OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
spmd_glob_minv.F File Reference
#include "implicit_f.inc"
#include "spmd.inc"
#include "com01_c.inc"
#include "com04_c.inc"
#include "task_c.inc"
#include "param_c.inc"

Go to the source code of this file.

Functions/Subroutines

subroutine spmd_glob_minv (t_monvol, dt2, itypts, nelts, volmon, fr_mv)

Function/Subroutine Documentation

◆ spmd_glob_minv()

subroutine spmd_glob_minv ( type(monvol_struct_), dimension(nvolu) t_monvol,
dt2,
integer itypts,
integer nelts,
volmon,
integer, dimension(nspmd+2,nvolu) fr_mv )

Definition at line 34 of file spmd_glob_minv.F.

35C-----------------------------------------------
36C I m p l i c i t T y p e s
37C-----------------------------------------------
38 USE spmd_comm_world_mod, ONLY : spmd_comm_world
40#include "implicit_f.inc"
41C-----------------------------------------------------------------
42C M e s s a g e P a s s i n g
43C-----------------------------------------------
44#include "spmd.inc"
45C-----------------------------------------------
46C C o m m o n B l o c k s
47C-----------------------------------------------
48#include "com01_c.inc"
49#include "com04_c.inc"
50#include "task_c.inc"
51#include "param_c.inc"
52C-----------------------------------------------
53C D u m m y A r g u m e n t s
54C-----------------------------------------------
55 TYPE(MONVOL_STRUCT_) :: T_MONVOL(NVOLU)
56 INTEGER ITYPTS, NELTS, FR_MV(NSPMD+2,NVOLU)
58 . dt2, volmon(*)
59C-----------------------------------------------
60C L o c a l V a r i a b l e s
61C-----------------------------------------------
62#ifdef MPI
63 INTEGER I, IERROR, LOC_PROC,
64 . K1, KK1,
65 . LEN, myop
67 . rbuf(3+nvolu*7), rrbuf(3+nvolu*7)
68 INTEGER :: MY_TYPE
69 INTEGER GLOB_MINV
70 EXTERNAL glob_minv
71C-----------------------------------------------
72C S o u r c e L i n e s
73C-----------------------------------------------
74C
75 loc_proc=ispmd+1
76C
77 rrbuf(1) = dt2
78 rrbuf(2) = itypts
79 rrbuf(3) = nelts
80 DO i = 1, nvolu*7
81 rrbuf(3+i) = zero
82 END DO
83 k1 = 1
84 kk1 = 0
85 DO i=1,nvolu
86 IF(fr_mv(nspmd+2,i)==ispmd+1) THEN
87 rrbuf(3+(i-1)*7+1)=volmon(kk1+1)
88 rrbuf(3+(i-1)*7+2)=volmon(kk1+2)
89 rrbuf(3+(i-1)*7+3)=volmon(kk1+5)
90 rrbuf(3+(i-1)*7+4)=volmon(kk1+12)
91 rrbuf(3+(i-1)*7+5)=volmon(kk1+16)
92 rrbuf(3+(i-1)*7+6)=volmon(kk1+18)
93 rrbuf(3+(i-1)*7+7)=volmon(kk1+21)
94 END IF
95 k1 = k1 + nimv
96 kk1 = kk1 + nrvolu
97 END DO
98
99 len = 3+nvolu*7
100
101 CALL mpi_type_contiguous(len,real,my_type,ierror)
102 CALL mpi_type_commit(my_type,ierror)
103 CALL mpi_op_create(glob_minv, .true., myop, ierror)
104
105 CALL mpi_allreduce(rrbuf, rbuf, 1, my_type, myop,
106 & spmd_comm_world, ierror)
107
108 CALL mpi_op_free(myop, ierror)
109 CALL mpi_type_free(my_type,ierror)
110
111 dt2 = rbuf(1)
112 itypts = rbuf(2)
113 nelts = rbuf(3)
114 k1 = 1
115 kk1 = 0
116 DO i=1,nvolu
117 volmon(kk1+1) =rbuf(3+(i-1)*7+1)
118 volmon(kk1+2) =rbuf(3+(i-1)*7+2)
119 volmon(kk1+5) =rbuf(3+(i-1)*7+3)
120 volmon(kk1+12)=rbuf(3+(i-1)*7+4) ! pressure
121 volmon(kk1+16)=rbuf(3+(i-1)*7+5) !Volume ?
122 volmon(kk1+18)=rbuf(3+(i-1)*7+6) ! area
123 volmon(kk1+21)=rbuf(3+(i-1)*7+7)
124 t_monvol(i)%pressure = volmon(kk1+12)
125 t_monvol(i)%temperature = volmon(kk1+13)
126 t_monvol(i)%area = volmon(kk1+18)
127! write(6,*) "Pressure ", I, " is ", T_MONVOL(I)%pressure
128! write(6,*) "Temperature ", I, " is ", T_MONVOL(I)%temperature
129! write(6,*) "Area ", I, " is ", T_MONVOL(I)%area
130! write(6,*) "Volume ", I, " is ", VOLMON(KK1+16),T_MONVOL(I)%volume
131 k1 = k1 + nimv
132 kk1 = kk1 + nrvolu
133 END DO
134C
135#endif
136 RETURN
#define my_real
Definition cppsort.cpp:32
subroutine glob_minv(rin, rinout, len, type)
Definition glob_minv.F:28
subroutine mpi_type_free(newtyp, ierr_mpi)
Definition mpi.f:399
subroutine mpi_type_contiguous(length, datatype, newtype, ierr_mpi)
Definition mpi.f:406
subroutine mpi_allreduce(sendbuf, recvbuf, cnt, datatype, operation, comm, ierr)
Definition mpi.f:103
subroutine mpi_type_commit(newtyp, ierr_mpi)
Definition mpi.f:393
subroutine mpi_op_create(func, commute, op, ierr)
Definition mpi.f:412
subroutine mpi_op_free(op, ierr)
Definition mpi.f:421