[1682] | 1 | !> @file local_tremain.f90 |
---|
[4677] | 2 | !--------------------------------------------------------------------------------------------------! |
---|
[2696] | 3 | ! This file is part of the PALM model system. |
---|
[1036] | 4 | ! |
---|
[4677] | 5 | ! PALM is free software: you can redistribute it and/or modify it under the terms of the GNU General |
---|
| 6 | ! Public License as published by the Free Software Foundation, either version 3 of the License, or |
---|
| 7 | ! (at your option) any later version. |
---|
[1036] | 8 | ! |
---|
[4677] | 9 | ! PALM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the |
---|
| 10 | ! implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
---|
| 11 | ! Public License for more details. |
---|
[1036] | 12 | ! |
---|
[4677] | 13 | ! You should have received a copy of the GNU General Public License along with PALM. If not, see |
---|
| 14 | ! <http://www.gnu.org/licenses/>. |
---|
[1036] | 15 | ! |
---|
[4360] | 16 | ! Copyright 1997-2020 Leibniz Universitaet Hannover |
---|
[4677] | 17 | !--------------------------------------------------------------------------------------------------! |
---|
[1036] | 18 | ! |
---|
[484] | 19 | ! Current revisions: |
---|
[1] | 20 | ! ----------------- |
---|
[4677] | 21 | ! |
---|
| 22 | ! |
---|
[1321] | 23 | ! Former revisions: |
---|
| 24 | ! ----------------- |
---|
| 25 | ! $Id: local_tremain.f90 4677 2020-09-14 07:55:28Z Giersch $ |
---|
[4677] | 26 | ! file re-formatted to follow the PALM coding standard |
---|
| 27 | ! |
---|
| 28 | ! 4360 2020-01-07 11:25:50Z suehring |
---|
[2716] | 29 | ! Corrected "Former revisions" section |
---|
[4677] | 30 | ! |
---|
[4182] | 31 | ! 3655 2019-01-07 16:51:22Z knoop |
---|
| 32 | ! Corrected "Former revisions" section |
---|
[1321] | 33 | ! |
---|
[4182] | 34 | ! Revision 1.1 1998/03/18 20:14:47 raasch |
---|
| 35 | ! Initial revision |
---|
| 36 | ! |
---|
| 37 | ! |
---|
[1] | 38 | ! Description: |
---|
| 39 | ! ------------ |
---|
[1682] | 40 | !> For different operating systems get the remaining cpu-time of the job |
---|
[4677] | 41 | !--------------------------------------------------------------------------------------------------! |
---|
[1682] | 42 | SUBROUTINE local_tremain( remaining_time ) |
---|
[1] | 43 | |
---|
[4677] | 44 | |
---|
| 45 | USE control_parameters, & |
---|
[1320] | 46 | ONLY: maximum_cpu_time_allowed |
---|
| 47 | |
---|
[4677] | 48 | USE cpulog, & |
---|
[1320] | 49 | ONLY: initial_wallclock_time |
---|
| 50 | |
---|
| 51 | USE kinds |
---|
| 52 | |
---|
[1] | 53 | USE pegrid |
---|
| 54 | |
---|
| 55 | IMPLICIT NONE |
---|
| 56 | |
---|
[1682] | 57 | INTEGER(idp) :: count !< |
---|
| 58 | INTEGER(idp) :: count_rate !< |
---|
[1808] | 59 | |
---|
[4677] | 60 | REAL(wp) :: current_wallclock_time !< |
---|
[1808] | 61 | REAL(wp) :: remaining_time !< |
---|
[1] | 62 | |
---|
| 63 | CALL SYSTEM_CLOCK( count, count_rate ) |
---|
[4677] | 64 | current_wallclock_time = REAL( count, KIND=wp ) / REAL( count_rate, KIND=wp ) |
---|
| 65 | remaining_time = maximum_cpu_time_allowed - ( current_wallclock_time - initial_wallclock_time ) |
---|
[1] | 66 | |
---|
| 67 | END SUBROUTINE local_tremain |
---|