-
Notifications
You must be signed in to change notification settings - Fork 147
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/main' into prepbufr_docs
- Loading branch information
Showing
18 changed files
with
576 additions
and
799 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
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
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,85 @@ | ||
! DART software - Copyright UCAR. This open source software is provided | ||
! by UCAR, "as is", without charge, subject to all terms of use at | ||
! http://www.image.ucar.edu/DAReS/DART/DART_download | ||
|
||
program test_parse_variables | ||
|
||
use utilities_mod, only : find_namelist_in_file, check_namelist_read, & | ||
initialize_utilities, finalize_utilities | ||
use types_mod, only : vtablenamelength, MISSING_R8, r8 | ||
use default_model_mod, only : parse_variables_clamp, parse_variables, & | ||
state_var_type, & | ||
MAX_STATE_VARIABLE_FIELDS_CLAMP, & | ||
MAX_STATE_VARIABLE_FIELDS | ||
use obs_kind_mod, only : QTY_SALINITY, QTY_POTENTIAL_TEMPERATURE, & | ||
QTY_U_CURRENT_COMPONENT | ||
|
||
use test ! fortran-testanything | ||
|
||
implicit none | ||
|
||
integer :: iunit, io | ||
type(state_var_type) :: state_vars, state_vars_clamp | ||
|
||
character(len=vtablenamelength) :: state_variables(MAX_STATE_VARIABLE_FIELDS) = ' ' | ||
character(len=vtablenamelength) :: state_variables_clamp(MAX_STATE_VARIABLE_FIELDS_CLAMP) = ' ' | ||
|
||
namelist /model_nml/ & | ||
state_variables | ||
|
||
namelist /model_nml_clamp/ & | ||
state_variables_clamp | ||
|
||
call initialize_utilities('test_parse_variables') | ||
|
||
call plan(28) | ||
|
||
! Using namelist entry WITHOUT clamping values | ||
|
||
call find_namelist_in_file('input.nml', 'model_nml', iunit) | ||
read(iunit, nml = model_nml, iostat = io) | ||
call check_namelist_read(iunit, io, 'model_nml') | ||
|
||
state_vars = parse_variables(state_variables) | ||
|
||
call ok(state_vars%nvars == 3) | ||
call ok(state_vars%netcdf_var_names(1) == 'SALT_CUR') | ||
call ok(state_vars%netcdf_var_names(2) == 'TEMP_CUR') | ||
call ok(state_vars%netcdf_var_names(3) == 'UVEL_CUR') | ||
call ok(state_vars%qtys(1) == QTY_SALINITY) | ||
call ok(state_vars%qtys(2) == QTY_POTENTIAL_TEMPERATURE) | ||
call ok(state_vars%qtys(3) == QTY_U_CURRENT_COMPONENT) | ||
call ok(allocated(state_vars_clamp%clamp_values) .eqv. .false.) | ||
call ok(state_vars%updates(1) .eqv. .true.) | ||
call ok(state_vars%updates(2) .eqv. .false.) | ||
call ok(state_vars%updates(3) .eqv. .true.) | ||
|
||
! Using namelist entry WITH clamping values | ||
|
||
call find_namelist_in_file('input.nml', 'model_nml_clamp', iunit) | ||
read(iunit, nml = model_nml_clamp, iostat = io) | ||
call check_namelist_read(iunit, io, 'model_nml_clamp') | ||
|
||
state_vars_clamp = parse_variables_clamp(state_variables_clamp) | ||
|
||
call ok(state_vars_clamp%nvars == 3) | ||
call ok(state_vars_clamp%netcdf_var_names(1) == 'SALT_CUR') | ||
call ok(state_vars_clamp%netcdf_var_names(2) == 'TEMP_CUR') | ||
call ok(state_vars_clamp%netcdf_var_names(3) == 'UVEL_CUR') | ||
call ok(state_vars_clamp%qtys(1) == QTY_SALINITY) | ||
call ok(state_vars_clamp%qtys(2) == QTY_POTENTIAL_TEMPERATURE) | ||
call ok(state_vars_clamp%qtys(3) == QTY_U_CURRENT_COMPONENT) | ||
call ok(allocated(state_vars_clamp%clamp_values) .eqv. .true.) | ||
call ok(state_vars_clamp%clamp_values(1,1) == 0.0_r8) | ||
call ok(state_vars_clamp%clamp_values(1,2) == 0.0_r8) | ||
call ok(state_vars_clamp%clamp_values(2,1) == 0.0_r8) | ||
call ok(state_vars_clamp%clamp_values(2,2) == 0.0_r8) | ||
call ok(state_vars_clamp%clamp_values(3,1) == 0.0_r8) | ||
call ok(state_vars_clamp%clamp_values(3,2) == 0.0_r8) | ||
call ok(state_vars_clamp%updates(1) .eqv. .true.) | ||
call ok(state_vars_clamp%updates(2) .eqv. .false.) | ||
call ok(state_vars_clamp%updates(3) .eqv. .true.) | ||
|
||
call finalize_utilities() | ||
|
||
end program test_parse_variables |
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,67 @@ | ||
&model_nml_clamp | ||
state_variables_clamp = 'SALT_CUR ', 'QTY_SALINITY', '0.0', '0.0', 'UPDATE', | ||
'TEMP_CUR ', 'QTY_POTENTIAL_TEMPERATURE', '0.0', '0.0', 'NO_COPY_BACK', | ||
'UVEL_CUR ', 'QTY_U_CURRENT_COMPONENT ', '0', '0.0', 'UPDATE', | ||
/ | ||
|
||
&model_nml | ||
state_variables = 'SALT_CUR ', 'QTY_SALINITY', 'UPDATE', | ||
'TEMP_CUR ', 'QTY_POTENTIAL_TEMPERATURE', 'NO_COPY_BACK', | ||
'UVEL_CUR ', 'QTY_U_CURRENT_COMPONENT ', 'update' | ||
/ | ||
|
||
&utilities_nml | ||
module_details = .false. | ||
write_nml = 'none' | ||
/ | ||
|
||
&preprocess_nml | ||
input_obs_kind_mod_file = '../../../assimilation_code/modules/observations/DEFAULT_obs_kind_mod.F90' | ||
quantity_files = '../../../assimilation_code/modules/observations/land_quantities_mod.f90', | ||
'../../../assimilation_code/modules/observations/default_quantities_mod.f90' | ||
'../../../assimilation_code/modules/observations/atmosphere_quantities_mod.f90' | ||
'../../../assimilation_code/modules/observations/ocean_quantities_mod.f90' | ||
output_obs_kind_mod_file = '../../../assimilation_code/modules/observations/obs_kind_mod.f90' | ||
input_obs_def_mod_file = '../../../observations/forward_operators/DEFAULT_obs_def_mod.F90' | ||
output_obs_def_mod_file = '../../../observations/forward_operators/obs_def_mod.f90' | ||
input_files = '../../../observations/forward_operators/obs_def_AIRS_mod.f90', | ||
'../../../observations/forward_operators/obs_def_AOD_mod.f90', | ||
'../../../observations/forward_operators/obs_def_AURA_mod.f90', | ||
'../../../observations/forward_operators/obs_def_COSMOS_mod.f90', | ||
'../../../observations/forward_operators/obs_def_CO_Nadir_mod.f90', | ||
'../../../observations/forward_operators/obs_def_GWD_mod.f90', | ||
'../../../observations/forward_operators/obs_def_QuikSCAT_mod.f90', | ||
'../../../observations/forward_operators/obs_def_SABER_mod.f90', | ||
'../../../observations/forward_operators/obs_def_altimeter_mod.f90', | ||
'../../../observations/forward_operators/obs_def_cloud_mod.f90', | ||
'../../../observations/forward_operators/obs_def_dew_point_mod.f90', | ||
'../../../observations/forward_operators/obs_def_dwl_mod.f90', | ||
'../../../observations/forward_operators/obs_def_eval_mod.f90', | ||
'../../../observations/forward_operators/obs_def_gps_mod.f90', | ||
'../../../observations/forward_operators/obs_def_gts_mod.f90', | ||
'../../../observations/forward_operators/obs_def_land_mod.f90', | ||
'../../../observations/forward_operators/obs_def_metar_mod.f90', | ||
'../../../observations/forward_operators/obs_def_ocean_mod.f90', | ||
'../../../observations/forward_operators/obs_def_pe2lyr_mod.f90', | ||
'../../../observations/forward_operators/obs_def_radar_mod.f90', | ||
'../../../observations/forward_operators/obs_def_reanalysis_bufr_mod.f90', | ||
'../../../observations/forward_operators/obs_def_rel_humidity_mod.f90', | ||
'../../../observations/forward_operators/obs_def_sqg_mod.f90', | ||
'../../../observations/forward_operators/obs_def_tower_mod.f90', | ||
'../../../observations/forward_operators/obs_def_tpw_mod.f90', | ||
'../../../observations/forward_operators/obs_def_upper_atm_mod.f90', | ||
'../../../observations/forward_operators/obs_def_vortex_mod.f90', | ||
'../../../observations/forward_operators/obs_def_wind_speed_mod.f90' | ||
/ | ||
|
||
&mpi_utilities_nml | ||
/ | ||
|
||
&obs_kind_nml | ||
/ | ||
|
||
&ensemble_manager_nml | ||
/ | ||
|
||
&state_vector_io_nml | ||
/ |
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,43 @@ | ||
#!/usr/bin/env bash | ||
|
||
# DART software - Copyright UCAR. This open source software is provided | ||
# by UCAR, "as is", without charge, subject to all terms of use at | ||
# http://www.image.ucar.edu/DAReS/DART/DART_download | ||
|
||
main() { | ||
|
||
export DART=$(git rev-parse --show-toplevel) | ||
source "$DART"/build_templates/buildfunctions.sh | ||
|
||
MODEL="none" | ||
EXTRA="$DART"/models/template/threed_model_mod.f90 | ||
dev_test=1 | ||
TEST="namelist" | ||
LOCATION="threed_sphere" | ||
|
||
serial_programs=( | ||
test_parse_variables | ||
) | ||
|
||
|
||
# quickbuild arguments | ||
arguments "$@" | ||
|
||
# clean the directory | ||
\rm -f -- *.o *.mod Makefile .cppdefs | ||
|
||
# build any NetCDF files from .cdl files | ||
cdl_to_netcdf | ||
|
||
# build and run preprocess before making any other DART executables | ||
buildpreprocess | ||
|
||
# build | ||
buildit | ||
|
||
# clean up | ||
\rm -f -- *.o *.mod | ||
|
||
} | ||
|
||
main "$@" |
Oops, something went wrong.