Changeset 5478 for LMDZ6


Ignore:
Timestamp:
Jan 16, 2025, 10:10:56 AM (10 hours ago)
Author:
jyg
Message:

Flag-protect the bug fix of svn 5469 :

keep_bug_indices_cv3_tracer=.TRUE. ==> bug is kept
default is .FALSE.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • LMDZ6/trunk/libf/phylmd/cv3_routines.f90

    r5469 r5478  
    49384938   USE lmdz_cv_ini, ONLY : nl
    49394939  USE cvflag_mod_h
     4940  USE ioipsl_getin_p_mod, ONLY : getin_p
    49404941  IMPLICIT NONE
    49414942
    49424943
    49434944!inputs:
     4945!------
    49444946  INTEGER, INTENT (IN)                               :: ncum, nd, na, nloc, len
    49454947  INTEGER, DIMENSION (len), INTENT (IN)              :: icb, inb
     
    49494951  REAL, DIMENSION (len, nd+1), INTENT (IN)           :: Vprecip
    49504952!ouputs:
     4953!------
    49514954  REAL, DIMENSION (len, na, na), INTENT (OUT)        :: phi, phi2, epmlmMm
    49524955  REAL, DIMENSION (len, na), INTENT (OUT)            :: da, d1a, dam, eplaMm
    49534956!
     4957!local variables:
     4958!---------------
    49544959! variables pour tracer dans precip de l'AA et des mel
    4955 !local variables:
    49564960  INTEGER i, j, k
    49574961  REAL epm(nloc, na, na)
     4962!
     4963  LOGICAL,SAVE   ::  first=.TRUE.
     4964  LOGICAL,SAVE   ::  keep_bug_indices_cv3_tracer
     4965  !$OMP_THREADPRIVATE (first, keep_bug_indices_cv3_tracer)
    49584966
    49594967! variables d'Emanuel : du second indice au troisieme
     
    49624970! variables personnelles : du troisieme au second indice
    49634971! --->    tab(i,j,k) -> de k a j
    4964 ! phi, phi2
    4965 
     4972! phi, phi2, epm, epmlmMm
     4973
     4974  IF (first) THEN
     4975    keep_bug_indices_cv3_tracer = .FALSE.
     4976    CALL getin_p('keep_bug_indices_cv3_tracer', keep_bug_indices_cv3_tracer)
     4977    first = .FALSE.
     4978  ENDIF ! (first)
    49664979! initialisations
    49674980
     
    50225035        d1a(i, j) = d1a(i, j) + ment(i, k, j)*ep(i, k)*(1.-sigij(i,k,j))
    50235036        IF (k<=j) THEN
    5024 !!jyg          dam(i, j) = dam(i, j) + ment(i, k, j)*epm(i, k, j)*(1.-ep(i,k))*(1.-sigij(i,k,j))
    5025           dam(i, j) = dam(i, j) + ment(i, k, j)*epm(i, j, k)*(1.-ep(i,k))*(1.-sigij(i,k,j))
    50265037          phi2(i, j, k) = phi(i, j, k)*epm(i, j, k)
    50275038        END IF
     
    50295040    END DO
    50305041  END DO
     5042
     5043  IF (keep_bug_indices_cv3_tracer) THEN
     5044    DO j = 1, nl
     5045      DO k = 1, nl
     5046        DO i = 1, ncum
     5047          IF (k<=j) THEN
     5048            dam(i, j) = dam(i, j) + ment(i, k, j)*epm(i, k, j)*(1.-ep(i,k))*(1.-sigij(i,k,j))
     5049          END IF ! (k<=j)
     5050        END DO
     5051      END DO
     5052    END DO
     5053  ELSE  ! (keep_bug_indices_cv3_tracer)
     5054    DO j = 1, nl
     5055      DO k = 1, nl
     5056        DO i = 1, ncum
     5057          IF (k<=j) THEN
     5058            dam(i, j) = dam(i, j) + ment(i, k, j)*epm(i, j, k)*(1.-ep(i,k))*(1.-sigij(i,k,j))
     5059          END IF ! (k<=j)
     5060        END DO
     5061      END DO
     5062    END DO
     5063  ENDIF ! (keep_bug_indices_cv3_tracer)
    50315064
    50325065  RETURN
Note: See TracChangeset for help on using the changeset viewer.