Skip to content

update for dev2 realtime run#1498

Open
haiqinli wants to merge 9 commits into
NOAA-EMC:rrfs-mpas-jedifrom
haiqinli:rrfs-mpas-jedi-smoke
Open

update for dev2 realtime run#1498
haiqinli wants to merge 9 commits into
NOAA-EMC:rrfs-mpas-jedifrom
haiqinli:rrfs-mpas-jedi-smoke

Conversation

@haiqinli

Copy link
Copy Markdown
Collaborator

DESCRIPTION OF CHANGES:

  • Update the workflow to run with 4 aerosol tracers: smoke-fine, dust-fine, dust-coarse, and unspc-fine (anthropogenic emission);
  • Use regrid submodule;
  • Use namelist option of "config_mp_aero_emission" to turn on/off aerosol emission for TEMPO MP.

TESTS CONDUCTED:

CONUS12km test run: /scratch4/BMC/acomp/Haiqin.Li/OPSROOT/smoke_12km

Machines/Platforms:

  • WCOSS2
    • Cactus/Dogwood
    • Acorn
  • RDHPCS
    • Hera
    • Ursa
    • Orion
    • Hercules

Test cases:

  • Engineering tests
    • Non-DA engineering test
    • DA engineering test
      • Retro
      • Ensemble
      • Parallel
  • [ X] RRFS fire weather
  • RRFS_A:
  • RRFS_B:
  • RTMA:
  • Others:

ISSUE:

  • Fixes the issue(s) mentioned in #9999

CONTRIBUTORS (optional):

Jordan Schnell

INTERP_WEIGHTS_DIR=${CHEM_INPUT}/grids/interpolation_weights/
SCRIP_FILES_DIR=${CHEM_INPUT}/grids/scrip_files/
# Now set the same for the scrip file:
if [[ "${SCRIP_FILES_DIR}/mpas_${MESH_NAME}_scrip.nc" ]]; then
Comment thread ush/chem_prep_goes_aod.sh
GOES_INPUT=/scratch4/BMC/zrtrr/jdduda/smoke_mask/GOES
# output directories
GOES_OUTPUTDIR=${DATA}
OUTPUTFILE=${UMBRELLA_PREP_CHEM_DATA}/goes.aod.init.nc
Comment thread ush/chem_prep_goes_aod.sh Fixed
export CHEM_GROUPS="smoke" # any combinations of "smoke, anthro, pollen, dust, rwc"
export EBB_DCYCLE=1
export EBB_DCYCLE=-1
export REGRID_WRAPPER_DIR="${HOMErrfs}/sorc/regrid-wrapper"
Comment thread ush/chem_prep_anthro.sh
ncwa -O -a LAY,COL "${NEMO_EMISFILE_PT_PROCESSED}" "${NEMO_EMISFILE_PT_PROCESSED}"
ncwa -O -a LAY,COL,TSTEP "${NEMO_STACKFILE_PROCESSED}" "${NEMO_STACKFILE_PROCESSED}"
# Cast the stack parameters through time
ncap2 -O -s 'e_ant_pt_in_unspc_fine[$Time,$TSTEP,$nanthro_pt]=e_ant_pt_in_unspc_fine' "${NEMO_EMISFILE_PT_PROCESSED}" "${NEMO_EMISFILE_PT_PROCESSED}"
Comment thread ush/chem_prep_anthro.sh
ncwa -O -a LAY,COL,TSTEP "${NEMO_STACKFILE_PROCESSED}" "${NEMO_STACKFILE_PROCESSED}"
# Cast the stack parameters through time
ncap2 -O -s 'e_ant_pt_in_unspc_fine[$Time,$TSTEP,$nanthro_pt]=e_ant_pt_in_unspc_fine' "${NEMO_EMISFILE_PT_PROCESSED}" "${NEMO_EMISFILE_PT_PROCESSED}"
ncap2 -O -s 'e_ant_pt_in_unspc_coarse[$Time,$TSTEP,$nanthro_pt]=e_ant_pt_in_unspc_coarse' "${NEMO_EMISFILE_PT_PROCESSED}" "${NEMO_EMISFILE_PT_PROCESSED}"
Comment thread ush/chem_prep_smoke.sh Fixed
Comment thread ush/chem_prep_smoke.sh Fixed
@@ -0,0 +1,19 @@
prepend_path("MODULEPATH", "/gpfs/f6/bil-fire8/world-shared/Benjamin.Koziol/mpas-aerosols/spack-stack/envs/mpas-aerosols/modules/Core")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We usually don't do this way. Let's discuss this first.

