convdump Program

Load any supported input and print summary values of first and last models.

Usage: convdump [path], default convdata.cnv (docs/usage.md). Prints model count first; reader picked from path by load_convection.


Variables

Type Attributes Name Initial
character(len=256) :: fname
integer(kind=int32) :: n

Subroutines

subroutine show(i)

Print ncyc, nconv, ncoord, tc, dc, summ0 and sum of xmcoord for one model.

Arguments

Type IntentOptional Attributes Name
integer(kind=int32), intent(in) :: i

Model index.

Source Code

program convdump
   !! Load any supported input and print summary values of first and last models.
   !!
   !! Usage: `convdump [path]`, default `convdata.cnv` (docs/usage.md). Prints model count first;
   !! reader picked from path by `load_convection`.

   use typedef, only: int32
   use convdata, only: data
   use mesaload, only: load_convection
   implicit none

   character(len=256) :: fname
   integer(int32) :: n

   if (command_argument_count() >= 1) then
      call get_command_argument(1, fname)
   else
      fname = 'convdata.cnv'
   end if

   call load_convection(trim(fname), 1_int32, huge(1_int32))
   n = int(size(data), int32)
   print '(a,i0)', 'nmodels ', n
   call show(1_int32)
   call show(n)

contains

   subroutine show(i)
      !! Print `ncyc`, `nconv`, `ncoord`, `tc`, `dc`, `summ0` and sum of `xmcoord` for one model.
      ! Arguments
      integer(int32), intent(in) :: i
         !! Model index.
      print '(a,i0,a,i0,a,i0)', '--- model index ', i, &
         '  ncyc=', data(i)%ncyc, '  nconv=', data(i)%nconv
      print '(a,i0,a,es22.15,a,es22.15)', '  ncoord=', data(i)%ncoord, &
         '  tc=', data(i)%tc, '  dc=', data(i)%dc
      print '(a,es22.15,a,es22.15)', '  summ0=', data(i)%summ0, &
         '  xmcoord.sum=', sum(data(i)%xmcoord)
   end subroutine show

end program convdump