[~/Sato.Kodama.Manda2015/Time-Height.Diagram/MSM.MGDSST/MSM.profiles.at.Stations]
[am@aofd165]
$ unzip MSM.profiles.at.Stations.zip
$ cd MSM.profiles.at.Stations/
$ cat msmstn.all.run.sh
#/bin/sh
write_config(){
cat << EOF > $config_file
${cruise}
${stn}
${yyyy}
${mm}
${dd}
${hh}
${lon}
${lat}
${MSM_dir}
EOF
}
cruise=MandA2011Leg2
indir=output
outdir=output
prefix=msmstn
config_file=$(basename $0 .sh).config.txt
exe=msmstn.run.sh
log=$(basename $0 .sh).log
date > $log
hostname >> $log
pwd >> $log
whoami >> $log
cat <<EOF >> $log
${cruise}
EOF
#==============================
#
# Time zone is UTC, not JST.
#
#==============================
#
# Set station info.
#
stn=S0
yyyy=2011
mm=05
dd=22
hh=21
lon=127.004
lat=28.0149
MSM_dir=/work4/DATA/MSM/MSM-P/${yyyy}
write_config
$exe -c ${config_file}
cat <<EOF >> $log
${indir}/${prefix}.${cruise}.${stn}.txt
${outdir}/${prefix}.${cruise}.${yyyy:2:2}${mm}${dd}${hh}.meter.grd
EOF
stn=S1
yyyy=2011
mm=05
dd=23
hh=00
lon=127.503
lat=28.7535
MSM_dir=/work4/DATA/MSM/MSM-P/${yyyy}
write_config
$exe -c ${config_file}
cat <<EOF >> $log
${indir}/${prefix}.${cruise}.${stn}.txt
${outdir}/${prefix}.${cruise}.${yyyy:2:2}${mm}${dd}${hh}.meter.grd
EOF
stn=S2
yyyy=2011
mm=05
dd=23
hh=01
lon=127.345
lat=29.1122
MSM_dir=/work4/DATA/MSM/MSM-P/${yyyy}
write_config
$exe -c ${config_file}
cat <<EOF >> $log
${indir}/${prefix}.${cruise}.${stn}.txt
${outdir}/${prefix}.${cruise}.${yyyy:2:2}${mm}${dd}${hh}.meter.grd
EOF
stn=S3
yyyy=2011
mm=05
dd=23
hh=02
lon=127.291
lat=29.3574
MSM_dir=/work4/DATA/MSM/MSM-P/${yyyy}
write_config
$exe -c ${config_file}
cat <<EOF >> $log
${indir}/${prefix}.${cruise}.${stn}.txt
${outdir}/${prefix}.${cruise}.${yyyy:2:2}${mm}${dd}${hh}.meter.grd
EOF
stn=S4
yyyy=2011
mm=05
dd=23
hh=03
lon=127.203
lat=29.5445
MSM_dir=/work4/DATA/MSM/MSM-P/${yyyy}
write_config
$exe -c ${config_file}
cat <<EOF >> $log
${indir}/${prefix}.${cruise}.${stn}.txt
${outdir}/${prefix}.${cruise}.${yyyy:2:2}${mm}${dd}${hh}.meter.grd
EOF
stn=S5
yyyy=2011
mm=05
dd=23
hh=04
lon=127.117
lat=29.7223
MSM_dir=/work4/DATA/MSM/MSM-P/${yyyy}
write_config
$exe -c ${config_file}
cat <<EOF >> $log
${indir}/${prefix}.${cruise}.${stn}.txt
${outdir}/${prefix}.${cruise}.${yyyy:2:2}${mm}${dd}${hh}.meter.grd
EOF
stn=S6
yyyy=2011
mm=05
dd=23
hh=05
lon=127.044
lat=29.8957
MSM_dir=/work4/DATA/MSM/MSM-P/${yyyy}
write_config
$exe -c ${config_file}
cat <<EOF >> $log
${indir}/${prefix}.${cruise}.${stn}.txt
${outdir}/${prefix}.${cruise}.${yyyy:2:2}${mm}${dd}${hh}.meter.grd
EOF
stn=S8
yyyy=2011
mm=05
dd=23
hh=07
lon=127.076
lat=30.1916
MSM_dir=/work4/DATA/MSM/MSM-P/${yyyy}
write_config
$exe -c ${config_file}
cat <<EOF >> $log
${indir}/${prefix}.${cruise}.${stn}.txt
${outdir}/${prefix}.${cruise}.${yyyy:2:2}${mm}${dd}${hh}.meter.grd
EOF
stn=S9
yyyy=2011
mm=05
dd=23
hh=08
lon=127.129
lat=30.3468
MSM_dir=/work4/DATA/MSM/MSM-P/${yyyy}
write_config
$exe -c ${config_file}
cat <<EOF >> $log
${indir}/${prefix}.${cruise}.${stn}.txt
${outdir}/${prefix}.${cruise}.${yyyy:2:2}${mm}${dd}${hh}.meter.grd
EOF
$ cd src
$ make
if [ ! -d ../obj ]; then \
mkdir -p ../obj ; \
fi
ifort -c -CB -traceback -fpe0 -module ../obj -c -o ../obj/module_main.o module_main.f90
ifort -c -CB -traceback -fpe0 -module ../obj -c -o ../obj/module_msms_var.o module_msms_var.f90
ifort -c -CB -traceback -fpe0 -module ../obj -c -o ../obj/module_msmp_var.o module_msmp_var.f90
ifort -c -CB -traceback -fpe0 -module ../obj -c -o ../obj/module_inout.o module_inout.f90
ifort -c -CB -traceback -fpe0 -module ../obj -c -o ../obj/msmstn.o msmstn.f90
ifort -c -CB -traceback -fpe0 -module ../obj -c -o ../obj/read_msms.o read_msms.f90
ifort -c -CB -traceback -fpe0 -module ../obj -c -o ../obj/read_msmp.o read_msmp.f90
ifort -c -CB -traceback -fpe0 -module ../obj -c -o ../obj/interpolate_space.o interpolate_space.f90
ifort -c -CB -traceback -fpe0 -module ../obj -c -o ../obj/bilinear.o bilinear.f90
ifort -c -CB -traceback -fpe0 -module ../obj -c -o ../obj/interpolate_time.o interpolate_time.f90
ifort -c -CB -traceback -fpe0 -module ../obj -c -o ../obj/write_stn.o write_stn.f90
ifort -c -CB -traceback -fpe0 -module ../obj -c -o ../obj/cal_vpt.o cal_vpt.f90
ifort -c -CB -traceback -fpe0 -module ../obj -c -o ../obj/virtual_potential_temperature.o virtual_potential_temperature.f90
ifort -o ../msmstn ../obj/module_main.o ../obj/module_msms_var.o ../obj/module_msmp_var.o ../obj/module_inout.o ../obj/msmstn.o ../obj/read_msms.o ../obj/read_msmp.o ../obj/interpolate_space.o ../obj/bilinear.o ../obj/interpolate_time.o ../obj/write_stn.o ../obj/cal_vpt.o ../obj/virtual_potential_temperature.o -module ../obj -L/usr/local/lib -lnetcdf
real 0m2.090s
user 0m1.575s
sys 0m0.519s
$ cd ..
$ msmstn.all.run.sh
...
... Lots of messages
...
write_stn:
Output: output/msmstn.MandA2011Leg2.S8.txt
Done program msmstn.
$ ls -lh output
合計 36K
-rw-rw-r-- 1 am am 1.2K 3月 2 14:00 msmstn.MandA2011Leg2.S0.txt
-rw-rw-r-- 1 am am 1.2K 3月 2 14:00 msmstn.MandA2011Leg2.S1.txt
-rw-rw-r-- 1 am am 1.2K 3月 2 14:00 msmstn.MandA2011Leg2.S2.txt
-rw-rw-r-- 1 am am 1.2K 3月 2 14:00 msmstn.MandA2011Leg2.S3.txt
-rw-rw-r-- 1 am am 1.2K 3月 2 14:00 msmstn.MandA2011Leg2.S4.txt
-rw-rw-r-- 1 am am 1.2K 3月 2 14:00 msmstn.MandA2011Leg2.S5.txt
-rw-rw-r-- 1 am am 1.2K 3月 2 14:00 msmstn.MandA2011Leg2.S6.txt
-rw-rw-r-- 1 am am 1.2K 3月 2 14:00 msmstn.MandA2011Leg2.S8.txt
-rw-rw-r-- 1 am am 1.2K 3月 2 14:00 msmstn.MandA2011Leg2.S9.txt
$ cd ..
$ ls
MSM.CrossSection.GrADS/ MSM.CrossSection.GrADS.zip MSM.profiles.at.Stations/
$ unzip MSM.CrossSection.GrADS.zip
$ cd MSM.CrossSection.GrADS
$ cd src
$ ls
ept_b80_RH.f90 makefile module_msmp_var.f90 msmcs.f90 read_stn.f90
itp_vp.f90 module_main.f90 module_thermo_vars.f90 out_vp.f90
$ make
if [ ! -d ../obj ]; then \
mkdir -p ../obj ; \
fi
ifort -c -CB -traceback -fpe0 -module ../obj -c -o ../obj/module_main.o module_main.f90
ifort -c -CB -traceback -fpe0 -module ../obj -c -o ../obj/module_msmp_var.o module_msmp_var.f90
ifort -c -CB -traceback -fpe0 -module ../obj -c -o ../obj/module_thermo_vars.o module_thermo_vars.f90
ifort -c -CB -traceback -fpe0 -module ../obj -c -o ../obj/msmcs.o msmcs.f90
ifort -c -CB -traceback -fpe0 -module ../obj -c -o ../obj/read_stn.o read_stn.f90
ifort -c -CB -traceback -fpe0 -module ../obj -c -o ../obj/itp_vp.o itp_vp.f90
ifort -c -CB -traceback -fpe0 -module ../obj -c -o ../obj/out_vp.o out_vp.f90
ifort -c -CB -traceback -fpe0 -module ../obj -c -o ../obj/ept_b80_RH.o ept_b80_RH.f90
ifort -o ../msmcs ../obj/module_main.o ../obj/module_msmp_var.o ../obj/module_thermo_vars.o ../obj/msmcs.o ../obj/read_stn.o ../obj/itp_vp.o ../obj/out_vp.o ../obj/ept_b80_RH.o -module ../obj
real 0m1.269s
user 0m0.922s
sys 0m0.342s
$ cd ..
$ chmod u+x *.sh
$ cat msmcs.run.sh
#!/bin/bash
cruise=MandA2011Leg2
outdir=output
indir=../MSM.profiles.at.Stations/output
no_of_input_files=9
inlist=${cruise}.inlist.txt
ofle=${outdir}/${cruise}.CrossSection.dat
log=${outdir}/${cruise}.CrossSection.log
exe=./msmcs
if [ ! -f $exe ]; then
Error in $0 : No such file, $exe
fi
if [ ! -d $outdir ]; then
mkdir -p $outdir
fi
namelist=$(basename $exe).namelist.txt
cat << END > $inlist
${no_of_input_files}
${indir}/msmstn.MandA2011Leg2.S0.txt
${outdir}/msmstn.MandA2011Leg2.11052221.meter.grd
${indir}/msmstn.MandA2011Leg2.S1.txt
${outdir}/msmstn.MandA2011Leg2.11052300.meter.grd
${indir}/msmstn.MandA2011Leg2.S2.txt
${outdir}/msmstn.MandA2011Leg2.11052301.meter.grd
${indir}/msmstn.MandA2011Leg2.S3.txt
${outdir}/msmstn.MandA2011Leg2.11052302.meter.grd
${indir}/msmstn.MandA2011Leg2.S4.txt
${outdir}/msmstn.MandA2011Leg2.11052303.meter.grd
${indir}/msmstn.MandA2011Leg2.S5.txt
${outdir}/msmstn.MandA2011Leg2.11052304.meter.grd
${indir}/msmstn.MandA2011Leg2.S6.txt
${outdir}/msmstn.MandA2011Leg2.11052305.meter.grd
${indir}/msmstn.MandA2011Leg2.S8.txt
${outdir}/msmstn.MandA2011Leg2.11052307.meter.grd
${indir}/msmstn.MandA2011Leg2.S9.txt
${outdir}/msmstn.MandA2011Leg2.11052308.meter.grd
END
cat << END > $namelist
¶
inlist="${inlist}",
log="${log}",
&end
END
$exe < $namelist
$ ./msmcs.run.sh
...
... Lots of messages
...
Log file: output/MandA2011Leg2.CrossSection.log
Done program msmcs.
$ ls output
$ cat output/*.ctl
dset ^msmstn.MandA2011Leg2.%y2%m2%d2%h2.meter.grd
options template
undef -999.9
xdef 1 linear 0.0 2.5
ydef 1 linear 60.0 2.5
zdef 500 linear 30 30
tdef 300 linear 18z22may2011 1hr
vars 14
h 500 99 Height [m]
v 500 99 N-S Wind Speed [m/s]
u 500 99 E-W Wind Speed [m/s]
wr 500 99 Wind Relative [s]
ws 500 99 Wind Speed [m/s]
p 500 99 Air Pressure [hpa]
t 500 99 Temprature [K]
rh 500 99 Relative humid [%]
pt 500 99 Potential Temprature [K]
wp 500 99 dewpoint Pressure [hpa]
ewo 500 99 equi
dt 500 99 Dewpoint depression [K]
w 500 99 Mixing Ratio [kg/kg]
ept 500 99 Equivalent potential temp [K]
endvars
$ grads -bcp "Check.cross.section.gs"
...
... Lots of messages
...
EPS file written to Check.cross.section.eps
No hardcopy metafile open
GX package terminated
Note: The following warning message(s) can be neglected.
Data Request Warning: Request is completely outside file limits
$ cd ..
$ cd Ship.track
$ ls
20110522.DAT TBL101_to_txt* nagasaki.maru.meteo*
20110522.raw.txt TBL101_to_txt.f90 nagasaki.maru.meteo.f90
20110523.DAT TBL101_to_txt.run.sh* nagasaki.maru.meteo.run.sh*
20110523.raw.txt makefile namelist.nagasaki.maru.meteo
$ make clean; make
rm -rf ../obj/nagasaki.maru.meteo.o ../obj/TBL101_to_txt.o ../obj/*.mod
real 0m0.006s
user 0m0.002s
sys 0m0.005s
if [ ! -d ../obj ]; then \
mkdir -p ../obj ; \
fi
ifort -c -CB -traceback -fpe0 -module ../obj -c -o ../obj/nagasaki.maru.meteo.o nagasaki.maru.meteo.f90
ifort -o nagasaki.maru.meteo ../obj/nagasaki.maru.meteo.o -module ../obj
ifort -c -CB -traceback -fpe0 -module ../obj -c -o ../obj/TBL101_to_txt.o TBL101_to_txt.f90
ifort -o TBL101_to_txt ../obj/TBL101_to_txt.o -module ../obj
$ cat nagasaki.maru.meteo.run.sh
#!/bin/sh
exe=nagasaki.maru.meteo
namelist=namelist.${exe}
indir= #/work2/kunoki/to_manda_sensei/Data/ECS_OBS/Ship_weather
in=20110522.DAT
out=$(basename $in .DAT).raw.txt
cat <<EOF > $namelist
¶
infle="${in}" ! input file
&end
EOF
echo Input: ${indir}/${in}
echo Output: ${out}
$exe < $namelist > $out
exit 0
$ nagasaki.maru.meteo.run.sh
Input: /20110522.DAT
Output: 20110522.raw.txt
$ cat nagasaki.maru.meteo.run.sh
#!/bin/sh
exe=nagasaki.maru.meteo
namelist=namelist.${exe}
indir= #/work2/kunoki/to_manda_sensei/Data/ECS_OBS/Ship_weather
in=20110523.DAT
out=$(basename $in .DAT).raw.txt
cat <<EOF > $namelist
¶
infle="${in}" ! input file
&end
EOF
echo Input: ${indir}/${in}
echo Output: ${out}
$exe < $namelist > $out
exit 0
$ nagasaki.maru.meteo.run.sh
Input: /20110523.DAT
Output: 20110523.raw.txt
$ chmod u+x merge.raw.sh
$ cat merge.raw.sh
#!/bin/bash
inlist="\
20110522.raw.txt \
20110523.raw.txt \
"
out=Manda2011Leg2.Track.txt
i=1
for input in $inlist; do
echo Input: $input
if [ $i -eq 1 ]; then
cat $input > $out
else
awk '{if ($1 !="#") print $0}' $input >>$out
fi
i=$(expr $i + 1)
done
echo
echo Output: $out
echo
exit 0
$ ./merge.raw.sh
Input: 20110522.raw.txt
Input: 20110523.raw.txt
Output: Manda2011Leg2.Track.txt
$ ..
$ cd MGDSST.AlongTrack
$ ls
0.README.txt makefile
bilinear.f90 mgdsst.alongtrack
check_sst.gs mgdsst.alongtrack.f90
check_sst.sh mgdsst.alongtrack.namelist.txt
cp.shiptrack.sh mgdsst.alongtrack.run.sh
interpolate_space.f90 mgdsst_lonlat.f90
interpolate_time.f90 read_mgdsst.f90
lst2utc.f90
$ cp ../Ship.track/Manda2011Leg2.Track.txt .
$ make clean; make
$ chmod u+x *.sh
$ cat mgdsst.alongtrack.run.sh
$ ./mgdsst.alongtrack.run.sh
#!/bin/bash
exe=mgdsst.alongtrack
namelist=${exe}.namelist.txt
infle=Manda2011Leg2.Track.txt
ofle=MGDSST.MandA2011Leg2.track.txt
mgd_dir=/work4/DATA/SST/MGDSST/data/2011/
mgd_prefix=re_mgd_sst_glb_D #mgd_sst_glb_D
mgd_postfix=txt
nlon=1440
nlat=720
slon=0.125
slat=-89.875
dlon=0.25
dlat=0.25
undef=-999.
cat <<EOF >$namelist
¶
infle="$infle",
ofle="$ofle",
mgd_dir="$mgd_dir",
mgd_prefix="$mgd_prefix",
mgd_postfix="$mgd_postfix",
undef=$undef
&end
&grid
nlon=$nlon
nlat=$nlat
slon=$slon
slat=$slat
dlon=$dlon
dlat=$dlat
&end
EOF
${exe} < $namelist
echo "Done $(basename $0)"
echo
$ ./mgdsst.alongtrack.run.sh
...
... Lots of messages
...
$ head -3 MGDSST.MandA2011Leg2.track.txt
# yyyy mo dd hh mi (UTC) lon(d,m) lat(d,m) sst sst1 sst2
2011 05 21 15 00 26. 14.3740 127. 40.7580 296.936 296.752 296.962
2011 05 21 15 01 26. 14.3740 127. 40.7580 296.936 296.752 296.962
$ cd ..
$ cd MSM.Surface.Alongtrack
$ ls
0.README.txt makefile
MSM.MandA2012Leg3.track.txt module_msms_var.f90
MandA2012Leg3.track.txt read_msms.f90
bilinear.f90 sampling.alongtrack
interpolate_space.f90 sampling.alongtrack.f90
interpolate_time.f90 sampling.alongtrack.namelist.txt
lst2utc.f90 sampling.alongtrack.run.sh
$ make
$ cp ../Ship.track/Manda2011Leg2.Track.txt .
$ chmod u+x *.sh
$ cat sampling.alongtrack.run.sh
#!/bin/bash
exe=sampling.alongtrack
namelist=${exe}.namelist.txt
infle=Manda2011Leg2.Track.txt
ofle=MSM.Manda2011Leg2.Track.txt
msm_dir=/work4/DATA/MSM/MSM-S/2011/
msm_postfix=.nc
undef=-999.
cat <<EOF >$namelist
¶
infle="$infle",
ofle="$ofle",
msm_dir="$msm_dir",
msm_postfix="$msm_postfix",
undef=$undef
&end
EOF
${exe} < $namelist
echo "Done $(basename $0)"
echo
$ ./sampling.alongtrack.run.sh
...
... Lots of messages (It takes time)
...
Input : Manda2011Leg2.Track.txt
Output: MSM.Manda2011Leg2.Track.txt
Done sampling.alongtrack.run.sh
$ cd ..
$ cd MSM.Heat.Flux
$ cp ../MSM.Surface.Alongtrack/MSM.Manda2011Leg2.Track.txt .
$ cp ../MGDSST.AlongTrack/MGDSST.MandA2011Leg2.track.txt .
$ make clean;make
rm -rf ./obj/msm_heat_flux.o ./obj/heat_flux_kondo.o ./obj/*.mod
real 0m0.006s
user 0m0.001s
sys 0m0.005s
if [ ! -d ./obj ]; then \
mkdir -p ./obj ; \
fi
ifort -c -CB -traceback -fpe0 -module ./obj -assume byterecl -c -o obj/msm_heat_flux.o msm_heat_flux.f90
ifort -c -CB -traceback -fpe0 -module ./obj -assume byterecl -c -o obj/heat_flux_kondo.o heat_flux_kondo.f90
ifort -o msm_heat_flux ./obj/msm_heat_flux.o ./obj/heat_flux_kondo.o -module ./obj
$ cat msm_heat_flux.run.sh
#!/bin/sh
indir1=.
in1=MSM.Manda2011Leg2.track.txt
indir2=.
in2=MGDSST.Manda2011Leg2.track.txt
hhZddmmmyyyy=15Z21may2011
dt=1mn
input1=${indir1}/${in1}
input2=${indir2}/${in2}
ofle=MSM.Heat.Flux.Manda2011Leg2.track.bin
ctl=MSM.Heat.Flux.Manda2011Leg2.track.ctl
ofle2=MSM.Heat.Flux.Manda2011Leg2.track.txt
temp1=$(basename $input1).temp
temp2=$(basename $input2).temp
awk '{if($1!="#") print $0}' $input1 > $temp1
awk '{if($1!="#") print $0}' $input2 > $temp2
nt1=$(wc -l $temp1 | awk '{print $1}')
nt2=$(wc -l $temp2 | awk '{print $1}')
if [ $nt1 -ne $nt2 ]; then
echo "Error in $0 : nt1 /= nt2"
exit 1
else
nt=$nt1
fi
#infle1=$(basename $in1 .txt).edit.txt
#sed -n '30,2309p' $input1 > $infle1
#infle2=$(basename $in2 .txt).edit.txt
#sed -n '30,2309p' $input2 > $infle2
infle1=$temp1
infle2=$temp2
exe=msm_heat_flux
namelist=${exe}.namelist.txt
cat <<EOF > $namelist
¶
infle1="${infle1}",
infle2="${infle2}",
nt=${nt}
ofle="${ofle}",
ofle2="${ofle2}",
&end
EOF
$exe < $namelist
rm -v $temp1 $temp2
cat <<EOF >$ctl
dset ^${ofle}
options template
undef -999.0
title MSM along track
xdef 1 linear 0.0 2.5
ydef 1 linear 60.0 2.5
zdef 1 linear 1 1
tdef ${nt} linear ${hhZddmmmyyyy} ${dt}
vars 8
sp 1 99 Surface Pressure [hpa]
sst 1 99 Sea Sfc. Temperature [degC]
ta 1 99 Surface Air Temp [degC]
rh 1 99 Relative Humidity [%]
ws 1 99 Wind Speed [m/s]
q 1 99 Specific Humidity [kg/kg]
sh 1 99 Sensible heat flux [w/m2]
lh 1 99 Latent heat flux [w/m2]
endvars
EOF
echo
echo Output: $ofle
echo Ctl file: $ctl
echo
exit 0
$ sh msm_heat_flux.run.sh
...
... Lots of messages
...
Output: MSM.Heat.Flux.Manda2011Leg2.track.bin
Ctl file: MSM.Heat.Flux.Manda2011Leg2.track.ctl
$ export DISPLAY=133.45.210.29:0
$ grads -p
ga-> open MSM.Heat.Flux.Manda2011Leg2.track.ctl
ga-> q file
File 1 : MSM along track
Descriptor: MSM.Heat.Flux.Manda2011Leg2.track.ctl
Binary: MSM.Heat.Flux.Manda2011Leg2.track.bin
Type = Gridded
Xsize = 1 Ysize = 1 Zsize = 1 Tsize = 2880 Esize = 1
Number of Variables = 8
sp 1 99 Surface Pressure [hpa]
sst 1 99 Sea Sfc. Temperature [degC]
ta 1 99 Surface Air Temp [degC]
rh 1 99 Relative Humidity [%]
ws 1 99 Wind Speed [m/s]
q 1 99 Specific Humidity [kg/kg]
sh 1 99 Sensible heat flux [w/m2]
lh 1 99 Latent heat flux [w/m2]
ga-> set t 1 2000
Time values set: 2011:5:21:15 2011:5:23:0
ga-> d sp
ga-> c
ga-> d lh
ga-> c
ga-> d sh
ga-> c
ga-> d q
ga-> c
ga-> d ta
ga-> c
ga-> d sst
ga-> c
ga-> d ws
ga-> quit
$ cd ..
$ cd Plot
$ cat time-height.run.sh
#!/bin/bash
exe=time-height.gs
if [ ! -f $exe ]; then
echo Error in $0 : No such file, $exe
exit 1
fi
opt="-o Time-height_MSM_Manda2011Leg2.eps -q"
grads -bcp "$exe $opt"
echo
echo Done $(basename $0).
echo
$ cat time-height.gs
function msm( args )
#
# Default values
#
out='time-height.eps'
quitflag='false'
*
* Decode options
*
i = 1
while( 1 )
arg = subwrd( args, i )
i = i + 1;
if( arg = '' ); break; endif
while( 1 )
if( arg = '-o' ); out = subwrd(args,i) ;i=i+1; break; endif
if( arg = '-q' ); quitflag='true' ;i=i+1; break; endif
say 'Syntax error : arg= 'arg
return
endwhile
endwhile
'reinit'
'set display color white'
'c'
'set grads off'
#### RGB set ####
'set rgb 20 250 250 250'
'set rgb 21 230 230 230'
'set rgb 22 210 210 210'
'set rgb 23 190 190 190'
'set rgb 24 160 160 160'
'set rgb 25 130 130 130'
'set rgb 26 100 100 100'
'set rgb 27 70 70 70'
'set rgb 28 40 40 40'
#################
'set rgb 31 210 210 210'
'set rgb 32 200 200 200'
'set rgb 33 190 190 190'
'set rgb 34 180 180 180'
'set rgb 35 170 170 170'
'set rgb 36 150 150 150'
'set rgb 37 130 130 130'
'set rgb 38 110 110 110'
'set rgb 39 90 90 90'
'set rgb 40 70 70 70'
'set rgb 41 50 50 50'
'set rgb 42 30 30 30'
##################### a ####################
'open ../MSM.CrossSection.GrADS/output/MandA2011Leg2.ctl'
'set parea 1.3 7.8 8.4 10.2' ;*8.7 10.5'
'set arrlab off'
'set xlopts 1 0 0'
'set time 18z22may2011 08z23may2011'
'set lev 0 3000'
'set ylint 500'
'set gxout grfill'
### F ###
'set clevs 4 6 8 12 14 15 16 17'
'define aa=pow(u,2)'
'define bb=pow(v,2)'
'define cc=pow(aa+bb,0.5)'
'd cc'
# 'run cbarn 0.5 1 7.95 7.3'
'xcbar 8 8.1 8.4 10.2 -fw 0.12 -fh 0.13 -fs 2 -ft 5 -dir v -line on -edge triangle'
### EPT ####
'set gxout contour'
'set cmin -4'
'set cmax 30'
'set cint 1'
'set ccolor 1'
# 'd ept'
############
'set clevs 5 10 15'
'set ccols 1 1 1 2'
'set arrscl 0.5 30'
'set ccolor 0'
'set cthick 20'
'd skip(u,10,1);v'
'set arrscl 0.5 30'
'set ccolor 1'
'set cthick 5'
'd skip(u,10,1);v'
# Legend
'set parea 1.3 7.75 10.995 11'
'set gxout vector'
'set ccolor 2'
'set arrscl 0.5 30 ' ;*20'
'set arrlab on'
'd skip(u,10,10);skip(v,10,10)'
'set strsiz 0.1 0.12'
'set string 1 c 3 0'
'draw string 6.4 10.375 m/s'
'close 1'
##################### a #####################
##################### b #####################
'open ../MSM.CrossSection.GrADS/output/MandA2011Leg2.ctl'
'set arrlab off'
'set parea 1.3 7.8 6.3 8.1'
'set xlopts 1 0 0'
'set time 18z22may2011 08z23may2011'
'set lev 0 3000'
'set ylint 500'
'set gxout grfill'
### EPT ###
'rgbset2'
'set clevs 332 334 336 338 340 342 344'
'd ept'
'xcbar 8 8.1 6.3 8.1 -fw 0.12 -fh 0.13 -fs 2 -ft 5 -dir v -line on -edge triangle'
# http://kodama.fubuki.info/wiki/wiki.cgi/GrADS/script/xcbar.gs?lang=jp
### T ####
'set gxout contour'
'set cmin -4'
'set cmax 30'
'set clab off'
'set cint 1'
'set ccolor 0'
'set cthick 20'
'd t-273.15'
'set cmin -4'
'set cmax 30'
'set cint 1'
'set clab off'
'set ccolor 1'
'set cthick 4'
'd t-273.15'
'set cmin -4'
'set cmax 30'
'set cint 2'
'set clab on'
'set ccolor 1'
'set cthick 4'
'd t-273.15'
'close 1'
##################### b #####################
##################### c ####################
'set parea 1.3 7.8 4.5 6.0'
'open ../MSM.Heat.Flux/MSM.Heat.Flux.Manda2011Leg2.track.ctl'
'set time 18z22may2011 08z23may2011'
'set yflip off'
'set vrange -100 200'
'set ylint 50'
'set ccolor 8'
'set cmark 0'
'set cstyle 1'
'd lh'
'set ccolor 2'
'set cmark 0'
'set cstyle 1'
'd sh'
'set ylpos 0 r'
'set vrange 0 18'
'set ylint 3'
'set ccolor 1'
'set cmark 0'
'd ws'
'close 1'
##################### c ####################
##################### d ####################
'set parea 1.3 7.8 2.7 4.2'
'open ../MSM.Heat.Flux/MSM.Heat.Flux.Manda2011Leg2.track.ctl'
'set xlopts 1 0 0'
'set time 18z22may2011 08z23may2011'
'set vrange 12 32'
'set ylint 4'
# 'set ccolor 2'
# 'set cmark 0'
# 'set cthick 6'
# 'set cstyle 5'
# 'd qs*1000'
# 'set ccolor 4'
# 'set cmark 0'
# 'set cthick 6'
# 'set cstyle 5'
# 'd q*1000'
'set ylpos 0 l'
'set vrange 18 28'
'set ylint 2'
'set cthick 5'
'set ccolor 2'
'set cmark 0'
'set cstyle 1'
'd sst'
'set ccolor 4'
'set cmark 0'
'set cstyle 1'
'd ta'
'close 1'
##################### d ####################
##################
'set string 1.2 l 5 0'
'set strsiz 0.17 0.17'
'draw string 0.2 10.2 (a)' ;*EPT and Air Temp.'
'draw string 0.2 8.1 (b)' ;* Horizontal wind'
'draw string 0.2 6.0 (c)' ;* Wind speed, LHF and SFH'
'draw string 0.2 4.1 (d)' ;* SST and SAT' ;*, q `bsst`n(g/kg), q`bTs`n(g/kg)'
'set strsiz 0.15 0.15'
'set string 1.2 c 5 90'
'draw string 0.65 9.5 [m]'
'draw string 0.65 7.4 [m]'
'draw string 0.65 5.3 [W/m`a2`n]'
'draw string 8.25 5.35 [m/s]'
'draw string 0.65 3.5 [`ao`nC]'
'set string 1.2 c 5 0'
'set strsiz 0.12 0.15'
'draw string 2.7 2.5 S0'
'draw string 4.1 2.5 S1'
'draw string 4.55 2.5 S2'
'draw string 5.0 2.5 S3'
'draw string 5.45 2.5 S4'
'draw string 5.95 2.5 S5'
'draw string 6.4 2.5 S6'
'draw string 6.9 2.5 S7'
'draw string 7.35 2.5 S8'
'draw string 7.8 2.5 S9'
'set strsiz 0.12 0.15'
'draw string 1.3 2.2 18UTC/22'
'draw string 2.7 2.2 21UTC'
'draw string 4.1 2.2 00UTC/23'
'draw string 5.5 2.2 03UTC'
'draw string 6.9 2.2 06UTC'
###### color bar label ######
'set strsiz 0.1 0.1'
'draw string 8.2 10.35 [m/s]'
'draw string 8.23 8.25 [K]'
# 'draw string 8.15 4.2 [g/kg]'
###### color bar label ######
###### c label ######
'set strsiz 0.1 0.1'
'set string 1'
'draw string 7.05 5.7 Ws [m/s]'
'set string 8'
'draw string 7.05 5.5 LHF [W/m`a2`n]'
'set string 2'
'draw string 7.05 5.3 SHF [W/m`a2`n]'
'set line 1'
'draw line 5.9 5.7 6.4 5.7'
'set line 8'
'draw line 5.9 5.5 6.4 5.5'
'set line 2'
'draw line 5.9 5.3 6.4 5.3'
###### c label ######
###### d label ######
'set strsiz 0.1 0.1'
'set string 2'
'draw string 6.7 3.8 SST' ;* [`ao`nC]'
'set string 4'
'draw string 6.7 3.6 SAT' ;* [`ao`nC]'
'set line 2'
'draw line 6 3.8 6.5 3.8'
'set line 4'
'draw line 6 3.6 6.5 3.6'
###### d label ######
'print 'out
if (quitflag='true')
quit
endif
return
$ time-height.run.sh