Back to home page

MITgcm

 
 

    


File indexing completed on 2018-03-06 06:09:12 UTC

view on githubraw file Latest commit 963f7646 on 2018-03-04 02:01:56 UTC
6e34151e15 Gael*0001 #include "LAYERS_OPTIONS.h"
                0002 
                0003 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
c1687389a3 Jean*0004 CBOP 0
                0005 C !ROUTINE: LAYERS_DIAGNOSTICS_INIT
6e34151e15 Gael*0006 
c1687389a3 Jean*0007 C !INTERFACE:
6e34151e15 Gael*0008       SUBROUTINE LAYERS_DIAGNOSTICS_INIT( myThid )
                0009 
c1687389a3 Jean*0010 C     !DESCRIPTION:
                0011 C     Initialize list of all available diagnostics for LAYERS package
6e34151e15 Gael*0012 
c1687389a3 Jean*0013 C     !USES:
6e34151e15 Gael*0014       IMPLICIT NONE
                0015 #include "EEPARAMS.h"
                0016 #include "SIZE.h"
                0017 #include "PARAMS.h"
9dd9b08cda Jean*0018 #include "GRID.h"
6e34151e15 Gael*0019 #ifdef ALLOW_LAYERS
                0020 # include "LAYERS_SIZE.h"
                0021 # include "LAYERS.h"
                0022 #endif
                0023 
c1687389a3 Jean*0024 C     !INPUT/OUTPUT PARAMETERS:
6e34151e15 Gael*0025 C     myThid ::  my Thread Id number
                0026       INTEGER myThid
                0027 
c1687389a3 Jean*0028 #ifdef ALLOW_LAYERS
                0029 #ifdef ALLOW_DIAGNOSTICS
                0030 C     !FUNCTIONS:
                0031       INTEGER  DIAGS_GET_PARMS_I
                0032       EXTERNAL DIAGS_GET_PARMS_I
                0033       CHARACTER*(16) DIAGS_MK_UNITS
                0034       EXTERNAL DIAGS_MK_UNITS
                0035 
                0036 C     !LOCAL VARIABLES:
406891c1a3 Gael*0037       INTEGER        iLa
6e34151e15 Gael*0038       INTEGER        diagNum
                0039       INTEGER        diagMate
                0040       CHARACTER*8    diagName
                0041       CHARACTER*16   diagCode
                0042       CHARACTER*16   diagUnits
                0043       CHARACTER*(80) diagTitle
c1687389a3 Jean*0044       CHARACTER*2    rUnit2c
a177b00569 Jean*0045 #ifdef LAYERS_PRHO_REF
                0046       INTEGER kLoc
                0047       _RL     rLoc
                0048 #endif
c1687389a3 Jean*0049 CEOP
6e34151e15 Gael*0050 
c1687389a3 Jean*0051 c     IF ( useDiagnostics ) THEN
6e34151e15 Gael*0052 
c1687389a3 Jean*0053       IF ( usingPCoords ) THEN
                0054         rUnit2c= 'Pa'
                0055       ELSE
                0056         rUnit2c= 'm '
                0057       ENDIF
                0058       diagNum = DIAGS_GET_PARMS_I( 'LAST_DIAG_ID', myThid )
406891c1a3 Gael*0059 
                0060       DO iLa=1,layers_maxNum
c1687389a3 Jean*0061        IF ( layers_num(iLa).NE.0 ) THEN
6e34151e15 Gael*0062 
9dd9b08cda Jean*0063 #ifdef LAYERS_PRHO_REF
                0064        IF ( layers_num(iLa).EQ.3 ) THEN
55f64449a3 Ryan*0065         WRITE(diagName,'(A4,I1,A3)') 'LaTr',iLa,layers_name(iLa)
a177b00569 Jean*0066         rLoc = 0.
                0067         kLoc = layers_krho(iLa)
                0068         IF ( kLoc.GE.1 .AND. kLoc.LE.Nr ) THEN
                0069           rLoc = rC(kLoc)
                0070         ELSE
                0071           kLoc = 0
                0072         ENDIF
                0073         WRITE(diagTitle,'(2A,F9.2,A,I4)') 'Pot. density (minus 1000)',
                0074      &    ' for layer averaging, ref_z=', rLoc, ',', kLoc
