This function \MaiuscolettoBS{must} be called before saving the data related to geometric mesh. This function initializes the saving of data variables indicating the \emph{type} of variables that will be saved.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | var_location | |||
character(len=*), | intent(in) | :: | var_block_action |
The VTK_DAT_XML variables have the following meaning:
Of course a single file can contain both cell and node centered variables. The \MaiuscolettoBS{VTK_DAT_XML} must be called two times, before saving a block-data-variables in order to open the block, and after the block-data-variables has been saved in order to close the block. XML file can contains as many blocks as you want.
The following is an example of VTK_DAT_XML calling:
function VTK_DAT_XML(var_location,var_block_action) result(E_IO)
!---------------------------------------------------------------------------------------------------------------------------------
!!This function \MaiuscolettoBS{must} be called before saving the data related to geometric mesh. This function initializes
!!the saving of data variables indicating the \emph{type} of variables that will be saved.
!---------------------------------------------------------------------------------------------------------------------------------
!---------------------------------------------------------------------------------------------------------------------------------
implicit none
character(*), intent(IN):: var_location ! location of saving variables: CELL for cell-centered, NODE for node-centered
character(*), intent(IN):: var_block_action ! variables block action: OPEN or CLOSE block
integer(I4P):: E_IO ! Input/Output inquiring flag: $0$ if IO is done, $> 0$ if IO is not done
!!The VTK\_DAT\_XML variables have the following meaning:
!!
!!\begin{description}
!!\item[{\color{RoyalBlue}var\_location}] contains the location-type of variables that will be saved after VTK\_DAT.
!!It is a scalar and cab assume the following values:
!! \begin{enumerateABlu}
!! \item \emph{cell} (it is case insensitive) $\rightarrow$ variables will be cell-centered.
!! \item \emph{node} (it is case insensitive) $\rightarrow$ variables will be node-centered.
!! \end{enumerateABlu}
!! \item[{\color{RoyalBlue}var\_block\_action}] indicates if the block-data-variables is being opened or closed; it can
!! assume the following values:
!! \begin{enumerateABlu}
!! \item \emph{open} (it is case insensitive) $\rightarrow$ block-data is being opened.
!! \item \emph{close} (it is case insensitive) $\rightarrow$ block-data is being closed.
!! \end{enumerateABlu}
!! \item[{\color{RoyalBlue}E\_IO}] contains the inquiring integer flag for error handling.
!!\end{description}
!!
!!Of course a single file can contain both cell and node centered variables. The \MaiuscolettoBS{VTK\_DAT\_XML} must be
!!called two times, before saving a block-data-variables in order to open the block, and after the block-data-variables
!!has been saved in order to close the block. XML file can contains as many blocks as you want.
!!
!!The following is an example of VTK\_DAT\_XML calling:
!!
!!\begin{boxred}{VTK\_DAT\_XML Calling}
!!\begin{verbatim}
!!...
!!E_IO = VTK_DAT_XML('node','OPEN')
!!...
!!SAVE YOUR DATA WITH VTK_VAR_XML
!!...
!!E_IO = VTK_DAT_XML('node','CLOSE')
!!...
!!\end{verbatim}
!!\end{boxred}
!---------------------------------------------------------------------------------------------------------------------------------
!---------------------------------------------------------------------------------------------------------------------------------
select case(f_out)
case(f_out_ascii)
select case(trim(Upper_Case(var_location)))
case('CELL')
select case(trim(Upper_Case(var_block_action)))
case('OPEN')
write(unit=Unit_VTK,fmt='(A)',iostat=E_IO)repeat(' ',indent)//'<CellData>'
indent = indent + 2
case('CLOSE')
indent = indent - 2
write(unit=Unit_VTK,fmt='(A)',iostat=E_IO)repeat(' ',indent)//'</CellData>'
endselect
case('NODE')
select case(trim(Upper_Case(var_block_action)))
case('OPEN')
write(unit=Unit_VTK,fmt='(A)',iostat=E_IO)repeat(' ',indent)//'<PointData>'
indent = indent + 2
case('CLOSE')
indent = indent - 2
write(unit=Unit_VTK,fmt='(A)',iostat=E_IO)repeat(' ',indent)//'</PointData>'
endselect
endselect
case(f_out_binary)
select case(trim(Upper_Case(var_location)))
case('CELL')
select case(trim(Upper_Case(var_block_action)))
case('OPEN')
write(unit=Unit_VTK,iostat=E_IO)repeat(' ',indent)//'<CellData>'//end_rec
indent = indent + 2
case('CLOSE')
indent = indent - 2
write(unit=Unit_VTK,iostat=E_IO)repeat(' ',indent)//'</CellData>'//end_rec
endselect
case('NODE')
select case(trim(Upper_Case(var_block_action)))
case('OPEN')
write(unit=Unit_VTK,iostat=E_IO)repeat(' ',indent)//'<PointData>'//end_rec
indent = indent + 2
case('CLOSE')
indent = indent - 2
write(unit=Unit_VTK,iostat=E_IO)repeat(' ',indent)//'</PointData>'//end_rec
endselect
endselect
endselect
return
!---------------------------------------------------------------------------------------------------------------------------------
endfunction VTK_DAT_XML