A BMI model intended to compute precip_rate from APCP_surface and TMP_2maboveground.
Despite the intent being to match the method used to generate the forcing files initially, this ends up being impossible to do exactly, as the original method uses data from the next timestep to calculate the current precip_rate. This model instead uses the current APCP_surface and TMP_2maboveground to calculate the current precip_rate.
It does this concurrently with the reverse computation, computing APCP_surface from precip_rate and TMP_2maboveground.
This calculation manages to be faithful to the original process by default, as it is the reverse of the other. Since the first one is calculated using data from timestep t+1, this one is calculated using the data from timestep t-1, which is actually possible to do by storing past values and accessing them when needed.
Further, the reverse computation is designed with configurability in mind, allowing the user to set TMP_time_offset and precip_rate_time_offset in the model_params to any value they wish, allowing them to calculate APCP_surface from precip_rate and TMP_2maboveground at any (non-positive) offset from the current timestep. An offset of 0 is equivalent to directly using current data, rather than storing it.
These are variables that can be requested from the model:
-
Input Variables
precip_rate- The rate of precipitation in mm/sAPCP_surface- The total precipitation in kg/m^2TMP_2maboveground- The temperature in K
-
Output Variables
atmosphere_water__precipitation_rate- Calculated equivalent toprecip_rateAPCP_surface_shifted- Calculated equivalent toAPCP_surface
- Clone the repository
- Install or symlink bmi-cxx in an adjacent directory
- Run
make - Use whatever methods you have available to link the produced shared library to ngen
Once you have built the model, you can use the included realization.json file with a dataset to run the model.
Here is the dataset provided for use with ngen:
wget --no-parent https://ciroh-ua-ngen-data.s3.us-east-2.amazonaws.com/AWI-006/AWI_16_2853886_006.tar.gzThe model when run will output csv files with any output variables requested via the realization.json file.