Changeset 14329
- Timestamp:
- 2021-01-22T12:28:22+01:00 (4 years ago)
- Location:
- NEMO/branches/2021/dev_r14312_MOI-01_MOI-GRIFFIESTRIADSMOOTHING/src/OCE/LDF
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
NEMO/branches/2021/dev_r14312_MOI-01_MOI-GRIFFIESTRIADSMOOTHING/src/OCE/LDF/ldfslp.F90
r14312 r14329 50 50 LOGICAL , PUBLIC :: ln_triad_iso = .FALSE. !: pure horizontal mixing in ML (nam_traldf namelist) 51 51 LOGICAL , PUBLIC :: ln_botmix_triad = .FALSE. !: mixing on bottom (nam_traldf namelist) 52 LOGICAL , PUBLIC :: ln_smooth_triad = .FALSE. !: smooth triads slopes (nam_traldf namelist) 52 53 REAL(wp), PUBLIC :: rn_sw_triad = 1._wp !: =1 switching triads ; =0 all four triads used (nam_traldf namelist) 53 54 REAL(wp), PUBLIC :: rn_slpmax = 0.01_wp !: slope limit (nam_traldf namelist) … … 232 233 ! 233 234 ! !* horizontal Shapiro filter 234 DO jk = 2, jpkm1 235 DO_2D( 0, 0, 0, 0 ) ! rows jj=2 and =jpjm1 only 236 uslp(ji,jj,jk) = z1_16 * ( zwz(ji-1,jj-1,jk) + zwz(ji+1,jj-1,jk) & 237 & + zwz(ji-1,jj+1,jk) + zwz(ji+1,jj+1,jk) & 238 & + 2.*( zwz(ji ,jj-1,jk) + zwz(ji-1,jj ,jk) & 239 & + zwz(ji+1,jj ,jk) + zwz(ji ,jj+1,jk) ) & 240 & + 4.* zwz(ji ,jj ,jk) ) 241 vslp(ji,jj,jk) = z1_16 * ( zww(ji-1,jj-1,jk) + zww(ji+1,jj-1,jk) & 242 & + zww(ji-1,jj+1,jk) + zww(ji+1,jj+1,jk) & 243 & + 2.*( zww(ji ,jj-1,jk) + zww(ji-1,jj ,jk) & 244 & + zww(ji+1,jj ,jk) + zww(ji ,jj+1,jk) ) & 245 & + 4.* zww(ji,jj ,jk) ) 246 END_2D 247 ! !* decrease along coastal boundaries 248 DO_2D( 0, 0, 0, 0 ) 249 uslp(ji,jj,jk) = uslp(ji,jj,jk) * ( umask(ji,jj+1,jk) + umask(ji,jj-1,jk ) ) * 0.5_wp & 250 & * ( umask(ji,jj ,jk) + umask(ji,jj ,jk+1) ) * 0.5_wp 251 vslp(ji,jj,jk) = vslp(ji,jj,jk) * ( vmask(ji+1,jj,jk) + vmask(ji-1,jj,jk ) ) * 0.5_wp & 252 & * ( vmask(ji ,jj,jk) + vmask(ji ,jj,jk+1) ) * 0.5_wp 253 END_2D 254 END DO 235 CALL ldf_slp_smooth( zwz , 'U' , uslp ) 236 CALL ldf_slp_smooth( zww , 'V' , vslp ) 255 237 256 238 … … 292 274 ! 293 275 ! !* horizontal Shapiro filter 294 DO jk = 2, jpkm1 295 DO_2D( 0, 0, 0, 0 ) ! rows jj=2 and =jpjm1 only 296 zcofw = wmask(ji,jj,jk) * z1_16 297 wslpi(ji,jj,jk) = ( zwz(ji-1,jj-1,jk) + zwz(ji+1,jj-1,jk) & 298 & + zwz(ji-1,jj+1,jk) + zwz(ji+1,jj+1,jk) & 299 & + 2.*( zwz(ji ,jj-1,jk) + zwz(ji-1,jj ,jk) & 300 & + zwz(ji+1,jj ,jk) + zwz(ji ,jj+1,jk) ) & 301 & + 4.* zwz(ji ,jj ,jk) ) * zcofw 302 303 wslpj(ji,jj,jk) = ( zww(ji-1,jj-1,jk) + zww(ji+1,jj-1,jk) & 304 & + zww(ji-1,jj+1,jk) + zww(ji+1,jj+1,jk) & 305 & + 2.*( zww(ji ,jj-1,jk) + zww(ji-1,jj ,jk) & 306 & + zww(ji+1,jj ,jk) + zww(ji ,jj+1,jk) ) & 307 & + 4.* zww(ji ,jj ,jk) ) * zcofw 308 END_2D 309 ! !* decrease in vicinity of topography 310 DO_2D( 0, 0, 0, 0 ) 311 zck = ( umask(ji,jj,jk) + umask(ji-1,jj,jk) ) & 312 & * ( vmask(ji,jj,jk) + vmask(ji,jj-1,jk) ) * 0.25 313 wslpi(ji,jj,jk) = wslpi(ji,jj,jk) * zck 314 wslpj(ji,jj,jk) = wslpj(ji,jj,jk) * zck 315 END_2D 316 END DO 276 CALL ldf_slp_smooth( zwz , 'W' , wslpi ) 277 CALL ldf_slp_smooth( zww , 'W' , wslpj ) 278 317 279 318 280 ! IV. Lateral boundary conditions … … 358 320 REAL(wp) :: zbeta0, ze3_e1, ze3_e2 359 321 REAL(wp), DIMENSION(jpi,jpj) :: z1_mlbw 322 REAL(wp), DIMENSION(jpi,jpj,jpk) :: ztmp ! Temporay array 360 323 REAL(wp), DIMENSION(jpi,jpj,jpk,0:1) :: zdxrho , zdyrho, zdzrho ! Horizontal and vertical density gradients 361 324 REAL(wp), DIMENSION(jpi,jpj,0:1,0:1) :: zti_mlb, ztj_mlb ! for Griffies operator only … … 548 511 END DO 549 512 ! 513 ! IV. Lateral boundary conditions 514 ! 515 CALL lbc_lnk_multi( 'ldfslp_triad', triadi_g(:,:,:,0,0) , 'U', -1. , triadi_g(:,:,:,0,1) , 'U', -1. , triadi_g(:,:,:,1,0), 'U',-1., triadi_g(:,:,:,1,1), 'U', -1. ) 516 CALL lbc_lnk_multi( 'ldfslp_triad', triadj_g(:,:,:,0,0) , 'V', -1. , triadj_g(:,:,:,0,1) , 'V', -1. , triadj_g(:,:,:,1,0), 'V',-1., triadj_g(:,:,:,1,1), 'V', -1. ) 517 CALL lbc_lnk_multi( 'ldfslp_triad', triadi(:,:,:,0,0) , 'U', -1. , triadi(:,:,:,0,1) , 'U', -1. , triadi(:,:,:,1,0), 'U',-1., triadi(:,:,:,1,1), 'U', -1. ) 518 CALL lbc_lnk_multi( 'ldfslp_triad', triadj(:,:,:,0,0) , 'V', -1. , triadj(:,:,:,0,1) , 'V', -1. , triadj(:,:,:,1,0), 'V',-1., triadj(:,:,:,1,1), 'V', -1. ) 519 CALL lbc_lnk( 'ldfslp', wslp2, 'W', -1. ) 520 ! 521 ! !* horizontal Shapiro filter 522 ! 523 IF( ln_smooth_triad )THEN !smooth triads slopes 524 525 DO kp = 0, 1 ! k-index of triads 526 DO jl = 0, 1 527 ip = jl ; jp = jl ! i- and j-indices of triads(i-k and j-k planes) 528 CALL ldf_slp_smooth( triadi_g(:,:,:,1-ip,kp) , 'U' , ztmp ) ; triadi_g(:,:,:,1-ip,kp) = ztmp(:,:,:) 529 CALL ldf_slp_smooth( triadj_g(:,:,:,1-jp,kp) , 'V' , ztmp ) ; triadj_g(:,:,:,1-jp,kp) = ztmp(:,:,:) 530 CALL ldf_slp_smooth( triadi(:,:,:,1-ip,kp) , 'U' , ztmp ) ; triadi(:,:,:,1-ip,kp) = ztmp(:,:,:) 531 CALL ldf_slp_smooth( triadj(:,:,:,1-jp,kp) , 'V' , ztmp ) ; triadj(:,:,:,1-jp,kp) = ztmp(:,:,:) 532 END DO 533 END DO 534 CALL ldf_slp_smooth( wslp2(:,:,:), 'W' , ztmp ) ; wslp2(:,:,:) = ztmp(:,:,:) 535 536 CALL lbc_lnk_multi( 'ldfslp_triad', triadi_g(:,:,:,0,0) , 'U', -1. , triadi_g(:,:,:,0,1) , 'U', -1. , triadi_g(:,:,:,1,0), 'U',-1., triadi_g(:,:,:,1,1), 'U', -1. ) 537 CALL lbc_lnk_multi( 'ldfslp_triad', triadj_g(:,:,:,0,0) , 'V', -1. , triadj_g(:,:,:,0,1) , 'V', -1. , triadj_g(:,:,:,1,0), 'V',-1., triadj_g(:,:,:,1,1), 'V', -1. ) 538 CALL lbc_lnk_multi( 'ldfslp_triad', triadi(:,:,:,0,0) , 'U', -1. , triadi(:,:,:,0,1) , 'U', -1. , triadi(:,:,:,1,0), 'U',-1., triadi(:,:,:,1,1), 'U', -1. ) 539 CALL lbc_lnk_multi( 'ldfslp_triad', triadj(:,:,:,0,0) , 'V', -1. , triadj(:,:,:,0,1) , 'V', -1. , triadj(:,:,:,1,0), 'V',-1., triadj(:,:,:,1,1), 'V', -1. ) 540 CALL lbc_lnk( 'ldfslp', wslp2, 'W', -1. ) 541 542 ENDIF 543 ! 544 550 545 wslp2(:,:,1) = 0._wp ! force the surface wslp to zero 551 546 … … 663 658 END SUBROUTINE ldf_slp_mxl 664 659 660 SUBROUTINE ldf_slp_smooth( pslpi , clg , pslpo ) 661 !!---------------------------------------------------------------------- 662 !! *** ROUTINE ldf_slp_mxl *** 663 !! 664 !! ** Purpose : smooth slope 665 !! 666 !! ** Method : use shapiro filter 667 !! 668 !! ** Action : pslpo=smooth pslpi) 669 !! 670 !!---------------------------------------------------------------------- 671 REAL(wp), DIMENSION(:,:,:), INTENT(in) :: pslpi ! unsmoothed slope 672 CHARACTER(len=*) , INTENT(in) :: clg ! grid point 673 REAL(wp), DIMENSION(:,:,:), INTENT(out) :: pslpo ! smoothed slope 674 !! 675 INTEGER :: ji, jj, jk ! dummy loop indices 676 REAL(wp) :: zcofw, z1_16, zck 677 REAL(wp), DIMENSION(jpi,jpj,jpk) :: zmask 678 !!---------------------------------------------------------------------- 679 ! 680 z1_16 = 1.0_wp / 16._wp 681 ! 682 ! slopes smoothing 683 ! 684 SELECT CASE(clg) 685 CASE('W') ; zmask(:,:,:) = z1_16 * zmask(:,:,:) 686 CASE DEFAULT ; zmask(:,:,:) = z1_16 687 END SELECT 688 ! 689 pslpo(:,:,:) = 0._wp 690 DO_3D( 0, 0, 0, 0, 2, jpkm1 ) 691 pslpo(ji,jj,jk) = z1_16 * ( pslpi(ji-1,jj-1,jk) + pslpi(ji+1,jj-1,jk) & 692 & + pslpi(ji-1,jj+1,jk) + pslpi(ji+1,jj+1,jk) & 693 & + 2.*( pslpi(ji ,jj-1,jk) + pslpi(ji-1,jj ,jk) & 694 & + pslpi(ji+1,jj ,jk) + pslpi(ji ,jj+1,jk) ) & 695 & + 4.* pslpi(ji ,jj ,jk)) 696 END_3D 697 ! 698 ! decrease along coastal boundaries 699 ! 700 SELECT CASE(clg) 701 CASE('U') 702 DO_3D( 0, 0, 0, 0, 2, jpkm1 ) 703 pslpo(ji,jj,jk) = pslpo(ji,jj,jk) * ( umask(ji,jj+1,jk) + umask(ji,jj-1,jk ) ) * 0.5_wp & 704 & * ( umask(ji,jj ,jk) + umask(ji,jj ,jk+1) ) * 0.5_wp 705 END_3D 706 CASE('V') 707 DO_3D( 0, 0, 0, 0, 2, jpkm1 ) 708 pslpo(ji,jj,jk) = pslpo(ji,jj,jk) * ( vmask(ji+1,jj,jk) + vmask(ji-1,jj,jk ) ) * 0.5_wp & 709 & * ( vmask(ji ,jj,jk) + vmask(ji ,jj,jk+1) ) * 0.5_wp 710 END_3D 711 CASE('W') 712 DO_3D( 0, 0, 0, 0, 2, jpkm1 ) 713 pslpo(ji,jj,jk) = pslpo(ji,jj,jk) * ( umask(ji,jj,jk) + umask(ji-1,jj,jk) ) & 714 & * ( vmask(ji,jj,jk) + vmask(ji,jj-1,jk) ) * 0.25 715 END_3D 716 END SELECT 717 ! 718 END SUBROUTINE ldf_slp_smooth 665 719 666 720 SUBROUTINE ldf_slp_init -
NEMO/branches/2021/dev_r14312_MOI-01_MOI-GRIFFIESTRIADSMOOTHING/src/OCE/LDF/ldftra.F90
r14201 r14329 139 139 & ln_traldf_lev, ln_traldf_hor , ln_traldf_triad, & ! acting direction of the operator 140 140 & ln_traldf_iso, ln_traldf_msc , rn_slpmax , & ! option for iso-neutral operator 141 & ln_triad_iso , ln_botmix_triad, rn_sw_triad , & ! option for triad operator 141 & ln_triad_iso , ln_botmix_triad, ln_smooth_triad, & ! option for triad operator 142 & rn_sw_triad , & ! option for triad operator 142 143 & nn_aht_ijk_t , rn_Ud , rn_Ld ! lateral eddy coefficient 143 144 !!---------------------------------------------------------------------- … … 175 176 WRITE(numout,*) ' switching triad or not rn_sw_triad = ', rn_sw_triad 176 177 WRITE(numout,*) ' lateral mixing on bottom ln_botmix_triad = ', ln_botmix_triad 178 WRITE(numout,*) ' smooth triads slopes ln_smooth_triad = ', ln_smooth_triad 177 179 WRITE(numout,*) ' coefficients :' 178 180 WRITE(numout,*) ' type of time-space variation nn_aht_ijk_t = ', nn_aht_ijk_t
Note: See TracChangeset
for help on using the changeset viewer.