source: LMDZ6/branches/Amaury_dev/libf/phy_common/abort_physic.F90 @ 5104

Last change on this file since 5104 was 5103, checked in by abarral, 4 months ago

Handle CPP_INLANDSIS in lmdz_cppkeys_wrapper.F90
Remove obsolete key wrgrads_thermcell, _ADV_HALO, _ADV_HALLO, isminmax
Remove redundant uses of CPPKEY_INCA (thanks acozic)
Remove obsolete misc/write_field.F90
Remove unused ioipsl_* wrappers
Remove calls to WriteField_u with wrong signature
Convert .F -> .[fF]90
(lint) uppercase fortran operators
[note: 1d and iso still broken - working on it]

File size: 1.4 KB
Line 
1! $Id: $
2      SUBROUTINE abort_physic(modname, message, ierr)
3     
4      USE IOIPSL
5      USE mod_phys_lmdz_para
6      USE print_control_mod, ONLY: lunout
7      IMPLICIT NONE
8
9! Stops the simulation cleanly, closing files and printing various
10! comments
11
12!  Input: modname = name of calling program
13!         message = stuff to print
14!         ierr    = severity of situation ( = 0 normal )
15
16      character(len=*), intent(in):: modname
17      integer ierr, ierror_mpi
18      character(len=*), intent(in):: message
19
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
26      endif
27!$OMP END MASTER
28
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
Note: See TracBrowser for help on using the repository browser.