Ignore:
Timestamp:
Jan 28, 2016, 5:02:13 PM (9 years ago)
Author:
Laurent Fairhead
Message:

Merged trunk changes r2396:2434 into testing branch

Location:
LMDZ5/branches/testing
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • LMDZ5/branches/testing

  • LMDZ5/branches/testing/libf/phylmd/cv3_cine.F90

    r1999 r2435  
    3434  INTEGER itop(nloc), ineg(nloc), ilow(nloc)
    3535  INTEGER ifst(nloc), isublcl(nloc)
    36   LOGICAL lswitch(nloc), lswitch1(nloc), lswitch2(nloc)
     36  LOGICAL lswitch(nloc), lswitch1(nloc), lswitch2(nloc), lswitch3(nloc)
    3737  LOGICAL exist_lfc(nloc)
    3838  REAL dpmax
     
    161161  END DO
    162162
     163  ! 1.2.1 Recompute itop (=1st layer with positive buoyancy above ineg)
     164  ! -------------------------------------------------------------------
     165
     166  DO il = 1, ncum
     167    IF (lswitch(il)) THEN
     168      itop(il) = nl - 1
     169    END IF
     170  END DO
     171
     172  DO k = nl, 1, -1
     173    DO il = 1, ncum
     174      IF (lswitch(il)) THEN
     175        IF (k>=ineg(il) .AND. buoy(il,k)>0) THEN
     176          itop(il) = k
     177        END IF
     178      END IF
     179    END DO
     180  END DO
     181
     182  ! If there is no layer with positive buoyancy above ineg, set Plfc,
     183  ! Cina and Cinb to arbitrary extreme values.
     184  DO il = 1, ncum
     185    IF (lswitch(il) .AND. itop(il) == nl - 1) THEN
     186      plfc(il) = 1.121
     187      cinb(il) = -1121.
     188      cina(il) = -1122.
     189    END IF
     190  END DO
     191
     192  DO il = 1, ncum
     193    lswitch3(il) = itop(il) < nl -1
     194    lswitch(il) = lswitch1(il) .AND. lswitch2(il) .AND. lswitch3(il)
     195  END DO
     196
    163197  DO il = 1, ncum
    164198    IF (lswitch(il)) THEN
    165199      cinb(il) = 0.
    166200
    167       ! 1.2.1  Calcul de la pression du niveau de flot. nulle juste au-dessus
     201      ! 1.2.2  Calcul de la pression du niveau de flot. nulle juste au-dessus
    168202      ! de LCL
    169203      ! ---------------------------------------------------------------------------
     
    171205        ! In order to get P0, one may interpolate linearly buoyancies
    172206        ! between P(ineg) and P(ineg-1).
    173         p0(il) = (buoy(il,ineg(il))*p(il,ineg(il)-1)-buoy(il,ineg( &
    174           il)-1)*p(il,ineg(il)))/(buoy(il,ineg(il))-buoy(il,ineg(il)-1))
     207        p0(il) = (buoy(il,ineg(il))*p(il,ineg(il)-1)-buoy(il,ineg(il)-1)*p(il,ineg(il)))/ &
     208          (buoy(il,ineg(il))-buoy(il,ineg(il)-1))
    175209      ELSE
    176210        ! In order to get P0, one has to interpolate between P(ineg) and
     
    180214      END IF
    181215    END IF
    182   END DO
    183 
    184   ! 1.2.2 Recompute itop (=1st layer with positive buoyancy above ineg)
    185   ! -------------------------------------------------------------------
    186   DO il = 1, ncum
    187     IF (lswitch(il)) THEN
    188       itop(il) = nl - 1
    189     END IF
    190   END DO
    191 
    192   DO k = nl, 1, -1
    193     DO il = 1, ncum
    194       IF (lswitch(il)) THEN
    195         IF (k>=ineg(il) .AND. buoy(il,k)>0) THEN
    196           itop(il) = k
    197         END IF
    198       END IF
    199     END DO
    200216  END DO
    201217
Note: See TracChangeset for help on using the changeset viewer.