Skip to content

Commit

Permalink
Add unit test for 'read_mdl_dims'.
Browse files Browse the repository at this point in the history
  • Loading branch information
George Gayno committed Jan 7, 2025
1 parent 858629b commit e23b2fd
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/orog/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ execute_process( COMMAND ${CMAKE_COMMAND} -E copy
execute_process( COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_SOURCE_DIR}/data/topography.gmted2010.lowres.nc ${CMAKE_CURRENT_BINARY_DIR}/topography.gmted2010.30s.nc)

# Note, the "read_mdl_dims" test expects this file
execute_process( COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_SOURCE_DIR}/data/C12_grid.tile1.nc ${CMAKE_CURRENT_BINARY_DIR}/C12_grid.tile1.nc)

add_executable(ftst_ll2xyz ftst_ll2xyz.F90)
add_test(NAME orog-ftst_ll2xyz COMMAND ftst_ll2xyz)
target_link_libraries(ftst_ll2xyz orog_lib)
Expand Down Expand Up @@ -74,3 +78,7 @@ target_link_libraries(ftst_read_global_mask orog_lib)
add_executable(ftst_read_global_orog ftst_read_global_orog.F90)
add_test(NAME orog-ftst_read_global_orog COMMAND ftst_read_global_orog)
target_link_libraries(ftst_read_global_orog orog_lib)

add_executable(ftst_read_mdl_dims ftst_read_mdl_dims.F90)
add_test(NAME orog-ftst_read_mdl_dims COMMAND ftst_read_mdl_dims)
target_link_libraries(ftst_read_mdl_dims orog_lib)
Binary file added tests/orog/data/C12_grid.tile1.nc
Binary file not shown.
23 changes: 23 additions & 0 deletions tests/orog/ftst_read_mdl_dims.F90
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
program read_model_dims

use io_utils, only : read_mdl_dims

implicit none

character(len=19) :: mdl_grid_file

integer :: im, jm

print*,"- Begin test of routine read_mdl_dims."

mdl_grid_file="./C12_grid.tile1.nc"

call read_mdl_dims(mdl_grid_file,im,jm)

print*,'im/jm ',im,jm

print*,"OK"

print*,"SUCCESS"

end program read_model_dims

0 comments on commit e23b2fd

Please sign in to comment.