Configure LFM for working with arbitrary resolutions

Warning: For advanced users only!

Custom LFM resolution configurations is an advanced topic. We do not recommend and do not support custom grid resolutions.

This page documents how to create configuration files for arbitrary resolution size and processor counts. You are in the right place if your resolution/processor count is not one of the pre-configured resolutions shipped with the LFM.

To compile the code for an arbitrary grid size and number of processors, you must run a configuration script to set up the appropriate (*.inc) include files required by the Fortran subroutines.

Note

We intend on dynamically allocating arrays (FORTRAN allocatable arrays) for a future release of the code. In the interim, you must run the configuration script before compiling and running parallel LFM.

The first step is to edit "param.h" file to reflect your choices. If you are new to the code, it is probably best to start with a pre-made file included in the LTR-para/LFM-para/src/param/ as a template. The standard naming convention is param-nixnjxnk-np.h where ni, nj, nk are the grid resolution and np is the number of processors. My favorite template to start with is "param-53x48x64-8.h" which has i,j,k grid resolution = 53x48x64 on 8 processors.

param-53x48x64-8.h
/*  dimensioning information for MHD code */
#define      N_I    53
#define      N_J    48
#define      N_K    64
#define      N_ORDER 8
#define      NUMBER_OF_PROCESSORS   8
#define      NUMBER_OF_MHD          8
#define      NUMBER_OF_ION          1
#define      NION_I                 49
#define      NION_J                 35

where

  • N_I, N_J, N_K are the sizes of your computational grid,
  • N_ORDER is the numerical order of the scheme,
  • NUMBER_OF_PROCESSORS is the total number of processors to be used by the both the magnetospheric and ionospheric portions of the simulation,
  • NUMBER_OF_MHD is the number of processors working on the MHD calculation should equal total number of processors
  • NUMBER_OF_ION is the number of processors working on the ionospheric portion
  • NION_I, NION_J are the sizes of the ionospheric grid and by default are N_J+1 and N_K/2+3. You probably want to leave NION_I = N_J+1 and NION_J = (N_K/2)+3 to avoid errors while running the code.

Once param.h is in place:

  1. Build the MSETUP program:
    cd path/to/LTR-para
      setenv MACHINE computername
      gmake MSETUP
    
  2. Execute MSETUP:
    mpirun \-np NUMBER_OF_PROCESSORS MSETUP > MSETUP.info
    
  3. Process the output with create-param.pl to create the (*.inc) include files need by the parallel version of the LFM:
    perl create-param.pl MSETUP.info
    
    # Set up the proper links to your custom param files:
    mv param-tmp.inc param-nixnjxnk-np.inc
      mv ion-param-tmp.inc ion-param-nixnjxnk-np.inc
      ln -sf param-nixnjxnk-np.inc param.inc
      ln -sf ion-param-nixnjxnk-np.inc ion-param.inc
    
  • No labels