[224] | 1 | ! |
---|
| 2 | ! $Id: abort_gcm.F 1907 2013-11-26 13:10:46Z lguez $ |
---|
| 3 | ! |
---|
| 4 | c |
---|
| 5 | c |
---|
| 6 | SUBROUTINE abort_gcm(modname, message, ierr) |
---|
| 7 | |
---|
| 8 | |
---|
| 9 | |
---|
| 10 | |
---|
| 11 | ! if not using IOIPSL, we still need to use (a local version of) getin_dump |
---|
| 12 | USE ioipsl_getincom |
---|
| 13 | |
---|
| 14 | USE parallel_lmdz |
---|
| 15 | |
---|
| 16 | |
---|
| 17 | |
---|
| 18 | |
---|
| 19 | ! |
---|
| 20 | ! $Header$ |
---|
| 21 | ! |
---|
| 22 | ! |
---|
| 23 | ! gestion des impressions de sorties et de débogage |
---|
| 24 | ! lunout: unité du fichier dans lequel se font les sorties |
---|
| 25 | ! (par defaut 6, la sortie standard) |
---|
| 26 | ! prt_level: niveau d'impression souhaité (0 = minimum) |
---|
| 27 | ! |
---|
| 28 | INTEGER lunout, prt_level |
---|
| 29 | COMMON /comprint/ lunout, prt_level |
---|
| 30 | |
---|
| 31 | C |
---|
| 32 | C Stops the simulation cleanly, closing files and printing various |
---|
| 33 | C comments |
---|
| 34 | C |
---|
| 35 | C Input: modname = name of calling program |
---|
| 36 | C message = stuff to print |
---|
| 37 | C ierr = severity of situation ( = 0 normal ) |
---|
| 38 | |
---|
| 39 | character(len=*) modname |
---|
| 40 | integer ierr, ierror_mpi |
---|
| 41 | character(len=*) message |
---|
| 42 | |
---|
| 43 | write(lunout,*) 'in abort_gcm' |
---|
| 44 | |
---|
| 45 | |
---|
| 46 | |
---|
| 47 | c call histclo(2) |
---|
| 48 | c call histclo(3) |
---|
| 49 | c call histclo(4) |
---|
| 50 | c call histclo(5) |
---|
| 51 | write(lunout,*) 'Stopping in ', modname |
---|
| 52 | write(lunout,*) 'Reason = ',message |
---|
| 53 | if (ierr .eq. 0) then |
---|
| 54 | write(lunout,*) 'Everything is cool' |
---|
| 55 | else |
---|
| 56 | write(lunout,*) 'Houston, we have a problem ', ierr |
---|
| 57 | C$OMP CRITICAL (MPI_ABORT_GCM) |
---|
| 58 | call MPI_ABORT(COMM_LMDZ, 1, ierror_mpi) |
---|
| 59 | C$OMP END CRITICAL (MPI_ABORT_GCM) |
---|
| 60 | |
---|
| 61 | |
---|
| 62 | |
---|
| 63 | endif |
---|
| 64 | END |
---|
| 65 | |
---|