NRG tutorial code: try it yourself!
Download the code:
(opens in a new window)NRG tutorial code
NRG computer practical:
Installation instructions (Linux):
Download and unzip the code.
Compile: f95 nrg_tut.f90 -llapack -lblas -O5 -o nrg_tut
Installation instructions (Mac OSX):
Download the Makefile
Download and install your favourite fortran compiler.
Adjust the FC variable accordingly. Compile and run the code.
Installation instructions (Windows):
- Click on the above link and download the file 'nrg_tutorial.zip'.
- Unzip 'nrg_tutorial.zip' to create the directory 'nrg_tutorial' in your chosen location, <path;>.;
- From the directory 'nrg_tutorial', run the file 'mingw-get-setup.exe'. Follow the installation instructions.
- Run the program 'MinGW Installer' (if it does not start automatically).
- In the 'Basic Setup' tab, select the boxes for 'mingw32-base' and 'mingw32-gcc-fortran' (mark for installation).
- Select 'Apply Changes' from the 'Installation' menu dropdown. Click 'Apply'. Close the dialogue box and MinGW program when complete.
- Right click on your computer icon, go to properties, advanced system settings, Environment Variables. Look for the 'Path' variable in the 'system variables' box. Click on it and click the 'edit' button. At the start of 'Variable value:' write 'C:\MinGW\bin;' (including the semicolon, without the quotemarks, before the text of the current value). Leave the remainder of the current value unchanged. Click 'OK' and close the dialogue boxes.
- From the directory 'nrg_tutorial', execute the file 'Force209GFortranSetup.exe', and follow the installation instructions.
- From the directory 'nrg_tutorial', execute the file 'gp500-win64-mingw.exe', and follow the installation instructions.
- From the directory 'nrg_tutorial', double-click to execute the file 'nrg_tut.f90', which should now automatically open in the Windows fortran code-editor 'Force 2.0'.
- From the 'Run' dropdown menu, select 'Compilation Options'. Under the 'Run' tab, in the 'Additional Parameters' -> 'Compiler' -> 'Options', type: "-L<path;>\nrg_tutorial", where <path;> is the full path of the directory 'nrg_tutorial'. In the 'Libraries' box, type "-llapack -lblas". Click 'Apply' and 'OK'.
- To run the NRG code, click 'Run' from the 'Run' dropdown menu (or hit the F9 key). Close the Force program once the NRG code has finished running. To run the compiled NRG code in future, the executable 'nrg_tut.exe' can be run directly (outside of Force). The code itself can be edited and/or compiled in Force.
- Run the graphing utility 'Gnuplot' (an icon may have been placed on your desktop). Change directories by selecting 'Change Directory...' from the 'File' dropdown menu. View the entopy plot by typing "plot 'entropy.dat' w lp". See it on a logscale by typing "set logscale x; set format x "%G"; replot". See the fixed point values by typing "replot log(2)" and "replot log(4)".