Skip to content

Commit

Permalink
Remove various deprecated stuff not prefixed by amrex or bl
Browse files Browse the repository at this point in the history
Most codes should not be affected by the removal. Some old codes that used
to use BoxLib might need updates.

AMReX_ArrayLim.H contains macros that are useful for calling Fortran
subroutines from C++. The old macros that do not start with `AMREX_` or
`BL_` have been moved to AMReX_ArrayLim_Old.H, which is only available if
one uses the amrex source directly.

Some macros defining BC types in AMReX_BC_TYPES.H have been removed. One
should use the C++ enum types (e.g., amrex::BCType::reflect_odd) or Fortran
module amrex_bc_types_module.

Macros defined in AMReX_CONSTANTS.H for Fortran have been removed. One
should use amrex_constants_module instead.

Fortran subroutines filcc and filccn have been removed. One should use
amrex_filcc and amrex_filccn instead.

The REAL_T macro for Fortran has been removed. One should use amrex_real in
amrex_fort_module instead.

The blutilrand function has been removed. If one needs random numbers in
Fortran, one should amrex_random in amrex_fort_module. Apparently this
function is very old. Recently, we had a multiple definition problem when we
tried to use amrex in a code containing this function that was copied from
BoxLib many years ago.

Macros like D_DECL have been removed from AMReX_SPACE.H. One should use the
AMREX_ version instead.

Macros like LO_DIRICHLET have been removed from AMReX_LO_BCTYPES.H. One
should use the AMREX_ version instead.
  • Loading branch information
WeiqunZhang committed Jan 21, 2024
1 parent 022f97e commit ddf13ff
Show file tree
Hide file tree
Showing 32 changed files with 285 additions and 585 deletions.
6 changes: 3 additions & 3 deletions Docs/sphinx_documentation/source/AmrCore.rst
Original file line number Diff line number Diff line change
Expand Up @@ -648,11 +648,11 @@ interface to a Fortran routine that tags cells (in this case, :fortran:`state_er
const int* thi = tilebox.hiVect();

// tag cells for refinement
state_error(tptr, ARLIM_3D(tlo), ARLIM_3D(thi),
state_error(tptr, AMREX_ARLIM_3D(tlo), AMREX_ARLIM_3D(thi),
BL_TO_FORTRAN_3D(state[mfi]),
&tagval, &clearval,
ARLIM_3D(tilebox.loVect()), ARLIM_3D(tilebox.hiVect()),
ZFILL(dx), ZFILL(prob_lo), &time, &phierr[lev]);
AMREX_ARLIM_3D(tilebox.loVect()), AMREX_ARLIM_3D(tilebox.hiVect()),
AMREX_ZFILL(dx), AMREX_ZFILL(prob_lo), &time, &phierr[lev]);
//
// Now update the tags in the TagBox in the tilebox region
// to be equal to itags
Expand Down
2 changes: 1 addition & 1 deletion Docs/sphinx_documentation/source/AmrLevel.rst
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ the :cpp:`AmrLevelAdv` class, e.g.,
int lo_bc[BL_SPACEDIM];
int hi_bc[BL_SPACEDIM];
for (int i = 0; i < BL_SPACEDIM; ++i) {
lo_bc[i] = hi_bc[i] = INT_DIR; // periodic boundaries
lo_bc[i] = hi_bc[i] = amrex::BCType::int_dir; // periodic boundaries
}

BCRec bc(lo_bc, hi_bc);
Expand Down
162 changes: 2 additions & 160 deletions Src/Base/AMReX_ArrayLim.H
Original file line number Diff line number Diff line change
Expand Up @@ -8,37 +8,6 @@

#include <AMReX_Array.H>

/*
** C++ stuff ...
*/

#ifndef AMREX_XSDK

#if AMREX_SPACEDIM==1
#define ARLIM_P(x) const int&
#define ARLIM(x) (x)[0]
#define ARLIM_3D(x) amrex::GpuArray<int,3>{(x)[0], 0, 0}.data()
#define ARLIM_ANYD(x) amrex::GpuArray<int,3>{(x)[0], 0, 0}.data()
#define ZFILL(x) amrex::GpuArray<amrex::Real,3>{(x)[0], 0., 0.}.data()
#define AMREX_REAL_ANYD(x) AMREX_ZFILL(x)
#elif AMREX_SPACEDIM==2
#define ARLIM_P(x) const int&,const int&
#define ARLIM(x) (x)[0],(x)[1]
#define ARLIM_3D(x) amrex::GpuArray<int,3>{(x)[0], (x)[1], 0}.data()
#define ARLIM_ANYD(x) amrex::GpuArray<int,3>{(x)[0], (x)[1], 0}.data()
#define ZFILL(x) amrex::GpuArray<amrex::Real,3>{(x)[0], (x)[1], 0.}.data()
#define AMREX_REAL_ANYD(x) AMREX_ZFILL(x)
#elif AMREX_SPACEDIM==3
#define ARLIM_P(x) const int&,const int&,const int&
#define ARLIM(x) (x)[0],(x)[1],(x)[2]
#define ARLIM_3D(x) x
#define ARLIM_ANYD(x) x
#define ZFILL(x) x
#define AMREX_REAL_ANYD(x) AMREX_ZFILL(x)
#endif

#endif /* ndef AMREX_XSDK */

#if AMREX_SPACEDIM==1
#define AMREX_ARLIM_P(x) const int&
#define AMREX_ARLIM(x) (x)[0]
Expand Down Expand Up @@ -81,133 +50,6 @@

#define BL_TO_FORTRAN_BOX(x) AMREX_ARLIM_3D((x).loVect()), AMREX_ARLIM_3D((x).hiVect())

#else

#if !defined(BL_LANG_FORT)

#ifndef AMREX_XSDK

/* C stuff */
#if AMREX_SPACEDIM == 1
#define ARLIM_P(x) const int*
#elif AMREX_SPACEDIM == 2
#define ARLIM_P(x) const int*, const int*
#else
#define ARLIM_P(x) const int*, const int*, const int*
#endif

#endif /* ndef AMREX_XSDK */

#if AMREX_SPACEDIM == 1
#define AMREX_ARLIM_P(x) const int*
#elif AMREX_SPACEDIM == 2
#define AMREX_ARLIM_P(x) const int*, const int*
#else
#define AMREX_ARLIM_P(x) const int*, const int*, const int*
#endif

#else

#ifndef AMREX_XSDK

/*
** Fortran stuff ...
*/

#if __STDC__==1 || defined(__INTEL_COMPILER)

#if (AMREX_SPACEDIM == 1)
#define DIMS(a) a##_l1, a##_h1
#define DIMDEC(a) a##_l1, a##_h1
#define DIMV(a) a##_l1:a##_h1
#define DIM1(a) a##_l1:a##_h1
#define ARG_L1(a) a##_l1
#define ARG_H1(a) a##_h1
#define DIMARG(a) a##(1)
#endif

#if (AMREX_SPACEDIM == 2)
#define DIMS(a) a##_l1, a##_l2, a##_h1, a##_h2
#define DIMDEC(a) a##_l1, a##_l2, a##_h1, a##_h2
#define DIMV(a) a##_l1:a##_h1, a##_l2:a##_h2
#define DIM1(a) a##_l1:a##_h1
#define DIM2(a) a##_l2:a##_h2
#define ARG_L1(a) a##_l1
#define ARG_L2(a) a##_l2
#define ARG_H1(a) a##_h1
#define ARG_H2(a) a##_h2
#define DIMARG(a) a##(1),a##(2)
#endif

#if (AMREX_SPACEDIM == 3)
#define DIMS(a) a##_l1, a##_l2, a##_l3, a##_h1, a##_h2, a##_h3
#define DIMDEC(a) a##_l1, a##_l2, a##_l3, a##_h1, a##_h2, a##_h3
#define DIMV(a) a##_l1:a##_h1, a##_l2:a##_h2, a##_l3:a##_h3
#define DIM1(a) a##_l1:a##_h1
#define DIM2(a) a##_l2:a##_h2
#define DIM3(a) a##_l3:a##_h3
#define DIM12(a) a##_l1:a##_h1, a##_l2:a##_h2
#define DIM23(a) a##_l2:a##_h2, a##_l3:a##_h3
#define DIM13(a) a##_l1:a##_h1, a##_l3:a##_h3
#define ARG_L1(a) a##_l1
#define ARG_L2(a) a##_l2
#define ARG_L3(a) a##_l3
#define ARG_H1(a) a##_h1
#define ARG_H2(a) a##_h2
#define ARG_H3(a) a##_h3
#define DIMARG(a) a##(1),a##(2),a##(3)
#endif

#else

#if (AMREX_SPACEDIM == 1)
#define DIMS(a) a/**/_l1, a/**/_h1
#define DIMDEC(a) a/**/_l1, a/**/_h1
#define DIMV(a) a/**/_l1:a/**/_h1
#define DIM1(a) a/**/_l1:a/**/_h1
#define ARG_L1(a) a/**/_l1
#define ARG_H1(a) a/**/_h1
#define DIMARG(a) a/**/(1)
#endif

#if (AMREX_SPACEDIM == 2)
#define DIMS(a) a/**/_l1, a/**/_l2, a/**/_h1, a/**/_h2
#define DIMDEC(a) a/**/_l1, a/**/_l2, a/**/_h1, a/**/_h2
#define DIMV(a) a/**/_l1:a/**/_h1, a/**/_l2:a/**/_h2
#define DIM1(a) a/**/_l1:a/**/_h1
#define DIM2(a) a/**/_l2:a/**/_h2
#define ARG_L1(a) a/**/_l1
#define ARG_L2(a) a/**/_l2
#define ARG_H1(a) a/**/_h1
#define ARG_H2(a) a/**/_h2
#define DIMARG(a) a/**/(1),a/**/(2)
#endif

#if (AMREX_SPACEDIM == 3)
#define DIMS(a) a/**/_l1, a/**/_l2, a/**/_l3, a/**/_h1, a/**/_h2, a/**/_h3
#define DIMDEC(a) a/**/_l1, a/**/_l2, a/**/_l3, a/**/_h1, a/**/_h2, a/**/_h3
#define DIMV(a) a/**/_l1:a/**/_h1, a/**/_l2:a/**/_h2, a/**/_l3:a/**/_h3
#define DIM1(a) a/**/_l1:a/**/_h1
#define DIM2(a) a/**/_l2:a/**/_h2
#define DIM3(a) a/**/_l3:a/**/_h3
#define DIM12(a) a/**/_l1:a/**/_h1, a/**/_l2:a/**/_h2
#define DIM23(a) a/**/_l2:a/**/_h2, a/**/_l3:a/**/_h3
#define DIM13(a) a/**/_l1:a/**/_h1, a/**/_l3:a/**/_h3
#define ARG_L1(a) a/**/_l1
#define ARG_L2(a) a/**/_l2
#define ARG_L3(a) a/**/_l3
#define ARG_H1(a) a/**/_h1
#define ARG_H2(a) a/**/_h2
#define ARG_H3(a) a/**/_h3
#define DIMARG(a) a/**/(1),a/**/(2),a/**/(3)
#endif

#endif /*__STDC__==1*/

#endif /* ndef AMREX_XSDK */

#endif /*else of !defined(BL_LANG_FORT)*/

#endif /*else of __cplusplus*/
#endif /* __cplusplus */

#endif /*BL_ARRAYLIM_H*/
#endif /* AMREX_ARRAYLIM_H_ */
148 changes: 148 additions & 0 deletions Src/Base/AMReX_ArrayLim_Old.H
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
#ifndef AMREX_ARRAYLIM_OLD_H_
#define AMREX_ARRAYLIM_OLD_H_
#include <AMReX_Config.H>

#include <AMReX_ArrayLim.H>

#ifdef __cplusplus

#include <AMReX_Array.H>

/*
** C++ stuff ...
*/

#if AMREX_SPACEDIM==1
#define ARLIM_P(x) const int&
#define ARLIM(x) (x)[0]
#define ARLIM_3D(x) amrex::GpuArray<int,3>{(x)[0], 0, 0}.data()
#define ARLIM_ANYD(x) amrex::GpuArray<int,3>{(x)[0], 0, 0}.data()
#define ZFILL(x) amrex::GpuArray<amrex::Real,3>{(x)[0], 0., 0.}.data()
#elif AMREX_SPACEDIM==2
#define ARLIM_P(x) const int&,const int&
#define ARLIM(x) (x)[0],(x)[1]
#define ARLIM_3D(x) amrex::GpuArray<int,3>{(x)[0], (x)[1], 0}.data()
#define ARLIM_ANYD(x) amrex::GpuArray<int,3>{(x)[0], (x)[1], 0}.data()
#define ZFILL(x) amrex::GpuArray<amrex::Real,3>{(x)[0], (x)[1], 0.}.data()
#elif AMREX_SPACEDIM==3
#define ARLIM_P(x) const int&,const int&,const int&
#define ARLIM(x) (x)[0],(x)[1],(x)[2]
#define ARLIM_3D(x) x
#define ARLIM_ANYD(x) x
#define ZFILL(x) x
#endif

#else

#if !defined(BL_LANG_FORT)

/* C stuff */
#if AMREX_SPACEDIM == 1
#define ARLIM_P(x) const int*
#elif AMREX_SPACEDIM == 2
#define ARLIM_P(x) const int*, const int*
#else
#define ARLIM_P(x) const int*, const int*, const int*
#endif

#else

/*
** Fortran stuff ...
*/

#if __STDC__==1 || defined(__INTEL_COMPILER)

#if (AMREX_SPACEDIM == 1)
#define DIMS(a) a##_l1, a##_h1
#define DIMDEC(a) a##_l1, a##_h1
#define DIMV(a) a##_l1:a##_h1
#define DIM1(a) a##_l1:a##_h1
#define ARG_L1(a) a##_l1
#define ARG_H1(a) a##_h1
#define DIMARG(a) a##(1)
#endif

#if (AMREX_SPACEDIM == 2)
#define DIMS(a) a##_l1, a##_l2, a##_h1, a##_h2
#define DIMDEC(a) a##_l1, a##_l2, a##_h1, a##_h2
#define DIMV(a) a##_l1:a##_h1, a##_l2:a##_h2
#define DIM1(a) a##_l1:a##_h1
#define DIM2(a) a##_l2:a##_h2
#define ARG_L1(a) a##_l1
#define ARG_L2(a) a##_l2
#define ARG_H1(a) a##_h1
#define ARG_H2(a) a##_h2
#define DIMARG(a) a##(1),a##(2)
#endif

#if (AMREX_SPACEDIM == 3)
#define DIMS(a) a##_l1, a##_l2, a##_l3, a##_h1, a##_h2, a##_h3
#define DIMDEC(a) a##_l1, a##_l2, a##_l3, a##_h1, a##_h2, a##_h3
#define DIMV(a) a##_l1:a##_h1, a##_l2:a##_h2, a##_l3:a##_h3
#define DIM1(a) a##_l1:a##_h1
#define DIM2(a) a##_l2:a##_h2
#define DIM3(a) a##_l3:a##_h3
#define DIM12(a) a##_l1:a##_h1, a##_l2:a##_h2
#define DIM23(a) a##_l2:a##_h2, a##_l3:a##_h3
#define DIM13(a) a##_l1:a##_h1, a##_l3:a##_h3
#define ARG_L1(a) a##_l1
#define ARG_L2(a) a##_l2
#define ARG_L3(a) a##_l3
#define ARG_H1(a) a##_h1
#define ARG_H2(a) a##_h2
#define ARG_H3(a) a##_h3
#define DIMARG(a) a##(1),a##(2),a##(3)
#endif

#else

#if (AMREX_SPACEDIM == 1)
#define DIMS(a) a/**/_l1, a/**/_h1
#define DIMDEC(a) a/**/_l1, a/**/_h1
#define DIMV(a) a/**/_l1:a/**/_h1
#define DIM1(a) a/**/_l1:a/**/_h1
#define ARG_L1(a) a/**/_l1
#define ARG_H1(a) a/**/_h1
#define DIMARG(a) a/**/(1)
#endif

#if (AMREX_SPACEDIM == 2)
#define DIMS(a) a/**/_l1, a/**/_l2, a/**/_h1, a/**/_h2
#define DIMDEC(a) a/**/_l1, a/**/_l2, a/**/_h1, a/**/_h2
#define DIMV(a) a/**/_l1:a/**/_h1, a/**/_l2:a/**/_h2
#define DIM1(a) a/**/_l1:a/**/_h1
#define DIM2(a) a/**/_l2:a/**/_h2
#define ARG_L1(a) a/**/_l1
#define ARG_L2(a) a/**/_l2
#define ARG_H1(a) a/**/_h1
#define ARG_H2(a) a/**/_h2
#define DIMARG(a) a/**/(1),a/**/(2)
#endif

#if (AMREX_SPACEDIM == 3)
#define DIMS(a) a/**/_l1, a/**/_l2, a/**/_l3, a/**/_h1, a/**/_h2, a/**/_h3
#define DIMDEC(a) a/**/_l1, a/**/_l2, a/**/_l3, a/**/_h1, a/**/_h2, a/**/_h3
#define DIMV(a) a/**/_l1:a/**/_h1, a/**/_l2:a/**/_h2, a/**/_l3:a/**/_h3
#define DIM1(a) a/**/_l1:a/**/_h1
#define DIM2(a) a/**/_l2:a/**/_h2
#define DIM3(a) a/**/_l3:a/**/_h3
#define DIM12(a) a/**/_l1:a/**/_h1, a/**/_l2:a/**/_h2
#define DIM23(a) a/**/_l2:a/**/_h2, a/**/_l3:a/**/_h3
#define DIM13(a) a/**/_l1:a/**/_h1, a/**/_l3:a/**/_h3
#define ARG_L1(a) a/**/_l1
#define ARG_L2(a) a/**/_l2
#define ARG_L3(a) a/**/_l3
#define ARG_H1(a) a/**/_h1
#define ARG_H2(a) a/**/_h2
#define ARG_H3(a) a/**/_h3
#define DIMARG(a) a/**/(1),a/**/(2),a/**/(3)
#endif

#endif /*__STDC__==1*/

#endif /*else of !defined(BL_LANG_FORT)*/

#endif /*else of __cplusplus*/

#endif
22 changes: 0 additions & 22 deletions Src/Base/AMReX_BC_TYPES.H
Original file line number Diff line number Diff line change
Expand Up @@ -82,26 +82,4 @@ enum mathematicalBndryTypes : int {
}
#endif

#ifndef AMREX_XSDK

#define BOGUS_BC (-666)

#define REFLECT_ODD (-1)
#define INT_DIR 0
#define REFLECT_EVEN 1
#define FOEXTRAP 2
#define EXT_DIR 3
#define HOEXTRAP 4
#define HOEXTRAPCC 5
#define EXT_DIR_CC 6

#define Interior 0
#define Inflow 1
#define Outflow 2
#define Symmetry 3
#define SlipWall 4
#define NoSlipWall 5

#endif

#endif
Loading

0 comments on commit ddf13ff

Please sign in to comment.