Original articles by Mark Leair, PGI Compiler Engineer
This is Part 1 of a series of articles:
#!/usr/bin/python | |
""" | |
Parses Fortran Namelists | |
based on Fortran Namelist parser for Python prog/scripts by Stephane Chamberland (stephane.chamberland@ec.gc.ca) | |
http://code.google.com/p/fortran-namelist/ | |
Updated by Volodymyr Vladymyrov (http://stackoverflow.com/users/1296661/vvladymyrov) to parse format presented | |
in http://stackoverflow.com/questions/14165733/regular-expression-parsing-key-value-pairs-in-namelist-input-file | |
added support for | |
1) | |
$NAMELIST |
! MT19937, Mersenne Twister Random Number Generator ([0,1) Real Number) | |
! in Fortran90 | |
! | |
! Usage: | |
! 1) When you use mt19937, add the sentence "use mt19937" | |
! above the implicit sentence. | |
! 2) To set an initial seed, call sgrnd(seed). (The "seed" is an integer.) | |
! If you do not call this, the seed is 4357. | |
! 3) Use the function grnd(). | |
! (Do not declare "real(8) :: grnd".) |
Original articles by Mark Leair, PGI Compiler Engineer
This is Part 1 of a series of articles:
Original article by Mark Leair, PGI Compiler Engineer
Note: This article was revised in March 2015 and again in January 2016 to bring it up-to-date with the production software release and to correct errors in the examples.
This is Part 2 of a series of articles:
There are two schools how to write numerical code, which in this document we will call the IEEE school and the Fortran school.
One end of the spectrum: no changes in floating point by the compiler, the developer must express exact intent. This is the IEEE school.
On the other end of the spectrum: Developer specifies math, the compiler is
! testing in the ipython notebook with the fortran code in one cell: | |
! %%file test.f90 | |
! and with the build call in the following cell: | |
! `!gfortran -shared test.f90 -o test.dll` | |
! note: some useful stuff found here: https://stackoverflow.com/a/13880611/5545005 | |
module c_interop | |
use iso_c_binding | |
implicit none | |
integer, parameter :: STRLEN = 64 | |
contains |
! | |
! PCG Random Number Generation for Fortran | |
! Ported from the minimal C version by Melissa O'Neill | |
! | |
! Copyright 2020 Ivan Pribec <ivan.pribec@gmail.com> | |
! | |
! | |
! Copyright 2014 Melissa O'Neill <oneill@pcg-random.org> | |
! |
<NotepadPlus> | |
<UserLang name="Fortran Namelist" ext="nml" udlVersion="2.1"> | |
<Settings> | |
<Global caseIgnored="yes" allowFoldOfComments="no" foldCompact="no" forcePureLC="0" decimalSeparator="0" /> | |
<Prefix Keywords1="no" Keywords2="no" Keywords3="no" Keywords4="no" Keywords5="no" Keywords6="no" Keywords7="no" Keywords8="no" /> | |
</Settings> | |
<KeywordLists> | |
<Keywords name="Comments">00! 01 02 03 04</Keywords> | |
<Keywords name="Numbers, prefix1">.</Keywords> | |
<Keywords name="Numbers, prefix2"></Keywords> |
build.yml
inside .github/workflows
path inside your repository. Edit it as required. You may check the validity of the yaml file online.README.md
, put the following badge:[![CI Build Status](https://github.com/<OWNER>/<REPO>/actions/workflows/build.yml/badge.svg)](https://github.com/<OWNER>/<REPO>/actions/workflows/build.yml)
https://github.com///actions/workflows/build.yml