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

Contents of /MITgcm/model/src/timestep_wvel.F

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


Revision 1.2 - (show annotations) (download)
Thu Feb 23 20:55:49 2006 UTC (18 years, 3 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint58e_post, checkpoint58h_post, checkpoint58j_post, checkpoint58f_post, checkpoint58d_post, checkpoint58c_post, checkpoint58i_post, checkpoint58g_post, checkpoint58k_post, checkpoint58b_post
Changes since 1.1: +38 -8 lines
1rst implementation of  Implicit IGW using the 3-D solver (use3Dsolver=T)
 and based on the reference stratification

1 C $Header: /u/gcmpack/MITgcm/model/src/timestep_wvel.F,v 1.1 2005/12/15 21:09:00 jmc Exp $
2 C $Name: $
3
4 #include "PACKAGES_CONFIG.h"
5 #include "CPP_OPTIONS.h"
6
7 CBOP
8 C !ROUTINE: TIMESTEP_WVEL
9 C !INTERFACE:
10 SUBROUTINE TIMESTEP_WVEL(
11 I myTime, myIter, myThid )
12 C !DESCRIPTION: \bv
13 C *==========================================================*
14 C | S/R TIMESTEP_WVEL
15 C | o Step model vertical velocity forward in time
16 C *==========================================================*
17 C \ev
18
19 C !USES:
20 IMPLICIT NONE
21 C == Global variables ==
22 #include "SIZE.h"
23 #include "EEPARAMS.h"
24 #include "PARAMS.h"
25 #include "GRID.h"
26 #include "DYNVARS.h"
27 #include "NH_VARS.h"
28 c #include "SURFACE.h"
29
30 C !INPUT/OUTPUT PARAMETERS:
31 C == Routine Arguments ==
32 _RL myTime
33 INTEGER myIter, myThid
34
35 #ifdef ALLOW_NONHYDROSTATIC
36 C !LOCAL VARIABLES:
37 C == Local variables ==
38 INTEGER k,bi,bj
39 INTEGER iMin,iMax,jMin,jMax
40 INTEGER i,j
41 _RL gWtmp(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
42 _RL tmpFac, nh_Fac, igwFac
43 CEOP
44
45 iMin = 1
46 iMax = sNx
47 jMin = 1
48 jMax = sNy
49
50 igwFac = 0.
51 IF ( implicitIntGravWave ) igwFac = horiVertRatio*horiVertRatio
52
53 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
54
55 C tile loops :
56 DO bj=myByLo(myThid),myByHi(myThid)
57 DO bi=myBxLo(myThid),myBxHi(myThid)
58
59 IF ( nonHydrostatic ) THEN
60 nh_Fac = 0.
61 IF ( nh_Am2.NE.0. ) nh_Fac = 1. _d 0 / nh_Am2
62
63 k = 1
64 DO j=1-Oly,sNy+Oly
65 DO i=1-Olx,sNx+Olx
66 gW(i,j,k,bi,bj) = wVel(i,j,k,bi,bj)
67 ENDDO
68 ENDDO
69
70 DO k=2,Nr
71
72 C apply mask to gW and keep a copy of wVel in gW:
73 DO j=1-Oly,sNy+Oly
74 DO i=1-Olx,sNx+Olx
75 gWtmp(i,j) = gW(i,j,k,bi,bj)
76 & *maskC(i,j,k,bi,bj)*maskC(i,j,k-1,bi,bj)
77 gW(i,j,k,bi,bj) = wVel(i,j,k,bi,bj)
78 ENDDO
79 ENDDO
80 C Step forward vertical velocity
81 tmpFac = nh_Fac + igwFac*dBdrRef(k)*deltaTMom*dTtracerLev(k)
82 IF (tmpFac.GT.0. ) tmpFac = 1. _d 0 / tmpFac
83 DO j=jMin,jMax
84 DO i=iMin,iMax
85 wVel(i,j,k,bi,bj) = wVel(i,j,k,bi,bj)
86 & + deltaTmom*tmpFac*gWtmp(i,j)
87 ENDDO
88 ENDDO
89
90 C- End of k loop
91 ENDDO
92
93 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
94
95 #ifdef ALLOW_OBCS
96 C-- This call is aesthetic: it makes the W field
97 C consistent with the OBs but this has no algorithmic
98 C impact. This is purely for diagnostic purposes.
99 IF (useOBCS) THEN
100 DO k=1,Nr
101 CALL OBCS_APPLY_W( bi, bj, k, wVel, myThid )
102 ENDDO
103 ENDIF
104 #endif /* ALLOW_OBCS */
105
106 ELSEIF ( implicitIntGravWave ) THEN
107 C keep a copy of wVel in gW:
108 DO k=1,Nr
109 DO j=1-Oly,sNy+Oly
110 DO i=1-Olx,sNx+Olx
111 gW(i,j,k,bi,bj) = wVel(i,j,k,bi,bj)
112 ENDDO
113 ENDDO
114 ENDDO
115
116 C- End if nonHydrostatic / elseif implicitIntGravWave
117 ENDIF
118
119 C- End of bi,bj loops
120 ENDDO
121 ENDDO
122
123 #endif /* ALLOW_NONHYDROSTATIC */
124
125 RETURN
126 END

  ViewVC Help
Powered by ViewVC 1.1.22