Skip to content

Commit

Permalink
Merge branch 'develop' into feature/multi_model_build
Browse files Browse the repository at this point in the history
  • Loading branch information
aerorahul committed Dec 14, 2024
2 parents 387b8dc + bef3e0b commit a901aee
Show file tree
Hide file tree
Showing 21 changed files with 256 additions and 363 deletions.
16 changes: 7 additions & 9 deletions parm/config/gfs/config.aeroanl
Original file line number Diff line number Diff line change
Expand Up @@ -7,41 +7,39 @@ echo "BEGIN: config.aeroanl"

# define analysis resolution based on deterministic res
case ${CASE} in
"C1152" | "C768" | "C384" | "C192")
CASE_ANL="C192"
"C1152" | "C768" | "C384")
CASE_ANL="C384"
;;
"C96" | "C48")
"C192" | "C96" | "C48")
CASE_ANL=${CASE}
;;
*)
echo "FATAL ERROR: Aerosol DA not supported at ${CASE} resolution"
exit 4
esac
export CASE_ANL
export OBS_LIST="${PARMgfs}/gdas/aero/obs/lists/gdas_aero.yaml.j2"
export JCB_ALGO_YAML_VAR=${PARMgfs}/gdas/aero/jcb-prototype_3dvar.yaml.j2
export STATICB_TYPE='diffusion'
export BERROR_YAML="${PARMgfs}/gdas/aero/berror/staticb_${STATICB_TYPE}.yaml.j2"
export BERROR_YAML="aero_background_error_static_${STATICB_TYPE}"
export BERROR_DATA_DIR="${FIXgfs}/gdas/aero/clim_b"

export CRTM_FIX_YAML="${PARMgfs}/gdas/aero_crtm_coeff.yaml.j2"
export JEDI_FIX_YAML="${PARMgfs}/gdas/aero_jedi_fix.yaml.j2"

export JEDI_CONFIG_YAML="${PARMgfs}/gdas/aeroanl_jedi_config.yaml.j2"

export AERO_STAGE_VARIATIONAL_TMPL="${PARMgfs}/gdas/aero_stage_variational.yaml.j2"
export AERO_FINALIZE_VARIATIONAL_TMPL="${PARMgfs}/gdas/aero_finalize_variational.yaml.j2"

export io_layout_x=@IO_LAYOUT_X@
export io_layout_y=@IO_LAYOUT_Y@

export JEDIEXE="${EXECgfs}/gdas.x"
export BMATEXE="${EXECgfs}/gdasapp_chem_diagb.x"
export DIFFUSIONEXE="${EXECgfs}/gdas_fv3jedi_error_covariance_toolbox.x"

if [[ "${DOIAU}" == "YES" ]]; then
export aero_bkg_times="3,6,9"
export JEDIYAML="${PARMgfs}/gdas/aero/variational/3dvar_fgat_gfs_aero.yaml.j2"
else
export aero_bkg_times="6," # Trailing comma is necessary so this is treated as a list
export JEDIYAML="${PARMgfs}/gdas/aero/variational/3dvar_gfs_aero.yaml.j2"
fi

echo "END: config.aeroanl"
5 changes: 2 additions & 3 deletions parm/config/gfs/config.aeroanlgenb
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ echo "BEGIN: config.aeroanlgenb"
# Get task specific resources
source "${EXPDIR}/config.resources" aeroanlgenb

