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

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

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


Revision 1.6 - (hide annotations) (download)
Thu Oct 30 19:09:05 2003 UTC (20 years, 7 months ago) by heimbach
Branch: MAIN
CVS Tags: checkpoint51t_post, checkpoint51s_post, checkpoint51q_post, checkpoint51r_post
Branch point for: branch-nonh
Changes since 1.5: +2 -3 lines
ctrl package totally restructured
o pack/unpack now optional and decoupled from
  xx_/adxx_ I/O
o ctrl_pack/unpack cleaned
  (new routines ctrl_init_ctrlvar.F, pkg/ctrl/ctrl_init_wet.F)
o confined inclusion of AD_CONFIG.h to where necessary.

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

  ViewVC Help
Powered by ViewVC 1.1.22