Back to home page

MITgcm

 
 

    


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

view on githubraw file Latest commit add29e06 on 2018-01-31 20:35:05 UTC
b93274141a Jean*0001 #include "ATM_CPL_OPTIONS.h"
f533a5790a Jean*0002 
                0003 CBOP
                0004 C     !ROUTINE: CPL_EXPORT_IMPORT_DATA
                0005 C     !INTERFACE:
                0006       SUBROUTINE CPL_EXPORT_IMPORT_DATA(
                0007      I                      myTime, myIter, myThid )
                0008 
                0009 C     !DESCRIPTION: \bv
                0010 C     *==========================================================*
                0011 C     | SUBROUTINE CPL_EXPORT_IMPORT_DATA
                0012 C     | o Routine for controlling
                0013 C     |   - export of coupling data to coupler layer AND
                0014 C     |   - import of coupling data from coupler layer.
                0015 C     *==========================================================*
                0016 C     | This version talks to the MIT Coupler. It uses the MIT
                0017 C     | Coupler "checkpoint1" library calls.
                0018 C     *==========================================================*
                0019 C     \ev
                0020 
                0021 C     !USES:
                0022       IMPLICIT NONE
                0023 
                0024 C     == Global variables ==
                0025 #include "SIZE.h"
                0026 #include "EEPARAMS.h"
1b0deb48dc Jean*0027 #include "PARAMS.h"
f533a5790a Jean*0028 #include "CPL_PARAMS.h"
                0029 
                0030 C     !INPUT/OUTPUT PARAMETERS:
                0031 C     == Routine arguments ==
                0032 C     myTime  :: Current time in simulation.
                0033 C     myIter  :: Current timestep number.
                0034 C     myThid  :: Thread number for this instance of the routine.
                0035       _RL     myTime
                0036       INTEGER myIter
                0037       INTEGER myThid
                0038 CEOP
                0039 
                0040 #ifdef COMPONENT_MODULE
                0041 C     !LOCAL VARIABLES:
                0042 C     == Local variables ==
1b0deb48dc Jean*0043 C     bi, bj  :: Tile indices
f533a5790a Jean*0044 C     msgBuf  :: Informational/error message buffer
1b0deb48dc Jean*0045       INTEGER bi, bj
f533a5790a Jean*0046       CHARACTER*(MAX_LEN_MBUF) msgBuf
                0047 
                0048 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
b93274141a Jean*0049 C     Note MIT Coupler checkpoint1 does not allow asynchronous posting of
                0050 C     data, so ordering has to be consistent with coupling layer ordering.
                0051 C--------------------------------------------------------------------------
b7bbcb5032 Jean*0052 C-    Send data to coupling layer
f533a5790a Jean*0053 
                0054       IF ( MOD(myIter,cplSendFrq_iter).EQ.0 ) THEN
                0055        _BEGIN_MASTER( myThid )
                0056         IF ( debugMode .OR. countPrtExp.LT.maxNumberPrint ) THEN
                0057          WRITE(msgBuf,'(A,I10)')
b93274141a Jean*0058      &    '  Exporting atmospheric surf fluxes at iter=', myIter
f533a5790a Jean*0059          CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
                0060      &                       SQUEEZE_RIGHT, myThid )
                0061          countPrtExp = countPrtExp + 1
                0062         ENDIF
                0063        _END_MASTER( myThid )
                0064 
b7bbcb5032 Jean*0065 C-    Store state variables (without averaging over cplSendFrq_iter time-steps)
1b0deb48dc Jean*0066         DO bj=myByLo(myThid),myByHi(myThid)
                0067          DO bi=myBxLo(myThid),myBxHi(myThid)
ece6c362bf Jean*0068            CALL ATM_STORE_DYNVARS( bi, bj, myTime, myIter, myThid )
1b0deb48dc Jean*0069            IF ( useThSIce ) THEN
                0070             CALL ATM_STORE_THSICE( bi, bj, myTime, myIter, myThid )
                0071            ENDIF
                0072          ENDDO
                0073         ENDDO
                0074 
b7bbcb5032 Jean*0075 C-    Send data to coupler
                0076         CALL ATM_EXPORT_FIELDS( myIter, myThid )
f533a5790a Jean*0077 
                0078       ENDIF
                0079 
                0080 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
b7bbcb5032 Jean*0081 C-    Fetch data from coupling layer.
f533a5790a Jean*0082 
                0083       IF ( MOD(myIter,cplSendFrq_iter).EQ.0 ) THEN
                0084        _BEGIN_MASTER( myThid )
                0085         IF ( debugMode .OR. countPrtImp.LT.maxNumberPrint ) THEN
                0086          WRITE(msgBuf,'(A,I10)')
b93274141a Jean*0087      &    '  Importing  oceanic surface fields at iter=', myIter
f533a5790a Jean*0088          CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
                0089      &                       SQUEEZE_RIGHT, myThid )
                0090          countPrtImp = countPrtImp + 1
                0091         ENDIF
                0092        _END_MASTER( myThid )
                0093 
b7bbcb5032 Jean*0094         CALL ATM_IMPORT_FIELDS( myIter, myThid )
f533a5790a Jean*0095 
2ae8858ffc Jean*0096 C     Fill diagnostics with updated coupling fields just received from Coupler
                0097         CALL CPL_DIAGNOSTICS_FILL( myTime, myIter, myThid )
                0098 
f533a5790a Jean*0099       ENDIF
                0100 
                0101 #endif /* COMPONENT_MODULE */
                0102 
                0103       RETURN
                0104       END