Zooplankton biomass#

%load_ext autoreload
%autoreload 2
import xarray as xr

from dask.distributed import Client
import numpy as np
import catalog
import util
import pandas as pd
xr.set_options(keep_attrs=True)
import matplotlib.pyplot as plt
import cartopy
import cartopy.crs as ccrs
import pop_tools
/glade/work/kristenk/miniconda/envs/cesm-exp/lib/python3.7/site-packages/dask_jobqueue/core.py:20: FutureWarning: tmpfile is deprecated and will be removed in a future release. Please use dask.utils.tmpfile instead.
  from distributed.utils import tmpfile
ds_grid = pop_tools.get_grid('POP_gx1v7')
lons=ds_grid.TLONG
lats=ds_grid.TLAT

Parameters#

casename = 'g.e22a06.G1850ECOIAF_JRA_PHYS_DEV.TL319_g17.scope_v1'
component = 'pop'
stream = 'h'

cluster_scheduler_address = None
# Parameters
casename = "g.e22a06.G1850ECOIAF_JRA_PHYS_DEV.TL319_g17.scope_v1"
component = "pop"
stream = "h"
cluster_scheduler_address = "tcp://10.12.206.26:40301"
assert component in ['pop']
assert stream in ['h', 'h.ecosys.nday1']

Connect 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-3fc5bc18-0c3d-11ed-bd0f-3cecef1b11d4

Connection method: Direct
Dashboard: https://jupyterhub.hpc.ucar.edu/stable/user/kristenk/proxy/36768/status

Scheduler Info

Scheduler

Scheduler-59153102-2d90-4250-b1d9-5b9f28512082

Comm: tcp://10.12.206.26:40301 Workers: 32
Dashboard: https://jupyterhub.hpc.ucar.edu/stable/user/kristenk/proxy/36768/status Total threads: 32
Started: 19 minutes ago Total memory: 744.96 GiB

Workers

Worker: PBSCluster-0

Comm: tcp://10.12.206.25:41180 Total threads: 1
Dashboard: https://jupyterhub.hpc.ucar.edu/stable/user/kristenk/proxy/42193/status Memory: 23.28 GiB
Nanny: tcp://10.12.206.25:34568
Local directory: /glade/scratch/kristenk/dask-workers/dask-worker-space/worker-smli87lm
Tasks executing: 0 Tasks in memory: 0
Tasks ready: 0 Tasks in flight: 0
CPU usage: 0.0% Last seen: Just now
Memory usage: 463.56 MiB Spilled bytes: 0 B
Read bytes: 257.58 MiB Write bytes: 64.48 MiB

Worker: PBSCluster-1

Comm: tcp://10.12.206.23:35055 Total threads: 1
Dashboard: https://jupyterhub.hpc.ucar.edu/stable/user/kristenk/proxy/39970/status Memory: 23.28 GiB
Nanny: tcp://10.12.206.23:39298
Local directory: /glade/scratch/kristenk/dask-workers/dask-worker-space/worker-pajhhimy
Tasks executing: 0 Tasks in memory: 0
Tasks ready: 0 Tasks in flight: 0
CPU usage: 2.0% Last seen: Just now
Memory usage: 521.87 MiB Spilled bytes: 0 B
Read bytes: 233.60 MiB Write bytes: 91.20 kiB

Worker: PBSCluster-10

Comm: tcp://10.12.206.18:39960 Total threads: 1
Dashboard: https://jupyterhub.hpc.ucar.edu/stable/user/kristenk/proxy/40058/status Memory: 23.28 GiB
Nanny: tcp://10.12.206.18:33787
Local directory: /glade/scratch/kristenk/dask-workers/dask-worker-space/worker-frtdc9f5
Tasks executing: 0 Tasks in memory: 0
Tasks ready: 0 Tasks in flight: 0
CPU usage: 2.0% Last seen: Just now
Memory usage: 476.93 MiB Spilled bytes: 0 B
Read bytes: 96.86 MiB Write bytes: 48.45 MiB

Worker: PBSCluster-11

Comm: tcp://10.12.206.18:35287 Total threads: 1
Dashboard: https://jupyterhub.hpc.ucar.edu/stable/user/kristenk/proxy/39615/status Memory: 23.28 GiB
Nanny: tcp://10.12.206.18:36732
Local directory: /glade/scratch/kristenk/dask-workers/dask-worker-space/worker-mmo_bs6s
Tasks executing: 0 Tasks in memory: 0
Tasks ready: 0 Tasks in flight: 0
CPU usage: 0.0% Last seen: Just now
Memory usage: 474.66 MiB Spilled bytes: 0 B
Read bytes: 96.82 MiB Write bytes: 48.42 MiB

