Back to home page

MITgcm

 
 

    


File indexing completed on 2018-03-02 18:42:46 UTC

view on githubraw file Latest commit add29e06 on 2018-01-31 20:35:05 UTC
9a4f5fc78a Jean*0001 #include "OCN_CPL_OPTIONS.h"
                0002 
                0003 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
                0004 CBOP 0
                0005 C !ROUTINE: CPL_DIAGNOSTICS_FILL
                0006 
                0007 C !INTERFACE:
                0008       SUBROUTINE CPL_DIAGNOSTICS_FILL(
                0009      I                     myTime, myIter, myThid )
                0010 
                0011 C     !DESCRIPTION:
                0012 C     Fill-in diagnostics array for OCN_CPL variables
                0013 
                0014 C     !USES:
                0015       IMPLICIT NONE
                0016 #include "SIZE.h"
                0017 #include "EEPARAMS.h"
                0018 #include "PARAMS.h"
                0019 #include "CPL_PARAMS.h"
                0020 #include "OCNCPL.h"
                0021 
                0022 C     !INPUT PARAMETERS:
                0023 C     myTime   :: Current time of simulation ( s )
                0024 C     myIter   :: Current iteration number in simulation
                0025 C     myThid   :: my Thread Id number
                0026       _RL     myTime
                0027       INTEGER myIter, myThid
                0028 CEOP
                0029 
                0030 #ifdef ALLOW_DIAGNOSTICS
                0031 C     !FUNCTIONS:
                0032 #ifdef ALLOW_THSICE
                0033       LOGICAL  DIAGNOSTICS_IS_ON
                0034       EXTERNAL DIAGNOSTICS_IS_ON
                0035 #endif /* ALLOW_THSICE */
                0036 
                0037 C     !LOCAL VARIABLES:
                0038 #ifdef ALLOW_THSICE
                0039       INTEGER bi,bj
                0040       INTEGER i,j
                0041       _RL tmpFld(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
                0042       _RL tmpFac
                0043 #endif /* ALLOW_THSICE */
                0044 
                0045       IF ( useDiagnostics ) THEN
                0046 
                0047         CALL DIAGNOSTICS_FILL( atmSLPr   , 'CPL_SLPr',
                0048      I                          0, 1, 0, 1, 1, myThid )
                0049         CALL DIAGNOSTICS_FILL( HeatFlux  , 'CPL_Qnet',
                0050      I                          0, 1, 0, 1, 1, myThid )
                0051         CALL DIAGNOSTICS_FILL( qShortWave, 'CPL_Qsw ',
                0052      I                          0, 1, 0, 1, 1, myThid )
                0053         CALL DIAGNOSTICS_FILL( tauX      , 'CPL_tauX',
                0054      I                          0, 1, 0, 1, 1, myThid )
                0055         CALL DIAGNOSTICS_FILL( tauY      , 'CPL_tauY',
                0056      I                          0, 1, 0, 1, 1, myThid )
                0057         CALL DIAGNOSTICS_FILL( FWFlux    , 'CPL_FWat',
                0058      I                          0, 1, 0, 1, 1, myThid )
                0059         CALL DIAGNOSTICS_FILL( iceSaltFlx, 'CPL_sFlx',
                0060      I                          0, 1, 0, 1, 1, myThid )
                0061         CALL DIAGNOSTICS_FILL( seaIceMass, 'CPL_iceM',
                0062      I                          0, 1, 0, 1, 1, myThid )
                0063 #ifdef ALLOW_SALT_PLUME
                0064         IF ( ocn_cplExch_SaltPl ) THEN
                0065          CALL DIAGNOSTICS_FILL( saltPlmFlx_cpl, 'CPL_sPlm',
                0066      I                          0, 1, 0, 1, 1, myThid )
                0067         ENDIF
                0068 #endif /* ALLOW_SALT_PLUME */
                0069 #ifdef ALLOW_DIC
                0070         IF ( ocn_cplExch_RunOff ) THEN
                0071          CALL DIAGNOSTICS_FILL( RunOff_cpl, 'CPL_RnOf',
                0072      I                          0, 1, 0, 1, 1, myThid )
                0073         ENDIF
                0074         IF ( ocn_cplExch_DIC ) THEN
                0075          CALL DIAGNOSTICS_FILL( airCO2    , 'CPL_aCO2',
                0076      I                          0, 1, 0, 1, 1, myThid )
                0077          CALL DIAGNOSTICS_FILL( surfWSpeed, 'CPL_wSpd',
                0078      I                          0, 1, 0, 1, 1, myThid )
                0079         ENDIF
                0080 #endif /* ALLOW_DIC */
                0081 #if (defined ALLOW_DIC) || (defined ALLOW_THSICE)
                0082         IF ( ( ocn_cplExch1W_sIce.AND.ocn_cplExch_DIC )
                0083      &    .OR. ocn_cplExch2W_sIce ) THEN
                0084          CALL DIAGNOSTICS_FILL( sIceFrac_cpl , 'CPL_icFr',
                0085      I                          0, 1, 0, 1, 1, myThid )
                0086         ENDIF
                0087 #endif /* ALLOW_DIC or ALLOW_THSICE */
                0088 #ifdef ALLOW_THSICE
                0089         IF ( ocn_cplExch2W_sIce ) THEN
                0090 C      Ice-fraction weighted quantities:
                0091          tmpFac = 1. _d 0
                0092          CALL DIAGNOSTICS_FRACT_FILL(
                0093      I                          sIceThick_cpl, sIceFrac_cpl,
                0094      I                          tmpFac, 1, 'CPL_iceH',
                0095      I                          0, 1, 0, 1, 1, myThid )
                0096          CALL DIAGNOSTICS_FRACT_FILL(
                0097      I                          sIceSnowH_cpl, sIceFrac_cpl,
                0098      I                          tmpFac, 1, 'CPL_snwH',
                0099      I                          0, 1, 0, 1, 1, myThid )
                0100 
                0101 C      Ice-Volume weighted quantities:
                0102          IF ( DIAGNOSTICS_IS_ON('CPL_Qic1',myThid) .OR.
                0103      &        DIAGNOSTICS_IS_ON('CPL_Qic2',myThid) ) THEN
                0104           DO bj=myByLo(myThid),myByHi(myThid)
                0105            DO bi=myBxLo(myThid),myBxHi(myThid)
                0106 
                0107             DO j=1-OLy,sNy+OLy
                0108              DO i=1-OLx,sNx+OLx
                0109               tmpFld(i,j) = sIceFrac_cpl(i,j,bi,bj)
                0110      &                    * sIceThick_cpl(i,j,bi,bj)
                0111              ENDDO
                0112             ENDDO
                0113             CALL DIAGNOSTICS_FRACT_FILL(
                0114      I                          sIceQ1_cpl(1-OLx,1-OLy,bi,bj),
                0115      I                          tmpFld, tmpFac, 1, 'CPL_Qic1',
                0116      I                          0, 1, 2,bi,bj, myThid )
                0117             CALL DIAGNOSTICS_FRACT_FILL(
                0118      I                          sIceQ2_cpl(1-OLx,1-OLy,bi,bj),
                0119      I                          tmpFld, tmpFac, 1, 'CPL_Qic2',
                0120      I                          0, 1, 2,bi,bj, myThid )
                0121 
                0122            ENDDO
                0123           ENDDO
                0124          ENDIF
                0125 
                0126         ENDIF
                0127 #endif /* ALLOW_THSICE */
                0128 
                0129       ENDIF
                0130 
                0131 #endif /* ALLOW_DIAGNOSTICS */
                0132       RETURN
                0133       END