[3] | 1 | MODULE zdfric |
---|
| 2 | !!====================================================================== |
---|
| 3 | !! *** MODULE zdfric *** |
---|
| 4 | !! Ocean physics: vertical mixing coefficient compute from the local |
---|
| 5 | !! Richardson number dependent formulation |
---|
| 6 | !!====================================================================== |
---|
[9019] | 7 | !! History : OPA ! 1987-09 (P. Andrich) Original code |
---|
| 8 | !! 4.0 ! 1991-11 (G. Madec) |
---|
| 9 | !! 7.0 ! 1996-01 (G. Madec) complete rewriting of multitasking suppression of common work arrays |
---|
| 10 | !! 8.0 ! 1997-06 (G. Madec) complete rewriting of zdfmix |
---|
| 11 | !! NEMO 1.0 ! 2002-06 (G. Madec) F90: Free form and module |
---|
| 12 | !! 3.3 ! 2010-10 (C. Ethe, G. Madec) reorganisation of initialisation phase |
---|
| 13 | !! 3.3.1! 2011-09 (P. Oddo) Mixed layer depth parameterization |
---|
[14072] | 14 | !! 4.0 ! 2017-04 (G. Madec) remove CPP ddm key & avm at t-point only |
---|
[1601] | 15 | !!---------------------------------------------------------------------- |
---|
[9019] | 16 | |
---|
[3] | 17 | !!---------------------------------------------------------------------- |
---|
[3625] | 18 | !! zdf_ric_init : initialization, namelist read, & parameters control |
---|
[9019] | 19 | !! zdf_ric : update momentum and tracer Kz from the Richardson number |
---|
| 20 | !! ric_rst : read/write RIC restart in ocean restart file |
---|
[3] | 21 | !!---------------------------------------------------------------------- |
---|
[3625] | 22 | USE oce ! ocean dynamics and tracers variables |
---|
| 23 | USE dom_oce ! ocean space and time domain variables |
---|
[9019] | 24 | USE zdf_oce ! vertical physics: variables |
---|
| 25 | USE phycst ! physical constants |
---|
| 26 | USE sbc_oce, ONLY : taum |
---|
| 27 | ! |
---|
[3625] | 28 | USE in_out_manager ! I/O manager |
---|
[9019] | 29 | USE iom ! I/O manager library |
---|
[14072] | 30 | USE lib_fortran ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined) |
---|
[3] | 31 | |
---|
[3294] | 32 | |
---|
[3] | 33 | IMPLICIT NONE |
---|
| 34 | PRIVATE |
---|
| 35 | |
---|
[9019] | 36 | PUBLIC zdf_ric ! called by zdfphy.F90 |
---|
| 37 | PUBLIC ric_rst ! called by zdfphy.F90 |
---|
| 38 | PUBLIC zdf_ric_init ! called by nemogcm.F90 |
---|
[3] | 39 | |
---|
[9019] | 40 | ! !!* Namelist namzdf_ric : Richardson number dependent Kz * |
---|
| 41 | INTEGER :: nn_ric ! coefficient of the parameterization |
---|
| 42 | REAL(wp) :: rn_avmri ! maximum value of the vertical eddy viscosity |
---|
| 43 | REAL(wp) :: rn_alp ! coefficient of the parameterization |
---|
| 44 | REAL(wp) :: rn_ekmfc ! Ekman Factor Coeff |
---|
[14072] | 45 | REAL(wp) :: rn_mldmin ! minimum mixed layer (ML) depth |
---|
[9019] | 46 | REAL(wp) :: rn_mldmax ! maximum mixed layer depth |
---|
| 47 | REAL(wp) :: rn_wtmix ! Vertical eddy Diff. in the ML |
---|
| 48 | REAL(wp) :: rn_wvmix ! Vertical eddy Visc. in the ML |
---|
| 49 | LOGICAL :: ln_mldw ! Use or not the MLD parameters |
---|
[3] | 50 | |
---|
| 51 | !! * Substitutions |
---|
[12377] | 52 | # include "do_loop_substitute.h90" |
---|
[15127] | 53 | # include "domzgr_substitute.h90" |
---|
[3] | 54 | !!---------------------------------------------------------------------- |
---|
[9598] | 55 | !! NEMO/OCE 4.0 , NEMO Consortium (2018) |
---|
[2528] | 56 | !! $Id$ |
---|
[10068] | 57 | !! Software governed by the CeCILL license (see ./LICENSE) |
---|
[247] | 58 | !!---------------------------------------------------------------------- |
---|
[3] | 59 | CONTAINS |
---|
| 60 | |
---|
[9019] | 61 | SUBROUTINE zdf_ric_init |
---|
[2715] | 62 | !!---------------------------------------------------------------------- |
---|
[9019] | 63 | !! *** ROUTINE zdf_ric_init *** |
---|
[14072] | 64 | !! |
---|
[9019] | 65 | !! ** Purpose : Initialization of the vertical eddy diffusivity and |
---|
| 66 | !! viscosity coef. for the Richardson number dependent formulation. |
---|
| 67 | !! |
---|
| 68 | !! ** Method : Read the namzdf_ric namelist and check the parameter values |
---|
| 69 | !! |
---|
| 70 | !! ** input : Namelist namzdf_ric |
---|
| 71 | !! |
---|
| 72 | !! ** Action : increase by 1 the nstop flag is setting problem encounter |
---|
[2715] | 73 | !!---------------------------------------------------------------------- |
---|
[9104] | 74 | INTEGER :: ji, jj, jk ! dummy loop indices |
---|
| 75 | INTEGER :: ios ! Local integer output status for namelist read |
---|
[9019] | 76 | !! |
---|
| 77 | NAMELIST/namzdf_ric/ rn_avmri, rn_alp , nn_ric , rn_ekmfc, & |
---|
| 78 | & rn_mldmin, rn_mldmax, rn_wtmix, rn_wvmix, ln_mldw |
---|
| 79 | !!---------------------------------------------------------------------- |
---|
[2715] | 80 | ! |
---|
[9019] | 81 | READ ( numnam_ref, namzdf_ric, IOSTAT = ios, ERR = 901) |
---|
[11536] | 82 | 901 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namzdf_ric in reference namelist' ) |
---|
[2715] | 83 | |
---|
[9019] | 84 | READ ( numnam_cfg, namzdf_ric, IOSTAT = ios, ERR = 902 ) |
---|
[11536] | 85 | 902 IF( ios > 0 ) CALL ctl_nam ( ios , 'namzdf_ric in configuration namelist' ) |
---|
[9019] | 86 | IF(lwm) WRITE ( numond, namzdf_ric ) |
---|
| 87 | ! |
---|
| 88 | IF(lwp) THEN ! Control print |
---|
| 89 | WRITE(numout,*) |
---|
| 90 | WRITE(numout,*) 'zdf_ric_init : Ri depend vertical mixing scheme' |
---|
| 91 | WRITE(numout,*) '~~~~~~~~~~~~' |
---|
| 92 | WRITE(numout,*) ' Namelist namzdf_ric : set Kz=F(Ri) parameters' |
---|
| 93 | WRITE(numout,*) ' maximum vertical viscosity rn_avmri = ', rn_avmri |
---|
| 94 | WRITE(numout,*) ' coefficient rn_alp = ', rn_alp |
---|
| 95 | WRITE(numout,*) ' exponent nn_ric = ', nn_ric |
---|
| 96 | WRITE(numout,*) ' Ekman layer enhanced mixing ln_mldw = ', ln_mldw |
---|
| 97 | WRITE(numout,*) ' Ekman Factor Coeff rn_ekmfc = ', rn_ekmfc |
---|
| 98 | WRITE(numout,*) ' minimum mixed layer depth rn_mldmin = ', rn_mldmin |
---|
| 99 | WRITE(numout,*) ' maximum mixed layer depth rn_mldmax = ', rn_mldmax |
---|
| 100 | WRITE(numout,*) ' Vertical eddy Diff. in the ML rn_wtmix = ', rn_wtmix |
---|
| 101 | WRITE(numout,*) ' Vertical eddy Visc. in the ML rn_wvmix = ', rn_wvmix |
---|
| 102 | ENDIF |
---|
| 103 | ! |
---|
| 104 | CALL ric_rst( nit000, 'READ' ) !* read or initialize all required files |
---|
| 105 | ! |
---|
| 106 | END SUBROUTINE zdf_ric_init |
---|
[2715] | 107 | |
---|
[9019] | 108 | |
---|
[12377] | 109 | SUBROUTINE zdf_ric( kt, Kmm, p_sh2, p_avm, p_avt ) |
---|
[3] | 110 | !!---------------------------------------------------------------------- |
---|
| 111 | !! *** ROUTINE zdfric *** |
---|
[14072] | 112 | !! |
---|
[3] | 113 | !! ** Purpose : Compute the before eddy viscosity and diffusivity as |
---|
[3294] | 114 | !! a function of the local richardson number. |
---|
[3] | 115 | !! |
---|
[14072] | 116 | !! ** Method : Local richardson number dependent formulation of the |
---|
| 117 | !! vertical eddy viscosity and diffusivity coefficients. |
---|
[1601] | 118 | !! The eddy coefficients are given by: |
---|
| 119 | !! avm = avm0 + avmb |
---|
| 120 | !! avt = avm0 / (1 + rn_alp*ri) |
---|
[3294] | 121 | !! with ri = N^2 / dz(u)**2 |
---|
[12377] | 122 | !! = e3w**2 * rn2/[ mi( dk(uu(:,:,:,Kbb)) )+mj( dk(vv(:,:,:,Kbb)) ) ] |
---|
[9019] | 123 | !! avm0= rn_avmri / (1 + rn_alp*Ri)**nn_ric |
---|
| 124 | !! where ri is the before local Richardson number, |
---|
[14072] | 125 | !! rn_avmri is the maximum value reaches by avm and avt |
---|
[9019] | 126 | !! and rn_alp, nn_ric are adjustable parameters. |
---|
| 127 | !! Typical values : rn_alp=5. and nn_ric=2. |
---|
| 128 | !! |
---|
[3294] | 129 | !! As second step compute Ekman depth from wind stress forcing |
---|
| 130 | !! and apply namelist provided vertical coeff within this depth. |
---|
| 131 | !! The Ekman depth is: |
---|
| 132 | !! Ustar = SQRT(Taum/rho0) |
---|
| 133 | !! ekd= rn_ekmfc * Ustar / f0 |
---|
[9019] | 134 | !! Large et al. (1994, eq.24) suggest rn_ekmfc=0.7; however, the derivation |
---|
[3294] | 135 | !! of the above equation indicates the value is somewhat arbitrary; therefore |
---|
| 136 | !! we allow the freedom to increase or decrease this value, if the |
---|
| 137 | !! Ekman depth estimate appears too shallow or too deep, respectively. |
---|
| 138 | !! Ekd is then limited by rn_mldmin and rn_mldmax provided in the |
---|
| 139 | !! namelist |
---|
[3] | 140 | !! N.B. the mask are required for implicit scheme, and surface |
---|
[9019] | 141 | !! and bottom value already set in zdfphy.F90 |
---|
[3] | 142 | !! |
---|
[9019] | 143 | !! ** Action : avm, avt mixing coeff (inner domain values only) |
---|
| 144 | !! |
---|
[1601] | 145 | !! References : Pacanowski & Philander 1981, JPO, 1441-1451. |
---|
[3294] | 146 | !! PFJ Lermusiaux 2001. |
---|
[3] | 147 | !!---------------------------------------------------------------------- |
---|
[15127] | 148 | INTEGER , INTENT(in ) :: kt ! ocean time-step |
---|
| 149 | INTEGER , INTENT(in ) :: Kmm ! ocean time level index |
---|
| 150 | REAL(wp), DIMENSION(A2D(nn_hls),jpk), INTENT(in ) :: p_sh2 ! shear production term |
---|
| 151 | REAL(wp), DIMENSION(:,:,:) , INTENT(inout) :: p_avm, p_avt ! momentum and tracer Kz (w-points) |
---|
[2715] | 152 | !! |
---|
[9019] | 153 | INTEGER :: ji, jj, jk ! dummy loop indices |
---|
| 154 | REAL(wp) :: zcfRi, zav, zustar, zhek ! local scalars |
---|
[15127] | 155 | REAL(wp), DIMENSION(A2D(nn_hls)) :: zh_ekm ! 2D workspace |
---|
[1537] | 156 | !!---------------------------------------------------------------------- |
---|
[3294] | 157 | ! |
---|
[9019] | 158 | ! !== avm and avt = F(Richardson number) ==! |
---|
[15127] | 159 | DO_3D_OVR( nn_hls, nn_hls-1, nn_hls, nn_hls-1, 2, jpkm1 ) ! coefficient = F(richardson number) (avm-weighted Ri) |
---|
[12377] | 160 | zcfRi = 1._wp / ( 1._wp + rn_alp * MAX( 0._wp , avm(ji,jj,jk) * rn2(ji,jj,jk) / ( p_sh2(ji,jj,jk) + 1.e-20 ) ) ) |
---|
| 161 | zav = rn_avmri * zcfRi**nn_ric |
---|
| 162 | ! ! avm and avt coefficients |
---|
| 163 | p_avm(ji,jj,jk) = MAX( zav , avmb(jk) ) * wmask(ji,jj,jk) |
---|
| 164 | p_avt(ji,jj,jk) = MAX( zav * zcfRi , avtb(jk) ) * wmask(ji,jj,jk) |
---|
| 165 | END_3D |
---|
[1601] | 166 | ! |
---|
[14072] | 167 | !!gm BUG <<<<==== This param can't work at low latitude |
---|
[9019] | 168 | !!gm it provides there much to thick mixed layer ( summer 150m in GYRE configuration !!! ) |
---|
| 169 | ! |
---|
| 170 | IF( ln_mldw ) THEN !== set a minimum value in the Ekman layer ==! |
---|
| 171 | ! |
---|
[15127] | 172 | DO_2D( nn_hls-1, nn_hls-1, nn_hls-1, nn_hls-1 ) |
---|
[12489] | 173 | zustar = SQRT( taum(ji,jj) * r1_rho0 ) |
---|
[12377] | 174 | zhek = rn_ekmfc * zustar / ( ABS( ff_t(ji,jj) ) + rsmall ) ! Ekman depth |
---|
| 175 | zh_ekm(ji,jj) = MAX( rn_mldmin , MIN( zhek , rn_mldmax ) ) ! set allowed range |
---|
| 176 | END_2D |
---|
[15127] | 177 | DO_3D_OVR( nn_hls-1, nn_hls-1, nn_hls-1, nn_hls-1, 2, jpkm1 ) !* minimum mixing coeff. within the Ekman layer |
---|
[12377] | 178 | IF( gdept(ji,jj,jk,Kmm) < zh_ekm(ji,jj) ) THEN |
---|
| 179 | p_avm(ji,jj,jk) = MAX( p_avm(ji,jj,jk), rn_wvmix ) * wmask(ji,jj,jk) |
---|
| 180 | p_avt(ji,jj,jk) = MAX( p_avt(ji,jj,jk), rn_wtmix ) * wmask(ji,jj,jk) |
---|
| 181 | ENDIF |
---|
| 182 | END_3D |
---|
[9019] | 183 | ENDIF |
---|
[1601] | 184 | ! |
---|
[3] | 185 | END SUBROUTINE zdf_ric |
---|
| 186 | |
---|
| 187 | |
---|
[9019] | 188 | SUBROUTINE ric_rst( kt, cdrw ) |
---|
| 189 | !!--------------------------------------------------------------------- |
---|
| 190 | !! *** ROUTINE ric_rst *** |
---|
[14072] | 191 | !! |
---|
[9019] | 192 | !! ** Purpose : Read or write TKE file (en) in restart file |
---|
[3] | 193 | !! |
---|
[9019] | 194 | !! ** Method : use of IOM library |
---|
[14072] | 195 | !! if the restart does not contain TKE, en is either |
---|
| 196 | !! set to rn_emin or recomputed |
---|
[3] | 197 | !!---------------------------------------------------------------------- |
---|
[9019] | 198 | INTEGER , INTENT(in) :: kt ! ocean time-step |
---|
| 199 | CHARACTER(len=*), INTENT(in) :: cdrw ! "READ"/"WRITE" flag |
---|
| 200 | ! |
---|
| 201 | INTEGER :: jit, jk ! dummy loop indices |
---|
| 202 | INTEGER :: id1, id2 ! local integers |
---|
[3] | 203 | !!---------------------------------------------------------------------- |
---|
[1601] | 204 | ! |
---|
[14072] | 205 | IF( TRIM(cdrw) == 'READ' ) THEN ! Read/initialise |
---|
[9019] | 206 | ! ! --------------- |
---|
| 207 | ! !* Read the restart file |
---|
| 208 | IF( ln_rstart ) THEN |
---|
| 209 | id1 = iom_varid( numror, 'avt_k', ldstop = .FALSE. ) |
---|
| 210 | id2 = iom_varid( numror, 'avm_k', ldstop = .FALSE. ) |
---|
| 211 | ! |
---|
| 212 | IF( MIN( id1, id2 ) > 0 ) THEN ! restart exists => read it |
---|
[13970] | 213 | CALL iom_get( numror, jpdom_auto, 'avt_k', avt_k ) |
---|
| 214 | CALL iom_get( numror, jpdom_auto, 'avm_k', avm_k ) |
---|
[9019] | 215 | ENDIF |
---|
| 216 | ENDIF |
---|
| 217 | ! !* otherwise Kz already set to the background value in zdf_phy_init |
---|
| 218 | ! |
---|
| 219 | ELSEIF( TRIM(cdrw) == 'WRITE' ) THEN ! Create restart file |
---|
| 220 | ! ! ------------------- |
---|
| 221 | IF(lwp) WRITE(numout,*) '---- ric-rst ----' |
---|
[13970] | 222 | CALL iom_rstput( kt, nitrst, numrow, 'avt_k', avt_k ) |
---|
| 223 | CALL iom_rstput( kt, nitrst, numrow, 'avm_k', avm_k) |
---|
[9019] | 224 | ! |
---|
[3] | 225 | ENDIF |
---|
[1601] | 226 | ! |
---|
[9019] | 227 | END SUBROUTINE ric_rst |
---|
[3] | 228 | |
---|
| 229 | !!====================================================================== |
---|
| 230 | END MODULE zdfric |
---|