/[MITgcm]/MITgcm/eesupp/src/print.F
ViewVC logotype

Diff of /MITgcm/eesupp/src/print.F

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

revision 1.29 by jmc, Tue Apr 21 16:02:42 2009 UTC revision 1.32 by zhc, Tue Jul 6 23:12:51 2010 UTC
# Line 8  C--                 in the MITgcm UV imp Line 8  C--                 in the MITgcm UV imp
8  C--   Contents  C--   Contents
9  C--   o PRINT_MESSAGE  Does IO with unhighlighted header  C--   o PRINT_MESSAGE  Does IO with unhighlighted header
10  C--   o PRINT_ERROR    Does IO with **ERROR** highlighted header  C--   o PRINT_ERROR    Does IO with **ERROR** highlighted header
11  C--   o PRINT_LIST_I   Prints one-deimensional list of INTEGER  C--   o PRINT_LIST_I   Prints one-dimensional list of INTEGER
12  C--                    numbers.  C--                    numbers.
13  C--   o PRINT_LIST_L   Prints one-deimensional list of LOGICAL  C--   o PRINT_LIST_L   Prints one-dimensional list of LOGICAL
14  C--                    variables.  C--                    variables.
15  C--   o PRINT_LIST_R8  Prints one-deimensional list of Real*8  C--   o PRINT_LIST_RL  Prints one-dimensional list of Real(_RL)
16  C--                    numbers.  C--                    numbers.
17  C--   o PRINT_MAPRS    Formats ABCD... contour map of a Real(_RS) field  C--   o PRINT_MAPRS    Formats ABCD... contour map of a Real(_RS) field
18  C--                    Uses print_message for writing  C--                    Uses print_message for writing
# Line 49  C     == Global data == Line 49  C     == Global data ==
49  #include "SIZE.h"  #include "SIZE.h"
50  #include "EEPARAMS.h"  #include "EEPARAMS.h"
51  #include "EESUPPORT.h"  #include "EESUPPORT.h"
       INTEGER  IFNBLNK  
       EXTERNAL IFNBLNK  
       INTEGER  ILNBLNK  
       EXTERNAL ILNBLNK  
52    
53  C     !INPUT/OUTPUT PARAMETERS:  C     !INPUT/OUTPUT PARAMETERS:
54  C     == Routine arguments ==  C     == Routine arguments ==
# Line 64  C     sq      :: Justification option Line 60  C     sq      :: Justification option
60        CHARACTER*(*) sq        CHARACTER*(*) sq
61        INTEGER  myThid        INTEGER  myThid
62    
63    C     !FUNCTIONS:
64          INTEGER  IFNBLNK
65          EXTERNAL IFNBLNK
66          INTEGER  ILNBLNK
67          EXTERNAL ILNBLNK
68    
69  C     !LOCAL VARIABLES:  C     !LOCAL VARIABLES:
70  C     == Local variables ==  C     == Local variables ==
71  C     iStart, iEnd :: String indexing variables  C     iStart, iEnd :: String indexing variables
# Line 176  C     == Global data == Line 178  C     == Global data ==
178  #include "SIZE.h"  #include "SIZE.h"
179  #include "EEPARAMS.h"  #include "EEPARAMS.h"
180  #include "EESUPPORT.h"  #include "EESUPPORT.h"
       INTEGER  IFNBLNK  
       EXTERNAL IFNBLNK  
       INTEGER  ILNBLNK  
       EXTERNAL ILNBLNK  
