Skip to content

Commit

Permalink
fix co2_year
Browse files Browse the repository at this point in the history
  • Loading branch information
weiyuan-jiang committed Jun 7, 2024
1 parent 9d6d699 commit eeb26ea
Show file tree
Hide file tree
Showing 2 changed files with 5 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 update CO2_YEAR when it is a no-value
- 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.

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 eeb26ea

Please sign in to comment.