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

ajk/cfe icefraction #49

Merged
merged 24 commits into from
Mar 15, 2022
Merged

ajk/cfe icefraction #49

merged 24 commits into from
Mar 15, 2022

Conversation

ajkhattak
Copy link
Contributor

@ajkhattak ajkhattak commented Feb 22, 2022

  1. Couples CFE with soil freeze-thaw (SFT) model
  2. Changes to runoff schemes (Schaake and Xinanjiang)
  3. Changes to BMI CFE input variables (new input variables are ice_fraction_schaake and ice_fraction_xinan) they both have different units
  4. Changes to BMI CFE output variables (BMI outputs storage, storage change at the timestep)
  5. Coupling requires CFE to provide/pass runoff scheme to CFE through BMI
  6. Basic functionality of the CFE, when run without the SFT model, is unaffected by the changes

Additions

  • cat_*_bmi_cfe.txt files need to provide urban_decimal_fraction if runoff scheme is Xinanjiang

Changes

  • Submodules for runoff schemes take an additional argument (ice_fraction) now.
  • Number of variables output to screen/console now includes ice_fraction and total storage

Testing

  1. Simulations using the pseudo framework make_and_run_bmi_pass_forcings_pet.sh give same results before and after the changes

Screenshots

Screen Shot 2022-02-22 at 2 55 15 PM

Checklist

  • PR has an informative and human-readable title
  • Changes are limited to a single goal (no scope creep)
  • Code can be automatically merged (no conflicts)
  • Code follows project standards (link if applicable)
  • Passes all existing automated tests
  • Any change in functionality is tested
  • New functions are documented (with a description, list of inputs, and expected output)
  • Placeholder code is flagged / future todos are captured in comments
  • Visually tested in supported browsers and devices (see checklist below 👇)
  • Project documentation has been updated (including the "Unreleased" section of the CHANGELOG)
  • Reviewers requested with the Reviewers tool ➡️

src/bmi_cfe.c Outdated Show resolved Hide resolved
src/bmi_cfe.c Outdated Show resolved Hide resolved
src/bmi_cfe.c Outdated Show resolved Hide resolved
src/bmi_cfe.c Outdated Show resolved Hide resolved
src/bmi_cfe.c Outdated Show resolved Hide resolved
src/cfe.c Outdated Show resolved Hide resolved
src/cfe.c Show resolved Hide resolved
src/cfe.c Show resolved Hide resolved
@madMatchstick
Copy link
Contributor

Note PR48 - Configuration file and parameter read-in changes was just merged. All config files now include [units]. e.g. see cat_87_bmi_config_cfe.txt. @ajkhattak When fetching upstream, can you please account for this change as well as adding any appropriate [units] to new params in both cat_87_bmi_config_cfe.txt & cat_87_bmi_config_cfe_pass.txt? -thanks

src/cfe.c Outdated Show resolved Hide resolved
src/cfe.c Outdated Show resolved Hide resolved
@madMatchstick
Copy link
Contributor

Suggest removing last # three lines from cat_87_*.txt (2) and including appropriate schaake only params in cat_58_*.txt (2) and/or cat_89_*.txt (3). Perhaps former where ice_fraction=1 & latter ice_fraction=0 (or vise versa)?

Best to maintain all files in /config with latest working version of bmi-cfe.

@rlmcdaniel
Copy link
Contributor

I suggest updating the documentation. It may be as simple as noting the option for including SFT (e.g. how to include or disable SFT). But other parameters within CFE, functionality changes, etc. should also be included somewhere in the documentation.

@ajkhattak
Copy link
Contributor Author

@madMatchstick I removed the three lines from cat_87 files. All other config files should work without any modifications. If CFE is not coupled to SFT, no additional parameters in the config files are needed.

@ajkhattak

This comment was marked as duplicate.

@ajkhattak ajkhattak closed this Mar 2, 2022
@madMatchstick
Copy link
Contributor

I suggest updating the documentation. It may be as simple as noting the option for including SFT (e.g. how to include or disable SFT). But other parameters within CFE, functionality changes, etc. should also be included somewhere in the documentation.

Noted, adding these changes to the cfe doc list! Thank you.

