Skip to content

Commit

Permalink
Do not increment CO2_YEAR when it is no-data. For Catchment simulatio…
Browse files Browse the repository at this point in the history
…ns, exclude CatchCN-specific resource variables from LDAS.rc (#51).
  • Loading branch information
gmao-rreichle committed Jun 14, 2024
2 parents 56b0975 + 359c4d6 commit b359a1f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
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

0 comments on commit b359a1f

Please sign in to comment.