-
Notifications
You must be signed in to change notification settings - Fork 0
/
remap_for_aurora
executable file
·35 lines (26 loc) · 1 KB
/
remap_for_aurora
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
#!/bin/bash
set -evx
varname=$1
infile=$2
infile_start=${infile/.nc/}
remap_target_coarse=${CENTER}/SNAP/low_res_target_aurora_nc3.nc
#remap_target_fine=${CENTER}/SNAP/high_res_target_aurora_nc3.nc VIEL ZU GROSS
remap_target_fine=${CENTER}/SNAP/temp_bil_final_timestep1_for_remapping.nc
region="-d x,1055934.,1169934. -d y,1085595.,1215595."
ncks -O $region ${infile} cropped.nc
cdo -f nc -setmissval,-9999 -remapcon,${remap_target_coarse} cropped.nc ${infile_start}_coarse.nc
ncks -A -v x,y ${remap_target_coarse} ${infile_start}_coarse.nc
cdo -f nc -setmissval,-9999 -remapbil,${remap_target_fine} cropped.nc ${infile_start}_fine.nc
ncks -A -v x,y ${remap_target_fine} ${infile_start}_fine.nc
for y in ${infile_start}_coarse.nc ${infile_start}_fine.nc ; do #
start=${y/.nc/}
cdo -splityear $y ${start}_
for x in ${start}_????.nc ; do
echo $x
cdo -splitmon $x ${x/.nc/_}
done
for x in ${start}_????_??.nc ; do
ncks -A -v x,y ${y} $x
nc_to_ascii -v $varname $x
done
done