SURFEX v8.1
General documentation of Surfex
sfx_oasis_end.F90
Go to the documentation of this file.
1 !SFX_LIC Copyright 1994-2014 CNRS, Meteo-France and Universite Paul Sabatier
2 !SFX_LIC This is part of the SURFEX software governed by the CeCILL-C licence
3 !SFX_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt
4 !SFX_LIC for details. version 1.
5 !#########
6 SUBROUTINE sfx_oasis_end
7 !########################
8 !
9 !!**** *SFX_OASIS_END* - end coupling SFX - OASIS and XIOS
10 !!
11 !! PURPOSE
12 !! -------
13 !!
14 !!** METHOD
15 !! ------
16 !!
17 !! EXTERNAL
18 !! --------
19 !!
20 !!
21 !! IMPLICIT ARGUMENTS
22 !! ------------------
23 !!
24 !! REFERENCE
25 !! ---------
26 !!
27 !!
28 !! AUTHOR
29 !! ------
30 !! B. Decharme *Meteo France*
31 !!
32 !! MODIFICATIONS
33 !! -------------
34 !! Original 10/2013
35 !! S.Sénési 08/2015 : add XIOS_FINALIZE
36 !-------------------------------------------------------------------------------
37 !
38 !* 0. DECLARATIONS
39 ! ------------
40 !
41 #ifdef CPLOASIS
42 USE mod_oasis
43 USE modd_sfx_oasis, ONLY : loasis
44 #endif
45 !
46 #ifdef WXIOS
47 USE modd_xios , ONLY : lxios
48 USE xios, ONLY : xios_finalize
49 #endif
50 !
51 USE modi_abor1_sfx
52 !
53 IMPLICIT NONE
54 !
55 !* 0.1 Declarations of arguments
56 ! -------------------------
57 !
58 !
59 !* 0.2 Declarations of local variables
60 ! -------------------------------
61 !
62 INTEGER :: IERR ! Error info
63 !
64 !-------------------------------------------------------------------------------
65 !
66 #ifdef WXIOS
67 IF (lxios) THEN
68 ! XIOS will finalize Oasis if needed
69  CALL xios_finalize()
70 ENDIF
71 #endif
72 !
73 #ifdef CPLOASIS
74 IF(loasis) THEN
75 #ifdef WXIOS
76  IF (.NOT. lxios)THEN !Same test than in offline.F90 because use for Arpege-Aladin-Arome
77 #endif
78  CALL oasis_terminate(ierr)
79  IF (ierr/=oasis_ok) THEN
80  WRITE(*,'(A)' )'Error OASIS terminate'
81  WRITE(*,'(A,I4)')'Return code from oasis_terminate : ',ierr
82  CALL abor1_sfx("SFX_OASIS_END: Error OASIS terminate")
83  ENDIF
84 #ifdef WXIOS
85  ENDIF
86 #endif
87 ENDIF
88 #endif
89 !
90 !-------------------------------------------------------------------------------
91 !
92 END SUBROUTINE sfx_oasis_end
logical lxios
Definition: modd_xios.F90:41
subroutine abor1_sfx(YTEXT)
Definition: abor1_sfx.F90:7
subroutine sfx_oasis_end