destroy_geopotential_model Subroutine

private subroutine destroy_geopotential_model(me)

Destroy a gravity model.

Type Bound

geopotential_model

Arguments

Type IntentOptional Attributes Name
class(geopotential_model), intent(inout) :: me

Called by

proc~~destroy_geopotential_model~2~~CalledByGraph proc~destroy_geopotential_model~2 geopotential_module::geopotential_model%destroy_geopotential_model proc~geopotential_module_test geopotential_module::geopotential_module_test proc~geopotential_module_test->proc~destroy_geopotential_model~2 proc~read_geopotential_file geopotential_module::geopotential_model%read_geopotential_file proc~geopotential_module_test->proc~read_geopotential_file proc~read_geopotential_file->proc~destroy_geopotential_model~2

Source Code

    subroutine destroy_geopotential_model(me)

    implicit none

    class(geopotential_model),intent(inout)  :: me

    !common to all:
    if (allocated(me%name))     deallocate(me%name)
    if (allocated(me%filename)) deallocate(me%filename)
    me%nmax = 0
    me%mmax = 0
    me%re   = zero
    me%mu   = zero

    select type (me)

    class is (geopotential_model_vector_coeff)

        if (allocated(me%c)) deallocate(me%c)
        if (allocated(me%s)) deallocate(me%s)

    class is (geopotential_model_matrix_coeff)

        if (allocated(me%cnm)) deallocate(me%cnm)
        if (allocated(me%snm)) deallocate(me%snm)

    end select

    end subroutine destroy_geopotential_model