Worker: PBSCluster-12

Comm: tcp://10.12.206.8:33729 Total threads: 1
Dashboard: https://jupyterhub.hpc.ucar.edu/stable/user/kristenk/proxy/35711/status Memory: 23.28 GiB
Nanny: tcp://10.12.206.8:43143
Local directory: /glade/scratch/kristenk/dask-workers/dask-worker-space/worker-svc02rvq
Tasks executing: 0 Tasks in memory: 0
Tasks ready: 0 Tasks in flight: 0
CPU usage: 0.0% Last seen: Just now
Memory usage: 454.47 MiB Spilled bytes: 0 B
Read bytes: 257.94 MiB Write bytes: 75.54 MiB

Worker: PBSCluster-13

Comm: tcp://10.12.206.8:37550 Total threads: 1
Dashboard: https://jupyterhub.hpc.ucar.edu/stable/user/kristenk/proxy/38907/status Memory: 23.28 GiB
Nanny: tcp://10.12.206.8:40235
Local directory: /glade/scratch/kristenk/dask-workers/dask-worker-space/worker-lys_uzzv
Tasks executing: 0 Tasks in memory: 0
Tasks ready: 0 Tasks in flight: 0
CPU usage: 2.0% Last seen: Just now
Memory usage: 527.95 MiB Spilled bytes: 0 B
Read bytes: 258.11 MiB Write bytes: 75.58 MiB

Worker: PBSCluster-14

Comm: tcp://10.12.206.25:44992 Total threads: 1
Dashboard: https://jupyterhub.hpc.ucar.edu/stable/user/kristenk/proxy/44154/status Memory: 23.28 GiB
Nanny: tcp://10.12.206.25:43428
Local directory: /glade/scratch/kristenk/dask-workers/dask-worker-space/worker-76two5nt
Tasks executing: 0 Tasks in memory: 0
Tasks ready: 0 Tasks in flight: 0
CPU usage: 2.0% Last seen: Just now
Memory usage: 503.55 MiB Spilled bytes: 0 B
Read bytes: 258.07 MiB Write bytes: 64.60 MiB

Worker: PBSCluster-15

Comm: tcp://10.12.206.15:43062 Total threads: 1
Dashboard: https://jupyterhub.hpc.ucar.edu/stable/user/kristenk/proxy/32926/status Memory: 23.28 GiB
Nanny: tcp://10.12.206.15:39144
Local directory: /glade/scratch/kristenk/dask-workers/dask-worker-space/worker-jy38onqp
Tasks executing: 0 Tasks in memory: 0
Tasks ready: 0 Tasks in flight: 0
CPU usage: 0.0% Last seen: Just now
Memory usage: 466.65 MiB Spilled bytes: 0 B
Read bytes: 129.02 MiB Write bytes: 64.54 MiB

Worker: PBSCluster-16

Comm: tcp://10.12.206.8:43565 Total threads: 1
Dashboard: https://jupyterhub.hpc.ucar.edu/stable/user/kristenk/proxy/41710/status Memory: 23.28 GiB
Nanny: tcp://10.12.206.8:45391
Local directory: /glade/scratch/kristenk/dask-workers/dask-worker-space/worker-_7ilj7sa
Tasks executing: 0 Tasks in memory: 0
Tasks ready: 0 Tasks in flight: 0
CPU usage: 0.0% Last seen: Just now
Memory usage: 464.01 MiB Spilled bytes: 0 B
Read bytes: 264.60 MiB Write bytes: 86.87 MiB

Worker: PBSCluster-17

Comm: tcp://10.12.206.11:40919 Total threads: 1
Dashboard: https://jupyterhub.hpc.ucar.edu/stable/user/kristenk/proxy/45664/status Memory: 23.28 GiB
Nanny: tcp://10.12.206.11:40649
Local directory: /glade/scratch/kristenk/dask-workers/dask-worker-space/worker-o65npiy5
Tasks executing: 0 Tasks in memory: 0
Tasks ready: 0 Tasks in flight: 0
CPU usage: 2.0% Last seen: Just now
Memory usage: 525.53 MiB Spilled bytes: 0 B
Read bytes: 747.95 MiB Write bytes: 296.09 kiB

Worker: PBSCluster-18

Comm: tcp://10.12.206.11:33891 Total threads: 1
Dashboard: https://jupyterhub.hpc.ucar.edu/stable/user/kristenk/proxy/38384/status Memory: 23.28 GiB
Nanny: tcp://10.12.206.11:33328
Local directory: /glade/scratch/kristenk/dask-workers/dask-worker-space/worker-nou8aprr
Tasks executing: 0 Tasks in memory: 0
Tasks ready: 0 Tasks in flight: 0
CPU usage: 2.0% Last seen: Just now
Memory usage: 561.57 MiB Spilled bytes: 0 B
Read bytes: 747.24 MiB Write bytes: 294.88 kiB

Worker: PBSCluster-19

Comm: tcp://10.12.206.15:36904 Total threads: 1
Dashboard: https://jupyterhub.hpc.ucar.edu/stable/user/kristenk/proxy/35533/status Memory: 23.28 GiB
Nanny: tcp://10.12.206.15:34961
Local directory: /glade/scratch/kristenk/dask-workers/dask-worker-space/worker-r5hakwxw
Tasks executing: 0 Tasks in memory: 0
Tasks ready: 0 Tasks in flight: 0
CPU usage: 0.0% Last seen: Just now
Memory usage: 486.99 MiB Spilled bytes: 0 B
Read bytes: 129.08 MiB Write bytes: 64.57 MiB

Worker: PBSCluster-2

Comm: tcp://10.12.206.15:43006 Total threads: 1
Dashboard: https://jupyterhub.hpc.ucar.edu/stable/user/kristenk/proxy/39124/status Memory: 23.28 GiB
Nanny: tcp://10.12.206.15:43393
Local directory: /glade/scratch/kristenk/dask-workers/dask-worker-space/worker-mmk9h6y4
Tasks executing: 0 Tasks in memory: 0
Tasks ready: 0 Tasks in flight: 0
CPU usage: 2.0% Last seen: Just now
Memory usage: 471.05 MiB Spilled bytes: 0 B
Read bytes: 114.80 MiB Write bytes: 80.63 MiB

Worker: PBSCluster-20

Comm: tcp://10.12.206.18:45916 Total threads: 1
Dashboard: https://jupyterhub.hpc.ucar.edu/stable/user/kristenk/proxy/35027/status Memory: 23.28 GiB
Nanny: tcp://10.12.206.18:43737
Local directory: /glade/scratch/kristenk/dask-workers/dask-worker-space/worker-xa8tkihj
Tasks executing: 0 Tasks in memory: 0
Tasks ready: 0 Tasks in flight: 0
CPU usage: 0.0% Last seen: Just now
Memory usage: 453.65 MiB Spilled bytes: 0 B
Read bytes: 96.70 MiB Write bytes: 48.36 MiB

Worker: PBSCluster-21

Comm: tcp://10.12.206.11:45334 Total threads: 1
Dashboard: https://jupyterhub.hpc.ucar.edu/stable/user/kristenk/proxy/46680/status Memory: 23.28 GiB
Nanny: tcp://10.12.206.11:46761
Local directory: /glade/scratch/kristenk/dask-workers/dask-worker-space/worker-t02yg0d0
Tasks executing: 0 Tasks in memory: 0
Tasks ready: 0 Tasks in flight: 0
CPU usage: 2.0% Last seen: Just now
Memory usage: 481.23 MiB Spilled bytes: 0 B
Read bytes: 746.81 MiB Write bytes: 297.24 kiB

Worker: PBSCluster-22

Comm: tcp://10.12.206.18:34993 Total threads: 1
Dashboard: https://jupyterhub.hpc.ucar.edu/stable/user/kristenk/proxy/44524/status Memory: 23.28 GiB
Nanny: tcp://10.12.206.18:46562
Local directory: /glade/scratch/kristenk/dask-workers/dask-worker-space/worker-3e1h8ye1
Tasks executing: 0 Tasks in memory: 0
Tasks ready: 0 Tasks in flight: 0
CPU usage: 2.0% Last seen: Just now
Memory usage: 492.16 MiB Spilled bytes: 0 B
Read bytes: 96.73 MiB Write bytes: 48.38 MiB

Worker: PBSCluster-23

