From 1a16bfef08a13d8d33d5d122af89c125814eda3b Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Wed, 27 Apr 2022 17:43:48 +0100 Subject: [PATCH] ECC-1019: Add test (check -ve numbers) --- examples/F90/bufr_ecc-1019.f90 | 16 +++++++--------- examples/F90/bufr_ecc-1019.sh | 2 +- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/examples/F90/bufr_ecc-1019.f90 b/examples/F90/bufr_ecc-1019.f90 index eb5bc9bd0..2ca499996 100644 --- a/examples/F90/bufr_ecc-1019.f90 +++ b/examples/F90/bufr_ecc-1019.f90 @@ -9,11 +9,9 @@ program operator_3_test use eccodes implicit none - integer :: iret - integer :: outfile - integer :: ibufr - integer(kind=4), dimension(:), allocatable :: ivalues - character(len=100) :: outfile_name + integer :: iret, outfile, ibufr + integer(kind=4), dimension(:), allocatable :: ivalues + character(len=100) :: outfile_name call getarg(1, outfile_name) @@ -32,8 +30,7 @@ program operator_3_test ivalues=(/ 2,2,2 /) call codes_set(ibufr,'inputExtendedDelayedDescriptorReplicationFactor',ivalues) deallocate(ivalues) - - call codes_set(ibufr,'edition',4) + call codes_set(ibufr,'masterTableNumber',0) call codes_set(ibufr,'bufrHeaderCentre',254) call codes_set(ibufr,'bufrHeaderSubCentre',0) @@ -57,6 +54,7 @@ program operator_3_test allocate(ivalues(7)) ivalues = (/ 203015,025052,203255,025052,101000,031002,014046 /) + ! ivalues = (/ 025052,101000,031002,014046 /) call codes_set(ibufr,'unexpandedDescriptors',ivalues,iret) if (iret /= CODES_SUCCESS) then write(*,*)'codes_set failed for the unexpandedDescriptors' @@ -64,8 +62,8 @@ program operator_3_test endif deallocate(ivalues) - - call codes_set(ibufr,'log10OfPrincipalComponentsNormalizedFitToData',1.1) + ! Negative values can now be encoded + call codes_set(ibufr, 'log10OfPrincipalComponentsNormalizedFitToData', -1.1) allocate(ivalues(3)) ivalues = 0 diff --git a/examples/F90/bufr_ecc-1019.sh b/examples/F90/bufr_ecc-1019.sh index 83d89a7b8..ab71079fb 100755 --- a/examples/F90/bufr_ecc-1019.sh +++ b/examples/F90/bufr_ecc-1019.sh @@ -29,7 +29,7 @@ EOF cat $TEMP_TEXT cat > $TEMP_REF << EOF - log3=1.1 + log3=-1.1 ref=-16383 -16383 -16383 scR1=0 scR2=0