[mesa-users] Using other_wind.f
Bill Paxton
paxton at kitp.ucsb.edu
Sun Jan 6 14:58:22 EST 2013
Hi,
You'll need to keep in mind that the "other_wind" case is different than the
others in terms of accessing information using "s". The wind routines are
called early in the sequence of operations during a time step, before doing
adjust mass and before unpacking of the basic variables and evaluation
of the input physics such as eos and net. So your "other_wind" routine
must be careful that it doesn't access things that have not yet been computed!
Most of the wind recipes rely only on "global" properties such as L, R, M, Teff,
and those are available. But if you want to implement a wind that depends
on things like sound speed or opacities in the outer layers of the model,
then things get tricky.
Perhaps this won't be an issue for you -- but I wanted to point out the possible problem.
Cheers,
Bill
On Jan 5, 2013, at 6:54 PM, Bill Paxton wrote:
> Hi Jieun,
>
> I don't pass the pointer "s" as an argument to the other_wind routine for various technical reasons.
> But the "id" argument let's you get what you need. It works like this:
>
> subroutine other_example(id, ierr)
> use star_def
> integer, intent(in) :: id
> integer, intent(out) :: ierr
>
> type (star_info), pointer :: s
>
> ierr = 0
> call star_ptr(id, s, ierr)
> if (ierr /= 0) return
>
> /* now you can use s to access whatever you need */
>
> ....
>
>
> Cheers,
> Bill
>
>
>
>
>
> On Jan 5, 2013, at 6:24 PM, Jieun Choi wrote:
>
>> Hi everyone,
>>
>> I'm experimenting with a different wind scheme which ties the regular Blöcker wind to an exponential factor involving the envelope mass. However, it seems like MESA only allows you to access Lsurf, Msurf, Rsurf, and Tsurf instead of the full star_info structure (from which I'd get the envelope mass). Is there some way to get around this?
>>
>> other_wind is called in winds.f using
>>
>> else if (scheme == 'other') then
>> if (dbg) write(*,*) 'call other_wind'
>> call s% other_wind(s% id, L1, M1, R1, T1, wind, ierr)
>> if (ierr /= 0) return
>>
>> and I copied the following from other_wind.f to use as a template in run_star_extras.f
>>
>> subroutine null_other_wind(id, Lsurf, Msurf, Rsurf, Tsurf, w, ierr)
>> use star_def
>> integer, intent(in) :: id
>> real(dp), intent(in) :: Lsurf, Msurf, Rsurf, Tsurf ! surface values (cgs)
>> ! NOTE: surface is outermost cell. not necessarily at photosphere.
>> ! NOTE: don't assume that vars are set at this point.
>> ! so if you want values other than those given as args,
>> ! you should use values from s% xh(:,:) and s% xa(:,:) only.
>> ! rather than things like s% Teff or s% lnT(:) which have not been set yet.
>> real(dp), intent(out) :: w ! wind in units of Msun/year (value is >= 0)
>> integer, intent(out) :: ierr
>> w = 0
>> ierr = 0
>> end subroutine null_other_wind
>>
>> Thanks,
>> Jieun
>> ------------------------------------------------------------------------------
>> Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
>> MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
>> with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
>> MVPs and experts. ON SALE this month only -- learn more at:
>> http://p.sf.net/sfu/learnmore_123012_______________________________________________
>> mesa-users mailing list
>> mesa-users at lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/mesa-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.mesastar.org/pipermail/mesa-users/attachments/20130106/363f6f44/attachment.html>
More information about the Mesa-users
mailing list