Commit eecada21 authored by gotm's avatar gotm
Browse files

cleaned the code

parent d797f9fd
!$Id: gotm.F90,v 1.1 2002-05-02 14:00:54 gotm Exp $ !$Id: gotm.F90,v 1.2 2003-04-01 15:27:27 gotm Exp $
#include "cppdefs.h" #include "cppdefs.h"
!----------------------------------------------------------------------- !-----------------------------------------------------------------------
!BOP !BOP
...@@ -31,8 +31,11 @@ ...@@ -31,8 +31,11 @@
! Original author(s): Karsten Bolding & Hans Burchard ! Original author(s): Karsten Bolding & Hans Burchard
! !
! $Log: gotm.F90,v $ ! $Log: gotm.F90,v $
! Revision 1.1 2002-05-02 14:00:54 gotm ! Revision 1.2 2003-04-01 15:27:27 gotm
! Initial revision ! cleaned the code
!
! Revision 1.1.1.1 2002/05/02 14:00:54 gotm
! recovering after CVS crash
! !
! Revision 1.11 2001/10/23 07:06:43 bbh ! Revision 1.11 2001/10/23 07:06:43 bbh
! PARABOLIC VISCOSITY --> PARABOLIC_VISCOSITY ! PARABOLIC VISCOSITY --> PARABOLIC_VISCOSITY
...@@ -87,85 +90,77 @@ ...@@ -87,85 +90,77 @@
write(debug,*) 'gotm() # ',Ncall write(debug,*) 'gotm() # ',Ncall
#endif #endif
n = n+1
do i=iimin,iimax do i=iimin,iimax
do j=jjmin,jjmax do j=jjmin,jjmax
if (az(i,j) .eq. 1 ) then if (az(i,j) .eq. 1 ) then
u_taus = sqrt(taus(i,j)) u_taus = sqrt(taus(i,j))
u_taub = sqrt(taub(i,j)) u_taub = sqrt(taub(i,j))
h = hn(i,j,:) h = hn(i,j,:)
SS1d = SS(i,j,:) SS1d = SS(i,j,:)
NN1d = NN(i,j,:) NN1d = NN(i,j,:)
P = num(i,j,:)*SS1d P = num(i,j,:)*SS1d
B = -nuh(i,j,:)*NN1d B = -nuh(i,j,:)*NN1d
tke1d=tke(i,j,:) tke1d=tke(i,j,:)
eps1d=eps(i,j,:) eps1d=eps(i,j,:)
L1d=cde*tke1d**1.5/eps1d L1d=cde*tke1d**1.5/eps1d
num1d=num(i,j,:) num1d=num(i,j,:)
nuh1d=nuh(i,j,:) nuh1d=nuh(i,j,:)
z0s = 0.1 z0s = 0.1
z0b=0.5*(max(zub(i-1,j),zub(i,j))+max(zvb(i,j-1),zvb(i,j))) z0b=0.5*(max(zub(i-1,j),zub(i,j))+max(zvb(i,j-1),zvb(i,j)))
if (z0s.gt.D(i,j)/10.) z0s=D(i,j)/10. if (z0s.gt.D(i,j)/10.) z0s=D(i,j)/10.
#ifdef PARABOLIC_VISCOSITY #ifdef PARABOLIC_VISCOSITY
zz = _ZERO_ zz = _ZERO_
do k=1,kmax-1 do k=1,kmax-1
zz=zz+hn(i,j,k) zz=zz+hn(i,j,k)
tke1d(k)=max(1.e-10,3.333333*u_taub**2*(1.-zz/D(i,j))) tke1d(k)=max(1.e-10,3.333333*u_taub**2*(1.-zz/D(i,j)))
L1d(k)=0.4*(zz+z0b)*sqrt(1.-zz/D(i,j)) L1d(k)=0.4*(zz+z0b)*sqrt(1.-zz/D(i,j))
eps1d(k)=0.16431677*tke1d(k)**1.5/L1d(k) eps1d(k)=0.16431677*tke1d(k)**1.5/L1d(k)
num1d(k)=0.09*tke1d(k)**2/eps1d(k) num1d(k)=0.09*tke1d(k)**2/eps1d(k)
nuh1d(k)=num1d(k) nuh1d(k)=num1d(k)
end do end do
#else #else
call do_turbulence(kmax,dt,D(i,j),u_taus,u_taub,z0s,z0b,h, & call do_turbulence(kmax,dt,D(i,j),u_taus,u_taub,z0s,z0b,h, &
NN1d,SS1d,P,B) NN1d,SS1d,P,B)
#endif #endif
tke(i,j,:) = tke1d tke(i,j,:) = tke1d
eps(i,j,:) = eps1d eps(i,j,:) = eps1d
num(i,j,:) = num1d num(i,j,:) = num1d
nuh(i,j,:) = nuh1d nuh(i,j,:) = nuh1d
#ifdef HAIDVOGEL_TEST #ifdef HAIDVOGEL_TEST
num(i,j,:) = 0.e-10 num(i,j,:) = 0.e-10
nuh(i,j,:) = 0.e-10 nuh(i,j,:) = 0.e-10
#endif #endif
#ifdef NOMADS_TEST #ifdef NOMADS_TEST
num(i,j,:) = _ZERO_ num(i,j,:) = _ZERO_
nuh(i,j,:) = _ZERO_ nuh(i,j,:) = _ZERO_
#endif #endif
end if end if
end do end do
end do end do
! Extrapolating eddy viscosity to open boundary points: ! Extrapolating eddy viscosity to open boundary points:
do i=iimin,iimax
do k=1,kmax-1 if (az(i,jjmin).eq.2) num(i,jjmin,:)=num(i,jjmin+1,:)
do i=iimin,iimax if (az(i,jjmax).eq.2) num(i,jjmax,:)=num(i,jjmax-1,:)
if (az(i,jjmin).eq.2) num(i,jjmin,k)=num(i,jjmin+1,k) if (az(i,jjmin).eq.2) nuh(i,jjmin,:)=nuh(i,jjmin+1,:)
if (az(i,jjmax).eq.2) num(i,jjmax,k)=num(i,jjmax-1,k) if (az(i,jjmax).eq.2) nuh(i,jjmax,:)=nuh(i,jjmax-1,:)
if (az(i,jjmin).eq.2) nuh(i,jjmin,k)=nuh(i,jjmin+1,k)
if (az(i,jjmax).eq.2) nuh(i,jjmax,k)=nuh(i,jjmax-1,k)
end do
end do end do
do k=1,kmax-1 do j=jjmin,jjmax
do j=jjmin,jjmax if (az(iimin,j).eq.2) num(iimin,j,:)=num(iimin+1,j,:)
if (az(iimin,j).eq.2) num(iimin,j,k)=num(iimin+1,j,k) if (az(iimax,j).eq.2) num(iimax,j,:)=num(iimax+1,j,:)
if (az(iimax,j).eq.2) num(iimax,j,k)=num(iimax+1,j,k) if (az(iimin,j).eq.2) nuh(iimin,j,:)=nuh(iimin+1,j,:)
if (az(iimin,j).eq.2) nuh(iimin,j,k)=nuh(iimin+1,j,k) if (az(iimax,j).eq.2) nuh(iimax,j,:)=nuh(iimax+1,j,:)
if (az(iimax,j).eq.2) nuh(iimax,j,k)=nuh(iimax+1,j,k)
end do
end do end do
#ifdef DEBUG #ifdef DEBUG
write(debug,*) 'Leaving gotm()' write(debug,*) 'Leaving gotm()'
write(debug,*) write(debug,*)
......
!$Id: m3d.F90,v 1.1 2002-05-02 14:00:51 gotm Exp $ !$Id: m3d.F90,v 1.2 2003-04-01 15:27:56 gotm Exp $
#include "cppdefs.h" #include "cppdefs.h"
!----------------------------------------------------------------------- !-----------------------------------------------------------------------
!BOP !BOP
...@@ -42,8 +42,11 @@ ...@@ -42,8 +42,11 @@
! Original author(s): Karsten Bolding & Hans Burchard ! Original author(s): Karsten Bolding & Hans Burchard
! !
! $Log: m3d.F90,v $ ! $Log: m3d.F90,v $
! Revision 1.1 2002-05-02 14:00:51 gotm ! Revision 1.2 2003-04-01 15:27:56 gotm
! Initial revision ! cleaned the code
!
! Revision 1.1.1.1 2002/05/02 14:00:51 gotm
! recovering after CVS crash
! !
! Revision 1.30 2001/10/26 09:13:24 bbh ! Revision 1.30 2001/10/26 09:13:24 bbh
! Only call slow_diffusion() if Am > 0. ! Only call slow_diffusion() if Am > 0.
...@@ -210,18 +213,18 @@ ...@@ -210,18 +213,18 @@
dt = M*timestep dt = M*timestep
hn= _ZERO_ hn= _ZERO_
uu= _ZERO_ uu= _ZERO_
vv= _ZERO_ vv= _ZERO_
ww= _ZERO_ ww= _ZERO_
rru= _ZERO_ rru= _ZERO_
rrv= _ZERO_ rrv= _ZERO_
uuEx= _ZERO_ uuEx= _ZERO_
vvEx= _ZERO_ vvEx= _ZERO_
tke=1.e-10 tke=1.e-10
eps=1.e-10 eps=1.e-10
num=avmmol num=avmmol
nuh=avmmol nuh=avmmol
#ifdef UV_TVD #ifdef UV_TVD
uadv = _ZERO_ uadv = _ZERO_
vadv = _ZERO_ vadv = _ZERO_
...@@ -305,7 +308,6 @@ ...@@ -305,7 +308,6 @@
#ifndef NO_BOTTFRIC #ifndef NO_BOTTFRIC
if (kmax.gt.1) then if (kmax.gt.1) then
call bottom_friction_3d() call bottom_friction_3d()
end if end if
#endif #endif
SS = _ZERO_ SS = _ZERO_
...@@ -369,6 +371,7 @@ ...@@ -369,6 +371,7 @@
#endif #endif
#endif #endif
end if end if
call slow_terms() call slow_terms()
call stop_macro() call stop_macro()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment