Changeset 14789 for NEMO/branches/2021/dev_r13747_HPC-11_mcastril_HPDAonline_DiagGPU/src/OCE/TRA/trazdf.F90
- Timestamp:
- 2021-05-05T13:18:04+02:00 (3 years ago)
- Location:
- NEMO/branches/2021/dev_r13747_HPC-11_mcastril_HPDAonline_DiagGPU
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
NEMO/branches/2021/dev_r13747_HPC-11_mcastril_HPDAonline_DiagGPU
- Property svn:externals
-
old new 3 3 ^/utils/build/mk@HEAD mk 4 4 ^/utils/tools@HEAD tools 5 ^/vendors/AGRIF/dev _r12970_AGRIF_CMEMSext/AGRIF5 ^/vendors/AGRIF/dev@HEAD ext/AGRIF 6 6 ^/vendors/FCM@HEAD ext/FCM 7 7 ^/vendors/IOIPSL@HEAD ext/IOIPSL 8 ^/vendors/PPR@HEAD ext/PPR 8 9 9 10 # SETTE 10 ^/utils/CI/sette@1 3559sette11 ^/utils/CI/sette@14244 sette
-
- Property svn:externals
-
NEMO/branches/2021/dev_r13747_HPC-11_mcastril_HPDAonline_DiagGPU/src/OCE/TRA/trazdf.F90
r13497 r14789 13 13 !!---------------------------------------------------------------------- 14 14 USE oce ! ocean dynamics and tracers variables 15 USE dom_oce ! ocean space and time domain variables 15 USE dom_oce ! ocean space and time domain variables 16 16 USE domvvl ! variable volume 17 17 USE phycst ! physical constant 18 18 USE zdf_oce ! ocean vertical physics variables 19 USE zdfmfc ! Mass FLux Convection 19 20 USE sbc_oce ! surface boundary condition: ocean 20 21 USE ldftra ! lateral diffusion: eddy diffusivity 21 USE ldfslp ! lateral diffusion: iso-neutral slope 22 USE ldfslp ! lateral diffusion: iso-neutral slope 22 23 USE trd_oce ! trends: ocean variables 23 24 USE trdtra ! trends: tracer trend manager 25 USE eosbn2, ONLY: ln_SEOS, rn_b0 24 26 ! 25 27 USE in_out_manager ! I/O manager … … 55 57 REAL(wp), DIMENSION(jpi,jpj,jpk,jpts,jpt), INTENT(inout) :: pts ! active tracers and RHS of tracer equation 56 58 ! 57 INTEGER :: j k ! Dummy loop indices59 INTEGER :: ji, jj, jk ! Dummy loop indices 58 60 REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: ztrdt, ztrds ! 3D workspace 59 61 !!--------------------------------------------------------------------- … … 62 64 ! 63 65 IF( kt == nit000 ) THEN 64 IF(lwp)WRITE(numout,*) 65 IF(lwp)WRITE(numout,*) 'tra_zdf : implicit vertical mixing on T & S' 66 IF(lwp)WRITE(numout,*) '~~~~~~~ ' 66 IF( ntile == 0 .OR. ntile == 1 ) THEN ! Do only on the first tile 67 IF(lwp)WRITE(numout,*) 68 IF(lwp)WRITE(numout,*) 'tra_zdf : implicit vertical mixing on T & S' 69 IF(lwp)WRITE(numout,*) '~~~~~~~ ' 70 ENDIF 67 71 ENDIF 68 72 ! 69 73 IF( l_trdtra ) THEN !* Save ta and sa trends 70 ALLOCATE( ztrdt(jpi,jpj,jpk) 74 ALLOCATE( ztrdt(jpi,jpj,jpk), ztrds(jpi,jpj,jpk) ) 71 75 ztrdt(:,:,:) = pts(:,:,:,jp_tem,Kaa) 72 76 ztrds(:,:,:) = pts(:,:,:,jp_sal,Kaa) … … 74 78 ! 75 79 ! !* compute lateral mixing trend and add it to the general trend 76 CALL tra_zdf_imp( kt, nit000, 'TRA', rDt, Kbb, Kmm, Krhs, pts, Kaa, jpts ) 80 CALL tra_zdf_imp( kt, nit000, 'TRA', rDt, Kbb, Kmm, Krhs, pts, Kaa, jpts ) 77 81 78 82 !!gm WHY here ! and I don't like that ! … … 80 84 ! JMM avoid negative salinities near river outlet ! Ugly fix 81 85 ! JMM : restore negative salinities to small salinities: 82 WHERE( pts(:,:,:,jp_sal,Kaa) < 0._wp ) pts(:,:,:,jp_sal,Kaa) = 0.1_wp 86 !!jc: discard this correction in case salinity is not used in eos 87 IF ( .NOT.(ln_SEOS.AND.(rn_b0==0._wp)) ) THEN 88 WHERE( pts(A2D(0),:,jp_sal,Kaa) < 0._wp ) pts(A2D(0),:,jp_sal,Kaa) = 0.1_wp 89 ENDIF 83 90 !!gm 84 91 85 92 IF( l_trdtra ) THEN ! save the vertical diffusive trends for further diagnostics 86 DO jk = 1, jpk m193 DO jk = 1, jpk 87 94 ztrdt(:,:,jk) = ( ( pts(:,:,jk,jp_tem,Kaa)*e3t(:,:,jk,Kaa) & 88 95 & - pts(:,:,jk,jp_tem,Kbb)*e3t(:,:,jk,Kbb) ) & … … 95 102 END DO 96 103 !!gm this should be moved in trdtra.F90 and done on all trends 97 CALL lbc_lnk _multi( 'trazdf', ztrdt, 'T', 1.0_wp , ztrds, 'T', 1.0_wp )104 CALL lbc_lnk( 'trazdf', ztrdt, 'T', 1.0_wp , ztrds, 'T', 1.0_wp ) 98 105 !!gm 99 106 CALL trd_tra( kt, Kmm, Krhs, 'TRA', jp_tem, jptra_zdf, ztrdt ) … … 109 116 END SUBROUTINE tra_zdf 110 117 111 112 SUBROUTINE tra_zdf_imp( kt, kit000, cdtype, p2dt, Kbb, Kmm, Krhs, pt, Kaa, kjpt ) 118 119 SUBROUTINE tra_zdf_imp( kt, kit000, cdtype, p2dt, Kbb, Kmm, Krhs, pt, Kaa, kjpt ) 113 120 !!---------------------------------------------------------------------- 114 121 !! *** ROUTINE tra_zdf_imp *** 115 122 !! 116 123 !! ** Purpose : Compute the after tracer through a implicit computation 117 !! of the vertical tracer diffusion (including the vertical component 118 !! of lateral mixing (only for 2nd order operator, for fourth order 119 !! it is already computed and add to the general trend in traldf) 124 !! of the vertical tracer diffusion (including the vertical component 125 !! of lateral mixing (only for 2nd order operator, for fourth order 126 !! it is already computed and add to the general trend in traldf) 120 127 !! 121 128 !! ** Method : The vertical diffusion of a tracer ,t , is given by: … … 140 147 INTEGER :: ji, jj, jk, jn ! dummy loop indices 141 148 REAL(wp) :: zrhs, zzwi, zzws ! local scalars 142 REAL(wp), DIMENSION( jpi,jpj,jpk) :: zwi, zwt, zwd, zws149 REAL(wp), DIMENSION(A2D(nn_hls),jpk) :: zwi, zwt, zwd, zws 143 150 !!--------------------------------------------------------------------- 144 151 ! … … 154 161 ! 155 162 ! vertical mixing coef.: avt for temperature, avs for salinity and passive tracers 156 IF( cdtype == 'TRA' .AND. jn == jp_tem ) THEN ; zwt(:,:,2:jpk) = avt(:,:,2:jpk) 157 ELSE ; zwt(:,:,2:jpk) = avs(:,:,2:jpk) 163 IF( cdtype == 'TRA' .AND. jn == jp_tem ) THEN 164 DO_3D( 1, 1, 1, 1, 2, jpk ) 165 zwt(ji,jj,jk) = avt(ji,jj,jk) 166 END_3D 167 ELSE 168 DO_3D( 1, 1, 1, 1, 2, jpk ) 169 zwt(ji,jj,jk) = avs(ji,jj,jk) 170 END_3D 158 171 ENDIF 159 172 zwt(:,:,1) = 0._wp 160 173 ! 161 IF( l_ldfslp ) THEN ! isoneutral diffusion: add the contribution 162 IF( ln_traldf_msc ) THEN ! MSC iso-neutral operator 174 IF( l_ldfslp ) THEN ! isoneutral diffusion: add the contribution 175 IF( ln_traldf_msc ) THEN ! MSC iso-neutral operator 163 176 DO_3D( 0, 0, 0, 0, 2, jpkm1 ) 164 zwt(ji,jj,jk) = zwt(ji,jj,jk) + akz(ji,jj,jk) 177 zwt(ji,jj,jk) = zwt(ji,jj,jk) + akz(ji,jj,jk) 165 178 END_3D 166 179 ELSE ! standard or triad iso-neutral operator … … 189 202 ENDIF 190 203 ! 204 ! Modification of diagonal to add MF scheme 205 IF ( ln_zdfmfc ) THEN 206 CALL diag_mfc( zwi, zwd, zws, p2dt, Kaa ) 207 END IF 208 ! 191 209 !! Matrix inversion from the first level 192 210 !!---------------------------------------------------------------------- … … 205 223 ! The solution will be in the 4d array pta. 206 224 ! The 3d array zwt is used as a work space array. 207 ! En route to the solution pt(:,:,:,:,Kaa) is used a to evaluate the rhs and then 225 ! En route to the solution pt(:,:,:,:,Kaa) is used a to evaluate the rhs and then 208 226 ! used as a work space array: its value is modified. 209 227 ! … … 215 233 END_3D 216 234 ! 217 ENDIF 218 ! 235 ENDIF 236 ! 237 ! Modification of rhs to add MF scheme 238 IF ( ln_zdfmfc ) THEN 239 CALL rhs_mfc( pt(:,:,:,jn,Krhs), jn ) 240 END IF 241 ! 219 242 DO_2D( 0, 0, 0, 0 ) !* 2nd recurrence: Zk = Yk - Ik / Tk-1 Zk-1 220 243 pt(ji,jj,1,jn,Kaa) = e3t(ji,jj,1,Kbb) * pt(ji,jj,1,jn,Kbb) & … … 222 245 END_2D 223 246 DO_3D( 0, 0, 0, 0, 2, jpkm1 ) 224 zrhs = e3t(ji,jj,jk,Kbb) * pt(ji,jj,jk,jn,Kbb) & 247 zrhs = e3t(ji,jj,jk,Kbb) * pt(ji,jj,jk,jn,Kbb) & 225 248 & + p2dt * e3t(ji,jj,jk,Kmm) * pt(ji,jj,jk,jn,Krhs) ! zrhs=right hand side 226 249 pt(ji,jj,jk,jn,Kaa) = zrhs - zwi(ji,jj,jk) / zwt(ji,jj,jk-1) * pt(ji,jj,jk-1,jn,Kaa)
Note: See TracChangeset
for help on using the changeset viewer.