SURFEX v8.1
General documentation of Surfex
sfx_oasis_check.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_check (IO, U, KLUOUT)
7 !###################################################
8 !
9 !!**** *SFX_OASIS_CHECK* - Definitions for exchange of coupling fields
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 !! 10/2016 B. Decharme : bug surface/groundwater coupling
36 !-------------------------------------------------------------------------------
37 !
38 !* 0. DECLARATIONS
39 ! ------------
40 !
41 !
42 !
43 !
45 USE modd_surf_atm_n, ONLY : surf_atm_t
46 !
47 USE modn_sfx_oasis, ONLY : ccalving, lwater
49 !
50 USE modi_abor1_sfx
51 !
52 USE yomhook ,ONLY : lhook, dr_hook
53 USE parkind1 ,ONLY : jprb
54 !
55 IMPLICIT NONE
56 !
57 !* 0.1 Declarations of arguments
58 ! -------------------------
59 !
60 !
61 TYPE(isba_options_t), INTENT(INOUT) :: IO
62 TYPE(surf_atm_t), INTENT(INOUT) :: U
63 !
64 INTEGER, INTENT(IN) :: KLUOUT
65 !
66 !* 0.2 Declarations of local variables
67 ! -------------------------------
68 !
69 REAL(KIND=JPRB) :: ZHOOK_HANDLE
70 !
71 !-------------------------------------------------------------------------------
72 !
73 IF (lhook) CALL dr_hook('SFX_OASIS_CHECK',0,zhook_handle)
74 !
75 IF(lcpl_lake)THEN
76  IF(u%CWATER/='FLAKE ')THEN
77  WRITE(kluout,*)'!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
78  WRITE(kluout,*)'!!! SFX - LAKE coupling is asked !!!'
79  WRITE(kluout,*)'!!! but CWATER /= FLAKE !!!'
80  WRITE(kluout,*)'!!! !!!'
81  WRITE(kluout,*)'!!! Please check your namelist !!!'
82  WRITE(kluout,*)'!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
83  CALL abor1_sfx('SFX_OASIS_CHECK: SFX - LAKE coupling asked but CWATER /= FLAKE')
84  ENDIF
85 ENDIF
86 !
87 !
88 IF(lcpl_calving)THEN
89  IF(.NOT.io%LGLACIER)THEN
90  WRITE(kluout,*)'!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
91  WRITE(kluout,*)'Calving flux is asked by SFX - OASIS coupling '
92  WRITE(kluout,*)'CCALVING = '//trim(ccalving)//' in NAM_SFX_LAND_CPL'
93  WRITE(kluout,*)'but LGLACIER in not activated in NAM_ISBAn '
94  WRITE(kluout,*)'Please check your SURFEX namelist '
95  WRITE(kluout,*)'!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
96  CALL abor1_sfx('SFX_OASIS_CHECK: Calving flux is asked by SFX - OASIS coupling')
97  ENDIF
98 ENDIF
99 !
100 !
101 IF(lcpl_gw.AND.io%CISBA/='DIF')THEN
102  WRITE(kluout,*)'SFX_OASIS_CHECK: Water table depth / surface coupling requires ISBA-DF'
103  CALL abor1_sfx('SFX_OASIS_CHECK: ISBA-DF is required for SFX - Groundwater coupling')
104 ENDIF
105 IF(.NOT.lcpl_gw.AND.io%CISBA=='DIF'.AND.io%LWTD)THEN
106  WRITE(kluout,*)'!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
107  WRITE(kluout,*)'!!! A groundwater map is specified and LAND coupling !!!'
108  WRITE(kluout,*)'!!! is activated but not groundwater/surface coupling !!!'
109  WRITE(kluout,*)'!!! !!!'
110  WRITE(kluout,*)'!!! ARE YOU SURE : YOU DO NOT WANT THIS COUPLING ? !!!'
111  WRITE(kluout,*)'!!! !!!'
112  WRITE(kluout,*)'!!! Use NAM_SFX_LAND_CPL with CWTD and CFWTD !!!'
113  WRITE(kluout,*)'!!! if you want this coupling via OASIS !!!'
114  WRITE(kluout,*)'!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
115 ENDIF
116 !
117 !
118 IF(lwater.AND.(u%CWATER=='NONE '.OR.u%CWATER=='FLAKE'))THEN
119  WRITE(kluout,*)'LWATER = ',lwater,' CWATER = ',u%CWATER
120  WRITE(kluout,*)'! Inland water should not be added to sea mask in case CWATER is NONE or FLAKE !!!'
121  WRITE(kluout,*)'! Change CWATER or put LWATER=.FALSE. in NAM_SFX_SEA_CPL !!!'
122  CALL abor1_sfx('SFX_OASIS_READ_NAM: LWATER and CWATER not consistent')
123 ENDIF
124 !
125 IF (lhook) CALL dr_hook('SFX_OASIS_CHECK',1,zhook_handle)
126 !
127 !-------------------------------------------------------------------------------
128 !
129 END SUBROUTINE sfx_oasis_check
static const char * trim(const char *name, int *n)
Definition: drhook.c:2383
subroutine sfx_oasis_check(IO, U, KLUOUT)
subroutine abor1_sfx(YTEXT)
Definition: abor1_sfx.F90:7
integer, parameter jprb
Definition: parkind1.F90:32
character(len=8) ccalving
logical lhook
Definition: yomhook.F90:15