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

Winter wheat changes by Theresa Boas #45

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

kvrigor
Copy link
Member

@kvrigor kvrigor commented Oct 7, 2024

Equivalent to winter wheat CLM5 patches by @tboas. Modifications include:

  1. Addition of several CFTs to source code files for active simulation (as opposed to being merged into other CFTs)
  2. Addition of winter wheat subroutines after Lu et al. (2017): https://doi.org/10.5194/gmd-10-1873-2017
  3. Addition of cover cropping subroutine that allows multiple crop types on the same column within one year

For additional information and results please see:

Boas, T., Bogena, H., Grünwald, T., Heinesch, B., Ryu, D., Schmidt, M., Vereecken, H., Western, A., and Hendricks Franssen, H.-J.: Improving the representation of cropland sites in the Community Land Model (CLM) version 5.0, Geosci. Model Dev., 14, 573–601, https://doi.org/10.5194/gmd-14-573-2021, 2021.

@kvrigor
Copy link
Member Author

kvrigor commented Oct 7, 2024

Patching strategy

# *****************************
# 1. Set useful shell variables
# *****************************

# Directories
eCLM_DIR="/path/to/eCLM"
WORKDIR="/some/path/..."

# Winter wheat git info
WW_BRANCH="winter_wheat_cc"
WW_COMMIT_HASH="0b38504117e9d4b7e94586bdd26c631cc855266e"

# ************************************************************
# 2. Generate winter wheat patch file from Theresa's CLM5 fork
# ************************************************************

# Clone Theresa's winter wheat CLM5 branch
cd ${WORKDIR}
git clone -b ${WW_BRANCH} https://github.com/tboas/CTSM.git CLM5_WW
cd CLM5_WW

# Check changed files
git diff ${WW_COMMIT_HASH} --stat -- src

# Create patch file
git diff ${WW_COMMIT_HASH} -- src > ww_patch.diff
WW_PATCH=$(realpath ww_patch.diff)


# **************************************
# 3. Apply winter wheat patches to eCLM
# **************************************

# Go to eCLM and create winter wheat branch
cd ${eCLM_DIR}
git checkout -b ${WW_BRANCH}

# Transform CLM5 paths in patch file to equivalent paths in eCLM.
sed -i 's#/src/#/src/clm5/#g' ${WW_PATCH}

# Apply patch
git apply --ignore-space-change --ignore-whitespace ${WW_PATCH}

# Check if eCLM diffs correspond to original WW patch
git diff > ww_eclm_patch.diff
git diff --no-index ww_eclm_patch.diff ${WW_PATCH}  # <- should have no diffs here!

@kvrigor kvrigor changed the title Winter wheat changes by Theresa boas Winter wheat changes by Theresa Boas Oct 7, 2024
@AGonzalezNicolas
Copy link
Contributor

Do you have a comparison between clm5-Winter_Wheat and eclm-Winter_Wheat?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants