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 | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | cModuleObject | |||
character(len=*), | intent(in) | :: | cFieldValue | |||
character(len=*), | intent(in) | :: | cFieldName | |||
character(len=*), | intent(in) | :: | cSubType | |||
logical, | intent(out) | :: | errFlag | |||
logical, | intent(inout) | :: | ErrorsFound |
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 ValidateEMSProgramName(cModuleObject,cFieldValue,cFieldName,cSubType,errFlag,ErrorsFound)
! SUBROUTINE INFORMATION:
! AUTHOR Linda Lawrie
! DATE WRITTEN May 2012
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! Consolidate error checking on EMS variable names.
! METHODOLOGY EMPLOYED:
! na
! REFERENCES:
! na
! USE STATEMENTS:
USE DataInterfaces, ONLY: ShowSevereError,ShowContinueError
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
CHARACTER(len=*), INTENT(IN) :: cModuleObject ! the current object name
CHARACTER(len=*), INTENT(IN) :: cFieldValue ! the field value
CHARACTER(len=*), INTENT(IN) :: cFieldName ! the current field name
CHARACTER(len=*), INTENT(IN) :: cSubType ! sub type = Program or Subroutine
LOGICAL, INTENT(OUT) :: errFlag ! true if errors found in this routine.
LOGICAL, INTENT(INOUT) :: ErrorsFound ! true if errors found in this routine.
! SUBROUTINE PARAMETER DEFINITIONS:
CHARACTER(len=*), PARAMETER :: InvalidStartCharacters='0123456789'
! INTERFACE BLOCK SPECIFICATIONS:
! na
! DERIVED TYPE DEFINITIONS:
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
INTEGER :: pos
errFlag=.false.
IF (SCAN(TRIM(cFieldValue), ' ') > 0) THEN
CALL ShowSevereError(TRIM(cModuleObject)//'="'//TRIM(cFieldValue)//'", Invalid variable name entered.')
CALL ShowContinueError('...'//TRIM(cFieldName)//'; Names used for EMS '//trim(cSubType)//' cannot contain spaces')
errFlag=.true.
ErrorsFound = .TRUE.
ENDIF
IF (SCAN(TRIM(cFieldValue), '-') > 0) THEN
CALL ShowSevereError(TRIM(cModuleObject)//'="'//TRIM(cFieldValue)//'", Invalid variable name entered.')
CALL ShowContinueError('...'//TRIM(cFieldName)//'; Names used for EMS '//trim(cSubType)//' cannot contain "-" characters.')
errFlag=.true.
ErrorsFound = .TRUE.
ENDIF
IF (SCAN(TRIM(cFieldValue), '+') > 0) THEN
CALL ShowSevereError(TRIM(cModuleObject)//'="'//TRIM(cFieldValue)//'", Invalid variable name entered.')
CALL ShowContinueError('...'//TRIM(cFieldName)//'; Names used for EMS '//trim(cSubType)//' cannot contain "+" characters.')
errFlag=.true.
ErrorsFound = .TRUE.
ENDIF
! pos=SCAN(cFieldValue(1:1),InvalidStartCharacters)
! IF (pos > 0) THEN
! CALL ShowSevereError(TRIM(cModuleObject)//'="'//TRIM(cFieldValue)//'", Invalid variable name entered.')
! CALL ShowContinueError('...'//TRIM(cFieldName)//'; Names used as EMS variables cannot start with numeric characters.')
! errFlag=.true.
! ErrorsFound = .TRUE.
! ENDIF
RETURN
END SUBROUTINE ValidateEMSProgramName