1 |
C $Header: $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "PACKAGES_CONFIG.h" |
5 |
#include "CPP_OPTIONS.h" |
6 |
|
7 |
CBOP |
8 |
C !ROUTINE: CPL_READPARMS |
9 |
C !INTERFACE: |
10 |
SUBROUTINE CPL_READPARMS( myThid ) |
11 |
|
12 |
C !DESCRIPTION: \bv |
13 |
C *==========================================================* |
14 |
C | S/R CPL_READPARMS |
15 |
C | o Read Coupling parameters that control import/export |
16 |
C | from/to the coupler layer |
17 |
C *==========================================================* |
18 |
C | this version is specific to 1 component (ocean) |
19 |
C *==========================================================* |
20 |
C \ev |
21 |
|
22 |
C !USES: |
23 |
IMPLICIT NONE |
24 |
|
25 |
C == Global variables === |
26 |
|
27 |
#include "SIZE.h" |
28 |
|
29 |
#include "EEPARAMS.h" |
30 |
#include "PARAMS.h" |
31 |
#include "CPL_PARAMS.h" |
32 |
|
33 |
C !INPUT/OUTPUT PARAMETERS: |
34 |
C == Routine Arguments == |
35 |
C myThid - Number of this instance |
36 |
INTEGER myThid |
37 |
CEOP |
38 |
|
39 |
#ifdef COMPONENT_MODULE |
40 |
|
41 |
C Functions |
42 |
INTEGER ILNBLNK |
43 |
|
44 |
C == Local Variables == |
45 |
C msgBuf :: Informational/error meesage buffer |
46 |
C iUnit :: Work variable for IO unit number |
47 |
C k :: loop counter |
48 |
C iL :: Work variable for length of file-name |
49 |
CHARACTER*(MAX_LEN_MBUF) msgBuf |
50 |
INTEGER iUnit, k, iL |
51 |
|
52 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
53 |
|
54 |
C-- Coupling parameters: |
55 |
C useImportHFlx :: True => use the Imported HeatFlux from couler |
56 |
C useImportFW :: True => use the Imported Fresh Water flux fr cpl |
57 |
C useImportTau :: True => use the Imported Wind-Stress from couler |
58 |
C cpl_taveFreq :: Frequency^-1 for time-Aver. output (s) |
59 |
NAMELIST /CPL_OCN_PARAM/ |
60 |
& useImportHFlx, useImportFW, useImportTau, |
61 |
& cpl_taveFreq |
62 |
|
63 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
64 |
|
65 |
C- Set default value: |
66 |
useImportHFlx = .TRUE. |
67 |
useImportFW = .TRUE. |
68 |
useImportTau = .TRUE. |
69 |
cpl_taveFreq = taveFreq |
70 |
|
71 |
_BEGIN_MASTER(myThid) |
72 |
|
73 |
WRITE(msgBuf,'(A)') ' CPL_READPARMS: opening data.cpl' |
74 |
CALL PRINT_MESSAGE(msgBuf,standardMessageUnit,SQUEEZE_RIGHT,1) |
75 |
|
76 |
CALL OPEN_COPY_DATA_FILE( 'data.cpl', 'CPL_READPARMS', |
77 |
O iUnit, myThid ) |
78 |
|
79 |
C-- Read parameters from open data file: |
80 |
|
81 |
C- Parameters for coupling interface: |
82 |
READ(UNIT=iUnit,NML=CPL_OCN_PARAM) |
83 |
|
84 |
WRITE(msgBuf,'(A)') |
85 |
& ' CPL_READPARMS: finished reading data.cpl' |
86 |
CALL PRINT_MESSAGE(msgBuf,standardMessageUnit,SQUEEZE_RIGHT,1) |
87 |
|
88 |
C-- Close the open data file |
89 |
CLOSE(iUnit) |
90 |
|
91 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
92 |
C-- Check parameters and model configuration |
93 |
|
94 |
C- If land_taveFreq is positive, then must compile the land-diagnostics code |
95 |
#ifndef ALLOW_TIMEAVE |
96 |
IF (cpl_taveFreq.GT.0.) THEN |
97 |
WRITE(msgBuf,'(A)') |
98 |
& 'CPL_READPARMS: cpl_taveFreq > 0 but ALLOW_TIMEAVE undefined' |
99 |
CALL PRINT_ERROR( msgBuf, myThid) |
100 |
WRITE(msgBuf,'(2A)') |
101 |
& 'Re-compile with: #define ALLOW_TIMEAVE', |
102 |
& ' or -DALLOW_TIMEAVE' |
103 |
CALL PRINT_ERROR( msgBuf, myThid) |
104 |
STOP 'ABNORMAL END: S/R CPL_READPARMS' |
105 |
ENDIF |
106 |
#endif /* ALLOW_TIMEAVE */ |
107 |
|
108 |
C- derive other parameters: |
109 |
|
110 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
111 |
C-- Print out parameter values : |
112 |
|
113 |
iUnit = standardMessageUnit |
114 |
WRITE(msgBuf,'(A)') ' ' |
115 |
CALL PRINT_MESSAGE(msgBuf,iUnit,SQUEEZE_RIGHT,1) |
116 |
WRITE(msgBuf,'(A)') '// ===================================' |
117 |
CALL PRINT_MESSAGE(msgBuf,iUnit,SQUEEZE_RIGHT,1) |
118 |
WRITE(msgBuf,'(A)') '// Coupling package parameters :' |
119 |
CALL PRINT_MESSAGE(msgBuf,iUnit,SQUEEZE_RIGHT,1) |
120 |
WRITE(msgBuf,'(A)') '// ===================================' |
121 |
CALL PRINT_MESSAGE(msgBuf,iUnit,SQUEEZE_RIGHT,1) |
122 |
|
123 |
C- namelist LAND_MODEL_PAR: |
124 |
CALL WRITE_0D_L( useImportHFlx, INDEX_NONE, |
125 |
& 'useImportHFlx=', |
126 |
& ' /* use Imported Heat-Flx fr Coupler on/off flag */') |
127 |
CALL WRITE_0D_L( useImportFW , INDEX_NONE, |
128 |
& 'useImportFW =', |
129 |
& ' /* use Imported Fresh-Water fr Cpl. on/off flag */') |
130 |
CALL WRITE_0D_L( useImportTau , INDEX_NONE, |
131 |
& 'useImportTau =', |
132 |
& ' /* use Imported Wind-Stress fr Cpl. on/off flag */') |
133 |
CALL WRITE_0D_R8( cpl_taveFreq, INDEX_NONE, 'cpl_taveFreq =', |
134 |
& ' /* Frequency^-1 for time-Aver. output (s) */') |
135 |
|
136 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
137 |
|
138 |
_END_MASTER(myThid) |
139 |
|
140 |
C-- Everyone else must wait for the parameters to be loaded |
141 |
_BARRIER |
142 |
|
143 |
#endif /* COMPONENT_MODULE */ |
144 |
|
145 |
RETURN |
146 |
END |