Maximum temp calculation

From: Sahidul <sahidul_at_nyahnyahspammersnyahnyah>
Date: Wed Apr 14 2010 - 06:34:32 MDT

Dear NCL users,

I would like to calculate Daily Maximum Temperature contour variation plots
from WRF model outputs.
I am having 3 days forecast files (no. of files = 72).

I tried to use following scripts; it is showing errors like:

fatal:Subscript out of range, error in subscript #0
fatal:An error occurred reading temp
fatal:Execute: Error occurred at or near line 47 in file max-temp.ncl [[ *the
line is:* dailymax(gg,:,:) = dim_max_n(temp(cntr:cntr+23,0,:,:),0) ]]

;;; script name is max-temp.ncl ====================

load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRF_contributed.ncl"

begin

datadir = "/scratch/WRF/2010041400/"
FILES = systemfunc ("ls -1 " + datadir + "wrfout_d01_2010-04* " )
numFILES = dimsizes(FILES)
a = addfiles(FILES+".nc","r")

wks = gsn_open_wks("ps","test")

gsn_define_colormap(wks,"gui_default")

P = a[:]->P ; perturbation
Pb = a[:]->PB ; base state pressure
Pt = P + Pb ; total pressure
Tc = a[:]->T ; perturbation potential temperature(theta+t0)
Tc = Tc + 300

temp = wrf_tk(Pt,Tc)

dailymax = temp(0::24,0,:,:) ; copy metadata
printVarSummary(dailymax)
dailymax = dailymax@_FillValue

  res = True ; plot mods desired
  res@gsnSpreadColors = True ; make cn span entire color
map
  res@cnFillOn = True
  res@gsnAddCyclic = False
  res@cnLineLabelsOn = False

plts = new (3 , "graphic")

cntr = 0
do gg = 0,dimsizes(temp(0::24,0,0,0))-1

         dailymax(gg,:,:) = dim_max_n(temp(cntr:cntr+23,0,:,:),0)
         cntr = cntr+24

     plts(gg) =gsn_csm_contour(wks,dailymax(gg,:,:),res)

end do
end
;;;=====================================

Kindly help me to solve this.

Thanking you.

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Apr 14 06:34:42 2010

This archive was generated by hypermail 2.1.8 : Fri Apr 16 2010 - 16:21:29 MDT