! ``colors`` module controls
! ==========================


! Colors User Parameters
! ----------------------

   ! ``use_colors``
   ! ~~~~~~~~~~~~~~
   ! Set to .true. to enable bolometric and synthetic photometry output.

   ! ``instrument``
   ! ~~~~~~~~~~~~~~
   ! Path to the filter instrument directory (structured as facility/instrument).
   ! The directory must contain an index file named after the instrument and
   ! one .dat transmission curve per filter. Each filter becomes a history column.

   ! ``stellar_atm``
   ! ~~~~~~~~~~~~~~~
   ! Path to the directory containing the stellar atmosphere lookup table and
   ! spectra used by the colors module. The default
   ! uses the ``Kurucz2003all`` ATLAS9 atmosphere grid shipped with MESA.
   ! Must contain: lookup_table.csv, SED files, and optionally flux_cube.bin.
   !Castelli & Kurucz 2003 -- https://arxiv.org/abs/astro-ph/0405087
   !SVO model -- https://svo2.cab.inta-csic.es/theory/newov2/index.php?models=Kurucz2003all



   ! ``vega_sed``
   ! ~~~~~~~~~~~~
   ! Path to the Vega reference SED file. Required when mag_system = 'Vega'.
   ! Used to compute photometric zero-points for all filters.

   ! ``distance``
   ! ~~~~~~~~~~~~
   ! Distance to the star in cm. Determines whether output magnitudes are
   ! absolute (default: 10 pc = 3.0857e19 cm) or apparent (set to source distance).

   ! ``make_csv``
   ! ~~~~~~~~~~~~
   ! If .true., exports the full SED as a CSV file at every profile interval.
   ! Files are written to colors_results_directory.

   ! ``colors_results_directory``
   ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   ! Directory where CSV outputs (make_csv, sed_per_model) are saved.

   ! ``mag_system``
   ! ~~~~~~~~~~~~~~
   ! Photometric zero-point system. Options: 'Vega', 'AB', 'ST'.
   !   Vega : zero-point set so Vega has magnitude 0 in all bands.
   !   AB   : zero-point based on flat f_nu = 3631 Jy.
   !   ST   : zero-point based on flat f_lambda per unit wavelength.

   ! ``sed_per_model``
   ! ~~~~~~~~~~~~~~~~~
   ! Requires make_csv = .true. If .true., each SED output file is suffixed with
   ! the model number, preserving the full SED history rather than overwriting.
   ! WARNING: can produce very large numbers of files. Ensure adequate storage.


   ! If ``use_colors`` is true, the colors module computes bolometric and synthetic
   ! magnitudes by interpolating stellar atmosphere model grids and convolving with
   ! photometric filter transmission curves. Output is appended to history.data.
   ! ::

      use_colors = .false.
      instrument = 'data/colors_data/filters/Generic/Johnson'
      stellar_atm = 'data/colors_data/stellar_models/Kurucz2003all/'
      vega_sed = 'data/colors_data/stellar_models/vega_flam.csv'
      distance = 3.0857d19     ! 10 parsecs in cm -> Absolute Magnitudes
      make_csv = .false.
      colors_results_directory = 'SED'
      mag_system = 'Vega'
      sed_per_model = .false.


   ! ``z_over_x_ref``
   ! ~~~~~~~~~~~~~~~~

   ! ``z_over_x_ref`` is the reference metal-to-hydrogen ratio used to map
   ! the photospheric composition onto the atmosphere-table metallicity axis:
   ! [Fe/H] = log10((Z/X)/z_over_x_ref).

   ! The default matches the GS98 solar mixture used by the default
   ! Kurucz2003all ATLAS9 atmosphere grid and equals
   ! 0.0169/(1 - 0.0169 - 0.2485) = 2.30057173972d-2.

   ! If the photospheric metallicity, expressed as Z/X, falls outside the
   ! metallicity range available in the tabulated atmosphere lookup table,
   ! then MESA uses the nearest metallicity in the table for the atmosphere
   ! interpolation. If the photospheric hydrogen mass fraction or metal mass
   ! fraction is not positive, then MESA cannot form
   ! log10((Z/X)/z_over_x_ref). In that case the module still returns colors
   ! and SEDs, but it does so by using the lowest metallicity in the table.
   ! This is a fallback safeguard and not a dedicated treatment for H-free
   ! atmospheres.

   ! For the shipped Kurucz2003all table in this checkout, the
   ! metallicity range is [Fe/H] = -2.5 to [Fe/H] = 4.0. With the
   ! default ``z_over_x_ref``, the lower edge corresponds to
   ! Z/X ~ 7.275d-5.

   ! ::

      z_over_x_ref = 2.30057173972d-2


! Extra inlist controls
! ---------------------

   ! One can split a colors inlist into pieces using the following parameters.
   ! It works recursively, so the extras can read extras too.

   ! ``read_extra_colors_inlist(1..5)``
   ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   ! ``extra_colors_inlist_name(1..5)``
   ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

   ! If ``read_extra_colors_inlist(i)`` is true, then read ``&colors``
   ! from the file ``extra_colors_inlist_name(i)``.
   !

   ! ::

      read_extra_colors_inlist(:) = .false.
      extra_colors_inlist_name(:) = 'undefined'
