#!/bin/bash

## Just run code in recipes, use it carefully
## example: use cdo to make cache file. Since cdo is quicker than ncl.
#;DIAG_NORCPM; RUNTHESECODES: echo '    no codes run here.'

infile=/nird/datalake/NS9039K/users/pgchiu/diag_norcpm/data/tos_input4MIPs_SSTsAndSeaIce_CMIP_PCMDI-AMIP-1-1-8_gn_187001-202112.nc
var=tos
yb=1980
ye=2020
griddes=GRIDDES
outfile=amip_tos.nc

cdo -s -O -selname,${var} -selyear,${yb}/${ye} ${infile} ${outfile}


