This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SHELL = /bin/sh | |
CXX = g++ | |
FFLAGS = -g | |
TARGET = my_executable | |
OBJDIR = obj | |
SRCDIR = src | |
BINDIR = bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SHELL = /bin/sh | |
# FORTRAN compiler | |
FC = mpif90 | |
# Check if we're using ifort or something else | |
COMPILER = $(shell $(FC) -show | cut -d' ' -f1) | |
FFLAGS = -Wall |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
! split a string into 2 either side of a delimiter token | |
SUBROUTINE split_string(instring, string1, string2, delim) | |
CHARACTER(30) :: instring,delim | |
CHARACTER(30),INTENT(OUT):: string1,string2 | |
INTEGER :: index | |
instring = TRIM(instring) | |
index = SCAN(instring,delim) | |
string1 = instring(1:index-1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
! Daniel Fletcher 2012 | |
! module for increasing array sizes dynamically | |
! currently new indices must be larger than old | |
! TODO : extend to handle array size reduction | |
MODULE reallocate | |
IMPLICIT NONE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PROGRAM test1 | |
IMPLICIT NONE | |
INTEGER, DIMENSION(:,:), ALLOCATABLE :: a | |
INTEGER :: i,j,ni,nj | |
ni = 4 | |
nj = 4 |