-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdataio.src
More file actions
82 lines (82 loc) · 2.29 KB
/
Copy pathdataio.src
File metadata and controls
82 lines (82 loc) · 2.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#include "zeus2d.def"
c=======================================================================
c//////////////////////// SUBROUTINE DATAIO \\\\\\\\\\\\\\\\\\\\\\\\\\
c
subroutine dataio(iswres,iswhdf,iswhst,iswusr)
c
c PURPOSE: Controls data I/O for restart, HDF, history, and USER
c dumps. The latter is an arbitrary routine the user can add for
c problem dependent i/o included using the cpp macroname USERDUMP
c
c INPUT ARGUMENTS: iswres,iswhdf,iswhst=switches for restart,hdf, and
c history dumps. Values of 1 ensure dumps will be made.
c
c OUTPUT ARGUMENTS: none
c
c EXTERNALS: MSAVE, HDFALL, STRTOI, HDUMP, USERDUMP
c
c LOCALS:
c-----------------------------------------------------------------------
implicit NONE
#include "root.h"
c-----------------------------------------------------------------------
integer iswres,iswhdf,iswhst,iswusr
integer incr,strtoi
external msave, hdfall, strtoi, printd, USERDUMP
c\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/////////////////////////////////
c=======================================================================
c
if (dtdump .gt. 0.0 .and. tused .ge. (tdump+dtdump)) then
tdump = tdump + dtdump
iswres = 1
endif
if (dthdf .gt. 0.0 .and. time .ge. (thdf+dthdf)) then
thdf = thdf + dthdf
iswhdf = 1
endif
if (dthist .gt. 0.0 .and. time .ge. (thist+dthist)) then
thist = thist + dthist
iswhst = 1
endif
if (dtusr .gt. 0.0 .and. time .ge. (tusr+dtusr)) then
tusr = tusr + dtusr
iswusr = 1
endif
c
c restart dump
c
if (iswres .eq. 1) then
call msave(resfile)
incr = strtoi(resfile,4,9) + 1
write(resfile,"(a3,i6.6,a8)") 'res',incr,id
iswres=0
endif
c
c HDF dump
c
if (iswhdf .eq. 1) then
call hdfall(hdffile)
incr = strtoi(hdffile,4,9) + 1
write(hdffile,"(a3,i6.6,a8)") 'hdf',incr,id
iswhdf=0
endif
c
c history dump
c
if (iswhst .eq. 1) then
call printd
iswhst=0
endif
c
c USER dump
c
if (iswusr .eq. 1) then
c call USERDUMP(usrfile)
call movie(usrfile)
incr = strtoi(usrfile,4,9) + 1
write(usrfile,"(a3,i6.6,a8)") 'usr',incr,id
iswusr=0
endif
c
return
end