├── .github └── workflows │ └── ci-ubuntu.yml ├── .gitignore ├── 00_Genray_Regression_Tests ├── EC_ITER_Central_CD.png ├── EC_ITER_Central_CD.ps ├── ECcone_optimal.dat ├── ECcone_optimal.dat_test10.1 ├── Prater_NF2008_Fig12+ADJ.odp ├── Prater_NF2008_Fig12.pdf ├── Prater_NF2008_Fig12.png ├── README ├── README_genray ├── Scen4_bn2.57_129x129 ├── ci-tests │ ├── .cleanrun.sh.swp │ ├── cleanrun.sh │ ├── test-CMod-LH-edge-id16 │ │ ├── g1060728011.01100 │ │ ├── genray.in │ │ └── gold-genray.nc │ ├── test-CMod-LH-edge │ │ ├── g1060728011.01100 │ │ ├── genray.in │ │ └── gold-genray.nc │ ├── test-EC-ITER-Centra-CD │ │ ├── equilib.dat │ │ ├── genray.dat │ │ └── gold-genray.nc │ └── test.sh ├── cur_den_test7.ps ├── delpwr.bin_test9 ├── dens.bin ├── drawdelpwr_lsc.in ├── drawem.in ├── drawfreqelec.in ├── drawgenr.in ├── drawonet1.in ├── drawonet2.in ├── emis.bin_113544.00325_mod ├── emis.bin_SS_Xmode_180_emission ├── emis.bin_test1 ├── emis.bin_test3 ├── eqdsk_MAST-like ├── equilib.dat ├── equilib.dat_EC_ITER_Central_CD ├── equilib.dat_HPRT_test_case_061219 ├── g1060728011.01100 ├── g106270.02500 ├── g113544.00325_mod ├── g521022.01000 ├── genray.bin_105830p193r1.bob ├── genray.bin_113544.00325_mod ├── genray.bin_CANONICAL_2004_ITER_TEST_one_ray ├── genray.bin_CMod_LH_edge ├── genray.bin_SS_Xmode_180_emission ├── genray.bin_id10iabsorp1 ├── genray.bin_shot106270 ├── genray.bin_test1 ├── genray.bin_test10 ├── genray.bin_test2 ├── genray.bin_test3 ├── genray.bin_test4.1 ├── genray.bin_test5 ├── genray.bin_test5.1 ├── genray.bin_test6 ├── genray.bin_test7 ├── genray.bin_test7_edge_dens_rz ├── genray.bin_test9 ├── genray.dat_113544.00325_mod ├── genray.dat_CANONICAL_2004_ITER_TEST_one_ray ├── genray.dat_EC_ITER_Central_CD ├── genray.dat_EC_ITER_Central_CD_ieffic3 ├── genray.dat_EC_ITER_Central_CD_ieffic4 ├── genray.dat_EC_ITER_Central_CD_ieffic4_mom_cons ├── genray.dat_EC_ITER_Central_CD_ieffic6 ├── genray.dat_GT_PoP2005_i_ox=1.1 ├── genray.dat_GT_PoP2005_i_ox=1.1_updtd ├── genray.dat_GT_PoP2005_id6_i_ox2_090720 ├── genray.dat_HPRT_test_case_061219 ├── genray.dat_SS_Xmode_180_emission ├── genray.dat_id10iabsorp1 ├── genray.dat_shot106270_multi_ray_multi_cone ├── genray.in_CMod_LH_edge ├── genray.in_CMod_LH_edge_LSC ├── genray.in_CMod_LH_edge_id16 ├── genray.in_i_edge_dens_rz_mesh=1 ├── genray.in_i_edge_dens_rz_mesh=2 ├── genray.in_test10 ├── genray.in_test10.1 ├── genray.in_test7_ec ├── idl_105830p193r1.bob_GR030417.4_gr061120.ps ├── idl_emission_spectrum_colorbar.pro ├── log_tests ├── onetwo1.bin_EC_ITER_Central_CD ├── onetwo1.bin_test7 ├── onetwo1.bin_test7.1 ├── pwr_den_test7.ps ├── tests ├── tests.sh ├── testsG.sh ├── tests_genray ├── xdraw.ini ├── xdraw_em_SS_Xmode_180_emission.ps ├── xdraw_genr_SS_Xmode_180_emission.ps ├── xdraw_genr_test7_rays.pdf ├── xdraw_genr_test7_rays.ps └── zrn.dat ├── Brief_genray_use_outline ├── CRAY_pgplot.txt ├── CTestConfig.cmake ├── CTestCustom.cmake ├── CTestTestfile.cmake ├── LICENSE ├── README ├── README.ubuntu-18.04.md ├── README_genray_devel ├── README_genray_overview ├── README_git ├── README_test ├── a_change.i ├── abc.f ├── abhay_disp.f ├── absorpfw.f ├── absorplh.f ├── absorplh1.f ├── adj.i ├── adj_control.f ├── adj_nml.i ├── adj_no_nml.i ├── adj_orbit.f ├── adj_prof.i ├── adj_real8.f ├── adj_sub.f ├── adj_vmlibpr.f ├── antenna.i ├── arrays.f ├── b.f ├── bcast.f ├── besk.f ├── besk2as.f ├── bess_slatec.f ├── bessel.f ├── besvec.f ├── bound.f ├── bripplb.i ├── cefield.i ├── chamber_wall.f ├── cn.f ├── cninit.f ├── cnpermuz.f ├── coldm.f ├── combine_disp.f ├── commons.i ├── complx.f ├── cone.i ├── cone_ec.f ├── cone_nml.i ├── cone_no_nml.i ├── config_ext.f90 ├── const_and_precisions.f90 ├── contour.f ├── cori_batchscript_mpi ├── cori_batchscript_mpi_gnu ├── croot.f ├── curba.f ├── curba_GA.f ├── dcom16.f ├── dddrz1.f ├── dense.f ├── dense_new.f ├── dinit.f ├── dinit.f.new ├── dinit_nml.i ├── distn.f ├── dmnf.f ├── dskin.f ├── dskin.i ├── dten16.f ├── dxdphi.f ├── dxdr.f ├── dxdz.f ├── dxrz.f ├── dydphi.f ├── dydr.f ├── dydz.f ├── edge_prof.i ├── edge_prof_nml.i ├── edge_prof_no_nml.i ├── efield.f ├── efield1.f ├── emissa.f ├── emissa.i ├── emissa_nml.i ├── emissa_no_nml.i ├── emission.diff_DM ├── emission.f ├── emission.for_DM ├── emission_spectrum.f ├── eps.i ├── equilib.f ├── equilib.f_genray ├── eric_disp.f ├── eric_disp.f_orig ├── five.i ├── flown.f ├── fokker.f ├── forest.f ├── forest_080829.f ├── fourb.i ├── fourb_t.i ├── gamma.f ├── genray.f ├── genray.f_hopper ├── genray.f_to_100507 ├── genray_help ├── genray_par.f_hopper ├── genray_plots.py ├── genray_plots.py_to_170714 ├── genray_plots_200816.py ├── genray_plots_Yang_TAE_Mac.py ├── genray_templates_archive ├── genray.dat_template_to_090130 ├── genray.dat_template_to_090406 ├── genray.dat_template_to_090505 ├── genray.dat_template_to_090901 ├── genray.dat_template_to_091220 ├── genray.dat_template_to_110503 ├── genray.dat_template_to_111011 ├── genray.dat_template_to_111031 ├── genray.dat_template_to_120401 ├── genray.dat_template_to_140701 ├── genray.dat_template_to_140801 ├── genray.dat_template_to_151018 ├── genray.dat_template_to_180402 ├── genray.dat_template_to_180518 ├── genray.dat_template_to_180529 ├── genray.in_template_MKSA_090130 ├── genray.in_template_MKSA_090406 ├── genray.in_template_MKSA_090505 ├── genray.in_template_MKSA_090901 ├── genray.in_template_MKSA_091220 ├── genray.in_template_MKSA_110503 ├── genray.in_template_MKSA_111011 ├── genray.in_template_MKSA_111031 ├── genray.in_template_MKSA_111031_nb ├── genray.in_template_MKSA_120401 ├── genray.in_template_MKSA_140701 ├── genray.in_template_MKSA_140801 ├── genray.in_template_MKSA_151018 ├── genray.in_template_MKSA_180402 ├── genray.in_template_MKSA_180518 ├── genray.in_template_MKSA_180529 └── genray.in_template_MKSA_191207 ├── globcd.h ├── globcd1.h ├── globcd2.h ├── gr.i ├── gr2new.f ├── gr3.f ├── gradient.f ├── green_func_ext.f90 ├── grep_eccone ├── grep_grill ├── grill.i ├── grill_lh.f ├── grill_lh.f_151110 ├── grill_nml.i ├── grill_no_nml.i ├── hamilmuz.f ├── hamilt1.f ├── hamilt_lambda.f ├── intel-module_portal_pppl.csh ├── intel-mpi-module_portal_pppl.csh ├── intinit.f ├── ions.i ├── ions_nml.i ├── kind_spec.f90 ├── lh_bonoli_disp.f ├── lh_ql_flux.f ├── lh_scattering.f ├── limit.i ├── limiter.f ├── lin_liu_curnt.f ├── loopb.i ├── lsc_approach.f ├── lsc_approach.i ├── lsc_approach_nml.i ├── lsc_approach_no_nml.i ├── make_archive ├── cori_batchscript_mpi ├── makefile ├── makefile_ericnm ├── makefile_franklin_pathscale ├── makefile_franklin_pgi ├── makefile_g95 ├── makefile_g95_czech_cql ├── makefile_g95_czech_genray ├── makefile_gfortran.CentOS ├── makefile_gfortran64 ├── makefile_gfortran64.bob9 ├── makefile_gfortran64.bob9.CentOS ├── makefile_gfortran64.edison ├── makefile_gfortran64_Yang_TAE_Mac ├── makefile_gfortran64_Yang_TAE_laptop ├── makefile_gfortran64_bound_check_1 ├── makefile_gfortran64_crpppc70 ├── makefile_gfortran64_czech ├── makefile_gfortran64_debug ├── makefile_gfortran64_debug_BOUND_CHECK ├── makefile_gfortran64_debug_BOUND_CHECK.CentOS ├── makefile_gfortran64_debug_BOUND_CHECK_Kumar ├── makefile_gfortran64_debug_BOUND_CHECK_read_write ├── makefile_gfortran64_new_libpgplot.compx1 ├── makefile_gfortran64_test ├── makefile_ifc_pleiades ├── makefile_ifort_VIZ ├── makefile_ifort_pleiades2 ├── makefile_ifort_stix_pppl ├── makefile_intel.edison ├── makefile_intel.hopper ├── makefile_jaguar ├── makefile_lf64 ├── makefile_lf95 ├── makefile_lf95_crpppc138 ├── makefile_lf95_delphi ├── makefile_lf95_marshall ├── makefile_lf95_petrel001 ├── makefile_lf95_portal ├── makefile_lf95_read_write_namelists ├── makefile_lf95_sap ├── makefile_lf95_sap_read_write_namelists ├── makefile_lf95_static ├── makefile_mpi.franklin ├── makefile_mpi.gfortran64 ├── makefile_mpi.gfortran64.CentOS ├── makefile_mpi.gfortran64.bob9 ├── makefile_mpi.gfortran64.bob9.CentOS ├── makefile_mpi.gfortran64_hopper ├── makefile_mpi_franklin_pathscale ├── makefile_mpi_intel.cori ├── makefile_mpi_intel.edison ├── makefile_mpi_intel.hopper ├── makefile_mpi_lf95 ├── makefile_mpi_lf95_crpppc138 ├── makefile_mpi_lf95_petrel001 ├── makefile_mpi_lf95_portal ├── makefile_mpi_pathscale.hopper ├── makefile_mpi_pathscale_portal_pppl ├── makefile_mpi_pgi.hopper ├── makefile_mpi_pleiades ├── makefile_nowrite_franklin_pathscale ├── makefile_nowrite_franklin_pgi ├── makefile_nowrite_gfortran64 ├── makefile_nowrite_gfortran64.CentOS ├── makefile_nowrite_gfortran64_crpppc70 ├── makefile_nowrite_gfortran64_debug ├── makefile_nowrite_gfortran_bob7 ├── makefile_nowrite_ifort_VIZ ├── makefile_nowrite_jaguar ├── makefile_nowrite_lf95 ├── makefile_nowrite_lf95_delphi ├── makefile_nowrite_lf95_portal ├── makefile_nowrite_pathscale_portal_pppl ├── makefile_pathscale.hopper ├── makefile_pathscale_nowrite.hopper ├── makefile_pathscale_portal_pppl ├── makefile_pgi.hopper ├── makefile_pgi_ga_benten ├── makefile_pgi_ga_lohan6 ├── makefile_pgi_lohan5 ├── makefile_pgi_nowrite.hopper ├── makefile_pgi_nowrite_ga_benten ├── makefile_pgi_nowrite_ga_lohan6 ├── makefile_pgi_nowrite_lohan5 ├── makefile_read_write_namelists_alternate └── makefile_swim ├── makefile_gfortran.CentOS ├── makefile_gfortran.CentOS7 ├── makefile_gfortran.CentOS7.1 ├── makefile_gfortran64 ├── makefile_gfortran64_debug_BOUND_CHECK.CentOS ├── makefile_gfortran64_debug_BOUND_CHECK.CentOS7 ├── makefile_mpi.gfortran64 ├── makefile_mpi_gnu.cori ├── makefile_mpi_intel.cori ├── makefile_nowrite_gfortran64.CentOS ├── mathcurb.f ├── md03ua_real8.f ├── minimization.f ├── mk_graph.f ├── mk_graph.g_100921_old ├── mmdei.f ├── mpi ├── README ├── auto ├── auto.cpp ├── cmm ├── cmm.cpp ├── makefile ├── mpi.ins ├── mpi.ins_hopper ├── mpi.ins_notworking ├── mpi.ins_to_111102 ├── mpi.ins_to_130508 ├── mpi.ins_to_130509 ├── mpi.ins_zip ├── mpi.sh ├── mpi.zip.safe ├── update.py ├── update.py.obsolete └── write.i ├── mullerfun2.f ├── n_parb.i ├── n_ray.f ├── name.i ├── name_adj.i ├── name_eccone.i ├── name_edge_prof_nml.i ├── name_genr.i ├── name_grill.i ├── name_lsc_approach_nml.i ├── name_non_uniform_mesh_profiles_line.i ├── name_tokamak.i ├── name_uniform_mesh_profiles.i ├── netcdf.inc ├── netcdfr3d.f ├── ninit_ec.f ├── nperpcom.i ├── number1.f ├── one.i ├── one_nml.i ├── one_no_nml.i ├── onetwo.i ├── onetwo_nml.i ├── onetwo_no_nml.i ├── ono_disp.f ├── outinit.f ├── output.f ├── output.f_new ├── output.i ├── output_nml.i ├── output_no_nml.i ├── outputb1.f ├── oxb.f ├── oxb.i ├── p_c_prof_lsc.f ├── param.i ├── partner.f ├── pathscale-module_portal_pppl.csh ├── pgconst.i ├── pinsk_1.f ├── pinsk_2.f ├── plasmray.f ├── plot_dens.f ├── plot_n_perp_omega.f ├── prep3d.diff_DM ├── prep3d.f ├── prepripl.f ├── pyctest-runner.py ├── quanc8.f90 ├── read_write_genray_input.f ├── read_write_genray_input_prep.f ├── read_write_genray_input_prep.f_to_170714 ├── relat_tens.f ├── rho.i ├── rhospl.f ├── rk_new.f ├── rkb1.f ├── rkutta.i ├── rrange.i ├── rrind.f ├── rside1.f ├── rsideb1.f ├── s.f ├── scatnper.i ├── scatnper_nml.i ├── scatnper_no_nml.i ├── scatperp.f ├── sdr1.f ├── se.f ├── shkarofs.f ├── six.i ├── six_nml.i ├── six_no_nml.i ├── slatec_ram.f ├── spldens.f ├── spline.f ├── spline_distrib.i ├── stop.f ├── svn-commit.tmp ├── t.f ├── tensrcld.f ├── test_integration.f ├── test_read_write_namelists.f ├── test_read_write_namelists ├── README ├── bcast.f ├── genray.in ├── genray.in_test7 ├── log_read_write_debug ├── makefile_read_write_namelists ├── makefile_read_write_namelists_debug ├── partner.f ├── read_write_genray_input.f ├── test_read_write_namelists.f └── zcunix.f ├── three.i ├── transport_prof.i ├── uertst.f ├── ugetio.f ├── uspkd.f ├── wall.f ├── wall_090325.f ├── wall_density.f ├── wconvini.f ├── write.i ├── write3d.f ├── writencdf.i ├── writencdf_one_ray_point.i ├── x.f ├── xdraw.tar.gz ├── xdraw ├── README ├── README_xdraw ├── binread.c ├── curves.h ├── dcon.bin ├── device.h ├── draw.in ├── event.c ├── gendefs.h ├── gldraw.h ├── glx.c ├── glx.h ├── limits.c ├── makefile ├── makefile_franklin ├── makefile_mainline ├── menu.c ├── menu.h ├── menuwin.c ├── menuwin.h ├── ps.c ├── ps.h ├── pspack.c ├── pspack.h ├── redraw.c ├── setcolor.c ├── setcolor.h ├── smaller.c ├── spline.c ├── spline.h ├── spline1.c ├── wdraw.c ├── wdraw.h ├── wtest.c ├── wtest.h ├── xcontour.c ├── xcontour.h ├── xdata.c ├── xdialog.c ├── xdialog.h ├── xdraw ├── xdraw.c ├── xdraw.h ├── xdrawa.ps ├── xdrawb.ps ├── xdrawc.ps ├── xdrawd.ps ├── xdrawe.ps ├── xdrawf.ps ├── xdump.c ├── xedit.c ├── xedit.h ├── xinit.c ├── xinit.h ├── xmotif.c ├── xmslib.c ├── xortest.c ├── xtools.c ├── xtools.h ├── xtoolsm.c └── xwinlib.c ├── xdraw_inputs.tar.gz ├── xdraw_inputs ├── README ├── README_xdraw ├── drawabsr.in ├── drawcur.in ├── drawcur.in_w_wtheta ├── drawdelpwr_lsc.in ├── drawdens.in ├── drawebw.in ├── drawefield.in ├── drawefieldrho.in ├── drawem.in ├── drawem1.in ├── drawemf1.in ├── drawemfr.in ├── drawemfr1.in ├── drawemis.in ├── drawemres.in ├── draweps_i.in ├── draweps_r.in ├── drawfokr.in ├── drawfreqelec.in ├── drawfreqion.in ├── drawg3d1.in ├── drawg3d2.in ├── drawgenc.in ├── drawgenp.in ├── drawgenr.in ├── drawgenri.in ├── drawgent.in ├── drawnpar.in ├── drawonet.in ├── drawonet.in.0 ├── drawonet1.in ├── drawonet1_1.in ├── drawonet2.in ├── drawtol1.in ├── drawtol2.in ├── drawtool.in ├── drawtor.in ├── drawtorp.in ├── log ├── xdraw.ini ├── xdraw.ini_psonly ├── xdraw_test.tar └── xdrawa.ps ├── y.f ├── zcunix.f ├── zfun_cur.f ├── zfunc.f └── zr_psith.f /.github/workflows/ci-ubuntu.yml: -------------------------------------------------------------------------------- 1 | name: CI on Ubuntu 2 | 3 | on: [push] 4 | 5 | jobs: 6 | build: 7 | 8 | runs-on: ubuntu-latest 9 | 10 | steps: 11 | - uses: actions/checkout@v2 12 | - name: Get toolchain repo 13 | run: sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test 14 | - name: Update apt 15 | run: sudo apt update 16 | - name: Install gfortran-9 17 | run: sudo apt -y install gfortran-9 18 | - name: Add gfortran-9 as an alternative 19 | run: sudo update-alternatives --install /usr/bin/gfortran gfortran /usr/bin/gfortran-9 9 20 | - name: Install deps 21 | run: sudo apt -y install nco netcdf-bin libnetcdff-dev pgplot5 22 | - name: Build 23 | run: make -f makefile_gfortran64 24 | - name: Test 25 | run: ctest 26 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.mod 3 | *~ 4 | xgenr* 5 | -------------------------------------------------------------------------------- /00_Genray_Regression_Tests/EC_ITER_Central_CD.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/compxco/genray/b5f4de9d2d09c7d0a2746a12b36dc6d597a202ec/00_Genray_Regression_Tests/EC_ITER_Central_CD.png -------------------------------------------------------------------------------- /00_Genray_Regression_Tests/ECcone_optimal.dat: -------------------------------------------------------------------------------- 1 | i_n_optimal( 1 )= 1 2 | zst( 1 )=-.499883200640716D-01 3 | rst( 1 )=0.154984153185285D+01 4 | phist( 1 )=0.115606214540386D+01 5 | betast( 1 )=-.191251469385283D+02 6 | alfast( 1 )=0.207724163938471D+03 7 | i_n_optimal( 1 )= 2 8 | zst( 1 )=-.499881530129173D-01 9 | rst( 1 )=0.154984145200933D+01 10 | phist( 1 )=-.115578404154635D+01 11 | betast( 1 )=0.237802608924835D+02 12 | alfast( 1 )=0.151242375251061D+03 13 | -------------------------------------------------------------------------------- /00_Genray_Regression_Tests/ECcone_optimal.dat_test10.1: -------------------------------------------------------------------------------- 1 | i_n_optimal( 1)= 1 2 | zst( 1)=0.999731230156369D-01 3 | rst( 1)=0.154985559878534D+01 4 | phist( 1)=0.218084176015867D+01 5 | betast( 1)=-.229903643449110D+02 6 | alfast( 1)=0.204140082430143D+03 7 | i_n_optimal( 1)= 2 8 | zst( 1)=0.999727428446035D-01 9 | rst( 1)=0.154985561725353D+01 10 | phist( 1)=-.215285822414955D+01 11 | betast( 1)=0.713899226638668D+01 12 | alfast( 1)=0.158099309733235D+03 13 | -------------------------------------------------------------------------------- /00_Genray_Regression_Tests/Prater_NF2008_Fig12+ADJ.odp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/compxco/genray/b5f4de9d2d09c7d0a2746a12b36dc6d597a202ec/00_Genray_Regression_Tests/Prater_NF2008_Fig12+ADJ.odp -------------------------------------------------------------------------------- /00_Genray_Regression_Tests/Prater_NF2008_Fig12.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/compxco/genray/b5f4de9d2d09c7d0a2746a12b36dc6d597a202ec/00_Genray_Regression_Tests/Prater_NF2008_Fig12.pdf -------------------------------------------------------------------------------- /00_Genray_Regression_Tests/Prater_NF2008_Fig12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/compxco/genray/b5f4de9d2d09c7d0a2746a12b36dc6d597a202ec/00_Genray_Regression_Tests/Prater_NF2008_Fig12.png -------------------------------------------------------------------------------- /00_Genray_Regression_Tests/README: -------------------------------------------------------------------------------- 1 | README_genray -------------------------------------------------------------------------------- /00_Genray_Regression_Tests/ci-tests/.cleanrun.sh.swp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/compxco/genray/b5f4de9d2d09c7d0a2746a12b36dc6d597a202ec/00_Genray_Regression_Tests/ci-tests/.cleanrun.sh.swp -------------------------------------------------------------------------------- /00_Genray_Regression_Tests/ci-tests/cleanrun.sh: -------------------------------------------------------------------------------- 1 | rm -f *.bin 2 | rm -f absorp.doc 3 | rm -f con1 4 | rm -f genray_one_ray_point.nc 5 | rm -f *.sap 6 | rm -f *.ps 7 | rm -f zrn.dat 8 | rm -f genray.nc 9 | rm -f *.txt 10 | rm -f logfile 11 | rm -f joptab scrach adjout adjinp 12 | -------------------------------------------------------------------------------- /00_Genray_Regression_Tests/ci-tests/test-CMod-LH-edge-id16/gold-genray.nc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/compxco/genray/b5f4de9d2d09c7d0a2746a12b36dc6d597a202ec/00_Genray_Regression_Tests/ci-tests/test-CMod-LH-edge-id16/gold-genray.nc -------------------------------------------------------------------------------- /00_Genray_Regression_Tests/ci-tests/test-CMod-LH-edge/gold-genray.nc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/compxco/genray/b5f4de9d2d09c7d0a2746a12b36dc6d597a202ec/00_Genray_Regression_Tests/ci-tests/test-CMod-LH-edge/gold-genray.nc -------------------------------------------------------------------------------- /00_Genray_Regression_Tests/ci-tests/test-EC-ITER-Centra-CD/gold-genray.nc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/compxco/genray/b5f4de9d2d09c7d0a2746a12b36dc6d597a202ec/00_Genray_Regression_Tests/ci-tests/test-EC-ITER-Centra-CD/gold-genray.nc -------------------------------------------------------------------------------- /00_Genray_Regression_Tests/ci-tests/test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ../cleanrun.sh 3 | ../../../xgenray &> logfile 4 | ncdump gold-genray.nc > gold.txt 5 | ncdump genray.nc > run.txt 6 | tail -n +2 gold.txt > gold0.txt 7 | tail -n +2 run.txt > run0.txt 8 | diff gold0.txt run0.txt 9 | ../cleanrun.sh 10 | 11 | -------------------------------------------------------------------------------- /00_Genray_Regression_Tests/delpwr.bin_test9: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/compxco/genray/b5f4de9d2d09c7d0a2746a12b36dc6d597a202ec/00_Genray_Regression_Tests/delpwr.bin_test9 -------------------------------------------------------------------------------- /00_Genray_Regression_Tests/dens.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/compxco/genray/b5f4de9d2d09c7d0a2746a12b36dc6d597a202ec/00_Genray_Regression_Tests/dens.bin -------------------------------------------------------------------------------- /00_Genray_Regression_Tests/drawdelpwr_lsc.in: -------------------------------------------------------------------------------- 1 | Type (G=Graph, C=Contour): G 2 | 3 | filename(s) 4 | delpwr.bin 5 | 6 | graph title: GENRAY 7 | 8 | variable names 9 | 0 power lsc 10 | 1 poloidal dist 11 | 12 | ix iy title 13 | 1 0 power(s) 14 | -------------------------------------------------------------------------------- /00_Genray_Regression_Tests/drawem.in: -------------------------------------------------------------------------------- 1 | Type (G=Graph, C=Contour): G 2 | 3 | filename(s) 4 | emis.bin 5 | 6 | graph title: GENRAY 7 | 8 | variable names 9 | 0 R 10 | 1 Z 11 | 2 Phi 12 | 3 distance 13 | 4 al 14 | 5 j 15 | 6 N_ray 16 | 7 I_n_sn/ds 17 | 8 I_n(s=0)/ds 18 | 9 Temperature 19 | 10 Rad Temp (keV) 20 | 11 I(s) (cgs) 21 | 12 tau_n 22 | 13 I_n(0) 23 | 24 | ix iy title 25 | 0 7 "I_n_sn/ds 26 | 0 8 dI(s=0)/ds 27 | 0 11 "Intensity, I(s) 28 | 0 4 al 29 | 0 5 j 30 | 0 6 N_ray 31 | 0 12 tau_n 32 | 0 9 Temperature 33 | 0 10 Local Rad Temp(R) 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /00_Genray_Regression_Tests/drawfreqelec.in: -------------------------------------------------------------------------------- 1 | Type (G=Graph, C=Contour): G 2 | 3 | filename(s) 4 | freqelec.bin 5 | 6 | graph title: GENRAY 7 | 8 | variable names 9 | 0 R[m] 10 | 1 freqncy[GHz] 11 | 2 rho 12 | 3 dens_e 10^13/cm^3 13 | 14 | ix iy title 15 | 0 1 fpe[0],fce[1],fuh[2],2-6*fce[3-7],fx1[8],fx2[9] 16 | 0 2 rho(R) 17 | 0 3 dens_e(R) -------------------------------------------------------------------------------- /00_Genray_Regression_Tests/drawgenr.in: -------------------------------------------------------------------------------- 1 | Type (G=Graph, C=Contour): G 2 | 3 | filename(s) 4 | genray.bin 5 | 6 | graph title: GENRAY 7 | 8 | variable names 9 | 0 R (cms) 10 | 1 Z (cms) 11 | 2 X (cms) 12 | 3 Y (cms) 13 | 4 Poloidal dist. (cms) 14 | 5 Power (ergs/sec) 15 | 6 Ez/E 16 | 7 rho 17 | 8 n_parallel 18 | 9 n_perp 19 | 10 ki_poloidal (cms**-1) 20 | 11 y_e 21 | 12 y_i 22 | 23 | ix iy title 24 | 0 1 z(r) 25 | 2 3 y(x) 26 | 4 5 power(poloidal dist.) 27 | 4 6 Ez/E(poloidal dist.) 28 | 4 7 rho(poloidal dist.) 29 | 4 8 n_parallel(poloidal dist) 30 | 4 9 n_perpendic(poloidal dist) 31 | 0 10 ki_poloidal(R) 32 | 11 5 power(y_e) 33 | 12 5 power(y_i) 34 | -------------------------------------------------------------------------------- /00_Genray_Regression_Tests/drawonet1.in: -------------------------------------------------------------------------------- 1 | Type (G=Graph, C=Contour): G 2 | 3 | filename(s) 4 | onetwo1.bin 5 | 6 | graph title: GENRAY 7 | 8 | variable names 9 | 0 rho 10 | 1 power density (egr/s*cm**3) 11 | 2 power (egr/s) 12 | 3 power_e density (egr/s*cm**3) 13 | 4 power_i density (erg/s*cm**3) 14 | 5 power_cl density (egr/s*cm**3) 15 | 6 current density parallel (A/cm**2) 16 | 7 current density onetwo (A/cm**2) 17 | 8 current density toroidal (A/cm**2) 18 | 9 current density poloidal (A/cm**2) 19 | 10 current density toroidal_LL (A/sm**2) 20 | 21 | ix iy title 22 | 0 1 power density erg/(s*cm**3)(rho) 23 | 0 3 power density(electron damping) 24 | 0 4 power density(ion damping) 25 | 0 5 power density(collisional damping) 26 | 0 6 parallel current density A/cm**2(rho) 27 | 0 7 onetwo current density A/cm**2(rho) 28 | 0 8 toroidal current density A/cm**2(rho) 29 | 0 9 poloidal current density A/cm**2(rho) 30 | 0 10 toroidal LL current density A/cm**2 (rho) 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /00_Genray_Regression_Tests/drawonet2.in: -------------------------------------------------------------------------------- 1 | Type (G=Graph, C=Contour): G 2 | 3 | filename(s) 4 | onetwo1.bin 5 | 6 | graph title: GENRAY 7 | 8 | variable names 9 | 0 rho 10 | 1 power density (egr/s*cm**3) 11 | 2 power (egr/s) 12 | 3 power_e density (egr/s*cm**3) 13 | 4 power_i density (erg/s*cm**3) 14 | 5 power_cl density (egr/s*cm**3) 15 | 6 current density parallel (A/cm**2) 16 | 7 current density onetwo (A/cm**2) 17 | 8 current density toroidal (A/cm**2) 18 | 9 current density poloidal (A/cm**2) 19 | 10 current density toroidal_LL (A/sm**2) 20 | 21 | ix iy title 22 | 0 1 power density erg/(s*cm**3)(rho) 23 | 0 7 onetwo current density A/cm**2(rho) 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /00_Genray_Regression_Tests/emis.bin_113544.00325_mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/compxco/genray/b5f4de9d2d09c7d0a2746a12b36dc6d597a202ec/00_Genray_Regression_Tests/emis.bin_113544.00325_mod -------------------------------------------------------------------------------- /00_Genray_Regression_Tests/emis.bin_SS_Xmode_180_emission: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/compxco/genray/b5f4de9d2d09c7d0a2746a12b36dc6d597a202ec/00_Genray_Regression_Tests/emis.bin_SS_Xmode_180_emission -------------------------------------------------------------------------------- /00_Genray_Regression_Tests/emis.bin_test1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/compxco/genray/b5f4de9d2d09c7d0a2746a12b36dc6d597a202ec/00_Genray_Regression_Tests/emis.bin_test1 -------------------------------------------------------------------------------- /00_Genray_Regression_Tests/emis.bin_test3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/compxco/genray/b5f4de9d2d09c7d0a2746a12b36dc6d597a202ec/00_Genray_Regression_Tests/emis.bin_test3 -------------------------------------------------------------------------------- /00_Genray_Regression_Tests/genray.bin_105830p193r1.bob: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/compxco/genray/b5f4de9d2d09c7d0a2746a12b36dc6d597a202ec/00_Genray_Regression_Tests/genray.bin_105830p193r1.bob -------------------------------------------------------------------------------- /00_Genray_Regression_Tests/genray.bin_113544.00325_mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/compxco/genray/b5f4de9d2d09c7d0a2746a12b36dc6d597a202ec/00_Genray_Regression_Tests/genray.bin_113544.00325_mod -------------------------------------------------------------------------------- /00_Genray_Regression_Tests/genray.bin_CANONICAL_2004_ITER_TEST_one_ray: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/compxco/genray/b5f4de9d2d09c7d0a2746a12b36dc6d597a202ec/00_Genray_Regression_Tests/genray.bin_CANONICAL_2004_ITER_TEST_one_ray -------------------------------------------------------------------------------- /00_Genray_Regression_Tests/genray.bin_CMod_LH_edge: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/compxco/genray/b5f4de9d2d09c7d0a2746a12b36dc6d597a202ec/00_Genray_Regression_Tests/genray.bin_CMod_LH_edge -------------------------------------------------------------------------------- /00_Genray_Regression_Tests/genray.bin_SS_Xmode_180_emission: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/compxco/genray/b5f4de9d2d09c7d0a2746a12b36dc6d597a202ec/00_Genray_Regression_Tests/genray.bin_SS_Xmode_180_emission -------------------------------------------------------------------------------- /00_Genray_Regression_Tests/genray.bin_id10iabsorp1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/compxco/genray/b5f4de9d2d09c7d0a2746a12b36dc6d597a202ec/00_Genray_Regression_Tests/genray.bin_id10iabsorp1 -------------------------------------------------------------------------------- /00_Genray_Regression_Tests/genray.bin_shot106270: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/compxco/genray/b5f4de9d2d09c7d0a2746a12b36dc6d597a202ec/00_Genray_Regression_Tests/genray.bin_shot106270 -------------------------------------------------------------------------------- /00_Genray_Regression_Tests/genray.bin_test1: -------------------------------------------------------------------------------- 1 | ./genray.bin_SS_Xmode_180_emission -------------------------------------------------------------------------------- /00_Genray_Regression_Tests/genray.bin_test10: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/compxco/genray/b5f4de9d2d09c7d0a2746a12b36dc6d597a202ec/00_Genray_Regression_Tests/genray.bin_test10 -------------------------------------------------------------------------------- /00_Genray_Regression_Tests/genray.bin_test2: -------------------------------------------------------------------------------- 1 | genray.bin_105830p193r1.bob -------------------------------------------------------------------------------- /00_Genray_Regression_Tests/genray.bin_test3: -------------------------------------------------------------------------------- 1 | genray.bin_113544.00325_mod -------------------------------------------------------------------------------- /00_Genray_Regression_Tests/genray.bin_test4.1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/compxco/genray/b5f4de9d2d09c7d0a2746a12b36dc6d597a202ec/00_Genray_Regression_Tests/genray.bin_test4.1 -------------------------------------------------------------------------------- /00_Genray_Regression_Tests/genray.bin_test5: -------------------------------------------------------------------------------- 1 | genray.bin_CANONICAL_2004_ITER_TEST_one_ray -------------------------------------------------------------------------------- /00_Genray_Regression_Tests/genray.bin_test5.1: -------------------------------------------------------------------------------- 1 | genray.bin_id10iabsorp1 -------------------------------------------------------------------------------- /00_Genray_Regression_Tests/genray.bin_test6: -------------------------------------------------------------------------------- 1 | genray.bin_shot106270 -------------------------------------------------------------------------------- /00_Genray_Regression_Tests/genray.bin_test7: -------------------------------------------------------------------------------- 1 | ./genray.bin_CMod_LH_edge -------------------------------------------------------------------------------- /00_Genray_Regression_Tests/genray.bin_test7_edge_dens_rz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/compxco/genray/b5f4de9d2d09c7d0a2746a12b36dc6d597a202ec/00_Genray_Regression_Tests/genray.bin_test7_edge_dens_rz -------------------------------------------------------------------------------- /00_Genray_Regression_Tests/genray.bin_test9: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/compxco/genray/b5f4de9d2d09c7d0a2746a12b36dc6d597a202ec/00_Genray_Regression_Tests/genray.bin_test9 -------------------------------------------------------------------------------- /00_Genray_Regression_Tests/log_tests: -------------------------------------------------------------------------------- 1 | Press for Keystroke summary. 2 | Press for Keystroke summary. 3 | Press for Keystroke summary. 4 | Press for Keystroke summary. 5 | Press for Keystroke summary. 6 | Press for Keystroke summary. 7 | Press for Keystroke summary. 8 | Press for Keystroke summary. 9 | Press for Keystroke summary. 10 | Press for Keystroke summary. 11 | test4: Compare output text files ECcone_optimal.dat 12 | test5: Compare genray.bin_CANONICAL_2004_ITER_TEST_one_ray with test5/genray.bin using xdraw 13 | Press for Keystroke summary. 14 | Press for Keystroke summary. 15 | test5.1: Compare genray.bin_id10iabsorp1 with test5.1/genray.bin using xdraw 16 | Press for Keystroke summary. 17 | Press for Keystroke summary. 18 | test6: Compare genray.bin_shot106270 with test6/genray.bin using xdraw 19 | After finishing viewing results, can remove all subdirectories with a: 20 | rm -rf test1 test2 test3 test4 test5 test5.1 test6 emis.bin genray.bin 21 | Press for Keystroke summary. 22 | Press for Keystroke summary. 23 | -------------------------------------------------------------------------------- /00_Genray_Regression_Tests/onetwo1.bin_EC_ITER_Central_CD: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/compxco/genray/b5f4de9d2d09c7d0a2746a12b36dc6d597a202ec/00_Genray_Regression_Tests/onetwo1.bin_EC_ITER_Central_CD -------------------------------------------------------------------------------- /00_Genray_Regression_Tests/onetwo1.bin_test7: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/compxco/genray/b5f4de9d2d09c7d0a2746a12b36dc6d597a202ec/00_Genray_Regression_Tests/onetwo1.bin_test7 -------------------------------------------------------------------------------- /00_Genray_Regression_Tests/onetwo1.bin_test7.1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/compxco/genray/b5f4de9d2d09c7d0a2746a12b36dc6d597a202ec/00_Genray_Regression_Tests/onetwo1.bin_test7.1 -------------------------------------------------------------------------------- /00_Genray_Regression_Tests/xdraw.ini: -------------------------------------------------------------------------------- 1 | pscolor: 1 2 | END 3 | -------------------------------------------------------------------------------- /00_Genray_Regression_Tests/xdraw_genr_test7_rays.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/compxco/genray/b5f4de9d2d09c7d0a2746a12b36dc6d597a202ec/00_Genray_Regression_Tests/xdraw_genr_test7_rays.pdf -------------------------------------------------------------------------------- /00_Genray_Regression_Tests/zrn.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/compxco/genray/b5f4de9d2d09c7d0a2746a12b36dc6d597a202ec/00_Genray_Regression_Tests/zrn.dat -------------------------------------------------------------------------------- /Brief_genray_use_outline: -------------------------------------------------------------------------------- 1 | In the source distribution, there is a file 2 | genray.in_template_MKSA_111031 [or later date] 3 | which gives the latest description of the input namelist. 4 | This can give some idea of code capabilities. 5 | 6 | In the regression test file, 00_Genray_Regression_Tests_nnnnnn.tar 7 | there are about a dozen regressions tests, as described 8 | in the README. These can be executed with the commands 9 | in file tests. 10 | 11 | You will need to have xdraw and executable, obtained with the 12 | makefile in genray_cswim_svn/trunk/xdraw/ It is in c, and compiles 13 | without additional libraries, so, almost everywhere. 14 | I make a alias to the xdraw1 executable to xdraw. 15 | 16 | There is a brief code description at 17 | http://www.compxco.com/genray.html 18 | and a manual at the bottom of this page. 19 | 20 | There is also a IPS test case for LH at 21 | hopper09:/global/homes/u/u650/my_ips_trunk/components/rf/genray/src/\ 22 | tests/Cmod_LH/one_ray_111106_newPS 23 | 24 | ls -lt make_archive/* gives a sort of history of the compilers and computers 25 | with which genray has been compiled, including dates. The newer ones 26 | will work with the present distribution. 27 | -------------------------------------------------------------------------------- /CTestConfig.cmake: -------------------------------------------------------------------------------- 1 | set(CTEST_PROJECT_NAME "GENRAY") 2 | set(CTEST_NIGHTLY_START_TIME "01:00:00 UTC") 3 | set(CTEST_DROP_METHOD "https") 4 | set(CTEST_DROP_SITE "cdash.nersc.gov") 5 | set(CTEST_DROP_LOCATION "/submit.php?project=${CTEST_PROJECT_NAME}") 6 | set(CTEST_CDASH_VERSION "1.6") 7 | set(CTEST_CDASH_QUERY_VERSION TRUE) 8 | 9 | -------------------------------------------------------------------------------- /CTestCustom.cmake: -------------------------------------------------------------------------------- 1 | set(CTEST_BUILD_NAME "[Linux Ubuntu 18.04 x86_64] [Python 2.7.17]") 2 | set(CTEST_SOURCE_DIRECTORY "/home/dg6/code/genray") 3 | set(CTEST_BINARY_DIRECTORY "/home/dg6/code/genray") 4 | set(CTEST_MODEL "Continuous") 5 | set(CTEST_SITE "fusiont6-1") 6 | # set(CTEST_CHECKOUT_COMMAND "") 7 | # set(CTEST_UPDATE_COMMAND "") 8 | # set(CTEST_CONFIGURE_COMMAND "") 9 | set(CTEST_BUILD_COMMAND "make -f makefile_gfortran64") 10 | # set(CTEST_COVERAGE_COMMAND "") 11 | # set(CTEST_MEMORYCHECK_COMMAND "") 12 | # set(CTEST_GENERATOR "") 13 | # set(CTEST_GENERATOR_PLATFORM "") 14 | set(CTEST_TIMEOUT "7200") 15 | set(CTEST_TRIGGER "None") 16 | set(CTEST_CUSTOM_MAXIMUM_NUMBER_OF_ERRORS "200") 17 | set(CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS "300") 18 | set(CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE "104857600") 19 | set(CTEST_CUSTOM_COVERAGE_EXCLUDE "NONE") 20 | set(CTEST_UPDATE_VERSION_ONLY ON) 21 | set(CTEST_SUBMIT_RETRY_COUNT "1") 22 | set(CTEST_SUBMIT_RETRY_DELAY "30") 23 | set(CTEST_DROP_LOCATION "/submit.php?project=${CTEST_PROJECT_NAME}") 24 | set(CTEST_DROP_METHOD "https") 25 | set(CTEST_DROP_SITE "cdash.nersc.gov") 26 | set(CTEST_NIGHTLY_START_TIME "01:00:00 UTC") 27 | 28 | -------------------------------------------------------------------------------- /CTestTestfile.cmake: -------------------------------------------------------------------------------- 1 | add_test(test-CMod-LH-edge "../test.sh") 2 | set_tests_properties(test-CMod-LH-edge PROPERTIES WORKING_DIRECTORY "00_Genray_Regression_Tests/ci-tests/test-CMod-LH-edge") 3 | add_test(test-CMod-LH-edge-id16 "../test.sh") 4 | set_tests_properties(test-CMod-LH-edge-id16 PROPERTIES WORKING_DIRECTORY "00_Genray_Regression_Tests/ci-tests/test-CMod-LH-edge-id16") 5 | add_test(EC-ITER-Centra-CD "../test.sh") 6 | set_tests_properties(EC-ITER-Centra-CD PROPERTIES WORKING_DIRECTORY "00_Genray_Regression_Tests/ci-tests/test-EC-ITER-Centra-CD") 7 | -------------------------------------------------------------------------------- /README.ubuntu-18.04.md: -------------------------------------------------------------------------------- 1 | # Build instructions for Ubuntu 18.04 2 | First get gfortran9 3 | ``` 4 | sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test 5 | sudo apt update 6 | sudo apt -y install gfortran-9 7 | ``` 8 | Then make gfortran-9 be the default gfortran (so we don't have to change the makefile) 9 | ``` 10 | sudo update-alternatives --install /usr/bin/gfortran gfortran /usr/bin/gfortran-7 7 11 | sudo update-alternatives --install /usr/bin/gfortran gfortran /usr/bin/gfortran-9 9 12 | ``` 13 | Install dependencies 14 | ``` 15 | sudo apt -y install nco 16 | sudo apt -y install netcdf-bin libnetcdff-dev pgplot5 17 | ``` 18 | Build & test 19 | ``` 20 | make -f makefile_gfortran64 clean 21 | make -f makefile_gfortran64 22 | ctest 23 | ``` 24 | 25 | -------------------------------------------------------------------------------- /README_git: -------------------------------------------------------------------------------- 1 | /home/bobh/cql3d/git_genray/ 2 | 3 | 180410 4 | ====== 5 | Puting genray under git version control, starting 6 | from files in genray_v10.11_180410.zip. 7 | 8 | git init 9 | git add * 10 | git commit -m 'Committing genray_v10.11_180410, the initial project version' 11 | -------------------------------------------------------------------------------- /README_test: -------------------------------------------------------------------------------- 1 | /home/bobh/cql3d/git_genray/README_test 2 | 3 | This is a test file for adding file to git working directory. 4 | 5 | git add README_test 6 | git status shows it is in staged state. 7 | Modify it further (now). 8 | git status ==> it is in Changes to be committed list, 9 | and is modified. .#README_test is an untracked file. 10 | 11 | Got rid of .#README_test (emacs releted) by saving it. 12 | Now git status ==> Changed but not updated: modified: README_test 13 | Do git add README_test ==> # Changes to be committed: modified: README_test 14 | git commit -a -m 'More README_tests' ==> works [Wouldn't work without the 15 | -m '' 16 | Making further mods, and saving. 17 | Then, 18 | git checkout README_test ==> overwrites changed README in working directory. 19 | I updated the checkout file. added and 20 | committed. 21 | 22 | 23 | Making copy of the directory and sub-directories. Then comparing these 24 | directories with the copy with bcompare, after commiting this 25 | README_test file. Purpose: to see what is changed througout the 26 | directories. 27 | 28 | -------------------------------------------------------------------------------- /adj.i: -------------------------------------------------------------------------------- 1 | include 'adj_nml.i' 2 | include 'adj_no_nml.i' 3 | -------------------------------------------------------------------------------- /adj_prof.i: -------------------------------------------------------------------------------- 1 | c-------------------------------------------------------------- 2 | c It contains variables used for calulations density profiles 3 | c outside LCFS 4 | c-------------------------------------------------------------- 5 | 6 | include 'edg_prof_nml.i' 7 | include 'edg_prof_no_nml.i' 8 | -------------------------------------------------------------------------------- /antenna.i: -------------------------------------------------------------------------------- 1 | c it is to specify the possible curves for EC cone vertex positions 2 | 3 | real*8 r_antenna_max,delta_z 4 | integer i_cone,i_ant 5 | common /antenna/ r_antenna_max, ! for i_ant=1 type of antenna curve 6 | &delta_z, ! vertical shift over (zmax,rzmax) point 7 | &i_cone, !for i_ant=2 type of antenna curve i_ant=2 8 | &i_ant 9 | 10 | 11 | c r_antenna_max, ! for i_ant=1 type of antenna curve 12 | c &delta_z, ! [m] vertical shift over (zmax,rzmax) point 13 | c &i_cone, !for i_ant=2 type of antenna curve i_ant=2 14 | c &i_ant ! sets the form of the curve 15 | c =1 circuler curve 16 | c =2 ellipse curve 17 | -------------------------------------------------------------------------------- /arrays.f: -------------------------------------------------------------------------------- 1 | c ********************** arrays *********************** 2 | c * ------ * 3 | c * this subroutine initializes the arrays deru and * 4 | c * prmt that drkgs (runge-kutta subroutine) later * 5 | c * uses. * 6 | c ***************************************************** 7 | c 8 | c------------------------------------------------------------------ 9 | c ! 10 | c input parameters ! 11 | c ! 12 | c ndim - number of differential equations ! 13 | c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 14 | c ! 15 | c output parameters ! 16 | c ! 17 | c deru - vector of weight coefficients of solution error. ! 18 | c later it becomes the vector of right hand side of ! 19 | c the geometrical optics equations. ! 20 | c prmt - vector of parameters for drkgs (initial step of ! 21 | c integration, accuracy of solution etc. see also ! 22 | c drkgs.for). ! 23 | c------------------------------------------------------------------ 24 | subroutine arrays(ndim,deru,prmt,ihlf) 25 | !implicit double precision (a-h,o-z) 26 | implicit none !YuP[2020-01-14] 27 | integer ndim,ihlf !YuP[2020-01-14] 28 | integer i !YuP[2020-01-14] 29 | real*8 deru,prmt !YuP[2020-01-14] 30 | real*8 ttt !YuP[2020-01-14] 31 | 32 | include 'param.i' 33 | include 'one.i' 34 | dimension deru(*),prmt(*) 35 | 36 | ttt=1.d0/ndim !YuP[2020-01-14] Not good to use 't'. 37 | !It is in name_adj.i and adj_nml.i 38 | !YuP: changed 't' to 'ttt', just in case. 39 | do 100 i=1,ndim 40 | deru(i)=ttt 41 | 100 continue 42 | prmt(7)=prmt(1)+prmt(6) 43 | prmt(8)=prmt(1)+prmt(3) 44 | 45 | c read(1,20)prmt(1),prmt(2),prmt(3) 46 | c read(1,25)prmt(4),prmt(6) 47 | c read(1,30)ihlf 48 | c ihlf=prmt(9) 49 | c prmt(9)=ihlf 50 | 51 | if(outprint.eq.'enabled')then !YuP[2018-01-17] Added 52 | write(*,*)'in arrays prmt(1)=',prmt(1) 53 | write(*,*)'in arrays prmt(2)=',prmt(2) 54 | write(*,*)'in arrays tau=prmt(3)=',prmt(3) 55 | write(*,*)'in arrays acccuracy=prmt(4)=',prmt(4) 56 | write(*,*)'in arrays hprint=prmt(6)=',prmt(6) 57 | write(*,*)'in arrays hamiltonian acccuracy=prmt(9)=',prmt(9) 58 | c write(*,*)'in arrays ihlf=',ihlf 59 | endif ! outprint 60 | 61 | 20 format(f6.3/f8.3/d7.1) 62 | 25 format(d7.1/d7.1) 63 | 30 format(i3) 64 | 65 | return 66 | end 67 | 68 | -------------------------------------------------------------------------------- /bcast.f: -------------------------------------------------------------------------------- 1 | ! 2 | ! 3 | subroutine bcast(a,val,n) 4 | !implicit integer (i-n), real*8 (a-h,o-z) 5 | implicit none !YuP[2020-01] 6 | real*8 val,a !YuP[2020-01] 7 | integer i,n !YuP[2020-01] 8 | !.................................................................. 9 | ! Temporary bcast routine until I can find UNICOS equivalent 10 | !.................................................................. 11 | dimension a(n) 12 | do 100 i=1,n 13 | a(i)=val 14 | 100 continue 15 | return 16 | end 17 | ! 18 | ! 19 | subroutine ibcast(ia,ival,n) 20 | !implicit integer (i-n), real*8 (a-h,o-z) 21 | implicit none !YuP[2020-01] 22 | integer i,n,ival,ia !YuP[2020-01] 23 | !.................................................................. 24 | ! Temporary bcast routine until I can find UNICOS equivalent 25 | !.................................................................. 26 | dimension ia(n) 27 | do 100 i=1,n 28 | ia(i)=ival 29 | 100 continue 30 | return 31 | end 32 | 33 | ! NME bcast routine for complex arrays 34 | subroutine ccast(c,cval,n) 35 | !implicit integer (i-n), complex*16 (c) 36 | implicit none !YuP[2020-01] 37 | complex*16 cval,c !YuP[2020-01] 38 | integer i,n !YuP[2020-01] 39 | dimension c(n) 40 | do 100 i=1,n 41 | c(i)=cval 42 | 100 continue 43 | return 44 | end 45 | 46 | subroutine r4bcast(a,val,n) 47 | !implicit integer (i-n), real*4 (a-h,o-z) 48 | implicit none !YuP[2020-01] 49 | real*4 val,a !YuP[2020-01] ![2020-09-05] Corrected to real*4 50 | integer i,n !YuP[2020-01] 51 | !.................................................................. 52 | ! Temporary bcast routine until I can find UNICOS equivalent 53 | !.................................................................. 54 | dimension a(n) 55 | do 100 i=1,n 56 | a(i)=val 57 | 100 continue 58 | return 59 | end 60 | ! 61 | -------------------------------------------------------------------------------- /besk2as.f: -------------------------------------------------------------------------------- 1 | c ******************************besk2as*********************** 2 | c * besk2as calculates the Macdonalds function * 3 | c * of the second order K_2(x) multiplied by EXP(x) * 4 | c * fox x>50 by using assimptotical representation * 5 | c * result: bk=exp(x)*K_2(x) * 6 | c *********************************************************** 7 | c * input parameter real X * 8 | c ----------------------------------------------------------- 9 | subroutine besk2as(x,bk) 10 | implicit double precision(a-h,o-z) 11 | c write(*,*)'beg.of besk2as' 12 | pi=4.d0*datan(1.d0) 13 | m=20 14 | pp=dsqrt(pi/(2.d0*x)) 15 | s=0.d0 16 | coef=1.d0 17 | do 10 j=1,m 18 | if (j.eq.1) then 19 | coef=1.d0 20 | else 21 | ppp=2.d0*(j-1)-1.d0 22 | ppp=ppp**2 23 | ppp=16.0d0-ppp 24 | ppp=ppp/(j-1) 25 | coef=coef*ppp 26 | end if 27 | ppp1=2.d0*(j-1) 28 | ppp=2.d0**ppp1 29 | if (j.eq.1) then 30 | ppp=ppp*1.d0 31 | else 32 | ppp=ppp*(j-1) 33 | end if 34 | coef1=coef/ppp 35 | s=s+coef1/(2.0d0*x)**(j-1) 36 | 10 continue 37 | bk=pp*s 38 | end 39 | -------------------------------------------------------------------------------- /bripplb.i: -------------------------------------------------------------------------------- 1 | 2 | c These variables are for calculation with the ripple magnetic field. 3 | common/bripplb/ 4 | 1 bripl_r0(nxmaxa,nymaxa),bripl_r1(nxmaxa,nymaxa), 5 | 1 bripl_z0(nxmaxa,nymaxa),bripl_z1(nxmaxa,nymaxa), 6 | 1 bripl_p0(nxmaxa,nymaxa),bripl_p1(nxmaxa,nymaxa), 7 | 1 rippl(nxmaxa,nymaxa), 8 | 1 rippl1(nxmaxa,nymaxa),ripplm(nxmaxa,nymaxa), 9 | 1 ripplt(nxmaxa,nymaxa) 10 | c the arrays for the ripple magnetic field 11 | c b_phi(z,r,phi)=bripl_p0(z,r)+cos(phi)*bripl_p1(z,r) -toroidal 12 | c b_r(z,r,phi) =bripl_r0(z,r)+sin(phi)*bripl_r1(z,r) -r component 13 | c b_z(z,r,phi) =bripl_z0(z,r)+sin(phi)*bripl_z1(z,r) -z component 14 | c rippl(z,r)=bripl_p1(z,r)/bripl_p0(z,r) 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /cefield.i: -------------------------------------------------------------------------------- 1 | 2 | c The electric field polarizations 3 | complex*16 cex,cey,cez !YuP[2020-01] double complex to complex*16 4 | common/cefield/cex,cey,cez 5 | c cex ,cey,cez -electric field polarizations 6 | -------------------------------------------------------------------------------- /cn.f: -------------------------------------------------------------------------------- 1 | c ********************** cn ************************** 2 | c * -- * 3 | c * this function calculates the absolute value of 4 | c * the wave refractive index * 5 | c * * 6 | c ****************************************************** 7 | c 8 | c----------------------------------------------------------------- 9 | c ! 10 | c input parameters ! 11 | c ! 12 | c r - r-coordinate of the point where the wave refractive ! 13 | c index is calculated. ! 14 | c cnz, cnr, cm - n_z, n_r and r*n_phi ! 15 | c------------------------------------------------------------------ 16 | real*8 function cn(r,cnz,cnr,cm) 17 | implicit none !integer (i-n), real*8 (a-h,o-z) 18 | include 'param.i' 19 | include 'one.i' 20 | real*8 r,cnz,cnr,cm !INPUT 21 | real*8 r2 ! local 22 | 23 | r2=r*r 24 | cn=dsqrt(cnz*cnz+cnr*cnr+cm*cm/r2) 25 | 26 | return 27 | end function cn 28 | -------------------------------------------------------------------------------- /coldm.f: -------------------------------------------------------------------------------- 1 | 2 | 3 | subroutine coldm(nz,az2,x,y,an2,ncld,icuto) 4 | 5 | implicit none !integer (i-n), real*8 (a-h,o-z) 6 | c 7 | c input: 8 | c nz = parallel refractive index 9 | c az2 = parallel refractive index squared 10 | c x = (omegape/omega)**2 11 | c y = (omegace/omega) 12 | c output: 13 | c an2(2) = X- and O-mode (perp. ref. index)**2 14 | c ncld(2)= X- and O-mode perp. ref. index, respectively. 15 | c icuto(2)=icuto(1)=1 if an2(1).lt.0., else 0 16 | c icuto(2)=2 if an2(2).lt.0., else 0 17 | c 18 | c 19 | c costruisce l'indice freddo per i due modi 20 | c 21 | !double precision ncld(2),nz,an2(2) 22 | !dimension icuto(2) 23 | real*8 ncld(2),an2(2) !OUTPUT 24 | integer icuto(2) !OUTPUT 25 | real*8 nz,az2,x,y !INPUT !YuP: nz is not used? Note that az2=nz**2 26 | real*8 d,de,dd,b1,b2,y2 !local 27 | 28 | c """"""""""""""""""""""""""" 29 | c write(*,*)'beg. of coldm' 30 | c """"""""""""""""""""""""""" 31 | 32 | icuto(1)=0 33 | icuto(2)=0 34 | y2=y*y 35 | de=1.d0-x-y2 36 | d=y2*(1.d0-az2)**2+4.d0*az2*(1.d0-x) 37 | if(d.eq.0.0d0.or.d.gt.0.0d0) go to 1000 38 | icuto(1)=1 39 | icuto(2)=2 40 | go to 2000 41 | 1000 dd=dsqrt(d) 42 | b1=1.d0-az2-x-.5d0*x*y2*(1.d0+az2)/de 43 | b2=.5d0*x*y*dd/de 44 | an2(1)=b1-b2 45 | an2(2)=b1+b2 46 | if(an2(1).lt.0.d0) icuto(1)=1 47 | if(an2(2).lt.0.d0) icuto(2)=2 48 | 2000 if(icuto(1).eq.1) an2(1)=1.d0 49 | if(icuto(2).eq.2) an2(2)=1.d0 50 | ncld(1)=-1.d0 51 | ncld(2)=-1.d0 52 | if(an2(1).ge.0.) ncld(1)=dsqrt(an2(1)) 53 | if(an2(1).ge.0.) ncld(2)=dsqrt(an2(2)) 54 | c if (icuto(1).eq.1) write(*,*) 'cutoff modo ',icuto(1) 55 | c if (icuto(2).eq.2) write(*,*) 'cutoff modo ',icuto(2) 56 | 57 | c """"""""""""""""""""""""""""""""""""" 58 | c write(*,*)'end coldm' 59 | c """"""""""""""""""""""""""""""""""""" 60 | return 61 | end 62 | 63 | -------------------------------------------------------------------------------- /commons.i: -------------------------------------------------------------------------------- 1 | 2 | c The list of all include files *.i, except param.i, commons.i, pgconst.i 3 | c include 'a_change.i' 4 | c include 'bripplb.i' 5 | include 'cefield.i' 6 | include 'cone.i' 7 | c include 'dskin.i' 8 | c include 'emissa.i' 9 | include 'eps.i' 10 | include 'five.i' 11 | include 'fourb.i' 12 | c include 'fourbr.i' 13 | include 'gr.i' 14 | include 'grill.i' 15 | include 'ions.i' 16 | include 'limit.i' 17 | c include 'loopb.i' 18 | include 'n_parb.i' 19 | c include 'nperpcom.i' 20 | include 'one.i' 21 | include 'onetwo.i' 22 | include 'output.i' 23 | include 'oxb.i' 24 | include 'rho.i' 25 | include 'rkutta.i' 26 | c include 'rrange.i' 27 | include 'scatnper.i' 28 | include 'six.i' 29 | c include 'spline_distrib.i' 30 | include 'three.i' 31 | include 'write.i' 32 | include 'writencdf.i' 33 | include 'adj.i' 34 | include 'transport_prof.i' 35 | include 'edge_prof.i' 36 | include 'lsc_approach.i' 37 | -------------------------------------------------------------------------------- /cone_nml.i: -------------------------------------------------------------------------------- 1 | c The data for EC cone starting conditions, obtained from namelist 2 | c and subroutine dinit_mr calls. 3 | real*8 4 | c-----namelist /eccone/ 5 | & zst,rst,phist, 6 | & alfast,betast, 7 | & alpha1,alpha2, 8 | & powtot, 9 | & cr, 10 | & rho_launching_disk,sigma_launching_disk, 11 | & part_gauss_power, 12 | & rho_focus_disk,d_disk, 13 | & initial_azimuth_angle_degree 14 | 15 | integer 16 | c------namelist /eccone/ 17 | & ncone, 18 | & n_mesh_disk_radial_bin, 19 | & n_mesh_disk_angle_bin, 20 | & gzone,mray,nray_in, 21 | & na1,na2 22 | 23 | character*8 24 | c------namelist /eccone/ 25 | & raypatt 26 | 27 | common/cone_nml/ 28 | c-----real*8 29 | & zst(nconea),rst(nconea),phist(nconea), 30 | & alfast(nconea),betast(nconea), 31 | & alpha1(nconea),alpha2(nconea), 32 | & powtot(nconea), 33 | & cr(gzonemax), 34 | & rho_launching_disk,sigma_launching_disk, 35 | & part_gauss_power, 36 | & rho_focus_disk,d_disk, 37 | & initial_azimuth_angle_degree(n_mesh_disk_radial_bin_a), 38 | c-----integer 39 | & ncone, 40 | & n_mesh_disk_radial_bin, 41 | & n_mesh_disk_angle_bin(n_mesh_disk_radial_bin_a), 42 | & gzone,mray(gzonemax),nray_in, 43 | & na1,na2, 44 | c-----character 45 | & raypatt 46 | -------------------------------------------------------------------------------- /config_ext.f90: -------------------------------------------------------------------------------- 1 | !####################################################################### 2 | 3 | MODULE config_ext 4 | 5 | !######################################################################## 6 | 7 | IMPLICIT NONE 8 | CONTAINS 9 | 10 | !####################################################################### 11 | 12 | FUNCTION Conf_p_avrg(S,x) RESULT(pav) 13 | !======================================================================== 14 | ! Function returns the value of

