Skip to content

Commit

Permalink
Expand documentation, remove redundant README file and dependencies f…
Browse files Browse the repository at this point in the history
…rom .toml file, update tests and demos to reflect the structural changes (ocean_forcing method replaced with separate initial condition and boundary forcing functions)
  • Loading branch information
ashjbarnes committed Feb 2, 2024
1 parent facc474 commit 6cc877d
Show file tree
Hide file tree
Showing 6 changed files with 265 additions and 115 deletions.
Empty file removed demos/README.md
Empty file.
25 changes: 19 additions & 6 deletions demos/access_om2-forced.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -770,9 +770,8 @@
"metadata": {},
"outputs": [],
"source": [
"expt.ocean_forcing(\n",
" tmpdir, ## Path to ocean foring files\n",
" {\"time\":\"time\",\n",
"# Define a mapping from the MOM5 B grid variables and dimensions to the MOM6 C grid ones\n",
"ocean_varnames = {\"time\":\"time\",\n",
" \"yh\":\"yt_ocean\",\n",
" \"xh\":\"xt_ocean\",\n",
" \"xq\":\"xu_ocean\",\n",
Expand All @@ -781,10 +780,24 @@
" \"eta\":\"eta_t\",\n",
" \"u\":\"u\",\n",
" \"v\":\"v\",\n",
" \"tracers\":{\"salt\":\"salt\",\"temp\":\"temp\"}},\n",
" boundaries = [\"south\",\"north\",\"west\",\"east\"],\n",
" \"tracers\":{\"salt\":\"salt\",\"temp\":\"temp\"}}\n",
"\n",
"# Set up the initial condition\n",
"expt.initial_condition(\n",
" tmpdir, # The directory where the unprocessed initial condition is stored, as definied earlier\n",
" ocean_varnames,\n",
" gridtype=\"B\"\n",
" )"
" )\n",
"\n",
"# Now iterate through our four boundaries \n",
"for i,orientation in enumerate([\"south\",\"north\",\"west\",\"east\"]):\n",
" expt.setup_rectangular_boundary(\n",
" tmpdir / (orientation + \"_unprocessed.nc\"),\n",
" ocean_varnames,\n",
" orientation, # Needs to know the cardinal direction of the boundary\n",
" i + 1, # Just a number to identify the boundary. Indexes from 1 \n",
" gridtype=\"B\"\n",
" )"
]
},
{
Expand Down
27 changes: 20 additions & 7 deletions demos/reanalysis-forced.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -222,9 +222,8 @@
"metadata": {},
"outputs": [],
"source": [
"expt.ocean_forcing(\n",
" glorys_path, ## Path to ocean foring files\n",
" {\"time\":\"time\",\n",
"# Define a mapping from the GLORYS variables and dimensions to the MOM6 ones\n",
"ocean_varnames = {\"time\":\"time\",\n",
" \"y\":\"latitude\",\n",
" \"x\":\"longitude\",\n",
" \"zl\":\"depth\",\n",
Expand All @@ -234,10 +233,24 @@
" \"tracers\":{\"salt\":\"so\",\n",
" \"temp\":\"thetao\"\n",
" }\n",
" },\n",
" boundaries = [\"south\",\"north\",\"west\",\"east\"],\n",
" gridtype=\"A\" ## Grid type. This is an Arakawa A grid sice velocities and tracers are all on the same points\n",
")"
" }\n",
"\n",
"# Set up the initial condition\n",
"expt.initial_condition(\n",
" glorys_path, # The directory where the unprocessed initial condition is stored, as definied earlier\n",
" ocean_varnames,\n",
" gridtype=\"A\"\n",
" )\n",
"\n",
"# Now iterate through our four boundaries \n",
"for i,orientation in enumerate([\"south\",\"north\",\"west\",\"east\"]):\n",
" expt.setup_rectangular_boundary(\n",
" glorys_path / (orientation + \"_unprocessed.nc\"),\n",
" ocean_varnames,\n",
" orientation, # Needs to know the cardinal direction of the boundary\n",
" i + 1, # Just a number to identify the boundary. Indexes from 1 \n",
" gridtype=\"A\"\n",
" )"
]
},
{
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ dependencies = [
"scipy>=1.2.0",
"xarray",
"xesmf>=0.8",
"ruamel.yaml>=0.18.0",
"f90nml>=1.4.1",
]

Expand Down
Loading

0 comments on commit 6cc877d

Please sign in to comment.