42 * ILOADP ,FAC ,A ,V ,X ,
43 1 IADC ,FSKY ,LLOADP ,FEXT ,NODA_SURF,NODA_PEXT,
44 2 ITAB ,H3D_DATA ,NL ,DTMIN_LOC ,WFEXT_LOC,
56 USE output_mod ,
ONLY : h3d_has_noda_pext, anim_has_noda_pext
60#include "implicit_f.inc"
74#include "tabsiz_c.inc"
78 INTEGER,
INTENT(IN) :: LLOADP(SLLOADP)
79 INTEGER,
INTENT(INOUT) :: ILOADP(SIZLOADP,NLOADP)
80 INTEGER,
INTENT(IN) :: IADC(*)
81 INTEGER,
INTENT(IN) :: ITAB(NUMNOD),NL
82 my_real,
INTENT(INOUT) :: dtmin_loc
83 DOUBLE PRECISION,
INTENT(INOUT) :: WFEXT_LOC
84 my_real,
INTENT(IN) :: v(3,numnod),x(3,numnod)
85 my_real,
INTENT(INOUT) :: fac(lfacload,nloadp)
86 my_real,
INTENT(INOUT) :: a(3,numnod),fsky(8,sfsky/8)
87 my_real,
INTENT(INOUT) :: fext(3,numnod)
88 my_real,
INTENT(INOUT) :: noda_surf(numnod)
89 my_real,
INTENT(INOUT) :: noda_pext(numnod)
91 TYPE (TH_SURF_) ,
INTENT(INOUT) :: TH_SURF
92 INTEGER,
INTENT(INOUT) :: NSEGPL
93 TYPE(pblast_),
INTENT(INOUT) :: PBLAST
97 INTEGER :: N1, N2, N3, N4, IL, IS, IAD, I, IANIM_OR_H3D,IZ_UPDATE,ABAC_ID,ISIZ_SEG,IERR1,, ITA_SHIFT,NS,KSURF
98 INTEGER :: NDT,IMODEL,NN(4)
101 my_real :: zx,zy,zz,
norm,nx,ny,nz,nnx,nny,nnz,hz,
area
102 my_real :: lambda,cos_theta, alpha_inci, alpha_refl, p_inci,p_refl,z
103 my_real :: i_inci,i_refl,dt_0,t_a,wave_refl,wave_inci, w13
104 my_real :: xdet,ydet,zdet,tdet,wtnt,pmin,t_stop,p,fac_m_bb, fac_l_bb, fac_t_bb, fac_p_bb, fac_i_bb,
106 my_real :: decay_inci,decay_refl
107 my_real :: cst_255_div_ln_z1_on_zn, log10_, npt, ff(3)
108 my_real :: projz(3), tmp(3), lg, zg, hc
109 my_real :: base_x,base_y,base_z
113 TYPE() :: FRIEDLANDER_PARAMS
114 LOGICAL,
SAVE :: IS_UPDATED
115 LOGICAL :: IS_DECAY_TO_BE_COMPUTED
117 CHARACTER(LEN=NCHARLINE) :: MSGOUT1,MSGOUT2
119 DATA cst_255_div_ln_z1_on_zn/-38.147316611455952998/
120 DATA log10_ /2.30258509299405000000/
136 IF(pblast%NLOADP_B == 0)
RETURN
139 ta_first = fac(07,nl)
141 tt_star = tt + pblast%PBLAST_DT%TA_INF
142 iz_update = iloadp(06,nl)
144 ta_first = fac(07,nl) + pblast%PBLAST_DT%TA_INF
145 IF(iz_update ==1)
THEN
147 dtmin_loc = (one+em06)*(ta_first - tt)
148 dtmin_loc=
max(pblast%PBLAST_TAB(il)%DTMIN, dtmin_loc)
149 IF(tt_star<ta_first)
RETURN
152 dtmin_loc = (one+em06)*(tdet - tt)
153 dtmin_loc=
max(pblast%PBLAST_TAB(il)%DTMIN, dtmin_loc)
155 dtmin_loc = pblast%PBLAST_TAB(il)%DTMIN
157 IF(tt_star<tdet)
RETURN
162 ianim_or_h3d = anim_v(5)+outp_v(5)+h3d_data%N_VECT_FINT + anim_v(6)+outp_v(6)+h3d_data%N_VECT_FEXT
165 z1_ = 0.500000000000000
168 fac_m_bb = fac_mass*ep03
169 fac_l_bb = fac_length*ep02
170 fac_t_bb = fac_time*ep06
171 fac_p_bb = fac_m_bb/fac_l_bb/fac_t_bb/fac_t_bb
172 fac_i_bb = fac_p_bb*fac_t_bb
173 fac_i_bb = fac_m_bb/fac_l_bb/fac_t_bb
188 ta_first = fac(07,nl)
195 ishape = iloadp(03,nl)
196 iz_update = iloadp(06,nl)
197 abac_id = iloadp(07,nl)
199 ita_shift = iloadp(09,nl)
201 imodel = iloadp(11,nl)
202 isiz_seg = iloadp(01,nl)/4
204 w13 = (wtnt*fac_m_bb)**third
208 is_decay_to_be_computed = .false.
209 IF(imodel == 2)is_decay_to_be_computed=.true.
218 n1=lloadp(iloadp(4,nl)+4*(i-1))
219 n2=lloadp(iloadp(4,nl)+4*(i-1)+1)
220 n3=lloadp(iloadp(4,nl)+4*(i-1)+2)
221 n4=lloadp(iloadp(4,nl)+4*(i-1)+3)
227 IF(n4 == 0 .OR. n3 == n4 )
THEN
229 pblast%PBLAST_TAB(il)%NPt(i) = three
232 zx = x(1,n1)+x(1,n2)+x(1,n3)
233 zy = x(2,n1)+x(2,n2)+x(2,n3)
234 zz = x(3,n1)+x(3,n2)+x(3,n3)
239 nx = (x(2,n3)-x(2,n1))*(x(3,n3)-x(3,n2)) - (x(3,n3)-x(3,n1))*(x(2,n3)-x(2,n2))
240 ny = (x(3,n3)-x(3,n1))*(x(1,n3)-x(1,n2)) - (x(1,n3)-x(1,n1))*(x(3,n3)-x(3,n2))
241 nz = (x(1,n3)-x(1,n1))*(x(2,n3)-x(2,n2)) - (x(2,n3)-x(2,n1))*(x(1,n3)-x(1,n2))
243 norm = sqrt(nx*nx+ny*ny+nz*nz)
246 pblast%PBLAST_TAB(il)%NPt(i) = four
249 zx = x(1,n1)+x(1,n2)+x(1,n3)+x(1,n4)
250 zy = x(2,n1)+x(2,n2)+x(2,n3)+x(2,n4)
251 zz = x(3,n1)+x(3,n2)+x(3,n3)+x(3,n4)
256 nx = (x(2,n3)-x(2,n1))*(x(3,n4)-x(3,n2)) - (x(3,n3)-x(3,n1))*(x(2,n4)-x(2,n2))
258 nz = (x(1,n3)-x(1,n1))*(x(2,n4)-x(2,n2)) - (x(2,n3)-x(2,n1))*(x(1,n4)-x(1,n2))
260 norm = sqrt(nx*nx+ny*ny+nz*nz)
263 pblast%PBLAST_TAB(il)%N(1,i) = n1
264 pblast%PBLAST_TAB(il)%N(2,i) = n2
265 pblast%PBLAST_TAB(il)%N(3,i) = n3
266 pblast%PBLAST_TAB(il)%N(4,i) = n4
271 hz = ( nnx*zx + nny*zy + nnz*zz - nnx*xdet - nny*ydet - nnz*zdet )
279 IF(iz_update == 2)
THEN
283 IF(hz >= -em10 .OR. ishape == 2)
THEN
291 lambda = (base_x-zx)*nnx + (base_y-zy)*nny + (base_z-zz)*nnz
293 projz(1) = zx + lambda*nnx
294 projz(2) = zy + lambda*nny
295 projz(3) = zz + lambda*nnz
297 tmp(1) = (projz(1)-xdet)
298 tmp(2) = (projz(2)-ydet)
299 tmp(3) = (projz(3)-zdet)
309 dx = (xdet - zx)*fac_l_bb
310 dy = (ydet - zy)*fac_l_bb
311 dz = (zdet - zz)*fac_l_bb
312 dnorm = sqrt(dx*dx+dy
316 cos_theta = cos_theta/
max(em20,
norm*dnorm)
318 z = zg !cylindrical - in abac unit
id g,cm,mus
320 cos_theta = (xdet-projz(1))*nx + (ydet-projz(2))*ny + (zdet-projz(3))*nz
321 cos_theta = cos_theta/
max(em20,lg*
norm)
325 IF(z > 0.5 .AND. z < 400.)
then
328 elseif(z <= 0.5 .AND. pblast%PBLAST_TAB(il)%TAGMSG(i) == 0)
then
329 write(iout, fmt=
'(A,I0,A)')
"Warning : /LOAD/PBLAST id=",
id,
" Rg/W**(1/3) < 0.5 cm/g**(1/3)"
330 write(istdo,fmt=
'(A,I0,A)')
"Warning : /LOAD/PBLAST id=",
id,
" Rg/W**(1/3) < 0.5 cm/g**(1/3)"
331 write(iout, fmt=
'(A)')
" Horizontal Distance on Ground (Rg) is too close to the charge"
332 write(istdo,fmt=
'(A)')
" Horizontal Distance on Ground (Rg) is too close to the charge"
333 if (n4 == 0 .OR. n3 == n4)
then
334 write(iout, fmt=
'(A,3I11)')
" -> Segment nodes : ",itab(n1),itab(n2),itab(n3)
335 write(istdo,fmt=
'(A,3I11)')
" -> Segment nodes : ",itab(n1),itab(n2),itab(n3)
337 write(iout, fmt=
'(A,4I11)')
" -> Segment nodes : ",itab(n1),itab(n2),itab(n3),itab(n4)
338 write(istdo,fmt=
'(A,4I11)')
" -> Segment nodes : ",itab(n1),itab(n2),itab(n3),itab(n4)
340 pblast%PBLAST_TAB(il)%TAGMSG(i) = 1
342 elseif(z > 400. .AND. pblast%PBLAST_TAB(il)%TAGMSG(i) == 0)
then
343 write(iout, fmt=
'(A,I0,A)')
"Warning : /LOAD/PBLAST id=",
id,
" Rg/W**(1/3) > 400. cm/g**(1/3)"
344 write(istdo,fmt=
'(a,i0,a)')
"warning : /load/pblast id=",
id,
" rg/w**(1/3) > 400. cm/g**(1/3)"
345 write(iout, fmt=
'(A)')
" Horizontal Distance on Ground (Rg) is too far from the charge"
346 write(istdo,fmt=
'(A)')
" Horizontal Distance on Ground (Rg) is too far from the charge"
347 if (n4 == 0 .OR. n3 == n4)
then
348 write(iout, fmt=
'(A,3I11)')
" -> Segment nodes : ",itab(n1),itab(n2),itab(n3)
349 write(istdo,fmt=
'(A,3I11)')
" -> Segment nodes : ",itab(n1),itab(n2),itab(n3)
351 write(iout, fmt=
'(A,4I11)')
" -> Segment nodes : ",itab(n1),itab(n2),itab(n3),itab(n4)
352 write(istdo,fmt=
'(A,4I11)')
" -> Segment nodes : ",itab(n1),itab(n2),itab(n3),itab(n4)
354 pblast%PBLAST_TAB(il)%TAGMSG(i) = 1
359 CALL pblast_parameters__surface_burst( pblast,
361 + fac_p_bb, fac_i_bb, fac_t_bb,
362 + is_decay_to_be_computed
363 + friedlander_params, nwarn )
364 p_inci = friedlander_params%P_inci
365 p_refl = friedlander_params%P_refl
366 i_inci = friedlander_params%I_inci
367 i_refl = friedlander_params%I_refl
368 t_a = friedlander_params%T_A
369 dt_0 = friedlander_params%DT_0
370 decay_inci = friedlander_params%decay_inci
371 decay_refl = friedlander_params%decay_refl
374 ta_inf_loc =
min(ta_inf_loc, t_a)
377 pblast%PBLAST_TAB(il)%cos_theta(i) = cos_theta
378 pblast%PBLAST_TAB(il)%P_inci(i) = p_inci
379 pblast%PBLAST_TAB(il)%P_refl(i) = p_refl
380 pblast%PBLAST_TAB(il)%ta(i) = t_a
381 pblast%PBLAST_TAB(il)%t0(i) = dt_0
382 pblast%PBLAST_TAB(il)%decay_inci(i) = decay_inci
383 pblast%PBLAST_TAB(il)%decay_refl(i) = decay_refl
397 dtmin_loc =
min(dtmin_loc,dt_0/ndt)
399 iloadp(06,nl) = iz_update
406 cos_theta = pblast%PBLAST_TAB(il)%cos_theta(i)
407 p_inci = pblast%PBLAST_TAB(il)%P_inci(i)
408 p_refl = pblast%PBLAST_TAB(il)%P_refl(i)
409 t_a = pblast%PBLAST_TAB(il)%ta(i)
411 decay_inci = pblast%PBLAST_TAB(il)%decay_inci(i)
412 decay_refl = pblast%PBLAST_TAB(il)%decay_refl(i)
413 dtmin_loc = pblast%PBLAST_TAB(il)%DTMIN
419 IF(cos_theta<=zero)
THEN
424 alpha_refl = cos_theta**2
425 alpha_inci = one + cos_theta - two * alpha_refl
432 wave_inci = p_inci*(one-(tt_star-t_a)/dt_0)*exp(-decay_inci*(tt_star-t_a)/dt_0)
433 wave_refl = p_refl*(one-(tt_star-t_a)/dt_0)*exp(-decay_refl
438 p = alpha_refl * wave_refl + alpha_inci * wave_inci
440 pblast%PBLAST_TAB(il)%PRES(i) = p
446 surf_patch = half*sqrt
447 ff(1) = -p * half*nx / npt
448 ff(2) = -p * half*ny / npt
449 ff(3) = -p * half*nz / npt
451 pblast%PBLAST_TAB(il)%FX(i) = ff(1)
452 pblast%PBLAST_TAB(il)%FY(i) = ff(2)
453 pblast%PBLAST_TAB(il)%FZ(i) = ff(3)
454 pblast%PBLAST_TAB(il)%SURF_PATCH(i) = surf_patch
459 wfext_loc=wfext_loc+dt1*(ff(1)*sum(v(1,nn(1:nint(npt)))) +ff(2)*sum(v(2,nn(1:nint(npt)))) +ff(3)*sum(v(3,nn(1:nint(npt)))))
462 IF(th_surf%LOADP_FLAG > 0 )
THEN
464 area = surf_patch*npt
465 DO ns=th_surf%LOADP_KSEGS(nsegpl) +1,th_surf%LOADP_KSEGS(nsegpl+1)
466 ksurf = th_surf%LOADP_SEGS(ns)
467 th_surf%channels(4,ksurf)= th_surf%channels(4,ksurf) +
area*p
468 th_surf%channels(5,ksurf)= th_surf%channels(5,ksurf) +
area
476 IF(imodel == 2 .AND. nwarn > 0)
THEN
478 WRITE(msgout1,fmt=
'(I0,A)') nwarn,
479 .
' SEGMENT(S) HAS EXCESSIVE POSITIVE IMPULSE REGARDING THE PEAK PRESSURE AND POSITIVE DURATION.'
481 msgout2=
'A TRIANGULAR WAVEFORM WILL BE USED INSTEAD TO MAXIMIZE THE IMPULSE. DEFINING A PMIN VALUE IS STRONGLY RECOMMENDED'
482 write(iout , fmt=
'(A,I10,/A,/A)')
"Updated parameters for /LOAD/PBLAST id=",
id, msgout1, msgout2
483 write(istdo, fmt=
'(A,I10,/A,/A)')
"Updated parameters for /LOAD/PBLAST id=",
id, msgout1, msgout2
491 fac(07,nl) =
min(ta_inf_loc, fac(07,nl))
493 dtmin_loc = (one+em06)*(fac(07,nl) - tt)
494 dtmin_loc=
max(pblast%PBLAST_TAB(il)%DTMIN, dtmin_loc)
497 iloadp(06,nl) = iz_update
498#include "lockoff.inc"
500 write(*,fmt=
'(A,I10,A,E16.8,A,E16.8)')
"Updated parameters for /LOAD/PBLAST id=",
501 .
id,
' previous first arrival time :',zeta,
502 .
' is now updated to :',fac(07,nl)
515 n1=lloadp(iloadp(4,nl)+4*(i-1))
516 n2=lloadp(iloadp(4,nl)+4*(i-1)+1)
517 n3=lloadp(iloadp(4,nl)+4*(i-1)+2)
518 n4=lloadp(iloadp(4,nl)+4*(i-1)+3)
519 a(1,n1)=a(1,n1)+pblast%PBLAST_TAB(il)%FX(i)
520 a(2,n1)=a(2,n1)+pblast%PBLAST_TAB(il)%FY(i)
521 a(3,n1)=a(3,n1)+pblast%PBLAST_TAB(il)%FZ(i)
522 a(1,n2)=a(1,n2)+pblast%PBLAST_TAB(il)%FX(i)
523 a(2,n2)=a(2,n2)+pblast%PBLAST_TAB(il)%FY(i)
524 a(3,n2)=a(3,n2)+pblast%PBLAST_TAB(il)%FZ(i)
525 a(1,n3)=a(1,n3)+pblast%PBLAST_TAB(il)%FX(i)
526 a(2,n3)=a(2,n3)+pblast%PBLAST_TAB(il)%FY(i)
527 a(3,n3)=a(3,n3)+pblast%PBLAST_TAB(il)%FZ(i)
528 IF(pblast%PBLAST_TAB(il)%NPt(i) == four)
THEN
529 a(1,n4)=a(1,n4)+pblast%PBLAST_TAB(il)%FX(i)
530 a(2,n4)=a(2,n4)+pblast%PBLAST_TAB(il)%FY(i)
531 a(3,n4)=a(3,n4)+pblast%PBLAST_TAB(il)%FZ(i)
538 iad =iadc(iloadp(4,nl)+4*(i-1))
539 fsky(1,iad) =pblast%PBLAST_TAB(il)%FX(i)
540 fsky(2,iad) =pblast%PBLAST_TAB(il)%FY(i)
541 fsky(3,iad) =pblast%PBLAST_TAB(il)%FZ(i)
542 iad =iadc(iloadp(4,nl)+4*(i-1)+1)
543 fsky(1,iad) =pblast%PBLAST_TAB(il)%FX(i)
544 fsky(2,iad) =pblast%PBLAST_TAB(il)%FY(i)
545 fsky(3,iad) =pblast%PBLAST_TAB(il)%FZ(i)
546 iad =iadc(iloadp(4,nl)+4*(i-1)+2)
547 fsky(1,iad) =pblast%PBLAST_TAB(il)%FX(i)
548 fsky(2,iad) =pblast%PBLAST_TAB(il)%FY(i)
549 fsky(3,iad) =pblast%PBLAST_TAB(il)%FZ(i)
550 IF(pblast%PBLAST_TAB(il)%NPt(i) == four)
THEN
551 iad =iadc(iloadp(4,nl)+4*(i-1)+3)
552 fsky(1,iad) =pblast%PBLAST_TAB(il)%FX(i)
553 fsky(2,iad) =pblast%PBLAST_TAB(il)%FY(i)
554 fsky(3,iad) =pblast%PBLAST_TAB(il)%FZ(i)
566 IF(ianim_or_h3d > 0)
THEN
568 n1=pblast%PBLAST_TAB(il)%N(1,i)
569 n2=pblast%PBLAST_TAB(il)%N(2,i)
570 n3=pblast%PBLAST_TAB(il)%N(3,i)
571 n4=pblast%PBLAST_TAB(il)%N(4,i)
572 fext(1,n1) = fext(1,n1)+pblast%PBLAST_TAB(il)%FX(i)
573 fext(2,n1) = fext(2,n1)+pblast%PBLAST_TAB(il)%FY(i)
574 fext(3,n1) = fext(3,n1)+pblast%PBLAST_TAB(il)%FZ(i)
575 fext(1,n2) = fext(1,n2)+pblast%PBLAST_TAB(il)%FX(i)
576 fext(2,n2) = fext(2,n2)+pblast%PBLAST_TAB(il)%FY(i)
577 fext(3,n2) = fext(3,n2)+pblast%PBLAST_TAB(il)%FZ(i)
578 fext(1,n3) = fext(1,n3)+pblast%PBLAST_TAB(il)%FX(i)
579 fext(2,n3) = fext(2,n3)+pblast%PBLAST_TAB(il)%FY(i)
580 fext(3,n3) = fext(3,n3)+pblast%PBLAST_TAB(il)%FZ(i)
581 IF(pblast%PBLAST_TAB(il)%NPt(i)==four)
THEN
582 fext(1,n4) = fext(1,n4)+pblast%PBLAST_TAB(il)%FX(i)
583 fext(2,n4) = fext(2,n4)+pblast%PBLAST_TAB(il)%FY(i)
584 fext(3,n4) = fext(3,n4)+pblast%PBLAST_TAB(il)%FZ(i)
588 IF(
th_has_noda_pext > 0 .OR. anim_has_noda_pext > 0 .OR. h3d_has_noda_pext > 0)
THEN
590 n1 = pblast%PBLAST_TAB(il)%N(1,i)
591 n2 = pblast%PBLAST_TAB(il)%N(2,i)
592 n3 = pblast%PBLAST_TAB(il)%N(3,i)
593 n4 = pblast%PBLAST_TAB(il)%N(4,i)
594 surf_patch = pblast%PBLAST_TAB(il)%SURF_PATCH(i)
595 noda_surf(n1) = noda_surf(n1) + surf_patch
596 noda_surf(n2) = noda_surf(n2) + surf_patch
597 noda_surf(n3) = noda_surf(n3) + surf_patch
598 p = pblast%PBLAST_TAB(il)%PRES(i) * surf_patch
599 noda_pext(n1) = noda_pext(n1) + p
600 noda_pext(n2) = noda_pext(n2) + p
601 noda_pext(n3) = noda_pext(n3) + p
602 IF(pblast%PBLAST_TAB(il)%NPT(i) == four)
THEN
603 noda_surf(n4) = noda_surf(n4) + surf_patch
604 noda_pext(n4) = noda_pext
614 WRITE(iout,*)
' ** ERROR IN MEMORY ALLOCATION - PBLAST LOADING'
615 WRITE(istdo,*)
' ** ERROR IN MEMORY ALLOCATION - PBLAST LOADING'