<div dir="ltr"><div><div><div><div><div><div>PLease: Do *<b>NOT</b>* send NCL usage questions to <a href="mailto:ncl-install@ucar.edu">ncl-install@ucar.edu</a> or <a href="mailto:ncl@ucar.edu">ncl@ucar.edu</a>. <br>Send only to ncl-talk@ucar,edu<br><br>---<br> 59 do ifs=0,nfs-1<br> 60 f = addfile(fs(ifs)+".nc","r")<br> 61 time(ifs) = wrf_user_list_times(f)<br>---<br></div><div>Left-Hand-Side: 'ifs' is an integer. Hence, time(ifs) is size 1<br></div>Right-Hand-Size: Before line 61 add:<br><br></div> TIME = wrf_user_list_times(f)<br></div> print(TIME)<br><br></div>This will tell you the number of times on the current file. Likely, it is > 1<br><br>===<br></div>The demonstration scripts are templates based on user applications. They are not 'plug in a file or files and it it will work.' <br><br></div>You must look at your data and make appropriate changes.<br><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Dec 10, 2017 at 12:19 AM, Karimar Ledesma-Maldonado <span dir="ltr"><<a href="mailto:k.ledesma@nevada.unr.edu" target="_blank">k.ledesma@nevada.unr.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><span style="font-size:12.8px">Hi!</span><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">I'm trying to plot the track of Hurricanne Maria but I continue having this error:</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px"><div>fatal:Dimension sizes on right hand side of assignment do not match dimension sizes of left hand side</div><div>fatal:["Execute.c":8640]:Execu<wbr>te: Error occurred at or near line 61 in file ujum.ncl</div><div><br></div><div>I'm trying to figure it out what is the problem. This is the script that I'm using:</div><div><br></div><div><pre style="white-space:pre-wrap;color:rgb(0,0,0);word-wrap:break-word">;*****************************<wbr>***************************
; Plot storm stracks from wrfout files.
;*****************************<wbr>***************************
;
; JUN-18-2005
; So-Young Ha (MMM/NCAR)
; SEP-01-2006
; Slightly modified by Mary Haley to add some extra comments.
; ==============================<wbr>=============
load "$NCARG_ROOT/lib/ncarg/nclscri<wbr>pts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscri<wbr>pts/csm/gsn_csm.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscri<wbr>pts/csm/contributed.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscri<wbr>pts/wrf/WRF_contributed.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscri<wbr>pts/wrf/WRFUserARW.ncl"
begin
; DATES
date = (/1512,1600,1612,1700,1712,180<wbr>0,1812,1900/)
ndate = dimsizes(date)
sdate = sprinti("%4.0i",date)
; Experiment name (for legend)
EXP = (/"EXP_I"/) ; (/"EXP_I","EXP_II","EXP_III"/)
nexp = dimsizes(EXP)
; To get lat/lon info.
a = addfile("wrfout_d03_2017-09-18<wbr>_00_00_00","r")
lat2d = a->XLAT(0,:,:)
lon2d = a->XLONG(0,:,:)
dimll = dimsizes(lat2d)
nlat = dimll(0)
mlon = dimll(1)
; Sea Level Pressure
slp = wrf_user_getvar(a,"slp",0)
dims = dimsizes(slp)
; Array for track
time = new(ndate,string)
imin = new(ndate,integer)
jmin = new(ndate,integer)
smin = new(ndate,integer)
; =======
; ndate
; =======
fs = systemfunc("ls wrfout*00")
nfs= dimsizes(fs)
if(nfs .ne. ndate) then
print("Check input data:"+nfs+" .ne. "+ndate)
end if
do ifs=0,nfs-1
f = addfile(fs(ifs)+".nc","r")
time(ifs) = wrf_user_list_times(f)
; print(time(ifs))
slp2d = wrf_user_getvar(f,"slp",0)
; We need to convert 2-D array to 1-D array to find the minima.
slp1d = ndtooned(slp2d)
smin(ifs) = minind(slp1d)
; Convert the index for 1-D array back to the indeces for 2-D array.
minij = ind_resolve(ind(slp1d.eq.min(s<wbr>lp2d)),dims)
imin(ifs) = minij(0,0)
jmin(ifs) = minij(0,1)
; print(time(ifs)+" : "+min(slp2d)+" ("+imin(ifs)+","+jmin(ifs)+")"<wbr>)
end do
;
; Graphics section
wks=gsn_open_wks("ps","track") ; Open PS file.
gsn_define_colormap(wks,"BlGrY<wbr>eOrReVi200") ; Change color map.
res = True
res@gsnDraw = False ; Turn off draw.
res@gsnFrame = False ; Turn off frame advance.
res@gsnMaximize = True ; Maximize plot in frame.
res@tiMainString = "Hurricane Isabel" ; Main title
WRF_map_c(a,res,0) ; Set up map resources
; (plot options)
plot = gsn_csm_map(wks,res) ; Create a map.
; Set up resources for polymarkers.
gsres = True
gsres@gsMarkerIndex = 16 ; filled dot
;gsres@gsMarkerSizeF = 0.005 ; default - 0.007
cols = (/5,160,40/)
; Set up resources for polylines.
res_lines = True
res_lines@gsLineThicknessF = 3. ; 3x as thick
dot = new(ndate,graphic) ; Make sure each gsn_add_polyxxx call
line = new(ndate,graphic) ; is assigned to a unique variable.
; Loop through each date and add polylines to the plot.
do i = 0,ndate-2
res_lines@gsLineColor = cols(0)
xx=(/lon2d(imin(i),jmin(i)),lo<wbr>n2d(imin(i+1),jmin(i+1))/)
yy=(/lat2d(imin(i),jmin(i)),la<wbr>t2d(imin(i+1),jmin(i+1))/)
line(i) = gsn_add_polyline(wks,plot,xx,y<wbr>y,res_lines)
end do
lon1d = ndtooned(lon2d)
lat1d = ndtooned(lat2d)
; Loop through each date and add polymarkers to the plot.
do i = 0,ndate-1
print("dot:"+lon1d(smin(i))+",<wbr>"+lat1d(smin(i)))
gsres@gsMarkerColor = cols(0)
dot(i)=gsn_add_polymarker(wks,<wbr>plot,lon1d(smin(i)),lat1d(smin<wbr>(i)),gsres)
end do
; Date (Legend)
txres = True
txres@txFontHeightF = 0.015
txres@txFontColor = cols(0)
txid1 = new(ndate,graphic)
; Loop through each date and draw a text string on the plot.
do i = 0, ndate-1
txres@txJust = "CenterRight"
ix = smin(i) - 4
print("Eye:"+ix)
if(i.eq.1) then
txres@txJust = "CenterLeft"
ix = ix + 8
end if
txid1(i) = gsn_add_text(wks,plot,sdate(i)<wbr>,lon1d(ix),lat1d(ix),txres)
end do
; Add marker and text for legend. (Or you can just use "pmLegend" instead.)
txres@txJust = "CenterLeft"
txid2 = new(nexp,graphic)
pmid2 = new(nexp,graphic)
do i = 0,nexp-1
gsres@gsMarkerColor = cols(i)
txres@txFontColor = cols(i)
ii = ((/129,119,109/)) ; ilat
jj = ((/110,110,110/)) ; jlon
ji = ii*mlon+jj ; col x row
pmid2(i) = gsn_add_polymarker(wks,plot,lo<wbr>n1d(ji(i)),lat1d(ji(i)),gsres)
txid2(i) = gsn_add_text(wks,plot,EXP(i),l<wbr>on1d(ji(i)+5),lat1d(ji(i)),txr<wbr>es)
end do
draw(plot)
frame(wks)
end</pre><pre style="white-space:pre-wrap;color:rgb(0,0,0);word-wrap:break-word"><br></pre><pre style="white-space:pre-wrap;color:rgb(0,0,0);word-wrap:break-word">I appreciate any help, thanks</pre></div></div><span class="HOEnZb"><font color="#888888"><div><div class="m_-6705039976954480921gmail_signature"><div dir="ltr"><font style="font-size:12.8px" color="#ff00ff"><b>Karimar Ledesma-Maldonado</b></font><div style="font-size:12.8px"><div style="font-size:12.8px"><span style="font-family:tahoma,sans-serif"><span style="color:rgb(153,153,153)"><font size="1">Graduate Student <br>Department of Atmospheric Sciences<br></font></span></span></div><div style="font-size:12.8px"><span style="font-family:tahoma,sans-serif"><span style="color:rgb(153,153,153)"><font size="1">Desert Research Institute<br></font></span></span></div><span style="font-size:12.8px;font-family:tahoma,sans-serif"><span style="color:rgb(153,153,153)"><font size="1">University of Nevada Reno</font></span></span></div></div></div></div>
</font></span></div>
<br>______________________________<wbr>_________________<br>
ncl-install mailing list<br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-install" rel="noreferrer" target="_blank">http://mailman.ucar.edu/<wbr>mailman/listinfo/ncl-install</a><br>
<br></blockquote></div><br></div>