-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_rx1h_qld_biasadjust.sh
executable file
·53 lines (36 loc) · 2.73 KB
/
run_rx1h_qld_biasadjust.sh
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
#!/bin/sh
# Get all the RX1H and RX1D
#dir=/g/data/py18/BARPA/output/CMIP6/DD/AUS-15/BOM/
dir=/g/data/ig45/QldFCP-2/CORDEX/CMIP6/DD/AUS-20i/UQ-DEC/
bdir=/g/data/ia39/australian-climate-service/test-data/CORDEX-CMIP6/bias-adjustment-output/AGCD-05i/
odir=/scratch/eg3/asp561/NCRA/bias-adjusted/
agency=('BOM' 'BOM' 'BOM' 'BOM' 'BOM' 'BOM' 'BOM' 'CSIRO' 'CSIRO' 'CSIRO' 'CSIRO' 'CSIRO' 'CSIRO' 'UQ-DEC' 'UQ-DEC' 'UQ-DEC' 'UQ-DEC' 'UQ-DEC' 'UQ-DEC' 'UQ-DEC' 'UQ-DEC' 'UQ-DEC' 'UQ-DEC' 'UQ-DEC' 'UQ-DEC' 'UQ-DEC' 'UQ-DEC' 'UQ-DEC')
model=('ACCESS-CM2' 'ACCESS-ESM1-5' 'CESM2' 'CMCC-ESM2' 'EC-Earth3' 'MPI-ESM1-2-HR' 'NorESM2-MM' 'ACCESS-CM2' 'ACCESS-ESM1-5' 'CESM2' 'CMCC-ESM2' 'CNRM-ESM2-1' 'EC-Earth3' 'ACCESS-CM2' 'ACCESS-ESM1-5' 'ACCESS-ESM1-5' 'ACCESS-ESM1-5' 'CMCC-ESM2' 'CNRM-CM6-1-HR' 'CNRM-CM6-1-HR' 'EC-Earth3' 'FGOALS-g3' 'GFDL-ESM4' 'GISS-E2-1-G' 'MPI-ESM1-2-LR' 'MRI-ESM2-0' 'NorESM2-MM' 'NorESM2-MM')
member=('r4i1p1f1' 'r6i1p1f1' 'r11i1p1f1' 'r1i1p1f1' 'r1i1p1f1' 'r1i1p1f1' 'r1i1p1f1' 'r4i1p1f1' 'r6i1p1f1' 'r11i1p1f1' 'r1i1p1f1' 'r1i1p1f2' 'r1i1p1f1' 'r2i1p1f1' 'r20i1p1f1' 'r40i1p1f1' 'r6i1p1f1' 'r1i1p1f1' 'r1i1p1f2' 'r1i1p1f2' 'r1i1p1f1' 'r4i1p1f1' 'r1i1p1f1' 'r2i1p1f2' 'r9i1p1f1' 'r1i1p1f1' 'r1i1p1f1' 'r1i1p1f1')
rcm=('BARPA-R' 'BARPA-R' 'BARPA-R' 'BARPA-R' 'BARPA-R' 'BARPA-R' 'BARPA-R' 'CCAM-v2203-SN' 'CCAM-v2203-SN' 'CCAM-v2203-SN' 'CCAM-v2203-SN' 'CCAM-v2203-SN' 'CCAM-v2203-SN' 'CCAMoc-v2112' 'CCAMoc-v2112' 'CCAMoc-v2112' 'CCAM-v2105' 'CCAM-v2105' 'CCAMoc-v2112' 'CCAM-v2112' 'CCAM-v2105' 'CCAM-v2105' 'CCAM-v2105' 'CCAM-v2105' 'CCAM-v2105' 'CCAM-v2105' 'CCAMoc-v2112' 'CCAM-v2112')
ssp=historical
for m in {24..27} ; do
yend=12312330
indir=${dir}/${model[$m]}/${ssp}/${member[$m]}/${rcm[$m]}/v1-r1/1hr/pr/v20240722//
fname=${model[$m]}_${ssp}_${member[$m]}_${agency[$m]}_${rcm[$m]}
for year in {1960..2014} ; do
cdo -b f32 daymax ${indir}/pr_AUS-20i_*${year}${yend}.nc ${odir}/tmp1.nc
cdo -b f32 daysum ${indir}/pr_AUS-20i_*${year}${yend}.nc ${odir}/tmp2.nc
cdo div ${odir}/tmp1.nc ${odir}/tmp2.nc ${odir}/tmp3.nc
cdo remapbil,/g/data/eg3/asp561/Shapefiles/awapgrid ${odir}/tmp3.nc ${odir}/tmp4.nc
cdo setrtoc,1,1e99,1 ${odir}/tmp4.nc ${odir}/tmp5.nc
for method in QME ; do
version=v1-r1-ACS-${method}-AGCD-1960-2022
indir2=${bdir}/${agency[$m]}/${model[$m]}/${ssp}/${member[$m]}/${rcm[$m]}/$version/day/prAdjust/
cdo mul ${odir}/tmp5.nc ${indir2}/prAdjust_AGCD-05i_${fname}_${version}_day_${year}01*.nc ${odir}/tmp6.nc
cdo yearmax ${odir}/tmp6.nc $odir/tmp_RX1H_${version}_${year}.nc
rm $odir/tmp6.nc
done
rm $odir/tmp?.nc
done
for method in QME ; do
version=v1-r1-ACS-${method}-AGCD-1960-2022
cdo mergetime $odir/tmp_RX1H_${version}_*.nc $odir/RX1H_AGCD-05i_${fname}_${version}_annual.nc
done
rm $odir/tmp_RX1H_*.nc
done