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 5208 for branches/2014/dev_r4650_UKMO11_restart_functionality/NEMOGCM/NEMO/LIM_SRC_3/limthd_ent.F90 – NEMO

Ignore:
Timestamp:
2015-04-13T15:08:59+02:00 (9 years ago)
Author:
davestorkey
Message:

Merge in changes from trunk up to 5021.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2014/dev_r4650_UKMO11_restart_functionality/NEMOGCM/NEMO/LIM_SRC_3/limthd_ent.F90

    r4688 r5208  
    3838   PUBLIC   lim_thd_ent         ! called by limthd and limthd_lac 
    3939 
    40    REAL(wp) :: epsi20 = 1.e-20   ! constant values 
    41    REAL(wp) :: epsi10 = 1.e-10   ! constant values 
    42  
    4340   !!---------------------------------------------------------------------- 
    4441   !! NEMO/LIM3 4.0 , UCL - NEMO Consortium (2011) 
     
    7976      INTEGER  :: ji         !  dummy loop indices 
    8077      INTEGER  :: jk0, jk1   !  old/new layer indices 
    81       REAL(wp) :: zswitch 
    8278      ! 
    8379      REAL(wp), POINTER, DIMENSION(:,:) :: zqh_cum0, zh_cum0   ! old cumulative enthlapies and layers interfaces 
     
    137133      DO jk1 = 1, nlay_i 
    138134         DO ji = kideb, kiut 
    139             zswitch      = 1._wp - MAX( 0._wp , SIGN( 1._wp , - zhnew(ji) + epsi10 ) )  
    140             qnew(ji,jk1) = zswitch * ( zqh_cum1(ji,jk1) - zqh_cum1(ji,jk1-1) ) / MAX( zhnew(ji), epsi10 ) 
     135            rswitch      = 1._wp - MAX( 0._wp , SIGN( 1._wp , - zhnew(ji) + epsi10 ) )  
     136            qnew(ji,jk1) = rswitch * ( zqh_cum1(ji,jk1) - zqh_cum1(ji,jk1-1) ) / MAX( zhnew(ji), epsi10 ) 
    141137         ENDDO 
    142138      ENDDO 
     
    146142      ! then we should not (* a_i) again but not important since this is just to check that remap error is ~0 
    147143      DO ji = kideb, kiut 
    148          hfx_err_rem_1d(ji) = hfx_err_rem_1d(ji) + a_i_b(ji) * r1_rdtice *  & 
     144         hfx_err_rem_1d(ji) = hfx_err_rem_1d(ji) + a_i_1d(ji) * r1_rdtice *  & 
    149145            &               ( SUM( qnew(ji,1:nlay_i) ) * zhnew(ji) - SUM( qh_i_old(ji,0:nlay_i+1) ) )  
    150146      END DO 
Note: See TracChangeset for help on using the changeset viewer.