54 ne_loc, cs_nnz_loc, cs_loc, &
55 node_nhe_flag, count, NN_src_ind_loc, QS, QP, &
56 lambda_nhe, mu_nhe, rho_nhe, &
57 Qs_nhe_el, Qp_nhe_el, mpi_id, mpi_comm)
65 integer*4 :: nn_loc, mpi_id, nmat, count, mpi_comm, mpi_ierr
66 integer*4,
dimension(nmat) :: sdeg_mat
67 integer*4,
dimension(nn_loc) :: node_nhe_flag
68 integer*4,
dimension(count) :: NN_src_ind_loc
70 real*8,
dimension(nmat) :: qs, qp
71 real*8,
dimension(nn_loc),
intent(inout) :: lambda_nhe, mu_nhe, rho_nhe
72 real*4,
dimension(nn_loc) :: qs_nhe, qp_nhe
74 integer*4 :: ne_loc, cs_nnz_loc
75 integer*4,
dimension(0:cs_nnz_loc) :: cs_loc
76 real*4,
dimension(ne_loc) :: qs_nhe_el, qp_nhe_el
78 character*70 :: file_tomo
79 integer*4 :: npts_tomo, stat, error
80 real*4,
dimension(:),
allocatable :: tomo_rho, tomo_vs, tomo_vp, tomo_qs, tomo_qp
81 real*8,
dimension(nmat,4) :: prop_mat
83 real*8 :: t0, t1, time_elapsed, dummy, vs_dum, vp_dum
84 integer*4 :: i, j, ipt, inode, ie
85 integer*4 :: im, istart, iend, nn
87 rho_nhe = 0.d0; mu_nhe = 0.d0; lambda_nhe = 0.d0;
88 qs_nhe_el = 0.d0; qp_nhe_el = 0.d0;
89 qs_nhe = 0.d0; qp_nhe = 0.d0;
98 file_tomo =
'tomo_xyz_mech.in'
100 if(mpi_id .eq.0)
then
101 open(124,file=file_tomo)
103 read(124,*) npts_tomo
105 call mpi_bcast(npts_tomo,1,speed_integer,0,mpi_comm,mpi_ierr)
108 allocate(tomo_rho(npts_tomo),tomo_vs(npts_tomo),tomo_vp(npts_tomo),tomo_qs(npts_tomo),tomo_qp(npts_tomo))
109 do ipt = 1, npts_tomo
110 read(124,*)dummy, dummy, dummy, tomo_rho(ipt), tomo_vs(ipt), tomo_vp(ipt), tomo_qs(ipt), tomo_qp(ipt)
121 if (mpi_id.ne.0)
then
122 allocate(tomo_rho(npts_tomo))
125 call mpi_barrier(mpi_comm, mpi_ierr)
126 call mpi_bcast(tomo_rho, npts_tomo, speed_integer, 0, mpi_comm, mpi_ierr)
130 if ((node_nhe_flag(inode).eq.999))
then
132 rho_nhe(inode) = tomo_rho(nn_src_ind_loc(i))
134 rho_nhe(inode) = prop_mat(node_nhe_flag(inode),1)
141 if (mpi_id.ne.0)
then
142 allocate(tomo_vs(npts_tomo))
145 call mpi_barrier(mpi_comm, mpi_ierr)
146 call mpi_bcast(tomo_vs, npts_tomo, speed_integer, 0, mpi_comm, mpi_ierr)
150 if ((node_nhe_flag(inode).eq.999))
then
152 vs_dum = tomo_vs(nn_src_ind_loc(i))
153 mu_nhe(inode) = rho_nhe(inode) * vs_dum**2
155 mu_nhe(inode) = prop_mat(node_nhe_flag(inode),3)
161 if (mpi_id.ne.0)
then
162 allocate(tomo_vp(npts_tomo))
165 call mpi_barrier(mpi_comm, mpi_ierr)
166 call mpi_bcast(tomo_vp, npts_tomo, speed_integer, 0, mpi_comm, mpi_ierr)
170 if ((node_nhe_flag(inode).eq.999))
then
172 vp_dum = tomo_vp(nn_src_ind_loc(i))
173 vs_dum = mu_nhe(inode)/rho_nhe(inode)
174 lambda_nhe(inode) = rho_nhe(inode) * (vp_dum**2 - 2*vs_dum)
176 lambda_nhe(inode) = prop_mat(node_nhe_flag(inode),2)
183 if (mpi_id.ne.0)
then
184 allocate(tomo_qs(npts_tomo))
187 call mpi_barrier(mpi_comm, mpi_ierr)
188 call mpi_bcast(tomo_qs, npts_tomo, speed_integer, 0, mpi_comm, mpi_ierr)
192 if ((node_nhe_flag(inode).eq.999))
then
194 qs_nhe(inode) = tomo_qs(nn_src_ind_loc(i))
196 qs_nhe(inode) = qs(node_nhe_flag(inode))
202 if (mpi_id.ne.0)
then
203 allocate(tomo_qp(npts_tomo))
206 call mpi_barrier(mpi_comm, mpi_ierr)
207 call mpi_bcast(tomo_qp, npts_tomo, speed_integer, 0, mpi_comm, mpi_ierr)
211 if ((node_nhe_flag(inode).eq.999))
then
213 qp_nhe(inode) = tomo_qp(nn_src_ind_loc(i))
215 qp_nhe(inode) = qp(node_nhe_flag(inode))
220 call mpi_barrier(mpi_comm, mpi_ierr)
229 im = cs_loc(cs_loc(ie -1))
230 nn = sdeg_mat(im) + 1
231 istart = cs_loc(ie-1) + 1
232 iend = cs_loc(ie) - 1
235 qs_nhe_el(ie) = qs_nhe_el(ie) + qs_nhe(cs_loc(j))
236 qp_nhe_el(ie) = qp_nhe_el(ie) + qp_nhe(cs_loc(j))
238 qs_nhe_el(ie) = qs_nhe_el(ie)/(nn**3)
239 qp_nhe_el(ie) = qp_nhe_el(ie)/(nn**3)
subroutine make_nh_enhanced_assign_prop(nn_loc, nmat, prop_mat, sdeg_mat, ne_loc, cs_nnz_loc, cs_loc, node_nhe_flag, count, nn_src_ind_loc, qs, qp, lambda_nhe, mu_nhe, rho_nhe, qs_nhe_el, qp_nhe_el, mpi_id, mpi_comm)
...Not-Honoring Enhanced (NHE) Implementation