SUBROUTINE local_tremain( remaining_time ) !--------------------------------------------------------------------------------! ! This file is part of PALM. ! ! PALM is free software: you can redistribute it and/or modify it under the terms ! of the GNU General Public License as published by the Free Software Foundation, ! either version 3 of the License, or (at your option) any later version. ! ! PALM is distributed in the hope that it will be useful, but WITHOUT ANY ! WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR ! A PARTICULAR PURPOSE. See the GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License along with ! PALM. If not, see . ! ! Copyright 1997-2012 Leibniz University Hannover !--------------------------------------------------------------------------------! ! ! Current revisions: ! ----------------- ! ! ! Former revisions: ! ----------------- ! $Id: local_tremain.f90 1037 2012-10-22 14:10:22Z fricke $ ! ! 1036 2012-10-22 13:43:42Z raasch ! code put under GPL (PALM 3.9) ! ! 225 2009-01-26 14:44:20Z raasch ! Type of count and count_rate changed to INTEGER(8) in order to avoid out of ! range problems (which result in measured negative time intervals) ! ! 82 2007-04-16 15:40:52Z raasch ! Preprocessor strings for different linux clusters changed to "lc", ! preprocessor directives for old systems removed ! ! RCS Log replace by Id keyword, revision history cleaned up ! ! Revision 1.14 2006/06/02 15:20:33 raasch ! Extended to TIT Sun Fire X4600 System (lctit) ! ! Revision 1.1 1998/03/18 20:14:47 raasch ! Initial revision ! ! ! Description: ! ------------ ! For different operating systems get the remaining cpu-time of the job !------------------------------------------------------------------------------! USE control_parameters USE cpulog USE pegrid IMPLICIT NONE REAL :: remaining_time #if defined( __ibm ) INTEGER(8) :: IRTC REAL :: actual_wallclock_time #elif defined( __lc ) INTEGER(8) :: count, count_rate REAL :: actual_wallclock_time #endif #if defined( __ibm ) actual_wallclock_time = IRTC( ) * 1E-9 remaining_time = maximum_cpu_time_allowed - & ( actual_wallclock_time - initial_wallclock_time ) #elif defined( __lc ) CALL SYSTEM_CLOCK( count, count_rate ) actual_wallclock_time = REAL( count ) / REAL( count_rate ) remaining_time = maximum_cpu_time_allowed - & ( actual_wallclock_time - initial_wallclock_time ) #elif defined( __nec ) CALL TREMAIN( remaining_time ) remaining_time = remaining_time / tasks_per_node #else ! !-- No stop due to running out of cpu-time on other machines remaining_time = 9999999.9 #endif END SUBROUTINE local_tremain