source: trunk/LMDZ.COMMON/libf/evolution/abort_pem_mod.F90 @ 3532

Last change on this file since 3532 was 3351, checked in by jbclement, 7 months ago

PEM:

  • Updates for several scripts in the deftank.
  • Addition of the bash script "clean.sh" to clean a folder after a PEM simulation.

JBC

File size: 1.3 KB
Line 
1MODULE abort_pem_mod
2
3implicit none
4
5!=======================================================================
6contains
7!=======================================================================
8
9SUBROUTINE abort_pem(modname,message,ierr)
10
11#ifdef CPP_IOIPSL
12    use IOIPSL
13#else
14    ! if not using IOIPSL, we still need to use (a local version of) getin_dump
15    use ioipsl_getincom
16#endif
17
18#ifdef CPP_XIOS
19    use wxios ! ug Pour les sorties XIOS
20#endif
21
22implicit none
23
24#include "iniprint.h"
25
26! Stop the simulation cleanly, closing files and printing various comments
27! Input: modname = name of calling program
28!        message = stuff to print
29!        ierr    = severity of situation (= 0 normal)
30character(len = *), intent(in) :: modname
31integer,            intent(in) :: ierr
32character(len = *), intent(in) :: message
33
34!----- Code
35write(lunout,*) 'in abort_pem'
36
37#ifdef CPP_XIOS
38    CALL wxios_close() ! Fermeture propre de XIOS
39#endif
40
41#ifdef CPP_IOIPSL
42    call histclo
43    call restclo
44#endif
45
46call getin_dump
47write(lunout,*) 'Stopping in ', modname
48write(lunout,*) 'Reason = ', message
49if (ierr == 0) then
50    write(lunout,*) 'Everything is cool!'
51    stop
52else
53    write(lunout,*) 'Houston, we have a problem, ierr =', ierr
54    stop 1
55endif
56
57END SUBROUTINE abort_pem
58
59END MODULE abort_pem_mod
Note: See TracBrowser for help on using the repository browser.