Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • m300602/pyicon
  • m300524/pyicon
  • m300883/pyicon
  • m301014/pyicon
  • b382615/pyicon
5 results
Show changes
Commits on Source (85)
Showing
with 1069 additions and 252 deletions
......@@ -37,3 +37,10 @@ all_qp_compare
pyicon/params_user.json
pyicon.egg-info
build/
dist/
py_icon.egg-info/
pyicon_diagnostics.egg-info/
.vscode
......@@ -14,7 +14,14 @@ Pyicon is hosted at: (https://gitlab.dkrz.de/m300602/pyicon/)
## Quick start for pyicon
Download pyicon with git:
You can install pyicon via pip:
```bash
pip install pyicon-diagnostics
```
However, if you want to use the most recent development version, it is advisable to
download pyicon with git:
```bash
git clone git@gitlab.dkrz.de:m300602/pyicon.git
......@@ -27,10 +34,11 @@ cd pyicon
pip install -e ./
```
To assure that all necessary requirements are met, install them e.g. by
If you notice that some requirements were not met by the installation, you can
also use conda to install the requirements:
```bash
conda env create -f ci/requirements_py39.yml
conda env create -f ci/requirements_latest.yml
```
or on DKRZ's super computer Levante use
......@@ -40,6 +48,12 @@ module load python3/2023.01-gcc-11.2.0
pip install healpy
```
To update pyicon, you only need to enter the pyicon directory update the git repository via
```bash
git pull
```
## Quick start for pyicon @DWD (Confluence, only intern)
https://ninjoservices.dwd.de/wiki/display/KUQ/pyICON+for+ICON+with+NWP+physics
......@@ -58,4 +72,4 @@ pip install git+https://gitlab.dkrz.de/m300602/pyicon.git
```
## Developing
When adding new functions, make sure to document them with a docstring. This should detail what the function does, the arguments and what type of objects it returns. Examples are encouraged. We use so-called "numpy" style docstrings which are then automatically rendered into the sphinx documentation. A guide to numpy style docstrings is available [here](https://numpydoc.readthedocs.io/en/latest/format.html) and they even produce some nice [examples](https://numpydoc.readthedocs.io/en/latest/example.html#example).
\ No newline at end of file
When adding new functions, make sure to document them with a docstring. This should detail what the function does, the arguments and what type of objects it returns. Examples are encouraged. We use so-called "numpy" style docstrings which are then automatically rendered into the sphinx documentation. A guide to numpy style docstrings is available [here](https://numpydoc.readthedocs.io/en/latest/format.html) and they even produce some nice [examples](https://numpydoc.readthedocs.io/en/latest/example.html#example).
requirements_py311.yml
\ No newline at end of file
......@@ -3,24 +3,48 @@ channels:
- conda-forge
dependencies:
- python=3.11
- pip
- numpy
- dask
- scipy
- netcdf4
- matplotlib
- cartopy
- netcdf4
- xarray
- zarr
- pandas
- cmocean
- scipy
- ipdb
- ipywidgets
- conda-build
- ipympl # interactive plots in jupyterlab
- nodejs # interactive plots in jupyterlab
- ipython
- jupyter
- jupyterlab # optional
- jupyter-resource-usage # for showing memory resources in upper right corner of notebook
#- jupyter_contrib_nbextensions
- cmocean # optional
- sphinx # optional for documentation
- nbsphinx # for sphinx
- nbsphinx-link
- docutils=0.20
- mpi4py
- seawater # optional
- pandas
- xarray
- cftime
- zarr
- dask
- dask-jobqueue
- dask-labextension
- dask-mpi
- flox
- python-graphviz
- f90nml
- dash
- papermill
- intake-esm
- jupytext
- pytest
- healpy
- pandoc
- sphinx # Documentation
- nbsphinx # Documentation
- nbsphinx-link # Documentation
- sphinx-copybutton # Documentation
- pydata-sphinx-theme # Documentation
- pytest
- pip:
- sphinx_sitemap
- sphinx_design
- sphinx_copybutton
- pydata_sphinx_theme
- myst_parser
......@@ -23,6 +23,7 @@ dependencies:
- seawater # optional
- pandas
- xarray
- cftime
- zarr
- dask
- dask-jobqueue
......
......@@ -23,11 +23,13 @@ dependencies:
- seawater # optional
- pandas
- xarray
- cftime
- zarr
- dask
- dask-jobqueue
- dask-labextension
- dask-mpi
- flox
- python-graphviz
- f90nml
- dash
......
import numpy as np
from netCDF4 import Dataset
import sys, os
from importlib import reload
import pyicon as pyic
reload(pyic)
#path_tgrid = '/pool/data/ICON/oes/input/r0002/'
#path_tgrid = '/pool/data/ICON/grids/public/mpim/0015/'
#icon_grid_0015_R02B09_G.nc
path_ckdtree = '/work/mh0033/m300602/icon/grids/r2b4_atm_r0012/'
path_rgrid = path_ckdtree + 'rectgrids/'
path_sections = path_ckdtree + 'sections/'
all_grids = [
'global_1.0',
'global_1.0_era',
'global_0.3',
# 'global_0.1',
]
all_secs = [
# '30W_100pts',
# '30W_200pts',
# '170W_100pts',
]
#all_grids = []
#all_secs = []
gnames = []
path_tgrids = []
# r2b9
#gnames += ['icon_grid_0015_R02B09_G']
#path_tgrids += ['/pool/data/ICON/grids/public/mpim/0015/']
# r2b4
gnames += ['icon_grid_0012_R02B04_G']
path_tgrids += ['/work/mh0287/m211032/Icon/Coupled/Setup.proto2/']
if not os.path.exists(path_rgrid):
os.makedirs(path_rgrid)
if not os.path.exists(path_sections):
os.makedirs(path_sections)
for gname, path_tgrid in zip(gnames, path_tgrids):
print(path_tgrid, gname)
# --- grids
sname = 'global_1.0_era'
if sname in all_grids:
pyic.ckdtree_hgrid(lon_reg=[-179.,181.], lat_reg=[-89.5,90.], res=1.0,
fname_tgrid = gname+'.nc',
path_tgrid = path_tgrid,
path_ckdtree = path_rgrid,
sname = sname,
gname = gname,
)
sname = 'global_1.0'
if sname in all_grids:
pyic.ckdtree_hgrid(lon_reg=[-180.,180.], lat_reg=[-90.,90.], res=1.0,
fname_tgrid = gname+'.nc',
path_tgrid = path_tgrid,
path_ckdtree = path_rgrid,
sname = sname,
gname = gname,
)
sname = 'global_0.3'
if sname in all_grids:
pyic.ckdtree_hgrid(lon_reg=[-180.,180.], lat_reg=[-90.,90.], res=0.3,
fname_tgrid = gname+'.nc',
path_tgrid = path_tgrid,
path_ckdtree = path_rgrid,
sname = sname,
gname = gname,
)
sname = 'global_0.1'
if sname in all_grids:
pyic.ckdtree_hgrid(lon_reg=[-180.,180.], lat_reg=[-90.,90.], res=0.1,
fname_tgrid = gname+'.nc',
path_tgrid = path_tgrid,
path_ckdtree = path_rgrid,
sname = sname,
gname = gname,
)
# --- sections
sname = '30W_100pts'
if sname in all_secs:
dckdtree, ickdtree, lon_sec, lat_sec, dist_sec = pyic.ckdtree_section(p1=[-30,-80], p2=[-30,80], npoints=100,
fname_tgrid = gname+'/'+gname+'.nc',
path_tgrid = path_tgrid,
path_ckdtree = path_sections,
sname = sname,
gname = gname,
)
sname = '30W_200pts'
if sname in all_secs:
dckdtree, ickdtree, lon_sec, lat_sec, dist_sec = pyic.ckdtree_section(p1=[-30,-80], p2=[-30,80], npoints=200,
fname_tgrid = gname+'/'+gname+'.nc',
path_tgrid = path_tgrid,
path_ckdtree = path_sections,
sname = sname,
gname = gname,
)
sname = '170W_100pts'
if sname in all_secs:
dckdtree, ickdtree, lon_sec, lat_sec, dist_sec = pyic.ckdtree_section(p1=[-170,-80], p2=[-170,80], npoints=100,
fname_tgrid = gname+'/'+gname+'.nc',
path_tgrid = path_tgrid,
path_ckdtree = path_sections,
sname = sname,
gname = gname,
)
print('make_ckdtree.py: All done!')
import numpy as np
from netCDF4 import Dataset
import sys, os
import matplotlib
if len(sys.argv)>=2:
matplotlib.use('Agg')
import pyicon as pyic
print('Hey there!')
#print(sys.argv)
#grid_target = sys.argv[2]
ts = pyic.timing([0], 'start')
tgname = f'epoc_oce'
gname = f'OceanOnly_FlemishCapZoom_5km_GEBCO_2023'
path_tgrid = f'/pool/data/ICON/oes/grids/OceanOnly/'
fname_tgrid = f'{gname}.nc'
path_ckdtree = f'/work/mh0033/m300602/icon/grids/{tgname}/ckdtree/'
path_rgrid = path_ckdtree + 'rectgrids/'
path_sections = path_ckdtree + 'sections/'
all_grids = [
'global_1.0',
'global_0.3',
'global_0.1',
#'global_0.02',
]
#all_grids = [grid_target]
#all_grids = []
all_secs = [
'30W_200pts',
'170W_200pts',
'30W_300pts',
'170W_300pts',
]
load_cgrid=True,
load_egrid=True,
load_vgrid=True,
gnames = [gname]
if not os.path.exists(path_rgrid):
os.makedirs(path_rgrid)
if not os.path.exists(path_sections):
os.makedirs(path_sections)
fpath = f'{path_ckdtree}/../{tgname}_tgrid.nc'
if not os.path.exists(fpath):
os.symlink(path_tgrid+fname_tgrid, fpath)
for gname in gnames:
ts = pyic.timing(ts, gname)
print(gname)
# --- grids
sname = 'global_1.0'
if sname in all_grids:
pyic.ckdtree_hgrid(lon_reg=[-180.,180.], lat_reg=[-90.,90.], res=1.0,
fname_tgrid = fname_tgrid,
path_tgrid = path_tgrid,
path_ckdtree = path_rgrid,
sname = sname,
gname = gname,
tgname = tgname,
load_cgrid=load_cgrid,
load_egrid=load_egrid,
load_vgrid=load_vgrid,
save_as='both',
)
sname = 'global_0.3'
if sname in all_grids:
pyic.ckdtree_hgrid(lon_reg=[-180.,180.], lat_reg=[-90.,90.], res=0.3,
fname_tgrid = fname_tgrid,
path_tgrid = path_tgrid,
path_ckdtree = path_rgrid,
sname = sname,
gname = gname,
tgname = tgname,
load_cgrid=load_cgrid,
load_egrid=load_egrid,
load_vgrid=load_vgrid,
save_as='both',
)
sname = 'global_0.1'
if sname in all_grids:
pyic.ckdtree_hgrid(lon_reg=[-180.,180.], lat_reg=[-90.,90.], res=0.1,
fname_tgrid = fname_tgrid,
path_tgrid = path_tgrid,
path_ckdtree = path_rgrid,
sname = sname,
gname = gname,
tgname = tgname,
load_cgrid=load_cgrid,
load_egrid=load_egrid,
load_vgrid=load_vgrid,
save_as='both',
)
sname = 'global_0.02'
if sname in all_grids:
pyic.ckdtree_hgrid(lon_reg=[-180.,180.], lat_reg=[-90.,90.], res=0.02,
fname_tgrid = fname_tgrid,
path_tgrid = path_tgrid,
path_ckdtree = path_rgrid,
sname = sname,
gname = gname,
tgname = tgname,
n_jobs = 10,
load_cgrid=load_cgrid,
load_egrid=load_egrid,
load_vgrid=load_vgrid,
save_as='both',
)
# --- sections
sname = '30W_200pts'
if sname in all_secs:
dckdtree, ickdtree, lon_sec, lat_sec, dist_sec = pyic.ckdtree_section(p1=[-30,-80], p2=[-30,80], npoints=200,
fname_tgrid = fname_tgrid,
path_tgrid = path_tgrid,
path_ckdtree = path_sections,
sname = sname,
gname = gname,
tgname = tgname,
save_as='both',
)
sname = '170W_200pts'
if sname in all_secs:
dckdtree, ickdtree, lon_sec, lat_sec, dist_sec = pyic.ckdtree_section(p1=[-170,-80], p2=[-170,80], npoints=200,
fname_tgrid = fname_tgrid,
path_tgrid = path_tgrid,
path_ckdtree = path_sections,
sname = sname,
gname = gname,
tgname = tgname,
save_as='both',
)
sname = '30W_300pts'
if sname in all_secs:
dckdtree, ickdtree, lon_sec, lat_sec, dist_sec = pyic.ckdtree_section(p1=[-30,-80], p2=[-30,80], npoints=300,
fname_tgrid = fname_tgrid,
path_tgrid = path_tgrid,
path_ckdtree = path_sections,
sname = sname,
gname = gname,
tgname = tgname,
save_as='both',
)
sname = '170W_300pts'
if sname in all_secs:
dckdtree, ickdtree, lon_sec, lat_sec, dist_sec = pyic.ckdtree_section(p1=[-170,-80], p2=[-170,80], npoints=300,
fname_tgrid = fname_tgrid,
path_tgrid = path_tgrid,
path_ckdtree = path_sections,
sname = sname,
gname = gname,
tgname = tgname,
save_as='both',
)
print('make_ckdtree.py: All done!')
ts = pyic.timing(ts, 'All done!')
......@@ -8,11 +8,12 @@ reload(pyic)
ts = pyic.timing([0], 'start')
tgname = f'icon_244_0158km60'
gname = 'icon_244_0158km60'
path_tgrid = f'/work/gg0877/g260161/grids/'
rev = f''
tgname = f'icon_coast_0158km60'
gname = f'icon_244_0158km60'
path_tgrid = f'/work/gg1302/g260161/grids/'
fname_tgrid = f'{gname}.nc'
path_ckdtree = f'/mnt/lustre01/work/mh0033/m300602/icon/grids/{tgname}/ckdtree/'
path_ckdtree = f'/work/mh0033/m300602/icon/grids/{tgname}/ckdtree/'
path_rgrid = path_ckdtree + 'rectgrids/'
path_sections = path_ckdtree + 'sections/'
......@@ -20,6 +21,7 @@ all_grids = [
'global_1.0',
'global_0.3',
'global_0.1',
'global_0.02',
]
all_secs = [
......
import numpy as np
from netCDF4 import Dataset
import sys, os
from importlib import reload
import matplotlib
if len(sys.argv)>=2:
matplotlib.use('Agg')
import pyicon as pyic
reload(pyic)
ts = pyic.timing([0], 'start')
......@@ -12,18 +11,19 @@ tgname = 'smt'
gname = 'OceanOnly_SubmesoNA_2500m_srtm30'
path_tgrid = f'/pool/data/ICON/oes/grids/OceanOnly/'
fname_tgrid = f'{gname}.nc'
path_ckdtree = f'/mnt/lustre01/work/mh0033/m300602/icon/grids/{tgname}/ckdtree/'
path_ckdtree = f'/work/mh0033/m300602/icon/grids/{tgname}/ckdtree/'
path_rgrid = path_ckdtree + 'rectgrids/'
path_sections = path_ckdtree + 'sections/'
all_grids = [
# 'global_1.0',
'global_0.3',
# 'global_0.3',
#'global_0.3_nn5',
#'global_0.3_nn20',
#'global_0.3_nn500',
# 'global_0.1',
# 'global_0.02',
'global_0.01',
]
all_secs = [
......@@ -35,16 +35,23 @@ all_secs = [
#all_grids = []
all_secs = []
load_cgrid=True
load_egrid=True
load_vgrid=True
gnames = [gname]
if not os.path.exists(path_rgrid):
os.makedirs(path_rgrid)
if not os.path.exists(path_sections):
os.makedirs(path_sections)
fpath = f'{path_ckdtree}/../{tgname}_tgrid.nc'
if not os.path.exists(fpath):
os.symlink(path_tgrid+fname_tgrid, fpath)
for gname in gnames:
ts = pyic.timing(ts, gname)
#print(gname)
print(gname)
# --- grids
sname = 'global_1.0'
......@@ -56,8 +63,10 @@ for gname in gnames:
sname = sname,
gname = gname,
tgname = tgname,
load_egrid=False,
load_vgrid=False,
load_cgrid=load_cgrid,
load_egrid=load_egrid,
load_vgrid=load_vgrid,
save_as='both',
)
sname = 'global_0.3_nn500'
......@@ -111,8 +120,10 @@ for gname in gnames:
sname = sname,
gname = gname,
tgname = tgname,
load_egrid=False,
load_vgrid=False,
load_cgrid=load_cgrid,
load_egrid=load_egrid,
load_vgrid=load_vgrid,
save_as='both',
)
sname = 'global_0.1'
......@@ -124,8 +135,10 @@ for gname in gnames:
sname = sname,
gname = gname,
tgname = tgname,
load_egrid=False,
load_vgrid=False,
load_cgrid=load_cgrid,
load_egrid=load_egrid,
load_vgrid=load_vgrid,
save_as='both',
)
sname = 'global_0.02'
......@@ -137,8 +150,25 @@ for gname in gnames:
sname = sname,
gname = gname,
tgname = tgname,
load_egrid=False,
load_vgrid=False,
load_cgrid=load_cgrid,
load_egrid=load_egrid,
load_vgrid=load_vgrid,
save_as='both',
)
sname = 'global_0.01'
if sname in all_grids:
pyic.ckdtree_hgrid(lon_reg=[-180.,180.], lat_reg=[-90.,90.], res=0.01,
fname_tgrid = fname_tgrid,
path_tgrid = path_tgrid,
path_ckdtree = path_rgrid,
sname = sname,
gname = gname,
tgname = tgname,
load_cgrid=load_cgrid,
load_egrid=load_egrid,
load_vgrid=load_vgrid,
save_as='both',
)
......
import numpy as np
from netCDF4 import Dataset
import sys, os
import matplotlib
if len(sys.argv)>=2:
matplotlib.use('Agg')
import pyicon as pyic
print('Hey there!')
#print(sys.argv)
#grid_target = sys.argv[2]
ts = pyic.timing([0], 'start')
rev = f'new'
tgname = f'r2b10_oce_{rev}'
gname = f'OceanOnly_Global_IcosSymmetric_2466m_rotatedZ37d_GEBCO_2023'
path_tgrid = f'/pool/data/ICON/oes/grids/OceanOnly/'
fname_tgrid = f'{gname}.nc'
path_ckdtree = f'/work/mh0033/m300602/icon/grids/{tgname}/ckdtree/'
path_rgrid = path_ckdtree + 'rectgrids/'
path_sections = path_ckdtree + 'sections/'
all_grids = [
'global_1.0',
'global_0.3',
'global_0.1',
'global_0.02',
]
#all_grids = [grid_target]
#all_grids = []
all_secs = [
'30W_200pts',
'170W_200pts',
'30W_300pts',
'170W_300pts',
]
load_cgrid=True,
load_egrid=True,
load_vgrid=True,
gnames = [gname]
if not os.path.exists(path_rgrid):
os.makedirs(path_rgrid)
if not os.path.exists(path_sections):
os.makedirs(path_sections)
fpath = f'{path_ckdtree}/../{tgname}_tgrid.nc'
if not os.path.exists(fpath):
os.symlink(path_tgrid+fname_tgrid, fpath)
gnames = [gname]
print(gnames)
for gname in gnames:
ts = pyic.timing(ts, gname)
print(gname)
# --- grids
sname = 'global_1.0'
if sname in all_grids:
pyic.ckdtree_hgrid(lon_reg=[-180.,180.], lat_reg=[-90.,90.], res=1.0,
fname_tgrid = fname_tgrid,
path_tgrid = path_tgrid,
path_ckdtree = path_rgrid,
sname = sname,
gname = gname,
tgname = tgname,
load_cgrid=load_cgrid,
load_egrid=load_egrid,
load_vgrid=load_vgrid,
save_as='both',
)
sname = 'global_0.3'
if sname in all_grids:
pyic.ckdtree_hgrid(lon_reg=[-180.,180.], lat_reg=[-90.,90.], res=0.3,
fname_tgrid = fname_tgrid,
path_tgrid = path_tgrid,
path_ckdtree = path_rgrid,
sname = sname,
gname = gname,
tgname = tgname,
load_cgrid=load_cgrid,
load_egrid=load_egrid,
load_vgrid=load_vgrid,
save_as='both',
)
sname = 'global_0.1'
if sname in all_grids:
pyic.ckdtree_hgrid(lon_reg=[-180.,180.], lat_reg=[-90.,90.], res=0.1,
fname_tgrid = fname_tgrid,
path_tgrid = path_tgrid,
path_ckdtree = path_rgrid,
sname = sname,
gname = gname,
tgname = tgname,
load_cgrid=load_cgrid,
load_egrid=load_egrid,
load_vgrid=load_vgrid,
save_as='both',
)
sname = 'global_0.02'
if sname in all_grids:
pyic.ckdtree_hgrid(lon_reg=[-180.,180.], lat_reg=[-90.,90.], res=0.02,
fname_tgrid = fname_tgrid,
path_tgrid = path_tgrid,
path_ckdtree = path_rgrid,
sname = sname,
gname = gname,
tgname = tgname,
n_jobs = 10,
load_cgrid=load_cgrid,
load_egrid=load_egrid,
load_vgrid=load_vgrid,
save_as='both',
)
# --- sections
sname = '30W_200pts'
if sname in all_secs:
dckdtree, ickdtree, lon_sec, lat_sec, dist_sec = pyic.ckdtree_section(p1=[-30,-80], p2=[-30,80], npoints=200,
fname_tgrid = fname_tgrid,
path_tgrid = path_tgrid,
path_ckdtree = path_sections,
sname = sname,
gname = gname,
tgname = tgname,
save_as='both',
)
sname = '170W_200pts'
if sname in all_secs:
dckdtree, ickdtree, lon_sec, lat_sec, dist_sec = pyic.ckdtree_section(p1=[-170,-80], p2=[-170,80], npoints=200,
fname_tgrid = fname_tgrid,
path_tgrid = path_tgrid,
path_ckdtree = path_sections,
sname = sname,
gname = gname,
tgname = tgname,
save_as='both',
)
sname = '30W_300pts'
if sname in all_secs:
dckdtree, ickdtree, lon_sec, lat_sec, dist_sec = pyic.ckdtree_section(p1=[-30,-80], p2=[-30,80], npoints=300,
fname_tgrid = fname_tgrid,
path_tgrid = path_tgrid,
path_ckdtree = path_sections,
sname = sname,
gname = gname,
tgname = tgname,
save_as='both',
)
sname = '170W_300pts'
if sname in all_secs:
dckdtree, ickdtree, lon_sec, lat_sec, dist_sec = pyic.ckdtree_section(p1=[-170,-80], p2=[-170,80], npoints=300,
fname_tgrid = fname_tgrid,
path_tgrid = path_tgrid,
path_ckdtree = path_sections,
sname = sname,
gname = gname,
tgname = tgname,
save_as='both',
)
print('make_ckdtree.py: All done!')
ts = pyic.timing(ts, 'All done!')
......@@ -6,7 +6,8 @@ if len(sys.argv)>=2:
matplotlib.use('Agg')
import pyicon as pyic
grid_target = sys.argv[2]
print(sys.argv)
#grid_target = sys.argv[2]
ts = pyic.timing([0], 'start')
......@@ -18,13 +19,14 @@ path_ckdtree = f'/work/mh0033/m300602/icon/grids/{tgname}/ckdtree/'
path_rgrid = path_ckdtree + 'rectgrids/'
path_sections = path_ckdtree + 'sections/'
#all_grids = [
## 'global_1.00',
## 'global_0.30',
## 'global_0.10',
## 'global_0.02',
# ]
all_grids = [grid_target]
all_grids = [
'global_1.0',
'global_0.3',
'global_0.1',
'global_0.02',
'global_0.01',
]
#all_grids = [grid_target]
all_secs = [
# '30W_200pts',
......@@ -33,6 +35,10 @@ all_secs = [
# '170W_300pts',
]
load_cgrid=True,
load_egrid=True,
load_vgrid=True,
if not os.path.exists(path_rgrid):
os.makedirs(path_rgrid)
if not os.path.exists(path_sections):
......@@ -42,12 +48,13 @@ if not os.path.exists(fpath):
os.symlink(path_tgrid+fname_tgrid, fpath)
gnames = [gname]
print(gnames)
for gname in gnames:
ts = pyic.timing(ts, gname)
print(gname)
# --- grids
sname = 'global_1.00'
sname = 'global_1.0'
if sname in all_grids:
pyic.ckdtree_hgrid(lon_reg=[-180.,180.], lat_reg=[-90.,90.], res=1.0,
fname_tgrid = fname_tgrid,
......@@ -56,9 +63,13 @@ for gname in gnames:
sname = sname,
gname = gname,
tgname = tgname,
load_cgrid=load_cgrid,
load_egrid=load_egrid,
load_vgrid=load_vgrid,
save_as='both',
)
sname = 'global_0.30'
sname = 'global_0.3'
if sname in all_grids:
pyic.ckdtree_hgrid(lon_reg=[-180.,180.], lat_reg=[-90.,90.], res=0.3,
fname_tgrid = fname_tgrid,
......@@ -67,9 +78,13 @@ for gname in gnames:
sname = sname,
gname = gname,
tgname = tgname,
load_cgrid=load_cgrid,
load_egrid=load_egrid,
load_vgrid=load_vgrid,
save_as='both',
)
sname = 'global_0.10'
sname = 'global_0.1'
if sname in all_grids:
pyic.ckdtree_hgrid(lon_reg=[-180.,180.], lat_reg=[-90.,90.], res=0.1,
fname_tgrid = fname_tgrid,
......@@ -78,6 +93,10 @@ for gname in gnames:
sname = sname,
gname = gname,
tgname = tgname,
load_cgrid=load_cgrid,
load_egrid=load_egrid,
load_vgrid=load_vgrid,
save_as='both',
)
sname = 'global_0.02'
......@@ -89,7 +108,10 @@ for gname in gnames:
sname = sname,
gname = gname,
tgname = tgname,
n_jobs = 10,
load_cgrid=load_cgrid,
load_egrid=load_egrid,
load_vgrid=load_vgrid,
save_as='both',
)
sname = 'global_0.01'
......@@ -101,7 +123,10 @@ for gname in gnames:
sname = sname,
gname = gname,
tgname = tgname,
n_jobs = 10,
load_cgrid=load_cgrid,
load_egrid=load_egrid,
load_vgrid=load_vgrid,
save_as='both',
)
......
import numpy as np
from netCDF4 import Dataset
import sys, os
import matplotlib
if len(sys.argv)>=2:
matplotlib.use('Agg')
import pyicon as pyic
print('Hey there!')
print(sys.argv)
#grid_target = sys.argv[2]
ts = pyic.timing([0], 'start')
tgname = f'r2b11_oce_r0005'
gname = f'OceanOnly_Global_IcosSymmetric_1233m_rotatedZ37d_GEBCO_2023'
path_tgrid = f'/pool/data/ICON/oes/grids/OceanOnly/'
fname_tgrid = f'{gname}.nc'
path_ckdtree = f'/work/mh0033/m300602/icon/grids/{tgname}/ckdtree/'
path_rgrid = path_ckdtree + 'rectgrids/'
path_sections = path_ckdtree + 'sections/'
all_grids = [
'global_1.0',
'global_0.3',
'global_0.1',
'global_0.02',
'global_0.01',
]
#all_grids = [grid_target]
all_secs = [
# '30W_200pts',
# '170W_200pts',
# '30W_300pts',
# '170W_300pts',
]
load_cgrid=True,
load_egrid=True,
load_vgrid=True,
if not os.path.exists(path_rgrid):
os.makedirs(path_rgrid)
if not os.path.exists(path_sections):
os.makedirs(path_sections)
fpath = f'{path_ckdtree}/../{tgname}_tgrid.nc'
if not os.path.exists(fpath):
os.symlink(path_tgrid+fname_tgrid, fpath)
gnames = [gname]
print(gnames)
for gname in gnames:
ts = pyic.timing(ts, gname)
print(gname)
# --- grids
sname = 'global_1.0'
if sname in all_grids:
pyic.ckdtree_hgrid(lon_reg=[-180.,180.], lat_reg=[-90.,90.], res=1.0,
fname_tgrid = fname_tgrid,
path_tgrid = path_tgrid,
path_ckdtree = path_rgrid,
sname = sname,
gname = gname,
tgname = tgname,
load_cgrid=load_cgrid,
load_egrid=load_egrid,
load_vgrid=load_vgrid,
save_as='both',
)
sname = 'global_0.3'
if sname in all_grids:
pyic.ckdtree_hgrid(lon_reg=[-180.,180.], lat_reg=[-90.,90.], res=0.3,
fname_tgrid = fname_tgrid,
path_tgrid = path_tgrid,
path_ckdtree = path_rgrid,
sname = sname,
gname = gname,
tgname = tgname,
load_cgrid=load_cgrid,
load_egrid=load_egrid,
load_vgrid=load_vgrid,
save_as='both',
)
sname = 'global_0.1'
if sname in all_grids:
pyic.ckdtree_hgrid(lon_reg=[-180.,180.], lat_reg=[-90.,90.], res=0.1,
fname_tgrid = fname_tgrid,
path_tgrid = path_tgrid,
path_ckdtree = path_rgrid,
sname = sname,
gname = gname,
tgname = tgname,
load_cgrid=load_cgrid,
load_egrid=load_egrid,
load_vgrid=load_vgrid,
save_as='both',
)
sname = 'global_0.02'
if sname in all_grids:
pyic.ckdtree_hgrid(lon_reg=[-180.,180.], lat_reg=[-90.,90.], res=0.02,
fname_tgrid = fname_tgrid,
path_tgrid = path_tgrid,
path_ckdtree = path_rgrid,
sname = sname,
gname = gname,
tgname = tgname,
load_cgrid=load_cgrid,
load_egrid=load_egrid,
load_vgrid=load_vgrid,
save_as='both',
)
sname = 'global_0.01'
if sname in all_grids:
pyic.ckdtree_hgrid(lon_reg=[-180.,180.], lat_reg=[-90.,90.], res=0.01,
fname_tgrid = fname_tgrid,
path_tgrid = path_tgrid,
path_ckdtree = path_rgrid,
sname = sname,
gname = gname,
tgname = tgname,
load_cgrid=load_cgrid,
load_egrid=load_egrid,
load_vgrid=load_vgrid,
save_as='both',
)
# --- sections
sname = '30W_200pts'
if sname in all_secs:
dckdtree, ickdtree, lon_sec, lat_sec, dist_sec = pyic.ckdtree_section(p1=[-30,-80], p2=[-30,80], npoints=200,
fname_tgrid = fname_tgrid,
path_tgrid = path_tgrid,
path_ckdtree = path_sections,
sname = sname,
gname = gname,
tgname = tgname,
)
sname = '170W_200pts'
if sname in all_secs:
dckdtree, ickdtree, lon_sec, lat_sec, dist_sec = pyic.ckdtree_section(p1=[-170,-80], p2=[-170,80], npoints=200,
fname_tgrid = fname_tgrid,
path_tgrid = path_tgrid,
path_ckdtree = path_sections,
sname = sname,
gname = gname,
tgname = tgname,
)
sname = '30W_300pts'
if sname in all_secs:
dckdtree, ickdtree, lon_sec, lat_sec, dist_sec = pyic.ckdtree_section(p1=[-30,-80], p2=[-30,80], npoints=300,
fname_tgrid = fname_tgrid,
path_tgrid = path_tgrid,
path_ckdtree = path_sections,
sname = sname,
gname = gname,
tgname = tgname,
)
sname = '170W_300pts'
if sname in all_secs:
dckdtree, ickdtree, lon_sec, lat_sec, dist_sec = pyic.ckdtree_section(p1=[-170,-80], p2=[-170,80], npoints=300,
fname_tgrid = fname_tgrid,
path_tgrid = path_tgrid,
path_ckdtree = path_sections,
sname = sname,
gname = gname,
tgname = tgname,
)
print('make_ckdtree.py: All done!')
ts = pyic.timing(ts, 'All done!')
......@@ -8,7 +8,7 @@ import pyicon as pyic
print('Hey there!')
print(sys.argv)
grid_target = sys.argv[2]
#grid_target = sys.argv[2]
ts = pyic.timing([0], 'start')
......@@ -20,13 +20,14 @@ path_ckdtree = f'/work/mh0033/m300602/icon/grids/{tgname}/ckdtree/'
path_rgrid = path_ckdtree + 'rectgrids/'
path_sections = path_ckdtree + 'sections/'
#all_grids = [
## 'global_1.00',
## 'global_0.30',
## 'global_0.10',
## 'global_0.02',
# ]
all_grids = [grid_target]
all_grids = [
'global_1.0',
'global_0.3',
'global_0.1',
'global_0.02',
'global_0.01',
]
#all_grids = [grid_target]
all_secs = [
# '30W_200pts',
......@@ -35,6 +36,10 @@ all_secs = [
# '170W_300pts',
]
load_cgrid=True,
load_egrid=True,
load_vgrid=True,
if not os.path.exists(path_rgrid):
os.makedirs(path_rgrid)
if not os.path.exists(path_sections):
......@@ -50,7 +55,7 @@ for gname in gnames:
print(gname)
# --- grids
sname = 'global_1.00'
sname = 'global_1.0'
if sname in all_grids:
pyic.ckdtree_hgrid(lon_reg=[-180.,180.], lat_reg=[-90.,90.], res=1.0,
fname_tgrid = fname_tgrid,
......@@ -59,9 +64,13 @@ for gname in gnames:
sname = sname,
gname = gname,
tgname = tgname,
load_cgrid=load_cgrid,
load_egrid=load_egrid,
load_vgrid=load_vgrid,
save_as='both',
)
sname = 'global_0.30'
sname = 'global_0.3'
if sname in all_grids:
pyic.ckdtree_hgrid(lon_reg=[-180.,180.], lat_reg=[-90.,90.], res=0.3,
fname_tgrid = fname_tgrid,
......@@ -70,9 +79,13 @@ for gname in gnames:
sname = sname,
gname = gname,
tgname = tgname,
load_cgrid=load_cgrid,
load_egrid=load_egrid,
load_vgrid=load_vgrid,
save_as='both',
)
sname = 'global_0.10'
sname = 'global_0.1'
if sname in all_grids:
pyic.ckdtree_hgrid(lon_reg=[-180.,180.], lat_reg=[-90.,90.], res=0.1,
fname_tgrid = fname_tgrid,
......@@ -81,6 +94,10 @@ for gname in gnames:
sname = sname,
gname = gname,
tgname = tgname,
load_cgrid=load_cgrid,
load_egrid=load_egrid,
load_vgrid=load_vgrid,
save_as='both',
)
sname = 'global_0.02'
......@@ -92,7 +109,10 @@ for gname in gnames:
sname = sname,
gname = gname,
tgname = tgname,
n_jobs = 10,
load_cgrid=load_cgrid,
load_egrid=load_egrid,
load_vgrid=load_vgrid,
save_as='both',
)
sname = 'global_0.01'
......@@ -104,7 +124,10 @@ for gname in gnames:
sname = sname,
gname = gname,
tgname = tgname,
n_jobs = 10,
load_cgrid=load_cgrid,
load_egrid=load_egrid,
load_vgrid=load_vgrid,
save_as='both',
)
......
import numpy as np
from netCDF4 import Dataset
import sys, os
from importlib import reload
import pyicon as pyic
reload(pyic)
ts = pyic.timing([0], 'start')
tgname = 'r2b4_atm_r0012'
gname = 'icon_grid_0012_R02B04_G'
path_tgrid = f'/hpc/uwork/gboeloen/pyICON/grids/'
path_tgrid = f'/pool/data/ICON/grids/public/mpim/0012/'
fname_tgrid = f'{gname}.nc'
path_ckdtree = f'/hpc/uwork/gboeloen/pyICON/grids/{tgname}/ckdtree/'
path_ckdtree = f'/work/mh0033/m300602/icon/grids/{tgname}/ckdtree/'
path_rgrid = path_ckdtree + 'rectgrids/'
path_sections = path_ckdtree + 'sections/'
......@@ -24,16 +22,8 @@ all_grids = [
'global_0.3',
]
all_secs = [
'30W_100pts',
'30W_200pts',
'170W_100pts',
]
all_secs = []
#all_grids = []
#all_secs = []
gnames = [gname]
if not os.path.exists(path_rgrid):
os.makedirs(path_rgrid)
......@@ -43,6 +33,8 @@ fpath = f'{path_ckdtree}/../{tgname}_tgrid.nc'
if not os.path.exists(fpath):
os.symlink(path_tgrid+fname_tgrid, fpath)
gnames = [gname]
print(gnames)
for gname in gnames:
ts = pyic.timing(ts, gname)
print(gname)
......@@ -57,7 +49,7 @@ for gname in gnames:
sname = sname,
gname = gname,
tgname = tgname,
save_as_nc=False,
save_as='both',
)
sname = 'global_1.5_era5'
......@@ -69,7 +61,7 @@ for gname in gnames:
sname = sname,
gname = gname,
tgname = tgname,
save_as_nc=False,
save_as='both',
)
sname = 'regional_1.0_era'
......@@ -81,10 +73,9 @@ for gname in gnames:
sname = sname,
gname = gname,
tgname = tgname,
save_as_nc=False,
save_as='both',
)
sname = 'global_1.0'
if sname in all_grids:
pyic.ckdtree_hgrid(lon_reg=[-180.,180.], lat_reg=[-90.,90.], res=1.0,
......@@ -94,7 +85,7 @@ for gname in gnames:
sname = sname,
gname = gname,
tgname = tgname,
save_as_nc=False,
save_as='both',
)
sname = 'global_0.3'
......@@ -106,45 +97,9 @@ for gname in gnames:
sname = sname,
gname = gname,
tgname = tgname,
save_as_nc=False,
save_as='both',
)
# --- sections
sname = '30W_100pts'
if sname in all_secs:
dckdtree, ickdtree, lon_sec, lat_sec, dist_sec = pyic.ckdtree_section(p1=[-30,-80], p2=[-30,80], npoints=100,
fname_tgrid = fname_tgrid,
path_tgrid = path_tgrid,
path_ckdtree = path_sections,
sname = sname,
gname = gname,
tgname = tgname,
save_as_nc=False,
)
sname = '30W_200pts'
if sname in all_secs:
dckdtree, ickdtree, lon_sec, lat_sec, dist_sec = pyic.ckdtree_section(p1=[-30,-80], p2=[-30,80], npoints=200,
fname_tgrid = fname_tgrid,
path_tgrid = path_tgrid,
path_ckdtree = path_sections,
sname = sname,
gname = gname,
tgname = tgname,
save_as_nc=False,
)
sname = '170W_100pts'
if sname in all_secs:
dckdtree, ickdtree, lon_sec, lat_sec, dist_sec = pyic.ckdtree_section(p1=[-170,-80], p2=[-170,80], npoints=100,
fname_tgrid = fname_tgrid,
path_tgrid = path_tgrid,
path_ckdtree = path_sections,
sname = sname,
gname = gname,
tgname = tgname,
save_as_nc=False,
)
print('make_ckdtree.py: All done!')
ts = pyic.timing(ts, 'All done!')
......@@ -8,25 +8,24 @@ reload(pyic)
ts = pyic.timing([0], 'start')
tgname = 'r2b4_atm_r0013'
gname = 'icon_grid_0013_R02B04_G'
rev = f'r0013'
tgname = f'r2b4_atm_{rev}'
gname = f'icon_grid_0013_R02B04_G'
path_tgrid = f'/pool/data/ICON/grids/public/mpim/0013/'
fname_tgrid = f'{gname}.nc'
path_ckdtree = f'/mnt/lustre01/work/mh0033/m300602/icon/grids/{tgname}/ckdtree/'
#path_ckdtree = f'/hpc/uwork/gboeloen/pyICON/grids/{tgname}/ckdtree/'
path_ckdtree = f'/work/mh0033/m300602/icon/grids/{tgname}/ckdtree/'
path_rgrid = path_ckdtree + 'rectgrids/'
path_sections = path_ckdtree + 'sections/'
all_grids = [
'global_1.0',
'global_1.0_era',
'global_1.5_era5',
'global_0.3',
]
all_secs = [
]
#all_grids = []
#all_secs = []
gnames = [gname]
......@@ -54,9 +53,9 @@ for gname in gnames:
tgname = tgname,
)
sname = 'global_1.0'
sname = 'global_1.5_era5'
if sname in all_grids:
pyic.ckdtree_hgrid(lon_reg=[-180.,180.], lat_reg=[-90.,90.], res=1.0,
pyic.ckdtree_hgrid(lon_reg=[-180.,180], lat_reg=[-90,91.5], res=1.5,
fname_tgrid = fname_tgrid,
path_tgrid = path_tgrid,
path_ckdtree = path_rgrid,
......@@ -64,10 +63,10 @@ for gname in gnames:
gname = gname,
tgname = tgname,
)
sname = 'global_0.3'
sname = 'global_1.0'
if sname in all_grids:
pyic.ckdtree_hgrid(lon_reg=[-180.,180.], lat_reg=[-90.,90.], res=0.3,
pyic.ckdtree_hgrid(lon_reg=[-180.,180.], lat_reg=[-90.,90.], res=1.0,
fname_tgrid = fname_tgrid,
path_tgrid = path_tgrid,
path_ckdtree = path_rgrid,
......@@ -76,9 +75,9 @@ for gname in gnames:
tgname = tgname,
)
sname = 'global_0.1'
sname = 'global_0.3'
if sname in all_grids:
pyic.ckdtree_hgrid(lon_reg=[-180.,180.], lat_reg=[-90.,90.], res=0.1,
pyic.ckdtree_hgrid(lon_reg=[-180.,180.], lat_reg=[-90.,90.], res=0.3,
fname_tgrid = fname_tgrid,
path_tgrid = path_tgrid,
path_ckdtree = path_rgrid,
......@@ -86,6 +85,7 @@ for gname in gnames:
gname = gname,
tgname = tgname,
)
print('make_ckdtree.py: All done!')
ts = pyic.timing(ts, 'All done!')
......@@ -8,11 +8,13 @@ reload(pyic)
ts = pyic.timing([0], 'start')
tgname = 'r2b4_atm_r0013'
gname = 'icon_grid_0013_R02B04_G'
path_tgrid = f'/hpc/uwork/gboeloen/pyICON/grids/'
rev = f'r0013'
tgname = f'r2b4_atm_{rev}'
gname = f'icon_grid_0013_R02B04_G'
path_tgrid = f'/pool/data/ICON/grids/public/mpim/0013/'
fname_tgrid = f'{gname}.nc'
path_ckdtree = f'/hpc/uwork/gboeloen/pyICON/grids/{tgname}/ckdtree/'
#path_ckdtree = f'/hpc/uwork/gboeloen/pyICON/grids/{tgname}/ckdtree/'
path_ckdtree = f'/work/mh0033/m300602/icon/grids/{tgname}/ckdtree/'
path_rgrid = path_ckdtree + 'rectgrids/'
path_sections = path_ckdtree + 'sections/'
......@@ -23,14 +25,7 @@ all_grids = [
'global_0.3',
]
all_secs = [
'30W_100pts',
'30W_200pts',
'170W_100pts',
]
#all_grids = []
#all_secs = []
gnames = [gname]
......@@ -56,7 +51,6 @@ for gname in gnames:
sname = sname,
gname = gname,
tgname = tgname,
save_as_nc=False,
)
sname = 'global_1.5_era5'
......@@ -68,7 +62,6 @@ for gname in gnames:
sname = sname,
gname = gname,
tgname = tgname,
save_as_nc=False,
)
sname = 'global_1.0'
......@@ -80,7 +73,6 @@ for gname in gnames:
sname = sname,
gname = gname,
tgname = tgname,
save_as_nc=False,
)
sname = 'global_0.3'
......@@ -92,42 +84,8 @@ for gname in gnames:
sname = sname,
gname = gname,
tgname = tgname,
save_as_nc=False,
)
# --- sections
sname = '30W_100pts'
if sname in all_secs:
dckdtree, ickdtree, lon_sec, lat_sec, dist_sec = pyic.ckdtree_section(p1=[-30,-80], p2=[-30,80], npoints=100,
fname_tgrid = fname_tgrid,
path_tgrid = path_tgrid,
path_ckdtree = path_sections,
sname = sname,
gname = gname,
save_as_nc=False,
)
sname = '30W_200pts'
if sname in all_secs:
dckdtree, ickdtree, lon_sec, lat_sec, dist_sec = pyic.ckdtree_section(p1=[-30,-80], p2=[-30,80], npoints=200,
fname_tgrid = fname_tgrid,
path_tgrid = path_tgrid,
path_ckdtree = path_sections,
sname = sname,
gname = gname,
save_as_nc=False,
)
sname = '170W_100pts'
if sname in all_secs:
dckdtree, ickdtree, lon_sec, lat_sec, dist_sec = pyic.ckdtree_section(p1=[-170,-80], p2=[-170,80], npoints=100,
fname_tgrid = fname_tgrid,
path_tgrid = path_tgrid,
path_ckdtree = path_sections,
sname = sname,
gname = gname,
save_as_nc=False,
)
print('make_ckdtree.py: All done!')
ts = pyic.timing(ts, 'All done!')
......@@ -18,16 +18,17 @@ path_rgrid = path_ckdtree + 'rectgrids/'
path_sections = path_ckdtree + 'sections/'
all_grids = [
'global_1.0',
'global_0.3',
'global_0.1',
# 'global_1.0',
# 'global_0.3',
# 'global_0.1',
]
all_secs = [
'30W_200pts',
'170W_200pts',
'30W_300pts',
'170W_300pts',
# '30W_200pts',
# '170W_200pts',
# '30W_300pts',
# '170W_300pts',
'48N_300pts',
]
#all_grids = []
......@@ -138,5 +139,17 @@ for gname in gnames:
tgname = tgname,
)
sname = '48N_300pts'
if sname in all_secs:
dckdtree, ickdtree, lon_sec, lat_sec, dist_sec = pyic.ckdtree_section(p1=[-50,48], p2=[0,48], npoints=300,
fname_tgrid = fname_tgrid,
path_tgrid = path_tgrid,
path_ckdtree = path_sections,
sname = sname,
gname = gname,
tgname = tgname,
save_as_nc = False,
)
print('make_ckdtree.py: All done!')
ts = pyic.timing(ts, 'All done!')
import numpy as np
from netCDF4 import Dataset
import sys, os
from importlib import reload
import pyicon as pyic
reload(pyic)
ts = pyic.timing([0], 'start')
rev = f'r0004'
tgname = f'r2b6_oce_{rev}'
gname = f'OceanOnly_Global_IcosSymmetric_0039km_rotatedZ37d_BlackSea_Greenland_modified_sills_srtm30_1min'
path_tgrid = f'/pool/data/ICON/oes/input/{rev}/OceanOnly_Global_IcosSymmetric_0039km_rotatedZ37d_BlackSea_Greenland_modified_srtm30_1min/'
fname_tgrid = f'{gname}.nc'
path_ckdtree = f'/work/mh0033/m300602/icon/grids/{tgname}_new/ckdtree/'
path_rgrid = path_ckdtree + 'rectgrids/'
path_sections = path_ckdtree + 'sections/'
all_grids = [
'global_1.0',
'global_0.3',
'global_0.1',
]
all_secs = [
'30W_200pts',
'170W_200pts',
'30W_300pts',
'170W_300pts',
'48N_300pts',
]
#all_grids = []
#all_secs = []
gnames = [gname]
if not os.path.exists(path_rgrid):
os.makedirs(path_rgrid)
if not os.path.exists(path_sections):
os.makedirs(path_sections)
fpath = f'{path_ckdtree}/../{tgname}_tgrid.nc'
if not os.path.exists(fpath):
os.symlink(path_tgrid+fname_tgrid, fpath)
for gname in gnames:
ts = pyic.timing(ts, gname)
print(gname)
# --- grids
sname = 'global_1.0'
if sname in all_grids:
pyic.ckdtree_hgrid(lon_reg=[-180.,180.], lat_reg=[-90.,90.], res=1.0,
fname_tgrid = fname_tgrid,
path_tgrid = path_tgrid,
path_ckdtree = path_rgrid,
sname = sname,
gname = gname,
tgname = tgname,
save_as = 'both',
)
sname = 'global_0.3'
if sname in all_grids:
pyic.ckdtree_hgrid(lon_reg=[-180.,180.], lat_reg=[-90.,90.], res=0.3,
fname_tgrid = fname_tgrid,
path_tgrid = path_tgrid,
path_ckdtree = path_rgrid,
sname = sname,
gname = gname,
tgname = tgname,
save_as = 'both',
)
sname = 'global_0.1'
if sname in all_grids:
pyic.ckdtree_hgrid(lon_reg=[-180.,180.], lat_reg=[-90.,90.], res=0.1,
fname_tgrid = fname_tgrid,
path_tgrid = path_tgrid,
path_ckdtree = path_rgrid,
sname = sname,
gname = gname,
tgname = tgname,
save_as = 'both',
)
sname = 'global_0.02'
if sname in all_grids:
pyic.ckdtree_hgrid(lon_reg=[-180.,180.], lat_reg=[-90.,90.], res=0.02,
fname_tgrid = fname_tgrid,
path_tgrid = path_tgrid,
path_ckdtree = path_rgrid,
sname = sname,
gname = gname,
tgname = tgname,
save_as = 'both',
)
# --- sections
sname = '30W_200pts'
if sname in all_secs:
dckdtree, ickdtree, lon_sec, lat_sec, dist_sec = pyic.ckdtree_section(p1=[-30,-80], p2=[-30,80], npoints=200,
fname_tgrid = fname_tgrid,
path_tgrid = path_tgrid,
path_ckdtree = path_sections,
sname = sname,
gname = gname,
tgname = tgname,
save_as = 'both',
)
sname = '170W_200pts'
if sname in all_secs:
dckdtree, ickdtree, lon_sec, lat_sec, dist_sec = pyic.ckdtree_section(p1=[-170,-80], p2=[-170,80], npoints=200,
fname_tgrid = fname_tgrid,
path_tgrid = path_tgrid,
path_ckdtree = path_sections,
sname = sname,
gname = gname,
tgname = tgname,
save_as = 'both',
)
sname = '30W_300pts'
if sname in all_secs:
dckdtree, ickdtree, lon_sec, lat_sec, dist_sec = pyic.ckdtree_section(p1=[-30,-80], p2=[-30,80], npoints=300,
fname_tgrid = fname_tgrid,
path_tgrid = path_tgrid,
path_ckdtree = path_sections,
sname = sname,
gname = gname,
tgname = tgname,
save_as = 'both',
)
sname = '170W_300pts'
if sname in all_secs:
dckdtree, ickdtree, lon_sec, lat_sec, dist_sec = pyic.ckdtree_section(p1=[-170,-80], p2=[-170,80], npoints=300,
fname_tgrid = fname_tgrid,
path_tgrid = path_tgrid,
path_ckdtree = path_sections,
sname = sname,
gname = gname,
tgname = tgname,
save_as = 'both',
)
sname = '48N_300pts'
if sname in all_secs:
dckdtree, ickdtree, lon_sec, lat_sec, dist_sec = pyic.ckdtree_section(p1=[-50,48], p2=[0,48], npoints=300,
fname_tgrid = fname_tgrid,
path_tgrid = path_tgrid,
path_ckdtree = path_sections,
sname = sname,
gname = gname,
tgname = tgname,
save_as = 'both',
)
print('make_ckdtree.py: All done!')
ts = pyic.timing(ts, 'All done!')
......@@ -19,20 +19,14 @@ path_sections = path_ckdtree + 'sections/'
all_grids = [
'global_1.0',
'global_1.0_era',
'global_1.5_era5',
'global_0.3',
'global_0.1',
'global_0.02',
]
all_secs = [
'30W_200pts',
'170W_200pts',
'30W_300pts',
'170W_300pts',
]
#all_grids = []
#all_secs = []
gnames = [gname]
......@@ -49,95 +43,54 @@ for gname in gnames:
print(gname)
# --- grids
sname = 'global_1.0'
sname = 'global_1.0_era'
if sname in all_grids:
pyic.ckdtree_hgrid(lon_reg=[-180.,180.], lat_reg=[-90.,90.], res=1.0,
pyic.ckdtree_hgrid(lon_reg=[-179.,181.], lat_reg=[-89.5,90.], res=1.0,
fname_tgrid = fname_tgrid,
path_tgrid = path_tgrid,
path_ckdtree = path_rgrid,
sname = sname,
gname = gname,
tgname = tgname,
save_as='both',
)
sname = 'global_0.3'
sname = 'global_1.5_era5'
if sname in all_grids:
pyic.ckdtree_hgrid(lon_reg=[-180.,180.], lat_reg=[-90.,90.], res=0.3,
pyic.ckdtree_hgrid(lon_reg=[-180.,180], lat_reg=[-90,91.5], res=1.5,
fname_tgrid = fname_tgrid,
path_tgrid = path_tgrid,
path_ckdtree = path_rgrid,
sname = sname,
gname = gname,
tgname = tgname,
save_as='both',
)
sname = 'global_0.1'
sname = 'global_1.0'
if sname in all_grids:
pyic.ckdtree_hgrid(lon_reg=[-180.,180.], lat_reg=[-90.,90.], res=0.1,
pyic.ckdtree_hgrid(lon_reg=[-180.,180.], lat_reg=[-90.,90.], res=1.0,
fname_tgrid = fname_tgrid,
path_tgrid = path_tgrid,
path_ckdtree = path_rgrid,
sname = sname,
gname = gname,
tgname = tgname,
save_as='both',
)
sname = 'global_0.02'
sname = 'global_0.3'
if sname in all_grids:
pyic.ckdtree_hgrid(lon_reg=[-180.,180.], lat_reg=[-90.,90.], res=0.02,
pyic.ckdtree_hgrid(lon_reg=[-180.,180.], lat_reg=[-90.,90.], res=0.3,
fname_tgrid = fname_tgrid,
path_tgrid = path_tgrid,
path_ckdtree = path_rgrid,
sname = sname,
gname = gname,
tgname = tgname,
save_as='both',
)
# --- sections
sname = '30W_200pts'
if sname in all_secs:
dckdtree, ickdtree, lon_sec, lat_sec, dist_sec = pyic.ckdtree_section(p1=[-30,-80], p2=[-30,80], npoints=200,
fname_tgrid = fname_tgrid,
path_tgrid = path_tgrid,
path_ckdtree = path_sections,
sname = sname,
gname = gname,
tgname = tgname,
)
sname = '170W_200pts'
if sname in all_secs:
dckdtree, ickdtree, lon_sec, lat_sec, dist_sec = pyic.ckdtree_section(p1=[-170,-80], p2=[-170,80], npoints=200,
fname_tgrid = fname_tgrid,
path_tgrid = path_tgrid,
path_ckdtree = path_sections,
sname = sname,
gname = gname,
tgname = tgname,
)
sname = '30W_300pts'
if sname in all_secs:
dckdtree, ickdtree, lon_sec, lat_sec, dist_sec = pyic.ckdtree_section(p1=[-30,-80], p2=[-30,80], npoints=300,
fname_tgrid = fname_tgrid,
path_tgrid = path_tgrid,
path_ckdtree = path_sections,
sname = sname,
gname = gname,
tgname = tgname,
)
sname = '170W_300pts'
if sname in all_secs:
dckdtree, ickdtree, lon_sec, lat_sec, dist_sec = pyic.ckdtree_section(p1=[-170,-80], p2=[-170,80], npoints=300,
fname_tgrid = fname_tgrid,
path_tgrid = path_tgrid,
path_ckdtree = path_sections,
sname = sname,
gname = gname,
tgname = tgname,
)
print('make_ckdtree.py: All done!')
ts = pyic.timing(ts, 'All done!')