source: LMDZ6/branches/contrails/libf/dyn3d_common/abort_gcm_NOMODULE.f90 @ 5428

Last change on this file since 5428 was 5327, checked in by abarral, 5 weeks ago

Remove (likely) obsolete and wrong code in abort_gcm_NOMODULE.f90

  • 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
Line 
1! /!\ We can't put this in a module right away with FCM1, as this creates a circular dependency e.g. with wxios through iniprint_mod
2
3SUBROUTINE abort_gcm(modname, message, ierr)
4  ! Stops the simulation cleanly, closing files and printing various
5  ! comments
6
7  !  Input: modname = name of calling program
8  !     message = stuff to print
9  !     ierr    = severity of situation ( = 0 normal )
10
11  USE IOIPSL, ONLY: histclo, restclo, getin_dump
12  USE wxios_mod, ONLY: using_xios, wxios_close
13  USE mod_phys_lmdz_mpi_data, ONLY: mpi_rank
14  USE lmdz_mpi, ONLY: using_mpi
15  USE mod_const_mpi, ONLY: comm_lmdz
16  USE iniprint_mod_h, ONLY: lunout, prt_level
17  IMPLICIT NONE
18
19  CHARACTER(LEN = *), INTENT(IN) :: modname
20  INTEGER, INTENT(IN) :: ierr
21  CHARACTER(LEN = *), INTENT(IN) :: message
22
23  INTEGER :: ierror_mpi
24
25  WRITE(lunout, *) 'in abort_gcm'
26
27  !$OMP MASTER
28  CALL histclo
29  CALL restclo
30  IF (mpi_rank == 0) THEN
31    CALL getin_dump
32  ENDIF
33  !$OMP END MASTER
34  WRITE(lunout, *) 'Stopping in ', modname
35  WRITE(lunout, *) 'Reason = ', message
36  IF (ierr == 0) THEN
37    WRITE(lunout, *) 'Everything is cool'
38    IF (.NOT. using_mpi) THEN
39      STOP
40    END IF
41  ELSE
42    WRITE(lunout, *) 'Houston, we have a problem, ierr = ', ierr
43
44    IF (using_mpi) THEN
45      !$OMP CRITICAL (MPI_ABORT_GCM)
46      CALL MPI_ABORT(comm_lmdz, 1, ierror_mpi)
47      !$OMP END CRITICAL (MPI_ABORT_GCM)
48    ELSE
49      STOP 1
50    END IF
51  END IF
52END SUBROUTINE abort_gcm
Note: See TracBrowser for help on using the repository browser.