1 | MODULE sbcblk_core |
---|
2 | !!====================================================================== |
---|
3 | !! *** MODULE sbcblk_core *** |
---|
4 | !! Ocean forcing: momentum, heat and freshwater flux formulation |
---|
5 | !!===================================================================== |
---|
6 | !! History : 1.0 ! 2004-08 (U. Schweckendiek) Original code |
---|
7 | !! 2.0 ! 2005-04 (L. Brodeau, A.M. Treguier) additions: |
---|
8 | !! - new bulk routine for efficiency |
---|
9 | !! - WINDS ARE NOW ASSUMED TO BE AT T POINTS in input files !!!! |
---|
10 | !! - file names and file characteristics in namelist |
---|
11 | !! - Implement reading of 6-hourly fields |
---|
12 | !! 3.0 ! 2006-06 (G. Madec) sbc rewritting |
---|
13 | !! - ! 2006-12 (L. Brodeau) Original code for TURB_CORE_2Z |
---|
14 | !! 3.2 ! 2009-04 (B. Lemaire) Introduce iom_put |
---|
15 | !! 3.3 ! 2010-10 (S. Masson) add diurnal cycle |
---|
16 | !! 3.4 ! 2011-11 (C. Harris) Fill arrays required by CICE |
---|
17 | !!---------------------------------------------------------------------- |
---|
18 | |
---|
19 | !!---------------------------------------------------------------------- |
---|
20 | !! sbc_blk_core : bulk formulation as ocean surface boundary condition |
---|
21 | !! (forced mode, CORE bulk formulea) |
---|
22 | !! blk_oce_core : ocean: computes momentum, heat and freshwater fluxes |
---|
23 | !! blk_ice_core : ice : computes momentum, heat and freshwater fluxes |
---|
24 | !! turb_core : computes the CORE turbulent transfer coefficients |
---|
25 | !!---------------------------------------------------------------------- |
---|
26 | USE oce ! ocean dynamics and tracers |
---|
27 | USE dom_oce ! ocean space and time domain |
---|
28 | USE phycst ! physical constants |
---|
29 | USE fldread ! read input fields |
---|
30 | USE sbc_oce ! Surface boundary condition: ocean fields |
---|
31 | USE sbcdcy ! surface boundary condition: diurnal cycle |
---|
32 | USE iom ! I/O manager library |
---|
33 | USE in_out_manager ! I/O manager |
---|
34 | USE lib_mpp ! distribued memory computing library |
---|
35 | USE wrk_nemo ! work arrays |
---|
36 | USE timing ! Timing |
---|
37 | USE lbclnk ! ocean lateral boundary conditions (or mpp link) |
---|
38 | USE prtctl ! Print control |
---|
39 | USE sbcwave,ONLY : cdn_wave !wave module |
---|
40 | #if defined key_lim3 || defined key_cice |
---|
41 | USE sbc_ice ! Surface boundary condition: ice fields |
---|
42 | #endif |
---|
43 | |
---|
44 | IMPLICIT NONE |
---|
45 | PRIVATE |
---|
46 | |
---|
47 | PUBLIC sbc_blk_core ! routine called in sbcmod module |
---|
48 | PUBLIC blk_ice_core ! routine called in sbc_ice_lim module |
---|
49 | PUBLIC turb_core_2z ! routine calles in sbcblk_mfs module |
---|
50 | |
---|
51 | INTEGER , PARAMETER :: jpfld = 9 ! maximum number of files to read |
---|
52 | INTEGER , PARAMETER :: jp_wndi = 1 ! index of 10m wind velocity (i-component) (m/s) at T-point |
---|
53 | INTEGER , PARAMETER :: jp_wndj = 2 ! index of 10m wind velocity (j-component) (m/s) at T-point |
---|
54 | INTEGER , PARAMETER :: jp_humi = 3 ! index of specific humidity ( - ) |
---|
55 | INTEGER , PARAMETER :: jp_qsr = 4 ! index of solar heat (W/m2) |
---|
56 | INTEGER , PARAMETER :: jp_qlw = 5 ! index of Long wave (W/m2) |
---|
57 | INTEGER , PARAMETER :: jp_tair = 6 ! index of 10m air temperature (Kelvin) |
---|
58 | INTEGER , PARAMETER :: jp_prec = 7 ! index of total precipitation (rain+snow) (Kg/m2/s) |
---|
59 | INTEGER , PARAMETER :: jp_snow = 8 ! index of snow (solid prcipitation) (kg/m2/s) |
---|
60 | INTEGER , PARAMETER :: jp_tdif = 9 ! index of tau diff associated to HF tau (N/m2) at T-point |
---|
61 | |
---|
62 | TYPE(FLD), ALLOCATABLE, DIMENSION(:) :: sf ! structure of input fields (file informations, fields read) |
---|
63 | |
---|
64 | ! !!! CORE bulk parameters |
---|
65 | REAL(wp), PARAMETER :: rhoa = 1.22 ! air density |
---|
66 | REAL(wp), PARAMETER :: cpa = 1000.5 ! specific heat of air |
---|
67 | REAL(wp), PARAMETER :: Lv = 2.5e6 ! latent heat of vaporization |
---|
68 | REAL(wp), PARAMETER :: Ls = 2.839e6 ! latent heat of sublimation |
---|
69 | REAL(wp), PARAMETER :: Stef = 5.67e-8 ! Stefan Boltzmann constant |
---|
70 | REAL(wp), PARAMETER :: Cice = 1.63e-3 ! transfer coefficient over ice |
---|
71 | REAL(wp), PARAMETER :: albo = 0.066 ! ocean albedo assumed to be contant |
---|
72 | |
---|
73 | ! !!* Namelist namsbc_core : CORE bulk parameters |
---|
74 | LOGICAL :: ln_2m = .FALSE. ! logical flag for height of air temp. and hum |
---|
75 | LOGICAL :: ln_taudif = .FALSE. ! logical flag to use the "mean of stress module - module of mean stress" data |
---|
76 | REAL(wp) :: rn_usecrt = 1. ! weighted use surface currents to compute relative wind speed |
---|
77 | REAL(wp) :: rn_pfac = 1. ! multiplication factor for precipitation |
---|
78 | |
---|
79 | !! * Substitutions |
---|
80 | # include "domzgr_substitute.h90" |
---|
81 | # include "vectopt_loop_substitute.h90" |
---|
82 | !!---------------------------------------------------------------------- |
---|
83 | !! NEMO/OPA 3.3 , NEMO-consortium (2010) |
---|
84 | !! $Id: sbcblk_core.F90 3294 2012-01-28 16:44:18Z rblod $ |
---|
85 | !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) |
---|
86 | !!---------------------------------------------------------------------- |
---|
87 | CONTAINS |
---|
88 | |
---|
89 | SUBROUTINE sbc_blk_core( kt ) |
---|
90 | !!--------------------------------------------------------------------- |
---|
91 | !! *** ROUTINE sbc_blk_core *** |
---|
92 | !! |
---|
93 | !! ** Purpose : provide at each time step the surface ocean fluxes |
---|
94 | !! (momentum, heat, freshwater and runoff) |
---|
95 | !! |
---|
96 | !! ** Method : (1) READ each fluxes in NetCDF files: |
---|
97 | !! the 10m wind velocity (i-component) (m/s) at T-point |
---|
98 | !! the 10m wind velocity (j-component) (m/s) at T-point |
---|
99 | !! the specific humidity ( - ) |
---|
100 | !! the solar heat (W/m2) |
---|
101 | !! the Long wave (W/m2) |
---|
102 | !! the 10m air temperature (Kelvin) |
---|
103 | !! the total precipitation (rain+snow) (Kg/m2/s) |
---|
104 | !! the snow (solid prcipitation) (kg/m2/s) |
---|
105 | !! OPTIONAL parameter (see ln_taudif namelist flag): |
---|
106 | !! the tau diff associated to HF tau (N/m2) at T-point |
---|
107 | !! (2) CALL blk_oce_core |
---|
108 | !! |
---|
109 | !! C A U T I O N : never mask the surface stress fields |
---|
110 | !! the stress is assumed to be in the mesh referential |
---|
111 | !! i.e. the (i,j) referential |
---|
112 | !! |
---|
113 | !! ** Action : defined at each time-step at the air-sea interface |
---|
114 | !! - utau, vtau i- and j-component of the wind stress |
---|
115 | !! - taum wind stress module at T-point |
---|
116 | !! - wndm 10m wind module at T-point |
---|
117 | !! - qns, qsr non-slor and solar heat flux |
---|
118 | !! - emp, emps evaporation minus precipitation |
---|
119 | !!---------------------------------------------------------------------- |
---|
120 | INTEGER, INTENT(in) :: kt ! ocean time step |
---|
121 | !! |
---|
122 | INTEGER :: ierror ! return error code |
---|
123 | INTEGER :: ifpr ! dummy loop indice |
---|
124 | INTEGER :: jfld ! dummy loop arguments |
---|
125 | !! |
---|
126 | CHARACTER(len=100) :: cn_dir ! Root directory for location of core files |
---|
127 | TYPE(FLD_N), DIMENSION(jpfld) :: slf_i ! array of namelist informations on the fields to read |
---|
128 | TYPE(FLD_N) :: sn_wndi, sn_wndj, sn_humi, sn_qsr ! informations about the fields to be read |
---|
129 | TYPE(FLD_N) :: sn_qlw , sn_tair, sn_prec, sn_snow ! " " |
---|
130 | TYPE(FLD_N) :: sn_tdif ! " " |
---|
131 | NAMELIST/namsbc_core/ cn_dir , ln_2m , ln_taudif, rn_pfac, rn_usecrt, & |
---|
132 | & sn_wndi, sn_wndj, sn_humi , sn_qsr , & |
---|
133 | & sn_qlw , sn_tair, sn_prec , sn_snow, sn_tdif |
---|
134 | !!--------------------------------------------------------------------- |
---|
135 | |
---|
136 | ! ! ====================== ! |
---|
137 | IF( kt == nit000 ) THEN ! First call kt=nit000 ! |
---|
138 | ! ! ====================== ! |
---|
139 | ! set file information (default values) |
---|
140 | cn_dir = './' ! directory in which the model is executed |
---|
141 | ! |
---|
142 | ! (NB: frequency positive => hours, negative => months) |
---|
143 | ! ! file ! frequency ! variable ! time intep ! clim ! 'yearly' or ! weights ! rotation ! |
---|
144 | ! ! name ! (hours) ! name ! (T/F) ! (T/F) ! 'monthly' ! filename ! pairs ! |
---|
145 | sn_wndi = FLD_N( 'uwnd10m', 24 , 'u_10' , .false. , .false. , 'yearly' , '' , '' ) |
---|
146 | sn_wndj = FLD_N( 'vwnd10m', 24 , 'v_10' , .false. , .false. , 'yearly' , '' , '' ) |
---|
147 | sn_qsr = FLD_N( 'qsw' , 24 , 'qsw' , .false. , .false. , 'yearly' , '' , '' ) |
---|
148 | sn_qlw = FLD_N( 'qlw' , 24 , 'qlw' , .false. , .false. , 'yearly' , '' , '' ) |
---|
149 | sn_tair = FLD_N( 'tair10m', 24 , 't_10' , .false. , .false. , 'yearly' , '' , '' ) |
---|
150 | sn_humi = FLD_N( 'humi10m', 24 , 'q_10' , .false. , .false. , 'yearly' , '' , '' ) |
---|
151 | sn_prec = FLD_N( 'precip' , -1 , 'precip' , .true. , .false. , 'yearly' , '' , '' ) |
---|
152 | sn_snow = FLD_N( 'snow' , -1 , 'snow' , .true. , .false. , 'yearly' , '' , '' ) |
---|
153 | sn_tdif = FLD_N( 'taudif' , 24 , 'taudif' , .true. , .false. , 'yearly' , '' , '' ) |
---|
154 | ! |
---|
155 | REWIND( numnam ) ! read in namlist namsbc_core |
---|
156 | READ ( numnam, namsbc_core ) |
---|
157 | ! ! check: do we plan to use ln_dm2dc with non-daily forcing? |
---|
158 | IF( ln_dm2dc .AND. sn_qsr%nfreqh /= 24 ) & |
---|
159 | & CALL ctl_stop( 'sbc_blk_core: ln_dm2dc can be activated only with daily short-wave forcing' ) |
---|
160 | IF( ln_dm2dc .AND. sn_qsr%ln_tint ) THEN |
---|
161 | CALL ctl_warn( 'sbc_blk_core: ln_dm2dc is taking care of the temporal interpolation of daily qsr', & |
---|
162 | & ' ==> We force time interpolation = .false. for qsr' ) |
---|
163 | sn_qsr%ln_tint = .false. |
---|
164 | ENDIF |
---|
165 | ! ! store namelist information in an array |
---|
166 | slf_i(jp_wndi) = sn_wndi ; slf_i(jp_wndj) = sn_wndj |
---|
167 | slf_i(jp_qsr ) = sn_qsr ; slf_i(jp_qlw ) = sn_qlw |
---|
168 | slf_i(jp_tair) = sn_tair ; slf_i(jp_humi) = sn_humi |
---|
169 | slf_i(jp_prec) = sn_prec ; slf_i(jp_snow) = sn_snow |
---|
170 | slf_i(jp_tdif) = sn_tdif |
---|
171 | ! |
---|
172 | lhftau = ln_taudif ! do we use HF tau information? |
---|
173 | jfld = jpfld - COUNT( (/.NOT. lhftau/) ) |
---|
174 | |
---|
175 | ! do we use snow information? |
---|
176 | jfld = jfld - COUNT( (/ nn_ice == 0 /) ) |
---|
177 | |
---|
178 | ! |
---|
179 | ALLOCATE( sf(jfld), STAT=ierror ) ! set sf structure |
---|
180 | IF( ierror > 0 ) CALL ctl_stop( 'STOP', 'sbc_blk_core: unable to allocate sf structure' ) |
---|
181 | DO ifpr= 1, jfld |
---|
182 | ALLOCATE( sf(ifpr)%fnow(jpi,jpj,1) ) |
---|
183 | IF( slf_i(ifpr)%ln_tint ) ALLOCATE( sf(ifpr)%fdta(jpi,jpj,1,2) ) |
---|
184 | END DO |
---|
185 | ! ! fill sf with slf_i and control print |
---|
186 | CALL fld_fill( sf, slf_i, cn_dir, 'sbc_blk_core', 'flux formulation for ocean surface boundary condition', 'namsbc_core' ) |
---|
187 | ! |
---|
188 | ENDIF |
---|
189 | |
---|
190 | CALL fld_read( kt, nn_fsbc, sf ) ! input fields provided at the current time-step |
---|
191 | |
---|
192 | ! ! surface ocean fluxes computed with CLIO bulk formulea |
---|
193 | IF( MOD( kt - 1, nn_fsbc ) == 0 ) CALL blk_oce_core( sf, sst_m, ssu_m, ssv_m ) |
---|
194 | |
---|
195 | #if defined key_cice |
---|
196 | IF( MOD( kt - 1, nn_fsbc ) == 0 ) THEN |
---|
197 | qlw_ice(:,:,1) = sf(jp_qlw)%fnow(:,:,1) |
---|
198 | qsr_ice(:,:,1) = sf(jp_qsr)%fnow(:,:,1) |
---|
199 | tatm_ice(:,:) = sf(jp_tair)%fnow(:,:,1) |
---|
200 | qatm_ice(:,:) = sf(jp_humi)%fnow(:,:,1) |
---|
201 | tprecip(:,:) = sf(jp_prec)%fnow(:,:,1) * rn_pfac |
---|
202 | sprecip(:,:) = sf(jp_snow)%fnow(:,:,1) * rn_pfac |
---|
203 | wndi_ice(:,:) = sf(jp_wndi)%fnow(:,:,1) |
---|
204 | wndj_ice(:,:) = sf(jp_wndj)%fnow(:,:,1) |
---|
205 | ENDIF |
---|
206 | #endif |
---|
207 | ! |
---|
208 | END SUBROUTINE sbc_blk_core |
---|
209 | |
---|
210 | |
---|
211 | SUBROUTINE blk_oce_core( sf, pst, pu, pv ) |
---|
212 | !!--------------------------------------------------------------------- |
---|
213 | !! *** ROUTINE blk_core *** |
---|
214 | !! |
---|
215 | !! ** Purpose : provide the momentum, heat and freshwater fluxes at |
---|
216 | !! the ocean surface at each time step |
---|
217 | !! |
---|
218 | !! ** Method : CORE bulk formulea for the ocean using atmospheric |
---|
219 | !! fields read in sbc_read |
---|
220 | !! |
---|
221 | !! ** Outputs : - utau : i-component of the stress at U-point (N/m2) |
---|
222 | !! - vtau : j-component of the stress at V-point (N/m2) |
---|
223 | !! - taum : Wind stress module at T-point (N/m2) |
---|
224 | !! - wndm : Wind speed module at T-point (m/s) |
---|
225 | !! - qsr : Solar heat flux over the ocean (W/m2) |
---|
226 | !! - qns : Non Solar heat flux over the ocean (W/m2) |
---|
227 | !! - evap : Evaporation over the ocean (kg/m2/s) |
---|
228 | !! - emp(s) : evaporation minus precipitation (kg/m2/s) |
---|
229 | !! |
---|
230 | !! ** Nota : sf has to be a dummy argument for AGRIF on NEC |
---|
231 | !!--------------------------------------------------------------------- |
---|
232 | TYPE(fld), INTENT(in), DIMENSION(:) :: sf ! input data |
---|
233 | REAL(wp) , INTENT(in), DIMENSION(:,:) :: pst ! surface temperature [Celcius] |
---|
234 | REAL(wp) , INTENT(in), DIMENSION(:,:) :: pu ! surface current at U-point (i-component) [m/s] |
---|
235 | REAL(wp) , INTENT(in), DIMENSION(:,:) :: pv ! surface current at V-point (j-component) [m/s] |
---|
236 | ! |
---|
237 | INTEGER :: ji, jj ! dummy loop indices |
---|
238 | REAL(wp) :: zcoef_qsatw, zztmp ! local variable |
---|
239 | REAL(wp), DIMENSION(:,:), POINTER :: zwnd_i, zwnd_j ! wind speed components at T-point |
---|
240 | REAL(wp), DIMENSION(:,:), POINTER :: zqsatw ! specific humidity at pst |
---|
241 | REAL(wp), DIMENSION(:,:), POINTER :: zqlw, zqsb ! long wave and sensible heat fluxes |
---|
242 | REAL(wp), DIMENSION(:,:), POINTER :: zqla, zevap ! latent heat fluxes and evaporation |
---|
243 | REAL(wp), DIMENSION(:,:), POINTER :: Cd ! transfer coefficient for momentum (tau) |
---|
244 | REAL(wp), DIMENSION(:,:), POINTER :: Ch ! transfer coefficient for sensible heat (Q_sens) |
---|
245 | REAL(wp), DIMENSION(:,:), POINTER :: Ce ! tansfert coefficient for evaporation (Q_lat) |
---|
246 | REAL(wp), DIMENSION(:,:), POINTER :: zst ! surface temperature in Kelvin |
---|
247 | REAL(wp), DIMENSION(:,:), POINTER :: zt_zu ! air temperature at wind speed height |
---|
248 | REAL(wp), DIMENSION(:,:), POINTER :: zq_zu ! air spec. hum. at wind speed height |
---|
249 | !!--------------------------------------------------------------------- |
---|
250 | ! |
---|
251 | IF( nn_timing == 1 ) CALL timing_start('blk_oce_core') |
---|
252 | ! |
---|
253 | CALL wrk_alloc( jpi,jpj, zwnd_i, zwnd_j, zqsatw, zqlw, zqsb, zqla, zevap ) |
---|
254 | CALL wrk_alloc( jpi,jpj, Cd, Ch, Ce, zst, zt_zu, zq_zu ) |
---|
255 | ! |
---|
256 | ! local scalars ( place there for vector optimisation purposes) |
---|
257 | zcoef_qsatw = 0.98 * 640380. / rhoa |
---|
258 | |
---|
259 | zst(:,:) = pst(:,:) + rt0 ! converte Celcius to Kelvin (and set minimum value far above 0 K) |
---|
260 | |
---|
261 | ! ----------------------------------------------------------------------------- ! |
---|
262 | ! 0 Wind components and module at T-point relative to the moving ocean ! |
---|
263 | ! ----------------------------------------------------------------------------- ! |
---|
264 | |
---|
265 | ! ... components ( U10m - U_oce ) at T-point (unmasked) |
---|
266 | IF( rn_usecrt /= 0. ) THEN |
---|
267 | #if defined key_vectopt_loop |
---|
268 | !CDIR COLLAPSE |
---|
269 | #endif |
---|
270 | DO jj = 2, jpjm1 |
---|
271 | DO ji = fs_2, fs_jpim1 ! vect. opt. |
---|
272 | zwnd_i(ji,jj) = ( sf(jp_wndi)%fnow(ji,jj,1) - 0.5 * rn_usecrt * ( pu(ji-1,jj ) + pu(ji,jj) ) ) |
---|
273 | zwnd_j(ji,jj) = ( sf(jp_wndj)%fnow(ji,jj,1) - 0.5 * rn_usecrt * ( pv(ji ,jj-1) + pv(ji,jj) ) ) |
---|
274 | END DO |
---|
275 | END DO |
---|
276 | CALL lbc_lnk( zwnd_i(:,:) , 'T', -1. ) |
---|
277 | CALL lbc_lnk( zwnd_j(:,:) , 'T', -1. ) |
---|
278 | ELSE |
---|
279 | zwnd_i(:,:) = sf(jp_wndi)%fnow(:,:,1) |
---|
280 | zwnd_j(:,:) = sf(jp_wndj)%fnow(:,:,1) |
---|
281 | END IF |
---|
282 | ! ... scalar wind module at T-point (masked) |
---|
283 | !CDIR NOVERRCHK |
---|
284 | !CDIR COLLAPSE |
---|
285 | wndm(:,:) = SQRT( zwnd_i(:,:) * zwnd_i(:,:) & |
---|
286 | & + zwnd_j(:,:) * zwnd_j(:,:) ) * tmask(:,:,1) |
---|
287 | |
---|
288 | ! ----------------------------------------------------------------------------- ! |
---|
289 | ! I Radiative FLUXES ! |
---|
290 | ! ----------------------------------------------------------------------------- ! |
---|
291 | |
---|
292 | ! ocean albedo assumed to be constant + modify now Qsr to include the diurnal cycle ! Short Wave |
---|
293 | zztmp = 1. - albo |
---|
294 | IF( ln_dm2dc ) THEN ; qsr(:,:) = zztmp * sbc_dcy( sf(jp_qsr)%fnow(:,:,1) ) * tmask(:,:,1) |
---|
295 | ELSE ; qsr(:,:) = zztmp * sf(jp_qsr)%fnow(:,:,1) * tmask(:,:,1) |
---|
296 | ENDIF |
---|
297 | !CDIR COLLAPSE |
---|
298 | zqlw(:,:) = ( sf(jp_qlw)%fnow(:,:,1) - Stef * zst(:,:)*zst(:,:)*zst(:,:)*zst(:,:) ) * tmask(:,:,1) ! Long Wave |
---|
299 | ! ----------------------------------------------------------------------------- ! |
---|
300 | ! II Turbulent FLUXES ! |
---|
301 | ! ----------------------------------------------------------------------------- ! |
---|
302 | |
---|
303 | ! ... specific humidity at SST and IST |
---|
304 | !CDIR NOVERRCHK |
---|
305 | !CDIR COLLAPSE |
---|
306 | zqsatw(:,:) = zcoef_qsatw * EXP( -5107.4 / zst(:,:) ) |
---|
307 | |
---|
308 | ! ... NCAR Bulk formulae, computation of Cd, Ch, Ce at T-point : |
---|
309 | IF( ln_2m ) THEN |
---|
310 | !! If air temp. and spec. hum. are given at different height (2m) than wind (10m) : |
---|
311 | CALL TURB_CORE_2Z(2.,10., zst , sf(jp_tair)%fnow, & |
---|
312 | & zqsatw, sf(jp_humi)%fnow, wndm, & |
---|
313 | & Cd , Ch , Ce , & |
---|
314 | & zt_zu , zq_zu ) |
---|
315 | ELSE |
---|
316 | !! If air temp. and spec. hum. are given at same height than wind (10m) : |
---|
317 | !gm bug? at the compiling phase, add a copy in temporary arrays... ==> check perf |
---|
318 | ! CALL TURB_CORE_1Z( 10., zst (:,:), sf(jp_tair)%fnow(:,:), & |
---|
319 | ! & zqsatw(:,:), sf(jp_humi)%fnow(:,:), wndm(:,:), & |
---|
320 | ! & Cd (:,:), Ch (:,:), Ce (:,:) ) |
---|
321 | !gm bug |
---|
322 | ! ARPDBG - this won't compile with gfortran. Fix but check performance |
---|
323 | ! as per comment above. |
---|
324 | CALL TURB_CORE_1Z( 10., zst , sf(jp_tair)%fnow(:,:,1), & |
---|
325 | & zqsatw, sf(jp_humi)%fnow(:,:,1), wndm, & |
---|
326 | & Cd , Ch , Ce ) |
---|
327 | ENDIF |
---|
328 | |
---|
329 | ! ... tau module, i and j component |
---|
330 | DO jj = 1, jpj |
---|
331 | DO ji = 1, jpi |
---|
332 | zztmp = rhoa * wndm(ji,jj) * Cd(ji,jj) |
---|
333 | taum (ji,jj) = zztmp * wndm (ji,jj) |
---|
334 | zwnd_i(ji,jj) = zztmp * zwnd_i(ji,jj) |
---|
335 | zwnd_j(ji,jj) = zztmp * zwnd_j(ji,jj) |
---|
336 | END DO |
---|
337 | END DO |
---|
338 | |
---|
339 | ! ... add the HF tau contribution to the wind stress module? |
---|
340 | IF( lhftau ) THEN |
---|
341 | !CDIR COLLAPSE |
---|
342 | taum(:,:) = taum(:,:) + sf(jp_tdif)%fnow(:,:,1) |
---|
343 | ENDIF |
---|
344 | CALL iom_put( "taum_oce", taum ) ! output wind stress module |
---|
345 | |
---|
346 | ! ... utau, vtau at U- and V_points, resp. |
---|
347 | ! Note the use of 0.5*(2-umask) in order to unmask the stress along coastlines |
---|
348 | DO jj = 1, jpjm1 |
---|
349 | DO ji = 1, fs_jpim1 |
---|
350 | utau(ji,jj) = 0.5 * ( 2. - umask(ji,jj,1) ) * ( zwnd_i(ji,jj) + zwnd_i(ji+1,jj ) ) |
---|
351 | vtau(ji,jj) = 0.5 * ( 2. - vmask(ji,jj,1) ) * ( zwnd_j(ji,jj) + zwnd_j(ji ,jj+1) ) |
---|
352 | END DO |
---|
353 | END DO |
---|
354 | CALL lbc_lnk( utau(:,:), 'U', -1. ) |
---|
355 | CALL lbc_lnk( vtau(:,:), 'V', -1. ) |
---|
356 | |
---|
357 | ! Turbulent fluxes over ocean |
---|
358 | ! ----------------------------- |
---|
359 | IF( ln_2m ) THEN |
---|
360 | ! Values of temp. and hum. adjusted to 10m must be used instead of 2m values |
---|
361 | zevap(:,:) = MAX( 0.e0, rhoa *Ce(:,:)*( zqsatw(:,:) - zq_zu(:,:) ) * wndm(:,:) ) ! Evaporation |
---|
362 | zqsb (:,:) = rhoa*cpa*Ch(:,:)*( zst (:,:) - zt_zu(:,:) ) * wndm(:,:) ! Sensible Heat |
---|
363 | ELSE |
---|
364 | !CDIR COLLAPSE |
---|
365 | zevap(:,:) = MAX( 0.e0, rhoa *Ce(:,:)*( zqsatw(:,:) - sf(jp_humi)%fnow(:,:,1) ) * wndm(:,:) ) ! Evaporation |
---|
366 | !CDIR COLLAPSE |
---|
367 | zqsb (:,:) = rhoa*cpa*Ch(:,:)*( zst (:,:) - sf(jp_tair)%fnow(:,:,1) ) * wndm(:,:) ! Sensible Heat |
---|
368 | ENDIF |
---|
369 | !CDIR COLLAPSE |
---|
370 | zqla (:,:) = Lv * zevap(:,:) ! Latent Heat |
---|
371 | |
---|
372 | IF(ln_ctl) THEN |
---|
373 | CALL prt_ctl( tab2d_1=zqla , clinfo1=' blk_oce_core: zqla : ', tab2d_2=Ce , clinfo2=' Ce : ' ) |
---|
374 | CALL prt_ctl( tab2d_1=zqsb , clinfo1=' blk_oce_core: zqsb : ', tab2d_2=Ch , clinfo2=' Ch : ' ) |
---|
375 | CALL prt_ctl( tab2d_1=zqlw , clinfo1=' blk_oce_core: zqlw : ', tab2d_2=qsr, clinfo2=' qsr : ' ) |
---|
376 | CALL prt_ctl( tab2d_1=zqsatw, clinfo1=' blk_oce_core: zqsatw : ', tab2d_2=zst, clinfo2=' zst : ' ) |
---|
377 | CALL prt_ctl( tab2d_1=utau , clinfo1=' blk_oce_core: utau : ', mask1=umask, & |
---|
378 | & tab2d_2=vtau , clinfo2= ' vtau : ' , mask2=vmask ) |
---|
379 | CALL prt_ctl( tab2d_1=wndm , clinfo1=' blk_oce_core: wndm : ') |
---|
380 | CALL prt_ctl( tab2d_1=zst , clinfo1=' blk_oce_core: zst : ') |
---|
381 | ENDIF |
---|
382 | |
---|
383 | ! ----------------------------------------------------------------------------- ! |
---|
384 | ! III Total FLUXES ! |
---|
385 | ! ----------------------------------------------------------------------------- ! |
---|
386 | |
---|
387 | !CDIR COLLAPSE |
---|
388 | qns(:,:) = zqlw(:,:) - zqsb(:,:) - zqla(:,:) ! Downward Non Solar flux |
---|
389 | !CDIR COLLAPSE |
---|
390 | emp(:,:) = zevap(:,:) - sf(jp_prec)%fnow(:,:,1) * rn_pfac * tmask(:,:,1) |
---|
391 | !CDIR COLLAPSE |
---|
392 | emps(:,:) = emp(:,:) |
---|
393 | ! |
---|
394 | CALL iom_put( "qlw_oce", zqlw ) ! output downward longwave heat over the ocean |
---|
395 | CALL iom_put( "qsb_oce", - zqsb ) ! output downward sensible heat over the ocean |
---|
396 | CALL iom_put( "qla_oce", - zqla ) ! output downward latent heat over the ocean |
---|
397 | CALL iom_put( "qns_oce", qns ) ! output downward non solar heat over the ocean |
---|
398 | ! |
---|
399 | IF(ln_ctl) THEN |
---|
400 | CALL prt_ctl(tab2d_1=zqsb , clinfo1=' blk_oce_core: zqsb : ', tab2d_2=zqlw , clinfo2=' zqlw : ') |
---|
401 | CALL prt_ctl(tab2d_1=zqla , clinfo1=' blk_oce_core: zqla : ', tab2d_2=qsr , clinfo2=' qsr : ') |
---|
402 | CALL prt_ctl(tab2d_1=pst , clinfo1=' blk_oce_core: pst : ', tab2d_2=emp , clinfo2=' emp : ') |
---|
403 | CALL prt_ctl(tab2d_1=utau , clinfo1=' blk_oce_core: utau : ', mask1=umask, & |
---|
404 | & tab2d_2=vtau , clinfo2= ' vtau : ' , mask2=vmask ) |
---|
405 | ENDIF |
---|
406 | ! |
---|
407 | CALL wrk_dealloc( jpi,jpj, zwnd_i, zwnd_j, zqsatw, zqlw, zqsb, zqla, zevap ) |
---|
408 | CALL wrk_dealloc( jpi,jpj, Cd, Ch, Ce, zst, zt_zu, zq_zu ) |
---|
409 | ! |
---|
410 | IF( nn_timing == 1 ) CALL timing_stop('blk_oce_core') |
---|
411 | ! |
---|
412 | END SUBROUTINE blk_oce_core |
---|
413 | |
---|
414 | |
---|
415 | SUBROUTINE blk_ice_core( pst , pui , pvi , palb , & |
---|
416 | & p_taui, p_tauj, p_qns , p_qsr, & |
---|
417 | & p_qla , p_dqns, p_dqla, & |
---|
418 | & p_tpr , p_spr , & |
---|
419 | & p_fr1 , p_fr2 , cd_grid, pdim ) |
---|
420 | !!--------------------------------------------------------------------- |
---|
421 | !! *** ROUTINE blk_ice_core *** |
---|
422 | !! |
---|
423 | !! ** Purpose : provide the surface boundary condition over sea-ice |
---|
424 | !! |
---|
425 | !! ** Method : compute momentum, heat and freshwater exchanged |
---|
426 | !! between atmosphere and sea-ice using CORE bulk |
---|
427 | !! formulea, ice variables and read atmmospheric fields. |
---|
428 | !! NB: ice drag coefficient is assumed to be a constant |
---|
429 | !! |
---|
430 | !! caution : the net upward water flux has with mm/day unit |
---|
431 | !!--------------------------------------------------------------------- |
---|
432 | REAL(wp), DIMENSION(:,:,:), INTENT(in ) :: pst ! ice surface temperature (>0, =rt0 over land) [Kelvin] |
---|
433 | REAL(wp), DIMENSION(:,:) , INTENT(in ) :: pui ! ice surface velocity (i- and i- components [m/s] |
---|
434 | REAL(wp), DIMENSION(:,:) , INTENT(in ) :: pvi ! at I-point (B-grid) or U & V-point (C-grid) |
---|
435 | REAL(wp), DIMENSION(:,:,:), INTENT(in ) :: palb ! ice albedo (clear sky) (alb_ice_cs) [%] |
---|
436 | REAL(wp), DIMENSION(:,:) , INTENT( out) :: p_taui ! i- & j-components of surface ice stress [N/m2] |
---|
437 | REAL(wp), DIMENSION(:,:) , INTENT( out) :: p_tauj ! at I-point (B-grid) or U & V-point (C-grid) |
---|
438 | REAL(wp), DIMENSION(:,:,:), INTENT( out) :: p_qns ! non solar heat flux over ice (T-point) [W/m2] |
---|
439 | REAL(wp), DIMENSION(:,:,:), INTENT( out) :: p_qsr ! solar heat flux over ice (T-point) [W/m2] |
---|
440 | REAL(wp), DIMENSION(:,:,:), INTENT( out) :: p_qla ! latent heat flux over ice (T-point) [W/m2] |
---|
441 | REAL(wp), DIMENSION(:,:,:), INTENT( out) :: p_dqns ! non solar heat sensistivity (T-point) [W/m2] |
---|
442 | REAL(wp), DIMENSION(:,:,:), INTENT( out) :: p_dqla ! latent heat sensistivity (T-point) [W/m2] |
---|
443 | REAL(wp), DIMENSION(:,:) , INTENT( out) :: p_tpr ! total precipitation (T-point) [Kg/m2/s] |
---|
444 | REAL(wp), DIMENSION(:,:) , INTENT( out) :: p_spr ! solid precipitation (T-point) [Kg/m2/s] |
---|
445 | REAL(wp), DIMENSION(:,:) , INTENT( out) :: p_fr1 ! 1sr fraction of qsr penetration in ice (T-point) [%] |
---|
446 | REAL(wp), DIMENSION(:,:) , INTENT( out) :: p_fr2 ! 2nd fraction of qsr penetration in ice (T-point) [%] |
---|
447 | CHARACTER(len=1) , INTENT(in ) :: cd_grid ! ice grid ( C or B-grid) |
---|
448 | INTEGER , INTENT(in ) :: pdim ! number of ice categories |
---|
449 | !! |
---|
450 | INTEGER :: ji, jj, jl ! dummy loop indices |
---|
451 | INTEGER :: ijpl ! number of ice categories (size of 3rd dim of input arrays) |
---|
452 | REAL(wp) :: zst2, zst3 |
---|
453 | REAL(wp) :: zcoef_wnorm, zcoef_wnorm2, zcoef_dqlw, zcoef_dqla, zcoef_dqsb |
---|
454 | REAL(wp) :: zztmp ! temporary variable |
---|
455 | REAL(wp) :: zcoef_frca ! fractional cloud amount |
---|
456 | REAL(wp) :: zwnorm_f, zwndi_f , zwndj_f ! relative wind module and components at F-point |
---|
457 | REAL(wp) :: zwndi_t , zwndj_t ! relative wind components at T-point |
---|
458 | !! |
---|
459 | REAL(wp), DIMENSION(:,:) , POINTER :: z_wnds_t ! wind speed ( = | U10m - U_ice | ) at T-point |
---|
460 | REAL(wp), DIMENSION(:,:,:), POINTER :: z_qlw ! long wave heat flux over ice |
---|
461 | REAL(wp), DIMENSION(:,:,:), POINTER :: z_qsb ! sensible heat flux over ice |
---|
462 | REAL(wp), DIMENSION(:,:,:), POINTER :: z_dqlw ! long wave heat sensitivity over ice |
---|
463 | REAL(wp), DIMENSION(:,:,:), POINTER :: z_dqsb ! sensible heat sensitivity over ice |
---|
464 | !!--------------------------------------------------------------------- |
---|
465 | ! |
---|
466 | IF( nn_timing == 1 ) CALL timing_start('blk_ice_core') |
---|
467 | ! |
---|
468 | CALL wrk_alloc( jpi,jpj, z_wnds_t ) |
---|
469 | CALL wrk_alloc( jpi,jpj,pdim, z_qlw, z_qsb, z_dqlw, z_dqsb ) |
---|
470 | |
---|
471 | ijpl = pdim ! number of ice categories |
---|
472 | |
---|
473 | ! local scalars ( place there for vector optimisation purposes) |
---|
474 | zcoef_wnorm = rhoa * Cice |
---|
475 | zcoef_wnorm2 = rhoa * Cice * 0.5 |
---|
476 | zcoef_dqlw = 4.0 * 0.95 * Stef |
---|
477 | zcoef_dqla = -Ls * Cice * 11637800. * (-5897.8) |
---|
478 | zcoef_dqsb = rhoa * cpa * Cice |
---|
479 | zcoef_frca = 1.0 - 0.3 |
---|
480 | |
---|
481 | !!gm brutal.... |
---|
482 | z_wnds_t(:,:) = 0.e0 |
---|
483 | p_taui (:,:) = 0.e0 |
---|
484 | p_tauj (:,:) = 0.e0 |
---|
485 | !!gm end |
---|
486 | |
---|
487 | #if defined key_lim3 |
---|
488 | tatm_ice(:,:) = sf(jp_tair)%fnow(:,:,1) ! LIM3: make Tair available in sea-ice. WARNING allocated after call to ice_init |
---|
489 | #endif |
---|
490 | ! ----------------------------------------------------------------------------- ! |
---|
491 | ! Wind components and module relative to the moving ocean ( U10m - U_ice ) ! |
---|
492 | ! ----------------------------------------------------------------------------- ! |
---|
493 | SELECT CASE( cd_grid ) |
---|
494 | CASE( 'I' ) ! B-grid ice dynamics : I-point (i.e. F-point with sea-ice indexation) |
---|
495 | ! and scalar wind at T-point ( = | U10m - U_ice | ) (masked) |
---|
496 | !CDIR NOVERRCHK |
---|
497 | DO jj = 2, jpjm1 |
---|
498 | DO ji = 2, jpim1 ! B grid : NO vector opt |
---|
499 | ! ... scalar wind at I-point (fld being at T-point) |
---|
500 | zwndi_f = 0.25 * ( sf(jp_wndi)%fnow(ji-1,jj ,1) + sf(jp_wndi)%fnow(ji ,jj ,1) & |
---|
501 | & + sf(jp_wndi)%fnow(ji-1,jj-1,1) + sf(jp_wndi)%fnow(ji ,jj-1,1) ) - pui(ji,jj) |
---|
502 | zwndj_f = 0.25 * ( sf(jp_wndj)%fnow(ji-1,jj ,1) + sf(jp_wndj)%fnow(ji ,jj ,1) & |
---|
503 | & + sf(jp_wndj)%fnow(ji-1,jj-1,1) + sf(jp_wndj)%fnow(ji ,jj-1,1) ) - pvi(ji,jj) |
---|
504 | zwnorm_f = zcoef_wnorm * SQRT( zwndi_f * zwndi_f + zwndj_f * zwndj_f ) |
---|
505 | ! ... ice stress at I-point |
---|
506 | p_taui(ji,jj) = zwnorm_f * zwndi_f |
---|
507 | p_tauj(ji,jj) = zwnorm_f * zwndj_f |
---|
508 | ! ... scalar wind at T-point (fld being at T-point) |
---|
509 | zwndi_t = sf(jp_wndi)%fnow(ji,jj,1) - 0.25 * ( pui(ji,jj+1) + pui(ji+1,jj+1) & |
---|
510 | & + pui(ji,jj ) + pui(ji+1,jj ) ) |
---|
511 | zwndj_t = sf(jp_wndj)%fnow(ji,jj,1) - 0.25 * ( pvi(ji,jj+1) + pvi(ji+1,jj+1) & |
---|
512 | & + pvi(ji,jj ) + pvi(ji+1,jj ) ) |
---|
513 | z_wnds_t(ji,jj) = SQRT( zwndi_t * zwndi_t + zwndj_t * zwndj_t ) * tmask(ji,jj,1) |
---|
514 | END DO |
---|
515 | END DO |
---|
516 | CALL lbc_lnk( p_taui , 'I', -1. ) |
---|
517 | CALL lbc_lnk( p_tauj , 'I', -1. ) |
---|
518 | CALL lbc_lnk( z_wnds_t, 'T', 1. ) |
---|
519 | ! |
---|
520 | CASE( 'C' ) ! C-grid ice dynamics : U & V-points (same as ocean) |
---|
521 | #if defined key_vectopt_loop |
---|
522 | !CDIR COLLAPSE |
---|
523 | #endif |
---|
524 | DO jj = 2, jpj |
---|
525 | DO ji = fs_2, jpi ! vect. opt. |
---|
526 | zwndi_t = ( sf(jp_wndi)%fnow(ji,jj,1) - 0.5 * ( pui(ji-1,jj ) + pui(ji,jj) ) ) |
---|
527 | zwndj_t = ( sf(jp_wndj)%fnow(ji,jj,1) - 0.5 * ( pvi(ji ,jj-1) + pvi(ji,jj) ) ) |
---|
528 | z_wnds_t(ji,jj) = SQRT( zwndi_t * zwndi_t + zwndj_t * zwndj_t ) * tmask(ji,jj,1) |
---|
529 | END DO |
---|
530 | END DO |
---|
531 | #if defined key_vectopt_loop |
---|
532 | !CDIR COLLAPSE |
---|
533 | #endif |
---|
534 | DO jj = 2, jpjm1 |
---|
535 | DO ji = fs_2, fs_jpim1 ! vect. opt. |
---|
536 | p_taui(ji,jj) = zcoef_wnorm2 * ( z_wnds_t(ji+1,jj ) + z_wnds_t(ji,jj) ) & |
---|
537 | & * ( 0.5 * (sf(jp_wndi)%fnow(ji+1,jj,1) + sf(jp_wndi)%fnow(ji,jj,1) ) - pui(ji,jj) ) |
---|
538 | p_tauj(ji,jj) = zcoef_wnorm2 * ( z_wnds_t(ji,jj+1 ) + z_wnds_t(ji,jj) ) & |
---|
539 | & * ( 0.5 * (sf(jp_wndj)%fnow(ji,jj+1,1) + sf(jp_wndj)%fnow(ji,jj,1) ) - pvi(ji,jj) ) |
---|
540 | END DO |
---|
541 | END DO |
---|
542 | CALL lbc_lnk( p_taui , 'U', -1. ) |
---|
543 | CALL lbc_lnk( p_tauj , 'V', -1. ) |
---|
544 | CALL lbc_lnk( z_wnds_t, 'T', 1. ) |
---|
545 | ! |
---|
546 | END SELECT |
---|
547 | |
---|
548 | zztmp = 1. / ( 1. - albo ) |
---|
549 | ! ! ========================== ! |
---|
550 | DO jl = 1, ijpl ! Loop over ice categories ! |
---|
551 | ! ! ========================== ! |
---|
552 | !CDIR NOVERRCHK |
---|
553 | !CDIR COLLAPSE |
---|
554 | DO jj = 1 , jpj |
---|
555 | !CDIR NOVERRCHK |
---|
556 | DO ji = 1, jpi |
---|
557 | ! ----------------------------! |
---|
558 | ! I Radiative FLUXES ! |
---|
559 | ! ----------------------------! |
---|
560 | zst2 = pst(ji,jj,jl) * pst(ji,jj,jl) |
---|
561 | zst3 = pst(ji,jj,jl) * zst2 |
---|
562 | ! Short Wave (sw) |
---|
563 | p_qsr(ji,jj,jl) = zztmp * ( 1. - palb(ji,jj,jl) ) * qsr(ji,jj) |
---|
564 | ! Long Wave (lw) |
---|
565 | z_qlw(ji,jj,jl) = 0.95 * ( sf(jp_qlw)%fnow(ji,jj,1) - Stef * pst(ji,jj,jl) * zst3 ) * tmask(ji,jj,1) |
---|
566 | ! lw sensitivity |
---|
567 | z_dqlw(ji,jj,jl) = zcoef_dqlw * zst3 |
---|
568 | |
---|
569 | ! ----------------------------! |
---|
570 | ! II Turbulent FLUXES ! |
---|
571 | ! ----------------------------! |
---|
572 | |
---|
573 | ! ... turbulent heat fluxes |
---|
574 | ! Sensible Heat |
---|
575 | z_qsb(ji,jj,jl) = rhoa * cpa * Cice * z_wnds_t(ji,jj) * ( pst(ji,jj,jl) - sf(jp_tair)%fnow(ji,jj,1) ) |
---|
576 | ! Latent Heat |
---|
577 | p_qla(ji,jj,jl) = MAX( 0.e0, rhoa * Ls * Cice * z_wnds_t(ji,jj) & |
---|
578 | & * ( 11637800. * EXP( -5897.8 / pst(ji,jj,jl) ) / rhoa - sf(jp_humi)%fnow(ji,jj,1) ) ) |
---|
579 | ! Latent heat sensitivity for ice (Dqla/Dt) |
---|
580 | p_dqla(ji,jj,jl) = zcoef_dqla * z_wnds_t(ji,jj) / ( zst2 ) * EXP( -5897.8 / pst(ji,jj,jl) ) |
---|
581 | ! Sensible heat sensitivity (Dqsb_ice/Dtn_ice) |
---|
582 | z_dqsb(ji,jj,jl) = zcoef_dqsb * z_wnds_t(ji,jj) |
---|
583 | |
---|
584 | ! ----------------------------! |
---|
585 | ! III Total FLUXES ! |
---|
586 | ! ----------------------------! |
---|
587 | ! Downward Non Solar flux |
---|
588 | p_qns (ji,jj,jl) = z_qlw (ji,jj,jl) - z_qsb (ji,jj,jl) - p_qla (ji,jj,jl) |
---|
589 | ! Total non solar heat flux sensitivity for ice |
---|
590 | p_dqns(ji,jj,jl) = - ( z_dqlw(ji,jj,jl) + z_dqsb(ji,jj,jl) + p_dqla(ji,jj,jl) ) |
---|
591 | END DO |
---|
592 | ! |
---|
593 | END DO |
---|
594 | ! |
---|
595 | END DO |
---|
596 | ! |
---|
597 | !-------------------------------------------------------------------- |
---|
598 | ! FRACTIONs of net shortwave radiation which is not absorbed in the |
---|
599 | ! thin surface layer and penetrates inside the ice cover |
---|
600 | ! ( Maykut and Untersteiner, 1971 ; Ebert and Curry, 1993 ) |
---|
601 | |
---|
602 | !CDIR COLLAPSE |
---|
603 | p_fr1(:,:) = ( 0.18 * ( 1.0 - zcoef_frca ) + 0.35 * zcoef_frca ) |
---|
604 | !CDIR COLLAPSE |
---|
605 | p_fr2(:,:) = ( 0.82 * ( 1.0 - zcoef_frca ) + 0.65 * zcoef_frca ) |
---|
606 | |
---|
607 | !CDIR COLLAPSE |
---|
608 | p_tpr(:,:) = sf(jp_prec)%fnow(:,:,1) * rn_pfac ! total precipitation [kg/m2/s] |
---|
609 | !CDIR COLLAPSE |
---|
610 | p_spr(:,:) = sf(jp_snow)%fnow(:,:,1) * rn_pfac ! solid precipitation [kg/m2/s] |
---|
611 | CALL iom_put( 'snowpre', p_spr ) ! Snow precipitation |
---|
612 | ! |
---|
613 | IF(ln_ctl) THEN |
---|
614 | CALL prt_ctl(tab3d_1=p_qla , clinfo1=' blk_ice_core: p_qla : ', tab3d_2=z_qsb , clinfo2=' z_qsb : ', kdim=ijpl) |
---|
615 | CALL prt_ctl(tab3d_1=z_qlw , clinfo1=' blk_ice_core: z_qlw : ', tab3d_2=p_dqla , clinfo2=' p_dqla : ', kdim=ijpl) |
---|
616 | CALL prt_ctl(tab3d_1=z_dqsb , clinfo1=' blk_ice_core: z_dqsb : ', tab3d_2=z_dqlw , clinfo2=' z_dqlw : ', kdim=ijpl) |
---|
617 | CALL prt_ctl(tab3d_1=p_dqns , clinfo1=' blk_ice_core: p_dqns : ', tab3d_2=p_qsr , clinfo2=' p_qsr : ', kdim=ijpl) |
---|
618 | CALL prt_ctl(tab3d_1=pst , clinfo1=' blk_ice_core: pst : ', tab3d_2=p_qns , clinfo2=' p_qns : ', kdim=ijpl) |
---|
619 | CALL prt_ctl(tab2d_1=p_tpr , clinfo1=' blk_ice_core: p_tpr : ', tab2d_2=p_spr , clinfo2=' p_spr : ') |
---|
620 | CALL prt_ctl(tab2d_1=p_taui , clinfo1=' blk_ice_core: p_taui : ', tab2d_2=p_tauj , clinfo2=' p_tauj : ') |
---|
621 | CALL prt_ctl(tab2d_1=z_wnds_t, clinfo1=' blk_ice_core: z_wnds_t : ') |
---|
622 | ENDIF |
---|
623 | |
---|
624 | CALL wrk_dealloc( jpi,jpj, z_wnds_t ) |
---|
625 | CALL wrk_dealloc( jpi,jpj,pdim, z_qlw, z_qsb, z_dqlw, z_dqsb ) |
---|
626 | ! |
---|
627 | IF( nn_timing == 1 ) CALL timing_stop('blk_ice_core') |
---|
628 | ! |
---|
629 | END SUBROUTINE blk_ice_core |
---|
630 | |
---|
631 | |
---|
632 | SUBROUTINE TURB_CORE_1Z(zu, sst, T_a, q_sat, q_a, & |
---|
633 | & dU , Cd , Ch , Ce ) |
---|
634 | !!---------------------------------------------------------------------- |
---|
635 | !! *** ROUTINE turb_core *** |
---|
636 | !! |
---|
637 | !! ** Purpose : Computes turbulent transfert coefficients of surface |
---|
638 | !! fluxes according to Large & Yeager (2004) |
---|
639 | !! |
---|
640 | !! ** Method : I N E R T I A L D I S S I P A T I O N M E T H O D |
---|
641 | !! Momentum, Latent and sensible heat exchange coefficients |
---|
642 | !! Caution: this procedure should only be used in cases when air |
---|
643 | !! temperature (T_air), air specific humidity (q_air) and wind (dU) |
---|
644 | !! are provided at the same height 'zzu'! |
---|
645 | !! |
---|
646 | !! References : Large & Yeager, 2004 : ??? |
---|
647 | !!---------------------------------------------------------------------- |
---|
648 | REAL(wp) , INTENT(in ) :: zu ! altitude of wind measurement [m] |
---|
649 | REAL(wp), DIMENSION(:,:), INTENT(in ) :: sst ! sea surface temperature [Kelvin] |
---|
650 | REAL(wp), DIMENSION(:,:), INTENT(in ) :: T_a ! potential air temperature [Kelvin] |
---|
651 | REAL(wp), DIMENSION(:,:), INTENT(in ) :: q_sat ! sea surface specific humidity [kg/kg] |
---|
652 | REAL(wp), DIMENSION(:,:), INTENT(in ) :: q_a ! specific air humidity [kg/kg] |
---|
653 | REAL(wp), DIMENSION(:,:), INTENT(in ) :: dU ! wind module |U(zu)-U(0)| [m/s] |
---|
654 | REAL(wp), DIMENSION(:,:), INTENT( out) :: Cd ! transfert coefficient for momentum (tau) |
---|
655 | REAL(wp), DIMENSION(:,:), INTENT( out) :: Ch ! transfert coefficient for temperature (Q_sens) |
---|
656 | REAL(wp), DIMENSION(:,:), INTENT( out) :: Ce ! transfert coefficient for evaporation (Q_lat) |
---|
657 | !! |
---|
658 | INTEGER :: j_itt |
---|
659 | INTEGER , PARAMETER :: nb_itt = 3 |
---|
660 | REAL(wp), PARAMETER :: grav = 9.8 ! gravity |
---|
661 | REAL(wp), PARAMETER :: kappa = 0.4 ! von Karman s constant |
---|
662 | |
---|
663 | REAL(wp), DIMENSION(:,:), POINTER :: dU10 ! dU [m/s] |
---|
664 | REAL(wp), DIMENSION(:,:), POINTER :: dT ! air/sea temperature differeence [K] |
---|
665 | REAL(wp), DIMENSION(:,:), POINTER :: dq ! air/sea humidity difference [K] |
---|
666 | REAL(wp), DIMENSION(:,:), POINTER :: Cd_n10 ! 10m neutral drag coefficient |
---|
667 | REAL(wp), DIMENSION(:,:), POINTER :: Ce_n10 ! 10m neutral latent coefficient |
---|
668 | REAL(wp), DIMENSION(:,:), POINTER :: Ch_n10 ! 10m neutral sensible coefficient |
---|
669 | REAL(wp), DIMENSION(:,:), POINTER :: sqrt_Cd_n10 ! root square of Cd_n10 |
---|
670 | REAL(wp), DIMENSION(:,:), POINTER :: sqrt_Cd ! root square of Cd |
---|
671 | REAL(wp), DIMENSION(:,:), POINTER :: T_vpot ! virtual potential temperature [K] |
---|
672 | REAL(wp), DIMENSION(:,:), POINTER :: T_star ! turbulent scale of tem. fluct. |
---|
673 | REAL(wp), DIMENSION(:,:), POINTER :: q_star ! turbulent humidity of temp. fluct. |
---|
674 | REAL(wp), DIMENSION(:,:), POINTER :: U_star ! turb. scale of velocity fluct. |
---|
675 | REAL(wp), DIMENSION(:,:), POINTER :: L ! Monin-Obukov length [m] |
---|
676 | REAL(wp), DIMENSION(:,:), POINTER :: zeta ! stability parameter at height zu |
---|
677 | REAL(wp), DIMENSION(:,:), POINTER :: U_n10 ! neutral wind velocity at 10m [m] |
---|
678 | REAL(wp), DIMENSION(:,:), POINTER :: xlogt, xct, zpsi_h, zpsi_m |
---|
679 | |
---|
680 | INTEGER , DIMENSION(:,:), POINTER :: stab ! 1st guess stability test integer |
---|
681 | !!---------------------------------------------------------------------- |
---|
682 | ! |
---|
683 | IF( nn_timing == 1 ) CALL timing_start('TURB_CORE_1Z') |
---|
684 | ! |
---|
685 | CALL wrk_alloc( jpi,jpj, stab ) ! integer |
---|
686 | CALL wrk_alloc( jpi,jpj, dU10, dT, dq, Cd_n10, Ce_n10, Ch_n10, sqrt_Cd_n10, sqrt_Cd, L ) |
---|
687 | CALL wrk_alloc( jpi,jpj, T_vpot, T_star, q_star, U_star, zeta, U_n10, xlogt, xct, zpsi_h, zpsi_m ) |
---|
688 | |
---|
689 | !! * Start |
---|
690 | !! Air/sea differences |
---|
691 | dU10 = max(0.5, dU) ! we don't want to fall under 0.5 m/s |
---|
692 | dT = T_a - sst ! assuming that T_a is allready the potential temp. at zzu |
---|
693 | dq = q_a - q_sat |
---|
694 | !! |
---|
695 | !! Virtual potential temperature |
---|
696 | T_vpot = T_a*(1. + 0.608*q_a) |
---|
697 | !! |
---|
698 | !! Neutral Drag Coefficient |
---|
699 | stab = 0.5 + sign(0.5,dT) ! stable : stab = 1 ; unstable : stab = 0 |
---|
700 | IF ( ln_cdgw ) THEN |
---|
701 | cdn_wave = cdn_wave - rsmall*(tmask(:,:,1)-1) |
---|
702 | Cd_n10(:,:) = cdn_wave |
---|
703 | ELSE |
---|
704 | Cd_n10 = 1E-3 * ( 2.7/dU10 + 0.142 + dU10/13.09 ) ! L & Y eq. (6a) |
---|
705 | ENDIF |
---|
706 | sqrt_Cd_n10 = sqrt(Cd_n10) |
---|
707 | Ce_n10 = 1E-3 * ( 34.6 * sqrt_Cd_n10 ) ! L & Y eq. (6b) |
---|
708 | Ch_n10 = 1E-3*sqrt_Cd_n10*(18*stab + 32.7*(1-stab)) ! L & Y eq. (6c), (6d) |
---|
709 | !! |
---|
710 | !! Initializing transfert coefficients with their first guess neutral equivalents : |
---|
711 | Cd = Cd_n10 ; Ce = Ce_n10 ; Ch = Ch_n10 ; sqrt_Cd = sqrt(Cd) |
---|
712 | |
---|
713 | !! * Now starting iteration loop |
---|
714 | DO j_itt=1, nb_itt |
---|
715 | !! Turbulent scales : |
---|
716 | U_star = sqrt_Cd*dU10 ! L & Y eq. (7a) |
---|
717 | T_star = Ch/sqrt_Cd*dT ! L & Y eq. (7b) |
---|
718 | q_star = Ce/sqrt_Cd*dq ! L & Y eq. (7c) |
---|
719 | |
---|
720 | !! Estimate the Monin-Obukov length : |
---|
721 | L = (U_star**2)/( kappa*grav*(T_star/T_vpot + q_star/(q_a + 1./0.608)) ) |
---|
722 | |
---|
723 | !! Stability parameters : |
---|
724 | zeta = zu/L ; zeta = sign( min(abs(zeta),10.0), zeta ) |
---|
725 | zpsi_h = psi_h(zeta) |
---|
726 | zpsi_m = psi_m(zeta) |
---|
727 | |
---|
728 | IF ( ln_cdgw ) THEN |
---|
729 | sqrt_Cd=kappa/((kappa/sqrt_Cd_n10) - zpsi_m) ; Cd=sqrt_Cd*sqrt_Cd; |
---|
730 | ELSE |
---|
731 | !! Shifting the wind speed to 10m and neutral stability : |
---|
732 | U_n10 = dU10*1./(1. + sqrt_Cd_n10/kappa*(log(zu/10.) - zpsi_m)) ! L & Y eq. (9a) |
---|
733 | |
---|
734 | !! Updating the neutral 10m transfer coefficients : |
---|
735 | Cd_n10 = 1E-3 * (2.7/U_n10 + 0.142 + U_n10/13.09) ! L & Y eq. (6a) |
---|
736 | sqrt_Cd_n10 = sqrt(Cd_n10) |
---|
737 | Ce_n10 = 1E-3 * (34.6 * sqrt_Cd_n10) ! L & Y eq. (6b) |
---|
738 | stab = 0.5 + sign(0.5,zeta) |
---|
739 | Ch_n10 = 1E-3*sqrt_Cd_n10*(18.*stab + 32.7*(1-stab)) ! L & Y eq. (6c), (6d) |
---|
740 | |
---|
741 | !! Shifting the neutral 10m transfer coefficients to ( zu , zeta ) : |
---|
742 | !! |
---|
743 | xct = 1. + sqrt_Cd_n10/kappa*(log(zu/10) - zpsi_m) |
---|
744 | Cd = Cd_n10/(xct*xct) ; sqrt_Cd = sqrt(Cd) |
---|
745 | ENDIF |
---|
746 | !! |
---|
747 | xlogt = log(zu/10.) - zpsi_h |
---|
748 | !! |
---|
749 | xct = 1. + Ch_n10*xlogt/kappa/sqrt_Cd_n10 |
---|
750 | Ch = Ch_n10*sqrt_Cd/sqrt_Cd_n10/xct |
---|
751 | !! |
---|
752 | xct = 1. + Ce_n10*xlogt/kappa/sqrt_Cd_n10 |
---|
753 | Ce = Ce_n10*sqrt_Cd/sqrt_Cd_n10/xct |
---|
754 | !! |
---|
755 | END DO |
---|
756 | !! |
---|
757 | CALL wrk_dealloc( jpi,jpj, stab ) ! integer |
---|
758 | CALL wrk_dealloc( jpi,jpj, dU10, dT, dq, Cd_n10, Ce_n10, Ch_n10, sqrt_Cd_n10, sqrt_Cd, L ) |
---|
759 | CALL wrk_dealloc( jpi,jpj, T_vpot, T_star, q_star, U_star, zeta, U_n10, xlogt, xct, zpsi_h, zpsi_m ) |
---|
760 | ! |
---|
761 | IF( nn_timing == 1 ) CALL timing_stop('TURB_CORE_1Z') |
---|
762 | ! |
---|
763 | END SUBROUTINE TURB_CORE_1Z |
---|
764 | |
---|
765 | |
---|
766 | SUBROUTINE TURB_CORE_2Z(zt, zu, sst, T_zt, q_sat, q_zt, dU, Cd, Ch, Ce, T_zu, q_zu) |
---|
767 | !!---------------------------------------------------------------------- |
---|
768 | !! *** ROUTINE turb_core *** |
---|
769 | !! |
---|
770 | !! ** Purpose : Computes turbulent transfert coefficients of surface |
---|
771 | !! fluxes according to Large & Yeager (2004). |
---|
772 | !! |
---|
773 | !! ** Method : I N E R T I A L D I S S I P A T I O N M E T H O D |
---|
774 | !! Momentum, Latent and sensible heat exchange coefficients |
---|
775 | !! Caution: this procedure should only be used in cases when air |
---|
776 | !! temperature (T_air) and air specific humidity (q_air) are at 2m |
---|
777 | !! whereas wind (dU) is at 10m. |
---|
778 | !! |
---|
779 | !! References : Large & Yeager, 2004 : ??? |
---|
780 | !!---------------------------------------------------------------------- |
---|
781 | REAL(wp), INTENT(in ) :: zt ! height for T_zt and q_zt [m] |
---|
782 | REAL(wp), INTENT(in ) :: zu ! height for dU [m] |
---|
783 | REAL(wp), INTENT(in ), DIMENSION(jpi,jpj) :: sst ! sea surface temperature [Kelvin] |
---|
784 | REAL(wp), INTENT(in ), DIMENSION(jpi,jpj) :: T_zt ! potential air temperature [Kelvin] |
---|
785 | REAL(wp), INTENT(in ), DIMENSION(jpi,jpj) :: q_sat ! sea surface specific humidity [kg/kg] |
---|
786 | REAL(wp), INTENT(in ), DIMENSION(jpi,jpj) :: q_zt ! specific air humidity [kg/kg] |
---|
787 | REAL(wp), INTENT(in ), DIMENSION(jpi,jpj) :: dU ! relative wind module |U(zu)-U(0)| [m/s] |
---|
788 | REAL(wp), INTENT( out), DIMENSION(jpi,jpj) :: Cd ! transfer coefficient for momentum (tau) |
---|
789 | REAL(wp), INTENT( out), DIMENSION(jpi,jpj) :: Ch ! transfer coefficient for sensible heat (Q_sens) |
---|
790 | REAL(wp), INTENT( out), DIMENSION(jpi,jpj) :: Ce ! transfert coefficient for evaporation (Q_lat) |
---|
791 | REAL(wp), INTENT( out), DIMENSION(jpi,jpj) :: T_zu ! air temp. shifted at zu [K] |
---|
792 | REAL(wp), INTENT( out), DIMENSION(jpi,jpj) :: q_zu ! spec. hum. shifted at zu [kg/kg] |
---|
793 | |
---|
794 | INTEGER :: j_itt |
---|
795 | INTEGER , PARAMETER :: nb_itt = 3 ! number of itterations |
---|
796 | REAL(wp), PARAMETER :: grav = 9.8 ! gravity |
---|
797 | REAL(wp), PARAMETER :: kappa = 0.4 ! von Karman's constant |
---|
798 | |
---|
799 | REAL(wp), DIMENSION(:,:), POINTER :: dU10 ! dU [m/s] |
---|
800 | REAL(wp), DIMENSION(:,:), POINTER :: dT ! air/sea temperature differeence [K] |
---|
801 | REAL(wp), DIMENSION(:,:), POINTER :: dq ! air/sea humidity difference [K] |
---|
802 | REAL(wp), DIMENSION(:,:), POINTER :: Cd_n10 ! 10m neutral drag coefficient |
---|
803 | REAL(wp), DIMENSION(:,:), POINTER :: Ce_n10 ! 10m neutral latent coefficient |
---|
804 | REAL(wp), DIMENSION(:,:), POINTER :: Ch_n10 ! 10m neutral sensible coefficient |
---|
805 | REAL(wp), DIMENSION(:,:), POINTER :: sqrt_Cd_n10 ! root square of Cd_n10 |
---|
806 | REAL(wp), DIMENSION(:,:), POINTER :: sqrt_Cd ! root square of Cd |
---|
807 | REAL(wp), DIMENSION(:,:), POINTER :: T_vpot ! virtual potential temperature [K] |
---|
808 | REAL(wp), DIMENSION(:,:), POINTER :: T_star ! turbulent scale of tem. fluct. |
---|
809 | REAL(wp), DIMENSION(:,:), POINTER :: q_star ! turbulent humidity of temp. fluct. |
---|
810 | REAL(wp), DIMENSION(:,:), POINTER :: U_star ! turb. scale of velocity fluct. |
---|
811 | REAL(wp), DIMENSION(:,:), POINTER :: L ! Monin-Obukov length [m] |
---|
812 | REAL(wp), DIMENSION(:,:), POINTER :: zeta_u ! stability parameter at height zu |
---|
813 | REAL(wp), DIMENSION(:,:), POINTER :: zeta_t ! stability parameter at height zt |
---|
814 | REAL(wp), DIMENSION(:,:), POINTER :: U_n10 ! neutral wind velocity at 10m [m] |
---|
815 | REAL(wp), DIMENSION(:,:), POINTER :: xlogt, xct, zpsi_hu, zpsi_ht, zpsi_m |
---|
816 | |
---|
817 | INTEGER , DIMENSION(:,:), POINTER :: stab ! 1st stability test integer |
---|
818 | !!---------------------------------------------------------------------- |
---|
819 | ! |
---|
820 | IF( nn_timing == 1 ) CALL timing_start('TURB_CORE_2Z') |
---|
821 | ! |
---|
822 | CALL wrk_alloc( jpi,jpj, dU10, dT, dq, Cd_n10, Ce_n10, Ch_n10, sqrt_Cd_n10, sqrt_Cd, L ) |
---|
823 | CALL wrk_alloc( jpi,jpj, T_vpot, T_star, q_star, U_star, zeta_u, zeta_t, U_n10 ) |
---|
824 | CALL wrk_alloc( jpi,jpj, xlogt, xct, zpsi_hu, zpsi_ht, zpsi_m ) |
---|
825 | CALL wrk_alloc( jpi,jpj, stab ) ! interger |
---|
826 | |
---|
827 | !! Initial air/sea differences |
---|
828 | dU10 = max(0.5, dU) ! we don't want to fall under 0.5 m/s |
---|
829 | dT = T_zt - sst |
---|
830 | dq = q_zt - q_sat |
---|
831 | |
---|
832 | !! Neutral Drag Coefficient : |
---|
833 | stab = 0.5 + sign(0.5,dT) ! stab = 1 if dT > 0 -> STABLE |
---|
834 | IF( ln_cdgw ) THEN |
---|
835 | cdn_wave = cdn_wave - rsmall*(tmask(:,:,1)-1) |
---|
836 | Cd_n10(:,:) = cdn_wave |
---|
837 | ELSE |
---|
838 | Cd_n10 = 1E-3*( 2.7/dU10 + 0.142 + dU10/13.09 ) |
---|
839 | ENDIF |
---|
840 | sqrt_Cd_n10 = sqrt(Cd_n10) |
---|
841 | Ce_n10 = 1E-3*( 34.6 * sqrt_Cd_n10 ) |
---|
842 | Ch_n10 = 1E-3*sqrt_Cd_n10*(18*stab + 32.7*(1 - stab)) |
---|
843 | |
---|
844 | !! Initializing transf. coeff. with their first guess neutral equivalents : |
---|
845 | Cd = Cd_n10 ; Ce = Ce_n10 ; Ch = Ch_n10 ; sqrt_Cd = sqrt(Cd) |
---|
846 | |
---|
847 | !! Initializing z_u values with z_t values : |
---|
848 | T_zu = T_zt ; q_zu = q_zt |
---|
849 | |
---|
850 | !! * Now starting iteration loop |
---|
851 | DO j_itt=1, nb_itt |
---|
852 | dT = T_zu - sst ; dq = q_zu - q_sat ! Updating air/sea differences |
---|
853 | T_vpot = T_zu*(1. + 0.608*q_zu) ! Updating virtual potential temperature at zu |
---|
854 | U_star = sqrt_Cd*dU10 ! Updating turbulent scales : (L & Y eq. (7)) |
---|
855 | T_star = Ch/sqrt_Cd*dT ! |
---|
856 | q_star = Ce/sqrt_Cd*dq ! |
---|
857 | !! |
---|
858 | L = (U_star*U_star) & ! Estimate the Monin-Obukov length at height zu |
---|
859 | & / (kappa*grav/T_vpot*(T_star*(1.+0.608*q_zu) + 0.608*T_zu*q_star)) |
---|
860 | !! Stability parameters : |
---|
861 | zeta_u = zu/L ; zeta_u = sign( min(abs(zeta_u),10.0), zeta_u ) |
---|
862 | zeta_t = zt/L ; zeta_t = sign( min(abs(zeta_t),10.0), zeta_t ) |
---|
863 | zpsi_hu = psi_h(zeta_u) |
---|
864 | zpsi_ht = psi_h(zeta_t) |
---|
865 | zpsi_m = psi_m(zeta_u) |
---|
866 | !! |
---|
867 | !! Shifting the wind speed to 10m and neutral stability : (L & Y eq.(9a)) |
---|
868 | ! U_n10 = dU10/(1. + sqrt_Cd_n10/kappa*(log(zu/10.) - psi_m(zeta_u))) |
---|
869 | U_n10 = dU10/(1. + sqrt_Cd_n10/kappa*(log(zu/10.) - zpsi_m)) |
---|
870 | !! |
---|
871 | !! Shifting temperature and humidity at zu : (L & Y eq. (9b-9c)) |
---|
872 | ! T_zu = T_zt - T_star/kappa*(log(zt/zu) + psi_h(zeta_u) - psi_h(zeta_t)) |
---|
873 | T_zu = T_zt - T_star/kappa*(log(zt/zu) + zpsi_hu - zpsi_ht) |
---|
874 | ! q_zu = q_zt - q_star/kappa*(log(zt/zu) + psi_h(zeta_u) - psi_h(zeta_t)) |
---|
875 | q_zu = q_zt - q_star/kappa*(log(zt/zu) + zpsi_hu - zpsi_ht) |
---|
876 | !! |
---|
877 | !! q_zu cannot have a negative value : forcing 0 |
---|
878 | stab = 0.5 + sign(0.5,q_zu) ; q_zu = stab*q_zu |
---|
879 | !! |
---|
880 | IF( ln_cdgw ) THEN |
---|
881 | sqrt_Cd=kappa/((kappa/sqrt_Cd_n10) - zpsi_m) ; Cd=sqrt_Cd*sqrt_Cd; |
---|
882 | ELSE |
---|
883 | !! Updating the neutral 10m transfer coefficients : |
---|
884 | Cd_n10 = 1E-3 * (2.7/U_n10 + 0.142 + U_n10/13.09) ! L & Y eq. (6a) |
---|
885 | sqrt_Cd_n10 = sqrt(Cd_n10) |
---|
886 | Ce_n10 = 1E-3 * (34.6 * sqrt_Cd_n10) ! L & Y eq. (6b) |
---|
887 | stab = 0.5 + sign(0.5,zeta_u) |
---|
888 | Ch_n10 = 1E-3*sqrt_Cd_n10*(18.*stab + 32.7*(1-stab)) ! L & Y eq. (6c-6d) |
---|
889 | !! |
---|
890 | !! |
---|
891 | !! Shifting the neutral 10m transfer coefficients to (zu,zeta_u) : |
---|
892 | xct = 1. + sqrt_Cd_n10/kappa*(log(zu/10.) - zpsi_m) |
---|
893 | Cd = Cd_n10/(xct*xct) ; sqrt_Cd = sqrt(Cd) |
---|
894 | ENDIF |
---|
895 | !! |
---|
896 | xlogt = log(zu/10.) - zpsi_hu |
---|
897 | !! |
---|
898 | xct = 1. + Ch_n10*xlogt/kappa/sqrt_Cd_n10 |
---|
899 | Ch = Ch_n10*sqrt_Cd/sqrt_Cd_n10/xct |
---|
900 | !! |
---|
901 | xct = 1. + Ce_n10*xlogt/kappa/sqrt_Cd_n10 |
---|
902 | Ce = Ce_n10*sqrt_Cd/sqrt_Cd_n10/xct |
---|
903 | !! |
---|
904 | !! |
---|
905 | END DO |
---|
906 | !! |
---|
907 | CALL wrk_dealloc( jpi,jpj, dU10, dT, dq, Cd_n10, Ce_n10, Ch_n10, sqrt_Cd_n10, sqrt_Cd, L ) |
---|
908 | CALL wrk_dealloc( jpi,jpj, T_vpot, T_star, q_star, U_star, zeta_u, zeta_t, U_n10 ) |
---|
909 | CALL wrk_dealloc( jpi,jpj, xlogt, xct, zpsi_hu, zpsi_ht, zpsi_m ) |
---|
910 | CALL wrk_dealloc( jpi,jpj, stab ) ! interger |
---|
911 | ! |
---|
912 | IF( nn_timing == 1 ) CALL timing_stop('TURB_CORE_2Z') |
---|
913 | ! |
---|
914 | END SUBROUTINE TURB_CORE_2Z |
---|
915 | |
---|
916 | |
---|
917 | FUNCTION psi_m(zta) !! Psis, L & Y eq. (8c), (8d), (8e) |
---|
918 | !------------------------------------------------------------------------------- |
---|
919 | REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: zta |
---|
920 | |
---|
921 | REAL(wp), PARAMETER :: pi = 3.141592653589793_wp |
---|
922 | REAL(wp), DIMENSION(jpi,jpj) :: psi_m |
---|
923 | REAL(wp), DIMENSION(:,:), POINTER :: X2, X, stabit |
---|
924 | !------------------------------------------------------------------------------- |
---|
925 | |
---|
926 | CALL wrk_alloc( jpi,jpj, X2, X, stabit ) |
---|
927 | |
---|
928 | X2 = sqrt(abs(1. - 16.*zta)) ; X2 = max(X2 , 1.0) ; X = sqrt(X2) |
---|
929 | stabit = 0.5 + sign(0.5,zta) |
---|
930 | psi_m = -5.*zta*stabit & ! Stable |
---|
931 | & + (1. - stabit)*(2*log((1. + X)/2) + log((1. + X2)/2) - 2*atan(X) + pi/2) ! Unstable |
---|
932 | |
---|
933 | CALL wrk_dealloc( jpi,jpj, X2, X, stabit ) |
---|
934 | ! |
---|
935 | END FUNCTION psi_m |
---|
936 | |
---|
937 | |
---|
938 | FUNCTION psi_h( zta ) !! Psis, L & Y eq. (8c), (8d), (8e) |
---|
939 | !------------------------------------------------------------------------------- |
---|
940 | REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: zta |
---|
941 | ! |
---|
942 | REAL(wp), DIMENSION(jpi,jpj) :: psi_h |
---|
943 | REAL(wp), DIMENSION(:,:), POINTER :: X2, X, stabit |
---|
944 | !------------------------------------------------------------------------------- |
---|
945 | |
---|
946 | CALL wrk_alloc( jpi,jpj, X2, X, stabit ) |
---|
947 | |
---|
948 | X2 = sqrt(abs(1. - 16.*zta)) ; X2 = max(X2 , 1.) ; X = sqrt(X2) |
---|
949 | stabit = 0.5 + sign(0.5,zta) |
---|
950 | psi_h = -5.*zta*stabit & ! Stable |
---|
951 | & + (1. - stabit)*(2.*log( (1. + X2)/2. )) ! Unstable |
---|
952 | |
---|
953 | CALL wrk_dealloc( jpi,jpj, X2, X, stabit ) |
---|
954 | ! |
---|
955 | END FUNCTION psi_h |
---|
956 | |
---|
957 | !!====================================================================== |
---|
958 | END MODULE sbcblk_core |
---|