~fluidity-core/fluidity/exorcised

« back to all changes in this revision

Viewing changes to radiation/Radiation_Materials_Interpolation_Destroy.F90

Latest trunk changes, and modifications to the backward_facing_step_2d example, which are experimental and work is ongoing. It's better than the current trunk example in that at least the k_epsilon code is correct.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
!    Copyright (C) 2006 Imperial College London and others.
2
 
!    
3
 
!    Please see the AUTHORS file in the main source directory for a full list
4
 
!    of copyright holders.
5
 
!
6
 
!    Prof. C Pain
7
 
!    Applied Modelling and Computation Group
8
 
!    Department of Earth Science and Engineering
9
 
!    Imperial College London
10
 
!
11
 
!    amcgsoftware@imperial.ac.uk
12
 
!    
13
 
!    This library is free software; you can redistribute it and/or
14
 
!    modify it under the terms of the GNU Lesser General Public
15
 
!    License as published by the Free Software Foundation,
16
 
!    version 2.1 of the License.
17
 
!
18
 
!    This library is distributed in the hope that it will be useful,
19
 
!    but WITHOUT ANY WARRANTY; without even the implied arranty of
20
 
!    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
21
 
!    Lesser General Public License for more details.
22
 
!
23
 
!    You should have received a copy of the GNU Lesser General Public
24
 
!    License along with this library; if not, write to the Free Software
25
 
!    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
26
 
!    USA
27
 
 
28
 
#include "fdebug.h"
29
 
 
30
 
module radiation_materials_interpolation_destroy
31
 
   
32
 
   use radiation_materials_interpolation_data_types
33
 
 
34
 
   implicit none
35
 
   
36
 
   private 
37
 
 
38
 
   public :: destroy
39
 
   
40
 
   interface destroy
41
 
      module procedure particle_radmat_ii_destroy, &
42
 
                       energy_group_set_all_destroy, &
43
 
                       energy_group_set_destroy, &
44
 
                       region_id_ii_all_destroy, &
45
 
                       region_id_ii_destroy, &
46
 
                       dataset_ii_destroy, &
47
 
                       ii_size_destroy
48
 
   end interface destroy
49
 
 
50
 
contains
51
 
 
52
 
   ! --------------------------------------------------------------------------
53
 
 
54
 
   subroutine particle_radmat_ii_destroy(particle_radmat_ii) 
55
 
   
56
 
      !!< Destroy the particle_radmat_ii type
57
 
 
58
 
      type(particle_radmat_ii_type), intent(inout) :: particle_radmat_ii
59
 
      
60
 
      energy_group_set_ii_deallocate: if (allocated(particle_radmat_ii%energy_group_set_ii)) then
61
 
            
62
 
         call destroy(particle_radmat_ii%energy_group_set_ii)
63
 
         
64
 
      end if energy_group_set_ii_deallocate
65
 
 
66
 
      ! set the flags      
67
 
      particle_radmat_ii%created = .false.
68
 
      
69
 
      particle_radmat_ii%formed = .false.
70
 
      
71
 
   end subroutine particle_radmat_ii_destroy
72
 
 
73
 
   ! --------------------------------------------------------------------------
74
 
   
75
 
   subroutine energy_group_set_all_destroy(energy_group_set_ii)
76
 
      
77
 
      !!< Destroy all the energy_group_set_ii type
78
 
      
79
 
      type(energy_group_set_ii_type), dimension(:), allocatable, intent(inout) :: energy_group_set_ii
80
 
      
81
 
      ! local variables
82
 
      integer :: g_set
83
 
      
84
 
      energy_group_set_loop: do g_set = 1,size(energy_group_set_ii)
85
 
         
86
 
         call destroy(energy_group_set_ii(g_set))
87
 
         
88
 
      end do energy_group_set_loop
89
 
      
90
 
      deallocate(energy_group_set_ii)
