Update Hands on ICON data analysis for beginners authored by Dian Putrasahan's avatar Dian Putrasahan
...@@ -1536,7 +1536,7 @@ We will use a script called `pyic_fig.py`, that is part of pyICON. Please refer ...@@ -1536,7 +1536,7 @@ We will use a script called `pyic_fig.py`, that is part of pyICON. Please refer
<details><summary><b> Quick view example using command line</b></summary> <details><summary><b> Quick view example using command line</b></summary>
```brainfuck=bash ```bash
pyicdir=/work/mh1421/m300466/tools/pyicon/scripts pyicdir=/work/mh1421/m300466/tools/pyicon/scripts
cd ${pyicdir} cd ${pyicdir}
...@@ -1601,7 +1601,7 @@ healpy.mollview(ds_map.tas.isel(time=0), flip="geo", nest=get_nest(ds_map)) ...@@ -1601,7 +1601,7 @@ healpy.mollview(ds_map.tas.isel(time=0), flip="geo", nest=get_nest(ds_map))
<details><summary><b> Sample script using pyic_sec.py </b></summary> <details><summary><b> Sample script using pyic_sec.py </b></summary>
```brainfuck=bash ```bash
expid=slo1826 expid=slo1826
datadir=/work/mh0287/m211032/Icon/Git_lev/icon.XPP.20240717/build.intel-hdext/experiments/${expid} datadir=/work/mh0287/m211032/Icon/Git_lev/icon.XPP.20240717/build.intel-hdext/experiments/${expid}
examplefile=${expid}_oce_def_19900101T000000Z.nc examplefile=${expid}_oce_def_19900101T000000Z.nc
...@@ -1626,7 +1626,7 @@ General recommendation (not a fixed rule) for remapping ICON to lon/lat: ...@@ -1626,7 +1626,7 @@ General recommendation (not a fixed rule) for remapping ICON to lon/lat:
<details><summary><b> Remap r2b9 (5km) ocean to 0.25deg grid </b></summary> <details><summary><b> Remap r2b9 (5km) ocean to 0.25deg grid </b></summary>
```brainfuck=bash ```bash
targetgrid=/work/mh0256/m300466/DPP/grid/IFS25_invertlat_gridexample.nc targetgrid=/work/mh0256/m300466/DPP/grid/IFS25_invertlat_gridexample.nc
remapwgt=/work/mh0256/m300466/DPP/weights/r2b9O_IFS25invertlat_yconremapweights.nc remapwgt=/work/mh0256/m300466/DPP/weights/r2b9O_IFS25invertlat_yconremapweights.nc
srcgrid=/pool/data/ICON/grids/public/mpim/0016/icon_grid_0016_R02B09_O.nc srcgrid=/pool/data/ICON/grids/public/mpim/0016/icon_grid_0016_R02B09_O.nc
...@@ -1656,7 +1656,7 @@ ncview ${varfile} & ...@@ -1656,7 +1656,7 @@ ncview ${varfile} &
<details><summary><b> Remap r2b5 (80km) atmosphere to 0.25deg grid </b></summary> <details><summary><b> Remap r2b5 (80km) atmosphere to 0.25deg grid </b></summary>
```brainfuck=bash ```bash
targetgrid=/work/mh0256/m300466/DPP/grid/IFS25_invertlat_gridexample.nc targetgrid=/work/mh0256/m300466/DPP/grid/IFS25_invertlat_gridexample.nc
srcgrid=/pool/data/ICON/grids/public/mpim/0053/icon_grid_0053_R02B07_G.nc srcgrid=/pool/data/ICON/grids/public/mpim/0053/icon_grid_0053_R02B07_G.nc
...@@ -1677,7 +1677,7 @@ ncview ${varfile} & ...@@ -1677,7 +1677,7 @@ ncview ${varfile} &
<details><summary><b> Remap from catalogue: r2b9 (5km) ocean to 0.25deg grid </b></summary> <details><summary><b> Remap from catalogue: r2b9 (5km) ocean to 0.25deg grid </b></summary>
```brainfuck=bash ```bash
module use /work/k20200/k202134/hsm-tools/outtake/module module use /work/k20200/k202134/hsm-tools/outtake/module
module load hsm-tools/unstable module load hsm-tools/unstable
module sw cdo cdo module sw cdo cdo
...@@ -1792,7 +1792,7 @@ ICON can only output on pressure levels if they are instantaneous outputs. For t ...@@ -1792,7 +1792,7 @@ ICON can only output on pressure levels if they are instantaneous outputs. For t
We use C5 experiments (ICON-Sapphire) as an example. We use C5 experiments (ICON-Sapphire) as an example.
```brainfuck=bash ```bash
#Find where files are located using `query_yaml` #Find where files are located using `query_yaml`
module use /work/k20200/k202134/hsm-tools/outtake/module module use /work/k20200/k202134/hsm-tools/outtake/module
module load hsm-tools/unstable module load hsm-tools/unstable
...@@ -1801,7 +1801,7 @@ filelist_p4k7=$(query_yaml ICON C5 AMIP_P4K --search_args grid=R02B07 time=P1D - ...@@ -1801,7 +1801,7 @@ filelist_p4k7=$(query_yaml ICON C5 AMIP_P4K --search_args grid=R02B07 time=P1D -
``` ```
In this example, we first horizontally interpolate the relevant variables onto 1x1deg grid, and then vertically interpolate onto the pressure levels. In this example, we first horizontally interpolate the relevant variables onto 1x1deg grid, and then vertically interpolate onto the pressure levels.
```brainfuck=bash ```bash
res=r2b7 res=r2b7
RES=R02B07 RES=R02B07
...@@ -1854,7 +1854,7 @@ done ...@@ -1854,7 +1854,7 @@ done
<details><summary><b> Compute mass streamfunction and take zonal mean </b></summary> <details><summary><b> Compute mass streamfunction and take zonal mean </b></summary>
```brainfuck=bash ```bash
res=r2b7 res=r2b7
RES=R02B07 RES=R02B07
...@@ -1888,11 +1888,11 @@ There's a driver script to produce quickplots for ICON simulations. Edits are ne ...@@ -1888,11 +1888,11 @@ There's a driver script to produce quickplots for ICON simulations. Edits are ne
<details><summary><b> Example driver script for making quick plots </b></summary> <details><summary><b> Example driver script for making quick plots </b></summary>
We use a DRAGON run as an example. We use a DRAGON run as an example. \
cd /work/mh1421/m300466/tools/pyicon/tools cd /work/mh1421/m300466/tools/pyicon/tools \
vi run_qp_driver_dragon_r3b7-r2b9.sh vi run_qp_driver_dragon_r3b7-r2b9.sh
```brainfuck=bash ```bash
#!/bin/bash #!/bin/bash
#SBATCH --job-name=pyicon_qp #SBATCH --job-name=pyicon_qp
#SBATCH --time=02:00:00 #SBATCH --time=02:00:00
...@@ -2016,7 +2016,7 @@ The observational dataset used in CVDP can be downloaded from [https://www.cesm. ...@@ -2016,7 +2016,7 @@ The observational dataset used in CVDP can be downloaded from [https://www.cesm.
<details><summary><b> Download CVDP </b></summary> <details><summary><b> Download CVDP </b></summary>
```brainfuck=bash ```bash
cd /work/mh1421/m300466/tools cd /work/mh1421/m300466/tools
git clone https://github.com/NCAR/CVDP-ncl.git CVDP git clone https://github.com/NCAR/CVDP-ncl.git CVDP
...@@ -2037,7 +2037,7 @@ mkdir -p icondata/ cvdpplots/ driverscripts/ ...@@ -2037,7 +2037,7 @@ mkdir -p icondata/ cvdpplots/ driverscripts/
We use a low res DRAGON run as an example. Here is a script `go_cvdp.sh` which you can modify to run CVDP. We use a low res DRAGON run as an example. Here is a script `go_cvdp.sh` which you can modify to run CVDP.
```brainfuck=bash ```bash
#!/bin/bash -x #!/bin/bash -x
CDO="cdo -P 48" CDO="cdo -P 48"
module load ncl module load ncl
...@@ -2169,6 +2169,34 @@ While variance/covariance gives you the combined variability on all time scales, ...@@ -2169,6 +2169,34 @@ While variance/covariance gives you the combined variability on all time scales,
The spectra can be simulataneously computed for each grid point on the native grid so that we can obtain 2D maps of how variability and bi-variate relations may look like on different frequency/timescales. The spectra can be simulataneously computed for each grid point on the native grid so that we can obtain 2D maps of how variability and bi-variate relations may look like on different frequency/timescales.
<details><summary><b> Example script for how variance looks </b></summary>
```bash
expid=slo1774
datadir=/work/mh0287/m211032/Icon/Git_lev/icon.XPP.20240717/build.intel-hdint/experiments/${expid}
outdir=/work/mh1421/m300466/blah/${expid}
varname1="t_2m"
varname2="sp_10m"
yyyys=1200
yyyye=1299
mkdir -p ${outdir}
# Detrend
cdo -detrend -yearmean -select,name=${varname1},year=${yyyys}/${yyyye}/1 [ ${datadir}/slo1774_atm_2d_ml_*.nc ] ${outdir}/detrend_${varname1}_ym_${yyyys}-${yyyye}.nc
cdo -detrend -yearmean -select,name=${varname2},year=${yyyys}/${yyyye}/1 [ ${datadir}/slo1774_atm_2d_ml_*.nc ] ${outdir}/detrend_${varname2}_ym_${yyyys}-${yyyye}.nc
#Variance and regrid to 1x1deg for easy plotting
cdo -remapycon,r360x180 -timvar ${outdir}/detrend_${varname1}_ym_${yyyys}-${yyyye}.nc ${outdir}/timvar_${expid}_${varname1}_ym_${yyyys}-${yyyye}_r360x180.nc
cdo -remapycon,r360x180 -timvar ${outdir}/detrend_${varname2}_ym_${yyyys}-${yyyye}.nc ${outdir}/timvar_${expid}_${varname2}_ym_${yyyys}-${yyyye}_r360x180.nc
#Correlation = covariance/(std(x)*std(y)), and Regrid to 1x1deg for easy plotting
cdo -remapycon,r360x180 -div -timcovar ${outdir}/detrend_${varname1}_ym_${yyyys}-${yyyye}.nc ${outdir}/detrend_${varname2}_ym_${yyyys}-${yyyye}.nc -mul -timstd ${outdir}/detrend_${varname1}_ym_${yyyys}-${yyyye}.nc -timstd ${outdir}/detrend_${varname2}_ym_${yyyys}-${yyyye}.nc ${outdir}/timecorr_${expid}_${varname1}_${varname2}_ym_${yyyys}-${yyyye}_r360x180.nc
```
</details>
<details><summary><b> Example script for spectral analysis </b></summary> <details><summary><b> Example script for spectral analysis </b></summary>
This example uses a control CMIP7 experiment (slo1774; 160km atm resolution). The script is called `timespectra_iconxpp.sh` This example uses a control CMIP7 experiment (slo1774; 160km atm resolution). The script is called `timespectra_iconxpp.sh`
... ...
......