| 1 |
/* |
| 2 |
* (C) Copyright 200 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 |
#include <cstring> |
| 12 |
|
| 13 |
#include "PointCloudInterface.h" |
| 14 |
|
| 15 |
#include "atlas/field/FieldSet.h" |
| 16 |
#include "atlas/field/detail/FieldImpl.h" |
| 17 |
#include "atlas/grid/Grid.h" |
| 18 |
#include "atlas/runtime/Exception.h" |
| 19 |
|
| 20 |
namespace atlas { |
| 21 |
namespace functionspace { |
| 22 |
|
| 23 |
// ---------------------------------------------------------------------------- |
| 24 |
// Fortran interfaces |
| 25 |
// ---------------------------------------------------------------------------- |
| 26 |
|
| 27 |
extern "C" { |
| 28 |
|
| 29 |
const detail::PointCloud* atlas__functionspace__PointCloud__new__lonlat(const Field::Implementation* lonlat) { |
| 30 |
return new detail::PointCloud(Field(lonlat)); |
| 31 |
} |
| 32 |
|
| 33 |
const detail::PointCloud* atlas__functionspace__PointCloud__new__lonlat_ghost(const field::FieldImpl* lonlat, |
| 34 |
const field::FieldImpl* ghost) { |
| 35 |
return new detail::PointCloud(Field(lonlat), Field(ghost)); |
| 36 |
} |
| 37 |
|
| 38 |
const detail::PointCloud* atlas__functionspace__PointCloud__new__fieldset(const field::FieldSetImpl* fset) { |
| 39 |
return new detail::PointCloud(FieldSet(fset)); |
| 40 |
} |
| 41 |
|
| 42 |
const detail::PointCloud* atlas__functionspace__PointCloud__new__grid(const Grid::Implementation* grid) { |
| 43 |
return new detail::PointCloud(Grid(grid)); |
| 44 |
} |
| 45 |
|
| 46 |
const field::FieldImpl* atlas__fs__PointCloud__lonlat(const detail::PointCloud* This) { |
| 47 |
return This->lonlat().get(); |
| 48 |
} |
| 49 |
|
| 50 |
idx_t atlas__fs__PointCloud__size(const detail::PointCloud* This) { |
| 51 |
return This->size(); |
| 52 |
} |
| 53 |
} |
| 54 |
|
| 55 |
// ---------------------------------------------------------------------------- |
| 56 |
|
| 57 |
} // namespace functionspace |
| 58 |
} // namespace atlas |