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 5167 for trunk/NEMOGCM/NEMO/LIM_SRC_3/limitd_me.F90 – NEMO

Ignore:
Timestamp:
2015-03-24T18:35:00+01:00 (9 years ago)
Author:
clem
Message:

LIM3 bug fix. see ticket #1492 (forthcoming update) which also solve ticket #1497

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/NEMOGCM/NEMO/LIM_SRC_3/limitd_me.F90

    r5134 r5167  
    154154      IF( ln_limdiahsb ) CALL lim_cons_hsm(0, 'limitd_me', zvi_b, zsmv_b, zei_b, zfw_b, zfs_b, zft_b) 
    155155 
     156      CALL lim_var_glo2eqv            ! equivalent variables, requested for rafting 
    156157      !-----------------------------------------------------------------------------! 
    157158      ! 1) Thickness categories boundaries, ice / o.w. concentrations, init_ons 
     
    235236               ! Reduce the closing rate if more than 100% of the open water  
    236237               ! would be removed.  Reduce the opening rate proportionately. 
    237                IF ( ato_i(ji,jj) > epsi10 .AND. athorn(ji,jj,0) > 0.0 ) THEN 
    238                   za = athorn(ji,jj,0) * closing_gross(ji,jj) * rdt_ice 
    239                   IF ( za > ato_i(ji,jj)) THEN 
    240                      zfac = ato_i(ji,jj) / za 
    241                      closing_gross(ji,jj) = closing_gross(ji,jj) * zfac 
    242                      opning(ji,jj) = opning(ji,jj) * zfac 
    243                   ENDIF 
     238               za   = athorn(ji,jj,0) * closing_gross(ji,jj) * rdt_ice 
     239               IF( za > epsi20 ) THEN 
     240                  zfac = MIN( 1._wp, ato_i(ji,jj) / za ) 
     241                  closing_gross(ji,jj) = closing_gross(ji,jj) * zfac 
     242                  opning       (ji,jj) = opning       (ji,jj) * zfac 
    244243               ENDIF 
    245244 
     
    251250         ! Reduce the closing rate if more than 100% of any ice category  
    252251         ! would be removed.  Reduce the opening rate proportionately. 
    253  
    254252         DO jl = 1, jpl 
    255253            DO jj = 1, jpj 
    256254               DO ji = 1, jpi 
    257                   IF ( a_i(ji,jj,jl) > epsi10 .AND. athorn(ji,jj,jl) > 0._wp )THEN 
    258                      za = athorn(ji,jj,jl) * closing_gross(ji,jj) * rdt_ice 
    259                      IF ( za  >  a_i(ji,jj,jl) ) THEN 
    260                         zfac = a_i(ji,jj,jl) / za 
    261                         closing_gross(ji,jj) = closing_gross(ji,jj) * zfac 
    262                         opning       (ji,jj) = opning       (ji,jj) * zfac 
    263                      ENDIF 
     255                  za = athorn(ji,jj,jl) * closing_gross(ji,jj) * rdt_ice 
     256                  IF( za  >  epsi20 ) THEN 
     257                     zfac = MIN( 1._wp, a_i(ji,jj,jl) / za ) 
     258                     closing_gross(ji,jj) = closing_gross(ji,jj) * zfac 
     259                     opning       (ji,jj) = opning       (ji,jj) * zfac 
    264260                  ENDIF 
    265261               END DO 
     
    369365 
    370366      ! updates 
    371       CALL lim_var_glo2eqv 
    372       CALL lim_var_zapsmall 
    373367      CALL lim_var_agg( 1 )  
    374368 
     
    377371      !-----------------------------------------------------------------------------! 
    378372      IF(ln_ctl) THEN  
     373         CALL lim_var_glo2eqv 
     374 
    379375         CALL prt_ctl_info(' ') 
    380376         CALL prt_ctl_info(' - Cell values : ') 
     
    531527         DO jj = 2, jpjm1 
    532528            DO ji = 2, jpim1 
    533                IF ( ( asum(ji,jj) - ato_i(ji,jj) ) > epsi10) THEN ! ice is present 
     529               IF ( ( asum(ji,jj) - ato_i(ji,jj) ) > 0._wp) THEN  
    534530                  zworka(ji,jj) = ( 4.0 * strength(ji,jj)              & 
    535531                     &                  + strength(ji-1,jj) * tmask(ji-1,jj,1) + strength(ji+1,jj) * tmask(ji+1,jj,1) &   
     
    566562         DO jj = 1, jpj - 1 
    567563            DO ji = 1, jpi - 1 
    568                IF ( ( asum(ji,jj) - ato_i(ji,jj) ) > epsi10) THEN       ! ice is present 
     564               IF ( ( asum(ji,jj) - ato_i(ji,jj) ) > 0._wp) THEN  
    569565                  numts_rm = 1 ! number of time steps for the running mean 
    570566                  IF ( strp1(ji,jj) > 0.0 ) numts_rm = numts_rm + 1 
     
    637633 
    638634      Gsum(:,:,-1) = 0._wp 
    639  
    640       DO jj = 1, jpj 
    641          DO ji = 1, jpi 
    642             IF( ato_i(ji,jj) > epsi10 ) THEN   ;   Gsum(ji,jj,0) = ato_i(ji,jj) 
    643             ELSE                               ;   Gsum(ji,jj,0) = 0._wp 
    644             ENDIF 
    645          END DO 
    646       END DO 
     635      Gsum(:,:,0 ) = ato_i(:,:) 
    647636 
    648637      ! for each value of h, you have to add ice concentration then 
    649638      DO jl = 1, jpl 
    650          DO jj = 1, jpj  
    651             DO ji = 1, jpi 
    652                IF( a_i(ji,jj,jl) > epsi10 ) THEN   ;   Gsum(ji,jj,jl) = Gsum(ji,jj,jl-1) + a_i(ji,jj,jl) 
    653                ELSE                                ;   Gsum(ji,jj,jl) = Gsum(ji,jj,jl-1) 
    654                ENDIF 
    655             END DO 
    656          END DO 
     639         Gsum(:,:,jl) = Gsum(:,:,jl-1) + a_i(:,:,jl) 
    657640      END DO 
    658641 
     
    828811      LOGICAL, PARAMETER ::   l_conservation_check = .true.  ! if true, check conservation (useful for debugging) 
    829812      ! 
    830       LOGICAL ::   neg_ato_i      ! flag for ato_i(i,j) < -puny 
    831       LOGICAL ::   large_afrac    ! flag for afrac > 1 
    832       LOGICAL ::   large_afrft    ! flag for afrac > 1 
    833813      INTEGER ::   ji, jj, jl, jl1, jl2, jk   ! dummy loop indices 
    834814      INTEGER ::   ij                ! horizontal index, combines i and j loops 
     
    898878      ! 1) Compute change in open water area due to closing and opening. 
    899879      !------------------------------------------------------------------------------- 
    900  
    901       neg_ato_i = .false. 
    902  
    903880      DO jj = 1, jpj 
    904881         DO ji = 1, jpi 
    905882            ato_i(ji,jj) = ato_i(ji,jj) - athorn(ji,jj,0) * closing_gross(ji,jj) * rdt_ice        & 
    906883               &                        + opning(ji,jj)                          * rdt_ice 
    907             IF( ato_i(ji,jj) < -epsi10 ) THEN 
    908                neg_ato_i = .TRUE. 
    909             ELSEIF( ato_i(ji,jj) < 0._wp ) THEN    ! roundoff error 
     884            IF    ( ato_i(ji,jj) < -epsi10 ) THEN    ! there is a bug 
     885               IF(lwp)   WRITE(numout,*) 'Ridging error: ato_i < 0 -- ato_i : ',ato_i(ji,jj) 
     886            ELSEIF( ato_i(ji,jj) < 0._wp   ) THEN    ! roundoff error 
    910887               ato_i(ji,jj) = 0._wp 
    911888            ENDIF 
    912889         END DO 
    913890      END DO 
    914  
    915       ! if negative open water area alert it 
    916       IF( neg_ato_i .AND. lwp ) THEN       ! there is a bug 
    917          DO jj = 1, jpj  
    918             DO ji = 1, jpi 
    919                IF( ato_i(ji,jj) < -epsi10 ) THEN  
    920                   WRITE(numout,*) ''   
    921                   WRITE(numout,*) 'Ridging error: ato_i < 0' 
    922                   WRITE(numout,*) 'ato_i : ', ato_i(ji,jj) 
    923                ENDIF 
    924             END DO 
    925          END DO 
    926       ENDIF 
    927891 
    928892      !----------------------------------------------------------------- 
    929893      ! 2) Save initial state variables 
    930894      !----------------------------------------------------------------- 
    931  
    932       DO jl = 1, jpl 
    933          aicen_init(:,:,jl) = a_i(:,:,jl) 
    934          vicen_init(:,:,jl) = v_i(:,:,jl) 
    935          vsnwn_init(:,:,jl) = v_s(:,:,jl) 
    936          ! 
    937          smv_i_init(:,:,jl) = smv_i(:,:,jl) 
    938          oa_i_init (:,:,jl) = oa_i (:,:,jl) 
    939       END DO 
    940  
    941       esnwn_init(:,:,:) = e_s(:,:,1,:) 
    942  
    943       DO jl = 1, jpl   
    944          DO jk = 1, nlay_i 
    945             eicen_init(:,:,jk,jl) = e_i(:,:,jk,jl) 
    946          END DO 
    947       END DO 
     895      aicen_init(:,:,:)   = a_i  (:,:,:) 
     896      vicen_init(:,:,:)   = v_i  (:,:,:) 
     897      vsnwn_init(:,:,:)   = v_s  (:,:,:) 
     898      smv_i_init(:,:,:)   = smv_i(:,:,:) 
     899      oa_i_init (:,:,:)   = oa_i (:,:,:) 
     900      esnwn_init(:,:,:)   = e_s  (:,:,1,:) 
     901      eicen_init(:,:,:,:) = e_i  (:,:,:,:) 
    948902 
    949903      ! 
     
    972926         END DO 
    973927 
    974          large_afrac = .false. 
    975          large_afrft = .false. 
    976  
    977928         DO ij = 1, icells 
    978929            ji = indxi(ij) 
     
    1000951            afrft(ji,jj) = arft1(ji,jj) / aicen_init(ji,jj,jl1) !rafting 
    1001952 
    1002             IF (afrac(ji,jj) > kamax + epsi10) THEN  !riging 
    1003                large_afrac = .true. 
    1004             ELSEIF (afrac(ji,jj) > kamax) THEN  ! roundoff error 
     953            IF( afrac(ji,jj) > kamax + epsi10 ) THEN  ! there is a bug 
     954               IF(lwp)   WRITE(numout,*) ' ardg > a_i -- ardg, aicen_init : ', ardg1(ji,jj), aicen_init(ji,jj,jl1) 
     955            ELSEIF( afrac(ji,jj) > kamax ) THEN       ! roundoff error 
    1005956               afrac(ji,jj) = kamax 
    1006957            ENDIF 
    1007             IF (afrft(ji,jj) > kamax + epsi10) THEN !rafting 
    1008                large_afrft = .true. 
    1009             ELSEIF (afrft(ji,jj) > kamax) THEN  ! roundoff error 
     958 
     959            IF( afrft(ji,jj) > kamax + epsi10 ) THEN ! there is a bug 
     960               IF(lwp)   WRITE(numout,*) ' arft > a_i -- arft, aicen_init : ', arft1(ji,jj), aicen_init(ji,jj,jl1)  
     961            ELSEIF( afrft(ji,jj) > kamax) THEN       ! roundoff error 
    1010962               afrft(ji,jj) = kamax 
    1011963            ENDIF 
     
    1022974            esrdg(ji,jj) = esnwn_init(ji,jj,jl1) * afrac(ji,jj) 
    1023975            srdg1(ji,jj) = smv_i_init(ji,jj,jl1) * afrac(ji,jj) 
    1024             srdg2(ji,jj) = smv_i_init(ji,jj,jl1) * afrac(ji,jj) !! MV HC 2014 this line seems useless 
    1025976 
    1026977            ! rafting volumes, heat contents ... 
     
    10501001             
    10511002            sfx_dyn(ji,jj) = sfx_dyn(ji,jj) - smsw(ji,jj) * rhoic * r1_rdtice 
    1052             wfx_dyn(ji,jj) = wfx_dyn(ji,jj) - vsw (ji,jj) * rhoic * r1_rdtice   ! gurvan: increase in ice volume du to seawater frozen in voids              
     1003            wfx_dyn(ji,jj) = wfx_dyn(ji,jj) - vsw (ji,jj) * rhoic * r1_rdtice   ! increase in ice volume du to seawater frozen in voids              
    10531004 
    10541005            !------------------------------------             
     
    11341085         ENDIF 
    11351086 
    1136          IF( large_afrac .AND. lwp ) THEN   ! there is a bug 
    1137             DO ij = 1, icells 
    1138                ji = indxi(ij) 
    1139                jj = indxj(ij) 
    1140                IF( afrac(ji,jj) > kamax + epsi10 ) THEN  
    1141                   WRITE(numout,*) '' 
    1142                   WRITE(numout,*) ' ardg > a_i' 
    1143                   WRITE(numout,*) ' ardg, aicen_init : ', ardg1(ji,jj), aicen_init(ji,jj,jl1) 
    1144                ENDIF 
    1145             END DO 
    1146          ENDIF 
    1147          IF( large_afrft .AND. lwp ) THEN  ! there is a bug 
    1148             DO ij = 1, icells 
    1149                ji = indxi(ij) 
    1150                jj = indxj(ij) 
    1151                IF( afrft(ji,jj) > kamax + epsi10 ) THEN  
    1152                   WRITE(numout,*) '' 
    1153                   WRITE(numout,*) ' arft > a_i' 
    1154                   WRITE(numout,*) ' arft, aicen_init : ', arft1(ji,jj), aicen_init(ji,jj,jl1) 
    1155                ENDIF 
    1156             END DO 
    1157          ENDIF 
    1158  
    11591087         !------------------------------------------------------------------------------- 
    11601088         ! 4) Add area, volume, and energy of new ridge to each category jl2 
Note: See TracChangeset for help on using the changeset viewer.