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 3820 for branches/2012 – NEMO

Changeset 3820 for branches/2012


Ignore:
Timestamp:
2013-02-21T18:58:13+01:00 (11 years ago)
Author:
hliu
Message:

add the 2D-enhancement for loglayer bfr coefficient. see ticket 1058

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfbfr.F90

    r3764 r3820  
    8787      INTEGER  ::   ji, jj                       ! dummy loop indices 
    8888      INTEGER  ::   ikbu, ikbv                   ! local integers 
    89       REAL(wp) ::   zvu, zuv, zecu, zecv, ztmp   ! temporary scalars 
     89      REAL(wp) ::   zvu, zuv, zecu, zecv         ! temporary scalars 
     90      REAL(wp) ::   ztmp, ztmp1                  ! temporary scalars 
    9091      !!---------------------------------------------------------------------- 
    9192      ! 
     
    100101 
    101102         IF(ln_loglayer) THEN       ! "log layer" bottom friction coefficient 
     103 
     104           ! add 2D-enhancement bottom friction 
     105           ztmp1 = 1._wp 
     106           IF(ABS(rn_bfri2) >= 1.e-10 ) THEN 
     107             ztmp1 = 1._wp / rn_bfri2 
     108           ELSE 
     109             CALL ctl_stop( 'rn_bfri2 must not be less than 1.e-10') 
     110           END IF 
     111 
    102112#  if defined key_vectopt_loop 
    103113           DO jj = 1, 1 
     
    108118#  endif 
    109119                ztmp = 0.5_wp * fse3t(ji,jj,mbkt(ji,jj)) 
    110                 ztmp = max(ztmp, rn_bfrz0) 
    111                 bfrcoef2d(ji,jj) = ( log( ztmp / rn_bfrz0 ) / vkarmn ) ** (-2) 
     120                ztmp = max(ztmp, rn_bfrz0 + 1.e-10) 
     121                bfrcoef2d(ji,jj) = bfrcoef2d(ji,jj) * ztmp1 * & 
     122                                 & ( log( ztmp / rn_bfrz0 ) / vkarmn ) ** (-2) 
    112123             END DO 
    113124           END DO 
     
    251262         ! 
    252263      END SELECT 
     264 
     265      IF( nn_bfr /= 2 .AND. ln_loglayer ) THEN 
     266         IF(lwp) THEN 
     267            WRITE(numout,*) 
     268            WRITE(numout,*) 'Loglayer can only be by applied for quadratic bottom friction'  
     269            WRITE(numout,*) 'but you have set: nn_bfr /= 2 and ln_loglayer=.true.!!!!' 
     270            WRITE(ctmp1,*)  'check nn_bfr and ln_loglayer (should be 2 and true)' 
     271            CALL ctl_stop( ctmp1 ) 
     272         END IF 
     273      END IF 
     274 
     275 
     276 
    253277      IF(lwp) WRITE(numout,*) '      implicit bottom friction switch                ln_bfrimp  = ', ln_bfrimp 
    254278      ! 
Note: See TracChangeset for help on using the changeset viewer.