[524] | 1 | ! |
---|
[1279] | 2 | ! $Id: abort_gcm.F 1279 2009-12-10 09:02:56Z fairhead $ |
---|
[524] | 3 | ! |
---|
| 4 | c |
---|
| 5 | c |
---|
| 6 | SUBROUTINE abort_gcm(modname, message, ierr) |
---|
| 7 | |
---|
| 8 | #ifdef CPP_IOIPSL |
---|
| 9 | USE IOIPSL |
---|
[1279] | 10 | #else |
---|
| 11 | ! if not using IOIPSL, we still need to use (a local version of) getin_dump |
---|
| 12 | USE ioipsl_getincom |
---|
[524] | 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 | |
---|
[1107] | 24 | character(len=*) modname |
---|
[524] | 25 | integer ierr |
---|
[1107] | 26 | character(len=*) message |
---|
[524] | 27 | |
---|
[1004] | 28 | ! write(lunout,*) 'in abort_gcm' |
---|
| 29 | write(6,*) 'in abort_gcm' |
---|
[524] | 30 | #ifdef CPP_IOIPSL |
---|
| 31 | call histclo |
---|
| 32 | call restclo |
---|
| 33 | #endif |
---|
[1147] | 34 | call getin_dump |
---|
[524] | 35 | c call histclo(2) |
---|
| 36 | c call histclo(3) |
---|
| 37 | c call histclo(4) |
---|
| 38 | c call histclo(5) |
---|
[1004] | 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 |
---|
[524] | 48 | if (ierr .eq. 0) then |
---|
[1004] | 49 | write(6,*) 'Everything is cool' |
---|
[524] | 50 | else |
---|
[1004] | 51 | write(6,*) 'Houston, we have a problem ', ierr |
---|
[524] | 52 | endif |
---|
| 53 | STOP |
---|
| 54 | END |
---|