export BMATYAML="${PARMgfs}/gdas/aero/berror/aero_diagb.yaml.j2"
export DIFFUSIONYAML="${PARMgfs}/gdas/aero/berror/aero_diffusionparm.yaml.j2"
export INTERPYAML="${PARMgfs}/gdas/aero/berror/aero_interp.yaml.j2"
export JEDI_CONFIG_YAML="${PARMgfs}/gdas/aero_bmat_jedi_config.yaml.j2"
export JCB_BASE_YAML="${PARMgfs}/gdas/aero/jcb-base.yaml.j2"
export AERO_BMATRIX_STAGE_TMPL="${PARMgfs}/gdas/aero_stage_bmatrix_bkg.yaml.j2"
export AERO_BMATRIX_FINALIZE_TMPL="${PARMgfs}/gdas/aero_finalize_bmatrix_bkg.yaml.j2"
export aero_diffusion_iter=10
Expand Down
19 changes: 19 additions & 0 deletions parm/gdas/aero_bmat_jedi_config.yaml.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
aero_interpbkg:
rundir: '{{ DATA }}'
exe_src: '{{ EXECgfs }}/gdas.x'
jedi_args: ['fv3jedi', 'convertstate']
mpi_cmd: '{{ APRUN_AEROANLGENB }}'
jcb_base_yaml: '{{ PARMgfs }}/gdas/aero/jcb-base.yaml.j2'
jcb_algo: aero_convert_background
aero_diagb:
rundir: '{{ DATA }}'
exe_src: '{{ EXECgfs }}/gdasapp_chem_diagb.x'
mpi_cmd: '{{ APRUN_AEROANLGENB }}'
jcb_base_yaml: '{{ PARMgfs }}/gdas/aero/jcb-base.yaml.j2'
jcb_algo: aero_gen_bmatrix_diagb
aero_diffusion:
rundir: '{{ DATA }}'
exe_src: '{{ EXECgfs }}/gdas_fv3jedi_error_covariance_toolbox.x'
mpi_cmd: '{{ APRUN_AEROANLGENB }}'
jcb_base_yaml: '{{ PARMgfs }}/gdas/aero/jcb-base.yaml.j2'
jcb_algo: aero_gen_bmatrix_diffusion
4 changes: 2 additions & 2 deletions parm/gdas/aero_finalize_bmatrix_bkg.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
{% set background_time = current_cycle | add_to_datetime(offset_td) %}
copy:
### copy YAMLs used
{% set yaml_list = ['chem_diagb.yaml', 'chem_diffusion.yaml'] %}
{% set yaml_list = ['aero_diagb.yaml', 'aero_diffusion.yaml', 'aero_interpbkg.yaml'] %}
{% for fname in yaml_list %}
- ["{{ DATA }}/{{ HEAD }}{{ fname }}", "{{ COMOUT_CHEM_BMAT }}/{{ HEAD }}{{ fname }}"]
- ["{{ DATA }}/{{ fname }}", "{{ COMOUT_CHEM_BMAT }}/{{ HEAD }}{{ fname }}"]
{% endfor %}
### copy stddev files to ROTDIR
{% for tile in range(1, ntiles+1) %}
Expand Down
2 changes: 1 addition & 1 deletion parm/gdas/aero_finalize_variational.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ mkdir:
- "{{ COMOUT_ATMOS_RESTART }}"
copy:
## copy variational YAML to ROTDIR
- ["{{ DATA }}/{{ APREFIX }}aerovar.yaml", "{{ COMOUT_CHEM_ANALYSIS }}/{{ APREFIX }}aerovar.yaml"]
- ["{{ DATA }}/aeroanlvar.yaml", "{{ COMOUT_CHEM_ANALYSIS }}/{{ APREFIX }}aerovar.yaml"]
## copy increments
{% for tile in range(1,ntiles+1) %}
- ["{{ DATA }}/anl/aeroinc.{{ current_cycle | to_fv3time }}.fv_tracer.res.tile{{ tile }}.nc", "{{ COMOUT_CHEM_ANALYSIS }}/aeroinc.{{ current_cycle | to_fv3time }}.fv_tracer.res.tile{{ tile }}.nc"]
Expand Down
9 changes: 8 additions & 1 deletion parm/gdas/aero_stage_bmatrix_bkg.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ mkdir:
- "{{ DATA }}/stddev"
- "{{ DATA }}/clm_stddev"
- "{{ DATA }}/diffusion"
- "{{ DATA }}/rescale"
copy:
######################################
# copy deterministic background files
Expand All @@ -30,9 +31,15 @@ copy:
- ["{{ COM_ATMOS_RESTART_TMPL | replace_tmpl(tmpl_dict) }}/{{ background_time | to_fv3time }}.{{ ftype }}.tile{{ tile }}.nc", "{{ DATA }}/bkg/{{ background_time | to_fv3time }}.{{ ftype }}.tile{{ tile }}.nc"]
{% endfor %}
{% endfor %}
######################################
# copy climatological stddev files
######################################
{% for tile in range(1, ntiles+1) %}
- ["{{ BERROR_DATA_DIR }}/stddev.fv_tracer.res.tile{{ tile }}.nc", "{{ DATA }}/clm_stddev/stddev.fv_tracer.res.tile{{ tile }}.nc"]
{% endfor %}

######################################
# copy stddev rescaling factor files
######################################
{% for tile in range(1, ntiles+1) %}
- ["{{ BERROR_DATA_DIR }}/rescale.fv_tracer.res.tile{{ tile }}.nc", "{{ DATA }}/rescale/rescale.fv_tracer.res.tile{{ tile }}.nc"]
{% endfor %}
7 changes: 7 additions & 0 deletions parm/gdas/aeroanl_jedi_config.yaml.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
aeroanlvar:
rundir: '{{ DATA }}'
exe_src: '{{ EXECgfs }}/gdas.x'
mpi_cmd: '{{ APRUN_AEROANL }}'
jedi_args: ['fv3jedi', 'variational']
jcb_base_yaml: '{{ PARMgfs }}/gdas/aero/jcb-base.yaml.j2'
jcb_algo_yaml: '{{ JCB_ALGO_YAML_VAR }}'
12 changes: 5 additions & 7 deletions scripts/exgdas_aero_analysis_generate_bmatrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,8 @@
# Take configuration from environment and cast it as python dictionary
config = cast_strdict_as_dtypedict(os.environ)

