Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for HEMCO diagnostic config file HEMCO_Diagn.rc #2402

Merged
Merged
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- Added ModelEe.2 (GCAP 2.0) simulation to integration tests for GCClassic
- Added simulation with all diagnostics on in HISTORY.rc to integration tests for GCClassic (including Planeflight + ObsPack) and GCHP
- Added descriptive error message in `Interfaces/GCHP/gchp_historyexportsmod.F90`
- Auto-update GCHP HEMCO_Diagn.rc settings at run-time to ensure seasalt, dust, soil NOx, and biogenic emissions match settings in HEMCO_Config.rc

### Fixed
- Added brackets around `exempt-issue-labels` list in `.github/workflows/stale.yml`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ EmisMGLY_BioBurn MGLY 111 -1 -1 2 kg/m2/s MGLY_emission_flux_from_b
EmisMOH_Total MOH -1 -1 -1 3 kg/m2/s MOH_emission_flux_from_all_sectors
EmisMOH_Anthro MOH 0 1 -1 3 kg/m2/s MOH_emission_flux_from_anthropogenic
EmisMOH_BioBurn MOH 111 -1 -1 2 kg/m2/s MOH_emission_flux_from_biomass_burning
EmisMOH_Biogenic MOH 108 -1 -1 2 kg/m2/s MOH_emission_flux_from_biogenic_sources
EmisMOH_Biogenic MOH 0 4 -1 2 kg/m2/s MOH_emission_flux_from_biogenic_sources
EmisMOH_Ocean MOH 101 -1 -1 2 kg/m2/s MOH_emission_flux_from_ocean
EmisMOH_Ship MOH 0 10 -1 2 kg/m2/s MOH_emission_flux_from_ships

Expand Down
2 changes: 1 addition & 1 deletion run/GCHP/HEMCO_Diagn.rc.templates/HEMCO_Diagn.rc.fullchem
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ EmisMGLY_BioBurn MGLY 111 -1 -1 2 kg/m2/s MGLY_emission_flux_from_b
EmisMOH_Total MOH -1 -1 -1 3 kg/m2/s MOH_emission_flux_from_all_sectors
EmisMOH_Anthro MOH 0 1 -1 3 kg/m2/s MOH_emission_flux_from_anthropogenic
EmisMOH_BioBurn MOH 111 -1 -1 2 kg/m2/s MOH_emission_flux_from_biomass_burning
EmisMOH_Biogenic MOH 108 -1 -1 2 kg/m2/s MOH_emission_flux_from_biogenic_sources
EmisMOH_Biogenic MOH 0 4 -1 2 kg/m2/s MOH_emission_flux_from_biogenic_sources
EmisMOH_Ocean MOH 101 -1 -1 2 kg/m2/s MOH_emission_flux_from_ocean
EmisMOH_Ship MOH 0 10 -1 2 kg/m2/s MOH_emission_flux_from_ships

Expand Down
56 changes: 56 additions & 0 deletions run/GCHP/setCommonRunSettings.sh.template
Original file line number Diff line number Diff line change
Expand Up @@ -773,6 +773,62 @@ if [[ ${lightningClimEntry} != "missing" ]]; then
fi
fi

#### Auto-update offline/online emissions settings in HEMCO_Diagn.rc based on HEMCO_Config.rc
# NOTES:
# - Includes seasalt, soilNOx, dust, and biogenic emissions only
# - Sets Emis* diagnostics to extension emissions if extension is on in HEMCO_Config.rc
# - Sets Emis* diagnostics to base emissions (offline) if extension is off in HEMCO_Config.rc

# Dust
dustExt=$(grep "105.*DustDead" HEMCO_Config.rc || echo "missing")
if [[ ${dustExt} != "missing" ]]; then
dustSetting=(${dustExt// / })
if [[ ${dustSetting[3]} = "on" ]]; then
sed -i -e 's|0 3 |105 -1|' HEMCO_Diagn.rc
else
sed -i -e 's|105 -1|0 3 |' HEMCO_Diagn.rc
fi
fi

# Sea salt
seasExt=$(grep "107.*SeaSalt" HEMCO_Config.rc || echo "missing")
if [[ ${seasExt} != "missing" ]]; then
seasSetting=(${seasExt// / })
if [[ ${seasSetting[3]} = "on" ]]; then
sed -i -e 's|SALA 0 3 |SALA 107 -1|' HEMCO_Diagn.rc
sed -i -e 's|SALC 0 3 |SALC 107 -1|' HEMCO_Diagn.rc
sed -i -e 's|AL 0 3 |AL 107 -1|' HEMCO_Diagn.rc
sed -i -e 's|CL 0 3 |CL 107 -1|' HEMCO_Diagn.rc
else
sed -i -e 's|SALA 107 -1|SALA 0 3 |' HEMCO_Diagn.rc
sed -i -e 's|SALC 107 -1|SALC 0 3 |' HEMCO_Diagn.rc
sed -i -e 's|AL 107 -1|AL 0 3 |' HEMCO_Diagn.rc
sed -i -e 's|CL 107 -1|CL 0 3 |' HEMCO_Diagn.rc
fi
fi

# Biogenic
biogExt=$(grep "108.*MEGAN" HEMCO_Config.rc || echo "missing")
if [[ ${biogExt} != "missing" ]]; then
biogSetting=(${biogExt// / })
if [[ ${biogSetting[3]} = "on" ]]; then
sed -i -e 's|0 4 |108 -1|' HEMCO_Diagn.rc
else
sed -i -e 's|108 -1|0 4 |' HEMCO_Diagn.rc
fi
fi

# SoilNOx
soilExt=$(grep "104.*SoilNOx" HEMCO_Config.rc || echo "missing")
if [[ ${soilExt} != "missing" ]]; then
soilSetting=(${soilExt// / })
if [[ ${soilSetting[3]} = "on" ]]; then
sed -i -e 's|NO 0 3 |NO 104 -1|' HEMCO_Diagn.rc
else
sed -i -e 's|NO 104 -1|NO 0 3 |' HEMCO_Diagn.rc
fi
fi

#### Done
print_msg " "
print_msg "setCommonRunSettings.sh done"
Expand Down