Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
ignore = all
[submodule "sorc/MPAS-Model"]
path = sorc/MPAS-Model
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!

ignore = all
[submodule "sorc/RDASApp"]
path = sorc/RDASApp
Expand Down Expand Up @@ -43,3 +43,8 @@
path = workflow/sideload/pyDAmonitor
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

url = https://github.com/jordanschnell/regrid-wrapper.git
branch = mpas_aero_v0
ignore = all
6 changes: 0 additions & 6 deletions fix/chemistry/mpassit/histlist_3d_anthro
Original file line number Diff line number Diff line change
@@ -1,8 +1,2 @@
smoke_fine SMOKE_FINE
smoke_coarse SMOKE_COARSE
unspc_fine UNSPC_FINE
unspc_coarse UNSPC_COARSE
PM2_5 PM2_5
PM10 PM10
dust_fine DUST_FINE
dust_coarse DUST_COARSE
5 changes: 1 addition & 4 deletions fix/chemistry/mpassit/histlist_3d_chem
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
smoke_fine SMOKE_FINE
PM2_5 PM2_5
PM10 PM10
dust_fine DUST_FINE
dust_coarse DUST_COARSE
vsb VSB
4 changes: 2 additions & 2 deletions fix/chemistry/mpassit/histlist_3d_pollen
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ polp_grass POLP_GRASS
polp_weed POLP_WEED
pols_all POLS_ALL
e_bio_out_polp_tree E_BIO_OUT_POLP_TREE
e_bio_out_polp_grass E_BIO_OUT_POLP_GRASS
e_bio_out_polp_weed E_BIO_OUT_POLP_WEED
e_bio_out_polp_grass E_BIO_OUT_POLP_GRASS
e_bio_out_polp_weed E_BIO_OUT_POLP_WEED
1 change: 0 additions & 1 deletion fix/chemistry/mpassit/histlist_3d_smoke
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
smoke_fine SMOKE_FINE
PM2_5 PM2_5
PM10 PM10
e_bb_out_smoke_fine E_BB_OUT_SMOKE_FINE
19 changes: 19 additions & 0 deletions modulefiles/rrfs/gaeac6.regrid-wrapper-spack-stack.intel.lua
Original file line number Diff line number Diff line change
@@ -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.

prepend_path("MODULEPATH", "/gpfs/f6/bil-fire8/world-shared/Benjamin.Koziol/mpas-aerosols/spack-stack/envs/mpas-aerosols/modules/cray-mpich/8.1.32/intel-oneapi-compilers/2025.2.1")
prepend_path("MODULEPATH", "/gpfs/f6/bil-fire8/world-shared/Benjamin.Koziol/mpas-aerosols/spack-stack/envs/mpas-aerosols/modules/intel-oneapi-compilers/2025.2.1")

prepend_path("LD_LIBRARY_PATH", "/opt/intel/oneapi/mkl/2025.2/lib")

load("stack-intel-oneapi-compilers/2025.2.1")
load("stack-cray-mpich/8.1.32")

load("py-numpy/1.26.4")
load("esmf/8.9.1")
load("py-netcdf4/1.7.2")
load("py-pytest/8.2.1")
load("py-xarray/2024.7.0")
load("py-pydantic/2.10.1")
load("py-pydantic-settings/2.6.1")

load("Core/24.11")
load("nco/5.1.9")
16 changes: 16 additions & 0 deletions modulefiles/rrfs/ursa.regrid-wrapper-spack-stack.intel.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
prepend_path("MODULEPATH", "/scratch3/NCEPDEV/stmp/Benjamin.Koziol/sandbox/spack-stack/envs/mpas-aerosols/modules/Core")
prepend_path("MODULEPATH", "/scratch3/NCEPDEV/stmp/Benjamin.Koziol/sandbox/spack-stack/envs/mpas-aerosols/modules/intel-oneapi-mpi/2021.17/intel-oneapi-compilers/2025.3.1")
prepend_path("MODULEPATH", "/scratch3/NCEPDEV/stmp/Benjamin.Koziol/sandbox/spack-stack/envs/mpas-aerosols/modules/intel-oneapi-compilers/2025.3.1")

