/[MITgcm]/MITgcm/pkg/admtlm/admtlm_dsvd2model.F
ViewVC logotype

Diff of /MITgcm/pkg/admtlm/admtlm_dsvd2model.F

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

revision 1.1 by heimbach, Fri Apr 29 10:36:45 2005 UTC revision 1.2 by heimbach, Tue Nov 1 04:09:46 2005 UTC
# Line 1  Line 1 
1    C
2    C $Header$
3    C $Name$
4    
5  #include "CPP_OPTIONS.h"  #include "PACKAGES_CONFIG.h"
6    #include "CTRL_CPPOPTIONS.h"
7    
8        subroutine admtlm_dsvd2model( tmpstate, mythid )        subroutine admtlm_dsvd2model( first, mythid )
9  C     /==========================================================\  
10  C     | subroutine admtlm_map                                    |  c     ==================================================================
11  C     | o This routine assigns final T,S to cost function        |  c     SUBROUTINE ctrl_unpack
12  C     \==========================================================/  c     ==================================================================
13         implicit none  c
14    c     o Unpack the control vector such that the land points are filled
15    c       in.
16    c
17    c     started: Christian Eckert eckert@mit.edu  10-Mar-2000
18    c
19    c     changed: Patrick Heimbach heimbach@mit.edu 06-Jun-2000
20    c              - Transferred some filename declarations
21    c                from here to namelist in ctrl_init
22    c
23    c              Patrick Heimbach heimbach@mit.edu 16-Jun-2000
24    c              - single file name convention with or without
25    c                ALLOW_ECCO_OPTIMIZATION
26    C
27    c              Armin Koehl akoehl@ucsd.edu 05-Dec-2000
28    c              - single processor reads global parameter file
29    c               and writes multiple xx* and adxx* files
30    c
31    c              G Gebbie gebbie@mit.edu 18-Mar-2003
32    c              - open boundary packing
33    c
34    c              heimbach@mit.edu totally restructured 28-Oct-2003
35    c
36    c     ==================================================================
37    c     SUBROUTINE ctrl_unpack
38    c     ==================================================================
39    
40          implicit none
41    
42    c     == global variables ==
43    
 C     == Global variables ===  
 #include "SIZE.h"  
44  #include "EEPARAMS.h"  #include "EEPARAMS.h"
45    #include "SIZE.h"
46  #include "PARAMS.h"  #include "PARAMS.h"
47  #ifdef ALLOW_ADMTLM  #include "GRID.h"
48  # include "adcost.h"  
49  # include "g_cost.h"  #include "ctrl.h"
50    #include "optim.h"
51    
52    #ifdef ALLOW_COST
53    # include "cost.h"
54    #endif
55    #ifdef ALLOW_ECCO
56    # include "ecco_cost.h"
57    #else
58    # include "ctrl_weights.h"
59  #endif  #endif
60    
61  C     ======== Routine arguments ======================  c     == routine arguments ==
62  C     myThid - Thread number for this instance of the routine.  
63        integer myThid        logical first
64        _RL tmpstate (snx,sny,nsx,nsy,4*Nr+1)        integer mythid
65    
66    #ifndef EXCLUDE_CTRL_PACK
67    c     == local variables ==
68    
 #ifdef ALLOW_ADMTLM  
 C     ========= Local variables =========================  
69        integer i, j, k        integer i, j, k
70        integer bi, bj        integer ii
71          integer il
72          integer irec
73          integer ivartype
74          integer ictrlgrad
75    
76        DO bj=myByLo(myThid),myByHi(myThid)        integer cbuffindex
77         DO bi=myBxLo(myThid),myBxHi(myThid)        integer cunit
78          DO j=1,sNy  
79           DO i=1,sNx        character*(128) cfile
80            DO k=1,4*Nr        character*( 80) weighttype
81             g_objf_state_final(i,j,bi,bj,k) =  
82       &            tmpstate(i,j,bi,bj,k)        logical lxxadxx
           END DO  
            g_objf_state_final(i,j,bi,bj,4*Nr+1) =  
      &         tmpstate(i,j,bi,bj,4*Nr+1)  
          END DO  
         END DO  
        END DO  
       END DO  
 #endif  
