Re: wind_2.ncl script

From: Mittal, Moti <mmittal_at_nyahnyahspammersnyahnyah>
Date: Fri, 10 Apr 2009 12:29:37 -0400

Hi Dennis,

I used printVarSummary for u and v and had the following output.
It is showing [south_north | 49] x [west_east_stag | 50] for u
and [south_north_stag | 50] x [west_east | 49] for v.
My dimensions from wrfout header are as follows:

   1 netcdf wrfout_d01_2007-01-31_12 {
   2 dimensions:
   3 Time = UNLIMITED ; // (6 currently)
   4 DateStrLen = 19 ;
   5 west_east = 49 ;
   6 south_north = 49 ;
   7 bottom_top = 27 ;
   8 bottom_top_stag = 28 ;
   9 soil_layers_stag = 4 ;
  10 west_east_stag = 50 ;
  11 south_north_stag = 50 ;
  12 emissions_zdim = 1 ;
  13 klevs_for_dust = 1 ;
  14 dust_errosion_dimension = 3 ;

What am I doing wrong? I am using polar stereographic projection.
I am also attaching the script at the end of this message.

Thank you for your help.
Moti

[mmittal_at_localhost ~/NCL]$ !ncl
ncl wind_2.ncl
 Copyright (C) 1995-2009 - All Rights Reserved
 University Corporation for Atmospheric Research
 NCAR Command Language Version 5.1.0
 The use of this software is governed by a License Agreement.
 See http://www.ncl.ucar.edu/ for more details.

Variable: u
Type: float
Total Size: 1587600 bytes
            396900 values
Number of Dimensions: 4
Dimensions and sizes: [Time | 6] x [bottom_top | 27] x [south_north | 49] x [west_east_stag | 50]
Coordinates:
Number Of Attributes: 6
  FieldType : 104
  MemoryOrder : XYZ
  description : x-wind component
  units : m s-1
  stagger : X
  coordinates : XLONG_U XLAT_U

Variable: v
Type: float
Total Size: 1587600 bytes
            396900 values
Number of Dimensions: 4
Dimensions and sizes: [Time | 6] x [bottom_top | 27] x [south_north_stag | 50] x [west_east | 49]
Coordinates:
Number Of Attributes: 6
  FieldType : 104
  MemoryOrder : XYZ
  description : y-wind component
  units : m s-1
  stagger : Y
  coordinates : XLONG_V XLAT_V
fatal:uv2vrF: The input arrays must have the same dimension sizes
fatal:Execute: Error occurred at or near line 2277 in file $NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl

fatal:Execute: Error occurred at or near line 20 in file wind_2.ncl

wind_2.ncl: script

 1 ;*************************************************
  2 ; wind_2.ncl
  3 ;*************************************************
  4 load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
  5 load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
  6 load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
  7 ;*************************************************
  8 begin
  9 ;*************************************************
 10 ; open file and read in data: data are on a gaussian grid
 11 ;*************************************************
 12 f = addfile ("wrfout_d01_2007-01-31_12.nc", "r")
 13 u = f->U ; (time,lat,lon)
 14 printVarSummary (u)
 15 v = f->V
 16 printVarSummary (v)
 17 ;*************************************************
 18 ; calculate vorticity: Wrap version maintains meta data
 19 ;*************************************************
 20 vrt = uv2vrG_Wrap(u,v)
 21
 22 ;*************************************************
 23 ; calculate rotational wind component
 24 ; --
 25 ; note: the calculation uses a procedure, so memory
 26 ; must be preallocated.
 27 ;*************************************************
 28 ur = new ( dimsizes(u), typeof(u), u@_FillValue )
 29 vr = new ( dimsizes(v), typeof(v), v@_FillValue )
 30
 31 vr2uvg(vrt, ur,vr)
 32 ur_at_long_name = "Zonal Rotational Wind"
 33 ur_at_units = u_at_units
 34 vr_at_long_name = "Meridional Rotational Wind"
 35 vr_at_units = v_at_units
 36 copy_VarCoords(u, ur )
 37 copy_VarCoords(u, vr )
 38 ;*************************************************
 39 ; plot results
 40 ;*************************************************
 41 wks = gsn_open_wks("ps","wind") ; open workstation
 42
 43 res = True
 44
 45 res_at_vcRefMagnitudeF = 5. ; make vectors larger
 46 res_at_vcRefLengthF = 0.050 ; reference vector
 47 res_at_vcGlyphStyle = "CurlyVector" ; turn on curly vectors
 48 res_at_vcMinDistanceF = 0.022 ; thin the vectors
 49 res_at_vcRefAnnoOrthogonalPosF = -1.0 ; move ref vector up
 50 res_at_gsnLeftString = "Rotational Wind"
 51 ; plot 1st time step
 52 plot= gsn_csm_vector_map_ce(wks,ur(0,:,:),vr(0,:,:),res)
 53
 54 end

Professor, Department of Environment and Occupational Health
College of Public Health
University of South Florida
13201 Bruce B. Downs Blvd., MDC56
Tampa, Fl 33612-3805

Tel: (813) 974-9571
Fax: (813) 974-4986
Email: mmittal_at_health.usf.edu
________________________________________
From: Dennis Shea [shea_at_ucar.edu]
Sent: Tuesday, April 07, 2009 5:59 PM
To: Mittal, Moti
Cc: ncl-talk_at_ucar.edu
Subject: Re: wind_2.ncl script

Something tells me that you are not running
wind_2.ncl. It uses "uv2vrG_Wrap" and "vr2uvg"

So, you have changed something.

The eroor message say that you are using two
different sized array as input.

Please do a 'printVarSummary' on each variable.

Good luck

Mittal, Moti wrote:
> I was trying to run the wind script. I am getting the following error.
> I will appreciate the suggestion to circumvent.
>
> Thank you.
> Moti
>
> Out put message:
>
> [mmittal_at_localhost ~/NCL]$ ncl wind_2.ncl
> Copyright (C) 1995-2009 - All Rights Reserved
> University Corporation for Atmospheric Research
> NCAR Command Language Version 5.1.0
> The use of this software is governed by a License Agreement.
> See http://www.ncl.ucar.edu/ for more details.
> fatal:uv2vrF: The input arrays must have the same dimension sizes
> fatal:Execute: Error occurred at or near line 2277 in file $NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl
>
> fatal:Execute: Error occurred at or near line 18 in file wind_2.ncl
>
>
> Professor, Department of Environment and Occupational Health
> College of Public Health
> University of South Florida
> 13201 Bruce B. Downs Blvd., MDC56
> Tampa, Fl 33612-3805
>
> Tel: (813) 974-9571
> Fax: (813) 974-4986
> Email: mmittal_at_health.usf.edu
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Fri Apr 10 2009 - 10:29:37 MDT

This archive was generated by hypermail 2.2.0 : Sun Apr 12 2009 - 14:28:35 MDT