Commit 0690708f authored by kbk's avatar kbk
Browse files

parallel support

parent 40bb5845
!$Id: have_bdy.F90,v 1.1 2002-05-02 14:00:44 gotm Exp $ !$Id: have_bdy.F90,v 1.2 2003-04-07 15:42:05 kbk Exp $
#include "cppdefs.h" #include "cppdefs.h"
!----------------------------------------------------------------------- !-----------------------------------------------------------------------
!BOP !BOP
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
! !
! !USES: ! !USES:
use domain use domain
!kbk use m2d, only: HaveBoundaries,EWBdy,ENBdy,EEBdy,ESBdy
use m2d, only: have_boundaries use m2d, only: have_boundaries
IMPLICIT NONE IMPLICIT NONE
! !
...@@ -26,15 +25,18 @@ ...@@ -26,15 +25,18 @@
! Original author(s): Karsten Bolding & Hans Burchard ! Original author(s): Karsten Bolding & Hans Burchard
! !
! $Log: have_bdy.F90,v $ ! $Log: have_bdy.F90,v $
! Revision 1.1 2002-05-02 14:00:44 gotm ! Revision 1.2 2003-04-07 15:42:05 kbk
! Initial revision ! parallel support
!
! Revision 1.1.1.1 2002/05/02 14:00:44 gotm
! recovering after CVS crash
! !
! Revision 1.1.1.1 2001/04/17 08:43:07 bbh ! Revision 1.1.1.1 2001/04/17 08:43:07 bbh
! initial import into CVS ! initial import into CVS
! !
! !LOCAL VARIABLES: ! !LOCAL VARIABLES:
integer :: i integer :: i,j,k,n
integer :: n,nbdy integer :: nbdy
integer :: f,l integer :: f,l
!EOP !EOP
!----------------------------------------------------------------------- !-----------------------------------------------------------------------
...@@ -49,15 +51,20 @@ ...@@ -49,15 +51,20 @@
i = 0 i = 0
if (NWB .ge. 1) then if (NWB .ge. 1) then
do n = 1,NWB do n = 1,NWB
if (wi(n) .ge. imin .and. wi(n) .le. imax) then if (wi(n) .ge. imin+ioff .and. wi(n) .le. imax+ioff) then
if ((wfj(n) .ge. jmin .and. wfj(n) .le. jmax) .or. & wi(n) = wi(n) - ioff
(wlj(n) .ge. jmin .and. wlj(n) .le. jmax)) then f = max(jmin+joff,wfj(n)) - joff
l = min(jmax+joff,wlj(n)) - joff
if(f .le. l) then
i = i+1 i = i+1
f = max(jmin,wfj(n))
wfj(i) = f wfj(i) = f
l = min(jmax,wlj(n))
wlj(i) = l wlj(i) = l
nbdy = nbdy+1 nbdy = nbdy+1
do k=1,nsbv
if(bdy_map(k,1) .eq. wi(n)+ioff .and. bdy_map(k,2) .eq. f+joff) then
bdy_index(nbdy) = k
end if
end do
end if end if
end if end if
end do end do
...@@ -67,15 +74,20 @@ ...@@ -67,15 +74,20 @@
i = 0 i = 0
if (NNB .ge. 1) then if (NNB .ge. 1) then
do n = 1,NNB do n = 1,NNB
if (nj(n) .ge. jmin .and. nj(n) .le. jmax) then if (nj(n) .ge. jmin+joff .and. nj(n) .le. jmax+joff) then
if ((nfi(n) .ge. imin .and. nfi(n) .le. imax) .or. & nj(n) = nj(n) - joff
(nli(n) .ge. imin .and. nli(n) .le. imax)) then f = max(imin+ioff,nfi(n)) - ioff
l = min(imax+ioff,nli(n)) - ioff
if(f .le. l) then
i = i+1 i = i+1
f = max(imin,nfi(n))
nfi(i) = f nfi(i) = f
l = min(imax,nli(n))
nli(i) = l nli(i) = l
nbdy = nbdy+1 nbdy = nbdy+1
do k=1,nsbv
if(bdy_map(k,1) .eq. f+ioff .and. bdy_map(k,2) .eq. nj(n)+joff) then
bdy_index(nbdy) = k
end if
end do
end if end if
end if end if
end do end do
...@@ -85,15 +97,20 @@ ...@@ -85,15 +97,20 @@
i = 0 i = 0
if (NEB .ge. 1) then if (NEB .ge. 1) then
do n = 1,NEB do n = 1,NEB
if (ei(n) .ge. imin .and. ei(n) .le. imax) then if (ei(n) .ge. imin+ioff .and. ei(n) .le. imax+ioff) then
if ((efj(n) .ge. jmin .and. efj(n) .le. jmax) .or. & ei(n) = ei(n) - ioff
(elj(n) .ge. jmin .and. elj(n) .le. jmax)) then f = max(jmin+joff,efj(n)) - joff
l = min(jmax+joff,elj(n)) - joff
if(f .le. l) then
i = i+1 i = i+1
f = max(jmin,efj(n))
efj(i) = f efj(i) = f
l = min(jmax,elj(n))
elj(i) = l elj(i) = l
nbdy = nbdy+1 nbdy = nbdy+1
do k=1,nsbv
if(bdy_map(k,1) .eq. ei(n)+ioff .and. bdy_map(k,2) .eq. l+joff) then
bdy_index(nbdy) = k
end if
end do
end if end if
end if end if
end do end do
...@@ -103,22 +120,33 @@ ...@@ -103,22 +120,33 @@
i = 0 i = 0
if (NSB .ge. 1) then if (NSB .ge. 1) then
do n = 1,NSB do n = 1,NSB
if (sj(n) .ge. jmin .and. sj(n) .le. jmax) then if (sj(n) .ge. jmin+joff .and. sj(n) .le. jmax+joff) then
if ((sfi(n) .ge. imin .and. sfi(n) .le. imax) .or. & sj(n) = sj(n) - joff
(sli(n) .ge. imin .and. sli(n) .le. imax)) then f = max(imin+ioff,sfi(n)) - ioff
l = min(imax+ioff,sli(n)) - ioff
if(f .le. l) then
i = i+1 i = i+1
f = max(imin,sfi(n))
sfi(i) = f sfi(i) = f
l = min(imax,sli(n))
sli(i) = l sli(i) = l
nbdy = nbdy+1 nbdy = nbdy+1
do k=1,nsbv
if(bdy_map(k,1) .eq. f+ioff .and. bdy_map(k,2) .eq. sj(n)+joff) then
bdy_index(nbdy) = k
end if
end do
end if end if
end if end if
end do end do
end if end if
NSB = i NSB = i
if (nbdy .gt. 0) have_boundaries = .true. if (nbdy .gt. 0) then
have_boundaries = .true.
bdy_index(nbdy+1:) = -1
else
have_boundaries = .false.
bdy_index = -1
end if
#ifdef DEBUG #ifdef DEBUG
write(debug,*) 'Leaving have_bdy()' write(debug,*) 'Leaving have_bdy()'
......
!$Id: sealevel.F90,v 1.2 2003-03-20 15:42:32 gotm Exp $ !$Id: sealevel.F90,v 1.3 2003-04-07 15:44:13 kbk Exp $
#include "cppdefs.h" #include "cppdefs.h"
!----------------------------------------------------------------------- !-----------------------------------------------------------------------
!BOP !BOP
...@@ -11,15 +11,15 @@ ...@@ -11,15 +11,15 @@
! !DESCRIPTION: ! !DESCRIPTION:
! !
! !USES: ! !USES:
use commhalo, only: update_2d_halo,wait_halo,z_TAG use domain, only: imin,imax,jmin,jmax,az,H
use domain, only: imin,imax,jmin,jmax,az,H
#if defined(SPHERICAL) || defined(CURVILINEAR) #if defined(SPHERICAL) || defined(CURVILINEAR)
use domain, only : arcd1,dxv,dyu use domain, only : arcd1,dxv,dyu
#else #else
use domain, only : dx,dy,ard1 use domain, only : dx,dy,ard1
#endif #endif
use m2d, only: dtm,comm_method use m2d, only: dtm
use variables_2d, only: z,zo,U,V use variables_2d, only: z,zo,U,V
use halo_zones, only : update_2d_halo,wait_halo,z_TAG
IMPLICIT NONE IMPLICIT NONE
! !
! !INPUT PARAMETERS: ! !INPUT PARAMETERS:
...@@ -32,8 +32,8 @@ ...@@ -32,8 +32,8 @@
! Original author(s): Hans Burchard & Karsten Bolding ! Original author(s): Hans Burchard & Karsten Bolding
! !
! $Log: sealevel.F90,v $ ! $Log: sealevel.F90,v $
! Revision 1.2 2003-03-20 15:42:32 gotm ! Revision 1.3 2003-04-07 15:44:13 kbk
! removed un-necessary multiplication with az ! parallel support
! !
! Revision 1.1.1.1 2002/05/02 14:00:45 gotm ! Revision 1.1.1.1 2002/05/02 14:00:45 gotm
! recovering after CVS crash ! recovering after CVS crash
...@@ -83,12 +83,14 @@ ...@@ -83,12 +83,14 @@
write(debug,*) 'sealevel() # ',Ncall write(debug,*) 'sealevel() # ',Ncall
#endif #endif
zo = z
do j=jmin,jmax do j=jmin,jmax
do i=imin,imax do i=imin,imax
zo(i,j) = z(i,j) !KBK zo(i,j) = z(i,j)
if (az(i,j) .eq. 1) then if (az(i,j) .eq. 1) then
z(i,j)=z(i,j)-dtm*((U(i,j)*DYU-U(i-1,j )*DYUIM1) & z(i,j)=z(i,j)-dtm*((U(i,j)*DYU-U(i-1,j )*DYUIM1) &
+(V(i,j)*DXV-V(i ,j-1)*DXVJM1))*ARCD1 +(V(i,j)*DXV-V(i ,j-1)*DXVJM1))*ARCD1
#ifdef NOMADS_TEST #ifdef NOMADS_TEST
kk=1.0 kk=1.0
if ((((i.eq.1).or.(i.eq.imax)).and.(j.ge.1).and.(j.le.jmax)).or.(((j.eq.1).or.(j.eq.jmax)).and.(i.ge.1).and.(i.le.imax))) & if ((((i.eq.1).or.(i.eq.imax)).and.(j.ge.1).and.(j.le.jmax)).or.(((j.eq.1).or.(j.eq.jmax)).and.(i.ge.1).and.(i.le.imax))) &
...@@ -113,6 +115,7 @@ ...@@ -113,6 +115,7 @@
call update_2d_halo(z,z,az,imin,jmin,imax,jmax,z_TAG) call update_2d_halo(z,z,az,imin,jmin,imax,jmax,z_TAG)
call wait_halo(z_TAG) call wait_halo(z_TAG)
!KBK call cp_outside_openbdy_2d(z)
#ifdef DEBUG #ifdef DEBUG
write(debug,*) 'Leaving sealevel()' write(debug,*) 'Leaving sealevel()'
......
!$Id: update_2d_bdy.F90,v 1.1 2002-05-02 14:00:45 gotm Exp $ !$Id: update_2d_bdy.F90,v 1.2 2003-04-07 15:45:05 kbk Exp $
#include "cppdefs.h" #include "cppdefs.h"
!----------------------------------------------------------------------- !-----------------------------------------------------------------------
!BOP !BOP
...@@ -13,8 +13,9 @@ ...@@ -13,8 +13,9 @@
! !USES: ! !USES:
use domain, only: NWB,NNB,NEB,NSB,H,min_depth,imin,imax,jmin,jmax,az use domain, only: NWB,NNB,NEB,NSB,H,min_depth,imin,imax,jmin,jmax,az
use domain, only: wi,wfj,wlj,nj,nfi,nli,ei,efj,elj,sj,sfi,sli,nsbv use domain, only: wi,wfj,wlj,nj,nfi,nli,ei,efj,elj,sj,sfi,sli,nsbv
use m2d, only: dtm,bdyfmt_2d,bdy_data use domain, only: bdy_index,nsbv
use variables_2d, only: z use m2d, only: dtm,bdyfmt_2d,bdy_data
use variables_2d, only: z
IMPLICIT NONE IMPLICIT NONE
! !
! !INPUT PARAMETERS: ! !INPUT PARAMETERS:
...@@ -28,8 +29,11 @@ ...@@ -28,8 +29,11 @@
! Original author(s): Karsten Bolding & Hans Burchard ! Original author(s): Karsten Bolding & Hans Burchard
! !
! $Log: update_2d_bdy.F90,v $ ! $Log: update_2d_bdy.F90,v $
! Revision 1.1 2002-05-02 14:00:45 gotm ! Revision 1.2 2003-04-07 15:45:05 kbk
! Initial revision ! parallel support
!
! Revision 1.1.1.1 2002/05/02 14:00:45 gotm
! recovering after CVS crash
! !
! Revision 1.8 2001/10/17 13:15:35 bbh ! Revision 1.8 2001/10/17 13:15:35 bbh
! Cleaning ! Cleaning
...@@ -59,13 +63,12 @@ ...@@ -59,13 +63,12 @@
! Revision 1.1.1.1 2001/04/17 08:43:08 bbh ! Revision 1.1.1.1 2001/04/17 08:43:08 bbh
! initial import into CVS ! initial import into CVS
! !
!
! !LOCAL VARIABLES: ! !LOCAL VARIABLES:
logical, save :: first=.true. logical, save :: first=.true.
REALTYPE, save :: time_array(1000),zbo(1000),zbn(1000) REALTYPE, save :: time_array(1000),zbo(1000),zbn(1000)
REALTYPE, save :: t,t1,t2 REALTYPE, save :: t,t1,t2
REALTYPE :: a,amp,ratio,fac REALTYPE :: a,amp,ratio,fac
integer :: n,i,j,k integer :: i,j,k,l,n
! !
!EOP !EOP
!----------------------------------------------------------------------- !-----------------------------------------------------------------------
...@@ -168,38 +171,47 @@ ...@@ -168,38 +171,47 @@
fac = _ONE_ fac = _ONE_
if(bdyramp .gt. 1) fac=min( _ONE_ ,4.*loop/float(bdyramp)) if(bdyramp .gt. 1) fac=min( _ONE_ ,4.*loop/float(bdyramp))
k = 0 l = 0
do n = 1,NWB do n = 1,NWB
l = l+1
k = bdy_index(l)
i = wi(n) i = wi(n)
do j = wfj(n),wlj(n) do j = wfj(n),wlj(n)
k = k+1
z(i,j) = max(fac*bdy_data(k),-H(i,j)+min_depth) z(i,j) = max(fac*bdy_data(k),-H(i,j)+min_depth)
k = k+1
end do end do
end do end do
do n = 1,NNB do n = 1,NNB
l = l+1
k = bdy_index(l)
j = nj(n) j = nj(n)
do i = nfi(n),nli(n) do i = nfi(n),nli(n)
k = k+1
z(i,j) = max(fac*bdy_data(k),-H(i,j)+min_depth) z(i,j) = max(fac*bdy_data(k),-H(i,j)+min_depth)
k = k+1
end do end do
end do end do
do n = 1,NEB do n = 1,NEB
l = l+1
k = bdy_index(l)
i = ei(n) i = ei(n)
do j = efj(n),elj(n) do j = efj(n),elj(n)
k = k+1
z(i,j) = max(fac*bdy_data(k),-H(i,j)+min_depth) z(i,j) = max(fac*bdy_data(k),-H(i,j)+min_depth)
k = k+1
end do end do
end do end do
do n = 1,NSB do n = 1,NSB
l = l+1
k = bdy_index(l)
j = sj(n) j = sj(n)
do i = sfi(n),sli(n) do i = sfi(n),sli(n)
k = k+1
z(i,j) = max(fac*bdy_data(k),-H(i,j)+min_depth) z(i,j) = max(fac*bdy_data(k),-H(i,j)+min_depth)
k = k+1
end do end do
end do end do
#if 1
#if 0
#ifdef NS_06NM_TEST #ifdef NS_06NM_TEST
i=109 i=109
do j=1,jmax do j=1,jmax
......
!$Id: uv_depths.F90,v 1.3 2003-04-01 14:16:54 gotm Exp $ !$Id: uv_depths.F90,v 1.4 2003-04-07 15:47:50 kbk Exp $
#include "cppdefs.h" #include "cppdefs.h"
!----------------------------------------------------------------------- !-----------------------------------------------------------------------
!BOP !BOP
...@@ -11,8 +11,9 @@ ...@@ -11,8 +11,9 @@
! !DESCRIPTION: ! !DESCRIPTION:
! !
! !USES: ! !USES:
use commhalo, only: update_2d_halo,wait_halo,HU_TAG,HV_TAG
use domain, only: imin,imax,jmin,jmax,az,au,av,H,HU,HV use domain, only: imin,imax,jmin,jmax,az,au,av,H,HU,HV
use variables_2d, only: DU,DV
use halo_zones, only : update_2d_halo,wait_halo,HU_TAG,HV_TAG
IMPLICIT NONE IMPLICIT NONE
! !
! !INPUT PARAMETERS: ! !INPUT PARAMETERS:
...@@ -25,11 +26,8 @@ ...@@ -25,11 +26,8 @@
! Original author(s): Hans Burchard & Karsten Bolding ! Original author(s): Hans Burchard & Karsten Bolding
! !
! $Log: uv_depths.F90,v $ ! $Log: uv_depths.F90,v $
! Revision 1.3 2003-04-01 14:16:54 gotm ! Revision 1.4 2003-04-07 15:47:50 kbk
! removed H_TAG and cleaned code ! parallel support
!
! Revision 1.2 2003/03/20 15:54:03 gotm
! added min function + ifdef DK_06NM_TEST to set depth
! !
! Revision 1.1.1.1 2002/05/02 14:00:46 gotm ! Revision 1.1.1.1 2002/05/02 14:00:46 gotm
! recovering after CVS crash ! recovering after CVS crash
...@@ -43,7 +41,6 @@ ...@@ -43,7 +41,6 @@
! Revision 1.1.1.1 2001/04/17 08:43:07 bbh ! Revision 1.1.1.1 2001/04/17 08:43:07 bbh
! initial import into CVS ! initial import into CVS
! !
!
! 10Sep kbk: needs some more cleaning + wait for input from Hans ! 10Sep kbk: needs some more cleaning + wait for input from Hans
! !
! !LOCAL VARIABLES: ! !LOCAL VARIABLES:
...@@ -71,11 +68,6 @@ ...@@ -71,11 +68,6 @@
end do end do
end do end do
#ifdef DK_06NM_TEST
HU(175,106)=5.6
HU(175,107)=-10.
#endif
call update_2d_halo(HU,HU,au,imin,jmin,imax,jmax,HU_TAG) call update_2d_halo(HU,HU,au,imin,jmin,imax,jmax,HU_TAG)
call wait_halo(HU_TAG) call wait_halo(HU_TAG)
......
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