Re: ncl-talk Digest, Vol 102, Issue 23

From: Owanda Otieno <owandaotieno_at_nyahnyahspammersnyahnyah>
Date: Thu May 17 2012 - 09:58:38 MDT

Hi Cece,

You did not specify which data you are using.
One quick thing to check is the units (i.e mb. Pa ...) of you slp. It might
be in a unit that gives very small values on EOF computation, hence NCL
sets it to zero. If that is the case then try appropriate conversion and it
should work.

Cheers!
Owanda Otieno

On 5/14/12 3:52 PM, Cece Borries wrote:
> Hello.
>
> I am receiving the following error when I run my script to calculate
> EOF's for sea level pressure:
>
> Warning! LAPACK routine returned eigenvalue <= 0.
> Setting it to zero...
>
> My code, following the examples online, is:
>
> lat = new((/nlat/), "float", -999)
> lat(:) = (/slp(0,:,0)/)
>
> wgt = sqrt(cos(lat*0.01745329))
>
> slp_re = slp(lat|:,lon|:,year|:)
> slp_w = slp_re
>
> slp_w = slp_re*conform(slp_re, wgt, 0)
>
> x = slp_w({15:75},{140:250},:)
>
> neval = 3
> eof = eofunc(x, neval, True)
>
> I have used the same code for a different variable and received no
> errors, so I am guessing that something is wrong with my SLP data. Does
> anyone have any suggestions?
>
> Thanks so much!
>
> Cece
>
> --
> Cecilia Borries
>
> Graduate Student
> International Arctic Research Center
> Department of Atmospheric Sciences
>
> Teaching Assistant
> Department of Physics
> University of Alaska Fairbanks

On Tue, May 15, 2012 at 2:00 PM, <ncl-talk-request@ucar.edu> wrote:

