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 |
|
|
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 |
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))//'.data' |
suff = suff(1:ILNBLNK(suff))//'.bin' |
65 |
|
|
66 |
CALL READ_FLD_XY_RS( 'land_ice_surf.'//suff, ' ', |
CALL READ_FLD_XY_RS( 'land_ice_surf.'//suff, ' ', |
67 |
& S_obs, 0, myThid ) |
& S_obs, 0, myThid ) |
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 |
86 |
|
|
87 |
|
|
88 |
! S_obs(i,j,bi,bj) = 0.0 |
! S_obs(i,j,bi,bj) = 0.0 |
89 |
|
if (streamice_cost_mask(i,j,bi,bj).eq.1.0) THEN |
90 |
cost_func1_streamice (bi,bj) = |
cost_func1_streamice (bi,bj) = |
91 |
& cost_func1_streamice (bi,bj) + |
& cost_func1_streamice (bi,bj) + |
92 |
& 0.5 * (S_obs(i,j,bi,bj)- |
& streamice_wgt_surf * (S_obs(i,j,bi,bj)- |
93 |
& surf_el_streamice(i,j,bi,bj))**2 |
& 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 |