DCS
a Driven-Cavity Open source Simulator code
 All Classes Files Functions Variables Groups Pages
Data_Type_Node.f90
Go to the documentation of this file.
1 
6 
12 
18 
24 
26 module data_type_node
27 !-----------------------------------------------------------------------------------------------------------------------------------
28 USE ir_precision ! Integers and reals precision definition.
29 USE data_type_vector ! Definition of Type_Vector.
30 !-----------------------------------------------------------------------------------------------------------------------------------
31 
32 !-----------------------------------------------------------------------------------------------------------------------------------
33 private
34 !-----------------------------------------------------------------------------------------------------------------------------------
35 
36 !-----------------------------------------------------------------------------------------------------------------------------------
39 type, public:: type_node
40  type(type_vector):: xyz
41  contains
42  procedure, non_overridable:: initialize ! Procedure for initializing Type_Node.
43  procedure, non_overridable:: finalize ! Procedure for finalizing Type_Node.
44  procedure, non_overridable:: pprint ! Procedure for printing Type_Node components with a "pretty" format.
45 endtype type_node
48 type, public:: type_node_ptr
49  type(type_node), pointer:: p => null()
50 endtype type_node_ptr
51 !-----------------------------------------------------------------------------------------------------------------------------------
52 contains
56 
60  elemental subroutine initialize(self,xyz)
61  !---------------------------------------------------------------------------------------------------------------------------------
62  implicit none
63  class(type_node), intent(INOUT):: self
64  type(type_vector), intent(IN):: xyz
65  !---------------------------------------------------------------------------------------------------------------------------------
66 
67  !---------------------------------------------------------------------------------------------------------------------------------
68  self%xyz = xyz
69  return
70  !---------------------------------------------------------------------------------------------------------------------------------
71  endsubroutine initialize
72 
74  elemental subroutine finalize(self)
75  !---------------------------------------------------------------------------------------------------------------------------------
76  implicit none
77  class(type_node), intent(INOUT):: self
78  !---------------------------------------------------------------------------------------------------------------------------------
79 
80  !---------------------------------------------------------------------------------------------------------------------------------
81  return
82  !---------------------------------------------------------------------------------------------------------------------------------
83  endsubroutine finalize
84 
87  function pprint(self,unit) result(err)
88  !---------------------------------------------------------------------------------------------------------------------------------
89  implicit none
90  class(type_node), intent(IN):: self
91  integer(I4P), intent(IN):: unit
92  integer(I4P):: err
93  integer(I4P):: n
94  !---------------------------------------------------------------------------------------------------------------------------------
95 
96  !---------------------------------------------------------------------------------------------------------------------------------
97  write(unit,'(A)',iostat=err)' x='//trim(str(n=self%xyz%x))//' y='//trim(str(n=self%xyz%y))//' z='//trim(str(n=self%xyz%z))
98  return
99  !---------------------------------------------------------------------------------------------------------------------------------
100  endfunction pprint
102 endmodule data_type_node
Derived type containing conservative variables.
procedure, non_overridable finalize
This module contains the definition of Type_Node and its procedures.
Derived type defining vectors.
Procedure for converting number, real and integer, to string (number to string type casting); logical...
This module contains the definition of Type_Vector and its procedures.
procedure, non_overridable initialize
procedure, non_overridable pprint
Pointer of Type_Node for creating array of pointers of Type_Node.
Module IR_Precision makes available some portable kind-parameters and some useful procedures to deal ...