Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | ProposedSection | |||
integer, | intent(in) | :: | LineNo |
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 ValidateSection(ProposedSection,LineNo)
! SUBROUTINE INFORMATION:
! AUTHOR Linda K. Lawrie
! DATE WRITTEN September 1997
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! This subroutine validates the section from the input data file
! with the list of objects from the data dictionary file.
! METHODOLOGY EMPLOYED:
! A "squeezed" string is formed and checked against the list of
! sections.
! REFERENCES:
! na
! USE STATEMENTS:
! na
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
CHARACTER(len=*), INTENT(IN) :: ProposedSection
INTEGER, INTENT(IN) :: LineNo
! SUBROUTINE PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
CHARACTER(len=MaxSectionNameLength) SqueezedSection
INTEGER Found
TYPE (SectionsDefinition), ALLOCATABLE :: TempSectionDef(:) ! Like SectionDef, used during Re-allocation
INTEGER OFound
SqueezedSection=MakeUPPERCase(ADJUSTL(ProposedSection))
IF (LEN_TRIM(ADJUSTL(ProposedSection)) > MaxSectionNameLength) THEN
CALL ShowWarningError('IP: Section length exceeds maximum, will be truncated='//TRIM(ProposedSection),EchoInputFile)
CALL ShowContinueError('Will be processed as Section='//TRIM(SqueezedSection),EchoInputFile)
ENDIF
IF (SqueezedSection(1:3) /= 'END') THEN
Found=FindIteminList(SqueezedSection,SectionDef%Name,NumSectionDefs)
IF (Found == 0) THEN
! Make sure this Section not an object name
IF (SortedIDD) THEN
OFound=FindItemInSortedList(SqueezedSection,ListOfObjects,NumObjectDefs)
IF (OFound /= 0) OFound=iListOfObjects(OFound)
ELSE
OFound=FindItemInList(SqueezedSection,ListOfObjects,NumObjectDefs)
ENDIF
IF (OFound /= 0) THEN
CALL AddRecordFromSection(OFound)
ELSEIF (NumSectionDefs == MaxSectionDefs) THEN
ALLOCATE (TempSectionDef(MaxSectionDefs+SectionDefAllocInc))
TempSectionDef(1:MaxSectionDefs)=SectionDef
DEALLOCATE (SectionDef)
ALLOCATE (SectionDef(MaxSectionDefs+SectionDefAllocInc))
SectionDef=TempSectionDef
DEALLOCATE (TempSectionDef)
MaxSectionDefs=MaxSectionDefs+SectionDefAllocInc
ENDIF
NumSectionDefs=NumSectionDefs+1
SectionDef(NumSectionDefs)%Name=SqueezedSection
SectionDef(NumSectionDefs)%NumFound=1
! Add to "Sections on file" if appropriate
IF (.not. ProcessingIDD) THEN
NumIDFSections=NumIDFSections+1
SectionsonFile(NumIDFSections)%Name=SqueezedSection
SectionsonFile(NumIDFSections)%FirstRecord=NumIDFRecords
SectionsonFile(NumIDFSections)%FirstLineNo=LineNo
ENDIF
ELSE
! IF (NumIDFSections > 0) THEN
! SectionsonFile(NumIDFSections)%LastRecord=NumIDFRecords
! ENDIF
SectionDef(Found)%NumFound=SectionDef(Found)%NumFound+1
IF (.not. ProcessingIDD) THEN
NumIDFSections=NumIDFSections+1
SectionsonFile(NumIDFSections)%Name=SqueezedSection
SectionsonFile(NumIDFSections)%FirstRecord=NumIDFRecords
SectionsonFile(NumIDFSections)%FirstLineNo=LineNo
ENDIF
ENDIF
ELSE ! End ...
IF (.not. ProcessingIDD) THEN
SqueezedSection=SqueezedSection(4:)
SqueezedSection=ADJUSTL(SqueezedSection)
DO Found=NumIDFSections,1,-1
IF (.not. SameString(SectionsonFile(Found)%Name,SqueezedSection)) CYCLE
SectionsonFile(Found)%LastRecord=NumIDFRecords
ENDDO
ENDIF
ENDIF
RETURN
END SUBROUTINE ValidateSection