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 11822 for NEMO/branches/2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps/src/ICE/icethd_do.F90 – NEMO

Ignore:
Timestamp:
2019-10-29T11:41:36+01:00 (4 years ago)
Author:
acc
Message:

Branch 2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps. Sette tested updates to branch to align with trunk changes between 10721 and 11740. Sette tests are passing but results differ from branch before these changes (except for GYRE_PISCES and VORTEX) and branch results already differed from trunk because of algorithmic fixes. Will need more checks to confirm correctness.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps/src/ICE/icethd_do.F90

    r10425 r11822  
    113113 
    114114      IF( ln_icediachk )   CALL ice_cons_hsm( 0, 'icethd_do', rdiag_v, rdiag_s, rdiag_t, rdiag_fv, rdiag_fs, rdiag_ft ) 
    115  
    116       CALL ice_var_agg(1) 
    117       CALL ice_var_glo2eqv 
    118  
     115      IF( ln_icediachk )   CALL ice_cons2D  ( 0, 'icethd_do',  diag_v,  diag_s,  diag_t,  diag_fv,  diag_fs,  diag_ft ) 
     116 
     117      at_i(:,:) = SUM( a_i, dim=3 ) 
    119118      !------------------------------------------------------------------------------! 
    120119      ! 1) Collection thickness of ice formed in leads and polynyas 
     
    130129 
    131130      ! Default new ice thickness 
    132       WHERE( qlead(:,:) < 0._wp )   ;   ht_i_new(:,:) = rn_hinew 
    133       ELSEWHERE                     ;   ht_i_new(:,:) = 0._wp 
     131      WHERE( qlead(:,:) < 0._wp  .AND. tau_icebfr(:,:) == 0._wp )   ;   ht_i_new(:,:) = rn_hinew ! if cooling and no landfast 
     132      ELSEWHERE                                                     ;   ht_i_new(:,:) = 0._wp 
    134133      END WHERE 
    135134 
     
    184183                  END DO 
    185184                  ! 
     185                  ! bound ht_i_new (though I don't see why it should be necessary) 
     186                  ht_i_new(ji,jj) = MAX( 0.01_wp, MIN( ht_i_new(ji,jj), hi_max(jpl) ) ) 
     187                  ! 
    186188               ENDIF 
    187189               ! 
     
    319321 
    320322         ! --- lateral ice growth --- ! 
    321          ! If lateral ice growth gives an ice concentration gt 1, then 
     323         ! If lateral ice growth gives an ice concentration > amax, then 
    322324         ! we keep the excessive volume in memory and attribute it later to bottom accretion 
    323325         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) ) 
     326            IF ( za_newice(ji) >  MAX( 0._wp, rn_amax_1d(ji) - at_i_1d(ji) ) ) THEN ! max is for roundoff error 
     327               zda_res(ji)   = za_newice(ji) - MAX( 0._wp, rn_amax_1d(ji) - at_i_1d(ji) ) 
    326328               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) 
     329               za_newice(ji) = MAX( 0._wp, za_newice(ji) - zda_res  (ji) ) 
     330               zv_newice(ji) = MAX( 0._wp, zv_newice(ji) - zdv_res  (ji) ) 
    329331            ELSE 
    330332               zda_res(ji) = 0._wp 
     
    419421      ! 
    420422      IF( ln_icediachk )   CALL ice_cons_hsm(1, 'icethd_do', rdiag_v, rdiag_s, rdiag_t, rdiag_fv, rdiag_fs, rdiag_ft) 
     423      IF( ln_icediachk )   CALL ice_cons2D  (1, 'icethd_do',  diag_v,  diag_s,  diag_t,  diag_fv,  diag_fs,  diag_ft) 
    421424      ! 
    422425   END SUBROUTINE ice_thd_do 
     
    442445      REWIND( numnam_ice_ref )              ! Namelist namthd_do in reference namelist : Ice thermodynamics 
    443446      READ  ( numnam_ice_ref, namthd_do, IOSTAT = ios, ERR = 901) 
    444 901   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namthd_do in reference namelist', lwp ) 
     447901   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namthd_do in reference namelist' ) 
    445448      REWIND( numnam_ice_cfg )              ! Namelist namthd_do in configuration namelist : Ice thermodynamics 
    446449      READ  ( numnam_ice_cfg, namthd_do, IOSTAT = ios, ERR = 902 ) 
    447 902   IF( ios >  0 )   CALL ctl_nam ( ios , 'namthd_do in configuration namelist', lwp ) 
     450902   IF( ios >  0 )   CALL ctl_nam ( ios , 'namthd_do in configuration namelist' ) 
    448451      IF(lwm) WRITE( numoni, namthd_do ) 
    449452      ! 
Note: See TracChangeset for help on using the changeset viewer.