-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathgetFV3GDASensembles
executable file
·92 lines (74 loc) · 2.91 KB
/
getFV3GDASensembles
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#!/bin/ksh
#####################################################
# machine set up (users should change this part)
#####################################################
# For Hera, Jet, Orion
#SBATCH --account=zrtrr
#SBATCH --qos=batch
#SBATCH --ntasks=1
#SBATCH --partition=service ## maxium 23:30 hours
#SBATCH --time=23:00:00
#SBATCH --job-name=get_gdasenkf
#SBATCH -o log.gdasenkf
# For WCOSS2
#PBS -A RRFS-DEV
#PBS -q dev_transfer
#PBS -l select=1:ncpus=1:mem=2G
#PBS -l walltime=06:00:00
#PBS -N get_gdasenkf
#PBS -j oe -o log.gdasenkf
set -ax
module load hpss
mkdir -p enkf/atm
cd enkf/atm
# decide the purpose of pulling the data:
for_ensICs=FALSE # TRUE: pull 6 hour atm and sfc files for ensemble initialization; otherwise, pull 9 hour atm files for GSI hybrid analysis
if [[ ${for_ensICs} == "TRUE" ]]; then
ensize=30
groupsize=3
fhr=6
else
ensize=80
groupsize=8
fhr=9
fi
YYYY=2022
MM=02
for DD in $(seq -w 01 07 ); do
for HH in 00 06 12 18; do
cyc=${YYYY}${MM}${DD}
JDATE=`date -d "${cyc:0:8} $HH" +%y%j%H00`
echo $YYYY $MM $DD $HH $JDATE
HPSSDIR=/NCEPPROD/5year/hpssprod/runhistory/rh${YYYY}/${YYYY}${MM}/${YYYY}${MM}${DD}
#make links
for k in $(seq -w 1 ${ensize} ); do
#ln -sf ./enkfgdas.${YYYY}${MM}${DD}/${HH}/mem0${k}/gdas.t${HH}z.atmf009.nemsio ${JDATE}.gdas.t${HH}z.atmf009s.mem0${k}.nemsio # 2020
ln -sf ./enkfgdas.${YYYY}${MM}${DD}/${HH}/atmos/mem0${k}/gdas.t${HH}z.atmf00${fhr}.nc ${JDATE}.gdas.t${HH}z.atmf00${fhr}.mem0${k}.nc # 2021--now
if [[ ${for_ensICs} == "TRUE" ]]; then
ln -sf ./enkfgdas.${YYYY}${MM}${DD}/${HH}/atmos/mem0${k}/gdas.t${HH}z.sfcf00${fhr}.nc ${JDATE}.gdas.t${HH}z.sfcf00${fhr}.mem0${k}.nc # 2021--now
fi
done
for i in $(seq 1 ${groupsize} ); do
#tarfile=${HPSSDIR}/gpfs_dell1_nco_ops_com_gfs_prod_enkfgdas.${YYYY}${MM}${DD}_${HH}.enkfgdas_grp${i}.tar # 2020 tar file name
tarfile=${HPSSDIR}/com_gfs_prod_enkfgdas.${YYYY}${MM}${DD}_${HH}.enkfgdas_grp${i}.tar # 2021 tar file name
#tarfile=${HPSSDIR}/com_gfs_v16.2_enkfgdas.${YYYY}${MM}${DD}_${HH}.enkfgdas_grp${i}.tar # start from June 27 2022, tar file name
# tarfile=${HPSSDIR}/com_gfs_v16.3_enkfgdas.${YYYY}${MM}${DD}_${HH}.enkfgdas_grp${i}.tar # start from Nov. 29 2022, tar file name
k1=$(( $i * 10 -9 )); k2=$(( $i*10 ))
members=''
for k in $(seq -w $k1 $k2); do
localfile=./enkfgdas.${YYYY}${MM}${DD}/${HH}/atmos/mem0${k}/gdas.t${HH}z.atmf00${fhr}.nc
localfile_sfc=""
if [[ ${for_ensICs} == "TRUE" ]]; then
localfile_sfc=./enkfgdas.${YYYY}${MM}${DD}/${HH}/atmos/mem0${k}/gdas.t${HH}z.sfcf00${fhr}.nc
fi
if [[ ! -s $localfile ]] || [[ -n "$( find $localfile -size -1690M )" ]]; then
members="${members} $localfile ${localfile_sfc}"
fi
done
echo "members = $members "
if [[ -n "${members// /}" ]]; then
htar -xvf $tarfile $members
fi
done
done
done