In [19]:
import iris
import iris.plot as iplt
import matplotlib.pyplot as plt

import numpy

Surface water flux binned by temperature


In [2]:
wfo_hist_file = '/g/data/r87/dbi599/CMIP6/CMIP/CNRM-CERFACS/CNRM-CM6-1/historical/r1i1p1f2/Omon/wfo/gn/v20180917/wfo-tos-binned_Omon_CNRM-CM6-1_historical_r1i1p1f2_gn_185001-201412.nc'

In [3]:
wfo_hist_cube = iris.load_cube(wfo_hist_file, 'water_flux_into_sea_water')

In [4]:
wfo_hist_cube


Out[4]:
Water Flux Into Sea Water (kg s-1) year sea_surface_temperature region
Shape 165 44 7
Dimension coordinates
year x - -
sea_surface_temperature - x -
region - - x
Attributes
CMIP6_CV_version cv=6.2.3.0-7-g2019642
Conventions CF-1.5
EXPID CNRM-CM6-1_historical_r1i1p1f2
NCO "4.5.5"
activity_id CMIP
arpege_minor_version 6.3.2
branch_method standard
branch_time_in_child 0.0
branch_time_in_parent 0.0
contact contact.cmip@meteo.fr
creation_date 2018-06-20T08:39:57Z
data_specs_version 01.00.21
description computed as the water flux into the ocean divided by the area of the ocean...
dr2xml_md5sum d6225e658d7de0912fca2a4293dbe2a7
dr2xml_version 1.10
experiment all-forcing simulation of the recent past
experiment_id historical
external_variables areacello
forcing_index 2
frequency mon
further_info_url https://furtherinfo.es-doc.org/CMIP6.CNRM-CERFACS.CNRM-CM6-1.historica...
grid native ocean tri-polar grid with 105 k ocean cells
grid_label gn
history Thu Dec 05 16:13:53 2019: /g/data/r87/dbi599/miniconda3/envs/ocean/bin/python...
initialization_index 1
institution CNRM (Centre National de Recherches Meteorologiques, Toulouse 31057, France),...
institution_id CNRM-CERFACS
interval_operation 1800 s
interval_write 1 month
license CMIP6 model data produced by CNRM-CERFACS is licensed under a Creative...
mip_era CMIP6
name /scratch/work/voldoire/outputs/CMIP6/DECK/CNRM-CM6-1_historical_r1i1p1...
nemo_gelato_commit 49095b3accd5d4c_6524fe19b00467a
nominal_resolution 100 km
online_operation average
parent_activity_id CMIP
parent_experiment_id piControl
parent_mip_era CMIP6
parent_source_id CNRM-CM6-1
parent_time_units days since 1850-01-01 00:00:00
parent_variant_label r1i1p1f2
physics_index 1
product model-output
realization_index 1
realm ocean
references http://www.umr-cnrm.fr/cmip6/references
source CNRM-CM6-1 (2017): aerosol: prescribed monthly fields computed by TACTIC_v2...
source_id CNRM-CM6-1
source_type AOGCM
sub_experiment none
sub_experiment_id none
table_id Omon
title CNRM-CM6-1 model output prepared for CMIP6 / CMIP historical
tracking_id hdl:21.14100/54c0c5ce-1a58-47ae-9b55-4bc635c83226
variable_id wfo
variant_label r1i1p1f2
xios_commit 1442-shuffle

In [9]:
fig = plt.figure(figsize=[10, 7])
plt.axhline(y=0, color='0.5')

iplt.plot(wfo_hist_cube[0, :, 0], label='North Atlantic')
iplt.plot(wfo_hist_cube[0, :, 1], label='South Atlantic')
iplt.plot(wfo_hist_cube[0, :, 2], label='North Pacific')
iplt.plot(wfo_hist_cube[0, :, 3], label='South Pacific')
iplt.plot(wfo_hist_cube[0, :, 4], label='Indian')

plt.legend()
plt.xlabel('sea surface temperature')
plt.ylabel('water flux into sea water (kg s-1)')
plt.title('CNRM-CM6-1 (year 1850)')
plt.show()


Ocean volume binned by salinity


In [10]:
wmfile = '/g/data/r87/dbi599/CMIP6/CMIP/CCCma/CanESM5/historical/r1i1p1f1/Omon/water-mass/gn/v20190429/water-mass_Omon_CanESM5_historical_r1i1p1f1_gn_185001-186012.nc'

