calculatecenter.F [SRC] [CPP] [JOB] [SCAN]
TOOLS / PREDATAS / GENERIC



   1 | include(dom.inc)
   2 |       SUBROUTINE calculatecenter(nb_nodes, nodelist, x, y, z)
   3 | 
   4 | !       ================================================================!
   5 | !                                                                       !
   6 | !       calculatecenter: Calculates the center of a face                !
   7 | !                                                                       !
   8 | !       in             : The number of nodes of the face 'nb_nodes'     !
   9 | !                        The id list of the nodes 'nodelist'            !
  10 | !       out            : The x, y, z coordinates of the center          !
  11 | !                                                                       !
  12 | !       author         : J. AMAYA (september 2007)                      !
  13 | !                                                                       !
  14 | !       ================================================================!
  15 | 
  16 |         USE datas
  17 |         IMPLICIT NONE
  18 | 
  19 | !       IN
  20 |         DOM_INT :: nb_nodes
  21 |         DOM_INT, DIMENSION(nb_nodes) :: nodelist
  22 | 
  23 | !       OUT
  24 |         DOM_REAL :: x, y, z
  25 | 
  26 | !       LOCAL
  27 |         DOM_INT :: i
  28 | 
  29 |         x = 0
  30 |         y = 0
  31 |         z = 0
  32 |         DO i=1, nb_nodes
  33 |           x = x + node_list(1, nodelist(i))
  34 |           y = y + node_list(2, nodelist(i))
  35 |           z = z + node_list(3, nodelist(i))
  36 |         ENDDO
  37 |         x = x / nb_nodes
  38 |         y = y / nb_nodes
  39 |         z = z / nb_nodes
  40 | 
  41 |       END SUBROUTINE calculatecenter


calculatecenter.F could be called by:
addface.F [TOOLS/PREDATAS/DATAS] - 139
Makefile [TOOLS/PREDATAS] - 82