> Send ncl-talk mailing list submissions to
> ncl-talk@ucar.edu
>
> To subscribe or unsubscribe via the World Wide Web, visit
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
> or, via email, send a message with subject or body 'help' to
> ncl-talk-request@ucar.edu
>
> You can reach the person managing the list at
> ncl-talk-owner@ucar.edu
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of ncl-talk digest..."
>
>
> Today's Topics:
>
> 1. Re: Writing netCDF binary to flat binary (Dennis Shea)
> 2. RE : writing netCDF as flat binary (James Scott)
> 3. EOF Eigenvalue Error (Cece Borries)
> 4. Re: EOF Eigenvalue Error (Dennis Shea)
> 5. To correctly define date variable (Noel Aloysius)
> 6. Re: antilog (Dennis Shea)
> 7. How to run scripts automaticially (Xiang_cy)
> 8. Printing Times Series for several grid points from wrf output
> files (Elena Maria Pison San Pedro)
> 9. Re: Printing Times Series for several grid points from wrf
> output files (Andrea N. Hahmann)
> 10. Re: To correctly define date variable (Mary Haley)
> 11. Re: How to run scripts automaticially (Mary Haley)
> 12. Re: Printing Times Series for several grid points from wrf
> output files (Dennis Shea)
> 13. Re: To correctly define date variable (Noel Aloysius)
> 14. Re: To correctly define date variable (Dennis Shea)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Mon, 14 May 2012 14:25:04 -0600
> From: Dennis Shea <shea@ucar.edu>
> Subject: Re: Writing netCDF binary to flat binary
> To: Noel Aloysius <noel.aloysius@gmail.com>
> Cc: NCL Talk <ncl-talk@ucar.edu>
> Message-ID: <4FB16A20.9030809@ucar.edu>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> You do not need to reorder.
>
> NCL is row major. The leftmost dimension varies slowest
> and the rightmost dimension varies fastest.
>
> Matlab is column major. The leftmost dimension varies fastest
> and the rightmost dimension varies slowest.
>
> The 'rule' is fastest varying dimension maps into fastest varying
> dimension.
>
> So ...
>
> netCDF (same as NCL): data(time,lat,lon)
>
> maps into
>
> Mtalab, fortran, R: data(lon,lat,time)
>
> ----
> No looping required:
>
> fo = "outfile.bin"
> f1 = addfile ("infile.nc", "r")
> data = f1->data
> fbindirwrite(fo, data )
>
> or, even
>
> fbindirwrite(fo, f1->data )
>
> =====
> Different language/tool indexing and ordering:
>
> NCL/C/C++: 0-based ; leftmost dimension varies slowest
> rightmost dimension varies fastest
>
> fortran, Matlab, R: 1-based; rightmost dimension varies slowest
> leftmost dimension varies fastest
> IDL: 0-based ; rightmost dimension varies slowest
>
> leftmost dimension varies fastest
>
> On 5/14/12 11:08 AM, Noel Aloysius wrote:
> > Hello NCL-talk:
> >
> > For further clarification, I am posting this question I previously asked
> > and answered.
> >
> > For an analysis I need to convert netCDF output to flat binary - netCDF
> > array size data(time,lat,lon) = data(1200,180,360).
> >
> > The output binary is read by a matlab program as data(lon,lat,time) =
> > data(360,180,1200).
> >
> > Do I have to rotate the dimensions before writing the binary?
> >
> > The following scripts does the conversion.
> >
> > f1 = addfile ("infile.nc <http://infile.nc>", "r")
> > data = f1->data
> > fo = "outfile.bin"
> > data1 = data(time|:,lon|:,lat|:) ;each time step has 360
> > lons and 180 lats
> > nt = 1200
> >
> > do nt=0,(nt-1 )
> > fbindirwrite(fo, vals(nt,:,:) )
> > end do
> >
> > Thanks,
> > Noel
> >
> >
> >
> > _______________________________________________
> > ncl-talk mailing list
> > List instructions, subscriber options, unsubscribe:
> > http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
> ------------------------------
>
> Message: 2
> Date: Mon, 14 May 2012 14:40:49 -0600
> From: James Scott <james.d.scott@noaa.gov>
> Subject: RE : writing netCDF as flat binary
> To: ncl-talk@ucar.edu
> Message-ID:
> <CAOHoOPPe4w3oTKFbyKTvKFtHDBnzTRSrFc2y1bCtjKb1W90PeA@mail.gmail.com
> >
> Content-Type: text/plain; charset="iso-8859-1"
>
> No, you don't need to change the array dimension order. You can also read
> the netcdf directly with Matlab.
>
> On Mon, May 14, 2012 at 12:00 PM, <ncl-talk-request@ucar.edu> wrote:
>
> > Hello NCL-talk:
> >
> > For further clarification, I am posting this question I previously asked
> > and answered.
> >
> > For an analysis I need to convert netCDF output to flat binary - netCDF
> > array size data(time,lat,lon) = data(1200,180,360).
> >
> > The output binary is read by a matlab program as data(lon,lat,time) =
> > data(360,180,1200).
> >
> > Do I have to rotate the dimensions before writing the binary?
> >
> > The following scripts does the conversion.
> >
> > f1 = addfile ("infile.nc", "r")
> > data = f1->data
> > fo = "outfile.bin"
> > data1 = data(time|:,lon|:,lat|:) ;each time step has 360 lons
> > and 180 lats
> > nt = 1200
> >
> > do nt=0,(nt-1 )
> > fbindirwrite(fo, vals(nt,:,:) )
> > end do
> >
> > Thanks,
> > Noel
> >
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20120514/7e16996c/attachment.html
>
> ------------------------------
>
> Message: 3
> Date: Mon, 14 May 2012 13:52:49 -0800
> From: Cece Borries <cjborries@alaska.edu>
> Subject: EOF Eigenvalue Error
> To: ncl-talk@ucar.edu
> Message-ID:
> <CAPogb3Y9-w7-TEKPRidB=K6mHtvAxsk-gob6g8e55Hm4o79qHQ@mail.gmail.com
> >
> Content-Type: text/plain; charset="iso-8859-1"
>
> Hello.
>
> I am receiving the following error when I run my script to calculate EOF's
> for sea level pressure:
>
> Warning! LAPACK routine returned eigenvalue <= 0.
> Setting it to zero...
>
> My code, following the examples online, is:
>
> lat = new((/nlat/), "float", -999)
> lat(:) = (/slp(0,:,0)/)
>
> wgt = sqrt(cos(lat*0.01745329))
>
> slp_re = slp(lat|:,lon|:,year|:)
> slp_w = slp_re
>
> slp_w = slp_re*conform(slp_re, wgt, 0)
>
> x = slp_w({15:75},{140:250},:)
>
> neval = 3
> eof = eofunc(x, neval, True)
>
> I have used the same code for a different variable and received no errors,
> so I am guessing that something is wrong with my SLP data. Does anyone
> have any suggestions?
>
> Thanks so much!
>
> Cece
>
> --
> Cecilia Borries
>
> Graduate Student
> International Arctic Research Center
> Department of Atmospheric Sciences
>
> Teaching Assistant
> Department of Physics
> University of Alaska Fairbanks
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20120514/22f96cda/attachment.html
>
> ------------------------------
>
> Message: 4
> Date: Mon, 14 May 2012 16:13:25 -0600
> From: Dennis Shea <shea@ucar.edu>
> Subject: Re: EOF Eigenvalue Error
> To: Cece Borries <cjborries@alaska.edu>
> Cc: ncl-talk@ucar.edu
> Message-ID: <4FB18385.8030602@ucar.edu>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> No much to go on here.
>
> Why are you doing
>
> lat = new((/nlat/), "float", -999)
> lat(:) = (/slp(0,:,0)/)
>
> Did you print lat after the above???
> print(lat)
>
> My guess is that you are assigning sea level pressure values
> to 'lat'. I think that would be a problem, n'est ce pas?
> also, no harm using lat(:) but better to use only 'lat'
>
>
> If you did the following
>
> f = addfile ("...", "r")
> slp = f->slp
>
> You should be able to use standard NCL syntax
>
> lat = slp&lat
> print(lat)
>
>
> ====
> If you want to work with just a region, you can directly
> read in just the region of interest. Good programming practice
> is to use variables rather than hard wiring values.
>
> latS = 15
> latN = 75
> lonL = 140
> lonR = 250
>
> f = addfile ("...", "r"0
> slp = f->slp(:,{latS;latN},{lonL:lonR})
> printVarSummary(slp)
>
> lat = slp&lat
> print(lat)
>
> ===
>
> Finally, use 'printVarSummary' a lot!
>
> Good luck
>
>
>
>
> On 5/14/12 3:52 PM, Cece Borries wrote:
> > Hello.
> >
> > I am receiving the following error when I run my script to calculate
> > EOF's for sea level pressure:
> >
> > Warning! LAPACK routine returned eigenvalue <= 0.
> > Setting it to zero...
> >
> > My code, following the examples online, is:
> >
> > lat = new((/nlat/), "float", -999)
> > lat(:) = (/slp(0,:,0)/)
> >
> > wgt = sqrt(cos(lat*0.01745329))
> >
> > slp_re = slp(lat|:,lon|:,year|:)
> > slp_w = slp_re
> >
> > slp_w = slp_re*conform(slp_re, wgt, 0)
> >
> > x = slp_w({15:75},{140:250},:)
> >
> > neval = 3
> > eof = eofunc(x, neval, True)
> >
> > I have used the same code for a different variable and received no
> > errors, so I am guessing that something is wrong with my SLP data. Does
> > anyone have any suggestions?
> >
> > Thanks so much!
> >
> > Cece
> >
> > --
> > Cecilia Borries
> >
> > Graduate Student
> > International Arctic Research Center
> > Department of Atmospheric Sciences
> >
> > Teaching Assistant
> > Department of Physics
> > University of Alaska Fairbanks
> >
> >
> >
> > _______________________________________________
> > ncl-talk mailing list
> > List instructions, subscriber options, unsubscribe:
> > http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
> ------------------------------
>
> Message: 5
> Date: Mon, 14 May 2012 18:55:34 -0400
> From: Noel Aloysius <noel.aloysius@gmail.com>
> Subject: To correctly define date variable
> To: NCL Talk <ncl-talk@ucar.edu>
> Message-ID:
> <CANfXz8FBSa-41zWg+J3RoMXsxok1ETqkdnzFbL3XDe80ZLyj=g@mail.gmail.com
> >
> Content-Type: text/plain; charset="iso-8859-1"
>
> Hello NCL-talk,
>
> Attached ncl script reads a binary file and writes a netCDF binary. The
> file it correctly written except the date variable. The date should start
> at 190101 and finish at 200012.
>
> Lines 26-48 in the script refer to the relevant section.
>
> Thanks in advance,
>
> Noel
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20120514/148a9685/attachment.html
> -------------- next part --------------
> A non-text attachment was scrubbed...
> Name: read_binary_write_netCDF.ncl
> Type: application/octet-stream
> Size: 3060 bytes
> Desc: not available
> Url :
> http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20120514/148a9685/attachment.obj
>
> ------------------------------
>
> Message: 6
> Date: Mon, 14 May 2012 18:33:01 -0600
> From: Dennis Shea <shea@ucar.edu>
> Subject: Re: antilog
> To: jbuzan <jbuzan@purdue.edu>
> Cc: ncl-talk@ucar.edu
> Message-ID: <4FB1A43D.5010709@ucar.edu>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> By antilog, do you the exponent or do you mean base 10?
>
> Look under the "General applied math" category
> http://www.ncl.ucar.edu/Document/Functions/
>
> http://www.ncl.ucar.edu/Document/Functions/Built-in/exp.shtml
> http://www.ncl.ucar.edu/Document/Functions/Built-in/log10.shtml
>
> On 5/14/12 7:46 AM, jbuzan wrote:
> > Hello,
> >
> > I am looking for the antilog function. I have been searching on the
> alphabetical listing for alog or antilog or anti-log, and I cannot find the
> antilog as a function.
> >
> > -Jonathan
> >
> > _______________________________________________
> > ncl-talk mailing list
> > List instructions, subscriber options, unsubscribe:
> > http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
> ------------------------------
>
> Message: 7
> Date: Tue, 15 May 2012 14:45:52 +0800
> From: "Xiang_cy"<Xiang_cy@126.com>
> Subject: How to run scripts automaticially
> To: "ncl-talk"<ncl-talk@ucar.edu>
> Message-ID: <7e7c5e1d.2015f8.1374f3ed84d.Coremail.Xiang_cy@126.com>
> Content-Type: text/plain; charset="utf-8"
>
> Hello,
>
>
> Is that possible to run a NCL script automatically under a WinXP system
> while thought Cgywin? If possible, could you please tell me the detail for
> that process.
>
> Thank you!
>
> **********************************************
> Chunyi XIANG
> Typhoon and Marine Meteorology Forecasting Center
> National Meteorological Center, R504
> China Meteorological Adminstration
> Add.: Zhongguancun South Ave., No.46,
> Haidian District,
> Beijing, P.R. China
> 100081
> Tel.: +86 10 68400343 Fax?+86 10 62175928
> **********************************************
>
> 2012-05-15
>
>
>
> Xiang_cy
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20120515/f43bd12f/attachment.html
>
> ------------------------------
>
> Message: 8
> Date: Tue, 15 May 2012 15:01:17 +0800
> From: Elena Maria Pison San Pedro <emp@dhi.com.sg>
> Subject: Printing Times Series for several grid points from
> wrf output files
> To: <ncl-talk@ucar.edu>
> Message-ID:
> <0DB1302871AD2D45A3FD1438B696A7D402120D3E@messiah.dhi.com.sg>
> Content-Type: text/plain; charset="us-ascii"
>
> Hello,
>
>
>
> I'm trying to print ascii files containing the time series of RAINC but
> for quite a lot of grid points.
>
> Is it possible to extract from wrf-output files several ascii files
> enumerated by the latitude longitude "name" of the grid?
>
>
>
> Could anyone suggest me which functions should I use?
>
>
>
> Thanks a lot in advance?
>
>
>
> Elena
>
>
>
>
>
>
>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20120515/2cd8c78d/attachment.html
>
> ------------------------------
>
> Message: 9
> Date: Tue, 15 May 2012 12:59:55 +0200
> From: "Andrea N. Hahmann" <ahah@dtu.dk>
> Subject: Re: Printing Times Series for several grid points
> from wrf output files
> To: Elena Maria Pison San Pedro <emp@dhi.com.sg>, "ncl-talk@ucar.edu"
> <ncl-talk@ucar.edu>
> Message-ID: <CBD80329.12991%ahah@dtu.dk>
> Content-Type: text/plain; charset="windows-1252"
>
> Dear Elena
>
> Have you consider using NCO? If you need only a grid point value, ncks
> would probably be the best choice for you. More info is available at:
> http://nco.sourceforge.net/nco.html#ncks-netCDF-Kitchen-Sink
>
> Regards,
> Andrea
> ----
> Andrea N. Hahmann
> Senior Scientist
> DTU Wind Energy
>
> Technical University of Denmark
> Ris? Campus
> Frederikborgvej 399, P.O. Box 49
> 4000 Roskilde, Denmark
>
> Direct +45 4677 5471
> Mobil: +45 2133 0550
> ahah@dtu.dk
> http://www.vindenergi.dtu.dk/
>
>
> From: Elena Maria Pison San Pedro <emp@dhi.com.sg<mailto:emp@dhi.com.sg>>
> To: "ncl-talk@ucar.edu<mailto:ncl-talk@ucar.edu>" <ncl-talk@ucar.edu
> <mailto:ncl-talk@ucar.edu>>
> Subject: Printing Times Series for several grid points from wrf
> output files
>
> Hello,
>
> I?m trying to print ascii files containing the time series of RAINC but
> for quite a lot of grid points.
> Is it possible to extract from wrf-output files several ascii files
> enumerated by the latitude longitude ?name? of the grid?
>
> Could anyone suggest me which functions should I use?
>
> Thanks a lot in advance?
>
> Elena
>
>
>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20120515/6ea35129/attachment.html
>
> ------------------------------
>
> Message: 10
> Date: Tue, 15 May 2012 08:11:06 -0600
> From: Mary Haley <haley@ucar.edu>
> Subject: Re: To correctly define date variable
> To: Noel Aloysius <noel.aloysius@gmail.com>
> Cc: NCL Talk <ncl-talk@ucar.edu>
> Message-ID: <9D1AB85D-D5AC-4D8B-8D74-64B558338B63@ucar.edu>
> Content-Type: text/plain; charset=iso-8859-1
>
> Noel,
>
> In your code, you are not incrementing the year array. You start at 1901
> but you never increment this.
>
> You need to add a loop across 1901 to 2000. You can also remove that inner
> loop:
>
> begin
> start_year = 1901
> end_year = 2000
> nmos = 12
> nyears = (end_year-start_year)+1
>
> ;---Count the number of leap years
> nleap = num(isleapyear(ispan(start_year,end_year,1)))
>
> ;---Calculate exact size of date/time arrays
> ntim = (nleap*366) +(nyears-nleap)*365
> time = new (ntim, float, "No_FillValue")
> date = new (ntim, integer, "No_FillValue")
>
> n = 0
> do ny=start_year,end_year
> do nmo=1,nmos
> YRM = ny*10000 + nmo*100
> ndm = days_in_month(ny,nmo)
> time(n:n+ndm-1) = ispan(n,n+ndm-1,1)
> date(n:n+ndm-1) = YRM + ispan(1,ndm,1)
> n = n + ndm
> end do
> end do
> print(date)
> end
>
>
>
> On May 14, 2012, at 4:55 PM, Noel Aloysius wrote:
>
> > Hello NCL-talk,
> >
> > Attached ncl script reads a binary file and writes a netCDF binary. The
> file it correctly written except the date variable. The date should start
> at 190101 and finish at 200012.
> >
> > Lines 26-48 in the script refer to the relevant section.
> >
> > Thanks in advance,
> >
> > Noel
> >
> >
> <read_binary_write_netCDF.ncl>_______________________________________________
> > ncl-talk mailing list
> > List instructions, subscriber options, unsubscribe:
> > http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
>
> ------------------------------
>
> Message: 11
> Date: Tue, 15 May 2012 08:13:17 -0600
> From: Mary Haley <haley@ucar.edu>
> Subject: Re: How to run scripts automaticially
> To: Xiang_cy <Xiang_cy@126.com>
> Cc: ncl-talk <ncl-talk@ucar.edu>
> Message-ID: <B92045A3-29B4-4BCB-B1D2-78B94EF37C7A@ucar.edu>
> Content-Type: text/plain; charset=utf-8
>
> You can only run NCL under X/Cygwin.
>
> Please see:
>
> http://www.ncl.ucar.edu/Download/cygwin.shtml
>
> for more information on installing and running NCL on a Windows system
> running X/Cygwin.
>
> --Mary
>
> On May 15, 2012, at 12:45 AM, Xiang_cy wrote:
>
> > Hello,
> >
> >
> > Is that possible to run a NCL script automatically under a WinXP system
> while thought Cgywin? If possible, could you please tell me the detail for
> that process.
> >
> > Thank you!
> >
> > **********************************************
> > Chunyi XIANG
> > Typhoon and Marine Meteorology Forecasting Center
> > National Meteorological Center, R504
> > China Meteorological Adminstration
> > Add.: Zhongguancun South Ave., No.46,
> > Haidian District,
> > Beijing, P.R. China
> > 100081
> > Tel.: +86 10 68400343 Fax?+86 10 62175928
> > **********************************************
> >
> > 2012-05-15
> > Xiang_cy
> > _______________________________________________
> > ncl-talk mailing list
> > List instructions, subscriber options, unsubscribe:
> > http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
>
> ------------------------------
>
> Message: 12
> Date: Tue, 15 May 2012 08:49:03 -0600
> From: Dennis Shea <shea@ucar.edu>
> Subject: Re: Printing Times Series for several grid points
> from wrf output files
> To: Elena Maria Pison San Pedro <emp@dhi.com.sg>
> Cc: "ncl-talk@ucar.edu" <ncl-talk@ucar.edu>
> Message-ID: <4FB26CDF.7090701@ucar.edu>
> Content-Type: text/plain; charset=windows-1252; format=flowed
>
> The NCO may do what you want.
>
> If not, lease resend to ncl-talk more details.
> Are the point scattered (if so, how many); are they a block of points;
>
>
> On 5/15/12 4:59 AM, Andrea N. Hahmann wrote:
> > Dear Elena
> >
> > Have you consider using NCO? If you need only a grid point value, ncks
> > would probably be the best choice for you. More info is available at:
> > http://nco.sourceforge.net/nco.html#ncks-netCDF-Kitchen-Sink
> >
> > Regards,
> > Andrea
> > ----
> > Andrea N. Hahmann
> > Senior Scientist
> > DTU Wind Energy
> >
> > *Technical University of Denmark
> > *Ris? Campus
> > Frederikborgvej 399, P.O. Box 49
> > 4000 Roskilde, Denmark
> >
> > Direct +45 4677 5471
> > Mobil: +45 2133 0550
> > ahah@dtu.dk
> > http://www.vindenergi.dtu.dk/
> >
> >
> > From: Elena Maria Pison San Pedro <emp@dhi.com.sg <mailto:emp@dhi.com.sg
> >>
> > To: "ncl-talk@ucar.edu <mailto:ncl-talk@ucar.edu>" <ncl-talk@ucar.edu
> > <mailto:ncl-talk@ucar.edu>>
> > Subject: Printing Times Series for several grid points from
> > wrf output files
> >
> > Hello,
> >
> > I?m trying to print ascii files containing the time series of RAINC but
> > for quite a lot of grid points.
> >
> > Is it possible to extract from wrf-output files several ascii files
> > enumerated by the latitude longitude ?name? of the grid?
> >
> > Could anyone suggest me which functions should I use?
> >
> > Thanks a lot in advance?
> >
> > Elena
> >
> >
> >
> > _______________________________________________
> > ncl-talk mailing list
> > List instructions, subscriber options, unsubscribe:
> > http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
> ------------------------------
>
> Message: 13
> Date: Tue, 15 May 2012 12:13:48 -0400
> From: Noel Aloysius <noel.aloysius@gmail.com>
> Subject: Re: To correctly define date variable
> To: NCL Talk <ncl-talk@ucar.edu>
> Message-ID:
> <CANfXz8H78hBo9YkMNRy+prz3S+Z=ZRVneWgiA7Y9x5F6MpMUEA@mail.gmail.com
> >
> Content-Type: text/plain; charset="iso-8859-1"
>
> Thanks Mary. The script you sent computes the daily time series. I want
> ntim = 1200 for a monthly series. Could you show me how I can modify the
> code please?
>
> Thanks,
> Noel
>
>
> On Tue, May 15, 2012 at 10:11 AM, Mary Haley <haley@ucar.edu> wrote:
>
> > Noel,
> >
> > In your code, you are not incrementing the year array. You start at 1901
> > but you never increment this.
> >
> > You need to add a loop across 1901 to 2000. You can also remove that
> inner
> > loop:
> >
> > begin
> > start_year = 1901
> > end_year = 2000
> > nmos = 12
> > nyears = (end_year-start_year)+1
> >
> > ;---Count the number of leap years
> > nleap = num(isleapyear(ispan(start_year,end_year,1)))
> >
> > ;---Calculate exact size of date/time arrays
> > ntim = (nleap*366) +(nyears-nleap)*365
> > time = new (ntim, float, "No_FillValue")
> > date = new (ntim, integer, "No_FillValue")
> >
> > n = 0
> > do ny=start_year,end_year
> > do nmo=1,nmos
> > YRM = ny*10000 + nmo*100
> > ndm = days_in_month(ny,nmo)
> > time(n:n+ndm-1) = ispan(n,n+ndm-1,1)
> > date(n:n+ndm-1) = YRM + ispan(1,ndm,1)
> > n = n + ndm
> > end do
> > end do
> > print(date)
> > end
> >
> >
> >
> > On May 14, 2012, at 4:55 PM, Noel Aloysius wrote:
> >
> > > Hello NCL-talk,
> > >
> > > Attached ncl script reads a binary file and writes a netCDF binary. The
> > file it correctly written except the date variable. The date should start
> > at 190101 and finish at 200012.
> > >
> > > Lines 26-48 in the script refer to the relevant section.
> > >
> > > Thanks in advance,
> > >
> > > Noel
> > >
> > >
> >
> <read_binary_write_netCDF.ncl>_______________________________________________
> > > ncl-talk mailing list
> > > List instructions, subscriber options, unsubscribe:
> > > http://mailman.ucar.edu/mailman/listinfo/ncl-talk
> >
> >
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20120515/a8f690ed/attachment.html
>
> ------------------------------
>
> Message: 14
> Date: Tue, 15 May 2012 10:47:50 -0600
> From: Dennis Shea <shea@ucar.edu>
> Subject: Re: To correctly define date variable
> To: Noel Aloysius <noel.aloysius@gmail.com>
> Cc: NCL Talk <ncl-talk@ucar.edu>
> Message-ID: <4FB288B6.8040607@ucar.edu>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> if nyrs=100 and nmos=12; ntim = nmos*nyrs (=1200)
>
> On 05/15/2012 10:13 AM, Noel Aloysius wrote:
> > Thanks Mary. The script you sent computes the daily time series. I want
> > ntim = 1200 for a monthly series. Could you show me how I can modify the
> > code please?
> >
> > Thanks,
> > Noel
> >
> >
> > On Tue, May 15, 2012 at 10:11 AM, Mary Haley <haley@ucar.edu
> > <mailto:haley@ucar.edu>> wrote:
> >
> > Noel,
> >
> > In your code, you are not incrementing the year array. You start at
> > 1901 but you never increment this.
> >
> > You need to add a loop across 1901 to 2000. You can also remove that
> > inner loop:
> >
> > begin
> > start_year = 1901
> > end_year = 2000
> > nmos = 12
> > nyears = (end_year-start_year)+1
> >
> > ;---Count the number of leap years
> > nleap = num(isleapyear(ispan(start_year,end_year,1)))
> >
> > ;---Calculate exact size of date/time arrays
> > ntim = (nleap*366) +(nyears-nleap)*365
> > time = new (ntim, float, "No_FillValue")
> > date = new (ntim, integer, "No_FillValue")
> >
> > n = 0
> > do ny=start_year,end_year
> > do nmo=1,nmos
> > YRM = ny*10000 + nmo*100
> > ndm = days_in_month(ny,nmo)
> > time(n:n+ndm-1) = ispan(n,n+ndm-1,1)
> > date(n:n+ndm-1) = YRM + ispan(1,ndm,1)
> > n = n + ndm
> > end do
> > end do
> > print(date)
> > end
> >
> >
> >
> > On May 14, 2012, at 4:55 PM, Noel Aloysius wrote:
> >
> > > Hello NCL-talk,
> > >
> > > Attached ncl script reads a binary file and writes a netCDF
> > binary. The file it correctly written except the date variable. The
> > date should start at 190101 and finish at 200012.
> > >
> > > Lines 26-48 in the script refer to the relevant section.
> > >
> > > Thanks in advance,
> > >
> > > Noel
> > >
> > >
> >
> <read_binary_write_netCDF.ncl>_______________________________________________
> > > 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
>
>
>
> ------------------------------
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk@ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
> End of ncl-talk Digest, Vol 102, Issue 23
> *****************************************
>

-- 
Owanda Otieno
Department of Natural Resources and the Environment
University of Connecticut
1376 Storrs Road, Unit 4087
Storrs, CT 06269-4087
Phone: (860) 486-1876

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu May 17 09:58:52 2012

This archive was generated by hypermail 2.1.8 : Thu May 17 2012 - 13:42:02 MDT