Back to home page

MITgcm

 
 

    


File indexing completed on 2018-03-02 18:37:34 UTC

view on githubraw file Latest commit add29e06 on 2018-01-31 20:35:05 UTC
3fd4b811ee Jean*0001 #include "ATM_CPL_OPTIONS.h"
12983a4149 Jean*0002 
                0003 CBOP
                0004 C     !ROUTINE: ATM_STORE_SURFFLUX
                0005 C     !INTERFACE:
                0006       SUBROUTINE ATM_STORE_SURFFLUX(
                0007      I                     bi, bj,
                0008      I                     myTime, myIter, myThid )
                0009 
                0010 C     !DESCRIPTION: \bv
                0011 C     *==========================================================*
                0012 C     | SUBROUTINE ATM_STORE_SURFFLUX
                0013 C     | o Routine for saving surface flux fields (in FFIELDS.h)
                0014 C     |   for export to coupling layer.
                0015 C     *==========================================================*
                0016 C     | This version interfaces to the main model
                0017 C     *==========================================================*
                0018 C     \ev
                0019 
                0020 C     !USES:
                0021       IMPLICIT NONE
                0022 
                0023 C     == Global variables ==
                0024 #include "SIZE.h"
                0025 
                0026 #include "EEPARAMS.h"
                0027 #include "PARAMS.h"
                0028 #include "CPL_PARAMS.h"
                0029 C     == Global variables (main model)
                0030 #include "FFIELDS.h"
                0031 C     == Global variables for coupling interface ==
                0032 #include "ATMCPL.h"
                0033 
                0034 C     !INPUT/OUTPUT PARAMETERS:
                0035 C     bi, bj    :: Tile indices
                0036 C     myTime    :: Current time in simulation (s)
                0037 C     myIter    :: Current iteration number
                0038 C     myThid    :: My Thread Id. number
                0039       INTEGER bi, bj
                0040       _RL     myTime
                0041       INTEGER myIter
                0042       INTEGER myThid
                0043 
                0044 C     !LOCAL VARIABLES:
                0045 C     i, j      :: Loop counters
                0046       INTEGER i,j
                0047       _RL cplTimeFraction
                0048 CEOP
                0049 
                0050        cplTimeFraction = 1. _d 0 / DFLOAT(cplSendFrq_iter)
                0051 
                0052 C     o Accumulate net surface heat flux (Qnet, +=upward, W/m2)
                0053 C       that will be exported to the coupling layer.
                0054        HeatFluxTime(bi,bj) = HeatFluxTime(bi,bj) + cplTimeFraction
                0055        DO j=1,sNy
                0056         DO i=1,sNx
                0057           HeatFlux(i,j,bi,bj) = HeatFlux(i,j,bi,bj)
                0058      &                        + Qnet(i,j,bi,bj)*cplTimeFraction
                0059         ENDDO
                0060        ENDDO
                0061 
                0062 C     o Accumulate net surface shortwave heat flux (Qsw, +=upward, W/m2)
                0063 C       that will be exported to the coupling layer.
                0064        qShortWaveTime(bi,bj) = qShortWaveTime(bi,bj) + cplTimeFraction
                0065        DO j=1,sNy
                0066         DO i=1,sNx
                0067           qShortWave(i,j,bi,bj) = qShortWave(i,j,bi,bj)
                0068      &                          + Qsw(i,j,bi,bj)*cplTimeFraction
                0069         ENDDO
                0070        ENDDO
                0071 
                0072 C     o Accumulate fresh water flux ( E-P, +=upward, kg/m^2/s)
                0073 C       that will be exported to the coupling layer.
                0074        EvMPrTime(bi,bj) = EvMPrTime(bi,bj) + cplTimeFraction
                0075        DO j=1,sNy
                0076         DO i=1,sNx
                0077           EvMPrFlux(i,j,bi,bj) = EvMPrFlux(i,j,bi,bj)
                0078      &                         + EmPmR(i,j,bi,bj)*cplTimeFraction
                0079         ENDDO
                0080        ENDDO
                0081 
961cdf7602 Jean*0082 #ifdef ALLOW_THSICE
12983a4149 Jean*0083       IF ( useThSIce ) THEN
                0084 C     o Accumulate SaltFlux from sea-ice (saltFlux, +=upward, g/m^2/s)
                0085 C       that will be exported to the coupling layer.
                0086        saltFxTime(bi,bj) = saltFxTime(bi,bj) + cplTimeFraction
                0087        DO j=1,sNy
                0088         DO i=1,sNx
                0089           iceSaltFlx(i,j,bi,bj) = iceSaltFlx(i,j,bi,bj)
                0090      &                 + saltFlux(i,j,bi,bj)*cplTimeFraction
                0091         ENDDO
                0092        ENDDO
                0093       ENDIF
961cdf7602 Jean*0094 #endif /* ALLOW_THSICE */
12983a4149 Jean*0095 
                0096       IF ( useAtm_Phys ) THEN
                0097 C     o Accumulate surface wind-stress
                0098 C       that will be exported to the coupling layer.
                0099        tauXTime(bi,bj) = tauXTime(bi,bj) + cplTimeFraction
                0100        tauYTime(bi,bj) = tauYTime(bi,bj) + cplTimeFraction
                0101        DO j=1,sNy
                0102         DO i=1,sNx
                0103           tauX(i,j,bi,bj) = tauX(i,j,bi,bj)
                0104      &                    + fu(i,j,bi,bj)*cplTimeFraction
                0105           tauY(i,j,bi,bj) = tauY(i,j,bi,bj)
                0106      &                    + fv(i,j,bi,bj)*cplTimeFraction
                0107         ENDDO
                0108        ENDDO
                0109       ENDIF
                0110 
                0111       RETURN
                0112       END