diff --git a/src/adn30.f b/src/adn30.f index c9729edd..30d2f353 100644 --- a/src/adn30.f +++ b/src/adn30.f @@ -1,6 +1,6 @@ C> @file C> @brief Convert an FXY value from its bit-wise (integer) -C> representation to its five or six character representation +C> representation to its five or six character representation. C> C> @author J. Woollen @date 1994-01-06 @@ -8,14 +8,13 @@ C> (integer) representation to its 5 or 6 character C> representation. C> +C> This function is the logical inverse of function idn30(). +C> C> @param[in] IDN -- integer: Bit-wise representation of FXY value C> @param[in] L30 -- integer: Length of string to be returned; can be -C> either 5 or 6 characters +C> either 5 or 6 characters C> @returns adn30 -- character*(*): FXY value C> -C> @remarks -C> - This function is the logical inverse of function idn30(). -C> C> @author J. Woollen @date 1994-01-06 FUNCTION ADN30(IDN,L30) diff --git a/src/capit.f b/src/capit.f index a34c6b96..6e2ebbbb 100644 --- a/src/capit.f +++ b/src/capit.f @@ -1,12 +1,12 @@ C> @file -C> @brief Capitalize a character string +C> @brief Capitalize a character string. C> C> @author J. Woollen @date 2002-05-14 C> This subroutine capitalizes all of the alphabetic characters in -C> a string. The string is modified in place. +C> a string. The string is modified in place. C> -C> @param[in,out] STR -- character*(*): String +C> @param[in,out] STR - character*(*): String C> C> @author J. Woollen @date 2002-05-14 SUBROUTINE CAPIT(STR) diff --git a/src/cmpmsg.f b/src/cmpmsg.f index 3392ec8b..90a7c084 100644 --- a/src/cmpmsg.f +++ b/src/cmpmsg.f @@ -1,5 +1,5 @@ C> @file -C> @brief Specify the use of compression when writing BUFR messages +C> @brief Specify the use of compression when writing BUFR messages. C> C> @author J. Ator @date 2005-03-09 @@ -7,11 +7,6 @@ C> by future calls to [message-writing subroutines](@ref hierarchy) and C> [subset-writing subroutines](@ref hierarchy) are to be compressed. C> -C> @param[in] CF -- character*1: Flag indicating whether future BUFR -C> output messages are to be compressed -C> - 'N' = No (the default) -C> - 'Y' = Yes -C> C> This subroutine can be called at any time after the first call C> to subroutine openbf(), and the specified value for CF will remain C> in effect for all future calls to @@ -32,6 +27,11 @@ C> compression may provide little to no benefit, and which is why C> it is not activated by default. C> +C> @param[in] CF -- character*1: Flag indicating whether future BUFR +C> output messages are to be compressed +C> - 'N' = No (the default) +C> - 'Y' = Yes +C> C> @author J. Ator @date 2005-03-09 SUBROUTINE CMPMSG(CF) diff --git a/src/nemtab.f b/src/nemtab.f index 9aedd878..6a8a941c 100644 --- a/src/nemtab.f +++ b/src/nemtab.f @@ -1,5 +1,5 @@ C> @file -C> @brief Get information about a descriptor, based on the mnemonic +C> @brief Get information about a descriptor, based on the mnemonic. C> C> @author J. Woollen @date 1994-01-06 diff --git a/test/run_test_bort.sh b/test/run_test_bort.sh index 5cc7c061..2254547f 100644 --- a/test/run_test_bort.sh +++ b/test/run_test_bort.sh @@ -5,12 +5,54 @@ # # Ed Hartnett 3/12/23 +# Check adn30(). +./test_bort_4 adn30 1 +[ $? != 1 ] && exit 1 +./test_bort_4 adn30 2 +[ $? != 1 ] && exit 1 + +# Check bort(). ./test_bort_4 bort 1 [ $? != 1 ] && exit 1 -./test_bort_4 bort 2 +# Check bort2(). +./test_bort_4 bort2 1 [ $? != 1 ] && exit 1 +# Check bvers(). +./test_bort_4 bvers 1 +[ $? != 1 ] && exit 1 + +# Check cmpmsg(). +./test_bort_4 cmpmsg 1 +[ $? != 1 ] && exit 1 + +# Check wtstat(). +./test_bort_4 wtstat 1 +[ $? != 1 ] && exit 1 +./test_bort_4 wtstat 2 +[ $? != 1 ] && exit 1 +./test_bort_4 wtstat 3 +[ $? != 1 ] && exit 1 +./test_bort_4 wtstat 4 +[ $? != 1 ] && exit 1 + +# Check writdx(). +./test_bort_4 writdx 1 +[ $? != 1 ] && exit 1 + +# Check writlc(). +./test_bort_4 writlc 1 +[ $? != 1 ] && exit 1 + +# Check writsa(). +./test_bort_4 writsa 1 +[ $? != 1 ] && exit 1 + +# Check writsb(). +./test_bort_4 writsb 1 +[ $? != 1 ] && exit 1 + # If we made it here, all error codes were correctly returned, and the # test passed! exit 0 diff --git a/test/test_bort.F90 b/test/test_bort.F90 index 0c80195d..e655912e 100644 --- a/test/test_bort.F90 +++ b/test/test_bort.F90 @@ -6,9 +6,12 @@ ! Ed Hartnett 3/12/23 program test_bort implicit none + character*2 char_short + character*30 char_30 integer :: num_args, len, status character(len=32) :: sub_name, test_case + character adn30 num_args = command_argument_count() if (num_args /= 2) then @@ -25,12 +28,57 @@ program test_bort print *, 'Testing ', sub_name, ' case ', test_case ! Run the test for the subroutine and test case. - if (sub_name .eq. 'bort') then + if (sub_name .eq. 'adn30') then + if (test_case .eq. '1') then + char_short = adn30(0, 5) + elseif (test_case .eq. '2') then + char_30 = adn30(0, 9) + endif + elseif (sub_name .eq. 'bort') then if (test_case .eq. '1') then call bort('goodbye!') - else if (test_case .eq. '2') then + endif + elseif (sub_name .eq. 'bort2') then + if (test_case .eq. '1') then call bort2('goodbye!', 'goodbye again!') endif + elseif (sub_name .eq. 'bvers') then + if (test_case .eq. '1') then + call bvers(char_short) + endif + elseif (sub_name .eq. 'cmpmsg') then + if (test_case .eq. '1') then + call cmpmsg('W') + endif + elseif (sub_name .eq. 'writdx') then + if (test_case .eq. '1') then + call writdx(0, 0, 0) + endif + elseif (sub_name .eq. 'writlc') then + if (test_case .eq. '1') then + call writlc(0, char_30, char_30) + endif + elseif (sub_name .eq. 'writsa') then + if (test_case .eq. '1') then + call writsa(0, 0, 0, 0) + endif + elseif (sub_name .eq. 'writsb') then + if (test_case .eq. '1') then + call writsb(0) + endif + elseif (sub_name .eq. 'wtstat') then + if (test_case .eq. '1') then + call wtstat(0, 0, 0, 0) + elseif (test_case .eq. '2') then + call wtstat(1, 0, 0, 0) + elseif (test_case .eq. '3') then + call wtstat(1, 1, -2, 0) + elseif (test_case .eq. '4') then + call wtstat(1, 1, 0, -1) + endif + else + print *, "Unknown test function" + stop 2 endif end program test_bort