$ srcdump.sh jofuro-2.monthly.anomaly.ncl
------------------------------
List of the following files:
------------------------------
jofuro-2.monthly.anomaly.ncl
------------------------------
Machine info
------------------------------
aofd165.bio.mie-u.ac.jp
/work2/am/2017.Heavy.Rain/J-OFURO2
Sat Jul 15 07:59:45 JST 2017
======================
jofuro-2.monthly.anomaly.ncl
======================
begin
indir="/misc/raid112MANDA/KakenA.H28/J-OFURO2"
prefix="J-OFURO2_LHF_HF004_MONTHLY_"
;mmm="JUN"
mmm="JUL"
figdir="Fig.monthly/"+mmm
system("mkdir -vp "+figdir)
if (mmm .eq. "JUN" )then
mm=6-1
end if
if (mmm .eq. "JUL" )then
mm=7-1
end if
yyyys=1988
yyyye=2008
script_name = get_script_name()
script_no_suffix = systemfunc("basename "+ script_name +" .ncl")
;print("script_no_suffix =" +script_no_suffix)
;print("")
figtype="png"
; CLIMATOLOGY
fns=systemfunc("ls "+indir+"/"+prefix+"*"+".nc")
print(fns)
fas = addfiles(fns,"r")
lhfall = fas[:]->LHF
yyyy=1988
infle=prefix+yyyy+".nc"
f = addfile(indir+"/"+infle,"r")
lonc=f->XLONG
latc=f->YLAT
dim=dimsizes(lhfall)
nmonth=dim(0)
nlat=dim(1)
nlon=dim(2)
clim=new( (/nlat,nlon/) ,typeof(lhfall))
clim=0.0
printVarSummary(clim)
do n=mm,nmonth-1,12
clim(:,:)=clim(:,:)+lhfall(n,:,:)
end do ;n
clim=clim/(yyyye-yyyys+1.0)
clim!0="lat"
clim!1="lon"
clim&lat=latc
clim&lon=lonc
clim&lat@units = "degrees_north"
clim&lon@units = "degrees_east"
figfile=figdir+"/"+script_no_suffix+"_"+prefix+mmm+"_CLIM"
res = True ; make plot mods
res@gsnAddCyclic = False
res@sfXArray = lonc
res@sfYArray = latc
opt=res
opt@cnFillOn = True
opt@gsnFrame = False
opt@gsnDraw = False
opt@mpMinLonF = 109
opt@mpMaxLonF = 140
opt@mpMinLatF = 15
opt@mpMaxLatF = 40
opt@mpGridAndLimbOn = True
opt@pmTickMarkDisplayMode = "Always"
opt@mpGridAndLimbDrawOrder = "PostDraw"
opt@mpGridLatSpacingF=2
opt@mpGridLonSpacingF=2
wks = gsn_open_wks(figtype,figfile)
;opt@cnLevelSelectionMode = "ExplicitLevels"
;opt@cnLevels = (/ 0, 10, 20, 50, 100, 150, 200/)
opt@cnLevelSelectionMode = "ManualLevels"
opt@cnMinLevelValF = 0
opt@cnMaxLevelValF = 200
opt@cnLevelSpacingF = 10
opt@gsnLeftString = "CLIM LHF"
opt@gsnCenterString = mmm
opt@gsnRightString = "W/m~S~2~N~"
; Color Table Gallery
; http://www.ncl.ucar.edu/Document/Graphics/color_table_gallery.shtml
gsn_define_colormap(wks,"WhiteBlueGreenYellowRed")
plot=gsn_csm_contour_map(wks,clim(:,:),opt)
draw(plot)
; HEADER
system("export LANG=C")
txres = True
txres@txFontHeightF = 0.01
txres@txJust="CenterLeft"
text=indir
gsn_text_ndc(wks,text,0.05,0.97,txres)
text=systemfunc("ls -lh "+ indir +"/"+ infle)
gsn_text_ndc(wks,text,0.05,0.95,txres)
;FOOTER
txres@txFontHeightF = 0.01
txres@txJust="CenterLeft"
text = systemfunc("date")
gsn_text_ndc(wks,text, 0.05,0.010,txres)
cwd =systemfunc("pwd")
gsn_text_ndc(wks,cwd, 0.05,0.025,txres)
gsn_text_ndc(wks,figfile+"."+figtype,0.05,0.040,txres)
frame(wks)
print("")
print("Output: "+figfile+"."+figtype)
print("")
; ANOMALY
do yyyy=yyyys,yyyye
infle=prefix+yyyy+".nc"
infle_no_suffix=systemfunc("basename "+ infle +" .nc")
;print("infle_no_suffix =" +infle_no_suffix)
;print("")
a = addfile(indir+"/"+infle, "r")
; print(a)
lon = a->XLONG
lat = a->YLAT
lhf = a->LHF
; printVarSummary(lon)
; print("")
; printVarSummary(lat)
; print("")
; printVarSummary(lhf)
; print("")
figfile=figdir+"/"+script_no_suffix+"_"+prefix+mmm+yyyy+"_ANOM"
wks = gsn_open_wks(figtype,figfile)
; print(wks)
;opt@cnLevelSelectionMode = "ExplicitLevels"
;opt@cnLevels = (/ 0, 10, 20, 50, 100, 150, 200/)
opt@cnLevelSelectionMode = "ManualLevels"
opt@cnMinLevelValF = -40
opt@cnMaxLevelValF = 40
opt@cnLevelSpacingF = 4
opt@gsnLeftString = "ANOM LHF" ; add the
opt@gsnCenterString = mmm+yyyy
opt@gsnRightString = "W/m~S~2~N~"
gsn_define_colormap(wks,"BlueWhiteOrangeRed")
ano=clim
ano=lhf(mm,:,:)-clim(:,:)
plot=gsn_csm_contour_map(wks,ano,opt)
draw(plot)
; HEADER
system("export LANG=C")
txres = True
txres@txFontHeightF = 0.01
txres@txJust="CenterLeft"
text=indir
gsn_text_ndc(wks,text,0.05,0.97,txres)
text=systemfunc("ls -lh "+ indir +"/"+ infle)
gsn_text_ndc(wks,text,0.05,0.95,txres)
;FOOTER
txres@txFontHeightF = 0.01
txres@txJust="CenterLeft"
text = systemfunc("date")
gsn_text_ndc(wks,text, 0.05,0.010,txres)
cwd =systemfunc("pwd")
gsn_text_ndc(wks,cwd, 0.05,0.025,txres)
gsn_text_ndc(wks,figfile+"."+figtype,0.05,0.040,txres)
frame(wks)
;print("")
print("Output: "+figfile+"."+figtype)
;print("")
end do ;yyyy
end
----------------------
End of jofuro-2.monthly.anomaly.ncl
----------------------