Skip to content

Commit de3c9cb

Browse files
authored
Make other routines self contained (#550)
Make other routines self-contained This should make teaching easier as it is now just one thing that needs copying Closes #374
1 parent e457eed commit de3c9cb

File tree

61 files changed

+108
-227
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+108
-227
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ build.log
1515
/lib/
1616
/include/
1717
*.pyc
18+
*/other/*.mod
1819

1920
## Debugging/Profiling
2021
gmon.out

binary/other/mod_other_accreted_material_j.f90

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@
2424
! ***********************************************************************
2525

2626
module mod_other_accreted_material_j
27-
use binary_def, only : binary_info, binary_ptr
28-
27+
2928
! NOTE: remember to set true:
3029
! use_other_accreted_material_j = .true.
3130

@@ -114,6 +113,7 @@ module mod_other_accreted_material_j
114113
contains
115114

116115
subroutine null_other_accreted_material_j(binary_id, ierr)
116+
use binary_def, only : binary_info, binary_ptr
117117
use const_def, only: dp
118118
integer, intent(in) :: binary_id
119119
integer, intent(out) :: ierr

binary/other/mod_other_adjust_mdots.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
! ***********************************************************************
2525

2626
module mod_other_adjust_mdots
27-
use binary_def, only : binary_info, binary_ptr
2827

2928
! NOTE: remember to set true:
3029
! use_other_adjust_mdots = .true.
@@ -111,6 +110,7 @@ module mod_other_adjust_mdots
111110
contains
112111

113112
subroutine null_other_adjust_mdots(binary_id, ierr)
113+
use binary_def, only : binary_info, binary_ptr
114114
use const_def, only: dp
115115
integer, intent(in) :: binary_id
116116
integer, intent(out) :: ierr

binary/other/mod_other_binary_ce.f90

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@
2424
! ***********************************************************************
2525

2626
module mod_other_binary_ce
27-
use star_def
28-
use binary_def, only : binary_info, binary_ptr
2927

3028
! NOTE: remember to set true:
3129
! use_other_CE_rlo_mdot = .true.
@@ -115,6 +113,8 @@ module mod_other_binary_ce
115113

116114
subroutine null_other_CE_init(binary_id, restart, ierr)
117115
use const_def, only: dp
116+
use star_def
117+
use binary_def, only : binary_info, binary_ptr
118118
integer, intent(in) :: binary_id
119119
logical, intent(in) :: restart
120120
integer, intent(out) :: ierr
@@ -130,6 +130,8 @@ end subroutine null_other_CE_init
130130

131131
subroutine null_other_CE_rlo_mdot(binary_id, mdot, ierr)
132132
use const_def, only: dp
133+
use star_def
134+
use binary_def, only : binary_info, binary_ptr
133135
integer, intent(in) :: binary_id
134136
real(dp), intent(out) :: mdot
135137
integer, intent(out) :: ierr
@@ -146,6 +148,8 @@ end subroutine null_other_CE_rlo_mdot
146148

147149
integer function null_other_CE_binary_evolve_step(binary_id)
148150
use const_def, only: dp
151+
use star_def
152+
use binary_def, only : binary_info, binary_ptr
149153
integer, intent(in) :: binary_id
150154
integer :: ierr
151155
type (binary_info), pointer :: b
@@ -160,6 +164,8 @@ integer function null_other_CE_binary_evolve_step(binary_id)
160164
end function null_other_CE_binary_evolve_step
161165

162166
integer function null_other_CE_binary_finish_step(binary_id)
167+
use star_def
168+
use binary_def, only : binary_info, binary_ptr
163169
integer, intent(in) :: binary_id
164170
integer :: ierr
165171
type (binary_info), pointer :: b

binary/other/mod_other_binary_edot.f90

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
! ***********************************************************************
2525

2626
module mod_other_binary_edot
27-
use binary_def, only : binary_info, binary_ptr
2827

2928
! NOTE: remember to set one of:
3029
! use_other_edot_tidal = .true.
@@ -116,6 +115,7 @@ module mod_other_binary_edot
116115

117116
subroutine null_other_edot_tidal(binary_id, ierr)
118117
use const_def, only: dp
118+
use binary_def, only : binary_info, binary_ptr
119119
integer, intent(in) :: binary_id
120120
integer, intent(out) :: ierr
121121
type (binary_info), pointer :: b
@@ -129,6 +129,7 @@ subroutine null_other_edot_tidal(binary_id, ierr)
129129
end subroutine null_other_edot_tidal
130130

131131
subroutine null_other_edot_enhance(binary_id, ierr)
132+
use binary_def, only : binary_info, binary_ptr
132133
integer, intent(in) :: binary_id
133134
integer, intent(out) :: ierr
134135
type (binary_info), pointer :: b
@@ -142,6 +143,7 @@ subroutine null_other_edot_enhance(binary_id, ierr)
142143
end subroutine null_other_edot_enhance
143144

144145
subroutine null_other_extra_edot(binary_id, ierr)
146+
use binary_def, only : binary_info, binary_ptr
145147
integer, intent(in) :: binary_id
146148
integer, intent(out) :: ierr
147149
type (binary_info), pointer :: b

binary/other/mod_other_binary_extras.f90

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@
2424
! ***********************************************************************
2525

2626
module mod_other_binary_extras
27-
use binary_def
28-
use const_def
2927

3028

3129
implicit none
@@ -36,6 +34,8 @@ module mod_other_binary_extras
3634
contains
3735

3836
integer function null_extras_binary_startup(binary_id,restart,ierr)
37+
use binary_def
38+
use const_def
3939
type (binary_info), pointer :: b
4040
integer, intent(in) :: binary_id
4141
integer, intent(out) :: ierr
@@ -50,6 +50,8 @@ integer function null_extras_binary_startup(binary_id,restart,ierr)
5050
end function null_extras_binary_startup
5151

5252
integer function null_extras_binary_start_step(binary_id,ierr)
53+
use binary_def
54+
use const_def
5355
type (binary_info), pointer :: b
5456
integer, intent(in) :: binary_id
5557
integer, intent(out) :: ierr
@@ -64,6 +66,8 @@ end function null_extras_binary_start_step
6466

6567
!Return either keep_going, retry or terminate
6668
integer function null_extras_binary_check_model(binary_id)
69+
use binary_def
70+
use const_def
6771
type (binary_info), pointer :: b
6872
integer, intent(in) :: binary_id
6973
integer :: ierr
@@ -79,6 +83,8 @@ end function null_extras_binary_check_model
7983
! returns either keep_going or terminate.
8084
! note: cannot request retry; extras_binary_check_model can do that.
8185
integer function null_extras_binary_finish_step(binary_id)
86+
use binary_def
87+
use const_def
8288
type (binary_info), pointer :: b
8389
integer, intent(in) :: binary_id
8490
integer :: ierr
@@ -93,6 +99,8 @@ end function null_extras_binary_finish_step
9399

94100

95101
subroutine null_extras_binary_after_evolve(binary_id, ierr)
102+
use binary_def
103+
use const_def
96104
type (binary_info), pointer :: b
97105
integer, intent(in) :: binary_id
98106
integer, intent(out) :: ierr
@@ -104,6 +112,8 @@ subroutine null_extras_binary_after_evolve(binary_id, ierr)
104112
end subroutine null_extras_binary_after_evolve
105113

106114
integer function null_how_many_extra_binary_history_columns(binary_id)
115+
use binary_def
116+
use const_def
107117
integer, intent(in) :: binary_id
108118
type (binary_info), pointer :: b
109119
integer :: ierr
@@ -118,6 +128,8 @@ integer function null_how_many_extra_binary_history_columns(binary_id)
118128
end function null_how_many_extra_binary_history_columns
119129

120130
subroutine null_data_for_extra_binary_history_columns(binary_id, n, names, vals, ierr)
131+
use binary_def
132+
use const_def
121133
integer, intent(in) :: binary_id
122134
integer, intent(in) :: n
123135
character (len=maxlen_binary_history_column_name) :: names(n)
@@ -135,13 +147,17 @@ end subroutine null_data_for_extra_binary_history_columns
135147

136148

137149
integer function null_how_many_extra_binary_history_header_items(binary_id)
150+
use binary_def
151+
use const_def
138152
use binary_def, only: binary_info
139153
integer, intent(in) :: binary_id
140154
null_how_many_extra_binary_history_header_items = 0
141155
end function null_how_many_extra_binary_history_header_items
142156

143157
subroutine null_data_for_extra_binary_history_header_items( &
144158
binary_id, n, names, vals, ierr)
159+
use binary_def
160+
use const_def
145161
type (binary_info), pointer :: b
146162
integer, intent(in) :: binary_id, n
147163
character (len=maxlen_binary_history_column_name) :: names(n)

binary/other/mod_other_binary_jdot.f90

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
! ***********************************************************************
2525

2626
module mod_other_binary_jdot
27-
use binary_def, only : binary_info, binary_ptr
2827

2928
! NOTE: remember to set one of:
3029
! use_other_jdot_mb = .true.
@@ -107,6 +106,7 @@ module mod_other_binary_jdot
107106
contains
108107

109108
subroutine null_other_jdot_mb(binary_id, ierr)
109+
use binary_def, only : binary_info, binary_ptr
110110
integer, intent(in) :: binary_id
111111
integer, intent(out) :: ierr
112112
type (binary_info), pointer :: b
@@ -120,6 +120,7 @@ subroutine null_other_jdot_mb(binary_id, ierr)
120120
end subroutine null_other_jdot_mb
121121

122122
subroutine null_other_jdot_gr(binary_id, ierr)
123+
use binary_def, only : binary_info, binary_ptr
123124
integer, intent(in) :: binary_id
124125
integer, intent(out) :: ierr
125126
type (binary_info), pointer :: b
@@ -133,6 +134,7 @@ subroutine null_other_jdot_gr(binary_id, ierr)
133134
end subroutine null_other_jdot_gr
134135

135136
subroutine null_other_jdot_ml(binary_id, ierr)
137+
use binary_def, only : binary_info, binary_ptr
136138
integer, intent(in) :: binary_id
137139
integer, intent(out) :: ierr
138140
type (binary_info), pointer :: b
@@ -146,6 +148,7 @@ subroutine null_other_jdot_ml(binary_id, ierr)
146148
end subroutine null_other_jdot_ml
147149

148150
subroutine null_other_extra_jdot(binary_id, ierr)
151+
use binary_def, only : binary_info, binary_ptr
149152
integer, intent(in) :: binary_id
150153
integer, intent(out) :: ierr
151154
type (binary_info), pointer :: b
@@ -159,6 +162,7 @@ subroutine null_other_extra_jdot(binary_id, ierr)
159162
end subroutine null_other_extra_jdot
160163

161164
subroutine null_other_jdot_ls(binary_id, ierr)
165+
use binary_def, only : binary_info, binary_ptr
162166
integer, intent(in) :: binary_id
163167
integer, intent(out) :: ierr
164168
type (binary_info), pointer :: b
@@ -172,6 +176,7 @@ subroutine null_other_jdot_ls(binary_id, ierr)
172176
end subroutine null_other_jdot_ls
173177

174178
subroutine null_other_jdot_missing_wind(binary_id, ierr)
179+
use binary_def, only : binary_info, binary_ptr
175180
integer, intent(in) :: binary_id
176181
integer, intent(out) :: ierr
177182
type (binary_info), pointer :: b

binary/other/mod_other_binary_photo_read.f90

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@
2525

2626
module mod_other_binary_photo_read
2727

28-
use binary_def
29-
3028
implicit none
3129

3230
! note: there is no flag "use_other_binary_photo_read".
@@ -37,6 +35,7 @@ module mod_other_binary_photo_read
3735

3836

3937
subroutine default_other_binary_photo_read(binary_id, iounit, ierr)
38+
use binary_def
4039
integer, intent(in) :: binary_id, iounit
4140
integer, intent(out) :: ierr
4241
ierr = 0

binary/other/mod_other_binary_photo_write.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525

2626
module mod_other_binary_photo_write
2727

28-
use binary_def
2928

3029
implicit none
3130

@@ -37,6 +36,7 @@ module mod_other_binary_photo_write
3736

3837

3938
subroutine default_other_binary_photo_write(binary_id, iounit)
39+
use binary_def
4040
integer, intent(in) :: binary_id, iounit
4141
!write(iounit) stuff
4242
end subroutine default_other_binary_photo_write

binary/other/mod_other_binary_wind_transfer.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
! ***********************************************************************
2525

2626
module mod_other_binary_wind_transfer
27-
use binary_def, only : binary_info, binary_ptr
2827

2928
! NOTE: remember to set true:
3029
! use_other_binary_wind_transfer = .true.
@@ -147,6 +146,7 @@ module mod_other_binary_wind_transfer
147146
contains
148147

149148
subroutine null_other_binary_wind_transfer(binary_id, s_i, ierr)
149+
use binary_def, only : binary_info, binary_ptr
150150
integer, intent(in) :: binary_id, s_i
151151
integer, intent(out) :: ierr
152152
type (binary_info), pointer :: b

0 commit comments

Comments
 (0)