1 |
edhill |
1.5 |
C |
2 |
heimbach |
1.7 |
C $Header: /u/gcmpack/MITgcm/pkg/ctrl/ctrl_set_fname.F,v 1.6 2003/10/30 19:09:05 heimbach Exp $ |
3 |
heimbach |
1.6 |
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 |
|
|
#include "ctrl.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 |
heimbach |
1.6 |
character*( 80) fname(2) |
39 |
heimbach |
1.2 |
integer mythid |
40 |
|
|
|
41 |
|
|
c == local variables == |
42 |
|
|
|
43 |
|
|
#ifndef ALLOW_ECCO_OPTIMIZATION |
44 |
|
|
integer optimcycle |
45 |
|
|
#endif |
46 |
|
|
|
47 |
|
|
integer ii |
48 |
|
|
integer il |
49 |
|
|
|
50 |
|
|
c == external == |
51 |
|
|
|
52 |
|
|
integer ilnblnk |
53 |
|
|
external ilnblnk |
54 |
|
|
|
55 |
|
|
c == end of interface == |
56 |
|
|
|
57 |
|
|
#ifndef ALLOW_ECCO_OPTIMIZATION |
58 |
|
|
optimcycle = 0 |
59 |
|
|
#endif |
60 |
|
|
|
61 |
|
|
c-- Only the master thread will do I/O. |
62 |
|
|
_BEGIN_MASTER( mythid ) |
63 |
|
|
|
64 |
|
|
il=ilnblnk( xx_fname ) |
65 |
|
|
|
66 |
heimbach |
1.6 |
write(fname(1)(1:80),'(80a)') ' ' |
67 |
|
|
write(fname(2)(1:80),'(80a)') ' ' |
68 |
heimbach |
1.2 |
|
69 |
heimbach |
1.3 |
if ( il .GT. 0 .AND. il .LE. 80 ) then |
70 |
heimbach |
1.6 |
write(fname(1)(1:80),'(2a,i10.10)') |
71 |
heimbach |
1.3 |
& xx_fname(1:il) ,'.', optimcycle |
72 |
heimbach |
1.6 |
write(fname(2)(1:80),'(3a,i10.10)') |
73 |
heimbach |
1.3 |
& yadprefix, xx_fname(1:il), '.', optimcycle |
74 |
|
|
endif |
75 |
heimbach |
1.2 |
|
76 |
|
|
_END_MASTER( mythid ) |
77 |
|
|
|
78 |
|
|
end |