1 |
adcroft |
1.2 |
C $Header: /u/gcmpack/models/MITgcmUV/eesupp/src/gsum_jam.F,v 1.1 2000/03/14 16:10:23 adcroft Exp $ |
2 |
adcroft |
1.1 |
|
3 |
|
|
#include "CPP_EEOPTIONS.h" |
4 |
|
|
|
5 |
|
|
#undef USE_MPI_GSUM |
6 |
|
|
#define USE_JAM_GSUM |
7 |
|
|
|
8 |
|
|
SUBROUTINE GLOBAL_SUM_R8_JAM( ans, myThid ) |
9 |
|
|
|
10 |
|
|
#ifdef ALLOW_MPI |
11 |
|
|
#include "mpif.h" |
12 |
|
|
#endif |
13 |
|
|
|
14 |
adcroft |
1.2 |
Real*8 ans |
15 |
adcroft |
1.1 |
INTEGER myThid |
16 |
|
|
|
17 |
|
|
#ifdef LETS_MAKE_JAM |
18 |
|
|
|
19 |
adcroft |
1.2 |
Real*8 phi |
20 |
adcroft |
1.1 |
INTEGER RC |
21 |
|
|
|
22 |
|
|
phi = ans |
23 |
|
|
|
24 |
|
|
#ifdef USE_MPI_GSUM |
25 |
|
|
CALL MPI_Allreduce( phi, |
26 |
|
|
& ans, |
27 |
|
|
& 1, |
28 |
|
|
& MPI_REAL8, |
29 |
|
|
& MPI_SUM, |
30 |
|
|
& MPI_COMM_WORLD, |
31 |
|
|
& rc |
32 |
|
|
& ) |
33 |
|
|
#endif |
34 |
|
|
|
35 |
|
|
#ifdef USE_JAM_GSUM |
36 |
|
|
C JAM global sum |
37 |
|
|
CALL JAM_barrier_start( phi ) |
38 |
|
|
CALL JAM_barrier_done( ans ) |
39 |
|
|
#endif |
40 |
|
|
|
41 |
|
|
C WRITE(6,*) ' phi = ', phi, ' Sum = ', ans |
42 |
|
|
C CALL MPI_Finalize( rc ) |
43 |
|
|
C STOP |
44 |
|
|
|
45 |
|
|
#endif /* LETS_MAKE_JAM */ |
46 |
|
|
|
47 |
|
|
RETURN |
48 |
|
|
END |