-
Notifications
You must be signed in to change notification settings - Fork 0
/
open_close.f90
86 lines (55 loc) · 2.38 KB
/
open_close.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
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
module fmo_open_close_mod
use qdyn
use fmo_globals_mod
implicit none
private :: module_name
public
character(len=error_l) :: module_name = 'fmo_open_close_mod'
contains
!! @description: open all files used in propagation (and write header info)
subroutine open_prop_files()
integer :: error
character(len=file_l) :: filename
character(len=error_l), parameter :: routine_name = "open_prop_files"
filename = "pop.dat"
call register_file(filename)
open(unit=funit(filename), file=join_path(rf, filename), &
& action='WRITE', iostat=error)
call openerror(module_name, 'open_files', error, filename)
write(funit(filename),'(A1,A14,A18)') '#', 't [fs]', 'populations...'
end subroutine open_prop_files
!! @description: close all files opened in `open_prop_files`
subroutine close_prop_files()
integer :: error
character(len=error_l), parameter :: routine_name = "close_prop_files"
close(unit=funit("pop.dat"), iostat=error)
call closeerror(module_name, routine_name, error)
end subroutine close_prop_files
!! @description: open all files used in OCT (and write header info)
subroutine open_oct_files()
integer :: error
character(len=file_l) :: filename
character(len=error_l), parameter :: routine_name = "open_oct_files"
filename = "tau.dat"
call register_file(filename)
open(unit=funit(filename), file=join_path(rf, filename), &
& action='WRITE', iostat=error)
call openerror(module_name, routine_name, error, filename)
write(funit(filename),'(A1,A9,2A15)') '#', 'iter', 'abs(tau)', 'arg(tau)/pi'
filename = "fluence.dat"
call register_file(filename)
open(unit=funit(filename), file=join_path(rf, filename), &
& action='WRITE', iostat=error)
call openerror(module_name, routine_name, error, filename)
write(funit(filename),'(A1,A9,A25)') '#', 'iter', 'pulse fluence'
end subroutine open_oct_files
!! @description: close all files opened in `open_oct_files`
subroutine close_oct_files()
integer :: error
character(len=error_l), parameter :: routine_name = "close_oct_files"
close(unit=funit("tau.dat"), iostat=error)
call closeerror(module_name, routine_name, error)
close(unit=funit("fluence.dat"), iostat=error)
call closeerror(module_name, routine_name, error)
end subroutine close_oct_files
end module fmo_open_close_mod