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 6219 – NEMO

Changeset 6219


Ignore:
Timestamp:
2016-01-06T16:39:17+01:00 (8 years ago)
Author:
hadcv
Message:

Quick fix to omit the iso-layer calculation when rn_iso_frac = 0.

The finite-difference part of the iso-layer calculation currently has the following bugs:

  • Only the first subsequent level beneath the iso-layer is considered
  • If z(ik_iso) < rn_zref, the interpolation can result in a MLD shallower than rn_zref
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/UKMO/dev_r5107_mld_zint/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfmxl.F90

    r6072 r6219  
    193193 
    194194      ! Local variables 
     195      REAL(wp), PARAMETER :: zepsilon = 1.e-30          ! local small value 
    195196      INTEGER, POINTER, DIMENSION(:,:) :: ikmt          ! number of active tracer levels  
    196197      INTEGER, POINTER, DIMENSION(:,:) :: ik_ref        ! index of reference level  
     
    268269      ikmt(:,:) = mbathy(:,:) - 1  
    269270 
    270       ! Search for a uniform density/temperature region where adjacent levels           
    271       ! differ by less than rn_iso_frac * deltaT.                                       
    272       ! ik_iso is the index of the last level in the uniform layer   
    273       ! ll_found indicates whether the mixed layer depth can be found by interpolation  
    274       ik_iso(:,:)   = ik_ref(:,:)  
    275       ll_found(:,:) = .false.  
    276       DO jj = 1, nlcj  
    277          DO ji = 1, nlci  
     271      IF ( rn_iso_frac - zepsilon > 0. ) THEN 
     272         ! Search for a uniform density/temperature region where adjacent levels           
     273         ! differ by less than rn_iso_frac * deltaT.                                       
     274         ! ik_iso is the index of the last level in the uniform layer   
     275         ! ll_found indicates whether the mixed layer depth can be found by interpolation  
     276         ik_iso(:,:)   = ik_ref(:,:)  
     277         ll_found(:,:) = .false.  
     278         DO jj = 1, nlcj  
     279            DO ji = 1, nlci  
    278280!CDIR NOVECTOR  
    279             DO jk = ik_ref(ji,jj), ikmt(ji,jj)-1  
    280                IF ( zmoddT(ji,jj,jk) > ( rn_iso_frac * zdelta_T(ji,jj) ) ) THEN  
    281                   ik_iso(ji,jj)   = jk  
    282                   ll_found(ji,jj) = ( zmoddT(ji,jj,jk) > zdelta_T(ji,jj) )  
    283                   EXIT  
     281               DO jk = ik_ref(ji,jj), ikmt(ji,jj)-1  
     282                  IF ( zmoddT(ji,jj,jk) > ( rn_iso_frac * zdelta_T(ji,jj) ) ) THEN  
     283                     ik_iso(ji,jj)   = jk  
     284                     ll_found(ji,jj) = ( zmoddT(ji,jj,jk) > zdelta_T(ji,jj) )  
     285                     EXIT  
     286                  END IF  
     287               END DO  
     288            END DO  
     289         END DO  
     290 
     291         ! Use linear interpolation to find depth of mixed layer base where possible  
     292         hmld_zint(:,:) = rn_zref  
     293         DO jj = 1, jpj  
     294            DO ji = 1, jpi  
     295               IF (ll_found(ji,jj) .and. tmask(ji,jj,1) == 1.0) THEN  
     296                  zdz =  abs( zdelta_T(ji,jj) / zdTdz(ji,jj,ik_iso(ji,jj)) )  
     297                  hmld_zint(ji,jj) = fsdept(ji,jj,ik_iso(ji,jj)) + zdz  
    284298               END IF  
    285299            END DO  
    286300         END DO  
    287       END DO  
    288  
    289       ! Use linear interpolation to find depth of mixed layer base where possible  
    290       hmld_zint(:,:) = rn_zref  
    291       DO jj = 1, jpj  
    292          DO ji = 1, jpi  
    293             IF (ll_found(ji,jj) .and. tmask(ji,jj,1) == 1.0) THEN  
    294                zdz =  abs( zdelta_T(ji,jj) / zdTdz(ji,jj,ik_iso(ji,jj)) )  
    295                hmld_zint(ji,jj) = fsdept(ji,jj,ik_iso(ji,jj)) + zdz  
    296             END IF  
    297          END DO  
    298       END DO  
     301      END IF 
    299302 
    300303      ! If ll_found = .false. then calculate MLD using difference of zdelta_T     
Note: See TracChangeset for help on using the changeset viewer.