Octopus
io_csv_f.F90
Go to the documentation of this file.
1!! Copyright (C) 2009 X. Andrade
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
19#include "global.h"
20#include "io_binary.h"
21
22module io_csv_oct_m
23 use debug_oct_m
24 use global_oct_m
25
26 implicit none
27
28 private
29
30 public :: &
31 dread_csv, &
33
34contains
35
36 subroutine dread_csv(fname, np, ff, ierr)
37 character(len=*), intent(in) :: fname
38 integer(int64), intent(in) :: np
39 real(real64), intent(inout) :: ff(:)
40 integer, intent(out) :: ierr
41
42 interface
43 subroutine read_csv(np, f, output_type, ierr, fname)
44 use iso_c_binding
45 implicit none
46 integer(C_LONG), intent(in) :: np
47 real(C_DOUBLE), intent(in) :: f
48 integer(C_INT), intent(in) :: output_type
49 integer(C_INT), intent(out) :: ierr
50 character(len=*), intent(in) :: fname
51 end subroutine read_csv
52 end interface
53
54 push_sub(dread_csv)
55
56 call read_csv(np, ff(1), type_double, ierr, trim(fname))
57
58 pop_sub(dread_csv)
59 end subroutine dread_csv
60
61 subroutine io_csv_get_info(fname, dims, ierr)
62 character(len=*), intent(in) :: fname
63 integer(int64), intent(inout) :: dims(:)
64 integer, intent(out) :: ierr
65
66 interface
67 subroutine get_info_csv(dims, ierr, fname)
68 use iso_c_binding
69 implicit none
70 integer(C_LONG), intent(inout) :: dims(:)
71 integer(C_INT), intent(out) :: ierr
72 character(len=*), intent(in) :: fname
73 end subroutine get_info_csv
74 end interface
75
76 push_sub(io_csv_get_info)
77
78 call get_info_csv(dims, ierr, trim(fname))
79
80 pop_sub(io_csv_get_info)
81 end subroutine io_csv_get_info
82
83end module io_csv_oct_m
84
85!! Local Variables:
86!! mode: f90
87!! coding: utf-8
88!! End:
subroutine, public dread_csv(fname, np, ff, ierr)
Definition: io_csv_f.F90:131
subroutine, public io_csv_get_info(fname, dims, ierr)
Definition: io_csv_f.F90:156