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 14122 – NEMO

Changeset 14122


Ignore:
Timestamp:
2020-12-07T18:37:04+01:00 (3 years ago)
Author:
jchanut
Message:

#2222, prevent from an out of bound error with AGRIF

File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/trunk/src/NST/agrif_oce_interp.F90

    r14086 r14122  
    651651      IF( ll_int_cons ) THEN  ! Conservative interpolation 
    652652         IF ( lk_tint2d_notinterp ) THEN 
     653            Agrif_UseSpecialValue = .FALSE. 
    653654            CALL Agrif_Bc_variable( ub2b_interp_id, calledweight=1._wp, procname=interpub2b_const ) 
    654655            CALL Agrif_Bc_variable( vb2b_interp_id, calledweight=1._wp, procname=interpvb2b_const )  
    655656            ! Divergence conserving correction terms: 
    656             CALL Agrif_Bc_variable(    ub2b_cor_id, calledweight=1._wp, procname=        ub2b_cor ) 
    657             CALL Agrif_Bc_variable(    vb2b_cor_id, calledweight=1._wp, procname=        vb2b_cor ) 
     657            IF ( Agrif_Rhox()>1 ) CALL Agrif_Bc_variable(    ub2b_cor_id, calledweight=1._wp, procname=ub2b_cor ) 
     658            IF ( Agrif_Rhoy()>1 ) CALL Agrif_Bc_variable(    vb2b_cor_id, calledweight=1._wp, procname=vb2b_cor ) 
    658659         ELSE 
    659660            ! order matters here !!!!!! 
     
    14381439         ptab(:,:) = 0._wp 
    14391440         DO ji=i1+1,i2-1 
    1440             DO jj=j1+1,j2 
     1441            DO jj=j1+1,j2-1 
    14411442               ptab(ji,jj) = 0.25_wp*( ( vb2_b(ji+1,jj  )*e1v(ji+1,jj  )   &  
    14421443                           &            -vb2_b(ji-1,jj  )*e1v(ji-1,jj  ) ) & 
     
    15421543         ptab(:,:) = 0._wp 
    15431544         DO ji=i1+1,i2-1 
    1544             DO jj=j1+1,j2 
     1545            DO jj=j1+1,j2-1 
    15451546               ptab(ji,jj) = 0.25_wp*( ( ub2_b(ji  ,jj+1)*e2u(ji  ,jj+1)   &  
    15461547                           &            -ub2_b(ji  ,jj-1)*e2u(ji  ,jj-1) ) & 
Note: See TracChangeset for help on using the changeset viewer.