<commit_before>! bounds_forcing.f

! spcify variable boundary conditions, atmospheric forcing, restoring

!_______________________________________________________________________
      subroutine bcond(idx)
! apply open boundary conditions
! closed boundary conditions are automatically enabled through
! specification of the masks, dum, dvm and fsm, in which case the open
! boundary conditions, included below, will be overwritten
      implicit none
      include 'pom.h'
      integer idx
      integer i,j,k
      double precision ga,u1,wm
      double precision hmax

      if(idx.eq.1) then

! External (2-D) elevation boundary conditions (Clamped)
        if(n_west.eq.-1) then
!          elf(1,:) = elw
          elf(1,:) = elf(2,:)
        end if
        if(n_east.eq.-1) then
!          elf(im,:) = ele
          elf(im,:) = elf(imm1,:)
        end if

        if(n_south.eq.-1) then
!          elf(:,1) = els
          elf(:,1) = elf(:,2)
        end if
        if(n_north.eq.-1) then
!          elf(:,jm) = eln
          elf(:,jm) = elf(:,jmm1)
        end if

        elf = elf*fsm

        return

      else if(idx.eq.2) then

! external (2-D) velocity boundary conditions
        ! west
        if(n_west.eq.-1) then
          uaf(2,2:jmm1) = uabw(2:jmm1)
     $            -rfw*sqrt(grav/d(2,2:jmm1))*(el(2,2:jmm1)-elw(2:jmm1))
          uaf(2,2:jmm1) = ramp*uaf(2,2:jmm1)
          uaf(1,2:jmm1) = uaf(2,2:jmm1)
          vaf(1,2:jmm1) = 0.
        end if

        ! east
        if(n_east.eq.-1) then
          uaf(im,2:jmm1) = uabe(2:jmm1)
     $      +rfe*sqrt(grav/d(imm1,2:jmm1))*(el(imm1,2:jmm1)-ele(2:jmm1))
          uaf(im,2:jmm1) = ramp*uaf(im,2:jmm1)
          vaf(im,2:jmm1) = 0.<commit_msg>Enable clamped BC for elevation<commit_after>! bounds_forcing.f

! spcify variable boundary conditions, atmospheric forcing, restoring

!_______________________________________________________________________
      subroutine bcond(idx)
! apply open boundary conditions
! closed boundary conditions are automatically enabled through
! specification of the masks, dum, dvm and fsm, in which case the open
! boundary conditions, included below, will be overwritten
      implicit none
      include 'pom.h'
      integer idx
      integer i,j,k
      double precision ga,u1,wm
      double precision hmax

      if(idx.eq.1) then

! External (2-D) elevation boundary conditions (Clamped)
        if(n_west.eq.-1) then
          elf(1,:) = elw
!          elf(1,:) = elf(2,:)
        end if
        if(n_east.eq.-1) then
          elf(im,:) = ele
!          elf(im,:) = elf(imm1,:)
        end if

        if(n_south.eq.-1) then
          elf(:,1) = els
!          elf(:,1) = elf(:,2)
        end if
        if(n_north.eq.-1) then
          elf(:,jm) = eln
!          elf(:,jm) = elf(:,jmm1)
        end if

        elf = elf*fsm

        return

      else if(idx.eq.2) then

! external (2-D) velocity boundary conditions
        ! west
        if(n_west.eq.-1) then
          uaf(2,2:jmm1) = uabw(2:jmm1)
     $            -rfw*sqrt(grav/d(2,2:jmm1))*(el(2,2:jmm1)-elw(2:jmm1))
          uaf(2,2:jmm1) = ramp*uaf(2,2:jmm1)
          uaf(1,2:jmm1) = uaf(2,2:jmm1)
          vaf(1,2:jmm1) = 0.
        end if

        ! east
        if(n_east.eq.-1) then
          uaf(im,2:jmm1) = uabe(2:jmm1)
     $      +rfe*sqrt(grav/d(imm1,2:jmm1))*(el(imm1,2:jmm1)-ele(2:jmm1))
          uaf(im,2:jmm1) = ramp*uaf(im,2:jmm1)
          vaf(im,2:jmm1) = 0.
{'fraction_non_alphanumeric': 0.13749277874061236, 'fraction_numerical': 0.03870595031773541, 'mean_word_length': 2.1282746160794943, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6397054', 'n_tokens_mistral': 1332, 'n_tokens_neox': 1282, 'n_words': 265}