/[MITgcm]/MITgcm/pkg/autodiff/global_sum_tile_ad.F
ViewVC logotype

Contents of /MITgcm/pkg/autodiff/global_sum_tile_ad.F

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


Revision 1.6 - (show annotations) (download)
Tue Mar 29 23:09:39 2011 UTC (13 years, 1 month ago) by jmc
Branch: MAIN
CVS Tags: checkpoint64y, checkpoint64x, checkpoint64z, checkpoint64q, checkpoint64p, checkpoint64s, checkpoint64r, checkpoint64u, checkpoint64t, checkpoint64w, checkpoint64v, checkpoint64i, checkpoint64h, checkpoint64k, checkpoint64j, checkpoint64m, checkpoint64l, checkpoint64o, checkpoint64n, checkpoint64a, checkpoint64c, checkpoint64b, checkpoint64e, checkpoint64d, checkpoint64g, checkpoint64f, checkpoint63p, checkpoint63q, checkpoint63r, checkpoint63s, checkpoint63l, checkpoint63m, checkpoint63n, checkpoint63o, checkpoint63h, checkpoint63i, checkpoint63j, checkpoint63k, checkpoint63d, checkpoint63e, checkpoint63f, checkpoint63g, checkpoint63a, checkpoint63b, checkpoint63c, checkpoint64, checkpoint65, checkpoint63, checkpoint66g, checkpoint66f, checkpoint66e, checkpoint66d, checkpoint66c, checkpoint66b, checkpoint66a, checkpoint66o, checkpoint66n, checkpoint66m, checkpoint66l, checkpoint66k, checkpoint66j, checkpoint66i, checkpoint66h, checkpoint65z, checkpoint65x, checkpoint65y, checkpoint65r, checkpoint65s, checkpoint65p, checkpoint65q, checkpoint65v, checkpoint65w, checkpoint65t, checkpoint65u, checkpoint65j, checkpoint65k, checkpoint65h, checkpoint65i, checkpoint65n, checkpoint65o, checkpoint65l, checkpoint65m, checkpoint65b, checkpoint65c, checkpoint65a, checkpoint65f, checkpoint65g, checkpoint65d, checkpoint65e, checkpoint62w, checkpoint62v, checkpoint62z, checkpoint62y, checkpoint62x, HEAD
Changes since 1.5: +9 -6 lines
fix by comparing with TAF generated adjoint of a simplified global_sum_tile.F

1 C $Header: /u/gcmpack/MITgcm/pkg/autodiff/global_sum_tile_ad.F,v 1.5 2011/03/18 10:40:37 mlosch Exp $
2 C $Name: $
3
4 #include "AUTODIFF_OPTIONS.h"
5
6 C-- File global_sum_tile_ad.F: Routines that perform adjoint of
7 C global sum on an array of thread values.
8 C Contents
9 C o GLOBAL_ADSUM_TILE_RL
10 C o GLOBAL_ADSUM_TILE_RS <- not yet coded
11
12 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
13 CBOP
14 C !ROUTINE: GLOBAL_ADSUM_TILE_RL
15
16 C !INTERFACE:
17 SUBROUTINE GLOBAL_ADSUM_TILE_RL(
18 U adPhiTile,
19 U adsumPhi,
20 I myThid )
21
22 C !DESCRIPTION:
23 C *==========================================================*
24 C | SUBROUTINE GLOBAL\_ADSUM\_TILE\_RL
25 C | o Adjoint version of global_sum_tile which returns
26 C | global sum over all tiles
27 C | Note: Assume that adsumPhi is local to this thread
28 C | (i.e., is not a shared var. and is not in a common block)
29 C *==========================================================*
30 C | Apply sum on an array of one value per tile
31 C | and operate over all tiles & all the processes.
32 C *==========================================================*
33
34 C !USES:
35 IMPLICIT NONE
36
37 C == Global data ==
38 #include "SIZE.h"
39 #include "EEPARAMS.h"
40
41 C !INPUT/OUTPUT PARAMETERS:
42 C == Routine arguments ==
43 C phiTile :: Input array with one value per tile
44 C sumPhi :: Result of sum.
45 C myThid :: My Thread Id.
46 _RL adphiTile(nSx,nSy)
47 _RL adsumPhi
48 INTEGER myThid
49 CEOP
50
51 C !LOCAL VARIABLES:
52 C == Local variables ==
53 C bi,bj :: tile indices
54 INTEGER bi,bj
55 Real*8 tmp
56
57 C note: arithmetic has been checked versus TAF generated adjoint
58 C of a simplified version of global_sum_tile.F code.
59
60 tmp = adsumPhi
61
62 CALL GLOBAL_SUM_R8( tmp, myThid )
63
64 C-- each thread updates its tile adjoint sum
65 DO bj = myByLo(myThid), myByHi(myThid)
66 DO bi = myBxLo(myThid), myBxHi(myThid)
67 adphiTile(bi,bj) = adphiTile(bi,bj) + tmp
68 ENDDO
69 ENDDO
70
71 adsumPhi = 0.
72
73 RETURN
74 END

  ViewVC Help
Powered by ViewVC 1.1.22