2 |
C $Header$ |
C $Header$ |
3 |
C $Name$ |
C $Name$ |
4 |
|
|
|
#include "AD_CONFIG.h" |
|
5 |
#include "CTRL_CPPOPTIONS.h" |
#include "CTRL_CPPOPTIONS.h" |
6 |
|
|
|
|
|
7 |
subroutine ctrl_set_globfld_xy( |
subroutine ctrl_set_globfld_xy( |
8 |
I fname, ivartype, mythid ) |
I fname, ivartype, mythid ) |
9 |
|
|
32 |
#include "GRID.h" |
#include "GRID.h" |
33 |
|
|
34 |
#include "ctrl.h" |
#include "ctrl.h" |
|
#include "cost.h" |
|
|
|
|
|
#ifdef ALLOW_ECCO_OPTIMIZATION |
|
35 |
#include "optim.h" |
#include "optim.h" |
|
#endif |
|
36 |
|
|
37 |
c == routine arguments == |
c == routine arguments == |
38 |
|
|
42 |
|
|
43 |
c == local variables == |
c == local variables == |
44 |
|
|
|
#ifndef ALLOW_ECCO_OPTIMIZATION |
|
|
integer optimcycle |
|
|
#endif |
|
|
|
|
45 |
integer bi,bj |
integer bi,bj |
46 |
integer ip,jp |
integer ip,jp |
47 |
integer i,j,k |
integer i,j,k |
51 |
integer imin,imax |
integer imin,imax |
52 |
integer irec,nrec_nl |
integer irec,nrec_nl |
53 |
|
|
54 |
_RL globfld2d( snx,nsx,npx,sny,nsy,npy ) |
_RL globfld2d(1-oLx:sNx+oLx,1-oLy:sNy+oLy,nSx,nSy) |
55 |
_RL globfld3d( snx,nsx,npx,sny,nsy,npy,nr ) |
_RL globfld3d(1-oLx:sNx+oLx,1-oLy:sNy+oLy,nr,nSx,nSy) |
56 |
|
|
57 |
c == external == |
c == external == |
58 |
|
|
62 |
jthi = nsy |
jthi = nsy |
63 |
itlo = 1 |
itlo = 1 |
64 |
ithi = nsx |
ithi = nsx |
65 |
jmin = 1 |
jmin = 1-oLy |
66 |
jmax = sny |
jmax = sny+oLy |
67 |
imin = 1 |
imin = 1-oLx |
68 |
imax = snx |
imax = snx+oLx |
69 |
|
|
70 |
c Initialise temporary file |
c Initialise temporary file |
71 |
do jp = 1,nPy |
do bj = jtlo,jthi |
72 |
do bj = jtlo,jthi |
do bi = itlo,ithi |
73 |
do j = jmin,jmax |
do j = jmin,jmax |
74 |
do ip = 1,nPx |
do i = imin,imax |
75 |
do bi = itlo,ithi |
globfld2d(i,j,bi,bj) = 0. _d 0 |
|
do i = imin,imax |
|
|
globfld2d(i,bi,ip,j,bj,jp) = 0. _d 0 |
|
|
enddo |
|
|
enddo |
|
76 |
enddo |
enddo |
77 |
enddo |
enddo |
78 |
enddo |
enddo |
79 |
enddo |
enddo |
80 |
c Initialise temporary file |
c Initialise temporary file |
81 |
do k = 1,nr |
do bj = jtlo,jthi |
82 |
do jp = 1,nPy |
do bi = itlo,ithi |
83 |
do bj = jtlo,jthi |
do k = 1,nr |
84 |
do j = jmin,jmax |
do j = jmin,jmax |
85 |
do ip = 1,nPx |
do i = imin,imax |
86 |
do bi = itlo,ithi |
globfld3d(i,j,k,bi,bj) = 0. _d 0 |
|
do i = imin,imax |
|
|
globfld3d(i,bi,ip,j,bj,jp,k) = 0. _d 0 |
|
|
enddo |
|
|
enddo |
|
87 |
enddo |
enddo |
88 |
enddo |
enddo |
89 |
enddo |
enddo |
90 |
enddo |
enddo |
91 |
enddo |
enddo |
92 |
|
|
|
#ifndef ALLOW_ECCO_OPTIMIZATION |
|
|
optimcycle = 0 |
|
|
#endif |
|
|
|
|
93 |
c-- Only the master thread will do I/O. |
c-- Only the master thread will do I/O. |
94 |
_BEGIN_MASTER( mythid ) |
_BEGIN_MASTER( mythid ) |
95 |
|
|
96 |
nrec_nl=int(ncvarrecs(ivartype)/Nr) |
nrec_nl=int(ncvarrecs(ivartype)/Nr) |
97 |
do irec = 1, nrec_nl |
do irec = 1, nrec_nl |
98 |
call MDSWRITEFIELD_3D_GL( fname, ctrlprec, 'RL', |
call MDSWRITEFIELD( fname, ctrlprec, .FALSE., 'RL', |
99 |
& Nr, globfld3d, |
& Nr, globfld3d, |
100 |
& irec, optimcycle, mythid) |
& irec, optimcycle, mythid) |
101 |
enddo |
enddo |
102 |
|
|
103 |
do irec = nrec_nl*Nr+1, ncvarrecs(ivartype) |
CMM( add one for good measure |
104 |
call MDSWRITEFIELD_2D_GL( fname, ctrlprec, 'RL', |
CMM do irec = nrec_nl*Nr+1, ncvarrecs(ivartype) |
105 |
|
do irec = nrec_nl*Nr+1, ncvarrecs(ivartype)+1 |
106 |
|
CMM) |
107 |
|
call MDSWRITEFIELD( fname, ctrlprec, .FALSE., 'RL', |
108 |
& 1, globfld2d, |
& 1, globfld2d, |
109 |
& irec, optimcycle, mythid) |
& irec, optimcycle, mythid) |
110 |
enddo |
enddo |