Skip to content

Commit

Permalink
Merge pull request #383 from NOAA-EMC/ejh_error_3
Browse files Browse the repository at this point in the history
Testing more borts 2
  • Loading branch information
jbathegit authored Mar 16, 2023
2 parents bddfcaa + 1dee10b commit ffeff74
Show file tree
Hide file tree
Showing 8 changed files with 292 additions and 77 deletions.
20 changes: 10 additions & 10 deletions src/copysb.f
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,6 @@
C> This subroutine copies a BUFR data subset from one Fortran logical
C> unit to another.
C>
C> @param[in] LUNIN -- integer: Fortran logical unit number for
C> source BUFR file
C> @param[in] LUNOT -- integer: Fortran logical unit number for
C> target BUFR file
C> @param[out] IRET -- integer: return code
C> - 0 = normal return
C> - -1 = a BUFR data subset could not be
C> read from the BUFR message in
C> internal arrays for LUNIN
C>
C> Logical unit LUNIN should have already been opened for input
C> operations via a previous call to subroutine openbf(), and a BUFR
C> message should have already been read into internal arrays for
Expand All @@ -39,6 +29,16 @@
C> definitions for the type of BUFR message containing the data
C> subset to be copied from LUNIN to LUNOT.
C>
C> @param[in] LUNIN -- integer: Fortran logical unit number for
C> source BUFR file
C> @param[in] LUNOT -- integer: Fortran logical unit number for
C> target BUFR file
C> @param[out] IRET -- integer: return code
C> - 0 = normal return
C> - -1 = a BUFR data subset could not be
C> read from the BUFR message in
C> internal arrays for LUNIN
C>
C> @author J. Woollen @date 1994-01-06
RECURSIVE SUBROUTINE COPYSB(LUNIN,LUNOT,IRET)

Expand Down
12 changes: 6 additions & 6 deletions src/stndrd.f
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@
C> whereas stdmsg() operates on BUFR messages stored internally
C> within the software.
C>
C> @remarks
C> - MSGIN and MSGOT must be separate arrays.
C> - Standardized messages are usually longer in length than their
C> non-standard counterparts, so it's usually a good idea to allow
C> for extra space when allocating MSGOT within the application program.
C>
C> @param[in] LUNIT -- integer: Fortran logical unit number for
C> BUFR file
C> @param[in] MSGIN -- integer(*): BUFR message
Expand All @@ -17,12 +23,6 @@
C> it doesn't overflow the MSGOT array
C> @param[out] MSGOT -- integer(*): Standardized copy of MSGIN
C>
C> @remarks
C> - MSGIN and MSGOT must be separate arrays.
C> - Standardized messages are usually longer in length than their
C> non-standard counterparts, so it's usually a good idea to allow
C> for extra space when allocating MSGOT within the application program.
C>
C> @author J. Ator @date 2004-08-18
RECURSIVE SUBROUTINE STNDRD(LUNIT,MSGIN,LMSGOT,MSGOT)

Expand Down
20 changes: 10 additions & 10 deletions src/ufbcnt.f
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
C> @file
C> @brief Get the current message number and data subset number within
C> a BUFR file
C> a BUFR file.
C>
C> @author J. Woollen @date 1994-01-06

Expand All @@ -9,15 +9,6 @@
C> beginning of the file, and a data subset number counting from the
C> beginning of that message.
C>
C> @param[in] LUNIT -- integer: Fortran logical unit number for BUFR file
C> @param[out] KMSG -- integer: Ordinal number of current message,
C> counting from the beginning of the BUFR file, but
C> not counting any messages which contain DX BUFR
C> tables information
C> @param[out] KSUB -- integer: Ordinal number of current data subset
C> within (KMSG)th message, counting from the
C> beginning of the message
C>
C> @remarks
C> - Logical unit LUNIT should have already been opened via a previous
C> call to subroutine openbf(). If LUNIT was opened for input
Expand All @@ -33,6 +24,15 @@
C> - The value returned for KMSG does <b>not</b> include any messages
C> which contain DX BUFR tables information.
C>
C> @param[in] LUNIT -- integer: Fortran logical unit number for BUFR file
C> @param[out] KMSG -- integer: Ordinal number of current message,
C> counting from the beginning of the BUFR file, but
C> not counting any messages which contain DX BUFR
C> tables information
C> @param[out] KSUB -- integer: Ordinal number of current data subset
C> within (KMSG)th message, counting from the
C> beginning of the message
C>
C> @author J. Woollen @date 1994-01-06
RECURSIVE SUBROUTINE UFBCNT(LUNIT,KMSG,KSUB)

Expand Down
40 changes: 20 additions & 20 deletions src/ufbevn.f
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,6 @@
C> this subroutine is used for NCEP prepbufr files and stores the
C> same information internally within a COMMON block.
C>
C> @param[in] LUNIT -- integer: Fortran logical unit number for
C> NCEP prepbufr file
C> @param[out] USR -- real*8(*,*): Data values
C> @param[in] I1 -- integer: First dimension of USR as allocated
C> within the calling program
C> @param[in] I2 -- integer: Second dimension of USR as allocated
C> within the calling program
C> @param[in] I3 -- integer: Third dimension of USR as allocated
C> within the calling program
C> @param[out] IRET -- integer: Number of replications of STR that were
C> read from the data subset, corresponding
C> to the second dimension of USR
C> @param[in] STR -- character*(*): String of blank-separated
C> Table B mnemonics
C> in one-to-one correspondence with the number of data
C> values that will be read from the data
C> subset within the first dimension of USR (see
C> [DX BUFR Tables](@ref dfbftab) for further
C> information about Table B mnemonics)
C>
C> It is the user's responsibility to ensure that USR is dimensioned
C> sufficiently large enough to accommodate the number of data values
C> that are to be read from the data subset. Note also
Expand Down Expand Up @@ -70,6 +50,26 @@
C> the BUFR message pointed to by IREC, counting from
C> the beginning of the message
C>
C> @param[in] LUNIT -- integer: Fortran logical unit number for
C> NCEP prepbufr file
C> @param[out] USR -- real*8(*,*): Data values
C> @param[in] I1 -- integer: First dimension of USR as allocated
C> within the calling program
C> @param[in] I2 -- integer: Second dimension of USR as allocated
C> within the calling program
C> @param[in] I3 -- integer: Third dimension of USR as allocated
C> within the calling program
C> @param[out] IRET -- integer: Number of replications of STR that were
C> read from the data subset, corresponding
C> to the second dimension of USR
C> @param[in] STR -- character*(*): String of blank-separated
C> Table B mnemonics
C> in one-to-one correspondence with the number of data
C> values that will be read from the data
C> subset within the first dimension of USR (see
C> [DX BUFR Tables](@ref dfbftab) for further
C> information about Table B mnemonics)
C>
C> @author J. Woollen @date 1994-01-06
RECURSIVE SUBROUTINE UFBEVN(LUNIT,USR,I1,I2,I3,IRET,STR)

Expand Down
60 changes: 30 additions & 30 deletions src/ufbstp.f
Original file line number Diff line number Diff line change
Expand Up @@ -26,36 +26,6 @@
C> also designed for different use cases as noted in
C> [DX BUFR Tables](@ref ufbsubs).
C>
C> @param[in] LUNIN -- integer: Absolute value is Fortran logical
C> unit number for BUFR file
C> @param[in,out] USR -- real*8(*,*): Data values
C> - If ABS(LUNIN) was opened for input, then
C> USR is output from this subroutine and
C> contains data values that were read
C> from the current data subset.
C> - If ABS(LUNIN) was opened for output, then
C> USR is input to this subroutine and
C> contains data values that are to be
C> written to the current data subset.
C> @param[in] I1 -- integer: First dimension of USR as allocated
C> within the calling program
C> @param[in] I2 -- integer:
C> - If ABS(LUNIN) was opened for input, then I2
C> must be set equal to the second dimension
C> of USR as allocated within the calling program
C> - If ABS(LUNIN) was opened for output, then I2
C> must be set equal to the number of replications
C> of STR that are to be written to the data subset
C> @param[out] IRET -- integer: Number of replications of STR that were
C> read/written from/to the data subset
C> @param[in] STR -- character*(*): String of blank-separated
C> Table B mnemonics
C> in one-to-one correspondence with the number of data
C> values that will be read/written from/to the data
C> subset within the first dimension of USR (see
C> [DX BUFR Tables](@ref dfbftab) for further
C> information about Table B mnemonics)
C>
C> It is the user's responsibility to ensure that USR is dimensioned
C> sufficiently large enough to accommodate the number of data values
C> that are to be read from or written to the data subset. Note also
Expand Down Expand Up @@ -111,6 +81,36 @@
C> that need to read certain values back out from a BUFR file during
C> the same time that it is in the process of being written to.
C>
C> @param[in] LUNIN -- integer: Absolute value is Fortran logical
C> unit number for BUFR file
C> @param[in,out] USR -- real*8(*,*): Data values
C> - If ABS(LUNIN) was opened for input, then
C> USR is output from this subroutine and
C> contains data values that were read
C> from the current data subset.
C> - If ABS(LUNIN) was opened for output, then
C> USR is input to this subroutine and
C> contains data values that are to be
C> written to the current data subset.
C> @param[in] I1 -- integer: First dimension of USR as allocated
C> within the calling program
C> @param[in] I2 -- integer:
C> - If ABS(LUNIN) was opened for input, then I2
C> must be set equal to the second dimension
C> of USR as allocated within the calling program
C> - If ABS(LUNIN) was opened for output, then I2
C> must be set equal to the number of replications
C> of STR that are to be written to the data subset
C> @param[out] IRET -- integer: Number of replications of STR that were
C> read/written from/to the data subset
C> @param[in] STR -- character*(*): String of blank-separated
C> Table B mnemonics
C> in one-to-one correspondence with the number of data
C> values that will be read/written from/to the data
C> subset within the first dimension of USR (see
C> [DX BUFR Tables](@ref dfbftab) for further
C> information about Table B mnemonics)
C>
C> @author J. Woollen @date 1994-01-06
RECURSIVE SUBROUTINE UFBSTP(LUNIN,USR,I1,I2,IRET,STR)

