File indexing completed on 2024-07-17 05:10:42 UTC
view on githubraw file Latest commit acacc28f on 2024-07-17 03:59:01 UTC
a5ec81ed49 Timo*0001 #include "DIAG_OPTIONS.h"
0002
41c4545f8f Jean*0003 SUBROUTINE DIAGNOSTICS_WRITE_ADJ(
b4c3946106 Timo*0004 I modelStart,
a5ec81ed49 Timo*0005 I myTime, myIter, myThid )
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
b4c3946106 Timo*0017
a10c595eb6 Timo*0018
a5ec81ed49 Timo*0019
0020
0021
0022
0023 IMPLICIT NONE
0024 #include "EEPARAMS.h"
0025 #include "SIZE.h"
0026 #include "DIAGNOSTICS_SIZE.h"
0027 #include "PARAMS.h"
0028 #include "DIAGNOSTICS.h"
0029
0030
b4c3946106 Timo*0031 LOGICAL modelStart
a5ec81ed49 Timo*0032 _RL myTime
0033 INTEGER myIter, myThid
0034
0035
0036 LOGICAL DIFF_PHASE_MULTIPLE
0037 EXTERNAL DIFF_PHASE_MULTIPLE
0038 #ifdef ALLOW_FIZHI
0039 LOGICAL ALARM2
0040 EXTERNAL ALARM2
0041 #endif
0042
0043
0044
0045 INTEGER n, nd
0046 INTEGER myItM1, wrIter
0047 LOGICAL dump2fileNow, write2file
0048 LOGICAL writeDiags(numLists)
0049 _RL phiSec, freqSec, wrTime
0050 #ifdef ALLOW_FIZHI
0051 CHARACTER *9 tagname
0052 #endif
0053
0054 myItM1 = myIter - 1
0055
0056
0057
0058
0059
0060 write2file = .FALSE.
0061 DO n = 1,nlists
0062 nd = ABS(jdiag(1,n))
0063 IF ( gdiag(nd)(4:4).EQ.'A' ) THEN
0064 freqSec = freq(n)
0065 phiSec = phase(n)
0066
0067
0068
0069 wrIter = myIter
0070 wrTime = myTime
0071
0072 dump2fileNow = DIFF_PHASE_MULTIPLE( phiSec, freqSec,
0073 & wrTime, deltaTClock )
0074 #ifdef ALLOW_FIZHI
0075 IF ( useFIZHI ) THEN
0076 WRITE(tagname,'(A,I2.2)')'diagtag',n
0077 dump2fileNow = ALARM2(tagname)
0078 ENDIF
0079 #endif
0080 #ifdef ALLOW_CAL
0081 IF ( useCAL ) THEN
0082 CALL CAL_TIME2DUMP( phiSec, freqSec, deltaTClock,
0083 U dump2fileNow,
0084 I wrTime, myIter, myThid )
0085 ENDIF
0086 #endif /* ALLOW_CAL */
b4c3946106 Timo*0087 IF ( dumpAtLast .AND. modelStart
a5ec81ed49 Timo*0088 & .AND. freqSec.GE.0. ) dump2fileNow = .TRUE.
0089 IF ( dump2fileNow ) THEN
0090 write2file = .TRUE.
0091 CALL DIAGNOSTICS_OUT(n,wrTime,wrIter,myThid)
0092 ENDIF
0093 writeDiags(n) = dump2fileNow
0094 ELSE
0095 writeDiags(n) = .FALSE.
0096
0097 ENDIF
0098
0099 ENDDO
0100
0101
0102
0103
0104
0105 IF ( write2file ) THEN
41c4545f8f Jean*0106 IF ( diag_dBugLevel.GE.debLevC ) THEN
0107 CALL DIAGNOSTICS_SUMMARY( -1, myTime, myIter, myThid )
a5ec81ed49 Timo*0108 ENDIF
0109
0110 _BARRIER
0111 ENDIF
0112
acacc28f7f Jean*0113
0114
0115
0116
0117
0118
0119
0120
0121
0122
0123
0124
0125
0126
a5ec81ed49 Timo*0127 DO n = 1,nlists
0128 IF ( writeDiags(n) ) CALL DIAGNOSTICS_CLEAR(n,myThid)
0129 ENDDO
0130
0131
0132
0133 RETURN
0134 END