38 REAL(kind=wp) :: delt, t
39 REAL(kind=wp),
DIMENSION(1:global%NumNp) :: rext_in
44 INTEGER ::
i,
j,
k,
m,
n, p, counter, ii
45 INTEGER :: newnrows_ceff, newnstart_ceff, newndim
46 REAL(kind=wp) :: contol, beta
47 REAL(kind=wp),
DIMENSION(1:LNumNp) :: rint, rint2, rext_new, temp, reff
48 REAL(kind=wp),
ALLOCATABLE,
DIMENSION(:) :: newreff, newtemp
49 REAL(kind=wp),
ALLOCATABLE,
DIMENSION(:) :: bufsnd, ftemp
50 REAL(wp) :: per1, delay
60 IF ( global%debug_state )
THEN
68 DO i = 1, global%NumNp
70 IF ( nodeproc(
i) == myid )
THEN
72 k = local2global(
i) - nstart_ktc + 1
75 rext_new(
k ) = rext_in(
i )
78 temp(
k ) = global%Temperature(
i )
86 If (
ALLOCATED(r_old) .eqv. .false.)
then
87 ALLOCATE(rext_imp(lnumnp),r_old(lnumnp))
102 IF(
ALLOCATED(aval_ceff).EQV. .true.)
DEALLOCATE(aval_ceff)
103 IF(
ALLOCATED(cval_ceff).EQV. .true.)
DEALLOCATE(cval_ceff)
104 IF(
ALLOCATED(rp_ceff).EQV. .true.)
DEALLOCATE(rp_ceff)
105 IF(
ALLOCATED(ceff_fptp).EQV. .true.)
DEALLOCATE(ceff_fptp)
116 print*,
'FORMING EFFECTIVE CAPACITANCE MATRIX',myid
120 CALL
comp_row_add(gnumnp,gnumnp,nrows_ktc,nrows_ktc,nnz_kt,nnz_c,1, &
121 rp_kt,cval_kt,beta*aval_kt,1,rp_c,cval_c,(1/delt)*aval_c)
123 ALLOCATE(rp_ceff(nrows_ktc+1),cval_ceff(nnz_temp),aval_ceff(nnz_temp))
128 nstart_ceff = nstart_ktc
129 nrows_ceff = nrows_ktc
131 cval_ceff = cval_temp
132 aval_ceff = aval_temp
133 DEALLOCATE(rp_temp,cval_temp,aval_temp)
136 CALL
enforcethermalbc(global%NumNp,lnumnp,temp,node_flag,boundary_value,0,myid)
140 CALL
partition_ceff(gnumnp,nrows_ceff,nnz_ceff,nstart_ceff,rp_ceff,cval_ceff,aval_ceff, &
141 newnrows_ceff,newnstart_ceff,newndim,temp,global)
145 DEALLOCATE(rp_ceff,cval_ceff,aval_ceff)
149 nrows_ceff = newnrows_ceff
150 nstart_ceff = newnstart_ceff
153 ALLOCATE(rp_ceff(nrows_ceff+1),cval_ceff(nnz_temp),aval_ceff(nnz_temp))
156 cval_ceff = cval_temp
157 aval_ceff = aval_temp
158 DEALLOCATE(rp_temp,cval_temp,aval_temp)
160 CALL bs95setup(gnumnp,nnz_ceff,nstart_ceff-1,nrows_ceff,rp_ceff,cval_ceff,aval_ceff,1,bs95debug)
181 CALL
intload(gnumnp,nrows_ktc,nnz_kt,nstart_ktc,rp_kt,cval_kt,(-1.0*(1.0-beta)*aval_kt),temp,rint)
184 CALL
intload(gnumnp,nrows_ktc,nnz_kt,nstart_ktc,rp_c,cval_c,1/delt*aval_c,temp,rint2)
190 DO i = 1, global%NumNp
191 IF (local2global(
i) ==
m)
THEN
192 IF (nodeproc(
i) == myid)
THEN
193 counter = counter + 1
194 IF(node_flag(
i,1) == 7)
THEN
197 rext_imp(counter) = boundary_value(
i,1)
218 reff = rint + rint2 +(1.0 - beta) * r_old + beta * (rext_new + rext_imp)
222 r_old = (rext_new + rext_imp)
225 ALLOCATE(newreff(1:nrows_ceff))
226 ALLOCATE(newtemp(1:nrows_ceff))
234 newreff(:) = newreff(:) - ceff_fptp(:)
249 CALL bs95solve(nrows_ceff,newreff,newtemp,contol,bs95debug)
266 IF(myid==0)
print*,
'ASSEMBLING NEW TEMPERATURE VECTOR'
272 DO i = 1, global%NumNp
273 IF ( nodeproc(
i) == myid )
THEN
274 k = local2global(
i) - nstart_ktc + 1
275 global%Temperature(
i ) = temp(
k )
284 CALL mpi_barrier(rocstar_communicator,ierr)
285 ALLOCATE(req_rcv(1:nprocs))
286 ALLOCATE(req_snd(1:nprocs))
287 ALLOCATE(stat_snd(1:mpi_status_size,1:nprocs))
288 ALLOCATE(stat_rcv(1:mpi_status_size,1:nprocs))
292 DO j = 1, mpi_status_size
301 CALL mpi_barrier(rocstar_communicator,ierr)
302 ALLOCATE(frmproc(1:numcommprocsfrom2))
303 DO i = 1, numcommprocsfrom2
304 ALLOCATE(frmproc(
i)%rcvbuf(1:2*numcommnodesfrom2(
i)))
305 CALL mpi_irecv(frmproc(
i)%rcvbuf(1),2*numcommnodesfrom2(
i), &
306 mpi_double_precision,commprocsfrom2(
i),10,rocstar_communicator, &
313 DO i = 1, numcommprocs2
314 ALLOCATE(bufsnd(1:2*numcommnodes2(
i)))
316 DO j = 1, numcommnodes2(
i)
317 counter = counter + 1
318 bufsnd(counter) = 1.0 * commnodes2(
i,
j)
322 k = global2local(commnodes2(
i,
j))
323 counter = counter + 1
324 bufsnd(counter) = global%Temperature(
k )
326 CALL mpi_send(bufsnd(:),2*numcommnodes2(
i),mpi_double_precision, &
327 commprocs2(
i),10,rocstar_communicator,ierr)
330 CALL mpi_waitall(nprocs,req_rcv,stat_rcv,ierr)
340 DO i = 1, numcommprocsfrom2
344 DO j = 1, numcommnodesfrom2(
i)
345 counter = counter + 1
348 k = global2local( int( frmproc(
i)%rcvbuf(counter) ) )
349 counter = counter + 1
350 global%Temperature(
k ) = frmproc(
i)%rcvbuf(counter)
subroutine enforcethermalbc(NumNp, LocNumNp, Temp, node_flag, boundary_value, t, myid)
subroutine comp_row_add(ndim, gndim, nrows1, nrows2, nnz1, nnz2, nstart1, rp1, cval1, aval1, nstart2, rp2, cval2, aval2)
subroutine intload(ndim, nrows, nnz, nstart, rp, cval, aval, tempin, rint)
subroutine partition_ceff(ndim, nrows, nnz, nstart, rp1, cval, aval, newnrows, newnstart, newndim, ProcTemp, global)
subroutine removebcht_reff(nstart, ndim, pbar, newndim, newpbar)
subroutine removebcht_newtemp(nstart, ndim, a, newndim, newa)
subroutine thermal_soln(delt, t, rext_in, global, istep)