Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | ProposedObject | |||
integer, | intent(inout) | :: | CurPos | |||
logical, | intent(inout) | :: | EndofFile |
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 ValidateObjectandParse(ProposedObject,CurPos,EndofFile)
! SUBROUTINE INFORMATION:
! AUTHOR Linda K. Lawrie
! DATE WRITTEN September 1997
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! This subroutine validates the proposed object from the IDF and then
! parses it, putting it into the internal InputProcessor Data structure.
! METHODOLOGY EMPLOYED:
! na
! REFERENCES:
! na
! USE STATEMENTS:
! na
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
CHARACTER(len=*), INTENT(IN) :: ProposedObject
INTEGER, INTENT(INOUT) :: CurPos
LOGICAL, INTENT(INOUT) :: EndofFile
! SUBROUTINE PARAMETER DEFINITIONS:
INTEGER, PARAMETER :: dimLineBuf=10
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
CHARACTER(len=MaxObjectNameLength) SqueezedObject
CHARACTER(len=MaxAlphaArgLength) SqueezedArg
INTEGER Found
INTEGER NumArg
INTEGER NumArgExpected
INTEGER NumAlpha
INTEGER NumNumeric
INTEGER Pos
LOGICAL EndofObject
LOGICAL BlankLine
LOGICAL,SAVE :: ErrFlag=.false.
INTEGER LenLeft
INTEGER Count
CHARACTER(len=32) FieldString
CHARACTER(len=MaxFieldNameLength) FieldNameString
CHARACTER(len=300) Message
CHARACTER(len=300) cStartLine
CHARACTER(len=300) cStartName
CHARACTER(len=300), DIMENSION(dimLineBuf), SAVE :: LineBuf
INTEGER, SAVE :: StartLine
INTEGER, SAVE :: NumConxLines
INTEGER, SAVE :: CurLines
INTEGER, SAVE :: CurQPtr
CHARACTER(len=52) :: String
LOGICAL IDidntMeanIt
LOGICAL TestingObject
LOGICAL TransitionDefer
INTEGER TFound
INTEGER, EXTERNAL :: FindNonSpace
INTEGER NextChr
CHARACTER(len=32) :: String1
SqueezedObject=MakeUPPERCase(ADJUSTL(ProposedObject))
IF (LEN_TRIM(ADJUSTL(ProposedObject)) > MaxObjectNameLength) THEN
CALL ShowWarningError('IP: Object name length exceeds maximum, will be truncated='//TRIM(ProposedObject),EchoInputFile)
CALL ShowContinueError('Will be processed as Object='//TRIM(SqueezedObject),EchoInputFile)
ENDIF
IDidntMeanIt=.false.
TestingObject=.true.
TransitionDefer=.false.
DO WHILE (TestingObject)
ErrFlag=.false.
IDidntMeanIt=.false.
IF (SortedIDD) THEN
Found=FindIteminSortedList(SqueezedObject,ListofObjects,NumObjectDefs)
IF (Found /= 0) Found=iListofObjects(Found)
ELSE
Found=FindIteminList(SqueezedObject,ListofObjects,NumObjectDefs)
ENDIF
IF (Found /= 0) THEN
IF (ObjectDef(Found)%ObsPtr > 0) THEN
TFound=FindItemInList(SqueezedObject,RepObjects%OldName,NumSecretObjects)
IF (TFound /= 0) THEN
IF (RepObjects(TFound)%Transitioned) THEN
IF (.not. RepObjects(TFound)%Used) &
CALL ShowWarningError('IP: Objects="'//TRIM(ADJUSTL(ProposedObject))// &
'" are being transitioned to this object="'// &
TRIM(RepObjects(TFound)%NewName)//'"')
RepObjects(TFound)%Used=.true.
IF (SortedIDD) THEN
Found=FindIteminSortedList(SqueezedObject,ListofObjects,NumObjectDefs)
IF (Found /= 0) Found=iListofObjects(Found)
ELSE
Found=FindIteminList(SqueezedObject,ListofObjects,NumObjectDefs)
ENDIF
ELSEIF (RepObjects(TFound)%TransitionDefer) THEN
IF (.not. RepObjects(TFound)%Used) &
CALL ShowWarningError('IP: Objects="'//TRIM(ADJUSTL(ProposedObject))// &
'" are being transitioned to this object="'// &
TRIM(RepObjects(TFound)%NewName)//'"')
RepObjects(TFound)%Used=.true.
IF (SortedIDD) THEN
Found=FindIteminSortedList(SqueezedObject,ListofObjects,NumObjectDefs)
IF (Found /= 0) Found=iListofObjects(Found)
ELSE
Found=FindIteminList(SqueezedObject,ListofObjects,NumObjectDefs)
ENDIF
TransitionDefer=.true.
ELSE
Found=0 ! being handled differently for this obsolete object
ENDIF
ENDIF
ENDIF
ENDIF
TestingObject=.false.
IF (Found == 0) THEN
! Check to see if it's a "secret" object
Found=FindItemInList(SqueezedObject,RepObjects%OldName,NumSecretObjects)
IF (Found == 0) THEN
CALL ShowSevereError('IP: IDF line~'//TRIM(IPTrimSigDigits(NumLines))// &
' Did not find "'//TRIM(ADJUSTL(ProposedObject))//'" in list of Objects',EchoInputFile)
! Will need to parse to next ;
ErrFlag=.true.
ELSEIF (RepObjects(Found)%Deleted) THEN
IF (.not. RepObjects(Found)%Used) THEN
CALL ShowWarningError('IP: IDF line~'//TRIM(IPTrimSigDigits(NumLines))// &
' Objects="'//TRIM(ADJUSTL(ProposedObject))//'" have been deleted from the IDD. Will be ignored.')
RepObjects(Found)%Used=.true.
ENDIF
IDidntMeanIt=.true.
ErrFlag=.true.
Found=0
ELSEIF (RepObjects(Found)%TransitionDefer) THEN
ELSE ! This name is replaced with something else
IF (.not. RepObjects(Found)%Used) THEN
IF (.not. RepObjects(Found)%Transitioned) THEN
CALL ShowWarningError('IP: IDF line~'//TRIM(IPTrimSigDigits(NumLines))// &
' Objects="'//TRIM(ADJUSTL(ProposedObject))//'" are being replaced with this object="'// &
TRIM(RepObjects(Found)%NewName)//'"')
RepObjects(Found)%Used=.true.
SqueezedObject=RepObjects(Found)%NewName
TestingObject=.true.
ELSE
CALL ShowWarningError('IP: IDF line~'//TRIM(IPTrimSigDigits(NumLines))// &
' Objects="'//TRIM(ADJUSTL(ProposedObject))//'" are being transitioned to this object="'// &
TRIM(RepObjects(Found)%NewName)//'"')
RepObjects(Found)%Used=.true.
IF (SortedIDD) THEN
Found=FindIteminSortedList(SqueezedObject,ListofObjects,NumObjectDefs)
IF (Found /= 0) Found=iListofObjects(Found)
ELSE
Found=FindIteminList(SqueezedObject,ListofObjects,NumObjectDefs)
ENDIF
ENDIF
ELSEIF (.not. RepObjects(Found)%Transitioned) THEN
SqueezedObject=RepObjects(Found)%NewName
TestingObject=.true.
ELSE
IF (SortedIDD) THEN
Found=FindIteminSortedList(SqueezedObject,ListofObjects,NumObjectDefs)
IF (Found /= 0) Found=iListofObjects(Found)
ELSE
Found=FindIteminList(SqueezedObject,ListofObjects,NumObjectDefs)
ENDIF
ENDIF
ENDIF
ELSE
! Start Parsing the Object according to definition
ErrFlag=.false.
LineItem%Name=SqueezedObject
LineItem%Alphas=Blank
LineItem%AlphBlank=.false.
LineItem%NumAlphas=0
LineItem%Numbers=0.0d0
LineItem%NumNumbers=0
LineItem%NumBlank=.false.
LineItem%ObjectDefPtr=Found
NumArgExpected=ObjectDef(Found)%NumParams
ObjectDef(Found)%NumFound=ObjectDef(Found)%NumFound+1
IF (ObjectDef(Found)%UniqueObject .and. ObjectDef(Found)%NumFound > 1) THEN
CALL ShowSevereError('IP: IDF line~'//TRIM(IPTrimSigDigits(NumLines))// &
' Multiple occurrences of Unique Object='//TRIM(ADJUSTL(ProposedObject)))
NumMiscErrorsFound=NumMiscErrorsFound+1
ENDIF
IF (ObjectDef(Found)%ObsPtr > 0) THEN
TFound=FindItemInList(SqueezedObject,RepObjects%OldName,NumSecretObjects)
IF (TFound == 0) THEN
CALL ShowWarningError('IP: IDF line~'//TRIM(IPTrimSigDigits(NumLines))// &
' Obsolete object='//TRIM(ADJUSTL(ProposedObject))// &
', encountered. Should be replaced with new object='// &
TRIM(ObsoleteObjectsRepNames(ObjectDef(Found)%ObsPtr)))
ELSEIF (.not. RepObjects(TFound)%Used .and. RepObjects(TFound)%Transitioned) THEN
CALL ShowWarningError('IP: IDF line~'//TRIM(IPTrimSigDigits(NumLines))// &
' Objects="'//TRIM(ADJUSTL(ProposedObject))//'" are being transitioned to this object="'// &
TRIM(RepObjects(TFound)%NewName)//'"')
RepObjects(TFound)%Used=.true.
ENDIF
ENDIF
ENDIF
ENDDO
NumArg=0
NumAlpha=0
NumNumeric=0
EndofObject=.false.
CurPos=CurPos+1
! Keep context buffer in case of errors
LineBuf=Blank
NumConxLines=0
StartLine=NumLines
cStartLine=InputLine(1:300)
cStartName=Blank
NumConxLines=0
CurLines=NumLines
CurQPtr=0
DO WHILE (.not. EndofFile .and. .not. EndofObject)
IF (CurLines /= NumLines) THEN
NumConxLines=MIN(NumConxLines+1,dimLineBuf)
CurQPtr=CurQPtr+1
IF (CurQPtr == 1 .and. cStartName == Blank .and. InputLine /= Blank) THEN
IF (Found > 0) THEN
IF (ObjectDef(Found)%NameAlpha1) THEN
Pos=INDEX(InputLine,',')
cStartName=InputLine(1:Pos-1)
cStartName=ADJUSTL(cStartName)
ENDIF
ENDIF
ENDIF
IF (CurQPtr > dimLineBuf) CurQPtr=1
LineBuf(CurQPtr)=InputLine(1:300)
CurLines=NumLines
ENDIF
IF (CurPos <= InputLineLength) THEN
Pos=SCAN(InputLine(CurPos:InputLineLength),',;')
IF (Pos == 0) THEN
IF (InputLine(InputLineLength:InputLineLength) == '!') THEN
LenLeft=LEN_TRIM(InputLine(CurPos:InputLineLength-1))
ELSE
LenLeft=LEN_TRIM(InputLine(CurPos:InputLineLength))
ENDIF
IF (LenLeft == 0) THEN
CurPos=InputLineLength+1
CYCLE
ELSE
IF (InputLine(InputLineLength:InputLineLength) == '!') THEN
Pos=InputLineLength-CurPos+1
CALL DumpCurrentLineBuffer(StartLine,cStartLine,cStartName,NumLines,NumConxLines,LineBuf,CurQPtr)
CALL ShowWarningError('IP: IDF line~'//TRIM(IPTrimSigDigits(NumLines))// &
' Comma being inserted after:"'//InputLine(CurPos:InputLineLength-1)// &
'" in Object='//TRIM(SqueezedObject),EchoInputFile)
ELSE
Pos=InputLineLength-CurPos+2
CALL DumpCurrentLineBuffer(StartLine,cStartLine,cStartName,NumLines,NumConxLines,LineBuf,CurQPtr)
CALL ShowWarningError('IP: IDF line~'//TRIM(IPTrimSigDigits(NumLines))// &
' Comma being inserted after:"'//InputLine(CurPos:InputLineLength)// &
'" in Object='//TRIM(SqueezedObject),EchoInputFile)
ENDIF
ENDIF
ENDIF
ELSE
CALL ReadInputLine(IDFFile,CurPos,BlankLine,InputLineLength,EndofFile)
CYCLE
ENDIF
IF (Pos > 0) THEN
IF (.not. ErrFlag) THEN
IF (CurPos <= CurPos+Pos-2) THEN
SqueezedArg=MakeUPPERCase(ADJUSTL(InputLine(CurPos:CurPos+Pos-2)))
IF (LEN_TRIM(ADJUSTL(InputLine(CurPos:CurPos+Pos-2))) > MaxAlphaArgLength) THEN
CALL DumpCurrentLineBuffer(StartLine,cStartLine,cStartName,NumLines,NumConxLines,LineBuf,CurQPtr)
CALL ShowWarningError('IP: IDF line~'//TRIM(IPTrimSigDigits(NumLines))// &
' Alpha Argument length exceeds maximum, will be truncated='// &
TRIM(InputLine(CurPos:CurPos+Pos-2)), EchoInputFile)
CALL ShowContinueError('Will be processed as Alpha='//TRIM(SqueezedArg),EchoInputFile)
ENDIF
ELSE
SqueezedArg=Blank
ENDIF
IF (NumArg == NumArgExpected .and. .not. ObjectDef(Found)%ExtensibleObject) THEN
CALL DumpCurrentLineBuffer(StartLine,cStartLine,cStartName,NumLines,NumConxLines,LineBuf,CurQPtr)
CALL ShowSevereError('IP: IDF line~'//TRIM(IPTrimSigDigits(NumLines))// &
' Error detected for Object='//TRIM(ObjectDef(Found)%Name),EchoInputFile)
CALL ShowContinueError(' Maximum arguments reached for this object, trying to process ->'//TRIM(SqueezedArg)//'<-', &
EchoInputFile)
ErrFlag=.true.
ELSE
IF (NumArg == NumArgExpected .and. ObjectDef(Found)%ExtensibleObject) THEN
CALL ExtendObjectDefinition(Found,NumArgExpected)
ENDIF
NumArg=NumArg+1
IF (ObjectDef(Found)%AlphaorNumeric(NumArg)) THEN
IF (NumAlpha == ObjectDef(Found)%NumAlpha) THEN
CALL DumpCurrentLineBuffer(StartLine,cStartLine,cStartName,NumLines,NumConxLines,LineBuf,CurQPtr)
CALL ShowSevereError('IP: IDF line~'//TRIM(IPTrimSigDigits(NumLines))// &
' Error detected for Object='//TRIM(ObjectDef(Found)%Name),EchoInputFile)
CALL ShowContinueError(' Too many Alphas for this object, trying to process ->'//TRIM(SqueezedArg)//'<-', &
EchoInputFile)
ErrFlag=.true.
ELSE
NumAlpha=NumAlpha+1
LineItem%NumAlphas=NumAlpha
IF (ObjectDef(Found)%AlphRetainCase(NumArg)) THEN
SqueezedArg=InputLine(CurPos:CurPos+Pos-2)
SqueezedArg=ADJUSTL(SqueezedArg)
ENDIF
IF (SqueezedArg /= Blank) THEN
LineItem%Alphas(NumAlpha)=SqueezedArg
ELSEIF (ObjectDef(Found)%ReqField(NumArg)) THEN ! Blank Argument
IF (ObjectDef(Found)%AlphFieldDefs(NumAlpha) /= Blank) THEN
LineItem%Alphas(NumAlpha)=ObjectDef(Found)%AlphFieldDefs(NumAlpha)
ELSE
IF (ObjectDef(Found)%NameAlpha1 .and. NumAlpha /= 1) THEN
CALL DumpCurrentLineBuffer(StartLine,cStartLine,cStartName,NumLines,NumConxLines,LineBuf,CurQPtr)
CALL ShowSevereError('IP: IDF line~'//TRIM(IPTrimSigDigits(NumLines))// &
' Error detected in Object='//TRIM(ObjectDef(Found)%Name)//', name='// &
TRIM(LineItem%Alphas(1)),EchoInputFile)
ELSE
CALL DumpCurrentLineBuffer(StartLine,cStartLine,cStartName,NumLines,NumConxLines,LineBuf,CurQPtr)
CALL ShowSevereError('IP: IDF line~'//TRIM(IPTrimSigDigits(NumLines))// &
' Error detected in Object='//TRIM(ObjectDef(Found)%Name),EchoInputFile)
ENDIF
CALL ShowContinueError('Field ['//TRIM(ObjectDef(Found)%AlphFieldChks(NumAlpha))// &
'] is required but was blank',EchoInputFile)
NumBlankReqFieldFound=NumBlankReqFieldFound+1
ENDIF
ELSE
LineItem%AlphBlank(NumAlpha)=.true.
IF (ObjectDef(Found)%AlphFieldDefs(NumAlpha) /= Blank) THEN
LineItem%Alphas(NumAlpha)=ObjectDef(Found)%AlphFieldDefs(NumAlpha)
ENDIF
ENDIF
ENDIF
ELSE
IF (NumNumeric == ObjectDef(Found)%NumNumeric) THEN
CALL DumpCurrentLineBuffer(StartLine,cStartLine,cStartName,NumLines,NumConxLines,LineBuf,CurQPtr)
CALL ShowSevereError('IP: IDF line~'//TRIM(IPTrimSigDigits(NumLines))// &
' Error detected for Object='//TRIM(ObjectDef(Found)%Name),EchoInputFile)
CALL ShowContinueError(' Too many Numbers for this object, trying to process ->'//TRIM(SqueezedArg)//'<-', &
EchoInputFile)
ErrFlag=.true.
ELSE
NumNumeric=NumNumeric+1
LineItem%NumNumbers=NumNumeric
IF (SqueezedArg /= Blank) THEN
IF (.not. ObjectDef(Found)%NumRangeChks(NumNumeric)%AutoSizable .and. &
.not. ObjectDef(Found)%NumRangeChks(NumNumeric)%AutoCalculatable) THEN
LineItem%Numbers(NumNumeric)=ProcessNumber(SqueezedArg,Errflag)
ELSEIF (SqueezedArg == 'AUTOSIZE') THEN
LineItem%Numbers(NumNumeric)=ObjectDef(Found)%NumRangeChks(NumNumeric)%AutoSizeValue
ELSEIF (SqueezedArg == 'AUTOCALCULATE') THEN
LineItem%Numbers(NumNumeric)=ObjectDef(Found)%NumRangeChks(NumNumeric)%AutoCalculateValue
ELSE
LineItem%Numbers(NumNumeric)=ProcessNumber(SqueezedArg,Errflag)
ENDIF
ELSE ! numeric arg is blank.
IF (ObjectDef(Found)%NumRangeChks(NumNumeric)%DefaultChk) THEN ! blank arg has default
IF (.not. ObjectDef(Found)%NumRangeChks(NumNumeric)%DefAutoSize .and. &
.not. ObjectDef(Found)%NumRangeChks(NumNumeric)%AutoCalculatable) THEN
LineItem%Numbers(NumNumeric)=ObjectDef(Found)%NumRangeChks(NumNumeric)%Default
LineItem%NumBlank(NumNumeric)=.true.
ELSEIF (ObjectDef(Found)%NumRangeChks(NumNumeric)%DefAutoSize) THEN
LineItem%Numbers(NumNumeric)=ObjectDef(Found)%NumRangeChks(NumNumeric)%AutoSizeValue
LineItem%NumBlank(NumNumeric)=.true.
ELSEIF (ObjectDef(Found)%NumRangeChks(NumNumeric)%DefAutoCalculate) THEN
LineItem%Numbers(NumNumeric)=ObjectDef(Found)%NumRangeChks(NumNumeric)%AutoCalculateValue
LineItem%NumBlank(NumNumeric)=.true.
ENDIF
ErrFlag=.false.
ELSE ! blank arg does not have default
IF (ObjectDef(Found)%ReqField(NumArg)) THEN ! arg is required
IF (ObjectDef(Found)%NameAlpha1) THEN ! object has name field - more context for error
CALL DumpCurrentLineBuffer(StartLine,cStartLine,cStartName,NumLines,NumConxLines,LineBuf,CurQPtr)
CALL ShowSevereError('IP: IDF line~'//TRIM(IPTrimSigDigits(NumLines))// &
' Error detected in Object='//TRIM(ObjectDef(Found)%Name)// &
', name='//TRIM(LineItem%Alphas(1)),EchoInputFile)
ErrFlag=.true.
ELSE ! object does not have name field
CALL DumpCurrentLineBuffer(StartLine,cStartLine,cStartName,NumLines,NumConxLines,LineBuf,CurQPtr)
CALL ShowSevereError('IP: IDF line~'//TRIM(IPTrimSigDigits(NumLines))// &
' Error detected in Object='//TRIM(ObjectDef(Found)%Name),EchoInputFile)
ErrFlag=.true.
ENDIF
CALL ShowContinueError('Field ['//TRIM(ObjectDef(Found)%NumRangeChks(NumNumeric)%FieldName)// &
'] is required but was blank',EchoInputFile)
NumBlankReqFieldFound=NumBlankReqFieldFound+1
ENDIF
LineItem%Numbers(NumNumeric)=0.0d0
LineItem%NumBlank(NumNumeric)=.true.
ENDIF
ENDIF
IF (ErrFlag) THEN
IF (SqueezedArg(1:1) /= '=') THEN ! argument does not start with "=" (parametric)
FieldString=IPTrimSigDigits(NumNumeric)
FieldNameString=ObjectDef(Found)%NumRangeChks(NumNumeric)%FieldName
IF (FieldNameString /= Blank) THEN
Message='Invalid Number in Numeric Field#'//TRIM(FieldString)//' ('//TRIM(FieldNameString)// &
'), value='//TRIM(SqueezedArg)
ELSE ! Field Name not recorded
Message='Invalid Number in Numeric Field#'//TRIM(FieldString)//', value='//TRIM(SqueezedArg)
ENDIF
Message=TRIM(Message)//', in '//TRIM(ObjectDef(Found)%Name)
IF (ObjectDef(Found)%NameAlpha1) THEN
Message=TRIM(Message)//'='//TRIM(LineItem%Alphas(1))
ENDIF
CALL DumpCurrentLineBuffer(StartLine,cStartLine,cStartName,NumLines,NumConxLines,LineBuf,CurQPtr)
CALL ShowSevereError('IP: IDF line~'//TRIM(IPTrimSigDigits(NumLines))// &
' '//TRIM(Message),EchoInputFile)
ELSE ! parametric in Numeric field
ErrFlag=.false.
ENDIF
ENDIF
ENDIF
ENDIF
ENDIF
ENDIF
IF (InputLine(CurPos+Pos-1:CurPos+Pos-1) == ';') THEN
EndofObject=.true.
! Check if more characters on line -- and if first is a comment character
IF (InputLine(CurPos+Pos:) /= Blank) THEN
NextChr=FindNonSpace(InputLine(CurPos+Pos:))
IF (InputLine(CurPos+Pos+NextChr-1:CurPos+Pos+NextChr-1) /= '!') THEN
CALL DumpCurrentLineBuffer(StartLine,cStartLine,cStartName,NumLines,NumConxLines,LineBuf,CurQPtr)
CALL ShowWarningError('IP: IDF line~'//TRIM(IPTrimSigDigits(NumLines))// &
' End of Object="'//TRIM(ObjectDef(Found)%Name)// &
'" reached, but next part of line not comment.',EchoInputFile)
CALL ShowContinueError('Final line above shows line that contains error.')
ENDIF
ENDIF
ENDIF
CurPos=CurPos+Pos
ENDIF
END DO
! Store to IDFRecord Data Structure, ErrFlag is true if there was an error
! Check out MinimumNumberOfFields
IF (.not. ErrFlag .and. .not. IDidntMeanIt) THEN
IF (NumArg < ObjectDef(Found)%MinNumFields) THEN
IF (ObjectDef(Found)%NameAlpha1) THEN
CALL ShowAuditErrorMessage(' ** Warning ** ','IP: IDF line~'//TRIM(IPTrimSigDigits(NumLines))// &
' Object='//TRIM(ObjectDef(Found)%Name)// &
', name='//TRIM(LineItem%Alphas(1))// &
', entered with less than minimum number of fields.')
ELSE
CALL ShowAuditErrorMessage(' ** Warning ** ','IP: IDF line~'//TRIM(IPTrimSigDigits(NumLines))// &
' Object='//TRIM(ObjectDef(Found)%Name)// &
', entered with less than minimum number of fields.')
ENDIF
CALL ShowAuditErrorMessage(' ** ~~~ ** ','Attempting fill to minimum.')
NumAlpha=0
NumNumeric=0
IF (ObjectDef(Found)%MinNumFields > ObjectDef(Found)%NumParams) THEN
String=IPTrimSigDigits(ObjectDef(Found)%MinNumFields)
String1=IPTrimSigDigits(ObjectDef(Found)%NumParams)
CALL ShowSevereError('IP: IDF line~'//TRIM(IPTrimSigDigits(NumLines))// &
' Object \min-fields > number of fields specified, Object='//TRIM(ObjectDef(Found)%Name))
CALL ShowContinueError('..\min-fields='//TRIM(String)// &
', total number of fields in object definition='//TRIM(String1))
ErrFlag=.true.
ELSE
DO Count=1,ObjectDef(Found)%MinNumFields
IF (ObjectDef(Found)%AlphaOrNumeric(Count)) THEN
NumAlpha=NumAlpha+1
IF (NumAlpha <= LineItem%NumAlphas) CYCLE
LineItem%NumAlphas=LineItem%NumAlphas+1
IF (ObjectDef(Found)%AlphFieldDefs(LineItem%NumAlphas) /= Blank) THEN
LineItem%Alphas(LineItem%NumAlphas)=ObjectDef(Found)%AlphFieldDefs(LineItem%NumAlphas)
CALL ShowAuditErrorMessage(' ** Add ** ',TRIM(ObjectDef(Found)%AlphFieldDefs(LineItem%NumAlphas))// &
' ! field=>'//TRIM(ObjectDef(Found)%AlphFieldChks(NumAlpha)))
ELSEIF (ObjectDef(Found)%ReqField(Count)) THEN
IF (ObjectDef(Found)%NameAlpha1) THEN
CALL ShowSevereError('IP: IDF line~'//TRIM(IPTrimSigDigits(NumLines))// &
' Object='//TRIM(ObjectDef(Found)%Name)// &
', name='//TRIM(LineItem%Alphas(1))// &
', Required Field=['// &
TRIM(ObjectDef(Found)%AlphFieldChks(NumAlpha))// &
'] was blank.',EchoInputFile)
ELSE
CALL ShowSevereError('IP: IDF line~'//TRIM(IPTrimSigDigits(NumLines))// &
' Object='//TRIM(ObjectDef(Found)%Name)// &
', Required Field=['// &
TRIM(ObjectDef(Found)%AlphFieldChks(NumAlpha))// &
'] was blank.',EchoInputFile)
ENDIF
ErrFlag=.true.
ELSE
LineItem%Alphas(LineItem%NumAlphas)=Blank
LineItem%AlphBlank(LineItem%NumAlphas)=.true.
CALL ShowAuditErrorMessage(' ** Add ** ','<blank field> ! field=>'// &
TRIM(ObjectDef(Found)%AlphFieldChks(NumAlpha)))
ENDIF
ELSE
NumNumeric=NumNumeric+1
IF (NumNumeric <= LineItem%NumNumbers) CYCLE
LineItem%NumNumbers=LineItem%NumNumbers+1
LineItem%NumBlank(NumNumeric)=.true.
IF (ObjectDef(Found)%NumRangeChks(NumNumeric)%Defaultchk) THEN
IF (.not. ObjectDef(Found)%NumRangeChks(NumNumeric)%DefAutoSize .and. &
.not. ObjectDef(Found)%NumRangeChks(NumNumeric)%DefAutoCalculate) THEN
LineItem%Numbers(NumNumeric)=ObjectDef(Found)%NumRangeChks(NumNumeric)%Default
WRITE(String,*) ObjectDef(Found)%NumRangeChks(NumNumeric)%Default
String=ADJUSTL(String)
CALL ShowAuditErrorMessage(' ** Add ** ',TRIM(String)// &
' ! field=>'//TRIM(ObjectDef(Found)%NumRangeChks(NumNumeric)%FieldName))
ELSEIF (ObjectDef(Found)%NumRangeChks(NumNumeric)%DefAutoSize) THEN
LineItem%Numbers(NumNumeric)=ObjectDef(Found)%NumRangeChks(NumNumeric)%AutoSizeValue
CALL ShowAuditErrorMessage(' ** Add ** ','autosize ! field=>'// &
TRIM(ObjectDef(Found)%NumRangeChks(NumNumeric)%FieldName))
ELSEIF (ObjectDef(Found)%NumRangeChks(NumNumeric)%DefAutoCalculate) THEN
LineItem%Numbers(NumNumeric)=ObjectDef(Found)%NumRangeChks(NumNumeric)%AutoCalculateValue
CALL ShowAuditErrorMessage(' ** Add ** ','autocalculate ! field=>'// &
TRIM(ObjectDef(Found)%NumRangeChks(NumNumeric)%FieldName))
ENDIF
ELSEIF (ObjectDef(Found)%ReqField(Count)) THEN
IF (ObjectDef(Found)%NameAlpha1) THEN
CALL ShowSevereError('IP: IDF line~'//TRIM(IPTrimSigDigits(NumLines))// &
' Object='//TRIM(ObjectDef(Found)%Name)// &
', name='//TRIM(LineItem%Alphas(1))// &
', Required Field=['// &
TRIM(ObjectDef(Found)%NumRangeChks(NumNumeric)%FieldName)// &
'] was blank.',EchoInputFile)
ELSE
CALL ShowSevereError('IP: IDF line~'//TRIM(IPTrimSigDigits(NumLines))// &
' Object='//TRIM(ObjectDef(Found)%Name)// &
', Required Field=['// &
TRIM(ObjectDef(Found)%NumRangeChks(NumNumeric)%FieldName)// &
'] was blank.',EchoInputFile)
ENDIF
ErrFlag=.true.
ELSE
LineItem%Numbers(NumNumeric)=0.0d0
LineItem%NumBlank(NumNumeric)=.true.
CALL ShowAuditErrorMessage(' ** Add ** ','<blank field> ! field=>'// &
TRIM(ObjectDef(Found)%NumRangeChks(NumNumeric)%FieldName))
ENDIF
ENDIF
ENDDO
ENDIF
ENDIF
ENDIF
IF (.not. ErrFlag .and. .not. IDidntMeanIt) THEN
IF (TransitionDefer) THEN
CALL MakeTransition(Found)
ENDIF
NumIDFRecords=NumIDFRecords+1
IF (ObjectStartRecord(Found) == 0) ObjectStartRecord(Found)=NumIDFRecords
MaxAlphaIDFArgsFound=MAX(MaxAlphaIDFArgsFound,LineItem%NumAlphas)
MaxNumericIDFArgsFound=MAX(MaxNumericIDFArgsFound,LineItem%NumNumbers)
MaxAlphaIDFDefArgsFound=MAX(MaxAlphaIDFDefArgsFound,ObjectDef(Found)%NumAlpha)
MaxNumericIDFDefArgsFound=MAX(MaxNumericIDFDefArgsFound,ObjectDef(Found)%NumNumeric)
IDFRecords(NumIDFRecords)%Name=LineItem%Name
IDFRecords(NumIDFRecords)%NumNumbers=LineItem%NumNumbers
IDFRecords(NumIDFRecords)%NumAlphas=LineItem%NumAlphas
IDFRecords(NumIDFRecords)%ObjectDefPtr=LineItem%ObjectDefPtr
ALLOCATE(IDFRecords(NumIDFRecords)%Alphas(LineItem%NumAlphas))
ALLOCATE(IDFRecords(NumIDFRecords)%AlphBlank(LineItem%NumAlphas))
ALLOCATE(IDFRecords(NumIDFRecords)%Numbers(LineItem%NumNumbers))
ALLOCATE(IDFRecords(NumIDFRecords)%NumBlank(LineItem%NumNumbers))
IDFRecords(NumIDFRecords)%Alphas(1:LineItem%NumAlphas)=LineItem%Alphas(1:LineItem%NumAlphas)
IDFRecords(NumIDFRecords)%AlphBlank(1:LineItem%NumAlphas)=LineItem%AlphBlank(1:LineItem%NumAlphas)
IDFRecords(NumIDFRecords)%Numbers(1:LineItem%NumNumbers)=LineItem%Numbers(1:LineItem%NumNumbers)
IDFRecords(NumIDFRecords)%NumBlank(1:LineItem%NumNumbers)=LineItem%NumBlank(1:LineItem%NumNumbers)
IF (LineItem%NumNumbers > 0) THEN
DO Count=1,LineItem%NumNumbers
IF (ObjectDef(Found)%NumRangeChks(Count)%MinMaxChk .and. .not. LineItem%NumBlank(Count)) THEN
CALL InternalRangeCheck(LineItem%Numbers(Count),Count,Found,LineItem%Alphas(1), &
ObjectDef(Found)%NumRangeChks(Count)%AutoSizable, &
ObjectDef(Found)%NumRangeChks(Count)%AutoCalculatable)
ENDIF
ENDDO
ENDIF
ELSEIF (.not. IDidntMeanIt) THEN
OverallErrorFlag=.true.
ENDIF
RETURN
END SUBROUTINE ValidateObjectandParse