Short instructional Fortran codes associated with Twitter @FortranTip . Search tips and run codes at FortranTipBrowser.
Index of Tweets, Most Recent First, with Associated Code. A List by Topic is here.
Fortran features in GCC 14 8:59 AM · May 17, 2024 linking to Fortran Discourse
Table of banded linear solvers in Fortran 6:13 AM · May 18, 2024
linking to Fortran Discourse
Fortran ranked 10th on TIOBE 7:04 AM · May 6, 2024
Repost: How to use LFortran to compile Fortran codes to WebAssembly via LLVM and host on static web pages 4:21 PM · May 2, 2024 linking to blog post
Proceedings of past Cray User Group conferences are available 7:05 AM · Apr 23, 2024 for example here
Intel Fortran 2024.1.0 6 is released 7:50 PM · Apr 18, 2024 linking to release notes
Fortran projects of gha3mi 8:57 AM · Apr 16, 2024 on GitHub
Fortran Standard Library v0.5.0 is released 8:11 AM · Apr 12, 2024 linking to Fortran Discourse
Fortran for Scientific Computing course at HLRS 7:38 PM · Apr 11, 2024 -- course site
Intermediate Modern Fortran course by Kevin Stratford 9:29 PM · Apr 9, 2024 -- GitHub
New paper "Scheduling and Performance of Asynchronous Tasks in Fortran 2018 with FEATS" 8:04 PM · Apr 1, 2024 -- GitHub
Is Fortran Memory-Safe? 11:26 AM · Mar 29, 2024 -- Fortran Discourse
For REAL x and COMPLEX z, x = z%re is clearer than x = z 7:16 AM · Mar 23, 2024
Production code should not use parameterized derived types 7:13 PM · Mar 21, 2024 -- Fortran Discourse
Fortran literal constant cannot have a minus sign 8:44 PM · Mar 14, 2024
By creating a namelist string from GET_COMMAND() you can parse command line arguments 6:40 AM · Mar 4, 2024 -- GitHub
Namelists blog post by Antoine Dauptain 7:11 AM · Mar 3, 2024
Installing gfortran on Windows 6:44 AM · Mar 2, 2024
Overloading of asterisk (*) -- post by John Harper 8:57 AM · Mar 1, 2024
Special meaning of asterisk (*) in DATA, READ, and NAMELIST 3:24 AM · Feb 29, 2024
Variables set in a DATA statement have the SAVE attribute 6:44 AM · Feb 28, 2024
DATA statement should be placed just after declarations 10:00 PM · Feb 26, 2024
New preprint "Accelerating Fortran Codes: A Method for Integrating Coarray Fortran with Cuda Fortran and Openmp" 4:57 PM · Feb 25, 2024
CHARACTER (len=*) and * in declarations of named constant arrays 5:58 PM · Feb 23, 2024
Use unformatted stream I/O to quickly and exactly store data. 7:02 AM · Jan 12, 2024 unformatted_stream.f90
Declare and set quadruple precision variables in a standard-conforming way by setting a KIND 6:52 AM · Dec 25, 2023 quad.f90
Fortran 2023 Standard and Interpretation Document 8:32 AM · Dec 24, 2023
Access comp.lang.fortran and other Usenet groups with Nemoweb 11:40 AM · Dec 23, 2023
Fortls is a language server for Fortran that interfaces with a code editor 8:11 AM · Dec 22, 2023
Link to talk on Using the HPE Cray Programming Environment to Port and Optimize (Fortran) Applications to a GPU environment 6:53 AM · Dec 20, 2023
Physical constants are available from the NIST codata project 7:24 AM · Dec 19, 2023
Fast_math is a library of functions for summation, trig, log, and sqrt that is faster and more accurate than the compiler intrinsics on some platforms. 8:14 AM · Dec 18, 2023
Feq-parse allows you to define functions as character strings and evaluate them on-the-fly. 7:51 AM · Dec 17, 2023
Fortran-shlex ports the Python’s shlex shell-like lexer. 6:17 AM · Dec 16, 2023
Brad Richardson's videos on Fortran 2023 and other topics 9:10 AM · Dec 15, 2023
Fortran is ranked 12th in the December Tiobe programming language index 6:50 AM · Dec 12, 2023
Test-drive from @fortranlang and other unit testing frameworks 6:17 AM · Dec 11, 2023
Fortran testing "unframework" 6:14 AM · Dec 11, 2023
Ifx is now the flagship Intel Fortran compiler, replacing ifort. 6:39 AM · Dec 10, 2023
PlusFORT 8, a suite of tools for analyzing and improving Fortran programs, is free for noncommercial use 6:47 AM · Dec 9, 2023
Modern Fortran Explained: Incorporating Fortran 2023 published 11:11 AM · Dec 8, 2023
Use the optional KIND argument of SIZE, MINLOC, FINDLOC etc. for large arrays. 10:21 AM · Jun 7, 2022 size_test.f90
With sequence association, the shapes of the actual and dummy arguments need not match. 12:42 PM · Jun 1, 2022 print_mat.f90
Sequence association effectively lets you pass a pointer to an array element. 8:58 AM · May 31, 2022
Wrap a procedure with explicit shape array arguments in a procedure with an assumed shape arguments for safety. 8:56 AM · May 31, 2022 wrap_explicit_shape.f90
Special meanings of * and / in list-directed input 8:50 AM · May 26, 2022 list_directed_read.f90
Ways of declaring character variables 6:43 AM · May 25, 2022
List of books with Fortran code other than Fortran textbooks. 6:47 AM · May 22, 2022
C can call Fortran procedures with prototypes generated by gfortran -fc-prototypes. 7:58 AM · May 21, 2022 call_print_stats.c print_stats.f90
An omitted Fortran optional argument corresponds to a NULL argument of a C function. 8:47 AM · May 20, 2022 xstrtof.f90
Use c_funloc() to pass a Fortran function as an argument to a C function. 7:29 AM · May 19, 2022 c_func_ptr.f90 cfuncptr.c
Use valgrind to find memory leaks in programs that use pointers. 7:09 AM · May 18, 2022 leak.f90
Use TYPE(C_PTR) and C_F_POINTER to call a C function returning a pointer. 10:49 AM · May 17, 2022 c_f_pointer.f90 squares.c
An allocated allocatable array can be passed to C as an explicit-shape array. 8:33 AM · May 16, 2022 xscale.f90 scale_vec.c
Common block and module variables with bind(c) can be accessed from C. 8:35 AM · May 15, 2022 xcircle.f90 circle.c
Fortran array x(n1,n2) passed to C array x[n2][n1] 9:50 AM · May 14, 2022 xcol_sum.f90 sum_rows.c
Use the std::span container from C++ 20 to view a contiguous Fortran array with a STL-compatible interface. 8:36 AM · May 12, 2022 test_sort.f90 sort.cpp
C++ functions can be called from Fortran if they are declared extern "C" and have C-like arguments. 9:09 AM · May 8, 2022 xnormal.f90 normal_array.cpp
The Fortran name can differ from the C name of a function if the NAME attribute appears in BIND. 7:53 AM · May 7, 2022 printf.f90
A simple derived type with the BIND(C) attribute interoperates with a C struct. 8:26 AM · May 6, 2022
Non-pointer arguments of C functions should have the VALUE attribute in the Fortran interface. 9:36 AM · May 5, 2022 xsum_vec.f90 sum_vec.c
C library functions can be called if an INTERFACE is provided. 2:35 PM · May 4, 2022 atoi_vs_read.f90
Fortran 2003 standardized the interoperation of Fortran and C. 9:06 AM · May 3, 2022
Use compiler options to catch the use of uninitialized variables. 8:15 AM · May 2, 2022
B, O, Z edit descriptors can be used to print integers as binary, octal, or hexadecimal. 8:44 AM · May 1, 2022 boz.f90
Use IANY instead of nested IOR, IALL instead of nested IAND. 11:21 PM · Apr 29, 2022 iany.f90
When is the -ffast-math option safe? 7:14 AM · Apr 29, 2022
Use ifort -fast or gfortran -O3 -march=native for speed. 7:09 AM · Apr 28, 2022
Compilers may accept extensions by default but have options to flag non-standard code. 8:00 AM · Apr 26, 2022
Compiler Explorer shows the assembly code generated by many Fortran compilers. 7:28 AM · Apr 25, 2022
Fortran-lang has a section on Building Programs, and F18 has a compiler options comparison. 9:28 AM · Apr 23, 2022
Fortran Package Manger simplifies building programs. 7:18 AM · Apr 22, 2022
Compilation can fail if there is no main program or if a USEd module has not been compiled. 7:42 AM · Apr 21, 2022
Create an executable in one step by compiling all source files or by compiling source files with -c and linking the object files. 7:40 AM · Apr 21, 2022
NOT, IAND, IOR, and IEOR perform logical operations on the bit representations of integers. 8:05 AM · Apr 20, 2022 bit_func.f90
TRANSFER can be used to store one type in another type. 8:12 AM · Apr 19, 2022 transfer.f90
Use PACK to select records from an array of derived types. 8:01 AM · Apr 18, 2022 query.f90
Fortran codes are listed by topic at the fortran-lang package index and Fortran Code on GitHub 7:41 AM · Apr 17, 2022
Implied do loop can access arbitrary derived type array sections. 8:10 AM · Apr 16, 2022 derived_type_implied_do.f90
Derived type array sections are allowed before or after the % component selector, but not in both places. 8:12 AM · Apr 15, 2022 derived_type_section.f90
Serialize a derived type using unformatted stream I/O. 8:51 AM · Apr 14, 2022 dt_stream.f90
PDT can have fixed parameters at compile time or be ALLOCATABLE. 8:34 AM · Apr 13, 2022
PDT can have array dimension, KIND, and character LEN parameters. 8:33 AM · Apr 13, 2022 pdt_matrix.f90
Links to tutorials on parameterized derived types (PDT). 8:55 AM · Apr 12, 2022
Deallocating a derived type deallocates its allocatable components. 8:57 AM · Apr 11, 2022 alloc_dt.f90
MOVE_ALLOC may be faster than RESHAPE or allocation on asignment to resize an array. 8:04 AM · Apr 10, 2022 move_alloc_bench.f90
Use MOVE_ALLOC to resize an array. 7:08 AM · Apr 10, 2022 move_alloc.f90
If unsure, test whether a variable is ALLOCATED before using DEALLOCATE. 7:41 AM · Apr 9, 2022
ALLOCATE has an optional ERRMSG specifier. 7:40 AM · Apr 8, 2022 alloc_errmsg.f90
ASSOCIATE to an array-valued expression allocates an array. 6:51 AM · Apr 7, 2022
ALLOCATE with SOURCE or MOLD to set values or SHAPE. 6:44 AM · Apr 7, 2022 alloc_source_mold.f90
Place IMPLICIT NONE before CONTAINS in a module. 8:32 AM · Apr 6, 2022
Scratch files are unnamed temporary files for I/O. 8:22 AM · Apr 5, 2022 scratch.f90
Read a file into a string with unformatted stream. 7:20 AM · Apr 4, 2022 file_to_string.f90
Because recursive I/O is prohibited, a function should use ERROR STOP msg instead of PRINT statements for error messages. 7:49 AM · Apr 3, 2022 recursive_io.f90
Use an implied do loop with a dummy variable to skip fields when reading a file. 7:09 AM · Apr 2, 2022 skip_columns.f90
List-directed READ will use several lines if necessary. 7:40 AM · Apr 1, 2022 list_directed.f90
MOOC on "Defensive programming and debugging" 11:46 AM · Mar 31, 2022
Use the "(a)" format to read a line of a file into a string. 7:31 AM · Mar 31, 2022 read_line.f90
Error in READ statement causes all variables to become undefined. 8:22 AM · Mar 30, 2022 read_err.f90
Use an implied do loop with TRIM to print an array of character variables without trailing blanks. 7:36 AM · Mar 29, 2022 trim_loop.f90
print*,char(7) causes the program to beep. 7:12 AM · Mar 28, 2022
DO WHILE loop iterates as long as condition at beginning is met. 7:18 AM · Mar 27, 2022 do_while.f90
Invalid loop bounds were discussed at Fortran Discourse. 7:00 AM · Mar 26, 2022
Beware of a loop to huge(i), since huge(i)+1 is out of range. 6:44 AM · Mar 26, 2022 huge_loop.f90
Number of iterations in a loop is determined at the beginning. 7:47 AM · Mar 25, 2022 loop_bound.f90
Changing a loop index within a loop is invalid. 8:48 AM · Mar 24, 2022 loop_index.f90
CYCLE skips the remaining statements in a loop. 8:06 AM · Mar 23, 2022 cycle.f90
EXIT can be used to leave a named outer loop. 7:44 AM · Mar 22, 2022 loop_label.f90
Use REWIND and BACKSPACE to change file position. 8:02 AM · Mar 21, 2022 rewind.f90
Slash / terminates a record. 10:43 AM · Mar 20, 2022 slash.f90
Stream input/output article by Clive Page 8:03 AM · Mar 19, 2022
Specific array elements can read or written to unformatted stream file by specifying the POS. 7:53 AM · Mar 19, 2022 stream_pos_dt.f90
DIRECT access file allows access to arbitrary record without looping over the previous records. 8:14 AM · Mar 18, 2022 direct_access.f90
How to append to a file or delete it 7:41 AM · Mar 17, 2022 write_append.f90
Use INQUIRE to get unit and file properties. 8:09 AM · Mar 16, 2022 inquire.f90
Use NEWUNIT in OPEN to get an unused unit number. 7:51 AM · Mar 15, 2022 newunit.f90
Number of files open simultaneously is limited, so they should be closed when possible. 7:58 AM · Mar 14, 2022 open_units_limit.f90
Write to many files by creating file names with internal write. 10:28 AM · Mar 13, 2022 write_many_files.f90
Unit n is connected to fort.n by default for most compilers. 7:40 AM · Mar 12, 2022 implicitly_connected.f90
Connect INPUT_UNIT and OUTPUT_UNIT to files to redirect standard input and output. 8:39 AM · Mar 11, 2022 output_unit.f90
Use ALLOCATABLE arrays or ASSOCIATE instead of POINTER when possible. 7:33 AM · Mar 10, 2022
Pointer should be initialized to null() to avoid undefined association status. 8:16 AM · Mar 9, 2022 pointer_use.f90
Pointer can remap array shape and bounds. 7:14 AM · Mar 8, 2022 pointer_reshape.f90
Bounds of associate-name for whole array or array section selector 7:38 AM · Mar 7, 2022 associate_bounds.f90
Tips by topic 9:03 AM · Mar 6, 2022
A variable ASSOCIATEd to an ALLOCATABLE variable is not ALLOCATABLE. 7:30 AM · Mar 6, 2022 associate_alloc.f90
ASSOCIATE statement can set several independent variables. 7:33 AM · Mar 5, 2022 associate_many.f90
ASSOCIATE is preferred over POINTER to create an alias because POINTER can inhibit optimization. 7:16 AM · Mar 4, 2022 associate_vs_pointer.f90
Pointer assignment and ASSOCIATE can create shallow copies. 7:59 AM · Mar 3, 2022 copy.f90
Internal procedures have access to variables from the host unless they are overridden by local variables. 8:29 AM · Mar 2, 2022 scope.f90
BLOCK construct allows declarations after executable statements. 8:08 AM · Mar 1, 2022 block.f90
Five free C C++ Fortran compiler families 8:38 AM · Feb 28, 2022
Errors in a procedure can be handled with an optional argument. 6:53 AM · Feb 27, 2022 optional_err.f90
Check that assumed-shape array arguments have consistent dimensions. 8:21 AM · Feb 26, 2022 error_handling.f90
ERROR STOP vs. STOP. 7:07 AM · Feb 25, 2022 error_stop.f90
Assumed type arguments have no declared type. 7:34 AM · Feb 24, 2022 assumed_type.f90
Unlimited polymorphic pointer can point to any type. 8:03 AM · Feb 23, 2022 unlimited_pointer.f90
Unlimited polymorphic allocatable variable can be set to any type. 7:36 AM · Feb 23, 2022 unlimited_poly.f90
Fortran 2018 procedures can have assumed-rank arguments. 7:59 AM · Feb 22, 2022 assumed_rank.f90
storage_size(A) returns the storage size of argument A in bits. 7:33 AM · Feb 21, 2022 storage_size.f90
A derived type can have PRIVATE components. 7:21 AM · Feb 20, 2022 dt_private.f90
A derived type component can have a default value. 6:44 AM · Feb 19, 2022 type_constructor_optional.f90
A derived type can have derived type components. 7:32 AM · Feb 18, 2022 derived_type_composition.f90
A derived type can be used where a scalar is needed. 7:59 AM · Feb 17, 2022 elemental_func_arg.f90
Modern Fortran Reference Card and Quick Reference/Cheat Sheet. 7:09 AM · Feb 16, 2022
Bounds of an allocatable array are preserved when passed to an allocatable, intent(in) or intent(in out) argument. 7:56 AM · Feb 15, 2022 allocatable_bounds.f90
Bounds of a derived type array component are preserved when passed to procedure. 8:24 AM · Feb 14, 2022 lbound_assumed_shape.f90
Array lower bounds are not preserved when passed as assumed shape argument. 7:55 AM · Feb 14, 2022 lbound_assumed_shape.f90
How to reverse an array or character string 7:52 AM · Feb 13, 2022 reverse.f90
Character variables can be compared like numerical variables. 8:23 AM · Feb 12, 2022 compare_character.f90
Internal write to character variable too small to hold output causes run-time error. 7:34 AM · Feb 11, 2022 write_char.f90
Convert from strings to numbers and the reverse using internal READ and WRITE. 7:43 AM · Feb 10, 2022 internal_read_write.f90
spread(source, dim, ncopies) copies a SOURCE array NCOPIES times along dimension DIM. 6:55 AM · Feb 9, 2022 spread.f90
Concatenate arrays and scalars in an array constructor [] 7:11 AM · Feb 8, 2022 concatenate.f90
get_command() and get_command_argument() get command line arguments. 7:38 AM · Feb 7, 2022 get_command.f90
Demonstrate subroutine get_environment_variable(name,value) of Fortran 2003. 9:21 AM · Feb 6, 2022 get_env.f90
Document results with compiler_version(), compiler_options(), and other intrinsics. 8:23 AM · Feb 5, 2022 xpi.f90
Execute_command_line() can call gnuplot to display a plot during a run. 7:44 AM · Feb 4, 2022
Execute_command_line() to pass a command to the shell. 7:23 AM · Feb 3, 2022 execute.f90
Mistakes in Fortran 90 Programs That Might Surprise You, by Szymanski 7:00 AM · Feb 2, 2022
Setting the values of an array section 7:41 AM · Feb 1, 2022 truloc.f90
Vector subscript can be used for non-contiguous array sections. 7:51 AM · Jan 31, 2022 vector_subscript.f90
Polyhedron suggested compiler optimization options and Fortran 95 benchmarks 9:13 AM · Jan 30, 2022
Google foo filetype:f90 or foo filetype:f to find Fortran code with foo. 5:43 PM · Jan 29, 2022
A procedure can have an argument that is another PROCEDURE with an INTERFACE. 8:02 AM · Jan 29, 2022 trapezoid.f90
Call ieee_set_halting_mode() to set floating point conditions that halt program. 10:26 AM · Jan 28, 2022 ieee_exceptions.f90
IEEE_ARITHMETIC module has functions to test numerical conditions. 9:22 AM · Jan 27, 2022 ieee_arithmetic.f90
Dummy argument that is changed must be definable in the caller. 7:20 AM · Jan 26, 2022 definable_arg.f90
ALLOCATABLE INTENT(OUT) argument is deallocated. 7:47 AM · Jan 25, 2022 intent_out_allocatable.f90
An INTENT(OUT) argument is undefined at the beginning of a procedure 7:45 AM · Jan 24, 2022 intent_out_undefined.f90
Turn compiler warnings into errors to force code defects to be fixed. 7:58 AM · Jan 23, 2022 warnings.f90
VALUE attribute for procedure arguments introduced in Fortran 2003 8:05 AM · Jan 22, 2022 value.f90
Use INTRINSIC to specify that compiler-provided procedures and modules are referenced 8:23 AM · Jan 21, 2022 intrinsic.f90
PROTECTED module variables cannot be changed outside the module. 7:12 AM · Jan 20, 2022 protected.f90
Array constructor with [] was introduced in Fortran 2003. Still valid is (//) 7:09 AM · Jan 19, 2022
Impure elemental procedure can be used to generate array of non-uniform variates 8:26 AM · Jan 18, 2022 random_normal.f90
Fortran 2008 introduced IMPURE ELEMENTAL procedures 8:07 AM · Jan 17, 2022 impure_elemental.f90
List of Fortran compilers, build tools, text editors, etc. 8:42 AM · Jan 16, 2022 list
Use iostat and iomsg to handle READ errors 7:14 AM · Jan 16, 2022 iomsg.f90 ; data_file
An unqualified USE foo statement imports public entities defined in foo and what foo imported. 7:29 AM · Jan 15, 2022 imports.f90
Module entities are PUBLIC by default. 7:45 AM · Jan 14, 2022 private.f90
How to rename an imported module entity 7:01 AM · Jan 13, 2022 rename.f90
Use the same name for analogous procedures defined in different modules using an INTERFACE 7:52 AM · Jan 12, 2022 shared_interface.f90
Procedures can be called with a mix of named and positional arguments. 8:26 AM · Jan 11, 2022 arguments.f90
UnALLOCATED variable passed to a procedure is not PRESENT there. 11:59 AM · Jan 10, 2022
DIMENSION can be used to declare several arrays of the same SHAPE 8:00 AM · Jan 9, 2022 dimension.f90
Propagation of an optional argument 8:23 AM · Jan 8, 2022 optional_use.f90
Two types of syntax for defining a function 9:28 PM · Jan 7, 2022 function.f90 function.txt
Syntax for character array without manual padding 11:19 AM · Jan 7, 2022 character_array.f90
Intrinsic character functions 4:58 AM · Jan 7, 2022 string_func.f90
Substrings of character variable arrays 11:31 AM · Jan 6, 2022 substring.f90
Parenthesize a variable to copy it "on the fly". 7:44 AM · Jan 6, 2022 overlapping_arg.f90
Use integer powers when possible. 11:28 AM · Jan 5, 2022 pow_real.f90
Use d0 or _kind to make a constant double precision. 8:02 AM · Jan 5, 2022 precision.f90
KIND numbers of types are not portable across compilers and should not be used directly. 7:39 PM · Jan 4, 2022
Avoid implicit save 8:50 AM · Jan 4, 2022 implicit_save.f90 run
Use parameters to dimension fixed-size arrays to make a code easier to change 6:45 AM · Jan 4, 2022
Fortran 2008 introduced z%re and z%im as alternatives to real(z) and aimag(z) 7:24 PM · Jan 3, 2022 im_re.f90
KindFinder code finds all KIND Values implemented by a compiler 10:47 AM · Jan 3, 2022 kindfind.f90
Real and integer KIND constants from iso_fortran_env; HUGE() and TINY() 7:51 AM · Jan 3, 2022 iso_kinds.f90
Advance="no" specifier of WRITE 6:47 PM · Jan 2, 2022 advance_no.f90
Len of character variable function result can depend on arguments 8:27 AM · Jan 2, 2022 join.f90
How size of an array function result can depend on function arguments 6:42 AM · Jan 2, 2022 array_func.f90
List of the syntax and purpose of Fortran intrinsics, with usage examples 11:46 AM · Jan 1, 2022
Do case-insensitive string comparisons by converting to lower case 9:00 AM · Jan 1, 2022 lower_case.f90
Fortran-lang suggested variable naming conventions 9:16 AM · Jan 1, 2022
Case insensitivity 10:49 AM · Jan 1, 2022 case_insensitivity.f90
Returning multiple values from a subroutine or function 8:20 PM · Dec 30, 2021 subroutine_dt.f90
MODULO vs. MOD function 7:13 AM · Dec 30, 2021
Compiler Support for the Fortran 2008 and 2018 Standards 1:59 PM · Dec 29, 2021
Many compilers evaluate ALL(x==y) efficiently with short-circuiting 12:16 PM · Dec 29, 2021
LEN of a character variable may be deferred in Fortran 2003 on 8:41 AM · Dec 29, 2021 deferred_character.f90
To learn about Fortran beyond F95, read the New Features articles of John Reid 5:18 AM · Dec 29, 2021
Use .true. and .false. for Booleans, not 1 and 0 1:04 PM · Dec 28, 2021
Standards committee has approved conditional expressions 8:47 AM · Dec 28, 2021
ANY and ALL may not be the most efficient methods to compare arrays. 8:02 AM · Dec 28, 2021
Consider using a tolerance to compare floats 7:51 AM · Dec 28, 2021 compare_floats.f90
Use ALL(A==B) to test for array equality 7:33 AM · Dec 28, 2021 all_any.f90
Intel Fortran Compiler (ifx) 9:52 AM · Dec 27, 2021
Doubled delimiter in a string is regarded as a single character of the constant 7:07 AM · Dec 27, 2021 doubled_delim.f90
Store data as an array of derived types or a derived type with array components? 9:55 AM · Dec 26, 2021 derived_type_array.f90
Fortran is column-major 4:22 AM · Dec 26, 2021 column_major.f90
CMPLX should be used with a KIND argument 6:30 PM · Dec 24, 2021 cmplx.f90
RESHAPE with the optional ORDER and PAD arguments 9:00 AM · Dec 24, 2021 reshape_array.f90
Use GAMMA to compute factorials 6:35 AM · Dec 24, 2021 factorial.f90
Derived type definition, initialization, and operator overloading 6:04 PM · Dec 23, 2021 date.f90
List-directed vs. explicitly formatted output 1:52 PM · Dec 23, 2021
Fortran equivalents of NumPy 4:08 AM · Dec 23, 2021
Zero-size array constructor such as [real ::] 8:51 PM · Dec 22, 2021 zero_size.f90
Use G0.d and colon edit descriptors with infinite repeat count to write delimited (CSV, etc.) output 9:44 AM · Dec 22, 2021
If allocation errors must be handled, use ALLOCATABLE rather than automatic arrays in procedures 6:48 AM · Dec 22, 2021 automatic.f90
Name modules and the source files containing them consistently, with one module per file. 11:13 AM · Dec 21, 2021
Use unformatted stream of Fortran 2003 for large-scale I/O. 5:59 AM · Dec 21, 2021 stream_io.f90
Using READ and WRITE for file i/o 12:38 PM · Dec 20, 2021 read_write_file.f90
Reading user input 8:47 AM · Dec 20, 2021 read_sum.f90
SELECT CASE for conditional execution 8:02 AM · Dec 20, 2021 select_case.f90
Declare floating point variables with KINDs 9:32 PM · Dec 19, 2021 kind.f90
Replace non-standard REAL*8 declaration with REAL(KIND=REAL64) 9:35 PM · Dec 19, 2021
Use PARAMETERs in modules to define physical and mathematical constants 6:00 PM · Dec 19, 2021 module_parameter.f90
Procedures can be RECURSIVE 4:56 PM · Dec 19, 2021
Specify function and subroutine argument INTENTs 4:39 PM · Dec 19, 2021
Subroutines can have INTENT(IN OUT) arguments, but functions should not 4:34 PM · Dec 19, 2021 intent_in_out.f90
Define and call a subroutine 4:16 PM · Dec 19, 2021 subroutine.f90
Demonstrate optional arguments and RANDOM_NUMBER 3:44 PM · Dec 19, 2021 optional.f90
Function overloading using an interface with module procedures 12:05 PM · Dec 19, 2021 interface.f90
USE, ONLY to avoid polluting the namespace 11:04 AM · Dec 19, 2021
Put functions and subroutines in modules to ensure that interfaces are checked. 10:50 AM · Dec 19, 2021 module.f90
ELEMENTAL functions broadcast arguments 10:37 AM · Dec 19, 2021 elemental.f90
Functions should be PURE and have INTENT(IN) arguments 10:25 AM · Dec 19, 2021 func.f90
PACK selects elements 10:13 AM · Dec 19, 2021 count_pack.f90
Loop variable equals the upper bound plus the stride after normal completion of a loop 10:04 AM · Dec 19, 2021 do_loop_index.f90
Associate creates an alias for expressions or variables. 7:52 AM · Dec 19, 2021 assoc.f90
In addition to if-elseif, Fortran has a one-line if 6:36 PM · Dec 18, 2021 one_line_if.f90
Character variables are padded with spaces at the end if necessary. 8:18 AM · Dec 18, 2021
An array of character variables has elements of the same LEN(gth). 8:10 AM · Dec 18, 2021 char.f90
MERGE(x,y,condition) returns x if condition is true, otherwise y 8:01 AM · Dec 18, 2021 merge.f90
IF-ELSEIF-ENDIF block 7:50 AM · Dec 18, 2021 if.f90
New Fortran code should be written using free source form and stored in a file with the .f90 suffix. 6:36 AM · Dec 18, 2021
Fortran has allocation on assignment. 6:26 AM · Dec 18, 2021 alloc.f90
SUM and other array functions have an optional DIM(ension) argument. 7:40 PM · Dec 17, 2021 2d_array.f90
Fortran arrays can have any lower bound. The default is 1. 6:16 PM · Dec 17, 2021 bounds.f90
Fortran array sections contain both endpoints 6:01 PM · Dec 17, 2021 sections.f90
Array intrinsic functions: SUM, MINVAL, MAXVAL, MINLOC, FINDLOC 5:44 PM · Dec 17, 2021 array_intrinsics.f90
Integer division truncates. 2:14 PM · Dec 17, 2021
** is the exponentiation operator. 12:03 PM · Dec 17, 2021 power.f90
Fortran compilers and tutorials 11:37 AM · Dec 17, 2021
EXIT a loop 11:30 AM · Dec 17, 2021 sum_exit.f90
DO-ENDDO loop 11:14 AM · Dec 17, 2021 loop.f90
Intrinsic data types: integer, real, complex, logical, and character 11:09 AM · Dec 17, 2021
Hello World 10:58 AM · Dec 17, 2021 hello_world.f90