From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>

Date: Wed Feb 23 2011 - 17:34:38 MST

Received on Wed Feb 23 17:34:44 2011

Date: Wed Feb 23 2011 - 17:34:38 MST

I have attached a simple script.

It creates a 'interface sigma' coordinate. This allows

the 'dpres_hybrid_ccm' function to be used. As you can see,

this offers an alternative to 'prcwater_dp' to calculate

the precipitable water. This uses 'dim_sum_n'

Note there is no need to reorder dimensions. The answers are

the same.

On 2/23/11 12:21 PM, Michael Notaro wrote:

*> Dennis, this seems to work. The problem before was
*

*> that dpres_hybrid_ccm produced 17 levels and q
*

*> has 18 levels, so there is an inconsistency in the
*

*> prcwater_dp command. Instead, now I estimate q between
*

*> levels and use the corresponding thicknesses.
*

*>
*

*>
*

*> a=addfile("../con9096/Southwest_ATM.1991070100.nc","r")
*

*> xlat=a->xlat
*

*> xlon=a->xlon
*

*> rcm_map=a->rcm_map
*

*> iy=a->iy
*

*> jx=a->jx
*

*> time=a->time
*

*> q=a->qv ; kg per kg
*

*> ps=a->ps ; hPa
*

*> sigma=a->sigma
*

*> A=a->sigma
*

*> A=0.0
*

*> P0=0.0
*

*> dp_sigma = dpres_hybrid_ccm(ps,P0,A,sigma)
*

*> dp_sigma=dp_sigma*100.
*

*> dp_sigma!0 = ps!0
*

*> dp_sigma!1 = "plevel"
*

*> dp_sigma!2 = ps!1
*

*> dp_sigma!3 = ps!2
*

*>
*

*> q_order=q(time|:,iy|:,jx|:,kz|:)
*

*> dp_sigma_order=dp_sigma(time|:,iy|:,jx|:,plevel|:)
*

*>
*

*> q1=new((/124,148,158,17/),float)
*

*> do iz=0,16
*

*> q1(:,:,:,iz)=(q_order(:,:,:,iz)+q_order(:,:,:,iz+1))/2.
*

*> end do
*

*>
*

*> copy_VarCoords(dp_sigma_order,q1)
*

*>
*

*> pw = prcwater_dp(q1,dp_sigma_order)
*

*> copy_VarCoords(ps,pw)
*

*>
*

*> pw@long_name = "total column precipitable water"
*

*> pw@units = "kg/m2"
*

*> pw@coordinates = "xlat xlon"
*

*> pw@grid_mapping = "rcm_map"
*

*>
*

*> system("rm pw.nc")
*

*> out=addfile("pw.nc","c")
*

*> out->pw=pw
*

*> out->xlat=xlat
*

*> out->xlon=xlon
*

*> out->rcm_map=rcm_map
*

*> out->iy=iy
*

*> out->jx=jx
*

*> out->time=time
*

*>
*

*>
*

*>
*

*>
*

*> On Feb 22, 2011, at 6:24 PM, Dennis Shea wrote:
*

*>
*

*>> One approach
*

*>>
*

*>> [1]
*

*>> http://www.ncl.ucar.edu/Document/Functions/Built-in/dpres_hybrid_ccm.shtml
*

*>>
*

*>> This uses:
*

*>> p(k) = A(k)*PO + B(k)*PS
*

*>> The B(k) are the the sigma levels.
*

*>> A = sigma
*

*>> A = 0.0
*

*>> P0 = 0.0
*

*>> dp_sigma = dpres_hybrid_ccm(ps,P0,A,sigma)
*

*>> dp_sigma!0 = ps!0 ; (say) time
*

*>> dp_sigma!1 = "plevel"
*

*>> dp_sigma!2 = ps!1 ; lat
*

*>> dp_sigma!3 = ps!2 ; lon
*

*>> printVarSummary(dp_sigma)
*

*>>
*

*>>
*

*>> [2]
*

*>> http://www.ncl.ucar.edu/Document/Functions/Built-in/prcwater_dp.shtml
*

*>> pw =
*

*>> prcwater_dp(q(time|:,lat|:,lon|:,sigma|:),dp_sigma(time|:,lat|:,lon|:,plevel|:))
*

*>>
*

*>> pw@long_name = "total column precipitable water"
*

*>> pw@units = "kg/m2"
*

*>>
*

*>>
*

*>>
*

*>>
*

*>> On 02/22/2011 02:36 PM, Michael Notaro wrote:
*

*>>> How can I compute precipitable water
*

*>>> on a lat2d x lon2d grid using sigma
*

*>>> coordinates, given water vapor mixing
*

*>>> ratio output and surface pressure?
*

*>>>
*

*>>> Thanks, Michael
*

_______________________________________________

ncl-talk mailing list

List instructions, subscriber options, unsubscribe:

http://mailman.ucar.edu/mailman/listinfo/ncl-talk

- text/plain attachment: Southwest.ncl

- text/plain attachment: Southwest.ncl_v1

*
This archive was generated by hypermail 2.1.8
: Fri Feb 25 2011 - 08:50:46 MST
*