| 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_mesh_actions_module |
| 12 |
|
| 13 |
implicit none |
| 14 |
|
| 15 |
public :: atlas_build_parallel_fields |
| 16 |
public :: atlas_build_nodes_parallel_fields |
| 17 |
public :: atlas_build_edges_parallel_fields |
| 18 |
public :: atlas_build_periodic_boundaries |
| 19 |
public :: atlas_build_halo |
| 20 |
public :: atlas_build_edges |
| 21 |
public :: atlas_build_pole_edges |
| 22 |
public :: atlas_build_node_to_cell_connectivity |
| 23 |
public :: atlas_build_node_to_edge_connectivity |
| 24 |
public :: atlas_build_median_dual_mesh |
| 25 |
public :: atlas_write_load_balance_report |
| 26 |
|
| 27 |
! ============================================================================= |
| 28 |
CONTAINS |
| 29 |
! ============================================================================= |
| 30 |
|
| 31 |
subroutine atlas_build_parallel_fields(mesh) |
| 32 |
use atlas_BuildParallelFields_c_binding |
| 33 |
use atlas_Mesh_module, only: atlas_Mesh |
| 34 |
type(atlas_Mesh), intent(inout) :: mesh |
| 35 |
call atlas__build_parallel_fields(mesh%CPTR_PGIBUG_A) |
| 36 |
end subroutine atlas_build_parallel_fields |
| 37 |
|
| 38 |
subroutine atlas_build_nodes_parallel_fields(nodes) |
| 39 |
use atlas_BuildParallelFields_c_binding |
| 40 |
use atlas_mesh_Nodes_module, only: atlas_mesh_Nodes |
| 41 |
type(atlas_mesh_Nodes), intent(inout) :: nodes |
| 42 |
call atlas__build_nodes_parallel_fields(nodes%CPTR_PGIBUG_A) |
| 43 |
end subroutine atlas_build_nodes_parallel_fields |
| 44 |
|
| 45 |
subroutine atlas_renumber_nodes_glb_idx(nodes) |
| 46 |
use atlas_BuildParallelFields_c_binding |
| 47 |
use atlas_mesh_Nodes_module, only: atlas_mesh_Nodes |
| 48 |
type(atlas_mesh_Nodes), intent(inout) :: nodes |
| 49 |
call atlas__renumber_nodes_glb_idx(nodes%CPTR_PGIBUG_A) |
| 50 |
end subroutine atlas_renumber_nodes_glb_idx |
| 51 |
|
| 52 |
subroutine atlas_build_edges_parallel_fields(mesh) |
| 53 |
use atlas_BuildParallelFields_c_binding |
| 54 |
use atlas_Mesh_module, only: atlas_Mesh |
| 55 |
type(atlas_Mesh), intent(inout) :: mesh |
| 56 |
call atlas__build_edges_parallel_fields(mesh%CPTR_PGIBUG_A) |
| 57 |
end subroutine atlas_build_edges_parallel_fields |
| 58 |
|
| 59 |
subroutine atlas_build_periodic_boundaries(mesh) |
| 60 |
use atlas_BuildPeriodicBoundaries_c_binding |
| 61 |
use atlas_Mesh_module, only: atlas_Mesh |
| 62 |
type(atlas_Mesh), intent(inout) :: mesh |
| 63 |
call atlas__build_periodic_boundaries(mesh%CPTR_PGIBUG_A) |
| 64 |
end subroutine atlas_build_periodic_boundaries |
| 65 |
|
| 66 |
subroutine atlas_build_halo(mesh,nelems) |
| 67 |
use atlas_BuildHalo_c_binding |
| 68 |
use atlas_Mesh_module, only: atlas_Mesh |
| 69 |
type(atlas_Mesh), intent(inout) :: mesh |
| 70 |
integer, intent(in) :: nelems |
| 71 |
call atlas__build_halo(mesh%CPTR_PGIBUG_A,nelems) |
| 72 |
end subroutine atlas_build_halo |
| 73 |
|
| 74 |
subroutine atlas_build_edges(mesh) |
| 75 |
use atlas_BuildEdges_c_binding |
| 76 |
use atlas_Mesh_module, only: atlas_Mesh |
| 77 |
type(atlas_Mesh), intent(inout) :: mesh |
| 78 |
call atlas__build_edges(mesh%CPTR_PGIBUG_A) |
| 79 |
end subroutine atlas_build_edges |
| 80 |
|
| 81 |
subroutine atlas_build_pole_edges(mesh) |
| 82 |
use atlas_BuildEdges_c_binding |
| 83 |
use atlas_Mesh_module, only: atlas_Mesh |
| 84 |
type(atlas_Mesh), intent(inout) :: mesh |
| 85 |
call atlas__build_pole_edges(mesh%CPTR_PGIBUG_A) |
| 86 |
end subroutine atlas_build_pole_edges |
| 87 |
|
| 88 |
subroutine atlas_build_node_to_cell_connectivity(mesh) |
| 89 |
use atlas_BuildNode2CellConnectivity_c_binding |
| 90 |
use atlas_Mesh_module, only: atlas_Mesh |
| 91 |
type(atlas_Mesh), intent(inout) :: mesh |
| 92 |
call atlas__build_node_to_cell_connectivity(mesh%CPTR_PGIBUG_A) |
| 93 |
end subroutine atlas_build_node_to_cell_connectivity |
| 94 |
|
| 95 |
subroutine atlas_build_node_to_edge_connectivity(mesh) |
| 96 |
use atlas_BuildEdges_c_binding |
| 97 |
use atlas_Mesh_module, only: atlas_Mesh |
| 98 |
type(atlas_Mesh), intent(inout) :: mesh |
| 99 |
call atlas__build_node_to_edge_connectivity(mesh%CPTR_PGIBUG_A) |
| 100 |
end subroutine atlas_build_node_to_edge_connectivity |
| 101 |
|
| 102 |
subroutine atlas_build_median_dual_mesh(mesh) |
| 103 |
use atlas_BuildDualMesh_c_binding |
| 104 |
use atlas_Mesh_module, only: atlas_Mesh |
| 105 |
type(atlas_Mesh), intent(inout) :: mesh |
| 106 |
call atlas__build_median_dual_mesh(mesh%CPTR_PGIBUG_A) |
| 107 |
end subroutine atlas_build_median_dual_mesh |
| 108 |
|
| 109 |
subroutine atlas_build_centroid_dual_mesh(mesh) |
| 110 |
use atlas_BuildDualMesh_c_binding |
| 111 |
use atlas_Mesh_module, only: atlas_Mesh |
| 112 |
type(atlas_Mesh), intent(inout) :: mesh |
| 113 |
call atlas__build_centroid_dual_mesh(mesh%CPTR_PGIBUG_A) |
| 114 |
end subroutine atlas_build_centroid_dual_mesh |
| 115 |
|
| 116 |
subroutine atlas_write_load_balance_report(mesh,filename) |
| 117 |
use fckit_c_interop_module, only : c_str |
| 118 |
use atlas_WriteLoadBalanceReport_c_binding |
| 119 |
use atlas_Mesh_module, only: atlas_Mesh |
| 120 |
type(atlas_Mesh), intent(in) :: mesh |
| 121 |
character(len=*), intent(in) :: filename |
| 122 |
call atlas__write_load_balance_report(mesh%CPTR_PGIBUG_A,c_str(filename)) |
| 123 |
end subroutine atlas_write_load_balance_report |
| 124 |
|
| 125 |
! ----------------------------------------------------------------------------- |
| 126 |
|
| 127 |
end module atlas_mesh_actions_module |