-
Notifications
You must be signed in to change notification settings - Fork 14
Adding Mixed Layer Depth Diagnostic #111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
- Mixed Layer depth diagnostic code added for analyzing model output - Takes MLD_003, MLD_EN1, MLD_EN2, OR MLD_EN3 as inputs. - Creates map of input (either min or max of monthly means) - Compares to similar field from obs (usually Argo based).
@@ -36,6 +36,38 @@ sources: | |||
metadata: | |||
origin_url: '' | |||
|
|||
Argo_MLD_003: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's make a note to copy these files into a central location. You can also include a notebook with the preprocessing steps in the om4labs/data
directory.
import xarray as xr | ||
import xesmf as xe | ||
import warnings | ||
from scipy.interpolate import griddata |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not used anymore
cat = open_intake_catalog(dictArgs["platform"], "obs") | ||
ds_obs = cat["Argo_MLD_003"].to_dask() | ||
|
||
ds_model = ds_input[mldvar].groupby("time.month").mean("time") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
consider moving groupby into calculate
LatMin = dims[dictArgs["grid"]][2] | ||
LatMax = dims[dictArgs["grid"]][3] | ||
|
||
# Extract copy of obs domain |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this block's purpose to select a subdomain?
|
||
regridder_mod = xe.Regridder(model, ds_plot, "bilinear", periodic=True) | ||
|
||
ds_plot["model"] = (("lat", "lon"), regridder_mod(model).MLD.values) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there might be a more concise way to do this
), | ||
) | ||
|
||
# Want to also compute the metrics here (bias, RMS, r2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bilinear interpolation does not conserve statistics beyond mean
) | ||
|
||
# Note that we are area weighting our global metrics by assuming a spherical Earth. This is a decent approximation and better than not area weighting the metrics. | ||
ds_plot["bias"] = np.nansum( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
consider using this function
Line 332 in 9d6836a
def standard_grid_cell_area(lat, lon, rE=6371.0e3): |
This PR is a replacement for #87
In addition to updating w/ the latest om4labs, it includes two updates requested in that PR:
Potential Remaining Issue:
Command to test:
om4labs mld --grid global --method max --mldvar MLD_EN1 -s /archive/bgr/FMS2019.01.03_mom6_20201020/OM4p25_JRA55do1.5_ePBLRL19_BBL01_VS_JHLtol/gfdl.ncrc4-intel18-prod/pp/ocean_monthly/ocean_monthly.static.nc /archive/bgr/FMS2019.01.03_mom6_20201020/OM4p25_JRA55do1.5_ePBLRL19_BBL01_VS_JHLtol/gfdl.ncrc4-intel18-prod/pp/ocean_monthly/ts/monthly/5yr/ocean_monthly.199801-200212.MLD_EN1.nc /archive/bgr/FMS2019.01.03_mom6_20201020/OM4p25_JRA55do1.5_ePBLRL19_BBL01_VS_JHLtol/gfdl.ncrc4-intel18-prod/pp/ocean_monthly/ts/monthly/5yr/ocean_monthly.200301-200712.MLD_EN1.nc /archive/bgr/FMS2019.01.03_mom6_20201020/OM4p25_JRA55do1.5_ePBLRL19_BBL01_VS_JHLtol/gfdl.ncrc4-intel18-prod/pp/ocean_monthly/ts/monthly/5yr/ocean_monthly.200801-201212.MLD_EN1.nc