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

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

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


Revision 1.6 - (show annotations) (download)
Tue Feb 5 15:13:01 2008 UTC (16 years, 4 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint60, checkpoint61, checkpoint62, checkpoint61l, checkpoint59q, checkpoint59p, checkpoint59r, checkpoint59o, checkpoint59n, checkpoint61f, checkpoint61g, checkpoint61d, checkpoint61e, checkpoint61b, checkpoint61c, checkpoint61a, checkpoint61n, checkpoint61o, checkpoint61m, checkpoint61j, checkpoint61k, checkpoint61h, checkpoint61i, checkpoint61v, checkpoint61w, checkpoint61t, checkpoint61u, checkpoint61r, checkpoint61s, checkpoint61p, checkpoint61q, checkpoint61z, checkpoint61x, checkpoint61y
Changes since 1.5: +45 -64 lines
In order to deal with large number of diagnostics (happens with large number
of tracers), store diagnostic mate number in dedicate array "hdiag":
- new version of S/R DIAGNOSTICS_ADD2LIST : DIAGNOSTICS_ADDTOLIST
  with 1 more argument (mate number).
- change old version of DIAGNOSTICS_ADD2LIST to extract mate number
  from parsing code and then call DIAGNOSTICS_ADDTOLIST
- modify setting, filling & output to use "hdiag" instead of reading
  mate number from gdiag.

1 C $Header: /u/gcmpack/MITgcm/pkg/diagnostics/diagnostics_add2list.F,v 1.5 2006/10/17 18:56:31 jmc Exp $
2 C $Name: $
3
4 #include "DIAG_OPTIONS.h"
5
6 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
7 CBOP 0
8 C !ROUTINE: DIAGNOSTICS_ADD2LIST
9
10 C !INTERFACE:
11 SUBROUTINE DIAGNOSTICS_ADD2LIST (
12 O diagNum,
13 I diagName, diagCode, diagUnits, diagTitle,
14 I myThid )
15
16 C !DESCRIPTION:
17 C old version of this subroutine (new version= DIAGNOSTICS_ADDTOLIST)
18 C the diagnostic-mate number, which is missing from the argument list,
19 C is read from the parsing code before calling DIAGNOSTICS_ADDTOLIST ;
20 C (see description of DIAGNOSTICS_ADDTOLIST for more details).
21 C Note: needs to be called after DIAGNOSTICS_INIT_EARLY
22 C and before DIAGNOSTICS_INIT_FIXED
23
24 C !USES:
25 IMPLICIT NONE
26 #include "SIZE.h"
27 #include "EEPARAMS.h"
28 #include "DIAGNOSTICS_SIZE.h"
29 #include "DIAGNOSTICS.h"
30
31 C !INPUT PARAMETERS:
32 C diagName :: diagnostic name to declare
33 C diagCode :: parser code for this diagnostic
34 C diagUnits :: field units for this diagnostic
35 C diagTitle :: field description for this diagnostic
36 C myThid :: my Thread Id number
37 CHARACTER*8 diagName
38 CHARACTER*16 diagCode
39 CHARACTER*16 diagUnits
40 CHARACTER*(*) diagTitle
41 INTEGER myThid
42
43 C !OUTPUT PARAMETERS:
44 C numDiag :: diagnostic number in the list of available diagnostics
45 INTEGER diagNum
46 CEOP
47
48 C !LOCAL VARIABLES:
49 C msgBuf :: Informational/error meesage buffer
50 C diagMate :: diagnostic mate number
51 C errIO :: IO error flag
52 CHARACTER*(MAX_LEN_MBUF) msgBuf
53 INTEGER diagMate
54 INTEGER errIO
55
56 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
57
58 IF ( diagCode(6:8) .EQ. ' ' ) THEN
59 diagMate = 0
60 ELSEIF ( diagCode(5:5).EQ.'C' ) THEN
61 READ(diagCode(6:8),'(I3)',IOSTAT=errIO) diagMate
62 IF ( errIO.NE.0 ) THEN
63 WRITE(msgBuf,'(6A)') 'DIAGNOSTICS_ADD2LIST: ',
64 & 'adding diagnostic: "',diagName,
65 & '" with diagcode="',diagCode,'"'
66 CALL PRINT_ERROR( msgBuf , myThid)
67 WRITE(msgBuf,'(A,I6,A)') 'DIAGNOSTICS_ADD2LIST: Error (=',
68 & errIO,') reading mate number from diagcode => STOP'
69 CALL PRINT_ERROR( msgBuf , myThid)
70 STOP 'ABNORMAL END: S/R DIAGNOSTICS_ADD2LIST'
71 ENDIF
72 ELSE
73 READ(diagCode(6:8),'(I3)',IOSTAT=errIO) diagMate
74 IF ( errIO.NE.0 ) THEN
75 WRITE(msgBuf,'(4A)') 'WARNING: DIAGNOSTICS_ADD2LIST: ',
76 & 'mate number not readable from diagCode="',diagCode,'"'
77 CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
78 & SQUEEZE_RIGHT , myThid)
79 WRITE(msgBuf,'(4A)') 'WARNING: DIAGNOSTICS_ADD2LIST: ',
80 & 'mate number of diag="',diagName,'" is reset to zero'
81 CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
82 & SQUEEZE_RIGHT , myThid)
83 diagMate = 0
84 ENDIF
85 ENDIF
86
87 CALL DIAGNOSTICS_ADDTOLIST (
88 O diagNum,
89 I diagName, diagCode, diagUnits, diagTitle, diagMate,
90 I myThid )
91
92 RETURN
93 END

  ViewVC Help
Powered by ViewVC 1.1.22