Octopus
write_iter.F90
Go to the documentation of this file.
1!! Copyright (C) 2002-2006 M. Marques, A. Castro, A. Rubio, G. Bertsch, M. Oliveira
2!!
3!! This program is free software; you can redistribute it and/or modify
4!! it under the terms of the GNU General Public License as published by
5!! the Free Software Foundation; either version 2, or (at your option)
6!! any later version.
7!!
8!! This program is distributed in the hope that it will be useful,
9!! but WITHOUT ANY WARRANTY; without even the implied warranty of
10!! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11!! GNU General Public License for more details.
12!!
13!! You should have received a copy of the GNU General Public License
14!! along with this program; if not, write to the Free Software
15!! Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
16!! 02110-1301, USA.
17!!
18#include "global.h"
19
22
23 use iso_c_binding
24 use string_oct_m
25
26 implicit none
27 private
28
29 public :: &
42
43 ! ---------------------------------------------------------
45 interface
46
47 subroutine write_iter_clear(out)
48 use iso_c_binding
49 implicit none
50 type(c_ptr), intent(inout) :: out
51 end subroutine write_iter_clear
52
53 subroutine write_iter_flush(out)
54 use iso_c_binding
55 implicit none
56 type(c_ptr), intent(inout) :: out
57 end subroutine write_iter_flush
58
59 subroutine write_iter_end(out)
60 use iso_c_binding
61 implicit none
62 type(c_ptr), intent(inout) :: out
63 end subroutine write_iter_end
64
68 subroutine write_iter_start(out)
69 use iso_c_binding
70 implicit none
71 type(c_ptr), intent(inout) :: out
72 end subroutine write_iter_start
73
75 subroutine write_iter_set(out, iter)
76 use iso_c_binding
77 implicit none
78 type(c_ptr), intent(inout) :: out
79 integer, intent(in) :: iter
80 end subroutine write_iter_set
81
82 subroutine write_iter_header_start(out)
83 use iso_c_binding
84 implicit none
85 type(c_ptr), intent(inout) :: out
86 end subroutine write_iter_header_start
87
88 subroutine write_iter_nl(out)
89 use iso_c_binding
90 implicit none
91 type(c_ptr), intent(inout) :: out
92 end subroutine write_iter_nl
93 end interface
94
95 interface write_iter_double
96 subroutine write_iter_double_1(out, d, n)
97 use iso_c_binding
98 implicit none
99 type(c_ptr), intent(inout) :: out
100 integer, intent(in) :: n
101 real(c_double), intent(in) :: d
102 end subroutine write_iter_double_1
103
104 subroutine write_iter_double_n(out, d, n)
105 use iso_c_binding
106 implicit none
107 type(c_ptr), intent(inout) :: out
108 integer, intent(in) :: n
109 real(c_double), intent(in) :: d(n)
110 end subroutine write_iter_double_n
111 end interface write_iter_double
112
113 interface write_iter_int
114 subroutine write_iter_int_1(out, i, n)
115 use iso_c_binding
116 implicit none
117 type(c_ptr), intent(inout) :: out
118 integer, intent(in) :: n
119 integer, intent(in) :: i
120 end subroutine write_iter_int_1
121
122 subroutine write_iter_int_n(out, i, n)
123 use iso_c_binding
124 implicit none
125 type(c_ptr), intent(inout) :: out
126 integer, intent(in) :: n
127 integer, intent(in) :: i(n)
128 end subroutine write_iter_int_n
129 end interface write_iter_int
130
131contains
132
133 subroutine write_iter_init(out, iter, factor, file)
134 type(c_ptr), intent(inout) :: out
135 integer, intent(in) :: iter
136 real(c_double), intent(in) :: factor
137 character(len=*), intent(in) :: file
138
139 interface write_iter_init_low
140 subroutine write_iter_init_low(out, iter, factor, file) bind(c, name="write_iter_init")
141 use iso_c_binding
142 implicit none
143 type(c_ptr), intent(inout) :: out
144 integer, intent(in) :: iter
145 real(c_double), intent(in) :: factor
146 character(kind=c_char), intent(in) :: file(*)
147 end subroutine write_iter_init_low
148 end interface write_iter_init_low
149
150 call write_iter_init_low(out, iter, factor, string_f_to_c(file))
151 end subroutine write_iter_init
152
153 subroutine write_iter_header(out, string)
154 type(c_ptr), intent(inout) :: out
155 character(len=*), intent(in) :: string
156
157 interface write_iter_header_low
158 subroutine write_iter_header_low(out, string) bind(c,name='write_iter_header')
159 use iso_c_binding
160 implicit none
161 type(c_ptr), intent(inout) :: out
162 character(kind=c_char), intent(in) :: string(*)
163 end subroutine write_iter_header_low
164 end interface write_iter_header_low
165
166 call write_iter_header_low(out, string_f_to_c(string))
167 end subroutine write_iter_header
168
169 subroutine write_iter_string(out, string)
170 type(c_ptr), intent(inout) :: out
171 character(len=*), intent(in) :: string
172
173 interface write_iter_string_low
174 subroutine write_iter_string_low(out, string) bind(c, name='write_iter_string')
175 use iso_c_binding
176 implicit none
177 type(c_ptr), intent(inout) :: out
178 character(kind=c_char), intent(in) :: string(*)
179 end subroutine write_iter_string_low
180 end interface write_iter_string_low
181
182 call write_iter_string_low(out, string_f_to_c(string))
183 end subroutine write_iter_string
184
185end module write_iter_oct_m
186
187!! Local Variables:
188!! mode: f90
189!! coding: utf-8
190!! End:
Sets the iteration number to the C object.
Definition: write_iter.F90:170
Writes to the corresponding file and adds one to the iteration. Must be called after write_iter_init(...
Definition: write_iter.F90:163
character(kind=c_char, len=1) function, dimension(:), allocatable, public string_f_to_c(f_string)
convert a Fortran string to a C string
Definition: string.F90:273
Explicit interfaces to C functions, defined in write_iter_low.cc.
Definition: write_iter.F90:116
subroutine, public write_iter_header(out, string)
Definition: write_iter.F90:249
subroutine, public write_iter_string(out, string)
Definition: write_iter.F90:265
subroutine, public write_iter_init(out, iter, factor, file)
Definition: write_iter.F90:229