Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ReadMultigridSection.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 !******************************************************************************
24 !
25 ! Purpose: read in user input related to multigrid and successive
26 ! grid refinement.
27 !
28 ! Description: none.
29 !
30 ! Input: user input file.
31 !
32 ! Output: global = start level, cycle type, iterations before refinement.
33 !
34 ! Notes: none.
35 !
36 !******************************************************************************
37 !
38 ! $Id: ReadMultigridSection.F90,v 1.4 2008/12/06 08:44:09 mtcampbe Exp $
39 !
40 ! Copyright: (c) 2001 by the University of Illinois
41 !
42 !******************************************************************************
43 
44 SUBROUTINE readmultigridsection( global )
45 
46  USE moddatatypes
47  USE modglobal, ONLY : t_global
48  USE modinterfaces, ONLY : readsection
49  USE moderror
50  USE modparameters
51  IMPLICIT NONE
52 
53 ! ... parameters
54  TYPE(t_global), POINTER :: global
55 
56 ! ... local variables
57  CHARACTER(10) :: keys(3)
58 
59  LOGICAL :: defined(3)
60 
61  REAL(RFREAL) :: vals(3)
62 
63 !******************************************************************************
64 
65  CALL registerfunction( global,'ReadMultigridSection',&
66  'ReadMultigridSection.F90' )
67 
68 ! specify keywords and search for them
69 
70  keys(1) = 'START'
71  keys(2) = 'CYCLE'
72  keys(3) = 'REFINE'
73 
74  CALL readsection( global,if_input,3,keys,vals,defined )
75 
76  IF (defined(1).eqv..true.) global%startLevel = max(1,int(abs(vals(1))))
77  IF (defined(2).eqv..true.) THEN
78  global%cycleType = mgcycle_no
79  IF (vals(2)>0.9 .AND. vals(2)<1.1) global%cycleType = mgcycle_v
80  IF (vals(2)>1.9 .AND. vals(2)<2.1) global%cycleType = mgcycle_w
81  ENDIF
82  IF (defined(3).eqv..true.) global%refineIter = int(abs(vals(3))+0.5_rfreal)
83 
84 ! finalize
85 
86  CALL deregisterfunction( global )
87 
88 END SUBROUTINE readmultigridsection
89 
90 !******************************************************************************
91 !
92 ! RCS Revision history:
93 !
94 ! $Log: ReadMultigridSection.F90,v $
95 ! Revision 1.4 2008/12/06 08:44:09 mtcampbe
96 ! Updated license.
97 !
98 ! Revision 1.3 2008/11/19 22:17:23 mtcampbe
99 ! Added Illinois Open Source License/Copyright
100 !
101 ! Revision 1.2 2008/10/23 18:20:55 mtcampbe
102 ! Crazy number of changes to track and fix initialization and
103 ! restart bugs. Many improperly formed logical expressions
104 ! were fixed, and bug in allocation for data associated with
105 ! the BC_INFLOWVELTEMP boundary condition squashed in
106 ! RFLO_ReadBcInflowVelSection.F90.
107 !
108 ! Revision 1.1 2004/12/01 16:50:33 haselbac
109 ! Initial revision after changing case
110 !
111 ! Revision 1.8 2003/11/20 16:40:35 mdbrandy
112 ! Backing out RocfluidMP changes from 11-17-03
113 !
114 ! Revision 1.5 2003/08/11 21:51:17 jblazek
115 ! Added basic global grid smoothing scheme.
116 !
117 ! Revision 1.4 2003/05/15 02:57:02 jblazek
118 ! Inlined index function.
119 !
120 ! Revision 1.3 2002/09/05 17:40:20 jblazek
121 ! Variable global moved into regions().
122 !
123 ! Revision 1.2 2002/01/11 17:18:31 jblazek
124 ! Updated description of I/O variables.
125 !
126 ! Revision 1.1 2002/01/02 16:00:03 jblazek
127 ! Added input for multigrid parameters.
128 !
129 !******************************************************************************
130 
131 
132 
133 
134 
135 
136 
subroutine readmultigridsection(global)
Vector_n max(const Array_n_const &v1, const Array_n_const &v2)
Definition: Vector_n.h:354
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
subroutine readsection(global, fileID, nvals, keys, vals, defined)
subroutine deregisterfunction(global)
Definition: ModError.F90:469