@@ -18,6 +18,8 @@ module m_check_ib_patches
1818
1919 use m_compile_specific
2020
21+ use m_helper_basic !< Functions to compare floating point numbers
22+
2123 use m_helper
2224 ! ==========================================================================
2325
@@ -82,9 +84,9 @@ contains
8284 ! Constraints on the geometric parameters of the circle patch
8385 if (n == 0 .or. p > 0 .or. patch_ib(patch_id)%radius <= 0d0 &
8486 .or. &
85- patch_ib(patch_id)%x_centroid == dflt_real &
87+ f_is_default( patch_ib(patch_id)%x_centroid) &
8688 .or. &
87- patch_ib(patch_id)%y_centroid == dflt_real ) then
89+ f_is_default( patch_ib(patch_id)%y_centroid) ) then
8890
8991 call s_mpi_abort(' Inconsistency(ies) detected in ' // &
9092 ' geometric parameters of circle ' // &
@@ -107,8 +109,8 @@ contains
107109 ! Constraints on the geometric parameters of the airfoil patch
108110 if (n == 0 .or. p > 0 .or. patch_ib(patch_id)%c <= 0d0 &
109111 .or. patch_ib(patch_id)%p <= 0d0 .or. patch_ib(patch_id)%t <= 0d0 &
110- .or. patch_ib(patch_id)%m <= 0d0 .or. patch_ib(patch_id)%x_centroid == dflt_real &
111- .or. patch_ib(patch_id)%y_centroid == dflt_real ) then
112+ .or. patch_ib(patch_id)%m <= 0d0 .or. f_is_default( patch_ib(patch_id)%x_centroid) &
113+ .or. f_is_default( patch_ib(patch_id)%y_centroid) ) then
112114
113115 call s_mpi_abort(' Inconsistency(ies) detected in ' // &
114116 ' geometric parameters of airfoil ' // &
@@ -131,9 +133,9 @@ contains
131133 ! Constraints on the geometric parameters of the 3d airfoil patch
132134 if (n == 0 .or. p == 0 .or. patch_ib(patch_id)%c <= 0d0 &
133135 .or. patch_ib(patch_id)%p <= 0d0 .or. patch_ib(patch_id)%t <= 0d0 &
134- .or. patch_ib(patch_id)%m <= 0d0 .or. patch_ib(patch_id)%x_centroid == dflt_real &
135- .or. patch_ib(patch_id)%y_centroid == dflt_real .or. patch_ib(patch_id)%z_centroid == dflt_real &
136- .or. patch_ib(patch_id)%length_z == dflt_real ) then
136+ .or. patch_ib(patch_id)%m <= 0d0 .or. f_is_default( patch_ib(patch_id)%x_centroid) &
137+ .or. f_is_default( patch_ib(patch_id)%y_centroid) .or. f_is_default( patch_ib(patch_id)%z_centroid) &
138+ .or. f_is_default( patch_ib(patch_id)%length_z) ) then
137139
138140 call s_mpi_abort(' Inconsistency(ies) detected in ' // &
139141 ' geometric parameters of airfoil ' // &
@@ -156,9 +158,9 @@ contains
156158 ! Constraints on the geometric parameters of the rectangle patch
157159 if (n == 0 .or. p > 0 &
158160 .or. &
159- patch_ib(patch_id)%x_centroid == dflt_real &
161+ f_is_default( patch_ib(patch_id)%x_centroid) &
160162 .or. &
161- patch_ib(patch_id)%y_centroid == dflt_real &
163+ f_is_default( patch_ib(patch_id)%y_centroid) &
162164 .or. &
163165 patch_ib(patch_id)%length_x <= 0d0 &
164166 .or. &
@@ -185,11 +187,11 @@ contains
185187 ! Constraints on the geometric parameters of the sphere patch
186188 if (n == 0 .or. p == 0 &
187189 .or. &
188- patch_ib(patch_id)%x_centroid == dflt_real &
190+ f_is_default( patch_ib(patch_id)%x_centroid) &
189191 .or. &
190- patch_ib(patch_id)%y_centroid == dflt_real &
192+ f_is_default( patch_ib(patch_id)%y_centroid) &
191193 .or. &
192- patch_ib(patch_id)%z_centroid == dflt_real &
194+ f_is_default( patch_ib(patch_id)%z_centroid) &
193195 .or. &
194196 patch_ib(patch_id)%radius <= 0d0 ) then
195197
@@ -214,27 +216,27 @@ contains
214216 ! Constraints on the geometric parameters of the cylinder patch
215217 if (p == 0 &
216218 .or. &
217- patch_ib(patch_id)%x_centroid == dflt_real &
219+ f_is_default( patch_ib(patch_id)%x_centroid) &
218220 .or. &
219- patch_ib(patch_id)%y_centroid == dflt_real &
221+ f_is_default( patch_ib(patch_id)%y_centroid) &
220222 .or. &
221- patch_ib(patch_id)%z_centroid == dflt_real &
223+ f_is_default( patch_ib(patch_id)%z_centroid) &
222224 .or. &
223225 (patch_ib(patch_id)%length_x <= 0d0 .and. &
224226 patch_ib(patch_id)%length_y <= 0d0 .and. &
225227 patch_ib(patch_id)%length_z <= 0d0 ) &
226228 .or. &
227229 (patch_ib(patch_id)%length_x > 0d0 .and. &
228- (patch_ib(patch_id)%length_y /= dflt_real .or. &
229- patch_ib(patch_id)%length_z /= dflt_real )) &
230+ (( .not. f_is_default( patch_ib(patch_id)%length_y)) .or. &
231+ ( .not. f_is_default( patch_ib(patch_id)%length_z)) )) &
230232 .or. &
231233 (patch_ib(patch_id)%length_y > 0d0 .and. &
232- (patch_ib(patch_id)%length_x /= dflt_real .or. &
233- patch_ib(patch_id)%length_z /= dflt_real )) &
234+ (( .not. f_is_default( patch_ib(patch_id)%length_x)) .or. &
235+ ( .not. f_is_default( patch_ib(patch_id)%length_z)) )) &
234236 .or. &
235237 (patch_ib(patch_id)%length_z > 0d0 .and. &
236- (patch_ib(patch_id)%length_x /= dflt_real .or. &
237- patch_ib(patch_id)%length_y /= dflt_real )) &
238+ (( .not. f_is_default( patch_ib(patch_id)%length_x)) .or. &
239+ ( .not. f_is_default( patch_ib(patch_id)%length_y)) )) &
238240 .or. &
239241 patch_ib(patch_id)%radius <= 0d0 ) then
240242
@@ -256,19 +258,19 @@ contains
256258 call s_int_to_str(patch_id, iStr)
257259
258260 ! Constraints on the geometric parameters of the inactive patch
259- if (patch_ib(patch_id)%x_centroid /= dflt_real &
261+ if (( .not. f_is_default( patch_ib(patch_id)%x_centroid)) &
260262 .or. &
261- patch_ib(patch_id)%y_centroid /= dflt_real &
263+ ( .not. f_is_default( patch_ib(patch_id)%y_centroid)) &
262264 .or. &
263- patch_ib(patch_id)%z_centroid /= dflt_real &
265+ ( .not. f_is_default( patch_ib(patch_id)%z_centroid)) &
264266 .or. &
265- patch_ib(patch_id)%length_x /= dflt_real &
267+ ( .not. f_is_default( patch_ib(patch_id)%length_x)) &
266268 .or. &
267- patch_ib(patch_id)%length_y /= dflt_real &
269+ ( .not. f_is_default( patch_ib(patch_id)%length_y)) &
268270 .or. &
269- patch_ib(patch_id)%length_z /= dflt_real &
271+ ( .not. f_is_default( patch_ib(patch_id)%length_z)) &
270272 .or. &
271- patch_ib(patch_id)%radius /= dflt_real ) then
273+ ( .not. f_is_default( patch_ib(patch_id)%radius)) ) then
272274
273275 call s_mpi_abort(' Inconsistency(ies) detected in ' // &
274276 ' geometric parameters of inactive ' // &
0 commit comments