1 |
C |
2 |
C $Header: /u/gcmpack/MITgcm/pkg/ctrl/ctrl_set_globfld_xyz.F,v 1.8 2004/11/16 05:42:12 heimbach Exp $ |
3 |
C $Name: $ |
4 |
|
5 |
#include "CTRL_CPPOPTIONS.h" |
6 |
|
7 |
subroutine ctrl_set_globfld_xyz( |
8 |
I fname, ivartype, mythid ) |
9 |
|
10 |
c ================================================================== |
11 |
c SUBROUTINE ctrl_set_globfld_xyz |
12 |
c ================================================================== |
13 |
c |
14 |
c o initialise field |
15 |
c |
16 |
c started: heimbach@mit.edu, 16-Aug-2001 |
17 |
c |
18 |
c ================================================================== |
19 |
|
20 |
implicit none |
21 |
|
22 |
c == global variables == |
23 |
|
24 |
#include "EEPARAMS.h" |
25 |
#include "SIZE.h" |
26 |
#include "PARAMS.h" |
27 |
#include "GRID.h" |
28 |
|
29 |
#include "ctrl.h" |
30 |
#include "optim.h" |
31 |
|
32 |
c == routine arguments == |
33 |
|
34 |
character*( 80) fname |
35 |
integer ivartype |
36 |
integer mythid |
37 |
|
38 |
c == local variables == |
39 |
|
40 |
integer bi,bj |
41 |
integer ip,jp |
42 |
integer i,j,k |
43 |
integer itlo,ithi |
44 |
integer jtlo,jthi |
45 |
integer jmin,jmax |
46 |
integer imin,imax |
47 |
integer irec |
48 |
|
49 |
_RL globfld3d(1-oLx:sNx+oLx,1-oLy:sNy+oLy,nr,nSx,nSy) |
50 |
|
51 |
c == external == |
52 |
|
53 |
c == end of interface == |
54 |
|
55 |
jtlo = 1 |
56 |
jthi = nsy |
57 |
itlo = 1 |
58 |
ithi = nsx |
59 |
jmin = 1-oLy |
60 |
jmax = sny+oLy |
61 |
imin = 1-oLx |
62 |
imax = snx+oLx |
63 |
|
64 |
c Initialise temporary file |
65 |
do bj = jtlo,jthi |
66 |
do bi = itlo,ithi |
67 |
do k = 1,nr |
68 |
do j = jmin,jmax |
69 |
do i = imin,imax |
70 |
globfld3d(i,j,k,bi,bj) = 0. _d 0 |
71 |
enddo |
72 |
enddo |
73 |
enddo |
74 |
enddo |
75 |
enddo |
76 |
|
77 |
c-- Only the master thread will do I/O. |
78 |
_BEGIN_MASTER( mythid ) |
79 |
|
80 |
do irec = 1, ncvarrecs(ivartype) |
81 |
call MDSWRITEFIELD( fname, ctrlprec,.FALSE., 'RL', |
82 |
& Nr, globfld3d, |
83 |
& irec, optimcycle, mythid) |
84 |
enddo |
85 |
|
86 |
_END_MASTER( mythid ) |
87 |
|
88 |
end |