| 1 |
! (C) Copyright 2013 ECMWF. |
| 2 |
! |
| 3 |
! This software is licensed under the terms of the Apache Licence Version 2.0 |
| 4 |
! which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. |
| 5 |
! In applying this licence, ECMWF does not waive the privileges and immunities |
| 6 |
! granted to it by virtue of its status as an intergovernmental organisation nor |
| 7 |
! does it submit to any jurisdiction. |
| 8 |
|
| 9 |
#include "atlas/atlas_f.h" |
| 10 |
|
| 11 |
module atlas_functionspace_StructuredColumns_module |
| 12 |
|
| 13 |
use, intrinsic :: iso_c_binding, only : c_ptr, c_double |
| 14 |
use fckit_c_interop_module, only : c_str, c_ptr_to_string, c_ptr_free |
| 15 |
use atlas_functionspace_module, only : atlas_FunctionSpace |
| 16 |
use atlas_Field_module, only: atlas_Field |
| 17 |
use atlas_FieldSet_module, only: atlas_FieldSet |
| 18 |
use atlas_Grid_module, only: atlas_Grid |
| 19 |
use atlas_Config_module, only: atlas_Config |
| 20 |
use atlas_kinds_module, only : ATLAS_KIND_IDX |
| 21 |
use fckit_owned_object_module, only : fckit_owned_object |
| 22 |
use atlas_GridDistribution_module, only : atlas_GridDistribution |
| 23 |
use atlas_Partitioner_module, only : atlas_Partitioner |
| 24 |
use atlas_Vertical_module, only : atlas_Vertical |
| 25 |
|
| 26 |
implicit none |
| 27 |
|
| 28 |
private :: c_ptr, c_double |
| 29 |
private :: c_str, c_ptr_to_string, c_ptr_free |
| 30 |
private :: atlas_FunctionSpace |
| 31 |
private :: atlas_Field |
| 32 |
private :: atlas_FieldSet |
| 33 |
private :: atlas_Grid |
| 34 |
private :: atlas_GridDistribution |
| 35 |
private :: atlas_Partitioner |
| 36 |
private :: atlas_Vertical |
| 37 |
private :: atlas_Config |
| 38 |
private :: fckit_owned_object |
| 39 |
|
| 40 |
public :: atlas_functionspace_StructuredColumns |
| 41 |
|
| 42 |
private |
| 43 |
|
| 44 |
!------------------------------------------------------------------------------ |
| 45 |
TYPE, extends(atlas_FunctionSpace) :: atlas_functionspace_StructuredColumns |
| 46 |
|
| 47 |
! Purpose : |
| 48 |
! ------- |
| 49 |
! *atlas_functionspace_StructuredColumns* : Interpretes spectral fields |
| 50 |
|
| 51 |
! Methods : |
| 52 |
! ------- |
| 53 |
|
| 54 |
! Author : |
| 55 |
! ------ |
| 56 |
! August-2015 Willem Deconinck *ECMWF* |
| 57 |
|
| 58 |
!------------------------------------------------------------------------------ |
| 59 |
integer(ATLAS_KIND_IDX), pointer, public :: index(:,:) |
| 60 |
|
| 61 |
contains |
| 62 |
|
| 63 |
procedure, public :: assignment_operator_hook |
| 64 |
|
| 65 |
procedure, private :: gather_fieldset |
| 66 |
procedure, private :: gather_field |
| 67 |
generic, public :: gather => gather_fieldset, gather_field |
| 68 |
|
| 69 |
procedure, private :: scatter_fieldset |
| 70 |
procedure, private :: scatter_field |
| 71 |
generic, public :: scatter => scatter_fieldset, scatter_field |
| 72 |
|
| 73 |
procedure, private :: checksum_fieldset |
| 74 |
procedure, private :: checksum_field |
| 75 |
generic, public :: checksum => checksum_fieldset, checksum_field |
| 76 |
|
| 77 |
procedure :: j_begin |
| 78 |
procedure :: j_end |
| 79 |
procedure :: i_begin |
| 80 |
procedure :: i_end |
| 81 |
procedure :: j_begin_halo |
| 82 |
procedure :: j_end_halo |
| 83 |
procedure :: i_begin_halo |
| 84 |
procedure :: i_end_halo |
| 85 |
|
| 86 |
procedure :: size => get_size |
| 87 |
procedure :: size_owned => get_size_owned |
| 88 |
|
| 89 |
procedure :: levels |
| 90 |
|
| 91 |
procedure :: xy |
| 92 |
!! Return xy coordinate field |
| 93 |
procedure :: z |
| 94 |
!! Return z coordinate field |
| 95 |
procedure :: partition |
| 96 |
!! Return partition field |
| 97 |
procedure :: global_index |
| 98 |
!! Return global_index field |
| 99 |
procedure :: index_i |
| 100 |
!! Return index_i field |
| 101 |
procedure :: index_j |
| 102 |
!! Return index_j field |
| 103 |
|
| 104 |
procedure :: grid |
| 105 |
|
| 106 |
procedure, private :: set_index |
| 107 |
|
| 108 |
#if FCKIT_FINAL_NOT_INHERITING |
| 109 |
final :: StructuredColumns__final_auto |
| 110 |
#endif |
| 111 |
|
| 112 |
END TYPE atlas_functionspace_StructuredColumns |
| 113 |
|
| 114 |
interface atlas_functionspace_StructuredColumns |
| 115 |
module procedure ctor_cptr |
| 116 |
module procedure ctor_grid |
| 117 |
module procedure ctor_grid_dist |
| 118 |
module procedure ctor_grid_dist_config |
| 119 |
module procedure ctor_grid_dist_levels |
| 120 |
module procedure ctor_grid_dist_vertical |
| 121 |
module procedure ctor_grid_part |
| 122 |
module procedure ctor_grid_part_levels |
| 123 |
module procedure ctor_grid_part_vertical |
| 124 |
end interface |
| 125 |
|
| 126 |
|
| 127 |
!------------------------------------------------------------------------------ |
| 128 |
|
| 129 |
!======================================================== |
| 130 |
contains |
| 131 |
!======================================================== |
| 132 |
|
| 133 |
subroutine assignment_operator_hook(this,other) |
| 134 |
class(atlas_functionspace_StructuredColumns) :: this |
| 135 |
class(fckit_owned_object) :: other |
| 136 |
call this%set_index() |
| 137 |
FCKIT_SUPPRESS_UNUSED(other) |
| 138 |
end subroutine |
| 139 |
|
| 140 |
function ctor_cptr(cptr) result(this) |
| 141 |
type(atlas_functionspace_StructuredColumns) :: this |
| 142 |
type(c_ptr), intent(in) :: cptr |
| 143 |
call this%reset_c_ptr( cptr ) |
| 144 |
call this%set_index() |
| 145 |
call this%return() |
| 146 |
end function |
| 147 |
|
| 148 |
function empty_config() result(config) |
| 149 |
type(atlas_Config) :: config |
| 150 |
config = atlas_Config() |
| 151 |
call config%return() |
| 152 |
end function |
| 153 |
|
| 154 |
function ctor_grid(grid, halo, levels) result(this) |
| 155 |
use atlas_functionspace_StructuredColumns_c_binding |
| 156 |
type(atlas_functionspace_StructuredColumns) :: this |
| 157 |
class(atlas_Grid), intent(in) :: grid |
| 158 |
integer, optional :: halo |
| 159 |
integer, optional :: levels |
| 160 |
type(atlas_Config) :: config |
| 161 |
config = empty_config() ! Due to PGI compiler bug, we have to do this instead of "config = atlas_Config()"" |
| 162 |
if( present(halo) ) call config%set("halo",halo) |
| 163 |
if( present(levels) ) call config%set("levels",levels) |
| 164 |
call this%reset_c_ptr( atlas__functionspace__StructuredColumns__new__grid( grid%CPTR_PGIBUG_A, & |
| 165 |
& config%CPTR_PGIBUG_B ) ) |
| 166 |
call this%set_index() |
| 167 |
call config%final() |
| 168 |
call this%return() |
| 169 |
end function |
| 170 |
|
| 171 |
function ctor_grid_dist(grid, distribution, halo, levels) result(this) |
| 172 |
use atlas_functionspace_StructuredColumns_c_binding |
| 173 |
type(atlas_functionspace_StructuredColumns) :: this |
| 174 |
class(atlas_Grid), intent(in) :: grid |
| 175 |
type(atlas_griddistribution), intent(in) :: distribution |
| 176 |
integer, optional :: halo |
| 177 |
integer, optional :: levels |
| 178 |
type(atlas_Config) :: config |
| 179 |
config = empty_config() ! Due to PGI compiler bug, we have to do this instead of "config = atlas_Config()"" |
| 180 |
if( present(halo) ) call config%set("halo",halo) |
| 181 |
if( present(levels) ) call config%set("levels",levels) |
| 182 |
call this%reset_c_ptr( atlas__functionspace__StructuredColumns__new__grid_dist( & |
| 183 |
& grid%CPTR_PGIBUG_A, distribution%CPTR_PGIBUG_A, config%CPTR_PGIBUG_B ) ) |
| 184 |
call this%set_index() |
| 185 |
call config%final() |
| 186 |
call this%return() |
| 187 |
end function |
| 188 |
|
| 189 |
function ctor_grid_dist_levels(grid, distribution, levels, halo) result(this) |
| 190 |
use atlas_functionspace_StructuredColumns_c_binding |
| 191 |
type(atlas_functionspace_StructuredColumns) :: this |
| 192 |
class(atlas_Grid), intent(in) :: grid |
| 193 |
type(atlas_griddistribution), intent(in) :: distribution |
| 194 |
integer, optional :: halo |
| 195 |
real(c_double) :: levels(:) |
| 196 |
type(atlas_Config) :: config |
| 197 |
type(atlas_Vertical) :: vertical |
| 198 |
config = empty_config() ! Due to PGI compiler bug, we have to do this insted of "config = atlas_Config()"" |
| 199 |
if( present(halo) ) call config%set("halo",halo) |
| 200 |
call config%set("levels",size(levels)) |
| 201 |
vertical = atlas_Vertical(levels) |
| 202 |
call this%reset_c_ptr( atlas__functionspace__StructuredColumns__new__grid_dist_vert( & |
| 203 |
& grid%CPTR_PGIBUG_A, distribution%CPTR_PGIBUG_A, vertical%CPTR_PGIBUG_B, & |
| 204 |
& config%CPTR_PGIBUG_B ) ) |
| 205 |
call this%set_index() |
| 206 |
call config%final() |
| 207 |
call vertical%final() |
| 208 |
call this%return() |
| 209 |
end function |
| 210 |
|
| 211 |
function ctor_grid_dist_vertical(grid, distribution, vertical, halo) result(this) |
| 212 |
use atlas_functionspace_StructuredColumns_c_binding |
| 213 |
type(atlas_functionspace_StructuredColumns) :: this |
| 214 |
class(atlas_Grid), intent(in) :: grid |
| 215 |
type(atlas_griddistribution), intent(in) :: distribution |
| 216 |
integer, optional :: halo |
| 217 |
type(atlas_Vertical) :: vertical |
| 218 |
type(atlas_Config) :: config |
| 219 |
config = empty_config() ! Due to PGI compiler bug, we have to do this insted of "config = atlas_Config()"" |
| 220 |
if( present(halo) ) call config%set("halo",halo) |
| 221 |
call config%set("levels",vertical%size()) |
| 222 |
call this%reset_c_ptr( atlas__functionspace__StructuredColumns__new__grid_dist_vert( & |
| 223 |
& grid%CPTR_PGIBUG_A, distribution%CPTR_PGIBUG_A, vertical%CPTR_PGIBUG_B, & |
| 224 |
& config%CPTR_PGIBUG_B ) ) |
| 225 |
call this%set_index() |
| 226 |
call config%final() |
| 227 |
call this%return() |
| 228 |
end function |
| 229 |
|
| 230 |
function ctor_grid_dist_config(grid, distribution, config) result(this) |
| 231 |
use atlas_functionspace_StructuredColumns_c_binding |
| 232 |
type(atlas_functionspace_StructuredColumns) :: this |
| 233 |
class(atlas_Grid), intent(in) :: grid |
| 234 |
type(atlas_griddistribution), intent(in) :: distribution |
| 235 |
type(atlas_Config), intent (in) :: config |
| 236 |
call this%reset_c_ptr(atlas__functionspace__StructuredColumns__new__grid_dist_config( & |
| 237 |
& grid%CPTR_PGIBUG_A, distribution%CPTR_PGIBUG_A, & |
| 238 |
& config%CPTR_PGIBUG_B ) ) |
| 239 |
call this%set_index() |
| 240 |
call this%return() |
| 241 |
end function |
| 242 |
|
| 243 |
|
| 244 |
function ctor_grid_part(grid, partitioner, halo, levels) result(this) |
| 245 |
use atlas_functionspace_StructuredColumns_c_binding |
| 246 |
type(atlas_functionspace_StructuredColumns) :: this |
| 247 |
class(atlas_Grid), intent(in) :: grid |
| 248 |
type(atlas_Partitioner), intent(in) :: partitioner |
| 249 |
integer, optional :: halo |
| 250 |
integer, optional :: levels |
| 251 |
type(atlas_Config) :: config |
| 252 |
config = empty_config() ! Due to PGI compiler bug, we have to do this instead of "config = atlas_Config()"" |
| 253 |
if( present(halo) ) call config%set("halo",halo) |
| 254 |
if( present(levels) ) call config%set("levels",levels) |
| 255 |
call this%reset_c_ptr( atlas__functionspace__StructuredColumns__new__grid_part( & |
| 256 |
& grid%CPTR_PGIBUG_A, partitioner%CPTR_PGIBUG_A, config%CPTR_PGIBUG_B ) ) |
| 257 |
call this%set_index() |
| 258 |
call config%final() |
| 259 |
call this%return() |
| 260 |
end function |
| 261 |
|
| 262 |
function ctor_grid_part_levels(grid, partitioner, levels, halo) result(this) |
| 263 |
use atlas_functionspace_StructuredColumns_c_binding |
| 264 |
type(atlas_functionspace_StructuredColumns) :: this |
| 265 |
class(atlas_Grid), intent(in) :: grid |
| 266 |
type(atlas_Partitioner), intent(in) :: partitioner |
| 267 |
integer, optional :: halo |
| 268 |
real(c_double) :: levels(:) |
| 269 |
type(atlas_Config) :: config |
| 270 |
type(atlas_Vertical) :: vertical |
| 271 |
config = empty_config() ! Due to PGI compiler bug, we have to do this insted of "config = atlas_Config()"" |
| 272 |
if( present(halo) ) call config%set("halo",halo) |
| 273 |
call config%set("levels",size(levels)) |
| 274 |
vertical = atlas_Vertical(levels) |
| 275 |
call this%reset_c_ptr( atlas__functionspace__StructuredColumns__new__grid_part_vert( & |
| 276 |
& grid%CPTR_PGIBUG_A, partitioner%CPTR_PGIBUG_A, vertical%CPTR_PGIBUG_B, & |
| 277 |
& config%CPTR_PGIBUG_B ) ) |
| 278 |
call this%set_index() |
| 279 |
call config%final() |
| 280 |
call vertical%final() |
| 281 |
call this%return() |
| 282 |
end function |
| 283 |
|
| 284 |
function ctor_grid_part_vertical(grid, partitioner, vertical, halo) result(this) |
| 285 |
use atlas_functionspace_StructuredColumns_c_binding |
| 286 |
type(atlas_functionspace_StructuredColumns) :: this |
| 287 |
class(atlas_Grid), intent(in) :: grid |
| 288 |
type(atlas_Partitioner), intent(in) :: partitioner |
| 289 |
integer, optional :: halo |
| 290 |
type(atlas_Vertical) :: vertical |
| 291 |
type(atlas_Config) :: config |
| 292 |
config = empty_config() ! Due to PGI compiler bug, we have to do this insted of "config = atlas_Config()"" |
| 293 |
if( present(halo) ) call config%set("halo",halo) |
| 294 |
call config%set("levels",vertical%size()) |
| 295 |
call this%reset_c_ptr( atlas__functionspace__StructuredColumns__new__grid_part_vert( & |
| 296 |
& grid%CPTR_PGIBUG_A, partitioner%CPTR_PGIBUG_A, vertical%CPTR_PGIBUG_B, & |
| 297 |
& config%CPTR_PGIBUG_B ) ) |
| 298 |
call this%set_index() |
| 299 |
call config%final() |
| 300 |
call this%return() |
| 301 |
end function |
| 302 |
|
| 303 |
|
| 304 |
subroutine gather_field(this,local,global) |
| 305 |
use atlas_functionspace_StructuredColumns_c_binding |
| 306 |
class(atlas_functionspace_StructuredColumns), intent(in) :: this |
| 307 |
type(atlas_Field), intent(in) :: local |
| 308 |
type(atlas_Field), intent(inout) :: global |
| 309 |
call atlas__functionspace__StructuredColumns__gather_field(this%CPTR_PGIBUG_A,local%CPTR_PGIBUG_A,global%CPTR_PGIBUG_A) |
| 310 |
end subroutine |
| 311 |
|
| 312 |
subroutine gather_fieldset(this,local,global) |
| 313 |
use atlas_functionspace_StructuredColumns_c_binding |
| 314 |
class(atlas_functionspace_StructuredColumns), intent(in) :: this |
| 315 |
type(atlas_FieldSet), intent(in) :: local |
| 316 |
type(atlas_FieldSet), intent(inout) :: global |
| 317 |
call atlas__functionspace__StructuredColumns__gather_fieldset(this%CPTR_PGIBUG_A,local%CPTR_PGIBUG_A,global%CPTR_PGIBUG_A) |
| 318 |
end subroutine |
| 319 |
|
| 320 |
subroutine scatter_field(this,global,local) |
| 321 |
use atlas_functionspace_StructuredColumns_c_binding |
| 322 |
class(atlas_functionspace_StructuredColumns), intent(in) :: this |
| 323 |
type(atlas_Field), intent(in) :: global |
| 324 |
type(atlas_Field), intent(inout) :: local |
| 325 |
call atlas__functionspace__StructuredColumns__scatter_field(this%CPTR_PGIBUG_A,global%CPTR_PGIBUG_A,local%CPTR_PGIBUG_A) |
| 326 |
end subroutine |
| 327 |
|
| 328 |
subroutine scatter_fieldset(this,global,local) |
| 329 |
use atlas_functionspace_StructuredColumns_c_binding |
| 330 |
class(atlas_functionspace_StructuredColumns), intent(in) :: this |
| 331 |
type(atlas_FieldSet), intent(in) :: global |
| 332 |
type(atlas_FieldSet), intent(inout) :: local |
| 333 |
call atlas__functionspace__StructuredColumns__scatter_fieldset(this%CPTR_PGIBUG_A,global%CPTR_PGIBUG_A,local%CPTR_PGIBUG_A) |
| 334 |
end subroutine |
| 335 |
|
| 336 |
function checksum_fieldset(this,fieldset) result(checksum) |
| 337 |
use, intrinsic :: iso_c_binding |
| 338 |
use atlas_functionspace_StructuredColumns_c_binding |
| 339 |
character(len=:), allocatable :: checksum |
| 340 |
class(atlas_functionspace_StructuredColumns), intent(in) :: this |
| 341 |
type(atlas_FieldSet), intent(in) :: fieldset |
| 342 |
type(c_ptr) :: checksum_cptr |
| 343 |
integer(ATLAS_KIND_IDX) :: checksum_size |
| 344 |
integer(c_int) :: checksum_allocated |
| 345 |
call atlas__fs__StructuredColumns__checksum_fieldset( & |
| 346 |
& this%CPTR_PGIBUG_A,fieldset%CPTR_PGIBUG_A,checksum_cptr,checksum_size,checksum_allocated) |
| 347 |
allocate(character(len=checksum_size) :: checksum ) |
| 348 |
checksum = c_ptr_to_string(checksum_cptr) |
| 349 |
if( checksum_allocated == 1 ) call c_ptr_free(checksum_cptr) |
| 350 |
end function |
| 351 |
|
| 352 |
|
| 353 |
function checksum_field(this,field) result(checksum) |
| 354 |
use, intrinsic :: iso_c_binding |
| 355 |
use atlas_functionspace_StructuredColumns_c_binding |
| 356 |
character(len=:), allocatable :: checksum |
| 357 |
class(atlas_functionspace_StructuredColumns), intent(in) :: this |
| 358 |
type(atlas_Field), intent(in) :: field |
| 359 |
type(c_ptr) :: checksum_cptr |
| 360 |
integer(ATLAS_KIND_IDX) :: checksum_size |
| 361 |
integer(c_int) :: checksum_allocated |
| 362 |
call atlas__fs__StructuredColumns__checksum_field( & |
| 363 |
& this%CPTR_PGIBUG_A,field%CPTR_PGIBUG_A,checksum_cptr,checksum_size,checksum_allocated) |
| 364 |
allocate(character(len=checksum_size) :: checksum ) |
| 365 |
checksum = c_ptr_to_string(checksum_cptr) |
| 366 |
if( checksum_allocated == 1 ) call c_ptr_free(checksum_cptr) |
| 367 |
end function |
| 368 |
|
| 369 |
subroutine set_index(this) |
| 370 |
use, intrinsic :: iso_c_binding, only : c_ptr, c_f_pointer |
| 371 |
use atlas_functionspace_StructuredColumns_c_binding |
| 372 |
class(atlas_functionspace_StructuredColumns), intent(inout) :: this |
| 373 |
type(c_ptr) :: index_cptr |
| 374 |
integer(ATLAS_KIND_IDX), pointer :: index_fptr(:) |
| 375 |
integer(ATLAS_KIND_IDX) :: i_min, i_max, j_min, j_max |
| 376 |
integer(ATLAS_KIND_IDX) :: ni, nj |
| 377 |
call atlas__fs__StructuredColumns__index_host( this%CPTR_PGIBUG_A, index_cptr, i_min, i_max, j_min, j_max ) |
| 378 |
ni = i_max-i_min+1; |
| 379 |
nj = j_max-j_min+1; |
| 380 |
call c_f_pointer( index_cptr, index_fptr, (/ni*nj/) ) |
| 381 |
this%index(i_min:i_max,j_min:j_max) => index_fptr(:) |
| 382 |
end subroutine |
| 383 |
|
| 384 |
function j_begin(this) result(j) |
| 385 |
use atlas_functionspace_StructuredColumns_c_binding |
| 386 |
integer(ATLAS_KIND_IDX) :: j |
| 387 |
class(atlas_functionspace_StructuredColumns), intent(in) :: this |
| 388 |
j = atlas__fs__StructuredColumns__j_begin(this%CPTR_PGIBUG_A) |
| 389 |
end function |
| 390 |
|
| 391 |
function j_end(this) result(j) |
| 392 |
use atlas_functionspace_StructuredColumns_c_binding |
| 393 |
integer(ATLAS_KIND_IDX) :: j |
| 394 |
class(atlas_functionspace_StructuredColumns), intent(in) :: this |
| 395 |
j = atlas__fs__StructuredColumns__j_end(this%CPTR_PGIBUG_A) |
| 396 |
end function |
| 397 |
|
| 398 |
function i_begin(this,j) result(i) |
| 399 |
use atlas_functionspace_StructuredColumns_c_binding |
| 400 |
integer(ATLAS_KIND_IDX) :: i |
| 401 |
integer(ATLAS_KIND_IDX), intent(in) :: j |
| 402 |
class(atlas_functionspace_StructuredColumns), intent(in) :: this |
| 403 |
i = atlas__fs__StructuredColumns__i_begin(this%CPTR_PGIBUG_A,j) |
| 404 |
end function |
| 405 |
|
| 406 |
function i_end(this,j) result(i) |
| 407 |
use atlas_functionspace_StructuredColumns_c_binding |
| 408 |
integer(ATLAS_KIND_IDX) :: i |
| 409 |
integer(ATLAS_KIND_IDX), intent(in) :: j |
| 410 |
class(atlas_functionspace_StructuredColumns), intent(in) :: this |
| 411 |
i = atlas__fs__StructuredColumns__i_end(this%CPTR_PGIBUG_A,j) |
| 412 |
end function |
| 413 |
|
| 414 |
|
| 415 |
function j_begin_halo(this) result(j) |
| 416 |
use atlas_functionspace_StructuredColumns_c_binding |
| 417 |
integer(ATLAS_KIND_IDX) :: j |
| 418 |
class(atlas_functionspace_StructuredColumns), intent(in) :: this |
| 419 |
j = atlas__fs__StructuredColumns__j_begin_halo(this%CPTR_PGIBUG_A) |
| 420 |
end function |
| 421 |
|
| 422 |
function j_end_halo(this) result(j) |
| 423 |
use atlas_functionspace_StructuredColumns_c_binding |
| 424 |
integer(ATLAS_KIND_IDX) :: j |
| 425 |
class(atlas_functionspace_StructuredColumns), intent(in) :: this |
| 426 |
j = atlas__fs__StructuredColumns__j_end_halo(this%CPTR_PGIBUG_A) |
| 427 |
end function |
| 428 |
|
| 429 |
function i_begin_halo(this,j) result(i) |
| 430 |
use atlas_functionspace_StructuredColumns_c_binding |
| 431 |
integer(ATLAS_KIND_IDX) :: i |
| 432 |
integer(ATLAS_KIND_IDX), intent(in) :: j |
| 433 |
class(atlas_functionspace_StructuredColumns), intent(in) :: this |
| 434 |
i = atlas__fs__StructuredColumns__i_begin_halo(this%CPTR_PGIBUG_A,j) |
| 435 |
end function |
| 436 |
|
| 437 |
function i_end_halo(this,j) result(i) |
| 438 |
use atlas_functionspace_StructuredColumns_c_binding |
| 439 |
integer(ATLAS_KIND_IDX) :: i |
| 440 |
integer(ATLAS_KIND_IDX), intent(in) :: j |
| 441 |
class(atlas_functionspace_StructuredColumns), intent(in) :: this |
| 442 |
i = atlas__fs__StructuredColumns__i_end_halo(this%CPTR_PGIBUG_A,j) |
| 443 |
end function |
| 444 |
|
| 445 |
function get_size(this) result(size) |
| 446 |
use atlas_functionspace_StructuredColumns_c_binding |
| 447 |
integer(ATLAS_KIND_IDX) :: size |
| 448 |
class(atlas_functionspace_StructuredColumns), intent(in) :: this |
| 449 |
size = atlas__fs__StructuredColumns__size(this%CPTR_PGIBUG_A) |
| 450 |
end function |
| 451 |
|
| 452 |
function get_size_owned(this) result(size) |
| 453 |
use atlas_functionspace_StructuredColumns_c_binding |
| 454 |
integer(ATLAS_KIND_IDX) :: size |
| 455 |
class(atlas_functionspace_StructuredColumns), intent(in) :: this |
| 456 |
size = atlas__fs__StructuredColumns__sizeOwned(this%CPTR_PGIBUG_A) |
| 457 |
end function |
| 458 |
|
| 459 |
function levels(this) |
| 460 |
use atlas_functionspace_StructuredColumns_c_binding |
| 461 |
integer(ATLAS_KIND_IDX) :: levels |
| 462 |
class(atlas_functionspace_StructuredColumns), intent(in) :: this |
| 463 |
levels = atlas__fs__StructuredColumns__levels(this%CPTR_PGIBUG_A) |
| 464 |
end function |
| 465 |
|
| 466 |
function xy(this) result(field) |
| 467 |
use atlas_functionspace_StructuredColumns_c_binding |
| 468 |
type(atlas_Field) :: field |
| 469 |
class(atlas_functionspace_StructuredColumns), intent(in) :: this |
| 470 |
field = atlas_Field( atlas__fs__StructuredColumns__xy(this%CPTR_PGIBUG_A) ) |
| 471 |
call field%return() |
| 472 |
end function |
| 473 |
|
| 474 |
function z(this) result(field) |
| 475 |
use atlas_functionspace_StructuredColumns_c_binding |
| 476 |
type(atlas_Field) :: field |
| 477 |
class(atlas_functionspace_StructuredColumns), intent(in) :: this |
| 478 |
field = atlas_Field( atlas__fs__StructuredColumns__z(this%CPTR_PGIBUG_A) ) |
| 479 |
call field%return() |
| 480 |
end function |
| 481 |
|
| 482 |
|
| 483 |
function partition(this) result(field) |
| 484 |
use atlas_functionspace_StructuredColumns_c_binding |
| 485 |
type(atlas_Field) :: field |
| 486 |
class(atlas_functionspace_StructuredColumns), intent(in) :: this |
| 487 |
field = atlas_Field( atlas__fs__StructuredColumns__partition(this%CPTR_PGIBUG_A) ) |
| 488 |
call field%return() |
| 489 |
end function |
| 490 |
|
| 491 |
function global_index(this) result(field) |
| 492 |
use atlas_functionspace_StructuredColumns_c_binding |
| 493 |
type(atlas_Field) :: field |
| 494 |
class(atlas_functionspace_StructuredColumns), intent(in) :: this |
| 495 |
field = atlas_Field( atlas__fs__StructuredColumns__global_index(this%CPTR_PGIBUG_A) ) |
| 496 |
call field%return() |
| 497 |
end function |
| 498 |
|
| 499 |
function index_i(this) result(field) |
| 500 |
use atlas_functionspace_StructuredColumns_c_binding |
| 501 |
type(atlas_Field) :: field |
| 502 |
class(atlas_functionspace_StructuredColumns), intent(in) :: this |
| 503 |
field = atlas_Field( atlas__fs__StructuredColumns__index_i(this%CPTR_PGIBUG_A) ) |
| 504 |
call field%return() |
| 505 |
end function |
| 506 |
|
| 507 |
function index_j(this) result(field) |
| 508 |
use atlas_functionspace_StructuredColumns_c_binding |
| 509 |
type(atlas_Field) :: field |
| 510 |
class(atlas_functionspace_StructuredColumns), intent(in) :: this |
| 511 |
field = atlas_Field( atlas__fs__StructuredColumns__index_j(this%CPTR_PGIBUG_A) ) |
| 512 |
call field%return() |
| 513 |
end function |
| 514 |
|
| 515 |
function grid(this) |
| 516 |
use atlas_functionspace_StructuredColumns_c_binding |
| 517 |
type(atlas_Grid) :: grid |
| 518 |
class(atlas_functionspace_StructuredColumns), intent(in) :: this |
| 519 |
grid = atlas_Grid( atlas__fs__StructuredColumns__grid(this%CPTR_PGIBUG_A) ) |
| 520 |
call grid%return() |
| 521 |
end function |
| 522 |
|
| 523 |
!------------------------------------------------------------------------------- |
| 524 |
|
| 525 |
#if FCKIT_FINAL_NOT_INHERITING |
| 526 |
ATLAS_FINAL subroutine StructuredColumns__final_auto(this) |
| 527 |
type(atlas_functionspace_StructuredColumns), intent(inout) :: this |
| 528 |
#if FCKIT_FINAL_DEBUGGING |
| 529 |
write(0,*) "atlas_functionspace_StructuredColumns__final_auto" |
| 530 |
#endif |
| 531 |
#if FCKIT_FINAL_NOT_PROPAGATING |
| 532 |
call this%final() |
| 533 |
#endif |
| 534 |
FCKIT_SUPPRESS_UNUSED( this ) |
| 535 |
end subroutine |
| 536 |
#endif |
| 537 |
|
| 538 |
end module atlas_functionspace_StructuredColumns_module |
| 539 |
|