From 1bade53d19bb7c531e5bf16273684bf749d10b17 Mon Sep 17 00:00:00 2001 From: George Gayno Date: Thu, 9 Jan 2025 10:28:06 -0600 Subject: [PATCH] Baseline unit test for routine 'read_mask'. Fix doxygen in that routine. Fixes #1000. --- sorc/orog_mask_tools.fd/orog.fd/io_utils.F90 | 6 +- tests/orog/CMakeLists.txt | 8 ++ tests/orog/data/C48.mx500.tile1.nc | Bin 0 -> 55384 bytes tests/orog/ftst_read_mask.F90 | 82 +++++++++++++++++++ 4 files changed, 93 insertions(+), 3 deletions(-) create mode 100644 tests/orog/data/C48.mx500.tile1.nc create mode 100644 tests/orog/ftst_read_mask.F90 diff --git a/sorc/orog_mask_tools.fd/orog.fd/io_utils.F90 b/sorc/orog_mask_tools.fd/orog.fd/io_utils.F90 index a89d6e238..d6dc508cc 100644 --- a/sorc/orog_mask_tools.fd/orog.fd/io_utils.F90 +++ b/sorc/orog_mask_tools.fd/orog.fd/io_utils.F90 @@ -343,9 +343,9 @@ end subroutine write_mask_netcdf !> Read the land mask file !! !! @param[in] merge_file path -!! @param[in] slm Land-sea mask. -!! @param[in] land_frac Land fraction. -!! @param[in] lake_frac Lake fraction +!! @param[out] slm Land-sea mask. +!! @param[out] land_frac Land fraction. +!! @param[out] lake_frac Lake fraction !! @param[in] im 'i' dimension of a model grid tile. !! @param[in] jm 'j' dimension of a model grid tile. !! @author George Gayno NOAA/EMC diff --git a/tests/orog/CMakeLists.txt b/tests/orog/CMakeLists.txt index 7986143ea..ca02d8215 100644 --- a/tests/orog/CMakeLists.txt +++ b/tests/orog/CMakeLists.txt @@ -23,6 +23,10 @@ execute_process( COMMAND ${CMAKE_COMMAND} -E copy execute_process( COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/data/C12_grid.tile1.nc ${CMAKE_CURRENT_BINARY_DIR}/C12_grid.tile1.nc) +# Note, the "read_mask" test expects this file. +execute_process( COMMAND ${CMAKE_COMMAND} -E copy + ${CMAKE_CURRENT_SOURCE_DIR}/data/C48.mx500.tile1.nc ${CMAKE_CURRENT_BINARY_DIR}/C48.mx500.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) @@ -86,3 +90,7 @@ target_link_libraries(ftst_read_mdl_dims orog_lib) add_executable(ftst_read_mdl_grid_file ftst_read_mdl_grid_file.F90) add_test(NAME orog-ftst_read_mdl_grid_file COMMAND ftst_read_mdl_grid_file) target_link_libraries(ftst_read_mdl_grid_file orog_lib) + +add_executable(ftst_read_mask ftst_read_mask.F90) +add_test(NAME orog-ftst_read_mask COMMAND ftst_read_mask) +target_link_libraries(ftst_read_mask orog_lib) diff --git a/tests/orog/data/C48.mx500.tile1.nc b/tests/orog/data/C48.mx500.tile1.nc new file mode 100644 index 0000000000000000000000000000000000000000..51b5fc0a40eaee21145fa6b33a3dc215d82f0648 GIT binary patch literal 55384 zcmeI13vg7`8OQHtlMq6H@J7nxij0K;HX#HEA$u=jvmszeBtbxE37hPOEbJpD3mD`P zM@vPhP_T%V5zz`Z0y^a(uNIh5d{Y4jkSQ%Q7DfjZP#9}%rRUsxKlZ^s*xhq)vYqe3 z?sw1Y`~K&59(!}{s*SxNa%e%yV*1wo*`k->PZlB}ElU9gpae21=Rw zRHY2s1lsf@PDiU`X43C=diu?A#j@czXim}@U(ifFmqz|2b6lOh(c^At;<}N{56LHq zd}i3J{A7!Z=kxdxBlAa&%FoT?bFyYX ztap3YTz>auxEMa6u1y{*AQFf{UuYz>Wew~HTT$Tp1T z2bZ{=wtCAv8*k+6Jf8aetSncJ+t65RAPtA{Cb!k6WS-qqx3Jn!<95rR4lNjjYl1{$osI~}|(_YR-~LN1=`mB#g2LGDtdVb!P0!`l02QZct)He8Rs zQUiTEE^sCE4SXn6npwom7bf_ZK`4#nbX=q(hd@2`(i;-=D=s{_c1)rpSW?cT2m*_Tyy*nsTc@c7ysLNVKiFP7CJ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