Changeset 4677 for palm/trunk/SOURCE/local_stop.f90
- Timestamp:
- Sep 14, 2020 7:55:28 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/local_stop.f90
r4564 r4677 1 1 !> @file local_stop.f90 2 !------------------------------------------------------------------------------ !2 !--------------------------------------------------------------------------------------------------! 3 3 ! This file is part of the PALM model system. 4 4 ! 5 ! PALM is free software: you can redistribute it and/or modify it under the 6 ! terms of the GNU General Public License as published by the Free Software 7 ! Foundation, either version 3 of the License, or (at your option) any later 8 ! version. 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. 9 8 ! 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 FOR12 ! A PARTICULAR PURPOSE. See the GNU GeneralPublic License for more details.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. 13 12 ! 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/>.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/>. 16 15 ! 17 16 ! Copyright 1997-2020 Leibniz Universitaet Hannover 18 !------------------------------------------------------------------------------ !17 !--------------------------------------------------------------------------------------------------! 19 18 ! 20 19 ! Current revisions: 21 20 ! ----------------- 22 ! 23 ! 21 ! 22 ! 24 23 ! Former revisions: 25 24 ! ----------------- 26 25 ! $Id$ 26 ! file re-formatted to follow the PALM coding standard 27 ! 28 ! 4564 2020-06-12 14:03:36Z raasch 27 29 ! Vertical nesting method of Huq et al. (2019) removed 28 ! 30 ! 29 31 ! 4444 2020-03-05 15:59:50Z raasch 30 32 ! bugfix: misplaced cpp-directive moved 31 ! 33 ! 32 34 ! 4360 2020-01-07 11:25:50Z suehring 33 35 ! Corrected "Former revisions" section 34 ! 36 ! 35 37 ! 3655 2019-01-07 16:51:22Z knoop 36 38 ! Added an empty output string to stop keywords to clean up job protocol … … 43 45 ! ------------ 44 46 !> Stop program execution 45 !------------------------------------------------------------------------------ !47 !--------------------------------------------------------------------------------------------------! 46 48 SUBROUTINE local_stop 47 49 48 50 #if defined( __parallel ) 49 51 50 USE control_parameters, & 51 ONLY: abort_mode, coupling_mode, coupling_mode_remote, dt_restart, & 52 stop_dt, terminate_coupled, terminate_coupled_remote, & 53 terminate_run, time_restart 52 USE control_parameters, & 53 ONLY: abort_mode, coupling_mode, coupling_mode_remote, dt_restart, stop_dt, & 54 terminate_coupled, terminate_coupled_remote, terminate_run, time_restart 54 55 55 56 USE pegrid 56 57 57 USE pmc_interface, &58 USE pmc_interface, & 58 59 ONLY: nested_run 59 60 … … 63 64 IF ( nested_run ) THEN 64 65 ! 65 !-- Workaround: If any of the nested model crashes, it aborts the whole 66 !-- run with MPI_ABORT,regardless of the reason given by abort_mode66 !-- Workaround: If any of the nested model crashes, it aborts the whole run with MPI_ABORT, 67 !-- regardless of the reason given by abort_mode 67 68 CALL MPI_ABORT( MPI_COMM_WORLD, 9999, ierr ) 68 69 ELSE … … 84 85 IF ( myid == 0 ) THEN 85 86 PRINT*, '+++ local_stop:' 86 PRINT*, ' local model "', TRIM( coupling_mode ), & 87 '" stops now' 87 PRINT*, ' local model "', TRIM( coupling_mode ), '" stops now' 88 88 ENDIF 89 89 ! 90 !-- Inform the remote model of the termination and its reason, provided 91 !-- the remote model has not already been informed of another92 !-- termination reason (terminate_coupled > 0)before.90 !-- Inform the remote model of the termination and its reason, provided the remote model 91 !-- has not already been informed of another termination reason (terminate_coupled > 0) 92 !-- before. 93 93 IF ( terminate_coupled == 0 ) THEN 94 94 terminate_coupled = 1 95 95 IF ( myid == 0 ) THEN 96 CALL MPI_SENDRECV( &97 terminate_coupled, 1, MPI_INTEGER, target_id, 0, &98 terminate_coupled_remote, 1, MPI_INTEGER, target_id, 0, &96 CALL MPI_SENDRECV( & 97 terminate_coupled, 1, MPI_INTEGER, target_id, 0, & 98 terminate_coupled_remote, 1, MPI_INTEGER, target_id, 0, & 99 99 comm_inter, status, ierr ) 100 100 ENDIF … … 107 107 IF ( myid == 0 ) THEN 108 108 PRINT*, '+++ local_stop:' 109 PRINT*, ' remote model "', TRIM( coupling_mode_remote ), & 110 '" stopped' 109 PRINT*, ' remote model "', TRIM( coupling_mode_remote ), '" stopped' 111 110 ENDIF 112 111 CALL MPI_FINALIZE( ierr ) … … 116 115 IF ( myid == 0 ) THEN 117 116 PRINT*, '+++ local_stop:' 118 PRINT*, ' remote model "', TRIM( coupling_mode_remote ), & 119 '" terminated' 117 PRINT*, ' remote model "', TRIM( coupling_mode_remote ), '" terminated' 120 118 PRINT*, ' with stop_dt = .T.' 121 119 ENDIF … … 125 123 IF ( myid == 0 ) THEN 126 124 PRINT*, '+++ local_stop:' 127 PRINT*, ' remote model "', TRIM( coupling_mode_remote ), & 128 '" terminated' 125 PRINT*, ' remote model "', TRIM( coupling_mode_remote ), '" terminated' 129 126 PRINT*, ' with terminate_run = .T. (CPU-time limit)' 130 127 ENDIF … … 134 131 IF ( myid == 0 ) THEN 135 132 PRINT*, '+++ local_stop:' 136 PRINT*, ' remote model "', TRIM( coupling_mode_remote ), & 137 '" terminated' 133 PRINT*, ' remote model "', TRIM( coupling_mode_remote ), '" terminated' 138 134 PRINT*, ' with terminate_run = .T. (restart)' 139 135 ENDIF … … 144 140 IF ( myid == 0 ) THEN 145 141 PRINT*, '+++ local_stop:' 146 PRINT*, ' remote model "', TRIM( coupling_mode_remote ), & 147 '" terminated' 142 PRINT*, ' remote model "', TRIM( coupling_mode_remote ), '" terminated' 148 143 PRINT*, ' with terminate_run = .T. (single restart)' 149 144 ENDIF … … 161 156 #endif 162 157 163 END SUBROUTINE local_stop 158 END SUBROUTINE local_stop
Note: See TracChangeset
for help on using the changeset viewer.