Hi,
In V6.0.0 of NCL and later, you can use "addfiles" to open all files at once instead of having to loop as you are doing.
Your code would look something like this:
;---Create the list of files you want to open
files = (/"$HOME/lu_modif_wrf/base-run/wrfout_d01_2012-07-01_00:00:00.nc", \
...
"$HOME/lu_modif_wrf/allurban-run/wrfout_d01_2012-07-01_00:00:00.nc"/)
;---Use "addfiles" to open all 7 files.
f1 = addfiles(files,"r")
ListSetType(f,"join") ; This is necessary so you get an extra dimension added when you read variables
;---Read U10 off all 7 files; it will be a 7 x [...] x [...] x [...] array
U10=wrf_user_getvar(fl,"U10",-1)
For more information, see example 2 at:
http://www.ncl.ucar.edu/Document/Functions/WRF_arw/wrf_user_getvar.shtml
If this still doesn't work, then use debugging tools to look at "U10":
printVarSummary(U10)
printMinMax(U10,0) ; be sure to load $NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl to get this function
--Mary
On Apr 27, 2013, at 10:37 PM, 陶玮 wrote:
> Hi, I use ncl-6.0.0
> Sorry to make a trouble
>
>
> fl =new(7, file)
>
> fl(0) = addfile ("$HOME/lu_modif_wrf/base-run/wrfout_d01_2012-07-01_00:00:00.nc","r")
> ......
> fl(6) = addfile ("$HOME/lu_modif_wrf/allurban-run/wrfout_d01_2012-07-01_00:00:00.nc","r")
>
> do i=0, 6
> U10(i,:,:,:)=wrf_user_getvar(fl(i),"U10",-1)
> .....
> end do
>
>
> But when I plot the time series of U10, the outcome is about ~100m/s, the units seemed to be exaggerated.And there is no error info.
>
> I then used fl0, fl1, .... (it is inconvenient since cannot use do loop )to replace fl(i) in wrf_user_getvar, the outcome is right(compared with ncview).
>
> I doubt whether fl(i) is the source of problem. Is there any good way to be more efficient in my case?
>
>
> Regards.
>
>
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Apr 29 08:59:43 2013
This archive was generated by hypermail 2.1.8 : Thu May 02 2013 - 11:16:45 MDT