load("stack-intel-oneapi-compilers/2025.3.1")
load("stack-intel-oneapi-mpi/2021.17")

load("hdf5/1.14.3")
load("esmf/8.9.1")
load("py-netcdf4/1.7.2")
load("py-pytest/8.2.1")
load("py-xarray/2024.7.0")
load("py-pydantic/2.10.1")
load("py-pydantic-settings/2.6.1")

load("nco")
4 changes: 3 additions & 1 deletion parm/chemistry/namelist.atmosphere
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
&chemistry
config_smoke_scheme = 'off'
config_dust_scheme = 'off'
config_anthro_scheme = 'off'
num_chem = 0
plume_wind_eff = 0
ebb_dcycle = 1
Expand All @@ -20,6 +21,7 @@
dust_moist_correction = 0.1
aero_dir_rad_fdb = false
config_mynn_enh_mix = false
kanthro = 20
config_mp_aero_emission = false
kanthro = 1
kwildfire = 1
/
10 changes: 8 additions & 2 deletions scripts/exrrfs_fcst.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@ if [[ "${FCST_CONVECTION_SCHEME^^}" == "TRUE" ]]; then
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?

sed -i -e "s/ config_apply_lbcs = true/\
config_apply_lbcs = true\n\
config_lbc_w = 'zero'/" namelist.atmosphere
fi

# generate the streams file on the fly using sed as this file contains "filename_template='lbc.$Y-$M-$D_$h.$m.$s.nc'"
lbc_interval=${LBC_INTERVAL:-3}
restart_interval=${RESTART_INTERVAL:-none}
Expand All @@ -82,9 +88,9 @@ sed -e "s/@restart_interval@/${restart_interval}/" -e "s/@history_interval@/${hi
-e "s/@diag_interval@/${diag_interval}/" -e "s/@lbc_interval@/${lbc_interval}/" \
-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!

sed -i '/<stream name="da_state"/,/<\/stream>/d' streams.atmosphere
fi
#fi
#
# chemistry related processing
if [[ "${DO_CHEMISTRY^^}" == "TRUE" ]]; then
Expand Down
46 changes: 33 additions & 13 deletions scripts/exrrfs_prep_chem.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
# 1. CHEM_GROUP -- which chem emission group is this task performing? (anthro, pollen, dust)
# 2. ANTHRO_EMISINV -- undecided, may merge for custom dataset, or leave option to combine
# 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.

#
# shellcheck disable=SC1091,SC2153,SC2154,SC2034
# rrfslint: file-disable=all
Expand All @@ -28,11 +29,13 @@
#
fcst_len_hrs_cycles=${FCST_LEN_HRS_CYCLES:-"01 01"}
my_fcst_length=$("${USHrrfs}/find_fcst_length.sh" "${fcst_len_hrs_cycles}" "${cyc}" )
export FCST_LENGTH="${my_fcst_length}"
echo "forecast length for this cycle is ${my_fcst_length}"
#
# ... Set some date variables
#
timestr=$(date -d "${CDATE:0:8} ${CDATE:8:2}" +%Y-%m-%d_%H.%M.%S)
JJJ=$(date -d "${CDATE:0:8} ${CDATE:8:2}" +%j)
YYYY=$(date -d "${CDATE:0:8} ${CDATE:8:2}" +%Y)
MM=$(date -d "${CDATE:0:8} ${CDATE:8:2}" +%m)
DD=$(date -d "${CDATE:0:8} ${CDATE:8:2}" +%d)
Expand All @@ -50,12 +53,12 @@
DDp=$(date -d "${CDATE:0:8} ${CDATE:8:2} - 1 day" +%d)
HHp=$(date -d "${CDATE:0:8} ${CDATE:8:2}- 1 day" +%H)
#
current_day=$(date -d "${YYYY}${MM}${DD}")
current_hh=$(date -d "${HH}" +"%H")
current_day="${YYYY}${MM}${DD}" #$(date -d "${YYYY}${MM}${DD}")
current_hh="${HH}" #$(date -d "${HH}" +"%H")
#
prev_hh=$(date -d "$current_hh -24 hour" +"%H")
#prev_hh=$(date -d "$current_hh -24 hour" +"%H")
previous_day=$(date '+%C%y%m%d' -d "$current_day-1 days")
previous_day="${previous_day} ${prev_hh}"
previous_day="${previous_day} ${HH}"
#
if [[ ${DOW} -le 5 ]]; then
DOW_STRING=weekdy
Expand Down Expand Up @@ -85,25 +88,38 @@
DOY_END=$(date -d "${CDATE:0:8} ${CDATE:8:2} + ${my_fcst_length} hours" +%j) # Julian day
#
# Set the init/mesh file name and link here:\
if [[ -r "${UMBRELLA_PREP_IC_DATA}"/init.nc ]]; then
if [[ -r "${FIXrrfs}/${MESH_NAME}/${MESH_NAME}.static.nc" ]]; then
ln -sf "${FIXrrfs}/${MESH_NAME}/${MESH_NAME}.static.nc" init.nc
INIT_FILE=./init.nc
elif [[ -r "${UMBRELLA_PREP_IC_DATA}"/init.nc ]]; then
ln -sf "${UMBRELLA_PREP_IC_DATA}"/init.nc init.nc
INIT_FILE=./${MESH_NAME}.init.nc
INIT_FILE=./init.nc
elif [[ -r "${UMBRELLA_PREP_IC_DATA}"/mpasout.nc ]]; then
ln -sf "${UMBRELLA_PREP_IC_DATA}"/mpasout.nc init.nc
INIT_FILE=./init.nc
else
echo "WARNING: NO Init File available, cannot reinterpolate if files are missing, did you run the task out of order?"
echo "FATAL: NO Init File available, cannot reinterpolate if files are missing, did you run the task out of order?"
err_exit
fi

#
SCRIPT=${USHrrfs}/chem_regrid.py
VINTERP_SCRIPT=${USHrrfs}/chem_vinterp.py
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

Check failure

Code scanning / shellcheck

Argument to implicit -n is always true due to literal strings. Error

Argument to implicit -n is always true due to literal strings.
ln -s "${SCRIP_FILES_DIR}/mpas_${MESH_NAME}_scrip.nc" ./
else
echo "WARNING: NO SCRIP file available for this domain in ${SCRIP_FILES_DIR}, you will need to supply it as an argument to ${SCRIPT}"
fi
#
#
# Set a few things for the CONDA environment
export REGRID_WRAPPER_LOG_DIR=${DATA}
regrid_wrapper_dir=${REGRID_WRAPPER_DIR} #/lfs5/BMC/rtwbl/rap-chem/mpas_rt/working/ben_interp/regrid-wrapper/
PYTHONDIR=${regrid_wrapper_dir}/src
regrid_conda_env=${REGRID_CONDA_ENV} #CONDAENV=/lfs5/BMC/rtwbl/rap-chem/miniconda/envs/regrid-wrapper
export PATH=${regrid_conda_env}/bin:${PATH}
export ESMFMKFILE=${regrid_conda_env}/lib/esmf.mk
#regrid_conda_env=${REGRID_CONDA_ENV} #CONDAENV=/lfs5/BMC/rtwbl/rap-chem/miniconda/envs/regrid-wrapper
#export PATH=${regrid_conda_env}/bin:${PATH}
#export ESMFMKFILE=${regrid_conda_env}/lib/esmf.mk
export PYTHONPATH=${PYTHONDIR}:${PYTHONPATH}
#
#==================================================================================================#
Expand All @@ -123,6 +139,10 @@
source "${USHrrfs}"/chem_prep_pollen.sh
fi # bio/pollen

