Skip to content

Commit

Permalink
Adding tests for getdim() (#711)
Browse files Browse the repository at this point in the history
* enabling some disabled tests

* debugging

* more debugging of existing tests

* fixed tests for templates 30 and 90

* Update test_getdim.F90

* removing comment
  • Loading branch information
AlysonStahl-NOAA authored Jun 19, 2024
1 parent 58deb07 commit d1392d5
Showing 1 changed file with 24 additions and 28 deletions.
52 changes: 24 additions & 28 deletions tests/test_getdim.F90
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
program test_getdim
implicit none

integer, parameter :: lcsec3 = 72
integer, parameter :: lcsec3 = 120
character(len=1) :: csec3(lcsec3)
integer :: width, height, iscan

Expand All @@ -29,7 +29,11 @@ end subroutine gf_unpack3
achar(8), achar(0), achar(0), achar(0), achar(9), achar(0), achar(0), achar(0), achar(10), achar(0), achar(0), &
achar(0), achar(11), achar(0), achar(0), achar(0), achar(12), achar(13), achar(0), achar(0), achar(0), achar(14), &
achar(0), achar(0), achar(0), achar(15), achar(0), achar(0), achar(0), achar(16), achar(0), achar(0), achar(0), &
achar(17), achar(18) /)
achar(17), achar(18), achar(0), achar(0), achar(0), achar(0), achar(0), achar(0), achar(0), achar(0), achar(0), &
achar(0), achar(0), achar(0), achar(0), achar(0), achar(0), achar(0), achar(0), achar(0), achar(0), achar(0), &
achar(0), achar(0), achar(0), achar(0), achar(0), achar(0), achar(0), achar(0), achar(0), achar(0), achar(0), &
achar(0), achar(0), achar(0), achar(0), achar(0), achar(0), achar(0), achar(0), achar(0), achar(0), achar(0), &
achar(0), achar(0), achar(0), achar(0), achar(0), achar(0) /)

! Template num at pos 14 of section 3 = igds(5)

Expand All @@ -55,15 +59,12 @@ end subroutine gf_unpack3
if (height .ne. 8) stop 22
if (iscan .ne. 0) stop 32

! Uninitialized value memory error
if (.false.) then
print *, 'Template num 30 (Lambert Conformal)'
csec3(14) = achar(30)
call getdim(csec3, lcsec3, width, height, iscan)
if (width .ne. 7) stop 13
if (height .ne. 8) stop 23
if (iscan .ne. 0) stop 33
end if
print *, 'Template num 30 (Lambert Conformal)'
csec3(14) = achar(30)
call getdim(csec3, lcsec3, width, height, iscan)
if (width .ne. 7) stop 13
if (height .ne. 8) stop 23
if (iscan .ne. 0) stop 33

print *, 'Template num 40 (Gaussian)'
csec3(14) = achar(40)
Expand All @@ -72,14 +73,12 @@ end subroutine gf_unpack3
if (height .ne. 8) stop 24
if (iscan .ne. 18) stop 34

if (.false.) then
print *, 'Template num 90 (Space View/Orthographic)'
csec3(14) = achar(90)
call getdim(csec3, lcsec3, width, height, iscan)
if (width .ne. 7) stop 15
if (height .ne. 8) stop 25
if (iscan .ne. 0) stop 35
end if
print *, 'Template num 90 (Space View/Orthographic)'
csec3(14) = achar(90)
call getdim(csec3, lcsec3, width, height, iscan)
if (width .ne. 7) stop 15
if (height .ne. 8) stop 25
if (iscan .ne. 0) stop 35

print *, 'Template num 110 (Equatorial Azimuthal)'
csec3(14) = achar(110)
Expand All @@ -88,15 +87,12 @@ end subroutine gf_unpack3
if (height .ne. 8) stop 26
if (iscan .ne. 0) stop 36

! Uninitialized value memory error
if (.false.) then
print *, 'Template num 5 (Default case)'
csec3(14) = achar(5)
call getdim(csec3, lcsec3, width, height, iscan)
if (width .ne. 0) stop 17
if (height .ne. 0) stop 27
if (iscan .ne. 0) stop 37
end if
print *, 'Template num 5 (Default case)'
csec3(14) = achar(5)
call getdim(csec3, lcsec3, width, height, iscan)
if (width .ne. 0) stop 17
if (height .ne. 0) stop 27
if (iscan .ne. 0) stop 37

print *, 'Error in gf_unpack3 call'
csec3(14) = achar(99)
Expand Down

0 comments on commit d1392d5

Please sign in to comment.