Merge lp:~fluidity-core/fluidity/fluidity-ss-bid-warnings into lp:fluidity

Proposed by Rhodri Davies
Status: Merged
Merged at revision: 4273
Proposed branch: lp:~fluidity-core/fluidity/fluidity-ss-bid-warnings
Merge into: lp:fluidity
Diff against target: 224 lines (+31/-20)
3 files modified
femtools/Boundary_Conditions.F90 (+8/-4)
preprocessor/Boundary_Conditions_From_Options.F90 (+22/-15)
preprocessor/Populate_Sub_State.F90 (+1/-1)
To merge this branch: bzr merge lp:~fluidity-core/fluidity/fluidity-ss-bid-warnings
Reviewer Review Type Date Requested Status
Stephan Kramer Approve
Review via email: mp+191925@code.launchpad.net

Description of the change

Ok - I have fixed bug #1240921 in branch:

lp:~fluidity-core/fluidity/fluidity-ss-bid-warnings

by adding the optional suppress_warnings argument if populate boundary conditions is called from sub_state.

A green buildbot queue is here:

http://buildbot-ocean.ese.ic.ac.uk:8080/builders/fluidity-ss-bid-warnings

To me, it's fine to merge, but best that somebody takes a look through beforehand.

To post a comment you must log in.
4272. By Rhodri Davies

Merge trunk changes into branch.

Revision history for this message
Stephan Kramer (s-kramer) wrote :

