86
87
90
91
92
93 integer, intent(in) :: ng, tile
94 integer, intent(in) :: LBi, UBi, LBj, UBj
95 integer, intent(in) :: IminS, ImaxS, JminS, JmaxS
96 integer, intent(in) :: Linp
97
98# ifdef ASSUMED_SHAPE
99# ifdef ADJUST_WSTRESS
100 real(r8), intent(in) :: tl_ustr(LBi:,LBj:,:,:)
101 real(r8), intent(in) :: tl_vstr(LBi:,LBj:,:,:)
102# endif
103# if defined ADJUST_STFLUX && defined SOLVE3D
104 real(r8), intent(inout) :: tl_tflux(LBi:,LBj:,:,:,:)
105# endif
106# ifdef ADJUST_WSTRESS
107 real(r8), intent(inout) :: tl_sustr(LBi:,LBj:)
108 real(r8), intent(inout) :: tl_svstr(LBi:,LBj:)
109# endif
110# if defined ADJUST_STFLUX && defined SOLVE3D
111 real(r8), intent(inout) :: tl_stflx(LBi:,LBj:,:)
112# endif
113# else
114# ifdef ADJUST_WSTRESS
115 real(r8), intent(in) :: tl_ustr(LBi:UBi,LBj:UBj,Nfrec(ng),2)
116 real(r8), intent(in) :: tl_vstr(LBi:UBi,LBj:UBj,Nfrec(ng),2)
117# endif
118# if defined ADJUST_STFLUX && defined SOLVE3D
119 real(r8), intent(in) :: tl_tflux(LBi:UBi,LBj:UBj, &
120 & Nfrec(ng),2,NT(ng))
121# endif
122# ifdef ADJUST_WSTRESS
123 real(r8), intent(inout) :: tl_sustr(LBi:UBi,LBj:UBj)
124 real(r8), intent(inout) :: tl_svstr(LBi:UBi,LBj:UBj)
125# endif
126# if defined ADJUST_STFLUX && defined SOLVE3D
127 real(r8), intent(inout) :: tl_stflx(LBi:UBi,LBj:UBj,NT(ng))
128# endif
129# endif
130
131
132
133 integer :: i, it1, it2, j
134# ifdef SOLVE3D
135 integer :: itrc
136# endif
137 real(r8) :: fac, fac1, fac2
138
139# include "set_bounds.h"
140
141
142
143
144
145
146
147
148 IF (
nfrec(ng).eq.1)
THEN
149 it1=1
150 it2=1
151 fac1=1.0_r8
152 fac2=0.0_r8
153 ELSE
154# ifdef GENERIC_DSTART
156# else
157 it1=max(0,(
iic(ng)-1)/
nsff(ng))+1
158# endif
159 it2=min(it1+1,
nfrec(ng))
162 fac=1.0_r8/(fac1+fac2)
163 fac1=fac*fac1
164 fac2=fac*fac2
165 END IF
166
167# ifdef ADJUST_WSTRESS
168
169
170
171
172 DO j=jstrr,jendr
173 DO i=istr,iendr
174 tl_sustr(i,j)=tl_sustr(i,j)+ &
175 & fac1*tl_ustr(i,j,it1,linp)+ &
176 & fac2*tl_ustr(i,j,it2,linp)
177 END DO
178 END DO
179 DO j=jstr,jendr
180 DO i=istrr,iendr
181 tl_svstr(i,j)=tl_svstr(i,j)+ &
182 & fac1*tl_vstr(i,j,it1,linp)+ &
183 & fac2*tl_vstr(i,j,it2,linp)
184 END DO
185 END DO
186# endif
187# if defined ADJUST_STFLUX && defined SOLVE3D
188
189
190
191
194 DO j=jstrr,jendr
195 DO i=istrr,iendr
196 tl_stflx(i,j,itrc)=tl_stflx(i,j,itrc)+ &
197 & fac1*tl_tflux(i,j,it1,linp,itrc)+ &
198 & fac2*tl_tflux(i,j,it2,linp,itrc)
199 END DO
200 END DO
201 END IF
202 END DO
203# endif
204
205 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