Comm: tcp://10.12.206.15:39733 Total threads: 1
Dashboard: https://jupyterhub.hpc.ucar.edu/stable/user/kristenk/proxy/46168/status Memory: 23.28 GiB
Nanny: tcp://10.12.206.15:41249
Local directory: /glade/scratch/kristenk/dask-workers/dask-worker-space/worker-xyvrzxs3
Tasks executing: 0 Tasks in memory: 0
Tasks ready: 0 Tasks in flight: 0
CPU usage: 2.0% Last seen: Just now
Memory usage: 485.59 MiB Spilled bytes: 0 B
Read bytes: 128.81 MiB Write bytes: 64.44 MiB

Worker: PBSCluster-24

Comm: tcp://10.12.206.25:44221 Total threads: 1
Dashboard: https://jupyterhub.hpc.ucar.edu/stable/user/kristenk/proxy/45234/status Memory: 23.28 GiB
Nanny: tcp://10.12.206.25:40387
Local directory: /glade/scratch/kristenk/dask-workers/dask-worker-space/worker-yfm951kg
Tasks executing: 0 Tasks in memory: 0
Tasks ready: 0 Tasks in flight: 0
CPU usage: 2.0% Last seen: Just now
Memory usage: 517.99 MiB Spilled bytes: 0 B
Read bytes: 257.90 MiB Write bytes: 64.56 MiB

Worker: PBSCluster-25

Comm: tcp://10.12.206.18:33408 Total threads: 1
Dashboard: https://jupyterhub.hpc.ucar.edu/stable/user/kristenk/proxy/43488/status Memory: 23.28 GiB
Nanny: tcp://10.12.206.18:41022
Local directory: /glade/scratch/kristenk/dask-workers/dask-worker-space/worker-6df9eo6t
Tasks executing: 0 Tasks in memory: 0
Tasks ready: 0 Tasks in flight: 0
CPU usage: 2.0% Last seen: Just now
Memory usage: 468.36 MiB Spilled bytes: 0 B
Read bytes: 96.73 MiB Write bytes: 48.38 MiB

Worker: PBSCluster-26

Comm: tcp://10.12.206.8:38884 Total threads: 1
Dashboard: https://jupyterhub.hpc.ucar.edu/stable/user/kristenk/proxy/39795/status Memory: 23.28 GiB
Nanny: tcp://10.12.206.8:40143
Local directory: /glade/scratch/kristenk/dask-workers/dask-worker-space/worker-sb74tso9
Tasks executing: 0 Tasks in memory: 0
Tasks ready: 0 Tasks in flight: 0
CPU usage: 2.0% Last seen: Just now
Memory usage: 460.54 MiB Spilled bytes: 0 B
Read bytes: 257.66 MiB Write bytes: 75.45 MiB

Worker: PBSCluster-27

Comm: tcp://10.12.206.15:40873 Total threads: 1
Dashboard: https://jupyterhub.hpc.ucar.edu/stable/user/kristenk/proxy/45934/status Memory: 23.28 GiB
Nanny: tcp://10.12.206.15:41861
Local directory: /glade/scratch/kristenk/dask-workers/dask-worker-space/worker-2tgmhfdl
Tasks executing: 0 Tasks in memory: 0
Tasks ready: 0 Tasks in flight: 0
CPU usage: 2.0% Last seen: Just now
Memory usage: 477.87 MiB Spilled bytes: 0 B
Read bytes: 128.97 MiB Write bytes: 64.52 MiB

Worker: PBSCluster-28

Comm: tcp://10.12.206.18:36750 Total threads: 1
Dashboard: https://jupyterhub.hpc.ucar.edu/stable/user/kristenk/proxy/42860/status Memory: 23.28 GiB
Nanny: tcp://10.12.206.18:43661
Local directory: /glade/scratch/kristenk/dask-workers/dask-worker-space/worker-6lr4z8hl
Tasks executing: 0 Tasks in memory: 0
Tasks ready: 0 Tasks in flight: 0
CPU usage: 0.0% Last seen: Just now
Memory usage: 475.46 MiB Spilled bytes: 0 B
Read bytes: 96.78 MiB Write bytes: 48.40 MiB

Worker: PBSCluster-29