Expand Down
2 changes: 1 addition & 1 deletion src/valx.f
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
C> @file
C> @brief Decode a real number from a character string
C> @brief Decode a real number from a character string.
C>
C> @author J. Woollen @date 1994-01-06

Expand Down
102 changes: 102 additions & 0 deletions test/run_test_bort.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,108 @@
./test_bort_4 cmpmsg 1
[ $? != 1 ] && exit 1

# Check codflg().
./test_bort_4 codflg 1
[ $? != 1 ] && exit 1

# Check copybf().
./test_bort_4 copybf 1
[ $? != 1 ] && exit 1

# Check copymg().
./test_bort_4 copymg 1
[ $? != 1 ] && exit 1

# Check copysb().
./test_bort_4 copysb 1
[ $? != 1 ] && exit 1

# Check sntbbe().
./test_bort_4 sntbbe 1
[ $? != 1 ] && exit 1

# Check sntbde().
./test_bort_4 sntbde 1
[ $? != 1 ] && exit 1

# Check stdmsg().
./test_bort_4 stdmsg 1
[ $? != 1 ] && exit 1

# Check stndrd().
./test_bort_4 stndrd 1
[ $? != 1 ] && exit 1

# Check strcpt().
./test_bort_4 strcpt 1
[ $? != 1 ] && exit 1

# Commented out until https://github.com/NOAA-EMC/NCEPLIBS-bufr/issues/384
# is resolved.
# Check string().
#./test_bort_4 string 1
#[ $? != 1 ] && exit 1

# Check ufbcnt().
./test_bort_4 ufbcnt 1
[ $? != 1 ] && exit 1

# Check ufbcpy().
./test_bort_4 ufbcpy 1
[ $? != 1 ] && exit 1

# Check ufbcup().
./test_bort_4 ufbcup 1
[ $? != 1 ] && exit 1

# Check ufbdmp().
./test_bort_4 ufbdmp 1
[ $? != 1 ] && exit 1

# Check ufbevn().
./test_bort_4 ufbevn 1
[ $? != 1 ] && exit 1

# Check ufbget().
./test_bort_4 ufbget 1
[ $? != 1 ] && exit 1

# Check ufbint().
./test_bort_4 ufbint 1
[ $? != 1 ] && exit 1

# Check ufbqcp().
./test_bort_4 ufbqcp 1
[ $? != 1 ] && exit 1

# Check ufbrep().
./test_bort_4 ufbrep 1
[ $? != 1 ] && exit 1

# Check ufbrms().
./test_bort_4 ufbrms 1
[ $? != 1 ] && exit 1

# Check ufbseq().
./test_bort_4 ufbseq 1
[ $? != 1 ] && exit 1

# Check ufdump().
./test_bort_4 ufdump 1
[ $? != 1 ] && exit 1

# Check upftbv().
./test_bort_4 upftbv 1
[ $? != 1 ] && exit 1

# Check valx().
./test_bort_4 valx 1
[ $? != 1 ] && exit 1

# Check wrdxtb().
./test_bort_4 wrdxtb 1
[ $? != 1 ] && exit 1

# Check wtstat().
./test_bort_4 wtstat 1
[ $? != 1 ] && exit 1
Expand Down
Loading

0 comments on commit ffeff74

Please sign in to comment.