MPPNP

General Overview
Main codes. Note while PPN (single zone) does not handle convection, MPPNP (multi-zone) does. MPPNP calculations need a lot more computer resource than PPN. So, recommended to use a cluster computer, etc.

Check this website mppnp github wiki.

Installation
Basically, follow some ReadMe files in the directories. MPPNP GitHub wiki page.
 * I did try this installation at NuGrid meeting, 2019 September. It didn't work out in the end in neither my Mac or Linux (Sony; installation (make) was successful, but error messages in running mppnp; probably hdf is not well installed). So I will try at gca server later (it worked!).

Installation requirement is
 * 1) SE library (developped by NuGrid collaboration); download NuSE from NuGrid GitHub and compile it (./configure --> make --> make install). Don't forget to set path in Make.local file.
 * 2) OpenMPI. Linux (Ubuntu) is easy to install (as far as I remember, not big trouble), but but Mac might be have some problems. Anyway, Mac is not ideal for running MPPNP. 2019/9/18, I installed OpenMPI by "sudo apt-get install openmpi-bin openmpi-common openssh-client openssh-server libopenmpi1.10 libopenmpi-dbg libopenmpi-dev" on GCA server. This pdf is useful OpenMPI. I set path in Make.local like /user/bin because this is where openmpi is installed. Also note, libopenmpi-dbg was not installed because it was not found on apt repository, but it's fine and mppnp working ok.
 * 3) HDF5. Download hdf5 from the official website and install from the source (ver 1-10-5). I don't know if it is possible to install by apt-get. For GCA's case, it was installed already, so I didn't do anything. My peronal Sony Linux has error message in mppnp, probably because hdf5 installation is not working well.
 * 4) hdf5-viewer (hdfview). This is not at all required, but convenient to check the .h5 file has no problem. When I installed by apt-get, then the viewer couldn't open the .h5 files correctly (nothing was seen). So I installed from the source (HDFView-3.1 Linux) by downloading from the HDF official site (run hdfview.sh), then I could see the .h5 files appropariately. For GCS, just apt-get install hdfviewer was enough to look into h5 files.

Now test with the Run_Template directory.
 * 1) cd run_template.
 * 2) Set the PCD path to "source" directory in Makefile of the directory like "PCD=../source"
 * 3) Follow the ReadMe file, i.e., ("make distclean" if you wish, and then) "make". This will create mppnp.exe.
 * 4) run by "mpirun -np 3 (or number of your cpu) mppnp.exe". You will see output files. You need to set data directory (datadir) and prefix appropriately in ppn_frame.input. Most likely you need to download these data file from CANFAR. I run with M25_z0.02 case on GCA and worked well.

Examples
- I downloaded M25 Z0.02 h5 files from CANFAR and set these paths in ppn_frame.input (used wget url for downloading.) - "make" - "mpirun -np 8 mppnp.exe" <-- because gca server has 8 cores - "python abu_evolution.py" <-- I modified "abu_evolution.py" in ppn. Basically follow what nugridse.py said in the beginning of the code. Note you need to change to "c = nugridse.se" in line ~120 of data_plot.py. This specifies that we're using MPPNP not PPN. - With the above script, you can draw mass (radius) vs rho curve in a specific cycle, and so on. (note at this point, you just plot mass vs rho in one clcle. mass radius (obviously) and rho are functions of mass (radius) in the cycle).
 * 1) run_test (or run_template) (now working as of 2019/9/21)

- Downloaded h5 files from CANFAR as each of ppn_frame.input in the directories indicate (M6, M3, M5). - "make" - Before running "mpirun -np 8 mppnp.exe", note, in ppn_frame.input, iniabu = 11 if you want to set an abundance file (MPPNP wiki says 10, but it is wrong). - If you don't set initial abundance correctly, you won't see any output in iso_mass_f, etc in H5_out or H5_surf (only surface area). So you need to be extra careful. - run mppnp (see above). - Now using "analysis.py" which is based on "abu_evolution.py" I wrote above. Note the output file directory path is set correctly (H5_out; H5_surf maybe ok?). Also note you can limit the radius to see the abundance by mass_range=[]. amass_range is for atomic mass, not stellar mass (radius).
 * 1) example codes; mppnp_HBB, mppnp_Hcore_burning, mppnp_Hecore_burning (working in 2019 Sep., and improved python visualization, etc. All worked well!).


 * 1) One basic mistake is, don't forget to check 'last_restart' file. Sometimes you forget to reset to 0 1 in the file and get an error message when you just want to start the run from scratch.


 * 1) Note, sometimes mpirun shows some error like ".... READ -1, errnum=1". You can fix this by setting "export OMPI_MCA_btl_vader_single_copy_mechanism=none" in ~/.bashrc.