Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PEUL_InitGenxInterface.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: register turbulence variables with GenX.
26 !
27 ! Description: none.
28 !
29 ! Input: regions = patches and region (volume) variables
30 !
31 ! Output: to Roccom via RFLO_initGenxInterface.
32 !
33 ! Notes: none.
34 !
35 !******************************************************************************
36 !
37 ! $Id: PEUL_InitGenxInterface.F90,v 1.3 2008/12/06 08:44:00 mtcampbe Exp $
38 !
39 ! Copyright: (c) 2003 by the University of Illinois
40 !
41 !******************************************************************************
42 
43 SUBROUTINE peul_initgenxinterface( regions,wins,winv )
44 
45  USE moddatatypes
46  USE modglobal, ONLY : t_global
47 #ifdef RFLO
48  USE moddatastruct, ONLY : t_region
49 #endif
50  USE moderror
51  USE modparameters
52  IMPLICIT NONE
53  include 'roccomf90.h'
54 
55 ! ... parameters
56  CHARACTER(CHRLEN) :: wins, winv
57  TYPE(t_region), POINTER :: regions(:)
58 
59 ! ... loop variables
60  INTEGER :: ireg, ipt
61 
62 ! ... local variables
63  INTEGER, PARAMETER :: ascii_zero = 48 ! char representation of zero
64  INTEGER :: ilev, pid, errorflag, ilb, nptypes, nptypesmax
65 
66  TYPE(t_global), POINTER :: global
67 
68 !******************************************************************************
69 
70  global => regions(1)%global
71 
72  CALL registerfunction( global,'PEUL_InitGenxInterface',&
73  'PEUL_InitGenxInterface.F90' )
74 
75 ! input data (currently none) -------------------------------------------------
76 
77 ! output surface data (currently none)
78 
79 ! output volume (for visualization) and restart data
80 
81  nptypesmax = 0
82  IF ( global%peulUsed ) THEN
83  DO ireg=1,global%nRegions
84  nptypesmax = max(nptypesmax,regions(ireg)%peulInput%nPtypes)
85  ENDDO ! iReg
86  ENDIF ! peulUsed
87 
88  DO ipt=1,nptypesmax
89  CALL com_new_attribute( trim(winv)//'.peul'//char(ipt+ascii_zero),'e', &
90  com_double,1,'kg/(m^3)' )
91  ENDDO ! ipt
92 
93 ! store pointers to variables, loop over all regions --------------------------
94 
95  DO ireg=1,global%nRegions
96  IF (regions(ireg)%procid==global%myProcid .AND. & ! region active and
97  regions(ireg)%active==active .AND. & ! on my processor
98  global%peulUsed ) THEN ! and smoke used
99 
100  ilev = regions(ireg)%currLevel
101 
102 ! --- volume data
103 
104  pid = ireg*regoff
105 
106  ilb = lbound(regions(ireg)%levels(ilev)%peul%cv,2)
107 
108  nptypes = regions(ireg)%peulInput%nPtypes
109 
110  DO ipt=1,nptypes
111  CALL com_set_array( trim(winv)//'.peul'//char(ipt+ascii_zero), &
112  pid,regions(ireg)%levels(ilev)%peul%cv(ipt,ilb),nptypes)
113  ENDDO ! ipt
114 
115  ENDIF ! region on this processor and active
116  ENDDO ! iReg
117 
118 ! finalize --------------------------------------------------------------------
119 
120  CALL deregisterfunction( global )
121 
122 END SUBROUTINE peul_initgenxinterface
123 
124 !******************************************************************************
125 !
126 ! RCS Revision history:
127 !
128 ! $Log: PEUL_InitGenxInterface.F90,v $
129 ! Revision 1.3 2008/12/06 08:44:00 mtcampbe
130 ! Updated license.
131 !
132 ! Revision 1.2 2008/11/19 22:17:14 mtcampbe
133 ! Added Illinois Open Source License/Copyright
134 !
135 ! Revision 1.1 2004/12/01 21:23:43 haselbac
136 ! Initial revision after changing case
137 !
138 ! Revision 1.5 2004/06/30 04:05:23 wasistho
139 ! moved Genx related parameter REGOFF to ModParameters
140 !
141 ! Revision 1.4 2004/06/29 23:52:26 wasistho
142 ! migrated to Roccom-3
143 !
144 ! Revision 1.3 2004/03/05 22:08:58 jferry
145 ! created global variables for peul, plag, and inrt use
146 !
147 ! Revision 1.2 2004/01/21 16:34:45 fnajjar
148 ! Fixed semantics of ipt+'0' to bypass Frost compiler error
149 !
150 ! Revision 1.1 2003/11/21 22:21:23 fnajjar
151 ! Initial import of Rocsmoke GenX interfaces
152 !
153 !******************************************************************************
154 
155 
156 
157 
158 
159 
160 
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 peul_initgenxinterface(regions, wins, winv)
subroutine deregisterfunction(global)
Definition: ModError.F90:469