Hybrid to pressure coordinates

From: alexg (alexg AT XXXXXX)
Date: Mon Dec 20 2004 - 15:47:43 MST

  • Next message: Mary Haley: "Re: NCL 4.2.0.a032 and wmbarb"

    Hi
    Im trying to convert from cam1 hybrid vertical coordinates to pressure
    coordinates. Can you tell me is the vinth2p appropriate for this (as only
    CCM is mentioned in documentation)? If it is, any ideas why the following
    code wouldn't produce the correct results?
    Many thanks
    Alex

    load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
    load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
    load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
    f = addfile ("/u4/CCSM_FULL/b20.007.cam1.h0.1339-12.nc","r")
    U=f->U
    PS=f->PS ;Pascals
    hyam=f->hyam
    hybm=f->hybm

       P0=100000
    ; type of interpolation: 1 = linear, 2 = log, 3 = loglog
       interp = 2

    ; is extrapolation desired if data is outside the range of PS
       extrap = False

    ; create an array of desired pressure levels:
       pnew =
    (/1000,990,980,965,950,930,900,870,840,800,750,700,600,500,400,200/)
    ;************************************************
    ; calculate T on pressure levels
    ;************************************************
    UonP = vinth2p(U,hyam,hybm,pnew,PS,interp,P0,1,extrap)

    wks = gsn_open_wks("X11","test")
    gsn_define_colormap(wks,"BlWhRe")
    res = True ; plot mods desired
    res@cnFillOn = True ; turn on color
    res@gsnSpreadColors = True
    res@lbOrientation ="vertical"
    plot = gsn_csm_contour(wks,dim_avg_Wrap(U(0,:,:,:)),res)
    UonP&lev_p@units="PA"
    plot = gsn_csm_pres_hgt(wks,dim_avg_Wrap(UonP(0,:,:,:)),res)

    _______________________________________________
    ncl-talk mailing list
    ncl-talk AT ucar.edu
    http://mailman.ucar.edu/mailman/listinfo/ncl-talk



    This archive was generated by hypermail 2b29 : Mon Dec 20 2004 - 16:25:36 MST