[ncl-talk] the script runs forever ,how to optimize ?

Alan Brammer abrammer at albany.edu
Mon Oct 13 14:59:52 MDT 2014


I didn't account for your time dimension. I don't see a wrf_interp function
that will interp across those two dimensions (time|level).  You could
create an output array of ntime x noutlevel and loop over times.

These lines are example and not intended to work without editing.

rhp= new( (/ntimes, 3/), float)

do t=0,ntimes-1
rhp(t,:) = wrf_interp_1d(rh(t,:,60,41), p(t,:,60,41), (/500,850,1000/))
end do

The error line tells you about the number of dimensions and the specific
problem.

P.s. always reply to ncl-talk, this allows everyone to help and not burden
a specific person.
On 13 Oct 2014 16:43, "Saurabh Singh" <saurabhsingh123op at gmail.com> wrote:

>
> On Tue, Oct 14, 2014 at 2:44 AM, Alan Brammer <abrammer at albany.edu> wrote:
>
>> (/500,850,1000/) )
>
>
> hey Alan
>
> i tried this script
>
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
>     load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"
>
>    files = systemfunc("ls -1
> /home/cee1/Music/Build_WRF_and_WPS.V351/WRF_and_WPS_src/WRFV3/test/em_real/2k1/wrfout_d01_2001-01-01*")
> + ".nc"
>    a = addfiles(files,"r")
> ;extraction of variables
>    time = -1
> rh = wrf_user_getvar(a,"rh",time)
> p  = wrf_user_getvar(a,"pressure",time)
> rhp = wrf_interp_1d(rh(:,60,41), p(:,60,41), (/500,850,1000/))
> asciiwrite("rh0.txt",rhp)
>
> it dosent works give an error :
> fatal:Number of subscripts do not match number of dimensions of
> variable,(3) Subscripts used, (4) Subscripts expected
> fatal:["Execute.c":7743]:Execute: Error occurred at or near line 10 in
> file chota.ncl
>
> fatal:Variable (rhp) is undefined
> fatal:["Execute.c":7743]:Execute: Error occurred at or near line 11 in
> file chota.ncl
>
>
>
>
> --
> With regards
> Saurabh Kumar singh
>
>  *P** : * *Please consider the environment before printing this e-mail*
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20141013/eae9740e/attachment.html 


More information about the ncl-talk mailing list