Changeset 2257


Ignore:
Timestamp:
Apr 7, 2015, 11:47:46 AM (10 years ago)
Author:
jyg
Message:

Improvement of three loops in cv3_undilute2 in cv3_routines.F90

File:
1 edited

Legend:

Unmodified
Added
Removed
  • LMDZ5/trunk/libf/phylmd/cv3_routines.F90

    r2253 r2257  
    13521352! first estimate of buoyancy:
    13531353
    1354   DO i = 1, ncum
    1355     DO k = 1, nl
     1354!jyg : k-loop outside i-loop (07042015)
     1355  DO k = 1, nl
     1356    DO i = 1, ncum
    13561357      buoy(i, k) = tvp(i, k) - tv(i, k)
    13571358    END DO
     
    13611362! for safety, set buoy(icb)=buoybase
    13621363
    1363   DO i = 1, ncum
    1364     DO k = 1, nl
     1364!jyg : k-loop outside i-loop (07042015)
     1365  DO k = 1, nl
     1366    DO i = 1, ncum
    13651367      IF ((k>=icb(i)) .AND. (k<=nl) .AND. (p(i,k)>=pbase(i))) THEN
    13661368        buoy(i, k) = buoybase(i)
    13671369      END IF
    13681370    END DO
     1371  END DO
     1372  DO i = 1, ncum
    13691373!    buoy(icb(i),k)=buoybase(i)
    13701374    buoy(i, icb(i)) = buoybase(i)
     
    15111515  END DO
    15121516
    1513   DO k = minorig + 1, nl
    1514     DO i = 1, ncum
    1515       IF ((k>=icb(i)) .AND. (k<=inb(i))) THEN
    1516 
    1517         IF (cvflag_ice) THEN
     1517!jyg : cvflag_ice test outside the loops (07042015)
     1518!
     1519  IF (cvflag_ice) THEN
     1520!
     1521    DO k = minorig + 1, nl
     1522      DO i = 1, ncum
     1523        IF ((k>=icb(i)) .AND. (k<=inb(i))) THEN
    15181524          frac(i, k) = 1. - (t(i,k)-243.15)/(263.15-243.15)
    15191525          frac(i, k) = min(max(frac(i,k),0.0), 1.0)
    15201526          hp(i, k) = hnk(i) + (lv(i,k)+(cpd-cpv)*t(i,k)+frac(i,k)*lf(i,k))* &
    15211527                              ep(i, k)*clw(i, k)
    1522 
    1523         ELSE
     1528        END IF
     1529      END DO
     1530    END DO
     1531!
     1532  ELSE
     1533!
     1534    DO k = minorig + 1, nl
     1535      DO i = 1, ncum
     1536        IF ((k>=icb(i)) .AND. (k<=inb(i))) THEN
    15241537          hp(i, k) = hnk(i) + (lv(i,k)+(cpd-cpv)*t(i,k))*ep(i, k)*clw(i, k)
    15251538        END IF
    1526 
    1527       END IF
    1528     END DO
    1529   END DO
     1539      END DO
     1540    END DO
     1541!
     1542  END IF  ! (cvflag_ice)
    15301543
    15311544  RETURN
Note: See TracChangeset for help on using the changeset viewer.