Changeset 3893


Ignore:
Timestamp:
Jan 25, 2016, 10:37:45 AM (9 years ago)
Author:
ymipsl
Message:

Bug fix for LMDZ : some operation was perform on whole range of an compressed array, making floating point exception when computing on invalid part of arrays.

YM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • dynamico_lmdz/aquaplanet/LMDZ5/libf/phylmd/yamada4.F90

    r3831 r3893  
    247247
    248248    DO k = 2, klev
    249       q2(:, k) = l(:, k)**2*zz(:, k)
     249      q2(:ngrid, k) = l(:ngrid, k)**2*zz(:ngrid, k)
    250250    END DO
    251251
     
    340340    ! print*,'Longueur ',l(:,:)
    341341    DO k = 2, klev - 1
    342       l(:, k) = max(l(:,k), 1.)
    343       km(:, k) = l(:, k)*sqrt(q2(:,k))*sm(:, k)
    344       q2(:, k) = q2(:, k) + dt*km(:, k)*m2(:, k)*(1.-rif(:,k))
    345       q2(:, k) = min(max(q2(:,k),1.E-10), 1.E4)
    346       q2(:, k) = 1./(1./sqrt(q2(:,k))+dt/(2*l(:,k)*b1))
    347       q2(:, k) = q2(:, k)*q2(:, k)
     342      DO ig = 1, ngrid
     343        l(ig, k) = max(l(ig,k), 1.)
     344        km(ig, k) = l(ig, k)*sqrt(q2(ig,k))*sm(ig, k)
     345        q2(ig, k) = q2(ig, k) + dt*km(ig, k)*m2(ig, k)*(1.-rif(ig,k))
     346        q2(ig, k) = min(max(q2(ig,k),1.E-10), 1.E4)
     347        q2(ig, k) = 1./(1./sqrt(q2(ig,k))+dt/(2*l(ig,k)*b1))
     348        q2(ig, k) = q2(ig, k)*q2(ig, k)
     349      END DO
    348350    END DO
    349351
     
    377379  IF (iflag_pbl>=12) THEN
    378380    ! print*,'YAMADA VDIF'
    379     q2(:, 1) = q2(:, 2)
     381    q2(1:ngrid, 1) = q2(1:ngrid, 2)
    380382    CALL vdif_q2(dt, g, rconst, ngrid, plev, temp, kq, q2)
    381383  END IF
Note: See TracChangeset for help on using the changeset viewer.