- Timestamp:
- 2010-09-17T14:35:46+02:00 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DEV_r2006_merge_TRA_TRC/NEMO/OPA_SRC/TRA/traldf_bilap.F90
r2082 r2104 4 4 !! Ocean tracers: horizontal component of the lateral tracer mixing trend 5 5 !!============================================================================== 6 !! History : !91-11 (G. Madec) Original code7 !! !93-03 (M. Guyon) symetrical conditions8 !! !95-11 (G. Madec) suppress volumetric scale factors9 !! !96-01 (G. Madec) statement function for e310 !! !96-01 (M. Imbard) mpp exchange11 !! !97-07 (G. Madec) optimization, and ahtt12 !! 8.5 !02-08 (G. Madec) F90: Free form and module13 !! 9.0 !04-08 (C. Talandier) New trends organization14 !! !05-11 (G. Madec) zps or sco as default option15 !! 3.3 !10-05 (C. Ethe, G. Madec) merge TRC-TRA6 !! History : OPA ! 1991-11 (G. Madec) Original code 7 !! ! 1993-03 (M. Guyon) symetrical conditions 8 !! ! 1995-11 (G. Madec) suppress volumetric scale factors 9 !! ! 1996-01 (G. Madec) statement function for e3 10 !! ! 1996-01 (M. Imbard) mpp exchange 11 !! ! 1997-07 (G. Madec) optimization, and ahtt 12 !! 8.5 ! 2002-08 (G. Madec) F90: Free form and module 13 !! NEMO 1.0 ! 2004-08 (C. Talandier) New trends organization 14 !! - ! 2005-11 (G. Madec) zps or sco as default option 15 !! 3.3 ! 2010-05 (C. Ethe, G. Madec) merge TRC-TRA 16 16 !!============================================================================== 17 17 … … 20 20 !! using a iso-level biharmonic operator 21 21 !!---------------------------------------------------------------------- 22 !! * Modules used23 22 USE oce ! ocean dynamics and active tracers 24 23 USE dom_oce ! ocean space and time domain … … 33 32 PRIVATE 34 33 35 !! * Routine accessibility 36 PUBLIC tra_ldf_bilap ! routine called by step.F90 34 PUBLIC tra_ldf_bilap ! routine called by step.F90 37 35 38 36 !! * Substitutions … … 43 41 !!---------------------------------------------------------------------- 44 42 !! NEMO/OPA 3.3 , LOCEAN-IPSL (2010) 45 !! $Id$ 46 !! This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt43 !! $Id$ 44 !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 47 45 !!---------------------------------------------------------------------- 48 46 … … 80 78 USE oce , ztv => va ! use va as workspace 81 79 !! 82 INTEGER , INTENT(in ) :: kt! ocean time-step index83 CHARACTER(len=3) , INTENT(in ) :: cdtype! =TRA or TRC (tracer indicator)84 INTEGER , INTENT(in ) :: kjpt! number of tracers85 REAL(wp) , INTENT(in ), DIMENSION(jpi,jpj,kjpt ) :: pgu, pgv! tracer gradient at pstep levels86 REAL(wp) , INTENT(in ), DIMENSION(jpi,jpj,jpk,kjpt) :: ptb! before and now tracer fields87 REAL(wp) , INTENT(inout), DIMENSION(jpi,jpj,jpk,kjpt) :: pta! tracer trend80 INTEGER , INTENT(in ) :: kt ! ocean time-step index 81 CHARACTER(len=3) , INTENT(in ) :: cdtype ! =TRA or TRC (tracer indicator) 82 INTEGER , INTENT(in ) :: kjpt ! number of tracers 83 REAL(wp), DIMENSION(jpi,jpj, kjpt), INTENT(in ) :: pgu, pgv ! tracer gradient at pstep levels 84 REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(in ) :: ptb ! before and now tracer fields 85 REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(inout) :: pta ! tracer trend 88 86 !! 89 INTEGER :: ji, jj, jk, jn ! dummy loop indices 90 INTEGER :: iku, ikv ! temporary integers 91 REAL(wp) :: zbtr, ztra ! temporary scalars 92 REAL(wp), DIMENSION(jpi,jpj) :: & 93 zeeu, zeev, zlt ! 2D workspace 87 INTEGER :: ji, jj, jk, jn ! dummy loop indices 88 INTEGER :: iku, ikv ! local integers 89 REAL(wp) :: zbtr, ztra ! local scalars 90 REAL(wp), DIMENSION(jpi,jpj) :: zeeu, zeev, zlt ! 2D workspace 94 91 !!---------------------------------------------------------------------- 95 92 96 IF( ( cdtype == 'TRA' .AND. kt == nit000 ) .OR. ( cdtype == 'TRC' .AND. kt == nittrc000 )) THEN93 IF( kt == nit000 ) THEN 97 94 IF(lwp) WRITE(numout,*) 98 95 IF(lwp) WRITE(numout,*) 'tra_ldf_bilap : iso-level biharmonic operator on ', cdtype … … 103 100 ! ! =========== 104 101 ! 105 DO jk = 1, jpkm1 102 DO jk = 1, jpkm1 ! Horizontal slab 106 103 ! 107 108 ! 0. Initialization of metric arrays (for z- or s-coordinates) 109 ! ---------------------------------- 104 ! !== Initialization of metric arrays (for z- or s-coordinates) ==! 110 105 DO jj = 1, jpjm1 111 106 DO ji = 1, fs_jpim1 ! vector opt. … … 115 110 END DO 116 111 117 118 ! 1. Laplacian 119 ! ------------ 120 121 ! First derivative (gradient) 122 DO jj = 1, jpjm1 112 ! !== Laplacian ==! 113 ! 114 DO jj = 1, jpjm1 ! First derivative (gradient) 123 115 DO ji = 1, fs_jpim1 ! vector opt. 124 116 ztu(ji,jj,jk) = zeeu(ji,jj) * ( ptb(ji+1,jj ,jk,jn) - ptb(ji,jj,jk,jn) ) … … 126 118 END DO 127 119 END DO 128 IF( ln_zps ) THEN ! set gradient at partial step level120 IF( ln_zps ) THEN ! set gradient at partial step level 129 121 DO jj = 1, jpjm1 130 122 DO ji = 1, jpim1 … … 137 129 END DO 138 130 ENDIF 139 140 ! Second derivative (divergence) multiply by the eddy diffusivity coefficient 141 DO jj = 2, jpjm1 131 DO jj = 2, jpjm1 ! Second derivative (divergence) time the eddy diffusivity coefficient 142 132 DO ji = fs_2, fs_jpim1 ! vector opt. 143 133 zbtr = 1.0 / ( e1t(ji,jj) * e2t(ji,jj) * fse3t(ji,jj,jk) ) 144 zlt(ji,jj) = fsahtt(ji,jj,jk) &145 & * zbtr * ( ztu(ji,jj,jk) - ztu(ji-1,jj,jk) + ztv(ji,jj,jk) - ztv(ji,jj-1,jk))134 zlt(ji,jj) = fsahtt(ji,jj,jk) * zbtr * ( ztu(ji,jj,jk) - ztu(ji-1,jj,jk) & 135 & + ztv(ji,jj,jk) - ztv(ji,jj-1,jk) ) 146 136 END DO 147 137 END DO 138 CALL lbc_lnk( zlt, 'T', 1. ) ! Lateral boundary conditions (unchanged sgn) 148 139 149 ! Lateral boundary conditions on the laplacian (zlt) (unchanged sgn) 150 CALL lbc_lnk( zlt, 'T', 1. ) 151 152 ! 2. Bilaplacian 153 ! -------------- 154 155 ! third derivative (gradient) 156 DO jj = 1, jpjm1 140 ! !== Bilaplacian ==! 141 ! 142 DO jj = 1, jpjm1 ! third derivative (gradient) 157 143 DO ji = 1, fs_jpim1 ! vector opt. 158 144 ztu(ji,jj,jk) = zeeu(ji,jj) * ( zlt(ji+1,jj ) - zlt(ji,jj) ) … … 160 146 END DO 161 147 END DO 162 163 ! fourth derivative (divergence) and add to the general tracer trend 164 DO jj = 2, jpjm1 148 DO jj = 2, jpjm1 ! fourth derivative (divergence) and add to the general tracer trend 165 149 DO ji = fs_2, fs_jpim1 ! vector opt. 166 150 ! horizontal diffusive trends … … 171 155 END DO 172 156 END DO 173 ! ! ===============157 ! 174 158 END DO ! Horizontal slab 175 ! ! ===============159 ! 176 160 ! "zonal" mean lateral diffusive heat and salt transport 177 161 IF( cdtype == 'TRA' .AND. ln_diaptr .AND. ( MOD( kt, nf_ptr ) == 0 ) ) THEN … … 179 163 IF( jn == jp_sal ) pst_ldf(:) = ptr_vj( ztv(:,:,:) ) 180 164 ENDIF 181 ! 182 END DO 183 165 ! ! =========== 166 END DO ! tracer loop 167 ! ! =========== 184 168 END SUBROUTINE tra_ldf_bilap 185 169
Note: See TracChangeset
for help on using the changeset viewer.