#2223 closed Bug (fixed)

Invbar Not applied on bdy if tidal boundaries used

Reported by: deazer Owned by: smueller
Priority: low Milestone:
Component: BDY Version: release-4.0
Severity: major Keywords: BDY, SBC, tides
Cc:

Description

Context

If applying invbar effect on open boundaries it is not applied if using tidal boundaries.

Analysis

If using tidal boundaries the slowly varying time values dta_bdy_s(jbdy)%ssh are assigned before the contribution of invbar is assigned.
If tides are used, switching on ln_apr_obc has no effect.

Fix

Solution is simple. Move the contribution to SSH of invbar (apr) before dta_bdy_s()%ssh is set

In bdydta.F90 change to:

     IF ( ln_apr_obc ) THEN
         DO jbdy = 1, nb_bdy
            IF (cn_tra(jbdy) /= 'runoff')THEN
               igrd = 1                      ! meridional velocity
               DO ib = 1, idx_bdy(jbdy)%nblenrim(igrd)
                  ii   = idx_bdy(jbdy)%nbi(ib,igrd)
                  ij   = idx_bdy(jbdy)%nbj(ib,igrd)
                  dta_bdy(jbdy)%ssh(ib) = dta_bdy(jbdy)%ssh(ib) + ssh_ib(ii,ij)
               END DO
            ENDIF
         END DO
      ENDIF

      IF ( ln_tide ) THEN
         IF (ln_dynspg_ts) THEN      ! Fill temporary arrays with slow-varying bdy data                           
            DO jbdy = 1, nb_bdy    ! Tidal component added in ts loop
               IF ( nn_dyn2d_dta(jbdy) .ge. 2 ) THEN
                  nblen => idx_bdy(jbdy)%nblen
                  nblenrim => idx_bdy(jbdy)%nblenrim
                  IF( cn_dyn2d(jbdy) == 'frs' ) THEN; ilen1(:)=nblen(:) ; ELSE ; ilen1(:)=nblenrim(:) ; ENDIF
                  IF ( dta_bdy(jbdy)%ll_ssh ) dta_bdy_s(jbdy)%ssh(1:ilen1(1)) = dta_bdy(jbdy)%ssh(1:ilen1(1))
                  IF ( dta_bdy(jbdy)%ll_u2d ) dta_bdy_s(jbdy)%u2d(1:ilen1(2)) = dta_bdy(jbdy)%u2d(1:ilen1(2))
                  IF ( dta_bdy(jbdy)%ll_v2d ) dta_bdy_s(jbdy)%v2d(1:ilen1(3)) = dta_bdy(jbdy)%v2d(1:ilen1(3))
               ENDIF
            END DO
         ELSE ! Add tides if not split-explicit free surface else this is done in ts loop
            !
            CALL bdy_dta_tides( kt=kt, time_offset=time_offset )
         ENDIF
      ENDIF

svn diff:

@@ -368,6 +368,18 @@
             jstart = jstart + dta%nread(1)
          ENDIF    ! nn_dta(jbdy) = 1
       END DO  ! jbdy
+      IF ( ln_apr_obc ) THEN
+         DO jbdy = 1, nb_bdy
+            IF (cn_tra(jbdy) /= 'runoff')THEN
+               igrd = 1                      ! meridional velocity
+               DO ib = 1, idx_bdy(jbdy)%nblenrim(igrd)
+                  ii   = idx_bdy(jbdy)%nbi(ib,igrd)
+                  ij   = idx_bdy(jbdy)%nbj(ib,igrd)
+                  dta_bdy(jbdy)%ssh(ib) = dta_bdy(jbdy)%ssh(ib) + ssh_ib(ii,ij)
+               END DO
+            ENDIF
+         END DO
+      ENDIF
 
       IF ( ln_tide ) THEN
          IF (ln_dynspg_ts) THEN      ! Fill temporary arrays with slow-varying bdy data                           
@@ -387,18 +399,6 @@
          ENDIF
       ENDIF
 
-      IF ( ln_apr_obc ) THEN
-         DO jbdy = 1, nb_bdy
-            IF (cn_tra(jbdy) /= 'runoff')THEN
-               igrd = 1                      ! meridional velocity
-               DO ib = 1, idx_bdy(jbdy)%nblenrim(igrd)
-                  ii   = idx_bdy(jbdy)%nbi(ib,igrd)
-                  ij   = idx_bdy(jbdy)%nbj(ib,igrd)
-                  dta_bdy(jbdy)%ssh(ib) = dta_bdy(jbdy)%ssh(ib) + ssh_ib(ii,ij)
-               END DO
-            ENDIF
-         END DO
-      ENDIF
       !
       IF( ln_timing )   CALL timing_stop('bdy_dta')
       !

Commit History (1)

ChangesetAuthorTimeChangeLog
10646smueller2019-02-07T12:58:00+01:00

Enabling of the activation of the inverse barometer effect at open boundaries in configurations where both tidal forcing and the time-split surface pressure gradient computation have been selected; fix for the bug described in ticket #2223.

Change History (4)

comment:1 Changed 14 months ago by smueller

  • Keywords tides added; removed
  • Owner changed from systeam to smueller
  • Status changed from new to assigned

comment:2 Changed 14 months ago by smueller

In 10646:

Enabling of the activation of the inverse barometer effect at open boundaries in configurations where both tidal forcing and the time-split surface pressure gradient computation have been selected; fix for the bug described in ticket #2223.

comment:3 Changed 14 months ago by smueller

The proposed fix has been applied (changeset [10646]). Revision 10646 of the release-4.0 version of the source code passes the standard AMM12 restartability and reproducibility SETTE tests as well as variants of these tests that additionally include atmospheric pressure forcing (ln_apr_dyn set to .true.; using spatially and temporally uniform mean sea-level pressure fields).

comment:4 Changed 14 months ago by smueller

  • Resolution set to fixed
  • Status changed from assigned to closed
Note: See TracTickets for help on using tickets.