/[MITgcm]/MITgcm/model/src/convective_adjustment.F
ViewVC logotype

Diff of /MITgcm/model/src/convective_adjustment.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.2 by adcroft, Fri Feb 2 21:04:47 2001 UTC revision 1.7 by heimbach, Mon May 14 21:46:17 2001 UTC
# Line 1  Line 1 
1  C $Header$  C $Header$
2    C $Name$
3    
4  #include "CPP_OPTIONS.h"  #include "CPP_OPTIONS.h"
5    
# Line 18  C     == Global data == Line 19  C     == Global data ==
19  #include "DYNVARS.h"  #include "DYNVARS.h"
20  #include "GRID.h"  #include "GRID.h"
21    
22    #ifdef ALLOW_TIMEAVE
23    #include "TIMEAVE_STATV.h"
24    #endif
25    
26    #ifdef ALLOW_AUTODIFF_TAMC
27    #include "tamc.h"
28    #include "tamc_keys.h"
29    #endif /* ALLOW_AUTODIFF_TAMC */
30    
31        EXTERNAL DIFFERENT_MULTIPLE        EXTERNAL DIFFERENT_MULTIPLE
32        LOGICAL  DIFFERENT_MULTIPLE        LOGICAL  DIFFERENT_MULTIPLE
33    
# Line 34  C     myThid - Thread number of this ins Line 44  C     myThid - Thread number of this ins
44  #ifdef INCLUDE_CONVECT_CALL  #ifdef INCLUDE_CONVECT_CALL
45    
46  C     == Local variables ==  C     == Local variables ==
47        INTEGER K        INTEGER i, j, K
48        _RL rhoKm1(1-OLx:sNx+OLx,1-OLy:sNy+OLy)        _RL rhoKm1(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
49        _RL rhoK  (1-OLx:sNx+OLx,1-OLy:sNy+OLy)        _RL rhoK  (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
50        _RL ConvectCount(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)        _RL ConvectCount(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)
# Line 42  C     == Local variables == Line 52  C     == Local variables ==
52  C--   Check to see if should convect now  C--   Check to see if should convect now
53        IF ( DIFFERENT_MULTIPLE(cAdjFreq,myTime,myTime-deltaTClock) ) THEN        IF ( DIFFERENT_MULTIPLE(cAdjFreq,myTime,myTime-deltaTClock) ) THEN
54    
55    C-      Initialisation of Convection Counter
56            DO K=1,Nr
57             DO j=1-OLy,sNy+OLy
58              DO i=1-OLx,sNx+OLx
59               ConvectCount(i,j,k) = 0.
60              ENDDO
61             ENDDO
62            ENDDO
63    
64    #ifdef ALLOW_AUTODIFF_TAMC
65              act1 = bi - myBxLo(myThid)
66              max1 = myBxHi(myThid) - myBxLo(myThid) + 1
67    
68              act2 = bj - myByLo(myThid)
69              max2 = myByHi(myThid) - myByLo(myThid) + 1
70    
71              act3 = myThid - 1
72              max3 = nTx*nTy
73    
74              act4 = ikey_dynamics - 1
75    
76              ikey = (act1 + 1) + act2*max1
77         &                      + act3*max1*max2
78         &                      + act4*max1*max2*max3
79    #endif /* ALLOW_AUTODIFF_TAMC */
80    
81  #ifdef  ALLOW_KPP  #ifdef  ALLOW_KPP
82          IF (          IF (
83       &      (.NOT.useKPP) ! CONVECT not needed with KPP mixing       &      (.NOT.useKPP) ! CONVECT not needed with KPP mixing
# Line 52  C--       Loop over all *interior* layer Line 88  C--       Loop over all *interior* layer
88            DO K=2,Nr            DO K=2,Nr
89    
90  #ifdef ALLOW_AUTODIFF_TAMC  #ifdef ALLOW_AUTODIFF_TAMC
91  CADJ STORE theta(:,:,k-1,bi,bj) = comlev1_bibj, key = ikey, byte = isbyte              kkey = (ikey-1)*Nr + k
92  CADJ STORE salt (:,:,k-1,bi,bj) = comlev1_bibj, key = ikey, byte = isbyte  CADJ STORE theta(:,:,k-1,bi,bj) = comlev1_bibj_k, key=kkey, byte=isbyte
93    CADJ STORE salt (:,:,k-1,bi,bj) = comlev1_bibj_k, key=kkey, byte=isbyte
94  #endif /* ALLOW_AUTODIFF_TAMC */  #endif /* ALLOW_AUTODIFF_TAMC */
95  C-          Density of K-1 layer (above W(K)) reference to K-1 T-level  C-          Density of K-1 layer (above W(K)) reference to K-1 T-level
96              CALL FIND_RHO(              CALL FIND_RHO(
# Line 64  C-          Density of K-1 layer (above Line 101  C-          Density of K-1 layer (above
101    
102  C-          Density of K layer (below W(K)) reference to K-1 T-level.  C-          Density of K layer (below W(K)) reference to K-1 T-level.
103  #ifdef ALLOW_AUTODIFF_TAMC  #ifdef ALLOW_AUTODIFF_TAMC
104  CADJ STORE theta(:,:,k,bi,bj) = comlev1_bibj, key = ikey, byte = isbyte  CADJ STORE theta(:,:,k,bi,bj) = comlev1_bibj_k, key=kkey, byte=isbyte
105  CADJ STORE salt (:,:,k,bi,bj) = comlev1_bibj, key = ikey, byte = isbyte  CADJ STORE salt (:,:,k,bi,bj) = comlev1_bibj_k, key=kkey, byte=isbyte
106  #endif /* ALLOW_AUTODIFF_TAMC */  #endif /* ALLOW_AUTODIFF_TAMC */
107              CALL FIND_RHO(              CALL FIND_RHO(
108       I           bi,bj,iMin,iMax,jMin,jMax,K,K-1,eosType,       I           bi,bj,iMin,iMax,jMin,jMax,K,K-1,eosType,
# Line 74  CADJ STORE salt (:,:,k,bi,bj) = comlev1_ Line 111  CADJ STORE salt (:,:,k,bi,bj) = comlev1_
111       I           myThid )       I           myThid )
112    
113  #ifdef ALLOW_AUTODIFF_TAMC  #ifdef ALLOW_AUTODIFF_TAMC
114  CADJ STORE rhoKm1(:,:)  = comlev1_bibj, key = ikey, byte = isbyte  CADJ STORE rhoKm1(:,:)  = comlev1_bibj_k, key = kkey, byte = isbyte
115  CADJ STORE rhoKp1(:,:)  = comlev1_bibj, key = ikey, byte = isbyte  CADJ STORE rhoK  (:,:)  = comlev1_bibj_k, key = kkey, byte = isbyte
116  #endif /* ALLOW_AUTODIFF_TAMC */  #endif /* ALLOW_AUTODIFF_TAMC */
117  C-          Check static stability with layer below and mix as needed.  C-          Check static stability with layer below and mix as needed.
118              CALL CONVECT(              CALL CONVECT(
# Line 86  C-          Check static stability with Line 123  C-          Check static stability with
123  C--       End DO K=1,Nr  C--       End DO K=1,Nr
124            ENDDO            ENDDO
125                
126    #ifdef ALLOW_TIMEAVE
127              IF (myIter.ne.nIter0 .AND. taveFreq.GT.0.) THEN
128                CALL TIMEAVE_CUMULATE(ConvectCountTave, ConvectCount, Nr,
129         I                               deltaTclock, bi, bj, myThid)
130              ENDIF
131    #endif /* ALLOW_TIMEAVE */
132    
133  #ifdef  ALLOW_KPP  #ifdef  ALLOW_KPP
134  C--     End IF (.NOT.useKPP)  C--     End IF (.NOT.useKPP)
135          ENDIF          ENDIF

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.7

  ViewVC Help
Powered by ViewVC 1.1.22