New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
Changeset 2969 for branches/2011/dev_r2782_NOCS_Griffies/NEMOGCM/NEMO/OPA_SRC/LDF/ldfslp.F90 – NEMO

Ignore:
Timestamp:
2011-10-20T18:00:23+02:00 (13 years ago)
Author:
acc
Message:

branches/2011/dev_r2782_NOCS_Griffies ticket #838. Final style changes and removal of outdated comments

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2011/dev_r2782_NOCS_Griffies/NEMOGCM/NEMO/OPA_SRC/LDF/ldfslp.F90

    r2840 r2969  
    402402      !!---------------------------------------------------------------------- 
    403403      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released 
    404       USE oce     , ONLY:   zalbet  => ua   ! use ua as workspace 
     404      USE oce     , ONLY:   zalbet  => ua       ! use ua as workspace 
    405405      USE wrk_nemo, ONLY:   z1_mlbw => wrk_2d_1 
    406406      !! 
    407       INTEGER, INTENT( in ) ::   kt         ! ocean time-step index 
     407      INTEGER, INTENT( in ) ::   kt             ! ocean time-step index 
    408408      !! 
    409409      INTEGER  ::   ji, jj, jk, jl, ip, jp, kp  ! dummy loop indices 
     
    425425      !--------------------------------! 
    426426      ! 
    427       CALL eos_alpbet( tsb, zalbet, zbeta0 )         !==  before local thermal/haline expension ratio at T-points  ==! 
    428       ! 
    429       DO jl = 0, 1                           !==  unmasked before density i- j-, k-gradients  ==! 
     427      CALL eos_alpbet( tsb, zalbet, zbeta0 )  !==  before local thermal/haline expension ratio at T-points  ==! 
     428      ! 
     429      DO jl = 0, 1                            !==  unmasked before density i- j-, k-gradients  ==! 
    430430         ! 
    431          ip = jl   ;   jp = jl        ! guaranteed nonzero gradients ( absolute value larger than repsln) 
    432          DO jk = 1, jpkm1                          ! done each pair of triad 
    433             DO jj = 1, jpjm1                       ! NB: not masked ==>  a minimum value is set 
    434                DO ji = 1, fs_jpim1   ! vector opt. 
     431         ip = jl   ;   jp = jl                ! guaranteed nonzero gradients ( absolute value larger than repsln) 
     432         DO jk = 1, jpkm1                     ! done each pair of triad 
     433            DO jj = 1, jpjm1                  ! NB: not masked ==>  a minimum value is set 
     434               DO ji = 1, fs_jpim1            ! vector opt. 
    435435                  zdit = ( tsb(ji+1,jj,jk,jp_tem) - tsb(ji,jj,jk,jp_tem) )    ! i-gradient of T & S at u-point 
    436436                  zdis = ( tsb(ji+1,jj,jk,jp_sal) - tsb(ji,jj,jk,jp_sal) ) 
     
    445445         END DO 
    446446         ! 
    447          IF( ln_zps.and.ln_grad_zps ) THEN                       ! partial steps: correction of i- & j-grad on bottom 
     447         IF( ln_zps.and.l_grad_zps ) THEN     ! partial steps: correction of i- & j-grad on bottom 
    448448# if defined key_vectopt_loop 
    449449            DO jj = 1, 1 
    450                DO ji = 1, jpij-jpi   ! vector opt. (forced unrolling) 
     450               DO ji = 1, jpij-jpi            ! vector opt. (forced unrolling) 
    451451# else 
    452452            DO jj = 1, jpjm1 
     
    466466      END DO 
    467467 
    468       DO kp = 0, 1                           !==  unmasked before density i- j-, k-gradients  ==! 
    469          DO jk = 1, jpkm1                          ! done each pair of triad 
    470             DO jj = 1, jpj                       ! NB: not masked ==>  a minimum value is set 
    471                DO ji = 1, jpi  ! vector opt. 
    472                   IF( jk+kp > 1 ) THEN                                       ! k-gradient of T & S a jk+kp 
     468      DO kp = 0, 1                            !==  unmasked before density i- j-, k-gradients  ==! 
     469         DO jk = 1, jpkm1                     ! done each pair of triad 
     470            DO jj = 1, jpj                    ! NB: not masked ==>  a minimum value is set 
     471               DO ji = 1, jpi                 ! vector opt. 
     472                  IF( jk+kp > 1 ) THEN        ! k-gradient of T & S a jk+kp 
    473473                     zdkt = ( tsb(ji,jj,jk+kp-1,jp_tem) - tsb(ji,jj,jk+kp,jp_tem) ) 
    474474                     zdks = ( tsb(ji,jj,jk+kp-1,jp_sal) - tsb(ji,jj,jk+kp,jp_sal) ) 
     
    484484      END DO 
    485485      ! 
    486       DO jj = 1, jpj                         !==  Reciprocal depth of the w-point below ML base  ==! 
     486      DO jj = 1, jpj                          !==  Reciprocal depth of the w-point below ML base  ==! 
    487487         DO ji = 1, jpi 
    488488            jk = MIN( nmln(ji,jj), mbkt(ji,jj) ) + 1     ! MIN in case ML depth is the ocean depth 
     
    491491      END DO 
    492492      ! 
    493       !                                      !==  intialisations to zero  ==! 
    494       ! 
    495       wslp2  (:,:,:)     = 0._wp                                        ! wslp2 will be cumulated 3D field set to zero 
     493      !                                       !==  intialisations to zero  ==! 
     494      ! 
     495      wslp2  (:,:,:)     = 0._wp              ! wslp2 will be cumulated 3D field set to zero 
    496496      triadi_g(:,:,1,:,:) = 0._wp   ;   triadi_g(:,:,jpk,:,:) = 0._wp   ! set surface and bottom slope to zero 
    497497      triadj_g(:,:,1,:,:) = 0._wp   ;   triadj_g(:,:,jpk,:,:) = 0._wp 
    498 !!gm _iso set to zero missing 
     498      !!gm _iso set to zero missing 
    499499      triadi  (:,:,1,:,:) = 0._wp   ;   triadj  (:,:,jpk,:,:) = 0._wp   ! set surface and bottom slope to zero 
    500500      triadj  (:,:,1,:,:) = 0._wp   ;   triadj  (:,:,jpk,:,:) = 0._wp 
     
    504504      !-------------------------------------! 
    505505      ! 
    506       DO jl = 0, 1               ! calculate slope of the 4 triads immediately ONE level below mixed-layer base 
    507          DO kp = 0, 1            ! with only the slope-max limit   and   MASKED 
     506      DO jl = 0, 1                            ! calculate slope of the 4 triads immediately ONE level below mixed-layer base 
     507         DO kp = 0, 1                         ! with only the slope-max limit   and   MASKED 
    508508            DO jj = 1, jpjm1 
    509509               DO ji = 1, fs_jpim1 
     
    527527      !-------------------------------------! 
    528528      ! 
    529       DO kp = 0, 1                        ! k-index of triads 
     529      DO kp = 0, 1                            ! k-index of triads 
    530530         DO jl = 0, 1 
    531             ip = jl   ;   jp = jl         ! i- and j-indices of triads (i-k and j-k planes) 
     531            ip = jl   ;   jp = jl             ! i- and j-indices of triads (i-k and j-k planes) 
    532532            DO jk = 1, jpkm1 
    533533               DO jj = 1, jpjm1 
    534                   DO ji = 1, fs_jpim1   ! vector opt. 
     534                  DO ji = 1, fs_jpim1         ! vector opt. 
    535535                     ! 
    536536                     ! Calculate slope relative to geopotentials used for GM skew fluxes 
     
    575575                     zti_lim  = ( zti_g_lim + zti_coord ) * umask(ji,jj,jk+kp)    ! remove coordinate slope => relative to coordinate surfaces 
    576576                     ztj_lim  = ( ztj_g_lim + ztj_coord ) * vmask(ji,jj,jk+kp) 
    577                      zti_lim2 = zti_lim * zti_lim      ! square of limited slopes            ! masked <<== 
     577                     zti_lim2 = zti_lim * zti_lim      ! square of limited slopes                          ! masked <<== 
    578578                     ztj_lim2 = ztj_lim * ztj_lim 
    579579                     ! 
     
    596596                     zbtj = e1t(ji,jj+jp) * e2t(ji,jj+jp) * fse3w(ji,jj+jp,jk+kp) 
    597597                     ! 
    598 !!gm this may inhibit vectorization on Vect Computers, and even on scalar computers....  ==> to be checked 
    599 ! agn may need to change to using ztj_g_lim**2, as wslp2 just used for eddy growth rate, needs *real* slope 
     598                     !!gm this may inhibit vectorization on Vect Computers, and even on scalar computers....  ==> to be checked 
     599                     ! agn may need to change to using ztj_g_lim**2, as wslp2 just used for eddy growth rate, needs *real* slope 
    600600                     wslp2 (ji+ip,jj,jk+kp) = wslp2(ji+ip,jj,jk+kp) + 0.25_wp * zbu / zbti * zti_lim2      ! masked 
    601601                     wslp2 (ji,jj+jp,jk+kp) = wslp2(ji,jj+jp,jk+kp) + 0.25_wp * zbv / zbtj * ztj_lim2 
     
    637637      REAL(wp), DIMENSION(:,:,:), INTENT(in) ::   p_dzr          ! z-gradient of density      (T-point) 
    638638      !! 
    639       INTEGER  ::   ji , jj , jk         ! dummy loop indices 
    640       INTEGER  ::   iku, ikv, ik, ikm1   ! local integers 
     639      INTEGER  ::   ji , jj , jk                   ! dummy loop indices 
     640      INTEGER  ::   iku, ikv, ik, ikm1             ! local integers 
    641641      REAL(wp) ::   zeps, zm1_g, zm1_2g            ! local scalars 
    642642      REAL(wp) ::   zci, zfi, zau, zbu, zai, zbi   !   -      - 
     
    654654      wslpjml(1,:) = 0._wp      ;      wslpjml(jpi,:) = 0._wp 
    655655      ! 
    656       !                          !==   surface mixed layer mask   ! 
    657       DO jk = 1, jpk                      ! =1 inside the mixed layer, =0 otherwise 
     656      !                                            !==   surface mixed layer mask   ! 
     657      DO jk = 1, jpk                               ! =1 inside the mixed layer, =0 otherwise 
    658658# if defined key_vectopt_loop 
    659659         DO jj = 1, 1 
    660             DO ji = 1, jpij   ! vector opt. (forced unrolling) 
     660            DO ji = 1, jpij                        ! vector opt. (forced unrolling) 
    661661# else 
    662662         DO jj = 1, jpj 
     
    689689         DO ji = 2, jpim1 
    690690# endif 
    691             !                    !==   Slope at u- & v-points just below the Mixed Layer   ==! 
     691            !                        !==   Slope at u- & v-points just below the Mixed Layer   ==! 
    692692            ! 
    693             !                          !- vertical density gradient for u- and v-slopes (from dzr at T-point) 
     693            !                        !- vertical density gradient for u- and v-slopes (from dzr at T-point) 
    694694            iku = MIN(  MAX( 1, nmln(ji,jj) , nmln(ji+1,jj) ) , jpkm1  )   ! ML (MAX of T-pts, bound by jpkm1) 
    695695            ikv = MIN(  MAX( 1, nmln(ji,jj) , nmln(ji,jj+1) ) , jpkm1  )   ! 
    696696            zbu = 0.5_wp * ( p_dzr(ji,jj,iku) + p_dzr(ji+1,jj  ,iku) ) 
    697697            zbv = 0.5_wp * ( p_dzr(ji,jj,ikv) + p_dzr(ji  ,jj+1,ikv) ) 
    698             !                          !- horizontal density gradient at u- & v-points 
     698            !                        !- horizontal density gradient at u- & v-points 
    699699            zau = p_gru(ji,jj,iku) / e1u(ji,jj) 
    700700            zav = p_grv(ji,jj,ikv) / e2v(ji,jj) 
    701             !                          !- bound the slopes: abs(zw.)<= 1/100 and zb..<0 
    702             !                                kxz max= ah slope max =< e1 e3 /(pi**2 2 dt) 
     701            !                        !- bound the slopes: abs(zw.)<= 1/100 and zb..<0 
     702            !                           kxz max= ah slope max =< e1 e3 /(pi**2 2 dt) 
    703703            zbu = MIN(  zbu , -100._wp* ABS( zau ) , -7.e+3_wp/fse3u(ji,jj,iku)* ABS( zau )  ) 
    704704            zbv = MIN(  zbv , -100._wp* ABS( zav ) , -7.e+3_wp/fse3v(ji,jj,ikv)* ABS( zav )  ) 
    705             !                          !- Slope at u- & v-points (uslpml, vslpml) 
     705            !                        !- Slope at u- & v-points (uslpml, vslpml) 
    706706            uslpml(ji,jj) = zau / ( zbu - zeps ) * umask(ji,jj,iku) 
    707707            vslpml(ji,jj) = zav / ( zbv - zeps ) * vmask(ji,jj,ikv) 
    708708            ! 
    709             !                    !==   i- & j-slopes at w-points just below the Mixed Layer   ==! 
     709            !                        !==   i- & j-slopes at w-points just below the Mixed Layer   ==! 
    710710            ! 
    711711            ik   = MIN( nmln(ji,jj) + 1, jpk ) 
    712712            ikm1 = MAX( 1, ik-1 ) 
    713             !                          !- vertical density gradient for w-slope (from N^2) 
     713            !                        !- vertical density gradient for w-slope (from N^2) 
    714714            zbw = zm1_2g * pn2 (ji,jj,ik) * ( prd (ji,jj,ik) + prd (ji,jj,ikm1) + 2. ) 
    715             !                          !- horizontal density i- & j-gradient at w-points 
     715            !                        !- horizontal density i- & j-gradient at w-points 
    716716            zci = MAX(   umask(ji-1,jj,ik  ) + umask(ji,jj,ik  )           & 
    717717               &       + umask(ji-1,jj,ikm1) + umask(ji,jj,ikm1) , zeps  ) * e1t(ji,jj) 
     
    722722            zaj =    (   p_grv(ji,jj-1,ik  ) + p_grv(ji,jj,ik  )           & 
    723723               &       + p_grv(ji,jj-1,ikm1) + p_grv(ji,jj,ikm1)  ) / zcj  * tmask(ji,jj,ik) 
    724             !                          !- bound the slopes: abs(zw.)<= 1/100 and zb..<0. 
    725             !                             kxz max= ah slope max =< e1 e3 /(pi**2 2 dt) 
     724            !                        !- bound the slopes: abs(zw.)<= 1/100 and zb..<0. 
     725            !                           kxz max= ah slope max =< e1 e3 /(pi**2 2 dt) 
    726726            zbi = MIN(  zbw , -100._wp* ABS( zai ) , -7.e+3_wp/fse3w(ji,jj,ik)* ABS( zai )  ) 
    727727            zbj = MIN(  zbw , -100._wp* ABS( zaj ) , -7.e+3_wp/fse3w(ji,jj,ik)* ABS( zaj )  ) 
    728             !                          !- i- & j-slope at w-points (wslpiml, wslpjml) 
     728            !                        !- i- & j-slope at w-points (wslpiml, wslpjml) 
    729729            wslpiml(ji,jj) = zai / ( zbi - zeps ) * tmask (ji,jj,ik) 
    730730            wslpjml(ji,jj) = zaj / ( zbj - zeps ) * tmask (ji,jj,ik) 
    731731         END DO 
    732732      END DO 
    733 !!gm this lbc_lnk should be useless.... 
     733      !!gm this lbc_lnk should be useless.... 
    734734      CALL lbc_lnk( uslpml , 'U', -1. )   ;   CALL lbc_lnk( vslpml , 'V', -1. )   ! lateral boundary cond. (sign change) 
    735735      CALL lbc_lnk( wslpiml, 'W', -1. )   ;   CALL lbc_lnk( wslpjml, 'W', -1. )   ! lateral boundary conditions 
     
    765765         IF( ln_dynldf_iso )   CALL ctl_stop( 'ldf_slp_init: Griffies operator on momentum not supported' ) 
    766766         ! 
    767          ! IF( ( ln_traldf_hor .OR. ln_dynldf_hor ) .AND. ln_sco )   & 
    768          !    CALL ctl_stop( 'ldf_slp_init: horizontal Griffies operator in s-coordinate not supported' ) 
    769          ! 
    770767      ELSE                             ! Madec operator : slopes at u-, v-, and w-points 
    771768         ALLOCATE( uslp(jpi,jpj,jpk) , vslp(jpi,jpj,jpk) , wslpi(jpi,jpj,jpk) , wslpj(jpi,jpj,jpk) ,                & 
     
    780777         wslpj(:,:,:) = 0._wp   ;   wslpjml(:,:) = 0._wp 
    781778 
    782 !!gm I no longer understand this..... 
     779         !!gm I no longer understand this..... 
    783780         IF( (ln_traldf_hor .OR. ln_dynldf_hor) .AND. .NOT. (lk_vvl .AND. ln_rstart) ) THEN 
    784781            IF(lwp)   WRITE(numout,*) '          Horizontal mixing in s-coordinate: slope = slope of s-surfaces' 
     
    813810   LOGICAL, PUBLIC, PARAMETER ::   lk_ldfslp = .FALSE.    !: slopes flag 
    814811CONTAINS 
    815    SUBROUTINE ldf_slp( kt, prd, pn2 )        ! Dummy routine 
     812   SUBROUTINE ldf_slp( kt, prd, pn2 )   ! Dummy routine 
    816813      INTEGER, INTENT(in) :: kt 
    817814      REAL, DIMENSION(:,:,:), INTENT(in) :: prd, pn2 
     
    822819      WRITE(*,*) 'ldf_slp_grif: You should not have seen this print! error?', kt 
    823820   END SUBROUTINE ldf_slp_grif 
    824    SUBROUTINE ldf_slp_init       ! Dummy routine 
     821   SUBROUTINE ldf_slp_init              ! Dummy routine 
    825822   END SUBROUTINE ldf_slp_init 
    826823#endif 
Note: See TracChangeset for help on using the changeset viewer.