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

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

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

revision 1.12 by heimbach, Thu Nov 6 22:05:08 2003 UTC revision 1.15 by mlosch, Fri Dec 3 00:48:57 2004 UTC
# Line 44  c     == global variables == Line 44  c     == global variables ==
44    
45  #include "ctrl.h"  #include "ctrl.h"
46  #include "cost.h"  #include "cost.h"
47    #include "optim.h"
48    
49  #ifdef ALLOW_ECCO  #ifdef ALLOW_ECCO
50  # include "ecco_cost.h"  # include "ecco_cost.h"
# Line 51  c     == global variables == Line 52  c     == global variables ==
52  # include "ctrl_weights.h"  # include "ctrl_weights.h"
53  #endif  #endif
54    
 #ifdef ALLOW_ECCO_OPTIMIZATION  
 # include "optim.h"  
 #endif  
   
55  c     == routine arguments ==  c     == routine arguments ==
56    
57        logical first        logical first
# Line 63  c     == routine arguments == Line 60  c     == routine arguments ==
60  #ifndef EXCLUDE_CTRL_PACK  #ifndef EXCLUDE_CTRL_PACK
61  c     == local variables ==  c     == local variables ==
62    
 #ifndef ALLOW_ECCO_OPTIMIZATION  
       integer optimcycle  
       _RL    fmin  
 #endif  
   
63        _RL    fcloc        _RL    fcloc
64    
65        integer i, j, k        integer i, j, k
# Line 97  c     == external == Line 89  c     == external ==
89  c     == end of interface ==  c     == end of interface ==
90    
91  #ifndef ALLOW_ECCO_OPTIMIZATION  #ifndef ALLOW_ECCO_OPTIMIZATION
       optimcycle = 0  
92        fmin       = 0. _d 0        fmin       = 0. _d 0
93  #endif  #endif
94    
# Line 107  c--   Tiled files are used. Line 98  c--   Tiled files are used.
98  c--   Initialise adjoint variables on active files.  c--   Initialise adjoint variables on active files.
99        ladinit = .false.        ladinit = .false.
100    
101    c--   Initialise global buffer index
102          nbuffglobal = 0
103    
104  c--   Assign file names.  c--   Assign file names.
105    
106        call ctrl_set_fname(xx_theta_file, fname_theta, mythid)        call ctrl_set_fname(xx_theta_file, fname_theta, mythid)
# Line 137  c Line 131  c
131  c--     Only the master thread will do I/O.  c--     Only the master thread will do I/O.
132        _BEGIN_MASTER( mythid )        _BEGIN_MASTER( mythid )
133    
134        if ( first .AND. optimcycle .EQ. 0 ) then        if ( first ) then
135  c     >>> Initialise control vector for optimcycle=0 <<<  c     >>> Initialise control vector for optimcycle=0 <<<
136            lxxadxx   = .TRUE.            lxxadxx   = .TRUE.
137            ictrlgrad = 1            ictrlgrad = 1
138            fcloc     = fmin            fcloc     = fmin
139            write(cfile(1:128),'(4a,i4.4)')            write(cfile(1:128),'(4a,i4.4)')
140       &      ctrlname(1:9),'_',yctrlid(1:10),'.opt', optimcycle       &         ctrlname(1:9),'_',yctrlid(1:10),
141         &         yctrlpospack, optimcycle
142              print *, 'ph-pack: unpacking ', ctrlname(1:9)
143        else        else
144  c     >>> Write gradient vector <<<  c     >>> Write gradient vector <<<
145            lxxadxx   = .FALSE.            lxxadxx   = .FALSE.
146            ictrlgrad = 2            ictrlgrad = 2
147            fcloc     = fc            fcloc     = fc
148            write(cfile(1:128),'(4a,i4.4)')            write(cfile(1:128),'(4a,i4.4)')
149       &    costname(1:9),'_',yctrlid(1:10),'.opt', optimcycle       &         costname(1:9),'_',yctrlid(1:10),
150         &         yctrlpospack, optimcycle
151              print *, 'ph-pack: unpacking ', costname(1:9)
152         endif         endif
153    
154         call mdsfindunit( cunit, mythid )         call mdsfindunit( cunit, mythid )
# Line 164  c--       Header information. Line 162  c--       Header information.
162            write(cunit) nvarlength            write(cunit) nvarlength
163            write(cunit) yctrlid            write(cunit) yctrlid
164            write(cunit) optimCycle            write(cunit) optimCycle
165            write(cunit) fcloc            write(cunit) fc
166            write(cunit) 1  C     place holder of obsolete variable iG
           write(cunit) 1  
167            write(cunit) 1            write(cunit) 1
168    C     place holder of obsolete variable jG
169            write(cunit) 1            write(cunit) 1
170              write(cunit) nsx
171              write(cunit) nsy
172            write(cunit) (nWetcGlobal(k), k=1,nr)            write(cunit) (nWetcGlobal(k), k=1,nr)
173            write(cunit) (nWetsGlobal(k), k=1,nr)            write(cunit) (nWetsGlobal(k), k=1,nr)
174            write(cunit) (nWetwGlobal(k), k=1,nr)            write(cunit) (nWetwGlobal(k), k=1,nr)
# Line 190  c--       Header information. Line 190  c--       Header information.
190  #endif  #endif
191            write(cunit) (ncvarindex(i), i=1,maxcvars)            write(cunit) (ncvarindex(i), i=1,maxcvars)
192            write(cunit) (ncvarrecs(i),  i=1,maxcvars)            write(cunit) (ncvarrecs(i),  i=1,maxcvars)
193            write(cunit) (nx,  i=1,maxcvars)            write(cunit) (ncvarxmax(i),  i=1,maxcvars)
194            write(cunit) (ny,  i=1,maxcvars)            write(cunit) (ncvarymax(i),  i=1,maxcvars)
195            write(cunit) (ncvarnrmax(i), i=1,maxcvars)            write(cunit) (ncvarnrmax(i), i=1,maxcvars)
196            write(cunit) (ncvargrd(i),   i=1,maxcvars)            write(cunit) (ncvargrd(i),   i=1,maxcvars)
197            write(cunit)            write(cunit)

Legend:
Removed from v.1.12  
changed lines
  Added in v.1.15

  ViewVC Help
Powered by ViewVC 1.1.22