ADflow  v1.0
ADflow is a finite volume RANS solver tailored for gradient-based aerodynamic design optimization.
inputParamRoutines.F90
Go to the documentation of this file.
2 
3  use constants, only: maxstringlen, inttype
4 
5  ! Set the parameter none, which is used as a check to see
6  ! whether or not some key parameters were specified.
7 
8  integer(kind=intType), parameter :: none = 0
9 
10  ! monDturb: Whether or not the turbulent residuals
11  ! must be monitored. This must be done via
12  ! this construction, because during the
13  ! reading of the monitoring variables the
14  ! turbulence model might not be known.
15  ! monitorSpecified: Whether or not the monitoring variables
16  ! were specified.
17  ! surfaceOutSpecified: Whether or not the surface output
18  ! variables were specified.
19  ! volumeOutSpecified: Whether or not the volume output
20  ! variables were specified.
21  ! isoOutSpecified: Wheter or not the isosurface output
22  ! variables were specified
23  logical :: mondturb
24  logical :: monitorspecified
26  logical :: volumeoutspecified
27  logical :: isooutspecified
28 
29  ! liftDirSpecified: Whether or not the lift direction was
30  ! specified.
31 
32  logical :: liftdirspecified
33 
34 contains
35 
36  subroutine checkmonitor
37  !
38  ! checkMonitor checks and possibly corrects the variables
39  ! to be monitored during the convergence. This depends on the
40  ! governing equations to be solved. After the correction the
41  ! sequence of the monitoring variable names is changed, such
42  ! that the output is independent of the specified sequence.
43  ! Furthermore memory is allocated for the arrays used to compute
44  ! the monitoring variables and it is checked whether or not the
45  ! maximum Mach number of total enthalpy difference is to be
46  ! monitored.
47  !
48  use constants
49  use cgnsnames
50  use monitor, only: monnames, monglob, monloc, nmonmax, nmonsum, &
55  use utils, only: terminate
56  implicit none
57  !
58  ! Local variables.
59  !
60  integer :: ierr
61 
62  integer(kind=intType) :: i, ii, nn
63  integer(kind=intType), dimension(:), allocatable :: sortNumber
64  integer(kind=intType), dimension(:), allocatable :: tmpNumber
65 
66  character(len=maxCGNSNameLen), dimension(:), allocatable :: &
67  tmpNames
68  logical :: RKExplicit
69 
70  ! Find out if an explicit RK scheme is used in unsteady mode and
71  ! set the logical RKExplicit accordingly. For explicit RK schemes
72  ! no residuals are monitored.
73 
74  rkexplicit = .false.
75  if (equationmode == unsteady .and. &
76  timeintegrationscheme == explicitrk) rkexplicit = .true.
77 
78  ! If the turbulent residuals must be monitored add them to the
79  ! list of monitoring names. Enough memory should have been
80  ! allocated for this.
81 
82  if (mondturb .and. equations == ransequations .and. &
83  (.not. rkexplicit)) then
84 
85  select case (turbmodel)
86 
87  ! One equation models of the spalart-allmaras family.
88 
90  nmon = nmon + 1; nmonsum = nmonsum + 1
92 
93  ! Two equation models of the k-w family.
94 
96  nmon = nmon + 2; nmonsum = nmonsum + 2
97  monnames(nmon - 1) = cgnsl2resk
99 
100  ! Two equation k-tau model.
101 
102  case (ktau)
103  nmon = nmon + 2; nmonsum = nmonsum + 2
104  monnames(nmon - 1) = cgnsl2resk
106 
107  ! V2f model.
108 
109  case (v2f)
110  nmon = nmon + 4; nmonsum = nmonsum + 4
111  monnames(nmon - 3) = cgnsl2resk
113  monnames(nmon - 1) = cgnsl2resv2
115 
116  end select
117  end if
118 
119  ! Allocate the memory for sortNumber tmpNumber and tmpNames.
120 
121  allocate (sortnumber(nmon), tmpnumber(nmon), tmpnames(nmon), &
122  stat=ierr)
123  if (ierr /= 0) &
124  call terminate("checkMonitor", &
125  "Memory allocation failure for sortNumber, etc.")
126 
127  ! Loop over the monitoring variables, copy the name into tmpName
128  ! and set a number to determine its place in the sequence. If the
129  ! variable cannot be monitored for the governing equations, the
130  ! priority is set to a high number, such that it will be at the
131  ! end of the sorted numbers. At the same time the number of
132  ! variables to be monitored, nMonSum, nMonMax and nMon, is
133  ! corrected.
134 
135  nn = nmon
136  do i = 1, nn
137 
138  tmpnames(i) = monnames(i)
139 
140  ! Determine the place in the sequence for this string.
141 
142  select case (monnames(i))
143  case (cgnsl2resrho)
144  sortnumber(i) = 1
145  if (rkexplicit) then
146  sortnumber(i) = 10001
147  nmonsum = nmonsum - 1
148  end if
149 
150  case (cgnsl2resmomx)
151  sortnumber(i) = 2
152  if (rkexplicit) then
153  sortnumber(i) = 10002
154  nmonsum = nmonsum - 1
155  end if
156 
157  case (cgnsl2resmomy)
158  sortnumber(i) = 3
159  if (rkexplicit) then
160  sortnumber(i) = 10003
161  nmonsum = nmonsum - 1
162  end if
163 
164  case (cgnsl2resmomz)
165  sortnumber(i) = 4
166  if (rkexplicit) then
167  sortnumber(i) = 10004
168  nmonsum = nmonsum - 1
169  end if
170 
171  case (cgnsl2resrhoe)
172  sortnumber(i) = 5
173  if (rkexplicit) then
174  sortnumber(i) = 10005
175  nmonsum = nmonsum - 1
176  end if
177 
178  case (cgnsl2resnu)
179  sortnumber(i) = 6
180  if (equations /= ransequations) then
181  sortnumber(i) = 10001
182  nmonsum = nmonsum - 1
183  end if
184 
185  case (cgnsl2resk)
186  sortnumber(i) = 7
187  if (equations /= ransequations) then
188  sortnumber(i) = 10002
189  nmonsum = nmonsum - 1
190  end if
191 
192  case (cgnsl2resomega)
193  sortnumber(i) = 8
194  if (equations /= ransequations) then
195  sortnumber(i) = 10003
196  nmonsum = nmonsum - 1
197  end if
198 
199  case (cgnsl2restau)
200  sortnumber(i) = 9
201  if (equations /= ransequations) then
202  sortnumber(i) = 10004
203  nmonsum = nmonsum - 1
204  end if
205 
206  case (cgnsl2resepsilon)
207  sortnumber(i) = 10
208  if (equations /= ransequations) then
209  sortnumber(i) = 10005
210  nmonsum = nmonsum - 1
211  end if
212 
213  case (cgnsl2resv2)
214  sortnumber(i) = 11
215  if (equations /= ransequations) then
216  sortnumber(i) = 10006
217  nmonsum = nmonsum - 1
218  end if
219 
220  case (cgnsl2resf)
221  sortnumber(i) = 12
222  if (equations /= ransequations) then
223  sortnumber(i) = 10007
224  nmonsum = nmonsum - 1
225  end if
226 
227  case (cgnscl)
228  sortnumber(i) = 101
229  if (flowtype == internalflow) then
230  sortnumber(i) = 11001
231  nmonsum = nmonsum - 1
232  end if
233 
234  case (cgnsclp)
235  sortnumber(i) = 102
236  if (flowtype == internalflow) then
237  sortnumber(i) = 11002
238  nmonsum = nmonsum - 1
239  end if
240 
241  case (cgnsclv)
242  sortnumber(i) = 103
243  if (equations == eulerequations .or. &
244  flowtype == internalflow) then
245  sortnumber(i) = 11003
246  nmonsum = nmonsum - 1
247  end if
248 
249  case (cgnscd)
250  sortnumber(i) = 104
251  if (flowtype == internalflow) then
252  sortnumber(i) = 11004
253  nmonsum = nmonsum - 1
254  end if
255 
256  case (cgnscdp)
257  sortnumber(i) = 105
258  if (flowtype == internalflow) then
259  sortnumber(i) = 11005
260  nmonsum = nmonsum - 1
261  end if
262 
263  case (cgnscdv)
264  sortnumber(i) = 106
265  if (equations == eulerequations .or. &
266  flowtype == internalflow) then
267  sortnumber(i) = 11006
268  nmonsum = nmonsum - 1
269  end if
270 
271  case (cgnscfx)
272  sortnumber(i) = 107
273 
274  case (cgnscfy)
275  sortnumber(i) = 108
276 
277  case (cgnscfz)
278  sortnumber(i) = 109
279 
280  case (cgnscmx)
281  sortnumber(i) = 110
282 
283  case (cgnscmy)
284  sortnumber(i) = 111
285 
286  case (cgnscmz)
287  sortnumber(i) = 112
288 
289  case ('totalR')
290  sortnumber(i) = 113
291 
292  case (cgnssepsensor)
293  sortnumber(i) = 114
294 
295  case (cgnscavitation)
296  sortnumber(i) = 115
297 
298  case (cgnsaxismoment)
299  sortnumber(i) = 116
300 
301  case (cgnssepsensorksarea)
302  sortnumber(i) = 117
303 
304  case (cgnshdiffmax)
305  sortnumber(i) = 201
306 
307  case (cgnsmachmax)
308  sortnumber(i) = 202
309 
310  case (cgnsyplusmax)
311  sortnumber(i) = 203
312  if (equations /= ransequations) then
313  sortnumber(i) = 12003
314  nmonmax = nmonmax - 1
315  end if
316 
317  case (cgnseddymax)
318  sortnumber(i) = 204
319  if (equations /= ransequations) then
320  sortnumber(i) = 12004
321  nmonmax = nmonmax - 1
322  end if
323 
324  case default
325  call terminate("checkMonitor", "This should not happen")
326  end select
327 
328  end do
329 
330  ! Set the new value of nMon, because this might have changed
331  ! due to the corrections.
332 
333  nmon = nmonsum + nmonmax
334 
335  ! Copy sortNumber in tmpNumber and sort it in increasing order.
336  ! Note that here nn must be used and not nMon.
337 
338  do i = 1, nn
339  tmpnumber(i) = sortnumber(i)
340  end do
341 
342  call qsortintegers(sortnumber, nn)
343 
344  ! Loop over the the number of monitoring variables and store the
345  ! new sequence in monNames.
346 
347  do i = 1, nn
348  ii = bsearchintegers(tmpnumber(i), sortnumber)
349  monnames(ii) = tmpnames(i)
350  end do
351 
352  ! Release the memory of sortNumber, tmpNumber and tmpNames.
353 
354  deallocate (sortnumber, tmpnumber, tmpnames, stat=ierr)
355  if (ierr /= 0) &
356  call terminate("checkMonitor", &
357  "Deallocation error for sortNumber, etc.")
358 
359  ! Allocate the memory for the monitoring variables.
360 
361  allocate (monloc(nmon), monglob(nmon), monref(nmon), stat=ierr)
362  if (ierr /= 0) &
363  call terminate("checkMonitor", &
364  "Memory allocation for monitoring variables")
365 
366  ! Check if the maximum Mach number or the maximum total enthalpy
367  ! difference must be monitored.
368 
369  monmachorhmax = .false.
370  do i = (nmonsum + 1), nmon
371  if (monnames(i) == cgnshdiffmax .or. &
372  monnames(i) == cgnsmachmax) monmachorhmax = .true.
373  end do
374 
375  end subroutine checkmonitor
376  subroutine checkoutput
377  !
378  ! checkOutput checks and possibly corrects the and output
379  ! variables. This depends on the set of governing equations to
380  ! be solved.
381  !
382  use constants
383  use extraoutput
387  implicit none
388 
389  ! Determine the governing equations to be solved and set the
390  ! variables accordingly.
391 
392  select case (equations)
393  case (eulerequations)
394  surfwritecf = .false.
395  surfwritech = .false.
396  surfwriteyplus = .false.
397  surfwritecfx = .false.
398  surfwritecfy = .false.
399  surfwritecfz = .false.
400  surfwriteforceindragdir = .false.
401  surfwriteforceinliftdir = .false.
402 
403  volwritemachturb = .false.
404  volwriteeddyvis = .false.
405  volwriteratioeddyvis = .false.
406  volwritedist = .false.
407  volwriteresturb = .false.
408 
409  case (nsequations)
410  surfwriteyplus = .false.
411 
412  volwritemachturb = .false.
413  volwriteeddyvis = .false.
414  volwriteratioeddyvis = .false.
415  volwritedist = .false.
416  volwriteresturb = .false.
417 
418  case (ransequations)
419 
420  ! Check if it is possible to write a turbulent Mach
421  ! number and eddy viscosity; this depends on the turbulence
422  ! model used.
423 
424  if (.not. kpresent) volwritemachturb = .false.
425  if (.not. eddymodel) then
426  volwriteeddyvis = .false.
427  volwriteratioeddyvis = .false.
428  end if
429 
430  ! If a wall distance free turbulence model is used,
431  ! set volWriteDist to .false.
432 
433  if (.not. walldistanceneeded) volwritedist = .false.
434 
435  end select
436 
437  if (equationmode == unsteady .and. &
439  volwriteresrho = .false.
440  volwriteresmom = .false.
441  volwriteresrhoe = .false.
442  volwriteresturb = .false.
443  end if
444 
445  end subroutine checkoutput
446  subroutine defaultisoout
447  !
448  ! defaultIsoOut sets the default set of additional
449  ! variables to be written to the solution file; the primitive
450  ! variables are always written. This additional set depends on
451  ! the governing equations to be solved.
452  !
453  use constants
454  use extraoutput
455  use inputphysics, only: equations
456  implicit none
457 
458  ! First set the variables, which are independent from the
459  ! governing equations to be solved.
460  isowriterho = .false.
461  isowritevx = .false.
462  isowritevy = .false.
463  isowritevz = .false.
464  isowritep = .false.
465  isowritemx = .false.
466  isowritemy = .false.
467  isowritemz = .false.
468  isowriterhoe = .false.
469  isowritetemp = .false.
470  isowritecp = .false.
471  isowritemach = .false.
472  isowritemachturb = .false.
473  isowritedist = .false.
474  isowritevort = .false.
475  isowritevortx = .false.
476  isowritevorty = .false.
477  isowritevortz = .false.
478  isowriteptotloss = .false.
479  isowriteresrho = .false.
480  isowriteresmom = .false.
481  isowriteresrhoe = .false.
482  isowriteshock = .false.
483  isowritefilteredshock = .false.
484  ! Set the values which depend on the equations to be solved.
485 
486  select case (equations)
487  case (eulerequations)
488  isowriteeddyvis = .false.
489  isowriteratioeddyvis = .false.
490  isowriteresturb = .false.
491 
492  case (nsequations)
493  isowriteeddyvis = .false.
494  isowriteratioeddyvis = .false.
495  isowriteresturb = .false.
496 
497  case (ransequations)
498  isowriteeddyvis = .false.
499  isowriteratioeddyvis = .false.
500  isowriteresturb = .false.
501  end select
502 
503  end subroutine defaultisoout
504  subroutine defaultmonitor
505  !
506  ! defaultMonitor sets the default set of variables to be
507  ! monitored during the convergence. This set depends on the
508  ! governing equations to be solved.
509  !
510  use constants
511  use cgnsnames
512  use inputphysics, only: equations, flowtype
513  use monitor, only: nmonsum, nmonmax, nmon, monnames, showcpu
514  use utils, only: terminate
515  implicit none
516  !
517  ! Local variables.
518  !
519  integer :: ierr
520 
521  ! CPU time is written to stdout.
522 
523  showcpu = .true.
524 
525  ! Determine the governing equations to be solved.
526 
527  select case (equations)
528  case (eulerequations)
529 
530  ! Set the number of summation and maximum monitor variables
531  ! and allocate the memory for the monitoring names.
532  ! A distinction is made between internal and external flows,
533  ! because cl and cd do not make a lot of sense for the former.
534 
535  if (flowtype == internalflow) then
536 
537  ! Internal flow; only the density residual is monitored.
538 
539  nmonsum = 1; nmonmax = 0; nmon = 1
540  allocate (monnames(nmon), stat=ierr)
541  if (ierr /= 0) &
542  call terminate("defaultMonitor", &
543  "Memory allocation failure for monNames")
544 
545  ! Set the names for the variables to be monitored.
546 
548 
549  else
550 
551  ! External; also lift and drag is monitored.
552 
553  nmonsum = 3; nmonmax = 0; nmon = 3
554  allocate (monnames(nmon), stat=ierr)
555  if (ierr /= 0) &
556  call terminate("defaultMonitor", &
557  "Memory allocation failure for monNames")
558 
559  ! Set the names for the variables to be monitored.
560 
562  monnames(2) = cgnscl
563  monnames(3) = cgnscd
564 
565  end if
566 
567  case (nsequations)
568 
569  ! Set the number of summation and maximum monitor variables
570  ! and allocate the memory for the monitoring names.
571  ! A distinction is made between internal and external flows,
572  ! because cl and cd do not make a lot of sense for the former.
573 
574  if (flowtype == internalflow) then
575 
576  ! Internal flow; only the density residual is monitored.
577 
578  nmonsum = 1; nmonmax = 0; nmon = 1
579  allocate (monnames(nmon), stat=ierr)
580  if (ierr /= 0) &
581  call terminate("defaultMonitor", &
582  "Memory allocation failure for monNames")
583 
584  ! Set the names for the variables to be monitored.
585 
587 
588  else
589 
590  ! External; also lift and drag (total and viscous)
591  ! is monitored.
592 
593  nmonsum = 4; nmonmax = 0; nmon = 4
594  allocate (monnames(nmon), stat=ierr)
595  if (ierr /= 0) &
596  call terminate("defaultMonitor", &
597  "Memory allocation failure for monNames")
598 
599  ! Set the names for the variables to be monitored.
600 
602  monnames(2) = cgnscl
603  monnames(3) = cgnscd
604  monnames(4) = cgnscdv
605 
606  end if
607 
608  case (ransequations)
609 
610  ! Set the number of summation and maximum monitor variables
611  ! and allocate the memory for the monitoring names.
612  ! A distinction is made between internal and external flows,
613  ! because cl and cd do not make a lot of sense for the former.
614 
615  if (flowtype == internalflow) then
616 
617  ! Internal flow; the density residual as well as the
618  ! maximum values of yplus and the eddy viscosity ration
619  ! are monitored.
620 
621  nmonsum = 1; nmonmax = 2; nmon = 3
622  allocate (monnames(nmon), stat=ierr)
623  if (ierr /= 0) &
624  call terminate("defaultMonitor", &
625  "Memory allocation failure for monNames")
626 
627  ! Set the names for the variables to be monitored.
628 
631  monnames(3) = cgnseddymax
632 
633  else
634 
635  ! External; also lift and drag (total and viscous)
636  ! is monitored.
637 
638  nmonsum = 4; nmonmax = 2; nmon = 6
639  allocate (monnames(nmon), stat=ierr)
640  if (ierr /= 0) &
641  call terminate("defaultMonitor", &
642  "Memory allocation failure for monNames")
643 
644  ! Set the names for the variables to be monitored.
645 
647  monnames(2) = cgnscl
648  monnames(3) = cgnscd
649  monnames(4) = cgnscdv
651  monnames(6) = cgnseddymax
652 
653  end if
654 
655  end select
656 
657  end subroutine defaultmonitor
658  subroutine defaultsurfaceout
659  !
660  ! defaultSurfaceOut sets the default set of surface variables
661  ! to be written to the solution file. This set depends on the
662  ! governing equations to be solved.
663  !
664  use constants
665  use extraoutput
666  use inputphysics, only: equations
667  implicit none
668 
669  ! First set the variables, which are independent from the
670  ! governing equations to be solved.
671 
672  surfwriterho = .true.
673  surfwritep = .false.
674  surfwritetemp = .false.
675  surfwritevx = .true.
676  surfwritevy = .true.
677  surfwritevz = .true.
678  surfwritecp = .true.
679  surfwritemach = .true.
680 
681  ! Set the values which depend on the equations to be solved.
682 
683  select case (equations)
684  case (eulerequations)
685  surfwriteptotloss = .true.
686  surfwritecf = .false.
687  surfwritech = .false.
688  surfwriteyplus = .false.
689  surfwritecfx = .false.
690  surfwritecfy = .false.
691  surfwritecfz = .false.
692 
693  case (nsequations)
694  surfwriteptotloss = .false.
695  surfwritecf = .true.
696  surfwritech = .false.
697  surfwriteyplus = .false.
698  surfwritecfx = .true.
699  surfwritecfy = .true.
700  surfwritecfz = .true.
701 
702  case (ransequations)
703  surfwriteptotloss = .false.
704  surfwritecf = .true.
705  surfwritech = .false.
706  surfwriteyplus = .true.
707  surfwritecfx = .true.
708  surfwritecfy = .true.
709  surfwritecfz = .true.
710  end select
711 
712  end subroutine defaultsurfaceout
713  subroutine defaultvolumeout
714  !
715  ! defaultVolumeOut sets the default set of additional
716  ! variables to be written to the solution file; the primitive
717  ! variables are always written. This additional set depends on
718  ! the governing equations to be solved.
719  !
720  use constants
721  use extraoutput
722  use inputphysics, only: equations
723  implicit none
724 
725  ! First set the variables, which are independent from the
726  ! governing equations to be solved.
727 
728  volwritemx = .false.
729  volwritemy = .false.
730  volwritemz = .false.
731  volwriterhoe = .false.
732  volwritetemp = .false.
733  volwritecp = .false.
734  volwritemach = .false.
735  volwritemachturb = .false.
736  volwritedist = .false.
737  volwritevort = .false.
738  volwritevortx = .false.
739  volwritevorty = .false.
740  volwritevortz = .false.
741  volwriteptotloss = .true.
742  volwriteresrho = .true.
743  volwriteresmom = .false.
744  volwriteresrhoe = .false.
745 
746  ! Set the values which depend on the equations to be solved.
747 
748  select case (equations)
749  case (eulerequations)
750  volwriteeddyvis = .false.
751  volwriteratioeddyvis = .false.
752  volwriteresturb = .false.
753 
754  case (nsequations)
755  volwriteeddyvis = .false.
756  volwriteratioeddyvis = .false.
757  volwriteresturb = .false.
758 
759  case (ransequations)
760  volwriteeddyvis = .true.
761  volwriteratioeddyvis = .true.
762  volwriteresturb = .true.
763  end select
764 
765  end subroutine defaultvolumeout
766 
768  !
769  ! This subroutine is the same as readParamFile EXCEPT it does not
770  ! read the actual file. Values are set diectly from python for
771  ! all the options and then this file is run.
772  !
773  use constants
774  use inputphysics, only: cpmodel
775 
776  implicit none
777  !
778  ! Local variables
779  !
780  integer, parameter :: readUnit = 32
781 
782  ! Check if all the desired input parameters were specified and
783  ! print warnings if some irrelevant ones are specified.
784 
785  call checkinputparam
786 
787  ! Read the cp curve fits from file if a variable cp model
788  ! must be used.
789 
791 
792  ! Determine the number of governing equations and set the
793  ! corresponding parameters accordingly.
794 
796 
797  ! Extract the multigrid info from the string.
798 
799  call extractmginfo
800 
801  ! If no monitoring variables were specified, set the default set.
802  ! Idem for the surface and volume output variables.
803 
804  if (.not. monitorspecified) call defaultmonitor
805  if (.not. surfaceoutspecified) call defaultsurfaceout
806  if (.not. volumeoutspecified) call defaultvolumeout
807  if (.not. isooutspecified) call defaultisoout
808 
809  ! Check the monitoring and output variables.
810 
811  call checkmonitor
812  call checkoutput
813 
814  end subroutine dummyreadparamfile
815  subroutine extractmginfo
816  !
817  ! extractMgInfo creates the integer array cycleStrategy from
818  ! the string describing the multigrid strategy. This string
819  ! either contains a predefined strategy, like sg, 2v, 4w, etc.,
820  ! or a combination of -1's, 0's and 1's, which defines a user
821  ! defined strategy. The integers -1, 0 and 1 have the following
822  ! meaning: 0 -> perform an iteration step on the current grid.
823  ! 1 -> go to next coarser grid.
824  ! -1 -> go to next finer grid.
825  ! For a valid cycling strategy the sum of the elements of the
826  ! array should be 0.
827  !
828  use constants
830  use inputphysics, only: equationmode
832  use communication, only: myid
834  implicit none
835  !
836  ! Local variables
837  !
838  integer :: stringLen, error
839  integer(kind=intType) :: i, ii, nMinus, nn
840  character(len=maxStringLen) :: errorMessage
841 
842  ! For an unsteady computation using explicit Runge-Kutta schemes
843  ! overrule mgDescription to sg.
844 
845  if (equationmode == unsteady .and. &
847 
848  ! Create a lower case version of mgDescription and determine the
849  ! length of the string. Note that if the string contains a user
850  ! defined cycling strategy the contents (0's, 1's, -1's) is not
851  ! changed by the call to convertToLowerCase
852 
855  stringlen = len_trim(mgdescription)
856 
857  ! Check for predefined cycling strategies.
858 
859  if (mgdescription == "sg") then
860 
861  ! Single grid computation. Set the values for the parameters
862  ! nMGSteps (number of steps in the cycle strategy) and
863  ! cycleStrategy (the cycle strategy itself).
864 
865  nmgsteps = 1
866  allocate (cyclestrategy(1), stat=error)
867  if (error /= 0) call terminate("extractMgInfo", &
868  "allocation error for 1 integer")
869  cyclestrategy(1) = 0
870 
871  ! Set the number of grid levels needed by the multigrid to 1.
872 
873  nmglevels = 1
874 
875  else if (mgdescription(stringlen:stringlen) == "v") then
876 
877  ! Must be a v-cycle. The rest of the string should only contain
878  ! digits. Check this.
879 
880  if (.not. digitsonlyinstring(mgdescription(:stringlen - 1))) then
881  write (errormessage, *) "Invalid cycle strategy, ", &
882  mgdescription(:stringlen), ", specified"
883  if (myid == 0) call terminate("extractMgInfo", errormessage)
884  end if
885 
886  ! Read the number of levels in the cycle.
887 
888  read (mgdescription(:stringlen - 1), *) nmglevels
889 
890  ! Determine the number of steps in cycleStrategy and allocate
891  ! the memory for it.
892 
893  nmgsteps = 4 * nmglevels - 4
894  allocate (cyclestrategy(nmgsteps), stat=error)
895  if (error /= 0) then
896  write (errormessage, *) "Allocation error for", nmgsteps, &
897  "integers for the v-cycle ", &
898  mgdescription(:stringlen)
899  call terminate("extractMgInfo", errormessage)
900  end if
901 
902  ! Set the values of cycleStrategy.
903 
904  ii = 1
905  do i = 1, (nmglevels - 1)
906  cyclestrategy(ii) = 0
907  cyclestrategy(ii + 1) = 1
908  ii = ii + 2
909  end do
910 
911  do i = 1, (nmglevels - 1)
912  cyclestrategy(ii) = 0
913  cyclestrategy(ii + 1) = -1
914  ii = ii + 2
915  end do
916 
917  else if (mgdescription(stringlen:stringlen) == "w") then
918 
919  ! Must be a w-cycle. The rest of the string should only contain
920  ! digits. Check this.
921 
922  if (.not. digitsonlyinstring(mgdescription(:stringlen - 1))) then
923  write (errormessage, *) "Invalid cycle strategy, ", &
924  mgdescription(:stringlen), ", specified"
925  if (myid == 0) call terminate("extractMgInfo", errormessage)
926  end if
927 
928  ! Read the number of levels in the cycle.
929 
930  read (mgdescription(:stringlen - 1), *) nmglevels
931 
932  ! Determine the number of steps in cycleStrategy and allocate
933  ! the memory for it.
934 
936  allocate (cyclestrategy(nmgsteps), stat=error)
937  if (error /= 0) then
938  write (errormessage, *) "Allocation error for", nmgsteps, &
939  "integers for the w-cycle ", &
940  mgdescription(:stringlen)
941  call terminate("extractMgInfo", errormessage)
942  end if
943 
944  ! Set the values of cycleStrategy.
945 
946  ii = 1
947  call setentrieswcycle(ii, nmglevels)
948 
949  else
950 
951  ! The string must be a collection of 0's, -1's and 1's to
952  ! describe the cycle strategy. Get rid of the internal spaces
953  ! first and determine the amount of -'s.
954 
955  ii = 0
956  nminus = 0
957  do i = 1, stringlen
958  if (mgdescription(i:i) /= " ") then
959  ii = ii + 1
960  mgdescription(ii:ii) = mgdescription(i:i)
961  if (mgdescription(ii:ii) == "-") nminus = nminus + 1
962  end if
963  end do
964  stringlen = ii
965 
966  ! Determine the number of steps in the cycle strategy and
967  ! allocate the memory for it.
968 
969  nmgsteps = ii - nminus
970  allocate (cyclestrategy(nmgsteps), stat=error)
971  if (error /= 0) then
972  write (errormessage, *) "Allocation error for", nmgsteps, &
973  "integers for the cycle strategy"
974  call terminate("extractMgInfo", errormessage)
975  end if
976 
977  ! Determine the entries for cycleStrategy.
978 
979  i = 1
980  nn = 1
981  do
982  ii = i
983  if (mgdescription(i:i) == "-") i = i + 1
984 
985  ! Determine the case we are having here.
986 
987  select case (mgdescription(ii:i))
988  case ("0")
989  cyclestrategy(nn) = 0
990  case ("1")
991  cyclestrategy(nn) = 1
992  case ("-1")
993  cyclestrategy(nn) = -1
994  case default
995  write (errormessage, *) "Invalid character, ", &
996  mgdescription(ii:i), &
997  ", in the string describing &
998  &cycling strategy"
999  if (myid == 0) call terminate("extractMgInfo", errormessage)
1000  end select
1001 
1002  ! Update i and nn
1003 
1004  i = i + 1
1005  nn = nn + 1
1006 
1007  ! Exit the do loop in case i is larger than stringLen.
1008 
1009  if (i > stringlen) exit
1010  end do
1011 
1012  ! Check if the string specified is valid and determine the
1013  ! maximum grid level needed in the cycle.
1014 
1015  nn = 0
1016  nmglevels = 0
1017  do i = 1, nmgsteps
1018  nn = nn + cyclestrategy(i)
1019  nmglevels = max(nn, nmglevels)
1020  end do
1021  nmglevels = nmglevels + 1
1022 
1023  if (nn /= 0 .and. myid == 0) &
1024  call terminate("extractMgInfo", &
1025  "sum of coefficients in cycle strategy is not 0")
1026  end if
1027 
1028  ! Correct the value of mgStartlevel in case a nonpositive number
1029  ! has been specified. In that case it is set to -1, the default
1030  ! value.
1031 
1032  if (mgstartlevel <= 0) mgstartlevel = -1
1033 
1034  ! Determine the value of mgStartlevel. This parameter might be
1035  ! specified in the python script file and is checked here for
1036  ! consistency. If mgStartlevel has not been specified to any
1037  ! specific level it is set to the coarsest level in the mg cycle
1038  ! (starting from free stream) or to the finest level (restart).
1039  ! The restart is handled in python wrapper.
1040 
1041  if (mgstartlevel == -1) then
1042 
1043  ! Value has not been specified. Default value is set, see
1044  ! the comments above.
1046 
1047  end if
1048 
1049  end subroutine extractmginfo
1050 
1051  ! ==================================================================
1052 
1053  logical function digitsonlyinstring(string)
1054  !
1055  ! digitsOnlyInString checks whether the given string contains
1056  ! digits only or if other character types are present. In the
1057  ! former case the function returns .True., otherwise .False.
1058  !
1059  implicit none
1060  !
1061  ! Subroutine argument *
1062  !
1063  character(len=*), intent(in) :: string
1064  !
1065  ! Local variables
1066  !
1067  integer :: i, stringlen
1068 
1069  ! Initialize digitsOnlyInString to .True.
1070 
1071  digitsonlyinstring = .true.
1072 
1073  ! Determine the length of the string.
1074 
1075  stringlen = len_trim(string)
1076 
1077  ! Loop over the elements of the string and check if they are digits.
1078 
1079  do i = 1, stringlen
1080  if (string(i:i) < "0" .or. string(i:i) > "9") &
1081  digitsonlyinstring = .false.
1082  end do
1083 
1084  end function digitsonlyinstring
1085 
1086  ! ==================================================================
1087 
1088  recursive function computenstepswcycle(nLevels) result(nSteps)
1089  !
1090  ! computeNstepsWcycle is recursive function, which determines
1091  ! the number of entries of a w-cycle of a given level.
1092  !
1093  use constants
1094  use communication
1095  use utils, only: terminate
1096  implicit none
1097  !
1098  ! Result variable
1099  !
1100  integer(kind=intType) :: nsteps
1101  !
1102  ! Function argument
1103  !
1104  integer(kind=intType), intent(in) :: nlevels
1105  !
1106  ! Local variables
1107  !
1108  character(len=maxStringLen) :: errormessage
1109 
1110  ! Determine the case we are having here. For nLevels is less
1111  ! than 2 an error message is printed, in case nLevels is 2
1112  ! the recursion is broken and otherwise a recursive call is made.
1113 
1114  if (nlevels < 2) then
1115  write (errormessage, *) "Wrong value of nLevels", nlevels
1116  if (myid == 0) call terminate("computeNstepsWcycle", errormessage)
1117  else if (nlevels == 2) then
1118  nsteps = 4
1119  else
1120  nsteps = 4 + 2 * computenstepswcycle(nlevels - 1)
1121  end if
1122 
1123  end function computenstepswcycle
1124 
1125  ! ==================================================================
1126 
1127  recursive subroutine setentrieswcycle(counter, nLevels)
1128  !
1129  ! setEntriesWcycle is a recursive subroutine, which actually
1130  ! fills the entries of cycleStrategy for a w-cycle.
1131  !
1132  use constants
1133  use inputiteration, only: cyclestrategy
1134  use communication, only: myid
1135  use utils, only: terminate
1136  implicit none
1137  !
1138  ! Subroutine argument.
1139  !
1140  integer(kind=intType), intent(inout) :: counter
1141  integer(kind=intType), intent(in) :: nlevels
1142  !
1143  ! Local variables
1144  !
1145  character(len=maxStringLen) :: errormessage
1146 
1147  ! Determine the case we are having here. For nLevels is less
1148  ! than 2 an error message is printed, in case nLevels is 2
1149  ! the recursion is broken and otherwise a recursive call is made.
1150 
1151  if (nlevels < 2) then
1152 
1153  write (errormessage, *) "Wrong value of nLevels", nlevels
1154  if (myid == 0) call terminate("setEntriesWcycle", errormessage)
1155 
1156  else if (nlevels == 2) then
1157 
1158  cyclestrategy(counter) = 0
1159  cyclestrategy(counter + 1) = 1
1160  cyclestrategy(counter + 2) = 0
1161  cyclestrategy(counter + 3) = -1
1162 
1163  counter = counter + 4
1164 
1165  else
1166 
1167  cyclestrategy(counter) = 0
1168  cyclestrategy(counter + 1) = 1
1169  counter = counter + 2
1170 
1171  call setentrieswcycle(counter, nlevels - 1)
1172  call setentrieswcycle(counter, nlevels - 1)
1173 
1174  cyclestrategy(counter) = 0
1175  cyclestrategy(counter + 1) = -1
1176  counter = counter + 2
1177 
1178  end if
1179 
1180  end subroutine setentrieswcycle
1181  subroutine isovariables(variables)
1182  !
1183  ! isoVariables extracts from the given string the extra
1184  ! iso surface variables to be written to the solution file.
1185  !
1186  use constants
1187  use extraoutput
1188  use utils, only: converttolowercase, terminate
1189  implicit none
1190  !
1191  ! Subroutine arguments.
1192  !
1193  character(len=*), intent(inout) :: variables
1194  !
1195  ! Local variables.
1196  !
1197  integer :: nVarSpecified, pos
1198 
1199  character(len=15) :: keyword
1200  character(len=maxStringLen) :: errorMessage
1201 
1202  ! Convert the string variables to lower case.
1203 
1204  call converttolowercase(variables)
1205 
1206  ! Initialize all the iso output variables to .False.
1207  isowriterho = .false.
1208  isowritevx = .false.
1209  isowritevy = .false.
1210  isowritevz = .false.
1211  isowritep = .false.
1212  isowriteturb = .false.
1213 
1214  isowritemx = .false.
1215  isowritemy = .false.
1216  isowritemz = .false.
1217  isowriterhoe = .false.
1218  isowritetemp = .false.
1219  isowritevort = .false.
1220  isowritevortx = .false.
1221  isowritevorty = .false.
1222  isowritevortz = .false.
1223 
1224  isowritecp = .false.
1225  isowritemach = .false.
1226  isowritemachturb = .false.
1227  isowriteptotloss = .false.
1228 
1229  isowriteeddyvis = .false.
1230  isowriteratioeddyvis = .false.
1231  isowritedist = .false.
1232 
1233  isowriteresrho = .false.
1234  isowriteresmom = .false.
1235  isowriteresrhoe = .false.
1236  isowriteresturb = .false.
1237 
1238  isowriteshock = .false.
1239  isowritefilteredshock = .false.
1240 
1241  isowriteblank = .false.
1242 
1243  ! Initialize nVarSpecified to 0. This serves as a test
1244  ! later on.
1245 
1246  nvarspecified = 0
1247 
1248  ! Loop to extract the info from the string variables.
1249 
1250  do
1251  ! Condition to exit the loop.
1252 
1253  if (len_trim(variables) == 0) exit
1254 
1255  ! Locate the first occurance of the _ in the string and
1256  ! determine the string keyword.
1257 
1258  pos = index(variables, "_")
1259  if (pos == 0) then
1260  keyword = variables
1261  variables = ""
1262  else
1263  keyword = variables(:pos - 1)
1264  variables = variables(pos + 1:)
1265  end if
1266 
1267  ! Check the keyword.
1268 
1269  select case (keyword)
1270  case ("")
1271  ! Multiple occurence of "_". Just ignore it.
1272 
1273  case ("rho")
1274  isowriterho = .true.
1275  nvarspecified = nvarspecified + 1
1276 
1277  case ("vx")
1278  isowritevx = .true.
1279  nvarspecified = nvarspecified + 1
1280 
1281  case ("vy")
1282  isowritevy = .true.
1283  nvarspecified = nvarspecified + 1
1284 
1285  case ("vz")
1286  isowritevz = .true.
1287  nvarspecified = nvarspecified + 1
1288 
1289  case ("P")
1290  isowritep = .true.
1291  nvarspecified = nvarspecified + 1
1292 
1293  case ("turb")
1294  isowriteturb = .true.
1295  nvarspecified = nvarspecified + 1
1296 
1297  case ("mx")
1298  isowritemx = .true.
1299  nvarspecified = nvarspecified + 1
1300 
1301  case ("my")
1302  isowritemy = .true.
1303  nvarspecified = nvarspecified + 1
1304 
1305  case ("mz")
1306  isowritemz = .true.
1307  nvarspecified = nvarspecified + 1
1308 
1309  case ("rvx")
1310  isowritervx = .true.
1311  nvarspecified = nvarspecified + 1
1312 
1313  case ("rvy")
1314  isowritervy = .true.
1315  nvarspecified = nvarspecified + 1
1316 
1317  case ("rvz")
1318  isowritervz = .true.
1319  nvarspecified = nvarspecified + 1
1320 
1321  case ("rhoe")
1322  isowriterhoe = .true.
1323  nvarspecified = nvarspecified + 1
1324 
1325  case ("temp")
1326  isowritetemp = .true.
1327  nvarspecified = nvarspecified + 1
1328 
1329  case ("vort")
1330  isowritevort = .true.
1331  nvarspecified = nvarspecified + 1
1332 
1333  case ("vortx")
1334  isowritevortx = .true.
1335  nvarspecified = nvarspecified + 1
1336 
1337  case ("vorty")
1338  isowritevorty = .true.
1339  nvarspecified = nvarspecified + 1
1340 
1341  case ("vortz")
1342  isowritevortz = .true.
1343  nvarspecified = nvarspecified + 1
1344 
1345  case ("cp")
1346  isowritecp = .true.
1347  nvarspecified = nvarspecified + 1
1348 
1349  case ("mach")
1350  isowritemach = .true.
1351  nvarspecified = nvarspecified + 1
1352 
1353  case ("rmach")
1354  isowritermach = .true.
1355  nvarspecified = nvarspecified + 1
1356 
1357  case ("macht")
1358  isowritemachturb = .true.
1359  nvarspecified = nvarspecified + 1
1360 
1361  case ("ptloss")
1362  isowriteptotloss = .true.
1363  nvarspecified = nvarspecified + 1
1364 
1365  case ("eddy")
1366  isowriteeddyvis = .true.
1367  nvarspecified = nvarspecified + 1
1368 
1369  case ("eddyratio")
1370  isowriteratioeddyvis = .true.
1371  nvarspecified = nvarspecified + 1
1372 
1373  case ("dist")
1374  isowritedist = .true.
1375  nvarspecified = nvarspecified + 1
1376 
1377  case ("resrho")
1378  isowriteresrho = .true.
1379  nvarspecified = nvarspecified + 1
1380 
1381  case ("resmom")
1382  isowriteresmom = .true.
1383  nvarspecified = nvarspecified + 1
1384 
1385  case ("resrhoe")
1386  isowriteresrhoe = .true.
1387  nvarspecified = nvarspecified + 1
1388 
1389  case ("resturb")
1390  isowriteresturb = .true.
1391  nvarspecified = nvarspecified + 1
1392 
1393  case ("blank")
1394  isowriteblank = .true.
1395  nvarspecified = nvarspecified + 1
1396 
1397  case ("shock")
1398  isowriteshock = .true.
1399  nvarspecified = nvarspecified + 1
1400 
1401  case ("filteredshock")
1402  isowritefilteredshock = .true.
1403  nvarspecified = nvarspecified + 1
1404 
1405  case default
1406  pos = len_trim(keyword)
1407  write (errormessage, "(3a)") "Unknown extra iso output &
1408  &variable, ", trim(keyword), &
1409  ", specified"
1410  call terminate("isoVariables", errormessage)
1411 
1412  end select
1413 
1414  end do
1415 
1416  ! Set this to true regardless...it is possible no varibles were
1417  ! specified
1418  isooutspecified = .true.
1419 
1420  end subroutine isovariables
1421 
1422  subroutine monitorvariables(variables)
1423  !
1424  ! monitorVariables extracts from the given string the variables
1425  ! to be monitored during the convergence.
1426  !
1427  use constants
1428  use cgnsnames
1430  use monitor, only: monnames, nmon, nmonmax, nmonsum, showcpu
1431  use utils, only: converttolowercase, terminate
1432  implicit none
1433  !
1434  ! Subroutine arguments.
1435  !
1436  character(len=*), intent(inout) :: variables
1437  !
1438  ! Local parameter.
1439  !
1440  integer(kind=intType), parameter :: nVarMax = 21
1441  !
1442  ! Local variables.
1443  !
1444  integer :: pos, ierr
1445 
1446  character(len=15) :: keyword
1447  character(len=maxStringLen) :: errorMessage
1448 
1449  character(len=maxCGNSNameLen), dimension(nVarMax) :: tmpNames
1450 
1451  logical :: monDrho, monTotalR
1452 
1453  ! Check if the monitoring names have already been allocated.
1454  ! This happens when multiple lines for the monitoring variables
1455  ! are specified in the parameter file. If this happens the last
1456  ! value is taken and thus release the memory of previously
1457  ! specified names.
1458 
1459  if (allocated(monnames)) then
1460  deallocate (monnames, stat=ierr)
1461  if (ierr /= 0) call terminate("monitorVariables", &
1462  "Deallocation error for monNames")
1463  end if
1464 
1465  ! Initialize monDrho, monDturb and showCPU to .false.
1466 
1467  mondrho = .false.
1468  montotalr = .false.
1469  mondturb = .false.
1470  showcpu = .false.
1471 
1472  ! Initialize nMonSum, nMonMax and nMon to 0.
1473 
1474  nmonsum = 0
1475  nmonmax = 0
1476  nmon = 0
1477 
1478  ! Convert the string variables to lower case.
1479 
1480  call converttolowercase(variables)
1481 
1482  ! Loop to extract the info from the string variables.
1483 
1484  do
1485  ! Condition to exit the loop.
1486 
1487  if (len_trim(variables) == 0) exit
1488 
1489  ! Locate the first occurance of the _ in the string and
1490  ! determine the string keyword.
1491 
1492  pos = index(variables, "_")
1493  if (pos == 0) then
1494  keyword = variables
1495  variables = ""
1496  else
1497  keyword = variables(:pos - 1)
1498  variables = variables(pos + 1:)
1499  end if
1500 
1501  ! Check the keyword.
1502 
1503  select case (keyword)
1504  case ("")
1505  ! Multiple occurence of "_". Just ignore it.
1506 
1507  case ("cpu") ! only written to stdout.
1508  showcpu = .true.
1509 
1510  case ("resrho")
1511  mondrho = .true.
1512  nmon = nmon + 1; nmonsum = nmonsum + 1
1513  tmpnames(nmon) = cgnsl2resrho
1514 
1515  case ("resmom")
1516  nmon = nmon + 3; nmonsum = nmonsum + 3
1517  tmpnames(nmon - 2) = cgnsl2resmomx
1518  tmpnames(nmon - 1) = cgnsl2resmomy
1519  tmpnames(nmon) = cgnsl2resmomz
1520 
1521  case ("resrhoe")
1522  nmon = nmon + 1; nmonsum = nmonsum + 1
1523  tmpnames(nmon) = cgnsl2resrhoe
1524 
1525  case ("resturb") ! special case, because the turbulence model
1526  ! Is not yet known. See checkMonitor.
1527  mondturb = .true.
1528 
1529  case ("cl")
1530  nmon = nmon + 1; nmonsum = nmonsum + 1
1531  tmpnames(nmon) = cgnscl
1532 
1533  case ("clp")
1534  nmon = nmon + 1; nmonsum = nmonsum + 1
1535  tmpnames(nmon) = cgnsclp
1536 
1537  case ("clv")
1538  nmon = nmon + 1; nmonsum = nmonsum + 1
1539  tmpnames(nmon) = cgnsclv
1540 
1541  case ("cd")
1542  nmon = nmon + 1; nmonsum = nmonsum + 1
1543  tmpnames(nmon) = cgnscd
1544 
1545  case ("cdp")
1546  nmon = nmon + 1; nmonsum = nmonsum + 1
1547  tmpnames(nmon) = cgnscdp
1548 
1549  case ("cdv")
1550  nmon = nmon + 1; nmonsum = nmonsum + 1
1551  tmpnames(nmon) = cgnscdv
1552 
1553  case ("cfx")
1554  nmon = nmon + 1; nmonsum = nmonsum + 1
1555  tmpnames(nmon) = cgnscfx
1556 
1557  case ("cfy")
1558  nmon = nmon + 1; nmonsum = nmonsum + 1
1559  tmpnames(nmon) = cgnscfy
1560 
1561  case ("cfz")
1562  nmon = nmon + 1; nmonsum = nmonsum + 1
1563  tmpnames(nmon) = cgnscfz
1564 
1565  case ("cmx")
1566  nmon = nmon + 1; nmonsum = nmonsum + 1
1567  tmpnames(nmon) = cgnscmx
1568 
1569  case ("cmy")
1570  nmon = nmon + 1; nmonsum = nmonsum + 1
1571  tmpnames(nmon) = cgnscmy
1572 
1573  case ("cmz")
1574  nmon = nmon + 1; nmonsum = nmonsum + 1
1575  tmpnames(nmon) = cgnscmz
1576 
1577  case ("hdiff")
1578  nmon = nmon + 1; nmonmax = nmonmax + 1
1579  tmpnames(nmon) = cgnshdiffmax
1580 
1581  case ("mach")
1582  nmon = nmon + 1; nmonmax = nmonmax + 1
1583  tmpnames(nmon) = cgnsmachmax
1584 
1585  case ("yplus")
1586  nmon = nmon + 1; nmonmax = nmonmax + 1
1587  tmpnames(nmon) = cgnsyplusmax
1588 
1589  case ("eddyv")
1590  nmon = nmon + 1; nmonmax = nmonmax + 1
1591  tmpnames(nmon) = cgnseddymax
1592 
1593  case ("totalr")
1594  montotalr = .true.
1595  nmon = nmon + 1; nmonsum = nmonsum + 1
1596  tmpnames(nmon) = 'totalR'
1597 
1598  case ("sepsensor")
1599  nmon = nmon + 1; nmonsum = nmonsum + 1
1600  tmpnames(nmon) = cgnssepsensor
1601 
1602  case ("SepSensorKsArea")
1603  nmon = nmon + 1; nmonsum = nmonsum + 1
1604  tmpnames(nmon) = cgnssepsensorksarea
1605 
1606  case ("cavitation")
1607  nmon = nmon + 1; nmonsum = nmonsum + 1
1608  tmpnames(nmon) = cgnscavitation
1609 
1610  case ("axismoment")
1611  nmon = nmon + 1; nmonsum = nmonsum + 1
1612  tmpnames(nmon) = cgnsaxismoment
1613 
1614  case default
1615  write (errormessage, "(3a)") "Unknown monitoring variable, ", &
1616  trim(keyword), ", specified"
1617  if (myid == 0) &
1618  call terminate("monitorVariables", errormessage)
1619  call mpi_barrier(adflow_comm_world, ierr)
1620 
1621  end select
1622 
1623  end do
1624 
1625  ! If the density residual was not specified to be monitored,
1626  ! add it to tmpNames.
1627 
1628  if (.not. mondrho) then
1629  nmon = nmon + 1; nmonsum = nmonsum + 1
1630  tmpnames(nmon) = cgnsl2resrho
1631  end if
1632 
1633  ! If the total residual was not specified to be monitored, add
1634  ! it to tmpNames.
1635 
1636  if (.not. montotalr) then
1637  nmon = nmon + 1; nmonsum = nmonsum + 1
1638  tmpnames(nmon) = "totalR"
1639  end if
1640 
1641  ! Allocate the memory for monNames. If the turbulent residuals
1642  ! must be monitored allocate some extra place.
1643 
1644  pos = nmon
1645  if (mondturb) pos = nmon + 4
1646  allocate (monnames(pos), stat=ierr)
1647  if (ierr /= 0) &
1648  call terminate("monitorVariables", &
1649  "Memory allocation failure for monNames")
1650 
1651  ! Copy the monitoring names into monNames.
1652 
1653  do pos = 1, nmon
1654  monnames(pos) = tmpnames(pos)
1655  end do
1656 
1657  ! Set monitorSpecified to .true. to indicate that monitoring
1658  ! variables have been specified.
1659 
1660  monitorspecified = .true.
1661 
1662  end subroutine monitorvariables
1664  !
1665  ! readCpTempCurveFits reads the curve fits for the cp as a
1666  ! function of the temperature from the file cpFile.
1667  !
1668  use constants
1670  use cpcurvefits, only: cptrange, cptempfit, cpeint, cphint, cvn, cv0, &
1671  cpnparts
1672  use inputio, only: cpfile
1673  use utils, only: terminate
1674  implicit none
1675 
1676  ! Local variables.
1677 
1678  integer, parameter :: readUnit = 32
1679 
1680  integer :: ios, ierr
1681 
1682  integer(kind=intType) :: nn, mm, kk, ii
1683  real(kind=realtype) :: t1, t2, e0
1684 
1685  character(len=2*maxStringLen) :: errorMessage
1686  character(len=512) :: string
1687 
1688  ! Open the file for reading and check if it went okay. If the file
1689  ! is not found, processor 0 prints an error message.
1690 
1691  open (unit=readunit, file=cpfile, status="old", &
1692  action="read", iostat=ios)
1693 
1694  if (ios /= 0) then
1695 
1696  write (errormessage, *) "Cp curve fit file ", trim(cpfile), &
1697  " not found."
1698  if (myid == 0) &
1699  call terminate("readCpTempCurveFits", errormessage)
1700 
1701  call mpi_barrier(adflow_comm_world, ierr)
1702  end if
1703 
1704  ! Skip the comment lines and read the number of parts.
1705  ! Check if a valid number is read.
1706 
1707  call findnextinfoline(readunit, string)
1708  read (string, *) cpnparts
1709 
1710  if (cpnparts <= 0) then
1711  if (myid == 0) &
1712  call terminate("readCpTempCurveFits", &
1713  "Wrong number of temperature ranges in &
1714  &Cp curve fit file.")
1715  call mpi_barrier(adflow_comm_world, ierr)
1716  end if
1717 
1718  ! Allocate the memory for the variables to store the curve fit
1719  ! data.
1720 
1721  allocate (cptrange(0:cpnparts), cpeint(0:cpnparts), &
1723  stat=ierr)
1724  if (ierr /= 0) &
1725  call terminate("readCpTempCurveFits", &
1726  "Memory allocation failure for cpTrange, &
1727  &cpEint, cpHint and cpTempFit")
1728 
1729  ! Loop over the number of temperature ranges.
1730 
1731  nranges: do nn = 1, cpnparts
1732 
1733  ! Find the next line with information and read the temperature
1734  ! range.
1735 
1736  call findnextinfoline(readunit, string)
1737  read (string, *) t1, t2
1738 
1739  ! If this is the first range, set the temperature range;
1740  ! otherwise check if the lower boundary equals the upper
1741  ! boundary of the previous range.
1742 
1743  if (nn == 1) then
1744  cptrange(0) = t1
1745  cptrange(1) = t2
1746  else
1747  cptrange(nn) = t2
1748 
1749  if (t1 /= cptrange(nn - 1)) then
1750  if (myid == 0) &
1751  call terminate("readCpTempCurveFits", &
1752  "Curve fit boundary not continuous")
1753  call mpi_barrier(adflow_comm_world, ierr)
1754  end if
1755  end if
1756 
1757  ! Read the number of points in the fit.
1758 
1759  call findnextinfoline(readunit, string)
1760  read (string, *) cptempfit(nn)%nterm
1761 
1762  ! Allocate the memory for the exponents and the constants.
1763 
1764  ii = cptempfit(nn)%nterm
1765  allocate (cptempfit(nn)%exponents(ii), &
1766  cptempfit(nn)%constants(ii), stat=ierr)
1767  if (ierr /= 0) &
1768  call terminate("readCpTempCurveFits", &
1769  "Memory allocation failure for exponents and &
1770  &constants")
1771 
1772  ! Read the exponents from the file.
1773 
1774  call findnextinfoline(readunit, string)
1775  do ii = 1, cptempfit(nn)%nterm
1776 
1777  ! Read the exponent from the string.
1778 
1779  read (string, *) cptempfit(nn)%exponents(ii)
1780 
1781  ! Remove this value from the string if this is not the
1782  ! last exponent to be read.
1783 
1784  if (ii < cptempfit(nn)%nterm) then
1785  ios = index(string, " ")
1786  if (ios > 0) then
1787  string = string(ios:)
1788  string = adjustl(string)
1789  string = trim(string)
1790  else
1791  if (myid == 0) &
1792  call terminate("readCpTempCurveFits", &
1793  "Not enough exponents on line; &
1794  &Cp curve fit file not valid.")
1795  call mpi_barrier(adflow_comm_world, ierr)
1796  end if
1797  end if
1798  end do
1799 
1800  ! Read the constants from the file.
1801 
1802  call findnextinfoline(readunit, string)
1803  do ii = 1, cptempfit(nn)%nterm
1804 
1805  ! Read the constant from the string.
1806 
1807  read (string, *) cptempfit(nn)%constants(ii)
1808 
1809  ! Remove this value from the string if this is not the
1810  ! last constant to be read.
1811 
1812  if (ii < cptempfit(nn)%nterm) then
1813  ios = index(string, " ")
1814  if (ios > 0) then
1815  string = string(ios:)
1816  string = adjustl(string)
1817  string = trim(string)
1818  else
1819  if (myid == 0) &
1820  call terminate("readCpTempCurveFits", &
1821  "Not enough constants on line; &
1822  &Cp curve fit file not valid.")
1823  call mpi_barrier(adflow_comm_world, ierr)
1824  end if
1825  end if
1826  end do
1827 
1828  end do nranges
1829 
1830  ! Close the file
1831 
1832  close (unit=readunit)
1833  !
1834  ! Compute the constants eint0, such that the internal energy is
1835  ! a continous function of the temperature.
1836  !
1837  ! First for the first interval, such that at T = 0 Kelvin the
1838  ! energy is also zero.
1839 
1840  t1 = cptrange(0)
1841  cv0 = -one ! cv/R = cp/R - 1.0
1842  e0 = -t1 ! e = integral of cv, not of cp.
1843 
1844  do ii = 1, cptempfit(1)%nterm
1845 
1846  ! Update cv0.
1847 
1848  t2 = t1**(cptempfit(1)%exponents(ii))
1849  cv0 = cv0 + cptempfit(1)%constants(ii) * t2
1850 
1851  ! Update e0, for which this contribution must be integrated.
1852  ! Take the exceptional case exponent is -1 into account.
1853 
1854  if (cptempfit(1)%exponents(ii) == -1_inttype) then
1855  e0 = e0 + cptempfit(1)%constants(ii) * log(t1)
1856  else
1857  t2 = t1 * t2
1858  e0 = e0 + cptempfit(1)%constants(ii) * t2 &
1859  / (cptempfit(1)%exponents(ii) + 1)
1860  end if
1861 
1862  end do
1863 
1864  ! Set the value of the internal energy at the temperature T1.
1865  ! Cv is assumed to be constant in the temperature range 0 - T1.
1866  ! Idem for the internal enthalpy.
1867 
1868  cpeint(0) = cv0 * t1
1869  cphint(0) = cpeint(0) + t1
1870 
1871  ! Compute the integration constant for the energy.
1872 
1873  cptempfit(1)%eint0 = cpeint(0) - e0
1874 
1875  ! Loop over the other temperature ranges to compute their
1876  ! integration constant and the energy at the curve fit boundary.
1877 
1878  nranges2: do nn = 2, cpnparts
1879 
1880  ! Store nn-1, the previous temperature range, in mm.
1881 
1882  mm = nn - 1
1883 
1884  ! Store the temperature at the interface a bit easier.
1885 
1886  t1 = cptrange(mm)
1887 
1888  ! First compute the internal energy (scaled by r) from the
1889  ! previous range. Actually not the energy but the enthalpy is
1890  ! computed. This leads to the same integraton constant.
1891  ! Again check for exponent -1 when integrating.
1892 
1893  e0 = cptempfit(mm)%eint0
1894 
1895  do ii = 1, cptempfit(mm)%nterm
1896  if (cptempfit(mm)%exponents(ii) == -1_inttype) then
1897  e0 = e0 + cptempfit(mm)%constants(ii) * log(t1)
1898  else
1899  kk = cptempfit(mm)%exponents(ii) + 1
1900  t2 = t1**kk
1901  e0 = e0 + cptempfit(mm)%constants(ii) * t2 / kk
1902  end if
1903  end do
1904 
1905  ! Store the enthalpy and energy at the curve fit boundary.
1906  ! Remember that cp was integrated.
1907 
1908  cphint(mm) = e0
1909  cpeint(mm) = e0 - t1
1910 
1911  ! Substract the part coming from the integration of cp/r of
1912  ! the range nn.
1913 
1914  do ii = 1, cptempfit(nn)%nterm
1915  if (cptempfit(nn)%exponents(ii) == -1_inttype) then
1916  e0 = e0 - cptempfit(nn)%constants(ii) * log(t1)
1917  else
1918  kk = cptempfit(nn)%exponents(ii) + 1
1919  t2 = t1**kk
1920  e0 = e0 - cptempfit(nn)%constants(ii) * t2 / kk
1921  end if
1922  end do
1923 
1924  ! Store the integration constant for the range nn.
1925 
1926  cptempfit(nn)%eint0 = e0
1927 
1928  end do nranges2
1929 
1930  ! Compute the values of cv and the internal energy at the upper
1931  ! boundary of the curve fit. This is needed for the extrapolation
1932  ! of the energy if states occur with a higher temperature than
1933  ! the validness of the curve fits.
1934 
1935  ! First initialize these values.
1936 
1937  nn = cpnparts
1938  t1 = cptrange(nn)
1939  cvn = -one ! cv/R = cp/R - 1.0
1940  e0 = cptempfit(nn)%eint0 - t1 ! e = integral of cv, not of cp.
1941 
1942  do ii = 1, cptempfit(nn)%nterm
1943 
1944  ! Update cvn.
1945 
1946  t2 = t1**(cptempfit(nn)%exponents(ii))
1947  cvn = cvn + cptempfit(nn)%constants(ii) * t2
1948 
1949  ! Update e0, for which this contribution must be integrated.
1950  ! Take the exceptional case exponent is -1 into account.
1951 
1952  if (cptempfit(nn)%exponents(ii) == -1_inttype) then
1953  e0 = e0 + cptempfit(nn)%constants(ii) * log(t1)
1954  else
1955  e0 = e0 + cptempfit(nn)%constants(ii) * t2 * t1 &
1956  / (cptempfit(nn)%exponents(ii) + 1)
1957  end if
1958 
1959  end do
1960 
1961  ! Store e0 correctly.
1962 
1963  cpeint(nn) = e0
1964  cphint(nn) = e0 + t1
1965 
1966  ! Compute the values of the integrands of cp/(R*T) at the lower
1967  ! and upper curve fit boundary. This is needed to compute the
1968  ! total pressure. This cannot be done with a single integration
1969  ! constant, because of the singularity at T = 0.
1970 
1971  nranges3: do nn = 1, cpnparts
1972 
1973  ! Store the temperatures of the lower and upper boundary a
1974  ! bit easier.
1975 
1976  t1 = cptrange(nn - 1)
1977  t2 = cptrange(nn)
1978 
1979  ! Initializes the integrands to zero.
1980 
1981  cptempfit(nn)%intCpovrT_1 = zero
1982  cptempfit(nn)%intCpovrT_2 = zero
1983 
1984  ! Loop over the number of terms of the curve fits and compute
1985  ! the integral cp/(r*t).
1986 
1987  do ii = 1, cptempfit(nn)%nterm
1988 
1989  ! Store the coefficient a bit easier in mm. As the integral
1990  ! of cp/(R*T) must be computed, this is also the exponent
1991  ! of the primitive function; except of course when the exponent
1992  ! is 0.
1993 
1994  mm = cptempfit(nn)%exponents(ii)
1995 
1996  ! Update the integrands if the temperature is larger than
1997  ! 0 kelvin. In case the boundary is 0 kelvin the value is not
1998  ! needed anyway.
1999 
2000  if (t1 > zero) then
2001  if (mm == 0_inttype) then
2002  cptempfit(nn)%intCpovrT_1 = cptempfit(nn)%intCpovrT_1 &
2003  + cptempfit(nn)%constants(ii) * log(t1)
2004  else
2005  cptempfit(nn)%intCpovrT_1 = cptempfit(nn)%intCpovrT_1 &
2006  + (cptempfit(nn)%constants(ii) * t1**mm) / mm
2007  end if
2008  end if
2009 
2010  if (t2 > zero) then
2011  if (mm == 0_inttype) then
2012  cptempfit(nn)%intCpovrT_2 = cptempfit(nn)%intCpovrT_2 &
2013  + cptempfit(nn)%constants(ii) * log(t2)
2014  else
2015  cptempfit(nn)%intCpovrT_2 = cptempfit(nn)%intCpovrT_2 &
2016  + (cptempfit(nn)%constants(ii) * t2**mm) / mm
2017  end if
2018  end if
2019 
2020  end do
2021 
2022  end do nranges3
2023 
2024  end subroutine readcptempcurvefits
2025 
2026  ! ==================================================================
2027 
2028  subroutine findnextinfoline(readUnit, string)
2029  !
2030  ! findNextInfoLine skips the comment lines in the given unit
2031  ! and finds the first line containing information.
2032  !
2033  use communication
2034  use utils, only: terminate
2035  implicit none
2036  !
2037  ! Subroutine arguments
2038  !
2039  integer, intent(in) :: readUnit
2040  character(len=512), intent(out) :: string
2041  !
2042  ! Local variables.
2043  !
2044  integer :: ios, ierr
2045 
2046  ! Loop to skip the comment lines.
2047 
2048  do
2049  read (unit=readunit, fmt="(a512)", iostat=ios) string
2050 
2051  ! Test if everything went okay.
2052 
2053  if (ios /= 0) then
2054  if (myid == 0) &
2055  call terminate("findNextInfoLine", &
2056  "Unexpected end of Cp curve fit file")
2057  call mpi_barrier(adflow_comm_world, ierr)
2058  end if
2059 
2060  ! Get rid of the leading and trailing spaces in string.
2061 
2062  string = adjustl(string)
2063  string = trim(string)
2064 
2065  ! Check if this is the correct line. If so, exit
2066 
2067  if ((len_trim(string) > 0) .and. (string(:1) /= "#")) exit
2068  end do
2069 
2070  end subroutine findnextinfoline
2071 
2073  !
2074  ! setEquationParameters sets the number of variables in the
2075  ! governing equations, the number of turbulent variables, etc.
2076  !
2077  use constants
2078  use paramturb
2079  use turbcurvefits
2080  use flowvarrefstate, only: nw, nwf, nt1, nt2, nwt, viscous, &
2083  implicit none
2084 
2085  ! Set the number of flow variables to 5, nt1 to 6. This is valid
2086  ! for all governing equations. Furthermore initialize viscous,
2087  ! kPresent and eddyModel to .False., which indicates an inviscid
2088  ! computation. For ns and rans this will be corrected.
2089 
2090  rsacw1 = rsacb1/(rsak**2) + (1._realtype + rsacb2)/rsacb3
2091 
2092  nwf = 5
2093  nt1 = 6
2094 
2095  viscous = .false.
2096  kpresent = .false.
2097  eddymodel = .false.
2098 
2099  ! Determine the set of governing equations to solve for and set
2100  ! the parameters accordingly.
2101 
2102  select case (equations)
2103  case (eulerequations)
2104  nw = 5
2105  nt2 = 5
2106 
2107  !===============================================================
2108 
2109  case (nsequations)
2110  nw = 5
2111  nt2 = 5
2112 
2113  viscous = .true.
2114 
2115  !===============================================================
2116 
2117  case (ransequations)
2118 
2119  viscous = .true.
2120 
2121  select case (turbmodel)
2122 
2123  case (spalartallmaras)
2124  nw = 6
2125  nt2 = 6
2126 
2127  eddymodel = .true.
2129 
2130  !===========================================================
2131 
2132  case (spalartallmarasedwards)
2133  nw = 6
2134  nt2 = 6
2135 
2136  eddymodel = .true.
2138 
2139  !===========================================================
2140 
2141  case (komegawilcox)
2142  nw = 7
2143  nt2 = 7
2144 
2145  kpresent = .true.
2146  eddymodel = .true.
2148 
2149  !===========================================================
2150 
2151  case (komegamodified)
2152  nw = 7
2153  nt2 = 7
2154 
2155  kpresent = .true.
2156  eddymodel = .true.
2158 
2159  !===========================================================
2160 
2161  case (mentersst)
2162  nw = 7
2163  nt2 = 7
2164 
2165  kpresent = .true.
2166  eddymodel = .true.
2168 
2169  !===========================================================
2170 
2171  case (ktau)
2172  nw = 7
2173  nt2 = 7
2174 
2175  kpresent = .true.
2176  eddymodel = .true.
2178 
2179  !===========================================================
2180 
2181  case (v2f)
2182  nw = 9
2183  nt2 = 9
2184 
2185  rvflimitk = 1.e-25_realtype
2186  rvflimite = 1.e-25_realtype
2187 
2188  if (rvfn == 6) then
2189  rvfcmu = rvfn6cmu
2190  rvfcl = rvfn6cl
2191  else
2192  rvfcmu = rvfn1cmu
2193  rvfcl = rvfn1cl
2194  end if
2195 
2196  kpresent = .true.
2197  eddymodel = .true.
2199 
2200  end select
2201 
2202  end select
2203 
2204  ! Determine the number of turbulent variables.
2205 
2206  nwt = nw - nwf
2207 
2208  end subroutine setequationparameters
2210  !
2211  ! setStageCoeffExplicitRK determines the coefficients of the
2212  ! stages for the explicit Runge Kutta time integration schemes
2213  ! for unsteady problems.
2214  !
2215  use constants
2218  use utils, only: terminate
2219  implicit none
2220  !
2221  ! Local variables.
2222  !
2223  integer :: ierr
2224 
2225  ! Determine the number of Runge Kutta stages as a function of
2226  ! the accuracy.
2227 
2228  select case (timeaccuracy)
2229  case (firstorder)
2230  nrkstagesunsteady = 1
2231 
2232  case (secondorder)
2233  nrkstagesunsteady = 2
2234 
2235  case (thirdorder)
2236  nrkstagesunsteady = 3
2237 
2238  case default
2239  call terminate("setStageCoeffExplicitRK", &
2240  "No higher order stuff yet")
2241  end select
2242 
2243  ! Allocate and determine betaRKUnsteady and gammaRKUnsteady.
2244 
2246  gammarkunsteady(nrkstagesunsteady), stat=ierr)
2247  if (ierr /= 0) &
2248  call terminate("setStageCoeffExplicitRK", &
2249  "Memory allocation failure for betaRKUnsteady &
2250  &and gammaRKUnsteady.")
2251 
2253 
2254  select case (timeaccuracy)
2255  case (firstorder)
2256 
2257  ! Just the forward Euler time integration scheme.
2258 
2259  betarkunsteady(1, 1) = 1.0_realtype
2260  gammarkunsteady(1) = 0.0_realtype
2261 
2262  !==============================================================
2263 
2264  case (secondorder)
2265 
2266  ! The TVD Runge Kutta scheme which allows for the maximum
2267  ! CFL number (1.0).
2268 
2269  betarkunsteady(1, 1) = 1.0_realtype
2270  betarkunsteady(2, 1) = -0.5_realtype
2271  betarkunsteady(2, 2) = 0.5_realtype
2272 
2273  gammarkunsteady(1) = 0.0_realtype
2274  gammarkunsteady(2) = 1.0_realtype
2275 
2276  !==============================================================
2277 
2278  case (thirdorder)
2279 
2280  ! Low storage (although not exploited in this implemetation)
2281  ! 3 stage scheme of Le and Moin.
2282 
2283  betarkunsteady(1, 1) = 8.0_realtype / 15.0_realtype
2284  betarkunsteady(2, 1) = -17.0_realtype / 60.0_realtype
2285  betarkunsteady(2, 2) = 5.0_realtype / 12.0_realtype
2286  betarkunsteady(3, 2) = -5.0_realtype / 12.0_realtype
2287  betarkunsteady(3, 3) = 3.0_realtype / 4.0_realtype
2288 
2289  gammarkunsteady(1) = 0.0_realtype
2290  gammarkunsteady(2) = 8.0_realtype / 15.0_realtype
2291  gammarkunsteady(3) = 2.0_realtype / 3.0_realtype
2292 
2293  ! The TVD Runge Kutta scheme which allows for the maximum
2294  ! CFL number (1.0).
2295 
2296  ! betaRKUnsteady(1,1) = 1.0_realType
2297  ! betaRKUnsteady(2,1) = -3.0_realType/ 4.0_realType
2298  ! betaRKUnsteady(2,2) = 1.0_realType/ 4.0_realType
2299  ! betaRKUnsteady(3,1) = -1.0_realType/12.0_realType
2300  ! betaRKUnsteady(3,2) = -1.0_realType/12.0_realType
2301  ! betaRKUnsteady(3,3) = 2.0_realType/ 3.0_realType
2302 
2303  ! gammaRKUnsteady(1) = 0.0_realType
2304  ! gammaRKUnsteady(2) = 1.0_realType
2305  ! gammaRKUnsteady(3) = 0.5_realType
2306 
2307  !==============================================================
2308 
2309  case default
2310  call terminate("setStageCoeffExplicitRK", &
2311  "No higher order stuff yet")
2312  end select
2313 
2314  end subroutine setstagecoeffexplicitrk
2315  subroutine surfacevariables(variables)
2316  !
2317  ! surfaceVariables extracts from the given string the surface
2318  ! variables to be written to the solution file.
2319  !
2320  use constants
2321  use extraoutput
2322  use utils, only: converttolowercase, terminate
2323  implicit none
2324  !
2325  ! Subroutine arguments.
2326  !
2327  character(len=*), intent(inout) :: variables
2328  !
2329  ! Local variables.
2330  !
2331  integer :: nVarSpecified, pos
2332 
2333  character(len=15) :: keyword
2334  character(len=maxStringLen) :: errorMessage
2335 
2336  ! Convert the string variables to lower case.
2337 
2338  call converttolowercase(variables)
2339 
2340  ! Initialize all the surface output variables to .false.
2341 
2342  surfwriterho = .false.
2343  surfwritep = .false.
2344  surfwritetemp = .false.
2345  surfwritevx = .false.
2346  surfwritevy = .false.
2347  surfwritevz = .false.
2348  surfwritervx = .false.
2349  surfwritervy = .false.
2350  surfwritervz = .false.
2351 
2352  surfwritecp = .false.
2353  surfwriteptotloss = .false.
2354  surfwritemach = .false.
2355  surfwritermach = .false.
2356 
2357  surfwritecf = .false.
2358  surfwritech = .false.
2359  surfwriteyplus = .false.
2360  surfwritecfx = .false.
2361  surfwritecfy = .false.
2362  surfwritecfz = .false.
2363  surfwriteforceindragdir = .false.
2364  surfwriteforceinliftdir = .false.
2365 
2366  surfwriteblank = .false.
2367  surfwritesepsensor = .false.
2368  surfwritesepsensorks = .false.
2369  surfwritesepsensorksarea = .false.
2370  surfwritecavitation = .false.
2371  surfwriteaxismoment = .false.
2372  surfwritegc = .false.
2373 
2374  ! Initialize nVarSpecified to 0. This serves as a test
2375  ! later on.
2376 
2377  nvarspecified = 0
2378 
2379  ! Loop to extract the info from the string variables.
2380 
2381  do
2382  ! Condition to exit the loop.
2383 
2384  if (len_trim(variables) == 0) exit
2385 
2386  ! Locate the first occurance of the _ in the string and
2387  ! determine the string keyword.
2388 
2389  pos = index(variables, "_")
2390  if (pos == 0) then
2391  keyword = variables
2392  variables = ""
2393  else
2394  keyword = variables(:pos - 1)
2395  variables = variables(pos + 1:)
2396  end if
2397 
2398  ! Check the keyword.
2399 
2400  select case (keyword)
2401  case ("")
2402  ! Multiple occurence of "_". Just ignore it.
2403 
2404  case ("rho")
2405  surfwriterho = .true.
2406  nvarspecified = nvarspecified + 1
2407 
2408  case ("p")
2409  surfwritep = .true.
2410  nvarspecified = nvarspecified + 1
2411 
2412  case ("temp")
2413  surfwritetemp = .true.
2414  nvarspecified = nvarspecified + 1
2415 
2416  case ("vx")
2417  surfwritevx = .true.
2418  nvarspecified = nvarspecified + 1
2419 
2420  case ("vy")
2421  surfwritevy = .true.
2422  nvarspecified = nvarspecified + 1
2423 
2424  case ("vz")
2425  surfwritevz = .true.
2426  nvarspecified = nvarspecified + 1
2427 
2428  case ("rvx")
2429  surfwritervx = .true.
2430  nvarspecified = nvarspecified + 1
2431 
2432  case ("rvy")
2433  surfwritervy = .true.
2434  nvarspecified = nvarspecified + 1
2435 
2436  case ("rvz")
2437  surfwritervz = .true.
2438  nvarspecified = nvarspecified + 1
2439 
2440  case ("cp")
2441  surfwritecp = .true.
2442  nvarspecified = nvarspecified + 1
2443 
2444  case ("ptloss")
2445  surfwriteptotloss = .true.
2446  nvarspecified = nvarspecified + 1
2447 
2448  case ("mach")
2449  surfwritemach = .true.
2450  nvarspecified = nvarspecified + 1
2451 
2452  case ("rmach")
2453  surfwritermach = .true.
2454  nvarspecified = nvarspecified + 1
2455 
2456  case ("cf")
2457  surfwritecf = .true.
2458  nvarspecified = nvarspecified + 1
2459 
2460  case ("ch")
2461  surfwritech = .true.
2462  nvarspecified = nvarspecified + 1
2463 
2464  case ("yplus")
2465  surfwriteyplus = .true.
2466  nvarspecified = nvarspecified + 1
2467 
2468  case ("cfx")
2469  surfwritecfx = .true.
2470  nvarspecified = nvarspecified + 1
2471 
2472  case ("cfy")
2473  surfwritecfy = .true.
2474  nvarspecified = nvarspecified + 1
2475 
2476  case ("cfz")
2477  surfwritecfz = .true.
2478  nvarspecified = nvarspecified + 1
2479 
2480  case ("forceindragdir")
2481  surfwriteforceindragdir = .true.
2482  nvarspecified = nvarspecified + 1
2483 
2484  case ("forceinliftdir")
2485  surfwriteforceinliftdir = .true.
2486  nvarspecified = nvarspecified + 1
2487 
2488  case ("blank")
2489  surfwriteblank = .true.
2490  nvarspecified = nvarspecified + 1
2491 
2492  case ("sepsensor")
2493  surfwritesepsensor = .true.
2494  nvarspecified = nvarspecified + 1
2495 
2496  case ("sepsensorks")
2497  surfwritesepsensorks = .true.
2498  nvarspecified = nvarspecified + 1
2499 
2500  case ("sepsensorksarea")
2501  surfwritesepsensorksarea = .true.
2502  nvarspecified = nvarspecified + 1
2503 
2504  case ("cavitation")
2505  surfwritecavitation = .true.
2506  nvarspecified = nvarspecified + 1
2507 
2508  case ("axismoment")
2509  surfwriteaxismoment = .true.
2510  nvarspecified = nvarspecified + 1
2511 
2512  case ("gc")
2513  surfwritegc = .true.
2514  nvarspecified = nvarspecified + 1
2515 
2516  case default
2517  pos = len_trim(keyword)
2518  write (errormessage, "(3a)") "Unknown surface output &
2519  &variable, ", trim(keyword), &
2520  ", specified"
2521  call terminate("surfaceVariables", errormessage)
2522 
2523  end select
2524 
2525  end do
2526 
2527  ! Set surfaceOutSpecified to .true. if variables were specified.
2528  ! If not, later on the defaults will be set.
2529 
2530  if (nvarspecified > 0) surfaceoutspecified = .true.
2531 
2532  end subroutine surfacevariables
2533 
2534  subroutine volumevariables(variables)
2535  !
2536  ! volumeVariables extracts from the given string the extra
2537  ! volume variables to be written to the solution file.
2538  !
2539  use constants
2540  use extraoutput
2541  use utils, only: converttolowercase, terminate
2542  implicit none
2543  !
2544  ! Subroutine arguments.
2545  !
2546  character(len=*), intent(inout) :: variables
2547  !
2548  ! Local variables.
2549  !
2550  integer :: nVarSpecified, pos
2551 
2552  character(len=15) :: keyword
2553  character(len=maxStringLen) :: errorMessage
2554 
2555  ! Convert the string variables to lower case.
2556 
2557  call converttolowercase(variables)
2558 
2559  ! Initialize all the volume output variables to .False.
2560 
2561  volwritemx = .false.
2562  volwritemy = .false.
2563  volwritemz = .false.
2564  volwriterhoe = .false.
2565  volwritetemp = .false.
2566  volwritevort = .false.
2567  volwritevortx = .false.
2568  volwritevorty = .false.
2569  volwritevortz = .false.
2570 
2571  volwritecp = .false.
2572  volwritemach = .false.
2573  volwritemachturb = .false.
2574  volwriteptotloss = .false.
2575 
2576  volwriteeddyvis = .false.
2577  volwriteratioeddyvis = .false.
2578  volwritedist = .false.
2579 
2580  volwriteresrho = .false.
2581  volwriteresmom = .false.
2582  volwriteresrhoe = .false.
2583  volwriteresturb = .false.
2584 
2585  volwriteshock = .false.
2586  volwritefilteredshock = .false.
2587 
2588  volwriteblank = .false.
2589  volwritegc = .false.
2590  volwritestatus = .false.
2591  volwriteintermittency = .false.
2592 
2593  ! Initialize nVarSpecified to 0. This serves as a test
2594  ! later on.
2595 
2596  nvarspecified = 0
2597 
2598  ! Loop to extract the info from the string variables.
2599 
2600  do
2601  ! Condition to exit the loop.
2602 
2603  if (len_trim(variables) == 0) exit
2604 
2605  ! Locate the first occurance of the _ in the string and
2606  ! determine the string keyword.
2607 
2608  pos = index(variables, "_")
2609  if (pos == 0) then
2610  keyword = variables
2611  variables = ""
2612  else
2613  keyword = variables(:pos - 1)
2614  variables = variables(pos + 1:)
2615  end if
2616 
2617  ! Check the keyword.
2618 
2619  select case (keyword)
2620  case ("")
2621  ! Multiple occurence of "_". Just ignore it.
2622 
2623  case ("mx")
2624  volwritemx = .true.
2625  nvarspecified = nvarspecified + 1
2626 
2627  case ("my")
2628  volwritemy = .true.
2629  nvarspecified = nvarspecified + 1
2630 
2631  case ("mz")
2632  volwritemz = .true.
2633  nvarspecified = nvarspecified + 1
2634 
2635  case ("rvx")
2636  volwritervx = .true.
2637  nvarspecified = nvarspecified + 1
2638 
2639  case ("rvy")
2640  volwritervy = .true.
2641  nvarspecified = nvarspecified + 1
2642 
2643  case ("rvz")
2644  volwritervz = .true.
2645  nvarspecified = nvarspecified + 1
2646 
2647  case ("rhoe")
2648  volwriterhoe = .true.
2649  nvarspecified = nvarspecified + 1
2650 
2651  case ("temp")
2652  volwritetemp = .true.
2653  nvarspecified = nvarspecified + 1
2654 
2655  case ("vort")
2656  volwritevort = .true.
2657  nvarspecified = nvarspecified + 1
2658 
2659  case ("vortx")
2660  volwritevortx = .true.
2661  nvarspecified = nvarspecified + 1
2662 
2663  case ("vorty")
2664  volwritevorty = .true.
2665  nvarspecified = nvarspecified + 1
2666 
2667  case ("vortz")
2668  volwritevortz = .true.
2669  nvarspecified = nvarspecified + 1
2670 
2671  case ("cp")
2672  volwritecp = .true.
2673  nvarspecified = nvarspecified + 1
2674 
2675  case ("mach")
2676  volwritemach = .true.
2677  nvarspecified = nvarspecified + 1
2678 
2679  case ("rmach")
2680  volwritermach = .true.
2681  nvarspecified = nvarspecified + 1
2682 
2683  case ("macht")
2684  volwritemachturb = .true.
2685  nvarspecified = nvarspecified + 1
2686 
2687  case ("ptloss")
2688  volwriteptotloss = .true.
2689  nvarspecified = nvarspecified + 1
2690 
2691  case ("eddy")
2692  volwriteeddyvis = .true.
2693  nvarspecified = nvarspecified + 1
2694 
2695  case ("eddyratio")
2696  volwriteratioeddyvis = .true.
2697  nvarspecified = nvarspecified + 1
2698 
2699  case ("dist")
2700  volwritedist = .true.
2701  nvarspecified = nvarspecified + 1
2702 
2703  case ("resrho")
2704  volwriteresrho = .true.
2705  nvarspecified = nvarspecified + 1
2706 
2707  case ("resmom")
2708  volwriteresmom = .true.
2709  nvarspecified = nvarspecified + 1
2710 
2711  case ("resrhoe")
2712  volwriteresrhoe = .true.
2713  nvarspecified = nvarspecified + 1
2714 
2715  case ("resturb")
2716  volwriteresturb = .true.
2717  nvarspecified = nvarspecified + 1
2718 
2719  case ("shock")
2720  volwriteshock = .true.
2721  nvarspecified = nvarspecified + 1
2722 
2723  case ("filteredshock")
2724  volwritefilteredshock = .true.
2725  nvarspecified = nvarspecified + 1
2726 
2727  case ("blank")
2728  volwriteblank = .true.
2729  nvarspecified = nvarspecified + 1
2730 
2731  case ("gc")
2732  volwritegc = .true.
2733  nvarspecified = nvarspecified + 1
2734 
2735  case ("status")
2736  volwritestatus = .true.
2737  nvarspecified = nvarspecified + 1
2738 
2739  case ("intermittency")
2740  volwriteintermittency = .true.
2741  nvarspecified = nvarspecified + 1
2742 
2743  case default
2744  pos = len_trim(keyword)
2745  write (errormessage, "(3a)") "Unknown extra volume output &
2746  &variable, ", trim(keyword), &
2747  ", specified"
2748  call terminate("volumeVariables", errormessage)
2749 
2750  end select
2751 
2752  end do
2753 
2754  ! Set volumeOutSpecified to .true. if variables were specified.
2755  ! If not, later on the defaults will be set.
2756 
2757  if (nvarspecified > 0) volumeoutspecified = .true.
2758 
2759  end subroutine volumevariables
2760 
2761  subroutine checkinputparam
2762  !
2763  ! checkInputParam checks if all necessary data has been
2764  ! specified. If some key data is missing an error message will
2765  ! be printed and the program will exit. Key data depends on the
2766  ! case to be solved. E.g. for the Navier Stokes equations it is
2767  ! necessary to specify the Reynolds number, but for Euler this
2768  ! can be omitted.
2769  ! Furthermore warnings are printed in case parameters have been
2770  ! specified that are ignored, e.g. Mach number for internal flow
2771  ! computations.
2772  ! Note that only processor 0 prints warning and error messages,
2773  ! such that the output does not become messy.
2774  !
2775  use constants
2776  ! --------- Bare imports...too many to list -------
2778  use inputio
2779  use inputiteration
2780  use inputmotion
2781  use inputoverset
2782  use inputparallel
2783  use inputphysics
2784  use inputtimespectral
2785  use inputunsteady
2786  use inputadjoint
2787  use inputtsstabderiv
2788  ! ------------------------------------------------
2790  use iteration, only: coeftime, coeftimeale, coefmeshale, &
2792  use monitor, only: ntimestepsrestart
2793  use utils, only: terminate
2794  implicit none
2795  !
2796  ! Local variables
2797  !
2798  integer :: ierr
2799 
2800  integer(kind=intType) :: nn, oldSolWrittenSize
2801 
2802  real(kind=realtype) :: veclength, dot
2803 
2804  logical :: gridPrecisionWarning, solPrecisionWarning
2805 
2806  ! Discretization parameters. Check if the key parameters have
2807  ! been specified and set some coarse grid parameters in case
2808  ! these have not been specified.
2809  !
2810  if (spacediscr == none) then
2811  if (myid == 0) &
2812  call terminate("checkInputParam", &
2813  "Discretization scheme not specified")
2814  call mpi_barrier(adflow_comm_world, ierr)
2815  end if
2816 
2818 
2820 
2821  ! Set dirScaling to .false. if a scheme other than scalar
2822  ! dissipation is used.
2823 
2824  if (spacediscr /= dissscalar) dirscaling = .false.
2825 
2826  ! Determine whether or not the spectral radIi are needed for
2827  ! the flux computations.
2828 
2829  radiineededfine = .false.
2830  if (spacediscr == dissscalar) radiineededfine = .true.
2831 
2832  radiineededcoarse = .false.
2834  !
2835  ! IO parameters. Check if the grid file has been specified
2836  ! Possibly correct the
2837  ! value of restart. Note that restart got the default value of
2838  ! .true. in case no restart file has been specified it is now
2839  ! set to false. Set the names of the solution files if not
2840  ! specified and check if a cp curve fit file has been specified
2841  ! if curve fits must be used.
2842  ! If the code has been compiled without cgns check that the file
2843  ! format is not cgns.
2844  ! Overwrite storeConvInnerIter to .true. if this is not an
2845  ! unsteady computation.
2846  !
2847  if (gridfile == "") then
2848  if (myid == 0) &
2849  call terminate("checkInputParam", "Grid file not specified")
2850  call mpi_barrier(adflow_comm_world, ierr)
2851  end if
2852 
2853  if (newgridfile == "") then
2854  newgridfile = "NewGrid.cgns"
2855  end if
2856 
2857  if (solfile == "") then
2858  solfile = "SolADflow.cgns"
2859  end if
2860 
2861  if (surfacesolfile == "") &
2862  surfacesolfile = trim(solfile)//"Surface"
2863 
2864  if (cpmodel == cptempcurvefits .and. cpfile == "") then
2865  if (myid == 0) &
2866  call terminate("checkInputParam", &
2867  "Cp curve fit file not specified")
2868  call mpi_barrier(adflow_comm_world, ierr)
2869  end if
2870 
2871 #ifdef USE_NO_CGNS
2872 
2873  if (fileformatread == cgnsformat .or. &
2874  fileformatwrite == cgnsformat) then
2875  if (myid == 0) &
2876  call terminate("checkInputParam", &
2877  "cgns support disabled during compile time")
2878  call mpi_barrier(adflow_comm_world, ierr)
2879  end if
2880 
2881 #endif
2882 
2883  if (equationmode == unsteady) then
2885  storeconvinneriter = .false.
2886  end if
2887  !
2888  ! Iteration parameters. Check if the key parameters have specified
2889  ! been and set some coarse grid parameters in case these
2890  ! have not been specified.
2891  !
2892  if (equationmode == unsteady .and. &
2894  smoother = none
2895  else
2896  if (smoother == none) then
2897  if (myid == 0) &
2898  call terminate("checkInputParam", "Smoother not specified")
2899  call mpi_barrier(adflow_comm_world, ierr)
2900  end if
2901 
2902  if (ncycles < 0) then
2903  if (myid == 0) &
2904  call terminate("checkInputParam", &
2905  "Number of multigrid cycles not or wrongly &
2906  &specified")
2907  call mpi_barrier(adflow_comm_world, ierr)
2908  end if
2909 
2910  if (cfl < zero) then
2911  if (myid == 0) &
2912  call terminate("checkInputParam", &
2913  "cfl number not or wrongly specified")
2914  call mpi_barrier(adflow_comm_world, ierr)
2915  end if
2916 
2917  if (l2conv <= zero .or. l2conv >= one) then
2918  if (myid == 0) &
2919  call terminate("checkInputParam", &
2920  "Relative L2 norm for convergence must be a &
2921  & number between 0 and 1.")
2922  call mpi_barrier(adflow_comm_world, ierr)
2923  end if
2924 
2925  if (l2convcoarse <= zero .or. l2convcoarse >= one) then
2926  if (myid == 0) &
2927  call terminate("checkInputParam", &
2928  "Relative L2 norm for convergence coarse grid &
2929  &must be a number between 0 and 1.")
2930  call mpi_barrier(adflow_comm_world, ierr)
2931  end if
2932  end if
2933  !
2934  ! Grid motion parameters. These can only be specified for an
2935  ! external flow problem.
2936  !
2937  if (flowtype == internalflow .and. gridmotionspecified) then
2938  if (myid == 0) &
2939  call terminate("checkInputParam", &
2940  "Grid motion specified for an internal flow; &
2941  &this is not possible")
2942  call mpi_barrier(adflow_comm_world, ierr)
2943  end if
2944  !
2945  ! Physics parameters. Check if the key parameters have been
2946  ! specified and set the unit vector for the free-stream velocity.
2947  !
2948  if (equations == none) then
2949  if (myid == 0) &
2950  call terminate("checkInputParam", "Equations not specified")
2951  call mpi_barrier(adflow_comm_world, ierr)
2952  end if
2953 
2954  if (equationmode == none) then
2955  if (myid == 0) &
2956  call terminate("checkInputParam", "Mode not specified")
2957  call mpi_barrier(adflow_comm_world, ierr)
2958  end if
2959 
2960  if (flowtype == none) then
2961  if (myid == 0) &
2962  call terminate("checkInputParam", "Flow type not specified")
2963  call mpi_barrier(adflow_comm_world, ierr)
2964  end if
2965 
2966  if (mach < zero .and. flowtype == externalflow) then
2967  if (myid == 0) &
2968  call terminate("checkInputParam", &
2969  "Mach not or wrongly specified")
2970  call mpi_barrier(adflow_comm_world, ierr)
2971  end if
2972 
2973  if (equations == ransequations .and. turbmodel == none) then
2974  if (myid == 0) &
2975  call terminate("checkInputParam", &
2976  "Turbulence model not specified")
2977  call mpi_barrier(adflow_comm_world, ierr)
2978  end if
2979 
2980  ! Create a unit vector for the free stream velocity. It is checked
2981  ! if the vector specified is a valid one. If not processor 0 prints
2982  ! an error message. Only for external flows.
2983 
2984  if (flowtype == externalflow) then
2985  veclength = sqrt(veldirfreestream(1) * veldirfreestream(1) &
2988  if (veclength < eps) then
2989  if (myid == 0) &
2990  call terminate("checkInputParam", &
2991  "Free stream velocity direction wrongly &
2992  &specified")
2993  call mpi_barrier(adflow_comm_world, ierr)
2994  end if
2995 
2996  veclength = one / veclength
2997  veldirfreestream(1) = veldirfreestream(1) * veclength
2998  veldirfreestream(2) = veldirfreestream(2) * veclength
2999  veldirfreestream(3) = veldirfreestream(3) * veclength
3000  else
3001  ! Internal flow; simply reset the velocity direction. The value
3002  ! will be determined later from the inflow boundary conditions.
3003 
3004  veldirfreestream(1) = one
3005  veldirfreestream(2) = zero
3006  veldirfreestream(3) = zero
3007  end if
3008 
3009  ! Set the drag direction to the velocity direction.
3010 
3012 
3013  ! Check the lift direction if it was specified for an external
3014  ! flow. Otherwise set the default direction.
3015 
3016  if (liftdirspecified .and. flowtype == externalflow) then
3017 
3018  ! Create a unit vector. Perform the same check as for
3019  ! for the free stream velocity direction.
3020 
3021  veclength = sqrt(liftdirection(1) * liftdirection(1) &
3022  + liftdirection(2) * liftdirection(2) &
3023  + liftdirection(3) * liftdirection(3))
3024  if (veclength < eps) then
3025  if (myid == 0) &
3026  call terminate("checkInputParam", &
3027  "Lift direction wrongly specified")
3028  call mpi_barrier(adflow_comm_world, ierr)
3029  end if
3030 
3031  veclength = one / veclength
3032  liftdirection(1) = liftdirection(1) * veclength
3033  liftdirection(2) = liftdirection(2) * veclength
3034  liftdirection(3) = liftdirection(3) * veclength
3035 
3036  ! Check the orthogonality with the drag direction.
3037 
3038  dot = liftdirection(1) * dragdirection(1) &
3039  + liftdirection(2) * dragdirection(2) &
3040  + liftdirection(3) * dragdirection(3)
3041 
3042  if (abs(dot) > 1.e-3_realtype) then
3043  if (myid == 0) &
3044  call terminate("checkInputParam", &
3045  "Lift direction not orthogonal to &
3046  &free-stream")
3047  call mpi_barrier(adflow_comm_world, ierr)
3048  end if
3049 
3050  else
3051 
3052  ! Lift direction not specified. Set the default direction.
3053  ! It will have a zero component in the y-direction and a positive
3054  ! one in the z-direction.
3055 
3056  liftdirection(1) = -dragdirection(3)
3057  liftdirection(2) = zero
3059 
3060  if (liftdirection(3) < zero) then
3061  liftdirection(1) = -liftdirection(1)
3062  liftdirection(3) = -liftdirection(3)
3063  end if
3064  end if
3065 
3066  ! Set the Mach number for the coefficients equal to the Mach
3067  ! number if it was not specified. For internal flow field this
3068  ! will again be changed in initFlo.
3069 
3070  if (machcoef < zero) machcoef = mach
3071  !
3072  ! Time spectral parameters. They only need to be specified for a
3073  ! time spectral computation.
3074  !
3075  testspectral: if (equationmode == timespectral) then
3076 
3077  ! Check if the number of time intervals was specified.
3078 
3079  if (ntimeintervalsspectral < 0) then
3080  if (myid == 0) &
3081  call terminate("checkInputParam", &
3082  "Number time intervals spectral not or &
3083  &wrongly specified")
3084  call mpi_barrier(adflow_comm_world, ierr)
3085  end if
3086 
3087  ! If an unsteady restart solution file must be written, check
3088  ! if the corresponding time step has been specified.
3089 
3091  if (dtunsteadyrestartspectral <= zero) then
3092  if (myid == 0) &
3093  call terminate("checkInputParam", &
3094  "Time step (in sec) for unsteady restart &
3095  &not or wrongly specified.")
3096  call mpi_barrier(adflow_comm_world, ierr)
3097  end if
3098  end if
3099 
3100  ! If solution files (for postprocessing) must be written,
3101  ! check if the number has been specified.
3102 
3103  if (writeunsteadyvolspectral .or. &
3105  if (nunsteadysolspectral <= 0) then
3106  if (myid == 0) &
3107  call terminate("checkInputParam", &
3108  "Number of unsteady solution files &
3109  &not or wrongly specified.")
3110  call mpi_barrier(adflow_comm_world, ierr)
3111  end if
3112  end if
3113 
3114  else testspectral
3115 
3116  ! No spectral method. Set nTimeIntervalsSpectral to 1.
3117 
3119 
3120  end if testspectral
3121  !
3122  ! Unsteady parameters. They only need to be specified for an
3123  ! unsteady computation.
3124  !
3125  testunsteady: if (equationmode == unsteady) then
3126 
3127  ! Physical time step parameters.
3128 
3129  if (ntimestepsfine < 0) then
3130  if (myid == 0) &
3131  call terminate("checkInputParam", &
3132  "Number of unsteady time steps fine grid &
3133  &not or wrongly specified")
3134  call mpi_barrier(adflow_comm_world, ierr)
3135  end if
3136 
3138 
3139  if (deltat < 0) then
3140  if (myid == 0) &
3141  call terminate("checkInputParam", &
3142  "Unsteady time step (in sec) &
3143  &not or wrongly specified")
3144  call mpi_barrier(adflow_comm_world, ierr)
3145  end if
3146 
3147  ! Check if the rigid body rotation parameters are consistent.
3148  ! The polynomial rotation coefficients.
3149 
3150  if (degreepolxrot >= 0 .and. &
3151  .not. allocated(coefpolxrot)) then
3152  if (myid == 0) &
3153  call terminate("checkInputParam", &
3154  "Polynomial coefficients x-rotation &
3155  &not specified")
3156  call mpi_barrier(adflow_comm_world, ierr)
3157  end if
3158 
3159  if (degreepolyrot >= 0 .and. &
3160  .not. allocated(coefpolyrot)) then
3161  if (myid == 0) &
3162  call terminate("checkInputParam", &
3163  "Polynomial coefficients y-rotation &
3164  &not specified")
3165  call mpi_barrier(adflow_comm_world, ierr)
3166  end if
3167 
3168  if (degreepolzrot >= 0 .and. &
3169  .not. allocated(coefpolzrot)) then
3170  if (myid == 0) &
3171  call terminate("checkInputParam", &
3172  "Polynomial coefficients z-rotation &
3173  &not specified")
3174  call mpi_barrier(adflow_comm_world, ierr)
3175  end if
3176 
3177  ! The fourier rotation coefficients.
3178 
3179  if (degreefourxrot >= 0 .and. &
3180  .not. allocated(coscoeffourxrot)) then
3181  if (myid == 0) &
3182  call terminate("checkInputParam", &
3183  "Fourier cosine coefficients x-rotation &
3184  &not specified")
3185  call mpi_barrier(adflow_comm_world, ierr)
3186  end if
3187 
3188  if (degreefourxrot >= 1 .and. &
3189  .not. allocated(sincoeffourxrot)) then
3190  if (myid == 0) &
3191  call terminate("checkInputParam", &
3192  "Fourier sine coefficients x-rotation &
3193  &not specified")
3194  call mpi_barrier(adflow_comm_world, ierr)
3195  end if
3196 
3197  if (degreefouryrot >= 0 .and. &
3198  .not. allocated(coscoeffouryrot)) then
3199  if (myid == 0) &
3200  call terminate("checkInputParam", &
3201  "Fourier cosine coefficients y-rotation &
3202  &not specified")
3203  call mpi_barrier(adflow_comm_world, ierr)
3204  end if
3205 
3206  if (degreefouryrot >= 1 .and. &
3207  .not. allocated(sincoeffouryrot)) then
3208  if (myid == 0) &
3209  call terminate("checkInputParam", &
3210  "Fourier sine coefficients y-rotation &
3211  &not specified")
3212  call mpi_barrier(adflow_comm_world, ierr)
3213  end if
3214 
3215  if (degreefourzrot >= 0 .and. &
3216  .not. allocated(coscoeffourzrot)) then
3217  if (myid == 0) &
3218  call terminate("checkInputParam", &
3219  "Fourier cosine coefficients z-rotation &
3220  &not specified")
3221  call mpi_barrier(adflow_comm_world, ierr)
3222  end if
3223 
3224  if (degreefourzrot >= 1 .and. &
3225  .not. allocated(sincoeffourzrot)) then
3226  if (myid == 0) &
3227  call terminate("checkInputParam", &
3228  "Fourier sine coefficients z-rotation &
3229  &not specified")
3230  call mpi_barrier(adflow_comm_world, ierr)
3231  end if
3232 
3233  end if testunsteady
3234  !
3235  ! Warning messages.
3236  !
3237  ! Check for an invisid problem if the Reynolds number is specified.
3238  ! If so, print a Warning that this info is ignored.
3239 
3240  if (myid == 0 .and. equations == eulerequations .and. &
3241  reynolds > zero) then
3242 
3243  print "(a)", "#"
3244  print "(a)", "# Warning"
3245  print "(a)", "# Reynolds number specified for the Euler &
3246  &equations."
3247  print "(a)", "# This information is ignored."
3248  print "(a)", "#"
3249 
3250  end if
3251 
3252  ! Check if the Mach and Reynolds number are specified for an
3253  ! internal flow problem. If so, print a Warning message that this
3254  ! info is ignored.
3255 
3256  if (flowtype == internalflow) then
3257 
3258  ! Check whether a viscous or an inviscid problem is to be solved.
3259  ! For an inviscid problem you do not want to mention that the
3260  ! Reynolds number is ignored, because this has already been
3261  ! taken care of.
3262 
3263  if ((equations == nsequations .or. &
3264  equations == ransequations) .and. &
3265  mach > zero .and. reynolds > zero) then
3266 
3267  ! Viscous problem, where both the Mach and Reynolds were
3268  ! specified. Processor 0 prints the Warning.
3269 
3270  if (myid == 0) then
3271  print "(a)", "#"
3272  print "(a)", "# Warning"
3273  print "(a)", "# Mach and Reynolds number specified &
3274  &for an internal flow problem."
3275  print "(a)", "# This information is ignored."
3276  print "(a)", "#"
3277  end if
3278 
3279  else if (mach > zero) then
3280 
3281  ! The Mach number has been specified. Processor 0 prints
3282  ! a Warning.
3283 
3284  if (myid == 0) then
3285  print "(a)", "#"
3286  print "(a)", "# Warning"
3287  print "(a)", "# Mach number specified for an internal &
3288  &flow problem."
3289  print "(a)", "# This information is ignored."
3290  print "(a)", "#"
3291  end if
3292 
3293  end if
3294 
3295  end if
3296 
3297  ! For a steady computation possible specified rigid body
3298  ! rotation info is ignored. Processor 0 will print the Warning.
3299 
3300  if (degreepolxrot >= 0 .or. degreepolyrot >= 0 .or. &
3301  degreepolzrot >= 0 .or. degreefourxrot >= 0 .or. &
3302  degreefouryrot >= 0 .or. degreefourzrot >= 0) then
3303 
3304  if (equationmode == steady .and. myid == 0) then
3305  print "(a)", "#"
3306  print "(a)", "# Warning"
3307  print "(a)", "# Rigid body rotation info specified for &
3308  &a steady computation."
3309  print "(a)", "# This information is ignored."
3310  print "(a)", "#"
3311  end if
3312  end if
3313 
3314  ! Print warning messages if the precision to be written
3315  ! is larger than the precision used in the computation.
3316 
3317  gridprecisionwarning = .false.
3318  solprecisionwarning = .false.
3319 
3320 #ifdef USE_SINGLE_PRECISION
3321  if (precisiongrid == precisiondouble) gridprecisionwarning = .true.
3322  if (precisionsol == precisiondouble) solprecisionwarning = .true.
3323 #endif
3324 
3325  if (gridprecisionwarning .and. myid == 0) then
3326  print "(a)", "#"
3327  print "(a)", "# Warning"
3328  print "(a)", "# Precision of the grid file to write is &
3329  &bigger than used in the computation."
3330  print "(a)", "# This does not make sense and is a waste &
3331  &of disk space"
3332  print "(a)", "#"
3333  end if
3334 
3335  if (solprecisionwarning .and. myid == 0) then
3336  print "(a)", "#"
3337  print "(a)", "# Warning"
3338  print "(a)", "# Precision of the solution file to write is &
3339  &bigger than used in the computation."
3340  print "(a)", "# This does not make sense and is a waste &
3341  &of disk space"
3342  print "(a)", "#"
3343  end if
3344  !
3345  ! Wall functions can only be used if the RANS equations are to
3346  ! be solved. If no wall functions are used the wall offset is
3347  ! set to zero.
3348  !
3349  if (equations /= ransequations) wallfunctions = .false.
3350  if (.not. wallfunctions) walloffset = zero
3351  !
3352  ! Check whether or not the wall distance is needed for the
3353  ! turbulence model.
3354  !
3355  if (equations == ransequations) then
3356 
3357  ! RANS simulation. Determine if the turbulence model is
3358  ! wall distance free. Note that updateWallDistanceUnsteady is
3359  ! NOT overruled, because this is just the case for which this
3360  ! parameter was intended.
3361 
3362  select case (turbmodel)
3364 
3365  ! Wall distance free turbulence models.
3366 
3367  walldistanceneeded = .false.
3368 
3369  !=============================================================
3370 
3371  case default
3372 
3373  ! The turbulence model needs the wall distance
3374 
3375  walldistanceneeded = .true.
3376 
3377  end select
3378 
3379  else
3380 
3381  ! Laminar or inviscid computation. Simply initialize the
3382  ! logicals for the wall distance to .false.
3383 
3384  walldistanceneeded = .false.
3385  updatewalldistanceunsteady = .false.
3386 
3387  end if
3388  !
3389  ! Parallelization parameters. Set the minimum load imbalance to
3390  ! 3 percent to avoid any problems.
3391  !
3392  loadimbalance = max(loadimbalance, 0.03_realtype)
3393  !
3394  ! Some default parameters, which depend on other parameters.
3395  ! Only if these have not been specified of course.
3396  !
3397  if (nsgstartup < 0) nsgstartup = 0
3399  if (cflcoarse < zero) cflcoarse = cfl
3400  if (betaturb < zero) betaturb = alfaturb
3401 
3402  if (turbrelax == turbrelaxnotdefined) then
3405  end if
3406 
3407  ! V2f should only be solved with explicit underrelaxation.
3408 
3409  if (equations == ransequations .and. turbmodel == v2f .and. &
3410  turbrelax == turbrelaximplicit) then
3411 
3413 
3414  if (myid == 0) then
3415  print "(a)", "#"
3416  print "(a)", "# Warning"
3417  print "(a)", "# Implicit underrelaxation specified for &
3418  &the v2f model."
3419  print "(a)", "# This is overwritten to explicit &
3420  &underrelaxation."
3421  print "(a)", "#"
3422  end if
3423 
3424  end if
3425 
3426  if (nsavevolume <= 0) then
3427  select case (equationmode)
3428  case (steady, timespectral)
3430 
3431  case (unsteady)
3433  + ntimestepsrestart + 1
3434  end select
3435  end if
3436 
3438 
3439  if (eddyvisinfratio < zero) then
3440 
3441  ! Default value depends on the turbulence model.
3442 
3443  select case (turbmodel)
3444 
3446  eddyvisinfratio = 0.009_realtype
3447 
3448  case default
3449  eddyvisinfratio = 0.1_realtype
3450 
3451  end select
3452  end if
3453  !
3454  ! Determine the number of old grid levels needed for the BDF
3455  ! time integration of unsteady problems and allocate the memory
3456  ! for the coefficients. The actual values are not yet set,
3457  ! because in the first (and possibly second) time step a reduced
3458  ! order must be used, because the older states are not available
3459  ! yet. Also allocate the memory for the logicals to indicate
3460  ! whether or not old solutions have been written.
3461  ! If a Runge Kutta scheme must be used for the time integration,
3462  ! either explicit or implicit, a separate routine is called to
3463  ! set all the necessary variables.
3464  !
3465  select case (timeintegrationscheme)
3466  case (bdf, md)
3467 
3468  ! First check if the accuracy is okay.
3469 
3470  if (timeaccuracy > thirdorder) then
3471  if (myid == 0) then
3472  print "(a)", "#"
3473  print "(a)", "# Warning"
3474  print "(a)", "# Maximum third order possible for BDF."
3475  print "(a)", "# Order has been reduced to third."
3476  print "(a)", "#"
3477  end if
3478 
3480  end if
3481 
3482  ! Determine the accuracy and set nOldLevels accordingly.
3483 
3484  select case (timeaccuracy)
3485  case (firstorder)
3486  noldlevels = 1
3487 
3488  case (secondorder)
3489  noldlevels = 2
3490 
3491  case (thirdorder)
3492  noldlevels = 3
3493  end select
3494 
3495  ! Allocate the memory for coefTime.
3496  if (allocated(coeftime)) deallocate (coeftime)
3497  allocate (coeftime(0:noldlevels), stat=ierr)
3498  if (ierr /= 0) &
3499  call terminate("checkInputParam", &
3500  "Memory allocation error for coefTime")
3501 
3502  ! Determine the accuracy and set ALE parameters accordingly.
3503  if (useale) then
3504  select case (timeaccuracy)
3505  case (firstorder)
3506  nalemeshes = 1
3507  nalesteps = 2
3508 
3509  case (secondorder)
3510  nalemeshes = 2
3511  nalesteps = 4
3512 
3513  case (thirdorder)
3514  call terminate("checkInputParam", &
3515  "ALE can only use 1st and 2nd order time accuracy")
3516  end select
3517 
3518  if (allocated(coeftimeale)) deallocate (coeftimeale)
3519  allocate (coeftimeale(1:nalesteps), stat=ierr)
3520  if (ierr /= 0) &
3521  call terminate("checkInputParam", &
3522  "Memory allocation error for coefTimeALE")
3523 
3524  if (allocated(coefmeshale)) deallocate (coefmeshale)
3525  allocate (coefmeshale(1:nalemeshes, 2), stat=ierr)
3526  if (ierr /= 0) &
3527  call terminate("checkInputParam", &
3528  "Memory allocation error for coefMeshALE")
3529  end if
3530 
3531  !===============================================================
3532 
3533  case (explicitrk)
3534  noldlevels = 1
3536 
3537  end select
3538 
3539  ! Set the logicals whether or not the old solutions have been
3540  ! written. Note that this is only used for the second and
3541  ! higher order BDF schemes. However it is allocated with a
3542  ! minimum size of 1 to avoid problems.
3543 
3544  oldsolwrittensize = max(noldlevels - 1_inttype, 1_inttype)
3545 
3546  !check allocations for multipile succesive calls
3547  if (allocated(oldsolwritten)) deallocate (oldsolwritten)
3548  allocate (oldsolwritten(oldsolwrittensize), stat=ierr)
3549  if (ierr /= 0) &
3550  call terminate("checkInputParam", &
3551  "Memory allocation error for oldSolWritten")
3552 
3553  do nn = 1, oldsolwrittensize
3554  oldsolwritten(nn) = .false.
3555  end do
3556  !
3557  ! Determine the values of the runge kutta parameters, depending
3558  ! on the number of stages specified.
3559  !
3560  ! Limit the number of stages between 1 and 6 and allocate the
3561  ! memory.
3562 
3563  nrkstages = min(6_inttype, max(1_inttype, nrkstages))
3564 
3565  !check allocations for multipile succesive calls
3566  if (allocated(etark)) deallocate (etark)
3567  if (allocated(cdisrk)) deallocate (cdisrk)
3568 
3569  allocate (etark(nrkstages), cdisrk(nrkstages), stat=ierr)
3570  if (ierr /= 0) &
3571  call terminate("checkInputParam", &
3572  "Memory allocation error for etaRK and cdisRK")
3573 
3574  ! Determine the case we are having here.
3575 
3576  select case (nrkstages)
3577  case (1_inttype)
3578  etark(1) = one
3579 
3580  cdisrk(1) = one
3581 
3582  case (2_inttype)
3583  etark(1) = 0.2222_realtype
3584  etark(2) = one
3585 
3586  cdisrk(1) = one
3587  cdisrk(2) = one
3588 
3589  case (3_inttype)
3590  etark(1) = 0.2846_realtype
3591  etark(2) = 0.6067_realtype
3592  etark(3) = one
3593 
3594  cdisrk(1) = one
3595  cdisrk(2) = one
3596  cdisrk(3) = one
3597 
3598  case (4_inttype)
3599  etark(1) = 0.33333333_realtype
3600  etark(2) = 0.26666667_realtype
3601  etark(3) = 0.55555555_realtype
3602  etark(4) = one
3603 
3604  cdisrk(1) = one
3605  cdisrk(2) = half
3606  cdisrk(3) = zero
3607  cdisrk(4) = zero
3608 
3609  case (5_inttype)
3610  etark(1) = fourth
3611  etark(2) = 0.16666667_realtype !1/6
3612  etark(3) = 0.37500000_realtype !3/8
3613  etark(4) = half
3614  etark(5) = one
3615 
3616  cdisrk(1) = one
3617  cdisrk(2) = zero
3618  cdisrk(3) = 0.56_realtype
3619  cdisrk(4) = zero
3620  cdisrk(5) = 0.44_realtype
3621 
3622  case (6_inttype)
3623  etark(1) = 0.0722_realtype
3624  etark(2) = 0.1421_realtype
3625  etark(3) = 0.2268_realtype
3626  etark(4) = 0.3425_realtype
3627  etark(5) = 0.5349_realtype
3628  etark(6) = one
3629 
3630  cdisrk(1) = one
3631  cdisrk(2) = one
3632  cdisrk(3) = one
3633  cdisrk(4) = one
3634  cdisrk(5) = one
3635  cdisrk(6) = one
3636  end select
3637  !
3638  ! To avoid any problems later on, allocate the memory for the
3639  ! rigid body motion parameters if these values were not present
3640  ! in the parameter file.
3641  !
3642  if (.not. allocated(coefpolxrot)) then
3643  allocate (coefpolxrot(0:0), stat=ierr)
3644  if (ierr /= 0) &
3645  call terminate("checkInputParam", &
3646  "Memory allocation failure for coefPolXRot")
3647  coefpolxrot = zero
3648  end if
3649 
3650  if (.not. allocated(coefpolyrot)) then
3651  allocate (coefpolyrot(0:0), stat=ierr)
3652  if (ierr /= 0) &
3653  call terminate("checkInputParam", &
3654  "Memory allocation failure for coefPolYRot")
3655  coefpolyrot = zero
3656  end if
3657 
3658  if (.not. allocated(coefpolzrot)) then
3659  allocate (coefpolzrot(0:0), stat=ierr)
3660  if (ierr /= 0) &
3661  call terminate("checkInputParam", &
3662  "Memory allocation failure for coefPolZRot")
3663  coefpolzrot = zero
3664  end if
3665 
3666  if (.not. allocated(coscoeffourxrot)) then
3667  allocate (coscoeffourxrot(0:0), stat=ierr)
3668  if (ierr /= 0) &
3669  call terminate("checkInputParam", &
3670  "Memory allocation failure for &
3671  &cosCoefFourXRot")
3673  end if
3674 
3675  if (.not. allocated(sincoeffourxrot)) then
3676  allocate (sincoeffourxrot(1), stat=ierr)
3677  if (ierr /= 0) &
3678  call terminate("checkInputParam", &
3679  "Memory allocation failure for &
3680  &sinCoefFourXRot")
3682  end if
3683 
3684  if (.not. allocated(coscoeffouryrot)) then
3685  allocate (coscoeffouryrot(0:0), stat=ierr)
3686  if (ierr /= 0) &
3687  call terminate("checkInputParam", &
3688  "Memory allocation failure for &
3689  &cosCoefFourYRot")
3691  end if
3692 
3693  if (.not. allocated(sincoeffouryrot)) then
3694  allocate (sincoeffouryrot(1), stat=ierr)
3695  if (ierr /= 0) &
3696  call terminate("checkInputParam", &
3697  "Memory allocation failure for &
3698  &sinCoefFourYRot")
3700  end if
3701 
3702  if (.not. allocated(coscoeffourzrot)) then
3703  allocate (coscoeffourzrot(0:0), stat=ierr)
3704  if (ierr /= 0) &
3705  call terminate("checkInputParam", &
3706  "Memory allocation failure for &
3707  &cosCoefFourZRot")
3709  end if
3710 
3711  if (.not. allocated(sincoeffourzrot)) then
3712  allocate (sincoeffourzrot(1), stat=ierr)
3713  if (ierr /= 0) &
3714  call terminate("checkInputParam", &
3715  "Memory allocation failure for &
3716  &sinCoefFourZRot")
3718  end if
3719 
3720  ! Allocate the memory for cpmin_family. We had to wait until
3721  ! nTimeIntervalsSpectral was set.
3722  if (.not. allocated(cpmin_family)) then
3723  allocate (cpmin_family(ntimeintervalsspectral), stat=ierr)
3724  if (ierr /= 0) &
3725  call terminate("checkInputParam", &
3726  "Memory allocation failure for &
3727  &cpmin_family")
3728  cpmin_family = zero
3729  end if
3730 
3731  ! Allocate the memory for sepsenmaxfamily. We had to wait until
3732  ! nTimeIntervalsSpectral was set.
3733  if (.not. allocated(sepsenmaxfamily)) then
3734  allocate (sepsenmaxfamily(ntimeintervalsspectral), stat=ierr)
3735  if (ierr /= 0) &
3736  call terminate("checkInputParam", &
3737  "Memory allocation failure for &
3738  &sepSenMaxFamily")
3740  end if
3741 
3742  end subroutine checkinputparam
3743  subroutine setdefaultvalues
3744  !
3745  ! setDefaultValues sets the default values for the input
3746  ! parameters where-ever possible. The parameters that must be
3747  ! set by the user are initialized such a check can be performed
3748  ! later.
3749  !
3750  use constants
3751 
3752  ! --------- Bare imports...too many to list -------
3754  use inputio
3755  use inputiteration
3756  use inputmotion
3757  use inputoverset
3758  use inputparallel
3759  use inputphysics
3760  use inputtimespectral
3761  use inputunsteady
3762  use inputadjoint
3763  use inputtsstabderiv
3764  ! ------------------------------------------------
3765  use flowvarrefstate, only: lref, lrefspecified, pref, rhoref, &
3766  tinfdim, tref
3769  use killsignals, only: fatalfail, routinefailed
3771  use inputcostfunctions
3772  implicit none
3773 
3774  ! Initialize boundary condition warning print outs
3775  printbcwarnings = .true.
3776 
3777  ! Initialize monitoring the turbulent residuals as well as the
3778  ! monitoring of mass flow of the sliding interfaces to .false.
3779 
3780  mondturb = .false.
3781  monmasssliding = .false.
3782 
3783  ! Initialize the logicals to check whether or not monitoring,
3784  ! surface output and volume output variables were specified to
3785  ! .false.
3786 
3787  monitorspecified = .false.
3788  surfaceoutspecified = .false.
3789  volumeoutspecified = .false.
3790  isooutspecified = .false.
3791  !
3792  ! Set the default values for the discretization parameters.
3793  !
3794  spacediscr = none ! Serves as a check later on.
3795  orderturb = firstorder ! First order discretization.
3796  ! Of turbulent advective terms.
3797  riemann = roe
3798  limiter = nolimiter ! No limiter in upwind schemes.
3799  precond = noprecond ! No preconditioning.
3800 
3801  eulerwallbctreatment = normalmomentum ! Normal momentum equation is
3802  ! Used to determine ghost
3803  ! cell pressure.
3804 
3805  viscwallbctreatment = constantpressure ! Normal momentum equation is
3806  ! Used to determine ghost
3807  ! cell pressure.
3808 
3809  outflowtreatment = constantextrapol ! Constant extrapolation at
3810  ! outflow boundaries.
3811 
3812  spacediscrcoarse = none ! Serves as a check. If nothing
3813  riemanncoarse = none ! is specified the fine grid
3814  ! parameter is taken.
3815 
3816  nonmatchtreatment = nonconservative ! Non conservative treatment
3817  ! of non-matching block to
3818  ! block boundaries.
3819 
3820  vortexcorr = .false. ! No vortex correction is
3821  ! applied.
3822 
3823  vis2 = half
3824  vis4 = one / 64.0_realtype
3825  vis2coarse = half
3826 
3827  dirscaling = .true. ! Apply isotropic directional
3828  adis = two * third ! scaling in the artificial
3829  ! dissipation schemes.
3830 
3831  hscalinginlet = .false. ! No total enthalpy scaling.
3832 
3833  kappacoef = third
3834  !
3835  ! Set the default values for the IO-parameters.
3836 
3837  gridfile = "" ! Serves as a check later on.
3838 
3839  checkrestartsol = .true. ! Restart solution is checked for
3840  ! correct nonDimensionalization.
3841 
3842  newgridfile = "" ! This will be corrected later on
3843  solfile = "" ! if nothing is specified. The
3844  ! default names depend on the
3845  ! format used
3846 
3847  surfacesolfile = "" ! This will be corrected later if no
3848  ! surface solution file is specified.
3849 
3850  storerindlayer = .true. ! No halo cells in solution files.
3851 
3852  autoparameterupdate = .true. ! Update the input parameter file
3853  ! when a restart file is written.
3854  writecoormeter = .false. ! Use original coordinate units
3855  ! when writing solution files.
3856 
3857  cpfile = "" ! Serves as a check later on.
3858 
3859  storeconvinneriter = .false. ! Do not store the convergence of
3860  ! iterations(inner iterations in unsteady mode).
3861 
3862 #ifdef USE_SINGLE_PRECISION
3863  precisiongrid = precisionsingle ! Default IO precision depends
3864  precisionsol = precisionsingle ! on the default floating
3865  ! point type used. Note that
3866 #else
3867  precisiongrid = precisiondouble ! for quadrupole precision the
3868  precisionsol = precisiondouble ! IO takes place in double
3869  ! precision.
3870 #endif
3871 
3872  ! Surface solution defaults to single precision
3875 
3876  !
3877  ! Set the default values for the iteration parameters.
3878  !
3879  ncycles = -1 ! Serves as a check later on.
3880  nsgstartup = 0 ! No single grid startup iterations.
3881  nsubiterturb = 0 ! No additional turbulent subiterations.
3882  nupdatebleeds = 50 ! Update the bleeds every 50 iterations.
3883 
3884  nsavevolume = 1 ! Only save at the end of the computation.
3885  nsavesurface = 1
3886 
3887  smoother = none
3888  nrkstages = 5
3889  nsubiterations = 1
3890 
3891  !resAveraging = noResAveraging ! No residual averaging.
3893  smoop = 1.5_realtype
3894 
3895  turbtreatment = decoupled ! Decoupled solver for the
3896  ! turbulent equations
3897  turbsmoother = adi ! solved using an adi scheme.
3898  freezeturbsource = .true. ! Freeze the coarse grid source
3899  ! terms for a coupled solver.
3900  turbrelax = turbrelaxnotdefined ! Will be set later, depending
3901  ! on the turbulence model.
3902 
3903  cfl = -one ! Serves as a check later on.
3904 
3905  relaxbleeds = 0.1_realtype ! Relaxation factor for the
3906  ! bleed boundary conditions.
3907 
3908  alfaturb = 0.8_realtype
3909  betaturb = -one ! Serves as a check later on.
3910 
3911  l2conv = 1.e-6_realtype ! Six orders of magnitude for
3912  ! convergence.
3913  l2convcoarse = 1.e-2_realtype ! Only two on coarse grids in
3914  ! full mg.
3915 
3916  maxl2deviationfactor = 1_realtype
3917  ncyclescoarse = -1 ! If these parameters are not
3918  cflcoarse = -one ! specified the corresponding fine
3919  ! grid values are taken.
3920 
3921  fcoll = one ! No relaxation when restricting the residuals.
3922 
3923  mgboundcorr = bcdirichlet0 ! Zero out the boundary halo's for
3924  ! the multigrid corrections.
3925 
3926  mgstartlevel = -1 ! Start at the coarsest grid of the mg cycle
3927  ! when no restart is performed.
3928  mgdescription = "sg" ! Single grid computation.
3929  !
3930  ! Set the default values for the motion parameters,
3931  ! i.e. no motion.
3932  !
3933  ! Translation data.
3934 
3935  ! Rotation data.
3936 
3937  rotpoint = zero
3938 
3939  degreepolxrot = -1 ! -1, because the start index is 0.
3940  degreepolyrot = -1
3941  degreepolzrot = -1
3942 
3943  degreefourxrot = -1 ! -1, because the start index is 0,
3944  ! at least of the cosine part.
3945  degreefouryrot = -1
3946  degreefourzrot = -1
3947 
3951 
3952  ! The logical to determine whether or not a motion is specified.
3953  ! Initialize it to .false.
3954 
3955  gridmotionspecified = .false.
3956  !
3957  ! Set the default values for the parallel parameters.
3958  !
3959  loadimbalance = 0.1_realtype ! Allow 10 percent load imbalance.
3960  splitblocks = .true. ! Allow the splitting of blocks to
3961  ! obtain a better load balancing.
3962  loadbalanceiter = 2 ! Do two iterations
3963  !
3964  ! Set the default values for the physics parameters.
3965  !
3966  equations = none ! These are parameters that must be
3967  equationmode = none ! specified. If not, the program
3968  flowtype = none ! exits.
3969  turbmodel = none
3970 
3971  cpmodel = cpconstant ! Constant cp.
3972 
3973  turbprod = strain ! Strain is used in the production
3974  ! term of transport turbulence models.
3975 
3976  wallfunctions = .false. ! No wall functions used.
3977 
3978  mach = -one ! Both parameters must be specified
3979  reynolds = -one ! for external flows. The -1. serves
3980  ! as a check later on.
3981 
3982  machcoef = -one ! If not specified MachCoef will
3983  ! be set to Mach.
3984 
3985  veldirfreestream(1) = one ! Free stream velocity
3986  veldirfreestream(2) = zero ! is specified in the
3987  veldirfreestream(3) = zero ! x-axis direction.
3988 
3989  liftdirspecified = .false. ! Lift direction not specified.
3990 
3992  tinfdim = 288.15_realtype
3993  gammaconstant = 1.4_realtype
3994  rgasdim = 287.87_realtype
3995 
3996  prandtl = 0.72_realtype
3997  prandtlturb = 0.90_realtype
3998  pklim = 20.0_realtype
3999  walloffset = zero
4000 
4001  ssuthdim = 110.55_realtype
4002  musuthdim = 1.716e-5_realtype
4003  tsuthdim = 273.15_realtype
4004 
4005  rvfn = 1 ! Version 1 of the v2f
4006  ! model is used.
4007  rvfb = .true. ! An upper bound is used
4008  ! in the v2f scales.
4009  eddyvisinfratio = -one ! Default value depends on
4010  ! the turbulence model.
4011  turbintensityinf = 0.001_realtype
4012 
4013  surfaceref = one
4014  lengthref = one
4015 
4016  pointref(1) = zero
4017  pointref(2) = zero
4018  pointref(3) = zero
4019 
4020  momentaxis(1, 1) = zero
4021  momentaxis(1, 2) = one
4022  momentaxis(2, 1) = zero
4023  momentaxis(2, 2) = zero
4024  momentaxis(3, 1) = zero
4025  momentaxis(3, 2) = zero
4026 
4027  !
4028  ! Set the default values for the time spectral parameters.
4029  !
4030  ntimeintervalsspectral = -1 ! Serves as a check later on.
4031 
4032  nunsteadysolspectral = -1 ! Serves as a check later on.
4033 
4034  writeunsteadyvolspectral = .false. ! No writing of the files
4035  writeunsteadysurfspectral = .false. ! for postprocessing.
4036 
4037  writeunsteadyrestartspectral = .false. ! No writing of an unsteady
4038  ! mode restart file.
4039 
4040  dtunsteadyrestartspectral = -one ! Is checked later on.
4041  !
4042  ! Set the default values for the unsteady parameters.
4043  !
4044  timeaccuracy = secondorder ! Second order time accuracy.
4045 
4046  ntimestepscoarse = -1 ! Serves as a check later on.
4047  ntimestepsfine = -1 ! Serves as a check later on.
4048 
4049  deltat = -one ! Serves as a check later on.
4050 
4051  useale = .true. ! Use the ALE scheme by default.
4052 
4053  updatewalldistanceunsteady = .true. ! This default value is
4054  ! overruled for models that
4055  ! are wall distance free.
4056  !
4057  ! The reference state variables. Set them to -1, such that they
4058  ! can be checked later on.
4059  !
4060  pref = -one
4061  rhoref = -one
4062  tref = -one
4063  !
4064  ! The conversion factor of the grid units to meters. Default 1.
4065  !
4066  lref = one
4067  lrefspecified = .false.
4068  !
4069  ! Initialization of some unsteady restart parameters. These will
4070  ! be overwritten when an actual unsteady restart is performed.
4071  !
4072  noldsolavail = 1
4073  ntimestepsrestart = 0
4075  !
4076  ! Variables needed for the writing of grid and solution files.
4077  !
4079 
4080  ! Additional Paramters Requiring Defaults
4081  printiterations = .true.
4082  routinefailed = .false.
4083  fatalfail = .false.
4084  lumpeddiss = .false.
4085  approxsa = .false.
4086  useapproxwalldistance = .false.
4087  updatewallassociations = .false.
4088  recomputeoverlapmatrix = .true.
4089  cfllimit = 3.0
4090  adjointpetscvarsallocated = .false.
4092  usematrixfreedrdw = .false.
4093  end subroutine setdefaultvalues
4094 
4095  subroutine initializeisosurfacevariables(values, nValues)
4096  !
4097  ! isoVariables extracts from the given string the extra
4098  ! iso surface variables to be written to the solution file.
4099  !
4100  use constants
4102  implicit none
4103  !
4104  ! Subroutine arguments.
4105  !
4106  integer(kind=intType), intent(in) :: nValues
4107  real(kind=realtype), dimension(nValues), intent(in) :: values
4108 
4109  ! Basically just copy into module
4110  if (allocated(isovalues)) then
4111  deallocate (isovalues)
4112  end if
4113 
4114  if (allocated(isosurfacenames)) then
4115  deallocate (isosurfacenames)
4116  end if
4117 
4118  nisosurface = nvalues
4119  allocate (isovalues(nisosurface))
4120  allocate (isosurfacenames(nisosurface))
4121 
4122  isovalues = values
4123 
4124  end subroutine initializeisosurfacevariables
4125 
4126  subroutine setisosurfacevariable(variable, iVar)
4127 
4128  ! Set variable to iVar. initializeIsoSurfaceVariables MUST be called
4129  ! first with the desired number of values to set.
4130 
4131  use constants
4132  use cgnsnames
4133  use extraoutput
4134  use communication, only: myid
4135  use utils, only: echk
4136  implicit none
4137  !
4138  ! Subroutine arguments.
4139  !
4140  character(len=*), intent(in) :: variable
4141  integer(kind=intType) :: iVar
4142 
4143  select case (variable)
4144  case ("rho")
4146  case ("vx")
4147  isosurfacenames(ivar) = cgnsvelx
4148  case ("vy")
4149  isosurfacenames(ivar) = cgnsvely
4150  case ("vz")
4151  isosurfacenames(ivar) = cgnsvelz
4152  case ("P")
4154  case ("mx")
4155  isosurfacenames(ivar) = cgnsmomx
4156  case ("my")
4157  isosurfacenames(ivar) = cgnsmomy
4158  case ("mz")
4159  isosurfacenames(ivar) = cgnsmomz
4160  case ("rvx")
4162  case ("rvy")
4164  case ("rvz")
4166  case ("rhoe")
4167  isosurfacenames(ivar) = cgnsenergy
4168  case ("temp")
4169  isosurfacenames(ivar) = cgnstemp
4170  case ("vort")
4172  case ("vortx")
4173  isosurfacenames(ivar) = cgnsvortx
4174  case ("vorty")
4175  isosurfacenames(ivar) = cgnsvorty
4176  case ("vortz")
4177  isosurfacenames(ivar) = cgnsvortz
4178  case ("cp")
4179  isosurfacenames(ivar) = cgnscp
4180  case ("mach")
4181  isosurfacenames(ivar) = cgnsmach
4182  case ("rmach")
4184  case ("macht")
4186  case ("ptloss")
4188  case ("eddy")
4189  isosurfacenames(ivar) = cgnseddy
4190  case ("eddyratio")
4192  case ("dist")
4194  case ("resrho")
4195  isosurfacenames(ivar) = cgnsresrho
4196  case ("shock")
4197  isosurfacenames(ivar) = cgnsshock
4198  case ("filteredShock")
4200  case default
4201 
4202  if (myid == 0) Then
4203  print *, 'Error: ', variable, 'cannot be used as an isoSurface'
4204  end if
4205  call echk(-99, __file__, __line__)
4206  end select
4207  end subroutine setisosurfacevariable
4208 
4209 end module inputparamroutines
logical adjointpetscvarsallocated
logical adjointpetscpreprocvarsallocated
character(len=maxcgnsnamelen), parameter cgnscl
Definition: cgnsNames.f90:235
character(len=maxcgnsnamelen), parameter cgnsl2resrho
Definition: cgnsNames.f90:208
character(len=maxcgnsnamelen), parameter cgnsrelvely
Definition: cgnsNames.f90:60
character(len=maxcgnsnamelen), parameter cgnsmachmax
Definition: cgnsNames.f90:265
character(len=maxcgnsnamelen), parameter cgnsl2resmomy
Definition: cgnsNames.f90:212
character(len=maxcgnsnamelen), parameter cgnscmy
Definition: cgnsNames.f90:256
character(len=maxcgnsnamelen), parameter cgnsyplusmax
Definition: cgnsNames.f90:267
character(len=maxcgnsnamelen), parameter cgnsl2resk
Definition: cgnsNames.f90:220
character(len=maxcgnsnamelen), parameter cgnscmx
Definition: cgnsNames.f90:254
character(len=maxcgnsnamelen), parameter cgnsmomz
Definition: cgnsNames.f90:33
character(len=maxcgnsnamelen), parameter cgnscfy
Definition: cgnsNames.f90:250
character(len=maxcgnsnamelen), parameter cgnsresrho
Definition: cgnsNames.f90:181
character(len=maxcgnsnamelen), parameter cgnssepsensorksarea
Definition: cgnsNames.f90:280
character(len=maxcgnsnamelen), parameter cgnsrelmach
Definition: cgnsNames.f90:76
character(len=maxcgnsnamelen), parameter cgnsdensity
Definition: cgnsNames.f90:27
character(len=maxcgnsnamelen), parameter cgnsl2resrhoe
Definition: cgnsNames.f90:216
character(len=maxcgnsnamelen), parameter cgnsshock
Definition: cgnsNames.f90:163
character(len=maxcgnsnamelen), parameter cgnsaxismoment
Definition: cgnsNames.f90:282
character(len=maxcgnsnamelen), parameter cgnsl2resv2
Definition: cgnsNames.f90:228
character(len=maxcgnsnamelen), parameter cgnsvelz
Definition: cgnsNames.f90:56
character(len=maxcgnsnamelen), parameter cgnsvortmagn
Definition: cgnsNames.f90:90
character(len=maxcgnsnamelen), parameter cgnsl2resmomx
Definition: cgnsNames.f90:210
character(len=maxcgnsnamelen), parameter cgnsl2resmomz
Definition: cgnsNames.f90:214
character(len=maxcgnsnamelen), parameter cgnsfilteredshock
Definition: cgnsNames.f90:166
character(len=maxcgnsnamelen), parameter cgnseddyratio
Definition: cgnsNames.f90:86
character(len=maxcgnsnamelen), parameter cgnstemp
Definition: cgnsNames.f90:70
character(len=maxcgnsnamelen), parameter cgnsmomy
Definition: cgnsNames.f90:31
character(len=maxcgnsnamelen), parameter cgnsvely
Definition: cgnsNames.f90:54
character(len=maxcgnsnamelen), parameter cgnsl2resomega
Definition: cgnsNames.f90:222
character(len=maxcgnsnamelen), parameter cgnsmachturb
Definition: cgnsNames.f90:78
character(len=maxcgnsnamelen), parameter cgnsl2restau
Definition: cgnsNames.f90:224
character(len=maxcgnsnamelen), parameter cgnseddy
Definition: cgnsNames.f90:84
character(len=maxcgnsnamelen), parameter cgnsclv
Definition: cgnsNames.f90:239
character(len=maxcgnsnamelen), parameter cgnssepsensor
Definition: cgnsNames.f90:278
character(len=maxcgnsnamelen), parameter cgnsvorty
Definition: cgnsNames.f90:94
character(len=maxcgnsnamelen), parameter cgnsclp
Definition: cgnsNames.f90:237
character(len=maxcgnsnamelen), parameter cgnsptotloss
Definition: cgnsNames.f90:98
character(len=maxcgnsnamelen), parameter cgnscmz
Definition: cgnsNames.f90:258
character(len=maxcgnsnamelen), parameter cgnscavitation
Definition: cgnsNames.f90:281
character(len=maxcgnsnamelen), parameter cgnsvortx
Definition: cgnsNames.f90:92
character(len=maxcgnsnamelen), parameter cgnseddymax
Definition: cgnsNames.f90:269
character(len=maxcgnsnamelen), parameter cgnsvelx
Definition: cgnsNames.f90:52
character(len=maxcgnsnamelen), parameter cgnsrelvelx
Definition: cgnsNames.f90:58
character(len=maxcgnsnamelen), parameter cgnsl2resf
Definition: cgnsNames.f90:230
character(len=maxcgnsnamelen), parameter cgnsrelvelz
Definition: cgnsNames.f90:62
character(len=maxcgnsnamelen), parameter cgnscd
Definition: cgnsNames.f90:241
character(len=maxcgnsnamelen), parameter cgnscp
Definition: cgnsNames.f90:72
character(len=maxcgnsnamelen), parameter cgnsmomx
Definition: cgnsNames.f90:29
character(len=maxcgnsnamelen), parameter cgnscfz
Definition: cgnsNames.f90:252
character(len=maxcgnsnamelen), parameter cgnscdp
Definition: cgnsNames.f90:243
character(len=maxcgnsnamelen), parameter cgnsl2resepsilon
Definition: cgnsNames.f90:226
character(len=maxcgnsnamelen), parameter cgnshdiffmax
Definition: cgnsNames.f90:263
character(len=maxcgnsnamelen), parameter cgnsenergy
Definition: cgnsNames.f90:35
character(len=maxcgnsnamelen), parameter cgnspressure
Definition: cgnsNames.f90:68
character(len=maxcgnsnamelen), parameter cgnsl2resnu
Definition: cgnsNames.f90:218
character(len=maxcgnsnamelen), parameter cgnsvortz
Definition: cgnsNames.f90:96
character(len=maxcgnsnamelen), parameter cgnscdv
Definition: cgnsNames.f90:245
character(len=maxcgnsnamelen), parameter cgnsmach
Definition: cgnsNames.f90:74
character(len=maxcgnsnamelen), parameter cgnscfx
Definition: cgnsNames.f90:248
character(len=maxcgnsnamelen), parameter cgnswalldist
Definition: cgnsNames.f90:88
integer adflow_comm_world
integer(kind=inttype), parameter strain
Definition: constants.F90:137
integer(kind=inttype), parameter spalartallmarasedwards
Definition: constants.F90:128
integer(kind=inttype), parameter spalartallmaras
Definition: constants.F90:128
integer(kind=inttype), parameter roe
Definition: constants.F90:155
integer(kind=inttype), parameter firstorder
Definition: constants.F90:142
integer(kind=inttype), parameter nonconservative
Definition: constants.F90:180
integer(kind=inttype), parameter cptempcurvefits
Definition: constants.F90:124
real(kind=realtype), parameter zero
Definition: constants.F90:71
integer(kind=inttype), parameter precisiondouble
Definition: constants.F90:184
integer(kind=inttype), parameter constantextrapol
Definition: constants.F90:176
real(kind=realtype), parameter third
Definition: constants.F90:81
integer(kind=inttype), parameter constantpressure
Definition: constants.F90:170
real(kind=realtype), parameter eps
Definition: constants.F90:23
integer(kind=inttype), parameter ktau
Definition: constants.F90:128
integer(kind=inttype), parameter md
Definition: constants.F90:189
integer(kind=inttype), parameter decoupled
Definition: constants.F90:207
integer(kind=inttype), parameter komegawilcox
Definition: constants.F90:128
integer(kind=inttype), parameter eulerequations
Definition: constants.F90:110
integer(kind=inttype), parameter timespectral
Definition: constants.F90:115
integer(kind=inttype), parameter komegamodified
Definition: constants.F90:128
integer(kind=inttype), parameter unsteady
Definition: constants.F90:115
integer(kind=inttype), parameter precisionsingle
Definition: constants.F90:184
integer(kind=inttype), parameter bcdirichlet0
Definition: constants.F90:214
integer(kind=inttype), parameter turbrelaxnotdefined
Definition: constants.F90:223
integer(kind=inttype), parameter noresaveraging
Definition: constants.F90:218
integer(kind=inttype), parameter noprecond
Definition: constants.F90:165
integer(kind=inttype), parameter bdf
Definition: constants.F90:189
real(kind=realtype), parameter one
Definition: constants.F90:72
integer, parameter maxstringlen
Definition: constants.F90:16
real(kind=realtype), parameter half
Definition: constants.F90:80
integer(kind=inttype), parameter turbrelaximplicit
Definition: constants.F90:223
integer(kind=inttype), parameter turbrelaxexplicit
Definition: constants.F90:223
integer(kind=inttype), parameter steady
Definition: constants.F90:115
integer(kind=inttype), parameter adi
Definition: constants.F90:210
real(kind=realtype), parameter two
Definition: constants.F90:73
integer(kind=inttype), parameter cpconstant
Definition: constants.F90:124
integer(kind=inttype), parameter explicitrk
Definition: constants.F90:189
real(kind=realtype), parameter fourth
Definition: constants.F90:82
integer(kind=inttype), parameter nolimiter
Definition: constants.F90:160
integer(kind=inttype), parameter mentersst
Definition: constants.F90:128
integer(kind=inttype), parameter thirdorder
Definition: constants.F90:142
integer(kind=inttype), parameter nsequations
Definition: constants.F90:110
integer(kind=inttype), parameter secondorder
Definition: constants.F90:142
integer(kind=inttype), parameter dissscalar
Definition: constants.F90:149
integer(kind=inttype), parameter externalflow
Definition: constants.F90:120
integer(kind=inttype), parameter ransequations
Definition: constants.F90:110
integer(kind=inttype), parameter normalmomentum
Definition: constants.F90:170
integer(kind=inttype), parameter internalflow
Definition: constants.F90:120
integer(kind=inttype), parameter v2f
Definition: constants.F90:128
real(kind=realtype) cvn
Definition: CpCurveFits.f90:58
real(kind=realtype), dimension(:), allocatable cptrange
Definition: CpCurveFits.f90:46
integer(kind=inttype) cpnparts
Definition: CpCurveFits.f90:44
real(kind=realtype), dimension(:), allocatable cphint
Definition: CpCurveFits.f90:48
real(kind=realtype) cv0
Definition: CpCurveFits.f90:58
type(cptempfittype), dimension(:), allocatable cptempfit
Definition: CpCurveFits.f90:49
real(kind=realtype), dimension(:), allocatable cpeint
Definition: CpCurveFits.f90:47
logical volwritervy
Definition: extraOutput.f90:30
logical volwritemy
Definition: extraOutput.f90:29
logical surfwritemach
Definition: extraOutput.f90:18
logical surfwritecavitation
Definition: extraOutput.f90:23
logical isowritevortx
Definition: extraOutput.f90:51
real(kind=realtype), dimension(:), allocatable isovalues
Definition: extraOutput.f90:61
logical isowritevz
Definition: extraOutput.f90:45
logical surfwritevy
Definition: extraOutput.f90:16
logical volwritegc
Definition: extraOutput.f90:38
logical volwriteintermittency
Definition: extraOutput.f90:39
logical surfwritecfx
Definition: extraOutput.f90:21
logical surfwritegc
Definition: extraOutput.f90:23
logical surfwriteyplus
Definition: extraOutput.f90:20
logical volwriteblank
Definition: extraOutput.f90:37
logical volwriteshock
Definition: extraOutput.f90:38
logical volwritermach
Definition: extraOutput.f90:33
logical isowritecp
Definition: extraOutput.f90:48
logical surfwriteforceindragdir
Definition: extraOutput.f90:24
logical isowritetemp
Definition: extraOutput.f90:48
logical surfwriteblank
Definition: extraOutput.f90:22
logical isowriterhoe
Definition: extraOutput.f90:48
logical isowritemx
Definition: extraOutput.f90:46
logical volwritervz
Definition: extraOutput.f90:30
logical isowriteeddyvis
Definition: extraOutput.f90:49
logical volwritedist
Definition: extraOutput.f90:34
logical isowritevortz
Definition: extraOutput.f90:52
logical volwritevorty
Definition: extraOutput.f90:35
logical isowritemach
Definition: extraOutput.f90:49
logical surfwritecfy
Definition: extraOutput.f90:21
logical volwriteresmom
Definition: extraOutput.f90:36
logical surfwritesepsensorks
Definition: extraOutput.f90:22
logical isowriteratioeddyvis
Definition: extraOutput.f90:51
logical surfwritecfz
Definition: extraOutput.f90:21
logical surfwritervx
Definition: extraOutput.f90:17
logical isowritervx
Definition: extraOutput.f90:47
logical volwriterhoe
Definition: extraOutput.f90:31
logical volwriteresrhoe
Definition: extraOutput.f90:37
logical surfwriteforceinliftdir
Definition: extraOutput.f90:24
logical isowriteresmom
Definition: extraOutput.f90:53
logical volwriteratioeddyvis
Definition: extraOutput.f90:34
logical volwriteresrho
Definition: extraOutput.f90:36
logical volwritestatus
Definition: extraOutput.f90:38
logical isowriteturb
Definition: extraOutput.f90:45
logical surfwritervz
Definition: extraOutput.f90:17
logical isowriteresturb
Definition: extraOutput.f90:54
logical isowriteresrhoe
Definition: extraOutput.f90:54
logical isowritermach
Definition: extraOutput.f90:50
logical isowriteshock
Definition: extraOutput.f90:55
logical isowriteblank
Definition: extraOutput.f90:54
logical surfwritevx
Definition: extraOutput.f90:16
logical isowritevx
Definition: extraOutput.f90:44
logical volwritecp
Definition: extraOutput.f90:31
logical volwriteptotloss
Definition: extraOutput.f90:36
logical surfwritep
Definition: extraOutput.f90:15
logical volwritemachturb
Definition: extraOutput.f90:32
logical surfwritesepsensorksarea
Definition: extraOutput.f90:22
logical isowriteptotloss
Definition: extraOutput.f90:53
logical isowritevorty
Definition: extraOutput.f90:52
logical volwriteeddyvis
Definition: extraOutput.f90:32
logical volwritemx
Definition: extraOutput.f90:29
logical volwritemach
Definition: extraOutput.f90:32
logical isowritep
Definition: extraOutput.f90:45
logical volwritervx
Definition: extraOutput.f90:30
logical surfwriteptotloss
Definition: extraOutput.f90:18
logical surfwritecf
Definition: extraOutput.f90:20
logical surfwritervy
Definition: extraOutput.f90:17
logical isowritemy
Definition: extraOutput.f90:46
logical surfwritesepsensor
Definition: extraOutput.f90:22
logical isowritefilteredshock
Definition: extraOutput.f90:55
logical surfwriteaxismoment
Definition: extraOutput.f90:23
logical isowritedist
Definition: extraOutput.f90:51
logical volwritevort
Definition: extraOutput.f90:35
logical isowritervy
Definition: extraOutput.f90:47
logical volwritemz
Definition: extraOutput.f90:29
logical volwritevortx
Definition: extraOutput.f90:34
logical surfwritevz
Definition: extraOutput.f90:16
logical volwriteresturb
Definition: extraOutput.f90:37
logical isowriterho
Definition: extraOutput.f90:44
logical isowritevort
Definition: extraOutput.f90:52
logical isowritervz
Definition: extraOutput.f90:47
logical surfwritermach
Definition: extraOutput.f90:19
character(len=maxcgnsnamelen), dimension(:), allocatable isosurfacenames
Definition: extraOutput.f90:62
logical volwritetemp
Definition: extraOutput.f90:31
logical volwritefilteredshock
Definition: extraOutput.f90:38
integer(kind=inttype) nisosurface
Definition: extraOutput.f90:60
logical surfwritech
Definition: extraOutput.f90:20
logical isowritemz
Definition: extraOutput.f90:46
logical volwritevortz
Definition: extraOutput.f90:35
logical isowriteresrho
Definition: extraOutput.f90:53
logical surfwritetemp
Definition: extraOutput.f90:15
logical isowritemachturb
Definition: extraOutput.f90:49
logical surfwriterho
Definition: extraOutput.f90:15
logical surfwritecp
Definition: extraOutput.f90:18
logical isowritevy
Definition: extraOutput.f90:44
integer(kind=inttype) nt1
real(kind=realtype) tinfdim
integer(kind=inttype) nwt
real(kind=realtype) rhoref
integer(kind=inttype) nwf
real(kind=realtype) tref
integer(kind=inttype) nw
real(kind=realtype) lref
real(kind=realtype) pref
integer(kind=inttype) nt2
logical usematrixfreedrdw
Definition: inputParam.F90:853
real(kind=realtype) vis2
Definition: inputParam.F90:78
logical radiineededcoarse
Definition: inputParam.F90:92
logical updatewallassociations
Definition: inputParam.F90:95
real(kind=realtype) vis2coarse
Definition: inputParam.F90:78
integer(kind=inttype) eulerwallbctreatment
Definition: inputParam.F90:75
integer(kind=inttype) orderturb
Definition: inputParam.F90:73
real(kind=realtype) adis
Definition: inputParam.F90:78
integer(kind=inttype) riemanncoarse
Definition: inputParam.F90:74
logical useapproxwalldistance
Definition: inputParam.F90:94
real(kind=realtype) vis4
Definition: inputParam.F90:78
real(kind=realtype) kappacoef
Definition: inputParam.F90:80
integer(kind=inttype) nonmatchtreatment
Definition: inputParam.F90:76
integer(kind=inttype) viscwallbctreatment
Definition: inputParam.F90:75
integer(kind=inttype) outflowtreatment
Definition: inputParam.F90:75
integer(kind=inttype) riemann
Definition: inputParam.F90:74
integer(kind=inttype) limiter
Definition: inputParam.F90:73
integer(kind=inttype) precond
Definition: inputParam.F90:74
integer(kind=inttype) spacediscrcoarse
Definition: inputParam.F90:72
integer(kind=inttype) spacediscr
Definition: inputParam.F90:72
logical storeconvinneriter
Definition: inputParam.F90:166
character(len=maxstringlen) solfile
Definition: inputParam.F90:160
character(len=maxstringlen) surfacesolfile
Definition: inputParam.F90:162
logical storerindlayer
Definition: inputParam.F90:164
character(len=maxstringlen) cpfile
Definition: inputParam.F90:162
character(len=maxstringlen) newgridfile
Definition: inputParam.F90:159
integer(kind=inttype) precisionsurfsol
Definition: inputParam.F90:157
integer(kind=inttype) precisionsol
Definition: inputParam.F90:156
character(len=maxstringlen) gridfile
Definition: inputParam.F90:158
logical autoparameterupdate
Definition: inputParam.F90:165
logical checkrestartsol
Definition: inputParam.F90:164
integer(kind=inttype) precisionsurfgrid
Definition: inputParam.F90:157
logical writecoormeter
Definition: inputParam.F90:165
integer(kind=inttype) precisiongrid
Definition: inputParam.F90:156
real(kind=realtype) betaturb
Definition: inputParam.F90:276
integer(kind=inttype) ncycles
Definition: inputParam.F90:262
integer(kind=inttype) smoother
Definition: inputParam.F90:264
real(kind=realtype) cflcoarse
Definition: inputParam.F90:275
integer(kind=inttype) nmgsteps
Definition: inputParam.F90:271
integer(kind=inttype) mgstartlevel
Definition: inputParam.F90:270
real(kind=realtype) maxl2deviationfactor
Definition: inputParam.F90:279
integer(kind=inttype) turbtreatment
Definition: inputParam.F90:269
integer(kind=inttype) nsavesurface
Definition: inputParam.F90:263
real(kind=realtype), dimension(:), allocatable cdisrk
Definition: inputParam.F90:283
character(len=maxstringlen) mgdescription
Definition: inputParam.F90:284
integer(kind=inttype) nsubiterturb
Definition: inputParam.F90:266
real(kind=realtype) smoop
Definition: inputParam.F90:275
real(kind=realtype) l2conv
Definition: inputParam.F90:277
logical printbcwarnings
Definition: inputParam.F90:292
integer(kind=inttype), dimension(:), allocatable cyclestrategy
Definition: inputParam.F90:273
integer(kind=inttype) nupdatebleeds
Definition: inputParam.F90:266
integer(kind=inttype) resaveraging
Definition: inputParam.F90:267
integer(kind=inttype) ncyclescoarse
Definition: inputParam.F90:262
integer(kind=inttype) nsubiterations
Definition: inputParam.F90:265
real(kind=realtype) cfllimit
Definition: inputParam.F90:268
integer(kind=inttype) nsavevolume
Definition: inputParam.F90:263
real(kind=realtype), dimension(:), allocatable etark
Definition: inputParam.F90:283
real(kind=realtype) l2convcoarse
Definition: inputParam.F90:277
real(kind=realtype) relaxbleeds
Definition: inputParam.F90:280
integer(kind=inttype) mgboundcorr
Definition: inputParam.F90:270
real(kind=realtype) fcoll
Definition: inputParam.F90:275
integer(kind=inttype) nrkstages
Definition: inputParam.F90:264
integer(kind=inttype) nmglevels
Definition: inputParam.F90:271
real(kind=realtype) alfaturb
Definition: inputParam.F90:276
logical printiterations
Definition: inputParam.F90:288
real(kind=realtype) cfl
Definition: inputParam.F90:275
integer(kind=inttype) turbsmoother
Definition: inputParam.F90:269
integer(kind=inttype) nsgstartup
Definition: inputParam.F90:264
logical freezeturbsource
Definition: inputParam.F90:287
integer(kind=inttype) turbrelax
Definition: inputParam.F90:269
integer(kind=inttype) degreefouryrot
Definition: inputParam.F90:354
integer(kind=inttype) degreefourxrot
Definition: inputParam.F90:353
integer(kind=inttype) degreepolxrot
Definition: inputParam.F90:337
real(kind=realtype) omegafouryrot
Definition: inputParam.F90:363
integer(kind=inttype) degreepolyrot
Definition: inputParam.F90:338
real(kind=realtype), dimension(:), allocatable coefpolxrot
Definition: inputParam.F90:345
real(kind=realtype) omegafourzrot
Definition: inputParam.F90:364
real(kind=realtype) omegafourxrot
Definition: inputParam.F90:362
real(kind=realtype), dimension(:), allocatable sincoeffouryrot
Definition: inputParam.F90:385
real(kind=realtype), dimension(:), allocatable coscoeffourxrot
Definition: inputParam.F90:373
real(kind=realtype), dimension(:), allocatable sincoeffourzrot
Definition: inputParam.F90:386
integer(kind=inttype) degreepolzrot
Definition: inputParam.F90:339
logical gridmotionspecified
Definition: inputParam.F90:481
real(kind=realtype), dimension(:), allocatable coscoeffouryrot
Definition: inputParam.F90:374
integer(kind=inttype) degreefourzrot
Definition: inputParam.F90:355
real(kind=realtype), dimension(:), allocatable coefpolzrot
Definition: inputParam.F90:347
real(kind=realtype), dimension(:), allocatable coefpolyrot
Definition: inputParam.F90:346
real(kind=realtype), dimension(3) rotpoint
Definition: inputParam.F90:330
real(kind=realtype), dimension(:), allocatable coscoeffourzrot
Definition: inputParam.F90:375
real(kind=realtype), dimension(:), allocatable sincoeffourxrot
Definition: inputParam.F90:384
logical recomputeoverlapmatrix
Definition: inputParam.F90:898
integer(kind=inttype) loadbalanceiter
Definition: inputParam.F90:502
real(realtype) loadimbalance
Definition: inputParam.F90:500
logical splitblocks
Definition: inputParam.F90:501
recursive subroutine setentrieswcycle(counter, nLevels)
logical function digitsonlyinstring(string)
subroutine isovariables(variables)
subroutine monitorvariables(variables)
subroutine findnextinfoline(readUnit, string)
subroutine surfacevariables(variables)
subroutine setisosurfacevariable(variable, iVar)
subroutine volumevariables(variables)
recursive integer(kind=inttype) function computenstepswcycle(nLevels)
subroutine initializeisosurfacevariables(values, nValues)
integer(kind=inttype), parameter none
real(kind=realtype) ssuthdim
Definition: inputParam.F90:606
real(kind=realtype) turbintensityinf
Definition: inputParam.F90:599
real(kind=realtype) gammaconstant
Definition: inputParam.F90:597
real(kind=realtype) eddyvisinfratio
Definition: inputParam.F90:599
integer(kind=inttype) equations
Definition: inputParam.F90:585
integer(kind=inttype) equationmode
Definition: inputParam.F90:585
real(kind=realtype), dimension(:), allocatable sepsenmaxfamily
Definition: inputParam.F90:611
real(kind=realtype) tsuthdim
Definition: inputParam.F90:606
real(kind=realtype) reynolds
Definition: inputParam.F90:596
real(kind=realtype), dimension(3) pointref
Definition: inputParam.F90:604
real(kind=realtype), dimension(3, 2) momentaxis
Definition: inputParam.F90:605
real(kind=realtype) prandtlturb
Definition: inputParam.F90:598
logical walldistanceneeded
Definition: inputParam.F90:591
real(kind=realtype), dimension(3) dragdirection
Definition: inputParam.F90:603
real(kind=realtype) reynoldslength
Definition: inputParam.F90:596
logical rvfb
Definition: inputParam.F90:588
integer(kind=inttype) turbprod
Definition: inputParam.F90:586
integer(kind=inttype) turbmodel
Definition: inputParam.F90:586
real(kind=realtype), dimension(:), allocatable cpmin_family
Definition: inputParam.F90:609
real(kind=realtype) lengthref
Definition: inputParam.F90:600
logical wallfunctions
Definition: inputParam.F90:591
real(kind=realtype) machcoef
Definition: inputParam.F90:595
real(kind=realtype) prandtl
Definition: inputParam.F90:598
real(kind=realtype), dimension(3) liftdirection
Definition: inputParam.F90:602
real(kind=realtype) pklim
Definition: inputParam.F90:598
integer(kind=inttype) flowtype
Definition: inputParam.F90:585
real(kind=realtype) surfaceref
Definition: inputParam.F90:600
integer(kind=inttype) cpmodel
Definition: inputParam.F90:586
real(kind=realtype) mach
Definition: inputParam.F90:595
real(kind=realtype) rgasdim
Definition: inputParam.F90:597
real(kind=realtype), dimension(3) veldirfreestream
Definition: inputParam.F90:601
real(kind=realtype) musuthdim
Definition: inputParam.F90:606
integer(kind=inttype) rvfn
Definition: inputParam.F90:587
real(kind=realtype) walloffset
Definition: inputParam.F90:598
logical writeunsteadysurfspectral
Definition: inputParam.F90:686
logical writeunsteadyvolspectral
Definition: inputParam.F90:685
real(kind=realtype) dtunsteadyrestartspectral
Definition: inputParam.F90:672
integer(kind=inttype) ntimeintervalsspectral
Definition: inputParam.F90:649
integer(kind=inttype) nunsteadysolspectral
Definition: inputParam.F90:684
logical writeunsteadyrestartspectral
Definition: inputParam.F90:673
integer(kind=inttype) ntimestepscoarse
Definition: inputParam.F90:735
real(kind=realtype), dimension(:), allocatable gammarkunsteady
Definition: inputParam.F90:749
logical useale
Definition: inputParam.F90:758
integer(kind=inttype) nrkstagesunsteady
Definition: inputParam.F90:746
real(kind=realtype) deltat
Definition: inputParam.F90:737
integer(kind=inttype) timeintegrationscheme
Definition: inputParam.F90:723
logical updatewalldistanceunsteady
Definition: inputParam.F90:769
integer(kind=inttype) timeaccuracy
Definition: inputParam.F90:734
real(kind=realtype), dimension(:, :), allocatable betarkunsteady
Definition: inputParam.F90:748
integer(kind=inttype) ntimestepsfine
Definition: inputParam.F90:735
integer(kind=inttype) noldlevels
Definition: iteration.f90:79
real(kind=realtype), dimension(:, :), allocatable coefmeshale
Definition: iteration.f90:109
integer(kind=inttype) nalemeshes
Definition: iteration.f90:107
real(kind=realtype), dimension(:), allocatable coeftime
Definition: iteration.f90:80
real(kind=realtype), dimension(:), allocatable coeftimeale
Definition: iteration.f90:108
integer(kind=inttype) nalesteps
Definition: iteration.f90:107
logical, dimension(:), allocatable oldsolwritten
Definition: iteration.f90:123
integer(kind=inttype) noldsolavail
Definition: iteration.f90:79
logical timespectralgridsnotwritten
Definition: iteration.f90:121
logical routinefailed
Definition: killSignals.f90:36
logical fatalfail
Definition: killSignals.f90:37
integer nmon
Definition: monitor.f90:30
integer nmonmax
Definition: monitor.f90:30
real(kind=realtype), dimension(:), allocatable monloc
Definition: monitor.f90:39
logical monmachorhmax
Definition: monitor.f90:55
integer nmonsum
Definition: monitor.f90:30
logical showcpu
Definition: monitor.f90:56
character(len=maxcgnsnamelen), dimension(:), allocatable monnames
Definition: monitor.f90:46
real(kind=realtype) timeunsteadyrestart
Definition: monitor.f90:98
integer(kind=inttype) ntimestepsrestart
Definition: monitor.f90:97
logical monmasssliding
Definition: monitor.f90:63
real(kind=realtype), dimension(:), allocatable monglob
Definition: monitor.f90:40
real(kind=realtype), dimension(:), allocatable monref
Definition: monitor.f90:41
real(kind=realtype), parameter rvfn6cmu
Definition: paramTurb.F90:68
real(kind=realtype) rvflimite
Definition: paramTurb.F90:73
real(kind=realtype), parameter rvfn1cmu
Definition: paramTurb.F90:64
real(kind=realtype), parameter rvfn6cl
Definition: paramTurb.F90:71
real(kind=realtype) rvfcmu
Definition: paramTurb.F90:74
real(kind=realtype) rvfcl
Definition: paramTurb.F90:73
real(kind=realtype), parameter rvfn1cl
Definition: paramTurb.F90:67
real(kind=realtype) rvflimitk
Definition: paramTurb.F90:73
real(kind=realtype) rsacw1
Definition: paramTurb.F90:20
subroutine qsortintegers(arr, nn)
Definition: sorting.F90:101
integer(kind=inttype) function bsearchintegers(key, base)
Definition: sorting.F90:18
subroutine initcurvefitdatakw
subroutine initcurvefitdatasst
subroutine initcurvefitdatakwmod
subroutine initcurvefitdataktau
subroutine initcurvefitdatasae
subroutine initcurvefitdatavf
subroutine initcurvefitdatasa
Definition: utils.F90:1
subroutine echk(errorcode, file, line)
Definition: utils.F90:5722
subroutine converttolowercase(string)
Definition: utils.F90:5756
subroutine terminate(routineName, errorMessage)
Definition: utils.F90:502