Comm: tcp://10.12.206.8:32978 Total threads: 1
Dashboard: https://jupyterhub.hpc.ucar.edu/stable/user/kristenk/proxy/46650/status Memory: 23.28 GiB
Nanny: tcp://10.12.206.8:38238
Local directory: /glade/scratch/kristenk/dask-workers/dask-worker-space/worker-ihw76ltj
Tasks executing: 0 Tasks in memory: 0
Tasks ready: 0 Tasks in flight: 0
CPU usage: 2.0% Last seen: Just now
Memory usage: 452.25 MiB Spilled bytes: 0 B
Read bytes: 257.82 MiB Write bytes: 75.50 MiB

Worker: PBSCluster-3

Comm: tcp://10.12.206.18:34352 Total threads: 1
Dashboard: https://jupyterhub.hpc.ucar.edu/stable/user/kristenk/proxy/35771/status Memory: 23.28 GiB
Nanny: tcp://10.12.206.18:32780
Local directory: /glade/scratch/kristenk/dask-workers/dask-worker-space/worker-l8qf3wzg
Tasks executing: 0 Tasks in memory: 0
Tasks ready: 0 Tasks in flight: 0
CPU usage: 2.0% Last seen: Just now
Memory usage: 460.59 MiB Spilled bytes: 0 B
Read bytes: 96.80 MiB Write bytes: 48.41 MiB

Worker: PBSCluster-30

Comm: tcp://10.12.206.8:39013 Total threads: 1
Dashboard: https://jupyterhub.hpc.ucar.edu/stable/user/kristenk/proxy/33562/status Memory: 23.28 GiB
Nanny: tcp://10.12.206.8:40233
Local directory: /glade/scratch/kristenk/dask-workers/dask-worker-space/worker-peochg10
Tasks executing: 0 Tasks in memory: 0
Tasks ready: 0 Tasks in flight: 0
CPU usage: 2.0% Last seen: Just now
Memory usage: 461.38 MiB Spilled bytes: 0 B
Read bytes: 257.87 MiB Write bytes: 75.51 MiB

Worker: PBSCluster-31

Comm: tcp://10.12.206.25:43689 Total threads: 1
Dashboard: https://jupyterhub.hpc.ucar.edu/stable/user/kristenk/proxy/43012/status Memory: 23.28 GiB
Nanny: tcp://10.12.206.25:43417
Local directory: /glade/scratch/kristenk/dask-workers/dask-worker-space/worker-yfzy1i0u
Tasks executing: 0 Tasks in memory: 0
Tasks ready: 0 Tasks in flight: 0
CPU usage: 0.0% Last seen: Just now
Memory usage: 517.08 MiB Spilled bytes: 0 B
Read bytes: 257.89 MiB Write bytes: 64.56 MiB

Worker: PBSCluster-4

Comm: tcp://10.12.206.13:33058 Total threads: 1
Dashboard: https://jupyterhub.hpc.ucar.edu/stable/user/kristenk/proxy/43170/status Memory: 23.28 GiB
Nanny: tcp://10.12.206.13:39266
Local directory: /glade/scratch/kristenk/dask-workers/dask-worker-space/worker-yy1kkjd5
Tasks executing: 0 Tasks in memory: 0
Tasks ready: 0 Tasks in flight: 0
CPU usage: 0.0% Last seen: Just now
Memory usage: 491.40 MiB Spilled bytes: 0 B
Read bytes: 129.05 MiB Write bytes: 49.72 MiB

Worker: PBSCluster-5

Comm: tcp://10.12.206.23:36916 Total threads: 1
Dashboard: https://jupyterhub.hpc.ucar.edu/stable/user/kristenk/proxy/42702/status Memory: 23.28 GiB
Nanny: tcp://10.12.206.23:45113
Local directory: /glade/scratch/kristenk/dask-workers/dask-worker-space/worker-8th_y8dw
Tasks executing: 0 Tasks in memory: 0
Tasks ready: 0 Tasks in flight: 0
CPU usage: 2.0% Last seen: Just now
Memory usage: 457.90 MiB Spilled bytes: 0 B
Read bytes: 234.15 MiB Write bytes: 91.31 kiB

Worker: PBSCluster-6

Comm: tcp://10.12.206.8:38424 Total threads: 1
Dashboard: https://jupyterhub.hpc.ucar.edu/stable/user/kristenk/proxy/46679/status Memory: 23.28 GiB
Nanny: tcp://10.12.206.8:44217
Local directory: /glade/scratch/kristenk/dask-workers/dask-worker-space/worker-ml7gmjn8
Tasks executing: 0 Tasks in memory: 0
Tasks ready: 0 Tasks in flight: 0
CPU usage: 2.0% Last seen: Just now
Memory usage: 455.46 MiB Spilled bytes: 0 B
Read bytes: 258.15 MiB Write bytes: 75.60 MiB

