MODFLOW 6  version 6.7.0.dev0
USGS Modular Hydrologic Model
RouterFactory.F90
Go to the documentation of this file.
4 #if defined(__WITH_MPI__)
6 #endif
7  implicit none
8  private
9 
10  public :: create_router
11 
12 contains
13 
14  !> @ Brief Create the proper router, depends on
15  !! simulation mode (parallel or sequential) and type
16  !! of build (with or without mpi)
17  !<
18  function create_router(sim_mode) result(router)
19  character(len=*) :: sim_mode !< simulation mode: SEQUENTIAL or PARALLEL
20  class(routerbasetype), pointer :: router !< the router object
21 
22  if (sim_mode == 'SEQUENTIAL') then
23  router => create_serial_router()
24 #if defined(__WITH_MPI__)
25  else if (sim_mode == 'PARALLEL') then
26  router => create_mpi_router()
27 #endif
28  else
29  router => null()
30  end if
31 
32  end function create_router
33 
34 end module routerfactorymodule
class(routerbasetype) function, pointer, public create_mpi_router()
Factory method to create MPI router.
Definition: MpiRouter.f90:56
class(routerbasetype) function, pointer, public create_router(sim_mode)
@ 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.