/[MITgcm]/MITgcm_contrib/dgoldberg/streamice/streamice_cost_surf_accum.F
ViewVC logotype

Diff of /MITgcm_contrib/dgoldberg/streamice/streamice_cost_surf_accum.F

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

revision 1.3 by heimbach, Fri Sep 28 12:31:31 2012 UTC revision 1.7 by dgoldberg, Thu Oct 4 15:42:48 2012 UTC
# Line 28  C     == Global variables === Line 28  C     == Global variables ===
28  #endif  #endif
29    
30  #include "cost.h"  #include "cost.h"
31    #ifdef ALLOW_AUTODIFF_TAMC
32    # include "tamc.h"
33    #endif
34    
35  C     == Routine arguments ==  C     == Routine arguments ==
36  C     myThid - Thread number for this instance of the routine.  C     myThid - Thread number for this instance of the routine.
# Line 52  C     == Local variables Line 55  C     == Local variables
55        jthi = mybyhi(mythid)        jthi = mybyhi(mythid)
56        itlo = mybxlo(mythid)        itlo = mybxlo(mythid)
57        ithi = mybxhi(mythid)        ithi = mybxhi(mythid)
58      
59        WRITE(suff,'(I10.10)') myIter        WRITE(suff,'(I10.10)') myIter
60          suff = suff(1:ILNBLNK(suff))//'.data'
61    
62        CALL READ_FLD_XY_RS( 'land_ice_surf.'//suff//'.data.', ' ',        CALL READ_FLD_XY_RS( 'land_ice_surf.'//suff, ' ',
63       &      S_obs, 0, myThid )       &      S_obs, 0, myThid )
64                
65  C--   Calculate mask for tracer cells  (0 => land, 1 => water)  C--   Calculate mask for tracer cells  (0 => land, 1 => water)
66  !       k=1  !       k=1
67    
68    #ifdef ALLOW_AUTODIFF_TAMC
69    CADJ STORE surf_el_streamice  = comlev1, key = ikey_dynamics,
70    CADJ &     kind = isbyte
71    CADJ STORE H_streamice_prev  = comlev1, key = ikey_dynamics,
72    CADJ &     kind = isbyte
73    CADJ STORE H_streamice  = comlev1, key = ikey_dynamics,
74    CADJ &     kind = isbyte
75    #endif
76    
77  C--   Calculate cost function on tile of this instance  C--   Calculate cost function on tile of this instance
78        do bj = jtlo,jthi        do bj = jtlo,jthi
79          do bi = itlo,ithi          do bi = itlo,ithi
80            do j=1,sNy            do j=1,sNy
81              do i=1,sNx              do i=1,sNx
82    
83    
84    !             S_obs(i,j,bi,bj) = 0.0
85    
86               cost_func1_streamice (bi,bj) =               cost_func1_streamice (bi,bj) =
87       &       cost_func1_streamice (bi,bj) +       &       cost_func1_streamice (bi,bj) +
88       &       0.5 * (S_obs(i,j,bi,bj)-       &       0.5 * (S_obs(i,j,bi,bj)-
89       &              surf_el_streamice(i,j,bi,bj))**2       &              surf_el_streamice(i,j,bi,bj))**2 +
90         &       0.5 * (H_streamice(i,j,bi,bj)-
91         &              H_streamice_prev(i,j,bi,bj))**2
92    
93              end do              end do
94            end do            end do

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

  ViewVC Help
Powered by ViewVC 1.1.22