/[MITgcm]/MITgcm/pkg/ctrl/ctrl_obcsbal.F
ViewVC logotype

Contents of /MITgcm/pkg/ctrl/ctrl_obcsbal.F

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


Revision 1.8 - (show annotations) (download)
Mon Mar 14 17:10:55 2011 UTC (13 years, 2 months ago) by mlosch
Branch: MAIN
CVS Tags: HEAD
Changes since 1.7: +1 -1 lines
FILE REMOVED
remove obsolete and partially broken code, step 2:
remove subroutines

1 C $Header: /u/gcmpack/MITgcm/pkg/ctrl/ctrl_obcsbal.F,v 1.7 2011/03/10 09:14:20 mlosch Exp $
2 C $Name: $
3
4 #include "CTRL_CPPOPTIONS.h"
5 #ifdef ALLOW_OBCS
6 # include "OBCS_OPTIONS.h"
7 #endif
8
9 subroutine ctrl_obcsbal(
10 I mytime,
11 I myiter,
12 I mythid
13 & )
14
15 c ==================================================================
16 c SUBROUTINE ctrl_obcsbal
17 c ==================================================================
18 c
19 c o volumetrically balance the control vector contribution.
20 c o Assume the calendar is identical
21 c for all open boundaries. Need to save the barotropic adjustment
22 c velocity so it can be used in all ctrl_getobcs files.
23 c o WARNING: eastern boundary (not defined) filenames have been a
24 c problem in the past.
25 c
26 c - started G. Gebbie, MIT-WHOI, 15-June-2002
27 c ==================================================================
28 c SUBROUTINE ctrl_obcsvol
29 c ==================================================================
30
31 implicit none
32
33 c == global variables ==
34
35 #include "EEPARAMS.h"
36 #include "SIZE.h"
37 #include "PARAMS.h"
38 #include "GRID.h"
39 #include "DYNVARS.h"
40 #ifdef ALLOW_OBCS
41 # include "OBCS.h"
42 #endif
43
44 #include "ctrl.h"
45 #include "ctrl_dummy.h"
46
47 c == routine arguments ==
48
49 integer myiter
50 _RL mytime
51 integer mythid
52
53 #ifdef BALANCE_CONTROL_VOLFLUX_GLOBAL
54 c == local variables ==
55
56 integer itlo,ithi
57 integer jtlo,jthi
58 integer jmin,jmax
59 integer imin,imax
60
61 _RL volflux
62 _RL area
63 _RL obcsnfac
64
65 logical obcsnfirst, obcsnchanged
66 integer obcsncount0, obcsncount1
67
68 #ifdef ECCO_VERBOSE
69 integer nrec
70 character*(MAX_LEN_MBUF) msgbuf
71 #endif
72
73 c == external functions ==
74
75 integer ilnblnk
76 external ilnblnk
77
78 c == end of interface ==
79
80 jtlo = mybylo(mythid)
81 jthi = mybyhi(mythid)
82 itlo = mybxlo(mythid)
83 ithi = mybxhi(mythid)
84 jmin = 1
85 jmax = sny
86 imin = 1
87 imax = snx
88
89 c-- Read tiled data.
90
91 cgg Assume the number of records is the same for
92 cgg all boundaries. Needs to be improved someday.
93
94 #if (defined (ALLOW_OBCS_CONTROL) || \
95 defined (ALLOW_OBCS_COST_CONTRIBUTION))
96
97 area= 0. d 0
98 volflux = 0. d 0
99
100 #ifdef ECCO_VERBOSE
101 _BEGIN_MASTER( mythid )
102 write(msgbuf,'(a)') ' '
103 call print_message( msgbuf, standardmessageunit,
104 & SQUEEZE_RIGHT , mythid)
105 write(msgbuf,'(a)') ' '
106 call print_message( msgbuf, standardmessageunit,
107 & SQUEEZE_RIGHT , mythid)
108 write(msgbuf,'(a,i9.8)')
109 & ' ctrl_obcsvol: number of records to process: ',nrec
110 call print_message( msgbuf, standardmessageunit,
111 & SQUEEZE_RIGHT , mythid)
112 write(msgbuf,'(a)') ' '
113 call print_message( msgbuf, standardmessageunit,
114 & SQUEEZE_RIGHT , mythid)
115 _END_MASTER( mythid )
116 #endif
117
118 CML I think that this call of ctrl_getrec was forgotten. I also think
119 CML that this code has not been use in ages, so we do not know what it
120 CML actually does, and if it does it correcly.
121 CMLc-- Get the counters, flags, and the interpolation factor.
122 CML call ctrl_GetRec( 'xx_obcsn',
123 CML O obcsnfac, obcsnfirst, obcsnchanged,
124 CML O obcsncount0,obcsncount1,
125 CML I mytime, myiter, mythid )
126 c-- Get the counters, flags, and the interpolation factor.
127 call ctrl_get_gen_rec(
128 I xx_obcsnstartdate, xx_obcsnperiod,
129 O obcsnfac, obcsnfirst, obcsnchanged,
130 O obcsncount0,obcsncount1,
131 I mytime, myiter, mythid )
132
133 c-- Loop over records. For north boundary, we only need V velocity.
134
135 if ( obcsnfirst ) then
136
137 shiftvel(1) = 0. d0
138 shiftvel(2) = 0. d0
139
140 call ctrl_volflux( obcsncount0, area, volflux, mythid)
141
142 c-- Do the global summation.
143 _GLOBAL_SUM_RL( volflux, mythid )
144 _GLOBAL_SUM_RL( area,mythid )
145
146 shiftvel(2) = volflux / area
147 print*,'volflux,area',volflux,area
148 endif
149 cgg End of the obcsnfirst loop.
150
151 if ( ( obcsnfirst) .or. (obcsnchanged)) then
152
153 cgg Swap the value.
154 shiftvel(1) = shiftvel(2)
155
156 volflux = 0. d0
157 area= 0. d0
158
159 call ctrl_volflux( obcsncount1, area, volflux, mythid)
160
161 c-- Do the global summation.
162 _GLOBAL_SUM_RL( volflux, mythid )
163 _GLOBAL_SUM_RL( area,mythid )
164
165 shiftvel(2) = volflux /area
166 print*,'volflux,area',volflux,area
167
168 endif
169 cgg End of the obcsnfirst, obcsnchanged loop.
170
171 #endif
172
173 #endif /* BALANCE_CONTROL_VOLFLUX_GLOBAL */
174
175 return
176 end
177
178
179
180
181
182
183

  ViewVC Help
Powered by ViewVC 1.1.22