Changeset 2528 for trunk/NEMOGCM/NEMO/OPA_SRC/LDF/ldfeiv.F90
- Timestamp:
- 2010-12-27T18:33:53+01:00 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/NEMOGCM/NEMO/OPA_SRC/LDF/ldfeiv.F90
- Property svn:eol-style deleted
r1482 r2528 4 4 !! Ocean physics: variable eddy induced velocity coefficients 5 5 !!====================================================================== 6 !! History : OPA ! 1999-03 (G. Madec, A. Jouzeau) Original code 7 !! NEMO 1.0 ! 2002-06 (G. Madec) Free form, F90 8 !!---------------------------------------------------------------------- 6 9 #if defined key_traldf_eiv && defined key_traldf_c2d 7 10 !!---------------------------------------------------------------------- … … 11 14 !! ldf_eiv : compute the eddy induced velocity coefficients 12 15 !!---------------------------------------------------------------------- 13 !! * Modules used14 16 USE oce ! ocean dynamics and tracers 15 17 USE dom_oce ! ocean space and time domain … … 22 24 USE lbclnk ! ocean lateral boundary conditions (or mpp link) 23 25 USE prtctl ! Print control 24 USE iom 26 USE iom ! I/O library 25 27 26 28 IMPLICIT NONE 27 29 PRIVATE 28 30 29 !! * Routine accessibility 30 PUBLIC ldf_eiv ! routine called by step.F90 31 !!---------------------------------------------------------------------- 32 !! OPA 9.0 , LOCEAN-IPSL (2005) 33 !! $Id$ 34 !! This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt 35 !!---------------------------------------------------------------------- 31 PUBLIC ldf_eiv ! routine called by step.F90 32 36 33 !! * Substitutions 37 34 # include "domzgr_substitute.h90" 38 35 # include "vectopt_loop_substitute.h90" 39 36 !!---------------------------------------------------------------------- 40 37 !! NEMO/OPA 3.3 , NEMO Consortium (2010) 38 !! $Id$ 39 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 40 !!---------------------------------------------------------------------- 41 41 CONTAINS 42 42 … … 46 46 !! 47 47 !! ** Purpose : Compute the eddy induced velocity coefficient from the 48 !! growth rate of baroclinic instability.48 !! growth rate of baroclinic instability. 49 49 !! 50 50 !! ** Method : 51 51 !! 52 !! ** Action : - uslp(), : i- and j-slopes of neutral surfaces 53 !! - vslp() at u- and v-points, resp. 54 !! - wslpi(), : i- and j-slopes of neutral surfaces 55 !! - wslpj() at w-points. 56 !! 57 !! History : 58 !! 8.1 ! 99-03 (G. Madec, A. Jouzeau) Original code 59 !! 8.5 ! 02-06 (G. Madec) Free form, F90 52 !! ** Action : - uslp , vslp : i- and j-slopes of neutral surfaces at u- & v-points 53 !! - wslpi, wslpj : i- and j-slopes of neutral surfaces at w-points. 60 54 !!---------------------------------------------------------------------- 61 !! * Arguments 62 INTEGER, INTENT( in ) :: kt ! ocean time-step inedx 63 64 !! * Local declarations 65 INTEGER :: ji, jj, jk ! dummy loop indices 66 REAL(wp) :: & 67 zfw, ze3w, zn2, zf20, & ! temporary scalars 68 zaht, zaht_min 69 REAL(wp), DIMENSION(jpi,jpj) :: & 70 zn, zah, zhw, zross ! workspace 55 INTEGER, INTENT(in) :: kt ! ocean time-step inedx 56 !! 57 INTEGER :: ji, jj, jk ! dummy loop indices 58 REAL(wp) :: zfw, ze3w, zn2, zf20, zaht, zaht_min ! temporary scalars 59 REAL(wp), DIMENSION(jpi,jpj) :: zn, zah, zhw, zross ! 2D workspace 71 60 !!---------------------------------------------------------------------- 72 61 … … 79 68 ! 0. Local initialization 80 69 ! ----------------------- 81 zn (:,:) = 0. e082 zhw (:,:) = 5. e083 zah (:,:) = 0. e084 zross(:,:) = 0. e070 zn (:,:) = 0._wp 71 zhw (:,:) = 5._wp 72 zah (:,:) = 0._wp 73 zross(:,:) = 0._wp 85 74 86 75 87 76 ! 1. Compute lateral diffusive coefficient 88 77 ! ---------------------------------------- 89 90 DO jk = 1, jpk78 IF( ln_traldf_grif ) THEN 79 DO jk = 1, jpk 91 80 # if defined key_vectopt_loop 92 81 !CDIR NOVERRCHK 93 DO ji = 1, jpij ! vector opt. 94 ! Take the max of N^2 and zero then take the vertical sum 95 ! of the square root of the resulting N^2 ( required to compute 96 ! internal Rossby radius Ro = .5 * sum_jpk(N) / f 97 zn2 = MAX( rn2b(ji,1,jk), 0.e0 ) 98 zn(ji,1) = zn(ji,1) + SQRT( zn2 ) * fse3w(ji,1,jk) 99 ! Compute elements required for the inverse time scale of baroclinic 100 ! eddies using the isopycnal slopes calculated in ldfslp.F : 101 ! T^-1 = sqrt(m_jpk(N^2*(r1^2+r2^2)*e3w)) 102 ze3w = fse3w(ji,1,jk) * tmask(ji,1,jk) 103 zah(ji,1) = zah(ji,1) + zn2 & 104 * ( wslpi(ji,1,jk) * wslpi(ji,1,jk) & 105 + wslpj(ji,1,jk) * wslpj(ji,1,jk) ) & 106 * ze3w 107 zhw(ji,1) = zhw(ji,1) + ze3w 108 END DO 82 DO ji = 1, jpij ! vector opt. 83 ! Take the max of N^2 and zero then take the vertical sum 84 ! of the square root of the resulting N^2 ( required to compute 85 ! internal Rossby radius Ro = .5 * sum_jpk(N) / f 86 zn2 = MAX( rn2b(ji,1,jk), 0._wp ) 87 zn(ji,1) = zn(ji,1) + SQRT( zn2 ) * fse3w(ji,1,jk) 88 ! Compute elements required for the inverse time scale of baroclinic 89 ! eddies using the isopycnal slopes calculated in ldfslp.F : 90 ! T^-1 = sqrt(m_jpk(N^2*(r1^2+r2^2)*e3w)) 91 ze3w = fse3w(ji,1,jk) * tmask(ji,1,jk) 92 zah(ji,1) = zah(ji,1) + zn2 * wslp2(ji,1,jk) * ze3w 93 zhw(ji,1) = zhw(ji,1) + ze3w 94 END DO 109 95 # else 110 DO jj = 2, jpjm1 111 !CDIR NOVERRCHK 112 DO ji = 2, jpim1 113 ! Take the max of N^2 and zero then take the vertical sum 114 ! of the square root of the resulting N^2 ( required to compute 115 ! internal Rossby radius Ro = .5 * sum_jpk(N) / f 116 zn2 = MAX( rn2b(ji,jj,jk), 0.e0 ) 117 zn(ji,jj) = zn(ji,jj) + SQRT( zn2 ) * fse3w(ji,jj,jk) 96 DO jj = 2, jpjm1 97 !CDIR NOVERRCHK 98 DO ji = 2, jpim1 99 ! Take the max of N^2 and zero then take the vertical sum 100 ! of the square root of the resulting N^2 ( required to compute 101 ! internal Rossby radius Ro = .5 * sum_jpk(N) / f 102 zn2 = MAX( rn2b(ji,jj,jk), 0._wp ) 103 zn(ji,jj) = zn(ji,jj) + SQRT( zn2 ) * fse3w(ji,jj,jk) 104 ! Compute elements required for the inverse time scale of baroclinic 105 ! eddies using the isopycnal slopes calculated in ldfslp.F : 106 ! T^-1 = sqrt(m_jpk(N^2*(r1^2+r2^2)*e3w)) 107 ze3w = fse3w(ji,jj,jk) * tmask(ji,jj,jk) 108 zah(ji,jj) = zah(ji,jj) + zn2 * wslp2(ji,jj,jk) * ze3w 109 zhw(ji,jj) = zhw(ji,jj) + ze3w 110 END DO 111 END DO 112 # endif 113 END DO 114 ELSE 115 DO jk = 1, jpk 116 # if defined key_vectopt_loop 117 !CDIR NOVERRCHK 118 DO ji = 1, jpij ! vector opt. 119 ! Take the max of N^2 and zero then take the vertical sum 120 ! of the square root of the resulting N^2 ( required to compute 121 ! internal Rossby radius Ro = .5 * sum_jpk(N) / f 122 zn2 = MAX( rn2b(ji,1,jk), 0._wp ) 123 zn(ji,1) = zn(ji,1) + SQRT( zn2 ) * fse3w(ji,1,jk) 118 124 ! Compute elements required for the inverse time scale of baroclinic 119 ! eddies using the isopycnal slopes calculated in ldfslp.F : 125 ! eddies using the isopycnal slopes calculated in ldfslp.F : 120 126 ! T^-1 = sqrt(m_jpk(N^2*(r1^2+r2^2)*e3w)) 121 ze3w = fse3w(ji,jj,jk) * tmask(ji,jj,jk) 122 zah(ji,jj) = zah(ji,jj) + zn2 & 123 * ( wslpi(ji,jj,jk) * wslpi(ji,jj,jk) & 124 + wslpj(ji,jj,jk) * wslpj(ji,jj,jk) ) & 125 * ze3w 126 zhw(ji,jj) = zhw(ji,jj) + ze3w 127 END DO 128 END DO 127 ze3w = fse3w(ji,1,jk) * tmask(ji,1,jk) 128 zah(ji,1) = zah(ji,1) + zn2 * ( wslpi(ji,1,jk) * wslpi(ji,1,jk) & 129 & + wslpj(ji,1,jk) * wslpj(ji,1,jk) ) * ze3w 130 zhw(ji,1) = zhw(ji,1) + ze3w 131 END DO 132 # else 133 DO jj = 2, jpjm1 134 !CDIR NOVERRCHK 135 DO ji = 2, jpim1 136 ! Take the max of N^2 and zero then take the vertical sum 137 ! of the square root of the resulting N^2 ( required to compute 138 ! internal Rossby radius Ro = .5 * sum_jpk(N) / f 139 zn2 = MAX( rn2b(ji,jj,jk), 0._wp ) 140 zn(ji,jj) = zn(ji,jj) + SQRT( zn2 ) * fse3w(ji,jj,jk) 141 ! Compute elements required for the inverse time scale of baroclinic 142 ! eddies using the isopycnal slopes calculated in ldfslp.F : 143 ! T^-1 = sqrt(m_jpk(N^2*(r1^2+r2^2)*e3w)) 144 ze3w = fse3w(ji,jj,jk) * tmask(ji,jj,jk) 145 zah(ji,jj) = zah(ji,jj) + zn2 * ( wslpi(ji,jj,jk) * wslpi(ji,jj,jk) & 146 & + wslpj(ji,jj,jk) * wslpj(ji,jj,jk) ) * ze3w 147 zhw(ji,jj) = zhw(ji,jj) + ze3w 148 END DO 149 END DO 129 150 # endif 130 END DO 151 END DO 152 END IF 131 153 132 154 DO jj = 2, jpjm1 … … 141 163 END DO 142 164 143 IF( cp_cfg == "orca" .AND. jp_cfg == 2 ) THEN ! ORCA R 02165 IF( cp_cfg == "orca" .AND. jp_cfg == 2 ) THEN ! ORCA R2 144 166 DO jj = 2, jpjm1 145 167 !CDIR NOVERRCHK 146 168 DO ji = fs_2, fs_jpim1 ! vector opt. 147 ! Take the minimum between aeiw and aeiv0 for depth levels 148 ! lower than 20 (21 in w- point) 149 IF( mbathy(ji,jj) <= 21. ) aeiw(ji,jj) = MIN( aeiw(ji,jj), 1000. ) 169 ! Take the minimum between aeiw and 1000 m2/s over shelves (depth shallower than 650 m) 170 IF( mbkt(ji,jj) <= 20 ) aeiw(ji,jj) = MIN( aeiw(ji,jj), 1000. ) 150 171 END DO 151 172 END DO … … 153 174 154 175 ! Decrease the coefficient in the tropics (20N-20S) 155 zf20 = 2. * omega * sin( rad * 20.)176 zf20 = 2._wp * omega * sin( rad * 20._wp ) 156 177 DO jj = 2, jpjm1 157 178 DO ji = fs_2, fs_jpim1 ! vector opt. … … 168 189 END DO 169 190 ENDIF 170 171 ! lateral boundary condition on aeiw 172 CALL lbc_lnk( aeiw, 'W', 1. ) 191 CALL lbc_lnk( aeiw, 'W', 1. ) ! lateral boundary condition on aeiw 192 173 193 174 194 ! Average the diffusive coefficient at u- v- points 175 195 DO jj = 2, jpjm1 176 196 DO ji = fs_2, fs_jpim1 ! vector opt. 177 aeiu(ji,jj) = .5* ( aeiw(ji,jj) + aeiw(ji+1,jj ) )178 aeiv(ji,jj) = .5* ( aeiw(ji,jj) + aeiw(ji ,jj+1) )197 aeiu(ji,jj) = 0.5_wp * ( aeiw(ji,jj) + aeiw(ji+1,jj ) ) 198 aeiv(ji,jj) = 0.5_wp * ( aeiw(ji,jj) + aeiw(ji ,jj+1) ) 179 199 END DO 180 200 END DO 181 182 ! lateral boundary condition on aeiu, aeiv 183 CALL lbc_lnk( aeiu, 'U', 1. ) 184 CALL lbc_lnk( aeiv, 'V', 1. ) 185 186 IF(ln_ctl) THEN 201 CALL lbc_lnk( aeiu, 'U', 1. ) ; CALL lbc_lnk( aeiv, 'V', 1. ) ! lateral boundary condition 202 203 204 IF(ln_ctl) THEN 187 205 CALL prt_ctl(tab2d_1=aeiu, clinfo1=' eiv - u: ', ovlap=1) 188 206 CALL prt_ctl(tab2d_1=aeiv, clinfo1=' eiv - v: ', ovlap=1) … … 191 209 ! ORCA R05: add a space variation on aht (=aeiv except at the equator and river mouth) 192 210 IF( cp_cfg == "orca" .AND. jp_cfg == 05 ) THEN 193 zf20 = 2. * omega * SIN( rad * 20.)194 zaht_min = 100. 211 zf20 = 2._wp * omega * SIN( rad * 20._wp ) 212 zaht_min = 100._wp ! minimum value for aht 195 213 DO jj = 1, jpj 196 214 DO ji = 1, jpi 197 zaht = ( 1. - MIN( 1., ABS( ff(ji,jj) / zf20 ) ) ) * ( aht0 - zaht_min ) &215 zaht = ( 1._wp - MIN( 1._wp , ABS( ff(ji,jj) / zf20 ) ) ) * ( aht0 - zaht_min ) & 198 216 & + aht0 * rnfmsk(ji,jj) ! enhanced near river mouths 199 217 ahtu(ji,jj) = MAX( MAX( zaht_min, aeiu(ji,jj) ) + zaht, aht0 ) … … 209 227 ENDIF 210 228 211 IF( aeiv0 == 0. e0) THEN212 aeiu(:,:) = 0. e0213 aeiv(:,:) = 0. e0214 aeiw(:,:) = 0. e0229 IF( aeiv0 == 0._wp ) THEN 230 aeiu(:,:) = 0._wp 231 aeiv(:,:) = 0._wp 232 aeiw(:,:) = 0._wp 215 233 ENDIF 216 234 217 235 CALL iom_put( "aht2d" , ahtw ) ! lateral eddy diffusivity 218 236 CALL iom_put( "aht2d_eiv", aeiw ) ! EIV lateral eddy diffusivity 219 237 ! 220 238 END SUBROUTINE ldf_eiv 221 239
Note: See TracChangeset
for help on using the changeset viewer.