-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcreate_precip_hourly.sh
executable file
·39 lines (34 loc) · 1.41 KB
/
create_precip_hourly.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
#!/bin/sh
CASE_NAMES="timestep_ctrl"
MONTHS="03 04 05 06 07 08 09 10 11 12"
OUTPUT_DIR=/p/lscratchh/santos36/timestep_precip
times="00000 03600 07200 10800 14400 18000 21600 25200 28800 32400 36000 39600 43200 46800 50400 54000 57600 61200 64800 68400 72000 75600 79200 82800"
for case_name in $CASE_NAMES; do
echo "On case $case_name"
case_dir=/p/lscratchh/santos36/ACME/$case_name/run
for month in $MONTHS; do
date
echo "On month $month."
for time in $times; do
echo "Time $time."
outfile="$OUTPUT_DIR/$case_name.hourly.0003-$month-$time.nc"
ncra -v PRECC,PRECL,PRECSC,PRECSL $case_dir/$case_name.cam.h0.0003-$month-*-$time.nc $outfile
ncks -A -v lat,lon,area /p/lscratchh/santos36/timestep_monthly_avgs/timestep_ctrl.0001-01.nc $outfile
done
done
done
MONTHS="01 02"
for case_name in $CASE_NAMES; do
echo "On case $case_name"
case_dir=/p/lscratchh/santos36/ACME/$case_name/run
for month in $MONTHS; do
date
echo "On month $month."
for time in $times; do
echo "Time $time."
outfile="$OUTPUT_DIR/$case_name.hourly.0004-$month-$time.nc"
ncra -v PRECC,PRECL,PRECSC,PRECSL $case_dir/$case_name.cam.h0.0004-$month-*-$time.nc $outfile
ncks -A -v lat,lon,area /p/lscratchh/santos36/timestep_monthly_avgs/timestep_ctrl.0001-01.nc $outfile
done
done
done