Page 1 of 1

def of a rectangle open boundaries

Posted: Fri Jun 12, 2015 6:27 pm
by Sou
Hello,
How can I define a rectangle open boundaries? it seems that the model doesn't let me consider all side as open boundaries.
I tried to define a rectangle in water where all sides are open and the depth is uniform, here is the brief statement:

!---grid dimensions
nc = 11; nr = 11; nz = 25

!---number of open sea boundaries
nosbu = 20; nosbv = 20

.
.
.
.
IMPLICIT NONE

!
!*Local variables
!
INTEGER :: i, j, jj, ii



procname(pglev+1) = 'usrdef_grid'
CALL log_timer_in()

!
!3. Open boundary locations
!--------------------------
!
!---West
ii = 0
j_441: DO j=1,nr-1

ii = ii + 1
iobu(ii) = 1
jobu(ii) = j

ENDDO j_441

!---East
!j_442: DO j=1,nr-1

! ii = ii + 1
! iobu(ii) = nc
! jobu(ii) = j

!ENDDO j_442

!---South
jj = 0
i_443: DO i=1,nc-1

jj = jj + 1
iobv(jj) = i
jobv(jj) = 1

ENDDO i_443


!---North
jj = 0
i_444: DO i=1,nc-1

jj = jj + 1
iobv(jj) = i
jobv(jj) = nr

ENDDO i_444

CALL log_timer_out()

RETURN

END SUBROUTINE usrdef_grid



But the model shows runlogerror and doesn't let me do it. However it runs normally for 2 open boundaries.
Please help me in that.
Regards,
Sue

Re: def of a rectangle open boundaries

Posted: Tue Jun 16, 2015 7:48 am
by Katrijn
Hi Sou,

I do notice a few things:
east boundary is commented (probably you testing the code)
At the north boundary you reset jj to 0, this should not be done (iobv(1:20)), if you reset you don't fill the whole array

Hope this helps,

KAt

Re: def of a rectangle open boundaries

Posted: Tue Jun 16, 2015 5:10 pm
by Sou
Thank You Kat, the problem was caused by jj=0 as you implied. now it lets me open all 4 boundaries.
Thanks again,
Sue