Never assume that eager or short-circuit evaluation of logical statements will occur in Fortran.
Fortran standards from Fortran I (1957) through Fortran 2018 do not mandate or prohibit
short-circuit logic.
That has resulted in some compilers (e.g. Gfortran) sometimes using short-circuit logic, while other compilers (e.g. Intel) do not use short circuit logic.
This causes breakage when the programmer tests with one Fortran compiler handles compound logic with eager evaluation, but other compiler uses short-circuit evaluation.
Compilers not short-circuiting (standard Fortran behavior):
Gfortran -O0
NAG
Intel
Short circuiting (non-standard behavior)
Gfortran -O1 or higher
Proper handling of compound logic in Fortran: one should carefully avoid assumptions that either eager or short-circuit evaluation of compound logical statements will occur, because neither is guaranteed by any Fortran standard.
Assuming eager evaluation of Fortran logical statements, this can cause breakage where a function that’s part of the statement has side effects.
For example, a function that modifies a module variable, or simply an intent(inout) variable will find those variables unmodified if a compiler uses short-circuit logic.
Fix: break up the compound if statement so that the function is always evaluated (e.g. just before the if statement).
Assumptions that short circuit evaluation occurs commonly causes breakage of present(arg) for optional :: arg optional dummy arguments.
subroutinemyfun(a,b)real,intent(inout)::areal,intent(in),optional::b! don't do this!
if(present(b).and.b<0)a=b*a! instead, do this:
ifpresent(b)thenif(b<0)a=b*aendif
OpenMPI is often available from package managers across computing platforms.
Users might build OpenMPI from source to get the latest version or to support other compilers.
OpenMPI takes several minutes to build.
The October 2018 day-long GitHub outage led many to consider having a live backup of their Git repos.
Multi-remote git push is intrinsic to Git itself.
Thus, automatic multi-site pushes are easy to configure for an arbitrarily large number of backup sites (GitHub, GitLab, Bitbucket, Dropbox, …).
This article covers the typical case where the main Git repository is on GitHub, but a public backup is desired on GitLab or similar site.
The article assumes an existing working GitHub repo cloned to the computer username/myprog.
We also assume SSH keys on both
GitHub
and
GitLab.
Use different SSH key pairs for each site for best security.
Back up the GitHub repo username/myprog to GitLab with every git push automatically as in the following section.
GitLab currently does not have a direct means to fork the same repo multiple times.
Users may wish to fork a repo multiple times to develop separate features and merge request each feature separately.
Multiple GitLab repo forks are possible by pasting a simple URL into the web browser as follows:
For main repo at https://gitlab.com/otherusername/repo:
create a New Group with arbitrary name
create a fork into this new group by visiting https://gitlab.com/otherusername/repo/forks/new.
rename this fork, setting the repo URL to be distinct from the original repo name–perhaps repo_feature1.
create an unlimited number of forks of the original repo by repeating steps 1, 2 and 3 for each fork.
For user GitLab installations (such as https://gitlab.kitware.com) this workaround requires creating a group.
One might have to do things manually in such a situation (and ask GitLab to make this simple and very necessary feature addition).
Fortran polymorphism and generic programming (sets, lists, generators) are consistently the highest
ranked survey feature requests
for the next Fortran standard.
Fortran programmers introduce polymorphic procedures and variables into modern Fortran by the following methods.
C preprocessor #ifdef etc. is simplest, and is widely supported and used.
C preprocessor is invoked by convention when the source file suffix is capitalized like .F90.
Build systems like CMake and Meson introspect Fortran source code, and so it’s important to use uppercase filename suffix if a Fortran source file needs preprocessing.
Fortran derived types with duplicated procedures for every desired type/kind.
This is more verbose to use, but it is the most powerful and flexible true Fortran polymorphism.
The preprocessor method might be thought of as compile-time polymorphism.
It’s not a perfect solution, and not true polymorphism since each procedure still requires exactly one type/kind per argument.
However, this technique combined with static polymorphism is simple to develop and handles many real-life use cases quickly and easily.
Example: compile-time Fortran polymorphic REAL
For each REAL variable and function, make kind=wp. For example polyreal.F90 (notice the capital F90):
Make a command-line options -Drealbits=64 or -Drealbits=32 etc. in CMakeLists.txt:
project(realpolyFortran)if(NOTrealbits)set(realbits64)endif()# your modules and programs
add_executable(polypolyreal.f90)target_compile_definitions(polyPRIVATEREALBITS=${realbits})
We typically have a comm.f90 that contains various constants including wp used throughout a program.
Generate then build as usual:
cmake -Drealbits=64 -B build
pi 3.1415926535897931 2pi 6.2831853071795862
That uses double-precision real64 variables and functions. The concept is trivially extensible to large programs consisting of many files and modules.
To then select a different kind and rerun, perhaps to evaluate accuracy vs. runtime tradeoffs (real32 is generally faster than real64, but less accurate):
cmake -Drealbits=32 -B build
pi 3.14159274 2pi 6.28318548
or for quad-precision Fortran real128:
cmake -Drealbits=128 -B build
pi 3.14159265358979323846264338327950280 2pi 6.28318530717958647692528676655900559
At the time of this writing, Python 3.4 is the newest version that can be used with ReactOS, since newer Python version require sufficient Windows NT ≥ 6.0, and ReactOS 0.4.x is NT 5.2 (Windows 2003 / XP).
Specifically, Miniconda didn’t yet work when tried with the 32-bit installer.
Python 3.4 is installed via ReactOS Application Manager, accessible from Start → Programs.