Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PLAG_INRT_AllocMemTStep.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: Allocate memory for Lagrangian particles sources
26 ! related to time stepping.
27 !
28 ! Description: none.
29 ! Input:
30 ! pRegion Region pointer
31 ! pPlag Pointer to particle data structure
32 !
33 ! Output: None.
34 !
35 ! Notes: none.
36 !
37 !******************************************************************************
38 !
39 ! $Id: PLAG_INRT_AllocMemTStep.F90,v 1.8 2008/12/06 08:44:33 mtcampbe Exp $
40 !
41 ! Copyright: (c) 2004 by the University of Illinois
42 !
43 !******************************************************************************
44 
45 SUBROUTINE plag_inrt_allocmemtstep( pRegion,pPlag )
46 
47  USE moddatatypes
48  USE moderror
49  USE modparameters
50  USE modglobal, ONLY: t_global
51  USE moddatastruct, ONLY: t_region
52  USE modpartlag, ONLY: t_plag
53  USE modmpi
54 
55  IMPLICIT NONE
56 
57 ! ******************************************************************************
58 ! Definitions and declarations
59 ! ******************************************************************************
60 
61 ! ==============================================================================
62 ! Arguments
63 ! ==============================================================================
64 
65  TYPE(t_region), POINTER :: pregion
66  TYPE(t_plag), POINTER :: pplag
67 
68 ! ==============================================================================
69 ! Locals
70 ! ==============================================================================
71 
72  CHARACTER(CHRLEN) :: rcsidentstring
73 
74  INTEGER :: ipcl,ivar,maxdisedges,npclsmax,errorflag
75 
76  TYPE(t_global), POINTER :: global
77 
78 ! ******************************************************************************
79 ! Start
80 ! ******************************************************************************
81 
82  rcsidentstring = '$RCSfile: PLAG_INRT_AllocMemTStep.F90,v $ $Revision: 1.8 $'
83 
84  global => pregion%global
85 
86  CALL registerfunction(global,'PLAG_INRT_AllocMemTStep',&
87  'PLAG_INRT_AllocMemTStep.F90')
88 
89 ! ******************************************************************************
90 ! Set pointers and variables
91 ! ******************************************************************************
92 
93  npclsmax = pregion%plag%nPclsMax
94  maxdisedges = pregion%inrtInput%maxDisEdges
95 
96 ! ******************************************************************************
97 ! Allocate memory
98 ! ******************************************************************************
99 
100  IF (maxdisedges > 0) THEN
101  ALLOCATE( pplag%inrtSources(maxdisedges,npclsmax),stat=errorflag )
102  global%error = errorflag
103  IF (global%error /= err_none) THEN
104  CALL errorstop( global,err_allocate,__line__,'pPlag%inrtSources')
105  END IF ! global%error
106 
107  ELSE
108  nullify( pplag%inrtSources )
109 
110  END IF ! maxDisEdges
111 
112 ! ******************************************************************************
113 ! Initialize memory
114 ! ******************************************************************************
115 
116  DO ipcl = 1,npclsmax
117  DO ivar = 1, maxdisedges
118  pplag%inrtSources(ivar,ipcl) = 0.0_rfreal
119  END DO ! iVar
120  END DO ! iPcl
121 
122 ! ******************************************************************************
123 ! End
124 ! ******************************************************************************
125 
126 ! finalize --------------------------------------------------------------------
127 
128  CALL deregisterfunction( global )
129 
130 END SUBROUTINE plag_inrt_allocmemtstep
131 
132 !******************************************************************************
133 !
134 ! RCS Revision history:
135 !
136 ! $Log: PLAG_INRT_AllocMemTStep.F90,v $
137 ! Revision 1.8 2008/12/06 08:44:33 mtcampbe
138 ! Updated license.
139 !
140 ! Revision 1.7 2008/11/19 22:17:46 mtcampbe
141 ! Added Illinois Open Source License/Copyright
142 !
143 ! Revision 1.6 2007/03/06 23:13:13 fnajjar
144 ! Renamed nPclsTot to nPclsMax
145 !
146 ! Revision 1.5 2006/04/07 15:19:23 haselbac
147 ! Removed tabs
148 !
149 ! Revision 1.4 2004/08/18 15:19:20 fnajjar
150 ! Bug fix for updated definition of nPclsTot
151 !
152 ! Revision 1.3 2004/07/26 18:47:05 fnajjar
153 ! Cleaned up header comments to properly reflect calling sequence
154 !
155 ! Revision 1.2 2004/07/26 18:43:16 fnajjar
156 ! Removed temporary debugging io
157 !
158 ! Revision 1.1 2004/07/26 17:06:54 fnajjar
159 ! initial import
160 !
161 !******************************************************************************
162 
163 
164 
165 
166 
167 
168 
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
subroutine plag_inrt_allocmemtstep(pRegion, pPlag)
subroutine errorstop(global, errorCode, errorLine, addMessage)
Definition: ModError.F90:483
subroutine deregisterfunction(global)
Definition: ModError.F90:469