Date representation
  Home FAQ Contact Sign in
comp.lang.fortran only
 
Advanced search
POPULAR GROUPS

more...

comp.lang.fortran Profile…
 Up
Date representation         


Author: Marin Brkic
Date: Sep 11, 2008 00:45

Hello all,

please, if you can, i need your help. I have a list
2008.09.09 1.2 1.3 1.4
2008.09.14 1.5 1.6 1.7
2008.09.16 1.8 1.9 2.0
2008.09.17 2.1 2.2 2.3 (just throwing numbers here)

The first number is the date. The rest are some temperature, pressure
... etc. The dates are not all, some are missing.

I need to calculate some values, and draw some plots, but I'm having
trouble figuring out how to load the dates into fortran. For example,
if you were to need to plot this on a time basis, what would be the
appropriate course to take ?

I was thinking about trying to load the date as a string, split it
into parts, calculate what date is what day of the year (so 2008.09.09
would be, I don't know - 278th day) and then making further on.
Is there a better way ?

I would appreciate all your ideas and suggestions on this matter,

with regards
Marin
8 Comments
Re: Date representation         


Author: Arjen Markus
Date: Sep 11, 2008 01:16

On 11 sep, 09:45, Marin Brkic wrote:
> Hello all,
>
> please, if you can, i need your help. I have a list
> 2008.09.09 1.2 1.3 1.4
> 2008.09.14 1.5 1.6 1.7
> 2008.09.16 1.8 1.9 2.0
> 2008.09.17 2.1 2.2 2.3 (just throwing numbers here)
>
> The first number is the date. The rest are some temperature, pressure
> ... etc. The dates are not all, some are missing.
>
> I need to calculate some values, and draw some plots, but I'm having
> trouble figuring out how to load the dates into fortran. For example,
> if you were to need to plot this on a time basis, what would be the
> appropriate course to take ?
>
> I was thinking about trying to load the date as a string, split it
> into parts, calculate what date is what day of the year (so 2008.09.09
> would be, I don't know - 278th day) and then making further on. ...
Show full article (1.56Kb)
no comments
Re: Date representation         


Author: David Jones
Date: Sep 11, 2008 03:43

Marin Brkic wrote:
> Hello all,
>
> please, if you can, i need your help. I have a list
> 2008.09.09 1.2 1.3 1.4
> 2008.09.14 1.5 1.6 1.7
> 2008.09.16 1.8 1.9 2.0
> 2008.09.17 2.1 2.2 2.3 (just throwing numbers here)
>
> The first number is the date. The rest are some temperature, pressure
> ... etc. The dates are not all, some are missing.
>
> I need to calculate some values, and draw some plots, but I'm having
> trouble figuring out how to load the dates into fortran. For example,
> if you were to need to plot this on a time basis, what would be the
> appropriate course to take ?
>
> I was thinking about trying to load the date as a string, split it
> into parts, calculate what date is what day of the year (so 2008.09.09
> would be, I don't know - 278th day) and then making further on. ...
Show full article (1.95Kb)
no comments
Re: Date representation         


Author: Gary Scott
Date: Sep 11, 2008 05:30

Marin Brkic wrote:
> Hello all,
>
> please, if you can, i need your help. I have a list
> 2008.09.09 1.2 1.3 1.4
> 2008.09.14 1.5 1.6 1.7
> 2008.09.16 1.8 1.9 2.0
> 2008.09.17 2.1 2.2 2.3 (just throwing numbers here)
>
> The first number is the date. The rest are some temperature, pressure
> ... etc. The dates are not all, some are missing.
>
> I need to calculate some values, and draw some plots, but I'm having
> trouble figuring out how to load the dates into fortran. For example,
> if you were to need to plot this on a time basis, what would be the
> appropriate course to take ?

I would just read the numeric portions and skip over the periods/dots.
a4,1x,a2,1x,a2 or i4,1x,i2,1x,i2
Show full article (1.38Kb)
no comments
Re: Date representation         


Author: Gary Scott
Date: Sep 11, 2008 05:35

Gary Scott wrote:
> Marin Brkic wrote:
>
>> Hello all,
>>
>> please, if you can, i need your help. I have a list
>> 2008.09.09 1.2 1.3 1.4
>> 2008.09.14 1.5 1.6 1.7
>> 2008.09.16 1.8 1.9 2.0
>> 2008.09.17 2.1 2.2 2.3 ...
Show full article (1.32Kb)
no comments
Re: Date representation         


Author: feenberg
Date: Sep 11, 2008 05:42

On Sep 11, 3:45 am, Marin Brkic wrote:
> Hello all,
>
> please, if you can, i need your help. I have a list
> 2008.09.09 1.2 1.3 1.4
> 2008.09.14 1.5 1.6 1.7
> 2008.09.16 1.8 1.9 2.0
> 2008.09.17 2.1 2.2 2.3 (just throwing numbers here)
>
> The first number is the date. The rest are some temperature, pressure
> ... etc. The dates are not all, some are missing.
>
> I need to calculate some values, and draw some plots, but I'm having
> trouble figuring out how to load the dates into fortran. For example,
> if you were to need to plot this on a time basis, what would be the
> appropriate course to take ?
>
> I was thinking about trying to load the date as a string, split it
> into parts, calculate what date is what day of the year (so 2008.09.09
> would be, I don't know - 278th day) and then making further on. ...
Show full article (1.45Kb)
no comments
Re: Date representation         


Author: Kurt Kallblad
Date: Sep 11, 2008 06:41

"Marin Brkic" wrote in message
news:ufihc4t8ibr99bfabvqrfghiidreokes5s@4ax.com...
> Hello all,
>
> please, if you can, i need your help. I have a list
> 2008.09.09 1.2 1.3 1.4
> 2008.09.14 1.5 1.6 1.7
> 2008.09.16 1.8 1.9 2.0
> 2008.09.17 2.1 2.2 2.3 (just throwing numbers here)
>
> The first number is the date. The rest are some temperature,
> pressure
> ... etc. The dates are not all, some are missing.
>
> I need to calculate some values, and draw some plots, but I'm
> having
> trouble figuring out how to load the dates into fortran. For
> example,
> if you were to need to plot this on a time basis, what would be
> the ...
Show full article (2.83Kb)
no comments
Re: Date representation         


Author: Arjan
Date: Sep 11, 2008 10:07

Hi!

I have written a MODULE defining "DateType" plus operators for
addition, subtraction and comparison,
plus some other manipulation functions. By USE-ing this MODULE you can
make constructions like:

USE libdate

TYPE(DateType) :: t,t_stop

t = DateType(1994,1, 1, 0,0) ! 1 january 1994
t_stop = DateType(2008,9,11,12,0) ! noon today

DO WHILE (t.LT.t_stop)
......

WRITE(*,*) DOY(t) ! Integer number Day Of Year

......

t = t + DateType(0,0,0,1,0) ! timestep of 1 hour
ENDDO

Anyone interested can ask for the code.

Regards,

Arjan
no comments
Re: Date representation         


Author: michels
Date: Sep 15, 2008 01:47

On 13 Sep., 19:30, Marin Brkic wrote:
> On Thu, 11 Sep 2008 11:43:33 +0100, "David Jones" ceh.ac.uk>
> wrote:
>
> Hi David, thanks for answering.
>
>
>
>>You don't say what the format of the file is where they are missing. If the file is in a fixed format for all records then you may be able to use a formatted read to get year, month, day directly as integers rather than putting the date into a character variable first ... missing dates might produce three zeroes if the records are set-up to allow this.
>
> The file is in fixed format. I used the "1x" approach to skip the dots
> and it works fine. It read the file ok. I just now have to, uhmm,
> maybe not the best word, 'translate' the dates to make the time so I
> can sort them and calculate with them.
>
> I do not understand what you mean under "missing dates might produce
> three zeroes if the records are set-up to allow this". Three zeroes ?
>
>
> ...
Show full article (2.06Kb)
no comments