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

New outputs: N to food and seed #2074

Merged
merged 18 commits into from
Nov 3, 2023
Merged

Conversation

samsrabin
Copy link
Collaborator

@samsrabin samsrabin commented Jul 26, 2023

Description of changes

In response to a user request for GRAINN_TO_FOOD outputs, this adds *_N_TO_FOOD and *_N_TO_SEED outputs for reproductive N pools. These are off by default, unlike their C counterparts.

Specific notes

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)? No

Testing performed, if any: A simple 5-day test gave the following for the gridcell average of the last day:
screenshot_6117
Spatial patterns match, but it's weird that the C:N ratio is so high—on the order of 100:1. This could just be a result of looking in what might be the middle of the growing season, before N retranslocation is complete.

@samsrabin samsrabin added enhancement new capability or improved behavior of existing capability PR status: ready PR: this is ready to merge in, with all tests satisfactory and reviews complete tag: enh - new science next this should get some attention in the next week or two. Normally each Thursday SE meeting. labels Jul 26, 2023
@samsrabin samsrabin self-assigned this Jul 26, 2023
@samsrabin samsrabin removed the PR status: ready PR: this is ready to merge in, with all tests satisfactory and reviews complete label Aug 3, 2023
@samsrabin
Copy link
Collaborator Author

