convert Subroutine

private subroutine convert(nmodel, cnm, snm)

Based on the CONVERT subroutine from [1]. Unnormalizes the C,S coefficients.

References

  1. W. M. Lear, "The Programs TRAJ1 and TRAJ2", JSC Mission Planning and Analysis Division, JSC-22512, 87-FM-4, April 1987

Note

Coded from [1] with some modifications.

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: nmodel
real(kind=wp), intent(inout), dimension(nmodel,0:nmodel) :: cnm
real(kind=wp), intent(inout), dimension(nmodel,0:nmodel) :: snm

Calls

proc~~convert~~CallsGraph proc~convert geopotential_module::convert proc~fl geopotential_module::FL proc~convert->proc~fl

Called by

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

Source Code

    subroutine convert(nmodel,cnm,snm)

    implicit none

    integer,intent(in) :: nmodel
    real(wp),dimension(nmodel,0:nmodel),intent(inout) :: cnm
    real(wp),dimension(nmodel,0:nmodel),intent(inout) :: snm

    integer :: n,m
    real(wp) :: t1,t2

    do n = 1, nmodel        !JW : this could be 2,nmodel ...
        t1 = 2*n+1
        cnm(n,0) = sqrt(t1)*cnm(n,0)
        do m = 1, n
            t2 = sqrt(FL(n-m)*t1*two / FL(n+m))
            cnm(n,m) = t2*cnm(n,m)
            snm(n,m) = t2*snm(n,m)
        end do
    end do

    end subroutine convert