Subversion Repositories lagranto.um

Rev

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