Changeset 3294 for trunk/NEMOGCM/NEMO/OPA_SRC/DYN/dynzdf_imp.F90
- Timestamp:
- 2012-01-28T17:44:18+01:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/NEMOGCM/NEMO/OPA_SRC/DYN/dynzdf_imp.F90
r2715 r3294 8 8 !! NEMO 0.5 ! 2002-08 (G. Madec) F90: Free form and module 9 9 !! 3.3 ! 2010-04 (M. Leclair, G. Madec) Forcing averaged over 2 time steps 10 !! 3.4 ! 2012-01 (H. Liu) Semi-implicit bottom friction 10 11 !!---------------------------------------------------------------------- 11 12 … … 20 21 USE in_out_manager ! I/O manager 21 22 USE lib_mpp ! MPP library 23 USE zdfbfr ! Bottom friction setup 24 USE wrk_nemo ! Memory Allocation 25 USE timing ! Timing 22 26 23 27 IMPLICIT NONE … … 54 58 !! ** Action : - Update (ua,va) arrays with the after vertical diffusive mixing trend. 55 59 !!--------------------------------------------------------------------- 56 USE wrk_nemo, ONLY: wrk_in_use, wrk_not_released 57 USE oce , ONLY: zwd => ta , zws => sa ! (ta,sa) used as 3D workspace 58 USE wrk_nemo, ONLY: zwi => wrk_3d_3 ! 3D workspace 59 !! 60 INTEGER , INTENT(in) :: kt ! ocean time-step index 60 INTEGER , INTENT(in) :: kt ! ocean time-step index 61 61 REAL(wp), INTENT(in) :: p2dt ! vertical profile of tracer time-step 62 62 !! 63 63 INTEGER :: ji, jj, jk ! dummy loop indices 64 INTEGER :: ikbu, ikbv ! local integers 64 65 REAL(wp) :: z1_p2dt, zcoef, zzwi, zzws, zrhs ! local scalars 65 66 !!---------------------------------------------------------------------- 66 67 67 IF( wrk_in_use(3, 3) ) THEN 68 CALL ctl_stop('dyn_zdf_imp: requested workspace array unavailable') ; RETURN 69 END IF 70 68 REAL(wp), POINTER, DIMENSION(:,:,:) :: zwi, zwd, zws 69 REAL(wp), POINTER, DIMENSION(:,:) :: zavmu, zavmv 70 !!---------------------------------------------------------------------- 71 ! 72 IF( nn_timing == 1 ) CALL timing_start('dyn_zdf_imp') 73 ! 74 CALL wrk_alloc( jpi,jpj,jpk, zwi, zwd, zws ) 75 CALL wrk_alloc( jpi,jpj, zavmu, zavmv ) 76 ! 71 77 IF( kt == nit000 ) THEN 72 78 IF(lwp) WRITE(numout,*) … … 79 85 z1_p2dt = 1._wp / p2dt ! inverse of the timestep 80 86 81 ! 1. Vertical diffusion on u 87 ! 1. Apply semi-implicit bottom friction 88 ! -------------------------------------- 89 ! Only needed for semi-implicit bottom friction setup. The explicit 90 ! bottom friction has been included in "u(v)a" which act as the R.H.S 91 ! column vector of the tri-diagonal matrix equation 92 ! 93 94 IF( ln_bfrimp ) THEN 95 # if defined key_vectopt_loop 96 DO jj = 1, 1 97 DO ji = jpi+2, jpij-jpi-1 ! vector opt. (forced unrolling) 98 # else 99 DO jj = 2, jpjm1 100 DO ji = 2, jpim1 101 # endif 102 ikbu = mbku(ji,jj) ! ocean bottom level at u- and v-points 103 ikbv = mbkv(ji,jj) ! (deepest ocean u- and v-points) 104 zavmu(ji,jj) = avmu(ji,jj,ikbu+1) 105 zavmv(ji,jj) = avmv(ji,jj,ikbv+1) 106 avmu(ji,jj,ikbu+1) = -bfrua(ji,jj) * fse3uw(ji,jj,ikbu+1) 107 avmv(ji,jj,ikbv+1) = -bfrva(ji,jj) * fse3vw(ji,jj,ikbv+1) 108 END DO 109 END DO 110 ENDIF 111 112 ! 2. Vertical diffusion on u 82 113 ! --------------------------- 83 114 ! Matrix and second member construction 84 115 ! bottom boundary condition: both zwi and zws must be masked as avmu can take 85 ! non zero value at the ocean bottom depending on the bottom friction 86 ! used but the bottom velocities have already been updated with the bottom 87 ! friction velocity in dyn_bfr using values from the previous timestep. There 88 ! is no need to include these in the implicit calculation. 116 ! non zero value at the ocean bottom depending on the bottom friction used. 89 117 ! 90 118 DO jk = 1, jpkm1 ! Matrix … … 168 196 169 197 170 ! 2. Vertical diffusion on v198 ! 3. Vertical diffusion on v 171 199 ! --------------------------- 172 200 ! Matrix and second member construction 173 201 ! bottom boundary condition: both zwi and zws must be masked as avmv can take 174 ! non zero value at the ocean bottom depending on the bottom friction 175 ! used but the bottom velocities have already been updated with the bottom 176 ! friction velocity in dyn_bfr using values from the previous timestep. There 177 ! is no need to include these in the implicit calculation. 202 ! non zero value at the ocean bottom depending on the bottom friction used 178 203 ! 179 204 DO jk = 1, jpkm1 ! Matrix … … 255 280 END DO 256 281 END DO 257 ! 258 IF( wrk_not_released(3, 3) ) CALL ctl_stop('dyn_zdf_imp: failed to release workspace array') 282 283 !! restore bottom layer avmu(v) 284 IF( ln_bfrimp ) THEN 285 # if defined key_vectopt_loop 286 DO jj = 1, 1 287 DO ji = jpi+2, jpij-jpi-1 ! vector opt. (forced unrolling) 288 # else 289 DO jj = 2, jpjm1 290 DO ji = 2, jpim1 291 # endif 292 ikbu = mbku(ji,jj) ! ocean bottom level at u- and v-points 293 ikbv = mbkv(ji,jj) ! (deepest ocean u- and v-points) 294 avmu(ji,jj,ikbu+1) = zavmu(ji,jj) 295 avmv(ji,jj,ikbv+1) = zavmv(ji,jj) 296 END DO 297 END DO 298 ENDIF 299 ! 300 CALL wrk_dealloc( jpi,jpj,jpk, zwi, zwd, zws) 301 CALL wrk_dealloc( jpi,jpj, zavmu, zavmv) 302 ! 303 IF( nn_timing == 1 ) CALL timing_stop('dyn_zdf_imp') 259 304 ! 260 305 END SUBROUTINE dyn_zdf_imp
Note: See TracChangeset
for help on using the changeset viewer.