MODFLOW 6  version 6.7.0.dev0
USGS Modular Hydrologic Model
dag_module.f90 File Reference

Go to the source code of this file.

Data Types

type  dag_module::vertex
 
type  dag_module::dag
 

Modules

module  dag_module
 

Functions/Subroutines

subroutine dag_module::dag_destroy (me)
 
subroutine dag_module::set_edge_vector (me, edges)
 
subroutine dag_module::add_edge (me, edge)
 
pure integer function, dimension(:), allocatable dag_module::dag_get_edges (me, ivertex)
 
pure integer function, dimension(:), allocatable dag_module::dag_get_dependencies (me, ivertex)
 
subroutine dag_module::dag_set_vertices (me, nvertices)
 
subroutine dag_module::dag_set_vertex_info (me, ivertex, label, attributes)
 
subroutine dag_module::dag_set_edges (me, ivertex, edges)
 
subroutine dag_module::dag_toposort (me, order, istat)
 
recursive subroutine dfs (v)
 
character(len=:) function, allocatable dag_module::dag_generate_digraph (me, rankdir, dpi, edge)
 
subroutine dag_module::dag_generate_dependency_matrix (me, mat)
 
subroutine dag_module::dag_save_digraph (me, filename, rankdir, dpi, edge)
 
pure character(len=:) function, allocatable dag_module::integer_to_string (i)
 

Function/Subroutine Documentation

◆ dfs()

recursive subroutine dag_toposort::dfs ( type(vertex), intent(inout)  v)
private

Definition at line 252 of file dag_module.f90.

253 
254  !! depth-first graph traversal
255 
256  type(vertex),intent(inout) :: v
257  integer :: j
258 
259  if (istat==-1) return
260 
261  if (v%checking) then
262  ! error: circular dependency
263  istat = -1
264  else
265  if (.not. v%marked) then
266  v%checking = .true.
267  if (allocated(v%edges)) then
268  do j=1,size(v%edges)
269  call dfs(me%vertices(v%edges(j)))
270  if (istat==-1) return
271  end do
272  end if
273  v%checking = .false.
274  v%marked = .true.
275  iorder = iorder + 1
276  order(iorder) = v%ivertex
277  end if
278  end if
279 
recursive subroutine dfs(v)
Definition: dag_module.f90:253
Here is the caller graph for this function: