source: palm/trunk/SOURCE/time_to_string.f90 @ 754

Last change on this file since 754 was 484, checked in by raasch, 15 years ago

typo in file headers removed

  • Property svn:keywords set to Id
File size: 1.3 KB
RevLine 
[1]1 FUNCTION time_to_string( time )
2
[3]3!------------------------------------------------------------------------------!
[484]4! Current revisions:
[1]5! -----------------
6!
7!
8! Former revisions:
9! -----------------
[3]10! $Id: time_to_string.f90 484 2010-02-05 07:36:54Z raasch $
11! RCS Log replace by Id keyword, revision history cleaned up
12!
[1]13! Revision 1.3  2001/01/22 08:16:04  raasch
14! Comments translated into English
15!
16! Revision 1.1  1997/08/11 06:26:08  raasch
17! Initial revision
18!
19!
20! Description:
21! ------------
22! Transforming the time from real to character-string hh:mm:ss
[3]23!------------------------------------------------------------------------------!
[1]24
25    IMPLICIT NONE
26
27    CHARACTER (LEN=9) ::  time_to_string
28    INTEGER           ::  hours, minutes, seconds
29    REAL              ::  rest_time, time
30
31!
32!-- Calculate the number of hours, minutes, and seconds
33    hours     = INT( time / 3600.0 )
34    rest_time = time - hours * 3600
35    minutes   = INT( rest_time / 60.0 )
36    seconds   = rest_time - minutes * 60
37
38!
39!-- Build the string
40    IF ( hours < 100 )  THEN
41       WRITE (time_to_string,'(I2.2,'':'',I2.2,'':'',I2.2)')  hours, minutes, &
42                                                              seconds
43    ELSE
44       WRITE (time_to_string,'(I3.3,'':'',I2.2,'':'',I2.2)')  hours, minutes, &
45                                                              seconds
46    ENDIF
47
48 END FUNCTION time_to_string
Note: See TracBrowser for help on using the repository browser.