-
Notifications
You must be signed in to change notification settings - Fork 318
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
Optionally base GDD20 on per-gridcell windows, not per-hemisphere #2593
Optionally base GDD20 on per-gridcell windows, not per-hemisphere #2593
Conversation
Previously, TemperatureType%flush_gdd20 would get set to true upon restart unless it was read and false. This change makes it so that: - If TemperatureType%flush_gdd20 isn't read from the restart file, it falls back to the flush_gdd20 from clm_varctl. - If TemperatureType%flush_gdd20 IS read from the restart file, it is set to true if it's true on the restart file OR if the flush_gdd20 from clm_varctl is true.
Not directly, at least. Instead, rely on TemperatureType%flush_gdd20 having been set correctly.
Having that alongside flush_gdd20 from clm_varctl means that they can disagree when restarting, and it's not obvious which should win. Note that the user being able to request a flush at all is dangerous. If they start a run with it true, they might continue that run without setting it to false. Instead, the restart decision should be made by the model---if a gridcell has different prescribed gdd20 season from what its restart file says, then that gridcell should be flushed.
@slevis-lmwg In 827632e, I resolved the "two Note that the user being able to request a flush at all is dangerous. If they start a run with it true, they might continue that run without setting it to false. Instead, the restart decision should be made by the model—if a gridcell has different prescribed GDD20 season from what its restart file says, then that gridcell should be flushed. I will plan to make that change in a future update, post-code-freeze. It only affects things when streaming GDD20 seasons, which will not be a default behavior, so I think it's okay to leave things as they are now. |
SMS_P128x1_Lm25.f10_f10_mg37.IHistClm60BgcCrop.izumi_nag.clm-RxCropCalsAdaptGGCMI
For some reason I'm getting an unexpected change in
<stream_fldFileName_gdd20_baseline cropcals_rx_adapt=".true.">lnd/clm2/cropdata/calendars/processed/gdd20bl.copied_from.gdds_20230829_161011.v2.tweaked_latlons.nc</stream_fldFileName_gdd20_baseline> And in the latest test (aeb4182) it looked like this: <stream_fldFileName_gdd20_baseline cropcals_rx_adapt=".true." stream_gdd20_seasons=".false.">lnd/clm2/cropdata/calendars/processed/20230714_cropcals_pr2_1deg.actually2deg.1980-2009.from_GDDB20.interpd_halfdeg.tweaked_latlons.nc</stream_fldFileName_gdd20_baseline>
<stream_fldFileName_gdd20_baseline cropcals_rx_adapt=".true." stream_gdd20_seasons=".true.">lnd/clm2/cropdata/calendars/processed/gdd20bl.copied_from.gdds_20230829_161011.v2.tweaked_latlons.nc</stream_fldFileName_gdd20_baseline> These two tests have This issue still exists as of 388c7ed.
|
I think the issue is here:
does not get the seasons var at all.
Alternatively, set_value(stream_gdd20_seasons) for can be used before adding default for stream_fld.... |
That's it! The exact diff needed, for posterity:
Thanks, @mvdebolskiy!! |
@slevis-lmwg So as to not have to redo the test suites I have in progress, I will NOT bring in Matvey's fix here or in the next PR (where I merge the latest CTSM master into my dev branch). Instead, I'll bring it in as the first thing on the PR where I enable |
@slevis-lmwg This is ready for re-review. |
@samsrabin I just wanted to confirm that you will track the items left pending from this PR, such as these: |
Good thinking. I've made the first one into issue #2660. I'm fixing the second as we speak, so I won't make a separate issue for that. |
Description of changes
In the existing code, when using the default CLM crop calendars,
gddmaturity
(maturity requirement; the number of growing degree-days it takes for a crop to mature and be harvested) can vary within some bounds based on climate over the past 20 years. Specifically, CLM looks at some annual "warm period" which differs between the northern and southern hemispheres, which I call the "GDD20 season." This variation allows "farmers" to adapt the "cultivars" (varieties) they grow based on recent climate.When prescribing maturity requirement, though—with input file
stream_fldFileName_cultivar_gdds
—it's currently not allowed to vary over time. Instead, it's locked in to what's provided in the input file: the mean GDD accumulation in the GGCMI growing period over the 1980-2009 growing seasons.We want this variation to allow "farmers" to adapt the "varieties" they grow based on whether the recent climate has been warmer or cooler than that baseline 1980-2009 period.
This PR represents the second step toward adding that ability. I'm breaking this work up into separate PRs to keep them manageable:
gddmaturity
values to a realistic range.Specific notes
Other features/changes
sowing_reason_perharv_patch
RXCROPMATURITYSKIPGEN_Ld1097.f10_f10_mg37.IHistClm50BgcCrop.derecho_intel.clm-cropMonthOutput
.GDD20_BASELINE
,GDD20_SEASON_START
,GDD20_SEASON_END
Contributors other than yourself, if any: None
CTSM Issues Fixed:
Are answers expected to change (and if so in what way)? Not unless enabling this new, experimental feature.
Any User Interface Changes (namelist or namelist defaults changes)?
stream_gdd20_seasons
(default false). Enabling this automatically sets the relevant input files (see below) to the half-degree GGCMI growing seasons.stream_fldFileName_gdd20_season_start
and_end
(default''
, unlessstream_gdd20_seasons
is true, in which case the GGCMI sowing and harvest dates are used). Providing either file butstream_gdd20_seasons = .true.
will cause an error in the build namelist step.flush_gdd20
(default false), which if true causes the accumulated GDD20 variables to be reset as soon as possible.allow_invalid_gdd20_season_inputs
(default false), which if false will cause a failure upon reading a value instream_fldFileName_gdd20_season_start
or_end
outside the range [1, 365] (or 366 in leap years).Does this create a need to change or add documentation? Did you do so? Documentation will need to be updated when all the PRs in my plan are merged and this feature is considered ready for use. But at this point, things are preliminary enough that I'd have to rewrite whatever docs I added in this PR. So no: I'm adding no documentation here.
Testing performed, if any:
ctsm5.2.005
, although there was a build failure in one nag compiler test.