The Upper_Case function converts the lower case characters of a string to upper case one. \LIBVTKIO uses this function in order to achieve case-insensitive: all character variables used within \LIBVTKIO functions are pre-processed by Uppper_Case function before these variables are used. So the users can call \LIBVTKIO functions whitout pay attention of the case of the kwywords passed to the functions: calling the function VTK_INI with the string \code{E_IO = VTK_INI('Ascii',…)} or with the string \code{E_IO = VTK_INI('AscII',…)} is equivalent.
Upper_Case function is private and cannot be called outside \LIBVTKIO. If you are interested to use it change its scope to public.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | string |
function Upper_Case(string)
!---------------------------------------------------------------------------------------------------------------------------------
!!The Upper\_Case function converts the lower case characters of a string to upper case one. \LIBVTKIO uses this function in
!!order to achieve case-insensitive: all character variables used within \LIBVTKIO functions are pre-processed by
!!Uppper\_Case function before these variables are used. So the users can call \LIBVTKIO functions whitout pay attention of the
!!case of the kwywords passed to the functions: calling the function VTK\_INI with the string \code{E_IO = VTK_INI('Ascii',...)}
!!or with the string \code{E_IO = VTK_INI('AscII',...)} is equivalent.
!---------------------------------------------------------------------------------------------------------------------------------
!---------------------------------------------------------------------------------------------------------------------------------
implicit none
character(len=*), intent(IN):: string ! string to be converted
character(len=len(string)):: Upper_Case ! converted string
integer:: n1 ! characters counter
!---------------------------------------------------------------------------------------------------------------------------------
!---------------------------------------------------------------------------------------------------------------------------------
!!The following is the code snippet of Upper\_Case function.
!!
!(\doc)codesnippet
Upper_Case = string
do n1=1,len(string)
select case(ichar(string(n1:n1)))
case(97:122)
Upper_Case(n1:n1)=char(ichar(string(n1:n1))-32) ! Upper case conversion
endselect
enddo
return
!(doc/)codesnippet
!!Upper\_Case function is private and cannot be called outside \LIBVTKIO. If you are interested to use it change its scope
!!to public.
!---------------------------------------------------------------------------------------------------------------------------------
endfunction Upper_Case