Commit Graph

320 Commits

Author SHA1 Message Date
6181b6096e Fix Makefile to remove literal '\n' printed in .d files in some systems. 2022-10-28 13:32:56 +02:00
3eab989d7b Fix bug in catand (complex arc tangent)
Function catand returned an incorrect value for its real part. To be
possibly replaced with the intrinsic function atan.
2022-10-04 19:05:43 +02:00
8c3e246f25 Add missing iprof parameter initialization in GRAY/JINTRAC interface
Cherry-pick from commit 6627cb14
2022-10-04 18:43:13 +02:00
Michele Guerini Rocco
8f90cb21da
gray_jetto1beam: activate some debug units by defaults 2022-09-27 18:44:32 +02:00
Michele Guerini Rocco
df4930818f
Makefile: add JETTO-specific target 2022-09-27 18:44:32 +02:00
Michele Guerini Rocco
45ef9c5eae
src/coreprofiles: make psnbnd fully automatic
1. Fix the mismatch between the psnbnd in coreprofiles and gray_core.
   This happens whenever gray overrides the externally provided one
   (i.e. the density tail would become negative before psnbnd and is so
   rescaled to end exactly on the zero).

2. Make psnbnd no longer required by always computing it as in 1.
   It hasn't been removed, because gray_params.data is sacrosant,
   but it no longer has any effect.

3. Cleanup: mark public functions, restructure the global variables into
   three categories; add comments explaining the analytical profiles
   format, formulae and how the polynomial tail is computed.
2022-05-22 04:06:21 +02:00
Michele Guerini Rocco
63e2bf0b04
convert remaining subroutines to derived types
- converts analytical profiles/equilibrium subroutines to derived types
- use less undecipherable and consistent names

The subroutine names have changed as follows:

    set_prfspl → set_profiles_spline
    set_prfan  → set_profiles_an
  unset_prfspl → unset_profiles_spline
  unset_prfan  → unset_profiles_an
  set_equian   → set_equil_an
  set_eqspl    → set_equil_spline
  unset_equian → unset_equil_an
  unset_eqspl  → unset_equil_spline
  unset_rhospl → unset_rho_spline
2022-05-22 01:18:08 +02:00
Michele Guerini Rocco
9fcf8e51e8
doc/3.io-files.md: clarify ieccd options 2022-05-22 01:02:19 +02:00
Michele Guerini Rocco
ebbea7cbeb
doc/2.physics.md: fix eq reference 2022-05-22 01:02:19 +02:00
Michele Guerini Rocco
f5ab40f54f
src/gray_core.f90: cleanup
- add some comments
- annotate loops
- indent comments
- remove trailing whitespace
- reduce usage of opaque global variables
- use Fortran 90 logical operators
- use Fortran 2003 array syntax
2022-05-22 01:02:19 +02:00
Michele Guerini Rocco
6010a9361b
add INI configuration file
This adds a new configuration file based on the INI format.
The new format will allow adding GRAY parameters without breaking
compatibility with existing configurations, unlike as of the old
gray_params.data.
2022-05-22 01:02:19 +02:00
Michele Guerini Rocco
0a1a0b5ac8
src/gray_core.f90: use intrinsic linear algebra functions 2022-05-19 19:00:55 +02:00
Michele Guerini Rocco
0cf1ab2e8d
src/dispersion.f90: mark colddisp a pure function 2022-05-19 19:00:54 +02:00
Michele Guerini Rocco
3cee84690c
src/dispersion.f90: mark zetac as pure 2022-05-11 01:15:08 +02:00
Michele Guerini Rocco
c3f8cb1921
default.nix: update to Nixpkgs 21.11 2022-05-11 01:15:08 +02:00
Michele Guerini Rocco
cd6966f1b4
default.nix: prevent nixpkgs tarball GC
When adding a GC root with `nix-build -A inputDerivation` the Nixpkgs
tarball wasn't being saved because it's technically not a build input.
2022-05-11 01:15:08 +02:00
Michele Guerini Rocco
3f79a6e9cd
skip print_headers with no active units 2022-05-11 01:15:07 +02:00
Michele Guerini Rocco
281a649212
Makefile: fix default PREFIX 2022-05-11 01:15:07 +02:00
Michele Guerini Rocco
d52fee084b
Makefile: fix gray.1 not being generated in all 2022-05-11 01:15:07 +02:00
Michele Guerini Rocco
aea31018a9
Revert "Change documentation formatting"
This reverts commit 10ab2d73.
The change broke the generation of the manual with help2man.
2022-05-11 01:15:07 +02:00
Michele Guerini Rocco
e81308d048
add option to set parameters from the command-line 2022-05-11 01:15:07 +02:00
Michele Guerini Rocco
3e49247d15
src/main.f90: fix typo 2022-05-11 01:15:06 +02:00
a2d4c25bb2
Change documentation formatting
Revert temporarily to default fonts to improve portability.
Add section header markers to the man page.
2022-05-11 01:15:06 +02:00
9a6063389e
Add wave frequency to parameters stored in file headers 2022-05-11 01:15:06 +02:00
efd4fc51e5
src/gray_params.f90: improve handling of absolute paths 2022-05-11 01:15:06 +02:00
d3a87e1044
Close open units on exit to flush the buffer 2022-05-11 01:15:05 +02:00
b379a20192
Makefile: change docs rule to make it work on macOS 2022-05-11 01:15:05 +02:00
Michele Guerini Rocco
6938d8c061
Makefile: make the .d rule portable
The \+ syntax is not POSIX and supported only by GNU sed.
This changes both the grep and sed commands to use extended regex.

