Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PLAG_ModSurfStats.F90
Go to the documentation of this file.
1 ! *********************************************************************
2 ! * Rocstar Simulation Suite *
3 ! * Copyright@2015, Illinois Rocstar LLC. All rights reserved. *
4 ! * *
5 ! * Illinois Rocstar LLC *
6 ! * Champaign, IL *
7 ! * www.illinoisrocstar.com *
8 ! * sales@illinoisrocstar.com *
9 ! * *
10 ! * License: See LICENSE file in top level of distribution package or *
11 ! * http://opensource.org/licenses/NCSA *
12 ! *********************************************************************
13 ! *********************************************************************
14 ! * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, *
15 ! * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES *
16 ! * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND *
17 ! * NONINFRINGEMENT. IN NO EVENT SHALL THE CONTRIBUTORS OR *
18 ! * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
19 ! * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, *
20 ! * Arising FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE *
21 ! * USE OR OTHER DEALINGS WITH THE SOFTWARE. *
22 ! *********************************************************************
23 ! ******************************************************************************
24 !
25 ! Purpose: Collection of routines for particle surface statistics.
26 !
27 ! Description: None.
28 !
29 ! Notes: None.
30 !
31 ! ******************************************************************************
32 !
33 ! $Id: PLAG_ModSurfStats.F90,v 1.13 2008/12/06 08:44:34 mtcampbe Exp $
34 !
35 ! Copyright: (c) 2004 by the University of Illinois
36 !
37 ! ******************************************************************************
38 
40 
41  USE modparameters
42  USE moddatatypes
43  USE modglobal, ONLY: t_global
44  USE modgrid, ONLY: t_grid
46  USE modbndpatch, ONLY: t_patch
47  USE moddatastruct, ONLY: t_region
48  USE moderror
49  USE modmpi
51 
54 
55  IMPLICIT NONE
56 
57 ! ******************************************************************************
58 ! Definitions and declarations
59 ! ******************************************************************************
60 
61 ! ==============================================================================
62 ! Private data
63 ! ==============================================================================
64 
65  CHARACTER(CHRLEN), PRIVATE :: &
66  RCSIdentString = '$RCSfile: PLAG_ModSurfStats.F90,v $ $Revision: 1.13 $'
67 
68 ! ==============================================================================
69 ! Public functions
70 ! ==============================================================================
71 
72  PUBLIC :: plag_createsurfstats, &
77 
78 ! ==============================================================================
79 ! Private functions
80 ! ==============================================================================
81 
82  PRIVATE :: plag_closesurfstats, &
98 
99 ! ******************************************************************************
100 ! Routines
101 ! ******************************************************************************
102 
103  CONTAINS
104 
105 
106 
107 
108 
109 ! *******************************************************************************
110 !
111 ! Purpose: Close surface statitstics file.
112 !
113 ! Description: None.
114 !
115 ! Input:
116 ! pRegion Pointer to region
117 !
118 ! Output: None.
119 !
120 ! Notes: None.
121 !
122 ! ******************************************************************************
123 
124  SUBROUTINE plag_closesurfstats(pRegion)
125 
126  IMPLICIT NONE
127 
128 ! ******************************************************************************
129 ! Declarations and definitions
130 ! ******************************************************************************
131 
132 ! ==============================================================================
133 ! Arguments
134 ! ==============================================================================
135 
136  TYPE(t_region), POINTER :: pregion
137 
138 ! ==============================================================================
139 ! Locals
140 ! ==============================================================================
141 
142  INTEGER :: errorflag,ifile
143  TYPE(t_global), POINTER :: global
144 
145 ! ******************************************************************************
146 ! Start, set pointers and variables
147 ! ******************************************************************************
148 
149  global => pregion%global
150 
151  CALL registerfunction(global,'PLAG_CloseSurfStats',&
152  'PLAG_ModSurfStats.F90')
153 
154  IF ( global%myProcid == masterproc .AND. &
155  global%verbLevel > verbose_none ) THEN
156  WRITE(stdout,'(A,1X,A)') solver_name, &
157  'Closing PLAG surface statistics file...'
158  END IF ! global%verbLevel
159 
160  ifile = if_plag_surf_stats
161 
162 ! ******************************************************************************
163 ! Close file
164 ! ******************************************************************************
165 
166  CLOSE(ifile,iostat=errorflag)
167  global%error = errorflag
168  IF ( global%error /= err_none ) THEN
169  CALL errorstop(global,err_file_close,__line__)
170  END IF ! global%error
171 
172 ! ******************************************************************************
173 ! End
174 ! ******************************************************************************
175 
176  IF ( global%myProcid == masterproc .AND. &
177  global%verbLevel > verbose_none ) THEN
178  WRITE(stdout,'(A,1X,A)') solver_name, &
179  'Closing PLAG surface statistics file done.'
180  END IF ! global%verbLevel
181 
182  CALL deregisterfunction(global)
183 
184  END SUBROUTINE plag_closesurfstats
185 
186 
187 
188 
189 
190 
191 ! *******************************************************************************
192 !
193 ! Purpose: Create surface statistics.
194 !
195 ! Description: None.
196 !
197 ! Input:
198 ! pRegion Pointer to region
199 !
200 ! Output: None.
201 !
202 ! Notes: None.
203 !
204 ! ******************************************************************************
205 
206  SUBROUTINE plag_createsurfstats(pRegion)
207 
208  IMPLICIT NONE
209 
210 ! ******************************************************************************
211 ! Declarations and definitions
212 ! ******************************************************************************
213 
214 ! ==============================================================================
215 ! Arguments
216 ! ==============================================================================
217 
218  TYPE(t_region), POINTER :: pregion
219 
220 ! ==============================================================================
221 ! Locals
222 ! ==============================================================================
223 
224  INTEGER :: errorflag,ipatch
225  TYPE(t_global), POINTER :: global
226  TYPE(t_grid), POINTER :: pgrid
227  TYPE(t_patch), POINTER :: ppatch
228 
229 ! ******************************************************************************
230 ! Start, set pointers and variables
231 ! ******************************************************************************
232 
233  global => pregion%global
234 
235  CALL registerfunction(global,'PLAG_CreateSurfStats',&
236  'PLAG_ModSurfStats.F90')
237 
238  pgrid => pregion%grid
239 
240 ! ******************************************************************************
241 ! Allocate memory
242 ! ******************************************************************************
243 
244 ! ==============================================================================
245 ! Patch data
246 ! ==============================================================================
247 
248  DO ipatch = 1,pgrid%nPatches
249  ppatch => pregion%patches(ipatch)
250 
251  IF ( ppatch%plotStatsFlag .EQV. .true. ) THEN
252  ALLOCATE(ppatch%statsPlag(ppatch%nBFaces),stat=errorflag)
253  global%error = errorflag
254  IF ( global%error /= err_none ) THEN
255  CALL errorstop(global,err_allocate,__line__,'pPatch%statsPlag')
256  END IF ! global%error
257 
258  CALL plag_createsurfstatskernel(pregion,ppatch%statsPlag)
259  END IF ! pPatch%plotStatsFlag
260  END DO ! iPatch
261 
262 ! ==============================================================================
263 ! Plane data
264 ! ==============================================================================
265 
266 ! ******************************************************************************
267 ! Initialize memory
268 ! ******************************************************************************
269 
270 ! ==============================================================================
271 ! Patch data
272 ! ==============================================================================
273 
274  DO ipatch = 1,pgrid%nPatches
275  ppatch => pregion%patches(ipatch)
276  IF ( ppatch%plotStatsFlag .EQV. .true. ) THEN
277  CALL plag_initsurfstats(pregion,ppatch%statsPlag)
278  END IF ! pPatch%plotStatsFlag
279  END DO ! iPatch
280 
281 ! ==============================================================================
282 ! Plane data
283 ! ==============================================================================
284 
285 ! ******************************************************************************
286 ! End
287 ! ******************************************************************************
288 
289  CALL deregisterfunction(global)
290 
291  END SUBROUTINE plag_createsurfstats
292 
293 
294 
295 
296 
297 
298 ! *******************************************************************************
299 !
300 ! Purpose: Kernel to create surface statistics.
301 !
302 ! Description: None.
303 !
304 ! Input:
305 ! pRegion Pointer to region
306 ! pStatsPlag Pointer to statsPlag
307 !
308 ! Output: None.
309 !
310 ! Notes: None.
311 !
312 ! ******************************************************************************
313 
314  SUBROUTINE plag_createsurfstatskernel(pRegion,pStatsPlag)
315 
316  IMPLICIT NONE
317 
318 ! ******************************************************************************
319 ! Declarations and definitions
320 ! ******************************************************************************
321 
322 ! ==============================================================================
323 ! Arguments
324 ! ==============================================================================
325 
326  TYPE(t_region), POINTER :: pregion
327  TYPE(t_surfstats_plag), DIMENSION(:), POINTER :: pstatsplag
328 
329 ! ==============================================================================
330 ! Locals
331 ! ==============================================================================
332 
333  INTEGER :: errorflag,ifl,nbfaces,nbins,ncont,nvars
334 
335  TYPE(t_global), POINTER :: global
336 
337 ! ******************************************************************************
338 ! Start, set pointers and variables
339 ! ******************************************************************************
340 
341  global => pregion%global
342 
343  CALL registerfunction(global,'PLAG_CreateSurfStatsKernel',&
344  'PLAG_ModSurfStats.F90')
345 
346  nbfaces = SIZE(pstatsplag,dim=1)
347 
348  ncont = pregion%plagInput%nCont
349  nvars = plag_surf_stats_last +ncont
350 
351 ! TEMPORARY
352  nbins = 20
353 ! nBins = pRegion%plagInput%nBins
354 ! END TEMPORARY
355 
356 ! ******************************************************************************
357 ! Allocate memory
358 ! ******************************************************************************
359 
360  DO ifl = 1,nbfaces
361  ALLOCATE(pstatsplag(ifl)%nHits(nbins),stat=errorflag)
362  global%error = errorflag
363  IF ( global%error /= err_none ) THEN
364  CALL errorstop(global,err_allocate,__line__,'pStatsPlag%nHits')
365  END IF ! global%error
366 
367  ALLOCATE(pstatsplag(ifl)%vars(nvars,nbins),stat=errorflag)
368  global%error = errorflag
369  IF ( global%error /= err_none ) THEN
370  CALL errorstop(global,err_allocate,__line__,'pStatsPlag%vars')
371  END IF ! global%error
372  END DO ! ifl
373 
374 ! ******************************************************************************
375 ! End
376 ! ******************************************************************************
377 
378  CALL deregisterfunction(global)
379 
380  END SUBROUTINE plag_createsurfstatskernel
381 
382 
383 
384 
385 
386 
387 ! *******************************************************************************
388 !
389 ! Purpose: Destroy surface statistics.
390 !
391 ! Description: None.
392 !
393 ! Input:
394 ! pRegion Pointer to region
395 !
396 ! Output: None.
397 !
398 ! Notes: None.
399 !
400 ! ******************************************************************************
401 
402  SUBROUTINE plag_destroysurfstats(pRegion)
403 
404  IMPLICIT NONE
405 
406 ! ******************************************************************************
407 ! Declarations and definitions
408 ! ******************************************************************************
409 
410 ! ==============================================================================
411 ! Arguments
412 ! ==============================================================================
413 
414  TYPE(t_region), POINTER :: pregion
415 
416 ! ==============================================================================
417 ! Locals
418 ! ==============================================================================
419 
420  INTEGER :: errorflag,ipatch
421  TYPE(t_global), POINTER :: global
422  TYPE(t_grid), POINTER :: pgrid
423  TYPE(t_patch), POINTER :: ppatch
424 
425 ! ******************************************************************************
426 ! Start, set pointers and variables
427 ! ******************************************************************************
428 
429  global => pregion%global
430 
431  CALL registerfunction(global,'PLAG_DestroySurfStats',&
432  'PLAG_ModSurfStats.F90')
433 
434  pgrid => pregion%grid
435 
436 ! ******************************************************************************
437 ! Deallocate memory
438 ! ******************************************************************************
439 
440  DO ipatch = 1,pgrid%nPatches
441  ppatch => pregion%patches(ipatch)
442 
443  IF ( ppatch%plotStatsFlag .EQV. .true. ) THEN
444  CALL plag_destroysurfstatskernel(global,ppatch%statsPlag)
445 
446  DEALLOCATE(ppatch%statsPlag,stat=errorflag)
447  global%error = errorflag
448  IF ( global%error /= err_none ) THEN
449  CALL errorstop(global,err_deallocate,__line__,'pPatch%statsPlag')
450  END IF ! global%error
451  END IF ! pPatch%plotStatsFlag
452  END DO ! iPatch
453 
454 ! ******************************************************************************
455 ! Nullify memory
456 ! ******************************************************************************
457 
458  CALL plag_nullifysurfstats(pregion)
459 
460 ! ******************************************************************************
461 ! End
462 ! ******************************************************************************
463 
464  CALL deregisterfunction(global)
465 
466  END SUBROUTINE plag_destroysurfstats
467 
468 
469 
470 
471 
472 
473 ! *******************************************************************************
474 !
475 ! Purpose: Kernel to destroy surface statistics.
476 !
477 ! Description: None.
478 !
479 ! Input:
480 ! global Pointer to global
481 ! pStatsPlag Pointer to statsPlag
482 !
483 ! Output: None.
484 !
485 ! Notes: None.
486 !
487 ! ******************************************************************************
488 
489  SUBROUTINE plag_destroysurfstatskernel(global,pStatsPlag)
490 
491  IMPLICIT NONE
492 
493 ! ******************************************************************************
494 ! Declarations and definitions
495 ! ******************************************************************************
496 
497 ! ==============================================================================
498 ! Arguments
499 ! ==============================================================================
500 
501  TYPE(t_global), POINTER :: global
502  TYPE(t_surfstats_plag), DIMENSION(:), POINTER :: pstatsplag
503 
504 ! ==============================================================================
505 ! Locals
506 ! ==============================================================================
507 
508  INTEGER :: errorflag,ifl,nbfaces
509 
510 ! ******************************************************************************
511 ! Start, set pointers and variables
512 ! ******************************************************************************
513 
514  CALL registerfunction(global,'PLAG_DestroySurfStatsKernel',&
515  'PLAG_ModSurfStats.F90')
516 
517  nbfaces = SIZE(pstatsplag,dim=1)
518 
519 ! ******************************************************************************
520 ! Deallocate memory
521 ! ******************************************************************************
522 
523  DO ifl = 1,nbfaces
524  DEALLOCATE(pstatsplag(ifl)%nHits,stat=errorflag)
525  global%error = errorflag
526  IF ( global%error /= err_none ) THEN
527  CALL errorstop(global,err_deallocate,__line__,'pStatsPlag%nHits')
528  END IF ! global%error
529 
530  DEALLOCATE(pstatsplag(ifl)%vars,stat=errorflag)
531  global%error = errorflag
532  IF ( global%error /= err_none ) THEN
533  CALL errorstop(global,err_deallocate,__line__,'pPatch%statsPlag%vars')
534  END IF ! global%error
535  END DO ! ifl
536 
537 ! ******************************************************************************
538 ! End
539 ! ******************************************************************************
540 
541  CALL deregisterfunction(global)
542 
543  END SUBROUTINE plag_destroysurfstatskernel
544 
545 
546 
547 
548 
549 
550 ! *******************************************************************************
551 !
552 ! Purpose: Gather surface statistics.
553 !
554 ! Description: None.
555 !
556 ! Input:
557 ! pRegion Pointer to region
558 ! pPlag Pointer to plag
559 ! pStatsPlag Pointer to statsPlag
560 ! ifl Local face index
561 ! iPcl Particle index
562 !
563 ! Output: None.
564 !
565 ! Notes: None.
566 !
567 ! ******************************************************************************
568 
569  SUBROUTINE plag_gathersurfstats(pRegion,pPlag,pStatsPlag,ifl,iPcl,thetaAngle)
570 
571  IMPLICIT NONE
572 
573 ! ******************************************************************************
574 ! Declarations and definitions
575 ! ******************************************************************************
576 
577 ! ==============================================================================
578 ! Arguments
579 ! ==============================================================================
580 
581  TYPE(t_region), POINTER :: pregion
582  TYPE(t_plag), POINTER :: pplag
583  TYPE(t_surfstats_plag), DIMENSION(:), POINTER :: pstatsplag
584 
585  INTEGER,INTENT(IN) :: ifl,ipcl
586  REAL(KIND=RFREAL),INTENT(IN) :: thetaangle
587 
588 ! ==============================================================================
589 ! Locals
590 ! ==============================================================================
591 
592  INTEGER :: binmethod,errorflag,ibin,icont,nbins,ncont
593  REAL(KIND=RFREAL) :: diambin,diamminmicron,diammaxmicron,diamplagmicron, &
594  enerplag,massplag,momemagnplag
595 
596  TYPE(t_global), POINTER :: global
597 
598 ! ******************************************************************************
599 ! Start, set pointers and variables
600 ! ******************************************************************************
601 
602  global => pregion%global
603 
604  CALL registerfunction(global,'PLAG_GatherSurfStats',&
605  'PLAG_ModSurfStats.F90')
606 
607  ncont = pregion%plagInput%nCont
608 
609 ! TEMPORARY
610  nbins = 20
611 ! nBins = pRegion%plagInput%nBins
612 ! END TEMPORARY
613 
614 ! TEMPORARY
615  binmethod = bin_method_linear
616 ! binMethod = pRegion%plagInput%binMethod
617 ! END TEMPORARY
618 
619 ! TEMPORARY
620  diamminmicron = 10.0_rfreal
621  diammaxmicron = 210.0_rfreal
622  diambin = (diammaxmicron-diamminmicron)/REAL(nbins,kind=rfreal)
623 ! END TEMPORARY
624 
625  diamplagmicron = pplag%dv(dv_plag_diam,ipcl)*1.0e+6_rfreal
626 
627  massplag = sum( pplag%cv(pplag%cvPlagMass(:),ipcl) )
628 
629  momemagnplag = sqrt( pplag%cv(cv_plag_xmom,ipcl)**2.0_rfreal &
630  +pplag%cv(cv_plag_ymom,ipcl)**2.0_rfreal &
631  +pplag%cv(cv_plag_zmom,ipcl)**2.0_rfreal )
632 
633  enerplag = pplag%cv(cv_plag_ener,ipcl)
634 
635 ! ******************************************************************************
636 ! Gather statistics
637 ! ******************************************************************************
638 
639 ! ==============================================================================
640 ! Determine bin
641 ! ==============================================================================
642 
643  ibin = plag_setbinindex(global,binmethod,nbins,diamplagmicron,diambin, &
644  diamminmicron,diammaxmicron)
645 
646 ! ==============================================================================
647 ! Cummulate data on bins
648 ! ==============================================================================
649 
650  pstatsplag(ifl)%nHits(ibin) = pstatsplag(ifl)%nHits(ibin) +1
651 
652  pstatsplag(ifl)%vars(plag_surf_stats_diam3,ibin) = &
653  pstatsplag(ifl)%vars(plag_surf_stats_diam3,ibin) +diamplagmicron**3.0_rfreal
654 
655  pstatsplag(ifl)%vars(plag_surf_stats_diam4,ibin) = &
656  pstatsplag(ifl)%vars(plag_surf_stats_diam4,ibin) +diamplagmicron**4.0_rfreal
657 
658  pstatsplag(ifl)%vars(plag_surf_stats_theta,ibin) = &
659  pstatsplag(ifl)%vars(plag_surf_stats_theta,ibin) +thetaangle
660 
661  pstatsplag(ifl)%vars(plag_surf_stats_mome1,ibin) = &
662  pstatsplag(ifl)%vars(plag_surf_stats_mome1,ibin) +momemagnplag
663 
664  pstatsplag(ifl)%vars(plag_surf_stats_mome2,ibin) = &
665  pstatsplag(ifl)%vars(plag_surf_stats_mome2,ibin) +momemagnplag**2.0_rfreal
666 
667  pstatsplag(ifl)%vars(plag_surf_stats_ener,ibin) = &
668  pstatsplag(ifl)%vars(plag_surf_stats_ener,ibin) +enerplag
669 
670  pstatsplag(ifl)%vars(plag_surf_stats_mass,ibin) = &
671  pstatsplag(ifl)%vars(plag_surf_stats_mass,ibin) +massplag
672 
673  DO icont = 1, ncont
674  pstatsplag(ifl)%vars(plag_surf_stats_last+icont,ibin) = &
675  pstatsplag(ifl)%vars(plag_surf_stats_last+icont,ibin) &
676  +pplag%cv(pplag%cvPlagMass(icont),ipcl)
677  END DO ! iCont
678 
679 ! ******************************************************************************
680 ! End
681 ! ******************************************************************************
682 
683  CALL deregisterfunction(global)
684 
685  END SUBROUTINE plag_gathersurfstats
686 
687 
688 
689 
690 
691 
692 ! *******************************************************************************
693 !
694 ! Purpose: Initialize surface statistics.
695 !
696 ! Description: None.
697 !
698 ! Input:
699 ! pRegion Pointer to region
700 ! pStatsPlag Pointer to statsPlag
701 !
702 ! Output: None.
703 !
704 ! Notes: None.
705 !
706 ! ******************************************************************************
707 
708  SUBROUTINE plag_initsurfstats(pRegion,pStatsPlag)
709 
710  IMPLICIT NONE
711 
712 ! ******************************************************************************
713 ! Declarations and definitions
714 ! ******************************************************************************
715 
716 ! ==============================================================================
717 ! Arguments
718 ! ==============================================================================
719 
720  TYPE(t_region), POINTER :: pregion
721  TYPE(t_surfstats_plag), DIMENSION(:), POINTER :: pstatsplag
722 
723 ! ==============================================================================
724 ! Locals
725 ! ==============================================================================
726 
727  INTEGER :: errorflag,ibin,ifl,ipatch,ivar,nbfaces,nbins,ncont,nvars
728 
729  TYPE(t_global), POINTER :: global
730 
731 ! ******************************************************************************
732 ! Start, set pointers and variables
733 ! ******************************************************************************
734 
735  global => pregion%global
736 
737  CALL registerfunction(global,'PLAG_InitSurfStats',&
738  'PLAG_ModSurfStats.F90')
739 
740  nbfaces = SIZE(pstatsplag,dim=1)
741 
742  ncont = pregion%plagInput%nCont
743  nvars = plag_surf_stats_last +ncont
744 
745 ! TEMPORARY
746  nbins = 20
747 ! nBins = pRegion%plagInput%nBins
748 ! END TEMPORARY
749 
750 ! ******************************************************************************
751 ! Initialize memory
752 ! ******************************************************************************
753 
754  DO ifl = 1,nbfaces
755  DO ibin = 1, nbins
756  pstatsplag(ifl)%nHits(ibin) = 0
757  END DO ! iBin
758 
759  DO ibin = 1, nbins
760  DO ivar = 1, nvars
761  pstatsplag(ifl)%vars(ivar,ibin) = 0.0_rfreal
762  END DO ! iVar
763  END DO ! iBin
764  END DO ! ifl
765 
766 ! ******************************************************************************
767 ! End
768 ! ******************************************************************************
769 
770  CALL deregisterfunction(global)
771 
772  END SUBROUTINE plag_initsurfstats
773 
774 
775 
776 
777 
778 
779 ! *******************************************************************************
780 !
781 ! Purpose: Nullify surface statistics.
782 !
783 ! Description: None.
784 !
785 ! Input:
786 ! pRegion Pointer to region
787 !
788 ! Output: None.
789 !
790 ! Notes: None.
791 !
792 ! ******************************************************************************
793 
794  SUBROUTINE plag_nullifysurfstats(pRegion)
795 
796  IMPLICIT NONE
797 
798 ! ******************************************************************************
799 ! Declarations and definitions
800 ! ******************************************************************************
801 
802 ! ==============================================================================
803 ! Arguments
804 ! ==============================================================================
805 
806  TYPE(t_region), POINTER :: pregion
807 
808 ! ==============================================================================
809 ! Locals
810 ! ==============================================================================
811 
812  INTEGER :: errorflag,ipatch
813  TYPE(t_global), POINTER :: global
814  TYPE(t_grid), POINTER :: pgrid
815  TYPE(t_patch), POINTER :: ppatch
816 
817 ! ******************************************************************************
818 ! Start, set pointers and variables
819 ! ******************************************************************************
820 
821  global => pregion%global
822 
823  CALL registerfunction(global,'PLAG_DestroySurfStats',&
824  'PLAG_ModSurfStats.F90')
825 
826  pgrid => pregion%grid
827 
828 ! ******************************************************************************
829 ! Nullify pointer
830 ! ******************************************************************************
831 
832 ! ==============================================================================
833 ! Patch data
834 ! ==============================================================================
835 
836  DO ipatch = 1,pgrid%nPatches
837  ppatch => pregion%patches(ipatch)
838 
839  IF ( ppatch%plotStatsFlag .EQV. .true. ) THEN
840  nullify(ppatch%statsPlag)
841  END IF ! pPatch%plotStatsFlag
842  END DO ! iPatch
843 
844 ! ==============================================================================
845 ! Plane data
846 ! ==============================================================================
847 
848 ! ******************************************************************************
849 ! End
850 ! ******************************************************************************
851 
852  CALL deregisterfunction(global)
853 
854  END SUBROUTINE plag_nullifysurfstats
855 
856 
857 
858 
859 
860 
861 ! *******************************************************************************
862 !
863 ! Purpose: Open surface statistics file in ASCII format.
864 !
865 ! Description: None.
866 !
867 ! Input:
868 ! pRegion Pointer to region
869 ! fileStatus File status
870 !
871 ! Output:
872 ! fileExists Flag indicating existence of file
873 !
874 ! Notes:
875 ! 1. File may not exist when it is opened in postprocessor before solver
876 ! was run, so need to deal with this gracefully.
877 !
878 ! ******************************************************************************
879 
880  SUBROUTINE plag_opensurfstatsascii(pRegion,fileStatus,fileExists)
881 
882  IMPLICIT NONE
883 
884 ! ******************************************************************************
885 ! Declarations and definitions
886 ! ******************************************************************************
887 
888 ! ==============================================================================
889 ! Arguments
890 ! ==============================================================================
891 
892  INTEGER, INTENT(IN) :: filestatus
893  LOGICAL, INTENT(OUT), OPTIONAL :: fileexists
894  TYPE(t_region), POINTER :: pregion
895 
896 ! ==============================================================================
897 ! Locals
898 ! ==============================================================================
899 
900  CHARACTER(CHRLEN) :: ifilename
901  INTEGER :: errorflag,ifile
902  TYPE(t_global), POINTER :: global
903 
904 ! ******************************************************************************
905 ! Start, set pointers and variables
906 ! ******************************************************************************
907 
908  global => pregion%global
909 
910  CALL registerfunction(global,'PLAG_OpenSurfStatsASCII',&
911  'PLAG_ModSurfStats.F90')
912 
913  IF ( global%myProcid == masterproc .AND. &
914  global%verbLevel > verbose_none ) THEN
915  WRITE(stdout,'(A,1X,A)') solver_name, &
916  'Opening ASCII PLAG surface statistics file...'
917  END IF ! global%verbLevel
918 
919  ifile = if_plag_surf_stats
920 
921 ! ******************************************************************************
922 ! Build file name
923 ! ******************************************************************************
924 
925  CALL buildfilenameunsteady(global,filedest_outdir,'.plag_ssta', &
926  pregion%iRegionGlobal,global%currentTime, &
927  ifilename)
928 
929  IF ( global%myProcid == masterproc .AND. &
930  global%verbLevel > verbose_none ) THEN
931  WRITE(stdout,'(A,3X,A,1X,I5.5)') solver_name,'Global region:', &
932  pregion%iRegionGlobal
933  WRITE(stdout,'(A,3X,A,1X,1PE11.5)') solver_name,'Current time:', &
934  global%currentTime
935  END IF ! global%verbLevel
936 
937 ! ******************************************************************************
938 ! Open file
939 ! ******************************************************************************
940 
941  IF ( filestatus == file_status_old ) THEN
942  INQUIRE(file=ifilename,exist=fileexists)
943 
944  IF ( fileexists .EQV. .true. ) THEN
945  OPEN(ifile,file=ifilename,form="FORMATTED",status="OLD", &
946  iostat=errorflag)
947  global%error = errorflag
948  IF ( global%error /= err_none ) THEN
949  CALL errorstop(global,err_file_open,__line__,ifilename)
950  END IF ! global%error
951  END IF ! fileExists
952  ELSE IF ( filestatus == file_status_unknown ) THEN
953  OPEN(ifile,file=ifilename,form="FORMATTED",status="UNKNOWN", &
954  iostat=errorflag)
955  global%error = errorflag
956  IF ( global%error /= err_none ) THEN
957  CALL errorstop(global,err_file_open,__line__,ifilename)
958  END IF ! global%error
959  ELSE
960  CALL errorstop(global,err_reached_default,__line__)
961  END IF ! fileStatus
962 
963 ! ******************************************************************************
964 ! End
965 ! ******************************************************************************
966 
967  IF ( global%myProcid == masterproc .AND. &
968  global%verbLevel > verbose_none ) THEN
969  WRITE(stdout,'(A,1X,A)') solver_name, &
970  'Opening ASCII PLAG surface statistics file done.'
971  END IF ! global%verbLevel
972 
973  CALL deregisterfunction(global)
974 
975  END SUBROUTINE plag_opensurfstatsascii
976 
977 
978 
979 
980 
981 
982 ! *******************************************************************************
983 !
984 ! Purpose: Open surface statistics file in binary format.
985 !
986 ! Description: None.
987 !
988 ! Input:
989 ! pRegion Pointer to region
990 ! fileStatus File status
991 !
992 ! Output:
993 ! fileExists Flag indicating existence of file
994 !
995 ! Notes:
996 ! 1. File may not exist when it is opened in postprocessor before solver
997 ! was run, so need to deal with this gracefully.
998 !
999 ! ******************************************************************************
1000 
1001  SUBROUTINE plag_opensurfstatsbinary(pRegion,fileStatus,fileExists)
1002 
1003  IMPLICIT NONE
1004 
1005 ! ******************************************************************************
1006 ! Declarations and definitions
1007 ! ******************************************************************************
1008 
1009 ! ==============================================================================
1010 ! Arguments
1011 ! ==============================================================================
1012 
1013  INTEGER, INTENT(IN) :: filestatus
1014  LOGICAL, INTENT(OUT), OPTIONAL :: fileexists
1015  TYPE(t_region), POINTER :: pregion
1016 
1017 ! ==============================================================================
1018 ! Locals
1019 ! ==============================================================================
1020 
1021  CHARACTER(CHRLEN) :: ifilename
1022  INTEGER :: errorflag,ifile
1023  TYPE(t_global), POINTER :: global
1024 
1025 ! ******************************************************************************
1026 ! Start, set pointers and variables
1027 ! ******************************************************************************
1028 
1029  global => pregion%global
1030 
1031  CALL registerfunction(global,'PLAG_OpenSurfStatsBinary',&
1032  'PLAG_ModSurfStats.F90')
1033 
1034  IF ( global%myProcid == masterproc .AND. &
1035  global%verbLevel > verbose_none ) THEN
1036  WRITE(stdout,'(A,1X,A)') solver_name, &
1037  'Opening binary PLAG surface statistics file...'
1038  END IF ! global%verbLevel
1039 
1040  ifile = if_plag_surf_stats
1041 
1042 ! ******************************************************************************
1043 ! Build file name
1044 ! ******************************************************************************
1045 
1046  CALL buildfilenameunsteady(global,filedest_outdir,'.plag_sst', &
1047  pregion%iRegionGlobal,global%currentTime, &
1048  ifilename)
1049 
1050  IF ( global%myProcid == masterproc .AND. &
1051  global%verbLevel > verbose_none ) THEN
1052  WRITE(stdout,'(A,3X,A,1X,I5.5)') solver_name,'Global region:', &
1053  pregion%iRegionGlobal
1054  WRITE(stdout,'(A,3X,A,1X,1PE11.5)') solver_name,'Current time:', &
1055  global%currentTime
1056  END IF ! global%verbLevel
1057 
1058 ! ******************************************************************************
1059 ! Open file
1060 ! ******************************************************************************
1061 
1062  IF ( filestatus == file_status_old ) THEN
1063  INQUIRE(file=ifilename,exist=fileexists)
1064 
1065  IF ( fileexists .EQV. .true. ) THEN
1066  OPEN(ifile,file=ifilename,form="UNFORMATTED",status="OLD", &
1067  iostat=errorflag)
1068  global%error = errorflag
1069  IF ( global%error /= err_none ) THEN
1070  CALL errorstop(global,err_file_open,__line__,ifilename)
1071  END IF ! global%error
1072  END IF ! fileExists
1073  ELSE IF ( filestatus == file_status_unknown ) THEN
1074  OPEN(ifile,file=ifilename,form="UNFORMATTED",status="UNKNOWN", &
1075  iostat=errorflag)
1076  global%error = errorflag
1077  IF ( global%error /= err_none ) THEN
1078  CALL errorstop(global,err_file_open,__line__,ifilename)
1079  END IF ! global%error
1080  ELSE
1081  CALL errorstop(global,err_reached_default,__line__)
1082  END IF ! fileStatus
1083 
1084 ! ******************************************************************************
1085 ! End
1086 ! ******************************************************************************
1087 
1088  IF ( global%myProcid == masterproc .AND. &
1089  global%verbLevel > verbose_none ) THEN
1090  WRITE(stdout,'(A,1X,A)') solver_name, &
1091  'Opening binary PLAG surface statistics file done.'
1092  END IF ! global%verbLevel
1093 
1094  CALL deregisterfunction(global)
1095 
1096  END SUBROUTINE plag_opensurfstatsbinary
1097 
1098 
1099 
1100 
1101 
1102 
1103 ! *******************************************************************************
1104 !
1105 ! Purpose: Read surface statistics in ASCII format.
1106 !
1107 ! Description: None.
1108 !
1109 ! Input:
1110 ! pRegion Pointer to region
1111 !
1112 ! Output: None.
1113 !
1114 ! Notes: None.
1115 !
1116 ! ******************************************************************************
1117 
1118  SUBROUTINE plag_readsurfstatsascii(pRegion)
1119 
1120  IMPLICIT NONE
1121 
1122 ! ******************************************************************************
1123 ! Declarations and definitions
1124 ! ******************************************************************************
1125 
1126 ! ==============================================================================
1127 ! Arguments
1128 ! ==============================================================================
1129 
1130  TYPE(t_region), POINTER :: pregion
1131 
1132 ! ==============================================================================
1133 ! Locals
1134 ! ==============================================================================
1135 
1136  CHARACTER(CHRLEN) :: ifilename,sectionstring
1137  INTEGER :: errorflag,ifile,ifl,ipatch,loopcounter
1138  TYPE(t_global), POINTER :: global
1139  TYPE(t_grid), POINTER :: pgrid
1140  TYPE(t_patch), POINTER :: ppatch
1141 
1142 ! ******************************************************************************
1143 ! Start, set pointers and variables
1144 ! ******************************************************************************
1145 
1146  global => pregion%global
1147 
1148  CALL registerfunction(global,'PLAG_ReadSurfStatsASCII',&
1149  'PLAG_ModSurfStats.F90')
1150 
1151  IF ( global%myProcid == masterproc .AND. &
1152  global%verbLevel > verbose_none ) THEN
1153  WRITE(stdout,'(A,1X,A)') solver_name, &
1154  'Reading ASCII PLAG surface statistics file...'
1155  END IF ! global%verbLevel
1156 
1157  pgrid => pregion%grid
1158 
1159  ifile = if_plag_surf_stats
1160 
1161 ! ******************************************************************************
1162 ! Header and general information
1163 ! ******************************************************************************
1164 
1165  IF ( global%myProcid == masterproc .AND. &
1166  global%verbLevel > verbose_low ) THEN
1167  WRITE(stdout,'(A,3X,A)') solver_name,'Header information...'
1168  END IF ! global%verbLevel
1169 
1170  READ(ifile,'(A)') sectionstring
1171  IF ( trim(sectionstring) /= '# ROCFLU surface statistics file' ) THEN
1172  CALL errorstop(global,err_invalid_marker,__line__,sectionstring)
1173  END IF ! TRIM
1174 
1175 ! ******************************************************************************
1176 ! Read rest of file
1177 ! ******************************************************************************
1178 
1179  loopcounter = 0
1180 
1181  DO ! set up infinite loop
1182  loopcounter = loopcounter + 1
1183 
1184  READ(ifile,'(A)') sectionstring
1185 
1186  SELECT CASE ( trim(sectionstring) )
1187 
1188 ! ==============================================================================
1189 ! Patch data
1190 ! ==============================================================================
1191 
1192  CASE ( '# Patch' )
1193  IF ( global%myProcid == masterproc .AND. &
1194  global%verbLevel > verbose_low ) THEN
1195  WRITE(stdout,'(A,3X,A)') solver_name,'Patch...'
1196  END IF ! global%verbLevel
1197 
1198  DO ipatch = 1,pgrid%nPatches
1199  ppatch => pregion%patches(ipatch)
1200  IF ( ppatch%plotStatsFlag .EQV. .true. ) THEN
1201  CALL plag_readsurfstatskernelascii(pregion,ppatch%statsPlag)
1202  END IF ! pPatch%plotStatsFlag
1203  END DO ! iPatch
1204 
1205 ! ==============================================================================
1206 ! Plane data
1207 ! ==============================================================================
1208 
1209 ! ==============================================================================
1210 ! End marker
1211 ! ==============================================================================
1212 
1213  CASE ( '# End' )
1214  IF ( global%myProcid == masterproc .AND. &
1215  global%verbLevel > verbose_low ) THEN
1216  WRITE(stdout,'(A,3X,A)') solver_name,'End marker...'
1217  END IF ! global%verbLevel
1218 
1219  EXIT
1220 
1221 ! ==============================================================================
1222 ! Invalid section string
1223 ! ==============================================================================
1224 
1225  CASE default
1226  IF ( global%verbLevel > verbose_low ) THEN
1227  WRITE(stdout,'(A,3X,A)') solver_name,sectionstring
1228  END IF ! verbosityLevel
1229 
1230  CALL errorstop(global,err_invalid_marker,__line__,sectionstring)
1231  END SELECT ! TRIM
1232 
1233 ! ==============================================================================
1234 ! Guard against infinite loop - unnecessary because of read errors?
1235 ! ==============================================================================
1236 
1237  IF ( loopcounter >= limit_infinite_loop ) THEN
1238  CALL errorstop(global,err_infinite_loop,__line__)
1239  END IF ! loopCounter
1240  END DO ! <empty>
1241 
1242 ! ******************************************************************************
1243 ! End
1244 ! ******************************************************************************
1245 
1246  IF ( global%myProcid == masterproc .AND. &
1247  global%verbLevel > verbose_none ) THEN
1248  WRITE(stdout,'(A,1X,A)') solver_name, &
1249  'Reading ASCII PLAG surface statistics file done.'
1250  END IF ! global%verbLevel
1251 
1252  CALL deregisterfunction(global)
1253 
1254  END SUBROUTINE plag_readsurfstatsascii
1255 
1256 
1257 
1258 
1259 
1260 
1261 ! *******************************************************************************
1262 !
1263 ! Purpose: Read surface statistics in binary format.
1264 !
1265 ! Description: None.
1266 !
1267 ! Input:
1268 ! pRegion Pointer to region
1269 !
1270 ! Output: None.
1271 !
1272 ! Notes: None.
1273 !
1274 ! ******************************************************************************
1275 
1276  SUBROUTINE plag_readsurfstatsbinary(pRegion)
1277 
1278  IMPLICIT NONE
1279 
1280 ! ******************************************************************************
1281 ! Declarations and definitions
1282 ! ******************************************************************************
1283 
1284 ! ==============================================================================
1285 ! Arguments
1286 ! ==============================================================================
1287 
1288  TYPE(t_region), POINTER :: pregion
1289 
1290 ! ==============================================================================
1291 ! Locals
1292 ! ==============================================================================
1293 
1294  CHARACTER(CHRLEN) :: ifilename,sectionstring
1295  INTEGER :: errorflag,ifile,ifl,ipatch,loopcounter
1296  TYPE(t_global), POINTER :: global
1297  TYPE(t_grid), POINTER :: pgrid
1298  TYPE(t_patch), POINTER :: ppatch
1299 
1300 ! ******************************************************************************
1301 ! Start, set pointers and variables
1302 ! ******************************************************************************
1303 
1304  global => pregion%global
1305 
1306  CALL registerfunction(global,'PLAG_ReadSurfStatsBinary',&
1307  'PLAG_ModSurfStats.F90')
1308 
1309  IF ( global%myProcid == masterproc .AND. &
1310  global%verbLevel > verbose_none ) THEN
1311  WRITE(stdout,'(A,1X,A)') solver_name, &
1312  'Reading ASCII PLAG surface statistics file...'
1313  END IF ! global%verbLevel
1314 
1315  pgrid => pregion%grid
1316 
1317  ifile = if_plag_surf_stats
1318 
1319 ! ******************************************************************************
1320 ! Header and general information
1321 ! ******************************************************************************
1322 
1323  IF ( global%myProcid == masterproc .AND. &
1324  global%verbLevel > verbose_low ) THEN
1325  WRITE(stdout,'(A,3X,A)') solver_name,'Header information...'
1326  END IF ! global%verbLevel
1327 
1328  READ(ifile) sectionstring
1329  IF ( trim(sectionstring) /= '# ROCFLU surface statistics file' ) THEN
1330  CALL errorstop(global,err_invalid_marker,__line__,sectionstring)
1331  END IF ! TRIM
1332 
1333 ! ******************************************************************************
1334 ! Read rest of file
1335 ! ******************************************************************************
1336 
1337  loopcounter = 0
1338 
1339  DO ! set up infinite loop
1340  loopcounter = loopcounter + 1
1341 
1342  READ(ifile) sectionstring
1343 
1344  SELECT CASE ( trim(sectionstring) )
1345 
1346 ! ==============================================================================
1347 ! Patch data
1348 ! ==============================================================================
1349 
1350  CASE ( '# Patch' )
1351  IF ( global%myProcid == masterproc .AND. &
1352  global%verbLevel > verbose_low ) THEN
1353  WRITE(stdout,'(A,3X,A)') solver_name,'Patch...'
1354  END IF ! global%verbLevel
1355 
1356  DO ipatch = 1,pgrid%nPatches
1357  ppatch => pregion%patches(ipatch)
1358  IF ( ppatch%plotStatsFlag .EQV. .true. ) THEN
1359  CALL plag_readsurfstatskernelbinary(pregion,ppatch%statsPlag)
1360  END IF ! pPatch%plotStatsFlag
1361  END DO ! iPatch
1362 
1363 ! ==============================================================================
1364 ! Plane data
1365 ! ==============================================================================
1366 
1367 ! ==============================================================================
1368 ! End marker
1369 ! ==============================================================================
1370 
1371  CASE ( '# End' )
1372  IF ( global%myProcid == masterproc .AND. &
1373  global%verbLevel > verbose_low ) THEN
1374  WRITE(stdout,'(A,3X,A)') solver_name,'End marker...'
1375  END IF ! global%verbLevel
1376 
1377  EXIT
1378 
1379 ! ==============================================================================
1380 ! Invalid section string
1381 ! ==============================================================================
1382 
1383  CASE default
1384  IF ( global%verbLevel > verbose_low ) THEN
1385  WRITE(stdout,'(A,3X,A)') solver_name,sectionstring
1386  END IF ! verbosityLevel
1387 
1388  CALL errorstop(global,err_invalid_marker,__line__,sectionstring)
1389  END SELECT ! TRIM
1390 
1391 ! ==============================================================================
1392 ! Guard against infinite loop - unnecessary because of read errors?
1393 ! ==============================================================================
1394 
1395  IF ( loopcounter >= limit_infinite_loop ) THEN
1396  CALL errorstop(global,err_infinite_loop,__line__)
1397  END IF ! loopCounter
1398  END DO ! <empty>
1399 
1400 ! ******************************************************************************
1401 ! End
1402 ! ******************************************************************************
1403 
1404  IF ( global%myProcid == masterproc .AND. &
1405  global%verbLevel > verbose_none ) THEN
1406  WRITE(stdout,'(A,1X,A)') solver_name, &
1407  'Reading Binary PLAG surface statistics file done.'
1408  END IF ! global%verbLevel
1409 
1410  CALL deregisterfunction(global)
1411 
1412  END SUBROUTINE plag_readsurfstatsbinary
1413 
1414 
1415 
1416 
1417 
1418 
1419 ! *******************************************************************************
1420 !
1421 ! Purpose: Kernel to read surface statistics in ASCII format.
1422 !
1423 ! Description: None.
1424 !
1425 ! Input:
1426 ! pRegion Pointer to region
1427 ! pStatsPlag Pointer to statsPlag
1428 !
1429 ! Output: None.
1430 !
1431 ! Notes: None.
1432 !
1433 ! ******************************************************************************
1434 
1435  SUBROUTINE plag_readsurfstatskernelascii(pRegion,pStatsPlag)
1436 
1437  IMPLICIT NONE
1438 
1439 ! ******************************************************************************
1440 ! Declarations and definitions
1441 ! ******************************************************************************
1442 
1443 ! ==============================================================================
1444 ! Arguments
1445 ! ==============================================================================
1446 
1447  TYPE(t_region), POINTER :: pregion
1448  TYPE(t_surfstats_plag), DIMENSION(:), POINTER :: pstatsplag
1449 
1450 ! ==============================================================================
1451 ! Locals
1452 ! ==============================================================================
1453 
1454  CHARACTER(CHRLEN) :: ifilename,sectionstring
1455  INTEGER :: errorflag,ibin,ifile,ifl,ipatch,ivar,nbfaces,nbins,ncont,nvars
1456 
1457  TYPE(t_global), POINTER :: global
1458 
1459 ! ******************************************************************************
1460 ! Start, set pointers and variables
1461 ! ******************************************************************************
1462 
1463  global => pregion%global
1464 
1465  CALL registerfunction(global,'PLAG_ReadSurfStatsKernelASCII',&
1466  'PLAG_ModSurfStats.F90')
1467 
1468  ifile = if_plag_surf_stats
1469 
1470  nbfaces = SIZE(pstatsplag,dim=1)
1471 
1472  ncont = pregion%plagInput%nCont
1473  nvars = plag_surf_stats_last +ncont
1474 
1475 ! TEMPORARY
1476  nbins = 20
1477 ! nBins = pRegion%plagInput%nBins
1478 ! END TEMPORARY
1479 
1480 ! ******************************************************************************
1481 ! Read surface statistics to file
1482 ! ******************************************************************************
1483 
1484 ! ==============================================================================
1485 ! Number of hits
1486 ! ==============================================================================
1487 
1488  READ(ifile,'(8(I10))') ((pstatsplag(ifl)%nHits(ibin),ibin=1,nbins),&
1489  ifl=1,nbfaces)
1490 
1491 ! ==============================================================================
1492 ! Surface variables
1493 ! ==============================================================================
1494 
1495  READ(ifile,'(5(E23.16))') (((pstatsplag(ifl)%vars(ivar,ibin), &
1496  ivar=1,nvars),ibin=1,nbins),ifl=1,nbfaces)
1497 
1498 ! ******************************************************************************
1499 ! End
1500 ! ******************************************************************************
1501 
1502  CALL deregisterfunction(global)
1503 
1504  END SUBROUTINE plag_readsurfstatskernelascii
1505 
1506 
1507 
1508 
1509 
1510 
1511 ! *******************************************************************************
1512 !
1513 ! Purpose: Kernel to read surface statistics in binary format.
1514 !
1515 ! Description: None.
1516 !
1517 ! Input:
1518 ! pRegion Pointer to region
1519 ! pStatsPlag Pointer to statsPlag
1520 !
1521 ! Output: None.
1522 !
1523 ! Notes: None.
1524 !
1525 ! ******************************************************************************
1526 
1527  SUBROUTINE plag_readsurfstatskernelbinary(pRegion,pStatsPlag)
1528 
1529  IMPLICIT NONE
1530 
1531 ! ******************************************************************************
1532 ! Declarations and definitions
1533 ! ******************************************************************************
1534 
1535 ! ==============================================================================
1536 ! Arguments
1537 ! ==============================================================================
1538 
1539  TYPE(t_region), POINTER :: pregion
1540  TYPE(t_surfstats_plag), DIMENSION(:), POINTER :: pstatsplag
1541 
1542 ! ==============================================================================
1543 ! Locals
1544 ! ==============================================================================
1545 
1546  CHARACTER(CHRLEN) :: ifilename,sectionstring
1547  INTEGER :: errorflag,ibin,ifile,ifl,ipatch,ivar,nbfaces,nbins,ncont,nvars
1548 
1549  TYPE(t_global), POINTER :: global
1550 
1551 ! ******************************************************************************
1552 ! Start, set pointers and variables
1553 ! ******************************************************************************
1554 
1555  global => pregion%global
1556 
1557  CALL registerfunction(global,'PLAG_ReadSurfStatsKernelBinary',&
1558  'PLAG_ModSurfStats.F90')
1559 
1560  ifile = if_plag_surf_stats
1561 
1562  nbfaces = SIZE(pstatsplag,dim=1)
1563 
1564  ncont = pregion%plagInput%nCont
1565  nvars = plag_surf_stats_last +ncont
1566 
1567 ! TEMPORARY
1568  nbins = 20
1569 ! nBins = pRegion%plagInput%nBins
1570 ! END TEMPORARY
1571 
1572 ! ******************************************************************************
1573 ! Read surface statistics to file
1574 ! ******************************************************************************
1575 
1576 ! ==============================================================================
1577 ! Number of hits
1578 ! ==============================================================================
1579 
1580  READ(ifile) ((pstatsplag(ifl)%nHits(ibin),ibin=1,nbins),ifl=1,nbfaces)
1581 
1582 ! ==============================================================================
1583 ! Surface variables
1584 ! ==============================================================================
1585 
1586  READ(ifile) (((pstatsplag(ifl)%vars(ivar,ibin), &
1587  ivar=1,nvars),ibin=1,nbins),ifl=1,nbfaces)
1588 
1589 ! ******************************************************************************
1590 ! End
1591 ! ******************************************************************************
1592 
1593  CALL deregisterfunction(global)
1594 
1595  END SUBROUTINE plag_readsurfstatskernelbinary
1596 
1597 
1598 
1599 
1600 
1601 
1602 
1603 
1604 
1605 
1606 
1607 
1608 ! *******************************************************************************
1609 !
1610 ! Purpose: Wrapper for reading surface statistics.
1611 !
1612 ! Description: None.
1613 !
1614 ! Input:
1615 ! pRegion Pointer to region
1616 !
1617 ! Output: None.
1618 !
1619 ! Notes: None.
1620 !
1621 ! ******************************************************************************
1622 
1623  SUBROUTINE plag_readsurfstatswrapper(pRegion)
1624 
1625  IMPLICIT NONE
1626 
1627 ! ******************************************************************************
1628 ! Declarations and definitions
1629 ! ******************************************************************************
1630 
1631 ! ==============================================================================
1632 ! Arguments
1633 ! ==============================================================================
1634 
1635  TYPE(t_region), POINTER :: pregion
1636 
1637 ! ==============================================================================
1638 ! Locals
1639 ! ==============================================================================
1640 
1641  LOGICAL :: fileexists
1642  TYPE(t_global), POINTER :: global
1643 
1644 ! ******************************************************************************
1645 ! Start, set pointers and variables
1646 ! ******************************************************************************
1647 
1648  global => pregion%global
1649 
1650  CALL registerfunction(global,'PLAG_ReadSurfStatsWrapper',&
1651  'PLAG_ModSurfStats.F90')
1652 
1653  SELECT CASE(global%solutFormat)
1654  CASE( format_ascii )
1655  CALL plag_opensurfstatsascii(pregion,file_status_old,fileexists)
1656 
1657  IF ( fileexists .EQV. .true. ) THEN
1658  CALL plag_readsurfstatsascii(pregion)
1659  CALL plag_closesurfstats(pregion)
1660  END IF ! fileExists
1661 
1662  CASE( format_binary )
1663  CALL plag_opensurfstatsbinary(pregion,file_status_old,fileexists)
1664 
1665  IF ( fileexists .EQV. .true. ) THEN
1666  CALL plag_readsurfstatsbinary(pregion)
1667  CALL plag_closesurfstats(pregion)
1668  END IF ! fileExists
1669  CASE default
1670  CALL errorstop(global,err_reached_default,__line__)
1671  END SELECT ! global%solutFormat
1672 
1673 ! ******************************************************************************
1674 ! Write warning if file is missing
1675 ! ******************************************************************************
1676 
1677  IF ( fileexists .EQV. .false. ) THEN
1678  global%warnCounter = global%warnCounter + 1
1679 
1680  IF ( global%myProcid == masterproc .AND. &
1681  global%verbLevel > verbose_none ) THEN
1682  WRITE(stdout,'(A,2(1X,A))') solver_name,'*** WARNING ***', &
1683  'Plag surface statistics file missing, not read.'
1684  END IF ! global%myProcid
1685  END IF ! fileExists
1686 
1687 ! ******************************************************************************
1688 ! End
1689 ! ******************************************************************************
1690 
1691  CALL deregisterfunction(global)
1692 
1693  END SUBROUTINE plag_readsurfstatswrapper
1694 
1695 
1696 
1697 
1698 
1699 
1700 ! *******************************************************************************
1701 !
1702 ! Purpose: Set bin index based on method selected..
1703 !
1704 ! Description: None.
1705 !
1706 ! Input:
1707 ! global Pointer to global
1708 ! binMethod Binning method selected
1709 ! diamMicron Particle diameter in microns
1710 ! diamMin Minimum diameter
1711 ! diamMax Maximum diameter
1712 !
1713 ! Output: Bin index.
1714 !
1715 ! Notes: None.
1716 !
1717 ! ******************************************************************************
1718 
1719  INTEGER FUNCTION plag_setbinindex(global,binMethod,nBins,diamMicron,&
1720  diambin,diammin,diammax)
1721 
1722  IMPLICIT NONE
1723 
1724 ! ******************************************************************************
1725 ! Declarations and definitions
1726 ! ******************************************************************************
1727 
1728 ! ==============================================================================
1729 ! Arguments
1730 ! ==============================================================================
1731 
1732  TYPE(t_global), POINTER :: global
1733 
1734  INTEGER, INTENT(IN) :: binmethod,nbins
1735  REAL(KIND=RFREAL), INTENT(IN) :: diambin,diammicron,diammax,diammin
1736 
1737 ! ==============================================================================
1738 ! Locals
1739 ! ==============================================================================
1740 
1741  INTEGER :: errorflag
1742 
1743 ! ******************************************************************************
1744 ! Start, set pointers and variables
1745 ! ******************************************************************************
1746 
1747  CALL registerfunction(global,'PLAG_SetBinMethod',&
1748  'PLAG_ModSurfStats.F90')
1749 
1750 ! ******************************************************************************
1751 ! Determine bin index
1752 ! ******************************************************************************
1753 
1754  SELECT CASE(binmethod)
1755  CASE( bin_method_linear)
1756  plag_setbinindex = min(int((diammicron-diammin)/diambin)+1,nbins)
1757 
1758  CASE default
1759  CALL errorstop(global,err_reached_default,__line__)
1760  END SELECT ! binMethod
1761 
1762 ! ******************************************************************************
1763 ! End
1764 ! ******************************************************************************
1765 
1766  CALL deregisterfunction(global)
1767 
1768  END FUNCTION plag_setbinindex
1769 
1770 
1771 
1772 
1773 
1774 
1775 ! *******************************************************************************
1776 !
1777 ! Purpose: Write surface statistics in ASCII format.
1778 !
1779 ! Description: None.
1780 !
1781 ! Input:
1782 ! pRegion Pointer to region
1783 !
1784 ! Output: None.
1785 !
1786 ! Notes: None.
1787 !
1788 ! ******************************************************************************
1789 
1790  SUBROUTINE plag_writesurfstatsascii(pRegion)
1791 
1792  IMPLICIT NONE
1793 
1794 ! ******************************************************************************
1795 ! Declarations and definitions
1796 ! ******************************************************************************
1797 
1798 ! ==============================================================================
1799 ! Arguments
1800 ! ==============================================================================
1801 
1802  TYPE(t_region), POINTER :: pregion
1803 
1804 ! ==============================================================================
1805 ! Locals
1806 ! ==============================================================================
1807 
1808  CHARACTER(CHRLEN) :: ifilename,sectionstring
1809  INTEGER :: errorflag,ifile,ifl,ipatch
1810  TYPE(t_global), POINTER :: global
1811  TYPE(t_grid), POINTER :: pgrid
1812  TYPE(t_patch), POINTER :: ppatch
1813 
1814 ! ******************************************************************************
1815 ! Start, set pointers and variables
1816 ! ******************************************************************************
1817 
1818  global => pregion%global
1819 
1820  CALL registerfunction(global,'PLAG_WriteSurfStatsASCII',&
1821  'PLAG_ModSurfStats.F90')
1822 
1823  IF ( global%myProcid == masterproc .AND. &
1824  global%verbLevel > verbose_none ) THEN
1825  WRITE(stdout,'(A,1X,A)') solver_name, &
1826  'Writing ASCII PLAG surface statistics file...'
1827  END IF ! global%verbLevel
1828 
1829  pgrid => pregion%grid
1830 
1831  ifile = if_plag_surf_stats
1832 
1833 ! ******************************************************************************
1834 ! Header and general information
1835 ! ******************************************************************************
1836 
1837  IF ( global%myProcid == masterproc .AND. &
1838  global%verbLevel > verbose_low ) THEN
1839  WRITE(stdout,'(A,3X,A)') solver_name,'Header information...'
1840  END IF ! global%verbLevel
1841 
1842  sectionstring = '# ROCFLU surface statistics file'
1843  WRITE(ifile,'(A)') trim(sectionstring)
1844 
1845 ! ******************************************************************************
1846 ! Write patch data
1847 ! ******************************************************************************
1848 
1849  sectionstring = '# Patch'
1850  WRITE(ifile,'(A)') trim(sectionstring)
1851 
1852  DO ipatch = 1,pgrid%nPatches
1853  ppatch => pregion%patches(ipatch)
1854 
1855  IF ( ppatch%plotStatsFlag .EQV. .true. ) THEN
1856  CALL plag_writesurfstatskernelascii(pregion,ppatch%statsPlag)
1857  END IF ! pPatch%plotStatsFlag
1858  END DO ! iPatch
1859 
1860 ! ******************************************************************************
1861 ! Write plane data
1862 ! ******************************************************************************
1863 
1864 ! ******************************************************************************
1865 ! End marker
1866 ! ******************************************************************************
1867 
1868  IF ( global%myProcid == masterproc .AND. &
1869  global%verbLevel > verbose_low ) THEN
1870  WRITE(stdout,'(A,3X,A)') solver_name,'End marker...'
1871  END IF ! global%verbLevel
1872 
1873  sectionstring = '# End'
1874  WRITE(ifile,'(A)') trim(sectionstring)
1875 
1876 ! ******************************************************************************
1877 ! End
1878 ! ******************************************************************************
1879 
1880  IF ( global%myProcid == masterproc .AND. &
1881  global%verbLevel > verbose_none ) THEN
1882  WRITE(stdout,'(A,1X,A)') solver_name, &
1883  'Writing ASCII PLAG surface statistics file done.'
1884  END IF ! global%verbLevel
1885 
1886  CALL deregisterfunction(global)
1887 
1888  END SUBROUTINE plag_writesurfstatsascii
1889 
1890 
1891 
1892 
1893 
1894 ! *******************************************************************************
1895 !
1896 ! Purpose: Write surface statistics in binary format.
1897 !
1898 ! Description: None.
1899 !
1900 ! Input:
1901 ! pRegion Pointer to region
1902 !
1903 ! Output: None.
1904 !
1905 ! Notes: None.
1906 !
1907 ! ******************************************************************************
1908 
1909  SUBROUTINE plag_writesurfstatsbinary(pRegion)
1910 
1911  IMPLICIT NONE
1912 
1913 ! ******************************************************************************
1914 ! Declarations and definitions
1915 ! ******************************************************************************
1916 
1917 ! ==============================================================================
1918 ! Arguments
1919 ! ==============================================================================
1920 
1921  TYPE(t_region), POINTER :: pregion
1922 
1923 ! ==============================================================================
1924 ! Locals
1925 ! ==============================================================================
1926 
1927  CHARACTER(CHRLEN) :: sectionstring
1928  INTEGER :: errorflag,ifile,ipatch
1929  TYPE(t_global), POINTER :: global
1930  TYPE(t_grid), POINTER :: pgrid
1931  TYPE(t_patch), POINTER :: ppatch
1932 
1933 ! ******************************************************************************
1934 ! Start, set pointers and variables
1935 ! ******************************************************************************
1936 
1937  global => pregion%global
1938 
1939  CALL registerfunction(global,'PLAG_WriteSurfStatsBinary',&
1940  'PLAG_ModSurfStats.F90')
1941 
1942  IF ( global%myProcid == masterproc .AND. &
1943  global%verbLevel > verbose_none ) THEN
1944  WRITE(stdout,'(A,1X,A)') solver_name, &
1945  'Writing binary PLAG surface statistics file...'
1946  END IF ! global%verbLevel
1947 
1948  pgrid => pregion%grid
1949 
1950  ifile = if_plag_surf_stats
1951 
1952 ! ******************************************************************************
1953 ! Header and general information
1954 ! ******************************************************************************
1955 
1956  IF ( global%myProcid == masterproc .AND. &
1957  global%verbLevel > verbose_low ) THEN
1958  WRITE(stdout,'(A,3X,A)') solver_name,'Header information...'
1959  END IF ! global%verbLevel
1960 
1961  sectionstring = '# ROCFLU surface statistics file'
1962  WRITE(ifile) sectionstring
1963 
1964 ! ******************************************************************************
1965 ! Write patch data
1966 ! ******************************************************************************
1967 
1968  sectionstring = '# Patch'
1969  WRITE(ifile) sectionstring
1970 
1971  DO ipatch = 1,pgrid%nPatches
1972  ppatch => pregion%patches(ipatch)
1973 
1974  IF ( ppatch%plotStatsFlag .EQV. .true. ) THEN
1975  CALL plag_writesurfstatskernelbinary(pregion,ppatch%statsPlag)
1976  END IF ! pPatch%plotStatsFlag
1977  END DO ! iPatch
1978 
1979 ! ******************************************************************************
1980 ! Write plane data
1981 ! ******************************************************************************
1982 
1983 
1984 
1985 ! ******************************************************************************
1986 ! End marker
1987 ! ******************************************************************************
1988 
1989  IF ( global%myProcid == masterproc .AND. &
1990  global%verbLevel > verbose_low ) THEN
1991  WRITE(stdout,'(A,3X,A)') solver_name,'End marker...'
1992  END IF ! global%verbLevel
1993 
1994  sectionstring = '# End'
1995  WRITE(ifile) sectionstring
1996 
1997 ! ******************************************************************************
1998 ! End
1999 ! ******************************************************************************
2000 
2001  IF ( global%myProcid == masterproc .AND. &
2002  global%verbLevel > verbose_none ) THEN
2003  WRITE(stdout,'(A,1X,A)') solver_name, &
2004  'Writing binary PLAG surface statistics file done.'
2005  END IF ! global%verbLevel
2006 
2007  CALL deregisterfunction(global)
2008 
2009  END SUBROUTINE plag_writesurfstatsbinary
2010 
2011 
2012 
2013 
2014 
2015 
2016 ! *******************************************************************************
2017 !
2018 ! Purpose: Kernel to write surface statistics in ASCII format.
2019 !
2020 ! Description: None.
2021 !
2022 ! Input:
2023 ! pRegion Pointer to region
2024 ! pStatsPlag Pointer to statsPlag
2025 !
2026 ! Output: None.
2027 !
2028 ! Notes: None.
2029 !
2030 ! ******************************************************************************
2031 
2032  SUBROUTINE plag_writesurfstatskernelascii(pRegion,pStatsPlag)
2033 
2034  IMPLICIT NONE
2035 
2036 ! ******************************************************************************
2037 ! Declarations and definitions
2038 ! ******************************************************************************
2039 
2040 ! ==============================================================================
2041 ! Arguments
2042 ! ==============================================================================
2043 
2044  TYPE(t_region), POINTER :: pregion
2045  TYPE(t_surfstats_plag), DIMENSION(:), POINTER :: pstatsplag
2046 
2047 ! ==============================================================================
2048 ! Locals
2049 ! ==============================================================================
2050 
2051  CHARACTER(CHRLEN) :: ifilename,sectionstring
2052  INTEGER :: errorflag,ibin,ifile,ifl,ipatch,ivar,nbfaces,nbins,ncont,nvars
2053 
2054  TYPE(t_global), POINTER :: global
2055 
2056 ! ******************************************************************************
2057 ! Start, set pointers and variables
2058 ! ******************************************************************************
2059 
2060  global => pregion%global
2061 
2062  CALL registerfunction(global,'PLAG_WriteSurfStatsKernelASCII',&
2063  'PLAG_ModSurfStats.F90')
2064 
2065  ifile = if_plag_surf_stats
2066 
2067  nbfaces = SIZE(pstatsplag,dim=1)
2068 
2069  ncont = pregion%plagInput%nCont
2070  nvars = plag_surf_stats_last +ncont
2071 
2072 ! TEMPORARY
2073  nbins = 20
2074 ! nBins = pRegion%plagInput%nBins
2075 ! END TEMPORARY
2076 
2077 ! ******************************************************************************
2078 ! Write surface statistics to file
2079 ! ******************************************************************************
2080 
2081 ! ==============================================================================
2082 ! Number of hits
2083 ! ==============================================================================
2084 
2085  WRITE(ifile,'(8(I10))') ((pstatsplag(ifl)%nHits(ibin),ibin=1,nbins),&
2086  ifl=1,nbfaces)
2087 
2088 ! ==============================================================================
2089 ! Surface variables
2090 ! ==============================================================================
2091 
2092  WRITE(ifile,'(5(E23.16))') (((pstatsplag(ifl)%vars(ivar,ibin), &
2093  ivar=1,nvars),ibin=1,nbins),ifl=1,nbfaces)
2094 
2095 ! ******************************************************************************
2096 ! End
2097 ! ******************************************************************************
2098 
2099  CALL deregisterfunction(global)
2100 
2101  END SUBROUTINE plag_writesurfstatskernelascii
2102 
2103 
2104 
2105 
2106 
2107 
2108 ! *******************************************************************************
2109 !
2110 ! Purpose: Kernel to write surface statistics in binary format.
2111 !
2112 ! Description: None.
2113 !
2114 ! Input:
2115 ! pRegion Pointer to region
2116 ! pStatsPlag Pointer to statsPlag
2117 !
2118 ! Output: None.
2119 !
2120 ! Notes: None.
2121 !
2122 ! ******************************************************************************
2123 
2124  SUBROUTINE plag_writesurfstatskernelbinary(pRegion,pStatsPlag)
2125 
2126  IMPLICIT NONE
2127 
2128 ! ******************************************************************************
2129 ! Declarations and definitions
2130 ! ******************************************************************************
2131 
2132 ! ==============================================================================
2133 ! Arguments
2134 ! ==============================================================================
2135 
2136  TYPE(t_region), POINTER :: pregion
2137 
2138  TYPE(t_surfstats_plag), DIMENSION(:), POINTER :: pstatsplag
2139 
2140 ! ==============================================================================
2141 ! Locals
2142 ! ==============================================================================
2143 
2144  CHARACTER(CHRLEN) :: ifilename
2145  INTEGER :: errorflag,ibin,ifile,ifl,ipatch,ivar,nbfaces,nbins,ncont,nvars
2146 
2147  TYPE(t_global), POINTER :: global
2148 
2149 ! ******************************************************************************
2150 ! Start, set pointers and variables
2151 ! ******************************************************************************
2152 
2153  global => pregion%global
2154 
2155  CALL registerfunction(global,'PLAG_WriteSurfStatsKernelBinary',&
2156  'PLAG_ModSurfStats.F90')
2157 
2158  ifile = if_plag_surf_stats
2159 
2160  nbfaces = SIZE(pstatsplag,dim=1)
2161 
2162  ncont = pregion%plagInput%nCont
2163  nvars = plag_surf_stats_last +ncont
2164 
2165 ! TEMPORARY
2166  nbins = 20
2167 ! nBins = pRegion%plagInput%nBins
2168 ! END TEMPORARY
2169 
2170 ! ******************************************************************************
2171 ! Write surface statistics to file
2172 ! ******************************************************************************
2173 
2174 ! ==============================================================================
2175 ! Number of hits
2176 ! ==============================================================================
2177 
2178  WRITE(ifile) ((pstatsplag(ifl)%nHits(ibin),ibin=1,nbins),ifl=1,nbfaces)
2179 
2180 ! ==============================================================================
2181 ! Surface variables
2182 ! ==============================================================================
2183 
2184  WRITE(ifile) (((pstatsplag(ifl)%vars(ivar,ibin), &
2185  ivar=1,nvars),ibin=1,nbins),ifl=1,nbfaces)
2186 
2187 ! ******************************************************************************
2188 ! End
2189 ! ******************************************************************************
2190 
2191  CALL deregisterfunction(global)
2192 
2193  END SUBROUTINE plag_writesurfstatskernelbinary
2194 
2195 
2196 
2197 
2198 
2199 ! *******************************************************************************
2200 !
2201 ! Purpose: Wrapper for writing surface statistics.
2202 !
2203 ! Description: None.
2204 !
2205 ! Input:
2206 ! pRegion Pointer to region
2207 !
2208 ! Output: None.
2209 !
2210 ! Notes: None.
2211 !
2212 ! ******************************************************************************
2213 
2214  SUBROUTINE plag_writesurfstatswrapper(pRegion)
2215 
2216  IMPLICIT NONE
2217 
2218 ! ******************************************************************************
2219 ! Declarations and definitions
2220 ! ******************************************************************************
2221 
2222 ! ==============================================================================
2223 ! Arguments
2224 ! ==============================================================================
2225 
2226  TYPE(t_region), POINTER :: pregion
2227 
2228 ! ==============================================================================
2229 ! Locals
2230 ! ==============================================================================
2231 
2232  TYPE(t_global), POINTER :: global
2233 
2234 ! ******************************************************************************
2235 ! Start, set pointers and variables
2236 ! ******************************************************************************
2237 
2238  global => pregion%global
2239 
2240  CALL registerfunction(global,'PLAG_WriteSurfStatsWrapper',&
2241  'PLAG_ModSurfStats.F90')
2242 
2243  SELECT CASE( global%solutFormat )
2244  CASE( format_ascii )
2245  CALL plag_opensurfstatsascii(pregion,file_status_unknown)
2246  CALL plag_writesurfstatsascii(pregion)
2247  CALL plag_closesurfstats(pregion)
2248  CASE( format_binary )
2249  CALL plag_opensurfstatsbinary(pregion,file_status_unknown)
2250  CALL plag_writesurfstatsbinary(pregion)
2251  CALL plag_closesurfstats(pregion)
2252  CASE default
2253  CALL errorstop(global,err_reached_default,__line__)
2254  END SELECT ! global%solutFormat
2255 
2256 ! ******************************************************************************
2257 ! End
2258 ! ******************************************************************************
2259 
2260  CALL deregisterfunction(global)
2261 
2262  END SUBROUTINE plag_writesurfstatswrapper
2263 
2264 
2265 
2266 
2267 
2268 
2269 END MODULE plag_modsurfstats
2270 
2271 ! ******************************************************************************
2272 !
2273 ! RCS Revision history:
2274 !
2275 ! $Log: PLAG_ModSurfStats.F90,v $
2276 ! Revision 1.13 2008/12/06 08:44:34 mtcampbe
2277 ! Updated license.
2278 !
2279 ! Revision 1.12 2008/11/19 22:17:47 mtcampbe
2280 ! Added Illinois Open Source License/Copyright
2281 !
2282 ! Revision 1.11 2006/05/12 22:50:32 fnajjar
2283 ! Fixed binary write of strings by remove TRIM
2284 !
2285 ! Revision 1.10 2006/05/11 18:17:44 fnajjar
2286 ! Fixed inconsistent naming for register functions
2287 !
2288 ! Revision 1.9 2006/05/09 14:38:10 fnajjar
2289 ! Bug for a formatted read from a binary file
2290 !
2291 ! Revision 1.8 2006/05/04 13:54:58 fnajjar
2292 ! Added and activated binary read for patch statistics file
2293 !
2294 ! Revision 1.7 2006/05/02 17:46:23 fnajjar
2295 ! Allowed surface statistics to be gathered on active patches
2296 !
2297 ! Revision 1.6 2006/04/07 15:19:23 haselbac
2298 ! Removed tabs
2299 !
2300 ! Revision 1.5 2005/12/30 16:27:18 fnajjar
2301 ! Changed diamMaxMicron to have size of 10 in bins
2302 !
2303 ! Revision 1.4 2005/01/06 22:26:43 fnajjar
2304 ! Implemented clean version for PLAG_SetBinIndex
2305 !
2306 ! Revision 1.3 2005/01/06 16:00:31 fnajjar
2307 ! Reformulated IDINT to INT with KIND in PLAG_SetBinIndex
2308 !
2309 ! Revision 1.2 2005/01/05 19:26:53 fnajjar
2310 ! Fixed definition of diamBin to maintain bounds
2311 !
2312 ! Revision 1.1 2004/12/21 15:07:02 fnajjar
2313 ! Initial import of surface statistics module
2314 !
2315 ! ******************************************************************************
2316 
2317 
2318 
2319 
2320 
2321 
2322 
2323 
2324 
2325 
2326 
2327 
2328 
2329 
2330 
2331 
2332 
2333 
2334 
2335 
2336 
2337 
2338 
2339 
2340 
2341 
2342 
subroutine, private plag_writesurfstatskernelascii(pRegion, pStatsPlag)
subroutine, private plag_writesurfstatsascii(pRegion)
subroutine, private plag_readsurfstatsbinary(pRegion)
Tfloat sum() const
Return the sum of all the pixel values in an image.
Definition: CImg.h:13022
subroutine, private plag_opensurfstatsbinary(pRegion, fileStatus, fileExists)
INTEGER function, private plag_setbinindex(global, binMethod, nBins, diamMicron, diamBin, diamMin, diamMax)
subroutine, private plag_closesurfstats(pRegion)
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
int status() const
Obtain the status of the attribute.
Definition: Attribute.h:240
double sqrt(double d)
Definition: double.h:73
subroutine, private plag_writesurfstatskernelbinary(pRegion, pStatsPlag)
subroutine, public plag_gathersurfstats(pRegion, pPlag, pStatsPlag, ifl, iPcl, thetaAngle)
subroutine, private plag_initsurfstats(pRegion, pStatsPlag)
subroutine, private plag_readsurfstatskernelascii(pRegion, pStatsPlag)
subroutine, public plag_destroysurfstats(pRegion)
subroutine, public plag_readsurfstatswrapper(pRegion)
subroutine, public plag_createsurfstats(pRegion)
subroutine, private plag_writesurfstatsbinary(pRegion)
**********************************************************************Rocstar Simulation Suite Illinois Rocstar LLC All rights reserved ****Illinois Rocstar LLC IL **www illinoisrocstar com **sales illinoisrocstar com WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **Arising OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE **********************************************************************INTERFACE SUBROUTINE form
subroutine, public plag_writesurfstatswrapper(pRegion)
subroutine, private plag_readsurfstatskernelbinary(pRegion, pStatsPlag)
Vector_n min(const Array_n_const &v1, const Array_n_const &v2)
Definition: Vector_n.h:346
subroutine, private plag_readsurfstatsascii(pRegion)
subroutine, private plag_opensurfstatsascii(pRegion, fileStatus, fileExists)
subroutine errorstop(global, errorCode, errorLine, addMessage)
Definition: ModError.F90:483
subroutine, private plag_nullifysurfstats(pRegion)
subroutine deregisterfunction(global)
Definition: ModError.F90:469
subroutine, private plag_createsurfstatskernel(pRegion, pStatsPlag)
subroutine, private plag_destroysurfstatskernel(global, pStatsPlag)
subroutine buildfilenamesteady(global, dest, ext, id, it, fileName)
subroutine buildfilenameunsteady(global, dest, ext, id, tm, fileName)