Changeset 12701


Ignore:
Timestamp:
2020-04-07T10:27:23+02:00 (7 months ago)
Author:
orioltp
Message:

Added few more sea-ice related fixes.

Location:
NEMO/branches/2020/dev_r12512_HPC-04_mcastril_Mixed_Precision_implementation/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2020/dev_r12512_HPC-04_mcastril_Mixed_Precision_implementation/src/ICE/iceitd.F90

    r12377 r12701  
    148148               !    Note: hn(t+1) must not be too close to either HR or HL otherwise a division by nearly 0 is possible  
    149149               !          in itd_glinear in the case (HR-HL) = 3(Hice - HL) or = 3(HR - Hice) 
     150# if defined key_single 
     151               IF( a_i_2d(ji,jl  ) > epsi10 .AND. h_i_2d(ji,jl  ) > ( zhbnew(ji,jl) - epsi06 ) )   nptidx(ji) = 0 
     152               IF( a_i_2d(ji,jl+1) > epsi10 .AND. h_i_2d(ji,jl+1) < ( zhbnew(ji,jl) + epsi06 ) )   nptidx(ji) = 0 
     153# else 
    150154               IF( a_i_2d(ji,jl  ) > epsi10 .AND. h_i_2d(ji,jl  ) > ( zhbnew(ji,jl) - epsi10 ) )   nptidx(ji) = 0 
    151155               IF( a_i_2d(ji,jl+1) > epsi10 .AND. h_i_2d(ji,jl+1) < ( zhbnew(ji,jl) + epsi10 ) )   nptidx(ji) = 0 
     156# endif 
    152157               ! 
    153158               ! 2) Hn-1 < Hn* < Hn+1   
     
    170175            !    h1(t) must not be too close to either HR or HL otherwise a division by nearly 0 is possible  
    171176            !    in itd_glinear in the case (HR-HL) = 3(Hice - HL) or = 3(HR - Hice) 
     177# if defined key_single 
     178            IF( h_ib_2d(ji,1) < ( hi_max(0) + epsi06 ) )   nptidx(ji) = 0 
     179            IF( h_ib_2d(ji,1) > ( hi_max(1) - epsi06 ) )   nptidx(ji) = 0 
     180# else 
    172181            IF( h_ib_2d(ji,1) < ( hi_max(0) + epsi10 ) )   nptidx(ji) = 0 
    173182            IF( h_ib_2d(ji,1) > ( hi_max(1) - epsi10 ) )   nptidx(ji) = 0 
     183# endif 
    174184         END DO 
    175185         ! 
     
    538548      ! 4) Update ice thickness and temperature 
    539549      !------------------------------------------------------------------------------- 
     550# if defined SINGLE_PRECISION 
     551      WHERE( a_i_2d(1:npti,:) >= epsi06 ) 
     552# else 
    540553      WHERE( a_i_2d(1:npti,:) >= epsi20 ) 
     554# endif 
    541555         h_i_2d (1:npti,:)  =  v_i_2d(1:npti,:) / a_i_2d(1:npti,:)  
    542556         t_su_2d(1:npti,:)  =  zaTsfn(1:npti,:) / a_i_2d(1:npti,:)  
  • NEMO/branches/2020/dev_r12512_HPC-04_mcastril_Mixed_Precision_implementation/src/ICE/icethd.F90

    r12546 r12701  
    218218                              CALL ice_thd_dh                           ! Ice-Snow thickness    
    219219                              CALL ice_thd_pnd                          ! Melt ponds formation 
    220                               CALL ice_thd_ent( e_i_1d(1:npti,:) )      ! Ice enthalpy remapping 
     220                              CALL ice_thd_ent( e_i_1d(1:npti,:), .true. )      ! Ice enthalpy remapping 
    221221            ENDIF 
    222222                              CALL ice_thd_sal( ln_icedS )          ! --- Ice salinity --- !     
  • NEMO/branches/2020/dev_r12512_HPC-04_mcastril_Mixed_Precision_implementation/src/ICE/icethd_do.F90

    r12546 r12701  
    385385            END DO 
    386386            ! --- Ice enthalpy remapping --- ! 
    387             CALL ice_thd_ent( ze_i_2d(1:npti,:,jl) )  
     387            CALL ice_thd_ent( ze_i_2d(1:npti,:,jl), .false. )  
    388388         END DO 
    389389 
  • NEMO/branches/2020/dev_r12512_HPC-04_mcastril_Mixed_Precision_implementation/src/ICE/icethd_ent.F90

    r12489 r12701  
    3838CONTAINS 
    3939  
    40    SUBROUTINE ice_thd_ent( qnew ) 
     40   SUBROUTINE ice_thd_ent( qnew, compute_hfx_err ) 
    4141      !!------------------------------------------------------------------- 
    4242      !!               ***   ROUTINE ice_thd_ent  *** 
     
    6464      !!------------------------------------------------------------------- 
    6565      REAL(wp), DIMENSION(:,:), INTENT(inout) ::   qnew             ! new enthlapies (J.m-3, remapped) 
     66      LOGICAL, INTENT(in)                     ::   compute_hfx_err  ! determines whether to compute diag. 
     67                                                                    ! error or not 
    6668      ! 
    6769      INTEGER  :: ji         !  dummy loop indices 
     
    128130      ! comment: if input h_i_old and eh_i_old are already multiplied by a_i (as in icethd_do),  
    129131      ! then we should not (* a_i) again but not important since this is just to check that remap error is ~0 
    130       DO ji = 1, npti 
    131          hfx_err_rem_1d(ji) = hfx_err_rem_1d(ji) + a_i_1d(ji) * r1_Dt_ice *  & 
    132             &               ( SUM( qnew(ji,1:nlay_i) ) * zhnew(ji) - SUM( eh_i_old(ji,0:nlay_i+1) ) )  
    133       END DO 
    134        
     132      IF( compute_hfx_err ) THEN 
     133         DO ji = 1, npti 
     134            hfx_err_rem_1d(ji) = hfx_err_rem_1d(ji) + a_i_1d(ji) * r1_rdtice *  & 
     135               &               ( SUM( qnew(ji,1:nlay_i) ) * zhnew(ji) - SUM( eh_i_old(ji,0:nlay_i+1) ) ) 
     136         END DO 
     137      END IF 
     138  
    135139   END SUBROUTINE ice_thd_ent 
    136140 
  • NEMO/branches/2020/dev_r12512_HPC-04_mcastril_Mixed_Precision_implementation/src/OCE/ZDF/zdftke.F90

    r12489 r12701  
    305305         DO_3D_00_00( 2, jpkm1 ) 
    306306            !                             ! local Richardson number 
    307             zri = MAX( rn2b(ji,jj,jk), 0._wp ) * p_avm(ji,jj,jk) / ( p_sh2(ji,jj,jk) + rn_bshear ) 
     307            IF (rn2b(ji,jj,jk) <= 0.0_wp) then 
     308                zri = 0.0_wp 
     309            ELSE 
     310                zri = rn2b(ji,jj,jk) * p_avm(ji,jj,jk) / ( p_sh2(ji,jj,jk) + rn_bshear ) 
     311            ENDIF 
    308312            !                             ! inverse of Prandtl number 
    309313            apdlr(ji,jj,jk) = MAX(  0.1_wp,  ri_cri / MAX( ri_cri , zri )  ) 
Note: See TracChangeset for help on using the changeset viewer.