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