83                
84    cgg(  Add OBCS mask names.
85    #ifdef ALLOW_OBCSN_CONTROL
86          integer        filenWetobcsnGlo(nr,nobcs)
87    #endif
88    #ifdef ALLOW_OBCSS_CONTROL
89          integer        filenWetobcssGlo(nr,nobcs)
90    #endif
91    #ifdef ALLOW_OBCSW_CONTROL
92          integer        filenWetobcswGlo(nr,nobcs)
93    #endif
94    #ifdef ALLOW_OBCSE_CONTROL
95          integer        filenWetobcseGlo(nr,nobcs)
96    #endif
97          integer iobcs
98    cgg)
99    
100    c     == external ==
101    
102          integer  ilnblnk
103          external ilnblnk
104    
105    c     == end of interface ==
106    
107    #ifndef ALLOW_ECCO_OPTIMIZATION
108          fmin       = 0. _d 0
109    #endif
110    
111    c--   Initialise
112          nbuffGlobal = 0
113    
114    cph-new(
115          yadprefix = 'g_'
116          nveccount = 0
117    cph-new)
118    
119    c--   Assign file names.
120    
121          call ctrl_set_fname(xx_theta_file, fname_theta, mythid)
122          call ctrl_set_fname(xx_salt_file, fname_salt, mythid)
123          call ctrl_set_fname(xx_hflux_file, fname_hflux, mythid)
124          call ctrl_set_fname(xx_sflux_file, fname_sflux, mythid)
125          call ctrl_set_fname(xx_tauu_file, fname_tauu, mythid)
126          call ctrl_set_fname(xx_tauv_file, fname_tauv, mythid)
127          call ctrl_set_fname(xx_atemp_file, fname_atemp, mythid)
128          call ctrl_set_fname(xx_aqh_file, fname_aqh, mythid)
129          call ctrl_set_fname(xx_precip_file, fname_precip, mythid)
130          call ctrl_set_fname(xx_swflux_file, fname_swflux, mythid)
131          call ctrl_set_fname(xx_swdown_file, fname_swdown, mythid)
132          call ctrl_set_fname(xx_uwind_file, fname_uwind, mythid)
133          call ctrl_set_fname(xx_vwind_file, fname_vwind, mythid)
134          call ctrl_set_fname(xx_obcsn_file, fname_obcsn, mythid)
135          call ctrl_set_fname(xx_obcss_file, fname_obcss, mythid)
136          call ctrl_set_fname(xx_obcsw_file, fname_obcsw, mythid)
137          call ctrl_set_fname(xx_obcse_file, fname_obcse, mythid)
138          call ctrl_set_fname(xx_diffkr_file, fname_diffkr, mythid)
139          call ctrl_set_fname(xx_kapgm_file, fname_kapgm, mythid)
140          call ctrl_set_fname(xx_tr1_file, fname_tr1, mythid)
141          call ctrl_set_fname(xx_sst_file, fname_sst, mythid)
142          call ctrl_set_fname(xx_sss_file, fname_sss, mythid)
143          call ctrl_set_fname(xx_hfacc_file, fname_hfacc, mythid)
144          call ctrl_set_fname(xx_efluxy_file, fname_efluxy, mythid)
145          call ctrl_set_fname(xx_efluxp_file, fname_efluxp, mythid)
146          call ctrl_set_fname(xx_bottomdrag_file, fname_bottomdrag, mythid)
147          call ctrl_set_fname(xx_edtaux_file, fname_edtaux, mythid)
148          call ctrl_set_fname(xx_edtauy_file, fname_edtauy, mythid)
149          call ctrl_set_fname(xx_uvel_file, fname_uvel, mythid)
150          call ctrl_set_fname(xx_vvel_file, fname_vvel, mythid)
151          call ctrl_set_fname(xx_etan_file, fname_etan, mythid)
152          call ctrl_set_fname(xx_relaxsst_file, fname_relaxsst, mythid)
153          call ctrl_set_fname(xx_relaxsss_file, fname_relaxsss, mythid)
154    
155    c--     Only the master thread will do I/O.
156            _BEGIN_MASTER( mythid )
157    
158    c *********************************************************************
159    
160          if ( first ) then
161    c     >>> Initialise control vector for optimcycle=0 <<<
162              lxxadxx   = .TRUE.
163              ictrlgrad = 1
164              write(cfile(1:128),'(4a,i4.4)')
165         &         ctrlname(1:9),'_',yctrlid(1:10),
166         &         yctrlposunpack(1:4), optimcycle
167              print *, 'ph-pack: unpacking ', ctrlname(1:9)
168          else
169    c     >>> Write gradient vector <<<
170              lxxadxx   = .FALSE.
171              ictrlgrad = 2
172              write(cfile(1:128),'(4a,i4.4)')
173         &         costname(1:9),'_',yctrlid(1:10),
174         &         yctrlposunpack(1:4), optimcycle
175              print *, 'ph-pack: unpacking ', costname(1:9)
176           endif
177    
178           call mdsfindunit( cunit, mythid )
179    
180    #ifdef ALLOW_ADMTLM
181    
182           write(cfile(1:128),'(a)') ' '
183           write(cfile,'(a,i4.4)')
184         &      'admtlm_vector.it', optimcycle
185           print *, 'ph-pack: unpacking ', cfile
186           open( cunit, file   = cfile,
187         &      status = 'old',
188         &      form   = 'unformatted',
189         &      access  = 'sequential'   )
190    
191    #else /* ndef ALLOW_ADMTLM */
192    
193              open( cunit, file   = cfile,
194         &         status = 'old',
195         &         form   = 'unformatted',
196         &         access  = 'sequential'   )
197    
198    c--       Header information.
199              read(cunit) filenvartype
200              read(cunit) filenvarlength
201              read(cunit) fileYctrlid
202              read(cunit) fileOptimCycle
203              read(cunit) filefc
204              read(cunit) fileIg
205              read(cunit) fileJg
206              read(cunit) filensx
207              read(cunit) filensy
208              read(cunit) (filenWetcGlobal(k),   k=1,nr)
209              read(cunit) (filenWetsGlobal(k),   k=1,nr)
210              read(cunit) (filenWetwGlobal(k),   k=1,nr)
211    #ifdef ALLOW_CTRL_WETV
212              read(cunit) (filenWetvGlobal(k),   k=1,nr)
213    #endif
214    
215    cgg(     Add OBCS mask information to the header.
216    #ifdef ALLOW_OBCSN_CONTROL
217              read(cunit) ((filenWetobcsnGlo(k,iobcs),
218         &         k=1,nr), iobcs= 1,nobcs)
219    #endif
220    #ifdef ALLOW_OBCSS_CONTROL
221              read(cunit) ((filenWetobcssGlo(k,iobcs),
222         &         k=1,nr), iobcs= 1,nobcs)
223    #endif
224    #ifdef ALLOW_OBCSW_CONTROL
225              read(cunit) ((filenWetobcswGlo(k,iobcs),
226         &         k=1,nr), iobcs= 1,nobcs)
227    #endif
228    #ifdef ALLOW_OBCSE_CONTROL
229              read(cunit) ((filenWetobcseGlo(k,iobcs),
230         &         k=1,nr), iobcs= 1,nobcs)
231    #endif
232    cgg)
233              read(cunit) (filencvarindex(i), i=1,maxcvars)
234              read(cunit) (filencvarrecs(i),  i=1,maxcvars)
235              read(cunit) (filencvarxmax(i),  i=1,maxcvars)
236              read(cunit) (filencvarymax(i),  i=1,maxcvars)
237              read(cunit) (filencvarnrmax(i), i=1,maxcvars)
238              read(cunit) (filencvargrd(i),   i=1,maxcvars)
239              read(cunit)
240    
241    c         Check file header info.
242    c
243              if ( filenvarlength .NE. nvarlength ) then
244                 print *, 'WARNING: wrong nvarlength ',
245         &            filenvarlength, nvarlength
246                 STOP 'in S/R ctrl_unpack'
247              else if ( filensx .NE. nsx .OR. filensy .NE. nsy ) then
248                 print *, 'WARNING: wrong nsx or nsy ',
249         &            filensx, nsx, filensy, nsy
250                 STOP 'in S/R ctrl_unpack'
251              endif
252              do k = 1, nr
253                 if ( filenWetcGlobal(k) .NE. nWetcGlobal(k) .OR.
254         &            filenWetsGlobal(k) .NE. nWetsGlobal(k) .OR.
255         &            filenWetwGlobal(k) .NE. nWetwGlobal(k) .OR.
256         &            filenWetvGlobal(k) .NE. nWetvGlobal(k)  ) then
257                    print *, 'WARNING: wrong nWet?Global for k = ', k
258                    STOP
259                 endif
260              end do
261    
262    cgg(   Lets also check the OBCS mask info in the header.
263    
264    #ifdef ALLOW_OBCSN_CONTROL
265           do iobcs = 1, nobcs
266             do k = 1, nr
267               if (filenWetobcsnGlo(k,iobcs) .NE.
268         &           nWetobcsnGlo(k,iobcs)) then
269                 print *, 'WARNING: OBCSN wrong nWet?Global for k = ', k
270                 STOP
271               endif
272             end do
273           end do
274    #endif
275    
276    #ifdef ALLOW_OBCSS_CONTROL
277           do iobcs = 1, nobcs
278             do k = 1, nr
279               if (filenWetobcssGlo(k,iobcs) .NE.
280         &           nWetobcssGlo(k,iobcs)) then
281                 print *, 'WARNING: OBCSS wrong nWet?Global for k = ', k
282                 STOP
283               endif
284             end do
285           end do
286    #endif
287    
288    #ifdef ALLOW_OBCSW_CONTROL
289           do iobcs = 1, nobcs
290             do k = 1, nr
291               if (filenWetobcswGlo(k,iobcs) .NE.
292         &           nWetobcswGlo(k,iobcs)) then
293                 print *, 'WARNING: OBCSW wrong nWet?Global for k = ', k
294                 STOP
295               endif
296             end do
297           end do
298    #endif
299    
300    #ifdef ALLOW_OBCSE_CONTROL
301           do iobcs = 1, nobcs
302             do k = 1, nr
303               if (filenWetobcseGlo(k,iobcs) .NE.
304         &           nWetobcseGlo(k,iobcs)) then
305                 print *, 'WARNING: OBCSE wrong nWet?Global for k = ', k
306                 STOP
307               endif
308             end do
309           end do
310    #endif
311    cgg)  End OBCS mask check.
312    
313    #endif /* ndef ALLOW_ADMTLM */
314    
315    c----------------------------------------------------------------------
316    
317    #ifdef ALLOW_THETA0_CONTROL
318              ivartype = 1
319              write(weighttype(1:80),'(80a)') ' '
320              write(weighttype(1:80),'(a)') "wtheta"
321              call ctrl_set_unpack_xyz( lxxadxx, cunit, ivartype,
322         &         fname_theta(ictrlgrad), "maskCtrlC",
323         &         weighttype, wtheta, nwetcglobal, mythid)
324    #endif
325    
326    #ifdef ALLOW_SALT0_CONTROL
327              ivartype = 2
328              write(weighttype(1:80),'(80a)') ' '
329              write(weighttype(1:80),'(a)') "wsalt"
330              call ctrl_set_unpack_xyz( lxxadxx, cunit, ivartype,
331         &         fname_salt(ictrlgrad), "maskCtrlC",
332         &         weighttype, wsalt, nwetcglobal, mythid)
333    #endif
334    
335    #if (defined (ALLOW_HFLUX_CONTROL) || defined (ALLOW_HFLUX0_CONTROL))
336              ivartype    = 3
337              write(weighttype(1:80),'(80a)') ' '
338              write(weighttype(1:80),'(a)') "whflux"
339              call ctrl_set_unpack_xy( lxxadxx, cunit, ivartype,
340         &         fname_hflux(ictrlgrad), "maskCtrlC",
341         &         weighttype, nwetcglobal, mythid)
342    #endif
343    
344    #if (defined (ALLOW_SFLUX_CONTROL) || defined (ALLOW_SFLUX0_CONTROL))
345              ivartype = 4
346              write(weighttype(1:80),'(80a)') ' '
347              write(weighttype(1:80),'(a)') "wsflux"
348              call ctrl_set_unpack_xy( lxxadxx, cunit, ivartype,
349         &         fname_sflux(ictrlgrad), "maskCtrlC",
350         &         weighttype, nwetcglobal, mythid)
351    #endif
352    
353    #if (defined (ALLOW_USTRESS_CONTROL) || defined (ALLOW_TAUU0_CONTROL))
354              ivartype = 5
355              write(weighttype(1:80),'(80a)') ' '
356              write(weighttype(1:80),'(a)') "wtauu"
357              call ctrl_set_unpack_xy( lxxadxx, cunit, ivartype,
358         &         fname_tauu(ictrlgrad), "maskCtrlW",
359         &         weighttype, nwetwglobal, mythid)
360    #endif
361    
362    #if (defined (ALLOW_VSTRESS_CONTROL) || defined (ALLOW_TAUV0_CONTROL))
363              ivartype = 6
364              write(weighttype(1:80),'(80a)') ' '
365              write(weighttype(1:80),'(a)') "wtauv"
366              call ctrl_set_unpack_xy( lxxadxx, cunit, ivartype,
367         &         fname_tauv(ictrlgrad), "maskCtrlS",
368         &         weighttype, nwetsglobal, mythid)
369    #endif
370    
371    #ifdef ALLOW_ATEMP_CONTROL
372              ivartype    = 7
373              write(weighttype(1:80),'(80a)') ' '
374              write(weighttype(1:80),'(a)') "watemp"
375              call ctrl_set_unpack_xy( lxxadxx, cunit, ivartype,
376         &         fname_atemp(ictrlgrad), "maskCtrlC",
377         &         weighttype, nwetcglobal, mythid)
378    #endif
379    
380    #ifdef ALLOW_AQH_CONTROL
381              ivartype    = 8
382              write(weighttype(1:80),'(80a)') ' '
383              write(weighttype(1:80),'(a)') "waqh"
384              call ctrl_set_unpack_xy( lxxadxx, cunit, ivartype,
385         &         fname_aqh(ictrlgrad), "maskCtrlC",
386         &         weighttype, nwetcglobal, mythid)
387    #endif
388    
389    #ifdef ALLOW_UWIND_CONTROL
390              ivartype    = 9
391              write(weighttype(1:80),'(80a)') ' '
392              write(weighttype(1:80),'(a)') "wuwind"
393              call ctrl_set_unpack_xy( lxxadxx, cunit, ivartype,
394         &         fname_uwind(ictrlgrad), "maskCtrlC",
395         &         weighttype, nwetcglobal, mythid)
396    #endif
397    
398    #ifdef ALLOW_VWIND_CONTROL
399              ivartype    = 10
400              write(weighttype(1:80),'(80a)') ' '
401              write(weighttype(1:80),'(a)') "wvwind"
402              call ctrl_set_unpack_xy( lxxadxx, cunit, ivartype,
403         &         fname_vwind(ictrlgrad), "maskCtrlC",
404         &         weighttype, nwetcglobal, mythid)
405    #endif
406    
407    #ifdef ALLOW_OBCSN_CONTROL
408              ivartype    = 11
409              write(weighttype(1:80),'(80a)') ' '
410              write(weighttype(1:80),'(a)') "wobcsn"
411              call ctrl_set_unpack_xz(
412         &         cunit, ivartype, fname_obcsn(ictrlgrad), "maskobcsn",
413         &         weighttype, wobcsn, nWetobcsnGlo, mythid)
414    #endif
415    
416    #ifdef ALLOW_OBCSS_CONTROL
417              ivartype    = 12
418              write(weighttype(1:80),'(80a)') ' '
419              write(weighttype(1:80),'(a)') "wobcss"
420              call ctrl_set_unpack_xz(
421         &         cunit, ivartype, fname_obcss(ictrlgrad), "maskobcss",
422         &         weighttype, wobcss, nWetobcssGlo, mythid)
423    #endif
424    
425    #ifdef ALLOW_OBCSW_CONTROL
426              ivartype    = 13
427              write(weighttype(1:80),'(80a)') ' '
428              write(weighttype(1:80),'(a)') "wobcsw"
429              call ctrl_set_unpack_yz(
430         &         cunit, ivartype, fname_obcsw(ictrlgrad), "maskobcsw",
431         &         weighttype, wobcsw, nWetobcswGlo, mythid)
432    #endif
433    
434    #ifdef ALLOW_OBCSE_CONTROL
435              ivartype    = 14
436              write(weighttype(1:80),'(80a)') ' '
437              write(weighttype(1:80),'(a)') "wobcse"
438              call ctrl_set_unpack_yz(
439         &         cunit, ivartype, fname_obcse(ictrlgrad), "maskobcse",
440         &         weighttype, wobcse, nWetobcseGlo, mythid)
441    #endif
442    
443    #ifdef ALLOW_DIFFKR_CONTROL
444              ivartype    = 15
445              write(weighttype(1:80),'(80a)') ' '
446              write(weighttype(1:80),'(a)') "wdiffkr"
447              call ctrl_set_unpack_xyz( lxxadxx, cunit, ivartype,
448         &         fname_diffkr(ictrlgrad), "maskCtrlC",
449         &         weighttype, wunit, nwetcglobal, mythid)
450    #endif
451    
452    #ifdef ALLOW_KAPGM_CONTROL
453              ivartype    = 16
454              write(weighttype(1:80),'(80a)') ' '
455              write(weighttype(1:80),'(a)') "wkapgm"
456              call ctrl_set_unpack_xyz( lxxadxx, cunit, ivartype,
457         &         fname_kapgm(ictrlgrad), "maskCtrlC",
458         &         weighttype, wunit, nwetcglobal, mythid)
459    #endif
460    
461    #ifdef ALLOW_TR10_CONTROL
462              ivartype    = 17
463              write(weighttype(1:80),'(80a)') ' '
464              write(weighttype(1:80),'(a)') "wtr1"
465              call ctrl_set_unpack_xyz( lxxadxx, cunit, ivartype,
466         &         fname_tr1(ictrlgrad), "maskCtrlC",
467         &         weighttype, wunit, nwetcglobal, mythid)
468    #endif
469    
470    #if (defined (ALLOW_SST_CONTROL) || defined (ALLOW_SST0_CONTROL))
471              ivartype    = 18
472              write(weighttype(1:80),'(80a)') ' '
473              write(weighttype(1:80),'(a)') "wsst"
474              call ctrl_set_unpack_xy( lxxadxx, cunit, ivartype,
475         &         fname_sst(ictrlgrad), "maskCtrlC",
476         &         weighttype, nwetcglobal, mythid)
477    #endif
478    
479    #if (defined (ALLOW_SSS_CONTROL) || defined (ALLOW_SSS0_CONTROL))
480              ivartype    = 19
481              write(weighttype(1:80),'(80a)') ' '
482              write(weighttype(1:80),'(a)') "wsss"
483              call ctrl_set_unpack_xy( lxxadxx, cunit, ivartype,
484         &         fname_sss(ictrlgrad), "maskCtrlC",
485         &         weighttype, nwetcglobal, mythid)
486    #endif
487    
488    #ifdef ALLOW_HFACC_CONTROL
489              ivartype    = 20
490              write(weighttype(1:80),'(80a)') ' '
491              write(weighttype(1:80),'(a)') "whfacc"
492    # ifdef ALLOW_HFACC3D_CONTROL
493              call ctrl_set_unpack_xyz( lxxadxx, cunit, ivartype,
494         &         fname_hfacc(ictrlgrad), "maskCtrlC",
495         &         wunit, nwetcglobal, mythid)
496    # else
497              call ctrl_set_unpack_xy( lxxadxx, cunit, ivartype,
498         &         fname_hfacc(ictrlgrad), "maskCtrlC",
499         &         weighttype, weighttype, nwetcglobal, mythid)
500    # endif
501    #endif
502    
503    #ifdef ALLOW_EFLUXY0_CONTROL
504              ivartype    = 21
505              write(weighttype(1:80),'(80a)') ' '
506              write(weighttype(1:80),'(a)') "wefluxy0"
507              call ctrl_set_unpack_xyz( lxxadxx, cunit, ivartype,
508         &         fname_efluxy(ictrlgrad), "maskCtrlS",
509         &         weighttype, wefluxy, nwetsglobal, mythid)
510    #endif
511    
512    #ifdef ALLOW_EFLUXP0_CONTROL
513              ivartype    = 22
514              write(weighttype(1:80),'(80a)') ' '
515              write(weighttype(1:80),'(a)') "wefluxp0"
516              call ctrl_set_unpack_xyz( lxxadxx, cunit, ivartype,
517         &         fname_efluxp(ictrlgrad), "maskhFacV",
518         &         weighttype, wefluxp, nwetvglobal, mythid)
519    #endif
520    
521    #ifdef ALLOW_BOTTOMDRAG_CONTROL
522              ivartype    = 23
523              write(weighttype(1:80),'(80a)') ' '
524              write(weighttype(1:80),'(a)') "wbottomdrag"
525              call ctrl_set_unpack_xy( lxxadxx, cunit, ivartype,
526         &         fname_bottomdrag(ictrlgrad), "maskCtrlC",
527         &         weighttype, nwetcglobal, mythid)
528    #endif
529    
530    #ifdef ALLOW_EDTAUX_CONTROL
531              ivartype    = 25
532              write(weighttype(1:80),'(80a)') ' '
533              write(weighttype(1:80),'(a)') "wedtaux"
534              call ctrl_set_unpack_xyz( lxxadxx, cunit, ivartype,
535         &         fname_edtaux(ictrlgrad), "maskCtrlW",
536         &         weighttype, wunit, nwetwglobal, mythid)
537    #endif
538    
539    #ifdef ALLOW_EDTAUY_CONTROL
540              ivartype    = 26
541              write(weighttype(1:80),'(80a)') ' '
542              write(weighttype(1:80),'(a)') "wedtauy"
543              call ctrl_set_unpack_xyz( lxxadxx, cunit, ivartype,
544         &         fname_edtauy(ictrlgrad), "maskCtrlS",
545         &         weighttype, wunit, nwetsglobal, mythid)
546    #endif
547    
548    #ifdef ALLOW_UVEL0_CONTROL
549              ivartype = 27
550              write(weighttype(1:80),'(80a)') ' '
551              write(weighttype(1:80),'(a)') "wuvel"
552              call ctrl_set_unpack_xyz( lxxadxx, cunit, ivartype,
553         &         fname_uvel(ictrlgrad), "maskCtrlW",
554         &         weighttype, wunit, nwetwglobal, mythid)
555    #endif
556    
557    #ifdef ALLOW_VVEL0_CONTROL
558              ivartype = 28
559              write(weighttype(1:80),'(80a)') ' '
560              write(weighttype(1:80),'(a)') "wvvel"
561              call ctrl_set_unpack_xyz( lxxadxx, cunit, ivartype,
562         &         fname_vvel(ictrlgrad), "maskCtrlS",
563         &         weighttype, wunit, nwetsglobal, mythid)
564    #endif
565    
566    #ifdef ALLOW_ETAN0_CONTROL
567              ivartype = 29
568              write(weighttype(1:80),'(80a)') ' '
569              write(weighttype(1:80),'(a)') "wetan"
570              call ctrl_set_unpack_xy( lxxadxx, cunit, ivartype,
571         &         fname_etan(ictrlgrad), "maskCtrlC",
572         &         weighttype, nwetcglobal, mythid)
573    #endif
574    
575    #ifdef ALLOW_RELAXSST_CONTROL
576              ivartype = 30
577              write(weighttype(1:80),'(80a)') ' '
578              write(weighttype(1:80),'(a)') "wrelaxsst"
579              call ctrl_set_unpack_xy( lxxadxx, cunit, ivartype,
580         &         fname_relaxsst(ictrlgrad), "maskCtrlC",
581         &         weighttype, nwetcglobal, mythid)
582    #endif
583    
584    #ifdef ALLOW_RELAXSSS_CONTROL
585              ivartype = 31
586              write(weighttype(1:80),'(80a)') ' '
587              write(weighttype(1:80),'(a)') "wrelaxsss"
588              call ctrl_set_unpack_xy( lxxadxx, cunit, ivartype,
589         &         fname_relaxsss(ictrlgrad), "maskCtrlC",
590         &         weighttype, nwetcglobal, mythid)
591    #endif
592    
593    #ifdef ALLOW_PRECIP_CONTROL
594              ivartype    = 32
595              write(weighttype(1:80),'(80a)') ' '
596              write(weighttype(1:80),'(a)') "wprecip"
597              call ctrl_set_unpack_xy( lxxadxx, cunit, ivartype,
598         &         fname_precip(ictrlgrad), "maskCtrlC",
599         &         weighttype, nwetcglobal, mythid)
600    #endif
601    
602    #ifdef ALLOW_SWFLUX_CONTROL
603              ivartype    = 33
604              write(weighttype(1:80),'(80a)') ' '
605              write(weighttype(1:80),'(a)') "wswflux"
606              call ctrl_set_unpack_xy( lxxadxx, cunit, ivartype,
607         &         fname_swflux(ictrlgrad), "maskCtrlC",
608         &         weighttype, nwetcglobal, mythid)
609    #endif
610    
611    #ifdef ALLOW_SWDOWN_CONTROL
612              ivartype    = 34
613              write(weighttype(1:80),'(80a)') ' '
614              write(weighttype(1:80),'(a)') "wswdown"
615              call ctrl_set_unpack_xy( lxxadxx, cunit, ivartype,
616         &         fname_swdown(ictrlgrad), "maskCtrlC",
617         &         weighttype, nwetcglobal, mythid)
618    #endif
619    
620             close ( cunit )
621    
622          _END_MASTER( mythid )
623    
624    #endif /* EXCLUDE_CTRL_PACK */
625    
626          return
627        end        end
628    

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

  ViewVC Help
Powered by ViewVC 1.1.22