/[MITgcm]/MITgcm/model/src/packages_boot.F
ViewVC logotype

Contents of /MITgcm/model/src/packages_boot.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.54 - (show annotations) (download)
Fri Mar 18 10:48:57 2011 UTC (13 years, 1 month ago) by mlosch
Branch: MAIN
CVS Tags: checkpoint62v, checkpoint62w, checkpoint62z, checkpoint62y, checkpoint62x, checkpoint63, checkpoint63a
Changes since 1.53: +19 -1 lines
Add parameters that allow to turn of parts of the adjoint code at run
time. For now, there are only useKPPinAdMode, useGMrediInAdMode,
and useSEAICEinAdMode. These parameters are set in data.pkg. This
is the lazy coward's version of doing this, but is still useful
for debugging. In order to do it right, everything needs to be
moved to pkg/autodiff.

1 C $Header: /u/gcmpack/MITgcm/model/src/packages_boot.F,v 1.53 2010/10/20 22:08:55 gforget Exp $
2 C $Name: $
3
4 #include "PACKAGES_CONFIG.h"
5 #include "CPP_OPTIONS.h"
6
7 CBOP
8 C !ROUTINE: PACKAGES_BOOT
9 C !INTERFACE:
10 SUBROUTINE PACKAGES_BOOT( myThid )
11
12 C !DESCRIPTION: \bv
13 C *==========================================================*
14 C | SUBROUTINE PACKAGES_BOOT
15 C | o Routine to parse runtime package selection file
16 C *==========================================================*
17 C | Routine reads a flat file which contains a single flag
18 C | for each known "package". Flag can enables runtime
19 C | activation or deactivation of a package. The data is read
20 C | from a file called data.pkg.
21 C | Note - If a runtime activation flag is set on but the
22 C | package code was not included in the build then
23 C | the default behavior is to stop with an error.
24 C *==========================================================*
25 C \ev
26
27 C !USES:
28 IMPLICIT NONE
29 C === Global variables ===
30 #include "SIZE.h"
31 #include "EEPARAMS.h"
32 #include "PARAMS.h"
33
34 C !INPUT/OUTPUT PARAMETERS:
35 C === Routine arguments ===
36 C myThid :: my Thread Id number
37 INTEGER myThid
38
39 C !LOCAL VARIABLES:
40 C === Local variables ===
41 C msgBuf :: Informational/error message buffer
42 C iUnit :: Work variable for IO unit number
43 CHARACTER*(MAX_LEN_MBUF) msgBuf
44 INTEGER iUnit
45
46 C data.pkg namelists
47 NAMELIST /PACKAGES/
48 & useOBCS,
49 & useSHAP_FILT,
50 & useZONAL_FILT,
51 & useOPPS,
52 & usePP81,
53 & useMY82,
54 & useGGL90,
55 & useKPP,
56 & useGMRedi,
57 & useDOWN_SLOPE,
58 c & useCAL,
59 & useEXF,
60 & useBulkForce,
61 & useEBM,
62 & useCheapAML,
63 & useGrdchk,
64 c & useSMOOTH,
65 & useECCO,
66 & useSBO,
67 & useFLT,
68 & usePTRACERS,
69 & useGCHEM,
70 & useRBCS,
71 & useOffLine,
72 & useMATRIX,
73 & useSEAICE,
74 & useSALT_PLUME,
75 & useShelfIce,
76 & useICEFRONT,
77 & useThSIce,
78 & useATM2D,
79 & useAIM,
80 & useLand,
81 & useFizhi,
82 & useGridAlt,
83 & useDiagnostics,
84 & useREGRID,
85 & useLayers,
86 & useMNC,
87 & useRunClock,
88 & useEMBED_FILES,
89 & useMYPACKAGE
90 & ,useKPPinAdMode, useGMrediInAdMode, useSEAICEinAdMode
91 CEOP
92
93 _BEGIN_MASTER(myThid)
94
95 WRITE(msgBuf,'(A)') ' PACKAGES_BOOT: opening data.pkg'
96 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
97 & SQUEEZE_RIGHT , myThid )
98
99
100 CALL OPEN_COPY_DATA_FILE(
101 I 'data.pkg', 'PACKAGES_BOOT',
102 O iUnit,
103 I myThid )
104
105 C-- Default package configuration
106 c useGAD =.FALSE.
107 useOBCS =.FALSE.
108 useSHAP_FILT =.FALSE.
109 useZONAL_FILT =.FALSE.
110 useOPPS =.FALSE.
111 usePP81 =.FALSE.
112 useMY82 =.FALSE.
113 useGGL90 =.FALSE.
114 useKPP =.FALSE.
115 useGMRedi =.FALSE.
116 useDOWN_SLOPE =.FALSE.
117 useCAL =.FALSE.
118 useEXF =.FALSE.
119 useBulkForce =.FALSE.
120 useEBM =.FALSE.
121 useCheapAML =.FALSE.
122 useGrdchk =.FALSE.
123 useSMOOTH =.FALSE.
124 useECCO =.FALSE.
125 useSBO =.FALSE.
126 useFLT =.FALSE.
127 usePTRACERS =.FALSE.
128 useGCHEM =.FALSE.
129 useRBCS =.FALSE.
130 useOffLine =.FALSE.
131 useMATRIX =.FALSE.
132 useSEAICE =.FALSE.
133 useSALT_PLUME =.FALSE.
134 useShelfIce =.FALSE.
135 useICEFRONT =.FALSE.
136 useThSIce =.FALSE.
137 useATM2D =.FALSE.
138 useAIM =.FALSE.
139 useLand =.FALSE.
140 useFizhi =.FALSE.
141 useGridAlt =.FALSE.
142 useDiagnostics =.FALSE.
143 useREGRID =.FALSE.
144 useLayers =.FALSE.
145 useMNC =.FALSE.
146 useRunClock =.FALSE.
147 useEMBED_FILES =.FALSE.
148 useMYPACKAGE =.FALSE.
149
150 useKPPinAdMode = .TRUE.
151 useGMrediInAdMode = .TRUE.
152 useSEAICEinAdMode = .TRUE.
153
154 C-- Read parameters from open data file
155 READ(UNIT=iUnit,NML=PACKAGES)
156
157
158 WRITE(msgBuf,'(A)') ' PACKAGES_BOOT: finished reading data.pkg'
159 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
160 & SQUEEZE_RIGHT , myThid )
161
162 C-- Close the open data file
163 CLOSE(iUnit)
164
165 C-- packages with hard-coded switch
166 #ifdef ALLOW_CAL
167 IF (useEXF) useCAL = .TRUE.
168 #endif
169
170 #ifdef ALLOW_PROFILES
171 useCAL = .TRUE.
172 #endif
173
174 #ifdef ALLOW_ECCO
175 useCAL = .TRUE.
176 #endif
177
178 #ifdef ALLOW_SMOOTH
179 useSMOOTH = .TRUE.
180 #endif
181
182 C-- packages with an implied switch
183 useGAD = tempStepping .OR. saltStepping .OR. usePTRACERS
184
185 C-- packages in adjoint mode
186 C-- store value of use$pkg as it will be reset in
187 C-- S/R AUTODIFF_INADMODE_SET_AD
188 useKPPinFwdMode = useKPP
189 useGMrediInFwdMode = useGMredi
190 useSEAICEinFwdMode = useSEAICE
191
192 IF ( useKPPinAdMode.AND..NOT.useKPP ) useKPPinAdMode = .FALSE.
193 IF ( useGMrediinAdMode.AND..NOT.useGMredi )
194 & useGMrediinAdMode = .FALSE.
195 IF ( useSEAICEinAdMode.AND..NOT.useSEAICE )
196 & useSEAICEinAdMode = .FALSE.
197
198 _END_MASTER(myThid)
199
200 C-- Everyone else must wait for the parameters to be loaded
201 _BARRIER
202
203 RETURN
204 END

  ViewVC Help
Powered by ViewVC 1.1.22