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 removed.

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 Feb 1, 2024
1 parent 296ed40 commit 7fcf30b
Show file tree
Hide file tree
Showing 31 changed files with 205 additions and 653 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_ */
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
38 changes: 2 additions & 36 deletions Src/Base/AMReX_CONSTANTS.H
Original file line number Diff line number Diff line change
Expand Up @@ -4,41 +4,7 @@

#include <AMReX_REAL.H>


#ifdef BL_LANG_FORT

#ifndef AMREX_XSDK

#define bigreal BL_REAL_E(1.0,30)
#define zero BL_REAL(0.0)
#define one BL_REAL(1.0)
#define two BL_REAL(2.0)
#define three BL_REAL(3.0)
#define four BL_REAL(4.0)
#define five BL_REAL(5.0)
#define six BL_REAL(6.0)
#define seven BL_REAL(7.0)
#define eight BL_REAL(8.0)
#define nine BL_REAL(9.0)
#define ten BL_REAL(10.0)
#define twelve BL_REAL(12.0)
#define fifteen BL_REAL(15.0)
#define sixteen BL_REAL(16.0)
#define twenty BL_REAL(20.0)
#define seventy BL_REAL(70.0)
#define ninety BL_REAL(90.0)
#define tenth BL_REAL(0.1)
#define eighth BL_REAL(0.125)
#define sixth BL_REAL(0.16666666666666667)
#define fifth BL_REAL(0.2)
#define fourth BL_REAL(0.25)
#define third BL_REAL(0.33333333333333333)
#define half BL_REAL(0.5)
#define two3rd BL_REAL(0.66666666666666667)
#define Pi BL_REAL(3.1415926535897932)

#endif /* ndef AMREX_XSDK */

#endif /*BL_LANG_FORT*/
/* Maybe in the future we will add some constants here. */
/* If we do, make sure this file is Fortran safe. */

#endif /*BL_CONSTANTS_H*/
44 changes: 0 additions & 44 deletions Src/Base/AMReX_FILCC_1D.F90

This file was deleted.

60 changes: 0 additions & 60 deletions Src/Base/AMReX_FILCC_2D.F90

This file was deleted.

Loading

0 comments on commit 7fcf30b

Please sign in to comment.