Looks fine and dandy to me!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'femtools/Boundary_Conditions.F90'
2--- femtools/Boundary_Conditions.F90 2013-03-03 01:34:34 +0000
3+++ femtools/Boundary_Conditions.F90 2013-10-20 21:56:18 +0000
4@@ -141,7 +141,7 @@
5 contains
6
7 subroutine add_scalar_boundary_condition(field, name, type, boundary_ids, &
8- option_path)
9+ option_path, suppress_warnings)
10 !!< Add boundary condition to scalar field
11 type(scalar_field), intent(inout):: field
12 !! all things should have a name
13@@ -152,6 +152,8 @@
14 integer, dimension(:), intent(in):: boundary_ids
15 !! path to options for this b.c. in the options tree
16 character(len=*), optional, intent(in) :: option_path
17+ !! suppress warnings about non-existant surface ids:
18+ logical, intent(in), optional:: suppress_warnings
19
20 logical, dimension(1:size(boundary_ids)):: boundary_id_used
21 integer, dimension(:), allocatable:: surface_element_list
22@@ -174,7 +176,7 @@
23 end if
24 end do
25
26- if (.not. IsParallel() .and. .not. all(boundary_id_used)) then
27+ if (.not. IsParallel() .and. .not. all(boundary_id_used) .and. .not. present_and_true(suppress_warnings)) then
28 ewrite(0,*) "WARNING: for boundary condition: ", trim(name)
29 ewrite(0,*) "added to field: ", trim(field%name)
30 ewrite(0,*) "The following boundary ids were specified, but they don't appear in the surface mesh:"
31@@ -232,7 +234,7 @@
32 end subroutine add_scalar_boundary_condition_surface_elements
33
34 subroutine add_vector_boundary_condition(field, name, type, boundary_ids, &
35- applies, option_path)
36+ applies, option_path, suppress_warnings)
37 !!< Add boundary condition to vector field
38 type(vector_field), intent(inout):: field
39 !! all things should have a name
40@@ -245,6 +247,8 @@
41 logical, dimension(:), intent(in), optional:: applies
42 !! path to options for this b.c. in the options tree
43 character(len=*), optional, intent(in) :: option_path
44+ !! suppress warnings about non-existant surface ids:
45+ logical, intent(in), optional:: suppress_warnings
46
47 logical, dimension(1:size(boundary_ids)):: boundary_id_used
48 integer, dimension(:), allocatable:: surface_element_list
49@@ -267,7 +271,7 @@
50 end if
51 end do
52
53- if (.not. IsParallel() .and. .not. all(boundary_id_used)) then
54+ if (.not. IsParallel() .and. .not. all(boundary_id_used) .and. .not. present_and_true(suppress_warnings)) then
55 ewrite(0,*) "WARNING: for boundary condition: ", trim(name)
56 ewrite(0,*) "added to field: ", trim(field%name)
57 ewrite(0,*) "The following boundary ids were specified, but they don't appear in the surface mesh:"
58
59=== modified file 'preprocessor/Boundary_Conditions_From_Options.F90'
60--- preprocessor/Boundary_Conditions_From_Options.F90 2013-08-02 08:43:04 +0000
61+++ preprocessor/Boundary_Conditions_From_Options.F90 2013-10-20 21:56:18 +0000
62@@ -71,11 +71,13 @@
63
64 contains
65
66- subroutine populate_boundary_conditions(states)
67+ subroutine populate_boundary_conditions(states, suppress_warnings)
68 ! Populate the boundary conditions of all fields
69 ! This is called as part of populate_state but also
70 ! after an adapt.
71 type(state_type), dimension(:), intent(in):: states
72+ ! suppress warnings about non-existant surface ids
73+ logical, optional, intent(in) :: suppress_warnings
74
75 ! these must be pointers as bc's should be added to the original field
76 type(scalar_field), pointer:: sfield
77@@ -104,9 +106,9 @@
78 field_path=sfield%option_path
79
80 call populate_scalar_boundary_conditions(sfield, &
81- trim(field_path)//'/prognostic/boundary_conditions', position)
82+ trim(field_path)//'/prognostic/boundary_conditions', position, suppress_warnings=suppress_warnings)
83 call populate_scalar_boundary_conditions(sfield, &
84- trim(field_path)//'/diagnostic/algorithm/boundary_conditions', position)
85+ trim(field_path)//'/diagnostic/algorithm/boundary_conditions', position, suppress_warnings=suppress_warnings)
86
87 end do
88
89@@ -121,7 +123,7 @@
90
91 ! only prognostic fields from here:
92 call populate_vector_boundary_conditions(states(p+1),vfield, &
93- trim(field_path)//'/prognostic/boundary_conditions', position)
94+ trim(field_path)//'/prognostic/boundary_conditions', position, suppress_warnings=suppress_warnings)
95
96 end do
97
98@@ -170,12 +172,14 @@
99
100 end subroutine populate_boundary_conditions
101
102- subroutine populate_scalar_boundary_conditions(field, bc_path, position)
103+ subroutine populate_scalar_boundary_conditions(field, bc_path, position, suppress_warnings)
104 ! Populate the boundary conditions of one scalar field
105 ! needs to be a pointer:
106 type(scalar_field), pointer:: field
107 character(len=*), intent(in):: bc_path
108 type(vector_field), intent(in):: position
109+ ! suppress warnings about non-existant surface ids
110+ logical, optional, intent(in) :: suppress_warnings
111
112 type(mesh_type), pointer:: surface_mesh
113 type(scalar_field) surface_field
114@@ -244,7 +248,7 @@
115
116 ! Add boundary condition
117 call add_boundary_condition(field, trim(bc_name), trim(bc_type), &
118- surface_ids, option_path=bc_path_i)
119+ surface_ids, option_path=bc_path_i, suppress_warnings=suppress_warnings)
120
121 ! mesh of only the part of the surface where this b.c. applies
122 call get_boundary_condition(field, i+1, surface_mesh=surface_mesh, &
123@@ -303,13 +307,15 @@
124
125 end subroutine populate_scalar_boundary_conditions
126
127- subroutine populate_vector_boundary_conditions(state, field, bc_path, position)
128+ subroutine populate_vector_boundary_conditions(state, field, bc_path, position, suppress_warnings)
129 ! Populate the boundary conditions of one vector field
130 ! needs to be a pointer:
131 type(state_type), intent(in) :: state
132 type(vector_field), pointer:: field
133 character(len=*), intent(in):: bc_path
134 type(vector_field), intent(in):: position
135+ ! suppress warnings about non-existant surface ids
136+ logical, optional, intent(in) :: suppress_warnings
137
138 ! possible vector components for vector b.c.s
139 ! either carteisan aligned or aligned with the surface
140@@ -373,7 +379,7 @@
141 call add_sem_bc(have_sem_bc)
142
143 call add_boundary_condition(field, trim(bc_name), trim(bc_type),&
144- & surface_ids, applies=applies, option_path=bc_path_i)
145+ & surface_ids, applies=applies, option_path=bc_path_i, suppress_warnings=suppress_warnings)
146 deallocate(surface_ids)
147
148 call get_boundary_condition(field, i+1, surface_mesh=surface_mesh)
149@@ -412,7 +418,7 @@
150 end do
151
152 call add_boundary_condition(field, trim(bc_name), trim(bc_type),&
153- & surface_ids, applies=applies, option_path=bc_path_i)
154+ & surface_ids, applies=applies, option_path=bc_path_i, suppress_warnings=suppress_warnings)
155 deallocate(surface_ids)
156
157 call get_boundary_condition(field, i+1, surface_mesh=surface_mesh)
158@@ -427,7 +433,7 @@
159 case("drag")
160
161 call add_boundary_condition(field, trim(bc_name), trim(bc_type), &
162- & surface_ids, option_path=bc_path_i)
163+ & surface_ids, option_path=bc_path_i, suppress_warnings=suppress_warnings)
164 deallocate(surface_ids)
165
166 call get_boundary_condition(field, i+1, surface_mesh=surface_mesh)
167@@ -438,7 +444,7 @@
168 case ("wind_forcing")
169
170 call add_boundary_condition(field, trim(bc_name), trim(bc_type), &
171- & surface_ids, option_path=bc_path_i)
172+ & surface_ids, option_path=bc_path_i, suppress_warnings=suppress_warnings)
173 deallocate(surface_ids)
174
175 call get_boundary_condition(field, i+1, surface_mesh=surface_mesh)
176@@ -456,7 +462,8 @@
177
178 ! Just add to the first dimension
179 call add_boundary_condition(field, trim(bc_name), trim(bc_type),&
180- & surface_ids, applies=(/ .true., .false., .false. /) , option_path=bc_path_i)
181+ & surface_ids, applies=(/ .true., .false., .false. /) , option_path=bc_path_i,&
182+ & suppress_warnings=suppress_warnings)
183 deallocate(surface_ids)
184 call get_boundary_condition(field, i+1, surface_mesh=surface_mesh)
185 call allocate(surface_field, field%dim, surface_mesh, name="value")
186@@ -467,7 +474,7 @@
187
188 ! The bulk_formulae type is actually a wind forcing on velocity...
189 call add_boundary_condition(field, trim(bc_name) ,&
190- &'wind_forcing', surface_ids, option_path=bc_path_i)
191+ &'wind_forcing', surface_ids, option_path=bc_path_i,suppress_warnings=suppress_warnings)
192 deallocate(surface_ids)
193 call get_boundary_condition(field, i+1, surface_mesh=surface_mesh)
194 call allocate(surface_field, field%dim-1, surface_mesh, name="WindSurfaceField")
195@@ -481,7 +488,7 @@
196 ! applying in the tangential directions only
197 call add_boundary_condition(field, trim(bc_name), trim(bc_type), &
198 & surface_ids, option_path=bc_path_i, &
199- & applies=(/ .true., .false., .false. /) )
200+ & applies=(/ .true., .false., .false. /),suppress_warnings=suppress_warnings)
201 deallocate(surface_ids)
202
203 if (trim(bc_type)=="free_surface") then
204@@ -502,7 +509,7 @@
205 case ("outflow")
206 ! dummy bc for outflow planes
207 call add_boundary_condition(field, trim(bc_name), trim(bc_type), surface_ids, option_path=bc_path_i, &
208- & applies=(/ .true., .true., .true. /) )
209+ & applies=(/ .true., .true., .true. /),suppress_warnings=suppress_warnings )
210 deallocate(surface_ids)
211
212 case default
213
214=== modified file 'preprocessor/Populate_Sub_State.F90'
215--- preprocessor/Populate_Sub_State.F90 2013-06-17 18:03:49 +0000
216+++ preprocessor/Populate_Sub_State.F90 2013-10-20 21:56:18 +0000
217@@ -106,7 +106,7 @@
218
219 call allocate_and_insert_fields(sub_states)
220
221- call populate_boundary_conditions(sub_states)
222+ call populate_boundary_conditions(sub_states, suppress_warnings=.true.)
223
224 call set_boundary_conditions_values(sub_states)
225