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 11081 for NEMO/branches/UKMO/NEMO_4.0_mirror/src/ICE/icethd_do.F90 – NEMO

Ignore:
Timestamp:
2019-06-06T16:11:54+02:00 (5 years ago)
Author:
davestorkey
Message:

UKMO/NEMO_4.0_mirror : update to be a copy of rev 11079 of release-4.0.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/UKMO/NEMO_4.0_mirror/src/ICE/icethd_do.F90

    r10888 r11081  
    114114      IF( ln_icediachk )   CALL ice_cons_hsm( 0, 'icethd_do', rdiag_v, rdiag_s, rdiag_t, rdiag_fv, rdiag_fs, rdiag_ft ) 
    115115 
    116       CALL ice_var_agg(1) 
    117       CALL ice_var_glo2eqv 
    118  
     116      at_i(:,:) = SUM( a_i, dim=3 ) 
    119117      !------------------------------------------------------------------------------! 
    120118      ! 1) Collection thickness of ice formed in leads and polynyas 
     
    319317 
    320318         ! --- lateral ice growth --- ! 
    321          ! If lateral ice growth gives an ice concentration gt 1, then 
     319         ! If lateral ice growth gives an ice concentration > amax, then 
    322320         ! we keep the excessive volume in memory and attribute it later to bottom accretion 
    323321         DO ji = 1, npti 
    324             IF ( za_newice(ji) >  ( rn_amax_1d(ji) - at_i_1d(ji) ) ) THEN 
    325                zda_res(ji)   = za_newice(ji) - ( rn_amax_1d(ji) - at_i_1d(ji) ) 
     322            IF ( za_newice(ji) >  MAX( 0._wp, rn_amax_1d(ji) - at_i_1d(ji) ) ) THEN ! max is for roundoff error 
     323               zda_res(ji)   = za_newice(ji) - MAX( 0._wp, rn_amax_1d(ji) - at_i_1d(ji) ) 
    326324               zdv_res(ji)   = zda_res  (ji) * zh_newice(ji)  
    327                za_newice(ji) = za_newice(ji) - zda_res  (ji) 
    328                zv_newice(ji) = zv_newice(ji) - zdv_res  (ji) 
     325               za_newice(ji) = MAX( 0._wp, za_newice(ji) - zda_res  (ji) ) 
     326               zv_newice(ji) = MAX( 0._wp, zv_newice(ji) - zdv_res  (ji) ) 
    329327            ELSE 
    330328               zda_res(ji) = 0._wp 
Note: See TracChangeset for help on using the changeset viewer.