atm_obs.sh 3.85 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/bin/bash

# atmosphere obs data processing

datasets=("CLOUDSAT" "ISCCP")

for dataset in "${datasets[@]}"
do

# to get this working, need to apply to all climos and using cesm1/e3sm specific mask file that has already been created
echo "remapping ${dataset} climos onto target grid"
file_w_data_on_source_grid=$outpath/masks/${case}.clm2.gris_mask.nc
ncremap -i $file_w_data_on_source_grid -V CLDTOT -a bilinear -d $obspath/${dataset}_01_climo.nc -v gris_mask -o $obspath/$case.gris_mask_${dataset}_grid.nc

done

for dataset in "${datasets[@]}"
do

echo "add mask and area variables to annualized daily averages"
ncks -A -v gris_mask,gw $obspath/$case.gris_mask_${dataset}_grid.nc $obspath/${dataset}_ANN_climo.nc
ncks -A -v gris_mask,gw $obspath/$case.gris_mask_${dataset}_grid.nc $obspath/${dataset}_DJF_climo.nc
ncks -A -v gris_mask,gw $obspath/$case.gris_mask_${dataset}_grid.nc $obspath/${dataset}_JJA_climo.nc
ncks -A -v gris_mask,gw $obspath/$case.gris_mask_${dataset}_grid.nc $obspath/${dataset}_01_climo.nc
ncks -A -v gris_mask,gw $obspath/$case.gris_mask_${dataset}_grid.nc $obspath/${dataset}_02_climo.nc
ncks -A -v gris_mask,gw $obspath/$case.gris_mask_${dataset}_grid.nc $obspath/${dataset}_03_climo.nc
ncks -A -v gris_mask,gw $obspath/$case.gris_mask_${dataset}_grid.nc $obspath/${dataset}_04_climo.nc
ncks -A -v gris_mask,gw $obspath/$case.gris_mask_${dataset}_grid.nc $obspath/${dataset}_05_climo.nc
ncks -A -v gris_mask,gw $obspath/$case.gris_mask_${dataset}_grid.nc $obspath/${dataset}_06_climo.nc
ncks -A -v gris_mask,gw $obspath/$case.gris_mask_${dataset}_grid.nc $obspath/${dataset}_07_climo.nc
ncks -A -v gris_mask,gw $obspath/$case.gris_mask_${dataset}_grid.nc $obspath/${dataset}_08_climo.nc
ncks -A -v gris_mask,gw $obspath/$case.gris_mask_${dataset}_grid.nc $obspath/${dataset}_09_climo.nc
ncks -A -v gris_mask,gw $obspath/$case.gris_mask_${dataset}_grid.nc $obspath/${dataset}_10_climo.nc
ncks -A -v gris_mask,gw $obspath/$case.gris_mask_${dataset}_grid.nc $obspath/${dataset}_11_climo.nc
ncks -A -v gris_mask,gw $obspath/$case.gris_mask_${dataset}_grid.nc $obspath/${dataset}_12_climo.nc

echo "average over ice sheet region for cloud data"
ncwa -O -a lat,lon -w area -B "gris_mask == 1" $obspath/${dataset}_ANN_climo.nc $obspath/${dataset}_ANN_aavg_climo.nc 
ncwa -O -a lat,lon -w area -B "gris_mask == 1" $obspath/${dataset}_JJA_climo.nc $obspath/${dataset}_JJA_aavg_climo.nc 
ncwa -O -a lat,lon -w area -B "gris_mask == 1" $obspath/${dataset}_DJF_climo.nc $obspath/${dataset}_DJF_aavg_climo.nc 
ncwa -O -a lat,lon -w area -B "gris_mask == 1" $obspath/${dataset}_01_climo.nc $obspath/${dataset}_01_aavg_climo.nc 
ncwa -O -a lat,lon -w area -B "gris_mask == 1" $obspath/${dataset}_02_climo.nc $obspath/${dataset}_02_aavg_climo.nc 
ncwa -O -a lat,lon -w area -B "gris_mask == 1" $obspath/${dataset}_03_climo.nc $obspath/${dataset}_03_aavg_climo.nc 
ncwa -O -a lat,lon -w area -B "gris_mask == 1" $obspath/${dataset}_04_climo.nc $obspath/${dataset}_04_aavg_climo.nc 
ncwa -O -a lat,lon -w area -B "gris_mask == 1" $obspath/${dataset}_05_climo.nc $obspath/${dataset}_05_aavg_climo.nc 
ncwa -O -a lat,lon -w area -B "gris_mask == 1" $obspath/${dataset}_06_climo.nc $obspath/${dataset}_06_aavg_climo.nc 
ncwa -O -a lat,lon -w area -B "gris_mask == 1" $obspath/${dataset}_07_climo.nc $obspath/${dataset}_07_aavg_climo.nc 
ncwa -O -a lat,lon -w area -B "gris_mask == 1" $obspath/${dataset}_08_climo.nc $obspath/${dataset}_08_aavg_climo.nc 
ncwa -O -a lat,lon -w area -B "gris_mask == 1" $obspath/${dataset}_09_climo.nc $obspath/${dataset}_09_aavg_climo.nc 
ncwa -O -a lat,lon -w area -B "gris_mask == 1" $obspath/${dataset}_10_climo.nc $obspath/${dataset}_10_aavg_climo.nc 
ncwa -O -a lat,lon -w area -B "gris_mask == 1" $obspath/${dataset}_11_climo.nc $obspath/${dataset}_11_aavg_climo.nc 
ncwa -O -a lat,lon -w area -B "gris_mask == 1" $obspath/${dataset}_12_climo.nc $obspath/${dataset}_12_aavg_climo.nc 

done