set_coordinate_system Subroutine

public subroutine set_coordinate_system(geom)

Uses

  • proc~~set_coordinate_system~~UsesGraph proc~set_coordinate_system set_coordinate_system module~mod_global_parameters mod_global_parameters proc~set_coordinate_system->module~mod_global_parameters module~mod_basic_types mod_basic_types module~mod_global_parameters->module~mod_basic_types module~mod_connectivity mod_connectivity module~mod_global_parameters->module~mod_connectivity module~mod_constants mod_constants module~mod_global_parameters->module~mod_constants module~mod_physicaldata mod_physicaldata module~mod_global_parameters->module~mod_physicaldata module~mod_variables mod_variables module~mod_global_parameters->module~mod_variables mpi mpi module~mod_global_parameters->mpi module~mod_variables->module~mod_basic_types

Set the coordinate system to be used

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: geom

Name of the coordinate system


Calls

proc~~set_coordinate_system~~CallsGraph proc~set_coordinate_system set_coordinate_system proc~mpistop mpistop proc~set_coordinate_system->proc~mpistop mpi_abort mpi_abort proc~mpistop->mpi_abort

Called by

proc~~set_coordinate_system~~CalledByGraph proc~set_coordinate_system set_coordinate_system proc~set_coordinate_system_from_config set_coordinate_system_from_config proc~set_coordinate_system_from_config->proc~set_coordinate_system proc~main main proc~main->proc~set_coordinate_system_from_config program~agile agile program~agile->proc~main

Source Code

  subroutine set_coordinate_system(geom)
    use mod_global_parameters
    character(len=*), intent(in) :: geom
    !< Name of the coordinate system

    ! Store the geometry name
    geometry_name = geom

    select case (geom)
    case ("Cartesian","Cartesian_1D","Cartesian_2D","Cartesian_3D")
      ndir = ndim
      coordinate=Cartesian
    case ("Cartesian_1D_expansion")
      if (ndim /= 1) call mpistop&
         ("Geometry Cartesian_1D_expansion but ndim /= 1")
      ndir = ndim
      coordinate=Cartesian_expansion
    case ("Cartesian_1.5D")
      if (ndim /= 1) call mpistop("Geometry Cartesian_1.5D but ndim /= 1")
      coordinate=Cartesian
      ndir = 2
    case ("Cartesian_1.75D")
      if (ndim /= 1) call mpistop("Geometry Cartesian_1.75D but ndim /= 1")
      coordinate=Cartesian
      ndir = 3
    case ("Cartesian_2.5D")
      if (ndim /= 2) call mpistop("Geometry Cartesian_2.5D but ndim /= 2")
      coordinate=Cartesian
      ndir = 3
    case ("cylindrical","cylindrical_2D","cylindrical_3D")
      ndir = ndim
      r_   = 1
      z_   = 2
      if(ndir==3) phi_ = 3
      coordinate=cylindrical
    case ("cylindrical_2.5D")
      if (ndim /= 2) call mpistop("Geometry cylindrical_2.5D but ndim /= 2")
      ndir = 3
      r_   = 1
      z_   = 2
      phi_ = 3
      coordinate=cylindrical
    case ("polar","polar_2D","polar_3D")
      ndir = ndim
      r_   = 1
      phi_ = 2
      if(ndir==3) z_ = 3
      coordinate=cylindrical
    case ("polar_1.5D")
       if (ndim /= 1) call mpistop("Geometry polar_1.5D but ndim /= 1")
       ndir = 2
       r_   = 1
       phi_ = 2
       coordinate=cylindrical
    case ("polar_2.5D")
      if (ndim /= 2) call mpistop("Geometry polar_2.5D but ndim /= 2")
      ndir = 3
      r_   = 1
      phi_ = 2
      z_   = 3
      coordinate=cylindrical
    case ("spherical","spherical_2D","spherical_3D")
      ndir = ndim
      r_   = 1
      if(ndir==3) phi_ = 3
      z_   = -1
      coordinate=spherical
    case ("spherical_2.5D")
      if (ndim /= 2) call mpistop("Geometry spherical_2.5D requires ndim == 2")

      ndir = 3
      r_   = 1
      phi_ = 3
      z_   = -1
      coordinate=spherical
    ! The two logarithmically stretched systems are the same coordinate
    ! systems - identical ndir, r_, phi_, z_ and the same `coordinate` value,
    ! so every select case (coordinate) in the code keeps matching. What
    ! differs is only that the mesh is uniform in ln(r) rather than in r, which
    ! the LOG_RADIUS define carries. The names are kept distinct here because
    ! geometry_name goes into the snapshot header, and a log snapshot must not
    ! restart into a uniformly spaced build.
    case ("logSpherical","logSpherical_3D")
      ndir = ndim
      r_   = 1
      if(ndir==3) phi_ = 3
      z_   = -1
      coordinate=spherical
    case ("logCylindrical","logCylindrical_3D")
      ndir = ndim
      r_   = 1
      z_   = 2
      if(ndir==3) phi_ = 3
      coordinate=cylindrical
    case default
      call mpistop("Unknown geometry specified")
    end select

    ! The coordinate system is a compile-time choice in AGILE: the GEOM define
    ! (set from `geometry` in &meshlist) specializes the finite-volume kernels.
    ! Guard against a mod_usr that disagrees with what the code was built for.
    if (coordinate /= Cartesian) call mpistop("meshlist geometry is Cartesian, &
       &but mod_usr set a non-Cartesian coordinate system")

    ! coordinate alone cannot tell a log-stretched system from a uniform one -
    ! that is the point of the design - so the radial spacing is checked
    ! separately, on the name.
    if (geom(1:3) == "log") call mpistop("mod_usr set a logarithmically &
       &stretched coordinate system, but meshlist geometry is not &
       &logSpherical or logCylindrical")
  end subroutine set_coordinate_system