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

Changeset 1486


Ignore:
Timestamp:
2009-07-07T12:09:51+02:00 (15 years ago)
Author:
smasson
Message:

additional bug fix associated with changeset:1485, see ticket:468

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/NEMO/OPA_SRC/DIA/diahth.F90

    r1485 r1486  
    101101      ! ----------------------- ! 
    102102       
    103       ! search last level above 20C 
    104       ikc(:,:) = COUNT( tn >= 20., dim = 3 ) 
     103      ! search last level above 20C (beware temperature is not always decreasing with depth) 
     104      ikc(:,:) = MAXLOC( fsdept(:,:,1:jpkm1), mask = tn(:,:,1:jpkm1) >= 20., dim = 3 )   !   ikc = 0 if mask always equal to false 
    105105      ! Depth of 20C isotherm, linear interpolation 
    106106      DO jj = 1, jpj 
    107107         DO ji = 1, jpi 
    108             iid = MAX(1, ikc(ji,jj)) 
     108            iid = MAX( 1, ikc(ji,jj) )    ! make sure that iid /= 0 (these points are masked later) 
    109109            zd = fsdept(ji,jj,iid) + (    fsdept(ji,jj,iid+1) - fsdept(ji,jj,iid)                           )   & 
    110110               &                   * ( 20.*tmask(ji,jj,iid+1) -     tn(ji,jj,iid)                           )   & 
     
    115115         END DO 
    116116      END DO 
    117       WHERE(ikc == 0 )   hd20 = 0.e0 
     117      WHERE(ikc == 0 )   hd20 = 0.e0      ! set to 0 points where tn is always < 20 (not very good for temporal mean...) 
    118118      CALL iom_put( "20d", hd20 )         ! depth of the 20 isotherm 
    119119 
     
    122122      ! ----------------------- ! 
    123123       
    124       ! search last level above 28C 
    125       ikc(:,:) = COUNT( tn >= 28., dim = 3 ) 
     124      ! search last level above 28C (beware temperature is not always decreasing with depth) 
     125      ikc(:,:) = MAXLOC( fsdept(:,:,1:jpkm1), mask = tn(:,:,1:jpkm1) >= 28., dim = 3 )   !   ikc = 0 if mask always equal to false 
    126126      ! Depth of 28C isotherm, linear interpolation 
    127127      DO jj = 1, jpj 
    128128         DO ji = 1, jpi 
    129             iid = MAX(1, ikc(ji,jj)) 
     129            iid = MAX( 1, ikc(ji,jj) )    ! make sure that iid /= 0 (these points are masked later) 
    130130            zd = fsdept(ji,jj,iid) + (    fsdept(ji,jj,iid+1) - fsdept(ji,jj,iid)                           )   & 
    131131               &                   * ( 28.*tmask(ji,jj,iid+1) -     tn(ji,jj,iid)                           )   & 
     
    136136         END DO 
    137137      END DO 
    138       WHERE(ikc == 0 )   hd28 = 0.e0 
     138      WHERE(ikc == 0 )   hd28 = 0.e0      ! set to 0 points where tn is always < 28 (not very good for temporal mean...) 
    139139      CALL iom_put( "28d", hd28 )         ! depth of the 28 isotherm 
    140140 
     
    146146      ilevel = 0 
    147147      zthick_0 = 0.e0 
    148       DO jk = 1, jpk-1                         
     148      DO jk = 1, jpkm1                       
    149149         zthick_0 = zthick_0 + e3t_0(jk) 
    150150         IF( zthick_0 < 300. )   ilevel = jk 
Note: See TracChangeset for help on using the changeset viewer.