In [46]:
wmcube = iris.load_cube(wmfile, 'Ocean Grid-Cell Volume binned by salinity')

In [47]:
wmcube


Out[47]:
Ocean Grid-Cell Volume Binned By Salinity (m3) year sea_water_salinity region
Shape 11 104 7
Dimension coordinates
year x - -
sea_water_salinity - x -
region - - x
Attributes
CCCma_model_hash 3dedf95315d603326fde4f5340dc0519d80d10c0
CCCma_parent_runid rc3-pictrl
CCCma_pycmor_hash 33c30511acc319a98240633965a04ca99c26427e
CCCma_runid rc3.1-his01
Conventions CF-1.5
YMDH_branch_time_in_child 1850:01:01:00
YMDH_branch_time_in_parent 5201:01:01:00
activity_id CMIP
branch_method Spin-up documentation
branch_time_in_child 0.0
branch_time_in_parent 1223115.0
cmor_version 3.4.0
contact ec.cccma.info-info.ccmac.ec@canada.ca
data_specs_version 01.00.29
experiment all-forcing simulation of the recent past
experiment_id historical
external_variables areacello volcello
forcing_index 1
frequency mon
further_info_url https://furtherinfo.es-doc.org/CMIP6.CCCma.CanESM5.historical.none.r1i...
grid ORCA1 tripolar grid, 1 deg with refinement to 1/3 deg within 20 degrees...
grid_label gn
history Fri Dec 06 10:46:16 2019: /g/data/r87/dbi599/miniconda3/envs/ocean/bin/python...
initialization_index 1
institution Canadian Centre for Climate Modelling and Analysis, Environment and Climate...
institution_id CCCma
invalid_standard_name ocean_volume_binned_by_salinity
license CMIP6 model data produced by The Government of Canada (Canadian Centre...
mip_era CMIP6
nominal_resolution 100 km
parent_activity_id CMIP
parent_experiment_id piControl
parent_mip_era CMIP6
parent_source_id CanESM5
parent_time_units days since 1850-01-01 0:0:0.0
parent_variant_label r1i1p1f1
physics_index 1
product model-output
realization_index 1
realm ocean
references Geophysical Model Development Special issue on CanESM5 (https://www.ge...
source CanESM5 (2019):
aerosol interactive
atmos CanAM5 (T63L49 native atmosphere,...
source_id CanESM5
source_type AOGCM
sub_experiment none
sub_experiment_id none
table_id Omon
table_info Creation Date:(20 February 2019) MD5:374fbe5a2bcca535c40f7f23da271e49
title CanESM5 output prepared for CMIP6
variant_label r1i1p1f1
version v20190429

In [48]:
wmcube.coord('sea_water_salinity')


Out[48]:
DimCoord(array([ 5.  , 15.  , 25.  , 30.05, 30.15, 30.25, 30.35, 30.45, 30.55,
       30.65, 30.75, 30.85, 30.95, 31.05, 31.15, 31.25, 31.35, 31.45,
       31.55, 31.65, 31.75, 31.85, 31.95, 32.05, 32.15, 32.25, 32.35,
       32.45, 32.55, 32.65, 32.75, 32.85, 32.95, 33.05, 33.15, 33.25,
       33.35, 33.45, 33.55, 33.65, 33.75, 33.85, 33.95, 34.05, 34.15,
       34.25, 34.35, 34.45, 34.55, 34.65, 34.75, 34.85, 34.95, 35.05,
       35.15, 35.25, 35.35, 35.45, 35.55, 35.65, 35.75, 35.85, 35.95,
       36.05, 36.15, 36.25, 36.35, 36.45, 36.55, 36.65, 36.75, 36.85,
       36.95, 37.05, 37.15, 37.25, 37.35, 37.45, 37.55, 37.65, 37.75,
       37.85, 37.95, 38.05, 38.15, 38.25, 38.35, 38.45, 38.55, 38.65,
       38.75, 38.85, 38.95, 39.05, 39.15, 39.25, 39.35, 39.45, 39.55,
       39.65, 39.75, 39.85, 39.95, 45.  ]), bounds=array([[ 0. , 10. ],
       [10. , 20. ],
       [20. , 30. ],
       [30. , 30.1],
       [30.1, 30.2],
       [30.2, 30.3],
       [30.3, 30.4],
       [30.4, 30.5],
       [30.5, 30.6],
       [30.6, 30.7],
       [30.7, 30.8],
       [30.8, 30.9],
       [30.9, 31. ],
       [31. , 31.1],
       [31.1, 31.2],
       [31.2, 31.3],
       [31.3, 31.4],
       [31.4, 31.5],
       [31.5, 31.6],
       [31.6, 31.7],
       [31.7, 31.8],
       [31.8, 31.9],
       [31.9, 32. ],
       [32. , 32.1],
       [32.1, 32.2],
       [32.2, 32.3],
       [32.3, 32.4],
       [32.4, 32.5],
       [32.5, 32.6],
       [32.6, 32.7],
       [32.7, 32.8],
       [32.8, 32.9],
       [32.9, 33. ],
       [33. , 33.1],
       [33.1, 33.2],
       [33.2, 33.3],
       [33.3, 33.4],
       [33.4, 33.5],
       [33.5, 33.6],
       [33.6, 33.7],
       [33.7, 33.8],
       [33.8, 33.9],
       [33.9, 34. ],
       [34. , 34.1],
       [34.1, 34.2],
       [34.2, 34.3],
       [34.3, 34.4],
       [34.4, 34.5],
       [34.5, 34.6],
       [34.6, 34.7],
       [34.7, 34.8],
       [34.8, 34.9],
       [34.9, 35. ],
       [35. , 35.1],
       [35.1, 35.2],
       [35.2, 35.3],
       [35.3, 35.4],
       [35.4, 35.5],
       [35.5, 35.6],
       [35.6, 35.7],
       [35.7, 35.8],
       [35.8, 35.9],
       [35.9, 36. ],
       [36. , 36.1],
       [36.1, 36.2],
       [36.2, 36.3],
       [36.3, 36.4],
       [36.4, 36.5],
       [36.5, 36.6],
       [36.6, 36.7],
       [36.7, 36.8],
       [36.8, 36.9],
       [36.9, 37. ],
       [37. , 37.1],
       [37.1, 37.2],
       [37.2, 37.3],
       [37.3, 37.4],
       [37.4, 37.5],
       [37.5, 37.6],
       [37.6, 37.7],
       [37.7, 37.8],
       [37.8, 37.9],
       [37.9, 38. ],
       [38. , 38.1],
       [38.1, 38.2],
       [38.2, 38.3],
       [38.3, 38.4],
       [38.4, 38.5],
       [38.5, 38.6],
       [38.6, 38.7],
       [38.7, 38.8],
       [38.8, 38.9],
       [38.9, 39. ],
       [39. , 39.1],
       [39.1, 39.2],
       [39.2, 39.3],
       [39.3, 39.4],
       [39.4, 39.5],
       [39.5, 39.6],
       [39.6, 39.7],
       [39.7, 39.8],
       [39.8, 39.9],
       [39.9, 40. ],
       [40. , 50. ]]), standard_name='sea_water_salinity', units=Unit('g/kg'), long_name='Sea Water Salinity', var_name='so')

In [49]:
fig = plt.figure(figsize=[10, 7])
plt.axhline(y=0, color='0.5')

iplt.plot(wmcube[0, :, 0], label='North Atlantic')
iplt.plot(wmcube[0, :, 1], label='South Atlantic')
iplt.plot(wmcube[0, :, 2], label='North Pacific')
iplt.plot(wmcube[0, :, 3], label='South Pacific')
iplt.plot(wmcube[0, :, 4], label='Indian')

plt.legend()
plt.xlabel('sea water salinity')
plt.ylabel('volume (m3)')
plt.title('CanESM5 (year 1850)')
#plt.xlim(32, 38)
plt.show()



In [53]:
fig = plt.figure(figsize=[10, 7])
plt.axhline(y=0, color='0.5')

iplt.plot(wmcube[0, :, 0], label='North Atlantic')
iplt.plot(wmcube[0, :, 1], label='South Atlantic')
iplt.plot(wmcube[0, :, 2], label='North Pacific')
iplt.plot(wmcube[0, :, 3], label='South Pacific')
iplt.plot(wmcube[0, :, 4], label='Indian')

plt.legend()
plt.xlabel('sea water salinity')
plt.ylabel('volume (m3)')
plt.title('CanESM5 (year 1850)')
plt.xlim(33.5, 36.5)
plt.show()



In [ ]: