forked from ufs-community/UFS_UTILS
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
4 changed files
with
104 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# This is the cmake build file for the tests directory of the | ||
# UFS_UTILS project. | ||
# | ||
# George Gayno | ||
|
||
if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$") | ||
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -r8 -assume byterecl") | ||
elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$") | ||
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -ffree-line-length-0 -fdefault-real-8") | ||
endif() | ||
|
||
# Copy necessary test files from the source data directory to the | ||
# build data directory. | ||
execute_process( COMMAND ${CMAKE_COMMAND} -E copy | ||
${CMAKE_CURRENT_SOURCE_DIR}/data/config.nml ${CMAKE_CURRENT_BINARY_DIR}/fort.41) | ||
|
||
add_executable(ftst_program_setup_snow ftst_program_setup.F90) | ||
target_link_libraries(ftst_program_setup_snow snow2mdl_lib) | ||
add_test(NAME emcsfc_snow2mdl-ftst_program_setup COMMAND ftst_program_setup_snow) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
&source_data | ||
autosnow_file="autosnow.grb" | ||
nesdis_snow_file="imssnow96.grb" | ||
nesdis_lsmask_file="mask.grb" | ||
afwa_snow_global_file="global_snow.grb" | ||
afwa_snow_nh_file="NPR.SNWN.SP.S1200.MESH16" | ||
afwa_snow_sh_file="NPR.SNWS.SP.S1200.MESH16" | ||
afwa_lsmask_nh_file="afwa_mask.nh.bin" | ||
afwa_lsmask_sh_file="afwa_mask.sh.bin" | ||
/ | ||
&qc | ||
climo_qc_file="emcsfc_snow_cover_climo.grib2" | ||
/ | ||
&model_specs | ||
model_lat_file="global_latitudes.t1534.3072.1536.grb" | ||
model_lon_file="global_longitudes.t1534.3072.1536.grb" | ||
model_lsmask_file="global_slmask.t1534.3072.1536.grb" | ||
gfs_lpl_file="global_lonsperlat.t1534.3072.1536.txt" | ||
/ | ||
&output_data | ||
model_snow_file="snogrb_model" | ||
output_grib2=.false. | ||
/ | ||
&output_grib_time | ||
grib_year=2012 | ||
grib_month=10 | ||
grib_day=29 | ||
grib_hour=0 | ||
/ | ||
¶meters | ||
lat_threshold=55.0 | ||
min_snow_depth=0.05 | ||
snow_cvr_threshold=50.0 | ||
/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
program ftst_program_setup | ||
|
||
! Unit test for emc_snow2mdl utility, program_setup. | ||
! | ||
! Reads the program namelist and compares each | ||
! variable to expected values. | ||
! | ||
! Author: George Gayno | ||
|
||
use program_setup | ||
|
||
implicit none | ||
|
||
print*, "Starting test of program_setup." | ||
print*, "testing read_setup_namelist with file fort.41..." | ||
|
||
call read_config_nml | ||
|
||
if (trim(autosnow_file) /= "autosnow.grb") stop 2 | ||
if (trim(nesdis_snow_file) /= "imssnow96.grb") stop 3 | ||
if (trim(nesdis_lsmask_file) /= "mask.grb") stop 4 | ||
if (trim(afwa_snow_global_file) /= "global_snow.grb") stop 5 | ||
if (trim(afwa_snow_nh_file) /= "NPR.SNWN.SP.S1200.MESH16") stop 6 | ||
if (trim(afwa_snow_sh_file) /= "NPR.SNWS.SP.S1200.MESH16") stop 7 | ||
if (trim(afwa_lsmask_nh_file) /= "afwa_mask.nh.bin") stop 8 | ||
if (trim(afwa_lsmask_sh_file) /= "afwa_mask.sh.bin") stop 9 | ||
|
||
if (trim(climo_qc_file) /= "emcsfc_snow_cover_climo.grib2") stop 10 | ||
|
||
if (trim(model_lat_file) /= "global_latitudes.t1534.3072.1536.grb") stop 11 | ||
if (trim(model_lon_file) /= "global_longitudes.t1534.3072.1536.grb") stop 12 | ||
if (trim(model_lsmask_file) /= "global_slmask.t1534.3072.1536.grb") stop 13 | ||
if (trim(gfs_lpl_file) /= "global_lonsperlat.t1534.3072.1536.txt") stop 14 | ||
|
||
if (trim(model_snow_file) /= "snogrb_model") stop 15 | ||
if (output_grib2) stop 16 | ||
|
||
if (grib_year /= 12) stop 17 | ||
if (grib_month /= 10) stop 18 | ||
if (grib_day /= 29) stop 19 | ||
if (grib_hour /= 0) stop 20 | ||
|
||
if (lat_threshold /= 55.0) stop 22 | ||
if (min_snow_depth /= 0.05) stop 23 | ||
if (snow_cvr_threshold /= 50.0) stop 24 | ||
|
||
print*, "OK" | ||
print*, "SUCCESS!" | ||
|
||
end program ftst_program_setup |