@ajkhattak ajkhattak reopened this Mar 2, 2022
ajkhattak and others added 4 commits March 2, 2022 15:54
documenting changes to cfe config files when coupled SFT model.
@madMatchstick madMatchstick self-requested a review March 2, 2022 21:10
@ajkhattak ajkhattak removed the request for review from madMatchstick March 3, 2022 01:33
…k within the ngen framework, also removed variables from the output list.
@SnowHydrology
Copy link
Contributor

@ajkhattak, I propose we change the merge branch for this PR from master to a new branch called cfe_soilfreezethaw. Given the number of changes proposed and some of the issues uncovered (when running in Nextgen, for example), I think it would be best to keep development in a non-master branch for now.

Additionally, the master branch of CFE is essentially a stable version we can use for testing formulations. When building ngen, users can fetch this stable version through a simple one-liner (git submodule update --remote extern/cfe/cfe). Considering we do not yet support C++ or have two-way coupling in ngen, I feel that having the stable version include SFT modifications may cause some confusion.

If you're okay with this, I will modify the PR accordingly. (Suggestions welcome from others!)

@SnowHydrology SnowHydrology changed the base branch from master to cfe_soilfreezethaw March 4, 2022 20:34
@SnowHydrology
Copy link
Contributor

I've changed the proposed merge branch to cfe_soilfreezethaw. We can work on cleaning up and merging this PR and then continue development (e.g., BMI modifications) in the new branch.

Copy link
Contributor

@madMatchstick madMatchstick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SnowHydrology - just confirming that we are NOT requiring this version to run in ngen, correct? (Hence the move to non-master, dev, branch.)

README.md Outdated Show resolved Hide resolved
@SnowHydrology
Copy link
Contributor

@SnowHydrology - just confirming that we are NOT requiring this version to run in ngen, correct? (Hence the move to non-master, dev, branch.)

@madMatchstick, that is correct. Please merge if it passes your review.

@ajkhattak
Copy link
Contributor Author

@SnowHydrology yes, Jess is correct. this branch won't run within the ngen framework due to coupling-related changes to bmi.

@ajkhattak
Copy link
Contributor Author

Sorry for the last confusing comment from me. I misread it. Anyway, I am going to merge this PR into cfe_soilfreezethaw

@ajkhattak ajkhattak merged commit 648bc99 into cfe_soilfreezethaw Mar 15, 2022
ajkhattak added a commit that referenced this pull request Aug 23, 2022
* changes to include ice fraction to the cfe runoff schemes.

* modified config file to add xinan urban fraction and minor changes to bm_cfe print header line.

* changes suggested in the PR#49, hard-coded parameters in the schaake scheme when ice fraction is used are moved to config file.

* added runoff ice_fraction parameters to cfe state variables.

* added units to the config files, minor changes bmi related to ice_content_threshold parameter unit.

* a minor change, moved cv_frz inside if condition.

* cleanup, config files and cfe.c

* Update README.md

documenting changes to cfe config files when coupled SFT model.

* Update README.md

* Update README.md

* typo in SFT section

* Update README.md

* removed ice_fraction variables from the bmi input list to make it work within the ngen framework, also removed variables from the output list.

* Reverting to 180c56f to use it in the pseudo framework.

* Adding ET to output

* adding gw and soil storage to output

* changes to include ice fraction to the cfe runoff schemes.

* changes suggested in the PR#49, hard-coded parameters in the schaake scheme when ice fraction is used are moved to config file.

* removed ice_fraction variables from the bmi input list to make it work within the ngen framework, also removed variables from the output list.

* Reverting to 180c56f to use it in the pseudo framework.

* name change: ice_fraction to sft_coupled.

* cleanup/renaming output variables.

* remove refs to `ngen` in README