Worker: PBSCluster-7

Comm: tcp://10.12.206.25:44991 Total threads: 1
Dashboard: https://jupyterhub.hpc.ucar.edu/stable/user/kristenk/proxy/42629/status Memory: 23.28 GiB
Nanny: tcp://10.12.206.25:45710
Local directory: /glade/scratch/kristenk/dask-workers/dask-worker-space/worker-ab599zkf
Tasks executing: 0 Tasks in memory: 0
Tasks ready: 0 Tasks in flight: 0
CPU usage: 2.0% Last seen: Just now
Memory usage: 458.74 MiB Spilled bytes: 0 B
Read bytes: 246.39 MiB Write bytes: 64.54 MiB

Worker: PBSCluster-8

Comm: tcp://10.12.206.25:42326 Total threads: 1
Dashboard: https://jupyterhub.hpc.ucar.edu/stable/user/kristenk/proxy/44451/status Memory: 23.28 GiB
Nanny: tcp://10.12.206.25:35373
Local directory: /glade/scratch/kristenk/dask-workers/dask-worker-space/worker-3gi9oohh
Tasks executing: 0 Tasks in memory: 0
Tasks ready: 0 Tasks in flight: 0
CPU usage: 0.0% Last seen: Just now
Memory usage: 470.92 MiB Spilled bytes: 0 B
Read bytes: 257.77 MiB Write bytes: 64.53 MiB

Worker: PBSCluster-9

Comm: tcp://10.12.206.15:35080 Total threads: 1
Dashboard: https://jupyterhub.hpc.ucar.edu/stable/user/kristenk/proxy/46851/status Memory: 23.28 GiB
Nanny: tcp://10.12.206.15:39139
Local directory: /glade/scratch/kristenk/dask-workers/dask-worker-space/worker-9ijbos11
Tasks executing: 0 Tasks in memory: 0
Tasks ready: 0 Tasks in flight: 0
CPU usage: 0.0% Last seen: Just now
Memory usage: 488.98 MiB Spilled bytes: 0 B
Read bytes: 118.91 MiB Write bytes: 80.69 MiB

Load the data#

dsets = catalog.to_dataset_dict(
    case=casename,
    component=component,
    stream=stream,
)
dsets.keys()
dict_keys(['g.e22a06.G1850ECOIAF_JRA_PHYS_DEV.TL319_g17.scope_v1.pop.h'])
ds = dsets[f'{casename}.{component}.{stream}']

Variable list#

variables =['mesozooC', 'microzooC']
keep_vars=['z_t','z_t_150m','dz','time_bound','time','TAREA','TLAT','TLONG'] + variables
ds = ds.drop([v for v in ds.variables if v not in keep_vars])

Make a monthly climatology dataset#

time = pd.date_range(start="2009-01-01", end="2019-01-01",freq="M")
mon_ds = ds.copy()
mon_ds['time'] = time
mon_ds = ds.groupby('time.month').mean('time')

Compute long-term mean#

ds = ds.mean(dim='time')

Plot mesozooplankton and microzooplankton biomass at the surface#

###### 
fig = plt.figure(figsize=(8,5))

ax = fig.add_subplot(2,1,1, projection=ccrs.Robinson(central_longitude=305.0))
ax.set_title('mesozooC at surface', fontsize=12)
lon, lat, field = util.adjust_pop_grid(lons, lats,  ds.microzooC.isel(z_t_150m=0))
pc=ax.pcolormesh(lon, lat, field, cmap='jet',vmin=0,vmax=2,transform=ccrs.PlateCarree())
cbar1 = fig.colorbar(pc, ax=ax,extend='max',label='microzooC (mmol m$^{-3}$)')


ax = fig.add_subplot(2,1,2, projection=ccrs.Robinson(central_longitude=305.0))
ax.set_title('mesozooC at surface', fontsize=12)
lon, lat, field = util.adjust_pop_grid(lons, lats,  ds.mesozooC.isel(z_t_150m=0))
pc=ax.pcolormesh(lon, lat, field, cmap='jet',vmin=0,vmax=4,transform=ccrs.PlateCarree())
cbar1 = fig.colorbar(pc, ax=ax,extend='max',label='mesozooC (mmol m$^{-3}$)')
_images/ocn-zoo_22_0.png

