/[MITgcm]/MITgcm/pkg/exf/exf_getsurfacefluxes.F
ViewVC logotype

Annotation of /MITgcm/pkg/exf/exf_getsurfacefluxes.F

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


Revision 1.24 - (hide annotations) (download)
Tue May 26 17:08:45 2015 UTC (8 years, 11 months ago) by gforget
Branch: MAIN
CVS Tags: checkpoint65z, checkpoint65x, checkpoint65y, checkpoint65r, checkpoint65s, checkpoint65p, checkpoint65q, checkpoint65v, checkpoint65w, checkpoint65t, checkpoint65u, checkpoint65n, checkpoint65m, checkpoint66g, checkpoint66f, checkpoint66e, checkpoint66d, checkpoint66c, checkpoint66b, checkpoint66a, checkpoint66o, checkpoint66n, checkpoint66m, checkpoint66l, checkpoint66k, checkpoint66j, checkpoint66i, checkpoint66h, checkpoint65o, HEAD
Changes since 1.23: +5 -5 lines
- allow for multiple contributions to same control variable.

1 gforget 1.24 C $Header: /u/gcmpack/MITgcm/pkg/exf/exf_getsurfacefluxes.F,v 1.23 2014/11/09 17:24:59 gforget Exp $
2 heimbach 1.8 C $Name: $
3 heimbach 1.1
4 edhill 1.6 #include "EXF_OPTIONS.h"
5 gforget 1.20 #ifdef ALLOW_CTRL
6     # include "CTRL_OPTIONS.h"
7     #endif
8     #ifdef ALLOW_ECCO
9     # include "ECCO_OPTIONS.h"
10     #endif
11 heimbach 1.1
12     subroutine exf_GetSurfaceFluxes(
13     I mytime,
14     I myiter,
15     I mythid
16     & )
17    
18     c ==================================================================
19     c SUBROUTINE exf_GetSurfaceFluxes
20     c ==================================================================
21     c
22     c o Mid-level routine for enabling the use of flux fields as control
23     c variables.
24     c
25     c started: Christian Eckert eckert@mit.edu 30-Jun-1999
26     c
27     c changed: Christian Eckert eckert@mit.edu 14-Jan-2000
28     c - Restructured the code in order to create a package
29     c for the MITgcmUV.
30     c
31     c Christian Eckert eckert@mit.edu 12-Feb-2000
32 dimitri 1.4 c - Changed Routine names (package prefix: exf_)
33 heimbach 1.1 c
34 dimitri 1.4 c mods for pkg/seaice: menemenlis@jpl.nasa.gov 20-Dec-2002
35 heimbach 1.1 c
36     c ==================================================================
37     c SUBROUTINE exf_GetSurfaceFluxes
38     c ==================================================================
39    
40     implicit none
41    
42 heimbach 1.5 c == global variables ==
43     #include "EEPARAMS.h"
44     #include "SIZE.h"
45     #include "PARAMS.h"
46     #include "GRID.h"
47    
48 jmc 1.12 #include "EXF_FIELDS.h"
49 gforget 1.13 #include "EXF_PARAM.h"
50 gforget 1.22 #ifdef ALLOW_CTRL
51     # include "CTRL_SIZE.h"
52     # include "ctrl.h"
53     # include "ctrl_dummy.h"
54     # include "CTRL_GENARR.h"
55     #endif
56     #if (defined (ALLOW_ECCO) && defined (ECCO_CTRL_DEPRECATED))
57     # include "ecco_cost.h"
58 heimbach 1.5 #endif
59    
60 heimbach 1.1 c == routine arguments ==
61    
62     _RL mytime
63     integer myiter
64     integer mythid
65    
66     c == global variables ==
67    
68 gforget 1.18 #ifdef ALLOW_CTRL
69    
70 gforget 1.13 #ifdef ALLOW_ROTATE_UV_CONTROLS
71     _RL tmpUE(1-olx:snx+olx,1-oly:sny+oly,nsx,nsy)
72     _RL tmpVN(1-olx:snx+olx,1-oly:sny+oly,nsx,nsy)
73     _RL tmpUX(1-olx:snx+olx,1-oly:sny+oly,nsx,nsy)
74     _RL tmpVY(1-olx:snx+olx,1-oly:sny+oly,nsx,nsy)
75 gforget 1.17 #endif
76    
77     #ifdef ALLOW_GENTIM2D_CONTROL
78     integer iarr
79     #endif
80    
81     #if (defined (ALLOW_ROTATE_UV_CONTROLS) || defined (ALLOW_GENTIM2D_CONTROL))
82 gforget 1.13 integer i,j,bi,bj
83     #endif
84    
85 gforget 1.17 c == end of interface ==
86    
87     #ifdef ALLOW_ROTATE_UV_CONTROLS
88 gforget 1.22 if ( useCTRL ) then
89 gforget 1.17 do bj = mybylo(mythid),mybyhi(mythid)
90     do bi = mybxlo(mythid),mybxhi(mythid)
91     do j = 1-oly,sny+oly
92     do i = 1-olx,snx+olx
93     tmpUE(i,j,bi,bj) = 0. _d 0
94     tmpVN(i,j,bi,bj) = 0. _d 0
95     tmpUX(i,j,bi,bj) = 0. _d 0
96     tmpVY(i,j,bi,bj) = 0. _d 0
97     enddo
98     enddo
99     enddo
100     enddo
101 gforget 1.22 endif
102 gforget 1.17 #endif
103 gforget 1.13
104 gforget 1.17 #if (defined (ALLOW_CTRL) && \
105     defined (ALLOW_GENTIM2D_CONTROL))
106 gforget 1.22 if ( useCTRL.AND.ctrlUseGen) then
107 gforget 1.17 DO bj = myByLo(myThid),myByHi(myThid)
108     DO bi = myBxLo(myThid),mybxhi(myThid)
109     DO j = 1,sNy
110     DO i = 1,sNx
111     do iarr = 1, maxCtrlTim2D
112     #ifndef ALLOW_ROTATE_UV_CONTROLS
113 gforget 1.24 if (xx_gentim2d_file(iarr)(1:7).EQ.'xx_tauu')
114 gforget 1.17 & ustress(i,j,bi,bj)=ustress(i,j,bi,bj)+
115     & xx_gentim2d(i,j,bi,bj,iarr)
116 gforget 1.24 if (xx_gentim2d_file(iarr)(1:7).EQ.'xx_tauv')
117 gforget 1.17 & vstress(i,j,bi,bj)=vstress(i,j,bi,bj)+
118     & xx_gentim2d(i,j,bi,bj,iarr)
119     #else
120 gforget 1.24 if (xx_gentim2d_file(iarr)(1:7).EQ.'xx_tauu')
121 gforget 1.23 & tmpUE(i,j,bi,bj)=tmpUE(i,j,bi,bj)
122     & +xx_gentim2d(i,j,bi,bj,iarr)
123 gforget 1.24 if (xx_gentim2d_file(iarr)(1:7).EQ.'xx_tauv')
124 gforget 1.23 & tmpVN(i,j,bi,bj)=tmpVN(i,j,bi,bj)
125     & +xx_gentim2d(i,j,bi,bj,iarr)
126 gforget 1.17 #endif
127     enddo
128     ENDDO
129     ENDDO
130     ENDDO
131     ENDDO
132     endif !if (ctrlUseGen) then
133     #endif
134 heimbach 1.1
135 gforget 1.21 #if (!defined (ALLOW_ECCO) || defined (ECCO_CTRL_DEPRECATED))
136 gforget 1.19
137 heimbach 1.1 #ifdef ALLOW_HFLUX_CONTROL
138 heimbach 1.5 call ctrl_get_gen (
139     & xx_hflux_file, xx_hfluxstartdate, xx_hfluxperiod,
140     & maskc, hflux, xx_hflux0, xx_hflux1, xx_hflux_dummy,
141 heimbach 1.11 & xx_hflux_remo_intercept, xx_hflux_remo_slope,
142 gforget 1.16 & whflux, mytime, myiter, mythid )
143 heimbach 1.1 #endif
144    
145     #ifdef ALLOW_SFLUX_CONTROL
146 heimbach 1.5 call ctrl_get_gen (
147     & xx_sflux_file, xx_sfluxstartdate, xx_sfluxperiod,
148     & maskc, sflux, xx_sflux0, xx_sflux1, xx_sflux_dummy,
149 heimbach 1.11 & xx_sflux_remo_intercept, xx_sflux_remo_slope,
150 gforget 1.16 & wsflux, mytime, myiter, mythid )
151 heimbach 1.1 #endif
152    
153 gforget 1.15 IF ( .NOT.useAtmWind ) THEN
154 gforget 1.21
155     IF ( .NOT.ctrlUseGen ) THEN
156 gforget 1.13 #ifndef ALLOW_ROTATE_UV_CONTROLS
157    
158 heimbach 1.1 #ifdef ALLOW_USTRESS_CONTROL
159 heimbach 1.5 call ctrl_get_gen (
160     & xx_tauu_file, xx_tauustartdate, xx_tauuperiod,
161     & maskw, ustress, xx_tauu0, xx_tauu1, xx_tauu_dummy,
162 heimbach 1.11 & xx_tauu_remo_intercept, xx_tauu_remo_slope,
163 gforget 1.16 & wtauu, mytime, myiter, mythid )
164 heimbach 1.1 #endif
165    
166     #ifdef ALLOW_VSTRESS_CONTROL
167 heimbach 1.5 call ctrl_get_gen (
168     & xx_tauv_file, xx_tauvstartdate, xx_tauvperiod,
169     & masks, vstress, xx_tauv0, xx_tauv1, xx_tauv_dummy,
170 heimbach 1.11 & xx_tauv_remo_intercept, xx_tauv_remo_slope,
171 gforget 1.16 & wtauv, mytime, myiter, mythid )
172 heimbach 1.1 #endif
173    
174 gforget 1.13 #else
175    
176 gforget 1.21 #if (defined (ALLOW_USTRESS_CONTROL) && defined (ALLOW_VSTRESS_CONTROL))
177 gforget 1.13
178     call ctrl_get_gen (
179     & xx_tauu_file, xx_tauustartdate, xx_tauuperiod,
180     & maskc, tmpUE, xx_tauu0, xx_tauu1, xx_tauu_dummy,
181     & xx_tauu_remo_intercept, xx_tauu_remo_slope,
182 gforget 1.16 & wtauu, mytime, myiter, mythid )
183 gforget 1.13
184     call ctrl_get_gen (
185     & xx_tauv_file, xx_tauvstartdate, xx_tauvperiod,
186     & maskc, tmpVN, xx_tauv0, xx_tauv1, xx_tauv_dummy,
187     & xx_tauv_remo_intercept, xx_tauv_remo_slope,
188 gforget 1.16 & wtauv, mytime, myiter, mythid )
189 gforget 1.13
190 gforget 1.21 #endif /* ALLOW_USTRESS_CONTROL and ALLOW_VSTRESS_CONTROL */
191    
192     #endif /* ALLOW_ROTATE_UV_CONTROLS */
193     ENDIF ! (.NOT.ctrlUseGen)
194    
195     #else
196 gforget 1.22 IF ( (useCTRL).AND.(.NOT.useAtmWind) ) THEN
197 gforget 1.21 #endif /* undef ALLOW_ECCO || def ECCO_CTRL_DEPRECATED */
198    
199     #ifdef ALLOW_ROTATE_UV_CONTROLS
200 gforget 1.13 _EXCH_XY_RL(tmpUE,myThid)
201     _EXCH_XY_RL(tmpVN,myThid)
202    
203     call rotate_uv2en_rl(tmpUX,tmpVY,tmpUE,tmpVN,
204     & .FALSE.,stressIsOnCgrid,.TRUE.,1,mythid)
205    
206     IF ( stressIsOnCgrid ) THEN
207     CALL EXCH_UV_XY_RL( tmpUX, tmpVY, .TRUE., myThid )
208     ELSE
209     CALL EXCH_UV_AGRID_3D_RL( tmpUX, tmpVY, .TRUE., 1, myThid)
210     ENDIF
211    
212     do bj = mybylo(mythid),mybyhi(mythid)
213     do bi = mybxlo(mythid),mybxhi(mythid)
214     do j = 1-oly,sny+oly
215     do i = 1-olx,snx+olx
216     ustress(i,j,bi,bj)=ustress(i,j,bi,bj)+tmpUX(i,j,bi,bj)
217     vstress(i,j,bi,bj)=vstress(i,j,bi,bj)+tmpVY(i,j,bi,bj)
218     enddo
219     enddo
220     enddo
221     enddo
222     #endif /* ALLOW_ROTATE_UV_CONTROLS */
223    
224 gforget 1.21 ENDIF !( .NOT.useAtmWind )
225 gforget 1.19
226 gforget 1.18 #endif /* ALLOW_CTRL */
227 gforget 1.13
228 heimbach 1.1 end

  ViewVC Help
Powered by ViewVC 1.1.22