Co-authored-by: JessicaGarrett-NOAA <30940444+madMatchstick@users.noreply.github.com>
Co-authored-by: lcunha0118 <luciana.k.cunha@gmail.com>
Co-authored-by: Keith Jennings <keithjennings@keiths-mbp.lan>
ajkhattak added a commit that referenced this pull request Oct 6, 2022
* ajk/cfe icefraction (#49)

* changes to include ice fraction to the cfe runoff schemes.

* modified config file to add xinan urban fraction and minor changes to bm_cfe print header line.

* changes suggested in the PR#49, hard-coded parameters in the schaake scheme when ice fraction is used are moved to config file.

* added runoff ice_fraction parameters to cfe state variables.

* added units to the config files, minor changes bmi related to ice_content_threshold parameter unit.

* a minor change, moved cv_frz inside if condition.

* cleanup, config files and cfe.c

* Update README.md

documenting changes to cfe config files when coupled SFT model.

* Update README.md

* Update README.md

* typo in SFT section

* Update README.md

* removed ice_fraction variables from the bmi input list to make it work within the ngen framework, also removed variables from the output list.

* Reverting to 180c56f to use it in the pseudo framework.

* Adding ET to output

* adding gw and soil storage to output

* changes to include ice fraction to the cfe runoff schemes.

* changes suggested in the PR#49, hard-coded parameters in the schaake scheme when ice fraction is used are moved to config file.

* removed ice_fraction variables from the bmi input list to make it work within the ngen framework, also removed variables from the output list.

* Reverting to 180c56f to use it in the pseudo framework.

* name change: ice_fraction to sft_coupled.

* cleanup/renaming output variables.

* remove refs to `ngen` in README

Co-authored-by: JessicaGarrett-NOAA <30940444+madMatchstick@users.noreply.github.com>
Co-authored-by: lcunha0118 <luciana.k.cunha@gmail.com>
Co-authored-by: Keith Jennings <keithjennings@keiths-mbp.lan>

* changed bmi input variable ice_fraction name.

* bug fix, smc_ref is dimensionless so dividing by the soil reservoir depth.

* separated giuh module from cfe to have its own source/header files, so it can be reused and extented, if needed, independently.

* root zone adjusted AET

* updates to match smc code changes

* Update laramie_bmi_config_smc_coupler.txt

* Rename src/main.c to src/old_driver_scripts/main.c

* Rename src/main_cfe_aorc_pet.c to src/old_driver_scripts/main_cfe_aorc_pet.c

* Rename src/main_pass_forcings.c to src/old_driver_scripts/main_pass_forcings.c

* Delete env_cheyenne.sh

* Delete make_and_run_bmi.sh

* Delete make_and_run_bmi_pass_forcings.sh

* Delete make_and_run_bmi_pass_forcings_pet.sh

* Update CMakeLists.txt

* Update README.md

* Update README.md

* minor changes, updated files due to changes in the SMP.

* removed sft_coupled=on, not needed

* updated CMakeLists and config files, the merge/changes reproduce cfe standalone results with basecase, aorc forcings only, aorc forcings + pet, and aorc + forcing + pet + aet root zone.

* added bash script to run cfe with different options. documenation needs to be updated.

* set default smc profile to 1x1 array, needed for cfe to run in the ngen framework as soil_moisture_profile is a bmi input.

* bug fix, assigns 0 to n_soil_layers when rootzone AET is turned off.

* added the right file for AET rootzone example.

* bug fix, set default aet_root_zone to FALSE.

* Update README.md

individual "make and run" files have been replace with a single file. For all examples, cmake is needed to build the code.

* Update README.md

* Update README.md

* Update README.md

* minor text edit.

* Added option to turn on/off AET rootzone and other related changes.

* few fixes that were introduced during rebasing.

* Update README.md

* Update README.md

* modified run_cfe to catch/output invalid option.

* Update README.md

* Update README.md

* added an explicit flag to check if SFT is ON or OFF inside the runoff schemes, if OFF ice_fraction parameters is set to 0.0. Updated readme file.

* Update README.md

* Update README.md

* minor changes in response to PR comments.

* Update README.md

Co-authored-by: JessicaGarrett-NOAA <30940444+madMatchstick@users.noreply.github.com>
Co-authored-by: lcunha0118 <luciana.k.cunha@gmail.com>
Co-authored-by: Keith Jennings <keithjennings@keiths-mbp.lan>
Co-authored-by: Rachel McDaniel <rachel.mcdaniel@outlook.com>
Co-authored-by: Rachel McDaniel <61248457+rlmcdaniel@users.noreply.github.com>
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.

5 participants