2D AMRCLAW
Functions/Subroutines
moment.f File Reference

Go to the source code of this file.

Functions/Subroutines

subroutine moment (intrect, badpts, npt, usage)
 Compute enclosing rectangle around flagged points. More...
 

Function/Subroutine Documentation

◆ moment()

subroutine moment ( dimension(nsize)  intrect,
dimension(2,npt)  badpts,
  npt,
save  usage 
)

Compute enclosing rectangle around flagged points.

save some info., even tho. usage might be low and rect. scrapped.

Parameters
[in]badptsx,y coords of cells around which a rectangle is to be made and compute efficiency on
[in]nptnum. of badpts. in the cluster.
[out]usageratio of flagged to unflagged badpts. in new grid measures goodness of fit and clustering
[out]intrectstores some info. for grid created herein. sometimes rect = rnode, sometimes = temp. array. sometimes intrect = node. depending on calling prog. (grdfit or expand)

Definition at line 17 of file moment.f.

References grdfit(), amr_module::ndihi, amr_module::ndilo, amr_module::ndjhi, amr_module::ndjlo, amr_module::node, amr_module::nsize, and amr_module::rnode.

Referenced by grdfit(), and smartbis().

17 c
18  use amr_module
19  implicit double precision (a-h,o-z)
20 
21 
22  dimension intrect(nsize),badpts(2,npt)
23 c
24 c :::::::::::::::::::::::: MOMENT ::::::::::::::::::::::::::::::::::
25 c moment = compute enclosing rectangle around flagged points.
26 c save some info., even tho. usage might be low and rect. scrapped.
27 
28 c input parameters:
29 c badpts = x,y coords of flagged badpts grouped into clusters
30 c are in the first two rows
31 c npt = num. of badpts. in the cluster.
32 c
33 c output parameters:
34 c usage = ratio of flagged to unflagged badpts. in new grid
35 c measures goodness of fit and clustering
36 c intrect( ) = stores some info. for grid created herein.
37 c sometimes rect = rnode, sometimes = temp. array.
38 c sometimes intrect = node.
39 c depending on calling prog. (grdfit or expand)
40 c
41 c
42 c :::::::::::::::::::::::: MOMENT ::::::::::::::::::::::::::::::::::
43 c
44  rn = dble(npt)
45 c
46 c compute length of enclosing rectangles to include all flagged badpts.
47 c
48  emx1 = badpts(1,1)
49  emn1 = emx1
50  emx2 = badpts(2,1)
51  emn2 = emx2
52  do 80 ipt = 1, npt
53  if (badpts(1,ipt) .gt. emx1) emx1 = badpts(1,ipt)
54  if (badpts(1,ipt) .lt. emn1) emn1 = badpts(1,ipt)
55  if (badpts(2,ipt) .gt. emx2) emx2 = badpts(2,ipt)
56  if (badpts(2,ipt) .lt. emn2) emn2 = badpts(2,ipt)
57  80 continue
58 c
59 c from length of the sides determine rect. corners.
60 c transform to cell numbers (subtract .5)
61 c
62  intrect(ndilo) = nint(emn1 - .5)
63  intrect(ndjlo) = nint(emn2 - .5)
64  intrect(ndihi) = nint(emx1 - .5)
65  intrect(ndjhi) = nint(emx2 - .5)
66 c
67 c compute usage
68 c
69  iside1 = intrect(ndihi) - intrect(ndilo) + 1
70  iside2 = intrect(ndjhi) - intrect(ndjlo) + 1
71  gpall = iside1 * iside2
72  usage = rn / gpall
73 c
74  return
integer, parameter ndihi
global i index of right border of this grid
Definition: amr_module.f90:111
integer, parameter nsize
Definition: amr_module.f90:31
integer, parameter ndilo
global i index of left border of this grid
Definition: amr_module.f90:108
integer, parameter ndjlo
global j index of lower border of this grid
Definition: amr_module.f90:114
integer, parameter ndjhi
global j index of upper border of this grid
Definition: amr_module.f90:117
The module contains the definition of a "node descriptor" as well as other global variables used duri...
Definition: amr_module.f90:21
Here is the call graph for this function:
Here is the caller graph for this function: