/[MITgcm]/MITgcm/pkg/diagnostics/diagnostics_fill_rs.F
ViewVC logotype

Annotation of /MITgcm/pkg/diagnostics/diagnostics_fill_rs.F

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


Revision 1.2 - (hide annotations) (download)
Wed Feb 17 17:42:42 2010 UTC (14 years, 3 months ago) by dimitri
Branch: MAIN
CVS Tags: checkpoint64i, checkpoint64h, checkpoint64k, checkpoint64j, checkpoint64m, checkpoint64l, 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, checkpoint63, checkpoint62c, checkpoint62g, checkpoint62f, checkpoint62e, checkpoint62d, checkpoint62k, checkpoint62j, checkpoint62i, checkpoint62h, checkpoint62o, checkpoint62n, checkpoint62m, checkpoint62l, checkpoint62s, checkpoint62r, checkpoint62q, checkpoint62p, checkpoint62w, checkpoint62v, checkpoint62u, checkpoint62t, checkpoint62z, checkpoint62y, checkpoint62x
Changes since 1.1: +2 -1 lines
adding a comment to define meaning of "local"

1 dimitri 1.2 C $Header: /u/gcmpack/MITgcm/pkg/diagnostics/diagnostics_fill_rs.F,v 1.1 2009/09/03 20:47:14 jmc Exp $
2 jmc 1.1 C $Name: $
3    
4     #include "DIAG_OPTIONS.h"
5    
6     CBOP
7     C !ROUTINE: DIAGNOSTICS_FILL_RS
8     C !INTERFACE:
9     SUBROUTINE DIAGNOSTICS_FILL_RS(
10     I inpFld, chardiag,
11     I kLev, nLevs, bibjFlg, biArg, bjArg, myThid )
12    
13     C !DESCRIPTION:
14     C***********************************************************************
15     C Wrapper routine to increment the diagnostics arrays with a RS field
16     C***********************************************************************
17     C !USES:
18     IMPLICIT NONE
19    
20     C == Global variables ===
21     #include "EEPARAMS.h"
22     #include "SIZE.h"
23     #include "DIAGNOSTICS_SIZE.h"
24     #include "DIAGNOSTICS.h"
25    
26     C !INPUT PARAMETERS:
27     C***********************************************************************
28     C Arguments Description
29     C ----------------------
30     C inpFld :: Field to increment diagnostics array
31     C chardiag :: Character expression for diag to fill
32     C kLev :: Integer flag for vertical levels:
33     C > 0 (any integer): WHICH single level to increment in qdiag.
34     C 0,-1 to increment "nLevs" levels in qdiag,
35     C 0 : fill-in in the same order as the input array
36     C -1: fill-in in reverse order.
37     C nLevs :: indicates Number of levels of the input field array
38     C (whether to fill-in all the levels (kLev<1) or just one (kLev>0))
39     C bibjFlg :: Integer flag to indicate instructions for bi bj loop
40     C 0 indicates that the bi-bj loop must be done here
41     C 1 indicates that the bi-bj loop is done OUTSIDE
42     C 2 indicates that the bi-bj loop is done OUTSIDE
43     C AND that we have been sent a local array (with overlap regions)
44 dimitri 1.2 C (local array here means that it has no bi-bj dimensions)
45 jmc 1.1 C 3 indicates that the bi-bj loop is done OUTSIDE
46     C AND that we have been sent a local array
47     C AND that the array has no overlap region (interior only)
48     C NOTE - bibjFlg can be NEGATIVE to indicate not to increment counter
49     C biArg :: X-direction tile number - used for bibjFlg=1-3
50     C bjArg :: Y-direction tile number - used for bibjFlg=1-3
51     C myThid :: my thread Id number
52     C***********************************************************************
53     C NOTE: User beware! If a local (1 tile only) array
54     C is sent here, bibjFlg MUST NOT be set to 0
55     C or there will be out of bounds problems!
56     C***********************************************************************
57     _RS inpFld(*)
58     CHARACTER*8 chardiag
59     INTEGER kLev, nLevs, bibjFlg, biArg, bjArg
60     INTEGER myThid
61     CEOP
62    
63     C !LOCAL VARIABLES:
64     C ndId :: diagnostic Id number (in available diagnostics list)
65     INTEGER m, n, j, k, l, bi, bj
66     INTEGER ndId, ipt, iSp
67     INTEGER region2fill(0:nRegions)
68     INTEGER arrType
69     _RL scaleFact
70     _RL dummyRL(1)
71     _RS dummyRS(1)
72     C ===============
73    
74     arrType = 2
75     scaleFact = 1. _d 0
76     IF ( bibjFlg.EQ.0 ) THEN
77     bi = myBxLo(myThid)
78     bj = myByLo(myThid)
79     ELSE
80     bi = biArg
81     bj = bjArg
82     ENDIF
83     C-- 2D/3D Diagnostics :
84     C Run through list of active diagnostics to make sure
85     C we are trying to fill a valid diagnostic
86     DO n=1,nlists
87     DO m=1,nActive(n)
88     IF ( chardiag.EQ.flds(m,n) .AND. idiag(m,n).GT.0 ) THEN
89     ipt = idiag(m,n)
90     IF ( ndiag(ipt,bi,bj).GE.0 ) THEN
91     ndId = jdiag(m,n)
92     ipt = ipt + pdiag(n,bi,bj)*kdiag(ndId)
93     C- diagnostic is valid & active, do the filling:
94     CALL DIAGNOSTICS_FILL_FIELD(
95     I dummyRL, dummyRL, inpFld, dummyRS,
96     I scaleFact, 1, arrType, 0,
97     I ndId, ipt, kLev, nLevs,
98     I bibjFlg, biArg, bjArg, myThid )
99     ENDIF
100     ENDIF
101     ENDDO
102     ENDDO
103    
104     C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
105     C-- Global/Regional Statistics :
106    
107     C Run through list of active statistics-diagnostics to make sure
108     C we are trying to compute & fill a valid diagnostic
109    
110     DO n=1,diagSt_nbLists
111     DO m=1,diagSt_nbActv(n)
112     IF ( chardiag.EQ.diagSt_Flds(m,n) .AND. iSdiag(m,n).GT.0 ) THEN
113     iSp = iSdiag(m,n)
114     IF ( qSdiag(0,0,iSp,bi,bj).GE.0. ) THEN
115     ndId = jSdiag(m,n)
116     C- Find list of regions to fill:
117     DO j=0,nRegions
118     region2fill(j) = diagSt_region(j,n)
119     ENDDO
120     C- if this diagnostics appears in several lists (with same freq)
121     C then add regions from other lists
122     DO l=1,diagSt_nbLists
123     DO k=1,diagSt_nbActv(l)
124     IF ( iSdiag(k,l).EQ.-iSp ) THEN
125     DO j=0,nRegions
126     region2fill(j) = MAX(region2fill(j),diagSt_region(j,l))
127     ENDDO
128     ENDIF
129     ENDDO
130     ENDDO
131     C- diagnostics is valid and Active: Now do the filling
132     CALL DIAGSTATS_FILL(
133     #ifdef REAL4_IS_SLOW
134     I inpFld, dummyRL,
135     #else
136     I dummyRL, dummyRL,
137     I inpFld, dummyRS,
138     #endif
139     I scaleFact, 1, arrType, 0,
140     I ndId, iSp, region2fill, kLev, nLevs,
141     I bibjFlg, biArg, bjArg, myThid )
142     ENDIF
143     ENDIF
144     ENDDO
145     ENDDO
146    
147     RETURN
148     END

  ViewVC Help
Powered by ViewVC 1.1.22