, i.e. the flux averaged pitch 15 | !

=, 16 | ! where p=vpar/v, 0<=x<=1, x = (1-p*p)/b, and b = B(s,theta,phi)/Bmax(s) 17 | !======================================================================== 18 | USE const_and_precisions 19 | IMPLICIT NONE 20 | REAL(wp_), INTENT(in) :: S,x 21 | REAL(wp_) :: pav 22 | !======================================================================== 23 | ! pav = ? 24 | !======================================================================== 25 | END FUNCTION Conf_p_avrg 26 | 27 | !######################################################################## 28 | !######################################################################## 29 | !######################################################################## 30 | 31 | FUNCTION Conf_p_avrg_integr(S,x) RESULT(ipav) 32 | !======================================================================== 33 | ! Function returns the value of Integral(from x to 1) dx'/p_avrg(s,x') , 34 | ! where p_avrg(s,x) = 0<=x<=1, 0<=s<=1, 35 | ! s is the normalized magnetic flux 36 | !======================================================================== 37 | USE const_and_precisions 38 | IMPLICIT NONE 39 | REAL(wp_), INTENT(in) :: S,x 40 | REAL(wp_) :: ipav 41 | !======================================================================== 42 | ! ipav = ? 43 | !======================================================================== 44 | END FUNCTION Conf_p_avrg_integr 45 | 46 | !####################################################################### 47 | 48 | END MODULE config_ext 49 | 50 | !####################################################################### 51 | -------------------------------------------------------------------------------- /cori_batchscript_mpi: -------------------------------------------------------------------------------- 1 | #!/bin/bash -l 2 | 3 | #SBATCH -J GENRAY 4 | #SBATCH -p regular 5 | #SBATCH --qos=premium 6 | #SBATCH --account=m77 7 | #SBATCH -t 0:02:00 8 | #SBATCH -C haswell 9 | #SBATCH -N 2 10 | 11 | ## Note: this batchscript can be used at Edison and Cori. 12 | ## For Edison, comment the line with haswell. 13 | ## Examples of using 480 cores: 14 | ##Edison has 24 cores per compute node, 20*24=480, so use (-N 20, -n 160 -c 3) 15 | ##Cori has 32 cores per node, 15*32=480, so use (-N 15, -n 160 -c 3) 16 | 17 | cd $SLURM_SUBMIT_DIR 18 | export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/global/homes/y/ypetrov/pgplot.intel 19 | 20 | srun -n 32 -c 4 --cpu_bind=cores ./xgenray_mpi_intel.cori 21 | -------------------------------------------------------------------------------- /cori_batchscript_mpi_gnu: -------------------------------------------------------------------------------- 1 | #!/bin/bash -l 2 | 3 | #SBATCH -J GENRAY 4 | #SBATCH -p regular 5 | #SBATCH --qos=premium 6 | #SBATCH --account=m77 7 | #SBATCH -t 0:02:00 8 | #SBATCH -C haswell 9 | #SBATCH -N 2 10 | 11 | ## Note: this batchscript can be used at Edison and Cori. 12 | ## For Edison, comment the line with haswell. 13 | ## Examples of using 480 cores: 14 | ##Edison has 24 cores per compute node, 20*24=480, so use (-N 20, -n 160 -c 3) 15 | ##Cori has 32 cores per node, 15*32=480, so use (-N 15, -n 160 -c 3) 16 | 17 | cd $SLURM_SUBMIT_DIR 18 | ##export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/global/homes/y/ypetrov/pgplot.intel 19 | export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/global/cfs/cdirs/m77/CompX/pgplot.gnu 20 | 21 | srun -n 32 -c 4 --cpu_bind=cores ./xgenray_mpi_gnu.cori 22 | -------------------------------------------------------------------------------- /dxdphi.f: -------------------------------------------------------------------------------- 1 | c ********************** dxdphi ********************** 2 | c * ------ * 3 | c * this function calculates the derivative of x * 4 | c * (being (omega_pl_i/omega)**2 ) with respect to * 5 | c * phi (i - type of particles) * 6 | c **************************************************** 7 | c 8 | c------------------------------------------------------------------ 9 | c ! 10 | c input parameters ! 11 | c ! 12 | c z, r phi - coordinates of the point where the derivative is ! 13 | c calculated. ! 14 | c i = 1 - electrons, ! 15 | c > 1 - ions. ! 16 | c rho is in common /one/ 17 | c------------------------------------------------------------------ 18 | real*8 function dxdphi(z,r,phi,i) 19 | c implicit double precision (a-h,o-z) 20 | 21 | implicit none 22 | 23 | include 'param.i' 24 | include 'one.i' 25 | c-----input 26 | real*8 z,r,phi 27 | integer i !number of plasma specie 28 | c-----external 29 | real*8 d_density_r_z_i_d_phi,dense,dvarddph 30 | 31 | c-----locals 32 | real*8 den 33 | 34 | cSAP090206 35 | c den=densrho(rho,i) 36 | 37 | c write(*,*)'dxdphi before dense' 38 | if (rho.gt.1.d0-1.d-10) then 39 | c---------------------------------------------------------- 40 | c the point is outside LCFS 41 | c--------------------------------------------------------------- 42 | cSAP090403 43 | dxdphi=0.d0 44 | if(n_wall.gt.1) then 45 | c----------------------------------------------------------------- 46 | c calculate density derivative using spline at RZ mesh 47 | c----------------------------------------------------- 48 | dxdphi=v(i)*d_density_r_z_i_d_phi(z,r,phi,i) !derivative from RZ spline 49 | endif 50 | else 51 | c---------------------------------------------------------- 52 | c the point is inside LCFS 53 | c--------------------------------------------------------------- 54 | den=dense(z,r,phi,i) 55 | 56 | 57 | if(den.lt.0.d0)then 58 | den=0.d0 59 | write(*,*)'in dxdphi den.lt.0.0 rho,i',rho,i 60 | endif 61 | dxdphi=0.d0 62 | dxdphi=v(i)*den*dvarddph(z,r,phi) 63 | 64 | c write(*,*)'in dxdphi v(i),den,dvarddph(z,r,phi),dxdphi', 65 | c & v(i),den,dvarddph(z,r,phi),dxdphi 66 | endif 67 | 68 | return 69 | end 70 | -------------------------------------------------------------------------------- /dxrz.f: -------------------------------------------------------------------------------- 1 | r 2 | -------------------------------------------------------------------------------- /dydphi.f: -------------------------------------------------------------------------------- 1 | c ********************** dydphi ************************** 2 | c * ------ * 3 | c * this function calculates the derivative of y * 4 | c * (being omega_cyclotron_i/omega) with respect to phi* 5 | c * (i - type of particles) * 6 | c ******************************************************** 7 | c 8 | c------------------------------------------------------------------ 9 | c ! 10 | c input parameters ! 11 | c ! 12 | c z, r phi - coordinates of the point where the derivative is ! 13 | c calculated. ! 14 | c i = 1 - electrons, ! 15 | c > 1 - ions. ! 16 | c rho is from common one.i 17 | c------------------------------------------------------------------ 18 | double precision 19 | 1function dydphi(z,r,phi,i) 20 | !implicit double precision (a-h,o-z) 21 | implicit none !YuP[2020-01-14] 22 | integer i !YuP[2020-01-14] 23 | real*8 z,r,phi !YuP[2020-01-14] 24 | include 'param.i' 25 | include 'one.i' 26 | 27 | dydphi=0.d0 28 | dydphi=w(i)*dbmdph 29 | return 30 | end 31 | 32 | 33 | -------------------------------------------------------------------------------- /dydr.f: -------------------------------------------------------------------------------- 1 | c ********************** dydr *************************** 2 | c * ---- * 3 | c * this function calculates the derivative of y * 4 | c * (being omega_cyclotron_i/omega) with respect to r* 5 | c * (i - type of particles) * 6 | c ******************************************************* 7 | c 8 | c------------------------------------------------------------------ 9 | c ! 10 | c input parameters ! 11 | c ! 12 | c z, r phi - coordinates of the point where the derivative is ! 13 | c calculated. ! 14 | c i = 1 - electrons, ! 15 | c > 1 - ions. ! 16 | c rho is from common one.i 17 | c------------------------------------------------------------------ 18 | double precision 19 | 1function dydr(z,r,phi,i) 20 | !implicit double precision (a-h,o-z) 21 | implicit none !YuP[2020-01-14] 22 | integer i !YuP[2020-01-14] 23 | real*8 z,r,phi !YuP[2020-01-14] 24 | include 'param.i' 25 | include 'one.i' 26 | 27 | dydr=w(i)*dbmdr 28 | 29 | return 30 | end 31 | -------------------------------------------------------------------------------- /dydz.f: -------------------------------------------------------------------------------- 1 | c ********************** dydz *************************** 2 | c * ---- * 3 | c * this function calculates the derivative of y * 4 | c * (being omega_cyclotron_i/omega) with respect to z* 5 | c * (i - type of particles) * 6 | c ******************************************************* 7 | c 8 | c------------------------------------------------------------------ 9 | c ! 10 | c input parameters ! 11 | c ! 12 | c z, r phi - coordinates of the point where the derivative is ! 13 | c calculated. ! 14 | c i = 1 - electrons, ! 15 | c > 1 - ions. ! 16 | c rho is from common one.i 17 | c------------------------------------------------------------------ 18 | double precision 19 | 1function dydz(z,r,phi,i) 20 | !implicit double precision (a-h,o-z) 21 | implicit none !YuP[2020-01-14] 22 | integer i !YuP[2020-01-14] 23 | real*8 z,r,phi !YuP[2020-01-14] 24 | include 'param.i' 25 | include 'one.i' 26 | 27 | dydz=w(i)*dbmdz 28 | return 29 | end 30 | -------------------------------------------------------------------------------- /edge_prof.i: -------------------------------------------------------------------------------- 1 | c--------------------------------------------------------------- 2 | c data for density profile outside LCFS 3 | c--------------------------------------------------------------- 4 | include 'edge_prof_nml.i' 5 | include 'edge_prof_no_nml.i' 6 | -------------------------------------------------------------------------------- /edge_prof_nml.i: -------------------------------------------------------------------------------- 1 | c--------------------------------------------------------------------------- 2 | c data to set density profile ouside LCFS 3 | c--------------------------------------------------------------------------- 4 | integer 5 | &i_edge_dens_anal, ! =0 6 | ! =1 analytical formula for sigmedgn(theta_pol) 7 | ! =2 table data for sigmedgn(theta_pol) 8 | &i_edge_dens_rz_mesh, ! =0 do not use density_rz 9 | ! =1 to read density_rz from namelist /dens_rz/ 10 | &n_pol_edge_dens, ! number of poloidal points of 11 | ! the poloidal mesh 12 | &nxeqd_add,nyeqd_add ! number of poits ar RZ mesh used for creation 13 | ! density_r_z 14 | real*8 15 | cSAP090304 16 | &sigmedgn, !normalized exponential density and temperature fall 17 | &sigmedgt, !off dist utside LCFS starting at rho=1 18 | &theta_pol_edge_dens_ar_degree, !poloidal angle mesh 19 | !to set 20 | !sigmedgn_ar 21 | &sigmedgn_ar, !exponential density fall off distance 22 | !outside LCFS starting at rho=1 density 23 | &dens_min_edge, !minimal edge density 24 | !10**13/cm**3 for all plasma species 25 | &temp_min_edge, !minimal edge temperature 26 | ![KeV] for all plasma species 27 | 28 | &theta_pol_edge_1_degree, !for analitical formula of sigma_edge_n 29 | &theta_pol_edge_2_degree, ! 30 | &sigma_theta_pol_edge_1_degree, 31 | &sigma_theta_pol_edge_2_degree, 32 | &sigma_edgen_0, 33 | &sigma_edgen_1, 34 | &sigma_edgen_2, 35 | &sigma_wall_n, 36 | &sigma_lim_toroidal_degree 37 | 38 | common /edge_prof_nml/ 39 | c---- real*8 40 | c-----from namelist /name_edge_prof_nml/ 41 | &sigmedgn, 42 | &sigmedgt, 43 | &theta_pol_edge_dens_ar_degree(1:n_pol_edge_dens_a), 44 | &sigmedgn_ar(1:n_pol_edge_dens_a), 45 | &dens_min_edge,temp_min_edge, 46 | &theta_pol_edge_1_degree, !for analitical formula of sigma_edge_n 47 | &theta_pol_edge_2_degree, 48 | &sigma_theta_pol_edge_1_degree, 49 | &sigma_theta_pol_edge_2_degree, 50 | &sigma_edgen_0, 51 | &sigma_edgen_1, 52 | &sigma_edgen_2, 53 | &sigma_wall_n, 54 | &sigma_lim_toroidal_degree, 55 | c-----integer 56 | &i_edge_dens_anal, 57 | &i_edge_dens_rz_mesh, 58 | &n_pol_edge_dens, 59 | &nxeqd_add,nyeqd_add 60 | 61 | -------------------------------------------------------------------------------- /edge_prof_no_nml.i: -------------------------------------------------------------------------------- 1 | c---------------------------------------------------------------- 2 | c data for density profile ouside LCFS which are not in the input 3 | c namelist /edge_prof_nml/ 4 | c----------------------------------------------------------------- 5 | real*8 6 | &theta_pol_edge_dens_ar_radian, !polidal angle mesh at radian 7 | &sigmedgn_deriv,!second derivatives from sigmedgn by poloidal angle 8 | !for the spline approximation 9 | &theta_pol_edge_1_radian, !for analitical formula of sigma_edge_n 10 | &theta_pol_edge_2_radian, 11 | &sigma_theta_pol_edge_1_radian, 12 | &sigma_theta_pol_edge_2_radian 13 | 14 | common /edge_prof_no_nml/ 15 | &theta_pol_edge_dens_ar_radian(n_pol_edge_dens_a), 16 | &sigmedgn_deriv(n_pol_edge_dens_a), 17 | &theta_pol_edge_1_radian, 18 | &theta_pol_edge_2_radian, 19 | &sigma_theta_pol_edge_1_radian, 20 | &sigma_theta_pol_edge_2_radian 21 | 22 | -------------------------------------------------------------------------------- /emissa.i: -------------------------------------------------------------------------------- 1 | c----------------------------------------------------------- 2 | c Some emission data from namelist /emission/ 3 | c 4 | c The spline coefficients for the emission calculations 5 | c z,r,phi,N_z,N_r,M are the coordinates of the points along the ray 6 | c in 6D phase space (3R,3N) 7 | c 8 | c----------------------------------------------------------- 9 | include 'emissa_nml.i' 10 | include 'emissa_no_nml.i' 11 | 12 | 13 | -------------------------------------------------------------------------------- /emissa_nml.i: -------------------------------------------------------------------------------- 1 | c emission data from namelists 2 | 3 | c-----from namelist /emission/ 4 | real*8 5 | &max_kin_energy_kev 6 | integer 7 | &jx_kin 8 | 9 | common /emissa_nml/ 10 | c-----real*8 11 | &max_kin_energy_kev, 12 | c-----integer 13 | &jx_kin 14 | -------------------------------------------------------------------------------- /emission.diff_DM: -------------------------------------------------------------------------------- 1 | 2758,2759c2758,2759 2 | < double complex exde,eyde,ezde 3 | < real*8 :: rnpar,rnper,romega,romegpe,rvgrpdc,redenfac 4 | --- 5 | > complex exde,eyde,ezde 6 | > real rnpar,rnper,romega,romegpe,rvgrpdc,redenfac 7 | -------------------------------------------------------------------------------- /eps.i: -------------------------------------------------------------------------------- 1 | 2 | c the complex dielectric tensor 3 | complex*16 reps(3,3) !YuP[2020-01] double complex to complex*16 4 | common/eps/ reps 5 | c reps(i,j) are the components of the dielectric tensor 6 | -------------------------------------------------------------------------------- /five.i: -------------------------------------------------------------------------------- 1 | 2 | c the data for the spline coefficients for psi(r,z),feqd(psi),pres(psi), 3 | c limiters :z_plus(r) and z_minus(r) 4 | c They are created in equilib.f 5 | 6 | c parameter (nx4a=nxeqda+4,ny4a=nyeqda+4,nrya=ny4a) 7 | c parameter (nlim4=nlimit+4) 8 | c parameter nrya=max(nxeqda,nyeqda)+4 9 | 10 | real*8 rmax,zrmax,rmin,zrmin,zmax,rzmax,zmin,rzmin, 11 | 1 tx,ty,txf,cx,cy, 12 | 4 trlimp,trlimm, 13 | 5 cxlimp,cxlimm,cxy, 14 | + tpres,cpres 15 | integer nx,ny,ncx,ncy,ip,im 16 | common/five/rmax,zrmax,rmin,zrmin,zmax,rzmax,zmin,rzmin, 17 | 1 tx(nx4a),ty(ny4a),txf(nx4a),cx(nx4a),cy(nrya), 18 | 4 trlimp(nlim4),trlimm(nlim4), 19 | 5 cxlimp(nlim4),cxlimm(nlim4),cxy(nx4a,ny4a), 20 | + tpres(nx4a),cpres(nx4a), 21 | 6 nx,ny,ncx,ncy,ip,im 22 | c 23 | c nxeqda must be >= nxeqd number of the mech points along r in eqdsk.file 24 | c nyeqda must be >= nyeqd number of the mech points along z in eqdsk.file 25 | c 26 | 27 | c coordinates of Lackner rectangle: 28 | c rmax,zrmax,rmin,zrmin,zmax,rzmax,zmin,rzmin 29 | 30 | c coefficients for the spline approximation of 31 | c psi(r,z): tx(nx4a),ty(ny4a),cxy (cy is a working array) 32 | c feqd(psi):txf,cx 33 | c pres(psi):tpres(nx4a),cpres(nx4a) 34 | c z_limmiter plus(r) or (z_above): trlimp,cxlimp 35 | c z_limmiter minus(r) or (z_under): trlimm,cxlimm 36 | -------------------------------------------------------------------------------- /globcd.h: -------------------------------------------------------------------------------- 1 | ! globcd.h 2 | !------------------------------------------------------------------------ 3 | REAL*8 small 4 | parameter (small=1.d-3) 5 | REAL*8 tmass 6 | parameter (tmass=511.d0) 7 | ! 8 | REAL*8 pi ! pi=acos(-1.d0) set in TorGA_curgap 9 | common/cnstcd/pi 10 | ! 11 | REAL*8 tolval ! =max(tol,1.d-6) set in TorGA_curgap 12 | common /sftwcd/tolval 13 | ! 14 | integer modelv ! modelv=model set in TorGA_curgap 15 | integer igv ! igv=ig set in TorGA_curgap 16 | common /mdlpcd/modelv,igv 17 | ! 18 | REAL*8 yval, enz, enzsq, sgnnz ! yval=yy, set in TorGA_curgap 19 | ! enz=npara, set in TorGA_curgap 20 | ! enzsq=enz*enz set in TorGA_curgap 21 | ! sgnnz=sign(1.0d0,npara) set in TorGA_curgap 22 | integer nharm ! nharm=lh set in TorGA_curgap 23 | common /wavccd/yval,enz,enzsq,sgnnz,nharm 24 | ! 25 | REAL*8 hloc, href, hav, hsqav, chrtav 26 | ! set in TorGa_ceqmdl 27 | ! hloc=(1.d0-eps)/(1.d0+eps*cos(thetap)) 28 | ! href=(1.d0-eps)/(1.d0+eps) 29 | ! hav=1.d0-eps 30 | ! hsqav=(1.d0-eps)**2/sqrt(1.d0-eps**2) 31 | ! chrtav=(sqrt(2.d0*eps*(1.d0-eps))+(1.d0+eps)* 32 | ! & asin(sqrt(2.d0*eps/(1.d0+eps))))/pi 33 | ! 34 | REAL*8 cxi2, cxi4, fc, ft 35 | ! set in TorGA_curgac 36 | ! cxi2,cxi4, 37 | ! set in TorGA_curgac or in TorGa_getftrap 38 | ! fc,ft 39 | common /geoqcd/hloc,href,hav,hsqav,chrtav,cxi2,cxi4,fc,ft 40 | ! 41 | REAL*8 zeff, zrat, tau, etcutoff, gammin, gammax 42 | ! zeff=zeffin set in TorGA_curgac 43 | ! zrat=(zeff+1.d0)/fc set in TorGA_curgac 44 | ! tau=tebulk/tmass set in TorGA_curgac 45 | ! etcutoff=20.d0 set in TorGA_curgac 46 | ! gammin set in TorGa_getlims 47 | ! gammax set in TorGa_getlims 48 | common /ztmpcd/zeff,zrat,tau,etcutoff,gammin,gammax 49 | ! 50 | REAL*8 eta ! set in different places of toray.f90 51 | common /collcd/eta 52 | -------------------------------------------------------------------------------- /globcd1.h: -------------------------------------------------------------------------------- 1 | !globcd1.h 2 | !------------------------------------------------------------------------- 3 | ! 4 | REAL*8 enperp, omodev 5 | !enperp=nperp set in TorGA_curgap 6 | !omodev=omode set in TorGA_curgap 7 | COMPLEX*16 cez, ceplus, ceminus 8 | ! cez=cefldz set in TorGA_curgap 9 | ! ceplus=cefldx+(0.d0, 1.d0)*cefldy set in TorGA_curgap 10 | ! ceminus=cefldx-(0.d0, 1.d0)*cefldy set in TorGA_curgap 11 | COMMON /wavccd1/cez,ceplus,ceminus,omodev, enperp 12 | -------------------------------------------------------------------------------- /globcd2.h: -------------------------------------------------------------------------------- 1 | ! globcd2.h 2 | !------------------------------------------------------------------------ 3 | REAL*8 zrtmp, fctmp 4 | !zrtmp=zeff+1.d0 set in TorGa_funxjz(x) 5 | !fctmp=1.d0 set in TorGa_funxjz(x) 6 | common /dumm/zrtmp, fctmp 7 | -------------------------------------------------------------------------------- /gr.i: -------------------------------------------------------------------------------- 1 | 2 | c the data for the contours flux_surface=psi(r,z)=const 3 | c and for plotting of the toroidal and poloidal tokamak cross sections 4 | 5 | c parameter (nteta,npsi,epspsi,nteta1=nteta+1) 6 | c PARAMETER (NL,NP=nteta) 7 | real*8 zpsi(npsi,nteta1),rpsi(npsi,nteta1), 8 | + zpsi1(npsi,nteta1),rpsi1(npsi,nteta1), 9 | + arpsi(npsi),arteta(nteta1), 10 | cSAP091201 for spline approximation using coeff2 11 | &zpsi_psps(npsi,nteta1),zpsi_thth(npsi,nteta1), 12 | &zpsi_pspsthth(npsi,nteta1), 13 | &rpsi_psps(npsi,nteta1),rpsi_thth(npsi,nteta1), 14 | &rpsi_pspsthth(npsi,nteta1) 15 | 16 | real*8 AR(NL,NP+1),AZ(NL,NP+1) 17 | real*8 XT(3,NP+1),YT(3,NP+1) 18 | real*8 ar_min(npsi),ar_max(npsi),ab_max(npsi), 19 | +ab_min(npsi) 20 | 21 | common/gr/ AR,AZ,XT,YT,zpsi,rpsi,arpsi,arteta, 22 | + ar_min,ar_max,ab_max,ab_min, 23 | &zpsi_psps,zpsi_thth,zpsi_pspsthth, 24 | &rpsi_psps,rpsi_thth,rpsi_pspsthth 25 | 26 | c the arrays for contours of the flux surface: psi(r,z)=const 27 | c npsi is a number of contours 28 | c nteta is a number of the points along the each contours 29 | c (in the poloidal direction) 30 | c epspsi is the accuracy for the determination of the contours 31 | c poins coordinates (zpsi,rpsi) 32 | c zpsi(npsi,nteta1),rpsi(npsi,nteta1) arrays of the contour point's 33 | c coordinates 34 | c arpsi(npsi) is the array of values the poloidal flux on the contours 35 | c arteta(nteta1) is the array of the poloidal angles 36 | c NL is a number of contours for ploting of the tokamak 37 | c cross section 38 | c NP is a number of points along each contours in poloidal direction 39 | c for plotting of the tokamak cross section 40 | c AR(NL,NP+1),AZ(NL,NP+1) arrays of the contour point's 41 | c coordinates for the ploting of the tokamak cross section 42 | c XT(3,NP+1),YT(3,NP+1) (x=r*cos(phi),y=r*sin(phi)) are the 43 | c coordinates for ploting of the middleplane tokamak cross section 44 | c ar_min(npsi) is the array of the min value r(psi) 45 | c ar_max(npsi) is the array of the max value r(psi) 46 | c ab_max(npsi) is the array of the max value b_total(psi) 47 | c ab_min(npsi) is the array of the min value b_total(psi) 48 | -------------------------------------------------------------------------------- /gr3.f: -------------------------------------------------------------------------------- 1 | c***************************************************** 2 | c----------------subroutine GR3---------------------* 3 | c Creates circles on the horizontal plane (X,Y) with* 4 | c radii RMIN,RMAX,RA (common block 'five') * 5 | c Output: arrays XT and YT into common block gr * 6 | c (file gr.cb) * 7 | c***************************************************** 8 | 9 | 10 | subroutine GR3 11 | 12 | implicit none !integer (i-n), real*8 (a-h,o-z) 13 | include 'param.i' 14 | include 'five.i' 15 | include 'three.i' 16 | include 'one.i' 17 | c double precision RMIN,RMAX,RA,PI 18 | real*8 RA 19 | 20 | real*8 PHI 21 | INTEGER I 22 | include 'gr.i' 23 | 24 | pi=4.d0*datan(1.d0) 25 | RA=xma 26 | 27 | DO 10 I=0,NP 28 | PHI=2.0D0*PI*I/DBLE(NP) 29 | XT(1,I+1)=RMAX*DCOS(PHI)*100.d0*r0x 30 | YT(1,I+1)=RMAX*DSIN(PHI)*100.d0*r0x 31 | 32 | XT(2,I+1)=RMIN*DCOS(PHI)*100.d0*r0x 33 | YT(2,I+1)=RMIN*DSIN(PHI)*100.d0*r0x 34 | 35 | XT(3,I+1)=RA*DCOS(PHI)*100.d0*r0x 36 | YT(3,I+1)=RA*DSIN(PHI)*100.d0*r0x 37 | 38 | 10 CONTINUE 39 | 40 | END 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /intel-module_portal_pppl.csh: -------------------------------------------------------------------------------- 1 | # July 30, 2013 2 | # intel compiler for cql3d on portal.pppl.gov 3 | # From Jin Chen, Aug 1, 2014: /p/swim/jchen/IPS/genray/cql3d 4 | 5 | module load intel 6 | module load netcdf 7 | module load ntcc 8 | module load subversion 9 | module load mdsplus 10 | module load pgplot 11 | -------------------------------------------------------------------------------- /intel-mpi-module_portal_pppl.csh: -------------------------------------------------------------------------------- 1 | # July 30, 2013 2 | # intel compiler for cql3d on portal.pppl.gov 3 | # From Jin Chen, Aug 1, 2014: /p/swim/jchen/IPS/genray/cql3d 4 | 5 | module load intel 6 | module load openmpi 7 | module load netcdf 8 | module load ntcc 9 | module load subversion 10 | module load mdsplus 11 | module load pgplot 12 | -------------------------------------------------------------------------------- /ions.i: -------------------------------------------------------------------------------- 1 | 2 | c the charges and masses of the plasma species 3 | c parameter (nbulka) 4 | c nbulka>=nbulk 5 | 6 | include 'ions_nml.i' 7 | 8 | 9 | -------------------------------------------------------------------------------- /ions_nml.i: -------------------------------------------------------------------------------- 1 | 2 | c Data from namelists for common /ions_nml/ 3 | c 4 | c the charges and masses of the plasma species. 5 | c parameter (nbulka) 6 | c nbulka>=nbulk 7 | 8 | c-----from namelist /species/ 9 | real*8 10 | &charge,dmas 11 | 12 | common/ions_nml/ charge(nbulka),dmas(nbulka) 13 | 14 | -------------------------------------------------------------------------------- /kind_spec.f90: -------------------------------------------------------------------------------- 1 | module kind_spec 2 | integer, parameter :: rprec = selected_real_kind(12,100) 3 | integer, parameter :: iprec = selected_int_kind(8) 4 | integer, parameter :: dp = rprec 5 | real(kind=dp), parameter :: d1mach1 = epsilon(1.0_dp) 6 | real(kind=dp), parameter :: d1mach2 = huge(1.0_dp) 7 | real(kind=dp),parameter::d1mach3=epsilon(1.0_dp)/radix(1.0_dp) 8 | real(kind=dp), parameter :: d1mach4 = epsilon(1.0_dp) 9 | real(kind=dp), parameter :: d1machx = radix(1.0_dp) 10 | ! --- Note d1mach5 should be log10( FLT_RADIX) but we can not 11 | !--- call the log function in an initialization 12 | real(kind=dp) :: d1mach5 = 0.301029995663981 13 | integer :: j1mach15 = minexponent(1.0_dp) 14 | integer :: j1mach14 = digits(1.0_dp) 15 | end module kind_spec 16 | -------------------------------------------------------------------------------- /limit.i: -------------------------------------------------------------------------------- 1 | 2 | c the arays for the plasma boundary 3 | c nlimit like in common five and fourb 4 | real*8 rpl,zpl,rml,zml 5 | common/limit/ 6 | 1 rpl(nlimit),zpl(nlimit),rml(nlimit),zml(nlimit) 7 | -------------------------------------------------------------------------------- /loopb.i: -------------------------------------------------------------------------------- 1 | 2 | c The arrays for the calculation of the ripple magnetic field using 3 | c the direct calculations of the ripple field from the coils. 4 | c These data are not used in the present genray version 5 | c parameter (ntor,nloop,npol) 6 | common/loopb/ 7 | 1 arbphi(ntor,nxeqda,nyeqda), 8 | 1 arbz(ntor,nxeqda,nyeqda),arbr(ntor,nxeqda,nyeqda), 9 | 1 arcosphl(nloop),arsinphl(nloop),arphloop(nloop), 10 | 1 arcosph(ntor),arsinph(ntor),arphi(ntor), 11 | 1 arcospl(npol),arsinpl(npol),artetpol(npol), 12 | 1 arrloop(npol),arzloop(npol), 13 | 1 arcospl_(npol),arsinpl_(npol),artetpl_(npol), 14 | 1 arrloop_(npol),arzloop_(npol), 15 | 1 ardelpol(npol),ardel_z(npol),ardel_r(npol) 16 | c ntor is the number of points in the 'toroidal angle' mesh 17 | c nxeqda is the max number of poins in the 'r-radial coordinate' mesh 18 | c nyeqda is the max number of poins in the 'z -verticle coordinate' mesh 19 | c nloop is the number of the loops 20 | c npol is the number of points along the loop 21 | c arbhi- toroidal magnetic field 22 | c arbz - z component of the magnetic field 23 | c arbr - major radius component of the magnetic field 24 | 25 | 26 | -------------------------------------------------------------------------------- /lsc_approach.i: -------------------------------------------------------------------------------- 1 | c This include file contains the variables which are used 2 | c LSC approach for LH absorption (at given DC electric field) 3 | c calculations 4 | 5 | include 'lsc_approach_nml.i' 6 | include 'lsc_approach_no_nml.i' 7 | -------------------------------------------------------------------------------- /lsc_approach_no_nml.i: -------------------------------------------------------------------------------- 1 | c data for LSC approach 2 | c velocity mesh is normalized at v_e_thermal different 3 | c at different radial points (1:n_psi_TSC) 4 | 5 | real*8, pointer :: 6 | &rho_bin_lsc(:), !(1:n_psi_TSC+1) 7 | &rho_bin_center_lsc(:), !(1:n_psi_TSC) 8 | &binvol_lsc(:), !(1:n_psi_TSC) 9 | &binarea_lsc(:), !(1:n_psi_TSC 10 | &v_te_bin_center_lsc(:), !(1:n_psi_TSC) 11 | &tau_n_bin_center_lsc(:), !(1:n_psi_TSC) 12 | &del_s_pol_bin_lsc(:), !(1:n_psi_TSC) 13 | &v_par_mesh_lsc(:), !(-nv_lsc_ql_lh : nv_lsc_ql_lh) 14 | &d_ql_lsc_lh_ar(:,:), !(1:n_psi_TSC,-nv_lsc_ql_lh : nv_lsc_ql_lh) 15 | &integral_fe_lsc(:,:), !(1:n_psi_TSC,-nv_lsc_ql_lh : nv_lsc_ql_lh) 16 | &fe_lsc(:,:), !(1:n_psi_TSC,-nv_lsc_ql_lh : nv_lsc_ql_lh) 17 | &d_fe_dv_lsc(:,:), !(1:n_psi_TSC,-nv_lsc_ql_lh : nv_lsc_ql_lh) 18 | &d_ql_lsc_lh_ar_old(:,:), !(1:n_psi_TSC,-nv_lsc_ql_lh : nv_lsc_ql_lh) 19 | &fe_lsc_old(:,:), !(1:n_psi_TSC,-nv_lsc_ql_lh : nv_lsc_ql_lh) 20 | &delpwr_nc_old_lsc(:,:), !(nrelta,nraya) 21 | &j_rf_TSC_1D(:), !(1:n_psi_TSC) 22 | &d_j_rf_d_Edc_TSC_1D(:), !(1:n_psi_TSC) 23 | &d_ln_j_rf_d_ln_Edc_TSC_1D(:), !(1:n_psi_TSC) 24 | &power_dens_watt_m3_TSC_1D(:), !(1:n_psi_TSC) 25 | &CD_dens_no_Edc_a_m2_TSC_1D(:), !(1:n_psi_TSC) 26 | &CD_dens_small_Edc_a_m2_TSC_1D(:), !(1:n_psi_TSC) 27 | &d_ql_lsc_lh_ar_loc(:) !(-nv_lsc_ql_lh : nv_lsc_ql_lh) 28 | 29 | common /lsc_approach_no_nml/ 30 | &rho_bin_lsc, 31 | &rho_bin_center_lsc, 32 | &binvol_lsc, ![cm**2] 33 | &binarea_lsc, ![cm**3] 34 | &v_te_bin_center_lsc, ![cm/sec] 35 | &tau_n_bin_center_lsc, ![sec] 36 | &del_s_pol_bin_lsc, 37 | &v_par_mesh_lsc, 38 | &d_ql_lsc_lh_ar, 39 | &integral_fe_lsc, 40 | &fe_lsc, 41 | &d_fe_dv_lsc, 42 | &d_ql_lsc_lh_ar_old, 43 | &fe_lsc_old, 44 | &delpwr_nc_old_lsc, 45 | &j_rf_TSC_1D, 46 | &d_j_rf_d_Edc_TSC_1D, 47 | &d_ln_j_rf_d_ln_Edc_TSC_1D, 48 | &power_dens_watt_m3_TSC_1D, ![watt/m**3] 49 | &CD_dens_no_Edc_a_m2_TSC_1D, !A/m**2 CD density without E_DC 50 | &CD_dens_small_Edc_a_m2_TSC_1D, !A/m**2 CD density with small E_DC 51 | &d_ql_lsc_lh_ar_loc 52 | -------------------------------------------------------------------------------- /make_archive/cori_batchscript_mpi: -------------------------------------------------------------------------------- 1 | #!/bin/bash -l 2 | 3 | #SBATCH -J GENRAY 4 | #SBATCH -p regular 5 | #SBATCH --qos=premium 6 | #SBATCH --account=m77 7 | #SBATCH -t 0:02:00 8 | #SBATCH -C haswell 9 | #SBATCH -N 2 10 | 11 | ## Note: this batchscript can be used at Edison and Cori. 12 | ## For Edison, comment the line with haswell. 13 | ## Examples of using 480 cores: 14 | ##Edison has 24 cores per compute node, 20*24=480, so use (-N 20, -n 160 -c 3) 15 | ##Cori has 32 cores per node, 15*32=480, so use (-N 15, -n 160 -c 3) 16 | 17 | cd $SLURM_SUBMIT_DIR 18 | export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/global/homes/y/ypetrov/pgplot.intel 19 | 20 | srun -n 32 -c 4 --cpu_bind=cores ./xgenray_mpi_intel.cori 21 | -------------------------------------------------------------------------------- /make_archive/makefile_gfortran64_debug_BOUND_CHECK_read_write: -------------------------------------------------------------------------------- 1 | # makefile for test_read_write_namelists using GFortran compiler. 2 | # test_read_write_namelists is an executable which reads genray.dat 3 | # using read_all_namelists (in read_write_genray_input.f), 4 | # and writes new genray.dat using write_all_namelists. 5 | # Source is read_write_genray_input.f. 6 | # Used for coupling genray to SciDAC SWIM IPS. 7 | 8 | # make - as usual make 9 | # make rebuild - rebuild whole program 10 | # make clean - remove all *.o files 11 | 12 | SHELL= /bin/sh 13 | NAME= test_read_write_namelists 14 | COMPILER= gfortran 15 | BUILDER= $(COMPILER) 16 | #Note: Following INCLUDES not necessary since the makefile simply 17 | # looks in ./, but this list identifies used include files. 18 | INCLUDES= cone_nml.i \ 19 | emissa_nml.i grill_nml.i ions_nml.i\ 20 | name.i \ 21 | output_nml.i one_nml.i \ 22 | onetwo_nml.i\ 23 | six_nml.i dinit_nml.i\ 24 | param.i rkutta.i transport_prof.i\ 25 | six.i scatnper.i name_uniform_mesh_profiles.i\ 26 | name_non_uniform_mesh_profiles_line.i 27 | SOURCES= read_write_genray_input.f bcast.f partner.f \ 28 | zcunix.f test_read_write_namelists.f 29 | OBJECTS= $(SOURCES:.f=.o) 30 | F90SRCS= kind_spec.f90 31 | F90OBJS= $(F90SRCS:.f90=.o) 32 | LOCATION= -L/usr/lib64 -L/usr/local/pgplot 33 | #LOCATION = -L/usr/local/netcdf-3.5.0/lib -L/usr/X11R6/lib -L/usr/local/pgplot -L/usr/X11R6/lib -L/usr/lib/gcc-lib/i386-redhat-linux/2.96 34 | #LIBRARIES= -lX11 -lnetcdf -lpgplot 35 | 36 | #!!! I have some problems with libpgplot.so file with lf95 compiler 37 | #!!! Try copy libpgplot.a to libpgplot_lf95.a in /usr/local/pgplot dir and 38 | #!!! uncomment next line (and comment previous one) 39 | 40 | LIBRARIES= -lX11 -lnetcdff -lnetcdf -lpgplot 41 | #LIBRARIES= -lX11 -lnetcdf -lpgplotlf95 42 | #LIBRARIES= -lX11 -lnetcdf -lpgplot -lnetcdf -lm -llapack -lblas -lg2c 43 | DEBUG= -g 44 | CSPECIAL= -ieee -fbounds-check 45 | BSPECIAL= 46 | 47 | COMPILE= $(COMPILER) -c $(CSPECIAL) $(DEBUG) 48 | BUILD= $(BUILDER) -o $(NAME) $(BSPECIAL) $(DEBUG) 49 | PROTECT= chmod 755 50 | DELETE= rm -f 51 | 52 | $(NAME): $(F90OBJS) $(OBJECTS) 53 | $(BUILD) $(F90OBJS) $(OBJECTS) $(LOCATION) $(LIBRARIES) 54 | $(PROTECT) $(NAME) 55 | 56 | $(F90OBJS): %.o: %.f90 57 | $(COMPILE) $< -o $@ 58 | 59 | $(OBJECTS): %.o: %.f 60 | $(COMPILE) $< -o $@ 61 | 62 | rebuild: 63 | $(COMPILE) $(SOURCES) $(F90SRCS) 64 | $(BUILD) $(OBJECTS) $(F90OBJS) $(LOCATION) $(LIBRARIES) 65 | $(PROTECT) $(NAME) 66 | 67 | clean: 68 | $(DELETE) $(OBJECTS) $(F90OBJS) 69 | 70 | #end 71 | 72 | -------------------------------------------------------------------------------- /make_archive/makefile_ifc_pleiades: -------------------------------------------------------------------------------- 1 | # makefile for GENRAY using Lahey Fortran compiler 2 | # N.Ershov 3 | # 24 Jan, 2003, Updated May 3, 2005 (BH) 4 | # USAGE: 5 | # make - as usual make 6 | # make rebuild - rebuild whole program 7 | # make clean - remove all *.o files 8 | 9 | 10 | SHELL= /bin/sh 11 | NAME= xgenray 12 | #COMPILER= lf95 13 | COMPILER= ifc 14 | BUILDER= $(COMPILER) 15 | INCLUDES= antenna.i bripplb.i cefield.i cone.i dskin.i eps.i\ 16 | emissa.i five.i fourb.i gr.i grill.i ions.i\ 17 | limit.i loopb.i nperpcom.i output.i one.i \ 18 | onetwo.i oxb.i\ 19 | transport_prof.i \ 20 | rho.i six.i spline_distrib.i three.i \ 21 | write.i writencdf.i \ 22 | commons.i param.i rrange.i n_parb.i rkutta.i\ 23 | globcd.h globcd1.h globcd2.h netcdf.inc 24 | SOURCES= genray.f abc.f absorpfw.f absorplh.f arrays.f\ 25 | abhay_disp.f\ 26 | b.f bcast.f besk.f besk2as.f bessel.f bound.f\ 27 | bess_slatec.f cn.f\ 28 | chamber_wall.f \ 29 | cninit.f cnpermuz.f coldm.f complx.f cone_ec.f\ 30 | contour.f croot.f curba.f curba_GA.f\ 31 | combine_disp.f \ 32 | dcom16.f dddrz1.f dense.f dinit.f\ 33 | dmnf.f dskin.f dten16.f dxdphi.f dxdr.f dxdz.f\ 34 | dydphi.f dydr.f dydz.f efield.f efield1.f\ 35 | equilib.f emission.f emission_spectrum.f eric_disp.f \ 36 | flown.f forest.f fokker.f gamma.f\ 37 | gr2new.f gr3.f grill_lh.f hamilmuz.f hamilt1.f\ 38 | hamilt_lambda.f lin_liu_curnt.f \ 39 | mathcurb.f mk_graph.f mmdei.f ninit_ec.f number1.f\ 40 | netcdfr3d.f \ 41 | outinit.f output.f outputb1.f ono_disp.f oxb.f\ 42 | onetwo_spline.f partner.f plasmray.f \ 43 | prep3d.f prepripl.f rhospl.f rk_new.f\ 44 | rkb1.f rside1.f relat_tens.f scatperp.f shkarofs.f\ 45 | rsideb1.f s.f sdr1.f se.f spline.f spldens.f\ 46 | slatec_ram.f\ 47 | stop.f tensrcld.f\ 48 | uertst.f ugetio.f uspkd.f\ 49 | write3d.f x.f y.f wconvini.f zcunix.f\ 50 | zfunc.f zr_psith.f zfun_cur.f 51 | OBJECTS= $(SOURCES:.f=.o) 52 | #LOCATION= -L/usr/X11R6/lib -L/d2/allfrey/evolve_deltaf/netcdf-3.5.0/lib -L/d2/petri/CQLP/lib 53 | #LOCATION= -L/usr/X11R6/lib -L/home/da13/harvey/lib 54 | LOCATION= -L/usr/X11R6/lib -L/usr/local/netcdf/lib -L/usr/local/pgplot 55 | LIBRARIES= -lX11 -lnetcdf -lpgplot 56 | 57 | DEBUG= 58 | CSPECIAL= 59 | BSPECIAL= -Vaxlib 60 | # -Vaxlib resolves most Unix routines [Minh Tran, 050504] 61 | 62 | COMPILE= $(COMPILER) -c $(CSPECIAL) $(DEBUG) 63 | BUILD= $(BUILDER) -o $(NAME) $(BSPECIAL) $(DEBUG) 64 | PROTECT= chmod 755 65 | DELETE= rm -f 66 | 67 | $(NAME): $(OBJECTS) 68 | $(BUILD) $(OBJECTS) $(LOCATION) $(LIBRARIES) 69 | $(PROTECT) $(NAME) 70 | 71 | $(OBJECTS): %.o: %.f 72 | $(COMPILE) $< -o $@ 73 | 74 | rebuild: 75 | $(COMPILE) $(SOURCES) 76 | $(BUILD) $(OBJECTS) $(LOCATION) $(LIBRARIES) 77 | $(PROTECT) $(NAME) 78 | 79 | clean: 80 | $(DELETE) $(OBJECTS) 81 | 82 | #end 83 | 84 | 85 | -------------------------------------------------------------------------------- /make_archive/makefile_lf95_crpppc138: -------------------------------------------------------------------------------- 1 | # makefile for GENRAY using Lahey Fortran compiler 2 | # N.Ershov 3 | # 24 Jan, 2003, Updated March. 22, 2005 (BH) 4 | # USAGE: 5 | # make - as usual make 6 | # make rebuild - rebuild whole program 7 | # make clean - remove all *.o files 8 | 9 | 10 | SHELL= /bin/sh 11 | NAME= xgenray 12 | COMPILER= lf95 13 | BUILDER= $(COMPILER) 14 | INCLUDES= antenna.i bripplb.i cefield.i cone.i dskin.i eps.i\ 15 | emissa.i five.i fourb.i gr.i grill.i ions.i\ 16 | limit.i loopb.i nperpcom.i output.i one.i \ 17 | onetwo.i rho.i six.i spline_distrib.i three.i \ 18 | write.i writencdf.i \ 19 | commons.i param.i rrange.i n_parb.i rkutta.i\ 20 | globcd.h globcd1.h globcd2.h netcdf.inc 21 | SOURCES= genray.f abc.f absorpfw.f absorplh.f arrays.f\ 22 | abhay_disp.f\ 23 | b.f bcast.f besk.f besk2as.f bessel.f bound.f\ 24 | bess_slatec.f cn.f\ 25 | chamber_wall.f \ 26 | cninit.f cnpermuz.f coldm.f complx.f cone_ec.f\ 27 | contour.f croot.f curba.f curba_GA.f\ 28 | combine_disp.f \ 29 | dcom16.f dddrz1.f dense.f dinit.f\ 30 | dmnf.f dskin.f dten16.f dxdphi.f dxdr.f dxdz.f\ 31 | dydphi.f dydr.f dydz.f efield.f efield1.f\ 32 | equilib.f emission.f emission_spectrum.f eric_disp.f \ 33 | flown.f forest.f fokker.f gamma.f\ 34 | gr2new.f gr3.f grill_lh.f hamilmuz.f hamilt1.f\ 35 | hamilt_lambda.f lin_liu_curnt.f \ 36 | mathcurb.f mk_graph.f mmdei.f ninit_ec.f number1.f\ 37 | netcdfr3d.f \ 38 | outinit.f output.f outputb1.f ono_disp.f oxb.f\ 39 | plasmray.f prep3d.f prepripl.f rhospl.f rk_new.f\ 40 | rkb1.f rside1.f relat_tens.f scatperp.f shkarofs.f\ 41 | rsideb1.f s.f sdr1.f se.f spline.f spldens.f\ 42 | slatec_ram.f\ 43 | stop.f tensrcld.f\ 44 | uertst.f ugetio.f uspkd.f\ 45 | write3d.f x.f y.f wconvini.f zcunix.f\ 46 | zfunc.f zr_psith.f zfun_cur.f 47 | OBJECTS= $(SOURCES:.f=.o) 48 | #LOCATION= -L/usr/X11R6/lib -L/d2/allfrey/evolve_deltaf/netcdf-3.5.0/lib -L/d2/petri/CQLP/lib 49 | LOCATION= -L/usr/X11R6/lib -L/home/da13/harvey/lib 50 | #LIBRARIES= -lX11 -lnetcdf -lpgplot 51 | 52 | #!!! I have some problems with libpgplot.so file with lf95 compiler 53 | #!!! Try copy libpgplot.a to libpgplot_lf95.a in /usr/local/pgplot dir and 54 | #!!! uncomment next line (and comment previous one) 55 | 56 | LIBRARIES= -lX11 -lnetcdf -lpgplot_lf95 57 | 58 | DEBUG= 59 | CSPECIAL= 60 | BSPECIAL= 61 | 62 | COMPILE= $(COMPILER) -c $(CSPECIAL) $(DEBUG) 63 | BUILD= $(BUILDER) -o $(NAME) $(BSPECIAL) $(DEBUG) 64 | PROTECT= chmod 755 65 | DELETE= rm -f 66 | 67 | $(NAME): $(OBJECTS) 68 | $(BUILD) $(OBJECTS) $(LOCATION) $(LIBRARIES) 69 | $(PROTECT) $(NAME) 70 | 71 | $(OBJECTS): %.o: %.f 72 | $(COMPILE) $< -o $@ 73 | 74 | rebuild: 75 | $(COMPILE) $(SOURCES) 76 | $(BUILD) $(OBJECTS) $(LOCATION) $(LIBRARIES) 77 | $(PROTECT) $(NAME) 78 | 79 | clean: 80 | $(DELETE) $(OBJECTS) 81 | 82 | #end 83 | 84 | 85 | -------------------------------------------------------------------------------- /make_archive/makefile_lf95_petrel001: -------------------------------------------------------------------------------- 1 | # makefile for GENRAY using Lahey Fortran compiler\ 2 | # N.Ershov 3 | # 24 Jan, 2003, Updated July 7, 2005 (BH) 4 | # USAGE: 5 | # make - as usual make 6 | # make rebuild - rebuild whole program 7 | # make clean - remove all *.o files 8 | 9 | # Copy a globcd.h globcd1.h globcd2.h netcdf.inc file from the appropriate netcdf distribution. 10 | 11 | SHELL= /bin/sh 12 | NAME= xgenray 13 | COMPILER= lf95 14 | BUILDER= $(COMPILER) 15 | INCLUDES= antenna.i bripplb.i cefield.i cone.i dskin.i eps.i\ 16 | emissa.i five.i fourb.i gr.i grill.i ions.i\ 17 | limit.i loopb.i nperpcom.i output.i one.i \ 18 | onetwo.i oxb.i\ 19 | transport_prof.i \ 20 | rho.i six.i spline_distrib.i three.i \ 21 | write.i writencdf.i \ 22 | commons.i param.i rrange.i n_parb.i rkutta.i\ 23 | globcd.h globcd1.h globcd2.h netcdf.inc 24 | SOURCES= genray.f abc.f absorpfw.f absorplh.f arrays.f\ 25 | abhay_disp.f\ 26 | b.f bcast.f besk.f besk2as.f bessel.f bound.f\ 27 | bess_slatec.f cn.f\ 28 | chamber_wall.f \ 29 | cninit.f cnpermuz.f coldm.f complx.f cone_ec.f\ 30 | contour.f croot.f curba.f curba_GA.f\ 31 | combine_disp.f \ 32 | dcom16.f dddrz1.f dense.f dinit.f\ 33 | dmnf.f dskin.f dten16.f dxdphi.f dxdr.f dxdz.f\ 34 | dydphi.f dydr.f dydz.f efield.f efield1.f\ 35 | equilib.f emission.f emission_spectrum.f eric_disp.f \ 36 | flown.f forest.f fokker.f gamma.f\ 37 | gr2new.f gr3.f grill_lh.f hamilmuz.f hamilt1.f\ 38 | hamilt_lambda.f lin_liu_curnt.f \ 39 | mathcurb.f mk_graph.f mmdei.f ninit_ec.f number1.f\ 40 | netcdfr3d.f \ 41 | outinit.f output.f outputb1.f ono_disp.f oxb.f\ 42 | onetwo_spline.f partner.f plasmray.f \ 43 | prep3d.f prepripl.f rhospl.f rk_new.f\ 44 | rkb1.f rside1.f relat_tens.f scatperp.f shkarofs.f\ 45 | rsideb1.f s.f sdr1.f se.f spline.f spldens.f\ 46 | slatec_ram.f\ 47 | stop.f tensrcld.f\ 48 | uertst.f ugetio.f uspkd.f\ 49 | write3d.f x.f y.f wconvini.f zcunix.f\ 50 | zfunc.f zr_psith.f zfun_cur.f 51 | OBJECTS= $(SOURCES:.f=.o) 52 | LOCATION= -L/usr/X11R6/lib -L/usr/local/netcdf-3.5.0/lib -L/u/bharvey 53 | #LIBRARIES= -lX11 -lnetcdf -lpgplot 54 | 55 | #!!! I have some problems with libpgplot.so file with lf95 compiler 56 | #!!! Try copy libpgplot.a to libpgplot_lf95.a in /usr/local/pgplot dir and 57 | #!!! uncomment next line (and comment previous one) 58 | 59 | LIBRARIES= -lX11 -lnetcdf -lpgplot_lf95 60 | 61 | DEBUG= 62 | CSPECIAL= 63 | BSPECIAL= 64 | 65 | COMPILE= $(COMPILER) -c $(CSPECIAL) $(DEBUG) 66 | BUILD= $(BUILDER) -o $(NAME) $(BSPECIAL) $(DEBUG) 67 | PROTECT= chmod 755 68 | DELETE= rm -f 69 | 70 | $(NAME): $(OBJECTS) 71 | $(BUILD) $(OBJECTS) $(LOCATION) $(LIBRARIES) 72 | $(PROTECT) $(NAME) 73 | 74 | $(OBJECTS): %.o: %.f 75 | $(COMPILE) $< -o $@ 76 | 77 | rebuild: 78 | $(COMPILE) $(SOURCES) 79 | $(BUILD) $(OBJECTS) $(LOCATION) $(LIBRARIES) 80 | $(PROTECT) $(NAME) 81 | 82 | clean: 83 | $(DELETE) $(OBJECTS) 84 | 85 | #end 86 | 87 | 88 | -------------------------------------------------------------------------------- /make_archive/makefile_lf95_portal: -------------------------------------------------------------------------------- 1 | # makefile for GENRAY using Lahey Fortran compiler\ 2 | # N.Ershov 3 | # 24 Jan, 2003, Updated Aug 16, 2006 (BH) 4 | # USAGE: 5 | # make - as usual make 6 | # make rebuild - rebuild whole program 7 | # make clean - remove all *.o files 8 | 9 | # Copy a netcdf.inc file from the appropriate netcdf distribution. 10 | 11 | SHELL= /bin/sh 12 | NAME= xgenray 13 | COMPILER= lf95 14 | BUILDER= $(COMPILER) 15 | INCLUDES= antenna.i bripplb.i cefield.i cone.i dskin.i eps.i\ 16 | emissa.i five.i fourb.i gr.i grill.i ions.i\ 17 | limit.i loopb.i nperpcom.i output.i one.i \ 18 | onetwo.i oxb.i\ 19 | transport_prof.i \ 20 | rho.i six.i spline_distrib.i three.i \ 21 | write.i writencdf.i \ 22 | commons.i param.i rrange.i n_parb.i rkutta.i\ 23 | globcd.h globcd1.h globcd2.h netcdf.inc 24 | SOURCES= genray.f abc.f absorpfw.f absorplh.f arrays.f\ 25 | abhay_disp.f\ 26 | b.f bcast.f besk.f besk2as.f bessel.f bound.f\ 27 | bess_slatec.f besvec.f cn.f\ 28 | chamber_wall.f \ 29 | cninit.f cnpermuz.f coldm.f complx.f cone_ec.f\ 30 | contour.f croot.f curba.f curba_GA.f\ 31 | combine_disp.f \ 32 | dcom16.f dddrz1.f dense.f dinit.f\ 33 | dmnf.f dskin.f dten16.f dxdphi.f dxdr.f dxdz.f\ 34 | dydphi.f dydr.f dydz.f efield.f efield1.f\ 35 | equilib.f emission.f emission_spectrum.f eric_disp.f \ 36 | flown.f forest.f fokker.f gamma.f\ 37 | gr2new.f gr3.f grill_lh.f hamilmuz.f hamilt1.f\ 38 | hamilt_lambda.f lin_liu_curnt.f \ 39 | mathcurb.f mk_graph.f mmdei.f mullerfun2.f ninit_ec.f \ 40 | netcdfr3d.f number1.f\ 41 | outinit.f output.f outputb1.f ono_disp.f oxb.f\ 42 | partner.f plasmray.f \ 43 | prep3d.f prepripl.f rhospl.f rk_new.f\ 44 | read_write_genray_input.f\ 45 | rkb1.f rside1.f relat_tens.f scatperp.f shkarofs.f\ 46 | rsideb1.f s.f sdr1.f se.f spline.f spldens.f\ 47 | slatec_ram.f\ 48 | stop.f tensrcld.f\ 49 | uertst.f ugetio.f uspkd.f\ 50 | write3d.f x.f y.f wconvini.f zcunix.f\ 51 | zfunc.f zr_psith.f zfun_cur.f 52 | OBJECTS= $(SOURCES:.f=.o) 53 | LOCATION= -L/usr/X11R6/lib -L$(NETCDFHOME)/lib -L/u/bharvey 54 | LIBRARIES= -lX11 -lnetcdf -lpgplot_lf95 55 | 56 | DEBUG= 57 | CSPECIAL= 58 | BSPECIAL= 59 | 60 | COMPILE= $(COMPILER) -c $(CSPECIAL) $(DEBUG) 61 | BUILD= $(BUILDER) -o $(NAME) $(BSPECIAL) $(DEBUG) 62 | PROTECT= chmod 755 63 | DELETE= rm -f 64 | 65 | $(NAME): $(OBJECTS) 66 | $(BUILD) $(OBJECTS) $(LOCATION) $(LIBRARIES) 67 | $(PROTECT) $(NAME) 68 | 69 | $(OBJECTS): %.o: %.f 70 | $(COMPILE) $< -o $@ 71 | 72 | rebuild: 73 | $(COMPILE) $(SOURCES) 74 | $(BUILD) $(OBJECTS) $(LOCATION) $(LIBRARIES) 75 | $(PROTECT) $(NAME) 76 | 77 | clean: 78 | $(DELETE) $(OBJECTS) 79 | 80 | #end 81 | 82 | 83 | -------------------------------------------------------------------------------- /make_archive/makefile_lf95_read_write_namelists: -------------------------------------------------------------------------------- 1 | # makefile for test_read_write_namelists using Lahey Fortran compiler. 2 | # test_read_write_namelists is an executable which reads genray.dat 3 | # using read_all_namelists (in read_write_genray_input.f), 4 | # and writes new genray.dat using write_all_namelists. 5 | # Source is read_write_genray_input.f. 6 | # Used for coupling genray to SciDAC SWIM IPS. 7 | 8 | # make - as usual make 9 | # make rebuild - rebuild whole program 10 | # make clean - remove all *.o files 11 | 12 | SHELL= /bin/sh 13 | NAME= test_read_write_namelists 14 | COMPILER= lf95 15 | BUILDER= $(COMPILER) 16 | #Note: Following INCLUDES not necessary since the makefile simply 17 | # looks in ./, but this list identifies used include files. 18 | INCLUDES= cone_nml.i \ 19 | emissa_nml.i grill_nml.i ions_nml.i\ 20 | name.i \ 21 | output_nml.i one_nml.i \ 22 | onetwo_nml.i\ 23 | six_nml.i dinit_nml.i\ 24 | param.i rkutta.i transport_prof.i\ 25 | six.i scatnper.i name_uniform_mesh_profiles.i\ 26 | name_non_uniform_mesh_profiles_line.i 27 | SOURCES= read_write_genray_input.f bcast.f partner.f \ 28 | zcunix.f test_read_write_namelists.f 29 | OBJECTS= $(SOURCES:.f=.o) 30 | LOCATION= -L/usr/X11R6/lib -L/usr/local/netcdf-3.5.0/lib 31 | #LOCATION = -L/usr/local/netcdf-3.5.0/lib -L/usr/X11R6/lib -L/usr/local/pgplot -L/usr/X11R6/lib -L/usr/lib/gcc-lib/i386-redhat-linux/2.96 32 | #LIBRARIES= -lX11 -lnetcdf -lpgplot 33 | 34 | #LIBRARIES= -lX11 -lnetcdf 35 | LIBRARIES= -lX11 -lnetcdf 36 | #LIBRARIES= -lX11 -lnetcdf -lpgplot -lnetcdf -lm -llapack -lblas -lg2c 37 | DEBUG= 38 | CSPECIAL= 39 | BSPECIAL= 40 | INCLUDE_DIR= ./ 41 | COMPILE= $(COMPILER) -c $(CSPECIAL) -I $(INCLUDE_DIR) $(DEBUG) 42 | BUILD= $(BUILDER) -o $(NAME) $(BSPECIAL) $(DEBUG) 43 | PROTECT= chmod 755 44 | DELETE= rm -f 45 | 46 | $(NAME): $(OBJECTS) 47 | $(BUILD) $(OBJECTS) $(LOCATION) $(LIBRARIES) 48 | $(PROTECT) $(NAME) 49 | 50 | $(OBJECTS): %.o: %.f 51 | $(COMPILE) $< -o $@ 52 | 53 | rebuild: 54 | $(COMPILE) $(SOURCES) 55 | $(BUILD) $(OBJECTS) $(LOCATION) $(LIBRARIES) 56 | $(PROTECT) $(NAME) 57 | 58 | clean: 59 | $(DELETE) $(OBJECTS) 60 | 61 | #end 62 | 63 | -------------------------------------------------------------------------------- /make_archive/makefile_lf95_sap_read_write_namelists: -------------------------------------------------------------------------------- 1 | # makefile for test_read_write_namelists using Lahey Fortran compiler. 2 | # test_read_write_namelists is an executable which reads genray.dat 3 | # using read_all_namelists (in read_write_genray_input.f), 4 | # and writes new genray.dat using write_all_namelists. 5 | # Source is read_write_genray_input.f. 6 | # Used for coupling genray to SciDAC SWIM IPS. 7 | 8 | # make - as usual make 9 | # make rebuild - rebuild whole program 10 | # make clean - remove all *.o files 11 | 12 | SHELL= /bin/sh 13 | NAME= test_read_write_namelists 14 | COMPILER= lf95 15 | BUILDER= $(COMPILER) 16 | #Note: Following INCLUDES not necessary since the makefile simply 17 | # looks in ./, but this list identifies used include files. 18 | INCLUDES= cone_nml.i \ 19 | emissa_nml.i grill_nml.i ions_nml.i\ 20 | name.i \ 21 | output_nml.i one_nml.i \ 22 | onetwo_nml.i\ 23 | six_nml.i dinit_nml.i\ 24 | param.i rkutta.i transport_prof.i\ 25 | six.i scatnper.i name_uniform_mesh_profiles.i\ 26 | name_non_uniform_mesh_profiles_line.i 27 | SOURCES= read_write_genray_input.f bcast.f partner.f \ 28 | zcunix.f test_read_write_namelists.f 29 | OBJECTS= $(SOURCES:.f=.o) 30 | LOCATION= -L/usr/X11R6/lib -L/usr/local/netcdf-3.5.0/lib 31 | #LOCATION = -L/usr/local/netcdf-3.5.0/lib -L/usr/X11R6/lib -L/usr/local/pgplot -L/usr/X11R6/lib -L/usr/lib/gcc-lib/i386-redhat-linux/2.96 32 | #LIBRARIES= -lX11 -lnetcdf -lpgplot 33 | 34 | #LIBRARIES= -lX11 -lnetcdf 35 | LIBRARIES= -lX11 -lnetcdf 36 | #LIBRARIES= -lX11 -lnetcdf -lpgplot -lnetcdf -lm -llapack -lblas -lg2c 37 | DEBUG= 38 | CSPECIAL= 39 | BSPECIAL= 40 | INCLUDE_DIR= ./ 41 | COMPILE= $(COMPILER) -c $(CSPECIAL) -I $(INCLUDE_DIR) $(DEBUG) 42 | BUILD= $(BUILDER) -o $(NAME) $(BSPECIAL) $(DEBUG) 43 | PROTECT= chmod 755 44 | DELETE= rm -f 45 | 46 | $(NAME): $(OBJECTS) 47 | $(BUILD) $(OBJECTS) $(LOCATION) $(LIBRARIES) 48 | $(PROTECT) $(NAME) 49 | 50 | $(OBJECTS): %.o: %.f 51 | $(COMPILE) $< -o $@ 52 | 53 | rebuild: 54 | $(COMPILE) $(SOURCES) 55 | $(BUILD) $(OBJECTS) $(LOCATION) $(LIBRARIES) 56 | $(PROTECT) $(NAME) 57 | 58 | clean: 59 | $(DELETE) $(OBJECTS) 60 | 61 | #end 62 | 63 | -------------------------------------------------------------------------------- /make_archive/makefile_nowrite_lf95: -------------------------------------------------------------------------------- 1 | # makefile for GENRAY using Lahey Fortran compiler 2 | # write(*,*) writes turned off 3 | # N.Ershov 4 | # 10 Sep, 2004 5 | # USAGE: 6 | # 1) make - building xgenray_nowrite 7 | # 2) make clean - removing all object files 8 | # make - as usual make 9 | 10 | SHELL= /bin/sh 11 | NAME= xgenray_nowrite 12 | COMPILER= lf95 13 | BUILDER= $(COMPILER) 14 | INCLUDES= antenna.i bripplb.i cefield.i cone.i dskin.i eps.i\ 15 | emissa.i five.i fourb.i gr.i grill.i ions.i\ 16 | limit.i loopb.i nperpcom.i output.i one.i \ 17 | onetwo.i oxb.i\ 18 | transport_prof.i \ 19 | rho.i six.i spline_distrib.i three.i \ 20 | write.i writencdf.i \ 21 | commons.i param.i rrange.i n_parb.i rkutta.i\ 22 | globcd.h globcd1.h globcd2.h netcdf.inc 23 | SOURCES= genray.f abc.f absorpfw.f absorplh.f arrays.f\ 24 | abhay_disp.f\ 25 | b.f bcast.f besk.f besk2as.f bessel.f bound.f\ 26 | bess_slatec.f besvec.f cn.f\ 27 | chamber_wall.f \ 28 | cninit.f cnpermuz.f coldm.f complx.f cone_ec.f\ 29 | contour.f croot.f curba.f curba_GA.f\ 30 | combine_disp.f \ 31 | dcom16.f dddrz1.f dense.f dinit.f\ 32 | dmnf.f dskin.f dten16.f dxdphi.f dxdr.f dxdz.f\ 33 | dydphi.f dydr.f dydz.f efield.f efield1.f\ 34 | equilib.f emission.f emission_spectrum.f eric_disp.f \ 35 | flown.f forest.f fokker.f gamma.f\ 36 | gr2new.f gr3.f grill_lh.f hamilmuz.f hamilt1.f\ 37 | hamilt_lambda.f lin_liu_curnt.f \ 38 | mathcurb.f mk_graph.f mmdei.f mullerfun2.f ninit_ec.f \ 39 | netcdfr3d.f number1.f\ 40 | outinit.f output.f outputb1.f ono_disp.f oxb.f\ 41 | partner.f plasmray.f \ 42 | prep3d.f prepripl.f rhospl.f rk_new.f\ 43 | rkb1.f rside1.f relat_tens.f scatperp.f shkarofs.f\ 44 | read_write_genray_input.f\ 45 | rsideb1.f s.f sdr1.f se.f spline.f spldens.f\ 46 | slatec_ram.f\ 47 | stop.f tensrcld.f\ 48 | uertst.f ugetio.f uspkd.f\ 49 | write3d.f x.f y.f wconvini.f zcunix.f\ 50 | zfunc.f zr_psith.f zfun_cur.f 51 | OBJECTS= $(SOURCES:.f=.o) 52 | NOWOBJS= $(SOURCES:.f=.nwo) 53 | 54 | LOCATION= -L/usr/X11R6/lib -L/usr/local/netcdf-3.5.0/lib -L/usr/local/pgplot 55 | LIBRARIES= -lX11 -lnetcdf -lpgplot_lf95 56 | #LIBRARIES= -lX11 -lnetcdf -lpgplotlf95 57 | #LIBRARIES= -lX11 -lnetcdf -lpgplot -lnetcdf -lm -llapack -lblas -lg2c 58 | 59 | $(NAME): $(NOWOBJS) 60 | mkdir TMP | echo -n 61 | mv *.o TMP | echo -n 62 | rename .nwo .o *.nwo | echo -n 63 | $(BUILDER) -o $(NAME) $(OBJECTS) $(LOCATION) $(LIBRARIES) 64 | chmod 755 $(NAME) 65 | rm -rf *.o | echo -n 66 | mv TMP/* . | echo -n 67 | rmdir TMP | echo -n 68 | 69 | $(NOWOBJS): %.nwo: %.f 70 | cp $< temp_nw.f 71 | mpi/cmm -a temp_nw.f 72 | mpi/cmm -p WRITE "write(*,*)" temp_nw.f 73 | mpi/cmm -p PAUSE "pause" temp_nw.f 74 | $(COMPILER) -c temp_nw.f -o temp_nw.o 75 | mv temp_nw.o $@ 76 | rm -f temp_nw.f 77 | 78 | clean: 79 | rm -rf *.nwo $(NAME) temp_nw* TMP | echo -n 80 | 81 | #end 82 | -------------------------------------------------------------------------------- /make_archive/makefile_nowrite_lf95_portal: -------------------------------------------------------------------------------- 1 | # makefile for GENRAY using Lahey Fortran compiler and NOWRITE OPTION, 2 | # minimizing printed o/p. 3 | # N.Ershov 4 | # 29 Feb, 2004, Updated Aug 31, 2006 (BH) 5 | # Usage: 6 | # 1) make - building xgenray_nowrite 7 | # 2) make clean - removing all object files 8 | 9 | #cmm comments out all write(*,*) and pause statements 10 | 11 | # Copy a netcdf.inc file from the appropriate netcdf distribution. 12 | 13 | SHELL= /bin/sh 14 | NAME= xgenray_nowrite 15 | COMPILER= lf95 16 | BUILDER= $(COMPILER) 17 | INCLUDES= antenna.i bripplb.i cefield.i cone.i dskin.i eps.i\ 18 | emissa.i five.i fourb.i gr.i grill.i ions.i\ 19 | limit.i loopb.i nperpcom.i output.i one.i \ 20 | onetwo.i oxb.i\ 21 | transport_prof.i \ 22 | rho.i six.i spline_distrib.i three.i \ 23 | write.i writencdf.i \ 24 | commons.i param.i rrange.i n_parb.i rkutta.i\ 25 | globcd.h globcd1.h globcd2.h netcdf.inc 26 | SOURCES= genray.f abc.f absorpfw.f absorplh.f arrays.f\ 27 | abhay_disp.f\ 28 | b.f bcast.f besk.f besk2as.f bessel.f bound.f\ 29 | bess_slatec.f besvec.f cn.f\ 30 | chamber_wall.f \ 31 | cninit.f cnpermuz.f coldm.f complx.f cone_ec.f\ 32 | contour.f croot.f curba.f curba_GA.f\ 33 | combine_disp.f \ 34 | dcom16.f dddrz1.f dense.f dinit.f\ 35 | dmnf.f dskin.f dten16.f dxdphi.f dxdr.f dxdz.f\ 36 | dydphi.f dydr.f dydz.f efield.f efield1.f\ 37 | equilib.f emission.f emission_spectrum.f eric_disp.f \ 38 | flown.f forest.f fokker.f gamma.f\ 39 | gr2new.f gr3.f grill_lh.f hamilmuz.f hamilt1.f\ 40 | hamilt_lambda.f lh_bonoli_disp.f lh_scattering.f limiter.f \ 41 | lin_liu_curnt.f lh_ql_flux.f lsc_approach.f \ 42 | netcdfr3d.f number1.f\ 43 | outinit.f output.f outputb1.f ono_disp.f oxb.f\ 44 | partner.f plasmray.f \ 45 | prep3d.f prepripl.f rhospl.f rk_new.f\ 46 | read_write_genray_input.f\ 47 | rkb1.f rside1.f relat_tens.f scatperp.f shkarofs.f\ 48 | rsideb1.f s.f sdr1.f se.f spline.f spldens.f\ 49 | slatec_ram.f\ 50 | stop.f tensrcld.f\ 51 | uertst.f ugetio.f uspkd.f\ 52 | write3d.f x.f y.f wconvini.f zcunix.f\ 53 | zfunc.f zr_psith.f zfun_cur.f 54 | OBJECTS= $(SOURCES:.f=.o) 55 | NOWOBJS= $(SOURCES:.f=.nwo) 56 | 57 | LOCATION= -L/usr/X11R6/lib -L$(NETCDFHOME)/lib -L/u/bharvey 58 | LIBRARIES= -lX11 -lnetcdf -lpgplot_lf95 59 | 60 | $(NAME): $(NOWOBJS) 61 | mkdir TMP | echo -n 62 | mv *.o TMP | echo -n 63 | rename .nwo .o *.nwo | echo -n 64 | $(BUILDER) -o $(NAME) $(OBJECTS) $(LOCATION) $(LIBRARIES) 65 | chmod 755 $(NAME) 66 | rm -rf *.o | echo -n 67 | mv TMP/* . | echo -n 68 | rmdir TMP | echo -n 69 | 70 | $(NOWOBJS): %.nwo: %.f 71 | cp $< temp_nw.f 72 | mpi/cmm -a temp_nw.f 73 | mpi/cmm -p WRITE "write(*,*)" temp_nw.f 74 | mpi/cmm -p PAUSE "pause" temp_nw.f 75 | $(COMPILER) -c temp_nw.f -o temp_nw.o 76 | mv temp_nw.o $@ 77 | rm -f temp_nw.f 78 | 79 | clean: 80 | rm -rf *.nwo $(NAME) temp_nw* TMP | echo -n 81 | 82 | #end 83 | 84 | 85 | -------------------------------------------------------------------------------- /make_archive/makefile_read_write_namelists_alternate: -------------------------------------------------------------------------------- 1 | SHELL= /bin/sh 2 | NAME= read_write 3 | SOURCES= read_write_genray_input.f bcast.f partner.f \ 4 | zcunix.f test_read_write_namelists.f 5 | OBJECTS = $(SOURCES:.f=.o) 6 | LOCATION= -L/usr/lib64 -L/usr/local/pgplot 7 | LIBRARIES= -lX11 -lnetcdff -lnetcdf -lpgplot 8 | DEBUG = -g 9 | OPTIMIZE = -O 10 | LISTING = -Mlist 11 | SPECIAL = -byteswapio -Mbackslash 12 | LDSPECIAL = 13 | INCLUDE = .. 14 | COMPILE = gfortran -c -I $(INCLUDE) $(OPTIMIZE) # or use $(DEBUG) 15 | LOAD = gfortran -o $(NAME) $(LDSPECIAL) $(DEBUG) # Remove -m for optimize 16 | PROTECT = chmod 755 17 | DELETE = rm -f 18 | 19 | # The following gives suffixes to be used in checking for suffix rules. 20 | # Written without dependencies, it may be useful to turn of such checking? 21 | .SUFFIXES: 22 | 23 | $(NAME): $(OBJECTS) 24 | $(LOAD) $(OBJECTS) $(LOCATION) $(LIBRARIES) 25 | $(PROTECT) $(NAME) 26 | 27 | # Following use of pattern matching works; 28 | # it is based on statements in Sect. 10.7 of gmake Manual 29 | # by Stallman and McGrath. 30 | 31 | # see Sect. 4.10.1, Static Pattern Rules. 32 | $(OBJECTS): %.o: %.f 33 | $(COMPILE) $< -o $@ 34 | 35 | rebuild: 36 | $(COMPILE) $(SOURCES) 37 | $(LOAD) $(OBJECTS) $(LOCATION) $(LIBRARIES) 38 | 39 | clean: 40 | $(DELETE) $(NAME) $(OBJECTS) *.lst 41 | 42 | -------------------------------------------------------------------------------- /make_archive/makefile_swim: -------------------------------------------------------------------------------- 1 | INSTALL=/usr/bin/install 2 | LIB=libgenray_input.a 3 | APP=genray 4 | BIN=xgenray_pathscale.hopper 5 | 6 | #BH090924, N.B. re updating,: 7 | #First: update ips/trunk/components/rf/genray/src from the 8 | # latest genray svn distribution, using update_prep-proc_genr_distn.sh, and 9 | # make in that directory (check tail of README_genray_prep-proc_devel). 10 | #Then: copy read_write_genray_input_prep.o and bcast.o from 11 | # your components/rf/genray/src directory to here, after 12 | # compiling there (read_write_genray_input_prep 13 | # gives verbose output, including write(*,*) output). 14 | #Finally: make -f makefile_swim clean 15 | # make -f makefile_swim 16 | # make -f makefile_swim install 17 | # 18 | OBJS=read_write_genray_input_prep.o bcast.o 19 | #BH090924: Discuss whether relevant .f files preferably also stored? 20 | INCLUDES= \ 21 | adj_nml.i grill_nml.i name_grill.i onetwo_nml.i \ 22 | cone_nml.i ions_nml.i name.i output_nml.i \ 23 | dinit_nml.i lsc_approach_nml.i name_lsc_approach_nml.i param.i \ 24 | edge_prof.i name_adj.i name_non_uniform_mesh_profiles_line.i rkutta.i \ 25 | edge_prof_nml.i name_eccone.i name_tokamak.i scatnper_nml.i \ 26 | edge_prof_no_nml.i name_edge_prof_nml.i name_uniform_mesh_profiles.i six_nml.i \ 27 | emissa_nml.i name_genr.i one_nml.i 28 | #BH090924 SHARE=grfont.dat #grfont.dat is from the PGPLOT_DIR which 29 | #BH09092 #presently needs to be set in user's login script. 30 | 31 | all: $(OBJS) $(INCLUDES) 32 | ar rv $(LIB) $(OBJS) 33 | 34 | #BH090924 install: $(BIN) $(LIB) $(INCLUDES) $(SHARE) 35 | install: $(BIN) $(LIB) $(INCLUDES) 36 | -$(INSTALL) $(BIN) $(IPS_PHYS_ROOT)/$(APP)/bin/xgenray 37 | -$(INSTALL) $(LIB) $(IPS_PHYS_ROOT)/$(APP)/lib 38 | -$(INSTALL) $(INCLUDES) $(IPS_PHYS_ROOT)/$(APP)/include 39 | #BH090924 -$(INSTALL) $(SHARE) $(IPS_PHYS_ROOT)/$(APP)/share 40 | clean: 41 | rm $(IPS_PHYS_ROOT)/$(APP)/lib/* 42 | rm $(IPS_PHYS_ROOT)/$(APP)/bin/* 43 | rm $(IPS_PHYS_ROOT)/$(APP)/include/* 44 | #BH090924 rm $(IPS_PHYS_ROOT)/$(APP)/share/* 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /mpi/auto: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/compxco/genray/b5f4de9d2d09c7d0a2746a12b36dc6d597a202ec/mpi/auto -------------------------------------------------------------------------------- /mpi/auto.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace std; 6 | 7 | int main(int argc, char** argv) 8 | { 9 | ifstream f[2]; 10 | f[0].open(argv[1]); 11 | f[1].open(argv[2]); 12 | 13 | int cf = 0; // current file 14 | 15 | string buf; 16 | getline(f[0],buf); 17 | while(f[0]) 18 | { 19 | if( buf.substr(0,18) != "CMPIINSERTPOSITION" ) 20 | cout << buf << endl; 21 | else 22 | cf = 1-cf; 23 | getline(f[cf],buf); 24 | } 25 | 26 | f[0].close(); 27 | f[1].close(); 28 | } 29 | 30 | -------------------------------------------------------------------------------- /mpi/cmm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/compxco/genray/b5f4de9d2d09c7d0a2746a12b36dc6d597a202ec/mpi/cmm -------------------------------------------------------------------------------- /mpi/makefile: -------------------------------------------------------------------------------- 1 | tmp: auto cmm 2 | 3 | auto: auto.cpp 4 | g++ -o auto auto.cpp 5 | 6 | cmm: cmm.cpp 7 | g++ -o cmm cmm.cpp 8 | -------------------------------------------------------------------------------- /mpi/mpi.ins_zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/compxco/genray/b5f4de9d2d09c7d0a2746a12b36dc6d597a202ec/mpi/mpi.ins_zip -------------------------------------------------------------------------------- /mpi/mpi.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | #cmm comments out all write(*,*) and pause statements, for MPI runs 3 | #auto makes MPI insertions in the *.f files at CMPIINSERTPOSITION points, 4 | # insertions specified in mpi.ins. 5 | 6 | mkdir TMP_GENRAY 7 | cp *.f *.i *.inc mpi/mpi.ins TMP_GENRAY 8 | cd TMP_GENRAY 9 | echo Start preprocessing 10 | ../mpi/cmm -a *.f 11 | ../mpi/cmm -p WRITE "write(*," *.f 12 | ../mpi/cmm -p PAUSE "pause" *.f 13 | echo auto 14 | ../mpi/auto genray.f mpi.ins >genray_.f 15 | mv genray_.f genray.f 16 | echo Start building 17 | $1 -c *.f 18 | $1 -o $2 *.o $3 $4 19 | cd .. 20 | cp TMP_GENRAY/$2 . 21 | rm -rf TMP_GENRAY 22 | -------------------------------------------------------------------------------- /mpi/mpi.zip.safe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/compxco/genray/b5f4de9d2d09c7d0a2746a12b36dc6d597a202ec/mpi/mpi.zip.safe -------------------------------------------------------------------------------- /mpi/update.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | import os, sys, string 3 | 4 | S = open('../write.i', 'r').readlines() 5 | state = 0 6 | var = {'complex':[], 'real':[]} 7 | arr = [] 8 | 9 | def fill(s): 10 | T = string.split(s,',') 11 | for i in range(len(T)): 12 | T[i] = string.strip(T[i]) 13 | return T 14 | 15 | for s in S: 16 | if s[0] in 'cC!' and s[:4]!='CMPI': 17 | continue 18 | pos = string.find(s,'double complex') 19 | if pos!=-1: 20 | var['complex'] = var['complex']+fill(s[pos+14:-1]) 21 | continue 22 | pos = string.find(s,'double precision') 23 | if pos!=-1: 24 | var['real'] = var['real']+fill(s[pos+16:-1]) 25 | continue 26 | pos = string.find(s,'common/write/') 27 | if pos!=-1: 28 | state = 1 29 | arr = arr+fill(s[pos+13:-1]) 30 | continue 31 | if s[:15]=='CMPI MAINOUTPUT': 32 | break 33 | if state==1: 34 | arr = arr+fill(s[pos+7:-1]) 35 | i = 0 36 | while i<(len(arr)): 37 | if arr[i]=='': 38 | del arr[i] 39 | i = i-1 40 | else: 41 | arr[i] = arr[i][:string.find(arr[i],'(')] 42 | i = i+1 43 | 44 | src = open('mpi.ins','r') 45 | dst = open('mpi.new','w') 46 | state = 0 47 | s = src.readline()[:-1] 48 | 49 | optmpl = {} 50 | optmpl['send'] = ' call MPI_SEND($,nrayelt,#,0,\n + tag,MPI_COMM_WORLD,ierr)' 51 | optmpl['recv'] = ' call MPI_RECV($,nrayelt,#,src,\n + tag,MPI_COMM_WORLD,status,ierr)' 52 | def prn(op): 53 | for v in arr: 54 | s = string.replace(optmpl[op],'$',v) 55 | type = '' 56 | if v in var['complex']: 57 | type = 'MPI_DOUBLE_COMPLEX' 58 | else: 59 | type = 'MPI_DOUBLE_PRECISION' 60 | s = string.replace(s,'#',type) 61 | # print s 62 | dst.write(s+'\n') 63 | 64 | while s!='': 65 | if state!=1 and state!=3: 66 | # print s 67 | dst.write(s+'\n') 68 | if s=='CVARCOMM': 69 | state = state+1 70 | if state==1: 71 | prn('send') 72 | # print 'CVARCOMM' 73 | dst.write('CVARCOMM\n') 74 | if state==3: 75 | prn('recv') 76 | # print 'CVARCOMM' 77 | dst.write('CVARCOMM\n') 78 | s = src.readline()[:-1] 79 | 80 | os.system('cp mpi.ins mpi.ins.old') 81 | os.system('mv mpi.new mpi.ins') 82 | -------------------------------------------------------------------------------- /mpi/update.py.obsolete: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | import os, sys, string 3 | 4 | S = open('../write.i', 'r').readlines() 5 | state = 0 6 | var = {'complex':[], 'real':[]} 7 | arr = [] 8 | 9 | def fill(s): 10 | T = string.split(s,',') 11 | for i in range(len(T)): 12 | T[i] = string.strip(T[i]) 13 | return T 14 | 15 | for s in S: 16 | if s[0] in 'cC!' and s[:4]!='CMPI': 17 | continue 18 | pos = string.find(s,'double complex') 19 | if pos!=-1: 20 | var['complex'] = var['complex']+fill(s[pos+14:-1]) 21 | continue 22 | pos = string.find(s,'double precision') 23 | if pos!=-1: 24 | var['real'] = var['real']+fill(s[pos+16:-1]) 25 | continue 26 | pos = string.find(s,'common/write/') 27 | if pos!=-1: 28 | state = 1 29 | arr = arr+fill(s[pos+13:-1]) 30 | continue 31 | if s[:15]=='CMPI MAINOUTPUT': 32 | break 33 | if state==1: 34 | arr = arr+fill(s[pos+7:-1]) 35 | i = 0 36 | while i<(len(arr)): 37 | if arr[i]=='': 38 | del arr[i] 39 | i = i-1 40 | else: 41 | arr[i] = arr[i][:string.find(arr[i],'(')] 42 | i = i+1 43 | 44 | src = open('mpi.ins','r') 45 | dst = open('mpi.new','w') 46 | state = 0 47 | s = src.readline()[:-1] 48 | 49 | optmpl = {} 50 | optmpl['send'] = ' call MPI_SEND($,nrayelt,#,0,\n + tag,MPI_COMM_WORLD,ierr)' 51 | optmpl['recv'] = ' call MPI_RECV($,nrayelt,#,src,\n + tag,MPI_COMM_WORLD,status,ierr)' 52 | def prn(op): 53 | for v in arr: 54 | s = string.replace(optmpl[op],'$',v) 55 | type = '' 56 | if v in var['complex']: 57 | type = 'MPI_DOUBLE_COMPLEX' 58 | else: 59 | type = 'MPI_DOUBLE_PRECISION' 60 | s = string.replace(s,'#',type) 61 | # print s 62 | dst.write(s+'\n') 63 | 64 | while s!='': 65 | if state!=1 and state!=3: 66 | # print s 67 | dst.write(s+'\n') 68 | if s=='CVARCOMM': 69 | state = state+1 70 | if state==1: 71 | prn('send') 72 | # print 'CVARCOMM' 73 | dst.write('CVARCOMM\n') 74 | if state==3: 75 | prn('recv') 76 | # print 'CVARCOMM' 77 | dst.write('CVARCOMM\n') 78 | s = src.readline()[:-1] 79 | 80 | os.system('cp mpi.ins mpi.ins.old') 81 | os.system('mv mpi.new mpi.ins') 82 | -------------------------------------------------------------------------------- /n_parb.i: -------------------------------------------------------------------------------- 1 | 2 | c the data for plotting of the magnetic field, and refractive index 3 | c along the trajectory 4 | c nrelta set in param.i 5 | real*8 wthet,wmdevr 6 | 1,wnpol,bpoloid,btor,btot 7 | 1,gradpsi,gradpdr 8 | 9 | 10 | common/n_parb/wthet(nrelta),wmdevr(nrelta) 11 | 1,wnpol(nrelta),bpoloid(nrelta),btor(nrelta),btot(nrelta) 12 | 1,gradpsi(nrelta),gradpdr(nrelta) 13 | -------------------------------------------------------------------------------- /name_adj.i: -------------------------------------------------------------------------------- 1 | c------------------------------------------------------ 2 | c namelist /adj_nml/ 3 | c------------------------------------------------------- 4 | 5 | namelist /adj_nml/ 6 | & i_adj, 7 | & t,ze,umax,dt, 8 | & aerrmx,rerrmx,epsi_adj, 9 | & npsi0,nthp0,nmax_chi,imax_chi,lmax_chi,tmax,alpha,rho_, 10 | & n_harm_adj_min,n_harm_adj_max, 11 | & n_relt_intgr_adj,i_resonance_curve_integration_method_adj, 12 | & i_calculate_or_read_adj_function, 13 | & i_chi_interpolation 14 | -------------------------------------------------------------------------------- /name_eccone.i: -------------------------------------------------------------------------------- 1 | c------------------------------------------------------ 2 | c namelist /eccone/ 3 | c------------------------------------------------------- 4 | 5 | namelist /eccone/ ncone,zst,rst,phist,betast,alfast,alpha1,alpha2, 6 | &na1,na2,powtot, 7 | &raypatt,gzone,nray_in,mray,cr, 8 | &n_mesh_disk_radial_bin,n_mesh_disk_angle_bin, 9 | &rho_launching_disk,sigma_launching_disk, 10 | &part_gauss_power, 11 | &rho_focus_disk,d_disk, 12 | &initial_azimuth_angle_degree 13 | -------------------------------------------------------------------------------- /name_edge_prof_nml.i: -------------------------------------------------------------------------------- 1 | c------------------------------------------------------------------ 2 | c namelist to set the table of exponential density fall off distance 3 | c outside LCFS starting at rho=1 density 4 | c at different polidal mesh 5 | c-------------------------------------------------------------------- 6 | namelist /edge_prof_nml/ 7 | &i_edge_dens_anal, 8 | &i_edge_dens_rz_mesh, 9 | &n_pol_edge_dens, 10 | &sigmedgn,sigmedgt, 11 | &theta_pol_edge_dens_ar_degree, 12 | &sigmedgn_ar, 13 | &dens_min_edge,temp_min_edge, 14 | &theta_pol_edge_1_degree, !for analitical formula of sigma_edge_n 15 | &theta_pol_edge_2_degree, ! 16 | &sigma_theta_pol_edge_1_degree, 17 | &sigma_theta_pol_edge_2_degree, 18 | &sigma_edgen_0, 19 | &sigma_edgen_1, 20 | &sigma_edgen_2, 21 | &sigma_wall_n, 22 | &sigma_lim_toroidal_degree, 23 | &nxeqd_add,nyeqd_add 24 | -------------------------------------------------------------------------------- /name_genr.i: -------------------------------------------------------------------------------- 1 | c------------------------------------------------------- 2 | c namelist /genr/ 3 | c------------------------------------------------------- 4 | 5 | namelist /genr/ r0x,b0,outdat,stat,mnemonic,rayop,dielectric_op, 6 | &partner, outnetcdf, outprint, outxdraw 7 | -------------------------------------------------------------------------------- /name_grill.i: -------------------------------------------------------------------------------- 1 | c------------------------------------------------------- 2 | c namelist grill 3 | c------------------------------------------------------- 4 | 5 | namelist /grill/ i_n_poloidal,n_theta_pol,ksi_nperp, 6 | *i_rho_cutoff,rho_step_find_LHFW_cutoff, 7 | *rho_initial_find_LHFW_cutoff, 8 | *ngrilld, !the old name for ngrill for old genray.in files 9 | *ngrill,igrillpw,igrilltw,rhopsi0,thgrill, 10 | *phigrill,height,nthin,anmin,anmax,nnkpar,powers, 11 | &antormin,antormax,nnktor,anpolmin,anpolmax,nnkpol, 12 | &ilaunch,r0launch,z0launch,phi0launch,i_grill_pol_mesh, 13 | &i_grill_npar_ntor_npol_mesh 14 | 15 | -------------------------------------------------------------------------------- /name_lsc_approach_nml.i: -------------------------------------------------------------------------------- 1 | c namelist to read input data for LSC approach 2 | 3 | namelist /lsc_approach_nml/ 4 | & EdcTSC_min, 5 | &i_lsc_approach, 6 | &v_par_lsc_dev_vte_max, 7 | &nv_lsc_ql_lh, 8 | &n_psi_TSC, 9 | &icount_iter_max, 10 | &eps_diff_d_ql, 11 | &n_power_steps, 12 | &n_dim_radii_f_plots, 13 | &n_radii_f_plots_ar 14 | -------------------------------------------------------------------------------- /name_non_uniform_mesh_profiles_line.i: -------------------------------------------------------------------------------- 1 | c----------------------------------------------------------------- 2 | c namelists for all table plasma profiles at non uniform 3 | c radial mesh written by lines: 4 | c----------------------------------------------------------------- 5 | namelist /dentab_nonuniform_line/ nj_tab,prof_2d,radii_2d 6 | namelist /temtab_nonuniform_line/ nj_tab,prof_2d,radii_2d 7 | namelist /tpoptab_nonuniform_line/ nj_tab,prof_2d,radii_2d 8 | namelist /vflowtab_nonuniform_line / nj_tab,prof_2d,radii_2d 9 | namelist /zeftab_nonuniform_line / nj_tab,prof_2d,radii_2d 10 | -------------------------------------------------------------------------------- /name_tokamak.i: -------------------------------------------------------------------------------- 1 | c-------------------------------------------------------- 2 | c namelist /tokamak/ 3 | c------------------------------------------------------------- 4 | namelist /tokamak/ indexrho,ipsi,ionetwo,ieffic,psifactr, 5 | +deltripl,nloop,i_ripple,eqdskin,NR, 6 | &n_wall,max_limiters,n_limiter,r_wall,z_wall, 7 | &r_limiter,z_limiter,phi_limiter, 8 | &h_add_wall,ieffic_mom_cons 9 | -------------------------------------------------------------------------------- /name_uniform_mesh_profiles.i: -------------------------------------------------------------------------------- 1 | c----------------------------------------------------------------- 2 | c namelists for all table plasma profiles 3 | c at the uniform radial mesh 4 | c----------------------------------------------------------------- 5 | namelist /dentab/ prof 6 | namelist /temtab/ prof 7 | namelist /tpoptab/ prof 8 | namelist /vflowtab/ prof 9 | namelist /zeftab/ zeff1 10 | namelist /EdcTSCtab/ prof 11 | namelist /JparTSCtab/prof 12 | -------------------------------------------------------------------------------- /ninit_ec.f: -------------------------------------------------------------------------------- 1 | c **********************ninit_ec************************ 2 | c * this subroutine creates 3 | c * tangent to the magnetic surface, the components 4 | c * of the refractive index cnteta,cnphi 5 | c * at the initial point (zu0,ru0,phiu0) for ECR wave 6 | c ****************************************************** 7 | c 8 | c------------------------------------------------------------------ 9 | c ! 10 | c input parameters: ! 11 | c zu0,ru0,phiu0,cnx,cny,cnz ! 12 | c output parameters: ! 13 | c cnteta,cnphi ! 14 | c------------------------------------------------------------------ 15 | subroutine ninit_ec(zu0,ru0,phiu0,cnx,cny,cnz,cnteta,cnphi) 16 | implicit none !double precision (a-h,o-z) 17 | c------------------------------------------------------------------ 18 | c e_phi=e_psi x e_phi, x -is the vector product. 19 | c z r phi 20 | c e_phi= { 0 , 0 , 1 } 21 | c e_psi= { dpsidz, dpsidr , 0 }/mod(grad(psi)) 22 | c e_teta={ dpsidr,-dpsidz , 0 }/mod(grad(psi)) 23 | c 24 | c x y z 25 | c e_phi= {-sin(phiu0) , cos(phiu0) , 0 } 26 | c e_teta={-cos(phiu0)dpsidz,-sin(phiu0)dpsidz, dpsidr } 27 | c 28 | c N_teta=(vector{N}*e_teta) ,N_phi=(vector{N}*e_phi) 29 | c---------------------------------------------------------------------- 30 | include 'param.i' 31 | include 'one.i' 32 | real*8 zu0,ru0,phiu0,cnx,cny,cnz,cnteta,cnphi ! IN/OUT 33 | real*8 gradpsi, cosphi,sinphi !,costet,sintet ! local 34 | c--------------------------------------------------------------------- 35 | c dpdrd=dpsidr dpdzr=dpsidr were calculated by b(z,r,phi) 36 | c They are in common/one/ 37 | c--------------------------------------------------------------------- 38 | gradpsi=dsqrt(dpdrd*dpdrd+dpdzd*dpdzd) 39 | cosphi=dcos(phiu0) 40 | sinphi=dsin(phiu0) 41 | if(gradpsi.gt.0.d0)then !YuP[2020-08-17] Added check of gradpsi=0 42 | !costet=dpdzd/gradpsi 43 | !sintet=dpdrd/gradpsi 44 | !cntet=-cnx*costet*cosphi-cny*costet*sinphi+cnz*sintet !YuP: not used 45 | cnteta=(-dpdzd*(cnx*cosphi+cny*sinphi)+dpdrd*cnz)/gradpsi 46 | else 47 | !cntet=0.d0 48 | cnteta=0.d0 49 | endif 50 | cnphi=-cnx*sinphi+cny*cosphi 51 | 52 | c write(*,*)'ninit_ec.f cnteta,cnphi',cnteta,cnphi 53 | 54 | return 55 | end 56 | 57 | 58 | 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /nperpcom.i: -------------------------------------------------------------------------------- 1 | c The data for the parameters of the plasma species. 2 | c They are used in hot non-relativistic dispersion. 3 | c Here nbulka is the max number of the plasma species. 4 | c integer nbulka !it is in param.i 5 | c parameter(nbulka=5) 6 | double precision nllc,massc,tec,xc,yc,tpopc,vflowc 7 | integer nbulkc 8 | common/nperpcom/nllc,massc(nbulka),tec(nbulka), 9 | .xc(nbulka),yc(nbulka),tpopc(nbulka),vflowc(nbulka), 10 | .nbulkc 11 | -------------------------------------------------------------------------------- /onetwo.i: -------------------------------------------------------------------------------- 1 | 2 | c the data for the profiles of the absorbed power and current drive. 3 | c PARAMETER (NRA) is set in param.i 4 | 5 | include 'onetwo_nml.i' 6 | include 'onetwo_no_nml.i' 7 | c 8 | c NR is the maximal number of points in the small radius direction 9 | c for the 10 | c calculations of the power and current drive radial profiles 11 | c in each radial bin. 12 | c NRA= maximal value of NR. It is set in param.i 13 | c power_e is the absorbed power due to collisionless electron damping 14 | c power_i is the absorbed power due to collisionless ion damping 15 | c power_s is the absorbed power due to coll'less ion damping on each ion 16 | c power_cl is the absorbed power due to collisional damping 17 | c spower_e summed absorbed power due to coll'less electron damping 18 | c spower_i summed absorbed power due to collisionless ion damping 19 | c spower_i summed absorbed power due to coll'less ion damping on each ion 20 | c spower_cl summed absorbed power due to collisional damping 21 | c allcur total current 22 | c densprof,temprof,zefprof for output of radial profiles to .nc file 23 | c 24 | c050406 25 | c currtot is a total current along B field 26 | c 27 | c cur_den_parallel is the flux surface averaged parallel current density 28 | c from one ray 29 | c 30 | c s_cur_den_parallel is the flux surface averaged parallel current density 31 | c from all rays 32 | c 33 | c binarea_pol is bin area of the poloidal cross-section at theta poloidal=0 34 | -------------------------------------------------------------------------------- /onetwo_nml.i: -------------------------------------------------------------------------------- 1 | 2 | c the data for the profiles of the absorbed power and current drive. 3 | c PARAMETER (NRA) is set in param.i 4 | c It has namelist data only 5 | 6 | c-----from namelist /tokamak/ 7 | integer 8 | &NR 9 | 10 | common/onetwo_nml/ 11 | & NR 12 | 13 | c--------------------------------------------------------------------------------- 14 | c NR is the maximal number of points in the small radius direction 15 | c for the 16 | c calculations of the power and current drive radial profiles 17 | c in each radial bin. 18 | c NRA= maximal value of NR. It is set in param.i 19 | c--------------------------------------------------------------------------------- 20 | -------------------------------------------------------------------------------- /outinit.f: -------------------------------------------------------------------------------- 1 | c ********************** outinit*********************** 2 | c * ----- * 3 | c * outinit is used in dinit to prepare output * 4 | c * data for 3D F-P code * 5 | c * outinit subroutine. * 6 | c * * 7 | c **************************************************** 8 | subroutine outinit(u) 9 | !implicit integer (i-n), real*8 (a-h,o-z) 10 | implicit none 11 | real*8 z1,r1,phi1,cnz1,cnr1,cm1, u 12 | include 'param.i' 13 | include 'write.i' 14 | dimension u(*) 15 | 16 | z1=u(1) 17 | r1=u(2) 18 | phi1=u(3) 19 | cnz1=u(4) 20 | cnr1=u(5) 21 | cm1=u(6) 22 | 23 | nrayelt=0 24 | zold=u(1) 25 | rold=u(2) 26 | 27 | return 28 | end 29 | 30 | -------------------------------------------------------------------------------- /output_no_nml.i: -------------------------------------------------------------------------------- 1 | 2 | c The data for subroutine outpt 3 | c Here no namelist data 4 | 5 | 6 | logical 7 | & first,was_not_ox_conversion 8 | 9 | common /output/ 10 | 11 | c-----logical 12 | &first,was_not_ox_conversion 13 | 14 | c----------------------------------------------------------------------------- 15 | c was_not_ox_conversion !for OX jump 16 | c--------------------------------------------------------------- 17 | -------------------------------------------------------------------------------- /oxb.i: -------------------------------------------------------------------------------- 1 | c The data for subroutine in oxb.f 2 | 3 | !YuP[2020-01] Collected same-type variables into separate blocks, 4 | !for better alignment 5 | 6 | logical was_in_ox_vicinity 7 | common/oxb_logical/was_in_ox_vicinity 8 | 9 | integer nrayelt_o_cutoff, 10 | &i_call_prep3d_in_output_at_i_ox_conversion_eq_1 11 | common/oxb_int/nrayelt_o_cutoff, 12 | &i_call_prep3d_in_output_at_i_ox_conversion_eq_1 13 | 14 | real*8 transm_ox_old 15 | common /oxb/transm_ox_old 16 | 17 | real*8 rhoconv, rho_plasm_vac !YuP[2020-07-29] added 18 | common /oxb/ rhoconv, rho_plasm_vac 19 | ! rhoconv is rho at Xe=1.0 conversion layer, 20 | ! calculated in sub.ox_conversion_grill_in_poloidal_point. 21 | ! rho_plasm_vac is rho at plasma-vacuum border; 22 | ! normally, it would be at rho=1.0, but if edge density is high, 23 | ! Xe=1 layer could be just outside of rho=1.0 24 | ! Then, we define rho_plasm_vac as max(rhoconv,1.0)+0.1 25 | ! (or slightly different, see sub.bound) 26 | ! The value of rho_plasm_vac is used in sub.bound in i_ox=1 run. 27 | 28 | c was_in_ox_vicinity !for OX jump 29 | c transm_ox_old the previous value of the transmission coefficient 30 | c 31 | c i_call_prep3d_in_output_at_i_ox_conversion_eq_1 - It is used 32 | c in prep3d.f to calculate the transmission coefficient 33 | c when prep3d was called in output after OX conversion point 34 | c determination 35 | c 36 | c nrayelt_o_cutoff is the number of ray point where O cutoff was 37 | c found 38 | -------------------------------------------------------------------------------- /pathscale-module_portal_pppl.csh: -------------------------------------------------------------------------------- 1 | #Kumar, Sept'09. Source this before using makefile_pathscale_portal_pppl. 2 | module load pathscale/3.2 3 | module load mpich 4 | module load netcdf 5 | module load acml 6 | module load fftw/2.1.5 7 | module load pgplot 8 | -------------------------------------------------------------------------------- /pgconst.i: -------------------------------------------------------------------------------- 1 | c 2 | cDefines some REAL*4 constants used when calling pgplot library routines 3 | c 4 | REAL*4 :: R40=0.,R4P1=.1,R4P2=.2,R4P3=.3,R4P4=.4,R4P5=.5 5 | REAL*4 :: R4P8=.8,R4P95=.95,R41P5=1.5 6 | REAL*4 :: R41=1.,R42=2.,R43=3.,R44=4.,R45=5.,R46=6.,R47=7.,R48=8. 7 | REAL*4 :: R43P8=3.8,R431=31.,R470=70.,R4110=110.,R41P4=1.4 8 | REAL*4 :: R445=45.,R4165=165.,R44P75=4.75,R410=10. 9 | 10 | !BH201124: For some reason, use of the following leads to a 11 | ! "multiple definition of `pgconst_'" compiler error, when 12 | ! both contour.f and mk_graph.f are loaded together. 13 | ! Even number of cnsts for common, to maintain alignment 14 | ! common /pgconst/R40,R4P1,R4P2,R4P3,R4P4,R4P5,R4P8,R4P95,R41P5, 15 | ! + R41,R42,R43,R44,R45,R46,R47,R48, 16 | ! + R43P8,R431,R470,R4110,R41P4, 17 | ! + R445,R4165,R44P75,R410 18 | 19 | -------------------------------------------------------------------------------- /plot_dens.f: -------------------------------------------------------------------------------- 1 | double precision function psi0_minus_psi_zr(r) 2 | c-------------------------------------------------- 3 | c calculates function: psi0_minus_psi_zr=psi_0-psi(z_0,r) 4 | c-------------------------------------------------- 5 | implicit none 6 | c-----input 7 | double precision 8 | & r ! major radius 9 | 10 | double precision 11 | & psi_0, !poloidal flux from /common_psi_m_psi_zr/ 12 | & z_0 !vertical coordinate from /common_psi_m_psi_zr/ 13 | common /common_psi_m_psi_zr/ psi_0,z_0 ! input data 14 | c-----externals 15 | double precision psif 16 | 17 | psi0_minus_psi_zr=psi_0-psif(z_0,r) 18 | 19 | return 20 | end 21 | 22 | subroutine r_min_r_max_from_psi_z(psi0,z0,accuracy, 23 | & rmin_psi_z,rmax_psi_z) 24 | c---------------------------------------------------------- 25 | c calculates two major radus points: rmin_psi_z,rmax_psi_z 26 | c at the flux surface with the given poloidal flux: psi 27 | c at the given vertical coordinate: z 28 | c---------------------------------------------------------- 29 | implicit none 30 | c-----input 31 | double precision 32 | & psi0, ! poloidal flux 33 | & z0, ! vertical coordinate 34 | & accuracy ! accuracy of root calciulations 35 | 36 | 37 | include 'param.i' 38 | include 'three.i' 39 | include 'five.i' 40 | c-----output 41 | double precision rmin_psi_z,rmax_psi_z 42 | c-----local 43 | double precision X1,X2 44 | 45 | c-----externals 46 | double precision rtbis,psi_m_psi_zr 47 | external psi_m_psi_zr 48 | double precision 49 | & psi_0, !poloidal flux in /common_psi_m_psi_zr/ 50 | & z_0 !vertical coordinate in /common_psi_m_psi_zr/ 51 | common /common_psi_m_psi_zr/ psi_0,z_0 ! input data 52 | 53 | c---------------------------------------------------------- 54 | c put parameters to common / common_psi_m_psi_zr/ 55 | c---------------------------------------------------------- 56 | psi_0=psi0 57 | z_0=z_0 58 | c---------------------------------------------------------- 59 | 60 | X1=xma 61 | X2=rmax*(1.d0+1.d-4) 62 | rmax_psi_z=rtbis(psi_m_psi_zr,x1,x2,accuracy) 63 | 64 | X1=rmin*(1.d0-1.d-4) 65 | X2=xma 66 | rmin_psi_z=rtbis(psi_m_psi_zr,x1,x2,accuracy) 67 | 68 | return 69 | end 70 | 71 | -------------------------------------------------------------------------------- /plot_n_perp_omega.f: -------------------------------------------------------------------------------- 1 | subroutine plot_cold_n_perp_omega_npar(z,r,phi,cnpar, 2 | &ratio_freq_min,ratio_freq_max,n_plot_freq) 3 | c 4 | implicit none 5 | 6 | include 'param.i' 7 | include 'one.i' 8 | c-----input 9 | real*8 10 | &z,r,phi, ! space coordinates 11 | & ratio_freq_min, ! frequency_min/frqncy 12 | & ratio_freq_max, ! frequency_max/frqncy 13 | & cnpar ! N_parallel 14 | 15 | integer n_plot_freq !number of points of frequency mesh 16 | c-----locals 17 | real*8 freq_loc,freq_min,freq_max,step,df, cnpar_loc, 18 | &eps,g,eta,det,yi,xi,a2,a0 19 | 20 | real*8, dimension(1:nbulk) :: v_loc,w_loc 21 | real*8, dimension(1:n_plot_freq) :: freq_ar,n_perp2_p,n_perp2_m 22 | integer n,i 23 | c-----external 24 | real*8 b,x,y 25 | 26 | freq_min=ratio_freq_min*frqncy 27 | freq_max=ratio_freq_max*frqncy 28 | 29 | step=(freq_max-freq_min)/(n_plot_freq-1) 30 | 31 | bmod=b(z,r,phi) 32 | do i=1,nbulk 33 | v_loc(i)=v(i) 34 | w_loc(i)=w(i) 35 | enddo 36 | 37 | do n=1,n_plot_freq 38 | 39 | freq_loc= freq_min+step*(n-1) 40 | freq_ar(n)= freq_loc 41 | df=frqncy/freq_loc 42 | 43 | do i=1,nbulk 44 | v(i)=v_loc(i)*df* df 45 | w(i)=w_loc(i)*df 46 | enddo !i 47 | 48 | cnpar_loc=cnpar*df 49 | 50 | eps=1.d0 51 | g=0.d0 52 | eta=1.d0 53 | 54 | do i=1,nbulk 55 | xi=x(z,r,phi,i) 56 | yi=y(z,r,phi,i) 57 | 58 | eps=eps-xi/(1.d0-yi**2) 59 | eta=eta-xi 60 | 61 | if (i.eq.1) then 62 | g=g+xi*yi/(1.d0-yi**2) 63 | else 64 | g=g-xi*yi/(1.d0-yi**2) 65 | endif 66 | enddo !i 67 | 68 | c--------dispersion relation 69 | c eps*N_perp**4-a2*N_perp**2+a0=0 70 | 71 | a2=(eps+eta)*(eps-cnpar_loc**2)-g*g 72 | a0=eta*((eps-cnpar_loc**2)**2-g*g) 73 | 74 | det=a2*a2-4.d0*eps*a0 75 | 76 | if (det.ge.0) then 77 | n_perp2_p(n)=(a2+dsqrt(det))/(2.d0*eps) 78 | n_perp2_p(n)=(a2-dsqrt(det))/(2.d0*eps) 79 | else 80 | n_perp2_p(n)=0.d0 81 | n_perp2_p(n)=0.d0 82 | endif 83 | 84 | enddo !n 85 | 86 | do i=1,nbulk 87 | v(i)=v_loc(i) 88 | w(i)=w_loc(i) 89 | enddo !i 90 | 91 | call plot1dt(freq_ar,n_perp2_p,0,0,n_plot_freq,1, 92 | &'linlin',0.d0,0.d0, 93 | &'freq GHZ','N_perp**2_p') 94 | 95 | call plot1dt(freq_ar,n_perp2_m,0,0,n_plot_freq,1, 96 | &'linlin',0.d0,0.d0, 97 | &'freq GHZ','N_perp**2_m') 98 | 99 | return 100 | end 101 | 102 | 103 | -------------------------------------------------------------------------------- /pyctest-runner.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import os, sys, platform 4 | import multiprocessing as mp 5 | import pyctest.pyctest as pyctest 6 | import pyctest.helpers as helpers 7 | 8 | directory = "./" 9 | 10 | # these are required 11 | 12 | pyctest.PROJECT_NAME = "GENRAY" 13 | pyctest.SOURCE_DIRECTORY = directory 14 | pyctest.BINARY_DIRECTORY = directory 15 | 16 | args = helpers.ArgumentParser(pyctest.PROJECT_NAME, 17 | pyctest.SOURCE_DIRECTORY, 18 | pyctest.BINARY_DIRECTORY).parse_args() 19 | 20 | pyctest.BUILD_COMMAND = "make -f makefile_gfortran64" 21 | 22 | test = pyctest.test() 23 | test.SetName("test-CMod-LH-edge") 24 | test.SetProperty("WORKING_DIRECTORY","00_Genray_Regression_Tests/ci-tests/test-CMod-LH-edge") 25 | test.SetCommand(["../test.sh"]) 26 | 27 | test = pyctest.test() 28 | test.SetName("test-CMod-LH-edge-id16") 29 | test.SetProperty("WORKING_DIRECTORY","00_Genray_Regression_Tests/ci-tests/test-CMod-LH-edge-id16") 30 | test.SetCommand(["../test.sh"]) 31 | 32 | test = pyctest.test() 33 | test.SetName("EC-ITER-Centra-CD") 34 | test.SetProperty("WORKING_DIRECTORY","00_Genray_Regression_Tests/ci-tests/test-EC-ITER-Centra-CD") 35 | test.SetCommand(["../test.sh"]) 36 | 37 | 38 | pyctest.run() 39 | -------------------------------------------------------------------------------- /rkutta.i: -------------------------------------------------------------------------------- 1 | 2 | c The numerical parameters used in Runge Kutta solvers 3 | real*8 prmt 4 | common/rkutta/prmt(9) 5 | 6 | -------------------------------------------------------------------------------- /rrange.i: -------------------------------------------------------------------------------- 1 | 2 | c The parameters used in mathcurba subroutine 3 | c --- rrange.i 4 | c 5 | c --- to specify the range of real numbers 6 | c 7 | real rsmall, rbig 8 | c parameter (rsmall = 1.797e-99, rbig = 2.225e99) 9 | parameter (rsmall = 1.e-38, rbig = 1.e38) 10 | real srsmall, srbig 11 | c parameter (srsmall = 3.434e-50, srbig = 4.717e49) 12 | parameter (srsmall = 1.e-19, srbig = 1.e19) 13 | c 14 | c srsmall = rsmall**(1/2) srbig = rbig**(1/2) 15 | c 16 | real trsmall, trbig 17 | c parameter (trsmall = 1.216e-33, trbig = 1.305e33) 18 | parameter (trsmall = 2.154433e-13, trbig = 4.641593e12) 19 | c 20 | c trsmall = rsmall**(1/3) trbig = rbig**(1/3) 21 | c 22 | real ttrsmall, ttrbig 23 | c parameter (ttrsmall = 1.478e-66, ttrbig = 1.704e66) 24 | parameter (ttrsmall = 4.641581e-26, ttrbig = 2.154438e25) 25 | 26 | c 27 | c ttrsmall = rsmall**(2/3) ttrbig = rbig**(2/3) 28 | c 29 | -------------------------------------------------------------------------------- /s.f: -------------------------------------------------------------------------------- 1 | c ********************** s ************************ 2 | c * - * 3 | c * this subroutine calculates six different sums * 4 | c * that are used by rside for cold plasma dispersion * 5 | c ***************************************************** 6 | c 7 | c------------------------------------------------------------------- 8 | c ! 9 | c input parameters ! 10 | c ! 11 | c z, r phi - coordinates of the point where the angle is ! 12 | c calculated. ! 13 | c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ! 14 | c ! 15 | c output parameters ! 16 | c 17 | c s1 = 1 - sum_(i.ne.ib) { x_i/[1-(y_i)**2] }, sum is present only if ib>1 18 | c (sum_i is present only if ib>1) 19 | c s2 = 1 - sum_(i.ne.ib) { x_i/[1-y_i] }, sum is present only if ib>1 20 | c sum_(i.ne.ib) means the sum over non-resonant ion species 21 | c 22 | c s3 = 1 - sum_(i) { x_i/[1+y_i] }, 23 | c 24 | c s4 = 1 - sum_(i) { x_i } - x_1 , 25 | c 26 | c s6 = 1 - sum_(i) {x_i/[1-y_i]} , sum_i is present only if ib=1 27 | c 28 | c s7 = 1 - sum_(i) {x_i/[1-(y_i)**2]} , sum_i is present only if ib=1 29 | c 30 | c sum_() is over i=2,nbulk (ion species); 31 | c ib can be one of 1,nbulk; nbulk - number of bulk particles 32 | c------------------------------------------------------------------- 33 | subroutine s(z,r,phi,s1,s2,s3,s4,s6,s7) 34 | !implicit double precision (a-h,o-z) 35 | implicit none !YuP[2020-01-14] 36 | real*8 z,r, phi,s1,s2,s3,s4,s6,s7 37 | real*8 ds1,ds2,ds3,ds4,ds6,ds7,xi,x,yi,y,pps 38 | integer i 39 | include 'param.i' 40 | include 'one.i' 41 | ds1=0.d0 42 | ds2=0.d0 43 | ds3=0.d0 44 | ds4=0.d0 45 | ds6=0.d0 46 | ds7=0.d0 47 | 48 | if (nbulk.gt.1) then 49 | c if 1 begin 50 | do 10 i=2,nbulk ! sum is over i=2,nbulk (ion species) 51 | 52 | xi=x(z,r,phi,i) 53 | yi=y(z,r,phi,i) 54 | ds3=ds3+xi/(1.d0+yi) 55 | ds4=ds4+xi 56 | 57 | c if 2 begin 58 | if (ib.eq.1) then 59 | ds6=ds6+xi/(1.d0-yi) 60 | ds7=ds7+xi/(1.d0-yi*yi) 61 | end if 62 | c if 2 end 63 | 64 | if ((i.eq.ib).or.(ib.eq.1)) goto 10 65 | ds1=ds1+xi/(1.d0-yi*yi) 66 | ds2=ds2+xi/(1.d0-yi) 67 | 10 continue 68 | 69 | end if 70 | c if 1 end 71 | c finish if ef nbulk.gt.1 72 | s1=1.d0-ds1 73 | s2=1.d0-ds2 74 | s3=1.d0-ds3 75 | pps=x(z,r,phi,1) ! Xe for electrons is added 76 | s4=1.d0-ds4-pps 77 | s6=1.d0-ds6 78 | s7=1.d0-ds7 79 | 80 | return 81 | end 82 | -------------------------------------------------------------------------------- /scatnper.i: -------------------------------------------------------------------------------- 1 | 2 | c data for the scattering of the perpendicular refractive index 3 | c parameter nscat_n ! It should be given in the param.i file 4 | 5 | include 'scatnper_nml.i' 6 | include 'scatnper_no_nml.i' 7 | 8 | c------------------------------------------------- 9 | c iscat it is the switch for the n_perp scattering 10 | c iscat=1 the scattering swithed on, =0 swithed off 11 | c 12 | c rhoscat(1:nscat_n) small radii for the scattering location 13 | c 14 | c The scattering of the polar angle deltheta will be 15 | c deltheta=dsqrt(2.d0*scatd)*ranorm(fseed) 16 | c scatd(0) the mean square scattering angle (radians**2) 17 | c for the plasma boundary reflection points 18 | c 19 | c scatd(0:nscat_n) the mean square scattering angles (radians**2) 20 | c for the interior plasma boundary points 21 | c rhooldsc the value of the small radius from the previous time step 22 | c It will be calculated in genray and output subroutines. 23 | c------------------------------------------------------------------- 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /scatnper_nml.i: -------------------------------------------------------------------------------- 1 | 2 | c the data for the scattering of the perpendicular refractive index 3 | c parameter nscat_n ! It should be given in the param.i file 4 | c All data are from namelist 5 | 6 | 7 | real*8 8 | c-----from namelist /scatnper/ 9 | &rhoscat, 10 | &scatd 11 | c-----from namelist /scatnper/ 12 | integer 13 | &iscat, 14 | cSAP120511 15 | &iscat_lh_nicola 16 | 17 | common/scatnper_nml/ 18 | &rhoscat(1:nscat_n), 19 | &scatd(0:nscat_n), 20 | &iscat, 21 | cSAP120511 22 | &iscat_lh_nicola 23 | c------------------------------------------------- 24 | c iscat it is the switch for the n_perp scattering 25 | c iscat=1 the scattering swithed on, =0 swithed off 26 | c 27 | c rhoscat(1:nscat_n) small radii for the scattering location 28 | c 29 | c The scattering of the polar angle deltheta will be 30 | c deltheta=dsqrt(2.d0*scatd)*ranorm(fseed) 31 | c scatd(0) the mean square scattering angle (radians**2) 32 | c for the plasma boundary reflection points 33 | c 34 | c scatd(0:nscat_n) the mean square scattering angles (radians**2) 35 | c for the interior plasma boundary points 36 | c rhooldsc the value of the small radius from the previous time step 37 | c It will be calculated in genray and output subroutines. 38 | c------------------------------------------------------------------- 39 | c iscat_lh_nicola=1 to use scattering procedure lh_scattering 40 | c =0 do not use lh_scattering 41 | c 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /scatnper_no_nml.i: -------------------------------------------------------------------------------- 1 | 2 | c the data for the scattering of the perpendicular refractive index 3 | c parameter nscat_n ! It should be given in the param.i file 4 | c Here no namelist data 5 | 6 | 7 | real*8 rhooldsc 8 | 9 | common/scatnper_no_nml/ 10 | & rhooldsc 11 | c------------------------------------------------- 12 | c iscat it is the switch for the n_perp scattering 13 | c iscat=1 the scattering swithed on, =0 swithed off 14 | c 15 | c rhoscat(1:nscat_n) small radii for the scattering location 16 | c 17 | c The scattering of the polar angle deltheta will be 18 | c deltheta=dsqrt(2.d0*scatd)*ranorm(fseed) 19 | c scatd(0) the mean square scattering angle (radians**2) 20 | c for the plasma boundary reflection points 21 | c 22 | c scatd(0:nscat_n) the mean square scattering angles (radians**2) 23 | c for the interior plasma boundary points 24 | c rhooldsc the value of the small radius from the previous time step 25 | c It will be calculated in genray and output subroutines. 26 | c------------------------------------------------------------------- 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /se.f: -------------------------------------------------------------------------------- 1 | c ********************** se ********************** 2 | c * - * 3 | c * this subroutine calculates eight different sums * 4 | c * that are used by efield in cold plasma * 5 | c **************************************************** 6 | c 7 | c------------------------------------------------------------------- 8 | c ! 9 | c input parameters ! 10 | c ! 11 | c z, r phi - coordinates of the point where the angle is ! 12 | c calculated. ! 13 | c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ! 14 | c ! 15 | c output parameters ! 16 | c ! 17 | c s1 = 1 - sum_(i.ne.ib) { x_i/[1-(y_i)**2] }, at ib.ne.1 ! 18 | c ! 19 | c s2 = 1 - sum_(i.ne.ib) { x_i/[1-y_i] }, at ib.ne.1 ! 20 | c ! 21 | c s3 = 1 - sum_(i) { x_i/[1+y_i] }, ! 22 | c ! 23 | c s4 = 1 - sum_(i) { x_i } - x_1 , ! 24 | c ! 25 | c s5 = sum_(i) { x_i * y_i/[1-y_i*y_i] } , at ib.eq.1 ! 26 | c ! 27 | c s6 = 1 - sum_(i) {x_i/[1-y_i] , at ib.eq.1 ! 28 | c ! 29 | c s7 = 1 - sum_(i) {x_i/[1-(y_i)**2] , at ib.eq.1 ! 30 | c ! 31 | c s8 = sum_(i) (i.ne.ib) { x_i * y_i/[1-y_i*y_i] } , ! 32 | c ! 33 | c i=2,nbulk; ib=1,nbulk; nbulk - number of bulk particles ! 34 | c------------------------------------------------------------------- 35 | subroutine se(z,r,phi,s1,s2,s3,s4,s5,s6,s7,s8) 36 | !implicit double precision (a-h,o-z) 37 | implicit none !YuP[2020-01-14] 38 | real*8 z,r,phi,s1,s2,s3,s4,s5,s6,s7,s8 39 | real*8 ds1,ds2,ds3,ds4,ds5,ds6,ds7,ds8,xi,x,yi,y,pps 40 | integer i 41 | include 'param.i' 42 | include'one.i' 43 | ds1=0.d0 44 | ds2=0.d0 45 | ds3=0.d0 46 | ds4=0.d0 47 | ds5=0.d0 48 | ds6=0.d0 49 | ds7=0.d0 50 | ds8=0.d0 51 | 52 | if (nbulk.gt.1) then 53 | c if 1 begin 54 | do 10 i=2,nbulk 55 | 56 | xi=x(z,r,phi,i) 57 | yi=y(z,r,phi,i) 58 | ds3=ds3+xi/(1.+yi) 59 | ds4=ds4+xi 60 | c if 2 begin 61 | if (ib.eq.1) then 62 | ds5=ds5+xi*yi/(1.-yi*yi) 63 | ds6=ds6+xi/(1.-yi) 64 | ds7=ds7+xi/(1.-yi*yi) 65 | end if 66 | c if 2 end 67 | 68 | if ((i.eq.ib).or.(ib.eq.1)) goto 10 69 | ds1=ds1+xi/(1.-yi*yi) 70 | ds2=ds2+xi/(1.-yi) 71 | ds8=ds8+xi*yi/(1.-yi*yi) 72 | 10 continue 73 | 74 | end if 75 | c if 1 end 76 | c finish if ef nbulk.gt.1 77 | s1=1.-ds1 78 | s2=1.-ds2 79 | s3=1.-ds3 80 | pps=x(z,r,phi,1) 81 | s4=1.-ds4-pps 82 | s5=ds5 83 | s6=1.-ds6 84 | s7=1.-ds7 85 | s8=ds8 86 | return 87 | end 88 | -------------------------------------------------------------------------------- /six.i: -------------------------------------------------------------------------------- 1 | 2 | c The spline coefficients for the density ,temperature,tpop,vflow,zeff 3 | c radial profiles 4 | c parameter (ndensa) It is given in param.i 5 | c parameter (ndens4a=ndensa+4) 6 | 7 | include 'six_nml.i' 8 | include 'six_no_nml.i' 9 | 10 | c--------------------------------------------------------------------------- 11 | c ndensa is the max number of points in arrays with the plasma density, 12 | c temperature and zeff. 13 | c ndens4a is the max number of points in the arrays for the spline 14 | c approximation of the plasma density, temperature and zeff 15 | c nbulka is the max number of plasma component =1 for the electron plasma 16 | c must be .ge. nbulk 17 | c-------------------------------------------------------------------------- 18 | 19 | -------------------------------------------------------------------------------- /six_nml.i: -------------------------------------------------------------------------------- 1 | 2 | c The declarion of namelits data used in common /six_nml/ 3 | c 4 | c zeff is in the namelist: namelist /zeftab/zeff1 5 | c 6 | c Arrays dens1,temp1,tpop1,vflow1 are storages for plasma profiles 7 | c 8 | c parameter (ndensa) It is given in param.i 9 | c parameter (nbulka) It is given in param.i 10 | 11 | real*8 12 | c-----/zeftab/ 13 | &zeff1,dens1,temp1,tpop1,vflow1, !profiles at uniform radial mesh 14 | !rhom(i=1,...,ndens)=(i-1)/(ndens-1) 15 | c----calulated using dinit_nml.i data------------------------------------- 16 | &zeff1_nonuniform,dens1_nonuniform, ! profiles at nonuniform radial mesh 17 | &temp1_nonuniform,tpop1_nonuniform, ! radii_...(nbulka,ndensa) 18 | &vflow1_nonuniform, ! 19 | &radii_nonuniform_zeff1,radii_nonuniform_dens1, !radii_... 20 | &radii_nonuniform_temp1,radii_nonuniform_tpop1, ! 21 | &radii_nonuniform_vflow1 22 | ! 23 | integer nj_tab_zeff1, !number of radial point 24 | &nj_tab_dens1,nj_tab_temp1, !used for the given profile 25 | &nj_tab_tpop1,nj_tab_vflow1 ! 26 | 27 | common/six_nml/ 28 | &zeff1(ndensa), 29 | &dens1(ndensa,nbulka), 30 | &temp1(ndensa,nbulka), 31 | &tpop1(ndensa,nbulka), 32 | &vflow1(ndensa,nbulka), 33 | &zeff1_nonuniform(ndensa,nbulka), 34 | &dens1_nonuniform(ndensa,nbulka), 35 | &temp1_nonuniform(ndensa,nbulka), 36 | &tpop1_nonuniform(ndensa,nbulka), 37 | &vflow1_nonuniform(ndensa,nbulka), 38 | &radii_nonuniform_zeff1(ndensa,nbulka), 39 | &radii_nonuniform_dens1(ndensa,nbulka), 40 | &radii_nonuniform_temp1(ndensa,nbulka), 41 | &radii_nonuniform_tpop1(ndensa,nbulka), 42 | &radii_nonuniform_vflow1(ndensa,nbulka), 43 | &nj_tab_zeff1(nbulka), 44 | &nj_tab_dens1(nbulka), 45 | &nj_tab_temp1(nbulka), 46 | &nj_tab_tpop1(nbulka), 47 | &nj_tab_vflow1(nbulka) 48 | c------------------------------------------------------------------------- 49 | c ndensa is the max number of points in arrays with the plasma density, 50 | c temperature and zeff. 51 | c ndens4a is the max number of points in the arrays for the spline 52 | c approximation of the plasma density, temperature and zeff 53 | c nbulka is the max number of plasma component =1 for the electron plasma 54 | c must be .ge. nbulk 55 | c----------------------------------------------------------------------------- 56 | 57 | -------------------------------------------------------------------------------- /spline_distrib.i: -------------------------------------------------------------------------------- 1 | c----------------------------------------------------- 2 | c the data for the spline coefficients for the distribution function 3 | c f(y,x,rho,ngena) 4 | c 5 | c rho(ir) is the normalized small radius ir=1,lrz 6 | c y(i,ir) is the pitch angle i=1,...iy_(ir) 7 | c x(j) is the normalized momentun x=P/(mVnorm) j=1,jx 8 | c ngena is the max number of plasma species 9 | 10 | c double precision fxx,fyy,fxxyy,wk 11 | c common/spline_distrib/ fxx(iya,jxa,lrza,ngena), 12 | c &fyy(iya,jxa,lrza,ngena),fxxyy(iya,jxa,lrza,ngena), 13 | c &ibd(4),wk(nwka) 14 | 15 | real*8, pointer :: 16 | &fxx(:,:,:,:), !(iya,jxa,lrza,ngena) 17 | &fyy(:,:,:,:), !(iya,jxa,lrza,ngena) 18 | &fxxyy(:,:,:,:), !(iya,jxa,lrza,ngena) 19 | &wk(:) !(nwka=1+3*max(jxa,iya)), 20 | 21 | integer ibd(4),nwk 22 | 23 | common/spline_distrib/ 24 | &fxx, !(iya,jxa,lrza,ngena) 25 | &fyy, !(iya,jxa,lrza,ngena) 26 | &fxxyy, !(iya,jxa,lrza,ngena) 27 | &wk, !(nwka), 28 | &ibd, !(4), 29 | &nwk ! nwka 30 | -------------------------------------------------------------------------------- /stop.f: -------------------------------------------------------------------------------- 1 | subroutine STOP(x,i) 2 | character x*50 3 | WRITE(*,*)'x' 4 | stop 5 | return 6 | end 7 | -------------------------------------------------------------------------------- /svn-commit.tmp: -------------------------------------------------------------------------------- 1 | Update comments and version="genray_v10.0_111109" 2 | 3 | --This line, and those below, will be ignored-- 4 | 5 | M README_genray_devel 6 | M param.i 7 | -------------------------------------------------------------------------------- /tensrcld.f: -------------------------------------------------------------------------------- 1 | c ********************tensrcld************************ 2 | c * * 3 | c * this subroutine calculates the components of * 4 | c * the complex dielectric tensor reps(3,3) * 5 | c * for cold plasma * 6 | c ***************************************************** 7 | c------------------------------------------------------------- 8 | c input parameters ! 9 | c rz,r,phi coordinates of ray point ! 10 | c ..... ! 11 | c rho-small radius was calculated in subroutine: b ! 12 | c rho is in common one ! 13 | c output parameter ! 14 | c reps(3,3)-complex dielectric tensor in common /eps/ ! 15 | c------------------------------------------------------------ 16 | subroutine tensrcld(z,r,phi) 17 | implicit none !integer (i-n), real*8 (a-h,o-z) 18 | include 'param.i' 19 | include 'one.i' 20 | include 'eps.i' 21 | real*8 z,r,phi !INPUT 22 | real*8 x,y !external functions 23 | real*8 xe,ye,xi,yi,epsper,epspar,g !local 24 | integer i 25 | c write(*,*)'in tensrcld ' 26 | xe=x(z,r,phi,1) 27 | ye=y(z,r,phi,1) 28 | epsper=1.d0-xe/(1.d0-ye*ye) 29 | g=xe*ye/(1.d0-ye*ye) 30 | 31 | epspar=1.d0-xe 32 | 33 | do i=2,nbulk 34 | xi=x(z,r,phi,i) 35 | yi=y(z,r,phi,i) 36 | epsper=epsper-xi/(1.d0-yi*yi) 37 | epspar=epspar-xi 38 | g=g-xi*yi/(1.d0-yi*yi) 39 | enddo 40 | c------------------------------------------------- 41 | reps(1,1)=dcmplx(epsper,0.d0) 42 | reps(1,2)=dcmplx(0.d0,g) 43 | reps(2,1)=-reps(1,2) 44 | reps(2,2)=reps(1,1) 45 | reps(3,3)=dcmplx(epspar,0.d0) 46 | reps(1,3)=dcmplx(0.d0,0.d0) 47 | reps(3,1)=dcmplx(0.d0,0.d0) 48 | reps(2,3)=dcmplx(0.d0,0.d0) 49 | reps(3,2)=dcmplx(0.d0,0.d0) 50 | c------------------------------------------------- 51 | c for test 52 | c gel=xe*ye/(1-ye*ye) 53 | c gion=0.d0 54 | c do i=2,nbulk 55 | c xi=x(z,r,phi,i) 56 | c yi=y(z,r,phi,i) 57 | c gion=gion+xi*yi/(1.d0-yi*yi) 58 | c enddo 59 | c gtest=gel-gion 60 | c write(*,*)'in tensrcld gel,gion,gtest,reps(1,2)' 61 | c write(*,*)gel,gion,gtest,reps(1,2) 62 | c------------------------------------------------- 63 | 64 | return 65 | end 66 | 67 | -------------------------------------------------------------------------------- /test_read_write_namelists.f: -------------------------------------------------------------------------------- 1 | program test 2 | c------reads genray.dat using read_all_namelists 3 | c------writes new genray.dat using write_all_namelists 4 | call prepare_genray_input 5 | stop 6 | end 7 | 8 | subroutine check_err(iret) 9 | integer iret 10 | include 'netcdf.inc' 11 | if (iret .ne. NF_NOERR) then 12 | c write(*,*) nf_strerror(iret) 13 | write(*,*) 'netCDF error' 14 | stop 'check_err:' 15 | endif 16 | end 17 | -------------------------------------------------------------------------------- /test_read_write_namelists/README: -------------------------------------------------------------------------------- 1 | Tests read_write_namelists.f. 2 | 3 | Copy a test genray.in (e.g. genray.in_test7) 4 | to genray.in. The test reads genray.in and 5 | re-writes over it using namelist writes. 6 | 7 | -------------------------------------------------------------------------------- /test_read_write_namelists/bcast.f: -------------------------------------------------------------------------------- 1 | c 2 | c 3 | subroutine bcast(a,val,n) 4 | implicit integer (i-n), real*8 (a-h,o-z) 5 | 6 | c.................................................................. 7 | c Temporary bcast routine until I can find UNICOS equivalent 8 | c.................................................................. 9 | 10 | dimension a(n) 11 | do 100 i=1,n 12 | a(i)=val 13 | 100 continue 14 | return 15 | end 16 | c 17 | c 18 | subroutine ibcast(ia,ival,n) 19 | implicit integer (i-n), real*8 (a-h,o-z) 20 | 21 | c.................................................................. 22 | c Temporary bcast routine until I can find UNICOS equivalent 23 | c.................................................................. 24 | 25 | dimension ia(n) 26 | do 100 i=1,n 27 | ia(i)=ival 28 | 100 continue 29 | return 30 | end 31 | 32 | c NME bcast routine for complex arrays 33 | subroutine ccast(c,cval,n) 34 | implicit integer (i-n), complex*16 (c) 35 | dimension c(n) 36 | do 100 i=1,n 37 | c(i)=cval 38 | 100 continue 39 | return 40 | end 41 | 42 | subroutine r4bcast(a,val,n) 43 | implicit integer (i-n), real*4 (a-h,o-z) 44 | 45 | c.................................................................. 46 | c Temporary bcast routine until I can find UNICOS equivalent 47 | c.................................................................. 48 | 49 | dimension a(n) 50 | do 100 i=1,n 51 | a(i)=val 52 | 100 continue 53 | return 54 | end 55 | c 56 | -------------------------------------------------------------------------------- /test_read_write_namelists/makefile_read_write_namelists: -------------------------------------------------------------------------------- 1 | SHELL= /bin/sh 2 | NAME= read_write 3 | SOURCES= read_write_genray_input.f bcast.f partner.f \ 4 | zcunix.f test_read_write_namelists.f 5 | OBJECTS = $(SOURCES:.f=.o) 6 | LOCATION= -L/usr/lib64 -L/usr/local/pgplot 7 | LIBRARIES= -lX11 -lnetcdff -lnetcdf -lpgplot 8 | DEBUG = -g 9 | OPTIMIZE = -O 10 | LISTING = -Mlist 11 | SPECIAL = -byteswapio -Mbackslash 12 | LDSPECIAL = 13 | INCLUDE = .. 14 | COMPILE = gfortran -c -I $(INCLUDE) $(OPTIMIZE) # or use $(DEBUG) 15 | LOAD = gfortran -o $(NAME) $(LDSPECIAL) $(DEBUG) # Remove -m for optimize 16 | PROTECT = chmod 755 17 | DELETE = rm -f 18 | 19 | # The following gives suffixes to be used in checking for suffix rules. 20 | # Written without dependencies, it may be useful to turn of such checking? 21 | .SUFFIXES: 22 | 23 | $(NAME): $(OBJECTS) 24 | $(LOAD) $(OBJECTS) $(LOCATION) $(LIBRARIES) 25 | $(PROTECT) $(NAME) 26 | 27 | # Following use of pattern matching works; 28 | # it is based on statements in Sect. 10.7 of gmake Manual 29 | # by Stallman and McGrath. 30 | 31 | # see Sect. 4.10.1, Static Pattern Rules. 32 | $(OBJECTS): %.o: %.f 33 | $(COMPILE) $< -o $@ 34 | 35 | rebuild: 36 | $(COMPILE) $(SOURCES) 37 | $(LOAD) $(OBJECTS) $(LOCATION) $(LIBRARIES) 38 | 39 | clean: 40 | $(DELETE) $(NAME) $(OBJECTS) *.lst 41 | 42 | -------------------------------------------------------------------------------- /test_read_write_namelists/makefile_read_write_namelists_debug: -------------------------------------------------------------------------------- 1 | SHELL= /bin/sh 2 | NAME= read_write_debug 3 | SOURCES= read_write_genray_input.f bcast.f partner.f \ 4 | zcunix.f test_read_write_namelists.f 5 | OBJECTS = $(SOURCES:.f=.o) 6 | LOCATION= -L/usr/lib64 -L/usr/local/pgplot 7 | LIBRARIES= -lX11 -lnetcdff -lnetcdf -lpgplot 8 | DEBUG = -g 9 | OPTIMIZE = -O 10 | LISTING = -Mlist 11 | SPECIAL = -byteswapio -Mbackslash 12 | LDSPECIAL = 13 | INCLUDE = .. 14 | CSPECIAL= -frecord-marker=4 -fbounds-check 15 | COMPILE = gfortran -c $(CSPECIAL) $(DEBUG) -I $(INCLUDE) # or use $(OPTIMIZE) 16 | LOAD = gfortran -o $(NAME) $(LDSPECIAL) $(DEBUG) # Remove -m for optimize 17 | PROTECT = chmod 755 18 | DELETE = rm -f 19 | 20 | # The following gives suffixes to be used in checking for suffix rules. 21 | # Written without dependencies, it may be useful to turn of such checking? 22 | .SUFFIXES: 23 | 24 | $(NAME): $(OBJECTS) 25 | $(LOAD) $(OBJECTS) $(LOCATION) $(LIBRARIES) 26 | $(PROTECT) $(NAME) 27 | 28 | # Following use of pattern matching works; 29 | # it is based on statements in Sect. 10.7 of gmake Manual 30 | # by Stallman and McGrath. 31 | 32 | # see Sect. 4.10.1, Static Pattern Rules. 33 | $(OBJECTS): %.o: %.f 34 | $(COMPILE) $< -o $@ 35 | 36 | rebuild: 37 | $(COMPILE) $(SOURCES) 38 | $(LOAD) $(OBJECTS) $(LOCATION) $(LIBRARIES) 39 | 40 | clean: 41 | $(DELETE) $(NAME) $(OBJECTS) *.lst 42 | 43 | -------------------------------------------------------------------------------- /test_read_write_namelists/test_read_write_namelists.f: -------------------------------------------------------------------------------- 1 | program test 2 | c------reads genray.dat using read_all_namelists 3 | c------writes new genray.dat using write_all_namelists 4 | call prepare_genray_input 5 | stop 6 | end 7 | 8 | subroutine check_err(iret) 9 | integer iret 10 | include 'netcdf.inc' 11 | if (iret .ne. NF_NOERR) then 12 | c write(*,*) nf_strerror(iret) 13 | write(*,*) 'netCDF error' 14 | stop 'check_err:' 15 | endif 16 | end 17 | -------------------------------------------------------------------------------- /three.i: -------------------------------------------------------------------------------- 1 | 2 | c Scalar input data from the eqdskin (default="equilib.dat") file 3 | real*8 4 | 1 xdimeqd,ydimeqd,rdimeqd,zdimeqd, 5 | 1 xeqmin,xeqmax,yeqmin,yeqmax,zeqmin,zeqmax, 6 | 2 reqd,redeqd,ymideqd,zmideqd,xma,yma, 7 | 3 psimag,psilim,beqd,toteqd, 8 | 4 psimx1,psimx2,xax1,xax2,zax1,zax2, 9 | 5 psisep,xsep,ysep 10 | integer nxeqd,nyeqd,nveqd,nnlim,nnves 11 | common/three/ 12 | 1 xdimeqd,ydimeqd,rdimeqd,zdimeqd, 13 | 1 xeqmin,xeqmax,yeqmin,yeqmax,zeqmin,zeqmax, 14 | 2 reqd,redeqd,ymideqd,zmideqd,xma,yma, 15 | 3 psimag,psilim,beqd,toteqd, 16 | 4 psimx1,psimx2,xax1,xax2,zax1,zax2, 17 | 5 psisep,xsep,ysep,nxeqd,nyeqd,nveqd,nnlim,nnves 18 | -------------------------------------------------------------------------------- /transport_prof.i: -------------------------------------------------------------------------------- 1 | c This include file originally for passing data from subroutines 2 | c read_transport_prof to write_transport_prof (in partner.f). 3 | c Now include in genray.f in order to set nj and pass it to 4 | c write_transport_prof for cases in which read_transport_prof 5 | c is not called.. 6 | 7 | !YuP[2020-01] Collected same-type variables into separate blocks, 8 | !for better alignment 9 | 10 | integer nspeca,nja 11 | parameter (nspeca=nbulka,nja=nra) 12 | c nspeca is a maximum number of transport code species(e+ions) 13 | c nja is maximum length of transport code small radial mesh 14 | 15 | integer nj !the number of radial points in 16 | !transport profiles 17 | common/transport_prof_int/nj 18 | 19 | real*8 r_transport(nja) !transport code small radial mesh [cm] 20 | real*8 dr_transp 21 | common/transport_prof/ dr_transp,r_transport -------------------------------------------------------------------------------- /ugetio.f: -------------------------------------------------------------------------------- 1 | C IMSL ROUTINE NAME - UGETIO 2 | C LATEST REVISION - JUNE 1, 1981 3 | C PURPOSE - TO RETRIEVE CURRENT VALUES AND TO SET NEW 4 | C VALUES FOR INPUT AND OUTPUT UNIT 5 | C IDENTIFIERS. 6 | C USAGE - CALL UGETIO(IOPT,NIN,NOUT) 7 | C ARGUMENTS IOPT - OPTION PARAMETER. (INPUT) 8 | C IF IOPT=1, THE CURRENT INPUT AND OUTPUT 9 | C UNIT IDENTIFIER VALUES ARE RETURNED IN NIN 10 | C AND NOUT, RESPECTIVELY. 11 | C IF IOPT=2, THE INTERNAL VALUE OF NIN IS 12 | C RESET FOR SUBSEQUENT USE. 13 | C IF IOPT=3, THE INTERNAL VALUE OF NOUT IS 14 | C RESET FOR SUBSEQUENT USE. 15 | C NIN - INPUT UNIT IDENTIFIER. 16 | C OUTPUT IF IOPT=1, INPUT IF IOPT=2. 17 | C NOUT - OUTPUT UNIT IDENTIFIER. 18 | C OUTPUT IF IOPT=1, INPUT IF IOPT=3. 19 | C PRECISION/HARDWARE - SINGLE/ALL 20 | C NOTATION - INFORMATION ON SPECIAL NOTATION AND 21 | C CONVENTIONS IS AVAILABLE IN THE MANUAL 22 | C INTRODUCTION OR THROUGH IMSL ROUTINE UHELP 23 | C REMARKS EACH IMSL ROUTINE THAT PERFORMS INPUT AND/OR OUTPUT 24 | C OPERATIONS CALLS UGETIO TO OBTAIN THE CURRENT UNIT 25 | C IDENTIFIER VALUES. IF UGETIO IS CALLED WITH IOPT=2 OR 26 | C IOPT=3, NEW UNIT IDENTIFIER VALUES ARE ESTABLISHED. 27 | C SUBSEQUENT INPUT/OUTPUT IS PERFORMED ON THE NEW UNITS. 28 | SUBROUTINE UGETIO(IOPT,NIN,NOUT) 29 | INTEGER IOPT,NIN,NOUT 30 | INTEGER NIND,NOUTD 31 | DATA NIND/7/,NOUTD/6/ 32 | IF (IOPT.EQ.3) GO TO 10 33 | IF (IOPT.EQ.2) GO TO 5 34 | IF (IOPT.NE.1) GO TO 9005 35 | NIN = NIND 36 | NOUT = NOUTD 37 | GO TO 9005 38 | 5 NIND = NIN 39 | GO TO 9005 40 | 10 NOUTD = NOUT 41 | 9005 RETURN 42 | END 43 | -------------------------------------------------------------------------------- /uspkd.f: -------------------------------------------------------------------------------- 1 | C ROUTINE NAME - USPKD 2 | C LATEST REVISION - NOVEMBER 1, 1984 3 | C PURPOSE - NUCLEUS CALLED BY IMSL ROUTINES THAT HAVE 4 | C CHARACTER STRING ARGUMENTS 5 | C USAGE - CALL USPKD (PACKED,NCHARS,UNPAKD,NCHMTB) 6 | C ARGUMENTS PACKED - CHARACTER STRING TO BE UNPACKED.(INPUT) 7 | C NCHARS - LENGTH OF PACKED. (INPUT) SEE REMARKS. 8 | C UNPAKD - INTEGER ARRAY TO RECEIVE THE UNPACKED 9 | C REPRESENTATION OF THE STRING. (OUTPUT) 10 | C NCHMTB - NCHARS MINUS TRAILING BLANKS. (OUTPUT) 11 | C PRECISION/HARDWARE - SINGLE/ALL 12 | C REQD. IMSL ROUTINES - NONE 13 | C REMARKS 1. USPKD UNPACKS A CHARACTER STRING INTO AN INTEGER ARRAY 14 | C IN (A1) FORMAT. 15 | C 2. UP TO 129 CHARACTERS MAY BE USED. ANY IN EXCESS OF 16 | C THAT ARE IGNORED. 17 | SUBROUTINE USPKD (PACKED,NCHARS,UNPAKD,NCHMTB) 18 | INTEGER NC,NCHARS,NCHMTB 19 | INTEGER UNPAKD(1),IBLANK 20 | CHARACTER*(*) PACKED 21 | DATA IBLANK /1H / 22 | C INITIALIZE NCHMTB 23 | NCHMTB = 0 24 | C RETURN IF NCHARS IS LE ZERO 25 | IF(NCHARS.LE.0) RETURN 26 | C SET NC=NUMBER OF CHARS TO BE DECODED 27 | NC = MIN0 (129,NCHARS) 28 | READ (PACKED,150) (UNPAKD(I),I=1,NC) 29 | 150 FORMAT (129A1) 30 | C CHECK UNPAKD ARRAY AND SET NCHMTB 31 | C BASED ON TRAILING BLANKS FOUND 32 | DO 200 N = 1,NC 33 | NN = NC - N + 1 34 | IF(UNPAKD(NN) .NE. IBLANK) GO TO 210 35 | 200 CONTINUE 36 | NN = 0 37 | 210 NCHMTB = NN 38 | RETURN 39 | END 40 | -------------------------------------------------------------------------------- /wall_density.f: -------------------------------------------------------------------------------- 1 | subroutine create_wall_density 2 | implicit none 3 | 4 | return 5 | end 6 | 7 | subroutine create_fine_mesh_for_chamber_wall_coordinates 8 | c It uses input wall arrays r_wall(n_wall_a),z_wall(n_wall_a) 9 | c from one_nml.i 10 | c 11 | c Using linear approximation it creates new arrays 12 | c r_wall_add(n_wall_add_a),z_wall_add(n_wall_add_a) 13 | c they will be in fourb.i 14 | c The distance between additional point and old mesh points 15 | c is h_add_wall*k 16 | 17 | 18 | implicit none 19 | include 'param.i' 20 | include 'one.i' 21 | include 'fourb.i' 22 | 23 | c-----locals 24 | integer i,j,k,ki, 25 | &n_wall_all !number of points in r_wall_add and z_wall_add arrays 26 | 27 | real*8 28 | &length_wall, !poloidal wall length 29 | &delta_r_wall,delta_z_wall, !r,z lengths of the wall element 30 | &delta_length_wall 31 | 32 | length_wall=0.d0 33 | do i=1,n_wall-1 34 | length_wall=length_wall+dsqrt((r_wall(i+1)-r_wall(i))**2+ 35 | & (z_wall(i+1)-z_wall(i))**2) 36 | enddo 37 | 38 | j=0 39 | do i=1,n_wall-1 40 | delta_r_wall=r_wall(i+1)-r_wall(i) 41 | delta_z_wall=r_wall(i+1)-r_wall(i) 42 | delta_length_wall=dsqrt(delta_r_wall**2+delta_z_wall**2) 43 | 44 | j=j+1 45 | r_wall_add(j)=r_wall(i) 46 | z_wall_add(j)=z_wall(i) 47 | 48 | if (delta_length_wall.gt.h_add_wall) then 49 | c-----------add additional wall points 50 | j=j+1 51 | 52 | ki= delta_length_wall/h_add_wall ! number of additional wall points 53 | ! at the interval(i,i+1) 54 | do k=1,ki 55 | j=j+1 56 | if (j.gt.n_wall_add_a) then 57 | write(*,*)'in create_fine_wall_mesh' 58 | write(*,*)'j.gt.n_wall_add_a' 59 | write(*,*)'j,n_wall_ad_a',j,n_wall_add_a 60 | write(*,*)'Please increase n_wall_add_a' 61 | write(*,*)'in param.i and recompile the code' 62 | stop 'create_seldom_mesh_for_chamber_wall_coordinates' 63 | endif 64 | r_wall_add(j)=r_wall(i)+ 65 | & delta_r_wall*h_add_wall*k/delta_length_wall 66 | z_wall_add(j)=z_wall(i)+ 67 | & delta_z_wall*h_add_wall*k/delta_length_wall 68 | enddo 69 | endif 70 | 71 | enddo 72 | 73 | return 74 | end 75 | 76 | 77 | -------------------------------------------------------------------------------- /xdraw.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/compxco/genray/b5f4de9d2d09c7d0a2746a12b36dc6d597a202ec/xdraw.tar.gz -------------------------------------------------------------------------------- /xdraw/README: -------------------------------------------------------------------------------- 1 | README_xdraw -------------------------------------------------------------------------------- /xdraw/README_xdraw: -------------------------------------------------------------------------------- 1 | /home/bobh/cql3d/genray/genray_cvs/xdraw 2 | 3 | The xdraw code was constructed by Sheryl M. Glasser. 4 | The make utility gives the executable xdraw1, which 5 | is then linked to xdraw. 6 | 7 | Usage is 8 | xdraw xxxx 9 | where xxxx is one of the drawxxxx.in files in 10 | the xdraw_input/ directory. 11 | 12 | xdraw plots data which is output by the genray 13 | code into *.bin files. The drawxxxx.in file 14 | specifies the input file and the quantities 15 | which are to be plotted. 16 | 17 | Nov 14, 2004 18 | ============ 19 | 20 | Sheryl Glasser points out that it possible 21 | to PS only using 22 | psonly: 1 23 | in the xdraw.ini file. 24 | Won't get the plots to the X-windows screen. 25 | 26 | -------------------------------------------------------------------------------- /xdraw/dcon.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/compxco/genray/b5f4de9d2d09c7d0a2746a12b36dc6d597a202ec/xdraw/dcon.bin -------------------------------------------------------------------------------- /xdraw/draw.in: -------------------------------------------------------------------------------- 1 | Type (G=Graph, C=Contour): G 2 | 3 | filename 4 | dcon.bin 5 | 6 | graph title: Surface Quantities 7 | 8 | variable names 9 | 0 psifac 10 | 1 f 11 | 2 mu0 p 12 | 3 q 13 | 4 ArcSinh DI 14 | 5 ArcSinh DR 15 | 6 ArcSinh H 16 | 7 ArcSinh ca1 17 | 18 | ix iy title 19 | 0 1 f = R BT 20 | 0 2 Plasma Pressure 21 | 0 3 Safety Factor 22 | 0 6 Toroidal Asymmetry Factor H 23 | 0 4 5 Mercier Criterion, DI > 0 => Unstable 24 | 0 7 High-n Ballooning, CA1 < 0 => Unstable 25 | -------------------------------------------------------------------------------- /xdraw/gendefs.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | ** NAME GENDEFS.H 3 | ** AUTHOR Sheryl M. Glasser 4 | ** 5 | ** DESCRIPTION 6 | ** structures LOOP and CURVE_SET xdraw.c, xinit.c 7 | ** 8 | ** Copyright (c) GlassWare 1994. All rights reserved. 9 | ******************************************************************************/ 10 | #ifdef UNIX 11 | #define Int int 12 | #define Long int 13 | typedef int byte; 14 | #else 15 | #define Int long 16 | #define Long long 17 | typedef unsigned char byte; 18 | #endif 19 | 20 | #define FZ (float)0 21 | #define FH (float).5 22 | 23 | #ifdef UNIX 24 | #define addfloat(bx,ix0) bx+ix0; 25 | #endif 26 | 27 | #define float_to_int(fx1) (int) ( (fx1>=FZ) ? (fx1+FH) : (fx1-FH) ) 28 | 29 | #define dprintf printf 30 | #define NOX (mydisplay==NULL) 31 | 32 | #if defined(MOTIF) 33 | #elif defined(MSWINDOWS) 34 | #else 35 | #define XCALLS 36 | #ifndef UNIX 37 | #define DOS 38 | #endif 39 | #endif 40 | 41 | #if defined(DOS) 42 | #define xprintf xPrintf /* in xmslib.c */ 43 | #else 44 | #ifndef XPRINTF /* dialog fns in setcolor.c */ 45 | extern void xprintf(const char *, ...); 46 | #else 47 | extern void xprintf(const char *, int, int, int, int, int, int, int, int); 48 | #endif /* end XPRINTF */ 49 | #endif /* end not DOS */ 50 | 51 | extern int xinput(char *, int *); 52 | 53 | -------------------------------------------------------------------------------- /xdraw/glx.h: -------------------------------------------------------------------------------- 1 | /*----------------------------------------------------------------------------- 2 | | glx.h 3 | -----------------------------------------------------------------------------*/ 4 | extern void init_glx(Display *, Window, unsigned long, unsigned long, 5 | Font, XFontStruct *, XEvent *, int, int); 6 | extern void prefposition(int mx1, int mx2, int my1, int my2); 7 | extern long winopen(char *p); 8 | extern void minsize(long dx, long dy); 9 | extern void winconstraints(void); 10 | extern void maxsize(long,long); 11 | extern void minsize(long,long); 12 | extern int windepth (long win); 13 | extern void winpop(void); 14 | extern void winpush(void); 15 | extern long winget(void); 16 | extern void winset(long win); 17 | 18 | extern void cpack(long color); 19 | extern long glx_index(long color); 20 | extern void clear(void); 21 | extern void rectfi(int x1, int y1, int x2, int y2); 22 | extern void recti(int x1, int y1, int x2, int y2); 23 | 24 | extern void cmov2i(int x, int y); 25 | extern void v2i(long xy[]); 26 | extern void drawstr(char *s); 27 | extern void bgnpolygon(void); 28 | extern void endpolygon(void); 29 | extern void bgnline(void); 30 | extern void endline(void); 31 | 32 | extern void popmatrix(void); 33 | extern void getorigin(long *x, long *y); 34 | extern void qdevice(int dev); 35 | extern int getvaluator(int dev); 36 | 37 | extern int getdescender(void); 38 | extern int getheight(void); 39 | extern void scale_font(int scale); 40 | extern long getstrwidth(char *text); 41 | 42 | #ifdef NOT_YET 43 | zap_events 44 | add_event 45 | #endif 46 | -------------------------------------------------------------------------------- /xdraw/makefile: -------------------------------------------------------------------------------- 1 | makefile_mainline -------------------------------------------------------------------------------- /xdraw/makefile_franklin: -------------------------------------------------------------------------------- 1 | CFLAGS_DEBUG = -g -DUNIX -D_HPUX_SOURCE 2 | CFLAGS_EXEC = -O -DUNIX -D_HPUX_SOURCE 3 | CFLAGS = $(CFLAGS_DEBUG) 4 | C89FLAGS = -g -DUNIX -D_HPUX_SOURCE 5 | NEWCFLAGS = -g +FPV -DUNIX -D_HPUX_SOURCE 6 | CC = gcc 7 | COM = gcc $(C89FLAGS) -c 8 | MAP = 9 | 10 | DRAW1 = xdraw.o xinit.o limits.o binread.o 11 | DRAW1A = redraw.o xcontour.o event.o xedit.o ps.o 12 | DRAW3M = xtoolsm.o setcolor.o menu.o menuwin.o glx.o 13 | DRAW3 = xtools.o setcolor.o spline.o 14 | DRAW4 = xtoolsw.o setcolor.o xmotif.o 15 | 16 | xdraw1: $(DRAW1) $(DRAW1A) $(DRAW3) 17 | $(CC) -o xdraw1 $(DRAW1) \ 18 | $(DRAW1A) \ 19 | $(DRAW3) \ 20 | -lm -L/usr/X11R6/lib64 -lX11 21 | 22 | xdraw: linkx $(DRAW1) $(DRAW3M) 23 | $(CC) -o xdraw $(DRAW1) \ 24 | $(DRAW3M) \ 25 | -lm -L/usr/X11R6/lib64 -lX11 26 | 27 | xdraww: linkw $(DRAW1) $(DRAW4) 28 | $(CC) -o xdraww $(DRAW1) \ 29 | $(DRAW4) \ 30 | -lm -L/usr/X11R6/lib64 -lXm -lXt -bloadmap:map 31 | 32 | resource: XDraw 33 | xrdb -merge XDraw 34 | 35 | linkx: 36 | @-ln -f -s xtools.c xtoolsm.c 37 | linkw: 38 | @-ln -f -s xtools.c xtoolsw.c 39 | 40 | smaller: smaller.o 41 | $(CC) -o smaller smaller.o -lm 42 | 43 | xdraw.o: xdraw.c xdraw.h curves.h xcontour.h xtools.h ps.h 44 | xinit.o: xinit.c xdraw.h curves.h 45 | spline.o: spline.h 46 | limits.o: limits.c curves.h 47 | event.o: event.c curves.h 48 | binread.o: binread.c 49 | redraw.o: redraw.c xdraw.h curves.h ps.h 50 | xcontour.o: xcontour.c xcontour.h curves.h xdraw.h xtools.h ps.h 51 | xedit.o: xedit.c curves.h xinit.h xtools.h 52 | xtools.o: xtools.c xtools.h ps.h 53 | setcolor.o: setcolor.c setcolor.h 54 | menu.o: menu.c menu.h menuwin.h curves.h xdraw.h xtools.h xcontour.h ps.h 55 | menuwin.o: menuwin.c menuwin.h glx.h device.h 56 | glx.o: glx.c glx.h 57 | ps.o: ps.c ps.h 58 | smaller: smaller.c 59 | 60 | xtoolsm.o: xtoolsm.c xtools.h ps.h 61 | $(CC) -g -DUNIX -DUSE_MENU -c xtoolsm.c 62 | xtoolsw.o: xtoolsw.c xtools.h ps.h 63 | $(CC) -g -DUNIX -DMOTIF -c xtoolsw.c 64 | 65 | dump: dump.o 66 | $(CC) -o dump dump.o 67 | 68 | SRC2 = cprint.o 69 | cprint: $(SRC2) 70 | $(CC) -o cprint $(SRC2) 71 | 72 | xdata: xdata.o 73 | $(CC) -o xdata xdata.o -lm 74 | 75 | SRC3 = pspack.o ps.o 76 | pspack: $(SRC3) 77 | $(CC) -o pspack $(SRC3) 78 | pspack.o: pspack.c pspack.h 79 | -------------------------------------------------------------------------------- /xdraw/makefile_mainline: -------------------------------------------------------------------------------- 1 | CFLAGS_DEBUG = -g -DUNIX -D_HPUX_SOURCE 2 | CFLAGS_EXEC = -O -DUNIX -D_HPUX_SOURCE 3 | CFLAGS = $(CFLAGS_DEBUG) 4 | C89FLAGS = -g -DUNIX -D_HPUX_SOURCE 5 | NEWCFLAGS = -g +FPV -DUNIX -D_HPUX_SOURCE 6 | CC = gcc 7 | COM = gcc $(C89FLAGS) -c 8 | MAP = 9 | 10 | DRAW1 = xdraw.o xinit.o limits.o binread.o 11 | DRAW1A = redraw.o xcontour.o event.o xedit.o ps.o 12 | DRAW3M = xtoolsm.o setcolor.o menu.o menuwin.o glx.o 13 | DRAW3 = xtools.o setcolor.o spline.o 14 | DRAW4 = xtoolsw.o setcolor.o xmotif.o 15 | 16 | xdraw1: $(DRAW1) $(DRAW1A) $(DRAW3) 17 | $(CC) -o xdraw1 $(DRAW1) \ 18 | $(DRAW1A) \ 19 | $(DRAW3) \ 20 | -lm -L/usr/lib/X11R5 -lX11 21 | 22 | xdraw: linkx $(DRAW1) $(DRAW3M) 23 | $(CC) -o xdraw $(DRAW1) \ 24 | $(DRAW3M) \ 25 | -lm -L/usr/lib/X11R5 -lX11 26 | 27 | xdraww: linkw $(DRAW1) $(DRAW4) 28 | $(CC) -o xdraww $(DRAW1) \ 29 | $(DRAW4) \ 30 | -lm -L/usr/lib/X11R5 -lXm -lXt -bloadmap:map 31 | 32 | resource: XDraw 33 | xrdb -merge XDraw 34 | 35 | linkx: 36 | @-ln -f -s xtools.c xtoolsm.c 37 | linkw: 38 | @-ln -f -s xtools.c xtoolsw.c 39 | 40 | smaller: smaller.o 41 | $(CC) -o smaller smaller.o -lm 42 | 43 | xdraw.o: xdraw.c xdraw.h curves.h xcontour.h xtools.h ps.h 44 | xinit.o: xinit.c xdraw.h curves.h 45 | spline.o: spline.h 46 | limits.o: limits.c curves.h 47 | event.o: event.c curves.h 48 | binread.o: binread.c 49 | redraw.o: redraw.c xdraw.h curves.h ps.h 50 | xcontour.o: xcontour.c xcontour.h curves.h xdraw.h xtools.h ps.h 51 | xedit.o: xedit.c curves.h xinit.h xtools.h 52 | xtools.o: xtools.c xtools.h ps.h 53 | setcolor.o: setcolor.c setcolor.h 54 | menu.o: menu.c menu.h menuwin.h curves.h xdraw.h xtools.h xcontour.h ps.h 55 | menuwin.o: menuwin.c menuwin.h glx.h device.h 56 | glx.o: glx.c glx.h 57 | ps.o: ps.c ps.h 58 | smaller: smaller.c 59 | 60 | xtoolsm.o: xtoolsm.c xtools.h ps.h 61 | $(CC) -g -DUNIX -DUSE_MENU -c xtoolsm.c 62 | xtoolsw.o: xtoolsw.c xtools.h ps.h 63 | $(CC) -g -DUNIX -DMOTIF -c xtoolsw.c 64 | 65 | dump: dump.o 66 | $(CC) -o dump dump.o 67 | 68 | SRC2 = cprint.o 69 | cprint: $(SRC2) 70 | $(CC) -o cprint $(SRC2) 71 | 72 | xdata: xdata.o 73 | $(CC) -o xdata xdata.o -lm 74 | 75 | SRC3 = pspack.o ps.o 76 | pspack: $(SRC3) 77 | $(CC) -o pspack $(SRC3) 78 | pspack.o: pspack.c pspack.h 79 | -------------------------------------------------------------------------------- /xdraw/menu.h: -------------------------------------------------------------------------------- 1 | /*----------------------------------------------------------------------------- 2 | | menu.h 3 | -----------------------------------------------------------------------------*/ 4 | extern void init_menus(); 5 | extern void set_selected_iwin(int); 6 | extern void menu_setwindows(int); 7 | 8 | -------------------------------------------------------------------------------- /xdraw/menuwin.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | ** NAME MENUWIN.H 3 | ** AUTHOR Sheryl M. Glasser 4 | ** 5 | ** DESCRIPTION 6 | ** Interface for menus 7 | ** 8 | ** Copyright (c) GlassWare 1993. All rights reserved. 9 | ******************************************************************************/ 10 | extern long newmenu(void); 11 | extern void addtomenu(long id, char *text, int *arg, long *submenu); 12 | extern void enablemenus(long mmain, char *title, int x, int y, 13 | void (*func) (char *)); 14 | extern void enable_menus(long mmain, char *title, int x, int y, 15 | int ndialog, void (*func) (char *)); 16 | extern int win_is_menu(long w); 17 | extern void set_menu_visibility(int i); 18 | extern int menu_event(int dev, short int state); 19 | extern void menu_ievent(long newwin); 20 | extern long get_cursorwin(void); 21 | extern void menu_backup(void); 22 | extern void menu_root(void); 23 | extern void redrawmenu(void *, int); 24 | extern void set_menubkgd(int, int, int, int); 25 | extern void set_menufore(int, int, int, int); 26 | extern unsigned long get_menubkgd(void); 27 | extern void raise_menu(void); 28 | extern void lower_menu(void); 29 | 30 | #define ANY -1 31 | #define UP 0 32 | #define DOWN 1 33 | 34 | 35 | -------------------------------------------------------------------------------- /xdraw/ps.h: -------------------------------------------------------------------------------- 1 | /*----------------------------------------------------------------------------- 2 | | PS.H 3 | -----------------------------------------------------------------------------*/ 4 | extern void postscript(char *title); 5 | extern void ps_dataname(char *s); 6 | extern void ps_suffix(char *p); 7 | extern void ps_init(char *ps_filename,char *ps_Ffontname,char data[]); 8 | extern void ps_color(float, float, float); 9 | extern void ps_comment(char *); 10 | extern void ps_line(int x1,int y1,int x2,int y2); 11 | extern void ps_stroke(void ); 12 | extern void ps_moveto(int x1,int y1); 13 | extern void ps_lineto(int x1,int y1); 14 | extern void ps_fmoveto(float x1,float y1); 15 | extern void ps_flineto(float x1,float y1); 16 | extern void ps_rectangle(int x1,int y1,int w,int h); 17 | extern void ps_clip(int x1,int y1,int w,int h); 18 | extern void ps_unclip(void ); 19 | extern void ps_thinline(void ); 20 | extern void ps_normalline(void ); 21 | extern void ps_font(int points ); 22 | extern void ps_setlabelfont(int); 23 | static void goodstring(char *string,int stringlen); 24 | extern void ps_draw_label(int lx1, int ly1, int lineno, char *s); 25 | extern void ps_draw_labelbox(int lx1, int ly1, int nline, char *longtext); 26 | extern void ps_rshowstring(int xpos,int ypos,char *string,int stringlen); 27 | extern void ps_showstring(int xpos,int ypos,char *string,int stringlen); 28 | extern void ps_centerstring(int x,int y,int above,char *s,int n); 29 | extern void ps_centervertically(int x,int y, int right,char *s,int n); 30 | extern void ps_power(int x_or_y, char *s2); 31 | extern void ps_string(char *string,int stringlen); 32 | extern void ps_rightjustify(int xpos,int ypos,char *string,int stringlen); 33 | extern void ps_translate(int xpos,int ypos); 34 | extern void ps_showpage(void ); 35 | extern void ps_adjustpage(int height, int bx1, int by1, int bw, int bh); 36 | extern void ps_scale(int height, int bx1,int by1,int bdx,int bdy); 37 | extern void ps_close(void ); 38 | extern void ps_save(int save); 39 | extern void writetrf(FILE *,FILE *,int,int,int,int,int,int); 40 | extern void ps_layout(int, int, int); 41 | extern void ps_country(int); 42 | extern int get_maxps(void); 43 | -------------------------------------------------------------------------------- /xdraw/pspack.h: -------------------------------------------------------------------------------- 1 | #ifndef noPROTO 2 | extern void main(int argc,char * *argv); 3 | extern void readsize(void ); 4 | extern void input(char *p,char *q); 5 | #endif 6 | 7 | -------------------------------------------------------------------------------- /xdraw/setcolor.h: -------------------------------------------------------------------------------- 1 | /*----------------------------------------------------------------------------- 2 | | setcolor.h 3 | -----------------------------------------------------------------------------*/ 4 | extern void set_xor(GC gc, int enable); 5 | extern void setcolor(int k, int ncurve, int how); 6 | extern float fancycolor(int k, int n,int i); 7 | extern void testpalette(int x, int y, int dx, int dy); 8 | extern unsigned long getcolor(int r, int g, int b); 9 | extern void hlsrgb(float hue, float light, float sat); 10 | static float value(float n1, float n2, float hue); 11 | extern int getgoodfont (char *fonttitle,int lowpoint,int highpoint, 12 | char *searchfontname); 13 | -------------------------------------------------------------------------------- /xdraw/spline.h: -------------------------------------------------------------------------------- 1 | /*----------------------------------------------------------------------------- 2 | | spline.h 3 | -----------------------------------------------------------------------------*/ 4 | extern int init_spline(int, int); 5 | extern void add_to_spline(int, float, float); 6 | extern int eval_spline(int, float, float *, float *, int); 7 | extern void fit_spline(void); 8 | extern void zap_spline(void); 9 | -------------------------------------------------------------------------------- /xdraw/wdraw.h: -------------------------------------------------------------------------------- 1 | /*************************************** 2 | * wdraw.h 3 | ***************************************/ 4 | #define WDR_QUIT 1 5 | #define WDR_PS 2 6 | #define WDR_MARKER 3 7 | 8 | extern HWND CreateMainWindow(char *, int, int); 9 | extern LRESULT CALLBACK WndEvent(HWND hWnd, UINT msgId, WPARAM w, LPARAM l ); 10 | extern void winRegister(const char *); 11 | extern void winDummy(void); 12 | extern void winEvent(void); 13 | -------------------------------------------------------------------------------- /xdraw/wtest.h: -------------------------------------------------------------------------------- 1 | /*************************************** 2 | * wtest.h 3 | ***************************************/ 4 | #define WT_QUIT 1 5 | #define WT_MSG 2 6 | #define WT_ARROW 3 7 | #define WT_CROSS 4 8 | 9 | -------------------------------------------------------------------------------- /xdraw/xcontour.h: -------------------------------------------------------------------------------- 1 | /*----------------------------------------------------------------------------- 2 | | xcontour.h 3 | -----------------------------------------------------------------------------*/ 4 | extern void redraw1(CURVE_SET *cp, 5 | float xmin, float xmax, float ymin, float ymax ); 6 | extern int new_ncurve(CURVE_SET *cp, char how); 7 | extern void contour_values(CURVE_SET *cp); 8 | extern void get_contlim(float *xlim, float *ylim); 9 | 10 | #ifdef XCONTOUR 11 | extern void drawcontour(float psi,int ii); 12 | extern FLAG *surround(FLAG *ilist, POINTS *p); 13 | extern POINTS_ *has_psi(float psi, int ir, int iz, POINTS_ *q); 14 | extern POINTS_ *same_as(POINTS_ *p); 15 | extern POINTS_ *nextpoint(int k,POINTS_ *q,POINTS_ *qln); 16 | extern double anglecmp(double a1, double a2); 17 | extern POINTS_ *save_linear(int ir,int mr,int n,QCOEFF *kp,POINTS_ *q); 18 | extern POINTS_ *save_extremum(int ir,int mr,int n,float psi,int how, 19 | QCOEFF *k,POINTS_ *q); 20 | extern void getquadcoeff(int n,int ir,int mr, QCOEFF *k); 21 | extern int getp00(int,int); 22 | extern float quadratic(QCOEFF *k, float psi, float x0); 23 | extern void savelevel(int how, int index, char *format); 24 | extern void savegrid(int ir,int iz); 25 | extern void psicount(float *buf, long bufsize, 26 | float psi0,float dpsi,int ncurve,float *count); 27 | #endif 28 | 29 | 30 | -------------------------------------------------------------------------------- /xdraw/xdialog.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | ** NAME xdialog.h 3 | ** AUTHOR Sheryl M. Glasser 4 | ** 5 | ** DESCRIPTION 6 | ** 7 | ** 8 | ** Copyright (c) GlassWare 1994. All rights reserved. 9 | ******************************************************************************/ 10 | Widget CreateEditDialog(Widget parent, int selected, Display *disp); 11 | 12 | -------------------------------------------------------------------------------- /xdraw/xdraw: -------------------------------------------------------------------------------- 1 | ./xdraw1 -------------------------------------------------------------------------------- /xdraw/xdraw.h: -------------------------------------------------------------------------------- 1 | /*----------------------------------------------------------------------------- 2 | | xdraw.h 3 | | If your "vanilla" c-compiler doesn't like prototypes, 4 | | you must compile with acc or gcc. 5 | -----------------------------------------------------------------------------*/ 6 | extern void main(int argc,char * *argv); 7 | extern int get_graph(Window w, int i0); 8 | extern void getscale(int wx0, int dwx, float xmin, float xmax, 9 | float *xscale, float *xoffset); 10 | extern float get_loopval(LOOP *qs, int i); 11 | extern int get_box_info(Window, XRectangle *, XRectangle *, 12 | float *, float *, float *, float *); 13 | extern int get_zoomed_limits(CURVE_SET *, float *, float *, float *, float *); 14 | extern void get_aspected_limits(Window, int, int, 15 | float *, float *, float *, float *, 16 | float,float,float,float); 17 | extern void draw_frame(void); 18 | extern void redraw(void ); 19 | extern void redraw0(int, int, int, float, float, float, float); 20 | extern void redraw00(int, int, int, float *, float *, float *, float *); 21 | extern void drawmarker(int x1,int y1,float fx1,float fy1); 22 | extern void setmarkerstyle(char *); 23 | extern void drawline(float, float, float, float, int, int, int); 24 | extern void draw_label(int, int, int, char *); 25 | extern void draw_misc_labels(CURVE_SET *); 26 | extern void draw_graphtype(char *type); 27 | extern void toggle_markers(CURVE_SET *cp, int *m); 28 | extern void toggle_aspect(CURVE_SET *cp, int *a); 29 | extern void toggle_extrema_use(CURVE_SET *cp1); 30 | extern void toggle_fill(CURVE_SET *cp); 31 | extern void toggle_single(CURVE_SET *cp, char c); 32 | extern void toggle_flabel(CURVE_SET *cp); 33 | extern char *skip_to_arg(char *text,int n,char delim); 34 | extern void init(int argc,char *argv[]); 35 | extern void label(float *xlim, float xscale, float xoffset, 36 | float *ylim, float yscale, float yoffset, CURVE_SET *cp); 37 | extern int load_single_label(CURVE_SET *cp, char *string); 38 | extern int rand_label(int); 39 | -------------------------------------------------------------------------------- /xdraw/xedit.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | ** NAME XEDIT.H 3 | ** AUTHOR Sheryl M. Glasser 4 | ** 5 | ** DESCRIPTION 6 | ** 7 | ** 8 | ** Copyright (c) Toptools SCF 1990. All rights reserved. 9 | ******************************************************************************/ 10 | extern int editcurve(int iwin, CURVE_SET *cp, char *mname2); 11 | extern void print_title(int iwin, CURVE_SET *p); 12 | extern char *get_descriptive_title(int iwin, CURVE_SET *p); 13 | extern void init_label(CURVE_SET *, char *, int); 14 | extern struct LABEL *get_label(int, struct LABEL *, int *, int *, 15 | char **, int *, int *, float,float,float,float); 16 | extern void get_labelbox(int *, char **); 17 | extern char *get_newline(char *s); 18 | -------------------------------------------------------------------------------- /xdraw/xinit.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | ** NAME XINIT.H 3 | ** AUTHOR Sheryl M. Glasser 4 | ** 5 | ** DESCRIPTION 6 | ** 7 | ** 8 | ** Copyright (c) Toptools SCF 1990. All rights reserved. 9 | ******************************************************************************/ 10 | extern void get_limits(CURVE_SET *cp); 11 | extern int parse_title(CURVE_SET *cp, char *title, char *text); 12 | extern int parse_subtitle(CURVE_SET *, char *); 13 | 14 | #ifndef XDRAW_SOURCE 15 | extern void limits(float *, CURVE_SET *, CVAR *); 16 | extern void initparam(CURVE_SET *cp); 17 | extern void getparam(CURVE_SET *cp); 18 | extern int printvar(int index, char *format, char *newtitle); 19 | extern int curvetest(CURVE_SET *cp); 20 | extern char *read_flabels(FILE *frd, char *text, int index); 21 | extern float *binread(char *fname, unsigned Long *sizep); 22 | extern void loop_structure(void); 23 | extern void d_abort(char *, int, int); 24 | extern void s_abort(char *, char *, int,int); 25 | extern void i_abort(char *, int, int); 26 | extern int get_ncount(void); 27 | extern Long step_over_ncount(int, int); 28 | extern int asc_header_found(FILE *, int *); 29 | extern int v_is_header(int); 30 | extern char *skip_to_arg(char *, int, char); 31 | extern void ztest(int *, int *); 32 | #endif 33 | -------------------------------------------------------------------------------- /xdraw/xtools.h: -------------------------------------------------------------------------------- 1 | /*----------------------------------------------------------------------------- 2 | | xtools.h 3 | -----------------------------------------------------------------------------*/ 4 | extern void give_command_args(int, char**); 5 | extern int opendisplay(char *title,int n); 6 | extern void closedisplay(void); 7 | extern void get_screensize(unsigned int *dx, unsigned int *dy); 8 | extern void init_menuXlibrary(void); 9 | extern int get_eventmask(void); 10 | extern int getview(Window); 11 | extern Window makewindow(char *title, int has_menu); 12 | extern void nextwindow(int *xw, int *yw); 13 | extern Window getwindow(int); 14 | extern Window get_op_window(Window win); 15 | extern void get_expose_info(Display **d,Window *w,GC *g, int *font_heightp); 16 | extern void get_properties(Window w, unsigned int *wp, unsigned int *hp, 17 | unsigned int *dp); 18 | extern Window enable_window(Window win); 19 | extern void clear_if_needed(Window, GC, unsigned int, unsigned int); 20 | extern unsigned long white(void); 21 | extern int textwidth(char *s, int n); 22 | extern void event(void); 23 | extern int readkey(void); 24 | extern int parsekey(void); 25 | extern void clear_redraw(int); 26 | extern void xmessage(int x, int y, char *s); 27 | extern int get_zoomedclip(Window w, float *x1, float *y1, float *x2, float *y2); 28 | extern void tell_zoom(Window, int, int); 29 | extern void tell_key(XEvent *); 30 | extern void addzoom(Window w, int inc); 31 | #ifndef MOTIF 32 | extern void zoom(Window w, int enable); 33 | #endif 34 | extern void coord(int enable); 35 | extern void define_cursor(Window); 36 | extern void newclip(int i, int xcurs,int ycurs); 37 | extern void set_aspected_limits(Window, int, float, float, float, float); 38 | extern void givebox(int wx0, int wy0, int w, int h, int width, int height); 39 | extern void crosshair(int x,int y); 40 | extern Window set_expose(int i); 41 | extern void set_winmask(Window); 42 | extern void xrectangle(unsigned int dx, unsigned int dy, int bkgd, int fore); 43 | 44 | #ifndef UNIX 45 | extern float huge *addfloat(float *buf, long ix0); 46 | #endif 47 | 48 | #define ZGET 2 49 | #define ZENABLE 1 50 | #define ZDISABLE 0 51 | #define ZORIGINAL -1 52 | #define ZIGNORE -2 53 | #define ZABORT 3 54 | 55 | #define XHAIR_XOR 0 56 | #define XHAIR_LINE 1 57 | #define XHAIR_CURSOR 2 58 | #define XHAIR_1ST_LINE 8 59 | 60 | typedef struct /* In xtools.c and event.c */ 61 | { 62 | Window window; 63 | GC gc; 64 | float f[4]; /* x1,y1,x2,y2, as read from cursor */ 65 | int clipped; 66 | } 67 | VIEW; 68 | 69 | -------------------------------------------------------------------------------- /xdraw_inputs.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/compxco/genray/b5f4de9d2d09c7d0a2746a12b36dc6d597a202ec/xdraw_inputs.tar.gz -------------------------------------------------------------------------------- /xdraw_inputs/README: -------------------------------------------------------------------------------- 1 | /home/bobh/cql3d/genray/genray_cvs/xdraw 2 | 3 | The xdraw code was constructed by Sheryl M. Glasser. 4 | The make utility gives the executable xdraw1, which 5 | is then linked to xdraw. 6 | 7 | Usage is 8 | xdraw xxxx 9 | where xxxx is one of the drawxxxx.in files in 10 | the xdraw_input/ directory. 11 | 12 | xdraw plots data which is output by the genray 13 | code into *.bin files. The drawxxxx.in file 14 | specifies the input file and the quantities 15 | which are to be plotted. 16 | 17 | Nov 14, 2004 18 | ============ 19 | 20 | Sheryl Glasser points out that it possible 21 | to PS only using 22 | psonly: 1 23 | in the xdraw.ini file. 24 | Won't get the plots to the X-windows screen. 25 | 26 | -------------------------------------------------------------------------------- /xdraw_inputs/README_xdraw: -------------------------------------------------------------------------------- 1 | /home/bobh/cql3d/genray/genray_cvs/xdraw 2 | 3 | The xdraw code was constructed by Sheryl M. Glasser. 4 | The make utility gives the executable xdraw1, which 5 | is then linked to xdraw. 6 | 7 | Usage is 8 | xdraw xxxx 9 | where xxxx is one of the drawxxxx.in files in 10 | the xdraw_input/ directory. 11 | 12 | xdraw plots data which is output by the genray 13 | code into *.bin files. The drawxxxx.in file 14 | specifies the input file and the quantities 15 | which are to be plotted. 16 | 17 | Nov 14, 2004 18 | ============ 19 | 20 | Sheryl Glasser points out that it possible 21 | to PS only using 22 | psonly: 1 23 | in the xdraw.ini file. 24 | Won't get the plots to the X-windows screen. 25 | 26 | -------------------------------------------------------------------------------- /xdraw_inputs/drawabsr.in: -------------------------------------------------------------------------------- 1 | Type (G=Graph, C=Contour): G 2 | 3 | filename(s) 4 | absorp.bin 5 | 6 | graph title: GENRAY 7 | 8 | variable names 9 | 0 Poloidal dist 10 | 1 power 11 | 2 rho 12 | 3 Ye 13 | 4 Yi1 14 | 5 Yi2 15 | 6 Y ion-ioni 16 | 17 | ix iy title 18 | 6 1 power(yii) 19 | 4 1 power(yi) 20 | 0 2 rho(poloidal dist) 21 | 0 3 ye(poloidal dist) 22 | 0 4 yi1(poloidal dist) 23 | 0 5 yi2(polidal diat) 24 | 0 6 yii(poloidal dist) 25 | -------------------------------------------------------------------------------- /xdraw_inputs/drawcur.in: -------------------------------------------------------------------------------- 1 | Type (G=Graph, C=Contour): G 2 | 3 | filename(s) 4 | cd.bin 5 | 6 | graph title: GENRAY 7 | 8 | variable names 9 | 0 Poloidal dist. 10 | 1 R 11 | 2 rho 12 | 3 y_e 13 | 4 eff 14 | 5 n_parallel 15 | 6 del_pow_e 16 | 7 del_cur_par 17 | 8 wtheta_pol 18 | 19 | ix iy title 20 | 0 2 rho(poloidal dist.) 21 | 0 4 eff(poloidal dist.) 22 | 0 5 n_parallel(poloidal dist.) 23 | 0 6 del_pow_e(polidal dist.) 24 | 0 7 del_cur_par(polidal dist.) 25 | 0 8 wtheta_pol(poloidal dist.) 26 | 2 5 n_parallel(rho) 27 | 2 6 del_pow_e(rho) 28 | 2 7 del_cur_par(rho) 29 | 30 | -------------------------------------------------------------------------------- /xdraw_inputs/drawcur.in_w_wtheta: -------------------------------------------------------------------------------- 1 | Type (G=Graph, C=Contour): G 2 | 3 | filename(s) 4 | cd.bin 5 | 6 | graph title: GENRAY 7 | 8 | variable names 9 | 0 Poloidal dist. 10 | 1 R 11 | 2 rho 12 | 3 y_e 13 | 4 eff 14 | 5 n_parallel 15 | 6 del_pow_e 16 | 7 del_cur_par 17 | 8 wtheta_pol 18 | 19 | ix iy title 20 | 0 2 rho(poloidal dist.) 21 | 0 4 eff(poloidal dist.) 22 | 0 5 n_parallel(poloidal dist.) 23 | 0 6 del_pow_e(polidal dist.) 24 | 0 7 del_cur_par(polidal dist.) 25 | 0 8 wtheta_pol(poloidal dist.) 26 | 2 5 n_parallel(rho) 27 | 2 6 del_pow_e(rho) 28 | 2 7 del_cur_par(rho) 29 | 30 | -------------------------------------------------------------------------------- /xdraw_inputs/drawdelpwr_lsc.in: -------------------------------------------------------------------------------- 1 | Type (G=Graph, C=Contour): G 2 | 3 | filename(s) 4 | delpwr.bin 5 | 6 | graph title: GENRAY 7 | 8 | variable names 9 | 0 power lsc 10 | 1 poloidal dist 11 | 12 | ix iy title 13 | 1 0 power(s) 14 | -------------------------------------------------------------------------------- /xdraw_inputs/drawdens.in: -------------------------------------------------------------------------------- 1 | Type (G=Graph, C=Contour): G 2 | 3 | filename(s) 4 | dens.bin 5 | 6 | graph title: GENRAY 7 | 8 | variable names 9 | 0 rho 10 | 1 density 11 | 2 temperature 12 | 13 | ix iy title 14 | 0 1 density(rho) [10**13/cm**3] 15 | 0 2 temperature(rho) [keV] 16 | -------------------------------------------------------------------------------- /xdraw_inputs/drawebw.in: -------------------------------------------------------------------------------- 1 | Type (G=Graph, C=Contour): G 2 | 3 | filename(s) 4 | ebw_root.bin 5 | 6 | graph title: EBW 7 | 8 | variable names 9 | 0 k_perp_R_Larm 10 | 1 1/Y 11 | 12 | ix iy title 13 | 0 1 1/Y(k) 14 | 15 | -------------------------------------------------------------------------------- /xdraw_inputs/drawefield.in: -------------------------------------------------------------------------------- 1 | Type (G=Graph, C=Contour): G 2 | 3 | filename(s) 4 | efield.bin 5 | 6 | graph title: GENRAY 7 | 8 | variable names 9 | 0 Poloidal dist 10 | 1 ReEx 11 | 2 ImEx 12 | 3 ReEy 13 | 4 ImEy 14 | 5 ReEz 15 | 6 ImEz 16 | 7 fluxn 17 | 18 | ix iy title 19 | 0 1 ReEx(s) 20 | 0 2 'ImEx(s) 21 | 0 3 ReEy(s) 22 | 0 4 'ImEy(s) 23 | 0 5 ReEz(s) 24 | 0 6 'ImEz(s) 25 | 0 7 fluxn(s) 26 | 27 | -------------------------------------------------------------------------------- /xdraw_inputs/drawefieldrho.in: -------------------------------------------------------------------------------- 1 | Type (G=Graph, C=Contour): G 2 | 3 | filename(s) 4 | efield.bin 5 | 6 | graph title: GENRAY 7 | 8 | variable names 9 | 0 Poloidal dist 10 | 1 ReEx 11 | 2 ImEx 12 | 3 ReEy 13 | 4 ImEy 14 | 5 ReEz 15 | 6 ImEz 16 | 7 fluxn 17 | 8 rho 18 | 19 | ix iy title 20 | 8 1 ReEx(rho) 21 | 8 2 'ImEx(rho) 22 | 8 3 ReEy(rho) 23 | 8 4 'ImEy(rho) 24 | 8 5 ReEz(rho) 25 | 8 6 'ImEz(rho) 26 | 8 7 fluxn(rho) 27 | 28 | -------------------------------------------------------------------------------- /xdraw_inputs/drawem.in: -------------------------------------------------------------------------------- 1 | Type (G=Graph, C=Contour): G 2 | 3 | filename(s) 4 | emis.bin 5 | 6 | graph title: GENRAY 7 | 8 | variable names 9 | 0 R 10 | 1 Z 11 | 2 Phi 12 | 3 distance 13 | 4 al 14 | 5 j 15 | 6 N_ray 16 | 7 I_n_sn/ds 17 | 8 I_n(s=0)/ds 18 | 9 Temperature 19 | 10 Rad Temp (keV) 20 | 11 I(s) (cgs) 21 | 12 tau_n 22 | 13 I_n(0) 23 | 24 | ix iy title 25 | 0 7 "I_n_sn/ds 26 | 0 8 dI(s=0)/ds 27 | 0 11 "Intensity, I(s) 28 | 0 4 al 29 | 0 5 j 30 | 0 6 N_ray 31 | 0 12 tau_n 32 | 0 9 Temperature 33 | 0 10 Local Rad Temp(R) 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /xdraw_inputs/drawem1.in: -------------------------------------------------------------------------------- 1 | Type (G=Graph, C=Contour): G 2 | 3 | filename(s) 4 | emis.bin 5 | 6 | graph title: GENRAY 7 | 8 | variable names 9 | 0 R 10 | 1 Z 11 | 2 Phi 12 | 3 distance 13 | 4 al 14 | 5 j 15 | 6 N_ray 16 | 7 I_n(s=sn)/ds 17 | 8 I_n(s=0)/ds 18 | 9 Temperature 19 | 10 rad temperature 20 | 11 I_0sn 21 | 12 tau_n 22 | 13 I_n(0) 23 | 14 j*exp(-tau_n) 24 | 25 | ix iy title 26 | 0 7 "I_n(s=sn)/ds 27 | 3 8 "I_n(s=0)/ds 28 | 3 11 "I_0sn 29 | 0 4 al 30 | 0 5 j 31 | 0 6 N_ray 32 | 0 12 tau_n 33 | 0 9 Temperature 34 | 3 14 "j exp(-taun) 35 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /xdraw_inputs/drawemf1.in: -------------------------------------------------------------------------------- 1 | Type (G=Graph, C=Contour): G 2 | 3 | filename(s) 4 | emfr.bin 5 | 6 | graph title: GENRAY 7 | 8 | variable names 9 | 0 omega/omegace0 10 | 1 rad_temperature 11 | 2 flux 12 | 3 temperature wall refl. 13 | 4 plasma temp 14 | 5 r of max emission 15 | 6 z of max emission 16 | 7 rho of max emission 17 | 8 r of 2nd harmonic 18 | 9 temperature at EC 2nd harmonic 19 | 20 | ix iy title 21 | 0 1 rad_temperature(keV) 22 | 0 3 temperature with wall reflection 23 | 0 4 plasma temperature(keV) 24 | 0 5 r of max emission 25 | 0 6 z of max emission 26 | 0 1 rad temperature(omega) 27 | 0 9 second harm plasma temperature (omega) 28 | 0 3 temperature with wall reflection 29 | 7 4 plasma temperature(rho) 30 | 31 | 32 | -------------------------------------------------------------------------------- /xdraw_inputs/drawemfr.in: -------------------------------------------------------------------------------- 1 | Type (G=Graph, C=Contour): G 2 | 3 | filename(s) 4 | emfr.bin 5 | 6 | graph title: GENRAY 7 | 8 | variable names 9 | 0 omega/omegace0 10 | 1 rad_temperature 11 | 2 flux 12 | 3 temperature wall refl. 13 | 4 plasma temp 14 | 5 r of max emission 15 | 6 z of max emission 16 | 7 rho of max emission 17 | 8 r of 2nd harmonic 18 | 9 temperature at EC 2nd harmonic 19 | 20 | ix iy title 21 | 0 1 rad_temperature(keV) 22 | 0 3 temperature with wall reflection 23 | 0 4 plasma temperature(keV) 24 | 0 5 r of max emission 25 | 0 6 z of max emission 26 | 8 1 rad temperature(R) 27 | 8 9 plasma temperature(R) 28 | 8 3 temperature with wall reflection 29 | 7 4 plasma temperature(rho) 30 | 31 | 32 | -------------------------------------------------------------------------------- /xdraw_inputs/drawemfr1.in: -------------------------------------------------------------------------------- 1 | Type (G=Graph, C=Contour): G 2 | 3 | filename(s) 4 | emfr.bin 5 | 6 | graph title: GENRAY 7 | 8 | variable names 9 | 0 omega/omegace0 10 | 1 rad_temperature 11 | 2 flux 12 | 3 temperature wall refl. 13 | 4 plasma temp 14 | 5 r of max emission 15 | 6 z of max emission 16 | 7 rho of max emission 17 | 8 r of 2nd harmonic 18 | 9 temperature at EC 2nd harmonic 19 | 10 optical depth 20 | 21 | ix iy title 22 | 0 1 rad_temperature(keV) 23 | 0 3 temperature with wall reflection 24 | 0 4 plasma temperature(keV) 25 | 0 5 r of max emission 26 | 0 6 z of max emission 27 | 8 1 rad temperature(R) 28 | 8 9 plasma temperature(R) 29 | 8 3 temperature with wall reflection 30 | 0 10 optical depth 31 | 32 | -------------------------------------------------------------------------------- /xdraw_inputs/drawemis.in: -------------------------------------------------------------------------------- 1 | Type (G=Graph, C=Contour): G 2 | 3 | filename(s) 4 | genray.bin 5 | 6 | graph title: GENRAY 7 | 8 | variable names 9 | 0 R 10 | 1 Z 11 | 2 X 12 | 3 Y 13 | 4 Poloidal dist. 14 | 5 Power 15 | 6 Ez/E 16 | 7 rho 17 | 8 n_parallel 18 | 9 n_perpendic. 19 | 10 ki_poloidal 20 | 11 y_e 21 | 12 y_i 22 | 13 al_emis(1/cm) 23 | 14 j_emis(erg*sec/cm**3) 24 | 25 | ix iy title 26 | 0 1 z(r) 27 | 2 3 y(x) 28 | 4 13 al_emis(poloidal dist.) 29 | 4 14 j_emis (poloidal dist.) 30 | 4 7 rho(poloidal dist.) 31 | 11 13 al_emis (Ye) 32 | 4 10 ki_poloidal(poloidal dist) 33 | 4 13 al_emis (poloidal dist) 34 | 4 14 j_emis(polidal dist) 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /xdraw_inputs/drawemres.in: -------------------------------------------------------------------------------- 1 | Type (G=Graph, C=Contour): G 2 | 3 | filename(s) 4 | em_res.bin 5 | 6 | graph title: GENRAY 7 | 8 | variable names 9 | 0 R 10 | 1 y_e 11 | 2 u_perp_max/vte 12 | 3 u_par_min/vte 13 | 4 u_par_max/vte 14 | 5 u_0/vte 15 | 6 del_u/vte 16 | 7 n_parallel 17 | 18 | ix iy title 19 | 0 2 u_perp/vte(R) 20 | 0 3 u_par_min/vte(R) 21 | 0 4 u_par_max/vte(R) 22 | 0 5 u_0(r)/vte(R) 23 | 0 6 del_u(r)/vte(R) 24 | 0 1 y_e(R)=omegace/omega 25 | 0 7 n_parallel(R) -------------------------------------------------------------------------------- /xdraw_inputs/draweps_i.in: -------------------------------------------------------------------------------- 1 | Type (G=Graph, C=Contour): G 2 | 3 | filename(s) 4 | eps_i.bin 5 | 6 | graph title: GENRAY 7 | 8 | variable names 9 | 0 Poloidal dist 10 | 1 Im_eps(1,1) 11 | 2 Im_eps(1,2) 12 | 3 Im_eps(1,3) 13 | 4 Im_eps(2,1) 14 | 5 Im_eps(2,2) 15 | 6 Im_eps(2,3) 16 | 7 Im_eps(3,1) 17 | 8 Im_eps(3,2) 18 | 9 Im_eps(3,3) 19 | 20 | ix iy title 21 | 0 1 "Im_eps(1,1,s) 22 | 0 2 "Im_eps(1,2,s) 23 | 0 3 "Im_eps(1,3,s) 24 | 0 4 "Im_eps(2,1,s) 25 | 0 5 "Im_eps(2,2,s) 26 | 0 6 "Im_eps(2,3,s) 27 | 0 7 "Im_eps(3,1,s) 28 | 0 8 "Im_eps(3,2,s) 29 | 0 9 "Im_eps(3,3,s) 30 | 31 | 32 | -------------------------------------------------------------------------------- /xdraw_inputs/draweps_r.in: -------------------------------------------------------------------------------- 1 | Type (G=Graph, C=Contour): G 2 | 3 | filename(s) 4 | eps_r.bin 5 | 6 | graph title: GENRAY 7 | 8 | variable names 9 | 0 Poloidal dist 10 | 1 Re_eps(1,1) 11 | 2 Re_eps(1,2) 12 | 3 Re_eps(1,3) 13 | 4 Re_eps(2,1) 14 | 5 Re_eps(2,2) 15 | 6 Re_eps(2,3) 16 | 7 Re_eps(3,1) 17 | 8 Re_eps(3,2) 18 | 9 Re_eps(3,3) 19 | 20 | ix iy title 21 | 0 1 Re_eps(1,1,s) 22 | 0 2 Re_eps(1,2,s) 23 | 0 3 Re_eps(1,3,s) 24 | 0 4 Re_eps(2,1,s) 25 | 0 5 Re_eps(2,2,s) 26 | 0 6 Re_eps(2,3,s) 27 | 0 7 Re_eps(3,1,s) 28 | 0 8 Re_eps(3,2,s) 29 | 0 9 Re_eps(3,3,s) 30 | 31 | 32 | -------------------------------------------------------------------------------- /xdraw_inputs/drawfokr.in: -------------------------------------------------------------------------------- 1 | Type (G=Graph, C=Contour): G 2 | 3 | filename(s) 4 | fokker.bin 5 | 6 | graph title: GENRAY 7 | 8 | variable names 9 | 0 kinetic energy [KeV] 10 | 1 log(f) 11 | 12 | ix iy title 13 | 0 1 log(f) vs E 14 | 15 | 16 | -------------------------------------------------------------------------------- /xdraw_inputs/drawfreqelec.in: -------------------------------------------------------------------------------- 1 | Type (G=Graph, C=Contour): G 2 | 3 | filename(s) 4 | freqelec.bin 5 | 6 | graph title: GENRAY 7 | 8 | variable names 9 | 0 R[m] 10 | 1 freqncy[GHz] 11 | 2 rho 12 | 3 dens_e 10^13/cm^3 13 | 14 | ix iy title 15 | 0 1 fpe[0],fce[1],fuh[2],2-6*fce[3-7],fx1[8],fx2[9] 16 | 0 2 rho(R) 17 | 0 3 dens_e(R) -------------------------------------------------------------------------------- /xdraw_inputs/drawfreqion.in: -------------------------------------------------------------------------------- 1 | Type (G=Graph, C=Contour): G 2 | 3 | filename(s) 4 | freqion.bin 5 | 6 | graph title: GENRAY 7 | 8 | variable names 9 | 0 R[m] 10 | 1 frequency[GHZ] 11 | 12 | ix iy title 13 | 0 1 fpi[0],fci[1],flh[2],2-4*fci[3-5] -------------------------------------------------------------------------------- /xdraw_inputs/drawg3d1.in: -------------------------------------------------------------------------------- 1 | Type (G=Graph, C=Contour): G 2 | 3 | filename(s) 4 | gr3d_1.bin 5 | 6 | graph title: GENRAY 7 | 8 | variable names 9 | 0 ws 10 | 1 seikon 11 | 2 spsi 12 | 3 r 13 | 4 phi 14 | 5 z 15 | 6 npar 16 | 7 nper 17 | 8 delpwr 18 | 9 sdpwr 19 | 20 | ix iy title 21 | 0 1 seikon 22 | 0 2 spsi 23 | 0 3 power 24 | 0 4 phi 25 | 0 5 z 26 | 0 6 npar 27 | 0 7 nper 28 | 0 8 delpwr 29 | 0 9 sdpwr 30 | 31 | 32 | -------------------------------------------------------------------------------- /xdraw_inputs/drawg3d2.in: -------------------------------------------------------------------------------- 1 | Type (G=Graph, C=Contour): G 2 | 3 | filename(s) 4 | gr3d_2.bin 5 | 6 | graph title: GENRAY 7 | 8 | variable names 9 | 0 ws 10 | 1 wdnpar 11 | 2 ex 12 | 3 ey 13 | 4 ez 14 | 5 fluxn 15 | 6 btot 16 | 7 sene 17 | 8 salphac 18 | 9 salphal 19 | 20 | ix iy title 21 | 0 1 wdnpar 22 | 0 2 ex 23 | 0 3 ey 24 | 0 4 ez 25 | 0 5 fluxn 26 | 0 6 btot 27 | 0 7 sene 28 | 0 8 salphac 29 | 0 9 salphal 30 | 31 | 32 | -------------------------------------------------------------------------------- /xdraw_inputs/drawgenc.in: -------------------------------------------------------------------------------- 1 | Type (G=Graph, C=Contour): G 2 | 3 | filename(s) 4 | genrac.bin 5 | 6 | graph title: GENRAY 7 | 8 | variable names 9 | 0 R 10 | 1 Z 11 | 2 X 12 | 3 Y 13 | 4 Poloidal dist. 14 | 5 Power 15 | 6 Ez/E 16 | 7 rho 17 | 8 n_parallel 18 | 9 n_perpendic. 19 | 10 ki_poloidal 20 | 21 | ix iy title 22 | 0 1 z(r) and contours 1/Y_ci=n 23 | 2 3 y(x) 24 | 4 5 power(poloidal dist.) 25 | 4 6 Ez/E(poloidal dist.) 26 | 4 7 rho(poloidal dist.) 27 | 4 8 n_parallel(poloidal dist) 28 | 7 9 n_perpendic(rho) 29 | 7 10 ki_poloidal(rho) 30 | -------------------------------------------------------------------------------- /xdraw_inputs/drawgenp.in: -------------------------------------------------------------------------------- 1 | Type (G=Graph, C=Contour): G 2 | 3 | filename(s) 4 | genray.bin 5 | 6 | graph title: GENRAY 7 | 8 | variable names 9 | 0 R 10 | 1 Z 11 | 2 X 12 | 3 Y 13 | 4 Poloidal dist. 14 | 5 Power 15 | 6 Ez/E 16 | 7 rho 17 | 8 n_parallel 18 | 9 n_perpendic. 19 | 10 ki_poloidal 20 | 11 y_e 21 | 12 y_i 22 | 23 | ix iy title 24 | 0 1 z(r) 25 | 2 3 y(x) 26 | 7 5 power(rho) 27 | 7 6 Ez/E(rho) 28 | 7 4 poloidal dist.(rho) 29 | 7 8 n_parallel(rho) 30 | 7 9 n_perpendic(rho) 31 | 7 10 ki_poloidal(rho) 32 | 11 5 power(y_e) 33 | 12 5 power(y_i) -------------------------------------------------------------------------------- /xdraw_inputs/drawgenr.in: -------------------------------------------------------------------------------- 1 | Type (G=Graph, C=Contour): G 2 | 3 | filename(s) 4 | genray.bin 5 | 6 | graph title: GENRAY 7 | 8 | variable names 9 | 0 R (cms) 10 | 1 Z (cms) 11 | 2 X (cms) 12 | 3 Y (cms) 13 | 4 Poloidal dist. (cms) 14 | 5 Power (ergs/sec) 15 | 6 Ez/E 16 | 7 rho 17 | 8 n_parallel 18 | 9 n_perp 19 | 10 ki_poloidal (cms**-1) 20 | 11 y_e 21 | 12 y_i 22 | 23 | ix iy title 24 | 0 1 z(r) 25 | 2 3 y(x) 26 | 4 5 power(poloidal dist.) 27 | 4 6 Ez/E(poloidal dist.) 28 | 4 7 rho(poloidal dist.) 29 | 4 8 n_parallel(poloidal dist) 30 | 4 9 n_perpendic(poloidal dist) 31 | 0 10 ki_poloidal(R) 32 | 11 5 power(y_e) 33 | 12 5 power(y_i) 34 | -------------------------------------------------------------------------------- /xdraw_inputs/drawgenri.in: -------------------------------------------------------------------------------- 1 | Type (G=Graph, C=Contour): G 2 | 3 | filename(s) 4 | genray.bin 5 | 6 | graph title: GENRAY 7 | 8 | variable names 9 | 0 R 10 | 1 z 11 | 2 x 12 | 3 y 13 | 4 Poloidal dist. 14 | 5 Power 15 | 6 Ez/E 16 | 7 rho 17 | 8 n_parallel 18 | 9 n_perpendic. 19 | 10 ki_poloidal 20 | 11 y_e 21 | 12 y_i 22 | 23 | ix iy title 24 | 0 1 z(R) 25 | 2 3 y(x) 26 | 4 5 power(poloidal dist.) 27 | 4 6 Ez/E(poloidal dist.) 28 | 4 7 rho(poloidal dist.) 29 | 4 8 n_parallel(poloidal dist) 30 | 4 9 n_perpendic(poloidal dist) 31 | 0 10 ki_poloidal(R) 32 | 12 5 power(y_i) 33 | 11 5 power(y_e) 34 | -------------------------------------------------------------------------------- /xdraw_inputs/drawgent.in: -------------------------------------------------------------------------------- 1 | Type (G=Graph, C=Contour): G 2 | 3 | filename(s) 4 | genrayt.bin 5 | 6 | graph title: GENRAY 7 | 8 | variable names 9 | 0 R 10 | 1 Z 11 | 2 X 12 | 3 Y 13 | 4 Poloidal dist. 14 | 5 Power 15 | 6 Ez/E 16 | 7 rho 17 | 8 n_parallel 18 | 9 n_perpendic. 19 | 10 ki_poloidal 20 | 11 y_e 21 | 12 y_i 22 | 23 | ix iy title 24 | 0 1 z(r) 25 | 2 3 y(x) 26 | 4 5 power(poloidal dist.) 27 | 4 6 Ez/E(poloidal dist.) 28 | 4 7 rho(poloidal dist.) 29 | 4 8 n_parallel(poloidal dist) 30 | 7 9 n_perpendic(rho) 31 | 7 10 ki_poloidal(rho) 32 | 12 5 power(y_i) 33 | 11 5 power(y_e) 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /xdraw_inputs/drawnpar.in: -------------------------------------------------------------------------------- 1 | Type (G=Graph, C=Contour): G 2 | 3 | filename(s) 4 | npar.bin 5 | 6 | graph title: GENRAY 7 | 8 | variable names 9 | 0 THETA 10 | 1 R 11 | 2 z 12 | 3 Poloidal dist. 13 | 4 Ez/E 14 | 5 rho 15 | 6 n_parallel 16 | 7 n_perpendic. 17 | 8 n_phi 18 | 9 n_parallel-n_phi 19 | 20 | ix iy title 21 | 0 1 R(theta) 22 | 0 2 z(theta) 23 | 0 3 poloidal dist.(theta) 24 | 0 4 Ez(theta) 25 | 0 5 rho(theta) 26 | 0 6 n_parallel(theta) 27 | 0 7 n_perpendic(theta) 28 | 0 8 n_phi(theta) 29 | 0 9 n_parallel-n_phi(theta) 30 | 31 | -------------------------------------------------------------------------------- /xdraw_inputs/drawonet.in: -------------------------------------------------------------------------------- 1 | Type (G=Graph, C=Contour): G 2 | 3 | filename(s) 4 | onetwo.bin 5 | 6 | graph title: GENRAY 7 | 8 | variable names 9 | 0 rho 10 | 1 power (erg/s) 11 | 2 power density (egr/s*cm**3) 12 | 3 power_e (erg/s*cm**3) 13 | 4 power_i (erg/s*cm**3) 14 | 5 power_cl (erg/s*cm**3) 15 | 6 power_per_cm (watt/cm) 16 | 7 rho_cm (cm) 17 | 8 power_per_d_rho(watt) 18 | 19 | ix iy title 20 | 0 1 power erg/s (rho) 21 | 0 2 power density erg/(s*cm**3)(rho) 22 | 0 3 power density(electron damping) 23 | 0 4 power density(ion damping) 24 | 0 5 power density(collisional damping) 25 | 7 6 power_per_cm (watt/cm) 26 | 0 7 rho_cm 27 | 0 8 power_per_d_rho 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /xdraw_inputs/drawonet.in.0: -------------------------------------------------------------------------------- 1 | Type (G=Graph, C=Contour): G 2 | 3 | filename(s) 4 | onetwo.bin 5 | 6 | graph title: GENRAY 7 | 8 | variable names 9 | 0 rho 10 | 1 power (egr/s) 11 | 2 power density (egr/s*cm**3) 12 | 3 power_e (egr/s*cm**3) 13 | 4 power_i (erg/s*cm**3) 14 | 5 power_cl (egr/s*cm**3) 15 | 6 toroidal current (A) 16 | 7 poloidal current (A) 17 | 8 toroidal current density (A/cm**2) 18 | 9 poloidal current density (A/cm**2) 19 | 20 | ix iy title 21 | 0 1 power egr/s (rho) 22 | 0 2 power density erg/(s*cm**3)(rho) 23 | 0 3 power density(electron damping) 24 | 0 4 power density(ion damping) 25 | 0 5 power density(collisional damping) 26 | 0 6 toroidal current A(rho) 27 | 0 7 poloidal current A(rho) 28 | 0 8 toroidal current density A/cm**2(rho) 29 | 0 9 poloidal current density A/cm**2(rho) 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /xdraw_inputs/drawonet1.in: -------------------------------------------------------------------------------- 1 | Type (G=Graph, C=Contour): G 2 | 3 | filename(s) 4 | onetwo1.bin 5 | 6 | graph title: GENRAY 7 | 8 | variable names 9 | 0 rho 10 | 1 power density (egr/s*cm**3) 11 | 2 power (egr/s) 12 | 3 power_e density (egr/s*cm**3) 13 | 4 power_i density (erg/s*cm**3) 14 | 5 power_cl density (egr/s*cm**3) 15 | 6 current density parallel (A/cm**2) 16 | 7 current density onetwo (A/cm**2) 17 | 8 current density toroidal (A/cm**2) 18 | 9 current density poloidal (A/cm**2) 19 | 10 current density toroidal_LL (A/sm**2) 20 | 21 | ix iy title 22 | 0 1 power density erg/(s*cm**3)(rho) 23 | 0 3 power density(electron damping) 24 | 0 4 power density(ion damping) 25 | 0 5 power density(collisional damping) 26 | 0 6 parallel current density A/cm**2(rho) 27 | 0 7 onetwo current density A/cm**2(rho) 28 | 0 8 toroidal current density A/cm**2(rho) 29 | 0 9 poloidal current density A/cm**2(rho) 30 | 0 10 toroidal LL current density A/cm**2 (rho) 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /xdraw_inputs/drawonet1_1.in: -------------------------------------------------------------------------------- 1 | Type (G=Graph, C=Contour): G 2 | 3 | filename(s) 4 | onetwo1.bin 5 | 6 | graph title: GENRAY 7 | 8 | variable names 9 | 0 rho 10 | 1 power density (egr/s*cm**3) 11 | 2 power (egr/s) 12 | 3 power_e density (egr/s*cm**3) 13 | 4 power_i density (erg/s*cm**3) 14 | 5 power_cl density (egr/s*cm**3) 15 | 6 current density parallel (A/cm**2) 16 | 7 current density onetwo (A/cm**2) 17 | 8 current density toroidal (A/cm**2) 18 | 9 current density poloidal (A/cm**2) 19 | 10 current density toroidal_LL (A/sm**2) 20 | 21 | ix iy title 22 | 0 1 power density erg/(s*cm**3)(rho) 23 | 0 3 power density(electron damping) 24 | 0 4 power density(ion damping) 25 | 0 6 parallel current density A/cm**2(rho) 26 | 0 7 onetwo current density A/cm**2(rho) 27 | 0 8 toroidal current density A/cm**2(rho) 28 | 0 9 poloidal current density A/cm**2(rho) 29 | 0 10 toroidal LL current density A/cm**2 (rho) 30 | 31 | -------------------------------------------------------------------------------- /xdraw_inputs/drawonet2.in: -------------------------------------------------------------------------------- 1 | Type (G=Graph, C=Contour): G 2 | 3 | filename(s) 4 | onetwo1.bin 5 | 6 | graph title: GENRAY 7 | 8 | variable names 9 | 0 rho 10 | 1 power density (egr/s*cm**3) 11 | 2 power (egr/s) 12 | 3 power_e density (egr/s*cm**3) 13 | 4 power_i density (erg/s*cm**3) 14 | 5 power_cl density (egr/s*cm**3) 15 | 6 current density parallel (A/cm**2) 16 | 7 current density onetwo (A/cm**2) 17 | 8 current density toroidal (A/cm**2) 18 | 9 current density poloidal (A/cm**2) 19 | 10 current density toroidal_LL (A/sm**2) 20 | 21 | ix iy title 22 | 0 1 power density erg/(s*cm**3)(rho) 23 | 0 7 onetwo current density A/cm**2(rho) 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /xdraw_inputs/drawtol1.in: -------------------------------------------------------------------------------- 1 | Type (G=Graph, C=Contour): G 2 | 3 | filename(s) 4 | tool1.bin 5 | 6 | graph title: GENRAY 7 | 8 | variable names 9 | 0 R 10 | 1 dens_e 11 | 2 temp_e 12 | 3 b 13 | 4 y_e 14 | 5 x_e 15 | 6 ur 16 | 7 cutoffp 17 | 8 cutoffm 18 | 9 sqrt(x_e)/y_e 19 | 20 | ix iy title 21 | 0 1 dens_e (10**19/m**3) 22 | 0 2 temp_e (KeV) 23 | 0 3 b (Tl) 24 | 0 4 y_e 25 | 0 5 x_e 26 | 0 6 ur=x_e+y_e**2 27 | 0 7 cutoffp=x/(1+y)+Npar**2 28 | 0 8 cutoffm=x/(1-y)+Npar**2 29 | 0 9 sqrt(x)/y 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /xdraw_inputs/drawtol2.in: -------------------------------------------------------------------------------- 1 | Type (G=Graph, C=Contour): G 2 | 3 | filename(s) 4 | tool2.bin 5 | 6 | graph title: GENRAY 7 | 8 | variable names 9 | 0 R 10 | 1 dens_e 11 | 2 temp_e 12 | 3 b 13 | 4 y_e 14 | 5 x_e 15 | 6 ur 16 | 7 cutoffp 17 | 8 cutoffm 18 | 9 d/(x/(1-N_par**2)-1) 19 | 20 | ix iy title 21 | 0 1 dens_e (10**19/m**3) 22 | 0 2 temp_e (KeV) 23 | 0 3 b (Tl) 24 | 0 4 y_e 25 | 0 5 x_e 26 | 0 6 ur=x_e+y_e**2 27 | 0 7 cutoffp=x/(1+y)+Npar**2-1 28 | 0 8 cutoffm=x/(1-y)+Npar**2-1 29 | 0 9 d/(x/(1-N_par**2)-1) 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /xdraw_inputs/drawtool.in: -------------------------------------------------------------------------------- 1 | Type (G=Graph, C=Contour): G 2 | 3 | filename(s) 4 | tool.bin 5 | 6 | graph title: GENRAY 7 | 8 | variable names 9 | 0 rho 10 | 1 dens_e 11 | 2 temp_e 12 | 3 b 13 | 4 y_e 14 | 5 x_e 15 | 6 ur 16 | 7 cutoffp 17 | 8 cutoffm 18 | 9 r 19 | 20 | ix iy title 21 | 0 1 dens_e (10**19/m**3) 22 | 0 2 temp_e (KeV) 23 | 0 3 b (Tl) 24 | 0 4 y_e 25 | 0 5 x_e 26 | 0 6 ur=x_e+y_e**2 27 | 0 7 cutoffp=x/(1+y)+Npar**2 28 | 0 8 cutoffm=x/(1-y)+Npar**2 29 | 0 9 r 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /xdraw_inputs/drawtor.in: -------------------------------------------------------------------------------- 1 | Type (G=Graph, C=Contour): G 2 | 3 | filename(s) 4 | genrayt.bin 5 | 6 | graph title: GENRAY 7 | 8 | variable names 9 | 0 R 10 | 1 Z 11 | 2 X 12 | 3 Y 13 | 4 Poloidal dist. 14 | 5 Power 15 | 6 Ez/E 16 | 7 rho 17 | 8 n_parallel 18 | 9 n_perpendic. 19 | 10 ki_poloidal 20 | 11 y_e 21 | 12 y_i 22 | 23 | ix iy title 24 | 0 1 z(r) 25 | 2 3 y(x) 26 | 4 5 power(poloidal dist.) 27 | 4 6 Ez/E(poloidal dist.) 28 | 4 7 rho(poloidal dist.) 29 | 4 8 n_parallel(poloidal dist) 30 | 4 9 n_perpendic(poloidal dist) 31 | 4 10 ki_poloidal(poloidal dist) 32 | 12 5 power(y_i) 33 | 11 5 power(y_e) 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /xdraw_inputs/drawtorp.in: -------------------------------------------------------------------------------- 1 | Type (G=Graph, C=Contour): G 2 | 3 | filename(s) 4 | genrayt.bin 5 | 6 | graph title: GENRAY 7 | 8 | variable names 9 | 0 R 10 | 1 Z 11 | 2 X 12 | 3 Y 13 | 4 Poloidal dist. 14 | 5 Power 15 | 6 Ez/E 16 | 7 rho 17 | 8 n_parallel 18 | 9 n_perpendic. 19 | 10 ki_poloidal 20 | 11 y_e 21 | 12 y_i 22 | 23 | ix iy title 24 | 0 1 z(r) 25 | 2 3 y(x) 26 | 7 5 power(rho) 27 | 7 6 Ez/E(rho) 28 | 7 4 poloidal dist(rho) 29 | 7 8 n_parallel(rho) 30 | 7 9 n_perpendic(rho) 31 | 7 10 ki_poloidal(rho) 32 | 12 5 power(y_i) 33 | 11 5 power(y_e) 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /xdraw_inputs/xdraw.ini: -------------------------------------------------------------------------------- 1 | pscolor: 1 2 | END 3 | -------------------------------------------------------------------------------- /xdraw_inputs/xdraw.ini_psonly: -------------------------------------------------------------------------------- 1 | pscolor: 1 2 | psonly: 1 3 | END 4 | -------------------------------------------------------------------------------- /y.f: -------------------------------------------------------------------------------- 1 | c ********************** y *********************** 2 | c * - * 3 | c * this function calculates the ratio of cyclotron * 4 | c * frequency of species i and wave frequency * 5 | c * y=omega_cyclotron_i/omega * 6 | c **************************************************** 7 | c 8 | c------------------------------------------------------------------- 9 | c ! 10 | c input parameters ! 11 | c ! 12 | c z, r phi - coordinates of the point where the ratio is ! 13 | c calculated. ! 14 | c small radius rho is in common one 15 | c------------------------------------------------------------------- 16 | double precision 17 | 1function y(z,r,phi,i) 18 | !implicit double precision (a-h,o-z) 19 | implicit none !YuP[2020-01-14] 20 | integer i !YuP[2020-01-14] 21 | real*8 z,r,phi !YuP[2020-01-14] 22 | 23 | include 'param.i' 24 | include 'one.i' 25 | y=w(i)*bmod 26 | c write(*,*)'in y i,w(i),bmod,rho,y',i,y,w(i),bmod,rho,y 27 | if(dabs(y).lt.1.d-8) y=1.d-8 28 | return 29 | end 30 | 31 | double precision 32 | 1function y_test(z,r,phi,i) 33 | !implicit double precision (a-h,o-z) 34 | implicit none !YuP[2020-01-14] 35 | integer i !YuP[2020-01-14] 36 | real*8 z,r,phi, y !YuP[2020-01-14] 37 | include 'param.i' 38 | include 'one.i' 39 | y=w(i)*bmod 40 | 41 | c write(*,*)'in y_test z,r,phi,ib,bmod,w(i),y', 42 | c &z,r,phi,ib,bmod,w(i),y 43 | 44 | c write(*,*)'in y i,w(i),bmod,rho,y',y,w(i),bmod,rho,y 45 | if(dabs(y).lt.1.d-8) y=1.d-8 46 | 47 | c write(*,*) 'in y_test y',y 48 | cSAP090122 49 | y_test=y 50 | 51 | return 52 | end 53 | --------------------------------------------------------------------------------