|
Last change
on this file since 3673 was
3351,
checked in by jbclement, 19 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
|
| Rev | Line | |
|---|
| [3076] | 1 | MODULE abort_pem_mod |
|---|
| 2 | |
|---|
| 3 | implicit none |
|---|
| 4 | |
|---|
| 5 | !======================================================================= |
|---|
| 6 | contains |
|---|
| 7 | !======================================================================= |
|---|
| 8 | |
|---|
| 9 | SUBROUTINE abort_pem(modname,message,ierr) |
|---|
| 10 | |
|---|
| [2888] | 11 | #ifdef CPP_IOIPSL |
|---|
| [3076] | 12 | use IOIPSL |
|---|
| [2888] | 13 | #else |
|---|
| [3076] | 14 | ! if not using IOIPSL, we still need to use (a local version of) getin_dump |
|---|
| 15 | use ioipsl_getincom |
|---|
| [2888] | 16 | #endif |
|---|
| 17 | |
|---|
| 18 | #ifdef CPP_XIOS |
|---|
| [3076] | 19 | use wxios ! ug Pour les sorties XIOS |
|---|
| [2888] | 20 | #endif |
|---|
| 21 | |
|---|
| [3076] | 22 | implicit none |
|---|
| 23 | |
|---|
| [2888] | 24 | #include "iniprint.h" |
|---|
| 25 | |
|---|
| [3076] | 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) |
|---|
| 30 | character(len = *), intent(in) :: modname |
|---|
| 31 | integer, intent(in) :: ierr |
|---|
| 32 | character(len = *), intent(in) :: message |
|---|
| [2888] | 33 | |
|---|
| [3076] | 34 | !----- Code |
|---|
| 35 | write(lunout,*) 'in abort_pem' |
|---|
| [2888] | 36 | |
|---|
| 37 | #ifdef CPP_XIOS |
|---|
| [3076] | 38 | CALL wxios_close() ! Fermeture propre de XIOS |
|---|
| [2888] | 39 | #endif |
|---|
| 40 | |
|---|
| 41 | #ifdef CPP_IOIPSL |
|---|
| [3076] | 42 | call histclo |
|---|
| 43 | call restclo |
|---|
| [2888] | 44 | #endif |
|---|
| [3076] | 45 | |
|---|
| 46 | call getin_dump |
|---|
| 47 | write(lunout,*) 'Stopping in ', modname |
|---|
| 48 | write(lunout,*) 'Reason = ', message |
|---|
| 49 | if (ierr == 0) then |
|---|
| [3351] | 50 | write(lunout,*) 'Everything is cool!' |
|---|
| [3076] | 51 | stop |
|---|
| 52 | else |
|---|
| [3351] | 53 | write(lunout,*) 'Houston, we have a problem, ierr =', ierr |
|---|
| [3076] | 54 | stop 1 |
|---|
| 55 | endif |
|---|
| 56 | |
|---|
| 57 | END SUBROUTINE abort_pem |
|---|
| 58 | |
|---|
| 59 | END MODULE abort_pem_mod |
|---|
Note: See
TracBrowser
for help on using the repository browser.