1 |
heimbach |
1.1 |
C |
2 |
heimbach |
1.2 |
C $Header: /u/gcmpack/MITgcm/pkg/ctrl/ctrl_init_ctrlvar.F,v 1.1 2003/10/30 19:09:05 heimbach Exp $ |
3 |
heimbach |
1.1 |
C $Name: $ |
4 |
|
|
|
5 |
|
|
#include "CTRL_CPPOPTIONS.h" |
6 |
|
|
|
7 |
|
|
subroutine ctrl_init_ctrlvar( |
8 |
|
|
& xx_fname |
9 |
|
|
& , ivarindex |
10 |
|
|
& , ncvarindex_loc |
11 |
|
|
& , ncvarrecs_loc |
12 |
|
|
& , ncvarrecstart_loc |
13 |
|
|
& , ncvarrecsend_loc |
14 |
|
|
& , ncvarxmax_loc |
15 |
|
|
& , ncvarymax_loc |
16 |
|
|
& , ncvarnrmax_loc |
17 |
|
|
& , ncvargrd_loc |
18 |
|
|
& , whichxyz |
19 |
|
|
& , mythid |
20 |
|
|
& ) |
21 |
|
|
|
22 |
|
|
c ================================================================== |
23 |
|
|
c SUBROUTINE ctrl_init_ctrlvar |
24 |
|
|
c ================================================================== |
25 |
|
|
c |
26 |
|
|
c started: heimbach@mit.edu 28-Oct-2003 |
27 |
|
|
c |
28 |
|
|
c ================================================================== |
29 |
|
|
c SUBROUTINE ctrl_init_ctrlvar |
30 |
|
|
c ================================================================== |
31 |
|
|
|
32 |
|
|
implicit none |
33 |
|
|
|
34 |
|
|
c == global variables == |
35 |
|
|
|
36 |
|
|
#include "EEPARAMS.h" |
37 |
|
|
#include "SIZE.h" |
38 |
|
|
#include "PARAMS.h" |
39 |
|
|
#include "GRID.h" |
40 |
|
|
#include "ctrl.h" |
41 |
|
|
|
42 |
|
|
#ifdef ALLOW_ECCO_OPTIMIZATION |
43 |
|
|
# include "optim.h" |
44 |
|
|
#endif |
45 |
|
|
|
46 |
|
|
c == routine arguments == |
47 |
|
|
character*(MAX_LEN_FNAM) xx_fname |
48 |
|
|
integer ivarindex |
49 |
|
|
integer ncvarindex_loc |
50 |
|
|
integer ncvarrecs_loc |
51 |
|
|
integer ncvarrecstart_loc |
52 |
|
|
integer ncvarrecsend_loc |
53 |
|
|
integer ncvarxmax_loc |
54 |
|
|
integer ncvarymax_loc |
55 |
|
|
integer ncvarnrmax_loc |
56 |
|
|
character ncvargrd_loc*1 |
57 |
|
|
character whichxyz*2 |
58 |
|
|
integer mythid |
59 |
|
|
|
60 |
|
|
c == local variables == |
61 |
|
|
#ifndef ALLOW_ECCO_OPTIMIZATION |
62 |
|
|
integer optimcycle |
63 |
|
|
#endif |
64 |
|
|
character*( 80) fname(2) |
65 |
heimbach |
1.2 |
logical exst |
66 |
heimbach |
1.1 |
|
67 |
|
|
#ifndef ALLOW_ECCO_OPTIMIZATION |
68 |
|
|
optimcycle = 0 |
69 |
|
|
#endif |
70 |
|
|
|
71 |
|
|
_BEGIN_MASTER( mythid ) |
72 |
|
|
|
73 |
|
|
ncvarindex(ivarindex) = ncvarindex_loc |
74 |
|
|
ncvarrecs (ivarindex) = ncvarrecs_loc |
75 |
|
|
ncvarrecstart(ivarindex) = ncvarrecstart_loc |
76 |
|
|
ncvarrecsend(ivarindex) = ncvarrecsend_loc |
77 |
|
|
ncvarxmax (ivarindex) = ncvarxmax_loc |
78 |
|
|
ncvarymax (ivarindex) = ncvarymax_loc |
79 |
|
|
ncvarnrmax(ivarindex) = ncvarnrmax_loc |
80 |
|
|
ncvargrd (ivarindex) = ncvargrd_loc |
81 |
|
|
|
82 |
|
|
call ctrl_set_fname( xx_fname, fname, mythid ) |
83 |
|
|
|
84 |
heimbach |
1.2 |
inquire( file='costfinal', exist=exst ) |
85 |
|
|
IF ( .NOT. exst) THEN |
86 |
|
|
|
87 |
|
|
if ( whichxyz .EQ. '3d') then |
88 |
|
|
call ctrl_set_globfld_xyz( fname(2), ivarindex, mythid) |
89 |
|
|
if (optimcycle .eq. 0) |
90 |
|
|
& call ctrl_set_globfld_xyz( fname(1), ivarindex, mythid) |
91 |
|
|
else if ( whichxyz .EQ. 'xy') then |
92 |
|
|
call ctrl_set_globfld_xy( fname(2), ivarindex, mythid) |
93 |
|
|
if (optimcycle .eq. 0) |
94 |
|
|
& call ctrl_set_globfld_xy( fname(1), ivarindex, mythid ) |
95 |
|
|
else if ( whichxyz .EQ. 'xz') then |
96 |
|
|
call ctrl_set_globfld_xz( fname(2), ivarindex, mythid) |
97 |
|
|
if (optimcycle .eq. 0) |
98 |
|
|
& call ctrl_set_globfld_xz( fname(1), ivarindex, mythid ) |
99 |
|
|
else if ( whichxyz .EQ. 'yz') then |
100 |
|
|
call ctrl_set_globfld_yz( fname(2), ivarindex, mythid) |
101 |
|
|
if (optimcycle .eq. 0) |
102 |
|
|
& call ctrl_set_globfld_yz( fname(1), ivarindex, mythid ) |
103 |
|
|
else |
104 |
|
|
STOP 'whichxyz option not implemented' |
105 |
|
|
end if |
106 |
|
|
|
107 |
|
|
ENDIF |
108 |
heimbach |
1.1 |
|
109 |
|
|
_END_MASTER( mythid ) |
110 |
|
|
|
111 |
|
|
return |
112 |
|
|
end |