File indexing completed on 2018-03-02 18:42:23 UTC
view on githubraw file Latest commit add29e06 on 2018-01-31 20:35:05 UTC
91672e10e3 Alis*0001 #include "MONITOR_OPTIONS.h"
dc684458c1 Alis*0002
2741539ec0 Ed H*0003
0004
0005
0006
0007
dc684458c1 Alis*0008 SUBROUTINE MONITOR(
4f6d3a8d05 Jean*0009 I myTime, myIter, myThid )
2741539ec0 Ed H*0010
0011
d1c48a721f Jean*0012
0013
dc684458c1 Alis*0014
2741539ec0 Ed H*0015
0016 IMPLICIT NONE
dc684458c1 Alis*0017 #include "SIZE.h"
0018 #include "EEPARAMS.h"
0019 #include "PARAMS.h"
0020 #include "GRID.h"
660ddcc3b0 Jean*0021 #include "DYNVARS.h"
df6a28fd13 Patr*0022 #include "FFIELDS.h"
d1c48a721f Jean*0023 #include "MONITOR.h"
0024 #ifdef ALLOW_MNC
0025 # include "MNC_PARAMS.h"
0026 #endif
dc684458c1 Alis*0027
2741539ec0 Ed H*0028
dc684458c1 Alis*0029 _RL myTime
4f6d3a8d05 Jean*0030 INTEGER myIter
dc684458c1 Alis*0031 INTEGER myThid
2741539ec0 Ed H*0032
dc684458c1 Alis*0033
49aab2cab9 Jean*0034
d1c48a721f Jean*0035 LOGICAL DIFFERENT_MULTIPLE
0036 EXTERNAL DIFFERENT_MULTIPLE
49aab2cab9 Jean*0037 LOGICAL MASTER_CPU_IO
0038 EXTERNAL MASTER_CPU_IO
d1c48a721f Jean*0039
2741539ec0 Ed H*0040
660ddcc3b0 Jean*0041 CHARACTER*(MAX_LEN_MBUF) msgBuf
dc684458c1 Alis*0042 _RL dT
723acae40e Jean*0043 _RL statsTemp(6)
b082722712 Jean*0044 _RL dummyRL(6)
b17d1c9285 Jean*0045 _RS thickFacC(Nr), thickFacF(Nr)
0046 INTEGER k
dc684458c1 Alis*0047
d1c48a721f Jean*0048 IF ( DIFFERENT_MULTIPLE(monitorFreq,myTime,deltaTClock) ) THEN
dc684458c1 Alis*0049
49aab2cab9 Jean*0050 IF ( MASTER_CPU_IO(myThid) ) THEN
d1c48a721f Jean*0051
3daafce20b Jean*0052
d1c48a721f Jean*0053
0054 IF (monitor_stdio) THEN
0055 mon_write_stdout = .TRUE.
0056 ELSE
0057 mon_write_stdout = .FALSE.
0058 ENDIF
0059 mon_write_mnc = .FALSE.
357126def9 Ed H*0060 #ifdef ALLOW_MNC
d1c48a721f Jean*0061 IF (useMNC .AND. monitor_mnc) THEN
b17d1c9285 Jean*0062 DO k = 1,MAX_LEN_MBUF
0063 mon_fname(k:k) = ' '
d1c48a721f Jean*0064 ENDDO
0065 mon_fname(1:7) = 'monitor'
0066 CALL MNC_CW_APPEND_VNAME(
0067 & 'T', '-_-_--__-__t', 0,0, myThid)
0068 CALL MNC_CW_SET_UDIM(mon_fname, -1, myThid)
0069 CALL MNC_CW_RL_W_S(
0070 & 'D',mon_fname,1,1,'T', myTime, myThid)
0071 CALL MNC_CW_SET_UDIM(mon_fname, 0, myThid)
0072 mon_write_mnc = .TRUE.
0073 ENDIF
0074 #endif /* ALLOW_MNC */
660ddcc3b0 Jean*0075
0076
d1c48a721f Jean*0077 IF ( mon_write_stdout ) THEN
0078 WRITE(msgBuf,'(2A)') '// ==========================',
0079 & '============================='
0080 CALL PRINT_MESSAGE( msgBuf, mon_ioUnit, SQUEEZE_RIGHT , 1)
0081 WRITE(msgBuf,'(A)')
0082 & '// Begin MONITOR dynamic field statistics'
0083 CALL PRINT_MESSAGE( msgBuf, mon_ioUnit, SQUEEZE_RIGHT , 1)
0084 WRITE(msgBuf,'(2A)') '// ==========================',
0085 & '============================='
0086 CALL PRINT_MESSAGE( msgBuf, mon_ioUnit, SQUEEZE_RIGHT , 1)
0087 ENDIF
660ddcc3b0 Jean*0088
49aab2cab9 Jean*0089
660ddcc3b0 Jean*0090 ENDIF
0091
b17d1c9285 Jean*0092
0093 DO k=1,Nr
0094 thickFacC(k) = drF(k)*deepFac2C(k)*rhoFacC(k)
0095 thickFacF(k) = drC(k)*deepFac2F(k)*rhoFacF(k)
0096 ENDDO
0097
a30418b6b9 Ed H*0098
b082722712 Jean*0099 CALL MON_SET_PREF( 'time', myThid )
0100 CALL MON_OUT_I( '_tsnumber', myIter,mon_string_none,myThid )
0101 CALL MON_OUT_RL('_secondsf', myTime,mon_string_none,myThid )
6f03324dd9 Dimi*0102
8f72d0962a Jean*0103 IF ( monitorSelect.GE.1 ) THEN
a30418b6b9 Ed H*0104
8f72d0962a Jean*0105 CALL MON_SET_PREF( 'dynstat', myThid )
0106 CALL MON_WRITESTATS_RL( 1, etaN, '_eta',
0107 & maskInC, maskInC, rA , drF, dummyRL, myThid )
0108 CALL MON_WRITESTATS_RL( Nr, uVel, '_uvel',
0109 & hFacW, maskInW, rAw, thickFacC, dummyRL, myThid )
0110 CALL MON_WRITESTATS_RL( Nr, vVel, '_vvel',
0111 & hFacS, maskInS, rAs, thickFacC, dummyRL, myThid )
0112 CALL MON_WRITESTATS_RL( Nr, wVel, '_wvel',
0113 & maskC, maskInC, rA , thickFacF, dummyRL, myThid )
0114 CALL MON_WRITESTATS_RL( Nr, theta,'_theta',
0115 & hFacC, maskInC, rA , thickFacC, statsTemp, myThid )
0116 CALL MON_WRITESTATS_RL( Nr, salt, '_salt',
0117 & hFacC, maskInC, rA , thickFacC, dummyRL, myThid )
0118 ELSE
0119 statsTemp(1) = 1.
0120 statsTemp(2) = 0.
0121 ENDIF
f804abbd25 Jean*0122 IF ( monitorSelect.GE.3 .AND.
0123 & nSx.EQ.1 .AND. nSy.EQ.1 ) THEN
b17d1c9285 Jean*0124
0125 k = 1
0126 IF ( usingPCoords ) k = Nr
b082722712 Jean*0127 CALL MON_WRITESTATS_RL( 1, theta(1-OLx,1-OLy,k,1,1), '_sst',
0128 & maskInC, maskInC, rA , drF, dummyRL, myThid )
0129 CALL MON_WRITESTATS_RL( 1, salt(1-OLx,1-OLy,k,1,1), '_sss',
0130 & maskInC, maskInC, rA , drF, dummyRL, myThid )
c1dee29dac Jean*0131 ENDIF
df6a28fd13 Patr*0132
0133
f804abbd25 Jean*0134 IF ( monitorSelect.GE.3 ) THEN
b082722712 Jean*0135 CALL MON_SET_PREF( 'forcing', myThid )
0136 CALL MON_WRITESTATS_RS( 1, Qnet, '_qnet',
0137 & maskInC, maskInC, rA , drF, dummyRL, myThid )
0138 CALL MON_WRITESTATS_RS( 1, Qsw , '_qsw',
0139 & maskInC, maskInC, rA , drF, dummyRL, myThid )
0140 CALL MON_WRITESTATS_RS( 1, EmPmR,'_empmr',
0141 & maskInC, maskInC, rA , drF, dummyRL, myThid )
0142 CALL MON_WRITESTATS_RS( 1, fu , '_fu',
0143 & maskInW, maskInW, rAw, drF, dummyRL, myThid )
0144 CALL MON_WRITESTATS_RS( 1, fv , '_fv',
0145 & maskInS, maskInS, rAs, drF, dummyRL, myThid )
c1dee29dac Jean*0146 ENDIF
660ddcc3b0 Jean*0147
dd92b9a824 Jean*0148
0149 IF ( monitorSelect.GE.2 ) THEN
0150 CALL MON_SET_PREF( 'trAdv_CFL', myThid )
0151 CALL MON_OUT_RL( '_u', mon_trAdvCFL(1), mon_foot_max,myThid )
0152 CALL MON_OUT_RL( '_v', mon_trAdvCFL(2), mon_foot_max,myThid )
0153 CALL MON_OUT_RL( '_w', mon_trAdvCFL(3), mon_foot_max,myThid )
0154 ENDIF
0155
a30418b6b9 Ed H*0156
b082722712 Jean*0157 CALL MON_SET_PREF( 'advcfl', myThid )
0158 dT = MAX(dTtracerLev(1),deltaTmom)
0159 CALL MON_ADVCFL( '_uvel', uVel, recip_dxC, dT, myThid )
0160 CALL MON_ADVCFL( '_vvel', vVel, recip_dyC, dT, myThid )
0161 CALL MON_ADVCFLW( '_wvel', wVel, recip_drC, dT, myThid )
0162 CALL MON_ADVCFLW2('_W_hf', wVel, recip_hFacC,
0163 & recip_drF, dT, myThid )
a30418b6b9 Ed H*0164
0165
0166 CALL MON_KE(myIter, myThid)
0167
660ddcc3b0 Jean*0168
f804abbd25 Jean*0169 IF ( monitorSelect.GE.2 ) CALL MON_VORT3( myIter, myThid )
a30418b6b9 Ed H*0170
0171
f804abbd25 Jean*0172 IF ( monitorSelect.GE.2 ) CALL MON_SURFCOR( myThid )
a30418b6b9 Ed H*0173
0174
723acae40e Jean*0175 CALL MON_SOLUTION( statsTemp, myTime, myIter, myThid )
660ddcc3b0 Jean*0176
0177
49aab2cab9 Jean*0178 IF ( MASTER_CPU_IO(myThid) ) THEN
d1c48a721f Jean*0179
3daafce20b Jean*0180
d1c48a721f Jean*0181
0182 IF ( mon_write_stdout ) THEN
0183 WRITE(msgBuf,'(2A)') '// ==========================',
0184 & '============================='
0185 CALL PRINT_MESSAGE( msgBuf, mon_ioUnit, SQUEEZE_RIGHT , 1)
0186 WRITE(msgBuf,'(A)')
0187 & '// End MONITOR dynamic field statistics'
0188 CALL PRINT_MESSAGE( msgBuf, mon_ioUnit, SQUEEZE_RIGHT , 1)
0189 WRITE(msgBuf,'(2A)') '// ==========================',
0190 & '============================='
0191 CALL PRINT_MESSAGE( msgBuf, mon_ioUnit, SQUEEZE_RIGHT , 1)
0192 ENDIF
0193
0194 mon_write_stdout = .FALSE.
0195 mon_write_mnc = .FALSE.
0196
49aab2cab9 Jean*0197
a30418b6b9 Ed H*0198 ENDIF
0e5a53334a Jean*0199
d1c48a721f Jean*0200
dc684458c1 Alis*0201 ENDIF
0202
0203 RETURN
0204 END