Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RandInitGenxInterface.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 portable random number variables with GenX.
26 !
27 ! Description: none.
28 !
29 ! Input: regions = patches and region (volume) variables
30 !
31 ! Output: to Roccom via randInitGenxInterface.
32 !
33 ! Notes: none.
34 !
35 !******************************************************************************
36 !
37 ! $Id: RandInitGenxInterface.F90,v 1.3 2008/12/06 08:44:01 mtcampbe Exp $
38 !
39 ! Copyright: (c) 2003 by the University of Illinois
40 !
41 !******************************************************************************
42 
43 SUBROUTINE randinitgenxinterface( 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  USE modrandom
53  IMPLICIT NONE
54  include 'roccomf90.h'
55 
56 ! ... parameters
57  CHARACTER(CHRLEN) :: wins, winv
58  TYPE(t_region), POINTER :: regions(:)
59 
60 ! ... loop variables
61  INTEGER :: ireg
62 
63 ! ... local variables
64  INTEGER :: pid
65  TYPE(t_global), POINTER :: global
66 
67 !******************************************************************************
68 
69  global => regions(1)%global
70 
71  CALL registerfunction( global,'randInitGenxInterface',&
72  'RandInitGenxInterface.F90' )
73 
74 ! input data (currently none) -------------------------------------------------
75 
76 ! output surface data (currently none) ----------------------------------------
77 
78 ! output restart data ---------------------------------------------------------
79 
80  CALL com_new_attribute( trim(winv)//'.rand', 'p', &
81  com_integer,1, '')
82  CALL com_set_size( trim(winv)//'.rand', 0, rand_total_size)
83 
84 ! store pointers to variables, loop over all regions --------------------------
85 
86  DO ireg=1,global%nRegions
87  IF (regions(ireg)%procid==global%myProcid .AND. & ! region active and
88  regions(ireg)%active==active ) THEN ! on my processor
89 
90 ! --- volume data -------------------------------------------------------------
91 
92  pid = ireg*regoff
93  CALL com_set_array( trim(winv)//'.rand',pid,regions(ireg)%randData%mt(0))
94 
95  ENDIF ! region on this processor and active
96  ENDDO ! iReg
97 
98 ! finalize --------------------------------------------------------------------
99 
100  CALL deregisterfunction( global )
101 
102 END SUBROUTINE randinitgenxinterface
103 
104 !******************************************************************************
105 !
106 ! RCS Revision history:
107 !
108 ! $Log: RandInitGenxInterface.F90,v $
109 ! Revision 1.3 2008/12/06 08:44:01 mtcampbe
110 ! Updated license.
111 !
112 ! Revision 1.2 2008/11/19 22:17:15 mtcampbe
113 ! Added Illinois Open Source License/Copyright
114 !
115 ! Revision 1.1 2004/12/01 21:23:47 haselbac
116 ! Initial revision after changing case
117 !
118 ! Revision 1.5 2004/06/30 04:07:48 wasistho
119 ! moved Genx related parameter REGOFF to ModParameters
120 !
121 ! Revision 1.4 2004/06/29 23:53:25 wasistho
122 ! migrated to Roccom-3
123 !
124 ! Revision 1.3 2004/03/01 23:47:35 jiao
125 ! Changed the F90 implementation for COM_init_attribute and COM_init_mesh
126 ! not to require registered scalars to be F90 pointers.
127 !
128 ! Revision 1.2 2004/02/20 00:49:04 jiao
129 ! Changed to use COM_INIT_ATTRIBUTE_SPECIAL in order to compile with older IBM compilers.
130 !
131 ! Revision 1.1 2003/11/21 22:20:04 fnajjar
132 ! Initial import
133 !
134 !******************************************************************************
135 
136 
137 
138 
139 
140 
141 
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
subroutine randinitgenxinterface(regions, wins, winv)
subroutine deregisterfunction(global)
Definition: ModError.F90:469