[mpas-developers] additions to src/operators

Michael Duda duda at ucar.edu
Mon May 3 16:29:48 MDT 2010


Hi, All.

Given that we now use basic linear algebra and geometry operations
in a number of modules, I was wondering whether it might be
beneficial to collect general, robust versions of the commonly
used routines into new modules to be added to the 'operators'
component of the framework. For example, we could add


module linear_algebra:

   - normalize()       ! normalizes a vector
   - dot_product()     ! computes the dot product of two n-vectors
   - cross_product()   ! computes the cross product of two 3-vectors
   - axb_solve()       ! solves the linear system Ax=b
   - matrix_inverse()  ! computes the inverse of a matrix


module geometry:

   - sphere_angle()       ! computes the angle on a sphere between arcs AB and AC
   - plane_angle()        ! computes the angle in a plane between vectors AB and AC 
   - arc_length()         ! computes the length on a sphere of great
                            circle arc from A to B
   - euclidean_distance() ! computes the Euclidean distance between A and B
   - arc_bisect()         ! finds the point bisecting spherical arc from A to B
   - rotate_about_vector() ! rotates a point an angle theta about a line


The names of the routines are certainly negotiable. With these
modules, we avoid duplicate code, and we can all benefit from
fixes and improvements to the shared modules. Of course, with the
addition of such modules, we can migrate existing use of the
encapsulated functionality on a gradual basis. What do others
think? Are there functions/subroutines that I've missed? Are there
suggestions for better names of the routines or perhaps argument
conventions?

Cheers,
Michael


More information about the mpas-developers mailing list