verify_write_control Subroutine

public subroutine verify_write_control(control, scheme, flow)

Verify all the variable being asked to write in the output file. This is a fail-safe subroutine which do not allow to write the incorrect input variable

Arguments

Type IntentOptional AttributesName
type(controltype), intent(inout) :: control
type(schemetype), intent(in) :: scheme
type(flowtype), intent(in) :: flow

Calls

proc~~verify_write_control~~CallsGraph proc~verify_write_control verify_write_control proc~lcase lcase proc~verify_write_control->proc~lcase

Called by

proc~~verify_write_control~~CalledByGraph proc~verify_write_control verify_write_control proc~initstate initstate proc~initstate->proc~verify_write_control proc~setup_state setup_state proc~setup_state->proc~initstate proc~setup_solver setup_solver proc~setup_solver->proc~setup_state proc~start_run start_run proc~start_run->proc~setup_solver program~main main program~main->proc~start_run

Contents

Source Code


Source Code

    subroutine verify_write_control(control, scheme, flow)
      !< Verify all the variable being asked to write in the output file. 
      !< This is a fail-safe subroutine which do not allow to write the incorrect input variable
      implicit none
      type(controltype), intent(inout) :: control
      type(schemetype) , intent(in) :: scheme
      type(flowtype)   , intent(in) :: flow
      integer :: n
      character(len=*), parameter :: err="Control Error: can't write variable - "

      do n = 1,control%w_count

        select case (trim(lcase(control%w_list(n))))
        
          case('velocity','vel','speed','u','v')
            control%w_list(n) = "Velocity"

          case('density','rho')
            control%w_list(n) = "Density"
          
          case('pressure','presssure','p')
            control%w_list(n) = "Pressure"

          case('mu','viscosity','mu_l','laminar_viscosity','muv','mu_v')
            if (flow%mu_ref/=0.0) then
              control%w_list(n) = "Mu"
            else
              print*, err//trim(control%w_list(n))//" to file"
              control%w_list(n) = "do not write"
            end if
            
          case('mu_t','turbulent_viscosity','mut')
            if (scheme%turbulence/='none') then
              control%w_list(n) = "Mu_t"
            else
              print*, err//trim(control%w_list(n))//" to file"
              control%w_list(n) = "do not write"
            end if
            
          case('tke','tk','turbulent_kinetic_enrgy','k')
            select case (trim(scheme%turbulence))
              case('sst', 'sst2003','kw','bsl','kkl','ke','des-sst')
                control%w_list(n) = "TKE"
              case DEFAULT
                print*, err//trim(control%w_list(n))//" to file"
                control%w_list(n) = "do not write"
             end select

          case('omega','tw')
            select case (trim(scheme%turbulence))
              case('sst', 'sst2003','kw','bsl','des-sst')
                control%w_list(n) = "Omega"
              case DEFAULT
                print*, err//trim(control%w_list(n))//" to file"
                control%w_list(n) = "do not write"
             end select

          case('dissipation','te','teps','eps')
            select case (trim(scheme%turbulence))
              case('ke')
                control%w_list(n) = "Dissipation"
              case DEFAULT
                print*, err//trim(control%w_list(n))//" to file"
                control%w_list(n) = "do not write"
             end select

          case('kl')
            select case (trim(scheme%turbulence))
              case('kkl')
                control%w_list(n) = "Kl"
              case DEFAULT
                print*, err//trim(control%w_list(n))//" to file"
                control%w_list(n) = "do not write"
             end select

          case('tv')
            select case (trim(scheme%turbulence))
              case('sa', 'saBC')
                control%w_list(n) = "tv"
              case DEFAULT
                print*, err//trim(control%w_list(n))//" to file"
                control%w_list(n) = "do not write"
             end select

          case('wall_distance', 'dist', 'wall_dist', 'wdist')
            if(scheme%turbulence/="none") then
              control%w_list(n) = "Wall_distance"
            else
              print*, err//trim(control%w_list(n))//" to file"
              control%w_list(n) = "do not write"
            end if

          case('resnorm')
            control%w_list(n) = "Resnorm"

          case('tke_residue')
            control%w_list(n) = "TKE_residue"

          case('omega_residue')
            control%w_list(n) = "Omega_residue"

          case('tv_residue')
            control%w_list(n) = "Tv_residue"

          case('mass_residue')
            control%w_list(n) = "Mass_residue"

          case('x_mom_residue')
            control%w_list(n) = "X_mom_residue"

          case('y_mom_residue')
            control%w_list(n) = "Y_mom_residue"

          case('z_mom_residue')
            control%w_list(n) = "Z_mom_residue"

          case('energy_residue')
            control%w_list(n) = "Energy_residue"

          case('f1')
            if(trim(scheme%turbulence)=='sst' .or. trim(scheme%turbulence)=='sst2003')then
              control%w_list(n) = "F1"
            else
              control%w_list(n) = 'do not write'
            end if

          case('dudx')
            control%w_list(n) = "Dudx"

          case('dudy')
            control%w_list(n) = "Dudy"

          case('dudz')
            control%w_list(n) = "Dudz"

          case('dvdx')
            control%w_list(n) = "Dvdx"

          case('dvdy')
            control%w_list(n) = "Dvdy"

          case('dvdz')
            control%w_list(n) = "Dvdz"

          case('dwdx')
            control%w_list(n) = "Dwdx"

          case('dwdy')
            control%w_list(n) = "Dwdy"

          case('dwdz')
            control%w_list(n) = "Dwdz"

          case('dTdx')
            control%w_list(n) = "DTdx"

          case('dTdy')
            control%w_list(n) = "DTdy"

          case('dTdz')
            control%w_list(n) = "DTdz"

          case('dtkdx')
            select case (trim(scheme%turbulence))
              case('sst', 'sst2003','kw','bsl','kkl','ke','des-sst')
                control%w_list(n) = "Dtkdx"
              case DEFAULT
                print*, err//trim(control%w_list(n))//" to file"
                control%w_list(n) = "do not write"
            end select

          case('dtkdy')
            select case (trim(scheme%turbulence))
              case('sst', 'sst2003','kw','bsl','kkl','ke','des-sst')
                control%w_list(n) = "Dtkdy"
              case DEFAULT
                print*, err//trim(control%w_list(n))//" to file"
                control%w_list(n) = "do not write"
            end select

          case('dtkdz')
            select case (trim(scheme%turbulence))
              case('sst','sst2003','kw','bsl','kkl','ke','des-sst')
                control%w_list(n) = "Dtkdz"
              case DEFAULT
                print*, err//trim(control%w_list(n))//" to file"
                control%w_list(n) = "do not write"
            end select

          case('dtwdx')
            select case (trim(scheme%turbulence))
              case('sst','sst2003','kw','bsl','des-sst')
                control%w_list(n) = "Dtwdx"
              case DEFAULT
                print*, err//trim(control%w_list(n))//" to file"
                control%w_list(n) = "do not write"
            end select

          case('dtwdy')
            select case (trim(scheme%turbulence))
              case('sst','sst2003','kw','bsl','des-sst')
                control%w_list(n) = "Dtwdy"
              case DEFAULT
                print*, err//trim(control%w_list(n))//" to file"
                control%w_list(n) = "do not write"
            end select

          case('dtwdz')
            select case (trim(scheme%turbulence))
              case('sst','sst2003','kw','bsl','des-sst')
                control%w_list(n) = "Dtwdz"
              case DEFAULT
                print*, err//trim(control%w_list(n))//" to file"
                control%w_list(n) = "do not write"
            end select

          case('dtedx')
            select case (trim(scheme%turbulence))
              case('ke')
                control%w_list(n) = "Dtedx"
              case DEFAULT
                print*, err//trim(control%w_list(n))//" to file"
                control%w_list(n) = "do not write"
            end select

          case('dtedy')
            select case (trim(scheme%turbulence))
              case('ke')
                control%w_list(n) = "Dtedy"
              case DEFAULT
                print*, err//trim(control%w_list(n))//" to file"
                control%w_list(n) = "do not write"
            end select

          case('dtedz')
            select case (trim(scheme%turbulence))
              case('ke')
                control%w_list(n) = "Dtedz"
              case DEFAULT
                print*, err//trim(control%w_list(n))//" to file"
                control%w_list(n) = "do not write"
            end select

          case('dtkldx')
            select case (trim(scheme%turbulence))
              case('kkl')
                control%w_list(n) = "Dtkldx"
              case DEFAULT
                print*, err//trim(control%w_list(n))//" to file"
                control%w_list(n) = "do not write"
             end select

          case('dtkldy')
            select case (trim(scheme%turbulence))
              case('kkl')
                control%w_list(n) = "Dtkldy"
              case DEFAULT
                print*, err//trim(control%w_list(n))//" to file"
                control%w_list(n) = "do not write"
             end select

          case('dtkldz')
            select case (trim(scheme%turbulence))
              case('kkl')
                control%w_list(n) = "Dtkldz"
              case DEFAULT
                print*, err//trim(control%w_list(n))//" to file"
                control%w_list(n) = "do not write"
             end select

          case('dtvdx')
            select case (trim(scheme%turbulence))
              case('sa', 'saBC')
                control%w_list(n) = "Dtvdx"
              case DEFAULT
                print*, err//trim(control%w_list(n))//" to file"
                control%w_list(n) = "do not write"
             end select

          case('dtvdy')
            select case (trim(scheme%turbulence))
              case('sa', 'saBC')
                control%w_list(n) = "Dtvdy"
              case DEFAULT
                print*, err//trim(control%w_list(n))//" to file"
                control%w_list(n) = "do not write"
             end select

          case('dtvdz')
            select case (trim(scheme%turbulence))
              case('sa', 'saBC')
                control%w_list(n) = "Dtvdz"
              case DEFAULT
                print*, err//trim(control%w_list(n))//" to file"
                control%w_list(n) = "do not write"
             end select

          case('intermittency')
            select case (trim(scheme%turbulence))
              case('saBC')
                control%w_list(n) = "Intermittency"
              case DEFAULT
                print*, err//trim(control%w_list(n))//" to file"
                control%w_list(n) = "do not write"
             end select

           case('tgm')
            select case (trim(scheme%transition))
              case('lctm2015')
                control%w_list(n) = "tgm"
              case DEFAULT
                print*, err//trim(control%w_list(n))//" to file"
                control%w_list(n) = "do not write"
             end select

          case('extravar1','extravar2', 'extravar3', 'extravar4', 'extravar5')
            control%w_list(n) = trim(lcase(control%w_list(n)))

          case Default
            print*, err//trim(control%w_list(n))//" to file"
            control%w_list(n) = "do not write"

        end select
      end do

    end subroutine verify_write_control