/[MITgcm]/MITgcm/optim/optim_writedata.F
ViewVC logotype

Diff of /MITgcm/optim/optim_writedata.F

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

revision 1.7 by dfer, Tue Jan 15 16:36:32 2008 UTC revision 1.12 by gforget, Tue Jun 2 14:49:13 2015 UTC
# Line 1  Line 1 
1    
2    c ECCO_CPPOPTIONS used to affect maxcvars
3    c and def ALLOW_OBCSN_CONTROL etc (OBCS masks etc)
4    c#include ECCO_CPPOPTIONS.h
5    
6    c CTRL_OPTIONS affects maxcvars and may def
7    c ALLOW_OBCSN_CONTROL etc (OBCS masks etc)
8    #include "CTRL_OPTIONS.h"
9    
10        subroutine optim_writedata(        subroutine optim_writedata(
11       I                       nn,       I                       nn,
12       I                       dfile,       I                       dfile,
# Line 30  c     == global variables == Line 38  c     == global variables ==
38    
39  #include "EEPARAMS.h"  #include "EEPARAMS.h"
40  #include "SIZE.h"  #include "SIZE.h"
 cgg   Include ECCO_CPPOPTIONS because the ecco_ctrl,cost files have headers with  
 cgg   options for OBCS masks.  
 #include "ECCO_CPPOPTIONS.h"  
   
41  #include "ctrl.h"  #include "ctrl.h"
42  #include "optim.h"  #include "optim.h"
43  #include "minimization.h"  #include "minimization.h"
# Line 151  c--   Write the header. Line 155  c--   Write the header.
155  #ifdef ALLOW_CTRL_WETV  #ifdef ALLOW_CTRL_WETV
156        write( funit ) (nWetvGlobal(k), k=1,nr)        write( funit ) (nWetvGlobal(k), k=1,nr)
157  #endif  #endif
158    #ifdef ALLOW_SHIFWFLX_CONTROL
159          write(funit) (nWetiGlobal(k),   k=1,nr)
160    c     write(funit) nWetiGlobal(1)
161    #endif
162    
163  cgg(    Add OBCS Mask information into the header section for optimization.  cgg(    Add OBCS Mask information into the header section for optimization.
164  #ifdef ALLOW_OBCSN_CONTROL  #ifdef ALLOW_OBCSN_CONTROL
# Line 180  c--         Write the data. Line 188  c--         Write the data.
188        do icvar = 1,maxcvars        do icvar = 1,maxcvars
189           if ( ncvarindex(icvar) .ne. -1 ) then           if ( ncvarindex(icvar) .ne. -1 ) then
190              do icvrec = 1,ncvarrecs(icvar)              do icvrec = 1,ncvarrecs(icvar)
191                 do bj = 1,nsy  cph               do bj = 1,nsy
192                    do bi = 1,nsx  cph                  do bi = 1,nsx
193                       write( funit ) ncvarindex(icvar)                       write( funit ) ncvarindex(icvar)
194                       write( funit ) bj                       write( funit ) bj
195                       write( funit ) bi                       write( funit ) bi
# Line 195  c--         Write the data. Line 203  c--         Write the data.
203                             cbuffindex = nWetwGlobal(k)                             cbuffindex = nWetwGlobal(k)
204                          else if (ncvargrd(icvar) .eq. 'v') then                          else if (ncvargrd(icvar) .eq. 'v') then
205                             cbuffindex = nWetvGlobal(k)                             cbuffindex = nWetvGlobal(k)
206    #ifdef ALLOW_SHIFWFLX_CONTROL
207                            else if (ncvargrd(icvar) .eq. 'i') then
208                               cbuffindex = nWetiGlobal(k)
209    #endif
210  cgg(   O.B. points have the grid mask "m".  cgg(   O.B. points have the grid mask "m".
211                          else if (ncvargrd(icvar) .eq. 'm') then                          else if (ncvargrd(icvar) .eq. 'm') then
212  cgg    From "icvrec", calculate what iobcs must be.  cgg    From "icvrec", calculate what iobcs must be.
# Line 227  cgg) Line 238  cgg)
238                          if (cbuffindex .gt. 0) then                          if (cbuffindex .gt. 0) then
239                             do icvcomp = 1,cbuffindex                             do icvcomp = 1,cbuffindex
240                                cbuff(icvcomp) = vv(icvoffset + icvcomp)                                cbuff(icvcomp) = vv(icvoffset + icvcomp)
241  cgg( Right now, the changes to the open boundary velocities are not balanced.  c     If you want to optimize with respect to just O.B. T and S
242  cgg( The model will crash due to physical reasons.  c     uncomment the next two lines.
243  cgg( However, we can optimize with respect to just O.B. T and S if the  c                              if (iobcs .eq. 3) cbuff(icvcomp)=0.
244  cgg( next two lines are uncommented.  c                              if (iobcs .eq. 4) cbuff(icvcomp)=0.
 cgg                              if (iobcs .eq. 3) cbuff(icvcomp)=0.  
 cgg                              if (iobcs .eq. 4) cbuff(icvcomp)=0.  
245                             enddo                             enddo
246                             write( funit ) cbuffindex                             write( funit ) cbuffindex
247                             write( funit ) k                             write( funit ) k
# Line 240  cgg                              if (iob Line 249  cgg                              if (iob
249                             icvoffset = icvoffset + cbuffindex                             icvoffset = icvoffset + cbuffindex
250                          endif                          endif
251                       enddo                       enddo
252                    enddo  cph                  enddo
253                 enddo  cph               enddo
254              enddo              enddo
255           endif           endif
256        enddo        enddo

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

  ViewVC Help
Powered by ViewVC 1.1.22