1 |
|
C $Header$ |
2 |
|
C $Name$ |
3 |
|
|
4 |
#include "COST_CPPOPTIONS.h" |
#include "COST_CPPOPTIONS.h" |
5 |
|
|
34 |
|
|
35 |
#include "cal.h" |
#include "cal.h" |
36 |
#include "ecco_cost.h" |
#include "ecco_cost.h" |
37 |
|
#include "CTRL_SIZE.h" |
38 |
#include "ctrl.h" |
#include "ctrl.h" |
39 |
#include "ctrl_dummy.h" |
#include "ctrl_dummy.h" |
40 |
#include "optim.h" |
#include "optim.h" |
93 |
#ifdef ALLOW_MEAN_SFLUX_COST_CONTRIBUTION |
#ifdef ALLOW_MEAN_SFLUX_COST_CONTRIBUTION |
94 |
|
|
95 |
if (optimcycle .ge. 0) then |
if (optimcycle .ge. 0) then |
96 |
ilsalt = ilnblnk( sfluxbarfile ) |
ilsalt = ilnblnk( sfluxmeanbarfile ) |
97 |
write(fnamesflux(1:80),'(2a,i10.10)') |
write(fnamesflux(1:80),'(2a,i10.10)') |
98 |
& sfluxbarfile(1:ilsalt),'.',optimcycle |
& sfluxmeanbarfile(1:ilsalt),'.',optimcycle |
99 |
endif |
endif |
100 |
|
|
101 |
do irec = 1, MAX(1,nyearsrec) |
do irec = 1, MAX(1,nyearsrec) |
116 |
tmpx=tmpfld2d(i,j,bi,bj) |
tmpx=tmpfld2d(i,j,bi,bj) |
117 |
if (maskC(i,j,kk,bi,bj) .ne. 0.) then |
if (maskC(i,j,kk,bi,bj) .ne. 0.) then |
118 |
fctiletot = fctiletot |
fctiletot = fctiletot |
119 |
& + tmpx*cos(yc(i,j,bi,bj)*deg2rad) |
& + tmpx* _rA(i,j,bi,bj)/rhoConstFresh |
120 |
sumtot = sumtot |
sumtot = sumtot |
121 |
& + cos(yc(i,j,bi,bj)*deg2rad) |
& + _rA(i,j,bi,bj) |
122 |
num_sfluxmm(bi,bj) = num_sfluxmm(bi,bj) + 1 |
num_sfluxmm(bi,bj) = num_sfluxmm(bi,bj) + 1 |
123 |
endif |
endif |
124 |
enddo |
enddo |
126 |
enddo |
enddo |
127 |
enddo |
enddo |
128 |
|
|
129 |
_GLOBAL_SUM_R8( sumtot , myThid ) |
_GLOBAL_SUM_RL( sumtot , myThid ) |
130 |
_GLOBAL_SUM_R8( fctiletot , myThid ) |
_GLOBAL_SUM_RL( fctiletot , myThid ) |
131 |
|
|
132 |
if (sumtot.eq.0.) sumtot = 1. |
if (sumtot.eq.0.) sumtot = 1. |
133 |
|
|
134 |
if ( wmean_sflux .NE. 0. ) then |
if ( wmean_sflux .NE. 0. ) then |
135 |
objf_sfluxmm = objf_sfluxmm |
objf_sfluxmm = objf_sfluxmm |
136 |
& + ( (fctiletot/sumtot-1.D0)/wmean_sflux )**2 |
& + ( (fctiletot/sumtot)/wmean_sflux )**2 |
137 |
else |
else |
138 |
objf_sfluxmm = 0. _d 0 |
objf_sfluxmm = 0. _d 0 |
139 |
endif |
endif |
142 |
write(standardmessageunit,'(A,I5,2(X,D22.14))') |
write(standardmessageunit,'(A,I5,2(X,D22.14))') |
143 |
& ' --> bal_sfluxmm =', irec, |
& ' --> bal_sfluxmm =', irec, |
144 |
& fctiletot/sumtot, |
& fctiletot/sumtot, |
145 |
& (fctiletot/sumtot/wmean_sflux)**2 |
& objf_sfluxmm |
146 |
|
|
147 |
enddo |
enddo |
148 |
|
|