181    
182  C     !INPUT/OUTPUT PARAMETERS:  C     !INPUT/OUTPUT PARAMETERS:
183  C     == Routine arguments ==  C     == Routine arguments ==
# Line 188  C     myThid  :: Thread number of this i Line 186  C     myThid  :: Thread number of this i
186        CHARACTER*(*) message        CHARACTER*(*) message
187        INTEGER       myThid        INTEGER       myThid
188    
189    C     !FUNCTIONS:
190    c     INTEGER  IFNBLNK
191    c     EXTERNAL IFNBLNK
192          INTEGER  ILNBLNK
193          EXTERNAL ILNBLNK
194    
195  C     !LOCAL VARIABLES:  C     !LOCAL VARIABLES:
196  C     == Local variables ==  C     == Local variables ==
197  C     iStart, iEnd :: Temps. for string indexing  C     iStart, iEnd :: Temps. for string indexing
198  C     idString     :: Temp. for building message prefix  C     idString     :: Temp. for building message prefix
199        INTEGER iStart  c     INTEGER iStart
200        INTEGER iEnd        INTEGER iEnd
201        CHARACTER*9 idString        CHARACTER*9 idString
202  CEOP  CEOP
203    
204  C--   Find beginning and end of message  C--   Find beginning and end of message
205        iStart = IFNBLNK( message )  c     iStart = IFNBLNK( message )
206        iEnd   = ILNBLNK( message )        iEnd   = ILNBLNK( message )
207  C--   Test to see if in multi-process ( or multi-threaded ) mode.  C--   Test to see if in multi-process ( or multi-threaded ) mode.
208  C     If so include process or thread identifier.  C     If so include process or thread identifier.
209        IF ( numberOfProcs .EQ. 0 .AND. nThreads .EQ. 1 ) THEN        IF ( numberOfProcs .EQ. 0 .AND. nThreads .EQ. 1 ) THEN
210  C--    Write single process format  C--    Write single process format
211         IF ( message .EQ. ' ' ) THEN         IF ( iEnd.EQ.0 ) THEN
212          WRITE(errorMessageUnit,'(A,1X,A)') ERROR_HEADER, ' '          WRITE(errorMessageUnit,'(A,1X,A)') ERROR_HEADER, ' '
213         ELSE         ELSE
214          WRITE(errorMessageUnit,'(A,1X,A)') ERROR_HEADER,          WRITE(errorMessageUnit,'(A,1X,A)') ERROR_HEADER,
215       &   message(iStart:iEnd)       &        message(1:iEnd)
216    c    &    message(iStart:iEnd)
217         ENDIF         ENDIF
218        ELSE        ELSE
219  C       PRINT_ERROR can be called by several threads simulataneously.  C       PRINT_ERROR can be called by several threads simulataneously.
# Line 233  c         WRITE(errorMessageUnit,'(A,A,1 Line 238  c         WRITE(errorMessageUnit,'(A,A,1
238  c         WRITE(errorMessageUnit,'(A,A,1X,A,A,A,A,A)',ERR=999)  c         WRITE(errorMessageUnit,'(A,A,1X,A,A,A,A,A)',ERR=999)
239            WRITE(errorMessageUnit,'(A,A,1X,A,A,A,A,A)')            WRITE(errorMessageUnit,'(A,A,1X,A,A,A,A,A)')
240       &    '(',PROCESS_HEADER,idString,')',ERROR_HEADER,' ',       &    '(',PROCESS_HEADER,idString,')',ERROR_HEADER,' ',
241       &    message(iStart:iEnd)       &        message(1:iEnd)
242    c    &    message(iStart:iEnd)
243           ENDIF           ENDIF
244         ENDIF         ENDIF
245    
# Line 534  C-    fortran format to write 1 or 2 ind Line 540  C-    fortran format to write 1 or 2 ind
540    
541  C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|  C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
542  CBOP  CBOP
543  C     !ROUTINE: PRINT_LIST_R8  C     !ROUTINE: PRINT_LIST_RL
544  C     !INTERFACE:  C     !INTERFACE:
545        SUBROUTINE PRINT_LIST_R8( fld, iFirst, iLast, index_type,        SUBROUTINE PRINT_LIST_RL( fld, iFirst, iLast, index_type,
546       &                          markEnd, compact, ioUnit )       &                          markEnd, compact, ioUnit )
547    
548  C     !DESCRIPTION:  C     !DESCRIPTION:
549  C     *==========================================================*  C     *==========================================================*
550  C     | o SUBROUTINE PRINT\_LIST\_R8  C     | o SUBROUTINE PRINT\_LIST\_RL
551  C     *==========================================================*  C     *==========================================================*
552  C     | Routine for producing list of values for a field with  C     | Routine for producing list of values for a field with
553  C     | duplicate values collected into  C     | duplicate values collected into
# Line 572  C     compact :: Flag to control use of Line 578  C     compact :: Flag to control use of
578  C                fields.  C                fields.
579  C     ioUnit  :: Unit number for IO.  C     ioUnit  :: Unit number for IO.
580        INTEGER iFirst, iLast        INTEGER iFirst, iLast
581        Real*8  fld(iFirst:iLast)        _RL     fld(iFirst:iLast)
582        INTEGER index_type        INTEGER index_type
583        LOGICAL markEnd        LOGICAL markEnd
584        LOGICAL compact        LOGICAL compact
# Line 591  C     K    - Loop counter Line 597  C     K    - Loop counter
597        INTEGER iLo        INTEGER iLo
598        INTEGER iHi        INTEGER iHi
599        INTEGER nDup        INTEGER nDup
600        Real*8 xNew, xOld        _RL     xNew, xOld
601        CHARACTER punc        CHARACTER punc
602        CHARACTER*(MAX_LEN_MBUF) msgBuf        CHARACTER*(MAX_LEN_MBUF) msgBuf
603        CHARACTER*2 commOpen,commClose        CHARACTER*2 commOpen,commClose
# Line 706  C     !USES: Line 712  C     !USES:
712  C     == Global variables ==  C     == Global variables ==
713  #include "SIZE.h"  #include "SIZE.h"
714  #include "EEPARAMS.h"  #include "EEPARAMS.h"
       INTEGER  IFNBLNK  
       EXTERNAL IFNBLNK  
       INTEGER  ILNBLNK  
       EXTERNAL ILNBLNK  
