Re: Map Projection for Finite Volume Grid

From: Adam Phillips <asphilli_at_nyahnyahspammersnyahnyah>
Date: Wed Feb 29 2012 - 14:26:37 MST

Hi Cecilia,
Try not setting res@tfDoNDCOverlay = True.

Reading from a January ncl-talk email of Mary Haley's:

"When you set the tfDoNDCOverlay resource to True, you are telling NCL that
the contours should be overlaid exactly on whatever map projection you
set up.
No lat/lon information is given to indicate where the contours should be
overlaid
on the map; instead, NCL basically lines up the contour plot with the
map plot as is.

If you zoom in on the map, then, NCL will overlay the contours to fit
the zoomed
area, because that's what you are telling it to do when you set
tfDoNDCOverlay to True. "

Basically, you do not need to use tfDoNDCOverlay.. You are providing
lat/lon coordinate information via your u_flux and v_flux arrays. (You
should check this by doing a printVarSummary(u_flux) and a
printVarSummary(v_flux))...

Hope that helps.. If not, please respond to ncl-talk.
Adam

On 02/29/2012 02:07 PM, Cece Borries wrote:
> Hello.
>
> I am trying to calculate the transient eddy moisture transport flux
> from CAM5 model output (finite volume grid, 0.9 x 1.25 degrees). I am
> fairly certain that my calculations are correct; however, the plots
> from NCL are not.
>
> I am wondering if I need to use a certain map projection for finite
> volume grids.
>
> My script is really long, so I include snippets below. I have also
> attached the plot which NCL creates.
>
> Thanks for any help!
>
> -------------------------------------------------------------------------------------------------------------------------------------------------------
> (I read in the data and create arrays of dimensions: year, month,
> level, lat, lon.)
>
> flux_v(i-1,j-1,:,:,:) =(jja_v(i-1,j-1,:,:,:) -
> v_year_avg)*(jja_q(i-1,j-1,:,:,:)- q_year_avg) ; v component of flux
> flux_u(i-1,j-1,:,:,:) =(jja_u(i-1,j-1,:,:,:) -
> u_year_avg)*(jja_q(i-1,j-1,:,:,:)- q_year_avg) ; u component of flux
>
> v_flux_mon_avg = dim_avg_n_Wrap(flux_v,1)
> ; calculate monthly and yearly averages
> v_flux_year_avg = dim_avg_n_Wrap(v_flux_mon_avg,0)
> copy_VarCoords(z,v_flux_year_avg)
>
> u_flux_mon_avg = dim_avg_n_Wrap(flux_u,1)
> u_flux_year_avg = dim_avg_n_Wrap(u_flux_mon_avg,0)
> copy_VarCoords(z,u_flux_year_avg)
>
> ; take a vertical integral over the levels
> hyai = in->hyai
> hybi = in->hybi
> ps = in->PS
> p0 = 100000
>
> dp = dpres_hybrid_ccm(ps,p0,hyai,hybi)
> dp_avg = dim_avg_n_Wrap(dp,0)
> g = 9.81
> a = new((/15, nlat, mlon/), "double", getFillValue(z)) ; only
> want the first 15 levels
> b = new((/15, nlat, mlon/), "double", getFillValue(z))
>
> do o = 1,15
> a(o-1,:,:) = (v_flux_year_avg(o-1,:,:)*dp_avg(30-o,:,:)) ;
> transient eddy moisture flux = (integral(v'q' dp))/g
> b(o-1,:,:) = (u_flux_year_avg(o-1,:,:)*dp_avg(30-o,:,:))
> end do
>
> v_flux = (dim_sum_n_Wrap(a,0)/g)
> u_flux = (dim_sum_n_Wrap(b,0)/g)
>
> ; plot TE flux
> res = True
> res@tiMainString = "" ; Title for
> the plot
> res@gsnMaximize = True
> res@gsnSpreadColors = True
> res@lbOrientation = "vertical"
> ;vertical label bar
>
> res@gsnAddCyclic = False
> res@mpLimitMode = "LatLon"
> res@mpMinLatF = 15 ;
> range to zoom in on
> res@mpMaxLatF = 75.
> res@mpMinLonF = 140
> res@mpMaxLonF = 250.
> res@mpRelativeCenterLon = True
> res@mpRelativeCenterLat = True
>
> res@tfDoNDCOverlay = True
> res@mpOutlineOn = True
>
> res@gsnDraw = False
> res@gsnFrame = False
> res@vcGlyphStyle = "LineArrow" ;
> use arrow vectors instead of wind barbs
> res@vcRefAnnoOn = True
> res@vcRefLengthF = 0.025
> res@vcRefMagnitudeF = 6
> res@vcMinDistanceF = 0.025
> res@pmTickMarkDisplayMode = "Never"
> res@gsnDraw = False
> res@gsnFrame = False
>
> res@vcMonoLineArrowColor = False
>
> plot=gsn_csm_vector_map(wks,u_flux({15:75},{140:250}),v_flux({15:75},{140:250}),res)
> draw(plot)
> frame(wks)
>
>
>
> --
> Cecilia Borries
>
> Graduate Student
> International Arctic Research Center
> Department of Atmospheric Sciences
>
> Teaching Assistant
> Department of Physics
> University of Alaska Fairbanks
>
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

-- 
______________________________________________________________
Adam Phillips                                asphilli@ucar.edu
NCAR/Climate and Global Dynamics Division       (303) 497-1726
P.O. Box 3000				
Boulder, CO 80307-3000    http://www.cgd.ucar.edu/cas/asphilli

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Feb 29 14:26:46 2012

This archive was generated by hypermail 2.1.8 : Mon Mar 05 2012 - 14:12:07 MST