Derivative between 2 levels

From: Brandon Fisel <bjfisel_at_nyahnyahspammersnyahnyah>
Date: Wed, 1 Jul 2009 18:17:13 -0500

Hi NCL'ers

I'm attempting to calculate the horizontal wind between two metgrid levels
(num_metgrid_levels=3 and num_metgrid_levels=4 - 850mb and 700mb). Below is
a segment of the ncl script performing the calculation:

   v_P = f->VV(:,0,(/3,4/),:,:)
   v_P!0 = "record"
   v_P!1 = "num_metgrid_levels"
   v_P!2 = "lat"
   v_P!3 = "lon"
   z_P = f->GHT(:,0,(/3,4/),:,:)
   z_P!0 = "record"
   z_P!1 = "num_metgrid_levels"
   z_P!2 = "lat"
   z_P!3 = "lon"
   v =
0.5*(v_P(record|:,num_metgrid_levels|:,lat|0:204,lon|:)+v_P(record|:,num_metgrid_levels|:,lat|
1:205,lon|:)) ; get V on mass grid
   v!0 = "record"
   v!1 = "num_metgrid_levels"
   v!2 = "lat"
   v!3 = "lon"

   do nt=0,ntimes
     type = "ps"
     prefix = "daily_Eady_"
     suffix = TimeChar(nt,0,:)+""
     print ("Suffix is:" + suffix)
     path = diro+""+prefix+""+suffix
     print ("Path is:" + path)
     wks = gsn_open_wks(type,path)
     fo(nt,:,:) = 2*0.00007292*sin_r(nt,:,:) ; coriolis parameter
     N = 0.011 ; Brunt-Vaisala Freq. s-1
     dVdZ = center_finite_diff (v(record|
nt,lat|:,lon|:,num_metgrid_levels|:),z_P(record|
nt,lat|:,lon|:,num_metgrid_levels|:),False,0)
     printVarSummary(dVdZ)
     print ("dVdZ is: " + dVdZ)
     s_BI = (0.31*fo*dVdZ)/N ; Eady Baro. Parameter

On the last printVarSummary for the dVdZ, I lose my time coordinate and
receive an error for the s_BI line:

fatal:Mul: Dimension size, for dimension number 0, of operands does not
match, can't continue

fatal:Execute: Error occurred at or near line 107 in file eady_baro.ncl

I'm under the impression that this isn't what I want. What am I doing wrong?

-------------------------------------------------------------
Brandon Fisel

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Jul 01 2009 - 17:17:13 MDT

This archive was generated by hypermail 2.2.0 : Tue Jul 07 2009 - 11:13:18 MDT