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

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

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


Revision 1.9 - (hide annotations) (download)
Wed Sep 17 20:57:34 2014 UTC (9 years, 8 months ago) by gforget
Branch: MAIN
Changes since 1.8: +12 -5 lines
o pkg/ecco :
   - remove cost_genctrl.F (now pkg/ctrl/ctrl_cost_driver.F)
   - remove cost_forcing_gen.F (now pkg/ctrl/ctrl_cost_gen2d.F)
   - update cost_forcing_gen calls in cost_forcing.F
   - update cost_genctrl call in ecco_cost_driver.F
   - update ecco_ad_diff.list accordingly

1 gforget 1.9 C $Header: /u/gcmpack/MITgcm/pkg/ecco/ecco_cost_driver.F,v 1.8 2013/02/05 21:48:07 gforget Exp $
2 gforget 1.1 C $Name: $
3    
4 jmc 1.6 #include "ECCO_OPTIONS.h"
5 gforget 1.1
6     subroutine ecco_cost_driver( myTime, myIter, mythid )
7    
8     c ==================================================================
9     c SUBROUTINE ecco_cost_driver
10     c ==================================================================
11     c
12     c o Compute all ecco cost function contributions.
13     c
14     c ==================================================================
15     c SUBROUTINE ecco_cost_driver
16     c ==================================================================
17    
18     implicit none
19    
20     c == global variables ==
21    
22     #include "EEPARAMS.h"
23     #include "SIZE.h"
24     #include "PARAMS.h"
25 gforget 1.7 #include "ecco_cost.h"
26 gforget 1.1
27     c == routine arguments ==
28     integer mythid
29     integer myiter
30     _RL mytime
31    
32     #ifdef ALLOW_ECCO_EVOLUTION
33 gforget 1.2
34     #ifdef ALLOW_AUTODIFF_TAMC
35     # ifdef ALLOW_SSH_COST_CONTRIBUTION
36     # ifdef ALLOW_PROFILES
37     # include "profiles.h"
38     # endif
39     # endif
40     #endif
41    
42 gforget 1.1 c-- Compute the cost function contribution of the boundary forcing,
43     c-- i.e. heat flux, salt flux, zonal and meridional wind stress.
44 jmc 1.3 #ifdef ALLOW_DEBUG
45     IF (debugMode) CALL DEBUG_CALL('cost_forcing',myThid)
46 gforget 1.1 #endif
47     call timer_start('cost_forcing [ECCO SPIN-DOWN]', mythid)
48     call cost_forcing( myiter, mytime, mythid )
49     call timer_stop ('cost_forcing [ECCO SPIN-DOWN]', mythid)
50     cph(
51     c-- Compute cost function contribution of wind stress observations.
52     #ifdef ALLOW_MEAN_HFLUX_COST_CONTRIBUTION
53     call cost_mean_heatflux( myiter, mytime, mythid )
54     # ifdef ALLOW_AUTODIFF_TAMC
55     CADJ STORE objf_hfluxmm = tapelev_init, key=1
56     # endif
57     #endif
58    
59     c-- Compute cost function contribution of wind stress observations.
60     #ifdef ALLOW_MEAN_SFLUX_COST_CONTRIBUTION
61     call cost_mean_saltflux( myiter, mytime, mythid )
62     # ifdef ALLOW_AUTODIFF_TAMC
63     CADJ STORE objf_sfluxmm = tapelev_init, key=1
64     # endif
65     #endif
66     cph)
67    
68     c-- Compute cost function contribution of SSH.
69     #ifdef ALLOW_SSH_COST_CONTRIBUTION
70 gforget 1.7 IF (using_cost_altim) THEN
71 jmc 1.3 # ifdef ALLOW_DEBUG
72     IF (debugMode) CALL DEBUG_CALL('cost_ssh',myThid)
73 gforget 1.1 # endif
74     # if (defined(ALLOW_SSHV4_COST))
75     call timer_start('cost_sshv4 [ECCO SPIN-DOWN]', mythid)
76     call cost_sshv4( myiter, mytime, mythid )
77     call timer_stop ('cost_sshv4 [ECCO SPIN-DOWN]', mythid)
78     # elif (defined(ALLOW_NEW_SSH_COST))
79     call timer_start('cost_ssh_new [ECCO SPIN-DOWN]', mythid)
80     call cost_ssh_new( myiter, mytime, mythid )
81     call timer_stop ('cost_ssh_new [ECCO SPIN-DOWN]', mythid)
82 gforget 1.4 # elif (!defined (ALLOW_GENCOST_SSHV4))
83 gforget 1.1 call timer_start('cost_ssh [ECCO SPIN-DOWN]', mythid)
84     call cost_ssh( myiter, mytime, mythid )
85     call timer_stop ('cost_ssh [ECCO SPIN-DOWN]', mythid)
86     # endif
87 gforget 1.7 ENDIF !IF (using_cost_altim) THEN
88 gforget 1.1 # ifdef ALLOW_AUTODIFF_TAMC
89     # ifdef ALLOW_PROFILES
90     CADJ STORE prof_etan_mean = tapelev_init, key=1
91     # endif
92     # endif
93     #endif
94    
95     #ifdef ALLOW_BP_COST_CONTRIBUTION
96     c-- Compute bottom pressure cost
97 gforget 1.7 IF (using_cost_bp) THEN
98 gforget 1.1 call timer_start('cost_bp [ECCO SPIN-DOWN]', mythid)
99     call cost_bp( myiter, mytime, mythid )
100     call timer_stop ('cost_bp [ECCO SPIN-DOWN]', mythid)
101 gforget 1.7 ENDIF
102 gforget 1.1 #endif
103    
104     c-- Compute cost function contribution of Temperature and Salinity.
105 jmc 1.3 #ifdef ALLOW_DEBUG
106     IF (debugMode) CALL DEBUG_CALL('cost_hyd',myThid)
107 gforget 1.1 #endif
108     call timer_start('cost_hyd [ECCO SPIN-DOWN]', mythid)
109     call cost_hyd( myiter, mytime, mythid )
110     call timer_stop ('cost_hyd [ECCO SPIN-DOWN]', mythid)
111    
112     #ifdef ALLOW_SEAICE
113 jmc 1.3 #ifdef ALLOW_DEBUG
114     IF (debugMode) CALL DEBUG_CALL('seaice_cost_driver',myThid)
115 gforget 1.1 #endif
116     IF ( useSeaice) THEN
117     call timer_start('seaice_cost_driver [ECCO SPIN-DOWN]', mythid)
118     call seaice_cost_driver( myiter, mytime, mythid )
119     call timer_stop ('seaice_cost_driver [ECCO SPIN-DOWN]', mythid)
120     ENDIF
121     #endif
122    
123     #ifdef ALLOW_OBCS_COST_CONTRIBUTION
124 jmc 1.3 #ifdef ALLOW_DEBUG
125     IF (debugMode) CALL DEBUG_CALL('cost_obcs',myThid)
126 gforget 1.1 #endif
127     call timer_start('cost_obcs [ECCO SPIN-DOWN]', mythid)
128     call cost_obcs( myiter, mytime, mythid )
129     call timer_stop ('cost_obcs [ECCO SPIN-DOWN]', mythid)
130     #endif
131    
132     #ifdef ALLOW_CURMTR_COST_CONTRIBUTION
133 jmc 1.3 #ifdef ALLOW_DEBUG
134     IF (debugMode) CALL DEBUG_CALL('cost_curmtr',myThid)
135 gforget 1.1 #endif
136     call timer_start('cost_curmtr [ECCO SPIN-DOWN]', mythid)
137     call cost_curmtr( myiter, mytime, mythid )
138     call timer_stop ('cost_curmtr [ECCO SPIN-DOWN]', mythid)
139     #endif
140    
141     c-- Compute cost function contribution of drifter velocities.
142     #ifdef ALLOW_DRIFTER_COST_CONTRIBUTION
143     #ifndef ALLOW_AUTODIFF_WHTAPEIO
144 jmc 1.3 #ifdef ALLOW_DEBUG
145     IF (debugMode) CALL DEBUG_CALL('cost_drifter',myThid)
146 gforget 1.1 #endif
147     call timer_start('cost_drifter [ECCO SPIN-DOWN]', mythid)
148     call cost_drifter( myiter, mytime, mythid )
149     call timer_stop ('cost_drifter [ECCO SPIN-DOWN]', mythid)
150     #endif
151     #endif
152    
153     c-- Compute cost function contribution of wind stress observations.
154     #if (defined (ALLOW_SCAT_COST_CONTRIBUTION) || \
155     defined (ALLOW_DAILYSCAT_COST_CONTRIBUTION) )
156 jmc 1.3 #ifdef ALLOW_DEBUG
157     IF (debugMode) CALL DEBUG_CALL('cost_scat',myThid)
158 gforget 1.1 #endif
159 gforget 1.7 IF (using_cost_scat) THEN
160 gforget 1.1 call timer_start('cost_scat [ECCO SPIN-DOWN]', mythid)
161     call cost_scat( myiter, mytime, mythid )
162     call timer_stop ('cost_scat [ECCO SPIN-DOWN]', mythid)
163 gforget 1.7 ENDIF
164 gforget 1.1 #endif
165    
166     c-- Compute cost function contribution of drift between the first
167     c and the last year.
168     #ifdef ALLOW_DRIFT_COST_CONTRIBUTION
169 jmc 1.3 #ifdef ALLOW_DEBUG
170     IF (debugMode) CALL DEBUG_CALL('cost_drift',myThid)
171 gforget 1.1 #endif
172     call timer_start('cost_drift [ECCO SPIN-DOWN]', mythid)
173     call cost_drift( myiter, mytime, mythid )
174     call timer_stop ('cost_drift [ECCO SPIN-DOWN]', mythid)
175     #endif
176     #ifdef ALLOW_DRIFTW_COST_CONTRIBUTION
177 jmc 1.3 #ifdef ALLOW_DEBUG
178     IF (debugMode) CALL DEBUG_CALL('cost_driftw',myThid)
179 gforget 1.1 #endif
180     call timer_start('cost_driftw [ECCO SPIN-DOWN]', mythid)
181     call cost_driftw( myiter, mytime, mythid )
182     call timer_stop ('cost_driftw [ECCO SPIN-DOWN]', mythid)
183     #endif
184     _BARRIER
185    
186     c-- Compute initial vs. final T/S deviation
187     #ifdef ALLOW_COST_INI_FIN
188     call timer_start('cost_ini_fin [ECCO SPIN-DOWN]', mythid)
189     call cost_theta_ini_fin( myiter, mytime, mythid )
190     call cost_salt_ini_fin( myiter, mytime, mythid )
191     call timer_stop ('cost_ini_fin [ECCO SPIN-DOWN]', mythid)
192     #endif
193     _BARRIER
194    
195     c-- Internal Parameter controls cost terms:
196     call timer_start('cost_internal_params [ECCO SPIN-DOWN]', mythid)
197     call cost_internal_params( myiter, mytime, mythid )
198     call timer_stop ('cost_internal_params [ECCO SPIN-DOWN]', mythid)
199     _BARRIER
200    
201     c-- Compute user defined cost function contributions (elaborate)
202     call timer_start('cost_gencost_all [ECCO SPIN-DOWN]', mythid)
203     call cost_gencost_all( myiter, mytime, mythid )
204     call timer_stop ('cost_gencost_all [ECCO SPIN-DOWN]', mythid)
205    
206     c-- Compute user defined cost function contributions (basic)
207     call timer_start('cost_usercost_all [ECCO SPIN-DOWN]', mythid)
208     call cost_usercost_all( myiter, mytime, mythid )
209     call timer_stop ('cost_usercost_all [ECCO SPIN-DOWN]', mythid)
210    
211 gforget 1.9
212     #ifdef ALLOW_CTRL
213     #ifdef ALLOW_DEBUG
214     IF (debugMode) CALL DEBUG_CALL('ctrl_cost_driver',myThid)
215     #endif
216     c IF ( useCtrl ) THEN
217     call timer_start('ctrl_cost_driver [ECCO SPIN-DOWN]', mythid)
218     call ctrl_cost_driver( myiter, mytime, mythid )
219     call timer_stop ('ctrl_cost_driver [ECCO SPIN-DOWN]', mythid)
220     c ENDIF
221     #endif
222 gforget 1.8
223 gforget 1.1 #endif /* ALLOW_ECCO_EVOLUTION */
224    
225     return
226     end

  ViewVC Help
Powered by ViewVC 1.1.22