-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRun_GEFS_ECMWF_LFT.bash
More file actions
executable file
·124 lines (94 loc) · 4.33 KB
/
Run_GEFS_ECMWF_LFT.bash
File metadata and controls
executable file
·124 lines (94 loc) · 4.33 KB
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
#!/bin/bash
date=`date`
echo "Starting AT "$date
lag=7
yyyy=`date -d '-'$lag' hours' -u +%Y`
mm=`date -d '-'$lag' hours' -u +%m`
dd=`date -d '-'$lag' hours' -u +%d`
hh=`date -d '-'$lag' hours' -u +%H`
mkdir "/data/downloaded/Forecasts/ARPortal_Archive/ECMWF/ensemble/landfall_images/"$yyyy$mm$dd$hh
mkdir "/data/downloaded/Forecasts/ARPortal_Archive/ECMWF/ensemble/landfall_images/"$yyyy$mm$dd$hh"/US-west/"
mkdir "/data/downloaded/Forecasts/ARPortal_Archive/ECMWF/ensemble/landfall_images/"$yyyy$mm$dd$hh"/SAK/"
mkdir "/data/downloaded/Forecasts/ARPortal_Archive/ECMWF/ensemble/landfall_images/"$yyyy$mm$dd$hh"/AK"
rm -f /data/projects/operations/LandfallTools/figs/US-west/ECMWF-GEFS_LandfallTool*current.png
rm -f /data/projects/operations/LandfallTools/figs/AK/ECMWF-GEFS_LandfallTool*current.png
rm -f /data/projects/operations/LandfallTools/figs/SAK/ECMWF-GEFS_LandfallTool*current.png
cd /data/projects/operations/LandfallTools/ar_landfall_tool/
filename="/data/projects/derived_products/ECMWF_IVT/Ensemble/IVT_EC_"$yyyy$mm$dd$hh".nc"
while true; do
if [[ -e "$filename" ]]; then # Check if the file exists
filesize1=$(stat --format="%s" "$filename") # Get the file size
sleep 5 # Wait a few seconds
filesize2=$(stat --format="%s" "$filename") # Get the file size again
if [[ "$filesize1" == "$filesize2" ]]; then # Compare file sizes
break # Exit the loop if file size is not changing
else
echo $filename" is still being written (file size is changing)."
sleep 30
fi
else
echo $filename" does not exist."
sleep 30
fi
done
echo $filename" ready for processing"
filename="/data/projects/derived_products/GEFS_IVT/data/GEFS_IVT_"$yyyy$mm$dd$hh".nc"
while true; do
if [[ -e "$filename" ]]; then # Check if the file exists
filesize1=$(stat --format="%s" "$filename") # Get the file size
sleep 5 # Wait a few seconds
filesize2=$(stat --format="%s" "$filename") # Get the file size again
if [[ "$filesize1" == "$filesize2" ]]; then # Compare file sizes
break # Exit the loop if file size is not changing
else
echo $filename" is still being written (file size is changing)."
sleep 30
fi
else
echo $filename" does not exist."
sleep 30
fi
done
echo $filename" ready for processing"
date=`date`
echo "STARTING MAKING LFTs at "$date
apptainer exec -e --bind /data:/data /data/projects/operations/LandfallTools/ar_landfall_tool/envs/ar_landfall_tool.2025.12.12.sif python /data/projects/operations/LandfallTools/ar_landfall_tool/run_tool.py "ECMWF-GEFS" "$yyyy$mm$dd$hh"
cd /data/projects/operations/LandfallTools/figs/US-west
check=1
while [ $check != 0 ]; do
timeout 120 rsync --ignore-missing-args -avih ECMWF-GEFS_LandfallTool*current.png /data/projects/website/mirror/htdocs/images/ECMWF/ensemble/LandfallTool/US-west/
check=$?
if [ $check != 0 ]; then
echo "Transfer failed"
sleep 10
fi
done
cd /data/projects/operations/LandfallTools/figs/AK/
check=1
while [ $check != 0 ]; do
timeout 120 rsync --ignore-missing-args -avih ECMWF-GEFS_LandfallTool*current.png /data/projects/website/mirror/htdocs/images/ECMWF/ensemble/LandfallTool/AK/
check=$?
if [ $check != 0 ]; then
echo "Transfer failed"
sleep 10
fi
done
cd /data/projects/operations/LandfallTools/figs/SAK/
check=1
while [ $check != 0 ]; do
timeout 120 rsync --ignore-missing-args -avih ECMWF-GEFS_LandfallTool*current.png /data/projects/website/mirror/htdocs/images/ECMWF/ensemble/LandfallTool/SAK/
check=$?
if [ $check != 0 ]; then
echo "Transfer failed"
sleep 10
fi
done
cd /data/projects/operations/LandfallTools/figs/US-west
mv "ECMWF-GEFS_LandfallTool"*$yyyy$mm$dd$hh".png" "/data/downloaded/Forecasts/ARPortal_Archive/ECMWF/ensemble/landfall_images/"$yyyy$mm$dd$hh"/US-west/"
cd /data/projects/operations/LandfallTools/figs/AK
mv "ECMWF-GEFS_LandfallTool"*$yyyy$mm$dd$hh".png" "/data/downloaded/Forecasts/ARPortal_Archive/ECMWF/ensemble/landfall_images/"$yyyy$mm$dd$hh"/AK/"
cd /data/projects/operations/LandfallTools/figs/SAK
mv "ECMWF-GEFS_LandfallTool"*$yyyy$mm$dd$hh".png" "/data/downloaded/Forecasts/ARPortal_Archive/ECMWF/ensemble/landfall_images/"$yyyy$mm$dd$hh"/SAK/"
date=`date`
echo "Finished at "$date
exit