--- MITgcm/eesupp/src/global_sum.F 2001/05/29 14:01:36 1.9 +++ MITgcm/eesupp/src/global_sum.F 2001/09/21 03:54:35 1.10 @@ -1,4 +1,4 @@ -C $Header: /home/ubuntu/mnt/e9_copy/MITgcm/eesupp/src/global_sum.F,v 1.9 2001/05/29 14:01:36 adcroft Exp $ +C $Header: /home/ubuntu/mnt/e9_copy/MITgcm/eesupp/src/global_sum.F,v 1.10 2001/09/21 03:54:35 cnh Exp $ C $Name: $ C-- File global_sum.F: Routines that perform global sum on an array @@ -8,39 +8,45 @@ C o global_sum_r8 #include "CPP_EEOPTIONS.h" -CStartOfInterface +CBOP +C !ROUTINE: GLOBAL_SUM_R4 + +C !INTERFACE: SUBROUTINE GLOBAL_SUM_R4( U sumPhi, I myThid ) -C /==========================================================\ -C | SUBROUTINE GLOBAL_SUM_R4 | -C | o Handle sum for real*4 data. | -C |==========================================================| -C | Perform sum an array of one value per thread and then | -C | sum result of all the processes. | -C | Notes | -C | ===== | -C | Within a process only one thread does the sum, each | -C | thread is assumed to have already summed its local data. | -C | The same thread also does the inter-process sum for | -C | example with MPI and then writes the result into a shared| -C | location. All threads wait until the sum is avaiailable. | -C \==========================================================/ IMPLICIT NONE +C !DESCRIPTION: +C *==========================================================* +C | SUBROUTINE GLOBAL_SUM_R4 +C | o Handle sum for real*4 data. +C *==========================================================* +C | Perform sum an array of one value per thread and then +C | sum result of all the processes. +C | Notes +C | ===== +C | Within a process only one thread does the sum, each +C | thread is assumed to have already summed its local data. +C | The same thread also does the inter-process sum for +C | example with MPI and then writes the result into a shared +C | location. All threads wait until the sum is avaiailable. +C *==========================================================* +C !USES: C == Global data == #include "SIZE.h" #include "EEPARAMS.h" #include "EESUPPORT.h" #include "GLOBAL_SUM.h" +C !INPUT/OUTPUT PARAMETERS: C == Routine arguments == C sumPhi - Result of sum. C myThid - My thread id. Real*4 sumPhi INTEGER myThid -CEndOfInterface +C !LOCAL VARIABLES: C == Local variables == C I - Loop counters C mpiRC - MPI return code @@ -49,6 +55,7 @@ #ifdef ALLOW_USE_MPI INTEGER mpiRC #endif /* ALLOW_USE_MPI */ +CEOP C-- write local sum into array CALL BAR2( myThid ) @@ -89,39 +96,45 @@ END -CStartOfInterface +CBOP +C !ROUTINE: GLOBAL_SUM_R8 + +C !INTERFACE: SUBROUTINE GLOBAL_SUM_R8( U sumPhi, I myThid ) -C /==========================================================\ -C | SUBROUTINE GLOBAL_SUM_R8 | -C | o Handle sum for real*8 data. | -C |==========================================================| -C | Perform sum an array of one value per thread and then | -C | sum result of all the processes. | -C | Notes | -C | ===== | -C | Within a process only one thread does the sum, each | -C | thread is assumed to have already summed its local data. | -C | The same thread also does the inter-process sum for | -C | example with MPI and then writes the result into a shared| -C | location. All threads wait until the sum is avaiailable. | -C \==========================================================/ - IMPLICIT NONE + IMPLICIT NONE +C !DESCRIPTION: +C *==========================================================* +C | SUBROUTINE GLOBAL_SUM_R8 +C | o Handle sum for real*8 data. +C *==========================================================* +C | Perform sum an array of one value per thread and then +C | sum result of all the processes. +C | Notes +C | ===== +C | Within a process only one thread does the sum, each +C | thread is assumed to have already summed its local data. +C | The same thread also does the inter-process sum for +C | example with MPI and then writes the result into a shared +C | location. All threads wait until the sum is avaiailable. +C *==========================================================* +C !USES: C === Global data === #include "SIZE.h" #include "EEPARAMS.h" #include "EESUPPORT.h" #include "GLOBAL_SUM.h" +C !INPUT/OUTPUT PARAMETERS: C === Routine arguments === C sumPhi - Result of sum. C myThid - My thread id. Real*8 sumPhi INTEGER myThid -CEndOfInterface +C !LOCAL VARIABLES: C === Local variables === C I - Loop counters C mpiRC - MPI return code @@ -130,6 +143,7 @@ #ifdef ALLOW_USE_MPI INTEGER mpiRC #endif /* ALLOW_USE_MPI */ +CEOP CALL BAR2( myThid ) C-- write local sum into array @@ -178,39 +192,45 @@ RETURN END -CStartOfInterface + +CBOP +C !ROUTINE: GLOBAL_SUM_INT +C !INTERFACE: SUBROUTINE GLOBAL_SUM_INT( U sumPhi, I myThid ) -C /==========================================================\ -C | SUBROUTINE GLOBAL_SUM_INT | -C | o Handle sum for integer data. | -C |==========================================================| -C | Perform sum an array of one value per thread and then | -C | sum result of all the processes. | -C | Notes | -C | ===== | -C | Within a process only one thread does the sum, each | -C | thread is assumed to have already summed its local data. | -C | The same thread also does the inter-process sum for | -C | example with MPI and then writes the result into a shared| -C | location. All threads wait until the sum is avaiailable. | -C \==========================================================/ IMPLICIT NONE +C !DESCRIPTION: +C *==========================================================* +C | SUBROUTINE GLOBAL_SUM_INT +C | o Handle sum for integer data. +C *==========================================================* +C | Perform sum an array of one value per thread and then +C | sum result of all the processes. +C | Notes +C | ===== +C | Within a process only one thread does the sum, each +C | thread is assumed to have already summed its local data. +C | The same thread also does the inter-process sum for +C | example with MPI and then writes the result into a shared +C | location. All threads wait until the sum is avaiailable. +C *==========================================================* +C !USES: C === Global data === #include "SIZE.h" #include "EEPARAMS.h" #include "EESUPPORT.h" #include "GLOBAL_SUM.h" +C !INPUT/OUTPUT PARAMETERS: C === Routine arguments === C sumPhi - Result of sum. C myThid - My thread id. INTEGER sumPhi INTEGER myThid -CEndOfInterface +C !LOCAL VARIABLES: C === Local variables === C I - Loop counters C mpiRC - MPI return code @@ -219,6 +239,7 @@ #ifdef ALLOW_USE_MPI INTEGER mpiRC #endif /* ALLOW_USE_MPI */ +CEOP _BARRIER C-- write local sum into array