IODA Bundle
legacy_test_fortran_api_open_non_existing_file.f90
Go to the documentation of this file.
1
! (C) Copyright 1996-2012 ECMWF.
2
!
3
! This software is licensed under the terms of the Apache Licence Version 2.0
4
! which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
5
! In applying this licence, ECMWF does not waive the privileges and immunities
6
! granted to it by virtue of its status as an intergovernmental organisation nor
7
! does it submit to any jurisdiction.
8
!
9
10
program
test_fortran_api
11
use,
intrinsic
:: iso_c_binding
12
use
odc_c_binding
13
implicit none
14
15
integer
,
parameter
:: max_varlen = 128
16
integer(kind=4)
:: ncolumns = 4
17
18
write
(0,*)
"Calling odb_start..."
19
20
call
odb_start
()
21
22
call
test_fortran_api_non_existing_file
()
23
24
contains
25
26
subroutine
test_fortran_api_non_existing_file
27
implicit none
28
type
(c_ptr) :: odb_handle, odb_it, odb_select_handle, odb_select_it
29
integer(kind=C_INT)
:: cerr
30
character(kind=C_CHAR, len=64)
:: config = c_null_char
31
character(kind=C_CHAR, len=max_varlen)
:: inputfile =
"test_fortran_api_non_existing_file.odb"
//achar(0)
32
character(kind=C_CHAR, len=128)
:: sql=
'select * from "test_fortran_api_non_existing_file.odb";'
//achar(0)
33
34
write
(0,*)
'test_fortran_api_non_existing_file'
35
odb_handle =
odb_read_new
(config, cerr)
36
odb_it =
odb_read_iterator_new
(odb_handle, inputfile, cerr);
37
! This should fail
38
write
(0,*)
'test_fortran_api_non_existing_file: odb_read_iterator_new => '
, cerr
39
if
(cerr == 0) stop 1
40
41
odb_handle =
odb_select_new
(config, cerr)
42
odb_it =
odb_select_iterator_new
(odb_handle, sql, cerr);
43
if
(cerr == 0) stop 1
44
end subroutine
test_fortran_api_non_existing_file
45
46
end program
test_fortran_api
odc_c_binding::odb_read_iterator_new
Create new read iterator.
Definition:
odc_c_binding.f90:79
odc_c_binding::odb_read_new
Definition:
odc_c_binding.f90:65
odc_c_binding::odb_select_iterator_new
Definition:
odc_c_binding.f90:179
odc_c_binding::odb_select_new
Definition:
odc_c_binding.f90:52
odc_c_binding::odb_start
Initialize ODB API. This function must be called before any other function from the ODB API.
Definition:
odc_c_binding.f90:39
test_fortran_api
program test_fortran_api
Definition:
legacy_test_fortran_api_open_non_existing_file.f90:10
test_fortran_api_non_existing_file
subroutine test_fortran_api_non_existing_file
Definition:
legacy_test_fortran_api_open_non_existing_file.f90:27
odc_c_binding
Provides Fortran bindings for ODB API.
Definition:
odc_c_binding.f90:26
odc
src
fortran
legacy_test_fortran_api_open_non_existing_file.f90
Generated on Fri Aug 20 2021 11:49:06 for IODA Bundle by
1.9.1