c******************************************************************* REAL (kind=dp) FUNCTION p0(r,m,vaiss) c routine private du module mod_cesam c calcul de P0 = 2 pi**2 / SUM 0-->R N/R dR c c Auteur: P.Morel, Laboratoire Lagrange, O.C.A., CESAM2k c entrées: c r(n): rayons du centre à l'extérieur (Rsol) c m(n): masse(cgs) c vaiss : "vaissala"=1/gamma1 dlnP/dlnR -dln ro/dlnR) c sorties c P0: fondamental mode g c---------------------------------------------------------------- USE mod_donnees, ONLY : gmsol, m_ch, pi, rsol USE mod_kind USE mod_numerique, ONLY : bsp1dn, no_croiss, sum_n USE mod_variables, ONLY: n_qs IMPLICIT NONE REAL (kind=dp), INTENT(in), DIMENSION(n_qs) :: m, r, vaiss REAL (kind=dp), DIMENSION(1,n_qs) :: nsr REAL (kind=dp), DIMENSION(n_qs+m_ch) :: rt REAL (kind=dp), DIMENSION(1) :: x, dx REAL (kind=dp), SAVE :: cte1 INTEGER :: i, knot_p0, l=1 LOGICAL, SAVE :: init=.TRUE. c---------------------------------------------------------------- 2000 FORMAT(8es10.3) c unités pour sortie en minutes IF(init)THEN init=.FALSE. cte1=2.d0*pi**2*SQRT(rsol**5/gmsol)/60.d0/rsol ENDIF c l'intégrant nsr=0.d0 DO i=1,n_qs IF(r(i) > 0.d0 .AND. vaiss(i) > 0.d0)nsr(1,i)=SQRT(m(i)/r(i)**5*vaiss(i)) ENDDO c au centre nsr(1,1)=nsr(1,2) c spline de N/R en fonction de r(Rsol) pour intégration CALL bsp1dn(1,nsr,r,rt,n_qs,m_ch,knot_p0,.FALSE.,r(1),l,x,dx) c initialisation et calcul de l'intégrale sum_n, aux points de rayons r :rsol c l'intégrale doit être un tableau de même dimension que celui de l'intégrant CALL sum_n(1,nsr,rt,m_ch,knot_p0,.FALSE.,r(1),r(n_qs),x) c unités et sorties P0 = 2 pi**2 / SUM 0-->R N/R dR p0=cte1/x(1) RETURN END FUNCTION p0