From 72bee8014203fdc74d7e17bc8cb6ce593828f044 Mon Sep 17 00:00:00 2001 From: Patrick Shriwise Date: Fri, 12 Oct 2018 17:10:06 -0500 Subject: [PATCH] Exposing openmc_plot_geom through C rather than plot.F90. --- CMakeLists.txt | 2 +- include/openmc/plot.h | 2 +- src/plot.F90 | 45 ------------------------------------------- src/plot.cpp | 4 ++-- src/plot_header.F90 | 4 ++++ 5 files changed, 8 insertions(+), 49 deletions(-) delete mode 100644 src/plot.F90 diff --git a/CMakeLists.txt b/CMakeLists.txt index 4ac9d9c5d..d3aacad71 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 diff --git a/include/openmc/plot.h b/include/openmc/plot.h index 585705d75..a5fc870e7 100644 --- a/include/openmc/plot.h +++ b/include/openmc/plot.h @@ -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); diff --git a/src/plot.F90 b/src/plot.F90 deleted file mode 100644 index faccb317c..000000000 --- a/src/plot.F90 +++ /dev/null @@ -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 diff --git a/src/plot.cpp b/src/plot.cpp index afb927252..61a22bde7 100644 --- a/src/plot.cpp +++ b/src/plot.cpp @@ -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++) { diff --git a/src/plot_header.F90 b/src/plot_header.F90 index 9937db7dd..81a8f7f9f 100644 --- a/src/plot_header.F90 +++ b/src/plot_header.F90 @@ -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