SURFEX  V8_0
Surfex V8_0 release
 All Classes Files Functions Variables
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 (I, 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 !-------------------------------------------------------------------------------
45 !
46 !* 0. DECLARATIONS
47 ! ------------
48 !
49 !
50 !
51 !
52 USE modd_isba_n, ONLY : isba_t
53 USE modd_seaflux_n, ONLY : seaflux_t
54 USE modd_surf_atm_n, ONLY : surf_atm_t
55 USE modd_watflux_n, ONLY : watflux_t
56 !
57 USE modd_surf_par, ONLY : xundef
58 !
59 USE modn_sfx_oasis, ONLY : lwater
60 USE modd_sfx_oasis, ONLY : lcpl_land, lcpl_calving, lcpl_gw, &
61  lcpl_flood, lcpl_sea, lcpl_seaice
62 !
63 USE modi_get_sfx_sea
64 USE modi_get_sfx_land
65 USE modi_abor1_sfx
66 USE modi_get_luout
67 !
68 USE yomhook ,ONLY : lhook, dr_hook
69 USE parkind1 ,ONLY : jprb
70 !
71 USE modi_get_1d_mask
72 !
73 USE modi_get_frac_n
74 IMPLICIT NONE
75 !
76 !* 0.1 Declarations of arguments
77 ! -------------------------
78 !
79 !
80 TYPE(isba_t), INTENT(INOUT) :: i
81 TYPE(seaflux_t), INTENT(INOUT) :: s
82 TYPE(surf_atm_t), INTENT(INOUT) :: u
83 TYPE(watflux_t), INTENT(INOUT) :: w
84 !
85  CHARACTER(LEN=6), INTENT(IN) :: hprogram
86 INTEGER, INTENT(IN) :: ki ! number of points
87 !
88 REAL, DIMENSION(KI), INTENT(OUT) :: prui
89 REAL, DIMENSION(KI), INTENT(OUT) :: pwind
90 REAL, DIMENSION(KI), INTENT(OUT) :: pfwsu
91 REAL, DIMENSION(KI), INTENT(OUT) :: pfwsv
92 REAL, DIMENSION(KI), INTENT(OUT) :: psnet
93 REAL, DIMENSION(KI), INTENT(OUT) :: pheat
94 REAL, DIMENSION(KI), INTENT(OUT) :: pevap
95 REAL, DIMENSION(KI), INTENT(OUT) :: prain
96 REAL, DIMENSION(KI), INTENT(OUT) :: psnow
97 REAL, DIMENSION(KI), INTENT(OUT) :: piceflux
98 REAL, DIMENSION(KI), INTENT(OUT) :: pfwsm
99 REAL, DIMENSION(KI), INTENT(OUT) :: pheat_ice
100 REAL, DIMENSION(KI), INTENT(OUT) :: pevap_ice
101 REAL, DIMENSION(KI), INTENT(OUT) :: psnet_ice
102 !
103 !* 0.2 Declarations of local variables
104 ! -------------------------------
105 !
106 REAL, DIMENSION(KI) :: zrunoff ! Cumulated Surface runoff (kg/m2)
107 REAL, DIMENSION(KI) :: zdrain ! Cumulated Deep drainage (kg/m2)
108 REAL, DIMENSION(KI) :: zcalving ! Cumulated Calving flux (kg/m2)
109 REAL, DIMENSION(KI) :: zrecharge ! Cumulated Recharge to groundwater (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  zrecharge(:) = xundef
156  zsrcflood(:) = xundef
157 !
158 ! * Get land output fields
159 !
160  CALL get_sfx_land(i, u, &
161  lcpl_gw,lcpl_flood,lcpl_calving, &
162  zrunoff,zdrain,zcalving,zrecharge, &
163  zsrcflood )
164 !
165 ! * Assign land output fields
166 !
167  prui(:) = zrunoff(:)+zdrain(:)
168  piceflux(:) = zcalving(:)
169 !
170 ENDIF
171 !
172 !-------------------------------------------------------------------------------
173 ! Get variable over sea and water tiles and for ice
174 !
175 IF(lcpl_sea)THEN
176 !
177 ! * Init sea output fields
178 !
179  zsea_fwsu(:) = xundef
180  zsea_fwsv(:) = xundef
181  zsea_heat(:) = xundef
182  zsea_snet(:) = xundef
183  zsea_wind(:) = xundef
184  zsea_fwsm(:) = xundef
185  zsea_evap(:) = xundef
186  zsea_rain(:) = xundef
187  zsea_snow(:) = xundef
188  zsea_watf(:) = xundef
189 !
190  zseaice_heat(:) = xundef
191  zseaice_snet(:) = xundef
192  zseaice_evap(:) = xundef
193 !
194 ! * Get sea output fields
195 !
196  CALL get_sfx_sea(s, u, w, &
197  lcpl_seaice,lwater, &
198  zsea_fwsu,zsea_fwsv,zsea_heat,zsea_snet, &
199  zsea_wind,zsea_fwsm,zsea_evap,zsea_rain, &
200  zsea_snow,zsea_watf, &
201  zseaice_heat,zseaice_snet,zseaice_evap )
202 !
203 ! * Assign sea output fields
204 !
205  pfwsu(:) = zsea_fwsu(:)
206  pfwsv(:) = zsea_fwsv(:)
207  psnet(:) = zsea_snet(:)
208  pheat(:) = zsea_heat(:)
209  pevap(:) = zsea_evap(:)
210  prain(:) = zsea_rain(:)
211  psnow(:) = zsea_snow(:)
212  pfwsm(:) = zsea_fwsm(:)
213  pheat_ice(:) = zseaice_heat(:)
214  pevap_ice(:) = zseaice_evap(:)
215  psnet_ice(:) = zseaice_snet(:)
216 !
217 ENDIF
218 !
219 !-------------------------------------------------------------------------------
220 IF (lhook) CALL dr_hook('GET_SFXCPL_N',1,zhook_handle)
221 !
222 END SUBROUTINE get_sfxcpl_n
subroutine get_sfx_land(I, U, OCPL_GW, OCPL_FLOOD, OCPL_CALVING, PRUNOFF, PDRAIN, PCALVING, PRECHARGE, PSRCFLOOD)
Definition: get_sfx_land.F90:6
subroutine get_sfxcpl_n(I, S, U, W, HPROGRAM, KI, PRUI, PWIND, PFWSU, PFWSV, PSNET, PHEAT, PEVAP, PRAIN, PSNOW, PICEFLUX, PFWSM, PHEAT_ICE, PEVAP_ICE, PSNET_ICE)
Definition: get_sfxcpln.F90:6
subroutine get_sfx_sea(S, U, W, OCPL_SEAICE, OWATER, PSEA_FWSU, PSEA_FWSV, PSEA_HEAT, PSEA_SNET, PSEA_WIND, PSEA_FWSM, PSEA_EVAP, PSEA_RAIN, PSEA_SNOW, PSEA_WATF, PSEAICE_HEAT, PSEAICE_SNET, PSEAICE_EVAP)
Definition: get_sfx_sea.F90:6
subroutine abor1_sfx(YTEXT)
Definition: abor1_sfx.F90:6
subroutine get_luout(HPROGRAM, KLUOUT)
Definition: get_luout.F90:6