Opened 5 years ago

Closed 5 years ago

Last modified 3 years ago

#1521 closed Bug (fixed)

ssh_ib not available to bdy_dta, causes consistency error when restarting nemo

Reported by: deazer Owned by: deazer
Priority: low Milestone: 2015 release-3.6
Component: OCE Version: trunk
Severity: Keywords: BDY SSH release-3.6 restartability
Cc:

Description

There is a small bug in relation in inverse barometer being applied on the bdy and restarts.
This will only manifest if using ln_apr_dyn=.true., in &namsbc and ln_apr_obc=.true, in namsbc_apr.

The issue concerns the variable ssh_ib which is used in by bdy_dta to add to the boundary ssh:
bdydta.F90:

IF ( ln_apr_obc ) THEN

DO ib_bdy = 1, nb_bdy

IF (cn_tra(ib_bdy) /= 'runoff')THEN

igrd = 1 ! meridional velocity
DO ib = 1, idx_bdy(ib_bdy)%nblenrim(igrd)

ii = idx_bdy(ib_bdy)%nbi(ib,igrd)
ij = idx_bdy(ib_bdy)%nbj(ib,igrd)
dta_bdy(ib_bdy)%ssh(ib) = dta_bdy(ib_bdy)%ssh(ib) + ssh_ib(ii,ij)

ENDDO

ENDIF

ENDDO

ENDIF

But because bdy_dta() is called in step.F90 before inv(). At the first time step ssh_ib() is not yet calculated.
Furthermore, on restarting it is not yet read in. Both calculation of ssh_ib and read from the restart are done in inv().

The simplest correction is a simple reordering of calls in step.F90 so that bdy_dta() comes after inv()

However, is there a preference for a separate init routine for inverse barometer to do this (read or calculate ssh_ib) instead?

Commit History (0)

(No commits)

Change History (16)

comment:1 Changed 5 years ago by deazer

Have checked this fix with sette and all ok
For AMM12 I needed to create a set of atmospheric fluxes and update the namelist.

For now I submit the bug fix without the AMM12 updated namelist. This will not actually check
this code. Once the fluxes are uploaded to the ftp site we can update the namelist in AMM12.

comment:2 Changed 5 years ago by clem

From what I remember, the call bdy_dta was put before the call to sbc in step.F90 to make NEMO-LIM3 restartable with open boundaries. The problem is that LIM3 needs some bdy information contained in bdy_dta.
I would prefer you keep the call to bdy_dta after sbc. Do you think you can find a way to solve your issue differently?

comment:3 Changed 5 years ago by clem

Sorry, mistake. I wanted to say "I'd prefer to keep the call to bdy_dta BEFORE sbc"

comment:4 Changed 5 years ago by deazer

Thanks Clement
OK so we need to make sure that bdydta has ssh_ib already calculated, despite having sbc called after bdy.

The constraints are for bdydta to work correctly are:

1) ssh_ib is set ahead of its use in bdydta

2) sf_apr is set
(Presently done in sbc_apr) which itself is dependent on sbc to read ln_apr_dyn.

a combination of keys might work plus an extra logical in the bdy namelist for surface pressure to be called.
Though we are trying to move away from key dependence!

the call to sbc_apr in sbcmod could be key dependent upon bdy (if there is key_bdy don't call it here)
if there was a key_bdy then it could be called somewhere in bdydta,
this would also need another logical in the bdy namelist to not call it in the case we don't want an atmospheric pressure effect)

That may work though it is a bit convoluted and uses keys,
what do you think?

I can code this as a proof of concept which might uncover further problems to be discussed or we can think of another way to solve the issue entirely.

comment:5 Changed 5 years ago by deazer

Proposed Solution

Files Changed:
M NEMOGCM/CONFIG/AMM12/EXP00/namelist_cfg
M NEMOGCM/CONFIG/SHARED/namelist_ref
M NEMOGCM/NEMO/OPA_SRC/SBC/sbcmod.F90
M NEMOGCM/NEMO/OPA_SRC/step.F90
M NEMOGCM/NEMO/OPA_SRC/step_oce.F90

namelists changes just implement sbc_apr with bdys

change to step_oce , includes USE sbc_apr

   USE sbctide          ! Tide initialisation
   USE sbcapr           ! surface boundary condition: ssh_ib required by bdydta


change to step.F90:

      IF( lk_tide    )   CALL sbc_tide( kstp )
      IF( lk_bdy     )  THEN
         IF( ln_apr_dyn)     CALL sbc_apr( kstp )   ! bdy_dta needs ssh_ib 
                         CALL bdy_dta ( kstp, time_offset=+1 )   ! update dynamic & tracer data a
      ENDIF
                         CALL sbc    ( kstp )         ! Sea Boundary Condition (including sea-ice
                                                      ! clem: moved here for bdy ice purpose

That is if bdy is used her ewe call sbc_apr before bdy_dta,

I don't think there are any issues with this but I welcome any comments if it is.

Changes to sbcmod.F90 is a USE to get lk_bdy

   USE bdy_par          ! Require lk_bd

and keying out the call to sbc_apr if bdy is used:

      IF ( .NOT. lk_bdy ) then
         IF( ln_apr_dyn ) CALL sbc_apr( kt )                ! atmospheric pressure provided at kt
      ENDIF

This works ok for AMM sette tests if mslp fields present.

If no objections by Monday, will commit back to trunk then.

comment:6 Changed 5 years ago by clem

It is a bit twisted but I do not see other way to do it.
I would say you can commit.

comment:7 Changed 5 years ago by deazer

  • Resolution set to fixed
  • Status changed from new to closed

comment:8 Changed 4 years ago by nicolasmartin

  • Keywords BDY added; bdy_dta removed

comment:9 Changed 4 years ago by nicolasmartin

  • Keywords apr removed

comment:10 Changed 4 years ago by nicolasmartin

  • Keywords inv removed

comment:11 Changed 4 years ago by nicolasmartin

  • Keywords SSH added; ssh_ib removed

comment:12 Changed 4 years ago by nicolasmartin

  • Keywords nemo_v3_6* added

comment:13 Changed 3 years ago by nemo

  • Keywords release-3.6* added; nemo_v3_6* removed

comment:14 Changed 3 years ago by nemo

  • Keywords restartability added; restart removed

comment:15 Changed 3 years ago by nemo

  • Keywords release-3.6 added

comment:16 Changed 3 years ago by nemo

  • Keywords release-3.6* removed
Note: See TracTickets for help on using tickets.