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

Add sowing window input files #2193

Merged
merged 98 commits into from
Oct 30, 2023

Conversation

samsrabin
Copy link
Collaborator

@samsrabin samsrabin commented Oct 10, 2023

Description of changes

Previously, one could run crops with either (a) sowing windows defined by the hemisphere-specific start and end dates on the paramfile or (b) prescribed sowing dates specified by input file stream_fldFileName_sdate. This PR replaces the latter with two new input files, stream_fldFileName_swindow_start and stream_fldFileName_swindow_end.

Specific notes

  • By default, CLM still uses the same old paramfile values. Eventually I hope to use more realistic sowing window input files by default, but there's a lot of work still to be done in that vein.
  • If a gridcell-crop has the same date in both sowing window input files, that date is treated as a prescribed sowing date. This means that the usual "Can we plant in this sowing window?" rules are discarded. It may be desirable to add an option to treat those as one-day-long sowing windows instead, or maybe to only treat as prescribed sowing date if all crops in all gridcells have the same start and end date.
  • Adds sowingDates testmod, which uses sowing windows derived from the static GGCMI phase 3 crop calendar dataset.
  • Includes unit testing.

Contributors other than yourself, if any: None

CTSM Issues Fixed (include github issue #): None

Are answers expected to change (and if so in what way)? No.

Any User Interface Changes (namelist or namelist defaults changes)? Removes namelist parameter stream_fldFileName_sdate. Adds namelist parameters stream_fldFileName_swindow_start and stream_fldFileName_swindow_end.

Testing performed, if any: A version of 1cade99 with some additional verbosity passed aux_clm against ctsm5.1.dev142. RXCROPMATURITY test also works.

glemieux and others added 30 commits July 26, 2023 23:08
Rename hist fields to track them down more easily

Renaming history fields to make easier to find in lists, e.g. when
using ncview. For example, litter fields like MET_LIT and STR_LIT
will be LIT_MET and LIT_STR.
If fates is not using dispersal mode, which is set via the parameter
file, do not run the nearest neighbor algorithm to avoid performace impact.
Change order of history fields to improve performance on derecho

Instead of just ordering history fields alphabetically, order them first
by the name of their level dimension (with fields without a level
dimension appearing first), then alphabetically within a given level
dimension. This changed ordering gives a significant performance
improvement especially noticeable on lustre file systems such as on
derecho.
This corresponds to a fates-side refactor that moves the seed_out and seed_in variables from the bc_in/out types to site.
Corrections to the column type names are also made
Since fates seed dispersal can occur at different user defined
cadences, allow the user to define this via the namelist.
The dispersal timing call utilizes a function that is not initialized
unless the mode has been initialized.  If it is included along with
the cadence check as it was setup previously, the timing call will
fail having not been initialized.
…ileName_sdate.

* Replicate stream_fldFileName_sdate behavior by using same file for stream_fldFileName_swindow_start and stream_fldFileName_swindow_end.
* RXCROPMATURITY test looks fine.
# Conflicts:
#	src/biogeochem/CNPhenologyMod.F90
glemieux and others added 9 commits October 18, 2023 16:03
SNICAR snow albedo scheme updates

A few substantial changes in the SNICAR module for the following updated snow albedo calculation features:
 - Updated ice optical properties from Flanner et al. (2021), with multiple types for ice refractive indices.
 - Updated aerosol optical properties from Flanner et al. (2021) with multiple dust types & new BC and OC optics.
 - Updated downward solar spectra from Flanner et al. (2021) for multiple condition types.
 - More accurate radiative transfer solver (adding-doubling) from Dang et al. (2019).
 - Nonspherical snow grain scheme from He et al. (2017).
 - BC-snow internal mixing scheme from He et al. (2017).
 - Dust-snow internal mixing scheme from He et al. (2019).
 - Hyperspectral (480-band, 10-nm spectral res) capability with all the above features.
 - New namelist controls for aerosol in snow and additional snow albedo diagnostic output variables.

 Specific notes
 - Code contributors: Cenlin He (NCAR/RAL) with advice from Dave Lawrence (NCAR/CGD) and Mark Flanner (UMich).
 - The manuscript to report this update is
 Cenlin He, Mark Flanner, David M Lawrence, Yu Gu: New features and enhancements in Community Land Model (CLM5) snow albedo modeling: description, sensitivity, and evaluation. Authorea. June 08, 2023. DOI:10.22541/essoar.168626390.01530324/v1
 - These updates will change the snow and surface albedo results along with other surface fluxes changes.
 - There are a few new namelist options related to SNICAR scheme added to the namelist control.

New namelist variables:
 snicar_numrad_snw = 5 or 480 wavelength bands, default 5
 snicar_solarspec, default "mid_latitude_winter" among six available options
 snicar_dust_optics, default "sahara" among three avail. options
 snicar_snw_shape, default "hexagonal_plate" among fourn avail. options
 snicar_use_aerosol, default .true.
 snicar_snobc_intmix and snicar_snodst_intmix, default .false. means do not activate bc-snow and dust-snow internal mixing

 do_sno_oc, default .false., already appeared in previous code but in caps
 use_snicar_frc, default .false., existed before
 fsnowoptics now points to an updated 5-band file and gives the option for a 480-band file
@samsrabin
Copy link
Collaborator Author

8d1537c broke RXCROPMATURITY; investigating.

@samsrabin samsrabin requested a review from slevis-lmwg October 26, 2023 22:50
@samsrabin
Copy link
Collaborator Author

samsrabin commented Oct 26, 2023

@slevis-lmwg Ready for re-review! Everything should be self-explanatory, but if you'd like to go through the diffs together, let me know.

After review, I will

  • Redo aux_clm testing

Copy link
Contributor

@slevis-lmwg slevis-lmwg left a comment

Choose a reason for hiding this comment

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

@samsrabin you will find one more request before I approve. Also I think it would be best if we went over things together in a 30' meeting today or Monday.

integer :: doy_tomorrow
character(len=*), parameter :: sub = 'clm::get_doy_tomorrow'

if ( doy_today < 1 .or. doy_today > 367 )then
Copy link
Contributor

Choose a reason for hiding this comment

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

Why 367? Is it 367 in leap years only? If so, I suggest replacing 367 with curr_days_per_year + 1 and explaining why + 1 in a comment.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good point. I don't know why it was EVER 367; fixed in 54e5f24.

FATES cross-grid seed dispersal

This PR enables FATES to disperse seeds across neighboring grid cells using MPI.
The API update includes calls to new fates dispersal procedures.  There are
four parameters that are utilized to control the dispersal kernel, although
these were introduced in ctsm5.1.dev130 so no new default FATES parameter file
is necessary with this update.  A new namelist parameter has been added to
enable the use of the seed dispersal mode.
@samsrabin samsrabin merged commit abc3c27 into ESCOMP:master Oct 30, 2023
@samsrabin samsrabin added the science Enhancement to or bug impacting science label Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bfb bit-for-bit enhancement new capability or improved behavior of existing capability science Enhancement to or bug impacting science
Projects
Status: Done
Status: Done (non release/external)
Development

Successfully merging this pull request may close these issues.

4 participants