![]() Real(kind(1d0)), intent(out) :: es_x, es_y, es_z, sin_thetaĮs_x = normal_z * rzero_y - normal_y * rzero_zĮs_y = normal_x * rzero_z - normal_z * rzero_xĮs_z = normal_y * rzero_x - normal_x * rzero_y Real(kind(1d0)), intent(in) :: rzero_x, rzero_y, rzero_z ![]() Real(kind(1d0)), intent(in) :: normal_x, normal_y, normal_z !$omp declare simd(Calculate_Sines) uniform(normal_x, normal_y, normal_z) Multiplying the normal by 'rzero' gives 'es', and taking the amplitude of 'es' gives us the sine of the angle between 'rzero' and the normal, viz: elemental subroutine Calculate_Sines(normal_x, normal_y, normal_z, & ![]() I decided to take a very simple, short subroutine that calculates a vector product: one of the vectors, 'normal' is unique, represented by its scalar components 'normal_x', 'normal_y' and 'normal_z', whilst the other vector 'rzero' is typically one of a large number of vectors represented by arrays of 'rzero_x', 'rzero_y' and 'rzero_z' components. I'm updating some of my long-standing code to take advantage of the latest OpenMP 4.0 syntax, but I've come unstuck at the first attempt. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |