Back to home page

MITgcm

 
 

    


File indexing completed on 2021-02-25 06:11:26 UTC

view on githubraw file Latest commit b7af0c28 on 2021-02-19 06:07:43 UTC
6f03324dd9 Dimi*0001 #include "EXF_OPTIONS.h"
30fcb891cf Jean*0002 #ifdef ALLOW_BLING
                0003 # include "BLING_OPTIONS.h"
                0004 #endif
6f03324dd9 Dimi*0005 
                0006 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
                0007 CBOP
                0008 C     !ROUTINE: EXF_MONITOR
                0009 
                0010 C     !INTERFACE:
                0011       SUBROUTINE EXF_MONITOR(
d9263fe447 Jean*0012      I               myTime, myIter, myThid )
6f03324dd9 Dimi*0013 
                0014 C     !DESCRIPTION:
                0015 C     Print some statistics about input forcing fields.
                0016 
                0017 C     !USES:
                0018       IMPLICIT NONE
                0019 #include "SIZE.h"
                0020 #include "EEPARAMS.h"
d9263fe447 Jean*0021 #include "PARAMS.h"
6f03324dd9 Dimi*0022 #include "GRID.h"
082e18c36c Jean*0023 #include "EXF_PARAM.h"
                0024 #include "EXF_FIELDS.h"
d1c48a721f Jean*0025 #ifdef ALLOW_MONITOR
                0026 # include "MONITOR.h"
                0027 #endif
                0028 #ifdef ALLOW_MNC
                0029 # include "MNC_PARAMS.h"
                0030 #endif
f0efe9a78f Matt*0031 #ifdef ALLOW_BLING
30fcb891cf Jean*0032 # include "EXF_INTERP_SIZE.h"
f0efe9a78f Matt*0033 # include "BLING_VARS.h"
                0034 #endif
6f03324dd9 Dimi*0035 
                0036 C     !INPUT PARAMETERS:
                0037       _RL myTime
25b1505994 Jean*0038       INTEGER myIter
6f03324dd9 Dimi*0039       INTEGER myThid
                0040 CEOP
                0041 
f15e1e61c6 Patr*0042 #ifdef ALLOW_MONITOR
                0043 
49aab2cab9 Jean*0044 C     === Functions ====
d9263fe447 Jean*0045       LOGICAL  DIFFERENT_MULTIPLE
                0046       EXTERNAL DIFFERENT_MULTIPLE
49aab2cab9 Jean*0047       LOGICAL  MASTER_CPU_IO
                0048       EXTERNAL MASTER_CPU_IO
d9263fe447 Jean*0049 
                0050 C     == Local variables ==
b0426326ce Jean*0051       _RL dummyRL(6)
d9263fe447 Jean*0052       CHARACTER*(MAX_LEN_MBUF) msgBuf
                0053 #ifdef ALLOW_MNC
                0054       INTEGER k
                0055 #endif
25b1505994 Jean*0056       LOGICAL computed
                0057 
                0058 #ifdef ALLOW_BULKFORMULAE
                0059       computed = .TRUE.
                0060 #else
                0061       computed = .FALSE.
                0062 #endif
d9263fe447 Jean*0063 
d1c48a721f Jean*0064       IF ( DIFFERENT_MULTIPLE(exf_monFreq,myTime,deltaTClock)
d9263fe447 Jean*0065      &   ) THEN
                0066 
49aab2cab9 Jean*0067         IF ( MASTER_CPU_IO(myThid) ) THEN
d1c48a721f Jean*0068 C--   only the master thread is allowed to switch On/Off mon_write_stdout
3daafce20b Jean*0069 C     & mon_write_mnc (since it is the only thread that uses those flags):
d1c48a721f Jean*0070 
                0071           IF (monitor_stdio) THEN
                0072             mon_write_stdout = .TRUE.
                0073           ELSE
                0074             mon_write_stdout = .FALSE.
                0075           ENDIF
                0076           mon_write_mnc = .FALSE.
                0077 #ifdef ALLOW_MNC
                0078           IF (useMNC .AND. monitor_mnc) THEN
                0079             DO k = 1,MAX_LEN_MBUF
                0080               mon_fname(k:k) = ' '
                0081             ENDDO
                0082             mon_fname(1:11) = 'monitor_exf'
                0083             CALL MNC_CW_APPEND_VNAME(
                0084      &           'T', '-_-_--__-__t', 0,0, myThid)
                0085             CALL MNC_CW_SET_UDIM(mon_fname, -1, myThid)