9dd9b08cda Jean*0075         diagUnits = 'kg/m^3          '
                0076         diagCode  = 'SMR     MR      '
                0077         CALL DIAGNOSTICS_ADDTOLIST( diagNum,
                0078      I   diagName, diagCode, diagUnits, diagTitle, 0, myThid )
                0079        ENDIF
                0080 #endif
                0081 
c1687389a3 Jean*0082 #if (defined LAYERS_UFLUX) || (defined LAYERS_VFLUX)
                0083 
                0084 C --- UH, VH
                0085         WRITE(diagName,'(A4,I1,A3)') 'LaUH',iLa,layers_name(iLa)
                0086         diagTitle = 'Layer Integrated  zonal Transport (UH, m^2/s)'
                0087         diagUnits = DIAGS_MK_UNITS( rUnit2c//'.m/s', myThid )
                0088         diagCode  = 'UU      MX      '
                0089         diagMate  = diagNum + 2
                0090         CALL DIAGNOSTICS_ADDTOLIST( diagNum,
6e34151e15 Gael*0091      I   diagName, diagCode, diagUnits, diagTitle, diagMate, myThid )
c1687389a3 Jean*0092         CALL DIAGNOSTICS_SETKLEV( diagName, Nlayers , myThid )
                0093 
                0094         WRITE(diagName,'(A4,I1,A3)') 'LaVH',iLa,layers_name(iLa)
                0095         diagTitle = 'Layer Integrated merid. Transport (VH, m^2/s)'
                0096         diagUnits = DIAGS_MK_UNITS( rUnit2c//'.m/s', myThid )
                0097         diagCode  = 'VV      MX      '
                0098         diagMate  = diagNum
                0099         CALL DIAGNOSTICS_ADDTOLIST( diagNum,
                0100      I   diagName, diagCode, diagUnits, diagTitle, diagMate, myThid )
                0101         CALL DIAGNOSTICS_SETKLEV( diagName, Nlayers , myThid )
6e34151e15 Gael*0102 
                0103 #ifdef LAYERS_THICKNESS
                0104 
c1687389a3 Jean*0105 C --- Thickness
                0106         WRITE(diagName,'(A4,I1,A3)') 'LaHw',iLa,layers_name(iLa)
                0107         diagTitle = 'Layer Thickness at U points (m)'
                0108         diagUnits = DIAGS_MK_UNITS( rUnit2c, myThid )
                0109         diagCode  = 'SU      MX      '
                0110         diagMate  = diagNum + 2
                0111         CALL DIAGNOSTICS_ADDTOLIST( diagNum,
6e34151e15 Gael*0112      I   diagName, diagCode, diagUnits, diagTitle, diagMate, myThid )
c1687389a3 Jean*0113         CALL DIAGNOSTICS_SETKLEV( diagName, Nlayers , myThid )
                0114 
                0115         WRITE(diagName,'(A4,I1,A3)') 'LaHs',iLa,layers_name(iLa)
                0116         diagTitle = 'Layer Thickness at V points (m)'
                0117         diagUnits = DIAGS_MK_UNITS( rUnit2c, myThid )
                0118         diagCode  = 'SV      MX      '
                0119         diagMate  = diagNum
                0120         CALL DIAGNOSTICS_ADDTOLIST( diagNum,
                0121      I   diagName, diagCode, diagUnits, diagTitle, diagMate, myThid )
                0122         CALL DIAGNOSTICS_SETKLEV( diagName, Nlayers , myThid )
14bb2ae926 Ryan*0123 
                0124 C --- PI
c1687389a3 Jean*0125         WRITE(diagName,'(A4,I1,A3)') 'LaPw',iLa,layers_name(iLa)
                0126         diagTitle = 'Layer Probability at U points [-]'
                0127         diagUnits = '1               '
                0128         diagCode  = 'SU      MX      '
                0129         diagMate  = diagNum + 2
                0130         CALL DIAGNOSTICS_ADDTOLIST( diagNum,
14bb2ae926 Ryan*0131      I   diagName, diagCode, diagUnits, diagTitle, diagMate, myThid )
c1687389a3 Jean*0132         CALL DIAGNOSTICS_SETKLEV( diagName, Nlayers , myThid )
                0133 
                0134         WRITE(diagName,'(A4,I1,A3)') 'LaPs',iLa,layers_name(iLa)
                0135         diagTitle = 'Layer Probability at V points [-]'
                0136         diagUnits = '1               '
                0137         diagCode  = 'SV      MX      '
                0138         diagMate  = diagNum
                0139         CALL DIAGNOSTICS_ADDTOLIST( diagNum,
14bb2ae926 Ryan*0140      I   diagName, diagCode, diagUnits, diagTitle, diagMate, myThid )
c1687389a3 Jean*0141         CALL DIAGNOSTICS_SETKLEV( diagName, Nlayers , myThid )
14bb2ae926 Ryan*0142 
                0143 C --- U, V
c1687389a3 Jean*0144         WRITE(diagName,'(A4,I1,A3)') 'LaUa',iLa,layers_name(iLa)
                0145         diagTitle = 'Layer-averaged U velocity (non-weighted) (m/s)'
                0146         diagUnits = 'm/s             '
                0147         diagCode  = 'UU      MX      '
                0148         diagMate  = diagNum + 2
                0149         CALL DIAGNOSTICS_ADDTOLIST( diagNum,
14bb2ae926 Ryan*0150      I   diagName, diagCode, diagUnits, diagTitle, diagMate, myThid )
c1687389a3 Jean*0151         CALL DIAGNOSTICS_SETKLEV( diagName, Nlayers , myThid )
                0152 
                0153         WRITE(diagName,'(A4,I1,A3)') 'LaVa',iLa,layers_name(iLa)
                0154         diagTitle = 'Layer-averaged V velocity (non-weighted) (m/s)'
                0155         diagUnits = 'm/s             '
                0156         diagCode  = 'VV      MX      '
                0157         diagMate  = diagNum
                0158         CALL DIAGNOSTICS_ADDTOLIST( diagNum,
14bb2ae926 Ryan*0159      I   diagName, diagCode, diagUnits, diagTitle, diagMate, myThid )
c1687389a3 Jean*0160         CALL DIAGNOSTICS_SETKLEV( diagName, Nlayers , myThid )
14bb2ae926 Ryan*0161 
c1687389a3 Jean*0162 #endif /* LAYERS_THICKNESS */
6e34151e15 Gael*0163 
c1687389a3 Jean*0164 #endif /* LAYERS_UFLUX or LAYERS_VFLUX */
                0165 
cf336ab6c5 Ryan*0166 #ifdef LAYERS_THERMODYNAMICS
                0167 
50d8304171 Ryan*0168         WRITE(diagName,'(A4,I1,A3)') 'LaHc',iLa,layers_name(iLa)
                0169         diagTitle = 'Layer Thickness at tracer points (m)'
                0170         diagUnits = DIAGS_MK_UNITS( rUnit2c, myThid )
                0171         diagCode  = 'SM      MX      '
                0172         diagMate  = 0
                0173         CALL DIAGNOSTICS_ADDTOLIST( diagNum,
                0174      I   diagName, diagCode, diagUnits, diagTitle, diagMate, myThid )
                0175         CALL DIAGNOSTICS_SETKLEV( diagName, Nlayers , myThid )
                0176 
cf336ab6c5 Ryan*0177         WRITE(diagName,'(A4,I1,A3)') 'LaTs',iLa,layers_name(iLa)
963f76462f chri*0178         diagTitle = 
                0179      &   'Layer thickness tendency due to THETA surf. forc.'
049a158a99 Hajo*0180         diagUnits = 'm/s             '
cf336ab6c5 Ryan*0181         diagCode  = 'SM      MX      '
                0182         diagMate  = 0
                0183         CALL DIAGNOSTICS_ADDTOLIST( diagNum,
                0184      I   diagName, diagCode, diagUnits, diagTitle, diagMate, myThid )
50d8304171 Ryan*0185         CALL DIAGNOSTICS_SETKLEV( diagName, Nlayers-1 , myThid )
cf336ab6c5 Ryan*0186 
                0187         WRITE(diagName,'(A4,I1,A3)') 'LaTh',iLa,layers_name(iLa)
963f76462f chri*0188         diagTitle = 
                0189      &   'Layer thickness tendency due to THETA horiz. diff.'
049a158a99 Hajo*0190         diagUnits = 'm/s             '
cf336ab6c5 Ryan*0191         diagCode  = 'SM      MX      '
                0192         diagMate  = 0
                0193         CALL DIAGNOSTICS_ADDTOLIST( diagNum,
                0194      I   diagName, diagCode, diagUnits, diagTitle, diagMate, myThid )
50d8304171 Ryan*0195         CALL DIAGNOSTICS_SETKLEV( diagName, Nlayers-1 , myThid )
cf336ab6c5 Ryan*0196 
55f64449a3 Ryan*0197 C ------- This diagnostic used to be called 'LaTr', but that name
6088c626b1 Jean*0198 C         conflicts with JMC s prho diagnostics.
55f64449a3 Ryan*0199         WRITE(diagName,'(A4,I1,A3)') 'LaTz',iLa,layers_name(iLa)
963f76462f chri*0200         diagTitle = 
                0201      &   'Layer thickness tendency due to THETA vert. diff.'
049a158a99 Hajo*0202         diagUnits = 'm/s             '
cf336ab6c5 Ryan*0203         diagCode  = 'SM      MX      '
                0204         diagMate  = 0
                0205         CALL DIAGNOSTICS_ADDTOLIST( diagNum,
                0206      I   diagName, diagCode, diagUnits, diagTitle, diagMate, myThid )
50d8304171 Ryan*0207         CALL DIAGNOSTICS_SETKLEV( diagName, Nlayers-1 , myThid )
                0208 
                0209         WRITE(diagName,'(A4,I1,A3)') 'LTha',iLa,layers_name(iLa)
963f76462f chri*0210         diagTitle = 
                0211      &   'Layer thickness tendency due to THETA horiz. adv.'
049a158a99 Hajo*0212         diagUnits = 'm/s             '
50d8304171 Ryan*0213         diagCode  = 'SM      MX      '
                0214         diagMate  = 0
                0215         CALL DIAGNOSTICS_ADDTOLIST( diagNum,
                0216      I   diagName, diagCode, diagUnits, diagTitle, diagMate, myThid )
                0217         CALL DIAGNOSTICS_SETKLEV( diagName, Nlayers-1 , myThid )
                0218 
7139ed4ee5 Ryan*0219         WRITE(diagName,'(A4,I1,A3)') 'LTza',iLa,layers_name(iLa)
963f76462f chri*0220         diagTitle = 
                0221      &   'Layer thickness tendency due to THETA vert. adv.'
049a158a99 Hajo*0222         diagUnits = 'm/s             '
50d8304171 Ryan*0223         diagCode  = 'SM      MX      '
                0224         diagMate  = 0
                0225         CALL DIAGNOSTICS_ADDTOLIST( diagNum,
                0226      I   diagName, diagCode, diagUnits, diagTitle, diagMate, myThid )
                0227         CALL DIAGNOSTICS_SETKLEV( diagName, Nlayers-1 , myThid )
                0228 
                0229         WRITE(diagName,'(A4,I1,A3)') 'LTto',iLa,layers_name(iLa)
963f76462f chri*0230         diagTitle = 
                0231      &   'Layer thickness tendency due to all THETA terms.'
049a158a99 Hajo*0232         diagUnits = 'm/day           '
50d8304171 Ryan*0233         diagCode  = 'SM      MX      '
                0234         diagMate  = 0
                0235         CALL DIAGNOSTICS_ADDTOLIST( diagNum,
                0236      I   diagName, diagCode, diagUnits, diagTitle, diagMate, myThid )
                0237         CALL DIAGNOSTICS_SETKLEV( diagName, Nlayers-1 , myThid )
cf336ab6c5 Ryan*0238 
                0239         WRITE(diagName,'(A4,I1,A3)') 'LaSs',iLa,layers_name(iLa)
963f76462f chri*0240         diagTitle = 
                0241      &   'Layer thickness tendency due to SALT surf. forc.'
049a158a99 Hajo*0242         diagUnits = 'm/s             '
cf336ab6c5 Ryan*0243         diagCode  = 'SM      MX      '
                0244         diagMate  = 0
                0245         CALL DIAGNOSTICS_ADDTOLIST( diagNum,
                0246      I   diagName, diagCode, diagUnits, diagTitle, diagMate, myThid )
50d8304171 Ryan*0247         CALL DIAGNOSTICS_SETKLEV( diagName, Nlayers-1 , myThid )
cf336ab6c5 Ryan*0248 
                0249         WRITE(diagName,'(A4,I1,A3)') 'LaSh',iLa,layers_name(iLa)
963f76462f chri*0250         diagTitle = 
                0251      &   'Layer thickness tendency due to SALT horiz. diff.'
049a158a99 Hajo*0252         diagUnits = 'm/s             '
cf336ab6c5 Ryan*0253         diagCode  = 'SM      MX      '
                0254         diagMate  = 0
                0255         CALL DIAGNOSTICS_ADDTOLIST( diagNum,
                0256      I   diagName, diagCode, diagUnits, diagTitle, diagMate, myThid )
50d8304171 Ryan*0257         CALL DIAGNOSTICS_SETKLEV( diagName, Nlayers-1 , myThid )
cf336ab6c5 Ryan*0258 
7139ed4ee5 Ryan*0259         WRITE(diagName,'(A4,I1,A3)') 'LaSz',iLa,layers_name(iLa)
963f76462f chri*0260         diagTitle = 
                0261      &   'Layer thickness tendency due to SALT vert. diff.'
049a158a99 Hajo*0262         diagUnits = 'm/s             '
cf336ab6c5 Ryan*0263         diagCode  = 'SM      MX      '
                0264         diagMate  = 0
                0265         CALL DIAGNOSTICS_ADDTOLIST( diagNum,
                0266      I   diagName, diagCode, diagUnits, diagTitle, diagMate, myThid )
50d8304171 Ryan*0267         CALL DIAGNOSTICS_SETKLEV( diagName, Nlayers-1 , myThid )
cf336ab6c5 Ryan*0268 
50d8304171 Ryan*0269         WRITE(diagName,'(A4,I1,A3)') 'LSha',iLa,layers_name(iLa)
963f76462f chri*0270         diagTitle = 
                0271      &   'Layer thickness tendency due to SALT horiz. adv.'
049a158a99 Hajo*0272         diagUnits = 'm/s             '
cf336ab6c5 Ryan*0273         diagCode  = 'SM      MX      '
                0274         diagMate  = 0
                0275         CALL DIAGNOSTICS_ADDTOLIST( diagNum,
                0276      I   diagName, diagCode, diagUnits, diagTitle, diagMate, myThid )
50d8304171 Ryan*0277         CALL DIAGNOSTICS_SETKLEV( diagName, Nlayers-1 , myThid )
                0278 
7139ed4ee5 Ryan*0279         WRITE(diagName,'(A4,I1,A3)') 'LSza',iLa,layers_name(iLa)
963f76462f chri*0280         diagTitle = 
                0281      &   'Layer thickness tendency due to SALT vert. adv.'
049a158a99 Hajo*0282         diagUnits = 'm/s             '
50d8304171 Ryan*0283         diagCode  = 'SM      MX      '
                0284         diagMate  = 0
                0285         CALL DIAGNOSTICS_ADDTOLIST( diagNum,
                0286      I   diagName, diagCode, diagUnits, diagTitle, diagMate, myThid )
                0287         CALL DIAGNOSTICS_SETKLEV( diagName, Nlayers-1 , myThid )
cf336ab6c5 Ryan*0288 
50d8304171 Ryan*0289         WRITE(diagName,'(A4,I1,A3)') 'LSto',iLa,layers_name(iLa)
963f76462f chri*0290         diagTitle = 
                0291      &   'Layer thickness tendency due to all SALT terms.'
049a158a99 Hajo*0292         diagUnits = 'm/day           '
50d8304171 Ryan*0293         diagCode  = 'SM      MX      '
                0294         diagMate  = 0
                0295         CALL DIAGNOSTICS_ADDTOLIST( diagNum,
                0296      I   diagName, diagCode, diagUnits, diagTitle, diagMate, myThid )
                0297         CALL DIAGNOSTICS_SETKLEV( diagName, Nlayers-1 , myThid )
6088c626b1 Jean*0298 
cf336ab6c5 Ryan*0299 C --- PI
                0300         WRITE(diagName,'(A4,I1,A3)') 'LaPc',iLa,layers_name(iLa)
                0301         diagTitle = 'Layer Probability at tracer points [-]'
                0302         diagUnits = '1               '
                0303         diagCode  = 'SM      MX      '
                0304         diagMate  = 0
                0305         CALL DIAGNOSTICS_ADDTOLIST( diagNum,
                0306      I   diagName, diagCode, diagUnits, diagTitle, diagMate, myThid )
                0307         CALL DIAGNOSTICS_SETKLEV( diagName, Nlayers , myThid )
                0308 #endif /* LAYERS_THERMODYNAMICS */
                0309 
c1687389a3 Jean*0310        ENDIF
406891c1a3 Gael*0311       ENDDO
                0312 
c1687389a3 Jean*0313 c     ENDIF
6e34151e15 Gael*0314 #endif /* ALLOW_DIAGNOSTICS */
                0315 #endif /* ALLOW_LAYERS */
                0316 
                0317       RETURN
                0318       END