number_of_coefficients Function

private pure function number_of_coefficients(n, m) result(np)

Number of (c,s) coefficients for n x m geopotential model Starting with n=2,m=0.

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: n

degree

integer, intent(in) :: m

order

Return Value integer

number of coefficients


Called by

proc~~number_of_coefficients~~CalledByGraph proc~number_of_coefficients geopotential_module::number_of_coefficients proc~geopotential_module_test geopotential_module::geopotential_module_test proc~geopotential_module_test->proc~number_of_coefficients proc~read_geopotential_file geopotential_module::geopotential_model%read_geopotential_file proc~geopotential_module_test->proc~read_geopotential_file proc~read_geopotential_file->proc~number_of_coefficients

Source Code

    pure function number_of_coefficients(n,m) result(np)

    implicit none

    integer            :: np  !! number of coefficients
    integer,intent(in) :: n   !! degree
    integer,intent(in) :: m   !! order

    integer :: i  !counter

    if (n>=m .and. n>1) then
        np = m - 1 + sum( [ (i, i=n,2,-1) ] )
    else
        np = -999    !error
    end if

    end function number_of_coefficients