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

Annotation of /MITgcm/model/src/momentum_correction_step.F

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


Revision 1.2 - (hide annotations) (download)
Thu Oct 13 19:43:07 2005 UTC (18 years, 7 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint57y_pre, checkpoint57x_post, checkpoint57w_post
Changes since 1.1: +15 -9 lines
add timing information for Shap & Zonal Filter ; update timer message.

1 jmc 1.2 C $Header: /u/gcmpack/MITgcm/model/src/momentum_correction_step.F,v 1.1 2004/07/06 01:01:56 jmc Exp $
2 jmc 1.1 C $Name: $
3    
4     #include "PACKAGES_CONFIG.h"
5     #include "CPP_OPTIONS.h"
6    
7     CBOP
8     C !ROUTINE: MOMENTUM_CORRECTION_STEP
9     C !INTERFACE:
10     SUBROUTINE MOMENTUM_CORRECTION_STEP(myTime, myIter, myThid)
11     C !DESCRIPTION: \bv
12     C *==========================================================*
13 jmc 1.2 C | SUBROUTINE MOMENTUM_CORRECTION_STEP
14 jmc 1.1 C *==========================================================*
15     C |1rst Part : Update U,V.
16     C |
17     C | The arrays used for time stepping are cycled.
18     C | Momentum:
19     C | V(n) = Gv(n) - dt * grad Eta
20     C |
21     C |part1: update U,V
22     C | U*,V* (contained in gU,gV) have the surface
23     C | pressure gradient term added and the result stored
24     C | in U,V (contained in uVel, vVel)
25     C |
26     C |part2: Adjustments
27     C | o Filter U,V (Shapiro Filter, Zonal_Filter)
28     C | o Compute again Eta (exact volume conservation)
29     C | o Compute vertical velocity
30     C *==========================================================*
31     C \ev
32    
33     C !USES:
34     IMPLICIT NONE
35     C == Global variables ===
36     #include "SIZE.h"
37     #include "EEPARAMS.h"
38     #include "PARAMS.h"
39     #include "DYNVARS.h"
40    
41     #ifdef ALLOW_SHAP_FILT
42     #include "SHAP_FILT.h"
43     #endif
44 jmc 1.2 #ifdef ALLOW_ZONAL_FILT
45 jmc 1.1 #include "ZONAL_FILT.h"
46     #endif
47    
48     C !INPUT/OUTPUT PARAMETERS:
49     C == Routine arguments ==
50     C myTime - Current time in simulation
51     C myIter - Current iteration number in simulation
52     C myThid - Thread number for this instance of the routine.
53     _RL myTime
54     INTEGER myIter
55     INTEGER myThid
56    
57     C !LOCAL VARIABLES:
58     C == Local variables
59     _RL phiSurfX(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
60     _RL phiSurfY(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
61     INTEGER iMin,iMax
62     INTEGER jMin,jMax
63     INTEGER bi,bj
64     INTEGER k,i,j
65    
66     CEOP
67    
68     DO bj=myByLo(myThid),myByHi(myThid)
69     DO bi=myBxLo(myThid),myBxHi(myThid)
70    
71     C-- Set up work arrays that need valid initial values
72     DO j=1-OLy,sNy+OLy
73     DO i=1-OLx,sNx+OLx
74     phiSurfX(i,j)=0.
75     phiSurfY(i,j)=0.
76     ENDDO
77     ENDDO
78    
79     C Loop range: Gradients of Eta are evaluated so valid
80     C range is all but first row and column in overlaps.
81     iMin = 1-OLx+1
82     iMax = sNx+OLx
83     jMin = 1-OLy+1
84     jMax = sNy+OLy
85    
86     C- Calculate gradient of surface Potentiel
87     CALL CALC_GRAD_PHI_SURF(
88     I bi,bj,iMin,iMax,jMin,jMax,
89     I etaN,
90     O phiSurfX,phiSurfY,
91     I myThid )
92    
93     C-- Loop over all layers, top to bottom
94     DO K=1,Nr
95    
96     C- Update velocity fields: V(n) = V** - dt * grad Eta
97     IF (momStepping)
98     & CALL CORRECTION_STEP(
99     I bi,bj,iMin,iMax,jMin,jMax,K,
100     I phiSurfX,phiSurfY,myTime,myThid )
101    
102     #ifdef ALLOW_OBCS
103     IF (useOBCS) THEN
104     CALL OBCS_APPLY_UV(bi,bj,K,uVel,vVel,myThid)
105     ENDIF
106     #endif /* ALLOW_OBCS */
107    
108     C-- End DO K=1,Nr
109     ENDDO
110    
111     C-- End of 1rst bi,bj loop
112     ENDDO
113     ENDDO
114    
115     C--- 2nd Part : Adjustment.
116    
117     C-- Filter (and exchange)
118     #ifdef ALLOW_SHAP_FILT
119     IF (useSHAP_FILT) THEN
120 jmc 1.2 IF ( .NOT.shap_filt_uvStar ) THEN
121     CALL TIMER_START('SHAP_FILT_UV [MOM_CORR_STEP]',myThid)
122     CALL SHAP_FILT_APPLY_UV( uVel, vVel, myTime, myIter, myThid )
123     CALL TIMER_STOP ('SHAP_FILT_UV [MOM_CORR_STEP]',myThid)
124     ENDIF
125 jmc 1.1 ENDIF
126 jmc 1.2 #endif
127 jmc 1.1 #ifdef ALLOW_ZONAL_FILT
128     IF (useZONAL_FILT) THEN
129 jmc 1.2 IF ( .NOT.zonal_filt_uvStar ) THEN
130     CALL TIMER_START('ZONAL_FILT_UV [MOM_CORR_STEP]',myThid)
131     CALL ZONAL_FILT_APPLY_UV( uVel, vVel, myThid )
132     CALL TIMER_STOP ('ZONAL_FILT_UV [MOM_CORR_STEP]',myThid)
133     ENDIF
134 jmc 1.1 ENDIF
135 jmc 1.2 #endif
136 jmc 1.1
137     DO bj=myByLo(myThid),myByHi(myThid)
138     DO bi=myBxLo(myThid),myBxHi(myThid)
139    
140     C-- Integrate continuity vertically
141     C-- for vertical velocity and "etaN" (exact volume conservation) :
142     CALL INTEGR_CONTINUITY( bi, bj, uVel, vVel,
143     I myTime, myIter, myThid )
144    
145     C-- End of 2nd bi,bj loop
146     ENDDO
147     ENDDO
148    
149     IF ( exactConserv .AND. implicDiv2Dflow .NE. 0. _d 0)
150     & _EXCH_XY_R8( etaN , myThid )
151    
152     RETURN
153     END

  ViewVC Help
Powered by ViewVC 1.1.22