Changeset 14072 for NEMO/trunk/src/OCE/TRA/zpshde.F90
- Timestamp:
- 2020-12-04T08:48:38+01:00 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
NEMO/trunk/src/OCE/TRA/zpshde.F90
r13982 r14072 7 7 !! NEMO 1.0 ! 2002-08 (G. Madec E. Durand) Optimization and Free form 8 8 !! - ! 2004-03 (C. Ethe) adapted for passive tracers 9 !! 3.3 ! 2010-05 (C. Ethe, G. Madec) merge TRC-TRA 9 !! 3.3 ! 2010-05 (C. Ethe, G. Madec) merge TRC-TRA 10 10 !! 3.6 ! 2014-11 (P. Mathiot) Add zps_hde_isf (needed to open a cavity) 11 11 !!====================================================================== 12 12 13 13 !!---------------------------------------------------------------------- 14 14 !! zps_hde : Horizontal DErivative of T, S and rd at the last … … 66 66 !!---------------------------------------------------------------------- 67 67 !! *** ROUTINE zps_hde *** 68 !! 68 !! 69 69 !! ** Purpose : Compute the horizontal derivative of T, S and rho 70 70 !! at u- and v-points with a linear interpolation for z-coordinate 71 71 !! with partial steps. 72 72 !! 73 !! ** Method : In z-coord with partial steps, scale factors on last 74 !! levels are different for each grid point, so that T, S and rd 73 !! ** Method : In z-coord with partial steps, scale factors on last 74 !! levels are different for each grid point, so that T, S and rd 75 75 !! points are not at the same depth as in z-coord. To have horizontal 76 !! gradients again, we interpolate T and S at the good depth : 77 !! Linear interpolation of T, S 76 !! gradients again, we interpolate T and S at the good depth : 77 !! Linear interpolation of T, S 78 78 !! Computation of di(tb) and dj(tb) by vertical interpolation: 79 79 !! di(t) = t~ - t(i,j,k) or t(i+1,j,k) - t~ 80 80 !! dj(t) = t~ - t(i,j,k) or t(i,j+1,k) - t~ 81 81 !! This formulation computes the two cases: 82 !! CASE 1 CASE 2 82 !! CASE 1 CASE 2 83 83 !! k-1 ___ ___________ k-1 ___ ___________ 84 84 !! Ti T~ T~ Ti+1 … … 87 87 !! | |____ ____| | 88 88 !! ___ | | | ___ | | | 89 !! 89 !! 90 90 !! case 1-> e3w(i+1,:,:,Kmm) >= e3w(i,:,:,Kmm) ( and e3w(:,j+1,:,Kmm) >= e3w(:,j,:,Kmm) ) then 91 91 !! t~ = t(i+1,j ,k) + (e3w(i+1,j,k,Kmm) - e3w(i,j,k,Kmm)) * dk(Ti+1)/e3w(i+1,j,k,Kmm) … … 95 95 !! t~ = t(i,j,k) + (e3w(i,j,k,Kmm) - e3w(i+1,j,k,Kmm)) * dk(Ti)/e3w(i,j,k,Kmm) 96 96 !! ( t~ = t(i,j,k) + (e3w(i,j,k,Kmm) - e3w(i,j+1,k,Kmm)) * dk(Tj)/e3w(i,j,k,Kmm) ) 97 !! Idem for di(s) and dj(s) 97 !! Idem for di(s) and dj(s) 98 98 !! 99 99 !! For rho, we call eos which will compute rd~(t~,s~) at the right … … 175 175 ! 176 176 IF (nn_hls.EQ.1) CALL lbc_lnk_multi( 'zpshde', pgtu(:,:,:), 'U', -1.0_wp , pgtv(:,:,:), 'V', -1.0_wp ) ! Lateral boundary cond. 177 ! 177 ! 178 178 IF( PRESENT( prd ) ) THEN !== horizontal derivative of density anomalies (rd) ==! (optional part) 179 179 pgru(:,:) = 0._wp … … 192 192 END_2D 193 193 ! 194 CALL eos( zti, zhi, zri ) ! interpolated density from zti, ztj 195 CALL eos( ztj, zhj, zrj ) ! at the partial step depth output in zri, zrj 194 CALL eos( zti, zhi, zri ) ! interpolated density from zti, ztj 195 CALL eos( ztj, zhj, zrj ) ! at the partial step depth output in zri, zrj 196 196 ! 197 197 DO_2D( nn_hls-1, nn_hls-1, nn_hls-1, nn_hls-1 ) ! Gradient of density at the last level … … 244 244 !!---------------------------------------------------------------------- 245 245 !! *** ROUTINE zps_hde_isf *** 246 !! 246 !! 247 247 !! ** Purpose : Compute the horizontal derivative of T, S and rho 248 248 !! at u- and v-points with a linear interpolation for z-coordinate 249 249 !! with partial steps for top (ice shelf) and bottom. 250 250 !! 251 !! ** Method : In z-coord with partial steps, scale factors on last 252 !! levels are different for each grid point, so that T, S and rd 251 !! ** Method : In z-coord with partial steps, scale factors on last 252 !! levels are different for each grid point, so that T, S and rd 253 253 !! points are not at the same depth as in z-coord. To have horizontal 254 254 !! gradients again, we interpolate T and S at the good depth : 255 255 !! For the bottom case: 256 !! Linear interpolation of T, S 256 !! Linear interpolation of T, S 257 257 !! Computation of di(tb) and dj(tb) by vertical interpolation: 258 258 !! di(t) = t~ - t(i,j,k) or t(i+1,j,k) - t~ 259 259 !! dj(t) = t~ - t(i,j,k) or t(i,j+1,k) - t~ 260 260 !! This formulation computes the two cases: 261 !! CASE 1 CASE 2 261 !! CASE 1 CASE 2 262 262 !! k-1 ___ ___________ k-1 ___ ___________ 263 263 !! Ti T~ T~ Ti+1 … … 266 266 !! | |____ ____| | 267 267 !! ___ | | | ___ | | | 268 !! 268 !! 269 269 !! case 1-> e3w(i+1,j,k,Kmm) >= e3w(i,j,k,Kmm) ( and e3w(i,j+1,k,Kmm) >= e3w(i,j,k,Kmm) ) then 270 270 !! t~ = t(i+1,j ,k) + (e3w(i+1,j ,k,Kmm) - e3w(i,j,k,Kmm)) * dk(Ti+1)/e3w(i+1,j ,k,Kmm) … … 274 274 !! t~ = t(i,j,k) + (e3w(i,j,k,Kmm) - e3w(i+1,j ,k,Kmm)) * dk(Ti)/e3w(i,j,k,Kmm) 275 275 !! ( t~ = t(i,j,k) + (e3w(i,j,k,Kmm) - e3w(i ,j+1,k,Kmm)) * dk(Tj)/e3w(i,j,k,Kmm) ) 276 !! Idem for di(s) and dj(s) 276 !! Idem for di(s) and dj(s) 277 277 !! 278 278 !! For rho, we call eos which will compute rd~(t~,s~) at the right … … 364 364 ! horizontal derivative of density anomalies (rd) 365 365 IF( PRESENT( prd ) ) THEN ! depth of the partial step level 366 pgru(:,:)=0.0_wp ; pgrv(:,:)=0.0_wp ; 366 pgru(:,:)=0.0_wp ; pgrv(:,:)=0.0_wp ; 367 367 ! 368 368 DO_2D( nn_hls-1, nn_hls-1, nn_hls-1, nn_hls-1 ) … … 418 418 ! the only common depth between cells (i,j) and (i,j+1) is gdepw_0 419 419 ze3wu = gdept(ji,jj,iku,Kmm) - gdept(ji+1,jj,iku,Kmm) 420 ze3wv = gdept(ji,jj,ikv,Kmm) - gdept(ji,jj+1,ikv,Kmm) 420 ze3wv = gdept(ji,jj,ikv,Kmm) - gdept(ji,jj+1,ikv,Kmm) 421 421 422 422 ! i- direction … … 463 463 ikv = mikv(ji,jj) 464 464 ze3wu = gdept(ji,jj,iku,Kmm) - gdept(ji+1,jj,iku,Kmm) 465 ze3wv = gdept(ji,jj,ikv,Kmm) - gdept(ji,jj+1,ikv,Kmm) 465 ze3wv = gdept(ji,jj,ikv,Kmm) - gdept(ji,jj+1,ikv,Kmm) 466 466 ! 467 467 IF( ze3wu >= 0._wp ) THEN ; zhi(ji,jj) = gdept(ji ,jj,iku,Kmm) ! i-direction: case 1 … … 475 475 END_2D 476 476 ! 477 CALL eos( zti, zhi, zri ) ! interpolated density from zti, ztj 478 CALL eos( ztj, zhj, zrj ) ! at the partial step depth output in zri, zrj 479 ! 480 DO_2D( nn_hls-1, nn_hls-1, nn_hls-1, nn_hls-1 ) 481 iku = miku(ji,jj) 482 ikv = mikv(ji,jj) 477 CALL eos( zti, zhi, zri ) ! interpolated density from zti, ztj 478 CALL eos( ztj, zhj, zrj ) ! at the partial step depth output in zri, zrj 479 ! 480 DO_2D( nn_hls-1, nn_hls-1, nn_hls-1, nn_hls-1 ) 481 iku = miku(ji,jj) 482 ikv = mikv(ji,jj) 483 483 ze3wu = gdept(ji,jj,iku,Kmm) - gdept(ji+1,jj,iku,Kmm) 484 ze3wv = gdept(ji,jj,ikv,Kmm) - gdept(ji,jj+1,ikv,Kmm) 484 ze3wv = gdept(ji,jj,ikv,Kmm) - gdept(ji,jj+1,ikv,Kmm) 485 485 486 486 IF( ze3wu >= 0._wp ) THEN ; pgrui(ji,jj) = ssumask(ji,jj) * ( zri(ji ,jj ) - prd(ji,jj,iku) ) ! i: 1 … … 494 494 IF (nn_hls.EQ.1) CALL lbc_lnk_multi( 'zpshde', pgrui, 'U', -1.0_wp , pgrvi, 'V', -1.0_wp ) ! Lateral boundary conditions 495 495 ! 496 END IF 496 END IF 497 497 ! 498 498 IF( ln_timing ) CALL timing_stop( 'zps_hde_isf')
Note: See TracChangeset
for help on using the changeset viewer.