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

Last change on this file since 3296 was 3076, checked in by jbclement, 14 months ago

PEM:
Big cleaning/improvements of the PEM:

  • Conversion of "abort_pem.F" and "soil_settings_PEM.F" into Fortran 90;
  • Transformation of every PEM subroutines into module;
  • Rewriting of many subroutines with modern Fortran syntax;
  • Correction of a bug in "pem.F90" when calling 'recomp_tend_co2_slope'. The arguments were given in disorder and emissivity was missing;
  • Update of "launch_pem.sh" in deftank.

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
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.