/[MITgcm]/MITgcm/verification/tutorial_global_oce_optim/code_ad/cost_hflux.F
ViewVC logotype

Diff of /MITgcm/verification/tutorial_global_oce_optim/code_ad/cost_hflux.F

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

revision 1.6 by jmc, Fri Aug 10 19:31:56 2012 UTC revision 1.7 by jmc, Thu Sep 11 19:52:09 2014 UTC
# Line 2  C $Header$ Line 2  C $Header$
2  C $Name$  C $Name$
3    
4  #include "COST_OPTIONS.h"  #include "COST_OPTIONS.h"
5    #ifdef ALLOW_CTRL
6    # include "CTRL_OPTIONS.h"
7    #endif
8    
9        SUBROUTINE COST_HFLUX( myThid )        SUBROUTINE COST_HFLUX( myThid )
10  C     *==========================================================*  C     *==========================================================*
# Line 23  C     == Global variables === Line 26  C     == Global variables ===
26  #ifdef ALLOW_HFLUXM_CONTROL  #ifdef ALLOW_HFLUXM_CONTROL
27  #include "FFIELDS.h"  #include "FFIELDS.h"
28  #endif  #endif
 #ifdef ALLOW_AUTODIFF_TAMC  
 # include "tamc.h"  
 # include "tamc_keys.h"  
 #endif /* ALLOW_AUTODIFF_TAMC */  
29    
30  C     ======== Routine arguments ======================  C     ======== Routine arguments ======================
31  C     myThid - Thread number for this instance of the routine.  C     myThid - Thread number for this instance of the routine.
# Line 54  C     ========= Local variables ======== Line 53  C     ========= Local variables ========
53        DO bj=myByLo(myThid),myByHi(myThid)        DO bj=myByLo(myThid),myByHi(myThid)
54         DO bi=myBxLo(myThid),myBxHi(myThid)         DO bi=myBxLo(myThid),myBxHi(myThid)
55    
 #ifdef ALLOW_AUTODIFF_TAMC  
          act1 = bi - myBxLo(myThid)  
          max1 = myBxHi(myThid) - myBxLo(myThid) + 1  
          act2 = bj - myByLo(myThid)  
          max2 = myByHi(myThid) - myByLo(myThid) + 1  
          act3 = myThid - 1  
          ikey = (act1 + 1) + act2*max1  
      &                      + act3*max1*max2  
 #endif /* ALLOW_AUTODIFF_TAMC */  
   
56           locfc = 0. _d 0           locfc = 0. _d 0
57           DO j=1,sNy           DO j=1,sNy
58            DO i=1,sNx            DO i=1,sNx
# Line 81  c        print*,'objf_hflux_tut =',locfc Line 70  c        print*,'objf_hflux_tut =',locfc
70         ENDDO         ENDDO
71        ENDDO        ENDDO
72    
73  #endif  #endif /* ALLOW_COST_HFLUXM & ALLOW_HFLUXM_CONTROL */
74        RETURN        RETURN
75        END        END

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

  ViewVC Help
Powered by ViewVC 1.1.22