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

Annotation of /MITgcm/pkg/ecco/cost_mean_saltflux.F

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


Revision 1.4 - (hide annotations) (download)
Fri Feb 17 23:48:14 2006 UTC (18 years, 3 months ago) by heimbach
Branch: MAIN
CVS Tags: checkpoint58e_post, checkpoint58g_post, checkpoint58h_post, checkpoint58j_post, checkpoint58f_post, checkpoint58d_post, checkpoint58c_post, checkpoint58i_post, checkpoint58k_post, checkpoint58b_post
Changes since 1.3: +8 -10 lines
Treatment of space/time mean fluxes modified.
(hfluxmm, sfluxmm havent been used so far)

1 heimbach 1.1
2     #include "COST_CPPOPTIONS.h"
3    
4    
5     subroutine cost_mean_saltflux(
6     I myiter,
7     I mytime,
8     I mythid
9     & )
10    
11     c ==================================================================
12     c SUBROUTINE cost_mean_saltflux
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_saltflux
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 heimbach 1.2 integer i,j,kk
49 heimbach 1.1 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    
63     character*(80) fnamesflux
64    
65     logical doglobalread
66     logical ladinit
67    
68     character*(MAX_LEN_MBUF) msgbuf
69    
70     c == external functions ==
71    
72     integer ilnblnk
73     external ilnblnk
74    
75     c == end of interface ==
76    
77     jtlo = mybylo(mythid)
78     jthi = mybyhi(mythid)
79     itlo = mybxlo(mythid)
80     ithi = mybxhi(mythid)
81     jmin = 1
82     jmax = sny
83     imin = 1
84     imax = snx
85    
86     c-- Read tiled data.
87     doglobalread = .false.
88     ladinit = .false.
89    
90     #ifdef ALLOW_MEAN_SFLUX_COST_CONTRIBUTION
91    
92     if (optimcycle .ge. 0) then
93     ilsalt = ilnblnk( sfluxbarfile )
94     write(fnamesflux(1:80),'(2a,i10.10)')
95     & sfluxbarfile(1:ilsalt),'.',optimcycle
96     endif
97    
98     irec = 1
99    
100     c-- Read time averages and the monthly mean data.
101     call active_read_xy( fnamesflux, tmpfld2d, irec,
102     & doglobalread, ladinit,
103     & optimcycle, mythid,
104     & xx_sflux_mean_dummy )
105    
106     do bj = jtlo,jthi
107     do bi = itlo,ithi
108     kk = 1
109     fctilemm = 0. _d 0
110     sumcos = 0. _d 0
111     do j = jmin,jmax
112     do i = imin,imax
113     tmpx=tmpfld2d(i,j,bi,bj)
114 heimbach 1.2 if (maskC(i,j,kk,bi,bj) .ne. 0.) then
115 heimbach 1.4 fctilemm = fctilemm + tmpx
116     & *cos(yc(i,j,bi,bj)*deg2rad)
117     sumcos = sumcos + cos(yc(i,j,bi,bj)*deg2rad)
118     num_sfluxmm(bi,bj) = num_sfluxmm(bi,bj) + 1
119 heimbach 1.1 endif
120     enddo
121     enddo
122    
123 heimbach 1.4 _GLOBAL_SUM_R8( sumcos , myThid )
124     if (sumcos.eq.0.) sumcos = 1.
125 heimbach 1.1
126 heimbach 1.4 fctilemm = fctilemm / sumcos
127     objf_sfluxmm(bi,bj) = wsfluxmm(bi,bj) * fctilemm
128 heimbach 1.1
129     enddo
130     enddo
131    
132     #endif
133    
134     return
135     end
136    

  ViewVC Help
Powered by ViewVC 1.1.22