{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Code for fig. S8 of\n", "#### Yeager et al., 2021: An Outsized Role for the Labrador Sea in the Multidecadal Variability of the Atlantic Overturning Circulation, *Science Advances*." ] }, { "cell_type": "code", "execution_count": 26, "metadata": {}, "outputs": [], "source": [ "import xarray as xr \n", "import numpy as np \n", "import cftime\n", "import copy\n", "import scipy.stats\n", "from scipy import signal\n", "import matplotlib.pyplot as plt\n", "import dask\n", "%matplotlib inline" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Create Dask Cluster" ] }, { "cell_type": "code", "execution_count": 25, "metadata": {}, "outputs": [], "source": [ "# Close out Dask Cluster and release workers:\n", "cluster.close()\n", "client.close()" ] }, { "cell_type": "code", "execution_count": 27, "metadata": {}, "outputs": [], "source": [ "def get_ClusterClient():\n", " import dask\n", " from dask_jobqueue import PBSCluster\n", " from dask.distributed import Client\n", " cluster = PBSCluster(\n", " cores=1,\n", " memory='10GB',\n", " processes=1,\n", " queue='casper',\n", " resource_spec='select=1:ncpus=1:mem=10GB',\n", " project='NCGD0011',\n", " walltime='02:00:00',\n", " interface='ib0',)\n", "\n", " dask.config.set({\n", " 'distributed.dashboard.link':\n", " 'https://jupyterhub.hpc.ucar.edu/stable/user/{USER}/proxy/{port}/status'\n", " })\n", " client = Client(cluster)\n", " return cluster, client" ] }, { "cell_type": "code", "execution_count": 28, "metadata": {}, "outputs": [], "source": [ "cluster, client = get_ClusterClient()\n", "cluster.scale(10) " ] }, { "cell_type": "code", "execution_count": 29, "metadata": {}, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "a5a02a51e3bd4c96baa41a9ee09a6e50", "version_major": 2, "version_minor": 0 }, "text/plain": [ "VBox(children=(HTML(value='

PBSCluster

'), HBox(children=(HTML(value='\\n
\\n