Skip to content

Commit

Permalink
Add unit test for new chgres_cube routine "dint2p".
Browse files Browse the repository at this point in the history
Fixes #555.
  • Loading branch information
GeorgeGayno-NOAA committed Jul 30, 2021
1 parent 32fdf16 commit c3bf3fb
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 0 deletions.
1 change: 1 addition & 0 deletions sorc/chgres_cube.fd/input_data.F90
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ module input_data
public :: quicksort
public :: convert_winds
public :: init_sfc_esmf_fields
public :: dint2p

contains

Expand Down
6 changes: 6 additions & 0 deletions tests/chgres_cube/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@ add_mpi_test(chgres_cube-ftst_sfc_input_data
NUMPROCS 4
TIMEOUT 60)

add_executable(ftst_dint2p ftst_dint2p.F90)
target_link_libraries(ftst_dint2p
chgres_cube_lib)

add_test(NAME chgres_cube-ftst_dint2p COMMAND ftst_dint2p)

add_executable(ftst_quicksort ftst_quicksort.F90)
target_link_libraries(ftst_quicksort
chgres_cube_lib)
Expand Down
35 changes: 35 additions & 0 deletions tests/chgres_cube/ftst_dint2p.F90
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
program ftst_dint2p

use input_data

implicit none

integer, parameter :: npin = 3
integer, parameter :: npout = 3

integer :: ier, linlog

real*8 :: ppin(npin), xxin(npin)
real*8 :: ppout(npout), xmsg
real*8 :: xxout(npout)

data ppin /1000., 700., 300./
data xxin /1., 2., 3. /
data ppout /850., 600., 400./

xmsg = -999.0

linlog = 1

call dint2p(ppin,xxin,npin,ppout,xxout,npout, &
linlog, xmsg, ier)

if (ier /= 0) stop 2
if (xxout(1) /= 1.5) stop 4
if (xxout(2) /= 2.25) stop 6
if (xxout(3) /= 2.75) stop 8

print*, "OK"
print*, "SUCCESS!"

end program ftst_dint2p

0 comments on commit c3bf3fb

Please sign in to comment.