(j3.2006) Question from a colleague

Van Snyder Van.Snyder
Wed Jun 11 15:41:24 EDT 2014


Here's a question from a colleague:

In code expected to be used on several platforms, is one of these
formulations generally (if not universally) more likely to be more
efficient, or should I expect significant processor-dependent variation?

        xsqr_pls_ysqr=(xx**2+yy**2)
        !-------------
        ! Asymptotic expression for extremely large |z|
        mask=(xsqr_pls_ysqr>=1.0e16_rk)
        allocate(index_sub(count(mask)))
        index_sub=pack(indx_array,mask)
        w(index_sub)=one_sqrt_pi*(abs(yy(index_sub))+j1*(xx(index_sub)))/ &
            (xsqr_pls_ysqr(index_sub));
        deallocate (index_sub)

        xsqr_pls_ysqr=(xx**2+yy**2)
        !-------------
        ! Asymptotic expression for extremely large |z|
        where (xsqr_pls_ysqr>=1.0e16_rk) &
          w=one_sqrt_pi*(abs(yy)+j1*(xx))/(xsqr_pls_ysqr);

Thanks,
Van





More information about the J3 mailing list