1 |
C $Header: /u/gcmpack/MITgcm/pkg/ecco/ecco_readparms.F,v 1.2 2001/07/13 13:42:16 heimbach Exp $ |
2 |
|
3 |
#include "CPP_OPTIONS.h" |
4 |
|
5 |
|
6 |
subroutine ecco_readparms( |
7 |
I mythid |
8 |
& ) |
9 |
|
10 |
c ================================================================== |
11 |
c SUBROUTINE ecco_readparms |
12 |
c ================================================================== |
13 |
c |
14 |
c o Initialize the ECCO release of the MITgcmUV. |
15 |
c |
16 |
c started: Christian Eckert eckert@mit.edu 29-Feb-1999 |
17 |
c |
18 |
c - Introduced to create a package for the MITgcmUV. |
19 |
c |
20 |
c changed: Christian Eckert eckert@mit.edu |
21 |
c |
22 |
c ================================================================== |
23 |
c SUBROUTINE ecco_readparms |
24 |
c ================================================================== |
25 |
|
26 |
implicit none |
27 |
|
28 |
c == global variables == |
29 |
|
30 |
#include "SIZE.h" |
31 |
#include "EEPARAMS.h" |
32 |
#include "PARAMS.h" |
33 |
#include "ecco.h" |
34 |
|
35 |
c == routine arguments == |
36 |
|
37 |
integer mythid |
38 |
|
39 |
c == local variables == |
40 |
|
41 |
integer errio |
42 |
integer il |
43 |
|
44 |
character*(max_len_prec) record |
45 |
|
46 |
c == external == |
47 |
|
48 |
integer ilnblnk |
49 |
external ilnblnk |
50 |
|
51 |
c == end of interface == |
52 |
|
53 |
c-- ECCO parameters. |
54 |
namelist /ECCO_PARMS/ |
55 |
& expId |
56 |
|
57 |
_BEGIN_MASTER( myThid ) |
58 |
open( unit=scrunit1, status='scratch' ) |
59 |
|
60 |
c-- Next, read the ECCO data file. |
61 |
open( unit = modeldataunit, |
62 |
& file = 'data.ecco', |
63 |
& status = 'old', |
64 |
& iostat = errio) |
65 |
|
66 |
if ( errio .lt. 0 ) then |
67 |
stop ' stopped in ecco_readparms.' |
68 |
endif |
69 |
|
70 |
do while ( .true. ) |
71 |
read(modeldataunit, fmt='(a)', end=1001) record |
72 |
il = max(ilnblnk(record),1) |
73 |
if ( record(1:1) .ne. commentcharacter ) |
74 |
& write(unit=scrunit1, fmt='(a)') record(:il) |
75 |
enddo |
76 |
1001 continue |
77 |
close( modeldataunit ) |
78 |
|
79 |
rewind( scrunit1 ) |
80 |
read ( unit = scrunit1, nml = ecco_parms) |
81 |
close ( scrunit1 ) |
82 |
|
83 |
c-------------------------------- ECCO -------------------------------- |
84 |
|
85 |
#ifdef INCLUDE_ECCO_PACKAGE |
86 |
C-- Initialise the ECCO State Estimation package. |
87 |
|
88 |
#ifdef ALLOW_CALENDAR |
89 |
C-- Initialise the calendar package. |
90 |
#ifdef ALLOW_CAL_NENDITER |
91 |
call cal_init( |
92 |
I startTime, |
93 |
I endTime, |
94 |
I deltaTclock, |
95 |
I nIter0, |
96 |
I nEndIter, |
97 |
I nTimeSteps, |
98 |
I myThid |
99 |
& ) |
100 |
#else |
101 |
call cal_init( |
102 |
I startTime, |
103 |
I endTime, |
104 |
I deltaTclock, |
105 |
I nIter0, |
106 |
I nTimeSteps, |
107 |
I myThid |
108 |
& ) |
109 |
#endif |
110 |
_BARRIER |
111 |
#endif |
112 |
|
113 |
C-- Custom routine to set forcing fields. |
114 |
#ifdef INCLUDE_EXTERNAL_FORCING_PACKAGE |
115 |
call exf_readparms ( mythid ) |
116 |
#endif |
117 |
|
118 |
#ifdef ALLOW_ECCO_OPTIMIZATION |
119 |
c-- Initialise the optimization-related parts of the ECCO State |
120 |
c-- Estimation package. |
121 |
call optim_init( myThid ) |
122 |
_BARRIER |
123 |
#else |
124 |
c-- Optimization not enabled. |
125 |
#endif |
126 |
|
127 |
#ifndef ALLOW_ECCO_FORWARD_RUN |
128 |
C-- Initialise the cost function. |
129 |
call cost_readparms( mythid ) |
130 |
call cost_init( myThid ) |
131 |
_BARRIER |
132 |
|
133 |
C-- Initialise the control vector. |
134 |
call ctrl_init( myThid ) |
135 |
_BARRIER |
136 |
#else |
137 |
c not needed for forward run only |
138 |
#endif |
139 |
|
140 |
#ifdef ALLOW_ECCO_DIAGNOSTICS_RUN |
141 |
c-- Initialise the ECCO diagnostics package. |
142 |
call diagnos_init( myThid ) |
143 |
_BARRIER |
144 |
#else |
145 |
c-- Diagnostics not enabled. |
146 |
#endif |
147 |
|
148 |
#endif /* INCLUDE_ECCO_PACKAGE */ |
149 |
|
150 |
c-------------------------------- ECCO -------------------------------- |
151 |
|
152 |
c-- Summarize the setup of the ECCO release. |
153 |
c call ecco_summary( mythid ) |
154 |
_END_MASTER( mythid ) |
155 |
|
156 |
c-- Everyone else must wait for the parameters to be loaded and |
157 |
c-- the setup to be completed. |
158 |
_BARRIER |
159 |
|
160 |
end |