<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p>Hi Mary <br>
</p>
<p><br>
</p>
<p>Kindly see the script below which I use with the bash script to determine the average of 2M TEMPERATURE contained in the whole of WRF out directory. I intend to skip the first 12 hours (spin up time) and I also tend to plot the final average in one plot.
Kindly let me know if you can help me out <br>
</p>
<p><br>
</p>
<p></p>
<div>load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"<br>
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"<br>
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"<br>
load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"<br>
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"<br>
load "/data/muhdomer/NSCC/scratch/WRF_myfunc.ncl"<br>
begin<br>
<br>
<div> DATADir = "./"<br>
<br>
FILES = systemfunc (" ls -1 " + DATADir + "wrfout_d05* ")<br>
<br>
a = addfiles(FILES+".nc","r")<br>
<br>
</div>
<br>
tc2 = wrf_user_getvar(a,"T2",-1)</div>
<div> <span>tc2 = tc2-273.16</span><br>
</div>
<div> times = a[:]->Times<br>
ntimes = dimsizes(times) ; number of times in the file<br>
ntimes_plot = ntimes(0) ; abandon the first 12 hours <br>
<br>
<br>
lh3d = new((/30,129,210/), float)<br>
lh2d = new((/129,210/), float)<br>
c = 0 <br>
do i=time_serie, ntimes_plot-2,24<br>
lh2d(:,:) = tc2(i,:,:)<br>
lh3d(c,:,:) = lh2d(:,:)<br>
c = c + 1</div>
<div> end do<br>
lh_avg = dim_avg_n(lh3d,0)<br>
type = "x11"<br>
wks= gsn_open_wks(type,"temp_"+hour)<br>
gsn_define_colormap(wks,"spread_15lev")<br>
<br>
res = True<br>
res@cnLevelSelectionMode = "ExplicitLevels"<br>
res@cnLevels=(/24,25,26,27,28,29,30,31,32,33,34,35,36/)<br>
res@InitTime = False<br>
res@Footer = False<br>
res@gsnMaximize = True<br>
res@gsnPaperOrientation = "landscape"<br>
pltres = True<br>
pltres@NoTitles = True<br>
pltres@gsnMaximize = True<br>
pltres@FramePlot = False<br>
pltres@PanelPlot = True<br>
mpres = True<br>
mpres@mpFillOn = False<br>
mpres@mpGeophysicalLineColor = "black"<br>
mpres@mpGeophysicalLineThicknessF = 0.0 ; for type = "png"<br>
mpres@mpDataBaseVersion="Ncarg4_1"<br>
mpres@mpDataSetName="Earth..4"<br>
mpres@mpDataResolution="Finest"<br>
mpres@mpOutlineOn=False<br>
<br>
lh_avg@description = "temperature averaged"<br>
<br>
lh_avg@units = "degree C"<br>
opts = res<br>
opts@cnFillOn = True<br>
contour_lh = wrf_contour(a[0],wks,lh_avg,opts)<br>
delete(opts)<br>
plot = wrf_map_overlays(a[0],wks,contour_lh,pltres,mpres)<br>
</div>
<div> shape_files = (/"/data/muhdomer/NSCC/scratch/Shapefiles/MYS_adm0.shp","/data/muhdomer/NSCC/scratch/Shapefiles/IDN_adm0.shp","/data/muhdomer/NSCC/scratch/Shapefiles/MP14_REGION_NO_SEA_PL.shp"/)<br>
<br>
plot = add_coastline_sgmyid(shape_files,wks,plot,"black")<br>
</div>
<div><br>
</div>
<div> draw(plot)<br>
frame(wks)<br>
end</div>
<br>
<p></p>
<p>Regards <br>
</p>
<p><br>
</p>
<p>Muhammad Omer<br>
</p>
<div id="Signature">
<div id="divtagdefaultwrapper" style="font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); font-family: Calibri,Arial,Helvetica,sans-serif,"EmojiFont","Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols;">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px"><b><br>
</b></div>
<div style="color:rgb(33,33,33); font-family:wf_segoe-ui_normal,'Segoe UI','Segoe WP',Tahoma,Arial,sans-serif; font-size:15.4545450210571px; margin:0px; background-color:rgb(255,255,255)">
<font size="3" face="Times New Roman,serif"><span style="font-size:12pt"><font size="2" face="Arial Bold" color="#1F497D"><span style="font-size:11pt">Muhammad Omer Mughal</span></font></span></font></div>
<div style="color:rgb(33,33,33); font-family:wf_segoe-ui_normal,'Segoe UI','Segoe WP',Tahoma,Arial,sans-serif; font-size:15.4545450210571px; margin:0px; background-color:rgb(255,255,255)">
<font size="3" face="Times New Roman,serif"><span style="font-size:12pt"><font size="2" face="Arial Bold" color="#1F497D"><span style="font-size:11pt">MSc BSc Mechanical Engineering</span></font><font size="1" face="Arial,sans-serif" color="#1F497D"><span style="font-size:8pt"><br>
</span></font><font size="2" face="Arial Bold" color="#AB8303"><span style="font-size:9pt">PhD Research Scholar</span></font></span></font></div>
<div style="color:rgb(33,33,33); font-family:wf_segoe-ui_normal,'Segoe UI','Segoe WP',Tahoma,Arial,sans-serif; font-size:15.4545450210571px; margin:0px; background-color:rgb(255,255,255)">
<font size="3" face="Times New Roman,serif"><span style="font-size:12pt"><font size="2" face="Arial Bold" color="#AB8303"><span style="font-size:9pt">Remote Sensing and Satellite Research Group</span></font></span></font></div>
<div style="color:rgb(33,33,33); font-family:wf_segoe-ui_normal,'Segoe UI','Segoe WP',Tahoma,Arial,sans-serif; font-size:15.4545450210571px; margin:0px; background-color:rgb(255,255,255)">
<font size="3" face="Times New Roman,serif"><span style="font-size:12pt"><font size="2" face="Arial Bold" color="#AB8303"><span style="font-size:9pt">Department of Imaging and Applied Physics</span></font><font size="2" face="Arial Bold" color="#AB8303"><span style="font-size:9pt"><br>
Curtin University</span></font><font size="2" face="Arial Bold" color="#AB8303"><span style="font-size:9pt"><br>
</span></font><font size="2" face="Calibri,sans-serif" color="#1F497D"><span style="font-size:11pt"><br>
</span></font><font size="2" face="Arial Bold" color="#1F497D"><span style="font-size:9pt">Curtin University</span></font><font size="2" face="Arial Bold" color="#1F497D"><span style="font-size:9pt"><br>
</span></font><font size="2" face="Arial Bold" color="#AB8303"><span style="font-size:9pt">Tel |</span></font><font size="2" face="Arial Bold" color="#1F497D"><span style="font-size:9pt"> </span></font><font size="2" face="Arial,sans-serif" color="#1F497D"><span style="font-size:9pt">+61
8 9266 7962</span></font><font size="2" face="Calibri,sans-serif" color="#1F497D"><span style="font-size:9pt"> </span></font><font size="1" face="Calibri,sans-serif" color="#1F497D"><span style="font-size:7pt"><br>
</span></font><font size="2" face="Arial Bold" color="#AB8303"><span style="font-size:9pt">Fax |</span></font><font size="2" face="Arial Bold" color="#1F497D"><span style="font-size:9pt"> </span></font><font size="2" face="Arial,sans-serif" color="#1F497D"><span style="font-size:9pt">+61
8 9266 2377</span></font><font size="2" face="Arial,sans-serif" color="#1F497D"><span style="font-size:9pt"><br>
</span></font><font size="2" face="Arial Bold" color="#AB8303"><span style="font-size:9pt">Mobile |</span></font><font size="2" face="Calibri,sans-serif" color="#1F497D"><span style="font-size:9pt"> </span></font><font size="2" face="Arial,sans-serif" color="#1F497D"><span style="font-size:9pt">0470 237 525</span></font><font size="2" face="Calibri,sans-serif" color="#1F497D"><span style="font-size:9pt"> </span></font><font size="2" face="Calibri,sans-serif" color="#1F497D"><span style="font-size:9pt"><br>
</span></font><font size="2" face="Calibri,sans-serif" color="#1F497D"><span style="font-size:9pt"><br>
</span></font><font size="2" face="Arial Bold" color="#AB8303"><span style="font-size:9pt">Email |</span></font><font size="2" face="Calibri,sans-serif" color="#1F497D"><span style="font-size:9pt"> </span></font><a href="mailto:m.lynch@curtin.edu.au" target="_blank" id="LPNoLP"><font size="2" face="Arial,sans-serif"><span style="font-size:9pt">m.mughal1@postgrad.curtin.edu.au</span></font></a><font size="2" face="Arial,sans-serif" color="#1F497D"><span style="font-size:9pt"> </span></font><font size="2" face="Arial,sans-serif" color="#1F497D"><span style="font-size:9pt"><br>
</span></font><font size="2" face="Arial Bold" color="#AB8303"><span style="font-size:9pt">Web |</span></font><font size="2" face="Calibri,sans-serif" color="#AB8303"><span style="font-size:9pt"> </span></font><a href="http://curtin.edu.au/" target="_blank" id="LPNoLP"><font size="2" face="Calibri,sans-serif"><span style="font-size:11pt"><font size="2" face="Arial,sans-serif"><span style="font-size:9pt">http://curtin.edu.au</span></font></span></font></a><font size="2" face="Arial,sans-serif" color="#1F497D"><span style="font-size:9pt"><br>
</span></font><font size="1" face="Calibri,sans-serif" color="#1F497D"><span style="font-size:7pt"><br>
</span></font></span></font></div>
<div style="color:rgb(33,33,33); font-family:wf_segoe-ui_normal,'Segoe UI','Segoe WP',Tahoma,Arial,sans-serif; font-size:15.4545450210571px; margin:0px; background-color:rgb(255,255,255)">
<font size="1" face="Calibri,sans-serif" color="#1F497D"><span style="font-size:6pt"></span></font><font size="1" face="Arial,sans-serif" color="#1F497D"><span style="font-size:6pt">Curtin University is a trademark of Curtin University of Technology. </span></font><br>
</div>
<div style="color:rgb(33,33,33); font-family:wf_segoe-ui_normal,'Segoe UI','Segoe WP',Tahoma,Arial,sans-serif; font-size:15.4545450210571px; margin:0px; background-color:rgb(255,255,255)">
<font size="3" face="Times New Roman,serif"><span style="font-size:12pt"><font size="1" face="Arial,sans-serif" color="#1F497D"><span style="font-size:6pt">CRICOS Provider Code 00301J (WA), 02637B (NSW)</span></font></span></font></div>
<div style="color:rgb(33,33,33); font-family:wf_segoe-ui_normal,'Segoe UI','Segoe WP',Tahoma,Arial,sans-serif; font-size:15.4545450210571px; margin:0px; background-color:rgb(255,255,255)">
<font size="3" face="Times New Roman,serif"><span style="font-size:12pt"><font size="1" face="Arial,sans-serif" color="#1F497D"><span style="font-size:6pt"><br>
</span></font></span></font></div>
<div style="color:rgb(33,33,33); font-family:wf_segoe-ui_normal,'Segoe UI','Segoe WP',Tahoma,Arial,sans-serif; font-size:15.4545450210571px; margin:0px; background-color:rgb(255,255,255)">
<font size="3" face="Times New Roman,serif"><span style="font-size:12pt"><font size="1" face="Arial,sans-serif" color="#1F497D"><span style="font-size:6pt"><br>
</span></font></span></font></div>
</div>
</div>
</div>
</div>
</body>
</html>