2 |
C $Header$ |
C $Header$ |
3 |
C $Name$ |
C $Name$ |
4 |
|
|
5 |
|
#include "PACKAGES_CONFIG.h" |
6 |
#include "CTRL_CPPOPTIONS.h" |
#include "CTRL_CPPOPTIONS.h" |
7 |
|
|
8 |
subroutine ctrl_pack( first, mythid ) |
subroutine ctrl_pack( first, mythid ) |
27 |
c G. Gebbie, added open boundary control packing, |
c G. Gebbie, added open boundary control packing, |
28 |
c gebbie@mit.edu 18 -Mar- 2003 |
c gebbie@mit.edu 18 -Mar- 2003 |
29 |
c |
c |
30 |
c heimbach@mit.edu totally restrucured 28-Oct-2003 |
c heimbach@mit.edu totally restructured 28-Oct-2003 |
31 |
c |
c |
32 |
c ================================================================== |
c ================================================================== |
33 |
c SUBROUTINE ctrl_pack |
c SUBROUTINE ctrl_pack |
42 |
#include "PARAMS.h" |
#include "PARAMS.h" |
43 |
#include "GRID.h" |
#include "GRID.h" |
44 |
|
|
|
#include "ecco.h" |
|
45 |
#include "ctrl.h" |
#include "ctrl.h" |
46 |
#include "cost.h" |
#include "cost.h" |
47 |
|
|
48 |
|
#ifdef ALLOW_ECCO |
49 |
|
# include "ecco_cost.h" |
50 |
|
#else |
51 |
|
# include "ctrl_weights.h" |
52 |
|
#endif |
53 |
|
|
54 |
#ifdef ALLOW_ECCO_OPTIMIZATION |
#ifdef ALLOW_ECCO_OPTIMIZATION |
55 |
#include "optim.h" |
# include "optim.h" |
56 |
#endif |
#endif |
57 |
|
|
58 |
c == routine arguments == |
c == routine arguments == |
137 |
c-- Only the master thread will do I/O. |
c-- Only the master thread will do I/O. |
138 |
_BEGIN_MASTER( mythid ) |
_BEGIN_MASTER( mythid ) |
139 |
|
|
|
print *, 'ph-pack in pack ' |
|
140 |
if ( first .AND. optimcycle .EQ. 0 ) then |
if ( first .AND. optimcycle .EQ. 0 ) then |
141 |
c >>> Initialise control vector for optimcycle=0 <<< |
c >>> Initialise control vector for optimcycle=0 <<< |
|
print *, 'ph-pack in ctrl ' |
|
142 |
lxxadxx = .TRUE. |
lxxadxx = .TRUE. |
143 |
ictrlgrad = 1 |
ictrlgrad = 1 |
144 |
fcloc = fmin |
fcloc = fmin |
146 |
& ctrlname(1:9),'_',yctrlid(1:10),'.opt', optimcycle |
& ctrlname(1:9),'_',yctrlid(1:10),'.opt', optimcycle |
147 |
else |
else |
148 |
c >>> Write gradient vector <<< |
c >>> Write gradient vector <<< |
|
print *, 'ph-pack in cost ' |
|
149 |
lxxadxx = .FALSE. |
lxxadxx = .FALSE. |
150 |
ictrlgrad = 2 |
ictrlgrad = 2 |
151 |
fcloc = fc |
fcloc = fc |
153 |
& costname(1:9),'_',yctrlid(1:10),'.opt', optimcycle |
& costname(1:9),'_',yctrlid(1:10),'.opt', optimcycle |
154 |
endif |
endif |
155 |
|
|
|
print *, 'ph-pack vor open ', optimcycle, cfile |
|
156 |
call mdsfindunit( cunit, mythid ) |
call mdsfindunit( cunit, mythid ) |
157 |
open( cunit, file = cfile, |
open( cunit, file = cfile, |
158 |
& status = 'unknown', |
& status = 'unknown', |