if [[ "${CHEM_GROUP}" == "GOES_AOD" ]] ; then
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

if [[ ! -s "${FIXrrfs}/chemistry/dust/fengsha_dust_inputs.${MESH_NAME}.nc" ]]; then
source "${HOMErrfs}/workflow/tools/chem_prep_dust.sh"
Expand Down
2 changes: 1 addition & 1 deletion 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!

1 change: 1 addition & 0 deletions sorc/regrid-wrapper
Submodule regrid-wrapper added at 769e48
54 changes: 35 additions & 19 deletions ush/chem_fcst.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ cat "${FIXrrfs}/chemistry/stream_list/stream_list.atmosphere.output" >> ./stream
# Biogenic/Pollen
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!

cat "${FIXrrfs}/chemistry/stream_list/stream_list.atmosphere.output.pollen" >> ./stream_list/stream_list.atmosphere.output
ln -snf "${UMBRELLA_PREP_CHEM_DATA}"/bio.init.nc bio.init.nc
sed -i "s/config_pollen_scheme\s*=\s*'off'/config_pollen_scheme = 'speciated_pollen_primary'/g" namelist.atmosphere
sed -i "s/config_pollen_scheme\s*=\s*'off'/config_pollen_scheme = 'speciated_primary'/g" namelist.atmosphere
num_chem=$(( num_chem + 4 ))
else
echo "WARNING: No pollen emission file exists"
Expand All @@ -26,7 +26,7 @@ if [[ "${CHEM_GROUPS,,}" == *dust* ]]; then
if [[ -s "${FIXrrfs}/chemistry/dust/fengsha_dust_inputs.${MESH_NAME}.nc" ]]; then
ln -snf "${FIXrrfs}/chemistry/dust/fengsha_dust_inputs.${MESH_NAME}.nc" dust.init.nc
cat "${FIXrrfs}/chemistry/stream_list/stream_list.atmosphere.output.dust" >> ./stream_list/stream_list.atmosphere.output
sed -i "\${e} cat ${PARMrrfs}/chemistry/streams.atmosphere.dust" streams.atmosphere
sed -i "\$e cat ${PARMrrfs}/chemistry/streams.atmosphere.dust" streams.atmosphere
sed -i "s/config_dust_scheme\s*=\s*'off'/config_dust_scheme = 'on'/g" namelist.atmosphere
num_chem=$(( num_chem + 2 ))
# Append the xtime variable if it is missing
Expand All @@ -44,32 +44,39 @@ save_nullglob=$(shopt -p nullglob)
shopt -s nullglob

