Last change
on this file since 1795 was
1748,
checked in by Ehouarn Millour, 11 years ago
|
OMP CRITICAL name must be between brackets (ifort specific?) or else compilation fails in OpenMP mode. Moreover it is recommended to use different names for different OMP CRITICAL sections.
EM
|
-
Property svn:eol-style set to
native
-
Property svn:keywords set to
Author Date Id Revision
|
File size:
1.3 KB
|
Rev | Line | |
---|
[630] | 1 | ! |
---|
[1279] | 2 | ! $Id: abort_gcm.F 1748 2013-04-24 14:18:40Z emillour $ |
---|
[630] | 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 |
---|
[630] | 13 | #endif |
---|
[1279] | 14 | USE parallel |
---|
[630] | 15 | #include "iniprint.h" |
---|
| 16 | |
---|
| 17 | C |
---|
| 18 | C Stops the simulation cleanly, closing files and printing various |
---|
| 19 | C comments |
---|
| 20 | C |
---|
| 21 | C Input: modname = name of calling program |
---|
| 22 | C message = stuff to print |
---|
| 23 | C ierr = severity of situation ( = 0 normal ) |
---|
| 24 | |
---|
[1425] | 25 | character(len=*) modname |
---|
[1747] | 26 | integer ierr, ierror_mpi |
---|
[1425] | 27 | character(len=*) message |
---|
[630] | 28 | |
---|
| 29 | write(lunout,*) 'in abort_gcm' |
---|
| 30 | #ifdef CPP_IOIPSL |
---|
[985] | 31 | c$OMP MASTER |
---|
[630] | 32 | call histclo |
---|
| 33 | call restclo |
---|
[1279] | 34 | if (MPI_rank .eq. 0) then |
---|
| 35 | call getin_dump |
---|
| 36 | endif |
---|
[985] | 37 | c$OMP END MASTER |
---|
[630] | 38 | #endif |
---|
| 39 | c call histclo(2) |
---|
| 40 | c call histclo(3) |
---|
| 41 | c call histclo(4) |
---|
| 42 | c call histclo(5) |
---|
| 43 | write(lunout,*) 'Stopping in ', modname |
---|
| 44 | write(lunout,*) 'Reason = ',message |
---|
| 45 | if (ierr .eq. 0) then |
---|
| 46 | write(lunout,*) 'Everything is cool' |
---|
| 47 | else |
---|
| 48 | write(lunout,*) 'Houston, we have a problem ', ierr |
---|
[1747] | 49 | #ifdef CPP_MPI |
---|
[1748] | 50 | C$OMP CRITICAL (MPI_ABORT_GCM) |
---|
[1747] | 51 | call MPI_ABORT(COMM_LMDZ, 1, ierror_mpi) |
---|
[1748] | 52 | C$OMP END CRITICAL (MPI_ABORT_GCM) |
---|
[1747] | 53 | #else |
---|
[1425] | 54 | stop 1 |
---|
[1747] | 55 | #endif |
---|
[630] | 56 | endif |
---|
| 57 | END |
---|
Note: See
TracBrowser
for help on using the repository browser.