5 use size_m
, only : nid, lelt, ndim, lx1, lx2, lx3
7 use input, only : reafle, ifmoab, h5mfle, numflu, numoth, ifheat
8 use input, only : matids, matindx, imatie, ifchar, numsts
9 use input, only : numbcs, ibcsts, bcf, bctyps
10 use parallel, only : nelgv, nelgt, isize
12 use zper, only : ifgtp
16 character(132) :: tmp_string
18 integer :: idum(3*numsts+3)
20 real(DP) :: edif, e1, e2
21 integer :: i, iset, nelgs
31 if(nid == 0)
write(6,
'(A,1pE15.7,A,/)') &
32 ' timer accuracy: ', edif,
' sec'
38 write(6,*)
'read .rea file'
39 OPEN (unit=9,file=reafle,status=
'OLD')
52 read(9,*) numflu, numoth
53 if (numflu+numoth > numsts)
then
55 'Number of fluid+other material sets too large.'
57 'Need to increase NUMSTS in file INPUT.'
59 else if (numoth > 0 .AND. .NOT. ifheat)
then
61 'Error: no. of other sets is non-zero but ifheat = false.')
63 read(9,*) (matids(i), i = 1, numflu+numoth)
64 do i = numflu+numoth+1, numsts
67 read(9,*) (matindx(i), i = 1, numflu+numoth)
68 do i = numflu+numoth+1, numsts
75 if (numbcs > numsts)
then
77 'Number of BC sets too large.'
79 'Need to increase NUMSTS in file INPUT.'
83 read(9,
'(2I5,A3)') ibcsts(iset), bcf(iset), bctyps(iset)
87 do iset = numbcs+1, numsts
93 read(9,*) nelgs,ndim,nelgv
97 call
bcast(nelgs,isize)
98 call
bcast(ndim ,isize)
99 call
bcast(nelgv,isize)
100 call
bcast(nelgt,isize)
101 call
bcast(h5mfle,132)
109 idum(3+iset) = matids(iset)
112 idum(3+numflu+numoth+iset) = ibcsts(iset)
115 idum(3+numflu+numoth+numbcs+iset) = matindx(iset)
118 call
bcast(idum, isize*(3+3*numsts))
119 call
bcast(bctyps, 3*numsts)
120 call
bcast(bcf, isize*numsts)
127 matids(iset) = idum(3+iset)
130 ibcsts(iset) = idum(3+numflu+numoth+iset)
133 matindx(iset) = idum(3+numflu+numoth+numbcs+iset)
138 if(nelgs < 0) ifre2 = .true.
141 if (ndim < 0) ifgtp = .true.
150 write(6,12)
'nelgt/nelgv/lelt:',nelgt,nelgv,lelt
151 write(6,12)
'lx1 /lx2 /lx3 :',lx1,lx2,lx3
152 12
format(1x,a,4i12,/,/)
159 write(*,*)
"Oops: ifre2"
169 mread = (
np-1)/maxrd+1
174 if (mod(nid,mread) == iread)
then
176 open(unit=9,file=reafle,status=
'OLD')
177 call
cscan(tmp_string,
'MESH DATA',9)
187 if (nid /= 0)
close(unit=9)
196 call
cscan(tmp_string,
'TAIL OPTS',9)
215 write(6,
'(A,g13.5,A,/)')
' done :: read .rea file ', &
221 if (ifchar .AND. (nelgv /= nelgt)) call
exitti( &
222 'ABORT: IFCHAR curr. not supported w/ conj. ht transfer$',nelgv)
233 use size_m
, only : nid, ndim, ldimt, ldimt1, npert
234 use size_m
, only : ldim, ly2, lx2, lz2, lgmres, lfdm, lbx1, lpx1
235 use size_m
, only : lxd, lyd, lzd
236 use size_m
, only : lx1, lx1m, ly1, ly1m, lz1, lz1m
238 use input, only : vnekton, param, npscal, cpfld
239 use input, only : iftmsh, ifadvc, ifflow, ifheat, iftran, ifaxis, iflomach
240 use input, only : ifusermv, ifcons, ifuservp, ifessr, ifmhd, ifvcoup
241 use input, only : ifmgrid, ifpert, ifbase, ifschclob, ifexplvis, ifcyclic
242 use input, only : ifmvbd, ifchar, if3d, ifsplit, ifldmhd
243 use input, only : ifmoab, ifcoup, ifkeps, ifanls, ifmodel, ifstrs, ifaziv
244 use parallel, only : isize, wdsize, csize
246 use zper, only : nelx, nely, nelz, ifzper, ifgfdm
249 character(132) :: tmp_string(100)
250 integer :: nparam, i, npscl1, npscl2, nskip, nlogic, ii, n_o, ktest
257 READ(9,*,err=400) ndim
258 READ(9,*,err=400) nparam
260 READ(9,*,err=400) param(i)
263 call
bcast(ndim ,isize)
264 call
bcast(nparam,isize)
265 call
bcast(param ,200*wdsize)
267 npscal=int(param(23))
271 IF (npscl1 > ldimt)
THEN
273 WRITE(6,21) ldimt,npscl1
274 21
FORMAT(//,2x,
'Error: This NEKTON Solver has been compiled' &
275 /,2x,
' for',i4,
' passive scalars. This run' &
276 /,2x,
' requires that LDIMT be set to',i4,
'.')
289 if(param(2) < 0.0) param(2) = -1.0/param(2)
290 if(param(8) < 0.0) param(8) = -1.0/param(8)
291 if(param(29) < 0.0) param(29) = -1.0/param(29)
303 READ(9,*,err=400) nskip
304 IF (nskip > 0 .AND. npscal > 0)
THEN
305 READ(9,*,err=400)(cpfld(i,1),i=3,npscl2)
306 IF(npscl2 < 9)
READ(9,*)
307 READ(9,*,err=400)(cpfld(i,2),i=3,npscl2)
308 IF(npscl2 < 9)
READ(9,*)
310 if (cpfld(i,1) < 0) cpfld(i,1) = -1./cpfld(i,1)
311 if (cpfld(i,2) < 0) cpfld(i,2) = -1./cpfld(i,2)
319 call
bcast(cpfld,wdsize*ldimt1*3)
360 IF(nid == 0)
READ(9,*,err=500) nlogic
361 call
bcast(nlogic,isize)
362 IF(nlogic > 100)
THEN
364 write(6,*)
'ABORT: Too many logical switches', nlogic
368 if(nid == 0)
READ(9,
'(A132)',err=500) (tmp_string(i),i=1,nlogic)
369 call
bcast(tmp_string,100*132*csize)
372 call
capit(tmp_string(i),132)
373 if (
indx1(tmp_string(i),
'IFTMSH' ,6) > 0)
then
374 read(tmp_string(i),*,err=490) (iftmsh(ii),ii=0,npscl2)
375 elseif (
indx1(tmp_string(i),
'IFNAV' ,5) > 0 .AND. &
376 indx1(tmp_string(i),
'IFADVC' ,6) > 0)
then
377 read(tmp_string(i),*,err=490) (ifadvc(ii),ii=1,npscl2)
378 elseif (
indx1(tmp_string(i),
'IFADVC' ,6) > 0)
then
379 read(tmp_string(i),*,err=490) (ifadvc(ii),ii=1,npscl2)
380 elseif (
indx1(tmp_string(i),
'IFFLOW' ,6) > 0)
then
381 read(tmp_string(i),*) ifflow
382 elseif (
indx1(tmp_string(i),
'IFHEAT' ,6) > 0)
then
383 read(tmp_string(i),*) ifheat
384 elseif (
indx1(tmp_string(i),
'IFTRAN' ,6) > 0)
then
385 read(tmp_string(i),*) iftran
386 elseif (
indx1(tmp_string(i),
'IFAXIS' ,6) > 0)
then
387 read(tmp_string(i),*) ifaxis
388 elseif (
indx1(tmp_string(i),
'IFAZIV' ,6) > 0)
then
389 read(tmp_string(i),*) ifaziv
390 elseif (
indx1(tmp_string(i),
'IFSTRS' ,6) > 0)
then
391 read(tmp_string(i),*) ifstrs
392 elseif (
indx1(tmp_string(i),
'IFLO' ,4) > 0)
then
393 read(tmp_string(i),*) iflomach
394 elseif (
indx1(tmp_string(i),
'IFMGRID',7) > 0)
then
396 elseif (
indx1(tmp_string(i),
'IFKEPS' ,6) > 0)
then
397 read(tmp_string(i),*) ifkeps
398 elseif (
indx1(tmp_string(i),
'IFMODEL',7) > 0)
then
399 read(tmp_string(i),*) ifmodel
400 elseif (
indx1(tmp_string(i),
'IFMVBD' ,6) > 0)
then
401 read(tmp_string(i),*) ifmvbd
402 elseif (
indx1(tmp_string(i),
'IFCHAR' ,6) > 0)
then
403 read(tmp_string(i),*) ifchar
404 elseif (
indx1(tmp_string(i),
'IFANLS' ,6) > 0)
then
405 read(tmp_string(i),*) ifanls
406 elseif (
indx1(tmp_string(i),
'IFMOAB' ,6) > 0)
then
407 read(tmp_string(i),*) ifmoab
408 elseif (
indx1(tmp_string(i),
'IFCOUP' ,6) > 0)
then
409 read(tmp_string(i),*) ifcoup
410 elseif (
indx1(tmp_string(i),
'IFVCOUP' ,7) > 0)
then
411 read(tmp_string(i),*) ifvcoup
412 elseif (
indx1(tmp_string(i),
'IFMHD' ,5) > 0)
then
413 read(tmp_string(i),*) ifmhd
414 elseif (
indx1(tmp_string(i),
'IFCONS' ,6) > 0)
then
415 read(tmp_string(i),*) ifcons
416 elseif (
indx1(tmp_string(i),
'IFUSERVP',8) > 0)
then
417 read(tmp_string(i),*) ifuservp
418 elseif (
indx1(tmp_string(i),
'IFUSERMV',8) > 0)
then
419 read(tmp_string(i),*) ifusermv
420 elseif (
indx1(tmp_string(i),
'IFCYCLIC',8) > 0)
then
421 read(tmp_string(i),*) ifcyclic
422 elseif (
indx1(tmp_string(i),
'IFPERT' ,6) > 0)
then
423 read(tmp_string(i),*) ifpert
424 elseif (
indx1(tmp_string(i),
'IFBASE' ,6) > 0)
then
425 read(tmp_string(i),*) ifbase
426 elseif (
indx1(tmp_string(i),
'IFSYNC' ,6) > 0)
then
427 read(tmp_string(i),*) ifsync
428 elseif (
indx1(tmp_string(i),
'IFEXPLVIS',9) > 0)
then
429 read(tmp_string(i),*) ifexplvis
430 elseif (
indx1(tmp_string(i),
'IFSCHCLOB',9) > 0)
then
431 read(tmp_string(i),*) ifschclob
432 elseif (
indx1(tmp_string(i),
'IFSPLIT' ,7) > 0)
then
436 write(6,
'(1X,2A)')
'ABORT: Unknown logical flag', tmp_string
437 write(6,
'(30(A,/))') &
438 ' Available logical flags:', &
470 if (ifsplit) ifmgrid = .true.
471 if (ifaxis ) ifmgrid = .false.
473 if (param(29) /= 0.) ifmhd = .true.
474 if (ifmhd) ifessr = .true.
475 if (ifmhd) npscl1 = npscl1 + 1
476 if (param(30) > 0) ifuservp = .true.
477 if (param(31) /= 0.) ifpert = .true.
478 if (param(31) < 0.) ifbase = .false.
479 npert = int(abs(param(31)))
481 IF (npscl1 > ldimt .AND. ifmhd)
THEN
483 WRITE(6,22) ldimt,npscl1
484 22
FORMAT(/s,2x,
'Error: This NEKTON Solver has been compiled' &
485 /,2x,
' for',i4,
' passive scalars. A MHD run' &
486 /,2x,
' requires that LDIMT be set to',i4,
'.')
492 if (lx1 /= lx1m .OR. ly1 /= ly1m .OR. lz1 /= lz1m) &
493 call
exitti(
'Need lx1m=lx1 etc. in SIZE . $',lx1m)
498 cpfld(ifldmhd,1) = param(29)
499 cpfld(ifldmhd,2) = param( 1)
504 if ( .NOT. iftran)
then
505 if (ifflow .AND. ifsplit)
then
516 nelx = int(abs(param(116)))
517 nely = int(abs(param(117)))
518 nelz = int(abs(param(118)))
524 if (nelz > 0) ifzper= .true.
525 if (nelx > 0) ifgfdm= .true.
526 if (nelx > 0) ifzper= .false.
535 WRITE(6,10) ldim,ndim
536 10
FORMAT(//,2x,
'ERROR: This NEKTON Solver has been compiled' &
537 /,2x,
' for spatial dimension equal to',i2,
'.' &
538 /,2x,
' The data file has dimension',i2,
'.')
542 IF (ndim == 3) if3d= .true.
543 IF (ndim /= 3) if3d= .false.
546 if (ly1 /= lx1 .OR. lz1 /= lx1)
then
547 if (nid == 0)
write(6,13) lx1,ly1,lz1
548 13
format(
'ERROR: lx1,ly1,lz1:',3i5,
' must be equal for 3D')
551 if (ly2 /= lx2 .OR. lz2 /= lx2)
then
552 if (nid == 0)
write(6,14) lx2,ly2,lz2
553 14
format(
'ERROR: lx2,ly2,lz2:',3i5,
' must be equal for 3D')
557 if (ly1 /= lx1 .OR. lz1 /= 1)
then
558 if (nid == 0)
write(6,12) lx1,ly1,lz1
559 12
format(
'ERROR: ',3i5,
' must have lx1=ly1; lz1=1, for 2D')
562 if (ly2 /= lx2 .OR. lz2 /= 1)
then
563 if (nid == 0)
write(6,11) lx2,ly2,lz2
564 11
format(
'ERROR: ',3i5,
' must have lx2=ly2; lz2=1, for 2D')
569 if (lgmres < 5 .AND. param(42) == 0)
then
570 if(nid == 0)
write(6,*) &
571 'WARNING: lgmres might be too low!'
576 if (nid == 0)
write(6,43) lx1,lx2
577 43
format(
'ERROR: lx1,lx2:',2i4,
' must be equal for IFSPLIT=T')
581 if (lx2 < lx1-2)
then
582 if (nid == 0)
write(6,44) lx1,lx2
583 44
format(
'ERROR: lx1,lx2:',2i4,
' lx2 must be lx-2 for IFSPLIT=F')
588 if (ifmvbd .AND. ifsplit)
then
589 if(nid == 0)
write(6,*) &
590 'ABORT: Moving boundary in Pn-Pn is not supported'
593 if (ifmoab .AND. .NOT. ifsplit)
then
594 if(nid == 0)
write(6,*) &
595 'ABORT: MOAB in Pn-Pn-2 is not supported'
599 ktest = (lx1-lx1m) + (ly1-ly1m) + (lz1-lz1m)
600 if (ifstrs .AND. ktest /= 0)
then
601 if(nid == 0)
write(6,*) &
602 'ABORT: Stress formulation requires lx1m=lx1, etc. in SIZE'
606 if (ifgfdm .AND. ifsplit) call
exitti &
607 (
'ERROR: FDM (p116>0) requires lx2=lx1-2 in SIZE$',lx2)
609 if (ifgfdm .AND. lfdm == 0) call
exitti &
610 (
'ERROR: FDM requires lfdm=1 in SIZE$',lfdm)
612 if (ifsplit .AND. ifstrs)
then
613 if(nid == 0)
write(6,*) &
614 'ABORT: Stress formulation in Pn-Pn is not supported'
618 if (ifsplit .AND. ifmhd)
then
619 if(nid == 0)
write(6,*) &
620 'ABORT: MHD in Pn-Pn is not supported'
624 if (ifmhd .AND. lbx1 /= lx1)
then
625 if(nid == 0)
write(6,*) &
626 'ABORT: For MHD, need lbx1=lx1, etc.; Change SIZE '
630 if (ifpert .AND. lpx1 /= lx1)
then
631 if(nid == 0)
write(6,*) &
632 'ABORT: For Lyapunov, need lpx1=lx1, etc.; Change SIZE '
635 if (if3d) ifaxis = .false.
637 if (iflomach .AND. .NOT. ifsplit)
then
638 if(nid == 0)
write(6,*) &
639 'ABORT: For lowMach, need lx2=lx1, etc.; Change SIZE '
643 if (iflomach .AND. .NOT. ifheat)
then
644 if(nid == 0)
write(6,*) &
645 'ABORT For lowMach, need ifheat=true; Change IFHEAT'
656 if (ifmhd) ifchar = .false.
659 if (param(99) < 0)
then
663 if (ifaxis) param(99) = 3
664 if (ifmvbd) param(99) = 3
667 if (ifchar .AND. param(99) < 0)
then
668 if (nid == 0)
write(6,*) &
669 'ABORT: Characteristic scheme needs dealiasing!'
673 if (param(99) > -1 .AND. (lxd < lx1 .OR. lyd < ly1 .OR. &
675 if(nid == 0)
write(6,*) &
676 'ABORT: Dealiasing space too small; Check lxd,lyd,lzd in SIZE '
699 print *,
"ABORT: ifmoab = .TRUE. in input but this ", &
700 "version of nek not compiled with MOAB."
711 if(nid == 0)
WRITE(6,401)
712 401
FORMAT(2x,
'ERROR READING PARAMETER DATA' &
713 ,/,2x,
'ABORTING IN ROUTINE RDPARAM.')
717 if(nid == 0)
WRITE(6,501)
718 501
FORMAT(2x,
'ERROR READING LOGICAL DATA' &
719 ,/,2x,
'ABORTING IN ROUTINE RDPARAM.')
733 use size_m
, only : ndim, nid, lelt, nelt
734 use input, only : iffmtin, igroup, xc, yc, zc
735 use input, only : curve, ccurve
736 use input, only : bc, cbc
737 use mesh, only : shape_x, start_x, end_x
738 use mesh, only : boundaries, tboundaries
743 integer :: nsides, ieg, iel, lcbc, ldimt1
752 read(9,*) start_x(1), end_x(1), shape_x(1)
753 read(9,*) start_x(2), end_x(2), shape_x(2)
754 read(9,*) start_x(3), end_x(3), shape_x(3)
755 read(9,*) boundaries(1:6)
756 read(9,*) tboundaries(1:6)
759 call
bcast(start_x,3*wdsize)
760 call
bcast(end_x, 3*wdsize)
761 call
bcast(shape_x,3*wdsize)
762 call
bcast(boundaries,3*6)
763 call
bcast(tboundaries,3*6)
765 dx = (end_x - start_x) / shape_x
769 CALL
blank(ccurve,12*lelt)
770 lcbc=18*lelt*(ldimt1 + 1)
778 ix(1) = mod(ieg - 1, shape_x(1))
779 ix(2) = mod((ieg-1)/shape_x(1), shape_x(2))
780 ix(3) = mod((ieg-1)/(shape_x(1)*shape_x(2)), shape_x(3))
782 root = start_x + ix * dx
786 xc(2,iel) = root(1) + dx(1)
787 xc(3,iel) = root(1) + dx(1)
790 xc(6,iel) = root(1) + dx(1)
791 xc(7,iel) = root(1) + dx(1)
796 yc(3,iel) = root(2) + dx(2)
797 yc(4,iel) = root(2) + dx(2)
800 yc(7,iel) = root(2) + dx(2)
801 yc(8,iel) = root(2) + dx(2)
807 zc(5,iel) = root(3) + dx(3)
808 zc(6,iel) = root(3) + dx(3)
809 zc(7,iel) = root(3) + dx(3)
810 zc(8,iel) = root(3) + dx(3)
814 cbc(1,iel,:) = boundaries(1)
815 cbc(1,iel,2) = tboundaries(1)
816 bc(1,1,iel,:) = ieg + (shape_x(2)-1)*shape_x(1)
818 bc(1,1,iel,:) = ieg - shape_x(1)
821 if (ix(2) == shape_x(2) - 1)
then
822 cbc(3,iel,:) = boundaries(3)
823 cbc(3,iel,2) = tboundaries(3)
824 bc(1,3,iel,:) = ieg - ix(2)*shape_x(1)
826 bc(1,3,iel,:) = ieg + shape_x(1)
830 cbc(4,iel,:) = boundaries(4)
831 cbc(4,iel,2) = tboundaries(4)
832 bc(1,4,iel,:) = ieg + (shape_x(1) - 1)
834 bc(1,4,iel,:) = ieg - 1
837 if (ix(1) == shape_x(1) - 1)
then
838 cbc(2,iel,:) = boundaries(2)
839 cbc(2,iel,2) = tboundaries(2)
840 bc(1,2,iel,:) = ieg - ix(1)
842 bc(1,2,iel,:) = ieg +1
846 cbc(5,iel,1) = boundaries(5)
847 cbc(5,iel,2) = tboundaries(5)
848 bc(1,5,iel,:) = ieg + (shape_x(3) - 1)*shape_x(2)*shape_x(1)
850 bc(1,5,iel,:) = ieg - shape_x(2)*shape_x(1)
852 if (ix(3) == shape_x(3) - 1)
then
853 cbc(6,iel,1) = boundaries(6)
854 cbc(6,iel,2) = tboundaries(6)
855 bc(1,6,iel,:) = ieg - ix(3) * shape_x(2)*shape_x(1)
857 bc(1,6,iel,:) = ieg + shape_x(2)*shape_x(1)
880 use size_m
, only : ndim, nid
881 use input, only : iffmtin, igroup, xc, yc, zc
886 integer :: nsides, ieg, iel, ic
893 IF (
gllnid(ieg) == nid)
THEN
897 read(9,30,err=31,end=600) igroup(iel)
904 READ(9,*,err=500,end=600) (xc(ic,iel),ic=1,4)
905 READ(9,*,err=500,end=600) (yc(ic,iel),ic=1,4)
907 ELSE IF(ndim == 3)
THEN
908 READ(9,*,err=500,end=600) (xc(ic,iel),ic=1,4)
909 READ(9,*,err=500,end=600) (yc(ic,iel),ic=1,4)
910 READ(9,*,err=500,end=600) (zc(ic,iel),ic=1,4)
911 READ(9,*,err=500,end=600) (xc(ic,iel),ic=5,8)
912 READ(9,*,err=500,end=600) (yc(ic,iel),ic=5,8)
913 READ(9,*,err=500,end=600) (zc(ic,iel),ic=5,8)
917 READ(9,41,err=500,end=600) adum
920 READ(9,41,err=500,end=600) adum
921 READ(9,41,err=500,end=600) adum
922 ELSE IF(ndim == 3)
THEN
923 READ(9,41,err=500,end=600) adum
924 READ(9,41,err=500,end=600) adum
925 READ(9,41,err=500,end=600) adum
926 READ(9,41,err=500,end=600) adum
927 READ(9,41,err=500,end=600) adum
928 READ(9,41,err=500,end=600) adum
940 if(nid == 0)
WRITE(6,401)
941 401
FORMAT(2x,
'ERROR READING SCALE FACTORS, CHECK READ FILE' &
942 ,/,2x,
'ABORTING IN ROUTINE RDMESH.')
946 if(nid == 0)
WRITE(6,501) ieg
947 501
FORMAT(2x,
'ERROR READING MESH DATA NEAR ELEMENT',i12 &
948 ,/,2x,
'ABORTING IN ROUTINE RDMESH.')
952 if(nid == 0)
WRITE(6,601) ieg
953 601
FORMAT(2x,
'ERROR 2 READING MESH DATA NEAR ELEMENT',i12 &
954 ,/,2x,
'ABORTING IN ROUTINE RDMESH.')
966 use size_m
, only : lelt, nid
967 use input, only : iffmtin, curve, ccurve
972 integer :: ncurve, icurve, iedg, ieg, iel
973 real(DP) :: r1, r2, r3, r4, r5
982 CALL
blank(ccurve,12*lelt)
984 DO 50 icurve=1,ncurve
985 IF (nelgt < 1000)
THEN
986 READ(9,60,err=500,end=500) iedg,ieg,r1,r2,r3,r4,r5,ans
987 ELSEIF (nelgt < 1000000)
THEN
988 READ(9,61,err=500,end=500) iedg,ieg,r1,r2,r3,r4,r5,ans
990 READ(9,62,err=500,end=500) iedg,ieg,r1,r2,r3,r4,r5,ans
992 60
FORMAT(i3,i3 ,5g14.6,1x,a1)
993 61
FORMAT(i2,i6 ,5g14.6,1x,a1)
994 62
FORMAT(i2,i12,5g14.6,1x,a1)
996 IF (
gllnid(ieg) == nid)
THEN
1000 curve(3,iedg,iel)=r3
1001 curve(4,iedg,iel)=r4
1002 curve(5,iedg,iel)=r5
1003 ccurve( iedg,iel)=ans
1012 if(nid == 0)
WRITE(6,501)
1013 501
FORMAT(2x,
'ERROR READING CURVE SIDE DATA' &
1014 ,/,2x,
'ABORTING IN ROUTINE RDCURVE.')
1024 CALL
blank(ccurve,12*lelt)
1025 IF (ncurve > 0)
THEN
1026 DO 1050 icurve=1,ncurve
1027 READ(8,err=1500,end=1500) iedg,ieg,r1,r2,r3,r4,r5,ans
1028 IF (
gllnid(ieg) == nid)
THEN
1030 curve(1,iedg,iel)=r1
1031 curve(2,iedg,iel)=r2
1032 curve(3,iedg,iel)=r3
1033 curve(4,iedg,iel)=r4
1034 curve(5,iedg,iel)=r5
1035 ccurve( iedg,iel)=ans
1044 if(nid == 0)
WRITE(6,1501)
1045 1501
FORMAT(2x,
'ERROR READING unformatted CURVE SIDE DATA' &
1046 ,/,2x,
'ABORTING IN ROUTINE RDCURVE.')
1058 use kinds, only : dp
1059 use size_m
, only : ndim, lelt, ldimt1, nid
1060 use input, only : cbc, bc, vnekton, npscal
1061 use input, only : ifheat, ifmhd, ifflow, iffmtin, iftmsh
1067 CHARACTER(1) :: CBC1, chtemp
1068 character(3) :: CBC3, chtmp3
1069 equivalence(chtemp,chtmp3)
1070 character(132) :: tmp_string
1071 integer :: nfldt, nbcs, ibcs, nsides, lcbc, ibcnew, ifield, nel, nbcrea, ieg
1072 integer :: ii, iside, icbc1, id2, id1, iel, lrbc
1077 IF (ifheat) nfldt=2+npscal
1078 if (ifmhd ) nfldt=2+npscal+1
1081 IF (ifflow) ibcs = 1
1086 lcbc=18*lelt*(ldimt1 + 1)
1087 lrbc=30*lelt*(ldimt1 + 1)
1089 CALL
blank(cbc,lcbc)
1097 READ(9,*,err=500,end=500)
1099 DO 100 ifield=ibcnew,nbcs
1101 if ( .NOT. iftmsh(ifield)) nel = nelgv
1103 read(9,81) tmp_string
1104 call
capit(tmp_string,132)
1114 if (
indx1(tmp_string,
'NO ',3) == 0)
then
1117 IF(vnekton <= 2.52) nbcrea = 3
1118 IF(vnekton >= 2.55) nbcrea = 5
1122 IF (
gllnid(ieg) == nid)
THEN
1124 IF (nelgt < 1000)
THEN
1125 READ(9,50,err=500,end=500) &
1127 cbc(iside,iel,ifield),id1,id2, &
1128 (bc(ii,iside,iel,ifield),ii=1,nbcrea)
1133 50
FORMAT(a1,a3,2i3,5g14.6)
1134 ELSEIF (nelgt < 100000)
THEN
1135 READ(9,51,err=500,end=500) &
1137 cbc(iside,iel,ifield),id1,id2, &
1138 (bc(ii,iside,iel,ifield),ii=1,nbcrea)
1139 51
FORMAT(a1,a3,i5,i1,5g14.6)
1140 ELSEIF (nelgt < 1000000)
THEN
1141 READ(9,52,err=500,end=500) &
1143 cbc(iside,iel,ifield),id1, &
1144 (bc(ii,iside,iel,ifield),ii=1,nbcrea)
1145 52
FORMAT(a1,a3,i6,5g14.6)
1147 READ(9,53,err=500,end=500) &
1149 cbc(iside,iel,ifield),id1, &
1150 (bc(ii,iside,iel,ifield),ii=1,nbcrea)
1151 53
FORMAT(a1,a3,i12,5g18.11)
1154 IF (chtemp /=
' ') cbc(iside,iel,0)(1:1)= chtemp
1156 cbc3=cbc(iside,iel,ifield)
1157 icbc1=ichar(cbc3(1:1))
1165 READ(9,*,err=500,end=500) cbc1
1176 IF (nfldt == 1)
READ(9,*,err=500,end=500)
1183 if(nid == 0)
WRITE(6,501) ifield,ieg
1184 501
FORMAT(2x,
'ERROR READING BOUNDARY CONDITIONS FOR FIELD',i4,i12 &
1185 ,/,2x,
'ABORTING IN ROUTINE RDBDRY.')
1204 IF (
gllnid(ieg) == nid)
THEN
1206 READ(8,err=1500,end=1500) &
1208 cbc(iside,iel,ifield),id1,id2, &
1209 (bc(ii,iside,iel,ifield),ii=1,nbcrea)
1212 IF (chtemp /=
' ') cbc(iside,iel,0)(1:1)= chtemp
1216 READ(8,err=1500,end=1500) chtmp3, &
1217 cbcs(iside,iel),id1,id2,(bcs(ii,iside,iel),ii=1,nbcrea)
1231 if(nid == 0)
WRITE(6,1501) ifield,ieg
1232 1501
FORMAT(2x,
'ERROR READING BOUNDARY CONDITIONS FOR FIELD',i4,i12 &
1233 ,/,2x,
'(unformatted) ABORTING IN ROUTINE RDBDRY.')
1244 use size_m
, only : nid
1245 use input, only : initc
1250 character(132) :: line
1251 integer :: ierr, nskip, i
1252 integer,
external :: iglmax
1258 call
blank(initc,15*132)
1259 read (9,80,err=200,end=200) line
1260 call
capit(line,132)
1261 if (
indx1(line,
'RESTART',7) /= 0)
then
1262 if ( .NOT.
ifgtil(nskip,line)) goto 200
1265 read(9,80,err=200,end=200) initc(i)
1267 read(9,80,err=200,end=200) line
1271 if ( .NOT.
ifgtil(nskip,line)) goto 200
1275 read(9,80,err=200,end=200) line
1279 read(9,*,err=200,end=200)
1280 read(9,*,err=200,end=200) nskip
1282 read(9,80,err=200,end=200) line
1286 ierr = iglmax(ierr,1)
1288 call
bcast(initc,15*132*csize)
1297 ierr = iglmax(ierr,1)
1300 if (nid == 0)
write(6,300)
1301 300
format(2x,
'Error reading initial condition/drive force data' &
1302 ,/,2x,
'aborting in routine rdicdf.')
1303 call
exitti(
'rdicdf error$',ierr)
1313 use kinds, only : dp
1314 use size_m
, only : ldimt1, nid
1315 use input, only : matype, cpgrp, ifvps
1319 CHARACTER(132) :: LINE
1320 integer :: nskip, npacks, iig, igrp, ifld, itype, iprop
1328 READ(9,*,err=200,end=200)
1329 READ(9,*,err=200,end=200) nskip
1330 READ(9,*,err=200,end=200) npacks
1333 READ(9,*)igrp,ifld,itype
1334 matype(igrp,ifld)=itype
1336 IF(itype == 1)
READ(9,* ) cpgrp(igrp,ifld,iprop)
1337 IF(itype == 2)
READ(9,80) line
1343 CALL
bcast(matype,16*ldimt1*isize)
1344 CALL
bcast(cpgrp ,48*ldimt1*wdsize)
1351 if(nid == 0)
WRITE(6,201)
1352 201
FORMAT(2x,
'ERROR READING MATERIAL PROPERTIES DATA' &
1353 ,/,2x,
'ABORTING IN ROUTINE RDMATP.')
1363 use size_m
, only : lhis, nid, nx1, ny1, nz1
1364 use input, only : lochis, hcode, nhis
1365 use parallel, only : nelgt, isize, csize
1368 integer :: ierr, i, ii, i2
1370 CALL
blank(hcode ,11*lhis)
1377 READ (9,*,err=200,end=200) nhis
1378 if (nhis > lhis)
then
1379 write(6,*) nid,
' Too many history pts. RESET LHIS.',nhis,lhis
1387 if (nelgt < 100000)
then
1388 read(9,130,err=200,end=200) &
1389 (hcode(ii,i),ii=1,11),(lochis(i2,i),i2=1,4)
1390 130
format(1x,11a1,1x,4i5)
1392 read(9,131,err=200,end=200) &
1393 (hcode(ii,i),ii=1,11),(lochis(i2,i),i2=1,4)
1394 131
format(1x,11a1,1x,3i5,i10)
1400 if (hcode(10,i) ==
'H')
then
1401 lochis(1,i) = min(lochis(1,i),nx1)
1402 lochis(2,i) = min(lochis(2,i),ny1)
1403 lochis(3,i) = min(lochis(3,i),nz1)
1407 if (lochis(1,i) == -1) lochis(1,i) = (nx1+1)/2
1408 if (lochis(2,i) == -1) lochis(2,i) = (ny1+1)/2
1409 if (lochis(3,i) == -1) lochis(3,i) = (nz1+1)/2
1415 call
err_chk(ierr,
' Too many histroy pts. RESET LHIS$')
1417 call
bcast(nhis ,isize)
1418 call
bcast(hcode ,11*lhis*csize)
1419 call
bcast(lochis,4*lhis*isize)
1426 if(nid == 0)
WRITE(6,201)
1427 201
FORMAT(2x,
'ERROR READING HISTORY DATA' &
1428 ,/,2x,
'ABORTING IN ROUTINE RDHIST.')
1437 use size_m
, only : nid, ldimt1
1438 use input, only : ifpsco, ifxyo, ifvo, ifpo, ifto, ifbo, ipsco
1442 logical :: lbuf(5+ldimt1)
1443 integer :: iflag, nouts, k, i
1444 integer,
external :: iglmax
1446 call
lfalse(lbuf,5+ldimt1)
1451 READ(9,*,err=200,end=200)
1452 READ(9,*,err=200,end=200) nouts
1453 READ(9,*,err=200,end=200) ifxyo
1454 READ(9,*,err=200,end=200) ifvo
1455 READ(9,*,err=200,end=200) ifpo
1456 READ(9,*,err=200,end=200) ifto
1457 READ(9,*,err=200,end=200) ifbo
1467 call
lfalse(ifpsco,ldimt1)
1468 read(9,*,err=200,end=200) ipsco
1470 if (ipsco > ldimt1)
then
1474 read(9,*,err=200,end=200) ifpsco(i)
1484 iflag = iglmax(iflag,1)
1485 if (iflag > 0) call
exitti &
1486 (
'Error in rdout. Increase ldimt1 in SIZE to$',ipsco)
1489 call
bcast(lbuf ,lsize*k)
1490 call
bcast(ipsco,isize )
1511 201
FORMAT(2x,
'ERROR READING OUTPUT SPECIFICATION DATA' &
1512 ,/,2x,
'ABORTING IN ROUTINE RDOUT.')
1516 end subroutine rdout
1521 use size_m
, only : nid, maxobj, maxmbr
1522 use input, only : nobj, nmember, object
1526 integer :: ierr, iobj, member, k
1532 READ(9,*,err=200,end=200)
1533 READ(9,*,err=200,end=200) nobj
1535 IF(nobj > maxobj) ierr=1
1539 READ(9,*,err=200,end=200) nmember(iobj)
1540 IF(nmember(iobj) > maxmbr)
THEN
1541 print*,
'ERROR: Too many members in object ',iobj
1545 DO 5 member=1,nmember(iobj)
1546 READ(9,*,err=200,end=200) object(iobj,member,1), &
1547 object(iobj,member,2)
1551 write(6,*) nobj,
' objects found' &
1552 ,(nmember(k),k=1,nobj)
1555 call
err_chk(ierr,
'ERROR, too many objects:$')
1557 call
bcast(nobj ,isize)
1558 call
bcast(nmember,maxobj*isize)
1559 call
bcast(object ,maxobj*maxmbr*2*isize)
1570 end subroutine rdobj
1579 use kinds, only : dp
1580 use size_m
, only : lx1, ly1, lz1, lelt
1581 use size_m
, only : nx1, ny1, nz1, nelt, ndim, nid
1582 use geom, only : xm1, ym1, zm1
1583 use input, only : ifheat, cbc, if3d
1585 use soln, only : tmult, vmult
1586 use tstep, only : ifield
1589 real(DP),
allocatable :: TA(:,:,:,:),TB(:,:,:,:) &
1594 integer :: ierr, nxyz1, ntot, nfaces, ie, ieg, ix, iy, iz, iface, iel
1595 real(DP) :: eps, xmx, xmn, ymx, ymn, zmx, zmn, xscmax, xscmin
1596 real(DP) :: scal1, scal2, scal3, xscale, yscmax, yscmin, zscale
1597 real(DP) :: yscale, zscmax, zscmin
1598 real(DP),
external :: glmin, glmax
1603 allocate(ta(lx1,ly1,lz1,lelt),tb(lx1,ly1,lz1,lelt) &
1604 ,qmask(lx1,ly1,lz1,lelt))
1606 if(nid == 0)
write(*,*)
'verify mesh topology'
1612 IF (ifheat) ifield = 2
1614 ntot = nx1*ny1*nz1*nelt
1617 xmx = glmax(xm1,ntot)
1618 xmn = glmin(xm1,ntot)
1619 ymx = glmax(ym1,ntot)
1620 ymn = glmin(ym1,ntot)
1621 zmx = glmax(zm1,ntot)
1622 zmn = glmin(zm1,ntot)
1623 if (nid == 0)
write(6,*) xmn,xmx,
' Xrange'
1624 if (nid == 0)
write(6,*) ymn,ymx,
' Yrange'
1625 if (nid == 0)
write(6,*) zmn,zmx,
' Zrange'
1631 CALL
copy(ta,tmult,ntot)
1633 CALL
copy(ta,vmult,ntot)
1651 IF (abs(tb(ix,iy,iz,ie)) > eps )
THEN
1652 WRITE(6,1005) ix,iy,iz,ieg &
1653 ,xm1(ix,iy,iz,ie),ym1(ix,iy,iz,ie),zm1(ix,iy,iz,ie) &
1654 ,ta(ix,iy,iz,ie),eps
1658 1005
FORMAT(2x,
'WARNING: DSSUM problem at:',/ &
1659 ,1x,
'I,J,K,IE:',3i5,i12,/ &
1660 ,2x,
'Near X =',3g16.8,
', d:',2g16.8)
1673 cb =cbc(iface,iel,ifield)
1674 IF (cb ==
'P ' .OR. cb ==
'p ') &
1675 CALL
facev(qmask,iel,iface,0.0,nx1,ny1,nz1)
1678 CALL
dsop(qmask,
'MUL')
1694 CALL
copy(ta,xm1,ntot)
1695 CALL
copy(tb,xm1,ntot)
1698 ta = (ta - xm1) * qmask
1699 tb = (tb - xm1) * qmask
1701 xscmax = maxval(xm1(:,:,:,ie))
1702 xscmin = minval(xm1(:,:,:,ie))
1703 scal1=abs(xscmax-xscmin)
1706 scal1=max(scal1,scal2)
1707 scal1=max(scal1,scal3)
1713 if (abs(ta(ix,iy,iz,ie)*xscale) > eps .OR. &
1714 abs(tb(ix,iy,iz,ie)*xscale) > eps )
then
1715 write(6,1105) ix,iy,iz,ieg &
1716 ,xm1(ix,iy,iz,ie),ym1(ix,iy,iz,ie),zm1(ix,iy,iz,ie) &
1717 ,tb(ix,iy,iz,ie),ta(ix,iy,iz,ie),xscale
1718 1105
format(1x,
'WARNING1 Element mesh mismatch at:',/ &
1719 ,1x,
'i,j,k,ie:',3i5,i12,/ &
1720 ,1x,
'Near X =',3g16.8,
', d:',3g16.8)
1730 CALL
copy(ta,ym1,ntot)
1731 CALL
copy(tb,ym1,ntot)
1734 ta = (ta - ym1) * qmask
1735 tb = (tb - ym1) * qmask
1737 yscmax = maxval(ym1(:,:,:,ie))
1738 yscmin = minval(ym1(:,:,:,ie))
1739 scal1=abs(yscmax-yscmin)
1742 scal1=max(scal1,scal2)
1743 scal1=max(scal1,scal3)
1749 IF (abs(ta(ix,iy,iz,ie)*yscale) > eps .OR. &
1750 abs(tb(ix,iy,iz,ie)*yscale) > eps )
THEN
1751 WRITE(6,1205) ix,iy,iz,ieg &
1752 ,xm1(ix,iy,iz,ie),ym1(ix,iy,iz,ie),zm1(ix,iy,iz,ie) &
1753 ,tb(ix,iy,iz,ie),ta(ix,iy,iz,ie),yscale
1754 1205
FORMAT(1x,
'WARNING2 Element mesh mismatch at:',/ &
1755 ,1x,
'I,J,K,IE:',3i5,i12,/ &
1756 ,1x,
'Near Y =',3g16.8,
', d:',3g16.8)
1767 CALL
copy(ta,zm1,ntot)
1768 CALL
copy(tb,zm1,ntot)
1771 ta = (ta - zm1) * qmask
1772 tb = (tb - zm1) * qmask
1774 zscmax = maxval(zm1(:,:,:,ie))
1775 zscmin = minval(zm1(:,:,:,ie))
1776 scal1=abs(zscmax-zscmin)
1779 scal1=max(scal1,scal2)
1780 scal1=max(scal1,scal3)
1786 IF (abs(ta(ix,iy,iz,ie)*zscale) > eps .OR. &
1787 abs(tb(ix,iy,iz,ie)*zscale) > eps )
THEN
1788 WRITE(6,1305) ix,iy,iz,ieg &
1789 ,xm1(ix,iy,iz,ie),ym1(ix,iy,iz,ie),zm1(ix,iy,iz,ie) &
1790 ,tb(ix,iy,iz,ie),ta(ix,iy,iz,ie),zscale
1791 1305
FORMAT(1x,
'WARNING3 Element mesh mismatch at:',/ &
1792 ,1x,
'I,J,K,IE:',3i5,i12,/ &
1793 ,1x,
'Near Z =',3g16.8,
', d:',3g16.8)
1802 ierr = iglsum(ierr,1)
1804 if(nid == 0)
WRITE(6,1400)
1806 (
' Mesh consistency check failed. EXITING in VRDSMSH.')
1811 CALL
gop(tmp,tmp(2),
'M ',1)
1812 IF (tmp(1) >= 4.0)
THEN
1814 (
' Mesh consistency check failed. EXITING in VRDSMSH.')
1819 write(6,*)
'done :: verify mesh topology'
1828 use size_m
, only : lelt, lelv, lelg, nid, nelt
1832 integer :: neltmx, nelvmx, lelt_needed
1833 integer,
external :: iglmax
1838 neltmx=min(neltmx,lelg)
1839 nelvmx=min(nelvmx,lelg)
1841 nelgt = iglmax(nelgt,1)
1842 nelgv = iglmax(nelgv,1)
1846 if (nelgt > neltmx .OR. nelgv > nelvmx)
then
1848 lelt_needed = nelgt/
np
1849 if (mod(nelgt,
np) /= 0) lelt_needed = lelt_needed + 1
1850 write(6,12) lelt,lelg,lelt_needed,
np,nelgt
1851 12
format(//,2x,
'ABORT: Problem size too large!' &
1853 ,/,2x,
'This solver has been compiled for:' &
1854 ,/,2x,
' number of elements/proc (lelt):',i12 &
1855 ,/,2x,
' total number of elements (lelg):',i12 &
1857 ,/,2x,
'Recompile with the following SIZE parameters:' &
1858 ,/,2x,
' lelt >= ',i12,
' for np = ',i12 &
1859 ,/,2x,
' lelg >= ',i12,/)
1867 if(nelgt > nelgt_max)
then
1868 if(nid == 0)
write(6,*) &
1869 'ABORT: Total number of elements too large!', &
1870 ' nel_max = ', nelgt_max
1875 if (nelt > lelt)
then
1876 write(6,
'(A,3I12)')
'ABORT: nelt>lelt!', nid, nelt, lelt
integer function gllel(ieg)
subroutine dssum(u)
Direct stiffness sum.
subroutine bcast(buf, len)
subroutine rdhist
.Read history data .Broadcast to all processors
subroutine rdbdry
Read Boundary Conditions (and connectivity data). .Disperse boundary condition data to all processors...
subroutine rdmatp
.Read materials property data .Disperse material properties to all processors according to sequential...
integer function indx1(S1, S2, L2)
subroutine rdobj
Read objects, Broadcast to all processors.
real(dp) function dnekclock()
integer function lglel(iel)
subroutine readat()
Read in data from preprocessor input file (.rea)
integer function gllnid(ieg)
subroutine rdcurve
.Read curve side data .Disperse curve side data to all processors according to sequential partition s...
subroutine dsop(u, op)
generalization of dssum to other reducers.
subroutine rdout
Read output specs, broadcast to all processors.
subroutine capit(lettrs, n)
Capitalizes string of length n.
subroutine blank(A, N)
blank a string
subroutine lfalse(IFA, N)
logical function ifgtil(IVALUE, LINE)
Read IVALUE from LINE and set IFGTIL to .TRUE. if successful, IFGTIL to .FALSE. otherwise. This complicated function is necessary thanks to the Ardent, which won't allow free formatted reads (*) from internal strings!
subroutine cscan(sout, key, nk)
subroutine genmesh
Generate local mesh elements.
subroutine gop(x, w, op, n)
Global vector commutative operation.
subroutine rdicdf
Read Initial Conditions / Drive Force. Broadcast ICFILE to all processors.
subroutine err_chk(ierr, istring)
subroutine facev(a, ie, iface, val, nx, ny, nz)
Assign the value VAL to face(IFACE,IE) of array A. IFACE is the input in the pre-processor ordering s...
subroutine vrdsmsh()
Verify that mesh and dssum are properly defined by performing a direct stiffness operation on the X...
subroutine rdmesh
Read number of elements. .Construct sequential element-processor partition according to number of ele...
subroutine exitti(stringi, idata)
subroutine rdparam
Read in parameters supplied by preprocessor and (eventually) echo check. .Broadcast run parameters to...