source: LMDZ6/trunk/libf/dyn3dmem/abort_gcm.F @ 5065

Last change on this file since 5065 was 4600, checked in by yann meurdesoif, 17 months ago

Suppress CPP_MPI key usage in source code. MPI wrappers is used to supress missing symbol if the mpi library is not linked

YM

  • Property copyright set to
    Name of program: LMDZ
    Creation date: 1984
    Version: LMDZ5
    License: CeCILL version 2
    Holder: Laboratoire de m\'et\'eorologie dynamique, CNRS, UMR 8539
    See the license file in the root directory
File size: 1.4 KB
RevLine 
[1632]1!
[1748]2! $Id: abort_gcm.F 1747 2013-04-23 14:06:30Z lguez $
[1632]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
[1823]14      USE parallel_lmdz
[4593]15      INCLUDE "iniprint.h"
[1632]16 
17C
18C Stops the simulation cleanly, closing files and printing various
19C comments
20C
21C  Input: modname = name of calling program
22C         message = stuff to print
23C         ierr    = severity of situation ( = 0 normal )
24
[2100]25      character(len=*), intent(in):: modname
[1747]26      integer ierr, ierror_mpi
[2100]27      character(len=*), intent(in):: message
[1632]28
29      write(lunout,*) 'in abort_gcm'
30#ifdef CPP_IOIPSL
31c$OMP MASTER
32      call histclo
33      call restclo
34      if (MPI_rank .eq. 0) then
35         call getin_dump
36      endif
37c$OMP END MASTER
38#endif
39c     call histclo(2)
40c     call histclo(3)
41c     call histclo(4)
42c     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
[2100]48        write(lunout,*) 'Houston, we have a problem, ierr = ', ierr
[4600]49
50        if (using_mpi) THEN
[1748]51C$OMP CRITICAL (MPI_ABORT_GCM)
[4600]52          call MPI_ABORT(COMM_LMDZ, 1, ierror_mpi)
[1748]53C$OMP END CRITICAL (MPI_ABORT_GCM)
[4600]54        else
55         stop 1
56        endif         
57     
[1632]58      endif
59      END
Note: See TracBrowser for help on using the repository browser.