-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tests for bitmaps #768
Open
AlysonStahl-NOAA
wants to merge
23
commits into
NOAA-EMC:develop
Choose a base branch
from
AlysonStahl-NOAA:as_bitmap
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Tests for bitmaps #768
Changes from 4 commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
4e7fde8
bitmap test file
AlysonStahl-NOAA 2e9cf89
add test file
AlysonStahl-NOAA eef84e9
copy test data
AlysonStahl-NOAA 77d3b41
Update test_bitmap.F90
AlysonStahl-NOAA 43eb3db
Merge branch 'develop' into as_bitmap
AlysonStahl-NOAA 42f1e05
Update test_bitmap.F90
AlysonStahl-NOAA 3750879
debug memcheck
AlysonStahl-NOAA e24f72e
Update test_bitmap.F90
AlysonStahl-NOAA 2b223d2
debug test coverage
AlysonStahl-NOAA e9ffe0e
debug workflows
AlysonStahl-NOAA 1f2ddde
fix test coverage
AlysonStahl-NOAA 18a986d
debug failing workflows
AlysonStahl-NOAA 9170d2c
Update test_bitmap.F90
AlysonStahl-NOAA decec32
debugging
AlysonStahl-NOAA fe81cea
Update test_bitmap.F90
AlysonStahl-NOAA ae6ae36
debugging memory errors
AlysonStahl-NOAA 96aec93
undo last change
AlysonStahl-NOAA 556559a
debug
AlysonStahl-NOAA 4527471
Update test_bitmap.F90
AlysonStahl-NOAA d718e8e
debug
AlysonStahl-NOAA 867e553
Update test_bitmap.F90
AlysonStahl-NOAA da20177
remove comments
AlysonStahl-NOAA a594759
Update test_bitmap.F90
AlysonStahl-NOAA File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
! This is a test program for NCEPLIBS-g2. | ||
! | ||
! This program tests processing a GRIB2 file with bitmaps. | ||
! | ||
! Alyson Stahl 11/5/24 | ||
program test_bitmap | ||
use bacio_module | ||
use grib_mod | ||
implicit none | ||
|
||
character(*) :: BITMAP_FILE | ||
parameter(BITMAP_FILE = 'data/ref_png_bitmap.png') | ||
character(*) :: BITMAP_FILE_INDEX | ||
parameter(BITMAP_FILE_INDEX = 'test_bitmap_index.grb2index') | ||
|
||
integer :: lugi, lugb | ||
parameter(lugi = 11, lugb = 10) | ||
|
||
character(len=1), pointer, dimension(:) :: cbuf(:) | ||
integer :: idxver, myidxver, nlen, nnum, ifldnum, iret | ||
type(gribfield) :: gfld | ||
|
||
interface | ||
subroutine getg2i2(lugi, cbuf, idxver, nlen, nnum, iret) | ||
integer, intent(in) :: lugi | ||
character(len=1), pointer, dimension(:) :: cbuf | ||
integer, intent(out) :: idxver, nlen, nnum, iret | ||
end subroutine getg2i2 | ||
subroutine g2_create_index(lugb, lugi, idxver, filename, iret) | ||
integer, intent(in) :: lugb, lugi, idxver | ||
character*(*) :: filename | ||
integer, intent(out) :: iret | ||
end subroutine g2_create_index | ||
end interface | ||
|
||
! Open GRIB2 file for reading. | ||
call baopenr(lugb, BITMAP_FILE, iret) | ||
if (iret .ne. 0) stop 3 | ||
|
||
! Open output file where index will be written. | ||
call baopen(lugi, BITMAP_FILE_INDEX, iret) | ||
if (iret .ne. 0) stop 4 | ||
|
||
call g2_create_index(lugb, lugi, idxver, BITMAP_FILE, iret) | ||
if (iret .ne. 0) stop 5 | ||
|
||
call baclose(lugb, iret) | ||
if (iret .ne. 0) stop 6 | ||
|
||
! Read the index file. | ||
call getg2i2(lugi, cbuf, myidxver, nlen, nnum, iret) | ||
if (iret .ne. 0) stop 7 | ||
|
||
call baclose(lugi, iret) | ||
if (iret .ne. 0) stop 8 | ||
|
||
ifldnum = 6 | ||
call gf_getfld(cbuf, nlen, ifldnum, .true., .true., gfld, iret) | ||
if (iret .ne. 0) stop 9 | ||
|
||
! Free resources. | ||
call gf_free(gfld) | ||
|
||
print *, 'SUCCESS!' | ||
end program test_bitmap |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you check for more than just success? For example, you should know what myindexver, nlen, and nnum you will get back here. Check them too.