3 |
michaesp |
1 |
#!/bin/bash
|
|
|
2 |
#-----------------
|
|
|
3 |
|
|
|
4 |
# -- load netcdf
|
|
|
5 |
module 'load netcdf/4.3.2'
|
|
|
6 |
|
|
|
7 |
# -- set environment
|
|
|
8 |
export LAGRANTO="${HOME}/lagranto.ocean/"
|
|
|
9 |
|
|
|
10 |
# -- set data dir
|
|
|
11 |
ddir="/atmosdyn/schemms/oras5/cdf"
|
|
|
12 |
|
|
|
13 |
# -- experiement data dir
|
|
|
14 |
odir=${ddir}/"2009.2010"
|
|
|
15 |
mkdir -pv $odir
|
|
|
16 |
cd $odir
|
|
|
17 |
find -type l -delete
|
|
|
18 |
|
|
|
19 |
# ---- start date
|
|
|
20 |
date="20091112_00"
|
|
|
21 |
|
|
|
22 |
|
|
|
23 |
# ---- end date
|
|
|
24 |
fdat=$( tim2dat -d +5 $date )
|
|
|
25 |
fdat=$( tim2dat -d +5 $fdat )
|
|
|
26 |
|
|
|
27 |
# --- link bathymetry file
|
|
|
28 |
ln -s ${ddir}/bath .
|
|
|
29 |
|
|
|
30 |
# -- current start date of trajectories
|
|
|
31 |
idat=$date
|
|
|
32 |
|
|
|
33 |
# -- link all necessary fields for time period
|
|
|
34 |
while [[ ${idat} != ${fdat} ]]; do
|
|
|
35 |
|
|
|
36 |
echo $idat
|
|
|
37 |
# -- date of this file
|
|
|
38 |
y=$(echo $idat | cut -c1-4)
|
|
|
39 |
m=$(echo $idat | cut -c5-6)
|
|
|
40 |
d=$(echo $idat | cut -c7-8)
|
|
|
41 |
h=$(echo $idat | cut -c9-10)
|
|
|
42 |
|
|
|
43 |
# -- link start file
|
|
|
44 |
ln -s ${ddir}/P${idat} . &> /dev/null
|
|
|
45 |
ln -s ${ddir}/S${idat} . &> /dev/null
|
|
|
46 |
|
|
|
47 |
# -- go to next time step
|
|
|
48 |
idat=$( tim2dat -d +5 $idat )
|
|
|
49 |
|
|
|
50 |
done
|
|
|
51 |
fdat=$( tim2dat -d -5 $fdat )
|
|
|
52 |
|
|
|
53 |
# ---- create the startfile
|
|
|
54 |
|
|
|
55 |
# -- Examples
|
|
|
56 |
#create_startf.ocean ${date} startf.2 'box.grid(-52,-53,55,55)@profile(0.6,10,20)@m'
|
|
|
57 |
#create_startf.ocean ${date} startf.2 'line(-55,-47,54,59,40)@profile(0.6,10,20)@m'
|
|
|
58 |
|
|
|
59 |
# -- Exp 1: Labrador current
|
|
|
60 |
#create_startf.ocean ${date} startf.2 'circle.grid(-55,55,100)@profile(0.6,10,20)@m'
|
|
|
61 |
|
|
|
62 |
# -- Exp 2: West Greenland current
|
|
|
63 |
#create_startf.ocean ${date} startf.2 'circle.grid(-50,60,100)@profile(0.6,10,20)@m'
|
|
|
64 |
|
|
|
65 |
# -- Exp 3: Labrador Sea deep convection
|
|
|
66 |
#create_startf.ocean ${date} startf.2 'circle.grid(-55,57.5,50)@profile(0.6,10,20)@m'
|
|
|
67 |
|
|
|
68 |
# -- Exp 4: North Labrador Sea turn
|
|
|
69 |
create_startf.ocean ${date} startf.2 'circle.grid(-58,63,50)@profile(0.6,5,10)@m'
|
|
|
70 |
|
|
|
71 |
# --- start calculation and output all 24 hours / computing time steps is 12h instead of 10h
|
|
|
72 |
caltra.ocean ${date} ${fdat} startf.2 traj.1 -j -o 1440
|
|
|
73 |
|
|
|
74 |
# --- Create the Tracevars file ---
|
|
|
75 |
\rm tracevars &> /dev/null
|
|
|
76 |
cat >> tracevars << end_trace
|
|
|
77 |
U 1. 0 Pq
|
|
|
78 |
HFLX 1. 0 S
|
|
|
79 |
end_trace
|
|
|
80 |
|
|
|
81 |
# -- trace some variables
|
|
|
82 |
trace.ocean traj.1 LSL${date}
|
|
|
83 |
|
|
|
84 |
# ---
|
|
|
85 |
find -type l -delete
|
|
|
86 |
|
|
|
87 |
exit 0
|