/[MITgcm]/MITgcm_contrib/cg2d_bench/gsum.F
ViewVC logotype

Contents of /MITgcm_contrib/cg2d_bench/gsum.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.2 - (show annotations) (download)
Fri May 12 22:23:10 2006 UTC (17 years, 11 months ago) by ce107
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +22 -3 lines
Fixed for single/double precision and also mixed precision (double for
global sums only)

1 C $Id$
2 SUBROUTINE GSUM_R8( ans, phi )
3
4 #include "EEPARAMS.h"
5 #ifdef ALLOW_MPI
6 #include "mpif.h"
7 #include "MPI_INFO.h"
8 #endif
9
10 #ifdef USE_MIXED_PRECISION
11 REAL*8 ans
12 REAL*8 phi
13 #else
14 Real ans
15 Real phi
16 #endif
17
18 INTEGER RC
19
20 ans = phi
21
22 #ifdef USE_MPI_GSUM
23 #ifdef USE_MIXED_PRECISION
24 CALL MPI_Allreduce( phi,
25 & ans,
26 & 1,
27 & MPI_REAL8,
28 & MPI_SUM,
29 & comm_use,
30 & rc
31 & )
32 #else
33 CALL MPI_Allreduce( phi,
34 & ans,
35 & 1,
36 & _MPI_TYPE_REAL,
37 & MPI_SUM,
38 & comm_use,
39 & rc
40 & )
41 #endif
42 #endif
43
44 #ifdef USE_JAM_GSUM
45 C JAM global sum
46 CALL JAM_barrier_start( phi )
47 CALL JAM_barrier_done( ans )
48 #endif
49
50 C WRITE(6,*) ' phi = ', phi, ' Sum = ', ans
51 C CALL MPI_Finalize( rc )
52 C STOP
53
54 RETURN
55 END

  ViewVC Help
Powered by ViewVC 1.1.22