Skip to content

Commit

Permalink
[develop] Use uwtools instead of set_namelist (ufs-community#1054)
Browse files Browse the repository at this point in the history
Continues the integration of the uwtools package. In this PR, I've done the following:
 * Call the UW config tool instead of set_namelist using the uwtools CLI in bash scripts and API in Python scripts
 * Lint the ush/set_fv3nml*.py files
 * Update uwtools to the latest release version

---------

Co-authored-by: michael.lueken <Michael.Lueken@noaa.gov>
  • Loading branch information
christinaholtNOAA and MichaelLueken authored Mar 20, 2024
1 parent 79bbe5d commit 6010eff
Show file tree
Hide file tree
Showing 23 changed files with 369 additions and 854 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/python_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ jobs:
pylint --ignore-imports=yes tests/test_python/
pylint ush/create_*.py
pylint ush/generate_FV3LAM_wflow.py
pylint ush/set_fv3nml*.py
pylint ush/update_input_nml.py
- name: Run python unittests
run: |
Expand Down
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ channels:
dependencies:
- pylint=2.17*
- pytest=7.2*
- uwtools=1.0.0
- uwtools=2.1*
5 changes: 1 addition & 4 deletions modulefiles/build_hera_gnu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@ the NOAA RDHPC machine Hera using GNU 9.2.0

whatis([===[Loads libraries needed for building the UFS SRW App on Hera using GNU 9.2.0 ]===])

-- When Hera switches from CentOS to Rocky, replace line withh correct path to spack-stack
-- If you want to use Rocky OS now, use line below
--prepend_path("MODULEPATH", "/scratch1/NCEPDEV/nems/role.epic/spack-stack/spack-stack-1.5.0/envs/unified-env-rocky8/install/modulefiles/Core")
prepend_path("MODULEPATH", "/scratch1/NCEPDEV/nems/role.epic/spack-stack/spack-stack-1.5.0/envs/unified-env-noavx512/install/modulefiles/Core")
prepend_path("MODULEPATH", "/scratch1/NCEPDEV/nems/role.epic/spack-stack/spack-stack-1.5.0/envs/unified-env-rocky8/install/modulefiles/Core")
prepend_path("MODULEPATH", "/scratch1/NCEPDEV/jcsda/jedipara/spack-stack/modulefiles")

load("stack-gcc/9.2.0")
Expand Down
5 changes: 1 addition & 4 deletions modulefiles/build_hera_intel.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@ whatis([===[Loads libraries needed for building the UFS SRW App on Hera ]===])
prepend_path("MODULEPATH","/contrib/sutils/modulefiles")
load("sutils")

-- When Hera switches from CentOS to Rocky, replace line withh correct path to spack-stack
-- If you want to use Rocky OS now, use line below
--prepend_path("MODULEPATH", "/scratch1/NCEPDEV/nems/role.epic/spack-stack/spack-stack-1.5.0/envs/unified-env-rocky8/install/modulefiles/Core")
prepend_path("MODULEPATH", "/scratch1/NCEPDEV/nems/role.epic/spack-stack/spack-stack-1.5.0/envs/unified-env-noavx512/install/modulefiles/Core")
prepend_path("MODULEPATH", "/scratch1/NCEPDEV/nems/role.epic/spack-stack/spack-stack-1.5.0/envs/unified-env-rocky8/install/modulefiles/Core")
prepend_path("MODULEPATH", "/scratch1/NCEPDEV/jcsda/jedipara/spack-stack/modulefiles")

stack_intel_ver=os.getenv("stack_intel_ver") or "2021.5.0"
Expand Down
123 changes: 58 additions & 65 deletions parm/FV3.input.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,7 @@
# parm/input.nml.FV3
#
# to obtain the namelist for each physics suite that the SRW App can
# run with. To build a namelist for one of these configurations, use
# the Python helper script
#
# ush/set_namelist.py
#
# and provide this file and the desired section via the -c option.
# run with.


FV3_RRFS_v1beta:
Expand Down Expand Up @@ -83,11 +78,11 @@ FV3_HRRR:
<<: *RRFS_v1beta_phys
cdmbgwd: [3.5, 1.0]
do_mynnsfclay: True
do_sfcperts: !!python/none
do_sfcperts: null
gwd_opt: 3
do_gsl_drag_ss: True
do_gsl_drag_tofd: True
do_gsl_drag_ls_bl: True
do_gsl_drag_ls_bl: True
iaer: 5111
icliq_sw: 2
iovr: 3
Expand All @@ -102,8 +97,8 @@ FV3_HRRR:
mosaic_lu: 0
mosaic_soil: 0
thsfc_loc: False
nst_anl:
nstf_name:
nst_anl: null
nstf_name: null

FV3_RAP:
fv_core_nml:
Expand All @@ -112,7 +107,7 @@ FV3_RAP:
<<: *RRFS_v1beta_phys
cdmbgwd: [3.5, 1.0]
do_mynnsfclay: True
do_sfcperts: !!python/none
do_sfcperts: null
gwd_opt: 3
do_gsl_drag_ss: True
do_gsl_drag_tofd: True
Expand Down Expand Up @@ -140,40 +135,40 @@ FV3_GFS_2017_gfdlmp:
k_split: 6
n_split: 6
nord: 2
nord_zs_filter: !!python/none
nord_zs_filter: null
range_warn: False
vtdm4: 0.075
gfs_physics_nml: &gfs_2017_gfdlmp_phys
avg_max_length: 3600.0
bl_mynn_tkeadvect: !!python/none
bl_mynn_edmf: !!python/none
bl_mynn_edmf_mom: !!python/none
bl_mynn_tkeadvect: null
bl_mynn_edmf: null
bl_mynn_edmf_mom: null
cdmbgwd: [3.5, 0.01]
cplflx: !!python/none
cplflx: null
do_deep: False
do_mynnedmf: !!python/none
do_mynnsfclay: !!python/none
do_mynnedmf: null
do_mynnsfclay: null
fhcyc: 0.0
fhlwr: 3600.0
fhswr: 3600.0
hybedmf: True
icloud_bl: !!python/none
icloud_bl: null
imfdeepcnv: 2
imfshalcnv: 2
imp_physics: 11
lgfdlmprad: True
lheatstrg: !!python/none
lndp_type: !!python/none
lsm: !!python/none
lsoil: !!python/none
lsoil_lsm: !!python/none
ltaerosol: !!python/none
n_var_lndp: !!python/none
lheatstrg: null
lndp_type: null
lsm: null
lsoil: null
lsoil_lsm: null
ltaerosol: null
n_var_lndp: null
oz_phys: True
oz_phys_2015: False
satmedmf: !!python/none
satmedmf: null
shal_cnv: True
ttendlim: !!python/none
ttendlim: null
gfdl_cloud_microphysics_nml: &gfs_gfdl_cloud_mp
c_cracw: 0.8
c_paut: 0.5
Expand Down Expand Up @@ -272,7 +267,7 @@ FV3_GFS_v15p2:
kord_wz: 9
n_split: 8
n_sponge: 30
nord_zs_filter: !!python/none
nord_zs_filter: null
nudge_qv: True
range_warn: False
rf_cutoff: 750.0
Expand All @@ -283,29 +278,29 @@ FV3_GFS_v15p2:
tau_l2v: 225.0
tau_v2l: 150.0
gfs_physics_nml: &gfs_v15_gfs_physics
bl_mynn_edmf: !!python/none
bl_mynn_edmf_mom: !!python/none
bl_mynn_tkeadvect: !!python/none
bl_mynn_edmf: null
bl_mynn_edmf_mom: null
bl_mynn_tkeadvect: null
cnvcld: True
cnvgwd: True
cplflx: !!python/none
cplflx: null
do_myjpbl: False
do_myjsfc: False
do_mynnedmf: !!python/none
do_mynnsfclay: !!python/none
do_mynnedmf: null
do_mynnsfclay: null
do_tofd: False
do_ugwp: False
do_ysu: False
fhcyc: 0.0
fhlwr: 3600.0
fhswr: 3600.0
hybedmf: True
iau_delthrs: !!python/none
iaufhrs: !!python/none
iau_delthrs: null
iaufhrs: null
imfdeepcnv: 2
imfshalcnv: 2
imp_physics: 11
icloud_bl: !!python/none
icloud_bl: null
iopt_alb: 2
iopt_btr: 1
iopt_crs: 1
Expand All @@ -321,28 +316,28 @@ FV3_GFS_v15p2:
iopt_trs: 2
ldiag_ugwp: False
lgfdlmprad: True
lradar: !!python/none
lradar: null
lsm: 1
lsoil: !!python/none
lsoil_lsm: !!python/none
ltaerosol: !!python/none
lsoil: null
lsoil_lsm: null
ltaerosol: null
shal_cnv: True
shinhong: False
ttendlim: !!python/none
ttendlim: null
xkzm_h: 1.0
xkzm_m: 1.0
xkzminv: 0.3
namsfc:
landice: True
ldebug: False
surf_map_nml:
surf_map_nml: null

FV3_GFS_v15_thompson_mynn_lam3km:
atmos_model_nml:
avg_max_length: 3600.0
fv_core_nml:
agrid_vel_rst: True
full_zs_filter: !!python/none
full_zs_filter: null
n_sponge: 9
npz_type: ''
rf_fast: False
Expand Down Expand Up @@ -382,20 +377,20 @@ FV3_GFS_v15_thompson_mynn_lam3km:
iopt_snf: 4
iopt_stc: 1
iopt_tbot: 2
iopt_trs: !!python/none
iopt_trs: null
iovr: 3
ldiag_ugwp: False
lgfdlmprad: False
lsm: 1
lsoil: !!python/none
lsoil_lsm: !!python/none
lsoil: null
lsoil_lsm: null
ltaerosol: False
print_diff_pgr: True
sfclay_compute_flux: !!python/none
sfclay_compute_flux: null
xkzminv: 0.3
xkzm_m: 1.0
xkzm_h: 1.0
surf_map_nml: !!python/none
surf_map_nml: null

FV3_GFS_v16:
cires_ugwp_nml:
Expand All @@ -419,7 +414,7 @@ FV3_GFS_v16:
na_init: 0
nudge_dz: False
res_latlon_dynamics: ''
rf_fast: !!python/none
rf_fast: null
tau: 10.0
gfdl_cloud_microphysics_nml:
<<: *gfs_gfdl_cloud_mp
Expand All @@ -431,10 +426,10 @@ FV3_GFS_v16:
gfs_physics_nml:
<<: *gfs_v15_gfs_physics
cdmbgwd: [4.0, 0.15, 1.0, 1.0]
do_myjpbl: !!python/none
do_myjsfc: !!python/none
do_myjpbl: null
do_myjsfc: null
do_tofd: True
do_ysu: !!python/none
do_ysu: null
hybedmf: False
iaer: 5111
icliq_sw: 2
Expand All @@ -443,23 +438,23 @@ FV3_GFS_v16:
isatmedmf: 1
lgfdlmprad: True
lheatstrg: True
lndp_type: !!python/none
lndp_type: null
lsoil: 4
n_var_lndp: !!python/none
n_var_lndp: null
prautco: [0.00015, 0.00015]
psautco: [0.0008, 0.0005]
satmedmf: True
shinhong: !!python/none
xkzminv: !!python/none
xkzm_m: !!python/none
xkzm_h: !!python/none
shinhong: null
xkzminv: null
xkzm_m: null
xkzm_h: null
mpp_io_nml:
deflate_level: 1
shuffle: 1
namsfc:
landice: True
ldebug: False
surf_map_nml: !!python/none
surf_map_nml: null

FV3_GFS_v17_p8:
cires_ugwp_nml:
Expand All @@ -485,7 +480,7 @@ FV3_GFS_v17_p8:
nord: 1
nudge_dz: False
res_latlon_dynamics: ''
rf_fast: !!python/none
rf_fast: null
tau: 10.0
gfs_physics_nml:
cdmbgwd: [4.0, 0.05, 1.0, 1.0]
Expand Down Expand Up @@ -548,6 +543,4 @@ FV3_GFS_v17_p8:
mpp_io_nml:
deflate_level: 1
shuffle: 1
namsfc:
surf_map_nml: !!python/none

surf_map_nml: null
29 changes: 0 additions & 29 deletions parm/fixed_files_mapping.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -139,35 +139,6 @@ fixed_files:
!join_str ["FNSMCC | ",*FNSMCC],
!join_str ["FNMSKH | ",*FNMSKH]
]
#"FNZORC | $FNZORC",

#
#-----------------------------------------------------------------------
#
# FV3_NML_VARNAME_TO_SFC_CLIMO_FIELD_MAPPING:
# This array is used to set some of the namelist variables in the forecast
# model's namelist file that represent the relative or absolute paths of
# various fixed files (the first column of the array, where columns are
# delineated by the pipe symbol "|") to the full paths to surface climatology
# files (on the native FV3-LAM grid) in the FIXlam directory derived from
# the corresponding surface climatology fields (the second column of the
# array).
#
#-----------------------------------------------------------------------
#
FV3_NML_VARNAME_TO_SFC_CLIMO_FIELD_MAPPING: [
"FNALBC | snowfree_albedo",
"FNALBC2 | facsf",
"FNTG3C | substrate_temperature",
"FNVEGC | vegetation_greenness",
"FNVETC | vegetation_type",
"FNSOTC | soil_type",
"FNVMNC | vegetation_greenness",
"FNVMXC | vegetation_greenness",
"FNSLPC | slope_type",
"FNABSC | maximum_snow_albedo"
]


#
#-----------------------------------------------------------------------
Expand Down
Loading

0 comments on commit 6010eff

Please sign in to comment.