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 4672 for branches/2013/dev_r4028_CNRS_LIM3/NEMOGCM/NEMO/LIM_SRC_3/limthd_ent.F90 – NEMO

Ignore:
Timestamp:
2014-06-17T17:06:59+02:00 (10 years ago)
Author:
clem
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2013/dev_r4028_CNRS_LIM3/NEMOGCM/NEMO/LIM_SRC_3/limthd_ent.F90

    r4649 r4672  
    3636   PRIVATE 
    3737 
    38    PUBLIC   lim_thd_ent         ! called by lim_thd 
     38   PUBLIC   lim_thd_ent         ! called by limthd and limthd_lac 
    3939 
    4040   REAL(wp) :: epsi20 = 1.e-20   ! constant values 
     
    4848CONTAINS 
    4949  
    50    SUBROUTINE lim_thd_ent( kideb, kiut, jl, qnew ) 
     50   SUBROUTINE lim_thd_ent( kideb, kiut, qnew ) 
    5151      !!------------------------------------------------------------------- 
    5252      !!               ***   ROUTINE lim_thd_ent  *** 
     
    7474      !!------------------------------------------------------------------- 
    7575      INTEGER , INTENT(in) ::   kideb, kiut   ! Start/End point on which the  the computation is applied 
    76       INTEGER , INTENT(in) ::   jl            ! Thickness cateogry number 
    7776 
    78       REAL(wp), INTENT(inout), DIMENSION(:,:) :: qnew          ! new enthlapies (remapped) 
     77      REAL(wp), INTENT(inout), DIMENSION(:,:) :: qnew          ! new enthlapies (J.m-3, remapped) 
    7978 
    80       INTEGER  :: ji,ii,ij   !  dummy loop indices 
     79      INTEGER  :: ji         !  dummy loop indices 
    8180      INTEGER  :: jk0, jk1   !  old/new layer indices 
    82       REAL(wp) :: ztmelts    ! temperature of melting 
    83       REAL(wp) :: zswitch, zaaa, zbbb, zccc, zdiscrim ! converting enthalpy to temperature 
     81      REAL(wp) :: zswitch 
    8482      ! 
    8583      REAL(wp), POINTER, DIMENSION(:,:) :: zqh_cum0, zh_cum0   ! old cumulative enthlapies and layers interfaces 
     
    139137      DO jk1 = 1, nlay_i 
    140138         DO ji = kideb, kiut 
    141             zswitch      =  1._wp - MAX( 0._wp , SIGN( 1._wp , - zhnew(ji) + epsi10 ) )  
     139            zswitch      = 1._wp - MAX( 0._wp , SIGN( 1._wp , - zhnew(ji) + epsi10 ) )  
    142140            qnew(ji,jk1) = zswitch * ( zqh_cum1(ji,jk1) - zqh_cum1(ji,jk1-1) ) / MAX( zhnew(ji), epsi10 ) 
    143141         ENDDO 
    144142      ENDDO 
     143 
     144      ! --- diag error on heat remapping --- ! 
     145      ! comment: if input h_i_old and qh_i_old are already multiplied by a_i (as in limthd_lac),  
     146      ! then we should not (* a_i) again but not important since this is just to check that remap error is ~0 
     147      DO ji = kideb, kiut 
     148         hfx_err_rem_1d(ji) = hfx_err_rem_1d(ji) + a_i_b(ji) * r1_rdtice *  & 
     149            &               ( SUM( qnew(ji,1:nlay_i) ) * zhnew(ji) - SUM( qh_i_old(ji,0:nlay_i+1) ) )  
     150      END DO 
     151       
    145152      ! 
    146153      CALL wrk_dealloc( jpij, nlay_i+3, zqh_cum0, zh_cum0, kjstart = 0 ) 
Note: See TracChangeset for help on using the changeset viewer.