program test use typedef, only: & char8, int32 use mkepinfo, only: & kepinfo use mproggit, only: & proggit use mprogvers, only: & progvers use mproguuid, only: & proguuid implicit none ! include 'typecom' integer(kind=int32) :: nargs character(kind=char8, len=80), dimension(0:20) :: inputarg !.... KEPLER signature information call progvers call proggit call proguuid !.... set program arguments nargs = 1 inputarg(0) = 'python' inputarg(1) = '-v' call kepinfo(inputarg, nargs) end program test !======================================================================= subroutine start_(nargs, input) use typedef, only: & char8, int32 use flib, only: & syspec use mkepinfo, only: & kepinfo use mproggit, only: & proggit use mprogvers, only: & progvers use mproguuid, only: & proguuid use mkepinit, only: & kepinit use msetup, only: & setup use mcycle, only: & cycle use cmd, only: & cmd_check implicit none ! include 'typecom' integer(kind=int32) :: i,j integer(kind=int32), intent(IN) :: nargs character(kind=char8, len=1), dimension(80*21), intent(IN) :: input character(kind=char8, len=80), dimension(0:20):: inputarg !.... KEPLER signature information call progvers call proggit call proguuid !.... get program arguments DO i=0,20 DO j=1,80 inputarg(i)(j:j) = input(j+i*80) enddo inputarg(i) = trim(inputarg(i)) enddo call kepinfo(inputarg, nargs) !.... some initialization that is not contained in a block data call kepinit !.... some platform specific settings call syspec !.... setup takes care of restarting or generating write(6, "(A)") ' [PYTHON] setting up kepler ...' call setup(inputarg, nargs) !.... check for commands call cmd_check end subroutine start_ !======================================================================= subroutine execute_(xcmdline, logitx, interactivex) use typedef, only: & char8, int32 use ttycom, only: & execute implicit none character(kind=char8, len=*), intent(IN) :: & xcmdline integer(kind=int32), intent(IN), optional :: & logitx, interactivex integer(kind=int32) :: & logit, interactive if (present(logitx)) then logit = logitx else logit = 0 endif if (present(interactivex)) then interactive = interactivex else interactive = 0 endif call execute(xcmdline, logit, interactive) end subroutine execute_ !======================================================================= subroutine cycle_(interactive) use mcycle, only: & cycle implicit none logical, intent(IN):: interactive call cycle(interactive) end subroutine cycle_ !======================================================================= subroutine terminate_(s) use typedef, only: & char8 use mterminate, only: & terminate implicit none character(kind=char8, len=*), intent(in) :: s call terminate(s) end subroutine terminate_ !======================================================================= subroutine loadbuf_(namedat,datbuf,jmin,jmax,datlabel,ierr) ! use griddef, only: & ! jmz use typedef, only: & int32, real64, char8 use mloadbuf, only: & loadbuf implicit none ! include 'typecom' ! include 'gridcom' ! integer(kind=int32), parameter :: & ! jmz = jmzmacro ! integer(kind=int32), parameter :: & ! jmz = 1983 integer(kind=int32), parameter :: & jmz = {JMZ} character(kind=char8, len=8), intent(in) :: & namedat integer(kind=int32), intent(in) :: & jmin, jmax character*48, intent(out) :: & datlabel integer(kind=int32), intent(out):: & ierr real(kind=real64), intent(out), dimension(0:jmz) :: & datbuf character(kind=char8, len=8) :: & name name = trim(namedat) call loadbuf(name,datbuf,jmin,jmax,datlabel,ierr) end subroutine loadbuf_ !======================================================================= subroutine pyexit(code) use typedef, only: & int32 implicit none ! include 'typecom' integer(kind=int32), intent(IN) :: code !f2py intent(callback, hide) endkepler(code) external endkepler write(6, "(A)") ' [PYEXIT]', code call endkepler(code) end subroutine pyexit !======================================================================= subroutine pyplot implicit none !f2py intent(callback, hide) plotkepler external plotkepler call plotkepler end subroutine pyplot !======================================================================= subroutine pygets(ttymsg) use typedef, only: & int32, int8, char8 implicit none ! include 'typecom' character(kind=char8, len=*), intent(out) :: ttymsg integer(kind=int32), parameter :: n = 132 integer(kind=int32) :: i integer(kind=int8), dimension(n) :: data !f2py intent(callback, hide) ttykepler(data) external ttykepler call ttykepler(data) do i = 1, min(n, len(ttymsg)) ttymsg(i:i) = char(data(i)) end do end subroutine pygets !======================================================================= subroutine getentropies_(datbuf, jmin, jmax) ! this interface avoids having to include kepcom ! use griddef, only: & ! jmz use typedef, only: & int32, real64 use pyinterface, only: & getentropies implicit none save ! include 'typecom' ! include 'gridcom' ! integer(kind=int32), parameter :: & ! jmz = jmzmacro ! integer(kind=int32), parameter :: & ! jmz = 1983 integer(kind=int32), parameter :: & jmz = {JMZ} integer(kind=int32), intent(in) :: & jmin, jmax real(kind=real64), intent(out), dimension(0:jmz, 0:5) :: & datbuf ! real(kind=real64), intent(out), dimension(:,:), allocatable :: & ! datbuf ! if (.not.allocated(datbuf)) then ! allocate(datbuf(0:jmz,0:5)) ! endif call getentropies(datbuf, jmin, jmax) end subroutine getentropies_ !======================================================================= subroutine eosedit_(jzone, tem, den, dt, idata, flags, data, l, m, n) use :: ieeevals, only :& ieee_nans use typedef, only: & int32, real64 use pyinterface, only: & geteos implicit none ! include 'typecom' integer(kind=int32), intent(in) :: & l, m, n, jzone, flags real(kind=real64), intent(in), dimension(m) :: & tem real(kind=real64), intent(in), dimension(n) :: & den real(kind=real64), intent(in) :: & dt real(kind=real64), intent(out), dimension(l, m, n) :: & data integer(kind=int32), intent(in), dimension(l) :: & idata !f2py intent(out) :: data !f2py intent(in) :: tem, den, dt, jzone, idata, flags !f2py intent(hide),depend(tem) :: m=shape(tem,0) !f2py intent(hide),depend(den) :: n=shape(den,0) !f2py intent(hide),depend(idata) :: l=shape(idata,0) real(kind=real64) :: & tn, dn, & ptot, etot, sig, & pt, pd, et, ed, & xs, xst, xsd, & xk, xkt, xkd, & dxmax real(kind=real64) :: & ga, fa integer(kind=int32) :: & i, j, k do i=1,m do j=1,n tn = tem(i) dn = den(j) call geteos( & jzone, tn, dn, dt, & ptot, etot, sig, & pt, pd, et, ed, & xk, xkt, xkd, & xs, xst, xsd, & dxmax, & flags) do k=1,l select case (idata(k)) case (0) data(k,i,j) = sig case (1) data(k,i,j) = ptot case (2) data(k,i,j) = etot case (3) data(k,i,j) = pt case (4) data(k,i,j) = pd case (5) data(k,i,j) = et case (6) data(k,i,j) = ed case (7) data(k,i,j) = xs case (8) data(k,i,j) = xst case (9) data(k,i,j) = xsd case (10) data(k,i,j) = xk case (11) data(k,i,j) = xkt case (12) data(k,i,j) = xkd case (13) ga=dn/ptot*(pt/et*(ptot/dn**2-ed)+pd) ! Gamma1 fa=(ptot-ed*dn**2)/(et*tn*ga*dn) ! gammaf = 1-1/Gamma2 data(k,i,j) = ptot*pt/(dn**2*pd*fa) case (14) data(k,i,j) = dxmax case default data(k,i,j) = ieee_nans end select enddo enddo enddo end subroutine eosedit_ !======================================================================= subroutine eos_(& jzone, tem, den, dt, flags, & ptot, etot, sig, & pt, pd, et, ed, & xk, xkt, xkd, & xs, xst, xsd, & dxmax & ) use typedef, only: & int32, real64 use pyinterface, only: & geteos implicit none ! include 'typecom' integer(kind=int32), intent(in) :: & jzone, flags real(kind=real64), intent(in) :: & tem, den, dt real(kind=real64), intent(out) :: & ptot, etot, sig, & pt, pd, et, ed, & xk, xkt, xkd, & xs, xst, xsd, & dxmax !f2py intent(out) :: ptot, etot, sig, pt, pd, et, ed !f2py intent(out) :: xk, xkt, xkd, xs, xst, xsd, dxmax !f2py intent(in) :: tem, den, dt, jzone, flags call geteos( & jzone, tem, den, dt, & ptot, etot, sig, & pt, pd, et, ed, & xk, xkt, xkd, & xs, xst, xsd, & dxmax, & flags) end subroutine eos_ !======================================================================= subroutine burnzone_(jzone, tem, den, dtup, xs, xnu, dxmax, flags) use typedef, only: & int32, real64 use pyinterface, only: & burnzone implicit none ! include 'typecom' integer(kind=int32), intent(in) :: & jzone, flags real(kind=real64), intent(in) :: & tem, den, dtup real(kind=real64), intent(out) :: & xs, xnu, dxmax !f2py intent(out) :: xs, xnu, dxmax !f2py intent(in) :: jzone, tem, den, dtup, flags !f2py optional,intent(in) :: flags = 1 call burnzone(jzone, tem, den, dtup, xs, xnu, dxmax, flags) end subroutine burnzone_ !======================================================================= subroutine eosburn_(& jzone, tem, den, dtup, flags, & ptot, etot, sig, & pt, pd, et, ed, & xk, xkt, xkd, & xs, xnu, dxmax & ) use typedef, only: & int32, real64 use pyinterface, only: & geteosburn implicit none ! include 'typecom' integer(kind=int32), intent(in) :: & jzone, flags real(kind=real64), intent(in) :: & tem, den, dtup real(kind=real64), intent(out) :: & ptot, etot, sig, & pt, pd, et, ed, & xk, xkt, xkd, & xs, xnu, dxmax !f2py intent(out) :: ptot, etot, sig, pt, pd, et, ed !f2py intent(out) :: xk, xkt, xkd, xs, xnu, dxmax !f2py intent(in) :: tem, den, dt, jzone, flags call geteosburn( & jzone, tem, den, dtup, & ptot, etot, sig, & pt, pd, et, ed, & xk, xkt, xkd, & xs, xnu, dxmax, & flags) end subroutine eosburn_ !======================================================================= subroutine getesk_(jzone, tem, den, p, e, pt, pd, et, ed, xk, xkt, xkd) use typedef, only: & int32, real64 use pyinterface, only: & getesk implicit none integer(kind=int32), intent(in) :: & jzone real(kind=real64), intent(in) :: & tem, den real(kind=real64), intent(out) :: & p, e, pt, pd, et, ed, & xk, xkt, xkd !f2py intent(out) :: p, e, pt, pd, et, ed, xk, xkt, xkd !f2py intent(in) :: jzone, tem, den call getesk(jzone, tem, den, p, e, pt, pd, et, ed, xk, xkt, xkd) end subroutine getesk_ !======================================================================= subroutine getes_(jzone, tem, den, p, e, pt, pd, et, ed) use typedef, only: & int32, real64 use pyinterface, only: & getes implicit none integer(kind=int32), intent(in) :: & jzone real(kind=real64), intent(in) :: & tem, den real(kind=real64), intent(out) :: & p, e, pt, pd, et, ed !f2py intent(out) :: p, e, pt, pd, et, ed !f2py intent(in) :: jzone, tem, den call getes(jzone, tem, den, p, e, pt, pd, et, ed) end subroutine getes_ !======================================================================= subroutine cpburn_(j0, j1) use typedef, only: & int32 use pyinterface, only: & cpburn implicit none integer(kind=int32), intent(in) :: & j0, j1 call cpburn(j0, j1) end subroutine cpburn_ !======================================================================= subroutine mixburn_(j0, j1, j2, f0) use typedef, only: & int32, real64 use pyinterface, only: & mixburn implicit none integer(kind=int32), intent(in) :: & j0, j1, j2 real(kind=real64), intent(in) :: & f0 call mixburn(j0, j1, j1, f0) end subroutine mixburn_ !======================================================================= subroutine ieee_values_(ieee) use ieeevals, only: & ieee_nans, ieee_nanq, ieee_inf, ieee_ninf, & ieee_den, ieee_nden, ieee_zero, ieee_nzero, & ieee_init use typedef, only: & real64 implicit none real(kind=real64), dimension(8), intent(out) :: ieee !f2py intent(out) :: ieee call ieee_init() ieee(:) = (/& ieee_nans,ieee_nanq,ieee_inf,ieee_ninf,& ieee_den,ieee_nden,ieee_zero,ieee_nzero/) print*,ieee end subroutine ieee_values_ !======================================================================= subroutine enuvogelb_(nzin,nain,qecin,integral,enbe) use typedef, only: & real64, int32 use vogel, only: & enuvogelb implicit none integer(kind=int32), intent(in) :: & nzin,nain,integral real(kind=real64), intent(in) :: & qecin real(kind=real64), intent(out) :: & enbe !f2py intent(in) :: nzin,nain,qecin,integral !f2py intent(out) :: enbe enbe = enuvogelb(nzin,nain,qecin,integral) end subroutine enuvogelb_ !======================================================================= subroutine enuvogel_(nzin,nain,qecin,iecinc,integral,enue) use typedef, only: & real64, int32 use vogel, only: & enuvogel implicit none integer(kind=int32), intent(in) :: & nzin,nain,iecinc,integral real(kind=real64), intent(in) :: & qecin real(kind=real64), intent(out) :: & enue !f2py intent(in) :: nzin,nain,qecin,iecinc,integral !f2py intent(out) :: enue enue = enuvogel(nzin,nain,qecin,iecinc,integral) end subroutine enuvogel_ !======================================================================= subroutine testflowb_(ixzone,xtemp,xrho,xdt,xrn,filename) use typedef, only: & real64, int32, char8 use btestflowb, only: & testflowb implicit none character(kind=char8, len=*), intent(in) :: & filename integer(kind=int32), intent(in) :: & ixzone real(kind=real64), intent(in) :: & xtemp,xrho,xdt,xrn !f2py intent(in) :: ixzone,xtemp,xrho,xdt,xrn,filename call testflowb(ixzone,xtemp,xrho,xdt,xrn,trim(filename)) end subroutine testflowb_