Re: [ncl-talk] NCL Script help

From: Adam Phillips (asphilli AT cgd.ucar.edu)
Date: Tue May 10 2005 - 09:14:26 MDT

  • Next message: Arjan van Dijk: "Earth..2 and the sea?"

    Hi Patrick,

    I think the function that you want is called dim_sum, which will sum up
    the rightmost dimension of an array:
    http://www.ncl.ucar.edu/Document/Functions/Built-in/dim_sum.shtml

    Assuming your arrays u,v, and pm are dimensioned lev x lat x lon:

    pm_plane = pm(0,:,:) ;set up pm_plane to keep coordinate variables
    pm_plane = (/ dim_sum(pm(lat|:,lon|:,lev|:)) /) ;sum up the rightmost
            ;dimension (lev), don't transfer coordinate variable info to
            ;pm_plane (or in this case destroy pm_plane coord var info)

    You can also use the _Wrap version of this function, which will transfer
    the correct coordinate variables lat,lon to pm_plane. Make sure you load
    contributed.ncl if you do this.
    http://www.ncl.ucar.edu/Document/Functions/Contributed/dim_sum_Wrap.shtml

    load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
    pm_plane = dim_sum_Wrap(pm(lat|:,lon|:,lev|:))

    Repeat for u_plane and v_plane...
    Adam

    Patrick O'Reilly wrote:
    > Hello,
    >
    > I am using a set of preconfigured NCL scripts to create imagery from
    > WRF/Chem output. I have a working script (attached) that plots PM2.5 and
    > winds at the surface, but I now want to plot (plan view) the total PM2.5 at
    > all levels, meaning adding every level together and plotting the total PM2.5
    > in the model domain, on one plot. This is probably an easy solution for you
    > NCL pros, but I am a novice and am having trouble.
    >
    > I thought one solution would be to loop through each level and add the PM2.5
    > on that level to the total PM2.5, then plot the total PM2.5. But maybe
    > there's an NCL function that does this automatically?
    >
    > Any help would be greatly appreciated.
    >
    > Patrick
    > _________________________________________
    > Patrick O'Reilly
    > Meteorological Decision Support Scientist
    > The STORM Project at UNI
    > patrick.oreilly@uni.edu 319-273-3789
    > http://www.uni.edu/storm
    >
    > "No trees were killed in the making of this e-mail...however,
    > a large number of electrons were horribly inconvenienced."
    >
    >
    > ------------------------------------------------------------------------
    >
    > _______________________________________________
    > ncl-talk mailing list
    > ncl-talk@ucar.edu
    > http://mailman.ucar.edu/mailman/listinfo/ncl-talk

    -- 
    --------------------------------------------------------------
    Adam Phillips			             asphilli@ucar.edu
    National Center for Atmospheric Research   tel: (303) 497-1726
    ESSL/CGD                                   fax: (303) 497-1333
    P.O. Box 3000				
    Boulder, CO 80307-3000	  http://www.cgd.ucar.edu/cas/asphilli
    _______________________________________________
    ncl-talk mailing list
    ncl-talk@ucar.edu
    http://mailman.ucar.edu/mailman/listinfo/ncl-talk
    



    This archive was generated by hypermail 2b29 : Mon May 23 2005 - 11:01:58 MDT