Re: vertical cross section

From: Adam Phillips <asphilli_at_nyahnyahspammersnyahnyah>
Date: Fri, 07 Nov 2008 15:47:58 -0700

Hi Jin-Young,

Beyond what Dennis said, a few other things I noticed:

1) Instead of this syntax
    ugrd(:,{19.4:19.4},:)
    use this
    ugrd(:,{19.4},:)

Otherwise you are submitting an array to the plotting function that is
number of levels by 1 by number of longitudes. (3D array)

2) (:, :) is not needed.. You can change this
    psfc = grb_file->PRMSL_GDS0_MSL(:, :)
    to this
    psfc = grb_file->PRMSL_GDS0_MSL

3) These are commented out, but you say this:
    gsn_csm_contour_shade
    when I think you mean this:
    gsn_contour_shade

    and you say this:
    SahdeGtContour
    when I think you mean this:
    ShadeGtContour

Adam

Jin-Young Kim wrote:
> Greeting,
>
> I have some problem to draw vertical cross section.
>
> plot=gsn_csm_contour(wks,ugrd(:,{19.4:19.4},:),res)
>
> It shows following error ..
>
> fatal:NclOneDValGetClosestIndex: finish coordinate index out of range,
> can't continue
> fatal:Could not obtain coordinate indexes, unable to perform subscript
> fatal:Execute: Error occurred at or near line 52 in file sim_wind.ncl
>
> In addition, my data is isobaric level,
> when i draw axis level 200 to 1000,, i would like to draw 1000 to 200..
>
> Would you give me comment..?
>
> Here is scripts
>
> ;/opt/ncl/5.0.0_bin/bin/
> ;/opt/ncl/5.0.0_bin/bin/ncl_filedump
> ;/opt/ncl/5.0.0_bin/bin/ncl_convert2nc
> ;/opt/ncl/5.0.0_intel_9.1/bin
> ;load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRF_contributed.ncl"
>
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"
>
> begin
>
>
> dir = "../DENNIS04L.2005070700/PSTP/postprd/"
>
> ifim = sprinti("wrfprs_d02.%0.2i"+".grb",ispan(24,30,6))
> ofim = sprinti("windx_d02h_%0.2i",ispan(24,30,6))
> titl = sprinti("%0.2i",ispan(24,30,6))
>
> do i= 0, dimsizes(ifim)-1
>
> grb_file = addfile(dir+ifim(i),"r")
> names = getfilevarnames (grb_file)
> print (names)
>
> psfc = grb_file->PRMSL_GDS0_MSL(:, :)
> psfc = psfc*0.01
> psfc_at_units = "hPa" ; Pa
>
> u10m = grb_file->U_GRD_GDS0_HTGL(:, :)
> ugrd = grb_file->U_GRD_GDS0_ISBL(:, :,:)
> u10m_at_units = "m/s" ; m/s
>
> v10m = grb_file->V_GRD_GDS0_HTGL(:, :)
> vgrd = grb_file->V_GRD_GDS0_ISBL(:, :,:)
> v10m_at_units = "m/s" ; m/s
>
> wind=sqrt(ugrd*ugrd+vgrd*vgrd)
> ************************************************
> wks =gsn_open_wks("ps",ofim(i))
> gsn_define_colormap(wks,"gui_default")
>
> res = True
> res_at_cnFillOn = True
> res_at_tiMainString = "Wind Speed (m/s) " + titl(i) + "h Fcst.";title
> res_at_cnLevelSpacingF = 5. ; contour spacing
>
> ; ({700},{-30:50},{ 135:270})
> plot=gsn_csm_contour(wks,ugrd(:,{19.4:19.4},:),res)
> ; plot=SahdeGtContour(plot,-999,10)
> ; opt = True
> ; opt_at_gsnShadeFillType = "Pattern"
> ; opt_at_gsnShadeHigh = 100
>
> ; plot=gsn_csm_contour_shade(plot,-999,25,opt)
>
> end do
>
> end
>
>
>
> --
> Ph. D. Student
> Jin-Young Kim (jin_at_climate.pknu.ac.kr <mailto:jin_at_climate.pknu.ac.kr>)
> Integrated Climate System Modeling Lab.
> Department of Environmental Atmospheric Sciences
> Pukyong National University, Busan 608-737, South Korea
> Web : http:climate.pknu.ac.kr/~jin <http://climate.pknu.ac.kr/~jin>
>
> Visiting Scholar
> Jin-Young Kim (Jin-Young.Kim_at_noaa.gov <mailto:Jin-Young.Kim_at_noaa.gov>)
> Global Systems Division
> Earth System Research Laboratory
> R/GSD7
> 325 Broadway
> Boulder, CO80305-3328
>
> +1-303- 497-4422 (Office)
> +1-303- 497-7262 (FAX)
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

-- 
--------------------------------------------------------------
Adam Phillips			             asphilli_at_ucar.edu
National Center for Atmospheric Research   tel: (303) 497-1726
ESSL/CGD/CAS                               fax: (303) 497-1333
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 Fri Nov 07 2008 - 15:47:58 MST

This archive was generated by hypermail 2.2.0 : Sun Nov 09 2008 - 06:17:31 MST