/[MITgcm]/MITgcm/pkg/exf/exf_set_obcs.F
ViewVC logotype

Annotation of /MITgcm/pkg/exf/exf_set_obcs.F

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


Revision 1.8 - (hide annotations) (download)
Thu Oct 11 01:29:16 2007 UTC (16 years, 7 months ago) by dimitri
Branch: MAIN
Changes since 1.7: +168 -3 lines
Starting to implement OBCS for sea ice AREA and HEFF.
This preliminary check-in reads in the open boundary
fields and makes them available to the model.

1 dimitri 1.8 C $Header: /u/gcmpack/MITgcm/pkg/exf/exf_set_obcs.F,v 1.7 2007/04/16 23:27:21 jmc Exp $
2 jmc 1.7 C $Name: $
3    
4 edhill 1.6 #include "EXF_OPTIONS.h"
5 heimbach 1.1
6     subroutine exf_set_obcs_xz (
7 heimbach 1.3 & obcs_fld_xz, obcs_xz_0, obcs_xz_1
8     I , obcs_file, obcsmask
9 heimbach 1.1 I , fac, first, changed, count0, count1
10     I , mycurrenttime, mycurrentiter, mythid
11     & )
12    
13     c ==================================================================
14     c SUBROUTINE exf_set_obcs_xz
15     c ==================================================================
16     c
17     c o set open boundary conditions
18     c
19     c started: heimbach@mit.edu 01-May-2001
20 dimitri 1.4 c mods for pkg/seaice: menemenlis@jpl.nasa.gov 20-Dec-2002
21 heimbach 1.1
22     c ==================================================================
23     c SUBROUTINE exf_set_obcs_xz
24     c ==================================================================
25    
26     implicit none
27    
28     c == global variables ==
29    
30     #include "EEPARAMS.h"
31     #include "SIZE.h"
32     #include "GRID.h"
33 jmc 1.7 #include "EXF_PARAM.h"
34     #include "EXF_CONSTANTS.h"
35 heimbach 1.1
36     c == routine arguments ==
37    
38     _RL obcs_fld_xz(1-olx:snx+olx,Nr,nsx,nsy)
39 heimbach 1.3 _RL obcs_xz_0(1-olx:snx+olx,Nr,nsx,nsy)
40     _RL obcs_xz_1(1-olx:snx+olx,Nr,nsx,nsy)
41    
42 heimbach 1.1 character*(128) obcs_file
43     character*1 obcsmask
44     logical first, changed
45     integer count0, count1
46     _RL fac
47     _RL mycurrenttime
48     integer mycurrentiter
49     integer mythid
50    
51     #ifdef ALLOW_OBCS
52    
53     c == local variables ==
54    
55     integer bi, bj
56 heimbach 1.2 integer i, k
57    
58 heimbach 1.1 c == end of interface ==
59    
60 dimitri 1.4 if ( obcs_file .NE. ' ' ) then
61 heimbach 1.1
62 dimitri 1.4 if ( first ) then
63     call mdsreadfieldxz( obcs_file, exf_iprec, exf_yftype, Nr
64     & , obcs_xz_1, count0, mythid
65     & )
66     endif
67    
68     if (( first ) .or. ( changed )) then
69     call exf_swapffields_xz( obcs_xz_0, obcs_xz_1, mythid )
70    
71     call mdsreadfieldxz( obcs_file, exf_iprec, exf_yftype, Nr
72     & , obcs_xz_1, count1, mythid
73     & )
74     endif
75    
76     do bj = mybylo(mythid),mybyhi(mythid)
77     do bi = mybxlo(mythid),mybxhi(mythid)
78     do k = 1,Nr
79     do i = 1,snx
80     obcs_fld_xz(i,k,bi,bj) =
81     & fac * obcs_xz_0(i,k,bi,bj) +
82     & (exf_one - fac) * obcs_xz_1(i,k,bi,bj)
83     enddo
84     enddo
85     enddo
86     enddo
87 heimbach 1.1
88     endif
89    
90 dimitri 1.8 #endif /* ALLOW_OBCS */
91 heimbach 1.1
92     end
93    
94     subroutine exf_set_obcs_yz (
95 heimbach 1.3 & obcs_fld_yz, obcs_yz_0, obcs_yz_1
96     I , obcs_file, obcsmask
97 heimbach 1.1 I , fac, first, changed, count0, count1
98     I , mycurrenttime, mycurrentiter, mythid
99     & )
100    
101     c ==================================================================
102     c SUBROUTINE exf_set_obcs_yz
103     c ==================================================================
104     c
105     c o set open boundary conditions
106     c
107     c started: heimbach@mit.edu 01-May-2001
108    
109     c ==================================================================
110     c SUBROUTINE exf_set_obcs_yz
111     c ==================================================================
112    
113     implicit none
114    
115     c == global variables ==
116    
117     #include "EEPARAMS.h"
118     #include "SIZE.h"
119     #include "GRID.h"
120 jmc 1.7 #include "EXF_PARAM.h"
121     #include "EXF_CONSTANTS.h"
122 heimbach 1.1
123     c == routine arguments ==
124    
125     _RL obcs_fld_yz(1-oly:sny+oly,Nr,nsx,nsy)
126 heimbach 1.3 _RL obcs_yz_0(1-oly:sny+oly,Nr,nsx,nsy)
127     _RL obcs_yz_1(1-oly:sny+oly,Nr,nsx,nsy)
128 heimbach 1.1 character*(MAX_LEN_FNAM) obcs_file
129     character*1 obcsmask
130     logical first, changed
131     integer count0, count1
132     _RL fac
133     _RL mycurrenttime
134     integer mycurrentiter
135     integer mythid
136    
137     #ifdef ALLOW_OBCS
138    
139     c == local variables ==
140    
141     integer bi, bj
142 heimbach 1.2 integer j, k
143    
144 heimbach 1.1 c == end of interface ==
145    
146 heimbach 1.5 if ( obcs_file .NE. ' ' ) then
147    
148     if ( first ) then
149     call mdsreadfieldyz( obcs_file, exf_iprec, exf_yftype, Nr
150     & , obcs_yz_1, count0, mythid
151     & )
152     endif
153 heimbach 1.1
154 heimbach 1.5 if (( first ) .or. ( changed )) then
155     call exf_swapffields_yz( obcs_yz_0, obcs_yz_1, mythid )
156 heimbach 1.1
157 heimbach 1.5 call mdsreadfieldyz( obcs_file, exf_iprec, exf_yftype, Nr
158     & , obcs_yz_1, count1, mythid
159     & )
160     endif
161 heimbach 1.1
162 heimbach 1.5 do bj = mybylo(mythid),mybyhi(mythid)
163     do bi = mybxlo(mythid),mybxhi(mythid)
164     do k = 1,Nr
165     do j = 1,sny
166     obcs_fld_yz(j,k,bi,bj) =
167     & fac *obcs_yz_0(j,k,bi,bj) +
168     & (exf_one - fac) *obcs_yz_1(j,k,bi,bj)
169     enddo
170     enddo
171 heimbach 1.1 enddo
172 heimbach 1.5 enddo
173    
174     endif
175 heimbach 1.1
176 dimitri 1.8 #endif /* ALLOW_OBCS */
177    
178     end
179    
180     subroutine exf_set_obcs_x (
181     & obcs_fld_x, obcs_x_0, obcs_x_1
182     I , obcs_file, obcsmask
183     I , fac, first, changed, count0, count1
184     I , mycurrenttime, mycurrentiter, mythid
185     & )
186    
187     c ==================================================================
188     c SUBROUTINE exf_set_obcs_x
189     c ==================================================================
190     c
191     c o set open boundary conditions
192     c same as exf_set_obcs_xz but for NR=1
193     c
194     c ==================================================================
195     c SUBROUTINE exf_set_obcs_x
196     c ==================================================================
197    
198     implicit none
199    
200     c == global variables ==
201    
202     #include "EEPARAMS.h"
203     #include "SIZE.h"
204     #include "GRID.h"
205     #include "EXF_PARAM.h"
206     #include "EXF_CONSTANTS.h"
207    
208     c == routine arguments ==
209    
210     _RL obcs_fld_x(1-olx:snx+olx,nsx,nsy)
211     _RL obcs_x_0(1-olx:snx+olx,nsx,nsy)
212     _RL obcs_x_1(1-olx:snx+olx,nsx,nsy)
213    
214     character*(128) obcs_file
215     character*1 obcsmask
216     logical first, changed
217     integer count0, count1
218     _RL fac
219     _RL mycurrenttime
220     integer mycurrentiter
221     integer mythid
222    
223     #ifdef ALLOW_OBCS
224    
225     c == local variables ==
226    
227     integer bi, bj, i
228    
229     c == end of interface ==
230    
231     if ( obcs_file .NE. ' ' ) then
232    
233     if ( first ) then
234     call mdsreadfieldxz( obcs_file, exf_iprec, exf_yftype, 1
235     & , obcs_x_1, count0, mythid
236     & )
237     endif
238    
239     if (( first ) .or. ( changed )) then
240     call exf_swapffields_x( obcs_x_0, obcs_x_1, mythid )
241    
242     call mdsreadfieldxz( obcs_file, exf_iprec, exf_yftype, 1
243     & , obcs_x_1, count1, mythid
244     & )
245     endif
246    
247     do bj = mybylo(mythid),mybyhi(mythid)
248     do bi = mybxlo(mythid),mybxhi(mythid)
249     do i = 1,snx
250     obcs_fld_x(i,bi,bj) =
251     & fac * obcs_x_0(i,bi,bj) +
252     & (exf_one - fac) * obcs_x_1(i,bi,bj)
253     enddo
254     enddo
255     enddo
256    
257     endif
258    
259     #endif /* ALLOW_OBCS */
260    
261     end
262    
263     subroutine exf_set_obcs_y (
264     & obcs_fld_y, obcs_y_0, obcs_y_1
265     I , obcs_file, obcsmask
266     I , fac, first, changed, count0, count1
267     I , mycurrenttime, mycurrentiter, mythid
268     & )
269    
270     c ==================================================================
271     c SUBROUTINE exf_set_obcs_y
272     c ==================================================================
273     c
274     c o set open boundary conditions
275     c same as exf_set_obcs_yz but for NR=1
276     c
277     c ==================================================================
278     c SUBROUTINE exf_set_obcs_y
279     c ==================================================================
280    
281     implicit none
282    
283     c == global variables ==
284    
285     #include "EEPARAMS.h"
286     #include "SIZE.h"
287     #include "GRID.h"
288     #include "EXF_PARAM.h"
289     #include "EXF_CONSTANTS.h"
290    
291     c == routine arguments ==
292    
293     _RL obcs_fld_y(1-oly:sny+oly,Nr,nsx,nsy)
294     _RL obcs_y_0(1-oly:sny+oly,Nr,nsx,nsy)
295     _RL obcs_y_1(1-oly:sny+oly,Nr,nsx,nsy)
296     character*(MAX_LEN_FNAM) obcs_file
297     character*1 obcsmask
298     logical first, changed
299     integer count0, count1
300     _RL fac
301     _RL mycurrenttime
302     integer mycurrentiter
303     integer mythid
304    
305     #ifdef ALLOW_OBCS
306    
307     c == local variables ==
308    
309     integer bi, bj, j
310    
311     c == end of interface ==
312    
313     if ( obcs_file .NE. ' ' ) then
314    
315     if ( first ) then
316     call mdsreadfieldyz( obcs_file, exf_iprec, exf_yftype, 1
317     & , obcs_y_1, count0, mythid
318     & )
319     endif
320    
321     if (( first ) .or. ( changed )) then
322     call exf_swapffields_y( obcs_y_0, obcs_y_1, mythid )
323    
324     call mdsreadfieldyz( obcs_file, exf_iprec, exf_yftype, 1
325     & , obcs_y_1, count1, mythid
326     & )
327     endif
328    
329     do bj = mybylo(mythid),mybyhi(mythid)
330     do bi = mybxlo(mythid),mybxhi(mythid)
331     do j = 1,sny
332     obcs_fld_y(j,bi,bj) =
333     & fac *obcs_y_0(j,bi,bj) +
334     & (exf_one - fac) *obcs_y_1(j,bi,bj)
335     enddo
336     enddo
337     enddo
338    
339     endif
340    
341     #endif /* ALLOW_OBCS */
342 heimbach 1.1
343     end

  ViewVC Help
Powered by ViewVC 1.1.22