samsrabin commented Aug 3, 2023

  • Should probably do aux_clm testing to see whether any diffs are introduced. There shouldn't be any, but one never knows.
  • Update master_list_nofates.rst (wait on Rework master_list_(no)?fates.rst? #2083)

@samsrabin samsrabin added the blocked: dependency Wait to work on this until dependency is resolved label Aug 3, 2023
@samsrabin
Copy link
Collaborator Author

Will be unblocked by #2087.

@samsrabin samsrabin removed the next this should get some attention in the next week or two. Normally each Thursday SE meeting. label Aug 17, 2023
@samsrabin samsrabin removed the blocked: dependency Wait to work on this until dependency is resolved label Sep 25, 2023
b4b changes to Python scripts, history lists, tech note, and clm_time_manager.
@samsrabin
Copy link
Collaborator Author

aux_clm OK; baselines saved as grainN_to_food.a26a5d1b2.

@samsrabin samsrabin requested a review from slevis-lmwg October 10, 2023 19:20
@samsrabin
Copy link
Collaborator Author

samsrabin commented Oct 10, 2023

Tasks from co-review with @slevis-lmwg:

  • Determine why I added get_repr_hist_fname to CNVegNitrogenFluxType%InitHistory(); remove if unneeded. Needed to get _N_TO_FOOD variable names depending on which reproductive pools exist.
  • Add GRAINN_TO_FOOD to first history file in crop testmod. Done with eeab40d.
  • Do a longer test, examining at-harvest C:N ratios of both TO_FOOD and TO_SEED.

@@ -3106,8 +3111,15 @@ subroutine CNOffsetLitterfall (num_soilp, filter_soilp, &
repr_grainc_to_food_thisyr(p,k) = repr_grainc_to_food_thisyr(p,k) &
+ repr_grainc_to_food_perharv(p,h,k)
end if
repr_grainn_to_food_thispool = npool_to_reproductiven(p,k) - repr_grainn_to_seed(p,k)
repr_grainn_to_food(p,k) = t1 * reproductiven(p,k) &
+ npool_to_reproductiven(p,k) - repr_grainn_to_seed(p,k)
Copy link
Contributor

Choose a reason for hiding this comment

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

I asked @samsrabin to remind me the diff between "grain to seed" and "grain to food" and I see here that the two terms summed are the reproductive pool. I'm not sure "seed" is the right term for what's left when you subtract food from the reproductive pool, but that's out of scope for this PR.

src/biogeochem/CNVegNitrogenFluxType.F90 Show resolved Hide resolved
fname=get_repr_hist_fname(k)//'N_TO_FOOD_PERHARV', &
units='gN/m^2', &
type2d='mxharvests', &
avgflag='I', &
Copy link
Contributor

Choose a reason for hiding this comment

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

I mentioned PR #2019 which, as written, eliminates 'I' hardwiring in the code; however, we are waiting for a different coding solution from CAM, so no need to worry about that right now.

@samsrabin
Copy link
Collaborator Author

Hmm. I'm concerned that the way CLM does C and N allocation to seed vs. grain makes it not fit for purpose with regard to harvested (food) N content. I don't exactly understand all the machinations, but the result is plain enough: At harvest, to-food N is sometimes zero while C is positive. This is not the case for to-seed N and C content (or, of course, seed + food).

Moreover, even if we combine both seed and food to get all grain biomass, C:N looks off. Soybeans typically have C:N ratio of < 10, but from a 5-year run, I'm not seeing mean at-harvest grain C:N below 45:
image

I still think it's worth adding these outputs, as without them I don't think there's a way to calculate aboveground crop N biomass. But perhaps some metadata of GRAINN_TO_FOOD should disclaim that it's not necessarily realistic.

Tagging @billsacks in case you have any thoughts, as I see you worked on the seed allocation and deficit code, albeit back in 2017.

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
Copy link
Collaborator Author

aux_clm OK as of af4a688.

@billsacks
Copy link
Member

Tagging @billsacks in case you have any thoughts, as I see you worked on the seed allocation and deficit code, albeit back in 2017.

Sorry for the slow reply. I think I worked on this code as part of getting C & N conservation to work with dynamic crop areas (i.e., dynamic landunits). I think this required me to move the product pools to grid cell level, so I did some rework to accomplish that.

In my notes from that project:

Why is grainn_to_food not treated the same as c, in subtract_cropseed?

Danica says: N should be treated the same as C... that's something they wanted to add

Then my notes went on to say that I want to rework this so that N is treated the same as C. And it looks like I did some rework to that end; in particular, it looks like I put in a removal of grainn_to_seed from the N crop product pool.

My notes lead me to think that, as of the time of this work (clm4_5_14_r220, in January 2017), it should have been the case that C and N were treated in the same way for crop seeding. But it's very possible that (1) I'm making an incorrect assumption about that from what I can glean from my 7-year-old notes; (2) I intended to make the treatment the same but there was still some mistake / discrepancy; and/or (3) C and N were treated the same at that time, but have diverged in some way since then.

I'd be happy to discuss this further if it would be useful.

@samsrabin
Copy link
Collaborator Author

@billsacks Thanks for that context—it's so great that you have notes going back that far!

As far as I can tell, everything that happens to repr_grainn_to_food_patch happens to the C equivalent and vice versa: e.g., "Send the remaining grain to the food product pool", the update of reproductive[cn]_patch in [CN]StateUpdate1(). I think the difference must come in how the seed deficit is calculated. But again, things seem to be the same mechanically—although I haven't taken as close a look.

Does it all derive from leafcn, then? That seems to be the driver of seed deficit via seed[cn]_to_leaf.

@billsacks
Copy link
Member

Interesting, thanks for your analysis. I don't remember enough about this to weigh in further, but let me know if you want to talk about it.

@samsrabin
Copy link
Collaborator Author

@slevis-lmwg This is ready for re-review (commits beginning b95b986).

@samsrabin samsrabin requested a review from slevis-lmwg November 1, 2023 17:21
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.

I looked over the latest changes and have no concerns.

@samsrabin samsrabin added the PR status: ready PR: this is ready to merge in, with all tests satisfactory and reviews complete label Nov 1, 2023
Add sowing window input files

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.
@samsrabin samsrabin merged commit 6743205 into ESCOMP:master Nov 3, 2023
2 checks passed
@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
enhancement new capability or improved behavior of existing capability PR status: ready PR: this is ready to merge in, with all tests satisfactory and reviews complete science Enhancement to or bug impacting science
Projects
Status: Done (non release/external)
Development

Successfully merging this pull request may close these issues.

3 participants