Changeset 3708 for LMDZ6


Ignore:
Timestamp:
Jun 11, 2020, 11:09:39 AM (4 years ago)
Author:
adurocher
Message:

Optimization in cv3_tracer

File:
1 edited

Legend:

Unmodified
Added
Removed
  • LMDZ6/branches/Optimisation_LMDZ/libf/phylmd/cv3_routines.F90

    r3624 r3708  
    49564956!local variables:
    49574957  INTEGER i, j, k
    4958   REAL epm(nloc, na, na)
     4958  REAL :: epm, eplaMm_tmp
    49594959
    49604960! variables d'Emanuel : du second indice au troisieme
     
    49704970  d1a(:, :) = 0.
    49714971  dam(:, :) = 0.
    4972   epm(:, :, :) = 0.
    49734972  eplaMm(:, :) = 0.
    49744973  epmlmMm(:, :, :) = 0.
     
    49764975  phi2(:, :, :) = 0.
    49774976
    4978 ! fraction deau condensee dans les melanges convertie en precip : epm
    4979 ! et eau condensée précipitée dans masse d'air saturé : l_m*dM_m/dzdz.dzdz
    4980   DO j = 1, nl
    4981     DO k = 1, nl
    4982       DO i = 1, ncum
    4983         IF (k>=icb(i) .AND. k<=inb(i) .AND. &
    4984 !!jyg              j.ge.k.and.j.le.inb(i)) then
    4985 !!jyg             epm(i,j,k)=1.-(1.-ep(i,j))*clw(i,j)/elij(i,k,j)
    4986             j>k .AND. j<=inb(i)) THEN
    4987           epm(i, j, k) = 1. - (1.-ep(i,j))*clw(i, j)/max(elij(i,k,j), 1.E-16)
    4988 !!
    4989           epm(i, j, k) = max(epm(i,j,k), 0.0)
    4990         END IF
    4991       END DO
    4992     END DO
    4993   END DO
    4994 
    4995 
    4996   DO j = 1, nl
    4997     DO k = 1, nl
    4998       DO i = 1, ncum
    4999         IF (k>=icb(i) .AND. k<=inb(i)) THEN
    5000           eplaMm(i, j) = eplamm(i, j) + &
    5001                          ep(i, j)*clw(i, j)*ment(i, j, k)*(1.-sigij(i,j,k))
    5002         END IF
    5003       END DO
    5004     END DO
    5005   END DO
    5006 
    5007   DO j = 1, nl
    5008     DO k = 1, j - 1
    5009       DO i = 1, ncum
    5010         IF (k>=icb(i) .AND. k<=inb(i) .AND. j<=inb(i)) THEN
    5011           epmlmMm(i, j, k) = epm(i, j, k)*elij(i, k, j)*ment(i, k, j)
    5012         END IF
    5013       END DO
    5014     END DO
    5015   END DO
    5016 
    5017 ! matrices pour calculer la tendance des concentrations dans cvltr.F90
     4977
    50184978  DO j = 1, nl
    50194979    DO k = 1, nl
     
    50224982        phi(i, j, k) = sigij(i, k, j)*ment(i, k, j)
    50234983        d1a(i, j) = d1a(i, j) + ment(i, k, j)*ep(i, k)*(1.-sigij(i,k,j))
    5024         IF (k<=j) THEN
    5025           dam(i, j) = dam(i, j) + ment(i, k, j)*epm(i, k, j)*(1.-ep(i,k))*(1.-sigij(i,k,j))
    5026           phi2(i, j, k) = phi(i, j, k)*epm(i, j, k)
    5027         END IF
    50284984      END DO
    50294985    END DO
    50304986  END DO
    5031 
    5032   RETURN
     4987  DO j = 1, nl   
     4988    DO i = 1, ncum
     4989      eplaMm_tmp = 0
     4990      DO k = icb(i), inb(i)
     4991        eplaMm_tmp = eplaMm_tmp + ment(i, j, k)*(1.-sigij(i,j,k))
     4992      END DO
     4993      eplaMm(i, j) = eplamm(i, j) + ep(i, j)*clw(i, j)*eplaMm_tmp
     4994    END DO
     4995  END DO     
     4996  DO i = 1, ncum
     4997    DO j = 1, inb(i)
     4998      DO k = icb(i), min(j-1,inb(i))
     4999        epm = 1. - (1.-ep(i,j))*clw(i, j)/max(elij(i,k,j), 1.E-16)
     5000        epm = max(epm, 0.0)
     5001        phi2(i, j, k) = phi(i, j, k)*epm
     5002        epmlmMm(i, j, k) = epm*elij(i, k, j)*ment(i, k, j)
     5003      END DO
     5004    END DO
     5005  END DO
     5006
    50335007END SUBROUTINE cv3_tracer
    50345008!AC! et !RomP <<<
Note: See TracChangeset for help on using the changeset viewer.