Changeset 5111 for LMDZ6/branches/Amaury_dev/libf/phy_common
- Timestamp:
- Jul 24, 2024, 12:17:33 PM (6 months ago)
- Location:
- LMDZ6/branches/Amaury_dev/libf/phy_common
- Files:
-
- 1 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
LMDZ6/branches/Amaury_dev/libf/phy_common/lmdz_abort_physic.F90
r5110 r5111 1 ! $Id: $ 2 SUBROUTINE abort_physic(modname, message, ierr) 3 4 USE IOIPSL 5 USE lmdz_phys_para 6 USE print_control_mod, ONLY: lunout 7 IMPLICIT NONE 1 MODULE lmdz_abort_physic 2 IMPLICIT NONE; PRIVATE 3 PUBLIC abort_physic 4 CONTAINS 8 5 9 ! Stops the simulation cleanly, closing files and printing various 10 ! comments 6 SUBROUTINE abort_physic(modname, message, ierr) 11 7 12 ! Input: modname = name of calling program 13 ! message = stuff to print 14 ! ierr = severity of situation ( = 0 normal ) 8 USE IOIPSL 9 USE lmdz_phys_para 10 USE print_control_mod, ONLY: lunout 11 IMPLICIT NONE 15 12 16 character(len=*), intent(in):: modname 17 integer ierr, ierror_mpi 18 character(len=*), intent(in):: message 13 ! Stops the simulation cleanly, closing files and printing various 14 ! comments 19 15 20 write(lunout,*) 'in abort_physic' 21 !$OMP MASTER 22 CALL histclo 23 CALL restclo 24 if (mpi_rank .eq. 0) then 25 CALL getin_dump 16 ! Input: modname = name of calling program 17 ! message = stuff to print 18 ! ierr = severity of situation ( = 0 normal ) 19 20 character(len = *), intent(in) :: modname 21 integer ierr, ierror_mpi 22 character(len = *), intent(in) :: message 23 24 write(lunout, *) 'in abort_physic' 25 !$OMP MASTER 26 CALL histclo 27 CALL restclo 28 if (mpi_rank == 0) then 29 CALL getin_dump 30 endif 31 !$OMP END MASTER 32 33 write(lunout, *) 'Stopping in ', modname 34 write(lunout, *) 'Reason = ', message 35 if (ierr == 0) then 36 write(lunout, *) 'Everything is cool' 37 if (using_mpi) then 38 !$OMP CRITICAL (MPI_ABORT_PHYSIC) 39 CALL MPI_ABORT(COMM_LMDZ_PHY, 0, ierror_mpi) 40 !$OMP END CRITICAL (MPI_ABORT_PHYSIC) 41 else 42 stop 0 26 43 endif 27 !$OMP END MASTER 44 else 45 write(lunout, *) 'Houston, we have a problem, ierr = ', ierr 46 if (using_mpi) then 47 !$OMP CRITICAL (MPI_ABORT_PHYSIC) 48 CALL MPI_ABORT(COMM_LMDZ_PHY, 1, ierror_mpi) 49 !$OMP END CRITICAL (MPI_ABORT_PHYSIC) 50 else 51 stop 1 52 endif 53 endif 54 END 28 55 29 write(lunout,*) 'Stopping in ', modname 30 write(lunout,*) 'Reason = ',message 31 if (ierr == 0) then 32 write(lunout,*) 'Everything is cool' 33 if (using_mpi) then 34 !$OMP CRITICAL (MPI_ABORT_PHYSIC) 35 CALL MPI_ABORT(COMM_LMDZ_PHY, 0, ierror_mpi) 36 !$OMP END CRITICAL (MPI_ABORT_PHYSIC) 37 else 38 stop 0 39 endif 40 else 41 write(lunout,*) 'Houston, we have a problem, ierr = ', ierr 42 if (using_mpi) then 43 !$OMP CRITICAL (MPI_ABORT_PHYSIC) 44 CALL MPI_ABORT(COMM_LMDZ_PHY, 1, ierror_mpi) 45 !$OMP END CRITICAL (MPI_ABORT_PHYSIC) 46 else 47 stop 1 48 endif 49 endif 50 END 56 END MODULE lmdz_abort_physic -
LMDZ6/branches/Amaury_dev/libf/phy_common/lmdz_phys_omp_data.F90
r5110 r5111 26 26 USE dimphy 27 27 USE lmdz_phys_mpi_data, ONLY: is_north_pole_dyn, is_south_pole_dyn 28 USE lmdz_abort_physic, ONLY: abort_physic 28 29 IMPLICIT NONE 29 30 INTEGER, INTENT(in) :: klon_mpi
Note: See TracChangeset
for help on using the changeset viewer.