MoDeNa  1.0
Software framework facilitating sequential multi-scale modelling
fmodena.f90
1 !
2 !
3 ! ooo ooooo oooooooooo. ooooo ooo
4 ! `88. .888' `888' `Y8b `888b. `8'
5 ! 888b d'888 .ooooo. 888 888 .ooooo. 8 `88b. 8 .oooo.
6 ! 8 Y88. .P 888 d88' `88b 888 888 d88' `88b 8 `88b. 8 `P )88b
7 ! 8 `888' 888 888 888 888 888 888ooo888 8 `88b.8 .oP"888
8 ! 8 Y 888 888 888 888 d88' 888 .o 8 `888 d8( 888
9 ! o8o o888o `Y8bod8P' o888bood8P' `Y8bod8P' o8o `8 `Y888""8o
10 !
11 !Copyright
12 ! 2014-2016 MoDeNa Consortium, All rights reserved.
13 !
14 !License
15 ! This file is part of Modena.
16 !
17 ! Modena is free software; you can redistribute it and/or modify it under
18 ! the terms of the GNU General Public License as published by the Free
19 ! Software Foundation, either version 3 of the License, or (at your option)
20 ! any later version.
21 !
22 ! Modena is distributed in the hope that it will be useful, but WITHOUT ANY
23 ! WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
24 ! FOR A PARTICULAR PURPOSE. See the GNU General Public License
25 ! for more details.
26 !
27 ! You should have received a copy of the GNU General Public License along
28 ! with Modena. If not, see <http://www.gnu.org/licenses/>.
29 
36 
40 
41 module fmodena !command line arguments not implemented yet
42  use iso_c_binding
43 
44  implicit none
45 
46  interface
47  function modena_inputs_new(model) result(inputs) bind(c)
48  import
49  type(c_ptr), value :: model
50  type(c_ptr) :: inputs
51  end function modena_inputs_new
52  function modena_outputs_new(model) result(outputs) bind(c)
53  import
54  type(c_ptr), value :: model
55  type(c_ptr) :: outputs
56  end function modena_outputs_new
57  function modena_model_inputs_argpos(model,name) result(argPos) bind(c,name="modena_model_inputs_argPos")
58  import
59  type(c_ptr), value :: model
60  character(c_char) :: name(*)
61  integer(c_size_t) :: argpos
62  end function modena_model_inputs_argpos
63  function modena_model_outputs_argpos(model,name) result(argPos) bind(c,name="modena_model_outputs_argPos")
64  import
65  type(c_ptr), value :: model
66  character(c_char) :: name(*)
67  integer(c_size_t) :: argpos
68  end function modena_model_outputs_argpos
69  subroutine modena_model_argpos_check(model) bind(c,name="modena_model_argPos_check")
70  import
71  type(c_ptr), value :: model
72  end subroutine modena_model_argpos_check
73  subroutine modena_inputs_set(inputs,argpos,input) bind(c)
74  import
75  type(c_ptr), value :: inputs
76  integer(c_size_t), value :: argpos
77  real(c_double), value :: input
78  end subroutine modena_inputs_set
79  subroutine modena_inputs_destroy(inputs) bind(c)
80  import
81  type(c_ptr), value :: inputs
82  end subroutine modena_inputs_destroy
83  subroutine modena_outputs_destroy(outputs) bind(c)
84  import
85  type(c_ptr), value :: outputs
86  end subroutine modena_outputs_destroy
87  subroutine modena_model_destroy(model) bind(c)
88  import
89  type(c_ptr), value :: model
90  end subroutine modena_model_destroy
91  function modena_outputs_get(outputs,argPos) result(output) bind(c)
92  import
93  type(c_ptr), value :: outputs
94  integer(c_size_t), value :: argpos
95  real(c_double) :: output
96  end function modena_outputs_get
97  function modena_model_new(model_name) result(model) bind(c)
98  import
99  character(c_char) :: model_name(*)
100  type(c_ptr) :: model
101  end function modena_model_new
102  function modena_model_call(model,inputs,outputs) result(ret) bind(c)
103  import
104  type(c_ptr), value :: model
105  type(c_ptr), value :: inputs
106  type(c_ptr), value :: outputs
107  integer(c_int) :: ret
108  end function modena_model_call
109  function modena_error_occurred() result(output) bind(c)
110  import
111  logical(c_bool) :: output
112  end function modena_error_occurred
113  function modena_error() result(output) bind(c)
114  import
115  integer(c_int) :: output
116  end function modena_error
117  end interface
118 
119 end module fmodena
120