DrylandEcology / STEPWAT2

folder
4 stars 5 forks source link

Calculate proportion of total precipitation received in the summer (June-August) needed for new wildlfire cheatgrass cycle implementation #522

Closed kpalmqui closed 1 year ago

kpalmqui commented 2 years ago

The proportion of total precipitation received in the summer (June-August) needs to be calculated and stored for use in the new wildfire cheatgrass cycle implementation.

precipitation that occurs in June, July, August / total annual precipitation

Should range between 0 and 1.

See SXW->ppt_monthly (monthly precipitation) & SXW->ppt (total annual precipitation)

mnovo323 commented 2 years ago

Per our meeting: we will implement a function in ST_environs that will take a array of integers that represent months (0 = January, 11 = December), and calculate the proportion of precipitation of those months over the whole year.

kpalmqui commented 1 year ago

An update here: for all climate variables used in the calculation of wildfire probability (proportion of total precipitation received in the summer, mean annual temperature, and annual precipitation), we want these to be based on 10-year running averages, not this year's annual values. get_running_mean is likely to be helpful here.

mnovo323 commented 1 year ago

Proposed changes:


Add a structure in ST_mortality.h to keep track of the past 10 years of the given data, and their average.

typedef struct WildfireClimate_st {
  double propSummerPrecip[10];
  double propSummerPrecipAvg;
  ...
  int count;
} WildfireClimate;

Add method to add the current years value, which will automatically update the structure and compute the new 10 year averages.

Add initialization method.

kpalmqui commented 1 year ago

Resolved by https://github.com/DrylandEcology/STEPWAT2/commit/1b60be281ebfbd19370ee64a91a64392771d8f9c