added PETSC compiler flag so code works when not compiling with PETSC

This commit is contained in:
Bryan Herman 2012-10-04 13:00:23 -07:00
parent d1d88d184a
commit 8fb1f3fb14
11 changed files with 46 additions and 1 deletions

View file

@ -7,7 +7,9 @@ module cmfd_execute
private
public :: execute_cmfd, cmfd_init_batch
# ifdef PETSC
# include <finclude/petsc.h90>
# endif
contains
@ -17,6 +19,8 @@ contains
subroutine execute_cmfd()
# ifdef PETSC
use cmfd_data, only: set_up_cmfd
use cmfd_message_passing, only: petsc_init_mpi, cmfd_bcast
use cmfd_output, only: write_hdf5_output
@ -124,6 +128,8 @@ contains
! wait here for all procs
call MPI_Barrier(MPI_COMM_WORLD,mpi_err)
# endif
end subroutine execute_cmfd
!==============================================================================
@ -166,6 +172,8 @@ contains
end subroutine cmfd_init_batch
# ifdef PETSC
!==============================================================================
! PROCESS_CMFD_OPTIONS
!==============================================================================
@ -433,6 +441,8 @@ contains
end function get_matrix_idx
# endif
!===============================================================================
! CMFD_TALLY_RESET
!===============================================================================

View file

@ -12,7 +12,9 @@ contains
subroutine configure_cmfd()
# ifdef PETSC
use cmfd_message_passing, only: petsc_init_mpi
# endif
use global, only: cmfd, cmfd_write_hdf5, master
#ifdef HDF5
@ -27,7 +29,9 @@ contains
! call write_cmfd_input_summary(cmfd_tally_size)
! initialize petsc on mpi
# ifdef PETSC
call petsc_init_mpi()
# endif
! Create a new file using default properties.
# ifdef HDF5

View file

@ -1,5 +1,7 @@
module cmfd_jacobian_operator
# ifdef PETSC
use cmfd_loss_operator, only: loss_operator,init_M_operator, &
build_loss_matrix,destroy_M_operator
use cmfd_prod_operator, only: prod_operator,init_F_operator, &
@ -345,4 +347,6 @@ contains
end subroutine destroy_J_operator
# endif
end module cmfd_jacobian_operator

View file

@ -1,5 +1,7 @@
module cmfd_loss_operator
# ifdef PETSC
implicit none
private
public :: init_M_operator,build_loss_matrix,destroy_M_operator
@ -533,4 +535,6 @@ contains
end subroutine destroy_M_operator
# endif
end module cmfd_loss_operator

View file

@ -1,5 +1,6 @@
module cmfd_message_passing
# ifdef PETSC
! This module contains MPI routines related to the CMFD calculation
@ -93,4 +94,6 @@ contains
end subroutine cmfd_bcast
# endif
end module cmfd_message_passing

View file

@ -1,5 +1,7 @@
module cmfd_output
# ifdef PETSC
! This modules cleans up cmfd objects and echos the results
implicit none
@ -164,4 +166,6 @@ contains
end subroutine write_hdf5_output
# endif
end module cmfd_output

View file

@ -1,5 +1,7 @@
module cmfd_power_solver
# ifdef PETSC
! This module contains routines to execute the power iteration solver
use cmfd_loss_operator, only: loss_operator,init_M_operator, &
@ -428,4 +430,6 @@ contains
end subroutine finalize
# endif
end module cmfd_power_solver

View file

@ -1,5 +1,7 @@
module cmfd_prod_operator
# ifdef PETSC
implicit none
private
public :: init_F_operator,build_prod_matrix,destroy_F_operator
@ -356,4 +358,6 @@ contains
end subroutine destroy_F_operator
# endif
end module cmfd_prod_operator

View file

@ -1,5 +1,7 @@
module cmfd_snes_solver
# ifdef PETSC
use cmfd_loss_operator, only: loss_operator,init_M_operator, &
& build_loss_matrix,destroy_M_operator
use cmfd_prod_operator, only: prod_operator,init_F_operator, &
@ -452,4 +454,6 @@ contains
end subroutine finalize
# endif
end module cmfd_snes_solver

View file

@ -1,6 +1,8 @@
module finalize
# ifdef PETSC
use cmfd_output, only: finalize_cmfd
# endif
use global
use output, only: print_runtime
use tally, only: write_tallies, tally_statistics
@ -36,8 +38,10 @@ contains
end if
end if
# ifdef PETSC
! finalize cmfd
if (cmfd_run) call finalize_cmfd()
# endif
! stop timers and show timing statistics
call timer_stop(time_finalize)

View file

@ -1,6 +1,6 @@
module input_xml
use cmfd_input, only: configure_cmfd
use cmfd_input, only: configure_cmfd
use constants
use datatypes, only: dict_add_key, dict_has_key, dict_get_key
use error, only: fatal_error, warning