Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Custom Background dSdr and dTdr via augment_reference. #416

Merged
merged 4 commits into from
Jan 5, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions src/Physics/PDE_Coefficients.F90
Original file line number Diff line number Diff line change
Expand Up @@ -689,9 +689,10 @@ Subroutine Augment_Reference()

If (my_rank .eq. 0) Then
Call stdout%print('Reference state will be augmented.')
Call stdout%print('Only heating and buoyancy may be modified.')
Call stdout%print('Only heating, buoyancy, or background dTdr/dSdr may be modified.')
Call stdout%print('Heating requires both c_10 and f_6 to be set.')
Call stdout%print('Buoyancy requires both c_2 and f_2 to be set.')
Call stdout%print('dTdr/dSdr requires f_14 to be set.')
Call stdout%print('Reading from: '//Trim(custom_reference_file))
Endif

Expand All @@ -703,11 +704,10 @@ Subroutine Augment_Reference()
Allocate(temp_functions(1:n_r, 1:n_ra_functions))
Allocate(temp_constants(1:n_ra_constants))
temp_functions(:,:) = ra_functions(:,:)

! Note that ra_constants is allocated up to max_ra_constants
temp_constants(:) = ra_constants(1:n_ra_constants)


Call Read_Custom_Reference_File(custom_reference_file)

If (use_custom_constant(10) .and. use_custom_function(6)) Then
Expand All @@ -732,6 +732,16 @@ Subroutine Augment_Reference()
temp_constants(2) = ra_constants(2)
Endif

If (use_custom_function(14)) Then
If (my_rank .eq. 0) Then
Call stdout%print('Background thermal gradient is set to:')
Call stdout%print('f_14')
Call stdout%print(' ')
Endif
ref%dsdr(:) = ra_functions(:,14)
temp_functions(:,14) = ra_functions(:,14)
Endif

ra_constants(1:n_ra_constants) = temp_constants(:)
ra_functions(:,:) = temp_functions(:,:)
DeAllocate(temp_functions, temp_constants)
Expand Down