ff_add Function

public function ff_add(p1, p2) result(p3)

Defines how to add two EMFields types

Arguments

Type IntentOptional AttributesName
type(EMFields), intent(in) :: p1
type(EMFields), intent(in) :: p2

Return Value type(EMFields)


Called by

proc~~ff_add~~CalledByGraph proc~ff_add ff_add interface~operator(+) operator(+) interface~operator(+)->proc~ff_add

Contents

Source Code


Source Code

function ff_add(p1, p2) result (p3)
    !+ Defines how to add two [[EMFields]] types
    type(EMFields), intent(in) :: p1,p2
    type(EMFields)             :: p3

    p3%br   = p1%br   + p2%br
    p3%bt   = p1%bt   + p2%bt
    p3%bz   = p1%bz   + p2%bz
    p3%er   = p1%er   + p2%er
    p3%et   = p1%et   + p2%et
    p3%ez   = p1%ez   + p2%ez

    p3%dbr_dr   = p1%dbr_dr + p2%dbr_dr
    p3%dbr_dz   = p1%dbr_dz + p2%dbr_dz
    p3%dbt_dr   = p1%dbt_dr + p2%dbt_dr
    p3%dbt_dz   = p1%dbt_dz + p2%dbt_dz
    p3%dbz_dr   = p1%dbz_dr + p2%dbz_dr
    p3%dbz_dz   = p1%dbz_dz + p2%dbz_dz

end function ff_add