/work1/am/2015.ECS.Convection.Sato.Manda/Time-Height.Diagram
下記のようなテキストファイルを野帳から自分で作成する。JSTは日本標準時の意味。緯度、経度の単位に秒は使用しない。緯度・経度の1分より小さい値は小数点を使って表す(船での表記法と同じ)。
$ cat Manda2011Leg2_Filename_Time_Location.txt
# /work1/am/Sato.Kodama.Manda2015/Time-Height.Diagram/Sonde.Time-height.UTC/Field.Note
# 327.xls
#
# stn. Time [JST] Lat [dd mm.mmm] Lon [dd mm.mmm] Filename
sonde1 2011/5/22 16:18:49 26 49.475 N 126 55.244 E
sonde2 2011/5/23 01:04:37 28 0.893 N 127 0.215 E
sonde 2011/5/23 05:58:01 28 45.208 N 127 30.199 E
sonde4 2011/5/23 08:27:20 29 5.792 N 127 21.156 E
sonde5 2011/5/23 10:24:13 29 21.446 N 127 17.45 E
sonde6 2011/5/23 11:24:46 29 32.67 N 127 12.169 E
sonde7 2011/5/23 12:25:12 29 43.336 N 127 7 E
sonde8 2011/5/23 13:24:54 29 53.742 N 127 2.645 E
sonde9 2011/5/23 14:17:58 30 1.32 N 127 0.797 E
sonde10 2011/5/23 15:26:15 30 11.499 N 127 4.546 E
sonde11 2011/5/23 16:27:45 30 20.807 N 127 7.732 E
sonde12-2 2011/5/23 17:45:43 30 32.817 N 127 11.672 E
sonde13-2 2011/5/23 23:30:41 31 18.071 N 127 28.659 E
Filenameの欄は後で追加してもよい。
$ chmod u+x *.sh
$ ./check_location.sh Manda2011Leg2_Filename_Time_Location.txt
Bash script ./check_location.sh starts.
Input : Manda2011Leg2_Filename_Time_Location.txt
Output : ./Manda2011Leg2_Filename_Time_Location.ps
pstext: Record 6 is incomplete (skipped)
Done ./check_location.sh
余分なデータを取り除いておく。
CSVファイルのコピー
$ cat cp.meisei.csv.sh
#!/bin/sh
indir=input
inlist=$(ls $indir)
outdir=Input.Edit
mkdir -vp $outdir
for input in $inlist; do
out=$(basename $input .CSV).edit.CSV
cp -v ${indir}/$input ${outdir}/$out
done
$ chmod u+x *.sh
$ ./cp.meisei.csv.sh
編集前のCSVファイルの例(F2011052305S7006639.edit.CSV)
(上の画像はクリックすると拡大する)
一行目の2列目にゾンデのシリアル番号(この場合7006639)
一行目の5, 6列目に観測開始日時(Balloon Releaseボタンを押した時刻)
が書いてあるので、野帳の番号とあっているか確認してから作業を行う。
放球時刻、時刻(ObsTime)、高度(Height)に注意する。野帳と比較しながら、放球前、測定終了後などの余分なデータを取り除いておく。これは手作業で行う。
編集後のファイルの例(ファイルの先頭)
」
編集後のファイルの例(ファイルの末尾)
観測点情報ファイルにファイル名が記載されていない場合、ここで追加する。
$ cat Manda2011Leg2_Filename_Time_Location.txt
# /work1/am/Sato.Kodama.Manda2015/Time-Height.Diagram/Sonde.Time-height.UTC/Field.Note
# 327.xls
#
# stn. Time [JST] Lat [dd mm.mmm] Lon [dd mm.mmm] Filename
sonde2 2011/5/23 1:04:37 28 0.893 N 127 0.215 E F2011052301S7006639.edit.CSV
sonde 2011/5/23 5:58:01 28 45.208 N 127 30.199 E F2011052305S7006642.edit.CSV
sonde4 2011/5/23 8:44:43 29 5.792 N 127 21.156 E F2011052308S7006641.edit.CSV
sonde5 2011/5/23 10:24:13 29 21.446 N 127 17.45 E F2011052310S7007210.edit.CSV
sonde6 2011/5/23 11:24:46 29 32.67 N 127 12.169 E F2011052311S7007213.edit.CSV
sonde7 2011/5/23 12:25:12 29 43.336 N 127 7 E F2011052312S7007207.edit.CSV
sonde8 2011/5/23 13:24:54 29 53.742 N 127 2.645 E F2011052313S7006671.edit.CSV
sonde9 2011/5/23 14:17:58 30 1.32 N 127 0.797 E F2011052314S7007208.edit.CSV
sonde10 2011/5/23 15:26:15 30 11.499 N 127 4.546 E F2011052315S7006675.edit.CSV
sonde11 2011/5/23 16:27:45 30 20.807 N 127 7.732 E F2011052316S7006678.edit.CSV
sonde12-2 2011/5/23 17:45:43 30 32.817 N 127 11.672 E F2011052317S7006677.edit.CSV
$ chmod u+x *.sh
$ cat proc.meisei.run.sh
#!/bin/bash
# Description:
#
# Author: AM
#
# Host: aofd165.fish.nagasaki-u.ac.jp
# Directory: /work2/kunoki/to_manda_sensei/Tools/Sonde.AM
#
# Revision history:
# This file is created by /usr/local/mybin/nbscr.sh at 10:07 on 06-05-2014.
cruise=MandA2011Leg2
list_out=${cruise}.list.dat
indir=Input.Edit
outdir=proc
mkdir -vp $outdir
info=${cruise}.Info.input.file.txt
awk <<EOF '{if ($1 !="#") print $0}' >$info
# Edited meisei csv file yyyy mm dd hh [UTC]
F2011052301S7006639.edit.CSV 2011 05 22 16
F2011052305S7006642.edit.CSV 2011 05 22 21
F2011052308S7006641.edit.CSV 2011 05 23 00
F2011052310S7007210.edit.CSV 2011 05 23 01
F2011052311S7007213.edit.CSV 2011 05 23 02
F2011052312S7007207.edit.CSV 2011 05 23 03
F2011052313S7006671.edit.CSV 2011 05 23 04
F2011052314S7007208.edit.CSV 2011 05 23 05
F2011052315S7006675.edit.CSV 2011 05 23 06
F2011052316S7006678.edit.CSV 2011 05 23 07
F2011052317S7006677.edit.CSV 2011 05 23 08
EOF
exe=proc.meisei.sh
if [ ! -f $exe ]; then
echo Error in $0 : No such file, $exe
exit 1
fi
echo "# ${cruise}" > ${list_out}
i=1
while read BUF ; do
ary=(`echo $BUF`) # 配列に格納
input=${ary[0]}
yyyy=${ary[1]}
mm=${ary[2]}
dd=${ary[3]}
hh=${ary[4]}
yyyymmddhh=${yyyy}${mm}${dd}${hh}
output=$(printf %03d $i).dat
#
# SMOOTHING AND RESAMPLING SONDE DATA
#
in=$indir/$input
out=$outdir/$output
${exe} $in $out
echo "Input: ${input} Output: ${out}"
i=$(expr $i + 1)
if [ -f $out ]; then
lines=$(wc -l $out |awk '{printf "%05d", $1}' )
echo "${in} ${out} ${lines} ${cruise}.${yyyymmddhh}.grd" >> ${list_out}
else
echo Error in $input
fi
done < ${info}
echo
echo File list: $list_out
echo
exit 0
proc.meisei.sh
#!/bin/bash
# Description:
#
# Author: AM
#
# 明星ゾンデデータ整理
#
#
# Host: aofd165.fish.nagasaki-u.ac.jp
# Directory: /work2/kunoki/to_manda_sensei/Tools
#
# Revision history:
# This file is created by /usr/local/mybin/nbscr.sh at 10:00 on 06-05-2014.
# Default values
z0=30 # [m]
dz=30 # [m]
if [ $# -ne 2 ]; then
echo Error in $0 : Wrong number of arugments
echo Usage: $0 input output
exit 1
fi
in=$1
out=$2
# awk : 必要なデータの抜き出し
# $12=高度 $10=風向 $11=風速 $21=気圧 $22=気温 $23=湿度
#
# sort: 並べ替え
# filter1d: 平滑化
# Using height as a vertical coordinate
awk 'BEGIN{FS=","}{if (NR>7) print $12,$10,$11,$21,$22,$23}' $in|\
sort -n | \
filter1d -Fb${dz} -T${z0}/15000/${dz} -N6/0 > $out
# Using pressure as a vertical coordinate
#awk 'BEGIN{FS=","}{if (NR>7) print $21,$10,$11,$12,$22,$23}' $in|\
#sort -n |\
#filter1d -Fb5 -T100/1020/5 -N6/0 > $out
$ ./proc.meisei.run.sh
Input: F2011052301S7006639.edit.CSV Output: proc/001.dat
Input: F2011052305S7006642.edit.CSV Output: proc/002.dat
Input: F2011052308S7006641.edit.CSV Output: proc/003.dat
Input: F2011052310S7007210.edit.CSV Output: proc/004.dat
Input: F2011052311S7007213.edit.CSV Output: proc/005.dat
Input: F2011052312S7007207.edit.CSV Output: proc/006.dat
Input: F2011052313S7006671.edit.CSV Output: proc/007.dat
Input: F2011052314S7007208.edit.CSV Output: proc/008.dat
Input: F2011052315S7006675.edit.CSV Output: proc/009.dat
Input: F2011052316S7006678.edit.CSV Output: proc/010.dat
Input: F2011052317S7006677.edit.CSV Output: proc/011.dat
File list: MandA2011Leg2.list.dat
熱力学的量(温位、相当温位、仮温位など)と各風速成分を計算する
$ cat sonde.meisei.analysis.f90
! Input data
! 1高度(m) 2風向(度;方位角) 3風速(m/s) 4気圧(hPa) 5気温(degC) 6相対湿度(%)
parameter(L=2490,P=3.1415926536*2.0)
integer,parameter::outvar=15
real x(outvar,500)
integer n
character csv*50,in*50,out*150,outdir*100
character(len=150)::list,fmt
namelist /para/nt,list,fmt,outdir
read(5,nml=para)
print *,list
open(1,file=list,action="read")
read(1,*) !Skip comment line
do 1 it=1,nt !time loop
read(1,fmt) csv,in,n,out
print *,trim(in),n,trim(out)
do i=1,500
do j=1,outvar
x(j,i)=-999.9
enddo
enddo
open(2,file=in,action="read")
open(3,file=trim(outdir)//"/"//out, &
access="direct",form="unformatted",recl=4*outvar*500)
do 10 i=1,n !height loop
read(2,*) (x(j,i),j=1,6)
if(-100.lt.x(5,i).and.x(5,i).le.100) then
if(0.lt.x(4,i).and.x(4,i).lt.1100) then
! 温位
x(7,i)=(x(5,i)+273.15)*(1000/x(4,i))**0.2859
! 飽和水蒸気圧 気温は摂氏 (Tetens, 1930)
x(8,i)=6.11*10**((7.5*x(5,i))/(237.3+x(5,i)))
endif
end if
if(0.lt.x(6,i).and.x(6,i).le.101) then
if(0.lt.x(4,i).and.x(4,i).lt.1100) then
if(-999.ne.x(7,i).and.x(8,i).ne.-999) then
! 水蒸気圧
x(9,i)=x(6,i)*x(8,i)/100
! 露点温度
x(10,i)=273.2/(1-273.2*0.0001844*log(x(9,i)/6.11))-273.15
! 混合比
x(11,i)=0.622*x(9,i)/(x(4,i)-x(9,i))
! 相当温位
! x(12,i)=x(7,i)*exp((x(11,i)*L)/(x(10,i)+273.15))
tk=x(5,i)+273.15 !K
pha=x(4,i) !hPa
rh=x(6,i) !%
call ept_bolton80_RH(ept, tk, pha, rh)
x(12,i)=ept !K
! 仮温位
call virtual_potential_temperature(vpt, tk, pha, rh)
x(13,i)=vpt
! x(13,i)=x(7,i)*(1.0+0.61*x(11,i))
endif
endif
endif
if(0.le.x(2,i).and.x(2,i).le.360) then
if(0.le.x(3,i).and.x(3,i).le.100) then
x(14,i)=-(x(3,i)*cos(P*x(2,i)/360))
x(15,i)=-(x(3,i)*sin(P*x(2,i)/360))
endif
endif
10 continue !n
close(2)
write(3,rec=1) &
(x(1,j),j=1,500), &
(x(2,j),j=1,500), &
(x(3,j),j=1,500), &
(x(4,j),j=1,500), &
(x(5,j),j=1,500), &
(x(6,j),j=1,500), &
(x(7,j),j=1,500), &
(x(8,j),j=1,500), &
(x(9,j),j=1,500), &
(x(10,j),j=1,500), &
(x(11,j),j=1,500), &
(x(12,j),j=1,500), &
(x(13,j),j=1,500), &
(x(14,j),j=1,500), &
(x(15,j),j=1,500)
close(3)
write(*,*) (x(14,j),j=1,10), &
(x(15,j),j=1,10)
1 continue !it
print *,outvar
write(*,'(A)')''
write(*,'(A)')'Output data'
write(*,'(A)')'x(1,:) h 500 99 Height [m]'
write(*,'(A)')'x(2,:) wr 500 99 Wind dir.(azimuth) [deg]'
write(*,'(A)')'x(3,:) ws 500 99 Wind Speed [m/s]'
write(*,'(A)')'x(4,:) p 500 99 Air Pressure [hpa]'
write(*,'(A)')'x(5,:) t 500 99 Temprature [K]'
write(*,'(A)')'x(6,:) rh 500 99 Relative humid [%]'
write(*,'(A)')'x(7,:) pt 500 99 Potential Temprature [K]'
write(*,'(A)')'x(8,:) vps 500 99 saturated vapor pr.[hPa]'
write(*,'(A)')'x(9,:) vp 500 99 vapor pressure [hPa]'
write(*,'(A)')'x(10,:) dt 500 99 dewpoint temp. [degC]'
write(*,'(A)')'x(11,:) w 500 99 Mixing Ratio [kg/kg]'
write(*,'(A)')'x(12,:) ept 500 99 Equiv. pot. temp. [K]'
write(*,'(A)')'x(13,:) vpt 500 99 Virtual pot. temp. [K]'
write(*,'(A)')'x(14,:) v 500 99 N-S Wind Speed [m/s]'
write(*,'(A)')'x(15,:) u 500 99 E-W Wind Speed [m/s]'
write(*,'(A)')''
stop
end
subroutine ept_bolton80_RH(ept, tk, p, RH)
! Author: am
! Revision history:
! This file is created by /usr/local/mybin/nff.sh at 11:29 on 11-02-2012.
!
! References:
! Bolton, D., 1980: The computation of equivalent potential
! Temperature, Monthly Weather Review, 108, 1046-1053.
! url: http://www.rsmas.miami.edu/users/pzuidema/Bolton.pdf
!
! "The most accurate formula to data is from Bolton (1980).
! It computes EPT to accuracy, relative to numerical
! solutions of the governing equation, better than 0.02 K."
! Davies-Jones (MWR, 2009)
implicit none
real,intent(out)::ept
! ept: equivalent potential temperature (kelvin)
real,intent(in)::tk,p,RH
! tk: absolute temperature (kelvin)
! p : pressure (hPa)
! RH : relative humidity (%)
real r,u,td
! r : water-vapor mixing ratio (g/kg)
! u : relative humidity (%)
real,parameter::p0=1000.0
! p0: pressue (hPa)
! Shimizus
real,parameter::L=2.5*1.e6
real,parameter::Rv=461.0
! L : latent heat
! Rv: gas constant
real tl, e
! tl: Absolute temperature at lifting condensation level (LCL)
! (kelvin)
! e: water vapor pressure (hPa)
real pt
! pt : potential temparature
real pow,arg1,arg2,exp1, denom
real A, es
real numer, C !
u=RH
denom=1.0/(tk - 55.0) - log(u/100.0)/2840.0
tl = 1.0/denom + 55.0
A = (tk- 273.2)/(273.2*tk)
es = 6.11*exp(A*L/Rv)
e = u * es * 0.01
r = (0.622 * e/ (p - e))*1.E3 ! mixing ratio g/kg
pow=0.2854*(1.0 - 0.28*0.001*r)
! Eq.(43) of B80.
arg1 = 3.376/tl - 0.00254
arg2 = r*(1.0 + 0.81 * 1.0E-3*r)
exp1=exp( arg1 * arg2 )
pt=tk*(p0/p)**pow
ept=tk*(p0/p)**pow * exp1
! Eq. (6.3) of Davies-Jones (MWR, 2009)
! numer = (2.771*1.E6 - 1109.0*(tl - 273.15))*r*1.E-3
! denom = 1005.7*tl
! ept=pt*exp(numer/denom)
! Eq. (2.5) of Davies-Jones (MWR, 2009)
! ept = pt*exp((2.690*1.E6 * 1.0E-3 * r)/(1005.7*tl) )
! write(*,'(a)')'Done subroutine ept_b80.'
! write(*,*)
end subroutine ept_bolton80_RH
subroutine virtual_potential_temperature(vpt, tk, p, rh)
!
implicit none
real,intent(out)::vpt
! pt: virtual potential temperature (kelvin)
real,intent(in)::tk,p,rh
! tk: absolute temperature (kelvin)
! p : pressure (hPa)
! rh: Relative Humidity (%)
real,parameter:: kappa=287.0/1004.0
! Rd=287 J K-1 kg-1
! Cp=1004 J K-1 kg-1
real,parameter::p0=1000.0
! p0: pressue (hPa)
real pt !Potential Temp.
real tc !air temp. in Celsius
real es !saturated water vapor pressure
real e !water vapor pressure
real w !Mixing Ratio
pt=tk*(p0/p)**kappa
! saturated water vapor pressure by Tetens (1930)'s formulae
tc=tk-273.15
es=611.0/100.*10**((7.5*tc)/(237.3+tc)) ![hPa]
e=rh/100*es
! water vapor mixing ratio in kg/kg
w=0.622*e/(p-e)
vpt=pt*(1.0 + 0.61*w)
end subroutine virtual_potential_temperature
$ make clean; make
rm -rf ../obj/sonde.meisei.analysis.o ../obj/*.mod
real 0m0.006s
user 0m0.003s
sys 0m0.003s
if [ ! -d ../obj ]; then \
mkdir -p ../obj ; \
fi
ifort -c -traceback -module ../obj -assume byterecl -c -o ../obj/sonde.meisei.analysis.o sonde.meisei.analysis.f90
ifort -o sonde.meisei.analysis ../obj/sonde.meisei.analysis.o -module ../obj -assume byterecl
$ chmod u+x *.sh
$ ./sonde.meisei.analysis.run.sh MandA2011Leg2.list.dat
Input.Edit/F2011052301S7006639.edit.CSV proc/001.dat 166 MandA2011Leg2.2011052216.grd
Input.Edit/F2011052305S7006642.edit.CSV proc/002.dat 166 MandA2011Leg2.2011052221.grd
Input.Edit/F2011052308S7006641.edit.CSV proc/003.dat 166 MandA2011Leg2.2011052300.grd
Input.Edit/F2011052310S7007210.edit.CSV proc/004.dat 166 MandA2011Leg2.2011052301.grd
Input.Edit/F2011052311S7007213.edit.CSV proc/005.dat 166 MandA2011Leg2.2011052302.grd
Input.Edit/F2011052312S7007207.edit.CSV proc/006.dat 166 MandA2011Leg2.2011052303.grd
Input.Edit/F2011052313S7006671.edit.CSV proc/007.dat 166 MandA2011Leg2.2011052304.grd
Input.Edit/F2011052314S7007208.edit.CSV proc/008.dat 166 MandA2011Leg2.2011052305.grd
Input.Edit/F2011052315S7006675.edit.CSV proc/009.dat 10 MandA2011Leg2.2011052306.grd
Input.Edit/F2011052316S7006678.edit.CSV proc/010.dat 166 MandA2011Leg2.2011052307.grd
Input.Edit/F2011052317S7006677.edit.CSV proc/011.dat 166 MandA2011Leg2.2011052308.grd
nt= 11
namelist file : ./sonde.meisei.analysis.namelist.txt
...
... Skip messages
...
Output data
x(1,:) h 500 99 Height [m]
x(2,:) wr 500 99 Wind dir.(azimuth) [deg]
x(3,:) ws 500 99 Wind Speed [m/s]
x(4,:) p 500 99 Air Pressure [hpa]
x(5,:) t 500 99 Temprature [K]
x(6,:) rh 500 99 Relative humid [%]
x(7,:) pt 500 99 Potential Temprature [K]
x(8,:) vps 500 99 saturated vapor pr.[hPa]
x(9,:) vp 500 99 vapor pressure [hPa]
x(10,:) dt 500 99 dewpoint temp. [degC]
x(11,:) w 500 99 Mixing Ratio [kg/kg]
x(12,:) ept 500 99 Equiv. pot. temp. [K]
x(13,:) vpt 500 99 Virtual pot. temp. [K]
x(14,:) v 500 99 N-S Wind Speed [m/s]
x(15,:) u 500 99 E-W Wind Speed [m/s]
Done ./sonde.meisei.analysis.
Deleting intermidiate files...
Done ./sonde.meisei.analysis.
$ ls -lh output
合計 352K
-rw-rw-r-- 1 am am 30K 3月 4 11:25 MandA2011Leg2.2011052216.grd
-rw-rw-r-- 1 am am 30K 3月 4 11:25 MandA2011Leg2.2011052221.grd
-rw-rw-r-- 1 am am 30K 3月 4 11:25 MandA2011Leg2.2011052300.grd
-rw-rw-r-- 1 am am 30K 3月 4 11:25 MandA2011Leg2.2011052301.grd
-rw-rw-r-- 1 am am 30K 3月 4 11:25 MandA2011Leg2.2011052302.grd
-rw-rw-r-- 1 am am 30K 3月 4 11:25 MandA2011Leg2.2011052303.grd
-rw-rw-r-- 1 am am 30K 3月 4 11:25 MandA2011Leg2.2011052304.grd
-rw-rw-r-- 1 am am 30K 3月 4 11:25 MandA2011Leg2.2011052305.grd
-rw-rw-r-- 1 am am 30K 3月 4 11:25 MandA2011Leg2.2011052306.grd
-rw-rw-r-- 1 am am 30K 3月 4 11:25 MandA2011Leg2.2011052307.grd
-rw-rw-r-- 1 am am 30K 3月 4 11:25 MandA2011Leg2.2011052308.grd
$ cat sonde.meisei.analysis.check.output.sh
#!/bin/bash
input=$1
if [ ! -f $input ]; then
echo Error in $0 : No such file, $input
echo
exit 1
fi
fc=ifort
opt="-assume byterecl"
prog=check.output.f90
exe=$(basename $prog .f90)
cat <<EOF > $prog
integer,parameter::outvar=15
integer,parameter::nlevel=10
character infle*100
real x(outvar,500)
open(1,file="${input}",access="direct",form="unformatted", &
& recl=4*outvar*500,action="read")
read(1,rec=1) &
(x(1,j),j=1,500), &
(x(2,j),j=1,500), &
(x(3,j),j=1,500), &
(x(4,j),j=1,500), &
(x(5,j),j=1,500), &
(x(6,j),j=1,500), &
(x(7,j),j=1,500), &
(x(8,j),j=1,500), &
(x(9,j),j=1,500), &
(x(10,j),j=1,500), &
(x(11,j),j=1,500), &
(x(12,j),j=1,500), &
(x(13,j),j=1,500), &
(x(14,j),j=1,500), &
(x(15,j),j=1,500)
do i=1,outvar
write(*,*)(x(i,j),j=1,nlevel)
write(*,*)
enddo !i
stop
end
EOF
${fc} ${opt} ${prog} -o $exe
$exe
exit 0
$ sh sonde.meisei.analysis.check.output.sh output/MandA2011Leg2.2011052216.grd
30.00000 60.00000 90.00000 120.0000 150.0000
180.0000 210.0000 240.0000 270.0000 300.0000 高度
158.2570 162.1010 162.9000 163.8920 163.8530
164.6010 166.4390 168.9460 170.8810 172.3500 風向
8.262730 7.967140 7.863330 7.770000 7.748330
7.744290 7.750000 7.858570 7.818570 7.858570 風速
1006.970 1003.430 999.9670 996.7670 993.2000
989.6570 986.5430 982.8710 979.7000 976.3000 気圧
.........
.........
299.7732 299.8421 299.8849 299.7871 300.0570
300.0474 300.0758 300.0936 300.1140 300.1130 仮温位
7.674876 7.581529 7.515716 7.464953 7.442669
7.466270 7.533937 7.712770 7.719754 7.788627 東西風速
-3.060878 -2.448621 -2.312136 -2.155777 -2.154831
-2.056413 -1.817223 -1.506756 -1.239129 -1.046141 南北風速
$ cat create.ctl.sh
#!/bin/bash
ctl=sonde.meisei.ctl
cwd=$(pwd)
outdir=output
cruise=MandA2011Leg2
dset=$cwd/$outdir/${cruise}.%y4%m2%d2%h2.grd
datetime=16z22may2011
dt=1hr
echo
echo Creating ctl file, $ctl in $outdir ...
cat <<EOF >$ctl
dset $dset
options template
undef -999.9
title Meisei sonde
xdef 1 linear 0.0 2.5
ydef 1 linear 60.0 2.5
zdef 500 linear 30 30
tdef 300 linear ${datetime} ${dt}
vars 15
h 500 99 Height [m]
wr 500 99 Wind dir.(azimuth) [deg]
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]
vps 500 99 saturated vapor pr.[hPa]
vp 500 99 vapor pressure [hPa]
dt 500 99 dewpoint temp. [degC]
w 500 99 Mixing Ratio [kg/kg]
ept 500 99 Equiv. pot. temp. [K]
vpt 500 99 Virtual pot. temp. [K]
v 500 99 N-S Wind Speed [m/s]
u 500 99 E-W Wind Speed [m/s]
endvars
EOF
echo Done.
echo
exit 0
$ create.ctl.sh
Creating ctl file, sonde.meisei.ctl, in output
Done.
$ cat time-height.sonde.run.sh
#!/bin/bash
t1=15z22May2011
t2=09z23May2011
out=MandA2011Leg2.meisei.sonde.eps
ctl=sonde.meisei.ctl
quit=yes
exe=time-height.sonde.gs
if [ ! -f $exe ]; then
echo Error in $0 : No such file, $exe
echo
exit 1
fi
if [ ! -f $ctl ]; then
echo Error in $ : No such file, $ctl
echo
exit 1
fi
opts="-ctl $ctl -t1 $t1 -t2 $t2 -q $quit -out $out"
grads -bcp "$exe $opts"
exit
$ sh time-height.sonde.run.sh
....................
....................
EPS file written to MandA2012Leg3.meisei.sonde.eps
$ cd ..
船舶観測データの時系列を追加で描きたい場合は以下の作業を行う
$ cd Ship.meteo/
$ ls
TBL101_to_txt.UTC.f90 lst2utc.f90 merge.meteo.raw.sh nagasaki.maru.meteo.UTC.run.sh
TBL101_to_txt.UTC.run.sh makefile nagasaki.maru.meteo.UTC.f90
::::::::::::::
nagasaki.maru.meteo.UTC.run.sh
::::::::::::::
#!/bin/sh
exe=nagasaki.maru.meteo.UTC
namelist=namelist.${exe}
indir= #/work2/kunoki/to_manda_sensei/Data/ECS_OBS/Ship_weather
in=20110524.DAT
tdh=+9 #Time difference in hour
out=$(basename $in .DAT).UTC.txt
cat <<EOF > $namelist
¶
infle="${in}" ! input file
tdh=${tdh} ! Time difference in hour
&end
EOF
echo Input: ${indir}/${in}
echo Output: ${out}
$exe < $namelist > $out
exit 0
::::::::::::::
nagasaki.maru.meteo.UTC.f90
::::::::::::::
program meteo
! Description: Read Nagasaki-Maru's Meteorol. data
! 列 データの種類 変数の名前
! 1 日付 yy,mm,dd
! 2 時刻 hh,mm
! 3 緯度 lat(dd,mm.mmm)
! 4 経度 lon(ddd,mm.mmm)
! 5 波高 wh(m)
! 6 周期 wp(s)
! 7 真風向 wd(deg)
! 8 風速(knot) ws(knot) 1 knot=0.514 m/s
! 9 気温 ta(deg)
!10 水温 ts(deg)
!11 気圧 pr(hPa)
!12 ジャイロ方位 gyr(deg)
!13 速力 ss(knots)
! 真風向の定義:北=0度、時計回りにはかる。北より(南向き)の風=0度、東より(西向き)の風=90度
!
! Author: am
character(len=500)::infle
character strm*500,ymd*12,hms*10,lat*14,lon*15
integer latd,lond
real latm,lonm
integer yr,mo,dy,hr,mi,sc !LST
integer uyr,umo,udy,uhr,umi,usc !UTC
integer tdh
namelist /para/infle,tdh
read(*,nml=para)
print '(A)','# date(yyyy,mm,dd) time_UTC(hh,mm) lat(dd,mm.mmm) lon(ddd,mm.mmm) wh(m) wp(s) wd(deg) ws(knot) ta(degC) ts(degC) p(hPa) gyr ss'
open(10,file=infle,action="read")
10 continue
read(10,'(A)',end=20)strm
if(strm(1:1)=="#")goto 10
read(strm(1:54),'(A,1x,A,1x,A,1x,A)')ymd,hms,lat,lon
read(strm(56:),*)wvh,wvp,wid,wis,ta,tw,pr,gyd,shs
read(ymd(2:5),*)yr
read(ymd(7:9),*)mo
read(ymd(10:11),*)dy
read(hms(2:3),*)hr
read(hms(5:6),*)mi
read(hms(8:9),*)sc
read(lat(2:3),*)latd
read(lat(6:11),*)latm
read(lon(2:4),*)lond
read(lon(7:12),*)lonm
call lst2utc(yr,mo,dy,hr, uyr, umo, udy, uhr, tdh)
umi=mi
usc=sc
print '(i5.4,2i3.2,3i3.2, i3,f7.3, i4,f7.3, f7.1,f7.1,f10.3,f8.1,f7.2,f7.1,f7.1)',&
uyr,umo,udy,uhr,umi,usc, latd,latm,lond,lonm ,wvh,wvp,wid,wis,ta,tw,pr
goto 10
20 continue
end program meteo
::::::::::::::
lst2utc.f90
::::::::::::::
subroutine lst2utc(lyr,lmo,ldy, lhr, uyr, umo, udy, uhr, tdh)
! Description:
!
! Author: am
!
! Host: aofd165.fish.nagasaki-u.ac.jp
! Directory: /work2/kunoki/to_manda_sensei/Tools/MGDSST.AlongTrack
!
! Revision history:
! This file is created by /usr/local/mybin/nff.sh at 09:19 on 09-12-2014.
! Reference
! 1行で書けるうるう年判別法
! http://d.hatena.ne.jp/Kappuccino/20081025/1224906495
!
implicit none
integer,intent(in):: lyr,lmo,ldy, lhr
integer,intent(inout)::uyr,umo,udy, uhr
integer,intent(in):: tdh
integer y
integer,dimension(12)::last_day
data last_day/31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31/
uyr=lyr
umo=lmo
udy=ldy
uhr=lhr
uhr=lhr-tdh
if(uhr<0)then
uhr=uhr+24
udy=udy-1
endif
if(udy<=0)then
umo=umo-1
udy=last_day(umo)
if(umo == 2)then
y=uyr
udy = 28 + (1 / (y - y / 4 * 4 + 1)) * &
& (1 - 1 / (y - y / 100 * 100 + 1)) &
& + (1 / (y - y / 400 * 400 + 1));
endif
endif
if(umo<=0)then
umo=1
uyr=uyr-1
endif
end subroutine lst2utc
::::::::::::::
TBL101_to_txt.UTC.run.sh
::::::::::::::
#!/bin/sh
exe=TBL101_to_txt.UTC
namelist=namelist.${exe}
indir= #/work2/kunoki/to_manda_sensei/Tools/U10.Ship/01.Raw/
in=CR800Series_TBL101.dat
tdh=+9 #Time difference in hour
out=$(basename $in .dat).UTC.txt
cat <<EOF > $namelist
¶
infle="${indir}${in}" ! input file
tdh=${tdh}
ofle="$out"
&end
EOF
if [ ! -f ${indir}${in} ]; then
echo Error in $: No such file, ${indir}${in}
exit 1
fi
$exe < $namelist
echo Input: ${indir}/${in}
echo Output: ${out}
exit 0
::::::::::::::
TBL101_to_txt.UTC.f90
::::::::::::::
!
! Change format of the humidity and rain rate data measured by
! Vaisalla CR800 TBL101.dat
!
program TBL101_to_txt
character(len=500)::infle,ofle
character(len=2000)::strm
character datetime*20
integer record
real ta, rh, prec_mm_tot
integer yr,mo,dy,hr,mi,sc !LST
integer uyr,umo,udy,uhr,umi,usc !UTC
integer tdh
namelist /para/infle,tdh,ofle
read(5,nml=para)
open(11,file=infle,action="read")
open(21,file=ofle)
write(21,'(A,A)')'# Input: ',trim(infle)
write(21,'(A)')'# rh[%] ta[degC] prec_mm_tot[mm] date(yyyy,mm,dd) time_UTC(hh,mm) datetime(JST)'
1 read(11,'(A)',end=9)strm
if(index(strm,"TOA5")/=0)goto 1
if(index(strm,"TIMESTAMP")/=0)goto 1
if(index(strm,"RN")/=0)goto 1
if(index(strm,"Smp")/=0)goto 1
read(strm(2:20),'(a)') datetime
read(strm(23:),*) record,ta,rh !,prec_mm_tot
! write(21,'(a19,2x,i6.6,f7.2,1x,f7.2,f12.3)')&
! datetime,record,ta,rh,prec_mm_tot
print '(A)',trim(datetime)
read(datetime(1:4),*) yr
read(datetime(6:7),*) mo
read(datetime(9:10),*) dy
read(datetime(12:13),*) hr
read(datetime(15:16),*) mi
read(datetime(18:19),*) sc
umi=mi
usc=sc
call lst2utc(yr,mo,dy,hr, uyr, umo, udy, uhr, tdh)
write(21,'(2x,3f7.2,2x,i4.4,1x,i2.2,1x,i2.2,1x,i2.2,1x,i2.2,1x,i2.2,1x,A19)')&
rh,ta,prec_mm_tot, uyr, umo, udy, uhr, umi, usc, datetime
goto 1
9 continue
close(21)
close(11)
end program TBL101_to_txt
$ cat makefile
#
#
#j Fortran77とFortran90/95の混成プログラムのコンパイル用makefile
#
#j 作成 Sun Feb 15 15:16:02 2009
#
#j 注:ごく簡単な動作チェックしか行っていない
#j サフィックスルールがこれで正しいかどうかチェックする必要あり
#
#j 参考文献
#j makefile の書き方
#j http://www.eis.osakafu-u.ac.jp/~yabu/soft/makefile.html
#j Makefile小技と新バージョンのDelFEM(FEMとUIの日記@New York)
#j http://d.hatena.ne.jp/etopirika5/20091207/1260207955
#
#-----------------------------------------
#j マクロの定義
#-----------------------------------------
#j コンパイラの指定
FC=ifort
#FC=gfortran
#FC=g77
#FC=f77
#j OBJDIR (オブジェクトファイルをおくディレクトリ)
OBJDIR=./obj
#-----------------------------------------
#j コンパイルオプション(ifort)
#-----------------------------------------
#j デバッグ用オプション(はじめて実行するときには必ずこのオプションをつけてコンパイルする)
FDFLAGS= -CB -traceback -fpe0
#j コンパイルオプション
FFLAGS=-module ${OBJDIR}
#j -module : モジュールファイル(.mod)を置く場所を指定する
#j 最適化用(他にも何種類かある. ifort -helpかマニュアルを見て調べる)
#FFLAGS = -O3 -module ${OBJDIR}
#j 倍精度
#FFLAGS = -r8 -module ${OBJDIR}
#j 入力データのバイト・スワップ(大型計算機のバイナリデータを読む時などにつかう)
#FFLAGS = #-convert big_endian -module ${OBJDIR}
#-----------------------------------------
#j リンク用のオプション
#-----------------------------------------
LDFLAGS=-module ${OBJDIR}
#j ターゲット名(最終的に作りたい実行ファイル名)
TARGET1=nagasaki.maru.meteo.UTC
TARGET2=TBL101_to_txt.UTC
TARGETS=$(TARGET1) $(TARGET2)
#j MOD (Fortran90以降のモジュールファイル)
MOD=
#j SRC7 (Fortran77のソースファイル)
SRC7=
#j SRC9 (Fortran90のソースファイル)
SRC9=nagasaki.maru.meteo.UTC.f90 lst2utc.f90
#j OBJ1 (ターゲットを作るのに必要なオブジェクトファイル名)
OBJM=$(MOD:.f90=.o)
OBJ7=$(SRC7:.f=.o)
OBJ9=$(SRC9:.f90=.o)
OBJTMP=$(OBJM) $(OBJ7) $(OBJ9)
OBJ1=$(OBJTMP:%=${OBJDIR}/%)
MOD2=
#j SRC7 (Fortran77のソースファイル)
SRC72=
#j SRC9 (Fortran90のソースファイル)
SRC92=TBL101_to_txt.UTC.f90 lst2utc.f90
#j OBJ (ターゲットを作るのに必要なオブジェクトファイル名)
OBJM2=$(MOD2:.f90=.o)
OBJ72=$(SRC72:.f=.o)
OBJ92=$(SRC92:.f90=.o)
OBJTMP2=$(OBJM2) $(OBJ72) $(OBJ92)
OBJ2=$(OBJTMP2:%=${OBJDIR}/%)
OBJ=$(OBJ1) $(OBJ2)
#-----------------------------------------
#j ここからコンパイルのルールの記述
#-----------------------------------------
all: mkobjd $(TARGETS)
$(TARGET1): $(OBJ1)
$(FC) -o $@ $(OBJ1) ${LDFLAGS}
$(TARGET2): $(OBJ2)
$(FC) -o $@ $(OBJ2) ${LDFLAGS}
#j 暗黙のサフィックスルールを無効にする
.SUFFIXES:
#j サフィックスの追加
.SUFFIXES: .o .f .f90
#j f77のソースファイルのコンパイル(.f用のサフィックスルール)
${OBJDIR}/%.o : %.f
$(FC) -c ${FDFLAGS} ${FFLAGS} -c -o $@ $<
#j f90のソースファイルのコンパイル(.f90用のサフィックスルール)
${OBJDIR}/%.o : %.f90
$(FC) -c ${FDFLAGS} ${FFLAGS} -c -o $@ $<
#j オブジェクトファイルを削除
clean:
rm -rf $(OBJ) ${OBJDIR}/*.mod
#j オブジェクトファイルと実行ファイルを削除
distclean:
rm -rf $(OBJ) ${OBJDIR}/*.mod $(TARGETS) \
rm -rf ${OBJDIR}
#j オブジェクトファイルを置くディレクトリを作成
mkobjd:
if [ ! -d ${OBJDIR} ]; then \
mkdir -p ${OBJDIR} ; \
fi
#j tarファイルを作る
tar:
tar cvf $(TARGET1).tar ./*.f90 ./*.f ./*.c ./*.h ./*.txt makefile
$ make clean ; make
rm -rf ./obj/nagasaki.maru.meteo.UTC.o ./obj/lst2utc.o ./obj/TBL101_to_txt.UTC.o ./obj/lst2utc.o ./obj/*.mod
real 0m0.006s
user 0m0.002s
sys 0m0.004s
if [ ! -d ./obj ]; then \
mkdir -p ./obj ; \
fi
ifort -c -CB -traceback -fpe0 -module ./obj -c -o obj/nagasaki.maru.meteo.UTC.o nagasaki.maru.meteo.UTC.f90
ifort -c -CB -traceback -fpe0 -module ./obj -c -o obj/lst2utc.o lst2utc.f90
ifort -o nagasaki.maru.meteo.UTC ./obj/nagasaki.maru.meteo.UTC.o ./obj/lst2utc.o -module ./obj
ifort -c -CB -traceback -fpe0 -module ./obj -c -o obj/TBL101_to_txt.UTC.o TBL101_to_txt.UTC.f90
ifort -o TBL101_to_txt.UTC ./obj/TBL101_to_txt.UTC.o ./obj/lst2utc.o -module ./obj
$ chmod u+x *.sh
$ nagasaki.maru.meteo.UTC.run.sh
Input: /20110523.DAT
Output: 20110523.UTC.txt
$ ./nagasaki.maru.meteo.UTC.run.sh
Input: /20110524.DAT
Output: 20110524.UTC.txt
$ cat merge.meteo.sh
#!/bin/bash
inlist="\
20110523.UTC.txt \
20110524.UTC.txt \
"
out=Manda2011Leg2.Meteo.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.meteo.sh
Input: 20110523.UTC.txt
Input: 20110524.UTC.txt
Output: Manda2011Leg2.Meteo.txt
湿度計データのフォーマットと時刻の変更
$ ./TBL101_to_txt.UTC.run.sh
...
... Lots of messages
...
Input: /CR800Series_TBL101.dat
Output: CR800Series_TBL101.UTC.txt
$ cat paste.meteo.tbl101.sh
#!/bin/bash
# Description:
#
# Author: am
#
# Host: aofd165.fish.nagasaki-u.ac.jp
# Directory: /work1/am/Sato.Kodama.Manda2015/Time-Height.Diagram/Ship.meteo
#
# Revision history:
# This file is created by /usr/local/mybin/nbscr.sh at 14:39 on 03-04-2015.
in1=Manda2011Leg2.Meteo.txt
in2=CR800Series_TBL101.UTC.txt
out=Manda2011Leg2.Surface.txt
if [ ! -f $in1 ]; then
echo Error in $0 : No such file, $in1
exit 1
fi
if [ ! -f $in2 ]; then
echo Error in $0 : No such file, $in2
exit 1
fi
nol1=$(wc -l $in1 | awk '{print $1}')
nol2=$(wc -l $in2 | awk '{print $1}')
if [ $nol1 -ne $nol2 ]; then
echo Error in $0 : Number of lines of $1 is not equal to that of $2.
exit 1
fi
paste $in1 $in2 > $out
echo
echo Input: $in1
echo Input: $in2
echo Output: $out
echo
echo "Done $0"
echo
$ ./paste.meteo.tbl101.sh
Input: Manda2011Leg2.Meteo.txt
Input: CR800Series_TBL101.UTC.txt
Output: Manda2011Leg2.Surface.txt
Done ./paste.meteo.tbl101.sh
長崎丸気象データと湿度計の日付・時刻がずれていないか確認する
$ awk '{if($1!="#")print $1,$2,$3,$4,$5,$6," ",$21,$22,$23,$24,$25,$26}' Manda2011Leg2.Surface.txt |less
$ cd ..
$ cd Ship.Heat.Flux
$ ls
heat_flux_kondo.f90 makefile ship_heat_flux.f90 ship_heat_flux.run.sh
::::::::::::::
makefile
::::::::::::::
#
#
#j Fortran77とFortran90/95の混成プログラムのコンパイル用makefile
#
#j 作成 Sun Feb 15 15:16:02 2009
#
#j 注:ごく簡単な動作チェックしか行っていない
#j サフィックスルールがこれで正しいかどうかチェックする必要あり
#
#j 参考文献
#j makefile の書き方
#j http://www.eis.osakafu-u.ac.jp/~yabu/soft/makefile.html
#j Makefile小技と新バージョンのDelFEM(FEMとUIの日記@New York)
#j http://d.hatena.ne.jp/etopirika5/20091207/1260207955
#
#-----------------------------------------
#j マクロの定義
#-----------------------------------------
#j コンパイラの指定
FC=ifort
#FC=gfortran
#FC=g77
#FC=f77
#j OBJDIR (オブジェクトファイルをおくディレクトリ)
OBJDIR=./obj
#-----------------------------------------
#j コンパイルオプション(ifort)
#-----------------------------------------
#j デバッグ用オプション(はじめて実行するときには必ずこのオプションをつけてコンパイルする)
FDFLAGS= -CB -traceback -fpe0
#j コンパイルオプション
FFLAGS=-module ${OBJDIR} -assume byterecl
#j -module : モジュールファイル(.mod)を置く場所を指定する
#j 最適化用(他にも何種類かある. ifort -helpかマニュアルを見て調べる)
#FFLAGS = -O3 -module ${OBJDIR}
#j 倍精度
#FFLAGS = -r8 -module ${OBJDIR}
#j 入力データのバイト・スワップ(大型計算機のバイナリデータを読む時などにつかう)
#FFLAGS = #-convert big_endian -module ${OBJDIR}
#-----------------------------------------
#j リンク用のオプション
#-----------------------------------------
LDFLAGS=-module ${OBJDIR}
#j ターゲット名(最終的に作りたい実行ファイル名)
TARGET1=ship_heat_flux
TARGET2=
TARGETS=$(TARGET1) $(TARGET2)
#j MOD (Fortran90以降のモジュールファイル)
MOD=
#j SRC7 (Fortran77のソースファイル)
SRC7=
#j SRC9 (Fortran90のソースファイル)
SRC9=ship_heat_flux.f90 heat_flux_kondo.f90
#j OBJ1 (ターゲットを作るのに必要なオブジェクトファイル名)
OBJM=$(MOD:.f90=.o)
OBJ7=$(SRC7:.f=.o)
OBJ9=$(SRC9:.f90=.o)
OBJTMP=$(OBJM) $(OBJ7) $(OBJ9)
OBJ1=$(OBJTMP:%=${OBJDIR}/%)
MOD2=
#j SRC7 (Fortran77のソースファイル)
SRC72=
#j SRC9 (Fortran90のソースファイル)
SRC92=
#j OBJ (ターゲットを作るのに必要なオブジェクトファイル名)
OBJM2=$(MOD2:.f90=.o)
OBJ72=$(SRC72:.f=.o)
OBJ92=$(SRC92:.f90=.o)
OBJTMP2=$(OBJM2) $(OBJ72) $(OBJ92)
OBJ2=$(OBJTMP2:%=${OBJDIR}/%)
OBJ=$(OBJ1) $(OBJ2)
#-----------------------------------------
#j ここからコンパイルのルールの記述
#-----------------------------------------
all: mkobjd $(TARGETS)
$(TARGET1): $(OBJ1)
$(FC) -o $@ $(OBJ1) ${LDFLAGS}
$(TARGET2): $(OBJ2)
$(FC) -o $@ $(OBJ2) ${LDFLAGS}
#j 暗黙のサフィックスルールを無効にする
.SUFFIXES:
#j サフィックスの追加
.SUFFIXES: .o .f .f90
#j f77のソースファイルのコンパイル(.f用のサフィックスルール)
${OBJDIR}/%.o : %.f
$(FC) -c ${FDFLAGS} ${FFLAGS} -c -o $@ $<
#j f90のソースファイルのコンパイル(.f90用のサフィックスルール)
${OBJDIR}/%.o : %.f90
$(FC) -c ${FDFLAGS} ${FFLAGS} -c -o $@ $<
#j オブジェクトファイルを削除
clean:
rm -rf $(OBJ) ${OBJDIR}/*.mod
#j オブジェクトファイルと実行ファイルを削除
distclean:
rm -rf $(OBJ) ${OBJDIR}/*.mod $(TARGETS) \
rm -rf ${OBJDIR}
#j オブジェクトファイルを置くディレクトリを作成
mkobjd:
if [ ! -d ${OBJDIR} ]; then \
mkdir -p ${OBJDIR} ; \
fi
run:
cd .. ; \
./run.sh 2>&1 > log.txt ; \
cd src
#j tarファイルを作る
tar:
tar cvf $(TARGET1).tar ./*.f90 ./*.f ./*.c ./*.h ./*.txt makefile
::::::::::::::
heat_flux_kondo.f90
::::::::::::::
subroutine heat_flux_kondo(slp,sst,t,rh,v,q,qh,qe)
! Description:
!
! Author: kunoki
!
! Host: aofd165.fish.nagasaki-u.ac.jp
! Directory: /work2/kunoki/to_manda_sensei/Tools/MSM.Heat.Flux
!
! Revision history:
! This file is created by /usr/local/mybin/nff.sh at 22:03 on 09-12-2014.
! slp [hPa]
! sst [degC]
! t [degC]
! rh [%]
! v [m/s]
! q [kg/kg]
! qh [W/m2]
! qe [W/ms]
real,intent(in):: slp,sst,t,rh,v
real,intent(inout)::qh,qe,q
real ae(5)/0., 0.969, 1.18, 1.196, 1.68/
real ah(5)/0., 0.927, 1.15, 1.17, 1.652/
real be(5)/1.23, 0.0521, 0.01, 0.008, -0.016/
real bh(5)/1.185, 0.0546, 0.01, 0.0075, -0.017/
real ce(5)/0., 0, 0, -0.0004, 0./
real ch(5)/0., 0, 0, -0.00045, 0./
real pe(5)/-0.16, 1., 1., 1., 1./
real ph(5)/-0.157, 1., 1., 1., 1./
real es,essea,qs,dens
real chn,cln,chg,clg,s0,s
parameter(LH=2500,cp=1004)
if (v.le.2.2) l=1
if (v.gt.2.2 .and. v.le.5.0) l=2
if (v.gt.5.0 .and. v.le.8.0) l=3
if (v.gt.8.0 .and. v.le.25.0) l=4
if (v.gt.25.0 .and. v.le.50.0) l=5
chn=0.001*(ah(l) + bh(l)*v**ph(l) + ch(l)*(v-8)**2)
cln=0.001*(ae(l) + be(l)*v**pe(l) + ce(l)*(v-8)**2)
s0=(sst-t)/(v**2)
s=s0*abs(s0)/(abs(s0)+0.01)
if(s.lt. -3.3) then
chg=0.0
clg=0.0
else if(s .lt. 0.0) then
chg=chn*(0.1+0.03*s+0.9*exp(4.8*s))
clg=cln*(0.1+0.03*s+0.9*exp(4.8*s))
else
chg=chn*(1.0+0.63*sqrt(s))
clg=cln*(1.0+0.63*sqrt(s))
endif
es=6.11*exp((LH/0.4615)*(1.0/273.2-1.0/(t+273.15)))
essea=6.11*exp((LH/0.4615)*(1.0/273.2-1.0/(sst+273.15)))*100/rh
! write(6,*) es,essea
q=0.622*es/slp
qs=0.622*essea/slp
dens=slp/(2.87*(1+0.61*q)*(t+273.15))
! write(6,*) 'dens,s,chg,clg,es,essea,q,qs'
! write(6,*) dens,q,qs
!
qh=dens*cp*chg*v*(sst-t)
qe=dens*LH*1000*clg*v*(qs-q)
! write(6,*) qh,qe
return
end subroutine heat_flux_kondo
::::::::::::::
ship_heat_flux.f90
::::::::::::::
program ship_heat_flux
character(len=500)::infle,ofle
integer nt
integer,allocatable,dimension(:)::yyyy,mm,dd,hh,mi,sc
real,allocatable,dimension(:)::lond,lonm,latd,latm
real,allocatable,dimension(:)::wd,ws,ta,ts,p,rh
real,allocatable,dimension(:)::wsm,wdd,wdr,taC,sstC,slphPa
real,allocatable,dimension(:)::u,v,q,lh,sh
integer tdh ! Time difference in hour
real,parameter::undef=-999.0
real,parameter::d2r=(180.0/3.14159265358979) !degree to radian
real,parameter::kn2m=0.514 !knot to m/s
character(len=2000)::strm
namelist /para/infle,ofle,tdh
read(*,nml=para)
open(11,file=infle,action="read")
print '(A,A)',"Open: ",trim(infle)
n=0
count_vaild_data: do
read(11,'(A)',iostat=ios)strm
if(ios<0)exit
if(strm(1:1) == "#")then
cycle
else
n=n+1
endif
enddo count_vaild_data
nt=n
print '(A,i5)','nt=',nt
rewind(11)
! wh: Wave height [m]
! wp: Wave period [s]
! wd: Wind direction in azimuth [deg]
! ws: Wind speed [knot]
! ta: Surface Air Temp [degC]
! ts: Sea surface temp [degC]
! p: Surface pressure [hPa]
! rh: Relative humidity [%]
allocate(yyyy(nt),mm(nt),dd(nt),hh(nt),mi(nt),sc(nt))
allocate(lond(nt),lonm(nt),latd(nt),latm(nt))
allocate(wd(n),ws(nt),ta(nt),ts(nt),p(nt),rh(nt))
allocate(wsm(nt),wdd(nt),wdr(nt),taC(nt),sstC(nt),slphPa(nt))
allocate(u(nt),v(nt),lh(nt),sh(nt),q(nt))
n=0
read_data: do
read(11,'(A)',iostat=ios)strm
if (ios<0) exit
if (strm(1:1)=="#")cycle
n=n+1
read(strm,*)yyyy(n),mm(n),dd(n),hh(n),mi(n),sc(n),&
latd(n),latm(n),lond(n),lonm(n),wh,wp,wd(n),ws(n),ta(n),ts(n),p(n),rh(n)
if(ts(n)==undef)then
sstC(n)=undef
else
sstC(n)=ts(n)
endif
if( ta(n)==undef)then
taC(n)=undef
else
taC(n)=ta(n)
endif
if(p(n)==undef)then
slphPa(n)=undef
else
slphPa(n)=p(n)
endif
wsm(n)=ws(n)*kn2m
wdd(n)=(270.0-wd(n)) !Azimuth to angle in mathematics
wdr(n)=wdd(n)*d2r
u(n)=wsm(n)*cos(wdr(n))
v(n)=wsm(n)*sin(wdr(n))
if(sstC(n)/=undef .and. taC(n)/=undef .and. slphPa(n)/=undef)then
call heat_flux_kondo(slphPa(n),sstC(n),taC(n),rh(n),wsm(n), q(n),sh(n), lh(n))
else
q(n)=undef
sh(n)=undef
lh(n)=undef
endif
print '(i5,1x,i4.4,i2.2,i2.2,1x,i2.2,i2.2)',n,yyyy(n),mm(n),dd(n),hh(n),mi(n)
print '(f9.2,2f8.1,f6.0,f9.0,f10.5,2f8.1)',slphPa(n),sstC(n),taC(n),rh(n),ws(n), q(n),sh(n), lh(n)
enddo read_data
nvar=10
open(20,file=ofle,access="direct",form="unformatted",recl=4*nvar)
! intel fortranの場合標準でのダイレクトアクセスは要素で数えるの
! でコンパイル時に-assume byterecl オブションをつけること。
! 例:
! $ ifort -assume byterecl prog.f90 -o prog
do n=1,nt
write(20,rec=n)slphPa(n),sstC(n),taC(n),rh(n),wsm(n),u(n),v(n),q(n),sh(n),lh(n)
enddo
close(20)
print *
print '(A,A)','Output: ',trim(ofle)
print *
end program ship_heat_flux
subroutine lst2utc(lyr,lmo,ldy, lhr, uyr, umo, udy, uhr, tdh)
! Description:
!
! Author: am
!
! Host: aofd165.fish.nagasaki-u.ac.jp
! Directory: /work2/kunoki/to_manda_sensei/Tools/MGDSST.AlongTrack
!
! Revision history:
! This file is created by /usr/local/mybin/nff.sh at 09:19 on 09-12-2014.
! Reference
! 1行で書けるうるう年判別法
! http://d.hatena.ne.jp/Kappuccino/20081025/1224906495
!
implicit none
integer,intent(in):: lyr,lmo,ldy, lhr
integer,intent(inout)::uyr,umo,udy, uhr
integer,intent(in):: tdh
integer y
integer,dimension(12)::last_day
data last_day/31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31/
uyr=lyr
umo=lmo
udy=ldy
uhr=lhr
uhr=lhr-tdh
if(uhr<0)then
uhr=uhr+24
udy=udy-1
endif
if(udy<=0)then
umo=umo-1
udy=last_day(umo)
if(umo == 2)then
y=uyr
udy = 28 + (1 / (y - y / 4 * 4 + 1)) * &
& (1 - 1 / (y - y / 100 * 100 + 1)) &
& + (1 / (y - y / 400 * 400 + 1));
endif
endif
if(umo<=0)then
umo=1
uyr=uyr-1
endif
end subroutine lst2utc
$ make clean; make
rm -rf ./obj/ship_heat_flux.o ./obj/heat_flux_kondo.o ./obj/*.mod
real 0m0.006s
user 0m0.005s
sys 0m0.002s
if [ ! -d ./obj ]; then \
mkdir -p ./obj ; \
fi
ifort -c -CB -traceback -fpe0 -module ./obj -assume byterecl -c -o obj/ship_heat_flux.o ship_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 ship_heat_flux ./obj/ship_heat_flux.o ./obj/heat_flux_kondo.o -module ./obj
$ chmod u+x *.sh
$ cat ship_heat_flux.run.sh
#!/bin/sh
indir=../Ship.meteo/
in=Manda2011Leg2.Surface.txt
tdh=0 # Time difference in hour ( 0 for UTC, +9 for JST)
hhZddmmmyyyy=15Z22may2011
dt=1mn
infle=${indir}/${in}
if [ ! -f $infle ]; then
echo Error in $0 : No such file, $infle
exit 1
fi
ofle=$(basename $infle .txt).bin
ctl=$(basename $infle .txt).ctl
exe=ship_heat_flux
namelist=${exe}.namelist.txt
nline=$(wc -l $infle |awk '{print $1}')
cat <<EOF > $namelist
¶
infle="${infle}",
ofle="${ofle}",
tdh=$tdh
&end
EOF
echo
echo Computing heat flux
$exe < $namelist
echo Done.
echo
echo Creating ctl file, $ctl
cat <<EOF >$ctl
dset ^${ofle}
options template
undef -999.0
title along ship track
xdef 1 linear 0.0 2.5
ydef 1 linear 60.0 2.5
zdef 1 linear 1 1
tdef ${nline} linear ${hhZddmmmyyyy} ${dt}
vars 10
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]
u 1 99 Eastward wind [m/s]
v 1 99 Northward wind [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 Done.
echo
echo Output: $ofle
echo Ctl file: $ctl
echo
exit 0
$ ship_heat_flux.run.sh
...
... Lots of mesasges
...
Output: Manda2011Leg2.Surface.bin
Ctl file: Manda2011Leg2.Surface.ctl
$ cat time.series.run.sh
#!/bin/bash
exe=time.series.gs
if [ ! -f $exe ]; then
echo Error in $0 : No such file, $exe
exit 1
fi
ctl=Manda2011Leg2.Surface.ctl
out=Manda2011Leg2.Surface.eps
t1=18z22may2011
t2=08z23may2011
opt="-ctl $ctl -o $out -t1 $t1 -t2 $t2 -q"
grads -bcp "$exe $opt"
echo
echo Done $(basename $0).
echo
$ cat time.series.gs
function ts( args )
#
# Default values
#
ctl='Manda2011Leg2.Surface.ctl'
out='Manda2011Leg2.Surface.eps'
quitflag='false'
t1='18z22may2011'
t2='08z23may2011'
*
* Decode options
*
i = 1
while( 1 )
arg = subwrd( args, i )
i = i + 1;
if( arg = '' ); break; endif
while( 1 )
if( arg = '-ctl' ); ctl = subwrd(args,i) ;i=i+1; break; endif
if( arg = '-o' ); out = subwrd(args,i) ;i=i+1; break; endif
if( arg = '-t1' ); t1 = subwrd(args,i) ;i=i+1; break; endif
if( arg = '-t2' ); t2 = 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'
##################### Flux ####################
'set parea 1.3 7.8 4.5 6.0'
'open 'ctl
'set time 't1' 't2
'set xlopts 1 0 0'
'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'
##################### Flux ####################
##################### SST&SAT ####################
'set parea 1.3 7.8 2.7 4.2'
'open 'ctl
'set time 't1' 't2
'set xlopts 1 5 0.12'
'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'
##################### SST&SAT ####################
##################
'set string 1.2 l 5 0'
'set strsiz 0.17 0.17'
'set strsiz 0.15 0.15'
'set string 1.2 c 5 90'
'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'
###### 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.8 Ws [m/s]'
'set string 8'
'draw string 7.05 5.6 LHF [W/m`a2`n]'
'set string 2'
'draw string 7.05 5.4 SHF [W/m`a2`n]'
'set line 1'
'draw line 5.9 5.8 6.4 5.8'
'set line 8'
'draw line 5.9 5.6 6.4 5.6'
'set line 2'
'draw line 5.9 5.4 6.4 5.4'
###### 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.series.run.sh
...
... Some mesasges
...
EPS file written to Manda2011Leg2.Surface.eps
No hardcopy metafile open
GX package terminated
Done time.series.run.sh.
$ cd ..
$ cd Sonde.Ship.Plot
::::::::::::::
time-height.sonde.run.sh
::::::::::::::
#!/bin/bash
dir1='../Sonde.Time-height.UTC'
ctl1='sonde.meisei.ctl'
dir2='../Ship.Heat.Flux'
ctl2='Manda2011Leg2.Surface.ctl'
quitopt='yes'
out='time-height.sonde.meisei.eps'
t1='15z22may2011'
t2='08z23may2011'
quit=yes
exe=time-height.sonde.gs
if [ ! -f $exe ]; then
echo Error in $0 : No such file, $exe
echo
exit 1
fi
if [ ! -f ${dir1}/$ctl1 ]; then
echo Error in $ : No such file, ${dir1}/$ctl1
echo
exit 1
fi
if [ ! -f ${dir2}/$ctl2 ]; then
echo Error in $ : No such file, ${dir2}/$ctl2
echo
exit 1
fi
opts="-dir1 $dir1 -ctl1 $ctl1 -dir2 $dir2 -t1 $t1 -t2 $t2 -q $quit -out $out"
grads -bcp "$exe $opts"
exit
::::::::::::::
time-height.sonde.gs
::::::::::::::
function thsonde ( args )
# default value
dir1='../Sonde.Time-height.UTC'
ctl1='sonde.meisei.ctl'
dir2='../Ship.Heat.Flux'
ctl2='Manda2011Leg2.Surface.ctl'
quitopt='yes'
out='time-height.sonde.meisei.eps'
t1='15z22may2011'
t2='08z23may2011'
# Initilize grads
'reinit'
'set display color white'
'c'
'set grads off'
'set rgb 17 220 0 0'
'set rgb 18 251 0 0'
'set rgb 19 255 111 0'
'set rgb 20 255 153 0'
'set rgb 21 255 205 0'
'set rgb 22 255 255 4'
'set rgb 23 255 255 145'
'set rgb 24 255 255 208'
'set rgb 25 255 255 139'
'set rgb 30 148 232 172'
'set rgb 31 200 249 198'
'set rgb 32 50 190 255'
'set rgb 33 95 225 234'
'set rgb 34 125 234 200'
'set rgb 35 200 255 14'
'set rgb 36 255 255 0'
'set rgb 37 255 220 0'
'set rgb 38 255 160 0'
'set rgb 39 245 109 0'
'set rgb 40 255 78 0'
'set rgb 41 246 0 0'
# 'set rgb 42 199 0 0'
'set rgb 43 132 255 22'
*
* Decode options
*
i = 1
while( 1 )
arg = subwrd( args, i )
i = i + 1;
if( arg = '' ); break; endif
while( 1 )
if( arg = '-dir1'); dir1 = subwrd(args,i);i=i+1; break;endif
if( arg = '-ctl1'); ctl1 = subwrd(args,i);i=i+1; break;endif
if( arg = '-dir2'); dir2 = subwrd(args,i);i=i+1; break;endif
if( arg = '-ctl2'); ctl2 = subwrd(args,i);i=i+1; break;endif
if( arg = '-out' );out = subwrd(args,i) ;i=i+1;break;endif
if( arg = '-t1' );t1 = subwrd(args,i) ;i=i+1;break;endif
if( arg = '-t2' );t2 = subwrd(args,i) ;i=i+1;break;endif
if( arg = '-q' ); quitopt='yes' ;i=i+1; break; endif
say 'Syntax error : arg= 'arg
return
endwhile
endwhile
### Use it after carefully checking which direction is north
# 'set strsiz 0.25 0.25'
# 'set string 1 c 6 0'
# 'draw string 1.4 10.4 N'
# 'draw string 7.6 10.4 S'
##################### RH&Wind #####################
'open 'dir1'/'ctl1
'set parea 1.3 7.75 8.0 10.25'
'set xlopts 1 0 0'
'set ylopts 1 6 0.16'
'set time 't1' 't2
'set lev 0 5000'
'set ylint 1000'
say;say;say
'q file'
say result
'q dims'
say result
'q ctlinfo'
say result
say;say;say
### RH
'set gxout grfill'
'set clevs 60 70 80 90 95'
* 'rgbset2'
'd rh'
'xcbar 8 8.1 8.5 10 -fw 0.12 -fh 0.13 -fs 2 -ft 5 -dir v -line on -edge triangle'
'set strsiz 0.13 0.13'
'set string 1 c 6'
'draw string 8.3 10.3 [%]'
### Wind
'set gxout vector'
'set ccolor 0'
'set cthick 20'
'set arrscl 0.5 40 ' ;*20'
'set arrlab off'
'd skip(u,10,1);v'
'set ccolor 1'
'set cthick 5'
'set arrscl 0.5 40 ' ;*20'
'set arrlab off'
'd skip(u,10,1);v'
'set strsiz 0.16 0.16'
'set string 1 c 6 90'
'draw string 0.4 9.2 [m]'
# Legend
'set parea 1.3 7.75 10.995 11'
'set xlopts 0 0 0'
'set ylopts 0 0 0'
'set gxout vector'
'set ccolor 2'
'set arrscl 0.5 40 ' ;*20'
'set arrlab on'
'd skip(u,1,1);skip(v,1,1)'
'set strsiz 0.1 0.12'
'set string 1 c 3 0'
'draw string 6.4 10.375 m/s'
'close 1'
##################### RH&Wind #####################
##################### EPT #####################
'open 'dir1'/'ctl1
'set parea 1.3 7.75 5.4 7.65'
'set arrlab off'
'set xlopts 1 0 0'
'set ylopts 1 6 0.16'
'set time 't1' 't2
'set lev 0 5000'
'set ylint 1000'
### EPT
# 'color -levs 332 334 336 338 340 342 344 -kind cornsilk->gold->orange->deeppink'
'set clev 332 334 336 338 340 342 344'
'rgbset2'
'set gxout grfill'
'd ept'
'xcbar 8 8.1 5.5 7.5 -fw 0.12 -fh 0.13 -fs 2 -ft 5 -dir v -line on -edge triangle'
'set strsiz 0.13 0.13'
'set string 1 c 6'
'draw string 8.3 7.8 [K]'
'set strsiz 0.16 0.16'
'set string 1 c 6 90'
'draw string 0.4 6.5 [m]'
'close 1'
##################### EPT #####################
##################### Flux ####################
'set parea 1.3 7.8 3.5 5.0'
'open 'dir2'/'ctl2
'set time 't1' 't2
'set xlopts 1 0 0'
'set yflip off'
'set vrange -100 200'
'set ylint 50'
'set ccolor 8'
'set cthick 6'
'set cmark 0'
'set cstyle 1'
'd lh'
'set ccolor 2'
'set cthick 6'
'set cmark 0'
'set cstyle 1'
'd sh'
'set ylpos 0 r'
'set vrange 0 18'
'set ylint 3'
'set ccolor 1'
'set cthick 6'
'set cmark 0'
'd ws'
'close 1'
##################### Flux ####################
##################### SST&SAT ####################
'set parea 1.3 7.8 1.5 3'
'open 'dir2'/'ctl2
'set time 't1' 't2
'set xlopts 1 5 0.15'
'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'
##################### SST&SAT ####################
##################
'set string 1.2 l 5 0'
'set strsiz 0.17 0.17'
'set strsiz 0.15 0.15'
'set string 1.2 c 5 90'
'draw string 0.65 4.3 [W/m`a2`n]'
'draw string 8.35 4.35 [m/s]'
'draw string 0.65 2.5 [`ao`nC]'
'set string 1.2 c 5 0'
###### 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 4.8 Ws [m/s]'
'set string 8'
'draw string 7.05 4.6 LHF [W/m`a2`n]'
'set string 2'
'draw string 7.05 4.4 SHF [W/m`a2`n]'
'set line 1'
'draw line 5.9 4.8 6.4 4.8'
'set line 8'
'draw line 5.9 4.6 6.4 4.6'
'set line 2'
'draw line 5.9 4.4 6.4 4.4'
###### c label ######
###### d label ######
'set strsiz 0.1 0.1'
'set string 2'
'draw string 6.7 2.8 SST' ;* [`ao`nC]'
'set string 4'
'draw string 6.7 2.6 SAT' ;* [`ao`nC]'
'set line 2'
'draw line 6 2.8 6.5 2.8'
'set line 4'
'draw line 6 2.6 6.5 2.6'
###### d label ######
###### Panel ######
'set strsiz 0.20 0.20'
'set string 1 c 6 0'
'draw string 0.25 10.25 (a)'
'draw string 0.25 7.6 (b)'
'draw string 0.25 5.0 (c)'
'draw string 0.25 3.0 (d)'
###### Panel ######
say ' '
'print 'out
say ' '
if ( quitopt = 'yes' ) ; quit ; endif
return
$ time-height.sonde.run.sh
...
... Lots of messages
...
EPS file written to time-height.sonde.meisei.eps
No hardcopy metafile open