| 1 |
C $Header: /u/gcmpack/MITgcm/pkg/atm_compon_interf/cpl_import_cplparms.F,v 1.1 2015/11/12 01:06:40 jmc Exp $ |
| 2 |
C $Name: $ |
| 3 |
|
| 4 |
#include "ATM_CPL_OPTIONS.h" |
| 5 |
|
| 6 |
CBOP 0 |
| 7 |
C !ROUTINE: CPL_IMPORT_CPLPARMS |
| 8 |
|
| 9 |
C !INTERFACE: |
| 10 |
SUBROUTINE CPL_IMPORT_CPLPARMS( myThid ) |
| 11 |
|
| 12 |
C !DESCRIPTION: |
| 13 |
C *==========================================================* |
| 14 |
C | SUBROUTINE CPL_IMPORT_CPLPARMS |
| 15 |
C | o Routine for importing coupling parameters |
| 16 |
C | from/to the coupler layer |
| 17 |
C *==========================================================* |
| 18 |
C | this version is specific to 1 component (atmos) |
| 19 |
C *==========================================================* |
| 20 |
|
| 21 |
C !USES: |
| 22 |
IMPLICIT NONE |
| 23 |
C == Global variables == |
| 24 |
#include "SIZE.h" |
| 25 |
#include "EEPARAMS.h" |
| 26 |
#include "CPL_PARAMS.h" |
| 27 |
#include "ATMIDS.h" |
| 28 |
|
| 29 |
C !INPUT/OUTPUT PARAMETERS: |
| 30 |
C == Routine arguments == |
| 31 |
C myThid :: Thread number for this instance of the routine |
| 32 |
INTEGER myThid |
| 33 |
CEOP |
| 34 |
|
| 35 |
C !LOCAL VARIABLES: |
| 36 |
C == Local variables == |
| 37 |
C i :: Loop counter |
| 38 |
C parBuf :: local buffer to receive coupler-params |
| 39 |
C msgBuf :: Informational/error message buffer |
| 40 |
INTEGER i |
| 41 |
INTEGER parBuf(atmParSize) |
| 42 |
CHARACTER*(MAX_LEN_MBUF) msgBuf |
| 43 |
|
| 44 |
_BARRIER |
| 45 |
_BEGIN_MASTER( myThid ) |
| 46 |
|
| 47 |
C-- Initialise error counter: |
| 48 |
cplErrorCount = 0 |
| 49 |
|
| 50 |
C- Initialise buffer |
| 51 |
DO i=1,atmParSize |
| 52 |
parBuf(i) = 0 |
| 53 |
ENDDO |
| 54 |
|
| 55 |
C- Receive coupler configuration info. |
| 56 |
|
| 57 |
C o Import coupling exhange-field selectors (coupler params) |
| 58 |
CALL COMPRECV_I4VEC( |
| 59 |
I atmCplParamsName, atmParSize, |
| 60 |
O parBuf ) |
| 61 |
|
| 62 |
C-dBug: |
| 63 |
WRITE(standardMessageUnit,'(A,10I6)') |
| 64 |
& ' CPL_IMPORT_CPLPARMS: Recv parBuf=', (parBuf(i),i=1,atmParSize) |
| 65 |
C-dBug: |
| 66 |
|
| 67 |
C- o Set options for coupling exchange |
| 68 |
IF ( atmParSize.EQ.6 ) THEN |
| 69 |
atm_cplSequential = parBuf(1).EQ.1 |
| 70 |
atm_cplExch_RunOff = parBuf(2).GE.2 |
| 71 |
atm_cplExch1W_sIce = parBuf(3).GE.2 |
| 72 |
atm_cplExch2W_sIce = parBuf(4).GE.2 |
| 73 |
atm_cplExch_SaltPl = parBuf(5).GE.2 |
| 74 |
atm_cplExch_DIC = parBuf(6).GE.2 |
| 75 |
C- save coupler parameter: |
| 76 |
cpl_exchange_RunOff = parBuf(2) |
| 77 |
cpl_exchange1W_sIce = parBuf(3) |
| 78 |
cpl_exchange2W_sIce = parBuf(4) |
| 79 |
cpl_exchange_SaltPl = parBuf(5) |
| 80 |
cpl_exchange_DIC = parBuf(6) |
| 81 |
ELSE |
| 82 |
C- If not using an up-to-date ATMIDS.h with the wrong atmParSize |
| 83 |
cplErrorCount = cplErrorCount + 1 |
| 84 |
WRITE(msgBuf,'(2A,I4,A)') 'CPL_IMPORT_CPLPARMS: ', |
| 85 |
& 'atmParSize=', atmParSize, ' is wrong (expect 6)' |
| 86 |
CALL PRINT_ERROR( msgBuf, myThid ) |
| 87 |
WRITE(msgBuf,'(2A,I4,A)') 'CPL_IMPORT_CPLPARMS: ', |
| 88 |
& '==> set ErrorCount=', cplErrorCount, ' (Fatal)' |
| 89 |
CALL PRINT_ERROR( msgBuf, myThid ) |
| 90 |
ENDIF |
| 91 |
|
| 92 |
_END_MASTER( myThid ) |
| 93 |
_BARRIER |
| 94 |
|
| 95 |
RETURN |
| 96 |
END |