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 | !! 4.0 ! 2012-05 (C. Rousset) store attenuation coef for use in ice model |
---|
13 | !!---------------------------------------------------------------------- |
---|
14 | |
---|
15 | !!---------------------------------------------------------------------- |
---|
16 | !! tra_qsr : trend due to the solar radiation penetration |
---|
17 | !! tra_qsr_init : solar radiation penetration initialization |
---|
18 | !!---------------------------------------------------------------------- |
---|
19 | USE oce ! ocean dynamics and active tracers |
---|
20 | USE dom_oce ! ocean space and time domain |
---|
21 | USE sbc_oce ! surface boundary condition: ocean |
---|
22 | USE trc_oce ! share SMS/Ocean variables |
---|
23 | USE trd_oce ! trends: ocean variables |
---|
24 | USE trdtra ! trends manager: tracers |
---|
25 | USE in_out_manager ! I/O manager |
---|
26 | USE phycst ! physical constants |
---|
27 | USE prtctl ! Print control |
---|
28 | USE iom ! I/O manager |
---|
29 | USE fldread ! read input fields |
---|
30 | USE restart ! ocean restart |
---|
31 | USE lib_mpp ! MPP library |
---|
32 | USE wrk_nemo ! Memory Allocation |
---|
33 | USE timing ! Timing |
---|
34 | |
---|
35 | IMPLICIT NONE |
---|
36 | PRIVATE |
---|
37 | |
---|
38 | PUBLIC tra_qsr ! routine called by step.F90 (ln_traqsr=T) |
---|
39 | PUBLIC tra_qsr_init ! routine called by opa.F90 |
---|
40 | |
---|
41 | ! !!* Namelist namtra_qsr: penetrative solar radiation |
---|
42 | LOGICAL , PUBLIC :: ln_traqsr !: light absorption (qsr) flag |
---|
43 | LOGICAL , PUBLIC :: ln_qsr_rgb !: Red-Green-Blue light absorption flag |
---|
44 | LOGICAL , PUBLIC :: ln_qsr_2bd !: 2 band light absorption flag |
---|
45 | LOGICAL , PUBLIC :: ln_qsr_bio !: bio-model light absorption flag |
---|
46 | LOGICAL , PUBLIC :: ln_qsr_ice !: light penetration for ice-model LIM3 (clem) |
---|
47 | INTEGER , PUBLIC :: nn_chldta !: use Chlorophyll data (=1) or not (=0) |
---|
48 | REAL(wp), PUBLIC :: rn_abs !: fraction absorbed in the very near surface (RGB & 2 bands) |
---|
49 | REAL(wp), PUBLIC :: rn_si0 !: very near surface depth of extinction (RGB & 2 bands) |
---|
50 | REAL(wp), PUBLIC :: rn_si1 !: deepest depth of extinction (water type I) (2 bands) |
---|
51 | |
---|
52 | !! Energy budget of the leads (open water embedded in sea ice) |
---|
53 | REAL(wp), PUBLIC, ALLOCATABLE, DIMENSION(:,:) :: fraqsr_1lev !: fraction of solar net radiation absorbed in the 1st T level [-] |
---|
54 | |
---|
55 | ! Module variables |
---|
56 | REAL(wp) :: xsi0r !: inverse of rn_si0 |
---|
57 | REAL(wp) :: xsi1r !: inverse of rn_si1 |
---|
58 | TYPE(FLD), ALLOCATABLE, DIMENSION(:) :: sf_chl ! structure of input Chl (file informations, fields read) |
---|
59 | INTEGER, PUBLIC :: nksr ! levels below which the light cannot penetrate ( depth larger than 391 m) |
---|
60 | REAL(wp), DIMENSION(3,61) :: rkrgb !: tabulated attenuation coefficients for RGB absorption |
---|
61 | |
---|
62 | !! * Substitutions |
---|
63 | # include "domzgr_substitute.h90" |
---|
64 | # include "vectopt_loop_substitute.h90" |
---|
65 | !!---------------------------------------------------------------------- |
---|
66 | !! NEMO/OPA 3.3 , NEMO Consortium (2010) |
---|
67 | !! $Id$ |
---|
68 | !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) |
---|
69 | !!---------------------------------------------------------------------- |
---|
70 | CONTAINS |
---|
71 | |
---|
72 | SUBROUTINE tra_qsr( kt ) |
---|
73 | !!---------------------------------------------------------------------- |
---|
74 | !! *** ROUTINE tra_qsr *** |
---|
75 | !! |
---|
76 | !! ** Purpose : Compute the temperature trend due to the solar radiation |
---|
77 | !! penetration and add it to the general temperature trend. |
---|
78 | !! |
---|
79 | !! ** Method : The profile of the solar radiation within the ocean is defined |
---|
80 | !! through 2 wavebands (rn_si0,rn_si1) or 3 wavebands (RGB) and a ratio rn_abs |
---|
81 | !! Considering the 2 wavebands case: |
---|
82 | !! I(k) = Qsr*( rn_abs*EXP(z(k)/rn_si0) + (1.-rn_abs)*EXP(z(k)/rn_si1) ) |
---|
83 | !! The temperature trend associated with the solar radiation penetration |
---|
84 | !! is given by : zta = 1/e3t dk[ I ] / (rau0*Cp) |
---|
85 | !! At the bottom, boudary condition for the radiation is no flux : |
---|
86 | !! all heat which has not been absorbed in the above levels is put |
---|
87 | !! in the last ocean level. |
---|
88 | !! In z-coordinate case, the computation is only done down to the |
---|
89 | !! level where I(k) < 1.e-15 W/m2. In addition, the coefficients |
---|
90 | !! used for the computation are calculated one for once as they |
---|
91 | !! depends on k only. |
---|
92 | !! |
---|
93 | !! ** Action : - update ta with the penetrative solar radiation trend |
---|
94 | !! - save the trend in ttrd ('key_trdtra') |
---|
95 | !! |
---|
96 | !! Reference : Jerlov, N. G., 1968 Optical Oceanography, Elsevier, 194pp. |
---|
97 | !! Lengaigne et al. 2007, Clim. Dyn., V28, 5, 503-516. |
---|
98 | !!---------------------------------------------------------------------- |
---|
99 | ! |
---|
100 | INTEGER, INTENT(in) :: kt ! ocean time-step |
---|
101 | ! |
---|
102 | INTEGER :: ji, jj, jk ! dummy loop indices |
---|
103 | INTEGER :: irgb ! local integers |
---|
104 | REAL(wp) :: zchl, zcoef, zfact ! local scalars |
---|
105 | REAL(wp) :: zc0, zc1, zc2, zc3 ! - - |
---|
106 | REAL(wp) :: zzc0, zzc1, zzc2, zzc3 ! - - |
---|
107 | REAL(wp) :: zz0, zz1, z1_e3t ! - - |
---|
108 | REAL(wp), POINTER, DIMENSION(:,: ) :: zekb, zekg, zekr |
---|
109 | REAL(wp), POINTER, DIMENSION(:,:,:) :: ze0, ze1, ze2, ze3, zea, ztrdt |
---|
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 ) |
---|
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) 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. lk_vvl ) THEN !* Variable Chlorophyll or ocean volume |
---|
189 | ! |
---|
190 | IF( nn_chldta == 1 ) THEN !* Variable Chlorophyll |
---|
191 | ! |
---|
192 | CALL fld_read( kt, 1, sf_chl ) ! Read Chl data and provides it at the current time step |
---|
193 | ! |
---|
194 | !CDIR COLLAPSE |
---|
195 | !CDIR NOVERRCHK |
---|
196 | DO jj = 1, jpj ! Separation in R-G-B depending of the surface Chl |
---|
197 | !CDIR NOVERRCHK |
---|
198 | DO ji = 1, jpi |
---|
199 | zchl = MIN( 10. , MAX( 0.03, sf_chl(1)%fnow(ji,jj,1) ) ) |
---|
200 | irgb = NINT( 41 + 20.*LOG10(zchl) + 1.e-15 ) |
---|
201 | zekb(ji,jj) = rkrgb(1,irgb) |
---|
202 | zekg(ji,jj) = rkrgb(2,irgb) |
---|
203 | zekr(ji,jj) = rkrgb(3,irgb) |
---|
204 | END DO |
---|
205 | END DO |
---|
206 | ELSE ! Variable ocean volume but constant chrlorophyll |
---|
207 | zchl = 0.05 ! constant chlorophyll |
---|
208 | irgb = NINT( 41 + 20.*LOG10( zchl ) + 1.e-15 ) |
---|
209 | zekb(:,:) = rkrgb(1,irgb) ! Separation in R-G-B depending of the chlorophyll |
---|
210 | zekg(:,:) = rkrgb(2,irgb) |
---|
211 | zekr(:,:) = rkrgb(3,irgb) |
---|
212 | ENDIF |
---|
213 | ! |
---|
214 | zcoef = ( 1. - rn_abs ) / 3.e0 ! equi-partition in R-G-B |
---|
215 | ze0(:,:,1) = rn_abs * qsr(:,:) |
---|
216 | ze1(:,:,1) = zcoef * qsr(:,:) |
---|
217 | ze2(:,:,1) = zcoef * qsr(:,:) |
---|
218 | ze3(:,:,1) = zcoef * qsr(:,:) |
---|
219 | zea(:,:,1) = qsr(:,:) |
---|
220 | ! |
---|
221 | DO jk = 2, nksr+1 |
---|
222 | !CDIR NOVERRCHK |
---|
223 | DO jj = 1, jpj |
---|
224 | !CDIR NOVERRCHK |
---|
225 | DO ji = 1, jpi |
---|
226 | zc0 = ze0(ji,jj,jk-1) * EXP( - fse3t(ji,jj,jk-1) * xsi0r ) |
---|
227 | zc1 = ze1(ji,jj,jk-1) * EXP( - fse3t(ji,jj,jk-1) * zekb(ji,jj) ) |
---|
228 | zc2 = ze2(ji,jj,jk-1) * EXP( - fse3t(ji,jj,jk-1) * zekg(ji,jj) ) |
---|
229 | zc3 = ze3(ji,jj,jk-1) * EXP( - fse3t(ji,jj,jk-1) * zekr(ji,jj) ) |
---|
230 | ze0(ji,jj,jk) = zc0 |
---|
231 | ze1(ji,jj,jk) = zc1 |
---|
232 | ze2(ji,jj,jk) = zc2 |
---|
233 | ze3(ji,jj,jk) = zc3 |
---|
234 | zea(ji,jj,jk) = ( zc0 + zc1 + zc2 + zc3 ) * tmask(ji,jj,jk) |
---|
235 | END DO |
---|
236 | END DO |
---|
237 | END DO |
---|
238 | ! clem: store attenuation coefficient of the first ocean level |
---|
239 | IF ( ln_qsr_ice ) THEN |
---|
240 | DO jj = 1, jpj |
---|
241 | DO ji = 1, jpi |
---|
242 | zzc0 = rn_abs * EXP( - fse3t(ji,jj,1) * xsi0r ) |
---|
243 | zzc1 = zcoef * EXP( - fse3t(ji,jj,1) * zekb(ji,jj) ) |
---|
244 | zzc2 = zcoef * EXP( - fse3t(ji,jj,1) * zekg(ji,jj) ) |
---|
245 | zzc3 = zcoef * EXP( - fse3t(ji,jj,1) * zekr(ji,jj) ) |
---|
246 | fraqsr_1lev(ji,jj) = 1.0 - ( zzc0 + zzc1 + zzc2 + zzc3 ) * tmask(ji,jj,2) |
---|
247 | END DO |
---|
248 | END DO |
---|
249 | ENDIF |
---|
250 | ! |
---|
251 | DO jk = 1, nksr ! compute and add qsr trend to ta |
---|
252 | qsr_hc(:,:,jk) = r1_rau0_rcp * ( zea(:,:,jk) - zea(:,:,jk+1) ) |
---|
253 | END DO |
---|
254 | zea(:,:,nksr+1:jpk) = 0.e0 ! below 400m set to zero |
---|
255 | CALL iom_put( 'qsr3d', zea ) ! Shortwave Radiation 3D distribution |
---|
256 | ! |
---|
257 | ELSE !* Constant Chlorophyll |
---|
258 | DO jk = 1, nksr |
---|
259 | qsr_hc(:,:,jk) = etot3(:,:,jk) * qsr(:,:) |
---|
260 | END DO |
---|
261 | ! clem: store attenuation coefficient of the first ocean level |
---|
262 | IF ( ln_qsr_ice ) THEN |
---|
263 | fraqsr_1lev(:,:) = etot3(:,:,1) / r1_rau0_rcp |
---|
264 | ENDIF |
---|
265 | ENDIF |
---|
266 | |
---|
267 | ENDIF |
---|
268 | ! ! ------------------------- ! |
---|
269 | IF( ln_qsr_2bd ) THEN ! 2 band light penetration ! |
---|
270 | ! ! ------------------------- ! |
---|
271 | ! |
---|
272 | IF( lk_vvl ) THEN !* variable volume |
---|
273 | zz0 = rn_abs * r1_rau0_rcp |
---|
274 | zz1 = ( 1. - rn_abs ) * r1_rau0_rcp |
---|
275 | DO jk = 1, nksr ! solar heat absorbed at T-point in the top 400m |
---|
276 | DO jj = 1, jpj |
---|
277 | DO ji = 1, jpi |
---|
278 | zc0 = zz0 * EXP( -fsdepw(ji,jj,jk )*xsi0r ) + zz1 * EXP( -fsdepw(ji,jj,jk )*xsi1r ) |
---|
279 | zc1 = zz0 * EXP( -fsdepw(ji,jj,jk+1)*xsi0r ) + zz1 * EXP( -fsdepw(ji,jj,jk+1)*xsi1r ) |
---|
280 | qsr_hc(ji,jj,jk) = qsr(ji,jj) * ( zc0*tmask(ji,jj,jk) - zc1*tmask(ji,jj,jk+1) ) |
---|
281 | END DO |
---|
282 | END DO |
---|
283 | END DO |
---|
284 | ! clem: store attenuation coefficient of the first ocean level |
---|
285 | IF ( ln_qsr_ice ) THEN |
---|
286 | DO jj = 1, jpj |
---|
287 | DO ji = 1, jpi |
---|
288 | zc0 = zz0 * EXP( -fsdepw(ji,jj,1)*xsi0r ) + zz1 * EXP( -fsdepw(ji,jj,1)*xsi1r ) |
---|
289 | zc1 = zz0 * EXP( -fsdepw(ji,jj,2)*xsi0r ) + zz1 * EXP( -fsdepw(ji,jj,2)*xsi1r ) |
---|
290 | fraqsr_1lev(ji,jj) = ( zc0*tmask(ji,jj,1) - zc1*tmask(ji,jj,2) ) / r1_rau0_rcp |
---|
291 | END DO |
---|
292 | END DO |
---|
293 | ENDIF |
---|
294 | ELSE !* constant volume: coef. computed one for all |
---|
295 | DO jk = 1, nksr |
---|
296 | DO jj = 2, jpjm1 |
---|
297 | DO ji = fs_2, fs_jpim1 ! vector opt. |
---|
298 | ! (ISF) no light penetration below the ice shelves |
---|
299 | qsr_hc(ji,jj,jk) = etot3(ji,jj,jk) * qsr(ji,jj) * tmask(ji,jj,1) |
---|
300 | END DO |
---|
301 | END DO |
---|
302 | END DO |
---|
303 | ! clem: store attenuation coefficient of the first ocean level |
---|
304 | IF ( ln_qsr_ice ) THEN |
---|
305 | fraqsr_1lev(:,:) = etot3(:,:,1) / r1_rau0_rcp |
---|
306 | ENDIF |
---|
307 | ! |
---|
308 | ENDIF |
---|
309 | ! |
---|
310 | ENDIF |
---|
311 | ! |
---|
312 | ! Add to the general trend |
---|
313 | DO jk = 1, nksr |
---|
314 | DO jj = 2, jpjm1 |
---|
315 | DO ji = fs_2, fs_jpim1 ! vector opt. |
---|
316 | z1_e3t = zfact / fse3t(ji,jj,jk) |
---|
317 | 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 |
---|
318 | END DO |
---|
319 | END DO |
---|
320 | END DO |
---|
321 | ! |
---|
322 | ENDIF |
---|
323 | ! |
---|
324 | IF( lrst_oce ) THEN ! Write in the ocean restart file |
---|
325 | ! ******************************* |
---|
326 | IF(lwp) WRITE(numout,*) |
---|
327 | IF(lwp) WRITE(numout,*) 'qsr tracer content forcing field written in ocean restart file ', & |
---|
328 | & 'at it= ', kt,' date= ', ndastp |
---|
329 | IF(lwp) WRITE(numout,*) '~~~~' |
---|
330 | CALL iom_rstput( kt, nitrst, numrow, 'qsr_hc_b', qsr_hc ) |
---|
331 | ! |
---|
332 | ENDIF |
---|
333 | |
---|
334 | IF( l_trdtra ) THEN ! qsr tracers trends saved for diagnostics |
---|
335 | ztrdt(:,:,:) = tsa(:,:,:,jp_tem) - ztrdt(:,:,:) |
---|
336 | CALL trd_tra( kt, 'TRA', jp_tem, jptra_qsr, ztrdt ) |
---|
337 | CALL wrk_dealloc( jpi, jpj, jpk, ztrdt ) |
---|
338 | ENDIF |
---|
339 | ! ! print mean trends (used for debugging) |
---|
340 | IF(ln_ctl) CALL prt_ctl( tab3d_1=tsa(:,:,:,jp_tem), clinfo1=' qsr - Ta: ', mask1=tmask, clinfo3='tra-ta' ) |
---|
341 | ! |
---|
342 | CALL wrk_dealloc( jpi, jpj, zekb, zekg, zekr ) |
---|
343 | CALL wrk_dealloc( jpi, jpj, jpk, ze0, ze1, ze2, ze3, zea ) |
---|
344 | ! |
---|
345 | IF( nn_timing == 1 ) CALL timing_stop('tra_qsr') |
---|
346 | ! |
---|
347 | END SUBROUTINE tra_qsr |
---|
348 | |
---|
349 | |
---|
350 | SUBROUTINE tra_qsr_init |
---|
351 | !!---------------------------------------------------------------------- |
---|
352 | !! *** ROUTINE tra_qsr_init *** |
---|
353 | !! |
---|
354 | !! ** Purpose : Initialization for the penetrative solar radiation |
---|
355 | !! |
---|
356 | !! ** Method : The profile of solar radiation within the ocean is set |
---|
357 | !! from two length scale of penetration (rn_si0,rn_si1) and a ratio |
---|
358 | !! (rn_abs). These parameters are read in the namtra_qsr namelist. The |
---|
359 | !! default values correspond to clear water (type I in Jerlov' |
---|
360 | !! (1968) classification. |
---|
361 | !! called by tra_qsr at the first timestep (nit000) |
---|
362 | !! |
---|
363 | !! ** Action : - initialize rn_si0, rn_si1 and rn_abs |
---|
364 | !! |
---|
365 | !! Reference : Jerlov, N. G., 1968 Optical Oceanography, Elsevier, 194pp. |
---|
366 | !!---------------------------------------------------------------------- |
---|
367 | ! |
---|
368 | INTEGER :: ji, jj, jk ! dummy loop indices |
---|
369 | INTEGER :: irgb, ierror, ioptio, nqsr ! local integer |
---|
370 | INTEGER :: ios ! Local integer output status for namelist read |
---|
371 | REAL(wp) :: zz0, zc0 , zc1, zcoef ! local scalars |
---|
372 | REAL(wp) :: zz1, zc2 , zc3, zchl ! - - |
---|
373 | REAL(wp), POINTER, DIMENSION(:,: ) :: zekb, zekg, zekr |
---|
374 | REAL(wp), POINTER, DIMENSION(:,:,:) :: ze0, ze1, ze2, ze3, zea |
---|
375 | ! |
---|
376 | CHARACTER(len=100) :: cn_dir ! Root directory for location of ssr files |
---|
377 | TYPE(FLD_N) :: sn_chl ! informations about the chlorofyl field to be read |
---|
378 | !! |
---|
379 | NAMELIST/namtra_qsr/ sn_chl, cn_dir, ln_traqsr, ln_qsr_rgb, ln_qsr_2bd, ln_qsr_bio, ln_qsr_ice, & |
---|
380 | & nn_chldta, rn_abs, rn_si0, rn_si1 |
---|
381 | !!---------------------------------------------------------------------- |
---|
382 | |
---|
383 | ! |
---|
384 | IF( nn_timing == 1 ) CALL timing_start('tra_qsr_init') |
---|
385 | ! |
---|
386 | CALL wrk_alloc( jpi, jpj, zekb, zekg, zekr ) |
---|
387 | CALL wrk_alloc( jpi, jpj, jpk, ze0, ze1, ze2, ze3, zea ) |
---|
388 | ! |
---|
389 | |
---|
390 | REWIND( numnam_ref ) ! Namelist namtra_qsr in reference namelist : Ratio and length of penetration |
---|
391 | READ ( numnam_ref, namtra_qsr, IOSTAT = ios, ERR = 901) |
---|
392 | 901 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtra_qsr in reference namelist', lwp ) |
---|
393 | |
---|
394 | REWIND( numnam_cfg ) ! Namelist namtra_qsr in configuration namelist : Ratio and length of penetration |
---|
395 | READ ( numnam_cfg, namtra_qsr, IOSTAT = ios, ERR = 902 ) |
---|
396 | 902 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtra_qsr in configuration namelist', lwp ) |
---|
397 | IF(lwm) WRITE ( numond, namtra_qsr ) |
---|
398 | ! |
---|
399 | IF(lwp) THEN ! control print |
---|
400 | WRITE(numout,*) |
---|
401 | WRITE(numout,*) 'tra_qsr_init : penetration of the surface solar radiation' |
---|
402 | WRITE(numout,*) '~~~~~~~~~~~~' |
---|
403 | WRITE(numout,*) ' Namelist namtra_qsr : set the parameter of penetration' |
---|
404 | WRITE(numout,*) ' Light penetration (T) or not (F) ln_traqsr = ', ln_traqsr |
---|
405 | WRITE(numout,*) ' RGB (Red-Green-Blue) light penetration ln_qsr_rgb = ', ln_qsr_rgb |
---|
406 | WRITE(numout,*) ' 2 band light penetration ln_qsr_2bd = ', ln_qsr_2bd |
---|
407 | WRITE(numout,*) ' bio-model light penetration ln_qsr_bio = ', ln_qsr_bio |
---|
408 | WRITE(numout,*) ' light penetration for ice-model LIM3 ln_qsr_ice = ', ln_qsr_ice |
---|
409 | WRITE(numout,*) ' RGB : Chl data (=1) or cst value (=0) nn_chldta = ', nn_chldta |
---|
410 | WRITE(numout,*) ' RGB & 2 bands: fraction of light (rn_si1) rn_abs = ', rn_abs |
---|
411 | WRITE(numout,*) ' RGB & 2 bands: shortess depth of extinction rn_si0 = ', rn_si0 |
---|
412 | WRITE(numout,*) ' 2 bands: longest depth of extinction rn_si1 = ', rn_si1 |
---|
413 | ENDIF |
---|
414 | |
---|
415 | ! allocate fraqsr_1lev if we have ln_qsr_ice |
---|
416 | IF( ln_qsr_ice ) THEN |
---|
417 | ALLOCATE( fraqsr_1lev(jpi,jpj) , STAT=ierror ) |
---|
418 | IF( ierror > 0 ) THEN |
---|
419 | CALL ctl_stop( 'tra_qsr_init: unable to allocate fraqsr_1lev array' ) ; RETURN |
---|
420 | ENDIF |
---|
421 | fraqsr_1lev(:,:) = 1._wp ! default definition used in the 1st time step as sbc_ssm is called before tra_qsr |
---|
422 | ENDIF |
---|
423 | |
---|
424 | IF( ln_traqsr ) THEN ! control consistency |
---|
425 | ! |
---|
426 | IF( .NOT.lk_qsr_bio .AND. ln_qsr_bio ) THEN |
---|
427 | CALL ctl_warn( 'No bio model : force ln_qsr_bio = FALSE ' ) |
---|
428 | ln_qsr_bio = .FALSE. |
---|
429 | ENDIF |
---|
430 | ! |
---|
431 | ioptio = 0 ! Parameter control |
---|
432 | IF( ln_qsr_rgb ) ioptio = ioptio + 1 |
---|
433 | IF( ln_qsr_2bd ) ioptio = ioptio + 1 |
---|
434 | IF( ln_qsr_bio ) ioptio = ioptio + 1 |
---|
435 | ! |
---|
436 | IF( ioptio /= 1 ) & |
---|
437 | CALL ctl_stop( ' Choose ONE type of light penetration in namelist namtra_qsr', & |
---|
438 | & ' 2 bands, 3 RGB bands or bio-model light penetration' ) |
---|
439 | ! |
---|
440 | IF( ln_qsr_rgb .AND. nn_chldta == 0 ) nqsr = 1 |
---|
441 | IF( ln_qsr_rgb .AND. nn_chldta == 1 ) nqsr = 2 |
---|
442 | IF( ln_qsr_2bd ) nqsr = 3 |
---|
443 | IF( ln_qsr_bio ) nqsr = 4 |
---|
444 | ! |
---|
445 | IF(lwp) THEN ! Print the choice |
---|
446 | WRITE(numout,*) |
---|
447 | IF( nqsr == 1 ) WRITE(numout,*) ' R-G-B light penetration - Constant Chlorophyll' |
---|
448 | IF( nqsr == 2 ) WRITE(numout,*) ' R-G-B light penetration - Chl data ' |
---|
449 | IF( nqsr == 3 ) WRITE(numout,*) ' 2 bands light penetration' |
---|
450 | IF( nqsr == 4 ) WRITE(numout,*) ' bio-model light penetration' |
---|
451 | ENDIF |
---|
452 | ! |
---|
453 | ENDIF |
---|
454 | ! ! ===================================== ! |
---|
455 | IF( ln_traqsr ) THEN ! Initialisation of Light Penetration ! |
---|
456 | ! ! ===================================== ! |
---|
457 | ! |
---|
458 | xsi0r = 1.e0 / rn_si0 |
---|
459 | xsi1r = 1.e0 / rn_si1 |
---|
460 | ! ! ---------------------------------- ! |
---|
461 | IF( ln_qsr_rgb ) THEN ! Red-Green-Blue light penetration ! |
---|
462 | ! ! ---------------------------------- ! |
---|
463 | ! |
---|
464 | CALL trc_oce_rgb( rkrgb ) !* tabulated attenuation coef. |
---|
465 | ! |
---|
466 | ! !* level of light extinction |
---|
467 | IF( ln_sco ) THEN ; nksr = jpkm1 |
---|
468 | ELSE ; nksr = trc_oce_ext_lev( r_si2, 0.33e2 ) |
---|
469 | ENDIF |
---|
470 | |
---|
471 | IF(lwp) WRITE(numout,*) ' level of light extinction = ', nksr, ' ref depth = ', gdepw_1d(nksr+1), ' m' |
---|
472 | ! |
---|
473 | IF( nn_chldta == 1 ) THEN !* Chl data : set sf_chl structure |
---|
474 | IF(lwp) WRITE(numout,*) |
---|
475 | IF(lwp) WRITE(numout,*) ' Chlorophyll read in a file' |
---|
476 | ALLOCATE( sf_chl(1), STAT=ierror ) |
---|
477 | IF( ierror > 0 ) THEN |
---|
478 | CALL ctl_stop( 'tra_qsr_init: unable to allocate sf_chl structure' ) ; RETURN |
---|
479 | ENDIF |
---|
480 | ALLOCATE( sf_chl(1)%fnow(jpi,jpj,1) ) |
---|
481 | IF( sn_chl%ln_tint )ALLOCATE( sf_chl(1)%fdta(jpi,jpj,1,2) ) |
---|
482 | ! ! fill sf_chl with sn_chl and control print |
---|
483 | CALL fld_fill( sf_chl, (/ sn_chl /), cn_dir, 'tra_qsr_init', & |
---|
484 | & 'Solar penetration function of read chlorophyll', 'namtra_qsr' ) |
---|
485 | ! |
---|
486 | ELSE !* constant Chl : compute once for all the distribution of light (etot3) |
---|
487 | IF(lwp) WRITE(numout,*) |
---|
488 | IF(lwp) WRITE(numout,*) ' Constant Chlorophyll concentration = 0.05' |
---|
489 | IF( lk_vvl ) THEN ! variable volume |
---|
490 | IF(lwp) WRITE(numout,*) ' key_vvl: light distribution will be computed at each time step' |
---|
491 | ELSE ! constant volume: computes one for all |
---|
492 | IF(lwp) WRITE(numout,*) ' fixed volume: light distribution computed one for all' |
---|
493 | ! |
---|
494 | zchl = 0.05 ! constant chlorophyll |
---|
495 | irgb = NINT( 41 + 20.*LOG10(zchl) + 1.e-15 ) |
---|
496 | zekb(:,:) = rkrgb(1,irgb) ! Separation in R-G-B depending of the chlorophyll |
---|
497 | zekg(:,:) = rkrgb(2,irgb) |
---|
498 | zekr(:,:) = rkrgb(3,irgb) |
---|
499 | ! |
---|
500 | zcoef = ( 1. - rn_abs ) / 3.e0 ! equi-partition in R-G-B |
---|
501 | ze0(:,:,1) = rn_abs |
---|
502 | ze1(:,:,1) = zcoef |
---|
503 | ze2(:,:,1) = zcoef |
---|
504 | ze3(:,:,1) = zcoef |
---|
505 | zea(:,:,1) = tmask(:,:,1) ! = ( ze0+ze1+z2+ze3 ) * tmask |
---|
506 | |
---|
507 | DO jk = 2, nksr+1 |
---|
508 | !CDIR NOVERRCHK |
---|
509 | DO jj = 1, jpj |
---|
510 | !CDIR NOVERRCHK |
---|
511 | DO ji = 1, jpi |
---|
512 | zc0 = ze0(ji,jj,jk-1) * EXP( - e3t_0(ji,jj,jk-1) * xsi0r ) |
---|
513 | zc1 = ze1(ji,jj,jk-1) * EXP( - e3t_0(ji,jj,jk-1) * zekb(ji,jj) ) |
---|
514 | zc2 = ze2(ji,jj,jk-1) * EXP( - e3t_0(ji,jj,jk-1) * zekg(ji,jj) ) |
---|
515 | zc3 = ze3(ji,jj,jk-1) * EXP( - e3t_0(ji,jj,jk-1) * zekr(ji,jj) ) |
---|
516 | ze0(ji,jj,jk) = zc0 |
---|
517 | ze1(ji,jj,jk) = zc1 |
---|
518 | ze2(ji,jj,jk) = zc2 |
---|
519 | ze3(ji,jj,jk) = zc3 |
---|
520 | zea(ji,jj,jk) = ( zc0 + zc1 + zc2 + zc3 ) * tmask(ji,jj,jk) |
---|
521 | END DO |
---|
522 | END DO |
---|
523 | END DO |
---|
524 | ! |
---|
525 | DO jk = 1, nksr |
---|
526 | ! (ISF) no light penetration below the ice shelves |
---|
527 | etot3(:,:,jk) = r1_rau0_rcp * ( zea(:,:,jk) - zea(:,:,jk+1) ) * tmask(:,:,1) |
---|
528 | END DO |
---|
529 | etot3(:,:,nksr+1:jpk) = 0.e0 ! below 400m set to zero |
---|
530 | ENDIF |
---|
531 | ENDIF |
---|
532 | ! |
---|
533 | ENDIF |
---|
534 | ! ! ---------------------------------- ! |
---|
535 | IF( ln_qsr_2bd ) THEN ! 2 bands light penetration ! |
---|
536 | ! ! ---------------------------------- ! |
---|
537 | ! |
---|
538 | ! ! level of light extinction |
---|
539 | nksr = trc_oce_ext_lev( rn_si1, 1.e2 ) |
---|
540 | IF(lwp) THEN |
---|
541 | WRITE(numout,*) |
---|
542 | IF(lwp) WRITE(numout,*) ' level of light extinction = ', nksr, ' ref depth = ', gdepw_1d(nksr+1), ' m' |
---|
543 | ENDIF |
---|
544 | ! |
---|
545 | IF( lk_vvl ) THEN ! variable volume |
---|
546 | IF(lwp) WRITE(numout,*) ' key_vvl: light distribution will be computed at each time step' |
---|
547 | ELSE ! constant volume: computes one for all |
---|
548 | zz0 = rn_abs * r1_rau0_rcp |
---|
549 | zz1 = ( 1. - rn_abs ) * r1_rau0_rcp |
---|
550 | DO jk = 1, nksr !* solar heat absorbed at T-point computed once for all |
---|
551 | DO jj = 1, jpj ! top 400 meters |
---|
552 | DO ji = 1, jpi |
---|
553 | zc0 = zz0 * EXP( -fsdepw(ji,jj,jk )*xsi0r ) + zz1 * EXP( -fsdepw(ji,jj,jk )*xsi1r ) |
---|
554 | zc1 = zz0 * EXP( -fsdepw(ji,jj,jk+1)*xsi0r ) + zz1 * EXP( -fsdepw(ji,jj,jk+1)*xsi1r ) |
---|
555 | etot3(ji,jj,jk) = ( zc0 * tmask(ji,jj,jk) - zc1 * tmask(ji,jj,jk+1) ) * tmask(ji,jj,1) |
---|
556 | END DO |
---|
557 | END DO |
---|
558 | END DO |
---|
559 | etot3(:,:,nksr+1:jpk) = 0.e0 ! below 400m set to zero |
---|
560 | ! |
---|
561 | ENDIF |
---|
562 | ENDIF |
---|
563 | ! ! ===================================== ! |
---|
564 | ELSE ! No light penetration ! |
---|
565 | ! ! ===================================== ! |
---|
566 | IF(lwp) THEN |
---|
567 | WRITE(numout,*) |
---|
568 | WRITE(numout,*) 'tra_qsr_init : NO solar flux penetration' |
---|
569 | WRITE(numout,*) '~~~~~~~~~~~~' |
---|
570 | ENDIF |
---|
571 | ENDIF |
---|
572 | ! |
---|
573 | CALL wrk_dealloc( jpi, jpj, zekb, zekg, zekr ) |
---|
574 | CALL wrk_dealloc( jpi, jpj, jpk, ze0, ze1, ze2, ze3, zea ) |
---|
575 | ! |
---|
576 | IF( nn_timing == 1 ) CALL timing_stop('tra_qsr_init') |
---|
577 | ! |
---|
578 | END SUBROUTINE tra_qsr_init |
---|
579 | |
---|
580 | !!====================================================================== |
---|
581 | END MODULE traqsr |
---|