CTSM icon indicating copy to clipboard operation
CTSM copied to clipboard

Add per-harvest outputs, incl. GRAINC_TO_FOOD

Open samsrabin opened this issue 3 years ago • 5 comments

Description of changes

Previously, the recommended way to get annual crop yield was to sum up daily-average values of GRAINC_TO_FOOD over a year, then multiply by the number of seconds per day. Here, I introduce a new output variable, GRAINC_TO_FOOD_ACCUM_PERHARV, that gives the same information with just annual resolution and without needing to multiply by anything.

Specific notes

Whereas GRAINC_TO_FOOD has dimensions time x pft, GRAINC_TO_FOOD_ACCUM_PERHARV has dimensions time x mxharvests x pft.

mxharvests is hard-coded to the maximum number of sowings per year plus 1. For now, that means mxharvests is always 2. So whereas with GRAINC_TO_FOOD you need to sum over all days in each year, with GRAINC_TO_FOOD_ACCUM_PERHARV you need to sum over all harvests in a year. (If only one harvest happens in a year, the second harvest's value is zero.)

CTSM Issues ~~Fixed~~ Addressed: #1649

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

Any User Interface Changes (namelist or namelist defaults changes)? None mandatory. GRAINC_TO_FOOD_ACCUM_PERHARV is an optional output variable.

Testing performed, if any: I did a test run for I2000Clm50BgcCrop at 10°x15° resolution (f10_f10_mg37) for 2000-2009. Processed outputs are the same for GRAINC_TO_FOOD_ACCUM_PERHARV as they were for GRAINC_TO_FOOD, although of course the processing scripts differ.

Test details

Case directory: /glade/u/home/samrabin/cases_ctsm/yield_perharv_f10_f10_mg37 Processing scripts in subdirectory outputs. Raw outputs and processed files in subdirectory outputs/lnd/hist.

GRAINC_TO_FOOD

  • Processing script: CropPFT_GridRemap.ncl
  • Processed file: yield_perharv_f10_f10_mg37_CropRemapped_GRAINC_TO_FOOD_200001-200912_Sum.nc

GRAINC_TO_FOOD_ACCUM_PERHARV

  • Processing script: CropPFT_GridRemap.ACCUM.ncl
  • Processed file: yield_perharv_f10_f10_mg37_CropRemapped_GRAINC_TO_FOOD_ACCUM_PERHARV_199901-200912_Sum.nc (Note the extra year at the beginning is because that was included in my annual-resolution output file.)

samsrabin avatar Jul 08 '22 23:07 samsrabin

Just realized it might also be useful to have another output variable that effectively does the "sum across mxharvests" step itself. I'll plan to add this in another commit; something like GRAINC_TO_FOOD_ACCUM_THISYR.

(The separate per-harvest output is useful for applications like ISIMIP-Agriculture/GGCMI, where it's important to be able to associate harvests with the year of their planting.)

samsrabin avatar Jul 09 '22 00:07 samsrabin

Found some discrepancies between gridded/remapped results from GRAINC_TO_FOOD vs. GRAINC_TO_FOOD_PERHARV vs. GRAINC_TO_FOOD_ANN. Investigating…

samsrabin avatar Jul 13 '22 23:07 samsrabin

Okay, in my test run, it looks like the new per-harvest and annual outputs are identical to within < 1 mgC/m2, which should be fine. But per-harvest differs from the original outputs by up to 444 gC/m2. Will investigate further.

samsrabin avatar Jul 13 '22 23:07 samsrabin

Turns out it's all good; I just had forgotten to time-shift the daily outputs in my Python script.

Max diff, original vs. perharv: (150.0,-10.0) sugarcane (67) 2007: 0.000244140625 (1094.70556640625 vs. 1094.705322265625)
Max diff (tie), perharv vs. annual: (150.0,-10.0) sugarcane (67) 2000: 0.0001220703125 (1100.258056640625 vs. 1100.2579345703125)
Max diff (tie), perharv vs. annual: (150.0,-10.0) sugarcane (67) 2007: 0.0001220703125 (1094.705322265625 vs. 1094.7054443359375)

I think this is ready for review.

samsrabin avatar Jul 15 '22 19:07 samsrabin

Commits above add more outputs, all with dimension mxharvests unless otherwise noted:

  • SDATES_PERHARV: actual sowing date (day of year) for crops harvested this year.
  • SYEARS_PERHARV: actual sowing year for crops harvested this year.
  • GDDHARV_PERHARV: Growing degree days (gdd) needed to harvest.
  • GDDACCUM_PERHARV: At-harvest accumulated growing degree days past planting date for crop.
  • HUI_PERHARV: At-harvest accumulated heat unit index for crop.
  • SOWING_REASON (dimension mxsowings)
  • SOWING_REASON_PERHARV
  • HARVEST_REASON_PERHARV

samsrabin avatar Aug 09 '22 16:08 samsrabin

Closing, as everything in this PR should also be in #1863.

samsrabin avatar Oct 06 '22 17:10 samsrabin