1 | MODULE traqsr |
---|
2 | !!====================================================================== |
---|
3 | !! *** MODULE traqsr *** |
---|
4 | !! Ocean physics: solar radiation penetration in the top ocean levels |
---|
5 | !!====================================================================== |
---|
6 | !! History : OPA ! 1990-10 (B. Blanke) Original code |
---|
7 | !! 7.0 ! 1991-11 (G. Madec) |
---|
8 | !! ! 1996-01 (G. Madec) s-coordinates |
---|
9 | !! NEMO 1.0 ! 2002-06 (G. Madec) F90: Free form and module |
---|
10 | !! - ! 2005-11 (G. Madec) zco, zps, sco coordinate |
---|
11 | !! 3.2 ! 2009-04 (G. Madec & NEMO team) |
---|
12 | !! 3.4 ! 2012-05 (C. Rousset) store attenuation coef for use in ice model |
---|
13 | !! 3.6 ! 2015-12 (O. Aumont, J. Jouanno, C. Ethe) use vertical profile of chlorophyll |
---|
14 | !!---------------------------------------------------------------------- |
---|
15 | |
---|
16 | !!---------------------------------------------------------------------- |
---|
17 | !! tra_qsr : trend due to the solar radiation penetration |
---|
18 | !! tra_qsr_init : solar radiation penetration initialization |
---|
19 | !!---------------------------------------------------------------------- |
---|
20 | USE oce ! ocean dynamics and active tracers |
---|
21 | USE dom_oce ! ocean space and time domain |
---|
22 | USE sbc_oce ! surface boundary condition: ocean |
---|
23 | USE trc_oce ! share SMS/Ocean variables |
---|
24 | USE trd_oce ! trends: ocean variables |
---|
25 | USE trdtra ! trends manager: tracers |
---|
26 | USE in_out_manager ! I/O manager |
---|
27 | USE phycst ! physical constants |
---|
28 | USE prtctl ! Print control |
---|
29 | USE iom ! I/O manager |
---|
30 | USE fldread ! read input fields |
---|
31 | USE restart ! ocean restart |
---|
32 | USE lib_mpp ! MPP library |
---|
33 | USE wrk_nemo ! Memory Allocation |
---|
34 | USE timing ! Timing |
---|
35 | |
---|
36 | IMPLICIT NONE |
---|
37 | PRIVATE |
---|
38 | |
---|
39 | PUBLIC tra_qsr ! routine called by step.F90 (ln_traqsr=T) |
---|
40 | PUBLIC tra_qsr_init ! routine called by nemogcm.F90 |
---|
41 | |
---|
42 | ! !!* Namelist namtra_qsr: penetrative solar radiation |
---|
43 | LOGICAL , PUBLIC :: ln_traqsr !: light absorption (qsr) flag |
---|
44 | LOGICAL , PUBLIC :: ln_qsr_rgb !: Red-Green-Blue light absorption flag |
---|
45 | LOGICAL , PUBLIC :: ln_qsr_2bd !: 2 band light absorption flag |
---|
46 | LOGICAL , PUBLIC :: ln_qsr_bio !: bio-model light absorption flag |
---|
47 | LOGICAL , PUBLIC :: ln_qsr_ice !: light penetration for ice-model LIM3 (clem) |
---|
48 | INTEGER , PUBLIC :: nn_chldta !: use Chlorophyll data (=1) or not (=0) |
---|
49 | REAL(wp), PUBLIC :: rn_abs !: fraction absorbed in the very near surface (RGB & 2 bands) |
---|
50 | REAL(wp), PUBLIC :: rn_si0 !: very near surface depth of extinction (RGB & 2 bands) |
---|
51 | REAL(wp), PUBLIC :: rn_si1 !: deepest depth of extinction (water type I) (2 bands) |
---|
52 | |
---|
53 | ! Module variables |
---|
54 | REAL(wp) :: xsi0r !: inverse of rn_si0 |
---|
55 | REAL(wp) :: xsi1r !: inverse of rn_si1 |
---|
56 | TYPE(FLD), ALLOCATABLE, DIMENSION(:) :: sf_chl ! structure of input Chl (file informations, fields read) |
---|
57 | INTEGER, PUBLIC :: nksr ! levels below which the light cannot penetrate ( depth larger than 391 m) |
---|
58 | REAL(wp), DIMENSION(3,61) :: rkrgb !: tabulated attenuation coefficients for RGB absorption |
---|
59 | |
---|
60 | !! * Substitutions |
---|
61 | # include "domzgr_substitute.h90" |
---|
62 | # include "vectopt_loop_substitute.h90" |
---|
63 | !!---------------------------------------------------------------------- |
---|
64 | !! NEMO/OPA 3.3 , NEMO Consortium (2010) |
---|
65 | !! $Id$ |
---|
66 | !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) |
---|
67 | !!---------------------------------------------------------------------- |
---|
68 | CONTAINS |
---|
69 | |
---|
70 | SUBROUTINE tra_qsr( kt ) |
---|
71 | !!---------------------------------------------------------------------- |
---|
72 | !! *** ROUTINE tra_qsr *** |
---|
73 | !! |
---|
74 | !! ** Purpose : Compute the temperature trend due to the solar radiation |
---|
75 | !! penetration and add it to the general temperature trend. |
---|
76 | !! |
---|
77 | !! ** Method : The profile of the solar radiation within the ocean is defined |
---|
78 | !! through 2 wavebands (rn_si0,rn_si1) or 3 wavebands (RGB) and a ratio rn_abs |
---|
79 | !! Considering the 2 wavebands case: |
---|
80 | !! I(k) = Qsr*( rn_abs*EXP(z(k)/rn_si0) + (1.-rn_abs)*EXP(z(k)/rn_si1) ) |
---|
81 | !! The temperature trend associated with the solar radiation penetration |
---|
82 | !! is given by : zta = 1/e3t dk[ I ] / (rau0*Cp) |
---|
83 | !! At the bottom, boudary condition for the radiation is no flux : |
---|
84 | !! all heat which has not been absorbed in the above levels is put |
---|
85 | !! in the last ocean level. |
---|
86 | !! In z-coordinate case, the computation is only done down to the |
---|
87 | !! level where I(k) < 1.e-15 W/m2. In addition, the coefficients |
---|
88 | !! used for the computation are calculated one for once as they |
---|
89 | !! depends on k only. |
---|
90 | !! |
---|
91 | !! ** Action : - update ta with the penetrative solar radiation trend |
---|
92 | !! - save the trend in ttrd ('key_trdtra') |
---|
93 | !! |
---|
94 | !! Reference : Jerlov, N. G., 1968 Optical Oceanography, Elsevier, 194pp. |
---|
95 | !! Lengaigne et al. 2007, Clim. Dyn., V28, 5, 503-516. |
---|
96 | !! Morel, A. et Berthon, JF, 1989, Limnol Oceanogr 34(8), 1545-1562 |
---|
97 | !!---------------------------------------------------------------------- |
---|
98 | ! |
---|
99 | INTEGER, INTENT(in) :: kt ! ocean time-step |
---|
100 | ! |
---|
101 | INTEGER :: ji, jj, jk ! dummy loop indices |
---|
102 | INTEGER :: irgb ! local integers |
---|
103 | REAL(wp) :: zchl, zcoef, zfact ! local scalars |
---|
104 | REAL(wp) :: zc0, zc1, zc2, zc3 ! - - |
---|
105 | REAL(wp) :: zz0, zz1, z1_e3t ! - - |
---|
106 | REAL(wp) :: zCb, zCmax, zze, zpsi, zpsimax, zdelpsi, zCtot, zCze |
---|
107 | REAL(wp) :: zlogc, zlogc2, zlogc3 |
---|
108 | REAL(wp), POINTER, DIMENSION(:,: ) :: zekb, zekg, zekr |
---|
109 | REAL(wp), POINTER, DIMENSION(:,:,:) :: ze0, ze1, ze2, ze3, zea, ztrdt, zchl3d |
---|
110 | !!-------------------------------------------------------------------------- |
---|
111 | ! |
---|
112 | IF( nn_timing == 1 ) CALL timing_start('tra_qsr') |
---|
113 | ! |
---|
114 | CALL wrk_alloc( jpi, jpj, zekb, zekg, zekr ) |
---|
115 | CALL wrk_alloc( jpi, jpj, jpk, ze0, ze1, ze2, ze3, zea, zchl3d ) |
---|
116 | ! |
---|
117 | IF( kt == nit000 ) THEN |
---|
118 | IF(lwp) WRITE(numout,*) |
---|
119 | IF(lwp) WRITE(numout,*) 'tra_qsr : penetration of the surface solar radiation' |
---|
120 | IF(lwp) WRITE(numout,*) '~~~~~~~' |
---|
121 | IF( .NOT.ln_traqsr ) RETURN |
---|
122 | ENDIF |
---|
123 | |
---|
124 | IF( l_trdtra ) THEN ! Save ta and sa trends |
---|
125 | CALL wrk_alloc( jpi, jpj, jpk, ztrdt ) |
---|
126 | ztrdt(:,:,:) = tsa(:,:,:,jp_tem) |
---|
127 | ENDIF |
---|
128 | |
---|
129 | ! Set before qsr tracer content field |
---|
130 | ! *********************************** |
---|
131 | IF( kt == nit000 ) THEN ! Set the forcing field at nit000 - 1 |
---|
132 | ! ! ----------------------------------- |
---|
133 | qsr_hc(:,:,:) = 0.e0 |
---|
134 | ! |
---|
135 | IF( ln_rstart .AND. & ! Restart: read in restart file |
---|
136 | & iom_varid( numror, 'qsr_hc_b', ldstop = .FALSE. ) > 0 ) THEN |
---|
137 | IF(lwp .AND. nprint >0) WRITE(numout,*) ' nit000-1 qsr tracer content forcing field red in the restart file' |
---|
138 | zfact = 0.5e0 |
---|
139 | CALL iom_get( numror, jpdom_autoglo, 'qsr_hc_b', qsr_hc_b ) ! before heat content trend due to Qsr flux |
---|
140 | ELSE ! No restart or restart not found: Euler forward time stepping |
---|
141 | zfact = 1.e0 |
---|
142 | qsr_hc_b(:,:,:) = 0.e0 |
---|
143 | ENDIF |
---|
144 | ELSE ! Swap of forcing field |
---|
145 | ! ! --------------------- |
---|
146 | zfact = 0.5e0 |
---|
147 | qsr_hc_b(:,:,:) = qsr_hc(:,:,:) |
---|
148 | ENDIF |
---|
149 | ! Compute now qsr tracer content field |
---|
150 | ! ************************************ |
---|
151 | |
---|
152 | ! ! ============================================== ! |
---|
153 | IF( lk_qsr_bio .AND. ln_qsr_bio ) THEN ! bio-model fluxes : all vertical coordinates ! |
---|
154 | ! ! ============================================== ! |
---|
155 | DO jk = 1, jpkm1 |
---|
156 | qsr_hc(:,:,jk) = r1_rau0_rcp * ( etot3(:,:,jk) - etot3(:,:,jk+1) ) |
---|
157 | END DO |
---|
158 | ! Add to the general trend |
---|
159 | DO jk = 1, jpkm1 |
---|
160 | DO jj = 2, jpjm1 |
---|
161 | DO ji = fs_2, fs_jpim1 ! vector opt. |
---|
162 | z1_e3t = zfact / fse3t(ji,jj,jk) |
---|
163 | tsa(ji,jj,jk,jp_tem) = tsa(ji,jj,jk,jp_tem) + ( qsr_hc_b(ji,jj,jk) + qsr_hc(ji,jj,jk) ) * z1_e3t |
---|
164 | END DO |
---|
165 | END DO |
---|
166 | END DO |
---|
167 | CALL iom_put( 'qsr3d', etot3 ) ! Shortwave Radiation 3D distribution |
---|
168 | ! clem: store attenuation coefficient of the first ocean level |
---|
169 | IF ( ln_qsr_ice ) THEN |
---|
170 | DO jj = 1, jpj |
---|
171 | DO ji = 1, jpi |
---|
172 | IF ( qsr(ji,jj) /= 0._wp ) THEN |
---|
173 | fraqsr_1lev(ji,jj) = ( qsr_hc(ji,jj,1) / ( r1_rau0_rcp * qsr(ji,jj) ) ) |
---|
174 | ELSE |
---|
175 | fraqsr_1lev(ji,jj) = 1. |
---|
176 | ENDIF |
---|
177 | END DO |
---|
178 | END DO |
---|
179 | ENDIF |
---|
180 | ! ! ============================================== ! |
---|
181 | ELSE ! Ocean alone : |
---|
182 | ! ! ============================================== ! |
---|
183 | ! |
---|
184 | ! ! ------------------------- ! |
---|
185 | IF( ln_qsr_rgb) THEN ! R-G-B light penetration ! |
---|
186 | ! ! ------------------------- ! |
---|
187 | ! Set chlorophyl concentration |
---|
188 | IF( nn_chldta == 1 .OR. nn_chldta == 2 .OR. lk_vvl ) THEN !* Variable Chlorophyll or ocean volume |
---|
189 | ! |
---|
190 | IF( nn_chldta == 1 ) THEN !* 2D Variable Chlorophyll |
---|
191 | ! |
---|
192 | CALL fld_read( kt, 1, sf_chl ) ! Read Chl data and provides it at the current time step |
---|
193 | DO jk = 1, nksr + 1 |
---|
194 | zchl3d(:,:,jk) = sf_chl(1)%fnow(:,:,1) |
---|
195 | ENDDO |
---|
196 | ! |
---|
197 | ELSE IF( nn_chldta == 2 ) THEN !* -3-D Variable Chlorophyll |
---|
198 | ! |
---|
199 | CALL fld_read( kt, 1, sf_chl ) ! Read Chl data and provides it at the current time step |
---|
200 | !CDIR NOVERRCHK ! |
---|
201 | DO jj = 1, jpj |
---|
202 | !CDIR NOVERRCHK |
---|
203 | DO ji = 1, jpi |
---|
204 | zchl = sf_chl(1)%fnow(ji,jj,1) |
---|
205 | zCtot = 40.6 * zchl**0.459 |
---|
206 | zze = 568.2 * zCtot**(-0.746) |
---|
207 | IF( zze > 102. ) zze = 200.0 * zCtot**(-0.293) |
---|
208 | zlogc = LOG( zchl ) |
---|
209 | zlogc2 = zlogc * zlogc |
---|
210 | zlogc3 = zlogc * zlogc * zlogc |
---|
211 | zCb = 0.768 + 0.087 * zlogc - 0.179 * zlogc2 - 0.025 * zlogc3 |
---|
212 | zCmax = 0.299 - 0.289 * zlogc + 0.579 * zlogc2 |
---|
213 | zpsimax = 0.6 - 0.640 * zlogc + 0.021 * zlogc2 + 0.115 * zlogc3 |
---|
214 | zdelpsi = 0.710 + 0.159 * zlogc + 0.021 * zlogc2 |
---|
215 | zCze = 1.12 * (zchl)**0.803 |
---|
216 | DO jk = 1, nksr + 1 |
---|
217 | zpsi = fsdept(ji,jj,jk) / zze |
---|
218 | zchl3d(ji,jj,jk) = zCze * ( zCb + zCmax * EXP( -( (zpsi - zpsimax) / zdelpsi )**2 ) ) |
---|
219 | END DO |
---|
220 | ! |
---|
221 | END DO |
---|
222 | END DO |
---|
223 | ! |
---|
224 | ELSE !* Variable ocean volume but constant chrlorophyll |
---|
225 | DO jk = 1, nksr + 1 |
---|
226 | zchl3d(:,:,jk) = 0.05 |
---|
227 | ENDDO |
---|
228 | ENDIF |
---|
229 | ! |
---|
230 | zcoef = ( 1. - rn_abs ) / 3.e0 ! equi-partition in R-G-B |
---|
231 | ze0(:,:,1) = rn_abs * qsr(:,:) |
---|
232 | ze1(:,:,1) = zcoef * qsr(:,:) |
---|
233 | ze2(:,:,1) = zcoef * qsr(:,:) |
---|
234 | ze3(:,:,1) = zcoef * qsr(:,:) |
---|
235 | zea(:,:,1) = qsr(:,:) |
---|
236 | ! |
---|
237 | DO jk = 2, nksr+1 |
---|
238 | ! |
---|
239 | DO jj = 1, jpj ! Separation in R-G-B depending of vertical profile of Chl |
---|
240 | !CDIR NOVERRCHK |
---|
241 | DO ji = 1, jpi |
---|
242 | zchl = MIN( 10. , MAX( 0.03, zchl3d(ji,jj,jk) ) ) |
---|
243 | irgb = NINT( 41 + 20.*LOG10(zchl) + 1.e-15 ) |
---|
244 | zekb(ji,jj) = rkrgb(1,irgb) |
---|
245 | zekg(ji,jj) = rkrgb(2,irgb) |
---|
246 | zekr(ji,jj) = rkrgb(3,irgb) |
---|
247 | END DO |
---|
248 | END DO |
---|
249 | !CDIR NOVERRCHK |
---|
250 | DO jj = 1, jpj |
---|
251 | !CDIR NOVERRCHK |
---|
252 | DO ji = 1, jpi |
---|
253 | zc0 = ze0(ji,jj,jk-1) * EXP( - fse3t(ji,jj,jk-1) * xsi0r ) |
---|
254 | zc1 = ze1(ji,jj,jk-1) * EXP( - fse3t(ji,jj,jk-1) * zekb(ji,jj) ) |
---|
255 | zc2 = ze2(ji,jj,jk-1) * EXP( - fse3t(ji,jj,jk-1) * zekg(ji,jj) ) |
---|
256 | zc3 = ze3(ji,jj,jk-1) * EXP( - fse3t(ji,jj,jk-1) * zekr(ji,jj) ) |
---|
257 | ze0(ji,jj,jk) = zc0 |
---|
258 | ze1(ji,jj,jk) = zc1 |
---|
259 | ze2(ji,jj,jk) = zc2 |
---|
260 | ze3(ji,jj,jk) = zc3 |
---|
261 | zea(ji,jj,jk) = ( zc0 + zc1 + zc2 + zc3 ) * tmask(ji,jj,jk) |
---|
262 | END DO |
---|
263 | END DO |
---|
264 | END DO |
---|
265 | ! |
---|
266 | DO jk = 1, nksr ! compute and add qsr trend to ta |
---|
267 | qsr_hc(:,:,jk) = r1_rau0_rcp * ( zea(:,:,jk) - zea(:,:,jk+1) ) |
---|
268 | END DO |
---|
269 | zea(:,:,nksr+1:jpk) = 0.e0 ! below 400m set to zero |
---|
270 | CALL iom_put( 'qsr3d', zea ) ! Shortwave Radiation 3D distribution |
---|
271 | ! |
---|
272 | IF ( ln_qsr_ice ) THEN ! store attenuation coefficient of the first ocean level |
---|
273 | !CDIR NOVERRCHK |
---|
274 | DO jj = 1, jpj ! Separation in R-G-B depending of the surface Chl |
---|
275 | !CDIR NOVERRCHK |
---|
276 | DO ji = 1, jpi |
---|
277 | zchl = MIN( 10. , MAX( 0.03, zchl3d(ji,jj,1) ) ) |
---|
278 | irgb = NINT( 41 + 20.*LOG10(zchl) + 1.e-15 ) |
---|
279 | zekb(ji,jj) = rkrgb(1,irgb) |
---|
280 | zekg(ji,jj) = rkrgb(2,irgb) |
---|
281 | zekr(ji,jj) = rkrgb(3,irgb) |
---|
282 | END DO |
---|
283 | END DO |
---|
284 | ! |
---|
285 | DO jj = 1, jpj |
---|
286 | DO ji = 1, jpi |
---|
287 | zc0 = rn_abs * EXP( - fse3t(ji,jj,1) * xsi0r ) |
---|
288 | zc1 = zcoef * EXP( - fse3t(ji,jj,1) * zekb(ji,jj) ) |
---|
289 | zc2 = zcoef * EXP( - fse3t(ji,jj,1) * zekg(ji,jj) ) |
---|
290 | zc3 = zcoef * EXP( - fse3t(ji,jj,1) * zekr(ji,jj) ) |
---|
291 | fraqsr_1lev(ji,jj) = 1.0 - ( zc0 + zc1 + zc2 + zc3 ) * tmask(ji,jj,2) |
---|
292 | END DO |
---|
293 | END DO |
---|
294 | ! |
---|
295 | ENDIF |
---|
296 | ! |
---|
297 | ELSE !* Constant Chlorophyll |
---|
298 | DO jk = 1, nksr |
---|
299 | qsr_hc(:,:,jk) = etot3(:,:,jk) * qsr(:,:) |
---|
300 | END DO |
---|
301 | ! store attenuation coefficient of the first ocean level |
---|
302 | IF( ln_qsr_ice ) THEN |
---|
303 | fraqsr_1lev(:,:) = etot3(:,:,1) / r1_rau0_rcp |
---|
304 | ENDIF |
---|
305 | ENDIF |
---|
306 | |
---|
307 | ENDIF |
---|
308 | ! ! ------------------------- ! |
---|
309 | IF( ln_qsr_2bd ) THEN ! 2 band light penetration ! |
---|
310 | ! ! ------------------------- ! |
---|
311 | ! |
---|
312 | IF( lk_vvl ) THEN !* variable volume |
---|
313 | zz0 = rn_abs * r1_rau0_rcp |
---|
314 | zz1 = ( 1. - rn_abs ) * r1_rau0_rcp |
---|
315 | DO jk = 1, nksr ! solar heat absorbed at T-point in the top 400m |
---|
316 | DO jj = 1, jpj |
---|
317 | DO ji = 1, jpi |
---|
318 | zc0 = zz0 * EXP( -fsdepw(ji,jj,jk )*xsi0r ) + zz1 * EXP( -fsdepw(ji,jj,jk )*xsi1r ) |
---|
319 | zc1 = zz0 * EXP( -fsdepw(ji,jj,jk+1)*xsi0r ) + zz1 * EXP( -fsdepw(ji,jj,jk+1)*xsi1r ) |
---|
320 | qsr_hc(ji,jj,jk) = qsr(ji,jj) * ( zc0*tmask(ji,jj,jk) - zc1*tmask(ji,jj,jk+1) ) |
---|
321 | END DO |
---|
322 | END DO |
---|
323 | END DO |
---|
324 | ! clem: store attenuation coefficient of the first ocean level |
---|
325 | IF ( ln_qsr_ice ) THEN |
---|
326 | DO jj = 1, jpj |
---|
327 | DO ji = 1, jpi |
---|
328 | zc0 = zz0 * EXP( -fsdepw(ji,jj,1)*xsi0r ) + zz1 * EXP( -fsdepw(ji,jj,1)*xsi1r ) |
---|
329 | zc1 = zz0 * EXP( -fsdepw(ji,jj,2)*xsi0r ) + zz1 * EXP( -fsdepw(ji,jj,2)*xsi1r ) |
---|
330 | fraqsr_1lev(ji,jj) = ( zc0*tmask(ji,jj,1) - zc1*tmask(ji,jj,2) ) / r1_rau0_rcp |
---|
331 | END DO |
---|
332 | END DO |
---|
333 | ENDIF |
---|
334 | ELSE !* constant volume: coef. computed one for all |
---|
335 | DO jk = 1, nksr |
---|
336 | DO jj = 2, jpjm1 |
---|
337 | DO ji = fs_2, fs_jpim1 ! vector opt. |
---|
338 | ! (ISF) no light penetration below the ice shelves |
---|
339 | qsr_hc(ji,jj,jk) = etot3(ji,jj,jk) * qsr(ji,jj) * tmask(ji,jj,1) |
---|
340 | END DO |
---|
341 | END DO |
---|
342 | END DO |
---|
343 | ! clem: store attenuation coefficient of the first ocean level |
---|
344 | IF ( ln_qsr_ice ) THEN |
---|
345 | fraqsr_1lev(:,:) = etot3(:,:,1) / r1_rau0_rcp |
---|
346 | ENDIF |
---|
347 | ! |
---|
348 | ENDIF |
---|
349 | ! |
---|
350 | ENDIF |
---|
351 | ! |
---|
352 | ! Add to the general trend |
---|
353 | DO jk = 1, nksr |
---|
354 | DO jj = 2, jpjm1 |
---|
355 | DO ji = fs_2, fs_jpim1 ! vector opt. |
---|
356 | z1_e3t = zfact / fse3t(ji,jj,jk) |
---|
357 | tsa(ji,jj,jk,jp_tem) = tsa(ji,jj,jk,jp_tem) + ( qsr_hc_b(ji,jj,jk) + qsr_hc(ji,jj,jk) ) * z1_e3t |
---|
358 | END DO |
---|
359 | END DO |
---|
360 | END DO |
---|
361 | ! |
---|
362 | ENDIF |
---|
363 | ! |
---|
364 | IF( lrst_oce ) THEN ! Write in the ocean restart file |
---|
365 | ! ******************************* |
---|
366 | IF(lwp .AND. nprint >0) THEN |
---|
367 | WRITE(numout,*) |
---|
368 | WRITE(numout,*) 'qsr tracer content forcing field written in ocean restart file ', & |
---|
369 | & 'at it= ', kt,' date= ', ndastp |
---|
370 | WRITE(numout,*) '~~~~' |
---|
371 | ENDIF |
---|
372 | IF(nn_timing == 2) CALL timing_start('iom_rstput') |
---|
373 | CALL iom_rstput( kt, nitrst, numrow, 'qsr_hc_b' , qsr_hc ) |
---|
374 | CALL iom_rstput( kt, nitrst, numrow, 'fraqsr_1lev', fraqsr_1lev ) ! default definition in sbcssm |
---|
375 | IF(nn_timing == 2) CALL timing_stop('iom_rstput') |
---|
376 | ! |
---|
377 | ENDIF |
---|
378 | |
---|
379 | IF( l_trdtra ) THEN ! qsr tracers trends saved for diagnostics |
---|
380 | ztrdt(:,:,:) = tsa(:,:,:,jp_tem) - ztrdt(:,:,:) |
---|
381 | CALL trd_tra( kt, 'TRA', jp_tem, jptra_qsr, ztrdt ) |
---|
382 | CALL wrk_dealloc( jpi, jpj, jpk, ztrdt ) |
---|
383 | ENDIF |
---|
384 | ! ! print mean trends (used for debugging) |
---|
385 | IF(ln_ctl) CALL prt_ctl( tab3d_1=tsa(:,:,:,jp_tem), clinfo1=' qsr - Ta: ', mask1=tmask, clinfo3='tra-ta' ) |
---|
386 | ! |
---|
387 | CALL wrk_dealloc( jpi, jpj, zekb, zekg, zekr ) |
---|
388 | CALL wrk_dealloc( jpi, jpj, jpk, ze0, ze1, ze2, ze3, zea, zchl3d ) |
---|
389 | ! |
---|
390 | IF( nn_timing == 1 ) CALL timing_stop('tra_qsr') |
---|
391 | ! |
---|
392 | END SUBROUTINE tra_qsr |
---|
393 | |
---|
394 | |
---|
395 | SUBROUTINE tra_qsr_init |
---|
396 | !!---------------------------------------------------------------------- |
---|
397 | !! *** ROUTINE tra_qsr_init *** |
---|
398 | !! |
---|
399 | !! ** Purpose : Initialization for the penetrative solar radiation |
---|
400 | !! |
---|
401 | !! ** Method : The profile of solar radiation within the ocean is set |
---|
402 | !! from two length scale of penetration (rn_si0,rn_si1) and a ratio |
---|
403 | !! (rn_abs). These parameters are read in the namtra_qsr namelist. The |
---|
404 | !! default values correspond to clear water (type I in Jerlov' |
---|
405 | !! (1968) classification. |
---|
406 | !! called by tra_qsr at the first timestep (nit000) |
---|
407 | !! |
---|
408 | !! ** Action : - initialize rn_si0, rn_si1 and rn_abs |
---|
409 | !! |
---|
410 | !! Reference : Jerlov, N. G., 1968 Optical Oceanography, Elsevier, 194pp. |
---|
411 | !!---------------------------------------------------------------------- |
---|
412 | ! |
---|
413 | INTEGER :: ji, jj, jk ! dummy loop indices |
---|
414 | INTEGER :: irgb, ierror, ioptio, nqsr ! local integer |
---|
415 | INTEGER :: ios ! Local integer output status for namelist read |
---|
416 | REAL(wp) :: zz0, zc0 , zc1, zcoef ! local scalars |
---|
417 | REAL(wp) :: zz1, zc2 , zc3, zchl ! - - |
---|
418 | REAL(wp), POINTER, DIMENSION(:,: ) :: zekb, zekg, zekr |
---|
419 | REAL(wp), POINTER, DIMENSION(:,:,:) :: ze0, ze1, ze2, ze3, zea |
---|
420 | ! |
---|
421 | CHARACTER(len=100) :: cn_dir ! Root directory for location of ssr files |
---|
422 | TYPE(FLD_N) :: sn_chl ! informations about the chlorofyl field to be read |
---|
423 | !! |
---|
424 | NAMELIST/namtra_qsr/ sn_chl, cn_dir, ln_traqsr, ln_qsr_rgb, ln_qsr_2bd, ln_qsr_bio, ln_qsr_ice, & |
---|
425 | & nn_chldta, rn_abs, rn_si0, rn_si1 |
---|
426 | !!---------------------------------------------------------------------- |
---|
427 | |
---|
428 | ! |
---|
429 | IF( nn_timing == 1 ) CALL timing_start('tra_qsr_init') |
---|
430 | ! |
---|
431 | CALL wrk_alloc( jpi, jpj, zekb, zekg, zekr ) |
---|
432 | CALL wrk_alloc( jpi, jpj, jpk, ze0, ze1, ze2, ze3, zea ) |
---|
433 | ! |
---|
434 | |
---|
435 | REWIND( numnam_ref ) ! Namelist namtra_qsr in reference namelist : Ratio and length of penetration |
---|
436 | READ ( numnam_ref, namtra_qsr, IOSTAT = ios, ERR = 901) |
---|
437 | 901 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtra_qsr in reference namelist', lwp ) |
---|
438 | |
---|
439 | REWIND( numnam_cfg ) ! Namelist namtra_qsr in configuration namelist : Ratio and length of penetration |
---|
440 | READ ( numnam_cfg, namtra_qsr, IOSTAT = ios, ERR = 902 ) |
---|
441 | 902 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtra_qsr in configuration namelist', lwp ) |
---|
442 | IF(lwm .AND. nprint > 2) WRITE ( numond, namtra_qsr ) |
---|
443 | ! |
---|
444 | IF(lwp) THEN ! control print |
---|
445 | WRITE(numout,*) |
---|
446 | WRITE(numout,*) 'tra_qsr_init : penetration of the surface solar radiation' |
---|
447 | WRITE(numout,*) '~~~~~~~~~~~~' |
---|
448 | WRITE(numout,*) ' Namelist namtra_qsr : set the parameter of penetration' |
---|
449 | WRITE(numout,*) ' Light penetration (T) or not (F) ln_traqsr = ', ln_traqsr |
---|
450 | WRITE(numout,*) ' RGB (Red-Green-Blue) light penetration ln_qsr_rgb = ', ln_qsr_rgb |
---|
451 | WRITE(numout,*) ' 2 band light penetration ln_qsr_2bd = ', ln_qsr_2bd |
---|
452 | WRITE(numout,*) ' bio-model light penetration ln_qsr_bio = ', ln_qsr_bio |
---|
453 | WRITE(numout,*) ' light penetration for ice-model LIM3 ln_qsr_ice = ', ln_qsr_ice |
---|
454 | WRITE(numout,*) ' RGB : Chl data (=1/2) or cst value (=0) nn_chldta = ', nn_chldta |
---|
455 | WRITE(numout,*) ' RGB & 2 bands: fraction of light (rn_si1) rn_abs = ', rn_abs |
---|
456 | WRITE(numout,*) ' RGB & 2 bands: shortess depth of extinction rn_si0 = ', rn_si0 |
---|
457 | WRITE(numout,*) ' 2 bands: longest depth of extinction rn_si1 = ', rn_si1 |
---|
458 | ENDIF |
---|
459 | |
---|
460 | IF( ln_traqsr ) THEN ! control consistency |
---|
461 | ! |
---|
462 | IF( .NOT.lk_qsr_bio .AND. ln_qsr_bio ) THEN |
---|
463 | CALL ctl_warn( 'No bio model : force ln_qsr_bio = FALSE ' ) |
---|
464 | ln_qsr_bio = .FALSE. |
---|
465 | ENDIF |
---|
466 | ! |
---|
467 | ioptio = 0 ! Parameter control |
---|
468 | IF( ln_qsr_rgb ) ioptio = ioptio + 1 |
---|
469 | IF( ln_qsr_2bd ) ioptio = ioptio + 1 |
---|
470 | IF( ln_qsr_bio ) ioptio = ioptio + 1 |
---|
471 | ! |
---|
472 | IF( ioptio /= 1 ) & |
---|
473 | CALL ctl_stop( ' Choose ONE type of light penetration in namelist namtra_qsr', & |
---|
474 | & ' 2 bands, 3 RGB bands or bio-model light penetration' ) |
---|
475 | ! |
---|
476 | IF( ln_qsr_rgb .AND. nn_chldta == 0 ) nqsr = 1 |
---|
477 | IF( ln_qsr_rgb .AND. nn_chldta == 1 ) nqsr = 2 |
---|
478 | IF( ln_qsr_rgb .AND. nn_chldta == 2 ) nqsr = 3 |
---|
479 | IF( ln_qsr_2bd ) nqsr = 4 |
---|
480 | IF( ln_qsr_bio ) nqsr = 5 |
---|
481 | ! |
---|
482 | IF(lwp) THEN ! Print the choice |
---|
483 | WRITE(numout,*) |
---|
484 | IF( nqsr == 1 ) WRITE(numout,*) ' R-G-B light penetration - Constant Chlorophyll' |
---|
485 | IF( nqsr == 2 ) WRITE(numout,*) ' R-G-B light penetration - 2D Chl data ' |
---|
486 | IF( nqsr == 3 ) WRITE(numout,*) ' R-G-B light penetration - 3D Chl data ' |
---|
487 | IF( nqsr == 4 ) WRITE(numout,*) ' 2 bands light penetration' |
---|
488 | IF( nqsr == 5 ) WRITE(numout,*) ' bio-model light penetration' |
---|
489 | ENDIF |
---|
490 | ! |
---|
491 | ENDIF |
---|
492 | ! ! ===================================== ! |
---|
493 | IF( ln_traqsr ) THEN ! Initialisation of Light Penetration ! |
---|
494 | ! ! ===================================== ! |
---|
495 | ! |
---|
496 | xsi0r = 1.e0 / rn_si0 |
---|
497 | xsi1r = 1.e0 / rn_si1 |
---|
498 | ! ! ---------------------------------- ! |
---|
499 | IF( ln_qsr_rgb ) THEN ! Red-Green-Blue light penetration ! |
---|
500 | ! ! ---------------------------------- ! |
---|
501 | ! |
---|
502 | CALL trc_oce_rgb( rkrgb ) !* tabulated attenuation coef. |
---|
503 | ! |
---|
504 | ! !* level of light extinction |
---|
505 | IF( ln_sco ) THEN ; nksr = jpkm1 |
---|
506 | ELSE ; nksr = trc_oce_ext_lev( r_si2, 0.33e2 ) |
---|
507 | ENDIF |
---|
508 | |
---|
509 | IF(lwp) WRITE(numout,*) ' level of light extinction = ', nksr, ' ref depth = ', gdepw_1d(nksr+1), ' m' |
---|
510 | ! |
---|
511 | IF( nn_chldta == 1 .OR. nn_chldta == 2 ) THEN !* Chl data : set sf_chl structure |
---|
512 | IF(lwp) WRITE(numout,*) |
---|
513 | IF(lwp) WRITE(numout,*) ' Chlorophyll read in a file' |
---|
514 | ALLOCATE( sf_chl(1), STAT=ierror ) |
---|
515 | IF( ierror > 0 ) THEN |
---|
516 | CALL ctl_stop( 'tra_qsr_init: unable to allocate sf_chl structure' ) ; RETURN |
---|
517 | ENDIF |
---|
518 | ALLOCATE( sf_chl(1)%fnow(jpi,jpj,1) ) |
---|
519 | IF( sn_chl%ln_tint )ALLOCATE( sf_chl(1)%fdta(jpi,jpj,1,2) ) |
---|
520 | ! ! fill sf_chl with sn_chl and control print |
---|
521 | CALL fld_fill( sf_chl, (/ sn_chl /), cn_dir, 'tra_qsr_init', & |
---|
522 | & 'Solar penetration function of read chlorophyll', 'namtra_qsr' ) |
---|
523 | ! |
---|
524 | ELSE !* constant Chl : compute once for all the distribution of light (etot3) |
---|
525 | IF(lwp) WRITE(numout,*) |
---|
526 | IF(lwp) WRITE(numout,*) ' Constant Chlorophyll concentration = 0.05' |
---|
527 | IF( lk_vvl ) THEN ! variable volume |
---|
528 | IF(lwp) WRITE(numout,*) ' key_vvl: light distribution will be computed at each time step' |
---|
529 | ELSE ! constant volume: computes one for all |
---|
530 | IF(lwp) WRITE(numout,*) ' fixed volume: light distribution computed one for all' |
---|
531 | ! |
---|
532 | zchl = 0.05 ! constant chlorophyll |
---|
533 | irgb = NINT( 41 + 20.*LOG10(zchl) + 1.e-15 ) |
---|
534 | zekb(:,:) = rkrgb(1,irgb) ! Separation in R-G-B depending of the chlorophyll |
---|
535 | zekg(:,:) = rkrgb(2,irgb) |
---|
536 | zekr(:,:) = rkrgb(3,irgb) |
---|
537 | ! |
---|
538 | zcoef = ( 1. - rn_abs ) / 3.e0 ! equi-partition in R-G-B |
---|
539 | ze0(:,:,1) = rn_abs |
---|
540 | ze1(:,:,1) = zcoef |
---|
541 | ze2(:,:,1) = zcoef |
---|
542 | ze3(:,:,1) = zcoef |
---|
543 | zea(:,:,1) = tmask(:,:,1) ! = ( ze0+ze1+z2+ze3 ) * tmask |
---|
544 | |
---|
545 | DO jk = 2, nksr+1 |
---|
546 | !CDIR NOVERRCHK |
---|
547 | DO jj = 1, jpj |
---|
548 | !CDIR NOVERRCHK |
---|
549 | DO ji = 1, jpi |
---|
550 | zc0 = ze0(ji,jj,jk-1) * EXP( - e3t_0(ji,jj,jk-1) * xsi0r ) |
---|
551 | zc1 = ze1(ji,jj,jk-1) * EXP( - e3t_0(ji,jj,jk-1) * zekb(ji,jj) ) |
---|
552 | zc2 = ze2(ji,jj,jk-1) * EXP( - e3t_0(ji,jj,jk-1) * zekg(ji,jj) ) |
---|
553 | zc3 = ze3(ji,jj,jk-1) * EXP( - e3t_0(ji,jj,jk-1) * zekr(ji,jj) ) |
---|
554 | ze0(ji,jj,jk) = zc0 |
---|
555 | ze1(ji,jj,jk) = zc1 |
---|
556 | ze2(ji,jj,jk) = zc2 |
---|
557 | ze3(ji,jj,jk) = zc3 |
---|
558 | zea(ji,jj,jk) = ( zc0 + zc1 + zc2 + zc3 ) * tmask(ji,jj,jk) |
---|
559 | END DO |
---|
560 | END DO |
---|
561 | END DO |
---|
562 | ! |
---|
563 | DO jk = 1, nksr |
---|
564 | ! (ISF) no light penetration below the ice shelves |
---|
565 | etot3(:,:,jk) = r1_rau0_rcp * ( zea(:,:,jk) - zea(:,:,jk+1) ) * tmask(:,:,1) |
---|
566 | END DO |
---|
567 | etot3(:,:,nksr+1:jpk) = 0.e0 ! below 400m set to zero |
---|
568 | ENDIF |
---|
569 | ENDIF |
---|
570 | ! |
---|
571 | ENDIF |
---|
572 | ! ! ---------------------------------- ! |
---|
573 | IF( ln_qsr_2bd ) THEN ! 2 bands light penetration ! |
---|
574 | ! ! ---------------------------------- ! |
---|
575 | ! |
---|
576 | ! ! level of light extinction |
---|
577 | nksr = trc_oce_ext_lev( rn_si1, 1.e2 ) |
---|
578 | IF(lwp) THEN |
---|
579 | WRITE(numout,*) |
---|
580 | IF(lwp) WRITE(numout,*) ' level of light extinction = ', nksr, ' ref depth = ', gdepw_1d(nksr+1), ' m' |
---|
581 | ENDIF |
---|
582 | ! |
---|
583 | IF( lk_vvl ) THEN ! variable volume |
---|
584 | IF(lwp) WRITE(numout,*) ' key_vvl: light distribution will be computed at each time step' |
---|
585 | ELSE ! constant volume: computes one for all |
---|
586 | zz0 = rn_abs * r1_rau0_rcp |
---|
587 | zz1 = ( 1. - rn_abs ) * r1_rau0_rcp |
---|
588 | DO jk = 1, nksr !* solar heat absorbed at T-point computed once for all |
---|
589 | DO jj = 1, jpj ! top 400 meters |
---|
590 | DO ji = 1, jpi |
---|
591 | zc0 = zz0 * EXP( -fsdepw(ji,jj,jk )*xsi0r ) + zz1 * EXP( -fsdepw(ji,jj,jk )*xsi1r ) |
---|
592 | zc1 = zz0 * EXP( -fsdepw(ji,jj,jk+1)*xsi0r ) + zz1 * EXP( -fsdepw(ji,jj,jk+1)*xsi1r ) |
---|
593 | etot3(ji,jj,jk) = ( zc0 * tmask(ji,jj,jk) - zc1 * tmask(ji,jj,jk+1) ) * tmask(ji,jj,1) |
---|
594 | END DO |
---|
595 | END DO |
---|
596 | END DO |
---|
597 | etot3(:,:,nksr+1:jpk) = 0.e0 ! below 400m set to zero |
---|
598 | ! |
---|
599 | ENDIF |
---|
600 | ENDIF |
---|
601 | ! ! ===================================== ! |
---|
602 | ELSE ! No light penetration ! |
---|
603 | ! ! ===================================== ! |
---|
604 | IF(lwp) THEN |
---|
605 | WRITE(numout,*) |
---|
606 | WRITE(numout,*) 'tra_qsr_init : NO solar flux penetration' |
---|
607 | WRITE(numout,*) '~~~~~~~~~~~~' |
---|
608 | ENDIF |
---|
609 | ENDIF |
---|
610 | ! |
---|
611 | ! initialisation of fraqsr_1lev used in sbcssm |
---|
612 | IF( iom_varid( numror, 'fraqsr_1lev', ldstop = .FALSE. ) > 0 ) THEN |
---|
613 | IF(nn_timing == 2) CALL timing_start('iom_rstget') |
---|
614 | CALL iom_get( numror, jpdom_autoglo, 'fraqsr_1lev' , fraqsr_1lev ) |
---|
615 | IF(nn_timing == 2) CALL timing_stop('iom_rstget') |
---|
616 | ELSE |
---|
617 | fraqsr_1lev(:,:) = 1._wp ! default definition |
---|
618 | ENDIF |
---|
619 | ! |
---|
620 | CALL wrk_dealloc( jpi, jpj, zekb, zekg, zekr ) |
---|
621 | CALL wrk_dealloc( jpi, jpj, jpk, ze0, ze1, ze2, ze3, zea ) |
---|
622 | ! |
---|
623 | IF( nn_timing == 1 ) CALL timing_stop('tra_qsr_init') |
---|
624 | ! |
---|
625 | END SUBROUTINE tra_qsr_init |
---|
626 | |
---|
627 | !!====================================================================== |
---|
628 | END MODULE traqsr |
---|