*ID API0F406
*/ U.M. 4.6 unix / source code change form / header   version 06/01/99
*/ CODE WRITERS MUST READ THE ACCOMPANYING INSTRUCTIONS FOR THIS BUILD:
*/  - See http://fr0800/umdoc/hegui/t3e4.6.html#chgfinst
*/ 
*/SOC:-> Correction to convection scheme diagnostics
*/->:    This mod corrects the updraught detrainment and 
*/       downdraught mass flux diagnostic in the
*/       convection scheme. Additionally initialization of diagnostics 
*/       has been moved from CONV_CTL to CONVEC3C to avoid the need 
*/       to initialize local arrays within the load balancing routine. 
*/
*/
*/ Has an entry been lodged in the Problem Reporting System? [N]      
*/
*/ THIS CODE IS INTENDED FOR INCLUSION IN THE 4.6 BUILD      [Y]
*/ .....................................................................
*/   Author[s]:-> A. Grant E-mail:-> almgrant@meto.gov.uk 
*/ Reviewer[s]:-> G. Martin E-mail:->gmmartin@meto.gov.uk
*/
*/    "I have checked this change. When provided, the advance design 
*/  specification was agreed and adequate, and the new code conforms to
*/  Unified Model standards."
*/
*/  DESIGN SPEC. WAS REVIEWED ON: ......      REVIEWER[S] SIGNATURES
*/                                            ----------------------
*/    DATE CODE REVIEWED: ......
*/  .....................................................................
*/
*/  WILL CHANGES AFFECT ANCILLARY FILES?         [N]
*/  ARE ANY CHANGES TO STASHMASTER FILES NEEDED? [N] 
*/  USER INTERFACE ACTION REQUIRED?              [N]
*/ 
*/  TESTED IN CONFIGURATIONS:->
*/  TESTS RUN BY [PERSON]:->
*/ 
*/  WILL THE CHANGES SLOW DOWN THE MODEL?        [N]
*/  -> Further details
*/  CHANGES WILL INCREASE MEMORY CONSUMPTION?    [N]   
*/  -> Further details
*/
*/ | Re-start dumps bit compare with those created without the change 
*/ V MARK [Y| ] BELOW; leave rest of lines untouched.
*/
*/   Control Code    loses bit comparison
*/   Atmosphere (assuming same science options chosen)   loses b.c.
*/   Ocean       loses bit comparison
*/   Wave        loses bit comparison
*/   Reconfiguration   loses bit comparison
*/   Diagnostics      lose bit comparison    Y
*/ For Y2K compliance checking:  
*/ DOES THIS CHANGE INTERACT WITH DATE CALCULATIONS IN ANY WAY? [N]   
*/ 
*/  SECTIONS (TO BE) CHANGED: 5
*/
*/  SECTIONS (TO BE) DELETED? none
*/
*/  NEW SECTIONS?  Fill in form http://www-hc/~hadmk/STASHmaster_change.html,
*/  and give section numbers below:
*/  
*/  *DEFS ADDED OR REMOVED: 
*/
*/  **Existing** decks being changed [with *I, *D, *B directives]
*/ ->
*/
*/  Decks being created or purged [with *DECK, *COMDECK, *PURGEDK]
*/ *......K  Deck name   Section#.vr
*/ -> 
*/ ......................................................................
*/ ANY REFERENCES TO EXTERNAL DOCUMENTS-> instead of design spec.
*/  ...OR ... ADVANCE DESIGN SPECIFICATION (optional) 
*/ ->    
*//////////////////////////////////////////////////////////////////////// 
*//
*//Built by  Alan Grant (hadag) on Thu Mar 23 09:34:20 GMT 2000
*//
*//--------------
*DECLARE CONVEC3C
*//--------------
*I ADR1F405.28
!LL  4.5   27/10/99  Move scatter of compressed BTERM array ahead of
!LL                  point where detrainment diagnostic set A. Grant
!LL  4.5   27/10/99  initialize updraught/downdraught diagnostics in 
!LL                  this routine rather than CONV_CTL. Avoids need
!LL                  to initialize local arrayis in T3e load balancing.
!LL                  A. Grant
*I CONVEC3C.881
C
C INTIALIZE DIAGNOSTIC ARRAYS SELECTED BY STASH FLAGS
C
      IF(FLG_UP_FLX) THEN
       DO K=1,NLEV
*I APB3F405.375
         UP_FLUX(I,K)=0.0
        END DO
       END DO
      END IF
      IF(FLG_DWN_FLX) THEN
       DO K=1,NLEV
        DO I=1,NPNTS
         DWN_FLUX(I,K)=0.0
        END DO
       END DO
      END IF
      IF(FLG_ENTR_UP) THEN
       DO K=1,NLEV
        DO I=1,NPNTS
         ENTRAIN_UP(I,K)=0.0
        END DO
       END DO
      END IF
      IF(FLG_DETR_UP) THEN
       DO K=1,NLEV
        DO I=1,NPNTS
         DETRAIN_UP(I,K)=0.0
        END DO
       END DO
      END IF
      IF(FLG_ENTR_DWN) THEN
       DO K=1,NLEV
        DO I=1,NPNTS
         ENTRAIN_DWN(I,K)=0.0
        END DO
       END DO
      END IF
      IF(FLG_DETR_DWN) THEN
       DO K=1,NLEV
        DO I=1,NPNTS
         DETRAIN_DWN(I,K)=0.0
        END DO
       END DO
      END IF
      DO I=1,NPNTS                                                      
*I CONVEC3C.1989
C SET LOGICALS SO THEY CAN BE USED TO DETERMINE DIAGNOSTICS LATER
C  
      DO I=1,NINIT                                                      
C                                                                       
        BGMK(INDEX3(I)) = BWORK(I,1)                                    
        BTERM(INDEX3(I)) = BWORK(I,3)                                   
        BINIT(INDEX3(I)) = BWORK(I,4)                                   
      ENDDO                                                             
C
*D CONVEC3C.2051,CONVEC3C.2056
 
*//
*//Built by  Alan Grant (hadag) on Thu Mar 23 09:34:21 GMT 2000
*//
*//--------------
*DECLARE DDCALL3C
*//--------------
*I AJC1F405.27
!LL   4.5   27/10/99  Correct downdraught diagnostic for initiatung
!LL                   level. A. Grant
*I DDCALL3C.904
      IF(FLG_DWN_FLX) THEN
C
C IF DOWNDRAUGHT INITIATED SET DIAGNOSTIC ARRAY
C
       DO I=1,NDD
       IF(BDD_START_C(I)) DD_FLUX(INDEX1(I),K)=FLX_DD_K(INDEX1(I))
       END DO
      END IF
*D API2F405.346
