Closed paigem closed 2 years ago
The fortran source code contains a check for land and generation of an internal mask. I would have assumed that would cover these cases. Have you verified that the land mask generation is happening inside aerobulk?
Thanks @rabernat - we have not yet checked the land mask implementation in aerobulk
. Sounds like @jbusecke has looked into this a bit, and it may be a mismatch in the atmosphere variables compared to ocean (since the atmosphere variables don't need land masks!).
@jbusecke and I did a small test today to see what values are allowed in aerobulk
. We tested:
NaN
values?
aerobulk
"masks" some of the inputs that are out of range, but not all. Some variables crash the kernel when values are out of range: humidity, u_zu, v_zuWe concluded that we need to handle land masking ourselves. From the meeting today, we decided to use @rabernat's idea of flattening the input variables that get passed to aerobulk
and removing the land points. This will cover the handling of a mask and will also reduce the computations being carried out by aerobulk
since it won't have to compute unphysical quantities over land.
A PR will follow shortly. 🙂
We may need to better handle land masking. In our hacking session today with @jbusecke and @zoecharlotte47, we found that some variables get through the flux computations with lands correctly masked as
0
, while others (e.g.evap
) have some weirdness.We suggest making a MRE (minimal reproducible example) with some sample data to test how
aerobulk-python
handles NaNs.