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

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

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


Revision 1.1 - (show annotations) (download)
Thu Nov 6 22:10:06 2003 UTC (20 years, 7 months ago) by heimbach
Branch: MAIN
CVS Tags: branch-netcdf, checkpoint52b_pre, checkpoint52, checkpoint52a_post, checkpoint52b_post, checkpoint52c_post, ecco_c52_e35, checkpoint52a_pre, checkpoint51u_post
o merging from ecco-branch
o pkg/ecco now containes ecco-specific part of cost function
o top level routines the_main_loop, forward_step
  supersede those in model/src/
  previous input data.cost now in data.ecco
  (new namelist ecco_cost_nml)

1 C $Header: /u/gcmpack/MITgcm/pkg/cost/Attic/cost_argo_theta.F,v 1.1.2.2 2003/06/19 15:21:16 heimbach Exp $
2
3 #include "COST_CPPOPTIONS.h"
4
5
6 subroutine cost_argo_theta(
7 I myiter,
8 I mytime,
9 I mythid
10 & )
11
12 c ==================================================================
13 c SUBROUTINE cost_argo_theta
14 c ==================================================================
15 c
16 c o Evaluate cost function contribution of ARGO temperature data.
17 c
18 c started: Elisabeth Remy eremy@ucsd.edu 30-Aug-2000
19 c
20 c
21 c ==================================================================
22 c SUBROUTINE cost_argo_theta
23 c ==================================================================
24
25 implicit none
26
27 c == global variables ==
28
29 #include "EEPARAMS.h"
30 #include "SIZE.h"
31 #include "GRID.h"
32 #include "DYNVARS.h"
33
34 #include "cal.h"
35 #include "ecco_cost.h"
36 #include "ctrl.h"
37 #include "ctrl_dummy.h"
38 #include "optim.h"
39
40 c == routine arguments ==
41
42 integer myiter
43 _RL mytime
44 integer mythid
45
46 c == local variables ==
47
48 integer bi,bj
49 integer i,j,k
50 integer itlo,ithi
51 integer jtlo,jthi
52 integer jmin,jmax
53 integer imin,imax
54 integer nrec
55 integer irec
56 integer ilu
57
58 _RL fctile_argot
59 _RL fcthread_argot
60 _RL www (1-olx:snx+olx,1-oly:sny+oly)
61 _RL tmpobs (1-olx:snx+olx,1-oly:sny+oly)
62 _RL spval
63 _RL ztop,rl_35,rl_0
64
65 character*(80) fnametheta
66
67 logical doglobalread
68 logical ladinit
69
70 character*(MAX_LEN_MBUF) msgbuf
71
72 c == external functions ==
73
74 integer ilnblnk
75 external ilnblnk
76 _RL SW_PTMP
77 external SW_PTMP
78
79 c == end of interface ==
80
81 jtlo = mybylo(mythid)
82 jthi = mybyhi(mythid)
83 itlo = mybxlo(mythid)
84 ithi = mybxhi(mythid)
85 jmin = 1
86 jmax = sny
87 imin = 1
88 imax = snx
89
90 spval = -2.
91 ztop = -.981*1.027
92 rl_35= 35.0
93 rl_0 = 0.0
94 c-- Read state record from global file.
95 doglobalread = .false.
96 ladinit = .false.
97
98 #ifdef ALLOW_ARGO_THETA_COST_CONTRIBUTION
99
100 #ifdef ECCO_VERBOSE
101 write(msgbuf,'(a)') ' '
102 call print_message( msgbuf, standardmessageunit,
103 & SQUEEZE_RIGHT , mythid)
104 write(msgbuf,'(a,i8.8)')
105 & ' cost_ARGO_THETA: number of records to process =', nmonsrec
106 call print_message( msgbuf, standardmessageunit,
107 & SQUEEZE_RIGHT , mythid)
108 write(msgbuf,'(a)') ' '
109 call print_message( msgbuf, standardmessageunit,
110 & SQUEEZE_RIGHT , mythid)
111 #endif
112
113 if (optimcycle .ge. 0) then
114 ilu=ilnblnk( tbarfile )
115 write(fnametheta(1:80),'(2a,i10.10)')
116 & tbarfile(1:ilu), '.', optimcycle
117 endif
118
119 fcthread_argot = 0. _d 0
120
121 c-- Loop over records.
122 do irec = 1,nmonsrec
123
124 c-- Read time averages and the monthly mean data.
125 call active_read_xyz( fnametheta, tbar, irec,
126 & doglobalread, ladinit,
127 & optimcycle, mythid
128 & , xx_tbar_mean_dummy )
129
130 call cost_readargot( irec, mythid )
131
132 c-- Loop over this thread's tiles.
133 do bj = jtlo,jthi
134 do bi = itlo,ithi
135 c-- Loop over the model layers
136
137 fctile_argot = 0. _d 0
138
139 do k = 1,nr
140
141 c-- Determine the weights to be used.
142 do j = jmin,jmax
143 do i = imin,imax
144 cph(
145 cph print *, 'WARNING: SPECIFIC SETUP FOR ECCO'
146 cph below statement could be replaced by following
147 cph to make it independnet of Nr:
148 cph
149 cph if ( rC(K) .GT. -1000. ) then
150 cph)
151 c-- set cmask=0 in areas shallower than 1000m
152 if( (argotobs(i,j,k,bi,bj) .ne. 0.).and.
153 & (argotobs(i,j,k,bi,bj) .ge. spval).and.
154 & (_hFacC(i,j,13,bi,bj) .ne. 0.).and.
155 & (_hFacC(i,j,k,bi,bj) .ne. 0.) )then
156 www(i,j) = cosphi(i,j,bi,bj)
157 tmpobs(i,j) = SW_PTMP(rl_35,
158 $ argotobs(i,j,k,bi,bj),ztop*rc(k),rl_0)
159
160 fctile_argot = fctile_argot +
161 & wtheta2(i,j,k,bi,bj)*www(i,j)*
162 & (tbar(i,j,k,bi,bj)-tmpobs(i,j))*
163 & (tbar(i,j,k,bi,bj)-tmpobs(i,j))
164 endif
165 enddo
166 enddo
167 c-- End of loop over layers.
168 enddo
169
170 fcthread_argot = fcthread_argot + fctile_argot
171 objf_argot(bi,bj) = objf_argot(bi,bj) + fctile_argot
172
173 #ifdef ECCO_VERBOSE
174 write(msgbuf,'(a)') ' '
175 call print_message( msgbuf, standardmessageunit,
176 & SQUEEZE_RIGHT , mythid)
177 write(msgbuf,'(a,i8.8,1x,i3.3,1x,i3.3)')
178 & ' COST_ARGO_THETA: irec,bi,bj = ',irec,bi,bj
179 call print_message( msgbuf, standardmessageunit,
180 & SQUEEZE_RIGHT , mythid)
181 write(msgbuf,'(a,d22.15)')
182 & ' COST_ARGO_THETA: cost function = ', fctile_argot
183 call print_message( msgbuf, standardmessageunit,
184 & SQUEEZE_RIGHT , mythid)
185 write(msgbuf,'(a)') ' '
186 call print_message( msgbuf, standardmessageunit,
187 & SQUEEZE_RIGHT , mythid)
188 #endif
189
190 enddo
191 enddo
192
193 #ifdef ECCO_VERBOSE
194 c-- Print cost function for all tiles.
195 c _GLOBAL_SUM_R8( fcthread_argot , myThid )
196 write(msgbuf,'(a)') ' '
197 call print_message( msgbuf, standardmessageunit,
198 & SQUEEZE_RIGHT , mythid)
199 write(msgbuf,'(a,i8.8)')
200 & ' cost_ARGOT: irec = ',irec
201 call print_message( msgbuf, standardmessageunit,
202 & SQUEEZE_RIGHT , mythid)
203 write(msgbuf,'(a,a,d22.15)')
204 & ' global cost function value',
205 & ' ( ARGO temp. ) = ',fcthread_argot
206 call print_message( msgbuf, standardmessageunit,
207 & SQUEEZE_RIGHT , mythid)
208 write(msgbuf,'(a)') ' '
209 call print_message( msgbuf, standardmessageunit,
210 & SQUEEZE_RIGHT , mythid)
211 #endif
212
213 enddo
214 c-- End of second loop over records.
215
216 #else
217 c-- Do not enter the calculation of the CTD temperature contribution
218 c-- to the final cost function.
219
220 fctile_argot = 0. _d 0
221 fcthread_argot = 0. _d 0
222
223 crg
224 nrec = 1
225 crg
226
227 _BEGIN_MASTER( mythid )
228 write(msgbuf,'(a)') ' '
229 call print_message( msgbuf, standardmessageunit,
230 & SQUEEZE_RIGHT , mythid)
231 write(msgbuf,'(a,a)')
232 & ' cost_ARGOT: no contribution of ARGO temperature ',
233 & ' to cost function.'
234 call print_message( msgbuf, standardmessageunit,
235 & SQUEEZE_RIGHT , mythid)
236 write(msgbuf,'(a,a,i9.8)')
237 & ' cost_ARGOT: number of records that would have',
238 & ' been processed: ',nrec
239 call print_message( msgbuf, standardmessageunit,
240 & SQUEEZE_RIGHT , mythid)
241 write(msgbuf,'(a)') ' '
242 call print_message( msgbuf, standardmessageunit,
243 & SQUEEZE_RIGHT , mythid)
244 _END_MASTER( mythid )
245 #endif
246
247 return
248 end

  ViewVC Help
Powered by ViewVC 1.1.22