Commit 11937e53 authored by kbk's avatar kbk
Browse files

parallel support, cleaned code + NO_3D, NO_BAROCLINIC

parent e0730661
!$Id: gotm.F90,v 1.2 2003-04-01 15:27:27 gotm Exp $
!$Id: gotm.F90,v 1.3 2003-04-07 13:36:38 kbk Exp $
#include "cppdefs.h"
!-----------------------------------------------------------------------
!BOP
......@@ -13,10 +13,9 @@
! !USES:
use domain, only: iimin,iimax,jjmin,jjmax,kmax,az,min_depth,crit_depth
use domain, only: egon => H
use m2d, only: D,zub,zvb,z
use variables_2d, only: D,zub,zvb,z
use variables_3d, only: dt,kmin,ho,hn,tke,eps,SS,NN,num,nuh,taus,taub
use mtridiagonal, only: init_tridiagonal
use turbulence, only: init_turbulence, do_turbulence,cde
use turbulence, only: do_turbulence,cde
use turbulence, only: tke1d => tke, eps1d => eps, L1d => L
use turbulence, only: num1d => num, nuh1d => nuh
IMPLICIT NONE
......@@ -31,8 +30,8 @@
! Original author(s): Karsten Bolding & Hans Burchard
!
! $Log: gotm.F90,v $
! Revision 1.2 2003-04-01 15:27:27 gotm
! cleaned the code
! Revision 1.3 2003-04-07 13:36:38 kbk
! parallel support, cleaned code + NO_3D, NO_BAROCLINIC
!
! Revision 1.1.1.1 2002/05/02 14:00:54 gotm
! recovering after CVS crash
......@@ -90,8 +89,8 @@
write(debug,*) 'gotm() # ',Ncall
#endif
do i=iimin,iimax
do j=jjmin,jjmax
do j=jjmin,jjmax
do i=iimin,iimax
if (az(i,j) .eq. 1 ) then
......@@ -113,7 +112,7 @@
z0s = 0.1
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
zz = _ZERO_
......
!$Id: rivers.F90,v 1.1 2002-05-02 14:01:00 gotm Exp $
!$Id: rivers.F90,v 1.2 2003-04-07 13:36:38 kbk Exp $
#include "cppdefs.h"
!-----------------------------------------------------------------------
!BOP
......@@ -30,8 +30,10 @@
#endif
use m2d, only: dtm
use variables_2d, only: z
#ifndef NO_BAROCLINIC
use m3d, only: calc_salt,calc_temp
use variables_3d, only: hn,ssen,T,S
#endif
IMPLICIT NONE
!
private
......@@ -56,8 +58,11 @@
! Original author(s): Karsten Bolding & Hans Burchard
!
! $Log: rivers.F90,v $
! Revision 1.1 2002-05-02 14:01:00 gotm
! Initial revision
! Revision 1.2 2003-04-07 13:36:38 kbk
! parallel support, cleaned code + NO_3D, NO_BAROCLINIC
!
! Revision 1.1.1.1 2002/05/02 14:01:00 gotm
! recovering after CVS crash
!
! Revision 1.3 2001/10/07 14:50:22 bbh
! Reading river data implemented - NetCFD
......@@ -215,6 +220,7 @@
height = rvol*ARCD1
river_int_flux(n)=river_int_flux(n)+height
z(i,j) = z(i,j) + height
#ifndef NO_BAROCLINIC
if (do_3d) then
if (calc_salt) then
S(i,j,1:kmax) = S(i,j,1:kmax)*(H(i,j)+ssen(i,j)) &
......@@ -238,6 +244,7 @@
end if
#endif
end if
#endif
end if
end do
case default
......
!$Id: salinity.F90,v 1.2 2003-03-17 14:59:33 gotm Exp $
!$Id: salinity.F90,v 1.3 2003-04-07 13:36:38 kbk Exp $
#include "cppdefs.h"
!-----------------------------------------------------------------------
!BOP
......@@ -12,10 +12,14 @@
! Description still missing
!
! !USES:
use commhalo, only: myid,update_3d_halo,wait_halo,D_TAG
use domain, only: imin,jmin,imax,jmax,H,az
use domain, only: imin,jmin,imax,jmax,ioff,joff
#ifdef HAIDVOGEL_TEST
use domain, only: iextr,jextr
#endif
use domain, only: iimin,jjmin,iimax,jjmax,kmax
use domain, only: H,az
use variables_3d, only: S,hn
use halo_zones, only: update_3d_halo,wait_halo,D_TAG
IMPLICIT NONE
!
private
......@@ -25,17 +29,18 @@
!
! !PRIVATE DATA MEMBERS:
integer :: salt_method=1,salt_format=2
character(len=32) :: salt_file="t_and_s.nc",salt_name='salt'
character(len=PATH_MAX) :: salt_file="t_and_s.nc"
character(len=32) :: salt_name='salt'
REALTYPE :: salt_const=35.
integer :: salt_hor_adv=1,salt_ver_adv=1,salt_strang=0
REALTYPE :: salt_AH=-1.
REALTYPE :: salt_AH=-_ONE_
!
! !REVISION HISTORY:
! Original author(s): Karsten Bolding & Hans Burchard
!
! $Log: salinity.F90,v $
! Revision 1.2 2003-03-17 14:59:33 gotm
! Added Black Sea support
! Revision 1.3 2003-04-07 13:36:38 kbk
! parallel support, cleaned code + NO_3D, NO_BAROCLINIC
!
! Revision 1.1.1.1 2002/05/02 14:00:58 gotm
! recovering after CVS crash
......@@ -139,9 +144,6 @@ field_no=1
#endif
#ifdef MED_15X15MINS_TEST
field_no=1
#endif
#ifdef BLACK_SEA_TEST
field_no=1
#endif
LEVEL2 'init_salinity()'
......@@ -201,11 +203,15 @@ stop 'salinity - dx is not known'
end do
#endif
#ifdef HAIDVOGEL_TEST
S = _ZERO_
S(iimin:iimax/2,jjmin:jjmax,1:kmax) = 6.4102564
S(iimin:iimax/2,jjmin:jjmax,1:kmax) = 5.
S(iimax/2+1:iimax,jjmin:jjmax,1:kmax) = 0.
S(iimax/2+1:iimax,jjmin:jjmax,1:kmax) = 0.
STDERR 'salinity= ',iimin,iimax,i+ioff,iextr/2
do i=iimin-1,iimax+1
if(i+ioff .le. iextr/2) then
S(i,jjmin-1:jjmax+1,0:kmax) = 6.4102564
S(i,jjmin-1:jjmax+1,0:kmax) = 5.
else
S(i,jjmin-1:jjmax+1,0:kmax) = 0.
end if
end do
#endif
!#else
!#ifdef PECS_TEST
......@@ -302,7 +308,7 @@ stop 'salinity - dx is not known'
#endif
call do_advection_3d(dt,S,uu,vv,ww,hun,hvn,ho,hn, &
delxu,delxv,delyu,delyv,area_inv,az,au,av, &
salt_hor_adv,salt_ver_adv,salt_strang,salt_AH)
salt_hor_adv,salt_ver_adv,salt_strang,salt_AH)
#ifdef PECS_TEST
S(iimin:iimin,jjmin:jjmax,1:kmax)=10.
......
!$Id: slow_bottom_friction.F90,v 1.1 2002-05-02 14:00:55 gotm Exp $
!$Id: slow_bottom_friction.F90,v 1.2 2003-04-07 13:36:38 kbk Exp $
#include "cppdefs.h"
!-----------------------------------------------------------------------
!BOP
......@@ -11,10 +11,10 @@
! !DESCRIPTION:
!
! !USES:
use parameters, only: kappa
use domain, only: iimin,iimax,jjmin,jjmax,HU,HV,min_depth,au,av
use m2d, only: zub,zvb,ru,rv,Uinto,Vinto
use variables_3d, only: ssuo,ssun,ssvo,ssvn
use parameters, only: kappa
use variables_2d, only: zub,zvb,ru,rv,Uinto,Vinto
use variables_3d, only: ssuo,ssun,ssvo,ssvn
IMPLICIT NONE
!
! !INPUT PARAMETERS:
......@@ -27,8 +27,11 @@
! Original author(s): Hans Burchard & Karsten Bolding
!
! $Log: slow_bottom_friction.F90,v $
! Revision 1.1 2002-05-02 14:00:55 gotm
! Initial revision
! Revision 1.2 2003-04-07 13:36:38 kbk
! parallel support, cleaned code + NO_3D, NO_BAROCLINIC
!
! Revision 1.1.1.1 2002/05/02 14:00:55 gotm
! recovering after CVS crash
!
! Revision 1.3 2001/06/22 08:19:10 bbh
! Compiler options such as USE_MASK and OLD_DRY deleted.
......@@ -60,72 +63,80 @@
Ncall = Ncall+1
write(debug,*) 'slow_bottom_friction() # ',Ncall
#endif
ruu = _ZERO_
rvv = _ZERO_
Ui = _ZERO_
Vi = _ZERO_
do j=jjmin,jjmax+1
do i=iimin-1,iimax
Ui(i,j)=Uinto(i,j)/(ssuo(i,j)+HU(i,j))
if(au(i,j) .ge. 1) then
Ui(i,j)=Uinto(i,j)/(ssuo(i,j)+HU(i,j))
else
Ui(i,j)=_ZERO_
end if
end do
end do
do j=jjmin-1,jjmax
do i=iimin,iimax+1
Vi(i,j)=Vinto(i,j)/(ssvo(i,j)+HV(i,j))
if(av(i,j) .ge. 1) then
Vi(i,j)=Vinto(i,j)/(ssvo(i,j)+HV(i,j))
else
Vi(i,j)=_ZERO_
end if
end do
end do
do j=jjmin,jjmax
do i=iimin,iimax
if (au(i,j).ge.1) then
HH=max(min_depth,ssun(i,j)+HU(i,j))
ruu(i,j)=(zub(i,j)+0.5*HH)/zub(i,j)
if (ruu(i,j).le.1.) then
write(9,*) ssuo(i,j),' Bottom xfriction coefficient infinite.'
stop
end if
ruu(i,j)=(kappa/log(ruu(i,j)))**2
if (au(i,j) .ge. 1) then
HH=max(min_depth,ssun(i,j)+HU(i,j))
ruu(i,j)=(zub(i,j)+0.5*HH)/zub(i,j)
if (ruu(i,j) .le. _ONE_) then
STDERR i,j,ssuo(i,j),' Bottom xfriction coefficient infinite.'
stop 'slow_bottom_friction()'
end if
ruu(i,j)=(kappa/log(ruu(i,j)))**2
end if
end do
end do
do j=jjmin,jjmax
do i=iimin,iimax
if (av(i,j).ge.1) then
HH=max(min_depth,ssvn(i,j)+HV(i,j))
rvv(i,j)=(zvb(i,j)+0.5*HH)/zvb(i,j)
if (rvv(i,j).le.1.) then
write(9,*) ssvo(i,j),' Bottom yfriction coefficient infinite.'
stop
end if
rvv(i,j)=(kappa/log(rvv(i,j)))**2
if (av(i,j) .ge. 1) then
HH=max(min_depth,ssvn(i,j)+HV(i,j))
rvv(i,j)=(zvb(i,j)+0.5*HH)/zvb(i,j)
if (rvv(i,j) .le. _ONE_) then
STDERR i,j,ssvo(i,j),' Bottom yfriction coefficient infinite.'
stop 'slow_bottom_friction()'
end if
rvv(i,j)=(kappa/log(rvv(i,j)))**2
end if
end do
end do
do j=jjmin,jjmax
do i=iimin,iimax
if (au(i,j).ge.1) then
uloc=Ui(i,j)
vloc=0.25*( Vi(i ,j ) &
+Vi(i+1,j ) &
+Vi(i ,j-1) &
+Vi(i+1,j-1) )
ru(i,j)=ruu(i,j)*sqrt(uloc**2+vloc**2)
if (au(i,j) .ge. 1) then
uloc=Ui(i,j)
vloc=0.25*( Vi(i ,j ) &
+Vi(i+1,j ) &
+Vi(i ,j-1) &
+Vi(i+1,j-1) )
ru(i,j)=ruu(i,j)*sqrt(uloc**2+vloc**2)
else
ru(i,j)=_ZERO_
end if
end do
end do
do j=jjmin,jjmax
do i=iimin,iimax
if (av(i,j).ge.1) then
uloc=0.25*( Ui(i ,j ) &
+Ui(i-1,j ) &
+Ui(i ,j+1) &
+Ui(i-1,j+1) )
vloc=Vi(i,j)
rv(i,j)=rvv(i,j)*sqrt(uloc**2+vloc**2)
if (av(i,j) .ge. 1) then
uloc=0.25*( Ui(i ,j ) &
+Ui(i-1,j ) &
+Ui(i ,j+1) &
+Ui(i-1,j+1) )
vloc=Vi(i,j)
rv(i,j)=rvv(i,j)*sqrt(uloc**2+vloc**2)
else
rv(i,j)=_ZERO_
end if
end do
end do
......
!$Id: slow_diffusion.F90,v 1.1 2002-05-02 14:01:00 gotm Exp $
!$Id: slow_diffusion.F90,v 1.2 2003-04-07 13:36:38 kbk Exp $
#include "cppdefs.h"
!-----------------------------------------------------------------------
!BOP
......@@ -12,15 +12,13 @@
!
! !USES:
use domain, only: iimin,iimax,jjmin,jjmax,az,au,av,H,HU,HV
use variables_2d, only: D,U,DU,V,DV,UEx,VEx,Uint,Vint
! use m2d, only: UEx,VEx,Uint,Vint
use variables_3d, only: ssen,ssun,ssvn
#if defined(SPHERICAL) || defined(CURVILINEAR)
use domain, only: dyc,arud1,dxx,dyx,arvd1,dxc
#else
use domain, only: dx,dy,ard1
#endif
use variables_2d, only: D,U,V,UEx,VEx,Uint,Vint
use variables_3d, only: ssen,ssun,ssvn
IMPLICIT NONE
!
! !INPUT PARAMETERS:
......
!$Id: slow_terms.F90,v 1.1 2002-05-02 14:00:55 gotm Exp $
!$Id: slow_terms.F90,v 1.2 2003-04-07 13:36:38 kbk Exp $
#include "cppdefs.h"
!-----------------------------------------------------------------------
!BOP
......@@ -12,9 +12,12 @@
!
! !USES:
use domain, only: iimin,iimax,jjmin,jjmax,kmax,HU,HV,au,av
use m2d, only: Uint,Vint,UEx,VEx,Slru,Slrv,SlUx,SlVx,ru,rv
use variables_3d, only: kumin,kvmin,uu,vv,huo,hun,hvo,hvn,idpdx,idpdy
use variables_3d, only: ssuo,ssun,ssvo,ssvn,uuEx,vvEx,rru,rrv
use variables_2d, only: Uint,Vint,UEx,VEx,Slru,Slrv,SlUx,SlVx,ru,rv
use variables_3d, only: kumin,kvmin,uu,vv,huo,hun,hvo,hvn
use variables_3d, only: ssuo,ssun,ssvo,ssvn,uuEx,vvEx,rru,rrv
#ifndef NO_BAROCLINIC
use variables_3d, only: idpdx,idpdy
#endif
IMPLICIT NONE
!
! !INPUT PARAMETERS:
......@@ -27,8 +30,11 @@
! Original author(s): Hans Burchard & Karsten Bolding
!
! $Log: slow_terms.F90,v $
! Revision 1.1 2002-05-02 14:00:55 gotm
! Initial revision
! Revision 1.2 2003-04-07 13:36:38 kbk
! parallel support, cleaned code + NO_3D, NO_BAROCLINIC
!
! Revision 1.1.1.1 2002/05/02 14:00:55 gotm
! recovering after CVS crash
!
! Revision 1.6 2001/08/27 11:50:17 bbh
! TVD-advection for momentum added, some bugs removed
......@@ -66,42 +72,50 @@
if (kmax.gt.1) then
do i=iimin,iimax
do j=jjmin,jjmax
if (au(i,j).ge.1) then
do j=jjmin,jjmax
do i=iimin,iimax
if (au(i,j).ge.1) then
SlUx(i,j)=-UEx(i,j)
end if
end if
end do
end do
do k=1,kmax
do j=jjmin,jjmax
do i=iimin,iimax
if (au(i,j).ge.1) then
if (au(i,j).ge.1) then
if (k.ge.kumin(i,j)) then
#ifdef NO_BAROCLINIC
SlUx(i,j)=SlUx(i,j)+uuEx(i,j,k)
#else
SlUx(i,j)=SlUx(i,j)+uuEx(i,j,k)-idpdx(i,j,k)
#endif
end if
end if
end do
end do
end do
do i=iimin,iimax
do j=jjmin,jjmax
if (av(i,j).ge.1) then
do j=jjmin,jjmax
do i=iimin,iimax
if (av(i,j).ge.1) then
SlVx(i,j)=-VEx(i,j)
end if
end if
end do
end do
do k=1,kmax
do j=jjmin,jjmax
do i=iimin,iimax
if (av(i,j).ge.1) then
if (av(i,j).ge.1) then
if (k.ge.kvmin(i,j)) then
#ifdef NO_BAROCLINIC
SlVx(i,j)=SlVx(i,j)+vvEx(i,j,k)
#else
SlVx(i,j)=SlVx(i,j)+vvEx(i,j,k)-idpdy(i,j,k)
#endif
end if
end if
end if
end do
end do
end do
......@@ -111,9 +125,13 @@
do k=1,kmax
do j=jjmin,jjmax
do i=iimin,iimax
if (au(i,j).ge.1) then
if (au(i,j).ge.1) then
if (k.ge.kumin(i,j)) then
#ifdef NO_BAROCLINIC
SlUx(i,j)= _ZERO_
#else
SlUx(i,j)=-idpdx(i,j,k)
#endif
end if
end if
end do
......@@ -123,11 +141,15 @@
do k=1,kmax
do j=jjmin,jjmax
do i=iimin,iimax
if (av(i,j).ge.1) then
if (av(i,j).ge.1) then
if (k.ge.kvmin(i,j)) then
#ifdef NO_BAROCLINIC
SlVx(i,j)= _ZERO_
#else
SlVx(i,j)=-idpdy(i,j,k)
#endif
end if
end if
end if
end do
end do
end do
......@@ -135,21 +157,21 @@
do j=jjmin,jjmax
do i=iimin,iimax
if (au(i,j).ge.1) then
k=kumin(i,j)
if (kmax.gt.1) then
if (au(i,j).ge.1) then
k=kumin(i,j)
if (kmax.gt.1) then
#ifdef NO_SLR
STDERR 'NO_SLR U'
Slru(i,j)= _ZERO_
STDERR 'NO_SLR U'
Slru(i,j)= _ZERO_
#else
Slru(i,j)=-Uint(i,j)/(0.5*(ssuo(i,j)+ssun(i,j)) &
+HU(i,j))*ru(i,j) &
+uu(i,j,k)/(0.5*(huo(i,j,k)+hun(i,j,k)))*rru(i,j)
Slru(i,j)=-Uint(i,j)/(0.5*(ssuo(i,j)+ssun(i,j)) &
+HU(i,j))*ru(i,j) &
+uu(i,j,k)/(0.5*(huo(i,j,k)+hun(i,j,k)))*rru(i,j)
#endif
else
Slru(i,j)= _ZERO_
else
Slru(i,j)= _ZERO_
end if
end if
end if
end do
end do
......@@ -157,7 +179,7 @@
do i=iimin,iimax
if (av(i,j).ge.1) then
k=kvmin(i,j)
if (kmax.gt.1) then
if (kmax.gt.1) then
#ifdef NO_SLR
STDERR 'NO_SLR V'
Slrv(i,j)=0.
......@@ -167,7 +189,7 @@
+vv(i,j,k)/(0.5*(hvo(i,j,k)+hvn(i,j,k)))*rrv(i,j)
#endif
else
Slrv(i,j)=0.
Slrv(i,j)=_ZERO_
end if
end if
end do
......
!$Id: spm.F90,v 1.1 2002-05-02 14:00:59 gotm Exp $
!$Id: spm.F90,v 1.2 2003-04-07 13:36:38 kbk Exp $
#include "cppdefs.h"
!-----------------------------------------------------------------------
!BOP
......@@ -12,11 +12,11 @@
! Description still missing
!
! !USES:
use commhalo, only: myid,update_3d_halo,wait_halo,D_TAG
use domain, only: imin,jmin,imax,jmax,H,az
use domain, only: iimin,jjmin,iimax,jjmax,kmax
use parameters, only: rho_0
use variables_3d, only: hn,spm,spm_ws,spm_pool,taub
use halo_zones, only: update_3d_halo,wait_halo,D_TAG
IMPLICIT NONE
!
private
......@@ -44,8 +44,11 @@
! Original author(s): Manuel Ruiz Villarreal, Karsten Bolding and Hans Burchard
!
! $Log: spm.F90,v $
! Revision 1.1 2002-05-02 14:00:59 gotm
! Initial revision
! Revision 1.2 2003-04-07 13:36:38 kbk
! parallel support, cleaned code + NO_3D, NO_BAROCLINIC
!
! Revision 1.1.1.1 2002/05/02 14:00:59 gotm
! recovering after CVS crash
!
!
! Revision 1.2 2001/10/23 07:30:19 bbh
......
!$Id: ss_nn.F90,v 1.1 2002-05-02 14:00:55 gotm Exp $
!$Id: ss_nn.F90,v 1.2 2003-04-07 13:36:38 kbk Exp $
#include "cppdefs.h"
!-----------------------------------------------------------------------
!BOP
......@@ -17,8 +17,11 @@
! by including isopycnal slopes.
!
! !USES:
use domain, only: iimin,iimax,jjmin,jjmax,kmax,au,av,az
use variables_3d, only: kmin,kumin,uu,hun,kvmin,vv,hvn,SS,NN,rho,hn,num,S
use domain, only: iimin,iimax,jjmin,jjmax,kmax,au,av,az
use variables_3d, only: kmin,kumin,uu,hun,kvmin,vv,hvn,SS
#ifndef NO_BAROCLINIC
use variables_3d, only: hn,NN,rho,num
#endif
IMPLICIT NONE
!
! !INPUT PARAMETERS:
......@@ -31,8 +34,11 @@
! Original author(s): Hans Burchard & Karsten Bolding
!
! $Log: ss_nn.F90,v $
! Revision 1.1 2002-05-02 14:00:55 gotm
! Initial revision
! Revision 1.2 2003-04-07 13:36:38 kbk
! parallel support, cleaned code + NO_3D, NO_BAROCLINIC
!