diff --git a/README.md b/README.md index 85a1435..4baa233 100644 --- a/README.md +++ b/README.md @@ -62,3 +62,11 @@ $ cupid-build config.yml # Will build HTML from Jupyter Book After the last step is finished, you can use Jupyter to view generated notebooks in `${CUPID_ROOT}/examples/coupled-model/computed_notebooks/quick-run` or you can copy the entire `${CUPID_ROOT}/examples/coupled-model/computed_notebooks/quick-run/_build/html` directory to your local machine and look at `index.html` in a web browser. + +For users running on the NCAR super computers (derecho or casper), you can visualize the web page in a browser with the following steps: +1. open a new browser window that points to https://fastx.ucar.edu:3300/session/ +1. open a default desktop icon +1. select the browser client +1. type `xterm` and hit enter to open a terminal +1. In the terminal, run `cd ${CUPID_ROOT}/examples/coupled_model/computed_notebooks/quick-run/_build/html` to enter the `html` directory +1. From the updated directory, run `firefox index.html &` to open a web browser pointed at the generated web page diff --git a/examples/nblibrary/land_comparision.ipynb b/examples/nblibrary/land_comparision.ipynb index 0bc2f56..9801544 100644 --- a/examples/nblibrary/land_comparision.ipynb +++ b/examples/nblibrary/land_comparision.ipynb @@ -20,11 +20,10 @@ "metadata": {}, "source": [ "## Simple example comparing land variables from two simulations\n", - "- Created by wwieder@ucar.edu\n", - "- Jan 2024\n", + "Created by wwieder@ucar.edu, Jan 2024\n", "\n", "- paths are harded coded for now\n", - "- quickly (and inaccurately) calcultes 20 year mean from raw, .h0., files \n", + "- quickly (and inaccurately) calculates 5 year mean from raw, .h0., files.\n", "- plots global means and differences which also not very nice to look at, especially since this points to a 4x5 grid." ] }, @@ -64,55 +63,6 @@ "%matplotlib inline" ] }, - { - "cell_type": "code", - "execution_count": null, - "id": "e0d67916-85c5-4590-b03f-c00753e88df4", - "metadata": {}, - "outputs": [], - "source": [ - "# Updated for PBS scheduler\n", - "# this could go into utils.\n", - "# By default gets 1 core w/ 25 GB memory\n", - "def get_ClusterClient(ncores=1, nmem='25GB'):\n", - " import dask\n", - " from dask_jobqueue import PBSCluster\n", - " from dask.distributed import Client\n", - " ncores=ncores\n", - " nmem = nmem\n", - "\n", - " cluster = PBSCluster(\n", - " cores=ncores, # The number of cores you want\n", - " memory=nmem, # Amount of memory\n", - " processes=ncores, # How many processes\n", - " queue='casper', # The type of queue to utilize (/glade/u/apps/dav/opt/usr/bin/execcasper)\n", - " resource_spec='select=1:ncpus='+str(ncores)+':mem='+nmem, # Specify resources\n", - " project='P93300641', # Input your project ID here\n", - " walltime='2:00:00', # Amount of wall time\n", - " interface='ext', # Interface to use 'lo' provided a cluster window, below.\n", - " )\n", - "\n", - " dask.config.set({\n", - " 'distributed.dashboard.link':\n", - " 'https://jupyterhub.hpc.ucar.edu/stable/user/{USER}/proxy/{port}/status'\n", - " })\n", - "\n", - " client = Client(cluster)\n", - " return cluster, client" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "590d68d1-7bf3-4164-911c-c6593d010246", - "metadata": {}, - "outputs": [], - "source": [ - "cluster, client = get_ClusterClient(nmem='1GB')\n", - "cluster.scale(10) \n", - "cluster" - ] - }, { "cell_type": "code", "execution_count": null, @@ -123,8 +73,8 @@ "# -- read only these variables from the whole netcdf files\n", "# average over time\n", "def preprocess (ds):\n", - " variables = ['GPP', 'TOTECOSYSC', 'TOTVEGC','ELAI','TOTSOMC',\n", - " 'SOM_PAS_C_vr','SOM_SLO_C_vr','ALT']\n", + " variables = ['TOTECOSYSC', 'TOTVEGC','TOTSOMC',\n", + " 'SOM_PAS_C_vr']\n", "\n", " ds_new= ds[variables]\n", " return ds_new\n", @@ -154,10 +104,11 @@ "for c in range(len(cases)):\n", "\n", " sim_files =[]\n", - " sim_path = \"/glade/derecho/scratch/slevis/archive/\"+cases[c]+\"/lnd/hist/\"\n", + " sim_path = \"/glade/campaign/cesm/development/cross-wg/diagnostic_framework/CESM_output_for_testing/\"\n", + " sim_path = sim_path+cases[c]+\"/lnd/hist/\"\n", " sim_files.extend(sorted(glob(join(sim_path+cases[c]+\".clm2.h0.*.nc\"))))\n", - " # subset last 20 years of data \n", - " sim_files = sim_files[-240:None]\n", + " # subset last 5 years of data \n", + " sim_files = sim_files[-60:None]\n", " print(\"All simulation files for \"+cases[c]+\": [\", len(sim_files), \"files]\")\n", "\n", " temp = xr.open_mfdataset(sim_files, decode_times=True, combine='by_coords',\n", @@ -261,22 +212,6 @@ "plt.ylabel(None)\n", "#plt.ylim(6,0)" ] - }, - { - "cell_type": "markdown", - "id": "b3f729af-05b4-4540-b4b5-567cc1cbe8f2", - "metadata": {}, - "source": [ - "### Big blob of passive C with depth in pAD" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "c10babf2-4530-4ca9-b304-4db7fb6a965d", - "metadata": {}, - "outputs": [], - "source": [] } ], "metadata": {