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