Re: NCEP/NCAR 4x reanalysis of PW

From: Adam Phillips (asphilli AT cgd.ucar.edu)
Date: Tue Nov 09 2004 - 10:54:32 MST

  • Next message: Dennis Shea: "Re: NCEP/NCAR 4x reanalysis of PW"

    Andrew,

    I believe the way you were originally calculating it is the correct way. Here is
    the way I do it: (using your .nc file)

    a = addfile("pr_wtr.eatm.2002.nc","r")
    p_wat = a->pr_wtr ;attributes are copied over to p_wat as well
    printVarSummary(p_wat)
    pwat = (p_wat*p_wat@scale_factor) + p_wat@add_offset
    copy_VarCoords(p_wat,pwat) ;in contributed.ncl, copies Coordinate variables
                                 ; from p_wat to pwat
    pwat@long_name = p_wat@long_name
    pwat@units = p_wat@units
    pwat@_FillValue = p_wat@missing_value
    delete(p_wat)
    printVarSummar(pwat)
    print("Min of pwat = "+min(pwat)+", max = "+max(pwat))

    Let us know if that doesn't work...
    Adam

    >Delivered-To: asphilli@ucar.edu
    >Delivered-To: ncl-talk@ucar.edu
    >Mime-Version: 1.0 (Apple Message framework v619)
    >Content-Transfer-Encoding: 7bit
    >To: ncl-talk@ucar.edu
    >From: Andrew Snyder <asnyder4@purdue.edu>
    >Date: Tue, 9 Nov 2004 12:54:54 -0500
    >X-Virus-Scanned: by amavisd-new
    >Subject: NCEP/NCAR 4x reanalysis of PW
    >X-BeenThere: ncl-talk@ucar.edu
    >X-Mailman-Version: 2.1.1
    >List-Id: NCAR Command Language User Group <ncl-talk.ucar.edu>
    >List-Unsubscribe: <http://mailman.ucar.edu/mailman/listinfo/ncl-talk>,
    <mailto:ncl-talk-request@ucar.edu?subject=unsubscribe>
    >List-Post: <mailto:ncl-talk@ucar.edu>
    >List-Help: <mailto:ncl-talk-request@ucar.edu?subject=help>
    >List-Subscribe: <http://mailman.ucar.edu/mailman/listinfo/ncl-talk>,
    <mailto:ncl-talk-request@ucar.edu?subject=subscribe>
    >X-Spam-Checker-Version: SpamAssassin 3.0.1 (2004-10-22) on mscan4.ucar.edu
    >X-Spam-Level:
    >X-Spam-Status: No, score=-4.0 required=5.0 tests=AWL,BAYES_00 autolearn=ham
    version=3.0.1
    >
    >NCL users -
    >
    >I have been attempting to read in and plot 4x daily NCEP/NCAR
    >reanalysis precipitable water data. I found a previous message in this
    >list from 2 years ago concerning temperature data, and it was helpful
    >in including the add_offset and scale_factor attributes, but the
    >numbers still don't make sense. I assume it has something to do with
    >the way I am calculating PW using the offset and scale factor, but none
    >of my other results make sense either. The values would ideally range
    >from ~10 - 60 mm (kg/m2). I've included my script and the output
    >below.
    >
    >Thank you for your help!
    >
    >********************************************
    >
    >Andrew Snyder
    >Graduate Student
    >Dept. of Earth and Atmospheric Sciences
    >Purdue University
    >
    >begin
    >
    > diri = "./"
    > fili = "pr_wtr.eatm.2002.nc"
    > f = addfile (diri+fili, "r")
    >
    > vnam = getfilevarnames (f) ; list of variables that are in file
    > print (vnam)
    >
    > p_wat = (f->pr_wtr)
    > p_wat@long_name = "Total Precipitable Water"
    > p_wat@units = "mm"
    > p_wat@scale_factor = 0.01
    > p_wat@add_offset = 277.65
    >
    > pwat = new ((/dimsizes(p_wat)/),float,1.e+20)
    >; pwat = (p_wat*p_wat@scale_factor) + p_wat@add_offset
    > pwat = (p_wat@scale_factor * (p_wat@add_offset + p_wat))
    > copy_VarMeta (p_wat,pwat)
    > delete (p_wat)
    >
    > lat2d = f->lat ; read 2d latitude grid from file
    > lon2d = f->lon ; read 2d longitude grid from file
    >
    > pwat@lat2d = lat2d
    > pwat@lon2d = lon2d
    >
    > min_pwat = min( pwat )
    > max_pwat = max( pwat )
    >
    > printVarSummary(pwat)
    > print ("Minimum PWV = "+min_pwat+" Maximum PWV = "+max_pwat)
    > print (pwat(1:4,12:14,121:124))
    > nvars = dimsizes (pwat)
    > print (nvars)
    >
    >end
    >
    >And the important part of the output is as follows:
    >
    >Variable: pwat
    >Type: float
    >Total Size: 61390080 bytes
    > 15347520 values
    >Number of Dimensions: 3
    >Dimensions and sizes: [time | 1460] x [lat | 73] x [lon | 144]
    >Coordinates:
    > time: [17540448.. 0]
    > lat: [90..-90]
    > lon: [ 0..357.5]
    >Number Of Attributes: 3
    > lon2d : <ARRAY>
    > lat2d : <ARRAY>
    > _FillValue : 1e+20
    >(0) Minimum PWV = -6.60001 Maximum PWV = 277.65
    >
    >
    >Variable: pwat (subsection)
    >Type: float
    >Total Size: 192 bytes
    > 48 values
    >Number of Dimensions: 3
    >Dimensions and sizes: [time | 4] x [lat | 3] x [lon | 4]
    >Coordinates:
    > time: [17540454..17540472]
    > lat: [60..55]
    > lon: [302.5..310]
    >Number Of Attributes: 3
    > _FillValue : 1e+20
    > lat2d : <ARRAY>
    > lon2d : <ARRAY>
    >(0,0,0) 8.5
    >(0,0,1) 8
    >(0,0,2) 7.399994
    >(0,0,3) 7.100006
    >(0,1,0) 7.799988
    >(0,1,1) 6.600006
    >(0,1,2) 5.899994
    >(0,1,3) 6.200012
    >(0,2,0) 5.5
    >(0,2,1) 4.700012
    >(0,2,2) 4.600006
    >(0,2,3) 5.399994
    >(1,0,0) 8.899994
    >(1,0,1) 8.899994
    >(1,0,2) 8.100006
    >(1,0,3) 7
    >(1,1,0) 7.600006
    >(1,1,1) 6.700012
    >(1,1,2) 5.899994
    >(1,1,3) 6
    >(1,2,0) 5.700012
    >(1,2,1) 4.899994
    >(1,2,2) 4.399994
    >(1,2,3) 4.799988
    >(2,0,0) 7.899994
    >(2,0,1) 7.700012
    >(2,0,2) 7.200012
    >(2,0,3) 6.399994
    >(2,1,0) 7.200012
    >(2,1,1) 6
    >(2,1,2) 5.200012
    >(2,1,3) 5.299988
    >(2,2,0) 6.399994
    >(2,2,1) 5.200012
    >(2,2,2) 4.200012
    >(2,2,3) 4.100006
    >(3,0,0) 7.600006
    >(3,0,1) 7.799988
    >(3,0,2) 7.200012
    >(3,0,3) 6.200012
    >(3,1,0) 7.200012
    >(3,1,1) 6.600006
    >(3,1,2) 5.899994
    >(3,1,3) 5.600006
    >(3,2,0) 6.399994
    >(3,2,1) 5.899994
    >(3,2,2) 5.200012
    >(3,2,3) 4.799988
    >
    >_______________________________________________
    >ncl-talk mailing list
    >ncl-talk@ucar.edu
    >http://mailman.ucar.edu/mailman/listinfo/ncl-talk

    -------------------------------------------------------------
    Adam Phillips email: asphilli@ucar.edu
    Climate and Global Dynamics Division tel: (303) 497-1726
    National Center for Atmospheric Research fax: (303) 497-1333
    P.O. Box 3000
    Boulder, CO 80307-3000 http://www.cgd.ucar.edu/~asphilli

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



    This archive was generated by hypermail 2b29 : Tue Nov 09 2004 - 14:31:52 MST