├── .gitattributes
├── .github
└── workflows
│ ├── DeployPage.yml
│ └── binder.yaml
├── .gitignore
├── Dockerfile
├── LICENSE
├── README.md
├── binder
└── Dockerfile
├── deprecated
├── DataStructures
│ ├── 01_MeshArrays.ipynb
│ ├── 01_MeshArrays.jl
│ ├── 02_ClimateTools.ipynb
│ ├── 02_ClimateTools.jl
│ ├── 03_nctiles.ipynb
│ ├── 03_nctiles.jl
│ ├── 04_interpolation.ipynb
│ ├── 04_interpolation.jl
│ ├── 05_ZarrCloud.ipynb
│ ├── 05_ZarrCloud.jl
│ └── helper_functions.jl
├── IPCC
│ ├── notebook_01.jl
│ ├── notebook_02.jl
│ ├── notebook_03.jl
│ ├── notebook_04.jl
│ ├── notebook_05.jl
│ └── run_notebooks.jl
├── OceanTransports
│ ├── 04_transports.ipynb
│ ├── 04_transports.jl
│ ├── 05_streamfunction.ipynb
│ ├── 05_streamfunction.jl
│ ├── 06_overturning.ipynb
│ ├── 06_overturning.jl
│ ├── 07_particles.ipynb
│ ├── 07_particles.jl
│ ├── helper_functions.jl
│ ├── interp_coeffs.csv
│ └── nctiles_climatology.csv
└── sysimage
│ ├── create_sysimage.jl
│ ├── download_stuff.jl
│ ├── postBuild
│ ├── pre_build_models.jl
│ └── warmup.jl
├── page
├── Project.toml
├── _assets
│ ├── diagonal-lines.svg
│ ├── favicon.ico
│ ├── logo.svg
│ └── nice_image.jpg
├── _css
│ ├── bootstrap.min.css
│ └── custom.css
├── _layout
│ ├── foot.html
│ ├── foot_highlight.html
│ ├── foot_katex.html
│ ├── head.html
│ ├── head_highlight.html
│ ├── head_katex.html
│ ├── header.html
│ ├── nav.html
│ ├── page_foot.html
│ ├── style_tuning.fcss
│ └── tag.html
├── _libs
│ ├── highlight
│ │ ├── highlight.pack.js
│ │ └── styles
│ │ │ ├── a11y-dark.css
│ │ │ ├── a11y-light.css
│ │ │ ├── agate.css
│ │ │ ├── an-old-hope.css
│ │ │ ├── androidstudio.css
│ │ │ ├── arduino-light.css
│ │ │ ├── arta.css
│ │ │ ├── ascetic.css
│ │ │ ├── atelier-cave-dark.css
│ │ │ ├── atelier-cave-light.css
│ │ │ ├── atelier-dune-dark.css
│ │ │ ├── atelier-dune-light.css
│ │ │ ├── atelier-estuary-dark.css
│ │ │ ├── atelier-estuary-light.css
│ │ │ ├── atelier-forest-dark.css
│ │ │ ├── atelier-forest-light.css
│ │ │ ├── atelier-heath-dark.css
│ │ │ ├── atelier-heath-light.css
│ │ │ ├── atelier-lakeside-dark.css
│ │ │ ├── atelier-lakeside-light.css
│ │ │ ├── atelier-plateau-dark.css
│ │ │ ├── atelier-plateau-light.css
│ │ │ ├── atelier-savanna-dark.css
│ │ │ ├── atelier-savanna-light.css
│ │ │ ├── atelier-seaside-dark.css
│ │ │ ├── atelier-seaside-light.css
│ │ │ ├── atelier-sulphurpool-dark.css
│ │ │ ├── atelier-sulphurpool-light.css
│ │ │ ├── atom-one-dark-reasonable.css
│ │ │ ├── atom-one-dark.css
│ │ │ ├── atom-one-light.css
│ │ │ ├── brown-paper.css
│ │ │ ├── brown-papersq.png
│ │ │ ├── codepen-embed.css
│ │ │ ├── color-brewer.css
│ │ │ ├── darcula.css
│ │ │ ├── dark.css
│ │ │ ├── default.css
│ │ │ ├── docco.css
│ │ │ ├── dracula.css
│ │ │ ├── far.css
│ │ │ ├── foundation.css
│ │ │ ├── github-gist.css
│ │ │ ├── github.css
│ │ │ ├── gml.css
│ │ │ ├── googlecode.css
│ │ │ ├── gradient-dark.css
│ │ │ ├── grayscale.css
│ │ │ ├── gruvbox-dark.css
│ │ │ ├── gruvbox-light.css
│ │ │ ├── hopscotch.css
│ │ │ ├── hybrid.css
│ │ │ ├── idea.css
│ │ │ ├── ir-black.css
│ │ │ ├── isbl-editor-dark.css
│ │ │ ├── isbl-editor-light.css
│ │ │ ├── kimbie.dark.css
│ │ │ ├── kimbie.light.css
│ │ │ ├── lightfair.css
│ │ │ ├── magula.css
│ │ │ ├── mono-blue.css
│ │ │ ├── monokai-sublime.css
│ │ │ ├── monokai.css
│ │ │ ├── night-owl.css
│ │ │ ├── nord.css
│ │ │ ├── obsidian.css
│ │ │ ├── ocean.css
│ │ │ ├── paraiso-dark.css
│ │ │ ├── paraiso-light.css
│ │ │ ├── pojoaque.css
│ │ │ ├── pojoaque.jpg
│ │ │ ├── purebasic.css
│ │ │ ├── qtcreator_dark.css
│ │ │ ├── qtcreator_light.css
│ │ │ ├── railscasts.css
│ │ │ ├── rainbow.css
│ │ │ ├── routeros.css
│ │ │ ├── school-book.css
│ │ │ ├── school-book.png
│ │ │ ├── shades-of-purple.css
│ │ │ ├── solarized-dark.css
│ │ │ ├── solarized-light.css
│ │ │ ├── srcery.css
│ │ │ ├── sunburst.css
│ │ │ ├── tomorrow-night-blue.css
│ │ │ ├── tomorrow-night-bright.css
│ │ │ ├── tomorrow-night-eighties.css
│ │ │ ├── tomorrow-night.css
│ │ │ ├── tomorrow.css
│ │ │ ├── vs.css
│ │ │ ├── vs2015.css
│ │ │ ├── xcode.css
│ │ │ ├── xt256.css
│ │ │ └── zenburn.css
│ ├── katex
│ │ ├── auto-render.min.js
│ │ ├── fonts
│ │ │ ├── KaTeX_AMS-Regular.ttf
│ │ │ ├── KaTeX_AMS-Regular.woff
│ │ │ ├── KaTeX_AMS-Regular.woff2
│ │ │ ├── KaTeX_Caligraphic-Bold.ttf
│ │ │ ├── KaTeX_Caligraphic-Bold.woff
│ │ │ ├── KaTeX_Caligraphic-Bold.woff2
│ │ │ ├── KaTeX_Caligraphic-Regular.ttf
│ │ │ ├── KaTeX_Caligraphic-Regular.woff
│ │ │ ├── KaTeX_Caligraphic-Regular.woff2
│ │ │ ├── KaTeX_Fraktur-Bold.ttf
│ │ │ ├── KaTeX_Fraktur-Bold.woff
│ │ │ ├── KaTeX_Fraktur-Bold.woff2
│ │ │ ├── KaTeX_Fraktur-Regular.ttf
│ │ │ ├── KaTeX_Fraktur-Regular.woff
│ │ │ ├── KaTeX_Fraktur-Regular.woff2
│ │ │ ├── KaTeX_Main-Bold.ttf
│ │ │ ├── KaTeX_Main-Bold.woff
│ │ │ ├── KaTeX_Main-Bold.woff2
│ │ │ ├── KaTeX_Main-BoldItalic.ttf
│ │ │ ├── KaTeX_Main-BoldItalic.woff
│ │ │ ├── KaTeX_Main-BoldItalic.woff2
│ │ │ ├── KaTeX_Main-Italic.ttf
│ │ │ ├── KaTeX_Main-Italic.woff
│ │ │ ├── KaTeX_Main-Italic.woff2
│ │ │ ├── KaTeX_Main-Regular.ttf
│ │ │ ├── KaTeX_Main-Regular.woff
│ │ │ ├── KaTeX_Main-Regular.woff2
│ │ │ ├── KaTeX_Math-BoldItalic.ttf
│ │ │ ├── KaTeX_Math-BoldItalic.woff
│ │ │ ├── KaTeX_Math-BoldItalic.woff2
│ │ │ ├── KaTeX_Math-Italic.ttf
│ │ │ ├── KaTeX_Math-Italic.woff
│ │ │ ├── KaTeX_Math-Italic.woff2
│ │ │ ├── KaTeX_SansSerif-Bold.ttf
│ │ │ ├── KaTeX_SansSerif-Bold.woff
│ │ │ ├── KaTeX_SansSerif-Bold.woff2
│ │ │ ├── KaTeX_SansSerif-Italic.ttf
│ │ │ ├── KaTeX_SansSerif-Italic.woff
│ │ │ ├── KaTeX_SansSerif-Italic.woff2
│ │ │ ├── KaTeX_SansSerif-Regular.ttf
│ │ │ ├── KaTeX_SansSerif-Regular.woff
│ │ │ ├── KaTeX_SansSerif-Regular.woff2
│ │ │ ├── KaTeX_Script-Regular.ttf
│ │ │ ├── KaTeX_Script-Regular.woff
│ │ │ ├── KaTeX_Script-Regular.woff2
│ │ │ ├── KaTeX_Size1-Regular.ttf
│ │ │ ├── KaTeX_Size1-Regular.woff
│ │ │ ├── KaTeX_Size1-Regular.woff2
│ │ │ ├── KaTeX_Size2-Regular.ttf
│ │ │ ├── KaTeX_Size2-Regular.woff
│ │ │ ├── KaTeX_Size2-Regular.woff2
│ │ │ ├── KaTeX_Size3-Regular.ttf
│ │ │ ├── KaTeX_Size3-Regular.woff
│ │ │ ├── KaTeX_Size3-Regular.woff2
│ │ │ ├── KaTeX_Size4-Regular.ttf
│ │ │ ├── KaTeX_Size4-Regular.woff
│ │ │ ├── KaTeX_Size4-Regular.woff2
│ │ │ ├── KaTeX_Typewriter-Regular.ttf
│ │ │ ├── KaTeX_Typewriter-Regular.woff
│ │ │ └── KaTeX_Typewriter-Regular.woff2
│ │ ├── katex.min.css
│ │ └── katex.min.js
│ └── simple-scrollspy.min.js
├── config.md
├── figures
│ ├── LatLonCap300mDepth.png
│ ├── MOC.png
│ ├── ScalarPotential.png
│ └── Streamfunction.png
├── index.md
└── utils.jl
├── src
├── Manifest.toml
├── Project.toml
├── download_notebooks.jl
├── environment.yml
├── plutoserver
│ ├── __init__.py
│ └── icons
│ │ └── pluto-logo.svg
├── runpluto.sh
├── setup.py
├── sysimage.jl
├── warmup1.jl
└── warmup2.jl
└── tutorials
├── GeoJSON_demo.jl
├── GeoTIFF_demo.jl
├── NetCDF_advanced.jl
├── NetCDF_basics.jl
├── NetCDF_packages.jl
├── Shapefile_demo.jl
├── YAXArrays_demo.jl
├── list_notebooks.jl
├── run_notebooks.jl
└── xarray_climarray_etc.jl
/.gitattributes:
--------------------------------------------------------------------------------
1 | page/* linguist-vendored
2 |
--------------------------------------------------------------------------------
/.github/workflows/DeployPage.yml:
--------------------------------------------------------------------------------
1 | name: Build and Deploy
2 | on:
3 | push:
4 | branches:
5 | - master
6 | - v0p3p17d
7 | pull_request:
8 | jobs:
9 | build-and-deploy:
10 | runs-on: ubuntu-latest
11 | steps:
12 | - name: Checkout
13 | uses: actions/checkout@v2
14 | with:
15 | persist-credentials: false
16 | # NOTE: uncomment the following lines if you intend to use PyPlot
17 | # - name: Install python
18 | # uses: actions/setup-python@v1
19 | # with:
20 | # python-version: '3.8'
21 | # - run: pip install matplotlib
22 | - name: Install Julia
23 | uses: julia-actions/setup-julia@v1
24 | with:
25 | version: 1.9
26 | # NOTE
27 | # Adjust the `input=""` on the last line to indicate where
28 | # the source of the package page is (`page/` by default).
29 | #
30 | # Adjust also `output=""` on the last line if you want
31 | # the page to be deployed in a specific folder on gh-pages
32 | # if you do that, make sure that you adjust the `prepath`
33 | # variable in `config.md` accordingly! so for instance
34 | # if you set here `folder="web"` change prepath for
35 | # `@def prepath = "YourPackage.jl/web"`
36 | - run: julia -e '
37 | using Pkg;
38 | Pkg.add(["NodeJS", "PkgPage", "DataFrames"]);
39 | using NodeJS;
40 | run(`$(npm_cmd()) install highlight.js purgecss`);
41 | import PkgPage;
42 | PkgPage.optimize(input="page", output="")'
43 | - run: julia -e '
44 | pth01=joinpath(homedir(),"work","Notebooks","Notebooks");
45 | cd(pth01);
46 | using Pkg;
47 | Pkg.activate(; temp=true);
48 | Pkg.add.(["NCDatasets","CairoMakie","Random"]);
49 | Pkg.add.(["Pluto", "PlutoUI", "PlutoSliderServer"]);
50 | Pkg.add.(["YAXArrays", "Zarr", "NetCDF", "EarthDataLab"]);
51 | Pkg.add.(["ArchGDAL","Colors","DiskArrays","Dataverse"]);
52 | Pkg.add.(["OceanStateEstimation","IJulia"]);
53 | include("src/warmup1.jl");
54 | include("tutorials/run_notebooks.jl");'
55 | - name: Build and Deploy
56 | uses: JamesIves/github-pages-deploy-action@releases/v3
57 | with:
58 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
59 | BRANCH: gh-pages
60 | FOLDER: page/__site
61 |
--------------------------------------------------------------------------------
/.github/workflows/binder.yaml:
--------------------------------------------------------------------------------
1 | name: Pluto, sysimage, & build for mybinder.org
2 | on:
3 | push:
4 | branches:
5 | - master
6 | - 20230922_mods
7 | pull_request:
8 | jobs:
9 | binder:
10 | runs-on: ubuntu-latest
11 | steps:
12 | - name: Checkout Code
13 | uses: actions/checkout@v2
14 | with:
15 | ref: ${{ github.event.pull_request.head.sha }}
16 |
17 | - name: update jupyter dependencies with repo2docker
18 | uses: jupyterhub/repo2docker-action@master
19 | with:
20 | DOCKER_USERNAME: ${{ secrets.DOCKER_HUB_USERNAME }}
21 | DOCKER_PASSWORD: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
22 | BINDER_CACHE: true
23 | PUBLIC_REGISTRY_CHECK: true
24 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | devel
2 | .ipynb_checkpoints
3 | nctiles_climatology
4 | GRID_CS32
5 | GRID_LLC90
6 | GRID_LL360
7 | tas_day_MIROC5_*.nc
8 | .DS_Store
9 | nctiles-testcases
10 | movies_etc
11 | page/__site
12 |
--------------------------------------------------------------------------------
/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM jupyter/base-notebook:latest
2 |
3 | USER root
4 | RUN wget https://julialang-s3.julialang.org/bin/linux/x64/1.10/julia-1.10.2-linux-x86_64.tar.gz && \
5 | tar -xvzf julia-1.10.2-linux-x86_64.tar.gz && \
6 | mv julia-1.10.2 /opt/ && \
7 | ln -s /opt/julia-1.10.2/bin/julia /usr/local/bin/julia && \
8 | rm julia-1.10.2-linux-x86_64.tar.gz
9 |
10 | ENV mainpath ./
11 | RUN mkdir -p ${mainpath}
12 |
13 | USER ${NB_USER}
14 |
15 | COPY --chown=${NB_USER}:users ./src ${mainpath}/src
16 | COPY --chown=${NB_USER}:users ./src/plutoserver ${mainpath}/plutoserver
17 |
18 | RUN cp ${mainpath}/src/setup.py ${mainpath}/setup.py
19 | RUN cp ${mainpath}/src/runpluto.sh ${mainpath}/runpluto.sh
20 | RUN cp ${mainpath}/src/environment.yml ${mainpath}/environment.yml
21 | RUN cp ${mainpath}/src/Project.toml ${mainpath}/Project.toml
22 |
23 | ENV USER_HOME_DIR /home/${NB_USER}
24 | ENV JULIA_PROJECT ${USER_HOME_DIR}
25 | ENV JULIA_DEPOT_PATH ${USER_HOME_DIR}/.julia
26 |
27 | RUN julia -e "import Pkg; Pkg.Registry.update();"
28 | RUN julia -e "import Pkg; Pkg.instantiate();"
29 |
30 | USER root
31 |
32 | RUN apt-get update && \
33 | apt-get install -y --no-install-recommends build-essential && \
34 | apt-get install -y --no-install-recommends vim && \
35 | apt-get install -y --no-install-recommends git-all && \
36 | apt-get install -y --no-install-recommends unzip && \
37 | apt-get install -y --no-install-recommends gfortran && \
38 | apt-get install -y --no-install-recommends openmpi-bin && \
39 | apt-get install -y --no-install-recommends libopenmpi-dev && \
40 | apt-get install -y --no-install-recommends libnetcdf-dev && \
41 | apt-get install -y --no-install-recommends libnetcdff-dev && \
42 | apt-get clean && rm -rf /var/lib/apt/lists/*
43 |
44 | USER ${NB_USER}
45 |
46 | RUN jupyter lab build && \
47 | jupyter lab clean && \
48 | pip install ${mainpath} --no-cache-dir && \
49 | rm -rf ~/.cache
50 |
51 | RUN julia ${mainpath}/src/warmup1.jl
52 | RUN julia ${mainpath}/src/download_notebooks.jl
53 |
54 | RUN mkdir .dev
55 | RUN mv build plutoserver.egg-info .dev
56 |
57 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2018 Gael Forget
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # JuliaClimate Notebooks
2 |
3 | [](https://JuliaClimate.github.io/Notebooks/)
4 | [](https://mybinder.org/v2/gh/JuliaClimate/Notebooks/HEAD?urlpath=lab)
5 | [](https://zenodo.org/badge/latestdoi/147266407)
6 |
7 | [Pluto notebooks](https://github.com/fonsp/Pluto.jl/wiki) that demonstrate [JuliaClimate](https://github.com/JuliaClimate/) packages working in concert together and within the broader `Julia` package ecosystem.
8 |
9 | The notebook stack is presented in the [JuliaClimate Notebooks](https://JuliaClimate.github.io/Notebooks/) website that provides all notebook links (html and code), guidelines, and explanation.
10 |
11 | The cloud computer configuration, also provided here, let's you use the notebooks interactively. For example, see this [notebooks binder](https://mybinder.org/v2/gh/JuliaClimate/Notebooks/HEAD?urlpath=lab).
12 |
13 | Please rely on the [issue tracker](https://github.com/JuliaClimate/Notebooks/issues) for feedback, bug reports, queries, contribution ideas, etc when appropriate.
14 |
15 | | | History | +1C | +2C | +4C | |
16 | |:-------------------------------------:|:-------------------------------------:|:-------------------------------------:|:-------------------------------------:|:-------------------------------------:|:-------------------------------------:|
17 | |
|
|
|
|
|
18 |
19 | _(please visit for more on the science behind these maps)_
20 |
--------------------------------------------------------------------------------
/binder/Dockerfile:
--------------------------------------------------------------------------------
1 | ### DO NOT EDIT THIS FILE! This Is Automatically Generated And Will Be Overwritten ###
2 | FROM gaelforget/notebooks:2976ee85ef48
--------------------------------------------------------------------------------
/deprecated/DataStructures/05_ZarrCloud.jl:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # ---
3 | # jupyter:
4 | # jupytext:
5 | # formats: ipynb,jl:light
6 | # text_representation:
7 | # extension: .jl
8 | # format_name: light
9 | # format_version: '1.5'
10 | # jupytext_version: 1.11.3
11 | # kernelspec:
12 | # display_name: Julia 1.7.0-beta3
13 | # language: julia
14 | # name: julia-1.7
15 | # ---
16 |
17 | # # Remote Access To Climate Model Output
18 | #
19 | # - Climate model archive ([CMIP6](https://esgf-node.llnl.gov/search/cmip6/)) is accessed using [AWS.jl](https://github.com/JuliaCloud/AWS.jl) and [Zarr.jl](https://github.com/meggart/Zarr.jl) via [ClimateModels.jl](https://github.com/gaelforget/ClimateModels.jl)
20 | # - Choose `institution_id`, `source_id`, `variable_id` (inside `CMIP6.jl`)
21 | # - Compute and plot (1) time mean global map and (2) time evolving global mean (inside `CMIP6.jl`)
22 |
23 | using ClimateModels
24 | p=dirname(pathof(ClimateModels))
25 | include(joinpath(p,"../examples/CMIP6.jl"))
26 |
27 |
28 |
--------------------------------------------------------------------------------
/deprecated/IPCC/run_notebooks.jl:
--------------------------------------------------------------------------------
1 |
2 | using ClimateModels
3 | import PlutoSliderServer
4 |
5 | function fig1to5(x::ModelConfig)
6 | pth0=pwd()
7 | pth01=joinpath(pth0,"page","__site")
8 | pth=joinpath(x.folder,string(x.ID))
9 | cd(pth)
10 |
11 | for ii in x.inputs[:notebookIDs]
12 | fil_in="notebook_0$(ii).jl"
13 | cp(joinpath(pth0,"IPCC",fil_in),fil_in)
14 | PlutoSliderServer.export_notebook(fil_in)
15 |
16 | fil_out="notebook_0$(ii).html"
17 | isdir(pth01) ? cp(fil_out,joinpath(pth01,fil_out)) : nothing
18 | end
19 |
20 | cd(pth0)
21 |
22 | return x
23 | end
24 |
25 | MC=ModelConfig(model="IPCC-AR6-WG1",configuration=fig1to5,inputs=Dict(:notebookIDs => 1:5))
26 |
27 | #setup(MC)
28 | mkdir(joinpath(MC.folder,string(MC.ID)))
29 |
30 | fig1to5(MC)
31 |
--------------------------------------------------------------------------------
/deprecated/OceanTransports/04_transports.jl:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # ---
3 | # jupyter:
4 | # jupytext:
5 | # cell_metadata_json: true
6 | # formats: ipynb,jl:light
7 | # text_representation:
8 | # extension: .jl
9 | # format_name: light
10 | # format_version: '1.5'
11 | # jupytext_version: 1.11.3
12 | # kernelspec:
13 | # display_name: Julia 1.6.2
14 | # language: julia
15 | # name: julia-1.6
16 | # ---
17 |
18 | # + [markdown] {"slideshow": {"slide_type": "slide"}}
19 | # # Ocean Transports -- Integration And Mapping
20 | #
21 | # Transports in the climate system are often represented as gridded vector fields (e.g. on a `C-grid`) and integrated across model grid lines. These paths may for examples connect a pair of coordinates, or track latitude circles. For more detail, please refer to [Forget et al, 2015](https://doi.org/10.5194/gmd-8-3071-2015) and appendices.
22 |
23 | # + [markdown] {"slideshow": {"slide_type": "slide"}}
24 | # ### Read grid & transports from file
25 | #
26 | # 1. pre-requisites
27 | # 2. read transports
28 |
29 | # + {"slideshow": {"slide_type": "subslide"}}
30 | include("helper_functions.jl")
31 |
32 | pth=MeshArrays.GRID_LLC90
33 | γ=GridSpec("LatLonCap",pth)
34 | Γ=GridLoad(γ;option="full")
35 | (Tx,Ty,τx,τy,η)=trsp_read("LatLonCap",pth);
36 | # -
37 |
38 | # Prepare for visualization:
39 |
40 | # +
41 | μ =Γ.hFacC[:,1]
42 | μ[findall(μ.>0.0)].=1.0
43 | μ[findall(μ.==0.0)].=NaN
44 |
45 | lon=[i for i=-179.:2.0:179., j=-89.:2.0:89.]
46 | lat=[j for i=-179.:2.0:179., j=-89.:2.0:89.]
47 |
48 | #(f,i,j,w)=InterpolationFactors(Γ,vec(lon),vec(lat))
49 | #λ=(lon=lon,lat=lat,f=f,i=i,j=j,w=w);
50 | #df = DataFrame(f=λ.f[:], i=λ.i[:], j=λ.j[:], w=Float32.(λ.w[:]));
51 | #CSV.write("interp_coeffs.csv", df)
52 |
53 | df=DataFrame(CSV.File("interp_coeffs.csv"))
54 | λ=(f=reshape(df.f,length(lon[:]),4), i=reshape(df.i,length(lon[:]),4),
55 | j=reshape(df.j,length(lon[:]),4), w=reshape(df.w,length(lon[:]),4));
56 |
57 | # + [markdown] {"slideshow": {"slide_type": "slide"}}
58 | # ### Integrate transport across latitude lines
59 | #
60 | # 1. `LatitudeCircles` computes `grid edge path`s that track latitude circles
61 | # 2. `ThroughFlow` integrates transports accross the specified `grid edge path`s
62 | # 3. Plot integrated meridional transport in `Sverdrup` units (1Sv=10^6 m³/s)
63 |
64 | # + {"slideshow": {"slide_type": "subslide"}}
65 | uv=Dict("U"=>Tx,"V"=>Ty,"dimensions"=>["x","y"])
66 | L=-89.0:89.0; LC=LatitudeCircles(L,Γ)
67 |
68 | T=Array{Float64,1}(undef,length(LC))
69 | [T[i]=1e-6*ThroughFlow(uv,LC[i],Γ) for i=1:length(LC)]
70 |
71 | plot(L,T,xlabel="latitude",ylabel="Northward Transport (in Sv)",label="ECCO estimate")
72 |
73 | # + [markdown] {"slideshow": {"slide_type": "slide"}}
74 | # ## Transport Directions
75 | #
76 | # 1. `u,v` are oriented in standard `Eastward,Northward` directions
77 | # 2. `uC,vC` are oriented along the `x,y` directions of each subdomain
78 |
79 | # + {"slideshow": {"slide_type": "-"}}
80 | u,v,uC,vC=rotate_uv(uv,Γ);
81 |
82 | # + {"slideshow": {"slide_type": "subslide"}, "cell_style": "split"}
83 | heatmap(u,clims=(-20.0,20.0),title="East-ward")
84 | #heatmap(v,clims=(-20.0,20.0),title="North-ward")
85 |
86 | # + {"slideshow": {"slide_type": "fragment"}, "cell_style": "split"}
87 | heatmap(uC,clims=(-20.0,20.0),title="x-ward")
88 | #heatmap(vC,clims=(-20.0,20.0),title="y-ward")
89 |
90 | # + [markdown] {"slideshow": {"slide_type": "slide"}}
91 | # ### Global Maps
92 | #
93 | # 1. interpolate `u,v` to a `1/2 x 1/2` degree grid for plotting
94 | # 2. map out the Eastward,Northward transport components
95 | # -
96 |
97 | uI=reshape(Interpolate(u,λ.f,λ.i,λ.j,λ.w),size(lon))
98 | vI=reshape(Interpolate(v,λ.f,λ.i,λ.j,λ.w),size(lon))
99 | size(lon)
100 |
101 | # + {"slideshow": {"slide_type": "subslide"}, "cell_style": "split"}
102 | heatmap(lon[:,1],lat[1,:],
103 | permutedims(uI),clims=(-20.0,20.0),
104 | title="Eastward transport (in Sv / cell)")
105 | # + {"slideshow": {"slide_type": "fragment"}, "cell_style": "split"}
106 | heatmap(lon[:,1],lat[1,:],
107 | permutedims(vI),clims=(-20.0,20.0),
108 | title="Northward transport (in Sv / cell)")
109 | # -
110 |
111 |
--------------------------------------------------------------------------------
/deprecated/OceanTransports/05_streamfunction.jl:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # ---
3 | # jupyter:
4 | # jupytext:
5 | # cell_metadata_json: true
6 | # formats: ipynb,jl:light
7 | # text_representation:
8 | # extension: .jl
9 | # format_name: light
10 | # format_version: '1.5'
11 | # jupytext_version: 1.11.3
12 | # kernelspec:
13 | # display_name: Julia 1.6.2
14 | # language: julia
15 | # name: julia-1.6
16 | # ---
17 |
18 | # + [markdown] {"slideshow": {"slide_type": "slide"}}
19 | # # Transport Streamfunction And Divergent Component
20 | #
21 | # Here we apply such [Helmholtz Decomposition](https://en.wikipedia.org/wiki/Helmholtz_decomposition) to vertically integrated transports defined over a Global Ocean model (`C-grid`).
22 | #
23 | # 1. read vertically integrated transport from file
24 | # 2. compute its convergence and apply land mask
25 | # 3. decompose into rotational and divergent components
26 | # 4. derive streamfunction from the rotational component
27 |
28 | # + [markdown] {"slideshow": {"slide_type": "slide"}}
29 | # ### Read Transports & Grid From File
30 | #
31 | # 1. pre-requisites
32 | # 2. read variables
33 |
34 | # + {"slideshow": {"slide_type": "subslide"}, "cell_style": "center"}
35 | using MeshArrays, Plots, Statistics
36 | pth=dirname(pathof(MeshArrays))
37 | include(joinpath(pth,"../examples/Plots.jl"))
38 | include("helper_functions.jl")
39 |
40 | pth=MeshArrays.GRID_LLC90
41 | γ=GridSpec("LatLonCap",pth)
42 | Γ=GridLoad(γ;option="full")
43 | (Tx,Ty,τx,τy,η)=trsp_read("LatLonCap",pth);
44 |
45 | # +
46 | μ =Γ.hFacC[:,1]
47 | μ[findall(μ.>0.0)].=1.0
48 | μ[findall(μ.==0.0)].=NaN
49 |
50 | lon=[i for i=-179.:2.0:179., j=-89.:2.0:89.]
51 | lat=[j for i=-179.:2.0:179., j=-89.:2.0:89.]
52 |
53 | #(f,i,j,w)=InterpolationFactors(Γ,vec(lon),vec(lat))
54 | #λ=(lon=lon,lat=lat,f=f,i=i,j=j,w=w);
55 | #df = DataFrame(f=λ.f[:], i=λ.i[:], j=λ.j[:], w=Float32.(λ.w[:]));
56 | #CSV.write("interp_coeffs.csv", df)
57 |
58 | df=DataFrame(CSV.File("interp_coeffs.csv"))
59 | λ=(f=reshape(df.f,length(lon[:]),4), i=reshape(df.i,length(lon[:]),4),
60 | j=reshape(df.j,length(lon[:]),4), w=reshape(df.w,length(lon[:]),4));
61 |
62 | # + [markdown] {"slideshow": {"slide_type": "slide"}}
63 | # ### Helmholtz Decomposition
64 | #
65 | # 1. convergence & land mask
66 | # 2. compute scalar potential
67 | # 3. subtract divergent component
68 | # 4. compute vector potential / streamfunction
69 | #
70 | # _note: masking avoids singularities related to isolated canyons_
71 |
72 | # + {"slideshow": {"slide_type": "subslide"}}
73 | #convergence & land mask
74 | TrspCon=μ.*convergence(Tx,Ty)
75 |
76 | #scalar potential
77 | TrspPot=ScalarPotential(TrspCon)
78 |
79 | #Divergent transport component
80 | (TxD,TyD)=gradient(TrspPot,Γ)
81 | TxD=TxD.*Γ.DXC
82 | TyD=TyD.*Γ.DYC
83 |
84 | #Rotational transport component
85 | TxR = Tx-TxD
86 | TyR = Ty-TyD
87 |
88 | #vector Potential
89 | TrspPsi=VectorPotential(TxR,TyR,Γ);
90 |
91 | # + [markdown] {"slideshow": {"slide_type": "skip"}}
92 | # ### Verify The Results Consistency
93 | #
94 | # _Next plot below normally shows that TrspCon-tmpCon is negligible compared with TrspCon_
95 |
96 | # + {"slideshow": {"slide_type": "skip"}, "cell_style": "center"}
97 | tmpCon=convergence(TxD,TyD)
98 | tmp1=TrspCon[3]
99 | tmp2=tmp1[findall(isfinite.(tmp1))]
100 | errCon=1/sqrt(mean(tmp2.^2)).*(tmpCon[3]-TrspCon[3])
101 | errCon[findall(isnan.(errCon))].=0.0
102 | extrema(errCon)
103 |
104 | # + [markdown] {"slideshow": {"slide_type": "slide"}}
105 | # ### Map Out Streamfunction And Scalar Potential
106 | #
107 | # _In plots below we interpolate MeshArrays to a regular global grid_
108 |
109 | # + {"slideshow": {"slide_type": "subslide"}, "cell_style": "center"}
110 | TrspPsiI=Interpolate(1e-6*μ*TrspPsi,λ.f,λ.i,λ.j,λ.w)
111 | contourf(vec(lon[:,1]),vec(lat[1,:]),
112 | TrspPsiI,title="Streamfunction",clims=(-50,50))
113 |
114 | # + {"slideshow": {"slide_type": "subslide"}, "cell_style": "center"}
115 | TrspPotI=Interpolate(1e-6*μ*TrspPot,λ.f,λ.i,λ.j,λ.w)
116 | contourf(vec(lon[:,1]),vec(lat[1,:]),
117 | TrspPotI,title="Scalar Potential",clims=(-0.4,0.4))
118 | # -
119 |
120 |
121 |
--------------------------------------------------------------------------------
/deprecated/OceanTransports/06_overturning.jl:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # ---
3 | # jupyter:
4 | # jupytext:
5 | # cell_metadata_json: true
6 | # formats: ipynb,jl:light
7 | # text_representation:
8 | # extension: .jl
9 | # format_name: light
10 | # format_version: '1.5'
11 | # jupytext_version: 1.11.3
12 | # kernelspec:
13 | # display_name: Julia 1.6.2
14 | # language: julia
15 | # name: julia-1.6
16 | # ---
17 |
18 | # + [markdown] {"slideshow": {"slide_type": "slide"}}
19 | # # Meridional Overturning Circulation
20 | #
21 | # Global Ocean transport depictions often involve concepts like the [AMOC](https://en.wikipedia.org/wiki/Atlantic_meridional_overturning_circulation), [Thermohaline Circulation](https://en.wikipedia.org/wiki/Thermohaline_circulation), or [conveyor Belt](http://oceanmotion.org/html/background/ocean-conveyor-belt.html). To apply these concepts to gridded ocean and climate models, one can compute an _overturning streamfunction_ as shown below. For more detail, please refer to [Forget et al, 2015](https://doi.org/10.5194/gmd-8-3071-2015) and the other [GlobalOceanNotebooks](https://github.com/JuliaClimate/GlobalOceanNotebooks).
22 |
23 | # + [markdown] {"slideshow": {"slide_type": "slide"}}
24 | # ### Read grid & velocities from file
25 | #
26 | # 1. pre-requisites
27 | # 2. read variables
28 | # 3. conversion to transports
29 |
30 | # +
31 | include("helper_functions.jl")
32 |
33 | pth=MeshArrays.GRID_LLC90
34 | γ=GridSpec("LatLonCap",pth)
35 | Γ=GridLoad(γ;option="full")
36 | LC=LatitudeCircles(-89.0:89.0,Γ);
37 |
38 | # +
39 | using OceanStateEstimation
40 | OceanStateEstimation.get_ecco_velocity_if_needed();
41 | #OceanStateEstimation.get_occa_velocity_if_needed();
42 |
43 | """
44 | read_velocities(γ::gcmgrid,t::Int,pth::String)
45 |
46 | Read velocity components `u,v` from files in `pth`for time `t`
47 | """
48 | function read_velocities(γ::gcmgrid,t::Int,pth::String)
49 | u=read_nctiles("$pth"*"UVELMASS/UVELMASS","UVELMASS",γ,I=(:,:,:,t))
50 | v=read_nctiles("$pth"*"VVELMASS/VVELMASS","VVELMASS",γ,I=(:,:,:,t))
51 | return u,v
52 | end
53 |
54 | # + [markdown] {"slideshow": {"slide_type": "slide"}}
55 | # ### Compute Overturning Streamfunction
56 | #
57 | # 1. integrate along latitude circles
58 | # 2. integrate from the bottom
59 |
60 | # + {"slideshow": {"slide_type": "-"}}
61 | nz=size(Γ.hFacC,2); nt=12; nl=length(LC)
62 | ov=Array{Float64,3}(undef,nl,nz,nt)
63 |
64 | #integrate across latitude circles
65 | for t=1:nt
66 | (U,V)=read_velocities(Γ.XC.grid,t,ECCOclim_path)
67 | (U,V)=convert_velocities(U,V,Γ)
68 | for z=1:nz
69 | UV=Dict("U"=>U[:,z],"V"=>V[:,z],"dimensions"=>["x","y"])
70 | [ov[l,z,t]=ThroughFlow(UV,LC[l],Γ) for l=1:nl]
71 | end
72 | end
73 |
74 | #integrate from bottom
75 | ov=reverse(cumsum(reverse(ov,dims=2),dims=2),dims=2);
76 |
77 | # + [markdown] {"slideshow": {"slide_type": "slide"}}
78 | # ### Plot Annual Mean And Variability
79 | # -
80 |
81 | x=vec(-89.0:89.0); y=reverse(vec(Γ.RF[1:end-1])); #coordinate variables
82 |
83 | # + {"slideshow": {"slide_type": "fragment"}, "cell_style": "split"}
84 | tmp=dropdims(mean(ov,dims=3),dims=3)
85 | z=reverse(tmp,dims=2); z[z.==0.0].=NaN
86 |
87 | contourf(x,y,1e-6*transpose(z),clims=(-40,40),
88 | title="Overturning mean (Eulerian; in Sv)",titlefontsize=10)
89 | #savefig("MOC_mean.png")
90 | # + {"slideshow": {"slide_type": "fragment"}, "cell_style": "split"}
91 | tmp=dropdims(std(ov,dims=3),dims=3)
92 | z=reverse(tmp,dims=2); z[z.==0.0].=NaN
93 |
94 | contourf(x,y,1e-6*transpose(z),clims=(-40,40),
95 | title="Overturning standard deviation (Eulerian; in Sv)",titlefontsize=10)
96 | #savefig("MOC_std.png")
97 | # -
98 |
99 |
100 |
--------------------------------------------------------------------------------
/deprecated/sysimage/create_sysimage.jl:
--------------------------------------------------------------------------------
1 | using PackageCompiler
2 | create_sysimage([:IJulia, :Pluto, :PlutoUI, :PyCall, :Conda,
3 | :MeshArrays, :ClimateModels, :MITgcmTools,
4 | :Dataverse, :OceanRobots, :OceanStateEstimation,
5 | :CairoMakie];
6 | precompile_execution_file = "sysimage/warmup.jl",
7 | sysimage_path="ExampleSysimage.so",
8 | cpu_target = PackageCompiler.default_app_cpu_target())
9 |
--------------------------------------------------------------------------------
/deprecated/sysimage/download_stuff.jl:
--------------------------------------------------------------------------------
1 | import MeshArrays
2 | MeshArrays.GRID_LLC90_download()
3 |
4 | import OceanStateEstimation
5 | OceanStateEstimation.ECCOdiags_add("release2")
6 | OceanStateEstimation.ECCOdiags_add("release4")
7 |
8 | import Downloads
9 | Downloads.download(
10 | "https://zenodo.org/record/5784905/files/interp_coeffs_halfdeg.jld2",
11 | joinpath(OceanStateEstimation.ScratchSpaces.ECCO,"interp_coeffs_halfdeg.jld2");
12 | timeout=60000.0)
13 |
14 | using ClimateModels
15 | path0="notebooks"
16 | nbs=notebooks.list()
17 | notebooks.download(path0,nbs)
18 |
19 | using DataFrames
20 | url0="https://raw.githubusercontent.com/JuliaClimate/IndividualDisplacements.jl/master/examples/worldwide/"
21 | nbs2=DataFrame( "folder" => ["IndividualDisplacements.jl","IndividualDisplacements.jl"],
22 | "file" => ["ECCO_FlowFields.jl","OCCA_FlowFields.jl"],
23 | "url" => [url0*"ECCO_FlowFields.jl",url0*"OCCA_FlowFields.jl"])
24 | notebooks.download(path0,nbs2)
25 |
26 |
--------------------------------------------------------------------------------
/deprecated/sysimage/postBuild:
--------------------------------------------------------------------------------
1 | jupyter contrib nbextension install --user
2 | jupyter nbextension enable splitcell/splitcell
3 | julia --project --sysimage ExampleSysimage.so -e 'using OceanStateEstimation; OceanStateEstimation.get_ecco_velocity_if_needed();'
4 | julia --project --sysimage ExampleSysimage.so -e 'using OceanStateEstimation; OceanStateEstimation.get_occa_velocity_if_needed();'
5 |
--------------------------------------------------------------------------------
/deprecated/sysimage/pre_build_models.jl:
--------------------------------------------------------------------------------
1 |
2 | ## pyDataverse
3 |
4 | using PyCall, Conda, Pkg
5 |
6 | ENV["PYTHON"]=""
7 | Pkg.build("PyCall")
8 |
9 | Conda.pip_interop(true)
10 | Conda.pip("install", "pyDataverse")
11 | Conda.pip("install", "fair")
12 |
13 | ##
14 |
15 | using ClimateModels
16 | pth=dirname(pathof(ClimateModels))
17 |
18 | ## Hector
19 |
20 | Pkg.add("IniFile")
21 | Pkg.add("Suppressor")
22 | fil=joinpath(pth,"..","examples","Hector_module.jl")
23 | include(fil)
24 | H=demo.Hector_config()
25 | run(H)
26 |
27 | f1=joinpath(pathof(H),"hector","src","hector")
28 | f2=joinpath(homedir(),"hector")
29 | mv(f1,f2)
30 |
31 | ## Speedy
32 |
33 | fil=joinpath(pth,"..","examples","Speedy_module.jl")
34 | include(fil)
35 | H=demo.SPEEDY_config()
36 | run(H)
37 |
38 | f1=joinpath(pathof(H),"bin","speedy")
39 | f2=joinpath(homedir(),"speedy")
40 | mv(f1,f2)
41 |
42 | ## MITgcm
43 |
44 | using MITgcmTools
45 | MITgcm_download()
46 | MC=MITgcm_config(configuration="tutorial_global_oce_biogeo")
47 | run(MC)
48 |
49 |
--------------------------------------------------------------------------------
/deprecated/sysimage/warmup.jl:
--------------------------------------------------------------------------------
1 | using Pkg;
2 | Pkg.test("ClimateModels")
3 | Pkg.test("MITgcmTools")
4 | Pkg.test("MeshArrays")
5 |
6 | using Pluto, PlutoUI, PlutoSliderServer, CairoMakie
7 |
8 | using ClimateModels
9 | tmp=ModelConfig(model=ClimateModels.RandomWalker)
10 | setup(tmp)
11 | launch(tmp)
12 |
13 | using Downloads
14 | url="https://raw.githubusercontent.com/JuliaClimate/MeshArrays.jl/master/examples/basics.jl"
15 | include(Downloads.download(url))
16 |
17 |
--------------------------------------------------------------------------------
/page/Project.toml:
--------------------------------------------------------------------------------
1 | [deps]
2 | DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
3 | Franklin = "713c75ef-9fc9-4b05-94a9-213340da978e"
4 |
--------------------------------------------------------------------------------
/page/_assets/diagonal-lines.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/page/_assets/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JuliaClimate/Notebooks/0cfae05c3bf172d03d032c98dc632bcb87f3d558/page/_assets/favicon.ico
--------------------------------------------------------------------------------
/page/_assets/logo.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/page/_assets/nice_image.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JuliaClimate/Notebooks/0cfae05c3bf172d03d032c98dc632bcb87f3d558/page/_assets/nice_image.jpg
--------------------------------------------------------------------------------
/page/_css/custom.css:
--------------------------------------------------------------------------------
1 | html { scroll-behavior: smooth; }
2 | header { margin: 0; padding: 0;}
3 | section { padding: 75px 0; }
4 | .jumbotron { margin-bottom: 0;}
5 |
6 | /* NAVBAR */
7 |
8 | #navbar-toggler-cbox:checked ~ .collapse { display:block; }
9 | .navbar-nav .active { color: #fff; }
10 |
11 | .navbar-brand a { color: ghostwhite; }
12 | .navbar-brand a:hover {
13 | color: rgba(255,255,255,.5);
14 | text-decoration: none;
15 | }
16 |
17 | a.nav-link.active { color: #fff !important; }
18 |
19 | /* FORMATTING */
20 |
21 | section h2 { margin-bottom: 1em;}
22 |
23 | .lead {
24 | font-size: 20px;
25 | font-weight: 300;
26 | line-height: 30px;
27 | margin-bottom: 1em;
28 | margin-top: 0;
29 | }
30 |
31 | .franklin-content ul li p { margin: 0; }
32 |
33 | .katex { font-size: 1em !important;}
34 |
35 | a.anchor {
36 | display: block;
37 | position: relative;
38 | top: -150px;
39 | visibility: hidden;
40 | }
41 |
42 | /* CODE */
43 |
44 | pre { margin-bottom: 0.5em; }
45 | pre code.hljs {
46 | padding-left: 20px;
47 | padding-top: 10px;
48 | padding-bottom: 10px;
49 | }
50 | pre code.hljs.plaintext {
51 | margin-bottom: 1em;
52 | }
53 |
54 | /* ADD ANY SPECIFIC TWEAKS YOU MIGHT WANT HERE */
55 |
56 | .im-50 {text-align: center;}
57 | .im-50 img {
58 | padding: 0;
59 | width: 50%;
60 | }
61 |
62 | .im-20 img {
63 | padding: 0;
64 | width: 20%;
65 | }
66 |
67 |
68 |
--------------------------------------------------------------------------------
/page/_layout/foot.html:
--------------------------------------------------------------------------------
1 |
2 | {{ if hasmath }}
3 | {{ insert foot_katex.html }}
4 | {{ end }}
5 | {{ if hascode }}
6 | {{ insert foot_highlight.html }}
7 | {{ end }}
8 |
9 |
18 |