1 |
jmc |
1.12 |
C $Header: /u/gcmpack/MITgcm/pkg/autodiff/tamc.h,v 1.11 2012/06/17 03:36:55 jmc Exp $ |
2 |
jmc |
1.8 |
C $Name: $ |
3 |
heimbach |
1.1 |
|
4 |
jmc |
1.12 |
C ================================================================ |
5 |
|
|
C HEADER TAMC |
6 |
|
|
C ================================================================ |
7 |
|
|
C |
8 |
|
|
C o Header for the use of the Tangent Linear and Adjoint Model |
9 |
|
|
C Compiler (TAMC). |
10 |
|
|
C |
11 |
|
|
C started: Christian Eckert eckert@mit.edu 04-Feb-1999 |
12 |
|
|
C changed: Patrick Heimbach heimbach@mit.edu 06-Jun-2000 |
13 |
|
|
C - New parameter nlevchk_0 for dimensionalising |
14 |
|
|
C common blocks in the undef ALLOW_TAMC_CHECKPOINTING case |
15 |
|
|
C - nhreads_chkpt was declared at the wrong place |
16 |
|
|
C - new keys, separate for different packages |
17 |
|
|
|
18 |
|
|
C ================================================================ |
19 |
|
|
C HEADER TAMC |
20 |
|
|
C ================================================================ |
21 |
|
|
#ifdef ALLOW_AUTODIFF_TAMC |
22 |
|
|
|
23 |
|
|
These lines are here to deliberately cause a compile-time error. |
24 |
|
|
If you see these lines in your .f files or the compiler shows them |
25 |
|
|
as an error then it means you have not placed your customized "tamc.h" |
26 |
|
|
file in the appropriate place. |
27 |
|
|
You need to place you own copy of tamc.h in the include path for the |
28 |
|
|
model (e.g., where your SIZE.h is), and comment out these lines. |
29 |
|
|
In particular the parameters nchklev_1/2/3 (and possibly also maxpass |
30 |
|
|
and maxcube in case you are using ptracers or cubed sphere grid) |
31 |
|
|
need to be set correctly. |
32 |
|
|
|
33 |
|
|
C TAMC checkpointing parameters: |
34 |
|
|
C ============================== |
35 |
|
|
C |
36 |
|
|
C The checkpointing parameters have to be consistent with other model |
37 |
|
|
C parameters and variables. This has to be checked before the model is |
38 |
|
|
C run. |
39 |
|
|
C |
40 |
|
|
C nyears_chkpt :: Number of calendar years affected by the assimilation |
41 |
|
|
C experiment; nyears_chkpt has to be at least equal to |
42 |
|
|
C the result of cal_IntYears(mythid). |
43 |
|
|
C nmonths_chkpt :: Number of months per year; nmonth_chkpt has to be at |
44 |
|
|
C least equal to nmonthyear. |
45 |
|
|
C ndays_chkpt :: Number of days per month; nday_chkpt has to be at least |
46 |
|
|
C equal to nmaxdaymonth. |
47 |
|
|
C nsteps_chkpt :: Number of steps per day; nsteps_chkpt has to be at |
48 |
|
|
C least equal to cal_nStepDay(mythid) |
49 |
|
|
C ncheck_chkpt :: Number of innermost checkpoints. |
50 |
|
|
C |
51 |
|
|
C ngeom_chkpt :: Geometry factor. |
52 |
|
|
C nthreads_chkpt :: Number of threads to be used; nth_chkpt .eq. nTx*nTy |
53 |
heimbach |
1.1 |
|
54 |
|
|
integer nyears_chkpt |
55 |
|
|
integer nmonths_chkpt |
56 |
|
|
integer ndays_chkpt |
57 |
|
|
integer ngeom_chkpt |
58 |
|
|
integer ncheck_chkpt |
59 |
|
|
integer nthreads_chkpt |
60 |
|
|
|
61 |
|
|
parameter (nyears_chkpt = 1 ) |
62 |
|
|
parameter (nmonths_chkpt = 12 ) |
63 |
|
|
parameter (ndays_chkpt = 31 ) |
64 |
|
|
parameter (ngeom_chkpt = nr*nsx*nsy ) |
65 |
|
|
parameter (ncheck_chkpt = 6 ) |
66 |
|
|
parameter ( nthreads_chkpt = 1 ) |
67 |
|
|
|
68 |
|
|
#ifdef ALLOW_TAMC_CHECKPOINTING |
69 |
|
|
|
70 |
|
|
integer nchklev_1 |
71 |
heimbach |
1.7 |
parameter( nchklev_1 = 5 ) |
72 |
heimbach |
1.1 |
integer nchklev_2 |
73 |
heimbach |
1.7 |
parameter( nchklev_2 = 2 ) |
74 |
|
|
c parameter( nchklev_2 = 150 ) |
75 |
heimbach |
1.1 |
integer nchklev_3 |
76 |
heimbach |
1.7 |
parameter( nchklev_3 = 3 ) |
77 |
|
|
c parameter( nchklev_3 = 150 ) |
78 |
heimbach |
1.1 |
|
79 |
jmc |
1.12 |
C-- Note always check for the correct sizes of the common blocks! |
80 |
heimbach |
1.1 |
|
81 |
|
|
#else /* ALLOW_TAMC_CHECKPOINTING undefined */ |
82 |
|
|
|
83 |
|
|
integer nchklev_0 |
84 |
heimbach |
1.2 |
parameter( nchklev_0 = 64800 ) |
85 |
heimbach |
1.10 |
integer nchklev_1 |
86 |
|
|
parameter( nchklev_1 = 5 ) |
87 |
heimbach |
1.1 |
|
88 |
|
|
#endif /* ALLOW_TAMC_CHECKPOINTING */ |
89 |
|
|
|
90 |
jmc |
1.12 |
C TAMC keys: |
91 |
|
|
C ========== |
92 |
|
|
C |
93 |
|
|
C The keys are used for storing and reading data of the reference |
94 |
|
|
C trajectory. |
95 |
|
|
C |
96 |
|
|
C The convention used here is: |
97 |
|
|
C ikey_<name> |
98 |
|
|
C |
99 |
|
|
C which means that this key is used in routine <name> for reading |
100 |
|
|
C and writing data. |
101 |
heimbach |
1.1 |
|
102 |
|
|
common /tamc_keys_i/ |
103 |
|
|
& ikey_dynamics, |
104 |
|
|
& ikey_yearly, |
105 |
|
|
& ikey_daily_1, |
106 |
|
|
& ikey_daily_2, |
107 |
|
|
& iloop_daily |
108 |
|
|
|
109 |
|
|
integer ikey_dynamics |
110 |
|
|
integer ikey_yearly |
111 |
|
|
integer ikey_daily_1 |
112 |
|
|
integer ikey_daily_2 |
113 |
|
|
integer iloop_daily |
114 |
|
|
|
115 |
|
|
INTEGER isbyte |
116 |
heimbach |
1.7 |
PARAMETER( isbyte = 8 ) |
117 |
heimbach |
1.1 |
INTEGER maximpl |
118 |
heimbach |
1.7 |
PARAMETER( maximpl = 6 ) |
119 |
gforget |
1.9 |
#ifndef ALLOW_PTRACERS |
120 |
heimbach |
1.2 |
INTEGER maxpass |
121 |
heimbach |
1.7 |
PARAMETER( maxpass = 2 ) |
122 |
heimbach |
1.5 |
#endif |
123 |
heimbach |
1.3 |
INTEGER maxcube |
124 |
heimbach |
1.7 |
PARAMETER( maxcube = 1 ) |
125 |
heimbach |
1.1 |
|
126 |
heimbach |
1.3 |
INTEGER act0, act1, act2, act3, act4 |
127 |
|
|
INTEGER max0, max1, max2, max3 |
128 |
jmc |
1.11 |
INTEGER iikey, kkey, passkey, igadkey, |
129 |
heimbach |
1.7 |
& itdkey, idynkey, igmkey, ikppkey, iptrkey |
130 |
heimbach |
1.1 |
|
131 |
jmc |
1.11 |
#ifdef ALLOW_CG2D_NSA |
132 |
|
|
C Parameter that is needed for the tape complev_cg2d_iter |
133 |
|
|
C cannot be smaller than the allowed number of iterations in cg2d |
134 |
|
|
C (numItersMax >= cg2dMaxIters in data-file) |
135 |
|
|
INTEGER numItersMax |
136 |
|
|
PARAMETER ( numItersMax = 100 ) |
137 |
|
|
#endif |
138 |
|
|
|
139 |
jmc |
1.12 |
#endif /* ALLOW_AUTODIFF_TAMC */ |
140 |
|
|
C ================================================================ |
141 |
|
|
C END OF HEADER TAMC |
142 |
|
|
C ================================================================ |