Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 8 additions & 22 deletions .github/workflows/Ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,10 @@ jobs:

env:
FC: gfortran
PFUNIT_DIR: /home/runner/work/GORILLA/GORILLA/pFUnit/build/installed/PFUNIT-4.7/

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Dependencies
run: |
Expand All @@ -36,20 +35,15 @@ jobs:
make -j$(nproc)
make tests
make install

- name: Additional Files
run: |
cd $GITHUB_WORKSPACE
wget -O 954.zip "https://dl.acm.org/action/downloadSupplement?doi=10.1145%2F2699468&file=954.zip&download=true"
unzip 954.zip
cp 954/F90/Src/Polynomial234RootSolvers.f90 SRC/contrib/
install_root="$PWD/installed"
echo "PFUNIT_DIR=$(find "$install_root" -maxdepth 1 -type d -name 'PFUNIT-*' | head -n 1)" >> "$GITHUB_ENV"

- name: Build
run: |
./build_coverage.sh

- name: Archive code coverage results
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: code-coverage-report
path: BUILD/COVERAGE/
Expand All @@ -59,24 +53,16 @@ jobs:

env:
FC: gfortran
PFUNIT_DIR: /home/runner/work/GORILLA/GORILLA/pFUnit/build/installed/PFUNIT-4.7

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Dependencies
run: |
sudo apt-get update
sudo apt-get install wget unzip gfortran liblapack-dev libnetcdff-dev

- name: Additional Files
run: |
cd $GITHUB_WORKSPACE
wget -O 954.zip "https://dl.acm.org/action/downloadSupplement?doi=10.1145%2F2699468&file=954.zip&download=true"
unzip 954.zip
cp 954/F90/Src/Polynomial234RootSolvers.f90 SRC/contrib/

- name: Build
run: |
make
Expand Down Expand Up @@ -123,13 +109,13 @@ jobs:
plotting_tutorial

- name: Archive MATLAB results
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: MATLAB-RESULTS
path: MATLAB/data_plots

- name: Set up Python 3.9
uses: actions/setup-python@v3
uses: actions/setup-python@v5
with:
python-version: 3.9

Expand Down Expand Up @@ -168,7 +154,7 @@ jobs:
python3.9 plotting_tutorial.py

- name: Archive PYTHON results
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: PYTHON-RESULTS
path: PYTHON/data_plots
Expand Down
17 changes: 15 additions & 2 deletions SRC/find_tetra_mod.f90
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module find_tetra_mod
!
private
!
public :: grid_for_find_tetra, find_tetra
public :: grid_for_find_tetra, find_tetra, deallocate_find_tetra_arrays
!
integer, dimension(:,:), allocatable :: equidistant_grid
integer, dimension(:), allocatable :: entry_counter
Expand Down Expand Up @@ -276,6 +276,19 @@ subroutine grid_for_find_tetra !compare with chapter 4.1 of master thesis of Jon
end subroutine grid_for_find_tetra
!
!ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
!
subroutine deallocate_find_tetra_arrays()
!
implicit none
!
if (allocated(equidistant_grid)) deallocate(equidistant_grid)
if (allocated(entry_counter)) deallocate(entry_counter)
if (allocated(box_centres)) deallocate(box_centres)
if (allocated(save_box_centres)) deallocate(save_box_centres)
!
end subroutine deallocate_find_tetra_arrays
!
!ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
!
subroutine find_tetra(x,vpar,vperp,ind_tetr_out,iface,sign_t_step_in)
!
Expand Down Expand Up @@ -595,4 +608,4 @@ subroutine find_tetra(x,vpar,vperp,ind_tetr_out,iface,sign_t_step_in)
endif
!
end subroutine find_tetra
end module find_tetra_mod
end module find_tetra_mod
24 changes: 24 additions & 0 deletions SRC/magdata_in_symfluxcoord.f90
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ module magdata_in_symfluxcoordinates_mod

implicit none

public :: load_magdata_in_symfluxcoord, magdata_in_symfluxcoord_ext, deallocate_magdata_in_symfluxcoord

contains

