fileio_generic.f90
Go to the documentation of this file.
1 !#############################################################################
2 !# #
3 !# fosite - 3D hydrodynamical simulation program #
4 !# module: mesh_generic.f90 #
5 !# #
6 !# Copyright (C) 2016 Manuel Jung <mjung@astrophysik.uni-kiel.de> #
7 !# #
8 !# This program is free software; you can redistribute it and/or modify #
9 !# it under the terms of the GNU General Public License as published by #
10 !# the Free Software Foundation; either version 2 of the License, or (at #
11 !# your option) any later version. #
12 !# #
13 !# This program is distributed in the hope that it will be useful, but #
14 !# WITHOUT ANY WARRANTY; without even the implied warranty of #
15 !# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or #
16 !# NON INFRINGEMENT. See the GNU General Public License for more #
17 !# details. #
18 !# #
19 !# You should have received a copy of the GNU General Public License #
20 !# along with this program; if not, write to the Free Software #
21 !# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. #
22 !# #
23 !#############################################################################
24 !----------------------------------------------------------------------------!
32 !----------------------------------------------------------------------------!
34  USE fileio_base_mod
35  USE fileio_vtk_mod
37  USE fileio_xdmf_mod
38  USE mesh_base_mod
42  USE common_dict
43 
44 CONTAINS
45 
46  SUBROUTINE new_fileio(Fileio,Mesh,Physics,Timedisc,Sources,config,IO)
47  IMPLICIT NONE
48  !------------------------------------------------------------------------!
49  CLASS(fileio_base), ALLOCATABLE :: Fileio
50  CLASS(mesh_base), INTENT(IN) :: Mesh
51  CLASS(physics_base), INTENT(IN) :: Physics
52  CLASS(timedisc_base), INTENT(IN) :: Timedisc
53  CLASS(sources_base), INTENT(IN), POINTER :: Sources
54  TYPE(DICT_TYP), INTENT(IN), POINTER :: config
55  TYPE(DICT_TYP), INTENT(IN), POINTER :: IO
56  !------------------------------------------------------------------------!
57  INTEGER :: fileformat
58  !------------------------------------------------------------------------!
59  CALL getattr(config,"fileformat",fileformat)
60 
61  ! allocate data
62  SELECT CASE(fileformat)
63  CASE(vtk)
64  ALLOCATE(fileio_vtk::fileio)
65  CASE(binary)
66  ALLOCATE(fileio_binary::fileio)
67  CASE(xdmf)
68  ALLOCATE(fileio_xdmf::fileio)
69  CASE DEFAULT
70  CALL fileio%Error("new_fileio","Unknown filetype.")
71  END SELECT
72 
73  ! call initialization
74  SELECT TYPE(obj => fileio)
75  TYPE IS (fileio_vtk)
76  CALL obj%InitFileio_vtk(mesh,physics,timedisc,sources,config,io)
77  TYPE IS (fileio_binary)
78  CALL obj%InitFileio_binary(mesh,physics,timedisc,sources,config,io)
79  TYPE IS (fileio_xdmf)
80  CALL obj%InitFileio_xdmf(mesh,physics,timedisc,sources,config,io)
81  END SELECT
82  END SUBROUTINE
83 END MODULE fileio_generic_mod
generic source terms module providing functionaly common to all source terms
constructor for fileio class
subroutine new_fileio(Fileio, Mesh, Physics, Timedisc, Sources, config, IO)
I/O for VTK files in XML format (vtkStructuredGrid)
Definition: fileio_vtk.f90:52
Generic file I/O module.
Definition: fileio_base.f90:54
integer, parameter, public binary
module for binary file I/O
Basic physics module.
integer, parameter, public xdmf
Dictionary for generic data types.
Definition: common_dict.f90:61
integer, parameter, public vtk
module for XDMF file I/O
Definition: fileio_xdmf.f90:41