1 |
C |
2 |
C $Header: $ |
3 |
C $Name: $ |
4 |
|
5 |
#include "AD_CONFIG.h" |
6 |
#include "CTRL_CPPOPTIONS.h" |
7 |
|
8 |
|
9 |
subroutine ctrl_set_globfld_yz( |
10 |
I fname, ivartype, mythid ) |
11 |
|
12 |
c ================================================================== |
13 |
c SUBROUTINE ctrl_set_globfld_yz |
14 |
c ================================================================== |
15 |
c |
16 |
c o initialise field |
17 |
c |
18 |
c started: heimbach@mit.edu, 16-Aug-2001 |
19 |
c |
20 |
c changed: heimbach@mit.edu 17-Jun-2003 |
21 |
c merged Armin's changes to replace write of |
22 |
c nr * globfld2d by 1 * globfld3d |
23 |
c (ad hoc fix to speed up global I/O) |
24 |
c |
25 |
c ================================================================== |
26 |
|
27 |
implicit none |
28 |
|
29 |
c == global variables == |
30 |
|
31 |
#include "EEPARAMS.h" |
32 |
#include "SIZE.h" |
33 |
#include "PARAMS.h" |
34 |
#include "GRID.h" |
35 |
|
36 |
#include "ctrl.h" |
37 |
#include "cost.h" |
38 |
|
39 |
#ifdef ALLOW_ECCO_OPTIMIZATION |
40 |
#include "optim.h" |
41 |
#endif |
42 |
|
43 |
c == routine arguments == |
44 |
|
45 |
character*( 80) fname |
46 |
integer ivartype |
47 |
integer mythid |
48 |
|
49 |
c == local variables == |
50 |
|
51 |
#ifndef ALLOW_ECCO_OPTIMIZATION |
52 |
integer optimcycle |
53 |
#endif |
54 |
|
55 |
integer bi,bj |
56 |
integer ip,jp |
57 |
integer i,j,k |
58 |
integer itlo,ithi |
59 |
integer jtlo,jthi |
60 |
integer jmin,jmax |
61 |
integer imin,imax |
62 |
integer irec,nrec_nl |
63 |
|
64 |
_RL globfldyz( nsx,npx,sny,nsy,npy,nr ) |
65 |
_RL globfld3d( snx,nsx,npx,sny,nsy,npy,nr ) |
66 |
|
67 |
c == external == |
68 |
|
69 |
c == end of interface == |
70 |
|
71 |
jtlo = 1 |
72 |
jthi = nsy |
73 |
itlo = 1 |
74 |
ithi = nsx |
75 |
jmin = 1 |
76 |
jmax = sny |
77 |
imin = 1 |
78 |
imax = snx |
79 |
|
80 |
c Initialise temporary file |
81 |
do k = 1,nr |
82 |
do jp = 1,nPy |
83 |
do bj = jtlo,jthi |
84 |
do j = jmin,jmax |
85 |
do ip = 1,nPx |
86 |
do bi = itlo,ithi |
87 |
globfldyz(bi,ip,j,bj,jp,k) = 0. _d 0 |
88 |
enddo |
89 |
enddo |
90 |
enddo |
91 |
enddo |
92 |
enddo |
93 |
enddo |
94 |
c Initialise temporary file |
95 |
do k = 1,nr |
96 |
do jp = 1,nPy |
97 |
do bj = jtlo,jthi |
98 |
do j = jmin,jmax |
99 |
do ip = 1,nPx |
100 |
do bi = itlo,ithi |
101 |
do i = imin,imax |
102 |
globfld3d(i,bi,ip,j,bj,jp,k) = 0. _d 0 |
103 |
enddo |
104 |
enddo |
105 |
enddo |
106 |
enddo |
107 |
enddo |
108 |
enddo |
109 |
enddo |
110 |
|
111 |
#ifndef ALLOW_ECCO_OPTIMIZATION |
112 |
optimcycle = 0 |
113 |
#endif |
114 |
|
115 |
c-- Only the master thread will do I/O. |
116 |
_BEGIN_MASTER( mythid ) |
117 |
|
118 |
nrec_nl=int(ncvarrecs(ivartype)/snx) |
119 |
do irec = 1, nrec_nl |
120 |
call MDSWRITEFIELD_3D_GL( fname, ctrlprec, 'RL', |
121 |
& Nr, globfld3d, |
122 |
& irec, optimcycle, mythid) |
123 |
enddo |
124 |
|
125 |
do irec = nrec_nl*snx+1, ncvarrecs(ivartype) |
126 |
call MDSWRITEFIELD_YZ_GL( fname, ctrlprec, 'RL', |
127 |
& Nr, globfldyz, |
128 |
& irec, optimcycle, mythid) |
129 |
enddo |
130 |
|
131 |
_END_MASTER( mythid ) |
132 |
|
133 |
end |