Skip to content

Commit b359a1f

Browse files
Do not increment CO2_YEAR when it is no-data. For Catchment simulations, exclude CatchCN-specific resource variables from LDAS.rc (#51).
2 parents 56b0975 + 359c4d6 commit b359a1f

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1717

1818
### Fixed
1919

20+
- Do not increment CO2_YEAR when it is a no-data-value. For Catchment simulations, exclude CatchCN-specific resource variables from LDAS.rc.
2021
- Bug fix and improved efficiency in matlab script for generation of mwRTM_param.
2122
- Changed EXPDIR to absolute path for POSTPROC_HIST>0 option to work.
2223
- Support HISTORY output of ASNOW alone from ENSAVG Gridcomp.

GEOSldas_App/ldas_setup

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1166,6 +1166,13 @@ class LDASsetup:
11661166
ldasrcInp[keyn]= valn
11671167
if('catchcn' in self.catch):
11681168
ldasrcInp['CO2_MonthlyMean_DiurnalCycle_FILE']= '../input/CO2_MonthlyMean_DiurnalCycle.nc4'
1169+
else:
1170+
# remove catchcn-specific entries that do not apply to catch model
1171+
ldasrcInp.pop('DTCN',None)
1172+
ldasrcInp.pop('ATM_CO2',None)
1173+
ldasrcInp.pop('CO2',None)
1174+
ldasrcInp.pop('CO2_YEAR',None)
1175+
ldasrcInp.pop('PRESCRIBE_DVG',None)
11691176

11701177
# create restart item in RC
11711178
catch_ = self.catch.upper()

GEOSldas_App/lenkf_j_template.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -788,19 +788,18 @@
788788
# update cap_restart
789789
# ##################
790790
791-
set CO2LINE = `grep -n -m 1 "CO2_YEAR" $HOMDIR/LDAS.rc | cut -d':' -f1`
791+
set CO2_BEFORE = `grep CO2_YEAR: LDAS.rc | cut -d':' -f2`
792792
793-
if ( $CO2LINE >= 1 ) then
793+
if ( $CO2_BEFORE >= 1 ) then
794794
795795
# Update reference year for Carbon Tracker CO2
796796
##############################################
797797
798-
set CO2_BEFORE = `sed -n "${{CO2LINE}}p;d" LDAS.rc | cut -d':' -f2`
799798
set CAP_BEFORE = `head -1 $HOMDIR/cap_restart | cut -c1-4`
800799
@ DY = $CAP_BEFORE - $CO2_BEFORE
801800
@ CO2_AFTER = `head -1 cap_restart | cut -c1-4` - $DY
802-
set CO2UPDATE = "CO2_YEAR: $CO2_AFTER"
803-
sed -i "${{CO2LINE}} s|.*|$CO2UPDATE|" LDAS.rc
801+
set CO2UPDATE = `echo "CO2_YEAR: "$CO2_AFTER`
802+
sed -i "/CO2_YEAR:/c\\$CO2UPDATE" LDAS.rc
804803
/bin/rm -f $HOMDIR//LDAS.rc
805804
/bin/cp -p LDAS.rc $HOMDIR/LDAS.rc
806805
endif

0 commit comments

Comments
 (0)