1 subroutine input() 2c 3c---------------------------------------------------------------------- 4c This routine inputs all the necessary data, allocates required array 5c storage, and sets up the appropriate parameters for the processing. 6c 7c 8c Farzin Shakib, Winter 1987. 9c Zdenek Johan, Winter 1991. (Fortran 90) 10c---------------------------------------------------------------------- 11c 12 include "common.h" 13 include "mpif.h" 14 15 external endata 16 17 integer, allocatable :: nsons(:) 18c 19 character*8 date 20 character*80 card 21 22c assigned in phasta.cc 23c numpe=npe 24c myrank=mrank 25 26 call MPI_BARRIER(MPI_COMM_WORLD, ierr) 27 rsec=TMRC() 28 ttim(100) = rsec 29 30 epsM = sqrt(epsilon(one)) 31c 32c.... read in and block all data 33c 34 call readnblk() 35c 36c.... open the echo file (echo closed at exit) 37c 38 if (myrank == master) 39 & open (unit=iecho, file=fecho, status='unknown', err=996) 40 41c 42c.... --------------------> Control Parameters <--------------------- 43c 44c.... echo the global information 45c 46 47 title = 'Default Ensa Case' 48 call date_and_time (date) 49 title = title(1:69) // ' ' // date(7:8) // '/' // date(5:6) 50 & // '/' // date(3:4) 51 ititle = char(12) // title(1:78) 52 53 if (myrank == master) then 54 write (iecho,1100) ititle, numpe, numnp, numel, numelb, 55 & nen, nfaces, nsd, numflx 56 write (iecho,1200) iALE, icoord, navier, irs, 57 & iexec, necho 58c 59c.... check the input parameters 60c 61 if (iALE .lt. 0 .or. iALE .gt. 1) 62 & call error ('input ','iALE ',iALE) 63c 64 if (icoord .lt. 0 .or. icoord .gt. 1) 65 & call error ('input ','icoord ',icoord) 66c 67 if (navier .lt. 0 .or. navier .gt. 1) 68 & call error ('input ','navier ',navier) 69 70 if (irs .lt. 0 .or. irs .gt. 3) 71 & call error ('input ','irs ',irs) 72c 73 if (iexec .lt. 0 .or. iexec .gt. 1) 74 & call error ('input ','iexec ',iexec) 75c 76 if (necho .lt. 0 .or. necho .gt. 3) 77 & call error ('input ','necho ',necho) 78 endif 79 80 if (myrank == master) then 81 write (iecho,1300) ititle, ntseq, imap, ivart, iDC, 82 & Kspace, nGMRES 83c 84c.... check the input parameters 85c 86 if (ntseq .gt. 100) call error ('input ','ntseq ',ntseq) 87c 88 if (imap .lt. 0 .or. imap .gt. 1) 89 & call error ('input ','imap ',imap) 90c 91 if (ivart .lt. 1 .or. ivart .gt. 3) 92 & call error ('input ','ivart ',ivart) 93c 94 if (iDC .lt. 0 .or. iDC .gt. 4) 95 & call error ('input ','iDC ',iDC) 96c 97 if (Kspace .lt. 1) call error ('input ','Kspace ',Kspace) 98c 99 if (nGMRES .lt. 1) call error ('input ','nGMRES ',nGMRES) 100 endif 101c 102c.... -----------------> Time Sequence Parameters <----------------- 103c 104c.... echo the solver information 105c 106 iprev = 0 107 do i = 1, ntseq 108 if (mod(i,50).eq.1 .and. myrank .eq. master) 109 & write(iecho,1400) ititle 110 111 if (myrank .eq. master) 112 & write (iecho,1500) i, nstep(i), niter(i), impl(i), 113 & LHSupd(i), epstol(i) 114c 115 if ((iALE .eq. 1) .or. (niter(i) .gt. 1)) iprev = 1 116 enddo 117c 118c.... echo the spatial and time integration information 119c 120 do i = 1, ntseq 121 if (mod(i,50).eq.1 .and. myrank .eq. master) 122 & write(iecho,1600) ititle 123 if (myrank .eq. master) 124 & write (iecho,1700) i, intg(1,i), intg(2,i), rhoinf(i), 125 & loctim(i), Delt(i), CFLfl(i), 126 & CFLsl(i) 127c 128 enddo 129c 130 if (myrank .eq. master) 131 & write (iecho,1800) ititle, ntout, ioform, ro, vel, 132 & temper, press, entrop 133 134 if (myrank .eq. master) then 135 write (*,*) 'Element block size = ',ibksiz 136 endif 137 138 if (iLSet .gt. 0 .and. myrank .eq. master)then 139 write(iecho,1900)iLSet, epsilon_ls, dtlset 140 endif 141c 142c.... generate the spatial integration rules 143c 144 call genint 145 146 ichem = 0 147c 148c.... estimate number of nonzero global entries: 149c.... nnonzero ~ nnz * nshg 150c 151 if (ipord .eq. 1) then 152 nnz = 35 153 else if (ipord .eq. 2) then 154 nnz = 85 155 else !assumed cubic 156 nnz = 300 157 endif 158 159 160c 161c.... compute fluid thermodynamic properties 162c 163 Boltzm = Rh / Nh 164c 165 do i = 1, 5 166 Rs(i) = Rh / Msh(i) 167 h0s(i) = h0sh(i) / Msh(i) 168 cpsh(i) = ( pt5 * dofs(i) + one ) * Rh 169 cps(i) = ( pt5 * dofs(i) + one ) * Rs(i) 170 cvs(i) = pt5 * dofs(i) * Rs(i) 171 enddo 172c 173 do i = 1, 5 174 s0sh(i) = Rh * ( pt5*( log( (two*pi*Msh(i)/(Nh*Planck**2))**3 175 & * Boltzm**5 ) + five ) + log(g0s(i)) ) 176 enddo 177c 178 do i = 1, 3 179 s0sh(i) = s0sh(i) + Rh * ( one - log(sigs(i)*Trot(i)) ) 180 enddo 181c 182 Rgas = one / ( xN2 / Rs(1) + xO2 / Rs(2) ) 183 if(myrank.eq.0) write(*,*) 'input.f computes Rgas to be', Rgas 184c Rgas = 0.4*716.5 185c Rgas = 8314/28.95 186 yN2 = xN2 * Rgas / Rs(1) 187 yO2 = xO2 * Rgas / Rs(2) 188c 189 s0 = yN2 * s0sh(1) / Msh(1) + yO2 * s0sh(2) / Msh(2) 190 const = - ( yN2 * Rs(1) * log(xN2) + yO2 * Rs(2) * log(xO2) ) 191c 192c.... stop CPU-timer 193c 194c call timer ('Back ') 195cc 196c..dumping common (useful for checking differences with 197c old format input 198c 199 if(myrank.eq.-1) then 200 mxats=1 201 open (unit=23, file="dumpnew.dat", status='unknown') 202 write (23,*)" master, numpe, myrank" 203 write (23,*) master, numpe, myrank 204 write (23,*)" maxfront, nlwork" 205 write (23,*) maxfront, nlwork 206 write (23,*)" numper, nshgt, nshg0" 207 write (23,*) numper, nshgt, nshg0 208 write (23,*) " birth, death, comtim" 209 write (23,*) birth, death, comtim 210 write (23,*)" pzero, wtavei,dtavei, dke, ierrcalc," 211 write (23,*) pzero, wtavei,dtavei, dke, ierrcalc, 212 & itwmod,taucfct 213 write (23,*)"irscale, intpres,rxinlt, rxrecy," 214 write (23,*)irscale, intpres,rxinlt, rxrecy, 215 & rbltin,rvscal, xlngth, ylngth, zlngth 216 217 write (23,*)" scdiff(5),nsclr,isclr,nsolt" 218 write (23,*) scdiff(5),nsclr,isclr,nsolt 219 write (23,*) " flxID(10,20), Force(3),HFlux, nsrflist(0:20)" 220 write (23,*) flxID(10,20), Force(3),HFlux, nsrflist(0:20) 221 write (23,*) " numnp, numel, numelb, numpbc, nen, nfaces," 222 write (23,*) numnp, numel, numelb, numpbc, nen, nfaces, 223 & numflx, ndof, iALE, icoord, navier, 224 & irs, iexec, necho, ichem, iRK, nedof, 225 & nshg, nnz, istop, nflow, nnz_tot, idtn, 226 & iLSet 227 write (23,*)" epsilon_ls, epsilon_lsd, dtlset" 228 write (23,*) epsilon_ls, epsilon_lsd, dtlset 229 write (23,*)" nshape, nshapeb, maxshb," 230 write (23,*) nshape, nshapeb, maxshb, 231 & nshl, nshlb,nfath, ntopsh, nsonmax 232 write (23,*) " mshp, mshgl, mwght, mshpb, mshglb, mwghtb," 233 write (23,*) mshp, mshgl, mwght, mshpb, mshglb, mwghtb, 234 & mmut, mrhot, mxst 235 write (23,*)" mcsyst, melCat, nenCat(8,3), nfaCat(8,3)" 236 write (23,*) mcsyst, melCat, nenCat(8,3), nfaCat(8,3) 237 238 write (23,*)" lelCat, lcsyst, iorder, nenb, " 239 write (23,*) lelCat, lcsyst, iorder, nenb, 240 & nelblk, nelblb, ndofl, nsymdl, nenl, nfacel, 241 & nenbl, intind, mattyp 242 write (23,*)" E3nsd, I3nsd, nsymdf, ndofBC, ndiBCB, ndBCB," 243 write (23,*) E3nsd, I3nsd, nsymdf, ndofBC, ndiBCB, ndBCB, 244 & Jactyp, jump, ires, iprec, ibound, 245 & idiff, lhs, itau, ipord, ipred, lstres, 246 & iepstm, dtsfct, ibksiz, iabc 247 write (23,*)" epstol(mxats), Delt(mxats)," 248 write (23,*) epstol(mxats), Delt(mxats), nstep(mxats), 249 & impl(mxats), rhoinf(mxats), 250 & LHSupd(mxats), loctim(mxats), deltol(mxats,2) 251 252 write (23,*)" intg(2,mxats), intpt(3), intptb(3)" 253 write (23,*) intg(2,mxats), intpt(3), intptb(3) 254 write (23,*) " indQpt(3,3,4), numQpt(3,3,4)," 255 write (23,*) indQpt(3,3,4), numQpt(3,3,4), 256 & intmax 257 write (23,*)" iin, igeom, ipar, ibndc, imat, iecho," 258 write (23,*) iin, igeom, ipar, ibndc, imat, iecho, 259 & iout, ichmou, irstin, irstou, ihist, iflux, 260 & ierror, itable, iforce, igraph, itime 261 write (23,*)"fwr1,ngaussf,idim,nlist " 262 write (23,*)fwr1,ngaussf,idim,nlist 263 write (23,*) " fin, fgeom, fpar, fbndc, fmat, fecho," 264 write (23,*) fin, fgeom, fpar, fbndc, fmat, fecho, 265 & frstin, frstou, fhist, ferror, ftable, fforce, 266 & fgraph, ftime 267 write (23,*)" fin, fgeom, fpar, fbndc, fmat, fecho," 268 write (23,*) fin, fgeom, fpar, fbndc, fmat, fecho, 269 & frstin, frstou, fhist, ferror, ftable, fforce, 270 & fgraph, ftime 271 write (23,*)" eGMRES, lGMRES, iKs, ntotGM " 272 write (23,*) eGMRES, lGMRES, iKs, ntotGM 273 write (23,*) " mHBrg, meBrg, myBrg, mRcos, mRsin" 274 write (23,*) mHBrg, meBrg, myBrg, mRcos, mRsin 275c 276 write (23,*)" pr, Planck, Stefan, Nh, Rh, Rgas," 277 write (23,*) pr, Planck, Stefan, Nh, Rh, Rgas, 278 & gamma, gamma1, s0, const, xN2, xO2, 279 & yN2, yO2, Msh(5), cpsh(5),s0sh(5),h0sh(5), 280 & Rs(5), cps(5), cvs(5), h0s(5), Trot(5),sigs(5), 281 & Tvib(5),g0s(5), dofs(5),ithm 282 write (23,*) " mexist" 283 write (23,*) mexist 284 write (23,*) " datmat(3,5,mxats), matflg(5,mxats)," 285 write (23,*) datmat(3,5,mxats), matflg(5,mxats), 286 & nummat, mexist 287 write (23,*)"ro, vel, temper, press, entrop, ntout," 288 write (23,*)ro, vel, temper, press, entrop, ntout, 289 & ioform 290 write (23,*)"mbeg, mend, mprec " 291 write (23,*)mbeg, mend, mprec 292 write (23,*)"epsM, iabres, npro,resfrt" 293 write (23,*)epsM, iabres, npro,resfrt 294 write (23,*)" imap, ivart, iDC, iPcond, Kspace, nGMRES" 295 write (23,*) imap, ivart, iDC, iPcond, Kspace, nGMRES 296 297 write (23,*)" indsym(5,5) " 298 write (23,*) indsym(5,5) 299 write (23,*) " time, CFLfld, CFLsld, Dtgl, Dtmax, alpha," 300 write (23,*) time, CFLfld, CFLsld, Dtgl, Dtmax, alpha, 301 & etol, lstep, ifunc, itseq, istep, iter, 302 & nitr, almi, alfi, gami, flmpl, flmpr, 303 & dtol(2) 304 write (23,*) "LCtime, ntseq" 305 write (23,*) LCtime, ntseq 306 write (23,*) " numeqns(100), minIters, maxIters," 307 write (23,*) numeqns(100), minIters, maxIters, 308 & iprjFlag, nPrjs, ipresPrjFlag, nPresPrjs, 309 & prestol, statsflow(6), statssclr(6), 310 & iverbose 311 write (23,*) " ccode" 312 write (23,*) ccode 313 write (23,*) " flops, gbytes, sbytes, iclock, icd, icode," 314 write (23,*) flops, gbytes, sbytes, iclock, icd, icode, 315 & icode2, icode3 316 write (23,*) " cpu(11), cpu0(11), nacess(11)" 317 write (23,*) cpu(11), cpu0(11), nacess(11) 318 write (23,*) " title, ititle" 319 write (23,*) title, ititle 320 close (23) 321 endif 322c 323c....return 324c 325 return 326c 327c.... end of file error handling 328c 329992 call error ('input ','opening ', imat) 330993 call error ('input ','opening ', iin) 331996 call error ('input ','opening ', iecho) 332999 call error ('input ','end file', iin) 333c 3341000 format(a69) 3351100 format(a80,//, 336 & ' M a i n C o n t r o l P a r a m e t e r s ' //, 337 & ' number of processing elements . . . . . . . (numpe )=',i10//, 338 & ' number of mesh nodes . . . . . . . . . . . (numnp )=',i10//, 339 & ' number of elements . . . . . . . . . . . . (numel )=',i10//, 340 & ' number of boundary elements . . . . . . . . (numelb)=',i10//, 341 & ' number of element nodes . . . . . . . . . . (nen )=',i10//, 342 & ' number of element faces . . . . . . . . . . (nfaces)=',i10//, 343 & ' number of space dimensions . . . . . . . . (nsd )=',i10//, 344 & ' number of boundary flux nodes . . . . . . . (numflx)=',i10/) 3451200 format( 346 & ' frame of reference . . . . . . . . . . . . (iALE )=',i10//, 347 & ' eq. 0, Eulerian ', / , 348 & ' eq. 1, arbitrary Lagrangian-Eulerian ', //, 349 & ' coordinate system . . . . . . . . . . . . . (icoord)=',i10//, 350 & ' eq. 0, cartesian ', / , 351 & ' eq. 1, axisymmetric ', //, 352 & ' equation type . . . . . . . . . . . . . . . (navier)=',i10//, 353 & ' eq. 0, Euler (inviscid) ', / , 354 & ' eq. 1, Navier-Stokes (viscous) ', //, 355 & ' restart option . . . . . . . . . . . . . . (irs )=',i10//, 356 & ' eq. 0, no restart nor solution written ', / , 357 & ' eq. 1, restart written ', / , 358 & ' eq. 2, restart and solution written ', //, 359 & ' execution code . . . . . . . . . . . . . . (iexec )=',i10//, 360 & ' eq. 0, data check only ', / , 361 & ' eq. 1, execution ', //, 362 & ' input echo parameter . . . . . . . . . . . (necho )=',i10) 3631300 format(a80,//, 364 & ' S o l u t i o n P a r a m e t e r s ' //, 365 & ' number of time sequences . . . . . . . . . (ntseq )=',i10//, 366 & ' blocking algorithm . . . . . . . . . . . . (imap )=',i10//, 367 & ' eq. 0, ordered blocking ', / , 368 & ' eq. 1, disjoint element blocking ', //, 369 & ' variational formulation . . . . . . . . . . (ivart )=',i10//, 370 & ' eq. 1, Galerkin ', / , 371 & ' eq. 2, Galerkin/least-squares ', / , 372 & ' eq. 3, plus discontinuity-capturing operator ', //, 373 & ' discontinuity-capturing type . . . . . . . (iDC )=',i10//, 374 & ' eq. 1, DC-mallet ', / , 375 & ' eq. 2, quadratic DC ', / , 376 & ' eq. 3, smallest of the previous two DCs ', //, 377 & ' dimension of Krylov space . . . . . . . . . (kspace)=',i10//, 378 & ' maximum number of GMRES cycles . . . . . . (ngmres)=',i10) 3791400 format(a80,//, 380 & ' S o l v e r I n f o r m a t i o n ',//, 381 & ' Seq num Nstep Niter Impl Nupdate', 382 & ' Eps_Tol') 3831500 format(i6,i10,i9,i8,i11,2x,e15.5) 3841600 format(a80,//, 385 & ' S p a t i a l a n d T i m e I n t e g r a t i o n',//, 386 & ' Seq num Elem Int. Bound Int. Level LCtime', 387 & ' Delt CFLfld CFLsld') 3881700 format(i6,i8,i12,e13.4,1p,i8,1p,e13.4,0p,2f10.4) 3891800 format(a80,//, 390 & ' O u t p u t I n f o r m a t i o n ',1p,//, 391 & ' number of time steps per output . . . . . . (ntout )=',i10//, 392 & ' I/O format . . . . . . . . . . . . . . . . (ioform)=',i10//, 393 & ' eq. 0, ASCII ', / , 394 & ' eq. 1, binary ', //, 395 &' scaling factor for density . . . . . . . . (ro )=',e15.5//, 396 &' scaling factor for velocity . . . . . . . . (vel )=',e15.5//, 397 &' scaling factor for temperature. . . . . . . (temper)=',e15.5//, 398 &' scaling factor for pressure . . . . . . . . (press )=',e15.5//, 399 &' scaling factor for entropy . . . . . . . . (entrop)=',e15.5) 400c 401 4021900 format(//, 403 & ' L e v e l S e t P a r a m e t e r s ' //, 404 & ' Level Set Switch . . . . . . . . . . (iLSet )=',i10//, 405 & ' eq. 0, No Level Set Solution Calculated ', / , 406 & ' eq. 1, Level Set Calculated, 2 Fluid Props Read ', / , 407 & ' eq. 2, Level Set and Redistancing Calcuations ', //, 408 & ' Property Smearing Band Width . . . . . .(epsilon_ls)=',e15.5) 409 410 411 412 end 413