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 3838 for branches/2012/dev_MERGE_2012 – NEMO

Ignore:
Timestamp:
2013-03-14T13:06:40+01:00 (11 years ago)
Author:
gm
Message:

dev_MERGE_2012: #1054, LIM3: more simple and efficient correction of the reported bug

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/LIM_SRC_3/limupdate.F90

    r3817 r3838  
    7676      !! ** Action  : -  
    7777      !!--------------------------------------------------------------------- 
    78       INTEGER ::   ji, jj, jk, jl, jm    ! dummy loop indices 
    79       INTEGER ::   jbnd1, jbnd2 
    80       INTEGER ::   i_ice_switch 
    81       INTEGER ::   ind_im, layer      ! indices for internal melt 
    82       REAL(wp) ::   zweight, zesum, zhimax, z_da_i 
    83       REAL(wp) ::   zindb, zindsn, zindic, zacrith 
    84       REAL(wp) ::   zrtt, zindg, zh, zdvres, zviold 
    85       REAL(wp) ::   zbigvalue, zvsold, z_da_ex, zamax 
    86       REAL(wp) ::   z_prescr_hi, zat_i_old, ztmelts, ze_s 
    87  
    88       INTEGER , POINTER, DIMENSION(:,:,:) ::  internal_melt 
    89       REAL(wp), POINTER, DIMENSION(:) ::   zthick0, zqm0      ! thickness of the layers and heat contents for 
     78      INTEGER  ::   ji, jj, jk, jl, jm    ! dummy loop indices 
     79      INTEGER  ::   jbnd1, jbnd2 
     80      INTEGER  ::   i_ice_switch, ind_im, layer             ! local integers 
     81      REAL(wp) ::   zweight, zesum, zhimax                  ! local scalars 
     82      REAL(wp) ::   zindb, zindsn, zindic, zacrith          !   -      - 
     83      REAL(wp) ::   zrtt, zindg, zh, zdvres, zviold         !   -      -  
     84      REAL(wp) ::   zbigvalue, zvsold                       !   -      - 
     85      REAL(wp) ::   z_prescr_hi, zat_i_old, ztmelts, ze_s   !   -      - 
     86      ! 
     87      INTEGER , POINTER, DIMENSION(:,:,:) ::   internal_melt 
     88      REAL(wp), POINTER, DIMENSION(:)     ::   zthick0, zqm0   ! thickness of the layers and heat contents for 
    9089      !!------------------------------------------------------------------- 
    9190 
     
    270269      ENDIF 
    271270 
    272       at_i(:,:) = a_i(:,:,1) 
     271      at_i(:,:) = a_i(:,:,1)                   ! total ice concentration 
    273272      DO jl = 2, jpl 
    274273         at_i(:,:) = at_i(:,:) + a_i(:,:,jl) 
     
    405404      ENDIF 
    406405 
    407       at_i(:,:) = a_i(:,:,1) 
     406      at_i(:,:) = a_i(:,:,1)                   ! total ice concentration 
    408407      DO jl = 2, jpl 
    409408         at_i(:,:) = at_i(:,:) + a_i(:,:,jl) 
     
    445444      ENDIF 
    446445 
    447       at_i(:,:) = a_i(:,:,1) 
     446      at_i(:,:) = a_i(:,:,1)                   ! total ice concentration 
    448447      DO jl = 2, jpl 
    449448         at_i(:,:) = at_i(:,:) + a_i(:,:,jl) 
     
    782781      ENDIF 
    783782 
    784       !--- 2.13 Total ice concentration should not exceed 1 
    785       !----------------------------------------------------- 
    786       zamax = amax 
    787       ! 2.13.1) total (and thus individual) concentrations cannot exceed zamax 
    788       !----------------------------------------------------------------------- 
    789  
    790       at_i(:,:) = a_i(:,:,1) 
     783      ! Total ice concentration check : forced to be less than amax 
     784      !------------------------------ 
     785      at_i(:,:) = a_i(:,:,1)                  ! total ice concentration 
    791786      DO jl = 2, jpl 
    792787         at_i(:,:) = at_i(:,:) + a_i(:,:,jl) 
    793788      END DO 
    794  
    795       DO jj = 1, jpj 
    796          DO ji = 1, jpi 
    797  
    798             ! 0) Excessive area ? 
    799             z_da_ex =  MAX( at_i(ji,jj) - zamax , 0._wp )         
    800  
    801             ! 1) Count the number of existing categories 
    802             DO jl  = 1, jpl 
    803 !!cr : comment the second line of zindb definition, and use epsi04 in the 1st one 
    804                zindb   =  MAX( rzero, SIGN( rone, v_i(ji,jj,jl) - epsi03 ) )  
    805                zindb   =  MAX( rzero, SIGN( rone, v_i(ji,jj,jl) ) )  
    806                z_da_i = a_i(ji,jj,jl) * z_da_ex / MAX( at_i(ji,jj), epsi06 ) * zindb 
    807                a_i(ji,jj,jl) = a_i(ji,jj,jl) - z_da_i 
    808             END DO 
    809  
    810          END DO !ji 
    811       END DO !jj 
     789      DO jl = 1, jpl                          ! if at_i > amax, set at_i=amax by a rescale of the area of each category 
     790         a_i(:,:,jl) = a_i(:,:,jl) * amax / MAX( at_i(:,:), amax ) 
     791      END DO 
     792      at_i(:,:) = MIN( at_i(:,:), amax )      ! at_i becomes less than amax by construction no need to recompute it 
    812793 
    813794      IF( ln_nicep ) THEN   
     
    818799      ENDIF 
    819800 
    820       at_i(:,:) = a_i(:,:,1) 
    821       DO jl = 2, jpl 
    822          at_i(:,:) = at_i(:,:) + a_i(:,:,jl) 
    823       END DO 
    824801 
    825802      IF( ln_nicep ) THEN   
     
    836813                     WRITE(numout,*) ' d_a_i_thd / trp ', d_a_i_thd(ji,jj,jl), d_a_i_trp(ji,jj,jl) 
    837814                  END DO 
    838                   !             WRITE(numout,*) ' CORRECTION BARBARE ' 
    839                   !             z_da_ex =  MAX( at_i(ji,jj) - zamax , 0.0 )         
    840815               ENDIF 
    841816            END DO 
     
    873848      ENDIF 
    874849 
    875       at_i(:,:) = a_i(:,:,1) 
     850      at_i(:,:) = a_i(:,:,1)                   ! total ice concentration 
    876851      DO jl = 2, jpl 
    877852         at_i(:,:) = at_i(:,:) + a_i(:,:,jl) 
Note: See TracChangeset for help on using the changeset viewer.