parse_geometry Subroutine

private subroutine parse_geometry(table, dict, error)

parse geometry information

Arguments

Type IntentOptional Attributes Name
type(toml_table), intent(inout) :: table

Input Toml table

type(toml_table), intent(inout) :: dict

Dictonary used to store metadata

type(toml_error), intent(out), allocatable :: error

Error message


Source Code

    subroutine parse_geometry(table, dict, error)
        !! parse geometry information
        use sim_state_mod, only : state
        
        !> Input Toml table
        type(toml_table),               intent(inout) :: table
        !> Dictonary used to store metadata
        type(toml_table),               intent(inout) :: dict
        !> Error message
        type(toml_error),  allocatable, intent(out)   :: error

        type(toml_table), pointer :: child
        real(kind=wp)             :: tau, musb, musc, muab, muac, hgg
        integer                   :: num_spheres

        call get_value(table, "geometry", child)

        if(associated(child))then
            call get_value(child, "geom_name", state%experiment, "sphere")
            call get_value(child, "tau", tau, 10._wp)
            call set_value(dict, "tau", tau)

            call get_value(child, "num_spheres", num_spheres, 10)
            call set_value(dict, "num_spheres", num_spheres)

            call get_value(child, "musb", musb, 0.0_wp)
            call set_value(dict, "musb", musb)
            call get_value(child, "muab", muab, 0.01_wp)
            call set_value(dict, "muab", muab)
            call get_value(child, "musc", musc, 0.0_wp)
            call set_value(dict, "musc", musc)
            call get_value(child, "muac", muac, 0.01_wp)
            call set_value(dict, "muac", muac)
            call get_value(child, "hgg", hgg, 0.7_wp)
            call set_value(dict, "hgg", hgg)
        else
            call make_error(error, "Need geometry table in input param file", -1)
            return
        end if

    end subroutine parse_geometry