[ncl-talk] Eady _growth_rate
Dennis Shea
shea at ucar.edu
Fri Aug 17 09:30:46 MDT 2018
*conform*
<http://www.ncl.ucar.edu/Document/Functions/Built-in/conform.shtml>:
function conform ( x , r , *ndim* )
*ndim* An array of dimension indexes to indicate which dimensions of *x*
*match* the dimensions in *r*.
[Time|12]x[ilev | 26] x [*lat | 96*] x [lon | 144]
0 1 *2* 3 <==
dimension numbers
xlat = f->lat ; *[lat | 96*]
XLAT = conform ( T412 , xlat , *2* )
On Fri, Aug 17, 2018 at 9:10 AM, Sri Nandini <snandini at marum.de> wrote:
>
> Thank you
>
> If instead of interpolating, i first try to remove the pressure levels and
> just have this:
>
> printVarSummary(T41) ; ; [Time|12]x [lat | 96] x [lon | 144]
> printVarSummary(T411) ; ; [Time|12]x [lat | 96] x [lon | 144]
> printVarSummary(T412) ; ; [Time|12]x [lat | 96] x [lon | 144]
>
> XLAT = conform(T412, xlat, (/0,1,2/)) ; problem here
> printVarSummary(XLAT)
>
> The error is still the same.
>
>
>
> On Aug 17, 2018 4:28:15 PM, Dennis Shea wrote:
>
>
> printVarSummary(T41) ; ; [Time|12]x[ilev |* 26*] x [lat | 96]
> x [lon | 144]
> printVarSummary(T411) ; ; [Time|12]x[ilev | *26*] x [lat | 96]
> x [lon | 144]
> printVarSummary(T412) ; ; [Time|12]x[ilev | *27*] x [lat | 96]
> x [lon | 144]
>
> Variable T412 is the issue. The 'ilev' dimension is different.
>
> You must interpolate it to the same dimensions as T41, T411
>
> pressure: int2p_n
> <http://www.ncl.ucar.edu/Document/Functions/Built-in/int2p_n.shtml> or,
> better, *int2p_n_Wrap
> <http://www.ncl.ucar.edu/Document/Functions/Contributed/int2p_n_Wrap.shtml>*
> ====
>
> hybrid vertical coordinates: vinth2p
> <http://www.ncl.ucar.edu/Document/Functions/Built-in/vinth2p.shtml>
>
> On Fri, Aug 17, 2018 at 8:07 AM, Sri Nandini <snandini at marum.de> wrote:
>
> Hello
>
> I am trying to plot the eady growth rate as a measure of baroclinic
> instability. I cannot due to:
> fatal:conform: The array to be conformed must have the same number of
> dimensions as indicated by the length of the last argument
> I cannot conform the latitude to same dimensions as the th variable.
>
> Below is my script, would be grateful for any suggestions.
>
>
> load "lat_lon_masked_lambert.ncl"
>
> ; ==============================================================
> ; Open the file: Read only the user specified period first observations
> then model
> ; ==============================================================
> f= addfile("SLP_PHIS_Z3_PI.nc", "r") ;
> T41 = f->Z3(:,:,:,:)
>
> printVarSummary(T41) ; ;
> [Time|12]x[ilev | 26] x [lat | 96] x [lon | 144]
> T41 at _FillValue = -9.96921e+36
>
> ;==============================================================
>
> f1= addfile("totalwinds_PI.nc", "r") ;
> T411 = f1->U(:,:,:,:)
>
> printVarSummary(T411) ; ;
> [Time|12]x[ilev | 26] x [lat | 96] x [lon | 144]
> T411 at _FillValue = -9.96921e+36
>
>
> ;==============================================================
> f2= addfile("th_PI.nc", "r") ;
> T412 = f2->TH(:,:,:,:)
>
> printVarSummary(T412) ; ;
> [Time|12]x[ilev | 27] x [lat | 96] x [lon | 144]
> T412 at _FillValue = -9.96921e+36
>
> ;==============================================================
>
> ; Read latitudes
> ; The 'eady_growth_rate' function requires that 'lat' and 'th' agree
> ; Use 'conform' the propogate the lat values
> ;==============================================================
>
> xlat = f->lat ; [lat | 96]
> printVarSummary(xlat)
>
> XLAT = conform(T412, xlat, (/0,2,3/)) ; problem here
> printVarSummary(XLAT)
>
> egr = eady_growth_rate(aveX2, aveX1, aveX, XLAT, 0, 1)
> printVarSummary(egr)
> printMinMax(egr, 0)
>
> ;==============================================================
> wks = gsn_open_wks("pdf","Eady") ; send graphics to PNG
> file
>
> ;---Set some basic plot options
>
> res = True
> res at gsnMaximize = True ; maximize plot in frame
> res at gsnAddCyclic = False
>
> res at cnFillOn = True
> res at cnLinesOn = False
> ;res at cnFillMode = "RasterFill" ; slow here
> res at cnFillMode = "CellFill" ; faster
>
>
> minlat = 25. ; min lat to mask
> maxlat = 80. ; max lat to mask
> minlon = -10. ; min lon to mask
> maxlon = 110. ; max lon to mask
> res at mpProjection = "LambertConformal" ; choose projection
>
> ;---masked plot
> res at gsnAddCyclic = True ; regional plot
>
> res at mpMinLatF = minlat ; min lat to mask
> res at mpMaxLatF = maxlat ; max lat to mask
> res at mpMinLonF = minlon ; min lon to mask
> res at mpMaxLonF = maxlon ; max lon to mask
>
> res at gsnMaskLambertConformal = True ; turn on lc masking
>
> ; specify a level or levels ... within boundary layer
>
> klStrt = 5
> klLast = 5
> nt = 0
>
> ;--- Eady growth rate (1/day)
>
> egr = egr*86400
> egr at units = "1/day"
>
> res at cnFillPalette = "precip2_17lev"
> res at cnLevelSelectionMode = "ManualLevels" ; set manual contour
> levels
> res at cnMinLevelValF = 0.5 ; set min contour level
> res at cnMaxLevelValF = 4.0 ; set max contour level
> res at cnLevelSpacingF = 0.25 ; set contour spacing
>
> do kl=klStrt,klLast
> res at gsnCenterString = "znu="+znu(nt,kl)
> res at gsnRightString = egr at units
> contour = gsn_csm_contour_map(wks, egr(nt,kl,:,:),res)
> end do
>
>
>
>
>
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180817/5d151be7/attachment.html>
More information about the ncl-talk
mailing list