45 IF (trim(des_output_type) .EQ.
'TECPLOT')
THEN 56 IF (des_calc_bedheight)
THEN 96 use discretelement
, only: des_pos_new, des_vel_new, des_usr_var
97 use discretelement
, only: des_radius
98 use discretelement
, only: des_usr_var, des_usr_var_size
99 use discretelement
, only: s_time
100 use discretelement
, only: use_cohesion, postcohesive
111 DOUBLE PRECISION,
DIMENSION(:),
ALLOCATABLE :: TMP_PAR
112 CHARACTER(len=10) :: lNoP
113 CHARACTER(len=24) :: sTIMEc
116 stimec=
'';
WRITE(stimec,
"(ES24.16)") s_time
127 &byte_order="LittleEndian">')
131 &NumberOfVerts="0" NumberOfLines="0" NumberOfStrips="0" & 132 &NumberOfPolys="0">')
142 ALLOCATE(tmp_par(
SIZE(des_radius)))
145 &Vectors="Velocity">')
154 DO nn=1, des_usr_var_size
158 IF(particle_orientation) &
162 tmp_par = 1.0d0 - epg_p
169 IF(any_species_eq)
THEN 211 DOUBLE PRECISION,
INTENT(OUT) :: OUT_VAR(:)
216 DO lc=1,
size(out_var)
218 out_var(lc) = 2.0d0*des_radius(lc)*&
221 out_var(lc) = 2.0d0*des_radius(lc)
225 out_var = 2.0d0*des_radius
273 INTEGER:: DES_DATA,DES_EX,DES_EPS
277 CHARACTER(LEN=50) :: FNAME_DATA
282 CHARACTER(LEN=50) :: FNAME_EXTRA
285 CHARACTER(LEN=50) :: FNAME_EPS
294 integer llocalcnt,lglocnt,lgathercnts(0:
numpes-1),lproc,ltotvar,lcount
295 double precision,
dimension(:,:),
allocatable :: ltemp_array
300 wdimn = merge(2,3,
no_k)
302 ltotvar = merge(8,9,
no_k)
309 write(fname_data,
'(A,"_DES_DATA",I4.4,"_",I4.4,".dat")') trim(
run_name 310 write(fname_extra,
'(A,"_DES_EXTRA",I4.4,"_",I4.4,".dat")') trim
311 write(fname_eps,
'(A,"_DES_EPS",I4.4,"_",I4.4,".dat")') trim(
run_name 312 open(convert=
'big_endian',unit=des_data,file=fname_data,status=
'new' 313 open(convert=
'big_endian',unit=des_ex,file=fname_extra,status=
'new' 314 open(convert=
'big_endian',unit=des_eps,file=fname_eps,status=
'new' 317 write(fname_data,
'(A,"_DES_DATA_",I4.4,".dat")') trim(
run_name 318 write(fname_extra,
'(A,"_DES_EXTRA_",I4.4,".dat")') trim(
run_name 319 write(fname_eps,
'(A,"_DES_EPS_",I4.4,".dat")') trim(
run_name 320 open(convert=
'big_endian',unit=des_data,file=fname_data,status
'new' 321 open(convert=
'big_endian',unit=des_ex,file=fname_extra,status
'new' 322 open(convert=
'big_endian',unit=des_eps,file=fname_eps,status
'new' 325 tecplot_findex = tecplot_findex + 1
330 write (des_data,
'(A)') &
331 'variables = "x" "y" "z" "vx" "vy" "vz" "rad" "den" "mark"' 333 write (des_data,
'(A)') &
334 'variables = "x" "y" "vx" "vy" "omega" "rad" "den" "mark"' 336 write (des_data,
"(A,F15.7,A)")
'zone T ="', s_time,
'"' 344 if(is_nonexistent(l)) cycle
346 if(is_ghost(l) .or. is_entering_ghost(l) .or. is_exiting_ghost
348 write (des_data,
'(8(2x,es12.5))')&
349 (des_pos_new(l,k),k=1,wdimn),(des_vel_new(l,k),k=1,wdimn
352 write (des_data,
'(7(2x,es12.5))')&
353 (des_pos_new(l,k),k=1,wdimn), (des_vel_new(l,k),k=1,wdimn
361 llocalcnt = pip - ighost_cnt
364 allocate (ltemp_array(lglocnt,ltotvar))
367 lgathercnts(
mype) = llocalcnt
378 ltemp_array(:,lcount) =
drootbuf(:); lcount=lcount+1
382 ltemp_array(:,lcount) =
drootbuf(:); lcount=lcount+1
386 ltemp_array(:,lcount) =
drootbuf(:); lcount=lcount+1
389 ltemp_array(:,lcount) =
drootbuf(:); lcount=lcount+1
391 ltemp_array(:,lcount) =
drootbuf(:); lcount=lcount+1
397 write (des_data,
'(8(2x,es12.5),I5)') (ltemp_array(l,k)
401 write (des_data,
'(7(2x,es12.5),I5)') (ltemp_array(l,k)
415 999
write(*,
"(/1x,70('*'),//,a,/,a,/1x,70('*'))")&
416 ' From: write_des_tecplot ',&
417 ' message: error opening des tecplot file. terminating run.' 453 LOGICAL,
SAVE :: FIRST_PASS = .true.
457 CHARACTER(LEN=50) :: FNAME_BH
459 INTEGER,
PARAMETER :: BH_UNIT = 2010
463 INTEGER,
SAVE :: tcount = 1
464 DOUBLE PRECISION :: height_avg, height_rms
465 DOUBLE PRECISION,
PARAMETER :: tmin = 5.d0
466 DOUBLE PRECISION,
DIMENSION(5000),
SAVE :: bed_height_time
479 if(
time.gt.tmin)
then 480 if(tcount.le.5000)
then 481 bed_height_time(tcount) = bed_height(1)
485 if(tcount.gt.20)
then 487 height_avg = height_avg + bed_height_time(i)
489 height_avg = height_avg/(tcount-1)
491 height_rms = height_rms + ((bed_height_time(i)&
495 height_rms = sqrt(height_rms/(tcount-1))
500 fname_bh = trim(
run_name)//
'_DES_BEDHEIGHT.dat' 503 INQUIRE(file=fname_bh,exist=f_exists)
506 IF (.NOT.f_exists)
THEN 507 OPEN(convert=
'BIG_ENDIAN',unit=bh_unit,file=fname_bh,&
508 form=
"formatted",status=
"new")
514 WRITE(unit_log, 1000)
518 OPEN(convert=
'BIG_ENDIAN',unit=bh_unit,file=fname_bh,&
525 OPEN(convert=
'BIG_ENDIAN',unit=bh_unit,file=fname_bh,&
529 WRITE(bh_unit,
'(10(2X,E20.12))') s_time, &
530 (bed_height(m), m=
mmax+1,
mmax+des_mmax), height_avg, height_rms
532 CLOSE(bh_unit, status=
"KEEP")
536 1000
FORMAT(/1
x,70(
'*')//,
' From: WRITE_DES_BEDHEIGHT',/,&
537 ' Message: bed_height.dat already exists in the run',&
538 ' directory.',/10
x,
'Run terminated to prevent',&
539 ' accidental overwriting of files.',/1
x,70(
'*')/)
577 LOGICAL,
SAVE :: FIRST_PASS = .true.
581 INTEGER,
PARAMETER :: GT_UNIT = 2020
583 CHARACTER(LEN=50) :: FNAME_GT
586 fname_gt = trim(
run_name)//
'_DES_THETA.dat' 589 INQUIRE(file=fname_gt,exist=f_exists)
591 IF (.NOT.f_exists)
THEN 594 OPEN(convert=
'BIG_ENDIAN',unit=gt_unit,file=fname_gt,&
603 WRITE(*,1001) fname_gt
604 WRITE(unit_log,1001) fname_gt
608 OPEN(convert=
'BIG_ENDIAN',unit=gt_unit, file=fname_gt,&
615 OPEN(convert=
'BIG_ENDIAN',unit=gt_unit,file=fname_gt,&
620 WRITE(gt_unit,
'(A6,ES24.16)')
'Time=', s_time
621 WRITE(gt_unit,
'(A6,2X,3(A6,2X),A8)',advance=
"NO")
'IJK', &
624 WRITE(gt_unit,
'(7X,A6,I1)',advance=
"NO")
'THETA_',m
627 DO ijk = ijkstart3, ijkend3
628 IF(fluid_at(ijk))
THEN 633 WRITE(gt_unit,
'(I6,2X,3(I6,2X),I8,(2X,ES15.5))') &
639 CLOSE(gt_unit, status=
'KEEP')
643 1001
FORMAT(/1
x,70(
'*')//,
' From: WRITE_DES_THETA',/,&
644 ' Message: ', a,
' already exists in the run',/10
x,&
645 'directory. Run terminated to prevent accidental overwriting',&
646 /10
x,
'of files.',/1
x,70(
'*')/)
integer, dimension(:), allocatable igathercnts
subroutine vtp_open_file(NoPc)
subroutine calc_des_bedheight
character(len=32) function ivar(VAR, i1, i2, i3)
subroutine write_des_data
subroutine write_des_tecplot
double precision, dimension(:), allocatable des_t_s
double precision, dimension(:), allocatable dprocbuf
character(len=60) run_name
subroutine get_diameter(OUT_VAR)
integer, dimension(:), allocatable irootbuf
subroutine vtp_close_file
subroutine write_des_theta
subroutine des_granular_temperature
character(len=16) run_type
integer, dimension(:), allocatable iprocbuf
double precision, dimension(:,:), allocatable theta_m
double precision, dimension(:,:), allocatable des_x_s
subroutine write_des_bedheight
subroutine add_vtp_to_pvd
integer, dimension(:), allocatable idispls
subroutine vtp_write_element(ELEMENT)
double precision, dimension(:), allocatable drootbuf
double precision, dimension(:), allocatable des_stat_wt
double precision, dimension(:), allocatable x
double precision, parameter zero