Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PLAG_INRT_DeallocMemTStep.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 
30 ! Input:
31 ! pRegion Region pointer
32 ! pPlag Pointer to particle data structure
33 !
34 ! Output: None.
35 !
36 ! Notes: none.
37 !
38 !******************************************************************************
39 !
40 ! $Id: PLAG_INRT_DeallocMemTStep.F90,v 1.4 2008/12/06 08:44:33 mtcampbe Exp $
41 !
42 ! Copyright: (c) 2004 by the University of Illinois
43 !
44 !******************************************************************************
45 
46 SUBROUTINE plag_inrt_deallocmemtstep( pRegion,pPlag )
47 
48  USE moddatatypes
49  USE moderror
50  USE modparameters
51  USE modglobal, ONLY: t_global
52  USE moddatastruct, ONLY: t_region
53  USE modpartlag, ONLY: t_plag
54  USE modmpi
55 
56  IMPLICIT NONE
57 
58 ! ******************************************************************************
59 ! Definitions and declarations
60 ! ******************************************************************************
61 
62 ! ==============================================================================
63 ! Arguments
64 ! ==============================================================================
65 
66  TYPE(t_region), POINTER :: pregion
67  TYPE(t_plag), POINTER :: pplag
68 
69 ! ==============================================================================
70 ! Locals
71 ! ==============================================================================
72 
73  CHARACTER(CHRLEN) :: rcsidentstring
74 
75  INTEGER :: maxdisedges,errorflag
76 
77  TYPE(t_global), POINTER :: global
78 
79 ! ******************************************************************************
80 ! Start
81 ! ******************************************************************************
82 
83  rcsidentstring = '$RCSfile: PLAG_INRT_DeallocMemTStep.F90,v $ $Revision: 1.4 $'
84 
85  global => pregion%global
86 
87  CALL registerfunction(global,'PLAG_INRT_DeallocMemTStep',&
88  'PLAG_INRT_DeallocMemTStep.F90')
89 
90 ! ******************************************************************************
91 ! Set variables
92 ! ******************************************************************************
93 
94  maxdisedges = pregion%inrtInput%maxDisEdges
95 
96 ! ******************************************************************************
97 ! Deallocate memory
98 ! ******************************************************************************
99 
100  IF (maxdisedges > 0) THEN
101  DEALLOCATE( pplag%inrtSources,stat=errorflag )
102  global%error = errorflag
103  IF (global%error /= err_none) THEN
104  CALL errorstop( global,err_deallocate,__line__,'pPlag%inrtSources')
105  END IF ! global%error
106 
107  ELSE
108  nullify( pplag%inrtSources )
109 
110  END IF ! maxDisEdges
111 
112 ! ******************************************************************************
113 ! End
114 ! ******************************************************************************
115 
116 ! finalize --------------------------------------------------------------------
117 
118  CALL deregisterfunction( global )
119 
120 END SUBROUTINE plag_inrt_deallocmemtstep
121 
122 !******************************************************************************
123 !
124 ! RCS Revision history:
125 !
126 ! $Log: PLAG_INRT_DeallocMemTStep.F90,v $
127 ! Revision 1.4 2008/12/06 08:44:33 mtcampbe
128 ! Updated license.
129 !
130 ! Revision 1.3 2008/11/19 22:17:46 mtcampbe
131 ! Added Illinois Open Source License/Copyright
132 !
133 ! Revision 1.2 2006/04/07 15:19:23 haselbac
134 ! Removed tabs
135 !
136 ! Revision 1.1 2004/07/26 19:01:20 fnajjar
137 ! Initial import
138 !
139 !******************************************************************************
140 
141 
142 
143 
144 
145 
146 
subroutine plag_inrt_deallocmemtstep(pRegion, pPlag)
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
subroutine errorstop(global, errorCode, errorLine, addMessage)
Definition: ModError.F90:483
subroutine deregisterfunction(global)
Definition: ModError.F90:469