/[MITgcm]/MITgcm/pkg/compon_communic/generate_tag.F
ViewVC logotype

Contents of /MITgcm/pkg/compon_communic/generate_tag.F

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


Revision 1.3 - (show annotations) (download)
Thu Oct 23 16:05:21 2014 UTC (9 years, 7 months ago) by jmc
Branch: MAIN
CVS Tags: 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, checkpoint65g, HEAD
Changes since 1.2: +14 -13 lines
simplify the tag number expression ignoring argument "carg":
- only the first 3 characters were relevant for the tag and happen
  to always be identical ('ATM' or 'OCN') for a given component.
- new tag value is much smaller and should fit standard MPI limit.

1 C $Header: /u/gcmpack/MITgcm/pkg/compon_communic/generate_tag.F,v 1.2 2007/10/08 23:58:20 jmc Exp $
2 C $Name: $
3
4 !=======================================================================
5 integer function generate_tag( iarg1, iarg2, carg )
6 implicit none
7 ! Predefined constants/arrays
8 #include "CPLR_SIG.h"
9 ! Arguments
10 integer iarg1
11 integer iarg2
12 character*(*) carg
13 ! Local
14 c integer j,hash,pow
15 c integer itrans(MAXLEN_COMP_NAME)
16 ! ------------------------------------------------------------------
17
18 ! Convert the characters to an integer array
19 c call mitcplr_char2int( carg, itrans )
20
21 ! Hash the integer array
22 c hash=1
23 c pow=1
24 c do j=1,MAXLEN_COMP_NAME
25 c hash=abs(hash+itrans(j)*pow)
26 c pow=mod(pow*128,256*256)
27 c enddo
28
29 c generate_tag=(hash*256+iarg2)*128+iarg1
30 c generate_tag=abs(mod(generate_tag,256*256*256))
31 generate_tag = iarg1*MAX_TILES + iarg2
32
33 c if (DEBUG)
34 c & write(0,*) 'generate_tag = ',generate_tag,iarg1,iarg2,carg
35
36 ! ------------------------------------------------------------------
37 return
38 end
39 !=======================================================================

  ViewVC Help
Powered by ViewVC 1.1.22