27 INTEGER :: iecrit=0,iindice, kcrit
30 INTEGER,
PARAMETER ::rspec = SELECTED_REAL_KIND(p=12,r=100),ispec = 8
143 & l_banana_nc,l_pfirsch_nc,l_potato_nc
146 INTEGER,
PRIVATE :: &
150 REAL,
PRIVATE,
SAVE :: &
151 & cden_nc,cpotb_nc,cpotl_nc,errsum
154 REAL,
PRIVATE,
SAVE :: &
155 & petap_nc,pjbbs_nc,pjbex_nc,pjboh_nc
158 INTEGER,
PRIVATE,
SAVE :: &
159 & mf_nc,mi_nc,ms_nc,mz_nc
162 INTEGER,
PRIVATE,
SAVE :: &
166 REAL(KIND=rspec),
PRIVATE,
SAVE,
ALLOCATABLE :: &
167 & vti_nc(:),amntii_nc(:,:), &
168 & calmi_nc(:,:,:),calnii_nc(:,:,:,:), &
169 & capmii_nc(:,:,:,:),capnii_nc(:,:,:,:)
172 REAL(KIND=rspec),
PRIVATE,
SAVE,
ALLOCATABLE :: &
176 INTEGER,
PRIVATE,
SAVE,
ALLOCATABLE :: &
177 & jms_nc(:),jzs_nc(:)
179 REAL(KIND=rspec),
PRIVATE,
SAVE,
ALLOCATABLE :: &
180 & sqzs_nc(:),xis_nc(:),ymus_nc(:,:,:), &
181 & bsjbps_nc(:),bsjbts_nc(:), &
182 & upars_nc(:,:,:),uthetas_nc(:,:,:), &
183 & gfls_nc(:,:),dpss_nc(:,:),dtss_nc(:,:), &
184 & qfls_nc(:,:),chipss_nc(:,:),chitss_nc(:,:), &
189 REAL(KIND=rspec),
PARAMETER :: &
190 z_coulomb=1.6022e-19_rspec, &
191 z_epsilon0=8.8542e-12_rspec, &
192 z_j7kv=1.6022e-16_rspec, &
193 z_pi=3.141592654_rspec, &
194 z_protonmass=1.6726e-27_rspec, &
195 z_electronmass=9.1095e-31_rspec, &
196 z_mu0 = 1.2566e-06_rspec
198 REAL(KIND=rspec),
PRIVATE,
PARAMETER :: &
204 SUBROUTINE nclass(m_i , m_z ,p_b2 , p_bm2 , p_eb, &
205 & p_fhat , p_fm ,p_ft , p_grbm2 , p_grphi, &
206 & p_gr2phi, p_ngrth ,amu_i , grt_i ,temp_i, &
207 & den_iz , fex_iz ,grp_iz ,ipr , iflag, &
208 & l_banana,l_pfirsch,l_potato,k_order, &
209 & c_den,c_potb,c_potl, &
210 & p_etap,p_jbbs,p_jbex,p_jboh, &
213 & gfl_s,dn_s,vnnt_s,vneb_s,vnex_s,dp_ss,dt_ss, &
215 & qfl_s,chi_s,vqnt_s,vqeb_s,vqex_s, &
217 & calm_i,caln_ii,capm_ii,capn_ii,ymu_s, &
343 INTEGER,
INTENT(IN) :: &
346 REAL(KIND=rspec),
INTENT(IN) :: &
347 & p_b2,p_bm2,p_eb,p_fhat,p_fm(:),p_ft,p_grbm2,p_grphi,p_gr2phi, &
349 & amu_i(:),grt_i(:),temp_i(:), &
350 & den_iz(:,:),grp_iz(:,:),fex_iz(:,:,:)
353 INTEGER,
INTENT(OUT) :: &
357 LOGICAL,
INTENT(IN),
OPTIONAL :: &
358 & L_BANANA,L_PFIRSCH,L_POTATO
360 INTEGER,
INTENT(IN),
OPTIONAL :: &
363 REAL(KIND=rspec),
INTENT(IN),
OPTIONAL :: &
364 & C_DEN,C_POTB,C_POTL
367 REAL(KIND=rspec),
INTENT(OUT),
OPTIONAL :: &
368 & P_ETAP,P_JBBS,P_JBEX,P_JBOH
370 INTEGER,
INTENT(OUT),
OPTIONAL :: &
371 & M_S,JM_S(:),JZ_S(:)
373 REAL(KIND=rspec),
INTENT(OUT),
OPTIONAL :: &
374 & BSJBP_S(:),BSJBT_S(:)
376 REAL(KIND=rspec),
INTENT(OUT),
OPTIONAL :: &
377 & DP_SS(:,:),DT_SS(:,:), &
378 & GFL_S(:,:),DN_S(:),VNEB_S(:),VNEX_S(:),VNNT_S(:)
380 REAL(KIND=rspec),
INTENT(OUT),
OPTIONAL :: &
381 & UPAR_S(:,:,:),UTHETA_S(:,:,:)
383 REAL(KIND=rspec),
INTENT(OUT),
OPTIONAL :: &
384 & CHIP_SS(:,:),CHIT_SS(:,:), &
385 & QFL_S(:,:),CHI_S(:),VQEB_S(:),VQEX_S(:),VQNT_S(:)
387 REAL(KIND=rspec),
INTENT(OUT),
OPTIONAL :: &
388 & CAPM_II(:,:,:,:),CAPN_II(:,:,:,:),CALM_I(:,:,:),CALN_II(:,:,:,:)
390 REAL(KIND=rspec),
INTENT(OUT),
OPTIONAL :: &
393 REAL(KIND=rspec),
INTENT(OUT),
OPTIONAL :: &
394 & SQZ_S(:),XI_S(:),TAU_SS(:,:)
400 REAL(KIND=rspec) :: &
403 REAL(KIND=rspec),
ALLOCATABLE :: &
411 if (ipr .le. 10)
then
420 IF(present(k_order))
THEN
422 IF(k_order < 2 .OR. k_order > 3)
THEN
425 write(*,*)
' K_ORDER =',k_order
426 write(*,*)
'NCLASS(1)/ERROR: K_ORDER must be 2 or 3'
444 IF(abs(p_ft) > 0.0_rspec)
THEN
454 IF(present(l_banana) .AND. (.NOT. l_banana)) l_banana_nc=.false.
459 IF(abs(sum(p_fm(:))) > 0.0_rspec)
THEN
471 IF(present(l_pfirsch) .AND. (.NOT. l_pfirsch)) &
472 & l_pfirsch_nc=.false.
476 IF(present(l_potato) .AND. &
477 & present(c_potb) .AND. &
478 & present(c_potl))
THEN
503 IF( (.NOT. l_banana_nc) .AND. (.NOT. l_pfirsch_nc))
THEN
512 IF(present(c_den))
THEN
525 IF((p_ft < 0.0_rspec) .OR. (p_ft > 1.0_rspec))
THEN
528 write(*,*)
'NCLASS(2)/ERROR: must have 0 <= p_ft <= 1'
535 CALL nclass_init(m_i,m_z,amu_i,den_iz,iflag)
541 IF(iflag > 0) goto 9999
550 CALL nclass_mn(amu_i,temp_i)
553 vti_nc(1:mi_nc)=sqrt(2.0_rspec*z_j7kv*temp_i(1:mi_nc) &
554 & /amu_i(1:mi_nc)/z_protonmass)
559 CALL nclass_tau(amu_i,temp_i,den_iz)
562 calmi_nc(:,:,:)=0.0_rspec
572 & sum(amntii_nc(i,1:mi_nc)*capmii_nc(k,l,i,1:mi_nc))
576 calnii_nc(k,l,i,1:mi_nc)= &
577 & amntii_nc(i,1:mi_nc)*capnii_nc(k,l,i,1:mi_nc)
578 if (k .eq. 1 .and. l .lt. 3 .and. i .eq. 1)
then
590 ALLOCATE(denz2(1:(mi_nc+ms_nc)))
598 IF(den_iz(i,iza) > cden_nc)
THEN
600 denz2(i)=denz2(i)+den_iz(i,iza)*iza**2
601 dent=dent+den_iz(i,iza)*temp_i(i)
612 xis_nc(i)=den_iz(jms_nc(i),iza)*
REAL(jzs_nc(i),rspec)**2 &
614 sqzs_nc(i)=1.0_rspec+p_fhat**2/p_b2*amu_i(jms_nc(i)) &
615 & *z_protonmass*p_gr2phi &
616 & /(z_coulomb*REAL(jzs_nc(i),rspec))
617 if(sqzs_nc(i) > 10.0_rspec) sqzs_nc(i)=10.0_rspec
618 IF(sqzs_nc(i) < 0.5_rspec) sqzs_nc(i)=0.5_rspec
625 CALL nclass_mu(p_fm,p_ft,p_ngrth,amu_i,temp_i,den_iz,ipr)
629 grppiz_nc(jms_nc(i),iza)=grp_iz(jms_nc(i),iza) &
630 & +p_grphi*den_iz(jms_nc(i),iza) &
631 & *
REAL(jzs_nc(i),rspec)*z_coulomb/z_j7kv
632 rval = p_grphi*den_iz(jms_nc(i),iza) &
633 & *
REAL(jzs_nc(i),rspec)*z_coulomb/z_j7kv
649 CALL nclass_flow(p_b2,p_bm2,p_eb,p_fhat,p_grbm2,grt_i,temp_i, &
650 & den_iz,fex_iz,iflag,ipr)
657 write(*,*)
'NCLASS(4)/'
658 IF(iflag > 0) goto 9999
673 uthetas_nc(k,l,i)=upars_nc(k,l,i)/p_b2
685 uthetas_nc(k,l,i)=uthetas_nc(k,l,i) &
686 & +p_fhat*grppiz_nc(jms_nc(i),iza)*z_j7kv &
687 & /(z_coulomb*
REAL(jzs_nc(i),rspec) &
688 & *den_iz(jms_nc(i),iza))/p_b2
693 uthetas_nc(k,l,i)=uthetas_nc(k,l,i) &
694 & +p_fhat*z_j7kv*grt_i(jms_nc(i)) &
695 & /(
REAL(jzs_nc(i),rspec)*z_coulomb*p_b2)
700 if (ipr .eq. 1 .and. l .eq. 2)
then
716 IF(present(m_s)) m_s=ms_nc
717 IF(present(jm_s)) jm_s(1:ms_nc)=jms_nc(1:ms_nc)
718 IF(present(jz_s)) jz_s(1:ms_nc)=jzs_nc(1:ms_nc)
721 IF(present(p_etap)) p_etap=petap_nc
723 IF(present(p_jbbs)) p_jbbs=pjbbs_nc
724 IF(present(p_jbex)) p_jbex=pjbex_nc
725 IF(present(p_jboh)) p_jboh=pjboh_nc
726 IF(present(bsjbp_s)) bsjbp_s(1:ms_nc)=bsjbps_nc(1:ms_nc)
727 IF(present(bsjbt_s)) bsjbt_s(1:ms_nc)=bsjbts_nc(1:ms_nc)
730 IF(present(dp_ss)) dp_ss(1:ms_nc,1:ms_nc)=dpss_nc(1:ms_nc,1:ms_nc)
731 IF(present(dt_ss)) dt_ss(1:ms_nc,1:ms_nc)=dtss_nc(1:ms_nc,1:ms_nc)
732 IF(present(gfl_s)) gfl_s(1:5,1:ms_nc)=gfls_nc(1:5,1:ms_nc)
734 IF(present(dn_s))
THEN
744 IF(present(vnnt_s))
THEN
749 vnnt_s(i)=(sum(gfls_nc(1:3,i)) &
750 & +dn_s(i)*(grp_iz(jms_nc(i),iza) &
751 & -den_iz(jms_nc(i),iza)*grt_i(jms_nc(i))) &
752 & /temp_i(jms_nc(i)))/den_iz(jms_nc(i),iza)
758 IF(present(vneb_s))
THEN
763 vneb_s(i)=gfls_nc(4,i)/den_iz(jms_nc(i),iza)
769 IF(present(vnex_s))
THEN
774 vnex_s(i)=gfls_nc(5,i)/den_iz(jms_nc(i),iza)
782 IF(present(upar_s)) upar_s(1:k_order_nc,1:3,1:ms_nc) &
783 & =upars_nc(1:k_order_nc,1:3,1:ms_nc)
784 IF(present(utheta_s)) utheta_s(1:k_order_nc,1:3,1:ms_nc) &
785 & =uthetas_nc(1:k_order_nc,1:3,1:ms_nc)
788 IF(present(qfl_s)) qfl_s(1:5,1:ms_nc)=qfls_nc(1:5,1:ms_nc)
790 IF(present(chi_s))
THEN
794 chi_s(i)=chipss_nc(i,i)+chitss_nc(i,i)
800 IF(present(vqnt_s))
THEN
805 vqnt_s(i)=(sum(qfls_nc(1:3,i))/z_j7kv/den_iz(jms_nc(i),iza) &
806 & +chi_s(i)*grt_i(jms_nc(i)))/temp_i(jms_nc(i))
812 IF(present(vqeb_s))
THEN
817 vqeb_s(i)=qfls_nc(4,i)/den_iz(jms_nc(i),iza)/temp_i(jms_nc(i)) &
824 IF(present(vqex_s))
THEN
829 vqex_s(i)=qfls_nc(5,i)/den_iz(jms_nc(i),iza)/temp_i(jms_nc(i)) &
836 IF(present(chip_ss)) chip_ss(1:ms_nc,1:ms_nc) &
837 & =chipss_nc(1:ms_nc,1:ms_nc)
838 IF(present(chit_ss)) chit_ss(1:ms_nc,1:ms_nc) &
839 & =chitss_nc(1:ms_nc,1:ms_nc)
842 IF(present(calm_i)) &
843 & calm_i(1:k_order_nc,1:k_order_nc,1:mi_nc) &
844 & =calmi_nc(1:k_order_nc,1:k_order_nc,1:mi_nc)
845 IF(present(caln_ii)) &
846 & caln_ii(1:k_order_nc,1:k_order_nc,1:mi_nc,1:mi_nc) &
847 & =calnii_nc(1:k_order_nc,1:k_order_nc,1:mi_nc,1:mi_nc)
848 IF(present(capm_ii)) &
849 & capm_ii(1:k_order_nc,1:k_order_nc,1:mi_nc,1:mi_nc) &
850 & =capmii_nc(1:k_order_nc,1:k_order_nc,1:mi_nc,1:mi_nc)
851 IF(present(capn_ii)) &
852 & capn_ii(1:k_order_nc,1:k_order_nc,1:mi_nc,1:mi_nc) &
853 & =capnii_nc(1:k_order_nc,1:k_order_nc,1:mi_nc,1:mi_nc)
856 IF(present(ymu_s)) ymu_s(1:k_order_nc,1:k_order_nc,1:ms_nc) &
857 & =ymus_nc(1:k_order_nc,1:k_order_nc,1:ms_nc)
860 IF(present(sqz_s)) sqz_s(1:ms_nc)=sqzs_nc(1:ms_nc)
861 IF(present(xi_s)) xi_s(1:ms_nc)=xis_nc(1:ms_nc)
862 IF(present(tau_ss)) tau_ss(1:ms_nc,1:ms_nc) &
863 & =tauss_nc(1:ms_nc,1:ms_nc)
869 SUBROUTINE nclass_flow(p_b2,p_bm2,p_eb,p_fhat,p_grbm2,grt_i, &
870 & temp_i,den_iz,fex_iz,iflag,ipr)
897 REAL(KIND=rspec),
INTENT(IN) :: &
898 & p_b2,p_bm2,p_eb,p_fhat,p_grbm2, &
899 & grt_i(:),temp_i(:),den_iz(:,:),fex_iz(:,:,:)
901 INTEGER,
INTENT(in) :: &
905 INTEGER,
INTENT(OUT) :: &
911 & i,im,iz,iza,j,jm,k,l,l1,m,m1
914 & indxk(1:k_order_nc),indxki(1:k_order_nc*mi_nc)
916 REAL(KIND=rspec) :: &
917 & cbp,cbpa,cbpaq,cc,ccl,ccla,cclaq, cclb,cclbq,cps,cpsa,cpsaq, &
920 REAL(KIND=rspec) :: &
921 & akk(1:k_order_nc,1:k_order_nc), &
922 & xk(1:k_order_nc), &
923 & akiki(1:k_order_nc*mi_nc,1:k_order_nc*mi_nc), &
924 & akikis(1:k_order_nc*mi_nc,1:k_order_nc*mi_nc), &
925 & xki3(1:k_order_nc*mi_nc,3), &
926 & crk6i(1:k_order_nc,6,mi_nc), &
927 & rk6s(1:k_order_nc,6,ms_nc), &
928 & srcth(1:k_order_nc,ms_nc),srcthp(ms_nc),srctht(ms_nc), &
929 & crhatp(1:k_order_nc,ms_nc,mi_nc), &
930 & crhatt(1:k_order_nc,ms_nc,mi_nc), &
931 & rhatp(1:k_order_nc,ms_nc,ms_nc), &
932 & rhatt(1:k_order_nc,ms_nc,ms_nc), &
933 & uaip(1:k_order_nc,ms_nc,ms_nc), &
934 & uait(1:k_order_nc,ms_nc,ms_nc), &
935 & xabp(k_order_nc*mi_nc,ms_nc), &
936 & xabt(k_order_nc*mi_nc,ms_nc)
940 REAL(KIND=rspec) :: &
941 & alp(1:k_order_nc,1:k_order_nc), &
942 & alps(1:k_order_nc,1:k_order_nc), &
943 & vecm(1:k_order_nc), &
944 & alp2(1:k_order_nc*mi_nc,1:k_order_nc*mi_nc), &
945 & alp2s(1:k_order_nc*mi_nc,1:k_order_nc*mi_nc), &
946 & vecm2(1:k_order_nc*mi_nc), &
947 & ama(1:k_order_nc), &
948 & ama2(1:k_order_nc*mi_nc), &
949 & sumdgesv(1:k_order_nc*mi_nc)
950 REAL(KIND=rspec) :: &
951 & ipvt(1:k_order_nc), &
952 & rcond,z(1:k_order_nc)
955 & indl2(1:k_order_nc*mi_nc), &
956 & indl(1:k_order_nc),n,job,lda,ichoix
968 crk6i(:,:,:)=0.0_rspec
969 rk6s(:,:,:)=0.0_rspec
973 crhatp(:,:,:)=0.0_rspec
974 crhatt(:,:,:)=0.0_rspec
975 rhatp(:,:,:)=0.0_rspec
976 rhatt(:,:,:)=0.0_rspec
977 uaip(:,:,:)=0.0_rspec
978 uait(:,:,:)=0.0_rspec
987 gfls_nc(:,:)=0.0_rspec
988 qfls_nc(:,:)=0.0_rspec
991 cc=(p_fhat/z_coulomb)*z_j7kv
992 cbp=p_fhat/p_b2/z_coulomb
993 cps=(p_fhat/z_coulomb)*(1.0/p_b2-p_bm2)
994 ccl=(p_grbm2/z_coulomb)/p_fhat
1008 akk(:,:)=xis_nc(i)*calmi_nc(:,:,im)-ymus_nc(:,:,i)
1026 if (ichoix .eq. 0)
then
1029 rk6s(k,k,i)= xis_nc(i)
1030 alp = xis_nc(i)*calmi_nc(:,:,im)-ymus_nc(:,:,i)
1034 call normalisation(alp,ama,k_order_nc,vecm)
1039 call dgesv(k_order_nc,1,alp,k_order_nc, &
1040 & indl,ama,k_order_nc,iflag)
1050 crk6i(:,k,im)=crk6i(:,k,im)+xis_nc(i)*ama
1057 srcth(1,i)=(cc/iz)*grppiz_nc(im,iza)/den_iz(im,iza)
1058 srcth(2,i)=(cc/iz)*grt_i(im)
1062 rk6s(k,4,i)=sum(srcth(:,i)*ymus_nc(k,:,i))
1066 alp = xis_nc(i)*calmi_nc(:,:,im)-ymus_nc(:,:,i)
1069 call normalisation(alp,ama,k_order_nc,vecm)
1070 call dgesv(k_order_nc,1,alp,k_order_nc, &
1071 & indl,ama,k_order_nc,iflag)
1074 crk6i(:,4,im) = crk6i(:,4,im)+xis_nc(i)*ama
1077 srcthp(i) =-(cc/iz)*temp_i(im)
1078 srctht(i) =-(cc/iz)*temp_i(im)
1079 rhatp(:,i,i) = srcthp(i)*ymus_nc(:,1,i)
1080 rhatt(:,i,i) = srctht(i)*ymus_nc(:,2,i)
1082 alp = xis_nc(i)*calmi_nc(:,:,im)-ymus_nc(:,:,i)
1083 ama = rhatp(1:k_order_nc,i,i)
1084 call normalisation(alp,ama,k_order_nc,vecm)
1085 call dgesv(k_order_nc,1,alp,k_order_nc, &
1086 & indl,ama,k_order_nc,iflag)
1087 rhatp(1:k_order_nc,i,i) = ama
1088 crhatp(:,i,im)=crhatp(:,i,im)+xis_nc(i)*ama
1091 alp = xis_nc(i)*calmi_nc(:,:,im)-ymus_nc(:,:,i)
1092 ama = rhatt(1:k_order_nc,i,i)
1093 call normalisation(alp,ama,k_order_nc,vecm)
1094 call dgesv(k_order_nc,1,alp,k_order_nc, &
1095 & indl,ama,k_order_nc,iflag)
1098 rhatt(1:k_order_nc,i,i) = ama
1099 crhatt(:,i,im)=crhatt(:,i,im)+xis_nc(i)*ama
1102 rk6s(1,5,i) =-iz*z_coulomb*den_iz(im,iza)
1104 alp = xis_nc(i)*calmi_nc(:,:,im)-ymus_nc(:,:,i)
1105 ama = rk6s(1:k_order_nc,5,i)
1106 call normalisation(alp,ama,k_order_nc,vecm)
1107 call dgesv(k_order_nc,1,alp,k_order_nc, &
1108 & indl,ama,k_order_nc,iflag)
1110 crk6i(:,5,im) = crk6i(:,5,im)+xis_nc(i)*ama
1111 rk6s(1:k_order_nc,5,i) = ama
1113 rk6s(1:k_order_nc,6,i)=-fex_iz(1:k_order_nc,im,iza)
1114 alp = xis_nc(i)*calmi_nc(:,:,im)-ymus_nc(:,:,i)
1115 ama = rk6s(1:k_order_nc,6,i)
1116 call normalisation(alp,ama,k_order_nc,vecm)
1117 call dgesv(k_order_nc,1,alp,k_order_nc, &
1118 & indl,ama,k_order_nc,iflag)
1120 rk6s(1:k_order_nc,6,i) = ama
1121 crk6i(:,6,im)=crk6i(:,6,im)+xis_nc(i)*ama
1134 akiki(m1,m1) = 1.0_rspec
1136 xki3(m1,1) = crk6i(m,4,im)
1139 xabp(m1,:) = crhatp(m,:,im)
1140 xabt(m1,:) = crhatt(m,:,im)
1142 xki3(m1,2) = crk6i(m,5,im)
1144 xki3(m1,3) = crk6i(m,6,im)
1156 akiki(m1,l1)=akiki(m1,l1) &
1157 & +sum(calnii_nc(1:k_order_nc,l,im,jm)*crk6i(m,1:k_order_nc,im))
1191 ama2 = xki3(1:k_order_nc*mi_nc,k)
1192 call normalisation(alp2,ama2,k_order_nc*mi_nc,vecm2)
1197 call dgesv(k_order_nc*mi_nc,1,alp2,k_order_nc*mi_nc, &
1198 & indl2,ama2,k_order_nc*mi_nc,iflag)
1200 do l=1,k_order_nc*mi_nc
1202 do j=1,k_order_nc*mi_nc
1203 sumdgesv(l) = sumdgesv(l)+akikis(l,j)*ama2(j)
1206 if (xki3(l,k) /= 0)
then
1207 errsum = abs(sumdgesv(l)-xki3(l,k))/xki3(l,k) + errsum
1212 xki3(1:k_order_nc*mi_nc,k) = ama2
1220 ama2 = xabp(1:k_order_nc*mi_nc,i)
1221 call normalisation(alp2,ama2,k_order_nc*mi_nc,vecm2)
1222 call dgesv(k_order_nc*mi_nc,1,alp2,k_order_nc*mi_nc, &
1223 & indl2,ama2,k_order_nc*mi_nc,iflag)
1224 xabp(1:k_order_nc*mi_nc,i) = ama2
1228 ama2 = xabt(1:k_order_nc*mi_nc,i)
1229 call normalisation(alp2,ama2,k_order_nc*mi_nc,vecm2)
1230 call dgesv(k_order_nc*mi_nc,1,alp2,k_order_nc*mi_nc, &
1231 & indl2,ama2,k_order_nc*mi_nc,iflag)
1232 xabt(1:k_order_nc*mi_nc,i) = ama2
1250 upars_nc(k,m,i)=rk6s(k,5,i)
1254 upars_nc(k,m,i)=rk6s(k,m+3,i)
1268 xk(:)=xk(:)-calnii_nc(1:k_order_nc,l,im,jm)*xki3(l1,m)
1274 upars_nc(:,m,i)=upars_nc(:,m,i)+xk(l)*rk6s(:,l,i)
1285 uaip(:,j,i)=rhatp(:,j,i)
1286 uait(:,j,i)=rhatt(:,j,i)
1296 xk(:)=xk(:)-calnii_nc(1:k_order_nc,l,im,jm)*xabp(l1,j)
1302 uaip(:,j,i)=uaip(:,j,i)+xk(l)*rk6s(:,l,i)
1311 xk(:)=xk(:)-calnii_nc(1:k_order_nc,l,im,jm)*xabt(l1,j)
1317 uait(:,j,i)=uait(:,j,i)+xk(l)*rk6s(:,l,i)
1330 bsjbps_nc(:) = 0.0_rspec
1331 bsjbts_nc(:) = 0.0_rspec
1332 dpss_nc(:,:) = 0.0_rspec
1333 dtss_nc(:,:) = 0.0_rspec
1334 chipss_nc(:,:) = 0.0_rspec
1335 chitss_nc(:,:) = 0.0_rspec
1344 denzc=den_iz(im,iza)*iz*z_coulomb
1345 pjbbs_nc=pjbbs_nc+denzc*upars_nc(1,1,i)
1347 pjboh_nc=pjboh_nc+denzc*upars_nc(1,2,i)
1349 pjbex_nc=pjbex_nc+denzc*upars_nc(1,3,i)
1351 bsjbps_nc(:)=bsjbps_nc(:)+denzc*uaip(1,:,i)
1352 bsjbts_nc(:)=bsjbts_nc(:)+denzc*uait(1,:,i)
1356 cbpaq=cbpa*(z_j7kv*temp_i(im))
1358 dpss_nc(i,i)=dpss_nc(i,i)-cbpa*ymus_nc(1,1,i)*srcthp(i)
1359 dtss_nc(i,i)=dtss_nc(i,i)-cbpa*ymus_nc(1,2,i)*srctht(i)
1360 chipss_nc(i,i)=chipss_nc(i,i)-cbpaq*ymus_nc(2,1,i)*srcthp(i)
1361 chitss_nc(i,i)=chitss_nc(i,i)-cbpaq*ymus_nc(2,2,i)*srctht(i)
1363 gfls_nc(1,i)=gfls_nc(1,i)-cbpa &
1364 & *sum(ymus_nc(1,:,i)*(upars_nc(:,1,i)+srcth(:,i)))
1365 qfls_nc(1,i)=qfls_nc(1,i)-cbpaq &
1366 & *sum(ymus_nc(2,:,i)*(upars_nc(:,1,i)+srcth(:,i)))
1368 gfls_nc(4,i)=gfls_nc(4,i)-cbpa &
1369 & *sum(ymus_nc(1,:,i)*upars_nc(:,2,i))
1370 qfls_nc(4,i)=qfls_nc(4,i)-cbpaq &
1371 & *sum(ymus_nc(2,:,i)*upars_nc(:,2,i))
1375 gfls_nc(5,i)=gfls_nc(5,i)-cbpa &
1376 & *sum(ymus_nc(1,:,i)*upars_nc(:,3,i))
1377 qfls_nc(5,i)=qfls_nc(5,i)-cbpaq &
1378 & *sum(ymus_nc(2,:,i)*upars_nc(:,3,i))
1384 dpss_nc(:,i)=dpss_nc(:,i)-cbpa*ymus_nc(1,k,i)*uaip(k,:,i)
1385 dtss_nc(:,i)=dtss_nc(:,i)-cbpa*ymus_nc(1,k,i)*uait(k,:,i)
1386 chipss_nc(:,i)=chipss_nc(:,i)-cbpaq*ymus_nc(2,k,i)*uaip(k,:,i)
1387 chitss_nc(:,i)=chitss_nc(:,i)-cbpaq*ymus_nc(2,k,i)*uait(k,:,i)
1399 cpsa=cps*(xis_nc(i)/iz)
1400 cpsaq=cpsa*(z_j7kv*temp_i(im))
1401 ccla=ccl*(xis_nc(i)/iz)
1402 cclaq=ccla*(z_j7kv*temp_i(im))
1404 gfls_nc(2,i)=gfls_nc(2,i)-cpsa &
1405 & *sum(calmi_nc(1,:,im)*srcth(:,i))
1406 qfls_nc(2,i)=qfls_nc(2,i)-cpsaq &
1407 & *sum(calmi_nc(2,:,im)*srcth(:,i))
1409 gfls_nc(3,i)=gfls_nc(3,i)+ccla &
1410 & *sum(calmi_nc(1,:,im)*srcth(:,i))
1411 qfls_nc(3,i)=qfls_nc(3,i)+cclaq &
1412 & *sum(calmi_nc(2,:,im)*srcth(:,i))
1414 dpss_nc(i,i)=dpss_nc(i,i)-(cpsa-ccla)*calmi_nc(1,1,im)*srcthp(i)
1415 dtss_nc(i,i)=dtss_nc(i,i)-(cpsa-ccla)*calmi_nc(1,2,im)*srctht(i)
1421 chipss_nc(i,i)=chipss_nc(i,i)-(cpsaq-cclaq)*calmi_nc(2,1,im) &
1423 chitss_nc(i,i)=chitss_nc(i,i)-(cpsaq-cclaq)*calmi_nc(2,2,im) &
1436 cpsbq=cpsb*(z_j7kv*temp_i(im))
1438 cclbq=cclb*(z_j7kv*temp_i(im))
1440 gfls_nc(2,i)=gfls_nc(2,i)-cpsb &
1441 & *sum(calnii_nc(1,1:k_order_nc,im,jm)*srcth(:,j))
1442 qfls_nc(2,i)=qfls_nc(2,i)-cpsbq &
1443 & *sum(calnii_nc(2,1:k_order_nc,im,jm)*srcth(:,j))
1445 gfls_nc(3,i)=gfls_nc(3,i)+cclb &
1446 & *sum(calnii_nc(1,1:k_order_nc,im,jm)*srcth(:,j))
1447 qfls_nc(3,i)=qfls_nc(3,i)+cclbq &
1448 & *sum(calnii_nc(2,1:k_order_nc,im,jm)*srcth(:,j))
1450 dpss_nc(j,i)=dpss_nc(j,i) &
1451 & -(cpsb-cclb)*calnii_nc(1,1,im,jm)*srcthp(j)
1452 dtss_nc(j,i)=dtss_nc(j,i) &
1453 & -(cpsb-cclb)*calnii_nc(1,2,im,jm)*srctht(j)
1454 chipss_nc(j,i)=chipss_nc(j,i) &
1455 & -(cpsbq-cclbq)*calnii_nc(2,1,im,jm)*srcthp(j)
1456 chitss_nc(j,i)=chitss_nc(j,i) &
1457 & -(cpsbq-cclbq)*calnii_nc(2,2,im,jm)*srctht(j)
1464 petap_nc=1.0_rspec/pjboh_nc
1469 pjboh_nc=p_eb*pjboh_nc
1470 upars_nc(:,2,:)=p_eb*upars_nc(:,2,:)
1471 qfls_nc(4,:) = p_eb*qfls_nc(4,:)
1472 gfls_nc(4,:) = p_eb*gfls_nc(4,:)
1481 dpss_nc(:,i)=dpss_nc(:,i)/den_iz(im,iza)
1482 dtss_nc(:,i)=dtss_nc(:,i)/den_iz(im,iza)
1483 chipss_nc(:,i)=chipss_nc(:,i)/den_iz(im,iza)/temp_i(im)/z_j7kv
1484 chitss_nc(:,i)=chitss_nc(:,i)/den_iz(im,iza)/temp_i(im)/z_j7kv
1490 END SUBROUTINE nclass_flow
1492 SUBROUTINE nclass_init(m_i,m_z,amu_i,den_iz,iflag)
1510 INTEGER,
INTENT(IN) :: &
1513 REAL(KIND=rspec),
INTENT(IN) :: &
1518 INTEGER,
INTENT(OUT) :: &
1537 IF(den_iz(i,j) >= cden_nc)
THEN
1540 IF(i > mi_nc) mi_nc=i
1541 IF(j > mz_nc) mz_nc=j
1557 write(*,*)
'NCLASS_INIT(1)/ERROR:m_i must be >= 2'
1558 write(*,*)
'mi_nc =',mi_nc
1567 write(*,*)
'NCLASS_INIT(2)/ERROR:m_z must be >= 1'
1575 IF(
ALLOCATED(calmi_nc))
THEN
1577 nset1=
SIZE(calmi_nc,1)
1578 nset2=
SIZE(calmi_nc,3)
1581 IF(nset1 /= k_order_nc .OR. nset2 /= mi_nc)
THEN
1584 DEALLOCATE(vti_nc, &
1590 ALLOCATE(vti_nc(1:mi_nc), &
1591 & amntii_nc(1:mi_nc,1:mi_nc), &
1592 & calmi_nc(1:k_order_nc,1:k_order_nc,1:mi_nc), &
1593 & calnii_nc(1:k_order_nc,1:k_order_nc,1:mi_nc,1:mi_nc), &
1594 & capmii_nc(1:k_order_nc,1:k_order_nc,1:mi_nc,1:mi_nc), &
1595 & capnii_nc(1:k_order_nc,1:k_order_nc,1:mi_nc,1:mi_nc))
1602 ALLOCATE(vti_nc(1:mi_nc), &
1603 & amntii_nc(1:mi_nc,1:mi_nc), &
1604 & calmi_nc(1:k_order_nc,1:k_order_nc,1:mi_nc), &
1605 & calnii_nc(1:k_order_nc,1:k_order_nc,1:mi_nc,1:mi_nc), &
1606 & capmii_nc(1:k_order_nc,1:k_order_nc,1:mi_nc,1:mi_nc), &
1607 & capnii_nc(1:k_order_nc,1:k_order_nc,1:mi_nc,1:mi_nc))
1614 IF(
ALLOCATED(grppiz_nc))
THEN
1616 nset1=
SIZE(grppiz_nc,1)
1617 nset2=
SIZE(grppiz_nc,2)
1620 IF(nset1 /= mi_nc .OR. nset2 /= mz_nc)
THEN
1623 DEALLOCATE(grppiz_nc)
1624 ALLOCATE(grppiz_nc(1:mi_nc,1:mz_nc))
1631 ALLOCATE(grppiz_nc(1:mi_nc,1:mz_nc))
1638 IF(
ALLOCATED(jms_nc))
THEN
1643 IF(nset1 /= ms_nc)
THEN
1646 DEALLOCATE(jms_nc, &
1660 ALLOCATE(jms_nc(1:ms_nc), &
1661 & jzs_nc(1:ms_nc), &
1662 & sqzs_nc(1:ms_nc), &
1663 & xis_nc(1:ms_nc), &
1664 & bsjbps_nc(1:ms_nc), &
1665 & bsjbts_nc(1:ms_nc), &
1666 & gfls_nc(5,1:ms_nc), &
1667 & dpss_nc(1:ms_nc,1:ms_nc), &
1668 & dtss_nc(1:ms_nc,1:ms_nc), &
1669 & qfls_nc(5,1:ms_nc), &
1670 & chipss_nc(1:ms_nc,1:ms_nc), &
1671 & chitss_nc(1:ms_nc,1:ms_nc), &
1672 & tauss_nc(1:ms_nc,1:ms_nc))
1679 ALLOCATE(jms_nc(1:ms_nc), &
1680 & jzs_nc(1:ms_nc), &
1681 & sqzs_nc(1:ms_nc), &
1682 & xis_nc(1:ms_nc), &
1683 & bsjbps_nc(1:ms_nc), &
1684 & bsjbts_nc(1:ms_nc), &
1685 & gfls_nc(5,1:ms_nc), &
1686 & dpss_nc(1:ms_nc,1:ms_nc), &
1687 & dtss_nc(1:ms_nc,1:ms_nc), &
1688 & qfls_nc(5,1:ms_nc), &
1689 & chipss_nc(1:ms_nc,1:ms_nc), &
1690 & chitss_nc(1:ms_nc,1:ms_nc), &
1691 & tauss_nc(1:ms_nc,1:ms_nc))
1699 IF(
ALLOCATED(ymus_nc))
THEN
1701 nset1=
SIZE(ymus_nc,1)
1702 nset2=
SIZE(ymus_nc,3)
1705 IF(nset1 /= ms_nc .OR. nset2 /= k_order_nc)
THEN
1708 DEALLOCATE(ymus_nc, &
1712 ALLOCATE(ymus_nc(1:k_order_nc,1:k_order_nc,1:ms_nc), &
1713 & upars_nc(1:k_order_nc,1:5,1:ms_nc), &
1714 & uthetas_nc(1:k_order_nc,1:5,1:ms_nc))
1721 ALLOCATE(ymus_nc(1:k_order_nc,1:k_order_nc,1:ms_nc), &
1722 & upars_nc(1:k_order_nc,1:5,1:ms_nc), &
1723 & uthetas_nc(1:k_order_nc,1:5,1:ms_nc))
1737 IF(den_iz(i,j) >= cden_nc)
THEN
1743 IF(amu_i(i) < 0.5)
THEN
1764 END SUBROUTINE nclass_init
1766 SUBROUTINE nclass_k(p_fm,p_ft,p_ngrth,x,amu_i,temp_i,ykb_s,ykp_s, &
1792 REAL(KIND=rspec),
INTENT(IN) :: &
1793 & p_fm(:),p_ft,p_ngrth,x, &
1794 & amu_i(:),temp_i(:)
1797 REAL(KIND=rspec) :: &
1798 & ykb_s(:),ykp_s(:),ykpo_s(:),ykpop_s(:)
1804 REAL(KIND=rspec) :: &
1807 REAL(KIND=rspec) :: &
1808 & ynud_s(ms_nc),ynut_s(ms_nc),ynutis(mf_nc,ms_nc)
1816 ykpop_s(:)=0.0_rspec
1819 CALL nclass_nu(p_ngrth,x,temp_i,ynud_s,ynut_s,ynutis)
1825 c2=3.0_rspec*2.19_rspec/(2.0_rspec**1.5)*x**(1.0/3.0)
1827 IF(l_potato_nc) c3=3.0_rspec*z_pi/(64.0_rspec*2.0_rspec**0.33333) &
1836 IF(l_banana_nc)
THEN
1841 IF(c4 < 1.0e-3_rspec) c4=1.0e-3_rspec
1842 ykb_s(i)=p_ft/c4/sqzs_nc(i)**1.5*ynud_s(i)
1847 IF(l_pfirsch_nc)
THEN
1849 ykp_s(i)=ykp_s(i)+c1*vti_nc(im)**2 &
1850 & *sum(p_fm(:)*ynutis(:,i))/ynut_s(i)
1855 IF(l_potato_nc)
THEN
1857 c4=abs(amu_i(im)*z_protonmass*vti_nc(im) &
1858 & /(iz*z_coulomb*cpotb_nc*cpotl_nc))
1859 ykpo_s(i)=c2*c4**(0.333333_rspec)*ynud_s(i) &
1860 & /sqzs_nc(i)**(1.666667_rspec)
1861 ykpop_s(i)=c3*vti_nc(im)*c4**(1.333333_rspec)
1867 END SUBROUTINE nclass_k
1869 SUBROUTINE nclass_mn(amu_i,temp_i)
1890 REAL(KIND=rspec),
INTENT(IN) :: &
1891 & amu_i(:),temp_i(:)
1897 REAL(KIND=rspec) :: &
1898 & xab,xab2,xmab,xtab,yab32,yab52,yab72,yab92
1908 xmab=amu_i(im)/amu_i(jm)
1910 xtab=temp_i(im)/temp_i(jm)
1915 yab32=(1.0_rspec+xab2)*sqrt(1.0_rspec+xab2)
1916 yab52=(1.0_rspec+xab2)*yab32
1918 IF(k_order_nc == 3)
THEN
1920 yab72=(1.0_rspec+xab2)*yab52
1921 yab92=(1.0_rspec+xab2)*yab72
1927 capmii_nc(1,1,im,jm)=-(1.0_rspec+xmab)/yab32
1929 capmii_nc(1,2,im,jm)=1.5_rspec*(1.0_rspec+xmab)/yab52
1931 capmii_nc(2,1,im,jm)=capmii_nc(1,2,im,jm)
1933 capmii_nc(2,2,im,jm)=-(3.25_rspec+xab2 &
1934 & *(4.0_rspec+7.5_rspec*xab2))/yab52
1936 IF(k_order_nc == 3)
THEN
1939 capmii_nc(1,3,im,jm)=-1.875_rspec*(1.0_rspec+xmab)/yab72
1941 capmii_nc(2,3,im,jm)=(4.3125_rspec+xab2 &
1942 & *(6.0_rspec+15.75_rspec*xab2))/yab72
1944 capmii_nc(3,1,im,jm)=capmii_nc(1,3,im,jm)
1946 capmii_nc(3,2,im,jm)=capmii_nc(2,3,im,jm)
1948 capmii_nc(3,3,im,jm)=-(433.0/64.0+xab2 &
1949 & *(17.0_rspec+xab2 &
1950 & *(57.375_rspec+xab2 &
1951 & *(28.0_rspec+xab2 &
1952 & *21.875_rspec))))/yab92
1958 capnii_nc(1,1,im,jm)=-capmii_nc(1,1,im,jm)
1960 capnii_nc(1,2,im,jm)=-xab2*capmii_nc(1,2,im,jm)
1962 capnii_nc(2,1,im,jm)=-capmii_nc(2,1,im,jm)
1964 capnii_nc(2,2,im,jm)=6.75_rspec*sqrt(xtab)*xab2/yab52
1966 IF(k_order_nc == 3)
THEN
1969 capnii_nc(1,3,im,jm)=-xab2**2*capmii_nc(1,3,im,jm)
1971 capnii_nc(2,3,im,jm)=-14.0625_rspec*xtab*xab2**2/yab72
1973 capnii_nc(3,1,im,jm)=-capmii_nc(3,1,im,jm)
1975 capnii_nc(3,2,im,jm)=-14.0625_rspec*xab2**2/yab72
1977 capnii_nc(3,3,im,jm)=2625.0/64.0*xtab*xab2**2/yab92
1985 END SUBROUTINE nclass_mn
1987 SUBROUTINE nclass_mu(p_fm,p_ft,p_ngrth,amu_i,temp_i,den_iz,ipr)
2008 REAL(KIND=rspec),
INTENT(IN) :: &
2009 & p_ft,p_ngrth,p_fm(:), &
2010 & amu_i(:),temp_i(:), &
2015 INTEGER,
PARAMETER :: &
2018 REAL(KIND=rspec),
PARAMETER :: &
2025 REAL(KIND=rspec),
SAVE :: &
2027 & x(mpnts),w(mpnts,5)
2031 & i,im,iza,k,l,m,ipr
2033 REAL(KIND=rspec) :: &
2034 & c2,ewt,expmx2,x2,x4,x6,x8,x10,x12,xk,xx, &
2036 & ykb_s(ms_nc),ykp_s(ms_nc),ykpo_s(ms_nc),ykpop_s(ms_nc), &
2037 & ymubs(1:k_order_nc,1:k_order_nc,ms_nc), &
2038 & ymubps(1:k_order_nc,1:k_order_nc,ms_nc), &
2039 & ymupps(1:k_order_nc,1:k_order_nc,ms_nc), &
2040 & ymupos(1:k_order_nc,1:k_order_nc,ms_nc)
2070 c1=8.0_rspec/3.0_rspec/sqrt(z_pi)*h
2076 ymus_nc(:,:,:)=0.0_rspec
2077 ymubs(:,:,:)=0.0_rspec
2078 ymubps(:,:,:)=0.0_rspec
2079 ymupos(:,:,:)=0.0_rspec
2080 ymupps(:,:,:)=0.0_rspec
2085 IF(l_banana_nc .OR. l_pfirsch_nc)
THEN
2103 CALL nclass_k(p_fm,p_ft,p_ngrth,xx,amu_i,temp_i,ykb_s,ykp_s, &
2110 c2=c1*ewt*den_iz(im,iza)*amu_i(im)*z_protonmass
2112 dum(2)=c2*(w(m,2)-2.5_rspec*w(m,1))
2113 dum(3)=c2*(w(m,3)-5.0_rspec*w(m,2)+6.25_rspec*w(m,1))
2115 IF(.NOT. l_banana_nc)
THEN
2120 ELSEIF(.NOT. l_pfirsch_nc)
THEN
2128 xk=ykb_s(i)*ykp_s(i)/(ykb_s(i)+ykp_s(i))
2132 ymubs(1,1,i)=ymubs(1,1,i)+ykb_s(i)*dum(1)
2133 ymubs(1,2,i)=ymubs(1,2,i)+ykb_s(i)*dum(2)
2134 ymubs(2,2,i)=ymubs(2,2,i)+ykb_s(i)*dum(3)
2135 ymubps(1,1,i)=ymubps(1,1,i)+xk*dum(1)
2136 ymubps(1,2,i)=ymubps(1,2,i)+xk*dum(2)
2137 ymubps(2,2,i)=ymubps(2,2,i)+xk*dum(3)
2139 IF(l_potato_nc)
THEN
2141 ymupos(1,1,i)=ymupos(1,1,i)+ykpo_s(i)*dum(1)
2142 ymupos(1,2,i)=ymupos(1,2,i)+ykpo_s(i)*dum(2)
2143 ymupos(2,2,i)=ymupos(2,2,i)+ykpo_s(i)*dum(3)
2144 xk=ykpo_s(i)*ykpop_s(i)/(ykpo_s(i)+ykpop_s(i))
2145 ymupps(1,1,i)=ymupps(1,1,i)+xk*dum(1)
2146 ymupps(1,2,i)=ymupps(1,2,i)+xk*dum(2)
2147 ymupps(2,2,i)=ymupps(2,2,i)+xk*dum(3)
2151 IF(k_order_nc == 3)
THEN
2153 dum(1)=c2*(0.5_rspec*w(m,3)-3.5_rspec*w(m,2) &
2154 & +4.375_rspec*w(m,1))
2155 dum(2)=c2*(0.5_rspec*w(m,4)-4.75_rspec*w(m,3) &
2156 & +13.125_rspec*w(m,2)-10.9375_rspec*w(m,1))
2157 dum(3)=c2*(0.25_rspec*w(m,5)-3.5_rspec*w(m,4) &
2158 & +16.625_rspec*w(m,3)-30.625*w(m,2) &
2159 & +(1225.0/64.0)*w(m,1))
2160 ymubs(1,3,i)=ymubs(1,3,i)+ykb_s(i)*dum(1)
2161 ymubs(2,3,i)=ymubs(2,3,i)+ykb_s(i)*dum(2)
2162 ymubs(3,3,i)=ymubs(3,3,i)+ykb_s(i)*dum(3)
2163 xk=ykb_s(i)*ykp_s(i)/(ykb_s(i)+ykp_s(i))
2164 ymubps(1,3,i)=ymubps(1,3,i)+xk*dum(1)
2165 ymubps(2,3,i)=ymubps(2,3,i)+xk*dum(2)
2166 ymubps(3,3,i)=ymubps(3,3,i)+xk*dum(3)
2168 IF(l_potato_nc)
THEN
2170 ymupos(1,3,i)=ymupos(1,3,i)+ykpo_s(i)*dum(1)
2171 ymupos(2,3,i)=ymupos(2,3,i)+ykpo_s(i)*dum(2)
2172 ymupos(3,3,i)=ymupos(3,3,i)+ykpo_s(i)*dum(3)
2173 xk=ykpo_s(i)*ykpop_s(i)/(ykpo_s(i)+ykpop_s(i))
2174 ymupps(1,3,i)=ymupps(1,3,i)+xk*dum(1)
2175 ymupps(2,3,i)=ymupps(2,3,i)+xk*dum(2)
2176 ymupps(3,3,i)=ymupps(3,3,i)+xk*dum(3)
2193 IF(l_potato_nc)
THEN
2196 ymus_nc(k,l,i)=(ymupos(k,l,i)**3*ymupps(k,l,i) &
2197 & +ymubs(k,l,i)**3*ymubps(k,l,i)) &
2198 & /(ymupos(k,l,i)**3+ymubs(k,l,i)**3)
2202 ymus_nc(k,l,i)=ymubps(k,l,i)
2226 ymus_nc(k,l,i)=ymus_nc(l,k,i)
2236 END SUBROUTINE nclass_mu
2238 SUBROUTINE nclass_nu(p_ngrth,x,temp_i,ynud_s,ynut_s,ynutis)
2260 REAL(KIND=rspec),
INTENT(IN) :: &
2265 REAL(KIND=rspec) :: &
2266 & ynud_s(:),ynut_s(:),ynutis(:,:)
2272 REAL(KIND=rspec) :: &
2280 ynutis(:,:)=0.0_rspec
2293 c1=vti_nc(jm)/vti_nc(im)
2296 g=(phi-c2*(2.0_rspec/sqrt(z_pi))*exp(-c2**2)) &
2297 & /(2.0_rspec*c2**2)
2298 ynud_s(i)=ynud_s(i)+(3.0_rspec*sqrt(z_pi)/4.0_rspec) &
2299 & *(phi-g)/x**3/tauss_nc(i,j)
2300 ynut_s(i)=ynut_s(i)+((3.0_rspec*sqrt(z_pi)/4.0_rspec) &
2301 & *((phi-3.0_rspec*g)/x**3 &
2302 & +4.0_rspec*(temp_i(im)/temp_i(jm) &
2303 & +1.0_rspec/c1**2)*g/x))/tauss_nc(i,j)
2310 IF(abs(p_ngrth) > 0.0_rspec)
THEN
2312 c1=x*vti_nc(im)*m*p_ngrth
2313 c2=(ynut_s(i)/c1)**2
2315 IF(c2 > 9.0_rspec)
THEN
2318 ynutis(m,i)=0.4_rspec
2323 c3=ynut_s(i)/c1*atan(c1/ynut_s(i))
2324 ynutis(m,i)=0.5_rspec*c3+c2*(3.0_rspec*(c3-0.5_rspec) &
2325 & +c2*4.5_rspec*(c3-1.0_rspec))
2331 ynutis(m,i)=0.4_rspec
2339 END SUBROUTINE nclass_nu
2341 SUBROUTINE nclass_tau(amu_i,temp_i,den_iz)
2357 REAL(KIND=rspec),
INTENT(IN) :: &
2358 & amu_i(:),temp_i(:), &
2363 & i,im,iz,iza,j,jm,jz,jza
2365 REAL(KIND=rspec) :: &
2372 amntii_nc(:,:)=0.0_rspec
2373 tauss_nc(:,:)=0.0_rspec
2376 cln=37.8_rspec-log(sqrt(den_iz(imel_nc,1))/temp_i(imel_nc))
2381 c1=4.0_rspec/3.0_rspec/sqrt(z_pi)*4.0_rspec*z_pi*cln*(z_coulomb &
2382 & /(4.0_rspec*z_pi*z_epsilon0))**2*(z_coulomb/z_protonmass)**2
2389 c2=(vti_nc(im)**3)*amu_i(im)**2/c1
2390 if (im .eq. 12)
then
2400 tauss_nc(i,j)=c2/iz**2/(den_iz(jm,jza)*jz**2)
2401 amntii_nc(im,jm)=amntii_nc(im,jm)+amu_i(im)*z_protonmass &
2402 & *den_iz(im,iza)/tauss_nc(i,j)
2408 END SUBROUTINE nclass_tau
2410 SUBROUTINE nclass_backsub(a,n,indx,b,ipr)
2434 INTEGER,
INTENT(IN) :: &
2438 REAL(KIND=rspec),
INTENT(IN) :: &
2442 REAL(KIND=rspec),
INTENT(INOUT) :: &
2449 REAL(KIND=rspec) :: &
2473 sumhoul=sumhoul-a(i,j)*b(j)
2478 ELSEIF (sumhoul /= 0.0)
THEN
2507 sumhoul=sumhoul-a(i,j)*b(j)
2522 END SUBROUTINE nclass_backsub
2524 SUBROUTINE nclass_decomp(a,n,indx,d,iflag,ipr)
2547 INTEGER,
INTENT(IN) :: &
2551 REAL(KIND=rspec),
INTENT(INOUT) :: &
2555 INTEGER,
INTENT(OUT) :: &
2559 REAL(KIND=rspec) :: alp(n,n)
2560 REAL(KIND=rspec),
INTENT(OUT) :: &
2567 REAL(KIND=rspec) :: &
2568 & aamax,dum,sumhoul, &
2569 & vv(n),varia,sumhoult,precis,precis2
2587 IF(abs(a(i,j)) > aamax) aamax=abs(a(i,j))
2591 IF(aamax == 0.0_rspec)
THEN
2594 write(*,*)
'NCLASS_DECOMP/ERROR:singular matrix(1)',aamax
2595 print*,
'erreur nclas_decomp'
2600 vv(i)=1.0_rspec/aamax
2611 if (j.eq. 1) goto 20
2619 sumhoul=sumhoul-a(i,k)*a(k,j)
2640 sumhoul=sumhoul-a(i,k)*a(k,j)
2641 varia = varia + a(i,k)*a(k,j)
2644 if (abs(sumhoul) .lt. precis)
then
2645 sumhoul=sign(precis,sumhoul)
2648 if (abs(sumhoul) .lt. precis)
then
2667 dum=vv(i)*abs(sumhoul)
2679 IF((dum >= aamax) .or. (abs(dum-aamax) < precis2))
THEN
2680 if (abs(dum-aamax) < precis2)
then
2718 IF(a(j,j) == 0.0_rspec)
THEN
2721 write(*,*)
'NCLASS_DECOMP/ERROR:singular matrix(2)'
2729 dum=1.0_rspec/a(j,j)
2746 END SUBROUTINE nclass_decomp
2748 FUNCTION nclass_erf(x)
2764 REAL(KIND=rspec),
INTENT(IN) :: &
2768 REAL(KIND=rspec) :: &
2773 REAL(KIND=rspec) :: &
2776 REAL(KIND=rspec),
PARAMETER :: &
2777 c = 0.3275911_rspec, &
2778 a1 = 0.254829592_rspec, &
2779 a2 =-0.284496736_rspec, &
2780 a3 = 1.421413741_rspec, &
2781 a4 =-1.453152027_rspec, &
2782 a5 = 1.061405429_rspec
2787 t = one/(one+c*abs(x))
2788 nclass_erf = sign(one-(a1+(a2+(a3+(a4+a5*t)*t)*t)*t)*t*exp(-x**2),x)
2790 END FUNCTION nclass_erf
2792 SUBROUTINE normalisation(RMAT,B,n,VECM)
2795 REAL(KIND=rspec),
INTENT(INOUT) :: rmat(:,:),b(:)
2797 REAL(KIND=rspec),
INTENT(OUT) :: vecm(:)
2799 INTEGER,
INTENT(in) :: n
2807 if (vecm(k) .le. rmat(k,j)) vecm(k) = rmat(k,j)
2809 rmat(k,:) = rmat(k,:)/vecm(k)
2813 END SUBROUTINE normalisation
2817 SUBROUTINE neo(equilibrium, coreprof, neoclassic)
2824 type(type_neoclassic
),
pointer :: neoclassic(:)
2825 type(type_coreprof
),
pointer :: coreprof(:)
2826 type(type_equilibrium
),
pointer :: equilibrium(:)
2827 type(type_toroidfield
),
pointer :: toroidfield(:)
2828 integer :: nrho,nion,neq
2831 SUBROUTINE neo_calc(equilibrium, coreprof,neoclassic,nrho,neq,nion)
2837 type(type_neoclassic
),
pointer :: neoclassic(:)
2838 type(type_coreprof
),
pointer :: coreprof(:)
2839 type(type_equilibrium
),
pointer :: equilibrium(:)
2840 type(type_toroidfield
),
pointer :: toroidfield(:)
2841 integer :: nrho,nion
2845 nrho=
size(coreprof(1)%te%value)
2846 neq=
size(equilibrium(1)%profiles_1d%rho_tor)
2851 nion=
size(coreprof(1)%ti%value,2)
2852 call
neo_calc(equilibrium, coreprof, neoclassic,nrho,neq,nion)
2856 SUBROUTINE neo_calc(equilibrium,coreprof,neoclassic,nrho,neq,nion)
2868 type(type_neoclassic
),
pointer :: neoclassic(:)
2869 type(type_coreprof
),
pointer :: coreprof(:)
2870 type(type_equilibrium
),
pointer :: equilibrium(:)
2871 type(type_toroidfield
),
pointer :: toroidfield(:)
2874 integer :: num,kboot,kpotato,k_order,kpfirsch
2875 integer :: icharge, kbanana, kmmaj, ksmaj
2876 integer :: m_i, m_z, nspec, ipr
2877 integer :: nrho,neq,nion
2878 integer,
PARAMETER :: mxmi=100, nmaxspec=10,mxmz=100,mxms=100
2879 REAL*8 p_b2, p_bm2, &
2882 & p_grbm2, p_grphi,&
2884 REAL*8 cden,tabtr(1000,200)
2885 real*8 pcharge(nmaxspec),pmasse(nmaxspec)
2886 REAL*8 amu_i(mxmi) , grti(200,mxmi) , &
2887 & tempi(200,mxmi), ztemp(3) , &
2888 & den(200,mxmi) , grden(200,mxmi) , &
2889 & temp_i(mxmi) , grt_i(mxmi)
2890 REAL*8 rhomax, q0, r0, b0, rkappa0, c_potb, c_pot1, xqs
2891 REAL*8 x(nrho), rho(nrho)
2892 REAL*8 psi(nrho) , psidrho(nrho) , r_in(nrho) , r_out(nrho)
2893 REAL*8 xr0_pr(nrho) , rminx_pr(nrho) , p_ft_pr(nrho) , xqs_pr(nrho)
2894 REAL*8 bt0_pr(nrho) , xvpr_pr(nrho) , gph_pr(nrho) , grho2_pr(nrho) , dpsidrho(nrho)
2895 REAL*8 p_b2_pr(nrho) , p_bm2_pr(nrho) , grho_pr(nrho) , p_eb_pr(nrho)
2896 REAL*8 ergrho(nrho) , inter(nrho) , gr2phi(nrho) , xfs_pr(nrho)
2897 REAL*8 force1(nrho) , force2(nrho) , force3(nrho) , p_grbm2_pr(nrho)
2898 REAL*8 xfs , rap(nrho) , gm1(nrho) , gm9(nrho)
2899 REAL*8 den_iz(mxmi,mxmz), fex_iz(3,mxmi,mxmz), &
2901 REAL*8 denz2(mxmi) , vti(mxmi)
2902 REAL*8 pgrp_iz(mxmi,mxmz) , xi(mxmi,mxmz)
2903 REAL*8 amntii(mxmi,mxmi)
2904 REAL*8 tau_ss(mxms,mxms) , ephi(2)
2905 REAL*8 calm_i(3,3,mxmi)
2906 REAL*8 caln_ii(3,3,mxmi,mxmi),capm_ii(3,3,mxmi,mxmi),&
2907 & capn_ii(3,3,mxmi,mxmi)
2908 REAL*8 bsjbp_s(mxms), bsjbt_s(mxms),&
2909 & DN_S(mxms), GFL_S(5,mxms),&
2910 & QFL_S(5,mxms), SQZ_S(mxms),&
2911 & UPAR_S(3,3,mxms), UTHETA_S(3,3,mxms),&
2912 & VNNT_S(mxms), VNEB_S(mxms),&
2913 & VNEX_S(mxms), VQEB_S(mxms),&
2914 & VQNT_S(mxms), VQEX_S(mxms),&
2916 & qebs(mxms), XI_S(mxms),&
2918 REAL*8 chip_ss(mxms,mxms), chit_ss(mxms,mxms),&
2919 & DP_SS(mxms,mxms), DT_SS(mxms,mxms)
2920 REAL*8 ni(200),xr0,xeps
2921 integer :: jm_s(mxms),jz_s(mxms)
2922 logical :: l_banana,l_pfirsch,l_potato
2923 real*8 :: c_potl,p_etap, p_jbbs, p_jbex, p_jboh,c_den,rminx
2924 real*8 :: bt0,dencut,dent,xbeta,xdelp,xvpr,ab,xgph,eps2,b,a,c,xm
2925 real*8 :: dentot, chitp, vconv,etatemp(4)
2927 integer :: itp1,i,ia,ima,ki,kspec,iza,iflag,j,indsave
2931 allocate(neoclassic(1))
2932 neoclassic(itp1)%time=coreprof(itp1)%time
2933 allocate(neoclassic(itp1)%rho_tor(nrho))
2934 allocate(neoclassic(itp1)%rho_tor_norm(nrho))
2935 allocate(neoclassic(itp1)%jboot(nrho))
2936 allocate(neoclassic(itp1)%sigma(nrho))
2937 allocate(neoclassic(itp1)%te_neo%flux(nrho))
2938 allocate(neoclassic(itp1)%ti_neo%flux(nrho,nion))
2939 allocate(neoclassic(itp1)%ne_neo%flux(nrho))
2940 allocate(neoclassic(itp1)%ni_neo%flux(nrho,nion))
2941 allocate(neoclassic(itp1)%te_neo%diff_eff(nrho))
2942 allocate(neoclassic(itp1)%ti_neo%diff_eff(nrho,nion))
2943 allocate(neoclassic(itp1)%ne_neo%diff_eff(nrho))
2944 allocate(neoclassic(itp1)%ni_neo%diff_eff(nrho,nion))
2945 allocate(neoclassic(itp1)%te_neo%vconv_eff(nrho))
2946 allocate(neoclassic(itp1)%ti_neo%vconv_eff(nrho,nion))
2947 allocate(neoclassic(itp1)%ne_neo%vconv_eff(nrho))
2948 allocate(neoclassic(itp1)%ni_neo%vconv_eff(nrho,nion))
2955 pmasse(2:nspec) = coreprof(itp1)%composition%amn
2957 pcharge(2:nspec) = coreprof(itp1)%composition%zn
3006 icharge = nint(pcharge(i))
3007 IF (icharge.gt.m_z) m_z = icharge
3009 amu_i(1) = z_electronmass/z_protonmass
3011 amu_i(i) = pmasse(i)
3025 rho(1:nrho) = coreprof(1)%rho_tor
3027 x(1:nrho) = rho/rhomax
3032 tempi(1:nrho,1) = coreprof(itp1)%te%value(1:nrho)/1000.0
3034 tempi(1:nrho,kspec) = coreprof(itp1)%ti%value(:,kspec-1)/1000.0
3036 den(1:nrho,1) = coreprof(itp1)%ne%value
3039 den(1:nrho,kspec) = coreprof(itp1)%ni%value(:,kspec-1)
3040 ni(:) = ni(:) + den(:,kspec)
3058 CALL
l3interp(equilibrium(1)%profiles_1d%psi, equilibrium(1)%profiles_1d%rho_tor,
size(equilibrium(1)%profiles_1d%rho_tor), &
3064 CALL
l3interp(equilibrium(1)%profiles_1d%r_inboard, equilibrium(1)%profiles_1d%rho_tor,
size(equilibrium(1)%profiles_1d%rho_tor), &
3068 CALL
l3interp(equilibrium(1)%profiles_1d%r_outboard, equilibrium(1)%profiles_1d%rho_tor,
size(equilibrium(1)%profiles_1d%rho_tor), &
3070 xr0_pr = (r_out+r_in)/2
3074 rminx_pr(1:nrho) = rho(1:nrho)
3077 CALL
l3interp(equilibrium(1)%profiles_1d%ftrap, equilibrium(1)%profiles_1d%rho_tor,
size(equilibrium(1)%profiles_1d%rho_tor), &
3082 CALL
l3interp(equilibrium(1)%profiles_1d%q, equilibrium(1)%profiles_1d%rho_tor,
size(equilibrium(1)%profiles_1d%rho_tor), &
3088 CALL
l3interp(equilibrium(1)%profiles_1d%dpsidrho_tor, equilibrium(1)%profiles_1d%rho_tor,
size(equilibrium(1)%profiles_1d%rho_tor), &
3089 dpsidrho, rho, nrho)
3091 CALL
l3interp(equilibrium(1)%profiles_1d%vprime, equilibrium(1)%profiles_1d%rho_tor,
size(equilibrium(1)%profiles_1d%rho_tor), &
3093 xvpr_pr = xvpr_pr * dpsidrho * rho(nrho)
3098 CALL
l3interp(equilibrium(1)%profiles_1d%gm1, equilibrium(1)%profiles_1d%rho_tor,
size(equilibrium(1)%profiles_1d%rho_tor), &
3102 CALL
l3interp(equilibrium(1)%profiles_1d%gm9, equilibrium(1)%profiles_1d%rho_tor,
size(equilibrium(1)%profiles_1d%rho_tor), &
3106 CALL
l3interp(equilibrium(1)%profiles_1d%F_dia * gm1 / gm9, equilibrium(1)%profiles_1d%rho_tor,
size(equilibrium(1)%profiles_1d%rho_tor), &
3108 r0 = equilibrium(1)%eqgeometry%geom_axis%r
3109 b0 = coreprof(itp1)%toroid_field%b0
3111 gph_pr(1:nrho) = gm1(1:nrho) * rhomax * xvpr_pr
3114 CALL
l3interp(equilibrium(1)%profiles_1d%gm3, equilibrium(1)%profiles_1d%rho_tor,
size(equilibrium(1)%profiles_1d%rho_tor), &
3115 grho2_pr, rho, nrho)
3118 CALL
l3interp(equilibrium(1)%profiles_1d%gm5, equilibrium(1)%profiles_1d%rho_tor,
size(equilibrium(1)%profiles_1d%rho_tor), &
3122 CALL
l3interp(equilibrium(1)%profiles_1d%gm4, equilibrium(1)%profiles_1d%rho_tor,
size(equilibrium(1)%profiles_1d%rho_tor), &
3123 p_bm2_pr, rho, nrho)
3126 CALL
l3interp(equilibrium(1)%profiles_1d%gm6, equilibrium(1)%profiles_1d%rho_tor,
size(equilibrium(1)%profiles_1d%rho_tor), &
3127 p_grbm2_pr, rho, nrho)
3130 CALL
l3interp(equilibrium(1)%profiles_1d%gm7, equilibrium(1)%profiles_1d%rho_tor,
size(equilibrium(1)%profiles_1d%rho_tor), &
3132 rkappa0 = equilibrium(1)%eqgeometry%elongation
3133 write(*,*)
'rkappa0 = ', rkappa0
3134 p_eb_pr(1:nrho) = coreprof(itp1)%profiles1d%eparallel%value
3136 p_eb_pr = p_eb_pr * b0
3137 c_potb = rkappa0*bt0/2/q0/q0
3144 inter(2:nrho) = -ergrho(2:nrho) / psidrho(2:nrho)
3148 gr2phi = psidrho * gr2phi
3166 xfs_pr = 2.0*z_pi*xr0_pr*bt0_pr/z_mu0
3177 fex_iz(1,kmmaj,ksmaj) = force1(ipr)
3178 fex_iz(2,kmmaj,ksmaj) = force2(ipr)
3179 fex_iz(3,kmmaj,ksmaj) = force3(ipr)
3182 rminx = rminx_pr(ipr)
3184 if (ipr .eq. 4)
then
3191 xdelp = xvpr_pr(ipr)
3195 p_bm2 = p_bm2_pr(ipr)
3198 xgph = gph_pr(ipr)/4/z_pi/z_pi
3202 den_iz(ima,ia) = dencut
3206 icharge = nint(pcharge(ima))
3207 den_iz(ima,icharge) = den(ipr,ima)
3214 den_iz(1,1) = den_iz(1,1)+float(ia)*den_iz(ima,ia)
3215 denz2(ima) = denz2(ima)+den_iz(ima,ia)&
3217 dent = dent+den_iz(ima,ia)*tempi(ipr,ima)
3220 denz2(1) = den_iz(1,1)
3221 dent = dent+den_iz(1,1)*tempi(ipr,1)
3222 xbeta = dent*z_j7kv/(bt0**2/2.0/z_mu0)
3225 xi(ima,ia) = den_iz(ima,ia)*float(ia)**2&
3227 IF(den_iz(ima,ia).eq.0)
THEN
3230 grp_iz(ima,ia) = grti(ipr,ima)*den_iz(ima,ia)&
3231 & +tempi(ipr,ima)*grden(ipr,ima)
3235 if (xgph .eq. 0)
then
3239 p_grbm2 = p_grbm2_pr(ipr)
3241 c_potb = rkappa0*bt0/2/q0/q0
3247 p_ngrth = (xeps/(xqs*xr0))**2/2.0
3251 ELSEIF(kboot.eq.2)
then
3256 p_fm(1) = xqs*xr0/xeps**1.5
3261 p_ngrth = 1.0/(xqs*xr0)
3265 IF (xeps.gt.0.0)
THEN
3269 c = (b**3.0)*(xqs*xr0)**2
3272 p_fm(m) = xm*a**(2.0*xm)*(1.0+xm*b)/c
3282 IF(den_iz(ima,iza).gt.c_den)
THEN
3288 IF(amu_i(ima).lt.0.5)
THEN
3300 vti(ima) = sqrt(2.0*z_j7kv*tempi(ipr,ima)&
3301 & / amu_i(ima)/z_protonmass)
3302 temp_i(ima) = tempi(ipr,ima)
3303 grt_i(ima) = grti(ipr,ima)
3305 if (kbanana .ne. 0)
then
3310 if (kpotato .ne. 0)
then
3315 if (kpfirsch .ne. 0)
then
3320 if (ipr .eq. 4)
then
3330 CALL
nclass( m_i , m_z , p_b2 , p_bm2 , p_eb, &
3331 & p_fhat , p_fm , p_ft , p_grbm2 , p_grphi, &
3332 & p_gr2phi , p_ngrth , amu_i , grt_i , temp_i, &
3333 & den_iz , fex_iz , grp_iz , ipr , iflag, &
3334 & l_banana , l_pfirsch , l_potato , k_order , c_den, &
3335 & c_potb , c_potl , p_etap , p_jbbs , p_jbex, &
3336 & p_jboh , m_s , jm_s , jz_s , bsjbp_s, &
3337 & bsjbt_s , gfl_s , dn_s , vnnt_s , vneb_s, &
3338 & vnex_s , dp_ss , dt_ss , upar_s , utheta_s, &
3339 & qfl_s , chi_s , vqnt_s , vqeb_s , vqex_s, &
3340 & chip_ss , chit_ss , calm_i , caln_ii , capm_ii, &
3341 & capn_ii , ymu_s , sqz_s , xi_s , tau_ss)
3344 neoclassic(itp1)%rho_tor = rho
3345 neoclassic(itp1)%rho_tor_norm = x
3353 tabtr(1,ipr) = p_jbbs
3354 neoclassic(itp1)%jboot(ipr) = p_jbbs / b0
3360 tabtr(2,ipr) = bsjbp_s(1)
3361 tabtr(3,ipr) = bsjbp_s(2)
3362 tabtr(4,ipr) = bsjbp_s(3)
3367 tabtr(5,ipr) = bsjbt_s(1)
3368 tabtr(6,ipr) = bsjbt_s(2)
3369 tabtr(7,ipr) = bsjbt_s(3)
3373 tabtr(8,ipr) = p_jbex
3377 tabtr(9,ipr) = p_etap
3378 neoclassic(itp1)%sigma(ipr) = 1.0 / p_etap
3392 tabtr(10,ipr) = 0.0d0
3393 tabtr(11,ipr) = 0.0d0
3394 tabtr(12,ipr) = 0.0d0
3395 tabtr(13,ipr) = 0.0d0
3403 tabtr(10,ipr) = tabtr(10,ipr)+qfl_s(j,1)
3404 tabtr(12,ipr) = tabtr(12,ipr)+gfl_s(j,1)
3409 tabtr(11,ipr) = tabtr(11,ipr)+qfl_s(j,ima)
3410 tabtr(13,ipr) = tabtr(13,ipr)+gfl_s(j,ima)
3414 neoclassic(itp1)%te_neo%flux(ipr) = tabtr(10,ipr) * rhomax / grho2_pr(ipr)
3416 neoclassic(itp1)%ne_neo%flux(ipr) = tabtr(12,ipr) * rhomax / grho2_pr(ipr)
3419 neoclassic(itp1)%ti_neo%flux(ipr,ima-1) = 0.0d0
3420 neoclassic(itp1)%ni_neo%flux(ipr,ima-1) = 0.0d0
3422 neoclassic(itp1)%ti_neo%flux(ipr,ima-1)=neoclassic(itp1)%ti_neo%flux(ipr,ima-1) + qfl_s(j,ima) * rhomax / grho2_pr(ipr)
3423 neoclassic(itp1)%ni_neo%flux(ipr,ima-1)=neoclassic(itp1)%ni_neo%flux(ipr,ima-1) + gfl_s(j,ima) * rhomax / grho2_pr(ipr)
3441 tabtr(14,ipr) = dn_s(1)
3443 neoclassic(itp1)%ne_neo%diff_eff(ipr) = tabtr(14,ipr) * rhomax ** 2 / grho2_pr(ipr)
3445 tabtr(15,ipr) = vnnt_s(1)+vneb_s(1)+gfl_s(5,1)/den(ipr,1)&
3448 neoclassic(itp1)%ne_neo%vconv_eff(ipr) = - tabtr(15,ipr) * rhomax / grho2_pr(ipr)
3450 tabtr(16,ipr) = chit_ss(1,1) + chip_ss(1,1)
3452 neoclassic(itp1)%te_neo%diff_eff(ipr) = tabtr(16,ipr) * rhomax**2 / grho2_pr(ipr) * den(ipr,1)
3454 neoclassic(itp1)%te_neo%diff_eff(ipr) = tabtr(16,ipr) * rhomax**2 / grho2_pr(ipr)
3456 tabtr(17,ipr) = tabtr(10,ipr)/&
3457 & (den_iz(1,1)*temp_i(1)*z_j7kv)+&
3458 & tabtr(16,ipr)*grt_i(1)/temp_i(1)
3460 neoclassic(itp1)%te_neo%vconv_eff(ipr) = - tabtr(17,ipr) * rhomax / grho2_pr(ipr)
3465 chitp = chit_ss(ima,ima)+chip_ss(ima,ima)
3466 tabtr(18,ipr) = tabtr(18,ipr)+&
3469 vconv = tabtr(11,ipr)/(den(ipr,ima)*temp_i(ima)*z_j7kv)+chitp*grt_i(2)/temp_i(2)
3471 neoclassic(itp1)%ti_neo%diff_eff(ipr,ima-1) = chitp*rhomax**2.0/grho2_pr(ipr)
3472 neoclassic(itp1)%ti_neo%vconv_eff(ipr,ima-1) = - vconv * rhomax / grho2_pr(ipr)
3474 dentot = dentot+den(ipr,ima)
3476 tabtr(18,ipr) = tabtr(18,ipr)/dentot
3477 tabtr(19,ipr) = tabtr(11,ipr)/&
3478 & (dentot*temp_i(2)*z_j7kv)+&
3479 & tabtr(18,ipr)*grt_i(2)/temp_i(2)
3481 tabtr(20,ipr) = dentot
3482 tabtr(21,ipr) = temp_i(2)
3483 tabtr(22,ipr) = grt_i(2)
3485 tabtr(23,ipr) = temp_i(1)
3486 tabtr(24,ipr) = den_iz(1,1)
3487 tabtr(25,ipr) = grt_i(1)
3491 tabtr(26,ipr) = p_jboh
3501 tabtr(indsave+m,ipr) = upar_s(1,1,m) + upar_s(1,2,m) &
3505 indsave = indsave + m_i
3514 tabtr(indsave+m,ipr) = utheta_s(1,1,m) + utheta_s(1,2,m)&
3516 if (ipr .eq. 1)
then
3521 indsave = indsave + m_i
3526 tabtr(indsave+m,ipr) = dn_s(m)
3527 neoclassic(itp1)%ni_neo%diff_eff(ipr,m-1) = dn_s(m) * rhomax ** 2 / grho2_pr(ipr)
3532 indsave = indsave + m_i -1
3534 tabtr(indsave+m,ipr) = vnnt_s(m)+vneb_s(m)+&
3535 & gfl_s(5,m)/den(ipr,m)+vnex_s(m)
3536 neoclassic(itp1)%ni_neo%vconv_eff(ipr,m-1) = - tabtr(indsave+m,ipr) * rhomax / grho2_pr(ipr)
3543 etatemp(2:4) = 1.0_8/neoclassic(itp1)%sigma(2:4)
3546 neoclassic(itp1)%sigma(1) = 1.0_8/etatemp(1)
3547 neoclassic(itp1)%jboot(1) = 0.0_8
subroutine nclass(m_i, m_z, p_b2, p_bm2, p_eb, p_fhat, p_fm, p_ft, p_grbm2, p_grphi, p_gr2phi, p_ngrth, amu_i, grt_i, temp_i, den_iz, fex_iz, grp_iz, ipr, iflag, L_BANANA, L_PFIRSCH, L_POTATO, K_ORDER, C_DEN, C_POTB, C_POTL, P_ETAP, P_JBBS, P_JBEX, P_JBOH, M_S, JM_S, JZ_S, BSJBP_S, BSJBT_S, GFL_S, DN_S, VNNT_S, VNEB_S, VNEX_S, DP_SS, DT_SS, UPAR_S, UTHETA_S, QFL_S, CHI_S, VQNT_S, VQEB_S, VQEX_S, CHIP_SS, CHIT_SS, CALM_I, CALN_II, CAPM_II, CAPN_II, YMU_S, SQZ_S, XI_S, TAU_SS)
subroutine neo_calc(equilibrium, coreprof, neoclassic, nrho, neq, nion)
NCLASS-Calculates NeoCLASSical transport properties
subroutine l3interp(y_in, x_in, nr_in, y_out, x_out, nr_out)
subroutine cos_zconversion(e, nbrho)
For REAL variables: Use p=6, r=35 for single precision on 32 bit machine Use p=12,r=100 for double precision on 32 bit machine for single precision on 64 bit machine Parameters for SELECTED_REAL_KIND: p -number of digits r -range of exponent from -r to r
subroutine neo(equilibrium, coreprof, neoclassic)
subroutine cos_rpdederive(dydx, K, x, y, c0, c1, d, o)