Re: Meridional stremfunction (fwd)

From: Dennis Shea (shea@XXXXXX)
Date: Fri Apr 02 1999 - 14:49:25 MST


> I don't know if you are on the ncarg-talk email list,

Nope!!

> > Would anybody have a NCL script that computes meridional
> > streamfunction from ccm3 data? I looked through the "Built-in NCL
> > functions and procedures" web page and all I could find was the
> > regular streamfunction (uv2sfvpf and uv2sfvpf). Any help will be
> > greatly appreciated.

Yes, Ethan forwarded thiks to me and I responded to Ethan.
Here is what I sent. Incidently, it might be good
to tell her about GSUN,

Sylvia's: http://www.cgd.ucar.edu/csm/cmps/NCL_tutorial/examples.html
and, possibly, mine
  IO: http://www.cgd.ucar.edu/cas/ncl-csm/IO_general.html
  Processing: http://www.cgd.ucar.edu/cas/ncl-csm/PR_general.html
              Some of these must be updated. Many were developed
              when I was 1st learning NCL.
  Graphics: http://www.cgd.ucar.edu/csm/cmps/CSM_Graphics/csm_graphics.html
              Tell her that in the next few weeks we will add examples
              of high quality graphics.
==========What I sent to Ethan=================================================

;
; / PSFC
; |
; 2 pi a cos(phi) |
; MPSI = --------------- | [V] dp
; g |
; |
; / PTOP
Ethan,

I don't have a proocedure that calculates the "meridional streamfunction"==> MPSI

MPSI is different from the "normal streamfunction" ===>PSI

PSI is a function of u and v and is used for lat-lon (horizontal) flow

MPSI is a function of zonal mean v ==> [V] and
      mean vertical velocity called omega===>[w]
---------------------------------------
let R=a cos(phi) where a = rad of earth, phi=latitude
    p = pressure, g=gravity, a^2=a*a

then

     [V] = (g/2*PI*R)*(d{MPSI}/d{p}) [w] = -(g/2*PI*a^2*cos(phi))*(d{MPSI}/d{phi})
-------------------------------------
How to compute: [Is he using CCM coords {time,lat,lev,lon} or COORDS {time,lev,lat,lon}

         the input "v" could be an instantaneous, or, more likely a monthly mean "v"
         

     (1) use "vinth2p" to interpolate the model meridional winds on hybrid levels to
         specified pressure levels
         
     (2) use "div_avg" to compute the zonal average of the v at each pressure level [V]
     
     (3) Multiply each [V]*[delta-pressure] at each level. I'll talk to u about this.
         It is simple but would require too much typing.
     
     (4) MPSI will lave dimensions [(time),lev,lat]
---------------------------------------------------------------------
Crude template: I am assuming the these "v" have been interpolated
                to the specified pressure levels and the dp have
                been specified externally.

  ;====================================================
function MeridStreamF (v[*][*][*]:float, dp[*]:float ,lat[*]:float )

; return MPSI: meridional stream function [klvl,nlat]
; nomenclature:
; v - meridional wind at pressure levels [klvl,nlat,mlon]
; dp - delta pressure [klvl,nlat,mlon]
; lat - latitudes [nlat]

; usuage: MPSI = MeridStreamF (v,dp,lat)
; MPSI = MeridStreamF (v(nt,:,:,:),dp ,lat)

begin
 dimv = dimsizes(v)
 dimp = dimsizes(dp)
 diml = dimsizes(lat)
 
 if (dimp.ne.dimv(0) .or. diml.eq.dimv(1)) then
     print ("MeridStreamF: dimension mismatch: dimv(0),dimp="+dimv(0)+" , "+dimp +\
                                               dimv(1),diml="+dimv(1)+" , "+diml)
     return (1.e+36)
 end if

 klvl = dimv(0)
 nlat = dimv(1)
 mlon = dimv(2)

 con = 2.*3.14159*6.37e06/9.80616 ; 2*PI*a/g
 concos = con*cos(0.01745*lat(:))
     
 MPSI = new( (/ klvl,nlat /), float ) ; MPSI at each level
                                             ; this is what is most used [plot]
 do nl=0,nlat-1
    MPSI(:,nl) = dim_avg(v(:,nl,:))*dp(:)*concos(:)
 end do

 return (MPSI)
 
 end



This archive was generated by hypermail 2b29 : Wed Jun 28 2000 - 09:45:43 MDT