Still struggling with regrid2
Daniel Victoria
daniel.victoria at GMAIL.COM
Tue May 29 15:17:48 EDT 2007
Mike, I'm resending an earlier email where I explain the dimensions of
the files. Could it be that I'm trying to convert a gaussian grid to a
uniform grid?
-------------------------------------------------------------------------------------------------------
I've daily NetCDF TMAX from ncep/ncar reanalysis at a gaussian grid
(downloaded from cdc) and want to resample it to a 0.25 x 0.25 grid.
So I issued the following command:
lats4d -i input.nc -o output -de template_0.25.ctl -func regrid2(@,0.25,0.25,bs)
And the output grid I got is all messed up! The dimensions and the
template file are:
Input dimensions:
ga-> q file
File 1 : daily NMC reanalysis (1948)
Descriptor: tmax.ncep.1948.2006.nc
Binary: tmax.ncep.1948.2006.nc
Type = Gridded
Xsize = 33 Ysize = 21 Zsize = 1 Tsize = 21550
Number of Variables = 1
tmax 0 -999 Daily Maximum Temperature at 2 m
ga-> q dims
Default file number is: 1
X is varying Lon = 270 to 330 X = 1.00001 to 33
Y is varying Lat = -29.5234 to 8.57257 Y = 1 to 21
Z is fixed Lev = 0 Z = 1
T is fixed Time = 00Z01JAN1948 T = 1
Template file:
dset nofile
title "Template GrADS ctl at 0.25 horizontal grid"
options template
undef -999
xdef 129 linear 279 0.25
ydef 101 linear -20 0.25
zdef 1 levels 1
tdef 21550 linear 00z01jan1948 1dy
vars 1
var 0 0 generic
endvars
Anyone knows what am I doing wrong?
Cheers
Daniel
On 5/29/07, Michael Fiorino <Michael.Fiorino at noaa.gov> wrote:
> daniel, this could be a bug, but it might also be the size of nimax,
> njmax -- you may need to increase for really big output files. i wrote
> this over 10 y ago and the default nimax,njmax is now on the low side.
> also, check the open for udf.regrid.gfi (input grid file) and
> udf.regrid.gfo (output grid file). i'm confused why you're getting more
> data out; you may need to do a 'set lat ...' 'set lon ...' to force
> output exactly where you want... the version you're using is that
> latest... best /r mike
>
>
>
>
> Daniel Victoria wrote:
> > Hi Michael,
> >
> > Xavier Francis helped me out and I figured out what was going on.
> > regrid2 was adding some more lines and columns to the output file. So,
> > the way I solved the issue was to export the regrided file to a binary
> > grid (set gxout fwrite). When I do this, GrADS reports the number of
> > columns/rows and the initial lat/lon. So I can then write a correct
> > .ctl file and export to NetCDF using lats4d. A lengthier process but
> > it works.
> >
> > As for the details, I did sent a more detailed email before but with
> > the input and output dimensions (template ctl and netcdf dims). I had
> > no idea it could be a compilation problem with regrid2, specially
> > because I know nothing about fortran.
> > Just to answer your questions, the open line in regrid2beta.f is:
> >
> > open (iunit_diag,file='udf.regrid.out',
> > $ form='formatted',status='unknown')
> >
> > Can't recall where I got the code from but it was about an year ago.
> > Is there a more recent version?
> >
> > Cheers
> > Daniel
> >
> >
> > On 5/29/07, Michael Fiorino <Michael.Fiorino at noaa.gov> wrote:
> >> daniel, this looks like a regrid2 build problem. the most annoying
> >> thing about fortran is the lack of a binary i/o standard... look at
> >> the 'open' line in the .f -- using direct access? sequential? and the
> >> usual plea -- if you want help, you HAVE to send details -- operating
> >> system, where you got the regrid code, the .ctl file you're working...
> >> /r mike
> >>
> >> Daniel Victoria wrote:
> >> > Hi all,
> >> >
> >> > I still haven't been able to regrid the gausian NCEP file to a uniform
> >> > 0.25 x 0.25 lat lon grid. The result I get is all messed up (attached
> >> > file). Does anyone knows what I'm doing wrong? Or is grads not able to
> >> > regrid the gaussian NCEP to uniform grid?
> >> >
> >> > Thanks
> >> > Daniel
> >> >
> >> >
> >> ------------------------------------------------------------------------
> >> >
> >>
>
More information about the gradsusr
mailing list