From d8987c3528f54ca7db4607a948434e1b8b6230e5 Mon Sep 17 00:00:00 2001 From: pmocz Date: Fri, 9 Aug 2024 13:53:01 -0400 Subject: [PATCH] [ci skip] run_stars_extras --- star/private/starspots.f90 | 3 ++ .../starspots/src/run_star_extras.f90 | 28 +++++++++---------- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/star/private/starspots.f90 b/star/private/starspots.f90 index 6191b5ac8..1627d0753 100644 --- a/star/private/starspots.f90 +++ b/star/private/starspots.f90 @@ -60,6 +60,7 @@ subroutine starspot_tweak_gradr(s, P, gradr, gradr_spot) real(dp) :: mu_ideal_gas, R2, Teff_local, PB_i type(auto_diff_real_star_order1) :: xspot_of_r ! xspot4 + if (.not. s%doing_relax .and. .not. s%doing_first_model_of_run) then mu_ideal_gas = s%mu(1) !1.00794d0 ! for hydrogen, 1 gram per mole R2 = pow2(s%R(1)) @@ -82,6 +83,7 @@ subroutine starspot_tweak_PT(s) type(star_info), pointer :: s real(dp) :: alp + alp = 1d0 - s%fspot + s%fspot*pow4(s%xspot) ! This is the surface-average value for luminosity @@ -101,6 +103,7 @@ subroutine starspot_restore_PT(s) ! ------------------------------------------------------------ type(star_info), pointer :: s + s%Teff = pow(L_init/(pi4*pow2(s%r(1))*boltz_sigma), 0.25_dp) s%L(1) = L_init diff --git a/star/test_suite/starspots/src/run_star_extras.f90 b/star/test_suite/starspots/src/run_star_extras.f90 index 9145d2541..2689dd765 100644 --- a/star/test_suite/starspots/src/run_star_extras.f90 +++ b/star/test_suite/starspots/src/run_star_extras.f90 @@ -77,7 +77,7 @@ subroutine extras_controls(id, ierr) s% data_for_extra_profile_header_items => data_for_extra_profile_header_items s% other_surface_PT => starspot_tweak_PT - s% other_mlt_results => YREC_spots_other_mlt_results + !!s% other_mlt_results => YREC_spots_other_mlt_results end subroutine extras_controls @@ -165,15 +165,15 @@ subroutine YREC_spots_other_mlt_results(id, k, MLT_option, & ! NOTE: k=0 is a v !------------------------------ !if (s% star_age >= 10d0) then - if (.not. s% doing_relax .and. .not. s% doing_first_model_of_run) then - xspot_of_r = (P - PB_i)/P - gradr_spot = gradr/( fspot*pow4(xspot_of_r) + 1d0 - fspot) - else - gradr_spot = gradr - end if + !!if (.not. s% doing_relax .and. .not. s% doing_first_model_of_run) then + !! xspot_of_r = (P - PB_i)/P + !! gradr_spot = gradr/( fspot*pow4(xspot_of_r) + 1d0 - fspot) + !!else + !! gradr_spot = gradr + !!end if call star_mlt_results(id, k, MLT_option, & - r, L, T, P, opacity, rho, chiRho, chiT, Cp, gradr_spot, grada, scale_height, & + r, L, T, P, opacity, rho, chiRho, chiT, Cp, gradr, grada, scale_height, & iso, XH1, cgrav, m, gradL_composition_term, mixing_length_alpha, & alpha_semiconvection, thermohaline_coeff, & mixing_type, gradT, Y_face, conv_vel, D, Gamma, ierr) @@ -212,16 +212,16 @@ subroutine starspot_tweak_PT(id, skip_partials, & need_atm_Psurf = .true. need_atm_Tsurf = .true. - alp = 1d0 - fspot + fspot*pow4(xspot) + !!!alp = 1d0 - fspot + fspot*pow4(xspot) ! This is the surface-average value for luminosity - L_init = s% L(1) + !!!L_init = s% L(1) ! Set the surface L to the unspotted, ambient L - s% L(1) = s% L(1) / alp + !!!s% L(1) = s% L(1) / alp ! Now, set the Teff. Used in atm table lookup to set boundary conditions - s% Teff = pow(s% L(1)/(pi4*pow2(s% r(1))*boltz_sigma), 0.25_dp) + !!!s% Teff = pow(s% L(1)/(pi4*pow2(s% r(1))*boltz_sigma), 0.25_dp) ! Set everything with Lamb. call star_get_surf_PT(id, skip_partials, need_atm_Psurf, need_atm_Tsurf, & @@ -229,8 +229,8 @@ subroutine starspot_tweak_PT(id, skip_partials, & lnP_surf, dlnP_dL, dlnP_dlnR, dlnP_dlnM, dlnP_dlnkap, & ierr) - s% Teff = pow(L_init/(pi4*pow2(s% r(1))*boltz_sigma), 0.25_dp) - s% L(1) = L_init + !!!s% Teff = pow(L_init/(pi4*pow2(s% r(1))*boltz_sigma), 0.25_dp) + !!!s% L(1) = L_init end subroutine starspot_tweak_PT