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