Re: questions about rcm2rgrid

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Thu, 29 Mar 2007 08:25:31 -0600 (MDT)

Dear Siraj,

Just an friendly reminder: when responding to ncl-talk, please change
the subject header from "Re: ncl-talk Digest, Vol 40, Issue 42" to
something more meaningful for the topic you are posting about. I've
taken the liberty of changing the subject header of this message.

As the error message indicates, the first argument (referred to as
"parameter (0)" in the error message, which I find very confusing)
must be 2-dimensional.

>From the looks of your script, you are doing this correctly, as your
lat2d and lon2d arrays both appear to be 2-dimensional. I
double-checked the routine on our end and it appears to be working.

To help me debug this, right before the call to "rcm2rgrid", can you
put the following in your script, and email me the output (you can
just email it to me personally):

    printVarSummary(lat2d)
    printVarSummary(lon2d)

Also, can you email me the version number of NCL that you are running?

Finally, here's a small way that you can clean up your script
slightly. You can replace the following code:

  newlon = new((/280/),typeof(lon2d))
  newlat = new((/200/),typeof(lat2d))

  do j=0,279
   newlon(j)= 50+(0.25)*j
  end do

  do i=0,199
   newlat(i)=-5+(0.25)*i
  end do

with:

  newlon = 50 + (0.25 * ispan(0,279,1))
  newlat = -5 + (0.25 * ispan(0,199,1))

--Mary

On Thu, 29 Mar 2007, Siraj Ul Islam wrote:

> Dear All,
>
> We have been trying to run the NCL script to convert ROTMER monthly
> postprocessed output of RegCM3 into regular lat long grid. But find
> the following error.
> ------------------------------------------------
>
> [root_at_localhost root]# ncl rcm2grid.ncl
>
> fatal:Number of dimensions in parameter (0) of (rcm2rgrid) is (3), (2)
> dimensions were expected
>
> fatal:Execute: Error occurred at or near line 38 in file rcm2grid.ncl
> -----------------------------------------------
>
> nc dump files of the outhead.nc and surface.nc file used in the script.
> Also the script for this convertion is also pasted at the end.
>
> thanks in advance,
>
> Regards,
> ----------------------------------------------
> ------------------------------------------------
> [root_at_localhost root]# ncl_filedump outhead.nc
> Variable: f (file variable)
> filename: outhead
> path: outhead.nc
> file global attributes:
> Conventions : COARDS
> calendar : standard
> comments : file created by grads using lats4d available from
> http://dao.gsfc.nasa.gov/sofware/grads/lats4d/
> model : geos/das
> center : gsfc
> dimensions:
> time = 1 // unlimited
> longitude = 303
> latitude = 226
> variables:
> double time ( time )
> units : hours since 2001-1-1 0
>
> -----------------------------------------------------
> ----------------------------------------------------
> filename: SRF
> path: SRF.nc
> file global attributes:
> domxmin : 52.37275
> domxmax : 108.0947
> domymin : -2.378861
> domymax : 44.79095
> domzmin : 1050
> domzmax : 1050
> dimensions:
> lon = 118
> lat = 109
> time = 132 // unlimited
> variables:
> float lon ( lon )
> long_name : Longitude
> units : degrees_east
> actual_range : <ARRAY>
>
> float lat ( lat )
> long_name : Latitude
> units : degrees_north
> actual_range : <ARRAY>
>
> -----------------------------------------------------------
>
> NCL SCRIPT
>
> -----------------------------------------------------------
>
> load "/usr/local/lib/ncarg/nclscripts/csm/gsn_code.ncl"
>
> load "/usr/local/lib/ncarg/nclscripts/csm/shea_util.ncl"
>
> load "/usr/local/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
>
> load "/usr/local/lib/ncarg/nclscripts/csm/contributed.ncl"
>
> ;********************************************
>
> begin
>
> dirhead="/root/"
>
> filhead="outhead.nc"
>
> dirrcm="/root/"
>
> filrcm="SRF.nc"
>
> fhead=addfile(dirhead+filhead,"r")
>
> f1 = addfile(dirrcm+filrcm,"r")
>
> var = f1->RT
>
> lat2d = fhead->xlat(0,:,:)
>
> lon2d = fhead->xlong(0,:,:)
>
> newlon = new((/280/),typeof(lon2d))
>
> newlat = new((/200/),typeof(lat2d))
>
> do j=0,279
>
> newlon(j)= 50+(0.25)*j
>
> end do
>
> do i=0,199
>
> newlat(i)=-5+(0.25)*i
>
> end do
>
> newvar = rcm2rgrid(lat2d,lon2d,var,newlat,newlon,0)
>
> end
>
> ------------------------------------------------
>
_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Mar 29 2007 - 08:25:31 MDT

This archive was generated by hypermail 2.2.0 : Sun Apr 01 2007 - 11:52:46 MDT