Open aktriplett opened 3 years ago
@aktriplett .. I was purposely avoiding a nansum
because undefined values of pressure/saturation outside the mask should have no bearing on the subsurface storage calculations, and the code should be tolerant of those values. The results of the calculate_subsurface_storage
function should not return any nan
s. If they are, then you've likely discovered a bug. Let me get in contact with you to get more details on this..
When adding up np arrays, using np.sum results in subsurface_storage, surface_storage and et unable to be calculated because they have undefined values outside the mask. This was fixed for me by changing np.sum to np.nansum. This has worked for myself and Jun Zhang.
Ex. below:
total subsurface storage for this time step is the summation of substorage across all x/y/z slices