ai2cm / fv3net

explore the FV3 data for parameterization
MIT License
16 stars 3 forks source link

Ignore nan in prognostic run diagnostic rms calculation #2355

Closed elynnwu closed 10 months ago

elynnwu commented 10 months ago

Scream prognostic outputs often have nans to denote invalid data points (e.g., temperature at 850mb when surface pressure at that point is lower than 850mb). While fv3gfs run extrapolates those points, scream masks them. This causes rms calculation to report inf. This PR adds the capability of ignoring nan values.

Significant internal changes:

Coverage reports (updated automatically):

AnnaKwa commented 10 months ago

LGTM. Does the rms function get used on non-time-averaged quantities for the SCREAM diags? I believe we only calculate RMS of already time averaged arrays for the FV3 online diagnostics. If that is also the case you could drop that line.

elynnwu commented 10 months ago

It looks like rms_errors should have been time averaged based on the transform, but when I put a breakpoint inside for debugging, I'm still getting non-time-averaged fields. I'll test it again without the breakpoint.

Update: it does need the time, transform makes it daily mean which still has the time dimension. Merging now.