WAVEWATCH III  beta 0.0.1
yownodepool.F90
Go to the documentation of this file.
1 !PDLIB Software License
2 !
3 !Software, as understood herein, shall be broadly interpreted as being inclusive of algorithms,
4 !source code, object code, data bases and related documentation, all of which shall be furnished
5 !free of charge to the Licensee. Corrections, upgrades or enhancements may be furnished and, if
6 !furnished, shall also be furnished to the Licensee without charge. NOAA, however, is not
7 !required to develop or furnish such corrections, upgrades or enhancements.
8 !Roland & Partner software, whether that initially furnished or corrections or upgrades,
9 !are furnished "as is". Roland & Partner furnishes its software without any warranty
10 !whatsoever and is not responsible for any direct, indirect or consequential damages
11 !that may be incurred by the Licensee. Warranties of merchantability, fitness for any
12 !particular purpose, title, and non-infringement, are specifically negated.
13 !The Licensee is not required to develop any software related to the licensed software.
14 !However, in the event that the Licensee does so, the Licensee is required to offer same
15 !to Roland & Partner for inclusion under the instant licensing terms with Roland & Partner
16 !licensed software along with documentation regarding its principles, use and its advantages.
17 !This includes changes to the wave model proper including numerical and physical approaches
18 !to wave modeling, and boundary layer parameterizations embedded in the wave model
19 !A Licensee may reproduce sufficient software to satisfy its needs.
20 !All copies shall bear the name of the software with any version number
21 !as well as replicas of any applied copyright notice, trademark notice,
22 !other notices and credit lines. Additionally, if the copies have been modified,
23 !e.g. with deletions or additions, this shall be so stated and identified.
24 !All of Licensee's employees who have a need to use the software may have access
25 !to the software but only after reading the instant license and stating, in writing,
26 !that they have read and understood the license and have agreed to its terms.
27 !Licensee is responsible for employing reasonable efforts to assure
28 !that only those of its employees that should have access to the software, in fact, have access.
29 !The Licensee may use the software for any purpose relating to sea state prediction.
30 !No disclosure of any portion of the software, whether by means of a media or verbally,
31 !may be made to any third party by the Licensee or the Licensee's employees
32 !The Licensee is responsible for compliance with any applicable export or
33 !import control laws of the United States, the European Union and Germany.
34 !
35 !© 2009 Roland&Partner, Georgenstr.32, 64297 Germany. All rights reserved.
36 !PDLIB is a trademark of Roland & Partner. No unauthorized use without permission.
37 !
40  use yowdatapool, only: rkind
41  implicit none
42  private
43  public :: finalizenodepool, nodes, ghosts
44 
45 
48  type, public :: t_node
49 
51  integer :: id = 0
52 
54  integer :: id_global = 0
55 
59  integer :: nconnnodes = 0
60 
63  integer :: domainid = 0
64 
65  contains
68  procedure :: insertconnnode
69 
72  procedure :: connnodes
73 
75  procedure :: isghost
76  end type t_node
77 
79  real(rkind), public, target, allocatable :: x(:), y(:), z(:)
80  real(rkind), public, target, allocatable :: pdlib_si(:), pdlib_tria(:), pdlib_tria03(:), pdlib_ien(:,:)
81  integer, public, target, allocatable :: pdlib_ccon(:), pdlib_ia(:), pdlib_ja(:)
82  integer, public, target, allocatable :: pdlib_ia_p(:), pdlib_ja_p(:), pdlib_ja_ie(:,:,:)
83  integer, public, target, allocatable :: pdlib_pos_cell(:), pdlib_ie_cell(:)
84  integer, public, target, allocatable :: pdlib_ie_cell2(:,:), pdlib_pos_cell2(:,:)
85  integer, public, target, allocatable :: pdlib_posi(:,:), pdlib_i_diag(:)
86  integer, public, target, allocatable :: listnp(:), listnpa(:), listiplg(:)
87 
89  integer, public :: np_global = 0
90  integer, public :: pdlib_nnz = 0
91 
93  integer, public :: np = 0
94 
96  integer, public :: ng = 0
97 
99  integer, public :: npa = 0
100 
103  type(t_node), public, allocatable, target :: nodes_global(:)
104 
106  integer, public :: maxconnnodes = 0
107 
112  integer, public, allocatable :: connnodes_data(:,:)
113 
116  integer, public, allocatable :: iplg(:)
117 
120  integer, public, allocatable :: ipgl(:)
121 
125  integer, public, allocatable :: ghostlg(:)
126 
129  integer, public, allocatable :: ghostgl(:)
130 
133  integer, public, allocatable :: np_perproc(:)
134 
138  integer, public, allocatable :: np_perprocsum(:)
139 
140 
141 contains
142 
146  function connnodes(this, i)
147  implicit none
148  class(t_node) :: this
149  integer, intent(in) :: i
150  type(t_node), pointer :: connnodes
151  connnodes => nodes_global(connnodes_data(this%id_global, i))
152  end function connnodes
153 
158  function nodes(id_local)
159  implicit none
160  integer, intent(in) :: id_local
161  type(t_node), pointer :: nodes
162  nodes => nodes_global(iplg(id_local))
163  end function nodes
164 
171  function ghosts(id)
172  implicit none
173  integer, intent(in) :: id
174  type(t_node), pointer :: ghosts
175  ghosts => nodes_global(ghostlg(id))
176  end function ghosts
177 
180  subroutine insertconnnode(this, ind)
181  implicit none
182  class(t_node) :: this
183  integer , intent(in), optional :: ind
184  integer :: i
185  type(t_node), pointer :: node
186 
187  ! if index is present, Check if the node has allreay be insert. Then insert it
188  ! if index is not present, just increas temporarily array lenght for later allocation
189  if(present(ind)) then
190  do i = 1, this%nConnNodes
191  node => this%connNodes(i)
192  if(node%id_global == ind) then
193  return
194  end if
195  end do
196 
197  this%nConnNodes = this%nConnNodes +1
198  ! connNode => this%connNodes(this%nConnNodes)
199  connnodes_data(this%id_global, this%nConnNodes) = ind
200  ! connNode = index
201  else
202  this%nConnNodes = this%nConnNodes +1
203  end if
204  end subroutine insertconnnode
205 
207  function isghost(this)
208  implicit none
209  class(t_node), intent(in) :: this
210  logical :: isghost
211 
212  if(this%id <= np) then
213  isghost = .false.
214  else
215  isghost = .true.
216  endif
217  end function isghost
218 
219  subroutine finalizenodepool()
220  implicit none
221 
222  if(allocated(x)) deallocate(x)
223  if(allocated(y)) deallocate(y)
224  if(allocated(z)) deallocate(z)
225  if(allocated(nodes_global)) deallocate(nodes_global)
226  if(allocated(connnodes_data)) deallocate(connnodes_data)
227  if(allocated(iplg)) deallocate(iplg)
228  if(allocated(ipgl)) deallocate(ipgl)
229  if(allocated(ghostlg)) deallocate(ghostlg)
230  if(allocated(ghostgl)) deallocate(ghostgl)
231  if(allocated(np_perproc)) deallocate(np_perproc)
232  if(allocated(np_perprocsum)) deallocate(np_perprocsum)
233  end subroutine finalizenodepool
234 end module yownodepool
yownodepool::ghostgl
integer, dimension(:), allocatable, public ghostgl
Ghost global to local mapping np_global long.
Definition: yownodepool.F90:129
yownodepool::pdlib_ia
integer, dimension(:), allocatable, target, public pdlib_ia
Definition: yownodepool.F90:81
yownodepool::pdlib_ie_cell
integer, dimension(:), allocatable, target, public pdlib_ie_cell
Definition: yownodepool.F90:83
yownodepool::maxconnnodes
integer, public maxconnnodes
max number of conntected nodes to a node
Definition: yownodepool.F90:106
yownodepool::pdlib_i_diag
integer, dimension(:), allocatable, target, public pdlib_i_diag
Definition: yownodepool.F90:85
yownodepool::iplg
integer, dimension(:), allocatable, public iplg
Node local to global mapping.
Definition: yownodepool.F90:116
yownodepool::npa
integer, public npa
number of ghost + resident nodes this partition holds
Definition: yownodepool.F90:99
yownodepool::connnodes_data
integer, dimension(:,:), allocatable, public connnodes_data
conntected Node Array.
Definition: yownodepool.F90:112
yownodepool::pdlib_ccon
integer, dimension(:), allocatable, target, public pdlib_ccon
Definition: yownodepool.F90:81
yowdatapool::rkind
integer, parameter rkind
double precision.
Definition: yowdatapool.F90:47
yownodepool::pdlib_ia_p
integer, dimension(:), allocatable, target, public pdlib_ia_p
Definition: yownodepool.F90:82
yownodepool::pdlib_si
real(rkind), dimension(:), allocatable, target, public pdlib_si
Definition: yownodepool.F90:80
yownodepool::np_global
integer, public np_global
number of nodes, global
Definition: yownodepool.F90:89
yownodepool::listiplg
integer, dimension(:), allocatable, target, public listiplg
Definition: yownodepool.F90:86
yownodepool::ipgl
integer, dimension(:), allocatable, public ipgl
Node global to local mapping np_global long.
Definition: yownodepool.F90:120
yownodepool::y
real(rkind), dimension(:), allocatable, target, public y
Definition: yownodepool.F90:79
yownodepool::pdlib_ja_ie
integer, dimension(:,:,:), allocatable, target, public pdlib_ja_ie
Definition: yownodepool.F90:82
yownodepool
Has data that belong to nodes.
Definition: yownodepool.F90:39
yownodepool::pdlib_ja_p
integer, dimension(:), allocatable, target, public pdlib_ja_p
Definition: yownodepool.F90:82
yownodepool::ghosts
type(t_node) function, pointer, public ghosts(id)
return pointer to the (global) (ghost) node Ghost nodes are nodes in the global node array,...
Definition: yownodepool.F90:172
yownodepool::x
real(rkind), dimension(:), allocatable, target, public x
coordinates of the local + ghost nodes.
Definition: yownodepool.F90:79
yownodepool::pdlib_ja
integer, dimension(:), allocatable, target, public pdlib_ja
Definition: yownodepool.F90:81
yownodepool::t_node
Holds the nodes data.
Definition: yownodepool.F90:48
yownodepool::pdlib_tria03
real(rkind), dimension(:), allocatable, target, public pdlib_tria03
Definition: yownodepool.F90:80
yownodepool::listnpa
integer, dimension(:), allocatable, target, public listnpa
Definition: yownodepool.F90:86
yownodepool::pdlib_pos_cell
integer, dimension(:), allocatable, target, public pdlib_pos_cell
Definition: yownodepool.F90:83
yownodepool::ghostlg
integer, dimension(:), allocatable, public ghostlg
Ghost local to global mapping ng long.
Definition: yownodepool.F90:125
yownodepool::listnp
integer, dimension(:), allocatable, target, public listnp
Definition: yownodepool.F90:86
yownodepool::np
integer, public np
number of nodes, local
Definition: yownodepool.F90:93
yowdatapool
Has fancy data.
Definition: yowdatapool.F90:39
yownodepool::z
real(rkind), dimension(:), allocatable, target, public z
Definition: yownodepool.F90:79
yownodepool::pdlib_tria
real(rkind), dimension(:), allocatable, target, public pdlib_tria
Definition: yownodepool.F90:80
yownodepool::pdlib_posi
integer, dimension(:,:), allocatable, target, public pdlib_posi
Definition: yownodepool.F90:85
yownodepool::np_perproc
integer, dimension(:), allocatable, public np_perproc
Numbers of Nodes pro Processor.
Definition: yownodepool.F90:133
yownodepool::nodes_global
type(t_node), dimension(:), allocatable, target, public nodes_global
all nodes with their data.
Definition: yownodepool.F90:103
yownodepool::pdlib_ien
real(rkind), dimension(:,:), allocatable, target, public pdlib_ien
Definition: yownodepool.F90:80
yownodepool::pdlib_ie_cell2
integer, dimension(:,:), allocatable, target, public pdlib_ie_cell2
Definition: yownodepool.F90:84
yownodepool::pdlib_pos_cell2
integer, dimension(:,:), allocatable, target, public pdlib_pos_cell2
Definition: yownodepool.F90:84
yownodepool::nodes
type(t_node) function, pointer, public nodes(id_local)
return pointer to the (global) node from the local id.
Definition: yownodepool.F90:159
yownodepool::finalizenodepool
subroutine, public finalizenodepool()
Definition: yownodepool.F90:220
yownodepool::np_perprocsum
integer, dimension(:), allocatable, public np_perprocsum
Number of Nodes pro Processor totalize.
Definition: yownodepool.F90:138
yownodepool::pdlib_nnz
integer, public pdlib_nnz
Definition: yownodepool.F90:90
yownodepool::ng
integer, public ng
number of ghost nodes this partition holds
Definition: yownodepool.F90:96