Nodes of different colours represent the following:
Solid arrows point from a parent (sub)module to the submodule which is descended from it. Dashed arrows point from a module being used to the module or program unit using it. Where possible, edges connecting nodes are given different colours to make them easier to distinguish in large graphs.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | inBlindNumber | |||
integer, | intent(inout) | :: | outBlindNumber | |||
logical, | intent(inout) | :: | errFlag |
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.
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 AddVariableSlatBlind(inBlindNumber,outBlindNumber,errFlag)
! SUBROUTINE INFORMATION:
! AUTHOR Linda Lawrie
! DATE WRITTEN September 2009
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! Window Blinds are presented as "fixed" slat blinds. However for certain Window Shading Controls,
! the program needs to set the property to "variable"/movable slats. Since a blind could be in use
! elsewhere with "fixed", a material needs to be added with variable properties -- having most of the
! "fixed" properties in tact.
! METHODOLOGY EMPLOYED:
! na
! REFERENCES:
! na
! USE STATEMENTS:
USE General, ONLY: RoundSigDigits
USE DataInterfaces, ONLY: ShowWarningError,ShowSevereError,ShowContinueError
USE InputProcessor, ONLY: FindItemInList
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
INTEGER, INTENT(IN) :: inBlindNumber ! current Blind Number/pointer to name
INTEGER, INTENT(INOUT) :: outBlindNumber ! resultant Blind Number to pass back
LOGICAL, INTENT(INOUT) :: errFlag ! error flag should one be needed
! SUBROUTINE PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS:
! na
! DERIVED TYPE DEFINITIONS:
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
TYPE (WindowBlindProperties), ALLOCATABLE, DIMENSION(:) :: tmpBlind
INTEGER :: Found
REAL(r64) :: MinSlatAngGeom
REAL(r64) :: MaxSlatAngGeom
! maybe it's already there
errFlag=.false.
Found=FindItemInList('~'//trim(Blind(inBlindNumber)%Name),Blind%Name,TotBlinds)
IF (Found == 0) THEN
! Add a new blind
ALLOCATE(tmpBlind(TotBlinds))
tmpBlind=Blind
DEALLOCATE(Blind)
TotBlinds=TotBlinds+1
ALLOCATE(Blind(TotBlinds))
Blind(1:TotBlinds-1)=tmpBlind(1:TotBlinds-1)
DEALLOCATE(tmpBlind)
Blind(TotBlinds)=Blind(inBlindNumber)
Blind(TotBlinds)%Name='~'//Blind(InBlindNumber)%Name
outBlindNumber=TotBlinds
Blind(TotBlinds)%SlatAngleType = VariableSlats
! Minimum and maximum slat angles allowed by slat geometry
IF(Blind(TotBlinds)%SlatWidth > Blind(TotBlinds)%SlatSeparation) THEN
MinSlatAngGeom = &
ASIN(Blind(TotBlinds)%SlatThickness/(Blind(TotBlinds)%SlatThickness + Blind(TotBlinds)%SlatSeparation))/DegToRadians
ELSE
MinSlatAngGeom = 0.0d0
END IF
MaxSlatAngGeom = 180.d0- MinSlatAngGeom
! Error if maximum slat angle less than minimum
IF(Blind(TotBlinds)%MaxSlatAngle < Blind(TotBlinds)%MinSlatAngle) THEN
errFlag = .true.
CALL ShowSevereError('WindowMaterial:Blind="'//trim(Blind(inBlindNumber)%Name)//'", Illegal value combination.')
CALL ShowContinueError('Minimum Slat Angle=['//TRIM(RoundSigDigits(Blind(TotBlinds)%MinSlatAngle,1))// &
'], is greater than '//'Maximum Slat Angle=['// &
TRIM(RoundSigDigits(Blind(TotBlinds)%MaxSlatAngle,1))//'] deg.')
END IF
! Error if input slat angle not in input min/max range
IF (Blind(TotBlinds)%MaxSlatAngle > Blind(TotBlinds)%MinSlatAngle .AND. &
(Blind(TotBlinds)%SlatAngle < Blind(TotBlinds)%MinSlatAngle &
.OR. Blind(TotBlinds)%SlatAngle > Blind(TotBlinds)%MaxSlatAngle)) THEN
errFlag = .true.
CALL ShowSevereError('WindowMaterial:Blind="'//trim(Blind(inBlindNumber)%Name)//'", Illegal value combination.')
CALL ShowContinueError('Slat Angle=['//TRIM(RoundSigDigits(Blind(TotBlinds)%SlatAngle,1))// &
'] is outside of the input min/max range, min=['//TRIM(RoundSigDigits(Blind(TotBlinds)%MinSlatAngle,1))// &
'], max=['//TRIM(RoundSigDigits(Blind(TotBlinds)%MaxSlatAngle,1))//'] deg.')
END IF
! Warning if input minimum slat angle is less than that allowed by slat geometry
IF(Blind(TotBlinds)%MinSlatAngle < MinSlatAngGeom) THEN
CALL ShowWarningError('WindowMaterial:Blind="'//trim(Blind(inBlindNumber)%Name)//'", Illegal value combination.')
CALL ShowContinueError('Minimum Slat Angle=['//TRIM(RoundSigDigits(Blind(TotBlinds)%MinSlatAngle,1))// &
'] is less than the smallest allowed by slat dimensions and spacing, min=['// &
TRIM(RoundSigDigits(MinSlatAngGeom,1))//'] deg.')
CALL ShowContinueError('Minimum Slat Angle will be set to '//TRIM(RoundSigDigits(MinSlatAngGeom,1))//' deg.')
Blind(TotBlinds)%MinSlatAngle = MinSlatAngGeom
END IF
! Warning if input maximum slat angle is greater than that allowed by slat geometry
IF(Blind(TotBlinds)%MaxSlatAngle > MaxSlatAngGeom) THEN
CALL ShowWarningError('WindowMaterial:Blind="'//trim(Blind(inBlindNumber)%Name)//'", Illegal value combination.')
CALL ShowContinueError('Maximum Slat Angle=['//TRIM(RoundSigDigits(Blind(TotBlinds)%MaxSlatAngle,1))// &
'] is greater than the largest allowed by slat dimensions and spacing, ['// &
TRIM(RoundSigDigits(MaxSlatAngGeom,1))//'] deg.')
CALL ShowContinueError('Maximum Slat Angle will be set to '//TRIM(RoundSigDigits(MaxSlatAngGeom,1))//' deg.')
Blind(TotBlinds)%MaxSlatAngle = MaxSlatAngGeom
END IF
ELSE
outBlindNumber=Found
ENDIF
RETURN
END SUBROUTINE AddVariableSlatBlind