Changeset 4408


Ignore:
Timestamp:
2014-02-04T13:12:14+01:00 (7 years ago)
Author:
trackstand2
Message:

Fixed bug where ji can go oob if mi1(ii0)==jpi

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/DIA/diafwb.F90

    r3211 r4408  
    6161      INTEGER :: inum             ! temporary logical unit 
    6262      INTEGER :: ji, jj, jk, jt   ! dummy loop indices 
    63       INTEGER :: ii0, ii1, ij0, ij1 
     63      INTEGER :: ii0, ii1, ij0, ij1, jip1 
    6464      REAL(wp) ::   zarea, zvol, zwei 
    6565      REAL(wp) ::  ztemi(4), ztemo(4), zsali(4), zsalo(4), zflxi(4), zflxo(4) 
     
    228228         !  
    229229         DO ji = mi0(ii0), mi1(ii1) 
     230            jip1 = MIN(ji+1,jpi) 
    230231            DO jj = mj0(ij0), mj1(ij1) 
    231232               DO jk = 1, jpk  
    232                   zt = 0.5 * ( tn(ji,jj,jk) + tn(ji+1,jj,jk) ) 
    233                   zs = 0.5 * ( sn(ji,jj,jk) + sn(ji+1,jj,jk) ) 
     233                  zt = 0.5 * ( tn(ji,jj,jk) + tn(jip1,jj,jk) ) 
     234                  zs = 0.5 * ( sn(ji,jj,jk) + sn(jip1,jj,jk) ) 
    234235                  zu = un(ji,jj,jk) * fse3t(ji,jj,jk) * e2u(ji,jj) 
    235236                   
Note: See TracChangeset for help on using the changeset viewer.