- Timestamp:
- 2009-05-07T16:34:11+02:00 (15 years ago)
- Location:
- branches/dev_004_VVL/NEMO/OPA_SRC
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/dev_004_VVL/NEMO/OPA_SRC/TRA/traqsr.F90
r1146 r1431 4 4 !! Ocean physics: solar radiation penetration in the top ocean levels 5 5 !!====================================================================== 6 !! History : 6.0 ! 90-10 (B. Blanke) Original code 7 !! 7.0 ! 91-11 (G. Madec) 8 !! ! 96-01 (G. Madec) s-coordinates 9 !! 8.5 ! 02-06 (G. Madec) F90: Free form and module 10 !! 9.0 ! 05-11 (G. Madec) zco, zps, sco coordinate 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) 11 12 !!---------------------------------------------------------------------- 12 13 … … 24 25 USE phycst ! physical constants 25 26 USE prtctl ! Print control 27 USE iom ! I/O manager 28 USE fldread ! read input fields 26 29 27 30 IMPLICIT NONE 28 31 PRIVATE 29 32 30 PUBLIC tra_qsr ! routine called by step.F90 (ln_traqsr=T) 31 PUBLIC tra_qsr_init ! routine called by opa.F90 32 33 !!* Namelist namqsr: penetrative solar radiation 34 LOGICAL , PUBLIC :: ln_traqsr = .TRUE. !: qsr flag (Default=T) 35 REAL(wp), PUBLIC :: rabs = 0.58_wp ! fraction associated with xsi1 36 REAL(wp), PUBLIC :: xsi1 = 0.35_wp ! first depth of extinction 37 REAL(wp), PUBLIC :: xsi2 = 23.0_wp ! second depth of extinction (default values: water type Ib) 38 LOGICAL , PUBLIC :: ln_qsr_sms = .false. ! flag to use or not the biological fluxes for light 33 PUBLIC tra_qsr ! routine called by step.F90 (ln_traqsr=T) 34 35 ! !!* Namelist namqsr: penetrative solar radiation 36 LOGICAL , PUBLIC :: ln_traqsr = .TRUE. !: light absorption (qsr) flag 37 LOGICAL , PUBLIC :: ln_qsr_rgb = .FALSE. !: Red-Green-Blue light absorption flag 38 LOGICAL , PUBLIC :: ln_qsr_bio = .FALSE. !: bio-model light absorption flag 39 INTEGER , PUBLIC :: nn_chldta = 0 !: use Chlorophyll data (=1) or not (=0) 40 REAL(wp), PUBLIC :: rn_abs = 0.58_wp !: fraction absorbed in the very near surface (RGB & 2 bands) 41 REAL(wp), PUBLIC :: rn_si0 = 0.35_wp !: very near surface depth of extinction (RGB & 2 bands) 42 REAL(wp), PUBLIC :: rn_si1 = 23.0_wp !: deepest depth of extinction (water type I) (2 bands) 43 REAL(wp), PUBLIC :: rn_si2 = 61.8_wp !: deepest depth of extinction (blue & 0.01 mg.m-3) (RGB) 39 44 40 INTEGER :: nksr ! number of levels 41 REAL(wp), DIMENSION(jpk) :: gdsr ! profile of the solar flux penetration 45 TYPE(FLD), ALLOCATABLE, DIMENSION(:) :: sf_chl ! structure of input Chl (file informations, fields read) 42 46 43 47 !! * Substitutions … … 45 49 # include "vectopt_loop_substitute.h90" 46 50 !!---------------------------------------------------------------------- 47 !! OPA 9.0 , LOCEAN-IPSL (2005)51 !! NEMO/OPA 3.2 , LOCEAN-IPSL (2009) 48 52 !! $Id$ 49 53 !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) … … 59 63 !! penetration and add it to the general temperature trend. 60 64 !! 61 !! ** Method : The profile of the solar radiation within the ocean is 62 !! defined through two penetration length scale (xsr1,xsr2) and a 63 !! ratio (rabs) as : 64 !! I(k) = Qsr*( rabs*EXP(z(k)/xsr1) + (1.-rabs)*EXP(z(k)/xsr2) ) 65 !! The temperature trend associated with the solar radiation 66 !! penetration is given by : 67 !! zta = 1/e3t dk[ I ] / (rau0*Cp) 65 !! ** Method : The profile of the solar radiation within the ocean is defined 66 !! through 2 wavebands (rn_si0,rn_si1) or 3 wavebands (RGB) and a ratio rn_abs 67 !! Considering the 2 wavebands case: 68 !! I(k) = Qsr*( rn_abs*EXP(z(k)/rn_si0) + (1.-rn_abs)*EXP(z(k)/rn_si1) ) 69 !! The temperature trend associated with the solar radiation penetration 70 !! is given by : zta = 1/e3t dk[ I ] / (rau0*Cp) 68 71 !! At the bottom, boudary condition for the radiation is no flux : 69 72 !! all heat which has not been absorbed in the above levels is put … … 76 79 !! ** Action : - update ta with the penetrative solar radiation trend 77 80 !! - save the trend in ttrd ('key_trdtra') 81 !! 82 !! Reference : Jerlov, N. G., 1968 Optical Oceanography, Elsevier, 194pp. 83 !! Lengaigne et al. 2007, Clim. Dyn., V28, 5, 503-516. 78 84 !!---------------------------------------------------------------------- 79 85 USE oce, ONLY : ztrdt => ua ! use ua as 3D workspace … … 82 88 INTEGER, INTENT(in) :: kt ! ocean time-step 83 89 !! 84 INTEGER :: ji, jj, jk ! dummy loop indexes 85 REAL(wp) :: zc0 , zta ! temporary scalars 90 INTEGER :: ji, jj, jk ! dummy loop indices 91 INTEGER :: irgb ! temporary integers 92 REAL(wp) :: zchl, zcoef, zsi0r ! temporary scalars 93 REAL(wp) :: zc0, zc1, zc2, zc3 ! - - 94 REAL(wp), DIMENSION(jpi,jpj) :: zekb, zekg, zekr ! 2D workspace 95 REAL(wp), DIMENSION(jpi,jpj,jpk) :: ze0, ze1 , ze2, ze3, zea ! 3D workspace 86 96 !!---------------------------------------------------------------------- 87 97 … … 91 101 IF(lwp) WRITE(numout,*) '~~~~~~~' 92 102 CALL tra_qsr_init 103 IF( .NOT.ln_traqsr ) RETURN 93 104 ENDIF 94 105 … … 98 109 ENDIF 99 110 100 ! ---------------------------------------------- ! 101 ! Biological fluxes : all vertical coordinate ! 102 ! ---------------------------------------------- ! 103 IF( lk_qsr_sms .AND. ln_qsr_sms ) THEN 104 ! ! =============== 105 DO jk = 1, jpkm1 ! Horizontal slab 106 ! ! =============== 111 112 ! ! ============================================== ! 113 IF( lk_qsr_bio ) THEN ! bio-model fluxes : all vertical coordinates ! 114 ! ! ============================================== ! 115 DO jk = 1, jpkm1 107 116 DO jj = 2, jpjm1 108 117 DO ji = fs_2, fs_jpim1 ! vector opt. 109 zc0 = ro0cpr / fse3t(ji,jj,jk) ! compute the qsr trend 110 zta = zc0 * ( etot3(ji,jj,jk ) * tmask(ji,jj,jk) & 111 & - etot3(ji,jj,jk+1) * tmask(ji,jj,jk+1) ) 112 ta(ji,jj,jk) = ta(ji,jj,jk) + zta ! add qsr trend to the temperature trend 118 ta(ji,jj,jk) = ta(ji,jj,jk) + ro0cpr * ( etot3(ji,jj,jk) - etot3(ji,jj,jk+1) ) / fse3t(ji,jj,jk) 113 119 END DO 114 120 END DO 115 ! ! =============== 116 END DO ! End of slab 117 ! ! =============== 118 119 ! ---------------------------------------------- ! 120 ! Ocean alone : 121 ! ---------------------------------------------- ! 122 ELSE 123 ! ! =================== ! 124 IF( ln_sco ) THEN ! s-coordinate ! 125 ! ! =================== ! 126 DO jk = 1, jpkm1 127 ta(:,:,jk) = ta(:,:,jk) + etot3(:,:,jk) * qsr(:,:) 128 END DO 129 ENDIF 130 ! ! =================== ! 131 IF( ln_zps ) THEN ! partial steps ! 132 ! ! =================== ! 121 END DO 122 ! ! ============================================== ! 123 ELSE ! Ocean alone : 124 ! ! ============================================== ! 125 ! 126 ! ! ------------------------- ! 127 IF( ln_qsr_rgb) THEN ! R-G-B light penetration ! 128 ! ! ------------------------- ! 129 ! Set chlorophyl concentration 130 IF( nn_chldta ==1 ) THEN !* Variable Chlorophyll 131 ! 132 CALL fld_read( kt, 1, sf_chl ) ! Read Chl data and provides it at the current time step 133 ! 134 !CDIR COLLAPSE 135 !CDIR NOVERRCHK 136 DO jj = 1, jpj ! Separation in R-G-B depending of the surface Chl 137 !CDIR NOVERRCHK 138 DO ji = 1, jpi 139 zchl = MIN( 10. , MAX( 0.03, sf_chl(1)%fnow(ji,jj) ) ) 140 irgb = NINT( 41 + 20.*LOG10(zchl) + 1.e-15 ) 141 zekb(ji,jj) = rkrgb(1,irgb) 142 zekg(ji,jj) = rkrgb(2,irgb) 143 zekr(ji,jj) = rkrgb(3,irgb) 144 END DO 145 END DO 146 ! 147 zsi0r = 1.e0 / rn_si0 148 zcoef = ( 1. - rn_abs ) / 3.e0 ! equi-partition in R-G-B 149 ze0(:,:,1) = rn_abs * qsr(:,:) 150 ze1(:,:,1) = zcoef * qsr(:,:) 151 ze2(:,:,1) = zcoef * qsr(:,:) 152 ze3(:,:,1) = zcoef * qsr(:,:) 153 zea(:,:,1) = qsr(:,:) 154 ! 155 DO jk = 2, nksr+1 156 !CDIR NOVERRCHK 157 DO jj = 1, jpj 158 !CDIR NOVERRCHK 159 DO ji = 1, jpi 160 zc0 = ze0(ji,jj,jk-1) * EXP( - fse3t(ji,jj,jk-1) * zsi0r ) 161 zc1 = ze1(ji,jj,jk-1) * EXP( - fse3t(ji,jj,jk-1) * zekb(ji,jj) ) 162 zc2 = ze2(ji,jj,jk-1) * EXP( - fse3t(ji,jj,jk-1) * zekg(ji,jj) ) 163 zc3 = ze3(ji,jj,jk-1) * EXP( - fse3t(ji,jj,jk-1) * zekr(ji,jj) ) 164 ze0(ji,jj,jk) = zc0 165 ze1(ji,jj,jk) = zc1 166 ze2(ji,jj,jk) = zc2 167 ze3(ji,jj,jk) = zc3 168 zea(ji,jj,jk) = ( zc0 + zc1 + zc2 + zc3 ) * tmask(ji,jj,jk) 169 END DO 170 END DO 171 END DO 172 ! 173 DO jk = 1, nksr ! compute and add qsr trend to ta 174 ta(:,:,jk) = ta(:,:,jk) + ro0cpr * ( zea(:,:,jk) - zea(:,:,jk+1) ) / fse3t(:,:,jk) 175 END DO 176 ! 177 ELSE !* Constant Chlorophyll 178 DO jk = 1, nksr 179 ta(:,:,jk) = ta(:,:,jk) + etot3(:,:,jk) * qsr(:,:) 180 END DO 181 ENDIF 182 183 !!gm BUG the case key_vvl is missing: etot3 should be recomputed at each time step !!! 184 185 ! ! ------------------------- ! 186 ELSE ! 2 band light penetration ! 187 ! ! ------------------------- ! 188 ! 133 189 DO jk = 1, nksr 134 190 DO jj = 2, jpjm1 135 191 DO ji = fs_2, fs_jpim1 ! vector opt. 136 ! qsr trend from gdsr 137 zc0 = qsr(ji,jj) / fse3t(ji,jj,jk) 138 zta = zc0 * ( gdsr(jk) * tmask(ji,jj,jk) - gdsr(jk+1) * tmask(ji,jj,jk+1) ) 139 ! add qsr trend to the temperature trend 140 ta(ji,jj,jk) = ta(ji,jj,jk) + zta 192 ta(ji,jj,jk) = ta(ji,jj,jk) + etot3(ji,jj,jk) * qsr(ji,jj) 141 193 END DO 142 194 END DO 143 195 END DO 196 ! 144 197 ENDIF 145 ! ! =================== ! 146 IF( ln_zco ) THEN ! z-coordinate ! 147 ! ! =================== ! 148 DO jk = 1, nksr 149 zc0 = 1. / e3t_0(jk) 150 DO jj = 2, jpjm1 151 DO ji = fs_2, fs_jpim1 ! vector opt. 152 ! qsr trend 153 zta = qsr(ji,jj) * zc0 * ( gdsr(jk)*tmask(ji,jj,jk) - gdsr(jk+1)*tmask(ji,jj,jk+1) ) 154 ! add qsr trend to the temperature trend 155 ta(ji,jj,jk) = ta(ji,jj,jk) + zta 156 END DO 157 END DO 158 END DO 159 ENDIF 198 199 !!gm BUG the case key_vvl is missing: etot3 should be recomputed at each time step !!! 200 160 201 ! 161 202 ENDIF … … 178 219 !! 179 220 !! ** Method : The profile of solar radiation within the ocean is set 180 !! from two length scale of penetration ( xsr1,xsr2) and a ratio181 !! (r abs). These parameters are read in the namqsr namelist. The221 !! from two length scale of penetration (rn_si0,rn_si1) and a ratio 222 !! (rn_abs). These parameters are read in the namqsr namelist. The 182 223 !! default values correspond to clear water (type I in Jerlov' 183 224 !! (1968) classification. 184 225 !! called by tra_qsr at the first timestep (nit000) 185 226 !! 186 !! ** Action : - initialize xsr1, xsr2 and rabs227 !! ** Action : - initialize rn_si0, rn_si1 and rn_abs 187 228 !! 188 229 !! Reference : Jerlov, N. G., 1968 Optical Oceanography, Elsevier, 194pp. 189 230 !!---------------------------------------------------------------------- 190 INTEGER :: ji, jj, jk ! dummy loop index 191 INTEGER :: indic ! temporary integer 192 REAL(wp) :: zc0 , zc1 , zc2 ! temporary scalars 193 REAL(wp) :: zcst, zdp1, zdp2 ! " " 194 195 NAMELIST/namqsr/ ln_traqsr, rabs, xsi1, xsi2, ln_qsr_sms 196 !!---------------------------------------------------------------------- 197 198 REWIND ( numnam ) ! Read Namelist namqsr : ratio and length of penetration 199 READ ( numnam, namqsr ) 200 201 IF( ln_traqsr ) THEN ! Parameter control and print 202 IF(lwp) THEN 203 WRITE(numout,*) 204 WRITE(numout,*) 'tra_qsr_init : penetration of the surface solar radiation' 205 WRITE(numout,*) '~~~~~~~~~~~~' 206 WRITE(numout,*) ' Namelist namqsr : set the parameter of penetration' 207 WRITE(numout,*) ' fraction associated with xsi rabs = ',rabs 208 WRITE(numout,*) ' first depth of extinction xsi1 = ',xsi1 209 WRITE(numout,*) ' second depth of extinction xsi2 = ',xsi2 210 IF( lk_qsr_sms ) THEN 211 WRITE(numout,*) ' Biological fluxes for light(Y/N) ln_qsr_sms = ',ln_qsr_sms 231 INTEGER :: ji, jj, jk ! dummy loop indices 232 INTEGER :: irgb, ierror ! temporary integer 233 REAL(wp) :: zc0 , zc1 ! temporary scalars 234 REAL(wp) :: zc2 , zc3 , zchl ! - - 235 REAL(wp) :: zsi0r, zsi1r, zcoef ! - - 236 REAL(wp), DIMENSION(jpi,jpj) :: zekb, zekg, zekr ! 2D workspace 237 REAL(wp), DIMENSION(jpi,jpj,jpk) :: ze0 , ze1 , ze2 , ze3 , zea ! 3D workspace 238 !! 239 CHARACTER(len=100) :: cn_dir ! Root directory for location of ssr files 240 TYPE(FLD_N) :: sn_chl ! informations about the chlorofyl field to be read 241 NAMELIST/namqsr/ sn_chl, cn_dir, ln_traqsr, ln_qsr_rgb, ln_qsr_bio, & 242 & nn_chldta, rn_abs, rn_si0, rn_si1, rn_si2 243 !!---------------------------------------------------------------------- 244 245 cn_dir = './' ! directory in which the model is executed 246 ! ... default values (NB: frequency positive => hours, negative => months) 247 ! ! file ! frequency ! variable ! time interp ! clim ! 'yearly' or ! weights ! rotation ! 248 ! ! name ! (hours) ! name ! (T/F) ! (T/F) ! 'monthly' ! filename ! pairs ! 249 sn_chl = FLD_N( 'chlorophyll' , -1 , 'CHLA' , .true. , .true. , 'yearly' , '' , '' ) 250 ! 251 REWIND( numnam ) ! Read Namelist namqsr : ratio and length of penetration 252 READ ( numnam, namqsr ) 253 ! 254 IF(lwp) THEN ! control print 255 WRITE(numout,*) 256 WRITE(numout,*) 'tra_qsr_init : penetration of the surface solar radiation' 257 WRITE(numout,*) '~~~~~~~~~~~~' 258 WRITE(numout,*) ' Namelist namqsr : set the parameter of penetration' 259 WRITE(numout,*) ' Light penetration (T) or not (F) ln_traqsr = ', ln_traqsr 260 WRITE(numout,*) ' RGB (Red-Green-Blue) light penetration ln_qsr_rgb = ', ln_qsr_rgb 261 WRITE(numout,*) ' bio-model light penetration ln_qsr_bio = ', ln_qsr_bio 262 WRITE(numout,*) ' RGB : Chl data (=1) or cst value (=0) nn_chldta = ', nn_chldta 263 WRITE(numout,*) ' RGB & 2 bands: fraction of light (rn_si1) rn_abs = ', rn_abs 264 WRITE(numout,*) ' RGB & 2 bands: shortess depth of extinction rn_si0 = ', rn_si0 265 WRITE(numout,*) ' 2 bands: longest depth of extinction rn_si1 = ', rn_si1 266 WRITE(numout,*) ' 3 bands: longest depth of extinction rn_si2 = ', rn_si2 267 ENDIF 268 ! ! control consistency 269 IF( lk_qsr_bio .AND. .NOT.ln_qsr_bio ) THEN 270 ln_qsr_bio = .true. 271 CALL ctl_warn( 'Force bio-model light penetraton ln_qsr_bio = TRUE ' ) 272 ENDIF 273 274 ! ! ===================================== ! 275 IF( ln_traqsr ) THEN ! Initialisation of Light Penetration ! 276 ! ! ===================================== ! 277 ! 278 zsi0r = 1.e0 / rn_si0 279 zsi1r = 1.e0 / rn_si1 280 ! ! ---------------------------------- ! 281 IF( ln_qsr_rgb ) THEN ! Red-Green-Blue light penetration ! 282 ! ! ---------------------------------- ! 283 ! 284 ! ! level of light extinction 285 nksr = trc_oce_ext_lev( rn_si2, 0.33e2 ) 286 IF(lwp) THEN 287 WRITE(numout,*) 288 WRITE(numout,*) ' level max of computation of qsr = ', nksr, ' ref depth = ', gdepw_0(nksr+1), ' m' 212 289 ENDIF 290 ! 291 CALL trc_oce_rgb( rkrgb ) !* tabulated attenuation coef. 292 !!gm CALL trc_oce_rgb_read( rkrgb ) !* tabulated attenuation coef. 293 ! 294 IF( nn_chldta == 1 ) THEN !* Chl data : set sf_chl structure 295 IF(lwp) WRITE(numout,*) 296 IF(lwp) WRITE(numout,*) ' Chlorophyll read in a file' 297 ALLOCATE( sf_chl(1), STAT=ierror ) 298 IF( ierror > 0 ) THEN 299 CALL ctl_stop( 'tra_qsr_init: unable to allocate sf_chl structure' ) ; RETURN 300 ENDIF 301 ALLOCATE( sf_chl(1)%fnow(jpi,jpj) ) 302 ALLOCATE( sf_chl(1)%fdta(jpi,jpj,2) ) 303 ! ! fill sf_chl with sn_chl and control print 304 CALL fld_fill( sf_chl, (/ sn_chl /), cn_dir, 'tra_qsr_init', & 305 & 'Solar penetration function of read chlorophyll', 'namqsr' ) 306 ! 307 ELSE !* constant Chl : compute once for all the distribution of light (etot3) 308 IF(lwp) WRITE(numout,*) 309 IF(lwp) WRITE(numout,*) ' Constant Chlorophyll concentration = 0.05' 310 IF(lwp) WRITE(numout,*) ' light distribution computed once for all' 311 ! 312 zchl = 0.05 ! constant chlorophyll 313 irgb = NINT( 41 + 20.*LOG10(zchl) + 1.e-15 ) 314 zekb(:,:) = rkrgb(1,irgb) ! Separation in R-G-B depending of the chlorophyl concentration 315 zekg(:,:) = rkrgb(2,irgb) 316 zekr(:,:) = rkrgb(3,irgb) 317 ! 318 zcoef = ( 1. - rn_abs ) / 3.e0 ! equi-partition in R-G-B 319 ze0(:,:,1) = rn_abs 320 ze1(:,:,1) = zcoef 321 ze2(:,:,1) = zcoef 322 ze3(:,:,1) = zcoef 323 zea(:,:,1) = tmask(:,:,1) ! = ( ze0+ze1+z2+ze3 ) * tmask 324 325 DO jk = 2, nksr+1 326 !CDIR NOVERRCHK 327 DO jj = 1, jpj 328 !CDIR NOVERRCHK 329 DO ji = 1, jpi 330 zc0 = ze0(ji,jj,jk-1) * EXP( - fse3t(ji,jj,jk-1) * zsi0r ) 331 zc1 = ze1(ji,jj,jk-1) * EXP( - fse3t(ji,jj,jk-1) * zekb(ji,jj) ) 332 zc2 = ze2(ji,jj,jk-1) * EXP( - fse3t(ji,jj,jk-1) * zekg(ji,jj) ) 333 zc3 = ze3(ji,jj,jk-1) * EXP( - fse3t(ji,jj,jk-1) * zekr(ji,jj) ) 334 ze0(ji,jj,jk) = zc0 335 ze1(ji,jj,jk) = zc1 336 ze2(ji,jj,jk) = zc2 337 ze3(ji,jj,jk) = zc3 338 zea(ji,jj,jk) = ( zc0 + zc1 + zc2 + zc3 ) * tmask(ji,jj,jk) 339 END DO 340 END DO 341 END DO 342 ! 343 DO jk = 1, nksr 344 etot3(:,:,jk) = ro0cpr * ( zea(:,:,jk) - zea(:,:,jk+1) ) / fse3t(:,:,jk) 345 END DO 346 etot3(:,:,nksr+1:jpk) = 0.e0 ! below 400m set to zero 347 ENDIF 348 ! 349 ! ! ---------------------------------- ! 350 ELSE ! 2 bands light penetration ! 351 ! ! ---------------------------------- ! 352 ! 353 ! ! level of light extinction 354 nksr = trc_oce_ext_lev( rn_si1, 1.e2 ) 355 IF(lwp) THEN 356 WRITE(numout,*) 357 WRITE(numout,*) ' level max of computation of qsr = ', nksr, ' ref depth = ', gdepw_0(nksr+1), ' m' 358 ENDIF 359 ! 360 DO jk = 1, nksr !* solar heat absorbed at T-point computed once for all 361 DO jj = 1, jpj ! top 400 meters 362 DO ji = 1, jpi 363 zc0 = rn_abs * EXP( -fsdepw(ji,jj,jk )*zsi0r ) + (1.-rn_abs) * EXP( -fsdepw(ji,jj,jk )*zsi1r ) 364 zc1 = rn_abs * EXP( -fsdepw(ji,jj,jk+1)*zsi0r ) + (1.-rn_abs) * EXP( -fsdepw(ji,jj,jk+1)*zsi1r ) 365 etot3(ji,jj,jk) = ro0cpr * ( zc0 * tmask(ji,jj,jk) - zc1 * tmask(ji,jj,jk+1) ) / fse3t(ji,jj,jk) 366 END DO 367 END DO 368 END DO 369 etot3(:,:,nksr+1:jpk) = 0.e0 ! below 400m set to zero 370 ! 213 371 ENDIF 214 ELSE 372 ! ! ===================================== ! 373 ELSE ! No light penetration ! 374 ! ! ===================================== ! 215 375 IF(lwp) THEN 216 376 WRITE(numout,*) … … 219 379 ENDIF 220 380 ENDIF 221 222 IF( rabs > 1.e0 .OR. rabs < 0.e0 .OR. xsi1 < 0.e0 .OR. xsi2 < 0.e0 ) &223 CALL ctl_stop( ' 0<rabs<1, 0<xsi1, or 0<xsi2 not satisfied' )224 225 ! ! Initialization of gdsr226 IF( ln_zco .OR. ln_zps ) THEN227 !228 ! z-coordinate with or without partial step : same w-level everywhere inside the ocean229 gdsr(:) = 0.e0230 DO jk = 1, jpk231 zdp1 = -gdepw_0(jk)232 gdsr(jk) = ro0cpr * ( rabs * EXP( zdp1/xsi1 ) + (1.-rabs) * EXP( zdp1/xsi2 ) )233 IF ( gdsr(jk) <= 1.e-10 ) EXIT234 END DO235 indic = 0236 DO jk = 1, jpk237 IF( gdsr(jk) <= 1.e-15 .AND. indic == 0 ) THEN238 gdsr(jk) = 0.e0239 nksr = jk240 indic = 1241 ENDIF242 END DO243 nksr = MIN( nksr, jpkm1 )244 IF(lwp) THEN245 WRITE(numout,*)246 WRITE(numout,*) ' - z-coordinate, level max of computation =', nksr247 WRITE(numout,*) ' profile of coef. of penetration:'248 WRITE(numout,"(' ',7e11.2)") ( gdsr(jk), jk = 1, nksr )249 WRITE(numout,*)250 ENDIF251 ! Initialisation of Biological fluxes for light here because252 ! the optical biological model is call after the dynamical one253 IF( lk_qsr_sms .AND. ln_qsr_sms ) THEN254 DO jk = 1, jpkm1255 zcst = gdsr(jk) / ro0cpr256 etot3(:,:,jk) = qsr(:,:) * zcst * tmask(:,:,jk)257 END DO258 ENDIF259 !260 ENDIF261 262 ! Initialisation of etot3 (s-coordinate)263 ! -----------------------264 IF( ln_sco ) THEN265 etot3(:,:,jpk) = 0.e0266 DO jk = 1, jpkm1267 DO jj = 1, jpj268 DO ji = 1, jpi269 zdp1 = -fsdepw(ji,jj,jk )270 zdp2 = -fsdepw(ji,jj,jk+1)271 zc0 = ro0cpr / fse3t(ji,jj,jk)272 zc1 = ( rabs * EXP(zdp1/xsi1) + (1.-rabs) * EXP(zdp1/xsi2) )273 zc2 = - ( rabs * EXP(zdp2/xsi1) + (1.-rabs) * EXP(zdp2/xsi2) )274 etot3(ji,jj,jk) = zc0 * ( zc1 * tmask(ji,jj,jk) + zc2 * tmask(ji,jj,jk+1) )275 END DO276 END DO277 END DO278 ENDIF279 381 ! 280 382 END SUBROUTINE tra_qsr_init -
branches/dev_004_VVL/NEMO/OPA_SRC/trc_oce.F90
r1152 r1431 4 4 !! Ocean passive tracer : share SMS/Ocean variables 5 5 !!====================================================================== 6 !! History : 7 !! 9.0 ! 04-03 (C. Ethe) F90: Free form and module 8 !!---------------------------------------------------------------------- 6 !! History : 1.0 ! 2004-03 (C. Ethe) Original code 7 !!---------------------------------------------------------------------- 8 9 !!---------------------------------------------------------------------- 10 !! trc_oce_rgb : tabulated attenuation coefficients for RGB light penetration 11 !!---------------------------------------------------------------------- 12 USE in_out_manager ! I/O manager 13 USE dom_oce ! ocean space and time domain 14 9 15 #if defined key_top && defined key_pisces 10 16 !!---------------------------------------------------------------------- 11 !! OPA 9.0 , LOCEAN-IPSL (2005) 17 !! 'key_top' & 'key_pisces' PISCES bio-model 18 !!---------------------------------------------------------------------- 19 USE sms_pisces , ONLY : etot3 => etot3 !: bio-model light absorption 20 21 IMPLICIT NONE 22 PRIVATE 23 24 PUBLIC trc_oce_rgb ! routine called by p4zopt.F90 25 26 LOGICAL, PUBLIC, PARAMETER :: lk_qsr_bio = .TRUE. !: bio-model light absorption flag 27 28 #else 29 !!---------------------------------------------------------------------- 30 !! Default option No bio-model light absorption 31 !!---------------------------------------------------------------------- 32 USE par_oce 33 34 IMPLICIT NONE 35 PRIVATE 36 37 PUBLIC trc_oce_rgb ! routine called by traqsr.F90 38 39 LOGICAL, PUBLIC, PARAMETER :: lk_qsr_bio = .FALSE. !: bio-model light absorption flag 40 41 REAL(wp), PUBLIC , DIMENSION(jpi,jpj,jpk) :: etot3 !: light absortion coefficient 42 #endif 43 44 PUBLIC trc_oce_ext_lev ! function called by traqsr.F90 at least 45 46 INTEGER, PUBLIC :: nksr ! levels below which the light cannot penetrate ( depth larger than 391 m) 47 48 REAL(wp), DIMENSION(3,61), PUBLIC :: rkrgb !: tabulated attenuation coefficients for RGB absorption 49 50 !! * Substitutions 51 # include "domzgr_substitute.h90" 52 !!---------------------------------------------------------------------- 53 !! NEMO/OPA 3.2 , LOCEAN-IPSL (2009) 12 54 !! $Id$ 13 !! This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt 14 !!---------------------------------------------------------------------- 15 USE sms_pisces , ONLY : & 16 etot3 => etot3 !!: Biological fluxes for light 17 !! Shared module variables 18 LOGICAL, PUBLIC, PARAMETER :: lk_qsr_sms = .TRUE. 19 #else 20 !!---------------------------------------------------------------------- 21 !! Default option No Biological fluxes for light 22 !!---------------------------------------------------------------------- 23 USE par_oce 24 LOGICAL, PUBLIC, PARAMETER :: lk_qsr_sms = .FALSE. 25 REAL(wp), PUBLIC , DIMENSION (jpi,jpj,jpk) :: & 26 etot3 27 #endif 28 55 !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 56 !!---------------------------------------------------------------------- 57 58 CONTAINS 59 60 SUBROUTINE trc_oce_rgb( prgb ) 61 !!--------------------------------------------------------------------- 62 !! *** ROUTINE p4z_opt_init *** 63 !! 64 !! ** Purpose : Initialization of of the optical scheme 65 !! 66 !! ** Method : Set a look up table for the optical coefficients 67 !! i.e. the attenuation coefficient for R-G-B light 68 !! tabulated in Chlorophyll class (from JM Andre) 69 !! 70 !! ** Action : prgb(3,61) tabulated R-G-B attenuation coef. 71 !! 72 !! Reference : Lengaigne et al. 2007, Clim. Dyn., V28, 5, 503-516. 73 !!---------------------------------------------------------------------- 74 REAL(wp), DIMENSION(3,61), INTENT(inout) :: prgb ! tabulated attenuation coefficient 75 !! 76 INTEGER :: jc ! dummy loop indice 77 INTEGER :: irgb ! temporary integer 78 REAL(wp) :: zchl ! temporary scalar 79 REAL(wp), DIMENSION(4,61) :: zrgb ! tabulated attenuation coefficient (formerly read in 'kRGB61.txt') 80 !!---------------------------------------------------------------------- 81 ! 82 IF(lwp) THEN 83 WRITE(numout,*) 84 WRITE(numout,*) 'trc_oce_rgb : Initialisation of the optical look-up table' 85 WRITE(numout,*) '~~~~~~~~~~~ ' 86 ENDIF 87 ! 88 ! Chlorophyll ! Blue attenuation ! Green attenuation ! Red attenuation ! 89 zrgb(1, 1) = 0.010 ; zrgb(2, 1) = 0.01618 ; zrgb(3, 1) = 0.07464 ; zrgb(4, 1) = 0.37807 90 zrgb(1, 2) = 0.011 ; zrgb(2, 2) = 0.01654 ; zrgb(3, 2) = 0.07480 ; zrgb(4, 2) = 0.37823 91 zrgb(1, 3) = 0.013 ; zrgb(2, 3) = 0.01693 ; zrgb(3, 3) = 0.07499 ; zrgb(4, 3) = 0.37840 92 zrgb(1, 4) = 0.014 ; zrgb(2, 4) = 0.01736 ; zrgb(3, 4) = 0.07518 ; zrgb(4, 4) = 0.37859 93 zrgb(1, 5) = 0.016 ; zrgb(2, 5) = 0.01782 ; zrgb(3, 5) = 0.07539 ; zrgb(4, 5) = 0.37879 94 zrgb(1, 6) = 0.018 ; zrgb(2, 6) = 0.01831 ; zrgb(3, 6) = 0.07562 ; zrgb(4, 6) = 0.37900 95 zrgb(1, 7) = 0.020 ; zrgb(2, 7) = 0.01885 ; zrgb(3, 7) = 0.07586 ; zrgb(4, 7) = 0.37923 96 zrgb(1, 8) = 0.022 ; zrgb(2, 8) = 0.01943 ; zrgb(3, 8) = 0.07613 ; zrgb(4, 8) = 0.37948 97 zrgb(1, 9) = 0.025 ; zrgb(2, 9) = 0.02005 ; zrgb(3, 9) = 0.07641 ; zrgb(4, 9) = 0.37976 98 zrgb(1,10) = 0.028 ; zrgb(2,10) = 0.02073 ; zrgb(3,10) = 0.07672 ; zrgb(4,10) = 0.38005 99 zrgb(1,11) = 0.032 ; zrgb(2,11) = 0.02146 ; zrgb(3,11) = 0.07705 ; zrgb(4,11) = 0.38036 100 zrgb(1,12) = 0.035 ; zrgb(2,12) = 0.02224 ; zrgb(3,12) = 0.07741 ; zrgb(4,12) = 0.38070 101 zrgb(1,13) = 0.040 ; zrgb(2,13) = 0.02310 ; zrgb(3,13) = 0.07780 ; zrgb(4,13) = 0.38107 102 zrgb(1,14) = 0.045 ; zrgb(2,14) = 0.02402 ; zrgb(3,14) = 0.07821 ; zrgb(4,14) = 0.38146 103 zrgb(1,15) = 0.050 ; zrgb(2,15) = 0.02501 ; zrgb(3,15) = 0.07866 ; zrgb(4,15) = 0.38189 104 zrgb(1,16) = 0.056 ; zrgb(2,16) = 0.02608 ; zrgb(3,16) = 0.07914 ; zrgb(4,16) = 0.38235 105 zrgb(1,17) = 0.063 ; zrgb(2,17) = 0.02724 ; zrgb(3,17) = 0.07967 ; zrgb(4,17) = 0.38285 106 zrgb(1,18) = 0.071 ; zrgb(2,18) = 0.02849 ; zrgb(3,18) = 0.08023 ; zrgb(4,18) = 0.38338 107 zrgb(1,19) = 0.079 ; zrgb(2,19) = 0.02984 ; zrgb(3,19) = 0.08083 ; zrgb(4,19) = 0.38396 108 zrgb(1,20) = 0.089 ; zrgb(2,20) = 0.03131 ; zrgb(3,20) = 0.08149 ; zrgb(4,20) = 0.38458 109 zrgb(1,21) = 0.100 ; zrgb(2,21) = 0.03288 ; zrgb(3,21) = 0.08219 ; zrgb(4,21) = 0.38526 110 zrgb(1,22) = 0.112 ; zrgb(2,22) = 0.03459 ; zrgb(3,22) = 0.08295 ; zrgb(4,22) = 0.38598 111 zrgb(1,23) = 0.126 ; zrgb(2,23) = 0.03643 ; zrgb(3,23) = 0.08377 ; zrgb(4,23) = 0.38676 112 zrgb(1,24) = 0.141 ; zrgb(2,24) = 0.03842 ; zrgb(3,24) = 0.08466 ; zrgb(4,24) = 0.38761 113 zrgb(1,25) = 0.158 ; zrgb(2,25) = 0.04057 ; zrgb(3,25) = 0.08561 ; zrgb(4,25) = 0.38852 114 zrgb(1,26) = 0.178 ; zrgb(2,26) = 0.04289 ; zrgb(3,26) = 0.08664 ; zrgb(4,26) = 0.38950 115 zrgb(1,27) = 0.200 ; zrgb(2,27) = 0.04540 ; zrgb(3,27) = 0.08775 ; zrgb(4,27) = 0.39056 116 zrgb(1,28) = 0.224 ; zrgb(2,28) = 0.04811 ; zrgb(3,28) = 0.08894 ; zrgb(4,28) = 0.39171 117 zrgb(1,29) = 0.251 ; zrgb(2,29) = 0.05103 ; zrgb(3,29) = 0.09023 ; zrgb(4,29) = 0.39294 118 zrgb(1,30) = 0.282 ; zrgb(2,30) = 0.05420 ; zrgb(3,30) = 0.09162 ; zrgb(4,30) = 0.39428 119 zrgb(1,31) = 0.316 ; zrgb(2,31) = 0.05761 ; zrgb(3,31) = 0.09312 ; zrgb(4,31) = 0.39572 120 zrgb(1,32) = 0.355 ; zrgb(2,32) = 0.06130 ; zrgb(3,32) = 0.09474 ; zrgb(4,32) = 0.39727 121 zrgb(1,33) = 0.398 ; zrgb(2,33) = 0.06529 ; zrgb(3,33) = 0.09649 ; zrgb(4,33) = 0.39894 122 zrgb(1,34) = 0.447 ; zrgb(2,34) = 0.06959 ; zrgb(3,34) = 0.09837 ; zrgb(4,34) = 0.40075 123 zrgb(1,35) = 0.501 ; zrgb(2,35) = 0.07424 ; zrgb(3,35) = 0.10040 ; zrgb(4,35) = 0.40270 124 zrgb(1,36) = 0.562 ; zrgb(2,36) = 0.07927 ; zrgb(3,36) = 0.10259 ; zrgb(4,36) = 0.40480 125 zrgb(1,37) = 0.631 ; zrgb(2,37) = 0.08470 ; zrgb(3,37) = 0.10495 ; zrgb(4,37) = 0.40707 126 zrgb(1,38) = 0.708 ; zrgb(2,38) = 0.09056 ; zrgb(3,38) = 0.10749 ; zrgb(4,38) = 0.40952 127 zrgb(1,39) = 0.794 ; zrgb(2,39) = 0.09690 ; zrgb(3,39) = 0.11024 ; zrgb(4,39) = 0.41216 128 zrgb(1,40) = 0.891 ; zrgb(2,40) = 0.10374 ; zrgb(3,40) = 0.11320 ; zrgb(4,40) = 0.41502 129 zrgb(1,41) = 1.000 ; zrgb(2,41) = 0.11114 ; zrgb(3,41) = 0.11639 ; zrgb(4,41) = 0.41809 130 zrgb(1,42) = 1.122 ; zrgb(2,42) = 0.11912 ; zrgb(3,42) = 0.11984 ; zrgb(4,42) = 0.42142 131 zrgb(1,43) = 1.259 ; zrgb(2,43) = 0.12775 ; zrgb(3,43) = 0.12356 ; zrgb(4,43) = 0.42500 132 zrgb(1,44) = 1.413 ; zrgb(2,44) = 0.13707 ; zrgb(3,44) = 0.12757 ; zrgb(4,44) = 0.42887 133 zrgb(1,45) = 1.585 ; zrgb(2,45) = 0.14715 ; zrgb(3,45) = 0.13189 ; zrgb(4,45) = 0.43304 134 zrgb(1,46) = 1.778 ; zrgb(2,46) = 0.15803 ; zrgb(3,46) = 0.13655 ; zrgb(4,46) = 0.43754 135 zrgb(1,47) = 1.995 ; zrgb(2,47) = 0.16978 ; zrgb(3,47) = 0.14158 ; zrgb(4,47) = 0.44240 136 zrgb(1,48) = 2.239 ; zrgb(2,48) = 0.18248 ; zrgb(3,48) = 0.14701 ; zrgb(4,48) = 0.44765 137 zrgb(1,49) = 2.512 ; zrgb(2,49) = 0.19620 ; zrgb(3,49) = 0.15286 ; zrgb(4,49) = 0.45331 138 zrgb(1,50) = 2.818 ; zrgb(2,50) = 0.21102 ; zrgb(3,50) = 0.15918 ; zrgb(4,50) = 0.45942 139 zrgb(1,51) = 3.162 ; zrgb(2,51) = 0.22703 ; zrgb(3,51) = 0.16599 ; zrgb(4,51) = 0.46601 140 zrgb(1,52) = 3.548 ; zrgb(2,52) = 0.24433 ; zrgb(3,52) = 0.17334 ; zrgb(4,52) = 0.47313 141 zrgb(1,53) = 3.981 ; zrgb(2,53) = 0.26301 ; zrgb(3,53) = 0.18126 ; zrgb(4,54) = 0.48080 142 zrgb(1,54) = 4.467 ; zrgb(2,54) = 0.28320 ; zrgb(3,54) = 0.18981 ; zrgb(4,55) = 0.48909 143 zrgb(1,55) = 5.012 ; zrgb(2,55) = 0.30502 ; zrgb(3,55) = 0.19903 ; zrgb(4,56) = 0.49803 144 zrgb(1,56) = 5.623 ; zrgb(2,56) = 0.32858 ; zrgb(3,56) = 0.20898 ; zrgb(4,57) = 0.50768 145 zrgb(1,57) = 6.310 ; zrgb(2,57) = 0.35404 ; zrgb(3,57) = 0.21971 ; zrgb(4,58) = 0.51810 146 zrgb(1,58) = 7.079 ; zrgb(2,58) = 0.38154 ; zrgb(3,58) = 0.23129 ; zrgb(4,59) = 0.52934 147 zrgb(1,59) = 7.943 ; zrgb(2,59) = 0.41125 ; zrgb(3,59) = 0.24378 ; zrgb(4,50) = 0.54147 148 zrgb(1,60) = 8.912 ; zrgb(2,60) = 0.44336 ; zrgb(3,60) = 0.25725 ; zrgb(4,60) = 0.55457 149 zrgb(1,61) = 10.000 ; zrgb(2,61) = 0.47804 ; zrgb(3,61) = 0.27178 ; zrgb(4,61) = 0.56870 150 ! 151 prgb(:,:) = zrgb(2:4,:) 152 ! 153 DO jc = 1, 61 ! check 154 zchl = zrgb(1,jc) 155 irgb = NINT( 41 + 20.* LOG10( zchl ) + 1.e-15 ) 156 IF(lwp) WRITE(numout,*) ' jc =', jc, ' Chl = ', zchl, ' irgb = ', irgb 157 IF( irgb /= jc ) THEN 158 IF(lwp) WRITE(numout,*) ' jc =', jc, ' Chl = ', zchl, ' Chl class = ', irgb 159 CALL ctl_stop( 'trc_oce_rgb : inconsistency in Chl tabulated attenuation coeff.' ) 160 ENDIF 161 END DO 162 ! 163 END SUBROUTINE trc_oce_rgb 164 165 166 SUBROUTINE trc_oce_rgb_read( prgb ) 167 !!---------------------------------------------------------------------- 168 !! *** ROUTINE p4z_opt_init *** 169 !! 170 !! ** Purpose : Initialization of of the optical scheme 171 !! 172 !! ** Method : read the look up table for the optical coefficients 173 !! 174 !! ** input : xkrgb(61) precomputed array corresponding to the 175 !! attenuation coefficient (from JM Andre) 176 !!---------------------------------------------------------------------- 177 REAL(wp), DIMENSION(3,61), INTENT(inout) :: prgb ! tabulated attenuation coefficient 178 !! 179 INTEGER :: jchl, jband ! dummy loop indices 180 INTEGER :: numlight 181 REAL(wp) :: ztoto 182 CHARACTER(LEN=20) :: clname 183 !!---------------------------------------------------------------------- 184 ! 185 clname = 'kRGB61.txt' 186 CALL ctlopn( numlight, clname, 'OLD', 'FORMATTED', 'SEQUENTIAL', 1, numout, .TRUE., 1 ) 187 DO jchl = 1, 61 188 READ(numlight,*) ztoto, ( prgb(jband,jchl), jband=1,3 ) 189 END DO 190 CLOSE( numlight ) 191 ! 192 IF(lwp) THEN ! control print 193 WRITE(numout,*) 194 WRITE(numout,*) ' trc_oce_rgb_read : optical look-up table read in kRGB61.txt file' 195 WRITE(numout,*) ' ~~~~~~~~~~~~~~~~' 196 ENDIF 197 ! 198 END SUBROUTINE trc_oce_rgb_read 199 200 201 FUNCTION trc_oce_ext_lev( prldex, pqsr_frc ) RESULT( pjl ) 202 !!---------------------------------------------------------------------- 203 !! *** ROUTINE trc_oce_ext_lev *** 204 !! 205 !! ** Purpose : compute max. level for light penetration 206 !! 207 !! ** Method : the function provides the level at which irradiance 208 !! becomes negligible (i.e. = 1.e-15 W/m2) for 3 or 2 bands light 209 !! penetration: I(z) = pqsr_frc * EXP(hext/prldex) = 1.e-15 W/m2 210 !! # prldex is the longest depth of extinction: 211 !! - prldex = 23 m (2 bands case) 212 !! - prldex = 62 m (3 bands case: blue waveband & 0.01 mg/m2 for the chlorophyll) 213 !! # pqsr_frc is the fraction of solar radiation which penetrates, 214 !! considering Qsr=240 W/m2 and rn_abs = 0.58: 215 !! - pqsr_frc = Qsr * (1-rn_abs) = 1.00e2 W/m2 (2 bands case) 216 !! - pqsr_frc = Qsr * (1-rn_abs)/3 = 0.33e2 W/m2 (3 bands case & equi-partition) 217 !! 218 !!---------------------------------------------------------------------- 219 REAL(wp), INTENT(in) :: prldex ! longest depth of extinction 220 REAL(wp), INTENT(in) :: pqsr_frc ! frac. solar radiation which penetrates 221 !! 222 INTEGER :: jk, pjl ! levels 223 REAL(wp) :: zhext ! deepest level till which light penetrates 224 REAL(wp) :: zprec = 15._wp ! precision to reach -LOG10(1.e-15) 225 REAL(wp) :: zem ! temporary scalar 226 !!---------------------------------------------------------------------- 227 ! 228 ! It is not necessary to compute anything bellow the following depth 229 zhext = prldex * ( LOG(10.e0) * zprec + LOG(pqsr_frc) ) 230 231 ! Level of light extinction 232 pjl = jpkm1 233 DO jk = jpkm1, 1, -1 234 zem = MAXVAL( fsdepw(:,:,jk+1) * tmask(:,:,jk) ) 235 IF( zem >= zhext ) pjl = jk ! last T-level reached by Qsr 236 END DO 237 ! 238 END FUNCTION trc_oce_ext_lev 239 240 241 !!====================================================================== 29 242 END MODULE trc_oce
Note: See TracChangeset
for help on using the changeset viewer.