3393e77079 Mart*0086             CALL MNC_CW_RL_W_S(
                0087      &          'D',mon_fname,1,1,'T', myTime, myThid)
d1c48a721f Jean*0088             CALL MNC_CW_SET_UDIM(mon_fname, 0, myThid)
                0089             mon_write_mnc = .TRUE.
                0090           ENDIF
                0091 #endif /* ALLOW_MNC */
                0092 
                0093           IF ( mon_write_stdout ) THEN
                0094             WRITE(msgBuf,'(2A)') '// ===========================',
                0095      &           '============================'
                0096             CALL PRINT_MESSAGE(msgBuf, mon_ioUnit, SQUEEZE_RIGHT, 1)
                0097             WRITE(msgBuf,'(A)') '// Begin MONITOR EXF statistics'
                0098             CALL PRINT_MESSAGE(msgBuf, mon_ioUnit, SQUEEZE_RIGHT, 1)
                0099             WRITE(msgBuf,'(2A)') '// ===========================',
                0100      &           '============================'
                0101             CALL PRINT_MESSAGE(msgBuf, mon_ioUnit, SQUEEZE_RIGHT, 1)
                0102           ENDIF
                0103 
49aab2cab9 Jean*0104 C--   endif master cpu io
d9263fe447 Jean*0105         ENDIF
                0106 
6f03324dd9 Dimi*0107         CALL MON_SET_PREF('exf',myThid)
d9263fe447 Jean*0108         CALL MON_OUT_I ('_tsnumber', myIter,mon_string_none,myThid)
                0109         CALL MON_OUT_RL('_time_sec', myTime,mon_string_none,myThid)
                0110 
                0111 C       Print some statistics about input forcing fields
b0426326ce Jean*0112         IF ( stressIsOnCgrid ) THEN
                0113           CALL MON_WRITESTATS_RL( 1, ustress, '_ustress',
                0114      &             maskInW, maskInW, rAw, drF, dummyRL, myThid )
                0115           CALL MON_WRITESTATS_RL( 1, vstress, '_vstress',
                0116      &             maskInS, maskInS, rAs, drF, dummyRL, myThid )
                0117         ELSE
                0118           CALL MON_WRITESTATS_RL( 1, ustress, '_ustress',
                0119      &             maskInC, maskInC, rA , drF, dummyRL, myThid )
                0120           CALL MON_WRITESTATS_RL( 1, vstress, '_vstress',
                0121      &             maskInC, maskInC, rA , drF, dummyRL, myThid )
                0122         ENDIF
25b1505994 Jean*0123         IF ( computed .OR. hfluxfile .NE. ' ' ) THEN
                0124           CALL MON_WRITESTATS_RL( 1, hflux,   '_hflux',
                0125      &             maskInC, maskInC, rA , drF, dummyRL, myThid )
                0126         ENDIF
                0127         IF ( computed .OR. sfluxfile .NE. ' ' ) THEN
                0128           CALL MON_WRITESTATS_RL( 1, sflux,   '_sflux',
                0129      &             maskInC, maskInC, rA , drF, dummyRL, myThid )
                0130         ENDIF
358649780a Gael*0131         IF ( useAtmWind ) THEN
25b1505994 Jean*0132           CALL MON_WRITESTATS_RL( 1, uwind,   '_uwind',
                0133      &             maskInC, maskInC, rA , drF, dummyRL, myThid )
                0134           CALL MON_WRITESTATS_RL( 1, vwind,   '_vwind',
                0135      &             maskInC, maskInC, rA , drF, dummyRL, myThid )
358649780a Gael*0136         ENDIF
25b1505994 Jean*0137         IF ( computed .OR. wspeedfile .NE. ' ' ) THEN
                0138           CALL MON_WRITESTATS_RL( 1, wspeed,  '_wspeed',
                0139      &             maskInC, maskInC, rA , drF, dummyRL, myThid )
                0140         ENDIF
