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.
! Errors here are fatal because should only be encountered during development.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | VariableName |
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.
FUNCTION GetUnitsString (VariableName) RESULT (ThisUnitsString)
! FUNCTION INFORMATION:
! AUTHOR Linda K. Lawrie
! DATE WRITTEN October 2003
! MODIFIED August 2008, Greg Stark; modified for use with SQLite
! RE-ENGINEERED na
! PURPOSE OF THIS FUNCTION:
! This function extracts the units from a Variable Name string supplied by
! the developer in the call to SetupOutputVariable(s).
! METHODOLOGY EMPLOYED:
! na
! REFERENCES:
! na
! USE STATEMENTS:
USE General, ONLY: TrimSigDigits
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! FUNCTION ARGUMENT DEFINITIONS:
CHARACTER(len=*), INTENT(IN) :: VariableName
CHARACTER(len=len(VariableName)) :: ThisUnitsString
! FUNCTION PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS:
! na
! DERIVED TYPE DEFINITIONS:
! na
! FUNCTION LOCAL VARIABLE DECLARATIONS:
INTEGER lbpos ! position of the left bracket
INTEGER rbpos ! position of the right bracket
CHARACTER(len=*), PARAMETER :: BlankString = ' '
! Units are marked with a [
lbpos = INDEX (VariableName, '[', .true.) ! from end of variable name
!!! Errors here are fatal because should only be encountered during development.
ThisUnitsString = BlankString
IF (lbpos > 0) THEN
rbpos = INDEX (VariableName, ']', .true.)
IF (rbpos == 0 .or. rbpos < lbpos) THEN
CALL ShowFatalError ('Ill formed Variable Name Units String, VariableName='//TRIM(VariableName))
ThisUnitsString = VariableName(lbpos:)
ELSE
IF ((rbpos-1)-(lbpos+1)+1 > len(VariableName)) THEN
CALL ShowFatalError ('Units String too long for VariableName: '//TRIM(VariableName)// &
'; it will be truncated to '//TrimSigDigits(len(VariableName))//' characters.')
END IF
IF (lbpos+1 <= rbpos-1) THEN
ThisUnitsString = VariableName(lbpos+1:rbpos-1)
ELSE
ThisUnitsString = BlankString
END IF
END IF
END IF
RETURN
END FUNCTION GetUnitsString