1 | MODULE p4zopt |
---|
2 | !!====================================================================== |
---|
3 | !! *** MODULE p4zopt *** |
---|
4 | !! TOP - PISCES : Compute the light availability in the water column |
---|
5 | !!====================================================================== |
---|
6 | !! History : 1.0 ! 2004 (O. Aumont) Original code |
---|
7 | !! 2.0 ! 2007-12 (C. Ethe, G. Madec) F90 |
---|
8 | !! 3.2 ! 2009-04 (C. Ethe, G. Madec) optimisation |
---|
9 | !! 3.4 ! 2011-06 (O. Aumont, C. Ethe) Improve light availability of nano & diat |
---|
10 | !!---------------------------------------------------------------------- |
---|
11 | #if defined key_pisces |
---|
12 | !!---------------------------------------------------------------------- |
---|
13 | !! 'key_pisces' PISCES bio-model |
---|
14 | !!---------------------------------------------------------------------- |
---|
15 | !! p4z_opt : light availability in the water column |
---|
16 | !!---------------------------------------------------------------------- |
---|
17 | USE trc ! tracer variables |
---|
18 | USE oce_trc ! tracer-ocean share variables |
---|
19 | USE sms_pisces ! Source Minus Sink of PISCES |
---|
20 | USE iom ! I/O manager |
---|
21 | USE fldread ! time interpolation |
---|
22 | USE prtctl_trc ! print control for debugging |
---|
23 | |
---|
24 | |
---|
25 | IMPLICIT NONE |
---|
26 | PRIVATE |
---|
27 | |
---|
28 | PUBLIC p4z_opt ! called in p4zbio.F90 module |
---|
29 | PUBLIC p4z_opt_init ! called in trcsms_pisces.F90 module |
---|
30 | PUBLIC p4z_opt_alloc |
---|
31 | |
---|
32 | !! * Shared module variables |
---|
33 | |
---|
34 | LOGICAL :: ln_varpar !: boolean for variable PAR fraction |
---|
35 | REAL(wp) :: parlux !: Fraction of shortwave as PAR |
---|
36 | REAL(wp) :: xparsw !: parlux/3 |
---|
37 | REAL(wp) :: xsi0r !: 1. /rn_si0 |
---|
38 | |
---|
39 | TYPE(FLD), ALLOCATABLE, DIMENSION(:) :: sf_par ! structure of input par |
---|
40 | INTEGER , PARAMETER :: nbtimes = 365 !: maximum number of times record in a file |
---|
41 | INTEGER :: ntimes_par ! number of time steps in a file |
---|
42 | REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) :: par_varsw !: PAR fraction of shortwave |
---|
43 | |
---|
44 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: enano, ediat !: PAR for phyto, nano and diat |
---|
45 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: etot_ndcy !: PAR over 24h in case of diurnal cycle |
---|
46 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: emoy !: averaged PAR in the mixed layer |
---|
47 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: ekb, ekg, ekr !: wavelength (Red-Green-Blue) |
---|
48 | |
---|
49 | INTEGER :: nksrp ! levels below which the light cannot penetrate ( depth larger than 391 m) |
---|
50 | |
---|
51 | REAL(wp), DIMENSION(3,61), PUBLIC :: xkrgb !: tabulated attenuation coefficients for RGB absorption |
---|
52 | |
---|
53 | !!---------------------------------------------------------------------- |
---|
54 | !! NEMO/TOP 3.3 , NEMO Consortium (2010) |
---|
55 | !! $Id: p4zopt.F90 3160 2011-11-20 14:27:18Z cetlod $ |
---|
56 | !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) |
---|
57 | !!---------------------------------------------------------------------- |
---|
58 | CONTAINS |
---|
59 | |
---|
60 | SUBROUTINE p4z_opt( kt, knt ) |
---|
61 | !!--------------------------------------------------------------------- |
---|
62 | !! *** ROUTINE p4z_opt *** |
---|
63 | !! |
---|
64 | !! ** Purpose : Compute the light availability in the water column |
---|
65 | !! depending on the depth and the chlorophyll concentration |
---|
66 | !! |
---|
67 | !! ** Method : - ??? |
---|
68 | !!--------------------------------------------------------------------- |
---|
69 | ! |
---|
70 | INTEGER, INTENT(in) :: kt, knt ! ocean time step |
---|
71 | ! |
---|
72 | INTEGER :: ji, jj, jk |
---|
73 | INTEGER :: irgb |
---|
74 | REAL(wp) :: zchl |
---|
75 | REAL(wp) :: zc0 , zc1 , zc2, zc3, z1_dep |
---|
76 | REAL(wp), POINTER, DIMENSION(:,: ) :: zdepmoy, zetmp1, zetmp2, zetmp3, zetmp4 |
---|
77 | REAL(wp), POINTER, DIMENSION(:,: ) :: zqsr100, zqsr_corr |
---|
78 | REAL(wp), POINTER, DIMENSION(:,:,:) :: zpar, ze0, ze1, ze2, ze3 |
---|
79 | !!--------------------------------------------------------------------- |
---|
80 | ! |
---|
81 | IF( nn_timing == 1 ) CALL timing_start('p4z_opt') |
---|
82 | ! |
---|
83 | ! Allocate temporary workspace |
---|
84 | CALL wrk_alloc( jpi, jpj, zdepmoy, zetmp1, zetmp2, zetmp3, zetmp4 ) |
---|
85 | CALL wrk_alloc( jpi, jpj, zqsr100, zqsr_corr ) |
---|
86 | CALL wrk_alloc( jpi, jpj, jpk, zpar , ze0, ze1, ze2, ze3 ) |
---|
87 | |
---|
88 | IF( knt == 1 .AND. ln_varpar ) CALL p4z_opt_sbc( kt ) |
---|
89 | |
---|
90 | ! Initialisation of variables used to compute PAR |
---|
91 | ! ----------------------------------------------- |
---|
92 | ze1(:,:,:) = 0._wp |
---|
93 | ze2(:,:,:) = 0._wp |
---|
94 | ze3(:,:,:) = 0._wp |
---|
95 | ! !* attenuation coef. function of Chlorophyll and wavelength (Red-Green-Blue) |
---|
96 | DO jk = 1, jpkm1 ! -------------------------------------------------------- |
---|
97 | DO jj = 1, jpj |
---|
98 | DO ji = 1, jpi |
---|
99 | zchl = ( trb(ji,jj,jk,jpnch) + trb(ji,jj,jk,jpdch) + rtrn ) * 1.e6 |
---|
100 | zchl = MIN( 10. , MAX( 0.05, zchl ) ) |
---|
101 | irgb = NINT( 41 + 20.* LOG10( zchl ) + rtrn ) |
---|
102 | ! |
---|
103 | ekb(ji,jj,jk) = xkrgb(1,irgb) * e3t_n(ji,jj,jk) |
---|
104 | ekg(ji,jj,jk) = xkrgb(2,irgb) * e3t_n(ji,jj,jk) |
---|
105 | ekr(ji,jj,jk) = xkrgb(3,irgb) * e3t_n(ji,jj,jk) |
---|
106 | END DO |
---|
107 | END DO |
---|
108 | END DO |
---|
109 | ! !* Photosynthetically Available Radiation (PAR) |
---|
110 | ! ! -------------------------------------- |
---|
111 | IF( l_trcdm2dc ) THEN ! diurnal cycle |
---|
112 | ! |
---|
113 | zqsr_corr(:,:) = qsr_mean(:,:) / ( 1. - fr_i(:,:) + rtrn ) |
---|
114 | ! |
---|
115 | CALL p4z_opt_par( kt, zqsr_corr, ze1, ze2, ze3, pqsr100 = zqsr100 ) |
---|
116 | ! |
---|
117 | DO jk = 1, nksrp |
---|
118 | etot_ndcy(:,:,jk) = ze1(:,:,jk) + ze2(:,:,jk) + ze3(:,:,jk) |
---|
119 | enano (:,:,jk) = 2.1 * ze1(:,:,jk) + 0.42 * ze2(:,:,jk) + 0.4 * ze3(:,:,jk) |
---|
120 | ediat (:,:,jk) = 1.6 * ze1(:,:,jk) + 0.69 * ze2(:,:,jk) + 0.7 * ze3(:,:,jk) |
---|
121 | END DO |
---|
122 | ! |
---|
123 | zqsr_corr(:,:) = qsr(:,:) / ( 1. - fr_i(:,:) + rtrn ) |
---|
124 | ! |
---|
125 | CALL p4z_opt_par( kt, zqsr_corr, ze1, ze2, ze3 ) |
---|
126 | ! |
---|
127 | DO jk = 1, nksrp |
---|
128 | etot(:,:,jk) = ze1(:,:,jk) + ze2(:,:,jk) + ze3(:,:,jk) |
---|
129 | END DO |
---|
130 | ! |
---|
131 | ELSE |
---|
132 | ! |
---|
133 | zqsr_corr(:,:) = qsr(:,:) / ( 1. - fr_i(:,:) + rtrn ) |
---|
134 | ! |
---|
135 | CALL p4z_opt_par( kt, zqsr_corr, ze1, ze2, ze3, pqsr100 = zqsr100 ) |
---|
136 | ! |
---|
137 | DO jk = 1, nksrp |
---|
138 | etot (:,:,jk) = ze1(:,:,jk) + ze2(:,:,jk) + ze3(:,:,jk) |
---|
139 | enano(:,:,jk) = 2.1 * ze1(:,:,jk) + 0.42 * ze2(:,:,jk) + 0.4 * ze3(:,:,jk) |
---|
140 | ediat(:,:,jk) = 1.6 * ze1(:,:,jk) + 0.69 * ze2(:,:,jk) + 0.7 * ze3(:,:,jk) |
---|
141 | END DO |
---|
142 | etot_ndcy(:,:,:) = etot(:,:,:) |
---|
143 | ENDIF |
---|
144 | |
---|
145 | |
---|
146 | IF( ln_qsr_bio ) THEN !* heat flux accros w-level (used in the dynamics) |
---|
147 | ! ! ------------------------ |
---|
148 | CALL p4z_opt_par( kt, qsr, ze1, ze2, ze3, pe0=ze0 ) |
---|
149 | ! |
---|
150 | etot3(:,:,1) = qsr(:,:) * tmask(:,:,1) |
---|
151 | DO jk = 2, nksrp + 1 |
---|
152 | etot3(:,:,jk) = ( ze0(:,:,jk) + ze1(:,:,jk) + ze2(:,:,jk) + ze3(:,:,jk) ) * tmask(:,:,jk) |
---|
153 | END DO |
---|
154 | ! ! ------------------------ |
---|
155 | ENDIF |
---|
156 | ! !* Euphotic depth and level |
---|
157 | neln(:,:) = 1 ! ------------------------ |
---|
158 | heup(:,:) = 300. |
---|
159 | |
---|
160 | DO jk = 2, nksrp |
---|
161 | DO jj = 1, jpj |
---|
162 | DO ji = 1, jpi |
---|
163 | IF( etot_ndcy(ji,jj,jk) * tmask(ji,jj,jk) >= zqsr100(ji,jj) ) THEN |
---|
164 | neln(ji,jj) = jk+1 ! Euphotic level : 1rst T-level strictly below Euphotic layer |
---|
165 | ! ! nb: ensure the compatibility with nmld_trc definition in trd_mld_trc_zint |
---|
166 | heup(ji,jj) = gdepw_n(ji,jj,jk+1) ! Euphotic layer depth |
---|
167 | ENDIF |
---|
168 | END DO |
---|
169 | END DO |
---|
170 | END DO |
---|
171 | ! |
---|
172 | heup(:,:) = MIN( 300., heup(:,:) ) |
---|
173 | ! !* mean light over the mixed layer |
---|
174 | zdepmoy(:,:) = 0.e0 ! ------------------------------- |
---|
175 | zetmp1 (:,:) = 0.e0 |
---|
176 | zetmp2 (:,:) = 0.e0 |
---|
177 | zetmp3 (:,:) = 0.e0 |
---|
178 | zetmp4 (:,:) = 0.e0 |
---|
179 | |
---|
180 | DO jk = 1, nksrp |
---|
181 | DO jj = 1, jpj |
---|
182 | DO ji = 1, jpi |
---|
183 | IF( gdepw_n(ji,jj,jk+1) <= hmld(ji,jj) ) THEN |
---|
184 | zetmp1 (ji,jj) = zetmp1 (ji,jj) + etot (ji,jj,jk) * e3t_n(ji,jj,jk) ! remineralisation |
---|
185 | zetmp2 (ji,jj) = zetmp2 (ji,jj) + etot_ndcy(ji,jj,jk) * e3t_n(ji,jj,jk) ! production |
---|
186 | zetmp3 (ji,jj) = zetmp3 (ji,jj) + enano (ji,jj,jk) * e3t_n(ji,jj,jk) ! production |
---|
187 | zetmp4 (ji,jj) = zetmp4 (ji,jj) + ediat (ji,jj,jk) * e3t_n(ji,jj,jk) ! production |
---|
188 | zdepmoy(ji,jj) = zdepmoy(ji,jj) + e3t_n(ji,jj,jk) |
---|
189 | ENDIF |
---|
190 | END DO |
---|
191 | END DO |
---|
192 | END DO |
---|
193 | ! |
---|
194 | emoy(:,:,:) = etot(:,:,:) ! remineralisation |
---|
195 | zpar(:,:,:) = etot_ndcy(:,:,:) ! diagnostic : PAR with no diurnal cycle |
---|
196 | ! |
---|
197 | DO jk = 1, nksrp |
---|
198 | DO jj = 1, jpj |
---|
199 | DO ji = 1, jpi |
---|
200 | IF( gdepw_n(ji,jj,jk+1) <= hmld(ji,jj) ) THEN |
---|
201 | z1_dep = 1. / ( zdepmoy(ji,jj) + rtrn ) |
---|
202 | emoy (ji,jj,jk) = zetmp1(ji,jj) * z1_dep |
---|
203 | zpar (ji,jj,jk) = zetmp2(ji,jj) * z1_dep |
---|
204 | enano(ji,jj,jk) = zetmp3(ji,jj) * z1_dep |
---|
205 | ediat(ji,jj,jk) = zetmp4(ji,jj) * z1_dep |
---|
206 | ENDIF |
---|
207 | END DO |
---|
208 | END DO |
---|
209 | END DO |
---|
210 | ! |
---|
211 | IF( lk_iomput ) THEN |
---|
212 | IF( knt == nrdttrc ) THEN |
---|
213 | IF( iom_use( "Heup" ) ) CALL iom_put( "Heup" , heup(:,: ) * tmask(:,:,1) ) ! euphotic layer deptht |
---|
214 | IF( iom_use( "PARDM" ) ) CALL iom_put( "PARDM", zpar(:,:,:) * tmask(:,:,:) ) ! Photosynthetically Available Radiation |
---|
215 | IF( iom_use( "PAR" ) ) CALL iom_put( "PAR" , emoy(:,:,:) * tmask(:,:,:) ) ! Photosynthetically Available Radiation |
---|
216 | ENDIF |
---|
217 | ELSE |
---|
218 | IF( ln_diatrc ) THEN ! save output diagnostics |
---|
219 | trc2d(:,:, jp_pcs0_2d + 10) = heup(:,: ) * tmask(:,:,1) |
---|
220 | trc3d(:,:,:,jp_pcs0_3d + 3) = etot(:,:,:) * tmask(:,:,:) |
---|
221 | ENDIF |
---|
222 | ENDIF |
---|
223 | ! |
---|
224 | CALL wrk_dealloc( jpi, jpj, zdepmoy, zetmp1, zetmp2, zetmp3, zetmp4 ) |
---|
225 | CALL wrk_dealloc( jpi, jpj, zqsr100, zqsr_corr ) |
---|
226 | CALL wrk_dealloc( jpi, jpj, jpk, zpar , ze0, ze1, ze2, ze3 ) |
---|
227 | ! |
---|
228 | IF( nn_timing == 1 ) CALL timing_stop('p4z_opt') |
---|
229 | ! |
---|
230 | END SUBROUTINE p4z_opt |
---|
231 | |
---|
232 | SUBROUTINE p4z_opt_par( kt, pqsr, pe1, pe2, pe3, pe0, pqsr100 ) |
---|
233 | !!---------------------------------------------------------------------- |
---|
234 | !! *** routine p4z_opt_par *** |
---|
235 | !! |
---|
236 | !! ** purpose : compute PAR of each wavelength (Red-Green-Blue) |
---|
237 | !! for a given shortwave radiation |
---|
238 | !! |
---|
239 | !!---------------------------------------------------------------------- |
---|
240 | !! * arguments |
---|
241 | INTEGER, INTENT(in) :: kt ! ocean time-step |
---|
242 | REAL(wp), DIMENSION(jpi,jpj) , INTENT(in) :: pqsr ! shortwave |
---|
243 | REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(inout) :: pe1 , pe2 , pe3 ! PAR ( R-G-B) |
---|
244 | REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(inout), OPTIONAL :: pe0 |
---|
245 | REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(out) , OPTIONAL :: pqsr100 |
---|
246 | !! * local variables |
---|
247 | INTEGER :: ji, jj, jk ! dummy loop indices |
---|
248 | REAL(wp), DIMENSION(jpi,jpj) :: zqsr ! shortwave |
---|
249 | !!---------------------------------------------------------------------- |
---|
250 | |
---|
251 | ! Real shortwave |
---|
252 | IF( ln_varpar ) THEN ; zqsr(:,:) = par_varsw(:,:) * pqsr(:,:) |
---|
253 | ELSE ; zqsr(:,:) = xparsw * pqsr(:,:) |
---|
254 | ENDIF |
---|
255 | |
---|
256 | ! Light at the euphotic depth |
---|
257 | IF( PRESENT( pqsr100 ) ) pqsr100(:,:) = 0.01 * 3. * zqsr(:,:) |
---|
258 | |
---|
259 | IF( PRESENT( pe0 ) ) THEN ! W-level |
---|
260 | ! |
---|
261 | pe0(:,:,1) = pqsr(:,:) - 3. * zqsr(:,:) ! ( 1 - 3 * alpha ) * q |
---|
262 | pe1(:,:,1) = zqsr(:,:) |
---|
263 | pe2(:,:,1) = zqsr(:,:) |
---|
264 | pe3(:,:,1) = zqsr(:,:) |
---|
265 | ! |
---|
266 | DO jk = 2, nksrp + 1 |
---|
267 | DO jj = 1, jpj |
---|
268 | DO ji = 1, jpi |
---|
269 | pe0(ji,jj,jk) = pe0(ji,jj,jk-1) * EXP( -e3t_n(ji,jj,jk-1) * xsi0r ) |
---|
270 | pe1(ji,jj,jk) = pe1(ji,jj,jk-1) * EXP( -ekb(ji,jj,jk-1 ) ) |
---|
271 | pe2(ji,jj,jk) = pe2(ji,jj,jk-1) * EXP( -ekg(ji,jj,jk-1 ) ) |
---|
272 | pe3(ji,jj,jk) = pe3(ji,jj,jk-1) * EXP( -ekr(ji,jj,jk-1 ) ) |
---|
273 | END DO |
---|
274 | ! |
---|
275 | END DO |
---|
276 | ! |
---|
277 | END DO |
---|
278 | ! |
---|
279 | ELSE ! T- level |
---|
280 | ! |
---|
281 | pe1(:,:,1) = zqsr(:,:) * EXP( -0.5 * ekb(:,:,1) ) |
---|
282 | pe2(:,:,1) = zqsr(:,:) * EXP( -0.5 * ekg(:,:,1) ) |
---|
283 | pe3(:,:,1) = zqsr(:,:) * EXP( -0.5 * ekr(:,:,1) ) |
---|
284 | ! |
---|
285 | DO jk = 2, nksrp |
---|
286 | DO jj = 1, jpj |
---|
287 | DO ji = 1, jpi |
---|
288 | pe1(ji,jj,jk) = pe1(ji,jj,jk-1) * EXP( -0.5 * ( ekb(ji,jj,jk-1) + ekb(ji,jj,jk) ) ) |
---|
289 | pe2(ji,jj,jk) = pe2(ji,jj,jk-1) * EXP( -0.5 * ( ekg(ji,jj,jk-1) + ekg(ji,jj,jk) ) ) |
---|
290 | pe3(ji,jj,jk) = pe3(ji,jj,jk-1) * EXP( -0.5 * ( ekr(ji,jj,jk-1) + ekr(ji,jj,jk) ) ) |
---|
291 | END DO |
---|
292 | END DO |
---|
293 | END DO |
---|
294 | ! |
---|
295 | ENDIF |
---|
296 | ! |
---|
297 | END SUBROUTINE p4z_opt_par |
---|
298 | |
---|
299 | |
---|
300 | SUBROUTINE p4z_opt_sbc( kt ) |
---|
301 | !!---------------------------------------------------------------------- |
---|
302 | !! *** routine p4z_opt_sbc *** |
---|
303 | !! |
---|
304 | !! ** purpose : read and interpolate the variable PAR fraction |
---|
305 | !! of shortwave radiation |
---|
306 | !! |
---|
307 | !! ** method : read the files and interpolate the appropriate variables |
---|
308 | !! |
---|
309 | !! ** input : external netcdf files |
---|
310 | !! |
---|
311 | !!---------------------------------------------------------------------- |
---|
312 | !! * arguments |
---|
313 | INTEGER , INTENT(in) :: kt ! ocean time step |
---|
314 | |
---|
315 | !! * local declarations |
---|
316 | INTEGER :: ji,jj |
---|
317 | REAL(wp) :: zcoef |
---|
318 | !!--------------------------------------------------------------------- |
---|
319 | ! |
---|
320 | IF( nn_timing == 1 ) CALL timing_start('p4z_optsbc') |
---|
321 | ! |
---|
322 | ! Compute par_varsw at nit000 or only if there is more than 1 time record in par coefficient file |
---|
323 | IF( ln_varpar ) THEN |
---|
324 | IF( kt == nit000 .OR. ( kt /= nit000 .AND. ntimes_par > 1 ) ) THEN |
---|
325 | CALL fld_read( kt, 1, sf_par ) |
---|
326 | par_varsw(:,:) = ( sf_par(1)%fnow(:,:,1) ) / 3.0 |
---|
327 | ENDIF |
---|
328 | ENDIF |
---|
329 | ! |
---|
330 | IF( nn_timing == 1 ) CALL timing_stop('p4z_optsbc') |
---|
331 | ! |
---|
332 | END SUBROUTINE p4z_opt_sbc |
---|
333 | |
---|
334 | SUBROUTINE p4z_opt_init |
---|
335 | !!---------------------------------------------------------------------- |
---|
336 | !! *** ROUTINE p4z_opt_init *** |
---|
337 | !! |
---|
338 | !! ** Purpose : Initialization of tabulated attenuation coef |
---|
339 | !! and of the percentage of PAR in Shortwave |
---|
340 | !! |
---|
341 | !! ** Input : external ascii and netcdf files |
---|
342 | !!---------------------------------------------------------------------- |
---|
343 | ! |
---|
344 | INTEGER :: numpar |
---|
345 | INTEGER :: ierr |
---|
346 | INTEGER :: ios ! Local integer output status for namelist read |
---|
347 | REAL(wp), DIMENSION(nbtimes) :: zsteps ! times records |
---|
348 | ! |
---|
349 | CHARACTER(len=100) :: cn_dir ! Root directory for location of ssr files |
---|
350 | TYPE(FLD_N) :: sn_par ! informations about the fields to be read |
---|
351 | ! |
---|
352 | NAMELIST/nampisopt/cn_dir, sn_par, ln_varpar, parlux |
---|
353 | |
---|
354 | !!---------------------------------------------------------------------- |
---|
355 | |
---|
356 | IF( nn_timing == 1 ) CALL timing_start('p4z_opt_init') |
---|
357 | |
---|
358 | REWIND( numnatp_ref ) ! Namelist nampisopt in reference namelist : Pisces attenuation coef. and PAR |
---|
359 | READ ( numnatp_ref, nampisopt, IOSTAT = ios, ERR = 901) |
---|
360 | 901 IF( ios /= 0 ) CALL ctl_nam ( ios , 'nampisopt in reference namelist', lwp ) |
---|
361 | |
---|
362 | REWIND( numnatp_cfg ) ! Namelist nampisopt in configuration namelist : Pisces attenuation coef. and PAR |
---|
363 | READ ( numnatp_cfg, nampisopt, IOSTAT = ios, ERR = 902 ) |
---|
364 | 902 IF( ios /= 0 ) CALL ctl_nam ( ios , 'nampisopt in configuration namelist', lwp ) |
---|
365 | IF(lwm) WRITE ( numonp, nampisopt ) |
---|
366 | |
---|
367 | IF(lwp) THEN |
---|
368 | WRITE(numout,*) ' ' |
---|
369 | WRITE(numout,*) ' namelist : nampisopt ' |
---|
370 | WRITE(numout,*) ' ~~~~~~~~~~~~~~~~~ ' |
---|
371 | WRITE(numout,*) ' PAR as a variable fraction of SW ln_varpar = ', ln_varpar |
---|
372 | WRITE(numout,*) ' Default value for the PAR fraction parlux = ', parlux |
---|
373 | ENDIF |
---|
374 | ! |
---|
375 | xparsw = parlux / 3.0 |
---|
376 | xsi0r = 1.e0 / rn_si0 |
---|
377 | ! |
---|
378 | ! Variable PAR at the surface of the ocean |
---|
379 | ! ---------------------------------------- |
---|
380 | IF( ln_varpar ) THEN |
---|
381 | IF(lwp) WRITE(numout,*) ' initialize variable par fraction ' |
---|
382 | IF(lwp) WRITE(numout,*) ' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~' |
---|
383 | ! |
---|
384 | ALLOCATE( par_varsw(jpi,jpj) ) |
---|
385 | ! |
---|
386 | ALLOCATE( sf_par(1), STAT=ierr ) !* allocate and fill sf_sst (forcing structure) with sn_sst |
---|
387 | IF( ierr > 0 ) CALL ctl_stop( 'STOP', 'p4z_opt_init: unable to allocate sf_par structure' ) |
---|
388 | ! |
---|
389 | CALL fld_fill( sf_par, (/ sn_par /), cn_dir, 'p4z_opt_init', 'Variable PAR fraction ', 'nampisopt' ) |
---|
390 | ALLOCATE( sf_par(1)%fnow(jpi,jpj,1) ) |
---|
391 | IF( sn_par%ln_tint ) ALLOCATE( sf_par(1)%fdta(jpi,jpj,1,2) ) |
---|
392 | |
---|
393 | CALL iom_open ( TRIM( sn_par%clname ) , numpar ) |
---|
394 | CALL iom_gettime( numpar, zsteps, kntime=ntimes_par) ! get number of record in file |
---|
395 | ENDIF |
---|
396 | ! |
---|
397 | CALL trc_oce_rgb( xkrgb ) ! tabulated attenuation coefficients |
---|
398 | nksrp = trc_oce_ext_lev( r_si2, 0.33e2 ) ! max level of light extinction (Blue Chl=0.01) |
---|
399 | ! |
---|
400 | IF(lwp) WRITE(numout,*) ' level of light extinction = ', nksrp, ' ref depth = ', gdepw_1d(nksrp+1), ' m' |
---|
401 | ! |
---|
402 | ekr (:,:,:) = 0._wp |
---|
403 | ekb (:,:,:) = 0._wp |
---|
404 | ekg (:,:,:) = 0._wp |
---|
405 | etot (:,:,:) = 0._wp |
---|
406 | etot_ndcy(:,:,:) = 0._wp |
---|
407 | enano (:,:,:) = 0._wp |
---|
408 | ediat (:,:,:) = 0._wp |
---|
409 | IF( ln_qsr_bio ) etot3 (:,:,:) = 0._wp |
---|
410 | ! |
---|
411 | IF( nn_timing == 1 ) CALL timing_stop('p4z_opt_init') |
---|
412 | ! |
---|
413 | END SUBROUTINE p4z_opt_init |
---|
414 | |
---|
415 | |
---|
416 | INTEGER FUNCTION p4z_opt_alloc() |
---|
417 | !!---------------------------------------------------------------------- |
---|
418 | !! *** ROUTINE p4z_opt_alloc *** |
---|
419 | !!---------------------------------------------------------------------- |
---|
420 | ALLOCATE( ekb(jpi,jpj,jpk) , ekr(jpi,jpj,jpk), ekg(jpi,jpj,jpk), & |
---|
421 | & enano(jpi,jpj,jpk) , ediat(jpi,jpj,jpk), & |
---|
422 | & etot_ndcy(jpi,jpj,jpk), emoy (jpi,jpj,jpk), STAT=p4z_opt_alloc ) |
---|
423 | ! |
---|
424 | IF( p4z_opt_alloc /= 0 ) CALL ctl_warn('p4z_opt_alloc : failed to allocate arrays.') |
---|
425 | ! |
---|
426 | END FUNCTION p4z_opt_alloc |
---|
427 | |
---|
428 | #else |
---|
429 | !!---------------------------------------------------------------------- |
---|
430 | !! Dummy module : No PISCES bio-model |
---|
431 | !!---------------------------------------------------------------------- |
---|
432 | CONTAINS |
---|
433 | SUBROUTINE p4z_opt ! Empty routine |
---|
434 | END SUBROUTINE p4z_opt |
---|
435 | #endif |
---|
436 | |
---|
437 | !!====================================================================== |
---|
438 | END MODULE p4zopt |
---|