Comment thread scripts/exrrfs_fcst.sh
config_gfl_sub3d = 1/" namelist.atmosphere
fi

if [[ "${MESH_NAME^^}" == "FWX1.25km" ]]; then

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't use if switches based on MESH_NAME inside j-jobs and ex-scripts.

Also config_lbc_w = 'zero' should be a standard option now, right?

Comment thread scripts/exrrfs_fcst.sh Outdated
-e "${mpasout_replacement}" "${PARMrrfs}"/streams.atmosphere > streams.atmosphere
#
if [[ "${mpasout_interval,,}" == "none" ]]; then # remove the da_state stream for coldstart only forecasts
#if [[ "${mpasout_interval,,}" == "none" ]]; then # remove the da_state stream for coldstart only forecasts

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We cannot comment out this part. Let us talk about a better way to address the Chem needs.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree. When I run with rrfsx/MPAS-Model, we don't need to comment out this part. However, we have to comment out this when run with ufs-community/MPAS-Model

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed as suggested. Thanks!

Comment thread scripts/exrrfs_prep_chem.sh Outdated
# 3. CHEM_INPUT -- location of interpolated files, ready to be used
# 4. MESH_NAME -- name of the MPAS domain, required to know if we have weights or data intepolated to the domain
# 4. MESH_NAME -- name of the MPAS domain, required to know if we have weights or data intepolated to the domain
# TEST COMMIT

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line 18 can be removed

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will remove line 18. Thanks!

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed as suggested.

