/[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.4 by heimbach, Tue Oct 2 00:43:21 2012 UTC revision 1.10 by dgoldberg, Thu Mar 7 15:23:19 2013 UTC
# Line 1  Line 1 
1  C $Header$  C $Header$
2  C $Name$  C $Name$
3    
4  #include "COST_OPTIONS.h"  #ifdef ALLOW_COST
5    # include "COST_OPTIONS.h"
6    #endif
7  #include "STREAMICE_OPTIONS.h"  #include "STREAMICE_OPTIONS.h"
8    
9    
# Line 27  C     == Global variables === Line 29  C     == Global variables ===
29  # include "STREAMICE.h"  # include "STREAMICE.h"
30  #endif  #endif
31    
32  #include "cost.h"  #ifdef ALLOW_COST
33    # include "cost.h"
34    #endif
35  #ifdef ALLOW_AUTODIFF_TAMC  #ifdef ALLOW_AUTODIFF_TAMC
36  # include "tamc.h"  # include "tamc.h"
37  #endif  #endif
# Line 55  C     == Local variables Line 59  C     == Local variables
59        jthi = mybyhi(mythid)        jthi = mybyhi(mythid)
60        itlo = mybxlo(mythid)        itlo = mybxlo(mythid)
61        ithi = mybxhi(mythid)        ithi = mybxhi(mythid)
62      
63        WRITE(suff,'(I10.10)') myIter        WRITE(suff,'(I10.10)') myIter
64          suff = suff(1:ILNBLNK(suff))//'.bin'
65    
66        CALL READ_FLD_XY_RS( 'land_ice_surf.'//suff//'.data.', ' ',        CALL READ_FLD_XY_RS( 'land_ice_surf.'//suff, ' ',
67       &      S_obs, 0, myThid )       &      S_obs, 0, myThid )
68                
69  C--   Calculate mask for tracer cells  (0 => land, 1 => water)  C--   Calculate mask for tracer cells  (0 => land, 1 => water)
# Line 67  C--   Calculate mask for tracer cells  ( Line 72  C--   Calculate mask for tracer cells  (
72  #ifdef ALLOW_AUTODIFF_TAMC  #ifdef ALLOW_AUTODIFF_TAMC
73  CADJ STORE surf_el_streamice  = comlev1, key = ikey_dynamics,  CADJ STORE surf_el_streamice  = comlev1, key = ikey_dynamics,
74  CADJ &     kind = isbyte  CADJ &     kind = isbyte
75    CADJ STORE H_streamice_prev  = comlev1, key = ikey_dynamics,
76    CADJ &     kind = isbyte
77    CADJ STORE H_streamice  = comlev1, key = ikey_dynamics,
78    CADJ &     kind = isbyte
79  #endif  #endif
80    
81  C--   Calculate cost function on tile of this instance  C--   Calculate cost function on tile of this instance
# Line 75  C--   Calculate cost function on tile of Line 84  C--   Calculate cost function on tile of
84            do j=1,sNy            do j=1,sNy
85              do i=1,sNx              do i=1,sNx
86    
87               cost_func1_streamice (bi,bj) =  
88       &       cost_func1_streamice (bi,bj) +  !             S_obs(i,j,bi,bj) = 0.0
89       &       0.5 * (S_obs(i,j,bi,bj)-               if (streamice_cost_mask(i,j,bi,bj).eq.1.0) THEN
90       &              surf_el_streamice(i,j,bi,bj))**2                cost_func1_streamice (bi,bj) =
91         &        cost_func1_streamice (bi,bj) +
92         &        streamice_wgt_surf * (S_obs(i,j,bi,bj)-
93         &               surf_el_streamice(i,j,bi,bj))**2 / Nx / Ny +
94         &        streamice_wgt_drift * (H_streamice(i,j,bi,bj)-
95         &               H_streamice_prev(i,j,bi,bj))**2 / Nx / Ny
96                 endif
97        
98    
99              end do              end do
100            end do            end do

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.10

  ViewVC Help
Powered by ViewVC 1.1.22