Exposing openmc_plot_geom through C rather than plot.F90.

This commit is contained in:
Patrick Shriwise 2018-10-12 17:10:06 -05:00
parent 96e5007276
commit 72bee80142
5 changed files with 8 additions and 49 deletions

View file

@ -344,7 +344,7 @@ add_library(libopenmc SHARED
src/photon_physics.F90
src/physics_common.F90
src/physics.F90
src/plot.F90
src/physics_mg.F90
src/plot_header.F90
src/progress_header.F90
src/pugixml/pugixml_f.F90

View file

@ -73,7 +73,7 @@ namespace openmc {
};
extern "C" int openmc_plot_geometry_c();
//extern "C" int openmc_plot_geometry();
extern "C" void read_plots(pugi::xml_node* plot_node);

View file

@ -1,45 +0,0 @@
module plot
use, intrinsic :: ISO_C_BINDING
use error, only: write_message
use particle_header
use plot_header
use string, only: to_str
implicit none
private
public :: openmc_plot_geometry
interface
function openmc_plot_geometry_c() bind(C) result(err)
import C_INT
integer(C_INT) :: err
end function openmc_plot_geometry_c
subroutine create_ppm(pl) bind(C)
import ObjectPlot
type(ObjectPlot), intent(in) :: pl
end subroutine create_ppm
subroutine create_voxel(pl) bind(C)
import ObjectPlot
type(ObjectPlot), intent(in) :: pl
end subroutine create_voxel
end interface
contains
!===============================================================================
! RUN_PLOT controls the logic for making one or many plots
!===============================================================================
function openmc_plot_geometry() result(err) bind(C)
integer(C_INT) :: err
integer :: i ! loop index for plots
err = openmc_plot_geometry_c()
return
end function openmc_plot_geometry
end module plot

View file

@ -28,8 +28,8 @@ const int NULLRGB[3] = {0, 0, 0};
// RUN_PLOT controls the logic for making one or many plots
//===============================================================================
int openmc_plot_geometry_c() {
extern "C"
int openmc_plot_geometry() {
int err;
for(int i = 0; i < n_plots; i++) {

View file

@ -71,4 +71,8 @@ contains
call plot_dict % clear()
end subroutine free_memory_plot
!===============================================================================
! RUN_PLOT controls the logic for making one or many plots
!===============================================================================
end module plot_header