Skip to content

Commit

Permalink
Clean up stella: tidy up the fields module (#159)
Browse files Browse the repository at this point in the history
Clean up the fields module, and split this into different modules based on function (i.e. Electromagnetic, Full flux surface, or radial variation).
  • Loading branch information
GeorgiaActon authored Sep 26, 2024
1 parent c0992ea commit 02354a5
Show file tree
Hide file tree
Showing 22 changed files with 3,372 additions and 2,549 deletions.
1 change: 0 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,6 @@ jobs:
brew update
brew install gcc fftw netcdf netcdf-fortran open-mpi python
ln -sn /opt/homebrew/bin/gfortran-12 /opt/homebrew/bin/gfortran
- uses: actions/checkout@v2

- name: Build stella
Expand Down
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,11 @@ set(STELLA_SOURCES_f90
# Sources that _do_ need preprocessing (because they have MPI flags, ...)
set(STELLA_SOURCES_fpp
fields.fpp
fields_fluxtube.fpp
fields_electromagnetic.fpp
fields_fullfluxsurface.fpp
fields_collisions.fpp
fields_radialvariation.fpp
response_matrix.fpp
sfincs_interface.fpp
sources.fpp
Expand Down
111 changes: 105 additions & 6 deletions Makefile.depend
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ stella_mod = \
ffs_solve.o \
fft_work.o \
fields.o \
fields_collisions.o \
fields_electromagnetic.o \
fields_fluxtube.o \
fields_fullfluxsurface.o \
fields_radialvariation.o \
file_utils.o \
finite_differences.o \
flow_shear.o \
Expand Down Expand Up @@ -99,7 +104,8 @@ coll_dougherty.o: \
arrays_fields.o \
calculations_kxky.o \
dist_redistribute.o \
fields.o \
fields_collisions.o \
fields_fluxtube.o \
file_utils.o \
finite_differences.o \
g_tofrom_h.o \
Expand All @@ -124,7 +130,8 @@ coll_fokkerplanck.o: \
common_types.o \
constants.o \
dist_redistribute.o \
fields.o \
fields_collisions.o \
fields_fluxtube.o \
file_utils.o \
finite_differences.o \
g_tofrom_h.o \
Expand Down Expand Up @@ -399,31 +406,119 @@ fft_work.o: \
fields.o: \
arrays_dist_fn.o \
arrays_fields.o \
calculations_kxky.o \
common_types.o \
constants.o \
debug_flags.o \
dist_redistribute.o \
fields_electromagnetic.o \
fields_fluxtube.o \
fields_fullfluxsurface.o \
fields_radialvariation.o \
file_utils.o \
geometry.o \
grids_kxky.o \
gyro_averages.o \
job_manage.o \
linear_solve.o \
mp.o \
mp_lu_decomposition.o \
parameters_kxky_grids.o \
parameters_numerical.o \
parameters_physics.o \
species.o \
stella_layouts.o \
volume_averages.o \
vpamu_grids.o \
zgrid.o
fields_collisions.o: \
arrays_dist_fn.o \
arrays_fields.o \
geometry.o \
grids_kxky.o \
gyro_averages.o \
mp.o \
parameters_kxky_grids.o \
parameters_numerical.o \
parameters_physics.o \
species.o \
spfunc.o \
stella_layouts.o \
vpamu_grids.o \
zgrid.o
fields_electromagnetic.o: \
arrays_dist_fn.o \
arrays_fields.o \
debug_flags.o \
fields_radialvariation.o \
gyro_averages.o \
job_manage.o \
mp.o \
parameters_kxky_grids.o \
parameters_numerical.o \
parameters_physics.o \
species.o \
stella_layouts.o \
vpamu_grids.o \
zgrid.o
fields_fluxtube.o: \
arrays_dist_fn.o \
arrays_fields.o \
debug_flags.o \
dist_redistribute.o \
fields_electromagnetic.o \
fields_radialvariation.o \
geometry.o \
grids_kxky.o \
gyro_averages.o \
job_manage.o \
mp.o \
multibox.o \
parameters_kxky_grids.o \
parameters_numerical.o \
parameters_physics.o \
redistribute.o \
species.o \
stella_layouts.o \
vpamu_grids.o \
zgrid.o
fields_fullfluxsurface.o: \
arrays_dist_fn.o \
arrays_fields.o \
calculations_kxky.o \
common_types.o \
debug_flags.o \
geometry.o \
grids_kxky.o \
gyro_averages.o \
mp.o \
parameters_kxky_grids.o \
parameters_numerical.o \
parameters_physics.o \
species.o \
spfunc.o \
stella_layouts.o \
stella_transforms.o \
volume_averages.o \
vpamu_grids.o \
zgrid.o
fields_radialvariation.o: \
arrays_dist_fn.o \
arrays_fields.o \
calculations_kxky.o \
file_utils.o \
geometry.o \
grids_kxky.o \
gyro_averages.o \
job_manage.o \
linear_solve.o \
mp.o \
mp_lu_decomposition.o \
multibox.o \
parameters_kxky_grids.o \
parameters_numerical.o \
parameters_physics.o \
species.o \
stella_layouts.o \
stella_transforms.o \
vpamu_grids.o \
zgrid.o
file_utils.o: \
command_line.o
finite_differences.o:
Expand Down Expand Up @@ -557,6 +652,7 @@ implicit_solve.o: \
extended_zgrid.o \
ffs_solve.o \
fields.o \
fields_fullfluxsurface.o \
grids_kxky.o \
gyro_averages.o \
job_manage.o \
Expand Down Expand Up @@ -601,6 +697,7 @@ mirror_terms.o: \
debug_flags.o \
dist_redistribute.o \
fields.o \
fields_electromagnetic.o \
finite_differences.o \
g_tofrom_h.o \
geometry.o \
Expand Down Expand Up @@ -791,6 +888,7 @@ stella.o: \
dist_redistribute.o \
extended_zgrid.o \
fields.o \
fields_radialvariation.o \
file_utils.o \
geometry.o \
git_version.o \
Expand Down Expand Up @@ -869,6 +967,7 @@ time_advance.o: \
dist_redistribute.o \
extended_zgrid.o \
fields.o \
fields_radialvariation.o \
file_utils.o \
finite_differences.o \
flow_shear.o \
Expand Down
4 changes: 4 additions & 0 deletions arrays_fields.f90
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ module arrays_fields
real, dimension(:, :, :), allocatable :: gamtot13, gamtot31, gamtot33
real, dimension(:, :, :), allocatable :: gamtotinv11, gamtotinv13, gamtotinv31, gamtotinv33
real, dimension(:, :), allocatable :: gamtot3
real, dimension(:, :, :), allocatable :: apar_denom
!real :: gamtot_h, gamtot3_h, efac, efacp

complex, dimension(:, :, :), allocatable :: theta
Expand All @@ -56,4 +57,7 @@ module arrays_fields
real :: tcorr_source_qn, exp_fac_qn
integer :: qn_window = MPI_WIN_NULL, qn_zf_window = MPI_WIN_NULL

real :: gamtot_h, gamtot3_h, efac, efacp
real, dimension(2, 5) :: time_field_solve = 0.

end module arrays_fields
Loading

0 comments on commit 02354a5

Please sign in to comment.