287 Commits

Author SHA1 Message Date
947ed1ad78 PARAMETERS: Use Fortran 2003 command line subroutines.
Fortran 2003 introduces procedures to get the number of command line
arguments and the specific argument. Use them instead of iargc() and
getarg() from GNU extension.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2020-07-30 10:23:31 -03:00
31a34c4380 PARAMETERS: Add verbose flag to read_parameters().
Slightly clean up other subroutines.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2020-07-30 10:13:48 -03:00
04169ad0f7 PARAMETERS: Remove subroutine redistribute_parameters().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2020-07-30 10:01:56 -03:00
62e989e0b7 DRIVER: Read parameters' file by all processes.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2020-07-30 10:00:12 -03:00
5c64df35e5 HASH: Remove obsolete specific xxh64_*() functions.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2020-05-13 17:32:04 -03:00
d41ec74665 IO: Use generic xxh64() to calculate all hashes.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2020-05-13 17:31:59 -03:00
467609bc00 HASH: Add generic function xxh64().
This function calculates the XXH64 has using a sequence of bytes, or
integer(kind=1) vector.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2020-05-13 17:31:48 -03:00
3dbbd0b8b1 HASH: Change kind of local variables.
Local variables remain and offset cannot be larger than the size of
input array, so they can be 4-byte integers.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2020-05-13 08:32:27 -03:00
e1e025017a HASH: Rename argument data to input.
Word DATA is reserved in Fortran. Rename this argument, just to avoid
confusion.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2020-05-13 07:05:44 -03:00
86c7f87365 HASH: Fix hash calculation in xxh64_integer() for odd length vectors.
If the input data has an odd number of elements, the last 4-byte
element has to be padded by 4-byte structure of zeros.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2020-05-13 06:57:26 -03:00
97e572ec94 IO: Make sure bounds have the same domensions while stored and read.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2020-05-13 06:49:53 -03:00
ca3580e2ec IO: Fix wrong warning while reading from an XML+binary restart snapshot.
If the forcing is off, the number of forcing modes is zero, but it is
not the same as a wrong number of forcing modes stored in the restart
file.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2020-05-13 06:47:38 -03:00
1c76a5b8ca BLOCKS: Reset fields of allocated datablock to zero.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2020-05-12 06:51:54 -03:00
5fc6b8dbe5 RANDOM: Fix bitwise OR in splitmix64(), xoshiro256p(), and jump().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2020-05-11 18:47:19 -03:00
7c1d028805 IO: Store hashes in write_snapshot_xml().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2020-05-11 18:42:05 -03:00
c2294cbe5e IO: Store hashes with leading zeros in write_restart_snapshot_xml().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2020-05-11 18:29:18 -03:00
5a9ea1dc92 IO: Verify hashes while reading XML+binary restart snapshots.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2020-05-11 18:19:33 -03:00
52d899aa72 IO: Store hashes of binary files in XML+binary restar snapshots.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2020-05-11 15:19:25 -03:00
cf39fa7292 HASH: Add Fortran implementation of 64-bit xxHash function.
The aim of the hash function is to verify consistency of the binary data
written in the snapshots.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2020-05-11 14:00:16 -03:00
c5aa43f8ff FORCING: Correct calculation of the acceleration RMS value.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2020-05-09 19:58:39 -03:00
bd1b4724e8 HELPERS: Increase show precision of real parameters to 5 digits.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2020-05-08 18:39:03 -03:00
638fba8902 USER_PROBLEM: Print parameters.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2020-05-08 18:35:37 -03:00
195d8895b0 FORCING: Rewrite Fourier forcing so both methods use vectors e1 and e2.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2020-05-07 19:28:04 -03:00
09612783a7 Revert "FORCING: Take into account solenoidal parameter in e1 and e2 vectors."
This reverts commit 0303f4ed84c752324bb5c9195dcab1547c0df4b9.
2020-05-03 19:06:48 -03:00
0303f4ed84 FORCING: Take into account solenoidal parameter in e1 and e2 vectors.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2020-05-03 18:20:53 -03:00
15162344f5 FORCING: Driving time and velocity scales are determined from the power.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2020-05-03 17:23:48 -03:00
836b1a873c FORCING: Calculate driving scales from driving power.
The driving power and injection scale determine the characteristic time
velocity and acceleration scales.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2020-05-03 17:20:45 -03:00
f1c30dffec EVOLUTION, FORCING: Call update_forcing() only when enabled.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2020-05-01 21:16:46 -03:00
5c554a2b2d IO: Do not store driving coefficients if nmodes == 0.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2020-05-01 21:06:34 -03:00
add0759308 IO: Handle properly seeds and driving coeffs in HDF5 restart files.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2020-05-01 20:58:27 -03:00
13858e6456 IO: Implement XML+binary format of the regular snapshots.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2020-05-01 11:40:37 -03:00
4550af59d4 IO: Fix mismatch in the XML restart snapshot.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2020-04-30 14:31:01 -03:00
59bc5482ea IO: Fix calling read_snapshot_parameter_h5().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2020-04-30 07:57:34 -03:00
a533978dff DRIVER: read_snapshot_parameter() is supported independently of HDF5.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2020-04-29 17:39:19 -03:00
07e74abfa9 IO: Implement XML+binary format of the restart snapshots.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2020-04-29 17:38:41 -03:00
0631962b4d FORCING: Export the number and coefficients of driving modes.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2020-04-29 17:37:41 -03:00
727c711478 PARAMETERS: Add subroutine to return the parameter file.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2020-04-29 17:36:54 -03:00
7e6332125f RANDOM: Export gentype parameter.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2020-04-29 17:36:20 -03:00
408f42151d IO, DRIVER: Store x/y/zblocks separately.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2020-04-28 14:40:04 -03:00
63013b25be DRIVER: Fix compilation with empty OUTPUT flag.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2020-04-28 14:31:53 -03:00
586df0bfa6 FORCING: Fix generation of vectors e1 and e2 in Alvelius method.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2020-04-28 14:25:15 -03:00
6217358c99 RANDOM: Add status argument to initialize_random().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2020-04-28 14:04:22 -03:00
24d33316ae RANDOM: Change Marsaglia's xorshift to Vigna's xoshiro256+ generator.
Completely rewrite the random generator module. The new method is
true 64-bit floating point generator in contrast to 32-bit Marsaglia's
methods. Add recommended seeds' initialization and jump for parallel
computations. Make function names more meaningful and add new functions
in IO module to store the seeds properly.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2020-04-25 18:37:58 -03:00
7b0b4e5e51 FORCING: Allow to set characteristic velocity in OH driving.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2020-04-23 17:34:53 -03:00
dcdcc303eb FORCING: Fix e2vec NaNs in 2D case, break long lines.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2020-04-23 16:24:48 -03:00
198d0f5796 FORCING: Fix compilation when MPI=N.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2020-04-22 22:08:41 -03:00
b8dd0c5b4f FORCING: Fix compilation when NDIMS = 2.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2020-04-22 22:03:34 -03:00
ddbb42a90f FORCING: Implement driving force by Alvelius.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2020-04-22 21:33:04 -03:00
ae665b24c5 MPITOOLS: Rewrite reduce_sum_complex_array().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2020-04-22 21:31:39 -03:00
ddd8426d0c USER_PROBLEM: Use sound speed and plasma-beta to set fields.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2020-04-20 13:15:22 -03:00