7 |
C !ROUTINE: DIAGSTATS_FILL |
C !ROUTINE: DIAGSTATS_FILL |
8 |
C !INTERFACE: |
C !INTERFACE: |
9 |
SUBROUTINE DIAGSTATS_FILL( |
SUBROUTINE DIAGSTATS_FILL( |
10 |
I inpFld, fractFld, scaleFact, nLevFract, |
I inpFld, fractFld, scaleFact, power, nLevFract, |
11 |
I ndId, kInQSd, region2fill, kLev, nLevs, |
I ndId, kInQSd, region2fill, kLev, nLevs, |
12 |
I bibjflg, biArg, bjArg, myThid ) |
I bibjflg, biArg, bjArg, myThid ) |
13 |
|
|
14 |
C !DESCRIPTION: |
C !DESCRIPTION: |
15 |
C*********************************************************************** |
C*********************************************************************** |
16 |
C compute statistics over 1 tile |
C compute statistics over 1 tile |
17 |
C and increment the diagnostics array |
C and increment the diagnostics array |
18 |
C using a scaling factor |
C using a scaling factor & square option (power=2), |
19 |
C and with the option to use a fraction-weight (assumed |
C and with the option to use a fraction-weight (assumed |
20 |
C to be the counter-mate of the current diagnostics) |
C to be the counter-mate of the current diagnostics) |
21 |
C*********************************************************************** |
C*********************************************************************** |
32 |
C*********************************************************************** |
C*********************************************************************** |
33 |
C Arguments Description |
C Arguments Description |
34 |
C ---------------------- |
C ---------------------- |
35 |
C inpFld ..... Field to increment diagnostics array |
C inpFld :: Field to increment diagnostics array |
36 |
C fractFld ... fraction used for weighted average diagnostics |
C fractFld :: fraction used for weighted average diagnostics |
37 |
C scaleFact .. scaling factor |
C scaleFact :: scaling factor |
38 |
C nLevFract .. number of levels of the fraction field, =0 : do not use fraction |
C power :: option to fill-in with the field square (power=2) |
39 |
C ndId ... Diagnostics Id Number (in available diag list) of diag to process |
C nLevFract :: number of levels of the fraction field, =0 : do not use fraction |
40 |
C kInQSd ... Pointer to the slot in qSdiag to fill |
C ndId :: Diagnostics Id Number (in available diag list) of diag to process |
41 |
C region2fill array, indicates whether to compute statistics over region |
C kInQSd :: Pointer to the slot in qSdiag to fill |
42 |
|
C region2fill :: array, indicates whether to compute statistics over region |
43 |
C "j" (if region2fill(j)=1) or not (if region2fill(j)=0) |
C "j" (if region2fill(j)=1) or not (if region2fill(j)=0) |
44 |
C kLev ..... Integer flag for vertical levels: |
C kLev :: Integer flag for vertical levels: |
45 |
C > 0 (any integer): WHICH single level to increment in qSdiag. |
C > 0 (any integer): WHICH single level to increment in qSdiag. |
46 |
C 0,-1 to increment "nLevs" levels in qSdiag, |
C 0,-1 to increment "nLevs" levels in qSdiag, |
47 |
C 0 : fill-in in the same order as the input array |
C 0 : fill-in in the same order as the input array |
48 |
C -1: fill-in in reverse order. |
C -1: fill-in in reverse order. |
49 |
C nLevs ...... indicates Number of levels of the input field array |
C nLevs :: indicates Number of levels of the input field array |
50 |
C (whether to fill-in all the levels (kLev<1) or just one (kLev>0)) |
C (whether to fill-in all the levels (kLev<1) or just one (kLev>0)) |
51 |
C bibjflg .... Integer flag to indicate instructions for bi bj loop |
C bibjflg :: Integer flag to indicate instructions for bi bj loop |
52 |
C 0 indicates that the bi-bj loop must be done here |
C 0 indicates that the bi-bj loop must be done here |
53 |
C 1 indicates that the bi-bj loop is done OUTSIDE |
C 1 indicates that the bi-bj loop is done OUTSIDE |
54 |
C 2 indicates that the bi-bj loop is done OUTSIDE |
C 2 indicates that the bi-bj loop is done OUTSIDE |
57 |
C AND that we have been sent a local array |
C AND that we have been sent a local array |
58 |
C AND that the array has no overlap region (interior only) |
C AND that the array has no overlap region (interior only) |
59 |
C NOTE - bibjflg can be NEGATIVE to indicate not to increment counter |
C NOTE - bibjflg can be NEGATIVE to indicate not to increment counter |
60 |
C biArg ...... X-direction tile number - used for bibjflg=1-3 |
C biArg :: X-direction tile number - used for bibjflg=1-3 |
61 |
C bjArg ...... Y-direction tile number - used for bibjflg=1-3 |
C bjArg :: Y-direction tile number - used for bibjflg=1-3 |
62 |
C myThid :: my thread Id number |
C myThid :: my thread Id number |
63 |
C*********************************************************************** |
C*********************************************************************** |
64 |
C NOTE: User beware! If a local (1 tile only) array |
C NOTE: User beware! If a local (1 tile only) array |
65 |
C is sent here, bibjflg MUST NOT be set to 0 |
C is sent here, bibjflg MUST NOT be set to 0 |
68 |
_RL inpFld(*) |
_RL inpFld(*) |
69 |
_RL fractFld(*) |
_RL fractFld(*) |
70 |
_RL scaleFact |
_RL scaleFact |
71 |
|
INTEGER power |
72 |
INTEGER nLevFract |
INTEGER nLevFract |
73 |
INTEGER ndId, kInQSd |
INTEGER ndId, kInQSd |
74 |
INTEGER region2fill(0:nRegions) |
INTEGER region2fill(0:nRegions) |
78 |
|
|
79 |
C !LOCAL VARIABLES: |
C !LOCAL VARIABLES: |
80 |
C =============== |
C =============== |
81 |
C useFract :: flag to increment (or not) with fraction-weigted inpFld |
C useFract :: flag to increment (or not) with fraction-weigted inpFld |
82 |
LOGICAL useFract |
LOGICAL useFract |
83 |
INTEGER sizF |
INTEGER sizF |
84 |
INTEGER sizI1,sizI2,sizJ1,sizJ2 |
INTEGER sizI1,sizI2,sizJ1,sizJ2 |
198 |
km = km0 + ksgn*k |
km = km0 + ksgn*k |
199 |
CALL DIAGSTATS_LOCAL( |
CALL DIAGSTATS_LOCAL( |
200 |
U qSdiag(0,0,kd,bi,bj), |
U qSdiag(0,0,kd,bi,bj), |
201 |
I inpFld, fractFld, scaleFact, useFract, sizF, |
I inpFld, fractFld, |
202 |
|
I scaleFact, power, useFract, sizF, |
203 |
I sizI1,sizI2,sizJ1,sizJ2,nLevs,sizTx,sizTy, |
I sizI1,sizI2,sizJ1,sizJ2,nLevs,sizTx,sizTy, |
204 |
I iRun,jRun,k,bi,bj, |
I iRun,jRun,k,bi,bj, |
205 |
I km, bi, bj, region2fill, |
I km, bi, bj, region2fill, |
215 |
km = km0 + ksgn*k |
km = km0 + ksgn*k |
216 |
CALL DIAGSTATS_LOCAL( |
CALL DIAGSTATS_LOCAL( |
217 |
U qSdiag(0,0,kd,biArg,bjArg), |
U qSdiag(0,0,kd,biArg,bjArg), |
218 |
I inpFld, fractFld, scaleFact, useFract, sizF, |
I inpFld, fractFld, |
219 |
|
I scaleFact, power, useFract, sizF, |
220 |
I sizI1,sizI2,sizJ1,sizJ2,nLevs,sizTx,sizTy, |
I sizI1,sizI2,sizJ1,sizJ2,nLevs,sizTx,sizTy, |
221 |
I iRun,jRun,k,bi,bj, |
I iRun,jRun,k,bi,bj, |
222 |
I km, biArg, bjArg, region2fill, |
I km, biArg, bjArg, region2fill, |