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

Contents 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.6.1 - (show annotations) (download)
Mon Apr 8 20:10:38 2002 UTC (22 years, 1 month ago) by heimbach
Branch: release1
CVS Tags: release1_p13_pre, release1_p13, release1_p8, release1_p9, release1_p1, release1_p2, release1_p3, release1_p4, release1_p5, release1_p6, release1_p7, release1_chkpt44d_post, release1_p11, release1_p12, release1_p10, release1_p16, release1_p17, release1_p14, release1_p15, release1_p12_pre
Branch point for: release1_50yr
Changes since 1.1: +0 -0 lines
Changes encapsulated by checkpoint43a-release1mods and chkpt44d_post
on the main trunk.
These are:

 o added missing EXCLUDE_MONITOR flags
 o changed "e" to "_d" in gmredi_slope_limit, gmredi_slope_psi
   (incompatible typ in MIN/MAX expressions caused problems
   on IBM SP3)
 o in genmake added variable MAKEDEPEND
   plus resetting for case SunOS
 o added timer_stats.c routine for IBM SP3
 o removed variables in dynamics
 o real fresh water flux implemented with non-linear free-surface.
 o few fix (mask in shap_s2, EmPmR in external_field_load,
   USE_NATURAL_BCS in solve_for_P);
 o add arguments myIter & myTime to S/R obcs_calc & solve_for_P
 o merge of relevant stuff from the ecco-branch:
   - genmake: removed $S64 overwrite for case SunOS
   - pkg/exf: update and corrections for field swapping and obcs
   - pkg/ecco: parameter lists for the_model_main, the_main_loop
               harmonized between ECCO and MITgcm
   - pkg/autodiff: added flow directives for obcs, mdsio_gl_slice
                   updated checkpointing_lev... lists for obcs
   - model/src: minor changes in forward_step, plot_field
                added directive for divided adjoint in the_main_loop
   - pkg/mdsio: added mdsio_gl_slice
 o check parameters & config (chkpt44a_pre,post)
 o OBC and NonLin_FrSurf.
 o fix bug in mom_vi_del2uv
 o select when filters are applied ; add options to zonal_filter (data.zonfilt)
 o gmredi: fix Pb in the adiabatic form ; add options (.e.g. Bolus advection)
 o update AIM experiments (NCEP input files)
 o improve and extend diagnostics (Monitor, TimeAve with NonLin-FrSurf)
 o added some stuff for AD

These were merged with
cvs co -r release1 -P MITgcm
cd MITgcm
cvs update -kk
cvs update -j checkpoint43a-release1mods -j chkpt44d_post -d -P -kk

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