33 |
|
|
34 |
#include "EEPARAMS.h" |
#include "EEPARAMS.h" |
35 |
#include "SIZE.h" |
#include "SIZE.h" |
36 |
|
cgg Include ECCO_CPPOPTIONS because the ecco_ctrl,cost files |
37 |
|
cgg have headers with options for OBCS masks. |
38 |
|
#include "ECCO_CPPOPTIONS.h" |
39 |
|
|
40 |
#include "ecco.h" |
#include "ecco.h" |
41 |
#include "ctrl.h" |
#include "ctrl.h" |
89 |
integer filensy |
integer filensy |
90 |
_RL fileff |
_RL fileff |
91 |
|
|
92 |
|
cgg( |
93 |
|
_RL gg |
94 |
|
integer igg |
95 |
|
integer iobcs |
96 |
|
cgg) |
97 |
|
|
98 |
c == end of interface == |
c == end of interface == |
99 |
|
|
100 |
c-- The reference i/o unit. |
c-- The reference i/o unit. |
157 |
& k=1,nr) |
& k=1,nr) |
158 |
read( funit ) (((nWetwTile(i,j,k), i=1,nsx), j=1,nsy), |
read( funit ) (((nWetwTile(i,j,k), i=1,nsx), j=1,nsy), |
159 |
& k=1,nr) |
& k=1,nr) |
160 |
|
|
161 |
|
cgg( Add OBCS Mask information into the header section for optimization. |
162 |
|
#ifdef ALLOW_OBCSN_CONTROL |
163 |
|
read(funit) ((((nWetobcsn(i,j,k,iobcs), k=1,nr), |
164 |
|
& iobcs= 1,nobcs), i=1,nsx) , j=1,nsy) |
165 |
|
#endif |
166 |
|
#ifdef ALLOW_OBCSS_CONTROL |
167 |
|
read(funit) ((((nWetobcss(i,j,k,iobcs), k=1,nr), |
168 |
|
& iobcs= 1,nobcs), i=1,nsx) , j=1,nsy) |
169 |
|
#endif |
170 |
|
#ifdef ALLOW_OBCSW_CONTROL |
171 |
|
read(funit) ((((nWetobcsw(i,j,k,iobcs), k=1,nr), |
172 |
|
& iobcs= 1,nobcs), i=1,nsx) , j=1,nsy) |
173 |
|
#endif |
174 |
|
#ifdef ALLOW_OBCSE_CONTROL |
175 |
|
read(funit) ((((nWetobcse(i,j,k,iobcs), k=1,nr), |
176 |
|
& iobcs= 1,nobcs), i=1,nsx) , j=1,nsy) |
177 |
|
#endif |
178 |
|
cgg) |
179 |
read( funit ) (ncvarindex(i), i=1,maxcvars) |
read( funit ) (ncvarindex(i), i=1,maxcvars) |
180 |
read( funit ) (ncvarrecs(i), i=1,maxcvars) |
read( funit ) (ncvarrecs(i), i=1,maxcvars) |
181 |
read( funit ) (ncvarxmax(i), i=1,maxcvars) |
read( funit ) (ncvarxmax(i), i=1,maxcvars) |
272 |
cbuffindex = nwetstile(bi,bj,k) |
cbuffindex = nwetstile(bi,bj,k) |
273 |
else if (ncvargrd(icvar) .eq. 'w') then |
else if (ncvargrd(icvar) .eq. 'w') then |
274 |
cbuffindex = nwetwtile(bi,bj,k) |
cbuffindex = nwetwtile(bi,bj,k) |
275 |
|
cgg( O.B. points have the grid mask "m". |
276 |
|
else if (ncvargrd(icvar) .eq. 'm') then |
277 |
|
cgg From "icvrec", calculate what iobcs must be. |
278 |
|
gg = (icvrec-1)/nobcs |
279 |
|
igg = int(gg) |
280 |
|
iobcs= icvrec - igg*nobcs |
281 |
|
#ifdef ALLOW_OBCSN_CONTROL |
282 |
|
if (icvar .eq. 11) then |
283 |
|
cbuffindex = nwetobcsn(bi,bj,k,iobcs) |
284 |
|
endif |
285 |
|
#endif |
286 |
|
#ifdef ALLOW_OBCSS_CONTROL |
287 |
|
if (icvar .eq. 12) then |
288 |
|
cbuffindex = nwetobcss(bi,bj,k,iobcs) |
289 |
|
endif |
290 |
|
#endif |
291 |
|
#ifdef ALLOW_OBCSW_CONTROL |
292 |
|
if (icvar .eq. 13) then |
293 |
|
cbuffindex = nwetobcsw(bi,bj,k,iobcs) |
294 |
|
endif |
295 |
|
#endif |
296 |
|
#ifdef ALLOW_OBCSE_CONTROL |
297 |
|
if (icvar .eq. 14) then |
298 |
|
cbuffindex = nwetobcse(bi,bj,k,iobcs) |
299 |
|
endif |
300 |
|
#endif |
301 |
|
cgg) |
302 |
endif |
endif |
303 |
if (cbuffindex .gt. 0) then |
if (cbuffindex .gt. 0) then |
304 |
read( funit ) cbuffindex |
read( funit ) cbuffindex |
306 |
read( funit ) (cbuff(ii), ii=1,cbuffindex) |
read( funit ) (cbuff(ii), ii=1,cbuffindex) |
307 |
do icvcomp = 1,cbuffindex |
do icvcomp = 1,cbuffindex |
308 |
vv(icvoffset+icvcomp) = cbuff(icvcomp) |
vv(icvoffset+icvcomp) = cbuff(icvcomp) |
309 |
|
cgg( Right now, the changes to the open boundary velocities are not balanced. |
310 |
|
cgg( The model will crash due to physical reasons. |
311 |
|
cgg( However, we can optimize with respect to just O.B. T and S if the |
312 |
|
cgg( next two lines are uncommented. |
313 |
|
cgg if (iobcs .eq. 3) vv(icvoffset+icvcomp)=0. |
314 |
|
cgg if (iobcs .eq. 4) vv(icvoffset+icvcomp)=0. |
315 |
enddo |
enddo |
316 |
icvoffset = icvoffset + cbuffindex |
icvoffset = icvoffset + cbuffindex |
317 |
endif |
endif |