7 |
SUBROUTINE abort_gcm(modname, message, ierr) |
SUBROUTINE abort_gcm(modname, message, ierr) |
8 |
|
|
9 |
! From abort_gcm.F, version 1.1.1.1 2004/05/19 12:53:05 |
! From abort_gcm.F, version 1.1.1.1 2004/05/19 12:53:05 |
10 |
|
! Stops the simulation, closing files and printing comments. |
11 |
|
|
12 |
! Stops the simulation cleanly, closing files and printing various |
USE histcom, only: histclo |
|
! comments |
|
13 |
|
|
14 |
! Input: modname = name of calling program |
character(len=*), intent(in):: modname ! name of calling program |
15 |
! message = stuff to print |
integer, intent(in):: ierr ! severity of situation (= 0 normal) |
16 |
! ierr = severity of situation ( = 0 normal ) |
character(len=*), intent(in):: message ! to print |
|
|
|
|
USE IOIPSL, only: histclo |
|
|
use iniprint, only: lunout |
|
|
|
|
|
character(len=*), intent(in):: modname |
|
|
integer, intent(in):: ierr |
|
|
character(len=*), intent(in):: message |
|
17 |
|
|
18 |
!------------------- |
!------------------- |
19 |
|
|
20 |
print *, 'abort_gcm' |
print *, 'abort_gcm' |
|
|
|
21 |
call histclo |
call histclo |
22 |
write(lunout,*) 'Stopping in ', modname |
print *, 'Stopping in ', modname |
23 |
write(lunout,*) 'Reason = ', trim(message) |
print *, 'Reason: ', trim(message) |
24 |
if (ierr == 0) then |
print *, 'Houston, we have a problem ', ierr |
25 |
write(lunout,*) 'Everything is cool' |
STOP 1 |
|
STOP |
|
|
else |
|
|
write(lunout,*) 'Houston, we have a problem ', ierr |
|
|
STOP 1 |
|
|
endif |
|
26 |
|
|
27 |
END SUBROUTINE abort_gcm |
END SUBROUTINE abort_gcm |
28 |
|
|