** Warning **
Issuing rollback() due to DESTROY without explicit disconnect() of DBD::mysql::db handle dbname=MITgcm at /usr/local/share/lxr/lib/LXR/Common.pm line 1224.
Last-Modified: Mon, 8 Sep 2024 05:11:48 GMT
Content-Type: text/html; charset=utf-8
MITgcm/MITgcm/pkg/obcs/obcs_monitor.F
File indexing completed on 2018-03-02 18:42:38 UTC
view on github raw file Latest commit add29e06 on 2018-01-31 20:35:05 UTC
5da861df38 Jean* 0001 #include "OBCS_OPTIONS.h "
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 SUBROUTINE OBCS_MONITOR ( myTime , myIter , myThid )
0014
0015
0016
0017
0018
0019
0020
0021
0022 IMPLICIT NONE
0023
0024
0025 #include "SIZE.h "
0026 #include "EEPARAMS.h "
0027 #include "PARAMS.h "
0028 #include "GRID.h "
0029 #include "DYNVARS.h "
9b4f2a04e2 Jean* 0030 #include "OBCS_PARAMS.h "
0031 #include "OBCS_GRID.h "
5da861df38 Jean* 0032 #ifdef ALLOW_MONITOR
0033 #include "MONITOR.h "
0034 #endif
0035
0036
0037 _RL myTime
0038 INTEGER myIter
0039 INTEGER myThid
0040
0041
0042 #ifdef ALLOW_OBCS
0043 #ifdef ALLOW_MONITOR
0044
0045
0046 LOGICAL DIFFERENT_MULTIPLE
0047 EXTERNAL DIFFERENT_MULTIPLE
0048 LOGICAL MASTER_CPU_IO
0049 EXTERNAL MASTER_CPU_IO
0050
0051
0052
0053 CHARACTER *(MAX_LEN_MBUF ) msgBuf
0054 _RL fldStats (0:4,4)
0055
0056 IF ( DIFFERENT_MULTIPLE ( OBCS_monitorFreq ,myTime ,deltaTClock )
0057 & ) THEN
0058
0059 #ifdef ALLOW_DEBUG
0060 IF (debugMode ) CALL DEBUG_ENTER ('OBCS_MONITOR' ,myThid )
0061 #endif
0062
0063
0064
0065
0066 IF ( MASTER_CPU_IO (myThid ) ) THEN
0067
0068
0069
0070
0071 mon_write_stdout = .TRUE.
0072
0073
0074
0075 mon_write_mnc = .FALSE.
0076
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 OBCS MONITOR 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
0088
0089
0090 ENDIF
0091
0092 IF ( OBCS_monitorFreq .NE. monitorFreq
0093 & .OR. .NOT. monitor_stdio ) THEN
0094 CALL MON_SET_PREF ('obc_time_' ,myThid )
0095 CALL MON_OUT_I ( 'tsnumber' , myIter ,mon_string_none ,myThid )
0096 CALL MON_OUT_RL ('secondsf' , myTime ,mon_string_none ,myThid )
0097 ENDIF
0098
0099 CALL MON_SET_PREF ('obc_' ,myThid )
0100
0101
0102 IF ( OBCS_monSelect .GE. 0 ) THEN
0103
0104 CALL OBCS_MON_STATS_EW_RL (
ae878c3c50 Jean* 0105 I tileHasOBE , tileHasOBW ,
0106 I OB_Ie , OB_Iw , OB_indexNone ,
47f36df0c2 Jean* 0107 I Nr , Nr , 1, uVel , hFacW , dyG , drF , maskInC ,
5da861df38 Jean* 0108 O fldStats (0,1),
0109 I myThid )
0110 CALL OBCS_MON_STATS_NS_RL (
ae878c3c50 Jean* 0111 I tileHasOBN , tileHasOBS ,
0112 I OB_Jn , OB_Js , OB_indexNone ,
47f36df0c2 Jean* 0113 I Nr , Nr , 2, vVel , hFacS , dxG , drF , maskInC ,
5da861df38 Jean* 0114 O fldStats (0,3),
0115 I myThid )
0116
0117 CALL OBCS_MON_WRITESTATS (
0118 I fldStats , 'Vel' ,
0119 I 3, myIter , myThid )
0120
0121 ENDIF
0122
0123
0124 IF ( OBCS_monSelect .GE. 1 ) THEN
0125
0126 CALL OBCS_MON_STATS_EW_RL (
ae878c3c50 Jean* 0127 I tileHasOBE , tileHasOBW ,
0128 I OB_Ie , OB_Iw , OB_indexNone ,
47f36df0c2 Jean* 0129 I Nr , Nr , 0, theta , hFacW , dyG , drF , maskInC ,
5da861df38 Jean* 0130 O fldStats (0,1),
0131 I myThid )
0132 CALL OBCS_MON_STATS_NS_RL (
ae878c3c50 Jean* 0133 I tileHasOBN , tileHasOBS ,
0134 I OB_Jn , OB_Js , OB_indexNone ,
47f36df0c2 Jean* 0135 I Nr , Nr , 0, theta , hFacS , dxG , drF , maskInC ,
5da861df38 Jean* 0136 O fldStats (0,3),
0137 I myThid )
0138
0139 CALL OBCS_MON_WRITESTATS (
0140 I fldStats , 'theta' ,
0141 I 0, myIter , myThid )
0142
0143 ENDIF
0144
0145
0146 IF ( OBCS_monSelect .GE. 2 ) THEN
0147
0148 CALL OBCS_MON_STATS_EW_RL (
ae878c3c50 Jean* 0149 I tileHasOBE , tileHasOBW ,
0150 I OB_Ie , OB_Iw , OB_indexNone ,
47f36df0c2 Jean* 0151 I Nr , Nr , 0, salt , hFacW , dyG , drF , maskInC ,
5da861df38 Jean* 0152 O fldStats (0,1),
0153 I myThid )
0154 CALL OBCS_MON_STATS_NS_RL (
ae878c3c50 Jean* 0155 I tileHasOBN , tileHasOBS ,
0156 I OB_Jn , OB_Js , OB_indexNone ,
47f36df0c2 Jean* 0157 I Nr , Nr , 0, salt , hFacS , dxG , drF , maskInC ,
5da861df38 Jean* 0158 O fldStats (0,3),
0159 I myThid )
0160
0161 CALL OBCS_MON_WRITESTATS (
0162 I fldStats , 'salt' ,
0163 I 0, myIter , myThid )
0164
0165 ENDIF
0166
0167
0168 IF ( MASTER_CPU_IO (myThid ) ) THEN
0169
0170
0171
0172 IF ( mon_write_stdout ) THEN
0173 WRITE (msgBuf ,'(2A)' ) '// ==========================' ,
0174 & '============================='
0175 CALL PRINT_MESSAGE ( msgBuf , mon_ioUnit , SQUEEZE_RIGHT , 1)
0176 WRITE (msgBuf ,'(A)' )
0177 & '// End OBCS MONITOR field statistics'
0178 CALL PRINT_MESSAGE ( msgBuf , mon_ioUnit , SQUEEZE_RIGHT , 1)
0179 WRITE (msgBuf ,'(2A)' ) '// ==========================' ,
0180 & '============================='
0181 CALL PRINT_MESSAGE ( msgBuf , mon_ioUnit , SQUEEZE_RIGHT , 1)
0182 ENDIF
0183
0184 mon_write_stdout = .FALSE.
0185 mon_write_mnc = .FALSE.
0186
0187
0188 ENDIF
0189
0190
0191 #ifdef ALLOW_DEBUG
0192 IF (debugMode ) CALL DEBUG_LEAVE ('OBCS_MONITOR' ,myThid )
0193 #endif
0194
0195
0196 ENDIF
0197
0198 #endif /* ALLOW_MONITOR */
0199 #endif /* ALLOW_OBCS */
0200
0201 RETURN
0202 END
0203
0204
0205
0206
0207
0208
0209 SUBROUTINE OBCS_MON_WRITESTATS (
0210 I arrStats , arrName ,
0211 I prtSelect , myIter , myThid )
0212
0213
0214
0215
0216
0217
0218
0219
0220 IMPLICIT NONE
0221
0222
0223 #include "SIZE.h "
0224 #include "EEPARAMS.h "
0225 #include "PARAMS.h "
0226 #ifdef ALLOW_MONITOR
0227 #include "MONITOR.h "
0228 #endif
0229
0230
0231 _RL arrStats (0:4,4)
0232 CHARACTER *(*) arrName
0233 INTEGER prtSelect
0234 INTEGER myIter
0235 INTEGER myThid
0236
0237
0238 #ifdef ALLOW_OBCS
0239 #ifdef ALLOW_MONITOR
0240
0241
0242
0243 INTEGER j
0244
0245 CHARACTER *(12) fldName
0246 _RL theMin , theMax , theMean , theSD
0247
0248 j = 1
0249 fldName = 'E_' //arrName
0250 IF ( MOD(prtSelect ,2).EQ. 1 ) fldName = 'E_u' //arrName
0251 IF ( arrStats (0,j ).GT. 0. _d 0 ) THEN
0252 theMean = arrStats (1,j )/arrStats (0,j )
0253 theSD = arrStats (2,j )/arrStats (0,j )
0254 theSD = theSD - theMean *theMean
0255 IF ( theSD .GT. 0. _d 0 ) theSD = SQRT(theSD )
0256 theMin = arrStats (3,j )
0257 theMax = arrStats (4,j )
0258 CALL MON_OUT_RL ( fldName , theMax , mon_foot_max , myThid )
0259 CALL MON_OUT_RL ( fldName , theMin , mon_foot_min , myThid )
0260 CALL MON_OUT_RL ( fldName , theMean , mon_foot_mean , myThid )
0261 CALL MON_OUT_RL ( fldName , theSD , mon_foot_sd , myThid )
0262 IF ( prtSelect .GE. 2 )
0263 & CALL MON_OUT_RL ( fldName , arrStats (1,j ), '_Int' , myThid )
0264 ENDIF
0265
0266 j = 2
0267 fldName = 'W_' //arrName
0268 IF ( MOD(prtSelect ,2).EQ. 1 ) fldName = 'W_u' //arrName
0269 IF ( arrStats (0,j ).GT. 0. _d 0 ) THEN
0270 theMean = arrStats (1,j )/arrStats (0,j )
0271 theSD = arrStats (2,j )/arrStats (0,j )
0272 theSD = theSD - theMean *theMean
0273 IF ( theSD .GT. 0. _d 0 ) theSD = SQRT(theSD )
0274 theMin = arrStats (3,j )
0275 theMax = arrStats (4,j )
0276 CALL MON_OUT_RL ( fldName , theMax , mon_foot_max , myThid )
0277 CALL MON_OUT_RL ( fldName , theMin , mon_foot_min , myThid )
0278 CALL MON_OUT_RL ( fldName , theMean , mon_foot_mean , myThid )
0279 CALL MON_OUT_RL ( fldName , theSD , mon_foot_sd , myThid )
0280 IF ( prtSelect .GE. 2 )
0281 & CALL MON_OUT_RL ( fldName , arrStats (1,j ), '_Int' , myThid )
0282 ENDIF
0283
0284 j = 3
0285 fldName = 'N_' //arrName
0286 IF ( MOD(prtSelect ,2).EQ. 1 ) fldName = 'N_v' //arrName
0287 IF ( arrStats (0,j ).GT. 0. _d 0 ) THEN
0288 theMean = arrStats (1,j )/arrStats (0,j )
0289 theSD = arrStats (2,j )/arrStats (0,j )
0290 theSD = theSD - theMean *theMean
0291 IF ( theSD .GT. 0. _d 0 ) theSD = SQRT(theSD )
0292 theMin = arrStats (3,j )
0293 theMax = arrStats (4,j )
0294 CALL MON_OUT_RL ( fldName , theMax , mon_foot_max , myThid )
0295 CALL MON_OUT_RL ( fldName , theMin , mon_foot_min , myThid )
0296 CALL MON_OUT_RL ( fldName , theMean , mon_foot_mean , myThid )
0297 CALL MON_OUT_RL ( fldName , theSD , mon_foot_sd , myThid )
0298 IF ( prtSelect .GE. 2 )
0299 & CALL MON_OUT_RL ( fldName , arrStats (1,j ), '_Int' , myThid )
0300 ENDIF
0301
0302 j = 4
0303 fldName = 'S_' //arrName
0304 IF ( MOD(prtSelect ,2).EQ. 1 ) fldName = 'S_v' //arrName
0305 IF ( arrStats (0,j ).GT. 0. _d 0 ) THEN
0306 theMean = arrStats (1,j )/arrStats (0,j )
0307 theSD = arrStats (2,j )/arrStats (0,j )
0308 theSD = theSD - theMean *theMean
0309 IF ( theSD .GT. 0. _d 0 ) theSD = SQRT(theSD )
0310 theMin = arrStats (3,j )
0311 theMax = arrStats (4,j )
0312 CALL MON_OUT_RL ( fldName , theMax , mon_foot_max , myThid )
0313 CALL MON_OUT_RL ( fldName , theMin , mon_foot_min , myThid )
0314 CALL MON_OUT_RL ( fldName , theMean , mon_foot_mean , myThid )
0315 CALL MON_OUT_RL ( fldName , theSD , mon_foot_sd , myThid )
0316 IF ( prtSelect .GE. 2 )
0317 & CALL MON_OUT_RL ( fldName , arrStats (1,j ), '_Int' , myThid )
0318 ENDIF
0319
0320 #endif /* ALLOW_MONITOR */
0321 #endif /* ALLOW_OBCS */
0322
0323 RETURN
0324 END