1 |
#include "CTRL_CPPOPTIONS.h" |
2 |
|
3 |
|
4 |
subroutine ctrl_set_globfld_yz( |
5 |
I fname, ivartype, mythid ) |
6 |
|
7 |
c ================================================================== |
8 |
c SUBROUTINE ctrl_set_globfld_yz |
9 |
c ================================================================== |
10 |
c |
11 |
c o initialise field |
12 |
c |
13 |
c started: heimbach@mit.edu, 16-Aug-2001 |
14 |
c |
15 |
c ================================================================== |
16 |
|
17 |
implicit none |
18 |
|
19 |
c == global variables == |
20 |
|
21 |
#include "EEPARAMS.h" |
22 |
#include "SIZE.h" |
23 |
#include "PARAMS.h" |
24 |
#include "GRID.h" |
25 |
|
26 |
#include "ctrl.h" |
27 |
#include "cost.h" |
28 |
|
29 |
#ifdef ALLOW_ECCO_OPTIMIZATION |
30 |
#include "optim.h" |
31 |
#endif |
32 |
|
33 |
c == routine arguments == |
34 |
|
35 |
character*( 80) fname |
36 |
integer ivartype |
37 |
integer mythid |
38 |
|
39 |
c == local variables == |
40 |
|
41 |
#ifndef ALLOW_ECCO_OPTIMIZATION |
42 |
integer optimcycle |
43 |
#endif |
44 |
|
45 |
integer bi,bj |
46 |
integer ip,jp |
47 |
integer i,j,k |
48 |
integer itlo,ithi |
49 |
integer jtlo,jthi |
50 |
integer jmin,jmax |
51 |
integer imin,imax |
52 |
integer irec |
53 |
|
54 |
_RL globfldyz( nsx,npx,sny,nsy,npy,nr ) |
55 |
|
56 |
c == external == |
57 |
|
58 |
c == end of interface == |
59 |
|
60 |
jtlo = 1 |
61 |
jthi = nsy |
62 |
itlo = 1 |
63 |
ithi = nsx |
64 |
jmin = 1 |
65 |
jmax = sny |
66 |
imin = 1 |
67 |
imax = snx |
68 |
|
69 |
c Initialise temporary file |
70 |
do k = 1,nr |
71 |
do jp = 1,nPy |
72 |
do bj = jtlo,jthi |
73 |
do j = jmin,jmax |
74 |
do ip = 1,nPx |
75 |
do bi = itlo,ithi |
76 |
#ifdef ALLOW_TANGENTLINEAR_RUN |
77 |
globfldyz(bi,ip,j,bj,jp,k) = 1. _d 0 |
78 |
#else |
79 |
globfldyz(bi,ip,j,bj,jp,k) = 0. _d 0 |
80 |
#endif |
81 |
enddo |
82 |
enddo |
83 |
enddo |
84 |
enddo |
85 |
enddo |
86 |
enddo |
87 |
|
88 |
#ifndef ALLOW_ECCO_OPTIMIZATION |
89 |
optimcycle = 0 |
90 |
#endif |
91 |
|
92 |
c-- Only the master thread will do I/O. |
93 |
_BEGIN_MASTER( mythid ) |
94 |
|
95 |
do irec = 1, ncvarrecs(ivartype) |
96 |
call MDSWRITEFIELD_YZ_GL( fname, ctrlprec, 'RL', |
97 |
& Nr, globfldyz, |
98 |
& irec, optimcycle, mythid) |
99 |
enddo |
100 |
|
101 |
_END_MASTER( mythid ) |
102 |
|
103 |
end |