1 |
C $Header: $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "CPP_OPTIONS.h" |
5 |
|
6 |
CBOP |
7 |
C !ROUTINE: CPL_READPARMS |
8 |
C !INTERFACE: |
9 |
SUBROUTINE CPL_READPARMS( myThid ) |
10 |
|
11 |
C !DESCRIPTION: \bv |
12 |
C *==========================================================* |
13 |
C | S/R CPL_READPARMS |
14 |
C | o Read Coupling parameters that control import/export |
15 |
C | from/to the coupler layer |
16 |
C *==========================================================* |
17 |
C | this version is specific to 1 component (atmos) |
18 |
C *==========================================================* |
19 |
C \ev |
20 |
|
21 |
C !USES: |
22 |
IMPLICIT NONE |
23 |
|
24 |
C == Global variables === |
25 |
|
26 |
#include "SIZE.h" |
27 |
|
28 |
#include "EEPARAMS.h" |
29 |
#include "PARAMS.h" |
30 |
#include "CPL_PARAMS.h" |
31 |
|
32 |
C !INPUT/OUTPUT PARAMETERS: |
33 |
C == Routine Arguments == |
34 |
C myThid - Number of this instance |
35 |
INTEGER myThid |
36 |
CEOP |
37 |
|
38 |
#ifdef COMPONENT_MODULE |
39 |
|
40 |
C Functions |
41 |
INTEGER ILNBLNK |
42 |
|
43 |
C == Local Variables == |
44 |
C msgBuf :: Informational/error meesage buffer |
45 |
C iUnit :: Work variable for IO unit number |
46 |
C k :: loop counter |
47 |
C iL :: Work variable for length of file-name |
48 |
CHARACTER*(MAX_LEN_MBUF) msgBuf |
49 |
INTEGER iUnit, k, iL |
50 |
_RL cpl_atmSendFrq |
51 |
|
52 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
53 |
|
54 |
C-- Coupling parameters: |
55 |
C useImportSST :: True => use the Imported SST from couler |
56 |
C cpl_atmSendFrq :: Frequency^-1 for sending data to coupler (s) |
57 |
NAMELIST /CPL_ATM_PARAM/ |
58 |
& useImportSST, |
59 |
& cpl_atmSendFrq |
60 |
|
61 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
62 |
|
63 |
C- Set default value: |
64 |
useImportSST = .TRUE. |
65 |
cpl_atmSendFrq = deltaTClock |
66 |
|
67 |
_BEGIN_MASTER(myThid) |
68 |
|
69 |
WRITE(msgBuf,'(A)') ' CPL_READPARMS: opening data.cpl' |
70 |
CALL PRINT_MESSAGE(msgBuf,standardMessageUnit,SQUEEZE_RIGHT,1) |
71 |
|
72 |
CALL OPEN_COPY_DATA_FILE( 'data.cpl', 'CPL_READPARMS', |
73 |
O iUnit, myThid ) |
74 |
|
75 |
C-- Read parameters from open data file: |
76 |
|
77 |
C- Parameters for coupling interface: |
78 |
READ(UNIT=iUnit,NML=CPL_ATM_PARAM) |
79 |
|
80 |
WRITE(msgBuf,'(A)') |
81 |
& ' CPL_READPARMS: finished reading data.cpl' |
82 |
CALL PRINT_MESSAGE(msgBuf,standardMessageUnit,SQUEEZE_RIGHT,1) |
83 |
|
84 |
C-- Close the open data file |
85 |
CLOSE(iUnit) |
86 |
|
87 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
88 |
C-- Check parameters and model configuration |
89 |
|
90 |
C- derive other parameters: |
91 |
cplSendFrq_iter = NINT( cpl_atmSendFrq / deltaTClock ) |
92 |
IF ( cplSendFrq_iter .LT. 1) cplSendFrq_iter = 1 |
93 |
|
94 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
95 |
C-- Print out parameter values : |
96 |
|
97 |
iUnit = standardMessageUnit |
98 |
WRITE(msgBuf,'(A)') ' ' |
99 |
CALL PRINT_MESSAGE(msgBuf,iUnit,SQUEEZE_RIGHT,1) |
100 |
WRITE(msgBuf,'(A)') '// ===================================' |
101 |
CALL PRINT_MESSAGE(msgBuf,iUnit,SQUEEZE_RIGHT,1) |
102 |
WRITE(msgBuf,'(A)') '// Coupling package parameters :' |
103 |
CALL PRINT_MESSAGE(msgBuf,iUnit,SQUEEZE_RIGHT,1) |
104 |
WRITE(msgBuf,'(A)') '// ===================================' |
105 |
CALL PRINT_MESSAGE(msgBuf,iUnit,SQUEEZE_RIGHT,1) |
106 |
|
107 |
C- namelist CPL_ATM_PARAM: |
108 |
CALL WRITE_0D_L( useImportSST , INDEX_NONE, |
109 |
& 'useImportSST =', |
110 |
& ' /* use Imported SST from Coupler on/off flag */') |
111 |
CALL WRITE_0D_R8( cpl_atmSendFrq, INDEX_NONE, 'cpl_atmSendFrq =', |
112 |
& ' /* Frequency^o-1 for sending data to Coupler (s) */') |
113 |
C cpl_atmSendFrq :: Frequency^-1 for sending data to coupler (s) |
114 |
CALL WRITE_0D_I( cplSendFrq_iter, INDEX_NONE,'cplSendFrq_iter =', |
115 |
&' /* send data to coupler every "cplSendFrq" iter */') |
116 |
|
117 |
|
118 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
119 |
|
120 |
_END_MASTER(myThid) |
121 |
|
122 |
C-- Everyone else must wait for the parameters to be loaded |
123 |
_BARRIER |
124 |
|
125 |
#endif /* COMPONENT_MODULE */ |
126 |
|
127 |
RETURN |
128 |
END |