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

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

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


Revision 1.4 - (hide annotations) (download)
Tue Feb 5 15:31:19 2008 UTC (16 years, 3 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint64y, checkpoint64x, checkpoint64z, checkpoint64q, checkpoint64p, checkpoint64s, checkpoint64r, checkpoint64u, checkpoint64t, checkpoint64w, checkpoint64v, checkpoint64i, checkpoint64h, checkpoint64k, checkpoint64j, checkpoint64m, checkpoint64l, checkpoint64o, checkpoint64n, checkpoint64a, checkpoint64c, checkpoint64b, checkpoint64e, checkpoint64d, checkpoint64g, checkpoint64f, checkpoint63p, checkpoint63q, checkpoint63r, checkpoint63s, checkpoint63l, checkpoint63m, checkpoint63n, checkpoint63o, checkpoint63h, checkpoint63i, checkpoint63j, checkpoint63k, checkpoint63d, checkpoint63e, checkpoint63f, checkpoint63g, checkpoint63a, checkpoint63b, checkpoint63c, checkpoint64, checkpoint65, checkpoint60, checkpoint61, checkpoint62, checkpoint63, checkpoint66e, checkpoint66d, checkpoint66c, checkpoint66b, checkpoint66a, checkpoint65z, checkpoint65x, checkpoint65y, checkpoint65r, checkpoint65s, checkpoint65p, checkpoint65q, checkpoint65v, checkpoint65w, checkpoint65t, checkpoint65u, checkpoint65j, checkpoint65k, checkpoint65h, checkpoint65i, checkpoint65n, checkpoint65o, checkpoint65l, checkpoint65m, checkpoint65b, checkpoint65c, checkpoint65a, checkpoint65f, checkpoint65g, checkpoint65d, checkpoint65e, checkpoint59q, checkpoint59p, checkpoint59r, checkpoint59o, checkpoint59n, checkpoint62c, checkpoint62b, checkpoint62a, checkpoint62g, checkpoint62f, checkpoint62e, checkpoint62d, checkpoint62k, checkpoint62j, checkpoint62i, checkpoint62h, checkpoint62o, checkpoint62n, checkpoint62m, checkpoint62l, checkpoint62s, checkpoint62r, checkpoint62q, checkpoint62p, checkpoint62w, checkpoint62v, checkpoint62u, checkpoint62t, checkpoint62z, checkpoint62y, checkpoint62x, checkpoint61f, checkpoint61g, checkpoint61d, checkpoint61e, checkpoint61b, checkpoint61c, checkpoint61a, checkpoint61n, checkpoint61o, checkpoint61l, checkpoint61m, checkpoint61j, checkpoint61k, checkpoint61h, checkpoint61i, checkpoint61v, checkpoint61w, checkpoint61t, checkpoint61u, checkpoint61r, checkpoint61s, checkpoint61p, checkpoint61q, checkpoint61z, checkpoint61x, checkpoint61y
Changes since 1.3: +6 -6 lines
minor modifications for many diagnostics:
- modify "available_diagnostics.log" and diagnostics summary (write mate number)
- use wider (integer) format (generally, use I6) to write diagnostics number
- rename numdiags --> numDiags (to differentiate from mdiag)

1 jmc 1.4 C $Header: /u/gcmpack/MITgcm/pkg/diagnostics/diagstats_ini_io.F,v 1.3 2006/02/21 01:23:57 jmc Exp $
2 jmc 1.1 C $Name: $
3    
4     #include "DIAG_OPTIONS.h"
5    
6     CBOP
7     C !ROUTINE: DIAGSTATS_INI_IO
8     C !INTERFACE:
9     SUBROUTINE DIAGSTATS_INI_IO( myThid )
10    
11     C !DESCRIPTION: \bv
12     C *==================================================================
13     C | S/R DIAGSTATS_INI_IO
14     C | o set I/O unit for ASCII output file
15     C *==================================================================
16     C \ev
17    
18     C !USES:
19     IMPLICIT NONE
20    
21     C == Global variables ===
22     #include "SIZE.h"
23     #include "EEPARAMS.h"
24     #include "EESUPPORT.h"
25     #include "PARAMS.h"
26     #include "DIAGNOSTICS_SIZE.h"
27     #include "DIAGNOSTICS.h"
28    
29     C !INPUT/OUTPUT PARAMETERS:
30     C == Routine arguments ==
31     C myThid - Thread number for this instance of the routine.
32     INTEGER myThid
33     CEOP
34    
35     C !LOCAL VARIABLES:
36     C == Local variables ==
37     INTEGER m, n, j, iL, nUnit
38     CHARACTER*(MAX_LEN_FNAM) dataFName
39 jmc 1.2 CHARACTER*(MAX_LEN_MBUF) msgBuf, tmpBuf
40 jmc 1.1 INTEGER ILNBLNK
41     EXTERNAL ILNBLNK
42    
43     _BEGIN_MASTER( myThid)
44    
45     #ifdef ALLOW_USE_MPI
46     IF ( diagSt_Ascii .AND. mpiMyId.EQ.0 ) THEN
47     #else
48     IF ( diagSt_Ascii ) THEN
49     #endif
50    
51     DO n=1,diagSt_nbLists
52    
53     C- get a free unit number as the I/O channel for this routine
54     CALL MDSFINDUNIT( nUnit, myThid )
55     diagSt_ioUnit(n) = nUnit
56    
57     iL = ILNBLNK(diagSt_Fname(n))
58     WRITE(dataFName,'(2A,I10.10,A)')
59     & diagSt_Fname(n)(1:iL), '.', nIter0, '.txt'
60     OPEN( nUnit, FILE=dataFName, STATUS='unknown' )
61    
62 jmc 1.4 WRITE(msgBuf,'(4A,I6)') 'DIAGSTATS_INI_IO: ',
63 jmc 1.1 & 'open file: ',dataFName(1:iL+15), ' , unit=', nUnit
64     CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
65     & SQUEEZE_RIGHT , myThid)
66    
67     C- write a kind of header:
68     WRITE(nUnit,'(2A)') '# header of file: ',
69     & diagSt_Fname(n)(1:iL)
70     WRITE(nUnit,'(A,F17.6)') '# frequency (s): ', diagSt_freq(n)
71     WRITE(nUnit,'(A,F17.6)') '# phase (s) : ', diagSt_phase(n)
72     WRITE(msgBuf,'(A)') '# Regions : '
73     iL = 17
74     DO j=0,nRegions
75     IF (diagSt_region(j,n).GE.1 .AND.iL+3.LE.MAX_LEN_MBUF) THEN
76 jmc 1.2 tmpBuf(1:iL) = msgBuf(1:iL)
77 jmc 1.4 WRITE(msgBuf,'(A,I3)') tmpBuf(1:iL),j
78 jmc 1.1 iL = iL+3
79     ENDIF
80     ENDDO
81 jmc 1.3 WRITE(nUnit,'(A)') msgBuf(1:iL)
82 jmc 1.1 DO j=1,diagSt_nbFlds(n),10
83 jmc 1.4 WRITE(nUnit,'(A,20A)') '# Fields :',
84 jmc 1.1 & (' ', diagSt_Flds(m,n), m=j,MIN(diagSt_nbFlds(n),j+9) )
85     ENDDO
86 jmc 1.3 DO j=1,diagSt_nbFlds(n),50
87 jmc 1.4 WRITE(nUnit,'(A,50I4)') '# Nb of levels : ',
88 jmc 1.3 & ( kdiag(jSdiag(m,n)), m=j,MIN(diagSt_nbFlds(n),j+49) )
89     ENDDO
90 jmc 1.1 WRITE(nUnit,'(2A)') '# end of header ----------------------',
91     & '--------------------------------------'
92     WRITE(nUnit,'(A)') ' '
93    
94     ENDDO
95 jmc 1.4
96 jmc 1.1 ENDIF
97    
98     _END_MASTER( myThid )
99    
100     RETURN
101     END

  ViewVC Help
Powered by ViewVC 1.1.22