91
 
   
92
 
   end subroutine energy_group_set_all_destroy
93
 
 
94
 
   ! --------------------------------------------------------------------------
95
 
   
96
 
   subroutine energy_group_set_destroy(energy_group_set_ii)
97
 
      
98
 
      !!< Destroy the energy_group_set_ii type
99
 
      
100
 
      type(energy_group_set_ii_type), intent(inout) :: energy_group_set_ii
101
 
            
102
 
      region_id_ii_deallocate: if (allocated(energy_group_set_ii%region_id_ii)) then
103
 
         
104
 
         call destroy(energy_group_set_ii%region_id_ii)
105
 
                  
106
 
      end if region_id_ii_deallocate
107
 
      
108
 
      call destroy(energy_group_set_ii%ii_size)
109
 
   
110
 
   end subroutine energy_group_set_destroy
111
 
 
112
 
   ! --------------------------------------------------------------------------
113
 
 
114
 
   subroutine region_id_ii_all_destroy(region_id_ii)
115
 
      
116
 
      !!< Destroy all the region_id_ii type 
117
 
       
118
 
      type(region_id_ii_type), dimension(:), allocatable, intent(inout) :: region_id_ii
119
 
      
120
 
      ! local variables
121
 
      integer :: n
122
 
         
123
 
      node_loop: do n = 1,size(region_id_ii) 
124
 
                     
125
 
         call destroy(region_id_ii(n))
126
 
         
127
 
      end do node_loop
128
 
         
129
 
      deallocate(region_id_ii)
130
 
      
131
 
   end subroutine region_id_ii_all_destroy
132
 
 
133
 
   ! --------------------------------------------------------------------------
134
 
 
135
 
   subroutine region_id_ii_destroy(region_id_ii)
136
 
 
137
 
      !!< Destroy the region_id_ii type
138
 
 
139
 
      type(region_id_ii_type), intent(inout) :: region_id_ii
140
 
      
141
 
      call destroy(region_id_ii%dataset_ii)
142
 
      
143
 
   end subroutine region_id_ii_destroy
144
 
 
145
 
   ! --------------------------------------------------------------------------
146
 
 
147
 
   subroutine dataset_ii_destroy(dataset_ii)
148
 
 
149
 
      !!< Destroy the dataset_ii type 
150
 
 
151
 
      type(dataset_ii_type), intent(inout) :: dataset_ii
152
 
            
153
 
      fraction_deallocate: if (allocated(dataset_ii%physical_radmat_ii%fraction)) then
154
 
               
155
 
         deallocate(dataset_ii%physical_radmat_ii%fraction)
156
 
            
157
 
      end if fraction_deallocate
158
 
 
159
 
      coordinate_deallocate: if (allocated(dataset_ii%physical_radmat_ii%radmat_base_coordinate)) then
160
 
               
161
 
         deallocate(dataset_ii%physical_radmat_ii%radmat_base_coordinate)
162
 
            
163
 
      end if coordinate_deallocate
164
 
      
165
 
   end subroutine dataset_ii_destroy
166
 
 
167
 
   ! --------------------------------------------------------------------------
168
 
 
169
 
   subroutine ii_size_destroy(ii_size)
170
 
      
171
 
      !!< Destroy the ii_size type
172
 
      
173
 
      type(ii_size_type), intent(inout) :: ii_size
174
 
      
175
 
      region_id_ii_size_deallocate: if (allocated(ii_size%region_id_ii_size)) then
176
 
         
177
 
         deallocate(ii_size%region_id_ii_size)
178
 
               
179
 
      end if region_id_ii_size_deallocate
180
 
      
181
 
      ! set the flag
182
 
      ii_size%size_set = .false.
183
 
      
184
 
   end subroutine ii_size_destroy
185
 
 
186
 
   ! --------------------------------------------------------------------------
187
 
 
188
 
end module radiation_materials_interpolation_destroy