Function for saving mesh; topology = STRUCTURED_POINTS (R8P).
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=I4P), | intent(in) | :: | Nx | |||
integer(kind=I4P), | intent(in) | :: | Ny | |||
integer(kind=I4P), | intent(in) | :: | Nz | |||
real(kind=R8P), | intent(in) | :: | X0 | |||
real(kind=R8P), | intent(in) | :: | Y0 | |||
real(kind=R8P), | intent(in) | :: | Z0 | |||
real(kind=R8P), | intent(in) | :: | Dx | |||
real(kind=R8P), | intent(in) | :: | Dy | |||
real(kind=R8P), | intent(in) | :: | Dz |
function VTK_GEO_STRP_R8(Nx,Ny,Nz,X0,Y0,Z0,Dx,Dy,Dz) result(E_IO)
!---------------------------------------------------------------------------------------------------------------------------------
!! Function for saving mesh; topology = STRUCTURED\_POINTS (R8P).
!---------------------------------------------------------------------------------------------------------------------------------
!---------------------------------------------------------------------------------------------------------------------------------
implicit none
integer(I4P), intent(IN):: Nx ! number of nodes in x direction
integer(I4P), intent(IN):: Ny ! number of nodes in y direction
integer(I4P), intent(IN):: Nz ! number of nodes in z direction
real(R8P), intent(IN):: X0 ! x coordinate of origin
real(R8P), intent(IN):: Y0 ! y coordinate of origin
real(R8P), intent(IN):: Z0 ! z coordinate of origin
real(R8P), intent(IN):: Dx ! space step in x direction
real(R8P), intent(IN):: Dy ! space step in y direction
real(R8P), intent(IN):: Dz ! space step in z direction
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
!---------------------------------------------------------------------------------------------------------------------------------
!---------------------------------------------------------------------------------------------------------------------------------
select case(f_out)
case(f_out_ascii)
write(unit=Unit_VTK,fmt='(A,3'//FI4P//')', iostat=E_IO)'DIMENSIONS ',Nx,Ny,Nz
write(unit=Unit_VTK,fmt='(A,3'//FR8P//')', iostat=E_IO)'ORIGIN ',X0,Y0,Z0
write(unit=Unit_VTK,fmt='(A,3'//FR8P//')', iostat=E_IO)'SPACING ',Dx,Dy,Dz
case(f_out_binary)
write(s_buffer, fmt='(A,3'//FI4P//')', iostat=E_IO)'DIMENSIONS ',Nx,Ny,Nz
write(unit=Unit_VTK, iostat=E_IO)trim(s_buffer)//end_rec
write(s_buffer, fmt='(A,3'//FR8P//')', iostat=E_IO)'ORIGIN ',X0,Y0,Z0
write(unit=Unit_VTK, iostat=E_IO)trim(s_buffer)//end_rec
write(s_buffer, fmt='(A,3'//FR8P//')', iostat=E_IO)'SPACING ',Dx,Dy,Dz
write(unit=Unit_VTK, iostat=E_IO)trim(s_buffer)//end_rec
endselect
return
!---------------------------------------------------------------------------------------------------------------------------------
endfunction VTK_GEO_STRP_R8