Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RFLU_ModRocstarAdmin.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 related to GENX interaction.
26 !
27 ! Description: None
28 !
29 ! Notes: None.
30 !
31 ! ******************************************************************************
32 !
33 ! $Id: RFLU_ModGENXAdmin.F90,v 1.26 2009/05/12 20:20:56 mtcampbe Exp $
34 !
35 ! Copyright: (c) 2004-2005 by the University of Illinois
36 !
37 ! ******************************************************************************
38 
40 
41  USE moddatatypes
42  USE modparameters
43  USE moderror
44  USE modglobal, ONLY: t_global
45  USE modbndpatch, ONLY: t_patch
46  USE moddatastruct, ONLY: t_region
47  USE modgrid, ONLY: t_grid
48  USE modborder, ONLY: t_border
49  USE modmpi
50 
53 
54  IMPLICIT NONE
55 
56  include 'roccomf90.h'
57 
58  PRIVATE
59  PUBLIC :: rflu_genx_buildgridsurf, &
94 
95 ! ******************************************************************************
96 ! Declarations and definitions
97 ! ******************************************************************************
98 
99 ! ==============================================================================
100 ! Private
101 ! ==============================================================================
102 
103  CHARACTER(CHRLEN) :: &
104  RCSIdentString = '$RCSfile: RFLU_ModGENXAdmin.F90,v $ $Revision: 1.26 $'
105 
106 ! ==============================================================================
107 ! Public
108 ! ==============================================================================
109 
110 
111 ! ******************************************************************************
112 ! Contained routines
113 ! ******************************************************************************
114 
115  CONTAINS
116 
117 
118 
119 
120 
121 ! ******************************************************************************
122 !
123 ! Purpose: Build surface grid.
124 !
125 ! Description: None.
126 !
127 ! Input:
128 ! pRegion Pointer to region
129 !
130 ! Output: None.
131 !
132 ! Notes:
133 ! 1. Roccom requires locally-numbered boundary-face lists.
134 !
135 ! ******************************************************************************
136 
137  SUBROUTINE rflu_genx_buildgridsurf(pRegion)
138 
140 
141  IMPLICIT NONE
142 
143 ! ******************************************************************************
144 ! Declarations and definitions
145 ! ******************************************************************************
146 
147 ! ==============================================================================
148 ! Arguments
149 ! ==============================================================================
150 
151  TYPE(t_region), POINTER :: pregion
152 
153 ! ==============================================================================
154 ! Locals
155 ! ==============================================================================
156 
157  INTEGER :: errorflag,ipatch,ivg,ivl
158  TYPE(t_global), POINTER :: global
159  TYPE(t_grid), POINTER :: pgrid
160  TYPE(t_patch), POINTER :: ppatch
161 
162 ! ******************************************************************************
163 ! Start, set pointers
164 ! ******************************************************************************
165 
166  global => pregion%global
167 
168  pgrid => pregion%grid
169 
170  CALL registerfunction(global,'RFLU_GENX_BuildGridSurf',&
171  'RFLU_ModRocstarAdmin.F90')
172 
173 ! ******************************************************************************
174 ! Create locally-numbered boundary face lists
175 ! ******************************************************************************
176 
177  CALL rflu_buildbfaceloclists(pregion)
178 
179 ! ******************************************************************************
180 ! Copy coordinates. NOTE no longer setting coordinates of virtual vertices to
181 ! CRAZY_VALUE_INT because this makes testing of service modules difficult.
182 ! ******************************************************************************
183 
184  DO ipatch=1,pgrid%nPatches
185  ppatch => pregion%patches(ipatch)
186 
187  DO ivl = 1,ppatch%nBVertTot
188  ivg = ppatch%bv(ivl)
189 
190  ppatch%xyz(xcoord,ivl) = pgrid%xyz(xcoord,ivg)
191  ppatch%xyz(ycoord,ivl) = pgrid%xyz(ycoord,ivg)
192  ppatch%xyz(zcoord,ivl) = pgrid%xyz(zcoord,ivg)
193  END DO ! ivl
194  END DO ! iPatch
195 
196 ! ******************************************************************************
197 ! End
198 ! ******************************************************************************
199 
200  CALL deregisterfunction(global)
201 
202  END SUBROUTINE rflu_genx_buildgridsurf
203 
204 
205 
206 
207 
208 
209 
210 ! ******************************************************************************
211 !
212 ! Purpose: Build pconn attribute.
213 !
214 ! Description: None.
215 !
216 ! Input:
217 ! pRegion Pointer to region
218 !
219 ! Output: None.
220 !
221 ! Notes: None.
222 !
223 ! ******************************************************************************
224 
225  SUBROUTINE rflu_genx_buildpconn(pRegion)
226 
227  IMPLICIT NONE
228 
229 ! ******************************************************************************
230 ! Declarations and definitions
231 ! ******************************************************************************
232 
233 ! ==============================================================================
234 ! Arguments
235 ! ==============================================================================
236 
237  TYPE(t_region), POINTER :: pregion
238 
239 ! ==============================================================================
240 ! Locals
241 ! ==============================================================================
242 
243  INTEGER :: errorflag,iborder,icl,ipc,ivl,paneid
244  TYPE(t_global), POINTER :: global
245  TYPE(t_grid), POINTER :: pgrid
246  TYPE(t_border), POINTER :: pborder
247 
248 ! ******************************************************************************
249 ! Start, set pointers
250 ! ******************************************************************************
251 
252  global => pregion%global
253 
254  pgrid => pregion%grid
255 
256  CALL registerfunction(global,'RFLU_GENX_BuildPConn',&
257  'RFLU_ModRocstarAdmin.F90')
258 
259  IF ( global%myProcid == masterproc .AND. &
260  global%verbLevel >= verbose_high ) THEN
261  WRITE(stdout,'(A,1X,A)') solver_name,'Building pconn...'
262  END IF ! global%verbLevel
263 
264 ! ******************************************************************************
265 ! Fill pconn array
266 ! ******************************************************************************
267 
268  ipc = 0
269 
270 ! ==============================================================================
271 ! Block 1: Shared vertices
272 ! ==============================================================================
273 
274  ipc = ipc + 1
275  pgrid%pconn(ipc) = pgrid%nBorders
276 
277  DO iborder = 1,pgrid%nBorders
278  pborder => pgrid%borders(iborder)
279 
280 ! ------------------------------------------------------------------------------
281 ! Pane id
282 ! ------------------------------------------------------------------------------
283 
284  CALL rflu_genx_buildpaneid(pborder%iRegionGlobal,0,paneid)
285 
286  ipc = ipc + 1
287  pgrid%pconn(ipc) = paneid
288 
289 ! ------------------------------------------------------------------------------
290 ! Dimension
291 ! ------------------------------------------------------------------------------
292 
293  ipc = ipc + 1
294  pgrid%pconn(ipc) = pborder%nVertShared
295 
296 ! ------------------------------------------------------------------------------
297 ! Data
298 ! ------------------------------------------------------------------------------
299 
300  DO ivl = 1,pborder%nVertShared
301  ipc = ipc + 1
302  pgrid%pconn(ipc) = pborder%ivgShared(ivl)
303  END DO ! ivl
304  END DO ! iBorder
305 
306 ! ==============================================================================
307 ! Block 2: Vertices to send
308 ! ==============================================================================
309 
310  ipc = ipc + 1
311  pgrid%pconn(ipc) = pgrid%nBorders
312 
313  DO iborder = 1,pgrid%nBorders
314  pborder => pgrid%borders(iborder)
315 
316 ! ------------------------------------------------------------------------------
317 ! Pane id
318 ! ------------------------------------------------------------------------------
319 
320  CALL rflu_genx_buildpaneid(pborder%iRegionGlobal,0,paneid)
321 
322  ipc = ipc + 1
323  pgrid%pconn(ipc) = paneid
324 
325 ! ------------------------------------------------------------------------------
326 ! Dimension
327 ! ------------------------------------------------------------------------------
328 
329  ipc = ipc + 1
330  pgrid%pconn(ipc) = pborder%nVertSend
331 
332 ! ------------------------------------------------------------------------------
333 ! Data
334 ! ------------------------------------------------------------------------------
335 
336  DO ivl = 1,pborder%nVertSend
337  ipc = ipc + 1
338  pgrid%pconn(ipc) = pborder%ivgSend(ivl)
339  END DO ! ivl
340  END DO ! iBorder
341 
342 ! ==============================================================================
343 ! Block 3: Vertices to recv
344 ! ==============================================================================
345 
346  ipc = ipc + 1
347  pgrid%pconn(ipc) = pgrid%nBorders
348 
349  DO iborder = 1,pgrid%nBorders
350  pborder => pgrid%borders(iborder)
351 
352 ! ------------------------------------------------------------------------------
353 ! Pane id
354 ! ------------------------------------------------------------------------------
355 
356  CALL rflu_genx_buildpaneid(pborder%iRegionGlobal,0,paneid)
357 
358  ipc = ipc + 1
359  pgrid%pconn(ipc) = paneid
360 
361 ! ------------------------------------------------------------------------------
362 ! Dimension
363 ! ------------------------------------------------------------------------------
364 
365  ipc = ipc + 1
366  pgrid%pconn(ipc) = pborder%nVertRecv
367 
368 ! ------------------------------------------------------------------------------
369 ! Data
370 ! ------------------------------------------------------------------------------
371 
372  DO ivl = 1,pborder%nVertRecv
373  ipc = ipc + 1
374  pgrid%pconn(ipc) = pborder%ivgRecv(ivl)
375  END DO ! ivl
376  END DO ! iBorder
377 
378 ! ==============================================================================
379 ! Block 4: Cells to send
380 ! ==============================================================================
381 
382  ipc = ipc + 1
383  pgrid%pconn(ipc) = pgrid%nBorders
384 
385  DO iborder = 1,pgrid%nBorders
386  pborder => pgrid%borders(iborder)
387 
388 ! ------------------------------------------------------------------------------
389 ! Pane id
390 ! ------------------------------------------------------------------------------
391 
392 
393  CALL rflu_genx_buildpaneid(pborder%iRegionGlobal,0,paneid)
394 
395  ipc = ipc + 1
396  pgrid%pconn(ipc) = paneid
397 
398 ! ------------------------------------------------------------------------------
399 ! Dimension
400 ! ------------------------------------------------------------------------------
401 
402  ipc = ipc + 1
403  pgrid%pconn(ipc) = pborder%nCellsSend
404 
405 ! ------------------------------------------------------------------------------
406 ! Data
407 ! ------------------------------------------------------------------------------
408 
409  DO icl = 1,pborder%nCellsSend
410  ipc = ipc + 1
411  pgrid%pconn(ipc) = pborder%icgSend(icl)
412  END DO ! ivl
413  END DO ! iBorder
414 
415 ! ==============================================================================
416 ! Block 5: Cells to recv
417 ! ==============================================================================
418 
419  ipc = ipc + 1
420  pgrid%pconn(ipc) = pgrid%nBorders
421 
422  DO iborder = 1,pgrid%nBorders
423  pborder => pgrid%borders(iborder)
424 
425 ! ------------------------------------------------------------------------------
426 ! Pane id
427 ! ------------------------------------------------------------------------------
428 
429  CALL rflu_genx_buildpaneid(pborder%iRegionGlobal,0,paneid)
430 
431  ipc = ipc + 1
432  pgrid%pconn(ipc) = paneid
433 
434 ! ------------------------------------------------------------------------------
435 ! Dimension
436 ! ------------------------------------------------------------------------------
437 
438  ipc = ipc + 1
439  pgrid%pconn(ipc) = pborder%nCellsRecv
440 
441 ! ------------------------------------------------------------------------------
442 ! Data
443 ! ------------------------------------------------------------------------------
444 
445  DO icl = 1,pborder%nCellsRecv
446  ipc = ipc + 1
447  pgrid%pconn(ipc) = pborder%icgRecv(icl)
448  END DO ! ivl
449  END DO ! iBorder
450 
451 ! ******************************************************************************
452 ! End
453 ! ******************************************************************************
454 
455  IF ( global%myProcid == masterproc .AND. &
456  global%verbLevel >= verbose_high ) THEN
457  WRITE(stdout,'(A,1X,A)') solver_name,'Building pconn done.'
458  END IF ! global%verbLevel
459 
460  CALL deregisterfunction(global)
461 
462  END SUBROUTINE rflu_genx_buildpconn
463 
464 
465 
466 
467 
468 
469 ! ******************************************************************************
470 !
471 ! Purpose: Close control files for Rocin.
472 !
473 ! Description: None.
474 !
475 ! Input:
476 ! global Pointer to global data
477 !
478 ! Output: None.
479 !
480 ! Notes: None.
481 !
482 ! ******************************************************************************
483 
484  SUBROUTINE rflu_genx_closerocinctrlfiles(global)
485 
486  IMPLICIT NONE
487 
488 ! ******************************************************************************
489 ! Declarations and definitions
490 ! ******************************************************************************
491 
492 ! ==============================================================================
493 ! Arguments
494 ! ==============================================================================
495 
496  TYPE(t_global), POINTER :: global
497 
498 ! ==============================================================================
499 ! Locals
500 ! ==============================================================================
501 
502  CHARACTER(CHRLEN) :: ifilename
503  CHARACTER(GENX_TIME_STRING_LEN) :: timestring
504  INTEGER :: errorflag
505 
506 ! ******************************************************************************
507 ! Start
508 ! ******************************************************************************
509 
510  CALL registerfunction(global,'RFLU_GENX_CloseRocinCtrlFiles', &
511  'RFLU_ModRocstarAdmin.F90')
512 
513  IF ( global%myProcid == masterproc .AND. &
514  global%verbLevel >= verbose_high ) THEN
515  WRITE(stdout,'(A,1X,A)') solver_name,'Closing Rocin control files...'
516  END IF ! global%verbLevel
517 
518 ! ******************************************************************************
519 ! Close files
520 ! ******************************************************************************
521 
522 ! ==============================================================================
523 ! Volume file
524 ! ==============================================================================
525 
526  CALL rflu_genx_buildtimestring(global%currentTime,timestring)
527  ifilename = './Rocflu/Rocin/fluid_in_'//trim(timestring)//'.txt'
528 
529  CLOSE(if_ctrl_vol,iostat=errorflag)
530  global%error = errorflag
531  IF ( global%error /= err_none ) THEN
532  CALL errorstop(global,err_file_close,__line__,ifilename)
533  END IF ! global%error
534 
535 ! ==============================================================================
536 ! Surface file
537 ! ==============================================================================
538 
539  CALL rflu_genx_buildtimestring(global%currentTime,timestring)
540  ifilename = './Rocflu/Rocin/ifluid_in_'//trim(timestring)//'.txt'
541 
542  CLOSE(if_ctrl_surf,iostat=errorflag)
543  global%error = errorflag
544  IF ( global%error /= err_none ) THEN
545  CALL errorstop(global,err_file_close,__line__,ifilename)
546  END IF ! global%error
547 
548 ! ******************************************************************************
549 ! End
550 ! ******************************************************************************
551 
552  IF ( global%myProcid == masterproc .AND. &
553  global%verbLevel >= verbose_high ) THEN
554  WRITE(stdout,'(A,1X,A)') solver_name,'Closing Rocin control files done.'
555  END IF ! global%verbLevel
556 
557  CALL deregisterfunction(global)
558 
559  END SUBROUTINE rflu_genx_closerocinctrlfiles
560 
561 
562 
563 
564 
565 
566 ! ******************************************************************************
567 !
568 ! Purpose: Create new attributes for displacements.
569 !
570 ! Description: None.
571 !
572 ! Input:
573 ! pRegion Pointer to region
574 !
575 ! Output: None.
576 !
577 ! Notes: None.
578 !
579 ! ******************************************************************************
580 
581  SUBROUTINE rflu_genx_createattrdisp(pRegion)
582 
583  IMPLICIT NONE
584 
585 ! ******************************************************************************
586 ! Declarations and definitions
587 ! ******************************************************************************
588 
589 ! ==============================================================================
590 ! Arguments
591 ! ==============================================================================
592 
593  TYPE(t_region), POINTER :: pregion
594 
595 ! ==============================================================================
596 ! Locals
597 ! ==============================================================================
598 
599  CHARACTER(CHRLEN) :: winname
600  TYPE(t_global), POINTER :: global
601 
602 ! ******************************************************************************
603 ! Start, set pointers and variables
604 ! ******************************************************************************
605 
606  global => pregion%global
607 
608 ! ******************************************************************************
609 ! Create new attributes
610 ! ******************************************************************************
611 
612  winname = global%volWinName
613 
614  CALL com_new_attribute(trim(winname)//'.disp','n',com_double_precision,3,'')
615 
616 ! ******************************************************************************
617 ! End
618 ! ******************************************************************************
619 
620  END SUBROUTINE rflu_genx_createattrdisp
621 
622 
623 
624 
625 
626 
627 ! ******************************************************************************
628 !
629 ! Purpose: Create new attributes for mixture solution.
630 !
631 ! Description: None.
632 !
633 ! Input:
634 ! pRegion Pointer to region
635 !
636 ! Output: None.
637 !
638 ! Notes: None.
639 !
640 ! ******************************************************************************
641 
642  SUBROUTINE rflu_genx_createattrflow(pRegion)
643 
644  IMPLICIT NONE
645 
646 ! ******************************************************************************
647 ! Declarations and definitions
648 ! ******************************************************************************
649 
650 ! ==============================================================================
651 ! Arguments
652 ! ==============================================================================
653 
654  TYPE(t_region), POINTER :: pregion
655 
656 ! ==============================================================================
657 ! Locals
658 ! ==============================================================================
659 
660  CHARACTER(CHRLEN) :: winname
661  TYPE(t_global), POINTER :: global
662 
663 ! ******************************************************************************
664 ! Start, set pointers
665 ! ******************************************************************************
666 
667  global => pregion%global
668 
669 ! ******************************************************************************
670 ! Create new attributes
671 ! ******************************************************************************
672 
673 ! ==============================================================================
674 ! Volume
675 ! ==============================================================================
676 
677  winname = global%volWinName
678 
679  CALL com_new_attribute(trim(winname)//'.rhof' ,'e',com_double_precision, &
680  1,'kg/(m^3)')
681  CALL com_new_attribute(trim(winname)//'.rhovf','e',com_double_precision, &
682  3,'kg/(m^2 s)')
683  CALL com_new_attribute(trim(winname)//'.rhoEf','e',com_double_precision, &
684  1,'(J/(m^3))')
685  CALL com_new_attribute(trim(winname)//'.pf','e',com_double_precision,1, &
686  'N/(m^2)')
687  CALL com_new_attribute(trim(winname)//'.Tf','e',com_double_precision,1, &
688  'K')
689  CALL com_new_attribute(trim(winname)//'.af','e',com_double_precision,1, &
690  'm/s')
691 
692 ! ******************************************************************************
693 ! End
694 ! ******************************************************************************
695 
696  END SUBROUTINE rflu_genx_createattrflow
697 
698 
699 
700 
701 
702 
703 
704 ! ******************************************************************************
705 !
706 ! Purpose: Create new attributes for surface grid.
707 !
708 ! Description: None.
709 !
710 ! Input:
711 ! pRegion Pointer to region
712 !
713 ! Output: None.
714 !
715 ! Notes:
716 ! 1. Must not access dimensions of grid, because not necessarily known.
717 !
718 ! ******************************************************************************
719 
720  SUBROUTINE rflu_genx_createattrgridsurf(pRegion)
721 
722  IMPLICIT NONE
723 
724 ! ******************************************************************************
725 ! Declarations and definitions
726 ! ******************************************************************************
727 
728 ! ==============================================================================
729 ! Arguments
730 ! ==============================================================================
731 
732  TYPE(t_region), POINTER :: pregion
733 
734 ! ==============================================================================
735 ! Locals
736 ! ==============================================================================
737 
738  CHARACTER(CHRLEN) :: winname
739  TYPE(t_global), POINTER :: global
740 
741 ! ******************************************************************************
742 ! Start, set pointers and variables
743 ! ******************************************************************************
744 
745  global => pregion%global
746 
747 ! ******************************************************************************
748 ! Create new attributes
749 ! ******************************************************************************
750 
751  winname = global%surfWinName
752 
753  CALL com_new_attribute(trim(winname)//'.bcflag' ,'p',com_integer,1,'')
754  CALL com_new_attribute(trim(winname)//'.patchNo' ,'p',com_integer,1,'')
755  CALL com_new_attribute(trim(winname)//'.cnstr_type' ,'p',com_integer,1,'')
756 
757  CALL com_new_attribute(trim(winname)//'.t3g:real' ,'p',com_integer,3,'')
758  CALL com_new_attribute(trim(winname)//'.t3g:virtual','p',com_integer,3,'')
759 
760  CALL com_new_attribute(trim(winname)//'.q4g:real' ,'p',com_integer,4,'')
761  CALL com_new_attribute(trim(winname)//'.q4g:virtual','p',com_integer,4,'')
762 
763 ! ******************************************************************************
764 ! End
765 ! ******************************************************************************
766 
767  END SUBROUTINE rflu_genx_createattrgridsurf
768 
769 
770 
771 
772 
773 
774 
775 
776 ! ******************************************************************************
777 !
778 ! Purpose: Create new attributes for grid speeds.
779 !
780 ! Description: None.
781 !
782 ! Input:
783 ! pRegion Pointer to region
784 !
785 ! Output: None.
786 !
787 ! Notes: None.
788 !
789 ! ******************************************************************************
790 
791  SUBROUTINE rflu_genx_createattrgspeeds(pRegion)
792 
793  IMPLICIT NONE
794 
795 ! ******************************************************************************
796 ! Declarations and definitions
797 ! ******************************************************************************
798 
799 ! ==============================================================================
800 ! Arguments
801 ! ==============================================================================
802 
803  TYPE(t_region), POINTER :: pregion
804 
805 ! ==============================================================================
806 ! Locals
807 ! ==============================================================================
808 
809  CHARACTER(CHRLEN) :: winname
810  TYPE(t_global), POINTER :: global
811 
812 ! ******************************************************************************
813 ! Start, set pointers
814 ! ******************************************************************************
815 
816  global => pregion%global
817 
818 ! ******************************************************************************
819 ! Create new attributes
820 ! ******************************************************************************
821 
822 ! ==============================================================================
823 ! Volume
824 ! ==============================================================================
825 
826  winname = global%volWinName
827 
828  CALL com_new_attribute(trim(winname)//'.gs','p',com_double_precision, &
829  1,'m/s')
830 
831 ! ==============================================================================
832 ! Surface
833 ! ==============================================================================
834 
835  winname = global%surfWinName
836 
837  CALL com_new_attribute(trim(winname)//'.gs','e',com_double_precision, &
838  1,'m/s')
839 
840 ! ******************************************************************************
841 ! End
842 ! ******************************************************************************
843 
844  END SUBROUTINE rflu_genx_createattrgspeeds
845 
846 
847 
848 
849 
850 
851 
852 ! ******************************************************************************
853 !
854 ! Purpose: Create new attributes for interface data.
855 !
856 ! Description: None.
857 !
858 ! Input:
859 ! pRegion Pointer to region
860 !
861 ! Output: None.
862 !
863 ! Notes: None.
864 !
865 ! ******************************************************************************
866 
867  SUBROUTINE rflu_genx_createattrinterf(pRegion)
868 
869  IMPLICIT NONE
870 
871 ! ******************************************************************************
872 ! Declarations and definitions
873 ! ******************************************************************************
874 
875 ! ==============================================================================
876 ! Arguments
877 ! ==============================================================================
878 
879  TYPE(t_region), POINTER :: pregion
880 
881 ! ==============================================================================
882 ! Locals
883 ! ==============================================================================
884 
885  CHARACTER(CHRLEN) :: winname
886  INTEGER :: comd,comi
887  TYPE(t_global), POINTER :: global
888 
889 ! ******************************************************************************
890 ! Start, set pointers and variables
891 ! ******************************************************************************
892 
893  global => pregion%global
894 
895  winname = global%surfWinName
896 
897  comd = com_double_precision
898  comi = com_integer
899 
900 ! ******************************************************************************
901 ! Create new attributes
902 ! ******************************************************************************
903 
904 ! ==============================================================================
905 ! Incoming data
906 ! ==============================================================================
907 
908  CALL com_new_attribute(trim(winname)//'.du_alp' ,'n',comd,3,'m' )
909  CALL com_new_attribute(trim(winname)//'.mdot_alp' ,'e',comd,1,'kg/(m^2s)')
910  CALL com_new_attribute(trim(winname)//'.rhofvf_alp','e',comd,3,'kg/(m^2s)')
911  CALL com_new_attribute(trim(winname)//'.Tflm_alp' ,'e',comd,1,'K' )
912  CALL com_new_attribute( trim(winname)//'.zoomFact' ,'w',comd,1,'none' )
913  CALL com_new_attribute(trim(winname)//'.Tb_alp' ,'e',comd,1,'K' )
914 
915 ! ==============================================================================
916 ! Outgoing data
917 ! ==============================================================================
918 
919  CALL com_new_attribute(trim(winname)//'.nf_alp' ,'e',comd,3,'' )
920  CALL com_new_attribute(trim(winname)//'.pf' ,'e',comd,1,'Pa' )
921  CALL com_new_attribute(trim(winname)//'.tf' ,'e',comd,3,'Pa' )
922  CALL com_new_attribute(trim(winname)//'.qc' ,'e',comd,1,'kgK/(m^2s)')
923  CALL com_new_attribute(trim(winname)//'.qr' ,'e',comd,1,'kgK/(m^2s)')
924  CALL com_new_attribute(trim(winname)//'.rhof_alp','e',comd,1,'kg/m^3' )
925  CALL com_new_attribute(trim(winname)//'.Tf' ,'e',comd,1,'K' )
926 ! CALL COM_new_attribute(TRIM(winName)//'.Tv' ,'e',comd,1,'K' )
927 ! CALL COM_new_attribute(TRIM(winName)//'.dn' ,'e',comd,1,'m' )
928 
929 ! ==============================================================================
930 ! Interface data (utility data used in the interface)
931 ! ==============================================================================
932 
933  CALL com_new_attribute(trim(winname)//'.bflag' ,'e',comi,1,'' )
934 
935 ! ******************************************************************************
936 ! End
937 ! ******************************************************************************
938 
939  END SUBROUTINE rflu_genx_createattrinterf
940 
941 
942 
943 
944 
945 
946 
947 ! ******************************************************************************
948 !
949 ! Purpose: Create new attributes for statistics data.
950 !
951 ! Description: None.
952 !
953 ! Input:
954 ! pRegion Pointer to region
955 !
956 ! Output: None.
957 !
958 ! Notes: None.
959 !
960 ! ******************************************************************************
961 
962  SUBROUTINE rflu_genx_createattrstats(pRegion)
963 #ifdef STATS
965 #endif
966  IMPLICIT NONE
967 
968 ! ******************************************************************************
969 ! Declarations and definitions
970 ! ******************************************************************************
971 
972 ! ==============================================================================
973 ! Arguments
974 ! ==============================================================================
975 
976  TYPE(t_region), POINTER :: pregion
977 
978 ! ******************************************************************************
979 ! Create new attributes
980 ! ******************************************************************************
981 #ifdef STATS
982  CALL stat_rflu_genxcreateattr(pregion)
983 #endif
984 ! ******************************************************************************
985 ! End
986 ! ******************************************************************************
987 
988  END SUBROUTINE rflu_genx_createattrstats
989 
990 
991 
992 
993 
994 
995 
996 ! ******************************************************************************
997 !
998 ! Purpose: Create new attributes for turbulence.
999 !
1000 ! Description: None.
1001 !
1002 ! Input:
1003 ! pRegion Pointer to region
1004 !
1005 ! Output: None.
1006 !
1007 ! Notes: None.
1008 !
1009 ! ******************************************************************************
1010 
1011  SUBROUTINE rflu_genx_createattrturb(pRegion)
1012 #ifdef TURB
1014 #endif
1015  IMPLICIT NONE
1016 
1017 ! ******************************************************************************
1018 ! Declarations and definitions
1019 ! ******************************************************************************
1020 
1021 ! ==============================================================================
1022 ! Arguments
1023 ! ==============================================================================
1024 
1025  TYPE(t_region), POINTER :: pregion
1026 
1027 ! ******************************************************************************
1028 ! Create new attributes
1029 ! ******************************************************************************
1030 #ifdef TURB
1031  CALL turb_rflu_genxcreateattr(pregion)
1032 #endif
1033 ! ******************************************************************************
1034 ! End
1035 ! ******************************************************************************
1036 
1037  END SUBROUTINE rflu_genx_createattrturb
1038 
1039 
1040 
1041 
1042 
1043 
1044 
1045 ! ******************************************************************************
1046 !
1047 ! Purpose: Wrapper for new attributes routines.
1048 !
1049 ! Description: None.
1050 !
1051 ! Input:
1052 ! pRegion Pointer to region
1053 !
1054 ! Output: None.
1055 !
1056 ! Notes: None.
1057 !
1058 ! ******************************************************************************
1059 
1060  SUBROUTINE rflu_genx_createattrwrapper(pRegion)
1061 
1062  IMPLICIT NONE
1063 
1064 ! ******************************************************************************
1065 ! Declarations and definitions
1066 ! ******************************************************************************
1067 
1068 ! ==============================================================================
1069 ! Arguments
1070 ! ==============================================================================
1071 
1072  TYPE(t_region), POINTER :: pregion
1073 
1074 ! ******************************************************************************
1075 ! Create new attributes
1076 ! ******************************************************************************
1077 
1078 ! ==============================================================================
1079 ! Mixture
1080 ! ==============================================================================
1081 
1082  CALL rflu_genx_createattrflow(pregion)
1083  CALL rflu_genx_createattrgridsurf(pregion)
1084  CALL rflu_genx_createattrgspeeds(pregion)
1085  CALL rflu_genx_createattrinterf(pregion)
1086  CALL rflu_genx_createattrdisp(pregion)
1087 
1088 ! ==============================================================================
1089 ! Statistics
1090 ! ==============================================================================
1091 
1092  CALL rflu_genx_createattrstats(pregion)
1093 
1094 ! ==============================================================================
1095 ! Turbulence
1096 ! ==============================================================================
1097 
1098  CALL rflu_genx_createattrturb(pregion)
1099 
1100 ! ******************************************************************************
1101 ! End
1102 ! ******************************************************************************
1103 
1104  END SUBROUTINE rflu_genx_createattrwrapper
1105 
1106 
1107 
1108 
1109 
1110 
1111 
1112 ! ******************************************************************************
1113 !
1114 ! Purpose: Create interface data arrays.
1115 !
1116 ! Description: None.
1117 !
1118 ! Input:
1119 ! pRegion Pointer to region
1120 !
1121 ! Output: None.
1122 !
1123 ! Notes: None.
1124 !
1125 ! ******************************************************************************
1126 
1127  SUBROUTINE rflu_genx_createdatainterf(pRegion)
1128 
1129  IMPLICIT NONE
1130 
1131 ! ******************************************************************************
1132 ! Declarations and definitions
1133 ! ******************************************************************************
1134 
1135 ! ==============================================================================
1136 ! Arguments
1137 ! ==============================================================================
1138 
1139  TYPE(t_region), POINTER :: pregion
1140 
1141 ! ==============================================================================
1142 ! Locals
1143 ! ==============================================================================
1144 
1145  INTEGER :: errorflag,ifl,ipatch,ivl
1146  TYPE(t_global), POINTER :: global
1147  TYPE(t_grid), POINTER :: pgrid
1148  TYPE(t_patch), POINTER :: ppatch
1149 
1150 ! ******************************************************************************
1151 ! Start, set pointers
1152 ! ******************************************************************************
1153 
1154  global => pregion%global
1155 
1156  pgrid => pregion%grid
1157 
1158  CALL registerfunction(global,'RFLU_GENX_CreateDataInterf',&
1159  'RFLU_ModRocstarAdmin.F90')
1160 
1161 ! ******************************************************************************
1162 ! Allocate memory
1163 ! ******************************************************************************
1164 
1165  DO ipatch = 1,pgrid%nPatches
1166  ppatch => pregion%patches(ipatch)
1167 
1168 ! ==============================================================================
1169 ! Surface grid deformation
1170 ! ==============================================================================
1171 
1172  ALLOCATE(ppatch%dXyz(xcoord:zcoord,ppatch%nBVertTot),stat=errorflag)
1173  global%error = errorflag
1174  IF ( global%error /= err_none ) THEN
1175  CALL errorstop(global,err_allocate,__line__,'pPatch%dXyz')
1176  END IF ! global%error
1177 
1178  DO ivl = 1,ppatch%nBVertTot
1179  ppatch%dXyz(xcoord,ivl) = 0.0_rfreal
1180  ppatch%dXyz(ycoord,ivl) = 0.0_rfreal
1181  ppatch%dXyz(zcoord,ivl) = 0.0_rfreal
1182  END DO ! ivl
1183 
1184 ! ==============================================================================
1185 ! Input data
1186 ! ==============================================================================
1187 
1188 ! ------------------------------------------------------------------------------
1189 ! All patches
1190 ! ------------------------------------------------------------------------------
1191 
1192  ALLOCATE(ppatch%duAlp(xcoord:zcoord,ppatch%nBVertTot),stat=errorflag)
1193  global%error = errorflag
1194  IF ( global%error /= err_none ) THEN
1195  CALL errorstop(global,err_allocate,__line__,'pPatch%duAlp')
1196  END IF ! global
1197 
1198  DO ivl = 1,ppatch%nBVertTot
1199  ppatch%duAlp(xcoord,ivl) = 0.0_rfreal
1200  ppatch%duAlp(ycoord,ivl) = 0.0_rfreal
1201  ppatch%duAlp(zcoord,ivl) = 0.0_rfreal
1202  END DO ! ivl
1203 
1204 ! ------------------------------------------------------------------------------
1205 ! Interacting patches (burning or non-burning)
1206 ! ------------------------------------------------------------------------------
1207 
1208  IF ( ppatch%bcCoupled /= bc_not_coupled ) THEN
1209  ALLOCATE(ppatch%rhofvfAlp(xcoord:zcoord,ppatch%nBFacesTot), &
1210  stat=errorflag)
1211  global%error = errorflag
1212  IF ( global%error /= err_none ) THEN
1213  CALL errorstop(global,err_allocate,__line__,'pPatch%rhofvfAlp')
1214  END IF ! global
1215 
1216  DO ifl = 1,ppatch%nBFacesTot
1217  ppatch%rhofvfAlp(xcoord,ifl) = 0.0_rfreal
1218  ppatch%rhofvfAlp(ycoord,ifl) = 0.0_rfreal
1219  ppatch%rhofvfAlp(zcoord,ifl) = 0.0_rfreal
1220  END DO ! ifl
1221 
1222  ALLOCATE(ppatch%tbAlp(ppatch%nBFacesTot),stat=errorflag)
1223  global%error = errorflag
1224  IF ( global%error /= err_none ) THEN
1225  CALL errorstop(global,err_allocate,__line__,'pPatch%tbAlp')
1226  END IF ! global
1227 
1228  DO ifl = 1,ppatch%nBFacesTot
1229  ppatch%tbAlp(ifl) = 0.0_rfreal
1230  END DO ! ifl
1231  END IF ! pPatch
1232 
1233 ! ------------------------------------------------------------------------------
1234 ! Burning patches
1235 ! ------------------------------------------------------------------------------
1236 
1237  IF ( ppatch%bcCoupled == bc_burning ) THEN
1238  ALLOCATE(ppatch%mdotAlp(ppatch%nBFacesTot),stat=errorflag)
1239  global%error = errorflag
1240  IF ( global%error /= err_none ) THEN
1241  CALL errorstop(global,err_allocate,__line__,'pPatch%mdotAlp')
1242  END IF ! global
1243 
1244  DO ifl = 1,ppatch%nBFacesTot
1245  ppatch%mdotAlp(ifl) = 0.0_rfreal
1246  END DO ! ifl
1247 
1248  ALLOCATE(ppatch%tflmAlp(ppatch%nBFacesTot),stat=errorflag)
1249  global%error = errorflag
1250  IF ( global%error /= err_none ) THEN
1251  CALL errorstop(global,err_allocate,__line__,'pPatch%tflmAlp')
1252  END IF ! global
1253 
1254  DO ifl = 1,ppatch%nBFacesTot
1255  ppatch%tflmAlp(ifl) = 0.0_rfreal
1256  END DO ! ifl
1257  END IF ! pPatch
1258 
1259 ! ==============================================================================
1260 ! Output data
1261 ! ==============================================================================
1262 
1263 ! ------------------------------------------------------------------------------
1264 ! Interacting patches (burning or non-burning)
1265 ! ------------------------------------------------------------------------------
1266 
1267  IF ( ppatch%bcCoupled /= bc_not_coupled ) THEN
1268  ALLOCATE(ppatch%nfAlp(xcoord:zcoord,ppatch%nBFacesTot),stat=errorflag)
1269  global%error = errorflag
1270  IF ( global%error /= err_none ) THEN
1271  CALL errorstop(global,err_allocate,__line__,'pPatch%nfAlp')
1272  END IF ! global
1273 
1274  DO ifl = 1,ppatch%nBFacesTot
1275  ppatch%nfAlp(xcoord,ifl) = 0.0_rfreal
1276  ppatch%nfAlp(ycoord,ifl) = 0.0_rfreal
1277  ppatch%nfAlp(zcoord,ifl) = 0.0_rfreal
1278  END DO ! ifl
1279 
1280  ALLOCATE(ppatch%rhofAlp(ppatch%nBFacesTot),stat=errorflag)
1281  global%error = errorflag
1282  IF ( global%error /= err_none ) THEN
1283  CALL errorstop(global,err_allocate,__line__,'pPatch%rhofAlp')
1284  END IF ! global
1285 
1286  DO ifl = 1,ppatch%nBFacesTot
1287  ppatch%rhofAlp(ifl) = 0.0_rfreal
1288  END DO ! ifl
1289 
1290  ALLOCATE(ppatch%pf(ppatch%nBFacesTot),stat=errorflag)
1291  global%error = errorflag
1292  IF ( global%error /= err_none ) THEN
1293  CALL errorstop(global,err_allocate,__line__,'pPatch%pf')
1294  END IF ! global
1295 
1296  DO ifl = 1,ppatch%nBFacesTot
1297  ppatch%pf(ifl) = 0.0_rfreal
1298  END DO ! ifl
1299 
1300  ALLOCATE(ppatch%tracf(xcoord:zcoord,ppatch%nBFacesTot),stat=errorflag)
1301  global%error = errorflag
1302  IF ( global%error /= err_none ) THEN
1303  CALL errorstop(global,err_allocate,__line__,'pPatch%tracf')
1304  END IF ! global
1305 
1306  DO ifl = 1,ppatch%nBFacesTot
1307  ppatch%tracf(xcoord,ifl) = 0.0_rfreal
1308  ppatch%tracf(ycoord,ifl) = 0.0_rfreal
1309  ppatch%tracf(zcoord,ifl) = 0.0_rfreal
1310  END DO ! ifl
1311 
1312  ALLOCATE(ppatch%qc(ppatch%nBFacesTot),stat=errorflag)
1313  global%error = errorflag
1314  IF ( global%error /= err_none ) THEN
1315  CALL errorstop(global,err_allocate,__line__,'pPatch%qc')
1316  END IF ! global
1317 
1318  DO ifl = 1,ppatch%nBFacesTot
1319  ppatch%qc(ifl) = 0.0_rfreal
1320  END DO ! ifl
1321 
1322  ALLOCATE(ppatch%qr(ppatch%nBFacesTot),stat=errorflag)
1323  global%error = errorflag
1324  IF ( global%error /= err_none ) THEN
1325  CALL errorstop(global,err_allocate,__line__,'pPatch%qr')
1326  END IF ! global
1327 
1328  DO ifl = 1,ppatch%nBFacesTot
1329  ppatch%qr(ifl) = 0.0_rfreal
1330  END DO ! ifl
1331  END IF ! pPatch%bcCoupled
1332 
1333 ! ------------------------------------------------------------------------------
1334 ! Burning patches
1335 ! ------------------------------------------------------------------------------
1336 
1337  IF ( ppatch%bcCoupled == bc_burning ) THEN
1338  ALLOCATE(ppatch%tempf(ppatch%nBFacesTot),stat=errorflag)
1339  global%error = errorflag
1340  IF ( global%error /= err_none ) THEN
1341  CALL errorstop(global,err_allocate,__line__,'pPatch%tempf')
1342  END IF ! global
1343 
1344  DO ifl = 1,ppatch%nBFacesTot
1345  ppatch%tempf(ifl) = 0.0_rfreal
1346  END DO ! ifl
1347 
1348 ! TEMPORARY
1349 ! bFlag will need to be removed from Rocflu eventually. For the
1350 ! moment, leave in, but always set bFlag to 1. This means that igniting
1351 ! computations cannot be run.
1352 
1353  ALLOCATE(ppatch%bFlag(ppatch%nBFacesTot),stat=errorflag)
1354  global%error = errorflag
1355  IF ( global%error /= err_none ) THEN
1356  CALL errorstop(global,err_allocate,__line__,'pPatch%bFlag')
1357  END IF ! global
1358 
1359  DO ifl = 1,ppatch%nBFaces
1360  ppatch%bFlag(ifl) = 1
1361  END DO ! ifl
1362 
1363  DO ifl = ppatch%nBFaces+1,ppatch%nBFacesTot
1364  ppatch%bFlag(ifl) = crazy_value_int
1365  END DO ! ifl
1366 ! END TEMPORARY
1367  END IF ! pPatch%bcType
1368  END DO ! iPatch
1369 
1370 ! ******************************************************************************
1371 ! End
1372 ! ******************************************************************************
1373 
1374  CALL rflu_genx_initbflag(pregion)
1375 
1376  CALL deregisterfunction(global)
1377 
1378  END SUBROUTINE rflu_genx_createdatainterf
1379 
1380 
1381 
1382 
1383 
1384 
1385 
1386 
1387 
1388 
1389 ! ******************************************************************************
1390 !
1391 ! Purpose: Create surface grid.
1392 !
1393 ! Description: None.
1394 !
1395 ! Input:
1396 ! pRegion Pointer to region
1397 !
1398 ! Output: None.
1399 !
1400 ! Notes:
1401 ! 1. Roccom requires locally-numbered boundary-face lists.
1402 !
1403 ! ******************************************************************************
1404 
1405  SUBROUTINE rflu_genx_creategridsurf(pRegion)
1406 
1408 
1409  IMPLICIT NONE
1410 
1411 ! ******************************************************************************
1412 ! Declarations and definitions
1413 ! ******************************************************************************
1414 
1415 ! ==============================================================================
1416 ! Arguments
1417 ! ==============================================================================
1418 
1419  TYPE(t_region), POINTER :: pregion
1420 
1421 ! ==============================================================================
1422 ! Locals
1423 ! ==============================================================================
1424 
1425  INTEGER :: errorflag,ipatch
1426  TYPE(t_global), POINTER :: global
1427  TYPE(t_grid), POINTER :: pgrid
1428  TYPE(t_patch), POINTER :: ppatch
1429 
1430 ! ******************************************************************************
1431 ! Start, set pointers
1432 ! ******************************************************************************
1433 
1434  global => pregion%global
1435 
1436  pgrid => pregion%grid
1437 
1438  CALL registerfunction(global,'RFLU_GENX_CreateGridSurf',&
1439  'RFLU_ModRocstarAdmin.F90')
1440 
1441 ! ******************************************************************************
1442 ! Create locally-numbered boundary face lists
1443 ! ******************************************************************************
1444 
1445  CALL rflu_createbfaceloclists(pregion)
1446 
1447 ! ******************************************************************************
1448 ! Allocate memory and initialize
1449 ! ******************************************************************************
1450 
1451  DO ipatch=1,pgrid%nPatches
1452  ppatch => pregion%patches(ipatch)
1453 
1454  ALLOCATE(ppatch%bcFlag(1),stat=errorflag)
1455  global%error = errorflag
1456  IF ( global%error /= err_none ) THEN
1457  CALL errorstop(global,err_allocate,__line__,'pPatch%bcFlag')
1458  END IF ! global
1459 
1460  ppatch%bcFlag(1) = ppatch%bcCoupled
1461 
1462  ALLOCATE(ppatch%patchNo(1),stat=errorflag)
1463  global%error = errorflag
1464  IF ( global%error /= err_none ) THEN
1465  CALL errorstop(global,err_allocate,__line__,'pPatch%patchNo')
1466  END IF ! global
1467 
1468  ppatch%patchNo(1) = ppatch%iPatchGlobal
1469 
1470  ALLOCATE(ppatch%cnstrType(1),stat=errorflag)
1471  global%error = errorflag
1472  IF ( global%error /= err_none ) THEN
1473  CALL errorstop(global,err_allocate,__line__,'pPatch%cnstrType')
1474  END IF ! global
1475 
1476  ppatch%cnstrType(1) = rflu_genx_setcnstrtype(ppatch%movePatchDir)
1477 
1478  ALLOCATE(ppatch%xyz(xcoord:zcoord,ppatch%nBVertTot),stat=errorflag)
1479  global%error = errorflag
1480  IF ( global%error /= err_none ) THEN
1481  CALL errorstop(global,err_allocate,__line__,'pPatch%xyz')
1482  END IF ! global%error
1483  END DO ! iPatch
1484 
1485 ! ******************************************************************************
1486 ! End
1487 ! ******************************************************************************
1488 
1489  CALL deregisterfunction(global)
1490 
1491  END SUBROUTINE rflu_genx_creategridsurf
1492 
1493 
1494 
1495 
1496 
1497 
1498 
1499 ! ******************************************************************************
1500 !
1501 ! Purpose: Create pconn attribute.
1502 !
1503 ! Description: None.
1504 !
1505 ! Input:
1506 ! pRegion Pointer to region
1507 !
1508 ! Output: None.
1509 !
1510 ! Notes: None.
1511 !
1512 ! ******************************************************************************
1513 
1514  SUBROUTINE rflu_genx_createpconn(pRegion)
1515 
1516  IMPLICIT NONE
1517 
1518 ! ******************************************************************************
1519 ! Declarations and definitions
1520 ! ******************************************************************************
1521 
1522 ! ==============================================================================
1523 ! Arguments
1524 ! ==============================================================================
1525 
1526  TYPE(t_region), POINTER :: pregion
1527 
1528 ! ==============================================================================
1529 ! Locals
1530 ! ==============================================================================
1531 
1532  INTEGER :: errorflag,iborder
1533  TYPE(t_global), POINTER :: global
1534  TYPE(t_grid), POINTER :: pgrid
1535  TYPE(t_border), POINTER :: pborder
1536 
1537 ! ******************************************************************************
1538 ! Start, set pointers
1539 ! ******************************************************************************
1540 
1541  global => pregion%global
1542 
1543  pgrid => pregion%grid
1544 
1545  CALL registerfunction(global,'RFLU_GENX_CreatePConn',&
1546  'RFLU_ModRocstarAdmin.F90')
1547 
1548  IF ( global%myProcid == masterproc .AND. &
1549  global%verbLevel >= verbose_high ) THEN
1550  WRITE(stdout,'(A,1X,A)') solver_name,'Creating pconn...'
1551  END IF ! global%verbLevel
1552 
1553 ! ******************************************************************************
1554 ! Determine size of pconn attribute
1555 ! ******************************************************************************
1556 
1557  pgrid%pconnSizeTot = 0
1558  pgrid%pconnSizeGhost = 0
1559 
1560 ! ==============================================================================
1561 ! Block 1: Shared vertices
1562 ! ==============================================================================
1563 
1564  pgrid%pconnSizeTot = pgrid%pconnSizeTot + 1
1565 
1566  DO iborder = 1,pgrid%nBorders
1567  pborder => pgrid%borders(iborder)
1568 
1569  pgrid%pconnSizeTot = pgrid%pconnSizeTot + pborder%nVertShared + 2
1570  END DO ! iBorder
1571 
1572 ! ==============================================================================
1573 ! Block 2: Vertices to send
1574 ! ==============================================================================
1575 
1576  pgrid%pconnSizeTot = pgrid%pconnSizeTot + 1
1577  pgrid%pconnSizeGhost = pgrid%pconnSizeGhost + 1
1578 
1579  DO iborder = 1,pgrid%nBorders
1580  pborder => pgrid%borders(iborder)
1581 
1582  pgrid%pconnSizeTot = pgrid%pconnSizeTot + pborder%nVertSend + 2
1583  pgrid%pconnSizeGhost = pgrid%pconnSizeGhost + pborder%nVertSend + 2
1584  END DO ! iBorder
1585 
1586 ! ==============================================================================
1587 ! Block 3: Vertices to recv
1588 ! ==============================================================================
1589 
1590  pgrid%pconnSizeTot = pgrid%pconnSizeTot + 1
1591  pgrid%pconnSizeGhost = pgrid%pconnSizeGhost + 1
1592 
1593  DO iborder = 1,pgrid%nBorders
1594  pborder => pgrid%borders(iborder)
1595 
1596  pgrid%pconnSizeTot = pgrid%pconnSizeTot + pborder%nVertRecv + 2
1597  pgrid%pconnSizeGhost = pgrid%pconnSizeGhost + pborder%nVertRecv + 2
1598  END DO ! iBorder
1599 
1600 ! ==============================================================================
1601 ! Block 4: Cells to send
1602 ! ==============================================================================
1603 
1604  pgrid%pconnSizeTot = pgrid%pconnSizeTot + 1
1605  pgrid%pconnSizeGhost = pgrid%pconnSizeGhost + 1
1606 
1607  DO iborder = 1,pgrid%nBorders
1608  pborder => pgrid%borders(iborder)
1609 
1610  pgrid%pconnSizeTot = pgrid%pconnSizeTot + pborder%nCellsSend + 2
1611  pgrid%pconnSizeGhost = pgrid%pconnSizeGhost + pborder%nCellsSend + 2
1612  END DO ! iBorder
1613 
1614 ! ==============================================================================
1615 ! Block 5: Cells to recv
1616 ! ==============================================================================
1617 
1618  pgrid%pconnSizeTot = pgrid%pconnSizeTot + 1
1619  pgrid%pconnSizeGhost = pgrid%pconnSizeGhost + 1
1620 
1621  DO iborder = 1,pgrid%nBorders
1622  pborder => pgrid%borders(iborder)
1623 
1624  pgrid%pconnSizeTot = pgrid%pconnSizeTot + pborder%nCellsRecv + 2
1625  pgrid%pconnSizeGhost = pgrid%pconnSizeGhost + pborder%nCellsRecv + 2
1626  END DO ! iBorder
1627 
1628 ! ******************************************************************************
1629 ! Allocate memory
1630 ! ******************************************************************************
1631 
1632  ALLOCATE(pgrid%pconn(pgrid%pconnSizeTot),stat=errorflag)
1633  global%error = errorflag
1634  IF ( global%error /= err_none ) THEN
1635  CALL errorstop(global,err_allocate,__line__,'pGrid%pconn')
1636  END IF ! global%error
1637 
1638 ! ******************************************************************************
1639 ! End
1640 ! ******************************************************************************
1641 
1642  IF ( global%myProcid == masterproc .AND. &
1643  global%verbLevel >= verbose_high ) THEN
1644  WRITE(stdout,'(A,1X,A)') solver_name,'Creating pconn done.'
1645  END IF ! global%verbLevel
1646 
1647  CALL deregisterfunction(global)
1648 
1649  END SUBROUTINE rflu_genx_createpconn
1650 
1651 
1652 
1653 
1654 
1655 
1656 
1657 
1658 ! ******************************************************************************
1659 !
1660 ! Purpose: Create windows.
1661 !
1662 ! Description: None.
1663 !
1664 ! Input:
1665 ! pRegion Pointer to region
1666 ! communicator Communicator
1667 !
1668 ! Output: None.
1669 !
1670 ! Notes: None.
1671 !
1672 ! ******************************************************************************
1673 
1674  SUBROUTINE rflu_genx_createwindows(pRegion,communicator)
1675 
1676  IMPLICIT NONE
1677 
1678 ! ******************************************************************************
1679 ! Declarations and definitions
1680 ! ******************************************************************************
1681 
1682 ! ==============================================================================
1683 ! Arguments
1684 ! ==============================================================================
1685 
1686  INTEGER, INTENT(IN), OPTIONAL :: communicator
1687  TYPE(t_region), POINTER :: pregion
1688 
1689 ! ==============================================================================
1690 ! Locals
1691 ! ==============================================================================
1692 
1693  TYPE(t_global), POINTER :: global
1694 
1695 ! ******************************************************************************
1696 ! Start, set pointers
1697 ! ******************************************************************************
1698 
1699  global => pregion%global
1700 
1701  IF ( global%myProcid == masterproc .AND. &
1702  global%verbLevel >= verbose_high ) THEN
1703  WRITE(stdout,'(A,1X,A)') solver_name,'Creating windows...'
1704  END IF ! global%myProcid
1705 
1706 ! ******************************************************************************
1707 ! Set names and create windows
1708 ! ******************************************************************************
1709 
1710  global%surfWinName = trim(global%winName)//'_surf'
1711  global%volWinName = trim(global%winName)//'_vol'
1712 
1713  IF ( global%myProcid == masterproc .AND. &
1714  global%verbLevel >= verbose_high ) THEN
1715  WRITE(stdout,'(A,3X,A,1X,A)') solver_name,'Surface window name:', &
1716  trim(global%surfWinName)
1717  WRITE(stdout,'(A,3X,A,1X,A)') solver_name,'Volume window name:', &
1718  trim(global%volWinName)
1719  END IF ! global%myProcid
1720 
1721  IF ( present(communicator) ) THEN
1722  CALL com_new_window(trim(global%surfWinName),communicator)
1723  CALL com_new_window(trim(global%volWinName),communicator)
1724  ELSE
1725  CALL com_new_window(trim(global%surfWinName))
1726  CALL com_new_window(trim(global%volWinName))
1727  END IF ! PRESENT
1728 
1729 ! ******************************************************************************
1730 ! End
1731 ! ******************************************************************************
1732 
1733  IF ( global%myProcid == masterproc .AND. &
1734  global%verbLevel >= verbose_high ) THEN
1735  WRITE(stdout,'(A,1X,A)') solver_name,'Creating windows done.'
1736  END IF ! global%myProcid
1737 
1738  END SUBROUTINE rflu_genx_createwindows
1739 
1740 
1741 
1742 
1743 
1744 
1745 
1746 ! ******************************************************************************
1747 !
1748 ! Purpose: Inform Roccom that window creation is done.
1749 !
1750 ! Description: None.
1751 !
1752 ! Input:
1753 ! pRegion Pointer to region
1754 !
1755 ! Output: None.
1756 !
1757 ! Notes: None.
1758 !
1759 ! ******************************************************************************
1760 
1761  SUBROUTINE rflu_genx_createwindowsdone(pRegion)
1762 
1763  IMPLICIT NONE
1764 
1765 ! ******************************************************************************
1766 ! Declarations and definitions
1767 ! ******************************************************************************
1768 
1769 ! ==============================================================================
1770 ! Arguments
1771 ! ==============================================================================
1772 
1773  TYPE(t_region), POINTER :: pregion
1774 
1775 ! ==============================================================================
1776 ! Locals
1777 ! ==============================================================================
1778 
1779  TYPE(t_global), POINTER :: global
1780 
1781 ! ******************************************************************************
1782 ! Start, set pointers
1783 ! ******************************************************************************
1784 
1785  global => pregion%global
1786 
1787 ! ******************************************************************************
1788 ! Inform Roccom that window creation done
1789 ! ******************************************************************************
1790 
1791  global%surfWinName = trim(global%winName)//'_surf'
1792  CALL com_window_init_done(trim(global%surfWinName))
1793 
1794  global%volWinName = trim(global%winName)//'_vol'
1795  CALL com_window_init_done(trim(global%volWinName))
1796 
1797 ! ******************************************************************************
1798 ! End
1799 ! ******************************************************************************
1800 
1801  END SUBROUTINE rflu_genx_createwindowsdone
1802 
1803 
1804 
1805 
1806 
1807 
1808 
1809 
1810 ! ******************************************************************************
1811 !
1812 ! Purpose: Destroy interface data arrays.
1813 !
1814 ! Description: None.
1815 !
1816 ! Input:
1817 ! pRegion Pointer to region
1818 !
1819 ! Output: None.
1820 !
1821 ! Notes: None.
1822 !
1823 ! ******************************************************************************
1824 
1825  SUBROUTINE rflu_genx_destroydatainterf(pRegion)
1826 
1827  IMPLICIT NONE
1828 
1829 ! ******************************************************************************
1830 ! Declarations and definitions
1831 ! ******************************************************************************
1832 
1833 ! ==============================================================================
1834 ! Arguments
1835 ! ==============================================================================
1836 
1837  TYPE(t_region), POINTER :: pregion
1838 
1839 ! ==============================================================================
1840 ! Locals
1841 ! ==============================================================================
1842 
1843  INTEGER :: errorflag,ipatch
1844  TYPE(t_global), POINTER :: global
1845  TYPE(t_grid), POINTER :: pgrid
1846  TYPE(t_patch), POINTER :: ppatch
1847 
1848 ! ******************************************************************************
1849 ! Start, set pointers
1850 ! ******************************************************************************
1851 
1852  global => pregion%global
1853 
1854  pgrid => pregion%grid
1855 
1856  CALL registerfunction(global,'RFLU_GENX_DestroyDataInterf',&
1857  'RFLU_ModRocstarAdmin.F90')
1858 
1859 ! ******************************************************************************
1860 ! Allocate memory
1861 ! ******************************************************************************
1862 
1863  DO ipatch = 1,pgrid%nPatches
1864  ppatch => pregion%patches(ipatch)
1865 
1866 ! ==============================================================================
1867 ! Surface grid deformation
1868 ! ==============================================================================
1869 
1870  DEALLOCATE(ppatch%dXyz,stat=errorflag)
1871  global%error = errorflag
1872  IF ( global%error /= err_none ) THEN
1873  CALL errorstop(global,err_deallocate,__line__,'pPatch%dXyz')
1874  END IF ! global%error
1875 
1876 ! ==============================================================================
1877 ! Input data
1878 ! ==============================================================================
1879 
1880 ! ------------------------------------------------------------------------------
1881 ! All patches
1882 ! ------------------------------------------------------------------------------
1883 
1884  DEALLOCATE(ppatch%duAlp,stat=errorflag)
1885  global%error = errorflag
1886  IF ( global%error /= err_none ) THEN
1887  CALL errorstop(global,err_deallocate,__line__,'pPatch%duAlp')
1888  END IF ! global
1889 
1890 ! ------------------------------------------------------------------------------
1891 ! Interacting patches (burning or non-burning)
1892 ! ------------------------------------------------------------------------------
1893 
1894  IF ( ppatch%bcCoupled /= bc_not_coupled ) THEN
1895  DEALLOCATE(ppatch%rhofvfAlp,stat=errorflag)
1896  global%error = errorflag
1897  IF ( global%error /= err_none ) THEN
1898  CALL errorstop(global,err_deallocate,__line__,'pPatch%rhofvfAlp')
1899  END IF ! global
1900 
1901  DEALLOCATE(ppatch%tbAlp,stat=errorflag)
1902  global%error = errorflag
1903  IF ( global%error /= err_none ) THEN
1904  CALL errorstop(global,err_deallocate,__line__,'pPatch%tbfAlp')
1905  END IF ! global
1906  END IF ! pPatch
1907 
1908 ! ------------------------------------------------------------------------------
1909 ! Burning patches
1910 ! ------------------------------------------------------------------------------
1911 
1912  IF ( ppatch%bcCoupled == bc_burning ) THEN
1913  DEALLOCATE(ppatch%mdotAlp,stat=errorflag)
1914  global%error = errorflag
1915  IF ( global%error /= err_none ) THEN
1916  CALL errorstop(global,err_deallocate,__line__,'pPatch%mdotAlp')
1917  END IF ! global
1918 
1919  DEALLOCATE(ppatch%tflmAlp,stat=errorflag)
1920  global%error = errorflag
1921  IF ( global%error /= err_none ) THEN
1922  CALL errorstop(global,err_deallocate,__line__,'pPatch%tflmAlp')
1923  END IF ! global
1924  END IF ! pPatch
1925 
1926 ! ==============================================================================
1927 ! Output data
1928 ! ==============================================================================
1929 
1930 ! ------------------------------------------------------------------------------
1931 ! Interacting patches (burning or non-burning)
1932 ! ------------------------------------------------------------------------------
1933 
1934  IF ( ppatch%bcCoupled /= bc_not_coupled ) THEN
1935  DEALLOCATE(ppatch%nfAlp,stat=errorflag)
1936  global%error = errorflag
1937  IF ( global%error /= err_none ) THEN
1938  CALL errorstop(global,err_deallocate,__line__,'pPatch%nfAlp')
1939  END IF ! global
1940 
1941  DEALLOCATE(ppatch%rhofAlp,stat=errorflag)
1942  global%error = errorflag
1943  IF ( global%error /= err_none ) THEN
1944  CALL errorstop(global,err_deallocate,__line__,'pPatch%rhofAlp')
1945  END IF ! global
1946 
1947  DEALLOCATE(ppatch%pf,stat=errorflag)
1948  global%error = errorflag
1949  IF ( global%error /= err_none ) THEN
1950  CALL errorstop(global,err_deallocate,__line__,'pPatch%pf')
1951  END IF ! global
1952 
1953  DEALLOCATE(ppatch%tracf,stat=errorflag)
1954  global%error = errorflag
1955  IF ( global%error /= err_none ) THEN
1956  CALL errorstop(global,err_deallocate,__line__,'pPatch%tracf')
1957  END IF ! global
1958 
1959  DEALLOCATE(ppatch%qc,stat=errorflag)
1960  global%error = errorflag
1961  IF ( global%error /= err_none ) THEN
1962  CALL errorstop(global,err_deallocate,__line__,'pPatch%qc')
1963  END IF ! global
1964 
1965  DEALLOCATE(ppatch%qr,stat=errorflag)
1966  global%error = errorflag
1967  IF ( global%error /= err_none ) THEN
1968  CALL errorstop(global,err_deallocate,__line__,'pPatch%qr')
1969  END IF ! global
1970  END IF ! pPatch%bcCoupled
1971 
1972 ! ------------------------------------------------------------------------------
1973 ! Burning patches
1974 ! ------------------------------------------------------------------------------
1975 
1976  IF ( ppatch%bcCoupled == bc_burning ) THEN
1977  DEALLOCATE(ppatch%tempf,stat=errorflag)
1978  global%error = errorflag
1979  IF ( global%error /= err_none ) THEN
1980  CALL errorstop(global,err_deallocate,__line__,'pPatch%tempf')
1981  END IF ! global
1982 
1983 ! TO BE REMOVED - Needs discussion
1984  DEALLOCATE(ppatch%bFlag,stat=errorflag)
1985  global%error = errorflag
1986  IF ( global%error /= err_none ) THEN
1987  CALL errorstop(global,err_deallocate,__line__,'pPatch%bFlag')
1988  END IF ! global
1989 ! END TO BE REMOVED
1990  END IF ! pPatch%bcType
1991  END DO ! iPatch
1992 
1993 ! ******************************************************************************
1994 ! End
1995 ! ******************************************************************************
1996 
1997  CALL deregisterfunction(global)
1998 
1999  END SUBROUTINE rflu_genx_destroydatainterf
2000 
2001 
2002 
2003 
2004 
2005 
2006 
2007 
2008 ! ******************************************************************************
2009 !
2010 ! Purpose: Destroy surface grid.
2011 !
2012 ! Description: None.
2013 !
2014 ! Input:
2015 ! pRegion Pointer to region
2016 !
2017 ! Output: None.
2018 !
2019 ! Notes: None.
2020 !
2021 ! ******************************************************************************
2022 
2023  SUBROUTINE rflu_genx_destroygridsurf(pRegion)
2024 
2026 
2027  IMPLICIT NONE
2028 
2029 ! ******************************************************************************
2030 ! Declarations and definitions
2031 ! ******************************************************************************
2032 
2033 ! ==============================================================================
2034 ! Arguments
2035 ! ==============================================================================
2036 
2037  TYPE(t_region), POINTER :: pregion
2038 
2039 ! ==============================================================================
2040 ! Locals
2041 ! ==============================================================================
2042 
2043  INTEGER :: errorflag,ipatch
2044  TYPE(t_global), POINTER :: global
2045  TYPE(t_grid), POINTER :: pgrid
2046  TYPE(t_patch), POINTER :: ppatch
2047 
2048 ! ******************************************************************************
2049 ! Start, set pointers
2050 ! ******************************************************************************
2051 
2052  global => pregion%global
2053 
2054  pgrid => pregion%grid
2055 
2056  CALL registerfunction(global,'RFLU_GENX_DestroyGridSurf',&
2057  'RFLU_ModRocstarAdmin.F90')
2058 
2059 ! ******************************************************************************
2060 ! Create locally-numbered boundary face lists
2061 ! ******************************************************************************
2062 
2063  CALL rflu_destroybfaceloclists(pregion)
2064 
2065 ! ******************************************************************************
2066 ! Allocate memory
2067 ! ******************************************************************************
2068 
2069  DO ipatch=1,pgrid%nPatches
2070  ppatch => pregion%patches(ipatch)
2071 
2072  DEALLOCATE(ppatch%bcFlag,stat=errorflag)
2073  global%error = errorflag
2074  IF ( global%error /= err_none ) THEN
2075  CALL errorstop(global,err_deallocate,__line__,'pPatch%bcFlag')
2076  END IF ! global
2077 
2078  DEALLOCATE(ppatch%patchNo,stat=errorflag)
2079  global%error = errorflag
2080  IF ( global%error /= err_none ) THEN
2081  CALL errorstop(global,err_deallocate,__line__,'pPatch%patchNo')
2082  END IF ! global
2083 
2084  DEALLOCATE(ppatch%cnstrType,stat=errorflag)
2085  global%error = errorflag
2086  IF ( global%error /= err_none ) THEN
2087  CALL errorstop(global,err_deallocate,__line__,'pPatch%cnstrType')
2088  END IF ! global
2089 
2090  DEALLOCATE(ppatch%xyz,stat=errorflag)
2091  global%error = errorflag
2092  IF ( global%error /= err_none ) THEN
2093  CALL errorstop(global,err_deallocate,__line__,'pPatch%xyz')
2094  END IF ! global%error
2095  END DO ! iPatch
2096 
2097 ! ******************************************************************************
2098 ! End
2099 ! ******************************************************************************
2100 
2101  CALL deregisterfunction(global)
2102 
2103  END SUBROUTINE rflu_genx_destroygridsurf
2104 
2105 
2106 
2107 
2108 
2109 
2110 
2111 
2112 
2113 
2114 ! ******************************************************************************
2115 !
2116 ! Purpose: Destroy pconn attribute.
2117 !
2118 ! Description: None.
2119 !
2120 ! Input:
2121 ! pRegion Pointer to region
2122 !
2123 ! Output: None.
2124 !
2125 ! Notes: None.
2126 !
2127 ! ******************************************************************************
2128 
2129  SUBROUTINE rflu_genx_destroypconn(pRegion)
2130 
2131  IMPLICIT NONE
2132 
2133 ! ******************************************************************************
2134 ! Declarations and definitions
2135 ! ******************************************************************************
2136 
2137 ! ==============================================================================
2138 ! Arguments
2139 ! ==============================================================================
2140 
2141  TYPE(t_region), POINTER :: pregion
2142 
2143 ! ==============================================================================
2144 ! Locals
2145 ! ==============================================================================
2146 
2147  INTEGER :: errorflag
2148  TYPE(t_global), POINTER :: global
2149  TYPE(t_grid), POINTER :: pgrid
2150 
2151 ! ******************************************************************************
2152 ! Start, set pointers
2153 ! ******************************************************************************
2154 
2155  global => pregion%global
2156 
2157  pgrid => pregion%grid
2158 
2159  CALL registerfunction(global,'RFLU_GENX_DestroyPConn',&
2160  'RFLU_ModRocstarAdmin.F90')
2161 
2162  IF ( global%myProcid == masterproc .AND. &
2163  global%verbLevel >= verbose_high ) THEN
2164  WRITE(stdout,'(A,1X,A)') solver_name,'Destroying pconn...'
2165  END IF ! global%verbLevel
2166 
2167 ! ******************************************************************************
2168 ! Deallocate memory
2169 ! ******************************************************************************
2170 
2171  DEALLOCATE(pgrid%pconn,stat=errorflag)
2172  global%error = errorflag
2173  IF ( global%error /= err_none ) THEN
2174  CALL errorstop(global,err_deallocate,__line__,'pGrid%pconn')
2175  END IF ! global%error
2176 
2177 ! ******************************************************************************
2178 ! End
2179 ! ******************************************************************************
2180 
2181  IF ( global%myProcid == masterproc .AND. &
2182  global%verbLevel >= verbose_high ) THEN
2183  WRITE(stdout,'(A,1X,A)') solver_name,'Destroying pconn done.'
2184  END IF ! global%verbLevel
2185 
2186  CALL deregisterfunction(global)
2187 
2188  END SUBROUTINE rflu_genx_destroypconn
2189 
2190 
2191 
2192 
2193 
2194 
2195 
2196 
2197 
2198 
2199 
2200 ! ******************************************************************************
2201 !
2202 ! Purpose: Hard-code window name.
2203 !
2204 ! Description: None.
2205 !
2206 ! Input:
2207 ! global Pointer to global data
2208 !
2209 ! Output: None.
2210 !
2211 ! Notes:
2212 ! 1. Routine is needed because some utilities are not called through Roccom.
2213 ! This means that rocflu_load_module is not called in which the window name
2214 ! is set. This window name must be set before the windows are created.
2215 ! 2. This routine MUST ONLY BE CALLED IF the parent code is not called through
2216 ! Roccom.
2217 !
2218 ! ******************************************************************************
2219 
2220  SUBROUTINE rflu_genx_hardcodewindowname(global)
2221 
2222  IMPLICIT NONE
2223 
2224 ! ******************************************************************************
2225 ! Declarations and definitions
2226 ! ******************************************************************************
2227 
2228 ! ==============================================================================
2229 ! Arguments
2230 ! ==============================================================================
2231 
2232  TYPE(t_global), POINTER :: global
2233 
2234 ! ******************************************************************************
2235 ! Set names and register windows
2236 ! ******************************************************************************
2237 
2238  global%winName = 'ROCFLU'
2239 
2240 ! ******************************************************************************
2241 ! End
2242 ! ******************************************************************************
2243 
2244  END SUBROUTINE rflu_genx_hardcodewindowname
2245 
2246 
2247 
2248 
2249 
2250 
2251 
2252 
2253 ! ******************************************************************************
2254 !
2255 ! Purpose: Initialize Rocman.
2256 !
2257 ! Description: None.
2258 !
2259 ! Input:
2260 ! pRegion Pointer to region
2261 ! handle Handle
2262 !
2263 ! Output: None.
2264 !
2265 ! Notes: None.
2266 !
2267 ! ******************************************************************************
2268 
2269  SUBROUTINE rflu_genx_initrocman(pRegion,handle)
2270 
2271  IMPLICIT NONE
2272 
2273 ! ******************************************************************************
2274 ! Declarations and definitions
2275 ! ******************************************************************************
2276 
2277 ! ==============================================================================
2278 ! Arguments
2279 ! ==============================================================================
2280 
2281  INTEGER, INTENT(IN) :: handle
2282  TYPE(t_region), POINTER :: pregion
2283 
2284 ! ==============================================================================
2285 ! Locals
2286 ! ==============================================================================
2287 
2288  INTEGER :: solvertype
2289  TYPE(t_global), POINTER :: global
2290 
2291 ! ******************************************************************************
2292 ! Start, set pointers
2293 ! ******************************************************************************
2294 
2295  global => pregion%global
2296 
2297  IF ( global%myProcid == masterproc .AND. &
2298  global%verbLevel >= verbose_high ) THEN
2299  WRITE(stdout,'(A,1X,A)') solver_name,'Initializing Rocman...'
2300  END IF ! global%verbLevel
2301 
2302 ! ******************************************************************************
2303 ! Initialize Rocman
2304 ! ******************************************************************************
2305 
2306  IF ( pregion%mixtInput%flowModel == flow_navst ) THEN
2307  solvertype = 1
2308  ELSE
2309  solvertype = 0
2310  END IF ! pRegion
2311 
2312  CALL com_call_function(handle,3,trim(global%surfWinName), &
2313  trim(global%volWinName),solvertype)
2314 
2315 ! ******************************************************************************
2316 ! End
2317 ! ******************************************************************************
2318 
2319  IF ( global%myProcid == masterproc .AND. &
2320  global%verbLevel >= verbose_high ) THEN
2321  WRITE(stdout,'(A,1X,A)') solver_name,'Initializing Rocman done.'
2322  END IF ! global%verbLevel
2323 
2324  END SUBROUTINE rflu_genx_initrocman
2325 
2326 
2327 
2328 
2329 
2330 
2331 
2332 
2333 ! ******************************************************************************
2334 !
2335 ! Purpose: Read Rocflu control file for GENX runs.
2336 !
2337 ! Description: None.
2338 !
2339 ! Input:
2340 ! global global type
2341 !
2342 ! Output: None.
2343 !
2344 ! Notes: None.
2345 !
2346 ! ******************************************************************************
2347 
2348  SUBROUTINE rflu_genx_readctrlfile(global)
2349 
2350  IMPLICIT NONE
2351 
2352 ! ******************************************************************************
2353 ! Definitions and declarations
2354 ! ******************************************************************************
2355 
2356 ! ==============================================================================
2357 ! Arguments
2358 ! ==============================================================================
2359 
2360  TYPE(t_global), POINTER :: global
2361 
2362 ! ==============================================================================
2363 ! Locals
2364 ! ==============================================================================
2365 
2366  CHARACTER(CHRLEN) :: ifilename
2367  INTEGER :: errorflag,verblevelcom
2368 
2369 ! ******************************************************************************
2370 ! Start
2371 ! ******************************************************************************
2372 
2373  CALL registerfunction(global,'RFLU_GENX_ReadCtrlFile',&
2374  'RFLU_ModRocstarAdmin.F90')
2375 
2376 ! ==============================================================================
2377 ! Open file
2378 ! ==============================================================================
2379 
2380  ifilename = './Rocflu/RocfluControl.txt'
2381 
2382  OPEN(if_control,file=ifilename,form='FORMATTED',status='OLD', &
2383  iostat=errorflag)
2384  global%error = errorflag
2385  IF ( global%error /= err_none ) THEN
2386  CALL errorstop(global,err_file_open,__line__,'File: '//trim(ifilename))
2387  END IF ! global%error
2388 
2389 ! ==============================================================================
2390 ! Read file
2391 ! ==============================================================================
2392 
2393 ! ------------------------------------------------------------------------------
2394 ! Case name
2395 ! ------------------------------------------------------------------------------
2396 
2397  READ(if_control,'(A)',iostat=errorflag) global%casename
2398  global%error = errorflag
2399  IF ( global%error /= err_none ) THEN
2400  CALL errorstop( global,err_file_read,__line__,'File: '//trim(ifilename) )
2401  END IF ! global%error
2402 
2403 ! ------------------------------------------------------------------------------
2404 ! Input and output directories
2405 ! ------------------------------------------------------------------------------
2406 
2407  READ(if_control,'(A)',iostat=errorflag) global%inDir
2408  global%error = errorflag
2409  IF ( global%error /= err_none ) THEN
2410  global%inDir = './'
2411  ELSE
2412  IF ( global%inDir(len_trim(global%inDir): &
2413  len_trim(global%inDir)) /= '/' ) THEN
2414  global%inDir = trim(global%inDir)//'/'
2415  END IF ! global%inDir
2416  END IF ! global%error
2417 
2418  READ(if_control,'(A)',iostat=errorflag) global%outDir
2419  global%error = errorflag
2420  IF ( global%error /= err_none ) THEN
2421  global%outDir = './'
2422  ELSE
2423  IF ( global%outDir(len_trim(global%outDir): &
2424  len_trim(global%outDir)) /= '/' ) THEN
2425  global%outDir = trim(global%outDir)//'/'
2426  END IF ! global%outDir
2427  END IF ! global%error
2428 
2429  READ(if_control,'(A)',iostat=errorflag) global%outDirHDF
2430  global%error = errorflag
2431  IF ( global%error /= err_none ) THEN
2432  global%outDirHDF = './'
2433  ELSE
2434  IF ( global%outDirHDF(len_trim(global%outDirHDF): &
2435  len_trim(global%outDirHDF)) /= '/' ) THEN
2436  global%outDirHDF = trim(global%outDirHDF)//'/'
2437  END IF ! global%outDirHDF
2438  END IF ! global%error
2439 
2440 ! ------------------------------------------------------------------------------
2441 ! Verbosity and checking levels. NOTE do not report error if Roccom verbosity
2442 ! level does not exist for backward compatibility. NOTE cannot write warning
2443 ! if Roccom verbosity level does not exit because global%myProcid is not set
2444 ! yet.
2445 ! ------------------------------------------------------------------------------
2446 
2447  READ(if_control,*,iostat=errorflag) global%verbLevel
2448  global%error = errorflag
2449  IF ( global%error /= err_none ) THEN
2450  global%verbLevel = verbose_high
2451  ELSE
2452  global%verbLevel = max(global%verbLevel,verbose_none)
2453  global%verbLevel = min(global%verbLevel,verbose_high)
2454  END IF ! global%error
2455 
2456  READ(if_control,*,iostat=errorflag) global%checkLevel
2457  global%error = errorflag
2458  IF ( global%error /= err_none ) THEN
2459  global%checkLevel = check_high
2460  ELSE
2461  global%checkLevel = max(global%checkLevel,check_none)
2462  global%checkLevel = min(global%checkLevel,check_high)
2463  END IF ! global%error
2464 
2465  READ(if_control,*,iostat=errorflag) verblevelcom
2466  IF ( errorflag == err_none ) THEN
2467  global%verbLevelCOM = verblevelcom
2468  END IF ! global%error
2469 
2470 ! ==============================================================================
2471 ! Close file
2472 ! ==============================================================================
2473 
2474  CLOSE(if_control,iostat=errorflag)
2475  global%error = errorflag
2476  IF ( global%error /= err_none ) THEN
2477  CALL errorstop(global,err_file_close,__line__,'File: '//trim(ifilename))
2478  END IF ! global%error
2479 
2480 ! ******************************************************************************
2481 ! End
2482 ! ******************************************************************************
2483 
2484  CALL deregisterfunction(global)
2485 
2486  END SUBROUTINE rflu_genx_readctrlfile
2487 
2488 
2489 
2490 
2491 
2492 
2493 
2494 ! ******************************************************************************
2495 !
2496 ! Purpose: Register flow data.
2497 !
2498 ! Description: None.
2499 !
2500 ! Input:
2501 ! pRegion Pointer to region
2502 !
2503 ! Output: None.
2504 !
2505 ! Notes: None.
2506 !
2507 ! ******************************************************************************
2508 
2509  SUBROUTINE rflu_genx_registerdataflow(pRegion)
2510 
2511  USE modmixture, ONLY: t_mixt_input
2512 
2513  IMPLICIT NONE
2514 
2515 ! ******************************************************************************
2516 ! Declarations and definitions
2517 ! ******************************************************************************
2518 
2519 ! ==============================================================================
2520 ! Arguments
2521 ! ==============================================================================
2522 
2523  TYPE(t_region), POINTER :: pregion
2524 
2525 ! ==============================================================================
2526 ! Locals
2527 ! ==============================================================================
2528 
2529  CHARACTER(CHRLEN) :: winname
2530  INTEGER :: paneid,sz,ng
2531  REAL(RFREAL), POINTER :: preal
2532  TYPE(t_global), POINTER :: global
2533  TYPE(t_grid), POINTER :: pgrid
2534  TYPE(t_mixt_input), POINTER :: pmixtinput
2535 
2536 ! ******************************************************************************
2537 ! Start, set pointers
2538 ! ******************************************************************************
2539 
2540  global => pregion%global
2541 
2542  pgrid => pregion%grid
2543  pmixtinput => pregion%mixtInput
2544 
2545  IF ( global%myProcid == masterproc .AND. &
2546  global%verbLevel >= verbose_high ) THEN
2547  WRITE(stdout,'(A,1X,A)') solver_name,'Registering flow data...'
2548  END IF ! global%verbLevel
2549 
2550 ! ******************************************************************************
2551 ! Register data
2552 ! ******************************************************************************
2553 
2554 ! ==============================================================================
2555 ! Volume
2556 ! ==============================================================================
2557 
2558  winname = global%volWinName
2559 
2560  CALL rflu_genx_buildpaneid(pregion%iRegionGlobal,0,paneid)
2561 
2562  IF ( global%myProcid == masterproc .AND. &
2563  global%verbLevel >= verbose_high ) THEN
2564  WRITE(stdout,'(A,3X,A,1X,A)') solver_name,'Window name:',trim(winname)
2565  WRITE(stdout,'(A,3X,A,1X,I5.5)') solver_name,'Pane id:', paneid
2566  END IF ! global%verbLevel
2567 
2568 ! ------------------------------------------------------------------------------
2569 ! Conserved variables
2570 ! ------------------------------------------------------------------------------
2571 
2572  preal => pregion%mixt%cv(cv_mixt_dens,1)
2573 
2574  CALL com_set_array(trim(winname)//'.rhof',paneid,preal,pmixtinput%nCv, &
2575  pgrid%nCellsTot)
2576 
2577 
2578  preal => pregion%mixt%cv(cv_mixt_xmom,1)
2579 
2580  CALL com_set_array(trim(winname)//'.rhovf',paneid,preal,pmixtinput%nCv, &
2581  pgrid%nCellsTot)
2582 
2583  preal => pregion%mixt%cv(cv_mixt_ener,1)
2584 
2585  CALL com_set_array(trim(winname)//'.rhoEf',paneid,preal,pmixtinput%nCv, &
2586  pgrid%nCellsTot)
2587 
2588 ! ------------------------------------------------------------------------------
2589 ! Dependent variables
2590 ! ------------------------------------------------------------------------------
2591 
2592  preal => pregion%mixt%dv(dv_mixt_pres,1)
2593 
2594  CALL com_set_array(trim(winname)//'.pf',paneid,preal,pmixtinput%nDv, &
2595  pgrid%nCellsTot)
2596 
2597  preal => pregion%mixt%dv(dv_mixt_temp,1)
2598 
2599  CALL com_set_array(trim(winname)//'.Tf',paneid,preal,pmixtinput%nDv, &
2600  pgrid%nCellsTot)
2601 
2602  preal => pregion%mixt%dv(dv_mixt_soun,1)
2603 
2604  CALL com_set_array(trim(winname)//'.af',paneid,preal,pmixtinput%nDv, &
2605  pgrid%nCellsTot)
2606 
2607 ! ******************************************************************************
2608 ! End
2609 ! ******************************************************************************
2610 
2611  IF ( global%myProcid == masterproc .AND. &
2612  global%verbLevel >= verbose_high ) THEN
2613  WRITE(stdout,'(A,1X,A)') solver_name,'Registering flow data done.'
2614  END IF ! global%verbLevel
2615 
2616  CALL com_get_size(trim(winname)//'.rhof',paneid,sz,ng)
2617 
2618  END SUBROUTINE rflu_genx_registerdataflow
2619 
2620 
2621 
2622 
2623 
2624 
2625 
2626 ! ******************************************************************************
2627 !
2628 ! Purpose: Register grid speeds.
2629 !
2630 ! Description: None.
2631 !
2632 ! Input:
2633 ! pRegion Pointer to region
2634 !
2635 ! Output: None.
2636 !
2637 ! Notes: None.
2638 !
2639 ! ******************************************************************************
2640 
2641  SUBROUTINE rflu_genx_registerdatagspeeds(pRegion)
2642 
2643  IMPLICIT NONE
2644 
2645 ! ******************************************************************************
2646 ! Declarations and definitions
2647 ! ******************************************************************************
2648 
2649 ! ==============================================================================
2650 ! Arguments
2651 ! ==============================================================================
2652 
2653  TYPE(t_region), POINTER :: pregion
2654 
2655 ! ==============================================================================
2656 ! Locals
2657 ! ==============================================================================
2658 
2659  CHARACTER(CHRLEN) :: winname
2660  INTEGER :: ipatch,paneid
2661  REAL(RFREAL), POINTER :: preal
2662  TYPE(t_global), POINTER :: global
2663  TYPE(t_grid), POINTER :: pgrid
2664  TYPE(t_patch), POINTER :: ppatch
2665 
2666 ! ******************************************************************************
2667 ! Start, set pointers
2668 ! ******************************************************************************
2669 
2670  global => pregion%global
2671 
2672  pgrid => pregion%grid
2673 
2674  IF ( global%myProcid == masterproc .AND. &
2675  global%verbLevel >= verbose_high ) THEN
2676  WRITE(stdout,'(A,1X,A)') solver_name,'Registering grid speeds...'
2677  END IF ! global%verbLevel
2678 
2679 ! ******************************************************************************
2680 ! Register data
2681 ! ******************************************************************************
2682 
2683 ! ==============================================================================
2684 ! Volume
2685 ! ==============================================================================
2686 
2687  winname = global%volWinName
2688 
2689  CALL rflu_genx_buildpaneid(pregion%iRegionGlobal,0,paneid)
2690 
2691  IF ( global%myProcid == masterproc .AND. &
2692  global%verbLevel >= verbose_high ) THEN
2693  WRITE(stdout,'(A,3X,A)') solver_name,'Volume data...'
2694  WRITE(stdout,'(A,5X,A,1X,A)') solver_name,'Window name:',trim(winname)
2695  WRITE(stdout,'(A,5X,A,1X,I5.5)') solver_name,'Pane id:', paneid
2696  END IF ! global%verbLevel
2697 
2698  preal => pgrid%gs(1)
2699 
2700  CALL com_set_size(trim(winname)//'.gs',paneid,pgrid%nFacesTot,0)
2701  CALL com_set_array(trim(winname)//'.gs',paneid,preal,1,pgrid%nFacesTot)
2702 
2703 ! ==============================================================================
2704 ! Surface
2705 ! ==============================================================================
2706 
2707  winname = global%surfWinName
2708 
2709  IF ( global%myProcid == masterproc .AND. &
2710  global%verbLevel >= verbose_high ) THEN
2711  WRITE(stdout,'(A,3X,A)') solver_name,'Surface data...'
2712  WRITE(stdout,'(A,5X,A,1X,A)') solver_name,'Window name:',trim(winname)
2713  END IF ! global%verbLevel
2714 
2715  DO ipatch = 1,pgrid%nPatches
2716  ppatch => pregion%patches(ipatch)
2717 
2718  CALL rflu_genx_buildpaneid(pregion%iRegionGlobal,ipatch,paneid)
2719 
2720  IF ( global%myProcid == masterproc .AND. &
2721  global%verbLevel >= verbose_high ) THEN
2722  WRITE(stdout,'(A,5X,A,1X,I2)') solver_name,'Patch:',ipatch
2723  WRITE(stdout,'(A,7X,A,1X,I5.5)') solver_name,'Pane id:', paneid
2724  END IF ! global%verbLevel
2725 
2726  preal => ppatch%gs(1)
2727 
2728  CALL com_set_array(trim(winname)//'.gs',paneid,preal,1,ppatch%nBFacesTot)
2729  END DO ! iPatch
2730 
2731 ! ******************************************************************************
2732 ! End
2733 ! ******************************************************************************
2734 
2735  IF ( global%myProcid == masterproc .AND. &
2736  global%verbLevel >= verbose_high ) THEN
2737  WRITE(stdout,'(A,1X,A)') solver_name,'Registering grid speeds done.'
2738  END IF ! global%verbLevel
2739 
2740  END SUBROUTINE rflu_genx_registerdatagspeeds
2741 
2742 
2743 
2744 
2745 
2746 
2747 
2748 ! ******************************************************************************
2749 !
2750 ! Purpose: Register interface data.
2751 !
2752 ! Description: None.
2753 !
2754 ! Input:
2755 ! pRegion Pointer to region
2756 !
2757 ! Output: None.
2758 !
2759 ! Notes: None.
2760 !
2761 ! ******************************************************************************
2762 
2763  SUBROUTINE rflu_genx_registerdatainterf(pRegion)
2764 
2765  IMPLICIT NONE
2766 
2767 ! ******************************************************************************
2768 ! Declarations and definitions
2769 ! ******************************************************************************
2770 
2771 ! ==============================================================================
2772 ! Arguments
2773 ! ==============================================================================
2774 
2775  TYPE(t_region), POINTER :: pregion
2776 
2777 ! ==============================================================================
2778 ! Locals
2779 ! ==============================================================================
2780 
2781  CHARACTER(CHRLEN) :: winname
2782  INTEGER :: ipatch,paneid
2783  REAL(RFREAL), POINTER :: preal
2784  TYPE(t_global), POINTER :: global
2785  TYPE(t_grid), POINTER :: pgrid
2786  TYPE(t_patch), POINTER :: ppatch
2787 
2788 ! ******************************************************************************
2789 ! Start, set pointers
2790 ! ******************************************************************************
2791 
2792  global => pregion%global
2793 
2794  pgrid => pregion%grid
2795 
2796  IF ( global%myProcid == masterproc .AND. &
2797  global%verbLevel >= verbose_high ) THEN
2798  WRITE(stdout,'(A,1X,A)') solver_name,'Registering interface data...'
2799  END IF ! global%verbLevel
2800 
2801 ! ******************************************************************************
2802 ! Register interface data
2803 ! ******************************************************************************
2804 
2805  winname = global%surfWinName
2806 
2807  IF ( global%myProcid == masterproc .AND. &
2808  global%verbLevel >= verbose_high) THEN
2809  WRITE(stdout,'(A,3X,A,1X,A)') solver_name,'Window name:',trim(winname)
2810  END IF ! global%verbLevel
2811 
2812  DO ipatch = 1,pgrid%nPatches
2813  ppatch => pregion%patches(ipatch)
2814 
2815  CALL rflu_genx_buildpaneid(pregion%iRegionGlobal,ipatch,paneid)
2816 
2817  IF ( global%myProcid == masterproc .AND. &
2818  global%verbLevel >= verbose_high ) THEN
2819  WRITE(stdout,'(A,3X,A,1X,I2)') solver_name,'Patch:',ipatch
2820  WRITE(stdout,'(A,5X,A,1X,I5.5)') solver_name,'Pane id:',paneid
2821  END IF ! global%verbLevel
2822 
2823 ! ==============================================================================
2824 ! Input data
2825 ! ==============================================================================
2826 
2827 ! ------------------------------------------------------------------------------
2828 ! All patches
2829 ! ------------------------------------------------------------------------------
2830 
2831  CALL com_set_array(trim(winname)//'.du_alp',paneid,ppatch%duAlp)
2832 
2833 ! ------------------------------------------------------------------------------
2834 ! Interacting patches (burning or non-burning)
2835 ! ------------------------------------------------------------------------------
2836 
2837  IF ( ppatch%bcCoupled /= bc_not_coupled ) THEN
2838  CALL com_set_array(trim(winname)//'.rhofvf_alp',paneid,ppatch%rhofvfAlp)
2839  CALL com_set_array(trim(winname)//'.Tb_alp',paneid,ppatch%tbAlp)
2840  END IF ! pPatch%bcCoupled
2841 
2842 ! ------------------------------------------------------------------------------
2843 ! Burning patches
2844 ! ------------------------------------------------------------------------------
2845 
2846  IF ( ppatch%bcCoupled == bc_burning ) THEN
2847  CALL com_set_array(trim(winname)//'.mdot_alp',paneid,ppatch%mdotAlp)
2848  CALL com_set_array(trim(winname)//'.Tflm_alp',paneid,ppatch%tflmAlp)
2849  END IF ! pPatch%bcCoupled
2850 
2851 ! ==============================================================================
2852 ! Output data
2853 ! ==============================================================================
2854 
2855 ! ------------------------------------------------------------------------------
2856 ! Interacting patches (burning or non-burning)
2857 ! ------------------------------------------------------------------------------
2858 
2859  IF ( ppatch%bcCoupled /= bc_not_coupled ) THEN
2860  CALL com_set_array(trim(winname)//'.nf_alp',paneid,ppatch%nfAlp)
2861  CALL com_set_array(trim(winname)//'.rhof_alp',paneid,ppatch%rhofAlp)
2862  CALL com_set_array(trim(winname)//'.pf',paneid,ppatch%pf)
2863  CALL com_set_array(trim(winname)//'.tf',paneid,ppatch%tracf)
2864  CALL com_set_array(trim(winname)//'.qc',paneid,ppatch%qc)
2865  CALL com_set_array(trim(winname)//'.qr',paneid,ppatch%qr)
2866  END IF ! pPatch%bcCoupled
2867 
2868 ! ------------------------------------------------------------------------------
2869 ! Burning patches
2870 ! ------------------------------------------------------------------------------
2871 
2872  IF ( ppatch%bcCoupled == bc_burning ) THEN
2873  CALL com_set_array(trim(winname)//'.Tf',paneid,ppatch%tempf)
2874  CALL com_set_array(trim(winname)//'.bflag',paneid,ppatch%bFlag)
2875  END IF ! pPatch%bcCoupled
2876  END DO ! iPatch
2877 
2878 ! ******************************************************************************
2879 ! End
2880 ! ******************************************************************************
2881 
2882  IF ( global%myProcid == masterproc .AND. &
2883  global%verbLevel >= verbose_high ) THEN
2884  WRITE(stdout,'(A,1X,A)') solver_name,'Registering interface data done.'
2885  END IF ! global%verbLevel
2886 
2887  END SUBROUTINE rflu_genx_registerdatainterf
2888 
2889 
2890 
2891 
2892 
2893 
2894 
2895 ! ******************************************************************************
2896 !
2897 ! Purpose: Statistics data registration.
2898 !
2899 ! Description: None.
2900 !
2901 ! Input:
2902 ! pRegion Pointer to region
2903 !
2904 ! Output: None.
2905 !
2906 ! Notes: None.
2907 !
2908 ! ******************************************************************************
2909 
2910  SUBROUTINE rflu_genx_registerdatastats(pRegion)
2911 #ifdef STATS
2913 #endif
2914  IMPLICIT NONE
2915 
2916 ! ******************************************************************************
2917 ! Declarations and definitions
2918 ! ******************************************************************************
2919 
2920 ! ==============================================================================
2921 ! Arguments
2922 ! ==============================================================================
2923 
2924  TYPE(t_region), POINTER :: pregion
2925 
2926 ! ******************************************************************************
2927 ! Register data
2928 ! ******************************************************************************
2929 #ifdef STATS
2930  CALL stat_rflu_genxregisterdata(pregion)
2931 #endif
2932 ! ******************************************************************************
2933 ! End
2934 ! ******************************************************************************
2935 
2936  END SUBROUTINE rflu_genx_registerdatastats
2937 
2938 
2939 
2940 
2941 
2942 
2943 
2944 ! ******************************************************************************
2945 !
2946 ! Purpose: Turbulence data registration.
2947 !
2948 ! Description: None.
2949 !
2950 ! Input:
2951 ! pRegion Pointer to region
2952 !
2953 ! Output: None.
2954 !
2955 ! Notes: None.
2956 !
2957 ! ******************************************************************************
2958 
2959  SUBROUTINE rflu_genx_registerdataturb(pRegion)
2960 #ifdef TURB
2962 #endif
2963  IMPLICIT NONE
2964 
2965 ! ******************************************************************************
2966 ! Declarations and definitions
2967 ! ******************************************************************************
2968 
2969 ! ==============================================================================
2970 ! Arguments
2971 ! ==============================================================================
2972 
2973  TYPE(t_region), POINTER :: pregion
2974 
2975 ! ******************************************************************************
2976 ! Register data
2977 ! ******************************************************************************
2978 #ifdef TURB
2979  IF (pregion%global%turbActive) CALL turb_rflu_genxregisterdata(pregion)
2980 #endif
2981 ! ******************************************************************************
2982 ! End
2983 ! ******************************************************************************
2984 
2985  END SUBROUTINE rflu_genx_registerdataturb
2986 
2987 
2988 
2989 
2990 
2991 
2992 
2993 ! ******************************************************************************
2994 !
2995 ! Purpose: Wrapper for data registration routines.
2996 !
2997 ! Description: None.
2998 !
2999 ! Input:
3000 ! pRegion Pointer to region
3001 !
3002 ! Output: None.
3003 !
3004 ! Notes: None.
3005 !
3006 ! ******************************************************************************
3007 
3008  SUBROUTINE rflu_genx_registerdatawrapper(pRegion)
3009 
3010  IMPLICIT NONE
3011 
3012 ! ******************************************************************************
3013 ! Declarations and definitions
3014 ! ******************************************************************************
3015 
3016 ! ==============================================================================
3017 ! Arguments
3018 ! ==============================================================================
3019 
3020  TYPE(t_region), POINTER :: pregion
3021 
3022 ! ******************************************************************************
3023 ! Register data
3024 ! ******************************************************************************
3025 
3026 ! ==============================================================================
3027 ! Mixture
3028 ! ==============================================================================
3029 
3030  CALL rflu_genx_registerdataflow(pregion)
3031  CALL rflu_genx_registerdatagspeeds(pregion)
3032  CALL rflu_genx_registerdatainterf(pregion)
3033  CALL rflu_genx_registerdisp(pregion)
3034 
3035 ! ==============================================================================
3036 ! Statistics
3037 ! ==============================================================================
3038 
3039  CALL rflu_genx_registerdatastats(pregion)
3040 
3041 ! ==============================================================================
3042 ! Turbulence
3043 ! ==============================================================================
3044 
3045  CALL rflu_genx_registerdataturb(pregion)
3046 
3047 ! ******************************************************************************
3048 ! End
3049 ! ******************************************************************************
3050 
3051  END SUBROUTINE rflu_genx_registerdatawrapper
3052 
3053 
3054 
3055 
3056 
3057 
3058 ! ******************************************************************************
3059 !
3060 ! Purpose: Register volume grid.
3061 !
3062 ! Description: None.
3063 !
3064 ! Input:
3065 ! pRegion Pointer to region
3066 !
3067 ! Output: None.
3068 !
3069 ! Notes:
3070 ! 1. Must be called after new attributes were created.
3071 !
3072 ! ******************************************************************************
3073 
3074  SUBROUTINE rflu_genx_registerdisp(pRegion)
3075 
3076  IMPLICIT NONE
3077 
3078 ! ******************************************************************************
3079 ! Declarations and definitions
3080 ! ******************************************************************************
3081 
3082 ! ==============================================================================
3083 ! Arguments
3084 ! ==============================================================================
3085 
3086  TYPE(t_region), POINTER :: pregion
3087 
3088 ! ==============================================================================
3089 ! Locals
3090 ! ==============================================================================
3091 
3092  CHARACTER(CHRLEN) :: winname
3093  INTEGER :: paneid
3094  TYPE(t_global), POINTER :: global
3095  TYPE(t_grid), POINTER :: pgrid
3096 
3097 ! ******************************************************************************
3098 ! Start, set pointers
3099 ! ******************************************************************************
3100 
3101  global => pregion%global
3102 
3103  pgrid => pregion%grid
3104 
3105  IF ( global%myProcid == masterproc .AND. &
3106  global%verbLevel >= verbose_high) THEN
3107  WRITE(stdout,'(A,1X,A)') solver_name,'Registering displacements...'
3108  END IF ! global%verbLevel
3109 
3110 ! ******************************************************************************
3111 ! Register displacements
3112 ! ******************************************************************************
3113 
3114  winname = global%volWinName
3115 
3116  CALL rflu_genx_buildpaneid(pregion%iRegionGlobal,0,paneid)
3117 
3118  IF ( global%myProcid == masterproc .AND. &
3119  global%verbLevel >= verbose_high ) THEN
3120  WRITE(stdout,'(A,3X,A,1X,A)') solver_name,'Window name:',trim(winname)
3121  WRITE(stdout,'(A,3X,A,1X,I5.5)') solver_name,'Pane id:',paneid
3122  END IF ! global%verbLevel
3123 
3124  CALL com_set_array(trim(winname)//'.disp',paneid,pgrid%disp)
3125 
3126 ! ******************************************************************************
3127 ! End
3128 ! ******************************************************************************
3129 
3130  IF ( global%myProcid == masterproc .AND. &
3131  global%verbLevel >= verbose_high ) THEN
3132  WRITE(stdout,'(A,1X,A)') solver_name,'Registering displacements done.'
3133  END IF ! global%verbLevel
3134 
3135  END SUBROUTINE rflu_genx_registerdisp
3136 
3137 
3138 
3139 
3140 
3141 
3142 
3143 
3144 ! ******************************************************************************
3145 !
3146 ! Purpose: Register grid.
3147 !
3148 ! Description: None.
3149 !
3150 ! Input:
3151 ! pRegion Pointer to region
3152 !
3153 ! Output: None.
3154 !
3155 ! Notes:
3156 ! 1. Must be called after new attributes were created.
3157 !
3158 ! ******************************************************************************
3159 
3160  SUBROUTINE rflu_genx_registergrid(pRegion)
3161 
3162  IMPLICIT NONE
3163 
3164 ! ******************************************************************************
3165 ! Declarations and definitions
3166 ! ******************************************************************************
3167 
3168 ! ==============================================================================
3169 ! Arguments
3170 ! ==============================================================================
3171 
3172  TYPE(t_region), POINTER :: pregion
3173 
3174 ! ==============================================================================
3175 ! Locals
3176 ! ==============================================================================
3177 
3178  TYPE(t_global), POINTER :: global
3179  TYPE(t_grid), POINTER :: pgrid
3180 
3181 ! ******************************************************************************
3182 ! Start, set pointers
3183 ! ******************************************************************************
3184 
3185  global => pregion%global
3186 
3187  pgrid => pregion%grid
3188 
3189  IF ( global%myProcid == masterproc .AND. &
3190  global%verbLevel >= verbose_high ) THEN
3191  WRITE(stdout,'(A,1X,A)') solver_name,'Registering grid...'
3192  END IF ! global%verbLevel
3193 
3194 ! ******************************************************************************
3195 ! Register grid
3196 ! ******************************************************************************
3197 
3198 ! ==============================================================================
3199 ! Volume
3200 ! ==============================================================================
3201 
3202  CALL rflu_genx_registergridvol(pregion)
3203 
3204 ! ==============================================================================
3205 ! Surface
3206 ! ==============================================================================
3207 
3208  IF ( pgrid%nPatches > 0 ) THEN
3209  CALL rflu_genx_registergridsurf(pregion)
3210  END IF ! pGrid%nPatches
3211 
3212 ! ******************************************************************************
3213 ! End
3214 ! ******************************************************************************
3215 
3216  IF ( global%myProcid == masterproc .AND. &
3217  global%verbLevel >= verbose_high ) THEN
3218  WRITE(stdout,'(A,1X,A)') solver_name,'Registering grid done.'
3219  END IF ! global%verbLevel
3220 
3221  END SUBROUTINE rflu_genx_registergrid
3222 
3223 
3224 
3225 
3226 
3227 
3228 
3229 
3230 ! ******************************************************************************
3231 !
3232 ! Purpose: Register surface grid.
3233 !
3234 ! Description: None.
3235 !
3236 ! Input:
3237 ! pRegion Pointer to region
3238 !
3239 ! Output: None.
3240 !
3241 ! Notes:
3242 ! 1. Must be called after new attributes were created.
3243 !
3244 ! ******************************************************************************
3245 
3246  SUBROUTINE rflu_genx_registergridsurf(pRegion)
3247 
3248  IMPLICIT NONE
3249 
3250 ! ******************************************************************************
3251 ! Declarations and definitions
3252 ! ******************************************************************************
3253 
3254 ! ==============================================================================
3255 ! Arguments
3256 ! ==============================================================================
3257 
3258  TYPE(t_region), POINTER :: pregion
3259 
3260 ! ==============================================================================
3261 ! Locals
3262 ! ==============================================================================
3263 
3264  CHARACTER(CHRLEN) :: winname
3265  INTEGER :: ipatch,paneid
3266  INTEGER, POINTER :: pint
3267  TYPE(t_global), POINTER :: global
3268  TYPE(t_grid), POINTER :: pgrid
3269  TYPE(t_patch), POINTER :: ppatch
3270 
3271 ! ******************************************************************************
3272 ! Start, set pointers
3273 ! ******************************************************************************
3274 
3275  global => pregion%global
3276 
3277  pgrid => pregion%grid
3278 
3279  IF ( global%myProcid == masterproc .AND. &
3280  global%verbLevel >= verbose_high ) THEN
3281  WRITE(stdout,'(A,1X,A)') solver_name,'Registering surface grid...'
3282  END IF ! global%verbLevel
3283 
3284 ! ******************************************************************************
3285 ! Register surface grid
3286 ! ******************************************************************************
3287 
3288  winname = global%surfWinName
3289 
3290  IF ( global%myProcid == masterproc .AND. &
3291  global%verbLevel >= verbose_high ) THEN
3292  WRITE(stdout,'(A,3X,A,1X,A)') solver_name,'Window name:',trim(winname)
3293  END IF ! global%verbLevel
3294 
3295 ! ==============================================================================
3296 ! Loop over patches
3297 ! ==============================================================================
3298 
3299  DO ipatch = 1,pgrid%nPatches
3300  ppatch => pregion%patches(ipatch)
3301 
3302  CALL rflu_genx_buildpaneid(pregion%iRegionGlobal,ipatch,paneid)
3303 
3304  IF ( global%myProcid == masterproc .AND. &
3305  global%verbLevel >= verbose_high ) THEN
3306  WRITE(stdout,'(A,3X,A,1X,I2)') solver_name,'Patch:',ipatch
3307  WRITE(stdout,'(A,5X,A,1X,I2)') solver_name,'Global patch id:', &
3308  ppatch%iPatchGlobal
3309  WRITE(stdout,'(A,5X,A,1X,I5.5)') solver_name,'Pane id:', paneid
3310  WRITE(stdout,'(A,5X,A,1X,2X,I3)') solver_name,'bcFlag: ', &
3311  ppatch%bcFlag(1)
3312  WRITE(stdout,'(A,5X,A,1X,2X,I4)') solver_name,'cnstrType:', &
3313  ppatch%cnstrType(1)
3314  END IF ! global%verbLevel
3315 
3316 ! ------------------------------------------------------------------------------
3317 ! Patch quantities
3318 ! ------------------------------------------------------------------------------
3319 
3320  CALL com_set_size(trim(winname)//'.bcflag',paneid,1)
3321  CALL com_set_array(trim(winname)//'.bcflag',paneid,ppatch%bcFlag)
3322 
3323  CALL com_set_size(trim(winname)//'.patchNo',paneid,1)
3324  CALL com_set_array(trim(winname)//'.patchNo',paneid,ppatch%patchNo)
3325 
3326  CALL com_set_size(trim(winname)//'.cnstr_type',paneid,1)
3327  CALL com_set_array(trim(winname)//'.cnstr_type',paneid,ppatch%cnstrType)
3328 
3329 ! ------------------------------------------------------------------------------
3330 ! Coordinates
3331 ! ------------------------------------------------------------------------------
3332 
3333  CALL com_set_size(trim(winname)//'.nc',paneid,ppatch%nBVertTot, &
3334  ppatch%nBVertTot-ppatch%nBVert)
3335  CALL com_set_array(trim(winname)//'.nc',paneid,ppatch%xyz)
3336 
3337 ! ------------------------------------------------------------------------------
3338 ! Connectivity. IMPORTANT: Note that locally-numbered boundary-face lists
3339 ! are registered as connectivity. Globally-numbered boundary-face lists are
3340 ! registered as additional data because they are needed for the basic
3341 ! grid description.
3342 ! ------------------------------------------------------------------------------
3343 
3344 ! --- Actual faces -------------------------------------------------------------
3345 
3346  IF ( ppatch%nBTris > 0 ) THEN
3347  pint => ppatch%bTri2vLoc(1,1)
3348 
3349  CALL com_set_size(trim(winname)//'.:t3:real',paneid,ppatch%nBTris,0)
3350  CALL com_set_array(trim(winname)//'.:t3:real',paneid,pint)
3351 
3352  pint => ppatch%bTri2v(1,1)
3353 
3354  CALL com_set_size(trim(winname)//'.t3g:real',paneid,ppatch%nBTris,0)
3355  CALL com_set_array(trim(winname)//'.t3g:real',paneid,pint)
3356  END IF ! pPatch%nBTris
3357 
3358  IF ( ppatch%nBQuads > 0 ) THEN
3359  pint => ppatch%bQuad2vLoc(1,1)
3360 
3361  CALL com_set_size(trim(winname)//'.:q4:real',paneid,ppatch%nBQuads,0)
3362  CALL com_set_array(trim(winname)//'.:q4:real',paneid,pint)
3363 
3364  pint => ppatch%bQuad2v(1,1)
3365 
3366  CALL com_set_size(trim(winname)//'.q4g:real',paneid,ppatch%nBQuads,0)
3367  CALL com_set_array(trim(winname)//'.q4g:real',paneid,pint)
3368  END IF ! pPatch%nBTris
3369 
3370 ! --- Virtual faces ------------------------------------------------------------
3371 
3372  IF ( ppatch%nBTrisTot > ppatch%nBTris ) THEN
3373  pint => ppatch%bTri2vLoc(1,ppatch%nBTris+1)
3374 
3375  CALL com_set_size(trim(winname)//'.:t3:virtual',paneid, &
3376  ppatch%nBTrisTot-ppatch%nBTris, &
3377  ppatch%nBTrisTot-ppatch%nBTris)
3378  CALL com_set_array(trim(winname)//'.:t3:virtual',paneid,pint)
3379 
3380  pint => ppatch%bTri2v(1,ppatch%nBTris+1)
3381 
3382  CALL com_set_size(trim(winname)//'.t3g:virtual',paneid, &
3383  ppatch%nBTrisTot-ppatch%nBTris, &
3384  ppatch%nBTrisTot-ppatch%nBTris)
3385  CALL com_set_array(trim(winname)//'.t3g:virtual',paneid,pint)
3386  END IF ! pPatch%nBTris
3387 
3388  IF ( ppatch%nBQuadsTot > ppatch%nBQuads ) THEN
3389  pint => ppatch%bQuad2vLoc(1,ppatch%nBQuads+1)
3390 
3391  CALL com_set_size(trim(winname)//'.:q4:virtual',paneid, &
3392  ppatch%nBQuadsTot-ppatch%nBQuads, &
3393  ppatch%nBQuadsTot-ppatch%nBQuads)
3394  CALL com_set_array(trim(winname)//'.:q4:virtual',paneid,pint)
3395 
3396  pint => ppatch%bQuad2v(1,ppatch%nBQuads+1)
3397 
3398  CALL com_set_size(trim(winname)//'.q4g:virtual',paneid, &
3399  ppatch%nBQuadsTot-ppatch%nBQuads, &
3400  ppatch%nBQuadsTot-ppatch%nBQuads)
3401  CALL com_set_array(trim(winname)//'.q4g:virtual',paneid,pint)
3402  END IF ! pPatch%nBQuads
3403  END DO ! iPatch
3404 
3405 ! ******************************************************************************
3406 ! End
3407 ! ******************************************************************************
3408 
3409  IF ( global%myProcid == masterproc .AND. &
3410  global%verbLevel >= verbose_high ) THEN
3411  WRITE(stdout,'(A,1X,A)') solver_name,'Registering surface grid done.'
3412  END IF ! global%verbLevel
3413 
3414  END SUBROUTINE rflu_genx_registergridsurf
3415 
3416 
3417 
3418 
3419 
3420 
3421 
3422 ! ******************************************************************************
3423 !
3424 ! Purpose: Register volume grid.
3425 !
3426 ! Description: None.
3427 !
3428 ! Input:
3429 ! pRegion Pointer to region
3430 !
3431 ! Output: None.
3432 !
3433 ! Notes:
3434 ! 1. Must be called after new attributes were created.
3435 !
3436 ! ******************************************************************************
3437 
3438  SUBROUTINE rflu_genx_registergridvol(pRegion)
3439 
3440  IMPLICIT NONE
3441 
3442 ! ******************************************************************************
3443 ! Declarations and definitions
3444 ! ******************************************************************************
3445 
3446 ! ==============================================================================
3447 ! Arguments
3448 ! ==============================================================================
3449 
3450  TYPE(t_region), POINTER :: pregion
3451 
3452 ! ==============================================================================
3453 ! Locals
3454 ! ==============================================================================
3455 
3456  CHARACTER(CHRLEN) :: winname
3457  INTEGER :: paneid
3458  INTEGER, POINTER :: pint
3459  TYPE(t_global), POINTER :: global
3460  TYPE(t_grid), POINTER :: pgrid
3461 
3462 ! ******************************************************************************
3463 ! Start, set pointers
3464 ! ******************************************************************************
3465 
3466  global => pregion%global
3467 
3468  pgrid => pregion%grid
3469 
3470  IF ( global%myProcid == masterproc .AND. &
3471  global%verbLevel >= verbose_high ) THEN
3472  WRITE(stdout,'(A,1X,A)') solver_name,'Registering volume grid...'
3473  END IF ! global%verbLevel
3474 
3475 ! ******************************************************************************
3476 ! Register grid
3477 ! ******************************************************************************
3478 
3479  winname = global%volWinName
3480 
3481  CALL rflu_genx_buildpaneid(pregion%iRegionGlobal,0,paneid)
3482 
3483  IF ( global%myProcid == masterproc .AND. &
3484  global%verbLevel >= verbose_high ) THEN
3485  WRITE(stdout,'(A,3X,A,1X,A)') solver_name,'Window name:',trim(winname)
3486  WRITE(stdout,'(A,3X,A,1X,I5.5)') solver_name,'Pane id:',paneid
3487  END IF ! global%verbLevel
3488 
3489 ! ==============================================================================
3490 ! Coordinates
3491 ! ==============================================================================
3492 
3493  CALL com_set_size(trim(winname)//'.nc',paneid,pgrid%nVertTot, &
3494  pgrid%nVertTot-pgrid%nVert)
3495  CALL com_set_array(trim(winname)//'.nc',paneid,pgrid%xyz)
3496 
3497 ! ==============================================================================
3498 ! Connectivity
3499 ! ==============================================================================
3500 
3501 ! ------------------------------------------------------------------------------
3502 ! pconn attribute
3503 ! ------------------------------------------------------------------------------
3504 
3505  CALL com_set_size(trim(winname)//'.pconn',paneid,pgrid%pconnSizeTot, &
3506  pgrid%pconnSizeGhost)
3507  CALL com_set_array(trim(winname)//'.pconn',paneid,pgrid%pconn)
3508 
3509 ! ------------------------------------------------------------------------------
3510 ! Actual cells
3511 ! ------------------------------------------------------------------------------
3512 
3513  IF ( pgrid%nTets > 0 ) THEN
3514  pint => pgrid%tet2v(1,1)
3515 
3516  CALL com_set_size(trim(winname)//'.:T4:real',paneid,pgrid%nTets,0)
3517  CALL com_set_array(trim(winname)//'.:T4:real',paneid,pint)
3518  END IF ! pGrid%nTets
3519 
3520  IF ( pgrid%nHexs > 0 ) THEN
3521  pint => pgrid%hex2v(1,1)
3522 
3523  CALL com_set_size(trim(winname)//'.:H8:real',paneid,pgrid%nHexs,0)
3524  CALL com_set_array(trim(winname)//'.:H8:real',paneid,pint)
3525  END IF ! pGrid%nHexs
3526 
3527  IF ( pgrid%nPris > 0 ) THEN
3528  pint => pgrid%pri2v(1,1)
3529 
3530  CALL com_set_size(trim(winname)//'.:W6:real',paneid,pgrid%nPris,0)
3531  CALL com_set_array(trim(winname)//'.:W6:real',paneid,pint)
3532  END IF ! pGrid%nPris
3533 
3534  IF ( pgrid%nPyrs > 0 ) THEN
3535  pint => pgrid%pyr2v(1,1)
3536 
3537  CALL com_set_size(trim(winname)//'.:P5:real',paneid,pgrid%nPyrs,0)
3538  CALL com_set_array(trim(winname)//'.:P5:real',paneid,pint)
3539  END IF ! pGrid%nPyrs
3540 
3541 ! ------------------------------------------------------------------------------
3542 ! Virtual cells
3543 ! ------------------------------------------------------------------------------
3544 
3545  IF ( pgrid%nTetsTot > pgrid%nTets ) THEN
3546  pint => pgrid%tet2v(1,pgrid%nTets+1)
3547 
3548  CALL com_set_size(trim(winname)//'.:T4:virtual',paneid, &
3549  pgrid%nTetsTot-pgrid%nTets,pgrid%nTetsTot-pgrid%nTets)
3550  CALL com_set_array(trim(winname)//'.:T4:virtual',paneid,pint)
3551  END IF ! pGrid%nTetsTot
3552 
3553  IF ( pgrid%nHexsTot > pgrid%nHexs ) THEN
3554  pint => pgrid%hex2v(1,pgrid%nHexs+1)
3555 
3556  CALL com_set_size(trim(winname)//'.:H8:virtual',paneid, &
3557  pgrid%nHexsTot-pgrid%nHexs,pgrid%nHexsTot-pgrid%nHexs)
3558  CALL com_set_array(trim(winname)//'.:H8:virtual',paneid,pint)
3559  END IF ! pGrid%nHexsTot
3560 
3561  IF ( pgrid%nPrisTot > pgrid%nPris ) THEN
3562  pint => pgrid%pri2v(1,pgrid%nPris+1)
3563 
3564  CALL com_set_size(trim(winname)//'.:W6:virtual',paneid, &
3565  pgrid%nPrisTot-pgrid%nPris,pgrid%nPrisTot-pgrid%nPris)
3566  CALL com_set_array(trim(winname)//'.:W6:virtual',paneid,pint)
3567  END IF ! pGrid%nPrisTot
3568 
3569  IF ( pgrid%nPyrsTot > pgrid%nPyrs ) THEN
3570  pint => pgrid%pyr2v(1,pgrid%nPyrs+1)
3571 
3572  CALL com_set_size(trim(winname)//'.:P5:virtual',paneid, &
3573  pgrid%nPyrsTot-pgrid%nPyrs,pgrid%nPyrsTot-pgrid%nPyrs)
3574  CALL com_set_array(trim(winname)//'.:P5:virtual',paneid,pint)
3575  END IF ! pGrid%nPrisTot
3576 
3577 ! ******************************************************************************
3578 ! End
3579 ! ******************************************************************************
3580 
3581  IF ( global%myProcid == masterproc .AND. &
3582  global%verbLevel >= verbose_high ) THEN
3583  WRITE(stdout,'(A,1X,A)') solver_name,'Registering volume grid done.'
3584  END IF ! global%verbLevel
3585 
3586  END SUBROUTINE rflu_genx_registergridvol
3587 
3588 
3589 
3590 
3591 
3592 
3593 
3594 
3595 
3596 
3597 ! ******************************************************************************
3598 !
3599 ! Purpose: Register size of connectivity tables.
3600 !
3601 ! Description: None.
3602 !
3603 ! Input:
3604 ! pRegion Pointer to region
3605 !
3606 ! Output: None.
3607 !
3608 ! Notes:
3609 ! 1. Must be called in initializor if have not registered grid so Roccom
3610 ! knows how many cells exist in grid.
3611 !
3612 ! ******************************************************************************
3613 
3614  SUBROUTINE rflu_genx_setconnsize(pRegion)
3615 
3616  IMPLICIT NONE
3617 
3618 ! ******************************************************************************
3619 ! Declarations and definitions
3620 ! ******************************************************************************
3621 
3622 ! ==============================================================================
3623 ! Arguments
3624 ! ==============================================================================
3625 
3626  TYPE(t_region), POINTER :: pregion
3627 
3628 ! ==============================================================================
3629 ! Locals
3630 ! ==============================================================================
3631 
3632  CHARACTER(CHRLEN) :: winname
3633  INTEGER :: paneid
3634  TYPE(t_global), POINTER :: global
3635  TYPE(t_grid), POINTER :: pgrid
3636 
3637 ! ******************************************************************************
3638 ! Start, set pointers
3639 ! ******************************************************************************
3640 
3641  global => pregion%global
3642 
3643  pgrid => pregion%grid
3644 
3645  IF ( global%myProcid == masterproc .AND. &
3646  global%verbLevel >= verbose_high ) THEN
3647  WRITE(stdout,'(A,1X,A)') solver_name,'Setting conn size...'
3648  END IF ! global%verbLevel
3649 
3650 ! ******************************************************************************
3651 ! Register conn size
3652 ! ******************************************************************************
3653 
3654  winname = global%volWinName
3655 
3656  CALL rflu_genx_buildpaneid(pregion%iRegionGlobal,0,paneid)
3657 
3658  IF ( global%myProcid == masterproc .AND. &
3659  global%verbLevel >= verbose_high ) THEN
3660  WRITE(stdout,'(A,3X,A,1X,A)') solver_name,'Window name:',trim(winname)
3661  WRITE(stdout,'(A,3X,A,1X,I5.5)') solver_name,'Pane id:',paneid
3662  END IF ! global%verbLevel
3663 
3664  CALL com_set_size(trim(winname)//'.conn',paneid,pgrid%nCellsTot, &
3665  pgrid%nCellsTot-pgrid%nCells)
3666 
3667 ! ******************************************************************************
3668 ! End
3669 ! ******************************************************************************
3670 
3671  IF ( global%myProcid == masterproc .AND. &
3672  global%verbLevel >= verbose_high ) THEN
3673  WRITE(stdout,'(A,1X,A)') solver_name,'Setting conn size done.'
3674  END IF ! global%verbLevel
3675 
3676  END SUBROUTINE rflu_genx_setconnsize
3677 
3678 
3679 
3680 
3681 
3682 
3683 
3684 
3685 
3686 
3687 
3688 
3689 
3690 ! ******************************************************************************
3691 !
3692 ! Purpose: Store communicator.
3693 !
3694 ! Description: None.
3695 !
3696 ! Input:
3697 ! global Pointer to global data
3698 ! communicator Communicator
3699 !
3700 ! Output: None.
3701 !
3702 ! Notes: None.
3703 !
3704 ! ******************************************************************************
3705 
3706  SUBROUTINE rflu_genx_storecommunicator(global,communicator)
3707 
3708  IMPLICIT NONE
3709 
3710 ! ******************************************************************************
3711 ! Declarations and definitions
3712 ! ******************************************************************************
3713 
3714 ! ==============================================================================
3715 ! Arguments
3716 ! ==============================================================================
3717 
3718  INTEGER, INTENT(IN) :: communicator
3719  TYPE(t_global), POINTER :: global
3720 
3721 ! ******************************************************************************
3722 ! Store communicator
3723 ! ******************************************************************************
3724 
3725  global%communicator = communicator
3726 
3727 ! ******************************************************************************
3728 ! End
3729 ! ******************************************************************************
3730 
3731  END SUBROUTINE rflu_genx_storecommunicator
3732 
3733 
3734 
3735 
3736 
3737 
3738 
3739 
3740 
3741 
3742 ! ******************************************************************************
3743 !
3744 ! Purpose: Set input window names.
3745 !
3746 ! Description: None.
3747 !
3748 ! Input:
3749 ! pRegion Pointer to region
3750 !
3751 ! Output: None.
3752 !
3753 ! Notes:
3754 ! 1. Input volume window name is assumed to be subdivided into separate
3755 ! strings for the mixture and multi-physics modules by empty spaces.
3756 !
3757 ! ******************************************************************************
3758 
3759  SUBROUTINE rflu_genx_storenameshandles(global,surfWinNameInput, &
3760  volwinnameinput,handleobtain)
3761 
3762  IMPLICIT NONE
3763 
3764 ! ******************************************************************************
3765 ! Declarations and definitions
3766 ! ******************************************************************************
3767 
3768 ! ==============================================================================
3769 ! Arguments
3770 ! ==============================================================================
3771 
3772  CHARACTER(*), INTENT(IN) :: surfwinnameinput,volwinnameinput
3773  INTEGER, INTENT(IN) :: handleobtain
3774  TYPE(t_global), POINTER :: global
3775 
3776 ! ==============================================================================
3777 ! Locals
3778 ! ==============================================================================
3779 
3780  CHARACTER(CHRLEN) :: tempstring1,tempstring2
3781  INTEGER :: errorflag
3782 
3783 ! ******************************************************************************
3784 ! Set names
3785 ! ******************************************************************************
3786 
3787  IF ( global%myProcid == masterproc .AND. &
3788  global%verbLevel >= verbose_high ) THEN
3789  WRITE(stdout,'(A,1X,A)') solver_name,'Storing names and handles...'
3790  END IF ! global%myProcid
3791 
3792 ! ==============================================================================
3793 ! Surface
3794 ! ==============================================================================
3795 
3796  global%surfWinNameInput = surfwinnameinput
3797 
3798  IF ( global%myProcid == masterproc .AND. &
3799  global%verbLevel >= verbose_high ) THEN
3800  WRITE(stdout,'(A,3X,A,1X,A)') solver_name,'Input surface window name:', &
3801  trim(global%surfWinNameInput)
3802  END IF ! global%myProcid
3803 
3804 ! ==============================================================================
3805 ! Volume. NOTE separate input volume window into substrings.
3806 ! ==============================================================================
3807 
3808  READ(volwinnameinput,*,iostat=errorflag) tempstring1,tempstring2
3809  global%error = errorflag
3810  IF ( global%error /= err_none ) THEN
3811  CALL errorstop(global,err_string_read,__line__)
3812  END IF ! global%error
3813 
3814 ! ------------------------------------------------------------------------------
3815 ! Mixture
3816 ! ------------------------------------------------------------------------------
3817 
3818  global%volWinNameInput = trim(tempstring1)
3819 
3820  IF ( global%myProcid == masterproc .AND. &
3821  global%verbLevel >= verbose_high ) THEN
3822  WRITE(stdout,'(A,3X,A,1X,A)') solver_name,'Input volume window name:', &
3823  trim(global%volWinNameInput)
3824  END IF ! global%myProcid
3825 
3826 ! TO DO
3827 ! When PLAG is being integrated, a new window name will need to be defined and
3828 ! it will need to be set to tempString2
3829 ! END TO DO
3830 
3831 ! ******************************************************************************
3832 ! Set handles
3833 ! ******************************************************************************
3834 
3835  global%handleObtain = handleobtain
3836 
3837 ! ******************************************************************************
3838 ! End
3839 ! ******************************************************************************
3840 
3841  IF ( global%myProcid == masterproc .AND. &
3842  global%verbLevel >= verbose_high ) THEN
3843  WRITE(stdout,'(A,1X,A)') solver_name,'Storing names and handles done.'
3844  END IF ! global%myProcid
3845 
3846  END SUBROUTINE rflu_genx_storenameshandles
3847 
3848 
3849 
3850 
3851 
3852 
3853 
3854 
3855 
3856 END MODULE rflu_modrocstaradmin
3857 
3858 ! ******************************************************************************
3859 !
3860 ! RCS Revision history:
3861 !
3862 ! $Log: RFLU_ModGENXAdmin.F90,v $
3863 ! Revision 1.26 2009/05/12 20:20:56 mtcampbe
3864 ! Rocon integration changes
3865 !
3866 ! Revision 1.25 2008/12/06 08:44:21 mtcampbe
3867 ! Updated license.
3868 !
3869 ! Revision 1.24 2008/11/19 22:17:32 mtcampbe
3870 ! Added Illinois Open Source License/Copyright
3871 !
3872 ! Revision 1.23 2007/07/08 21:45:03 gzheng
3873 ! changed the PRESENT is used for PGI compiler
3874 !
3875 ! Revision 1.22 2007/04/20 16:07:48 mtcampbe
3876 ! Updating for burnout support function RFLU_GENX_InitBFLAG
3877 !
3878 ! Revision 1.21 2007/04/14 14:12:53 mtcampbe
3879 ! Mods for TZ
3880 !
3881 ! Revision 1.20 2006/04/07 15:19:19 haselbac
3882 ! Removed tabs
3883 !
3884 ! Revision 1.19 2006/01/04 20:11:18 wasistho
3885 ! added turbActive condition
3886 !
3887 ! Revision 1.18 2006/01/03 06:29:53 wasistho
3888 ! added CreateAttrWrapper and RegisterDataWrapper
3889 !
3890 ! Revision 1.17 2005/10/14 14:06:53 haselbac
3891 ! Added alloc/dealloc and setting of tbAlp array
3892 !
3893 ! Revision 1.16 2005/10/14 13:07:36 haselbac
3894 ! Removed tbAlp - added erroneously when checking in other changes
3895 !
3896 ! Revision 1.15 2005/10/13 17:27:32 haselbac
3897 ! Fixed bug in format statement, lead to *** output
3898 !
3899 ! Revision 1.14 2005/07/01 15:14:36 haselbac
3900 ! Added reading of verbLevelCOM
3901 !
3902 ! Revision 1.13 2005/06/09 20:19:52 haselbac
3903 ! Added cnstr_type to various routines
3904 !
3905 ! Revision 1.12 2005/05/04 03:34:10 haselbac
3906 ! Added writing of more info when registering surface grid
3907 !
3908 ! Revision 1.11 2005/04/15 15:06:55 haselbac
3909 ! Added routines to create, build, and destroy pconn attribute
3910 !
3911 ! Revision 1.10 2005/03/09 15:07:41 haselbac
3912 ! Erroneous check-in, removed debug code
3913 !
3914 ! Revision 1.9 2005/03/09 15:06:03 haselbac
3915 ! Added 2d option
3916 !
3917 ! Revision 1.8 2004/11/03 17:02:16 haselbac
3918 ! Removal of vertex and cell flag arrays, removed RFLU_GENX_CreateAttrGridVol (no longer necessary)
3919 !
3920 ! Revision 1.7 2004/11/02 14:03:34 haselbac
3921 ! Bug fix: Added missing declaration of t_mixt_input
3922 !
3923 ! Revision 1.6 2004/11/02 02:31:33 haselbac
3924 ! Replaced CV_MIXT_NEQS and DV_MIXT_NVAR
3925 !
3926 ! Revision 1.5 2004/10/27 12:26:52 jiao
3927 ! Fixed definition of bcflag, which used to be defined three times.
3928 !
3929 ! Revision 1.4 2004/10/27 05:46:45 jiao
3930 ! Added COM_set_size back for .gs for volume window.
3931 !
3932 ! Revision 1.3 2004/10/27 05:24:55 jiao
3933 ! Removed COM_set_size on du_alp and gs.
3934 !
3935 ! Revision 1.2 2004/10/22 14:00:57 haselbac
3936 ! Bug fix: False type used when creating attr for disp
3937 !
3938 ! Revision 1.1 2004/10/19 19:27:25 haselbac
3939 ! Initial revision
3940 !
3941 ! ******************************************************************************
3942 
3943 
3944 
3945 
3946 
3947 
3948 
3949 
3950 
3951 
3952 
3953 
3954 
3955 
3956 
3957 
subroutine, public turb_rflu_genxregisterdata(pRegion)
subroutine, public rflu_createbfaceloclists(pRegion)
subroutine, public rflu_genx_registerdataturb(pRegion)
subroutine, public rflu_genx_createattrdisp(pRegion)
size_t handle(const msq_std::string &name, MsqError &err) const
Get tag index from name.
subroutine, public rflu_genx_creategridsurf(pRegion)
subroutine, public rflu_genx_createattrflow(pRegion)
subroutine, public rflu_genx_destroygridsurf(pRegion)
subroutine, public rflu_genx_hardcodewindowname(global)
subroutine, public rflu_genx_createwindowsdone(pRegion)
subroutine, public rflu_genx_registergridsurf(pRegion)
subroutine, public rflu_genx_createattrgridsurf(pRegion)
Vector_n max(const Array_n_const &v1, const Array_n_const &v2)
Definition: Vector_n.h:354
subroutine, public rflu_genx_initrocman(pRegion, handle)
subroutine, public rflu_genx_buildpconn(pRegion)
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
int status() const
Obtain the status of the attribute.
Definition: Attribute.h:240
subroutine, public rflu_genx_storenameshandles(global, surfWinNameInput, volWinNameInput, handleObtain)
subroutine, public rflu_genx_createattrinterf(pRegion)
subroutine, public rflu_genx_createattrstats(pRegion)
subroutine, public rflu_genx_registerdatawrapper(pRegion)
subroutine, public rflu_genx_buildtimestring(time, timeString)
subroutine, public stat_rflu_genxregisterdata(pRegion)
MPI_Comm communicator() const
Definition: Function.h:119
subroutine, public rflu_genx_createdatainterf(pRegion)
subroutine, public rflu_genx_createwindows(pRegion, communicator)
subroutine, public rflu_genx_setconnsize(pRegion)
subroutine, public rflu_genx_closerocinctrlfiles(global)
subroutine, public rflu_genx_initbflag(pRegion)
subroutine, public rflu_genx_registerdataflow(pRegion)
subroutine, public turb_rflu_genxcreateattr(pRegion)
subroutine, public rflu_genx_createattrgspeeds(pRegion)
subroutine, public rflu_genx_buildgridsurf(pRegion)
subroutine, public rflu_genx_storecommunicator(global, communicator)
**********************************************************************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 rflu_genx_registergrid(pRegion)
subroutine, public rflu_genx_registerdisp(pRegion)
subroutine, public rflu_genx_createattrwrapper(pRegion)
subroutine, public rflu_genx_createpconn(pRegion)
subroutine, public stat_rflu_genxcreateattr(pRegion)
Vector_n min(const Array_n_const &v1, const Array_n_const &v2)
Definition: Vector_n.h:346
INTEGER function, public rflu_genx_setcnstrtype(movePatchDir)
subroutine, public rflu_destroybfaceloclists(pRegion)
subroutine, public rflu_genx_registergridvol(pRegion)
subroutine, public rflu_genx_readctrlfile(global)
subroutine, public rflu_genx_registerdatastats(pRegion)
subroutine, public rflu_genx_registerdatainterf(pRegion)
subroutine, public rflu_genx_registerdatagspeeds(pRegion)
subroutine errorstop(global, errorCode, errorLine, addMessage)
Definition: ModError.F90:483
subroutine, public rflu_genx_createattrturb(pRegion)
subroutine, public rflu_genx_destroydatainterf(pRegion)
subroutine, public rflu_buildbfaceloclists(pRegion)
subroutine deregisterfunction(global)
Definition: ModError.F90:469
subroutine, public rflu_genx_buildpaneid(iRegion, iPatch, paneId)
subroutine, public rflu_genx_destroypconn(pRegion)