<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On 5 Jan 2017, at 20:54, Lyndon Mark Olaguera <<a href="mailto:olagueralyndonmark429@gmail.com" class="">olagueralyndonmark429@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><b style="font-family: Helvetica; font-style: normal; font-variant-caps: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: rgb(255, 0, 0); font-size: 12.8px;" class="">sfvp = sfvp(1,:,:,:)</b></div></blockquote></div><br class=""><div class="">This won’t in NCL. NCL won’t dynamically change the size of an existing variable. </div><div class=""><br class=""></div><div class="">You can (assuming you’re using a recent version of NCL) however use the := notation, which will effectively redefine the sfvp variable. e.g. sfvp := sfvp(1,:,:,:)</div><div class="">Then the rest of your script should work as expected. </div><div class=""><br class=""></div><div class="">Though for the sake of having variable names that make sense I would do as below. </div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><div class=""><div class=""><div style="font-size: 12.8px;" class=""><font face="InputMono-Regular" class="">begin</font></div><div style="font-size: 12.8px;" class=""><font face="InputMono-Regular" class="">ufile = addfile("uwind200hPa_1975.nc",<wbr class="">"r") ;single level(200hPa) only</font></div><div style="font-size: 12.8px;" class=""><font face="InputMono-Regular" class="">vfile = addfile("vwind200hPa_1975.nc",<wbr class="">"r") ;single level(200hPa) only</font></div><div style="font-size: 12.8px;" class=""><font face="InputMono-Regular" class=""><br class=""></font></div><div style="font-size: 12.8px;" class=""><font face="InputMono-Regular" class="">uwnd = ufile->uwnd(:,0,::-1,:) ;sort coordinates usinf ::-1</font></div><div style="font-size: 12.8px;" class=""><font face="InputMono-Regular" class="">printVarSummary(uwnd)</font></div><div style="font-size: 12.8px;" class=""><font face="InputMono-Regular" class=""><br class=""></font></div><div style="font-size: 12.8px;" class=""><font face="InputMono-Regular" class="">vwnd = vfile->vwnd(:,0,::-1,:) ;sort coordinates using ::-1</font></div><div style="font-size: 12.8px;" class=""><font face="InputMono-Regular" class="">printVarSummary(vwnd)</font></div><div style="font-size: 12.8px;" class=""><font face="InputMono-Regular" class=""><br class=""></font></div><div style="font-size: 12.8px;" class=""><font face="InputMono-Regular" class="">sfvp = uv2sfvpF(uwnd,vwnd)</font></div><div style="font-size: 12.8px;" class=""><font face="InputMono-Regular" class=""><br class=""></font></div><div style="font-size: 12.8px;" class=""><font face="InputMono-Regular" class="">vp = sfvp(1,:,:,:)</font></div><div style="font-size: 12.8px;" class=""><font face="InputMono-Regular" class=""><br class=""></font></div><div style="font-size: 12.8px;" class=""><font face="InputMono-Regular" class="">vp = vp/1e6 ;rescaling by 1e6</font></div><div style="font-size: 12.8px;" class=""><font face="InputMono-Regular" class=""><br class=""></font></div><div style="font-size: 12.8px;" class=""><font face="InputMono-Regular" class="">copy_VarCoords(uwnd,vp)</font></div><div style="font-size: 12.8px;" class=""><font face="InputMono-Regular" class="">vp@long_name = "velocity potential"</font></div><div class=""><font face="InputMono-Regular" style="font-size: 12.8px;" class="">vp@units = "m/s</font><font face="InputMono-Regular" class=""><span style="font-size: 12.800000190734863px;" class="">”</span></font></div><div style="font-size: 12.8px;" class=""><span style="font-family: InputMono-Regular;" class="">printVarSummary(</span><span style="font-family: InputMono-Regular;" class="">vp</span><span style="font-family: InputMono-Regular;" class="">)</span></div></div><div style="font-size: 12.8px;" class=""><span style="font-family: InputMono-Regular;" class=""><br class=""></span></div><div style="font-size: 12.8px;" class=""><div class=""><font face="InputMono-Regular" class="">ncdf = addfile("<a href="http://test.nc/" target="_blank" class="">test.nc</a>" ,"c") ; open output netCDF file</font></div><div class=""><font face="InputMono-Regular" class=""><br class=""></font></div><div class=""><font face="InputMono-Regular" class="">fAtt = True ; assign file attributes</font></div><div class=""><font face="InputMono-Regular" class="">fAtt@title = "Velocity Potential"</font></div><div class=""><font face="InputMono-Regular" class="">fAtt@source_file = "<a href="https://www.esrl.noaa.gov/psd/data/gridded/data.ncep.reanalysis.pressure.html" target="_blank" class="">https://www.esrl.noaa.gov/<wbr class="">psd/data/gridded/data.ncep.<wbr class="">reanalysis.pressure.html</a>"</font></div><div class=""><font face="InputMono-Regular" class="">fAtt@Conventions = "None"</font></div><div class=""><font face="InputMono-Regular" class="">fAtt@creation_date = systemfunc ("date")</font></div><div class=""><font face="InputMono-Regular" class="">fileattdef( ncdf, fAtt ) ; copy file attributes</font></div><div class=""><font face="InputMono-Regular" class=""><br class=""></font></div><div class=""><font face="InputMono-Regular" class="">ncdf->sfvp = vp</font></div><div class=""><font face="InputMono-Regular" class="">end</font></div><div class=""><br class=""></div></div></div></div></body></html>