6f03324dd9 Dimi*0141 #ifdef ALLOW_ATM_TEMP
25b1505994 Jean*0142         IF ( atempfile .NE. ' ' ) THEN
                0143           CALL MON_WRITESTATS_RL( 1, atemp,   '_atemp',
                0144      &             maskInC, maskInC, rA , drF, dummyRL, myThid )
                0145         ENDIF
                0146         IF ( aqhfile .NE. ' ' ) THEN
                0147           CALL MON_WRITESTATS_RL( 1, aqh,     '_aqh',
                0148      &             maskInC, maskInC, rA , drF, dummyRL, myThid )
                0149         ENDIF
                0150         IF ( lwdownfile .NE. ' ' .OR. lwfluxfile .NE. ' ' ) THEN
                0151           CALL MON_WRITESTATS_RL( 1, lwflux,  '_lwflux',
                0152      &             maskInC, maskInC, rA , drF, dummyRL, myThid )
                0153         ENDIF
26f6b8243e Jean*0154         IF ( computed .OR. evapfile .NE. ' ' ) THEN
                0155           CALL MON_WRITESTATS_RL( 1, evap,    '_evap',
                0156      &             maskInC, maskInC, rA , drF, dummyRL, myThid )
                0157         ENDIF
25b1505994 Jean*0158         IF ( precipfile .NE. ' ' ) THEN
                0159           CALL MON_WRITESTATS_RL( 1, precip,  '_precip',
                0160      &             maskInC, maskInC, rA , drF, dummyRL, myThid )
                0161         ENDIF
                0162         IF ( snowprecipfile .NE. ' ' ) THEN
                0163           CALL MON_WRITESTATS_RL(1,snowprecip,'_snowprecip',
                0164      &             maskInC, maskInC, rA , drF, dummyRL, myThid )
                0165         ENDIF
6f03324dd9 Dimi*0166 #endif /* ALLOW_ATM_TEMP */
                0167 #if defined(ALLOW_ATM_TEMP) || defined(SHORTWAVE_HEATING)
25b1505994 Jean*0168         IF ( swdownfile .NE. ' ' .OR. swfluxfile .NE. ' ' ) THEN
                0169           CALL MON_WRITESTATS_RL( 1, swflux,  '_swflux',
                0170      &             maskInC, maskInC, rA , drF, dummyRL, myThid )
                0171         ENDIF
6f03324dd9 Dimi*0172 #endif
                0173 #ifdef ALLOW_DOWNWARD_RADIATION
25b1505994 Jean*0174         IF ( swdownfile .NE. ' ' ) THEN
                0175           CALL MON_WRITESTATS_RL( 1, swdown,  '_swdown',
                0176      &             maskInC, maskInC, rA , drF, dummyRL, myThid )
                0177         ENDIF
                0178         IF ( lwdownfile .NE. ' ' ) THEN
                0179           CALL MON_WRITESTATS_RL( 1, lwdown,  '_lwdown',
                0180      &             maskInC, maskInC, rA , drF, dummyRL, myThid )
                0181         ENDIF
6f03324dd9 Dimi*0182 #endif
                0183 #ifdef ATMOSPHERIC_LOADING
25b1505994 Jean*0184         IF ( apressurefile .NE. ' ' ) THEN
                0185            CALL MON_WRITESTATS_RL( 1,apressure,'_apressure',
                0186      &              maskInC, maskInC, rA , drF, dummyRL, myThid )
                0187         ENDIF
6f03324dd9 Dimi*0188 #endif
a0e99e946e Jean*0189 #ifdef ALLOW_RUNOFF
25b1505994 Jean*0190         IF ( runofffile .NE. ' ' ) THEN
                0191           CALL MON_WRITESTATS_RL( 1, runoff,  '_runoff',
                0192      &             maskInC, maskInC, rA , drF, dummyRL, myThid )
                0193         ENDIF
e603dbf008 Dimi*0194 # ifdef ALLOW_RUNOFTEMP
                0195         IF ( runoftempfile .NE. ' ' ) THEN
                0196           CALL MON_WRITESTATS_RL( 1, runoftemp,  '_runoftemp',
                0197      &             maskInC, maskInC, rA , drF, dummyRL, myThid )
                0198         ENDIF
                0199 # endif
6f03324dd9 Dimi*0200 #endif
b7af0c28d6 Ou W*0201 #ifdef ALLOW_SALTFLX
a66aad0124 Gael*0202         IF ( saltflxfile .NE. ' ' ) THEN
                0203           CALL MON_WRITESTATS_RL( 1, saltflx,'_saltflx',
                0204      &             maskInC, maskInC, rA , drF, dummyRL, myThid )
                0205         ENDIF
                0206 #endif
