/[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.20 by heimbach, Sat Mar 24 02:25:29 2007 UTC revision 1.22 by heimbach, Fri Jul 27 22:18:57 2007 UTC
# Line 81  c     == global variables == Line 81  c     == global variables ==
81  #include "PARAMS.h"  #include "PARAMS.h"
82  #include "grdchk.h"  #include "grdchk.h"
83  #include "cost.h"  #include "cost.h"
84    #include "ctrl.h"
85  #ifdef ALLOW_TANGENTLINEAR_RUN  #ifdef ALLOW_TANGENTLINEAR_RUN
86  #include "g_cost.h"  #include "g_cost.h"
87  #endif  #endif
# Line 156  cph   and so has unperturbed cost functi Line 157  cph   and so has unperturbed cost functi
157  cph   assuming all xx_ fields are initialised to zero.  cph   assuming all xx_ fields are initialised to zero.
158    
159        ierr_grdchk = 0        ierr_grdchk = 0
160  cphadmtlm(  #ifdef ALLOW_ADMTLM
161          fcref = objf_state_final(idep,jdep,1,1,1)
162    #else
163        fcref = fc        fcref = fc
164  cphadmtlm      fcref = objf_state_final(45,4,1,1,1)  #endif
 cphadmtlm)  
165    
166        print *, 'ph-check fcref = ', fcref        print *, 'ph-check fcref = ', fcref
167    
# Line 247  c--   (B): Get gradient component g_fc f Line 249  c--   (B): Get gradient component g_fc f
249  c******************************************************  c******************************************************
250  c--  c--
251  c--   1. perturb control vector component: xx(i)=1.  c--   1. perturb control vector component: xx(i)=1.
252                ftlxxmemo = 0.
253    
254              if ( myProcId .EQ. grdchkwhichproc .AND.              if ( myProcId .EQ. grdchkwhichproc .AND.
255       &           ierr .EQ. 0 ) then       &           ierr .EQ. 0 ) then
# Line 263  c-- Line 266  c--
266  c--   2. perform tangent linear run  c--   2. perform tangent linear run
267              mytime = starttime              mytime = starttime
268              myiter = niter0              myiter = niter0
269  cphadmtlm(  #ifdef ALLOW_ADMTLM
270                do k=1,4*Nr+1
271                 do j=1,sny
272                  do i=1,snx
273                   g_objf_state_final(i,j,1,1,k) = 0.
274                  enddo
275                 enddo
276                enddo
277    #else
278              g_fc = 0.              g_fc = 0.
279  cphadmtlm            do j=1,sny  #endif
280  cphadmtlm               do i=1,snx  
 cphadmtlm                  g_objf_state_final(i,j,1,1,1) = 0.  
 cphadmtlm                  g_objf_state_final(i,j,1,1,2) = 0.  
 cphadmtlm               enddo  
 cphadmtlm            enddo  
 cphadmtlm)  
281              call g_the_main_loop( mytime, myiter, mythid )              call g_the_main_loop( mytime, myiter, mythid )
 cphadmtlm(  
             ftlxxmemo = g_fc  
 cphadmtlm            ftlxxmemo = g_objf_state_final(45,4,1,1,1)  
 cphadmtlm)  
282              _BARRIER              _BARRIER
283    #ifdef ALLOW_ADMTLM
284                ftlxxmemo = g_objf_state_final(idep,jdep,1,1,1)
285    #else
286                ftlxxmemo = g_fc
287    #endif
288    
289  c--  c--
290  c--   3. reset control vector  c--   3. reset control vector
291              if ( myProcId .EQ. grdchkwhichproc .AND.              if ( myProcId .EQ. grdchkwhichproc .AND.
# Line 314  c--   forward run with perturbed control Line 322  c--   forward run with perturbed control
322              mytime = starttime              mytime = starttime
323              myiter = niter0              myiter = niter0
324              call the_main_loop( mytime, myiter, mythid )              call the_main_loop( mytime, myiter, mythid )
325  cphadmtlm(  #ifdef ALLOW_ADMTLM
326                fcpertplus = objf_state_final(idep,jdep,1,1,1)
327    #else
328              fcpertplus = fc              fcpertplus = fc
329  cphadmtlm            fcpertplus = objf_state_final(45,4,1,1,1)  #endif
 cphadmtlm)  
330              print *, 'ph-check fcpertplus = ', fcpertplus              print *, 'ph-check fcpertplus = ', fcpertplus
331              _BARRIER              _BARRIER
332                                        
# Line 355  c--   forward run with perturbed control Line 364  c--   forward run with perturbed control
364                 myiter = niter0                 myiter = niter0
365                 call the_main_loop( mytime, myiter, mythid )                 call the_main_loop( mytime, myiter, mythid )
366                 _BARRIER                 _BARRIER
367    #ifdef ALLOW_ADMTLM
368                   fcpertminus = objf_state_final(idep,jdep,1,1,1)
369    #else
370                 fcpertminus = fc                 fcpertminus = fc
371    #endif
372                                        
373  c--   Reset control vector.  c--   Reset control vector.
374                 if ( myProcId .EQ. grdchkwhichproc .AND.                 if ( myProcId .EQ. grdchkwhichproc .AND.

Legend:
Removed from v.1.20  
changed lines
  Added in v.1.22

  ViewVC Help
Powered by ViewVC 1.1.22