ECCOは低解像度のため黒潮のオーバーシュートが大きいようだ。
$ pl.uvtsrho.all.run.sh
aofd165.bio.mie-u.ac.jp
/work1/am/TEACHING/Shourai.Kikou.Yosoku/UVSST
Tue Jun 21 15:02:09 JST 2016
======================
pl.uvtsrho.all.run.sh
======================
#!/bin/bash
exe=pl.uvtsrho.run.sh
if [ ! -f $exe ]; then
echo
echo Error in $0 : No such file, $exe
echo
exit 1
fi
yyyy=2014 #1993
yyyye=2014
ydlist="\
n10day_10_18 \
"
n10day_01_09 \
n10day_19_27 \
n10day_28_37 \
vlev=1
while [ $yyyy -le $yyyye ]; do
for yearday in $ydlist; do
if [ $yearday = "n10day_28_37" ]; then
de=10
else
de=9
fi
day=1
while [ $day -le $de ]; do
$exe $yyyy $yearday $day $vlev
day=$(expr $day + 1)
done #day
done # yearday
yyyy=$(expr $yyyy + 1)
done # yyyy
exit 0
----------------------
End of pl.uvtsrho.all.run.sh
----------------------
======================
pl.uvtsrho.ncl
======================
;
; Plot horizontal map of U,V,T,S & RHO ECCO dr080 dataset
;
; Refer to http://dx.doi.org/10.1002/2014JC010336 for details on dr080
;
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"
begin
wallClock1 = systemfunc("date") ; retrieve wall clock time
;
; Read command line arguments
;
scname = getenv("NCL_ARG_1")
infle1 = getenv("NCL_ARG_2")
infle2 = getenv("NCL_ARG_3")
infle3 = getenv("NCL_ARG_4")
infle4 = getenv("NCL_ARG_5")
day = getenv("NCL_ARG_6")
vlev = getenv("NCL_ARG_7")
outdir = getenv("NCL_ARG_8")
day_no=stringtointeger(day)
;
; Read input data
;
fu=addfile(infle1,"r")
fv=addfile(infle2,"r")
ft=addfile(infle3,"r")
fs=addfile(infle4,"r")
u3d=fu->Uave(day_no-1,:,:,:)
v3d=fv->Vave(day_no-1,:,:,:)
t3d=ft->Tave(day_no-1,:,:,:)
s3d=fs->Save(day_no-1,:,:,:)
time=ft->time(day_no-1)
z1d=ft->depth
;
; Set date
;
julian0=greg2jul(1970,01,01,00)
;
; float time(time) ;
; time:units = "hours since 1970-01-01 00:00:0.0" ;
;
julim0=julian0 + time/24.0 -5
julim1=julian0 + time/24.0 +4
greg0=jul2greg(julim0)
greg1=jul2greg(julim1)
date0=greg0(0)+sprinti("%0.2i",greg0(1))+sprinti("%0.2i",greg0(2))
date1=greg1(0)+sprinti("%0.2i",greg1(1))+sprinti("%0.2i",greg1(2))
dateprt0=greg0(0) + "/" +sprinti("%0.2i",greg0(1)) + "/" +sprinti("%0.2i",greg0(2))
dateprt1=greg1(0) + "/" +sprinti("%0.2i",greg1(1)) + "/" +sprinti("%0.2i",greg1(2))
dateprt=dateprt0 + "-" + dateprt1
;Set depth
klev=stringtointeger(vlev)-1
z=floattointeger(z1d(klev))
;Set 2D vars
t2d=t3d(klev,:,:)
s2d=s3d(klev,:,:)
u2d=u3d(klev,:,:)
v2d=v3d(klev,:,:)
;
; Potential temperature
;
pd = depth_to_pres( z1d, False )*10 ; bars*10 => decibars
pref= 0.0 ; user specified reference pressure (dbars)
pd@units = "decibar" ; must be decibar units
pot3d=t3d
pot3d = potmp_insitu_ocn(t3d,s3d,pd,pref, 0 ,False) ; pot(ntim,klev,nlat,nlon)
pot2d = pot3d(klev,:,:)
;
; Potential density
;
;dref=0.0
;pd2d=t2d
;pd2d=rho_mwjf(t2d,s2d,dref)
;pd2d=1000.*(pd2d - 1.0) ; Put into kg/m3 pot den units
;
; Set output file name
;
filetype="png" ;"ps"
ofle=outdir + "/" + "ECCO.dr080_UVTS.rho." + sprinti("%0.5i",z) + "m." + date0 + "-" + date1 + "." + filetype
wks = gsn_open_wks(filetype,ofle)
;
; Set NCL resources
;
res = True
res@gsnDraw = False ; don't draw
res@gsnFrame = False ; don't advance frame
;Figure size
;res@vpHeightF = 0.35
;res@vpWidthF = 0.55
;res@vpXF = 0.2
;Map
res@mpFillOn = True
;Contour
res@cnFillOn = True ; turn on color fill
res@cnLinesOn = False
res@lbOrientation = "vertical"
res@cnLevelSelectionMode = "ManualLevels" ; manually set the contour levels with the following 3 resources
;Choose subregion
res@mpMinLatF = 20 ;-20
res@mpMaxLatF = 45 ;20
res@mpMinLonF = 115; 40
res@mpMaxLonF = 150; 110
res@mpDataBaseVersion = "Ncarg4_1" ; use GMT coastline
;
; Upper panel
;
res1=res
;res1@vpYF = 0.9
res1@cnMinLevelValF = 6 ; set min contour level
res1@cnMaxLevelValF = 28 ;32 ; set max contour level
res1@cnLevelSpacingF = 2 ; set contour spacing
res1@gsnLeftString = dateprt ; add the gsn titles
res1@gsnCenterString = "T & ~F33~s ~B~q"
res1@gsnRightString = z + " m"
tcon = gsn_csm_contour_map(wks,t2d(:,:),res1) ; Draw a contour plot.
plot=tcon
;respd=True
;respd@gsnDraw = False ; don't draw
;respd@gsnFrame = False ; don't advance frame
;respd@cnMinLevelValF = 10 ; set min contour level
;respd@cnMaxLevelValF = 32 ; set max contour level
;respd@cnLevelSpacingF = 0.5 ; set contour spacing
;
;respd@cnFillOn = False ; turn off color fill
;respd@cnLineColor = "white"
;respd@gsnContourLineThicknessesScale=4
;respd@cnLabelMasking = True
;respd@cnLineLabelBackgroundColor= "Transparent"
;respd@cnLineLabelFontColor="white"
;respd@cnLineLabelFontHeightF = 0.017
;respd@cnLineLabelFont=22
;respd@cnLineThicknessF=2
;respd@cnLineLabelDensityF = 1.5 ; increase the number of line labels/line
;respd@cnLineLabelInterval = 1 ; labels for every line (default=2)
;
;respd@cnInfoLabelOn = False
;
;respd@gsnLeftString = "" ; add the gsn titles
;respd@gsnCenterString = ""
;respd@gsnRightString = ""
;
;pdcon = gsn_csm_contour(wks,pd2d(:,:),respd)
;overlay(plot,pdcon)
vecres = True ; vector only resources
vecres@gsnDraw = False ; don't draw
vecres@gsnFrame = False ; don't advance frame
vecres@vcGlyphStyle="CurlyVector"
vecres@vcLineArrowThicknessF = 2
vecres@vcRefMagnitudeF = 0.2 ; define vector ref mag
vecres@vcRefLengthF = 0.045 ; define length of vec ref
vecres@gsnRightString = " " ; turn off right string
vecres@gsnLeftString = " " ; turn off left string
vecres@tiXAxisString = " " ; turn off axis label
vecres@vcFillArrowsOn = True
vecres@vcFillArrowEdgeColor = "white"
vecres@vcRefAnnoParallelPosF = 0.19 ; move ref vector into plot
vecres@vcRefAnnoOrthogonalPosF = -1
vector = gsn_csm_vector(wks,u2d(::1,::1),v2d(::1,::1),vecres)
overlay(plot,vector)
draw(plot)
delete(res1)
txres = True ; text mods desired
txres@txFontHeightF = 0.015 ; font smaller. default big
txres@txBackgroundFillColor = "white"
txres@txFontColor="black"
;gsn_text_ndc(wks,dateprt,0.635,0.585,txres)
;
; Lower panel
;
;res2=res
;
;res2@vpYF = 0.45
;
;res2@cnMinLevelValF = 30 ; set min contour level
;res2@cnMaxLevelValF = 38 ; set max contour level
;res2@cnLevelSpacingF = 1 ; set contour spacing
;
;res2@gsnLeftString = dateprt ; add the gsn titles
;res2@gsnCenterString = "S & ~F33~s ~B~q"
;res2@gsnRightString = z + " m"
;
;scon = gsn_csm_contour_map(wks,s2d(:,:),res2) ; Draw a contour plot.
;plot=scon
;
;;pdcon = gsn_csm_contour(wks,pd2d(:,:),respd)
;;overlay(plot,pdcon)
;
;vector = gsn_csm_vector(wks,u2d(::1,::1),v2d(::1,::1),vecres)
;overlay(plot,vector) ; result will be plotA
;
;draw(plot)
;delete(res2)
;
;gsn_text_ndc(wks,dateprt,0.635,0.135,txres)
;
; Header and footer
;
;drawNDCGrid(wks)
txres = True ; text mods desired
txres@txFontHeightF = 0.01 ; font smaller. default big
gsn_text_ndc(wks,outdir,0.5,0.99,txres)
text=systemfunc("date")
gsn_text_ndc(wks,text,0.2,0.010,txres)
text=systemfunc("pwd")+"/"+scname
gsn_text_ndc(wks,text,0.5,0.03,txres)
frame(wks)
print("")
print("Output: "+ ofle)
print("")
end
----------------------
End of pl.uvtsrho.ncl
----------------------
======================
pl.uvtsrho.run.sh
======================
#!/bin/sh
export LANC=C
exe=./runncl.sh
ncl=pl.uvtsrho.ncl
if [ ! -f $ncl ]; then
echo
echo Error in $0 : No such file, $ncl
echo
exit 1
fi
# Default value
dataset=dr080g
yyyy=1993
yearday=n10day_01_09
day=01
vlev=1
# Read arguments
yyyy=$1
yearday=$2
day=$3
vlev=$4
indir=/work4/data/ECCO.dr080g/${dataset}_${yyyy}/${yearday}
if [ ! -d $indir ]; then
echo
echo Error in $0 : No such directory, $indir
echo
exit 1
fi
#outdir=${HOME}/2015.Ibnu.Indian.Ocean/Fig/$(basename $(pwd))/\
outdir=Fig/\
$(basename $0 .sh)/${yyyy}
if [ ! -d $outdir ]; then
mkdir -vp $outdir
fi
if [ $yearday = "n10day_01_09" ]; then
datainfo="08_08.00001_02160_240"
elif [ $yearday = "n10day_10_18" ]; then
datainfo="08_08.02160_04320_240"
elif [ $yearday = "n10day_19_27" ]; then
datainfo="08_08.04320_06480_240"
elif [ $yearday = "n10day_28_37" ]; then
datainfo="08_08.06480_08880_240"
fi
in[0]=${indir}"/Uave_"${datainfo}".cdf"
in[1]=${indir}"/Vave_"${datainfo}".cdf"
in[2]=${indir}"/Tave_"${datainfo}".cdf"
in[3]=${indir}"/Save_"${datainfo}".cdf"
i=0
while [ $i -le 3 ]; do
if [ ! -f ${in[$i]} ]; then
echo
echo Error in $0 : No such file, ${in[$i]}
echo
exit 1
fi
i=$(expr $i + 1)
done
$exe $ncl ${in[0]} ${in[1]} ${in[2]} ${in[3]} ${day} ${vlev} ${outdir}
echo
echo Done $(basename $0).
echo
----------------------
End of pl.uvtsrho.run.sh
----------------------
======================
runncl.sh
======================
#!/bin/bash
#
# Universal wrapper script for ncl.
# Pass arguments from the command line to environment variables
#
# version 0.1, Thierry Corti, C2SM ETH Zurich
#
E_BADARGS=65
if [ ! -n "$1" ]
then
echo "Usage: `basename $0` script.ncl argument1 argument2 etc."
exit $E_BADARGS
fi
# save number of arguments to environment variable NCL_N_ARG
export NCL_N_ARGS=$#
# save command line arguments to environment variable NCL_ARG_#
for ((index=1; index<=$#; index++))
do
eval export NCL_ARG_$index=\$$index
done
# run ncl
ncl $1
----------------------
End of runncl.sh
----------------------