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

Contents of /MITgcm/pkg/diagnostics/diagstats_close_io.F

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


Revision 1.1 - (show annotations) (download)
Fri May 20 07:28:51 2005 UTC (19 years ago) by jmc
Branch: MAIN
CVS Tags: checkpoint58l_post, checkpoint57t_post, checkpoint57o_post, checkpoint58e_post, mitgcm_mapl_00, checkpoint58u_post, checkpoint58w_post, checkpoint57m_post, checkpoint57s_post, checkpoint57k_post, checkpoint58r_post, checkpoint57i_post, checkpoint57y_post, checkpoint58n_post, checkpoint58x_post, checkpoint58t_post, checkpoint58h_post, checkpoint57y_pre, checkpoint58q_post, checkpoint57v_post, checkpoint58j_post, checkpoint59e, checkpoint59d, checkpoint59g, checkpoint59f, checkpoint59a, checkpoint59c, checkpoint59b, checkpoint59m, checkpoint59l, checkpoint59i, checkpoint59h, checkpoint59k, checkpoint59j, checkpoint57r_post, checkpoint59, checkpoint58, checkpoint58f_post, checkpoint57x_post, checkpoint57n_post, checkpoint58d_post, checkpoint58c_post, checkpoint57w_post, checkpoint57p_post, checkpint57u_post, checkpoint58a_post, checkpoint58i_post, checkpoint57q_post, checkpoint58g_post, checkpoint58o_post, checkpoint57z_post, checkpoint58y_post, checkpoint58k_post, checkpoint58v_post, checkpoint58s_post, checkpoint58p_post, checkpoint57j_post, checkpoint58b_post, checkpoint58m_post, checkpoint57l_post
Add new capability: compute & write Global/Regional & per level statistics

1 C $Header: $
2 C $Name: $
3
4 #include "DIAG_OPTIONS.h"
5
6 CBOP
7 C !ROUTINE: DIAGSTATS_CLOSE_IO
8 C !INTERFACE:
9 SUBROUTINE DIAGSTATS_CLOSE_IO( myThid )
10
11 C !DESCRIPTION: \bv
12 C *==================================================================
13 C | S/R DIAGSTATS_CLOSE_IO
14 C | o Close I/O unit of 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 n, iL, nUnit
38 CHARACTER*(MAX_LEN_FNAM) dataFName
39 CHARACTER*(MAX_LEN_MBUF) msgBuf
40 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 nUnit = diagSt_ioUnit(n)
54
55 C- write a conclusion & close the file:
56 WRITE(nUnit,'(A)') '# records End here.'
57 CLOSE(nUnit)
58
59 iL = ILNBLNK(diagSt_Fname(n))
60 WRITE(dataFName,'(2A,I10.10,A)')
61 & diagSt_Fname(n)(1:iL), '.', nIter0, '.txt'
62 WRITE(msgBuf,'(4A,I6)') 'DIAGSTATS_CLOSE_IO: ',
63 & 'close file: ',dataFName(1:iL+15), ' , unit=', nUnit
64 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
65 & SQUEEZE_RIGHT , myThid)
66
67 ENDDO
68
69 ENDIF
70
71 _END_MASTER( myThid )
72
73 RETURN
74 END

  ViewVC Help
Powered by ViewVC 1.1.22