From 57d2352a7d8fa422bf2f4c8fec8c3ecbacde2b5e Mon Sep 17 00:00:00 2001 From: Edward Hartnett Date: Tue, 14 Mar 2023 09:07:19 -0600 Subject: [PATCH 01/11] more bort testing --- src/ufbstp.f | 60 +++++++++++++++++++++---------------------- src/valx.f | 2 +- test/run_test_bort.sh | 32 +++++++++++++++++++++++ test/test_bort.F90 | 38 ++++++++++++++++++++++++++- 4 files changed, 100 insertions(+), 32 deletions(-) diff --git a/src/ufbstp.f b/src/ufbstp.f index 6791b436..5ace596b 100644 --- a/src/ufbstp.f +++ b/src/ufbstp.f @@ -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 @@ -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) diff --git a/src/valx.f b/src/valx.f index 2ea03f60..7824a027 100644 --- a/src/valx.f +++ b/src/valx.f @@ -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 diff --git a/test/run_test_bort.sh b/test/run_test_bort.sh index 2254547f..df5f2069 100644 --- a/test/run_test_bort.sh +++ b/test/run_test_bort.sh @@ -27,6 +27,38 @@ ./test_bort_4 cmpmsg 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 diff --git a/test/test_bort.F90 b/test/test_bort.F90 index 36a5ec38..4abfe8c3 100644 --- a/test/test_bort.F90 +++ b/test/test_bort.F90 @@ -6,8 +6,11 @@ ! Ed Hartnett 3/12/23 program test_bort implicit none + integer iret character*2 char_short character*30 char_30 + real r, valx + real*8 real_2d(1,1) integer :: num_args, len, status character(len=32) :: sub_name, test_case @@ -50,6 +53,38 @@ program test_bort if (test_case .eq. '1') then call cmpmsg('W') endif + elseif (sub_name .eq. 'ufbqcp') then + if (test_case .eq. '1') then + call ufbqcp(0, 0, 'c') + endif + elseif (sub_name .eq. 'ufbrep') then + if (test_case .eq. '1') then + call ufbrep(0, real_2d, 1, 2, iret, 'c') + endif + elseif (sub_name .eq. 'ufbrms') then + if (test_case .eq. '1') then + call ufbrms(1, 1, real_2d, 1, 2, iret, 'c') + endif + elseif (sub_name .eq. 'ufbseq') then + if (test_case .eq. '1') then + call ufbseq(0, real_2d, 1, 2, iret, 'c') + endif + elseif (sub_name .eq. 'ufdump') then + if (test_case .eq. '1') then + call ufdump(0, 0) + endif + elseif (sub_name .eq. 'upftbv') then + if (test_case .eq. '1') then + call upftbv(0, 'n', 1.0, 1, 1, 1) + endif + elseif (sub_name .eq. 'valx') then + if (test_case .eq. '1') then + r = valx('0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789') + endif + elseif (sub_name .eq. 'wrdxtb') then + if (test_case .eq. '1') then + call wrdxtb(0, 0) + endif elseif (sub_name .eq. 'writdx') then if (test_case .eq. '1') then call writdx(0, 0, 0) @@ -64,7 +99,8 @@ program test_bort endif elseif (sub_name .eq. 'writsb') then if (test_case .eq. '1') then - call writsb(0, 0, 0, 0) + call WRDXTB(0, 0) +! call writsb(0, 0, 0, 0) endif elseif (sub_name .eq. 'wtstat') then if (test_case .eq. '1') then From 17fa55f76f3b275fdcd38e4b8c382a9c6d9cd21d Mon Sep 17 00:00:00 2001 From: Edward Hartnett Date: Tue, 14 Mar 2023 09:09:58 -0600 Subject: [PATCH 02/11] more bort testing --- test/run_test_bort.sh | 4 ++++ test/test_bort.F90 | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/test/run_test_bort.sh b/test/run_test_bort.sh index df5f2069..d33a84d6 100644 --- a/test/run_test_bort.sh +++ b/test/run_test_bort.sh @@ -27,6 +27,10 @@ ./test_bort_4 cmpmsg 1 [ $? != 1 ] && exit 1 +# Check ufbint(). +./test_bort_4 ufbint 1 +[ $? != 1 ] && exit 1 + # Check ufbqcp(). ./test_bort_4 ufbqcp 1 [ $? != 1 ] && exit 1 diff --git a/test/test_bort.F90 b/test/test_bort.F90 index 4abfe8c3..710a164a 100644 --- a/test/test_bort.F90 +++ b/test/test_bort.F90 @@ -53,6 +53,10 @@ program test_bort if (test_case .eq. '1') then call cmpmsg('W') endif + elseif (sub_name .eq. 'ufbint') then + if (test_case .eq. '1') then + call ufbint(0, real_2d, 1, 2, iret, 'c') + endif elseif (sub_name .eq. 'ufbqcp') then if (test_case .eq. '1') then call ufbqcp(0, 0, 'c') From cf8e54af70c11e31b1790ebac16168a36ee9cb3f Mon Sep 17 00:00:00 2001 From: Edward Hartnett Date: Tue, 14 Mar 2023 09:20:47 -0600 Subject: [PATCH 03/11] more bort testing --- test/run_test_bort.sh | 8 ++++++++ test/test_bort.F90 | 9 +++++++++ 2 files changed, 17 insertions(+) diff --git a/test/run_test_bort.sh b/test/run_test_bort.sh index d33a84d6..4281e2c7 100644 --- a/test/run_test_bort.sh +++ b/test/run_test_bort.sh @@ -27,6 +27,14 @@ ./test_bort_4 cmpmsg 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 diff --git a/test/test_bort.F90 b/test/test_bort.F90 index 710a164a..f92b402c 100644 --- a/test/test_bort.F90 +++ b/test/test_bort.F90 @@ -10,6 +10,7 @@ program test_bort character*2 char_short character*30 char_30 real r, valx + real*8 real_1d(1) real*8 real_2d(1,1) integer :: num_args, len, status @@ -53,6 +54,14 @@ program test_bort if (test_case .eq. '1') then call cmpmsg('W') endif + elseif (sub_name .eq. 'ufbevn') then + if (test_case .eq. '1') then + call ufbevn(0, real_2d, 1, 2, 3, iret, 'c') + endif + elseif (sub_name .eq. 'ufbget') then + if (test_case .eq. '1') then + call ufbget(0, real_1d, 1, iret, 's') + endif elseif (sub_name .eq. 'ufbint') then if (test_case .eq. '1') then call ufbint(0, real_2d, 1, 2, iret, 'c') From aecba3f75f7af7d7fd6b29c81a6dcf8b5d4b5cca Mon Sep 17 00:00:00 2001 From: Edward Hartnett Date: Tue, 14 Mar 2023 09:22:02 -0600 Subject: [PATCH 04/11] more bort testing --- src/ufbevn.f | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/src/ufbevn.f b/src/ufbevn.f index d22365f3..df777b4d 100644 --- a/src/ufbevn.f +++ b/src/ufbevn.f @@ -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 @@ -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) From 03265e0b0c98b621d39f07e6a2d028aa0a1c98ca Mon Sep 17 00:00:00 2001 From: Edward Hartnett Date: Tue, 14 Mar 2023 09:27:33 -0600 Subject: [PATCH 05/11] more bort testing --- test/run_test_bort.sh | 12 ++++++++++++ test/test_bort.F90 | 12 ++++++++++++ 2 files changed, 24 insertions(+) diff --git a/test/run_test_bort.sh b/test/run_test_bort.sh index 4281e2c7..ff1b4630 100644 --- a/test/run_test_bort.sh +++ b/test/run_test_bort.sh @@ -27,6 +27,18 @@ ./test_bort_4 cmpmsg 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 diff --git a/test/test_bort.F90 b/test/test_bort.F90 index f92b402c..b0cad4a6 100644 --- a/test/test_bort.F90 +++ b/test/test_bort.F90 @@ -54,6 +54,18 @@ program test_bort if (test_case .eq. '1') then call cmpmsg('W') endif + elseif (sub_name .eq. 'ufbcpy') then + if (test_case .eq. '1') then + call ufbcpy(0, 0) + endif + elseif (sub_name .eq. 'ufbcup') then + if (test_case .eq. '1') then + call ufbcup(0, 0) + endif + elseif (sub_name .eq. 'ufbdmp') then + if (test_case .eq. '1') then + call ufbdmp(0, 0) + endif elseif (sub_name .eq. 'ufbevn') then if (test_case .eq. '1') then call ufbevn(0, real_2d, 1, 2, 3, iret, 'c') From 411fbe33f96c7e44cc30c9cf4d96bbf0e06554be Mon Sep 17 00:00:00 2001 From: Edward Hartnett Date: Tue, 14 Mar 2023 09:29:01 -0600 Subject: [PATCH 06/11] more bort testing --- src/ufbcnt.f | 20 ++++++++++---------- test/test_bort.F90 | 3 ++- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/ufbcnt.f b/src/ufbcnt.f index cb74a727..dd49e486 100644 --- a/src/ufbcnt.f +++ b/src/ufbcnt.f @@ -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 @@ -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 @@ -33,6 +24,15 @@ C> - The value returned for KMSG does not 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) diff --git a/test/test_bort.F90 b/test/test_bort.F90 index b0cad4a6..5819791b 100644 --- a/test/test_bort.F90 +++ b/test/test_bort.F90 @@ -56,7 +56,8 @@ program test_bort endif elseif (sub_name .eq. 'ufbcpy') then if (test_case .eq. '1') then - call ufbcpy(0, 0) + call ufbcnt(0, 1, 1) +`! call ufbcpy(0, 0) endif elseif (sub_name .eq. 'ufbcup') then if (test_case .eq. '1') then From 231d7d73f4c9c7a5ab9d047150c63daf1fca98e8 Mon Sep 17 00:00:00 2001 From: Edward Hartnett Date: Tue, 14 Mar 2023 09:30:29 -0600 Subject: [PATCH 07/11] more bort testing --- test/run_test_bort.sh | 4 ++++ test/test_bort.F90 | 7 +++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/test/run_test_bort.sh b/test/run_test_bort.sh index ff1b4630..42845141 100644 --- a/test/run_test_bort.sh +++ b/test/run_test_bort.sh @@ -27,6 +27,10 @@ ./test_bort_4 cmpmsg 1 [ $? != 1 ] && exit 1 +# Check ufbcnt(). +./test_bort_4 ufbcnt 1 +[ $? != 1 ] && exit 1 + # Check ufbcpy(). ./test_bort_4 ufbcpy 1 [ $? != 1 ] && exit 1 diff --git a/test/test_bort.F90 b/test/test_bort.F90 index 5819791b..cee165b6 100644 --- a/test/test_bort.F90 +++ b/test/test_bort.F90 @@ -54,10 +54,13 @@ program test_bort if (test_case .eq. '1') then call cmpmsg('W') endif - elseif (sub_name .eq. 'ufbcpy') then + elseif (sub_name .eq. 'ufbcnt') then if (test_case .eq. '1') then call ufbcnt(0, 1, 1) -`! call ufbcpy(0, 0) + endif + elseif (sub_name .eq. 'ufbcpy') then + if (test_case .eq. '1') then + call ufbcpy(0, 0) endif elseif (sub_name .eq. 'ufbcup') then if (test_case .eq. '1') then From 7b8977aa6f4b539eee30c674d2ebfa612d266231 Mon Sep 17 00:00:00 2001 From: Edward Hartnett Date: Tue, 14 Mar 2023 09:54:00 -0600 Subject: [PATCH 08/11] more bort testing --- src/stndrd.f | 12 ++++++------ test/run_test_bort.sh | 14 ++++++++++++++ test/test_bort.F90 | 16 ++++++++++++++++ 3 files changed, 36 insertions(+), 6 deletions(-) diff --git a/src/stndrd.f b/src/stndrd.f index 2b04f827..4cbfa76f 100644 --- a/src/stndrd.f +++ b/src/stndrd.f @@ -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 @@ -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) diff --git a/test/run_test_bort.sh b/test/run_test_bort.sh index 42845141..6e0df3d9 100644 --- a/test/run_test_bort.sh +++ b/test/run_test_bort.sh @@ -27,6 +27,20 @@ ./test_bort_4 cmpmsg 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 diff --git a/test/test_bort.F90 b/test/test_bort.F90 index cee165b6..e28d05c1 100644 --- a/test/test_bort.F90 +++ b/test/test_bort.F90 @@ -7,6 +7,8 @@ program test_bort implicit none integer iret + ! integer i1 + integer int_1d(1), int_1d_2(1) character*2 char_short character*30 char_30 real r, valx @@ -54,6 +56,20 @@ program test_bort if (test_case .eq. '1') then call cmpmsg('W') endif + elseif (sub_name .eq. 'stndrd') then + if (test_case .eq. '1') then + call stndrd(0, int_1d, 1, int_1d_2) + endif + elseif (sub_name .eq. 'strcpt') then + if (test_case .eq. '1') then + call strcpt('W', 1960, 12, 15, 12, 0) + endif + ! Next test commented out until + ! https://github.com/NOAA-EMC/NCEPLIBS-bufr/issues/384 is resolved. + ! elseif (sub_name .eq. 'string') then if (test_case .eq. '1') then + ! call + ! STRING('0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789', + ! & 1, i1, 0) endif elseif (sub_name .eq. 'ufbcnt') then if (test_case .eq. '1') then call ufbcnt(0, 1, 1) From 46411f8fe0626797306b269f6c68231b812fd82c Mon Sep 17 00:00:00 2001 From: Edward Hartnett Date: Tue, 14 Mar 2023 10:06:38 -0600 Subject: [PATCH 09/11] more bort testing --- test/run_test_bort.sh | 8 ++++++++ test/test_bort.F90 | 11 +++++++++++ 2 files changed, 19 insertions(+) diff --git a/test/run_test_bort.sh b/test/run_test_bort.sh index 6e0df3d9..66716f9e 100644 --- a/test/run_test_bort.sh +++ b/test/run_test_bort.sh @@ -27,6 +27,14 @@ ./test_bort_4 cmpmsg 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 diff --git a/test/test_bort.F90 b/test/test_bort.F90 index e28d05c1..fdd03a9a 100644 --- a/test/test_bort.F90 +++ b/test/test_bort.F90 @@ -11,6 +11,9 @@ program test_bort integer int_1d(1), int_1d_2(1) character*2 char_short character*30 char_30 + character*4 char_4(1) + character*8 char_8(1) + character*120 char_120(1) real r, valx real*8 real_1d(1) real*8 real_2d(1,1) @@ -56,6 +59,14 @@ program test_bort if (test_case .eq. '1') then call cmpmsg('W') endif + elseif (sub_name .eq. 'sntbde') then + if (test_case .eq. '1') then + call sntbde(0, 0, 'c', 1, 1, 2, int_1d, char_8, char_4, char_120, int_1d_2, int_1d, char_120) + endif + elseif (sub_name .eq. 'stdmsg') then + if (test_case .eq. '1') then + call stdmsg('W') + endif elseif (sub_name .eq. 'stndrd') then if (test_case .eq. '1') then call stndrd(0, int_1d, 1, int_1d_2) From 0ef3a521d55e6c609b0d548e975cba8d3c294702 Mon Sep 17 00:00:00 2001 From: Edward Hartnett Date: Tue, 14 Mar 2023 10:13:40 -0600 Subject: [PATCH 10/11] more bort testing --- test/run_test_bort.sh | 4 ++++ test/test_bort.F90 | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/test/run_test_bort.sh b/test/run_test_bort.sh index 66716f9e..ea743fc9 100644 --- a/test/run_test_bort.sh +++ b/test/run_test_bort.sh @@ -27,6 +27,10 @@ ./test_bort_4 cmpmsg 1 [ $? != 1 ] && exit 1 +# Check sntbbe(). +./test_bort_4 sntbbe 1 +[ $? != 1 ] && exit 1 + # Check sntbde(). ./test_bort_4 sntbde 1 [ $? != 1 ] && exit 1 diff --git a/test/test_bort.F90 b/test/test_bort.F90 index fdd03a9a..2a1f6e87 100644 --- a/test/test_bort.F90 +++ b/test/test_bort.F90 @@ -13,6 +13,8 @@ program test_bort character*30 char_30 character*4 char_4(1) character*8 char_8(1) + character*12 char_12(1) + character*24 char_24(1) character*120 char_120(1) real r, valx real*8 real_1d(1) @@ -59,6 +61,10 @@ program test_bort if (test_case .eq. '1') then call cmpmsg('W') endif + elseif (sub_name .eq. 'sntbbe') then + if (test_case .eq. '1') then + call sntbbe(0, 'c', 1, 2, int_1d, char_4, char_12, char_4, char_24, char_8, char_4, char_120) + endif elseif (sub_name .eq. 'sntbde') then if (test_case .eq. '1') then call sntbde(0, 0, 'c', 1, 1, 2, int_1d, char_8, char_4, char_120, int_1d_2, int_1d, char_120) From 088f2faa7458692d186996e9e3b688004f076b67 Mon Sep 17 00:00:00 2001 From: Edward Hartnett Date: Tue, 14 Mar 2023 10:32:43 -0600 Subject: [PATCH 11/11] more bort testing --- src/copysb.f | 20 ++++++++++---------- test/run_test_bort.sh | 16 ++++++++++++++++ test/test_bort.F90 | 16 ++++++++++++++++ 3 files changed, 42 insertions(+), 10 deletions(-) diff --git a/src/copysb.f b/src/copysb.f index e5f026da..76f503b8 100644 --- a/src/copysb.f +++ b/src/copysb.f @@ -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 @@ -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) diff --git a/test/run_test_bort.sh b/test/run_test_bort.sh index ea743fc9..de650c13 100644 --- a/test/run_test_bort.sh +++ b/test/run_test_bort.sh @@ -27,6 +27,22 @@ ./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 diff --git a/test/test_bort.F90 b/test/test_bort.F90 index 2a1f6e87..911ebaaa 100644 --- a/test/test_bort.F90 +++ b/test/test_bort.F90 @@ -61,6 +61,22 @@ program test_bort if (test_case .eq. '1') then call cmpmsg('W') endif + elseif (sub_name .eq. 'codflg') then + if (test_case .eq. '1') then + call codflg('W') + endif + elseif (sub_name .eq. 'copybf') then + if (test_case .eq. '1') then + call copybf(0, 0) + endif + elseif (sub_name .eq. 'copymg') then + if (test_case .eq. '1') then + call copymg(0, 0) + endif + elseif (sub_name .eq. 'copysb') then + if (test_case .eq. '1') then + call copysb(0, 0, iret) + endif elseif (sub_name .eq. 'sntbbe') then if (test_case .eq. '1') then call sntbbe(0, 'c', 1, 2, int_1d, char_4, char_12, char_4, char_24, char_8, char_4, char_120)