4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
24
28# ifdef AD_AVERAGES
30# endif
31# ifdef DISTRIBUTE
33# endif
35# ifdef AD_AVERAGES
37# endif
38
39 implicit none
40
41
42
43 integer, intent(in) :: ng
44
45
46
47 logical :: Ldefine, Lupdate, NewFile, wrtHIS
48
49 integer :: Fcount, ifile, status
50
51 character (len=*), parameter :: MyFile = &
52 & __FILE__
53
55
56# ifdef PROFILE
57
58
59
60
61
63# endif
64
65
66
67
68
69
70
73 END IF
74
75
76
77
78#ifdef BIOLOGY
79 lupdate=.true.
80#else
81 lupdate=.false.
82#endif
83
84
85
86
87
94 END IF
95 END IF
99 ldefine=.false.
100 ELSE
101 ldefine=.true.
102 newfile=.false.
103 END IF
109 END IF
110 ldefine=.true.
111 newfile=.true.
112 ELSE
113 ldefine=.false.
114 END IF
115 IF (ldefine) THEN
118 END IF
120 adm(ng)%load=
adm(ng)%load+1
121 IF (
adm(ng)%load.gt.
adm(ng)%Nfiles)
THEN
123 WRITE (
stdout,10)
'TLM(ng)%load = ',
adm(ng)%load, &
124 &
adm(ng)%Nfiles, trim(
adm(ng)%base), &
125 & ifile
126 END IF
129 & __line__, myfile)) RETURN
130 END IF
132 adm(ng)%Nrec(fcount)=0
134 WRITE (
adm(ng)%name,20) trim(
adm(ng)%base), ifile
135 END IF
136# ifdef DISTRIBUTE
138# endif
139 adm(ng)%files(fcount)=trim(
adm(ng)%name)
143 END IF
146 ELSE
148 END IF
149 ELSE
155 END IF
156 END IF
157 END IF
158
159
160
164 & (mod(
iic(ng)-1,
nadj(ng)).eq.0))
THEN
165# ifdef DISTRIBUTE
167# else
169# endif
171 END IF
172 ELSE
173# ifdef HESSIAN_SO
174 wrthis=(mod(
iic(ng)-1,
nadj(ng)).eq.0)
175# else
178 & (mod(
iic(ng)-1,
nadj(ng)).eq.0)
179 ELSE
180# if defined WEAK_CONSTRAINT && !defined WEAK_NOINTERP
181# ifdef SP4DVAR
182 wrthis=(mod(
iic(ng)-1,
nadj(ng)).eq.0)
183# endif
185 & (mod(
iic(ng)-1,
nadj(ng)).eq.0)
186# else
187 wrthis=(mod(
iic(ng)-1,
nadj(ng)).eq.0)
188# endif
189 END IF
190# endif
191 IF (wrthis) THEN
192# ifdef DISTRIBUTE
194# else
196# endif
198 END IF
199 END IF
200 END IF
201
202# ifdef AD_AVERAGES
203
204
205
206
207
208
209
210
211
220 END IF
221 END IF
224 ldefine=.false.
225 ELSE
226 newfile=.false.
227 ldefine=.true.
228 END IF
234 END IF
235 ldefine=.true.
236 newfile=.true.
237 ELSE
238 ldefine=.false.
239 END IF
240 IF (ldefine) THEN
243 END IF
246 ELSE
248 END IF
249 avg(ng)%load=
avg(ng)%load+1
250 IF (
avg(ng)%load.gt.
avg(ng)%Nfiles)
THEN
252 WRITE (
stdout,10)
'AVG(ng)%load = ',
avg(ng)%load, &
253 &
avg(ng)%Nfiles, trim(
avg(ng)%base), &
254 & ifile
255 END IF
258 & __line__, myfile)) RETURN
259 END IF
261 avg(ng)%Nrec(fcount)=0
263 WRITE (
avg(ng)%name,20) trim(
avg(ng)%base), ifile
264 END IF
265# ifdef DISTRIBUTE
267# endif
268 avg(ng)%files(fcount)=trim(
avg(ng)%name)
273 END IF
274 ELSE
280 END IF
281 END IF
282 END IF
283
284
285
288 & (mod(
iic(ng),
navg(ng)).eq.1))
THEN
289# ifdef DISTRIBUTE
291# else
293# endif
295 END IF
296 END IF
297# endif
298
299# ifdef PROFILE
300
301
302
303
304
306# endif
307
308 10 FORMAT (/,' AD_OUTPUT - multi-file counter ',a,i0, &
309 & ', is greater than Nfiles = ',i0,1x,'dimension', &
310 & /,13x,'in structure when creating next file: ', &
311 & a,'_',i4.4,'.nc', &
312 & /,13x,'Incorrect OutFiles logic in ''read_phypar''.')
313 20 FORMAT (a,'_',i4.4,'.nc')
314
315 RETURN
subroutine, public ad_def_his(ng, ldef)
subroutine, public ad_wrt_his(ng, tile)
subroutine, public close_file(ng, model, s, ncname, lupdate)
subroutine, public def_avg(ng, ldef)
type(t_io), dimension(:), allocatable adm
type(t_io), dimension(:), allocatable avg
character(len=256) sourcefile
integer, dimension(:), allocatable idefadj
integer, dimension(:), allocatable idefavg
integer, dimension(:), allocatable nrrec
integer, dimension(:), allocatable ntimes
integer, dimension(:), allocatable iic
logical, dimension(:), allocatable ldefavg
integer, dimension(:), allocatable navg
logical, dimension(:), allocatable lwrtavg
logical, dimension(:), allocatable ldefadj
logical, dimension(:), allocatable lwrtadj
integer, dimension(:), allocatable ndefavg
logical, dimension(:), allocatable lwrtper
logical, dimension(:), allocatable ldefout
integer, dimension(:), allocatable ntstart
integer, dimension(:), allocatable ndefadj
integer, dimension(:), allocatable nadj
logical function, public founderror(flag, noerr, line, routine)
subroutine, public wrt_avg(ng, tile)
recursive subroutine wclock_off(ng, model, region, line, routine)
recursive subroutine wclock_on(ng, model, region, line, routine)