/[MITgcm]/MITgcm/pkg/obcs/obcs_init_variables.F
ViewVC logotype

Contents of /MITgcm/pkg/obcs/obcs_init_variables.F

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


Revision 1.11 - (show annotations) (download)
Fri Sep 24 14:31:16 2004 UTC (19 years, 8 months ago) by mlosch
Branch: MAIN
CVS Tags: checkpoint55g_post, checkpoint55d_post, checkpoint55d_pre, checkpoint55f_post, checkpoint55e_post
Changes since 1.10: +10 -1 lines
o adding exchanges after applying the initial boundary conditions, now
  my 1 tile and 2x2 tile experiment give exactly the same result.

1 C $Header: /u/gcmpack/MITgcm/pkg/obcs/obcs_init_variables.F,v 1.10 2004/09/20 23:22:57 heimbach Exp $
2 C $Name: $
3
4 #include "OBCS_OPTIONS.h"
5
6 SUBROUTINE OBCS_INIT_VARIABLES( myThid )
7 C /==========================================================\
8 C | SUBROUTINE OBCS_INIT_VARIABLES |
9 C | o Initialise OBCs variable data |
10 C |==========================================================|
11 C | |
12 C \==========================================================/
13 IMPLICIT NONE
14
15 C === Global variables ===
16 #include "SIZE.h"
17 #include "EEPARAMS.h"
18 #include "PARAMS.h"
19 #include "DYNVARS.h"
20 #include "OBCS.h"
21
22 C == Routine arguments ==
23 C myThid - Number of this instance of INI_DEPTHS
24 INTEGER myThid
25
26 #ifdef ALLOW_OBCS
27
28 C == Local variables ==
29 INTEGER bi, bj
30 INTEGER I, J, K
31 CHARACTER*(10) suff
32 INTEGER prec
33
34 DO bj = myByLo(myThid), myByHi(myThid)
35 DO bi = myBxLo(myThid), myBxHi(myThid)
36
37 DO K=1,Nr
38 DO I=1-Olx,sNx+Olx
39 #ifdef ALLOW_OBCS_NORTH
40 OBNu(I,K,bi,bj)=0. _d 0
41 OBNv(I,K,bi,bj)=0. _d 0
42 OBNt(I,K,bi,bj)=0. _d 0
43 OBNs(I,K,bi,bj)=0. _d 0
44 # ifdef ALLOW_NONHYDROSTATIC
45 OBNw(I,K,bi,bj)=0. _d 0
46 # endif
47 # ifdef ALLOW_OBCS_PRESCRIBE
48 OBNu0(I,K,bi,bj)=0. _d 0
49 OBNv0(I,K,bi,bj)=0. _d 0
50 OBNt0(I,K,bi,bj)=0. _d 0
51 OBNs0(I,K,bi,bj)=0. _d 0
52 OBNu1(I,K,bi,bj)=0. _d 0
53 OBNv1(I,K,bi,bj)=0. _d 0
54 OBNt1(I,K,bi,bj)=0. _d 0
55 OBNs1(I,K,bi,bj)=0. _d 0
56 # endif
57 #endif /* ALLOW_OBCS_NORTH */
58
59 #ifdef ALLOW_OBCS_SOUTH
60 OBSu(I,K,bi,bj)=0. _d 0
61 OBSv(I,K,bi,bj)=0. _d 0
62 OBSt(I,K,bi,bj)=0. _d 0
63 OBSs(I,K,bi,bj)=0. _d 0
64 # ifdef ALLOW_NONHYDROSTATIC
65 OBSw(I,K,bi,bj)=0. _d 0
66 # endif
67 # ifdef ALLOW_OBCS_PRESCRIBE
68 OBSu0(I,K,bi,bj)=0. _d 0
69 OBSv0(I,K,bi,bj)=0. _d 0
70 OBSt0(I,K,bi,bj)=0. _d 0
71 OBSs0(I,K,bi,bj)=0. _d 0
72 OBSu1(I,K,bi,bj)=0. _d 0
73 OBSv1(I,K,bi,bj)=0. _d 0
74 OBSt1(I,K,bi,bj)=0. _d 0
75 OBSs1(I,K,bi,bj)=0. _d 0
76 # endif
77 #endif /* ALLOW_OBCS_SOUTH */
78 ENDDO
79
80 DO J=1-Oly,sNy+Oly
81 #ifdef ALLOW_OBCS_EAST
82 OBEu(J,K,bi,bj)=0. _d 0
83 OBEv(J,K,bi,bj)=0. _d 0
84 OBEt(J,K,bi,bj)=0. _d 0
85 OBEs(J,K,bi,bj)=0. _d 0
86 # ifdef ALLOW_NONHYDROSTATIC
87 OBEw(J,K,bi,bj)=0. _d 0
88 # endif
89 # ifdef ALLOW_OBCS_PRESCRIBE
90 OBEu0(J,K,bi,bj)=0. _d 0
91 OBEv0(J,K,bi,bj)=0. _d 0
92 OBEt0(J,K,bi,bj)=0. _d 0
93 OBEs0(J,K,bi,bj)=0. _d 0
94 OBEu1(J,K,bi,bj)=0. _d 0
95 OBEv1(J,K,bi,bj)=0. _d 0
96 OBEt1(J,K,bi,bj)=0. _d 0
97 OBEs1(J,K,bi,bj)=0. _d 0
98 # endif
99 #endif /* ALLOW_OBCS_EAST */
100
101 #ifdef ALLOW_OBCS_WEST
102 OBWu(J,K,bi,bj)=0. _d 0
103 OBWv(J,K,bi,bj)=0. _d 0
104 OBWt(J,K,bi,bj)=0. _d 0
105 OBWs(J,K,bi,bj)=0. _d 0
106 # ifdef ALLOW_NONHYDROSTATIC
107 OBWw(J,K,bi,bj)=0. _d 0
108 # endif
109 # ifdef ALLOW_OBCS_PRESCRIBE
110 OBWu0(J,K,bi,bj)=0. _d 0
111 OBWv0(J,K,bi,bj)=0. _d 0
112 OBWt0(J,K,bi,bj)=0. _d 0
113 OBWs0(J,K,bi,bj)=0. _d 0
114 OBWu1(J,K,bi,bj)=0. _d 0
115 OBWv1(J,K,bi,bj)=0. _d 0
116 OBWt1(J,K,bi,bj)=0. _d 0
117 OBWs1(J,K,bi,bj)=0. _d 0
118 # endif
119 #endif /* ALLOW_OBCS_WEST */
120 ENDDO
121 ENDDO
122
123 #ifdef NONLIN_FRSURF
124 DO I=1-Olx,sNx+Olx
125 OBNeta(I,bi,bj)=0.
126 OBSeta(I,bi,bj)=0.
127 ENDDO
128 DO J=1-Oly,sNy+Oly
129 OBEeta(J,bi,bj)=0.
130 OBWeta(J,bi,bj)=0.
131 ENDDO
132 #endif /* NONLIN_FRSURF */
133
134 #ifdef ALLOW_ORLANSKI
135 IF (useOrlanskiNorth.OR.useOrlanskiSouth.OR.
136 & useOrlanskiEast.OR.useOrlanskiWest) THEN
137 CALL ORLANSKI_INIT(bi, bj, myThid)
138 ENDIF
139 #endif /* ALLOW_ORLANSKI */
140
141 ENDDO
142 ENDDO
143
144 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
145 C jmc: here is the logical place to read OBCS-pickup files
146 C but a) without Orlanski: pass the test 1+1=2 without reading pickup.
147 C b) with Orlanski: 1+1=2 fail even with this bit of code
148 IF ( nIter0.NE.0 ) THEN
149 prec = precFloat64
150 IF (pickupSuff.EQ.' ') THEN
151 WRITE(suff,'(I10.10)') nIter0
152 ELSE
153 WRITE(suff,'(A10)') pickupSuff
154 ENDIF
155 c CALL OBCS_READ_CHECKPOINT(prec, nIter0, suff, myThid)
156 ENDIF
157 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
158
159 C-- Apply OBCS values to initial conditions for consistancy
160 DO bj = myByLo(myThid), myByHi(myThid)
161 DO bi = myBxLo(myThid), myBxHi(myThid)
162 CALL OBCS_CALC( bi, bj, startTime, nIter0,
163 & uVel, vVel, wVel, theta, salt, myThid )
164 ENDDO
165 ENDDO
166
167 DO bj = myByLo(myThid), myByHi(myThid)
168 DO bi = myBxLo(myThid), myBxHi(myThid)
169 DO K=1,Nr
170 CALL OBCS_APPLY_UV( bi, bj, k, uVel, vVel, myThid )
171 CALL OBCS_APPLY_TS( bi, bj, k, theta, salt, myThid )
172 ENDDO
173 ENDDO
174 ENDDO
175
176 IF (useOBCSprescribe) THEN
177 C After applying the boundary conditions exchange the 3D-fields.
178 C This is only necessary of the boudnary values have been read
179 C from a file.
180 CALL EXCH_UV_XYZ_RL(uVel,vVel,.TRUE.,myThid)
181 _EXCH_XYZ_R8( theta, myThid )
182 _EXCH_XYZ_R8( salt , myThid )
183 ENDIF
184
185 #endif /* ALLOW_OBCS */
186
187 RETURN
188 END

  ViewVC Help
Powered by ViewVC 1.1.22