/[MITgcm]/MITgcm/pkg/ctrl/ctrl_pack.F
ViewVC logotype

Contents of /MITgcm/pkg/ctrl/ctrl_pack.F

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


Revision 1.48 - (show annotations) (download)
Thu Sep 13 19:56:40 2012 UTC (11 years, 8 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint64, checkpoint64a, checkpoint64c, checkpoint64b
Changes since 1.47: +1 -4 lines
remove AD_CONFIG.h (since doMainPack is now turn off by default for
 simple forward run)

1 C $Header: /u/gcmpack/MITgcm/pkg/ctrl/ctrl_pack.F,v 1.47 2012/09/12 22:20:06 jmc Exp $
2 C $Name: $
3
4 #include "CTRL_OPTIONS.h"
5 #ifdef ALLOW_EXF
6 # include "EXF_OPTIONS.h"
7 #endif
8
9 subroutine ctrl_pack( first, mythid )
10
11 c ==================================================================
12 c SUBROUTINE ctrl_pack
13 c ==================================================================
14 c
15 c o Compress the control vector such that only ocean points are
16 c written to file.
17 c
18 c started: Christian Eckert eckert@mit.edu 10-Mar=2000
19 c
20 c changed: Patrick Heimbach heimbach@mit.edu 06-Jun-2000
21 c - Transferred some filename declarations
22 c from here to namelist in ctrl_init
23 c
24 c Patrick Heimbach heimbach@mit.edu 16-Jun-2000
25 c - single file name convention with or without
26 c ALLOW_ECCO_OPTIMIZATION
27 c
28 c G. Gebbie, added open boundary control packing,
29 c gebbie@mit.edu 18 -Mar- 2003
30 c
31 c heimbach@mit.edu totally restructured 28-Oct-2003
32 c
33 c ==================================================================
34 c SUBROUTINE ctrl_pack
35 c ==================================================================
36
37 implicit none
38
39 c == global variables ==
40
41 #include "EEPARAMS.h"
42 #include "SIZE.h"
43 #include "PARAMS.h"
44 #include "GRID.h"
45
46 #include "ctrl.h"
47 #include "CTRL_SIZE.h"
48 #include "CTRL_GENARR.h"
49 #include "optim.h"
50
51 #ifdef ALLOW_COST
52 # include "cost.h"
53 #endif
54 #ifdef ALLOW_ECCO
55 # include "ecco_cost.h"
56 #else
57 # include "ctrl_weights.h"
58 #endif
59 #ifdef ALLOW_EXF
60 # include "EXF_PARAM.h"
61 #endif
62
63 c == routine arguments ==
64 logical first
65 integer mythid
66
67 #ifndef EXCLUDE_CTRL_PACK
68 c == external ==
69 integer ilnblnk
70 external ilnblnk
71
72 c == local variables ==
73
74 _RL fcloc
75
76 integer i, j, k
77 integer ii
78 integer il
79 integer irec
80 integer ig,jg
81 integer ivartype
82 integer iobcs
83 #if (defined ALLOW_GENARR2D_CONTROL) || (defined ALLOW_GENARR3D_CONTROL)
84 C- Providing we set the file-name just before calling ctrl_set_pack,
85 C the same local file-name variable can be used for different variables.
86 C This is how GENARR2/3D_CONTROL is implemented (+ provides an example)
87 integer iarr
88 character*(80) fname_local(3)
89 #endif
90
91 logical doglobalread
92 logical ladinit
93 integer cbuffindex
94 logical lxxadxx
95
96 integer cunit
97 integer ictrlgrad
98
99 character*(128) cfile
100 character*( 80) weighttype
101
102 c == end of interface ==
103
104 #ifndef ALLOW_ECCO_OPTIMIZATION
105 fmin = 0. _d 0
106 #endif
107
108 c-- Tiled files are used.
109 doglobalread = .false.
110
111 c-- Initialise adjoint variables on active files.
112 ladinit = .false.
113
114 c-- Initialise global buffer index
115 nbuffglobal = 0
116
117 c-- Assign file names.
118
119 call ctrl_set_fname(xx_theta_file, fname_theta, mythid)
120 call ctrl_set_fname(xx_salt_file, fname_salt, mythid)
121 call ctrl_set_fname(xx_hflux_file, fname_hflux, mythid)
122 call ctrl_set_fname(xx_sflux_file, fname_sflux, mythid)
123 call ctrl_set_fname(xx_tauu_file, fname_tauu, mythid)
124 call ctrl_set_fname(xx_tauv_file, fname_tauv, mythid)
125 call ctrl_set_fname(xx_atemp_file, fname_atemp, mythid)
126 call ctrl_set_fname(xx_aqh_file, fname_aqh, mythid)
127 call ctrl_set_fname(xx_precip_file, fname_precip, mythid)
128 call ctrl_set_fname(xx_swflux_file, fname_swflux, mythid)
129 call ctrl_set_fname(xx_swdown_file, fname_swdown, mythid)
130 call ctrl_set_fname(xx_lwflux_file, fname_lwflux, mythid)
131 call ctrl_set_fname(xx_lwdown_file, fname_lwdown, mythid)
132 call ctrl_set_fname(xx_evap_file, fname_evap, mythid)
133 call ctrl_set_fname(xx_snowprecip_file, fname_snowprecip, mythid)
134 call ctrl_set_fname(xx_apressure_file, fname_apressure, mythid)
135 call ctrl_set_fname(xx_runoff_file, fname_runoff, mythid)
136 call ctrl_set_fname(xx_uwind_file, fname_uwind, mythid)
137 call ctrl_set_fname(xx_vwind_file, fname_vwind, mythid)
138 call ctrl_set_fname(xx_obcsn_file, fname_obcsn, mythid)
139 call ctrl_set_fname(xx_obcss_file, fname_obcss, mythid)
140 call ctrl_set_fname(xx_obcsw_file, fname_obcsw, mythid)
141 call ctrl_set_fname(xx_obcse_file, fname_obcse, mythid)
142 call ctrl_set_fname(xx_diffkr_file, fname_diffkr, mythid)
143 call ctrl_set_fname(xx_kapgm_file, fname_kapgm, mythid)
144 call ctrl_set_fname(xx_kapredi_file, fname_kapredi, mythid)
145 call ctrl_set_fname(xx_tr1_file, fname_tr1, mythid)
146 call ctrl_set_fname(xx_sst_file, fname_sst, mythid)
147 call ctrl_set_fname(xx_sss_file, fname_sss, mythid)
148 call ctrl_set_fname(xx_depth_file, fname_depth, mythid)
149 call ctrl_set_fname(xx_efluxy_file, fname_efluxy, mythid)
150 call ctrl_set_fname(xx_efluxp_file, fname_efluxp, mythid)
151 call ctrl_set_fname(xx_bottomdrag_file, fname_bottomdrag, mythid)
152 call ctrl_set_fname(xx_edtaux_file, fname_edtaux, mythid)
153 call ctrl_set_fname(xx_edtauy_file, fname_edtauy, mythid)
154 call ctrl_set_fname(xx_uvel_file, fname_uvel, mythid)
155 call ctrl_set_fname(xx_vvel_file, fname_vvel, mythid)
156 call ctrl_set_fname(xx_etan_file, fname_etan, mythid)
157 call ctrl_set_fname(xx_relaxsst_file, fname_relaxsst, mythid)
158 call ctrl_set_fname(xx_relaxsss_file, fname_relaxsss, mythid)
159 call ctrl_set_fname(xx_siarea_file, fname_siarea, mythid)
160 call ctrl_set_fname(xx_siheff_file, fname_siheff, mythid)
161 call ctrl_set_fname(xx_sihsnow_file, fname_sihsnow, mythid)
162 call ctrl_set_fname(xx_shifwflx_file, fname_shifwflx, mythid)
163 cHFLUXM_CONTROL
164 call ctrl_set_fname(xx_hfluxm_file, fname_hfluxm, mythid)
165 cHFLUXM_CONTROL
166
167 c-- Only the master thread will do I/O.
168 _BEGIN_MASTER( mythid )
169
170 if ( first ) then
171 c >>> Initialise control vector for optimcycle=0 <<<
172 lxxadxx = .TRUE.
173 ictrlgrad = 1
174 fcloc = fmin
175 write(cfile(1:128),'(4a,i4.4)')
176 & ctrlname(1:9),'_',yctrlid(1:10),
177 & yctrlpospack, optimcycle
178 print *, 'ph-pack: packing ', ctrlname(1:9)
179 else
180 c >>> Write gradient vector <<<
181 lxxadxx = .FALSE.
182 ictrlgrad = 2
183 #ifdef ALLOW_AUTODIFF_OPENAD
184 fcloc = fc%v
185 #else
186 fcloc = fc
187 #endif
188 write(cfile(1:128),'(4a,i4.4)')
189 & costname(1:9),'_',yctrlid(1:10),
190 & yctrlpospack, optimcycle
191 print *, 'ph-pack: packing ', costname(1:9)
192 endif
193
194 c-- Only Proc 0 will do I/O.
195 IF ( myProcId .eq. 0 ) THEN
196
197 call mdsfindunit( cunit, mythid )
198 open( cunit, file = cfile,
199 & status = 'unknown',
200 & form = 'unformatted',
201 & access = 'sequential' )
202
203 c-- Header information.
204 write(cunit) nvartype
205 write(cunit) nvarlength
206 write(cunit) yctrlid
207 write(cunit) optimCycle
208 write(cunit) fc
209 C place holder of obsolete variable iG
210 write(cunit) 1
211 C place holder of obsolete variable jG
212 write(cunit) 1
213 write(cunit) nsx
214 write(cunit) nsy
215 write(cunit) (nWetcGlobal(k), k=1,nr)
216 write(cunit) (nWetsGlobal(k), k=1,nr)
217 write(cunit) (nWetwGlobal(k), k=1,nr)
218 #ifdef ALLOW_CTRL_WETV
219 write(cunit) (nWetvGlobal(k), k=1,nr)
220 #endif
221 #ifdef ALLOW_SHIFWFLX_CONTROL
222 write(cunit) (nWetiGlobal(k), k=1,nr)
223 c write(cunit) nWetiGlobal(1)
224 #endif
225
226 #ifdef ALLOW_OBCSN_CONTROL
227 write(cunit) ((nWetobcsnGlo(k,iobcs), k=1,nr),iobcs= 1,nobcs)
228 #endif
229 #ifdef ALLOW_OBCSS_CONTROL
230 write(cunit) ((nWetobcssGlo(k,iobcs), k=1,nr),iobcs= 1,nobcs)
231 #endif
232 #ifdef ALLOW_OBCSW_CONTROL
233 write(cunit) ((nWetobcswGlo(k,iobcs), k=1,nr),iobcs= 1,nobcs)
234 #endif
235 #ifdef ALLOW_OBCSE_CONTROL
236 write(cunit) ((nWetobcseGlo(k,iobcs), k=1,nr),iobcs= 1,nobcs)
237 #endif
238 write(cunit) (ncvarindex(i), i=1,maxcvars)
239 write(cunit) (ncvarrecs(i), i=1,maxcvars)
240 write(cunit) (ncvarxmax(i), i=1,maxcvars)
241 write(cunit) (ncvarymax(i), i=1,maxcvars)
242 write(cunit) (ncvarnrmax(i), i=1,maxcvars)
243 write(cunit) (ncvargrd(i), i=1,maxcvars)
244 write(cunit)
245
246 #ifdef ALLOW_PACKUNPACK_METHOD2
247 ENDIF
248 _END_MASTER( mythid )
249 _BARRIER
250 #endif
251
252 #ifdef ALLOW_THETA0_CONTROL
253 ivartype = 1
254 write(weighttype(1:80),'(80a)') ' '
255 write(weighttype(1:80),'(a)') "wthetaLev"
256 call ctrl_set_pack_xyz(
257 & cunit, ivartype, fname_theta(ictrlgrad), "maskCtrlC",
258 & weighttype, wtheta, lxxadxx, mythid)
259 #endif
260
261 #ifdef ALLOW_SALT0_CONTROL
262 ivartype = 2
263 write(weighttype(1:80),'(80a)') ' '
264 write(weighttype(1:80),'(a)') "wsaltLev"
265 call ctrl_set_pack_xyz(
266 & cunit, ivartype, fname_salt(ictrlgrad), "maskCtrlC",
267 & weighttype, wsalt, lxxadxx, mythid)
268 #endif
269
270 #if (defined (ALLOW_HFLUX_CONTROL) || defined (ALLOW_HFLUX0_CONTROL))
271 ivartype = 3
272 write(weighttype(1:80),'(80a)') ' '
273 write(weighttype(1:80),'(a)') "whflux"
274 call ctrl_set_pack_xy(
275 & cunit, ivartype, fname_hflux(ictrlgrad), "maskCtrlC",
276 & weighttype, lxxadxx, mythid)
277 #endif
278
279 #if (defined (ALLOW_SFLUX_CONTROL) || defined (ALLOW_SFLUX0_CONTROL))
280 ivartype = 4
281 write(weighttype(1:80),'(80a)') ' '
282 write(weighttype(1:80),'(a)') "wsflux"
283 call ctrl_set_pack_xy(
284 & cunit, ivartype, fname_sflux(ictrlgrad), "maskCtrlC",
285 & weighttype, lxxadxx, mythid)
286 #endif
287
288 #if (defined (ALLOW_USTRESS_CONTROL) || defined (ALLOW_TAUU0_CONTROL))
289 #ifdef ALLOW_EXF
290 IF ( .NOT.useAtmWind ) THEN
291 #endif
292 ivartype = 5
293 write(weighttype(1:80),'(80a)') ' '
294 write(weighttype(1:80),'(a)') "wtauu"
295 call ctrl_set_pack_xy(
296 #ifndef ALLOW_ROTATE_UV_CONTROLS
297 & cunit, ivartype, fname_tauu(ictrlgrad), "maskCtrlW",
298 #else
299 & cunit, ivartype, fname_tauu(ictrlgrad), "maskCtrlC",
300 #endif
301 & weighttype, lxxadxx, mythid)
302 #ifdef ALLOW_EXF
303 ENDIF
304 #endif
305 #endif
306
307 #if (defined (ALLOW_VSTRESS_CONTROL) || defined (ALLOW_TAUV0_CONTROL))
308 #ifdef ALLOW_EXF
309 IF ( .NOT.useAtmWind ) THEN
310 #endif
311 ivartype = 6
312 write(weighttype(1:80),'(80a)') ' '
313 write(weighttype(1:80),'(a)') "wtauv"
314 call ctrl_set_pack_xy(
315 #ifndef ALLOW_ROTATE_UV_CONTROLS
316 & cunit, ivartype, fname_tauv(ictrlgrad), "maskCtrlS",
317 #else
318 & cunit, ivartype, fname_tauv(ictrlgrad), "maskCtrlC",
319 #endif
320 & weighttype, lxxadxx, mythid)
321 #ifdef ALLOW_EXF
322 ENDIF
323 #endif
324 #endif
325
326 #ifdef ALLOW_ATEMP_CONTROL
327 ivartype = 7
328 write(weighttype(1:80),'(80a)') ' '
329 write(weighttype(1:80),'(a)') "watemp"
330 call ctrl_set_pack_xy(
331 & cunit, ivartype, fname_atemp(ictrlgrad), "maskCtrlC",
332 & weighttype, lxxadxx, mythid)
333 #endif
334
335 #ifdef ALLOW_AQH_CONTROL
336 ivartype = 8
337 write(weighttype(1:80),'(80a)') ' '
338 write(weighttype(1:80),'(a)') "waqh"
339 call ctrl_set_pack_xy(
340 & cunit, ivartype, fname_aqh(ictrlgrad), "maskCtrlC",
341 & weighttype, lxxadxx, mythid)
342 #endif
343
344 #ifdef ALLOW_UWIND_CONTROL
345 #ifdef ALLOW_EXF
346 IF ( useAtmWind ) THEN
347 #endif
348 ivartype = 9
349 write(weighttype(1:80),'(80a)') ' '
350 write(weighttype(1:80),'(a)') "wuwind"
351 call ctrl_set_pack_xy(
352 & cunit, ivartype, fname_uwind(ictrlgrad), "maskCtrlC",
353 & weighttype, lxxadxx, mythid)
354 #ifdef ALLOW_EXF
355 ENDIF
356 #endif
357 #endif
358
359 #ifdef ALLOW_VWIND_CONTROL
360 #ifdef ALLOW_EXF
361 IF ( useAtmWind ) THEN
362 #endif
363 ivartype = 10
364 write(weighttype(1:80),'(80a)') ' '
365 write(weighttype(1:80),'(a)') "wvwind"
366 call ctrl_set_pack_xy(
367 & cunit, ivartype, fname_vwind(ictrlgrad), "maskCtrlC",
368 & weighttype, lxxadxx, mythid)
369 #ifdef ALLOW_EXF
370 ENDIF
371 #endif
372 #endif
373
374 #ifdef ALLOW_OBCSN_CONTROL
375 ivartype = 11
376 write(weighttype(1:80),'(80a)') ' '
377 write(weighttype(1:80),'(a)') "wobcsn"
378 call ctrl_set_pack_xz(
379 & cunit, ivartype, fname_obcsn(ictrlgrad), "maskobcsn",
380 & weighttype, wobcsn, lxxadxx, mythid)
381 #endif
382
383 #ifdef ALLOW_OBCSS_CONTROL
384 ivartype = 12
385 write(weighttype(1:80),'(80a)') ' '
386 write(weighttype(1:80),'(a)') "wobcss"
387 call ctrl_set_pack_xz(
388 & cunit, ivartype, fname_obcss(ictrlgrad), "maskobcss",
389 & weighttype, wobcss, lxxadxx, mythid)
390 #endif
391
392 #ifdef ALLOW_OBCSW_CONTROL
393 ivartype = 13
394 write(weighttype(1:80),'(80a)') ' '
395 write(weighttype(1:80),'(a)') "wobcsw"
396 call ctrl_set_pack_yz(
397 & cunit, ivartype, fname_obcsw(ictrlgrad), "maskobcsw",
398 & weighttype, wobcsw, lxxadxx, mythid)
399 #endif
400
401 #ifdef ALLOW_OBCSE_CONTROL
402 ivartype = 14
403 write(weighttype(1:80),'(80a)') ' '
404 write(weighttype(1:80),'(a)') "wobcse"
405 call ctrl_set_pack_yz(
406 & cunit, ivartype, fname_obcse(ictrlgrad), "maskobcse",
407 & weighttype, wobcse, lxxadxx, mythid)
408 #endif
409
410 #ifdef ALLOW_DIFFKR_CONTROL
411 ivartype = 15
412 write(weighttype(1:80),'(80a)') ' '
413 write(weighttype(1:80),'(a)') "wdiffkr"
414 call ctrl_set_pack_xyz(
415 & cunit, ivartype, fname_diffkr(ictrlgrad), "maskCtrlC",
416 & weighttype, wdiffkr, lxxadxx, mythid)
417 #endif
418
419 #ifdef ALLOW_KAPGM_CONTROL
420 ivartype = 16
421 write(weighttype(1:80),'(80a)') ' '
422 write(weighttype(1:80),'(a)') "wkapgm"
423 call ctrl_set_pack_xyz(
424 & cunit, ivartype, fname_kapgm(ictrlgrad), "maskCtrlC",
425 & weighttype, wkapgm, lxxadxx, mythid)
426 #endif
427
428 #ifdef ALLOW_TR10_CONTROL
429 ivartype = 17
430 write(weighttype(1:80),'(80a)') ' '
431 write(weighttype(1:80),'(a)') "wtr1"
432 call ctrl_set_pack_xyz(
433 & cunit, ivartype, fname_tr1(ictrlgrad), "maskCtrlC",
434 & weighttype, wunit, lxxadxx, mythid)
435 #endif
436
437 #if (defined (ALLOW_SST_CONTROL) || defined (ALLOW_SST0_CONTROL))
438 ivartype = 18
439 write(weighttype(1:80),'(80a)') ' '
440 write(weighttype(1:80),'(a)') "wsst"
441 call ctrl_set_pack_xy(
442 & cunit, ivartype, fname_sst(ictrlgrad), "maskCtrlC",
443 & weighttype, lxxadxx, mythid)
444 #endif
445
446 #if (defined (ALLOW_SSS_CONTROL) || defined (ALLOW_SSS0_CONTROL))
447 ivartype = 19
448 write(weighttype(1:80),'(80a)') ' '
449 write(weighttype(1:80),'(a)') "wsss"
450 call ctrl_set_pack_xy(
451 & cunit, ivartype, fname_sss(ictrlgrad),
452 & "maskCtrlC", weighttype, lxxadxx, mythid)
453 #endif
454
455 #ifdef ALLOW_DEPTH_CONTROL
456 ivartype = 20
457 write(weighttype(1:80),'(80a)') ' '
458 write(weighttype(1:80),'(a)') "wdepth"
459 call ctrl_set_pack_xy(
460 & cunit, ivartype, fname_depth(ictrlgrad),
461 & "maskCtrlC", weighttype, lxxadxx, mythid)
462 #endif /* ALLOW_DEPTH_CONTROL */
463
464 #ifdef ALLOW_EFLUXY0_CONTROL
465 ivartype = 21
466 write(weighttype(1:80),'(80a)') ' '
467 write(weighttype(1:80),'(a)') "wefluxy0"
468 call ctrl_set_pack_xyz(
469 & cunit, ivartype, fname_efluxy(ictrlgrad), "maskCtrlS",
470 & weighttype, wunit, lxxadxx, mythid)
471 #endif
472
473 #ifdef ALLOW_EFLUXP0_CONTROL
474 ivartype = 22
475 write(weighttype(1:80),'(80a)') ' '
476 write(weighttype(1:80),'(a)') "wefluxp0"
477 call ctrl_set_pack_xyz(
478 & cunit, ivartype, fname_efluxp(ictrlgrad), "maskhFacV",
479 & weighttype, wunit, lxxadxx, mythid)
480 #endif
481
482 #ifdef ALLOW_BOTTOMDRAG_CONTROL
483 ivartype = 23
484 write(weighttype(1:80),'(80a)') ' '
485 write(weighttype(1:80),'(a)') "wbottomdrag"
486 call ctrl_set_pack_xy(
487 & cunit, ivartype, fname_bottomdrag(ictrlgrad), "maskCtrlC",
488 & weighttype, lxxadxx, mythid)
489 #endif
490
491 #ifdef ALLOW_HFLUXM_CONTROL
492 ivartype = 24
493 write(weighttype(1:80),'(80a)') ' '
494 write(weighttype(1:80),'(a)') "whfluxm"
495 call ctrl_set_pack_xy(
496 & cunit, ivartype, fname_hfluxm(ictrlgrad), "maskCtrlC",
497 & weighttype, lxxadxx, mythid)
498 #endif
499
500 #ifdef ALLOW_EDDYPSI_CONTROL
501 ivartype = 25
502 write(weighttype(1:80),'(80a)') ' '
503 write(weighttype(1:80),'(a)') "wedtaux"
504 call ctrl_set_pack_xyz(
505 & cunit, ivartype, fname_edtaux(ictrlgrad), "maskCtrlW",
506 & weighttype, wedtaux, lxxadxx, mythid)
507
508 ivartype = 26
509 write(weighttype(1:80),'(80a)') ' '
510 write(weighttype(1:80),'(a)') "wedtauy"
511 call ctrl_set_pack_xyz(
512 & cunit, ivartype, fname_edtauy(ictrlgrad), "maskCtrlS",
513 & weighttype, wedtauy, lxxadxx, mythid)
514 #endif
515
516 #ifdef ALLOW_UVEL0_CONTROL
517 ivartype = 27
518 write(weighttype(1:80),'(80a)') ' '
519 write(weighttype(1:80),'(a)') "wuvel"
520 call ctrl_set_pack_xyz(
521 & cunit, ivartype, fname_uvel(ictrlgrad), "maskCtrlW",
522 & weighttype, wuvel, lxxadxx, mythid)
523 #endif
524
525 #ifdef ALLOW_VVEL0_CONTROL
526 ivartype = 28
527 write(weighttype(1:80),'(80a)') ' '
528 write(weighttype(1:80),'(a)') "wvvel"
529 call ctrl_set_pack_xyz(
530 & cunit, ivartype, fname_vvel(ictrlgrad), "maskCtrlS",
531 & weighttype, wvvel, lxxadxx, mythid)
532 #endif
533
534 #ifdef ALLOW_ETAN0_CONTROL
535 ivartype = 29
536 write(weighttype(1:80),'(80a)') ' '
537 write(weighttype(1:80),'(a)') "wetan"
538 call ctrl_set_pack_xy(
539 & cunit, ivartype, fname_etan(ictrlgrad),
540 & "maskCtrlC", weighttype, lxxadxx, mythid)
541 #endif
542
543 #ifdef ALLOW_RELAXSST_CONTROL
544 ivartype = 30
545 write(weighttype(1:80),'(80a)') ' '
546 write(weighttype(1:80),'(a)') "wrelaxsst"
547 call ctrl_set_pack_xy(
548 & cunit, ivartype, fname_relaxsst(ictrlgrad),
549 & "maskCtrlC", weighttype, lxxadxx, mythid)
550 #endif
551
552 #ifdef ALLOW_RELAXSSS_CONTROL
553 ivartype = 31
554 write(weighttype(1:80),'(80a)') ' '
555 write(weighttype(1:80),'(a)') "wrelaxsss"
556 call ctrl_set_pack_xy(
557 & cunit, ivartype, fname_relaxsss(ictrlgrad),
558 & "maskCtrlC", weighttype, lxxadxx, mythid)
559 #endif
560
561 #ifdef ALLOW_PRECIP_CONTROL
562 ivartype = 32
563 write(weighttype(1:80),'(80a)') ' '
564 write(weighttype(1:80),'(a)') "wprecip"
565 call ctrl_set_pack_xy(
566 & cunit, ivartype, fname_precip(ictrlgrad),
567 & "maskCtrlC", weighttype, lxxadxx, mythid)
568 #endif
569
570 #ifdef ALLOW_SWFLUX_CONTROL
571 ivartype = 33
572 write(weighttype(1:80),'(80a)') ' '
573 write(weighttype(1:80),'(a)') "wswflux"
574 call ctrl_set_pack_xy(
575 & cunit, ivartype, fname_swflux(ictrlgrad),
576 & "maskCtrlC", weighttype, lxxadxx, mythid)
577 #endif
578
579 #ifdef ALLOW_SWDOWN_CONTROL
580 ivartype = 34
581 write(weighttype(1:80),'(80a)') ' '
582 write(weighttype(1:80),'(a)') "wswdown"
583 call ctrl_set_pack_xy(
584 & cunit, ivartype, fname_swdown(ictrlgrad),
585 & "maskCtrlC", weighttype, lxxadxx, mythid)
586 #endif
587
588 #ifdef ALLOW_LWFLUX_CONTROL
589 ivartype = 35
590 write(weighttype(1:80),'(80a)') ' '
591 write(weighttype(1:80),'(a)') "wlwflux"
592 call ctrl_set_pack_xy(
593 & cunit, ivartype, fname_lwflux(ictrlgrad),
594 & "maskCtrlC", weighttype, lxxadxx, mythid)
595 #endif
596
597 #ifdef ALLOW_LWDOWN_CONTROL
598 ivartype = 36
599 write(weighttype(1:80),'(80a)') ' '
600 write(weighttype(1:80),'(a)') "wlwdown"
601 call ctrl_set_pack_xy(
602 & cunit, ivartype, fname_lwdown(ictrlgrad),
603 & "maskCtrlC", weighttype, lxxadxx, mythid)
604 #endif
605
606 #ifdef ALLOW_EVAP_CONTROL
607 ivartype = 37
608 write(weighttype(1:80),'(80a)') ' '
609 write(weighttype(1:80),'(a)') "wevap"
610 call ctrl_set_pack_xy(
611 & cunit, ivartype, fname_evap(ictrlgrad),
612 & "maskCtrlC", weighttype, lxxadxx, mythid)
613 #endif
614
615 #ifdef ALLOW_SNOWPRECIP_CONTROL
616 ivartype = 38
617 write(weighttype(1:80),'(80a)') ' '
618 write(weighttype(1:80),'(a)') "wsnowprecip"
619 call ctrl_set_pack_xy(
620 & cunit, ivartype, fname_snowprecip(ictrlgrad),
621 & "maskCtrlC", weighttype, lxxadxx, mythid)
622 #endif
623
624 #ifdef ALLOW_APRESSURE_CONTROL
625 ivartype = 39
626 write(weighttype(1:80),'(80a)') ' '
627 write(weighttype(1:80),'(a)') "wapressure"
628 call ctrl_set_pack_xy(
629 & cunit, ivartype, fname_apressure(ictrlgrad),
630 & "maskCtrlC", weighttype, lxxadxx, mythid)
631 #endif
632
633 #ifdef ALLOW_RUNOFF_CONTROL
634 ivartype = 40
635 write(weighttype(1:80),'(80a)') ' '
636 write(weighttype(1:80),'(a)') "wrunoff"
637 call ctrl_set_pack_xy(
638 & cunit, ivartype, fname_runoff(ictrlgrad),
639 & "maskCtrlC", weighttype, lxxadxx, mythid)
640 #endif
641
642 #ifdef ALLOW_SIAREA_CONTROL
643 ivartype = 41
644 write(weighttype(1:80),'(80a)') ' '
645 write(weighttype(1:80),'(a)') "wunit"
646 call ctrl_set_pack_xy(
647 & cunit, ivartype, fname_siarea(ictrlgrad),
648 & "maskCtrlC", weighttype, lxxadxx, mythid)
649 #endif
650
651 #ifdef ALLOW_SIHEFF_CONTROL
652 ivartype = 42
653 write(weighttype(1:80),'(80a)') ' '
654 write(weighttype(1:80),'(a)') "wunit"
655 call ctrl_set_pack_xy(
656 & cunit, ivartype, fname_siheff(ictrlgrad),
657 & "maskCtrlC", weighttype, lxxadxx, mythid)
658 #endif
659
660 #ifdef ALLOW_SIHSNOW_CONTROL
661 ivartype = 43
662 write(weighttype(1:80),'(80a)') ' '
663 write(weighttype(1:80),'(a)') "wunit"
664 call ctrl_set_pack_xy(
665 & cunit, ivartype, fname_sihsnow(ictrlgrad),
666 & "maskCtrlC", weighttype, lxxadxx, mythid)
667 #endif
668
669 #ifdef ALLOW_KAPREDI_CONTROL
670 ivartype = 44
671 write(weighttype(1:80),'(80a)') ' '
672 write(weighttype(1:80),'(a)') "wkapredi"
673 call ctrl_set_pack_xyz(
674 & cunit, ivartype, fname_kapredi(ictrlgrad), "maskCtrlC",
675 & weighttype, wkapredi, lxxadxx, mythid)
676 #endif
677
678 #ifdef ALLOW_SHIFWFLX_CONTROL
679 ivartype = 45
680 write(weighttype(1:80),'(80a)') ' '
681 write(weighttype(1:80),'(a)') "wshifwflx"
682 call ctrl_set_pack_xy(
683 & cunit, ivartype, fname_shifwflx(ictrlgrad),
684 & "maskCtrlI", weighttype, lxxadxx, mythid)
685 #endif
686
687 #ifdef ALLOW_GENARR2D_CONTROL
688 do iarr = 1, maxCtrlArr2D
689 call ctrl_set_fname( xx_genarr2d_file(iarr),
690 O fname_local, mythid )
691 ivartype = 100+iarr
692 write(weighttype(1:80),'(80a)') ' '
693 write(weighttype(1:80),'(a)') "wunit"
694 call ctrl_set_pack_xy(
695 & cunit, ivartype, fname_local(ictrlgrad),
696 & "maskCtrlC", weighttype, lxxadxx, mythid)
697 enddo
698 #endif
699
700 #ifdef ALLOW_GENARR3D_CONTROL
701 do iarr = 1, maxCtrlArr3D
702 call ctrl_set_fname( xx_genarr3d_file(iarr),
703 O fname_local, mythid )
704 ivartype = 200+iarr
705 write(weighttype(1:80),'(80a)') ' '
706 write(weighttype(1:80),'(a)') "wunit"
707 call ctrl_set_pack_xyz(
708 & cunit, ivartype, fname_local(ictrlgrad),
709 & "maskCtrlC", weighttype, wunit, lxxadxx, mythid)
710 enddo
711 #endif
712
713 #ifdef ALLOW_PACKUNPACK_METHOD2
714 _BEGIN_MASTER( mythid )
715 IF ( myProcId .eq. 0 ) THEN
716 #endif
717
718 close ( cunit )
719 ENDIF !IF ( myProcId .eq. 0 )
720 _END_MASTER( mythid )
721 _BARRIER
722 #endif /* EXCLUDE_CTRL_PACK */
723
724 return
725 end

  ViewVC Help
Powered by ViewVC 1.1.22