715    
716  C     !INPUT/OUTPUT PARAMETERS:  C     !INPUT/OUTPUT PARAMETERS:
717  C     == Routine arguments ==  C     == Routine arguments ==
# Line 740  C     kStr Line 742  C     kStr
742        INTEGER bxMin, bxMax, bxStr        INTEGER bxMin, bxMax, bxStr
743        INTEGER byMin, byMax, byStr        INTEGER byMin, byMax, byStr
744    
745    C     !FUNCTIONS:
746          INTEGER  IFNBLNK
747          EXTERNAL IFNBLNK
748          INTEGER  ILNBLNK
749          EXTERNAL ILNBLNK
750    
751  C     !LOCAL VARIABLES:  C     !LOCAL VARIABLES:
752  C     == Local variables ==  C     == Local variables ==
753  C     plotBuf - Buffer for building plot record  C     plotBuf - Buffer for building plot record
# Line 856  C--   Write field title and statistics Line 864  C--   Write field title and statistics
864       & '//                  0.0: ','.'       & '//                  0.0: ','.'
865        CALL PRINT_MESSAGE(msgBuf, standardMessageUnit,        CALL PRINT_MESSAGE(msgBuf, standardMessageUnit,
866       &                   SQUEEZE_RIGHT, 1)       &                   SQUEEZE_RIGHT, 1)
867         WRITE(msgBuf,'(A,3(A,I4),A)')         WRITE(msgBuf,'(A,3(A,I6),A)')
868       & '// RANGE I (Lo:Hi:Step):',       & '// RANGE I (Lo:Hi:Step):',
869       &  '(',myXGlobalLo-1+(bxMin-1)*sNx+iMin,       &  '(',myXGlobalLo-1+(bxMin-1)*sNx+iMin,
870       &  ':',myXGlobalLo-1+(bxMax-1)*sNx+iMax,       &  ':',myXGlobalLo-1+(bxMax-1)*sNx+iMax,
871       &  ':',iStr,')'       &  ':',iStr,')'
872        CALL PRINT_MESSAGE(msgBuf, standardMessageUnit,        CALL PRINT_MESSAGE(msgBuf, standardMessageUnit,
873       &                   SQUEEZE_RIGHT, 1)       &                   SQUEEZE_RIGHT, 1)
874         WRITE(msgBuf,'(A,3(A,I4),A)')         WRITE(msgBuf,'(A,3(A,I6),A)')
875       & '// RANGE J (Lo:Hi:Step):',       & '// RANGE J (Lo:Hi:Step):',
876       &  '(',myYGlobalLo-1+(byMin-1)*sNy+jMin,       &  '(',myYGlobalLo-1+(byMin-1)*sNy+jMin,
877       &  ':',myYGlobalLo-1+(byMax-1)*sNy+jMax,       &  ':',myYGlobalLo-1+(byMax-1)*sNy+jMax,
# Line 1137  C     !USES: Line 1145  C     !USES:
1145  C     == Global variables ==  C     == Global variables ==
1146  #include "SIZE.h"  #include "SIZE.h"
1147  #include "EEPARAMS.h"  #include "EEPARAMS.h"
       INTEGER  IFNBLNK  
       EXTERNAL IFNBLNK  
       INTEGER  ILNBLNK  
       EXTERNAL ILNBLNK  
