@@ -149,18 +149,18 @@ void SphericalVector::do_execute(const Field& sourceField, Field& targetField,
149149 Metadata&) const {
150150 ATLAS_TRACE (" atlas::interpolation::method::SphericalVector::do_execute()" );
151151
152- if (targetField.size () == 0 ) {
153- haloExchange (sourceField);
154- return ;
155- }
156-
157152 const auto fieldType = sourceField.metadata ().getString (" type" , " " );
158153 if (fieldType != " vector" ) {
159154 auto metadata = Metadata ();
160155 Method::do_execute (sourceField, targetField, metadata);
161156 return ;
162157 }
163158
159+ if (targetField.size () == 0 ) {
160+ haloExchange (sourceField);
161+ return ;
162+ }
163+
164164 Method::check_compatibility (sourceField, targetField, matrix ());
165165
166166 haloExchange (sourceField);
@@ -193,18 +193,18 @@ void SphericalVector::do_execute_adjoint(Field& sourceField,
193193 ATLAS_TRACE (
194194 " atlas::interpolation::method::SphericalVector::do_execute_adjoint()" );
195195
196- if (targetField.size () == 0 ) {
197- adjointHaloExchange (sourceField);
198- return ;
199- }
200-
201196 const auto fieldType = sourceField.metadata ().getString (" type" , " " );
202197 if (fieldType != " vector" ) {
203198 auto metadata = Metadata ();
204199 Method::do_execute_adjoint (sourceField, targetField, metadata);
205200 return ;
206201 }
207202
203+ if (targetField.size () == 0 ) {
204+ adjointHaloExchange (sourceField);
205+ return ;
206+ }
207+
208208 Method::check_compatibility (sourceField, targetField, matrix ());
209209
210210 ATLAS_ASSERT (adjoint_, " \" adjoint\" needs to be set to \" true\" in Config." );
0 commit comments