LCOV - code coverage report
Current view: top level - neu/public - neu_lib.f90 (source / functions) Coverage Total Hit
Test: coverage.info Lines: 100.0 % 3 3
Test Date: 2025-05-08 18:23:42 Functions: 100.0 % 1 1

            Line data    Source code
       1              : ! ***********************************************************************
       2              : !
       3              : !   Copyright (C) 2010  The MESA Team
       4              : !
       5              : !   This program is free software: you can redistribute it and/or modify
       6              : !   it under the terms of the GNU Lesser General Public License
       7              : !   as published by the Free Software Foundation,
       8              : !   either version 3 of the License, or (at your option) any later version.
       9              : !
      10              : !   This program is distributed in the hope that it will be useful,
      11              : !   but WITHOUT ANY WARRANTY; without even the implied warranty of
      12              : !   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
      13              : !   See the GNU Lesser General Public License for more details.
      14              : !
      15              : !   You should have received a copy of the GNU Lesser General Public License
      16              : !   along with this program. If not, see <https://www.gnu.org/licenses/>.
      17              : !
      18              : ! ***********************************************************************
      19              : 
      20              :       module neu_lib
      21              :       ! library for calculating neutrino losses from non-nuclear-burning sources
      22              :       ! neutrino losses that occur during nuclear reactions are included in the nuclear library
      23              :       ! the data interface for the library is defined in neu_def
      24              : 
      25              :       use const_def, only: dp
      26              : 
      27              :       implicit none
      28              : 
      29              : 
      30              :       contains  ! the procedure interface for the library
      31              :       ! client programs should only call these routines.
      32              : 
      33              : 
      34        36684 :       subroutine neu_get(T, log10_T, Rho, log10_Rho, abar, zbar, log10_Tlim, flags, &
      35              :                loss, sources, info)
      36              :          use neu_def
      37              :          use mod_neu, only : neutrinos
      38              : 
      39              :          ! this routine computes neutrino losses from the analytic fits of
      40              :          ! itoh et al. apjs 102, 411, 1996, and also returns their derivatives.
      41              : 
      42              :          ! provide T or log10_T or both (the code needs both, so pass 'em if you've got 'em!)
      43              :          ! same for Rho and log10_Rho
      44              : 
      45              :          real(dp), intent(in) :: T  ! temperature
      46              :          real(dp), intent(in) :: log10_T  ! log10 of temperature
      47              :          real(dp), intent(in) :: Rho  ! density
      48              :          real(dp), intent(in) :: log10_Rho  ! log10 of density
      49              :          real(dp), intent(in) :: abar  ! mean atomic weight
      50              :          real(dp), intent(in) :: zbar  ! mean charge
      51              :          real(dp), intent(in) :: log10_Tlim
      52              :          ! log10 of temperature at which begin to cutoff results
      53              :          !    NOTE: the Itoh et al data has a lower temperature limit of 10^7
      54              :          !    so for T < 10^7, the neutrino losses are simply set to 0
      55              :          !    Rather than have an abrupt cutoff, the values are multiplied by a coefficient
      56              :          !    that reaches 0 at T = 10^7 and is equal to 1 for log10T > log10_Tlim
      57              :          ! log10_Tlim of 7.5 is a reasonable choice.
      58              :          logical, intent(in) :: flags(num_neu_types)  ! true if should include the type of loss
      59              : 
      60              :          real(dp), intent(inout) :: loss(num_neu_rvs)  ! total from all sources
      61              :          real(dp), intent(inout) :: sources(num_neu_types, num_neu_rvs)
      62              :          integer, intent(out) :: info  ! 0 means AOK.
      63              : 
      64              :          call neutrinos(T, log10_T, Rho, log10_Rho, abar, zbar, log10_Tlim,  &
      65        36684 :                   flags, loss, sources, info)
      66              : 
      67        36684 :       end subroutine neu_get
      68              : 
      69              : 
      70              :       end module neu_lib
      71              : 
        

Generated by: LCOV version 2.0-1