Newer
Older
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
!-----------------------------------------------------------------------------
!
!
SUBROUTINE step(n)
!
!
!-----------------------------------------------------------------------------
!
!
! Subroutine to advance the state of the system by one large
! timestep.
!
!
!-----------------------------------------------------------------------------
USE fly_h
implicit none
INCLUDE 'mpif.h'
! Declaration of local variables.
! -------------------------------
INTEGER(KIND=8) :: n
REAL(KIND=8) :: c0,c1,ctot
!-----------------------------------------------------------------------------
! TREE BUILDING + FORCE_COMPUTE
!-----------------------------------------------------------------------------
CALL MPI_BARRIER(MPI_COMM_WORLD,ierror)
c0=MPI_WTIME()
CALL step_force('acc ')
CALL MPI_BARRIER(MPI_COMM_WORLD,ierror)
c1=MPI_WTIME()
ctot=c1-c0
IF(me.eq.0) THEN
write(uterm,*) 'STEP_FORCE: executed - time=',ctot
call flush(uterm)
ENDIF
!-----------------------------------------------------------------------------
! UPDATE DT
!-----------------------------------------------------------------------------
CALL dt_comp
!-----------------------------------------------------------------------------
! send data to FLASH-code
!-----------------------------------------------------------------------------
#ifdef FLASH
CALL density_send
#endif
!-----------------------------------------------------------------------------
! UPDATE VELOCITY
!-----------------------------------------------------------------------------
CALL upd_vel
CALL MPI_BARRIER(MPI_COMM_WORLD,ierror)
!-----------------------------------------------------------------------------
! UPDATE POSITIONS
!-----------------------------------------------------------------------------
CALL upd_pos
CALL MPI_BARRIER(MPI_COMM_WORLD,ierror)
CALL MPI_BARRIER(MPI_COMM_WORLD,ierror)
tstep=tstep+1
!-----------------------------------------------------------------------------
! Output system state:
!
! wr_native: write the files (binary native format) for the next run
!
! out_32: write the output (binary) intermediate and final files for
! data analysis (post processing) and quick look data files at the time-ste
! indicated in out32.tab file
!-----------------------------------------------------------------------------
c0=MPI_WTIME()
CALL out_32
CALL wr_native(n)
c1=MPI_WTIME()
ctot=c1-c0
if (me .EQ. 0) then
write(uterm,*) 'Output: executed - time=',ctot
call flush(uterm)
endif
CALL MPI_BARRIER(MPI_COMM_WORLD,ierror)
RETURN
END