1 | ! |
---|
2 | ! $Id: abort_gcm.F 1279 2009-12-10 09:02:56Z snguyen $ |
---|
3 | ! |
---|
4 | c |
---|
5 | c |
---|
6 | SUBROUTINE abort_gcm(modname, message, ierr) |
---|
7 | |
---|
8 | #ifdef CPP_IOIPSL |
---|
9 | USE IOIPSL |
---|
10 | #else |
---|
11 | ! if not using IOIPSL, we still need to use (a local version of) getin_dump |
---|
12 | USE ioipsl_getincom |
---|
13 | #endif |
---|
14 | #include "iniprint.h" |
---|
15 | |
---|
16 | C |
---|
17 | C Stops the simulation cleanly, closing files and printing various |
---|
18 | C comments |
---|
19 | C |
---|
20 | C Input: modname = name of calling program |
---|
21 | C message = stuff to print |
---|
22 | C ierr = severity of situation ( = 0 normal ) |
---|
23 | |
---|
24 | character(len=*) modname |
---|
25 | integer ierr |
---|
26 | character(len=*) message |
---|
27 | |
---|
28 | ! write(lunout,*) 'in abort_gcm' |
---|
29 | write(6,*) 'in abort_gcm' |
---|
30 | #ifdef CPP_IOIPSL |
---|
31 | call histclo |
---|
32 | call restclo |
---|
33 | #endif |
---|
34 | call getin_dump |
---|
35 | c call histclo(2) |
---|
36 | c call histclo(3) |
---|
37 | c call histclo(4) |
---|
38 | c call histclo(5) |
---|
39 | c write(lunout,*) 'Stopping in ', modname |
---|
40 | c write(lunout,*) 'Reason = ',message |
---|
41 | c if (ierr .eq. 0) then |
---|
42 | c write(lunout,*) 'Everything is cool' |
---|
43 | c else |
---|
44 | c write(lunout,*) 'Houston, we have a problem ', ierr |
---|
45 | c endif |
---|
46 | write(6,*) 'Stopping in ', modname |
---|
47 | write(6,*) 'Reason = ',message |
---|
48 | if (ierr .eq. 0) then |
---|
49 | write(6,*) 'Everything is cool' |
---|
50 | else |
---|
51 | write(6,*) 'Houston, we have a problem ', ierr |
---|
52 | endif |
---|
53 | STOP |
---|
54 | END |
---|