Skip to content

Commit

Permalink
Fixes to apply optimized OH scale factors to posterior simulation (#287)
Browse files Browse the repository at this point in the history
  • Loading branch information
megan-he authored Nov 13, 2024
1 parent 88558f5 commit e6a2a66
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/components/posterior_component/posterior.sh
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,16 @@ run_posterior() {
OHPertPrevLine='DEFAULT 0 1.0'
OHPertNewLine="N_HEMIS 1 ${oh_sfs[0]}\nS_HEMIS 2 ${oh_sfs[1]}"
sed -i "/$OHPertPrevLine/a $OHPertNewLine" PerturbationsOH.txt

# Modify OH scale factor in HEMCO config
sed -i -e "s|AnalyticalInversion : false|AnalyticalInversion : true|g" HEMCO_Config.rc
sed -i -e "s| OH_pert_factor 1.0 - - - xy 1 1| OH_pert_factor PerturbationsOH.txt - - - xy 1 1|g" HEMCO_Config.rc

HcoPrevLineMask='CH4_STATE_VECTOR'
HcoNextLineMask='* HEMIS_MASK $ROOT\/MASKS\/v2024-08\/hemisphere_mask.01x01.nc Hemisphere 2000\/1\/1\/0 C xy 1 * - 1 1
'
sed -i "/${HcoPrevLineMask}/a ${HcoNextLineMask}" HEMCO_Config.rc

printf "OH optimized perturbation values set to:\n"
printf " ${oh_sfs[0]} for Northern Hemisphere\n"
printf " ${oh_sfs[1]} for Southern Hemisphere\n"
Expand Down

0 comments on commit e6a2a66

Please sign in to comment.