Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | iSurf |
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed arrows point from an interface to procedures which implement that interface. This could include the module procedures in a generic interface or the implementation in a submodule of an interface in a parent module. Where possible, edges connecting nodes are given different colours to make them easier to distinguish in large graphs.
SUBROUTINE CheckCFSStates(iSurf)
! SUBROUTINE INFORMATION:
! AUTHOR Simon Vidanovic
! DATE WRITTEN May 2013
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! Check if there are new states available for complex fenestration and performs proper initialization
! METHODOLOGY EMPLOYED:
! na
! REFERENCES:
! na
! USE STATEMENTS:
! na
implicit none ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
Integer, Intent(in) :: iSurf ! Surface number
! SUBROUTINE PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS:
! na
! DERIVED TYPE DEFINITIONS:
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
Integer :: NumOfStates ! number of states for current surface
Logical :: StateFound ! variable to indicate if state has been found
Integer :: i ! Local counter
Integer :: CurrentCFSState
StateFound = .false.
CurrentCFSState = SurfaceWindow(iSurf)%ComplexFen%CurrentState
! Check if EMS changed construction number
if (Surface(iSurf)%Construction /= SurfaceWindow(iSurf)%ComplexFen%State(CurrentCFSState)%Konst) then
! If construction number changed then take new state
! First search for existing states. Maybe state is already added in previous timestep
NumOfStates = SurfaceWindow(iSurf)%ComplexFen%NumStates
do i = 1, NumOfStates
if (Surface(iSurf)%Construction == SurfaceWindow(iSurf)%ComplexFen%State(i)%Konst) then
StateFound = .true.
CurrentCFSState = i
SurfaceWindow(iSurf)%ComplexFen%CurrentState = i
end if
end do
else
StateFound = .true.
end if
! If new state is not found in the list of current states, then create new one, initialize and make it active
if (.not. StateFound) then
call ExpandComplexState(iSurf, Surface(iSurf)%Construction)
CurrentCFSState = SurfaceWindow(iSurf)%ComplexFen%NumStates
SurfaceWindow(iSurf)%ComplexFen%CurrentState = CurrentCFSState
end if
END SUBROUTINE CheckCFSStates