Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
INRT_AllocateAuxillary.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: Allocates data structures for an individual interaction
26 !
27 ! Description: none.
28 !
29 ! Input: global = global data
30 ! inrt = interaction
31 ! nEdges = number of Edges in interaction
32 ! nSwitches = number of integer parameters for interaction
33 ! nData = number of real parameters for interaction
34 !
35 ! Output: sets value of inrt%nEdges,
36 ! allocates and initializes inrt%edges, inrt%switches, and inrt%data
37 !
38 ! Notes: none.
39 !
40 !******************************************************************************
41 !
42 ! $Id: INRT_AllocateAuxillary.F90,v 1.3 2008/12/06 08:44:31 mtcampbe Exp $
43 !
44 ! Copyright: (c) 2003 by the University of Illinois
45 !
46 !******************************************************************************
47 
48 SUBROUTINE inrt_allocateauxillary( global,inrt,nEdges,nSwitches,nData )
49 
50  USE moddatatypes
51  USE modglobal, ONLY : t_global
52  USE modinteract, ONLY : t_inrt_interact
53  USE moderror
55 
56  IMPLICIT NONE
57 
58 ! ... parameters
59  TYPE(t_global), POINTER :: global
60  TYPE(t_inrt_interact), POINTER :: inrt
61  INTEGER, INTENT(IN) :: nedges,nswitches,ndata
62 
63 ! ... loop variables
64  INTEGER :: iedge
65 
66 ! ... local variables
67  CHARACTER(CHRLEN) :: rcsidentstring
68  INTEGER :: errorflag
69 
70 !******************************************************************************
71 
72  rcsidentstring = &
73  '$RCSfile: INRT_AllocateAuxillary.F90,v $ $Revision: 1.3 $'
74 
75  CALL registerfunction( global,'INRT_AllocateAuxillary',&
76  'INRT_AllocateAuxillary.F90' )
77 
78 ! begin -----------------------------------------------------------------------
79 
80  inrt%nSwitches = nswitches
81  inrt%nData = ndata
82  inrt%nEdges = nedges
83 
84  IF (nswitches > 0) THEN
85 
86  ALLOCATE( inrt%switches(nswitches),stat=errorflag )
87  global%error = errorflag
88  IF (global%error /= 0) CALL errorstop( global,err_allocate,__line__ )
89  inrt%switches = -1
90 
91  END IF ! nSwitches
92 
93  IF (ndata > 0) THEN
94 
95  ALLOCATE( inrt%data(ndata),stat=errorflag )
96  global%error = errorflag
97  IF (global%error /= 0) CALL errorstop( global,err_allocate,__line__ )
98  inrt%data = -1._rfreal
99 
100  END IF ! nData
101 
102  IF (nedges > 0) THEN
103 
104  ALLOCATE( inrt%edges(nedges),stat=errorflag )
105  global%error = errorflag
106  IF (global%error /= 0) CALL errorstop( global,err_allocate,__line__ )
107 
108  DO iedge = 1,nedges
109  inrt%edges(iedge)%tEdge = inrt_edge_bad
110  inrt%edges(iedge)%iNode = -1
111  inrt%edges(iedge)%token = inrt_perm_pall
112  END DO ! iEdge
113 
114  END IF ! nEdges
115 
116 ! finalize --------------------------------------------------------------------
117 
118  CALL deregisterfunction( global )
119 
120 END SUBROUTINE inrt_allocateauxillary
121 
122 !******************************************************************************
123 !
124 ! RCS Revision history:
125 !
126 ! $Log: INRT_AllocateAuxillary.F90,v $
127 ! Revision 1.3 2008/12/06 08:44:31 mtcampbe
128 ! Updated license.
129 !
130 ! Revision 1.2 2008/11/19 22:17:44 mtcampbe
131 ! Added Illinois Open Source License/Copyright
132 !
133 ! Revision 1.1 2004/12/01 21:56:08 fnajjar
134 ! Initial revision after changing case
135 !
136 ! Revision 1.4 2003/04/03 21:10:17 jferry
137 ! implemented additional safety checks for rocinteract
138 !
139 ! Revision 1.3 2003/04/02 22:32:03 jferry
140 ! codified Activeness and Permission structures for rocinteract
141 !
142 ! Revision 1.2 2003/03/11 16:09:39 jferry
143 ! Added comments
144 !
145 ! Revision 1.1 2003/03/04 22:12:35 jferry
146 ! Initial import of Rocinteract
147 !
148 !******************************************************************************
149 
150 
151 
152 
153 
154 
155 
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
IndexType nedges() const
Definition: Mesh.H:564
subroutine inrt_allocateauxillary(global, inrt, nEdges, nSwitches, nData)
subroutine errorstop(global, errorCode, errorLine, addMessage)
Definition: ModError.F90:483
subroutine deregisterfunction(global)
Definition: ModError.F90:469