ECC-1019: Add test (check -ve numbers)

This commit is contained in:
Shahram Najm 2022-04-27 17:43:48 +01:00
parent 0edd8a5818
commit 1a16bfef08
2 changed files with 8 additions and 10 deletions

View File

@ -9,9 +9,7 @@
program operator_3_test program operator_3_test
use eccodes use eccodes
implicit none implicit none
integer :: iret integer :: iret, outfile, ibufr
integer :: outfile
integer :: ibufr
integer(kind=4), dimension(:), allocatable :: ivalues integer(kind=4), dimension(:), allocatable :: ivalues
character(len=100) :: outfile_name character(len=100) :: outfile_name
@ -33,7 +31,6 @@ program operator_3_test
call codes_set(ibufr,'inputExtendedDelayedDescriptorReplicationFactor',ivalues) call codes_set(ibufr,'inputExtendedDelayedDescriptorReplicationFactor',ivalues)
deallocate(ivalues) deallocate(ivalues)
call codes_set(ibufr,'edition',4)
call codes_set(ibufr,'masterTableNumber',0) call codes_set(ibufr,'masterTableNumber',0)
call codes_set(ibufr,'bufrHeaderCentre',254) call codes_set(ibufr,'bufrHeaderCentre',254)
call codes_set(ibufr,'bufrHeaderSubCentre',0) call codes_set(ibufr,'bufrHeaderSubCentre',0)
@ -57,6 +54,7 @@ program operator_3_test
allocate(ivalues(7)) allocate(ivalues(7))
ivalues = (/ 203015,025052,203255,025052,101000,031002,014046 /) ivalues = (/ 203015,025052,203255,025052,101000,031002,014046 /)
! ivalues = (/ 025052,101000,031002,014046 /)
call codes_set(ibufr,'unexpandedDescriptors',ivalues,iret) call codes_set(ibufr,'unexpandedDescriptors',ivalues,iret)
if (iret /= CODES_SUCCESS) then if (iret /= CODES_SUCCESS) then
write(*,*)'codes_set failed for the unexpandedDescriptors' write(*,*)'codes_set failed for the unexpandedDescriptors'
@ -64,8 +62,8 @@ program operator_3_test
endif endif
deallocate(ivalues) deallocate(ivalues)
! Negative values can now be encoded
call codes_set(ibufr,'log10OfPrincipalComponentsNormalizedFitToData',1.1) call codes_set(ibufr, 'log10OfPrincipalComponentsNormalizedFitToData', -1.1)
allocate(ivalues(3)) allocate(ivalues(3))
ivalues = 0 ivalues = 0

View File

@ -29,7 +29,7 @@ EOF
cat $TEMP_TEXT cat $TEMP_TEXT
cat > $TEMP_REF << EOF cat > $TEMP_REF << EOF
log3=1.1 log3=-1.1
ref=-16383 -16383 -16383 ref=-16383 -16383 -16383
scR1=0 scR1=0
scR2=0 scR2=0