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

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

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


Revision 1.2 - (hide annotations) (download)
Mon May 23 01:58:27 2005 UTC (19 years ago) by jmc
Branch: MAIN
CVS Tags: checkpoint57t_post, checkpoint57o_post, checkpoint57m_post, checkpoint57s_post, checkpoint57k_post, checkpoint57i_post, checkpoint57v_post, checkpoint57r_post, checkpoint57n_post, checkpoint57w_post, checkpoint57p_post, checkpint57u_post, checkpoint57q_post, checkpoint57j_post, checkpoint57l_post
Changes since 1.1: +2 -2 lines
minor modification.

1 jmc 1.2 C $Header: /u/gcmpack/MITgcm/pkg/diagnostics/diagstats_ascii_out.F,v 1.1 2005/05/20 07:28:50 jmc Exp $
2 jmc 1.1 C $Name: $
3    
4     #include "DIAG_OPTIONS.h"
5    
6     C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
7     CBOP 0
8     C !ROUTINE: DIAGSTATS_ASCII_OUT
9    
10     C !INTERFACE:
11     SUBROUTINE DIAGSTATS_ASCII_OUT(
12     I statGlob, nLev, ndId,
13     I mId, listId, myIter, myThid )
14    
15     C !DESCRIPTION:
16     C Write Global statistic to ASCII file
17    
18     C !USES:
19     IMPLICIT NONE
20     #include "SIZE.h"
21     #include "EEPARAMS.h"
22     #include "EESUPPORT.h"
23     #include "DIAGNOSTICS_SIZE.h"
24     #include "DIAGNOSTICS.h"
25    
26     C !INPUT PARAMETERS:
27     C statGlob ..... AVERAGED DIAGNOSTIC QUANTITY
28     C nLev .... 2nd Dimension (max Nb of levels) of statGlob array
29     C ndId ... diagnostic Id number (in diagnostics long list)
30     C mId ..... field rank in list "listId"
31     C listId ..... current output Stream list
32     C myIter ..... current Iteration Number
33     C myThid ..... my thread Id number
34     INTEGER nLev
35     _RL statGlob(0:nStats,0:nLev,0:nRegions)
36     INTEGER ndId, mId, listId
37     INTEGER myIter, myThid
38     CEOP
39    
40     C !LOCAL VARIABLES:
41     INTEGER im, ix, iv
42     PARAMETER ( iv = nStats - 2 , im = nStats - 1 , ix = nStats )
43     INTEGER i, j, k, klev, nUnit
44     CHARACTER*(MAX_LEN_MBUF) msgBuf
45    
46     C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
47    
48     _BEGIN_MASTER( myThid)
49    
50     #ifdef ALLOW_USE_MPI
51     IF ( diagSt_Ascii .AND. mpiMyId.EQ.0 ) THEN
52     #else
53     IF ( diagSt_Ascii ) THEN
54     #endif
55    
56     nUnit = diagSt_ioUnit(listId)
57     klev = kdiag(ndId)
58     C- single level field: Vertical Integral (k=0) & 1rst level are identical
59     C => write only 1 of the 2:
60     IF ( klev.EQ.1 ) kLev = 0
61     C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
62     DO j=0,nRegions
63     IF ( diagSt_region(j,listId).GE.1 ) THEN
64     WRITE(nUnit,'(3A,I10,2(A,I4))') ' field : ', cdiag(ndId),
65 jmc 1.2 & ' ; Iter =',myIter,' ; region #',j, ' ; nb.Lev =',kdiag(ndId)
66 jmc 1.1 c WRITE(nUnit,'(5A)') ' k |',
67     c & ' -- Average -- |', ' -- Std.Dev -- |',
68     c & ' -- min -- |', ' -- max -- |'
69     WRITE(nUnit,'(6A)') ' k |',
70     & ' -- Average -- |', ' -- Std.Dev -- |',
71     & ' -- min -- |', ' -- max -- |',' Vol'
72     DO k=0,klev
73     C full precision, do not write the volume:
74     c WRITE(nUnit,'(I3,1P4E20.12)') k,(statGlob(i,k,j),i=1,nStats)
75     C reduced precision + write the volume (usefull for testing):
76     WRITE(nUnit,'(I3,1P4E18.10,1X,1PE12.5)')
77     & k, (statGlob(i,k,j),i=1,nStats), statGlob(0,k,j)
78     ENDDO
79     ENDIF
80     ENDDO
81     WRITE(nUnit,'(A)') ' '
82     C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
83     ENDIF
84    
85     _END_MASTER( myThid )
86    
87     RETURN
88     END

  ViewVC Help
Powered by ViewVC 1.1.22