# Instantiate the aerosol variance and diffusion correlation tasks
AeroB = AerosolBMatrix(config)
AeroB.initialize()
AeroB.interpBackground()
AeroB.computeVariance()
AeroB.computeDiffusion()
AeroB.finalize()
# Create an instance of the AerosolBMatrix task
aeroBMat = AerosolBMatrix(config)
aeroBMat.initialize()
aeroBMat.execute()
aeroBMat.finalize()
2 changes: 2 additions & 0 deletions scripts/exglobal_aero_analysis_finalize.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,6 @@

# Instantiate the aerosol analysis task
AeroAnl = AerosolAnalysis(config)

# Finalize JEDI aerosol variational analysis
AeroAnl.finalize()
2 changes: 2 additions & 0 deletions scripts/exglobal_aero_analysis_initialize.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,6 @@

# Instantiate the aerosol analysis task
AeroAnl = AerosolAnalysis(config)

# Initialize JEDI aerosol variational analysis
AeroAnl.initialize()
4 changes: 3 additions & 1 deletion scripts/exglobal_aero_analysis_variational.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,6 @@

# Instantiate the aerosol analysis task
AeroAnl = AerosolAnalysis(config)
AeroAnl.variational()

# Execute JEDI variational analysis
AeroAnl.execute('aeroanlvar')
1 change: 1 addition & 0 deletions sorc/build_ww3prepost.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ sed -e "s/DIST/SHRD/g" \
-e "s/OMPH / /g" \
-e "s/MPIT / /g" \
-e "s/MPI / /g" \
-e "s/PIO / /g" \
-e "s/B4B / /g" \
-e "s/PDLIB / /g" \
-e "s/SCOTCH / /g" \
Expand Down
2 changes: 1 addition & 1 deletion sorc/gdas.cd
8 changes: 4 additions & 4 deletions sorc/link_workflow.sh
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,10 @@ cd "${HOMEgfs}/parm/ufs" || exit 1
${LINK_OR_COPY} "${HOMEgfs}/sorc/ufs_model.fd/tests/parm/noahmptable.tbl" .

cd "${HOMEgfs}/parm/post" || exit 1
for file in params_grib2_tbl_new nam_micro_lookup.dat; do
${LINK_OR_COPY} "${HOMEgfs}/sorc/upp.fd/parm/${file}" .
done
for dir in gfs gefs sfs; do
${LINK_OR_COPY} "${HOMEgfs}/sorc/upp.fd/parm/params_grib2_tbl_new" .
${LINK_OR_COPY} "${HOMEgfs}/sorc/upp.fd/fix/nam_micro_lookup.dat" .
for dir in gfs gefs sfs
do
${LINK_OR_COPY} "${HOMEgfs}/sorc/upp.fd/parm/${dir}" .
done
for file in ice.csv ocean.csv ocnicepost.nml.jinja2; do
Expand Down
2 changes: 1 addition & 1 deletion sorc/ufs_model.fd
Submodule ufs_model.fd updated 211 files
3 changes: 2 additions & 1 deletion ush/parsing_namelists_CICE.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ local CICE_RESTART_FORMAT="pnetcdf2"
local CICE_DUMPFREQ="y" # "h","d","m" or "y" for restarts at intervals of "hours", "days", "months" or "years"
local CICE_DUMPFREQ_N=10000 # Set this to a really large value, as cice, mom6 and cmeps restart interval is controlled by ufs.configure
local CICE_DIAGFREQ=$(( 86400 / DT_CICE )) # frequency of diagnostic output in timesteps, recommended for 1x per day
local CICE_HISTFREQ_N="0, 0, ${FHOUT_ICE}, 1, 1"
local CICE_HISTFREQ_N="0, 0, ${FHOUT_ICE}, 0, 1"
local CICE_hist_suffix="'x','x','x','x','x'"
if [[ "${RUN}" =~ "gdas" ]]; then
local CICE_HIST_AVG=".false., .false., .false., .false., .false." # DA needs instantaneous
else
Expand Down
10 changes: 10 additions & 0 deletions ush/parsing_ufs_configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,16 @@ if [[ "${cplwav}" = ".true." ]]; then
local MULTIGRID="${waveMULTIGRID}"
local WW3_user_sets_restname="false"

local WW3_user_histname="false"
local WW3_historync="false"
local WW3_restartnc="false"
local WW3_restart_from_binary="false"
local WW3_PIO_FORMAT="pnetcdf"
local WW3_PIO_IOTASKS=-99
local WW3_PIO_STRIDE=4
local WW3_PIO_REARR="box"
local WW3_PIO_ROOT=-99

fi

if [[ "${cplchm}" = ".true." ]]; then
Expand Down
1 change: 0 additions & 1 deletion ush/python/pygfs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import os

from .task.analysis import Analysis
from .task.bmatrix import BMatrix
from .task.aero_emissions import AerosolEmissions
from .task.aero_analysis import AerosolAnalysis
from .task.aero_bmatrix import AerosolBMatrix
Expand Down
Loading

0 comments on commit a901aee

Please sign in to comment.