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

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

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


Revision 1.7 - (show annotations) (download)
Thu Nov 6 22:05:08 2003 UTC (20 years, 6 months ago) by heimbach
Branch: MAIN
CVS Tags: checkpoint52l_pre, hrcube4, hrcube5, checkpoint52d_pre, checkpoint52j_pre, checkpoint54d_post, checkpoint54e_post, checkpoint52l_post, checkpoint52k_post, checkpoint55, checkpoint54, checkpoint53, checkpoint52, checkpoint52f_post, checkpoint54f_post, checkpoint55i_post, checkpoint52i_pre, hrcube_1, hrcube_2, hrcube_3, checkpoint55c_post, checkpoint52e_pre, checkpoint52e_post, checkpoint53d_post, checkpoint52b_pre, checkpoint54b_post, checkpoint52m_post, checkpoint55g_post, checkpoint52b_post, checkpoint52c_post, checkpoint52f_pre, checkpoint55d_post, checkpoint54a_pre, checkpoint53c_post, checkpoint55d_pre, checkpoint55j_post, checkpoint54a_post, checkpoint55h_post, checkpoint55b_post, checkpoint53a_post, checkpoint55f_post, checkpoint52d_post, checkpoint53g_post, checkpoint52a_pre, checkpoint52i_post, checkpoint52h_pre, checkpoint53f_post, checkpoint52j_post, branch-netcdf, checkpoint52n_post, checkpoint53b_pre, checkpoint55a_post, checkpoint53b_post, checkpoint52a_post, ecco_c52_e35, checkpoint53d_pre, checkpoint55e_post, checkpoint54c_post, checkpoint51u_post
Branch point for: netcdf-sm0
Changes since 1.6: +1 -3 lines
o merging from ecco-branch
o cleaned some cross-dependencies and updated CPP options

1 C
2 C $Header: /u/gcmpack/MITgcm/pkg/ctrl/ctrl_set_globfld_xy.F,v 1.6 2003/10/30 19:09:05 heimbach Exp $
3 C $Name: $
4
5 #include "CTRL_CPPOPTIONS.h"
6
7 subroutine ctrl_set_globfld_xy(
8 I fname, ivartype, mythid )
9
10 c ==================================================================
11 c SUBROUTINE ctrl_set_globfld_xy
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
36 #ifdef ALLOW_ECCO_OPTIMIZATION
37 #include "optim.h"
38 #endif
39
40 c == routine arguments ==
41
42 character*( 80) fname
43 integer ivartype
44 integer mythid
45
46 c == local variables ==
47
48 #ifndef ALLOW_ECCO_OPTIMIZATION
49 integer optimcycle
50 #endif
51
52 integer bi,bj
53 integer ip,jp
54 integer i,j,k
55 integer itlo,ithi
56 integer jtlo,jthi
57 integer jmin,jmax
58 integer imin,imax
59 integer irec,nrec_nl
60
61 _RL globfld2d( snx,nsx,npx,sny,nsy,npy )
62 _RL globfld3d( snx,nsx,npx,sny,nsy,npy,nr )
63
64 c == external ==
65
66 c == end of interface ==
67
68 jtlo = 1
69 jthi = nsy
70 itlo = 1
71 ithi = nsx
72 jmin = 1
73 jmax = sny
74 imin = 1
75 imax = snx
76
77 c Initialise temporary file
78 do jp = 1,nPy
79 do bj = jtlo,jthi
80 do j = jmin,jmax
81 do ip = 1,nPx
82 do bi = itlo,ithi
83 do i = imin,imax
84 globfld2d(i,bi,ip,j,bj,jp) = 0. _d 0
85 enddo
86 enddo
87 enddo
88 enddo
89 enddo
90 enddo
91 c Initialise temporary file
92 do k = 1,nr
93 do jp = 1,nPy
94 do bj = jtlo,jthi
95 do j = jmin,jmax
96 do ip = 1,nPx
97 do bi = itlo,ithi
98 do i = imin,imax
99 globfld3d(i,bi,ip,j,bj,jp,k) = 0. _d 0
100 enddo
101 enddo
102 enddo
103 enddo
104 enddo
105 enddo
106 enddo
107
108 #ifndef ALLOW_ECCO_OPTIMIZATION
109 optimcycle = 0
110 #endif
111
112 c-- Only the master thread will do I/O.
113 _BEGIN_MASTER( mythid )
114
115 nrec_nl=int(ncvarrecs(ivartype)/Nr)
116 do irec = 1, nrec_nl
117 call MDSWRITEFIELD_3D_GL( fname, ctrlprec, 'RL',
118 & Nr, globfld3d,
119 & irec, optimcycle, mythid)
120 enddo
121
122 do irec = nrec_nl*Nr+1, ncvarrecs(ivartype)
123 call MDSWRITEFIELD_2D_GL( fname, ctrlprec, 'RL',
124 & 1, globfld2d,
125 & irec, optimcycle, mythid)
126 enddo
127
128 _END_MASTER( mythid )
129
130 end

  ViewVC Help
Powered by ViewVC 1.1.22