source: palm/trunk/SOURCE/local_tremain.f90 @ 1036

Last change on this file since 1036 was 1036, checked in by raasch, 9 years ago

code has been put under the GNU General Public License (v3)

  • Property svn:keywords set to Id
File size: 2.7 KB
Line 
1 SUBROUTINE local_tremain( remaining_time )
2
3!--------------------------------------------------------------------------------!
4! This file is part of PALM.
5!
6! PALM is free software: you can redistribute it and/or modify it under the terms
7! of the GNU General Public License as published by the Free Software Foundation,
8! either version 3 of the License, or (at your option) any later version.
9!
10! PALM is distributed in the hope that it will be useful, but WITHOUT ANY
11! WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
12! A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
13!
14! You should have received a copy of the GNU General Public License along with
15! PALM. If not, see <http://www.gnu.org/licenses/>.
16!
17! Copyright 1997-2012  Leibniz University Hannover
18!--------------------------------------------------------------------------------!
19!
20! Current revisions:
21! -----------------
22!
23!
24! Former revisions:
25! -----------------
26! $Id: local_tremain.f90 1036 2012-10-22 13:43:42Z raasch $
27!
28! 225 2009-01-26 14:44:20Z raasch
29! Type of count and count_rate changed to INTEGER(8) in order to avoid out of
30! range problems (which result in measured negative time intervals)
31!
32! 82 2007-04-16 15:40:52Z raasch
33! Preprocessor strings for different linux clusters changed to "lc",
34! preprocessor directives for old systems removed
35!
36! RCS Log replace by Id keyword, revision history cleaned up
37!
38! Revision 1.14  2006/06/02 15:20:33  raasch
39! Extended to TIT Sun Fire X4600 System (lctit)
40!
41! Revision 1.1  1998/03/18 20:14:47  raasch
42! Initial revision
43!
44!
45! Description:
46! ------------
47! For different operating systems get the remaining cpu-time of the job
48!------------------------------------------------------------------------------!
49
50    USE control_parameters
51    USE cpulog
52    USE pegrid
53
54    IMPLICIT NONE
55
56    REAL ::  remaining_time
57#if defined( __ibm )
58    INTEGER(8) ::  IRTC
59    REAL       ::  actual_wallclock_time
60#elif defined( __lc )
61    INTEGER(8) ::  count, count_rate
62    REAL       ::  actual_wallclock_time
63#endif
64
65#if defined( __ibm )
66
67    actual_wallclock_time = IRTC( ) * 1E-9
68    remaining_time = maximum_cpu_time_allowed - &
69                     ( actual_wallclock_time - initial_wallclock_time )
70
71#elif defined( __lc )
72
73    CALL SYSTEM_CLOCK( count, count_rate )
74    actual_wallclock_time = REAL( count ) / REAL( count_rate )
75    remaining_time = maximum_cpu_time_allowed - &
76                     ( actual_wallclock_time - initial_wallclock_time )
77
78#elif defined( __nec )
79   
80    CALL TREMAIN( remaining_time )
81    remaining_time = remaining_time / tasks_per_node
82
83#else
84
85!
86!-- No stop due to running out of cpu-time on other machines
87    remaining_time = 9999999.9
88
89#endif
90
91 END SUBROUTINE local_tremain
Note: See TracBrowser for help on using the repository browser.