forked from Nek5000-deprecated/Nek5000-deprecated
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathconnect2.f
2793 lines (2528 loc) · 79.2 KB
/
connect2.f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
c-----------------------------------------------------------------------
subroutine readat
C
C Read in data from preprocessor input file (.rea)
C
INCLUDE 'SIZE'
INCLUDE 'INPUT'
INCLUDE 'PARALLEL'
INCLUDE 'ZPER'
logical ifbswap,ifre2
character*132 string
real*8 etime_tmp
integer idum(3*numsts+3)
C Test timer accuracy
edif = 0.0
do i = 1,10
e1 = dnekclock()
e2 = dnekclock()
edif = edif + e2-e1
enddo
edif = edif/10.
if(nio.eq.0) write(6,'(A,1pE15.7,A,/)')
& ' timer accuracy: ', edif, ' sec'
etime_tmp = dnekclock()
C Open .rea file
if(nid.eq.0) then
write(6,*) 'read .rea file'
OPEN (UNIT=9,FILE=REAFLE,STATUS='OLD')
endif
C Read parameters and logical flags
CALL RDPARAM
C Read Mesh Info
if(nid.eq.0) then
read(9,*) ! xfac,yfac,xzero,yzero
read(9,*) ! dummy
if (ifmoab) then
read(9,*) h5mfle
! read fluid/solid material set ids
read(9,*) numflu, numoth
if (numflu+numoth .gt. numsts) then
write(6,'(A)')
$ 'Number of fluid+other material sets too large.'
write(6, '(A)')
$ 'Need to increase NUMSTS in file INPUT.'
call exitt
else if (numoth .gt. 0 .and. .not. ifheat) then
call exitt(
$ 'Error: no. of other sets is non-zero but ifheat = false.')
endif
read(9,*) (matids(i), i = 1, numflu+numoth)
do i = numflu+numoth+1, numsts
matids(i) = -1
enddo
read(9,*) (matindx(i), i = 1, numflu+numoth)
do i = numflu+numoth+1, numsts
matindx(i) = -1
enddo
do i = 1, lelt
imatie(i) = -1
enddo
read(9,*) numbcs
if (numbcs .gt. numsts) then
write(6,'(A)')
$ 'Number of BC sets too large.'
write(6, '(A)')
$ 'Need to increase NUMSTS in file INPUT.'
call exitti
endif
do iset = 1, numbcs
read(9,'(2I5,A3)') ibcsts(iset), bcf(iset), bctyps(iset)
enddo
nelgs = 0
do iset = numbcs+1, numsts
bcf(iset) = -1
bctyps(iset) = 'E '
ibcsts(iset) = -1
enddo
else
read(9,*) nelgs,ndim,nelgv
nelgt = abs(nelgs)
endif
endif
call bcast(nelgs,ISIZE)
call bcast(ndim ,ISIZE)
call bcast(nelgv,ISIZE)
call bcast(nelgt,ISIZE)
call bcast(h5mfle,132)
if (ifmoab) then
c pack into long int array and bcast as that
if (nid .eq. 0) then
idum(1) = numflu
idum(2) = numoth
idum(3) = numbcs
do iset = 1, numsts
idum(3+iset) = matids(iset)
enddo
do iset = 1, numsts
idum(3+numflu+numoth+iset) = ibcsts(iset)
enddo
do iset = 1, numsts
idum(3+numflu+numoth+numbcs+iset) = matindx(iset)
enddo
endif
call bcast(idum, ISIZE*(3+3*numsts))
call bcast(bctyps, 3*numsts)
call bcast(bcf, ISIZE*numsts)
if (nid .ne. 0) then
numflu = idum(1)
numoth = idum(2)
numbcs = idum(3)
do iset = 1, numsts
matids(iset) = idum(3+iset)
enddo
do iset = 1, numsts
ibcsts(iset) = idum(3+numflu+numoth+iset)
enddo
do iset = 1, numsts
matindx(iset) = idum(3+numflu+numoth+numbcs+iset)
enddo
endif
endif
ifre2 = .false.
if(nelgs.lt.0) ifre2 = .true. ! use new .re2 reader
ifgtp = .false.
if (ndim.lt.0) ifgtp = .true. ! domain is a global tensor product
if (ifmoab) then
#ifdef MOAB
call nekMOAB_import
#endif
else
if (ifre2) call open_bin_file(ifbswap) ! rank0 will open and read
if (nio.eq.0) then
write(6,12) 'nelgt/nelgv/lelt:',nelgt,nelgv,lelt
write(6,12) 'lx1 /lx2 /lx3 :',lx1,lx2,lx3
12 format(1X,A,4I12,/,/)
endif
call chk_nel ! make certain sufficient array sizes
if (.not.ifgtp) call mapelpr ! read .map file, est. gllnid, etc.
if (ifre2) then
call bin_rd1(ifbswap) ! rank0 will read mesh data + distribute
else
maxrd = 32 ! max # procs to read at once
mread = (np-1)/maxrd+1 ! mod param
iread = 0 ! mod param
x = 0
do i=0,np-1,maxrd
call nekgsync()
if (mod(nid,mread).eq.iread) then
if (nid.ne.0) then
open(UNIT=9,FILE=REAFLE,STATUS='OLD')
call cscan(string,'MESH DATA',9)
read(9,*) string
endif
if (ifgtp) then
call genbox
else
call rdmesh
call rdcurve ! Curved side data
call rdbdry ! Boundary Conditions
endif
if (nid.ne.0) close(unit=9)
endif
iread = iread + 1
enddo
endif
endif
C Read Restart options / Initial Conditions / Drive Force
CALL RDICDF
C Read materials property data
CALL RDMATP
C Read history data
CALL RDHIST
C Read output specs
CALL RDOUT
C Read objects
CALL RDOBJ
call nekgsync()
C End of input data, close read file.
IF(NID.EQ.0) THEN
CLOSE(UNIT=9)
write(6,'(A,g13.5,A,/)') ' done :: read .rea file ',
& dnekclock()-etime_tmp,' sec'
ENDIF
c This is not an excellent place for this check, but will
c suffice for now. 5/6/10
if (ifchar.and.(nelgv.ne.nelgt)) call exitti(
$ 'ABORT: IFCHAR curr. not supported w/ conj. ht transfer$',nelgv)
return
END
c-----------------------------------------------------------------------
subroutine rdparam
C
C .Read in parameters supplied by preprocessor and
C (eventually) echo check.
C
C .Broadcast run parameters to all processors
C
INCLUDE 'SIZE'
INCLUDE 'INPUT'
INCLUDE 'PARALLEL'
INCLUDE 'CTIMER'
INCLUDE 'ZPER'
character*132 string(100)
VNEKTON = 3 ! dummy not really used anymore
IF(NID.EQ.0) THEN
READ(9,*,ERR=400)
READ(9,*,ERR=400)
READ(9,*,ERR=400) NDIM
READ(9,*,ERR=400) NPARAM
DO 20 I=1,NPARAM
READ(9,*,ERR=400) PARAM(I)
20 CONTINUE
ENDIF
call bcast(NDIM ,ISIZE)
call bcast(NPARAM,ISIZE)
call bcast(PARAM ,200*WDSIZE)
NPSCAL=INT(PARAM(23))
NPSCL1=NPSCAL+1
NPSCL2=NPSCAL+2
IF (NPSCL1.GT.LDIMT) THEN
if(nid.eq.0) then
WRITE(6,21) LDIMT,NPSCL1
21 FORMAT(//,2X,'Error: This NEKTON Solver has been compiled'
$ /,2X,' for',I4,' passive scalars. This run'
$ /,2X,' requires that LDIMT be set to',I4,'.')
endif
call exitt
ENDIF
c
c Read in the passive scalar conduct and rhocp's:
c
c fluid
c .viscosity is PARAM(2)
c .if it is negative, it indicates that Re has been input
c .therefore, redefine PARAM(2) = -1.0/PARAM(2)
c
if(param(2) .lt.0.0) param(2) = -1.0/param(2)
if(param(8) .lt.0.0) param(8) = -1.0/param(8)
if(param(29).lt.0.0) param(29) = -1.0/param(29)
C
CPFLD(1,1)=PARAM(2)
CPFLD(1,2)=PARAM(1)
C temperature
CPFLD(2,1)=PARAM(8)
CPFLD(2,2)=PARAM(7)
CPFLD(2,3)=PARAM(9)
c
c passive scalars
c
IF(NID.EQ.0) THEN
READ(9,*,ERR=400) NSKIP
IF (NSKIP.GT.0 .AND. NPSCAL.GT.0) THEN
READ(9,*,ERR=400)(CPFLD(I,1),I=3,NPSCL2)
IF(NPSCL2.LT.9)READ(9,*)
READ(9,*,ERR=400)(CPFLD(I,2),I=3,NPSCL2)
IF(NPSCL2.LT.9)READ(9,*)
do i=3,npscl2
if (cpfld(i,1).lt.0) cpfld(i,1) = -1./cpfld(i,1)
if (cpfld(i,2).lt.0) cpfld(i,2) = -1./cpfld(i,2)
enddo
ELSE
DO 25 I=1,NSKIP
READ(9,*,ERR=500)
25 CONTINUE
ENDIF
ENDIF
call bcast(cpfld,WDSIZE*LDIMT1*3)
C
C Read logical equation type descriptors....
C
IFTMSH(0) = .false.
do i=1,NPSCL2
IFTMSH(i) = .false.
IFADVC(i) = .false.
enddo
IFFLOW = .false.
IFHEAT = .false.
IFTRAN = .false.
IFAXIS = .false.
IFAZIV = .false.
IFSTRS = .false.
IFLOMACH = .false.
IFMODEL = .false.
IFKEPS = .false.
IFMVBD = .false.
IFCHAR = .false.
IFDG = .false.
IFANLS = .false.
IFMOAB = .false.
IFCOUP = .false.
IFVCOUP = .false.
IFMHD = .false.
IFESSR = .false.
IFTMSH(0) = .false.
IFUSERVP = .false.
IFCONS = .false. ! Use conservation form?
IFUSERMV = .false.
IFCYCLIC = .false.
IFSYNC = .false.
IFEXPLVIS = .false.
IFSCHCLOB = .false.
c IFSPLIT = .false.
IFCMT = .false.
IFVISC = .false.
IFFLTR = .false.
ifbase = .true.
ifpert = .false.
IF(NID.EQ.0) READ(9,*,ERR=500) NLOGIC
call bcast(NLOGIC,ISIZE)
IF(NLOGIC.GT.100) THEN
if(nid.eq.0)
$ write(6,*) 'ABORT: Too many logical switches', NLOGIC
call exitt
ENDIF
if(nid.eq.0) READ(9,'(A132)',ERR=500) (string(i),i=1,NLOGIC)
call bcast(string,100*132*CSIZE)
do i = 1,NLOGIC
call capit(string(i),132)
if (indx1(string(i),'IFTMSH' ,6).gt.0) then
read(string(i),*,ERR=490) (IFTMSH(II),II=0,NPSCL2)
elseif (indx1(string(i),'IFNAV' ,5).gt.0 .and.
& indx1(string(i),'IFADVC' ,6).gt.0) then
read(string(i),*,ERR=490) (IFADVC(II),II=1,NPSCL2)
elseif (indx1(string(i),'IFADVC' ,6).gt.0) then
read(string(i),*,ERR=490) (IFADVC(II),II=1,NPSCL2)
elseif (indx1(string(i),'IFFLOW' ,6).gt.0) then
read(string(i),*) IFFLOW
elseif (indx1(string(i),'IFHEAT' ,6).gt.0) then
read(string(i),*) IFHEAT
elseif (indx1(string(i),'IFTRAN' ,6).gt.0) then
read(string(i),*) IFTRAN
elseif (indx1(string(i),'IFAXIS' ,6).gt.0) then
read(string(i),*) IFAXIS
elseif (indx1(string(i),'IFAZIV' ,6).gt.0) then
read(string(i),*) IFAZIV
elseif (indx1(string(i),'IFSTRS' ,6).gt.0) then
read(string(i),*) IFSTRS
elseif (indx1(string(i),'IFLO' ,4).gt.0) then
read(string(i),*) IFLOMACH
elseif (indx1(string(i),'IFMGRID',7).gt.0) then
c read(string(i),*) IFMGRID
elseif (indx1(string(i),'IFKEPS' ,6).gt.0) then
read(string(i),*) IFKEPS
elseif (indx1(string(i),'IFMODEL',7).gt.0) then
read(string(i),*) IFMODEL
elseif (indx1(string(i),'IFMVBD' ,6).gt.0) then
read(string(i),*) IFMVBD
elseif (indx1(string(i),'IFCHAR' ,6).gt.0) then
read(string(i),*) IFCHAR
elseif (indx1(string(i),'IFDG' ,4).gt.0) then
read(string(i),*) IFDG
elseif (indx1(string(i),'IFANLS' ,6).gt.0) then
read(string(i),*) IFANLS
elseif (indx1(string(i),'IFMOAB' ,6).gt.0) then
read(string(i),*) IFMOAB
elseif (indx1(string(i),'IFCOUP' ,6).gt.0) then
read(string(i),*) IFCOUP
elseif (indx1(string(i),'IFVCOUP' ,7).gt.0) then
read(string(i),*) IFVCOUP
elseif (indx1(string(i),'IFMHD' ,5).gt.0) then
read(string(i),*) IFMHD
elseif (indx1(string(i),'IFCONS' ,6).gt.0) then
read(string(i),*) IFCONS
elseif (indx1(string(i),'IFUSERVP',8).gt.0) then
read(string(i),*) IFUSERVP
elseif (indx1(string(i),'IFUSERMV',8).gt.0) then
read(string(i),*) IFUSERMV
elseif (indx1(string(i),'IFCYCLIC',8).gt.0) then
read(string(i),*) IFCYCLIC
elseif (indx1(string(i),'IFPERT' ,6).gt.0) then
read(string(i),*) IFPERT
elseif (indx1(string(i),'IFBASE' ,6).gt.0) then
read(string(i),*) IFBASE
elseif (indx1(string(i),'IFSYNC' ,6).gt.0) then
read(string(i),*) IFSYNC
elseif (indx1(string(i),'IFEXPLVIS',9).gt.0) then
read(string(i),*) IFEXPLVIS
elseif (indx1(string(i),'IFSCHCLOB',9).gt.0) then
read(string(i),*) IFSCHCLOB
elseif (indx1(string(i),'IFSPLIT' ,7).gt.0) then
c read(string,*) IFSPLIT
elseif (indx1(string(i),'IFCMT',5).gt.0) then
read(string(i),*) IFCMT
elseif (indx1(string(i),'IFVISC',6).gt.0) then
read(string(i),*) IFVISC
elseif (indx1(string(i),'IFFLTR',6).gt.0) then
read(string(i),*) IFFLTR
else
if(nid.eq.0) then
write(6,'(1X,2A)') 'ABORT: Unknown logical flag', string
write(6,'(30(A,/))')
& ' Available logical flags:',
& ' IFTMSH' ,
& ' IFADVC' ,
& ' IFFLOW' ,
& ' IFHEAT' ,
& ' IFTRAN' ,
& ' IFAXIS' ,
& ' IFCYCLIC' ,
& ' IFSTRS' ,
& ' IFLOMACH' ,
& ' IFMGRID' ,
& ' IFKEPS' ,
& ' IFMVBD' ,
& ' IFCHAR' ,
& ' IFDG' ,
& ' IFANLS' ,
& ' IFUSERVP' ,
& ' IFUSERMV' ,
& ' IFSYNC' ,
& ' IFCYCLIC' ,
& ' IFSPLIT' ,
& ' IFEXPLVIS',
& ' IFCONS' ,
& ' IFMOAB' ,
& ' IFCOUP' ,
& ' IFVCOUP' ,
& ' IFCMT' ,
& ' IFVISC' ,
& ' IFFLTR'
endif
call exitt
endif
490 continue
enddo
ifmgrid = .false.
if (ifsplit) ifmgrid = .true.
if (ifaxis.and..not.ifsplit) then ! Use standard Schwarz/PCG solver
ifmgrid = .false.
param(42) = 1.00000 ! p042 0=gmres/1=pcg
param(43) = 1.00000 ! p043 0=semg/1=schwarz
param(44) = 1.00000 ! p044 0=E-based/1=A-based prec.
endif
if (param(29).ne.0.) ifmhd = .true.
if (ifmhd) ifessr = .true.
if (ifmhd) npscl1 = npscl1 + 1
if (param(30).gt.0) ifuservp = .true.
if (param(31).ne.0.) ifpert = .true.
if (param(31).lt.0.) ifbase = .false. ! don't time adv base flow
npert = abs(param(31))
IF (NPSCL1.GT.LDIMT .AND. IFMHD) THEN
if(nid.eq.0) then
WRITE(6,22) LDIMT,NPSCL1
22 FORMAT(/s,2X,'Error: This NEKTON Solver has been compiled'
$ /,2X,' for',I4,' passive scalars. A MHD run'
$ /,2X,' requires that LDIMT be set to',I4,'.')
endif
call exitt
ENDIF
if (ifmvbd) then
if (lx1.ne.lx1m.or.ly1.ne.ly1m.or.lz1.ne.lz1m)
$ call exitti('Need lx1m=lx1 etc. in SIZE . $',lx1m)
endif
ifldmhd = npscal + 3
if (ifmhd) then
cpfld(ifldmhd,1) = param(29) ! magnetic viscosity
cpfld(ifldmhd,2) = param( 1) ! magnetic rho same as for fluid
endif
C
C Set up default time dependent coefficients - NSTEPS,DT.
C
if (.not.iftran) then
if (ifflow.and.ifsplit) then
iftran=.true.
else
param(11) = 1.0
param(12) = 1.0
param(19) = 0.0
endif
endif
c
c Check here for global fast diagonalization method or z-homogeneity.
c This is here because it influence the mesh read, which follows.
nelx = abs(param(116)) ! check for global tensor-product structure
nely = abs(param(117))
nelz = abs(param(118))
n_o = 0
if (n_o.eq.0) then
ifzper=.false.
ifgfdm=.false.
if (nelz.gt.0) ifzper=.true.
if (nelx.gt.0) ifgfdm=.true.
if (nelx.gt.0) ifzper=.false.
endif
C
C Do some checks
C
IF(NDIM.NE.LDIM)THEN
IF(NID.EQ.0) THEN
WRITE(6,10) LDIM,NDIM
10 FORMAT(//,2X,'ERROR: This NEKTON Solver has been compiled'
$ /,2X,' for spatial dimension equal to',I2,'.'
$ /,2X,' The data file has dimension',I2,'.')
ENDIF
call exitt
ENDIF
IF (NDIM.EQ.3) IF3D=.TRUE.
IF (NDIM.NE.3) IF3D=.FALSE.
if (if3d) then
if (ly1.ne.lx1.or.lz1.ne.lx1) then
if (nid.eq.0) write(6,13) lx1,ly1,lz1
13 format('ERROR: lx1,ly1,lz1:',3i5,' must be equal for 3D')
call exitt
endif
if (ly2.ne.lx2.or.lz2.ne.lx2) then
if (nid.eq.0) write(6,14) lx2,ly2,lz2
14 format('ERROR: lx2,ly2,lz2:',3i5,' must be equal for 3D')
call exitt
endif
else
if (ly1.ne.lx1.or.lz1.ne.1) then
if (nid.eq.0) write(6,12) lx1,ly1,lz1
12 format('ERROR: ',3i5,' must have lx1=ly1; lz1=1, for 2D')
call exitt
endif
if (ly2.ne.lx2.or.lz2.ne.1) then
if (nid.eq.0) write(6,11) lx2,ly2,lz2
11 format('ERROR: ',3i5,' must have lx2=ly2; lz2=1, for 2D')
call exitt
endif
endif
if (lgmres.lt.5 .and. param(42).eq.0) then
if(nid.eq.0) write(6,*)
$ 'WARNING: lgmres might be too low!'
endif
if (ifsplit) then
if (lx1.ne.lx2) then
if (nid.eq.0) write(6,43) lx1,lx2
43 format('ERROR: lx1,lx2:',2i4,' must be equal for IFSPLIT=T')
call exitt
endif
else
if (lx2.lt.lx1-2) then
if (nid.eq.0) write(6,44) lx1,lx2
44 format('ERROR: lx1,lx2:',2i4,' lx2 must be lx-2 for IFSPLIT=F')
call exitt
endif
endif
if (ifmvbd .and. ifsplit) then
if(nid.eq.0) write(6,*)
$ 'ABORT: Moving boundary in Pn-Pn is not supported'
call exitt
endif
if (ifmoab .and..not. ifsplit) then
if(nid.eq.0) write(6,*)
$ 'ABORT: MOAB in Pn-Pn-2 is not supported'
call exitt
endif
ktest = (lx1-lx1m) + (ly1-ly1m) + (lz1-lz1m)
if (ifstrs.and.ktest.ne.0) then
if(nid.eq.0) write(6,*)
$ 'ABORT: Stress formulation requires lx1m=lx1, etc. in SIZE'
call exitt
endif
if (ifgfdm.and.ifsplit) call exitti
$ ('ERROR: FDM (p116>0) requires lx2=lx1-2 in SIZE$',lx2)
if (ifgfdm.and.lfdm.eq.0) call exitti
$ ('ERROR: FDM requires lfdm=1 in SIZE$',lfdm)
if (ifsplit .and. ifstrs) then
if(nid.eq.0) write(6,*)
$ 'ABORT: Stress formulation in Pn-Pn is not supported'
call exitt
endif
if (ifsplit .and. ifmhd) then
if(nid.eq.0) write(6,*)
$ 'ABORT: MHD in Pn-Pn is not supported'
call exitt
endif
if (ifmhd .and. lbx1.ne.lx1) then
if(nid.eq.0) write(6,*)
$ 'ABORT: For MHD, need lbx1=lx1, etc.; Change SIZE '
call exitt
endif
if (ifpert .and. lpx1.ne.lx1) then
if(nid.eq.0) write(6,*)
$ 'ABORT: For Lyapunov, need lpx1=lx1, etc.; Change SIZE '
endif
if (if3d) ifaxis = .false.
if (iflomach .and. .not.ifsplit) then
if(nid.eq.0) write(6,*)
$ 'ABORT: For lowMach, need lx2=lx1, etc.; Change SIZE '
call exitt
endif
if (iflomach .and. .not.ifheat) then
if(nid.eq.0) write(6,*)
$ 'ABORT For lowMach, need ifheat=true; Change IFHEAT'
call exitt
endif
c if (ifsplit .and. param(55).ne.0) then
c if(nid.eq.0) write(6,*)
c $ 'ABORT: Fixed mass flux not supported for Pn-Pn'
c call exitt
c endif
if (ifmhd) ifchar = .false. ! For now, at least.
c set dealiasing handling
if (param(99).lt.0) then
param(99) = -1 ! No dealiasing
else
param(99) = 4 ! default
if (ifaxis) param(99) = 3 ! For now, at least.
if (ifmvbd) param(99) = 3 ! For now, at least.
endif
if (ifchar .and. param(99).lt.0) then
if (nid.eq.0) write(6,*)
& 'ABORT: Characteristic scheme needs dealiasing!'
call exitt
endif
if (param(99).gt.-1 .and. (lxd.lt.lx1 .or. lyd.lt.ly1 .or.
& lzd.lt.lz1)) then
if(nid.eq.0) write(6,*)
& 'ABORT: Dealiasing space too small; Check lxd,lyd,lzd in SIZE '
call exitt
endif
c set I/O format handling
c if (param(67).lt.0) then
c param(67) = 0 ! ASCII
c else ! elseif (param(67).ne.4) then
c param(67) = 6 ! binary is default
c endif
c if (param(66).lt.0) then
c param(66) = 0 ! ASCII
c else ! elseif (param(66).ne.4) then
c param(66) = 6 ! binary is default
c endif
c SET DEFAULT TO 6, ADJUSTED IN USR FILE ONLY
param(66) = 6
param(67) = 6
if (ifdg) param(59)=1 ! No fast operator eval for DG
#ifndef MOAB
if (ifmoab) then
print *,"ABORT: ifmoab = .true. in input but this ",
$ "version of nek not compiled with MOAB."
call exitti
endif
#endif
return
C
C Error handling:
C
400 CONTINUE
if(nid.eq.0) WRITE(6,401)
401 FORMAT(2X,'ERROR READING PARAMETER DATA'
$ ,/,2X,'ABORTING IN ROUTINE RDPARAM.')
call exitt
C
500 CONTINUE
if(nid.eq.0) WRITE(6,501)
501 FORMAT(2X,'ERROR READING LOGICAL DATA'
$ ,/,2X,'ABORTING IN ROUTINE RDPARAM.')
call exitt
C
return
END
c-----------------------------------------------------------------------
subroutine rdmesh
C
C .Read number of elements
C
C .Construct sequential element-processor partition according
C to number of elements and processors
C
C .Selectively read mesh (defined by element vertices, and group numbers)
C on each processor
C
include 'SIZE'
include 'INPUT'
include 'PARALLEL'
character*1 adum
real dum(4)
c Read elemental mesh data, formatted
iffmtin = .true.
NSIDES=NDIM*2
DO 40 IEG=1,NELGT
IF (GLLNID(IEG).EQ.NID) THEN
IEL=GLLEL(IEG)
igroup(iel) = 0
read(9,30,err=31,end=600) igroup(iel)
30 format(43x,i5)
c read(9,*,err=31,end=600) adum
31 continue
C Read Corner data
IF(NDIM.EQ.2)THEN
READ(9,*,ERR=500,END=600) (XC(IC,IEL),IC=1,4)
READ(9,*,ERR=500,END=600) (YC(IC,IEL),IC=1,4)
call rzero (zc(1 ,iel) ,4)
ELSE IF(NDIM.EQ.3)THEN
READ(9,*,ERR=500,END=600) (XC(IC,IEL),IC=1,4)
READ(9,*,ERR=500,END=600) (YC(IC,IEL),IC=1,4)
READ(9,*,ERR=500,END=600) (ZC(IC,IEL),IC=1,4)
READ(9,*,ERR=500,END=600) (XC(IC,IEL),IC=5,8)
READ(9,*,ERR=500,END=600) (YC(IC,IEL),IC=5,8)
READ(9,*,ERR=500,END=600) (ZC(IC,IEL),IC=5,8)
ENDIF
ELSE
C Skip over this data for element NOT on this processor
READ(9,41,ERR=500,END=600) ADUM
C Read Corner data
IF(NDIM.EQ.2)THEN
READ(9,41,ERR=500,END=600) ADUM
READ(9,41,ERR=500,END=600) ADUM
ELSE IF(NDIM.EQ.3)THEN
READ(9,41,ERR=500,END=600) ADUM
READ(9,41,ERR=500,END=600) ADUM
READ(9,41,ERR=500,END=600) ADUM
READ(9,41,ERR=500,END=600) ADUM
READ(9,41,ERR=500,END=600) ADUM
READ(9,41,ERR=500,END=600) ADUM
ENDIF
ENDIF
40 CONTINUE
41 FORMAT(A1)
C
C End of mesh read.
C
return
C
C Error handling:
C
400 CONTINUE
if(nid.eq.0) WRITE(6,401)
401 FORMAT(2X,'ERROR READING SCALE FACTORS, CHECK READ FILE'
$ ,/,2X,'ABORTING IN ROUTINE RDMESH.')
call exitt
500 CONTINUE
if(nid.eq.0) WRITE(6,501) IEG
501 FORMAT(2X,'ERROR READING MESH DATA NEAR ELEMENT',I12
$ ,/,2X,'ABORTING IN ROUTINE RDMESH.')
call exitt
600 CONTINUE
if(nid.eq.0) WRITE(6,601) IEG
601 FORMAT(2X,'ERROR 2 READING MESH DATA NEAR ELEMENT',I12
$ ,/,2X,'ABORTING IN ROUTINE RDMESH.')
call exitt
return
end
c-----------------------------------------------------------------------
subroutine rdcurve
C
C .Read curve side data
C
C .Disperse curve side data to all processors according
C to sequential partition scheme
C
C
INCLUDE 'SIZE'
INCLUDE 'INPUT'
INCLUDE 'PARALLEL'
CHARACTER*1 ANS
C
C
C
IF (IFFMTIN) THEN
C
C Read formatted curve side data
C
READ(9,*)
READ(9,*)NCURVE
CALL RZERO(CURVE ,72*LELT)
CALL BLANK(CCURVE,12*LELT)
IF (NCURVE.GT.0) THEN
DO 50 ICURVE=1,NCURVE
IF (NELGT.LT.1000) THEN
READ(9,60,ERR=500,END=500) IEDG,IEG,R1,R2,R3,R4,R5,ANS
ELSEIF (NELGT.LT.1 000 000) THEN
READ(9,61,ERR=500,END=500) IEDG,IEG,R1,R2,R3,R4,R5,ANS
ELSE
READ(9,62,ERR=500,END=500) IEDG,IEG,R1,R2,R3,R4,R5,ANS
ENDIF
60 FORMAT(I3,I3 ,5G14.6,1X,A1)
61 FORMAT(I2,I6 ,5G14.6,1X,A1)
62 FORMAT(I2,I12,5G14.6,1X,A1)
IF (GLLNID(IEG).EQ.NID) THEN
IEL=GLLEL(IEG)
CURVE (1,IEDG,IEL)=R1
CURVE (2,IEDG,IEL)=R2
CURVE (3,IEDG,IEL)=R3
CURVE (4,IEDG,IEL)=R4
CURVE (5,IEDG,IEL)=R5
CCURVE( IEDG,IEL)=ANS
ENDIF
50 CONTINUE
ENDIF
return
C
C Error handling:
C
500 CONTINUE
if(nid.eq.0) WRITE(6,501)
501 FORMAT(2X,'ERROR READING CURVE SIDE DATA'
$ ,/,2X,'ABORTING IN ROUTINE RDCURVE.')
call exitt
return
C
ELSE
C
C Read unformatted curve side data
C
READ(8) NCURVE
CALL RZERO(CURVE ,72*LELT)
CALL BLANK(CCURVE,12*LELT)
IF (NCURVE.GT.0) THEN
DO 1050 ICURVE=1,NCURVE
READ(8,ERR=1500,END=1500) IEDG,IEG,R1,R2,R3,R4,R5,ANS
IF (GLLNID(IEG).EQ.NID) THEN
IEL=GLLEL(IEG)
CURVE (1,IEDG,IEL)=R1
CURVE (2,IEDG,IEL)=R2
CURVE (3,IEDG,IEL)=R3
CURVE (4,IEDG,IEL)=R4
CURVE (5,IEDG,IEL)=R5
CCURVE( IEDG,IEL)=ANS
ENDIF
1050 CONTINUE
ENDIF
return
C
C Error handling:
C
1500 CONTINUE
if(nid.eq.0) WRITE(6,1501)
1501 FORMAT(2X,'ERROR READING unformatted CURVE SIDE DATA'
$ ,/,2X,'ABORTING IN ROUTINE RDCURVE.')
call exitt
C
return
ENDIF
END
c-----------------------------------------------------------------------
subroutine rdbdry
C
C .Read Boundary Conditions (and connectivity data)
C
C .Disperse boundary condition data to all processors
C according to sequential partition scheme
C
INCLUDE 'SIZE'
INCLUDE 'INPUT'
INCLUDE 'PARALLEL'
INCLUDE 'SCRCT'
CHARACTER CBC1*1,CBC3*3,CHTEMP*1,CHTMP3*3
EQUIVALENCE (CHTEMP,CHTMP3)
character*132 string
C
C Set up TEMPORARY value for NFIELD - NFLDT
C
NFLDT = 1
IF (IFHEAT) NFLDT=2+NPSCAL
if (ifmhd ) nfldt=2+npscal+1
NBCS = NFLDT
IBCS = 2
IF (IFFLOW) IBCS = 1
NSIDES = 2*NDIM
C
C Read boundary conditions for all fields
C
LCBC=18*LELT*(LDIMT1 + 1)
LRBC=30*LELT*(LDIMT1 + 1)
CALL RZERO(BC ,LRBC)
CALL BLANK(CBC,LCBC)
C
C-----------------------------------------------------------------
C Formatted Reads
C-----------------------------------------------------------------
C
IF (IFFMTIN) THEN
C
READ(9,*,ERR=500,END=500) ! ***** BOUNDARY CONDITIONS *****
ibcnew = 1
DO 100 IFIELD=ibcnew,NBCS ! DO 100 IFIELD=IBCS,NBCS
NEL=NELGT
if (.not.iftmsh(ifield)) nel = nelgv
C Fluid and/or thermal
read(9,81) string ! ***** FLUID BOUNDARY CONDITIONS *****
call capit(string,132)
c write(6,*) 'reading BC:',ifield,ibcs,nbcs
c write(6,81) string
c if1 = indx1(string,'NO ',3)
c write(6,*) if1,' if NO. quit.',ifield,ibcs,nbcs
c write(6,*) ifield,iftmsh(ifield),nel,' iftmsh'
c call exitt
if (indx1(string,'NO ',3).eq.0) then ! we have acitve bc info
C
IF(VNEKTON .LE. 2.52) NBCREA = 3
IF(VNEKTON .GE. 2.55) NBCREA = 5
C
DO 80 IEG=1,NEL
DO 80 ISIDE=1,NSIDES
IF (GLLNID(IEG).EQ.NID) THEN
IEL=GLLEL(IEG)
IF (NELGT.LT.1000) THEN
READ(9,50,ERR=500,END=500)
$ CHTEMP,
$ CBC(ISIDE,IEL,IFIELD),ID1,ID2,
$ (BC(II,ISIDE,IEL,IFIELD),II=1,NBCREA)
c write(6,50)
c $ CHTEMP,
c $ CBC(ISIDE,IEL,IFIELD),ID1,ID2,
c $ (BC(II,ISIDE,IEL,IFIELD),II=1,NBCREA)
50 FORMAT(A1,A3,2I3,5G14.6)
ELSEIF (NELGT.LT.100 000) THEN
READ(9,51,ERR=500,END=500)
$ CHTEMP,
$ CBC(ISIDE,IEL,IFIELD),ID1,ID2,
$ (BC(II,ISIDE,IEL,IFIELD),II=1,NBCREA)
51 FORMAT(A1,A3,I5,I1,5G14.6)
ELSEIF (NELGT.LT.1 000 000) THEN
READ(9,52,ERR=500,END=500)
$ CHTEMP,
$ CBC(ISIDE,IEL,IFIELD),ID1,
$ (BC(II,ISIDE,IEL,IFIELD),II=1,NBCREA)
52 FORMAT(A1,A3,I6,5G14.6)
ELSE
READ(9,53,ERR=500,END=500)
$ CHTEMP,
$ CBC(ISIDE,IEL,IFIELD),ID1,
$ (BC(II,ISIDE,IEL,IFIELD),II=1,NBCREA)
53 FORMAT(A1,A3,I12,5G18.11)
ENDIF
C Mesh B.C.'s in 1st column of 1st field
IF (CHTEMP.NE.' ') CBC(ISIDE,IEL,0)(1:1)= CHTEMP
C check for fortran function as denoted by lower case bc's: