Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FABM advection with semi-implicit and TVD #7

Open
riquitorres opened this issue Jun 8, 2022 · 0 comments
Open

FABM advection with semi-implicit and TVD #7

riquitorres opened this issue Jun 8, 2022 · 0 comments

Comments

@riquitorres
Copy link
Contributor

riquitorres commented Jun 8, 2022

Submitted by Karsten Lettmann

  1. We had some problems with advection of FABM tracers when activating
    with semi-implicit and TVD.
    The tracers were not advected in this case.

For normal explicit runs using TVD everything was fine.

I compared with the advection of salt and there might be some
inconsistency in the code.
I checked your FABM 4.3 and FABM 4.4.1 code I downloaded a few months,
ago. Both had the same issue.

I believe, the problem is in mod_fabm_3D.F in SUBROUTINE FABM_ADV in the
lines (1675 in commit ):

#       if !defined (SEMI_IMPLICIT)
#       if !defined (TVD)
         EXFLUX=-UN*DTIJ(I,K)* &
((1.0_SP+SIGN(1.0_SP,UN))*FIJ2+(1.0_SP-SIGN(1.0_SP,UN))*FIJ1)*0.5_SP+FXX+FYY
#       else
         EXFLUX=-UN*DTIJ(I,K)* &
((1.0_SP+SIGN(1.0_SP,UN))*FAB12_B+(1.0_SP-SIGN(1.0_SP,UN))*FAB12_A)*0.5_SP+FXX+FYY
#       endif
#       else
         EXFLUX=-UN*DTIJ(I,K)* &
((1.0_SP+SIGN(1.0_SP,UN))*FIJ2+(1.0_SP-SIGN(1.0_SP,UN))*FIJ1)*0.5_SP
EXFLUX=(1.0_SP-IFCETA)*EXFLUX+IFCETA*(-UN1*DTIJ1(I,K)*((1.0_SP+SIGN(1.0_SP,UN1))*FIJ2+(1.0_SP-SIGN(1.0_SP,UN1))*FIJ1)*0.5_SP)+FXX+FYY
#       endif

For a semi-implicit run the following lines might be used even for TVD:

         EXFLUX=-UN*DTIJ(I,K)* &
((1.0_SP+SIGN(1.0_SP,UN))*FIJ2+(1.0_SP-SIGN(1.0_SP,UN))*FIJ1)*0.5_SP
EXFLUX=(1.0_SP-IFCETA)*EXFLUX+IFCETA*(-UN1*DTIJ1(I,K)*((1.0_SP+SIGN(1.0_SP,UN1))*FIJ2+(1.0_SP-SIGN(1.0_SP,UN1))*FIJ1)*0.5_SP)+FXX+FYY

Here, the variables FIJ1 and FIJ2 are used, which are not defined in
TVD, where you only specify:

        FAB12_A     =
FABM_ALL(IA,K,IFABM)+0.5_SP*A_LIMITER*(FABM_ALL(IB,K,IFABM)-FABM_ALL(IA,K,IFABM))
        FAB12_B     =
FABM_ALL(IB,K,IFABM)+0.5_SP*B_LIMITER*(FABM_ALL(IA,K,IFABM)-FABM_ALL(IB,K,IFABM))

When comparing it with the adv_s, an easy and compact solution might be:

        FIJ1     =
FABM_ALL(IA,K,IFABM)+0.5_SP*A_LIMITER*(FABM_ALL(IB,K,IFABM)-FABM_ALL(IA,K,IFABM))
! FAB12_A
        FIJ2     =
FABM_ALL(IB,K,IFABM)+0.5_SP*B_LIMITER*(FABM_ALL(IA,K,IFABM)-FABM_ALL(IB,K,IFABM))
! FAB12_B

#       if !defined (SEMI_IMPLICIT)
         EXFLUX=-UN*DTIJ(I,K)* &
((1.0_SP+SIGN(1.0_SP,UN))*FIJ2+(1.0_SP-SIGN(1.0_SP,UN))*FIJ1)*0.5_SP+FXX+FYY
#       else
         EXFLUX=-UN*DTIJ(I,K)* &
((1.0_SP+SIGN(1.0_SP,UN))*FIJ2+(1.0_SP-SIGN(1.0_SP,UN))*FIJ1)*0.5_SP
EXFLUX=(1.0_SP-IFCETA)*EXFLUX+IFCETA*(-UN1*DTIJ1(I,K)*((1.0_SP+SIGN(1.0_SP,UN1))*FIJ2+(1.0_SP-SIGN(1.0_SP,UN1))*FIJ1)*0.5_SP)+FXX+FYY
#       endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant