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

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

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

revision 1.7 by edhill, Thu Oct 23 04:41:40 2003 UTC revision 1.13 by gforget, Tue Jul 13 00:02:10 2010 UTC
# Line 1  Line 1 
 C  
1  C $Header$  C $Header$
2  C $Name$  C $Name$
3    
 #include "AD_CONFIG.h"  
4  #include "EXF_OPTIONS.h"  #include "EXF_OPTIONS.h"
5    
6        subroutine exf_GetSurfaceFluxes(        subroutine exf_GetSurfaceFluxes(
# Line 41  c     == global variables == Line 39  c     == global variables ==
39  #include "PARAMS.h"  #include "PARAMS.h"
40  #include "GRID.h"  #include "GRID.h"
41    
42  #include "exf_fields.h"  #include "EXF_FIELDS.h"
43  #if (defined (ALLOW_ADJOINT_RUN) || \  #include "EXF_PARAM.h"
44       defined (ALLOW_TANGENTLINEAR_RUN) || \  #ifdef ALLOW_AUTODIFF
      defined (ALLOW_ECCO_OPTIMIZATION))  
45  # include "ctrl.h"  # include "ctrl.h"
46  # include "ctrl_dummy.h"  # include "ctrl_dummy.h"
47  #endif  #endif
# Line 57  c     == routine arguments == Line 54  c     == routine arguments ==
54    
55  c     == global variables ==  c     == global variables ==
56    
57    #ifdef ALLOW_ROTATE_UV_CONTROLS
58          _RL     tmpUE(1-olx:snx+olx,1-oly:sny+oly,nsx,nsy)
59          _RL     tmpVN(1-olx:snx+olx,1-oly:sny+oly,nsx,nsy)
60          _RL     tmpUX(1-olx:snx+olx,1-oly:sny+oly,nsx,nsy)
61          _RL     tmpVY(1-olx:snx+olx,1-oly:sny+oly,nsx,nsy)
62          integer i,j,bi,bj
63    #endif
64    
65    
66  c     == end of interface ==  c     == end of interface ==
67    
68  #ifdef ALLOW_HFLUX_CONTROL  #ifdef ALLOW_HFLUX_CONTROL
69        call ctrl_get_gen (        call ctrl_get_gen (
70       &     xx_hflux_file, xx_hfluxstartdate, xx_hfluxperiod,       &     xx_hflux_file, xx_hfluxstartdate, xx_hfluxperiod,
71       &     maskc, hflux, xx_hflux0, xx_hflux1, xx_hflux_dummy,       &     maskc, hflux, xx_hflux0, xx_hflux1, xx_hflux_dummy,
72         &     xx_hflux_remo_intercept, xx_hflux_remo_slope,
73       &     mytime, myiter, mythid )       &     mytime, myiter, mythid )
74  #endif  #endif
75    
# Line 70  c     == end of interface == Line 77  c     == end of interface ==
77        call ctrl_get_gen (        call ctrl_get_gen (
78       &     xx_sflux_file, xx_sfluxstartdate, xx_sfluxperiod,       &     xx_sflux_file, xx_sfluxstartdate, xx_sfluxperiod,
79       &     maskc, sflux, xx_sflux0, xx_sflux1, xx_sflux_dummy,       &     maskc, sflux, xx_sflux0, xx_sflux1, xx_sflux_dummy,
80         &     xx_sflux_remo_intercept, xx_sflux_remo_slope,
81       &     mytime, myiter, mythid )       &     mytime, myiter, mythid )
82  #endif  #endif
83    
84    #ifndef ALLOW_ROTATE_UV_CONTROLS
85    
86  #ifdef ALLOW_USTRESS_CONTROL  #ifdef ALLOW_USTRESS_CONTROL
87        call ctrl_get_gen (        call ctrl_get_gen (
88       &     xx_tauu_file, xx_tauustartdate, xx_tauuperiod,       &     xx_tauu_file, xx_tauustartdate, xx_tauuperiod,
89       &     maskw, ustress, xx_tauu0, xx_tauu1, xx_tauu_dummy,       &     maskw, ustress, xx_tauu0, xx_tauu1, xx_tauu_dummy,
90         &     xx_tauu_remo_intercept, xx_tauu_remo_slope,
91       &     mytime, myiter, mythid )       &     mytime, myiter, mythid )
92  #endif  #endif
93    
# Line 84  c     == end of interface == Line 95  c     == end of interface ==
95        call ctrl_get_gen (        call ctrl_get_gen (
96       &     xx_tauv_file, xx_tauvstartdate, xx_tauvperiod,       &     xx_tauv_file, xx_tauvstartdate, xx_tauvperiod,
97       &     masks, vstress, xx_tauv0, xx_tauv1, xx_tauv_dummy,       &     masks, vstress, xx_tauv0, xx_tauv1, xx_tauv_dummy,
98         &     xx_tauv_remo_intercept, xx_tauv_remo_slope,
99       &     mytime, myiter, mythid )       &     mytime, myiter, mythid )
100  #endif  #endif
101    
102  #ifdef ALLOW_SWFLUX_CONTROL  #else
103    
104    #if defined(ALLOW_USTRESS_CONTROL) && defined(ALLOW_VSTRESS_CONTROL)
105    
106            do bj = mybylo(mythid),mybyhi(mythid)
107             do bi = mybxlo(mythid),mybxhi(mythid)
108              do j = 1-oly,sny+oly
109               do i = 1-olx,snx+olx
110                 tmpUE(i,j,bi,bj) = 0. _d 0
111                 tmpVN(i,j,bi,bj) = 0. _d 0
112                 tmpUX(i,j,bi,bj) = 0. _d 0
113                 tmpVY(i,j,bi,bj) = 0. _d 0
114               enddo
115              enddo
116             enddo
117            enddo
118    
119        call ctrl_get_gen (        call ctrl_get_gen (
120  NOT YET IMPLEMENTED       &     xx_tauu_file, xx_tauustartdate, xx_tauuperiod,
121         &     maskc, tmpUE, xx_tauu0, xx_tauu1, xx_tauu_dummy,
122         &     xx_tauu_remo_intercept, xx_tauu_remo_slope,
123       &     mytime, myiter, mythid )       &     mytime, myiter, mythid )
 #endif  
124    
 #ifdef ALLOW_LWFLUX_CONTROL  
125        call ctrl_get_gen (        call ctrl_get_gen (
126  NOT YET IMPLEMENTED       &     xx_tauv_file, xx_tauvstartdate, xx_tauvperiod,
127         &     maskc, tmpVN, xx_tauv0, xx_tauv1, xx_tauv_dummy,
128         &     xx_tauv_remo_intercept, xx_tauv_remo_slope,
129       &     mytime, myiter, mythid )       &     mytime, myiter, mythid )
130    
131          _EXCH_XY_RL(tmpUE,myThid)
132          _EXCH_XY_RL(tmpVN,myThid)
133    
134          call rotate_uv2en_rl(tmpUX,tmpVY,tmpUE,tmpVN,
135         &     .FALSE.,stressIsOnCgrid,.TRUE.,1,mythid)
136    
137          IF ( stressIsOnCgrid ) THEN
138            CALL EXCH_UV_XY_RL( tmpUX, tmpVY, .TRUE., myThid )
139          ELSE
140            CALL EXCH_UV_AGRID_3D_RL( tmpUX, tmpVY, .TRUE., 1, myThid)
141          ENDIF  
142    
143            do bj = mybylo(mythid),mybyhi(mythid)
144             do bi = mybxlo(mythid),mybxhi(mythid)
145              do j = 1-oly,sny+oly
146               do i = 1-olx,snx+olx
147                 ustress(i,j,bi,bj)=ustress(i,j,bi,bj)+tmpUX(i,j,bi,bj)
148                 vstress(i,j,bi,bj)=vstress(i,j,bi,bj)+tmpVY(i,j,bi,bj)
149               enddo
150              enddo
151             enddo
152            enddo
153    
154  #endif  #endif
155    #endif /* ALLOW_ROTATE_UV_CONTROLS */
156    
157    
158    
159        end        end

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.13

  ViewVC Help
Powered by ViewVC 1.1.22