Changeset 5128 for LMDZ6/branches/Amaury_dev/libf/misc
- Timestamp:
- Jul 25, 2024, 5:47:25 PM (8 weeks ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
LMDZ6/branches/Amaury_dev/libf/misc/lmdz_NOMODULE_abort_gcm.f90
r5127 r5128 1 2 1 ! $Id: abort_gcm.F 1747 2013-04-23 14:06:30Z lguez $ 3 2 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 7 4 8 USE IOIPSL 9 USE parallel_lmdz 10 USE lmdz_iniprint, ONLY: lunout, prt_level 11 12 ! 5 SUBROUTINE abort_gcm(modname, ierr, message) 6 !END 13 7 ! Stops the simulation cleanly, closing files and printing various 14 8 ! comments … … 18 12 ! ierr = severity of situation ( = 0 normal ) 19 13 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 23 21 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 26 35 CALL histclo 27 36 CALL restclo 28 IF ( MPI_rank == 0) THEN29 37 IF (mpi_rank == 0) THEN 38 CALL getin_dump 30 39 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 38 43 IF (ierr == 0) THEN 39 WRITE(lunout, *) 'Everything is cool'40 else41 WRITE(lunout, *) 'Houston, we have a problem, ierr = ', ierr44 WRITE(lunout, *) 'Everything is cool' 45 ELSE 46 WRITE(lunout, *) 'Houston, we have a problem, ierr = ', ierr 42 47 43 48 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 51 55 ENDIF 52 56 END SUBROUTINE abort_gcm
Note: See TracChangeset
for help on using the changeset viewer.