Comment thread sorc/MPAS-Model

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We cannot use the ufs-community/MPAS-Model directly as it misses the output_timelevels and output_done_marker

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a pending PR (ufs-community/MPAS-Model#240). Should I update the PR with output_timelevels and output_done_marker? Thanks!

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have two routes:
(1) We get ufs-community/MPAS-Model#240 merged first; then merge the changes to rrfsx/MPAS-Model which already has output_timelevels and output_done_marker
(2) If you need the above PR #240 change earlier, you can create a PR to rrfsx/MPAS-Model.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just submitted a PR (RRFSx/MPAS-Model#25) to rrfsx/MPAS-Model. Thanks!

Comment thread ush/chem_fcst.sh
if [[ "${CHEM_GROUPS,,}" == *pollen* ]]; then
if [[ -s "${UMBRELLA_PREP_CHEM_DATA}/bio.init.nc" ]]; then
sed -i "\${e} cat ${PARMrrfs}/chemistry/streams.atmosphere.pollen" streams.atmosphere # append before the last line (i.e. </stream>)
sed -i "\$e cat ${PARMrrfs}/chemistry/streams.atmosphere.pollen" streams.atmosphere # append before the last line (i.e. </stream>)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why change ${e} to $e?

@haiqinli haiqinli May 19, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will change $e back to ${e}. Thanks!

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for some reason the brackets cause this command to fail

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I cannot remember exactly, but I think I manually tested ${e} in this command and it worked.
I will double check this. If it fails, we are fine to use $e. Thanks!

Comment thread ush/chem_ic_update.sh
# if [[ "${CHEM_GROUPS,,}" == *ssalt* ]]; then
# ncap2 -O -s "ssalt_fine=1.e-12*qv" init.nc init.nc
# ncap2 -O -s "ssalt_coarse=1.e-12*qv" init.nc init.nc
# fi

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lines 35-61: Are they still needed? If not, we can remove them

Comment thread ush/chem_prep_anthro.sh
fi # Is GRA2PES listed as one of the anthro inventories?


# Now for NEMO emissions

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there are additional helper scripts needed for the NEMO implemetnation
chem_create_merge_dates_ann.py
chem_get_merge_date.py
chem_merge_emissions.py
chem_merge_pt_emissions.py

source "${USHrrfs}"/chem_prep_goes_aod.sh
fi

if [[ "${CHEM_GROUP}" == "dust" ]]; then

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we will need to update the FIX files for dust based on the name changes in MPAS-Model

Comment thread ush/chem_prep_smoke.sh Outdated
err_exit
fi
fi
ncap2 -O -s 'frp_in=frp_in.ttl($nkwildfire)' -s 'fre_in=fre_in.ttl($nkwildfire)' "${EMISFILE}" "${EMISFILE}"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please see latest commits - this dimension summing should only occur for the actual RAVE files, the dummy files will already have the correct dimensions

Comment thread .gitmodules Outdated
url = https://github.com/RRFSx/MPAS-Model
branch = gsl/develop
url = https://github.com/haiqinli/MPAS-Model
branch = gsl/develop-mp-emission

@guoqing-noaa guoqing-noaa May 26, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@haiqinli Could you merge the latest rrfs-mpas-jedi branch and then revert changes in lines 8-9? Thanks!

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated as suggested. Thanks!

Comment thread ush/chem_prep_anthro.sh
# Cast the stack parameters through time
ncap2 -O -s 'e_ant_pt_in_unspc_fine[$Time,$TSTEP,$nanthro_pt]=e_ant_pt_in_unspc_fine' "${NEMO_EMISFILE_PT_PROCESSED}" "${NEMO_EMISFILE_PT_PROCESSED}"
ncap2 -O -s 'e_ant_pt_in_unspc_coarse[$Time,$TSTEP,$nanthro_pt]=e_ant_pt_in_unspc_coarse' "${NEMO_EMISFILE_PT_PROCESSED}" "${NEMO_EMISFILE_PT_PROCESSED}"
ncap2 -O -s 'e_ant_pt_in_co[$Time,$TSTEP,$nanthro_pt]=e_ant_pt_in_co' "${NEMO_EMISFILE_PT_PROCESSED}" "${NEMO_EMISFILE_PT_PROCESSED}"
Comment thread ush/chem_prep_anthro.sh
ncap2 -O -s 'e_ant_pt_in_unspc_fine[$Time,$TSTEP,$nanthro_pt]=e_ant_pt_in_unspc_fine' "${NEMO_EMISFILE_PT_PROCESSED}" "${NEMO_EMISFILE_PT_PROCESSED}"
ncap2 -O -s 'e_ant_pt_in_unspc_coarse[$Time,$TSTEP,$nanthro_pt]=e_ant_pt_in_unspc_coarse' "${NEMO_EMISFILE_PT_PROCESSED}" "${NEMO_EMISFILE_PT_PROCESSED}"
ncap2 -O -s 'e_ant_pt_in_co[$Time,$TSTEP,$nanthro_pt]=e_ant_pt_in_co' "${NEMO_EMISFILE_PT_PROCESSED}" "${NEMO_EMISFILE_PT_PROCESSED}"
ncap2 -O -s 'e_ant_pt_in_nox[$Time,$TSTEP,$nanthro_pt]=e_ant_pt_in_nox' "${NEMO_EMISFILE_PT_PROCESSED}" "${NEMO_EMISFILE_PT_PROCESSED}"
Comment thread ush/chem_prep_anthro.sh
ncap2 -O -s 'e_ant_pt_in_unspc_coarse[$Time,$TSTEP,$nanthro_pt]=e_ant_pt_in_unspc_coarse' "${NEMO_EMISFILE_PT_PROCESSED}" "${NEMO_EMISFILE_PT_PROCESSED}"
ncap2 -O -s 'e_ant_pt_in_co[$Time,$TSTEP,$nanthro_pt]=e_ant_pt_in_co' "${NEMO_EMISFILE_PT_PROCESSED}" "${NEMO_EMISFILE_PT_PROCESSED}"
ncap2 -O -s 'e_ant_pt_in_nox[$Time,$TSTEP,$nanthro_pt]=e_ant_pt_in_nox' "${NEMO_EMISFILE_PT_PROCESSED}" "${NEMO_EMISFILE_PT_PROCESSED}"
ncap2 -O -s 'e_ant_pt_in_nh3[$Time,$TSTEP,$nanthro_pt]=e_ant_pt_in_nh3' "${NEMO_EMISFILE_PT_PROCESSED}" "${NEMO_EMISFILE_PT_PROCESSED}"
Comment thread ush/chem_prep_anthro.sh
ncap2 -O -s 'e_ant_pt_in_co[$Time,$TSTEP,$nanthro_pt]=e_ant_pt_in_co' "${NEMO_EMISFILE_PT_PROCESSED}" "${NEMO_EMISFILE_PT_PROCESSED}"
ncap2 -O -s 'e_ant_pt_in_nox[$Time,$TSTEP,$nanthro_pt]=e_ant_pt_in_nox' "${NEMO_EMISFILE_PT_PROCESSED}" "${NEMO_EMISFILE_PT_PROCESSED}"
ncap2 -O -s 'e_ant_pt_in_nh3[$Time,$TSTEP,$nanthro_pt]=e_ant_pt_in_nh3' "${NEMO_EMISFILE_PT_PROCESSED}" "${NEMO_EMISFILE_PT_PROCESSED}"
ncap2 -O -s 'e_ant_pt_in_so2[$Time,$TSTEP,$nanthro_pt]=e_ant_pt_in_so2' "${NEMO_EMISFILE_PT_PROCESSED}" "${NEMO_EMISFILE_PT_PROCESSED}"
Comment thread ush/chem_prep_anthro.sh
ncap2 -O -s 'e_ant_pt_in_nox[$Time,$TSTEP,$nanthro_pt]=e_ant_pt_in_nox' "${NEMO_EMISFILE_PT_PROCESSED}" "${NEMO_EMISFILE_PT_PROCESSED}"
ncap2 -O -s 'e_ant_pt_in_nh3[$Time,$TSTEP,$nanthro_pt]=e_ant_pt_in_nh3' "${NEMO_EMISFILE_PT_PROCESSED}" "${NEMO_EMISFILE_PT_PROCESSED}"
ncap2 -O -s 'e_ant_pt_in_so2[$Time,$TSTEP,$nanthro_pt]=e_ant_pt_in_so2' "${NEMO_EMISFILE_PT_PROCESSED}" "${NEMO_EMISFILE_PT_PROCESSED}"
ncap2 -O -s 'e_ant_pt_in_nh4_a_fine[$Time,$TSTEP,$nanthro_pt]=e_ant_pt_in_nh4_a_fine' "${NEMO_EMISFILE_PT_PROCESSED}" "${NEMO_EMISFILE_PT_PROCESSED}"
Comment thread ush/chem_prep_anthro.sh
ncap2 -O -s 'e_ant_pt_in_nh3[$Time,$TSTEP,$nanthro_pt]=e_ant_pt_in_nh3' "${NEMO_EMISFILE_PT_PROCESSED}" "${NEMO_EMISFILE_PT_PROCESSED}"
ncap2 -O -s 'e_ant_pt_in_so2[$Time,$TSTEP,$nanthro_pt]=e_ant_pt_in_so2' "${NEMO_EMISFILE_PT_PROCESSED}" "${NEMO_EMISFILE_PT_PROCESSED}"
ncap2 -O -s 'e_ant_pt_in_nh4_a_fine[$Time,$TSTEP,$nanthro_pt]=e_ant_pt_in_nh4_a_fine' "${NEMO_EMISFILE_PT_PROCESSED}" "${NEMO_EMISFILE_PT_PROCESSED}"
ncap2 -O -s 'e_ant_pt_in_no3_a_fine[$Time,$TSTEP,$nanthro_pt]=e_ant_pt_in_no3_a_fine' "${NEMO_EMISFILE_PT_PROCESSED}" "${NEMO_EMISFILE_PT_PROCESSED}"
Comment thread ush/chem_prep_anthro.sh
ncap2 -O -s 'e_ant_pt_in_so2[$Time,$TSTEP,$nanthro_pt]=e_ant_pt_in_so2' "${NEMO_EMISFILE_PT_PROCESSED}" "${NEMO_EMISFILE_PT_PROCESSED}"
ncap2 -O -s 'e_ant_pt_in_nh4_a_fine[$Time,$TSTEP,$nanthro_pt]=e_ant_pt_in_nh4_a_fine' "${NEMO_EMISFILE_PT_PROCESSED}" "${NEMO_EMISFILE_PT_PROCESSED}"
ncap2 -O -s 'e_ant_pt_in_no3_a_fine[$Time,$TSTEP,$nanthro_pt]=e_ant_pt_in_no3_a_fine' "${NEMO_EMISFILE_PT_PROCESSED}" "${NEMO_EMISFILE_PT_PROCESSED}"
ncap2 -O -s 'e_ant_pt_in_so4_a_fine[$Time,$TSTEP,$nanthro_pt]=e_ant_pt_in_so4_a_fine' "${NEMO_EMISFILE_PT_PROCESSED}" "${NEMO_EMISFILE_PT_PROCESSED}"
Comment thread ush/chem_prep_smoke.sh
ncrename -v NOx,e_bb_in_nox "${EMISFILE2}"
ln -sf "${EMISFILE2}" "${EMISFILE}"
# TODO temporary fix until YAML options are built into regriddder
ncap2 -O -s 'frp_in=frp_in.ttl($nkwildfire)' -s 'fre_in=fre_in.ttl($nkwildfire)' "${EMISFILE}" "${EMISFILE}"
Comment thread ush/chem_prep_smoke.sh
ncrename -v NOx,e_bb_in_nox "${EMISFILE2}"
ln -sf "${EMISFILE2}" "${EMISFILE}"
# TODO temporary fix until YAML options are built into regriddder
ncap2 -O -s 'frp_in=frp_in.ttl($nkwildfire)' -s 'fre_in=fre_in.ttl($nkwildfire)' "${EMISFILE}" "${EMISFILE}"
export MPASSIT_DX=1000.0
export MPASSIT_REF_LAT=37.0
export MPASSIT_REF_LON=-119.0

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lines 100-111: remove the "garnetSm1km" section

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed as suggested. Thanks!

}
trap cleanup SIGINT SIGTERM
else
echo "Info: Not slurm nor PBS"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merge the latest rrfs-mpas-jedi branch so that the changes on the left side are not overwritten accidentally.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merged the latest rrfs-mpas-jedi branch.

#!/usr/bin/env python3
import argparse
import numpy as np

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add some documentation here about what this is.

Comment thread .gitmodules Outdated
url = https://github.com/pyDAmonitor/pyDAmonitor.git
ignore = all
[submodule "sorc/regrid-wrapper"]
path = sorc/regrid-wrapper

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorc/chem-regrid-wrapper

Comment thread ush/chem_prep_anthro.sh
# file for that same year and month (e.g., matching 201705*)
if [[ ! -r "${testfile}" ]]; then
YYYYMM="${testdate:0:6}"
first_available=$(ls -1 "${INDIR_NEMO}/${isect}/"emis_mole_${isect}_${YYYYMM}*.ncf 2>/dev/null | head -n 1)
Comment thread ush/chem_prep_anthro.sh
# file for that same year and month (e.g., matching 201705*)
if [[ ! -r "${testfile}" ]]; then
YYYYMM="${testdate:0:6}"
first_available=$(ls -1 "${INDIR_NEMO}/${isect}/"emis_mole_${isect}_${YYYYMM}*.ncf 2>/dev/null | head -n 1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants