Accessing ECCOv4 release 5 output in the AWS Cloud¶
Introduction¶
In addition to accessing the ECCOv4r4 Central Estimate output released on PO.DAAC, ecco_access functions can also retrieve output from the newer release 5 (ECCOv4r5). Unlike v4r4, for which many fields can be accessed at monthly/daily/snapshot time resolutions and native/latlon grid configurations, only the v4r5 monthly mean native grid outputs are currently accessible, and ecco_access can only retrieve them within the AWS Cloud. However, a number of fields were archived in v4r5 that
were not archived in v4r4, including the terms of momentum and sea-ice budgets.
SST comparison: v4r4 vs. v4r5¶
First let’s consider a field that is archived in both releases: potential temperature in the top layer, or SST. Accessing the monthly mean potential temperature for 1998 from v4r4 (and assuming we don’t know the ShortName already):
[1]:
import xarray as xr
import matplotlib.pyplot as plt
from os.path import join,expanduser
import ecco_v4_py as ecco
import ecco_access as ea
# identify user's home directory
user_home_dir = expanduser('~')
Note: If using
s3_open_fsspecmode, you will need access to json files that are hosted on thes3://ecco-model-granules/bucket, a “requester pays” bucket. This means that the entity requesting the data (i.e., you) would pay the data transfer fees. However, no need to get alarmed! When transferring data within the same AWS region as the bucket, the requester does not have to pay any data transfer fees. If your AWS EC2 instance is set up in the same region us-west-2 (Oregon) as theecco-model-granulesbucket, there will be no cost associated with the data transfer.When accessing data from the
ecco-model-granulesbucket, a prompt appears by default to remind the user that the data access is “requester pays”. This prompt can be suppressed by settingprompt_request_payer=False.
[2]:
# open v4r4 monthly v4r4 temperature fields for 1998, using s3_open_fsspec mode
ds_T_v4r4 = ea.ecco_podaac_to_xrdataset('temperature',\
version='v4r4',grid='native',time_res='monthly',\
StartDate='1998-01',EndDate='1998-12',\
mode='s3_open_fsspec',\
prompt_request_payer=False)
ShortName Options for query "temperature":
Variable Name Description (units)
Option 1: ECCO_L4_ATM_STATE_LLC0090GRID_MONTHLY_V4R4 *native grid,monthly means*
EXFatemp Atmosphere surface (2 m) air temperature (degK)
EXFaqh Atmosphere surface (2 m) specific humidity (kg/kg)
EXFuwind Wind speed at 10m in the model +x direction (m/s)
EXFvwind Wind speed at 10m in the model +y direction (m/s)
EXFwspee Wind speed (m/s)
EXFpress Atmosphere surface pressure (N/m^2)
Option 2: ECCO_L4_HEAT_FLUX_LLC0090GRID_MONTHLY_V4R4 *native grid,monthly means*
EXFhl Open ocean air-sea latent heat flux (W/m^2)
EXFhs Open ocean air-sea sensible heat flux (W/m^2)
EXFlwdn Downward longwave radiative flux (W/m^2)
EXFswdn Downwelling shortwave radiative flux (W/m^2)
EXFqnet Open ocean net air-sea heat flux (W/m^2)
oceQnet Net heat flux into the ocean surface (W/m^2)
SIatmQnt Net upward heat flux to the atmosphere (W/m^2)
TFLUX Rate of change of ocean heat content per m^2
accounting for mass (e.g. freshwater) fluxes
(W/m^2)
EXFswnet Open ocean net shortwave radiative flux (W/m^2)
EXFlwnet Net open ocean longwave radiative flux (W/m^2)
oceQsw Net shortwave radiative flux across the ocean
surface (W/m^2)
SIaaflux Conservative ocean and sea-ice advective heat flux
adjustment, associated with temperature difference
between sea surface temperature and sea-ice,
excluding latent heat of fusion (W/m^2)
Option 3: ECCO_L4_MIXED_LAYER_DEPTH_LLC0090GRID_MONTHLY_V4R4 *native grid,monthly means*
MXLDEPTH Mixed-layer depth diagnosed using the temperature
difference criterion of Kara et al., 2000 (m)
Option 4: ECCO_L4_TEMP_SALINITY_LLC0090GRID_MONTHLY_V4R4 *native grid,monthly means*
THETA Potential temperature, i.e., temperature of water
parcel at sea level pressure (degC)
SALT Salinity (1e-3, or parts per thousand)
Option 5: ECCO_L4_OCEAN_3D_TEMPERATURE_FLUX_LLC0090GRID_MONTHLY_V4R4 *native grid,monthly means*
ADVx_TH Lateral advective flux of potential temperature in
the model +x direction (degC m^3/s)
ADVy_TH Lateral advective flux of potential temperature in
the model +y direction (degC m^3/s)
ADVr_TH Vertical advective flux of potential temperature
(degC m^3/s)
DFxE_TH Lateral diffusive flux of potential temperature in
the model +x direction (degC m^3/s)
DFyE_TH Lateral diffusive flux of potential temperature in
the model +y direction (degC m^3/s)
DFrE_TH Vertical diffusive flux of potential temperature,
explicit term (degC m^3/s)
DFrI_TH Vertical diffusive flux of potential temperature,
implicit term (degC m^3/s)
Please select option [1-5]: 4
Using dataset with ShortName: ECCO_L4_TEMP_SALINITY_LLC0090GRID_MONTHLY_V4R4
Select option 4 (the dataset that contains variables THETA and SALT), and the requested output is included in the xarray dataset ds_T_v4r4. Here is the contents of that dataset:
[3]:
ds_T_v4r4
[3]:
<xarray.Dataset> Size: 510MB
Dimensions: (time: 12, k: 50, tile: 13, j: 90, i: 90, nb: 4, j_g: 90,
i_g: 90, nv: 2, k_l: 50, k_p1: 51, k_u: 50)
Coordinates: (12/22)
* time (time) datetime64[ns] 96B 1998-01-16T12:00:00 ... 1998-12-16T1...
XC (tile, j, i) float32 421kB dask.array<chunksize=(13, 90, 90), meta=np.ndarray>
XC_bnds (tile, j, i, nb) float32 2MB dask.array<chunksize=(13, 90, 90, 4), meta=np.ndarray>
XG (tile, j_g, i_g) float32 421kB dask.array<chunksize=(13, 90, 90), meta=np.ndarray>
YC (tile, j, i) float32 421kB dask.array<chunksize=(13, 90, 90), meta=np.ndarray>
YC_bnds (tile, j, i, nb) float32 2MB dask.array<chunksize=(13, 90, 90, 4), meta=np.ndarray>
... ...
* k (k) int32 200B 0 1 2 3 4 5 6 7 8 9 ... 41 42 43 44 45 46 47 48 49
* k_l (k_l) int32 200B 0 1 2 3 4 5 6 7 8 ... 41 42 43 44 45 46 47 48 49
* k_p1 (k_p1) int32 204B 0 1 2 3 4 5 6 7 8 ... 43 44 45 46 47 48 49 50
* k_u (k_u) int32 200B 0 1 2 3 4 5 6 7 8 ... 41 42 43 44 45 46 47 48 49
* tile (tile) int32 52B 0 1 2 3 4 5 6 7 8 9 10 11 12
time_bnds (time, nv) datetime64[ns] 192B dask.array<chunksize=(12, 2), meta=np.ndarray>
Dimensions without coordinates: nb, nv
Data variables:
SALT (time, k, tile, j, i) float32 253MB dask.array<chunksize=(6, 50, 13, 90, 90), meta=np.ndarray>
THETA (time, k, tile, j, i) float32 253MB dask.array<chunksize=(6, 50, 13, 90, 90), meta=np.ndarray>
Attributes: (12/62)
Conventions: CF-1.8, ACDD-1.3
acknowledgement: This research was carried out by the Jet...
author: Ian Fenty and Ou Wang
cdm_data_type: Grid
comment: Fields provided on the curvilinear lat-l...
coordinates_comment: Note: the global 'coordinates' attribute...
... ...
time_coverage_duration: P1M
time_coverage_end: 1992-02-01T00:00:00
time_coverage_resolution: P1M
time_coverage_start: 1992-01-01T12:00:00
title: ECCO Ocean Temperature and Salinity - Mo...
uuid: f07693e6-4181-11eb-beb3-0cc47a3f44ffNow try the same thing, but with v4r5.
Note: Access to v4r5 outputs are currently accessed not through PO.DAAC’s S3 bucket, but on the “requester pays”
s3://ecco-model-granules/bucket. Users working in the us-west-2 (Oregon) AWS region will not need to pay any data transfer fees; see note above.
For mode = s3_open_fsspec, the json files will be stored under ~/MZZ/v4r5 by default, unless a different path is specified using the jsons_root_dir option.
[4]:
# open v4r5 monthly temperature fields for 1998
ds_T_v4r5 = ea.ecco_podaac_to_xrdataset('temperature',\
version='v4r5',grid='native',time_res='monthly',\
StartDate='1998-01',EndDate='1998-12',\
mode='s3_open_fsspec',\
prompt_request_payer=False)
ShortName Options for query "temperature":
Variable Name Description (units)
Option 1: ECCO_L4_ATM_SURFACE_TEMP_HUM_WIND_PRES_LLC0090GRID_MONTHLY_V4R5 *native grid,monthly means*
EXFatemp Surface (2 m) air temperature over open water.
(degK)
EXFaqh Surface (2 m) specific humidity over open water.
(kg/kg)
EXFpress Atmospheric pressure field at sea level. (N/m^2)
EXFuwind Wind speed at 10m in the +x direction at the
tracer cell on the native model grid. (m/s)
EXFvwind Wind speed at 10m in the +y direction at the
tracer cell on the native model grid. (m/s)
EXFwspee 10-m wind speed magnitude (>= 0 ) over open water.
(m/s)
Option 2: ECCO_L4_OCEAN_AND_ICE_SURFACE_HEAT_FLUX_LLC0090GRID_MONTHLY_V4R5 *native grid,monthly means*
EXFhl Air-sea latent heat flux per unit area of open
water not covered by sea-ice. (W/m^2)
EXFhs Air-sea sensible heat flux per unit area of open
water not covered by sea-ice. (W/m^2)
EXFlwdn Downward longwave radiative flux. (W/m^2)
EXFlwnet Net longwave radiative flux per unit area of open
water not covered by sea-ice. (W/m^2)
EXFswdn Downward shortwave radiative flux. (W/m^2)
EXFswnet Net shortwave radiative flux per unit area of open
water not covered by sea-ice. (W/m^2)
EXFqnet Net air-sea heat flux (turbulent and radiative)
per unit area of open water not covered by
sea-ice. (W/m^2)
SIatmQnt Net upward heat flux to the atmosphere across open
water and sea-ice or snow surfaces. (W/m^2)
SIaaflux Heat flux associated with the temperature
difference between sea surface temperature and
sea-ice (assume 0 degree C in the model). (W/m^2)
oceQnet Net heat flux into the ocean surface from all
processes: air-sea turbulent and radiative fluxes
and turbulent and conductive fluxes between the
ocean and sea-ice and snow. oceQnet does not
include the change in ocean heat content due to
changing ocean ocean mass, oceFWflx. (W/m^2)
oceQsw Net shortwave radiative flux across the ocean
surface. (W/m^2)
TFLUX The rate of change of ocean heat content due to
heat fluxes across the liquid surface and the
addition or removal of mass. Unlike oceQnet, TFLUX
includes the contribution to the ocean heat
content from changing ocean mass, oceFWflx.
(W/m^2)
Option 3: ECCO_L4_OCEAN_TEMPERATURE_FLUX_LLC0090GRID_MONTHLY_V4R5 *native grid,monthly means*
ADVx_TH Lateral advective flux of potential temperature
(THETA) in the +x direction through the 'u' face
of the tracer cell on the native model grid. (degC
m^3/s)
DFxE_TH Lateral diffusive flux of potential temperature
(THETA) in the +x direction through the 'u' face
of the tracer cell on the native model grid. (degC
m^3/s)
ADVy_TH Lateral advective flux of potential temperature
(THETA) in the +y direction through the 'v' face
of the tracer cell on the native model grid. (degC
m^3/s)
DFyE_TH Lateral diffusive flux of potential temperature
(THETA) in the +y direction through the 'v' face
of the tracer cell on the native model grid. (degC
m^3/s)
ADVr_TH Vertical advective flux of potential temperature
(THETA) in the +z direction through the top 'w'
face of the tracer cell on the native model grid.
(degC m^3/s)
DFrE_TH The explicit term of the vertical diffusive flux
of potential temperature (THETA) in the +z
direction through the top 'w' face of the tracer
cell on the native model grid. (degC m^3/s)
DFrI_TH The implicit term of the vertical diffusive flux
of potential temperature (THETA) in the +z
direction through the top 'w' face of the tracer
cell on the native model grid. (degC m^3/s)
Option 4: ECCO_L4_OCEAN_TEMPERATURE_SALINITY_LLC0090GRID_MONTHLY_V4R5 *native grid,monthly means*
THETA Sea water potential temperature, i.e., the
temperature a parcel of sea water would have if
moved adiabatically to sea level pressure. (degC)
SALT Sea water salinity. (1e-3, or parts per thousand)
Please select option [1-4]: 4
Using dataset with ShortName: ECCO_L4_OCEAN_TEMPERATURE_SALINITY_LLC0090GRID_MONTHLY_V4R5
Select option 4 again (the dataset with THETA and SALT).
[5]:
ds_T_v4r5
[5]:
<xarray.Dataset> Size: 510MB
Dimensions: (time: 12, k: 50, tile: 13, j: 90, i: 90, nb: 4, j_g: 90,
i_g: 90, nv: 2, k_l: 50, k_p1: 51, k_u: 50)
Coordinates: (12/22)
* time (time) datetime64[ns] 96B 1998-01-16T12:00:00 ... 1998-12-16T1...
XC (tile, j, i) float32 421kB dask.array<chunksize=(13, 90, 90), meta=np.ndarray>
XC_bnds (tile, j, i, nb) float32 2MB dask.array<chunksize=(13, 90, 90, 4), meta=np.ndarray>
XG (tile, j_g, i_g) float32 421kB dask.array<chunksize=(13, 90, 90), meta=np.ndarray>
YC (tile, j, i) float32 421kB dask.array<chunksize=(13, 90, 90), meta=np.ndarray>
YC_bnds (tile, j, i, nb) float32 2MB dask.array<chunksize=(13, 90, 90, 4), meta=np.ndarray>
... ...
* k (k) int32 200B 0 1 2 3 4 5 6 7 8 9 ... 41 42 43 44 45 46 47 48 49
* k_l (k_l) int32 200B 0 1 2 3 4 5 6 7 8 ... 41 42 43 44 45 46 47 48 49
* k_p1 (k_p1) int32 204B 0 1 2 3 4 5 6 7 8 ... 43 44 45 46 47 48 49 50
* k_u (k_u) int32 200B 0 1 2 3 4 5 6 7 8 ... 41 42 43 44 45 46 47 48 49
* tile (tile) int32 52B 0 1 2 3 4 5 6 7 8 9 10 11 12
time_bnds (time, nv) datetime64[ns] 192B dask.array<chunksize=(12, 2), meta=np.ndarray>
Dimensions without coordinates: nb, nv
Data variables:
SALT (time, k, tile, j, i) float32 253MB dask.array<chunksize=(6, 50, 13, 90, 90), meta=np.ndarray>
THETA (time, k, tile, j, i) float32 253MB dask.array<chunksize=(6, 50, 13, 90, 90), meta=np.ndarray>
Attributes: (12/63)
Conventions: CF-1.8, ACDD-1.3
acknowledgement: This research was carried out by the Jet...
author: Ian Fenty, Ou Wang, Ichiro Fukumori
cdm_data_type: Grid
comment: Fields provided on the curvilinear lat-l...
coordinates_comment: Note: the global 'coordinates' attribute...
... ...
time_coverage_duration: P1M
time_coverage_end: 1992-02-01T00:00:00
time_coverage_resolution: P1M
time_coverage_start: 1992-01-01T12:00:00
title: ECCO Ocean Temperature and Salinity - Mo...
uuid: 8a5175e0-2719-11f0-9a28-0a58a9feac02Now plot a map of the difference in surface potential temperature (i.e., SST) between the two releases, for May 1998.
[6]:
T_diff = ds_T_v4r5.THETA - ds_T_v4r4.THETA
plt.figure(figsize=(12,6), dpi= 90)
ecco.plot_proj_to_latlon_grid(ds_T_v4r4.XC, ds_T_v4r4.YC, \
T_diff.isel(time=4,k=0), \
user_lon_0=-160,\
projection_type='robin',\
plot_type='pcolormesh', \
cmap='RdBu_r',\
dx=1,dy=1,cmin=-1, cmax=1,show_colorbar=True)
plt.title('SST difference v4r5 - v4r4 [C], May 1998\n')
plt.show()
Momentum budget terms in v4r5¶
Now, let’s consider a dataset that was only archived in v4r5, not v4r4: the terms of the momentum budget. We will access and view the terms of the
-momentum budget, i.e., the momentum along the
-axis of the llc90 native grid.
Note: ECCOv4r5 has two different sets of momentum budget terms archived. The first set (options 1 and 2) below quantifies the effect of (lateral) vorticity advection vs. other advection terms that contribute to the momentum budget (vertical and kinetic energy gradient). The second set (options 5 and 6) consists of the primitive equation terms that describe
- and
-momentum tendency, which you probably learned in introductory fluid dynamics classes. We consider the second set below.
[7]:
# u-momentum budget terms
ds_u_mom = ea.ecco_podaac_to_xrdataset('momentum',\
version='v4r5',grid='native',time_res='monthly',\
StartDate='1998-01',EndDate='1998-12',\
mode='s3_open_fsspec',\
prompt_request_payer=False)
ShortName Options for query "momentum":
Variable Name Description (units)
Option 1: ECCO_L4_OCEAN_3D_MOMENTUM_ADV_TEND_X_LLC0090GRID_MONTHLY_V4R5 *native grid,monthly means*
Um_AdvZ3 U momentum tendency from vorticity advection.
(m/s^2)
Um_AdvRe U momentum tendency from vertical advection,
explicit part. (m/s^2)
Um_dKEdx U momentum tendency from grad KE. (m/s^2)
Option 2: ECCO_L4_OCEAN_3D_MOMENTUM_ADV_TEND_Y_LLC0090GRID_MONTHLY_V4R5 *native grid,monthly means*
Vm_AdvZ3 V momentum tendency from vorticity advection.
(m/s^2)
Vm_AdvRe V momentum tendency from vertical advection,
explicit part. (m/s^2)
Vm_dKEdy V momentum tendency from grad KE. (m/s^2)
Option 3: ECCO_L4_OCEAN_3D_MOMENTUM_DISS_TEND_X_LLC0090GRID_MONTHLY_V4R5 *native grid,monthly means*
Um_Diss2 U momentum tendency from harmonic visc alone.
(m/s^2)
Um_Diss4 U momentum tendency from biharmonic visc alone.
(m/s^2)
UBotDrag U momentum tendency from bottom drag. (m/s^2)
USidDrag U momentum tendency from side drag. (m/s^2)
UShIDrag U momentum tendency from friction/no-slip at base
of shelf ice. (m/s^2)
Option 4: ECCO_L4_OCEAN_3D_MOMENTUM_DISS_TEND_Y_LLC0090GRID_MONTHLY_V4R5 *native grid,monthly means*
Vm_Diss2 V momentum tendency from harmonic visc alone.
(m/s^2)
Vm_Diss4 V momentum tendency from biharmonic visc alone.
(m/s^2)
VBotDrag V momentum tendency from bottom drag. (m/s^2)
VSidDrag V momentum tendency from side drag. (m/s^2)
VShIDrag V momentum tendency from friction/no-slip at base
of shelf ice. (m/s^2)
Option 5: ECCO_L4_OCEAN_3D_MOMENTUM_TEND_X_LLC0090GRID_MONTHLY_V4R5 *native grid,monthly means*
TOTUTEND Tendency of zonal component of velocity. (m/s/day)
Um_Cori U momentum tendency from Coriolis term. (m/s^2)
Um_Advec U momentum tendency from advection terms. (m/s^2)
Um_Diss U momentum tendency from dissipation, explicit
part. (m/s^2)
Um_Ext U momentum tendency from external forcing. (m/s^2)
Um_dPhiX U momentum tendency from pressure/potential grad.
(m/s^2)
AB_gU U momentum tendency from Adams-Bashforth. (m/s^2)
Um_ImplD U momentum tendency from dissipation, implicit
part. (m/s^2)
Option 6: ECCO_L4_OCEAN_3D_MOMENTUM_TEND_Y_LLC0090GRID_MONTHLY_V4R5 *native grid,monthly means*
TOTVTEND Tendency of meridional component of velocity.
(m/s/day)
Vm_Cori V momentum tendency from Coriolis term. (m/s^2)
Vm_Advec V momentum tendency from advection terms. (m/s^2)
Vm_Diss V momentum tendency from dissipation, explicit
part. (m/s^2)
Vm_Ext V momentum tendency from external forcing. (m/s^2)
Vm_dPhiY V momentum tendency from pressure/potential grad.
(m/s^2)
AB_gV V momentum tendency from Adams-Bashforth. (m/s^2)
Vm_ImplD V momentum tendency from dissipation, implicit
part. (m/s^2)
Please select option [1-6]: 5
Using dataset with ShortName: ECCO_L4_OCEAN_3D_MOMENTUM_TEND_X_LLC0090GRID_MONTHLY_V4R5
Select option 5 to look at the primitive equation
-momentum terms.
Let’s plot the Coriolis and pressure gradient contributions to the model
-momentum budget on tile 7 (North Pacific). This is a rotated tile, which means the positive
direction is southward. Hence the
-momentum budget corresponds to approximately the meridional momentum budget, with the sign reversed.
[8]:
import matplotlib as mpl
seismic_nanmasked = mpl.colormaps['seismic'].copy()
seismic_nanmasked.set_bad('gray')
plt.figure(figsize=(10,7), dpi= 90)
ds_u_mom.Um_Cori.isel(time=4,k=0,tile=7).plot(cmap=seismic_nanmasked)
plt.title('$u$-momentum Coriolis term [m s$^{-2}$], surface, May 1998\n')
plt.show()
[9]:
plt.figure(figsize=(10,7),dpi=90)
ds_u_mom.Um_dPhiX.isel(time=4,k=0,tile=7).plot(cmap=seismic_nanmasked)
plt.title('$u$-momentum pressure gradient term [m s$^{-2}$], surface, May 1998\n')
plt.show()
The fact that these two terms are nearly equal and opposite reflects the dominance of geostrophic balance. The sum of the Coriolis and pressure gradient terms (1st plot below) is balanced mostly by two frictional terms (2nd plot below): the sum of the surface (Ekman) stress included in the external forcing term Um_Ext, and the implicit dissipation of momentum Um_ImplD.
[10]:
Um_Cori_plus_pgrad = ds_u_mom.Um_Cori + ds_u_mom.Um_dPhiX
plt.figure(figsize=(10,7),dpi=90)
Um_Cori_plus_pgrad.isel(time=4,k=0,tile=7).plot(cmap=seismic_nanmasked)
plt.title('$u$-momentum Coriolis plus pressure gradient terms [m s$^{-2}$], surface, May 1998\n')
plt.show()
[11]:
Um_Ext_plus_ImplD = ds_u_mom.Um_Ext + ds_u_mom.Um_ImplD
plt.figure(figsize=(10,7),dpi=90)
Um_Ext_plus_ImplD.isel(time=4,k=0,tile=7).plot(cmap=seismic_nanmasked)
plt.title('$u$-momentum external forcing + implicit dissipation terms [m s$^{-2}$], surface, May 1998\n')
plt.show()
Notice that the two term combinations above are nearly equal in magnitude and opposite in sign.
If we look at a level well below the surface (~200 m), the residual after summing the Coriolis and pressure gradient terms is even smaller.
[12]:
k_plot = 16
plt.figure(figsize=(10,7),dpi=90)
Um_Cori_plus_pgrad.isel(time=4,k=k_plot,tile=7).plot(cmap=seismic_nanmasked)
# the syntax "%.0f" % X" rounds X to the nearest integer, with 0 digits after the decimal point
plt.title('$u$-momentum Coriolis plus pressure gradient terms [m s$^{-2}$], '\
+f'{"%.0f" % -Um_Cori_plus_pgrad.Z[k_plot].values} m depth, May 1998\n')
plt.show()
Exercise: Try plotting the terms of the meridional momentum budget globally. To do this successfully you will need both the
- and
-momentum terms, and to interpolate and rotate them using the
and
parameters in the grid file (you can use the v4r4 grid file for this). This tutorial is a good resource for how to do the interpolation/rotation on the llc90 grid.
-momentum tendency, which you probably learned in introductory fluid dynamics classes. We consider the second
set below.
and
parameters in the grid file (you can use the v4r4 grid file for this).