source: trunk/LMDZ.COMMON/libf/dyn3dpar/abort_gcm.F @ 3595

Last change on this file since 3595 was 3350, checked in by jbclement, 8 months ago

Mars PCM:

  • Correction for the script "launch_orb_1Dchained.sh" in the deftank.
  • Small cleanings related to error detection.

JBC

File size: 1.3 KB
RevLine 
[1]1!
[1300]2! $Id: abort_gcm.F 1907 2013-11-26 13:10:46Z lguez $
[1]3!
4c
5c
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
[1019]14      USE parallel_lmdz
[1300]15
16
17
18
[1]19#include "iniprint.h"
20 
21C
22C Stops the simulation cleanly, closing files and printing various
23C comments
24C
25C  Input: modname = name of calling program
26C         message = stuff to print
27C         ierr    = severity of situation ( = 0 normal )
28
[1391]29      character(len=*), intent(in):: modname
[979]30      integer ierr, ierror_mpi
[1391]31      character(len=*), intent(in):: message
[1]32
33      write(lunout,*) 'in abort_gcm'
34#ifdef CPP_IOIPSL
35c$OMP MASTER
36      call histclo
37      call restclo
38      if (MPI_rank .eq. 0) then
39         call getin_dump
40      endif
41c$OMP END MASTER
42#endif
[1300]43
44
45
[1]46c     call histclo(2)
47c     call histclo(3)
48c     call histclo(4)
49c     call histclo(5)
50      write(lunout,*) 'Stopping in ', modname
51      write(lunout,*) 'Reason = ',message
52      if (ierr .eq. 0) then
[3350]53        write(lunout,*) 'Everything is cool!'
[1]54      else
[3350]55        write(lunout,*) 'Houston, we have a problem, ierr =', ierr
[979]56#ifdef CPP_MPI
57C$OMP CRITICAL (MPI_ABORT_GCM)
58        call MPI_ABORT(COMM_LMDZ, 1, ierror_mpi)
59C$OMP END CRITICAL (MPI_ABORT_GCM)
60#else
[1]61        stop 1
[979]62#endif         
[1]63      endif
64      END
[1300]65
Note: See TracBrowser for help on using the repository browser.