/[MITgcm]/MITgcm/pkg/ctrl/ctrl_set_globfld_yz.F
ViewVC logotype

Contents of /MITgcm/pkg/ctrl/ctrl_set_globfld_yz.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.10 - (show annotations) (download)
Mon May 14 23:06:13 2007 UTC (17 years ago) by heimbach
Branch: MAIN
Changes since 1.9: +13 -16 lines
Cleanup suggested by M. Mazloff

1 C
2 C $Header: /u/gcmpack/MITgcm/pkg/ctrl/ctrl_set_globfld_yz.F,v 1.9 2006/03/24 22:59:39 heimbach Exp $
3 C $Name: $
4
5 #include "CTRL_CPPOPTIONS.h"
6
7 subroutine ctrl_set_globfld_yz(
8 I fname, ivartype, mythid )
9
10 c ==================================================================
11 c SUBROUTINE ctrl_set_globfld_yz
12 c ==================================================================
13 c
14 c o initialise field
15 c
16 c started: heimbach@mit.edu, 16-Aug-2001
17 c
18 c changed: heimbach@mit.edu 17-Jun-2003
19 c merged Armin's changes to replace write of
20 c nr * globfld2d by 1 * globfld3d
21 c (ad hoc fix to speed up global I/O)
22 c
23 c ==================================================================
24
25 implicit none
26
27 c == global variables ==
28
29 #include "EEPARAMS.h"
30 #include "SIZE.h"
31 #include "PARAMS.h"
32 #include "GRID.h"
33
34 #include "ctrl.h"
35 #include "optim.h"
36
37 c == routine arguments ==
38
39 character*( 80) fname
40 integer ivartype
41 integer mythid
42
43 c == local variables ==
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,nrec_nl
53
54 _RL globfldyz( snx,nr,snx,nsx )
55 _RL globfld3d( snx,sny,nr,nsx,nsy )
56
57
58 c == external ==
59
60 c == end of interface ==
61
62 jtlo = 1
63 jthi = nsy
64 itlo = 1
65 ithi = nsx
66 jmin = 1
67 jmax = sny
68 imin = 1
69 imax = snx
70
71 c Initialise temporary file
72 do k = 1,nr
73 do bj = jtlo,jthi
74 do j = jmin,jmax
75 do bi = itlo,ithi
76 globfldyz(j,k,bi,bj) = 0. _d 0
77 enddo
78 enddo
79 enddo
80 enddo
81 c Initialise temporary file
82 do k = 1,nr
83 do bj = jtlo,jthi
84 do j = jmin,jmax
85 do bi = itlo,ithi
86 do i = imin,imax
87 globfld3d(i,j,k,bi,bj) = 0. _d 0
88 enddo
89 enddo
90 enddo
91 enddo
92 enddo
93
94 c-- Only the master thread will do I/O.
95 _BEGIN_MASTER( mythid )
96
97 nrec_nl=int(ncvarrecs(ivartype)/Nx)
98 do irec = 1, nrec_nl
99 call MDSWRITEFIELD( fname, ctrlprec,.FALSE., 'RL',
100 & Nr, globfld3d,
101 & irec, optimcycle, mythid)
102
103 enddo
104
105 CMM( addone for good measure
106 CMM do irec = nrec_nl*Nx+1, ncvarrecs(ivartype)
107 do irec = nrec_nl*Nx+1, ncvarrecs(ivartype)+1
108 CMM)
109 call MDSWRITEFIELDYZ( fname, ctrlprec,.FALSE., 'RL',
110 & Nr, globfldyz,
111 & irec, optimcycle, mythid)
112 enddo
113
114 _END_MASTER( mythid )
115
116 end

  ViewVC Help
Powered by ViewVC 1.1.22