1 |
C $Header: /u/gcmpack/MITgcm/pkg/cost/cost_readparms.F,v 1.15 2012/08/10 14:43:57 gforget Exp $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "COST_OPTIONS.h" |
5 |
|
6 |
subroutine cost_readparms( mythid ) |
7 |
|
8 |
c ================================================================== |
9 |
c SUBROUTINE cost_readparms |
10 |
c ================================================================== |
11 |
c |
12 |
c o This routine initialises the package cost. |
13 |
c |
14 |
c started: Ralf Giering 18-Jan-2001 |
15 |
c |
16 |
c ================================================================== |
17 |
c SUBROUTINE cost_readparms |
18 |
c ================================================================== |
19 |
|
20 |
implicit none |
21 |
|
22 |
c == global variables == |
23 |
|
24 |
#include "EEPARAMS.h" |
25 |
#include "SIZE.h" |
26 |
#include "GRID.h" |
27 |
#include "PARAMS.h" |
28 |
|
29 |
#include "cost.h" |
30 |
|
31 |
c == routine arguments == |
32 |
integer mythid |
33 |
|
34 |
c == local variables == |
35 |
character*(max_len_mbuf) msgbuf |
36 |
integer iUnit |
37 |
|
38 |
c == end of interface == |
39 |
|
40 |
c-- Read the namelist input. |
41 |
namelist /cost_nml/ |
42 |
& mult_atl, mult_test, mult_tracer |
43 |
& , multTheta, multSalt, multUvel, multVvel, multEtan |
44 |
#ifdef ALLOW_COST_TRANSPORT |
45 |
& , mult_transport |
46 |
#endif |
47 |
#ifdef ALLOW_COST_DEPTH |
48 |
& , mult_depth |
49 |
#endif |
50 |
& , lastinterval |
51 |
cHFLUXM_CONTROL |
52 |
& , mult_temp_tut, mult_hflux_tut |
53 |
cHFLUXM_CONTROL |
54 |
|
55 |
_BEGIN_MASTER( myThid ) |
56 |
|
57 |
c-- Set default values. |
58 |
mult_atl = 0. _d 0 |
59 |
mult_test = 0. _d 0 |
60 |
mult_tracer = 0. _d 0 |
61 |
multTheta = 0. _d 0 |
62 |
multSalt = 0. _d 0 |
63 |
multUvel = 0. _d 0 |
64 |
multVvel = 0. _d 0 |
65 |
multEtan = 0. _d 0 |
66 |
#ifdef ALLOW_COST_TRANSPORT |
67 |
mult_transport = 0. _d 0 |
68 |
#endif |
69 |
#ifdef ALLOW_COST_DEPTH |
70 |
mult_depth = 0. _d 0 |
71 |
#endif |
72 |
cHFLUXM_CONTROL |
73 |
mult_temp_tut = 0. _d 0 |
74 |
mult_hflux_tut = 0. _d 0 |
75 |
cHFLUXM_CONTROL |
76 |
|
77 |
c-- 30*24*3600 = 2592000 = 1 model month |
78 |
lastinterval = 2592000. |
79 |
|
80 |
c-- Next, read the cost data file. |
81 |
WRITE(msgBuf,'(A)') 'COST_READPARMS: opening data.cost' |
82 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
83 |
& SQUEEZE_RIGHT , 1) |
84 |
|
85 |
CALL OPEN_COPY_DATA_FILE( |
86 |
I 'data.cost', 'COST_READPARMS', |
87 |
O iUnit, |
88 |
I myThid ) |
89 |
|
90 |
READ( iUnit, nml = cost_nml ) |
91 |
|
92 |
WRITE(msgBuf,'(A)') 'COST_READPARMS: finished reading data.cost' |
93 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
94 |
& SQUEEZE_RIGHT , 1) |
95 |
|
96 |
CLOSE( iUnit ) |
97 |
|
98 |
IF ( MOD(lastinterval,deltaTclock) .GT. 0. ) |
99 |
& lastinterval = MAX( |
100 |
& INT(lastinterval/deltaTclock-1)*deltaTclock,deltaTclock) |
101 |
|
102 |
#if (defined ALLOW_COST_HFLUXM) || (defined ALLOW_COST_TEMP) |
103 |
c-- get the weights for the cost functions |
104 |
CALL COST_WEIGHTS( myThid ) |
105 |
cgf : to compile previous line user is expected to provide cost_weights.F |
106 |
#endif |
107 |
_END_MASTER( mythid ) |
108 |
|
109 |
_BARRIER |
110 |
|
111 |
end |