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

Changeset 1484


Ignore:
Timestamp:
2009-07-06T14:22:44+02:00 (15 years ago)
Author:
smasson
Message:

bugfix in 300m heat contain, see ticket:342

File:
1 edited

Legend:

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

    r1482 r1484  
    6969      INTEGER, DIMENSION(jpi,jpj) ::   ikc 
    7070 
    71       REAL(wp) :: zd, zmoy              ! temporary scalars 
     71      REAL(wp) :: zd, zmoy, zthick_0, zcoef              ! temporary scalars 
    7272      REAL(wp), DIMENSION(jpi) ::   zmax 
     73      REAL(wp), DIMENSION(jpi,jpj) ::   zthick 
    7374      REAL(wp), DIMENSION(jpi,jpk) ::   zdzt 
    7475      !!---------------------------------------------------------------------- 
     
    198199      ! ----------------------------------------- ! 
    199200 
    200       htc3(:,:) = 0.e0 
    201       ilevel = 18 
    202       zmoy = rau0 * rcp * 0.5 
    203        
    204       ! intregrate tn from surface to klevel 
    205  
     201      ! find ilevel with (ilevel+1) the deepest W-level above 300m (we assume we can use e3t_0 to do this search...) 
     202      ilevel = 0 
     203      zthick_0 = 0.e0 
     204      DO jk = 1, jpk-1                         
     205         zthick_0 = zthick_0 + e3t_0(jk) 
     206         IF( zthick_0 < 300. )   ilevel = jk 
     207      END DO 
     208      ! surface boundary condition 
     209      IF( lk_vvl ) THEN   ;   zthick(:,:) = 0.e0        ;   htc3(:,:) = 0.e0                                      
     210      ELSE                ;   zthick(:,:) = sshn(:,:)   ;   htc3(:,:) = tn(:,:,jk) * sshn(:,:) * tmask(:,:,jk)    
     211      ENDIF 
     212      ! integration down to ilevel 
    206213      DO jk = 1, ilevel 
    207                htc3(:,:) = htc3(:,:)   & 
    208                          + zmoy * ( tn(:,:,jk) + tn(:,:,jk+1) ) * fse3w(:,:,jk) * tmask(:,:,jk) 
    209       END DO 
     214         zthick(:,:) = zthick(:,:) + fse3t(:,:,jk) 
     215         htc3  (:,:) = htc3  (:,:) + fse3t(:,:,jk) * tn(:,:,jk) * tmask(:,:,jk) 
     216      END DO 
     217      ! deepest layer 
     218      zthick(:,:) = 300. - zthick(:,:)   !   remaining thickness to reach 300m 
     219      htc3(:,:) = htc3(:,:) + tn(:,:,ilevel+1) * MIN( fse3t(:,:,ilevel+1), zthick(:,:) ) * tmask(:,:,ilevel+1) 
     220      ! from temperature to heat contain 
     221      zcoef = rau0 * rcp 
     222      htc3(:,:) = zcoef * htc3(:,:) 
    210223      CALL iom_put( "hc300", htc3 )   ! first 300m heaat content 
    211224 
Note: See TracChangeset for help on using the changeset viewer.