24da7525ba Jean*0207 #ifdef EXF_SEAICE_FRACTION
25b1505994 Jean*0208         IF ( areamaskfile .NE. ' ' ) THEN
                0209           CALL MON_WRITESTATS_RL( 1, areamask,'_areamask',
                0210      &             maskInC, maskInC, rA , drF, dummyRL, myThid )
                0211         ENDIF
8f277f2728 Gael*0212 #endif
4b13fec8e0 Matt*0213 #ifdef USE_EXFCO2
                0214         IF ( apco2file .NE. ' ' ) THEN
                0215           CALL MON_WRITESTATS_RL( 1, apco2, '_apco2',
                0216      &             maskInC, maskInC, rA , drF, dummyRL, myThid )
                0217         ENDIF
                0218 #endif
822b68fb45 Dimi*0219 #ifdef ALLOW_CLIMSST_RELAXATION
25b1505994 Jean*0220         IF ( climsstfile .NE. ' ' ) THEN
                0221           CALL MON_WRITESTATS_RL( 1, climsst, '_climsst',
                0222      &             maskInC, maskInC, rA , drF, dummyRL, myThid )
                0223         ENDIF
822b68fb45 Dimi*0224 #endif
                0225 #ifdef ALLOW_CLIMSSS_RELAXATION
25b1505994 Jean*0226         IF ( climsssfile .NE. ' ' ) THEN
                0227           CALL MON_WRITESTATS_RL( 1, climsss, '_climsss',
                0228      &             maskInC, maskInC, rA , drF, dummyRL, myThid )
                0229         ENDIF
822b68fb45 Dimi*0230 #endif
de9be302a8 Patr*0231 #ifdef ALLOW_CLIMSTRESS_RELAXATION
25b1505994 Jean*0232         IF ( climustrfile .NE. ' ' ) THEN
de9be302a8 Patr*0233           CALL MON_WRITESTATS_RL( 1, climustr, '_climustr',
                0234      &             maskInW, maskInW, rAw, drF, dummyRL, myThid )
25b1505994 Jean*0235         ENDIF
                0236         IF ( climvstrfile .NE. ' ' ) THEN
de9be302a8 Patr*0237           CALL MON_WRITESTATS_RL( 1, climvstr, '_climvstr',
                0238      &             maskInS, maskInS, rAs, drF, dummyRL, myThid )
25b1505994 Jean*0239         ENDIF
de9be302a8 Patr*0240 #endif
6f03324dd9 Dimi*0241 
49aab2cab9 Jean*0242         IF ( MASTER_CPU_IO(myThid) ) THEN
d1c48a721f Jean*0243 C--   only the master thread is allowed to switch On/Off mon_write_stdout
3daafce20b Jean*0244 C     & mon_write_mnc (since it is the only thread that uses those flags):
d1c48a721f Jean*0245 
                0246           IF ( mon_write_stdout ) THEN
                0247             WRITE(msgBuf,'(2A)') '// ===========================',
                0248      &           '============================'
                0249             CALL PRINT_MESSAGE(msgBuf, mon_ioUnit, SQUEEZE_RIGHT, 1)
                0250             WRITE(msgBuf,'(A)') '// End MONITOR EXF statistics'
                0251             CALL PRINT_MESSAGE(msgBuf, mon_ioUnit, SQUEEZE_RIGHT, 1)
                0252             WRITE(msgBuf,'(2A)') '// ===========================',
                0253      &           '============================'
                0254             CALL PRINT_MESSAGE(msgBuf, mon_ioUnit, SQUEEZE_RIGHT, 1)
                0255           ENDIF
                0256 
                0257           mon_write_stdout = .FALSE.
                0258           mon_write_mnc    = .FALSE.
                0259 
49aab2cab9 Jean*0260 C--   endif master cpu io
d9263fe447 Jean*0261         ENDIF
                0262 
d1c48a721f Jean*0263 C     endif different multiple
d9263fe447 Jean*0264       ENDIF
                0265 
f15e1e61c6 Patr*0266 #endif /* ALLOW_MONITOR */
                0267 
6f03324dd9 Dimi*0268       RETURN
                0269       END