SURFEX v8.1
General documentation of Surfex
get_sfxcpln.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 get_sfxcpl_n (IM, S, U, W, &
7  HPROGRAM,KI,PRUI,PWIND,PFWSU,PFWSV,PSNET, &
8  PHEAT,PEVAP,PRAIN,PSNOW,PICEFLUX,PFWSM, &
9  PHEAT_ICE,PEVAP_ICE,PSNET_ICE)
10 ! ###################################################################
11 !
12 !!**** *GETSFXCPL_n* - routine to get some variables from surfex into
13 ! ocean and/or a river routing model when the coupler
14 ! is not in SURFEX but in ARPEGE.
15 !
16 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
17 ! This routine will be suppress soon.
18 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
19 !
20 !! PURPOSE
21 !! -------
22 !!
23 !!** METHOD
24 !! ------
25 !!
26 !! EXTERNAL
27 !! --------
28 !!
29 !!
30 !! IMPLICIT ARGUMENTS
31 !! ------------------
32 !!
33 !! REFERENCE
34 !! ---------
35 !!
36 !!
37 !! AUTHOR
38 !! ------
39 !! B. Decharme *Meteo France*
40 !!
41 !! MODIFICATIONS
42 !! -------------
43 !! Original 08/2009
44 !! 10/2016 B. Decharme : bug surface/groundwater coupling
45 !-------------------------------------------------------------------------------
46 !
47 !* 0. DECLARATIONS
48 ! ------------
49 !
50 !
51 !
52 !
53 USE modd_surfex_n, ONLY : isba_model_t
54 USE modd_seaflux_n, ONLY : seaflux_t
55 USE modd_surf_atm_n, ONLY : surf_atm_t
56 USE modd_watflux_n, ONLY : watflux_t
57 !
58 USE modd_surf_par, ONLY : xundef
59 !
60 USE modn_sfx_oasis, ONLY : lwater
63 !
64 USE modi_get_sfx_sea
65 USE modi_get_sfx_land
66 USE modi_abor1_sfx
67 USE modi_get_luout
68 !
69 USE yomhook ,ONLY : lhook, dr_hook
70 USE parkind1 ,ONLY : jprb
71 !
72 USE modi_get_1d_mask
73 !
74 USE modi_get_frac_n
75 IMPLICIT NONE
76 !
77 !* 0.1 Declarations of arguments
78 ! -------------------------
79 !
80 !
81 TYPE(isba_model_t), INTENT(INOUT) :: IM
82 TYPE(seaflux_t), INTENT(INOUT) :: S
83 TYPE(surf_atm_t), INTENT(INOUT) :: U
84 TYPE(watflux_t), INTENT(INOUT) :: W
85 !
86  CHARACTER(LEN=6), INTENT(IN) :: HPROGRAM
87 INTEGER, INTENT(IN) :: KI ! number of points
88 !
89 REAL, DIMENSION(KI), INTENT(OUT) :: PRUI
90 REAL, DIMENSION(KI), INTENT(OUT) :: PWIND
91 REAL, DIMENSION(KI), INTENT(OUT) :: PFWSU
92 REAL, DIMENSION(KI), INTENT(OUT) :: PFWSV
93 REAL, DIMENSION(KI), INTENT(OUT) :: PSNET
94 REAL, DIMENSION(KI), INTENT(OUT) :: PHEAT
95 REAL, DIMENSION(KI), INTENT(OUT) :: PEVAP
96 REAL, DIMENSION(KI), INTENT(OUT) :: PRAIN
97 REAL, DIMENSION(KI), INTENT(OUT) :: PSNOW
98 REAL, DIMENSION(KI), INTENT(OUT) :: PICEFLUX
99 REAL, DIMENSION(KI), INTENT(OUT) :: PFWSM
100 REAL, DIMENSION(KI), INTENT(OUT) :: PHEAT_ICE
101 REAL, DIMENSION(KI), INTENT(OUT) :: PEVAP_ICE
102 REAL, DIMENSION(KI), INTENT(OUT) :: PSNET_ICE
103 !
104 !* 0.2 Declarations of local variables
105 ! -------------------------------
106 !
107 REAL, DIMENSION(KI) :: ZRUNOFF ! Cumulated Surface runoff (kg/m2)
108 REAL, DIMENSION(KI) :: ZDRAIN ! Cumulated Deep drainage (kg/m2)
109 REAL, DIMENSION(KI) :: ZCALVING ! Cumulated Calving flux (kg/m2)
110 REAL, DIMENSION(KI) :: ZSRCFLOOD ! Cumulated flood freshwater flux (kg/m2)
111 !
112 REAL, DIMENSION(KI) :: ZSEA_FWSU ! Cumulated zonal wind stress (Pa.s)
113 REAL, DIMENSION(KI) :: ZSEA_FWSV ! Cumulated meridian wind stress (Pa.s)
114 REAL, DIMENSION(KI) :: ZSEA_HEAT ! Cumulated Non solar net heat flux (J/m2)
115 REAL, DIMENSION(KI) :: ZSEA_SNET ! Cumulated Solar net heat flux (J/m2)
116 REAL, DIMENSION(KI) :: ZSEA_WIND ! Cumulated 10m wind speed (m)
117 REAL, DIMENSION(KI) :: ZSEA_FWSM ! Cumulated wind stress (Pa.s)
118 REAL, DIMENSION(KI) :: ZSEA_EVAP ! Cumulated Evaporation (kg/m2)
119 REAL, DIMENSION(KI) :: ZSEA_RAIN ! Cumulated Rainfall rate (kg/m2)
120 REAL, DIMENSION(KI) :: ZSEA_SNOW ! Cumulated Snowfall rate (kg/m2)
121 REAL, DIMENSION(KI) :: ZSEA_WATF ! Cumulated freshwater flux (kg/m2)
122 !
123 REAL, DIMENSION(KI) :: ZSEAICE_HEAT ! Cumulated Sea-ice non solar net heat flux (J/m2)
124 REAL, DIMENSION(KI) :: ZSEAICE_SNET ! Cumulated Sea-ice solar net heat flux (J/m2)
125 REAL, DIMENSION(KI) :: ZSEAICE_EVAP ! Cumulated Sea-ice sublimation (kg/m2)
126 !
127 INTEGER :: ILU, ILUOUT
128 !
129 REAL(KIND=JPRB) :: ZHOOK_HANDLE
130 !
131 !-------------------------------------------------------------------------------
132 IF (lhook) CALL dr_hook('GET_SFXCPL_N',0,zhook_handle)
133 !
134  CALL get_luout(hprogram,iluout)
135 !
136 !-------------------------------------------------------------------------------
137 ! Global argument
138 !
139 IF(ki/=u%NSIZE_FULL)THEN
140  WRITE(iluout,*) 'size of field expected by the coupling :', ki
141  WRITE(iluout,*) 'size of field in SURFEX :', u%NSIZE_FULL
142  CALL abor1_sfx('GET_SFXCPL_N: VECTOR SIZE NOT CORRECT FOR COUPLING')
143 ENDIF
144 !
145 !-------------------------------------------------------------------------------
146 ! Get variable over nature tile
147 !
148 IF(lcpl_land)THEN
149 !
150 ! * Init land output fields
151 !
152  zrunoff(:) = xundef
153  zdrain(:) = xundef
154  zcalving(:) = xundef
155  zsrcflood(:) = xundef
156 !
157 ! * Get land output fields
158 !
159  CALL get_sfx_land(im%O, im%S, u, &
161  zrunoff,zdrain,zcalving,zsrcflood )
162 !
163 ! * Assign land output fields
164 !
165  prui(:) = zrunoff(:)+zdrain(:)
166  piceflux(:) = zcalving(:)
167 !
168 ENDIF
169 !
170 !-------------------------------------------------------------------------------
171 ! Get variable over sea and water tiles and for ice
172 !
173 IF(lcpl_sea)THEN
174 !
175 ! * Init sea output fields
176 !
177  zsea_fwsu(:) = xundef
178  zsea_fwsv(:) = xundef
179  zsea_heat(:) = xundef
180  zsea_snet(:) = xundef
181  zsea_wind(:) = xundef
182  zsea_fwsm(:) = xundef
183  zsea_evap(:) = xundef
184  zsea_rain(:) = xundef
185  zsea_snow(:) = xundef
186  zsea_watf(:) = xundef
187 !
188  zseaice_heat(:) = xundef
189  zseaice_snet(:) = xundef
190  zseaice_evap(:) = xundef
191 !
192 ! * Get sea output fields
193 !
194  CALL get_sfx_sea(s, u, w, &
196  zsea_fwsu,zsea_fwsv,zsea_heat,zsea_snet, &
197  zsea_wind,zsea_fwsm,zsea_evap,zsea_rain, &
198  zsea_snow,zsea_watf, &
199  zseaice_heat,zseaice_snet,zseaice_evap )
200 !
201 ! * Assign sea output fields
202 !
203  pfwsu(:) = zsea_fwsu(:)
204  pfwsv(:) = zsea_fwsv(:)
205  psnet(:) = zsea_snet(:)
206  pheat(:) = zsea_heat(:)
207  pevap(:) = zsea_evap(:)
208  prain(:) = zsea_rain(:)
209  psnow(:) = zsea_snow(:)
210  pfwsm(:) = zsea_fwsm(:)
211  pheat_ice(:) = zseaice_heat(:)
212  pevap_ice(:) = zseaice_evap(:)
213  psnet_ice(:) = zseaice_snet(:)
214 !
215 ENDIF
216 !
217 !-------------------------------------------------------------------------------
218 IF (lhook) CALL dr_hook('GET_SFXCPL_N',1,zhook_handle)
219 !
220 END SUBROUTINE get_sfxcpl_n
subroutine abor1_sfx(YTEXT)
Definition: abor1_sfx.F90:7
real, parameter xundef
integer, parameter jprb
Definition: parkind1.F90:32
subroutine get_sfx_land(IO, S, U, OCPL_GW, OCPL_FLOOD, OCPL_CALVING, PRUNOFF, PDRAIN, PCALVING, PSRCFLOOD)
Definition: get_sfx_land.F90:9
subroutine get_luout(HPROGRAM, KLUOUT)
Definition: get_luout.F90:7
subroutine get_sfx_sea(S, U, W, OCPL_SEAICE, OWATER,
Definition: get_sfx_sea.F90:8
logical lhook
Definition: yomhook.F90:15
subroutine get_sfxcpl_n(IM, S, U, W, HPROGRAM, KI, PRUI, PWIND, PFWSU, PFWSV, PSNET,
Definition: get_sfxcpln.F90:8