/[MITgcm]/MITgcm/pkg/grdchk/grdchk_main.F
ViewVC logotype

Diff of /MITgcm/pkg/grdchk/grdchk_main.F

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

revision 1.8 by heimbach, Tue Jun 24 16:08:45 2003 UTC revision 1.9 by heimbach, Thu Oct 2 21:30:22 2003 UTC
# Line 78  c     == global variables == Line 78  c     == global variables ==
78  #include "PARAMS.h"  #include "PARAMS.h"
79  #include "grdchk.h"  #include "grdchk.h"
80  #include "cost.h"  #include "cost.h"
81    #ifdef ALLOW_TANGENTLINEAR_RUN
82    #include "g_cost.h"
83    #endif
84    
85  C     !INPUT/OUTPUT PARAMETERS:  C     !INPUT/OUTPUT PARAMETERS:
86  c     == routine arguments ==  c     == routine arguments ==
# Line 122  c     == local variables == Line 125  c     == local variables ==
125        _RL tmpplot2(1-olx:snx+olx,1-oly:sny+oly,nr,nsx,nsy)        _RL tmpplot2(1-olx:snx+olx,1-oly:sny+oly,nr,nsx,nsy)
126        _RL tmpplot3(1-olx:snx+olx,1-oly:sny+oly,nr,nsx,nsy)        _RL tmpplot3(1-olx:snx+olx,1-oly:sny+oly,nr,nsx,nsy)
127    
 #ifdef ALLOW_TANGENTLINEAR_RUN  
       _RL     g_fc  
       common /g_cost_r/ g_fc  
 #endif  
   
128  c     == end of interface ==  c     == end of interface ==
129  CEOP  CEOP
130    
# Line 149  cph   Gradient via adjoint has already b Line 147  cph   Gradient via adjoint has already b
147  cph   and so has unperturbed cost function,  cph   and so has unperturbed cost function,
148  cph   assuming all xx_ fields are initialised to zero.  cph   assuming all xx_ fields are initialised to zero.
149    
       fcref = fc  
150        ierr_grdchk = 0        ierr_grdchk = 0
151    cphadmtlm(
152          fcref = fc
153    cphadmtlm      fcref = objf_state_final(45,4,1,1)
154    cphadmtlm)
155    
156          print *, 'ph-check fcref = ', fcref
157    
158        do bj = jtlo, jthi        do bj = jtlo, jthi
159           do bi = itlo, ithi           do bi = itlo, ithi
# Line 241  c-- Line 244  c--
244  c--   2. perform tangent linear run  c--   2. perform tangent linear run
245              mytime = starttime              mytime = starttime
246              myiter = niter0              myiter = niter0
247    cphadmtlm(
248              g_fc = 0.              g_fc = 0.
249    cphadmtlm            do j=1,sny
250    cphadmtlm               do i=1,snx
251    cphadmtlm                  g_objf_state_final(i,j,1,1) = 0.
252    cphadmtlm               enddo
253    cphadmtlm            enddo
254    cphadmtlm)
255              call g_the_main_loop( mytime, myiter, mythid )              call g_the_main_loop( mytime, myiter, mythid )
256    cphadmtlm(
257              ftlxxmemo = g_fc              ftlxxmemo = g_fc
258    cphadmtlm            ftlxxmemo = g_objf_state_final(45,4,1,1)
259    cphadmtlm)
260              _BARRIER              _BARRIER
261  c--  c--
262  c--   3. reset control vector  c--   3. reset control vector
# Line 281  c--   forward run with perturbed control Line 294  c--   forward run with perturbed control
294              mytime = starttime              mytime = starttime
295              myiter = niter0              myiter = niter0
296              call the_main_loop( mytime, myiter, mythid )              call the_main_loop( mytime, myiter, mythid )
297    cphadmtlm(
298              fcpertplus = fc              fcpertplus = fc
299    cphadmtlm            fcpertplus = objf_state_final(45,4,1,1)
300    cphadmtlm)
301              _BARRIER              _BARRIER
302                                        
303  c--   Reset control vector.  c--   Reset control vector.

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.9

  ViewVC Help
Powered by ViewVC 1.1.22