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
1be817fa63 Jean*0001 #include "ATM_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 (atmos)
                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 "ATMIDS.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(atmParSize)
                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,atmParSize
                0049         parBuf(i) = 0
                0050       ENDDO
                0051 
                0052 C-    Receive coupler configuration info.
                0053 
                0054 C     o Import coupling exhange-field selectors (coupler params)
                0055       CALL COMPRECV_I4VEC(
                0056      I              atmCplParamsName, atmParSize,
                0057      O              parBuf )
                0058 
                0059 C-dBug:
                0060       WRITE(standardMessageUnit,'(A,10I6)')
                0061      & ' CPL_IMPORT_CPLPARMS: Recv parBuf=', (parBuf(i),i=1,atmParSize)
                0062 C-dBug:
                0063 
                0064 C-    o Set options for coupling exchange
                0065       IF ( atmParSize.EQ.6 ) THEN
                0066         atm_cplSequential  = parBuf(1).EQ.1
                0067         atm_cplExch_RunOff = parBuf(2).GE.2
                0068         atm_cplExch1W_sIce = parBuf(3).GE.2
                0069         atm_cplExch2W_sIce = parBuf(4).GE.2
                0070         atm_cplExch_SaltPl = parBuf(5).GE.2
                0071         atm_cplExch_DIC    = parBuf(6).GE.2
fa4a0a5486 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)
1be817fa63 Jean*0078       ELSE
                0079 C-    If not using an up-to-date ATMIDS.h with the wrong atmParSize
                0080         cplErrorCount = cplErrorCount + 1
                0081         WRITE(msgBuf,'(2A,I4,A)') 'CPL_IMPORT_CPLPARMS: ',
                0082      &       'atmParSize=', atmParSize, ' 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