SUBROUTINE local_tremain( remaining_time ) !------------------------------------------------------------------------------! ! Current revisions: ! ----------------- ! ! ! Former revisions: ! ----------------- ! $Id: local_tremain.f90 484 2010-02-05 07:36:54Z maronga $ ! ! 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