MODFLOW 6  version 6.8.0.dev0
USGS Modular Hydrologic Model
AtsFactory.F90
Go to the documentation of this file.
2  use simmodule, only: ustop
4 #if defined(__WITH_MPI__)
6 #endif
7  implicit none
8  private
9 
10  public :: create_ats
11 
12 contains
13 
14 !> @brief Factory method to create ATS object, to hide
15 !< the parallel details for the synchronization across ranks
16  function create_ats() result(ats)
18  class(atstype), pointer :: ats
19  ! local
20 #if defined(__WITH_MPI__)
21  class(parallelatstype), pointer :: par_ats
22 #endif
23 
24  if (simulation_mode == 'SEQUENTIAL') then
25  allocate (ats)
26 #if defined(__WITH_MPI__)
27  else if (simulation_mode == 'PARALLEL') then
28  allocate (par_ats)
29  ats => par_ats
30 #endif
31  else
32  call ustop('Unsupported simulation mode for creating ATS: '&
33  &//trim(simulation_mode))
34  end if
35 
36  end function create_ats
37 
38 end module atsfactorymodule
class(atstype) function, pointer, public create_ats()
Factory method to create ATS object, to hide.
Definition: AtsFactory.F90:17
This module contains simulation methods.
Definition: Sim.f90:10
subroutine, public ustop(stopmess, ioutlocal)
Stop the simulation.
Definition: Sim.f90:312
This module contains simulation variables.
Definition: SimVariables.f90:9
character(len=linelength) simulation_mode
Extends ATS so we can do synchronization.
Definition: ParallelAts.f90:14