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 5202 for trunk/NEMOGCM/NEMO/LIM_SRC_3/limthd.F90 – NEMO

Ignore:
Timestamp:
2015-04-07T17:40:16+02:00 (9 years ago)
Author:
clem
Message:

LIM3: important bug fix to avoid crashes. See ticket #1508

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/NEMOGCM/NEMO/LIM_SRC_3/limthd.F90

    r5167 r5202  
    8989      REAL(wp) :: zfric_u, zqld, zqfr 
    9090      REAL(wp) :: zvi_b, zsmv_b, zei_b, zfs_b, zfw_b, zft_b  
    91       REAL(wp), PARAMETER :: zfric_umin = 0._wp        ! lower bound for the friction velocity (cice value=5.e-04) 
    92       REAL(wp), PARAMETER :: zch        = 0.0057_wp    ! heat transfer coefficient 
     91      REAL(wp), PARAMETER :: zfric_umin = 0._wp           ! lower bound for the friction velocity (cice value=5.e-04) 
     92      REAL(wp), PARAMETER :: zch        = 0.0057_wp       ! heat transfer coefficient 
    9393      ! 
    9494      REAL(wp), POINTER, DIMENSION(:,:) ::  zqsr, zqns 
     
    353353      END DO 
    354354  
    355       !------------------------ 
    356       ! Ice natural aging               
    357       !------------------------ 
    358       oa_i(:,:,:) = oa_i(:,:,:) + a_i(:,:,:) * rdt_ice /rday 
    359  
    360355      !---------------------------------- 
    361356      ! Change thickness to volume 
     
    365360      smv_i(:,:,:) = sm_i(:,:,:) * v_i(:,:,:) 
    366361 
     362      ! update ice age (in case a_i changed, i.e. becomes 0 or lateral melting in monocat) 
     363      DO jl  = 1, jpl 
     364         DO jj = 1, jpj 
     365            DO ji = 1, jpi 
     366               rswitch = MAX( 0._wp , SIGN( 1._wp, a_i_b(ji,jj,jl) - epsi10 ) ) 
     367               oa_i(ji,jj,jl) = rswitch * oa_i(ji,jj,jl) * a_i(ji,jj,jl) / MAX( a_i_b(ji,jj,jl), epsi10 ) 
     368            END DO 
     369         END DO 
     370      END DO 
     371 
    367372      CALL lim_var_zapsmall 
     373 
    368374      !-------------------------------------------- 
    369375      ! Diagnostic thermodynamic growth rates 
Note: See TracChangeset for help on using the changeset viewer.