pecan icon indicating copy to clipboard operation
pecan copied to clipboard

Updates of fates model

Open Hhh-hyc opened this issue 2 years ago • 4 comments

Description

Changes made in this pull request:

  • docker-compose.yml: added a package named CTSM-FATES for further integration (on going).
  • DESCRIPTION: replaced the old name 'fates' with 'CTSM-FATES' for clarity, the version of CTSM-FATES will be added later.
  • met2model.FATES.R: was updated to generate three monthly files, including precipitation, solar radiation and temperature+other variables, 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.
  • template.job: tentative changes were made. is stil a work ongoing.

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
  • [x] When possible

Types of changes

  • [ ] Bug fix (non-breaking change which fixes an issue)
  • [x] 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.
  • [x] I have read the CONTRIBUTING document.
  • [ ] I have added tests to cover my changes.
  • [ ] All new and existing tests passed.

Hhh-hyc avatar Nov 09 '23 08:11 Hhh-hyc

@Hhh-hyc Yucong congratulations on your first PEcAn PR, thank you for contributing. Let's iterate with the suggested revisions.

istfer avatar Nov 09 '23 09:11 istfer

@Hhh-hyc wanted to ping you about finishing up this PR, which has been in the queue for a while

mdietze avatar Feb 25 '24 17:02 mdietze

 R check of models/fates reports the following new problems. Please fix these and resubmit:
  checking dependencies in R code ... WARNING
  '::' or ':::' import not declared from: ‘ncdf4.helpers’
  checking for code/documentation mismatches ... WARNING
  Codoc mismatches from documentation object 'met2model.FATES':
  met2model.FATES
    Code: function(in.path, in.prefix, outfolder, start_date, end_date,
                   lst = 0, lat, lon, overwrite, verbose)
    Docs: function(in.path, in.prefix, outfolder, start_date, end_date,
                   lst = 0, lat, lon, overwrite = FALSE, verbose = FALSE,
                   ...)
    Argument names in docs not in code:
      ...
    Mismatches in argument default values:
      Name: 'overwrite' Code:  Docs: FALSE
      Name: 'verbose' Code:  Docs: FALSE
  
  Codoc mismatches from documentation object 'model2netcdf.FATES':
  model2netcdf.FATES
    Code: function(outdir, sitelat, sitelon, pfts)
    Docs: function(outdir)
    Argument names in code not in docs:
      sitelat sitelon pfts
  
  checking R code for possible problems ... NOTE
  model2netcdf.FATES : var_update: no visible global function definition
    for ‘show’
  Undefined global functions or variables:
    show

mdietze avatar Apr 01 '24 23:04 mdietze

@Hhh-hyc checking in again on this PR which seems to require fairly minor changes to pass the GH Action checks. Is this something you'll be able to get back to soon?

mdietze avatar May 16 '24 18:05 mdietze