Line |
Branch |
Exec |
Source |
1 |
|
|
! $Id: $ |
2 |
|
✗ |
SUBROUTINE abort_physic(modname, message, ierr) |
3 |
|
|
|
4 |
|
|
USE IOIPSL |
5 |
|
|
USE mod_phys_lmdz_para |
6 |
|
|
USE print_control_mod, ONLY: lunout |
7 |
|
|
IMPLICIT NONE |
8 |
|
|
! |
9 |
|
|
! Stops the simulation cleanly, closing files and printing various |
10 |
|
|
! comments |
11 |
|
|
! |
12 |
|
|
! Input: modname = name of calling program |
13 |
|
|
! message = stuff to print |
14 |
|
|
! ierr = severity of situation ( = 0 normal ) |
15 |
|
|
|
16 |
|
|
character(len=*), intent(in):: modname |
17 |
|
|
integer ierr, ierror_mpi |
18 |
|
|
character(len=*), intent(in):: message |
19 |
|
|
|
20 |
|
✗ |
write(lunout,*) 'in abort_physic' |
21 |
|
|
!$OMP MASTER |
22 |
|
✗ |
call histclo |
23 |
|
✗ |
call restclo |
24 |
|
✗ |
if (mpi_rank .eq. 0) then |
25 |
|
✗ |
call getin_dump |
26 |
|
|
endif |
27 |
|
|
!$OMP END MASTER |
28 |
|
|
|
29 |
|
✗ |
write(lunout,*) 'Stopping in ', modname |
30 |
|
✗ |
write(lunout,*) 'Reason = ',message |
31 |
|
✗ |
if (ierr .eq. 0) then |
32 |
|
✗ |
write(lunout,*) 'Everything is cool' |
33 |
|
|
else |
34 |
|
✗ |
write(lunout,*) 'Houston, we have a problem, ierr = ', ierr |
35 |
|
✗ |
stop 1 |
36 |
|
|
endif |
37 |
|
✗ |
END |
38 |
|
|
|