feldi Subroutine

private subroutine feldi(me)

Used for l computation.

Type Bound

shellig_type

Arguments

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

Called by

proc~~feldi~~CalledByGraph proc~feldi shellig_module::shellig_type%feldi proc~stoer shellig_module::shellig_type%stoer proc~stoer->proc~feldi proc~findb0 shellig_module::shellig_type%findb0 proc~findb0->proc~stoer proc~shellg shellig_module::shellig_type%shellg proc~shellg->proc~stoer proc~igrf shellig_module::shellig_type%igrf proc~igrf->proc~findb0 proc~igrf->proc~shellg proc~igrfc shellig_module::shellig_type%igrfc proc~igrfc->proc~findb0 proc~shellc shellig_module::shellig_type%shellc proc~igrfc->proc~shellc proc~shellc->proc~shellg proc~get_flux_c_ radbelt_module::radbelt_type%get_flux_c_ proc~get_flux_c_->proc~igrfc proc~get_flux_g_ radbelt_module::radbelt_type%get_flux_g_ proc~get_flux_g_->proc~igrf none~get_flux radbelt_module::radbelt_type%get_flux none~get_flux->proc~get_flux_c_ none~get_flux->proc~get_flux_g_ proc~get_flux_c radbelt_module::get_flux_c proc~get_flux_c->none~get_flux proc~get_flux_g radbelt_module::get_flux_g proc~get_flux_g->none~get_flux proc~get_flux_g_c radbelt_c_module::get_flux_g_c proc~get_flux_g_c->none~get_flux interface~get_flux radbelt_module::get_flux interface~get_flux->proc~get_flux_c interface~get_flux->proc~get_flux_g

Source Code

    subroutine feldi(me)

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

        real(wp) :: f, x, y, z
        integer :: i, ih, ihmax, il, imax, k, last, m

        ihmax = me%nmax * me%nmax + 1
        last = ihmax + me%nmax + me%nmax
        imax = me%nmax + me%nmax - 1
        do i = ihmax, last
            me%h(i) = me%g(i)
        end do
        do k = 1, 3, 2
            i = imax
            ih = ihmax
            do
                il = ih - i
                f = 2.0_wp / real(i - k + 2, wp)
                x = me%xi(1) * f
                y = me%xi(2) * f
                z = me%xi(3) * (f + f)
                i = i - 2
                if ((i - 1) >= 0) then
                    if ((i - 1) > 0) then
                        do m = 3, i, 2
                            me%h(il + m + 1) = me%g(il + m + 1) + z * me%h(ih + m + 1) + x * (me%h(ih + m + 3) - &
                                                                       me%h(ih + m - 1)) - y * (me%h(ih + m + 2) + me%h(ih + m - 2))
                            me%h(il + m) = me%g(il + m) + z * me%h(ih + m) + x * (me%h(ih + m + 2) - &
                                                                       me%h(ih + m - 2)) + y * (me%h(ih + m + 3) + me%h(ih + m - 1))
                        end do
                    end if
                    me%h(il + 2) = me%g(il + 2) + z * me%h(ih + 2) + x * me%h(ih + 4) - y * (me%h(ih + 3) + me%h(ih))
                    me%h(il + 1) = me%g(il + 1) + z * me%h(ih + 1) + y * me%h(ih + 4) + x * (me%h(ih + 3) - me%h(ih))
                end if
                me%h(il) = me%g(il) + z * me%h(ih) + 2.0_wp * (x * me%h(ih + 1) + y * me%h(ih + 2))
                ih = il
                if (i < k) exit
            end do
        end do

    end subroutine feldi