Skip to content

Rc mirca update#52

Open
RChadsey wants to merge 27 commits into
masterfrom
rc_MIRCA_update
Open

Rc mirca update#52
RChadsey wants to merge 27 commits into
masterfrom
rc_MIRCA_update

Conversation

@RChadsey

Copy link
Copy Markdown
Collaborator

Bring in mapSPAM harvested area, yield, production, and physical area values from 2020.

Kanishka Balu Narayan and others added 27 commits July 17, 2025 17:22
…ave runtime. Instead hard-coded in grid dimesions for mapSPAM
@aldivi

aldivi commented May 13, 2026

Copy link
Copy Markdown
Collaborator

@kanishkan91 @RChadsey There are a few things that should be addressed:

  1. similar to the base_year_update, the top-level hyde and other land type files should be removed
  2. in line 328 of proc_mapspam.c, this should probably be: crop_grid[land_cells_sage[j]] <= 0
  3. lines 340 and 343 in proc_mapspam.c: consider if this can (or needs to be) made more explicit of a check. it may be machine/compiler dependent on whether NANs are read in as large negative numbers or as something else.
  4. when writing the files (lines 489 and later), don't write the yield input variable, as it is just a sum and not really valid. consider not processing this at all, unless it is calculated as an area-weighted average to compare the the yield value calculated from production and area. so only write the calculated yield (from production and area), or write a separate file based on the input yield properly calculated. Also, the units for the yield file name on line 67 are not correct; they should be Mt_per_ha.
  5. there are multiple nested (and not nested) loops over the entire grid. there is likely a way to reduce the number of times the code loops over the entire grid.

@aldivi

aldivi commented May 13, 2026

Copy link
Copy Markdown
Collaborator

regarding number 3 above, it appears that if the TIFF NAN values are the standard IEEE 754 values (which is a specific bit pattern rather than a number), then isnan() from math.h should recognize them because fread does a straight binary read.
the problem is that the sign bit can be either 1 or 0 (positive or negative), so checking for a negative value is not universal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants