MFIX  2016-1
write_des_data.f
Go to the documentation of this file.
1 !vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv!
2 ! !
3 ! Subroutine: WRITE_DES_DATA !
4 ! Purpose: Writing DES output in Paraview format !
5 ! !
6 ! !
7 ! Author: Jay Boyalakuntla Date: 26-Jul-06 !
8 ! Reviewer: Sreekanth Pannala Date: 31-Oct-06 !
9 ! !
10 ! Reviewer: J. Musser Date: 20-Apr-10 !
11 ! Comments: Split original subroutine into one for ParaView *.vtp !
12 ! files, and a second for TECPLOT files *.dat. !
13 ! !
14 !^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^!
15 
16  SUBROUTINE write_des_data
17 
18 !-----------------------------------------------
19 ! Modules
20 !-----------------------------------------------
21  USE param
22  USE param1
23  USE parallel
24  USE fldvar
25  USE discretelement
26  USE run
27  USE geometry
28  USE physprop
29  USE sendrecv
30  USE des_bc
31 
32  use error_manager
33 
34  IMPLICIT NONE
35 !-----------------------------------------------
36 ! Local Variables
37 !-----------------------------------------------
38 
39 !-----------------------------------------------
40 ! Functions
41 !-----------------------------------------------
42 
43 !-----------------------------------------------
44 
45  IF (trim(des_output_type) .EQ. 'TECPLOT') THEN
47  ELSE
48  CALL write_des_vtp
49  ENDIF
50 
51 ! Invoke at own risk
52 
53 ! Granular temperature subroutine should be called/calculated when
54 ! writing DES data
55 
56  IF (des_calc_bedheight) THEN
59  ENDIF
60 
61  IF (.false.) CALL des_granular_temperature
62  IF (.false.) CALL write_des_theta
63 
64  RETURN
65  END SUBROUTINE write_des_data
66 !-----------------------------------------------
67 
68 !vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv!
69 ! !
70 ! Subroutine: WRITE_DES_VTP !
71 ! Purpose: Writing DES output in Paraview format !
72 ! !
73 ! !
74 ! Reviewer: Rahul Garg Dare: 01-Aug-07 !
75 ! Comments: Added one more output file containing averaged bed height !
76 ! !
77 ! Revision : For parallel runs added cumulative and parallel IO !
78 ! Author : Pradeep G. !
79 ! !
80 ! NOTE: If the system starts with zero particles, ParaView may have !
81 ! trouble showing the results. To view the results in the current !
82 ! version of ParaView, Version 3.6.1: !
83 ! i - load the *.vtp files !
84 ! ii - filter with glyph (Filters > Common > Glyph) !
85 ! a - change glyph to sphere !
86 ! b - change scale mode to scalar !
87 ! c - check the "Edit" Set Scale Factor Box !
88 ! d - change the value to 1.0 !
89 ! !
90 !^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^!
91 
92  SUBROUTINE write_des_vtp
93 
94  use des_rxns, only: des_x_s
95  use des_thermo, only: des_t_s
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
101  use error_manager
102  use mfix_pic, only: des_stat_wt, mppic
103  use param
104  use param1, only: zero
105  use run, only: any_species_eq
106  use run, only: energy_eq
107  use vtp
108 
109  IMPLICIT NONE
110 
111  DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE :: TMP_PAR
112  CHARACTER(len=10) :: lNoP
113  CHARACTER(len=24) :: sTIMEc
114  INTEGER :: NN
115 
116  stimec=''; WRITE(stimec,"(ES24.16)") s_time
117 
118 ! This routine opens the VTP file and calculates send/recv information.
119 ! It returns back the number of points as a string.
120  CALL vtp_open_file(lnop)
121 
122 ! Standard VTP header information:
123 !----------------------------------------------------------------------/
124  CALL vtp_write_element('<?xml version="1.0"?>')
125  CALL vtp_write_element('<!-- Time ='//stimec//'s -->')
126  CALL vtp_write_element('<VTKFile type="PolyData" version="0.1" &
127  &byte_order="LittleEndian">')
128  CALL vtp_write_element('<PolyData>')
129 
130  CALL vtp_write_element('<Piece NumberOfPoints="'//lnop//'" &
131  &NumberOfVerts="0" NumberOfLines="0" NumberOfStrips="0" &
132  &NumberOfPolys="0">')
133 
134 ! Points are the particle identified by position:
135 !----------------------------------------------------------------------/
136  CALL vtp_write_element('<Points>')
137  CALL vtp_write_data('Position', des_pos_new)
138  CALL vtp_write_element('</Points>')
139 
140 ! PointData are individual particle properties:
141 !----------------------------------------------------------------------/
142  ALLOCATE(tmp_par(SIZE(des_radius)))
143 
144  CALL vtp_write_element('<PointData Scalars="Diameter" &
145  &Vectors="Velocity">')
146 
147  CALL get_diameter(tmp_par)
148  CALL vtp_write_data('Diameter', tmp_par)
149 
150  CALL vtp_write_data('Velocity', des_vel_new)
151 
152  CALL vtp_write_data('ID', iglobal_id)
153 
154  DO nn=1, des_usr_var_size
155  CALL vtp_write_data(trim(ivar('USR_VAR',nn)),des_usr_var(nn,:))
156  ENDDO
157 
158  IF(particle_orientation) &
159  CALL vtp_write_data('Orientation', orientation)
160 
161  IF(mppic) THEN
162  tmp_par = 1.0d0 - epg_p
163  CALL vtp_write_data('EPs', tmp_par)
164  ENDIF
165 
166  IF(energy_eq) &
167  CALL vtp_write_data('Temperature', des_t_s)
168 
169  IF(any_species_eq) THEN
170  DO nn=1, dimension_n_s
171  CALL vtp_write_data(trim(ivar('X_s',nn)), des_x_s(:,nn))
172  ENDDO
173  ENDIF
174 
175  IF(use_cohesion) &
176  CALL vtp_write_data('CohesiveForce', postcohesive)
177 
178  CALL vtp_write_element('</PointData>')
179  DEALLOCATE(tmp_par)
180 
181 ! Open/Close the unused VTP tags.
182 !----------------------------------------------------------------------/
183  CALL vtp_write_element('<CellData></CellData>')
184  CALL vtp_write_element('<Verts></Verts>')
185  CALL vtp_write_element('<Lines></Lines>')
186  CALL vtp_write_element('<Strips></Strips>')
187  CALL vtp_write_element('<Polys></Polys>')
188 
189 ! Close all the opened tags:
190 !----------------------------------------------------------------------/
191  CALL vtp_write_element('</Piece>')
192  CALL vtp_write_element('</PolyData>')
193  CALL vtp_write_element('</VTKFile>')
194 
195  CALL vtp_close_file
196 
197 ! Add the new VTP file to the PVD file for time association.
198  CALL add_vtp_to_pvd
199 
200  RETURN
201 
202  contains
203 
204 !......................................................................!
205 ! Purpose: Return the diamerter of DES particles. !
206 !......................................................................!
207  SUBROUTINE get_diameter(OUT_VAR)
209  IMPLICIT NONE
210 
211  DOUBLE PRECISION, INTENT(OUT) :: OUT_VAR(:)
212  INTEGER :: LC
213 
214 ! Return the effective diamter of the parcle.
215  IF(mppic) THEN
216  DO lc=1,size(out_var)
217  IF(des_stat_wt(lc) > zero) THEN
218  out_var(lc) = 2.0d0*des_radius(lc)*&
219  (des_stat_wt(lc)**(1./3.))
220  ELSE
221  out_var(lc) = 2.0d0*des_radius(lc)
222  ENDIF
223  ENDDO
224  ELSE
225  out_var = 2.0d0*des_radius
226  ENDIF
227 
228  RETURN
229  END SUBROUTINE get_diameter
230 
231  END SUBROUTINE write_des_vtp
232 
233 !vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
234 !
235 ! Module name: WRITE_DES_TECPLOT
236 ! Purpose: Writing DES output in TECPLOT format
237 !
238 ! Revision: For parallel runs added distributed and single IO
239 ! Comment: In earlier version the time instances are keep appended to
240 ! the tecplot file. This will make tecplot file so large for
241 ! large simulations. Hence seperate files are written for
242 ! each instances
243 ! Author : Pradeep G.
244 !
245 !
246 !
247 !^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
248  SUBROUTINE write_des_tecplot
250  USE param
251  USE param1
252  USE parallel
253  USE fldvar
254  USE discretelement
255  USE run
256  USE geometry
257  USE physprop
258  USE sendrecv
259  USE des_bc
260  USE compar
261  USE cdist
262  USE desmpi
263  USE mpi_comm_des
264  USE mpi_utility
265  USE functions
266  IMPLICIT NONE
267 
268 !-----------------------------------------------
269 ! Local Variables
270 !-----------------------------------------------
271 ! file units for
272 ! Pradeep remove parameter from following variables
273  INTEGER:: DES_DATA,DES_EX,DES_EPS
274 
275 ! output file for basic DES variables including: position, velocity,
276 ! radius, density, mark (flag)
277  CHARACTER(LEN=50) :: FNAME_DATA
278 
279 ! output file for extra DES variables including:
280 ! solids time (S_TIME), maximum neighbor count, maximum overlap
281 ! granular energy and granular temperature
282  CHARACTER(LEN=50) :: FNAME_EXTRA
283 
284 ! output file for axial solids volume fraction and granular temp
285  CHARACTER(LEN=50) :: FNAME_EPS
286 
287 ! dummy indices
288  INTEGER L, K
289 
290 ! index to track accounted for particles
291  INTEGER PC
292 
293 ! Variables related to gathering info at PE_IO
294  integer llocalcnt,lglocnt,lgathercnts(0:numpes-1),lproc,ltotvar,lcount
295  double precision, dimension(:,:), allocatable :: ltemp_array
296 
297  INTEGER :: wDIMN
298 
299 ! Set output dimnensions
300  wdimn = merge(2,3,no_k)
301 ! set the total variable based on dimension
302  ltotvar = merge(8,9,no_k)
303 
304 ! set the file name and unit number and open file
305  des_data = 2000
306  des_ex = 2100
307  des_eps = 2200
308  if (bdist_io) then
309  write(fname_data,'(A,"_DES_DATA",I4.4,"_",I4.4,".dat")') trim(run_name),tecplot_findex,mype
310  write(fname_extra,'(A,"_DES_EXTRA",I4.4,"_",I4.4,".dat")') trim(run_name),tecplot_findex,mype
311  write(fname_eps,'(A,"_DES_EPS",I4.4,"_",I4.4,".dat")') trim(run_name),tecplot_findex,mype
312  open(convert='big_endian',unit=des_data,file=fname_data,status='new',err=999)
313  open(convert='big_endian',unit=des_ex,file=fname_extra,status='new',err=999)
314  open(convert='big_endian',unit=des_eps,file=fname_eps,status='new',err=999)
315  else
316  if(mype.eq.pe_io) then
317  write(fname_data,'(A,"_DES_DATA_",I4.4,".dat")') trim(run_name),tecplot_findex
318  write(fname_extra,'(A,"_DES_EXTRA_",I4.4,".dat")') trim(run_name),tecplot_findex
319  write(fname_eps,'(A,"_DES_EPS_",I4.4,".dat")') trim(run_name),tecplot_findex
320  open(convert='big_endian',unit=des_data,file=fname_data,status='new',err=999)
321  open(convert='big_endian',unit=des_ex,file=fname_extra,status='new',err=999)
322  open(convert='big_endian',unit=des_eps,file=fname_eps,status='new',err=999)
323  end if
324  end if
325  tecplot_findex = tecplot_findex + 1
326 
327 ! write header
328  if (bdist_io .or. mype .eq. pe_io) then
329  if(do_k) then
330  write (des_data,'(A)') &
331  'variables = "x" "y" "z" "vx" "vy" "vz" "rad" "den" "mark"'
332  else
333  write (des_data, '(A)') &
334  'variables = "x" "y" "vx" "vy" "omega" "rad" "den" "mark"'
335  endif
336  write (des_data, "(A,F15.7,A)")'zone T ="', s_time, '"'
337  end if
338 
339 ! write data in ditributed mode or as a single file
340  if(bdist_io) then
341  pc = 1
342  do l = 1,max_pip
343  if(pc.gt.pip) exit
344  if(is_nonexistent(l)) cycle
345  pc = pc+1
346  if(is_ghost(l) .or. is_entering_ghost(l) .or. is_exiting_ghost(l)) cycle
347  if(do_k) then
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), &
350  des_radius(l),ro_sol(l)
351  else
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), &
354  omega_new(l,1), des_radius(l), ro_sol(l)
355  endif
356  end do
357 
358  else ! if bdist_io
359 ! set parameters required for gathering info at PEIO and write as single file
360  lglocnt = 10
361  llocalcnt = pip - ighost_cnt
362  call global_sum(llocalcnt,lglocnt)
363  allocate (dprocbuf(llocalcnt),drootbuf(lglocnt),iprocbuf(llocalcnt),irootbuf(lglocnt))
364  allocate (ltemp_array(lglocnt,ltotvar))
365  igath_sendcnt = llocalcnt
366  lgathercnts = 0
367  lgathercnts(mype) = llocalcnt
368  call global_sum(lgathercnts,igathercnts)
369  idispls(0) = 0
370  do lproc = 1,numpes-1
371  idispls(lproc) = idispls(lproc-1) + igathercnts(lproc-1)
372  end do
373 
374 ! gather information from all processor
375  lcount = 1
376  do k = 1,wdimn
377  call des_gather(des_pos_new(:,k))
378  ltemp_array(:,lcount) = drootbuf(:); lcount=lcount+1
379  end do
380  do k = 1,wdimn
381  call des_gather(des_vel_new(:,k))
382  ltemp_array(:,lcount) = drootbuf(:); lcount=lcount+1
383  end do
384  if(no_k) then
385  call des_gather(omega_new(:,1))
386  ltemp_array(:,lcount) = drootbuf(:); lcount=lcount+1
387  end if
388  call des_gather(des_radius)
389  ltemp_array(:,lcount) = drootbuf(:); lcount=lcount+1
390  call des_gather(ro_sol)
391  ltemp_array(:,lcount) = drootbuf(:); lcount=lcount+1
392 
393 ! write the data into file
394  if (mype.eq.pe_io) then
395  if(do_k) then
396  do l =1,lglocnt
397  write (des_data,'(8(2x,es12.5),I5)') (ltemp_array(l,k),k=1,8),int(ltemp_array(l,9))
398  end do
399  else
400  do l =1,lglocnt
401  write (des_data,'(7(2x,es12.5),I5)') (ltemp_array(l,k),k=1,7),int(ltemp_array(l,8))
402  end do
403  end if
404  end if
405  deallocate (dprocbuf,drootbuf,iprocbuf,irootbuf,ltemp_array)
406  end if
407 ! close the files
408  if (mype.eq.pe_io .or. bdist_io) then
409  close(des_data)
410  close(des_ex)
411  close(des_eps)
412  end if
413  return
414 
415  999 write(*,"(/1x,70('*'),//,a,/,a,/1x,70('*'))")&
416  ' From: write_des_tecplot ',&
417  ' message: error opening des tecplot file. terminating run.'
418 
419 
420  END SUBROUTINE write_des_tecplot
421 !-----------------------------------------------
422 
423 !vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
424 !
425 ! Module name: WRITE_DES_BEDHEIGHT
426 ! Purpose: Writing DES output on bed height.
427 
428 ! WARNING: This code is out-of-date and should be modified for consistency
429 ! with current DEM version. Also this routine will be fairly specific
430 ! to a user needs and should probably be tailored as such
431 
432 !
433 !^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
434  SUBROUTINE write_des_bedheight
436  USE param
437  USE param1
438  USE parallel
439  USE fldvar
440  USE discretelement
441  USE run
442  USE geometry
443  USE physprop
444  USE sendrecv
445  USE des_bc
446  IMPLICIT NONE
447 
448 !-----------------------------------------------
449 ! Local Variables
450 !-----------------------------------------------
451 ! logical that identifies that the data file has been created
452 ! and is already opened (initial checks/writes)
453  LOGICAL, SAVE :: FIRST_PASS = .true.
454 ! logical used for testing is the data files already exists
455  LOGICAL :: F_EXISTS
456 ! output file for the bed height data
457  CHARACTER(LEN=50) :: FNAME_BH
458 ! file unit for the bed height data
459  INTEGER, PARAMETER :: BH_UNIT = 2010
460 ! dummy index values
461  INTEGER I, M
462 ! variables for bed height calculation
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
467 
468 !-----------------------------------------------
469 ! Functions
470 !-----------------------------------------------
471 !-----------------------------------------------
472 
473 ! after tmin start storing bed height. after enough measurements
474 ! have been taken (i.e. tcount > 20) start to calculate a running
475 ! average bed height and running rms bed height for solids phase 1 only
476  height_avg = zero
477  height_rms = zero
478 
479  if(time.gt.tmin) then
480  if(tcount.le.5000) then
481  bed_height_time(tcount) = bed_height(1)
482  !dt_time(tcount) = DT
483  tcount = tcount + 1
484 
485  if(tcount.gt.20) then
486  do i = 1, tcount-1,1
487  height_avg = height_avg + bed_height_time(i)!*dt_time(i)
488  enddo
489  height_avg = height_avg/(tcount-1)
490  do i = 1, tcount-1,1
491  height_rms = height_rms + ((bed_height_time(i)&
492  &-height_avg)**2)!*dt_time(i)
493  enddo
494 
495  height_rms = sqrt(height_rms/(tcount-1))
496  endif
497  endif
498  endif
499 
500  fname_bh = trim(run_name)//'_DES_BEDHEIGHT.dat'
501  IF(first_pass) THEN
502  f_exists = .false.
503  INQUIRE(file=fname_bh,exist=f_exists)
504 ! If the file does not exist, then create it with the necessary
505 ! header information.
506  IF (.NOT.f_exists) THEN
507  OPEN(convert='BIG_ENDIAN',unit=bh_unit,file=fname_bh,&
508  form="formatted",status="new")
509  ELSE
510 ! To prevent overwriting existing files accidently, exit if the file
511 ! exists and this is a NEW run.
512  IF(run_type .EQ. 'NEW') THEN
513  WRITE(*,1000)
514  WRITE(unit_log, 1000)
515  CALL mfix_exit(mype)
516  ELSE
517 ! Open the file for appending of new data (RESTART_1 Case)
518  OPEN(convert='BIG_ENDIAN',unit=bh_unit,file=fname_bh,&
519  position="append")
520  ENDIF
521  ENDIF
522  first_pass = .false.
523  ELSE
524 ! Open the file and mark for appending
525  OPEN(convert='BIG_ENDIAN',unit=bh_unit,file=fname_bh,&
526  position="append")
527  ENDIF
528 
529  WRITE(bh_unit, '(10(2X,E20.12))') s_time, &
530  (bed_height(m), m=mmax+1,mmax+des_mmax), height_avg, height_rms
531 ! Close the file and keep
532  CLOSE(bh_unit, status="KEEP")
533 
534  RETURN
535 
536  1000 FORMAT(/1x,70('*')//, ' From: WRITE_DES_BEDHEIGHT',/,&
537  ' Message: bed_height.dat already exists in the run',&
538  ' directory.',/10x, 'Run terminated to prevent',&
539  ' accidental overwriting of files.',/1x,70('*')/)
540 
541  END SUBROUTINE write_des_bedheight
542 
543 
544 !vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
545 !
546 ! Module name: WRITE_DES_THETA
547 ! Purpose: The following code writes out theta_m for discrete
548 ! particles to a file for each ijk cell in the system each time
549 ! des_granular_temperature is called.
550 !
551 !
552 !^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
553  SUBROUTINE write_des_theta
555  USE param
556  USE param1
557  USE parallel
558  USE fldvar
559  USE discretelement
560  USE run
561  USE geometry
562  USE physprop
563  USE sendrecv
564  USE des_bc
565  USE functions
566  IMPLICIT NONE
567 
568 !-----------------------------------------------
569 ! Local Variables
570 !-----------------------------------------------
571 ! indices
572  INTEGER I, J, K, IJK
573 !
574  INTEGER M, NP
575 ! logical that identifies that the data file has been created
576 ! and is already opened (initial checks/writes)
577  LOGICAL, SAVE :: FIRST_PASS = .true.
578 ! logical used for testing is the data file already exists
579  LOGICAL :: F_EXISTS
580 ! file unit for the granular temperature data
581  INTEGER, PARAMETER :: GT_UNIT = 2020
582 ! output file for the granular temperature data
583  CHARACTER(LEN=50) :: FNAME_GT
584 !-----------------------------------------------
585 
586  fname_gt = trim(run_name)//'_DES_THETA.dat'
587  IF (first_pass) THEN
588  f_exists = .false.
589  INQUIRE(file=fname_gt,exist=f_exists)
590 
591  IF (.NOT.f_exists) THEN
592 ! If the file does not exist, then create it with the necessary
593 ! header information.
594  OPEN(convert='BIG_ENDIAN',unit=gt_unit,file=fname_gt,&
595  status='NEW')
596  ELSE
597  IF(run_type .EQ. 'NEW') THEN
598 ! If the run is new and the GT file already exists replace it with a
599 ! new file.
600 ! OPEN(CONVERT='BIG_ENDIAN',UNIT=GT_UNIT,FILE=FNAME_GT,STATUS='REPLACE')
601 ! Prevent overwriting an existing file by exiting if the file exists
602 ! and this is a NEW run.
603  WRITE(*,1001) fname_gt
604  WRITE(unit_log,1001) fname_gt
605  CALL mfix_exit(mype)
606  ELSE
607 ! Open the file for appending of new data (RESTART_1 Case)
608  OPEN(convert='BIG_ENDIAN',unit=gt_unit, file=fname_gt,&
609  position='APPEND')
610  ENDIF
611  ENDIF
612  first_pass = .false.
613  ELSE
614 ! Open file and mark for appending
615  OPEN(convert='BIG_ENDIAN',unit=gt_unit,file=fname_gt,&
616  position='APPEND')
617  ENDIF ! endif (first_pass)
618 
619  WRITE(gt_unit,*) ''
620  WRITE(gt_unit,'(A6,ES24.16)') 'Time=', s_time
621  WRITE(gt_unit,'(A6,2X,3(A6,2X),A8)',advance="NO") 'IJK', &
622  'I', 'J', 'K', 'NP'
623  DO m = mmax+1,des_mmax+mmax
624  WRITE(gt_unit,'(7X,A6,I1)',advance="NO") 'THETA_',m
625  ENDDO
626  WRITE(gt_unit,*) ''
627  DO ijk = ijkstart3, ijkend3
628  IF(fluid_at(ijk)) THEN
629  i = i_of(ijk)
630  j = j_of(ijk)
631  k = k_of(ijk)
632  np = pinc(ijk)
633  WRITE(gt_unit,'(I6,2X,3(I6,2X),I8,(2X,ES15.5))') &
634  ijk, i, j, k, np, (theta_m(ijk,m), m = mmax+1,des_mmax+mmax)
635  ENDIF
636  ENDDO
637 
638 ! Close the file and keep
639  CLOSE(gt_unit, status='KEEP')
640 
641  RETURN
642 
643  1001 FORMAT(/1x,70('*')//, ' From: WRITE_DES_THETA',/,&
644  ' Message: ', a, ' already exists in the run',/10x,&
645  'directory. Run terminated to prevent accidental overwriting',&
646  /10x,'of files.',/1x,70('*')/)
647 
648  END SUBROUTINE write_des_theta
649 !-----------------------------------------------
integer, dimension(:), allocatable igathercnts
Definition: desmpi_mod.f:48
subroutine vtp_open_file(NoPc)
Definition: vtp_mod.f:237
subroutine calc_des_bedheight
character(len=32) function ivar(VAR, i1, i2, i3)
subroutine write_des_data
logical bdist_io
Definition: cdist_mod.f:4
subroutine write_des_tecplot
double precision, dimension(:), allocatable des_t_s
double precision, dimension(:), allocatable dprocbuf
Definition: desmpi_mod.f:42
subroutine write_des_vtp
character(len=60) run_name
Definition: run_mod.f:24
subroutine get_diameter(OUT_VAR)
integer, dimension(:), allocatable irootbuf
Definition: desmpi_mod.f:43
subroutine vtp_close_file
Definition: vtp_mod.f:364
subroutine write_des_theta
integer numpes
Definition: compar_mod.f:24
integer pe_io
Definition: compar_mod.f:30
subroutine des_granular_temperature
integer mmax
Definition: physprop_mod.f:19
Definition: cdist_mod.f:2
character(len=16) run_type
Definition: run_mod.f:33
integer, dimension(:), allocatable iprocbuf
Definition: desmpi_mod.f:44
double precision, dimension(:,:), allocatable theta_m
Definition: fldvar_mod.f:149
double precision, dimension(:,:), allocatable des_x_s
Definition: des_rxns_mod.f:21
logical any_species_eq
Definition: run_mod.f:118
subroutine write_des_bedheight
Definition: run_mod.f:13
Definition: vtp_mod.f:1
Definition: param_mod.f:2
logical no_k
Definition: geometry_mod.f:28
logical do_k
Definition: geometry_mod.f:30
integer mype
Definition: compar_mod.f:24
subroutine add_vtp_to_pvd
Definition: vtp_mod.f:380
logical energy_eq
Definition: run_mod.f:100
integer, dimension(:), allocatable idispls
Definition: desmpi_mod.f:46
integer igath_sendcnt
Definition: desmpi_mod.f:51
subroutine vtp_write_element(ELEMENT)
Definition: vtp_mod.f:219
logical mppic
Definition: mfix_pic_mod.f:14
double precision, dimension(:), allocatable drootbuf
Definition: desmpi_mod.f:41
integer dimension_n_s
Definition: param_mod.f:21
double precision time
Definition: run_mod.f:45
double precision, dimension(:), allocatable des_stat_wt
Definition: mfix_pic_mod.f:54
double precision, dimension(:), allocatable x
Definition: geometry_mod.f:129
double precision, parameter zero
Definition: param1_mod.f:27