Potential errors can come up when using allocatable arrays when returned in functions. Given the example found below, an error is created on purpose to demonstrate the compiled cannot detect it. Output: [mypc]$ gfortran allocarr.f90 && ./a.outvalues= -1 25 25 0 -1 -1 Bear in mind, potential errors could come from allocatable output arrays. Valgrind…
read moreFortran namelist is a I/O method introduced in Fortran 77. It later became a standard in Fortran 90. It basically allows to read/write data as a dictionary like in plain text files. In order to read a REAL array, see the example below: Input param.nml: ¶m nrows=3, ncol=2, data_file=”hello.txt”, values=1.1, 2.2, 3.3, 4.4/ Output: mymachine:~/tests/namelist_arrays$…
read more