1 |
C $Header: /u/gcmpack/development/heimbach/ecco_env/pkg/ctrl/optim_init.F,v 1.2 2001/02/02 19:23:35 heimbach Exp $ |
2 |
|
3 |
#include "CTRL_CPPOPTIONS.h" |
4 |
|
5 |
|
6 |
subroutine optim_readparms( |
7 |
I mythid |
8 |
& ) |
9 |
|
10 |
c ================================================================== |
11 |
c SUBROUTINE optim_readparms |
12 |
c ================================================================== |
13 |
c |
14 |
c o Initialise the optimization part of the ECCO release. |
15 |
c |
16 |
c started: Christian Eckert eckert@mit.edu 03-Mar-2000 |
17 |
c |
18 |
c changed: |
19 |
c |
20 |
c ================================================================== |
21 |
c SUBROUTINE optim_readparms |
22 |
c ================================================================== |
23 |
|
24 |
implicit none |
25 |
|
26 |
c == global variables == |
27 |
|
28 |
#include "EEPARAMS.h" |
29 |
|
30 |
#include "optim.h" |
31 |
|
32 |
c == routine arguments == |
33 |
|
34 |
integer mythid |
35 |
|
36 |
c == local variables == |
37 |
|
38 |
integer errio |
39 |
integer il |
40 |
|
41 |
character*(max_len_prec) record |
42 |
|
43 |
c == external == |
44 |
|
45 |
integer ilnblnk |
46 |
external ilnblnk |
47 |
|
48 |
c == end of interface == |
49 |
|
50 |
c-- Optimization parameters. |
51 |
namelist /optim/ |
52 |
& optimcycle, nvars, |
53 |
& nondimcontrol, |
54 |
& numiter, nfunc, fmin, iprint, |
55 |
& epsf, epsx, epsg, |
56 |
& nupdate, eps |
57 |
|
58 |
_BEGIN_MASTER( mythid ) |
59 |
|
60 |
c-- Set default values. |
61 |
optimcycle = 0 |
62 |
nvars = 10 |
63 |
nondimcontrol = .false. |
64 |
numiter = 0 |
65 |
nfunc = 1 |
66 |
fmin = 0.0 _d 0 |
67 |
iprint = 10 |
68 |
epsx = 1.e-6 |
69 |
epsg = 1.e-6 |
70 |
eps = -1.e-6 |
71 |
nupdate = 0 |
72 |
|
73 |
c-- Check versions. |
74 |
|
75 |
open(unit=scrunit1,status='scratch') |
76 |
|
77 |
c-- Next, read the forcing data file. |
78 |
open(unit = modeldataunit,file = 'data.optim', |
79 |
& status = 'old', iostat = errio) |
80 |
if ( errio .lt. 0 ) then |
81 |
stop ' stopped in optim_readparms.' |
82 |
endif |
83 |
|
84 |
do while ( .true. ) |
85 |
read(modeldataunit, fmt='(a)', end=1001) record |
86 |
il = max(ilnblnk(record),1) |
87 |
if ( record(1:1) .ne. commentcharacter ) |
88 |
& write(unit=scrunit1, fmt='(a)') record(:il) |
89 |
enddo |
90 |
1001 continue |
91 |
close( modeldataunit ) |
92 |
|
93 |
rewind( scrunit1 ) |
94 |
read(unit = scrunit1, nml = optim) |
95 |
close( scrunit1 ) |
96 |
|
97 |
_END_MASTER( mythid ) |
98 |
|
99 |
_BARRIER |
100 |
|
101 |
return |
102 |
end |
103 |
|