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
31ebb84b18 Jean*0001 #include "OCN_CPL_OPTIONS.h"
                0002 
                0003 CBOP 0
                0004 C !ROUTINE: CPL_IMPORT_CPLPARMS
                0005 
                0006 C !INTERFACE:
                0007       SUBROUTINE CPL_IMPORT_CPLPARMS( myThid )
                0008 
                0009 C !DESCRIPTION:
                0010 C     *==========================================================*
                0011 C     | SUBROUTINE CPL_IMPORT_CPLPARMS
                0012 C     | o Routine for importing coupling parameters
                0013 C     |   from/to the coupler layer
                0014 C     *==========================================================*
                0015 C     |   this version is specific to 1 component (ocean)
                0016 C     *==========================================================*
                0017 
                0018 C !USES:
                0019       IMPLICIT NONE
                0020 C     == Global variables ==
                0021 #include "SIZE.h"
                0022 #include "EEPARAMS.h"
                0023 #include "CPL_PARAMS.h"
                0024 #include "OCNIDS.h"
                0025 
                0026 C !INPUT/OUTPUT PARAMETERS:
                0027 C     == Routine arguments ==
                0028 C     myThid   :: Thread number for this instance of the routine
                0029       INTEGER myThid
                0030 CEOP
                0031 
                0032 C !LOCAL VARIABLES:
                0033 C     == Local variables ==
                0034 C     i        :: Loop counter
                0035 C     parBuf   :: local buffer to receive coupler-params
                0036 C     msgBuf   :: Informational/error message buffer
                0037       INTEGER i
                0038       INTEGER parBuf(ocnParSize)
                0039       CHARACTER*(MAX_LEN_MBUF) msgBuf
                0040 
                0041       _BARRIER
                0042       _BEGIN_MASTER( myThid )
                0043 
                0044 C--   Initialise error counter:
                0045       cplErrorCount = 0
                0046 
                0047 C-    Initialise buffer
                0048       DO i=1,ocnParSize
                0049         parBuf(i) = 0
                0050       ENDDO
                0051 
                0052 C-    Receive coupler configuration info.
                0053 
                0054 C     o Import coupling exchange-field selectors (coupler params)
                0055       CALL COMPRECV_I4VEC(
                0056      I              ocnCplParamsName, ocnParSize,
                0057      O              parBuf )
                0058 
                0059 C-dBug:
                0060       WRITE(standardMessageUnit,'(A,10I6)')
                0061      & ' CPL_IMPORT_CPLPARMS: Recv parBuf=', (parBuf(i),i=1,ocnParSize)
                0062 C-dBug:
                0063 
                0064 C-    o Set options for coupling exchange
                0065       IF ( ocnParSize.EQ.6 ) THEN
                0066         ocn_cplSequential  = parBuf(1).EQ.1
                0067         ocn_cplExch_RunOff = MOD(parBuf(2),2).EQ.1
                0068         ocn_cplExch1W_sIce = MOD(parBuf(3),2).EQ.1
                0069         ocn_cplExch2W_sIce = MOD(parBuf(4),2).EQ.1
                0070         ocn_cplExch_SaltPl = MOD(parBuf(5),2).EQ.1
                0071         ocn_cplExch_DIC    = MOD(parBuf(6),2).EQ.1
d06ba90ed2 Jean*0072 C-    save coupler parameter:
                0073         cpl_exchange_RunOff = parBuf(2)
                0074         cpl_exchange1W_sIce = parBuf(3)
                0075         cpl_exchange2W_sIce = parBuf(4)
                0076         cpl_exchange_SaltPl = parBuf(5)
                0077         cpl_exchange_DIC    = parBuf(6)
31ebb84b18 Jean*0078       ELSE
                0079 C-    If not using an up-to-date OCNIDS.h with the wrong ocnParSize
                0080         cplErrorCount = cplErrorCount + 1
                0081         WRITE(msgBuf,'(2A,I4,A)') 'CPL_IMPORT_CPLPARMS: ',
                0082      &       'ocnParSize=', ocnParSize, ' is wrong (expect 6)'
                0083         CALL PRINT_ERROR( msgBuf, myThid )
                0084         WRITE(msgBuf,'(2A,I4,A)') 'CPL_IMPORT_CPLPARMS: ',
                0085      &       '==> set ErrorCount=', cplErrorCount, ' (Fatal)'
                0086         CALL PRINT_ERROR( msgBuf, myThid )
                0087       ENDIF
                0088 
                0089       _END_MASTER( myThid )
                0090       _BARRIER
                0091 
                0092       RETURN
                0093       END