Compare mesozooplankton biomass to COPEPOD database#

Moriarty & O’Brien, 2013

file = '/glade/u/home/kristenk/work/copepod-biomass/data/POP_gx1v7/copepod-2012__cmass-m00-qtr.zarr'
ds_copepod = xr.open_zarr(file, consolidated=False)
ds_copepod['copepod_C']=ds_copepod.copepod_C/12.011
fig = plt.figure(figsize=(12,3))

ax = fig.add_subplot(1,2,1, projection=ccrs.Robinson(central_longitude=305.0))
ax.set_title('COPEPOD dataset', fontsize=12)
lon, lat, field = util.adjust_pop_grid(lons, lats, ds_copepod.copepod_C)
pc=ax.pcolormesh(lon, lat, field, cmap='Reds',vmin=0,vmax=2,transform=ccrs.PlateCarree())
ax.coastlines('110m',linewidth=0.5)

ax = fig.add_subplot(1,2,2, projection=ccrs.Robinson(central_longitude=305.0))
ax.set_title('CESM ${\it Mesozooplankton}$ biomass', fontsize=12)
lon, lat, field = util.adjust_pop_grid(lons, lats, ds.mesozooC.mean(dim='z_t_150m'))
pc=ax.pcolormesh(lon, lat, field, cmap='Reds',vmin=0,vmax=2,transform=ccrs.PlateCarree())
ax.coastlines('110m',linewidth=0.5)

fig.subplots_adjust(right=0.8)
cbar_ax = fig.add_axes([0.85, 0.15, 0.02, 0.7])
fig.colorbar(pc, cax=cbar_ax,extend='max', label='top 150m/200m mean (mmol m$^{-3}$)');
_images/ocn-zoo_25_0.png

Compare to observation-based GLMM of global mesozooplankton biomass climatology#

Heneghan et al., 2020

Petrik et al., submitted to Global Biogeochemical Cycles

file = '/glade/u/home/kristenk/work/copepod-biomass/obsglmm_zmeso_vint_200m_monthly_climatology.nc'
ds_copepod_clim = xr.open_dataset(file)
ds_copepod_clim.zmeso200.attrs['units'] = 'mgC m-2'

months = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec']
### depth integrate and convert model to mol/m2
mon_ds['mesozooC_zint'] = ((mon_ds.mesozooC) * 10.).sum(dim='z_t_150m') #in mmol/m2
mon_ds['mesozooC_zint'] = mon_ds['mesozooC_zint'] * 12.011 #convert to mgC/m2
mon_ds['mesozooC_zint'].attrs['units'] = 'mgC m-2'
fig = plt.figure(figsize=(5,18))

for row in np.arange(1,13):
    
    ts=row-1
    
    plot = row*2 - 1
    ax = fig.add_subplot(12,2,plot, projection=ccrs.Robinson(central_longitude=305.0))
    ax.set_title(months[ts]+' obs', fontsize=12)
    pc=ax.pcolormesh(ds_copepod_clim.Lon, ds_copepod_clim.Lat, ds_copepod_clim.zmeso200.isel(month=ts), 
                     cmap='Reds',vmin=0,vmax=4000,transform=ccrs.PlateCarree())
    ax.coastlines('110m',linewidth=0.5)
    
    plot = row*2
    ax = fig.add_subplot(12,2,plot, projection=ccrs.Robinson(central_longitude=305.0))
    ax.set_title(months[ts]+' CESM', fontsize=12)
    tmp = mon_ds.mesozooC_zint.isel(month=ts)
    lon, lat, field = util.adjust_pop_grid(lons, lats,  tmp)
    pc=ax.pcolormesh(lon, lat, field, cmap='Reds',vmin=0,vmax=4000,transform=ccrs.PlateCarree())
    ax.coastlines('110m',linewidth=0.5)

cbar_ax = fig.add_axes([0.92, 0.15, 0.03, 0.7])
fig.colorbar(pc, cax=cbar_ax,extend='max', label='Depth-integrated copepod biomass (mg m$^{-2}$)');
_images/ocn-zoo_29_0.png

TO DO#

• Additional comparisons to make (Colleen’s suggestions): look at the seasonal cycle in different regions and also the relationship between zooplankton biomass and chlorophyll.

• Add production fields

• z-ratio comparison

• Comparisons to MAREDAT