execution time issue

From: Sahidul <sahidul_at_nyahnyahspammersnyahnyah>
Date: Thu Jul 08 2010 - 04:37:29 MDT

Dear NCL Users,

Following script is working fine. BUT It is taking lot of time ( *more than
6 hours*) to complete.

 Could you please suggest me how to run it fast.

;;***************************************************
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"
begin

;; in this directory, I have 87 wrfout files ( every 1 hour interval file)

datadir = "/WRF_output/2010062200/"
FILES = systemfunc ("ls -1 " + datadir + "wrfout_d02* " )
numFILES = dimsizes(FILES)

res = True
res@InitTime = False
res@Footer = False

do ifil = 0,numFILES-1
   a = addfile(FILES(ifil)+".nc","r")

    times = wrf_user_list_times(a)
    ntimes = dimsizes(times)
    plevs = (/ 1000., 925., 850., 700., 600., 500., 300., 200. /)
    nlevels = dimsizes(plevs)

do it = 0,ntimes-1,2
;;;===========================
yr = systemfunc("echo "+times +"|cut -c1-4")
mon = systemfunc("date '+%b'|tr [a-z] [A-Z]")
day = systemfunc("echo "+times +"|cut -c9-10")
hr = systemfunc("echo "+times +"|cut -c12-13")
;;;===========================
     w = wrf_user_getvar(a,"wa",it)
 do level = 0,nlevels-1

   pressure =plevs(level)
   p = wrf_user_getvar(a, "pressure",it)
   w_plane = wrf_user_intrp3d(w,p,"h",pressure,0.,False)
   w_plane@description = ""
   w_plane@units = ""

  wks = gsn_open_wks("ps","om_"+pressure+"hPa"+"_"+day+mon+yr+"_"+hr+"Z")

  res = True ; Plot options desired.
  res@gsnDraw = True ; Forces the plot to be drawn
  res@gsnFrame = True ; Frame advance
  pltres = True
  mpres = True

  opts = res
  opts@cnFillOn = True
  opts@cnInfoLabelOn = False

  mpres@mpNationalLineThicknessF = 1.0
  mpres@mpNationalLineColor = "black"
  mpres@mpGeophysicalLineColor = "black"
  mpres@mpGeophysicalLineThicknessF = 1.0

 vector_w = wrf_contour(a,wks,w_plane,opts)
 plot = wrf_map_overlays(a,wks,vector_w,pltres,mpres)

        if ( pressure .eq. 925 ) then
            plot = wrf_map_overlays(a,wks,vector_w,pltres,mpres)
        end if
        if ( pressure .eq. 850 ) then
            plot = wrf_map_overlays(a,wks,vector_w,pltres,mpres)
        end if
        if ( pressure .eq. 700 ) then
            plot = wrf_map_overlays(a,wks,vector_w,pltres,mpres)
        end if
        if ( pressure .eq. 600 ) then
            plot = wrf_map_overlays(a,wks,vector_w,pltres,mpres)
        end if
        if ( pressure .eq. 500 ) then
            plot = wrf_map_overlays(a,wks,vector_w,pltres,mpres)
        end if
        if ( pressure .eq. 300 ) then
            plot = wrf_map_overlays(a,wks,vector_w,pltres,mpres)
        end if
        if ( pressure .eq. 200 ) then
            plot = wrf_map_overlays(a,wks,vector_w,pltres,mpres)
        end if

end do
end do
end do
end
;;***************************************************

Kindly help me.

Thanking you,

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Jul 8 04:37:35 2010

This archive was generated by hypermail 2.1.8 : Fri Jul 09 2010 - 16:06:22 MDT