[mesa-users] MLT problem

Bill Paxton paxton at kitp.ucsb.edu
Tue Jan 19 12:19:42 EST 2016


On Jan 19, 2016, at 8:47 AM, Kenny Van wrote:

> I'm not sure I'm properly implementing the ierr = -1. If I understand correctly, I would not only need to include ierr = -1 in the test of (is_bad_num(d_Bcubed_dvb(mlt_dgrada))), but I would also need to define it in the initial parameters of the subroutine correct?
> 

ierr /= 0 is used by "lower" level routines to indicate a failure.   it must be an arg to the routine so it can be returned to tell the caller what has happened.

"higher" level routine go beyond a simple binary okay or failed to return an integer value from the following set (defined in star/public/star_def.inc)

      ! result codes for various evolution routines
      integer, parameter :: keep_going = 0
      integer, parameter :: redo = 1 
         ! repeat current step with same timestep
         ! for example, after changing a parameter such as mdot
      integer, parameter :: retry = 2
         ! repeat current step with smaller timestep
      integer, parameter :: backup = 3
         ! go back to previous model and retry with smaller timestep
      integer, parameter :: terminate = 4

Routines that are returning such a value may declare ierr as a local variable for use in calls to lower level routines.  

For an example of this, see 'integer function do_evolve_step_part1' in star/private/evolve

-Bill



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.mesastar.org/pipermail/mesa-users/attachments/20160119/ea2b1a4b/attachment.html>


More information about the Mesa-users mailing list