Hi,
I am trying to use canter_finite _difference_n function to calculate
meridional temperature gradient.
But I am getting an error saying
"Invalid dimension index for calculating the center finite difference"
Here is the portion of my script where I am doing this:
nlat = 128
nlon =256
dlon = (lon(2)-lon(1))*0.0174533 ; convert to radians
; pre-allocate space
dLon = dble2flt(dlon)
Lon = dble2flt(lon)
dTdY = new((/124,15,nlat,nlon/),typeof(tempm))
do nl =0,nlon-1 ; loop over each longitude
dY = 6378388.*cos(0.0174533*Lon(nl))*dLon ; constant at this latitude
printVarSummary(dY)
dTdY(:,:,:,nl)= center_finite_diff_n (tempm(:,:,:,nl),dY,True,0,3)
end do
dtdy = flt2dble(dTdY)
printVarSummary(dtdy)
printMinMax(dtdy, True)
printMinMax(dTdY, True)
Also in the example 6 of documentation of "center_finite_difference_n"
there are typeo in this line:
dTdX(:,:,nl,:) = center_finite_diff_n (T(:,:,nl;,:), dX , True,0,0)
it should be I think
dTdX(:,:,nl,:) = center_finite_diff_n (T(:,:,nl,:), dX , True,0,2)
Thanks,
-- ************************************* Soumik Basu Graduate Student, Research Assistant International Arctic Research Center University of Alaska Fairbanks Fairbanks,Alaska,USA ************************************** ----------------------------------------- This email was sent using SquirrelMail. "Webmail for nuts!" http://squirrelmail.org/ _______________________________________________ ncl-talk mailing list List instructions, subscriber options, unsubscribe: http://mailman.ucar.edu/mailman/listinfo/ncl-talkReceived on Mon May 2 11:58:28 2011
This archive was generated by hypermail 2.1.8 : Tue May 03 2011 - 14:47:34 MDT