Skip to content

Commit

Permalink
more spaces + latex formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
navidcy committed Feb 16, 2024
1 parent 2a2e4a0 commit 5bff30f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
17 changes: 7 additions & 10 deletions demos/access_om2-forced.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -440,10 +440,9 @@
"## Directory where ocean model cut-outs go before processing\n",
"tmpdir = f\"{scratch}/regional_tmp/{expt_name}\"\n",
"\n",
"for i in [rundir,tmpdir,inputdir]:\n",
"for i in [rundir, tmpdir, inputdir]:\n",
" if not os.path.exists(i):\n",
" os.makedirs(str(i))\n",
"\n"
" os.makedirs(str(i))"
]
},
{
Expand All @@ -469,10 +468,8 @@
"metadata": {},
"outputs": [],
"source": [
"\n",
"\n",
"## Cut out 3 months of forcing from 1990\n",
"om2_input = xr.open_mfdataset(f\"/g/data/ik11/outputs/access-om2-01/01deg_jra55v13_ryf9091/output1077/ocean/ocean_daily*\",parallel=True,chunks='auto')[[\"u\",\"v\",\"salt\",\"temp\",\"eta_t\"]].sel( \n",
"om2_input = xr.open_mfdataset(f\"/g/data/ik11/outputs/access-om2-01/01deg_jra55v13_ryf9091/output1077/ocean/ocean_daily*\", parallel=True, chunks='auto')[[\"u\", \"v\", \"salt\", \"temp\", \"eta_t\"]].sel( \n",
" yu_ocean = slice(yextent[0] - 0.2, yextent[1] + 0.2),\n",
" yt_ocean = slice(yextent[0] - 0.2, yextent[1] + 0.2)\n",
").isel(time = slice(0, 5))\n",
Expand All @@ -482,19 +479,19 @@
"ic = om2_input.isel(time = 0)\n",
"\n",
"## Nicer Slicer handles seams in longitude and different grids. Ensures that the output matches our 'xextent'\n",
"ic = rm.nicer_slicer(ic,[xextent[0], xextent[1]],[\"xu_ocean\",\"xt_ocean\"])\n",
"ic = rm.nicer_slicer(ic, [xextent[0], xextent[1]], [\"xu_ocean\", \"xt_ocean\"])\n",
"ic.to_netcdf(tmpdir + \"/ic_unprocessed\")\n",
"\n",
"## Cut out East and West segments. Does lat slice first then uses nicer slicer for lon slice\n",
"eastwest = om2_input.sel( \n",
" yu_ocean = slice(yextent[0] - 0.2, yextent[1] + 0.2),\n",
" yt_ocean = slice(yextent[0] - 0.2, yextent[1] + 0.2)\n",
")\n",
"rm.nicer_slicer(eastwest,[xextent[1], xextent[1]], [\"xu_ocean\", \"xt_ocean\"]).to_netcdf(tmpdir + \"/east_unprocessed\")\n",
"rm.nicer_slicer(eastwest,[xextent[0], xextent[0]], [\"xu_ocean\", \"xt_ocean\"]).to_netcdf(tmpdir + \"/west_unprocessed\")\n",
"rm.nicer_slicer(eastwest, [xextent[1], xextent[1]], [\"xu_ocean\", \"xt_ocean\"]).to_netcdf(tmpdir + \"/east_unprocessed\")\n",
"rm.nicer_slicer(eastwest, [xextent[0], xextent[0]], [\"xu_ocean\", \"xt_ocean\"]).to_netcdf(tmpdir + \"/west_unprocessed\")\n",
"\n",
"## Cut out North and South segments\n",
"northsouth = rm.nicer_slicer(om2_input,[xextent[0],xextent[1]],[\"xu_ocean\",\"xt_ocean\"])\n",
"northsouth = rm.nicer_slicer(om2_input, [xextent[0],xextent[1]],[\"xu_ocean\",\"xt_ocean\"])\n",
"northsouth.sel(\n",
" yu_ocean = slice(yextent[1] - 0.2, yextent[1] + 0.2),\n",
" yt_ocean = slice(yextent[1] - 0.2, yextent[1] + 0.2)\n",
Expand Down
4 changes: 2 additions & 2 deletions demos/reanalysis-forced.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -296,9 +296,9 @@
"\n",
"We calculate specific humidity $q$ from dewpoint temperature $T_d$ and surface pressure $P$ via saturation vapour pressure $P_v$.\n",
"\n",
"$\\large P_v = 10^{8.07131 - \\frac{1730.63}{233.426 + T}} \\frac{101325}{760} $ Pascals\n",
"$$P_v = 10^{8.07131 - \\frac{1730.63}{233.426 + T}} \\frac{101325}{760} \\; \\textrm{[Pascal]} $$\n",
"\n",
"$\\large q = 0.001 * 0.622 \\frac{P_v}{P}$ "
"$$q = 0.001 \\times 0.622 \\frac{P_v}{P}$$"
]
},
{
Expand Down

0 comments on commit 5bff30f

Please sign in to comment.