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
6bfee994e4 Jean*0001 #include "OCN_CPL_OPTIONS.h"
69e21e3ef0 Jean*0002 
242e706d69 Jean*0003 CBOP
f533a5790a Jean*0004 C     !ROUTINE: CPL_EXPORT_IMPORT_DATA
                0005 
242e706d69 Jean*0006 C     !INTERFACE:
f533a5790a Jean*0007       SUBROUTINE CPL_EXPORT_IMPORT_DATA(
242e706d69 Jean*0008      I                      myTime, myIter, myThid )
                0009 
                0010 C     !DESCRIPTION: \bv
                0011 C     *==========================================================*
f533a5790a Jean*0012 C     | SUBROUTINE CPL_EXPORT_IMPORT_DATA
                0013 C     | o Routine for controlling
                0014 C     |   - export of coupling data to coupler layer AND
                0015 C     |   - import of coupling data from coupler layer.
242e706d69 Jean*0016 C     *==========================================================*
                0017 C     | This version talks to the MIT Coupler. It uses the MIT
                0018 C     | Coupler "checkpoint1" library calls.
                0019 C     *==========================================================*
                0020 C     \ev
                0021 
                0022 C     !USES
69e21e3ef0 Jean*0023       IMPLICIT NONE
f533a5790a Jean*0024 C     == GLobal variables ==
69e21e3ef0 Jean*0025 #include "SIZE.h"
                0026 #include "EEPARAMS.h"
                0027 #include "PARAMS.h"
963aacc62a Jean*0028 #include "CPL_PARAMS.h"
69e21e3ef0 Jean*0029 
242e706d69 Jean*0030 C     !INPUT/OUTPUT PARAMETERS:
69e21e3ef0 Jean*0031 C     == Routine arguments ==
242e706d69 Jean*0032 C     myTime  :: Current time in simulation.
                0033 C     myIter  :: Current timestep number.
                0034 C     myThid  :: Thread number for this instance of the routine.
e596558d31 Jean*0035       _RL     myTime
242e706d69 Jean*0036       INTEGER myIter
69e21e3ef0 Jean*0037       INTEGER myThid
242e706d69 Jean*0038 CEOP
69e21e3ef0 Jean*0039 
242e706d69 Jean*0040 #ifdef COMPONENT_MODULE
                0041 C     !LOCAL VARIABLES:
6bfee994e4 Jean*0042 C     msgBuf  :: Informational/error message buffer
                0043       CHARACTER*(MAX_LEN_MBUF) msgBuf
69e21e3ef0 Jean*0044 
f533a5790a Jean*0045 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
6bfee994e4 Jean*0046 C     Note MIT Coupler checkpoint1 does not allow asynchronous posting of
                0047 C     data, so ordering has to be consistent with coupling layer ordering.
                0048 C--------------------------------------------------------------------------
7eca977925 Jean*0049 C     Synchronous coupling: Send data to coupling layer
6bfee994e4 Jean*0050 
7eca977925 Jean*0051       IF ( .NOT.ocn_cplSequential ) THEN
6bfee994e4 Jean*0052         IF ( debugMode ) THEN
                0053          _BEGIN_MASTER( myThid )
                0054          WRITE(msgBuf,'(A,I10)')
                0055      &    '  Exporting  oceanic surface fields at iter=', myIter
                0056          CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
                0057      &                       SQUEEZE_RIGHT, myThid )
                0058          _END_MASTER( myThid )
                0059         ENDIF
f533a5790a Jean*0060 
                0061         CALL OCN_STORE_MY_DATA(
                0062      I           myTime, myIter, myThid )
                0063 
4e3940889d Jean*0064         CALL OCN_EXPORT_FIELDS ( myIter, myThid )
f533a5790a Jean*0065 
6bfee994e4 Jean*0066       ENDIF
                0067 
f533a5790a Jean*0068 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
6bfee994e4 Jean*0069 C-    Fetch data from coupling layer.
                0070 
                0071       IF ( .TRUE. ) THEN
                0072         IF ( debugMode ) THEN
                0073          _BEGIN_MASTER( myThid )
                0074          WRITE(msgBuf,'(A,I10)')
                0075      &    '  Importing atmospheric surf fluxes at iter=', myIter
                0076          CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
                0077      &                       SQUEEZE_RIGHT, myThid )
                0078          _END_MASTER( myThid )
                0079         ENDIF
f533a5790a Jean*0080 
4e3940889d Jean*0081         CALL OCN_IMPORT_FIELDS ( myIter, myThid )
                0082 
                0083 C     Fill diagnostics with updated coupling fields just received from Coupler
                0084         CALL CPL_DIAGNOSTICS_FILL( myTime, myIter, myThid )
e596558d31 Jean*0085 
7eca977925 Jean*0086       ENDIF
69e21e3ef0 Jean*0087 
7eca977925 Jean*0088 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
69e21e3ef0 Jean*0089 
7eca977925 Jean*0090 #ifndef ALLOW_THSICE
                0091 C     Sequential coupling: Send data to coupling layer
                0092 C     call also OCN_CPL_DIAGS (to cumulate cpl time-ave) in both cases
                0093 C      (Synchronous or Sequential coupling)
                0094       CALL OCN_EXPORT_DATA( myTime, myIter, myThid )
                0095 #endif /* ndef ALLOW_THSICE */
                0096 
                0097 C     If compiling pkg/thsice, do it later by calling the same S/R
                0098 C     directly from DO_OCEANIC_PHYS, just after SEAICE_MODEL call.
6bfee994e4 Jean*0099 
242e706d69 Jean*0100 #endif /* COMPONENT_MODULE */
                0101 
69e21e3ef0 Jean*0102       RETURN
                0103       END