-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathio.F90
57 lines (37 loc) · 1.14 KB
/
io.F90
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
module io
#include "definition.h"
use grid_data, only : gr_xCoord, gr_V, gr_ibeg, gr_iend
use sim_data, only : sim_name
implicit none
integer, save :: nCounter
contains
subroutine io_writeLog(zerodt)
implicit none
integer, intent(IN) :: zerodt
character(len=35) :: ofile
ofile = 'slug_'//trim(sim_name)//'.log'
open(unit=30,file=ofile,status='unknown')
write(30,930)zerodt
930 format(i5)
close(30)
end subroutine io_writeLog
subroutine io_writeOutput(t,nstep,ioCounter)
implicit none
real, intent(IN) :: t
integer, intent(IN) :: nstep,ioCounter
integer :: i,nVar,nCell
character(len=35) :: ofile
character(len=5) :: cCounter
! convert conter number to character
write(cCounter,910) ioCounter + 10000
! file name for ascii output
ofile = 'slug_'//trim(sim_name)//'_'//cCounter//'.dat'
open(unit=20,file=ofile,status='unknown')
do i=gr_ibeg,gr_iend
write(20,920)gr_xCoord(i),(gr_V(nVar,i),nVar=1,NUMB_VAR)
end do
910 format(i5)
920 format(1x,f16.8,1x,NUMB_VAR f32.16)
close(20)
end subroutine io_writeOutput
end module io