Calculating and Caching MOC
Contents
Calculating and Caching MOC#
%load_ext autoreload
%autoreload 2
%matplotlib inline
%set_env CESMDATAROOT=/glade/scratch/eromashkova/tmp
import os
import numpy as np
import matplotlib.pyplot as plt
import xarray as xr
import dask
from dask.distributed import Client
import intake
import pop_tools
import nc_time_axis
import util
env: CESMDATAROOT=/glade/scratch/eromashkova/tmp
Reading in parameters#
### this cell will get parametrized
path_to_cat = "placeholder"
subset_kwargs = {}
asset_path = "placeholder"
### this is here so it can be run alone
#path_to_cat = "temp_data/ssh_cat_subset.json"
# Parameters
casename = "gcp-cases"
path_to_cat = "/glade/u/home/eromashkova/codes/my-cesm-experiment-extended/notebooks/temp_data/gcp-cases_subset.json"
cluster_scheduler_address = "tcp://10.12.206.47:39726"
subset_kwargs = {"frequency": "month_1", "component": "ocn", "variable": "MOC"}
asset_path = "/glade/u/home/eromashkova/codes/my-cesm-experiment-extended/notebooks/cache_data/gcp-cases_POP_MOC_extract_cat_1.nc"
Connecting to cluster#
if cluster_scheduler_address is None:
cluster, client = util.get_ClusterClient()
cluster.scale(12)
else:
client = Client(cluster_scheduler_address)
client
Client
Client-9f1d16f9-a1a9-11ed-92ca-3cecef1aca46
Connection method: Direct | |
Dashboard: https://jupyterhub.hpc.ucar.edu/stable/user/eromashkova/proxy/8787/status |
Scheduler Info
Scheduler
Scheduler-7cfddfff-723a-4eb5-8b97-437cfe055d0a
Comm: tcp://10.12.206.47:39726 | Workers: 0 |
Dashboard: https://jupyterhub.hpc.ucar.edu/stable/user/eromashkova/proxy/8787/status | Total threads: 0 |
Started: Just now | Total memory: 0 B |
Workers
Reading in data with subsetting#
print(path_to_cat)
dset_dict = (intake.open_esm_datastore(path_to_cat).search(**subset_kwargs)).to_dataset_dict()
/glade/u/home/eromashkova/codes/my-cesm-experiment-extended/notebooks/temp_data/gcp-cases_subset.json
--> The keys in the returned dictionary of datasets are constructed as follows:
'component.stream.case'
100.00% [1/1 00:18<00:00]
ds_pop = dset_dict[list(dset_dict.keys())[0]] #grabbing an arbitrary element of dset_dict
ds_pop_grid = pop_tools.get_grid('POP_gx1v7')
ds_pop["TLAT"] = ds_pop_grid.TLAT
ds_pop["TLONG"] = ds_pop_grid.TLONG
ds_pop["ULAT"] = ds_pop_grid.ULAT
ds_pop["ULONG"] = ds_pop_grid.ULONG
ds_pop["KMT"] = ds_pop_grid.KMT
j_26n = np.abs(ds_pop.lat_aux_grid - 26.0).argmin().values
j_45n = np.abs(ds_pop.lat_aux_grid - 43.0).argmin().values
ds_pop
<xarray.Dataset> Dimensions: (moc_comp: 3, transport_comp: 5, transport_reg: 2, z_t: 60, z_t_150m: 15, z_w: 60, z_w_top: 60, z_w_bot: 60, lat_aux_grid: 395, moc_z: 61, nlat: 384, nlon: 320, time: 4428, d2: 2) Coordinates: (12/66) moc_components (moc_comp) |S384 dask.array<chunksize=(3,), meta=np.ndarray> transport_components (transport_comp) |S384 dask.array<chunksize=(5,), meta=np.ndarray> transport_regions (transport_reg) |S384 dask.array<chunksize=(2,), meta=np.ndarray> * z_t (z_t) float32 500.0 1.5e+03 ... 5.125e+05 5.375e+05 * z_t_150m (z_t_150m) float32 500.0 1.5e+03 ... 1.45e+04 * z_w (z_w) float32 0.0 1e+03 2e+03 ... 5e+05 5.25e+05 ... ... salinity_factor float64 -0.00347 sflux_factor float64 0.1 nsurface_t float64 8.61e+04 nsurface_u float64 8.297e+04 time_bound (time, d2) object dask.array<chunksize=(300, 2), meta=np.ndarray> * time (time) object 1653-02-01 00:00:00 ... 2022-01-01 ... Dimensions without coordinates: moc_comp, transport_comp, transport_reg, nlat, nlon, d2 Data variables: MOC (time, transport_reg, moc_comp, moc_z, lat_aux_grid) float32 dask.array<chunksize=(300, 2, 3, 61, 395), meta=np.ndarray> Attributes: (12/20) history: none Conventions: CF-1.0; http://www.cgd.ucar.edu/cms/ea... time_period_freq: month_1 model_doi_url: https://doi.org/10.5065/D67H1H0V contents: Diagnostic and Prognostic Variables source: CCSM POP2, the CCSM Ocean Component ... ... intake_esm_attrs:long_name: Meridional Overturning Circulation intake_esm_attrs:units: Sverdrups intake_esm_attrs:vertical_levels: 1 intake_esm_attrs:frequency: month_1 intake_esm_attrs:_data_format_: netcdf intake_esm_dataset_key: ocn.pop.h.g.e22.GOMIPECOIAF_JRA-1p4-20...
xarray.Dataset
- moc_comp: 3
- transport_comp: 5
- transport_reg: 2
- z_t: 60
- z_t_150m: 15
- z_w: 60
- z_w_top: 60
- z_w_bot: 60
- lat_aux_grid: 395
- moc_z: 61
- nlat: 384
- nlon: 320
- time: 4428
- d2: 2
- moc_components(moc_comp)|S384dask.array<chunksize=(3,), meta=np.ndarray>
- long_name :
- MOC component names
- units :
Array Chunk Bytes 1.12 kiB 1.12 kiB Shape (3,) (3,) Dask graph 1 chunks in 49 graph layers Data type |S384 numpy.ndarray - transport_components(transport_comp)|S384dask.array<chunksize=(5,), meta=np.ndarray>
- long_name :
- T,S transport components
- units :
Array Chunk Bytes 1.88 kiB 1.88 kiB Shape (5,) (5,) Dask graph 1 chunks in 49 graph layers Data type |S384 numpy.ndarray - transport_regions(transport_reg)|S384dask.array<chunksize=(2,), meta=np.ndarray>
- long_name :
- regions for all transport diagnostics
- units :
Array Chunk Bytes 768 B 768 B Shape (2,) (2,) Dask graph 1 chunks in 49 graph layers Data type |S384 numpy.ndarray - z_t(z_t)float32500.0 1.5e+03 ... 5.375e+05
- long_name :
- depth from surface to midpoint of layer
- units :
- centimeters
- positive :
- down
- valid_min :
- 500.0
- valid_max :
- 537500.0
array([5.000000e+02, 1.500000e+03, 2.500000e+03, 3.500000e+03, 4.500000e+03, 5.500000e+03, 6.500000e+03, 7.500000e+03, 8.500000e+03, 9.500000e+03, 1.050000e+04, 1.150000e+04, 1.250000e+04, 1.350000e+04, 1.450000e+04, 1.550000e+04, 1.650984e+04, 1.754790e+04, 1.862913e+04, 1.976603e+04, 2.097114e+04, 2.225783e+04, 2.364088e+04, 2.513702e+04, 2.676542e+04, 2.854837e+04, 3.051192e+04, 3.268680e+04, 3.510935e+04, 3.782276e+04, 4.087846e+04, 4.433777e+04, 4.827367e+04, 5.277280e+04, 5.793729e+04, 6.388626e+04, 7.075633e+04, 7.870025e+04, 8.788252e+04, 9.847059e+04, 1.106204e+05, 1.244567e+05, 1.400497e+05, 1.573946e+05, 1.764003e+05, 1.968944e+05, 2.186457e+05, 2.413972e+05, 2.649001e+05, 2.889385e+05, 3.133405e+05, 3.379793e+05, 3.627670e+05, 3.876452e+05, 4.125768e+05, 4.375392e+05, 4.625190e+05, 4.875083e+05, 5.125028e+05, 5.375000e+05], dtype=float32)
- z_t_150m(z_t_150m)float32500.0 1.5e+03 ... 1.35e+04 1.45e+04
- long_name :
- depth from surface to midpoint of layer
- units :
- centimeters
- positive :
- down
- valid_min :
- 500.0
- valid_max :
- 14500.0
array([ 500., 1500., 2500., 3500., 4500., 5500., 6500., 7500., 8500., 9500., 10500., 11500., 12500., 13500., 14500.], dtype=float32)
- z_w(z_w)float320.0 1e+03 2e+03 ... 5e+05 5.25e+05
- long_name :
- depth from surface to top of layer
- units :
- centimeters
- positive :
- down
- valid_min :
- 0.0
- valid_max :
- 525000.94
array([ 0. , 1000. , 2000. , 3000. , 4000. , 5000. , 6000. , 7000. , 8000. , 9000. , 10000. , 11000. , 12000. , 13000. , 14000. , 15000. , 16000. , 17019.682, 18076.129, 19182.125, 20349.932, 21592.344, 22923.312, 24358.453, 25915.58 , 27615.26 , 29481.47 , 31542.373, 33831.227, 36387.473, 39258.047, 42498.887, 46176.656, 50370.688, 55174.91 , 60699.668, 67072.86 , 74439.805, 82960.695, 92804.35 , 104136.82 , 117104.016, 131809.36 , 148290.08 , 166499.2 , 186301.44 , 207487.39 , 229803.9 , 252990.4 , 276809.84 , 301067.06 , 325613.84 , 350344.88 , 375189.2 , 400101.16 , 425052.47 , 450026.06 , 475012. , 500004.7 , 525000.94 ], dtype=float32)
- z_w_top(z_w_top)float320.0 1e+03 2e+03 ... 5e+05 5.25e+05
- long_name :
- depth from surface to top of layer
- units :
- centimeters
- positive :
- down
- valid_min :
- 0.0
- valid_max :
- 525000.94
array([ 0. , 1000. , 2000. , 3000. , 4000. , 5000. , 6000. , 7000. , 8000. , 9000. , 10000. , 11000. , 12000. , 13000. , 14000. , 15000. , 16000. , 17019.682, 18076.129, 19182.125, 20349.932, 21592.344, 22923.312, 24358.453, 25915.58 , 27615.26 , 29481.47 , 31542.373, 33831.227, 36387.473, 39258.047, 42498.887, 46176.656, 50370.688, 55174.91 , 60699.668, 67072.86 , 74439.805, 82960.695, 92804.35 , 104136.82 , 117104.016, 131809.36 , 148290.08 , 166499.2 , 186301.44 , 207487.39 , 229803.9 , 252990.4 , 276809.84 , 301067.06 , 325613.84 , 350344.88 , 375189.2 , 400101.16 , 425052.47 , 450026.06 , 475012. , 500004.7 , 525000.94 ], dtype=float32)
- z_w_bot(z_w_bot)float321e+03 2e+03 ... 5.25e+05 5.5e+05
- long_name :
- depth from surface to bottom of layer
- units :
- centimeters
- positive :
- down
- valid_min :
- 1000.0
- valid_max :
- 549999.06
array([ 1000. , 2000. , 3000. , 4000. , 5000. , 6000. , 7000. , 8000. , 9000. , 10000. , 11000. , 12000. , 13000. , 14000. , 15000. , 16000. , 17019.682, 18076.129, 19182.125, 20349.932, 21592.344, 22923.312, 24358.453, 25915.58 , 27615.26 , 29481.47 , 31542.373, 33831.227, 36387.473, 39258.047, 42498.887, 46176.656, 50370.688, 55174.91 , 60699.668, 67072.86 , 74439.805, 82960.695, 92804.35 , 104136.82 , 117104.016, 131809.36 , 148290.08 , 166499.2 , 186301.44 , 207487.39 , 229803.9 , 252990.4 , 276809.84 , 301067.06 , 325613.84 , 350344.88 , 375189.2 , 400101.16 , 425052.47 , 450026.06 , 475012. , 500004.7 , 525000.94 , 549999.06 ], dtype=float32)
- lat_aux_grid(lat_aux_grid)float32-79.49 -78.95 -78.42 ... 89.47 90.0
- long_name :
- latitude grid for transport diagnostics
- units :
- degrees_north
- valid_min :
- -79.48815
- valid_max :
- 90.0
array([-79.48815 , -78.952896, -78.418655, ..., 88.948814, 89.47441 , 90. ], dtype=float32)
- moc_z(moc_z)float320.0 1e+03 ... 5.25e+05 5.5e+05
- long_name :
- depth from surface to top of layer
- units :
- centimeters
- positive :
- down
- valid_min :
- 0.0
- valid_max :
- 549999.06
array([ 0. , 1000. , 2000. , 3000. , 4000. , 5000. , 6000. , 7000. , 8000. , 9000. , 10000. , 11000. , 12000. , 13000. , 14000. , 15000. , 16000. , 17019.682, 18076.129, 19182.125, 20349.932, 21592.344, 22923.312, 24358.453, 25915.58 , 27615.26 , 29481.47 , 31542.373, 33831.227, 36387.473, 39258.047, 42498.887, 46176.656, 50370.688, 55174.91 , 60699.668, 67072.86 , 74439.805, 82960.695, 92804.35 , 104136.82 , 117104.016, 131809.36 , 148290.08 , 166499.2 , 186301.44 , 207487.39 , 229803.9 , 252990.4 , 276809.84 , 301067.06 , 325613.84 , 350344.88 , 375189.2 , 400101.16 , 425052.47 , 450026.06 , 475012. , 500004.7 , 525000.94 , 549999.06 ], dtype=float32)
- dz(z_t)float32dask.array<chunksize=(60,), meta=np.ndarray>
- long_name :
- thickness of layer k
- units :
- centimeters
Array Chunk Bytes 240 B 240 B Shape (60,) (60,) Dask graph 1 chunks in 75 graph layers Data type float32 numpy.ndarray - dzw(z_w)float32dask.array<chunksize=(60,), meta=np.ndarray>
- long_name :
- midpoint of k to midpoint of k+1
- units :
- centimeters
Array Chunk Bytes 240 B 240 B Shape (60,) (60,) Dask graph 1 chunks in 75 graph layers Data type float32 numpy.ndarray - ULONG(nlat, nlon)float64321.1 322.3 323.4 ... 319.6 320.0
- units :
- degrees_east
- long_name :
- U-grid longitude
array([[321.12500894, 322.25000897, 323.375009 , ..., 317.75000884, 318.87500887, 320.0000089 ], [321.12500894, 322.25000897, 323.375009 , ..., 317.75000884, 318.87500887, 320.0000089 ], [321.12500894, 322.25000897, 323.375009 , ..., 317.75000884, 318.87500887, 320.0000089 ], ..., [320.48637802, 320.97240884, 321.4577638 , ..., 319.02760897, 319.51363979, 320.00001324], [320.45160767, 320.90286181, 321.35342745, ..., 319.097156 , 319.54841014, 320.00001293], [320.41397858, 320.82760085, 321.24052915, ..., 319.17241696, 319.58603923, 320.00001259]])
- ULAT(nlat, nlon)float64-78.95 -78.95 ... 72.41 72.41
- units :
- degrees_north
- long_name :
- U-grid latitude
array([[-78.95289509, -78.95289509, -78.95289509, ..., -78.95289509, -78.95289509, -78.95289509], [-78.41865507, -78.41865507, -78.41865507, ..., -78.41865507, -78.41865507, -78.41865507], [-77.88441506, -77.88441506, -77.88441506, ..., -77.88441506, -77.88441506, -77.88441506], ..., [ 71.51215224, 71.51766482, 71.52684191, ..., 71.51766482, 71.51215224, 71.51031365], [ 71.95983548, 71.96504258, 71.97371054, ..., 71.96504258, 71.95983548, 71.95809872], [ 72.4135549 , 72.41841155, 72.42649554, ..., 72.41841155, 72.4135549 , 72.41193498]])
- TLONG(nlat, nlon)float64320.6 321.7 322.8 ... 319.4 319.8
- units :
- degrees_east
- long_name :
- T-grid longitude
array([[320.56250892, 321.68750895, 322.81250898, ..., 317.18750883, 318.31250886, 319.43750889], [320.56250892, 321.68750895, 322.81250898, ..., 317.18750883, 318.31250886, 319.43750889], [320.56250892, 321.68750895, 322.81250898, ..., 317.18750883, 318.31250886, 319.43750889], ..., [320.25133086, 320.75380113, 321.25577325, ..., 318.74424456, 319.24621668, 319.74869143], [320.23459477, 320.70358949, 321.17207442, ..., 318.82794339, 319.29642832, 319.76542721], [320.21650899, 320.6493303 , 321.08163473, ..., 318.91838308, 319.3506875 , 319.78351267]])
- TLAT(nlat, nlon)float64-79.22 -79.22 ... 72.19 72.19
- units :
- degrees_north
- long_name :
- T-grid latitude
array([[-79.22052261, -79.22052261, -79.22052261, ..., -79.22052261, -79.22052261, -79.22052261], [-78.68630626, -78.68630626, -78.68630626, ..., -78.68630626, -78.68630626, -78.68630626], [-78.15208992, -78.15208992, -78.15208992, ..., -78.15208992, -78.15208992, -78.15208992], ..., [ 71.29031715, 71.29408252, 71.30160692, ..., 71.30160692, 71.29408252, 71.29031716], [ 71.73524335, 71.73881845, 71.74596231, ..., 71.74596231, 71.73881845, 71.73524335], [ 72.18597561, 72.18933231, 72.19603941, ..., 72.19603941, 72.18933231, 72.18597562]])
- KMT(nlat, nlon)int320 0 0 0 0 0 0 0 ... 0 0 0 0 0 0 0 0
- long_name :
- k Index of Deepest Grid Cell on T Grid
- coordinates :
- TLONG TLAT
array([[ 0, 0, 0, ..., 0, 0, 0], [ 0, 0, 0, ..., 0, 0, 0], [38, 38, 38, ..., 0, 0, 0], ..., [ 0, 0, 0, ..., 0, 0, 0], [ 0, 0, 0, ..., 0, 0, 0], [ 0, 0, 0, ..., 0, 0, 0]], dtype=int32)
- KMU(nlat, nlon)float64dask.array<chunksize=(384, 320), meta=np.ndarray>
- long_name :
- k Index of Deepest Grid Cell on U Grid
Array Chunk Bytes 0.94 MiB 0.94 MiB Shape (384, 320) (384, 320) Dask graph 1 chunks in 75 graph layers Data type float64 numpy.ndarray - REGION_MASK(nlat, nlon)float64dask.array<chunksize=(384, 320), meta=np.ndarray>
- long_name :
- basin index number (signed integers)
Array Chunk Bytes 0.94 MiB 0.94 MiB Shape (384, 320) (384, 320) Dask graph 1 chunks in 75 graph layers Data type float64 numpy.ndarray - UAREA(nlat, nlon)float64dask.array<chunksize=(384, 320), meta=np.ndarray>
- long_name :
- area of U cells
- units :
- centimeter^2
Array Chunk Bytes 0.94 MiB 0.94 MiB Shape (384, 320) (384, 320) Dask graph 1 chunks in 75 graph layers Data type float64 numpy.ndarray - TAREA(nlat, nlon)float64dask.array<chunksize=(384, 320), meta=np.ndarray>
- long_name :
- area of T cells
- units :
- centimeter^2
Array Chunk Bytes 0.94 MiB 0.94 MiB Shape (384, 320) (384, 320) Dask graph 1 chunks in 75 graph layers Data type float64 numpy.ndarray - HU(nlat, nlon)float64dask.array<chunksize=(384, 320), meta=np.ndarray>
- long_name :
- ocean depth at U points
- units :
- centimeter
Array Chunk Bytes 0.94 MiB 0.94 MiB Shape (384, 320) (384, 320) Dask graph 1 chunks in 75 graph layers Data type float64 numpy.ndarray - HT(nlat, nlon)float64dask.array<chunksize=(384, 320), meta=np.ndarray>
- long_name :
- ocean depth at T points
- units :
- centimeter
Array Chunk Bytes 0.94 MiB 0.94 MiB Shape (384, 320) (384, 320) Dask graph 1 chunks in 75 graph layers Data type float64 numpy.ndarray - DXU(nlat, nlon)float64dask.array<chunksize=(384, 320), meta=np.ndarray>
- long_name :
- x-spacing centered at U points
- units :
- centimeters
Array Chunk Bytes 0.94 MiB 0.94 MiB Shape (384, 320) (384, 320) Dask graph 1 chunks in 75 graph layers Data type float64 numpy.ndarray - DYU(nlat, nlon)float64dask.array<chunksize=(384, 320), meta=np.ndarray>
- long_name :
- y-spacing centered at U points
- units :
- centimeters
Array Chunk Bytes 0.94 MiB 0.94 MiB Shape (384, 320) (384, 320) Dask graph 1 chunks in 75 graph layers Data type float64 numpy.ndarray - DXT(nlat, nlon)float64dask.array<chunksize=(384, 320), meta=np.ndarray>
- long_name :
- x-spacing centered at T points
- units :
- centimeters
Array Chunk Bytes 0.94 MiB 0.94 MiB Shape (384, 320) (384, 320) Dask graph 1 chunks in 75 graph layers Data type float64 numpy.ndarray - DYT(nlat, nlon)float64dask.array<chunksize=(384, 320), meta=np.ndarray>
- long_name :
- y-spacing centered at T points
- units :
- centimeters
Array Chunk Bytes 0.94 MiB 0.94 MiB Shape (384, 320) (384, 320) Dask graph 1 chunks in 75 graph layers Data type float64 numpy.ndarray - HTN(nlat, nlon)float64dask.array<chunksize=(384, 320), meta=np.ndarray>
- long_name :
- cell widths on North sides of T cell
- units :
- centimeters
Array Chunk Bytes 0.94 MiB 0.94 MiB Shape (384, 320) (384, 320) Dask graph 1 chunks in 75 graph layers Data type float64 numpy.ndarray - HTE(nlat, nlon)float64dask.array<chunksize=(384, 320), meta=np.ndarray>
- long_name :
- cell widths on East sides of T cell
- units :
- centimeters
Array Chunk Bytes 0.94 MiB 0.94 MiB Shape (384, 320) (384, 320) Dask graph 1 chunks in 75 graph layers Data type float64 numpy.ndarray - HUS(nlat, nlon)float64dask.array<chunksize=(384, 320), meta=np.ndarray>
- long_name :
- cell widths on South sides of U cell
- units :
- centimeters
Array Chunk Bytes 0.94 MiB 0.94 MiB Shape (384, 320) (384, 320) Dask graph 1 chunks in 75 graph layers Data type float64 numpy.ndarray - HUW(nlat, nlon)float64dask.array<chunksize=(384, 320), meta=np.ndarray>
- long_name :
- cell widths on West sides of U cell
- units :
- centimeters
Array Chunk Bytes 0.94 MiB 0.94 MiB Shape (384, 320) (384, 320) Dask graph 1 chunks in 75 graph layers Data type float64 numpy.ndarray - ANGLE(nlat, nlon)float64dask.array<chunksize=(384, 320), meta=np.ndarray>
- long_name :
- angle grid makes with latitude line
- units :
- radians
Array Chunk Bytes 0.94 MiB 0.94 MiB Shape (384, 320) (384, 320) Dask graph 1 chunks in 75 graph layers Data type float64 numpy.ndarray - ANGLET(nlat, nlon)float64dask.array<chunksize=(384, 320), meta=np.ndarray>
- long_name :
- angle grid makes with latitude line on T grid
- units :
- radians
Array Chunk Bytes 0.94 MiB 0.94 MiB Shape (384, 320) (384, 320) Dask graph 1 chunks in 75 graph layers Data type float64 numpy.ndarray - days_in_norm_year()timedelta64[ns]365 days
- long_name :
- Calendar Length
array(31536000000000000, dtype='timedelta64[ns]')
- grav()float64980.6
- long_name :
- Acceleration Due to Gravity
- units :
- centimeter/s^2
array(980.616)
- omega()float647.292e-05
- long_name :
- Earths Angular Velocity
- units :
- 1/second
array(7.29212352e-05)
- radius()float646.371e+08
- long_name :
- Earths Radius
- units :
- centimeters
array(6.37122e+08)
- cp_sw()float643.996e+07
- long_name :
- Specific Heat of Sea Water
- units :
- erg/g/K
array(39960000.)
- sound()float641.5e+05
- long_name :
- Speed of Sound
- units :
- centimeter/s
array(150000.)
- vonkar()float640.4
- long_name :
- von Karman Constant
array(0.4)
- cp_air()float641.005e+03
- long_name :
- Heat Capacity of Air
- units :
- joule/kg/degK
array(1004.64)
- rho_air()float641.292
- long_name :
- Ambient Air Density
- units :
- kg/m^3
array(1.29231828)
- rho_sw()float641.026
- long_name :
- Density of Sea Water
- units :
- gram/centimeter^3
array(1.026)
- rho_fw()float641.0
- long_name :
- Density of Fresh Water
- units :
- gram/centimeter^3
array(1.)
- stefan_boltzmann()float645.67e-08
- long_name :
- Stefan-Boltzmann Constant
- units :
- watt/m^2/degK^4
array(5.67e-08)
- latent_heat_vapor()float642.501e+06
- long_name :
- Latent Heat of Vaporization
- units :
- J/kg
array(2501000.)
- latent_heat_fusion()float643.337e+09
- long_name :
- Latent Heat of Fusion
- units :
- erg/g
array(3.337e+09)
- latent_heat_fusion_mks()float643.337e+05
- long_name :
- Latent Heat of Fusion
- units :
- J/kg
array(333700.)
- ocn_ref_salinity()float6434.7
- long_name :
- Ocean Reference Salinity
- units :
- g/kg
array(34.7)
- sea_ice_salinity()float644.0
- long_name :
- Salinity of Sea Ice
- units :
- g/kg
array(4.)
- T0_Kelvin()float64273.1
- long_name :
- Zero Point for Celsius
- units :
- degK
array(273.15)
- salt_to_ppt()float641e+03
- long_name :
- Convert Salt in gram/gram to g/kg
array(1000.)
- ppt_to_salt()float640.001
- long_name :
- Convert Salt in g/kg to gram/gram
array(0.001)
- mass_to_Sv()float641e-12
- long_name :
- Convert Mass Flux to Sverdrups
array(1.e-12)
- heat_to_PW()float644.186e-15
- long_name :
- Convert Heat Flux to Petawatts
array(4.186e-15)
- salt_to_Svppt()float641e-09
- long_name :
- Convert Salt Flux to Sverdrups*g/kg
array(1.e-09)
- salt_to_mmday()float643.154e+05
- long_name :
- Convert Salt to Water (millimeters/day)
array(315360.)
- momentum_factor()float6410.0
- long_name :
- Convert Windstress to Velocity Flux
array(10.)
- hflux_factor()float642.439e-05
- long_name :
- Convert Heat and Solar Flux to Temperature Flux
array(2.43908626e-05)
- fwflux_factor()float640.0001
- long_name :
- Convert Net Fresh Water Flux to Salt Flux (in model units)
array(0.0001)
- salinity_factor()float64-0.00347
array(-0.00347)
- sflux_factor()float640.1
- long_name :
- Convert Salt Flux to Salt Flux (in model units)
array(0.1)
- nsurface_t()float648.61e+04
- long_name :
- Number of Ocean T Points at Surface
array(86096.)
- nsurface_u()float648.297e+04
- long_name :
- Number of Ocean U Points at Surface
array(82966.)
- time_bound(time, d2)objectdask.array<chunksize=(300, 2), meta=np.ndarray>
- long_name :
- boundaries for time-averaging interval
Array Chunk Bytes 69.19 kiB 4.69 kiB Shape (4428, 2) (300, 2) Dask graph 16 chunks in 33 graph layers Data type object numpy.ndarray - time(time)object1653-02-01 00:00:00 ... 2022-01-...
- long_name :
- time
- bounds :
- time_bound
array([cftime.DatetimeNoLeap(1653, 2, 1, 0, 0, 0, 0, has_year_zero=True), cftime.DatetimeNoLeap(1653, 3, 1, 0, 0, 0, 0, has_year_zero=True), cftime.DatetimeNoLeap(1653, 4, 1, 0, 0, 0, 0, has_year_zero=True), ..., cftime.DatetimeNoLeap(2021, 11, 1, 0, 0, 0, 0, has_year_zero=True), cftime.DatetimeNoLeap(2021, 12, 1, 0, 0, 0, 0, has_year_zero=True), cftime.DatetimeNoLeap(2022, 1, 1, 0, 0, 0, 0, has_year_zero=True)], dtype=object)
- MOC(time, transport_reg, moc_comp, moc_z, lat_aux_grid)float32dask.array<chunksize=(300, 2, 3, 61, 395), meta=np.ndarray>
- long_name :
- Meridional Overturning Circulation
- units :
- Sverdrups
- coordinates :
- lat_aux_grid moc_z moc_components transport_region time
- cell_methods :
- time: mean
Array Chunk Bytes 2.38 GiB 165.45 MiB Shape (4428, 2, 3, 61, 395) (300, 2, 3, 61, 395) Dask graph 16 chunks in 33 graph layers Data type float32 numpy.ndarray
- z_tPandasIndex
PandasIndex(Float64Index([ 500.0, 1500.0, 2500.0, 3500.0, 4500.0, 5500.0, 6500.0, 7500.0, 8500.0, 9500.0, 10500.0, 11500.0, 12500.0, 13500.0, 14500.0, 15500.0, 16509.83984375, 17547.904296875, 18629.126953125, 19766.02734375, 20971.138671875, 22257.828125, 23640.8828125, 25137.015625, 26765.419921875, 28548.365234375, 30511.921875, 32686.798828125, 35109.34765625, 37822.76171875, 40878.46484375, 44337.76953125, 48273.671875, 52772.80078125, 57937.2890625, 63886.26171875, 70756.328125, 78700.25, 87882.5234375, 98470.5859375, 110620.421875, 124456.6875, 140049.71875, 157394.640625, 176400.328125, 196894.421875, 218645.65625, 241397.15625, 264900.125, 288938.46875, 313340.46875, 337979.34375, 362767.03125, 387645.1875, 412576.8125, 437539.25, 462519.03125, 487508.34375, 512502.8125, 537500.0], dtype='float64', name='z_t'))
- z_t_150mPandasIndex
PandasIndex(Float64Index([ 500.0, 1500.0, 2500.0, 3500.0, 4500.0, 5500.0, 6500.0, 7500.0, 8500.0, 9500.0, 10500.0, 11500.0, 12500.0, 13500.0, 14500.0], dtype='float64', name='z_t_150m'))
- z_wPandasIndex
PandasIndex(Float64Index([ 0.0, 1000.0, 2000.0, 3000.0, 4000.0, 5000.0, 6000.0, 7000.0, 8000.0, 9000.0, 10000.0, 11000.0, 12000.0, 13000.0, 14000.0, 15000.0, 16000.0, 17019.681640625, 18076.12890625, 19182.125, 20349.931640625, 21592.34375, 22923.3125, 24358.453125, 25915.580078125, 27615.259765625, 29481.470703125, 31542.373046875, 33831.2265625, 36387.47265625, 39258.046875, 42498.88671875, 46176.65625, 50370.6875, 55174.91015625, 60699.66796875, 67072.859375, 74439.8046875, 82960.6953125, 92804.3515625, 104136.8203125, 117104.015625, 131809.359375, 148290.078125, 166499.203125, 186301.4375, 207487.390625, 229803.90625, 252990.40625, 276809.84375, 301067.0625, 325613.84375, 350344.875, 375189.1875, 400101.15625, 425052.46875, 450026.0625, 475012.0, 500004.6875, 525000.9375], dtype='float64', name='z_w'))
- z_w_topPandasIndex
PandasIndex(Float64Index([ 0.0, 1000.0, 2000.0, 3000.0, 4000.0, 5000.0, 6000.0, 7000.0, 8000.0, 9000.0, 10000.0, 11000.0, 12000.0, 13000.0, 14000.0, 15000.0, 16000.0, 17019.681640625, 18076.12890625, 19182.125, 20349.931640625, 21592.34375, 22923.3125, 24358.453125, 25915.580078125, 27615.259765625, 29481.470703125, 31542.373046875, 33831.2265625, 36387.47265625, 39258.046875, 42498.88671875, 46176.65625, 50370.6875, 55174.91015625, 60699.66796875, 67072.859375, 74439.8046875, 82960.6953125, 92804.3515625, 104136.8203125, 117104.015625, 131809.359375, 148290.078125, 166499.203125, 186301.4375, 207487.390625, 229803.90625, 252990.40625, 276809.84375, 301067.0625, 325613.84375, 350344.875, 375189.1875, 400101.15625, 425052.46875, 450026.0625, 475012.0, 500004.6875, 525000.9375], dtype='float64', name='z_w_top'))
- z_w_botPandasIndex
PandasIndex(Float64Index([ 1000.0, 2000.0, 3000.0, 4000.0, 5000.0, 6000.0, 7000.0, 8000.0, 9000.0, 10000.0, 11000.0, 12000.0, 13000.0, 14000.0, 15000.0, 16000.0, 17019.681640625, 18076.12890625, 19182.125, 20349.931640625, 21592.34375, 22923.3125, 24358.453125, 25915.580078125, 27615.259765625, 29481.470703125, 31542.373046875, 33831.2265625, 36387.47265625, 39258.046875, 42498.88671875, 46176.65625, 50370.6875, 55174.91015625, 60699.66796875, 67072.859375, 74439.8046875, 82960.6953125, 92804.3515625, 104136.8203125, 117104.015625, 131809.359375, 148290.078125, 166499.203125, 186301.4375, 207487.390625, 229803.90625, 252990.40625, 276809.84375, 301067.0625, 325613.84375, 350344.875, 375189.1875, 400101.15625, 425052.46875, 450026.0625, 475012.0, 500004.6875, 525000.9375, 549999.0625], dtype='float64', name='z_w_bot'))
- lat_aux_gridPandasIndex
PandasIndex(Float64Index([-79.48815155029297, -78.95289611816406, -78.41865539550781, -77.88441467285156, -77.35017395019531, -76.81593322753906, -76.28169250488281, -75.74745178222656, -75.21321868896484, -74.6789779663086, ... 85.26966857910156, 85.79525756835938, 86.32085418701172, 86.84644317626953, 87.37203979492188, 87.89762878417969, 88.42322540283203, 88.94881439208984, 89.47441101074219, 90.0], dtype='float64', name='lat_aux_grid', length=395))
- moc_zPandasIndex
PandasIndex(Float64Index([ 0.0, 1000.0, 2000.0, 3000.0, 4000.0, 5000.0, 6000.0, 7000.0, 8000.0, 9000.0, 10000.0, 11000.0, 12000.0, 13000.0, 14000.0, 15000.0, 16000.0, 17019.681640625, 18076.12890625, 19182.125, 20349.931640625, 21592.34375, 22923.3125, 24358.453125, 25915.580078125, 27615.259765625, 29481.470703125, 31542.373046875, 33831.2265625, 36387.47265625, 39258.046875, 42498.88671875, 46176.65625, 50370.6875, 55174.91015625, 60699.66796875, 67072.859375, 74439.8046875, 82960.6953125, 92804.3515625, 104136.8203125, 117104.015625, 131809.359375, 148290.078125, 166499.203125, 186301.4375, 207487.390625, 229803.90625, 252990.40625, 276809.84375, 301067.0625, 325613.84375, 350344.875, 375189.1875, 400101.15625, 425052.46875, 450026.0625, 475012.0, 500004.6875, 525000.9375, 549999.0625], dtype='float64', name='moc_z'))
- timePandasIndex
PandasIndex(CFTimeIndex([1653-02-01 00:00:00, 1653-03-01 00:00:00, 1653-04-01 00:00:00, 1653-05-01 00:00:00, 1653-06-01 00:00:00, 1653-07-01 00:00:00, 1653-08-01 00:00:00, 1653-09-01 00:00:00, 1653-10-01 00:00:00, 1653-11-01 00:00:00, ... 2021-04-01 00:00:00, 2021-05-01 00:00:00, 2021-06-01 00:00:00, 2021-07-01 00:00:00, 2021-08-01 00:00:00, 2021-09-01 00:00:00, 2021-10-01 00:00:00, 2021-11-01 00:00:00, 2021-12-01 00:00:00, 2022-01-01 00:00:00], dtype='object', length=4428, calendar='noleap', freq='MS'))
- history :
- none
- Conventions :
- CF-1.0; http://www.cgd.ucar.edu/cms/eaton/netcdf/CF-current.htm
- time_period_freq :
- month_1
- model_doi_url :
- https://doi.org/10.5065/D67H1H0V
- contents :
- Diagnostic and Prognostic Variables
- source :
- CCSM POP2, the CCSM Ocean Component
- revision :
- $Id$
- calendar :
- All years have exactly 365 days.
- cell_methods :
- cell_methods = time: mean ==> the variable values are averaged over the time interval between the previous time coordinate and the current one. cell_methods absent ==> the variable values are at the time given by the current time coordinate.
- intake_esm_vars :
- ['MOC']
- intake_esm_attrs:component :
- ocn
- intake_esm_attrs:stream :
- pop.h
- intake_esm_attrs:case :
- g.e22.GOMIPECOIAF_JRA-1p4-2018.TL319_g17.GCB_2022.BCRD
- intake_esm_attrs:variable :
- MOC
- intake_esm_attrs:long_name :
- Meridional Overturning Circulation
- intake_esm_attrs:units :
- Sverdrups
- intake_esm_attrs:vertical_levels :
- 1
- intake_esm_attrs:frequency :
- month_1
- intake_esm_attrs:_data_format_ :
- netcdf
- intake_esm_dataset_key :
- ocn.pop.h.g.e22.GOMIPECOIAF_JRA-1p4-2018.TL319_g17.GCB_2022.BCRD
print(ds_pop['transport_regions'].values)
[b'Global Ocean - Marginal Seas'
b'Atlantic Ocean + Mediterranean Sea + Labrador Sea + GIN Sea + Arctic Ocean + Hudson Bay']
print(ds_pop['moc_components'].values)
[b'Eulerian Mean' b'Eddy-Induced (bolus)' b'Submeso']
AMOC_series_26n = ds_pop.MOC.isel(lat_aux_grid=j_26n,transport_reg=1).sum(dim='moc_comp').sel(moc_z=slice(250e2,6000e2)).max(dim='moc_z')
AMOC_series_45n = ds_pop.MOC.isel(lat_aux_grid=j_45n,transport_reg=1).sum(dim='moc_comp').sel(moc_z=slice(250e2,6000e2)).max(dim='moc_z')
AMOC_series_26n
<xarray.DataArray 'MOC' (time: 4428)> dask.array<_nanmax_skip-aggregate, shape=(4428,), dtype=float32, chunksize=(300,), chunktype=numpy.ndarray> Coordinates: (12/34) transport_regions |S384 dask.array<chunksize=(), meta=np.ndarray> lat_aux_grid float32 25.8 days_in_norm_year timedelta64[ns] 365 days grav float64 980.6 omega float64 7.292e-05 radius float64 6.371e+08 ... ... fwflux_factor float64 0.0001 salinity_factor float64 -0.00347 sflux_factor float64 0.1 nsurface_t float64 8.61e+04 nsurface_u float64 8.297e+04 * time (time) object 1653-02-01 00:00:00 ... 2022-01-01 ...
xarray.DataArray
'MOC'
- time: 4428
- dask.array<chunksize=(300,), meta=np.ndarray>
Array Chunk Bytes 17.30 kiB 1.17 kiB Shape (4428,) (300,) Dask graph 16 chunks in 42 graph layers Data type float32 numpy.ndarray - transport_regions()|S384dask.array<chunksize=(), meta=np.ndarray>
- long_name :
- regions for all transport diagnostics
- units :
Array Chunk Bytes 384 B 384 B Shape () () Dask graph 1 chunks in 50 graph layers Data type |S384 numpy.ndarray - lat_aux_grid()float3225.8
- long_name :
- latitude grid for transport diagnostics
- units :
- degrees_north
- valid_min :
- -79.48815
- valid_max :
- 90.0
array(25.796091, dtype=float32)
- days_in_norm_year()timedelta64[ns]365 days
- long_name :
- Calendar Length
array(31536000000000000, dtype='timedelta64[ns]')
- grav()float64980.6
- long_name :
- Acceleration Due to Gravity
- units :
- centimeter/s^2
array(980.616)
- omega()float647.292e-05
- long_name :
- Earths Angular Velocity
- units :
- 1/second
array(7.29212352e-05)
- radius()float646.371e+08
- long_name :
- Earths Radius
- units :
- centimeters
array(6.37122e+08)
- cp_sw()float643.996e+07
- long_name :
- Specific Heat of Sea Water
- units :
- erg/g/K
array(39960000.)
- sound()float641.5e+05
- long_name :
- Speed of Sound
- units :
- centimeter/s
array(150000.)
- vonkar()float640.4
- long_name :
- von Karman Constant
array(0.4)
- cp_air()float641.005e+03
- long_name :
- Heat Capacity of Air
- units :
- joule/kg/degK
array(1004.64)
- rho_air()float641.292
- long_name :
- Ambient Air Density
- units :
- kg/m^3
array(1.29231828)
- rho_sw()float641.026
- long_name :
- Density of Sea Water
- units :
- gram/centimeter^3
array(1.026)
- rho_fw()float641.0
- long_name :
- Density of Fresh Water
- units :
- gram/centimeter^3
array(1.)
- stefan_boltzmann()float645.67e-08
- long_name :
- Stefan-Boltzmann Constant
- units :
- watt/m^2/degK^4
array(5.67e-08)
- latent_heat_vapor()float642.501e+06
- long_name :
- Latent Heat of Vaporization
- units :
- J/kg
array(2501000.)
- latent_heat_fusion()float643.337e+09
- long_name :
- Latent Heat of Fusion
- units :
- erg/g
array(3.337e+09)
- latent_heat_fusion_mks()float643.337e+05
- long_name :
- Latent Heat of Fusion
- units :
- J/kg
array(333700.)
- ocn_ref_salinity()float6434.7
- long_name :
- Ocean Reference Salinity
- units :
- g/kg
array(34.7)
- sea_ice_salinity()float644.0
- long_name :
- Salinity of Sea Ice
- units :
- g/kg
array(4.)
- T0_Kelvin()float64273.1
- long_name :
- Zero Point for Celsius
- units :
- degK
array(273.15)
- salt_to_ppt()float641e+03
- long_name :
- Convert Salt in gram/gram to g/kg
array(1000.)
- ppt_to_salt()float640.001
- long_name :
- Convert Salt in g/kg to gram/gram
array(0.001)
- mass_to_Sv()float641e-12
- long_name :
- Convert Mass Flux to Sverdrups
array(1.e-12)
- heat_to_PW()float644.186e-15
- long_name :
- Convert Heat Flux to Petawatts
array(4.186e-15)
- salt_to_Svppt()float641e-09
- long_name :
- Convert Salt Flux to Sverdrups*g/kg
array(1.e-09)
- salt_to_mmday()float643.154e+05
- long_name :
- Convert Salt to Water (millimeters/day)
array(315360.)
- momentum_factor()float6410.0
- long_name :
- Convert Windstress to Velocity Flux
array(10.)
- hflux_factor()float642.439e-05
- long_name :
- Convert Heat and Solar Flux to Temperature Flux
array(2.43908626e-05)
- fwflux_factor()float640.0001
- long_name :
- Convert Net Fresh Water Flux to Salt Flux (in model units)
array(0.0001)
- salinity_factor()float64-0.00347
array(-0.00347)
- sflux_factor()float640.1
- long_name :
- Convert Salt Flux to Salt Flux (in model units)
array(0.1)
- nsurface_t()float648.61e+04
- long_name :
- Number of Ocean T Points at Surface
array(86096.)
- nsurface_u()float648.297e+04
- long_name :
- Number of Ocean U Points at Surface
array(82966.)
- time(time)object1653-02-01 00:00:00 ... 2022-01-...
- long_name :
- time
- bounds :
- time_bound
array([cftime.DatetimeNoLeap(1653, 2, 1, 0, 0, 0, 0, has_year_zero=True), cftime.DatetimeNoLeap(1653, 3, 1, 0, 0, 0, 0, has_year_zero=True), cftime.DatetimeNoLeap(1653, 4, 1, 0, 0, 0, 0, has_year_zero=True), ..., cftime.DatetimeNoLeap(2021, 11, 1, 0, 0, 0, 0, has_year_zero=True), cftime.DatetimeNoLeap(2021, 12, 1, 0, 0, 0, 0, has_year_zero=True), cftime.DatetimeNoLeap(2022, 1, 1, 0, 0, 0, 0, has_year_zero=True)], dtype=object)
- timePandasIndex
PandasIndex(CFTimeIndex([1653-02-01 00:00:00, 1653-03-01 00:00:00, 1653-04-01 00:00:00, 1653-05-01 00:00:00, 1653-06-01 00:00:00, 1653-07-01 00:00:00, 1653-08-01 00:00:00, 1653-09-01 00:00:00, 1653-10-01 00:00:00, 1653-11-01 00:00:00, ... 2021-04-01 00:00:00, 2021-05-01 00:00:00, 2021-06-01 00:00:00, 2021-07-01 00:00:00, 2021-08-01 00:00:00, 2021-09-01 00:00:00, 2021-10-01 00:00:00, 2021-11-01 00:00:00, 2021-12-01 00:00:00, 2022-01-01 00:00:00], dtype='object', length=4428, calendar='noleap', freq='MS'))
#AMOC_series_26n.plot()
#AMOC_series_45n.plot()
ds_26n = xr.Dataset(
{'MOC': (('time'), AMOC_series_26n.data)},
coords={'time':ds_pop.time}
)
ds_45n = xr.Dataset(
{'MOC': (('time'), AMOC_series_45n.data)},
coords={'time':ds_pop.time}
)
ds_26n.to_netcdf(asset_path)