Changeset 2528 for trunk/NEMOGCM/NEMO/OPA_SRC/DYN/divcur.F90
- Timestamp:
- 2010-12-27T18:33:53+01:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/NEMOGCM/NEMO/OPA_SRC/DYN/divcur.F90
- Property svn:eol-style deleted
r1792 r2528 4 4 !! Ocean diagnostic variable : horizontal divergence and relative vorticity 5 5 !!============================================================================== 6 !! History : OPA ! 1987-06 (P. Andrich, D. L Hostis) Original code 7 !! 4.0 ! 1991-11 (G. Madec) 8 !! 6.0 ! 1993-03 (M. Guyon) symetrical conditions 9 !! 7.0 ! 1996-01 (G. Madec) s-coordinates 10 !! 8.0 ! 1997-06 (G. Madec) lateral boundary cond., lbc 11 !! 8.1 ! 1997-08 (J.M. Molines) Open boundaries 12 !! 8.2 ! 2000-03 (G. Madec) no slip accurate 13 !! NEMO 1.0 ! 2002-09 (G. Madec, E. Durand) Free form, F90 14 !! - ! 2005-01 (J. Chanut) Unstructured open boundaries 15 !! - ! 2003-08 (G. Madec) merged of cur and div, free form, F90 16 !! - ! 2005-01 (J. Chanut, A. Sellar) unstructured open boundaries 17 !! 3.3 ! 2010-09 (D.Storkey and E.O'Dea) bug fixes for BDY module 18 !! - ! 2010-10 (R. Furner, G. Madec) runoff and cla added directly here 19 !!---------------------------------------------------------------------- 6 20 7 21 !!---------------------------------------------------------------------- … … 9 23 !! vorticity fields 10 24 !!---------------------------------------------------------------------- 11 !! * Modules used12 25 USE oce ! ocean dynamics and tracers 13 26 USE dom_oce ! ocean space and time domain 27 USE sbc_oce, ONLY : ln_rnf ! surface boundary condition: ocean 28 USE sbcrnf ! river runoff 29 USE obc_oce ! ocean lateral open boundary condition 30 USE cla ! cross land advection (cla_div routine) 14 31 USE in_out_manager ! I/O manager 15 USE obc_oce ! ocean lateral open boundary condition16 USE bdy_oce ! Unstructured open boundaries variables17 32 USE lbclnk ! ocean lateral boundary conditions (or mpp link) 18 33 … … 20 35 PRIVATE 21 36 22 !! * Accessibility 23 PUBLIC div_cur ! routine called by step.F90 and istate.F90 37 PUBLIC div_cur ! routine called by step.F90 and istate.F90 24 38 25 39 !! * Substitutions … … 27 41 # include "vectopt_loop_substitute.h90" 28 42 !!---------------------------------------------------------------------- 29 !! OPA 9.0 , LOCEAN-IPSL (2005)43 !! NEMO/OPA 3.3 , NEMO Consortium (2010) 30 44 !! $Id$ 31 !! This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt 32 !!---------------------------------------------------------------------- 33 45 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 46 !!---------------------------------------------------------------------- 34 47 CONTAINS 35 48 … … 47 60 !! vorticity at before and now time-step 48 61 !! 49 !! ** Method : 50 !! I. divergence : 62 !! ** Method : I. divergence : 51 63 !! - save the divergence computed at the previous time-step 52 64 !! (note that the Asselin filter has not been applied on hdivb) 53 65 !! - compute the now divergence given by : 54 66 !! hdivn = 1/(e1t*e2t*e3t) ( di[e2u*e3u un] + dj[e1v*e3v vn] ) 55 !! Note: if lk_zco=T, e3u=e3v=e3t, they are simplified in the 56 !! above expression 57 !! - apply lateral boundary conditions on hdivn 58 !! II. vorticity : 67 !! correct hdiv with runoff inflow (div_rnf) and cross land flow (div_cla) 68 !! II. vorticity : 59 69 !! - save the curl computed at the previous time-step 60 70 !! rotb = rotn … … 62 72 !! - compute the now curl in tensorial formalism: 63 73 !! rotn = 1/(e1f*e2f) ( di[e2v vn] - dj[e1u un] ) 64 !! - apply lateral boundary conditions on rotn through a call65 !! of lbc_lnk routine.66 74 !! - Coastal boundary condition: 'key_noslip_accurate' defined, 67 75 !! the no-slip boundary condition is computed using Schchepetkin … … 69 77 !! For example, along east coast, the one-sided finite difference 70 78 !! approximation used for di[v] is: 71 !! di[e2v vn] = 1/(e1f*e2f) 72 !! * ( (e2v vn)(i) + (e2v vn)(i-1) + (e2v vn)(i-2) ) 79 !! di[e2v vn] = 1/(e1f*e2f) * ( (e2v vn)(i) + (e2v vn)(i-1) + (e2v vn)(i-2) ) 73 80 !! 74 81 !! ** Action : - update hdivb, hdivn, the before & now hor. divergence 75 82 !! - update rotb , rotn , the before & now rel. vorticity 76 !! 77 !! History : 78 !! 8.2 ! 00-03 (G. Madec) no slip accurate 79 !! 9.0 ! 03-08 (G. Madec) merged of cur and div, free form, F90 80 !! ! 05-01 (J. Chanut, A. Sellar) unstructured open boundaries 81 !!---------------------------------------------------------------------- 82 !! * Arguments 83 !!---------------------------------------------------------------------- 83 84 INTEGER, INTENT( in ) :: kt ! ocean time-step index 84 85 !! * Local declarations 85 ! 86 86 INTEGER :: ji, jj, jk ! dummy loop indices 87 87 INTEGER :: ii, ij, jl ! temporary integer 88 88 INTEGER :: ijt, iju ! temporary integer 89 REAL(wp) :: zraur, zdep 89 90 REAL(wp), DIMENSION( jpi ,1:jpj+2) :: zwu ! workspace 90 91 REAL(wp), DIMENSION(-1:jpi+2, jpj ) :: zwv ! workspace … … 100 101 DO jk = 1, jpkm1 ! Horizontal slab 101 102 ! ! =============== 102 103 ! 103 104 hdivb(:,:,jk) = hdivn(:,:,jk) ! time swap of div arrays 104 105 rotb (:,:,jk) = rotn (:,:,jk) ! time swap of rot arrays 105 106 ! 106 107 ! ! -------- 107 108 ! Horizontal divergence ! div … … 109 110 DO jj = 2, jpjm1 110 111 DO ji = fs_2, fs_jpim1 ! vector opt. 111 #if defined key_zco112 hdivn(ji,jj,jk) = ( e2u(ji,jj) * un(ji,jj,jk) - e2u(ji-1,jj ) * un(ji-1,jj ,jk) &113 & + e1v(ji,jj) * vn(ji,jj,jk) - e1v(ji ,jj-1) * vn(ji ,jj-1,jk) ) &114 & / ( e1t(ji,jj) * e2t(ji,jj) )115 #else116 112 hdivn(ji,jj,jk) = & 117 113 ( e2u(ji,jj)*fse3u(ji,jj,jk) * un(ji,jj,jk) - e2u(ji-1,jj )*fse3u(ji-1,jj ,jk) * un(ji-1,jj ,jk) & 118 114 + e1v(ji,jj)*fse3v(ji,jj,jk) * vn(ji,jj,jk) - e1v(ji ,jj-1)*fse3v(ji ,jj-1,jk) * vn(ji ,jj-1,jk) ) & 119 115 / ( e1t(ji,jj) * e2t(ji,jj) * fse3t(ji,jj,jk) ) 120 #endif121 116 END DO 122 117 END DO … … 131 126 IF( lp_obc_south ) hdivn(nis0 :nis1 ,njs0 :njs1 ,jk) = 0.e0 ! south 132 127 ENDIF 133 #endif134 #if defined key_bdy135 ! unstructured open boundaries (div must be zero behind the open boundary)136 DO jj = 1, jpj137 DO ji = 1, jpi138 hdivn(ji,jj,jk)=hdivn(ji,jj,jk)*bdytmask(ji,jj)139 END DO140 END DO141 128 #endif 142 129 IF( .NOT. AGRIF_Root() ) THEN … … 210 197 DO ji = 1, fs_jpim1 ! vector opt. 211 198 rotn(ji,jj,jk) = ( zwv(ji+1,jj ) - zwv(ji,jj) & 212 - zwu(ji ,jj+1) + zwu(ji,jj) ) & 213 * fmask(ji,jj,jk) / ( e1f(ji,jj)*e2f(ji,jj) ) 199 & - zwu(ji ,jj+1) + zwu(ji,jj) ) * fmask(ji,jj,jk) / ( e1f(ji,jj)*e2f(ji,jj) ) 214 200 END DO 215 201 END DO … … 240 226 * ( -4. * zwu(ii,ij) + zwu(ii,ij-1) - 0.2 * zwu(ii,ij-2) ) 241 227 END DO 242 243 228 ! ! =============== 244 229 END DO ! End of slab 245 230 ! ! =============== 231 232 IF( ln_rnf ) CALL sbc_rnf_div( hdivn ) ! runoffs (update hdivn field) 233 IF( nn_cla == 1 ) CALL cla_div ( kt ) ! Cross Land Advection (Update Hor. divergence) 246 234 247 235 ! 4. Lateral boundary conditions on hdivn and rotn 248 236 ! ---------------------------------=======---====== 249 CALL lbc_lnk( hdivn, 'T', 1. ) ! T-point, no sign change 250 CALL lbc_lnk( rotn , 'F', 1. ) ! F-point, no sign change 251 237 CALL lbc_lnk( hdivn, 'T', 1. ) ; CALL lbc_lnk( rotn , 'F', 1. ) ! lateral boundary cond. (no sign change) 238 ! 252 239 END SUBROUTINE div_cur 253 240 … … 269 256 !! - compute the now divergence given by : 270 257 !! hdivn = 1/(e1t*e2t*e3t) ( di[e2u*e3u un] + dj[e1v*e3v vn] ) 271 !! Note: if lk_zco=T, e3u=e3v=e3t, they are simplified in the 272 !! above expression 273 !! - apply lateral boundary conditions on hdivn 258 !! correct hdiv with runoff inflow (div_rnf) and cross land flow (div_cla) 274 259 !! - Relavtive Vorticity : 275 260 !! - save the curl computed at the previous time-step (rotb = rotn) … … 277 262 !! - compute the now curl in tensorial formalism: 278 263 !! rotn = 1/(e1f*e2f) ( di[e2v vn] - dj[e1u un] ) 279 !! - apply lateral boundary conditions on rotn through a call to280 !! routine lbc_lnk routine.281 264 !! Note: Coastal boundary condition: lateral friction set through 282 265 !! the value of fmask along the coast (see dommsk.F90) and shlat … … 285 268 !! ** Action : - update hdivb, hdivn, the before & now hor. divergence 286 269 !! - update rotb , rotn , the before & now rel. vorticity 287 !! 288 !! History : 289 !! 1.0 ! 87-06 (P. Andrich, D. L Hostis) Original code 290 !! 4.0 ! 91-11 (G. Madec) 291 !! 6.0 ! 93-03 (M. Guyon) symetrical conditions 292 !! 7.0 ! 96-01 (G. Madec) s-coordinates 293 !! 8.0 ! 97-06 (G. Madec) lateral boundary cond., lbc 294 !! 8.1 ! 97-08 (J.M. Molines) Open boundaries 295 !! 9.0 ! 02-09 (G. Madec, E. Durand) Free form, F90 296 !! ! 05-01 (J. Chanut) Unstructured open boundaries 297 !!---------------------------------------------------------------------- 298 !! * Arguments 270 !!---------------------------------------------------------------------- 299 271 INTEGER, INTENT( in ) :: kt ! ocean time-step index 300 301 !! * Local declarations 272 ! 302 273 INTEGER :: ji, jj, jk ! dummy loop indices 274 REAL(wp) :: zraur, zdep 303 275 !!---------------------------------------------------------------------- 304 276 … … 312 284 DO jk = 1, jpkm1 ! Horizontal slab 313 285 ! ! =============== 314 286 ! 315 287 hdivb(:,:,jk) = hdivn(:,:,jk) ! time swap of div arrays 316 288 rotb (:,:,jk) = rotn (:,:,jk) ! time swap of rot arrays 317 289 ! 318 290 ! ! -------- 319 291 ! Horizontal divergence ! div … … 321 293 DO jj = 2, jpjm1 322 294 DO ji = fs_2, fs_jpim1 ! vector opt. 323 #if defined key_zco324 hdivn(ji,jj,jk) = ( e2u(ji,jj) * un(ji,jj,jk) - e2u(ji-1,jj ) * un(ji-1,jj ,jk) &325 & + e1v(ji,jj) * vn(ji,jj,jk) - e1v(ji ,jj-1) * vn(ji ,jj-1,jk) ) &326 / ( e1t(ji,jj) * e2t(ji,jj) )327 #else328 295 hdivn(ji,jj,jk) = & 329 ( e2u(ji,jj)*fse3u(ji,jj,jk) * un(ji,jj,jk) - e2u(ji-1,jj )*fse3u(ji-1,jj ,jk) * un(ji-1,jj,jk) &330 + e1v(ji,jj)*fse3v(ji,jj,jk) * vn(ji,jj,jk) - e1v(ji ,jj-1)*fse3v(ji ,jj-1,jk) * vn(ji,jj-1,jk) ) &296 ( e2u(ji,jj)*fse3u(ji,jj,jk) * un(ji,jj,jk) - e2u(ji-1,jj)*fse3u(ji-1,jj,jk) * un(ji-1,jj,jk) & 297 + e1v(ji,jj)*fse3v(ji,jj,jk) * vn(ji,jj,jk) - e1v(ji,jj-1)*fse3v(ji,jj-1,jk) * vn(ji,jj-1,jk) ) & 331 298 / ( e1t(ji,jj) * e2t(ji,jj) * fse3t(ji,jj,jk) ) 332 #endif333 299 END DO 334 300 END DO … … 344 310 ENDIF 345 311 #endif 346 #if defined key_bdy347 ! unstructured open boundaries (div must be zero behind the open boundary)348 DO jj = 1, jpj349 DO ji = 1, jpi350 hdivn(ji,jj,jk)=hdivn(ji,jj,jk)*bdytmask(ji,jj)351 END DO352 END DO353 #endif354 312 IF( .NOT. AGRIF_Root() ) THEN 355 313 IF ((nbondi == 1).OR.(nbondi == 2)) hdivn(nlci-1 , : ,jk) = 0.e0 ! east … … 372 330 END DO ! End of slab 373 331 ! ! =============== 374 332 333 IF( ln_rnf ) CALL sbc_rnf_div( hdivn ) ! runoffs (update hdivn field) 334 IF( nn_cla == 1 ) CALL cla_div ( kt ) ! Cross Land Advection (update hdivn field) 335 375 336 ! 4. Lateral boundary conditions on hdivn and rotn 376 337 ! ---------------------------------=======---====== 377 CALL lbc_lnk( hdivn, 'T', 1. ) ! T-point, no sign change 378 CALL lbc_lnk( rotn , 'F', 1. ) ! F-point, no sign change 379 338 CALL lbc_lnk( hdivn, 'T', 1. ) ; CALL lbc_lnk( rotn , 'F', 1. ) ! lateral boundary cond. (no sign change) 339 ! 380 340 END SUBROUTINE div_cur 381 341
Note: See TracChangeset
for help on using the changeset viewer.