# Anthropogenic
if [[ "${CHEM_GROUPS,,}" == *anthro* ]]; then
files=("${UMBRELLA_PREP_CHEM_DATA}"/anthro.init*)
if (( ${#files[@]} )); then # at least one file exists
sed -i "\${e} cat ${PARMrrfs}/chemistry/streams.atmosphere.anthro" streams.atmosphere
sed -i "\$e cat ${PARMrrfs}/chemistry/streams.atmosphere.anthro" streams.atmosphere
ln -snf "${UMBRELLA_PREP_CHEM_DATA}"/anthro.init* ./
ptfiles=("${UMBRELLA_PREP_CHEM_DATA}"/anthro_pt.*)
if (( ${#ptfiles[@]} )); then
sed -i "\$e cat ${PARMrrfs}/chemistry/streams.atmosphere.anthro_pt" streams.atmosphere
sed -i "s/config_anthro_pt_scheme\s*=\s*'off'/config_anthro_pt_scheme = 'on'/g" namelist.atmosphere
ln -snf "${UMBRELLA_PREP_CHEM_DATA}"/anthro_pt.* ./
fi
for ifl in anthro*.nc
do
ncks -O -6 "${ifl}" "${ifl}"
done
#
if [[ "${CHEM_GROUPS,,}" == *anthro* ]]; then
sed -i "s/config_anthro_scheme\s*=\s*'off'/config_anthro_scheme = 'on'/g" namelist.atmosphere
num_chem=$(( num_chem + 6 ))
if [[ "${CHEM_GROUPS,,}" == *dust* ]]; then
num_chem=$(( num_chem - 2 ))
fi
if [[ "${CHEM_GROUPS,,}" == *smoke* ]]; then
num_chem=$(( num_chem - 2 ))
fi
sed -i "s/config_anthro_scheme\s*=\s*'off'/config_anthro_scheme = 'simple_aero'/g" namelist.atmosphere
num_chem=$(( num_chem + 1 ))
if [[ "${CONFIG_COARSE}" == "TRUE" ]]; then
num_chem=$(( num_chem + 1 ))
fi
fi
fi

# Smoke/Wildfire
files=("${UMBRELLA_PREP_CHEM_DATA}"/smoke.init*)
if (( ${#files[@]} )); then # at least one file exists
cat "${FIXrrfs}/chemistry/stream_list/stream_list.atmosphere.output.smoke" >> ./stream_list/stream_list.atmosphere.output
#
if (( EBB_DCYCLE == 1 )); then # Diurnal cycle for EBB (Emissions from Biomass Burning)
sed -i "\${e} cat ${PARMrrfs}/chemistry/streams.atmosphere.smoke_retro" streams.atmosphere
if (( EBB_DCYCLE == 1 )) || (( EBB_DCYCLE == -1 )); then # Diurnal cycle for EBB (Emissions from Biomass Burning)
sed -i "\$e cat ${PARMrrfs}/chemistry/streams.atmosphere.smoke_retro" streams.atmosphere
elif (( EBB_DCYCLE == 2 )); then
sed -i "\${e} cat ${PARMrrfs}/chemistry/streams.atmosphere.smoke_forecast" streams.atmosphere
sed -i "\$e cat ${PARMrrfs}/chemistry/streams.atmosphere.smoke_forecast" streams.atmosphere
else
echo "Not appending any smoke stream"
fi
Expand All @@ -78,18 +85,27 @@ if (( ${#files[@]} )); then # at least one file exists
#
if [[ "${CHEM_GROUPS,,}" == *smoke* ]]; then
sed -i "s/config_smoke_scheme\s*=\s*'off'/config_smoke_scheme = 'on'/g" namelist.atmosphere
num_chem=$(( num_chem + 2 ))
num_chem=$(( num_chem + 1 ))
added_smoke="TRUE"
fi
if [[ "${CONFIG_COARSE}" == "TRUE" ]]; then
num_chem=$(( num_chem + 1 ))
fi
# Set EBB_DCYCLE
sed -i -e "s/@ebb_dcycle@/${EBB_DCYCLE}/" namelist.atmosphere
fi

# RWC - Residual Wood Combustion
if [[ -s "${UMBRELLA_PREP_CHEM_DATA}/rwc.init.nc" ]]; then
sed -i "\${e} cat ${PARMrrfs}/chemistry/streams.atmosphere.rwc" streams.atmosphere
sed -i "\$e cat ${PARMrrfs}/chemistry/streams.atmosphere.rwc" streams.atmosphere
ln -snf "${UMBRELLA_PREP_CHEM_DATA}"/rwc.init.nc rwc.init.nc
# Set namelist
#sed -e "s/@online_rwc_emis@/1/" "${PARMrrfs}"/namelist.atmosphere > namelist.atmosphere
sed -i "s/config_rwc_scheme\s*=\s*'off'/config_rwc_scheme = 'on'/g" namelist.atmosphere
if [[ "${added_smoke}" == "TRUE" ]]; then
echo "Smoke already added and num_chem adjusted"
else
num_chem=$(( num_chem + 1 ))
fi
fi
#
# Replace the num_chem value with the correct number
Expand Down
Loading
Loading