-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into ejh_error_3
- Loading branch information
Showing
9 changed files
with
122 additions
and
21 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,7 +50,7 @@ jobs: | |
uses: actions/cache@v2 | ||
with: | ||
path: ~/data | ||
key: data-3 | ||
key: data-4 | ||
|
||
- name: build | ||
run: | | ||
|
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 |
---|---|---|
|
@@ -41,7 +41,7 @@ jobs: | |
uses: actions/cache@v2 | ||
with: | ||
path: ~/data | ||
key: data-3 | ||
key: data-4 | ||
|
||
- name: build | ||
run: | | ||
|
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 |
---|---|---|
|
@@ -37,7 +37,7 @@ jobs: | |
uses: actions/cache@v2 | ||
with: | ||
path: ~/data | ||
key: data-3 | ||
key: data-4 | ||
|
||
- name: build-bufr | ||
run: | | ||
|
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 |
---|---|---|
|
@@ -38,7 +38,7 @@ jobs: | |
uses: actions/cache@v2 | ||
with: | ||
path: ~/data | ||
key: data-3 | ||
key: data-4 | ||
|
||
- name: build | ||
run: | | ||
|
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
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
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,99 @@ | ||
! This is a test for NCEPLIBS-bufr. | ||
! | ||
! Reads test file 'testfiles/IN_10' to test ERRWRT branches in ARALLOCF, UFBMEM, UFBMEX, and OPENBT. | ||
! | ||
! J. Ator, 3/13/2023 | ||
|
||
module Share_errstr | ||
! This module is needed in order to share information between the test program and subroutine errwrt, because | ||
! the latter is not called by the former but rather is called directly from within the BUFRLIB software. | ||
|
||
character*4000 errstr | ||
|
||
integer errstr_len | ||
end module Share_errstr | ||
|
||
subroutine errwrt(str) | ||
! This subroutine supersedes the subroutine of the same name within the BUFRLIB software, so that we can | ||
! easily test the generation of error messages from within the library. | ||
|
||
use Share_errstr | ||
|
||
character*(*) str | ||
|
||
integer str_len | ||
|
||
str_len = len(str) | ||
errstr ( errstr_len + 1 : errstr_len + str_len + 1 ) = str | ||
errstr_len = errstr_len + str_len | ||
|
||
return | ||
end subroutine errwrt | ||
|
||
program intest10 | ||
use Share_errstr | ||
|
||
implicit none | ||
|
||
integer*4 isetprm | ||
|
||
integer icnt, iunt, imesg(150), idate, iret, ios1, ios2, lundx | ||
|
||
character cmgtag*8 | ||
|
||
print *, 'Testing reading IN_10 to test ERRWRT branches in ARALLOCF, UFBMEM, UFBMEX, and OPENBT' | ||
|
||
#ifdef KIND_8 | ||
call setim8b ( .true. ) | ||
#endif | ||
|
||
if ( ( isetprm ( 'MAXMSG', 125 ) .ne. 0 ) .or. ( isetprm ( 'MAXMEM', 125000 ) .ne. 0 ) ) stop 1 | ||
|
||
! Test some various out-of-bounds verbosity settings, and test the errwrt branch in arallocf. | ||
! The verbosity level is the 3rd argument whenever the 2nd argument to openbf is 'QUIET'. Any | ||
! request greater than 3 should automatically reset internally to the max value of 2, and any | ||
! request less than -1 should automatically reset internally to the min value of -1. | ||
errstr_len = 0 | ||
call openbf ( 21, 'QUIET', 3 ) | ||
if ( index( errstr(1:errstr_len), 'ARRAYS WILL BE DYNAMICALLY ALLOCATED USING THE FOLLOWING VALUES' ) .eq. 0 ) stop 2 | ||
call openbf ( 21, 'QUIET', -2 ) | ||
call openbf ( 21, 'QUIET', 1 ) | ||
|
||
! Test the errwrt branches in ufbmem. | ||
open ( unit = 21, file = 'testfiles/IN_10_infile1', form = 'unformatted', iostat = ios1 ) | ||
open ( unit = 22, file = 'testfiles/IN_10_infile2', form = 'unformatted', iostat = ios2 ) | ||
if ( ( ios1 .ne. 0 ) .or. ( ios2 .ne. 0 ) ) stop 3 | ||
errstr_len = 0 | ||
call ufbmem ( 21, 0, icnt, iunt ) | ||
if ( ( icnt .ne. 125 ) .or. & | ||
( index( errstr(1:errstr_len), 'UFBMEM - THE NO. OF MESSAGES REQUIRED TO STORE ALL MESSAGES' ) .eq. 0 ) ) stop 4 | ||
call ufbmem ( 22, 0, icnt, iunt ) | ||
if ( ( icnt .ne. 97 ) .or. & | ||
( index( errstr(1:errstr_len), 'UFBMEM - THE NO. OF BYTES REQUIRED TO STORE ALL MESSAGES' ) .eq. 0 ) ) stop 5 | ||
|
||
! Reset the input files. | ||
call closbf ( 21 ) | ||
call closbf ( 22 ) | ||
open ( unit = 21, file = 'testfiles/IN_10_infile1', form = 'unformatted', iostat = ios1 ) | ||
open ( unit = 22, file = 'testfiles/IN_10_infile2', form = 'unformatted', iostat = ios2 ) | ||
if ( ( ios1 .ne. 0 ) .or. ( ios2 .ne. 0 ) ) stop 6 | ||
|
||
! Test the errwrt branches in ufbmex. | ||
errstr_len = 0 | ||
call ufbmex ( 21, 21, 0, icnt, imesg ) | ||
if ( ( icnt .ne. 125 ) .or. & | ||
( index( errstr(1:errstr_len), 'UFBMEX - THE NO. OF MESSAGES REQUIRED TO STORE ALL MESSAGES' ) .eq. 0 ) ) stop 7 | ||
call ufbmex ( 22, 22, 0, icnt, imesg ) | ||
if ( ( icnt .ne. 97 ) .or. & | ||
( index( errstr(1:errstr_len), 'UFBMEX - THE NO. OF BYTES REQUIRED TO STORE ALL MESSAGES' ) .eq. 0 ) ) stop 8 | ||
|
||
! Test the errwrt branch in openbt, both indirectly and directly. | ||
errstr_len = 0 | ||
call rdmemm ( 50, cmgtag, idate, iret ) | ||
if ( index( errstr(1:errstr_len), 'OPENBT - THIS IS A DUMMY BUFRLIB ROUTINE' ) .eq. 0 ) stop 9 | ||
errstr_len = 0 | ||
call openbt ( lundx, 255 ) | ||
if ( index( errstr(1:errstr_len), 'OPENBT - THIS IS A DUMMY BUFRLIB ROUTINE' ) .eq. 0 ) stop 10 | ||
|
||
print *, 'SUCCESS!' | ||
end program intest10 |
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
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