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

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

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

revision 1.38 by cnh, Fri Nov 6 22:44:45 1998 UTC revision 1.42 by adcroft, Tue May 18 18:01:12 1999 UTC
# Line 20  C     | ===== Line 20  C     | =====
20  C     | C*P* comments indicating place holders for which code is |  C     | C*P* comments indicating place holders for which code is |
21  C     |      presently being developed.                          |  C     |      presently being developed.                          |
22  C     \==========================================================/  C     \==========================================================/
23          IMPLICIT NONE
24    
25  C     == Global variables ===  C     == Global variables ===
26  #include "SIZE.h"  #include "SIZE.h"
# Line 27  C     == Global variables === Line 28  C     == Global variables ===
28  #include "CG2D.h"  #include "CG2D.h"
29  #include "PARAMS.h"  #include "PARAMS.h"
30  #include "DYNVARS.h"  #include "DYNVARS.h"
31    #include "GRID.h"
32    #ifdef ALLOW_KPP
33    #include "KPPMIX.h"
34    #endif
35    
36  C     == Routine arguments ==  C     == Routine arguments ==
37  C     myTime - Current time in simulation  C     myTime - Current time in simulation
# Line 117  C                      index into fVerTe Line 122  C                      index into fVerTe
122        _RL KapGM   (1-OLx:sNx+OLx,1-OLy:sNy+OLy)        _RL KapGM   (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
123        _RL KappaRT (1-Olx:sNx+Olx,1-Oly:sNy+Oly,Nr)        _RL KappaRT (1-Olx:sNx+Olx,1-Oly:sNy+Oly,Nr)
124        _RL KappaRS (1-Olx:sNx+Olx,1-Oly:sNy+Oly,Nr)        _RL KappaRS (1-Olx:sNx+Olx,1-Oly:sNy+Oly,Nr)
125          _RL KappaRU (1-Olx:sNx+Olx,1-Oly:sNy+Oly,Nr)
126          _RL KappaRV (1-Olx:sNx+Olx,1-Oly:sNy+Oly,Nr)
127    
128        INTEGER iMin, iMax        INTEGER iMin, iMax
129        INTEGER jMin, jMax        INTEGER jMin, jMax
# Line 251  C--     Update fields in top level accor Line 258  C--     Update fields in top level accor
258          CALL CORRECTION_STEP(          CALL CORRECTION_STEP(
259       I       bi,bj,iMin,iMax,jMin,jMax,K,       I       bi,bj,iMin,iMax,jMin,jMax,K,
260       I       etaSurfX,etaSurfY,myTime,myThid)       I       etaSurfX,etaSurfY,myTime,myThid)
261            IF (openBoundaries) CALL APPLY_OBCS1( bi, bj, K, myThid )
262          IF ( .NOT. BOTTOM_LAYER ) THEN          IF ( .NOT. BOTTOM_LAYER ) THEN
263  C--      Update fields in layer below according to tendency terms  C--      Update fields in layer below according to tendency terms
264           CALL CORRECTION_STEP(           CALL CORRECTION_STEP(
265       I        bi,bj,iMin,iMax,jMin,jMax,K+1,       I        bi,bj,iMin,iMax,jMin,jMax,K+1,
266       I        etaSurfX,etaSurfY,myTime,myThid)       I        etaSurfX,etaSurfY,myTime,myThid)
267             IF (openBoundaries) CALL APPLY_OBCS1( bi, bj, K+1, myThid )
268          ENDIF          ENDIF
269  #endif  #endif
270  C--     Density of 1st level (below W(1)) reference to level 1  C--     Density of 1st level (below W(1)) reference to level 1
# Line 266  C--     Density of 1st level (below W(1) Line 275  C--     Density of 1st level (below W(1)
275       I     myThid )       I     myThid )
276  #endif  #endif
277    
278          IF ( .NOT. BOTTOM_LAYER ) THEN          IF (       (.NOT. BOTTOM_LAYER)
279    #ifdef ALLOW_KPP
280         &       .AND. (.NOT.usingKPPmixing) ! CONVECT not needed with KPP mixing
281    #endif
282         &     ) THEN
283  C--      Check static stability with layer below  C--      Check static stability with layer below
284  C--      and mix as needed.  C--      and mix as needed.
285  #ifdef  INCLUDE_FIND_RHO_CALL  #ifdef  INCLUDE_FIND_RHO_CALL
# Line 308  C--       Update fields in layer below a Line 321  C--       Update fields in layer below a
321            CALL CORRECTION_STEP(            CALL CORRECTION_STEP(
322       I         bi,bj,iMin,iMax,jMin,jMax,K+1,       I         bi,bj,iMin,iMax,jMin,jMax,K+1,
323       I         etaSurfX,etaSurfY,myTime,myThid)       I         etaSurfX,etaSurfY,myTime,myThid)
324              IF (openBoundaries) CALL APPLY_OBCS1( bi, bj, K+1, myThid )
325           ENDIF           ENDIF
326  #endif  #endif
327  C--      Density of K level (below W(K)) reference to K level  C--      Density of K level (below W(K)) reference to K level
# Line 317  C--      Density of K level (below W(K)) Line 331  C--      Density of K level (below W(K))
331       O      rhoK,       O      rhoK,
332       I      myThid )       I      myThid )
333  #endif  #endif
334           IF ( .NOT. BOTTOM_LAYER ) THEN           IF (       (.NOT. BOTTOM_LAYER)
335    #ifdef ALLOW_KPP
336         &       .AND. (.NOT.usingKPPmixing) ! CONVECT not needed with KPP mixing
337    #endif
338         &      ) THEN
339  C--       Check static stability with layer below and mix as needed.  C--       Check static stability with layer below and mix as needed.
340  C--       Density of K+1 level (below W(K+1)) reference to K level.  C--       Density of K+1 level (below W(K+1)) reference to K level.
341  #ifdef  INCLUDE_FIND_RHO_CALL  #ifdef  INCLUDE_FIND_RHO_CALL
# Line 374  C--      Calculate iso-neutral slopes fo Line 392  C--      Calculate iso-neutral slopes fo
392           ENDDO           ENDDO
393          ENDDO ! K          ENDDO ! K
394    
395    #ifdef ALLOW_KPP
396    C--     Compute KPP mixing coefficients
397            IF (usingKPPmixing) THEN
398             CALL TIMER_START('KVMIX (FIND KPP COEFFICIENTS) [DYNAMICS]'
399         I          , myThid)
400             CALL KVMIX(
401         I               bi, bj, myTime, myThid )
402             CALL TIMER_STOP ('KVMIX (FIND KPP COEFFICIENTS) [DYNAMICS]'
403         I        , myThid)
404            ENDIF
405    #endif
406    
407          DO K = Nr, 1, -1          DO K = Nr, 1, -1
408    
409           kM1  =max(1,k-1)   ! Points to level above k (=k-1)           kM1  =max(1,k-1)   ! Points to level above k (=k-1)
# Line 394  C--      Calculate the total vertical di Line 424  C--      Calculate the total vertical di
424           CALL CALC_DIFFUSIVITY(           CALL CALC_DIFFUSIVITY(
425       I        bi,bj,iMin,iMax,jMin,jMax,K,       I        bi,bj,iMin,iMax,jMin,jMax,K,
426       I        maskC,maskUp,KapGM,K33,       I        maskC,maskUp,KapGM,K33,
427       O        KappaRT,KappaRS,       O        KappaRT,KappaRS,KappaRU,KappaRV,
428       I        myThid)       I        myThid)
429  #endif  #endif
430  C--      Calculate accelerations in the momentum equations  C--      Calculate accelerations in the momentum equations
# Line 402  C--      Calculate accelerations in the Line 432  C--      Calculate accelerations in the
432            CALL CALC_MOM_RHS(            CALL CALC_MOM_RHS(
433       I         bi,bj,iMin,iMax,jMin,jMax,k,kM1,kUp,kDown,       I         bi,bj,iMin,iMax,jMin,jMax,k,kM1,kUp,kDown,
434       I         xA,yA,uTrans,vTrans,rTrans,rVel,maskC,       I         xA,yA,uTrans,vTrans,rTrans,rVel,maskC,
435       I         phiHyd,       I         phiHyd,KappaRU,KappaRV,
436       U         aTerm,xTerm,cTerm,mTerm,pTerm,       U         aTerm,xTerm,cTerm,mTerm,pTerm,
437       U         fZon, fMer, fVerU, fVerV,       U         fZon, fMer, fVerU, fVerV,
438       I         myTime, myThid)       I         myTime, myThid)
# Line 428  C--      Prediction step (step forward a Line 458  C--      Prediction step (step forward a
458           CALL TIMESTEP(           CALL TIMESTEP(
459       I       bi,bj,iMin,iMax,jMin,jMax,K,       I       bi,bj,iMin,iMax,jMin,jMax,K,
460       I       myThid)       I       myThid)
461    C--      Apply open boundary conditions
462             IF (openBoundaries) CALL APPLY_OBCS2( bi, bj, K, myThid )
463    C--      Freeze water
464             IF (allowFreezing)
465         &   CALL FREEZE( bi, bj, iMin, iMax, jMin, jMax, K, myThid )
466  C--      Diagnose barotropic divergence of predicted fields  C--      Diagnose barotropic divergence of predicted fields
467           CALL CALC_DIV_GHAT(           CALL CALC_DIV_GHAT(
468       I       bi,bj,iMin,iMax,jMin,jMax,K,       I       bi,bj,iMin,iMax,jMin,jMax,K,
# Line 448  C--      Cumulative diagnostic calculati Line 483  C--      Cumulative diagnostic calculati
483    
484  C--     Implicit diffusion  C--     Implicit diffusion
485          IF (implicitDiffusion) THEN          IF (implicitDiffusion) THEN
486           CALL IMPLDIFF( bi, bj, iMin, iMax, jMin, jMax,           IF (tempStepping) CALL IMPLDIFF(
487       I                  KappaRT,KappaRS,       I         bi, bj, iMin, iMax, jMin, jMax,
488       I                  myThid )       I         deltaTtracer, KappaRT,recip_HFacC,
489          ENDIF       U         gTNm1,
490         I         myThid )
491             IF (saltStepping) CALL IMPLDIFF(
492         I         bi, bj, iMin, iMax, jMin, jMax,
493         I         deltaTtracer, KappaRS,recip_HFacC,
494         U         gSNm1,
495         I         myThid )
496             IF (momStepping) THEN
497              CALL IMPLDIFF(
498         I         bi, bj, iMin, iMax, jMin, jMax,
499         I         deltaTmom, KappaRU,recip_HFacW,
500         U         gUNm1,
501         I         myThid )
502              CALL IMPLDIFF(
503         I         bi, bj, iMin, iMax, jMin, jMax,
504         I         deltaTmom, KappaRV,recip_HFacS,
505         U         gVNm1,
506         I         myThid )
507    #ifdef INCLUDE_CD_CODE
508              CALL IMPLDIFF(
509         I         bi, bj, iMin, iMax, jMin, jMax,
510         I         deltaTmom, KappaRU,recip_HFacW,
511         U         vVelD,
512         I         myThid )
513              CALL IMPLDIFF(
514         I         bi, bj, iMin, iMax, jMin, jMax,
515         I         deltaTmom, KappaRV,recip_HFacS,
516         U         uVelD,
517         I         myThid )
518    #endif
519             ENDIF ! momStepping
520            ENDIF ! implicitDiffusion
521    
522         ENDDO         ENDDO
523        ENDDO        ENDDO

Legend:
Removed from v.1.38  
changed lines
  Added in v.1.42

  ViewVC Help
Powered by ViewVC 1.1.22