libtime++: Date and time calculation
time_add.f
Go to the documentation of this file.
1 c this is <time_add.f> (extracted from ../libtime.f)
2 c automatically generated by "SPLITF.PL V1.0 SPLIT Fortran source code"
3 c----------------------------------------------------------------------
4 c
5 c Copyright 2000 by Thomas Forbriger (IfG Stuttgart)
6 c
7 c ----
8 c libtime is free software; you can redistribute it and/or modify
9 c it under the terms of the GNU General Public License as published by
10 c the Free Software Foundation; either version 2 of the License, or
11 c (at your option) any later version.
12 c
13 c This program is distributed in the hope that it will be useful,
14 c but WITHOUT ANY WARRANTY; without even the implied warranty of
15 c MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 c GNU General Public License for more details.
17 c
18 c You should have received a copy of the GNU General Public License
19 c along with this program; if not, write to the Free Software
20 c Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21 c ----
22 c
23 c add two time records
24 c
25 c REVISIONS and CHANGES
26 c 05/08/2000 V1.0 Thomas Forbriger
27 c V2.0 call language specific warning routine
28 c
29 c ============================================================================
30 cS
31  subroutine time_add(date1, date2, date3)
32 c
33 c date3=date1+date2
34 c
35 c One of both should be a relative time:
36 c relative + absolute -> absolute
37 c relative + relative -> relative
38 c absolute + absolute -> senseless
39 c
40 c NOTICE: This version of time_add disregards leap-seconds!
41 c
42 c input:
43 c date1: primary time record
44 c date2: time record to be added
45 c output:
46 c date3: date1+date2 the sum of the input record
47 c
48 c last change: V2.00 (05/08/2000)
49 c
50  integer date1(7), date2(7), date3(7)
51 cE
52  integer i
53 c
54  if((date1(1).ne.0).and.(date2(1).ne.0)) call
55  & time_util_warning('time_add)',
56  & 'adding two absolute times is senseless')
57  call time_norm(date1)
58  call time_norm(date2)
59  do i=1,7
60  date3(i)=date1(i)+date2(i)
61  enddo
62  call time_norm(date3)
63  return
64  end
65 c
66 c ----- END OF <time_add.f> -----
subroutine time_util_warning(caller, text)
void time_add(time_Ts Date1, time_Ts Date2, time_Ts *Pdate3)
Definition: ctime_add.c:33
void time_norm(time_Ts *Pdate)
Definition: ctime_norm.c:33