92
93
96
97
98
99 integer, intent(in) :: ng, tile
100 integer, intent(in) :: LBi, UBi, LBj, UBj
101 integer, intent(in) :: IminS, ImaxS, JminS, JmaxS
102 integer, intent(in) :: Linp
103
104# ifdef ASSUMED_SHAPE
105# ifdef ADJUST_WSTRESS
106 real(r8), intent(in) :: tl_ustr(LBi:,LBj:,:,:)
107 real(r8), intent(in) :: tl_vstr(LBi:,LBj:,:,:)
108# endif
109# if defined ADJUST_STFLUX && defined SOLVE3D
110 real(r8), intent(inout) :: tflux(LBi:,LBj:,:,:,:)
111 real(r8), intent(inout) :: tl_tflux(LBi:,LBj:,:,:,:)
112# endif
113# ifdef ADJUST_WSTRESS
114 real(r8), intent(inout) :: ustr(LBi:,LBj:,:,:)
115 real(r8), intent(inout) :: vstr(LBi:,LBj:,:,:)
116 real(r8), intent(inout) :: sustr(LBi:,LBj:)
117 real(r8), intent(inout) :: svstr(LBi:,LBj:)
118# endif
119# if defined ADJUST_STFLUX && defined SOLVE3D
120 real(r8), intent(inout) :: stflx(LBi:,LBj:,:)
121# endif
122# else
123# ifdef ADJUST_WSTRESS
124 real(r8), intent(in) :: tl_ustr(LBi:UBi,LBj:UBj,Nfrec(ng),2)
125 real(r8), intent(in) :: tl_vstr(LBi:UBi,LBj:UBj,Nfrec(ng),2)
126# endif
127# if defined ADJUST_STFLUX && defined SOLVE3D
128 real(r8), intent(in) :: tflux(LBi:UBi,LBj:UBj, &
129 & Nfrec(ng),2,NT(ng))
130 real(r8), intent(in) :: tl_tflux(LBi:UBi,LBj:UBj, &
131 & Nfrec(ng),2,NT(ng))
132# endif
133# ifdef ADJUST_WSTRESS
134 real(r8), intent(inout) :: ustr(LBi:UBi,LBj:UBj,Nfrec(ng),2)
135 real(r8), intent(inout) :: vstr(LBi:UBi,LBj:UBj,Nfrec(ng),2)
136 real(r8), intent(inout) :: sustr(LBi:UBi,LBj:UBj)
137 real(r8), intent(inout) :: svstr(LBi:UBi,LBj:UBj)
138# endif
139# if defined ADJUST_STFLUX && defined SOLVE3D
140 real(r8), intent(inout) :: stflx(LBi:UBi,LBj:UBj,NT(ng))
141# endif
142# endif
143
144
145
146 integer :: i, it1, it2, j
147# ifdef SOLVE3D
148 integer :: itrc
149# endif
150 real(r8) :: fac, fac1, fac2
151
152# include "set_bounds.h"
153
154
155
156
157
158
159
160 IF (
nfrec(ng).eq.1)
THEN
161 it1=1
162 it2=1
163 fac1=1.0_r8
164 fac2=0.0_r8
165 ELSE
166# ifdef GENERIC_DSTART
168# else
169 it1=max(0,(
iic(ng)-1)/
nsff(ng))+1
170# endif
171 it2=min(it1+1,
nfrec(ng))
174 fac=1.0_r8/(fac1+fac2)
175 fac1=fac*fac1
176 fac2=fac*fac2
177 END IF
178
179# ifdef ADJUST_WSTRESS
180
181
182
183
184 DO j=jstrr,jendr
185 DO i=istr,iendr
186 sustr(i,j)=sustr(i,j)+ &
187 & fac1*tl_ustr(i,j,it1,linp)+ &
188 & fac2*tl_ustr(i,j,it2,linp)
189 END DO
190 END DO
191 DO j=jstr,jendr
192 DO i=istrr,iendr
193 svstr(i,j)=svstr(i,j)+ &
194 & fac1*tl_vstr(i,j,it1,linp)+ &
195 & fac2*tl_vstr(i,j,it2,linp)
196 END DO
197 END DO
198# endif
199# if defined ADJUST_STFLUX && defined SOLVE3D
200
201
202
203
206 DO j=jstrr,jendr
207 DO i=istrr,iendr
208 stflx(i,j,itrc)=stflx(i,j,itrc)+ &
209 & fac1*tl_tflux(i,j,it1,linp,itrc)+ &
210 & fac2*tl_tflux(i,j,it2,linp,itrc)
211 END DO
212 END DO
213 END IF
214 END DO
215# endif
216
217 RETURN
integer, dimension(:), allocatable nt
integer, dimension(:), allocatable iic
real(dp), dimension(:), allocatable dt
logical, dimension(:,:), allocatable lstflux
integer, dimension(:), allocatable nfrec
real(dp), dimension(:), allocatable time
integer, dimension(:), allocatable nsff
integer, dimension(:), allocatable ntstart
real(dp), dimension(:,:), allocatable sf_time