Ignore:
Timestamp:
Jul 25, 2024, 5:47:25 PM (8 weeks ago)
Author:
abarral
Message:

Correct bug in vlspltqs_loc.f90 from r2270 where we call SSUM with incorrect arguments.
Merge the three different versions of abort_gcm into one
Fix seq, para 3D compilation broken from r5107 onwards
(lint) usual + Remove uneeded fixed-form continuations

File:
1 moved

Legend:

Unmodified
Added
Removed
  • LMDZ6/branches/Amaury_dev/libf/misc/lmdz_NOMODULE_abort_gcm.f90

    r5127 r5128  
    1 
    21! $Id: abort_gcm.F 1747 2013-04-23 14:06:30Z lguez $
    32
    4 !
    5 !
    6 SUBROUTINE abort_gcm(modname, message, ierr)
     3! /!\ We can't put this in a module right away with FCM1, as this creates a circular dependency e.g. with wxios through lmdz_iniprint
    74
    8   USE IOIPSL
    9   USE parallel_lmdz
    10   USE lmdz_iniprint, ONLY: lunout, prt_level
    11 
    12   !
     5SUBROUTINE abort_gcm(modname, ierr, message)
     6  !END
    137  ! Stops the simulation cleanly, closing files and printing various
    148  ! comments
     
    1812  !     ierr    = severity of situation ( = 0 normal )
    1913
    20   CHARACTER(LEN=*), INTENT(IN):: modname
    21   INTEGER :: ierr, ierror_mpi
    22   CHARACTER(LEN=*), INTENT(IN):: message
     14  USE IOIPSL, ONLY: histclo, restclo, getin_dump
     15  USE lmdz_wxios, ONLY: using_xios, wxios_close
     16  USE lmdz_phys_mpi_data, ONLY: mpi_rank
     17  USE lmdz_mpi, ONLY: using_mpi
     18  USE mod_const_mpi, ONLY: comm_lmdz
     19  USE lmdz_iniprint, ONLY: lunout, prt_level
     20  IMPLICIT NONE
    2321
    24   WRITE(lunout,*) 'in abort_gcm'
    25 !$OMP MASTER
     22  CHARACTER(LEN = *), INTENT(IN) :: modname
     23  INTEGER, INTENT(IN) :: ierr
     24  CHARACTER(LEN = *), INTENT(IN) :: message
     25
     26  INTEGER :: ierror_mpi
     27
     28  WRITE(lunout, *) 'in abort_gcm'
     29
     30  IF (using_xios) THEN !Fermeture propre de XIOS
     31    CALL wxios_close()
     32  ENDIF
     33
     34  !$OMP MASTER
    2635  CALL histclo
    2736  CALL restclo
    28   IF (MPI_rank == 0) THEN
    29      CALL getin_dump
     37  IF (mpi_rank == 0) THEN
     38    CALL getin_dump
    3039  ENDIF
    31 !$OMP END MASTER
    32   ! CALL histclo(2)
    33   ! CALL histclo(3)
    34   ! CALL histclo(4)
    35   ! CALL histclo(5)
    36   WRITE(lunout,*) 'Stopping in ', modname
    37   WRITE(lunout,*) 'Reason = ',message
     40  !$OMP END MASTER
     41  WRITE(lunout, *) 'Stopping in ', modname
     42  WRITE(lunout, *) 'Reason = ', message
    3843  IF (ierr == 0) THEN
    39     WRITE(lunout,*) 'Everything is cool'
    40   else
    41     WRITE(lunout,*) 'Houston, we have a problem, ierr = ', ierr
     44    WRITE(lunout, *) 'Everything is cool'
     45  ELSE
     46    WRITE(lunout, *) 'Houston, we have a problem, ierr = ', ierr
    4247
    4348    IF (using_mpi) THEN
    44 !$OMP CRITICAL (MPI_ABORT_GCM)
    45       CALL MPI_ABORT(COMM_LMDZ, 1, ierror_mpi)
    46 !$OMP END CRITICAL (MPI_ABORT_GCM)
    47     else
    48      stop 1
    49     endif
    50 
     49      !$OMP CRITICAL (MPI_ABORT_GCM)
     50      CALL MPI_ABORT(comm_lmdz, 1, ierror_mpi)
     51      !$OMP END CRITICAL (MPI_ABORT_GCM)
     52    ELSE
     53      STOP 1
     54    END IF
    5155  ENDIF
    5256END SUBROUTINE abort_gcm
Note: See TracChangeset for help on using the changeset viewer.