- Timestamp:
- 2020-07-01T15:01:22+02:00 (4 years ago)
- Location:
- branches/UKMO/dev_1d_bugfixes_tocommit/NEMOGCM/NEMO/OPA_SRC/ZDF
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/UKMO/dev_1d_bugfixes_tocommit/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfbfr.F90
r11442 r13191 107 107 WRITE(numout,*) '~~~~~~~~' 108 108 ENDIF 109 ! 109 ! 110 #if defined key_traldf_c2d || key_traldf_c3d 110 111 IF( ln_stopack .AND. ( nn_spp_bfr > 0 ) ) THEN 111 112 bfrcoef2d = bfrcoef2d0 112 113 CALL spp_gen(kt, bfrcoef2d, nn_spp_bfr, rn_bfr_sd, jk_spp_bfr) 113 114 ENDIF 115 #else 116 IF ( ln_stopack .AND. ( nn_spp_bfr > 0 ) ) & 117 & CALL ctl_stop( 'zdf_bfr: parameter perturbation will only work with '// & 118 'key_traldf_c2d or key_traldf_c3d') 119 #endif 114 120 ! 115 121 IF( nn_bfr == 2 ) THEN ! quadratic bottom friction only … … 140 146 END DO 141 147 END IF 142 ! 148 ! 143 149 ELSE 144 150 zbfrt(:,:) = bfrcoef2d(:,:) … … 183 189 DO ji = 2, jpim1 184 190 ! (ISF) ======================================================================== 185 ikbu = miku(ji,jj) ! ocean top level at u- and v-points 191 ikbu = miku(ji,jj) ! ocean top level at u- and v-points 186 192 ikbv = mikv(ji,jj) ! (1st wet ocean u- and v-points) 187 193 ! … … 363 369 bfrcoef2d(:,:) = rn_bfri2 ! initialize bfrcoef2d to the namelist variable 364 370 ENDIF 365 371 366 372 IF ( ln_isfcav ) THEN 367 373 IF(ln_tfr2d) THEN -
branches/UKMO/dev_1d_bugfixes_tocommit/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfevd.F90
r11442 r13191 20 20 USE zdfkpp ! KPP vertical mixing 21 21 USE trd_oce ! trends: ocean variables 22 USE trdtra ! trends manager: tracers 22 USE trdtra ! trends manager: tracers 23 23 USE in_out_manager ! I/O manager 24 24 USE iom ! for iom_put 25 25 USE lbclnk ! ocean lateral boundary conditions (or mpp link) 26 26 USE timing ! Timing 27 USE stopack 27 USE stopack 28 28 29 29 IMPLICIT NONE … … 45 45 !!---------------------------------------------------------------------- 46 46 !! *** ROUTINE zdf_evd *** 47 !! 47 !! 48 48 !! ** Purpose : Local increased the vertical eddy viscosity and diffu- 49 49 !! sivity coefficients when a static instability is encountered. 50 50 !! 51 51 !! ** Method : avt, avm, and the 4 neighbouring avmu, avmv coefficients 52 !! are set to avevd (namelist parameter) if the water column is 52 !! are set to avevd (namelist parameter) if the water column is 53 53 !! statically unstable (i.e. if rn2 < -1.e-12 ) 54 54 !! … … 77 77 zavt_evd(:,:,:) = avt(:,:,:) ! set avt prior to evd application 78 78 79 #if defined key_traldf_c2d || key_traldf_c3d 79 80 IF( ln_stopack .AND. ( nn_spp_aevd > 0 ) ) THEN 80 81 rn_avevd0(:,:) = rn_avevd 81 82 CALL spp_gen(kt, rn_avevd0, nn_spp_aevd, rn_aevd_sd, jk_spp_aevd) 82 83 ENDIF 84 #else 85 IF ( ln_stopack .AND. ( nn_spp_aevd > 0 ) ) & 86 & CALL ctl_stop( 'zdf_evd: parameter perturbation will only work with '// & 87 'key_traldf_c2d or key_traldf_c3d') 88 #endif 83 89 84 90 SELECT CASE ( nn_evdm ) … … 88 94 zavm_evd(:,:,:) = avm(:,:,:) ! set avm prior to evd application 89 95 ! 90 DO jk = 1, jpkm1 96 DO jk = 1, jpkm1 91 97 DO jj = 2, jpj ! no vector opt. 92 98 DO ji = 2, jpi … … 106 112 END DO 107 113 END DO 108 END DO 114 END DO 109 115 CALL lbc_lnk( avt , 'W', 1. ) ; CALL lbc_lnk( avm , 'W', 1. ) ! Lateral boundary conditions 110 116 CALL lbc_lnk( avmu, 'U', 1. ) ; CALL lbc_lnk( avmv, 'V', 1. ) … … 113 119 CALL iom_put( "avm_evd", zavm_evd ) ! output this change 114 120 ! 115 CASE DEFAULT ! enhance vertical eddy diffusivity only (if rn2<-1.e-12) 121 CASE DEFAULT ! enhance vertical eddy diffusivity only (if rn2<-1.e-12) 116 122 DO jk = 1, jpkm1 117 !!! WHERE( rn2(:,:,jk) <= -1.e-12 ) avt(:,:,jk) = tmask(:,:,jk) * avevd ! agissant sur T SEUL! 123 !!! WHERE( rn2(:,:,jk) <= -1.e-12 ) avt(:,:,jk) = tmask(:,:,jk) * avevd ! agissant sur T SEUL! 118 124 DO jj = 1, jpj ! loop over the whole domain (no lbc_lnk call) 119 125 DO ji = 1, jpi 120 126 #if defined key_zdfkpp 121 127 ! no evd mixing in the boundary layer with KPP 122 IF( MIN( rn2(ji,jj,jk), rn2b(ji,jj,jk) ) <= -1.e-12 .AND. fsdepw(ji,jj,jk) > hkpp(ji,jj) ) & 128 IF( MIN( rn2(ji,jj,jk), rn2b(ji,jj,jk) ) <= -1.e-12 .AND. fsdepw(ji,jj,jk) > hkpp(ji,jj) ) & 123 129 #else 124 130 IF( MIN( rn2(ji,jj,jk), rn2b(ji,jj,jk) ) <= -1.e-12 ) & … … 129 135 END DO 130 136 ! 131 END SELECT 137 END SELECT 132 138 133 139 zavt_evd(:,:,:) = avt(:,:,:) - zavt_evd(:,:,:) ! change in avt due to evd -
branches/UKMO/dev_1d_bugfixes_tocommit/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfgls.F90
r11442 r13191 2 2 !!====================================================================== 3 3 !! *** MODULE zdfgls *** 4 !! Ocean physics: vertical mixing coefficient computed from the gls 4 !! Ocean physics: vertical mixing coefficient computed from the gls 5 5 !! turbulent closure parameterization 6 6 !!====================================================================== … … 16 16 !! gls_rst : read/write gls restart in ocean restart file 17 17 !!---------------------------------------------------------------------- 18 USE oce ! ocean dynamics and active tracers 18 USE oce ! ocean dynamics and active tracers 19 19 USE dom_oce ! ocean space and time domain 20 20 USE domvvl ! ocean space and time domain : variable volume layer … … 31 31 USE iom ! I/O manager library 32 32 USE timing ! Timing 33 USE lib_fortran ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined) 33 USE lib_fortran ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined) 34 34 USE stopack 35 35 … … 62 62 REAL(wp) :: rn_crban ! Craig and Banner constant for surface breaking waves mixing 63 63 REAL(wp) :: rn_hsro ! Minimum surface roughness 64 REAL(wp) :: rn_frac_hs ! Fraction of wave height as surface roughness (if nn_z0_met > 1) 64 REAL(wp) :: rn_frac_hs ! Fraction of wave height as surface roughness (if nn_z0_met > 1) 65 65 66 66 REAL(wp) :: rcm_sf = 0.73_wp ! Shear free turbulence parameters 67 REAL(wp) :: ra_sf = -2.0_wp ! Must be negative -2 < ra_sf < -1 68 REAL(wp) :: rl_sf = 0.2_wp ! 0 <rl_sf<vkarmn 67 REAL(wp) :: ra_sf = -2.0_wp ! Must be negative -2 < ra_sf < -1 68 REAL(wp) :: rl_sf = 0.2_wp ! 0 <rl_sf<vkarmn 69 69 REAL(wp) :: rghmin = -0.28_wp 70 70 REAL(wp) :: rgh0 = 0.0329_wp … … 73 73 REAL(wp) :: ra2 = 0.74_wp 74 74 REAL(wp) :: rb1 = 16.60_wp 75 REAL(wp) :: rb2 = 10.10_wp 76 REAL(wp) :: re2 = 1.33_wp 75 REAL(wp) :: rb2 = 10.10_wp 76 REAL(wp) :: re2 = 1.33_wp 77 77 REAL(wp) :: rl1 = 0.107_wp 78 78 REAL(wp) :: rl2 = 0.0032_wp … … 134 134 INTEGER :: ji, jj, jk, ibot, ibotm1, dir ! dummy loop arguments 135 135 REAL(wp) :: zesh2, zsigpsi, zcoef, zex1, zex2 ! local scalars 136 REAL(wp) :: ztx2, zty2, zup, zdown, zcof ! - - 136 REAL(wp) :: ztx2, zty2, zup, zdown, zcof ! - - 137 137 REAL(wp) :: zratio, zrn2, zflxb, sh ! - - 138 138 REAL(wp) :: prod, buoy, diss, zdiss, sm ! - - … … 140 140 REAL(wp), POINTER, DIMENSION(:,: ) :: zdep 141 141 REAL(wp), POINTER, DIMENSION(:,: ) :: zkar 142 REAL(wp), POINTER, DIMENSION(:,: ) :: zflxs ! Turbulence fluxed induced by internal waves 142 REAL(wp), POINTER, DIMENSION(:,: ) :: zflxs ! Turbulence fluxed induced by internal waves 143 143 REAL(wp), POINTER, DIMENSION(:,: ) :: zhsro ! Surface roughness (surface waves) 144 144 REAL(wp), POINTER, DIMENSION(:,:,:) :: eb ! tke at time before … … 157 157 CALL wrk_alloc( jpi,jpj, zdep, zkar, zflxs, zhsro ) 158 158 CALL wrk_alloc( jpi,jpj,jpk, eb, mxlb, shear, eps, zwall_psi, z_elem_a, z_elem_b, z_elem_c, psi ) 159 159 160 160 ! Preliminary computing 161 161 … … 166 166 avm (:,:,:) = avm_k (:,:,:) 167 167 avmu(:,:,:) = avmu_k(:,:,:) 168 avmv(:,:,:) = avmv_k(:,:,:) 168 avmv(:,:,:) = avmv_k(:,:,:) 169 169 ENDIF 170 170 171 171 ! Compute surface and bottom friction at T-points 172 !CDIR NOVERRCHK 173 DO jj = 2, jpjm1 174 !CDIR NOVERRCHK 175 DO ji = fs_2, fs_jpim1 ! vector opt. 172 !CDIR NOVERRCHK 173 DO jj = 2, jpjm1 174 !CDIR NOVERRCHK 175 DO ji = fs_2, fs_jpim1 ! vector opt. 176 176 ! 177 177 ! surface friction 178 178 ustars2(ji,jj) = r1_rau0 * taum(ji,jj) * tmask(ji,jj,1) 179 ! 180 ! bottom friction (explicit before friction) 181 ! Note that we chose here not to bound the friction as in dynbfr) 182 ztx2 = ( bfrua(ji,jj) * ub(ji,jj,mbku(ji,jj)) + bfrua(ji-1,jj) * ub(ji-1,jj,mbku(ji-1,jj)) ) & 183 & * ( 1._wp - 0.5_wp * umask(ji,jj,1) * umask(ji-1,jj,1) ) 184 zty2 = ( bfrva(ji,jj) * vb(ji,jj,mbkv(ji,jj)) + bfrva(ji,jj-1) * vb(ji,jj-1,mbkv(ji,jj-1)) ) & 185 & * ( 1._wp - 0.5_wp * vmask(ji,jj,1) * vmask(ji,jj-1,1) ) 186 ustarb2(ji,jj) = SQRT( ztx2 * ztx2 + zty2 * zty2 ) * tmask(ji,jj,1) 187 END DO 188 END DO 179 ! 180 ! bottom friction (explicit before friction) 181 ! Note that we chose here not to bound the friction as in dynbfr) 182 ztx2 = ( bfrua(ji,jj) * ub(ji,jj,mbku(ji,jj)) + bfrua(ji-1,jj) * ub(ji-1,jj,mbku(ji-1,jj)) ) & 183 & * ( 1._wp - 0.5_wp * umask(ji,jj,1) * umask(ji-1,jj,1) ) 184 zty2 = ( bfrva(ji,jj) * vb(ji,jj,mbkv(ji,jj)) + bfrva(ji,jj-1) * vb(ji,jj-1,mbkv(ji,jj-1)) ) & 185 & * ( 1._wp - 0.5_wp * vmask(ji,jj,1) * vmask(ji,jj-1,1) ) 186 ustarb2(ji,jj) = SQRT( ztx2 * ztx2 + zty2 * zty2 ) * tmask(ji,jj,1) 187 END DO 188 END DO 189 189 190 190 ! Set surface roughness length 191 191 SELECT CASE ( nn_z0_met ) 192 192 ! 193 CASE ( 0 ) ! Constant roughness 193 CASE ( 0 ) ! Constant roughness 194 194 zhsro(:,:) = rn_hsro 195 195 CASE ( 1 ) ! Standard Charnock formula … … 227 227 IF( nn_clos == 0 ) THEN ! Mellor-Yamada 228 228 DO jk = 2, jpkm1 229 DO jj = 2, jpjm1 229 DO jj = 2, jpjm1 230 230 DO ji = fs_2, fs_jpim1 ! vector opt. 231 231 zup = mxln(ji,jj,jk) * fsdepw(ji,jj,mbkt(ji,jj)+1) … … 276 276 IF( ln_sigpsi ) THEN 277 277 zsigpsi = MIN( 1._wp, zesh2 / eps(ji,jj,jk) ) ! 0. <= zsigpsi <= 1. 278 zwall_psi(ji,jj,jk) = rsc_psi / & 278 zwall_psi(ji,jj,jk) = rsc_psi / & 279 279 & ( zsigpsi * rsc_psi + (1._wp-zsigpsi) * rsc_psi0 / MAX( zwall(ji,jj,jk), 1._wp ) ) 280 280 ELSE … … 295 295 ! diagonal 296 296 z_elem_b(ji,jj,jk) = 1._wp - z_elem_a(ji,jj,jk) - z_elem_c(ji,jj,jk) & 297 & + rdt * zdiss * tmask(ji,jj,jk) 297 & + rdt * zdiss * tmask(ji,jj,jk) 298 298 ! 299 299 ! right hand side in en … … 317 317 ! First level 318 318 en(:,:,1) = rc02r * ustars2(:,:) * (1._wp + rsbc_tke1)**(2._wp/3._wp) 319 en(:,:,1) = MAX(en(:,:,1), rn_emin) 319 en(:,:,1) = MAX(en(:,:,1), rn_emin) 320 320 z_elem_a(:,:,1) = en(:,:,1) 321 321 z_elem_c(:,:,1) = 0._wp 322 322 z_elem_b(:,:,1) = 1._wp 323 ! 323 ! 324 324 ! One level below 325 325 en(:,:,2) = rc02r * ustars2(:,:) * (1._wp + rsbc_tke1 * ((zhsro(:,:)+fsdepw(:,:,2)) & 326 326 & / zhsro(:,:) )**(1.5_wp*ra_sf))**(2._wp/3._wp) 327 327 en(:,:,2) = MAX(en(:,:,2), rn_emin ) 328 z_elem_a(:,:,2) = 0._wp 328 z_elem_a(:,:,2) = 0._wp 329 329 z_elem_c(:,:,2) = 0._wp 330 330 z_elem_b(:,:,2) = 1._wp … … 335 335 ! Dirichlet conditions at k=1 336 336 en(:,:,1) = rc02r * ustars2(:,:) * (1._wp + rsbc_tke1)**(2._wp/3._wp) 337 en(:,:,1) = MAX(en(:,:,1), rn_emin) 337 en(:,:,1) = MAX(en(:,:,1), rn_emin) 338 338 z_elem_a(:,:,1) = en(:,:,1) 339 339 z_elem_c(:,:,1) = 0._wp … … 358 358 SELECT CASE ( nn_bc_bot ) 359 359 ! 360 CASE ( 0 ) ! Dirichlet 360 CASE ( 0 ) ! Dirichlet 361 361 ! ! en(ibot) = u*^2 / Co2 and mxln(ibot) = rn_lmin 362 362 ! ! Balance between the production and the dissipation terms … … 378 378 z_elem_c(ji,jj,ibotm1) = 0._wp 379 379 z_elem_b(ji,jj,ibotm1) = 1._wp 380 en(ji,jj,ibotm1) = MAX( rc02r * ustarb2(ji,jj), rn_emin ) 380 en(ji,jj,ibotm1) = MAX( rc02r * ustarb2(ji,jj), rn_emin ) 381 381 END DO 382 382 END DO 383 383 ! 384 384 CASE ( 1 ) ! Neumman boundary condition 385 ! 385 ! 386 386 !CDIR NOVERRCHK 387 387 DO jj = 2, jpjm1 … … 429 429 END DO 430 430 END DO 431 ! ! set the minimum value of tke 431 ! ! set the minimum value of tke 432 432 en(:,:,:) = MAX( en(:,:,:), rn_emin ) 433 433 … … 471 471 DO jj = 2, jpjm1 472 472 DO ji = fs_2, fs_jpim1 ! vector opt. 473 psi(ji,jj,jk) = rc02 * eb(ji,jj,jk) * mxlb(ji,jj,jk)**rnn 473 psi(ji,jj,jk) = rc02 * eb(ji,jj,jk) * mxlb(ji,jj,jk)**rnn 474 474 END DO 475 475 END DO … … 490 490 ! 491 491 ! psi / k 492 zratio = psi(ji,jj,jk) / eb(ji,jj,jk) 492 zratio = psi(ji,jj,jk) / eb(ji,jj,jk) 493 493 ! 494 494 ! psi3+ : stable : B=-KhN²<0 => N²>0 if rn2>0 dir = 1 (stable) otherwise dir = 0 (unstable) … … 510 510 zesh2 = dir * ( prod + buoy ) + (1._wp - dir ) * prod ! production term 511 511 zdiss = dir * ( diss / psi(ji,jj,jk) ) + (1._wp - dir ) * (diss-buoy) / psi(ji,jj,jk) ! dissipation term 512 ! 512 ! 513 513 ! building the matrix 514 514 zcof = rfact_psi * zwall_psi(ji,jj,jk) * tmask(ji,jj,jk) … … 552 552 z_elem_c(:,:,2) = 0._wp 553 553 z_elem_b(:,:,2) = 1._wp 554 ! 554 ! 555 555 ! 556 556 CASE ( 1 ) ! Neumann boundary condition on d(psi)/dz … … 576 576 psi(:,:,2) = psi(:,:,2) + zflxs(:,:) / fse3w(:,:,2) 577 577 578 ! 578 ! 579 579 ! 580 580 END SELECT … … 586 586 ! 587 587 ! 588 CASE ( 0 ) ! Dirichlet 588 CASE ( 0 ) ! Dirichlet 589 589 ! ! en(ibot) = u*^2 / Co2 and mxln(ibot) = vkarmn * rn_bfrz0 590 590 ! ! Balance between the production and the dissipation terms … … 611 611 ! 612 612 CASE ( 1 ) ! Neumman boundary condition 613 ! 613 ! 614 614 !CDIR NOVERRCHK 615 615 DO jj = 2, jpjm1 … … 693 693 DO jj = 2, jpjm1 694 694 DO ji = fs_2, fs_jpim1 ! vector opt. 695 eps(ji,jj,jk) = rc04 * en(ji,jj,jk) * psi(ji,jj,jk) 695 eps(ji,jj,jk) = rc04 * en(ji,jj,jk) * psi(ji,jj,jk) 696 696 END DO 697 697 END DO … … 720 720 eps(ji,jj,jk) = MAX( eps(ji,jj,jk), rn_epsmin ) 721 721 mxln(ji,jj,jk) = rc03 * en(ji,jj,jk) * SQRT( en(ji,jj,jk) ) / eps(ji,jj,jk) 722 ! Galperin criterium (NOTE : Not required if the proper value of C3 in stable cases is calculated) 722 ! Galperin criterium (NOTE : Not required if the proper value of C3 in stable cases is calculated) 723 723 zrn2 = MAX( rn2(ji,jj,jk), rsmall ) 724 724 IF (ln_length_lim) mxln(ji,jj,jk) = MIN( rn_clim_galp * SQRT( 2._wp * en(ji,jj,jk) / zrn2 ), mxln(ji,jj,jk) ) 725 725 END DO 726 726 END DO 727 END DO 727 END DO 728 728 729 729 ! … … 807 807 END DO 808 808 END DO 809 #if defined key_traldf_c2d || key_traldf_c3d 809 810 IF( ln_stopack) THEN 810 811 IF( nn_spp_avt > 0 ) CALL spp_gen(kt, avt(:,:,jk), nn_spp_avt, rn_avt_sd,jk) 811 812 IF( nn_spp_avm > 0 ) CALL spp_gen(kt, avm(:,:,jk), nn_spp_avm, rn_avm_sd,jk) 812 ENDIF 813 ENDIF 814 #else 815 IF ( ln_stopack ) & 816 & CALL ctl_stop( 'zdf_gls: parameter perturbation will only work with '// & 817 'key_traldf_c2d or key_traldf_c3d') 818 #endif 813 819 END DO 814 820 ! … … 851 857 !!---------------------------------------------------------------------- 852 858 !! *** ROUTINE zdf_gls_init *** 853 !! 854 !! ** Purpose : Initialization of the vertical eddy diffivity and 859 !! 860 !! ** Purpose : Initialization of the vertical eddy diffivity and 855 861 !! viscosity when using a gls turbulent closure scheme 856 862 !! … … 1071 1077 ! 1072 1078 END SELECT 1073 1079 1074 1080 ! !* Set Schmidt number for psi diffusion in the wave breaking case 1075 1081 ! ! See Eq. (13) of Carniel et al, OM, 30, 225-239, 2009 1076 1082 ! ! or Eq. (17) of Burchard, JPO, 31, 3133-3145, 2001 1077 1083 IF( ln_sigpsi ) THEN 1078 ra_sf = -1.5 ! Set kinetic energy slope, then deduce rsc_psi and rl_sf 1084 ra_sf = -1.5 ! Set kinetic energy slope, then deduce rsc_psi and rl_sf 1079 1085 ! Verification: retrieve Burchard (2001) results by uncomenting the line below: 1080 1086 ! Note that the results depend on the value of rn_cm_sf which is constant (=rc0) in his work … … 1084 1090 rsc_psi0 = rsc_psi 1085 1091 ENDIF 1086 1092 1087 1093 ! !* Shear free turbulence parameters 1088 1094 ! … … 1130 1136 rc04 = rc03 * rc0 1131 1137 rsbc_tke1 = -3._wp/2._wp*rn_crban*ra_sf*rl_sf ! Dirichlet + Wave breaking 1132 rsbc_tke2 = rdt * rn_crban / rl_sf ! Neumann + Wave breaking 1138 rsbc_tke2 = rdt * rn_crban / rl_sf ! Neumann + Wave breaking 1133 1139 zcr = MAX(rsmall, rsbc_tke1**(1./(-ra_sf*3._wp/2._wp))-1._wp ) 1134 rtrans = 0.2_wp / zcr ! Ad. inverse transition length between log and wave layer 1140 rtrans = 0.2_wp / zcr ! Ad. inverse transition length between log and wave layer 1135 1141 rsbc_zs1 = rn_charn/grav ! Charnock formula for surface roughness 1136 rsbc_zs2 = rn_frac_hs / 0.85_wp / grav * 665._wp ! Rascle formula for surface roughness 1142 rsbc_zs2 = rn_frac_hs / 0.85_wp / grav * 665._wp ! Rascle formula for surface roughness 1137 1143 rsbc_psi1 = -0.5_wp * rdt * rc0**(rpp-2._wp*rmm) / rsc_psi 1138 rsbc_psi2 = -0.5_wp * rdt * rc0**rpp * rnn * vkarmn**rnn / rsc_psi ! Neumann + NO Wave breaking 1144 rsbc_psi2 = -0.5_wp * rdt * rc0**rpp * rnn * vkarmn**rnn / rsc_psi ! Neumann + NO Wave breaking 1139 1145 1140 1146 rfact_tke = -0.5_wp / rsc_tke * rdt ! Cst used for the Diffusion term of tke … … 1151 1157 avmv(:,:,jk) = avmb(jk) * vmask(:,:,jk) 1152 1158 END DO 1153 ! 1159 ! 1154 1160 CALL gls_rst( nit000, 'READ' ) !* read or initialize all required files 1155 1161 ! … … 1162 1168 !!--------------------------------------------------------------------- 1163 1169 !! *** ROUTINE ts_rst *** 1164 !! 1170 !! 1165 1171 !! ** Purpose : Read or write TKE file (en) in restart file 1166 1172 !! 1167 1173 !! ** Method : use of IOM library 1168 !! if the restart does not contain TKE, en is either 1174 !! if the restart does not contain TKE, en is either 1169 1175 !! set to rn_emin or recomputed (nn_igls/=0) 1170 1176 !!---------------------------------------------------------------------- … … 1178 1184 !!---------------------------------------------------------------------- 1179 1185 ! 1180 IF( TRIM(cdrw) == 'READ' ) THEN ! Read/initialise 1186 IF( TRIM(cdrw) == 'READ' ) THEN ! Read/initialise 1181 1187 ! ! --------------- 1182 1188 IF( ln_rstart ) THEN !* Read the restart file … … 1197 1203 CALL iom_get( numror, jpdom_autoglo, 'mxln' , mxln ) 1198 1204 IF(nn_timing == 2) CALL timing_stop('iom_rstget') 1199 ELSE 1205 ELSE 1200 1206 IF(lwp) WRITE(numout,*) ' ===>>>> : previous run without gls scheme, en and mxln computed by iterative loop' 1201 1207 en (:,:,:) = rn_emin 1202 mxln(:,:,:) = 0.05 1208 mxln(:,:,:) = 0.05 1203 1209 avt_k (:,:,:) = avt (:,:,:) 1204 1210 avm_k (:,:,:) = avm (:,:,:) … … 1210 1216 IF(lwp) WRITE(numout,*) ' ===>>>> : Initialisation of en and mxln by background values' 1211 1217 en (:,:,:) = rn_emin 1212 mxln(:,:,:) = 0.05 1218 mxln(:,:,:) = 0.05 1213 1219 ENDIF 1214 1220 ! … … 1217 1223 IF(lwp) WRITE(numout,*) '---- gls-rst ----' 1218 1224 IF(nn_timing == 2) CALL timing_start('iom_rstput') 1219 CALL iom_rstput( kt, nitrst, numrow, 'en' , en ) 1225 CALL iom_rstput( kt, nitrst, numrow, 'en' , en ) 1220 1226 CALL iom_rstput( kt, nitrst, numrow, 'avt' , avt_k ) 1221 1227 CALL iom_rstput( kt, nitrst, numrow, 'avm' , avm_k ) 1222 CALL iom_rstput( kt, nitrst, numrow, 'avmu' , avmu_k ) 1228 CALL iom_rstput( kt, nitrst, numrow, 'avmu' , avmu_k ) 1223 1229 CALL iom_rstput( kt, nitrst, numrow, 'avmv' , avmv_k ) 1224 1230 CALL iom_rstput( kt, nitrst, numrow, 'mxln' , mxln ) … … 1239 1245 WRITE(*,*) 'zdf_gls_init: You should not have seen this print! error?' 1240 1246 END SUBROUTINE zdf_gls_init 1241 1247 1242 1248 SUBROUTINE zdf_gls( kt ) ! Empty routine 1243 1249 IMPLICIT NONE 1244 INTEGER, INTENT(in) :: kt ! ocean time step 1250 INTEGER, INTENT(in) :: kt ! ocean time step 1245 1251 WRITE(*,*) 'zdf_gls: You should not have seen this print! error?', kt 1246 1252 END SUBROUTINE zdf_gls 1247 1253 1248 1254 SUBROUTINE gls_rst( kt, cdrw ) ! Empty routine 1249 1255 IMPLICIT NONE … … 1256 1262 !!====================================================================== 1257 1263 END MODULE zdfgls 1258 -
branches/UKMO/dev_1d_bugfixes_tocommit/NEMOGCM/NEMO/OPA_SRC/ZDF/zdftke.F90
r11442 r13191 2 2 !!====================================================================== 3 3 !! *** MODULE zdftke *** 4 !! Ocean physics: vertical mixing coefficient computed from the tke 4 !! Ocean physics: vertical mixing coefficient computed from the tke 5 5 !! turbulent closure parameterization 6 6 !!===================================================================== … … 22 22 !! - ! 2008-05 (J.-M. Molines, G. Madec) 2D form of avtb 23 23 !! - ! 2008-06 (G. Madec) style + DOCTOR name for namelist parameters 24 !! - ! 2008-12 (G. Reffray) stable discretization of the production term 25 !! 3.2 ! 2009-06 (G. Madec, S. Masson) TKE restart compatible with key_cpl 24 !! - ! 2008-12 (G. Reffray) stable discretization of the production term 25 !! 3.2 ! 2009-06 (G. Madec, S. Masson) TKE restart compatible with key_cpl 26 26 !! ! + cleaning of the parameters + bugs correction 27 27 !! 3.3 ! 2010-10 (C. Ethe, G. Madec) reorganisation of initialisation phase … … 52 52 USE wrk_nemo ! work arrays 53 53 USE timing ! Timing 54 USE lib_fortran ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined) 54 USE lib_fortran ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined) 55 55 #if defined key_agrif 56 56 USE agrif_opa_interp … … 74 74 INTEGER :: nn_pdl ! Prandtl number or not (ratio avt/avm) (=0/1) 75 75 REAL(wp) :: rn_ediff ! coefficient for avt: avt=rn_ediff*mxl*sqrt(e) 76 REAL(wp) :: rn_ediss ! coefficient of the Kolmogoroff dissipation 76 REAL(wp) :: rn_ediss ! coefficient of the Kolmogoroff dissipation 77 77 REAL(wp) :: rn_ebb ! coefficient of the surface input of tke 78 78 REAL(wp) :: rn_emin ! minimum value of tke [m2/s2] … … 102 102 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: e_niw !: TKE budget- near-inertial waves term 103 103 REAL(wp) , ALLOCATABLE, SAVE, DIMENSION(:,:) :: efr ! surface boundary condition for nn_etau = 4 104 104 105 105 !! * Substitutions 106 106 # include "domzgr_substitute.h90" … … 118 118 !!---------------------------------------------------------------------- 119 119 ALLOCATE( & 120 & efr (jpi,jpj) , e_niw(jpi,jpj,jpk) , & 120 & efr (jpi,jpj) , e_niw(jpi,jpj,jpk) , & 121 121 #if defined key_c1d 122 122 & e_dis(jpi,jpj,jpk) , e_mix(jpi,jpj,jpk) , & … … 147 147 !! surface: en = max( rn_emin0, rn_ebb * taum ) 148 148 !! bottom : en = rn_emin 149 !! The associated critical Richardson number is: ri_cri = 2/(2+rn_ediss/rn_ediff) 150 !! 151 !! The now Turbulent kinetic energy is computed using the following 149 !! The associated critical Richardson number is: ri_cri = 2/(2+rn_ediss/rn_ediff) 150 !! 151 !! The now Turbulent kinetic energy is computed using the following 152 152 !! time stepping: implicit for vertical diffusion term, linearized semi 153 !! implicit for kolmogoroff dissipation term, and explicit forward for 154 !! both buoyancy and shear production terms. Therefore a tridiagonal 153 !! implicit for kolmogoroff dissipation term, and explicit forward for 154 !! both buoyancy and shear production terms. Therefore a tridiagonal 155 155 !! linear system is solved. Note that buoyancy and shear terms are 156 156 !! discretized in a energy conserving form (Bruchard 2002). … … 160 160 !! 161 161 !! The now vertical eddy vicosity and diffusivity coefficients are 162 !! given by: 162 !! given by: 163 163 !! avm = max( avtb, rn_ediff * zmxlm * en^1/2 ) 164 !! avt = max( avmb, pdl * avm ) 164 !! avt = max( avmb, pdl * avm ) 165 165 !! eav = max( avmb, avm ) 166 166 !! where pdl, the inverse of the Prandtl number is 1 if nn_pdl=0 and 167 !! given by an empirical funtion of the localRichardson number if nn_pdl=1 167 !! given by an empirical funtion of the localRichardson number if nn_pdl=1 168 168 !! 169 169 !! ** Action : compute en (now turbulent kinetic energy) … … 180 180 ! 181 181 IF( kt /= nit000 ) THEN ! restore before value to compute tke 182 avt (:,:,:) = avt_k (:,:,:) 183 avm (:,:,:) = avm_k (:,:,:) 184 avmu(:,:,:) = avmu_k(:,:,:) 185 avmv(:,:,:) = avmv_k(:,:,:) 186 ENDIF 187 ! 182 avt (:,:,:) = avt_k (:,:,:) 183 avm (:,:,:) = avm_k (:,:,:) 184 avmu(:,:,:) = avmu_k(:,:,:) 185 avmv(:,:,:) = avmv_k(:,:,:) 186 ENDIF 187 ! 188 #if defined key_traldf_c2d || key_traldf_c3d 188 189 IF( ln_stopack) THEN 189 190 IF( nn_spp_tkelc > 0 ) THEN … … 208 209 ENDIF 209 210 ENDIF 211 #else 212 IF ( ln_stopack ) & 213 & CALL ctl_stop( 'zdf_tke: parameter perturbation will only work with '// & 214 'key_traldf_c2d or key_traldf_c3d') 215 #endif 210 216 ! 211 217 CALL tke_tke ! now tke (en) … … 213 219 CALL tke_avn ! now avt, avm, avmu, avmv 214 220 ! 215 avt_k (:,:,:) = avt (:,:,:) 216 avm_k (:,:,:) = avm (:,:,:) 217 avmu_k(:,:,:) = avmu(:,:,:) 218 avmv_k(:,:,:) = avmv(:,:,:) 221 avt_k (:,:,:) = avt (:,:,:) 222 avm_k (:,:,:) = avm (:,:,:) 223 avmu_k(:,:,:) = avmu(:,:,:) 224 avmv_k(:,:,:) = avmv(:,:,:) 219 225 ! 220 226 #if defined key_agrif 221 ! Update child grid f => parent grid 227 ! Update child grid f => parent grid 222 228 IF( .NOT.Agrif_Root() ) CALL Agrif_Update_Tke( kt ) ! children only 223 #endif 229 #endif 224 230 IF ( kt == nitend ) THEN 225 231 DEALLOCATE ( rn_lc0, rn_ediff0, rn_ediss0, rn_ebb0, rn_efr0 ) … … 271 277 CALL wrk_alloc( jpi,jpj, zfact2 ) 272 278 CALL wrk_alloc( jpi,jpj, zfact3 ) 273 CALL wrk_alloc( jpi,jpj,jpk, zpelc, zdiag, zd_up, zd_lw ) 279 CALL wrk_alloc( jpi,jpj,jpk, zpelc, zdiag, zd_up, zd_lw ) 274 280 ! 275 281 zbbrau = rn_ebb0 / rau0 ! Local constant initialisation 276 zfact1 = -.5_wp * rdt 282 zfact1 = -.5_wp * rdt 277 283 zfact2 = 1.5_wp * rdt * rn_ediss0 278 284 zfact3 = 0.5_wp * rn_ediss0 … … 294 300 END DO 295 301 END DO 296 302 297 303 !!bfr - start commented area 298 304 ! !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< … … 333 339 imlc(:,:) = mbkt(:,:) + 1 ! Initialization to the number of w ocean point (=2 over land) 334 340 DO jk = jpkm1, 2, -1 335 DO jj = 1, jpj ! Last w-level at which zpelc>=0.5*us*us 341 DO jj = 1, jpj ! Last w-level at which zpelc>=0.5*us*us 336 342 DO ji = 1, jpi ! with us=0.016*wind(starting from jpk-1) 337 343 zus = zcof * taum(ji,jj) … … 341 347 END DO 342 348 ! ! finite LC depth 343 DO jj = 1, jpj 349 DO jj = 1, jpj 344 350 DO ji = 1, jpi 345 351 zhlc(ji,jj) = fsdepw(ji,jj,imlc(ji,jj)) … … 378 384 DO ji = 1, jpi 379 385 avmu(ji,jj,jk) = avmu(ji,jj,jk) * ( un(ji,jj,jk-1) - un(ji,jj,jk) ) & 380 & * ( ub(ji,jj,jk-1) - ub(ji,jj,jk) ) & 386 & * ( ub(ji,jj,jk-1) - ub(ji,jj,jk) ) & 381 387 & / ( fse3uw_n(ji,jj,jk) & 382 388 & * fse3uw_b(ji,jj,jk) ) … … 407 413 ! ! shear prod. at w-point weightened by mask 408 414 zesh2 = ( avmu(ji-1,jj,jk) + avmu(ji,jj,jk) ) / MAX( 1._wp , umask(ji-1,jj,jk) + umask(ji,jj,jk) ) & 409 & + ( avmv(ji,jj-1,jk) + avmv(ji,jj,jk) ) / MAX( 1._wp , vmask(ji,jj-1,jk) + vmask(ji,jj,jk) ) 415 & + ( avmv(ji,jj-1,jk) + avmv(ji,jj,jk) ) / MAX( 1._wp , vmask(ji,jj-1,jk) + vmask(ji,jj,jk) ) 410 416 ! 411 417 zd_up(ji,jj,jk) = zzd_up ! Matrix (zdiag, zd_up, zd_lw) … … 464 470 END DO 465 471 466 ! ! Save TKE prior to nn_etau addition 467 e_niw(:,:,:) = en(:,:,:) 468 ! 472 ! ! Save TKE prior to nn_etau addition 473 e_niw(:,:,:) = en(:,:,:) 474 ! 469 475 ! !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 470 476 ! ! TKE due to surface and internal wave breaking … … 508 514 ztx2 = utau(ji-1,jj ) + utau(ji,jj) 509 515 zty2 = vtau(ji ,jj-1) + vtau(ji,jj) 510 ztau = 0.5_wp * SQRT( ztx2 * ztx2 + zty2 * zty2 ) * tmask(ji,jj,1) ! module of the mean stress 511 zdif = taum(ji,jj) - ztau ! mean of modulus - modulus of the mean 516 ztau = 0.5_wp * SQRT( ztx2 * ztx2 + zty2 * zty2 ) * tmask(ji,jj,1) ! module of the mean stress 517 zdif = taum(ji,jj) - ztau ! mean of modulus - modulus of the mean 512 518 zdif = rhftau_scl * MAX( 0._wp, zdif + rhftau_add ) ! apply some modifications... 513 519 en(ji,jj,jk) = en(ji,jj,jk) + zbbrau(ji,jj) * zdif * EXP( -fsdepw(ji,jj,jk) / htau(ji,jj) ) & … … 517 523 END DO 518 524 ELSEIF( nn_etau == 4 ) THEN !* column integral independant of htau (rn_efr must be scaled up) 519 IF( nn_htau == 2 ) THEN ! efr dependant on time-varying htau 525 IF( nn_htau == 2 ) THEN ! efr dependant on time-varying htau 520 526 DO jj = 2, jpjm1 521 527 DO ji = fs_2, fs_jpim1 ! vector opt. … … 535 541 CALL lbc_lnk( en, 'W', 1. ) ! Lateral boundary conditions (sign unchanged) 536 542 ! 537 DO jk = 2, jpkm1 ! TKE budget: near-inertial waves term 538 DO jj = 2, jpjm1 539 DO ji = fs_2, fs_jpim1 ! vector opt. 540 e_niw(ji,jj,jk) = en(ji,jj,jk) - e_niw(ji,jj,jk) 541 END DO 542 END DO 543 END DO 544 ! 545 CALL lbc_lnk( e_niw, 'W', 1. ) 543 DO jk = 2, jpkm1 ! TKE budget: near-inertial waves term 544 DO jj = 2, jpjm1 545 DO ji = fs_2, fs_jpim1 ! vector opt. 546 e_niw(ji,jj,jk) = en(ji,jj,jk) - e_niw(ji,jj,jk) 547 END DO 548 END DO 549 END DO 550 ! 551 CALL lbc_lnk( e_niw, 'W', 1. ) 546 552 ! 547 553 CALL wrk_dealloc( jpi,jpj, imlc ) ! integer 548 CALL wrk_dealloc( jpi,jpj, zhlc ) 549 CALL wrk_dealloc( jpi,jpj, zbbrau ) 550 CALL wrk_dealloc( jpi,jpj, zfact2 ) 551 CALL wrk_dealloc( jpi,jpj, zfact3 ) 552 CALL wrk_dealloc( jpi,jpj,jpk, zpelc, zdiag, zd_up, zd_lw ) 554 CALL wrk_dealloc( jpi,jpj, zhlc ) 555 CALL wrk_dealloc( jpi,jpj, zbbrau ) 556 CALL wrk_dealloc( jpi,jpj, zfact2 ) 557 CALL wrk_dealloc( jpi,jpj, zfact3 ) 558 CALL wrk_dealloc( jpi,jpj,jpk, zpelc, zdiag, zd_up, zd_lw ) 553 559 ! 554 560 IF( nn_timing == 1 ) CALL timing_stop('tke_tke') … … 563 569 !! ** Purpose : Compute the vertical eddy viscosity and diffusivity 564 570 !! 565 !! ** Method : At this stage, en, the now TKE, is known (computed in 566 !! the tke_tke routine). First, the now mixing lenth is 571 !! ** Method : At this stage, en, the now TKE, is known (computed in 572 !! the tke_tke routine). First, the now mixing lenth is 567 573 !! computed from en and the strafification (N^2), then the mixings 568 574 !! coefficients are computed. 569 575 !! - Mixing length : a first evaluation of the mixing lengh 570 576 !! scales is: 571 !! mxl = sqrt(2*en) / N 577 !! mxl = sqrt(2*en) / N 572 578 !! where N is the brunt-vaisala frequency, with a minimum value set 573 579 !! to rmxl_min (rn_mxl0) in the interior (surface) ocean. 574 !! The mixing and dissipative length scale are bound as follow : 580 !! The mixing and dissipative length scale are bound as follow : 575 581 !! nn_mxl=0 : mxl bounded by the distance to surface and bottom. 576 582 !! zmxld = zmxlm = mxl 577 583 !! nn_mxl=1 : mxl bounded by the e3w and zmxld = zmxlm = mxl 578 !! nn_mxl=2 : mxl bounded such that the vertical derivative of mxl is 584 !! nn_mxl=2 : mxl bounded such that the vertical derivative of mxl is 579 585 !! less than 1 (|d/dz(mxl)|<1) and zmxld = zmxlm = mxl 580 586 !! nn_mxl=3 : mxl is bounded from the surface to the bottom usings 581 !! |d/dz(xml)|<1 to obtain lup, and from the bottom to 582 !! the surface to obtain ldown. the resulting length 587 !! |d/dz(xml)|<1 to obtain lup, and from the bottom to 588 !! the surface to obtain ldown. the resulting length 583 589 !! scales are: 584 !! zmxld = sqrt( lup * ldown ) 590 !! zmxld = sqrt( lup * ldown ) 585 591 !! zmxlm = min ( lup , ldown ) 586 592 !! - Vertical eddy viscosity and diffusivity: 587 593 !! avm = max( avtb, rn_ediff * zmxlm * en^1/2 ) 588 !! avt = max( avmb, pdlr * avm ) 594 !! avt = max( avmb, pdlr * avm ) 589 595 !! with pdlr=1 if nn_pdl=0, pdlr=1/pdl=F(Ri) otherwise. 590 596 !! … … 601 607 IF( nn_timing == 1 ) CALL timing_start('tke_avn') 602 608 603 CALL wrk_alloc( jpi,jpj,jpk, zmpdl, zmxlm, zmxld ) 609 CALL wrk_alloc( jpi,jpj,jpk, zmpdl, zmxlm, zmxld ) 604 610 605 611 ! !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< … … 610 616 ! 611 617 ! initialisation of interior minimum value (avoid a 2d loop with mikt) 612 zmxlm(:,:,:) = rmxl_min 618 zmxlm(:,:,:) = rmxl_min 613 619 zmxld(:,:,:) = rmxl_min 614 620 ! … … 620 626 END DO 621 627 END DO 622 ELSE 628 ELSE 623 629 zmxlm(:,:,1) = rn_mxl0 624 630 ENDIF … … 638 644 ! !* Physical limits for the mixing length 639 645 ! 640 zmxld(:,:,1 ) = zmxlm(:,:,1) ! surface set to the minimum value 646 zmxld(:,:,1 ) = zmxlm(:,:,1) ! surface set to the minimum value 641 647 zmxld(:,:,jpk) = rmxl_min ! last level set to the minimum value 642 648 ! … … 738 744 END DO 739 745 END DO 746 #if defined key_traldf_c2d || key_traldf_c3d 740 747 IF( ln_stopack) THEN 741 748 IF(nn_spp_avt > 0 ) CALL spp_gen( 1, avt(:,:,jk), nn_spp_avt, rn_avt_sd, jk_spp_avt, jk) 742 749 IF(nn_spp_avm > 0 ) CALL spp_gen( 1, avm(:,:,jk), nn_spp_avm, rn_avm_sd, jk_spp_avm, jk) 743 750 ENDIF 751 #else 752 IF ( ln_stopack ) & 753 & CALL ctl_stop( 'tke_avn: parameter perturbation will only work with '// & 754 'key_traldf_c2d or key_traldf_c3d') 755 #endif 744 756 END DO 745 757 CALL lbc_lnk( avm, 'W', 1. ) ! Lateral boundary conditions (sign unchanged) … … 787 799 ENDIF 788 800 ! 789 CALL wrk_dealloc( jpi,jpj,jpk, zmpdl, zmxlm, zmxld ) 801 CALL wrk_dealloc( jpi,jpj,jpk, zmpdl, zmxlm, zmxld ) 790 802 ! 791 803 IF( nn_timing == 1 ) CALL timing_stop('tke_avn') … … 797 809 !!---------------------------------------------------------------------- 798 810 !! *** ROUTINE zdf_tke_init *** 799 !! 800 !! ** Purpose : Initialization of the vertical eddy diffivity and 811 !! 812 !! ** Purpose : Initialization of the vertical eddy diffivity and 801 813 !! viscosity when using a tke turbulent closure scheme 802 814 !! … … 814 826 & rn_emin0, rn_bshear, nn_mxl , ln_mxl0 , & 815 827 & rn_mxl0 , nn_pdl , ln_lc , rn_lc , & 816 & nn_etau , nn_htau , rn_efr , rn_c 828 & nn_etau , nn_htau , rn_efr , rn_c 817 829 !!---------------------------------------------------------------------- 818 830 … … 884 896 ALLOCATE( rn_ebb0 (jpi,jpj) ) ; rn_ebb0 = rn_ebb 885 897 ALLOCATE( rn_efr0 (jpi,jpj) ) ; rn_efr0 = rn_efr 886 898 887 899 IF( nn_etau == 2 ) THEN 888 900 ierr = zdf_mxl_alloc() … … 896 908 897 909 ! !* depth of penetration of surface tke 898 IF( nn_etau /= 0 ) THEN 910 IF( nn_etau /= 0 ) THEN 899 911 htau(:,:) = 0._wp 900 912 SELECT CASE( nn_htau ) ! Choice of the depth of penetration … … 902 914 htau(:,:) = 10._wp 903 915 CASE( 1 ) ! F(latitude) : 0.5m to 30m poleward of 40 degrees 904 htau(:,:) = MAX( 0.5_wp, MIN( 30._wp, 45._wp* ABS( SIN( rpi/180._wp * gphit(:,:) ) ) ) ) 916 htau(:,:) = MAX( 0.5_wp, MIN( 30._wp, 45._wp* ABS( SIN( rpi/180._wp * gphit(:,:) ) ) ) ) 905 917 CASE( 2 ) ! fraction of depth-integrated TKE within mixed-layer 906 918 rhtau = -1._wp / LOG( 1._wp - rn_c ) … … 945 957 END DO 946 958 dissl(:,:,:) = 1.e-12_wp 947 ! 959 ! 948 960 CALL tke_rst( nit000, 'READ' ) !* read or initialize all required files 949 961 ! … … 954 966 !!--------------------------------------------------------------------- 955 967 !! *** ROUTINE tke_rst *** 956 !! 968 !! 957 969 !! ** Purpose : Read or write TKE file (en) in restart file 958 970 !! 959 971 !! ** Method : use of IOM library 960 !! if the restart does not contain TKE, en is either 961 !! set to rn_emin or recomputed 972 !! if the restart does not contain TKE, en is either 973 !! set to rn_emin or recomputed 962 974 !!---------------------------------------------------------------------- 963 975 INTEGER , INTENT(in) :: kt ! ocean time-step … … 968 980 !!---------------------------------------------------------------------- 969 981 ! 970 IF( TRIM(cdrw) == 'READ' ) THEN ! Read/initialise 982 IF( TRIM(cdrw) == 'READ' ) THEN ! Read/initialise 971 983 ! ! --------------- 972 984 IF( ln_rstart ) THEN !* Read the restart file … … 1006 1018 avmu_k(:,:,:) = avmu(:,:,:) 1007 1019 avmv_k(:,:,:) = avmv(:,:,:) 1008 1020 1009 1021 ELSEIF( TRIM(cdrw) == 'WRITE' ) THEN ! Create restart file 1010 1022 ! ! -------------------
Note: See TracChangeset
for help on using the changeset viewer.