-
Notifications
You must be signed in to change notification settings - Fork 14
CLM5 Fruit Tree v1.1 #97
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
Draft
kvrigor
wants to merge
13
commits into
master
Choose a base branch
from
CLM5_FruitTree_v1.1
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Member
Author
Patching strategy#
# 1. Create working directories
#
PATCH_WORKDIR=$HOME/CLM_FruitTree
PATCHFILES_DIR=$PATCH_WORKDIR/patch_files
eCLM_DIR=$PATCH_WORKDIR/eCLM
CLM5_DIR=$PATCH_WORKDIR/CLM5
mkdir -vp ${PATCHFILES_DIR}
#
# 2. Clone repos
#
cd ${PATCH_WORKDIR}
git clone -b master https://github.com/HPSCTerrSys/eCLM.git
git clone -b release-clm5.0_FruitTree https://github.com/odombro/CTSM CLM5
#
# 3. Get a grasp of changed files
#
# Show last 20 commits leading to the official release (CLM5_FruitTree_v1.1)
cd $CLM5_DIR
git log --pretty=format:"%h %as %<(15,trunc)%an %<(30,trunc)%s %d" -20 CLM5_FruitTree_v1.1 | cat
#
# 59b6a3009 2023-07-17 OlgaDom Corrected flux assignment fr.. (tag: CLM5_FruitTree_v1.1)
# 7edde0ba8 2022-11-15 OlgaDom cleaned up some scripts, add..
# a6bd8ded3 2022-11-15 OlgaDom added new subroutine for orc..
# 2a21cb018 2022-11-04 OlgaDom Fix orchard rotation carbon ..
# 17f3e8ae6 2022-10-18 OlgaDom debug planting of fruit tree..
# 7c9a3bbc8 2022-08-17 OlgaDom Included harvest trigger whe..
# ad3d25b07 2022-05-30 OlgaDom Bug fix in CNPhenology and C..
# 57586d70e 2022-05-22 OlgaDom added references to CLM-Palm..
# 2a6d95e08 2022-05-05 OlgaDom Update parameter file with t..
# 093c985b9 2022-05-05 OlgaDom Make taper and nstem PFT par..
# 87b35bed2 2022-03-14 OlgaDom Correct orchard rotation/rep..
# 64c874934 2022-02-09 OlgaDom Update README (tag: CLM5_FruitTree)
# 7b823206d 2022-02-09 OlgaDom Update README
# 2a1f5b91d 2022-02-09 odombro Update README
# c4f164e92 2022-02-08 odombro Update README
# 9fa4d0dfe 2022-02-08 Olga Dombrowski Implement CLM-FruitTree sub-..
# d2b270654 2021-11-30 Bill Sacks Merge pull request #1568 fro.. (origin/release-clm5.0)
# d035667e3 2021-11-30 Keith Oleson Fix errors in technical note..
# 4d9bb14b9 2021-09-08 Bill Sacks Merge pull request #1480 fro..
# 3c00edf2b 2021-09-07 Samuel Levis Bringing a copy of master_li..
#
# List modified files under src/ folder starting from the commit after release-clm5.0 (9fa4d0dfe) to CLM5_FruitTree_v1.1 (59b6a3009)
git diff origin/release-clm5.0..CLM5_FruitTree_v1.1 --numstat -- src | cat
# +++ ---
# 3 3 src/biogeochem/CNBalanceCheckMod.F90
# 13 3 src/biogeochem/CNCIsoFluxMod.F90
# 97 38 src/biogeochem/CNCStateUpdate1Mod.F90
# 0 2 src/biogeochem/CNCStateUpdate2Mod.F90
# 6 3 src/biogeochem/CNDriverMod.F90
# 5 3 src/biogeochem/CNFUNMod.F90
# 21 9 src/biogeochem/CNGRespMod.F90
# 3 2 src/biogeochem/CNGapMortalityMod.F90
# 4 1 src/biogeochem/CNMRespMod.F90
# 73 27 src/biogeochem/CNNStateUpdate1Mod.F90
# 1875 581 src/biogeochem/CNPhenologyMod.F90
# 65 5 src/biogeochem/CNVegCarbonFluxType.F90
# 51 13 src/biogeochem/CNVegCarbonStateType.F90
# 2 2 src/biogeochem/CNVegComputeSeedMod.F90
# 39 2 src/biogeochem/CNVegNitrogenFluxType.F90
# 38 2 src/biogeochem/CNVegNitrogenStateType.F90
# 157 5 src/biogeochem/CNVegStateType.F90
# 31 27 src/biogeochem/CNVegStructUpdateMod.F90
# 9 2 src/biogeochem/CropType.F90
# 383 120 src/biogeochem/NutrientCompetitionFlexibleCNMod.F90
# 6 6 src/biogeochem/dynHarvestMod.F90
# 31 1 src/biogeophys/TemperatureType.F90
# 91 2 src/main/pftconMod.F90
#
#
# 4. Generate FruitTree patchset
#
git -C ${CLM5_DIR} format-patch --output-directory ${PATCHFILES_DIR} origin/release-clm5.0..CLM5_FruitTree_v1.1
#
# /home/user/CLM_FruitTree/patch_files/0001-Implement-CLM-FruitTree-sub-model-for-deciduous-frui.patch
# /home/user/CLM_FruitTree/patch_files/0002-Update-README.patch
# /home/user/CLM_FruitTree/patch_files/0003-Update-README.patch
# /home/user/CLM_FruitTree/patch_files/0004-Update-README.patch
# /home/user/CLM_FruitTree/patch_files/0005-Update-README.patch
# /home/user/CLM_FruitTree/patch_files/0006-Correct-orchard-rotation-replanting-trigger.patch
# /home/user/CLM_FruitTree/patch_files/0007-Make-taper-and-nstem-PFT-parameters-to-be-set-in-par.patch
# /home/user/CLM_FruitTree/patch_files/0008-Update-parameter-file-with-taper-and-nstem-parameter.patch
# /home/user/CLM_FruitTree/patch_files/0009-added-references-to-CLM-Palm-Fan-et-al.-2015.patch
# /home/user/CLM_FruitTree/patch_files/0010-Bug-fix-in-CNPhenology-and-CNVegStructUpdateMod-and-.patch
# /home/user/CLM_FruitTree/patch_files/0011-Included-harvest-trigger-when-leaf-offset-starts.patch
# /home/user/CLM_FruitTree/patch_files/0012-debug-planting-of-fruit-trees-make-two-more-CFTs-act.patch
# /home/user/CLM_FruitTree/patch_files/0013-Fix-orchard-rotation-carbon-balance-error.patch
# /home/user/CLM_FruitTree/patch_files/0014-added-new-subroutine-for-orchard-rotation.patch
# /home/user/CLM_FruitTree/patch_files/0015-cleaned-up-some-scripts-added-some-crop-types-to-act.patch
# /home/user/CLM_FruitTree/patch_files/0016-Corrected-flux-assignment-from-column-to-patch-level.patch
# /home/user/CLM_FruitTree/patch_files/0017-Update-README.patch
# /home/user/CLM_FruitTree/patch_files/0018-Update-README.patch
#
#
# 5. Transform CLM5 paths in patchfiles into their equivalent eCLM paths
#
# Show instances of CLM5 paths
grep -RE "src/(biogeochem|biogeophys|main)" $PATCHFILES_DIR
# src/* -> src/clm5/*
sed -i 's#src/biogeochem#src/clm5/biogeochem#g' ${PATCHFILES_DIR}/*.patch
sed -i 's#src/biogeophys#src/clm5/biogeophys#g' ${PATCHFILES_DIR}/*.patch
sed -i 's#src/main#src/clm5/main#g' $PATCHFILES_DIR/*.patch
# Check if sed worked
grep -RE "src/(biogeochem|biogeophys|main)" $PATCHFILES_DIR # should show no results
grep -RE "src/clm5/(biogeochem|biogeophys|main)" $PATCHFILES_DIR # show transformed paths
#
# 6. Apply FruitTree patchset to eCLM
#
cd ${eCLM_DIR}
git checkout -b CLM5_FruitTree_v1.1
# Start interactive patching
git am --ignore-whitespace $PATCHFILES_DIR/*
# The ff. patches include README updates which isn't in eCLM and thus skipped:
#
# /home/user/CLM_FruitTree/patch_files/0002-Update-README.patch
# /home/user/CLM_FruitTree/patch_files/0003-Update-README.patch
# /home/user/CLM_FruitTree/patch_files/0004-Update-README.patch
# /home/user/CLM_FruitTree/patch_files/0005-Update-README.patch
git am --show-current-patch=diff
git am --skip
# Show diff summary after patching
git log --pretty=format:"%h %as %<(15,trunc)%an %<(30,trunc)%s %d" -20 | cat
#
# acf0b4cbc 2023-07-17 OlgaDom Corrected flux assignment fr.. (HEAD -> CLM5_FruitTree_v1.1, origin/CLM5_FruitTree_v1.1)
# 1d07087dc 2022-11-15 OlgaDom cleaned up some scripts, add..
# be24b9368 2022-11-15 OlgaDom added new subroutine for orc..
# 1dbab6aeb 2022-11-04 OlgaDom Fix orchard rotation carbon ..
# cbf5e76d5 2022-10-18 OlgaDom debug planting of fruit tree..
# 288c754ca 2022-08-17 OlgaDom Included harvest trigger whe..
# 27db3e604 2022-05-30 OlgaDom Bug fix in CNPhenology and C..
# 9e8401d62 2022-05-22 OlgaDom added references to CLM-Palm..
# 3eef0a65b 2022-05-05 OlgaDom Update parameter file with t..
# 99dca29bc 2022-05-05 OlgaDom Make taper and nstem PFT par..
# 50fddc120 2022-03-14 OlgaDom Correct orchard rotation/rep..
# 3fe2de2d8 2022-02-09 OlgaDom Update README
# 1bcfffbd5 2022-02-08 Olga Dombrowski Implement CLM-FruitTree sub-..
# e1781edc1 2025-12-02 Johannes Keller PDAF-related: GRACE-DA chang.. (origin/master, origin/dev-merge-eclm_with_FT_WC, origin/HEAD, master)
# cece7aa74 2025-12-02 Johannes Keller Set cpl_inst_tag from pdaf_i..
# 91d5f7b40 2025-11-25 Johannes Keller Soil Hydraulic Parameter fro..
# 7877e5cc2 2025-11-21 Johannes Keller Soil Hydraulic Parameter Per..
# 860a68c49 2025-11-20 Johannes Keller PDAF-related perturbation ro..
# 7853ec4db 2025-11-04 Johannes Keller docs: secure jupyter-book v1..
# 923b0fcd1 2025-10-02 Paul Rigor Fixed wrong working director..
# Show eCLM files modified by the FruitTree patchset
git diff master..acf0b4cbc --numstat | cat
# +++ ---
# - - clm5_params.c171117__FruitTree.nc
# 3 3 src/clm5/biogeochem/CNBalanceCheckMod.F90
# 13 3 src/clm5/biogeochem/CNCIsoFluxMod.F90
# 97 38 src/clm5/biogeochem/CNCStateUpdate1Mod.F90
# 0 2 src/clm5/biogeochem/CNCStateUpdate2Mod.F90
# 6 3 src/clm5/biogeochem/CNDriverMod.F90
# 5 3 src/clm5/biogeochem/CNFUNMod.F90
# 21 9 src/clm5/biogeochem/CNGRespMod.F90
# 3 2 src/clm5/biogeochem/CNGapMortalityMod.F90
# 4 1 src/clm5/biogeochem/CNMRespMod.F90
# 73 27 src/clm5/biogeochem/CNNStateUpdate1Mod.F90
# 1875 581 src/clm5/biogeochem/CNPhenologyMod.F90
# 65 5 src/clm5/biogeochem/CNVegCarbonFluxType.F90
# 51 13 src/clm5/biogeochem/CNVegCarbonStateType.F90
# 2 2 src/clm5/biogeochem/CNVegComputeSeedMod.F90
# 39 2 src/clm5/biogeochem/CNVegNitrogenFluxType.F90
# 38 2 src/clm5/biogeochem/CNVegNitrogenStateType.F90
# 157 5 src/clm5/biogeochem/CNVegStateType.F90
# 31 27 src/clm5/biogeochem/CNVegStructUpdateMod.F90
# 9 2 src/clm5/biogeochem/CropType.F90
# 383 120 src/clm5/biogeochem/NutrientCompetitionFlexibleCNMod.F90
# 6 6 src/clm5/biogeochem/dynHarvestMod.F90
# 31 1 src/clm5/biogeophys/TemperatureType.F90
# 91 2 src/clm5/main/pftconMod.F90
|
kvrigor
commented
Jan 21, 2026
| call ncd_io('season_decid', this%season_decid, 'read', ncid, readvar=readv, posNOTonfile=.true.) | ||
| if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) | ||
|
|
||
| call ncd_io('perennial', this%perennial, 'read', ncid, readvar=readv, posNOTonfile=.true.) |
Member
Author
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Requiring perennial and mulch_pruning in the PFT file is causing the CI failure. Some adjustments are necessary to make this parameters optional.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Equivalent to CLM5_FruitTree_v1.1 by @odombro.