| 1 |
/* |
| 2 |
* (C) Copyright 2013 ECMWF. |
| 3 |
* |
| 4 |
* This software is licensed under the terms of the Apache Licence Version 2.0 |
| 5 |
* which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. |
| 6 |
* In applying this licence, ECMWF does not waive the privileges and immunities |
| 7 |
* granted to it by virtue of its status as an intergovernmental organisation |
| 8 |
* nor does it submit to any jurisdiction. |
| 9 |
*/ |
| 10 |
|
| 11 |
#pragma once |
| 12 |
|
| 13 |
#include "eckit/filesystem/PathName.h" |
| 14 |
|
| 15 |
#include "atlas/array/LocalView.h" |
| 16 |
#include "atlas/functionspace/Spectral.h" |
| 17 |
#include "atlas/grid/Grid.h" |
| 18 |
#include "atlas/grid/StructuredGrid.h" |
| 19 |
#include "atlas/runtime/Exception.h" |
| 20 |
#include "atlas/trans/detail/TransImpl.h" |
| 21 |
|
| 22 |
//----------------------------------------------------------------------------- |
| 23 |
// Forward declarations |
| 24 |
|
| 25 |
struct Trans_t; // declared in "ectrans/transi.h" |
| 26 |
|
| 27 |
namespace atlas { |
| 28 |
class Field; |
| 29 |
class FieldSet; |
| 30 |
namespace field { |
| 31 |
class FieldImpl; |
| 32 |
class FieldSetImpl; |
| 33 |
} // namespace field |
| 34 |
} // namespace atlas |
| 35 |
|
| 36 |
namespace atlas { |
| 37 |
namespace array { |
| 38 |
class Array; |
| 39 |
} |
| 40 |
} // namespace atlas |
| 41 |
|
| 42 |
|
| 43 |
namespace atlas { |
| 44 |
namespace functionspace { |
| 45 |
class StructuredColumns; |
| 46 |
class NodeColumns; |
| 47 |
class Spectral; |
| 48 |
} // namespace functionspace |
| 49 |
} // namespace atlas |
| 50 |
|
| 51 |
namespace atlas { |
| 52 |
namespace functionspace { |
| 53 |
namespace detail { |
| 54 |
class NodeColumns; |
| 55 |
class Spectral; |
| 56 |
} // namespace detail |
| 57 |
} // namespace functionspace |
| 58 |
} // namespace atlas |
| 59 |
|
| 60 |
namespace atlas { |
| 61 |
namespace grid { |
| 62 |
namespace detail { |
| 63 |
namespace partitioner { |
| 64 |
class TransPartitioner; |
| 65 |
} |
| 66 |
} // namespace detail |
| 67 |
} // namespace grid |
| 68 |
} // namespace atlas |
| 69 |
|
| 70 |
|
| 71 |
//----------------------------------------------------------------------------- |
| 72 |
|
| 73 |
namespace atlas { |
| 74 |
namespace trans { |
| 75 |
|
| 76 |
//----------------------------------------------------------------------------- |
| 77 |
|
| 78 |
class TransIFS : public trans::TransImpl { |
| 79 |
private: |
| 80 |
typedef struct ::Trans_t Trans_t; |
| 81 |
|
| 82 |
public: |
| 83 |
TransIFS(const Grid&, const long truncation, const eckit::Configuration& = util::NoConfig()); |
| 84 |
TransIFS(const Grid&, const Domain&, const long truncation, const eckit::Configuration& = util::NoConfig()); |
| 85 |
TransIFS(const Cache&, const Grid&, const long truncation, const eckit::Configuration& = util::NoConfig()); |
| 86 |
TransIFS(const Cache&, const Grid&, const Domain&, const long truncation, |
| 87 |
const eckit::Configuration& = util::NoConfig()); |
| 88 |
|
| 89 |
virtual ~TransIFS() override; |
| 90 |
operator ::Trans_t*() const { return trans(); } |
| 91 |
::Trans_t* trans() const { return trans_.get(); } |
| 92 |
|
| 93 |
virtual int truncation() const override; |
| 94 |
virtual size_t nb_spectral_coefficients() const override; |
| 95 |
virtual size_t nb_spectral_coefficients_global() const override; |
| 96 |
|
| 97 |
virtual const Grid& grid() const override { return grid_; } |
| 98 |
virtual const functionspace::Spectral& spectral() const override; |
| 99 |
|
| 100 |
// pure virtual interface |
| 101 |
|
| 102 |
virtual void dirtrans(const Field& gpfield, Field& spfield, |
| 103 |
const eckit::Configuration& = util::NoConfig()) const override; |
| 104 |
|
| 105 |
virtual void dirtrans(const FieldSet& gpfields, FieldSet& spfields, |
| 106 |
const eckit::Configuration& = util::NoConfig()) const override; |
| 107 |
|
| 108 |
virtual void dirtrans_wind2vordiv(const Field& gpwind, Field& spvor, Field& spdiv, |
| 109 |
const eckit::Configuration& = util::NoConfig()) const override; |
| 110 |
|
| 111 |
virtual void dirtrans_adj(const Field& spfield, Field& gpfield, |
| 112 |
const eckit::Configuration& = util::NoConfig()) const override; |
| 113 |
|
| 114 |
virtual void dirtrans_adj(const FieldSet& spfields, FieldSet& gpfields, |
| 115 |
const eckit::Configuration& = util::NoConfig()) const override; |
| 116 |
|
| 117 |
virtual void dirtrans_wind2vordiv_adj(const Field& spvor, const Field& spdiv, Field& gpwind, |
| 118 |
const eckit::Configuration& = util::NoConfig()) const override; |
| 119 |
|
| 120 |
virtual void invtrans(const Field& spfield, Field& gpfield, |
| 121 |
const eckit::Configuration& = util::NoConfig()) const override; |
| 122 |
|
| 123 |
virtual void invtrans(const FieldSet& spfields, FieldSet& gpfields, |
| 124 |
const eckit::Configuration& = util::NoConfig()) const override; |
| 125 |
|
| 126 |
virtual void invtrans_grad(const Field& spfield, Field& gradfield, |
| 127 |
const eckit::Configuration& = util::NoConfig()) const override; |
| 128 |
|
| 129 |
virtual void invtrans_grad(const FieldSet& spfields, FieldSet& gradfields, |
| 130 |
const eckit::Configuration& = util::NoConfig()) const override; |
| 131 |
|
| 132 |
virtual void invtrans_vordiv2wind(const Field& spvor, const Field& spdiv, Field& gpwind, |
| 133 |
const eckit::Configuration& = util::NoConfig()) const override; |
| 134 |
|
| 135 |
virtual void invtrans_adj(const Field& gpfield, Field& spfield, |
| 136 |
const eckit::Configuration& = util::NoConfig()) const override; |
| 137 |
|
| 138 |
virtual void invtrans_adj(const FieldSet& gpfields, FieldSet& spfields, |
| 139 |
const eckit::Configuration& = util::NoConfig()) const override; |
| 140 |
|
| 141 |
virtual void invtrans_grad_adj(const Field& gradfield, Field& spfield, |
| 142 |
const eckit::Configuration& = util::NoConfig()) const override; |
| 143 |
|
| 144 |
virtual void invtrans_grad_adj(const FieldSet& spfields, FieldSet& gradfields, |
| 145 |
const eckit::Configuration& = util::NoConfig()) const override; |
| 146 |
|
| 147 |
virtual void invtrans_vordiv2wind_adj(const Field& gpwind, Field& spvor, Field& spdiv, |
| 148 |
const eckit::Configuration& = util::NoConfig()) const override; |
| 149 |
|
| 150 |
// -- IFS style API -- |
| 151 |
// These fields have special interpretation required. You need to know what |
| 152 |
// you're doing. |
| 153 |
// See IFS trans library. |
| 154 |
|
| 155 |
/*! |
| 156 |
* @brief invtrans |
| 157 |
* @param nb_scalar_fields |
| 158 |
* @param scalar_spectra [NSPEC2][nb_scalar_fields] |
| 159 |
* @param nb_vordiv_fields |
| 160 |
* @param vorticity_spectra [NSPEC2][nb_vordiv_fields] |
| 161 |
* @param divergence_spectra [NSPEC2][nb_vordiv_fields] |
| 162 |
* @param gp_fields Ordering: [NGPBLKS][NFLD][NPROMA] if distributed, |
| 163 |
* [NFLD][NGPTOTG] if global ( add option::global() |
| 164 |
* ) |
| 165 |
*/ |
| 166 |
virtual void invtrans(const int nb_scalar_fields, const double scalar_spectra[], const int nb_vordiv_fields, |
| 167 |
const double vorticity_spectra[], const double divergence_spectra[], double gp_fields[], |
| 168 |
const eckit::Configuration& = util::NoConfig()) const override; |
| 169 |
|
| 170 |
/*! |
| 171 |
* @brief invtrans |
| 172 |
* @param nb_fields |
| 173 |
* @param scalar_spectra |
| 174 |
* @param scalar_fields |
| 175 |
*/ |
| 176 |
virtual void invtrans(const int nb_scalar_fields, const double scalar_spectra[], double gp_fields[], |
| 177 |
const eckit::Configuration& = util::NoConfig()) const override; |
| 178 |
|
| 179 |
/*! |
| 180 |
* @brief Inverse transform of vorticity/divergence to wind(U/V) |
| 181 |
* @param nb_fields [in] Number of fields ( both components of wind count as 1 ) |
| 182 |
*/ |
| 183 |
virtual void invtrans(const int nb_vordiv_fields, const double vorticity_spectra[], |
| 184 |
const double divergence_spectra[], double gp_fields[], |
| 185 |
const eckit::Configuration& = util::NoConfig()) const override; |
| 186 |
|
| 187 |
|
| 188 |
/*! |
| 189 |
* @brief invtrans_adj |
| 190 |
* @param nb_scalar_fields |
| 191 |
* @param scalar_spectra [NSPEC2][nb_scalar_fields] |
| 192 |
* @param nb_vordiv_fields |
| 193 |
* @param vorticity_spectra [NSPEC2][nb_vordiv_fields] |
| 194 |
* @param divergence_spectra [NSPEC2][nb_vordiv_fields] |
| 195 |
* @param gp_fields Ordering: [NGPBLKS][NFLD][NPROMA] if distributed, |
| 196 |
* [NFLD][NGPTOTG] if global ( add option::global() |
| 197 |
* ) |
| 198 |
*/ |
| 199 |
virtual void invtrans_adj(const int nb_scalar_fields, const double gp_fields[], const int nb_vordiv_fields, |
| 200 |
double vorticity_spectra[], double divergence_spectra[], double scalar_spectra[], |
| 201 |
const eckit::Configuration& = util::NoConfig()) const override; |
| 202 |
|
| 203 |
|
| 204 |
/*! |
| 205 |
* @brief invtrans_adj |
| 206 |
* @param nb_fields |
| 207 |
* @param scalar_spectra |
| 208 |
* @param scalar_fields |
| 209 |
*/ |
| 210 |
virtual void invtrans_adj(const int nb_scalar_fields, const double gp_fields[], double scalar_spectra[], |
| 211 |
const eckit::Configuration& = util::NoConfig()) const override; |
| 212 |
|
| 213 |
|
| 214 |
/*! |
| 215 |
* @brief invtrans_adj |
| 216 |
* @param nb_scalar_fields |
| 217 |
* @param scalar_spectra [NSPEC2][nb_scalar_fields] |
| 218 |
* @param nb_vordiv_fields |
| 219 |
* @param vorticity_spectra [NSPEC2][nb_vordiv_fields] |
| 220 |
* @param divergence_spectra [NSPEC2][nb_vordiv_fields] |
| 221 |
* @param gp_fields Ordering: [NGPBLKS][NFLD][NPROMA] if distributed, |
| 222 |
* [NFLD][NGPTOTG] if global ( add option::global() |
| 223 |
* ) |
| 224 |
*/ |
| 225 |
virtual void invtrans_adj(const int nb_vordiv_fields, const double gp_fields[], double vorticity_spectra[], |
| 226 |
double divergence_spectra[], |
| 227 |
const eckit::Configuration& = util::NoConfig()) const override; |
| 228 |
|
| 229 |
/*! |
| 230 |
* @brief Direct transform of scalar fields |
| 231 |
*/ |
| 232 |
virtual void dirtrans(const int nb_fields, const double scalar_fields[], double scalar_spectra[], |
| 233 |
const eckit::Configuration& = util::NoConfig()) const override; |
| 234 |
|
| 235 |
/*! |
| 236 |
* @brief Direct transform of wind(U/V) to vorticity/divergence |
| 237 |
* @param nb_fields [in] Number of fields ( both components of wind count as 1 ) |
| 238 |
*/ |
| 239 |
virtual void dirtrans(const int nb_fields, const double wind_fields[], double vorticity_spectra[], |
| 240 |
double divergence_spectra[], const eckit::Configuration& = util::NoConfig()) const override; |
| 241 |
|
| 242 |
// implementations |
| 243 |
|
| 244 |
public: |
| 245 |
void __dirtrans(const functionspace::StructuredColumns&, const Field& gpfield, const functionspace::Spectral&, |
| 246 |
Field& spfield, const eckit::Configuration& = util::NoConfig()) const; |
| 247 |
void __dirtrans(const functionspace::NodeColumns&, const Field& gpfield, const functionspace::Spectral&, |
| 248 |
Field& spfield, const eckit::Configuration& = util::NoConfig()) const; |
| 249 |
|
| 250 |
void __dirtrans(const functionspace::StructuredColumns&, const FieldSet& gpfields, const functionspace::Spectral&, |
| 251 |
FieldSet& spfields, const eckit::Configuration& = util::NoConfig()) const; |
| 252 |
void __dirtrans(const functionspace::NodeColumns&, const FieldSet& gpfields, const functionspace::Spectral&, |
| 253 |
FieldSet& spfields, const eckit::Configuration& = util::NoConfig()) const; |
| 254 |
|
| 255 |
void __dirtrans_wind2vordiv(const functionspace::StructuredColumns&, const Field& gpwind, |
| 256 |
const functionspace::Spectral&, Field& spvor, Field& spdiv, |
| 257 |
const eckit::Configuration& = util::NoConfig()) const; |
| 258 |
void __dirtrans_wind2vordiv(const functionspace::NodeColumns&, const Field& gpwind, const functionspace::Spectral&, |
| 259 |
Field& spvor, Field& spdiv, const eckit::Configuration& = util::NoConfig()) const; |
| 260 |
|
| 261 |
void __dirtrans_adj(const functionspace::Spectral&, const Field& spfield, |
| 262 |
const functionspace::StructuredColumns&, Field& gpfield, |
| 263 |
const eckit::Configuration& = util::NoConfig()) const; |
| 264 |
void __dirtrans_adj(const functionspace::Spectral&, const Field& spfield, |
| 265 |
const functionspace::NodeColumns&, Field& gpfield, |
| 266 |
const eckit::Configuration& = util::NoConfig()) const; |
| 267 |
|
| 268 |
void __dirtrans_adj(const functionspace::Spectral&, const FieldSet& spfields, |
| 269 |
const functionspace::StructuredColumns&, FieldSet& gpfields, |
| 270 |
const eckit::Configuration& = util::NoConfig()) const; |
| 271 |
void __dirtrans_adj(const functionspace::Spectral&, const FieldSet& spfields, |
| 272 |
const functionspace::NodeColumns&, FieldSet& gpfields, |
| 273 |
const eckit::Configuration& = util::NoConfig()) const; |
| 274 |
|
| 275 |
void __dirtrans_wind2vordiv_adj(const functionspace::Spectral&, const Field& spvor, const Field& spdiv, |
| 276 |
const functionspace::StructuredColumns&, Field& gpwind, |
| 277 |
const eckit::Configuration& = util::NoConfig()) const; |
| 278 |
void __dirtrans_wind2vordiv_adj(const functionspace::Spectral&, const Field& spvor, const Field& spdiv, |
| 279 |
const functionspace::NodeColumns&, Field& gpwind, |
| 280 |
const eckit::Configuration& = util::NoConfig()) const; |
| 281 |
|
| 282 |
void __invtrans(const functionspace::Spectral&, const Field& spfield, const functionspace::StructuredColumns&, |
| 283 |
Field& gpfield, const eckit::Configuration& = util::NoConfig()) const; |
| 284 |
void __invtrans(const functionspace::Spectral&, const Field& spfield, const functionspace::NodeColumns&, |
| 285 |
Field& gpfield, const eckit::Configuration& = util::NoConfig()) const; |
| 286 |
|
| 287 |
void __invtrans(const functionspace::Spectral&, const FieldSet& spfields, const functionspace::StructuredColumns&, |
| 288 |
FieldSet& gpfields, const eckit::Configuration& = util::NoConfig()) const; |
| 289 |
void __invtrans(const functionspace::Spectral&, const FieldSet& spfields, const functionspace::NodeColumns&, |
| 290 |
FieldSet& gpfields, const eckit::Configuration& = util::NoConfig()) const; |
| 291 |
|
| 292 |
void __invtrans_grad(const functionspace::Spectral& sp, const Field& spfield, |
| 293 |
const functionspace::StructuredColumns& gp, Field& gradfield, |
| 294 |
const eckit::Configuration& = util::NoConfig()) const; |
| 295 |
void __invtrans_grad(const functionspace::Spectral& sp, const Field& spfield, const functionspace::NodeColumns& gp, |
| 296 |
Field& gradfield, const eckit::Configuration& = util::NoConfig()) const; |
| 297 |
|
| 298 |
void __invtrans_grad(const functionspace::Spectral& sp, const FieldSet& spfields, |
| 299 |
const functionspace::StructuredColumns& gp, FieldSet& gradfields, |
| 300 |
const eckit::Configuration& = util::NoConfig()) const; |
| 301 |
void __invtrans_grad(const functionspace::Spectral& sp, const FieldSet& spfields, |
| 302 |
const functionspace::NodeColumns& gp, FieldSet& gradfields, |
| 303 |
const eckit::Configuration& = util::NoConfig()) const; |
| 304 |
|
| 305 |
void __invtrans_vordiv2wind(const functionspace::Spectral&, const Field& spvor, const Field& spdiv, |
| 306 |
const functionspace::StructuredColumns&, Field& gpwind, |
| 307 |
const eckit::Configuration& = util::NoConfig()) const; |
| 308 |
void __invtrans_vordiv2wind(const functionspace::Spectral&, const Field& spvor, const Field& spdiv, |
| 309 |
const functionspace::NodeColumns&, Field& gpwind, |
| 310 |
const eckit::Configuration& = util::NoConfig()) const; |
| 311 |
|
| 312 |
void __invtrans_adj(const functionspace::Spectral&, Field& spfield, const functionspace::StructuredColumns&, |
| 313 |
const Field& gpfield, const eckit::Configuration& = util::NoConfig()) const; |
| 314 |
void __invtrans_adj(const functionspace::Spectral&, Field& spfield, const functionspace::NodeColumns&, |
| 315 |
const Field& gpfield, const eckit::Configuration& = util::NoConfig()) const; |
| 316 |
|
| 317 |
void __invtrans_adj(const functionspace::Spectral&, FieldSet& spfields, const functionspace::StructuredColumns&, |
| 318 |
const FieldSet& gpfields, const eckit::Configuration& = util::NoConfig()) const; |
| 319 |
void __invtrans_adj(const functionspace::Spectral&, FieldSet& spfields, const functionspace::NodeColumns&, |
| 320 |
const FieldSet& gpfields, const eckit::Configuration& = util::NoConfig()) const; |
| 321 |
|
| 322 |
void __invtrans_grad_adj(const functionspace::Spectral& sp, Field& spfield, |
| 323 |
const functionspace::StructuredColumns& gp, const Field& gradfield, |
| 324 |
const eckit::Configuration& = util::NoConfig()) const; |
| 325 |
void __invtrans_grad_adj(const functionspace::Spectral& sp, Field& spfield, const functionspace::NodeColumns& gp, |
| 326 |
const Field& gradfield, const eckit::Configuration& = util::NoConfig()) const; |
| 327 |
|
| 328 |
void __invtrans_grad_adj(const functionspace::Spectral& sp, FieldSet& spfields, |
| 329 |
const functionspace::StructuredColumns& gp, const FieldSet& gradfields, |
| 330 |
const eckit::Configuration& = util::NoConfig()) const; |
| 331 |
void __invtrans_grad_adj(const functionspace::Spectral& sp, FieldSet& spfields, |
| 332 |
const functionspace::NodeColumns& gp, const FieldSet& gradfields, |
| 333 |
const eckit::Configuration& = util::NoConfig()) const; |
| 334 |
|
| 335 |
void __invtrans_vordiv2wind_adj(const functionspace::Spectral&, Field& spvor, Field& spdiv, |
| 336 |
const functionspace::StructuredColumns&, const Field& gpwind, |
| 337 |
const eckit::Configuration& = util::NoConfig()) const; |
| 338 |
void __invtrans_vordiv2wind_adj(const functionspace::Spectral&, Field& spvor, Field& spdiv, |
| 339 |
const functionspace::NodeColumns&, const Field& gpwind, |
| 340 |
const eckit::Configuration& = util::NoConfig()) const; |
| 341 |
|
| 342 |
public: |
| 343 |
void specnorm(const int nb_fields, const double spectra[], double norms[], int rank = 0) const; |
| 344 |
|
| 345 |
protected: |
| 346 |
void assertCompatibleDistributions(const FunctionSpace& gp, const FunctionSpace& /*sp*/) const; |
| 347 |
|
| 348 |
private: |
| 349 |
void ctor(const Grid&, long nsmax, const eckit::Configuration&); |
| 350 |
|
| 351 |
void ctor_rgg(const long nlat, const idx_t pl[], long nsmax, const eckit::Configuration&); |
| 352 |
|
| 353 |
void ctor_lonlat(const long nlon, const long nlat, long nsmax, const eckit::Configuration&); |
| 354 |
|
| 355 |
private: |
| 356 |
friend class grid::detail::partitioner::TransPartitioner; |
| 357 |
|
| 358 |
/// @brief Constructor for grid-only setup (e.g. for |
| 359 |
/// partitioning/parallelisation routines) |
| 360 |
TransIFS(const Grid& g, const eckit::Configuration& = util::NoConfig()); |
| 361 |
|
| 362 |
virtual int handle() const override; |
| 363 |
int ndgl() const; |
| 364 |
int nsmax() const; |
| 365 |
int ngptot() const; |
| 366 |
int ngptotg() const; |
| 367 |
int ngptotmx() const; |
| 368 |
int nspec() const; |
| 369 |
int nspec2() const; |
| 370 |
int nspec2g() const; |
| 371 |
int nspec2mx() const; |
| 372 |
int n_regions_NS() const; |
| 373 |
int n_regions_EW() const; |
| 374 |
int nump() const; |
| 375 |
int nproc() const; |
| 376 |
int myproc(int proc0 = 0) const; |
| 377 |
|
| 378 |
const int* nloen(int& size) const; |
| 379 |
|
| 380 |
array::LocalView<int, 1> nloen() const; |
| 381 |
|
| 382 |
const int* n_regions(int& size) const; |
| 383 |
|
| 384 |
array::LocalView<int, 1> n_regions() const; |
| 385 |
|
| 386 |
const int* nfrstlat(int& size) const; |
| 387 |
|
| 388 |
array::LocalView<int, 1> nfrstlat() const; |
| 389 |
|
| 390 |
const int* nlstlat(int& size) const; |
| 391 |
|
| 392 |
array::LocalView<int, 1> nlstlat() const; |
| 393 |
|
| 394 |
const int* nptrfrstlat(int& size) const; |
| 395 |
|
| 396 |
array::LocalView<int, 1> nptrfrstlat() const; |
| 397 |
|
| 398 |
const int* nsta(int& sizef2, int& sizef1) const; |
| 399 |
|
| 400 |
array::LocalView<int, 2> nsta() const; |
| 401 |
|
| 402 |
const int* nonl(int& sizef2, int& sizef1) const; |
| 403 |
|
| 404 |
array::LocalView<int, 2> nonl() const; |
| 405 |
|
| 406 |
const int* nmyms(int& size) const; |
| 407 |
|
| 408 |
array::LocalView<int, 1> nmyms() const; |
| 409 |
|
| 410 |
const int* nasm0(int& size) const; |
| 411 |
|
| 412 |
array::LocalView<int, 1> nasm0() const; |
| 413 |
|
| 414 |
const int* nvalue(int& size) const; |
| 415 |
|
| 416 |
array::LocalView<int, 1> nvalue() const; |
| 417 |
|
| 418 |
public: |
| 419 |
/*! |
| 420 |
* @brief distspec |
| 421 |
* @param nb_fields |
| 422 |
* @param origin |
| 423 |
* @param global_spectra |
| 424 |
* @param spectra |
| 425 |
*/ |
| 426 |
void distspec(const int nb_fields, const int origin[], const double global_spectra[], double spectra[]) const; |
| 427 |
|
| 428 |
/*! |
| 429 |
* @brief gathspec |
| 430 |
* @param nb_fields |
| 431 |
* @param destination |
| 432 |
* @param spectra |
| 433 |
* @param global_spectra |
| 434 |
*/ |
| 435 |
void gathspec(const int nb_fields, const int destination[], const double spectra[], double global_spectra[]) const; |
| 436 |
|
| 437 |
/*! |
| 438 |
* @brief distgrid |
| 439 |
* @param nb_fields |
| 440 |
* @param origin |
| 441 |
* @param global_fields |
| 442 |
* @param fields |
| 443 |
*/ |
| 444 |
void distgrid(const int nb_fields, const int origin[], const double global_fields[], double fields[]) const; |
| 445 |
|
| 446 |
/*! |
| 447 |
* @brief gathgrid |
| 448 |
* @param nb_fields |
| 449 |
* @param destination |
| 450 |
* @param fields |
| 451 |
* @param global_fields |
| 452 |
*/ |
| 453 |
void gathgrid(const int nb_fields, const int destination[], const double fields[], double global_fields[]) const; |
| 454 |
|
| 455 |
private: |
| 456 |
friend class functionspace::detail::Spectral; |
| 457 |
mutable std::shared_ptr<::Trans_t> trans_; |
| 458 |
StructuredGrid grid_; |
| 459 |
const void* cache_{nullptr}; |
| 460 |
size_t cachesize_{0}; |
| 461 |
|
| 462 |
protected: |
| 463 |
mutable functionspace::Spectral spectral_; |
| 464 |
}; |
| 465 |
|
| 466 |
// ------------------------------------------------------------------ |
| 467 |
|
| 468 |
} // namespace trans |
| 469 |
} // namespace atlas |