/[MITgcm]/MITgcm/pkg/ecco/cost_mean_heatflux.F
ViewVC logotype

Contents of /MITgcm/pkg/ecco/cost_mean_heatflux.F

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


Revision 1.4 - (show annotations) (download)
Fri Feb 17 23:48:14 2006 UTC (18 years, 3 months ago) by heimbach
Branch: MAIN
CVS Tags: checkpoint58l_post, checkpoint58e_post, checkpoint58u_post, checkpoint58r_post, checkpoint58g_post, checkpoint58n_post, checkpoint58x_post, checkpoint58t_post, checkpoint58h_post, checkpoint58w_post, checkpoint58q_post, checkpoint58j_post, checkpoint59e, checkpoint59d, checkpoint59g, checkpoint59f, checkpoint59a, checkpoint59c, checkpoint59b, checkpoint59h, checkpoint59, checkpoint58f_post, checkpoint58d_post, checkpoint58c_post, checkpoint58i_post, checkpoint58o_post, checkpoint58y_post, checkpoint58k_post, checkpoint58v_post, checkpoint58s_post, checkpoint58p_post, checkpoint58b_post, checkpoint58m_post
Changes since 1.3: +9 -12 lines
Treatment of space/time mean fluxes modified.
(hfluxmm, sfluxmm havent been used so far)

1
2 #include "COST_CPPOPTIONS.h"
3
4
5 subroutine cost_mean_heatflux(
6 I myiter,
7 I mytime,
8 I mythid
9 & )
10
11 c ==================================================================
12 c SUBROUTINE cost_mean_heatflux
13 c ==================================================================
14 c
15 c o Evaluate cost function contribution of sea surface salinity.
16 c
17 c started: Elisabeth Remy 19-mar-2001 copy from cost_sst.F
18 c
19 c ==================================================================
20 c SUBROUTINE cost_mean_heatflux
21 c ==================================================================
22
23 implicit none
24
25 c == global variables ==
26
27 #include "EEPARAMS.h"
28 #include "SIZE.h"
29 #include "GRID.h"
30 #include "DYNVARS.h"
31 #include "PARAMS.h"
32
33 #include "cal.h"
34 #include "ecco_cost.h"
35 #include "ctrl.h"
36 #include "ctrl_dummy.h"
37 #include "optim.h"
38
39 c == routine arguments ==
40
41 integer myiter
42 _RL mytime
43 integer mythid
44
45 c == local variables ==
46
47 integer bi,bj
48 integer i,j,kk
49 integer itlo,ithi
50 integer jtlo,jthi
51 integer jmin,jmax
52 integer imin,imax
53 integer irec
54 integer levmon
55 integer levoff
56 integer ilsalt
57
58 _RL fctilemm
59 _RL tmpx
60 _RL sumcos
61
62 character*(80) fnamehflux
63
64 logical doglobalread
65 logical ladinit
66
67 character*(MAX_LEN_MBUF) msgbuf
68
69 c == external functions ==
70
71 integer ilnblnk
72 external ilnblnk
73
74 c == end of interface ==
75
76 jtlo = mybylo(mythid)
77 jthi = mybyhi(mythid)
78 itlo = mybxlo(mythid)
79 ithi = mybxhi(mythid)
80 jmin = 1
81 jmax = sny
82 imin = 1
83 imax = snx
84
85 c-- Read tiled data.
86 doglobalread = .false.
87 ladinit = .false.
88
89 #ifdef ALLOW_MEAN_HFLUX_COST_CONTRIBUTION
90
91 if (optimcycle .ge. 0) then
92 ilsalt = ilnblnk( hfluxbarfile )
93 write(fnamehflux(1:80),'(2a,i10.10)')
94 & hfluxbarfile(1:ilsalt),'.',optimcycle
95 endif
96
97 irec = 1
98
99 c-- Read time averages and the monthly mean data.
100 call active_read_xy( fnamehflux, tmpfld2d, irec,
101 & doglobalread, ladinit,
102 & optimcycle, mythid,
103 & xx_hflux_mean_dummy )
104
105 do bj = jtlo,jthi
106 do bi = itlo,ithi
107 kk = 1
108 fctilemm = 0. _d 0
109 sumcos = 0. _d 0
110 do j = jmin,jmax
111 do i = imin,imax
112 tmpx=tmpfld2d(i,j,bi,bj)
113 if (maskC(i,j,kk,bi,bj) .ne. 0.) then
114 fctilemm = fctilemm + tmpx
115 & *cos(yc(i,j,bi,bj)*deg2rad)
116 sumcos = sumcos + cos(yc(i,j,bi,bj)*deg2rad)
117 num_hfluxmm(bi,bj) = num_hfluxmm(bi,bj) + 1
118 endif
119 enddo
120 enddo
121
122 _GLOBAL_SUM_R8( sumcos , myThid )
123 if (sumcos.eq.0.) sumcos = 1.
124
125 fctilemm = fctilemm / sumcos
126 objf_hfluxmm(bi,bj) = whfluxmm(bi,bj) * fctilemm
127
128 enddo
129 enddo
130
131 #endif
132
133 return
134 end
135

  ViewVC Help
Powered by ViewVC 1.1.22