Re: question on NCL function cz2ccm

From: Jianping Pan (pan1 AT uiuc.edu)
Date: Thu Oct 21 2004 - 14:44:24 MDT

  • Next message: Jing: "about Panel contour bar font size"

    Thanks for the help and explanation. My test found out that
    "hybrid-coefficient" has to be from "ground-to-top", and either "TV"
    direction will generate the output of "HGT" in the type of "top-to-ground"
    order. So I guess just as Dennis said, The "Tv" should be also
    "top-to-ground" order. The following is my test output of HGT, (left 19
    levels are with Tv "ground-to-top", right with Tv "top-to-ground", with
    hybrid-coef input from top-to-ground provides -Inf values)

    1 36939.52 1 33121.88
    2 28784.02 2 26258.34
    3 23859.66 3 22215
    4 19140.27 4 18353.34
    5 15117.81 5 14980.41
    6 12190.52 6 12449.87
    7 10166.34 7 10662.19
    8 8640.828 8 9286.664
    9 7433.391 9 8159.997
    10 6355.065 10 7107.182
    11 5267.163 11 5992.918
    12 4168.225 12 4815.199
    13 3109.26 13 3640.769
    14 2155.399 14 2560.717
    15 1386.949 15 1671.785
    16 820.6031 16 996.3781
    17 422.1466 17 509.4178
    18 149.3835 18 177.2213
    19 17.90278 19 20.99122

    At 10:33 AM 10/21/2004, Dennis Shea wrote:

    >Hello Jianping
    >
    >This function is directly from the old (now unsupported) CCM Processor.
    >It calculates geopotential heights for older versions of the
    >AGCM that did not output geopotential height. Current versions output
    >the "Z3" variable.
    >
    >Functions that are directly from the CCM Processor
    >(eg, cz2ccm, vinth2p, ..) require top-to-bottom order where "bottom"
    >refers to the near surface level.
    >
    >This can be confusing because the hybrid coefficients on the
    >files are from bottom-to-top while variable like temperature
    >and specific humidity which are used to calculate
    >virtual temperatue (tv) are from top-to-bottom.
    >
    >Note from example 1:
    >
    > z2 = cz2ccm(ps, phis, tv, p0 \
    > ,hyam(::-1), hybm(::-1), hyai(::-1), hybi(::-1) )
    >
    >The (::-1) syntax is NCL's succinct way of reversing the order
    >of a variables dimension. This make all the hybrid variables
    >go from top-to-bottom and is consistent with "tv".
    >
    >The output is from top-to-bottom.
    >
    >--
    >After invoking the cz2ccm function you may wish to create
    >and copy appropriate mata dat (attributes, coordinate variables).
    >
    >load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
    >begin
    >
    > diri = "/fs/scd/home1/shea/ncldata_input/"
    > filphis = "01-50.nc" ; file with PHIS field
    > f = addfile (diri+filphis+".nc" , "r")
    > ; strip off various fields
    > phis = f->PHIS(0,:,:) ; read PHIS to memory
    > lat = f->lat
    > lon = f->lon
    > lev = f->lev
    > ilev = f->ilev
    > hyam = f->hyam
    > hybm = f->hybm
    > hyai = f->hyai
    > hybi = f->hybi
    >
    > fili = (/ "ha0001.nc" /)
    > f = addfile (diri+fili , "r") ; daily files
    > ps = f->PS ; get sfc pres
    > T = f->T
    > tv = T*(1.+0.61*f->Q) ; calculate virtual temperature
    > p0 = f->P0 ; get constant
    >
    > ; calculate z2 at all 30 time steps
    > z2 = cz2ccm(ps, phis, tv, p0 \
    > ,hyam(::-1), hybm(::-1), hyai(::-1), hybi(::-1) )
    >
    > z2@long_name = "geopotential height"
    > z2@units = "gpm"
    > copy_VarCoords(T,z2) ; contributed
    > printVarSummary(z2)
    >
    > delete(T) ; *not* required
    > delete(tv) ; delete if memory is a concern
    > delete(ps) ; and you do not need these variables
    > delete(phis)
    >
    > [snip]
    >end
    >
    >_______________________________________________
    >ncl-talk mailing list
    >ncl-talk@ucar.edu
    >http://mailman.ucar.edu/mailman/listinfo/ncl-talk


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



    This archive was generated by hypermail 2b29 : Thu Oct 21 2004 - 15:08:24 MDT