Skip to content
This repository was archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
Refactored read_in subroutines for naming consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
daminton committed Aug 19, 2021
1 parent 5b9e3ba commit cf8523a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
10 changes: 5 additions & 5 deletions src/io/io.f90
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,7 @@ module subroutine io_param_writer(self, unit, iotype, v_list, iostat, iomsg)
write(param_name, Afmt) "DT"; write(param_value, Rfmt) param%dt; write(unit, Afmt, err = 667, iomsg = iomsg) adjustl(param_name), adjustl(param_value)
write(param_name, Afmt) "CB_IN"; write(param_value, Afmt) trim(adjustl(param%incbfile)); write(unit, Afmt, err = 667, iomsg = iomsg) adjustl(param_name), adjustl(param_value)
write(param_name, Afmt) "PL_IN"; write(param_value, Afmt) trim(adjustl(param%inplfile)); write(unit, Afmt, err = 667, iomsg = iomsg) adjustl(param_name), adjustl(param_value)
write(param_name, Afmt) "TP_in"; write(param_value, Afmt) trim(adjustl(param%intpfile)); write(unit, Afmt, err = 667, iomsg = iomsg) adjustl(param_name), adjustl(param_value)
write(param_name, Afmt) "TP_IN"; write(param_value, Afmt) trim(adjustl(param%intpfile)); write(unit, Afmt, err = 667, iomsg = iomsg) adjustl(param_name), adjustl(param_value)
write(param_name, Afmt) "IN_TYPE"; write(param_value, Afmt) trim(adjustl(param%in_type)); write(unit, Afmt, err = 667, iomsg = iomsg) adjustl(param_name), adjustl(param_value)
if (param%istep_out > 0) then
write(param_name, Afmt) "ISTEP_OUT"; write(param_value, Ifmt) param%istep_out; write(unit, Afmt, err = 667, iomsg = iomsg) adjustl(param_name), adjustl(param_value)
Expand Down Expand Up @@ -784,7 +784,7 @@ module subroutine io_param_writer(self, unit, iotype, v_list, iostat, iomsg)
end subroutine io_param_writer


module subroutine io_read_body_in(self, param)
module subroutine io_read_in_body(self, param)
!! author: The Purdue Swiftest Team - David A. Minton, Carlisle A. Wishard, Jennifer L.L. Pouplin, and Jacob R. Elliott
!!
!! Read in either test particle or massive body data
Expand Down Expand Up @@ -873,10 +873,10 @@ module subroutine io_read_body_in(self, param)
667 continue
write(*,*) 'Error reading in initial conditions file: ',trim(adjustl(errmsg))
return
end subroutine io_read_body_in
end subroutine io_read_in_body


module subroutine io_read_cb_in(self, param)
module subroutine io_read_in_cb(self, param)
!! author: David A. Minton
!!
!! Reads in central body data
Expand Down Expand Up @@ -925,7 +925,7 @@ module subroutine io_read_cb_in(self, param)
667 continue
write(*,*) "Error reading central body file: " // trim(adjustl(errmsg))
call util_exit(FAILURE)
end subroutine io_read_cb_in
end subroutine io_read_in_cb


function io_read_encounter(t, id1, id2, Gmass1, Gmass2, radius1, radius2, &
Expand Down
12 changes: 6 additions & 6 deletions src/modules/swiftest_classes.f90
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ module swiftest_classes
real(DP), dimension(NDIM) :: L0 = 0.0_DP !! Initial angular momentum of the central body
real(DP), dimension(NDIM) :: dL = 0.0_DP !! Change in angular momentum of the central body
contains
procedure :: initialize => io_read_cb_in !! I/O routine for reading in central body data
procedure :: initialize => io_read_in_cb !! I/O routine for reading in central body data
procedure :: read_frame => io_read_frame_cb !! I/O routine for reading out a single frame of time-series data for the central body
procedure :: write_frame => io_write_frame_cb !! I/O routine for writing out a single frame of time-series data for the central body
end type swiftest_cb
Expand Down Expand Up @@ -174,7 +174,7 @@ module swiftest_classes
procedure :: drift => drift_body !! Loop through bodies and call Danby drift routine on heliocentric variables
procedure :: v2pv => gr_vh2pv_body !! Converts from velocity to psudeovelocity for GR calculations using symplectic integrators
procedure :: pv2v => gr_pv2vh_body !! Converts from psudeovelocity to velocity for GR calculations using symplectic integrators
procedure :: initialize => io_read_body_in !! Read in body initial conditions from a file
procedure :: initialize => io_read_in_body !! Read in body initial conditions from a file
procedure :: read_frame => io_read_frame_body !! I/O routine for writing out a single frame of time-series data for the central body
procedure :: write_frame => io_write_frame_body !! I/O routine for writing out a single frame of time-series data for the central body
procedure :: accel_obl => obl_acc_body !! Compute the barycentric accelerations of bodies due to the oblateness of the central body
Expand Down Expand Up @@ -610,17 +610,17 @@ module subroutine io_param_writer(self, unit, iotype, v_list, iostat, iomsg)
character(len=*), intent(inout) :: iomsg !! Message to pass if iostat /= 0
end subroutine io_param_writer

module subroutine io_read_body_in(self, param)
module subroutine io_read_in_body(self, param)
implicit none
class(swiftest_body), intent(inout) :: self !! Swiftest body object
class(swiftest_parameters), intent(inout) :: param !! Current run configuration parameters
end subroutine io_read_body_in
end subroutine io_read_in_body

module subroutine io_read_cb_in(self, param)
module subroutine io_read_in_cb(self, param)
implicit none
class(swiftest_cb), intent(inout) :: self !! Swiftest central body object
class(swiftest_parameters), intent(inout) :: param !! Current run configuration parameters
end subroutine io_read_cb_in
end subroutine io_read_in_cb

module subroutine io_read_param_in(self, param_file_name)
implicit none
Expand Down

0 comments on commit cf8523a

Please sign in to comment.