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

do not update CO2_YEAR during simulation when CO2_YEAR is no-data; for Catch, exclude CatchCN rc vars from LDAS.rc #51

Merged
merged 5 commits into from
Jun 14, 2024
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 @@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed

- Do not increment CO2_YEAR when it is a no-data-value. For Catchment simulations, exclude CatchCN-specific resource variables from LDAS.rc.
- Bug fix and improved efficiency in matlab script for generation of mwRTM_param.
- Changed EXPDIR to absolute path for POSTPROC_HIST>0 option to work.
- Support HISTORY output of ASNOW alone from ENSAVG Gridcomp.
Expand Down
7 changes: 7 additions & 0 deletions GEOSldas_App/ldas_setup
Original file line number Diff line number Diff line change
Expand Up @@ -1166,6 +1166,13 @@ class LDASsetup:
ldasrcInp[keyn]= valn
if('catchcn' in self.catch):
ldasrcInp['CO2_MonthlyMean_DiurnalCycle_FILE']= '../input/CO2_MonthlyMean_DiurnalCycle.nc4'
else:
# remove catchcn-specific entries that do not apply to catch model
ldasrcInp.pop('DTCN',None)
ldasrcInp.pop('ATM_CO2',None)
ldasrcInp.pop('CO2',None)
ldasrcInp.pop('CO2_YEAR',None)
ldasrcInp.pop('PRESCRIBE_DVG',None)

# create restart item in RC
catch_ = self.catch.upper()
Expand Down
9 changes: 4 additions & 5 deletions GEOSldas_App/lenkf_j_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -788,19 +788,18 @@
# update cap_restart
# ##################

set CO2LINE = `grep -n -m 1 "CO2_YEAR" $HOMDIR/LDAS.rc | cut -d':' -f1`
set CO2_BEFORE = `grep CO2_YEAR: LDAS.rc | cut -d':' -f2`

if ( $CO2LINE >= 1 ) then
if ( $CO2_BEFORE >= 1 ) then

# Update reference year for Carbon Tracker CO2
##############################################

set CO2_BEFORE = `sed -n "${{CO2LINE}}p;d" LDAS.rc | cut -d':' -f2`
set CAP_BEFORE = `head -1 $HOMDIR/cap_restart | cut -c1-4`
@ DY = $CAP_BEFORE - $CO2_BEFORE
@ CO2_AFTER = `head -1 cap_restart | cut -c1-4` - $DY
set CO2UPDATE = "CO2_YEAR: $CO2_AFTER"
sed -i "${{CO2LINE}} s|.*|$CO2UPDATE|" LDAS.rc
set CO2UPDATE = `echo "CO2_YEAR: "$CO2_AFTER`
sed -i "/CO2_YEAR:/c\\$CO2UPDATE" LDAS.rc
/bin/rm -f $HOMDIR//LDAS.rc
/bin/cp -p LDAS.rc $HOMDIR/LDAS.rc
endif
Expand Down