1148    
1149  C     !INPUT/OUTPUT PARAMETERS:  C     !INPUT/OUTPUT PARAMETERS:
1150  C     == Routine arguments ==  C     == Routine arguments ==
# Line 1171  C     kStr Line 1175  C     kStr
1175        INTEGER bxMin, bxMax, bxStr        INTEGER bxMin, bxMax, bxStr
1176        INTEGER byMin, byMax, byStr        INTEGER byMin, byMax, byStr
1177    
1178    C     !FUNCTIONS:
1179          INTEGER  IFNBLNK
1180          EXTERNAL IFNBLNK
1181          INTEGER  ILNBLNK
1182          EXTERNAL ILNBLNK
1183    
1184  C     !LOCAL VARIABLES:  C     !LOCAL VARIABLES:
1185  C     == Local variables ==  C     == Local variables ==
1186  C     plotBuf - Buffer for building plot record  C     plotBuf - Buffer for building plot record
# Line 1288  C--   Write field title and statistics Line 1298  C--   Write field title and statistics
1298       & '//                  0.0: ','.'       & '//                  0.0: ','.'
1299        CALL PRINT_MESSAGE(msgBuf, standardMessageUnit,        CALL PRINT_MESSAGE(msgBuf, standardMessageUnit,
1300       &                   SQUEEZE_RIGHT, 1)       &                   SQUEEZE_RIGHT, 1)
1301         WRITE(msgBuf,'(A,3(A,I4),A)')         WRITE(msgBuf,'(A,3(A,I6),A)')
1302       & '// RANGE I (Lo:Hi:Step):',       & '// RANGE I (Lo:Hi:Step):',
1303       &  '(',myXGlobalLo-1+(bxMin-1)*sNx+iMin,       &  '(',myXGlobalLo-1+(bxMin-1)*sNx+iMin,
1304       &  ':',myXGlobalLo-1+(bxMax-1)*sNx+iMax,       &  ':',myXGlobalLo-1+(bxMax-1)*sNx+iMax,
1305       &  ':',iStr,')'       &  ':',iStr,')'
1306        CALL PRINT_MESSAGE(msgBuf, standardMessageUnit,        CALL PRINT_MESSAGE(msgBuf, standardMessageUnit,
1307       &                   SQUEEZE_RIGHT, 1)       &                   SQUEEZE_RIGHT, 1)
1308         WRITE(msgBuf,'(A,3(A,I4),A)')         WRITE(msgBuf,'(A,3(A,I6),A)')
1309       & '// RANGE J (Lo:Hi:Step):',       & '// RANGE J (Lo:Hi:Step):',
1310       &  '(',myYGlobalLo-1+(byMin-1)*sNy+jMin,       &  '(',myYGlobalLo-1+(byMin-1)*sNy+jMin,
1311       &  ':',myYGlobalLo-1+(byMax-1)*sNy+jMax,       &  ':',myYGlobalLo-1+(byMax-1)*sNy+jMax,

Legend:
Removed from v.1.29  
changed lines
  Added in v.1.32

  ViewVC Help
Powered by ViewVC 1.1.22