Skip to content
UCLA's Magnetohydrodynamic Object Oriented Solver. MOONS is a finite difference research code, written in fortran, for studying MHD flows.
Fortran TeX Python MAXScript MATLAB Makefile Other
Branch: master
Clone or download
charleskawczynski Merge branch 'master' of https://github.com/charliekawczynski/MOONS
Just tried pulling and resolving conflicts. About to try pushing again
Just tried pulling and resolving conflicts. About to try pushing again..
Latest commit 37abed1 Mar 8, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
__documentation
code Merge branch 'master' of https://github.com/charliekawczynski/MOONS Mar 7, 2018
code_not_compiled
makefiles
matlab
out_dir About to push to workstation for some last-minute sims. Dec 19, 2017
python
python_generator Merge branch 'master' of https://github.com/charliekawczynski/MOONS Mar 7, 2018
saved_input_files The input file is now selected in the makefile. This way, the input f… Jan 12, 2018
saved_meshes Added and confirmed full BC mesh to sim_params_extend. Nov 27, 2017
scratch paper Changes: Aug 23, 2017
tecplot Need to checkout older commit for bandaru case and incrementally change. Jul 7, 2017
wxmaxima/LU_decomposition About to push for Peter at Hypercomp. Jun 15, 2017
.gitignore About to push to remote and pull to work PC. Mar 7, 2018
README.md About to push to workstation for some last-minute sims. Dec 19, 2017
display_examples.f90 Replaced nearly all of MOONS.py with generated code. Sep 8, 2017
q Just verified curl-curl diagonal preconditioner. All preconditioners … Jan 4, 2016

README.md

MOONS

UCLA's Magnetohydrodynamic Object Oriented Solver. MOONS is a finite difference research code, written in fortran, for studying MHD flows in rectangular coordinate systems.

Here are instructions on how to run a simulation:

  1. Run the code generator and makefile generator 1.1) Navigate to the python_generator/application/ folder and run main.py. This will auto-generate a huge portion of the MOONS data structure, including constructors, destructors, and print and other routines. Running main.py also preps the final makefile. So, main.py must be run after adding any new handwritten files to the code (that need compiled).

  2. Configure the makefile 2.1) Navigate to, and open, the makefile in the makefiles/ folder. 2.1) Configure the path where the simulation will be run, in the variable TARGET_DIR. 2.1) Configure the release ('DEBUG','OPTIMIZE','PROFILE') and parallelization (all near the top). 2.1) Choose a cluster (or make your own) with the 'CLUSTER' variable. This variable allows for customized compiler flags depending on the machine being used. The purpose is to allow each user to create customized settings.

  3. Configure the TARGET_DIR 3.1) The TARGET_DIR (set in the makefile) folder must contain 2 files and 1 folder (main.f90, makefile,out/). They can be copied over directly from the out_dir/ folder.

  4. Delete the restart file (if it exists, or for a fresh simulation only) 4.1) If out/LDC does not exist, then skip this step. Navigate to the restart folder (e.g. out/LDC/restart/restart1) & delete the "primitives.dat" file. This ensures that the code will not attempt to restart the simulation, which is (AND SHOULD REMAIN) the default behavior. See the below explanation as to why.

  5. Configure the simulation parameters 5.1) Navigate to the code/handwritten/sim_params/sim_params_extend.f90 file and set the desired parameters for the simulation. There should be comments in this file to help assist how the parameters should be set. When a particular case is set, they can be hard-code saved in the saved_input_files/ folder.

  6. Build and run MOONS 6.1) Open a git shell window and navigate to the makefiles/ folder in it. 6.2) Clean the object files and modules with the "make clean" command 6.3) Build with the "make" command 6.4) Build and run with the "make run" command

** Windows CMD has, in the past, demonstrated spurrious compilation errors that have not been resolved. The latest conclusion is that, actually, this is a windows command prompt bug, and not related to MOONS nor the makefile. Git Power Shell does not demonstrate this bug with the same exact code and makefile configuration, which supports this hypothesis.

*** The code should always try to restart as the default behavior so that, in the event of a crash, the only required action needed is to double click the MOONS.exe application, which will automatically restart the code. The reason that this should not be changed is that, if the code crashes and restarting is not the default behavior, then a new MOONS.exe must be generated. That means that the .exe must be built by setting up the code for that particular set of simulation parameters, which is a time consuming and tedious task if it has not been looked at for months.

You can’t perform that action at this time.