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

Ignore:
Timestamp:
2016-01-08T10:35:19+01:00 (8 years ago)
Author:
jamesharle
Message:

Update MPP_BDY_UPDATE branch to be consistent with head of trunk

File:
1 edited

Legend:

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

    r4688 r6225  
    2525   USE sbc_oce        ! Surface boundary condition: ocean fields 
    2626   USE ice            ! LIM variables 
    27    USE par_ice        ! LIM parameters 
    2827   USE thd_ice        ! LIM thermodynamics 
    2928   USE limvar         ! LIM variables 
     
    3736 
    3837   PUBLIC   lim_thd_ent         ! called by limthd and limthd_lac 
    39  
    40    REAL(wp) :: epsi20 = 1.e-20   ! constant values 
    41    REAL(wp) :: epsi10 = 1.e-10   ! constant values 
    4238 
    4339   !!---------------------------------------------------------------------- 
     
    7975      INTEGER  :: ji         !  dummy loop indices 
    8076      INTEGER  :: jk0, jk1   !  old/new layer indices 
    81       REAL(wp) :: zswitch 
    8277      ! 
    8378      REAL(wp), POINTER, DIMENSION(:,:) :: zqh_cum0, zh_cum0   ! old cumulative enthlapies and layers interfaces 
     
    9186 
    9287      !-------------------------------------------------------------------------- 
    93       !  1) Cumulative integral of old enthalpy * thicnkess and layers interfaces 
     88      !  1) Cumulative integral of old enthalpy * thickness and layers interfaces 
    9489      !-------------------------------------------------------------------------- 
    9590      zqh_cum0(:,0:nlay_i+2) = 0._wp  
     
    107102      ! new layer thickesses 
    108103      DO ji = kideb, kiut 
    109          zhnew(ji) = SUM( h_i_old(ji,0:nlay_i+1) ) / REAL( nlay_i )   
     104         zhnew(ji) = SUM( h_i_old(ji,0:nlay_i+1) ) * r1_nlay_i   
    110105      ENDDO 
    111106 
     
    137132      DO jk1 = 1, nlay_i 
    138133         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 ) 
     134            rswitch      = MAX( 0._wp , SIGN( 1._wp , zhnew(ji) - epsi20 ) )  
     135            qnew(ji,jk1) = rswitch * ( zqh_cum1(ji,jk1) - zqh_cum1(ji,jk1-1) ) / MAX( zhnew(ji), epsi20 ) 
    141136         ENDDO 
    142137      ENDDO 
     
    146141      ! then we should not (* a_i) again but not important since this is just to check that remap error is ~0 
    147142      DO ji = kideb, kiut 
    148          hfx_err_rem_1d(ji) = hfx_err_rem_1d(ji) + a_i_b(ji) * r1_rdtice *  & 
     143         hfx_err_rem_1d(ji) = hfx_err_rem_1d(ji) + a_i_1d(ji) * r1_rdtice *  & 
    149144            &               ( SUM( qnew(ji,1:nlay_i) ) * zhnew(ji) - SUM( qh_i_old(ji,0:nlay_i+1) ) )  
    150145      END DO 
Note: See TracChangeset for help on using the changeset viewer.