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 | ||
---|---|---|---|---|---|---|
integer(kind=I4P), | intent(in) | :: | NC_NN | |||
character(len=*), | intent(in) | :: | var_location |
function VTK_DAT(NC_NN,var_location) 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
integer(I4P), intent(IN):: NC_NN ! number of cells or nodes of field
character(*), intent(IN):: var_location ! location of saving variables: cell for cell-centered, node for node-centered
integer(I4P):: E_IO ! Input/Output inquiring flag: $0$ if IO is done, $> 0$ if IO is not done
character(len=maxlen):: s_buffer ! buffer string
!!The VTK\_DAT variables have the following meaning:
!!
!!\begin{description}
!! \item[{\color{RoyalBlue}NC\_NN}] indicates the number of all cells or all nodes according to the value of
!! {\color{RoyalBlue}tipo}.
!! \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}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; in this case the VTK\_DAT function must be
!!called two times, before saving cell-centered variables and before saving node-centered variables.
!!
!!The following is an example of VTK\_DAT calling:
!!
!!\begin{boxred}{VTK\_DAT Calling}
!!\begin{verbatim}
!!...
!!E_IO = VTK_DAT(50,'node')
!!...
!!\end{verbatim}
!!\end{boxred}
!---------------------------------------------------------------------------------------------------------------------------------
!---------------------------------------------------------------------------------------------------------------------------------
select case(f_out)
case(f_out_ascii)
select case(trim(Upper_Case(var_location)))
case('CELL')
write(unit=Unit_VTK,fmt='(A,'//FI4P//')',iostat=E_IO)'CELL_DATA ',NC_NN
case('NODE')
write(unit=Unit_VTK,fmt='(A,'//FI4P//')',iostat=E_IO)'POINT_DATA ',NC_NN
endselect
case(f_out_binary)
select case(trim(Upper_Case(var_location)))
case('CELL')
write(s_buffer,fmt='(A,'//FI4P//')',iostat=E_IO)'CELL_DATA ',NC_NN
write(unit=Unit_VTK,iostat=E_IO)trim(s_buffer)//end_rec
case('NODE')
write(s_buffer,fmt='(A,'//FI4P//')',iostat=E_IO)'POINT_DATA ',NC_NN
write(unit=Unit_VTK,iostat=E_IO)trim(s_buffer)//end_rec
endselect
endselect
return
!---------------------------------------------------------------------------------------------------------------------------------
endfunction VTK_DAT