[gradsusr] Least-Squares Regression and Climatology (Time Series)

James T. Potemra jimp at hawaii.edu
Thu Jul 11 15:17:45 EDT 2013


Corey:

No idea about (1) below.  But for (2), you've got several potential 
problems in your
script.  The first line ('set time jan2020 dec2020') defines the time 
period to be a
single year (2020).  The second line creates "nino34"; this variable is 
only defined
for the period Jan 2020 through Dec 2020 as specified in the line 
above.  Further,
this statement will create a mean from Jan 2020 to Dec 2089 stepping by 
12 giving
a constant value.  "Code 2" is a little closer to what you want.  I 
think this should
work:

'set t 1 840'
'define nino34=(aave((sst-273.15),lon=120,lon=170,lat=-5,lat=5))
'set t 1 12'
'define nino34clim=ave(nino34,t=1,t+0,t=840,12)'
'set t 1 840'
'modify nino34clim seasonal'
'd nino34 - nino34clim'

Jim

On 7/11/13 8:32 AM, Corey Gabriel wrote:
> ***Identical to previous message.  Subject line included this time***
>
> Dear gradsusr mailing list:
>
> I am attempting to perform a least-squares regression of a 3-month running
> mean time series of sea surface temperatures over the Nino 3.4 region over
> the 70 year period 2020 to 2089.  My goal is to diagnose significant 
> events
> over that 70 year period by performing the least-squares regression.  I
> need to remove the seasonal cycle, and then compare the time series to the
> regression line.  A couple problems:
> 1.) GrADS will not allow me to use time as the ind. var. or dep. var. in
> the tregr() function or when defining the coeff.(b).
> 2.) I attempted to invoke climatology, based on the documentation provided
> here:http://grads.wikidot.com/algorithms.  However, I cannot seem to 
> remove
> the seasonality.
>
>   Please find the relevant portion of my code copied below.  An alternate
> version of my code is also copied below, using a different variable.  I
> have also attached the anomaly figure that code2(see below) generates.
>
> Any assistance would be tremendously appreciated!
> Corey
>
> *Code1: *'et time jan2020 dec2020
> define nino34=(aave((sst-273.15),lon=
> 120,lon=170,lat=-5,lat=5))
> define nino34clim=ave(nino34,time=jan2020,time=dec2089,12)
> modify nino34clim seasonal
> define b=tregr(t,nino34,t=1,t=840)
> define linearnino34clim= ( b*t + 420) + nino34clim
> d linearnino34clim
> c
> set lat 1
> set lon 1
> set grads off
> set cstyle 3
> set ccolor 3
> set cmark 0
> d nino34-linearnino34clim'
>
> *Code2(figure attached)
> *'set time jan2020 dec2089
> set t 1 840
> define nino34=(aave((sst-273.15),lon=120,lon=170,lat=-5,lat=5))
> define nino34clim=ave(nino34,time=jan2020,time=dec2089,12)
> modify nino34clim seasonal
> define b=tregr(nino34,nino34clim,t=1,t=840)
> define linearnino34clim=(b*nino34+nino34clim)
> d linearnino34clim
> c
> set grads off
> set lat 1
> set lon 1
> set cstyle 3
> set ccolor 3
> set cmark 0
> d nino34-linearnino34clim'
> *
>
>
> On Thu, Jul 11, 2013 at 2:22 PM, <gradsusr-request at gradsusr.org 
> <mailto:gradsusr-request at gradsusr.org>> wrote:
>
>     Send gradsusr mailing list submissions to
>     gradsusr at gradsusr.org <mailto:gradsusr at gradsusr.org>
>
>     To subscribe or unsubscribe via the World Wide Web, visit
>     http://gradsusr.org/mailman/listinfo/gradsusr
>     or, via email, send a message with subject or body 'help' to
>     gradsusr-request at gradsusr.org <mailto:gradsusr-request at gradsusr.org>
>
>     You can reach the person managing the list at
>     gradsusr-owner at gradsusr.org <mailto:gradsusr-owner at gradsusr.org>
>
>     When replying, please edit your Subject line so it is more specific
>     than "Re: Contents of gradsusr digest..."
>
>
>     Today's Topics:
>
>        1. Re: gradsusr Digest, Vol 41, Issue 19 (Corey Gabriel)
>
>
>     ----------------------------------------------------------------------
>
>     Message: 1
>     Date: Thu, 11 Jul 2013 14:22:07 -0400
>     From: Corey Gabriel <cjgabriel7 at gmail.com
>     <mailto:cjgabriel7 at gmail.com>>
>     Subject: Re: [gradsusr] gradsusr Digest, Vol 41, Issue 19
>     To: gradsusr at gradsusr.org <mailto:gradsusr at gradsusr.org>
>     Message-ID:
>            
>     <CAEhnGEru0gWKX=tSMgLyWCm3iFgMthwhxkEdnnY6yTTHANZA1A at mail.gmail.com <mailto:tSMgLyWCm3iFgMthwhxkEdnnY6yTTHANZA1A at mail.gmail.com>>
>     Content-Type: text/plain; charset="iso-8859-1"
>
>     Dear gradsusr mailing list:
>
>     I am attempting to perform a least-squares regression of a 3-month
>     running
>     mean time series of sea surface temperatures over the Nino 3.4
>     region over
>     the 70 year period 2020 to 2089.  My goal is to diagnose
>     significant events
>     over that 70 year period by performing the least-squares
>     regression.  I
>     need to remove the seasonal cycle, and then compare the time
>     series to the
>     regression line.  A couple problems:
>     1.) GrADS will not allow me to use time as the ind. var. or dep.
>     var. in
>     the tregr() function or when defining the coeff.(b).
>     2.) I attempted to invoke climatology, based on the documentation
>     provided
>     here:http://grads.wikidot.com/algorithms.  However, I cannot seem
>     to remove
>     the seasonality.
>
>       Please find the relevant portion of my code copied below.  An
>     alternate
>     version of my code is also copied below, using a different
>     variable.  I
>     have also attached the anomaly figure that code2(see below) generates.
>
>     Any assistance would be tremendously appreciated!
>     Corey
>
>     *Code1: *'et time jan2020 dec2020
>     define nino34=(aave((sst-273.15),lon=120,lon=170,lat=-5,lat=5))
>     define nino34clim=ave(nino34,time=jan2020,time=dec2089,12)
>     modify nino34clim seasonal
>     define b=tregr(t,nino34,t=1,t=840)
>     define linearnino34clim= ( b*t + 420) + nino34clim
>     d linearnino34clim
>     c
>     set lat 1
>     set lon 1
>     set grads off
>     set cstyle 3
>     set ccolor 3
>     set cmark 0
>     d nino34-linearnino34clim'
>
>     *Code2(figure attached)
>     *'set time jan2020 dec2089
>     set t 1 840
>     define nino34=(aave((sst-273.15),lon=120,lon=170,lat=-5,lat=5))
>     define nino34clim=ave(nino34,time=jan2020,time=dec2089,12)
>     modify nino34clim seasonal
>     define b=tregr(nino34,nino34clim,t=1,t=840)
>     define linearnino34clim=(b*nino34+nino34clim)
>     d linearnino34clim
>     c
>     set grads off
>     set lat 1
>     set lon 1
>     set cstyle 3
>     set ccolor 3
>     set cmark 0
>     d nino34-linearnino34clim'
>     *
>     *
>
>
>
>
>     On Thu, Jul 11, 2013 at 1:40 PM, <gradsusr-request at gradsusr.org
>     <mailto:gradsusr-request at gradsusr.org>> wrote:
>
>     > Send gradsusr mailing list submissions to
>     > gradsusr at gradsusr.org <mailto:gradsusr at gradsusr.org>
>     >
>     > To subscribe or unsubscribe via the World Wide Web, visit
>     > http://gradsusr.org/mailman/listinfo/gradsusr
>     > or, via email, send a message with subject or body 'help' to
>     > gradsusr-request at gradsusr.org <mailto:gradsusr-request at gradsusr.org>
>     >
>     > You can reach the person managing the list at
>     > gradsusr-owner at gradsusr.org <mailto:gradsusr-owner at gradsusr.org>
>     >
>     > When replying, please edit your Subject line so it is more specific
>     > than "Re: Contents of gradsusr digest..."
>     >
>     >
>     > Today's Topics:
>     >
>     >    1. Re: help - NetCDF file (Celso Bandeira de Melo Ribeiro)
>     >    2. Re: Shift in the lattitude while plotting in grads
>     >       mercator/latlon projction (Mohsen Soltani)
>     >    3. Re: Shift in the lattitude while plotting in grads
>     >       mercator/latlon projction (itesh dash)
>     >    4. Re: help - NetCDF file (James T. Potemra)
>     >    5. Re: Shift in the lattitude while plotting in grads
>     >       mercator/latlon projction (James T. Potemra)
>     >
>     >
>     >
>     ----------------------------------------------------------------------
>     >
>     > Message: 1
>     > Date: Thu, 11 Jul 2013 13:57:21 -0300
>     > From: Celso Bandeira de Melo Ribeiro <celso.bandeira at ufjf.edu.br
>     <mailto:celso.bandeira at ufjf.edu.br>>
>     > Subject: Re: [gradsusr] help - NetCDF file
>     > To: GrADS Users Forum <gradsusr at gradsusr.org
>     <mailto:gradsusr at gradsusr.org>>
>     > Message-ID: <34fb6a6e970b1fff4dc36f87278e432e at localhost>
>     > Content-Type: text/plain; charset=UTF-8
>     >
>     > Hi James,
>     > Thank you for attention and help.
>     > I modified the file data to diaries as show below:
>     >
>     > DSET ^amazonia.clm2.h0.2002-01-%m2-00000.nc <http://m2-00000.nc>
>     > OPTIONS 365_day_calendar
>     > tdef time 4 linear 01jan2000 1dy
>     >
>     > But it did not work, appeared the following error message:
>     >
>     > ga-> xdfopen amazonia.ctl
>     > Scanning Descriptor File:  amazonia.ctl
>     > Error: nc_open failed to open file
>     amazonia.clm2.h0.2002-01-%m2-00000.nc <http://m2-00000.nc>
>     > No such file or directory
>     > gadsdf: Couldn't ingest SDF metadata.
>     > SDF Descriptor file amazonia.ctl was not successfully opened &
>     parsed.
>     > ga->
>     >
>     > All the best!
>     >
>     > Celso
>     >
>     >
>     >
>     > On Wed, 10 Jul 2013 17:06:21 -1000, "James T. Potemra"
>     <jimp at hawaii.edu <mailto:jimp at hawaii.edu>>
>     > wrote:
>     > > Celso:
>     > >
>     > > Your descriptor file lists four times (months), but it is
>     specifically
>     > > reading only one file (amazonia.clm2.h0.2002-01-01-00000.nc
>     <http://amazonia.clm2.h0.2002-01-01-00000.nc>).  You
>     > > likely want to read all four, so you'll have to add an option
>     > > "template".  Also, it's not clear from the file names if they
>     reference
>     > > month-day or day-month, e.g., is
>     amazonia.clm2.h0.2002-01-04-00000.nc
>     <http://amazonia.clm2.h0.2002-01-04-00000.nc>
>     > > for January 4, 2002 or April 1, 2002?  In your descriptor file you
>     > > specify the time increment as monthly (1mo).  If the files
>     have single
>     > > time values (one monthly value), and the format of the file
>     name is
>     > > day-month, your DSET line should be something like:
>     > >
>     > > DSET ^amazonia.clm2.h0.2002-01-%m2-00000.nc <http://m2-00000.nc>
>     > >
>     > > The %m2 indicating a substitution template of 2-digit month.
>     > >
>     > > Jim
>     > >
>     > > On 7/10/13 3:58 PM, Celso Bandeira de Melo Ribeiro wrote:
>     > >> Hi Matt,
>     > >>
>     > >> Thank you very much for your attention and help.
>     > >> Worked perfectly I created the following file:
>     > >>
>     > >> DSET ^amazonia.clm2.h0.2002-01-01-00000.nc
>     <http://amazonia.clm2.h0.2002-01-01-00000.nc>
>     > >> OPTIONS 365_day_calendar
>     > >> tdef time 4 linear 01jan2000 1mo
>     > >>
>     > >> I am working with 4 files (Daily), whose names are:
>     > >>
>     > >> amazonia.clm2.h0.2002-01-01-00000.nc
>     <http://amazonia.clm2.h0.2002-01-01-00000.nc>
>     > >> amazonia.clm2.h0.2002-01-02-00000.nc
>     <http://amazonia.clm2.h0.2002-01-02-00000.nc>
>     > >> amazonia.clm2.h0.2002-01-03-00000.nc
>     <http://amazonia.clm2.h0.2002-01-03-00000.nc>
>     > >> amazonia.clm2.h0.2002-01-04-00000.nc
>     <http://amazonia.clm2.h0.2002-01-04-00000.nc>
>     > >>
>     > >> The file opens perfectly in GrADS:
>     > >>
>     > >> ga-> xdfopen amazonia.ctl
>     > >> Scanning Descriptor File:  amazonia.ctl
>     > >> SDF file amazonia.clm2.h0.2002-01-01-00000.nc
>     <http://amazonia.clm2.h0.2002-01-01-00000.nc> is open as file 1
>     > >> LON set to 279.062 311.875
>     > >> LAT set to -20.2999 6.45372
>     > >> LEV set to 0.00710064 0.00710064
>     > >> Time values set: 2000:1:1:0 2000:1:1:0
>     > >> E set to 1 1
>     > >> ga-> q file
>     > >> File 1 : CLM History file information
>     > >>    Descriptor: amazonia.ctl
>     > >>    Binary: amazonia.clm2.h0.2002-01-01-00000.nc
>     <http://amazonia.clm2.h0.2002-01-01-00000.nc>
>     > >>    Type = Gridded
>     > >>    Xsize = 106  Ysize = 115  Zsize = 15  Tsize = 4  Esize = 1
>     > >>    Number of Variables = 175
>     > >>      ...
>     > >>       tsoi  15  t,z,y,x  soil temperature
>     > >>       tsoi_10cm  0  t,y,x  soil temperature in top 10cm of soil
>     > >>       tv  0  t,y,x  vegetation temperature
>     > >>       u10  0  t,y,x  10-m wind
>     > >>       urban_ac  0  t,y,x  urban air conditioning flux
>     > >>   ...
>     > >>
>     > >> But when I try to open in GrADS putting time as a variable
>     (set 1 t 4)
>     > >> appears the following error message:
>     > >>
>     > >> ga-> set t 1 4
>     > >> Time values set: 2000:1:1:0 2000:4:1:0
>     > >> ga-> d tsoi
>     > >> Contouring: 273 to 279 interval 0.5
>     > >> gancgrid error: nc_get_vara_double failed; NetCDF: Index exceeds
>     > >> dimension
>     > >> bound
>     > >> Data Request Error:  Error for variable 'tsoi'
>     > >>    Error ocurred at column 1
>     > >> DISPLAY error:  Invalid expression
>     > >>    Expression = tsoi
>     > >> ga->
>     > >>
>     > >> You know how to help me change the time?
>     > >>
>     > >> All the best!
>     > >>
>     > >> Celso
>     > >>
>     > >>
>     > >>
>     > >> On Wed, 10 Jul 2013 12:43:38 -0700, Matt Masarik
>     > >> <mmasarik at atmos.ucla.edu <mailto:mmasarik at atmos.ucla.edu>>
>     > >> wrote:
>     > >>> Hi Celso,
>     > >>>
>     > >>> you can solve this by using a small (3 line) control file
>     > >>> that has the 365_day_calendar option specified.  Copy
>     > >>> the following text into a file, say, amazonia.ctl
>     > >>>
>     > >>> DSET ^amazonia.clm2.h0.2002-01-04-00000.nc
>     <http://amazonia.clm2.h0.2002-01-04-00000.nc>
>     > >>> OPTIONS 365_day_calendar
>     > >>> tdef time 3084 linear 16jan1850 1mo
>     > >>>
>     > >>> I put your file name in the DSET line already.  You will
>     > >>> need to change the 3084 to the total number of time
>     > >>> records in the file.  You can find this out by issuing
>     > >>> the following at a command prompt:
>     > >>>
>     > >>> ncdump -c amazonia.clm2.h0.2002-01-04-00000.nc
>     <http://amazonia.clm2.h0.2002-01-04-00000.nc>
>     > >>>
>     > >>> you will also need to change 16jan1850 to the start
>     > >>> date of your data set, again use ncdump.
>     > >>>
>     > >>> Once you make those changes you should be able to open
>     > >>> the file by using
>     > >>>
>     > >>> xdfopen amazonia.ctl
>     > >>>
>     > >>>
>     > >>> Matt
>     > >>>
>     > >>>
>     > >>> On 07/10/2013 11:50 AM, Celso Bandeira de Melo Ribeiro wrote:
>     > >>>> Hello,
>     > >>>> I'm working with GrADS Version 2.0.a9 in Linux Ubuntu
>     64-bit and I am
>     > >> not
>     > >>>> able to open NetCDF file.
>     > >>>> I am using the function "sdfopen" but an error message
>     appears as
>     > >> sending
>     > >>>> the attachment.
>     > >>>> The message, as follows:
>     > >>>>
>     > >>>> ga-> sdfopen amazonia.clm2.h0.2002-01-04-00000.nc
>     <http://amazonia.clm2.h0.2002-01-04-00000.nc>
>     > >>>> Scanning self-describing file:
>     amazonia.clm2.h0.2002-01-04-00000.nc
>     <http://amazonia.clm2.h0.2002-01-04-00000.nc>
>     > >>>> SDF Error: 365 day calendars are no longer supported by
>     sdfopen.
>     > >>>>     To open this file with GrADS, use a descriptor file with
>     > >>>>     a complete TDEF entry and OPTIONS 365_day_calendar.
>     > >>>>     Documentation is at
>     > >> http://iges.org/grads/gadoc/SDFdescriptorfile.html
>     > >>>> ga->
>     > >>>>
>     > >>>> I would like to know how solve this problem.
>     > >>>> Thank you!
>     > >>>> Celso
>     > >>>>
>     > >>> _______________________________________________
>     > >>> gradsusr mailing list
>     > >>> gradsusr at gradsusr.org <mailto:gradsusr at gradsusr.org>
>     > >>> http://gradsusr.org/mailman/listinfo/gradsusr
>     > >
>     > > _______________________________________________
>     > > gradsusr mailing list
>     > > gradsusr at gradsusr.org <mailto:gradsusr at gradsusr.org>
>     > > http://gradsusr.org/mailman/listinfo/gradsusr
>     >
>     > --
>     > ____________________________________________
>     > Prof. Celso Bandeira de Melo Ribeiro
>     > Universidade Federal de Juiz de Fora - UFJF
>     > Faculdade de Engenharia, Plataforma 4
>     > Departamento de Engenharia Sanit?ria e Ambiental - ESA
>     > Bairro Martelos, Juiz de Fora (MG) CEP. 36036-900
>     > tel. (32) 2102-3419, Ramal 30
>     >
>     >
>     > ------------------------------
>     >
>     > Message: 2
>     > Date: Thu, 11 Jul 2013 09:58:42 -0700
>     > From: Mohsen Soltani <soltani.clima at gmail.com
>     <mailto:soltani.clima at gmail.com>>
>     > Subject: Re: [gradsusr] Shift in the lattitude while plotting in
>     grads
>     >         mercator/latlon projction
>     > To: GrADS Users Forum <gradsusr at gradsusr.org
>     <mailto:gradsusr at gradsusr.org>>
>     > Message-ID:
>     >         <
>     >
>     CAPoCDiM50XFQjKOHUN86kCNNdB3kp69YFaJYb5emWgMyYLpCOA at mail.gmail.com
>     <mailto:CAPoCDiM50XFQjKOHUN86kCNNdB3kp69YFaJYb5emWgMyYLpCOA at mail.gmail.com>>
>     > Content-Type: text/plain; charset="iso-8859-1"
>     >
>     > itesh,
>     >
>     > Make sure Lat/Lon in your .ctl file are the same as your script!
>     >
>     > Mohsen
>     >
>     > --
>     > April showers bring May flowers!
>     > --
>     > *Mohsen Soltani, M.Sc.*
>     > Climatology Grad Student,
>     > Department of Climatology, Faculty of Geography,
>     > University of Tehran, Tehran, Iran
>     > voice: (+98) 9119772934 <tel:%28%2B98%29%209119772934>
>     > e-mail: soltani.clima at gmail.com <mailto:soltani.clima at gmail.com>
>     >
>     >
>     > On Thu, Jul 11, 2013 at 9:05 AM, itesh dash <itesh at rimes.int
>     <mailto:itesh at rimes.int>> wrote:
>     >
>     > > Dear Sir,
>     > >
>     > > I am working with the WRF and tried to plot the output in
>     grads. I found
>     > > there is nearly 1 degree shift in the projection and the plot.
>     > >
>     > > Please guide how to correct this.
>     > >
>     > > I am using mercator projection for the WRF model. Please find
>     attached
>     > > image.
>     > >
>     > > Seeking your advice on the same.
>     > >
>     > > regards,
>     > > itesh
>     > >
>     > >
>     > > _______________________________________________
>     > > gradsusr mailing list
>     > > gradsusr at gradsusr.org <mailto:gradsusr at gradsusr.org>
>     > > http://gradsusr.org/mailman/listinfo/gradsusr
>     > >
>     > >
>     > -------------- next part --------------
>     > An HTML attachment was scrubbed...
>     > URL:
>     >
>     http://gradsusr.org/pipermail/gradsusr/attachments/20130711/7cf013d5/attachment-0001.html
>     >
>     > ------------------------------
>     >
>     > Message: 3
>     > Date: Fri, 12 Jul 2013 00:31:29 +0700
>     > From: itesh dash <itesh at rimes.int <mailto:itesh at rimes.int>>
>     > Subject: Re: [gradsusr] Shift in the lattitude while plotting in
>     grads
>     >         mercator/latlon projction
>     > To: GrADS Users Forum <gradsusr at gradsusr.org
>     <mailto:gradsusr at gradsusr.org>>
>     > Message-ID:
>     >         <CAFTUJN465mGcZ8k=
>     > JDB1t6UvJRG9jO+1L+fAD20Gd4G8X_Qayg at mail.gmail.com
>     <mailto:JDB1t6UvJRG9jO%2B1L%2BfAD20Gd4G8X_Qayg at mail.gmail.com>>
>     > Content-Type: text/plain; charset="iso-8859-1"
>     >
>     > Dear Mohsen,
>     >
>     > thanks for the response. But I am not even trying to use any
>     script. Just
>     > by opening and plotting the ctl file.
>     >
>     > Here is my ctl file
>     >
>     > dset ^Jul1013_12.dat
>     > undef 1.e35
>     > xdef  639 linear   61.1815   0.0935
>     > ydef  459 linear   -3.1006   0.0873
>     > zdef    3 levels
>     >   850.00000
>     >   500.00000
>     >   200.00000
>     > tdef         8 linear 12z10jul2013  6hr
>     > vars 1
>     > HGT 0 0 Terrain Height
>     > endvars
>     >
>     > The wrf model ran with mercator projection 640 x 460 grid points
>     9 km
>     > resolution.
>     >
>     > I could not figure out why the shift is there. Is there a way i
>     can balance
>     > the shift.
>     >
>     > regards,
>     > itesh
>     >
>     >
>     > On Thu, Jul 11, 2013 at 11:58 PM, Mohsen Soltani
>     <soltani.clima at gmail.com <mailto:soltani.clima at gmail.com>
>     > >wrote:
>     >
>     > > itesh,
>     > >
>     > > Make sure Lat/Lon in your .ctl file are the same as your script!
>     > >
>     > > Mohsen
>     > >
>     > > --
>     > > April showers bring May flowers!
>     > > --
>     > > *Mohsen Soltani, M.Sc.*
>     > > Climatology Grad Student,
>     > > Department of Climatology, Faculty of Geography,
>     > > University of Tehran, Tehran, Iran
>     > > voice: (+98) 9119772934 <tel:%28%2B98%29%209119772934>
>     > > e-mail: soltani.clima at gmail.com <mailto:soltani.clima at gmail.com>
>     > >
>     > >
>     > > On Thu, Jul 11, 2013 at 9:05 AM, itesh dash <itesh at rimes.int
>     <mailto:itesh at rimes.int>> wrote:
>     > >
>     > >> Dear Sir,
>     > >>
>     > >> I am working with the WRF and tried to plot the output in
>     grads. I found
>     > >> there is nearly 1 degree shift in the projection and the plot.
>     > >>
>     > >> Please guide how to correct this.
>     > >>
>     > >> I am using mercator projection for the WRF model. Please find
>     attached
>     > >> image.
>     > >>
>     > >> Seeking your advice on the same.
>     > >>
>     > >> regards,
>     > >> itesh
>     > >>
>     > >>
>     > >> _______________________________________________
>     > >> gradsusr mailing list
>     > >> gradsusr at gradsusr.org <mailto:gradsusr at gradsusr.org>
>     > >> http://gradsusr.org/mailman/listinfo/gradsusr
>     > >>
>     > >>
>     > >
>     > > _______________________________________________
>     > > gradsusr mailing list
>     > > gradsusr at gradsusr.org <mailto:gradsusr at gradsusr.org>
>     > > http://gradsusr.org/mailman/listinfo/gradsusr
>     > >
>     > >
>     > -------------- next part --------------
>     > An HTML attachment was scrubbed...
>     > URL:
>     >
>     http://gradsusr.org/pipermail/gradsusr/attachments/20130712/9a256213/attachment-0001.html
>     >
>     > ------------------------------
>     >
>     > Message: 4
>     > Date: Thu, 11 Jul 2013 07:33:38 -1000
>     > From: "James T. Potemra" <jimp at hawaii.edu <mailto:jimp at hawaii.edu>>
>     > Subject: Re: [gradsusr] help - NetCDF file
>     > To: GrADS Users Forum <gradsusr at gradsusr.org
>     <mailto:gradsusr at gradsusr.org>>
>     > Message-ID: <51DEEC72.8050809 at hawaii.edu
>     <mailto:51DEEC72.8050809 at hawaii.edu>>
>     > Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>     >
>     > Hi Celso:
>     >
>     > You also have to add the option "template":
>     > OPTIONS template
>     >
>     > Jim
>     > On 7/11/13 6:57 AM, Celso Bandeira de Melo Ribeiro wrote:
>     > > Hi James,
>     > > Thank you for attention and help.
>     > > I modified the file data to diaries as show below:
>     > >
>     > > DSET ^amazonia.clm2.h0.2002-01-%m2-00000.nc <http://m2-00000.nc>
>     > > OPTIONS 365_day_calendar
>     > > tdef time 4 linear 01jan2000 1dy
>     > >
>     > > But it did not work, appeared the following error message:
>     > >
>     > > ga-> xdfopen amazonia.ctl
>     > > Scanning Descriptor File:  amazonia.ctl
>     > > Error: nc_open failed to open file
>     amazonia.clm2.h0.2002-01-%m2-00000.nc <http://m2-00000.nc>
>     > > No such file or directory
>     > > gadsdf: Couldn't ingest SDF metadata.
>     > > SDF Descriptor file amazonia.ctl was not successfully opened &
>     parsed.
>     > > ga->
>     > >
>     > > All the best!
>     > >
>     > > Celso
>     > >
>     > >
>     > >
>     > > On Wed, 10 Jul 2013 17:06:21 -1000, "James T. Potemra"
>     <jimp at hawaii.edu <mailto:jimp at hawaii.edu>>
>     > > wrote:
>     > >> Celso:
>     > >>
>     > >> Your descriptor file lists four times (months), but it is
>     specifically
>     > >> reading only one file (amazonia.clm2.h0.2002-01-01-00000.nc
>     <http://amazonia.clm2.h0.2002-01-01-00000.nc>).  You
>     > >> likely want to read all four, so you'll have to add an option
>     > >> "template".  Also, it's not clear from the file names if they
>     reference
>     > >> month-day or day-month, e.g., is
>     amazonia.clm2.h0.2002-01-04-00000.nc
>     <http://amazonia.clm2.h0.2002-01-04-00000.nc>
>     > >> for January 4, 2002 or April 1, 2002?  In your descriptor
>     file you
>     > >> specify the time increment as monthly (1mo).  If the files
>     have single
>     > >> time values (one monthly value), and the format of the file
>     name is
>     > >> day-month, your DSET line should be something like:
>     > >>
>     > >> DSET ^amazonia.clm2.h0.2002-01-%m2-00000.nc <http://m2-00000.nc>
>     > >>
>     > >> The %m2 indicating a substitution template of 2-digit month.
>     > >>
>     > >> Jim
>     > >>
>     > >> On 7/10/13 3:58 PM, Celso Bandeira de Melo Ribeiro wrote:
>     > >>> Hi Matt,
>     > >>>
>     > >>> Thank you very much for your attention and help.
>     > >>> Worked perfectly I created the following file:
>     > >>>
>     > >>> DSET ^amazonia.clm2.h0.2002-01-01-00000.nc
>     <http://amazonia.clm2.h0.2002-01-01-00000.nc>
>     > >>> OPTIONS 365_day_calendar
>     > >>> tdef time 4 linear 01jan2000 1mo
>     > >>>
>     > >>> I am working with 4 files (Daily), whose names are:
>     > >>>
>     > >>> amazonia.clm2.h0.2002-01-01-00000.nc
>     <http://amazonia.clm2.h0.2002-01-01-00000.nc>
>     > >>> amazonia.clm2.h0.2002-01-02-00000.nc
>     <http://amazonia.clm2.h0.2002-01-02-00000.nc>
>     > >>> amazonia.clm2.h0.2002-01-03-00000.nc
>     <http://amazonia.clm2.h0.2002-01-03-00000.nc>
>     > >>> amazonia.clm2.h0.2002-01-04-00000.nc
>     <http://amazonia.clm2.h0.2002-01-04-00000.nc>
>     > >>>
>     > >>> The file opens perfectly in GrADS:
>     > >>>
>     > >>> ga-> xdfopen amazonia.ctl
>     > >>> Scanning Descriptor File:  amazonia.ctl
>     > >>> SDF file amazonia.clm2.h0.2002-01-01-00000.nc
>     <http://amazonia.clm2.h0.2002-01-01-00000.nc> is open as file 1
>     > >>> LON set to 279.062 311.875
>     > >>> LAT set to -20.2999 6.45372
>     > >>> LEV set to 0.00710064 0.00710064
>     > >>> Time values set: 2000:1:1:0 2000:1:1:0
>     > >>> E set to 1 1
>     > >>> ga-> q file
>     > >>> File 1 : CLM History file information
>     > >>>     Descriptor: amazonia.ctl
>     > >>>     Binary: amazonia.clm2.h0.2002-01-01-00000.nc
>     <http://amazonia.clm2.h0.2002-01-01-00000.nc>
>     > >>>     Type = Gridded
>     > >>>     Xsize = 106  Ysize = 115  Zsize = 15  Tsize = 4  Esize = 1
>     > >>>     Number of Variables = 175
>     > >>>       ...
>     > >>>        tsoi  15  t,z,y,x  soil temperature
>     > >>>        tsoi_10cm  0  t,y,x  soil temperature in top 10cm of soil
>     > >>>        tv  0  t,y,x  vegetation temperature
>     > >>>        u10  0  t,y,x  10-m wind
>     > >>>        urban_ac  0  t,y,x  urban air conditioning flux
>     > >>>    ...
>     > >>>
>     > >>> But when I try to open in GrADS putting time as a variable
>     (set 1 t 4)
>     > >>> appears the following error message:
>     > >>>
>     > >>> ga-> set t 1 4
>     > >>> Time values set: 2000:1:1:0 2000:4:1:0
>     > >>> ga-> d tsoi
>     > >>> Contouring: 273 to 279 interval 0.5
>     > >>> gancgrid error: nc_get_vara_double failed; NetCDF: Index exceeds
>     > >>> dimension
>     > >>> bound
>     > >>> Data Request Error:  Error for variable 'tsoi'
>     > >>>     Error ocurred at column 1
>     > >>> DISPLAY error:  Invalid expression
>     > >>>     Expression = tsoi
>     > >>> ga->
>     > >>>
>     > >>> You know how to help me change the time?
>     > >>>
>     > >>> All the best!
>     > >>>
>     > >>> Celso
>     > >>>
>     > >>>
>     > >>>
>     > >>> On Wed, 10 Jul 2013 12:43:38 -0700, Matt Masarik
>     > >>> <mmasarik at atmos.ucla.edu <mailto:mmasarik at atmos.ucla.edu>>
>     > >>> wrote:
>     > >>>> Hi Celso,
>     > >>>>
>     > >>>> you can solve this by using a small (3 line) control file
>     > >>>> that has the 365_day_calendar option specified.  Copy
>     > >>>> the following text into a file, say, amazonia.ctl
>     > >>>>
>     > >>>> DSET ^amazonia.clm2.h0.2002-01-04-00000.nc
>     <http://amazonia.clm2.h0.2002-01-04-00000.nc>
>     > >>>> OPTIONS 365_day_calendar
>     > >>>> tdef time 3084 linear 16jan1850 1mo
>     > >>>>
>     > >>>> I put your file name in the DSET line already.  You will
>     > >>>> need to change the 3084 to the total number of time
>     > >>>> records in the file.  You can find this out by issuing
>     > >>>> the following at a command prompt:
>     > >>>>
>     > >>>> ncdump -c amazonia.clm2.h0.2002-01-04-00000.nc
>     <http://amazonia.clm2.h0.2002-01-04-00000.nc>
>     > >>>>
>     > >>>> you will also need to change 16jan1850 to the start
>     > >>>> date of your data set, again use ncdump.
>     > >>>>
>     > >>>> Once you make those changes you should be able to open
>     > >>>> the file by using
>     > >>>>
>     > >>>> xdfopen amazonia.ctl
>     > >>>>
>     > >>>>
>     > >>>> Matt
>     > >>>>
>     > >>>>
>     > >>>> On 07/10/2013 11:50 AM, Celso Bandeira de Melo Ribeiro wrote:
>     > >>>>> Hello,
>     > >>>>> I'm working with GrADS Version 2.0.a9 in Linux Ubuntu
>     64-bit and I am
>     > >>> not
>     > >>>>> able to open NetCDF file.
>     > >>>>> I am using the function "sdfopen" but an error message
>     appears as
>     > >>> sending
>     > >>>>> the attachment.
>     > >>>>> The message, as follows:
>     > >>>>>
>     > >>>>> ga-> sdfopen amazonia.clm2.h0.2002-01-04-00000.nc
>     <http://amazonia.clm2.h0.2002-01-04-00000.nc>
>     > >>>>> Scanning self-describing file:
>     amazonia.clm2.h0.2002-01-04-00000.nc
>     <http://amazonia.clm2.h0.2002-01-04-00000.nc>
>     > >>>>> SDF Error: 365 day calendars are no longer supported by
>     sdfopen.
>     > >>>>>      To open this file with GrADS, use a descriptor file with
>     > >>>>>      a complete TDEF entry and OPTIONS 365_day_calendar.
>     > >>>>>      Documentation is at
>     > >>> http://iges.org/grads/gadoc/SDFdescriptorfile.html
>     > >>>>> ga->
>     > >>>>>
>     > >>>>> I would like to know how solve this problem.
>     > >>>>> Thank you!
>     > >>>>> Celso
>     > >>>>>
>     > >>>> _______________________________________________
>     > >>>> gradsusr mailing list
>     > >>>> gradsusr at gradsusr.org <mailto:gradsusr at gradsusr.org>
>     > >>>> http://gradsusr.org/mailman/listinfo/gradsusr
>     > >> _______________________________________________
>     > >> gradsusr mailing list
>     > >> gradsusr at gradsusr.org <mailto:gradsusr at gradsusr.org>
>     > >> http://gradsusr.org/mailman/listinfo/gradsusr
>     >
>     >
>     >
>     > ------------------------------
>     >
>     > Message: 5
>     > Date: Thu, 11 Jul 2013 07:40:30 -1000
>     > From: "James T. Potemra" <jimp at hawaii.edu <mailto:jimp at hawaii.edu>>
>     > Subject: Re: [gradsusr] Shift in the lattitude while plotting in
>     grads
>     >         mercator/latlon projction
>     > To: GrADS Users Forum <gradsusr at gradsusr.org
>     <mailto:gradsusr at gradsusr.org>>
>     > Message-ID: <51DEEE0E.8030905 at hawaii.edu
>     <mailto:51DEEE0E.8030905 at hawaii.edu>>
>     > Content-Type: text/plain; charset="iso-8859-1"
>     >
>     > Itesh:
>     >
>     > Your model output is 640 x 460, but your descriptor file has
>     > xdef = 639 and ydef = 459.  These should be 640 and 460,
>     > respectively.  Also, I think what Mohsen meant was to make
>     > sure your starting lat/lon is the same in the descriptor file
>     > and model grid, i.e., you have 61.1815 as the starting lon
>     > and -3.1006 as the starting lat.  Are these the same as the
>     > model grid?
>     >
>     > Jim
>     >
>     > On 7/11/13 7:31 AM, itesh dash wrote:
>     > > Dear Mohsen,
>     > >
>     > > thanks for the response. But I am not even trying to use any
>     script.
>     > > Just by opening and plotting the ctl file.
>     > >
>     > > Here is my ctl file
>     > >
>     > > dset ^Jul1013_12.dat
>     > > undef 1.e35
>     > > xdef  639 linear   61.1815   0.0935
>     > > ydef  459 linear   -3.1006   0.0873
>     > > zdef    3 levels
>     > >   850.00000
>     > >   500.00000
>     > >   200.00000
>     > > tdef         8 linear 12z10jul2013  6hr
>     > > vars 1
>     > > HGT 0 0 Terrain Height
>     > > endvars
>     > >
>     > > The wrf model ran with mercator projection 640 x 460 grid
>     points 9 km
>     > > resolution.
>     > >
>     > > I could not figure out why the shift is there. Is there a way
>     i can
>     > > balance the shift.
>     > >
>     > > regards,
>     > > itesh
>     > >
>     > >
>     > > On Thu, Jul 11, 2013 at 11:58 PM, Mohsen Soltani
>     > > <soltani.clima at gmail.com <mailto:soltani.clima at gmail.com>
>     <mailto:soltani.clima at gmail.com <mailto:soltani.clima at gmail.com>>>
>     wrote:
>     > >
>     > >     itesh,
>     > >
>     > >     Make sure Lat/Lon in your .ctl file are the same as your
>     script!
>     > >
>     > >     Mohsen
>     > >
>     > >     --
>     > >     April showers bring May flowers!
>     > >     --
>     > >     *Mohsen Soltani, M.Sc.*
>     > >     Climatology Grad Student,
>     > >     Department of Climatology, Faculty of Geography,
>     > >     University of Tehran, Tehran, Iran
>     > >     voice: (+98) 9119772934 <tel:%28%2B98%29%209119772934>
>     > >     e-mail: soltani.clima at gmail.com
>     <mailto:soltani.clima at gmail.com> <mailto:soltani.clima at gmail.com
>     <mailto:soltani.clima at gmail.com>>
>     > >
>     > >
>     > >     On Thu, Jul 11, 2013 at 9:05 AM, itesh dash
>     <itesh at rimes.int <mailto:itesh at rimes.int>
>     > >     <mailto:itesh at rimes.int <mailto:itesh at rimes.int>>> wrote:
>     > >
>     > >         Dear Sir,
>     > >
>     > >         I am working with the WRF and tried to plot the output in
>     > >         grads. I found there is nearly 1 degree shift in the
>     > >         projection and the plot.
>     > >
>     > >         Please guide how to correct this.
>     > >
>     > >         I am using mercator projection for the WRF model.
>     Please find
>     > >         attached image.
>     > >
>     > >         Seeking your advice on the same.
>     > >
>     > >         regards,
>     > >         itesh
>     > >
>     > >
>     > > _______________________________________________
>     > >         gradsusr mailing list
>     > > gradsusr at gradsusr.org <mailto:gradsusr at gradsusr.org>
>     <mailto:gradsusr at gradsusr.org <mailto:gradsusr at gradsusr.org>>
>     > > http://gradsusr.org/mailman/listinfo/gradsusr
>     > >
>     > >
>     > >
>     > > _______________________________________________
>     > >     gradsusr mailing list
>     > > gradsusr at gradsusr.org <mailto:gradsusr at gradsusr.org>
>     <mailto:gradsusr at gradsusr.org <mailto:gradsusr at gradsusr.org>>
>     > > http://gradsusr.org/mailman/listinfo/gradsusr
>     > >
>     > >
>     > >
>     > >
>     > > _______________________________________________
>     > > gradsusr mailing list
>     > > gradsusr at gradsusr.org <mailto:gradsusr at gradsusr.org>
>     > > http://gradsusr.org/mailman/listinfo/gradsusr
>     >
>     > -------------- next part --------------
>     > An HTML attachment was scrubbed...
>     > URL:
>     >
>     http://gradsusr.org/pipermail/gradsusr/attachments/20130711/44403521/attachment.html
>     >
>     > ------------------------------
>     >
>     > _______________________________________________
>     > gradsusr mailing list
>     > gradsusr at gradsusr.org <mailto:gradsusr at gradsusr.org>
>     > http://gradsusr.org/mailman/listinfo/gradsusr
>     >
>     >
>     > End of gradsusr Digest, Vol 41, Issue 19
>     > ****************************************
>     >
>     -------------- next part --------------
>     An HTML attachment was scrubbed...
>     URL:
>     http://gradsusr.org/pipermail/gradsusr/attachments/20130711/721238f0/attachment.html
>     -------------- next part --------------
>     A non-text attachment was scrubbed...
>     Name: NINO34GISSR1G4.jpeg
>     Type: image/jpeg
>     Size: 15210 bytes
>     Desc: not available
>     Url :
>     http://gradsusr.org/pipermail/gradsusr/attachments/20130711/721238f0/attachment.jpeg
>
>     ------------------------------
>
>     _______________________________________________
>     gradsusr mailing list
>     gradsusr at gradsusr.org <mailto:gradsusr at gradsusr.org>
>     http://gradsusr.org/mailman/listinfo/gradsusr
>
>
>     End of gradsusr Digest, Vol 41, Issue 20
>     ****************************************
>
>
>
>
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20130711/d96ffbd4/attachment-0003.html 


More information about the gradsusr mailing list