[3] | 1 | MODULE traqsr |
---|
| 2 | !!====================================================================== |
---|
| 3 | !! *** MODULE traqsr *** |
---|
[6140] | 4 | !! Ocean physics: solar radiation penetration in the top ocean levels |
---|
[3] | 5 | !!====================================================================== |
---|
[1423] | 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) |
---|
[6140] | 12 | !! 3.6 ! 2012-05 (C. Rousset) store attenuation coef for use in ice model |
---|
[6403] | 13 | !! 3.6 ! 2015-12 (O. Aumont, J. Jouanno, C. Ethe) use vertical profile of chlorophyll |
---|
[6140] | 14 | !! 3.7 ! 2015-11 (G. Madec, A. Coward) remove optimisation for fix volume |
---|
[3] | 15 | !!---------------------------------------------------------------------- |
---|
[503] | 16 | |
---|
| 17 | !!---------------------------------------------------------------------- |
---|
[6140] | 18 | !! tra_qsr : temperature trend due to the penetration of solar radiation |
---|
| 19 | !! tra_qsr_init : initialization of the qsr penetration |
---|
[3] | 20 | !!---------------------------------------------------------------------- |
---|
[6140] | 21 | USE oce ! ocean dynamics and active tracers |
---|
| 22 | USE phycst ! physical constants |
---|
| 23 | USE dom_oce ! ocean space and time domain |
---|
| 24 | USE sbc_oce ! surface boundary condition: ocean |
---|
| 25 | USE trc_oce ! share SMS/Ocean variables |
---|
[4990] | 26 | USE trd_oce ! trends: ocean variables |
---|
| 27 | USE trdtra ! trends manager: tracers |
---|
[6140] | 28 | ! |
---|
| 29 | USE in_out_manager ! I/O manager |
---|
| 30 | USE prtctl ! Print control |
---|
[9019] | 31 | USE iom ! I/O library |
---|
[6140] | 32 | USE fldread ! read input fields |
---|
| 33 | USE restart ! ocean restart |
---|
| 34 | USE lib_mpp ! MPP library |
---|
| 35 | USE lbclnk ! ocean lateral boundary conditions (or mpp link) |
---|
[3294] | 36 | USE timing ! Timing |
---|
[3] | 37 | |
---|
| 38 | IMPLICIT NONE |
---|
| 39 | PRIVATE |
---|
| 40 | |
---|
[2528] | 41 | PUBLIC tra_qsr ! routine called by step.F90 (ln_traqsr=T) |
---|
[5407] | 42 | PUBLIC tra_qsr_init ! routine called by nemogcm.F90 |
---|
[3] | 43 | |
---|
[4147] | 44 | ! !!* Namelist namtra_qsr: penetrative solar radiation |
---|
| 45 | LOGICAL , PUBLIC :: ln_traqsr !: light absorption (qsr) flag |
---|
| 46 | LOGICAL , PUBLIC :: ln_qsr_rgb !: Red-Green-Blue light absorption flag |
---|
| 47 | LOGICAL , PUBLIC :: ln_qsr_2bd !: 2 band light absorption flag |
---|
| 48 | LOGICAL , PUBLIC :: ln_qsr_bio !: bio-model light absorption flag |
---|
| 49 | INTEGER , PUBLIC :: nn_chldta !: use Chlorophyll data (=1) or not (=0) |
---|
| 50 | REAL(wp), PUBLIC :: rn_abs !: fraction absorbed in the very near surface (RGB & 2 bands) |
---|
| 51 | REAL(wp), PUBLIC :: rn_si0 !: very near surface depth of extinction (RGB & 2 bands) |
---|
| 52 | REAL(wp), PUBLIC :: rn_si1 !: deepest depth of extinction (water type I) (2 bands) |
---|
[6140] | 53 | ! |
---|
| 54 | INTEGER , PUBLIC :: nksr !: levels below which the light cannot penetrate (depth larger than 391 m) |
---|
[5407] | 55 | |
---|
[6140] | 56 | INTEGER, PARAMETER :: np_RGB = 1 ! R-G-B light penetration with constant Chlorophyll |
---|
| 57 | INTEGER, PARAMETER :: np_RGBc = 2 ! R-G-B light penetration with Chlorophyll data |
---|
| 58 | INTEGER, PARAMETER :: np_2BD = 3 ! 2 bands light penetration |
---|
| 59 | INTEGER, PARAMETER :: np_BIO = 4 ! bio-model light penetration |
---|
| 60 | ! |
---|
| 61 | INTEGER :: nqsr ! user choice of the type of light penetration |
---|
| 62 | REAL(wp) :: xsi0r ! inverse of rn_si0 |
---|
| 63 | REAL(wp) :: xsi1r ! inverse of rn_si1 |
---|
| 64 | ! |
---|
| 65 | REAL(wp) , DIMENSION(3,61) :: rkrgb ! tabulated attenuation coefficients for RGB absorption |
---|
[1423] | 66 | TYPE(FLD), ALLOCATABLE, DIMENSION(:) :: sf_chl ! structure of input Chl (file informations, fields read) |
---|
[3] | 67 | |
---|
| 68 | !! * Substitutions |
---|
[12377] | 69 | # include "do_loop_substitute.h90" |
---|
[3] | 70 | !!---------------------------------------------------------------------- |
---|
[9598] | 71 | !! NEMO/OCE 4.0 , NEMO Consortium (2018) |
---|
[888] | 72 | !! $Id$ |
---|
[10068] | 73 | !! Software governed by the CeCILL license (see ./LICENSE) |
---|
[3] | 74 | !!---------------------------------------------------------------------- |
---|
| 75 | CONTAINS |
---|
| 76 | |
---|
[12377] | 77 | SUBROUTINE tra_qsr( kt, Kmm, pts, Krhs ) |
---|
[3] | 78 | !!---------------------------------------------------------------------- |
---|
| 79 | !! *** ROUTINE tra_qsr *** |
---|
| 80 | !! |
---|
| 81 | !! ** Purpose : Compute the temperature trend due to the solar radiation |
---|
[6140] | 82 | !! penetration and add it to the general temperature trend. |
---|
[3] | 83 | !! |
---|
[1423] | 84 | !! ** Method : The profile of the solar radiation within the ocean is defined |
---|
| 85 | !! through 2 wavebands (rn_si0,rn_si1) or 3 wavebands (RGB) and a ratio rn_abs |
---|
| 86 | !! Considering the 2 wavebands case: |
---|
| 87 | !! I(k) = Qsr*( rn_abs*EXP(z(k)/rn_si0) + (1.-rn_abs)*EXP(z(k)/rn_si1) ) |
---|
| 88 | !! The temperature trend associated with the solar radiation penetration |
---|
[12489] | 89 | !! is given by : zta = 1/e3t dk[ I ] / (rho0*Cp) |
---|
[3] | 90 | !! At the bottom, boudary condition for the radiation is no flux : |
---|
| 91 | !! all heat which has not been absorbed in the above levels is put |
---|
| 92 | !! in the last ocean level. |
---|
[6140] | 93 | !! The computation is only done down to the level where |
---|
| 94 | !! I(k) < 1.e-15 W/m2 (i.e. over the top nksr levels) . |
---|
[3] | 95 | !! |
---|
| 96 | !! ** Action : - update ta with the penetrative solar radiation trend |
---|
[6140] | 97 | !! - send trend for further diagnostics (l_trdtra=T) |
---|
[1423] | 98 | !! |
---|
| 99 | !! Reference : Jerlov, N. G., 1968 Optical Oceanography, Elsevier, 194pp. |
---|
| 100 | !! Lengaigne et al. 2007, Clim. Dyn., V28, 5, 503-516. |
---|
[6403] | 101 | !! Morel, A. et Berthon, JF, 1989, Limnol Oceanogr 34(8), 1545-1562 |
---|
[503] | 102 | !!---------------------------------------------------------------------- |
---|
[12377] | 103 | INTEGER, INTENT(in ) :: kt ! ocean time-step |
---|
| 104 | INTEGER, INTENT(in ) :: Kmm, Krhs ! time level indices |
---|
| 105 | REAL(wp), DIMENSION(jpi,jpj,jpk,jpts,jpt), INTENT(inout) :: pts ! active tracers and RHS of tracer equation |
---|
[2715] | 106 | ! |
---|
[6140] | 107 | INTEGER :: ji, jj, jk ! dummy loop indices |
---|
| 108 | INTEGER :: irgb ! local integers |
---|
| 109 | REAL(wp) :: zchl, zcoef, z1_2 ! local scalars |
---|
| 110 | REAL(wp) :: zc0 , zc1 , zc2 , zc3 ! - - |
---|
[4161] | 111 | REAL(wp) :: zzc0, zzc1, zzc2, zzc3 ! - - |
---|
[13205] | 112 | REAL(wp) :: zz0 , zz1 , ze3t, zlui ! - - |
---|
| 113 | REAL(wp) :: zCb, zCmax, zpsi, zpsimax, zrdpsi, zCze |
---|
| 114 | REAL(wp) :: zlogc, zlogze, zlogCtot, zlogCze |
---|
| 115 | REAL(wp), ALLOCATABLE, DIMENSION(:,:) :: ze0, ze1, ze2, ze3 |
---|
| 116 | REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) :: ztrdt, zetot, ztmp3d |
---|
[3] | 117 | !!---------------------------------------------------------------------- |
---|
[3294] | 118 | ! |
---|
[9019] | 119 | IF( ln_timing ) CALL timing_start('tra_qsr') |
---|
[3294] | 120 | ! |
---|
[3] | 121 | IF( kt == nit000 ) THEN |
---|
[503] | 122 | IF(lwp) WRITE(numout,*) |
---|
| 123 | IF(lwp) WRITE(numout,*) 'tra_qsr : penetration of the surface solar radiation' |
---|
| 124 | IF(lwp) WRITE(numout,*) '~~~~~~~' |
---|
[3] | 125 | ENDIF |
---|
[6140] | 126 | ! |
---|
| 127 | IF( l_trdtra ) THEN ! trends diagnostic: save the input temperature trend |
---|
[9019] | 128 | ALLOCATE( ztrdt(jpi,jpj,jpk) ) |
---|
[12377] | 129 | ztrdt(:,:,:) = pts(:,:,:,jp_tem,Krhs) |
---|
[216] | 130 | ENDIF |
---|
[6140] | 131 | ! |
---|
| 132 | ! !-----------------------------------! |
---|
| 133 | ! ! before qsr induced heat content ! |
---|
| 134 | ! !-----------------------------------! |
---|
| 135 | IF( kt == nit000 ) THEN !== 1st time step ==! |
---|
[12489] | 136 | IF( ln_rstart .AND. iom_varid( numror, 'qsr_hc_b', ldstop = .FALSE. ) > 0 .AND. .NOT.l_1st_euler ) THEN ! read in restart |
---|
[6140] | 137 | IF(lwp) WRITE(numout,*) ' nit000-1 qsr tracer content forcing field read in the restart file' |
---|
| 138 | z1_2 = 0.5_wp |
---|
[9367] | 139 | CALL iom_get( numror, jpdom_autoglo, 'qsr_hc_b', qsr_hc_b, ldxios = lrxios ) ! before heat content trend due to Qsr flux |
---|
[2528] | 140 | ELSE ! No restart or restart not found: Euler forward time stepping |
---|
[6140] | 141 | z1_2 = 1._wp |
---|
[7753] | 142 | qsr_hc_b(:,:,:) = 0._wp |
---|
[2528] | 143 | ENDIF |
---|
[6140] | 144 | ELSE !== Swap of qsr heat content ==! |
---|
| 145 | z1_2 = 0.5_wp |
---|
[7753] | 146 | qsr_hc_b(:,:,:) = qsr_hc(:,:,:) |
---|
[2528] | 147 | ENDIF |
---|
[6140] | 148 | ! |
---|
| 149 | ! !--------------------------------! |
---|
| 150 | SELECT CASE( nqsr ) ! now qsr induced heat content ! |
---|
| 151 | ! !--------------------------------! |
---|
| 152 | ! |
---|
| 153 | CASE( np_BIO ) !== bio-model fluxes ==! |
---|
| 154 | ! |
---|
| 155 | DO jk = 1, nksr |
---|
[12489] | 156 | qsr_hc(:,:,jk) = r1_rho0_rcp * ( etot3(:,:,jk) - etot3(:,:,jk+1) ) |
---|
[2528] | 157 | END DO |
---|
[6140] | 158 | ! |
---|
| 159 | CASE( np_RGB , np_RGBc ) !== R-G-B fluxes ==! |
---|
| 160 | ! |
---|
[13205] | 161 | ALLOCATE( ze0 (jpi,jpj) , ze1 (jpi,jpj) , & |
---|
| 162 | & ze2 (jpi,jpj) , ze3 (jpi,jpj) , & |
---|
| 163 | & ztmp3d(jpi,jpj,nksr + 1) ) |
---|
[6140] | 164 | ! |
---|
| 165 | IF( nqsr == np_RGBc ) THEN !* Variable Chlorophyll |
---|
| 166 | CALL fld_read( kt, 1, sf_chl ) ! Read Chl data and provides it at the current time step |
---|
[13205] | 167 | ! |
---|
| 168 | ! Separation in R-G-B depending on the surface Chl |
---|
| 169 | ! perform and store as many of the 2D calculations as possible |
---|
| 170 | ! before the 3D loop (use the temporary 2D arrays to replace the |
---|
| 171 | ! most expensive calculations) |
---|
| 172 | ! |
---|
| 173 | DO_2D_00_00 |
---|
| 174 | ! zlogc = log(zchl) |
---|
| 175 | zlogc = LOG ( MIN( 10. , MAX( 0.03, sf_chl(1)%fnow(ji,jj,1) ) ) ) |
---|
| 176 | ! zc1 : log(zCze) = log (1.12 * zchl**0.803) |
---|
| 177 | zc1 = 0.113328685307 + 0.803 * zlogc |
---|
| 178 | ! zc2 : log(zCtot) = log(40.6 * zchl**0.459) |
---|
| 179 | zc2 = 3.703768066608 + 0.459 * zlogc |
---|
| 180 | ! zc3 : log(zze) = log(568.2 * zCtot**(-0.746)) |
---|
| 181 | zc3 = 6.34247346942 - 0.746 * zc2 |
---|
| 182 | ! IF( log(zze) > log(102.) ) log(zze) = log(200.0 * zCtot**(-0.293)) |
---|
| 183 | IF( zc3 > 4.62497281328 ) zc3 = 5.298317366548 - 0.293 * zc2 |
---|
| 184 | ! |
---|
| 185 | ze0(ji,jj) = zlogc ! ze0 = log(zchl) |
---|
| 186 | ze1(ji,jj) = EXP( zc1 ) ! ze1 = zCze |
---|
| 187 | ze2(ji,jj) = 1._wp / ( 0.710 + zlogc * ( 0.159 + zlogc * 0.021 ) ) ! ze2 = 1/zdelpsi |
---|
| 188 | ze3(ji,jj) = EXP( - zc3 ) ! ze3 = 1/zze |
---|
| 189 | END_2D |
---|
| 190 | |
---|
| 191 | ! |
---|
| 192 | DO_3D_00_00 ( 1, nksr + 1 ) |
---|
| 193 | ! zchl = ALOG( ze0(ji,jj) ) |
---|
| 194 | zlogc = ze0(ji,jj) |
---|
| 195 | ! |
---|
| 196 | zCb = 0.768 + zlogc * ( 0.087 - zlogc * ( 0.179 + zlogc * 0.025 ) ) |
---|
| 197 | zCmax = 0.299 - zlogc * ( 0.289 - zlogc * 0.579 ) |
---|
| 198 | zpsimax = 0.6 - zlogc * ( 0.640 - zlogc * ( 0.021 + zlogc * 0.115 ) ) |
---|
| 199 | ! zdelpsi = 0.710 + zlogc * ( 0.159 + zlogc * 0.021 ) |
---|
| 200 | ! |
---|
| 201 | zCze = ze1(ji,jj) |
---|
| 202 | zrdpsi = ze2(ji,jj) ! 1/zdelpsi |
---|
| 203 | zpsi = ze3(ji,jj) * gdepw(ji,jj,jk,Kmm) ! gdepw/zze |
---|
| 204 | ! |
---|
| 205 | ! NB. make sure zchl value is such that: zchl = MIN( 10. , MAX( 0.03, zchl ) ) |
---|
| 206 | zchl = MIN( 10. , MAX( 0.03, zCze * ( zCb + zCmax * EXP( -( (zpsi - zpsimax) * zrdpsi )**2 ) ) ) ) |
---|
| 207 | ! Convert chlorophyll value to attenuation coefficient look-up table index |
---|
| 208 | ztmp3d(ji,jj,jk) = 41 + 20.*LOG10(zchl) + 1.e-15 |
---|
| 209 | END_3D |
---|
| 210 | ELSE !* constant chlorophyll |
---|
| 211 | zchl = 0.05 |
---|
| 212 | ! NB. make sure constant value is such that: |
---|
| 213 | zchl = MIN( 10. , MAX( 0.03, zchl ) ) |
---|
| 214 | ! Convert chlorophyll value to attenuation coefficient look-up table index |
---|
| 215 | zlui = 41 + 20.*LOG10(zchl) + 1.e-15 |
---|
[6403] | 216 | DO jk = 1, nksr + 1 |
---|
[13205] | 217 | ztmp3d(:,:,jk) = zlui |
---|
[3] | 218 | END DO |
---|
[4161] | 219 | ENDIF |
---|
[1423] | 220 | ! |
---|
[6140] | 221 | zcoef = ( 1. - rn_abs ) / 3._wp !* surface equi-partition in R-G-B |
---|
[12377] | 222 | DO_2D_00_00 |
---|
[13205] | 223 | ze0(ji,jj) = rn_abs * qsr(ji,jj) |
---|
| 224 | ze1(ji,jj) = zcoef * qsr(ji,jj) |
---|
| 225 | ze2(ji,jj) = zcoef * qsr(ji,jj) |
---|
| 226 | ze3(ji,jj) = zcoef * qsr(ji,jj) |
---|
| 227 | ! store the surface SW radiation; re-use the surface ztmp3d array |
---|
| 228 | ! since the surface attenuation coefficient is not used |
---|
| 229 | ztmp3d(ji,jj,1) = qsr(ji,jj) |
---|
[12377] | 230 | END_2D |
---|
[6140] | 231 | ! |
---|
[13205] | 232 | !* interior equi-partition in R-G-B depending on vertical profile of Chl |
---|
| 233 | DO_3D_00_00 ( 2, nksr + 1 ) |
---|
| 234 | ze3t = e3t(ji,jj,jk-1,Kmm) |
---|
| 235 | irgb = NINT( ztmp3d(ji,jj,jk) ) |
---|
| 236 | zc0 = ze0(ji,jj) * EXP( - ze3t * xsi0r ) |
---|
| 237 | zc1 = ze1(ji,jj) * EXP( - ze3t * rkrgb(1,irgb) ) |
---|
| 238 | zc2 = ze2(ji,jj) * EXP( - ze3t * rkrgb(2,irgb) ) |
---|
| 239 | zc3 = ze3(ji,jj) * EXP( - ze3t * rkrgb(3,irgb) ) |
---|
| 240 | ze0(ji,jj) = zc0 |
---|
| 241 | ze1(ji,jj) = zc1 |
---|
| 242 | ze2(ji,jj) = zc2 |
---|
| 243 | ze3(ji,jj) = zc3 |
---|
| 244 | ztmp3d(ji,jj,jk) = ( zc0 + zc1 + zc2 + zc3 ) * wmask(ji,jj,jk) |
---|
| 245 | END_3D |
---|
[6140] | 246 | ! |
---|
[12377] | 247 | DO_3D_00_00( 1, nksr ) |
---|
[13205] | 248 | qsr_hc(ji,jj,jk) = r1_rho0_rcp * ( ztmp3d(ji,jj,jk) - ztmp3d(ji,jj,jk+1) ) |
---|
[12377] | 249 | END_3D |
---|
[187] | 250 | ! |
---|
[13205] | 251 | DEALLOCATE( ze0 , ze1 , ze2 , ze3 , ztmp3d ) |
---|
[6140] | 252 | ! |
---|
| 253 | CASE( np_2BD ) !== 2-bands fluxes ==! |
---|
| 254 | ! |
---|
[12489] | 255 | zz0 = rn_abs * r1_rho0_rcp ! surface equi-partition in 2-bands |
---|
| 256 | zz1 = ( 1. - rn_abs ) * r1_rho0_rcp |
---|
[12377] | 257 | DO_3D_00_00( 1, nksr ) |
---|
| 258 | zc0 = zz0 * EXP( -gdepw(ji,jj,jk ,Kmm)*xsi0r ) + zz1 * EXP( -gdepw(ji,jj,jk ,Kmm)*xsi1r ) |
---|
| 259 | zc1 = zz0 * EXP( -gdepw(ji,jj,jk+1,Kmm)*xsi0r ) + zz1 * EXP( -gdepw(ji,jj,jk+1,Kmm)*xsi1r ) |
---|
| 260 | qsr_hc(ji,jj,jk) = qsr(ji,jj) * ( zc0 * wmask(ji,jj,jk) - zc1 * wmask(ji,jj,jk+1) ) |
---|
| 261 | END_3D |
---|
[2528] | 262 | ! |
---|
[6140] | 263 | END SELECT |
---|
| 264 | ! |
---|
| 265 | ! !-----------------------------! |
---|
[12377] | 266 | DO_3D_00_00( 1, nksr ) |
---|
| 267 | pts(ji,jj,jk,jp_tem,Krhs) = pts(ji,jj,jk,jp_tem,Krhs) & |
---|
| 268 | & + z1_2 * ( qsr_hc_b(ji,jj,jk) + qsr_hc(ji,jj,jk) ) / e3t(ji,jj,jk,Kmm) |
---|
| 269 | END_3D |
---|
[6140] | 270 | ! |
---|
[9019] | 271 | ! sea-ice: store the 1st ocean level attenuation coefficient |
---|
[12377] | 272 | DO_2D_00_00 |
---|
[12489] | 273 | IF( qsr(ji,jj) /= 0._wp ) THEN ; fraqsr_1lev(ji,jj) = qsr_hc(ji,jj,1) / ( r1_rho0_rcp * qsr(ji,jj) ) |
---|
[12377] | 274 | ELSE ; fraqsr_1lev(ji,jj) = 1._wp |
---|
| 275 | ENDIF |
---|
| 276 | END_2D |
---|
[10425] | 277 | CALL lbc_lnk( 'traqsr', fraqsr_1lev(:,:), 'T', 1._wp ) |
---|
[2528] | 278 | ! |
---|
[6140] | 279 | IF( iom_use('qsr3d') ) THEN ! output the shortwave Radiation distribution |
---|
[9019] | 280 | ALLOCATE( zetot(jpi,jpj,jpk) ) |
---|
[7753] | 281 | zetot(:,:,nksr+1:jpk) = 0._wp ! below ~400m set to zero |
---|
[6140] | 282 | DO jk = nksr, 1, -1 |
---|
[12489] | 283 | zetot(:,:,jk) = zetot(:,:,jk+1) + qsr_hc(:,:,jk) * rho0_rcp |
---|
[6140] | 284 | END DO |
---|
| 285 | CALL iom_put( 'qsr3d', zetot ) ! 3D distribution of shortwave Radiation |
---|
[9019] | 286 | DEALLOCATE( zetot ) |
---|
[2528] | 287 | ENDIF |
---|
[6140] | 288 | ! |
---|
| 289 | IF( lrst_oce ) THEN ! write in the ocean restart file |
---|
[9367] | 290 | IF( lwxios ) CALL iom_swap( cwxios_context ) |
---|
| 291 | CALL iom_rstput( kt, nitrst, numrow, 'qsr_hc_b' , qsr_hc , ldxios = lwxios ) |
---|
| 292 | CALL iom_rstput( kt, nitrst, numrow, 'fraqsr_1lev', fraqsr_1lev, ldxios = lwxios ) |
---|
| 293 | IF( lwxios ) CALL iom_swap( cxios_context ) |
---|
[6140] | 294 | ENDIF |
---|
| 295 | ! |
---|
[503] | 296 | IF( l_trdtra ) THEN ! qsr tracers trends saved for diagnostics |
---|
[12377] | 297 | ztrdt(:,:,:) = pts(:,:,:,jp_tem,Krhs) - ztrdt(:,:,:) |
---|
| 298 | CALL trd_tra( kt, Kmm, Krhs, 'TRA', jp_tem, jptra_qsr, ztrdt ) |
---|
[9019] | 299 | DEALLOCATE( ztrdt ) |
---|
[3] | 300 | ENDIF |
---|
[457] | 301 | ! ! print mean trends (used for debugging) |
---|
[12377] | 302 | IF(sn_cfctl%l_prtctl) CALL prt_ctl( tab3d_1=pts(:,:,:,jp_tem,Krhs), clinfo1=' qsr - Ta: ', mask1=tmask, clinfo3='tra-ta' ) |
---|
[503] | 303 | ! |
---|
[9019] | 304 | IF( ln_timing ) CALL timing_stop('tra_qsr') |
---|
[3294] | 305 | ! |
---|
[3] | 306 | END SUBROUTINE tra_qsr |
---|
| 307 | |
---|
| 308 | |
---|
| 309 | SUBROUTINE tra_qsr_init |
---|
| 310 | !!---------------------------------------------------------------------- |
---|
| 311 | !! *** ROUTINE tra_qsr_init *** |
---|
| 312 | !! |
---|
| 313 | !! ** Purpose : Initialization for the penetrative solar radiation |
---|
| 314 | !! |
---|
| 315 | !! ** Method : The profile of solar radiation within the ocean is set |
---|
[1423] | 316 | !! from two length scale of penetration (rn_si0,rn_si1) and a ratio |
---|
[1601] | 317 | !! (rn_abs). These parameters are read in the namtra_qsr namelist. The |
---|
[3] | 318 | !! default values correspond to clear water (type I in Jerlov' |
---|
| 319 | !! (1968) classification. |
---|
| 320 | !! called by tra_qsr at the first timestep (nit000) |
---|
| 321 | !! |
---|
[1423] | 322 | !! ** Action : - initialize rn_si0, rn_si1 and rn_abs |
---|
[3] | 323 | !! |
---|
[503] | 324 | !! Reference : Jerlov, N. G., 1968 Optical Oceanography, Elsevier, 194pp. |
---|
[3] | 325 | !!---------------------------------------------------------------------- |
---|
[6140] | 326 | INTEGER :: ji, jj, jk ! dummy loop indices |
---|
| 327 | INTEGER :: ios, irgb, ierror, ioptio ! local integer |
---|
| 328 | REAL(wp) :: zz0, zc0 , zc1, zcoef ! local scalars |
---|
| 329 | REAL(wp) :: zz1, zc2 , zc3, zchl ! - - |
---|
[2715] | 330 | ! |
---|
[1423] | 331 | CHARACTER(len=100) :: cn_dir ! Root directory for location of ssr files |
---|
| 332 | TYPE(FLD_N) :: sn_chl ! informations about the chlorofyl field to be read |
---|
[2715] | 333 | !! |
---|
[9019] | 334 | NAMELIST/namtra_qsr/ sn_chl, cn_dir, ln_qsr_rgb, ln_qsr_2bd, ln_qsr_bio, & |
---|
[2528] | 335 | & nn_chldta, rn_abs, rn_si0, rn_si1 |
---|
[3] | 336 | !!---------------------------------------------------------------------- |
---|
[3294] | 337 | ! |
---|
[6140] | 338 | READ ( numnam_ref, namtra_qsr, IOSTAT = ios, ERR = 901) |
---|
[11536] | 339 | 901 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtra_qsr in reference namelist' ) |
---|
[3294] | 340 | ! |
---|
[4147] | 341 | READ ( numnam_cfg, namtra_qsr, IOSTAT = ios, ERR = 902 ) |
---|
[11536] | 342 | 902 IF( ios > 0 ) CALL ctl_nam ( ios , 'namtra_qsr in configuration namelist' ) |
---|
[4624] | 343 | IF(lwm) WRITE ( numond, namtra_qsr ) |
---|
[1423] | 344 | ! |
---|
| 345 | IF(lwp) THEN ! control print |
---|
| 346 | WRITE(numout,*) |
---|
| 347 | WRITE(numout,*) 'tra_qsr_init : penetration of the surface solar radiation' |
---|
| 348 | WRITE(numout,*) '~~~~~~~~~~~~' |
---|
[1601] | 349 | WRITE(numout,*) ' Namelist namtra_qsr : set the parameter of penetration' |
---|
[6140] | 350 | WRITE(numout,*) ' RGB (Red-Green-Blue) light penetration ln_qsr_rgb = ', ln_qsr_rgb |
---|
| 351 | WRITE(numout,*) ' 2 band light penetration ln_qsr_2bd = ', ln_qsr_2bd |
---|
| 352 | WRITE(numout,*) ' bio-model light penetration ln_qsr_bio = ', ln_qsr_bio |
---|
| 353 | WRITE(numout,*) ' RGB : Chl data (=1) or cst value (=0) nn_chldta = ', nn_chldta |
---|
| 354 | WRITE(numout,*) ' RGB & 2 bands: fraction of light (rn_si1) rn_abs = ', rn_abs |
---|
| 355 | WRITE(numout,*) ' RGB & 2 bands: shortess depth of extinction rn_si0 = ', rn_si0 |
---|
| 356 | WRITE(numout,*) ' 2 bands: longest depth of extinction rn_si1 = ', rn_si1 |
---|
| 357 | WRITE(numout,*) |
---|
[1423] | 358 | ENDIF |
---|
[6140] | 359 | ! |
---|
| 360 | ioptio = 0 ! Parameter control |
---|
| 361 | IF( ln_qsr_rgb ) ioptio = ioptio + 1 |
---|
| 362 | IF( ln_qsr_2bd ) ioptio = ioptio + 1 |
---|
| 363 | IF( ln_qsr_bio ) ioptio = ioptio + 1 |
---|
| 364 | ! |
---|
| 365 | IF( ioptio /= 1 ) CALL ctl_stop( 'Choose ONE type of light penetration in namelist namtra_qsr', & |
---|
| 366 | & ' 2 bands, 3 RGB bands or bio-model light penetration' ) |
---|
| 367 | ! |
---|
| 368 | IF( ln_qsr_rgb .AND. nn_chldta == 0 ) nqsr = np_RGB |
---|
| 369 | IF( ln_qsr_rgb .AND. nn_chldta == 1 ) nqsr = np_RGBc |
---|
| 370 | IF( ln_qsr_2bd ) nqsr = np_2BD |
---|
| 371 | IF( ln_qsr_bio ) nqsr = np_BIO |
---|
| 372 | ! |
---|
| 373 | ! ! Initialisation |
---|
| 374 | xsi0r = 1._wp / rn_si0 |
---|
| 375 | xsi1r = 1._wp / rn_si1 |
---|
| 376 | ! |
---|
| 377 | SELECT CASE( nqsr ) |
---|
| 378 | ! |
---|
| 379 | CASE( np_RGB , np_RGBc ) !== Red-Green-Blue light penetration ==! |
---|
| 380 | ! |
---|
[9169] | 381 | IF(lwp) WRITE(numout,*) ' ==>>> R-G-B light penetration ' |
---|
[6140] | 382 | ! |
---|
| 383 | CALL trc_oce_rgb( rkrgb ) ! tabulated attenuation coef. |
---|
| 384 | ! |
---|
| 385 | nksr = trc_oce_ext_lev( r_si2, 33._wp ) ! level of light extinction |
---|
| 386 | ! |
---|
| 387 | IF(lwp) WRITE(numout,*) ' level of light extinction = ', nksr, ' ref depth = ', gdepw_1d(nksr+1), ' m' |
---|
| 388 | ! |
---|
| 389 | IF( nqsr == np_RGBc ) THEN ! Chl data : set sf_chl structure |
---|
[9169] | 390 | IF(lwp) WRITE(numout,*) ' ==>>> Chlorophyll read in a file' |
---|
[6140] | 391 | ALLOCATE( sf_chl(1), STAT=ierror ) |
---|
| 392 | IF( ierror > 0 ) THEN |
---|
| 393 | CALL ctl_stop( 'tra_qsr_init: unable to allocate sf_chl structure' ) ; RETURN |
---|
| 394 | ENDIF |
---|
| 395 | ALLOCATE( sf_chl(1)%fnow(jpi,jpj,1) ) |
---|
| 396 | IF( sn_chl%ln_tint ) ALLOCATE( sf_chl(1)%fdta(jpi,jpj,1,2) ) |
---|
| 397 | ! ! fill sf_chl with sn_chl and control print |
---|
| 398 | CALL fld_fill( sf_chl, (/ sn_chl /), cn_dir, 'tra_qsr_init', & |
---|
[7646] | 399 | & 'Solar penetration function of read chlorophyll', 'namtra_qsr' , no_print ) |
---|
[1448] | 400 | ENDIF |
---|
[6140] | 401 | IF( nqsr == np_RGB ) THEN ! constant Chl |
---|
[9169] | 402 | IF(lwp) WRITE(numout,*) ' ==>>> Constant Chlorophyll concentration = 0.05' |
---|
[6140] | 403 | ENDIF |
---|
[1448] | 404 | ! |
---|
[6140] | 405 | CASE( np_2BD ) !== 2 bands light penetration ==! |
---|
[1448] | 406 | ! |
---|
[9169] | 407 | IF(lwp) WRITE(numout,*) ' ==>>> 2 bands light penetration' |
---|
[1448] | 408 | ! |
---|
[6140] | 409 | nksr = trc_oce_ext_lev( rn_si1, 100._wp ) ! level of light extinction |
---|
| 410 | IF(lwp) WRITE(numout,*) ' level of light extinction = ', nksr, ' ref depth = ', gdepw_1d(nksr+1), ' m' |
---|
[1455] | 411 | ! |
---|
[6140] | 412 | CASE( np_BIO ) !== BIO light penetration ==! |
---|
[1448] | 413 | ! |
---|
[9169] | 414 | IF(lwp) WRITE(numout,*) ' ==>>> bio-model light penetration' |
---|
[7646] | 415 | IF( .NOT.lk_top ) CALL ctl_stop( 'No bio model : ln_qsr_bio = true impossible ' ) |
---|
[1423] | 416 | ! |
---|
[6140] | 417 | END SELECT |
---|
[503] | 418 | ! |
---|
[7753] | 419 | qsr_hc(:,:,:) = 0._wp ! now qsr heat content set to zero where it will not be computed |
---|
[6140] | 420 | ! |
---|
| 421 | ! 1st ocean level attenuation coefficient (used in sbcssm) |
---|
[5407] | 422 | IF( iom_varid( numror, 'fraqsr_1lev', ldstop = .FALSE. ) > 0 ) THEN |
---|
[9367] | 423 | CALL iom_get( numror, jpdom_autoglo, 'fraqsr_1lev' , fraqsr_1lev, ldxios = lrxios ) |
---|
[5407] | 424 | ELSE |
---|
[7753] | 425 | fraqsr_1lev(:,:) = 1._wp ! default : no penetration |
---|
[5407] | 426 | ENDIF |
---|
| 427 | ! |
---|
[9367] | 428 | IF( lwxios ) THEN |
---|
| 429 | CALL iom_set_rstw_var_active('qsr_hc_b') |
---|
| 430 | CALL iom_set_rstw_var_active('fraqsr_1lev') |
---|
| 431 | ENDIF |
---|
| 432 | ! |
---|
[3] | 433 | END SUBROUTINE tra_qsr_init |
---|
| 434 | |
---|
| 435 | !!====================================================================== |
---|
| 436 | END MODULE traqsr |
---|