/[MITgcm]/MITgcm/pkg/debug/debug_fld_stats_rs.F
ViewVC logotype

Annotation of /MITgcm/pkg/debug/debug_fld_stats_rs.F

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


Revision 1.1 - (hide annotations) (download)
Fri Feb 15 21:25:44 2002 UTC (22 years, 2 months ago) by heimbach
Branch: MAIN
CVS Tags: checkpoint46n_post, checkpoint47e_post, checkpoint44e_post, checkpoint46l_post, checkpoint46g_pre, checkpoint47c_post, checkpoint50c_post, checkpoint46f_post, checkpoint48e_post, checkpoint50c_pre, checkpoint44f_post, checkpoint46b_post, checkpoint48i_post, checkpoint46l_pre, chkpt44d_post, checkpoint51, checkpoint50, checkpoint50d_post, checkpoint50b_pre, checkpoint44e_pre, checkpoint51f_post, checkpoint48b_post, checkpoint51d_post, checkpoint48c_pre, checkpoint47d_pre, checkpoint47a_post, checkpoint48d_pre, checkpoint51j_post, checkpoint47i_post, checkpoint47d_post, checkpoint46d_pre, checkpoint48d_post, checkpoint48f_post, checkpoint45d_post, checkpoint46j_pre, checkpoint44h_pre, checkpoint48h_post, checkpoint51b_pre, checkpoint46a_post, checkpoint47g_post, checkpoint46j_post, checkpoint51h_pre, checkpoint46k_post, checkpoint48a_post, checkpoint45a_post, checkpoint50f_post, checkpoint50a_post, checkpoint50f_pre, ecco_c44_e18, ecco_c44_e17, checkpoint47j_post, branch-exfmods-tag, checkpoint44g_post, branchpoint-genmake2, checkpoint46e_pre, checkpoint48c_post, checkpoint45b_post, checkpoint46b_pre, release1_final_v1, checkpoint51b_post, checkpoint51c_post, checkpoint46c_pre, checkpoint46, checkpoint47b_post, checkpoint46h_pre, checkpoint46m_post, checkpoint46a_pre, checkpoint50g_post, checkpoint45c_post, checkpoint44h_post, checkpoint46g_post, checkpoint50h_post, checkpoint50e_pre, checkpoint50i_post, checkpoint51i_pre, checkpoint47f_post, checkpoint50e_post, checkpoint46i_post, checkpoint46c_post, checkpoint50d_pre, checkpoint46e_post, checkpoint51e_post, checkpoint47, checkpoint45, checkpoint48, checkpoint49, checkpoint46h_post, checkpoint51f_pre, checkpoint48g_post, checkpoint47h_post, checkpoint44f_pre, checkpoint51g_post, checkpoint46d_post, checkpoint50b_post, checkpoint51a_post
Branch point for: branch-exfmods-curt, release1_final, branch-genmake2, release1, ecco-branch
Added missing debug_fld_stats_rs routine.

1 heimbach 1.1
2     #include "CPP_OPTIONS.h"
3    
4     SUBROUTINE DEBUG_FLD_STATS_RS(
5     I myNr, arr,
6     O theMin,theMax,theMean,theSD,
7     I myThid )
8     C /==========================================================\
9     C | SUBROUTINE DEBUG_FLD_STATS_RS |
10     C | o Calculate bare statistics of global array "_RS arr" |
11     C |==========================================================|
12     C \==========================================================/
13     IMPLICIT NONE
14    
15     C === Global data ===
16     #include "SIZE.h"
17     #include "EEPARAMS.h"
18    
19     C === Routine arguments ===
20     INTEGER myNr
21     _RS arr(1-OLx:sNx+OLx,1-OLy:sNy+OLy,myNr,nSx,nSy)
22     _RL theMin
23     _RL theMax
24     _RL theMean
25     _RL theSD
26     INTEGER myThid
27    
28     C === Local variables ====
29     INTEGER bi,bj,I,J,K
30     INTEGER numPnts
31     LOGICAL noPnts
32     _RL tmpVal,rNumPnts
33     _RL theVar
34    
35     theMin=0.
36     theMax=0.
37     theMean=0.
38     theSD=0.
39     theVar=0.
40     numPnts=0
41     noPnts=.TRUE.
42    
43     DO bj=myByLo(myThid),myByHi(myThid)
44     DO bi=myBxLo(myThid),myBxHi(myThid)
45     DO K=1,myNr
46     DO J=1,sNy
47     DO I=1,sNx
48     tmpVal=arr(I,J,K,bi,bj)
49     IF (tmpVal.NE.0. .AND. noPnts) THEN
50     theMin=tmpVal
51     theMax=tmpVal
52     noPnts=.FALSE.
53     ENDIF
54     IF (tmpVal.NE.0.) THEN
55     theMin=min(theMin,tmpVal)
56     theMax=max(theMax,tmpVal)
57     theMean=theMean+tmpVal
58     theVar=theVar+tmpVal**2
59     numPnts=numPnts+1
60     ENDIF
61     ENDDO
62     ENDDO
63     ENDDO
64     ENDDO
65     ENDDO
66    
67     theMin=-theMin
68     _GLOBAL_MAX_R8(theMin,myThid)
69     theMin=-theMin
70     _GLOBAL_MAX_R8(theMax,myThid)
71     _GLOBAL_SUM_R8(theMean,myThid)
72     _GLOBAL_SUM_R8(theVar,myThid)
73     tmpVal=FLOAT(numPnts)
74     _GLOBAL_SUM_R8(tmpVal,myThid)
75     numPnts=INT(tmpVal+0.5)
76    
77     IF (tmpVal.GT.0.) THEN
78     rNumPnts=1./tmpVal
79     theMean=theMean*rNumPnts
80     theVar=theVar*rNumPnts
81    
82     DO bj=myByLo(myThid),myByHi(myThid)
83     DO bi=myBxLo(myThid),myBxHi(myThid)
84     DO K=1,myNr
85     DO J=1,sNy
86     DO I=1,sNx
87     tmpVal=arr(I,J,K,bi,bj)
88     IF (tmpVal.NE.0.) THEN
89     theSD=theSD+(tmpVal-theMean)**2
90     ENDIF
91     ENDDO
92     ENDDO
93     ENDDO
94     ENDDO
95     ENDDO
96    
97     _GLOBAL_SUM_R8(theSD,myThid)
98    
99     theSD=sqrt(theSD*rNumPnts)
100     c theSD=sqrt(theVar-theMean**2)
101     ENDIF
102    
103     RETURN
104     END

  ViewVC Help
Powered by ViewVC 1.1.22