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
c04db39328 Jean*0001 #include "ATM_CPL_OPTIONS.h"
12983a4149 Jean*0002 #ifdef ALLOW_AIM
                0003 # include "AIM_OPTIONS.h"
                0004 #endif
                0005 
                0006 CBOP
                0007 C     !ROUTINE: ATM_STORE_AIM_FIELDS
                0008 C     !INTERFACE:
                0009       SUBROUTINE ATM_STORE_AIM_FIELDS(
                0010      I                     bi, bj,
                0011      I                     myTime, myIter, myThid )
                0012 
                0013 C     !DESCRIPTION: \bv
                0014 C     *==========================================================*
                0015 C     | SUBROUTINE ATM_STORE_AIM_FIELDS
                0016 C     | o Routine for saving AIM fields (e.g., surface wind
                0017 C     |   speed) for export to coupling layer.
                0018 C     *==========================================================*
                0019 C     | This version interfaces to the AIM package.
                0020 C     *==========================================================*
                0021 C     \ev
                0022 
                0023 C     !USES:
                0024       IMPLICIT NONE
                0025 
                0026 C     == Global variables ==
                0027 #ifdef ALLOW_AIM
                0028 # include "AIM_SIZE.h"
                0029 #else
                0030 # include "SIZE.h"
                0031 #endif
                0032 
                0033 #include "EEPARAMS.h"
                0034 #include "PARAMS.h"
54e4d81b97 Jean*0035 c#include "ATMIDS.h"
12983a4149 Jean*0036 #include "CPL_PARAMS.h"
                0037 #ifdef ALLOW_AIM
                0038 # include "AIM2DYN.h"
                0039 # include "AIM_CO2.h"
                0040 #endif
                0041 C     == Global variables for coupling interface ==
                0042 #include "ATMCPL.h"
                0043 
                0044 C     !INPUT/OUTPUT PARAMETERS:
                0045 C     bi, bj    :: Tile indices
                0046 C     myTime    :: Current time in simulation (s)
                0047 C     myIter    :: Current iteration number
                0048 C     myThid    :: My Thread Id. number
                0049       INTEGER bi, bj
                0050       _RL     myTime
                0051       INTEGER myIter
                0052       INTEGER myThid
                0053 CEOP
                0054 
                0055 #ifdef ALLOW_AIM
                0056 C     !LOCAL VARIABLES:
                0057 C     i, j      :: Loop counters
                0058       INTEGER i,j
                0059       _RL cplTimeFraction
                0060 
                0061       cplTimeFraction = 1. _d 0 / DFLOAT(cplSendFrq_iter)
                0062 
                0063 C     o Accumulate atmospheric surface wind speed (m/s) from AIM pkg
                0064 C       that will be exported to the coupling layer.
                0065        sWSpeedTime(bi,bj) = sWSpeedTime(bi,bj) + cplTimeFraction
                0066        DO j=1,sNy
                0067         DO i=1,sNx
                0068           sWSpeed(i,j,bi,bj) = sWSpeed(i,j,bi,bj)
                0069      &                       + aim_surfWind(i,j,bi,bj)*cplTimeFraction
                0070         ENDDO
                0071        ENDDO
                0072 
                0073 #ifdef ALLOW_AIM_CO2
c04db39328 Jean*0074 c     IF ( atm_cplExch_DIC ) THEN
12983a4149 Jean*0075 C     o Accumulate atmospheric CO2 from Aim pkg that will be exported
                0076 C       to the coupling layer.
                0077        airCO2Time(bi,bj) = airCO2Time(bi,bj) + cplTimeFraction
                0078        DO j=1,sNy
                0079         DO i=1,sNx
                0080           airCO2(i,j,bi,bj) = airCO2(i,j,bi,bj)
                0081      &                      + aim_CO2(i,j,bi,bj)*cplTimeFraction
                0082         ENDDO
                0083        ENDDO
54e4d81b97 Jean*0084 c     ENDIF
12983a4149 Jean*0085 #endif /* ALLOW_AIM_CO2 */
                0086 
                0087 #endif /* ALLOW_AIM */
                0088 
                0089       RETURN
                0090       END