1 |
#include "CTRL_CPPOPTIONS.h" |
2 |
|
3 |
|
4 |
subroutine ctrl_set_fname( |
5 |
I xx_fname,fname, adfname, mythid ) |
6 |
|
7 |
c ================================================================== |
8 |
c SUBROUTINE ctrl_set_fname |
9 |
c ================================================================== |
10 |
c |
11 |
c o get filename for control variable and adjoint thereof |
12 |
c o initialise adjoint field |
13 |
c |
14 |
c started: heimbach@mit.edu, 16-Aug-2001 |
15 |
c |
16 |
c ================================================================== |
17 |
|
18 |
implicit none |
19 |
|
20 |
c == global variables == |
21 |
|
22 |
#include "EEPARAMS.h" |
23 |
#include "SIZE.h" |
24 |
#include "PARAMS.h" |
25 |
#include "GRID.h" |
26 |
|
27 |
#include "ecco.h" |
28 |
#include "ctrl.h" |
29 |
#include "cost.h" |
30 |
|
31 |
#ifdef ALLOW_ECCO_OPTIMIZATION |
32 |
#include "optim.h" |
33 |
#endif |
34 |
|
35 |
c == routine arguments == |
36 |
|
37 |
character*(MAX_LEN_FNAM) xx_fname |
38 |
character*( 80) fname |
39 |
character*( 80) adfname |
40 |
integer mythid |
41 |
|
42 |
c == local variables == |
43 |
|
44 |
#ifndef ALLOW_ECCO_OPTIMIZATION |
45 |
integer optimcycle |
46 |
#endif |
47 |
|
48 |
integer ii |
49 |
integer il |
50 |
|
51 |
c == external == |
52 |
|
53 |
integer ilnblnk |
54 |
external ilnblnk |
55 |
|
56 |
c == end of interface == |
57 |
|
58 |
#ifndef ALLOW_ECCO_OPTIMIZATION |
59 |
optimcycle = 0 |
60 |
#endif |
61 |
|
62 |
c-- Only the master thread will do I/O. |
63 |
_BEGIN_MASTER( mythid ) |
64 |
|
65 |
il=ilnblnk( xx_fname ) |
66 |
|
67 |
write( fname(1:80),'(80a)') ' ' |
68 |
write(adfname(1:80),'(80a)') ' ' |
69 |
|
70 |
if ( il .GT. 0 .AND. il .LE. 80 ) then |
71 |
write(fname(1:80),'(2a,i10.10)') |
72 |
& xx_fname(1:il) ,'.', optimcycle |
73 |
write(adfname(1:80),'(3a,i10.10)') |
74 |
& yadprefix, xx_fname(1:il), '.', optimcycle |
75 |
endif |
76 |
|
77 |
_END_MASTER( mythid ) |
78 |
|
79 |
end |