Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
select_bbx.f90
Go to the documentation of this file.
1 ! *********************************************************************
2 ! * Rocstar Simulation Suite *
3 ! * Copyright@2015, Illinois Rocstar LLC. All rights reserved. *
4 ! * *
5 ! * Illinois Rocstar LLC *
6 ! * Champaign, IL *
7 ! * www.illinoisrocstar.com *
8 ! * sales@illinoisrocstar.com *
9 ! * *
10 ! * License: See LICENSE file in top level of distribution package or *
11 ! * http://opensource.org/licenses/NCSA *
12 ! *********************************************************************
13 ! *********************************************************************
14 ! * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, *
15 ! * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES *
16 ! * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND *
17 ! * NONINFRINGEMENT. IN NO EVENT SHALL THE CONTRIBUTORS OR *
18 ! * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
19 ! * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, *
20 ! * Arising FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE *
21 ! * USE OR OTHER DEALINGS WITH THE SOFTWARE. *
22 ! *********************************************************************
23  Program select_bbx
24 
25  implicit none
26 
27  INTEGER, PARAMETER :: double = selected_real_kind(p=14,r=30)
28  real(kind=double) :: xmin,xmax,ymin,ymax,zmin,zmax,eps=1.0e-06
29  real(kind=double) :: g_xmin,g_xmax,g_ymin,g_ymax,g_zmin,g_zmax
30  real(kind=double) :: xmn,xmx,ymn,ymx,zmn,zmx
31  integer :: idom,ios
32  character(len=6) :: string
33 
34 !
35 ! Select blocks that lie in a specified bounding box
36 !
37 ! Reads output from hdf2bbx_d
38 !
39  open(7,file='bbox',form='formatted',status='old',iostat=ios)
40  if (ios /= 0) then
41  write(*,*) 'I need file bbox from program hdf2bbx_d or reader'
42  stop
43  else
44  open(10,file='BBOX',form='formatted',status='old',iostat=ios)
45  read(10,*) string, g_xmin,g_xmax,g_ymin,g_ymax,g_zmin,g_zmax
46  write(*,*) 'Global BBX is ', &
47  g_xmin,g_xmax,g_ymin,g_ymax,g_zmin,g_zmax
48  endif
49 !
50 ! Read image bounding box
51 !
52  write(*,*) 'Enter Xmin, Xmax, Ymin, Ymax, Zmin, Zmax'
53  read (*,*) xmin, xmax, ymin, ymax, zmin, zmax
54 !
55 ! Read bounding box for each block, and write list of visible blocks
56 !
57  open(8,file='Bbox',form='formatted',status='unknown')
58  open(9,file='Ibox',form='formatted',status='unknown')
59 !
60  do
61  read(7,*,iostat=ios) idom,xmn,xmx,ymn,ymx,zmn,zmx
62  if (ios /= 0) exit
63 !
64 ! Eliminate blocks outside the image bounding box
65 !
66  if (xmn.gt.xmax-eps .or. ymn.gt.ymax-eps .or. zmn.gt.zmax-eps) cycle
67  if (xmx.lt.xmin+eps .or. ymx.lt.ymin+eps .or. zmx.lt.zmin+eps) cycle
68 !
69 ! This block is visible
70 !
71  write(8,10) idom
72  write(9,*) idom
73  10 format('block_',i4.4)
74 !
75  enddo
76 !
77  end program select_bbx
78 
79 
80 
81 
82 
83 
unsigned char r() const
Definition: Color.h:68
double ymin() const
double xmax() const
double xmin() const
int status() const
Obtain the status of the attribute.
Definition: Attribute.h:240
double zmin() const
**********************************************************************Rocstar Simulation Suite Illinois Rocstar LLC All rights reserved ****Illinois Rocstar LLC IL **www illinoisrocstar com **sales illinoisrocstar com WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **Arising OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE **********************************************************************INTERFACE SUBROUTINE form
double zmax() const
double ymax() const
static const char * string()
Definition: CImg.h:2085
program select_bbx
Definition: select_bbx.f90:23