30 |
|
|
31 |
#include "EEPARAMS.h" |
#include "EEPARAMS.h" |
32 |
#include "SIZE.h" |
#include "SIZE.h" |
33 |
|
cgg Include ECCO_CPPOPTIONS because the ecco_ctrl,cost files have headers with |
34 |
|
cgg options for OBCS masks. |
35 |
|
#include "ECCO_CPPOPTIONS.h" |
36 |
|
|
37 |
#include "ecco.h" |
#include "ecco.h" |
38 |
#include "ctrl.h" |
#include "ctrl.h" |
65 |
_RL cbuff( sNx*nSx*nPx*sNy*nSy*nPy ) |
_RL cbuff( sNx*nSx*nPx*sNy*nSy*nPy ) |
66 |
|
|
67 |
character*(128) fname |
character*(128) fname |
68 |
|
cgg( |
69 |
|
_RL gg |
70 |
|
integer igg |
71 |
|
integer iobcs |
72 |
|
cgg) |
73 |
|
|
74 |
c == end of interface == |
c == end of interface == |
75 |
|
|
150 |
& k=1,nr) |
& k=1,nr) |
151 |
write( funit ) (((nWetwTile(i,j,k), i=1,nsx), j=1,nsy), |
write( funit ) (((nWetwTile(i,j,k), i=1,nsx), j=1,nsy), |
152 |
& k=1,nr) |
& k=1,nr) |
153 |
|
|
154 |
|
cgg( Add OBCS Mask information into the header section for optimization. |
155 |
|
#ifdef ALLOW_OBCSN_CONTROL |
156 |
|
write(funit) ((((nWetobcsn(i,j,k,iobcs), k=1,nr), |
157 |
|
& iobcs= 1,nobcs), i=1,nsx) , j=1,nsy) |
158 |
|
#endif |
159 |
|
#ifdef ALLOW_OBCSS_CONTROL |
160 |
|
write(funit) ((((nWetobcss(i,j,k,iobcs), k=1,nr), |
161 |
|
& iobcs= 1,nobcs), i=1,nsx) , j=1,nsy) |
162 |
|
#endif |
163 |
|
#ifdef ALLOW_OBCSW_CONTROL |
164 |
|
write(funit) ((((nWetobcsw(i,j,k,iobcs), k=1,nr), |
165 |
|
& iobcs= 1,nobcs), i=1,nsx) , j=1,nsy) |
166 |
|
#endif |
167 |
|
#ifdef ALLOW_OBCSE_CONTROL |
168 |
|
write(funit) ((((nWetobcse(i,j,k,iobcs), k=1,nr), |
169 |
|
& iobcs= 1,nobcs), i=1,nsx) , j=1,nsy) |
170 |
|
#endif |
171 |
|
cgg) |
172 |
|
|
173 |
write( funit ) (ncvarindex(i), i=1,maxcvars) |
write( funit ) (ncvarindex(i), i=1,maxcvars) |
174 |
write( funit ) (ncvarrecs(i), i=1,maxcvars) |
write( funit ) (ncvarrecs(i), i=1,maxcvars) |
175 |
write( funit ) (ncvarxmax(i), i=1,maxcvars) |
write( funit ) (ncvarxmax(i), i=1,maxcvars) |
200 |
cbuffindex = nwetstile(bi,bj,k) |
cbuffindex = nwetstile(bi,bj,k) |
201 |
else if (ncvargrd(icvar) .eq. 'w') then |
else if (ncvargrd(icvar) .eq. 'w') then |
202 |
cbuffindex = nwetwtile(bi,bj,k) |
cbuffindex = nwetwtile(bi,bj,k) |
203 |
|
|
204 |
|
cgg( O.B. points have the grid mask "m". |
205 |
|
else if (ncvargrd(icvar) .eq. 'm') then |
206 |
|
cgg From "icvrec", calculate what iobcs must be. |
207 |
|
gg = (icvrec-1)/nobcs |
208 |
|
igg = int(gg) |
209 |
|
iobcs= icvrec - igg*nobcs |
210 |
|
#ifdef ALLOW_OBCSN_CONTROL |
211 |
|
if (icvar .eq. 11) then |
212 |
|
cbuffindex = nwetobcsn(bi,bj,k,iobcs) |
213 |
|
endif |
214 |
|
#endif |
215 |
|
#ifdef ALLOW_OBCSS_CONTROL |
216 |
|
if (icvar .eq. 12) then |
217 |
|
cbuffindex = nwetobcss(bi,bj,k,iobcs) |
218 |
|
endif |
219 |
|
#endif |
220 |
|
#ifdef ALLOW_OBCSW_CONTROL |
221 |
|
if (icvar .eq. 13) then |
222 |
|
cbuffindex = nwetobcsw(bi,bj,k,iobcs) |
223 |
|
endif |
224 |
|
#endif |
225 |
|
#ifdef ALLOW_OBCSE_CONTROL |
226 |
|
if (icvar .eq. 14) then |
227 |
|
cbuffindex = nwetobcse(bi,bj,k,iobcs) |
228 |
|
endif |
229 |
|
#endif |
230 |
endif |
endif |
231 |
|
cgg) |
232 |
if (cbuffindex .gt. 0) then |
if (cbuffindex .gt. 0) then |
233 |
do icvcomp = 1,cbuffindex |
do icvcomp = 1,cbuffindex |
234 |
cbuff(icvcomp) = vv(icvoffset + icvcomp) |
cbuff(icvcomp) = vv(icvoffset + icvcomp) |
235 |
|
cgg( Right now, the changes to the open boundary velocities are not balanced. |
236 |
|
cgg( The model will crash due to physical reasons. |
237 |
|
cgg( However, we can optimize with respect to just O.B. T and S if the |
238 |
|
cgg( next two lines are uncommented. |
239 |
|
cgg if (iobcs .eq. 3) cbuff(icvcomp)=0. |
240 |
|
cgg if (iobcs .eq. 4) cbuff(icvcomp)=0. |
241 |
enddo |
enddo |
242 |
write( funit ) cbuffindex |
write( funit ) cbuffindex |
243 |
write( funit ) k |
write( funit ) k |
259 |
return |
return |
260 |
end |
end |
261 |
|
|
262 |
|
|
263 |
|
|
264 |
|
|