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_dh.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_dh.F90

    r10534 r11822  
    614614      DO jk = 1, nlay_s 
    615615         DO ji = 1,npti 
    616             ! mask enthalpy 
    617             rswitch       = 1._wp - MAX(  0._wp , SIGN( 1._wp, - h_s_1d(ji) )  ) 
     616            ! where there is no ice or no snow 
     617            rswitch = ( 1._wp - MAX( 0._wp, SIGN( 1._wp, - h_s_1d(ji) ) ) ) * ( 1._wp - MAX( 0._wp, SIGN(1._wp, - h_i_1d(ji) ) ) ) 
     618            ! mass & energy loss to the ocean 
     619            hfx_res_1d(ji) = hfx_res_1d(ji) + ( 1._wp - rswitch ) * & 
     620               &                              ( e_s_1d(ji,jk) * h_s_1d(ji) * r1_nlay_s * a_i_1d(ji) * r1_rdtice )  ! heat flux to the ocean [W.m-2], < 0 
     621            wfx_res_1d(ji) = wfx_res_1d(ji) + ( 1._wp - rswitch ) * & 
     622               &                              ( rhos          * h_s_1d(ji) * r1_nlay_s * a_i_1d(ji) * r1_rdtice )  ! mass flux 
     623            ! update energy (mass is updated in the next loop) 
    618624            e_s_1d(ji,jk) = rswitch * e_s_1d(ji,jk) 
    619625            ! recalculate t_s_1d from e_s_1d 
     
    622628      END DO 
    623629 
    624       ! --- ensure that a_i = 0 where h_i = 0 --- 
    625       WHERE( h_i_1d(1:npti) == 0._wp )   a_i_1d(1:npti) = 0._wp 
     630      ! --- ensure that a_i = 0 & h_s = 0 where h_i = 0 --- 
     631      WHERE( h_i_1d(1:npti) == 0._wp )    
     632         a_i_1d(1:npti) = 0._wp 
     633         h_s_1d(1:npti) = 0._wp 
     634      END WHERE 
    626635      ! 
    627636   END SUBROUTINE ice_thd_dh 
Note: See TracChangeset for help on using the changeset viewer.