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 14037 for NEMO/branches/2020/dev_r13333_KERNEL-08_techene_gm_HPG_SPG/src/ICE/iceitd.F90 – NEMO

Ignore:
Timestamp:
2020-12-03T12:20:38+01:00 (3 years ago)
Author:
ayoung
Message:

Updated to trunk at 14020. Sette tests passed with change of results for configurations with non-linear ssh. Ticket #2506.

Location:
NEMO/branches/2020/dev_r13333_KERNEL-08_techene_gm_HPG_SPG
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2020/dev_r13333_KERNEL-08_techene_gm_HPG_SPG

    • Property svn:externals
      •  

        old new  
        88 
        99# SETTE 
        10 ^/utils/CI/sette@13292        sette 
         10^/utils/CI/sette_wave@13990         sette 
  • NEMO/branches/2020/dev_r13333_KERNEL-08_techene_gm_HPG_SPG/src/ICE/iceitd.F90

    r13295 r14037  
    2929   USE lib_fortran    ! fortran utilities (glob_sum + no signed zero) 
    3030   USE prtctl         ! Print control 
     31   USE timing         ! Timing 
    3132 
    3233   IMPLICIT NONE 
     
    4748   LOGICAL                    ::   ln_cat_usr   ! ice categories are defined by rn_catbnd 
    4849   REAL(wp), DIMENSION(0:100) ::   rn_catbnd    ! ice categories bounds 
     50   REAL(wp)                   ::   rn_himax     ! maximum ice thickness allowed 
    4951   ! 
    5052   !! * Substitutions 
     
    8688      REAL(wp), DIMENSION(jpij,0:jpl) ::   zhbnew          ! new boundaries of ice categories 
    8789      !!------------------------------------------------------------------ 
     90      IF( ln_timing )   CALL timing_start('iceitd_rem') 
    8891 
    8992      IF( kt == nit000 .AND. lwp )   WRITE(numout,*) '-- ice_itd_rem: remapping ice thickness distribution'  
     
    314317            IF ( a_i_1d(ji) > epsi10 .AND. h_i_1d(ji) < rn_himin ) THEN 
    315318               a_i_1d(ji) = a_i_1d(ji) * h_i_1d(ji) / rn_himin  
    316                IF( ln_pnd_H12 )   a_ip_1d(ji) = a_ip_1d(ji) * h_i_1d(ji) / rn_himin 
     319               IF( ln_pnd_LEV .OR. ln_pnd_TOPO )   a_ip_1d(ji) = a_ip_1d(ji) * h_i_1d(ji) / rn_himin 
    317320               h_i_1d(ji) = rn_himin 
    318321            ENDIF 
     
    327330      IF( ln_icediachk )   CALL ice_cons_hsm(1, 'iceitd_rem', rdiag_v, rdiag_s, rdiag_t, rdiag_fv, rdiag_fs, rdiag_ft) 
    328331      IF( ln_icediachk )   CALL ice_cons2D  (1, 'iceitd_rem',  diag_v,  diag_s,  diag_t,  diag_fv,  diag_fs,  diag_ft) 
     332      IF( ln_timing    )   CALL timing_stop ('iceitd_rem') 
    329333      ! 
    330334   END SUBROUTINE ice_itd_rem 
     
    420424      CALL tab_3d_2d( npti, nptidx(1:npti), a_ip_2d(1:npti,1:jpl), a_ip ) 
    421425      CALL tab_3d_2d( npti, nptidx(1:npti), v_ip_2d(1:npti,1:jpl), v_ip ) 
     426      CALL tab_3d_2d( npti, nptidx(1:npti), v_il_2d(1:npti,1:jpl), v_il ) 
    422427      CALL tab_3d_2d( npti, nptidx(1:npti), t_su_2d(1:npti,1:jpl), t_su ) 
    423428      DO jl = 1, jpl 
     
    484489               zaTsfn(ji,jl2)  = zaTsfn(ji,jl2) + ztrans 
    485490               !   
    486                IF ( ln_pnd_H12 ) THEN 
     491               IF ( ln_pnd_LEV .OR. ln_pnd_TOPO ) THEN 
    487492                  ztrans          = a_ip_2d(ji,jl1) * zworka(ji)     ! Pond fraction 
    488493                  a_ip_2d(ji,jl1) = a_ip_2d(ji,jl1) - ztrans 
    489494                  a_ip_2d(ji,jl2) = a_ip_2d(ji,jl2) + ztrans 
    490495                  !                                               
    491                   ztrans          = v_ip_2d(ji,jl1) * zworka(ji)     ! Pond volume (also proportional to da/a) 
     496                  ztrans          = v_ip_2d(ji,jl1) * zworkv(ji)     ! Pond volume 
    492497                  v_ip_2d(ji,jl1) = v_ip_2d(ji,jl1) - ztrans 
    493498                  v_ip_2d(ji,jl2) = v_ip_2d(ji,jl2) + ztrans 
     499                  ! 
     500                  IF ( ln_pnd_lids ) THEN                            ! Pond lid volume 
     501                     ztrans          = v_il_2d(ji,jl1) * zworkv(ji) 
     502                     v_il_2d(ji,jl1) = v_il_2d(ji,jl1) - ztrans 
     503                     v_il_2d(ji,jl2) = v_il_2d(ji,jl2) + ztrans 
     504                  ENDIF 
    494505               ENDIF 
    495506               ! 
     
    536547      ! clem: The transfer between one category to another can lead to very small negative values (-1.e-20) 
    537548      !       because of truncation error ( i.e. 1. - 1. /= 0 ) 
    538       CALL ice_var_roundoff( a_i_2d, v_i_2d, v_s_2d, sv_i_2d, oa_i_2d, a_ip_2d, v_ip_2d, ze_s_2d, ze_i_2d ) 
     549      CALL ice_var_roundoff( a_i_2d, v_i_2d, v_s_2d, sv_i_2d, oa_i_2d, a_ip_2d, v_ip_2d, v_il_2d, ze_s_2d, ze_i_2d ) 
    539550 
    540551      ! at_i must be <= rn_amax 
     
    568579      CALL tab_2d_3d( npti, nptidx(1:npti), a_ip_2d(1:npti,1:jpl), a_ip ) 
    569580      CALL tab_2d_3d( npti, nptidx(1:npti), v_ip_2d(1:npti,1:jpl), v_ip ) 
     581      CALL tab_2d_3d( npti, nptidx(1:npti), v_il_2d(1:npti,1:jpl), v_il ) 
    570582      CALL tab_2d_3d( npti, nptidx(1:npti), t_su_2d(1:npti,1:jpl), t_su ) 
    571583      DO jl = 1, jpl 
     
    597609      REAL(wp), DIMENSION(jpij,jpl-1) ::   zdaice, zdvice   ! ice area and volume transferred 
    598610      !!------------------------------------------------------------------ 
     611      IF( ln_timing )   CALL timing_start('iceitd_reb') 
    599612      ! 
    600613      IF( kt == nit000 .AND. lwp )   WRITE(numout,*) '-- ice_itd_reb: rebining ice thickness distribution'  
     
    618631         END_2D 
    619632         ! 
    620 !!clem   CALL tab_2d_1d( npti, nptidx(1:npti), h_i_1d(1:npti), h_i(:,:,jl) ) 
    621          CALL tab_2d_1d( npti, nptidx(1:npti), a_i_1d(1:npti), a_i(:,:,jl) ) 
    622          CALL tab_2d_1d( npti, nptidx(1:npti), v_i_1d(1:npti), v_i(:,:,jl) ) 
    623          ! 
    624          DO ji = 1, npti 
    625             jdonor(ji,jl)  = jl  
    626             ! how much of a_i you send in cat sup is somewhat arbitrary 
    627 !!clem: these do not work properly after a restart (I do not know why) => not sure it is still true 
    628 !!          zdaice(ji,jl)  = a_i_1d(ji) * ( h_i_1d(ji) - hi_max(jl) + epsi10 ) / h_i_1d(ji)   
    629 !!          zdvice(ji,jl)  = v_i_1d(ji) - ( a_i_1d(ji) - zdaice(ji,jl) ) * ( hi_max(jl) - epsi10 ) 
    630 !!clem: these do not work properly after a restart (I do not know why) => not sure it is still true 
    631 !!          zdaice(ji,jl)  = a_i_1d(ji) 
    632 !!          zdvice(ji,jl)  = v_i_1d(ji) 
    633 !!clem: these are from UCL and work ok 
    634             zdaice(ji,jl)  = a_i_1d(ji) * 0.5_wp 
    635             zdvice(ji,jl)  = v_i_1d(ji) - zdaice(ji,jl) * ( hi_max(jl) + hi_max(jl-1) ) * 0.5_wp 
    636          END DO 
    637          ! 
    638          IF( npti > 0 ) THEN 
     633         IF( npti > 0 ) THEN             
     634            !!clem   CALL tab_2d_1d( npti, nptidx(1:npti), h_i_1d(1:npti), h_i(:,:,jl) ) 
     635            CALL tab_2d_1d( npti, nptidx(1:npti), a_i_1d(1:npti), a_i(:,:,jl) ) 
     636            CALL tab_2d_1d( npti, nptidx(1:npti), v_i_1d(1:npti), v_i(:,:,jl) ) 
     637            ! 
     638            DO ji = 1, npti 
     639               jdonor(ji,jl)  = jl  
     640               ! how much of a_i you send in cat sup is somewhat arbitrary 
     641               ! these are from CICE => transfer everything 
     642               !!zdaice(ji,jl)  = a_i_1d(ji) 
     643               !!zdvice(ji,jl)  = v_i_1d(ji) 
     644               ! these are from LLN => transfer only half of the category 
     645               zdaice(ji,jl)  =                       0.5_wp  * a_i_1d(ji) 
     646               zdvice(ji,jl)  = v_i_1d(ji) - (1._wp - 0.5_wp) * a_i_1d(ji) * hi_mean(jl) 
     647            END DO 
     648            ! 
    639649            CALL itd_shiftice( jdonor(1:npti,:), zdaice(1:npti,:), zdvice(1:npti,:) )  ! Shift jl=>jl+1 
    640650            ! Reset shift parameters 
     
    657667         END_2D 
    658668         ! 
    659          CALL tab_2d_1d( npti, nptidx(1:npti), a_i_1d(1:npti), a_i(:,:,jl+1) ) ! jl+1 is ok 
    660          CALL tab_2d_1d( npti, nptidx(1:npti), v_i_1d(1:npti), v_i(:,:,jl+1) ) ! jl+1 is ok 
    661          DO ji = 1, npti 
    662             jdonor(ji,jl) = jl + 1 
    663             zdaice(ji,jl) = a_i_1d(ji)  
    664             zdvice(ji,jl) = v_i_1d(ji) 
    665          END DO 
    666          ! 
    667669         IF( npti > 0 ) THEN 
     670            CALL tab_2d_1d( npti, nptidx(1:npti), a_i_1d(1:npti), a_i(:,:,jl+1) ) ! jl+1 is ok 
     671            CALL tab_2d_1d( npti, nptidx(1:npti), v_i_1d(1:npti), v_i(:,:,jl+1) ) ! jl+1 is ok 
     672            DO ji = 1, npti 
     673               jdonor(ji,jl) = jl + 1 
     674               zdaice(ji,jl) = a_i_1d(ji)  
     675               zdvice(ji,jl) = v_i_1d(ji) 
     676            END DO 
     677            ! 
    668678            CALL itd_shiftice( jdonor(1:npti,:), zdaice(1:npti,:), zdvice(1:npti,:) )  ! Shift jl+1=>jl 
    669679            ! Reset shift parameters 
     
    677687      IF( ln_icediachk )   CALL ice_cons_hsm(1, 'iceitd_reb', rdiag_v, rdiag_s, rdiag_t, rdiag_fv, rdiag_fs, rdiag_ft) 
    678688      IF( ln_icediachk )   CALL ice_cons2D  (1, 'iceitd_reb',  diag_v,  diag_s,  diag_t,  diag_fv,  diag_fs,  diag_ft) 
     689      IF( ln_timing    )   CALL timing_stop ('iceitd_reb') 
    679690      ! 
    680691   END SUBROUTINE ice_itd_reb 
     
    693704      REAL(wp) ::   zhmax, znum, zden, zalpha   !   -      - 
    694705      ! 
    695       NAMELIST/namitd/ ln_cat_hfn, rn_himean, ln_cat_usr, rn_catbnd, rn_himin 
     706      NAMELIST/namitd/ ln_cat_hfn, rn_himean, ln_cat_usr, rn_catbnd, rn_himin, rn_himax 
    696707      !!------------------------------------------------------------------ 
    697708      ! 
     
    710721         WRITE(numout,*) '         mean ice thickness in the domain                               rn_himean  = ', rn_himean 
    711722         WRITE(numout,*) '      Ice categories are defined by rn_catbnd                           ln_cat_usr = ', ln_cat_usr 
    712          WRITE(numout,*) '      minimum ice thickness                                             rn_himin   = ', rn_himin  
     723         WRITE(numout,*) '      minimum ice thickness allowed                                     rn_himin   = ', rn_himin  
     724         WRITE(numout,*) '      maximum ice thickness allowed                                     rn_himax   = ', rn_himax  
    713725      ENDIF 
    714726      ! 
     
    747759      END DO 
    748760      ! 
    749       hi_max(jpl) = 99._wp          ! set to a big value to ensure that all ice is thinner than hi_max(jpl) 
     761      hi_max(jpl) = rn_himax        ! set to a big value to ensure that all ice is thinner than hi_max(jpl) 
    750762      ! 
    751763      IF(lwp) WRITE(numout,*) 
Note: See TracChangeset for help on using the changeset viewer.