#!/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.'

#!/bin/bash
hadisstfn='/projects/NS9039K/shared/HadISST/HadISST_sst.nc'
griddes='griddes.txt'
yearb='1980'
yeare='1982'
years=$(seq $yearb $yeare | tr '\n' ,)
cdo -s -remapbil,$griddes \
    -expr,'sst=(sst<-2.)?missval(sst):sst' \
    -selyear,$years \
    -selname,sst \
    $hadisstfn HadISST_with_model_grid.nc
cdo -s -ymonsub HadISST_with_model_grid.nc -ymonmean HadISST_with_model_grid.nc  HadISST_with_model_grid_ano.nc


