62 TYPE(t_region
),
POINTER :: regions(:)
68 INTEGER,
PARAMETER :: n_rvar = 1
69 INTEGER,
PARAMETER :: n_ivar_extra = 1
70 INTEGER,
PARAMETER :: randstate_offset = n_ivar_extra+1
71 INTEGER,
PARAMETER :: n_randstate = rand_total_size+n_ivar_extra
73 CHARACTER(2*CHRLEN+18) :: fname, fhead
74 CHARACTER(CHRLEN) :: rcsidentstring,
msg
77 INTEGER ::
status(mpi_status_size)
79 INTEGER :: errorflag, randstate(n_randstate,1)
81 REAL(RFREAL) :: rvar(n_rvar,1)
87 global => regions(1)%global
90 'RFLO_WriteRandomState.F90' )
96 IF (global%myProcid == masterproc)
THEN
98 fhead = trim(global%inDir)//trim(global%casename)
100 SELECT CASE(global%solutFormat)
102 fhead = trim(fhead)//
'.randa_'
104 fhead = trim(fhead)//
'.randb_'
106 CALL
errorstop( global,err_unknown_format,&
110 IF (global%flowType == flow_unsteady)
THEN
111 WRITE(fname,
'(A,ES11.5)') trim(fhead), global%currentTime
112 rvar(1,1) = global%currentTime
114 WRITE(fname,
'(A,I6.6)') trim(fhead), global%currentIter
115 rvar(1,1) = 0._rfreal
118 SELECT CASE(global%solutFormat)
120 OPEN(if_rand_state,file=fname,
form=
'formatted',
status=
'unknown', &
123 OPEN(if_rand_state,file=fname,
form=
'unformatted',
status=
'unknown', &
126 CALL
errorstop( global,err_unknown_format,&
130 global%error = errorflag
131 IF (global%error /= 0) &
133 __line__,
'File: '//trim(fname) )
144 DO ireg=1,global%nRegions
148 IF (regions(ireg)%procid == global%myProcid)
THEN
149 randstate(1,1) = ireg
150 DO i=0,rand_total_size-1
151 randstate(
i+randstate_offset,1) = regions(ireg)%randData%mt(
i)
157 IF (global%myProcid == masterproc)
THEN
160 IF (regions(ireg)%procid /= masterproc)
THEN
162 CALL mpi_recv( randstate,n_randstate,mpi_integer, &
163 regions(ireg)%procid,ireg, &
164 global%mpiComm,
status,global%mpierr )
165 IF (global%mpierr /=0) CALL
errorstop(global,err_mpi_trouble,&
172 n_randstate,1,randstate )
177 IF (regions(ireg)%procid == global%myProcid)
THEN
179 CALL mpi_send( randstate,n_randstate,mpi_integer,masterproc,ireg, &
180 global%mpiComm,global%mpierr )
181 IF (global%mpierr /=0) CALL
errorstop(global,err_mpi_trouble,&
193 IF (global%myProcid == masterproc)
THEN
194 CLOSE(if_rand_state,iostat=errorflag)
195 global%error = errorflag
196 IF (global%error /= 0) &
198 __line__,
'File: '//trim(fname) )
subroutine rflo_writerandomstate(regions)
subroutine rflo_writedatafileint(global, fileId, form, nDim1, nDim2, ivar)
subroutine registerfunction(global, funName, fileName)
int status() const
Obtain the status of the attribute.
**********************************************************************Rocstar Simulation Suite Illinois Rocstar LLC All rights reserved ****Illinois Rocstar LLC IL **www illinoisrocstar com **sales illinoisrocstar com WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **Arising OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE **********************************************************************INTERFACE SUBROUTINE form
subroutine errorstop(global, errorCode, errorLine, addMessage)
subroutine rflo_writedatafilereal(global, fileId, form, nDim1, nDim2, var)
subroutine deregisterfunction(global)