Skip to content

Commit

Permalink
Move CESM_output_dir to global_params
Browse files Browse the repository at this point in the history
Also removed unused import statements from notebooks, cleaned up the FastX
section of the README (mainly to mention that you had to be on the NCAR network
to connect to FastX), and removed the out-dated adf-only example
  • Loading branch information
mnlevy1981 committed Jan 24, 2024
1 parent 729064f commit 59f07cb
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 164 deletions.
17 changes: 10 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,13 @@ After the last step is finished, you can use Jupyter to view generated notebooks
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
### Looking at Output

For users running on the NCAR super computers (derecho or casper), you can visualize the web page in a browser using the FastX service. FastX requires you to be on the internal NCAR network (either on-site or via the VPN, and can be accessed via 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.
118 changes: 0 additions & 118 deletions examples/adf-only/config-adf-only.yml

This file was deleted.

11 changes: 3 additions & 8 deletions examples/coupled_model/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
data_sources:
# sname is any string used as a nickname for this configuration. It will be
### used as the name of the folder your computed notebooks are put in
sname: &sname
quick-run
sname: quick-run

# run_dir is the path to the folder you want
### all the files associated with this configuration
Expand Down Expand Up @@ -45,7 +44,7 @@ computation_config:
# All parameters under global_params get passed to all the notebooks

global_params:
test_global_param: hello
CESM_output_dir: /glade/campaign/cesm/development/cross-wg/diagnostic_framework/CESM_output_for_testing

compute_notebooks:

Expand All @@ -57,21 +56,18 @@ compute_notebooks:
### notebook from nb_path_root, minus the .ipynb
index:
parameter_groups:
none:
sname: *sname
none: {}

adf_quick_run:
parameter_groups:
none:
sname: *sname
adf_path: ../../externals/ADF
config_path: .
config_fil_str: "config_f.cam6_3_119.FLTHIST_ne30.r328_gamma0.33_soae.001.yaml"

ocean_surface:
parameter_groups:
none:
CESM_output_dir: /glade/campaign/cesm/development/cross-wg/diagnostic_framework/CESM_output_for_testing
Case: b.e23_alpha16b.BLT1850.ne30_t232.054
savefigs: False
mom6_tools_config:
Expand All @@ -87,7 +83,6 @@ compute_notebooks:
land_comparison:
parameter_groups:
none:
CESM_output_dir: /glade/campaign/cesm/development/cross-wg/diagnostic_framework/CESM_output_for_testing/
cases:
- ctsm51d159_f45_GSWP3_bgccrop_1850pAD
- ctsm51d159_f45_GSWP3_bgccrop_1850pSASU
Expand Down
1 change: 0 additions & 1 deletion examples/nblibrary/adf_quick_run.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -788,7 +788,6 @@
"import matplotlib.pyplot as plt\n",
"import xarray as xr\n",
"import numpy as np\n",
"import matplotlib.ticker as ticker\n",
"from matplotlib.ticker import MultipleLocator\n",
"from matplotlib.lines import Line2D\n",
"\n",
Expand Down
24 changes: 4 additions & 20 deletions examples/nblibrary/land_comparison.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -22,28 +22,12 @@
"%load_ext autoreload\n",
"%autoreload 2\n",
"\n",
"import os\n",
"import time\n",
"import datetime\n",
"import calendar\n",
"import cftime\n",
"\n",
"from glob import glob\n",
"from os.path import join\n",
"\n",
"import dask\n",
"\n",
"import numpy as np\n",
"import pandas as pd\n",
"import xarray as xr\n",
"\n",
"import matplotlib\n",
"import matplotlib.pyplot as plt\n",
"import matplotlib.dates as mdates\n",
"from matplotlib.pyplot import cm\n",
"import cartopy.crs as ccrs\n",
"\n",
"from distributed import wait\n",
"\n",
"%matplotlib inline"
]
Expand All @@ -63,7 +47,7 @@
},
"outputs": [],
"source": [
"CESM_output_dir = \"/glade/campaign/cesm/development/cross-wg/diagnostic_framework/CESM_output_for_testing/\"\n",
"CESM_output_dir = \"/glade/campaign/cesm/development/cross-wg/diagnostic_framework/CESM_output_for_testing\"\n",
"type = ['1850pAD','1850pSASU']\n",
"cases = ['ctsm51d159_f45_GSWP3_bgccrop_1850pAD', 'ctsm51d159_f45_GSWP3_bgccrop_1850pSASU']"
]
Expand Down Expand Up @@ -96,11 +80,11 @@
"for c in range(len(cases)):\n",
"\n",
" sim_files =[]\n",
" sim_path = CESM_output_dir+cases[c]+\"/lnd/hist/\"\n",
" sim_files.extend(sorted(glob(join(sim_path+cases[c]+\".clm2.h0.*.nc\"))))\n",
" sim_path = f\"{CESM_output_dir}/{cases[c]}/lnd/hist\"\n",
" sim_files.extend(sorted(glob(join(f\"{sim_path}/{cases[c]}.clm2.h0.*.nc\"))))\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",
" print(f\"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",
" parallel=False, preprocess=preprocess).mean('time')\n",
Expand Down
14 changes: 4 additions & 10 deletions examples/nblibrary/ocean_surface.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,11 @@
"outputs": [],
"source": [
"import xarray as xr\n",
"import numpy as np\n",
"import matplotlib.pyplot as plt\n",
"import warnings, os, yaml, argparse\n",
"import pandas as pd\n",
"import dask, intake\n",
"from datetime import datetime, date\n",
"from ncar_jobqueue import NCARCluster\n",
"from dask.distributed import Client\n",
"from mom6_tools.m6plot import xycompare, xyplot\n",
"import warnings, os\n",
"import intake\n",
"from datetime import datetime\n",
"from mom6_tools.MOM6grid import MOM6grid\n",
"from mom6_tools.surface import get_SSH, get_MLD, get_BLD\n",
"from mom6_tools.surface import get_MLD, get_BLD\n",
"\n",
"warnings.filterwarnings(\"ignore\")"
]
Expand Down

0 comments on commit 59f07cb

Please sign in to comment.