Scheduled Downtime
On Wednesday 09 March 2022 from 6am to 10am MT, the website will be down for maintenance

For a given gridcell, obtain the fraction of total area corresponding to the current patch/pft


New Member
I am working on applying the consumption water flux from sectoral water usage to surface soil.
I want to add this water only over the natural vegetation, and for a given gridcell, distribute the water across relevant patches according to the weight of each natural pft.

Here is the pseudocode:

do loop over the number of points with natural vegetation:

current_nat_veg_patch = filter_nat_veg(current_number_in_the_loop)
consumption_flux_for_current_nat_veg_patch = total_consumption_flux_for_current_gridcell * weight_of_current_nat_veg_patch_for_current_gridcell

end loop;

! Important: the weight_of_current_nat_veg_patch_for_current_gridcell when summed over all elements of the loop should be 1 (which means the denominator for this weight should be the total area of only natural vegetation patches and the numerator should be the area of current nat_veg patch).

I found that there is in clm_instur the wt_nat_patch array containing the information I need. But it seems that this array for a given gridcell contain the weights of all the natural vegetation pfts in their given order. While in my loop, there may be situation where some of the possible pfts will not exist in the current gridcell. So I am not sure what to use in as pft index [wt_nat_patch(grid_cell, pft)] so it matches my current patch type.


Keith Oleson
CSEG and Liaisons
Staff member
I'm not sure I understand the question, by default the pfts share a single soil column. So it seems like you would just add the water to the soil column shared by the natural vegetation?


New Member
Hi Keith!

You are right, I didn't think about it this way.
I changed my code using column level aggregation, and I am running some tests now.

Thanks again for the precise remark!