SourceForge

HOW TO INSTALL & COMPILE PARAMESH AS A LIBRARY

USING THE LIBRARY FLAG

With release 3.2 of PARAMESH you can now set most of the parameters and flags you previously set in the 'paramesh_preprocessor.fh' file at runtime.

This is done by first creating a file called 'amr_runtime_parameters' and placing it in the directory from which you will run your executable. This file is read during the initialization of PARAMESH by calling amr_intialize. An example 'amr_runtime_parameters' file is provided in the top level PARAMESH directory of the distribution. All of these parameters have a one-to-one coorespondence to the parameters in the 'paramesh_preprocessor.fh' file as described elsewhere in this document.

The 'paramesh_preprossor.fh' file must still exist in the headers directory and must contain the following:

#define LIBRARY  ! compile paramesh a LIBRARY
#define REAL4 (or REAL8) ! Select precision of real variables

Once the 'paramesh_preprocessor.fh' file has been set up as described above, the user can then simply compile as normal. However, all other parameters can be set at runtime and one need not recompile each time a parameter is changed. A user can also compile and move the library files to a location accessible by all users of a system. Each user can then link their application to the PARAMESH libraries, i.e., libmodules.a, libparamesh.a and libmpi_paramesh.a.

The format of the 'amr_runtime_parameters' file with the variable names which are read in follows:

integer maxblocks (the total no. of blocks per processor)

integer ndim (the dimension of the problem, 1,2, or 3)

integer l2p5d (0 or 1, switch to determine if a 2.5d model is being used)

integer nxb (the number of grid cells in a single block in the
integer nyb x, y and z directions)
integer nzb

integer nvar (no. of cell centered quantities)

integer nfacevar (no. of face centered quantities)

integer nvaredge (no. of edge centered quantities)

integer nvarcorn (no. of node or corned centered quantities)

integer nvar_work (no. of cell centered quantities in the work arrays)

integer nguard (no. of guard cells)

integer nguard_work (no. of guardcell cells in work array)

integer nfluxvar (no. of variables to which flux conservation will be
applied)

integer nedgevar (no. of variables to which edge averaging will be applied)

integer iface_off (The convention for relating variables associated with
cell interfaces to the variables defined at cell centers is as follows:

If iface_off=0 :
the array facevarx(:,i,j,k,:) for example defines data
on the x(i-1/2) face of the (i,j,k)-th mesh cell.
If iface_off=-1 :
the array facevarx(:,i,j,k,:) for example defines data
on the x(i+1/2) face of the (i,j,k)-th mesh cell.)

integer mflags (parameters used to declare the number of block marker flags needed)

integer nfield_divf (set the number of divergence free fields which you will need)

integer nboundaries (no. of external boundary conditions)

logical diagonals (Are diagonals to be filled when calling the guardcell
routine)

logical amr_error_checking (Do error checking during runtime ? For better
performance set this to .false.)

logical no_permanent_guardcells (Is permanent guardcell storage to be
allocated ?)

logical advance_all_levels (Is the solution to be advanced at all levels in the
tree hierarchy or not ?)

logical force_consistency (Is the consistency of face centered variables of
neighboring blocks at the same refinement level to
be enforced ?)

logical consv_fluxes (Are total fluxes being used for flux conservation ?
Setting this flag forces fluxes to be added at
refinement jumps.)

logical consv_flux_densities (Are flux densities being used ? Setting this
flag forces face centered quantities to be
averaged at refinement jumps.)

logical edge_value (Averge edge values is set to .true.. Must be .false. if
the value below is .true.)

logical edge_value_integ (Sum edge values if set to .true.. Must be .false. if
the above is .true.)

logical var_dt (Is variable time stepping being used ?)

logical pred_corr (Is a predictor-corrector time advance algoithm being used ?)

logical empty_cells (Will any grid blocks represent obstacles to flow ?)

logical conserve (Use a conservative algorithm during prolongation. CAUTION:
this only works with the default linear operation ?)

logical divergence_free (Ensure divergence free prolongation for face centered
variables. CAUTION, not yet working ?)

logical curvilinear (Are curvilinear coordinates being used ?)

logical curvilinear_conserve (Is conservation ensured for restricition step ?)

logical cartesian (Are cartesian coordinates being used ?)

logical cylindrical (Are cylindrical coordindates being used ?)

logical spherical (Are spherical coordinates being used ?)

logical polar (Are polar coordinates being used ?)

logical lsingular line (Does the domain contain a singular line where there is a
degeneracy in the coordinate systems, like a pole)

logical timing_mpi (If .true. turns on timers for timing the mpi version of
PARAMESH).

logical timing_mpix (If .true. turns on more detailed timers, but has
an impact on performance)

character output_dir (Directory where paramesh output should be written)


WARNING !!!: If you have previously written a code that uses an earlier version of PARAMESH and now wish to use the library feature, you must remove any references in your code to preprocessor variables which formerly appeared in 'paramesh_preprocessor.fh' and replace them by adding Fortran code which makes use of the above list of variables. For instance, if your old code read,


#ifdef NO_PERMANENT_GUARDCELLS
      .
      .
      .
      some fortran code that you wrote
      .
      .
      .
#endif

you would replace this with,

      if (no_permanent_guardcells) then
      .
      .
      .
      some fortran code that you wrote
      .
      .
      .
      end if

Note that the replacement code will function correctly whether you use PARAMESH as a Library or not.

An example 'amr_runtime_parameters' file which corresponds to the settings in the default 'paramesh_preprossor.fh' file distributed with the PARAMESH package would look like:

1000
3
0
4
6
8
2
0
0
0
2
1
1
2
0
0
1
0
6
.true.
.true.
.false.
.false.
.true.
.false.
.true.
.true.
.false.
.false.
.false.
.false.
.false.
.false.
.false.
.false.
.false.
.false.
.false.
.true.
.false.
'./'

Return to Main Page.