Adding Mixed Layer Depth Diagnostic#87
Closed
breichl wants to merge 7 commits into
Closed
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).
jkrasting
requested changes
Oct 25, 2021
jkrasting
left a comment
Collaborator
There was a problem hiding this comment.
@breichl - Looks really good. Mostly a few minor nits.
Major comments:
- Please apply the black code formatter to your .py files
- Consider whether or not using xESMF for regridding would work better for this diagnostic
Comment on lines
+188
to
+189
| obs_lat = np.copy(ds_obs["Lat"]) | ||
| obs_lon = np.copy(ds_obs["Lon"]) |
Collaborator
There was a problem hiding this comment.
Copying in general increases the memory footprint. You can access the underlying NumPy arrays by using the .values method, e.g.
obs_lat = ds_obs["Lat"].values
| # Gridding obs data to common grid. While obs data is already on the common grid, | ||
| # it may need shuffled if crossing periodic longitude boundary. This is an easy | ||
| # way to ensure that happens correctly. | ||
| obs = griddata((obs_lat.flatten(),obs_lon.flatten()), |
Collaborator
There was a problem hiding this comment.
In general, there is a lot of code here to implement regridding functionality. I wonder if using xESMF would be more streamlined?
Owner
There was a problem hiding this comment.
I agree xesmf should be used instead of griddata, there is a function in om4common to regrid data
raphaeldussin
requested changes
Oct 27, 2021
| # Gridding obs data to common grid. While obs data is already on the common grid, | ||
| # it may need shuffled if crossing periodic longitude boundary. This is an easy | ||
| # way to ensure that happens correctly. | ||
| obs = griddata((obs_lat.flatten(),obs_lon.flatten()), |
Owner
There was a problem hiding this comment.
I agree xesmf should be used instead of griddata, there is a function in om4common to regrid data
added 6 commits
October 27, 2021 09:48
- CLim -> cbar_lim - Dim -> dim
…o user/bgr/MLD_diag
Author
|
This PR is replaced by #111 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Potential Issues:
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