forked from Leeds-MONC/monc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
monc_driver.F90
46 lines (40 loc) · 1.66 KB
/
monc_driver.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
!> MONC program entry point which simply calls the main procedure in the MONC module
!
program monc_driver
use io_server_mod, only : io_server_run
use monc_mod, only : monc_core_bootstrap
use monc_component_mod, only : component_descriptor_type
use collections_mod, only : list_type, c_add_generic
! Include the autogenerated use modules for each of the components
#ifdef USE_MAKE
#include "components/componentheaders.autogen"
#include "testcases/testcaseheaders.autogen"
#else
#include "componentheaders.static"
#include "testcaseheaders.static"
#endif
implicit none
type(list_type) :: component_descriptions
call get_compiled_components(component_descriptions)
call monc_core_bootstrap(component_descriptions, io_server_run)
contains
subroutine get_compiled_components(component_descriptions)
type(list_type), intent(inout) :: component_descriptions
! Include the autogenerated registration calls for each of the components
#ifdef USE_MAKE
#include "components/componentregistrations.autogen"
#include "testcases/testcaseregistrations.autogen"
#else
#include "componentregistrations.static"
#include "testcaseregistrations.static"
#endif
end subroutine get_compiled_components
!> Called by each component to add itself to the registration list_type
subroutine add_component(component_descriptions, single_description)
type(list_type), intent(inout) :: component_descriptions
type(component_descriptor_type), intent(in) :: single_description
class(*), pointer :: raw_data
allocate(raw_data, source=single_description)
call c_add_generic(component_descriptions, raw_data, .false.)
end subroutine add_component
end program monc_driver