Subversion Repositories lagranto.um

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
16 michaesp 1
#!/bin/sh
2
if [ $# = 0 ];then
3
echo "ppconvert.sh YYYYMMDD inputppfile"
4
echo
5
echo "Output will be in folder JOBIDYYYYMMDD"
6
echo "inputppfile should include full path"
7
echo
8
echo "NOTE: Ensure this dimensions of your UM files are correct in"
9
echo "      ${LAGRANTO}/ppconvert/um_dims.inc & pp2cdf.f"
10
echo "Changes will require recompiling this component of lagranto"
11
exit 1
12
fi
13
callingdir=`pwd`
14
#cd ${LAGRANTO}/ppconvert
15
YMD=$1
16
DFILE=$2
17
# set the following 8 parameters
18
JOBYYYY=`echo $YMD | cut -c 1-4` # set jobref Year YYYY
19
JOBYY=`echo $YMD | cut -c 3-4`
20
JOBMM=`echo $YMD | cut -c 5-6` # set jobref Month MM
21
JOBDD=`echo $YMD | cut -c 7-8` # set jobref Day DD
22
CONSTS_FILE=${JOBYYYY}${JOBMM}${JOBDD}_cst
23
DTYPE=USER          # set to LAM or UKMM or USER for data type
24
 
25
#TSTASH=4004                 # set Stash code of T field in $DFILE
26
TSTASH=90002                # set Stash code of T field in $DFILE
27
#QSTASH=4010                 # set Stash code of Q field in $DFILE
28
QSTASH=90077                # set Stash code of Q field in $DFILE
29
PSTASH=409                  # set Stash code of PS field in $DFILE
30
#PSTASH=90120
31
Pmin=1000.0                 # set Stash code of PS field in $DFILE
32
Pmax=160.0                  # set Stash code of PS field in $DFILE
33
Pdiff=15.0                  # set Stash code of PS field in $DFILE
34
NewDyn=.TRUE.               # set to true for New Dynamics code
35
IGNORET0=1                  # set to 1 to ignore T+0 data
36
 
37
# set USER_EXEC if DTYPE=USER
38
USER_EXEC=${LAGRANTO}/ppconvert/pp2cdf
39
# USER_EXEC=pp2cdf
40
# N.B Do not change following creation of fort.15
41
 
42
#fort.15 is a input file in the above executable file.
43
# any changes made for the following creation will changs made 
44
#for the input statement in it
45
 
46
JOBREF=${JOBYYYY}${JOBMM}${JOBDD}
47
cat > fort.15 << EOF
48
$DFILE
49
P${JOBREF}_
50
yes
51
$CONSTS_FILE
52
1.0e+30
53
$TSTASH
54
$QSTASH
55
$PSTASH
56
$Pmin
57
$Pmax
58
$Pdiff
59
$NewDyn
60
$IGNORET0
61
EOF
62
#$PSTASH
63
#$Pmin
64
#$Pmax
65
#$Pdiff
66
 
67
if [ "$DTYPE" = "LAM" ]
68
then
69
  $LAGRANTO/ppconvert/ppf2cdf_lam.x          # LAM data converter
70
elif [ "$DTYPE" = "UKMM" ]
71
then
72
  $LAGRANTO/ppconvert/ppf2cdf_ukmm_new.x         # UKMM data converter
73
elif [ "$DTYPE" = "USER" ]
74
then
75
  $USER_EXEC                                  # USER data converter
76
else
77
  echo "Data type: $DTYPE not recognised - Exiting"
78
#  exit(1)
79
fi
80
#rm -f $DFILE
81
 
82
# N.B use only year and month for filter as could go into next day
83
list=`ls P${JOBYYYY}${JOBMM}*`
84
# now create the S-files
85
for file in $list
86
do
87
  $LAGRANTO/ppconvert/p2s.csh $file 1
88
  #p2s.csh $file 5
89
done
90
 
91
# edit here if you want to move files
92
chmod g+r P${JOBREF}*
93
chmod g+r S${JOBREF}*
94
#mv P${JOBREF}* $TRAJ_HOME/traj/jan97/.
95
#mv S${JOBREF}* $TRAJ_HOME/traj/jan97/.
96
#mv $CONSTS_FILE $TRAJ_HOME/traj/jan97/.
97
 
98
cd $callingdir
99
 
100
exit 0