MODFLOW 6 version 6.9.0.dev0
USGS Modular Hydrologic Model
Loading...
Searching...
No Matches
RouterFactory.F90
Go to the documentation of this file.
2 use kindmodule, only: i4b
5#if defined(__WITH_MPI__)
7#endif
8 implicit none
9 private
10
11 public :: create_router
12
13contains
14
15 !> @ Brief Create the proper router, depends on
16 !! simulation mode (parallel or sequential) and type
17 !! of build (with or without mpi)
18 !<
19 function create_router(sim_mode, nr_sols) result(router)
20 character(len=*) :: sim_mode !< simulation mode: SEQUENTIAL or PARALLEL
21 integer(I4B) :: nr_sols !< nr. of solutions
22 class(routerbasetype), pointer :: router !< the router object
23
24 if (sim_mode == 'SEQUENTIAL') then
25 router => create_serial_router()
26 router%nr_virt_solutions = nr_sols
27#if defined(__WITH_MPI__)
28 else if (sim_mode == 'PARALLEL') then
29 router => create_mpi_router()
30 router%nr_virt_solutions = nr_sols
31#endif
32 else
33 router => null()
34 end if
35
36 end function create_router
37
38end module routerfactorymodule
This module defines variable data types.
Definition kind.f90:8
class(routerbasetype) function, pointer, public create_mpi_router()
Factory method to create MPI router.
Definition MpiRouter.f90:59
class(routerbasetype) function, pointer, public create_router(sim_mode, nr_sols)
@ Brief Create the proper router, depends on simulation mode (parallel or sequential) and type of bui...
class(routerbasetype) function, pointer, public create_serial_router()
Factory method to create serial router.