subroutine load_magdata_in_symfluxcoord
Expand Down Expand Up @@ -242,4 +244,26 @@ end subroutine magdata_in_symfluxcoord_ext
!
!ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
!
subroutine deallocate_magdata_in_symfluxcoord()
!
use magdata_in_symfluxcoor_mod
!
implicit none
!
if (allocated(rbeg)) deallocate(rbeg)
if (allocated(rsmall)) deallocate(rsmall)
if (allocated(qsaf)) deallocate(qsaf)
if (allocated(psisurf)) deallocate(psisurf)
if (allocated(phitor)) deallocate(phitor)
if (allocated(R_st)) deallocate(R_st)
if (allocated(Z_st)) deallocate(Z_st)
if (allocated(bmod_st)) deallocate(bmod_st)
if (allocated(sqgnorm_st)) deallocate(sqgnorm_st)
!
load = .true.
!
end subroutine deallocate_magdata_in_symfluxcoord
!
!ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
!
end module magdata_in_symfluxcoordinates_mod
18 changes: 17 additions & 1 deletion SRC/tetra_grid_mod.f90
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,23 @@ subroutine make_tetra_grid()
end subroutine make_tetra_grid
!
!ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
!
subroutine deallocate_tetra_grid()
!
implicit none
!
if (allocated(tetra_grid)) deallocate(tetra_grid)
if (allocated(verts_rphiz)) deallocate(verts_rphiz)
if (allocated(verts_xyz)) deallocate(verts_xyz)
if (allocated(verts_sthetaphi)) deallocate(verts_sthetaphi)
if (allocated(verts_theta_vmec)) deallocate(verts_theta_vmec)
!
ntetr = 0
nvert = 0
!
end subroutine deallocate_tetra_grid
!
!ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
!
subroutine make_grid_aligned(grid_size,efit_vmec,n_field_periods)
!
Expand Down Expand Up @@ -712,4 +729,3 @@ subroutine check_neighbour(knots1,knots2,iface1,iface2)
end subroutine check_neighbour
!
end module tetra_grid_mod

26 changes: 25 additions & 1 deletion SRC/tetra_grid_settings_mod.f90
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ module tetra_grid_settings_mod
& g_file_filename,convex_wall_filename,netcdf_filename, &
& knots_SOLEDGE3X_EIRENE_filename, triangles_SOLEDGE3X_EIRENE_filename
!
public :: load_tetra_grid_inp,set_grid_size,set_n_field_periods
public :: load_tetra_grid_inp,set_grid_size,set_n_field_periods,set_n2,set_n3
!
contains
!
Expand Down Expand Up @@ -116,6 +116,30 @@ subroutine set_grid_size(grid_size_in)
end subroutine set_grid_size
!
!ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
!
subroutine set_n2(n2_in)
!
implicit none
!
integer, intent(in) :: n2_in
!
n2 = n2_in
!
end subroutine set_n2
!
!ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
!
subroutine set_n3(n3_in)
!
implicit none
!
integer, intent(in) :: n3_in
!
n3 = n3_in
!
end subroutine set_n3
!
!ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
!
end module tetra_grid_settings_mod
!
Expand Down
16 changes: 15 additions & 1 deletion SRC/tetra_physics_mod.f90
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ module tetra_physics_mod
integer, public, protected :: coord_system
integer, public, protected :: sign_sqg
!
public :: make_tetra_physics, deallocate_tetra_physics
!
contains
!
subroutine make_tetra_physics(coord_system_in,ipert_in,bmod_multiplier_in, i_option)
Expand Down Expand Up @@ -1013,6 +1015,19 @@ subroutine make_tetra_physics(coord_system_in,ipert_in,bmod_multiplier_in, i_opt
end subroutine make_tetra_physics
!
!ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
!
subroutine deallocate_tetra_physics()
!
implicit none
!
if (allocated(tetra_physics)) deallocate(tetra_physics)
if (allocated(tetra_skew_coord)) deallocate(tetra_skew_coord)
if (allocated(hamiltonian_time)) deallocate(hamiltonian_time)
if (allocated(phi_elec)) deallocate(phi_elec)
!
end subroutine deallocate_tetra_physics
!
!ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
!
function isinside(ind_tetr,current_x) result(bool_isinside)
!
Expand Down Expand Up @@ -1346,4 +1361,3 @@ end subroutine set_all_dt_dtau_const
!ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
!
end module tetra_physics_mod

15 changes: 14 additions & 1 deletion SRC/tetra_physics_poly_precomp_mod.f90
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ module tetra_physics_poly_precomp_mod
!$OMP THREADPRIVATE(tetra_physics_poly_perpinv,boole_precomp_poly_perpinv)
!
public :: make_precomp_poly,make_precomp_poly_perpinv, &
& deallocate_precomp_poly, &
& initialize_boole_precomp_poly_perpinv,alloc_precomp_poly_perpinv
!
contains
Expand Down Expand Up @@ -498,6 +499,19 @@ subroutine initialize_boole_precomp_poly_perpinv()
end subroutine initialize_boole_precomp_poly_perpinv
!
!ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
!
subroutine deallocate_precomp_poly()
!
implicit none
!
if (allocated(tetra_physics_poly1)) deallocate(tetra_physics_poly1)
if (allocated(tetra_physics_poly4)) deallocate(tetra_physics_poly4)
if (allocated(tetra_physics_poly_perpinv)) deallocate(tetra_physics_poly_perpinv)
if (allocated(boole_precomp_poly_perpinv)) deallocate(boole_precomp_poly_perpinv)
!
end subroutine deallocate_precomp_poly
!
!ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
!
subroutine make_precomp_poly_perpinv(perpinv,perpinv2)
!
Expand Down Expand Up @@ -563,4 +577,3 @@ end subroutine make_precomp_poly_perpinv
!ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
!
end module tetra_physics_poly_precomp_mod

Loading