100 SUBROUTINE glt_sndmlrf( pbathy,tpdom,tpatc,tpml,tpdia,tpsit,tptfl, &
106 #if ! defined in_surfex
107 USE mode_gltools_bound
109 USE modi_gltools_adjflx
114 REAL,
DIMENSION(nx,ny),
INTENT(in) :: &
116 TYPE(t_dom),
DIMENSION(nx,ny),
INTENT(in) :: &
118 TYPE(t_atm),
DIMENSION(nx,ny),
INTENT(in) :: &
120 TYPE(t_mxl),
DIMENSION(nx,ny),
INTENT(in) :: &
122 TYPE(t_dia),
DIMENSION(nx,ny),
INTENT(inout) :: &
124 TYPE(t_sit),
DIMENSION(nt,nx,ny),
INTENT(in) :: &
126 TYPE(t_tfl),
DIMENSION(nx,ny),
INTENT(inout) :: &
128 REAL,
DIMENSION(nx,ny),
INTENT(out) :: &
130 TYPE(t_2oc),
DIMENSION(nx,ny),
INTENT(inout) :: &
135 LOGICAL,
DIMENSION(nx,ny) :: &
137 REAL,
DIMENSION(nx,ny) :: &
138 zfsit,zfld,ztxgw,ztygw,zmsi,zmsa,zssi
139 REAL,
DIMENSION(nt,nx,ny) :: &
141 REAL,
DIMENSION(nx,ny) :: &
142 zwork2,zhsit_ext,zdx_ext,zdy_ext
143 TYPE(t_tfl),
DIMENSION(nx,ny) :: &
166 zfsit(:,:) = sum( tpsit(:,:,:)%fsi,dim=1 )
167 zfld(:,:) = 1.-zfsit(:,:)
171 pustar(:,:) = sqrt( sqrt(tptfl(:,:)%xio**2+tptfl(:,:)%yio**2)/rhosw )
177 WHERE ( pbathy(:,:)<=80. )
178 tptfl(:,:)%xio = tpatc(:,:)%ztx
179 tptfl(:,:)%yio = tpatc(:,:)%mty
184 tpdia(:,:)%atx = zfsit(:,:)*tpatc(:,:)%ztx
185 tpdia(:,:)%otx = -zfsit(:,:)*tptfl(:,:)%xio
186 ztxgw(:,:) = -tpdia(:,:)%otx + zfld(:,:)*tpatc(:,:)%ztx
188 ztxgw(:,:) = ztxgw(:,:)*float( tpdom(:,:)%umk )
192 tpdia(:,:)%aty = zfsit(:,:)*tpatc(:,:)%mty
193 tpdia(:,:)%oty = -zfsit(:,:)*tptfl(:,:)%yio
194 ztygw(:,:) = -tpdia(:,:)%oty + zfld(:,:)*tpatc(:,:)%mty
196 ztygw(:,:) = ztygw(:,:)*float( tpdom(:,:)%vmk )
198 #if ! defined in_surfex
199 CALL gltools_bound(
'U',
'vector',ztxgw )
200 CALL gltools_bound(
'V',
'vector',ztygw )
213 IF ( nadvect==1 .AND. ndyncor==1 )
THEN
226 ycrit = ( tpdom(:,:)%lat>0..AND.tpdom(:,:)%tmk==1.AND.zfsit(:,:)>epsil1 )
229 ycrit = ( tpdom(:,:)%lat<0..AND.tpdom(:,:)%tmk==1.AND.zfsit(:,:)>epsil1 )
232 CALL
glt_updtfl(
'FW2O', tpml,tzdfl,zdm,pent=zent )
246 ycrit = ( tpdom(:,:)%lat>0..AND.tpdom(:,:)%tmk==1.AND.zfsit(:,:)>epsil1 )
249 WHERE( abs( zmsi(:,:) )>epsil2 )
250 zssi(:,:) = zmsa(:,:)/zmsi(:,:)
255 zdm(1,:,:) = zdm(1,:,:) + zmsi(:,:)
257 zsalt(1,:,:) = zsalt(1,:,:) + 1000.*zssi(:,:)
260 ycrit = ( tpdom(:,:)%lat<0..AND.tpdom(:,:)%tmk==1.AND.zfsit(:,:)>epsil1 )
263 WHERE( abs( zmsi(:,:) )>epsil2 )
264 zssi(:,:) = zmsa(:,:)/zmsi(:,:)
269 zdm(1,:,:) = zdm(1,:,:) + zmsi(:,:)
271 zsalt(1,:,:) = zsalt(1,:,:) + 1000.*zssi(:,:)
279 CALL
glt_updtfl(
'I2O', tpml,tzdfl,zdm,pent=zent,psalt=zsalt )
285 tptfl(:,:)%tio = tptfl(:,:)%tio + tzdfl(:,:)%tio
286 tptfl(:,:)%tlo = tptfl(:,:)%tlo + tzdfl(:,:)%tlo
287 tptfl(:,:)%wio = tptfl(:,:)%wio + tzdfl(:,:)%wio
288 tptfl(:,:)%wlo = tptfl(:,:)%wlo + tzdfl(:,:)%wlo
289 tptfl(:,:)%cio = tptfl(:,:)%cio + tzdfl(:,:)%cio
290 tptfl(:,:)%sio = tptfl(:,:)%sio + tzdfl(:,:)%sio
306 ( tptfl(:,:)%tio + tptfl(:,:)%tlo )* &
307 float( tpdom(:,:)%tmk )
308 #if ! defined in_surfex
309 CALL gltools_bound(
'T',
'scalar',zwork2 )
311 tpall_oce(:,:)%nsf = zwork2(:,:)
317 zwork2(:,:) = ( tptfl(:,:)%lio + tptfl(:,:)%llo )* &
318 float( tpdom(:,:)%tmk )
319 #if ! defined in_surfex
320 CALL gltools_bound(
'T',
'scalar',zwork2 )
322 tpall_oce(:,:)%swa = zwork2(:,:)
334 ( tptfl(:,:)%cio + tptfl(:,:)%wlo + tptfl(:,:)%wio )* &
335 float( tpdom(:,:)%tmk )
336 #if ! defined in_surfex
337 CALL gltools_bound(
'T',
'scalar',zwork2 )
339 tpall_oce(:,:)%cdf = zwork2(:,:)
345 ( tptfl(:,:)%sio )*float( tpdom(:,:)%tmk )
346 #if ! defined in_surfex
347 CALL gltools_bound(
'T',
'scalar',zwork2 )
349 tpall_oce(:,:)%saf = zwork2(:,:)
356 ( tptfl(:,:)%wio + tptfl(:,:)%wlo )*float( tpdom(:,:)%tmk )
359 tpdia%sp1 = tzdfl%wio
360 tpdia%sp2 = tzdfl%wlo
362 #if ! defined in_surfex
363 CALL gltools_bound(
'T',
'scalar',zwork2 )
365 tpall_oce(:,:)%wfl = zwork2(:,:)
373 zwork2(:,:) = ztxgw(:,:)*float( tpdom(:,:)%umk )
374 #if ! defined in_surfex
375 CALL gltools_bound(
'U',
'vector',zwork2 )
377 tpall_oce(:,:)%ztx = zwork2(:,:)
381 zwork2(:,:) = ztygw(:,:)*float( tpdom(:,:)%vmk )
382 #if ! defined in_surfex
383 CALL gltools_bound(
'V',
'vector',zwork2 )
385 tpall_oce(:,:)%mty = zwork2(:,:)
391 zwork2(:,:) = pustar(:,:)*float( tpdom(:,:)%tmk )
392 #if ! defined in_surfex
393 CALL gltools_bound(
'T',
'scalar',zwork2 )
395 tpall_oce(:,:)%ust = zwork2(:,:)
subroutine glt_sndmlrf(pbathy, tpdom, tpatc, tpml, tpdia, tpsit, tptfl, pustar, tpall_oce)
subroutine glt_updtfl(hflag, tpmxl, tptfl, pdmass, pent, psalt)