1 |
heimbach |
1.3 |
C $Header: /u/gcmpack/models/MITgcmUV/pkg/debug/chksum_tiled.F,v 1.2 2001/02/02 21:36:29 adcroft Exp $ |
2 |
|
|
C $Name: checkpoint37 $ |
3 |
adcroft |
1.2 |
|
4 |
|
|
#include "CPP_OPTIONS.h" |
5 |
|
|
|
6 |
|
|
SUBROUTINE CHKSUM_TILED( str,fld,NN,bi,bj,myThid ) |
7 |
|
|
IMPLICIT NONE |
8 |
|
|
C Global/common |
9 |
|
|
#include "SIZE.h" |
10 |
|
|
#include "EEPARAMS.h" |
11 |
|
|
C Routines arguments |
12 |
|
|
CHARACTER*(*) str |
13 |
|
|
INTEGER NN,bi,bj,myThid |
14 |
|
|
_RL fld(1-OLx:sNx+OLx,1-OLy:sNy+OLy,NN,nSx,nSy) |
15 |
|
|
C Local |
16 |
|
|
INTEGER I,J,K |
17 |
|
|
INTEGER cnt |
18 |
|
|
_RL Fmn,Fmin,Fmax,Frms |
19 |
|
|
|
20 |
|
|
Fmn=0. |
21 |
|
|
Frms=0. |
22 |
|
|
Fmin=fld(1,1,1,bi,bj) |
23 |
|
|
Fmax=fld(1,1,1,bi,bj) |
24 |
|
|
cnt=0 |
25 |
|
|
DO K=1,NN |
26 |
|
|
DO J=1,sNy |
27 |
|
|
DO I=1,sNx |
28 |
|
|
Fmin=min(Fmin,fld(I,J,K,bi,bj)) |
29 |
|
|
Fmax=max(Fmax,fld(I,J,K,bi,bj)) |
30 |
|
|
Fmn=Fmn+fld(I,J,K,bi,bj) |
31 |
|
|
cnt=cnt+1 |
32 |
|
|
ENDDO |
33 |
|
|
ENDDO |
34 |
|
|
ENDDO |
35 |
|
|
Fmn=Fmn/float(cnt) |
36 |
|
|
DO K=1,NN |
37 |
|
|
DO J=1,sNy |
38 |
|
|
DO I=1,sNx |
39 |
|
|
Frms=Frms+(fld(I,J,K,bi,bj)-Fmn)**2 |
40 |
|
|
ENDDO |
41 |
|
|
ENDDO |
42 |
|
|
ENDDO |
43 |
|
|
Frms=sqrt(Frms/float(cnt)) |
44 |
|
|
|
45 |
heimbach |
1.3 |
write(*,'(a,1p4e12.5,1x,a)') |
46 |
adcroft |
1.2 |
& 'CHKSUM_TILED: ',Fmin,Fmax,Fmn,Frms,str |
47 |
|
|
|
48 |
|
|
RETURN |
49 |
|
|
END |