Re: (no subject)

From: Debasish PaiMazumder <debasish_at_nyahnyahspammersnyahnyah>
Date: Tue, 4 Aug 2009 09:55:16 -0400

Dear Sima,

Instead of doing y = (/y1,y2/)

You can do something like

y=new((/2,dimsizes(y1)/),typeof(y1))

y(0,:)=y1(:)
y(1,:)=y2(:)

Thanks

Debasish

On 09-08-04, at 06:15, sima sima wrote:

> Hi Dear
>
> I write an ncl script until open 2 different wrfout files and read
> T variable both of them, then draw it on a xy plot,it failed :
>
> Copyright (C) 1995-2009 - All Rights Reserved
> University Corporation for Atmospheric Research
> NCAR Command Language Version 5.1.1
> The use of this software is governed by a License Agreement.
> See http://www.ncl.ucar.edu/ for more details.
> fatal:Variable (T) is undefined
> fatal:Execute: Error occurred at or near line 17 in file sima.nc
>
> There is the program fallow:
>
> 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/wrf/WRF_contributed.ncl"
>
> begin
> f1 = addfile("wrfout_d04_2008-04-01_00:00:00.nc", "r")
> f2 = addfile ("/home/hamzelou/hamzehlou/WRF/run/
> wrfout_d04_2000-04-01_00:00:00.nc", "r")
> Times = f1->Times ; Times is of type character
> Time = WRF_Times2Udunits_c(Times, 0) ; convert to "hours since"
> ntim = dimsizes(Time)
>
> Times2 = f2->Times ; Times is of type character
> Time2 = WRF_Times2Udunits_c(Times, 0) ; convert to "hours since"
>
> y1 = f1->T(:,1,42,49) ; (Time, south_north, west_east)
> y2 = f2->T(:,1,42,49) ; (Time, bottom_top, south_north, west_east)
> y = (/y1,y2/) line17
> wks = gsn_open_wks("x11" ,"temp") ; ps,pdf,x11,ncgm,eps
>
> res = True ; plot mods desired
> Time_at_long_name = Time_at_units
> res_at_xyLineColors = (/"green", "red"/)
> plot = gsn_csm_xy(wks,Time,y,res)
> end line23
>
> I try to
> y = new (/y1,y2/)
> but it faild again:
> Copyright (C) 1995-2009 - All Rights Reserved
> University Corporation for Atmospheric Research
> NCAR Command Language Version 5.1.1
> The use of this software is governed by a License Agreement.
> See http://www.ncl.ucar.edu/ for more details.
> fatal:syntax error: line 17 in file sima.nc before or near (/
> y = new(/
> -----------^
>
> fatal:Syntax Error in block, block not executed
> fatal:error at line 23 in file sima.nc
>
> Please help me
>
> Sima
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

Debasish PaiMazumder, PhD
Hydrology & Climate Science
Postdoctoral Researcher at UQÀM/Ouranos
550, Sherbrooke west, 19th floor, west tower,
Montréal, QC, Canada H3A 1B9
Tel: (514) 282-6464-343
      (514) 937-0042 (R)
email: debasish_at_sca.uqam.ca

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Aug 04 2009 - 07:55:16 MDT

This archive was generated by hypermail 2.2.0 : Wed Aug 05 2009 - 20:36:03 MDT