Note: sed -E option is not POSIX either, but widely supported.
2022-05-11 01:15:05 +02:00
Michele Guerini Rocco
a30cd09e8e
src/math.f90: use the intrinsic gamma function
- remove the `gamm` function
- rewrite `fact` in terms of `gamma`
2022-05-11 01:15:05 +02:00
Michele Guerini Rocco
98599b2b7d
src/dispersion.f90: compute factorials incrementally 2022-05-11 01:15:05 +02:00
Michele Guerini Rocco
91a2e6cf07
src: implement toggling of output units
This actually implements the --units option
2022-05-11 01:15:04 +02:00
Michele Guerini Rocco
96359bc3fd
src: use hypot and norm2 when possible 2022-05-11 01:15:04 +02:00
Michele Guerini Rocco
18c1126d28
src/gray_params.f90: improve print_parameters
- add all missing parameters (not *data*)
- use shorter formatting
2022-05-11 01:15:04 +02:00
Michele Guerini Rocco
add59dbdda
src: use the logging system everywhere 2022-05-11 01:15:04 +02:00
Michele Guerini Rocco
f2f41ec023
src/logger.f90: init
This change adds a minimal logging system. The log messages carry a
timestamp in μs, the identifier of the emitter (fortran module +
procedure) and a log level. For simplicity the format is hardcoded.
2022-05-11 01:15:04 +02:00
Michele Guerini Rocco
ed0917aa8c
src/conical.f90: eliminate dead code
Use the intrinsic functions when possible (bessel_j0, bessel_j1) and
remove other unused functions.
2022-05-11 01:15:03 +02:00
Michele Guerini Rocco
ef1617713f
src: simplify handling of free units
This changes the behavior of `get_free_unit` to simplify the handling of
optional unit numbers.
2022-05-11 01:15:03 +02:00
Michele Guerini Rocco
095ee7ecf2
default.nix: exlcude result from source 2022-05-11 01:15:03 +02:00
Michele Guerini Rocco
da1ddd186e
default.nix: enable parallel build 2022-05-11 01:15:03 +02:00
Michele Guerini Rocco
5a8e64a595
Makefile: fix shell quoting 2022-05-11 01:15:03 +02:00
Michele Guerini Rocco
9a39251f44
doc/gray.1 generate from gray --help 2022-05-11 01:15:02 +02:00
Michele Guerini Rocco
01a6f9145c
initial gray CLI work
This lays down the basis for the gray command-line interface.
All options works but currently --units and -v/-q have no effect.
2022-05-11 01:15:02 +02:00
Michele Guerini Rocco
93d936ce24
Makefile: ignore instrisic modules
This excludes intristic modules like `iso_fortran_env` from the
automatic generation of the prerequisites.
2022-05-11 01:15:02 +02:00
Michele Guerini Rocco
2bee7be103
src/graycore.f90 -> src/gray_core.f90
Rename for consistency with other modules.
2022-05-11 01:15:02 +02:00
Michele Guerini Rocco
d18e05353a
src: remove unused parameters 2022-05-11 01:15:02 +02:00
Michele Guerini Rocco
7818ac731c
src/gray_jetto1beamf90: update for graycore changes 2022-05-11 01:15:01 +02:00
Michele Guerini Rocco
f56e1cbc05
src/coreprofiles.f90: use derived types 2022-05-11 01:15:01 +02:00
Michele Guerini Rocco
948a512254
src: use derived type arguments (work in progress)
This change structures the arguments of most functions, in particular
gray_main, into well-defined categories using derived types.

All types are defined in the gray_params.f90 (location subject to
change) and are organised as follows:

  gray_parameters (statically allocated data)
  ├── antenna_parameters
  ├── ecrh_cd_parameters
  ├── equilibrium_parameters
  ├── misc_parameters
  ├── output_parameters
  ├── profiles_parameters
  └── raytracing_parameters

  gray_data - inputs of gray_main (dynamically-allocated arrays)
  ├── equilibrium_data
  └── profiles_data

  gray_results - outputs of gray_main (dynamically-allocated arrays)
2022-05-11 01:15:01 +02:00
Michele Guerini Rocco
4f867bad14
src/magsurf_data.f90: fix memory leak 2022-05-11 01:15:01 +02:00
Michele Guerini Rocco
b1694bc575
src/pec.f90: fix uninitialised memory use
If the condition `sccsa > zero` is not met, ratj{a,b}mx remain
unitialised and print_finals may write them to fort.7.
2022-05-11 01:15:00 +02:00