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

Updates of fates model #3331

Merged
merged 8 commits into from
Jul 26, 2024
Merged

Updates of fates model #3331

merged 8 commits into from
Jul 26, 2024

Conversation

Hhh-hyc
Copy link
Contributor

@Hhh-hyc Hhh-hyc commented Jul 12, 2024

Description

Changes made in this pull request

  • docker-compose.yml: added a package named fates for further integration (on going).
  • met2model.FATES.R: was updated to generate three monthly files, including precipitation, solar radiation and temperature+humidity, respectively. The shared variables, such as longitude, latitude, EDGEW, EDGEN, etc., were pre-defined and then written into .nc files along with unique variables for each type of files, e.g, precipitation flux for precipitation file, surface downwelling flux for solar file, etc. The file structures are in line with the default GSWP3 forcing files used by CTSM-FATES. The generated input files have been tested with ctsm5.1.dev108 and FATES sci.1.58.1_api.24.1.0 for FATES (with NUOPC coupler). The function has been tested with stand-alone R. Testing within PEcAN is still needed.
  • model2netcdf.FATES.R: both PFT level output and grid level output variables from CLM-FATES have been considered. Other cohort/patch level outputs such as different age and size groups, however, have not been implemented yet. Any suggestions on this are welcome. Currently, The function has been tested with stand-alone R assuming default monthly output from CLM-FATES. Extending the function to deal with daily output from CLM-FATES and testing the function within PEcAn is still needed.

Motivation and Context

Integrate the newest version of CTSM-FATES into PEcAn. CTSM-FATES is assumed to be run in a docker or openshift container. The work is relevant to the issue on PEcAN #1008 and the issue on FATES: NGEET/fates#364

Review Time Estimate

  • Immediately
  • Within one week
  • When possible

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My change requires a change to the documentation.
  • My name is in the list of CITATION.cff
  • I have updated the CHANGELOG.md.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@istfer
Copy link
Contributor

istfer commented Jul 23, 2024

@infotroph in this PR, @Hhh-hyc added a new tibble dependency to the fates package. Is she supposed to add it by hand to the pecan_package_dependencies.csv or is this file autogenerated by running some other script?

@infotroph
Copy link
Member

infotroph commented Jul 23, 2024

@Hhh-hyc @istfer Thanks for checking! You should run scripts/generate_dependencies.R and it will update the CSVs for you, picking up the changes you've already added to DESCRIPTION.

@Hhh-hyc
Copy link
Contributor Author

Hhh-hyc commented Jul 24, 2024

Thanks for your response! @infotroph
But it seems not work on my local machine. Do you have any idea on the error, reported after running the script?

Error: unexpected '>' in "deps <- pkgs_parsed |>"

@infotroph
Copy link
Member

@Hhh-hyc What version of R are you using? That error usually comes from versions that don't recognize the native pipe (|>), which was added in R 4.1.

R 4.1 is also the oldest version of R we test PEcAn against, so I recommend upgrading if yours is older than that.

@infotroph
Copy link
Member

@Hhh-hyc Would it be helpful if I run the dependency script and push the changes directly to this PR? You'll then need to make sure you pull that change from GitHub to your machine before doing more local development on this branch.

@Hhh-hyc
Copy link
Contributor Author

Hhh-hyc commented Jul 26, 2024

I tried to update R and run the script, but it reports another error:

Error in `dplyr::filter()`:
! Problem while computing `..1 = package != "R"`.
Caused by error in `mask$eval_all_filter()`:
! object 'package' not found

@infotroph If you could help solve this problem and push changes to this PR, it would be very helpful!

@infotroph
Copy link
Member

@Hhh-hyc Done!

@mdietze mdietze merged commit f72abcc into PecanProject:develop Jul 26, 2024
12 of 13 checks passed
@infotroph infotroph mentioned this pull request Jul 29, 2024
13 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants