diff --git a/.gitignore b/.gitignore index 18ebc5f07061fca18eaad5976ce6e8c3bb0a8d15..bc2372a981c61cfd52ed21553c875888e668256e 100644 --- a/.gitignore +++ b/.gitignore @@ -8,5 +8,9 @@ src-f90/chease_itm src-f90/chease_imas src-f90/chease_itm_hdf5 *chease*-dirty.f90 +## avoid make source files in top folder, but keep chease....f90 subroutine and program in src-f90 +chease*.f90 +!src-f90/chease*.f90 +## except files created by make to have git version or depending on xml choice src-f90/*_effxml*.f90 src-f90/*_afterfpp*.f90 diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5a68bea7cf315bdd44d23d15578355a55ac5ce69..47be303e2c76a8f97fffc1987b81985c36acfc44 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -7,7 +7,7 @@ variables: TBXFOLDER: matlab/CHEASEgui TBXTARGET: CHEASEgui MATVER: 906 - MATFIRST: 805 + MATFIRST: 902 TESTCASE: basic # Build @@ -17,10 +17,12 @@ build: - export - echo "Script to build (e.g. mexes)" - cd src-f90 - - make chease - - cd .. - - ./WK/TESTCASES/NIDEAL10/script_test_chease_from_codes $PWD/src-f90 - - cd src-f90 + - make test_chease_ci_short +# - cd .. +# - ./WK/TESTCASES/NIDEAL10/script_test_chease_from_codes $PWD/src-f90 $PWD +# - cd src-f90 + # to be done nightly or weekends + - make test_chease_nsttp nsttp=0 - make clean # Build @@ -32,16 +34,6 @@ validate_py_scripts: after_script: null # Tests -test-matlab-8.5.0: - extends: .test-template:up-to-8.5 - variables: - MATLABCMD: matlab850 - -test-matlab-9.0.0: - extends: .test-template:8.6-to-9.5 - variables: - MATLABCMD: matlab900 - test-matlab-9.2.0: extends: .test-template:8.6-to-9.5 variables: @@ -64,16 +56,6 @@ pre-deployment-checks: pre-deployment-staging: extends: .staging-template -test-staging-8.5.0: - extends: .test-staging-template:up-to-8.5 - variables: - MATLABCMD: matlab850 - -test-staging-9.0.0: - extends: .test-staging-template - variables: - MATLABCMD: matlab900 - test-staging-9.2.0: extends: .test-staging-template variables: diff --git a/Code_transfer_CHEASE_ITERandPartners.pdf b/Code_transfer_CHEASE_ITERandPartners.pdf deleted file mode 100644 index 1abb2e1984d41fab0d199438d7a5eed2874eeb8f..0000000000000000000000000000000000000000 Binary files a/Code_transfer_CHEASE_ITERandPartners.pdf and /dev/null differ diff --git a/Code_transfer_CHEASE_generic.pdf b/Code_transfer_CHEASE_generic.pdf deleted file mode 100644 index b21eb4029c6ad290914a07227725f42bbf57a67a..0000000000000000000000000000000000000000 Binary files a/Code_transfer_CHEASE_generic.pdf and /dev/null differ diff --git a/README_tags b/README_tags index 52631eb005b4dc1953b638c4be3bf319bcc00a77..f08b0759a3b7d038d6a3658f3b30afaff18f457d 100644 --- a/README_tags +++ b/README_tags @@ -457,3 +457,12 @@ e 20211112: Last tag of svn, then move to gitlab: gitlab.epfl.ch:spc/chease.git svn cp https://spcsvn.epfl.ch/repos/CHEASE/chease/trunk https://spcsvn.epfl.ch/repos/CHEASE/chease/tags/4.10b.10_IMAS_3_CHEASEv12_18 -m"Tag 4.10b.10_IMAS_3_CHEASEv12_18: minor fixes but mainly last tag before moving to gitlab.epfl.ch:spc/chease.git" + +20230330: Tag starting new main version with corrected q input (when npsi/niso differ) and allowing P and/or q as input directly from eqdsk + git tag 13.1 -m"allows p and/or q as inputs from eqdsk, improved q input solver, simplify tag numbering" + +202401xx: Tag with version removing obsolete IDS nodes and other smaller bug fix of feature enhancement like nblopt + git tag 14.1 -m"removed obsolete IDS nodes and other smaller bug fix of feature enhancement like nblopt" + +20240314: Tag small corrections (one element removed as obsolescent by error and 1 bug fix) + git tag 14.2 -m"re-introduce boundary%geometric_axis removed by error and fix write_out_expeq_in to hdf5" diff --git a/WK/TESTCASES/NIDEAL10/script_test_chease_from_codes b/WK/TESTCASES/NIDEAL10/script_test_chease_from_codes index 882ebf6408bf87f5f8e59c7902f192a3eb6afe4b..bc5a3177aac4472f74e86bb86273ce53f29f2466 100755 --- a/WK/TESTCASES/NIDEAL10/script_test_chease_from_codes +++ b/WK/TESTCASES/NIDEAL10/script_test_chease_from_codes @@ -10,6 +10,11 @@ fi echo $chease_path export CHEASE_ROOT=$PWD #this is the directory in which you have src-f90, WK, etc +if [ $# -ge 2 ] +then + CHEASE_ROOT=$2 +fi + export NIDEAL10=$CHEASE_ROOT'/WK/TESTCASES/NIDEAL10' export PATH=$CHEASE_ROOT/scripts_for_bin:$chease_path:$PATH # to add path for o.chease_to_cols and official chease release at SPC diff --git a/WK/TESTCASES/nsttp_series_test/VG_run_tests.m b/WK/TESTCASES/nsttp_series_test/VG_run_tests.m index 68af2167ce055ae37e239f00ca873e053852dacb..7745ff105a2aeb57a0c4019ecfdbe3f89610a53b 100644 --- a/WK/TESTCASES/nsttp_series_test/VG_run_tests.m +++ b/WK/TESTCASES/nsttp_series_test/VG_run_tests.m @@ -23,6 +23,9 @@ try eqd1=read_eqdsk(fullfile(inputdir,'EQDSK_COCOS_11.OUT_EXPEQtest_1'),cocosin); switch runtest + case 0 + eqd2=read_eqdsk(fullfile(tmpdir,'EQDSK_COCOS_11.OUT'),cocosin); + eqd3=read_eqdsk(fullfile(tmpdir,'EQDSK_COCOS_11.OUT_fromEQDSK_Q'),cocosin); case 1 eqd2=read_eqdsk(fullfile(tmpdir,'EQDSK_COCOS_11.OUT_fromEQDSK'),cocosin); case 2 @@ -39,7 +42,7 @@ try disp('runtest not ok') return end - + set(0,'DefaultlineLineWidth',3); figure set(gcf,'pos',[460 60 720 710]); subplot(4,1,1) @@ -47,6 +50,10 @@ try hold on plot(eqd2.rhopsi,eqd2.p,'--') legend('EQDSK_orig',eqd2.fname) + if exist('eqd3') + plot(eqd3.rhopsi,eqd3.p,'--') + legend('EQDSK_orig',eqd2.fname,eqd3.fname) + end xlabel('rhopsi') ylabel('p') title(['runtest = ' num2str(runtest)]) @@ -56,6 +63,10 @@ try hold on plot(eqd2.rhopsi,eqd2.pprime,'--') legend('EQDSK_orig',eqd2.fname) + if exist('eqd3') + plot(eqd3.rhopsi,eqd3.pprime,'--') + legend('EQDSK_orig',eqd2.fname,eqd3.fname) + end xlabel('rhopsi') ylabel('pprime') @@ -64,6 +75,10 @@ try hold on plot(eqd2.rhopsi,eqd2.FFprime,'--') legend('EQDSK_orig',eqd2.fname) + if exist('eqd3') + plot(eqd3.rhopsi,eqd3.FFprime,'--') + legend('EQDSK_orig',eqd2.fname,eqd3.fname) + end xlabel('rhopsi') ylabel('FFprime') @@ -75,6 +90,13 @@ try zaaa = sum(abs(eqd1.q-aaa).^2) / numel(aaa); disp(['diff on q sqrt(sum((q-y)^2)/N)/mean(q): ' num2str(sqrt(zaaa)/mean(eqd1.q),'%.2e')]) legend('EQDSK_orig','EQDSK_out_fromeqdsk') + if exist('eqd3') + plot(eqd3.rhopsi,eqd3.q,'--') + legend('EQDSK_orig',eqd2.fname,eqd3.fname) + aaa = interpos(eqd3.rhopsi,eqd3.q,eqd1.rhopsi,-0.01,[2 2],[eqd3.q(1) eqd3.q(end)]); + zaaa = sum(abs(eqd1.q-aaa).^2) / numel(aaa); + disp(['diff on q eqd3 sqrt(sum((q-y)^2)/N)/mean(q): ' num2str(sqrt(zaaa)/mean(eqd1.q),'%.2e')]) + end xlabel('rhopsi') ylabel('q') @@ -83,6 +105,10 @@ try hold on plot(eqd2.rplas,eqd2.zplas,'--') legend('EQDSK_orig',eqd2.fname) + if exist('eqd3') + plot(eqd3.rplas,eqd3.zplas,'--') + legend('EQDSK_orig',eqd2.fname,eqd3.fname) + end xlabel('R [m]') ylabel('Z [m]') @@ -94,6 +120,9 @@ try disp(['eqd2.Rgeom/r0exp= ' num2str(eqd2.syscode_formulas.R0/eqd2.r0)]) disp(['eqd1.q0= ' num2str(eqd1.q(1))]) disp(['eqd2.q0= ' num2str(eqd2.q(1))]) + if exist('eqd3') + disp(['eqd3.q0= ' num2str(eqd3.q(1))]) + end if abs(eqd1.q(1)-eqd2.q(1)) > 0.001 disp('***********************************************************************') warning(['WARNING q0 different']) diff --git a/WK/TESTCASES/nsttp_series_test/run_tests b/WK/TESTCASES/nsttp_series_test/run_tests index 0c61de3b388c4674d11a3a43841580cfa5363ce9..595654b673b937f59f3e3e040d1b40168753c781 100755 --- a/WK/TESTCASES/nsttp_series_test/run_tests +++ b/WK/TESTCASES/nsttp_series_test/run_tests @@ -1,9 +1,26 @@ #!/bin/sh curdir=`pwd` +if [ $# -lt 2 ] +then + chease_path=/home/codes/bin +else + chease_path=$2 +fi +echo $chease_path + +export CHEASE_ROOT=$PWD #this is the directory in which you have src-f90, WK, etc +if [ $# -ge 3 ] +then + CHEASE_ROOT=$3 +fi + +export PATH=$CHEASE_ROOT/scripts_for_bin:$chease_path:$PATH # to add path for o.chease_to_cols and official chease release at SPC +which chease + fullpath=`realpath $0` inputfiles=`dirname $fullpath` -#echo $inputfiles +echo "inputfiles = " $inputfiles testdir='/tmp/'$USER'/nsttp_tests' mkdir -p $testdir #echo $testdir @@ -18,6 +35,362 @@ then runtest=$1 fi +if [ $runtest -eq 0 ] +then + # run from eqdsk file nsttp=1 up to nsttp=5 + echo " " + echo "************* from eqdsk with pprime, FFprime(rhopol)" + cp $inputfiles/EQDSK_COCOS_11.OUT_EXPEQtest_1 EXPEQ + cp $inputfiles/chease_namelist_top chease_namelist + echo 'NEQDSK=1,' >> chease_namelist + echo 'NSTTP=1,' >> chease_namelist + echo 'NPROPT=-2,' >> chease_namelist + echo '/' >> chease_namelist + cp EXPEQ EXPEQ_orig + cp chease_namelist chease_namelist_eqdsk + cp chease_namelist o.EQDSK + chease>>o.EQDSK + cp -pr EQDSK_COCOS_11.OUT EQDSK_COCOS_11.OUT_fromEQDSK + q0=0.802357108 + qedge=1.99278996 + betap=0.623757284 + grep -E Q_ZERO\|Q_EDGE o.EQDSK | cut -c -25 + grep -E "[0-9]+.*POLOIDAL BETA" o.EQDSK + grep SCALE o.EQDSK + echo " " + Q_ZERO=`grep Q_ZERO o.EQDSK | cut -c -18` + Q_EDGE=`grep Q_EDGE o.EQDSK | cut -c -18` + BETAPOL=`grep -E "[0-9]+.*POLOIDAL BETA" o.EQDSK | cut -c -18` + err0=`perl -e "print ($q0-$Q_ZERO)"` + erredge=`perl -e "print ($qedge-$Q_EDGE)"` + errbetap=`perl -e "print ($betap-$BETAPOL)"` + test_string0='x'$err0'x' + test_stringedge='x'$erredge'x' + test_stringbetap='x'$errbetap'x' + if [ $test_string0 != 'xx' ] && [ $test_stringedge != 'xx' ] && [ $test_stringbetap != 'xx' ] + then + err_ok=`perl -e "print (abs($errbetap*$err0*$erredge)<1e-10)"` + else + echo "empty string in some err hence not defined" + err_ok=0 + fi + echo "err_ok = $err_ok, errq0 = $err0, errqedge = $erredge, errbetap = $errbetap" + if [ $err_ok -eq '1' ] + then + CODE0=0 + else + CODE0=1 + echo "exit with CODE0" $CODE0 + exit $CODE0 + fi + + echo " " + echo "************* from EXPEQ.OUT.TOR with P, Istar(rhotornorm)" + cp EXPEQ.OUT.TOR EXPEQ + cp $inputfiles/chease_namelist_top chease_namelist + echo 'NEQDSK=0,' >> chease_namelist + echo 'NCSCAL=1,' >> chease_namelist + echo 'QSPEC=' $q0 ',' >> chease_namelist + echo 'NSTTP=2,' >> chease_namelist + echo 'NPPFUN=8,' >> chease_namelist + echo 'NPROPT=3,' >> chease_namelist + echo 'NFUNRHO=1,' >> chease_namelist + echo 'NRHOMESH=1,' >> chease_namelist + echo '/' >> chease_namelist + cp chease_namelist o.npropt_m2 + chease>>o.npropt_m2 + grep -E Q_ZERO\|Q_EDGE o.npropt_m2 | cut -c -25 + grep -E "[0-9]+.*POLOIDAL BETA" o.npropt_m2 + grep SCALE o.npropt_m2 + echo " " + Q_ZERO=`grep Q_ZERO o.npropt_m2 | cut -c -18` + Q_EDGE=`grep Q_EDGE o.npropt_m2 | cut -c -18` + BETAPOL=`grep -E "[0-9]+.*POLOIDAL BETA" o.npropt_m2 | cut -c -18` + err0=`perl -e "print ($q0-$Q_ZERO)"` + erredge=`perl -e "print ($qedge-$Q_EDGE)"` + errbetap=`perl -e "print ($betap-$BETAPOL)"` + test_string0='x'$err0'x' + test_stringedge='x'$erredge'x' + test_stringbetap='x'$errbetap'x' + if [ $test_string0 != 'xx' ] && [ $test_stringedge != 'xx' ] && [ $test_stringbetap != 'xx' ] + then + err_ok=`perl -e "print (abs($errbetap)*abs($erredge)<1e-5)"` + else + echo "empty string in some err hence not defined" + err_ok=0 + fi + echo "err_ok = $err_ok, errq0 = $err0, errqedge = $erredge, errbetap = $errbetap" + if [ $err_ok -eq '1' ] + then + CODE1=0 + else + CODE1=1 + echo "exit with CODE1" $CODE1 + exit $CODE1 + fi + + echo " " + echo "************* from EXPEQ.OUT with pprime, Iparallel(rhopol)" + restart=0 + if [ $restart -eq '1' ] + then + cp EXPEQ_orig EXPEQ + cp chease_namelist_eqdsk chease_namelist + echo 'NPROPT=3,' >> chease_namelist + chease>>o.EQDSK_npropt_3 + ok_value=1e-6 + else + ok_value=1e-4 + fi + cp EXPEQ.OUT EXPEQ + cp $inputfiles/chease_namelist_top chease_namelist + echo 'NEQDSK=0,' >> chease_namelist + echo 'NCSCAL=1,' >> chease_namelist + echo 'QSPEC=' $q0 ',' >> chease_namelist + echo 'NSTTP=3,' >> chease_namelist + echo 'NPPFUN=4,' >> chease_namelist + echo 'NPROPT=-4,' >> chease_namelist + echo 'NFUNRHO=0,' >> chease_namelist + echo 'NRHOMESH=0,' >> chease_namelist + echo '/' >> chease_namelist + cp chease_namelist o.npropt_3 + chease>>o.npropt_3 + grep -E Q_ZERO\|Q_EDGE o.npropt_3 | cut -c -25 + grep -E "[0-9]+.*POLOIDAL BETA" o.npropt_3 + grep SCALE o.npropt_3 + echo " " + Q_ZERO=`grep Q_ZERO o.npropt_3 | cut -c -18` + Q_EDGE=`grep Q_EDGE o.npropt_3 | cut -c -18` + BETAPOL=`grep -E "[0-9]+.*POLOIDAL BETA" o.npropt_3 | cut -c -18` + err0=`perl -e "print ($q0-$Q_ZERO)"` + erredge=`perl -e "print ($qedge-$Q_EDGE)"` + errbetap=`perl -e "print ($betap-$BETAPOL)"` + test_string0='x'$err0'x' + test_stringedge='x'$erredge'x' + test_stringbetap='x'$errbetap'x' + if [ $test_string0 != 'xx' ] && [ $test_stringedge != 'xx' ] && [ $test_stringbetap != 'xx' ] + then + err_ok=`perl -e "print (abs($errbetap)*abs($erredge)<$ok_value)"` + else + echo "empty string in some err hence not defined" + err_ok=0 + fi + echo "err_ok = $err_ok, errq0 = $err0, errqedge = $erredge, errbetap = $errbetap" + if [ $err_ok -eq '1' ] + then + CODE2=0 + else + CODE2=1 + echo "exit with CODE2" $CODE2 + exit $CODE2 + fi + + echo " " + echo "************* from EXPEQ.OUT.TOR with P, <j.B>/B0(rhotornorm)" + restart=1 + if [ $restart -eq '1' ] + then + cp EXPEQ_orig EXPEQ + cp chease_namelist_eqdsk chease_namelist + echo 'NPROPT=-4,' >> chease_namelist + chease>>o.EQDSK_npropt_m4 + ok_value=3e-5 + else + ok_value=1e-4 + fi + cp EXPEQ.OUT.TOR EXPEQ + cp $inputfiles/chease_namelist_top chease_namelist + echo 'NEQDSK=0,' >> chease_namelist + echo 'NCSCAL=1,' >> chease_namelist + echo 'QSPEC=' $q0 ',' >> chease_namelist + echo 'NSTTP=4,' >> chease_namelist + echo 'NPPFUN=8,' >> chease_namelist + echo 'NPROPT=-5,' >> chease_namelist + echo 'NFUNRHO=1,' >> chease_namelist + echo 'NRHOMESH=1,' >> chease_namelist + echo '/' >> chease_namelist + cp chease_namelist o.npropt_m4 + chease>>o.npropt_m4 + grep -E Q_ZERO\|Q_EDGE o.npropt_m4 | cut -c -25 + grep -E "[0-9]+.*POLOIDAL BETA" o.npropt_m4 + grep SCALE o.npropt_m4 + echo " " + Q_ZERO=`grep Q_ZERO o.npropt_m4 | cut -c -18` + Q_EDGE=`grep Q_EDGE o.npropt_m4 | cut -c -18` + BETAPOL=`grep -E "[0-9]+.*POLOIDAL BETA" o.npropt_m4 | cut -c -18` + err0=`perl -e "print ($q0-$Q_ZERO)"` + erredge=`perl -e "print ($qedge-$Q_EDGE)"` + errbetap=`perl -e "print ($betap-$BETAPOL)"` + test_string0='x'$err0'x' + test_stringedge='x'$erredge'x' + test_stringbetap='x'$errbetap'x' + if [ $test_string0 != 'xx' ] && [ $test_stringedge != 'xx' ] && [ $test_stringbetap != 'xx' ] + then + err_ok=`perl -e "print (abs($errbetap)*abs($erredge)<$ok_value)"` + else + echo "empty string in some err hence not defined" + err_ok=0 + fi + echo "err_ok = $err_ok, errq0 = $err0, errqedge = $erredge, errbetap = $errbetap" + if [ $err_ok -eq '1' ] + then + CODE3=0 + else + CODE3=1 + echo "exit with CODE3" $CODE3 + exit $CODE3 + fi + + echo " " + echo "************* from EXPEQ.OUT.TOR with P, q(rhotornorm)" + restart=1 + if [ $restart -eq '1' ] + then + cp EXPEQ_orig EXPEQ + cp chease_namelist_eqdsk chease_namelist + echo 'NPROPT=-5,' >> chease_namelist + chease>>o.EQDSK_npropt_m4 + ok_value=3e-5 + else + ok_value=1e-4 + fi + cp EXPEQ.OUT.TOR EXPEQ + cp $inputfiles/chease_namelist_top chease_namelist + echo 'NEQDSK=0,' >> chease_namelist + echo 'NCSCAL=1,' >> chease_namelist + echo 'QSPEC=' $q0 ',' >> chease_namelist + echo 'NSTTP=5,' >> chease_namelist + echo 'NPPFUN=8,' >> chease_namelist + echo 'NPROPT=5,' >> chease_namelist + echo 'NFUNRHO=1,' >> chease_namelist + echo 'NRHOMESH=1,' >> chease_namelist + echo '/' >> chease_namelist + cp chease_namelist o.npropt_m5 + chease>>o.npropt_m5 + grep -E Q_ZERO\|Q_EDGE o.npropt_m5 | cut -c -25 + grep -E "[0-9]+.*POLOIDAL BETA" o.npropt_m5 + grep SCALE o.npropt_m5 + echo " " + Q_ZERO=`grep Q_ZERO o.npropt_m5 | cut -c -18` + Q_EDGE=`grep Q_EDGE o.npropt_m5 | cut -c -18` + BETAPOL=`grep -E "[0-9]+.*POLOIDAL BETA" o.npropt_m5 | cut -c -18` + err0=`perl -e "print ($q0-$Q_ZERO)"` + erredge=`perl -e "print ($qedge-$Q_EDGE)"` + errbetap=`perl -e "print ($betap-$BETAPOL)"` + test_string0='x'$err0'x' + test_stringedge='x'$erredge'x' + test_stringbetap='x'$errbetap'x' + if [ $test_string0 != 'xx' ] && [ $test_stringedge != 'xx' ] && [ $test_stringbetap != 'xx' ] + then + err_ok=`perl -e "print (abs($errbetap)*abs($erredge)<$ok_value)"` + else + echo "empty string in some err hence not defined" + err_ok=0 + fi + echo "err_ok = $err_ok, errq0 = $err0, errqedge = $erredge, errbetap = $errbetap" + if [ $err_ok -eq '1' ] + then + CODE4=0 + else + CODE4=1 + echo "exit with CODE4" $CODE4 + exit $CODE4 + fi + + echo " " + echo "************* from eqdsk with pressure and q(rhopol), ask for jedge=0" + cp $inputfiles/EQDSK_COCOS_11.OUT_EXPEQtest_1 EXPEQ + cp $inputfiles/chease_namelist_top chease_namelist + echo 'NEQDSK=1,' >> chease_namelist + echo 'NSTTP=5,' >> chease_namelist + echo 'NPPFUN=8,' >> chease_namelist + echo 'RELAX=0.2,' >> chease_namelist + echo 'NINSCA=100,' >> chease_namelist + echo 'NINMAP=100,' >> chease_namelist + echo 'N0JEDGE=1,' >> chease_namelist + echo 'NPROPT=-2,' >> chease_namelist + echo '/' >> chease_namelist + cp chease_namelist o.EQDSK_Q + chease>>o.EQDSK_Q + cp -pr EQDSK_COCOS_11.OUT EQDSK_COCOS_11.OUT_fromEQDSK_Q + grep -E Q_ZERO\|Q_EDGE o.EQDSK_Q | cut -c -25 + grep -E "[0-9]+.*POLOIDAL BETA" o.EQDSK_Q + grep SCALE o.EQDSK_Q + echo " " + Q_ZERO=`grep Q_ZERO o.EQDSK_Q | cut -c -18` + Q_EDGE=`grep Q_EDGE o.EQDSK_Q | cut -c -18` + BETAPOL=`grep -E "[0-9]+.*POLOIDAL BETA" o.EQDSK_Q | cut -c -18` + err0=`perl -e "print ($q0-$Q_ZERO)"` + erredge=`perl -e "print ($qedge-$Q_EDGE)"` + errbetap=`perl -e "print ($betap-$BETAPOL)"` + test_string0='x'$err0'x' + test_stringedge='x'$erredge'x' + test_stringbetap='x'$errbetap'x' + if [ $test_string0 != 'xx' ] && [ $test_stringedge != 'xx' ] && [ $test_stringbetap != 'xx' ] + then + err_ok=`perl -e "print (abs($errbetap*$err0*$erredge)<1e-08)"` + else + echo "empty string in some err hence not defined" + err_ok=0 + fi + echo "err_ok = $err_ok, errq0 = $err0, errqedge = $erredge, errbetap = $errbetap" + if [ $err_ok -eq '1' ] + then + CODE5=0 + else + CODE5=1 + echo "exit with CODE5" $CODE5 + exit $CODE5 + fi + + echo " " + echo "************* test NIN, from eqdsk with pressure and q(rhopol), ask for jedge=1" + # Note can use NIN for nsttp5 only if NOUT was obtained with nsttp=5 option (specific arrays saved) + cp NOUT NIN + grep -v / chease_namelist > tmp + cp tmp chease_namelist + echo 'N0JEDGE=0,' >> chease_namelist + echo 'NOPT=-2,' >> chease_namelist + echo '/' >> chease_namelist + cp chease_namelist o.EQDSK_Q_b + chease>>o.EQDSK_Q_b + cp -pr EQDSK_COCOS_11.OUT EQDSK_COCOS_11.OUT_fromEQDSK_Q_b + grep -E Q_ZERO\|Q_EDGE o.EQDSK_Q_b | cut -c -25 + grep -E "[0-9]+.*POLOIDAL BETA" o.EQDSK_Q_b + grep SCALE o.EQDSK_Q_b + echo " " + Q_ZERO=`grep Q_ZERO o.EQDSK_Q_b | cut -c -18` + Q_EDGE=`grep Q_EDGE o.EQDSK_Q_b | cut -c -18` + BETAPOL=`grep -E "[0-9]+.*POLOIDAL BETA" o.EQDSK_Q_b | cut -c -18` + err0=`perl -e "print ($q0-$Q_ZERO)"` + erredge=`perl -e "print ($qedge-$Q_EDGE)"` + errbetap=`perl -e "print ($betap-$BETAPOL)"` + test_string0='x'$err0'x' + test_stringedge='x'$erredge'x' + test_stringbetap='x'$errbetap'x' + if [ $test_string0 != 'xx' ] && [ $test_stringedge != 'xx' ] && [ $test_stringbetap != 'xx' ] + then + err_ok=`perl -e "print (abs($errbetap*$err0*$erredge)<1e-10)"` + else + echo "empty string in some err hence not defined" + err_ok=0 + fi + echo "err_ok = $err_ok, errq0 = $err0, errqedge = $erredge, errbetap = $errbetap" + if [ $err_ok -eq '1' ] + then + CODE6=0 + else + CODE6=1 + echo "exit with CODE6" $CODE6 + exit $CODE6 + fi + + CODEALL=`perl -e "print ($CODE0+$CODE1+$CODE2+$CODE3+$CODE4+$CODE5+$CODE6)"` + echo "exit with CODEALL" $CODEALL + exit $CODEALL + +fi + if [ $runtest -eq 1 ] then # run from eqdsk file diff --git a/build_imas.csh b/build_imas.csh index 3902ce16e0996270797feffc4de6b836402cac06..1cec51bd61100cd7e647c1007c18690af8eddf5a 100755 --- a/build_imas.csh +++ b/build_imas.csh @@ -2,25 +2,23 @@ setenv IMAS_HOME_eff 'x'$IMAS_HOME'x' if ($IMAS_HOME_eff != 'xx') then - # build_imas expect folder fc2k_imas with the actors *.xml - # for ITM, expects - #source $ITMSCRIPTDIR/ITMv1 kepler test 4.10b.10_R2.2.0 - #source $ITMSCRIPTDIR/ITMv1 kepler test 4.10b_rc - #module switch fc2k/rc - #module switch scripts/R2.2 cd src-f90 make clean - make libchease_kepler_imas + make libchease_module_imas cd .. - - # can test with: fc2k -kepler -docfile doc/chease.txt fc2k_imas/chease.xml + + set extra_string='_choices' + if ($XML_USE_CHOICE == 'NO') then + set extra_string='_reflist' + endif + echo " " + echo "Now execute: " + echo "iwrap -f iwrap/chease$extra_string.yaml -i ~/public/PYTHON_ACTORS" + echo " " + echo "to test then:" + echo "python python/run_chease_iwrap$extra_string.py > /tmp/$USER/o.python_chease$extra_string" echo " " - echo "Can execute: fc2k fc2k_imas/chease.xml # -kepler -docfile doc/chease.txt do not seem to work" - - # then can test with workflow in ./workflow_test/chease_test_workflow_nocpoin.xml which creates shot 12345, run=1 from no CPO (dummy shot=12345, run 4321 used) - # then can test with workflow in ./workflow_test/chease_test_workflow.xml using shot=12345, run=1 to create run=11 else - echo "error IMAS environment not available. Cant use makefile option 'IMAS_ENVIRONMENT_LOADED=yes'" + echo "error IMAS environment not available. Cant use makefile option 'IMAS_HOME=yes'" endif - diff --git a/config_iter_hpc.sh b/config_iter_hpc.sh deleted file mode 100644 index 8c0539cf7e8b5acd38f99af4fc2ae69b4a96b4db..0000000000000000000000000000000000000000 --- a/config_iter_hpc.sh +++ /dev/null @@ -1,20 +0,0 @@ -# Start from clean environment -module purge - -# IMAS and FC2K -module load IMAS FC2K - -# Actor folder -export ACTOR_FOLDER=~/public/PYTHON_ACTORS -mkdir -p $ACTOR_FOLDER - -# Need to remove the stack limit to avoid segmentation fault inside codes -ulimit -Ss unlimited - -# Libraries needed for the compilation of the H&CD codes themselves -module load XMLlib/3.3.1-intel-2018a -module load INTERPOS/9.1.0-intel-2018a - -# EXTEND PYTHON PATH AND AVOID DOUBLONS -export PYTHONPATH=$ACTOR_FOLDER/chease:$PYTHONPATH -export PYTHONPATH="$(perl -e 'print join(":", grep { not $seen{$_}++ } split(/:/, $ENV{PYTHONPATH}))')" diff --git a/config_iter_sdcc.sh b/config_iter_sdcc.sh old mode 100644 new mode 100755 index 0686a55cc1a8082265874adca649a4fb1dcf9ad3..8b30edaeab3105e9709d8a38176211b7f3b95402 --- a/config_iter_sdcc.sh +++ b/config_iter_sdcc.sh @@ -1,8 +1,64 @@ -# Start from clean environment -module purge +# treats inputs/defaults +# source config_iter_sdcc.sh [ifort/gfortran [NO/YES [0/1]]] (defaults: ifort, NO and 0 (no module loaded)) +# +export CHEASE_F90=ifort +export XML_USE_CHOICE=NO +export load_specific_modules=0 +if [ $# -ge 1 ] +then + export CHEASE_F90=$1 + if [ $# -ge 2 ] + then + export XML_USE_CHOICE=$2 + if [ $# -ge 3 ] + then + export load_specific_modules=$3 + fi + else + echo "default \$2: $XML_USE_CHOICE" + fi +else + echo "default \$1: $CHEASE_F90 and \$2: $XML_USE_CHOICE" +fi +export FC=$CHEASE_F90 -# IMAS and FC2K -module load IMAS iWrap FC2K +export on_gateway=`test -d /cineca ; echo $?` + +# Start from clean environment if 3rd input is 1 +if [ $load_specific_modules = '1' ] +then + module purge + + # load standard modules, add module switch if need specific ones per compiler type + if [ $on_gateway = '0' ] + then + module load cineca + module load imasenv/3.40.0-test/intel/rc iwrap + else + module load IMAS iWrap XMLlib INTERPOS TotalView + fi +fi + +if [ $CHEASE_F90 = 'ifort' ] +then + echo "" # need a statement in then + # ifort modules + # ... +else + if [ $CHEASE_F90 = 'gfortran' ] + then + echo "" + if [ $on_gateway = '0' ] + then + echo 'on gateway: ONLY ifort works so far' + break + fi + # gfortran modules: + # ... + else + echo 'compiler ($1='$CHEASE_F90') not yet expected, choose ifort or gfortran' + fi +fi # Actor folder export ACTOR_FOLDER=~/public/PYTHON_ACTORS @@ -11,16 +67,6 @@ mkdir -p $ACTOR_FOLDER # Need to remove the stack limit to avoid segmentation fault inside codes ulimit -Ss unlimited -# Intel as default compiler -export FCOMPILER=ifort - -# Libraries needed for the compilation of the H&CD codes themselves -module load INTERPOS/9.1.0-intel-2020b -module load XMLlib/3.3.1-intel-2020b - # EXTEND PYTHON PATH AND AVOID DOUBLONS -#export PYTHONPATH=$ACTOR_FOLDER/chease:$PYTHONPATH # FOR FC2K export PYTHONPATH=$ACTOR_FOLDER:$PYTHONPATH # FOR IWRAP export PYTHONPATH="$(perl -e 'print join(":", grep { not $seen{$_}++ } split(/:/, $ENV{PYTHONPATH}))')" - -# iwrap -a nemo -f nemo.yaml diff --git a/fc2k/chease.xml b/fc2k/chease.xml index 96deb6753af32729db5e9ce7c05edf3f41856e95..4e6ef9e6e2735fba7a85170d3a2af17803106645 100644 --- a/fc2k/chease.xml +++ b/fc2k/chease.xml @@ -6,6 +6,8 @@ <fFile>./src-f90/libchease_kepler.a</fFile> <mainLibraryOptim></mainLibraryOptim> <HasOptim>false</HasOptim> + <headerPath>../src-f90/chease_module.mod</headerPath> + <useHeader>true</useHeader> <subrt>chease</subrt> <tupleParams serialization="custom"> <unserializable-parents/> diff --git a/input/README_test_iwrap b/input/README_test_iwrap new file mode 100644 index 0000000000000000000000000000000000000000..2e3e3704416340ad67743abaad547159075b31ef --- /dev/null +++ b/input/README_test_iwrap @@ -0,0 +1,6 @@ +source config_iter_sdcc.sh ifort NO # or: source config_iter_sdcc.sh gfortran NO +build_imas.csh +iwrap -f iwrap/chease_reflist.yaml -i ~/public/PYTHON_ACTORS +ln -sf scenario_iter.yaml input/scenario.yaml +#or ln -sf scenario_gateway.yaml input/scenario.yaml +python python/run_chease_iwrap_reflist.py > /tmp/$USER/o.reflist diff --git a/input/chease_input_choices.xml b/input/chease_input_choices.xml index 7a3aeff14137e2a68fe9fb556569e4047e2565bd..e54161abfe730ad817dbc41a49f2a575517ffac9 100644 --- a/input/chease_input_choices.xml +++ b/input/chease_input_choices.xml @@ -4,7 +4,7 @@ <COCOS_verbose> <cocos_in>11</cocos_in> <cocos_out>11</cocos_out> - <nverbose>1</nverbose> + <nverbose>3</nverbose> </COCOS_verbose> <choice_of_input_profiles> <first_source> diff --git a/input/chease_input_reflist.xml b/input/chease_input_reflist.xml new file mode 100644 index 0000000000000000000000000000000000000000..a5725ee89f48d2afa66f6c72c28ee2a654c434c8 --- /dev/null +++ b/input/chease_input_reflist.xml @@ -0,0 +1,171 @@ +<!-- !*comdeck comdat --> +<!-- ! --> +<!-- !********************************************************************** --> +<!-- ! * --> +<!-- ! c.20 equilbrium namelist * --> +<!-- ! * --> +<!-- !********************************************************************** --> +<!-- ! --> +<!-- ! add comments about namelist variables here: --> +<!-- ! --> +<!-- ! nideal: determines mapping of specific chease results on to a specific mesh, in general for a given code --> +<!-- ! =0: for mars --> +<!-- ! =1: for erato --> +<!-- ! =2: for lion --> +<!-- ! =3: for nova-w (file inp1) --> +<!-- ! =4: for penn (file npenn) --> +<!-- ! =5: for xtor (file outxtor) --> +<!-- ! =6 (default): for standard output, including eqdsk --> +<!-- ! =7: for gyrokinetic codes (file eqcin) --> +<!-- ! =8: for elite (file nelite) --> +<!-- ! =9: for ogyropsi (file ogyropsi), requires straight field line jacobian --> +<!-- ! --> +<!-- ! eu-itm related variables: --> +<!-- ! --> +<!-- ! nitmopt: determines type of input and possibilities. if set to -1 as default value, assume chease not compiled with itm package. if set to 0, then can be changed in namelist such that: --> +<!-- ! =01: read equilibrium from itm structure, but write standard output files --> +<!-- ! =11: read and write equil from and to itm data structure --> +<!-- ! =10: read equil from standard files and write to itm data structure --> +<!-- ! =00: read from files and write on files as before --> +<!-- ! =22: read and write via kepler (not active yet) --> +<!-- ! nitmshot(1)/nitmrun(1): shot and run number to read itm data from --> +<!-- ! nitmshot(2)/nitmrun(2): shot and run number to write itm data to --> +<!-- ! treeitm: itm tree to use, treeitm(1) for reading and treeitm(2) for writing the data --> +<!-- ! at this stage, it is assumed that only the signal_name='equilibrium' is dealt with --> +<!-- ! --> +<!-- ! namelist /eqdata/ & --> + +<parameters> + +<!-- note: the first appearance of a given parameter is taken into account instead of the last as in namelist --> + +<!-- run_control parameters --> + <cocos_in> 11 </cocos_in> + <cocos_out> 11 </cocos_out> + <nverbose>3</nverbose> + <epslon> 1.0e-8 </epslon> + <relax> 0.6 </relax> + <ninmap> 200 </ninmap> + <ninsca> 200 </ninsca> + +<!-- meshes parameters --> + <aplace> .97 .99 1.0</aplace> + <awidth> .05 .02 .05 </awidth> + <cplace> .95 .99 1.0 </cplace> + <cwidth> .10 .02 .05 </cwidth> + <dplace> -1.80 -1.80 4.0 </dplace> + <dwidth> .18 .08 .05 </dwidth> + <eplace> -1.70 -1.70 1.70 1.70 </eplace> + <ewidth> .18 .08 .18 .08 </ewidth> + <qplace> 1.00 1.00 2.00 2.00 3.00 3.00 4.00 4.00 4.41 4.41 </qplace> + <qwidth> 0.13 0.04 0.09 0.04 0.07 0.02 0.04 0.01 0.01 0.001 </qwidth> + <solpda> 0.60 </solpda> + <solpdc> 0.70 </solpdc> + <solpdd> 0.60 </solpdd> + <solpde> 0.50 </solpde> + <solpdpol> 0.35 </solpdpol> + <msmax> 1 </msmax> + <nchi> 256 </nchi> + <ndift> 1 </ndift> + <negp> -1 </negp> + <ner> 1 </ner> + <niso> 256 </niso> + <nmesha> 1 </nmesha> + <nmeshc> 1 </nmeshc> + <nmeshd> 1 </nmeshd> + <nmeshe> 0 </nmeshe> + <nmeshpol> 1 </nmeshpol> + <npoida> 2 </npoida> + <npoidc> 2 </npoidc> + <npoidd> 2 </npoidd> + <npoide> 4 </npoide> + <npoidq> 10 </npoidq> + <npsi> 256 </npsi> + <ns> 60 </ns> + <nt> 60 </nt> + <ntnova> 12 </ntnova> + <nv> 40 </nv> + <nvexp> 1 </nvexp> + +<!-- equilibrium_control parameters --> + <cfbal> 10.0 </cfbal> + <cfnress> 1.0 </cfnress> + <cpress> 1.0 </cpress> + <csspec> 0.0 </csspec> + <currt> 0.52 </currt> + <etaei> 0.1 </etaei> + <gamma> 1.6666666667 </gamma> + <predge> 1.0e-08 </predge> + <psibndexp>-9e40</psibndexp> + <psiscl> 1.0 </psiscl> + <qspec> 0.9 </qspec> + <rzion> 1.5 </rzion> + +<!-- plasma_boundary parameters --> + <aspct> 0.28 </aspct> + <elong> 2.05 </elong> + <triang> 0.5 </triang> + <nsurf> 6 </nsurf> + <nsym> 0 </nsym> + +<!-- profiles parameters --> + <ap> 0.0 -0.8 0.0 0.0 </ap> + <at> 0. -0.30761536e+01 0.72318357 0.0 </at> + <at2> 1.5165 0.14189 -5.0417 36.759 -121.11 200.38 -162.23 51.152 </at2> + <at3> 0.52503 0.92754 0.21896 -2.4078 8.1211 -13.87 11.653 -3.7942 </at3> + <at4> 29500. -68768. 272720. -1147400. 2798300. -3873600. 2842600. -852840. </at4> + <nfunc> 4 </nfunc> + <npp> 1 </npp> + <nppfun> 4 </nppfun> <!-- nppfun=4 for pprime and 8 for p as input (needs nsttp.ge.2 for nppfun=8) --> + <nppr> 24 </nppr> + <npropt> 2 </npropt> + <nsour> 8 </nsour> + <nsttp> 5 </nsttp> <!-- set nsttp=1 for ffprime, 2 for Istar=jphi, 3 for Ipar and 4 for jpar=<j.B>/B0 --> + +<!-- in_out_control parameters --> + <b0exp> 1.08 </b0exp> + <comments> + *** comments for the run + *** should fill in first 2 lines, then mod chease to put some automatic values in lines 3:4? + </comments> + <rext> 10.0 </rext> + <rpeop> 0.5 </rpeop> + <rz0w> 0. </rz0w> + <r0exp> 2.90 </r0exp> + <r0w> 1. </r0w> + <nbal> 0 </nbal> + <nblc0> 16 </nblc0> + <nblopt> 0 </nblopt> + <nbsexpq> 0000 </nbsexpq> + <ncscal> 4 </ncscal> + <ndiagop> 1 </ndiagop> + <ndifps> 0 </ndifps> + <neqdsk> 0 </neqdsk> + <neqdxtpo> 1 </neqdxtpo> + <nideal> 6 </nideal> + <nitmopt> 22 </nitmopt> + <nitmshot> 9999 9999</nitmshot> + <nitmrun> 9998 9991</nitmrun> + <nitmocc>0 0</nitmocc> + <treeitm>ids</treeitm> + <tree_user>sautero</tree_user> + <tree_tokamak>test</tree_tokamak> + <tree_majorversion>3 3</tree_majorversion> + <time_ref>200.</time_ref> + <nidsbound>0</nidsbound> + <nopt> 0 </nopt> + <nplot> 1 </nplot> + <nrbox> 129 </nrbox> + <nrscal> 0 </nrscal> + <nsmooth> 1 </nsmooth> + <ntcase> 0 </ntcase> + <ntmf0> 0 </ntmf0> + <nturn> 20 </nturn> + <nzbox> 129 </nzbox> + + <tensbnd> -0.1 </tensbnd> <!-- -1. is standard smoothing, 0 to avoid problems in loops, -10 if boundary hectic or experimental --> + <tensprof> -0.1 </tensprof> <!-- 0 for no smoothing of input profiles, -1 or -10 for stronger and stronger smoothing --> + + <nprof2d> 1 </nprof2d> <!-- 1: compute simple profiles_2d(2), 2: complete, 11: as 1 and _2d(3) on rhotor_norm mesh, 12: complete _2d(3) --> + <n0jedge> 1 </n0jedge> +</parameters> diff --git a/input/chease_input_reflist_nsttp5.xml b/input/chease_input_reflist_nsttp5.xml new file mode 100644 index 0000000000000000000000000000000000000000..890880d84eb32a88c9e2d4827862ddd77ac83c4b --- /dev/null +++ b/input/chease_input_reflist_nsttp5.xml @@ -0,0 +1,171 @@ +<!-- !*comdeck comdat --> +<!-- ! --> +<!-- !********************************************************************** --> +<!-- ! * --> +<!-- ! c.20 equilbrium namelist * --> +<!-- ! * --> +<!-- !********************************************************************** --> +<!-- ! --> +<!-- ! add comments about namelist variables here: --> +<!-- ! --> +<!-- ! nideal: determines mapping of specific chease results on to a specific mesh, in general for a given code --> +<!-- ! =0: for mars --> +<!-- ! =1: for erato --> +<!-- ! =2: for lion --> +<!-- ! =3: for nova-w (file inp1) --> +<!-- ! =4: for penn (file npenn) --> +<!-- ! =5: for xtor (file outxtor) --> +<!-- ! =6 (default): for standard output, including eqdsk --> +<!-- ! =7: for gyrokinetic codes (file eqcin) --> +<!-- ! =8: for elite (file nelite) --> +<!-- ! =9: for ogyropsi (file ogyropsi), requires straight field line jacobian --> +<!-- ! --> +<!-- ! eu-itm related variables: --> +<!-- ! --> +<!-- ! nitmopt: determines type of input and possibilities. if set to -1 as default value, assume chease not compiled with itm package. if set to 0, then can be changed in namelist such that: --> +<!-- ! =01: read equilibrium from itm structure, but write standard output files --> +<!-- ! =11: read and write equil from and to itm data structure --> +<!-- ! =10: read equil from standard files and write to itm data structure --> +<!-- ! =00: read from files and write on files as before --> +<!-- ! =22: read and write via kepler (not active yet) --> +<!-- ! nitmshot(1)/nitmrun(1): shot and run number to read itm data from --> +<!-- ! nitmshot(2)/nitmrun(2): shot and run number to write itm data to --> +<!-- ! treeitm: itm tree to use, treeitm(1) for reading and treeitm(2) for writing the data --> +<!-- ! at this stage, it is assumed that only the signal_name='equilibrium' is dealt with --> +<!-- ! --> +<!-- ! namelist /eqdata/ & --> + +<parameters> + +<!-- note: the first appearance of a given parameter is taken into account instead of the last as in namelist --> + +<!-- run_control parameters --> + <cocos_in> 11 </cocos_in> + <cocos_out> 11 </cocos_out> + <nverbose>3</nverbose> + <epslon> 1.0e-8 </epslon> + <relax> 0.6 </relax> + <ninmap> 100 </ninmap> + <ninsca> 100 </ninsca> + +<!-- meshes parameters --> + <aplace> .00 .70 1.0</aplace> + <awidth> .05 .07 .05 </awidth> + <cplace> .95 .99 1.0 </cplace> + <cwidth> .10 .02 .05 </cwidth> + <dplace> -1.80 -1.80 4.0 </dplace> + <dwidth> .18 .08 .05 </dwidth> + <eplace> -1.70 -1.70 1.70 1.70 </eplace> + <ewidth> .18 .08 .18 .08 </ewidth> + <qplace> 1.00 1.00 2.00 2.00 3.00 3.00 4.00 4.00 4.41 4.41 </qplace> + <qwidth> 0.13 0.04 0.09 0.04 0.07 0.02 0.04 0.01 0.01 0.001 </qwidth> + <solpda> 0.10 </solpda> + <solpdc> 0.70 </solpdc> + <solpdd> 0.60 </solpdd> + <solpde> 0.50 </solpde> + <solpdpol> 0.25 </solpdpol> + <msmax> 1 </msmax> + <nchi> 100 </nchi> + <ndift> 1 </ndift> + <negp> -1 </negp> + <ner> 1 </ner> + <niso> 100 </niso> + <nmesha> 0 </nmesha> + <nmeshc> 1 </nmeshc> + <nmeshd> 1 </nmeshd> + <nmeshe> 0 </nmeshe> + <nmeshpol> 1 </nmeshpol> + <npoida> 1 </npoida> + <npoidc> 2 </npoidc> + <npoidd> 2 </npoidd> + <npoide> 4 </npoide> + <npoidq> 10 </npoidq> + <npsi> 100 </npsi> + <ns> 40 </ns> + <nt> 40 </nt> + <ntnova> 12 </ntnova> + <nv> 40 </nv> + <nvexp> 1 </nvexp> + +<!-- equilibrium_control parameters --> + <cfbal> 10.0 </cfbal> + <cfnress> 1.0 </cfnress> + <cpress> 1.0 </cpress> + <csspec> 0.0 </csspec> + <currt> 0.52 </currt> + <etaei> 0.1 </etaei> + <gamma> 1.6666666667 </gamma> + <predge> 1.0e-08 </predge> + <psibndexp>-9e40</psibndexp> + <psiscl> 1.0 </psiscl> + <qspec> 0.9 </qspec> + <rzion> 1.5 </rzion> + +<!-- plasma_boundary parameters --> + <aspct> 0.28 </aspct> + <elong> 2.05 </elong> + <triang> 0.5 </triang> + <nsurf> 6 </nsurf> + <nsym> 0 </nsym> + +<!-- profiles parameters --> + <ap> 0.0 -0.8 0.0 0.0 </ap> + <at> 0. -0.30761536e+01 0.72318357 0.0 </at> + <at2> 1.5165 0.14189 -5.0417 36.759 -121.11 200.38 -162.23 51.152 </at2> + <at3> 0.52503 0.92754 0.21896 -2.4078 8.1211 -13.87 11.653 -3.7942 </at3> + <at4> 29500. -68768. 272720. -1147400. 2798300. -3873600. 2842600. -852840. </at4> + <nfunc> 4 </nfunc> + <npp> 1 </npp> + <nppfun> 8 </nppfun> <!-- nppfun=4 for pprime and 8 for p as input (needs nsttp.ge.2 for nppfun=8) --> + <nppr> 24 </nppr> + <npropt> 2 </npropt> + <nsour> 8 </nsour> + <nsttp> 5 </nsttp> <!-- set nsttp=1 for ffprime, 2 for Istar=jphi, 3 for Ipar and 4 for jpar=<j.B>/B0 --> + +<!-- in_out_control parameters --> + <b0exp> 1.08 </b0exp> + <comments> + *** comments for the run + *** should fill in first 2 lines, then mod chease to put some automatic values in lines 3:4? + </comments> + <rext> 10.0 </rext> + <rpeop> 0.5 </rpeop> + <rz0w> 0. </rz0w> + <r0exp> 2.90 </r0exp> + <r0w> 1. </r0w> + <nbal> 0 </nbal> + <nblc0> 16 </nblc0> + <nblopt> 0 </nblopt> + <nbsexpq> 0000 </nbsexpq> + <ncscal> 4 </ncscal> + <ndiagop> 1 </ndiagop> + <ndifps> 0 </ndifps> + <neqdsk> 0 </neqdsk> + <neqdxtpo> 1 </neqdxtpo> + <nideal> 6 </nideal> + <nitmopt> 22 </nitmopt> + <nitmshot> 9999 9999</nitmshot> + <nitmrun> 9998 9991</nitmrun> + <nitmocc>0 0</nitmocc> + <treeitm>ids</treeitm> + <tree_user>sautero</tree_user> + <tree_tokamak>test</tree_tokamak> + <tree_majorversion>3 3</tree_majorversion> + <time_ref>200.</time_ref> + <nidsbound>0</nidsbound> + <nopt> 0 </nopt> + <nplot> 1 </nplot> + <nrbox> 129 </nrbox> + <nrscal> 0 </nrscal> + <nsmooth> 1 </nsmooth> + <ntcase> 0 </ntcase> + <ntmf0> 0 </ntmf0> + <nturn> 20 </nturn> + <nzbox> 129 </nzbox> + + <tensbnd> -0.1 </tensbnd> <!-- -1. is standard smoothing, 0 to avoid problems in loops, -10 if boundary hectic or experimental --> + <tensprof> -0.1 </tensprof> <!-- 0 for no smoothing of input profiles, -1 or -10 for stronger and stronger smoothing --> + + <nprof2d> 1 </nprof2d> <!-- 1: compute simple profiles_2d(2), 2: complete, 11: as 1 and _2d(3) on rhotor_norm mesh, 12: complete _2d(3) --> + <n0jedge> 1 </n0jedge> +</parameters> diff --git a/input/scenario.yaml b/input/scenario.yaml index 01e6139826289dd0187d845cebb67a4730e5f270..78698f6a9fb6cbbbafc7877de81892f28fe36d03 120000 --- a/input/scenario.yaml +++ b/input/scenario.yaml @@ -1 +1 @@ -scenario_all.yaml \ No newline at end of file +scenario_iter.yaml \ No newline at end of file diff --git a/input/scenario_all.yaml b/input/scenario_all.yaml index 75fbbb945c4aad3a3cc7c75d5e12d263831ea0bf..89ede1c684232beec5e0b1dc3c97a55454bdddda 100644 --- a/input/scenario_all.yaml +++ b/input/scenario_all.yaml @@ -1,17 +1,25 @@ # --------------------------------- # PARAMETERS OF THE INPUT SCENARIO # --------------------------------- -shot: 100015 -run_in: 1 +#shot: 53301 +#run_in: 103 +#input_user_or_path: depiccc +#input_database: ernesto_data +#scenario_backend: mdsplus +shot: 134173 +run_in: 106 input_user_or_path: public input_database: ITER +scenario_backend: mdsplus # ----------------------------------- # PARAMETERS TO SAVE THE OUTPUT DATA # ----------------------------------- output_user_or_path: default -output_database: ITER -run_out: 9998 +output_database: CHEASE +run_out: 9999 +output_backend: mdsplus +output_tmp_folder: default # ----------------------------------- # PARAMETERS FOR OPTIONAL TIME LOOP @@ -21,11 +29,17 @@ run_out: 9998 # - if <0: use IDS first time slice (with ntimes specified by the user) # - if =0: use IDS whole time vector (ntimes not used) # - if >0: use the specified time slice (with ntimes specified by the user) -time_slice: 0. +time_slice: 200. # Number of time steps to simulate # (effective only when time_slice is not equal to zero) -ntimes: 10 +ntimes: 1 # Time step in case a generic time array is defined dt_required: 0.2 + +# Debug option +debug: 0 + +# Sandbox manual settings +sandbox_manual: 1 diff --git a/input/scenario_gateway.yaml b/input/scenario_gateway.yaml new file mode 100644 index 0000000000000000000000000000000000000000..f9f4be347d8507db5846a78fac6b1a2d03d2ce28 --- /dev/null +++ b/input/scenario_gateway.yaml @@ -0,0 +1,50 @@ +# --------------------------------- +# PARAMETERS OF THE INPUT SCENARIO +# --------------------------------- +#shot: 64770 +#run_in: 1 +#input_user_or_path: g2osaute +#input_database: tcv +#shot: 100015 +#run_in: 1 +#input_user_or_path: public +#input_database: ITER +#scenario_backend: mdsplus +shot: 87341 +run_in: 1 +input_user_or_path: g2aho +input_database: jet_lsv_v2 +scenario_backend: hdf5 + + +# ----------------------------------- +# PARAMETERS TO SAVE THE OUTPUT DATA +# ----------------------------------- +output_user_or_path: default +output_database: CHEASE +run_out: 9994 +output_backend: mdsplus +output_tmp_folder: default + +# ----------------------------------- +# PARAMETERS FOR OPTIONAL TIME LOOP +# ----------------------------------- + +# Time slice to simulate +# - if <0: use IDS first time slice (with ntimes specified by the user) +# - if =0: use IDS whole time vector (ntimes not used) +# - if >0: use the specified time slice (with ntimes specified by the user) +time_slice: 51.7 + +# Number of time steps to simulate +# (effective only when time_slice is not equal to zero) +ntimes: 1 + +# Time step in case a generic time array is defined +dt_required: 0.2 + +# Debug option +debug: 0 + +# Sandbox manual settings +sandbox_manual: 1 diff --git a/input/scenario_iter.yaml b/input/scenario_iter.yaml new file mode 100644 index 0000000000000000000000000000000000000000..bdfedd56b7bb4e75f5c4b5aff532df8107447c29 --- /dev/null +++ b/input/scenario_iter.yaml @@ -0,0 +1,40 @@ +# --------------------------------- +# PARAMETERS OF THE INPUT SCENARIO +# --------------------------------- +shot: 134173 +run_in: 106 +input_user_or_path: public +input_database: ITER +scenario_backend: mdsplus + +# ----------------------------------- +# PARAMETERS TO SAVE THE OUTPUT DATA +# ----------------------------------- +output_user_or_path: default +output_database: CHEASE +run_out: 9999 +output_backend: mdsplus +output_tmp_folder: default + +# ----------------------------------- +# PARAMETERS FOR OPTIONAL TIME LOOP +# ----------------------------------- + +# Time slice to simulate +# - if <0: use IDS first time slice (with ntimes specified by the user) +# - if =0: use IDS whole time vector (ntimes not used) +# - if >0: use the specified time slice (with ntimes specified by the user) +time_slice: 200. + +# Number of time steps to simulate +# (effective only when time_slice is not equal to zero) +ntimes: 1 + +# Time step in case a generic time array is defined +dt_required: 0.2 + +# Debug option +debug: 0 + +# Sandbox manual settings +sandbox_manual: 1 diff --git a/iwrap/chease_choices.yaml b/iwrap/chease_choices.yaml new file mode 100644 index 0000000000000000000000000000000000000000..bbc008ad307b24dc33a9f0205581f9f9afc3056a --- /dev/null +++ b/iwrap/chease_choices.yaml @@ -0,0 +1,37 @@ +--- +actor_description: + actor_name: chease + actor_type: python + data_type: legacy +code_description: + arguments: + - intent: IN + name: equilibrium_in + type: equilibrium + - intent: OUT + name: equilibrium_out + type: equilibrium + documentation: '' + implementation: + code_parameters: + parameters: ../input/chease_input_choices.xml + schema: ../src-f90/chease_schema_choices.xsd + code_path: ../src-f90/libchease_module_imas.a + data_dictionary_compliant: 3.38.1 + data_type: legacy + include_path: ../src-f90/chease_module.mod + programming_language: fortran + root_dir: . + subroutines: + finalize: '' + init: '' + main: chease + settings: + compiler_cmd: $FC + extra_libraries: + path_defined: [] + pkg_config_defined: + - xmllib + mpi_compiler_cmd: '' + open_mp_switch: '' +... diff --git a/iwrap/chease_gfortran.yaml b/iwrap/chease_gfortran.yaml new file mode 100644 index 0000000000000000000000000000000000000000..48e796ba116d3b246f2ea74960824910a322733b --- /dev/null +++ b/iwrap/chease_gfortran.yaml @@ -0,0 +1,37 @@ +--- +actor_description: + actor_name: chease + actor_type: python + data_type: legacy +code_description: + arguments: + - intent: IN + name: equilibrium_in + type: equilibrium + - intent: OUT + name: equilibrium_out + type: equilibrium + documentation: '' + implementation: + code_parameters: + parameters: ../input/chease_input_choices.xml + schema: ../src-f90/chease_schema_choices.xsd + code_path: ../src-f90/libchease_module_imas.a + data_dictionary_compliant: 3.38.1 + data_type: legacy + include_path: ../src-f90/chease_module.mod + programming_language: fortran + root_dir: . + subroutines: + finalize: '' + init: '' + main: chease + settings: + compiler_cmd: gfortran + extra_libraries: + path_defined: [] + pkg_config_defined: + - xmllib + mpi_compiler_cmd: '' + open_mp_switch: '' +... diff --git a/iwrap/chease.yaml b/iwrap/chease_ifort.yaml similarity index 95% rename from iwrap/chease.yaml rename to iwrap/chease_ifort.yaml index 77c0f679be09dd70f5088e5171598bff43936234..230feb9cd2287e6d7ac2946b7bc395253f68809a 100644 --- a/iwrap/chease.yaml +++ b/iwrap/chease_ifort.yaml @@ -17,6 +17,7 @@ code_description: parameters: ../input/chease_input_choices.xml schema: ../src-f90/chease_schema_choices.xsd code_path: ../src-f90/libchease_module_imas.a + data_dictionary_compliant: 3.38.1 data_type: legacy include_path: ../src-f90/chease_module.mod programming_language: fortran diff --git a/iwrap/chease_reflist.yaml b/iwrap/chease_reflist.yaml new file mode 100644 index 0000000000000000000000000000000000000000..383ffc2aa7a3e7a46b16ccb127a29bdd2b68bb8c --- /dev/null +++ b/iwrap/chease_reflist.yaml @@ -0,0 +1,37 @@ +--- +actor_description: + actor_name: chease + actor_type: python + data_type: legacy +code_description: + arguments: + - intent: IN + name: equilibrium_in + type: equilibrium + - intent: OUT + name: equilibrium_out + type: equilibrium + documentation: '' + implementation: + code_parameters: + parameters: ../input/chease_input_reflist.xml + schema: ../src-f90/chease_schema_reflist.xsd + code_path: ../src-f90/libchease_module_imas.a + data_dictionary_compliant: 3.40.0 + data_type: legacy + include_path: ../src-f90/chease_module.mod + programming_language: fortran + root_dir: . + subroutines: + finalize: '' + init: '' + main: chease + settings: + compiler_cmd: $FC + extra_libraries: + path_defined: [] + pkg_config_defined: + - xmllib + mpi_compiler_cmd: '' + open_mp_switch: '' +... diff --git a/license/CLA_individual_CHEASE.md b/license/CLA_individual_CHEASE.md new file mode 100644 index 0000000000000000000000000000000000000000..1e4f2d13554a011fdeddaf0a27f5e05c30006cd9 --- /dev/null +++ b/license/CLA_individual_CHEASE.md @@ -0,0 +1,103 @@ + EPFL / SPC / Lausanne / CH + Individual Contributor License Agreement ("Agreement") V2.2 + http://www.apache.org/licenses/ + +Thank you for your interest in CHEASE software from EPFL/SPC (Lab). +In order to clarify the intellectual property license +granted with Contributions from any person or entity, here is +the Contributor License Agreement ("CLA") that has +been agreed by each Contributor when signing the CHEASE agreement, +indicating agreement to the license terms below. +This license is for your protection as a Contributor as +well as the protection of the Lab and its users; it does not +change your rights to use your own Contributions for any other purpose. +If you have not already done so, please complete and sign, then scan +and email a pdf file of the CHEASE Agreement to olivier.sauter@epfl.ch + +Please read this document carefully before signing the CHEASE agreement + +You accept and agree to the following terms and conditions for Your past, +present and future Contributions submitted to the Lab. In +return, the Lab shall not use Your Contributions in a way that +is contrary to the public benefit or inconsistent with its nonprofit +status and bylaws in effect at the time of the Contribution. Except +for the license granted herein to the Lab and recipients of +software distributed by the Lab, You reserve all right, title, +and interest in and to Your Contributions. + +1. Definitions. + + "You" (or "Your") shall mean the copyright owner or legal entity + authorized by the copyright owner that is making this Agreement + with the Lab. For legal entities, the entity making a + Contribution and all other entities that control, are controlled + by, or are under common control with that entity are considered to + be a single Contributor. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "Contribution" shall mean any original work of authorship, + including any modifications or additions to an existing work, that + is intentionally submitted by You to the Lab for inclusion + in, or documentation of, any of the products owned or managed by + the Lab (the "Work"). For the purposes of this definition, + "submitted" means any form of electronic, verbal, or written + communication sent to the Lab or its representatives, + including but not limited to communication on electronic mailing + lists, source code control systems, and issue tracking systems that + are managed by, or on behalf of, the Lab for the purpose of + discussing and improving the Work, but excluding communication that + is conspicuously marked or otherwise designated in writing by You + as "Not a Contribution." + +2. Grant of Copyright License. Subject to the terms and conditions of + this Agreement, You hereby grant to the Lab and to + recipients of software distributed by the Lab a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare derivative works of, + publicly display, publicly perform, sublicense, and distribute Your + Contributions and such derivative works. + +3. Grant of Patent License. Subject to the terms and conditions of + this Agreement, You hereby grant to the Lab and to + recipients of software distributed by the Lab a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have + made, use, offer to sell, sell, import, and otherwise transfer the + Work, where such license applies only to those patent claims + licensable by You that are necessarily infringed by Your + Contribution(s) alone or by combination of Your Contribution(s) + with the Work to which such Contribution(s) was submitted. If any + entity institutes patent litigation against You or any other entity + (including a cross-claim or counterclaim in a lawsuit) alleging + that your Contribution, or the Work to which you have contributed, + constitutes direct or contributory patent infringement, then any + patent licenses granted to that entity under this Agreement for + that Contribution or Work shall terminate as of the date such + litigation is filed. + +4. You represent that you are legally entitled to grant the above + license. You represent that each of Your Contributions is Your original + creation (see section 5 for submissions on behalf of others). + You are not expected to provide support for Your Contributions, + except to the extent You desire to provide support. You may provide + support for free, for a fee, or not at all. Unless required by + applicable law or agreed to in writing, You provide Your + Contributions on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS + OF ANY KIND, either express or implied, including, without + limitation, any warranties or conditions of TITLE, NON- + INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. + +5. Should You wish to submit work that is not Your original creation, + You may submit it to the Lab separately from any + Contribution, identifying the complete details of its source and of + any license or other restriction (including, but not limited to, + related patents, trademarks, and license agreements) of which you + are personally aware, and conspicuously marking the work as + "Submitted on behalf of a third-party: [named here]". + +6. You agree to notify the Lab of any facts or circumstances of + which you become aware that would make these representations + inaccurate in any respect. diff --git a/license/CLA_organization_CHEASE.md b/license/CLA_organization_CHEASE.md new file mode 100644 index 0000000000000000000000000000000000000000..80b017c95605a39031d7d8c7335f71c4c2b00928 --- /dev/null +++ b/license/CLA_organization_CHEASE.md @@ -0,0 +1,124 @@ + EPFL / SPC / Lausanne / CH + Software Grant and Organization Contributor License Agreement ("Agreement") V2.2 + http://www.apache.org/licenses/ + + Thank you for your interest in CHEASE software from EPFL/SPC (Lab). + In order to clarify the intellectual property license + granted with Contributions from any person or entity, here is + the Contributor License Agreement ("CLA") that has + been agreed by each Contributor when signing the CHEASE agreement, + indicating agreement to the license terms below. + This license is for your protection as a Contributor as + well as the protection of the Lab and its users; it does not + change your rights to use your own Contributions for any other purpose. + If you have not already done so, please complete and sign, then scan + and email a pdf file of the CHEASE Agreement to olivier.sauter@epfl.ch + + This version of the Agreement allows an entity (the "Organization") to + submit Contributions to the Lab, to authorize Contributions + submitted by its designated employees to the Lab, and to grant + copyright and patent licenses thereto. + + Please read this document carefully before signing the CHEASE agreement + + You accept and agree to the following terms and conditions for Your past, + present and future Contributions submitted to the Lab. In + return, the Lab shall not use Your Contributions in a way that + is contrary to the public benefit or inconsistent with its nonprofit + status and bylaws in effect at the time of the Contribution. Except + for the license granted herein to the Lab and recipients of + software distributed by the Lab, You reserve all right, title, + and interest in and to Your Contributions. + + 1. Definitions. + + "You" (or "Your") shall mean the copyright owner or legal entity + authorized by the copyright owner that is making this Agreement + with the Lab. For legal entities, the entity making a + Contribution and all other entities that control, are controlled by, + or are under common control with that entity are considered to be a + single Contributor. For the purposes of this definition, "control" + means (i) the power, direct or indirect, to cause the direction or + management of such entity, whether by contract or otherwise, or + (ii) ownership of fifty percent (50%) or more of the outstanding + shares, or (iii) beneficial ownership of such entity. + + "Contribution" shall mean the code, documentation or other original + works of authorship expressly identified in Schedule B, as well as + any original work of authorship, including + any modifications or additions to an existing work, that is intentionally + submitted by You to the Lab for inclusion in, or + documentation of, any of the products owned or managed by the + Lab (the "Work"). For the purposes of this definition, + "submitted" means any form of electronic, verbal, or written + communication sent to the Lab or its representatives, + including but not limited to communication on electronic mailing + lists, source code control systems, and issue tracking systems + that are managed by, or on behalf of, the Lab for the + purpose of discussing and improving the Work, but excluding + communication that is conspicuously marked or otherwise designated + in writing by You as "Not a Contribution." + + 2. Grant of Copyright License. Subject to the terms and conditions + of this Agreement, You hereby grant to the Lab and to + recipients of software distributed by the Lab a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare derivative works of, + publicly display, publicly perform, sublicense, and distribute + Your Contributions and such derivative works. + + 3. Grant of Patent License. Subject to the terms and conditions of + this Agreement, You hereby grant to the Lab and to recipients + of software distributed by the Lab a perpetual, worldwide, + non-exclusive, no-charge, royalty-free, irrevocable (except as + stated in this section) patent license to make, have made, use, + offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by You that are necessarily infringed by Your Contribution(s) + alone or by combination of Your Contribution(s) with the Work to + which such Contribution(s) were submitted. If any entity institutes + patent litigation against You or any other entity (including a + cross-claim or counterclaim in a lawsuit) alleging that your + Contribution, or the Work to which you have contributed, constitutes + direct or contributory patent infringement, then any patent licenses + granted to that entity under this Agreement for that Contribution or + Work shall terminate as of the date such litigation is filed. + + 4. You represent that you are legally entitled to grant the above + license. You represent that each of Your Contributions is Your original + creation (see section 5 for submissions on behalf of others). + You are not expected to provide support for Your Contributions, + except to the extent You desire to provide support. You may provide + support for free, for a fee, or not at all. Unless required by + applicable law or agreed to in writing, You provide Your + Contributions on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS + OF ANY KIND, either express or implied, including, without + limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, + MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. + + 5. Should You wish to submit work that is not Your original creation, + You may submit it to the Lab separately from any + Contribution, identifying the complete details of its source and + of any license or other restriction (including, but not limited + to, related patents, trademarks, and license agreements) of which + you are personally aware, and conspicuously marking the work as + "Submitted on behalf of a third-party: [named here]". + + 6. You agree to notify the Lab when any change + is required to the list of designated employees authorized to submit + Contributions on behalf of the Organization, or to the Organization's + Point of Contact with the Lab. + + +Schedule A + + [Initial list of designated employees. NB: authorization is not + tied to particular Contributions.] + + + + +Schedule B + + [Identification of optional concurrent software grant. Would be + left blank or omitted if there is no concurrent software grant.] diff --git a/license/Code_transfer_CHEASE_generic_with_partners_CLA.md b/license/Code_transfer_CHEASE_generic_with_partners_CLA.md new file mode 100644 index 0000000000000000000000000000000000000000..41ea958debca0c22fc71ff39544a0a9668577a6d --- /dev/null +++ b/license/Code_transfer_CHEASE_generic_with_partners_CLA.md @@ -0,0 +1,58 @@ +Authorisation to use and apply: + +**CHEASE** + +at the _______________________________________________ (insert association name) + +___ + +The CHEASE code is developed at the Swiss Plasma Center, Ecole Polytechnique +Fédérale de Lausanne (SPC/EPFL), Switzerland. CHEASE is an accurate fixed +boundary equilibrium solver, flexible and designed to produce interface with many +different codes. + +The undersigned has received a copy of CHEASE, including its source code, under +the additional conditions that: + +1. The code does not change its name even if modified. + +2. The undersigned agrees with the contributor license agreement (CLA), see + [CLA_individual_CHEASE.md](CLA_individual_CHEASE.md)/[CLA_organization_CHEASE.md](CLA_organization_CHEASE.md) (v2.2) for details, + also in the git repository license subfolder. Modifications of the codes + that are developed and made available to the SPC are granting the right to + EPFL to make these modifications available on an “as is” basis to all other + holders of an agreed usage of CHEASE. + +3. Results produced with the original or the modified versions of CHEASE should + appropriately reference the original publications: + + - [H. Lütjens, A. Bondeson, O. Sauter, Comput. Phys. Commun. 97 (1996) 219](https://crppwww.epfl.ch/~sauter/CHEASE/Lutjens_CHEASE_CPC96_OS.pdf) + +4. CHEASE can be used by the partners of the above association on the + association related clusters under the above conditions. The partners can + obtain the sources to be installed at their home institutes by just signing + the code transfer document ([printable pdf version](https://crppwww.epfl.ch/~sauter/CHEASE/Code_transfer_CHEASE_generic_with_partners_CLA.pdf)). + + + +5. CHEASE nor their progeny may be transferred or made available to other + research groups without the written authorisation from the SPC. + +Responsible person + +- Name: __________________________________ + +- email: __________________________________ + +- Place and Date: __________________________________ + +- Signature: __________________________________ + + +___ + +SPC-EPFL<br/> +Station 13<br/> +1015 Lausanne (Switzerland) + +http://spc.epfl.ch/CHEASE diff --git a/matlab/CHEASEgui/CHEASEgui.fig b/matlab/CHEASEgui/CHEASEgui.fig index add6d3ca4489a7b49c4cd706418574654020327b..154025649e20fa296c1077ff1c2bb18451ba0ccd 100644 Binary files a/matlab/CHEASEgui/CHEASEgui.fig and b/matlab/CHEASEgui/CHEASEgui.fig differ diff --git a/matlab/CHEASEgui/CHEASEgui.m b/matlab/CHEASEgui/CHEASEgui.m index 7a98e2e9bef0b7a73b5676ba194add9723291f82..2508b763912cb63424e717d977723fc3433fbdf6 100644 --- a/matlab/CHEASEgui/CHEASEgui.m +++ b/matlab/CHEASEgui/CHEASEgui.m @@ -22,7 +22,7 @@ function varargout = CHEASEgui(varargin) % Edit the above text to modify the response to help CHEASEgui -% Last Modified by GUIDE v2.5 09-Dec-2021 11:49:27 +% Last Modified by GUIDE v2.5 11-Jun-2023 08:01:18 % Begin initialization code - DO NOT EDIT gui_Singleton = 1; @@ -88,6 +88,9 @@ set(handles.which_curr_prof,'string',func_options) set(handles.set_COCOS_IN,'string','11') set(handles.set_COCOS_OUT,'string','11') +% Adapt TooltipStrings +set(handles.set_BAL_JEDGE,'TooltipString',sprintf(get(handles.set_BAL_JEDGE,'TooltipString'))); + % Update handles structure guidata(hObject, handles); @@ -472,6 +475,9 @@ switch(value) case 5 handles.CurrProf.nsttp=5; % Q chosen, nsttp=5 ylabel('Q'); + set(handles.set_NINSCA,'String',num2str(max(100,str2num(get(handles.set_NINSCA,'string'))))) + set(handles.set_NINMAP,'String',num2str(max(100,str2num(get(handles.set_NINMAP,'string'))))) + set(handles.set_relax, 'String',num2str(max(0.6,str2num(get(handles.set_relax,'string'))))) end guidata (hObject, handles); @@ -1116,6 +1122,9 @@ handles.datanamelist.qspec=str2num(get(handles.set_q, 'String')); handles.datanamelist.cpress=str2num(get(handles.set_CPRESS,'String')); handles.datanamelist.n0jedge=str2num(get(handles.set_N0JEDGE,'String')); handles.datanamelist.nideal=str2num(get(handles.set_NIDEAL,'String')); +handles.datanamelist.ninblopt=str2num(get(handles.set_NINBLOPT,'String')); +handles.datanamelist.ninsca=str2num(get(handles.set_NINSCA,'String')); +handles.datanamelist.ninmap=str2num(get(handles.set_NINMAP,'String')); handles.datanamelist.ner=str2num(get(handles.set_NER,'String')); handles.datanamelist.negp=str2num(get(handles.set_NEGP,'String')); handles.datanamelist.nverbose=str2num(get(handles.set_NVERBOSE, 'String')); @@ -1124,6 +1133,7 @@ npropt_list = get(handles.set_npropt,'string'); ival=get(handles.set_npropt,'Value'); handles.datanamelist.npropt=str2num(npropt_list{ival}); handles.datanamelist.pedge=str2num(get(handles.set_pedge, 'String')); +handles.datanamelist.pprime_bal_max=str2num(get(handles.set_PPRIME_BAL_MAX, 'String')); if handles.PressProf.Pprofile==1 || handles.PressProf.nppfun~=4 handles.datanamelist.nppfun=handles.PressProf.nppfun; elseif handles.PressProf.nppfun==4 && handles.PressProf.Pprofile==2 @@ -1214,12 +1224,17 @@ disp('in RunTest_Callback') % RUN CHEASE [fname_out,outglobalsvalues]=run_chease_expeq(handles.fname_namelist_CHEASE,handles.fname_expeq) -if iscell(fname_out) +if iscell(fname_out) && ~isempty(fname_out) fpath_out = fileparts(fname_out{1}); else warning('problems running chease') - unix(['tail -40 ' fname_out]); - fpath_out = fileparts(fname_out); + if ~isempty(fname_out) + unix(['tail -20 ' fname_out]); + fpath_out = fileparts(fname_out); + else + fpath_out = []; + end + return end handles.fname_output_chease=fullfile(fpath_out,['o.chease.' handles.runname_expeq]); @@ -1227,7 +1242,7 @@ handles.fname_output_chease_cols=fullfile(fpath_out,['o.chease.' handles.runname handles.fname_expeq_out=fullfile(fpath_out,['EXPEQ.OUT_' handles.runname_expeq]); % eqdsk has cocos in the name, thus search for full eqdsk out -aaa=regexpi(fname_out,'eqdsk.*[0-9].out'); % not taking the "_POS" +aaa=regexpi(fname_out,'eqdsk.*[0-9].out'); % not taking the '_POS' (positive Ip/B0) for i=1:length(aaa) if aaa{i}>0 handles.fname_eqdsk_out = fname_out{i}; @@ -1250,7 +1265,7 @@ if isempty(outglobalsvalues) for i=1:length(aaa) if ~isempty(aaa{i}); ij=i; end end - if ~isempty(ij); unix(['tail -40 ' fname_out{ij}(1:end-5)]); end + if ~isempty(ij); unix(['tail -20 ' fname_out{ij}(1:end-5)]); end return end @@ -1314,6 +1329,54 @@ fprintf('\nhmode_distance.Smax_0curv_top_half = %f\nhmode_distance.Smax_0curv_bo guidata (hObject,handles); %cd(handles.olddir); %uncomment this if you want to go back to work directory after this operation +% -------------------------------------------------------------------- +function run_nblopt_Callback(hObject, eventdata, handles) +% hObject handle to run_nblopt (see GCBO) +% eventdata reserved - to be defined in a future version of MATLAB +% handles structure with handles and user data (see GUIDATA) + +% First run CHEASE with npropt=2 +set(handles.set_npropt,'Value',2); +prepare_input_Callback(hObject, eventdata, handles); +handles = guidata (hObject); +RunTest_Callback(hObject, eventdata, handles); +handles = guidata (hObject); +expeq_out_filename = handles.fname_out{contains(handles.fname_out,'EXPEQ.OUT_')}; +disp(['Reference EXPEQ with nropt=2: ' expeq_out_filename]); +expeq = read_expeq(expeq_out_filename); +% Put the original designed boundary back +expeq.RZ_psi = handles.EXPEQdata.RZ_psi; +expeq.n_psi = size(expeq.RZ_psi,1); +if ~any(expeq.nsttp==[2 3 4]) || expeq.nppfun ~= 4 + if ~any(expeq.nsttp==[2 3 4]) + disp(['Should run CHEASE first with npropt = 2(preferred), 3 or 4']) + end + if expeq.nppfun ~= 4 + disp(['Should run CHEASE first with npropt positive to have pprime as input function']) + end + return +end +add_jedge = str2num(get(handles.set_BAL_JEDGE,'String')); +ninblopt = str2num(get(handles.set_NINBLOPT,'String')); +pprime_bal_max = str2num(get(handles.set_PPRIME_BAL_MAX,'String')); + +[fname_out_nblopt,globalsvalues_nblopt,namelist_struct_nblopt,expeqout_nblopt,ocols_nblopt,jout_nblopt] = ... + run_nblopt(expeq_out_filename,0,add_jedge,[handles.runname_expeq '_nblopt'],ninblopt,pprime_bal_max); +%fname_out_nblopt +jout_nblopt +ocols_nblopt +expeqout_nblopt +if ~isfield(handles,'nblopt') + j_nblopt = 1; +else + j_nblopt = numel(handles.nblopt) + 1; +end +to_copy = {'fname_out_nblopt','globalsvalues_nblopt','namelist_struct_nblopt','expeqout_nblopt','ocols_nblopt','jout_nblopt'}; +for i=1:numel(to_copy) + handles.nblopt{j_nblopt}.(to_copy{i}) = eval(to_copy{i}); +end +guidata (hObject,handles); + % -------------------------------------------------------------------- function run_caxe_kinx_Callback(hObject, eventdata, handles) % hObject handle to run_caxe_kinx (see GCBO) @@ -1553,7 +1616,6 @@ else disp(['case not known in read eqdsk from hObject = ' num2str(hObject)]) return end - handles.EXPEQdata=read_expeq(handles.fname_expeq,hObject==handles.read_EXPEQ); % set rhotype @@ -1605,11 +1667,33 @@ set(handles.plot_current_points, 'Enable', 'on'); %reading and setting new nsttp handles.CurrProf.nsttp=handles.EXPEQdata.nsttp; %set nsttp equal to the nsttp of the EXPEQ loaded set(handles.which_curr_prof, 'Value', handles.CurrProf.nsttp);%set the popup menu accordingly +if handles.CurrProf.nsttp == 5 + set(handles.set_NINSCA,'String',num2str(max(100,str2num(get(handles.set_NINSCA,'string'))))) + set(handles.set_NINMAP,'String',num2str(max(100,str2num(get(handles.set_NINMAP,'string'))))) + set(handles.set_relax, 'String',num2str(max(0.6,str2num(get(handles.set_relax,'string'))))) +end + +% check if R0 given in extralines notes +R0EXP = str2num(get(handles.set_R0exp, 'String')); +r0exp_from_file = 0; +if isfield(handles.EXPEQdata,'extralines') && ~isempty(handles.EXPEQdata.extralines) + for ij=1:length(handles.EXPEQdata.extralines) + if ~isempty(strfind(upper(handles.EXPEQdata.extralines{ij}),'R0 [M]')) + R0EXP=sscanf(handles.EXPEQdata.extralines{ij},'%f',1); + set(handles.set_R0exp, 'String', num2str(R0EXP)); + r0exp_from_file = 1; + end + end +end %calculate boundaries parameters % save boundary data from EXPEQ to PlasmaBndry structure tensbnd=str2num(get(handles.set_tensbnd, 'String')); -PlasmaBndry = makePlasmaBndry_from_exp(handles.EXPEQdata.RZ_psi,[],tensbnd); +if r0exp_from_file + PlasmaBndry = makePlasmaBndry_from_exp(handles.EXPEQdata.RZ_psi*R0EXP,R0EXP,tensbnd); +else + PlasmaBndry = makePlasmaBndry_from_exp(handles.EXPEQdata.RZ_psi*R0EXP,[],tensbnd); +end handles.PlasmaBndry = PlasmaBndry; % set edit boxes : Note keep values as is for those not included in EXPEQ (like R0EXP) @@ -1621,55 +1705,54 @@ set(handles.set_delta, 'String', num2str(PlasmaBndry.delta)); set(handles.set_tensbnd, 'String', num2str(PlasmaBndry.tensbnd)); set(handles.set_pedge, 'String', num2str(handles.EXPEQdata.pedge)); -% check if R0, B0, Ip given in extralines notes -R0EXP = str2num(get(handles.set_R0exp, 'String')); +% check if B0, Ip, etc given in extralines notes B0EXP = str2num(get(handles.set_B0exp, 'String')); if isfield(handles.EXPEQdata,'extralines') && ~isempty(handles.EXPEQdata.extralines) for ij=1:length(handles.EXPEQdata.extralines) - if ~isempty(strfind(handles.EXPEQdata.extralines{ij},'R0 [M]')) - R0EXP=sscanf(handles.EXPEQdata.extralines{ij},'%f',1); - set(handles.set_R0exp, 'String', num2str(R0EXP)); - end - if ~isempty(strfind(handles.EXPEQdata.extralines{ij},'B0 [T]')) + if ~isempty(strfind(upper(handles.EXPEQdata.extralines{ij}),'B0 [T]')) B0EXP=sscanf(handles.EXPEQdata.extralines{ij},'%f',1); set(handles.set_B0exp, 'String', num2str(B0EXP)); end - if ~isempty(strfind(handles.EXPEQdata.extralines{ij},'TOTAL CURRENT')) + if ~isempty(strfind(upper(handles.EXPEQdata.extralines{ij}),'TOTAL CURRENT')) Ipchease=sscanf(handles.EXPEQdata.extralines{ij},'%f',1); end - if ~isempty(strfind(handles.EXPEQdata.extralines{ij},'Q_ZERO')) + if ~isempty(strfind(upper(handles.EXPEQdata.extralines{ij}),'Q_ZERO')) Q_ZERO=sscanf(handles.EXPEQdata.extralines{ij},'%f',1); set(handles.q0out, 'String', ['q0: ' num2str(Q_ZERO,'%.2f')]); end - if ~isempty(strfind(handles.EXPEQdata.extralines{ij},'Q_EDGE')) + if ~isempty(strfind(upper(handles.EXPEQdata.extralines{ij}),'Q_EDGE')) Q_EDGE=sscanf(handles.EXPEQdata.extralines{ij},'%f',1); set(handles.qaout, 'String', ['q_a: ' num2str(Q_EDGE,'%.2f')]); end - if ~isempty(strfind(handles.EXPEQdata.extralines{ij},'LI')) + if ~isempty(strfind(upper(handles.EXPEQdata.extralines{ij}),'LI')) LI=sscanf(handles.EXPEQdata.extralines{ij},'%f',1); set(handles.liout, 'String', ['li3: ' num2str(LI,'%.2f')]); end - if ~isempty(strfind(handles.EXPEQdata.extralines{ij},'BETA_EXP')) + if ~isempty(strfind(upper(handles.EXPEQdata.extralines{ij}),'BETA_EXP')) BETA_EXP=sscanf(handles.EXPEQdata.extralines{ij},'%f',1); end - if ~isempty(strfind(handles.EXPEQdata.extralines{ij},'POLOIDAL BETA')) + if ~isempty(strfind(upper(handles.EXPEQdata.extralines{ij}),'POLOIDAL BETA')) betap=sscanf(handles.EXPEQdata.extralines{ij},'%f',1); set(handles.betapout, 'String', ['Vol[m^3]: ' num2str(betap,'%.2f')]); end - if ~isempty(strfind(handles.EXPEQdata.extralines{ij},'VOLUM')) + if ~isempty(strfind(upper(handles.EXPEQdata.extralines{ij}),'VOLUM')) VOLUM=sscanf(handles.EXPEQdata.extralines{ij},'%f',1); set(handles.volout, 'String', ['Vol[m^3]: ' num2str(VOLUM*R0EXP^3,'%.2f')]); end - if ~isempty(strfind(handles.EXPEQdata.extralines{ij},'b/a')) + if ~isempty(strfind(upper(handles.EXPEQdata.extralines{ij}),'b/a')) kappaa=sscanf(handles.EXPEQdata.extralines{ij},'%f',1); set(handles.kappaaout, 'String', ['kappa_a: ' num2str(kappaa,'%.2f')]); end end - if exist('Ipchease') && exist('R0EXP') && exist('B0EXP') && exist('BETA_EXP') - Ipph=Ipchease/(4e-7*pi/R0EXP/B0EXP); - set(handles.Ipout, 'String', ['Ip[MA]: ' num2str(Ipph/1e6,'%.2f')]); - betaN = BETA_EXP*100 / (Ipph/1e6/PlasmaBndry.achease/R0EXP/B0EXP); - set(handles.betaNout, 'String', ['beta_N: ' num2str(betaN,'%.2f')]); + if exist('Ipchease') + if exist('R0EXP') && exist('B0EXP') && exist('BETA_EXP') + + Ipph=Ipchease/(4e-7*pi/R0EXP/B0EXP); + set(handles.Ipout, 'String', ['Ip[MA]: ' num2str(Ipph/1e6,'%.2f')]); + betaN = BETA_EXP*100 / (Ipph/1e6/PlasmaBndry.achease/R0EXP/B0EXP); + set(handles.betaNout, 'String', ['beta_N: ' num2str(betaN,'%.2f')]); + else + end end end PlasmaBndry.R0 = R0EXP; @@ -1836,8 +1919,12 @@ set(handles.plot_pressure_points, 'Enable', 'on'); set(handles.set_x_curr, 'Enable', 'on'); set(handles.set_y_curr, 'Enable', 'on'); set(handles.plot_current_points, 'Enable', 'on'); -%setting new nsttp -handles.CurrProf.nsttp=1; %if EQDSK is used, nsttp =1, TTptime is given +%setting new nsttp (can be only 1 or 5 from eqdsk) +nsttp_now = get(handles.which_curr_prof, 'Value'); +if nsttp_now~=1 && nsttp_now~=5 + nsttp_now = 1; +end +handles.CurrProf.nsttp=nsttp_now; % standard case use TTprime set(handles.which_curr_prof, 'Value', handles.CurrProf.nsttp);%set the popup menu accordingly %calculate boundaries parameters , make sure R0 from eqdsk is used to correctly normalize back/forth @@ -1898,8 +1985,14 @@ plot (eqdskval_cocos2.rhopsi, ypress_chease , '--r', 'LineWidth', 2); grid on; %set edit boxes of current profile and plot current profile set (handles.set_x_curr, 'String', num2str(eqdskval_cocos2.rhopsi')); -ycurr_physic = eqdskval_cocos2.FFprime'; %convert into a column vector. EQDSKgives always PHYSIC values -ycurr_chease = zpsinorm .* ycurr_physic / abs(eqdskval_cocos2.b0); %extracting CHEASEvalues +if handles.CurrProf.nsttp == 1 + ycurr_physic = eqdskval_cocos2.FFprime'; %convert into a column vector. EQDSKgives always PHYSIC values + ycurr_chease = zpsinorm .* ycurr_physic / abs(eqdskval_cocos2.b0); %extracting CHEASEvalues +elseif handles.CurrProf.nsttp == 5 + ycurr_chease = abs(eqdskval_cocos2.q); +else + error(sprintf('Should not get here since nsttp should be set 1 or 5 instead of: %d\n',handles.CurrProf.nsttp)); +end set (handles.set_y_curr, 'String', num2str (ycurr_chease)); handles.CurrProf.y_forinput = ycurr_chease; @@ -1948,10 +2041,15 @@ assignin('base','cheasegui_plasmabndry',Plasma); assignin('base','cheasegui_fname_out',handles.fname_out); assignin('base','cheasegui_globalsvalues',outglobalsvalues); -nuplo_related.hmode_distance = handles.hmode_distance; -nuplo_related.nuplo_data_figs = handles.nuplo; -assignin('base','cheasegui_2D',nuplo_related); - +if isfield(handles,'hmode_distance') + nuplo_related.hmode_distance = handles.hmode_distance; + nuplo_related.nuplo_data_figs = handles.nuplo; + assignin('base','cheasegui_2D',nuplo_related); +end +if isfield(handles,'nblopt') + nblopt_related = handles.nblopt; + assignin('base','cheasegui_nblopt',nblopt_related); +end disp('various variables added to workspace as cheasegui_xxxx; execute: whos cheasegui_*') [aaa]=evalin('base','whos'); for i=1:length(aaa) @@ -3085,6 +3183,7 @@ else R0=r0exp; else R0=Rgeom; + disp(sprintf('Using Rgeom = %f to make plasma boundary from rzchease\n',R0)); end Z0=(Zmax+Zmin)/2;%calculate Z0 a = (Rmax-Rmin)/2; %calculate a @@ -3569,6 +3668,9 @@ set(handles.set_q, 'String',num2str(nl.qspec)); set(handles.set_CPRESS,'String',num2str(nl.cpress)); set(handles.set_N0JEDGE,'String',num2str(nl.n0jedge)); set(handles.set_NIDEAL,'String',num2str(nl.nideal)); +set(handles.set_NINBLOPT,'String',num2str(nl.ninblopt)); +set(handles.set_NINMAP,'String',num2str(nl.ninmap)); +set(handles.set_NINSCA,'String',num2str(nl.ninsca)); set(handles.set_NER,'String',num2str(nl.ner)); set(handles.set_NEGP,'String',num2str(nl.negp)); set(handles.set_NVERBOSE, 'String',num2str(nl.nverbose)); @@ -3586,6 +3688,7 @@ if handles.PressProf.nppfun==8 end set(handles.set_NPPFUN, 'Value',handles.PressProf.nppfun) set(handles.popupmenuPprofile,'value',handles.PressProf.Pprofile) +set(handles.set_PPRIME_BAL_MAX,'String',num2str(nl.pprime_bal_max)); handles.CurrProf.nfunc = nl.nfunc; set(handles.set_nfunc, 'Value',handles.CurrProf.nfunc) @@ -4178,3 +4281,118 @@ function plot_chease_nuplo_localshear_Callback(hObject, eventdata, handles) % hObject handle to plot_chease_nuplo_localshear (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) + + + +function set_NINSCA_Callback(hObject, eventdata, handles) +% hObject handle to set_NINSCA (see GCBO) +% eventdata reserved - to be defined in a future version of MATLAB +% handles structure with handles and user data (see GUIDATA) + +% Hints: get(hObject,'String') returns contents of set_NINSCA as text +% str2double(get(hObject,'String')) returns contents of set_NINSCA as a double + + +% --- Executes during object creation, after setting all properties. +function set_NINSCA_CreateFcn(hObject, eventdata, handles) +% hObject handle to set_NINSCA (see GCBO) +% eventdata reserved - to be defined in a future version of MATLAB +% handles empty - handles not created until after all CreateFcns called + +% Hint: edit controls usually have a white background on Windows. +% See ISPC and COMPUTER. +if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) + set(hObject,'BackgroundColor','white'); +end + + + +function set_NINMAP_Callback(hObject, eventdata, handles) +% hObject handle to set_NINMAP (see GCBO) +% eventdata reserved - to be defined in a future version of MATLAB +% handles structure with handles and user data (see GUIDATA) + +% Hints: get(hObject,'String') returns contents of set_NINMAP as text +% str2double(get(hObject,'String')) returns contents of set_NINMAP as a double + + +% --- Executes during object creation, after setting all properties. +function set_NINMAP_CreateFcn(hObject, eventdata, handles) +% hObject handle to set_NINMAP (see GCBO) +% eventdata reserved - to be defined in a future version of MATLAB +% handles empty - handles not created until after all CreateFcns called + +% Hint: edit controls usually have a white background on Windows. +% See ISPC and COMPUTER. +if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) + set(hObject,'BackgroundColor','white'); +end + + + +function set_PPRIME_BAL_MAX_Callback(hObject, eventdata, handles) +% hObject handle to set_PPRIME_BAL_MAX (see GCBO) +% eventdata reserved - to be defined in a future version of MATLAB +% handles structure with handles and user data (see GUIDATA) + +% Hints: get(hObject,'String') returns contents of set_PPRIME_BAL_MAX as text +% str2double(get(hObject,'String')) returns contents of set_PPRIME_BAL_MAX as a double + + +% --- Executes during object creation, after setting all properties. +function set_PPRIME_BAL_MAX_CreateFcn(hObject, eventdata, handles) +% hObject handle to set_PPRIME_BAL_MAX (see GCBO) +% eventdata reserved - to be defined in a future version of MATLAB +% handles empty - handles not created until after all CreateFcns called + +% Hint: edit controls usually have a white background on Windows. +% See ISPC and COMPUTER. +if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) + set(hObject,'BackgroundColor','white'); +end + + + +function set_NINBLOPT_Callback(hObject, eventdata, handles) +% hObject handle to set_NINBLOPT (see GCBO) +% eventdata reserved - to be defined in a future version of MATLAB +% handles structure with handles and user data (see GUIDATA) + +% Hints: get(hObject,'String') returns contents of set_NINBLOPT as text +% str2double(get(hObject,'String')) returns contents of set_NINBLOPT as a double + + +% --- Executes during object creation, after setting all properties. +function set_NINBLOPT_CreateFcn(hObject, eventdata, handles) +% hObject handle to set_NINBLOPT (see GCBO) +% eventdata reserved - to be defined in a future version of MATLAB +% handles empty - handles not created until after all CreateFcns called + +% Hint: edit controls usually have a white background on Windows. +% See ISPC and COMPUTER. +if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) + set(hObject,'BackgroundColor','white'); +end + + + +function set_BAL_JEDGE_Callback(hObject, eventdata, handles) +% hObject handle to set_BAL_JEDGE (see GCBO) +% eventdata reserved - to be defined in a future version of MATLAB +% handles structure with handles and user data (see GUIDATA) + +% Hints: get(hObject,'String') returns contents of set_BAL_JEDGE as text +% str2double(get(hObject,'String')) returns contents of set_BAL_JEDGE as a double + + +% --- Executes during object creation, after setting all properties. +function set_BAL_JEDGE_CreateFcn(hObject, eventdata, handles) +% hObject handle to set_BAL_JEDGE (see GCBO) +% eventdata reserved - to be defined in a future version of MATLAB +% handles empty - handles not created until after all CreateFcns called + +% Hint: edit controls usually have a white background on Windows. +% See ISPC and COMPUTER. +if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) + set(hObject,'BackgroundColor','white'); +end diff --git a/matlab/CHEASEgui/astra2expeq.m b/matlab/CHEASEgui/astra2expeq.m index d72e6006bcb58c53f5183fb545f83c3e992b840f..ae33acceaadb4ddb4e057e478ebe4b55c6f943c3 100644 --- a/matlab/CHEASEgui/astra2expeq.m +++ b/matlab/CHEASEgui/astra2expeq.m @@ -162,7 +162,7 @@ pressure_i= s.NI(1:NA1,itime).*s.TI(1:NA1,itime).*1.6022.* 1000; %[To Pa] pressure = pressure_e + pressure_i; %[MKSA] tcurrent= rtor*btor*s.IPOL(1:NA1,itime); -% fp is poloidal flux as Liuqe but in "radians" T m^2, thus 2pi times larger than CHEASE (cocos 12 to 2) +% fp is poloidal flux as Liuqe but in 'radians' T m^2, thus 2pi times larger than CHEASE (cocos 12 to 2) polpsi=s.FP(1:NA1,itime)./2./pi; % To determine poloidal flux at rho=0. I have to interpolate, since ametr(1)~=0, rho(1)~=0 etc... diff --git a/matlab/CHEASEgui/chease_expeq_default_namelist b/matlab/CHEASEgui/chease_expeq_default_namelist index 9574d13d555ab6378f10ed500916292ecd7983a2..e1c63b72039e2b7fdcb109a8caa0c096820fe90a 100644 --- a/matlab/CHEASEgui/chease_expeq_default_namelist +++ b/matlab/CHEASEgui/chease_expeq_default_namelist @@ -1,14 +1,14 @@ ************************ * DEFAULT NAMELIST * ************************ -*** +*** &EQDATA NPROPT=1, CPRESS=1, NIDEAL=6, NPLOT=1, NTCASE=0, NSMOOTH=1, NS=40, NT=40, NPSI=180, NCHI=180, NISO=180, NTNOVA=12, QSPEC=0.70, CSSPEC=0.0, CFNRESS=1.00, NRSCAL=0, NCSCAL=2, NTMF0=0, -NBAL=0, NBLOPT=0, CFBAL=10.00, +NBAL=0, NBLOPT=0, CFBAL=10.00, NOPT=0, R0EXP=8.79999995E-01, @@ -23,4 +23,5 @@ MSMAX=1, NINMAP=40, NINSCA=40, NSYM=0, NEGP=-1, NER=1, NV=40, NVEXP=1, REXT=10.0, R0W=1., RZ0W=0., NEQDSK=0, NEQDXTPO=1, PSISCL= 1.0, NRBOX=129, NZBOX=129, +TENSBND=-0.1, TENSPROF=-0.1, / diff --git a/matlab/CHEASEgui/cheasedata_mat_to_cols.m b/matlab/CHEASEgui/cheasedata_mat_to_cols.m new file mode 100644 index 0000000000000000000000000000000000000000..efd7fb0f24958fc5ba01710445863e9bff146830 --- /dev/null +++ b/matlab/CHEASEgui/cheasedata_mat_to_cols.m @@ -0,0 +1,13 @@ +chease_data_filename = 'ITER_hybrid_citrin_equil_cheasedata.mat'; + +aa=load(chease_data_filename); + +fid=fopen([chease_data_filename '2cols'],'w'); +fprintf(fid,'%%'); +fprintf(fid,' %s',aa.chease_data.labels{:}); +fprintf(fid,'\n'); +for i=1:size(aa.chease_data.data,1) + fprintf(fid,'%13.5e ',aa.chease_data.data(i,:)'); + fprintf(fid,'\n'); +end +fclose(fid); diff --git a/matlab/CHEASEgui/cocos.m b/matlab/CHEASEgui/cocos.m index 1bbbac91b92263a08a148b65999aadc05c17166e..59b2b91b29ecda7a4329ddd5c495506f82a3bd04 100644 --- a/matlab/CHEASEgui/cocos.m +++ b/matlab/CHEASEgui/cocos.m @@ -14,7 +14,7 @@ function [cocos_struct]=cocos(cocos_in); % Note that the expected sign(dpsi) for Ip and B0 positive is -sign_pprime_pos % derived useful quantities: % cocos_struct.sign_theta_clockwise = sigma_RphiZ*sigma_rhothetaphi: +1 if theta clockwise and -1 if counter-clockwise -% "standard" mathematical polar direction is counter-clockwise thus sign_theta_clockwise=-1 +% 'standard' mathematical polar direction is counter-clockwise thus sign_theta_clockwise=-1 % % Note that table III gives the sign transformations when Ip and B0 are not positive % @@ -75,7 +75,7 @@ switch cocos_in cocos_struct.sign_pprime_pos = +1; % case {4, 14} - % + % cocos_struct.sigma_Bp = -1; cocos_struct.sigma_RphiZ = -1; cocos_struct.sigma_rhothetaphi = -1; @@ -83,7 +83,7 @@ switch cocos_in cocos_struct.sign_pprime_pos = +1; % case {5, 15} - % + % cocos_struct.sigma_Bp = +1; cocos_struct.sigma_RphiZ = +1; cocos_struct.sigma_rhothetaphi = -1; @@ -91,7 +91,7 @@ switch cocos_in cocos_struct.sign_pprime_pos = -1; % case {6, 16} - % + % cocos_struct.sigma_Bp = +1; cocos_struct.sigma_RphiZ = -1; cocos_struct.sigma_rhothetaphi = -1; @@ -107,7 +107,7 @@ switch cocos_in cocos_struct.sign_pprime_pos = +1; % case {8, 18} - % + % cocos_struct.sigma_Bp = -1; cocos_struct.sigma_RphiZ = -1; cocos_struct.sigma_rhothetaphi = +1; diff --git a/matlab/CHEASEgui/customize_options.m b/matlab/CHEASEgui/customize_options.m index fe2f260427c1810133782af664069b1e4ea3c84b..42de48651e6723cbeda91beeec7d17b53eb570d9 100644 --- a/matlab/CHEASEgui/customize_options.m +++ b/matlab/CHEASEgui/customize_options.m @@ -3,7 +3,7 @@ function [customizelist_H] = customize_options(customizelist_in,option) % [customizelist_H] = customize_options(customizelist_in,option) % % customizelist_in: if filename, assume a 3 columns string data with one header line -% 1st line : "% keywords(no space) default_values labels(can have space) +% 1st line : % keywords(no space) default_values labels(can have space) % next lines: keyword data label % % customizelist_in: if structure @@ -12,7 +12,7 @@ function [customizelist_H] = customize_options(customizelist_in,option) % Creates GUI to be able to change the values % % customizelist_H: contains labels and data in output so can be easily called in local environment to make new plots -% is changed in "workspace", "ok/continue" closes the window +% is changed in 'workspace', 'ok/continue' closes the window % % if called from within a GUI, add the folowing lines: % >> [customizelist_H] = customize_options(customizelist_in); @@ -132,4 +132,3 @@ guidata(customizelist_H.main,myhandles); pause(0.1) set(customizelist_H.main,'children',customizelist_H.children); - diff --git a/matlab/CHEASEgui/default_namelist_chease b/matlab/CHEASEgui/default_namelist_chease index 5ed2c923cc9a6f07dc2ab9ad751e7b3543bbe683..9e11e8fbf221046c2cd6198a93f0ba0f2671dcf8 100644 --- a/matlab/CHEASEgui/default_namelist_chease +++ b/matlab/CHEASEgui/default_namelist_chease @@ -1,3 +1,4 @@ + NVERBOSE = 3, RELAX = 0., NDIAGOP = 1, NBSEXPQ=0000, @@ -43,3 +44,5 @@ COCOS_OUT = 2, SIGNB0XP = -9, SIGNIPXP = -9, + NINBLOPT = 25, + PPRIME_BAL_MAX = 5, diff --git a/matlab/CHEASEgui/default_namelist_chease_eqdsk b/matlab/CHEASEgui/default_namelist_chease_eqdsk index f3bfe20d0af1609a24a79adfc7b824e82e555944..c5aae86f61c3aa764b38f73b1a556aa2e96f5959 100644 --- a/matlab/CHEASEgui/default_namelist_chease_eqdsk +++ b/matlab/CHEASEgui/default_namelist_chease_eqdsk @@ -1,3 +1,4 @@ + NVERBOSE = 3, RELAX = 0., NDIAGOP = 1, NBSEXPQ=0000, @@ -43,3 +44,8 @@ COCOS_OUT = 2, SIGNB0XP = -9, SIGNIPXP = -9, + NINBLOPT = 25, + PPRIME_BAL_MAX = 5, + TENSBND=-0.1, + TENSPROF=-0.1, + NFIXWALL=1, diff --git a/matlab/CHEASEgui/default_namelist_chease_expeq b/matlab/CHEASEgui/default_namelist_chease_expeq index 56e7825686d1c2d69c4daccbdfe930444aef17f9..6416093422f8bcfb2697b600690d5c2d727a1022 100644 --- a/matlab/CHEASEgui/default_namelist_chease_expeq +++ b/matlab/CHEASEgui/default_namelist_chease_expeq @@ -1,3 +1,4 @@ + NVERBOSE = 3, RELAX = 0., NDIAGOP = 1, NBSEXPQ=0000, @@ -26,10 +27,10 @@ QWIDTH=0.13,0.04,0.09,0.04,0.07,0.02,0.04,0.01,0.01,0.001, NMESHC=1, NPOIDC=2, SOLPDC=.70,CPLACE=.95,.99,1.0, CWIDTH=.10,.02,.05, DWIDTH=.18,.08,.05, - NMESHD=0, NPOIDD=2, SOLPDD=.60,DPLACE=-1.80,-1.80,4.0, - DWIDTH=.18,.08,.05, - NMESHE=0, NPOIDE=4, SOLPDE=.50,EPLACE=-1.70,-1.70, 1.70, 1.70, - EWIDTH=.18,.08,.18,.08, + NMESHD=1, NPOIDD=4, SOLPDD=.50,DPLACE=-1.87,-1.87,1.92,1.92, + DWIDTH=.18,.04,.18,.08, + NMESHE=1, NPOIDE=4, SOLPDE=.50,EPLACE=-1.87,-1.87, 1.92, 1.92, + EWIDTH=.18,.04,.18,.08, NMESHPOL=1,SOLPDPOL=0.25, EPSLON=1.0E-8, GAMMA=1.6666666667, NTURN=20, NBLC0=16, NPPR=24, @@ -43,3 +44,8 @@ COCOS_OUT = 2, SIGNB0XP = -9, SIGNIPXP = -9, + NINBLOPT = 25, + PPRIME_BAL_MAX = 5, + TENSBND=-0.1, + TENSPROF=-0.1, + NFIXWALL=1, diff --git a/matlab/CHEASEgui/default_namelist_chease_nofiles b/matlab/CHEASEgui/default_namelist_chease_nofiles index c5844d29729d04e8ab73906bc470e2dee1bb8470..7cb4fae283b5a04d9a5b1580303a63250fc787a4 100644 --- a/matlab/CHEASEgui/default_namelist_chease_nofiles +++ b/matlab/CHEASEgui/default_namelist_chease_nofiles @@ -1,3 +1,4 @@ + NVERBOSE = 3, RELAX = 0., NDIAGOP = 1, NBSEXPQ=0000, diff --git a/matlab/CHEASEgui/eqdsk2chease2D.m b/matlab/CHEASEgui/eqdsk2chease2D.m index 9eb4bc4563504febb0e271389c303d3140d6a02c..548facdb4439dccd3d54eac4506ae65bef51bc6a 100644 --- a/matlab/CHEASEgui/eqdsk2chease2D.m +++ b/matlab/CHEASEgui/eqdsk2chease2D.m @@ -1,10 +1,12 @@ -function [hmode_distance,hmode_distance_hedge,nuplo_data,eqdsk_out,fname_out,globalsvalues] = eqdsk2chease2D(eqdsk_in,varargin); +function [hmode_distance,hmode_distance_hedge,nuplo_data,eqdsk_out,fname_out_in,globalsvalues_in, ... + fname_out_hedge,globalsvalues_hedge] = eqdsk2chease2D(eqdsk_in,varargin); % -% [hmode_distance,hmode_distance_hedge,nuplo_data,eqdsk_out,fname_out,globalsvalues] = eqdsk2chease2D(eqdsk_in); +% [hmode_distance,hmode_distance_hedge,nuplo_data,eqdsk_out,fname_out_in,globalsvalues_in, ... +% fname_out_hedge,globalsvalues_hedge] = eqdsk2chease2D(eqdsk_in); % % get eqdsk_in as (array of) eqdsk structure or read from (array of cell) eqdsk_in filenames (using find_cocos(1)) -% run chease from: [fname_out,globalsvalues] = run_chease(2,aa.eqdsk,aa.eqdsk.cocos); -% Get 2D plot from: [hmode_distance,nuplo_data] = nuplo_2d_plots(fname_out{contains(fname_out, 'NUPLO')},[num2str(shot) '@' num2str(time)]); +% run chease from: [fname_out_in,globalsvalues_in] = run_chease(2,aa.eqdsk,aa.eqdsk.cocos); +% Get 2D plot from: [hmode_distance,nuplo_data] = nuplo_2d_plots(fname_out_in{contains(fname_out_in, 'NUPLO')},[num2str(shot) '@' num2str(time)]); % % varargin{1}: shot(s) % varargin{2}: time(s) @@ -38,11 +40,11 @@ for i=1:numel(eqdsk_in) end end - [fname_out{i},globalsvalues(i)] = run_chease(2,eqdsk_out(i),eqdsk_out(i).cocos); - [hmode_distance(i),nuplo_data(i)] = nuplo_2d_plots(fname_out{i}{contains(fname_out{i}, 'NUPLO')},suffix,'35',psi_surface); + [fname_out_in{i},globalsvalues_in(i)] = run_chease(2,eqdsk_out(i),eqdsk_out(i).cocos); + [hmode_distance(i),nuplo_data(i)] = nuplo_2d_plots(fname_out_in{i}{contains(fname_out_in{i}, 'NUPLO')},suffix,'35',psi_surface); - expeq_out0 = regexp(fname_out{i},'EXPEQ.OUT$'); - expeq_out0 = fname_out{i}{find(cellfun(@(x) ~isempty(x), expeq_out0))}; + expeq_out0 = regexp(fname_out_in{i},'EXPEQ.OUT$'); + expeq_out0 = fname_out_in{i}{find(cellfun(@(x) ~isempty(x), expeq_out0))}; exp1 = read_expeq(expeq_out0); amp_pp = 1.1; rhodep_pp = 0.6; @@ -61,9 +63,9 @@ for i=1:numel(eqdsk_in) exp2.Istar=frac_johm.*exp1.Istar+jbsexp; namelist_struct_expeq = namelist_struct_expeq; namelist_struct_expeq.ncscal = 2; - namelist_struct_expeq.currt = globalsvalues.ipchease; - namelist_struct_expeq.r0exp = globalsvalues.r0exp; - namelist_struct_expeq.b0exp = globalsvalues.b0exp; + namelist_struct_expeq.currt = globalsvalues_in.ipchease; + namelist_struct_expeq.r0exp = globalsvalues_in.r0exp; + namelist_struct_expeq.b0exp = globalsvalues_in.b0exp; [fname_out_hedge{i},globalsvalues_hedge(i),namelist_struct_hedge,namelistfile_eff_hedge] = run_chease(namelist_struct_expeq,exp2); [hmode_distance_hedge(i),nuplo_data_hedge(i)] = nuplo_2d_plots(fname_out_hedge{i}{find(contains(fname_out_hedge{i},'NUPLO'))}, ... [suffix '_hedge'],'35',psi_surface); diff --git a/matlab/CHEASEgui/eqdsk2ids.m b/matlab/CHEASEgui/eqdsk2ids.m index 0d0d04b7d69d5e587d5ea21d1eed67935f978b3f..a1b434bb1858f9f76995fea5fa404c4ecf51cfd9 100644 --- a/matlab/CHEASEgui/eqdsk2ids.m +++ b/matlab/CHEASEgui/eqdsk2ids.m @@ -20,7 +20,7 @@ eqdsk = read_eqdsk(eqdsk_fname); if ~exist('cocos_in','var') || isempty(cocos_in) cocos_in = eqdsk.cocos; end - + eqdsk = eqdsk_cocos_transform(eqdsk,[cocos_in, 11]); % profiles_2d @@ -64,7 +64,7 @@ equilibrium.vacuum_toroidal_field.b0 = eqdsk.b0; equilibrium.time = time; equilibrium.ids_properties.homogeneous_time = 1; -equilibrium.ids_properties.source = sprintf('Generated from EQDSK by eqdsk2ids from file "%s" with cocos_in=%2d',eqdsk.fnamefull,cocos_in); +equilibrium.ids_properties.source = sprintf('Generated from EQDSK by eqdsk2ids from file ''%s'' with cocos_in=%2d',eqdsk.fnamefull,cocos_in); equilibrium.ids_properties.comment = sprintf('EQDSK Title: %s',eqdsk.stitle); equilibrium.ids_properties.creation_date = datestr(now,'yyyy-mm-dd HH:MM:SS'); @@ -89,22 +89,22 @@ equilibrium.time_slice{1}.ggd = {}; if nargout > 1 - + wall = ids_gen('wall'); - + wall.description_2d{1}.limiter.type.index = 0; wall.description_2d{1}.limiter.unit{1}.outline.r = eqdsk.rlim; wall.description_2d{1}.limiter.unit{1}.outline.z = eqdsk.zlim; - + wall.ids_properties.homogeneous_time = 0; - wall.ids_properties.source = sprintf('Generated from EQDSK by eqdsk2ids from file "%s" with cocos_in=%2d',eqdsk.fnamefull,cocos_in); + wall.ids_properties.source = sprintf('Generated from EQDSK by eqdsk2ids from file ''%s'' with cocos_in=%2d',eqdsk.fnamefull,cocos_in); wall.ids_properties.comment = sprintf('EQDSK Title: %s',eqdsk.stitle); wall.ids_properties.creation_date = datestr(now,'yyyy-mm-dd HH:MM:SS'); - + wall.description_2d{1}.mobile.unit = {}; wall.description_2d{1}.vessel.unit = {}; wall.description_ggd = {}; end -end \ No newline at end of file +end diff --git a/matlab/CHEASEgui/eqdsk_cocos_transform.m b/matlab/CHEASEgui/eqdsk_cocos_transform.m index 908dae4ed7f9f1535cceefcb4a424ad529957c18..6d5ab1bc7a6b95d766248a524ea9431bb0c87c61 100644 --- a/matlab/CHEASEgui/eqdsk_cocos_transform.m +++ b/matlab/CHEASEgui/eqdsk_cocos_transform.m @@ -106,7 +106,7 @@ sigma_B0pos_eff = sign(eqdsk_input.b0) * (+1); sigma_Bp_eff = cocos_in_struct.sigma_Bp * cocos_out_struct.sigma_Bp; -% Eq. (15) as Ref with "out" being "cocos" and "in" being "chease,2", then re-written in Appendix C +% Eq. (15) as Ref with 'out' being 'cocos' and 'in' being 'chease,2', then re-written in Appendix C exp_Bp_eff = cocos_out_struct.exp_Bp - cocos_in_struct.exp_Bp; sigma_rhothetaphi_eff = cocos_in_struct.sigma_rhothetaphi .* cocos_out_struct.sigma_rhothetaphi; diff --git a/matlab/CHEASEgui/eqdsk_to_fluxtheta_map.m b/matlab/CHEASEgui/eqdsk_to_fluxtheta_map.m index a1623211652788072eae34842a153dce22d8f12b..d4e22ac0543abee876b210f04656790acaedb315 100644 --- a/matlab/CHEASEgui/eqdsk_to_fluxtheta_map.m +++ b/matlab/CHEASEgui/eqdsk_to_fluxtheta_map.m @@ -2,7 +2,7 @@ function [eqdsk_new]=eqdsk_to_fluxtheta_map(fname_or_eqdskstruct,rho_out_type,rh % % [eqdsk_new]=eqdsk_to_fluxtheta_map(fname_or_eqdskstruct,rho_out_type,rho_out_mesh,varargin); % -% Assume eqdsk_structure obtained from read_eqdsk(file,cocos,1); (with the extra "1" option to calculate various quantities like rhotor) +% Assume eqdsk_structure obtained from read_eqdsk(file,cocos,1); (with the extra 1 option to calculate various quantities like rhotor) % % if fname_or_eqdskstruct is empty or not a struct, calls read_eqdsk(fname_or_eqdskstruct,varargin{1},1) which prompts for an eqdsk file if needed % @@ -18,7 +18,7 @@ function [eqdsk_new]=eqdsk_to_fluxtheta_map(fname_or_eqdskstruct,rho_out_type,rh % varargin{1}: COCOS index value required if fname is an eqdsk filename. Assume 2 (as CHEASE/EFIT) if not given % -% +% % Use profiles_2d psi(grid) assuming grid is dim1=R, dim2=Z rectangular mesh % Find flux surfaces inside the LCFS (at this stage but could interpolate outside) % Flux surfaces are chosen from a rhopsi_norm_in mesh or a rhotor_norm_in (here using nflux points) diff --git a/matlab/CHEASEgui/eqdsk_transform.m b/matlab/CHEASEgui/eqdsk_transform.m index 5feaefd7c7d30565e809b488ae784d806798141b..dd593e66e1d029a6d5f5dbff0f54979bc33095b9 100644 --- a/matlab/CHEASEgui/eqdsk_transform.m +++ b/matlab/CHEASEgui/eqdsk_transform.m @@ -26,7 +26,7 @@ if nargin>=5 && ~isempty(varargin{2}); doplot = varargin{2}; end recompute_edge=0; psiedge_newbnd=eqdskval.psiedge; if nargin>=6 && ~isempty(varargin{3}) - psiedge_newbnd = varargin{3}; + psiedge_newbnd = varargin{3}; recompute_edge = 1; end zshift=[]; @@ -65,9 +65,8 @@ if isfield(eqdskval,'extralines') else eqdskval.extralines{1} = ['plasma shifted in z by ' num2str(zaxis_shift)]; end -zmaxbox=max(abs(eqdskval.zmesh(1)),abs(eqdskval.zmesh(end))); -zmeshfit=linspace(-zmaxbox,zmaxbox,NZ)'; -eqdskval.zboxlen = 2.*zmaxbox; +% keep same mesh ends, hence same zboxlen and zmid, but use zmesh(1) and (end) as reference +zmeshfit=linspace(eqdskval.zmesh(1),eqdskval.zmesh(end),NZ)'; ioptos=13; clear psiz_1 dpsidZ_1 d2psidZ2_1 @@ -123,7 +122,7 @@ hold on contour(rmeshfit,zmeshfit,psir_1',120,'--') contour(eqdskval.rmesh,eqdskval.zmesh,eqdskval.psi',[eqdskval.psiedge eqdskval.psiedge],'k','linewidth',3); contour(rmeshfit,zmeshfit,psir_1',[eqdskval.psiedge eqdskval.psiedge],'r--','linewidth',3); -[Cedge Hedge]=contour(rmeshfit,zmeshfit,psir_1',[psiedge_newbnd psiedge_newbnd],'m--','linewidth',3); +[Cedge Hedge]=contour(rmeshfit,zmeshfit,psir_1',[psiedge_newbnd psiedge_newbnd],'m-.','linewidth',3); if ~doplot close(fig_cont) @@ -152,7 +151,7 @@ else if i==iimax Redgenew=Cedge(1,ii(i)+1:ii(i)+iinb(i)); Zedgenew=Cedge(2,ii(i)+1:ii(i)+iinb(i)); - end + end end end if doplot diff --git a/matlab/CHEASEgui/find_cocos.m b/matlab/CHEASEgui/find_cocos.m index ed2c2721a86211069e461b9939a9b55297759646..a6f90d9dfa46a3fb7b0f8a5870e0fe9846a9645f 100644 --- a/matlab/CHEASEgui/find_cocos.m +++ b/matlab/CHEASEgui/find_cocos.m @@ -44,7 +44,7 @@ function [cocos_out,comments,status]=find_cocos(b0,ip,psi_profile,pprime_profile status = -1; cocos_out = []; comments = []; -if nargin==0 || (isnumeric(b0) && nargin < 7) || (~ischar(b0) && ~isstruct(b0) && ~isnumeric(b0)) +if nargin==0 || (isnumeric(b0) && nargin < 7) || (~ischar(b0) && (~isstring(b0) || isstring(b0)&&numel(b0)>1) && ~isstruct(b0) && ~isnumeric(b0)) disp('requires at least 7 inputs:') disp(['[cocos_ok,status,cocos_ok_qabs]=find_cocos(b0,ip,psi_profile,pprime_profile,q_profile,r0,a_minor[,f0[,ffprime0[,' ... ' cocos_to_check]]])']); @@ -54,9 +54,9 @@ if nargin==0 || (isnumeric(b0) && nargin < 7) || (~ischar(b0) && ~isstruct(b0) & end i_eqdsk_input = 0; -if ischar(b0) || isstruct(b0) +if ischar(b0) || isstring(b0) || isstruct(b0) % eqdsk given, fill in inputs - cocos_for_readeqdsk = []; + cocos_for_readeqdsk = 2; % start with a default value so can call find_cocos from read_eqdsk if nargin >=2 && ~isempty(ip) cocos_to_check = ip; cocos_for_readeqdsk = cocos_to_check; @@ -64,7 +64,7 @@ if ischar(b0) || isstruct(b0) if nargin >=3 && ~isempty(psi_profile) sigma_rphiz = psi_profile; end - if ischar(b0) + if ischar(b0) || isstring(b0) eqdsk_filename = b0; try eqdsk = read_eqdsk(eqdsk_filename,cocos_for_readeqdsk,0,[],[],0); diff --git a/matlab/CHEASEgui/geteqdskJET.m b/matlab/CHEASEgui/geteqdskJET.m index 190f1c3969a6adfab8539537333667e7a85eb617..44afb29b3218a73c38882f09f772855eb0ebbb5d 100644 --- a/matlab/CHEASEgui/geteqdskJET.m +++ b/matlab/CHEASEgui/geteqdskJET.m @@ -412,12 +412,12 @@ for it=1:numel(index_efit) plot(psi_efit,F/F(end),'r-') ss=sprintf('%.4f',time_efit); title(['JET #' num2str(shot) ' t= ' ss]) - legend('P/P(0)','F/F(edge)',3) + legend('P/P(0)','F/F(edge)','location','best') subplot(3,1,2) plot(psieq,pressprime/abs(pressprime(1)),'-') hold on plot(psieq,G.*Gprime/abs(G(1).*Gprime(1)),'r-') - legend('Pprime/|Pprime(0)|','F*Fprime/|F*Fprime(0)|',2) + legend('Pprime/|Pprime(0)|','F*Fprime/|F*Fprime(0)|','location','best') subplot(3,1,3) plot(psi_efit,Q,'-') hold on diff --git a/matlab/CHEASEgui/interpos2Dcartesian.m b/matlab/CHEASEgui/interpos2Dcartesian.m index 7eb1d1815569723941c4a2b5c85595fdee808e27..6c7fd8aed2b505701f34f02913767dadaae8e1d1 100644 --- a/matlab/CHEASEgui/interpos2Dcartesian.m +++ b/matlab/CHEASEgui/interpos2Dcartesian.m @@ -12,7 +12,7 @@ function [farray_out,dfarray_out_dx,dfarray_out_dy,d2farray_out_dx2,d2farray_out % The interpolation is performed with two successive series of 1-D cubic spline interpolation with tension. Along x then along y. % First one calculates the values at (x_in(i),y_out), using nbc_y B.C. and then one interpolates at the x_out values, using nbc_out. % -% extrapolation is performed according to kextrapol (same for x and y at this stage): +% extrapolation is performed according to kextrapol (same for x and y at this stage): % kextrapol = 0 => (63=interpos_opt) constant outside the (x_in,y_in) domain with f_extrapol = f_edge % kextrapol = 1 => (23) linear extrapolation with continuous derivative along the direction (either x or y) % kextrapol = 2 => (33)quadratic extrapolation with continuous derivative @@ -23,7 +23,7 @@ function [farray_out,dfarray_out_dx,dfarray_out_dy,d2farray_out_dx2,d2farray_out % kextrapol = 7 => (21) linear + cst extrapolation % % The boundary conditions are given for nbc_x and nbc_y as follows: -% [0 0] (default): zero second derivative at the boundary of the input domain (x(1), x(end) for x direction for example). +% [0 0] (default): zero second derivative at the boundary of the input domain (x(1), x(end) for x direction for example). % This is the standard cubic spline boundary condition % [1 1] : zero 1st derivative at the boundary % [2 2] : fixed value at the boundary according to the input function @@ -84,7 +84,7 @@ switch nderiv_opt end % % Check inputs: -% +% if prod(size(x_in)) ~= length(x_in) warning('expects 1-D x_in array') return @@ -167,7 +167,7 @@ for k=1:nin case 3 opt_interpos(k) = 13; % cubic nearby then quadratic (default interpos) case 4 - opt_interpos(k) = 43; % cubic + opt_interpos(k) = 43; % cubic case 5 opt_interpos(k) = 3; % no extrapolation, get warning from interpos if extrapolating case 6 @@ -235,7 +235,7 @@ farray_out = NaN * ones(ndim_xout,ndim_yout,nin); % f_out_eff = NaN * ones(ndim_xout,ndim_yout,nin); for k=1:nin - % since boundary conditions, tensio, etc are allowed to depend on each function being interpolated, cannot use "multiple" interpolation to save time (and not yet implemented in interpos in any case...) + % since boundary conditions, tensio, etc are allowed to depend on each function being interpolated, cannot use 'multiple' interpolation to save time (and not yet implemented in interpos in any case...) tension_x_k = tension_x_eff(k); tension_y_k = tension_y_eff(k); nbc_x_k = nbc_x_eff(1:2,k); @@ -257,10 +257,10 @@ for k=1:nin end end end - + farray_out = f_out_eff; % -% Compute derivatives. Can only do it at the end, once the function is known on the final grid, +% Compute derivatives. Can only do it at the end, once the function is known on the final grid, % otherwise need to interpolate the various derivatives across the grid % % Since the resulting function is a cubic spline, would like to use tension=0. However then needs to use 0 2nd derivative diff --git a/matlab/CHEASEgui/kinetic_CHEASE_TCV.m b/matlab/CHEASEgui/kinetic_CHEASE_TCV.m index 049d2e64bed7b1e1133a2d62454d89a949b14fb1..e190ac8e49250d952aea36561b799433a3a4dfa7 100644 --- a/matlab/CHEASEgui/kinetic_CHEASE_TCV.m +++ b/matlab/CHEASEgui/kinetic_CHEASE_TCV.m @@ -32,7 +32,7 @@ expeq.nppfun=8; write_expeq(expeq,'EXPEQ.48158t1.6503_pTCV'); -% reran using CHEASEgui and setting "pressure", ncscal=4 +% reran using CHEASEgui and setting 'pressure', ncscal=4 johmall=gdat(shot,'\RESULTS::IBS:JOHMAV'); jparall=gdat(shot,'\RESULTS::IBS:JPARAV'); @@ -71,4 +71,3 @@ write_exptnz(exptnz,'EXPTNZ.48158t1.6503_1.2pTCV_Ipar'); % ran chease with both above files into: o.chease.48158t1.6503_1.2pTCV_Ipar, o.chease.48158t1.6503_1.2pTCV_Ipar.cols % forLiuqe_fromCHEASE.m - diff --git a/matlab/CHEASEgui/nblopt_plot.m b/matlab/CHEASEgui/nblopt_plot.m new file mode 100644 index 0000000000000000000000000000000000000000..19c723e06b441548bcb7b64f1b7e5385ae80fb95 --- /dev/null +++ b/matlab/CHEASEgui/nblopt_plot.m @@ -0,0 +1,198 @@ +function [ocols, expeqs, handles_nblopt_plot] = nblopt_plot(ocols_files,expeqout_files,suffix_titles); +% +% [ocols, expeqs, handles_nblopt_plot] = nblopt_plot(ocols_files,expeqout_files,suffix_titles); +% +% Assume 1st index is reference expeq and ocols +% suffix_titles used for titles of figures, optional +% + +set_defaults_matlab + +if ~exist('expeqout_files') || numel(expeqout_files)<1 + warning('inputs empty?, no expeq cannot do much'); + return +end + +if ~exist('suffix_titles') || isempty(suffix_titles) + [a_path, a_name, a_extension] = fileparts(expeqout_files{1}); + if ~isempty(a_extension) && numel(a_extension)>=5 + suffix_titles = strrep(a_extension(2:end),'OUT',''); + else + suffix_titles = strrep([a_name a_extension],'EXPEQ.OUT',''); + end +end +suffix_titles = strrep(suffix_titles,'_','\_'); + +ocols{1} = plotdatafile(ocols_files{1},0); % assumes 1st is fine and is ref +[a1,a2,a3]=fileparts(ocols_files{1}); +leg{1} = a2(min(round(numel(a2)/2)-1,10):numel(a2)); +for i=2:numel(ocols_files) + try + ocols{end+1} = plotdatafile(ocols_files{i},0); + [a1,a2,a3]=fileparts(ocols_files{i}); + leg{end+1} = a2(min(round(numel(a2)/2)-1,10):end); + end +end + +%% +expeqs{1} = plot_expeq(expeqout_files{1}); +for j=2:numel(expeqout_files) + try + expeqs{end+1} = plot_expeq(gcf,expeqout_files{j}); + end +end +%% + +irhopol = 1; +ipprime = 7; +iq = 8; +ishear = 10; +iistar = 11; +ialpha = 57; +incbal = 88; +% alpha= - 2μ0 dV/dpsi 1/(2 pi)^2 (V / (2 pi^2 R_0))^(1/2) dp/dpsi +% alphaGroebner = -dp/dpsi * dV/dpsi /2/pi**2 * sqrt(V/2pi**2/Rgeom) + +%% +ix_to_plot = [irhopol, irhopol, irhopol, irhopol, irhopol, ialpha]; +iy_to_plot = [iistar, iq, ishear, ialpha, ipprime, ishear]; +leg = cellstr(num2str([1:numel(ocols)]')); + +n_fig = 1; +for j=1:numel(iy_to_plot) + ix = ix_to_plot(j); + iy = iy_to_plot(j); + %% + handles_nblopt_plot.fig{2} = figure; + for i=1:numel(ocols) + handles_nblopt_plot.plot{i,n_fig} = plot(ocols{i}.pdata_in(:,ix),ocols{i}.pdata_in(:,iy)); + hold on + end + xlabel(ocols{i}.labels{ix}) + ylabel(ocols{i}.labels{iy}) + handles_nblopt_plot.leg{n_fig} = legend(leg); + %% +end +handles_nblopt_plot.title{n_fig} = title([suffix_titles]); + +%% Add shear vs alpha stable/unstable +ix = ialpha; +iy = ishear; +n_fig = n_fig + 1; +handles_nblopt_plot.fig{n_fig} = figure; +for i=1:numel(ocols) + iunstable = [ocols{i}.pdata_in(:,incbal) ~= 0]; + aa = ocols{i}.pdata_in(:,ix); + aa(iunstable) = NaN; + handles_nblopt_plot.plot{i,n_fig} = plotos(aa,ocols{i}.pdata_in(:,iy),'*-',[2 5],0,colos(i,:)); + hold on +end +handles_nblopt_plot.title{n_fig} = title(['stable points ' suffix_titles]); + +% $$$ for i=1:numel(ocols) +% $$$ istable = [ocols{i}.pdata_in(:,incbal) == 0]; +% $$$ aa = ocols{i}.pdata_in(:,ix); +% $$$ aa(istable) = NaN; +% $$$ plotos(aa,ocols{i}.pdata_in(:,iy),'s-',[1 6],0,colos(i,:)); +% $$$ hold on +% $$$ end +xlabel(ocols{i}.labels{ix}) +ylabel(ocols{i}.labels{iy}) +handles_nblopt_plot.leg{n_fig} = legend(leg); +%% + +%% +ix = irhopol; +n_fig = n_fig + 1; +handles_nblopt_plot.fig{n_fig} = figure; +iy = ipprime; +for i=2:numel(ocols) + yfit = interpos(ocols{i}.pdata_in(:,ix),ocols{i}.pdata_in(:,iy),ocols{1}.pdata_in(:,ix),-0.01); + fmarg(:,i) = yfit./ocols{1}.pdata_in(:,iy); + handles_nblopt_plot.plot{i,n_fig} = plot(ocols{1}.pdata_in(:,ix),fmarg(:,i)); + hold on +end +xlabel(ocols{i}.labels{ix}) +ylabel('Fmarg=P''nblopt/ref') +handles_nblopt_plot.leg{n_fig} = legend(leg{2:end}); +axis([0 1 0 10]) +handles_nblopt_plot.title{n_fig} = title([suffix_titles]); + +%% +n_fig = n_fig + 1; +handles_nblopt_plot.fig{n_fig} = figure; +handles_nblopt_plot.subplot{1,n_fig} = subplot(3,1,1); +for i=2:numel(ocols) + handles_nblopt_plot.subplots{i,1,n_fig} = plot(ocols{1}.pdata_in(:,ix),fmarg(:,i)); + hold on +end +ylabel('Fmarg') +%axis([0 1 0.5 4.5]); +handles_nblopt_plot.subplots{numel(ocols)+1,1,n_fig} = plotos([0 1],[1 1],'k--',[1 0]); +handles_nblopt_plot.leg{n_fig} = legend(leg{2:end},'location','nw'); +handles_nblopt_plot.title{n_fig} = title([suffix_titles]); + +handles_nblopt_plot.subplot{2,n_fig} = subplot(3,1,2); +iy = ishear; +for i=1:numel(ocols) + handles_nblopt_plot.subplots{i,2,n_fig} = plot(ocols{i}.pdata_in(:,ix),ocols{i}.pdata_in(:,iy)); + hold on +end +ylabel('shear') +legend(leg,'location','nw') + + +handles_nblopt_plot.subplot{3,n_fig} = subplot(3,1,3); +iy = ialpha; +for i=1:numel(ocols) + handles_nblopt_plot.subplots{i,3,n_fig} = plot(ocols{i}.pdata_in(:,ix),ocols{i}.pdata_in(:,iy)); + hold on +end +ylabel('alpha') +%legend(leg) +xlabel('\rho_p') +%[child_handles,hslice] = modsubplot([0.9 1],[],-1.3,{[0.5 4.5] [0 20] [0 3]},[],[],[],[],[0 0.12]); +[handles_nblopt_plot.child_handles{n_fig},hslice] = modsubplot([0. 1],[],-1.3,{[0. 8] [-5 20] [0 10]},[],'x',[],[],[0 0.12]); +%saveas(gcf,'cheaseout.61141t0.9800_fmarg.png','png'); + +%% +n_fig = n_fig + 1; +handles_nblopt_plot.fig{n_fig} = figure; +handles_nblopt_plot.subplot{1,n_fig} = subplot(3,1,1); +iy = iistar; +for i=1:numel(ocols) + plot(ocols{i}.pdata_in(:,ix),ocols{i}.pdata_in(:,iy)); + hold on +end +%ylabel('<j_\phi/R>/<1/R>') +handles_nblopt_plot.text{1,n_fig} = text(0.71,0.16,'<j_\phi/R>/<1/R>'); +%axis([0 1 0.5 4.5]); +%plotos([0 1],[1 1],'k--',[1 0]); +%legend(leg{1:end},'location','nw') +handles_nblopt_plot.title{n_fig} = title([suffix_titles]); + +handles_nblopt_plot.subplot{2,n_fig} = subplot(3,1,2); +iy = ishear; +for i=1:numel(ocols) + handles_nblopt_plot.subplots{i,2,n_fig} = plot(ocols{i}.pdata_in(:,ix),ocols{i}.pdata_in(:,iy)); + hold on +end +%ylabel('shear') +handles_nblopt_plot.text{2,n_fig} = text(0.71,2.6,'shear'); +%legend(leg,'location','nw') + + +handles_nblopt_plot.subplot{3,n_fig} = subplot(3,1,3); +iy = ipprime; +for i=1:numel(ocols) + handles_nblopt_plot.subplots{i,3,n_fig} = plot(ocols{i}.pdata_in(:,ix),abs(ocols{i}.pdata_in(:,iy))); + hold on +end +%ylabel('|dp/d\psi|_{max} stable to n=\infty') +handles_nblopt_plot.text{3,n_fig} = text(0.71,-0.6,'|dp/d\psi|_{max} stable to n=\infty'); +%legend(leg) +xlabel('\rho_\psi') +%[child_handles,hslice] = modsubplot([0.9 1],[],-1.3,{[0.5 4.5] [0 20] [0 3]},[],[],[],[],[0 0.12]); +[handles_nblopt_plot.child_handles{n_fig},hslice] = modsubplot([0.7 1],[],-1.32,{},[],'x',[],[],[0 -0.01]); +%[handles_nblopt_plot.child_handles{n_fig},hslice] = modsubplot([0.7 1],[],-1.32,{[0. 1.2] [0 3] [-1.1 0]},[],'x',[],[],[0 -0.01]); +%saveas(gcf,'cheaseout.61141t0.9800_fmarg.png','png'); diff --git a/matlab/CHEASEgui/nuplo_2d_plots.m b/matlab/CHEASEgui/nuplo_2d_plots.m index 08f014068c2b1518f4e6262864f0beb09edcdd84..7046f4c8b60fdb29362c1ef78e4f6120c2810d4f 100644 --- a/matlab/CHEASEgui/nuplo_2d_plots.m +++ b/matlab/CHEASEgui/nuplo_2d_plots.m @@ -7,7 +7,7 @@ function [hmode_distance,nuplo_data,nuplo_figs_handle] = nuplo_2d_plots(nuplo_fi % (2) psi=cst surfaces % (3) S(R,Z) local magnetic shear and zero curvature as contour asinh % (4) as (3) but only markers for negative S -% (5) local shear S versus theta on psi_surface flux surface, used to determine distance to "H-mode" +% (5) local shear S versus theta on psi_surface flux surface, used to determine distance to H-mode % % nuplo_filename: NUPLO full filename, output of CHEASE. % if cell array (fname_out from run_chease) find file with NUPLO in name with nuplo_filename{contains(nuplo_filename, 'NUPLO')} @@ -357,13 +357,14 @@ hmode_distance.comments.S_local_min_bot_good_curv = sprintf('%s%f%s','local min %% location of S=0 inside Smax (i.e. between 0 and theta_Smax) ij = find(a0(iSmaxtop_sort:-1:i0)<0); -if ~isempty(ij) +if ~isempty(ij) && a0(iSmaxtop_sort)>0 thetaS0top_sort = interp1(a0(iSmaxtop_sort-ij(1)+1:iSmaxtop_sort-ij(1)+2),theta_fit(iSmaxtop_sort-ij(1)+1:iSmaxtop_sort-ij(1)+2),0); + hmode_distance.theta_top_S0_deg = thetaS0top_sort*180/pi; else thetaS0top_sort = NaN; + hmode_distance.theta_top_S0_deg = NaN; end -hmode_distance.theta_top_S0_deg = thetaS0top_sort*180/pi; -if hmode_distance.theta_top_maxS_fit_2ndder_deg < 0 +if hmode_distance.theta_top_maxS_fit_2ndder_deg < 0 && hmode_distance.theta_top_maxS_value > 0 thetaS0top_fromSmax_deg = hmode_distance.theta_top_maxS_deg ... - sqrt(-2.*hmode_distance.theta_top_maxS_value/hmode_distance.theta_top_maxS_fit_2ndder_deg); ij=iround_os(nuplo_data.theta_psi_surf_sort*180/pi,thetaS0top_fromSmax_deg); @@ -376,13 +377,13 @@ end hmode_distance.theta_top_S0_approx_from_Smax_deg = thetaS0top_fromSmax_deg; ij = find(a0(iSmaxbot_sort:i0)<0); -if ~isempty(ij) +if ~isempty(ij) && a0(iSmaxbot_sort)>0 thetaS0bot_sort = interp1(a0(iSmaxbot_sort+ij(1)-2:iSmaxbot_sort+ij(1)-1),theta_fit(iSmaxbot_sort+ij(1)-2:iSmaxbot_sort+ij(1)-1),0); else thetaS0bot_sort = NaN; end hmode_distance.theta_bot_S0_deg = thetaS0bot_sort*180/pi; -if hmode_distance.theta_bot_maxS_fit_2ndder_deg < 0 +if hmode_distance.theta_bot_maxS_fit_2ndder_deg < 0 && hmode_distance.theta_bot_maxS_value > 0 thetaS0bot_fromSmax_deg = hmode_distance.theta_bot_maxS_deg ... + sqrt(-2.*hmode_distance.theta_bot_maxS_value/hmode_distance.theta_bot_maxS_fit_2ndder_deg); ij=iround_os(nuplo_data.theta_psi_surf_sort*180/pi,thetaS0bot_fromSmax_deg); diff --git a/matlab/CHEASEgui/plot_expeq.m b/matlab/CHEASEgui/plot_expeq.m index 2d8dd5aaca35b900c3865a2a57e5f6c7596cc48e..333f3d643a2f498a9e8b831fdb89cb15ce193ea1 100644 --- a/matlab/CHEASEgui/plot_expeq.m +++ b/matlab/CHEASEgui/plot_expeq.m @@ -1,23 +1,23 @@ function [EXPEQdata,ph] = plot_expeq(varargin) % PLOT_EXPEQ Function to plot data from an EXPEQ file. % [EXPEQdata plothandle]= PLOT_EXPEQ({fighandle},{fname/EXPEQdata},{plotOptions}) -% +% % Uses read_expeq.m % % Can be run without input arguments, in that case the user is prompted for % a file. -% +% % The first argument can optionally be a figure handle, to plot on. In that % case, the plot color is automatically changed using the hold('all') % feature. % % The user provides the EXPEQ data via a valid filename or an existing % structure containing the data. -% +% % Optionally, plotOptions can be used to assign matlab plot options. It is % an argument of variable size (similar to varargin). % -% NB: - In this new version, it is mandatory to specify the figure handle +% NB: - In this new version, it is mandatory to specify the figure handle % in order to plot another equilibrium on the same figure. % - If you want to use the plotOptions feature, you have to specify the % a valid EXPEQ (either a file or a structure) @@ -31,7 +31,7 @@ function [EXPEQdata,ph] = plot_expeq(varargin) % % Example 1: Specifying custom plot options % plot_expeq('EXPEQ_A','--k','Linewidth',2,'DisplayName','Original Data'); -% +% % % See also READ_EXPEQ and WRITE_EXPEQ @@ -50,12 +50,12 @@ if (nargin ~=0) && isscalar(varargin{1}) && ishghandle(varargin{1}) end end -if nargin == iarg || isempty(varargin{1+iarg}); +if nargin == iarg || isempty(varargin{1+iarg}); EXPEQdata = read_expeq; fnamefull = EXPEQdata.fnamefull; end -if nargin >= 1+iarg; +if nargin >= 1+iarg; if ~isempty(varargin{1+iarg}) && isstruct(varargin{1+iarg}) % EXPEQ structure is given EXPEQdata = varargin{1+iarg}; @@ -69,6 +69,13 @@ if nargin >= 1+iarg; % expeq filename is known, read expeq if ~isempty(varargin{1+iarg}) fnamefull = varargin{1+iarg}; + if isstring(fnamefull) + if numel(fnamefull) == 1 + fnamefull = char(fnamefull); + else + error('Input filename should be single char array or single string'); + end + end EXPEQdata = read_expeq(fnamefull); end end @@ -108,7 +115,7 @@ switch EXPEQdata.nppfun name_p = 'pressure'; end -switch EXPEQdata.nrhotype +switch EXPEQdata.nrhotype case 0 rho_label=('\rho_{\psi}'); case 1 @@ -137,7 +144,7 @@ if newfig % create new figure clf(ph.fig); - + % create axes for the boundary ax_xy=subplot(2,2,[1,3]);hold(ax_xy,'all'); set(ax_xy,'OuterPosition',[0.0 0.0 0.5 1.0],'Tag','ax_xy'); @@ -145,21 +152,21 @@ if newfig title('Boundary '); xlabel('r/R_0'); ylabel('z/R_0'); - + % create axes for the pressure profile ax_pp=subplot(2,2,2);hold(ax_pp,'all'); set(ax_pp,'OuterPosition',[0.5 0.5 0.5 0.5],'Tag','ax_pp'); title([name_p ' chease']); xlabel(rho_label); ylabel('chease units'); - + % create axes for the current profile ax_cu=subplot(2,2,4);hold(ax_cu,'all'); set(ax_cu,'OuterPosition',[0.5 0.0 0.5 0.5],'Tag','ax_cu'); xlabel(rho_label); ylabel('chease units'); title(title_cu) - + loose_inset = get(0,'DefaultAxesLooseInset'); % Manage insets to avoid crowded figure tight_inset = get(ax_xy,'TightInset'); @@ -185,4 +192,3 @@ ph.handle(1,1) = plot(ax_xy,EXPEQdata.RZ_psi(:,1),EXPEQdata.RZ_psi(:,2),plotOpti ph.handle(2,1) = plot(ax_pp,EXPEQdata.rho,EXPEQdata.(name_p),plotOptions{:}); ph.handle(3,1) = plot(ax_cu,EXPEQdata.rho,EXPEQdata.(name_cu),plotOptions{:}); - diff --git a/matlab/CHEASEgui/plot_exptnz.m b/matlab/CHEASEgui/plot_exptnz.m index c3faa1ce075ddd695ba4af2d70ff16e3cddde247..ef2f8fe6605a841f794df2c4baa7a43517ded20c 100644 --- a/matlab/CHEASEgui/plot_exptnz.m +++ b/matlab/CHEASEgui/plot_exptnz.m @@ -4,11 +4,11 @@ function EXPTNZdata=plot_exptnz(fname,plotOptions) % % Script to plot from EXPTNZ file. Uses read_exptnz.m % -% Can be run without input arguments, in that case if +% Can be run without input arguments, in that case if % If fname variable exists in workspace it is used directly. % Otherwise the user is prompted for a file. -% -% Optionally, plotOptions variable in workspace can be used +% +% Optionally, plotOptions variable in workspace can be used % to assign matlab plot options. % % Example: @@ -18,13 +18,13 @@ function EXPTNZdata=plot_exptnz(fname,plotOptions) % F.Felici CRPP - Feb 2010 -if nargin == 0 || isempty(fname); +if nargin == 0 || isempty(fname); EXPTNZdata = read_exptnz; fnamefull = EXPTNZdata.fnamefull; text_title=['Plot of ', fnamefull]; end -if nargin >= 1; +if nargin >= 1; if ~isempty(fname) && isstruct(fname) % EXPTNZ structure is given EXPTNZdata = fname; @@ -33,6 +33,13 @@ if nargin >= 1; % exptnz filename is known, read exptnz if ~isempty(fname) fnamefull = fname; + if isstring(fnamefull) + if numel(fnamefull) == 1 + fnamefull = char(fnamefull); + else + error('Input filename should be single char array or single string'); + end + end EXPTNZdata = read_exptnz(fnamefull); text_title=['Plot of ', fnamefull]; end @@ -62,7 +69,7 @@ if isfield(EXPTNZdata,'ni') plotos(EXPTNZdata.rhopsi,EXPTNZdata.ni,'--',0,0,plotOptions); legend('ne','ni') else - + end xlabel('\rho_{\psi}'); ylabel('[m^{-3}]'); diff --git a/matlab/CHEASEgui/plot_ocols.m b/matlab/CHEASEgui/plot_ocols.m deleted file mode 100644 index 42880c8ad16265013ac34afee2feb0a761d5a6b6..0000000000000000000000000000000000000000 --- a/matlab/CHEASEgui/plot_ocols.m +++ /dev/null @@ -1,58 +0,0 @@ -function [Hocols,chease_output_struct]=plot_ocols(varargin) -% -% Function to plot ochease.cols file obtained from unix script: o.chease_to_cols o.chease_output o.cols_file -% -% [Hocols,chease_output_struct] = plot_ocols -% or: -% [Hocols,chease_output_struct] = plot_ocols('/path/to/my/o.cols_file'); -% -% NOTE: The first argument has to be named "Hocols", otherwise the callback do not work -% - -% rewritten from plotdatafile to use read_ocols.m -% F.Felici CRPP May 2009 -% - -if nargout < 1 - error('must be called with at least first output argument named Hocols : Hocols = plot_ocols;'); -end - -if nargin == 0 - chease_output_struct = read_ocols; % call without inputs, user will be prompted -elseif nargin==1 - chease_output_struct = read_ocols(varargin{1}); % call with specified file -end - -data = chease_output_struct.data; -labels=chease_output_struct.labels; -% $$$ fields = fieldnames(chease_output_struct); -% $$$ % extract data and fields from structure -% $$$ for tel=1:length(fields) -% $$$ data(:,tel) = getfield(chease_output_struct,fields{tel},'data'); -% $$$ labels{tel} = getfield(chease_output_struct,fields{tel},'label'); -% $$$ end - -figure; Hocols.main=gcf; -% create UI list -set(Hocols.main,'Position',[40 250 400 400]); -x1=20; xlen=120; y1=20; ylen=300; -Hocols.listx=uicontrol(Hocols.main,'style','listbox','string',labels,'Position',[x1 y1 xlen ylen]); -Hocols.listx_lab=uicontrol(Hocols.main,'style','text','string','x-variable','Position',[x1+20 y1+ylen+10 80 20]); -x2=x1+xlen+10; -Hocols.listy=uicontrol(Hocols.main,'style','listbox','string',labels,'Position',[x2 20 xlen ylen]); -Hocols.listy_lab=uicontrol(Hocols.main,'style','text','string','y-variable','Position',[x2+20 y1+ylen+10 80 20]); - -x3=x2+xlen+10; y3=y1+0.9*ylen; - -Hocols.data = data; -Hocols.labels = labels; - -Hocols.figplot1D=11; -Hocols.plotcb=['if ~exist(''Hocols''); disp(''1st argument should be called Hocols''); return; end;', ... - 'ix=get(Hocols.listx,''value''); iy=get(Hocols.listy,''value'');',... - 'figure(Hocols.figplot1D); plot(Hocols.data(:,ix),Hocols.data(:,iy));',... - 'xlabel(Hocols.labels{ix}); ylabel(Hocols.labels{iy});', ... - 'disp([''plot(chease_output_struct.data(:,'' num2str(ix) ''),chease_output_struct.data(:,'' num2str(iy) '')) ; ylabel(chease_output_struct.labels{'' num2str(iy) ''}) ''])']; - -Hocols.plot1D=uicontrol(Hocols.main,'style','pushbutton','string','plot(x,y)', ... - 'Position',[x3 y3 100 20],'callback',Hocols.plotcb); diff --git a/matlab/CHEASEgui/plot_output_KX.m b/matlab/CHEASEgui/plot_output_KX.m index 85326dbc5cea61fb846ed2c9e0355f366d72b597..34fe741fbbcf6bc359383ba37f54574c02699245 100644 --- a/matlab/CHEASEgui/plot_output_KX.m +++ b/matlab/CHEASEgui/plot_output_KX.m @@ -19,7 +19,7 @@ if nargin<1, end co='co.bsp'; % coordinates -fi='fi.bsp'; % displacement projected +fi='fi.bsp'; % displacement projected st='st.bsp'; % inform. about stability NLines=25; % nb. of level lines for contour plot ScalQuiver=1.5; % scaling for quiver plot @@ -39,7 +39,7 @@ fprintf('- KINX mesh: %d x %d\n', nc(2), nc(1)-1); % % Definition of columns = projection of displacement to: % 1 = grad(psi), perp. on magnetic surfaces -% 2 = B x grad(psi), "poloidally" +% 2 = B x grad(psi), 'poloidally' % 3 = B, on magnetic field % 4 = ? % 5 = r-vector @@ -128,11 +128,11 @@ if ismember(plot_sel,[1,3]); if (plot_sel==3), subplot(121); end %tcvview('v'); for ii=1:1, - if(ii==1) + if(ii==1) set(gca,'box','on'); cmt=' (REAL)'; end; - if(ii==2) + if(ii==2) set(gca,'box','on'); cmt=' (IMAG)'; end; @@ -167,12 +167,12 @@ if ismember(plot_sel,[2,3]), for jj=5:5; % for the plot - if(jj==1) + if(jj==1) % subplot(1,2,1); set(gca,'box','on'); title('Displacement REAL'); end; - if(jj==2) + if(jj==2) % subplot(1,2,2); set(gca,'box','on'); title('Normal displacement level lines IMAG'); @@ -205,4 +205,3 @@ if ismember(plot_sel,[2,3]), end return - diff --git a/matlab/CHEASEgui/read_eqdsk.m b/matlab/CHEASEgui/read_eqdsk.m index 783d39415381b5ad80fcb30de4e830390d351d9b..5bc29ca3c06bf57a43157618624376f3daa25107 100644 --- a/matlab/CHEASEgui/read_eqdsk.m +++ b/matlab/CHEASEgui/read_eqdsk.m @@ -16,9 +16,20 @@ function [eqdskval]=read_eqdsk(fname,varargin) % varargin{5}: nverbose: 0 (no displays), 1 (warnings), 3 (detailed information, file written, etc (default)) % -cocos_in = 2; if nargin>1 && ~isempty(varargin{1}) cocos_in = varargin{1}; +else + if isstruct(fname) && isfield(fname,'cocos') && ~isempty(fname.cocos) + cocos_in = fname.cocos; + else + cocos_tmp=find_cocos(fname); + if numel(cocos_tmp) > 0 + cocos_in = cocos_tmp(1); + else + warning('cocos could not be defined, use 2') + cocos_in = 2; + end + end end docalculateBRetc = 0; @@ -77,10 +88,10 @@ if doread_fname eqdskval.fname=fname; eqdskval.pathname=pathname; eqdskval.cocos = cocos_in; - + fid=fopen(fnamefull,'r'); if fid==-1; error(['error opening ',fnamefull]); end - + eqdskval.stitle=fscanf(fid,'%c',48); ind=fscanf(fid,'%d',3); % goes to next line aftar char(10) @@ -134,12 +145,12 @@ if doread_fname eqdskval.extralines=footer; end % strvcat(footer) - + fclose(fid); - + % eqdskval.psi=reshape(eqdskval.psirz,[eqdskval.nr,eqdskval.nz]); - + eqdskval.rboxlen=line(1,1); eqdskval.zboxlen=line(1,2); eqdskval.r0=line(1,3); @@ -158,10 +169,10 @@ if doread_fname eqdskval.psiedge=line(2,4); eqdskval.b0=line(2,5); eqdskval.ip=line(3,1); - + eqdskval.rmesh=linspace(eqdskval.rboxleft,eqdskval.rboxleft+eqdskval.rboxlen,eqdskval.nr)'; eqdskval.zmesh=linspace(eqdskval.zmid-eqdskval.zboxlen/2,eqdskval.zmid+eqdskval.zboxlen/2,eqdskval.nz)'; - + % construct limiter from box if needed if length(eqdskval.rlim)==1 && eqdskval.nblim==1 eqdskval.rlim=[eqdskval.rboxleft ; eqdskval.rboxleft+eqdskval.rboxlen ; ... @@ -177,7 +188,7 @@ if doread_fname ' but eqdskval.nblim = ' num2str(eqdskval.nblim)]); end end - + end if ~isfield(eqdskval,'cocos') @@ -250,7 +261,7 @@ if ~isempty(eqdskval.rplas) && ~isempty(eqdskval.zplas) && ~isempty(intwhich) eqdskval.rplas_equi = eqdskval.raxis + eqdskval.rho_equi .* cos(eqdskval.theta_equi); eqdskval.zplas_equi = eqdskval.zaxis + eqdskval.rho_equi .* sin(eqdskval.theta_equi); - % Add "w07" points and syscode formulas + % Add 'w07' points and syscode formulas [eqdskval.syscode_formulas] = syscode_formulas(eqdskval.b0,eqdskval.ip,eqdskval.rplas,eqdskval.zplas); else eqdskval.rho_LCFS = []; diff --git a/matlab/CHEASEgui/read_expeq.m b/matlab/CHEASEgui/read_expeq.m index 3159b182582387af572d3adcdc9d1b4e1b29bd32..7aca63b458250d9b0470736fbd4b7d6522c68dd3 100644 --- a/matlab/CHEASEgui/read_expeq.m +++ b/matlab/CHEASEgui/read_expeq.m @@ -23,6 +23,13 @@ if nargin ==0 fnamefull = fullfile(pathname, fname); elseif nargin >= 1; fnamefull = varargin{1}; + if isstring(fnamefull) + if numel(fnamefull) == 1 + fnamefull = char(fnamefull); + else + error('Input filename should be single char array or single string'); + end + end if ~exist(fnamefull,'file'); disp([fnamefull,' does not exist']); [fname,pathname] = uigetfile([{'EXPEQ*;expeq*'},{'EXPEQ* or expeq* files'}; ... diff --git a/matlab/CHEASEgui/read_exptnz.m b/matlab/CHEASEgui/read_exptnz.m index f8c89a22f597789ac862ad9098eb276cd4f9aa95..0d56cfeba2c9a0104286af10d043263f95d9947f 100644 --- a/matlab/CHEASEgui/read_exptnz.m +++ b/matlab/CHEASEgui/read_exptnz.m @@ -23,13 +23,20 @@ if nargin ==0 fnamefull = fullfile(pathname, fname); elseif nargin >= 1; fnamefull = varargin{1}; - if ~exist(fnamefull); - disp([fnamefull,' does not exist']); + if ~exist(fnamefull); + disp([fnamefull,' does not exist']); [fname,pathname] = uigetfile([{'EXPTNZ*;exptnz*'},{'EXPTNZ* or exptnz* files'}; ... {'*EXPTNZ*;*exptnz*'},{'*EXPTNZ* or *exptnz* files'};{'*'},{'All files'}],'Select an EXPTNZ file'); if isequal(fname,0) || isequal(pathname,0); return; end fnamefull = fullfile(pathname, fname); else + if isstring(fnamefull) + if numel(fnamefull) == 1 + fnamefull = char(fnamefull) + else + error('Input filename should be single char array or single string'); + end + end ii=findstr(fnamefull,filesep); if ~isempty(ii) fname=fnamefull(ii(end)+1:end); diff --git a/matlab/CHEASEgui/run_chease.m b/matlab/CHEASEgui/run_chease.m index 5a8ca981b7cc76fc4164318fb6717f5794d6f2a1..db35245db0a07087f44a6c3d26cd59fb594268b9 100644 --- a/matlab/CHEASEgui/run_chease.m +++ b/matlab/CHEASEgui/run_chease.m @@ -6,14 +6,14 @@ function [fname_out,globalsvalues,namelist_struct,namelistfile_eff] = run_chease % [~,~,namelist_struct] = run_chease; % returns the default namelist structure (EXPEQ) % [~,~,namelist_struct] = run_chease(ii); % returns the default namelist structure for case 1, 2 or 0 % -% namelistfile: full path to CHEASE namelist (1 (default): if want default expeq namelist, 2 for default "eqdsk" namelist, 0 for an example with boundary and profiles given in namelist only) +% namelistfile: full path to CHEASE namelist (1 (default): if want default expeq namelist, 2 for default 'eqdsk' namelist, 0 for an example with boundary and profiles given in namelist only) % inputfile : full path to input file (EXPEQ/EQDSK file) or equivalent structure if namelistfile=1 or 2 % cocos_in : cocos of input eqdsk (2 by default, not needed if EXPEQ file given) % exptnzfile : (optional) full path to EXPTNZ file % suffix : (optional) suffix to written files % chease_exe : (optional) chease executable name (default=chease) which should be in your path, set chease_develop to have develop version, chease_lac5, etc % nverbose : (optional) verbosity level -% NIN_file : (optional) full path to CHEASE "restart" file +% NIN_file : (optional) full path to CHEASE 'restart' file % % fname_out : cell containing full path of output files % globalsvalues: structure containing main global results extracted from output: q0, qedge, q95, betaN, betap, li, kappa, delta, etc @@ -25,7 +25,7 @@ function [fname_out,globalsvalues,namelist_struct,namelistfile_eff] = run_chease fname_out=''; globalsvalues=[]; -if ~exist('cocos_in','var') +if ~exist('cocos_in','var') || isempty(cocos_in) cocos_in=2; end @@ -74,10 +74,14 @@ if ~exist(tmpdir,'dir'), mkdir(tmpdir); end if isstruct(inputfile) if (isnumeric(namelistfile) && namelistfile==1) || (isstruct(namelistfile) && namelistfile.neqdsk==0) || (isstruct(inputfile) && isfield(inputfile,'pressure')) - [EXPEQdataout,fclose_out] = write_expeq(inputfile_eff,fullfile(tmpdir,'EXPEQ_fromstruct')); + tmp_name = 'EXPEQ_fromstruct'; + if isfield(inputfile,'fname') && ~isempty(inputfile.fname'), tmp_name = [tmp_name '_' inputfile.fname]; end + [EXPEQdataout,fclose_out] = write_expeq(inputfile_eff,fullfile(tmpdir,tmp_name)); inputfile_eff = EXPEQdataout.fnamefull; elseif (isnumeric(namelistfile) && namelistfile==2) || (isstruct(namelistfile) && namelistfile.neqdsk==1) || (isstruct(inputfile) && isfield(inputfile,'F')) - [eqdsk_cocosout] = write_eqdsk(fullfile(tmpdir,'EQDSK_fromstruct'),inputfile_eff); + tmp_name = 'EQDSK_fromstruct'; + if isfield(inputfile,'fname') && ~isempty(inputfile.fname'), tmp_name = [tmp_name '_' inputfile.fname]; end + [eqdsk_cocosout] = write_eqdsk(fullfile(tmpdir,tmp_name),inputfile_eff); inputfile_eff = eqdsk_cocosout.fnamefull; end end @@ -301,7 +305,7 @@ else return end -if ~exist('suffix','var') +if ~exist('suffix','var') || isempty(suffix) if ~isempty(inputfile_eff) % extract an 'appropriate' suffix suffix = inputfile_eff(strfind(lower(inputfile_eff),'expeq')+length('expeq'):end); @@ -326,10 +330,11 @@ if ~isempty(fname_out) end fname_out = fname_out_copied; % transpose for nicer visualization else - disp('length(fname_out)=0?'); - disp('fname_out = ');disp(fname_out); - disp('type ''dbcont'' to continue, but you may ask O. Sauter to check what happened'); - keyboard + disp('isempty(fname_out)'); + [a,b]=unix(['ls -1 ' fullfile(tmpdir,'o.*[^l][^s]')]); + unix(['tail -20 ' b]); + disp(['from: tail -20 ' b]);;disp(fname_out); + return end % find an EQDSK OUT diff --git a/matlab/CHEASEgui/run_nblopt.m b/matlab/CHEASEgui/run_nblopt.m new file mode 100644 index 0000000000000000000000000000000000000000..283ed6e9e461bff902fe966a133246ff812a879a --- /dev/null +++ b/matlab/CHEASEgui/run_nblopt.m @@ -0,0 +1,266 @@ +function [fname_out_nblopt,globalsvalues_nblopt,namelist_struct_nblopt,expeqout_nblopt,ocols_nblopt,jout_nblopt] = run_nblopt(inputfile,is_eqdsk,add_jedge,main_suffix,varargin); +% +% [fname_out_nblopt,globalsvalues_nblopt,namelist_struct_nblopt,expeqout_nblopt,ocols_nblopt,jout_nblopt] = run_nblopt(inputfile,is_eqdsk,add_jedge,main_suffix,varargin); +% +% inputfile: an EXPEQ or an EQDSK file or structure +% is_eqdsk: 0 for an EXPEQ input and 1 for an eqdsk +% add_jedge: additional edge current (0 by default), to mimic edge bootstrap of CD. If array, loops over values provided +% j_expeq = (1-add_jedge(i)/5) * j_expeq + add_jedge(i) * j_edge(rho) +% hence [0, 0.5, 1] will scan initial j_expeq with Ip fixed (NCSCAL=2, except if npropt_fix=5) +% 0 will just test given equilibrium as is +% main_suffix: suffix added to output filenames by run_chease +% +% varargin{1}: ninblopt, max number of ballooning optimization iteration (default = 30) +% varargin{2}: pprime_bal_max (def=6), maximum pprime above which assumed unstable to limit pprime<abs(PPRIME_BAL_MAX) when is 2nd stability region +% varargin{3}: rhodep_j (default = 0.97), location of added jedge Gaussian +% varargin{4}: wdep_j (default = 0.04), full 1/e width of added jedge Gaussian +% + +npropt_for_fix_profile = 2; + +jout = 0; +if ~exist('is_eqdsk'), fprintf('\n%s\n\n','is_eqdsk should be provided'); return; end +if ~exist('add_jedge') || isempty(add_jedge), add_jedge = 0; end + +ninblopt = 30; +if nargin >= 5 && ~isempty(varargin{1}) && isnumeric(varargin{1}) + ninblopt = varargin{1}; +end +pprime_bal_max = 6.; +if nargin >= 6 && ~isempty(varargin{2}) && isnumeric(varargin{2}) + pprime_bal_max = varargin{2}; +end +rhodep_j = 0.97; +if nargin >= 7 && ~isempty(varargin{3}) && isnumeric(varargin{3}) + rhodep_j = varargin{3}; +end +wdep_j = 0.04; +if nargin >= 8 && ~isempty(varargin{4}) && isnumeric(varargin{4}) + wdep_j = varargin{4}; +end + +% get npropt = npropt_for_fix_profile EXPEQ file to run nblopt = 1 on +if is_eqdsk == 1 + if ~exist('main_suffix') || isempty('main_suffix') + main_suffix = 'run_nblopt_eqdsk'; + end + [~,~,namelist_struct_eqdsk] = run_chease(2); + namelist_struct_eqdsk.npropt = npropt_for_fix_profile; + jout = jout + 1; + if ~isstruct(inputfile) + eqdsk_struct_in = read_eqdsk(inputfile); + else + eqdsk_struct_in = inputfile; + end + namelist_struct_eqdsk.nverbose = 3; % required to get ocols and globalsout + [fname_out_nblopt{jout},globalsvalues_nblopt{jout},namelist_struct_nblopt{jout}] = run_chease(namelist_struct_eqdsk,eqdsk_struct_in, ... + eqdsk_struct_in.cocos,[],main_suffix); + r0exp = globalsvalues_nblopt{jout}.r0exp; + b0exp = globalsvalues_nblopt{jout}.b0exp; + ip_phys = globalsvalues_nblopt{jout}.ip_phys; + ip_chease = globalsvalues_nblopt{jout}.ipchease; + ab = {fname_out_nblopt{jout}{contains(fname_out_nblopt{jout},'EXPEQ.OUT')}}; + expeqout_nblopt{jout} = ab{1}; + ab = fname_out_nblopt{jout}{contains(fname_out_nblopt{jout},'.cols')}; + ocols_nblopt{jout} = ab; + % keep original (R,Z) + expeq_struct_ref = read_expeq(expeqout_nblopt{jout}); + expeq_struct_ref.RZ_psi = [reshape(eqdsk_struct_in.rplas/r0exp,eqdsk_struct_in.nbbound,1),reshape(eqdsk_struct_in.zplas/r0exp,eqdsk_struct_in.nbbound,1)]; + expeq_struct_ref.n_psi = eqdsk_struct_in.nbbound; +elseif is_eqdsk == 0 + if ~exist('main_suffix') || isempty('main_suffix') + main_suffix = 'run_nblopt_expeq'; + end + if ~isstruct(inputfile) + expeq_struct_ref = read_expeq(inputfile); + else + expeq_struct_ref = inputfile; + end + if expeq_struct_ref.nsttp ~= npropt_for_fix_profile || expeq_struct_ref.nrhotype ~= 0 + % need to run CHEASE to get npropt expeq.out(rhopol) + [~,~,namelist_struct_expeq] = run_chease(1); + namelist_struct_expeq.npropt = npropt_for_fix_profile; + namelist_struct_expeq.nverbose = 3; % required to get ocols and globalsout + jout = jout + 1; + [fname_out_nblopt{jout},globalsvalues_nblopt{jout},namelist_struct_nblopt{jout}] = run_chease(namelist_struct_expeq,inputfile,[], ... + [],main_suffix); + r0exp = globalsvalues_nblopt{jout}.r0exp; + b0exp = globalsvalues_nblopt{jout}.b0exp; + ip_phys = globalsvalues_nblopt{jout}.ip_phys; + ip_chease = globalsvalues_nblopt{jout}.ipchease; + ab = {fname_out_nblopt{jout}{contains(fname_out_nblopt{jout},'EXPEQ.OUT')}}; + expeqout_nblopt{jout} = ab{1}; + ab = fname_out_nblopt{jout}{contains(fname_out_nblopt{jout},'.cols')}; + ocols_nblopt{jout} = ab; + % keep original (R,Z) + expeq_struct_ref0 = expeq_struct_ref; + expeq_struct_ref = read_expeq(expeqout_nblopt{jout}); + expeq_struct_ref.RZ_psi = expeq_struct_ref0.RZ_psi; + expeq_struct_ref.n_psi = expeq_struct_ref0.n_psi; + else + try + r0_line = expeq_struct_ref.extralines{contains(expeq_struct_ref.extralines,'R0 [M]')}; + b0_line = expeq_struct_ref.extralines{contains(expeq_struct_ref.extralines,'B0 [T]')}; + ip_line = expeq_struct_ref.extralines{contains(expeq_struct_ref.extralines,'TOTAL CURRENT')}; + r0exp = sscanf(r0_line,'%f'); + b0exp = sscanf(b0_line,'%f'); + ip_chease = sscanf(ip_line,'%f'); + ip_phys = sscanf(ip_line(findstr(ip_line,'[A]')+4:end),'%f'); + catch ME + disp('tried to extract r0exp, b0exp and Ips but failed, provide expeq structure in input') + throw ME + end + end +else + disp(['is_eqdsk = ' is_eqdsk ' should be 0 or 1']) + return +end + + +%% start from typical pprime, avoid center and finite edge value +expeq_struct_ref.Pprime = min(0.,-6.*(expeq_struct_ref.rho-0.2).*(1-expeq_struct_ref.rho)-0.3.*expeq_struct_ref.rho.^2); + +ip_phys + +amp_j0 = 0.4; +for iloop=1:numel(add_jedge) + jout = jout + 1; + expeq_struct_ref_iloop = expeq_struct_ref; + % add edge current (inspired by eqdsk2chease2D.m) + amp_j = add_jedge(iloop) * amp_j0; + frac_johm = max(1 - 0.2 * add_jedge(iloop),0.2); % to try to have same integrated current in input + %jbsexp=amp_j.*(1+tanh((expeq_struct_ref_iloop.rho-rhodep_j)./wdep_j))+amp_j.*exp(-(expeq_struct_ref_iloop.rho-0.97).^2./0.12^2); + jbsexp=amp_j.*exp(-4.*(expeq_struct_ref_iloop.rho-rhodep_j).^2./wdep_j^2); + if any(npropt_for_fix_profile == [2, 3, 4]) + expeq_struct_ref_iloop.Istar=frac_johm.*expeq_struct_ref_iloop.Istar+jbsexp; + elseif npropt_for_fix_profile == 5 + jbsexp=amp_j.*(1+tanh((expeq_struct_ref_iloop.rho-rhodep_j)./wdep_j))+amp_j.*exp(-(expeq_struct_ref_iloop.rho-0.97).^2./0.12^2); + expeq_struct_ref_iloop.q = expeq_struct_ref_iloop.q+jbsexp; + end + % + [~,~,namelist_struct_nblopt{jout}] = run_chease(1); + namelist_struct_nblopt{jout}.r0exp = r0exp; + namelist_struct_nblopt{jout}.b0exp = b0exp; + namelist_struct_nblopt{jout}.currt = ip_chease; + namelist_struct_nblopt{jout}.ncscal = 2; + namelist_struct_nblopt{jout}.relax = 0.2; + namelist_struct_nblopt{jout}.ninmap = 60; + namelist_struct_nblopt{jout}.ninsca = 60; + if npropt_for_fix_profile==5 + namelist_struct_nblopt{jout}.ncscal = 1; + namelist_struct_nblopt{jout}.ninsca = 100; + namelist_struct_nblopt{jout}.ninmap = 100; + namelist_struct_nblopt{jout}.relax = 0.4; + end + namelist_struct_nblopt{jout}.npropt = npropt_for_fix_profile; + namelist_struct_nblopt{jout}.nblopt = 1; + namelist_struct_nblopt{jout}.epslon = 1e-6; + namelist_struct_nblopt{jout}.ninblopt = ninblopt; + namelist_struct_nblopt{jout}.nppr = 100; + namelist_struct_nblopt{jout}.cfbal = 100; + namelist_struct_nblopt{jout}.pprime_bal_max = pprime_bal_max; + namelist_struct_nblopt{jout}.ndiagop = 0; + namelist_struct_nblopt{jout}.nverbose = 3; + chease_suffix = [main_suffix 'nblopt']; + tic + [fname_out_nblopt{jout},globalsvalues_nblopt{jout},namelist_struct_nblopt{jout}] = ... + run_chease(namelist_struct_nblopt{jout},expeq_struct_ref_iloop,[],[],chease_suffix); + toc + jout_nblopt(iloop) = jout; + ab = fname_out_nblopt{jout}{contains(fname_out_nblopt{jout},'NOUT')}; + NOUT_chease_nblopt = ab; + ab = {fname_out_nblopt{jout}{contains(fname_out_nblopt{jout},['EXPEQ.OUT' chease_suffix])}}; + if numel(ab) >= 1 + expeqout_nblopt{jout} = ab{1}; + else + fname_out_nblopt + warning('CHEASE could not run properly'); + expeqout_nblopt{jout} = []; + end + % could replace RZ with original shape at this stage for expeqout_nblopt{jout_nblopt(iloop)} + ab = fname_out_nblopt{jout}{contains(fname_out_nblopt{jout},'.cols')}; + ocols_nblopt{jout} = ab; + if numel(ab) >= 1 + out_chease_nblopt = ab(1:end-5); + unix(['grep ''ERROR >'' ' out_chease_nblopt ' | tail -10']); + end + if isempty(expeqout_nblopt{jout_nblopt(iloop)}) + jout = jout + 2; + expeqout_nblopt{jout-1:jout} = []; + ocols_nblopt{jout-1:jout} = []; + else + %% + plot_expeq(expeq_struct_ref_iloop); + plot_expeq(gcf,expeqout_nblopt{jout_nblopt(iloop)}); + %% check stability + jout = jout + 1; + [~,~,namelist_struct_nblopt{jout}] = run_chease(1); + namelist_struct_nblopt{jout}.r0exp = r0exp; + namelist_struct_nblopt{jout}.b0exp = b0exp; + namelist_struct_nblopt{jout}.currt = ip_chease; + namelist_struct_nblopt{jout}.ncscal = 4; + namelist_struct_nblopt{jout}.cpress=0.95; + namelist_struct_nblopt{jout}.nverbose=3; + chease_suffix = [main_suffix '_testBAL_095']; + tic + [fname_out_nblopt{jout},globalsvalues_nblopt{jout},namelist_struct_nblopt{jout}] = ... + run_chease(namelist_struct_nblopt{jout},expeqout_nblopt{jout_nblopt(iloop)},[],[],chease_suffix); + toc + ab = fname_out_nblopt{jout}{contains(fname_out_nblopt{jout},'.cols')}; + ocols_nblopt{jout} = ab; + out_chease_nblopt095 = ab(1:end-5); + ab = {fname_out_nblopt{jout}{contains(fname_out_nblopt{jout},['EXPEQ.OUT' chease_suffix])}}; + if numel(ab)>=1 + expeqout_nblopt{jout} = ab{1}; + else + expeqout_nblopt{jout} = ''; + end + ab = fname_out_nblopt{jout}{contains(fname_out_nblopt{jout},'NOUT')}; + NOUT_chease_nblopt095 = ab; + [globalsvalues_nblopt{jout},ocols_struct] = extractdatachease(out_chease_nblopt095,ocols_nblopt{jout}); + ij=find(ocols_struct.s_mesh.data>0.5); + nb_unstable = max(ocols_struct.ncbal.data(ij)); + if nb_unstable == 0 + disp(['with 0.95 cpress, ' expeqout_nblopt{jout_nblopt(iloop)} ' is stable']); + else + disp(['with 0.95 cpress, ' expeqout_nblopt{jout_nblopt(iloop)} ' is unstable']); + end + figure;plot(ocols_struct.s_mesh.data,ocols_struct.ncbal.data) + hold on + + %% + jout = jout + 1; + namelist_struct_nblopt{jout} = namelist_struct_nblopt{jout-1}; + namelist_struct_nblopt{jout}.cpress=1.02; + namelist_struct_nblopt{jout}.relax=0.2; + namelist_struct_nblopt{jout}.nopt = -2; + chease_suffix = [main_suffix '_testBAL_102']; + tic + [fname_out_nblopt{jout},globalsvalues_nblopt{jout},namelist_struct_nblopt{jout},namelistfile_eff] = ... + run_chease(namelist_struct_nblopt{jout},expeqout_nblopt{jout_nblopt(iloop)},[],[],chease_suffix,[],[],NOUT_chease_nblopt095); + toc + ab = fname_out_nblopt{jout}{contains(fname_out_nblopt{jout},'.cols')}; + ocols_nblopt{jout} = ab; + out_chease_nblopt102 = ab(1:end-5); + ab = {fname_out_nblopt{jout}{contains(fname_out_nblopt{jout},['EXPEQ.OUT' chease_suffix])}}; + if numel(ab)>=1 + expeqout_nblopt{jout} = ab{1}; + else + expeqout_nblopt{jout} = ''; + end + [globalsvalues_nblopt{jout},ocols_struct] = extractdatachease(out_chease_nblopt102,[out_chease_nblopt102 '.cols'],[out_chease_nblopt102 '.RZcols']); + ij=find(ocols_struct.s_mesh.data>0.5); + nb_unstable = max(ocols_struct.ncbal.data(ij)); + if nb_unstable == 0 + disp(['with 1.02 cpress, ' expeqout_nblopt{jout_nblopt(iloop)} ' is stable']); + else + disp(['with 1.02 cpress, ' expeqout_nblopt{jout_nblopt(iloop)} ' is unstable']); + end + plot(ocols_struct.s_mesh.data,ocols_struct.ncbal.data) + legend('0.95','1.02') + ylabel('NCBAL') + title('with inputfile as is') + unix(['grep ''GEXP'' ' out_chease_nblopt095]); + unix(['grep ''GEXP'' ' out_chease_nblopt102]); + end +end diff --git a/matlab/CHEASEgui/tests_matlab.m b/matlab/CHEASEgui/tests_matlab.m index eda8cf3f8ef65ad452ce7c43f3ec0eb370da21c0..959d8cfc21da38a29c19a649691cca80b4aea83e 100644 --- a/matlab/CHEASEgui/tests_matlab.m +++ b/matlab/CHEASEgui/tests_matlab.m @@ -2,6 +2,8 @@ function tests_matlab(test_case) try fprintf('\n Running test file: %s\n',mfilename('fullpath')); fprintf(' Time: %s\n',datestr(now)); + [a,uname_out]=unix('uname -a'); + uname_out passed = run_cheasegui_tests(test_case); % call to your test script here, with optional test_case input exit_code = int32(~passed); % convert to bash shell convention diff --git a/matlab/CHEASEgui/write_eqdsk.m b/matlab/CHEASEgui/write_eqdsk.m index 29d0bf63bf0388a634d003bde6988919573b768d..fc44b80ea28c81e60141084fdb40414bc6604065 100644 --- a/matlab/CHEASEgui/write_eqdsk.m +++ b/matlab/CHEASEgui/write_eqdsk.m @@ -28,11 +28,11 @@ eqdsk_cocosout_IpB0pos = []; if ~exist('cocos_inout'); cocos_inout = []; end if nargin==0 - disp('needs at least 1 input: eqdsk_structure with the field "fnamefull" provided, or 2 inputs'); + disp('needs at least 1 input: eqdsk_structure with the field ''fnamefull'' provided, or 2 inputs'); return elseif nargin==1 if ~isstruct(fnamefull) - disp('needs at least 1 input: eqdsk_structure with the field "fnamefull" provided, or 2 inputs'); + disp('needs at least 1 input: eqdsk_structure with the field ''fnamefull'' provided, or 2 inputs'); return end % take fnamefull from input structure @@ -40,7 +40,7 @@ elseif nargin==1 if isfield(eqdsk_input,'fnamefull') && ~isempty(eqdsk_input.fnamefull) fnamefull = eqdsk_input.fnamefull; else - disp('needs at least 1 input: eqdsk_structure with the field "fnamefull" provided, or 2 inputs'); + disp('needs at least 1 input: eqdsk_structure with the field ''fnamefull'' provided, or 2 inputs'); return end end @@ -140,7 +140,7 @@ for ieq=1:length(eqdskin) return end fprintf(fid,'%16.9E%16.9E%16.9E%16.9E%16.9E\n',eqdskin{ieq}.psirz(1:end-1));fprintf(fid,'%16.9E\n',eqdskin{ieq}.psirz(end)); - + % Q(NR): FORMAT 5E16.9 fprintf(fid,'%16.9E%16.9E%16.9E%16.9E%16.9E\n',eqdskin{ieq}.q(1:end-1));fprintf(fid,'%16.9E\n',eqdskin{ieq}.q(end)); % NPLASMA_BOUND, NLIMITER_BOUND: FORMAT 2I5 @@ -154,7 +154,7 @@ for ieq=1:length(eqdskin) aa=reshape([eqdskin{ieq}.rplas' ; eqdskin{ieq}.zplas'],2*eqdskin{ieq}.nbbound,1); fprintf(fid,'%16.9E%16.9E%16.9E%16.9E%16.9E\n',aa(1:end-1));fprintf(fid,'%16.9E\n',aa(end)); % RLIMITER_BOUND(NLIMITER_BOUND), ZLIMITER_BOUND(NLIMITER_BOUND) - if ~isempty(eqdskin{ieq}.nblim) + if ~isempty(eqdskin{ieq}.nblim) && eqdskin{ieq}.nblim > 0 aa=reshape([eqdskin{ieq}.rlim' ; eqdskin{ieq}.zlim'],2*eqdskin{ieq}.nblim,1); fprintf(fid,'%16.9E%16.9E%16.9E%16.9E%16.9E\n',aa(1:end-1));fprintf(fid,'%16.9E\n',aa(end)); end @@ -168,7 +168,7 @@ for ieq=1:length(eqdskin) fprintf(fid,'%s\n',eqdskin{ieq}.extralines{i}); end end - + % add extra comment lines if ~isempty(extracomments) fprintf(fid,'\n'); diff --git a/matlab/CHEASEgui/write_namelist_chease.m b/matlab/CHEASEgui/write_namelist_chease.m index b51c724211a9f01e0e3c63b50f94d7adfb0851b1..499b12fa5ce502e35bd7f512d14e55fda3962ee0 100644 --- a/matlab/CHEASEgui/write_namelist_chease.m +++ b/matlab/CHEASEgui/write_namelist_chease.m @@ -36,9 +36,9 @@ end % one day these should come from src-f90/COMDAT.inc allowed_fields = {'aplace','awidth','b0exp','cfbal','cfnress','cplace','cpress','csspec','currt','cwidth','cwidth','dplace','dwidth', ... 'eplace','epslon','etaei','ewidth','gamma','msmax','n0jedge','nbal','nblc0','nblopt','nbsexpq','nbsopt','nbpsout','nbstrp','nchi','ncscal','ndiagop', ... - 'ndifps','ndift','neqdsk','negp','neqdxtpo','ner','nfunc','nfunrho','nrhomesh','ninmap','ninsca','nideal','niso','nmesha','nmeshb','nmeshc','nmeshd', ... + 'ndifps','ndift','neqdsk','negp','neqdxtpo','ner','nfunc','nfunrho','nrhomesh','ninblopt','ninmap','ninsca','nideal','niso','nmesha','nmeshb','nmeshc','nmeshd', ... 'nmeshe','nmeshpol','nmeshpolexp','nopt','nplot','npoida','npoidc','npoidc','npoidd','npoide','npoidq','nppfun','npp','nppr','npropt','npsi','nrbox','nrscal', ... - 'ns','nsmooth','nsttp','nsurf','nsym','nt','ntcase','ntmf0','ntnova','nturn','nvexp','nverbose','nzbox','psiscl','qplace','qspec','qwidth','r0w','z0w','r0','rz0', ... + 'ns','nsmooth','nsttp','nsurf','nsym','nt','ntcase','ntmf0','ntnova','nturn','nvexp','nverbose','nzbox','pprime_bal_max','psiscl','qplace','qspec','qwidth','r0w','z0w','r0','rz0', ... 'r0exp','relax','rext','rpeop','rz0w','rzion','sgma','solpda','solpda','solpdc','solpdc','solpdd','solpde','solpdpol',... 'nfixwall', 'rboxlen', 'rboxlft', 'zboxlen', 'zboxmid', ... % CHEASE namelist variables 'rc','triang','elong','aspct','beans','ceta','theta0','rnu','xi','sgma','delta', ... % shaping @@ -179,7 +179,7 @@ if isfield(nl,'IpkA') end %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% Create namelist file "namelist_chease", input to CHEASE +% Create namelist file 'namelist_chease', input to CHEASE %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% fdir = fileparts(fname_eff); if isempty(fdir); fdir = '.'; end if ~exist(fdir,'dir'); % create dir if necessary @@ -266,7 +266,7 @@ return %fprintf(fid,'NEQDSK=%d, NPROPT=%d, NOPT=0,\n',nl.npropt); %fprintf(fid,'NPPFUN=4, NFUNRHO=%d, NSTTP=%d, NFUNC=4,\n\n',nl.nfunrho,nl.nsttp); %% --- CHEASE subroutines, ie. ballooning stab. (NBAL) and jbs optimizations (NBSTRP) --- -%fprintf(fid,'NBLOPT=0, NBAL=1, CFBAL=10.00, NTURN=10, NPPR=24, NBLC0=16,\n'); +%fprintf(fid,'NBLOPT=0, NBAL=1, CFBAL=10.00, NTURN=10, NPPR=24, NBLC0=16, NINBLOPT=15,\n'); %fprintf(fid,'NBSOPT=0, NBSTRP=1, ETAEI=0.1, RPEOP=0.70, RZION=1.5, \n\n'); %% --- CHEASE scaling --- %fprintf(fid,'CPRESS=%2.0f, QSPEC=%8.7f, CSSPEC=%8.7f,\n',nl.cpress,nl.qspec,nl.csspec); diff --git a/python/.gitignore b/python/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..b0f0891cc5872c9357bdf96f6e638d572bb3fdce --- /dev/null +++ b/python/.gitignore @@ -0,0 +1,4 @@ +EQDSK_COCOS_* +EXPEQ* +EXPTNZ.OUT +NOUT diff --git a/python/chease_hdf5.py b/python/chease_hdf5.py index f598a3ddbfb638ed2be260f8df2290e0daa3d5e0..7135ed85f1d7f768416433980301eabd94863003 100755 --- a/python/chease_hdf5.py +++ b/python/chease_hdf5.py @@ -141,7 +141,7 @@ class chease_eq(object): print(e) def plot(self, outline=True, label=True, fig=None, ax=None, - plot_data=None, quantity="B", norm="SI", contours=10): + plot_data=None, quantity="B", norm="SI", contours=10, mark_axis=False): """ 2D R,Z plot of |B|. Optionally instead pass in tuple plot_data=(X(s,c), 'label') """ @@ -159,7 +159,7 @@ class chease_eq(object): plot_data = add_ghost(plot_data[0]) pc = ax.pcolormesh(R, Z, plot_data, shading="auto") - if outline or True: + if outline: ax.plot(R[:,-1], Z[:,-1], "k-") if contours: contour_line = ax.contour(R, Z, plot_data, @@ -184,7 +184,6 @@ class chease_eq(object): if contours: [cbar.ax.axhline(i, color="k", linewidth=0.1) for i in contour_line.levels] - mark_axis = False if mark_axis: cbar.ax.axhline(plot_data[0,0], color="m", linestyle="--", linewidth=2.) if fig is not None: @@ -218,7 +217,7 @@ class chease_eq(object): for sval in slist: plot_ring(sval, ax, sgrid, R, Z, color="k", linewidth=0.5) - def plot_chi(self, fig=None, ax=None, nchi=10): + def plot_chi(self, fig=None, ax=None, nchi=8): """ Add nchi lines of equispaced chi=theta* to the passed (R,Z) axis """ @@ -257,7 +256,7 @@ if __name__ == "__main__": fig, ax = cheq.plot() cheq.plot_psi(ax=ax, npsi=10) - cheq.plot_chi(ax=ax, nchi=4) + cheq.plot_chi(ax=ax, nchi=8) plot_filename = "chease_B_plot_psi_chi.png" interactive_show_or_save(fig, plot_filename, all_figs, interactive, dpi=300) diff --git a/python/chease_schema_reflist.xsd b/python/chease_schema_reflist.xsd new file mode 100644 index 0000000000000000000000000000000000000000..6f2aea2b7c56bd43448eb9bdcc34e8183a74bff1 --- /dev/null +++ b/python/chease_schema_reflist.xsd @@ -0,0 +1,1107 @@ +<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> + <!-- document element --> + <xs:element name="parameters"> + <xs:complexType> + <xs:all> + <xs:element ref="cocos_in" minOccurs="0" maxOccurs="1"/> + <xs:element ref="cocos_out" minOccurs="0" maxOccurs="1"/> + <xs:element ref="epslon" minOccurs="0" maxOccurs="1"/> + <xs:element ref="relax" minOccurs="0" maxOccurs="1"/> + <xs:element ref="ninmap" minOccurs="0" maxOccurs="1"/> + <xs:element ref="ninsca" minOccurs="0" maxOccurs="1"/> + <xs:element ref="nmgaus" minOccurs="0" maxOccurs="1"/> + <xs:element ref="nsgaus" minOccurs="0" maxOccurs="1"/> + <xs:element ref="ntgaus" minOccurs="0" maxOccurs="1"/> + <xs:element ref="nverbose" minOccurs="0" maxOccurs="1"/> + <!-- meshes parameters --> + <xs:element ref="aplace" minOccurs="0" maxOccurs="1"/> + <xs:element ref="awidth" minOccurs="0" maxOccurs="1"/> + <xs:element ref="bplace" minOccurs="0" maxOccurs="1"/> + <xs:element ref="bwidth" minOccurs="0" maxOccurs="1"/> + <xs:element ref="cplace" minOccurs="0" maxOccurs="1"/> + <xs:element ref="cwidth" minOccurs="0" maxOccurs="1"/> + <xs:element ref="dplace" minOccurs="0" maxOccurs="1"/> + <xs:element ref="dwidth" minOccurs="0" maxOccurs="1"/> + <xs:element ref="eplace" minOccurs="0" maxOccurs="1"/> + <xs:element ref="ewidth" minOccurs="0" maxOccurs="1"/> + <xs:element ref="qplace" minOccurs="0" maxOccurs="1"/> + <xs:element ref="qvalneo" minOccurs="0" maxOccurs="1"/> + <xs:element ref="qwidth" minOccurs="0" maxOccurs="1"/> + <xs:element ref="solpda" minOccurs="0" maxOccurs="1"/> + <xs:element ref="solpdb" minOccurs="0" maxOccurs="1"/> + <xs:element ref="solpdc" minOccurs="0" maxOccurs="1"/> + <xs:element ref="solpdd" minOccurs="0" maxOccurs="1"/> + <xs:element ref="solpde" minOccurs="0" maxOccurs="1"/> + <xs:element ref="solpdpol" minOccurs="0" maxOccurs="1"/> + <xs:element ref="msmax" minOccurs="0" maxOccurs="1"/> + <xs:element ref="nchi" minOccurs="0" maxOccurs="1"/> + <xs:element ref="ndift" minOccurs="0" maxOccurs="1"/> + <xs:element ref="negp" minOccurs="0" maxOccurs="1"/> + <xs:element ref="ner" minOccurs="0" maxOccurs="1"/> + <xs:element ref="niso" minOccurs="0" maxOccurs="1"/> + <xs:element ref="nmesha" minOccurs="0" maxOccurs="1"/> + <xs:element ref="nmeshb" minOccurs="0" maxOccurs="1"/> + <xs:element ref="nmeshc" minOccurs="0" maxOccurs="1"/> + <xs:element ref="nmeshd" minOccurs="0" maxOccurs="1"/> + <xs:element ref="nmeshe" minOccurs="0" maxOccurs="1"/> + <xs:element ref="nmeshpol" minOccurs="0" maxOccurs="1"/> + <xs:element ref="nmeshpolexp" minOccurs="0" maxOccurs="1"/> + <xs:element ref="npoida" minOccurs="0" maxOccurs="1"/> + <xs:element ref="npoidb" minOccurs="0" maxOccurs="1"/> + <xs:element ref="npoidc" minOccurs="0" maxOccurs="1"/> + <xs:element ref="npoidd" minOccurs="0" maxOccurs="1"/> + <xs:element ref="npoide" minOccurs="0" maxOccurs="1"/> + <xs:element ref="npoidq" minOccurs="0" maxOccurs="1"/> + <xs:element ref="npsi" minOccurs="0" maxOccurs="1"/> + <xs:element ref="ns" minOccurs="0" maxOccurs="1"/> + <xs:element ref="nt" minOccurs="0" maxOccurs="1"/> + <xs:element ref="ntnova" minOccurs="0" maxOccurs="1"/> + <xs:element ref="nv" minOccurs="0" maxOccurs="1"/> + <xs:element ref="nvexp" minOccurs="0" maxOccurs="1"/> + <!-- equilibrium_control parameters --> + <xs:element ref="bsfrac" minOccurs="0" maxOccurs="1"/> + <xs:element ref="cfbal" minOccurs="0" maxOccurs="1"/> + <xs:element ref="cfnress" minOccurs="0" maxOccurs="1"/> + <xs:element ref="cfnresso" minOccurs="0" maxOccurs="1"/> + <xs:element ref="cpress" minOccurs="0" maxOccurs="1"/> + <xs:element ref="cpresso" minOccurs="0" maxOccurs="1"/> + <xs:element ref="cq0" minOccurs="0" maxOccurs="1"/> + <xs:element ref="csspec" minOccurs="0" maxOccurs="1"/> + <xs:element ref="currt" minOccurs="0" maxOccurs="1"/> + <xs:element ref="etaei" minOccurs="0" maxOccurs="1"/> + <xs:element ref="gamma" minOccurs="0" maxOccurs="1"/> + <xs:element ref="pangle" minOccurs="0" maxOccurs="1"/> + <xs:element ref="predge" minOccurs="0" maxOccurs="1"/> + <xs:element ref="psibndexp" minOccurs="0" maxOccurs="1"/> + <xs:element ref="psiscl" minOccurs="0" maxOccurs="1"/> + <xs:element ref="qspec" minOccurs="0" maxOccurs="1"/> + <xs:element ref="rzion" minOccurs="0" maxOccurs="1"/> + <xs:element ref="scalne" minOccurs="0" maxOccurs="1"/> + <xs:element ref="scexp" minOccurs="0" maxOccurs="1"/> + <xs:element ref="nbsfun" minOccurs="0" maxOccurs="1"/> + <xs:element ref="nbsopt" minOccurs="0" maxOccurs="1"/> + <xs:element ref="nbstrp" minOccurs="0" maxOccurs="1"/> + <xs:element ref="nfunrho" minOccurs="0" maxOccurs="1"/> + <xs:element ref="nrhomesh" minOccurs="0" maxOccurs="1"/> + <xs:element ref="nrfp" minOccurs="0" maxOccurs="1"/> + <!-- plasma_boundary parameters --> + <xs:element ref="aspct" minOccurs="0" maxOccurs="1"/> + <xs:element ref="beans" minOccurs="0" maxOccurs="1"/> + <xs:element ref="ceta" minOccurs="0" maxOccurs="1"/> + <xs:element ref="delta" minOccurs="0" maxOccurs="1"/> + <xs:element ref="elong" minOccurs="0" maxOccurs="1"/> + <xs:element ref="rc" minOccurs="0" maxOccurs="1"/> + <xs:element ref="rnu" minOccurs="0" maxOccurs="1"/> + <xs:element ref="rz0" minOccurs="0" maxOccurs="1"/> + <xs:element ref="r0" minOccurs="0" maxOccurs="1"/> + <xs:element ref="sgma" minOccurs="0" maxOccurs="1"/> + <xs:element ref="theta0" minOccurs="0" maxOccurs="1"/> + <xs:element ref="triang" minOccurs="0" maxOccurs="1"/> + <xs:element ref="triplt" minOccurs="0" maxOccurs="1"/> + <xs:element ref="xi" minOccurs="0" maxOccurs="1"/> + <xs:element ref="nsurf" minOccurs="0" maxOccurs="1"/> + <xs:element ref="nsym" minOccurs="0" maxOccurs="1"/> + <!-- profiles parameters --> + <xs:element ref="afbs" minOccurs="0" maxOccurs="1"/> + <xs:element ref="afbs2" minOccurs="0" maxOccurs="1"/> + <xs:element ref="ap" minOccurs="0" maxOccurs="1"/> + <xs:element ref="ap2" minOccurs="0" maxOccurs="1"/> + <xs:element ref="at" minOccurs="0" maxOccurs="1"/> + <xs:element ref="at2" minOccurs="0" maxOccurs="1"/> + <xs:element ref="at3" minOccurs="0" maxOccurs="1"/> + <xs:element ref="at4" minOccurs="0" maxOccurs="1"/> + <xs:element ref="n0jedge" minOccurs="0" maxOccurs="1"/> + <xs:element ref="nfixaxis" minOccurs="0" maxOccurs="1"/> + <xs:element ref="nfunc" minOccurs="0" maxOccurs="1"/> + <xs:element ref="nipr" minOccurs="0" maxOccurs="1"/> + <xs:element ref="npp" minOccurs="0" maxOccurs="1"/> + <xs:element ref="nppfun" minOccurs="0" maxOccurs="1"/> + <xs:element ref="nppr" minOccurs="0" maxOccurs="1"/> + <xs:element ref="nprofz" minOccurs="0" maxOccurs="1"/> + <xs:element ref="nprof2d" minOccurs="0" maxOccurs="1"/> + <xs:element ref="npropt" minOccurs="0" maxOccurs="1"/> + <xs:element ref="nsour" minOccurs="0" maxOccurs="1"/> + <xs:element ref="nsttp" minOccurs="0" maxOccurs="1"/> + <!-- in_out_control parameters --> + <xs:element ref="bentaxis" minOccurs="0" maxOccurs="1"/> + <xs:element ref="bentqprofile" minOccurs="0" maxOccurs="1"/> + <xs:element ref="bentradius" minOccurs="0" maxOccurs="1"/> + <xs:element ref="b0exp" minOccurs="0" maxOccurs="1"/> + <xs:element ref="comments" minOccurs="0" maxOccurs="1"/> + <xs:element ref="rboxlen" minOccurs="0" maxOccurs="1"/> + <xs:element ref="rboxlft" minOccurs="0" maxOccurs="1"/> + <xs:element ref="rext" minOccurs="0" maxOccurs="1"/> + <xs:element ref="rpeop" minOccurs="0" maxOccurs="1"/> + <xs:element ref="rz0w" minOccurs="0" maxOccurs="1"/> + <xs:element ref="r0exp" minOccurs="0" maxOccurs="1"/> + <xs:element ref="r0w" minOccurs="0" maxOccurs="1"/> + <xs:element ref="signb0xp" minOccurs="0" maxOccurs="1"/> + <xs:element ref="signipxp" minOccurs="0" maxOccurs="1"/> + <xs:element ref="slimit" minOccurs="0" maxOccurs="1"/> + <xs:element ref="snumber" minOccurs="0" maxOccurs="1"/> + <xs:element ref="shift_p" minOccurs="0" maxOccurs="1"/> + <xs:element ref="time_ref" minOccurs="0" maxOccurs="1"/> + <xs:element ref="treeitm" minOccurs="0" maxOccurs="1"/> + <xs:element ref="tree_user" minOccurs="0" maxOccurs="1"/> + <xs:element ref="tree_tokamak" minOccurs="0" maxOccurs="1"/> + <xs:element ref="tree_majorversion" minOccurs="0" maxOccurs="1"/> + <xs:element ref="zboxlen" minOccurs="0" maxOccurs="1"/> + <xs:element ref="zboxmid" minOccurs="0" maxOccurs="1"/> + <xs:element ref="nanal" minOccurs="0" maxOccurs="1"/> + <xs:element ref="nbal" minOccurs="0" maxOccurs="1"/> + <xs:element ref="nblc0" minOccurs="0" maxOccurs="1"/> + <xs:element ref="nblopt" minOccurs="0" maxOccurs="1"/> + <xs:element ref="nbpsout" minOccurs="0" maxOccurs="1"/> + <xs:element ref="nbsexpq" minOccurs="0" maxOccurs="1"/> + <xs:element ref="ncscal" minOccurs="0" maxOccurs="1"/> + <xs:element ref="ndiagop" minOccurs="0" maxOccurs="1"/> + <xs:element ref="ndifps" minOccurs="0" maxOccurs="1"/> + <xs:element ref="neonbqs" minOccurs="0" maxOccurs="1"/> + <xs:element ref="neqdsk" minOccurs="0" maxOccurs="1"/> + <xs:element ref="neqdxtpo" minOccurs="0" maxOccurs="1"/> + <xs:element ref="nfftopt" minOccurs="0" maxOccurs="1"/> + <xs:element ref="nideal" minOccurs="0" maxOccurs="1"/> + <xs:element ref="nitmocc" minOccurs="0" maxOccurs="1"/> + <xs:element ref="nitmopt" minOccurs="0" maxOccurs="1"/> + <xs:element ref="nitmrun" minOccurs="0" maxOccurs="1"/> + <xs:element ref="nitmshot" minOccurs="0" maxOccurs="1"/> + <xs:element ref="nidsbound" minOccurs="0" maxOccurs="1"/> + <xs:element ref="nopt" minOccurs="0" maxOccurs="1"/> + <xs:element ref="nplot" minOccurs="0" maxOccurs="1"/> + <xs:element ref="nprpsi" minOccurs="0" maxOccurs="1"/> + <xs:element ref="nrbox" minOccurs="0" maxOccurs="1"/> + <xs:element ref="nrscal" minOccurs="0" maxOccurs="1"/> + <xs:element ref="nsmooth" minOccurs="0" maxOccurs="1"/> + <xs:element ref="ntcase" minOccurs="0" maxOccurs="1"/> + <xs:element ref="ntest" minOccurs="0" maxOccurs="1"/> + <xs:element ref="ntmf0" minOccurs="0" maxOccurs="1"/> + <xs:element ref="nturn" minOccurs="0" maxOccurs="1"/> + <xs:element ref="nzbox" minOccurs="0" maxOccurs="1"/> + <xs:element ref="tensbnd" minOccurs="0" maxOccurs="1"/> + <xs:element ref="tensprof" minOccurs="0" maxOccurs="1"/> +</xs:all> +</xs:complexType> +</xs:element> +<xs:simpleType name="IntegerList"> + <xs:list itemType="xs:integer"/> + </xs:simpleType> +<xs:simpleType name="FloatList"> + <xs:list itemType="xs:float"/> +</xs:simpleType> + <xs:element name="cocos_in"> + <xs:simpleType> + <xs:restriction base="xs:integer"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="cocos_out"> + <xs:simpleType> + <xs:restriction base="xs:integer"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="epslon"> + <xs:simpleType> + <xs:restriction base="xs:float"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="relax"> + <xs:simpleType> + <xs:restriction base="xs:float"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="ninmap"> + <xs:simpleType> + <xs:restriction base="xs:integer"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="ninsca"> + <xs:simpleType> + <xs:restriction base="xs:integer"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="nmgaus"> + <xs:simpleType> + <xs:restriction base="xs:integer"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="nsgaus"> + <xs:simpleType> + <xs:restriction base="xs:integer"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="ntgaus"> + <xs:simpleType> + <xs:restriction base="xs:integer"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="nverbose"> + <xs:simpleType> + <xs:restriction base="xs:integer"> + </xs:restriction> + </xs:simpleType> + </xs:element> + + <!-- meshes parameters --> + <xs:element name="aplace" type="FloatList"/> + <xs:element name="awidth" type="FloatList"/> + <xs:element name="bplace" type="FloatList"/> + <xs:element name="bwidth" type="FloatList"/> + <xs:element name="cplace" type="FloatList"/> + <xs:element name="cwidth" type="FloatList"/> + <xs:element name="dplace" type="FloatList"/> + <xs:element name="dwidth" type="FloatList"/> + <xs:element name="eplace" type="FloatList"/> + <xs:element name="ewidth" type="FloatList"/> + <xs:element name="qplace" type="FloatList"/> + <xs:element name="qvalneo" type="FloatList"/> + <xs:element name="qwidth" type="FloatList"/> + <xs:element name="solpda"> + <xs:simpleType> + <xs:restriction base="xs:float"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="solpdb"> + <xs:simpleType> + <xs:restriction base="xs:float"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="solpdc"> + <xs:simpleType> + <xs:restriction base="xs:float"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="solpdd"> + <xs:simpleType> + <xs:restriction base="xs:float"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="solpde"> + <xs:simpleType> + <xs:restriction base="xs:float"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="solpdpol"> + <xs:simpleType> + <xs:restriction base="xs:float"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="msmax"> + <xs:simpleType> + <xs:restriction base="xs:integer"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="nchi"> + <xs:simpleType> + <xs:restriction base="xs:integer"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="ndift"> + <xs:simpleType> + <xs:restriction base="xs:integer"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="negp"> + <xs:simpleType> + <xs:restriction base="xs:integer"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="ner"> + <xs:simpleType> + <xs:restriction base="xs:integer"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="niso"> + <xs:simpleType> + <xs:restriction base="xs:integer"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="nmesha"> + <xs:simpleType> + <xs:restriction base="xs:integer"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="nmeshb"> + <xs:simpleType> + <xs:restriction base="xs:integer"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="nmeshc"> + <xs:simpleType> + <xs:restriction base="xs:integer"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="nmeshd"> + <xs:simpleType> + <xs:restriction base="xs:integer"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="nmeshe"> + <xs:simpleType> + <xs:restriction base="xs:integer"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="nmeshpol"> + <xs:simpleType> + <xs:restriction base="xs:integer"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="nmeshpolexp"> + <xs:simpleType> + <xs:restriction base="xs:integer"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="npoida"> + <xs:simpleType> + <xs:restriction base="xs:integer"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="npoidb"> + <xs:simpleType> + <xs:restriction base="xs:integer"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="npoidc"> + <xs:simpleType> + <xs:restriction base="xs:integer"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="npoidd"> + <xs:simpleType> + <xs:restriction base="xs:integer"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="npoide"> + <xs:simpleType> + <xs:restriction base="xs:integer"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="npoidq"> + <xs:simpleType> + <xs:restriction base="xs:integer"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="npsi"> + <xs:simpleType> + <xs:restriction base="xs:integer"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="ns"> + <xs:simpleType> + <xs:restriction base="xs:integer"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="nt"> + <xs:simpleType> + <xs:restriction base="xs:integer"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="ntnova"> + <xs:simpleType> + <xs:restriction base="xs:integer"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="nv"> + <xs:simpleType> + <xs:restriction base="xs:integer"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="nvexp"> + <xs:simpleType> + <xs:restriction base="xs:integer"> + </xs:restriction> + </xs:simpleType> + </xs:element> + +<!-- equilibrium_control parameters --> + <xs:element name="bsfrac"> + <xs:simpleType> + <xs:restriction base="xs:float"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="cfbal"> + <xs:simpleType> + <xs:restriction base="xs:float"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="cfnress"> + <xs:simpleType> + <xs:restriction base="xs:float"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="cfnresso"> + <xs:simpleType> + <xs:restriction base="xs:float"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="cpress"> + <xs:simpleType> + <xs:restriction base="xs:float"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="cpresso"> + <xs:simpleType> + <xs:restriction base="xs:float"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="cq0"> + <xs:simpleType> + <xs:restriction base="xs:float"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="csspec"> + <xs:simpleType> + <xs:restriction base="xs:float"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="currt"> + <xs:simpleType> + <xs:restriction base="xs:float"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="etaei"> + <xs:simpleType> + <xs:restriction base="xs:float"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="gamma"> + <xs:simpleType> + <xs:restriction base="xs:float"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="pangle"> + <xs:simpleType> + <xs:restriction base="xs:float"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="predge"> + <xs:simpleType> + <xs:restriction base="xs:float"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="psibndexp"> + <xs:simpleType> + <xs:restriction base="xs:float"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="psiscl"> + <xs:simpleType> + <xs:restriction base="xs:float"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="qspec"> + <xs:simpleType> + <xs:restriction base="xs:float"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="rzion"> + <xs:simpleType> + <xs:restriction base="xs:float"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="scalne"> + <xs:simpleType> + <xs:restriction base="xs:float"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="scexp"> + <xs:simpleType> + <xs:restriction base="xs:float"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="nbsfun"> + <xs:simpleType> + <xs:restriction base="xs:integer"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="nbsopt"> + <xs:simpleType> + <xs:restriction base="xs:integer"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="nbstrp"> + <xs:simpleType> + <xs:restriction base="xs:integer"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="nfunrho"> + <xs:simpleType> + <xs:restriction base="xs:integer"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="nrhomesh"> + <xs:simpleType> + <xs:restriction base="xs:integer"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="nrfp"> + <xs:simpleType> + <xs:restriction base="xs:integer"> + </xs:restriction> + </xs:simpleType> + </xs:element> + +<!-- plasma_boundary parameters --> + <xs:element name="aspct"> + <xs:simpleType> + <xs:restriction base="xs:float"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="beans"> + <xs:simpleType> + <xs:restriction base="xs:float"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="ceta"> + <xs:simpleType> + <xs:restriction base="xs:float"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="delta"> + <xs:simpleType> + <xs:restriction base="xs:float"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="elong"> + <xs:simpleType> + <xs:restriction base="xs:float"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="rc"> + <xs:simpleType> + <xs:restriction base="xs:float"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="rnu"> + <xs:simpleType> + <xs:restriction base="xs:float"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="rz0"> + <xs:simpleType> + <xs:restriction base="xs:float"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="r0"> + <xs:simpleType> + <xs:restriction base="xs:float"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="sgma"> + <xs:simpleType> + <xs:restriction base="xs:float"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="theta0"> + <xs:simpleType> + <xs:restriction base="xs:float"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="triang"> + <xs:simpleType> + <xs:restriction base="xs:float"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="triplt"> + <xs:simpleType> + <xs:restriction base="xs:float"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="xi"> + <xs:simpleType> + <xs:restriction base="xs:float"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="nsurf"> + <xs:simpleType> + <xs:restriction base="xs:integer"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="nsym"> + <xs:simpleType> + <xs:restriction base="xs:integer"> + </xs:restriction> + </xs:simpleType> + </xs:element> + + <!-- profiles parameters --> + <xs:element name="afbs" type="FloatList"/> + <xs:element name="afbs2" type="FloatList"/> + <xs:element name="ap" type="FloatList"/> + <xs:element name="ap2" type="FloatList"/> + <xs:element name="at" type="FloatList"/> + <xs:element name="at2" type="FloatList"/> + <xs:element name="at3" type="FloatList"/> + <xs:element name="at4" type="FloatList"/> + <xs:element name="nfixaxis"> + <xs:simpleType> + <xs:restriction base="xs:integer"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="n0jedge"> + <xs:simpleType> + <xs:restriction base="xs:integer"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="nfunc"> + <xs:simpleType> + <xs:restriction base="xs:integer"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="nipr"> + <xs:simpleType> + <xs:restriction base="xs:integer"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="npp"> + <xs:simpleType> + <xs:restriction base="xs:integer"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="nppfun"> + <xs:simpleType> + <xs:restriction base="xs:integer"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="nppr"> + <xs:simpleType> + <xs:restriction base="xs:integer"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="nprofz"> + <xs:simpleType> + <xs:restriction base="xs:integer"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="nprof2d"> + <xs:simpleType> + <xs:restriction base="xs:integer"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="npropt"> + <xs:simpleType> + <xs:restriction base="xs:integer"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="nsour"> + <xs:simpleType> + <xs:restriction base="xs:integer"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="nsttp"> + <xs:simpleType> + <xs:restriction base="xs:integer"> + </xs:restriction> + </xs:simpleType> + </xs:element> + +<!-- in_out_control parameters --> + <xs:element name="bentaxis"> + <xs:simpleType> + <xs:restriction base="xs:float"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="bentqprofile"> + <xs:simpleType> + <xs:restriction base="xs:float"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="bentradius"> + <xs:simpleType> + <xs:restriction base="xs:float"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="b0exp"> + <xs:simpleType> + <xs:restriction base="xs:float"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="comments"> + <xs:simpleType> + <xs:restriction base="xs:string"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="rboxlen"> + <xs:simpleType> + <xs:restriction base="xs:float"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="rboxlft"> + <xs:simpleType> + <xs:restriction base="xs:float"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="rext"> + <xs:simpleType> + <xs:restriction base="xs:float"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="rpeop"> + <xs:simpleType> + <xs:restriction base="xs:float"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="rz0w"> + <xs:simpleType> + <xs:restriction base="xs:float"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="r0exp"> + <xs:simpleType> + <xs:restriction base="xs:float"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="r0w"> + <xs:simpleType> + <xs:restriction base="xs:float"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="signb0xp"> + <xs:simpleType> + <xs:restriction base="xs:float"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="signipxp"> + <xs:simpleType> + <xs:restriction base="xs:float"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="slimit"> + <xs:simpleType> + <xs:restriction base="xs:float"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="snumber"> + <xs:simpleType> + <xs:restriction base="xs:float"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="shift_p"> + <xs:simpleType> + <xs:restriction base="xs:float"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="time_ref"> + <xs:simpleType> + <xs:restriction base="xs:float"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="treeitm"> + <xs:simpleType> + <xs:restriction base="xs:string"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="tree_user"> + <xs:simpleType> + <xs:restriction base="xs:string"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="tree_tokamak"> + <xs:simpleType> + <xs:restriction base="xs:string"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="tree_majorversion"> + <xs:simpleType> + <xs:restriction base="xs:string"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="zboxlen"> + <xs:simpleType> + <xs:restriction base="xs:float"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="zboxmid"> + <xs:simpleType> + <xs:restriction base="xs:float"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="nanal"> + <xs:simpleType> + <xs:restriction base="xs:integer"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="nbal"> + <xs:simpleType> + <xs:restriction base="xs:integer"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="nblc0"> + <xs:simpleType> + <xs:restriction base="xs:integer"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="nblopt"> + <xs:simpleType> + <xs:restriction base="xs:integer"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="nbpsout"> + <xs:simpleType> + <xs:restriction base="xs:integer"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="nbsexpq"> + <xs:simpleType> + <xs:restriction base="xs:integer"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="ncscal"> + <xs:simpleType> + <xs:restriction base="xs:integer"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="ndiagop"> + <xs:simpleType> + <xs:restriction base="xs:integer"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="ndifps"> + <xs:simpleType> + <xs:restriction base="xs:integer"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="neonbqs"> + <xs:simpleType> + <xs:restriction base="xs:integer"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="neqdsk"> + <xs:simpleType> + <xs:restriction base="xs:integer"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="neqdxtpo"> + <xs:simpleType> + <xs:restriction base="xs:integer"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="nfftopt"> + <xs:simpleType> + <xs:restriction base="xs:integer"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="nideal"> + <xs:simpleType> + <xs:restriction base="xs:integer"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="nitmopt"> + <xs:simpleType> + <xs:restriction base="xs:integer"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="nidsbound"> + <xs:simpleType> + <xs:restriction base="xs:integer"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="nitmshot" type="IntegerList"/> + <xs:element name="nitmrun" type="IntegerList"/> + <xs:element name="nitmocc" type="IntegerList"/> + <xs:element name="nopt"> + <xs:simpleType> + <xs:restriction base="xs:integer"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="nplot"> + <xs:simpleType> + <xs:restriction base="xs:integer"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="nprpsi"> + <xs:simpleType> + <xs:restriction base="xs:integer"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="nrbox"> + <xs:simpleType> + <xs:restriction base="xs:integer"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="nrscal"> + <xs:simpleType> + <xs:restriction base="xs:integer"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="nsmooth"> + <xs:simpleType> + <xs:restriction base="xs:integer"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="ntcase"> + <xs:simpleType> + <xs:restriction base="xs:integer"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="ntest"> + <xs:simpleType> + <xs:restriction base="xs:integer"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="ntmf0"> + <xs:simpleType> + <xs:restriction base="xs:integer"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="nturn"> + <xs:simpleType> + <xs:restriction base="xs:integer"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="nzbox"> + <xs:simpleType> + <xs:restriction base="xs:integer"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="tensbnd"> + <xs:simpleType> + <xs:restriction base="xs:float"> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="tensprof"> + <xs:simpleType> + <xs:restriction base="xs:float"> + </xs:restriction> + </xs:simpleType> + </xs:element> +</xs:schema> diff --git a/python/eq_boundary.py b/python/eq_boundary.py new file mode 100755 index 0000000000000000000000000000000000000000..1ea29879b082792d1226e19dcf548592f0d4f399 --- /dev/null +++ b/python/eq_boundary.py @@ -0,0 +1,117 @@ +#!/usr/bin/env python +import numpy as np +import matplotlib.pyplot as plt +import argparse + +def delta_loc_def(eps=0.3, R0=1., R_max=1.3): + a = R0 * eps + return (R0 - R_max) / a + +def delta_loc_get(r, z, eps, verbose=False): + Zmin_ind = np.argmin(z) + Zmax_ind = np.argmax(z) + R_zmin = r[Zmin_ind] + R_zmax = r[Zmax_ind] + delta_u_def = delta_loc_def(eps=eps, R0=1., R_max=R_zmax) + delta_l_def = delta_loc_def(eps=eps, R0=1., R_max=R_zmin) + if verbose: + print(f"'local' delta_l = {delta_l_def}") + print(f"'local' delta_u = {delta_u_def}") + return delta_l_def, delta_u_def + +def rz_1(theta, eps=0.3, kappa=1.5, delta=0.6, xi=0.1): + r_1 = 1. + eps * np.cos(theta+delta * np.sin(theta) - xi * np.sin(2*theta)) + z_1 = 0.0 + kappa * eps * np.sin(theta+xi * np.sin(2 * theta)) + return r_1, z_1 + +def get_rz(theta, eps=0.3, kappa_l=0.1, kappa_u=0.1, delta_l=0.1, delta_u=0.1, xi_l=0.0, xi_u=0.0): + r1, z1 = rz_1(theta[theta < np.pi], eps=eps, delta=delta_u, kappa=kappa_u, xi=xi_u) + r2, z2 = rz_1(theta[theta >= np.pi], eps=eps, delta=delta_l, kappa=kappa_l, xi=xi_l) + r = np.append(r1, r2) + z = np.append(z1, z2) + return r, z + +def plot_params(theta, eps=0.3, kappa_l=1.1, kappa_u=1.0, delta_l=0.0, + delta_u=0.0, xi_l=0.0, xi_u=0.0, nest=False, verbose=True, + ax=None): + if ax is None: + fig, ax = plt.subplots() + + if not nest: + eps_list = [eps] + else: + eps_list = np.linspace(0.0, eps, 11)[1:] + + for ieps, eps_val in enumerate(eps_list[::-1]): + r, z = get_rz(theta, eps=eps_val, + kappa_l=kappa_l, kappa_u=kappa_u, + delta_l=delta_l, delta_u=delta_u, + xi_l=xi_l, xi_u=xi_u) + ax.plot(r, z) + if ieps == 0: + if r.min() < ax.get_xlim()[0] or r.max() > ax.get_xlim()[1]: + ax.set_xlim([r.min()-0.1, r.max()+0.1]) + if z.min() < ax.get_ylim()[0] or z.max() > ax.get_ylim()[1]: + ax.set_ylim([z.min()-0.1, z.max()+0.1]) + if verbose: + delta_loc_l, delta_loc_u = delta_loc_get(r, z, eps) + print(f"'local' delta_l = {delta_loc_l}") + print(f"'local' delta_u = {delta_loc_u}") + return ax + + +if __name__ == "__main__": + parser = argparse.ArgumentParser(description="Tool for parameterized descriptions of plasma equilibrium boundary") + parser.add_argument("-eps", type=float, default=0.1, help="Aspect ratio") + parser.add_argument("-kappa", type=float, default=1., help="Elongation (if not both of kappa_l or kappa_u are provided") + parser.add_argument("-kappa_l", type=float, help="Lower elongation (kappa_u must also be provided)") + parser.add_argument("-kappa_u", type=float, help="Upper elongation (kappa_l must also be provided)") + parser.add_argument("-delta", type=float, default=0., help="Triangularity (if not both of delta_l or delta_u are provided") + parser.add_argument("-delta_l", type=float, help="Lower triangularity (delta_u must also be provided)") + parser.add_argument("-delta_u", type=float, help="Upper triangularity (delta_l must also be provided)") + parser.add_argument("-xi", type=float, default=0., help="Squareness (if not both of xi_l or xi_u are provided") + parser.add_argument("-xi_l", type=float, help="Lower squareness (xi_u must also be provided)") + parser.add_argument("-xi_u", type=float, help="Upper squareness (xi_l must also be provided)") + parser.add_argument("-nest", type=int, default=1, help="Whether to plot multiple nested surfaces when plotting eq.") + args = parser.parse_args() + + if args.kappa_l is None or args.kappa_u is None: + if (args.kappa_l is None) ^ (args.kappa_u is None): + print(f"One of kappa_l, kappa_u not provided, taking kappa_{{l,u}}={args.kappa}") + kappa_l = args.kappa + kappa_u = args.kappa + else: + kappa_l = args.kappa_l + kappa_u = args.kappa_u + + if args.delta_l is None or args.delta_u is None: + if (args.delta_l is None) ^ (args.delta_u is None): + print(f"One of delta_l, delta_u not provided, taking delta_{{l,u}}={args.delta}") + delta_l = args.delta + delta_u = args.delta + else: + delta_l = args.delta_l + delta_u = args.delta_u + + if args.xi_l is None or args.xi_u is None: + if (args.xi_l is None) ^ (args.xi_u is None): + print(f"One of xi_l, xi_u not provided, taking xi_{{l,u}}={args.xi}") + xi_l = args.xi + xi_u = args.xi + else: + xi_l = args.xi_l + xi_u = args.xi_u + + eps = args.eps + + fig, ax = plt.subplots() + theta = np.linspace(0, 2.0*np.pi, 1001) + _ = plot_params(theta, eps=eps, + delta_l=delta_l, delta_u=delta_u, + kappa_l=kappa_l, kappa_u=kappa_u, + xi_l=xi_l, xi_u=xi_u, + nest=args.nest, ax=ax) + ax.set_aspect(1.0) + ax.set_xlabel("R") + ax.set_ylabel("Z") + plt.show() diff --git a/python/plot_expeq.py b/python/plot_expeq.py new file mode 100755 index 0000000000000000000000000000000000000000..e540d5a7a09f9bc7f7aa18ad4e11e9f68ef9cf92 --- /dev/null +++ b/python/plot_expeq.py @@ -0,0 +1,355 @@ +#!/usr/bin/env python +import numpy as np +import matplotlib_interactive +DEFAULT_INTERACTIVE = matplotlib_interactive.DEFAULT_INTERACTIVE +import matplotlib.pyplot as plt +import argparse +import os.path +try: + from scipy.optimize import curve_fit, minimize + HAVE_SCIPY = True +except ImportError: + HAVE_SCIPY = False + +from chease_hdf5 import interactive_show_or_save, interactive_hold_and_save +import eq_boundary + +# Dicts for the NPPFUN and NSTTP labels +NPPFUN_LABEL_DICT = { + 4: 'pprime', + 8: 'pressure', +} +NSTTP_LABEL_DICT = { + 1: "TT'", + 2: "$I^*$", + 3: "$I_{||}$", + 4: "$J_{||}$", + 5: 'q', +} +NRHOTYPE_LABEL_DICT = { + 0: r"\rho_{\psi}", + 1: r"\rho_{tor}", +} + +def read_field(fileobj, nlines): + tmp = [] + for _ in range(nlines): + tmp.append(fileobj.readline()) + ncols = len(tmp[0].split()) + if ncols > 1: + array = np.array([[float(i) for i in line.split()] for line in tmp]) + else: + array = np.array([float(i) for line in tmp for i in line.split()]) + return array + +def read_scalar(fileobj, scalar_type=float): + line = fileobj.readline() + return scalar_type(line.split()[0]) + +def read_expeq(filename="EXPEQ"): + """ + Read an EXPEQ file and return a struct. + N.B. some of the field labels are either placeholders, or are incorrect for some options. + """ + expeq_str = {} + with open(filename, "r") as expeq: + expeq_str["aspect_ratio"] = read_scalar(expeq, float) + expeq_str["rz0c"] = read_scalar(expeq, float) + expeq_str["pedge"] = read_scalar(expeq, float) + expeq_str["nbps"] = read_scalar(expeq, int) + expeq_str["boundary"] = read_field(expeq, expeq_str["nbps"]) + expeq_str["npsi"], expeq_str["nppfun"] = [int(x) for x in expeq.readline().split()] + expeq_str["nsttp"], expeq_str["nrhotype"] = [int(x) for x in expeq.readline().split()] + expeq_str["psi"] = read_field(expeq, expeq_str["npsi"]) + expeq_str["pressure"] = read_field(expeq, expeq_str["npsi"]) + expeq_str["q"] = read_field(expeq, expeq_str["npsi"]) + footer = [] + while True: + line = expeq.readline() + if line == "": + break + footer.append(line) + expeq_str["footer"] = footer + return expeq_str + +def write_expeq(expeq_str, filename="EXPEQ_out"): + """ + Write an EXPEQ file given a struct. + N.B. some of the field labels are either placeholders, or are incorrect for some options. + """ + with open(filename, "w") as expeq: + expeq.write(str(expeq_str["aspect_ratio"]) + "\n") + expeq.write(str(expeq_str["rz0c"]) + "\n") + expeq.write(str(expeq_str["pedge"]) + "\n") + expeq.write(str(expeq_str["nbps"]) + "\n") + for x, y in expeq_str["boundary"]: + expeq.write(f"{x} {y}\n") + expeq.write(f"{expeq_str['npsi']} {expeq_str['nppfun']}\n") + expeq.write(f"{expeq_str['nsttp']} {expeq_str['nrhotype']}\n") + for psival in expeq_str["psi"]: + expeq.write(f"{psival}\n") + for pressureval in expeq_str["pressure"]: + expeq.write(f"{pressureval}\n") + for qval in expeq_str["q"]: + expeq.write(f"{qval}\n") + for line in expeq_str["footer"]: + expeq.write(line) + +def test_plot(expeq, show=True): + fig, ax = plt.subplots() + ax.plot(expeq["boundary"][:,0], expeq["boundary"][:,1]) + ax.set_aspect(1.) + fig, ax = plt.subplots() + ax.plot(np.sqrt(expeq["psi"]), expeq["q"]) + fig, ax = plt.subplots() + ax.plot(np.sqrt(expeq["psi"]), expeq["pressure"]) + print(expeq["pressure"][0]) + if show: + plt.show(block=True) + +def fit(boundary, eps, z0=0., guess=None, plot=False, do_rz_simul=True, do_rz_stagger=False): + """ + Given a prescribed boundary, fit the parameters of our analytical function to the boundary. + """ + if not HAVE_SCIPY: + raise NotImplementedError + if not (do_rz_simul + do_rz_stagger): + print("At least one of do_rz_simul or do_rz_stagger must be true") + raise ValueError + + theta = np.linspace(0.0, 2.0*np.pi, boundary.shape[0]) + r_orig = boundary[:,0] + z_orig = boundary[:,1] - z0 + + if guess is None: + popt = [1., 1., 0.0, 0.0, 0.0, 0.0] + else: + popt = guess + + if plot: + fig, ax = plt.subplots() + ax.plot(r_orig, z_orig + z0, 'k-') + + def target_func(theta, *x): + kl, ku, dl, du, xl, xu = x + r_fit, z_fit = eq_boundary.get_rz( + theta, eps=eps, + kappa_l=kl, kappa_u=ku, + delta_l=dl, delta_u=du, + xi_l=xl, xi_u=xu, + ) + return r_fit, z_fit + + if do_rz_stagger: + def target_func_r(theta, kl, ku, dl, du, xl, xu): + return eq_boundary.get_rz(theta, eps=eps, + kappa_l=kl, kappa_u=ku, + delta_l=dl, delta_u=du, + xi_l=xl, xi_u=xu, + )[0] + def target_func_z(theta, kl, ku, dl, du, xl, xu): + return eq_boundary.get_rz(theta, eps=eps, + kappa_l=kl, kappa_u=ku, + delta_l=dl, delta_u=du, + xi_l=xl, xi_u=xu, + )[1] + + # Here we iterate between optimizing for R and optimizing for Z + for _ in range(100): + p0 = popt + popt, pcov = curve_fit(target_func_r, theta, r_orig, p0) + p0 = popt + popt, pcov = curve_fit(target_func_z, theta, z_orig, p0) + print(popt) + if plot: + r_fit_2, z_fit_2 = target_func(theta, *popt) + ax.plot(r_fit_2, z_fit_2 + z0, 'b-.') + + if do_rz_simul: + # Here we solve R and Z simultaneously + # Start from the previous answer if we did the previous minimization + + def cost_function(params, theta, data): + rdata, zdata = data + r_fit, z_fit = target_func(theta, *params) + return np.sum((r_fit - r_orig)**2 + (z_fit - z_orig)**2) + + data = [r_orig, z_orig] + a = minimize(cost_function, popt, args=(theta, data)) + r_fit, z_fit = target_func(theta, *a.x) + print(a.x) + if plot: + ax.plot(r_fit, z_fit + z0, 'r--') + popt = a.x + + if plot: + ax.plot([1.0], [z0], 'k+') + plt.show() + return popt + +def test(): + expeq = read_expeq() + fit(expeq["boundary"], expeq["aspect_ratio"], plot=True, z0=expeq["rz0c"], do_rz_stagger=True) + test_plot(expeq) + write_expeq(expeq, filename="EXPEQ_test") + +def replace(args): + """ + Replace the boundary in an EXPEQ file. + EQ Values are taken from the command line arguments. + Default EQ parameters are taken by fitting the boundary in the existing EXPEQ file. + + The directory, as well as the input and output filenames can be controlled via command line options. + """ + if args.kappa_l is None and args.kappa_u is None: + kappa_l = args.kappa + kappa_u = args.kappa + else: + kappa_l = args.kappa_l + kappa_u = args.kappa_u + + if args.delta_l is None and args.delta_u is None: + delta_l = args.delta + delta_u = args.delta + else: + delta_l = args.delta_l + delta_u = args.delta_u + + if args.xi_l is None and args.xi_u is None: + xi_l = args.xi + xi_u = args.xi + else: + xi_l = args.xi_l + xi_u = args.xi_u + + expeq = read_expeq(filename=os.path.join(args.directory, args.filename)) + + if args.eps is None: + eps = expeq["aspect_ratio"] + + if kappa_l is None or kappa_u is None or delta_l is None or delta_u is None or xi_l is None or xi_u is None: + if args.plot_boundary: + plt.plot(expeq["boundary"][:,0], expeq["boundary"][:,1], 'k-') + fit_params = fit( + expeq["boundary"], + expeq["aspect_ratio"], + z0=expeq["rz0c"], + plot=args.plot_boundary + ) + if kappa_l is None: + kappa_l = fit_params[0] + print(f"{kappa_l=}") + if kappa_u is None: + kappa_u = fit_params[1] + print(f"{kappa_u=}") + if delta_l is None: + delta_l = fit_params[2] + print(f"{delta_l=}") + if delta_u is None: + delta_u = fit_params[3] + print(f"{delta_u=}") + if xi_l is None: + xi_l = fit_params[4] + print(f"{xi_l=}") + if xi_u is None: + xi_u = fit_params[5] + print(f"{xi_u=}") + + theta = np.linspace(0.0, 2.0*np.pi, expeq["nbps"], endpoint=True) + r, z = eq_boundary.get_rz( + theta, eps=eps, + kappa_l=kappa_l, kappa_u=kappa_u, + delta_l=delta_l, delta_u=delta_u, + xi_l=xi_l, xi_u=xi_u + ) + # Re-add the Z0 offset + z = z[:] + expeq["rz0c"] + if args.plot_boundary: + plt.plot(r, z) + plt.plot([1.0], [expeq["rz0c"]], '+') + plt.gca().set_aspect(1.) + plt.show() + expeq["boundary"][:,0] = r[:] + expeq["boundary"][:,1] = z[:] + + if args.filename_out is None: + filename = "EXPEQ_OUT" + else: + filename = args.filename_out + write_expeq(expeq, filename=os.path.join(args.directory, filename)) + + +def plot_expeq(expeq=None, filename='EXPEQ', directory='.', interactivePlots=False): + """ + Given a filename or expeq dict, plot the contents of the EXPEQ file (boundary + two profiles). + """ + figlist = [] + + if expeq is None: + expeq = read_expeq(os.path.join(directory, filename)) + + fig, ax = plt.subplots() + ax.plot(expeq["boundary"][:,0], expeq["boundary"][:,1]) + ax.set_aspect(1.) + plot_filename = "expeq_boundary.pdf" + interactive_show_or_save(fig, plot_filename, figlist, interactivePlots) + + + fig, ax = plt.subplots() + c = next(ax._get_lines.prop_cycler)['color'] + label = NPPFUN_LABEL_DICT.get(expeq["nppfun"]) + ax.plot(expeq["psi"], expeq["pressure"], color=c, label=label) + c = next(ax._get_lines.prop_cycler)['color'] + + ax2 = ax.twinx() + label = NSTTP_LABEL_DICT.get(expeq["nsttp"]) + ax.plot([], [], label=label, color=c) + ax2.plot(expeq["psi"], expeq["q"], color=c) + ax.legend() + + # Set xlabel depending on nrhotype + ax.set_xlabel(f"${NRHOTYPE_LABEL_DICT.get(expeq['nrhotype'])}$") + plt.show() + + plot_filename = "expeq_profs.pdf" + interactive_show_or_save(fig, plot_filename, figlist, interactivePlots) + + interactive_hold_and_save(figlist) + + +def main(): + parser = argparse.ArgumentParser(description="Tool for plotting and manipulating EXPEQ equilibrium files") + parser.add_argument("-directory", type=str, default=".", help="Directory of the input/output EXPEQ file(s)") + parser.add_argument("-filename", type=str, default="EXPEQ", help="Filename of the input EXPEQ file") + parser.add_argument("-filename_out", type=str, help="Filename of the output EXPEQ file") + parser.add_argument("-eps", type=float, default=0.1, help="Aspect ratio") + parser.add_argument("-kappa", type=float, default=1., help="Elongation (if neither of kappa_l or kappa_u are provided") + parser.add_argument("-kappa_l", type=float, help="Lower elongation") + parser.add_argument("-kappa_u", type=float, help="Upper elongation") + parser.add_argument("-delta", type=float, default=0., help="Triangularity (if neither of delta_l or delta_u are provided") + parser.add_argument("-delta_l", type=float, help="Lower triangularity") + parser.add_argument("-delta_u", type=float, help="Upper triangularity") + parser.add_argument("-xi", type=float, default=0., help="Squareness (if neither of xi_l or xi_u are provided") + parser.add_argument("-xi_l", type=float, help="Lower squareness") + parser.add_argument("-xi_u", type=float, help="Upper squareness") + parser.add_argument("-plot_boundary", type=int, default=0, help="Whether to plot the boundary when doing a boundary replacement") + parser.add_argument("-test", type=int, default=0, help="Test the code. Will read a file EXPEQ and write a file EXPEQ_test") + parser.add_argument("-fit", type=int, default=0, help="Whether to fit an analytical approximation to the boundary (experimental)") + parser.add_argument("-replace", type=int, default=0, help="Whether to replace the EXPEQ boundary with parameters/fitted values)") + parser.add_argument("-plot", type=int, default=0, help="Whether to plot the EXPEQ file") + parser.add_argument("-interactivePlots", type=int, default=0, help="If plots should be interactive or saved") + args = parser.parse_args() + + if args.test: + test() + return + + if args.replace: + replace(args) + + if args.plot: + plot_expeq(filename=args.filename, directory=args.directory, interactivePlots=args.interactivePlots) + + +if __name__ == "__main__": + main() diff --git a/python/run_chease.py b/python/run_chease.py index a76a1ce220c4e38e58a953ac4099f2689e38e98f..27b5fbf5357df1ab31ab06a9d7597aa37e7fa1c0 100644 --- a/python/run_chease.py +++ b/python/run_chease.py @@ -88,6 +88,3 @@ for itime in range(ntime): input.close() output.close() print('Done.') - - - diff --git a/python/run_chease_iwrap.py b/python/run_chease_iwrap_choices.py similarity index 52% rename from python/run_chease_iwrap.py rename to python/run_chease_iwrap_choices.py index d712239d1ebfa39d89900098d123714548a24439..2b74eebac3f13eb7599222b22122f46ab902178d 100644 --- a/python/run_chease_iwrap.py +++ b/python/run_chease_iwrap_choices.py @@ -2,40 +2,60 @@ # PYTHON SCRIPT TO CALL CHEASE # ----------------------------- -# export PYTHONPATH=~/public/PYTHON_ACTORS:$PYTHONPATH +# export PYTHONPATH=~/public/PYTHON_ACTORS/chease:$PYTHONPATH # NEEDED MODULES import os,imas,yaml import numpy as np -from chease.actor import chease as chease_actor -curdir = os.getenv('PWD') -run_py_dir = os.path.dirname(os.path.realpath(__file__)) -input_chease = run_py_dir + "/../input/chease_input_choices.xml" - -chease = chease_actor() -code_parameters = chease.get_code_parameters() -code_parameters.parameters_path = input_chease -chease.initialize() +path_file = os.path.dirname(os.path.abspath(__file__)) +current_file=os.path.join(path_file,'../input/scenario.yaml') +print('code_parameters.parameters_path = ',path_file) # INPUT/OUTPUT CONFIGURATION -input_scenario = run_py_dir + "/../input/scenario.yaml" -file = open(input_scenario, 'r') -config = yaml.load(file,Loader=yaml.CLoader) +file = open(current_file, 'r') +cc = yaml.load(file,Loader=yaml.CLoader) file.close() -shot = config['shot'] -run_in = config['run_in'] -input_user_or_path = config['input_user_or_path'] -input_database = config['input_database'] -if config['output_user_or_path'] == 'default': +if cc['output_user_or_path'] == 'default': output_user_or_path = os.getenv('USER') else: - output_user_or_path = config['output_user_or_path'] -output_database = config['output_database'] -run_out = config['run_out'] -dt_required = config['dt_required'] -time_slice = config['time_slice'] -ntimes = config['ntimes'] + output_user_or_path = cc['output_user_or_path'] + +if cc['output_tmp_folder'] == 'default': + output_tmp_folder = '/tmp/'+os.getenv('USER') + os.system('mkdir -p '+output_tmp_folder) +else: + output_tmp_folder = cc['output_tmp_folder'] + +current_folder = os.getcwd() +os.chdir(output_tmp_folder) + +if cc['scenario_backend'] == 'hdf5': + sc_backend = imas.imasdef.HDF5_BACKEND +else: + sc_backend = imas.imasdef.MDSPLUS_BACKEND + +if cc['output_backend'] == 'hdf5': + out_backend = imas.imasdef.HDF5_BACKEND +else: + out_backend = imas.imasdef.MDSPLUS_BACKEND + +# CHEASE INITIALISATION +from chease.actor import chease as chease_actor +chease = chease_actor() +code_parameters = chease.get_code_parameters() +code_parameters.parameters_path = os.path.join(path_file,'../input/chease_input_choices.xml') +print('code_parameters.parameters_path = ',path_file) +runtime_settings = chease.get_runtime_settings() +if cc['debug'] == 1: + from chease.common.runtime_settings import DebugMode + runtime_settings.debug_mode = DebugMode.STANDALONE +if cc['sandbox_manual'] == 1: + from chease.common.runtime_settings import SandboxLifeTime, SandboxMode + runtime_settings.sandbox.life_time = SandboxLifeTime.PERSISTENT + runtime_settings.sandbox.mode = SandboxMode.MANUAL + runtime_settings.sandbox.path = os.getcwd() +chease.initialize(code_parameters=code_parameters,runtime_settings=runtime_settings) # TO SUPPRESS THE ACCESS LAYER WARNINGS ABOUT OBSOLETE DATA import logging @@ -44,16 +64,16 @@ log.setLevel(logging.ERROR) # DISPLAY SIMULATION INFORMATION print('---------------------------------') -print('shot = ',shot) -print('run_in = ',run_in) -print('run_out = ',run_out) -print('input_user_or_path = ',input_user_or_path) -print('input_database = ',input_database) +print('shot = ',cc['shot']) +print('run_in = ',cc['run_in']) +print('run_out = ',cc['run_out']) +print('input_user_or_path = ',cc['input_user_or_path']) +print('input_database = ',cc['input_database']) print('output_user_or_path = ',output_user_or_path) -print('output_database = ',output_database) -print('time_slice = ',time_slice) -print('ntimes = ',ntimes) -print('dt_required = ',dt_required,' s') +print('output_database = ',cc['output_database']) +print('time_slice = ',cc['time_slice']) +print('ntimes = ',cc['ntimes']) +print('dt_required = ',cc['dt_required'],' s') print('---------------------------------') # FUNCTION TO FIND INDEX OF NEAREST TIME SLICE IN TIME ARRAY @@ -64,78 +84,78 @@ def find_nearest(a, a0): # READ INPUT IDSS print('=> Open input datafile') -input = imas.DBEntry(imas.imasdef.MDSPLUS_BACKEND,input_database,shot,run_in,input_user_or_path) +input = imas.DBEntry(sc_backend,cc['input_database'],cc['shot'],cc['run_in'],cc['input_user_or_path']) input.open() # READ FULL TIME VECTOR OF EQUILIBRIUM IDS TO GET THE TIME BASE print('=> Open input datafile and to read time array from equilibrium IDS') time_array = input.partial_get(ids_name='equilibrium',data_path='time') -if time_slice == 0: - ntimes = len(time_array) +if cc['time_slice'] == 0: + cc['ntimes'] = len(time_array) it = 0 print('-----------------------------------------------------') print('Use the whole time array of the input equilibrium IDS') print('- t_init = ',time_array[0],'s') - print('- ntimes = ',ntimes) + print('- ntimes = ',cc['ntimes']) print('-----------------------------------------------------') -elif time_slice < 0: +elif cc['time_slice'] < 0: it = 0 - time_slice = time_array[0] - if ntimes > len(time_array): - time_array = np.linspace(time_array[0],time_array[0]+ntimes*dt_required,ntimes) + cc['time_slice'] = time_array[0] + if cc['ntimes'] > len(time_array): + time_array = np.linspace(time_array[0],time_array[0]+cc['ntimes']*cc['dt_required'],cc['ntimes']) print('-------------------------------------------------------------------------------------') print('Use the first time slice of the input equilibrium IDS with ntimes defined by the user') print('... However ntimes is greater than the input time array') print('--> Artificial time array generated with dt defined by the user:') print(' - t_init = ',time_array[it],'s') - print(' - ntimes = ',ntimes) - print(' - dt_required = ',dt_required) + print(' - ntimes = ',cc['ntimes']) + print(' - dt_required = ',cc['dt_required']) print('-------------------------------------------------------------------------------------') else: print('--------------------------------------------------------------------------------------') print('Use the first time slice of the input equilibrium IDS with ntimes defined by the user:') print('- t_init = ',time_array[0],'s') - print('- ntimes = ',ntimes) + print('- ntimes = ',cc['ntimes']) print('--------------------------------------------------------------------------------------') else: # FIND INDEX OF NEAREST TIME SLICE IN TIME ARRAY - [tc,it] = find_nearest(time_array,time_slice) - if ntimes > len(time_array) or it+ntimes>len(time_array): - time_array = np.linspace(time_array[it],time_array[it]+ntimes*dt_required,ntimes) + [tc,it] = find_nearest(time_array,cc['time_slice']) + if cc['ntimes'] > len(time_array) or it+cc['ntimes']>len(time_array): + time_array = np.linspace(time_array[it],time_array[it]+cc['ntimes']*cc['dt_required'],cc['ntimes']) it = 0 print('----------------------------------------------------------------') print('Required ntimes greater than the input time array') print('or required t_init too large for the required ntimes') print('--> Artificial time array generated with dt defined by the user:') - print(' - Required t_init = ',time_slice,'s') + print(' - Required t_init = ',cc['time_slice'],'s') print(' - Actual t_init = ',time_array[it],'s') - print(' - ntimes = ',ntimes) - print(' - dt_required = ',dt_required) + print(' - ntimes = ',cc['ntimes']) + print(' - dt_required = ',cc['dt_required']) print('----------------------------------------------------------------') else: print('--------------------------------------------------------------------') print('Use the specificed first time slice with ntimes defined by the user:') - print('- Required t_init = ',time_slice,'s') + print('- Required t_init = ',cc['time_slice'],'s') print('- Actual t_init = ',time_array[it],'s') - print('- ntimes = ',ntimes) + print('- ntimes = ',cc['ntimes']) print('--------------------------------------------------------------------') # IF LOCAL DATABASE DOES NOT EXIST: CREATE IT -local_database = os.getenv("HOME") + "/public/imasdb/" + output_database + "/3/0" +local_database = os.getenv("HOME") + "/public/imasdb/" + cc['output_database'] + "/3/0" if os.path.isdir(local_database) == False: print("-- Create local database " + local_database) os.makedirs(local_database) # CREATE OUTPUT DATAFILE -print('=> Create output datafile') -output = imas.DBEntry(imas.imasdef.MDSPLUS_BACKEND,output_database,shot,run_out,output_user_or_path) +print("=> Create output datafile",out_backend,cc['output_database'],cc['shot'],cc['run_out'],output_user_or_path) +output = imas.DBEntry(out_backend,cc['output_database'],cc['shot'],cc['run_out'],output_user_or_path) output.create() # START TIME LOOP -for itime in range(ntimes): +for itime in range(cc['ntimes']): # TIME PASSING BY - print('Time = %5.2f' % time_array[itime],'s, itime = ',itime,'/',ntimes) + print('Time = %5.2f' % time_array[itime],'s, itime = ',itime,'/',cc['ntimes']) # READ INPUT IDSS input_equilibrium = input.get_slice('equilibrium',time_array[itime],1) @@ -154,3 +174,5 @@ chease.finalize() input.close() output.close() print('Done.') + +os.chdir(current_folder) diff --git a/python/run_chease_iwrap_reflist.py b/python/run_chease_iwrap_reflist.py new file mode 100644 index 0000000000000000000000000000000000000000..9afaa4e0a7a3a637ac9bc0641e2b9f19520a47b0 --- /dev/null +++ b/python/run_chease_iwrap_reflist.py @@ -0,0 +1,182 @@ +# ----------------------------- +# PYTHON SCRIPT TO CALL CHEASE +# ----------------------------- + +# export PYTHONPATH=~/public/PYTHON_ACTORS/chease:$PYTHONPATH + +# NEEDED MODULES +import os,imas,yaml +import numpy as np + +path_file = os.path.dirname(os.path.abspath(__file__)) +current_file=os.path.join(path_file,'../input/scenario.yaml') +print('code_parameters.parameters_path = ',path_file) + +# INPUT/OUTPUT CONFIGURATION +file = open(current_file, 'r') +cc = yaml.load(file,Loader=yaml.CLoader) +file.close() +if cc['output_user_or_path'] == 'default': + output_user_or_path = os.getenv('USER') +else: + output_user_or_path = cc['output_user_or_path'] + +if cc['output_tmp_folder'] == 'default': + output_tmp_folder = '/tmp/'+os.getenv('USER') + os.system('mkdir -p '+output_tmp_folder) +else: + output_tmp_folder = cc['output_tmp_folder'] + +current_folder = os.getcwd() +os.chdir(output_tmp_folder) + +if cc['scenario_backend'] == 'hdf5': + sc_backend = imas.imasdef.HDF5_BACKEND +else: + sc_backend = imas.imasdef.MDSPLUS_BACKEND + +if cc['output_backend'] == 'hdf5': + out_backend = imas.imasdef.HDF5_BACKEND +else: + out_backend = imas.imasdef.MDSPLUS_BACKEND + +# CHEASE INITIALISATION +from chease.actor import chease as chease_actor +chease = chease_actor() +code_parameters = chease.get_code_parameters() +code_parameters.parameters_path = os.path.join(path_file,'../input/chease_input_reflist.xml') +print('code_parameters.parameters_path = ',path_file) +runtime_settings = chease.get_runtime_settings() +if cc['debug'] == 1: + from chease.common.runtime_settings import DebugMode + runtime_settings.debug_mode = DebugMode.STANDALONE +if cc['sandbox_manual'] == 1: + from chease.common.runtime_settings import SandboxLifeTime, SandboxMode + runtime_settings.sandbox.life_time = SandboxLifeTime.PERSISTENT + runtime_settings.sandbox.mode = SandboxMode.MANUAL + runtime_settings.sandbox.path = os.getcwd() +chease.initialize(code_parameters=code_parameters,runtime_settings=runtime_settings) + +# TO SUPPRESS THE ACCESS LAYER WARNINGS ABOUT OBSOLETE DATA +import logging +log = logging.getLogger() +log.setLevel(logging.ERROR) + +# DISPLAY SIMULATION INFORMATION +print('---------------------------------') +print('shot = ',cc['shot']) +print('run_in = ',cc['run_in']) +print('run_out = ',cc['run_out']) +print('input_user_or_path = ',cc['input_user_or_path']) +print('input_database = ',cc['input_database']) +print('output_user_or_path = ',output_user_or_path) +print('output_database = ',cc['output_database']) +print('time_slice = ',cc['time_slice']) +print('ntimes = ',cc['ntimes']) +print('dt_required = ',cc['dt_required'],' s') +print('---------------------------------') + +# FUNCTION TO FIND INDEX OF NEAREST TIME SLICE IN TIME ARRAY +def find_nearest(a, a0): + "Element in nd array `a` closest to the scalar value `a0`" + idx = np.abs(a - a0).argmin() + return a.flat[idx],idx + +# READ INPUT IDSS +print('=> Open input datafile') +input = imas.DBEntry(sc_backend,cc['input_database'],cc['shot'],cc['run_in'],cc['input_user_or_path']) +input.open() + +# READ FULL TIME VECTOR OF EQUILIBRIUM IDS TO GET THE TIME BASE +print('=> Open input datafile and to read time array from equilibrium IDS') +time_array = input.partial_get(ids_name='equilibrium',data_path='time') +if cc['time_slice'] == 0: + cc['ntimes'] = len(time_array) + it = 0 + print('-----------------------------------------------------') + print('Use the whole time array of the input equilibrium IDS') + print('- t_init = ',time_array[0],'s') + print('- ntimes = ',cc['ntimes']) + print('-----------------------------------------------------') +elif cc['time_slice'] < 0: + it = 0 + cc['time_slice'] = time_array[0] + if cc['ntimes'] > len(time_array): + time_array = np.linspace(time_array[0],time_array[0]+cc['ntimes']*cc['dt_required'],cc['ntimes']) + print('-------------------------------------------------------------------------------------') + print('Use the first time slice of the input equilibrium IDS with ntimes defined by the user') + print('... However ntimes is greater than the input time array') + print('--> Artificial time array generated with dt defined by the user:') + print(' - t_init = ',time_array[it],'s') + print(' - ntimes = ',cc['ntimes']) + print(' - dt_required = ',cc['dt_required']) + print('-------------------------------------------------------------------------------------') + else: + print('--------------------------------------------------------------------------------------') + print('Use the first time slice of the input equilibrium IDS with ntimes defined by the user:') + print('- t_init = ',time_array[0],'s') + print('- ntimes = ',cc['ntimes']) + print('--------------------------------------------------------------------------------------') +else: + # FIND INDEX OF NEAREST TIME SLICE IN TIME ARRAY + [tc,it] = find_nearest(time_array,cc['time_slice']) + if cc['ntimes'] > len(time_array) or it+cc['ntimes']>len(time_array): + time_array = np.linspace(time_array[it],time_array[it]+cc['ntimes']*cc['dt_required'],cc['ntimes']) + it = 0 + print('----------------------------------------------------------------') + print('Required ntimes greater than the input time array') + print('or required t_init too large for the required ntimes') + print('--> Artificial time array generated with dt defined by the user:') + print(' - Required t_init = ',cc['time_slice'],'s') + print(' - Actual t_init = ',time_array[it],'s') + print(' - ntimes = ',cc['ntimes']) + print(' - dt_required = ',cc['dt_required']) + print('----------------------------------------------------------------') + else: + print('--------------------------------------------------------------------') + print('Use the specificed first time slice with ntimes defined by the user:') + print('- Required t_init = ',cc['time_slice'],'s') + print('- Actual t_init = ',time_array[it],'s') + print('- ntimes = ',cc['ntimes']) + print('--------------------------------------------------------------------') + +# IF LOCAL DATABASE DOES NOT EXIST: CREATE IT +local_database = os.getenv("HOME") + "/public/imasdb/" + cc['output_database'] + "/3/0" +if os.path.isdir(local_database) == False: + print("-- Create local database " + local_database) + os.makedirs(local_database) + +# CREATE OUTPUT DATAFILE +print("=> Create output datafile",out_backend,cc['output_database'],cc['shot'],cc['run_out'],output_user_or_path) +#print('=> Create output datafile') +output = imas.DBEntry(out_backend,cc['output_database'],cc['shot'],cc['run_out'],output_user_or_path) +output.create() +print('=> Done output datafile') + +# START TIME LOOP +for itime in range(cc['ntimes']): + + # TIME PASSING BY + print('Time = %5.2f' % time_array[itime],'s, itime = ',itime,'/',cc['ntimes']) + + # READ INPUT IDSS + print('=> before input_get_slice') + input_equilibrium = input.get_slice('equilibrium',time_array[itime],1) + print('=> before chease') + + # EXECUTE CHEASE + output_equilibrium = chease(input_equilibrium) + + # WRITE RESULT TO LOCAL DATABASE + output.put_slice(output_equilibrium) + + print('-------------------------------------') + print('Output time = ',output_equilibrium.time) + print('-------------------------------------') + +chease.finalize() +input.close() +output.close() +print('Done.') + +os.chdir(current_folder) diff --git a/scripts_for_bin/database_to_database b/scripts_for_bin/database_to_database new file mode 100755 index 0000000000000000000000000000000000000000..8367d725efffb0c96d64ca60bb6561526b958a57 --- /dev/null +++ b/scripts_for_bin/database_to_database @@ -0,0 +1,333 @@ +#!/bin/bash + +# run CHEASE from an input from the local database euitm or IMAS (tree ids or euitm) and write to database or IMAS +# +# database_to_database shot_in run_in shot_out run_out [cocos_in [cocos_out [occurence_nb_in [occurence_nb_out [treename [treeuser_in [ treeuser_out [ipsign_out [b0sign_out [time_in [tokamak]]]]]]]]]] +# +# defaults: cocos_in=11 (or 13 if not on iter), cocos_out=cocos_in +# Note: for ITER should set default cocos_out=11 in the file, and 13 for EU +# Note: for IMAS, set treename='ids' in this file as default, for CPOs set treename=euitm +# +# ipsign_out: by default (-9) will use sign(Ip) in eqdsk file and perform the transformation from cocos_in to cocs_out +# If a specific sign is wanted, then set ipsign_out=+1 or -1 +# Note that the standard for ITER is cocos=11, Ip<0 and B0<0, so can use ipsign_out=b0sign_out=-1 +# +# b0sign_out: same meaning as ipsign_out but for sign of B0 +# +# time_in: to extract the equilibrium nearby a specific time instead of first time by default +# +# Note: if cocos_in=11 or 2 do not work, try 7 +# +# New: +# export chease_exe=chease_imas_hdf5 (to use a specific executable, now the default at IO is chease_imas_hdf5) +# Note: +# You can use the top part of the CHEASE output, which contains the namelist, and copy it to "chease_namelist" file, then change some parameters and run chease_imas[_hdf5] +# + +# Can override/add variables to the namelist file by adding --override_a=b to the *START* and to the *END* of the list of arguments. +############# start of grab_override file ########### +# Grab override variables and add to temp file, which will later be added to the namelist file, and later deleted. +# override statements should be before and/or after the standard list, but not in the middle +non_override_seen=0 +override_file=$(mktemp) +for var in "$@" +do + [ "${var:0:11}" == "--override_" ] && { + # strip "--override_" from front of var and add to file + echo ${var#--override_} >> ${override_file} + # shift, such that the remaining $1/... logic later still works. + if [ ${1:0:11} == "--override_" ]; then + shift # note will not shift anymore once all first overrides have been scanned + fi + } || { + # Mark the first time we see an arg not starting with --override_ + (( non_override_seen++ )) + } +done +############# end of grab_override file ########### + +curdir=`pwd` + +name_iter=`uname -n | grep iter` +if [ $? -eq 0 ] +then + # assume on iter machine thus imas database + default_treename='ids' + # default cocos_out should be 11 for ITER, 13 for euitm + cocos_in=11 + chease_exe=${chease_exe:-chease_imas} +else + # assume on gateway + xitmenvx=x`echo $ITM_ENVIRONMENT_LOADED`x + if [ $xitmenvx = 'xx' ] + then + # default cocos_in should be 11 for ITER, 13 for euitm + default_treename='ids' + cocos_in=11 + chease_exe=${chease_exe:-chease_imas} + else + default_treename='euitm' + # assume on gateway for euitm database + cocos_in=13 + chease_exe=${chease_exe:-chease_itm} + fi +fi + +cocos_out=$cocos_in +occurence_nb_in=0 +occurence_nb_out=0 +ipsign_out=-9 +b0sign_out=-9 +time_in=1. +tree_tokamak_in='test' +tree_user_in=`echo $USER` +tree_user_out=`echo $USER` +tree_majorversion_in='3' + +if [ ${non_override_seen} -lt 4 -o ${non_override_seen} -gt 16 ] +then + echo "needs 4 to 16 arguments: shot_in run_in shot_out run_out [cocos_in [cocos_out [occurence_nb_in [occurence_nb_out [treename [treeuser_in [treeuser_out [ipsign_out [b0sign_out [time_in [tree_tokamak [tree_majorversion]]]]]]]]]]]]" + echo " default cocos_in = "$cocos_in + echo " default cocos_out = "$cocos_out + echo " default occurence_nb_in = "$occurence_nb_in + echo " default occurence_nb_out = "$occurence_nb_out + echo " default treename: "$default_treename + echo "for some codes might want to impose negative Ip and B0 thus set ipsign_out=-1 and b0sign_out=-1some signs of Ip or B0, note that positive Ip and B0 is automatically provided as extra eqdsk output (in /tmp/username) (default -9, -9)" + echo "to get the correct Ip and B0 signs from the transformation from cocos_in to cocos_out, do not set ipsign_out nor b0sign_out" + echo " default ipsign_out: "$ipsign_out + echo " default b0sign_out: "$b0sign_out + echo " default time_in: "$time_in " (note if an array is provided then give it in between quotes to be taken as a single input argument)" + echo " default tree_tokamak_in: "$tree_tokamak_in + echo " default tree_user_in: "$tree_user_in + echo " default tree_majorversion_in: "$tree_majorversion_in + echo " " + echo "All output files are in /tmp/username/." + echo " " + exit +fi + +shot_number_in=$1 +run_number_in=$2 +shot_number_out=$3 +run_number_out=$4 + +jobname=${shot_number_in}_${run_number_in} + +if [ ${non_override_seen} -ge 5 ] +then + cocos_in=$5 +fi + +if [ ${non_override_seen} -ge 6 ] +then + cocos_out=$6 +fi + +if [ ${non_override_seen} -ge 7 ] +then + occurence_nb_in=$7 +fi +if [ ${non_override_seen} -ge 8 ] +then + occurence_nb_out=$8 +fi + +treename=$default_treename +if [ ${non_override_seen} -ge 9 ] +then + treename=$9 +fi + +if [ ${non_override_seen} -ge 10 ] +then + tree_user_in=${10} +fi +if [ ${non_override_seen} -ge 11 ] +then + tree_user_out=${11} +fi + +if [ ${non_override_seen} -ge 12 ] +then + ipsign_out=${12} +fi +if [ ${non_override_seen} -ge 13 ] +then + b0sign_out=${13} +fi + +if [ ${non_override_seen} -ge 14 ] +then + time_in=${14} +fi +if [ ${non_override_seen} -ge 15 ] +then + tree_tokamak_in=${15} +fi +if [ ${non_override_seen} -ge 16 ] +then + tree_majorversion_in=${16} +fi + +che_opt=1 + +filedir_in=`pwd` + +filedir_out='/tmp/'$USER +mkdir $filedir_out 2> /dev/null + +os=`which $chease_exe` +if [ $? -ne 0 ] +then + echo "" + echo "should have $chease_exe in the PATH" + echo "" + exit +fi + +# run on tmp: +tmpdir=/tmp/`date|sed s/[^0-9]//g`$$ +mkdir $tmpdir +cd $tmpdir +mkdir core +pwd + +echo " using chease from :"$os > log_database_to_database + +echo "*** $eqdskfilename" > chease_namelist +cat >>chease_namelist <<'EOF' +*** +***NEGP=-1,NER= 1 TCV case with ECRH +*** NSURF=6,NEQDSK=1, NEQDXTPO=-1 + &EQDATA + RELAX= 0., NDIAGOP= 1, NBSEXPQ=0000, + NITMOPT = 11, +EOF +echo " NITMSHOT= $shot_number_in, $shot_number_out," >> chease_namelist +echo " NITMRUN= $run_number_in, $run_number_out," >> chease_namelist +echo " NITMOCC= $occurence_nb_in, $occurence_nb_out" >> chease_namelist +echo " COCOS_IN=$cocos_in," >> chease_namelist +echo " COCOS_OUT=$cocos_out," >> chease_namelist +echo " TREEITM=$treename,$treename" >> chease_namelist +echo " TREE_TOKAMAK=$tree_tokamak_in,$tree_tokamak_in" >> chease_namelist +echo " TREE_USER=$tree_user_in,$tree_user_out" >> chease_namelist +echo " TREE_MAJORVERSION=$tree_majorversion_in,$tree_majorversion_in" >> chease_namelist +echo " TIME_REF=$time_in," >> chease_namelist +echo " SIGNIPXP=$ipsign_out," >> chease_namelist +echo " SIGNB0XP=$b0sign_out," >> chease_namelist +cat >>chease_namelist <<'EOF' + NVERBOSE=3, + NPROPT=-2, + NIDEAL=6, NPLOT=1, NTCASE=0, NSMOOTH=1, + NS=60, NT=60, NPSI=220, NCHI=220, NISO=220, NTNOVA=12, + NS=40, NT=40, NPSI=180, NCHI=180, NISO=180, NTNOVA=12, + CPRESS=1.0, QSPEC=0.70, CSSPEC=0.0, + CFNRESS=1.00, + NRSCAL=0, NCSCAL=2, NTMF0=0, + NBAL=0, NBLOPT=0, CFBAL=10.00, + + NOPT=0, + R0EXP=8.79999995E-01, + TENSPROF= -0.3, + TENSBND = -10, + TENSPROF= -0.05, + TENSBND = -0.05, + + NSURF=6, ELONG=2.045, TRIANG=0.7, BEANS=0., CETA=0.24, SGMA=0., + ASPCT= 0.28123462E+00, + ASPCT= 0.28, + + AT4=0.0, 27.926, -42.339, 16.664, 0.0, + AT4=28.232, -48.496, 35.964, -14.26, 0.0, + AT4=29500., -68768., 272720., -1147400., 2798300., -3873600., 2842600., -852840., + AT3=0.52719, 0.11069, -0.11517, -0.083952, 0.15572, -0.048391, 0., 0. + AT3=0.52503, 0.92754, 0.21896, -2.4078, 8.1211, -13.87, 11.653, -3.7942, + AT2=1.5145, 0.12811, -4.9335, 36.43, -120.88, 201.1, -163.58, 51.79, + AT2=1.5165, 0.14189, -5.0417, 36.759, -121.11, 200.38, -162.23, 51.152, + ETAEI= 0.1, RPEOP= 0.5, RZION=1.5, + NPPFUN=8, NPP=1, AP= 0.0,-0.8, 0.0, 0.0, + NFUNC=4, NSTTP=2, AT= 0., -0.30761536E+01,0.72318357, 0.0, + NSOUR=8, + + NDIFPS=0, NDIFT=1, + NMESHC=1, NPOIDC=2, SOLPDC=.70,CPLACE=.95,.99,1.0, + CWIDTH=.10,.02,.05, + NMESHA=0, NPOIDA=1, SOLPDA=.60,APLACE=.00,.70,1.0, + AWIDTH=.05,.07,.05, + NMESHA=2, NPOIDQ=6, SOLPDA=.10,QPLACE=0.95,0.95,1.0,2.0,3.00,4.0,4.0, + QWIDTH=0.06,.04,.08,.05,0.05,0.05, + NMESHA=0, NPOIDQ=8, SOLPDA=.10,QPLACE=0.95,0.95,1.0,2.0,3.00,3.0 ,4.0,4.0, + QWIDTH=0.06,.04, .03,.06, .05,0.01,0.04,.01 + NMESHA=2, NPOIDQ=2, SOLPDA=.60,QPLACE=1.00,1.00,1.00,2.00,2.00,2.00,3.00,3.00,4.00,4.00, + QWIDTH=0.13,0.06,0.01,0.09,0.05,0.02,0.07,0.02,0.04,0.01, + NMESHA=2, NPOIDQ=10, SOLPDA=.10,QPLACE=1.00,1.00,1.00,2.00,2.00,2.00,3.00,3.00,4.00,4.00, + QWIDTH=0.13,0.06,0.01,0.09,0.05,0.02,0.07,0.02,0.04,0.01, + NMESHA=0, NPOIDQ=10, SOLPDA=.10,QPLACE=1.00,1.00,2.00,2.00,3.00,3.00,4.00,4.00,4.41,4.41, + QWIDTH=0.13,0.04,0.09,0.04,0.07,0.02,0.04,0.01,0.01,0.001, + NMESHD=1, NPOIDD=2, SOLPDD=.60,DPLACE=-1.80,-1.80,4.0, + DWIDTH=.18,.08,.05, + NMESHD=0, NPOIDD=2, SOLPDD=.60,DPLACE=-1.80,-1.80,4.0, + DWIDTH=.18,.08,.05, + NMESHE=0, NPOIDE=4, SOLPDE=.50,EPLACE=-1.70,-1.70, 1.70, 1.70, + EWIDTH=.18,.08,.18,.08, + EPSLON=1.0E-8, GAMMA=1.6666666667, + NTURN=20, NBLC0=16, NPPR=24, + MSMAX=1, NINMAP=40, NINSCA=40, + NSYM=0, NEGP= 0, NER=2, NV=40, NVEXP=1, REXT=10.0, R0W=1., RZ0W=0., + NSYM=0, NEGP=-2, NER=2, NV=40, NVEXP=1, REXT=10.0, R0W=1., RZ0W=0., + NSYM=0, NEGP=-1, NER=1, NV=40, NVEXP=1, REXT=10.0, R0W=1., RZ0W=0., + NEQDXTPO=-1001, + NEQDSK=0, NEQDXTPO=-1, + NEQDSK=1, NEQDXTPO=1, + PSISCL= 1.0, NRBOX=33, NZBOX=33, + PSISCL= 1.0, NRBOX=33, NZBOX=65, + PSISCL= 1.0, NRBOX=129, NZBOX=129, + PSISCL= 1.0, NRBOX=257, NZBOX=257, + PSISCL= 1.0, NRBOX=157, NZBOX=157, + PSISCL= 1.0, NRBOX=129, NZBOX=129, +EOF + +# Add override vars +cat ${override_file} >> chease_namelist + +cat >>chease_namelist <<'EOF' + / + &NEWRUN + AL0=-3.0E-03, NWALL= 1, REXT=10.0, + NLGREN= .F., WNTORE=1.0, NV=40, + NLDIAG=11*.T., + NAL0AUTO=1, + / +EOF + +cat chease_namelist >> log_database_to_eqdsk + +# +# Run CHEASE +# +if [ $che_opt = '1' ] +then + cp chease_namelist $filedir_out/o.$jobname + echo "" >> $filedir_out/o.$jobname + $chease_exe >> $filedir_out/o.$jobname + ls -al >> log_database_to_eqdsk + aaaa=`ls -1 | egrep -x 'EQDSK_COCOS_'..'.OUT'` + cp $aaaa $filedir_out/$aaaa.$jobname + aaaa=`ls -1 | egrep -x 'EQDSK_COCOS_'..'_POS.OUT'` + cp $aaaa $filedir_out/$aaaa.$jobname + cp EXPEQ.OUT $filedir_out/EXPEQ.OUT.$jobname + cp EXPEQ.OUT.TOR $filedir_out/EXPEQ.OUT.TOR.$jobname + cp EXPTNZ.OUT $filedir_out/EXPTNZ.OUT.$jobname + cp NOUT $filedir_out/NOUT.$jobname + cp EXPEQ_KEPLER.IN $filedir_out/EXPEQ_KEPLER.IN.$jobname + date >> log_database_to_eqdsk + cp log_database_to_eqdsk $filedir_out/log_database_to_eqdsk.$jobname + + echo "" + echo " Chease done" + echo "" +fi + +cd $curdir +#rm -r $tmpdir +rm ${override_file} diff --git a/scripts_for_bin/o.chease_to_cols b/scripts_for_bin/o.chease_to_cols index 4bc6b289a334341bda0e870580f8e7c14791697d..ec9b90a0fafeaa4a8a13c140de886a3a412725e3 100755 --- a/scripts_for_bin/o.chease_to_cols +++ b/scripts_for_bin/o.chease_to_cols @@ -25,4 +25,3 @@ cols_RZ_output=$cheaseoutputfile".RZcols" $abc/o.chease_to_cols_v10.pl $cheaseoutputfile > $cols_output $abc/o.chease_rz_plasma_boundary_to_cols.pl $cheaseoutputfile > $cols_RZ_output #fi - diff --git a/scripts_for_bin/o.chease_to_cols_v10.pl b/scripts_for_bin/o.chease_to_cols_v10.pl index 289a930a15fc85cdb2472bd1faab95bd57343481..3b1a4f12578852c5dc42a7c58a242297e0755df2 100755 --- a/scripts_for_bin/o.chease_to_cols_v10.pl +++ b/scripts_for_bin/o.chease_to_cols_v10.pl @@ -102,8 +102,17 @@ $table_head=1; ); - $varnum=-1; +# skip lines until FINAL OUTPUT so works with nblopt=1 for example or any intermediate outputs +while(<>){ + if(m/FINAL OUTPUT/){ + last; + } + if (eof()){ + print STDERR "FINAL OUTPUT not found in chease output, could not fill cols file\n"; + last; + } +} while(<>){ if(/^\s*\n/ && $get==1){ $get=0; diff --git a/scripts_for_bin/run.chease.eqdsk b/scripts_for_bin/run.chease.eqdsk index 86e84b82d0e30ad0d22e104a0297f6b806f87e74..c6e6ba14f0544ba86d8c9b3916177fa76a4943e6 100755 --- a/scripts_for_bin/run.chease.eqdsk +++ b/scripts_for_bin/run.chease.eqdsk @@ -94,6 +94,7 @@ cat >>chease_namelist <<'EOF' ***NEGP=-1,NER= 1 TCV case with ECRH *** NSURF=6,NEQDSK=1, NEQDXTPO=1 &EQDATA + NVERBOSE = 3, EOF if [ $TNZfile -eq 1 ] then diff --git a/scripts_for_bin/run.chease.expeq b/scripts_for_bin/run.chease.expeq index e90295bbac46c2b971f77b1a0960a8fb772f51c6..471ee8d49480bd1806840ef9ddf12d6e35b93da6 100755 --- a/scripts_for_bin/run.chease.expeq +++ b/scripts_for_bin/run.chease.expeq @@ -173,6 +173,7 @@ echo " NFUNC=$nfppfun, NSTTP=1, AT= 0., -0.30761536E+01,0.72318357, 0.0, " > echo " SIGNIPXP=$signIp, " >> chease_namelist echo " SIGNB0XP=$signB0, " >> chease_namelist cat >>chease_namelist <<'EOF' + NVERBOSE = 3, NSOUR=8, NDIFPS=0, NDIFT=1, diff --git a/src-f90/COMDAT.inc b/src-f90/COMDAT.inc index f650b8c78acf9db0df3d35078970a02117668fe2..9784be8940c2796b9d2270f9de77e2bff149b6bf 100644 --- a/src-f90/COMDAT.inc +++ b/src-f90/COMDAT.inc @@ -83,7 +83,7 @@ Namelist /EQDATA/ & & BPLACE, BSFRAC, BWIDTH, B0EXP, CETA, CFBAL, CFNRESS, CFNRESSO, & & COCOS_IN,COCOS_OUT,CPLACE, CPRESS, CPRESSO, CQ0, CSSPEC, CURRT, & & CWIDTH, DELTA, DPLACE, DWIDTH, ELONG, EPLACE, & - & ETAEI, EWIDTH, EPSLON, GAMMA, PANGLE, PREDGE, PSIBNDEXP, & + & ETAEI, EWIDTH, EPSLON, GAMMA, PANGLE, PPRIME_BAL_MAX, PREDGE, PSIBNDEXP, & & PSISCL, QSPEC, QPLACE, QWIDTH, QVALNEO, RBOXLEN, RBOXLFT, & & RC, RELAX, REXT, RNU, RODABYROD0, RPEOP, RZION, & & RZ0, RZ0C, RZ0W, R0, R0EXP, R0W, SCALNE, & @@ -94,7 +94,7 @@ Namelist /EQDATA/ & & MDT, MSMAX, N0JEDGE, NANAL, NBAL, NBLC0, NBLOPT, NBPSOUT, NBSEXPQ, & & NBSFUN, NBSOPT, NBSTRP, NCHI, NCSCAL, NDIAGOP, NDIFPS, & & NDIFT, NEGP, NEONBQS, NEQDSK, NER, NIDSBOUND,NITMOCC, NITMOPT, NITMRUN, NITMSHOT, NFFTOPT, & - & NFIXAXIS,NFIXWALL,NFUNC, NFUNRHO, NIDEAL, NINMAP, NINSCA, NIPR, NISO, NMESHA, & + & NFIXAXIS,NFIXWALL,NFUNC, NFUNRHO, NIDEAL, NINBLOPT, NINMAP, NINSCA, NIPR, NISO, NMESHA, & & NMESHB, NMESHC, NMESHD, NMESHE, NMESHPOL, NMESHPOLEXP, NMGAUS, NOPT, NOUTXTOR, & & NPLOT, NPOIDA, NPOIDB, NPOIDC, NPOIDD, NPOIDE, & & NPOIDQ, NPP, NPPFUN, NPPR, NPROF2D, NPROFZ, NPROPT, & @@ -103,7 +103,7 @@ Namelist /EQDATA/ & & NT, NTCASE, NTGAUS, NTEST, NTMF0, NTNOVA, & & NTURN, NV, NVEXP, NZBOX, NZBOX_XTOR, & & NEQDXTPO,NVERBOSE,COMMENTS -! +! ! TENSPROF: Tension for input profile smoothing (used in interpos). Set it to 0. for no smoothing ! TENSBND: Tension for input plasma boundary smoothing. Set it to 0. for no smoothing ! diff --git a/src-f90/Makefile b/src-f90/Makefile index 561b41867cbfc7837424331ead016501405ca58e..21b458e818f53f1853c63c16e1b696e7c8075eea 100644 --- a/src-f90/Makefile +++ b/src-f90/Makefile @@ -10,10 +10,12 @@ PROG_KEPLER_IMAS = libchease_kepler_imas PROG_MODULE_IMAS = libchease_module_imas PROG_ACTOR = actor PROG_ACTOR_FC2K = actor_fc2k +PROG_TEST = test PROG_TEST_CHEASE = test_chease PROG_TEST_CHEASE_ITM = test_chease_itm PROG_TEST_CHEASE_IMAS = test_chease_imas PROG_TEST_CHEASE_Q = test_chease_q +PROG_TEST_CHEASE_nsttp = test_chease_nsttp PROG_TEST_CHEASE_CI_SHORT = test_chease_ci_short PROG_TEST_CHEASE_IMAS_CI_SHORT = test_chease_imas_ci_short @@ -80,6 +82,7 @@ export HDF5 F90 F90FLAGS LDFLAGS LIBS LIBS_HDF5 INCL_HDF5 CCFLAGS $(shell rm -f chease_effxml.f90 chease_prog_effxml.f90 chease_effxml.o chease_prog_effxml.o) $(shell rm -f chease_imas_effxml.f90 chease_prog_imas_ids_effxml.f90 chease_imas_effxml.o chease_prog_imas_ids_effxml.o) $(shell rm -f chease_imas_effxml_module.f90 chease_imas_effxml_module.o) +$(shell rm -f metrictoitm_afterfpp.f90 metrictoitm_afterfpp.o) # to get current git hash ifeq ($(XML_USE_CHOICE),$(filter $(XML_USE_CHOICE),NO N n no 0)) reflistorchoices = reflist @@ -108,6 +111,10 @@ endif # @echo $(XML_USE_CHOICE) ################## TEMPORARY +ifndef nsttp + echo "should give nsttp value, default: nsttp=2" + nsttp=2 +endif copy_itm_to_ids_equilibrium_eff = copy_itm_to_ids_equilibrium.f90 # use linked default file ifeq ($(IMAS_VERSION),3.6.1) @@ -131,11 +138,11 @@ SRCS_all = a_chease.f90 acopy.f90 aldlt.f90 apcoef.f90 apcoef2.f90 \ direct.f90 drhodp.f90 dwy.f90 energy.f90 eqchease_mksa.f90 eqdim.f90 erdata.f90 \ errorch.f90 evlate.f90 fix_surface_near_axis.f90 four1.f90 fourfft.f90 fourier.f90 g_0.f90 \ g_1.f90 g_2.f90 g_3.f90 gauss.f90 gchi.f90 gdataext.f90 genout.f90 \ - gijlin.f90 gloadd.f90 globals_init.f90 \ + gijlin.f90 gloadd.f90 globals_init.f90 gloqua.f90 \ guess.f90 iarray.f90 identa.f90 identb.f90 indexx.f90 initia.f90 \ iodisk.f90 isamin.f90 ismax.f90 ismin.f90 isofind.f90 \ isofun.f90 isrchfge.f90 issum.f90 itipr.f90 ivar.f90 jnovaw.f90 \ - labrun.f90 limita.f90 limitb.f90 ltxw.f90 lyv.f90 magaxe.f90 \ + labrun.f90 limita.f90 limitb.f90 ltxw.f90 lyv.f90 magaxe.f90 mappin.f90 \ matrix.f90 mesage.f90 mesh.f90 metrictoitm_afterfpp.f90 msplcy.f90 \ mspline.f90 nerat.f90 nonlin.f90 norept.f90 ntridg.f90 oarray.f90 \ oldeq.f90 oldnew.f90 outgload.f90 outmksa.f90 outnvw.f90 outpen.f90 \ @@ -165,9 +172,9 @@ SRCS_1 = chease_prog_effxml.f90 SRCS_1_IMAS = chease_prog_imas_ids_effxml.f90 # SRCS_2 get and put routines to read/write to ITM data structure, dummy routines if not needed -SRCS_2 = gloqua.f90 mappin.f90 load_itm_dummy.f90 write_itm_dummy.f90 -SRCS_2_ITM = gloqua.f90 mappin.f90 load_itm_with_rout.f90 write_itm_with_rout.f90 -SRCS_2_IMAS = gloqua_imas.f90 mappin_imas.f90 load_imas_with_rout.f90 write_imas_with_rout.f90 +SRCS_2 = load_itm_dummy.f90 write_itm_dummy.f90 +SRCS_2_ITM = load_itm_with_rout.f90 write_itm_with_rout.f90 +SRCS_2_IMAS = load_imas_with_rout.f90 write_imas_with_rout.f90 #SRCS_2_IMAS = load_imas_dummy.f90 write_imas_dummy.f90 # SRCS_interpos to make interpos library @@ -248,7 +255,10 @@ OBJS_MODULE_IMAS = $(MODS_IMAS:.f90=.o) $(MODS_interpos:.f90=.o) $(SRCS_MODULE_I # -VERSION=`git describe --tags --first-parent --abbrev=11 --long --dirty --always` +#NB: --first-parent not available in git on RHEL7 +hash_current!=git rev-parse --verify HEAD +branch_current!=git rev-parse --abbrev-ref HEAD +VERSION ?= $(hash_current)_branch_$(branch_current) #FPPFLAGS+=-DSVNVERSION="\"`svnversion .. | sed 's/.*://'`\"" GITREVISION=$(VERSION) @@ -342,6 +352,10 @@ $(FUTILS)/lib$(futils).a : # cp $(FUTILS)/$(Makefile_futils) $(FUTILS)/Makefile $(MAKE) -C $(FUTILS) -f $(Makefile_futils) +$(PROG_TEST): + # default main test + make test_chease_nsttp nsttp=0 + $(PROG_TEST_CHEASE): ../WK/TESTCASES/NIDEAL10/script_test_chease_from_src-f90 @@ -359,14 +373,23 @@ $(PROG_TEST_CHEASE_Q): unset PATHprev_temp matlab -nodesktop -r "runtest=5;run ../WK/TESTCASES/nsttp_series_test/VG_run_tests;disp('type quit when done')" +$(PROG_TEST_CHEASE_nsttp): + @PATHprev_temp=$(PATH) + @PATH=".:"$(PATH) + ../WK/TESTCASES/nsttp_series_test/run_tests $(nsttp) $(PWD) $(PWD)/.. + @PATH=$(PATHprev_temp) + @unset PATHprev_temp + @echo "To see results with matlab, you can do: " + @echo "matlab -nodesktop -r \"runtest=$(nsttp);addpath('../WK/TESTCASES/nsttp_series_test');VG_run_tests\"" + $(PROG_TEST_CHEASE_CI_SHORT): make chease - ../WK/TESTCASES/NIDEAL10/script_test_chease_from_codes $(PWD) + ../WK/TESTCASES/NIDEAL10/script_test_chease_from_codes $(PWD) $(PWD)/.. $(PROG_TEST_CHEASE_IMAS_CI_SHORT): make chease_imas ln -sf chease_imas chease - ../WK/TESTCASES/NIDEAL10/script_test_chease_from_codes $(PWD) + ../WK/TESTCASES/NIDEAL10/script_test_chease_from_codes $(PWD) $(PWD)/.. # Here are make targets that are called by continuous integration service (Bamboo) which should run tests for CHEASE # with a stringency according to release, develop or feature branch. @@ -491,20 +514,24 @@ ccopy.o: globals.o center.o: globals.o check.o: globals.o BNDIND.inc checknanos_module.o: prec_const.o -chease_effxml.o: globals.o $(MODS_f90_xml_interface:.f90=.o) +# need targets for chease_effxml.f90 and related files for "make source", hence provide rules for xx.f90 and xx.o separately +chease_effxml.o: globals.o $(MODS_f90_xml_interface:.f90=.o) chease_effxml.f90 + $(F90) $(F90FLAGS_O0) -c chease_effxml.f90 +chease_effxml.f90: # use sed instead of fpp or cpp since cpp removes concatenation // characters and fpp not always present sed "s/reflist/$(reflistorchoices)/" chease.f90 > chease_effxml.f90 - $(F90) $(F90FLAGS_O0) -c chease_effxml.f90 -chease_imas_effxml.o: globals.o equilibrium_euitm_module.o $(MODS_f90_xml_interface:.f90=.o) - sed "s/reflist/$(reflistorchoices)/" chease_imas.f90 > chease_imas_effxml.f90 +chease_imas_effxml.o: globals.o equilibrium_euitm_module.o $(MODS_f90_xml_interface:.f90=.o) chease_imas_effxml.f90 $(F90) $(F90FLAGS_O0) -c chease_imas_effxml.f90 $(INCL_FUTILS) $(INCL_HDF5) -chease_imas_effxml_module.o: globals.o equilibrium_euitm_module.o $(MODS_f90_xml_interface:.f90=.o) +chease_imas_effxml.f90: + sed "s/reflist/$(reflistorchoices)/" chease_imas.f90 > chease_imas_effxml.f90 +chease_imas_effxml_module.o: globals.o equilibrium_euitm_module.o $(MODS_f90_xml_interface:.f90=.o) chease_imas_effxml_module.f90 + $(F90) $(F90FLAGS_O0) -c chease_imas_effxml_module.f90 $(INCL_FUTILS) $(INCL_HDF5) +chease_imas_effxml_module.f90: echo "module chease_module" > temp_chease_module.f90 echo "contains" >> temp_chease_module.f90 cat chease_imas.f90 >> temp_chease_module.f90 echo "end module chease_module" >> temp_chease_module.f90 sed "s/reflist/$(reflistorchoices)/" temp_chease_module.f90 > chease_imas_effxml_module.f90;rm temp_chease_module.f90 - $(F90) $(F90FLAGS_O0) -c chease_imas_effxml_module.f90 $(INCL_FUTILS) $(INCL_HDF5) chipsi.o: globals.o chipsimetrics.o: globals.o interpos_source.o cint.o: globals.o @@ -526,15 +553,17 @@ eqchease_mksa.o: prec_const.o globals.o cocos_module.o eqdim.o: globals.o erdata.o: globals.o errorch.o: globals.o -chease_prog_effxml.o: SOLOV.inc COMDAT.inc globals.o euitm_schemas.o prec_const.o $(MODS_f90_xml_interface:.f90=.o) - sed "s/reflist/$(reflistorchoices)/" chease_prog.f90 > chease_prog_effxml.f90 +chease_prog_effxml.o: SOLOV.inc COMDAT.inc globals.o euitm_schemas.o prec_const.o $(MODS_f90_xml_interface:.f90=.o) chease_prog_effxml.f90 $(F90) $(F90FLAGS_O0) -c chease_prog_effxml.f90 $(INCL_FUTILS) $(INCL_HDF5) -chease_prog_imas_ids_effxml.o: SOLOV.inc COMDAT.inc globals.o euitm_schemas.o prec_const.o $(MODS_f90_xml_interface:.f90=.o) - sed "s/reflist/$(reflistorchoices)/" chease_prog_imas_ids.f90 > chease_prog_imas_ids_effxml.f90 +chease_prog_effxml.f90: + sed "s/reflist/$(reflistorchoices)/" chease_prog.f90 > chease_prog_effxml.f90 +chease_prog_imas_ids_effxml.o: SOLOV.inc COMDAT.inc globals.o euitm_schemas.o prec_const.o $(MODS_f90_xml_interface:.f90=.o) chease_prog_imas_ids_effxml.f90 $(F90) $(F90FLAGS_O0) -c chease_prog_imas_ids_effxml.f90 $(INCL_FUTILS) $(INCL_HDF5) +chease_prog_imas_ids_effxml.f90: + sed "s/reflist/$(reflistorchoices)/" chease_prog_imas_ids.f90 > chease_prog_imas_ids_effxml.f90 #euitm_schemas.o: #euitm_routines.o: euitm_schemas.o -euitm_xml_parser.o: itm_types.o string_manipulation_tools.o euitm_schemas.o +euitm_xml_parser.o: itm_types.o string_manipulation_tools.o euitm_schemas.o euitm_xml_parser.f90 $(F90) $(F90FLAGS_parser) -c euitm_xml_parser.f90 #euitm_utilities.o: euitm_schemas.o evlate.o: globals.o @@ -621,7 +650,7 @@ preset.o: globals.o prfunc.o: globals.o interpos_source.o priqqu.o: globals.o prnorm.o: globals.o -profile.o: globals.o interpol.o +profile.o: globals.o interpol.o interpos_source.o prof2d_rz_to_fluxtheta.o: itm_types.o interpos_source.o psibox.o: globals.o interpol.o interpos_source.o psicel.o: globals.o diff --git a/src-f90/Makefile.define_CHEASEF90 b/src-f90/Makefile.define_CHEASEF90 index 4a1c46382c111ca425a5d5399e45095bca31483f..534ad970c63d4ebaeb32f720ad56fc9d3ffb7418 100644 --- a/src-f90/Makefile.define_CHEASEF90 +++ b/src-f90/Makefile.define_CHEASEF90 @@ -73,3 +73,6 @@ CHEASE_F90 = ifort ifneq (,$(findstring iris,$(HOSTNAME))) CHEASE_F90 = gfortran endif + ifneq (,$(findstring nb-thay-1,$(HOSTNAME))) + CHEASE_F90 = gfortran + endif \ No newline at end of file diff --git a/src-f90/Makefile.define_FLAGS b/src-f90/Makefile.define_FLAGS index 0beaecd7c701234db5fb63155b7058d6911a206e..6aa17977fc32777affee3dd37765f77ed2b30aa4 100644 --- a/src-f90/Makefile.define_FLAGS +++ b/src-f90/Makefile.define_FLAGS @@ -205,17 +205,18 @@ ifeq ($(CHEASE_MACHINE),sun) LDFLAGS = -fast -O5 endif -ifeq ($(CHEASE_MACHINE),$(filter $(CHEASE_MACHINE), linux_nohdf5 aug)) +ifeq ($(CHEASE_MACHINE),$(filter $(CHEASE_MACHINE), linux_nohdf5 aug marconi ubuntu_22.04)) ifeq ($(CHEASE_F90),gfortran) F90 = gfortran - F90FLAGS_debug_gfortran = -Wextra -Wall -fimplicit-none -fcheck=all -fbacktrace -ffpe-trap=invalid,zero,overflow -g -Og -finit-real=nan - F90FLAGS = -g -O0 -Wall -ffree-line-length-none -I$(DIR_interpos) - F90FLAGS = -g -O2 -Wall -ffree-line-length-none -I$(DIR_interpos) - F90FLAGS_O0 = -g -O0 -Wall -ffree-line-length-none -I$(DIR_interpos) - F90FLAGS_parser = -O0 -ffree-line-length-none + F90_R8_FLAGS = -fdefault-real-8 -fdefault-double-8 + F90FLAGS_debug_gfortran = -Wextra -Wall -fimplicit-none -fcheck=all -fbacktrace -ffpe-trap=invalid,zero,overflow -g -Og -finit-real=nan $(F90_R8_FLAGS) + F90FLAGS = -g -O0 -Wall -ffree-line-length-none $(F90_R8_FLAGS) -I$(DIR_interpos) + F90FLAGS = -g -O2 -Wall -ffree-line-length-none $(F90_R8_FLAGS) -I$(DIR_interpos) + F90FLAGS_O0 = -g -O0 -Wall -ffree-line-length-none $(F90_R8_FLAGS) -I$(DIR_interpos) + F90FLAGS_parser = -O0 -ffree-line-length-none $(F90_R8_FLAGS) F90FLAGS_parser_nor8 = -O0 -ffree-line-length-none - LDFLAGS = -g -O0 -ffree-line-length-none - LDFLAGS = -g -O2 -ffree-line-length-none + LDFLAGS = -g -O0 -ffree-line-length-none $(F90_R8_FLAGS) + LDFLAGS = -g -O2 -ffree-line-length-none $(F90_R8_FLAGS) endif ifeq ($(CHEASE_F90),g95) F90 = g95 @@ -267,12 +268,20 @@ ifeq ($(CHEASE_MACHINE),$(filter $(CHEASE_MACHINE), linux_nohdf5 aug)) F90FLAGS_parser_nor8 = -O1 -r8 -ftrace=full -fno-second-underscore -fPIC LDFLAGS = -O3 -g -fPIC endif - ifeq ($(CHEASE_MACHINE),aug) + ifeq ($(CHEASE_MACHINE),$(filter $(CHEASE_MACHINE), aug marconi)) HDF5=$(HDF5_HOME) INCL_HDF5=-I$(HDF5)/include LIBS_HDF5 = -L$(FUTILS) -lfutils -L$(FUTILS)/mpiuni -lmpiuni -Wl,-rpath,$(HDF5)/lib -L$(HDF5)/lib -lhdf5_fortran -lhdf5 -lz Makefile_futils=Makefile.ifort endif + ifeq ($(CHEASE_MACHINE),ubuntu_22.04) + Makefile_futils = Makefile.gfortran + F90=gfortran + INCL_HDF5 = -I/usr/include/hdf5/serial/ + # LIBS_HDF5 = -Lfutils_src -lfutils -L/usr/lib/x86_64-linux-gnu/hdf5/serial/ -lhdf5_fortran -lhdf5 -L$(readlink -f futils_src/mpiuni) -lmpiuni + MPIUNI_DIR := $(shell readlink -f futils_src/mpiuni) + LIBS_HDF5 = -Lfutils_src -lfutils -L/usr/lib/x86_64-linux-gnu/hdf5/serial/ -lhdf5_fortran -lhdf5 -L$(MPIUNI_DIR) -lmpiuni + endif endif ifeq ($(CHEASE_MACHINE),win966) @@ -479,11 +488,11 @@ ifeq ($(CHEASE_MACHINE),ITER) ifeq ($(CHEASE_F90),gfortran) F90 = gfortran - F90FLAGS = -g -O3 -Wall -ffree-line-length-none `pkg-config imas-gfortran interpos --cflags` - F90FLAGS_O0 = -g -O0 -Wall -ffree-line-length-none `pkg-config imas-gfortran interpos --cflags` - F90FLAGS_parser = -O0 -ffree-line-length-none - F90FLAGS_parser_nor8 = -O0 -ffree-line-length-none - LDFLAGS = -g -O0 -ffree-line-length-none + F90FLAGS = -g -O3 -Wall -ffree-line-length-none -fPIC `pkg-config imas-gfortran interpos --cflags` + F90FLAGS_O0 = -g -O0 -Wall -ffree-line-length-none -fPIC `pkg-config imas-gfortran interpos --cflags` + F90FLAGS_parser = -O0 -ffree-line-length-none -fPIC + F90FLAGS_parser_nor8 = -O0 -ffree-line-length-none -fPIC + LDFLAGS = -g -O0 -ffree-line-length-none -fPIC OBJS_IMASlocal = LIBS = LIBS = `pkg-config imas-gfortran --libs` diff --git a/src-f90/Makefile.define_MACHINE b/src-f90/Makefile.define_MACHINE index 51ef569caf5e4ea686f486ebe8e5b35e71c8ba08..547fc496201eae80e1d5b980215c347b693256b0 100644 --- a/src-f90/Makefile.define_MACHINE +++ b/src-f90/Makefile.define_MACHINE @@ -71,7 +71,11 @@ CHEASE_MACHINE = none CHEASE_MACHINE = aug endif ifeq ($(findstring mpg.de,$(DOMAINNAME)),mpg.de) - CHEASE_MACHINE = aug + ifeq ($(findstring nb-thay-1,$(HOSTNAME)),nb-thay-1) + CHEASE_MACHINE = ubuntu_22.04 + else + CHEASE_MACHINE = aug + endif endif ifneq (,$(findstring occigen,$(HOSTNAME))) CHEASE_MACHINE = occigen @@ -102,3 +106,6 @@ CHEASE_MACHINE = none CHEASE_MACHINE = ITER endif endif + ifeq ($(findstring marconi.cineca.it,$(DOMAINNAME)),marconi.cineca.it) + CHEASE_MACHINE = marconi + endif diff --git a/src-f90/assign_chease_codeparameters_reflist.f90 b/src-f90/assign_chease_codeparameters_reflist.f90 index 25ee2e523f68776033b70aafe845b0eea587e19f..173761dee7f6f13914f8a63ccc91626bbc06d32d 100644 --- a/src-f90/assign_chease_codeparameters_reflist.f90 +++ b/src-f90/assign_chease_codeparameters_reflist.f90 @@ -1,997 +1,3231 @@ module assign_chease_codeparameters_reflist -! -! reference xml with a simple list series of input as opposed to choices with pre-defined group in _choices, the latter using xml2 and eg routines -! + ! + ! reference xml with a simple list series of input as opposed to choices with pre-defined group in _choices, the latter using xml2 and eg routines + ! implicit none contains + ! subroutine assign_chease_codepar_reflist(codeparameters, return_status) - !----------------------------------------------------------------------- - ! calls the XML parser for the code parameters and assign the - ! resulting values to the corresponding variables - ! NEEDS TO HAVE VARIABLES IN "lower case" - !TODO: check an alternative and more elegant solution in Perl - !----------------------------------------------------------------------- + !----------------------------------------------------------------------- + ! calls the XML parser for the code parameters and assign the + ! resulting values to the corresponding variables + ! NEEDS TO HAVE VARIABLES IN "lower case" + !TODO: check an alternative and more elegant solution in Perl + !----------------------------------------------------------------------- - ! This is the C. Konz option with its own parser but assuming all variable names are those with "ref=" in the xsd file - ! It does not allow choices and options with defaults. For this use the "choice" chease_schema_choice.xsd and related xml - ! The latter is used with the module assign_chease_codeparam_xml2eg.f90 and routine assign_codeparameters_choices + ! This is the C. Konz option with its own parser but assuming all variable names are those with "ref=" in the xsd file + ! It does not allow choices and options with defaults. For this use the "choice" chease_schema_choice.xsd and related xml + ! The latter is used with the module assign_chease_codeparam_xml2eg.f90 and routine assign_codeparameters_choices - use prec_const + use prec_const - use euitm_schemas - use euitm_xml_parser - use globals + use euitm_schemas + use euitm_xml_parser + use globals - implicit none - - type (type_param), intent(in) :: codeparameters - integer(ikind), intent(out) :: return_status + implicit none - type(tree) :: parameter_list - type(element), pointer :: temp_pointer - integer(itm_i4) :: nparm - integer(itm_i4) :: i, n_values - character(len = 132) :: cname - ! integer(ikind) :: ns, NEQDXTPO + type (type_param), intent(inout) :: codeparameters + integer(ikind), intent(out) :: return_status - !-- set path to XML schema - ! file_xml_schema = 'chease_schema.xml' + type(tree) :: parameter_list + type(element), pointer :: temp_pointer + integer(itm_i4) :: nparm + integer(itm_i4) :: i, n_values + character(len = 132) :: cname + ! integer(ikind) :: ns, NEQDXTPO - return_status = 0 ! no error + !-- set path to XML schema + ! file_xml_schema = 'chease_schema.xml' - !-- parse xml-string codeparameters%parameters + return_status = 0 ! no error - call euitm_xml_parse(codeparameters, nparm, parameter_list) - ! IF (NVERBOSE .GE. 2) print *,'codeparameters%parameters= ',codeparameters%parameters - IF (NVERBOSE .GE. 3) print *,' nparm= ',nparm - ! IF (NVERBOSE .GE. 2) print *,'parameter_list= ',parameter_list + !-- parse xml-string codeparameters%parameters + if (.not. associated(codeparameters%schema)) call get_schema(codeparameters,return_status) + if (.not. associated(codeparameters%schema)) then + print *,'in assign_chease_codeparameters_reflist: schema not provided, do not get parameters' + return + end if + call euitm_xml_parse(codeparameters, nparm, parameter_list) + IF (NVERBOSE .GE. 3) print *,' nparm= ',nparm - !-- assign variables + !-- assign variables - temp_pointer => parameter_list%first + temp_pointer => parameter_list%first - outer: do - cname = char2str(temp_pointer%cname) ! necessary for AIX - ! IF (NVERBOSE .GE. 2) print *,'cname = ', trim(cname) - select case (cname) - case ("parameters") + outer: do + cname = char2str(temp_pointer%cname) ! necessary for AIX + ! IF (NVERBOSE .GE. 2) print *,'cname = ', trim(cname) + select case (cname) + case ("parameters") temp_pointer => temp_pointer%child cycle - case ("epslon") + case ("epslon") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, epslon) + call char2num(temp_pointer%cvalue, epslon) ! IF (NVERBOSE .GE. 2) print *,' epslon= ',epslon - case ("relax") + case ("relax") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, relax) + call char2num(temp_pointer%cvalue, relax) ! IF (NVERBOSE .GE. 2) print *,' relax= ',relax - case ("cocos_in") + case ("cocos_in") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, COCOS_IN) + call char2num(temp_pointer%cvalue, COCOS_IN) ! IF (NVERBOSE .GE. 2) print *,' COCOS_IN= ',COCOS_IN - case ("cocos_out") + case ("cocos_out") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, COCOS_OUT) + call char2num(temp_pointer%cvalue, COCOS_OUT) ! IF (NVERBOSE .GE. 2) print *,' COCOS_OUT= ',COCOS_OUT - case ("nverbose") + case ("nverbose") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, NVERBOSE) + call char2num(temp_pointer%cvalue, NVERBOSE) ! IF (NVERBOSE .GE. 2) print *,' NVERBOSE= ',NVERBOSE - case ("ninmap") + case ("ninmap") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, ninmap) + call char2num(temp_pointer%cvalue, ninmap) ! IF (NVERBOSE .GE. 2) print *,' ninmap= ',ninmap - case ("ninsca") + case ("ninsca") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, ninsca) + call char2num(temp_pointer%cvalue, ninsca) ! IF (NVERBOSE .GE. 2) print *,' ninsca= ',ninsca - case ("nmgaus") + case ("nmgaus") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, nmgaus) + call char2num(temp_pointer%cvalue, nmgaus) ! IF (NVERBOSE .GE. 2) print *,' nmgaus= ',nmgaus - case ("nsgaus") + case ("nsgaus") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, nsgaus) + call char2num(temp_pointer%cvalue, nsgaus) ! IF (NVERBOSE .GE. 2) print *,' nsgaus= ',nsgaus - case ("ntgaus") + case ("ntgaus") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, ntgaus) + call char2num(temp_pointer%cvalue, ntgaus) ! IF (NVERBOSE .GE. 2) print *,' ntgaus= ',ntgaus ! ! Arrays - case ("aplace") + case ("aplace") ! array if (allocated(temp_pointer%cvalue)) & - call scan_str2num(char2str(temp_pointer%cvalue), aplace, n_values) + call scan_str2num(char2str(temp_pointer%cvalue), aplace, n_values) ! IF (NVERBOSE .GE. 2) print *,' aplace= ',aplace ! IF (NVERBOSE .GE. 2) print *,' n_values= ',n_values - case ("awidth") + case ("awidth") ! array if (allocated(temp_pointer%cvalue)) & - call scan_str2num(char2str(temp_pointer%cvalue), awidth, n_values) + call scan_str2num(char2str(temp_pointer%cvalue), awidth, n_values) ! IF (NVERBOSE .GE. 2) print *,' awidth= ',awidth ! IF (NVERBOSE .GE. 2) print *,' n_values= ',n_values - case ("bplace") + case ("bplace") ! array if (allocated(temp_pointer%cvalue)) & - call scan_str2num(char2str(temp_pointer%cvalue), bplace, n_values) + call scan_str2num(char2str(temp_pointer%cvalue), bplace, n_values) ! IF (NVERBOSE .GE. 2) print *,' bplace= ',bplace ! IF (NVERBOSE .GE. 2) print *,' n_values= ',n_values - case ("bwidth") + case ("bwidth") ! array if (allocated(temp_pointer%cvalue)) & - call scan_str2num(char2str(temp_pointer%cvalue), bwidth, n_values) + call scan_str2num(char2str(temp_pointer%cvalue), bwidth, n_values) ! IF (NVERBOSE .GE. 2) print *,' bwidth= ',bwidth ! IF (NVERBOSE .GE. 2) print *,' n_values= ',n_values - case ("cplace") + case ("cplace") ! array if (allocated(temp_pointer%cvalue)) & - call scan_str2num(char2str(temp_pointer%cvalue), cplace, n_values) + call scan_str2num(char2str(temp_pointer%cvalue), cplace, n_values) ! IF (NVERBOSE .GE. 2) print *,' cplace= ',cplace ! IF (NVERBOSE .GE. 2) print *,' n_values= ',n_values - case ("cwidth") + case ("cwidth") ! array if (allocated(temp_pointer%cvalue)) & - call scan_str2num(char2str(temp_pointer%cvalue), cwidth, n_values) + call scan_str2num(char2str(temp_pointer%cvalue), cwidth, n_values) ! IF (NVERBOSE .GE. 2) print *,' cwidth= ',cwidth ! IF (NVERBOSE .GE. 2) print *,' n_values= ',n_values - case ("dplace") + case ("dplace") ! array if (allocated(temp_pointer%cvalue)) & - call scan_str2num(char2str(temp_pointer%cvalue), dplace, n_values) + call scan_str2num(char2str(temp_pointer%cvalue), dplace, n_values) ! IF (NVERBOSE .GE. 2) print *,' dplace= ',dplace ! IF (NVERBOSE .GE. 2) print *,' n_values= ',n_values - case ("dwidth") + case ("dwidth") ! array if (allocated(temp_pointer%cvalue)) & - call scan_str2num(char2str(temp_pointer%cvalue), dwidth, n_values) + call scan_str2num(char2str(temp_pointer%cvalue), dwidth, n_values) ! IF (NVERBOSE .GE. 2) print *,' dwidth= ',dwidth ! IF (NVERBOSE .GE. 2) print *,' n_values= ',n_values - case ("eplace") + case ("eplace") ! array if (allocated(temp_pointer%cvalue)) & - call scan_str2num(char2str(temp_pointer%cvalue), eplace, n_values) + call scan_str2num(char2str(temp_pointer%cvalue), eplace, n_values) ! IF (NVERBOSE .GE. 2) print *,' eplace= ',eplace ! IF (NVERBOSE .GE. 2) print *,' n_values= ',n_values - case ("ewidth") + case ("ewidth") ! array if (allocated(temp_pointer%cvalue)) & - call scan_str2num(char2str(temp_pointer%cvalue), ewidth, n_values) + call scan_str2num(char2str(temp_pointer%cvalue), ewidth, n_values) ! IF (NVERBOSE .GE. 2) print *,' ewidth= ',ewidth ! IF (NVERBOSE .GE. 2) print *,' n_values= ',n_values - case ("qplace") + case ("qplace") ! array if (allocated(temp_pointer%cvalue)) & - call scan_str2num(char2str(temp_pointer%cvalue), qplace, n_values) + call scan_str2num(char2str(temp_pointer%cvalue), qplace, n_values) ! IF (NVERBOSE .GE. 2) print *,' qplace= ',qplace ! IF (NVERBOSE .GE. 2) print *,' n_values= ',n_values - case ("qwidth") + case ("qwidth") ! array if (allocated(temp_pointer%cvalue)) & - call scan_str2num(char2str(temp_pointer%cvalue), qwidth, n_values) + call scan_str2num(char2str(temp_pointer%cvalue), qwidth, n_values) ! IF (NVERBOSE .GE. 2) print *,' qwidth= ',qwidth ! IF (NVERBOSE .GE. 2) print *,' n_values= ',n_values - case ("solpda") + case ("solpda") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, solpda) + call char2num(temp_pointer%cvalue, solpda) ! IF (NVERBOSE .GE. 2) print *,' solpda= ',solpda - case ("solpdb") + case ("solpdb") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, solpdb) + call char2num(temp_pointer%cvalue, solpdb) ! IF (NVERBOSE .GE. 2) print *,' solpdb= ',solpdb - case ("solpdc") + case ("solpdc") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, solpdc) + call char2num(temp_pointer%cvalue, solpdc) ! IF (NVERBOSE .GE. 2) print *,' solpdc= ',solpdc - case ("solpdd") + case ("solpdd") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, solpdd) + call char2num(temp_pointer%cvalue, solpdd) ! IF (NVERBOSE .GE. 2) print *,' solpdd= ',solpdd - case ("solpde") + case ("solpde") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, solpde) + call char2num(temp_pointer%cvalue, solpde) ! IF (NVERBOSE .GE. 2) print *,' solpde= ',solpde - case ("solpdpol") + case ("solpdpol") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, solpdpol) + call char2num(temp_pointer%cvalue, solpdpol) ! IF (NVERBOSE .GE. 2) print *,' solpdpol= ',solpdpol - case ("msmax") + case ("msmax") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, msmax) + call char2num(temp_pointer%cvalue, msmax) ! IF (NVERBOSE .GE. 2) print *,' msmax= ',msmax - case ("nchi") + case ("nchi") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, nchi) + call char2num(temp_pointer%cvalue, nchi) ! IF (NVERBOSE .GE. 2) print *,' nchi= ',nchi - case ("ndift") + case ("ndift") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, ndift) + call char2num(temp_pointer%cvalue, ndift) ! IF (NVERBOSE .GE. 2) print *,' ndift= ',ndift - case ("negp") + case ("negp") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, negp) + call char2num(temp_pointer%cvalue, negp) ! IF (NVERBOSE .GE. 2) print *,' negp= ',negp - case ("ner") + case ("ner") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, ner) + call char2num(temp_pointer%cvalue, ner) ! IF (NVERBOSE .GE. 2) print *,' ner= ',ner - case ("niso") + case ("niso") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, niso) + call char2num(temp_pointer%cvalue, niso) ! IF (NVERBOSE .GE. 2) print *,' niso= ',niso - case ("nmesha") + case ("nmesha") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, nmesha) + call char2num(temp_pointer%cvalue, nmesha) ! IF (NVERBOSE .GE. 2) print *,' nmesha= ',nmesha - case ("nmeshb") + case ("nmeshb") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, nmeshb) + call char2num(temp_pointer%cvalue, nmeshb) ! IF (NVERBOSE .GE. 2) print *,' nmeshb= ',nmeshb - case ("nmeshc") + case ("nmeshc") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, nmeshc) + call char2num(temp_pointer%cvalue, nmeshc) ! IF (NVERBOSE .GE. 2) print *,' nmeshc= ',nmeshc - case ("nmeshd") + case ("nmeshd") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, nmeshd) + call char2num(temp_pointer%cvalue, nmeshd) ! IF (NVERBOSE .GE. 2) print *,' nmeshd= ',nmeshd - case ("nmeshe") + case ("nmeshe") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, nmeshe) + call char2num(temp_pointer%cvalue, nmeshe) ! IF (NVERBOSE .GE. 2) print *,' nmeshe= ',nmeshe - case ("nmeshpol") + case ("nmeshpol") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, nmeshpol) + call char2num(temp_pointer%cvalue, nmeshpol) ! IF (NVERBOSE .GE. 2) print *,' nmeshpol= ',nmeshpol - case ("nmeshpolexp") + case ("nmeshpolexp") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, nmeshpolexp) + call char2num(temp_pointer%cvalue, nmeshpolexp) ! IF (NVERBOSE .GE. 2) print *,' nmeshpolexp= ',nmeshpolexp - case ("npoida") + case ("npoida") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, npoida) + call char2num(temp_pointer%cvalue, npoida) ! IF (NVERBOSE .GE. 2) print *,' npoida= ',npoida - case ("npoidb") + case ("npoidb") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, npoidb) + call char2num(temp_pointer%cvalue, npoidb) ! IF (NVERBOSE .GE. 2) print *,' npoidb= ',npoidb - case ("npoidc") + case ("npoidc") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, npoidc) + call char2num(temp_pointer%cvalue, npoidc) ! IF (NVERBOSE .GE. 2) print *,' npoidc= ',npoidc - case ("npoidd") + case ("npoidd") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, npoidd) + call char2num(temp_pointer%cvalue, npoidd) ! IF (NVERBOSE .GE. 2) print *,' npoidd= ',npoidd - case ("npoide") + case ("npoide") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, npoide) + call char2num(temp_pointer%cvalue, npoide) ! IF (NVERBOSE .GE. 2) print *,' npoide= ',npoide - case ("npoidq") + case ("npoidq") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, npoidq) + call char2num(temp_pointer%cvalue, npoidq) ! IF (NVERBOSE .GE. 2) print *,' npoidq= ',npoidq - case ("npsi") + case ("npsi") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, npsi) + call char2num(temp_pointer%cvalue, npsi) ! IF (NVERBOSE .GE. 2) print *,' npsi= ',npsi - case ("ns") + case ("ns") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, ns) + call char2num(temp_pointer%cvalue, ns) ! IF (NVERBOSE .GE. 2) print *,' ns= ',ns - case ("nt") + case ("nt") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, nt) + call char2num(temp_pointer%cvalue, nt) ! IF (NVERBOSE .GE. 2) print *,' nt= ',nt - case ("ntnova") + case ("ntnova") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, ntnova) + call char2num(temp_pointer%cvalue, ntnova) ! IF (NVERBOSE .GE. 2) print *,' ntnova= ',ntnova - case ("nv") + case ("nv") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, nv) + call char2num(temp_pointer%cvalue, nv) ! IF (NVERBOSE .GE. 2) print *,' nv= ',nv - case ("nvexp") + case ("nvexp") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, nvexp) + call char2num(temp_pointer%cvalue, nvexp) ! IF (NVERBOSE .GE. 2) print *,' nvexp= ',nvexp - case ("bsfrac") + case ("bsfrac") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, bsfrac) + call char2num(temp_pointer%cvalue, bsfrac) ! IF (NVERBOSE .GE. 2) print *,' bsfrac= ',bsfrac - case ("cfbal") + case ("cfbal") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, cfbal) + call char2num(temp_pointer%cvalue, cfbal) ! IF (NVERBOSE .GE. 2) print *,' cfbal= ',cfbal - case ("cfnress") + case ("cfnress") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, cfnress) + call char2num(temp_pointer%cvalue, cfnress) ! IF (NVERBOSE .GE. 2) print *,' cfnress= ',cfnress - case ("cfnresso") + case ("cfnresso") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, cfnresso) + call char2num(temp_pointer%cvalue, cfnresso) ! IF (NVERBOSE .GE. 2) print *,' cfnresso= ',cfnresso - case ("cpress") + case ("cpress") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, cpress) + call char2num(temp_pointer%cvalue, cpress) ! IF (NVERBOSE .GE. 2) print *,' cpress= ',cpress - case ("cpresso") + case ("cpresso") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, cpresso) + call char2num(temp_pointer%cvalue, cpresso) ! IF (NVERBOSE .GE. 2) print *,' cpresso= ',cpresso - case ("cq0") + case ("cq0") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, cq0) + call char2num(temp_pointer%cvalue, cq0) ! IF (NVERBOSE .GE. 2) print *,' cq0= ',cq0 - case ("csspec") + case ("csspec") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, csspec) + call char2num(temp_pointer%cvalue, csspec) ! IF (NVERBOSE .GE. 2) print *,' csspec= ',csspec - case ("currt") + case ("currt") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, currt) + call char2num(temp_pointer%cvalue, currt) ! IF (NVERBOSE .GE. 2) print *,' currt= ',currt - case ("etaei") + case ("etaei") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, etaei) + call char2num(temp_pointer%cvalue, etaei) ! IF (NVERBOSE .GE. 2) print *,' etaei= ',etaei - case ("gamma") + case ("gamma") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, gamma) + call char2num(temp_pointer%cvalue, gamma) ! IF (NVERBOSE .GE. 2) print *,' gamma= ',gamma - case ("pangle") + case ("pangle") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, pangle) + call char2num(temp_pointer%cvalue, pangle) ! IF (NVERBOSE .GE. 2) print *,' pangle= ',pangle - case ("predge") + case ("predge") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, predge) + call char2num(temp_pointer%cvalue, predge) ! IF (NVERBOSE .GE. 2) print *,' predge= ',predge - case ("psibndexp") + case ("psibndexp") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, psibndexp) + call char2num(temp_pointer%cvalue, psibndexp) ! IF (NVERBOSE .GE. 2) print *,' psibndexp= ',psibndexp - case ("psiscl") + case ("psiscl") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, psiscl) + call char2num(temp_pointer%cvalue, psiscl) ! IF (NVERBOSE .GE. 2) print *,' psiscl= ',psiscl - case ("qspec") + case ("qspec") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, qspec) + call char2num(temp_pointer%cvalue, qspec) ! IF (NVERBOSE .GE. 2) print *,' qspec= ',qspec - case ("rzion") + case ("rzion") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, rzion) + call char2num(temp_pointer%cvalue, rzion) ! IF (NVERBOSE .GE. 2) print *,' rzion= ',rzion - case ("scalne") + case ("scalne") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, scalne) + call char2num(temp_pointer%cvalue, scalne) ! IF (NVERBOSE .GE. 2) print *,' scalne= ',scalne - case ("scexp") + case ("scexp") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, scexp) + call char2num(temp_pointer%cvalue, scexp) ! IF (NVERBOSE .GE. 2) print *,' scexp= ',scexp - case ("nbsfun") + case ("nbsfun") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, nbsfun) + call char2num(temp_pointer%cvalue, nbsfun) ! IF (NVERBOSE .GE. 2) print *,' nbsfun= ',nbsfun - case ("nbsopt") + case ("nbsopt") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, nbsopt) + call char2num(temp_pointer%cvalue, nbsopt) ! IF (NVERBOSE .GE. 2) print *,' nbsopt= ',nbsopt - case ("nbstrp") + case ("nbstrp") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, nbstrp) + call char2num(temp_pointer%cvalue, nbstrp) ! IF (NVERBOSE .GE. 2) print *,' nbstrp= ',nbstrp - case ("nfunrho") + case ("nfunrho") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, nfunrho) + call char2num(temp_pointer%cvalue, nfunrho) IF (NVERBOSE .GE. 2) print *,' nfunrho= ',nfunrho - case ("nrhomesh") + case ("nrhomesh") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, nrhomesh) + call char2num(temp_pointer%cvalue, nrhomesh) IF (NVERBOSE .GE. 2) print *,' nrhomesh= ',nrhomesh - case ("nrfp") + case ("nrfp") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, nrfp) + call char2num(temp_pointer%cvalue, nrfp) ! IF (NVERBOSE .GE. 2) print *,' nrfp= ',nrfp - case ("aspct") + case ("aspct") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, aspct) + call char2num(temp_pointer%cvalue, aspct) ! IF (NVERBOSE .GE. 2) print *,' aspct= ',aspct - case ("beans") + case ("beans") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, beans) + call char2num(temp_pointer%cvalue, beans) ! IF (NVERBOSE .GE. 2) print *,' beans= ',beans - case ("ceta") + case ("ceta") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, ceta) + call char2num(temp_pointer%cvalue, ceta) ! IF (NVERBOSE .GE. 2) print *,' ceta= ',ceta - case ("delta") + case ("delta") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, delta) + call char2num(temp_pointer%cvalue, delta) ! IF (NVERBOSE .GE. 2) print *,' delta= ',delta - case ("elong") + case ("elong") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, elong) + call char2num(temp_pointer%cvalue, elong) ! IF (NVERBOSE .GE. 2) print *,' elong= ',elong - case ("rc") + case ("rc") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, rc) + call char2num(temp_pointer%cvalue, rc) ! IF (NVERBOSE .GE. 2) print *,' rc= ',rc - case ("rnu") + case ("rnu") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, rnu) + call char2num(temp_pointer%cvalue, rnu) ! IF (NVERBOSE .GE. 2) print *,' rnu= ',rnu - case ("rz0") + case ("rz0") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, rz0) + call char2num(temp_pointer%cvalue, rz0) ! IF (NVERBOSE .GE. 2) print *,' rz0= ',rz0 - case ("r0") + case ("r0") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, r0) + call char2num(temp_pointer%cvalue, r0) ! IF (NVERBOSE .GE. 2) print *,' r0= ',r0 - case ("sgma") + case ("sgma") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, sgma) + call char2num(temp_pointer%cvalue, sgma) ! IF (NVERBOSE .GE. 2) print *,' sgma= ',sgma - case ("tensprof") + case ("tensprof") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, tensprof) + call char2num(temp_pointer%cvalue, tensprof) ! IF (NVERBOSE .GE. 2) print *,' tensprof= ',tensprof - case ("tensbnd") + case ("tensbnd") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, tensbnd) + call char2num(temp_pointer%cvalue, tensbnd) ! IF (NVERBOSE .GE. 2) print *,' tensbnd= ',tensbnd - case ("theta0") + case ("theta0") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, theta0) + call char2num(temp_pointer%cvalue, theta0) ! IF (NVERBOSE .GE. 2) print *,' theta0= ',theta0 - case ("triang") + case ("triang") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, triang) + call char2num(temp_pointer%cvalue, triang) ! IF (NVERBOSE .GE. 2) print *,' triang= ',triang - case ("triplt") + case ("triplt") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, triplt) + call char2num(temp_pointer%cvalue, triplt) ! IF (NVERBOSE .GE. 2) print *,' triplt= ',triplt - case ("xi") + case ("xi") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, xi) + call char2num(temp_pointer%cvalue, xi) ! IF (NVERBOSE .GE. 2) print *,' xi= ',xi - case ("nsurf") + case ("nsurf") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, nsurf) + call char2num(temp_pointer%cvalue, nsurf) ! IF (NVERBOSE .GE. 2) print *,' nsurf= ',nsurf - case ("nsym") + case ("nsym") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, nsym) + call char2num(temp_pointer%cvalue, nsym) ! IF (NVERBOSE .GE. 2) print *,' nsym= ',nsym - case ("afbs") + case ("afbs") ! array if (allocated(temp_pointer%cvalue)) & - call scan_str2num(char2str(temp_pointer%cvalue), afbs, n_values) + call scan_str2num(char2str(temp_pointer%cvalue), afbs, n_values) ! IF (NVERBOSE .GE. 2) print *,' afbs= ',afbs ! IF (NVERBOSE .GE. 2) print *,' n_values= ',n_values - case ("afbs2") + case ("afbs2") ! array if (allocated(temp_pointer%cvalue)) & - call scan_str2num(char2str(temp_pointer%cvalue), afbs2, n_values) + call scan_str2num(char2str(temp_pointer%cvalue), afbs2, n_values) ! IF (NVERBOSE .GE. 2) print *,' afbs2= ',afbs2 ! IF (NVERBOSE .GE. 2) print *,' n_values= ',n_values - case ("ap") + case ("ap") ! array if (allocated(temp_pointer%cvalue)) & - call scan_str2num(char2str(temp_pointer%cvalue), ap, n_values) + call scan_str2num(char2str(temp_pointer%cvalue), ap, n_values) ! IF (NVERBOSE .GE. 2) print *,' ap= ',ap ! IF (NVERBOSE .GE. 2) print *,' n_values= ',n_values - case ("ap2") + case ("ap2") ! array if (allocated(temp_pointer%cvalue)) & - call scan_str2num(char2str(temp_pointer%cvalue), ap2, n_values) + call scan_str2num(char2str(temp_pointer%cvalue), ap2, n_values) ! IF (NVERBOSE .GE. 2) print *,' ap2= ',ap2 ! IF (NVERBOSE .GE. 2) print *,' n_values= ',n_values - case ("at") + case ("at") ! array if (allocated(temp_pointer%cvalue)) & - call scan_str2num(char2str(temp_pointer%cvalue), at, n_values) + call scan_str2num(char2str(temp_pointer%cvalue), at, n_values) ! IF (NVERBOSE .GE. 2) print *,' at= ',at ! IF (NVERBOSE .GE. 2) print *,' n_values= ',n_values - case ("at2") + case ("at2") ! array if (allocated(temp_pointer%cvalue)) & - call scan_str2num(char2str(temp_pointer%cvalue), at2, n_values) + call scan_str2num(char2str(temp_pointer%cvalue), at2, n_values) ! IF (NVERBOSE .GE. 2) print *,' at2= ',at2 ! IF (NVERBOSE .GE. 2) print *,' n_values= ',n_values - case ("at3") + case ("at3") ! array if (allocated(temp_pointer%cvalue)) & - call scan_str2num(char2str(temp_pointer%cvalue), at3, n_values) + call scan_str2num(char2str(temp_pointer%cvalue), at3, n_values) ! IF (NVERBOSE .GE. 2) print *,' at3= ',at3 ! IF (NVERBOSE .GE. 2) print *,' n_values= ',n_values - case ("at4") + case ("at4") ! array if (allocated(temp_pointer%cvalue)) & - call scan_str2num(char2str(temp_pointer%cvalue), at4, n_values) + call scan_str2num(char2str(temp_pointer%cvalue), at4, n_values) ! IF (NVERBOSE .GE. 2) print *,' at4= ',at4 ! IF (NVERBOSE .GE. 2) print *,' n_values= ',n_values - case ("nfixaxis") + case ("nfixaxis") ! integer/real constant if (allocated(temp_pointer%cvalue)) & call char2num(temp_pointer%cvalue, nfixaxis) ! IF (NVERBOSE .GE. 2) print *,' nfixaxis= ',nfixaxis - case ("nfunc") + case ("nfunc") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, nfunc) + call char2num(temp_pointer%cvalue, nfunc) ! IF (NVERBOSE .GE. 2) print *,' nfunc= ',nfunc - case ("nipr") + case ("nipr") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, nipr) + call char2num(temp_pointer%cvalue, nipr) ! IF (NVERBOSE .GE. 2) print *,' nipr= ',nipr - case ("npp") + case ("npp") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, npp) + call char2num(temp_pointer%cvalue, npp) ! IF (NVERBOSE .GE. 2) print *,' npp= ',npp - case ("nppfun") + case ("nppfun") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, nppfun) + call char2num(temp_pointer%cvalue, nppfun) ! IF (NVERBOSE .GE. 2) print *,' nppfun= ',nppfun - case ("nppr") + case ("nppr") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, nppr) + call char2num(temp_pointer%cvalue, nppr) ! IF (NVERBOSE .GE. 2) print *,' nppr= ',nppr - case ("nprofz") + case ("nprofz") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, nprofz) + call char2num(temp_pointer%cvalue, nprofz) ! IF (NVERBOSE .GE. 2) print *,' nprofz= ',nprofz - case ("nprof2d") + case ("nprof2d") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, nprof2d) + call char2num(temp_pointer%cvalue, nprof2d) ! IF (NVERBOSE .GE. 2) print *,' nprof2d= ',nprof2d - case ("npropt") + case ("npropt") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, npropt) + call char2num(temp_pointer%cvalue, npropt) ! IF (NVERBOSE .GE. 2) print *,' npropt= ',npropt - case ("nsour") + case ("nsour") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, nsour) + call char2num(temp_pointer%cvalue, nsour) ! IF (NVERBOSE .GE. 2) print *,' nsour= ',nsour - case ("nsttp") + case ("nsttp") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, nsttp) + call char2num(temp_pointer%cvalue, nsttp) ! IF (NVERBOSE .GE. 2) print *,' nsttp= ',nsttp - case ("bentaxis") + case ("bentaxis") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, bentaxis) + call char2num(temp_pointer%cvalue, bentaxis) ! IF (NVERBOSE .GE. 2) print *,' bentaxis= ',bentaxis - case ("bentqprofile") + case ("bentqprofile") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, bentqprofile) + call char2num(temp_pointer%cvalue, bentqprofile) ! IF (NVERBOSE .GE. 2) print *,' bentqprofile= ',bentqprofile - case ("bentradius") + case ("bentradius") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, bentradius) + call char2num(temp_pointer%cvalue, bentradius) ! IF (NVERBOSE .GE. 2) print *,' bentradius= ',bentradius - case ("b0exp") + case ("b0exp") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, b0exp) + call char2num(temp_pointer%cvalue, b0exp) ! IF (NVERBOSE .GE. 2) print *,' b0exp= ',b0exp - case ("comments") + case ("comments") ! char array if (allocated(temp_pointer%cvalue)) & - comments = char2str(temp_pointer%cvalue) + comments = char2str(temp_pointer%cvalue) n_values = size(comments) ! n_values = len(comments) do i=1,n_values - ! IF (NVERBOSE .GE. 2) print *,'comments(',i,') = ',comments(i) + ! IF (NVERBOSE .GE. 2) print *,'comments(',i,') = ',comments(i) end do ! IF (NVERBOSE .GE. 2) print *,' size(comments)= ',size(comments) ! IF (NVERBOSE .GE. 2) print *,' len(comments)= ',len(comments) - case ("qvalneo") + case ("qvalneo") ! array if (allocated(temp_pointer%cvalue)) & - call scan_str2num(char2str(temp_pointer%cvalue), qvalneo, n_values) + call scan_str2num(char2str(temp_pointer%cvalue), qvalneo, n_values) ! IF (NVERBOSE .GE. 2) print *,' qvalneo= ',qvalneo ! IF (NVERBOSE .GE. 2) print *,' n_values= ',n_values - case ("rboxlen") + case ("rboxlen") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, rboxlen) + call char2num(temp_pointer%cvalue, rboxlen) ! IF (NVERBOSE .GE. 2) print *,' rboxlen= ',rboxlen - case ("rboxlft") + case ("rboxlft") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, rboxlft) + call char2num(temp_pointer%cvalue, rboxlft) ! IF (NVERBOSE .GE. 2) print *,' rboxlft= ',rboxlft - case ("rext") + case ("rext") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, rext) + call char2num(temp_pointer%cvalue, rext) ! IF (NVERBOSE .GE. 2) print *,' rext= ',rext - case ("rpeop") + case ("rpeop") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, rpeop) + call char2num(temp_pointer%cvalue, rpeop) ! IF (NVERBOSE .GE. 2) print *,' rpeop= ',rpeop - case ("rz0w") + case ("rz0w") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, rz0w) + call char2num(temp_pointer%cvalue, rz0w) ! IF (NVERBOSE .GE. 2) print *,' rz0w= ',rz0w - case ("r0exp") + case ("r0exp") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, r0exp) + call char2num(temp_pointer%cvalue, r0exp) ! IF (NVERBOSE .GE. 2) print *,' r0exp= ',r0exp - case ("r0w") + case ("r0w") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, r0w) + call char2num(temp_pointer%cvalue, r0w) ! IF (NVERBOSE .GE. 2) print *,' r0w= ',r0w - case ("signb0xp") + case ("signb0xp") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, signb0xp) + call char2num(temp_pointer%cvalue, signb0xp) ! IF (NVERBOSE .GE. 2) print *,' signb0xp= ',signb0xp - case ("signipxp") + case ("signipxp") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, signipxp) + call char2num(temp_pointer%cvalue, signipxp) ! IF (NVERBOSE .GE. 2) print *,' signipxp= ',signipxp - case ("slimit") + case ("slimit") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, slimit) + call char2num(temp_pointer%cvalue, slimit) ! IF (NVERBOSE .GE. 2) print *,' slimit= ',slimit - case ("snumber") + case ("snumber") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, snumber) + call char2num(temp_pointer%cvalue, snumber) ! IF (NVERBOSE .GE. 2) print *,' snumber= ',snumber - case ("shift_p") + case ("shift_p") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, shift_p) + call char2num(temp_pointer%cvalue, shift_p) ! IF (NVERBOSE .GE. 2) print *,' shift_p= ',shift_p - case ("time_ref") + case ("time_ref") ! array if (allocated(temp_pointer%cvalue)) & - call scan_str2num(char2str(temp_pointer%cvalue), time_ref, n_values) + call scan_str2num(char2str(temp_pointer%cvalue), time_ref, n_values) ! IF (NVERBOSE .GE. 2) print *,' time_ref= ',time_ref - case ("treeitm") + case ("treeitm") ! array if (allocated(temp_pointer%cvalue)) & - treeitm = char2str(temp_pointer%cvalue) + treeitm = char2str(temp_pointer%cvalue) n_values = len(treeitm) ! IF (NVERBOSE .GE. 2) print *,' treeitm= ',treeitm ! IF (NVERBOSE .GE. 2) print *,' n_values= ',n_values - case ("tree_user") + case ("tree_user") ! array if (allocated(temp_pointer%cvalue)) & - tree_user = char2str(temp_pointer%cvalue) + tree_user = char2str(temp_pointer%cvalue) n_values = len(tree_user) ! IF (NVERBOSE .GE. 2) print *,' tree_user= ',tree_user ! IF (NVERBOSE .GE. 2) print *,' n_values= ',n_values - case ("tree_tokamak") + case ("tree_tokamak") ! array if (allocated(temp_pointer%cvalue)) & - tree_tokamak = char2str(temp_pointer%cvalue) + tree_tokamak = char2str(temp_pointer%cvalue) n_values = len(tree_tokamak) ! IF (NVERBOSE .GE. 2) print *,' tree_tokamak= ',tree_tokamak ! IF (NVERBOSE .GE. 2) print *,' n_values= ',n_values - case ("tree_majorversion") + case ("tree_majorversion") ! array if (allocated(temp_pointer%cvalue)) & - tree_majorversion = char2str(temp_pointer%cvalue) + tree_majorversion = char2str(temp_pointer%cvalue) n_values = len(tree_majorversion) ! IF (NVERBOSE .GE. 2) print *,' tree_majorversion= ',tree_majorversion ! IF (NVERBOSE .GE. 2) print *,' n_values= ',n_values - case ("zboxlen") + case ("zboxlen") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, zboxlen) + call char2num(temp_pointer%cvalue, zboxlen) ! IF (NVERBOSE .GE. 2) print *,' zboxlen= ',zboxlen - case ("zboxmid") + case ("zboxmid") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, zboxmid) + call char2num(temp_pointer%cvalue, zboxmid) ! IF (NVERBOSE .GE. 2) print *,' zboxmid= ',zboxmid - case ("n0jedge") + case ("n0jedge") ! integer/real constant if (allocated(temp_pointer%cvalue)) & call char2num(temp_pointer%cvalue,n0jedge) ! IF (NVERBOSE .GE. 2) print *,' n0jedge= ',n0jedge - case ("nanal") + case ("nanal") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, nanal) + call char2num(temp_pointer%cvalue, nanal) ! IF (NVERBOSE .GE. 2) print *,' nanal= ',nanal - case ("nbal") + case ("nbal") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, nbal) + call char2num(temp_pointer%cvalue, nbal) ! IF (NVERBOSE .GE. 2) print *,' nbal= ',nbal - case ("nblc0") + case ("nblc0") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, nblc0) + call char2num(temp_pointer%cvalue, nblc0) ! IF (NVERBOSE .GE. 2) print *,' nblc0= ',nblc0 - case ("nblopt") + case ("nblopt") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, nblopt) + call char2num(temp_pointer%cvalue, nblopt) ! IF (NVERBOSE .GE. 2) print *,' nblopt= ',nblopt - case ("nbpsout") + case ("nbpsout") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, nbpsout) + call char2num(temp_pointer%cvalue, nbpsout) ! IF (NVERBOSE .GE. 2) print *,' nbpsout= ',nbpsout - case ("nbsexpq") + case ("nbsexpq") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, nbsexpq) + call char2num(temp_pointer%cvalue, nbsexpq) ! IF (NVERBOSE .GE. 2) print *,' nbsexpq= ',nbsexpq - case ("ncscal") + case ("ncscal") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, ncscal) + call char2num(temp_pointer%cvalue, ncscal) ! IF (NVERBOSE .GE. 2) print *,' ncscal= ',ncscal - case ("ndiagop") + case ("ndiagop") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, ndiagop) + call char2num(temp_pointer%cvalue, ndiagop) ! IF (NVERBOSE .GE. 2) print *,' ndiagop= ',ndiagop - case ("ndifps") + case ("ndifps") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, ndifps) + call char2num(temp_pointer%cvalue, ndifps) ! IF (NVERBOSE .GE. 2) print *,' ndifps= ',ndifps - case ("neonbqs") + case ("neonbqs") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, neonbqs) + call char2num(temp_pointer%cvalue, neonbqs) ! IF (NVERBOSE .GE. 2) print *,' neonbqs= ',neonbqs - case ("neqdsk") + case ("neqdsk") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, neqdsk) + call char2num(temp_pointer%cvalue, neqdsk) ! IF (NVERBOSE .GE. 2) print *,' neqdsk= ',neqdsk - case ("neqdxtpo") + case ("neqdxtpo") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, neqdxtpo) + call char2num(temp_pointer%cvalue, neqdxtpo) ! IF (NVERBOSE .GE. 2) print *,' neqdxtpo= ',neqdxtpo - case ("nfftopt") + case ("nfftopt") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, nfftopt) + call char2num(temp_pointer%cvalue, nfftopt) ! IF (NVERBOSE .GE. 2) print *,' nfftopt= ',nfftopt - case ("nideal") + case ("nideal") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, nideal) + call char2num(temp_pointer%cvalue, nideal) ! IF (NVERBOSE .GE. 2) print *,' nideal= ',nideal - case ("nidsbound") + case ("nidsbound") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, nidsbound) + call char2num(temp_pointer%cvalue, nidsbound) ! IF (NVERBOSE .GE. 2) print *,' nidsbound= ',nidsbound - case ("nitmocc") + case ("nitmocc") ! array if (allocated(temp_pointer%cvalue)) & - call scan_str2num(char2str(temp_pointer%cvalue), nitmocc, n_values) + call scan_str2num(char2str(temp_pointer%cvalue), nitmocc, n_values) ! IF (NVERBOSE .GE. 2) print *,' nitmocc= ',nitmocc ! IF (NVERBOSE .GE. 2) print *,' n_values= ',n_values - case ("nitmopt") + case ("nitmopt") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, nitmopt) + call char2num(temp_pointer%cvalue, nitmopt) ! IF (NVERBOSE .GE. 2) print *,' nitmopt= ',nitmopt - case ("nitmrun") + case ("nitmrun") ! array if (allocated(temp_pointer%cvalue)) & - call scan_str2num(char2str(temp_pointer%cvalue), nitmrun, n_values) + call scan_str2num(char2str(temp_pointer%cvalue), nitmrun, n_values) ! IF (NVERBOSE .GE. 2) print *,' nitmrun= ',nitmrun ! IF (NVERBOSE .GE. 2) print *,' n_values= ',n_values - case ("nitmshot") + case ("nitmshot") ! array if (allocated(temp_pointer%cvalue)) & - call scan_str2num(char2str(temp_pointer%cvalue), nitmshot, n_values) + call scan_str2num(char2str(temp_pointer%cvalue), nitmshot, n_values) ! IF (NVERBOSE .GE. 2) print *,' nitmshot= ',nitmshot ! IF (NVERBOSE .GE. 2) print *,' n_values= ',n_values - case ("nopt") + case ("nopt") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, nopt) + call char2num(temp_pointer%cvalue, nopt) ! IF (NVERBOSE .GE. 2) print *,' nopt= ',nopt - case ("nplot") + case ("nplot") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, nplot) + call char2num(temp_pointer%cvalue, nplot) ! IF (NVERBOSE .GE. 2) print *,' nplot= ',nplot - case ("nprpsi") + case ("nprpsi") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, nprpsi) + call char2num(temp_pointer%cvalue, nprpsi) ! IF (NVERBOSE .GE. 2) print *,' nprpsi= ',nprpsi - case ("nrbox") + case ("nrbox") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, nrbox) + call char2num(temp_pointer%cvalue, nrbox) ! IF (NVERBOSE .GE. 2) print *,' nrbox= ',nrbox - case ("nrscal") + case ("nrscal") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, nrscal) + call char2num(temp_pointer%cvalue, nrscal) ! IF (NVERBOSE .GE. 2) print *,' nrscal= ',nrscal - case ("nsmooth") + case ("nsmooth") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, nsmooth) + call char2num(temp_pointer%cvalue, nsmooth) ! IF (NVERBOSE .GE. 2) print *,' nsmooth= ',nsmooth - case ("ntcase") + case ("ntcase") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, ntcase) + call char2num(temp_pointer%cvalue, ntcase) ! IF (NVERBOSE .GE. 2) print *,' ntcase= ',ntcase - case ("ntest") + case ("ntest") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, ntest) + call char2num(temp_pointer%cvalue, ntest) ! IF (NVERBOSE .GE. 2) print *,' ntest= ',ntest - case ("ntmf0") + case ("ntmf0") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, ntmf0) + call char2num(temp_pointer%cvalue, ntmf0) ! IF (NVERBOSE .GE. 2) print *,' ntmf0= ',ntmf0 - case ("nturn") + case ("nturn") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, nturn) + call char2num(temp_pointer%cvalue, nturn) ! IF (NVERBOSE .GE. 2) print *,' nturn= ',nturn - case ("nzbox") + case ("nzbox") ! integer/real constant if (allocated(temp_pointer%cvalue)) & - call char2num(temp_pointer%cvalue, nzbox) + call char2num(temp_pointer%cvalue, nzbox) ! IF (NVERBOSE .GE. 2) print *,' nzbox= ',nzbox - case default + case default write(*, *) 'ERROR: invalid parameter', cname return_status = 1 ! exit - end select - do + end select + do if (associated(temp_pointer%sibling)) then - temp_pointer => temp_pointer%sibling - exit + temp_pointer => temp_pointer%sibling + exit end if if (associated(temp_pointer%parent, parameter_list%first )) & - exit outer + exit outer if (associated(temp_pointer%parent)) then - temp_pointer => temp_pointer%parent + temp_pointer => temp_pointer%parent else - write(*, *) 'ERROR: broken list.' - return + write(*, *) 'ERROR: broken list.' + return end if - end do - end do outer + end do + end do outer - !-- destroy tree - call destroy_xml_tree(parameter_list) + !-- destroy tree + call destroy_xml_tree(parameter_list) - return + return -end subroutine assign_chease_codepar_reflist + end subroutine assign_chease_codepar_reflist + subroutine get_schema(codeparameters, return_status) + ! copy file i lines of chease_schema_reflist.xsd into codeparameters%schema(i) + use prec_const + use euitm_schemas + implicit none + type (type_param), intent(inout) :: codeparameters + integer(ikind), intent(out) :: return_status + integer :: nb_lines, i + ! + return_status = 1 + nb_lines = 1107 ! nb lines in chease_schema_reflist.xsd + allocate(codeparameters%schema(nb_lines)) + i=1 + codeparameters%schema(i) = '<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">' + i = i+1 + codeparameters%schema(i) = ' <!-- document element -->' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="parameters">' + i = i+1 + codeparameters%schema(i) = ' <xs:complexType>' + i = i+1 + codeparameters%schema(i) = ' <xs:all>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="cocos_in" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="cocos_out" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="epslon" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="relax" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="ninmap" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="ninsca" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="nmgaus" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="nsgaus" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="ntgaus" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="nverbose" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <!-- meshes parameters -->' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="aplace" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="awidth" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="bplace" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="bwidth" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="cplace" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="cwidth" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="dplace" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="dwidth" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="eplace" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="ewidth" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="qplace" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="qvalneo" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="qwidth" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="solpda" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="solpdb" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="solpdc" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="solpdd" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="solpde" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="solpdpol" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="msmax" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="nchi" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="ndift" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="negp" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="ner" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="niso" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="nmesha" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="nmeshb" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="nmeshc" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="nmeshd" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="nmeshe" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="nmeshpol" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="nmeshpolexp" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="npoida" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="npoidb" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="npoidc" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="npoidd" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="npoide" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="npoidq" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="npsi" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="ns" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="nt" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="ntnova" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="nv" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="nvexp" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <!-- equilibrium_control parameters -->' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="bsfrac" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="cfbal" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="cfnress" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="cfnresso" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="cpress" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="cpresso" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="cq0" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="csspec" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="currt" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="etaei" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="gamma" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="pangle" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="predge" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="psibndexp" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="psiscl" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="qspec" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="rzion" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="scalne" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="scexp" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="nbsfun" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="nbsopt" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="nbstrp" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="nfunrho" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="nrhomesh" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="nrfp" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <!-- plasma_boundary parameters -->' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="aspct" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="beans" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="ceta" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="delta" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="elong" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="rc" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="rnu" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="rz0" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="r0" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="sgma" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="theta0" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="triang" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="triplt" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="xi" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="nsurf" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="nsym" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <!-- profiles parameters -->' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="afbs" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="afbs2" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="ap" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="ap2" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="at" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="at2" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="at3" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="at4" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="n0jedge" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="nfixaxis" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="nfunc" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="nipr" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="npp" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="nppfun" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="nppr" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="nprofz" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="nprof2d" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="npropt" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="nsour" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="nsttp" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <!-- in_out_control parameters -->' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="bentaxis" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="bentqprofile" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="bentradius" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="b0exp" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="comments" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="rboxlen" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="rboxlft" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="rext" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="rpeop" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="rz0w" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="r0exp" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="r0w" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="signb0xp" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="signipxp" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="slimit" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="snumber" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="shift_p" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="time_ref" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="treeitm" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="tree_user" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="tree_tokamak" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="tree_majorversion" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="zboxlen" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="zboxmid" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="nanal" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="nbal" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="nblc0" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="nblopt" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="nbpsout" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="nbsexpq" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="ncscal" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="ndiagop" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="ndifps" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="neonbqs" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="neqdsk" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="neqdxtpo" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="nfftopt" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="nideal" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="nitmocc" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="nitmopt" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="nitmrun" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="nitmshot" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="nidsbound" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="nopt" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="nplot" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="nprpsi" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="nrbox" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="nrscal" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="nsmooth" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="ntcase" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="ntest" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="ntmf0" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="nturn" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="nzbox" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="tensbnd" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element ref="tensprof" minOccurs="0" maxOccurs="1"/>' + i = i+1 + codeparameters%schema(i) = '</xs:all>' + i = i+1 + codeparameters%schema(i) = '</xs:complexType>' + i = i+1 + codeparameters%schema(i) = '</xs:element>' + i = i+1 + codeparameters%schema(i) = '<xs:simpleType name="IntegerList">' + i = i+1 + codeparameters%schema(i) = ' <xs:list itemType="xs:integer"/>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = '<xs:simpleType name="FloatList">' + i = i+1 + codeparameters%schema(i) = ' <xs:list itemType="xs:float"/>' + i = i+1 + codeparameters%schema(i) = '</xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="cocos_in">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:integer">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="cocos_out">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:integer">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="epslon">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:float">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="relax">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:float">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="ninmap">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:integer">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="ninsca">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:integer">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="nmgaus">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:integer">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="nsgaus">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:integer">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="ntgaus">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:integer">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="nverbose">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:integer">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = '' + i = i+1 + codeparameters%schema(i) = ' <!-- meshes parameters -->' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="aplace" type="FloatList"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="awidth" type="FloatList"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="bplace" type="FloatList"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="bwidth" type="FloatList"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="cplace" type="FloatList"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="cwidth" type="FloatList"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="dplace" type="FloatList"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="dwidth" type="FloatList"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="eplace" type="FloatList"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="ewidth" type="FloatList"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="qplace" type="FloatList"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="qvalneo" type="FloatList"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="qwidth" type="FloatList"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="solpda">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:float">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="solpdb">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:float">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="solpdc">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:float">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="solpdd">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:float">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="solpde">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:float">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="solpdpol">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:float">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="msmax">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:integer">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="nchi">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:integer">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="ndift">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:integer">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="negp">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:integer">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="ner">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:integer">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="niso">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:integer">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="nmesha">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:integer">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="nmeshb">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:integer">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="nmeshc">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:integer">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="nmeshd">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:integer">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="nmeshe">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:integer">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="nmeshpol">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:integer">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="nmeshpolexp">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:integer">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="npoida">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:integer">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="npoidb">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:integer">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="npoidc">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:integer">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="npoidd">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:integer">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="npoide">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:integer">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="npoidq">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:integer">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="npsi">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:integer">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="ns">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:integer">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="nt">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:integer">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="ntnova">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:integer">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="nv">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:integer">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="nvexp">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:integer">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = '' + i = i+1 + codeparameters%schema(i) = '<!-- equilibrium_control parameters -->' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="bsfrac">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:float">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="cfbal">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:float">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="cfnress">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:float">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="cfnresso">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:float">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="cpress">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:float">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="cpresso">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:float">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="cq0">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:float">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="csspec">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:float">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="currt">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:float">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="etaei">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:float">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="gamma">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:float">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="pangle">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:float">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="predge">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:float">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="psibndexp">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:float">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="psiscl">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:float">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="qspec">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:float">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="rzion">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:float">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="scalne">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:float">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="scexp">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:float">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="nbsfun">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:integer">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="nbsopt">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:integer">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="nbstrp">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:integer">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="nfunrho">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:integer">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="nrhomesh">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:integer">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="nrfp">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:integer">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = '' + i = i+1 + codeparameters%schema(i) = '<!-- plasma_boundary parameters -->' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="aspct">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:float">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="beans">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:float">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="ceta">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:float">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="delta">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:float">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="elong">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:float">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="rc">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:float">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="rnu">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:float">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="rz0">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:float">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="r0">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:float">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="sgma">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:float">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="theta0">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:float">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="triang">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:float">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="triplt">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:float">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="xi">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:float">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="nsurf">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:integer">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="nsym">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:integer">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = '' + i = i+1 + codeparameters%schema(i) = ' <!-- profiles parameters -->' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="afbs" type="FloatList"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="afbs2" type="FloatList"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="ap" type="FloatList"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="ap2" type="FloatList"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="at" type="FloatList"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="at2" type="FloatList"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="at3" type="FloatList"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="at4" type="FloatList"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="nfixaxis">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:integer">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="n0jedge">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:integer">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="nfunc">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:integer">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="nipr">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:integer">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="npp">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:integer">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="nppfun">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:integer">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="nppr">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:integer">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="nprofz">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:integer">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="nprof2d">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:integer">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="npropt">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:integer">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="nsour">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:integer">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="nsttp">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:integer">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = '' + i = i+1 + codeparameters%schema(i) = '<!-- in_out_control parameters -->' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="bentaxis">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:float">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="bentqprofile">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:float">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="bentradius">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:float">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="b0exp">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:float">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="comments">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:string">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="rboxlen">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:float">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="rboxlft">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:float">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="rext">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:float">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="rpeop">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:float">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="rz0w">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:float">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="r0exp">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:float">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="r0w">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:float">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="signb0xp">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:float">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="signipxp">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:float">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="slimit">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:float">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="snumber">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:float">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="shift_p">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:float">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="time_ref">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:float">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="treeitm">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:string">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="tree_user">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:string">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="tree_tokamak">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:string">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="tree_majorversion">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:string">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="zboxlen">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:float">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="zboxmid">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:float">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="nanal">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:integer">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="nbal">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:integer">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="nblc0">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:integer">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="nblopt">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:integer">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="nbpsout">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:integer">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="nbsexpq">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:integer">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="ncscal">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:integer">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="ndiagop">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:integer">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="ndifps">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:integer">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="neonbqs">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:integer">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="neqdsk">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:integer">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="neqdxtpo">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:integer">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="nfftopt">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:integer">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="nideal">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:integer">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="nitmopt">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:integer">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="nidsbound">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:integer">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="nitmshot" type="IntegerList"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="nitmrun" type="IntegerList"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="nitmocc" type="IntegerList"/>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="nopt">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:integer">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="nplot">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:integer">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="nprpsi">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:integer">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="nrbox">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:integer">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="nrscal">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:integer">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="nsmooth">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:integer">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="ntcase">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:integer">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="ntest">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:integer">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="ntmf0">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:integer">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="nturn">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:integer">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="nzbox">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:integer">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="tensbnd">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:float">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = ' <xs:element name="tensprof">' + i = i+1 + codeparameters%schema(i) = ' <xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' <xs:restriction base="xs:float">' + i = i+1 + codeparameters%schema(i) = ' </xs:restriction>' + i = i+1 + codeparameters%schema(i) = ' </xs:simpleType>' + i = i+1 + codeparameters%schema(i) = ' </xs:element>' + i = i+1 + codeparameters%schema(i) = '</xs:schema>' + ! + return_status = 0 ! no error + ! + return + end subroutine get_schema end module assign_chease_codeparameters_reflist diff --git a/src-f90/auxval.f90 b/src-f90/auxval.f90 index 89334f62b2d0376f9c488d755ec76777c660f77b..29dd8005d4b4683503b9e8ee95d0441b6cdcff1a 100644 --- a/src-f90/auxval.f90 +++ b/src-f90/auxval.f90 @@ -1,4 +1,4 @@ -!*DECK C1S05 +!*DECK C1S05 !*CALL PROCESS SUBROUTINE AUXVAL ! ################# @@ -20,7 +20,7 @@ SUBROUTINE AUXVAL IMPLICIT NONE ! REAL(RKIND) :: ZRM - REAL(RKIND) :: ZRX + REAL(RKIND) :: ZRX, Z_RELAX_MIN INTEGER :: ISMIN INTEGER :: IMN INTEGER :: ISMAX @@ -28,12 +28,15 @@ SUBROUTINE AUXVAL INTEGER :: J4 REAL(RKIND) :: ZR REAL(RKIND) :: ZT - INTEGER :: J3 + INTEGER :: J3, ITERATIONS_MIN REAL(RKIND) :: ZWORK DIMENSION & & ZR(12*NPT),ZT(12*NPT),ZWORK(NPBPS) !----------------------------------------------------------------------- ! + ! Override nverbose to be at least 1 if nideal=9 + if (nideal == 9) nverbose = max(nverbose, 1) + ! ! Various flags for diag etc ! IF (NVERBOSE .GE. 2) THEN @@ -45,10 +48,28 @@ SUBROUTINE AUXVAL ! ! SET SOME PARAMETERS FOR EQDSK AND NOT EUITM INPUT ! - IF (NSURF.EQ.6 .AND. NEQDSK>=1 .AND. NITMOPT.NE.22 .AND. mod(NITMOPT,10).NE.1) THEN - NPPFUN = 4 - NFUNC = 4 - NSTTP = 1 + IF (NSURF.EQ.6 .AND. NEQDSK>=1 .AND. NITMOPT.NE.22 .AND. mod(NITMOPT,10).NE.1) THEN + NFUNC = 4 + ! New: allow p or pprime, as well as GGprime or q + IF ((NPPFUN .NE. 4) .AND. (NPPFUN .NE. 8)) THEN + IF (NVERBOSE .GE. 3) WRITE(6,*) 'WARNING: NPPFUN changed from ',NPPFUN,' to 4' + NPPFUN = 4 + END IF + IF ((NSTTP .NE. 1) .AND. (NSTTP .NE. 5)) THEN + IF (NVERBOSE .GE. 3) WRITE(6,*) 'WARNING: NSTTP changed from ',NSTTP,' to 1' + NSTTP = 1 + END IF + ENDIF + IF (NSTTP .EQ. 5) THEN + Z_RELAX_MIN = 0.3 + ITERATIONS_MIN = 100 + RELAX = MAX(RELAX,Z_RELAX_MIN) + NINMAP = MAX(ITERATIONS_MIN,NINMAP) + NINSCA = MAX(ITERATIONS_MIN,NINSCA) + IF ((NVERBOSE .GE. 3) .AND. & + & ( (abs(RELAX-Z_RELAX_MIN) .LE. 1e-6_rkind) .OR. (NINMAP .eq. ITERATIONS_MIN) .OR. (NINSCA .eq. ITERATIONS_MIN) )) & + & WRITE(6,*) 'INFO: RELAX = MAX(RELAX,',Z_RELAX_MIN,'), NINMAP = MAX(',ITERATIONS_MIN,',NINMAP), NINSCA = MAX(', & + & ITERATIONS_MIN,',NINSCA)' ENDIF if (tree_user(1) == 'xxx') then call getenv('USER',tree_user(1)) @@ -70,7 +91,7 @@ SUBROUTINE AUXVAL ! Actually might be useful for others, so compute if asked in namelist (will be available if chease used as routine) !IF (NITMOPT .LE. 9) NPROF2D = 0 ! - ! READ EXPERIMENTAL EQUILIBRIUM DATA'S + ! READ EXPERIMENTAL EQUILIBRIUM DATA'S ! IF NOPT .NE. 1 ! IF ((NFUNC .EQ. 4 .OR. NPPFUN .EQ. 4 .OR. NPPFUN .EQ. 8 .OR. NSURF .EQ. 6 .OR. & @@ -89,8 +110,8 @@ SUBROUTINE AUXVAL IF (NOPT .NE. 1) THEN ! NOTE: CAN GIVE SPECIFIC SIGN TO B0EXP OR R0EXP, BUT THIS IS TO ENFORCE NAMELIST VALUE INSTEAD ! OF NIN OR EQDSK VALUES. IT IS NOT RELATED TO EFFECTIVE SIGN OF IP AND/OR B0 IN EXPERIMENT - ! WHICH ARE IRRELEVANT FOR CHEASE. - ! THEY CAN BE GIVEN IN THE NAMELIST THROUGH SIGNB0XP AND SIGNIPXP FOR OUTPUTS + ! WHICH ARE IRRELEVANT FOR CHEASE. + ! THEY CAN BE GIVEN IN THE NAMELIST THROUGH SIGNB0XP AND SIGNIPXP FOR OUTPUTS R0EXP = ABS(R0EXP) B0EXP = ABS(B0EXP) ENDIF @@ -99,19 +120,13 @@ SUBROUTINE AUXVAL ! TO BE CHECKED AFTER HAVING READ EXP. EQUILIBRIUM ! IF (NFUNRHO .GE. 1) THEN - IF (NVERBOSE .GE. 0) write(0,*) 'EXP. PROFILES MAY BE NOT GIVEN IN TERMS OF RHO PSI' + IF (NVERBOSE .GE. 1) write(0,*) 'EXP. PROFILES MAY BE NOT GIVEN IN TERMS OF RHO PSI' IF ( ((NPPFUN .NE. 4) .AND. NPPFUN.NE.8) .OR. (NFUNC .NE. 4) ) THEN IF (NVERBOSE .GE. 0) write(0,*) ' NFUNRHO>=1 ONLY WITH NPPFUN=4 or 8 AND NFUNC=4' eqchease_out(index_out)%codeparam%output_diag(1) = 'in AUXVAL: NFUNRHO>=1 ONLY WITH NPPFUN=4 or 8 AND NFUNC=4' eqchease_out(index_out)%codeparam%output_flag = -21 return ENDIF - IF (NSTTP .EQ. 1) THEN - IF (NVERBOSE .GE. 0) PRINT *,' NFUNRHO>=1 ONLY WITH NSTTP>=2 SO FAR' - eqchease_out(index_out)%codeparam%output_diag(1) = 'in AUXVAL: NFUNRHO>=1 ONLY WITH NSTTP>=2 SO FAR' - eqchease_out(index_out)%codeparam%output_flag = -22 - return - ENDIF IF (NEQDSK>=1 .AND. NITMOPT.LT.10) THEN IF (NVERBOSE .GE. 0) PRINT *,'EQDSK PROFILES SHOULD BE IN TERMS OF RHO_PSI' eqchease_out(index_out)%codeparam%output_diag(1) = 'in AUXVAL: EQDSK PROFILES SHOULD BE IN TERMS OF RHO_PSI' @@ -157,12 +172,12 @@ SUBROUTINE AUXVAL AP2(4) = CPRESS * AP2(4) ELSE IF (NPPFUN .EQ. 4 .OR. NPPFUN .EQ. 8) THEN CALL DSCAL(NPPF+1,CPRESS,RPPF,1) - ELSE IF (NPPFUN .EQ. 5) THEN + ELSE IF (NPPFUN .EQ. 5) THEN AP(2) = CPRESS * AP(2) - ELSE IF (NPPFUN .EQ. 6) THEN + ELSE IF (NPPFUN .EQ. 6) THEN CALL DSCAL(8,CPRESS,AP(6),1) CALL DSCAL(8,CPRESS,AP2(6),1) - ELSE IF (NPPFUN .EQ. 7) THEN + ELSE IF (NPPFUN .EQ. 7) THEN AP(1) = CPRESS * AP(1) AP2(1) = CPRESS * AP2(1) ELSE @@ -199,7 +214,7 @@ SUBROUTINE AUXVAL AT(1) = CFNRESS * AT(1) ELSE IF (NFUNC .EQ. 4) THEN CALL DSCAL(NPPF+1,CFNRESS,RFUN,1) - ELSE IF (NFUNC .EQ. 5) THEN + ELSE IF (NFUNC .EQ. 5) THEN IF (NVERBOSE .GE. 0) write(0,*) ' OPTION NFUNC=5 AND CFNRESS NOT YET DEFINED' IF (NVERBOSE .GE. 0) write(0,*) ' FUNCTION NOT DEFINED WELL ENOUGH IN PRFUNC' eqchease_out(index_out)%codeparam%output_diag(1) = 'in AUXVAL: OPTION NFUNC=5 AND CFNRESS NOT YET DEFINED' @@ -377,7 +392,7 @@ SUBROUTINE AUXVAL BPS(1 ) = R0 BPS(2 ) = RC BPS(3 ) = BPS(2) - BPS(1) - BPS(4 ) = ASPCT + BPS(4 ) = ASPCT BPS(5 ) = SGMA BPS(6 ) = ASPCT * RC BPS(7 ) = DELTA @@ -431,13 +446,12 @@ SUBROUTINE AUXVAL ! !********************************************************************** ! * - ! ADJUST BPS(4) AND BPS(5) SUCH THAT (RMIN+RMAX)/(RMAX-RMIN)=ASPCT * + ! ADJUST BPS(4) AND BPS(6) SUCH THAT (RMIN+RMAX)/(RMAX-RMIN)=ASPCT * ! * !********************************************************************** ! - IF (NSURF .EQ. 1 .OR. NSURF .EQ. 2 .OR. NSURF .EQ. 6 .OR. & - & NSURF .EQ. 7) RETURN - ! + IF (NSURF .EQ. 1 .OR. NSURF .EQ. 6 .OR. NSURF .EQ. 7) RETURN + ! !%OS IF (NSURF .EQ. 5) THEN ! PRINT*,'**************WARNING***************************' @@ -451,22 +465,22 @@ SUBROUTINE AUXVAL ! !%OS ENDIF ! - DO J3=1,100 + DO J3=1,12*NT ! - ZT(J3) = (J3 - 1) * CPI / 50._RKIND + ZT(J3) = 2._rkind*(J3 - 1) * CPI / (12*NT) ! END DO ! - CALL BOUND(100,ZT,ZR) + CALL BOUND(12*NT,ZT,ZR) ! - DO J4=1,100 + DO J4=1,12*NT ! ZR(J4) = BPS(1) + ZR(J4) * COS(ZT(J4)) ! END DO ! - IMX = ISMAX(100,ZR,1) - IMN = ISMIN(100,ZR,1) + IMX = ISMAX(12*NT,ZR,1) + IMN = ISMIN(12*NT,ZR,1) ZRX = (ZR(IMX) - BPS(1) - BPS(3)) / BPS(6) ZRM = (ZR(IMN) - BPS(1) - BPS(3)) / BPS(6) ! diff --git a/src-f90/ballit.f90 b/src-f90/ballit.f90 index a4f5827185d20710a00101d4a229e0c7a18efd27..52021ecf60dc92d6b30aba8e9874e81c98196603 100644 --- a/src-f90/ballit.f90 +++ b/src-f90/ballit.f90 @@ -48,6 +48,7 @@ SUBROUTINE BALLIT INTEGER :: IFIN INTEGER :: IDIM INTEGER :: IGUESS + ! IGUESS = 1 IDIM = 0 IF (NOPT.GE.-2 .AND. NOPT.LE.-1) THEN @@ -89,7 +90,7 @@ SUBROUTINE BALLIT 1 CONTINUE ! IDIMLOOP = IDIMLOOP + 1 - IF (IDIMLOOP .GE. NINSCA .AND. NBLOPT.NE.0) IFIN=3 + IF (IDIMLOOP-1 .GT. NINBLOPT .AND. NBLOPT.NE.0) IFIN=3 ! NCON = 0 ! @@ -157,7 +158,7 @@ SUBROUTINE BALLIT IF (NBLOPT .EQ. 1) CALL DCOPY(NPPR+1,CPPR,1,RPRM,1) ! CALL NOREPT(NPPR+1,1) - CALL MAPPIN(1) ! to allocate eqchease_out related quantities used in surface etc + IF ((NBLOPT.EQ.0) .OR. (NBLOPT.EQ.1 .AND. IDIMLOOP.LE.2)) CALL MAPPIN(1) ! to allocate (once) eqchease_out related quantities used in surface etc CALL BLTEST ! ! IF IFIN = 3, BALLOONING STABILITY IS TESTED, BUT THE P-PRIME diff --git a/src-f90/bltest.f90 b/src-f90/bltest.f90 index 4ac5bd1d7837e9739ec0cc04fd0f2ccc8f22e009..e25c842ba462d3e3d766b1c1903c6c3c33c15b40 100644 --- a/src-f90/bltest.f90 +++ b/src-f90/bltest.f90 @@ -29,6 +29,7 @@ SUBROUTINE BLTEST INTEGER :: J1 INTEGER :: ISRCHFGE INTEGER :: IP + ! IP = ISRCHFGE(NPPR+1,PSIISO,1,CPSICL(1)) ! IF (IP.LT.1) IP = 1 @@ -46,8 +47,8 @@ SUBROUTINE BLTEST !%OS CALL BALOON(IP,NPPR+1,PCSM) !%OS ELSE DO J5=IP,NPPR+1,NPPSBAL - JEND = MIN(J5+NPPSBAL-1,NPPR+1) - CALL BALOON(J5,JEND,PCSM) + JEND = MIN(J5+NPPSBAL-1,NPPR+1) + CALL BALOON(J5,JEND,PCSM) ENDDO !%OS ENDIF ! @@ -60,6 +61,15 @@ SUBROUTINE BLTEST NCBAL(J2) = - 1 SMERCI(J2) = 0.25_RKIND ! + RJ1(J2) = RJ1(IP) + RJ2(J2) = RJ2(IP) + RJ3(J2) = RJ3(IP) + RJ4(J2) = RJ4(IP) + RJ5(J2) = RJ5(IP) + RJ5P(J2)= RJ5P(IP) + RJ6(J2) = RJ6(IP) + CDQ(J2) = CDQ(IP) + QPSI(J2)= QPSI(IP) END DO ! ENDIF @@ -74,10 +84,10 @@ SUBROUTINE BLTEST ! DO J3=IP,NPPR+1 ! - IF (ABS(CPPR(J3)) .GT. ABS(CFBAL * CDQ(J3)) .OR. & - & ABS(CPPR(J3)) .GT. 5._RKIND) THEN + IF ((PCSM(J3) .LE. 0.2_RKIND) .OR. (QPSI(J3) .LE. 1._RKIND) .OR. & + & (ABS(CPPR(J3)) .GT. PPRIME_BAL_MAX)) THEN ! - NCBAL(J3) = 1 + NCBAL(J3) = 1 N2BAL(J3) = 1 ! ENDIF @@ -93,7 +103,7 @@ SUBROUTINE BLTEST PRINT*,'*****WARNING***** : CPPR(',J4,') = CPPR(',J4-1,')' PRINT*,' IMPOSED. NPPR = ',NPPR ! - NCBAL(J4) = 1 + NCBAL(J4) = 1 N2BAL(J4) = 1 ! ENDIF diff --git a/src-f90/chease_imas.f90 b/src-f90/chease_imas.f90 index 25145e27320d336a5b440ce4ddeacd75f7a45943..fe5e0cad17780b1b08688e17cc308ab0506cbd7a 120000 --- a/src-f90/chease_imas.f90 +++ b/src-f90/chease_imas.f90 @@ -1 +1 @@ -chease_imas_vDD3_5.3PUAL3_3.8.f90 \ No newline at end of file +chease_imas_v3.39.0-4.11.6-2020b.f90 \ No newline at end of file diff --git a/src-f90/chease_imas_v3.39.0-4.11.6-2020b.f90 b/src-f90/chease_imas_v3.39.0-4.11.6-2020b.f90 new file mode 120000 index 0000000000000000000000000000000000000000..25145e27320d336a5b440ce4ddeacd75f7a45943 --- /dev/null +++ b/src-f90/chease_imas_v3.39.0-4.11.6-2020b.f90 @@ -0,0 +1 @@ +chease_imas_vDD3_5.3PUAL3_3.8.f90 \ No newline at end of file diff --git a/src-f90/chease_imas_vDD3_5.3PUAL3_3.8.f90 b/src-f90/chease_imas_vDD3_5.3PUAL3_3.8.f90 index 300d29fc9463d2ec6457f66933770bc13ae922fc..4a5f68a9e08513a6b75e5f95814cc3da08716cfc 100644 --- a/src-f90/chease_imas_vDD3_5.3PUAL3_3.8.f90 +++ b/src-f90/chease_imas_vDD3_5.3PUAL3_3.8.f90 @@ -434,42 +434,42 @@ subroutine chease(equil_in_ids,equil_out_ids,param_input_ids,flag_status,output_ IMPLICIT NONE interface - subroutine copy_ids_to_itm_equilibrium(equil_in_ids,equil_out_itm,index_times_eff_in,flag_status) - ! - ! copy ids equilibrium structure to eu-itm CPO structure. - ! - ! flag_status = 0 if OK, 1 if not (equil_in_itm not associated or size<1) - ! - use euITM_schemas ! CPO definitions - use ids_schemas ! IDS definitions - ! - IMPLICIT NONE - ! - type(ids_equilibrium) :: equil_in_ids - type(type_equilibrium),pointer :: equil_out_itm(:) - integer :: index_times_eff_in(:), flag_status - end subroutine copy_ids_to_itm_equilibrium - subroutine copy_itm_to_ids_equilibrium(equil_in_itm,equil_out_ids,flag_status,extra_data_itm_to_ids,extra_option) - ! - ! copy ITM CPO-equilibrium structure to IDS structure. - ! copy whole times if timebase homogeneous, do not know if it could be otherwise in Equilibrium actually? - ! - ! flag_status = 0 if OK, 1 if not (equil_in_itm not associated or size<1) - ! - use euITM_schemas ! CPO definitions - use ids_schemas ! IDS definitions - use itm_ids_utilities ! to give extra_data for ids - ! - IMPLICIT NONE - ! - type(type_equilibrium),pointer :: equil_in_itm(:) - type(ids_equilibrium) :: equil_out_ids - type(extra_data_gen),optional,pointer :: extra_data_itm_to_ids(:) ! scans through same time index as equil_in_itm - integer :: flag_status - integer, optional :: extra_option - ! - end subroutine copy_itm_to_ids_equilibrium - ! + subroutine copy_ids_to_itm_equilibrium(equil_in_ids,equil_out_itm,index_times_eff_in,flag_status) + ! + ! copy ids equilibrium structure to eu-itm CPO structure. + ! + ! flag_status = 0 if OK, 1 if not (equil_in_itm not associated or size<1) + ! + use euITM_schemas ! CPO definitions + use ids_schemas ! IDS definitions + ! + IMPLICIT NONE + ! + type(ids_equilibrium) :: equil_in_ids + type(type_equilibrium),pointer :: equil_out_itm(:) + integer :: index_times_eff_in(:), flag_status + end subroutine copy_ids_to_itm_equilibrium + subroutine copy_itm_to_ids_equilibrium(equil_in_itm,equil_out_ids,flag_status,extra_data_itm_to_ids,extra_option) + ! + ! copy ITM CPO-equilibrium structure to IDS structure. + ! copy whole times if timebase homogeneous, do not know if it could be otherwise in Equilibrium actually? + ! + ! flag_status = 0 if OK, 1 if not (equil_in_itm not associated or size<1) + ! + use euITM_schemas ! CPO definitions + use ids_schemas ! IDS definitions + use itm_ids_utilities ! to give extra_data for ids + ! + IMPLICIT NONE + ! + type(type_equilibrium),pointer :: equil_in_itm(:) + type(ids_equilibrium) :: equil_out_ids + type(extra_data_gen),optional,pointer :: extra_data_itm_to_ids(:) ! scans through same time index as equil_in_itm + integer :: flag_status + integer, optional :: extra_option + ! + end subroutine copy_itm_to_ids_equilibrium + ! end interface type(ids_equilibrium) :: equil_in_ids @@ -482,12 +482,17 @@ subroutine chease(equil_in_ids,equil_out_ids,param_input_ids,flag_status,output_ REAL(RKIND), DIMENSION( :), ALLOCATABLE :: time_ref_eff, time_array REAL(RKIND) :: t_target INTEGER, DIMENSION( :), ALLOCATABLE :: index_time_in_to_use - integer :: istatus, iout_size, i, isize_comment, flag_status, ilist, iextra_option, & + integer :: istatus, iout_size, i, isize_comment, flag_status, ilist, iextra_option, idebug, & & iin_size, ilast_time_ref_eff, is_homogeneous_time, istart, iend, inb_times_eff, nb_times_in, isrchfge, itarget + integer :: INXML, ios, n_lines character(len=:), pointer :: output_message + character(len = 132) :: xml_line + character(len = 132), allocatable :: schemas_lines(:) ! !********************************************************************** ! + idebug = 0 ! for print and other calls before parameters are taken from parameters, then nverbose can be used + if (nitmopt .ne. 22) idebug = nverbose ! within actor, nverbose not yet defined from user call cpu_time(stime) ! ! Allow multiple runs dependening on time_ref if data from the database, see COMDAT @@ -518,8 +523,7 @@ subroutine chease(equil_in_ids,equil_out_ids,param_input_ids,flag_status,output_ end do end if end if - print *,'ilast_time_ref_eff= ',ilast_time_ref_eff - call flush(6) + if (idebug .ge. 2) print *,'ilast_time_ref_eff= ',ilast_time_ref_eff if (ilast_time_ref_eff .gt. 1) then is_homogeneous_time = equil_in_ids%ids_properties%homogeneous_time if (is_homogeneous_time .eq. 1) then @@ -540,8 +544,10 @@ subroutine chease(equil_in_ids,equil_out_ids,param_input_ids,flag_status,output_ iend = min(iend,nb_times_in) if (time_array(iend) .gt. time_ref(2)) iend = iend - 1 inb_times_eff = iend - istart + 1 - print *,' istart, iend,inb_times_eff = ',istart, iend, iend,inb_times_eff - call flush(6) + if (idebug .ge. 2) then + print *,' istart, iend,inb_times_eff = ',istart, iend, iend,inb_times_eff + call flush(6) + end if allocate(index_time_in_to_use(inb_times_eff)) allocate(time_ref_eff(inb_times_eff)) do i=1,iend-istart+1 @@ -568,7 +574,7 @@ subroutine chease(equil_in_ids,equil_out_ids,param_input_ids,flag_status,output_ time_ref_eff(i) = t_target end do else - if (nverbose .ge. 3) then + if (idebug .ge. 3) then write(0,*) 'time_ref has 3 elements with 3rd larger than 1st which is incorrect, take time_ref(1)' write(0,*) 'time_ref = ', time_ref call flush(0) @@ -587,7 +593,7 @@ subroutine chease(equil_in_ids,equil_out_ids,param_input_ids,flag_status,output_ end do ilast_time_ref_eff = iend - 1 inb_times_eff = ilast_time_ref_eff - print *,'inb_times_eff= ',inb_times_eff + if (idebug .ge. 2) print *,'inb_times_eff= ',inb_times_eff allocate(index_time_in_to_use(inb_times_eff)) allocate(time_ref_eff(inb_times_eff)) istart = 1 @@ -616,9 +622,6 @@ subroutine chease(equil_in_ids,equil_out_ids,param_input_ids,flag_status,output_ time_ref_eff(1) = time_ref(1) end if iout_size = size(index_time_in_to_use) - print *,'iout_size3= ', iout_size - print *,'index_time_in_to_use= ',index_time_in_to_use - print *,'time_ref_eff= ',time_ref_eff ! IF (NITMOPT.GT.0 .AND. MOD(NITMOPT,10) .GE. 1) THEN ! Do this only if did get an ids, thus either from within kepler (nitmopt=22) or if reading from database (nitmopt=1 or 11) @@ -626,7 +629,7 @@ subroutine chease(equil_in_ids,equil_out_ids,param_input_ids,flag_status,output_ ! ! Copy ids equilibrium to itm since chease is coded with CPO structure call copy_ids_to_itm_equilibrium(equil_in_ids,equil_in,index_time_in_to_use,flag_status) - print *,'size(equil_in)= ',size(equil_in) + if (idebug .ge. 2) print *,'size(equil_in)= ',size(equil_in) if (flag_status .ne. 0) then if (nverbose .ge. 1) write(6,*) 'problem with copy_ids_to_itm_equilibrium, flag_status = ',flag_status call flush(6) @@ -637,16 +640,24 @@ subroutine chease(equil_in_ids,equil_out_ids,param_input_ids,flag_status,output_ end if ! Copy ids_param_input to CPO_code_param and equil_in%codeparam%parameters if (associated(param_input_ids%parameters_value)) then - allocate(param_code%parameters(size(param_input_ids%parameters_value))) - param_code%parameters = param_input_ids%parameters_value - allocate(param_code%default_param(size(param_input_ids%parameters_default))) - param_code%default_param = param_input_ids%parameters_default - allocate(param_code%schema(size(param_input_ids%schema))) - param_code%schema = param_input_ids%schema + if (associated(param_input_ids%parameters_value)) then + allocate(param_code%parameters(size(param_input_ids%parameters_value))) + param_code%parameters = param_input_ids%parameters_value + end if + if (associated(param_input_ids%parameters_default)) then + allocate(param_code%default_param(size(param_input_ids%parameters_default))) + param_code%default_param = param_input_ids%parameters_default + end if + if (associated(param_input_ids%schema)) then + allocate(param_code%schema(size(param_input_ids%schema))) + param_code%schema = param_input_ids%schema + end if do i=1,size(equil_in) if (associated(equil_in(i)%codeparam%parameters)) deallocate(equil_in(i)%codeparam%parameters) - allocate(equil_in(i)%codeparam%parameters(size(param_input_ids%parameters_value))) - equil_in(i)%codeparam%parameters = param_input_ids%parameters_value + if (associated(param_input_ids%parameters_value)) then + allocate(equil_in(i)%codeparam%parameters(size(param_input_ids%parameters_value))) + equil_in(i)%codeparam%parameters = param_input_ids%parameters_value + end if end do else if (nverbose .ge. 3) print *,'param_input_ids%parameters_value not associated, probably read input from chease_namelist' @@ -660,20 +671,25 @@ subroutine chease(equil_in_ids,equil_out_ids,param_input_ids,flag_status,output_ ! From now on, should be same as ITM version until copy back to IDS part near end ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! + if (idebug .ge. 2) then + print *,'iout_size= ', iout_size + print *,'index_time_in_to_use= ',index_time_in_to_use + print *,'time_ref_eff= ',time_ref_eff + end if if (associated(equil_in)) then iout_size = min(iout_size,size(equil_in)) else iout_size = 1 end if - if (nverbose .ge. 3) write(*,*) 'iout_size = ',iout_size + if (idebug .ge. 3) write(*,*) 'iout_size = ',iout_size ! ! If within KEPLER, do here what was performed in chease_prog.f90, except loading shot ! ! NITMOPT=22 - IF (NVERBOSE .GE. 0) write(0,*) 'NITMOPT = ',NITMOPT + if (idebug .ge. 3) write(0,*) 'NITMOPT = ',NITMOPT if (associated(equil_in)) then - IF (NVERBOSE .GE. 3) write(*,*) 'equil_in(1)%eqgeometry%geom_axis%r = ',equil_in(1)%eqgeometry%geom_axis%r - IF (NVERBOSE .GE. 3) write(*,*) 'equil_in(1)%eqgeometry%geom_axis%z = ',equil_in(1)%eqgeometry%geom_axis%z + if (idebug .ge. 3) write(*,*) 'equil_in(1)%eqgeometry%geom_axis%r = ',equil_in(1)%eqgeometry%geom_axis%r + if (idebug .ge. 3) write(*,*) 'equil_in(1)%eqgeometry%geom_axis%z = ',equil_in(1)%eqgeometry%geom_axis%z end if if (allocated(CPSICL)) then if (nverbose .ge. 1) print *,'CPSICL allocated' @@ -698,6 +714,8 @@ subroutine chease(equil_in_ids,equil_out_ids,param_input_ids,flag_status,output_ eqchease_out(index_out)%codeparam%output_diag(1) = 'ERROR in chease_new.f90: Could not assign some code parameters.' eqchease_out(index_out)%codeparam%output_flag = -10 equil_out => eqchease_out + flag_status = eqchease_out(index_out)%codeparam%output_flag + output_message => eqchease_out(index_out)%codeparam%output_diag(1) return end if ! @@ -708,6 +726,7 @@ subroutine chease(equil_in_ids,equil_out_ids,param_input_ids,flag_status,output_ print *,' nitmrun = ',nitmrun print *,' nitmocc = ',nitmocc print *,' ndiagop = ',ndiagop + call flush(6) END IF ! avoid: call euitm_copy(equil_in,eqchease_in) so no need for module euitm_routines !!$ call euitm_copy(equil_in,eqchease_in) @@ -765,7 +784,7 @@ subroutine chease(equil_in_ids,equil_out_ids,param_input_ids,flag_status,output_ else eqchease_out(i)%time = time_ref(1) end if - print *,'eqchease_out(i)%time= ',eqchease_out(i)%time + if (nverbose .ge. 2) print *,'eqchease_out(i)%time= ',eqchease_out(i)%time ! allocate output_flag to at least (1) so can enter error message allocate(eqchease_out(i)%codeparam%output_diag(10)) eqchease_out(i)%codeparam%output_diag(:) = '' @@ -792,6 +811,9 @@ subroutine chease(equil_in_ids,equil_out_ids,param_input_ids,flag_status,output_ if (nverbose .ge. 0) write(0,*) 'there were problems in auxval, quit chease' equil_out => eqchease_out call copy_itm_to_ids_equilibrium(equil_out,equil_out_ids,flag_status,extra_data_itm_to_ids,iextra_option) + if ( associated(eqchease_out(index_out)%codeparam%output_diag) ) then + output_message => eqchease_out(index_out)%codeparam%output_diag(1) + end if return end if ! @@ -802,47 +824,47 @@ subroutine chease(equil_in_ids,equil_out_ids,param_input_ids,flag_status,output_ !********************************************************************** ! CALL STEPON - print *,'eqchease_out(index_out)%time= ',eqchease_out(index_out)%time + if (nverbose .ge. 2) print *,'eqchease_out(index_out)%time= ',eqchease_out(index_out)%time ! add extra data needed for ids structure, not included in equil_out ITM-CPO - if (size(eqchease_out_add_1d) .ge. NISO1EFF1) then - allocate(extra_data_itm_to_ids(index_out)%prof1d_list(2)) - ! 1: magnetic_shear - ilist = 1 - allocate(extra_data_itm_to_ids(index_out)%prof1d_list(ilist)%values(NISO1EFF1)) - extra_data_itm_to_ids(index_out)%prof1d_list(ilist)%values(1:NISO1EFF1) = eqchease_out_add_1d(1:NISO1EFF1,iishear) - extra_data_itm_to_ids(index_out)%prof1d_list(ilist)%name = "magnetic_shear" - ! 2: length poloidal - ilist = 2 - allocate(extra_data_itm_to_ids(index_out)%prof1d_list(ilist)%values(NISO1EFF1)) - extra_data_itm_to_ids(index_out)%prof1d_list(ilist)%values(1:NISO1EFF1) = (/ RC0P, RLENG(1:NISO1EFF)*R0EXP /) - extra_data_itm_to_ids(index_out)%prof1d_list(ilist)%name = "length_pol" - ! - iextra_option = 1 - end if + if (size(eqchease_out_add_1d) .ge. NISO1EFF1) then + allocate(extra_data_itm_to_ids(index_out)%prof1d_list(2)) + ! 1: magnetic_shear + ilist = 1 + allocate(extra_data_itm_to_ids(index_out)%prof1d_list(ilist)%values(NISO1EFF1)) + extra_data_itm_to_ids(index_out)%prof1d_list(ilist)%values(1:NISO1EFF1) = eqchease_out_add_1d(1:NISO1EFF1,iishear) + extra_data_itm_to_ids(index_out)%prof1d_list(ilist)%name = "magnetic_shear" + ! 2: length poloidal + ilist = 2 + allocate(extra_data_itm_to_ids(index_out)%prof1d_list(ilist)%values(NISO1EFF1)) + extra_data_itm_to_ids(index_out)%prof1d_list(ilist)%values(1:NISO1EFF1) = (/ RC0P, RLENG(1:NISO1EFF)*R0EXP /) + extra_data_itm_to_ids(index_out)%prof1d_list(ilist)%name = "length_pol" + ! + iextra_option = 1 + end if if (eqchease_out(index_out)%codeparam%output_flag .ge. -1) then eqchease_out(index_out)%codeparam%output_flag = 0 eqchease_out(index_out)%codeparam%output_diag(1) = 'CHEASE reached after STEPON without errors' + flag_status = eqchease_out(index_out)%codeparam%output_flag elseif (eqchease_out(index_out)%codeparam%output_flag .lt. -1) then if (nverbose .ge. 0) write(0,*) 'for time: eqchease_out(index_out)%time= ',eqchease_out(index_out)%time if (nverbose .ge. 0) write(0,*) 'there were problems in stepon, quit chease' call flush(0) equil_out => eqchease_out call copy_itm_to_ids_equilibrium(equil_out,equil_out_ids,flag_status,extra_data_itm_to_ids,iextra_option) - print *,'equil_out_ids%time= ',equil_out_ids%time + if (nverbose .ge. 3) print *,'equil_out_ids%time= ',equil_out_ids%time return end if end do ! - !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! NOTE THAT NOW eqchease_out IS IN SI UNITS WITH COCOS_OUT CONVENTION - !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! IF (NVERBOSE .GE. 1) CALL RUNTIM ! ! avoid: call euitm_copy(eqchease_out,equil_out) so no need for module euitm_routines - !!$ call euitm_copy(eqchease_out,equil_out) equil_out => eqchease_out ! IF (NVERBOSE .GE. 3) THEN diff --git a/src-f90/chease_input_kepler_std_pjpar.xml b/src-f90/chease_input_kepler_std_pjpar.xml index 18900c60d4cfc2765294cd02a020c4b583fed501..9a24ed832063ca6f2a4a0ecec21381935ad23e50 100644 --- a/src-f90/chease_input_kepler_std_pjpar.xml +++ b/src-f90/chease_input_kepler_std_pjpar.xml @@ -3,7 +3,7 @@ <parameters xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <nitmopt> 22 </nitmopt> <!-- 22 within kepler, 1 to read from ITM database, 11 to read and write, 10 to write, 0 to be independent from ITM database --> <ndiagop> -1 </ndiagop> <!-- set to -1 to remove outputs of array at the end --> - <nverbose> 0 </nverbose> <!-- set to 1 for more messages and to 2 for full output --> + <nverbose> 0 </nverbose> <!-- set to 1 for more messages and to 3 for full output --> <cocos_in> 13 </cocos_in> <!-- 13 for original ITM,11 for ITER, 2 for eqdsk/chease standard --> <cocos_out> 13 </cocos_out> <!-- 13 for original ITM, 11 for ITER, 2 for eqdsk/chease standard --> @@ -34,7 +34,7 @@ <nsurf> 6 </nsurf> <nppfun> 8 </nppfun> <!-- nppfun=4 for pprime and 8 for p as input (needs nsttp.ge.2 for nppfun=8) --> <nfunc> 4 </nfunc> - <nsttp> 4 </nsttp> <!-- set nsttp=1 for ffprime, 2 for Istar=jphi, 3 for Ipar and 4 for jpar=<j.B>/B0 --> + <nsttp> 4 </nsttp> <!-- set nsttp=1 for ffprime, 2 for Istar=jphi, 3 for Ipar, 4 for jpar=<j.B>/B0 and 5 for q --> <nideal> 6 </nideal> <!-- standard mapping --> <negp> -1 </negp> <!-- straight field line, NER=2, NEGP=0, since Jacobian=C(psi) R^NER grad(psi)^NEGP --> diff --git a/src-f90/chease_input_reflist.xml b/src-f90/chease_input_reflist.xml index 5f54d58694586ea86fa228599813ed227ec2ba78..9c46087556b2fed7c1eb312bbc8bbc3f8abca3be 100644 --- a/src-f90/chease_input_reflist.xml +++ b/src-f90/chease_input_reflist.xml @@ -143,6 +143,7 @@ <nitmopt> 0 </nitmopt> <nitmshot> 180 190 </nitmshot> <nitmrun> 1 1 </nitmrun> + <nverbose> 3 </nverbose> <tree_user>xxx</tree_user> <tree_tokamak>test</tree_tokamak> <tree_majorversion>3</tree_majorversion> diff --git a/src-f90/chease_new.f90 b/src-f90/chease_new.f90 index 872169327e67532a3171e70b21119538f2e49a07..0e5c9779c7d38caf5f3acfd2611cb54b18e1b175 100644 --- a/src-f90/chease_new.f90 +++ b/src-f90/chease_new.f90 @@ -24,7 +24,7 @@ subroutine chease(equil_in,equil_out,param_code,output_flag,output_message) ! ! [2] H.LUETJENS, A.BONDESON, O.SAUTER, COMP.PHYS.COMM 97 (1996) P.219-260 ! - ! COMPILATION DIRECTIONS: + ! COMPILATION DIRECTIONS: ! ----------------------- ! THIS PROGRAM MUST IMPERATIVELY BE COMPILED AT LEAST IN 64BITS ! PRECISION, I.E. SINGLE PRECISION ON CRAY, DOUBLE-PRECISION @@ -32,7 +32,7 @@ subroutine chease(equil_in,equil_out,param_code,output_flag,output_message) ! AND THERE ARE COMMANDS UP TO 25 FORTRAN LINES AND DO LOOPS ! WITH SEVERAL HUNDREDS FORTRAN LINES. THEREFORE, THE USER MUST ! BE AWARE THAT THE DEFAULT SET-UP OF HIS LOCAL COMPILER CAN BE - ! UNADAPTED FOR THE COMPILATION OF CHEASE. + ! UNADAPTED FOR THE COMPILATION OF CHEASE. ! ! ON CRAY SYSTEMS, CHEASE SHOULD BE COMPILED WITH ! @@ -45,8 +45,8 @@ subroutine chease(equil_in,equil_out,param_code,output_flag,output_message) ! ON 32 BITS HP-K200 WORKSTATIONS WITH ! ! f77 -O +Onolimit +autodblpad chease.f - ! - ! TEST CASES : + ! + ! TEST CASES : ! ------------ ! ! 1) SOLOVEV EQUILIBRIUM @@ -62,7 +62,7 @@ subroutine chease(equil_in,equil_out,param_code,output_flag,output_message) ! NCHI=100,NPSI=15,NS= 30,NT= 30, ! $END ! $NEWRUN - ! $END + ! $END ! ! 2) JET EQUILIBRIUM. J_PHI SPECIFIED WITH TT-PRIME AND P-PRIME ! ------------------------------------------------------------- @@ -77,7 +77,7 @@ subroutine chease(equil_in,equil_out,param_code,output_flag,output_message) ! NCHI=100,NPSI=15,NS= 30,NT= 30, ! $END ! $NEWRUN - ! $END + ! $END ! ! 3) NET EQUILIBRIUM. J_PHI SPECIFIED WITH I* AND P-PRIME ! ------------------------------------------------------- @@ -93,7 +93,7 @@ subroutine chease(equil_in,equil_out,param_code,output_flag,output_message) ! NCHI=100,NPSI=15,NS= 30,NT= 30, ! $END ! $NEWRUN - ! $END + ! $END ! ! 4) ASYMMETRIC EQUILIBRIUM. J_PHI SPECIFIED WITH I* AND P-PRIME ! -------------------------------------------------------------- @@ -108,7 +108,7 @@ subroutine chease(equil_in,equil_out,param_code,output_flag,output_message) ! NCHI=100,NPSI=15,NS= 30,NT= 30, ! $END ! $NEWRUN - ! $END + ! $END ! ! ! ********** @@ -128,7 +128,7 @@ subroutine chease(equil_in,equil_out,param_code,output_flag,output_message) ! TCASE SET UP TEST CASES 1.07 ! ! STEPON LEAD THE CALCULATIONS 2.01 - ! BALLIT LEAD BALLOONING OPTIMZATION AND + ! BALLIT LEAD BALLOONING OPTIMZATION AND ! SPECIFICATION OF BOOTSTRAP CURRENT 2.02 ! INITIA INITIALIZE VERTICAL MATRIX INDEXATION ! AND QUADRATURE POINTS FOR EQUILIBRIUM @@ -168,7 +168,7 @@ subroutine chease(equil_in,equil_out,param_code,output_flag,output_message) ! SOLVIT SOLVE GRAD-SHAFRANOV EQUATION 2.E01 ! DIRECT GAUSS ELIMINATION 2.E02 ! ERROR COMPUTE ERROR ON PSI 2.E03 - ! ENERGY COMPUTE AVERAGED POLOIDAL MAGNETIC + ! ENERGY COMPUTE AVERAGED POLOIDAL MAGNETIC ! FIELD ENERGY 2.E04 ! SMOOTH BICUBIC SPLINE SMOOTHING OF BICUBIC ! HERMITE EQUILIBRIUM SOLUTION 2.E05 @@ -201,7 +201,7 @@ subroutine chease(equil_in,equil_out,param_code,output_flag,output_message) ! FOURIER PERFORM FOURIER TRANSFORM OF QUANTITIES ! COMPUTED BY GIJLIN 2.M09 ! PROFILE COMPUTE PROFILES ON S-MESH 2.M10 - ! BALOON BALOONING STABILITY AND LOCAL + ! BALOON BALOONING STABILITY AND LOCAL ! INTERCHANGE TESTS 2.M11 ! GLOQUA COMPUTE AUXILIARY GLOBAL FLUX SURFACE ! QUANTITES 2.M12 @@ -210,18 +210,18 @@ subroutine chease(equil_in,equil_out,param_code,output_flag,output_message) ! OUTNVW COMPUTE EQ'S FOR NOVA-W AND PEST 2.M15 ! STCHPS COMPUTE SIGMA(PSI,CHI) AND ! THETA(PSI,CHI) FOR NOVA-W 2.M16 - ! JNOVAW COMPUTE R,Z AND STABILITY MESH + ! JNOVAW COMPUTE R,Z AND STABILITY MESH ! JACOBIAN AT (SIGMA, THETA) 2.M17 ! TPSI COMPUTE SIGMA(PSI,THETA-PENN) AND ! THETA(PSI,THETA-PENN) 2.M20 ! OUTPEN COMPUTE EQ'S FOR PENN A-PENN) 2.M21 ! OUTXT COMPUTE AND WRITES DATA FOR XTOR ! - ! FOURFFT COMPUTE FAST FOURIER TRANSFORMS OF ALL + ! FOURFFT COMPUTE FAST FOURIER TRANSFORMS OF ALL ! EQ'S FOR MARS INSIDE THE PLASMA 2.M22 - ! VACUFFT COMPUTE FAST FOURIER TRANSFORMS OF ALL + ! VACUFFT COMPUTE FAST FOURIER TRANSFORMS OF ALL ! EQV'S FOR MARS IN THE VACUMM 2.M23 - ! SPLIFFT COMPUTES CUBIC SPLINE INTERPOLATION + ! SPLIFFT COMPUTES CUBIC SPLINE INTERPOLATION ! AND FAST FOURIER TRANSFORM 2.M24 ! ! CURENT COMPUTE CURRENT DENSITY FOR GIVEN PSI 2.J01 @@ -240,7 +240,7 @@ subroutine chease(equil_in,equil_out,param_code,output_flag,output_message) ! BOOTSTRAP CURRENT 2.P02 ! PPSPLN SPLINE INTERPOLATION OF P-PRIME 2.P03 ! APCOEF COMPUTE P-PRIME WITH AP'S 2.P04 - ! COPYAP COMPUTE COEFFICENT OF POLYNOMIAL + ! COPYAP COMPUTE COEFFICENT OF POLYNOMIAL ! SECTIONS FROM AP'S 2.P05 ! APCOEF2 ALTERNATIVE VERSION OF APCOEF 2.P06 ! COPYAPP ALTERNATIVE VERSION OF COPYAPP 2.P07 @@ -268,27 +268,27 @@ subroutine chease(equil_in,equil_out,param_code,output_flag,output_message) ! AXIS WITH CONSTANT FLUX SURFACES 2.U04 ! ! BOUND COMPUTE PLASMA SURFACE 2.X01 - ! BNDSPL CUBIC SPLINE INTERPOLATION OF + ! BNDSPL CUBIC SPLINE INTERPOLATION OF ! EXPERIMENTAL BOUNDARY POINTS 2.X03 ! SUBZ SHIFT EXPERIMENTAL BOUNDARY VERTICALLY 2.X04 ! RZBOUND COMPUTE (R,Z) COORDINATES OF BOUNDARY 2.X05 ! - ! BASIS1 COMPUTE BASIS FUNCTIONS AT GAUSS + ! BASIS1 COMPUTE BASIS FUNCTIONS AT GAUSS ! INTEGRATION POINTS 2.Y01 - ! BASIS2 COMPUTE FIRST DERIVATIVES OF BASIS + ! BASIS2 COMPUTE FIRST DERIVATIVES OF BASIS ! FUNCTIONS AT GAUSS INTEGRATION POINTS 2.Y02 - ! BASIS3 COMPUTE FIRST AND 2ND DERIVATIVES OF - ! BASIS FUNCTIONS AT GAUSS INTEGRATION + ! BASIS3 COMPUTE FIRST AND 2ND DERIVATIVES OF + ! BASIS FUNCTIONS AT GAUSS INTEGRATION ! POINTS 2.Y03 - ! BASIS4 COMPUTE FIRST DERIVATIVES OF BASIS - ! FUNCTIONS IN SIGMA DIRECTION AT GAUSS + ! BASIS4 COMPUTE FIRST DERIVATIVES OF BASIS + ! FUNCTIONS IN SIGMA DIRECTION AT GAUSS ! INTEGRATION POINTS 2.Y04 ! PSICEL COMPUTE VARIABLES DEFINING THE BICUBIC ! EXPANSIONS OF PSI IN KN CELLS 2.Y05 ! PSIBOX EVALUATE PSI ON A (R,Z) GRID 2.Y06 ! ! OUTPUT CONTROL INPUT/OUTPUT 3.A01 - ! PRIQQU PRINT EQUILIBRIUM QUANTITIES Q-VALUES + ! PRIQQU PRINT EQUILIBRIUM QUANTITIES Q-VALUES ! SPECIFIED IN QPLACS 3.A02 ! OUTMKSA SAVE EQUILIBRIUM QUANTITIES IN MKSA 3.A03 ! @@ -314,21 +314,21 @@ subroutine chease(equil_in,equil_out,param_code,output_flag,output_message) ! LTXW SOLVE LT*X = W MR04 ! ! SPLINE CUBIC SPLINE INTERPOLATION. BOUNDARY - ! CONDITIONS BY CUBIC LAGRANGE + ! CONDITIONS BY CUBIC LAGRANGE ! INTERPOLATION MSP01 - ! MSPLINE AS SPLINE, BUT DOES M INTERPOLATIONS + ! MSPLINE AS SPLINE, BUT DOES M INTERPOLATIONS ! IN PARALLEL MSP02 ! SPLCY CUBIC SPLINE INTERPOLATION. PERIODIC ! BOUNDARY CONDITIONS. MSP03 - ! MSPLCY AS SPLCY, BUT DOES M INTERPOLATIONS + ! MSPLCY AS SPLCY, BUT DOES M INTERPOLATIONS ! IN PARALLEL MSP04 ! SPLCYP CUBIC SPLINE INTERPOLATION OF A PERIODIC - ! FUNCTION WITH PERIODIC DEFINITION + ! FUNCTION WITH PERIODIC DEFINITION ! INTERVAL MSP05 ! ! NTRIDG LU DECOMPOSE ND2-ND1+1 TRIDIAGONAL ! SYSTEMS MRD01 - ! TRIDAGM INVERT M TRIDIAGONAL SYSTEMS IN + ! TRIDAGM INVERT M TRIDIAGONAL SYSTEMS IN ! PARALLEL MRD02 ! TRICYC INVERT 1 TRIDIAGONAL SYSTEM WITH ! PERIODIC BOUNDARY CONDITIONS MRD03 @@ -388,12 +388,12 @@ subroutine chease(equil_in,equil_out,param_code,output_flag,output_message) ! ISAMIN ! ISRCHFGT ! ISRCHFGE - ! DAXPY - ! DCOPY + ! DAXPY + ! DCOPY ! DDOT - ! DSCAL + ! DSCAL ! SSUM - ! ISSUM + ! ISSUM ! ! ********** ! @@ -438,13 +438,13 @@ subroutine chease(equil_in,equil_out,param_code,output_flag,output_message) use prec_const use euitm_schemas - use euitm_xml_parser + use euitm_xml_parser use globals implicit none type (type_param), intent(in) :: codeparameters - integer(ikind), intent(out) :: return_status + integer(ikind), intent(out) :: return_status end subroutine assign_code_parameters end interface @@ -508,7 +508,7 @@ subroutine chease(equil_in,equil_out,param_code,output_flag,output_message) iend = min(iend,nb_times_in) if (time_array(iend) .gt. time_ref(2)) iend = iend - 1 inb_times_eff = iend - istart + 1 - print *,' istart, iend,inb_times_eff = ',istart, iend, iend,inb_times_eff + print *,' istart, iend,inb_times_eff = ',istart, iend, inb_times_eff call flush(6) allocate(index_time_in_to_use(inb_times_eff)) allocate(time_ref_eff(inb_times_eff)) @@ -643,7 +643,7 @@ subroutine chease(equil_in,equil_out,param_code,output_flag,output_message) print *,' ndiagop = ',ndiagop END IF ! avoid: call euitm_copy(equil_in,eqchease_in) so no need for module euitm_routines -!!$ call euitm_copy(equil_in,eqchease_in) +!!$ call euitm_copy(equil_in,eqchease_in) eqchease_in => equil_in IF ( (associated(eqchease_in)) .and. (NVERBOSE .GE. 3)) write(*,*) 'eqchease_in(1)%eqgeometry%geom_axis%r = ',eqchease_in(1)%eqgeometry%geom_axis%r ! @@ -665,7 +665,7 @@ subroutine chease(equil_in,equil_out,param_code,output_flag,output_message) ! if (iout_size > 1 .and. (nverbose .ge. 1)) write(0,*) 'iout_size = ',iout_size,' > 1: is it correct?' ! - ! + ! ! Starts clock for cpu time calculations IF (NVERBOSE .GE. 1) CALL RUNTIM ! put here any modifications of the main mesh values and not in AUXVAL diff --git a/src-f90/chease_prog_imas_ids.f90 b/src-f90/chease_prog_imas_ids.f90 index c3dd33f02caba1724854e4a8ca21dc9b372d4689..6efb8388581de48389524af838690f308dcd6667 120000 --- a/src-f90/chease_prog_imas_ids.f90 +++ b/src-f90/chease_prog_imas_ids.f90 @@ -1 +1 @@ -chease_prog_imas_ids_vDD3_5.3PUAL3_3.8.f90 \ No newline at end of file +chease_prog_imas_ids_v3.39.0-4.11.6-2020b.f90 \ No newline at end of file diff --git a/src-f90/chease_prog_imas_ids_v3.39.0-4.11.6-2020b.f90 b/src-f90/chease_prog_imas_ids_v3.39.0-4.11.6-2020b.f90 new file mode 120000 index 0000000000000000000000000000000000000000..c3dd33f02caba1724854e4a8ca21dc9b372d4689 --- /dev/null +++ b/src-f90/chease_prog_imas_ids_v3.39.0-4.11.6-2020b.f90 @@ -0,0 +1 @@ +chease_prog_imas_ids_vDD3_5.3PUAL3_3.8.f90 \ No newline at end of file diff --git a/src-f90/chease_prog_imas_ids_vDD3_5.3PUAL3_3.8.f90 b/src-f90/chease_prog_imas_ids_vDD3_5.3PUAL3_3.8.f90 index b610c52750b7993352c76028f6d6743da5a89c6d..eba0ab963c539add7f884b534d3100a9e13a8798 100644 --- a/src-f90/chease_prog_imas_ids_vDD3_5.3PUAL3_3.8.f90 +++ b/src-f90/chease_prog_imas_ids_vDD3_5.3PUAL3_3.8.f90 @@ -22,7 +22,7 @@ program chease_prog ! interface - subroutine chease(equil_in_ids,equil_out_ids,param_input_ids) + subroutine chease(equil_in_ids,equil_out_ids,param_input_ids,flag_status,output_message) use globals use euITM_schemas ! module containing the equilibrium type definitions use ids_schemas ! module containing the equilibrium type definitions @@ -32,6 +32,8 @@ program chease_prog type(ids_equilibrium), intent(in) :: equil_in_ids type(ids_equilibrium), intent(out) :: equil_out_ids type(ids_Parameters_Input), intent(inout) :: param_input_ids + integer :: flag_status + character(len=:), pointer :: output_message ! end subroutine chease @@ -61,7 +63,8 @@ program chease_prog type (type_param) :: codeparam_itm ! type (type_param) :: codeparam_param type (ids_Parameters_Input) :: param_input_ids - integer :: itmopt, i, nflag + integer :: itmopt, i, nflag, flag_status + character(len=:), pointer :: output_message => null() !!$ character(len = 132), target :: codename(1) = 'CHEASE' !!$ character(len = 132), target :: codeversion(1) = 'version 10' @@ -248,7 +251,13 @@ program chease_prog IF (NVERBOSE .GE. 3) PRINT *,'equilibrium not taken from ITM structure, thus equil_in_ids not loaded' end if ! - call chease(equil_in_ids,equil_out_ids,param_input_ids) + allocate(character(132) :: output_message) + call chease(equil_in_ids,equil_out_ids,param_input_ids,flag_status,output_message) + print *,'flag_status = ',flag_status + if (associated(output_message)) then + print *,'output_message = x',output_message,'x' + end if + deallocate(output_message) ! for testing memory leaks run twice: !!$ write(6,*) 'in between' !!$ call flush(6) diff --git a/src-f90/copy_ids_to_itm_equilibrium.f90 b/src-f90/copy_ids_to_itm_equilibrium.f90 index 58d26d5e3863adc7844df2ed5b84ec7d0e548e52..527f4987e6e8e41c0db91af85f8925d8e8577fbf 120000 --- a/src-f90/copy_ids_to_itm_equilibrium.f90 +++ b/src-f90/copy_ids_to_itm_equilibrium.f90 @@ -1 +1 @@ -copy_ids_vDD3.5.3_PUAL3.3.8_to_itm_v4_10b_equilibrium.f90 \ No newline at end of file +copy_ids_v3.39.0-4.11.6-2020b_to_itm_v4_10b_equilibrium.f90 \ No newline at end of file diff --git a/src-f90/copy_ids_v3.39.0-4.11.6-2020b_to_itm_v4_10b_equilibrium.f90 b/src-f90/copy_ids_v3.39.0-4.11.6-2020b_to_itm_v4_10b_equilibrium.f90 new file mode 120000 index 0000000000000000000000000000000000000000..58d26d5e3863adc7844df2ed5b84ec7d0e548e52 --- /dev/null +++ b/src-f90/copy_ids_v3.39.0-4.11.6-2020b_to_itm_v4_10b_equilibrium.f90 @@ -0,0 +1 @@ +copy_ids_vDD3.5.3_PUAL3.3.8_to_itm_v4_10b_equilibrium.f90 \ No newline at end of file diff --git a/src-f90/copy_ids_vDD3.5.3_PUAL3.3.8_to_itm_v4_10b_equilibrium.f90 b/src-f90/copy_ids_vDD3.5.3_PUAL3.3.8_to_itm_v4_10b_equilibrium.f90 index 97a74bf6e18115de8dd770ba2b31aa350431fa2b..8e774fb2f38f27590665f61fa12c566f32662663 100644 --- a/src-f90/copy_ids_vDD3.5.3_PUAL3.3.8_to_itm_v4_10b_equilibrium.f90 +++ b/src-f90/copy_ids_vDD3.5.3_PUAL3.3.8_to_itm_v4_10b_equilibrium.f90 @@ -68,7 +68,6 @@ subroutine copy_ids_to_itm_equilibrium(equil_in_ids,equil_out_itm,index_times_ef if (associated(equil_out_itm) .and. size(equil_out_itm) .ge. 1) equil_out_itm(1)%codeparam%output_flag = flag_status return end if - if (nverbose .ge. 3) print *,'nb_times_in, nb_times_eff_in= ',nb_times_in, nb_times_eff_in allocate(equil_out_itm(nb_times_eff_in)) ! @@ -143,7 +142,7 @@ subroutine copy_ids_to_itm_equilibrium(equil_in_ids,equil_out_itm,index_times_ef ndim1_coord_sys = 0 end if if (ndim1_coord_sys .le. 0) then - if (nverbose .ge. 1) write(0,*) 'ndim1_coord_sys = ',ndim1_coord_sys + if (nverbose .ge. 2) write(0,*) 'ndim1_coord_sys = ',ndim1_coord_sys flag_status = -13 + flag_status if (associated(equil_out_itm) .and. size(equil_out_itm) .ge. it) equil_out_itm(index)%codeparam%output_flag = flag_status elseif (nverbose .ge. 3) then @@ -156,7 +155,7 @@ subroutine copy_ids_to_itm_equilibrium(equil_in_ids,equil_out_itm,index_times_ef ndim2_coord_sys = 0 end if if (ndim2_coord_sys .le. 0) then - if (nverbose .ge. 1) write(0,*) 'ndim2_coord_sys = ',ndim2_coord_sys + if (nverbose .ge. 2) write(0,*) 'ndim2_coord_sys = ',ndim2_coord_sys flag_status = -14 + flag_status if (associated(equil_out_itm) .and. size(equil_out_itm) .ge. it) equil_out_itm(index)%codeparam%output_flag = flag_status elseif (nverbose .ge. 3) then diff --git a/src-f90/copy_itm_to_ids_equilibrium.f90 b/src-f90/copy_itm_to_ids_equilibrium.f90 index b681b41cc394dd72dc535bda7f8fd6611694a90d..85bce135ff324a261786bde903cccd48a0a18132 120000 --- a/src-f90/copy_itm_to_ids_equilibrium.f90 +++ b/src-f90/copy_itm_to_ids_equilibrium.f90 @@ -1 +1 @@ -copy_itm_v4_10b_to_ids_vDD3.15.1_PUAL3.7.0_equilibrium.f90 \ No newline at end of file +copy_itm_v4_10b_to_ids_v3.39.0-4.11.6-2020b_equilibrium.f90 \ No newline at end of file diff --git a/src-f90/copy_itm_v4_10b_to_ids_v3.39.0-4.11.6-2020b_equilibrium.f90 b/src-f90/copy_itm_v4_10b_to_ids_v3.39.0-4.11.6-2020b_equilibrium.f90 new file mode 100644 index 0000000000000000000000000000000000000000..9682716061bc00327a15de0d0f66e443eaaf6d51 --- /dev/null +++ b/src-f90/copy_itm_v4_10b_to_ids_v3.39.0-4.11.6-2020b_equilibrium.f90 @@ -0,0 +1,672 @@ +subroutine copy_itm_to_ids_equilibrium(equil_in_itm,equil_out_ids,flag_status,extra_data_itm_to_ids,extra_option) + ! + ! copy ITM CPO-equilibrium structure to IDS structure. + ! copy whole times if timebase homogeneous, do not know if it could be otherwise in Equilibrium actually? + ! + ! extra_option = 1: use extra_data_itm_to_ids to fill in extra arrays (return if expected keywords not present) + ! = 0: do not use extra_data_itm_to_ids and copy only itm-cpo to ids (default) + ! + ! flag_status = 0 if OK, 1 if not (equil_in_itm not associated or size<1) + ! + use globals, ONLY : R0EXP, NISO1EFF1, NVERBOSE, CSQMIN, eqchease_out_add_1d, iirgeo, CPI, COCOS_OUT + USE interpos_module + use euITM_schemas ! CPO definitions, note should be linked onto euitm_schemas_4.10a.3_R1.1.2.f90 + use ids_schemas ! IDS definitions, note should be linked onto ids_schemas_vDD3_0.0PUAL3_0.0.f90 + use itm_ids_utilities ! to give extra_data for ids + ! + IMPLICIT NONE + ! + type(type_equilibrium),pointer :: equil_in_itm(:) + type(ids_equilibrium) :: equil_out_ids + type(extra_data_gen),optional,pointer :: extra_data_itm_to_ids(:) ! scans through same time index as equil_in_itm + integer :: flag_status + integer, optional :: extra_option + ! + real(ids_real), dimension(:), allocatable :: ztemp1d + integer :: i, it, iextra_option, nb_times, ndim1, ndim2, nb_2d, nb_lines, nb_points, & + & npsi_1d, ishear, iprof2d, iextra, ilength_pol, icsmin + ! + !********************************************************************** + ! + flag_status = 1 + ! + iextra_option = 0 + if (present(extra_option)) iextra_option = extra_option + ! + ! + nb_times = 1 + if (associated(equil_in_itm)) then + nb_times = size(equil_in_itm) + else + ! not associated, return + return + end if + if (nb_times .lt. 1) then + ! problem with size of input + return + end if + ! + ! check flag_status of input cpo, warning if not good + if (equil_in_itm(1)%codeparam%output_flag .lt. -1) then + if (nverbose .ge. 3) then + write(0,*) 'equil_in_itm(1)%codeparam%output_flag =',equil_in_itm(1)%codeparam%output_flag + write(0,*) 'WARNING in copy_itm_to_ids, input itm is not good' + call flush(0) + end if + end if + if (iextra_option .EQ. 1) then + if (present(extra_data_itm_to_ids) .AND. size(extra_data_itm_to_ids).lt.nb_times) then +!!$ if (nverbose .ge. 1) print *,'size(extra_data_itm_to_ids) <nb_times, do not use it' +!!$ iextra_option = 0 + end if + end if + if (nverbose .ge. 3) write(*,*) 'nb_times = ',nb_times,' in copy_itm_to_ids' + ! + ! find relevant keywords, assume same for all times + ishear = 0 + ilength_pol = 0 + it = 1 + if (associated(extra_data_itm_to_ids)) then + if (associated(extra_data_itm_to_ids(it)%prof1d_list)) then + i=size(extra_data_itm_to_ids(it)%prof1d_list) + do iextra=1,i + if ( 'magnetic_shear' .eq. trim(extra_data_itm_to_ids(it)%prof1d_list(iextra)%name) ) then + ishear = iextra + end if + if ( 'length_pol' .eq. trim(extra_data_itm_to_ids(it)%prof1d_list(iextra)%name) ) then + ilength_pol = iextra + end if + end do + else + if (nverbose .ge. 1) write(0,*) 'extra_data_itm_to_ids(it)%prof1d_list not associated in copy_itm_to_ids' + end if + else + if (nverbose .ge. 1) write(0,*) 'extra_data_itm_to_ids not associated in copy_itm_to_ids' + end if + if (ishear .eq. 0 .and. nverbose .ge. 1) write(0,*) 'magnetic shear not found in copy_itm_to_ids' + if (ilength_pol .eq. 0 .and. nverbose .ge. 1) write(0,*) 'length pol not found in copy_itm_to_ids' + + ! + ! 1. Fill in NON-time dependent quantities, assume corresponds to equil_in_itm(nb_times) (last being most recent?) + ! Assume not homogeneous time base, since do not know, but fill in both %time and %time_slice(:)%time + ! + ! 1.1 IDS_properties + ! + equil_out_ids%ids_properties%homogeneous_time = 1 + + ! cocos not anymore in ids_properties and not yet in metadat to our knowledge, add in comment + if (associated(equil_in_itm(nb_times)%datainfo%comment)) then + allocate(equil_out_ids%ids_properties%comment(size(equil_in_itm(nb_times)%datainfo%comment)+1)) + equil_out_ids%ids_properties%comment(1:size(equil_in_itm(nb_times)%datainfo%comment)) = & + & equil_in_itm(nb_times)%datainfo%comment + else + allocate(equil_out_ids%ids_properties%comment(1)) + end if + write(equil_out_ids%ids_properties%comment(size(equil_out_ids%ids_properties%comment)),'(A,I2)') 'COCOS OUT ',COCOS_OUT + if (associated(equil_in_itm(nb_times)%datainfo%putdate)) then + allocate(equil_out_ids%ids_properties%creation_date(size(equil_in_itm(nb_times)%datainfo%putdate))) + equil_out_ids%ids_properties%creation_date = equil_in_itm(nb_times)%datainfo%putdate + end if + if (associated(equil_in_itm(nb_times)%codeparam%codeversion)) then + allocate(equil_out_ids%ids_properties%provider(size(equil_in_itm(nb_times)%codeparam%codeversion))) + equil_out_ids%ids_properties%provider(1) = 'CHEASE ' // trim(equil_in_itm(nb_times)%codeparam%codeversion(1)) + end if + ! + ! Other than IDS_Properties + ! + ! 2. Time dependent part + ! + ! 2.1 Allocate first all arrays before do loop on time index + ! Also set values when it is the same for all times + ! + allocate(equil_out_ids%time(nb_times)) + allocate(equil_out_ids%vacuum_toroidal_field%b0(nb_times)) + allocate(equil_out_ids%time_slice(nb_times)) + allocate(equil_out_ids%code%output_flag(nb_times)) + ! + equil_out_ids%vacuum_toroidal_field%r0 = R0EXP + do it=1,nb_times + ! + equil_out_ids%time(it) = equil_in_itm(it)%time + equil_out_ids%time_slice(it)%time = equil_in_itm(it)%time + equil_out_ids%code%output_flag(it) = equil_in_itm(it)%codeparam%output_flag + end do + do it=1,nb_times + ! + if (associated(equil_in_itm(it)%profiles_1d%psi)) then + npsi_1d = size(equil_in_itm(it)%profiles_1d%psi) ! needed for some global_quantities as well (should be NISO1EFF1) + if (( NISO1EFF1 .ne. npsi_1d ) .and. (nb_times .eq. 1)) then + if (nverbose .ge. 1) & + & write(0,*) 'problem with size(equil_in_itm(',it,')%profiles_1d%psi) which should be equal to NISO1EFF1' + ! return ! do not return since could be only some time point the problem + end if + else + npsi_1d = 0 + if (nverbose .ge. 1) & + & write(0,*) 'problem with equil_in_itm(',it,')%profiles_1d%psi not associated' + ! return ! do not return since could be only some time point the problem + end if + ! + ! vacuum_toroidal_field + equil_out_ids%vacuum_toroidal_field%b0(it) = & + & equil_in_itm(it)%global_param%toroid_field%B0 * equil_in_itm(it)%global_param%toroid_field%R0 / R0EXP + ! + ! time_slice(it) + ! + ! boundary + equil_out_ids%time_slice(it)%boundary%type = equil_in_itm(it)%eqgeometry%boundarytype + if (associated(equil_in_itm(it)%eqgeometry%boundary(1)%r)) then + nb_points = size(equil_in_itm(it)%eqgeometry%boundary(1)%r) + else + nb_points = 0 + end if + allocate(equil_out_ids%time_slice(it)%boundary%outline%r(nb_points)) + equil_out_ids%time_slice(it)%boundary%outline%r(1:nb_points) = equil_in_itm(it)%eqgeometry%boundary(1)%r(1:nb_points) + allocate(equil_out_ids%time_slice(it)%boundary%outline%z(nb_points)) + equil_out_ids%time_slice(it)%boundary%outline%z(1:nb_points) = equil_in_itm(it)%eqgeometry%boundary(1)%z(1:nb_points) + equil_out_ids%time_slice(it)%boundary%psi_norm = equil_in_itm(it)%global_param%psi_bound ! since value at separatrix not known, may need to use namelist choice for shaving + equil_out_ids%time_slice(it)%boundary%geometric_axis%r = equil_in_itm(it)%eqgeometry%geom_axis%r + equil_out_ids%time_slice(it)%boundary%geometric_axis%z = equil_in_itm(it)%eqgeometry%geom_axis%z + equil_out_ids%time_slice(it)%boundary%minor_radius = equil_in_itm(it)%eqgeometry%a_minor + equil_out_ids%time_slice(it)%boundary%elongation = equil_in_itm(it)%eqgeometry%elongation + equil_out_ids%time_slice(it)%boundary%elongation_upper = equil_in_itm(it)%eqgeometry%elong_upper + equil_out_ids%time_slice(it)%boundary%elongation_lower = equil_in_itm(it)%eqgeometry%elong_lower + equil_out_ids%time_slice(it)%boundary%triangularity = & + & 0.5_ids_real * (equil_in_itm(it)%eqgeometry%tria_upper + equil_in_itm(it)%eqgeometry%tria_lower) + equil_out_ids%time_slice(it)%boundary%triangularity_upper = equil_in_itm(it)%eqgeometry%tria_upper + equil_out_ids%time_slice(it)%boundary%triangularity_lower = equil_in_itm(it)%eqgeometry%tria_lower + ! No X-point information from within CHEASE + ! + ! Globals + equil_out_ids%time_slice(it)%global_quantities%beta_pol = equil_in_itm(it)%global_param%beta_pol + equil_out_ids%time_slice(it)%global_quantities%beta_tor = equil_in_itm(it)%global_param%beta_tor + equil_out_ids%time_slice(it)%global_quantities%beta_normal = equil_in_itm(it)%global_param%beta_normal + equil_out_ids%time_slice(it)%global_quantities%ip = equil_in_itm(it)%global_param%i_plasma + equil_out_ids%time_slice(it)%global_quantities%li_3 = equil_in_itm(it)%global_param%li + equil_out_ids%time_slice(it)%global_quantities%volume = equil_in_itm(it)%global_param%volume + equil_out_ids%time_slice(it)%global_quantities%area = equil_in_itm(it)%global_param%area + if (nverbose .ge. 4) then + if ((it .eq. 1) .and. (associated(equil_out_ids%time_slice))) then + print *,'size(equil_out_ids%time_slice)= ',size(equil_out_ids%time_slice) + print *,'size(equil_in_itm)= ',size(equil_in_itm) + end if + print *,'equil_in_itm(it=',it,')%time= ',equil_in_itm(it)%time + if (associated(equil_in_itm(it)%profiles_1d%surface)) & + & print *,'size(equil_in_itm(it)%profiles_1d%surface)= ',size(equil_in_itm(it)%profiles_1d%surface) + print *,'npsi_1d = ',npsi_1d + end if + if ((npsi_1d .gt. 0) .and. (associated(equil_in_itm(it)%profiles_1d%surface)) .and. & + & (size(equil_in_itm(it)%profiles_1d%surface) .ge. npsi_1d)) & + & equil_out_ids%time_slice(it)%global_quantities%surface = equil_in_itm(it)%profiles_1d%surface(npsi_1d) + if ((npsi_1d .gt. 0) .and. (associated(extra_data_itm_to_ids)) .and. (it .le. size(extra_data_itm_to_ids)) & + & .and. (associated(extra_data_itm_to_ids(it)%prof1d_list))) then + if ((npsi_1d .gt. 0) .and. iextra_option .eq. 1 .and. ilength_pol .ne. 0 .and. & + & (associated(extra_data_itm_to_ids(it)%prof1d_list(ilength_pol)%values)) .and. & + & size(extra_data_itm_to_ids(it)%prof1d_list(ilength_pol)%values) .ge. npsi_1d) then + equil_out_ids%time_slice(it)%global_quantities%length_pol = & + & extra_data_itm_to_ids(it)%prof1d_list(ilength_pol)%values(npsi_1d) + else + equil_out_ids%time_slice(it)%global_quantities%length_pol = -1.e+40_ids_real + end if + end if + equil_out_ids%time_slice(it)%global_quantities%psi_axis = equil_in_itm(it)%global_param%psi_ax + equil_out_ids%time_slice(it)%global_quantities%psi_boundary = equil_in_itm(it)%global_param%psi_bound + equil_out_ids%time_slice(it)%global_quantities%magnetic_axis%r = equil_in_itm(it)%global_param%mag_axis%position%r + equil_out_ids%time_slice(it)%global_quantities%magnetic_axis%z = equil_in_itm(it)%global_param%mag_axis%position%z + equil_out_ids%time_slice(it)%global_quantities%magnetic_axis%b_field_tor = & + & equil_in_itm(it)%global_param%mag_axis%bphi + equil_out_ids%time_slice(it)%global_quantities%q_axis = equil_in_itm(it)%global_param%mag_axis%q + equil_out_ids%time_slice(it)%global_quantities%q_95 = equil_in_itm(it)%global_param%q_95 + equil_out_ids%time_slice(it)%global_quantities%q_min%value = equil_in_itm(it)%global_param%q_min + ! q_min%rho_tor_norm defined below + equil_out_ids%time_slice(it)%global_quantities%energy_mhd = equil_in_itm(it)%global_param%w_mhd + ! + ! equil_out_ids%profiles_1d: + if (npsi_1d .gt. 0) then + if ( (associated(equil_in_itm(it)%profiles_1d%psi)) .and. & + & (size(equil_in_itm(it)%profiles_1d%psi) .ge. npsi_1d) ) then + allocate(equil_out_ids%time_slice(it)%profiles_1d%psi(npsi_1d)) + equil_out_ids%time_slice(it)%profiles_1d%psi(1:npsi_1d) = equil_in_itm(it)%profiles_1d%psi(1:npsi_1d) + end if + if ( (associated(equil_in_itm(it)%profiles_1d%phi)) .and. & + & (size(equil_in_itm(it)%profiles_1d%phi) .ge. npsi_1d) ) then + allocate(equil_out_ids%time_slice(it)%profiles_1d%phi(npsi_1d)) + equil_out_ids%time_slice(it)%profiles_1d%phi(1:npsi_1d) = equil_in_itm(it)%profiles_1d%phi(1:npsi_1d) + end if + if ( (associated(equil_in_itm(it)%profiles_1d%pressure)) .and. & + & (size(equil_in_itm(it)%profiles_1d%pressure) .ge. npsi_1d) ) then + allocate(equil_out_ids%time_slice(it)%profiles_1d%pressure(npsi_1d)) + equil_out_ids%time_slice(it)%profiles_1d%pressure(1:npsi_1d) = equil_in_itm(it)%profiles_1d%pressure(1:npsi_1d) + end if + if ( (associated(equil_in_itm(it)%profiles_1d%f_dia)) .and. & + & (size(equil_in_itm(it)%profiles_1d%f_dia) .ge. npsi_1d) ) then + allocate(equil_out_ids%time_slice(it)%profiles_1d%f(npsi_1d)) + equil_out_ids%time_slice(it)%profiles_1d%f(1:npsi_1d) = equil_in_itm(it)%profiles_1d%f_dia(1:npsi_1d) + end if + if ( (associated(equil_in_itm(it)%profiles_1d%pprime)) .and. & + & (size(equil_in_itm(it)%profiles_1d%pprime) .ge. npsi_1d) ) then + allocate(equil_out_ids%time_slice(it)%profiles_1d%dpressure_dpsi(npsi_1d)) + equil_out_ids%time_slice(it)%profiles_1d%dpressure_dpsi(1:npsi_1d) = & + & equil_in_itm(it)%profiles_1d%pprime(1:npsi_1d) + end if + if ( (associated(equil_in_itm(it)%profiles_1d%ffprime)) .and. & + & (size(equil_in_itm(it)%profiles_1d%ffprime) .ge. npsi_1d) ) then + allocate(equil_out_ids%time_slice(it)%profiles_1d%f_df_dpsi(npsi_1d)) + equil_out_ids%time_slice(it)%profiles_1d%f_df_dpsi(1:npsi_1d) = equil_in_itm(it)%profiles_1d%ffprime(1:npsi_1d) + end if + if ( (associated(equil_in_itm(it)%profiles_1d%jphi)) .and. & + & (size(equil_in_itm(it)%profiles_1d%jphi) .ge. npsi_1d) ) then + allocate(equil_out_ids%time_slice(it)%profiles_1d%j_tor(npsi_1d)) + equil_out_ids%time_slice(it)%profiles_1d%j_tor(1:npsi_1d) = equil_in_itm(it)%profiles_1d%jphi(1:npsi_1d) + end if + if ( (associated(equil_in_itm(it)%profiles_1d%jparallel)) .and. & + & (size(equil_in_itm(it)%profiles_1d%jparallel) .ge. npsi_1d) ) then + allocate(equil_out_ids%time_slice(it)%profiles_1d%j_parallel(npsi_1d)) + equil_out_ids%time_slice(it)%profiles_1d%j_parallel(1:npsi_1d) = equil_in_itm(it)%profiles_1d%jparallel(1:npsi_1d) + end if + if ( (associated(equil_in_itm(it)%profiles_1d%q)) .and. (size(equil_in_itm(it)%profiles_1d%q) .ge. npsi_1d) ) then + allocate(equil_out_ids%time_slice(it)%profiles_1d%q(npsi_1d)) + equil_out_ids%time_slice(it)%profiles_1d%q(1:npsi_1d) = equil_in_itm(it)%profiles_1d%q(1:npsi_1d) + end if + if (associated(extra_data_itm_to_ids) .and. (it .le. size(extra_data_itm_to_ids))) then + allocate(equil_out_ids%time_slice(it)%profiles_1d%magnetic_shear(npsi_1d)) + if (iextra_option .eq. 1 .and. ishear .ne. 0 .and. & + & (associated(extra_data_itm_to_ids(it)%prof1d_list(ishear)%values)) .and. & + & size(extra_data_itm_to_ids(it)%prof1d_list(ishear)%values) .ge. npsi_1d) then + equil_out_ids%time_slice(it)%profiles_1d%magnetic_shear(1:npsi_1d) = & + & extra_data_itm_to_ids(it)%prof1d_list(ishear)%values(1:npsi_1d) + else + equil_out_ids%time_slice(it)%profiles_1d%magnetic_shear(1:npsi_1d) = -1.e+40_ids_real + end if + end if + if ( (associated(equil_in_itm(it)%profiles_1d%r_inboard)) .and. & + & (size(equil_in_itm(it)%profiles_1d%r_inboard) .ge. npsi_1d) ) then + allocate(equil_out_ids%time_slice(it)%profiles_1d%r_inboard(npsi_1d)) + equil_out_ids%time_slice(it)%profiles_1d%r_inboard(1:npsi_1d) = equil_in_itm(it)%profiles_1d%r_inboard(1:npsi_1d) + end if + if ( (associated(equil_in_itm(it)%profiles_1d%r_outboard)) .and. & + & (size(equil_in_itm(it)%profiles_1d%r_outboard) .ge. npsi_1d) ) then + allocate(equil_out_ids%time_slice(it)%profiles_1d%r_outboard(npsi_1d)) + equil_out_ids%time_slice(it)%profiles_1d%r_outboard(1:npsi_1d) = & + & equil_in_itm(it)%profiles_1d%r_outboard(1:npsi_1d) + end if + if ( (associated(equil_in_itm(it)%profiles_1d%rho_tor)) .and. & + & (size(equil_in_itm(it)%profiles_1d%rho_tor) .ge. npsi_1d) ) then + allocate(equil_out_ids%time_slice(it)%profiles_1d%rho_tor(npsi_1d)) + equil_out_ids%time_slice(it)%profiles_1d%rho_tor(1:npsi_1d) = equil_in_itm(it)%profiles_1d%rho_tor(1:npsi_1d) + end if + if ( (associated(equil_in_itm(it)%profiles_1d%rho_tor)) .and. & + & (size(equil_in_itm(it)%profiles_1d%rho_tor) .ge. npsi_1d) ) then + allocate(equil_out_ids%time_slice(it)%profiles_1d%rho_tor_norm(npsi_1d)) + equil_out_ids%time_slice(it)%profiles_1d%rho_tor_norm(1:npsi_1d) = & + & equil_in_itm(it)%profiles_1d%rho_tor(1:npsi_1d) / equil_in_itm(it)%profiles_1d%rho_tor(npsi_1d) + equil_out_ids%time_slice(it)%profiles_1d%rho_tor_norm(npsi_1d) = 1.0_ids_real + ! find rho_tor_norm value at qmin from simple linear fit + allocate(ztemp1d(npsi_1d)) + ztemp1d(1:npsi_1d-1) = sqrt((equil_in_itm(it)%profiles_1d%psi(1:npsi_1d-1)-equil_in_itm(it)%profiles_1d%psi(1)) & + & /(equil_in_itm(it)%profiles_1d%psi(npsi_1d)-equil_in_itm(it)%profiles_1d%psi(1))) + ztemp1d(npsi_1d) = 1._ids_real + icsmin=minloc(abs(ztemp1d(1:npsi_1d)-csqmin),1) + if ((ztemp1d(icsmin) .gt. csqmin) .and. (icsmin .gt. 1)) icsmin = icsmin - 1 + equil_out_ids%time_slice(it)%global_quantities%q_min%rho_tor_norm = & + & equil_out_ids%time_slice(it)%profiles_1d%rho_tor_norm(icsmin) & + & + (csqmin-ztemp1d(icsmin))/(ztemp1d(icsmin+1)-ztemp1d(icsmin)) & + & * (equil_out_ids%time_slice(it)%profiles_1d%rho_tor_norm(icsmin+1) & + & - equil_out_ids%time_slice(it)%profiles_1d%rho_tor_norm(icsmin)) + deallocate(ztemp1d) + end if + if ( (associated(equil_in_itm(it)%profiles_1d%dpsidrho_tor)) .and. & + & (size(equil_in_itm(it)%profiles_1d%dpsidrho_tor) .ge. npsi_1d) ) then + allocate(equil_out_ids%time_slice(it)%profiles_1d%dpsi_drho_tor(npsi_1d)) + equil_out_ids%time_slice(it)%profiles_1d%dpsi_drho_tor(1:npsi_1d) = & + & equil_in_itm(it)%profiles_1d%dpsidrho_tor(1:npsi_1d) + end if + if ( (allocated(eqchease_out_add_1d)) .and. (size(eqchease_out_add_1d(:,1)) .ge. npsi_1d) ) then + allocate(equil_out_ids%time_slice(it)%profiles_1d%geometric_axis%r(npsi_1d)) + equil_out_ids%time_slice(it)%profiles_1d%geometric_axis%r(1:npsi_1d) = & + & eqchease_out_add_1d(1:npsi_1d,iirgeo) * R0EXP + allocate(equil_out_ids%time_slice(it)%profiles_1d%geometric_axis%z(npsi_1d)) + equil_out_ids%time_slice(it)%profiles_1d%geometric_axis%z(1:npsi_1d) = & + & equil_out_ids%time_slice(it)%global_quantities%magnetic_axis%z ! OS: to correct + end if + if ( (associated(equil_in_itm(it)%profiles_1d%elongation)) .and. & + & (size(equil_in_itm(it)%profiles_1d%elongation) .ge. npsi_1d) ) then + allocate(equil_out_ids%time_slice(it)%profiles_1d%elongation(npsi_1d)) + equil_out_ids%time_slice(it)%profiles_1d%elongation(1:npsi_1d) = & + & equil_in_itm(it)%profiles_1d%elongation(1:npsi_1d) + end if + if ( (associated(equil_in_itm(it)%profiles_1d%tria_upper)) .and. & + & (size(equil_in_itm(it)%profiles_1d%tria_upper) .ge. npsi_1d) ) then + allocate(equil_out_ids%time_slice(it)%profiles_1d%triangularity_upper(npsi_1d)) + equil_out_ids%time_slice(it)%profiles_1d%triangularity_upper(1:npsi_1d) = & + & equil_in_itm(it)%profiles_1d%tria_upper(1:npsi_1d) + end if + if ( (associated(equil_in_itm(it)%profiles_1d%tria_lower)) .and. & + & (size(equil_in_itm(it)%profiles_1d%tria_lower) .ge. npsi_1d) ) then + allocate(equil_out_ids%time_slice(it)%profiles_1d%triangularity_lower(npsi_1d)) + equil_out_ids%time_slice(it)%profiles_1d%triangularity_lower(1:npsi_1d) = & + & equil_in_itm(it)%profiles_1d%tria_lower(1:npsi_1d) + end if + if ((associated(equil_in_itm(it)%profiles_1d%volume)) .and. & + & (size(equil_in_itm(it)%profiles_1d%volume) .ge. npsi_1d)) then + allocate(equil_out_ids%time_slice(it)%profiles_1d%volume(npsi_1d)) + equil_out_ids%time_slice(it)%profiles_1d%volume(1:npsi_1d) = equil_in_itm(it)%profiles_1d%volume(1:npsi_1d) + allocate(equil_out_ids%time_slice(it)%profiles_1d%rho_volume_norm(npsi_1d)) + equil_out_ids%time_slice(it)%profiles_1d%rho_volume_norm(1:npsi_1d) = & + & sqrt(equil_in_itm(it)%profiles_1d%volume(1:npsi_1d)/equil_in_itm(it)%profiles_1d%volume(npsi_1d)) + equil_out_ids%time_slice(it)%profiles_1d%rho_volume_norm(1) = 0._ids_real + equil_out_ids%time_slice(it)%profiles_1d%rho_volume_norm(npsi_1d) = 1._ids_real + end if + if ( (associated(equil_in_itm(it)%profiles_1d%vprime)) .and. & + & (size(equil_in_itm(it)%profiles_1d%vprime) .ge. npsi_1d) ) then + allocate(equil_out_ids%time_slice(it)%profiles_1d%dvolume_dpsi(npsi_1d)) + equil_out_ids%time_slice(it)%profiles_1d%dvolume_dpsi(1:npsi_1d) = equil_in_itm(it)%profiles_1d%vprime(1:npsi_1d) + end if + if ( (associated(equil_in_itm(it)%profiles_1d%dvdrho)) .and. & + & (size(equil_in_itm(it)%profiles_1d%dvdrho) .ge. npsi_1d) ) then + allocate(equil_out_ids%time_slice(it)%profiles_1d%dvolume_drho_tor(npsi_1d)) + equil_out_ids%time_slice(it)%profiles_1d%dvolume_drho_tor(1:npsi_1d) = & + & equil_in_itm(it)%profiles_1d%dvdrho(1:npsi_1d) + end if + if ( (associated(equil_in_itm(it)%profiles_1d%area)) .and. & + & (size(equil_in_itm(it)%profiles_1d%area) .ge. npsi_1d) ) then + allocate(equil_out_ids%time_slice(it)%profiles_1d%area(npsi_1d)) + equil_out_ids%time_slice(it)%profiles_1d%area(1:npsi_1d) = equil_in_itm(it)%profiles_1d%area(1:npsi_1d) + end if + if ( (associated(equil_in_itm(it)%profiles_1d%aprime)) .and. & + & (size(equil_in_itm(it)%profiles_1d%aprime) .ge. npsi_1d) ) then + allocate(equil_out_ids%time_slice(it)%profiles_1d%darea_dpsi(npsi_1d)) + equil_out_ids%time_slice(it)%profiles_1d%darea_dpsi(1:npsi_1d) = equil_in_itm(it)%profiles_1d%aprime(1:npsi_1d) + end if + if ( (associated(equil_in_itm(it)%profiles_1d%area)) .and. & + & (size(equil_in_itm(it)%profiles_1d%area) .ge. npsi_1d) ) then + allocate(equil_out_ids%time_slice(it)%profiles_1d%darea_drho_tor(npsi_1d)) + call interpos(equil_out_ids%time_slice(it)%profiles_1d%rho_tor(1:npsi_1d), & + & equil_out_ids%time_slice(it)%profiles_1d%area(1:npsi_1d), & + & npsi_1d,YOUTP=equil_out_ids%time_slice(it)%profiles_1d%darea_drho_tor(1:npsi_1d)) + end if + if ( (associated(equil_in_itm(it)%profiles_1d%surface)) .and. & + & (size(equil_in_itm(it)%profiles_1d%surface) .ge. npsi_1d) ) then + allocate(equil_out_ids%time_slice(it)%profiles_1d%surface(npsi_1d)) + equil_out_ids%time_slice(it)%profiles_1d%surface(1:npsi_1d) = equil_in_itm(it)%profiles_1d%surface(1:npsi_1d) + end if + if ( (associated(equil_in_itm(it)%profiles_1d%ftrap)) .and. & + & (size(equil_in_itm(it)%profiles_1d%ftrap) .ge. npsi_1d) ) then + allocate(equil_out_ids%time_slice(it)%profiles_1d%trapped_fraction(npsi_1d)) + equil_out_ids%time_slice(it)%profiles_1d%trapped_fraction(1:npsi_1d) = & + & equil_in_itm(it)%profiles_1d%ftrap(1:npsi_1d) + end if + if ( (associated(equil_in_itm(it)%profiles_1d%gm1)) .and. & + & (size(equil_in_itm(it)%profiles_1d%gm1) .ge. npsi_1d) ) then + allocate(equil_out_ids%time_slice(it)%profiles_1d%gm1(npsi_1d)) + equil_out_ids%time_slice(it)%profiles_1d%gm1(1:npsi_1d) = equil_in_itm(it)%profiles_1d%gm1(1:npsi_1d) + end if + if ( (associated(equil_in_itm(it)%profiles_1d%gm2)) .and. & + & (size(equil_in_itm(it)%profiles_1d%gm2) .ge. npsi_1d) ) then + allocate(equil_out_ids%time_slice(it)%profiles_1d%gm2(npsi_1d)) + equil_out_ids%time_slice(it)%profiles_1d%gm2(1:npsi_1d) = equil_in_itm(it)%profiles_1d%gm2(1:npsi_1d) + end if + if ( (associated(equil_in_itm(it)%profiles_1d%gm3)) .and. & + & (size(equil_in_itm(it)%profiles_1d%gm3) .ge. npsi_1d) ) then + allocate(equil_out_ids%time_slice(it)%profiles_1d%gm3(npsi_1d)) + equil_out_ids%time_slice(it)%profiles_1d%gm3(1:npsi_1d) = equil_in_itm(it)%profiles_1d%gm3(1:npsi_1d) + end if + if ( (associated(equil_in_itm(it)%profiles_1d%gm4)) .and. & + & (size(equil_in_itm(it)%profiles_1d%gm4) .ge. npsi_1d) ) then + allocate(equil_out_ids%time_slice(it)%profiles_1d%gm4(npsi_1d)) + equil_out_ids%time_slice(it)%profiles_1d%gm4(1:npsi_1d) = equil_in_itm(it)%profiles_1d%gm4(1:npsi_1d) + end if + if ( (associated(equil_in_itm(it)%profiles_1d%gm5)) .and. & + & (size(equil_in_itm(it)%profiles_1d%gm5) .ge. npsi_1d) ) then + allocate(equil_out_ids%time_slice(it)%profiles_1d%gm5(npsi_1d)) + equil_out_ids%time_slice(it)%profiles_1d%gm5(1:npsi_1d) = equil_in_itm(it)%profiles_1d%gm5(1:npsi_1d) + end if + if ( (associated(equil_in_itm(it)%profiles_1d%gm6)) .and. & + & (size(equil_in_itm(it)%profiles_1d%gm6) .ge. npsi_1d) ) then + allocate(equil_out_ids%time_slice(it)%profiles_1d%gm6(npsi_1d)) + equil_out_ids%time_slice(it)%profiles_1d%gm6(1:npsi_1d) = equil_in_itm(it)%profiles_1d%gm6(1:npsi_1d) + end if + if ( (associated(equil_in_itm(it)%profiles_1d%gm7)) .and. & + & (size(equil_in_itm(it)%profiles_1d%gm7) .ge. npsi_1d) ) then + allocate(equil_out_ids%time_slice(it)%profiles_1d%gm7(npsi_1d)) + equil_out_ids%time_slice(it)%profiles_1d%gm7(1:npsi_1d) = equil_in_itm(it)%profiles_1d%gm7(1:npsi_1d) + end if + if ( (associated(equil_in_itm(it)%profiles_1d%gm8)) .and. & + & (size(equil_in_itm(it)%profiles_1d%gm8) .ge. npsi_1d) ) then + allocate(equil_out_ids%time_slice(it)%profiles_1d%gm8(npsi_1d)) + equil_out_ids%time_slice(it)%profiles_1d%gm8(1:npsi_1d) = equil_in_itm(it)%profiles_1d%gm8(1:npsi_1d) + end if + if ( (associated(equil_in_itm(it)%profiles_1d%gm9)) .and. & + & (size(equil_in_itm(it)%profiles_1d%gm9) .ge. npsi_1d) ) then + allocate(equil_out_ids%time_slice(it)%profiles_1d%gm9(npsi_1d)) + equil_out_ids%time_slice(it)%profiles_1d%gm9(1:npsi_1d) = equil_in_itm(it)%profiles_1d%gm9(1:npsi_1d) + end if + if ( (associated(equil_in_itm(it)%profiles_1d%b_av)) .and. & + & (size(equil_in_itm(it)%profiles_1d%b_av) .ge. npsi_1d) ) then + allocate(equil_out_ids%time_slice(it)%profiles_1d%b_field_average(npsi_1d)) + equil_out_ids%time_slice(it)%profiles_1d%b_field_average(1:npsi_1d) = equil_in_itm(it)%profiles_1d%b_av(1:npsi_1d) + end if + if ( (associated(equil_in_itm(it)%profiles_1d%b_min)) .and. & + & (size(equil_in_itm(it)%profiles_1d%b_min) .ge. npsi_1d) ) then + allocate(equil_out_ids%time_slice(it)%profiles_1d%b_field_min(npsi_1d)) + equil_out_ids%time_slice(it)%profiles_1d%b_field_min(1:npsi_1d) = equil_in_itm(it)%profiles_1d%b_min(1:npsi_1d) + end if + if ( (associated(equil_in_itm(it)%profiles_1d%b_max)) .and. (size(equil_in_itm(it)%profiles_1d%b_max) .ge. npsi_1d) ) then + allocate(equil_out_ids%time_slice(it)%profiles_1d%b_field_max(npsi_1d)) + equil_out_ids%time_slice(it)%profiles_1d%b_field_max(1:npsi_1d) = equil_in_itm(it)%profiles_1d%b_max(1:npsi_1d) + end if + ! beta_pol to be fixed later with CHEASE version, new IDS definition of radial profile using edge Ip + allocate(equil_out_ids%time_slice(it)%profiles_1d%beta_pol(npsi_1d)) + call interpos(equil_out_ids%time_slice(it)%profiles_1d%volume(1:npsi_1d), & + & equil_out_ids%time_slice(it)%profiles_1d%pressure(1:npsi_1d), & + & npsi_1d,YOUTINT=equil_out_ids%time_slice(it)%profiles_1d%beta_pol(1:npsi_1d)) + equil_out_ids%time_slice(it)%profiles_1d%beta_pol(1:npsi_1d) = & + & 4._ids_real * equil_out_ids%time_slice(it)%profiles_1d%beta_pol(1:npsi_1d) & + & / equil_out_ids%vacuum_toroidal_field%r0 & + & / (4.E-07_ids_real * CPI) / equil_out_ids%time_slice(it)%global_quantities%ip**2 + end if + ! + ! profiles_2d + if (associated(equil_in_itm(it)%profiles_2d)) then + nb_2d = size(equil_in_itm(it)%profiles_2d) + else + nb_2d = 0 + end if + if (nb_2d .gt. 0) then + allocate(equil_out_ids%time_slice(it)%profiles_2d(nb_2d)) + do iprof2d=1,nb_2d + if (associated(equil_in_itm(it)%profiles_2d(iprof2d)%grid%dim1)) then + ndim1 = size(equil_in_itm(it)%profiles_2d(iprof2d)%grid%dim1) + else + ndim1 = 0 + endif + if (ndim1 .gt. 0) then + ! grid type, so far use: index "name" 'description' + ! 1 "rz" 'cylindrical R,Z ala eqdsk, within the corresponding COCOS convention' + ! 2 "polar" 'true 2D polar coordinates rho, theta with magnetic axis as center of grid; theta and values following the corresponding COCOS convention' + ! 11 "flux_psi_straight" 'flux surface type with psi as radial label, theta straight-field line (mod(index,10)=1), could be non-equidistant; magnetic axis as center of grid; following the corresponding COCOS convention' + ! 12 "flux_psi_arc" 'same as 11 but theta to have equal arc (mod(index,10)=2)' + ! 13 "flux_psi_polar" 'same as 11 but theta as polar angle, could be non-equidistant' + ! 21 "flux_rhopolnorm_straight" 'same as 11 but radial label is sqrt[(psi-psi_axis)/(psi_edge-psi_axis)]' + ! 22 "flux_rhopolnorm_arc" 'same as 12 but radial label is sqrt[(psi-psi_axis)/(psi_edge-psi_axis)]' + ! 23 "flux_rhopolnorm_polar" 'same as 13 but radial label is sqrt[(psi-psi_axis)/(psi_edge-psi_axis)]' + ! 31 to 33: same but "flux_rhotornorm_straight", "flux_rhotornorm_arc", "flux_rhotornorm_polar" + ! + ! 91 "irregular_rz" 'irregular grid, thus give list of vertices in dim1(1:ndim1), dim2(1:ndim1) and then all fields are on values(1:ndim1,1); needs to know if R,Z, psi,theta for dim1, dim2?' + ! + ! These should be already set in metrictoitm in case of treeitm=ids, so just copy with index from grid_type(1) + ! + allocate(equil_out_ids%time_slice(it)%profiles_2d(iprof2d)%type%name(1)) + equil_out_ids%time_slice(it)%profiles_2d(iprof2d)%type%name(1) = 'plasma' + equil_out_ids%time_slice(it)%profiles_2d(iprof2d)%type%index = 4 + allocate(equil_out_ids%time_slice(it)%profiles_2d(iprof2d)%type%description(1)) + equil_out_ids%time_slice(it)%profiles_2d(iprof2d)%type%description(1) = 'Fixed equilibrium code, hence only plasma inside LCFS contributions' + ! + if (associated(equil_in_itm(it)%profiles_2d(iprof2d)%grid_type)) then + read(equil_in_itm(it)%profiles_2d(iprof2d)%grid_type(1),*) & + & equil_out_ids%time_slice(it)%profiles_2d(iprof2d)%grid_type%index + allocate(equil_out_ids%time_slice(it)%profiles_2d(iprof2d)%grid_type%name(1)) + equil_out_ids%time_slice(it)%profiles_2d(iprof2d)%grid_type%name(1) = & + & equil_in_itm(it)%profiles_2d(iprof2d)%grid_type(2) + allocate(equil_out_ids%time_slice(it)%profiles_2d(iprof2d)%grid_type%description(1)) + equil_out_ids%time_slice(it)%profiles_2d(iprof2d)%grid_type%description(1) = & + & equil_in_itm(it)%profiles_2d(iprof2d)%grid_type(4) + else + if (nverbose .ge. 1) write(0,*) 'grid_type not associated profiles_2d(' ,iprof2d, & + & ') return in copy_itm_to_ids' + return + end if + ! + if (associated(equil_in_itm(it)%profiles_2d(iprof2d)%grid%dim2)) then + ndim2 = size(equil_in_itm(it)%profiles_2d(iprof2d)%grid%dim2) + else + ndim2 = 0 + end if + allocate(equil_out_ids%time_slice(it)%profiles_2d(iprof2d)%grid%dim1(ndim1)) + equil_out_ids%time_slice(it)%profiles_2d(iprof2d)%grid%dim1(1:ndim1) = & + & equil_in_itm(it)%profiles_2d(iprof2d)%grid%dim1(1:ndim1) + allocate(equil_out_ids%time_slice(it)%profiles_2d(iprof2d)%grid%dim2(ndim2)) + equil_out_ids%time_slice(it)%profiles_2d(iprof2d)%grid%dim2(1:ndim2) = & + & equil_in_itm(it)%profiles_2d(iprof2d)%grid%dim2(1:ndim2) + if (associated(equil_in_itm(it)%profiles_2d(iprof2d)%r)) then + allocate(equil_out_ids%time_slice(it)%profiles_2d(iprof2d)%r(ndim1,ndim2)) + equil_out_ids%time_slice(it)%profiles_2d(iprof2d)%r(1:ndim1,1:ndim2) = & + & equil_in_itm(it)%profiles_2d(iprof2d)%r(1:ndim1,1:ndim2) + end if + if (associated(equil_in_itm(it)%profiles_2d(iprof2d)%z)) then + allocate(equil_out_ids%time_slice(it)%profiles_2d(iprof2d)%z(ndim1,ndim2)) + equil_out_ids%time_slice(it)%profiles_2d(iprof2d)%z(1:ndim1,1:ndim2) = & + & equil_in_itm(it)%profiles_2d(iprof2d)%z(1:ndim1,1:ndim2) + end if + allocate(equil_out_ids%time_slice(it)%profiles_2d(iprof2d)%psi(ndim1,ndim2)) + equil_out_ids%time_slice(it)%profiles_2d(iprof2d)%psi(1:ndim1,1:ndim2) = & + & equil_in_itm(it)%profiles_2d(iprof2d)%psi(1:ndim1,1:ndim2) + allocate(equil_out_ids%time_slice(it)%profiles_2d(iprof2d)%theta(ndim1,ndim2)) + equil_out_ids%time_slice(it)%profiles_2d(iprof2d)%theta(1:ndim1,1:ndim2) = & + & equil_in_itm(it)%profiles_2d(iprof2d)%theta(1:ndim1,1:ndim2) + allocate(equil_out_ids%time_slice(it)%profiles_2d(iprof2d)%phi(ndim1,ndim2)) + equil_out_ids%time_slice(it)%profiles_2d(iprof2d)%phi(1:ndim1,1:ndim2) = & + & equil_in_itm(it)%profiles_2d(iprof2d)%phi(1:ndim1,1:ndim2) + if (associated(equil_in_itm(it)%profiles_2d(iprof2d)%jphi)) then + allocate(equil_out_ids%time_slice(it)%profiles_2d(iprof2d)%j_tor(ndim1,ndim2)) + equil_out_ids%time_slice(it)%profiles_2d(iprof2d)%j_tor(1:ndim1,1:ndim2) = & + & equil_in_itm(it)%profiles_2d(iprof2d)%jphi(1:ndim1,1:ndim2) + end if + if (associated(equil_in_itm(it)%profiles_2d(iprof2d)%jpar)) then + allocate(equil_out_ids%time_slice(it)%profiles_2d(iprof2d)%j_parallel(ndim1,ndim2)) + equil_out_ids%time_slice(it)%profiles_2d(iprof2d)%j_parallel(1:ndim1,1:ndim2) = & + & equil_in_itm(it)%profiles_2d(iprof2d)%jpar(1:ndim1,1:ndim2) + end if + if (associated(equil_in_itm(it)%profiles_2d(iprof2d)%br)) then + allocate(equil_out_ids%time_slice(it)%profiles_2d(iprof2d)%b_field_r(ndim1,ndim2)) + equil_out_ids%time_slice(it)%profiles_2d(iprof2d)%b_field_r(1:ndim1,1:ndim2) = & + & equil_in_itm(it)%profiles_2d(iprof2d)%br(1:ndim1,1:ndim2) + end if + if (associated(equil_in_itm(it)%profiles_2d(iprof2d)%bz)) then + allocate(equil_out_ids%time_slice(it)%profiles_2d(iprof2d)%b_field_z(ndim1,ndim2)) + equil_out_ids%time_slice(it)%profiles_2d(iprof2d)%b_field_z(1:ndim1,1:ndim2) = & + & equil_in_itm(it)%profiles_2d(iprof2d)%bz(1:ndim1,1:ndim2) + end if + if (associated(equil_in_itm(it)%profiles_2d(iprof2d)%bphi)) then + allocate(equil_out_ids%time_slice(it)%profiles_2d(iprof2d)%b_field_tor(ndim1,ndim2)) + equil_out_ids%time_slice(it)%profiles_2d(iprof2d)%b_field_tor(1:ndim1,1:ndim2) = & + &equil_in_itm(it)%profiles_2d(iprof2d)%bphi(1:ndim1,1:ndim2) + end if + end if + end do + end if + ! + ! coordinate_system: + if (associated(equil_in_itm(it)%coord_sys%grid_type)) then + read(equil_in_itm(it)%coord_sys%grid_type(1),*) equil_out_ids%time_slice(it)%coordinate_system%grid_type%index + allocate(equil_out_ids%time_slice(it)%coordinate_system%grid_type%name(1)) + equil_out_ids%time_slice(it)%coordinate_system%grid_type%name(1) = equil_in_itm(it)%coord_sys%grid_type(2) + allocate(equil_out_ids%time_slice(it)%coordinate_system%grid_type%description(1)) + equil_out_ids%time_slice(it)%coordinate_system%grid_type%description(1) = equil_in_itm(it)%coord_sys%grid_type(4) + else + if (nverbose .ge. 1) write(0,*) 'grid_type not associated in coord_sys, return in copy_itm_to_ids' + return + end if + if ( (associated(equil_in_itm(1)%coord_sys%grid%dim1)) .and. (associated(equil_in_itm(1)%coord_sys%grid%dim2))) then + ndim1 = size(equil_in_itm(1)%coord_sys%grid%dim1) + ndim2 = size(equil_in_itm(1)%coord_sys%grid%dim2) + else + ndim1 = 0 + ndim2 = 0 + end if + allocate(equil_out_ids%time_slice(it)%coordinate_system%grid%dim1(ndim1)) + equil_out_ids%time_slice(it)%coordinate_system%grid%dim1(1:ndim1) = equil_in_itm(it)%coord_sys%grid%dim1(1:ndim1) + allocate(equil_out_ids%time_slice(it)%coordinate_system%grid%dim2(ndim2)) + equil_out_ids%time_slice(it)%coordinate_system%grid%dim2(1:ndim2) = equil_in_itm(it)%coord_sys%grid%dim2(1:ndim2) + allocate(equil_out_ids%time_slice(it)%coordinate_system%r(ndim1,ndim2)) + equil_out_ids%time_slice(it)%coordinate_system%r(1:ndim1,1:ndim2) = & + & equil_in_itm(it)%coord_sys%position%r(1:ndim1,1:ndim2) + allocate(equil_out_ids%time_slice(it)%coordinate_system%z(ndim1,ndim2)) + equil_out_ids%time_slice(it)%coordinate_system%z(1:ndim1,1:ndim2) = & + & equil_in_itm(it)%coord_sys%position%z(1:ndim1,1:ndim2) + allocate(equil_out_ids%time_slice(it)%coordinate_system%jacobian(ndim1,ndim2)) + equil_out_ids%time_slice(it)%coordinate_system%jacobian(1:ndim1,1:ndim2) = & + & equil_in_itm(it)%coord_sys%jacobian(1:ndim1,1:ndim2) + allocate(equil_out_ids%time_slice(it)%coordinate_system%tensor_contravariant(ndim1,ndim2,3,3)) + equil_out_ids%time_slice(it)%coordinate_system%tensor_contravariant(1:ndim1,1:ndim2,1,1) = & + & equil_in_itm(it)%coord_sys%g_11(1:ndim1,1:ndim2) + equil_out_ids%time_slice(it)%coordinate_system%tensor_contravariant(1:ndim1,1:ndim2,1,2) = & + & equil_in_itm(it)%coord_sys%g_12(1:ndim1,1:ndim2) + equil_out_ids%time_slice(it)%coordinate_system%tensor_contravariant(1:ndim1,1:ndim2,1,3) = & + & equil_in_itm(it)%coord_sys%g_13(1:ndim1,1:ndim2) + equil_out_ids%time_slice(it)%coordinate_system%tensor_contravariant(1:ndim1,1:ndim2,2,2) = & + & equil_in_itm(it)%coord_sys%g_22(1:ndim1,1:ndim2) + equil_out_ids%time_slice(it)%coordinate_system%tensor_contravariant(1:ndim1,1:ndim2,2,3) = & + & equil_in_itm(it)%coord_sys%g_23(1:ndim1,1:ndim2) + equil_out_ids%time_slice(it)%coordinate_system%tensor_contravariant(1:ndim1,1:ndim2,3,3) = & + & equil_in_itm(it)%coord_sys%g_33(1:ndim1,1:ndim2) + ! + end do + ! + ! code_parameters: at this stage, use array of structure of code%parameters to store input xml lines so use last equilibrium + if (associated(equil_in_itm(nb_times)%codeparam%codename)) then + nb_lines = size(equil_in_itm(nb_times)%codeparam%codename) + else + nb_lines = 0 + end if + if ( nb_lines .gt. 0) then + allocate(equil_out_ids%code%name(nb_lines)) + equil_out_ids%code%name(1:nb_lines) = equil_in_itm(nb_times)%codeparam%codename(1:nb_lines) + if (nverbose .ge. 4) then + print *,'size(equil_out_ids%code%name)= ',size(equil_out_ids%code%name) + print *,'equil_out_ids%code%name(1) = ',equil_out_ids%code%name(1) + end if + end if + if (associated(equil_in_itm(nb_times)%codeparam%codeversion)) then + nb_lines = size(equil_in_itm(nb_times)%codeparam%codeversion) + else + nb_lines = 0 + end if + if ( nb_lines .gt. 0) then + allocate(equil_out_ids%code%version(nb_lines)) + equil_out_ids%code%version(1:nb_lines) = equil_in_itm(nb_times)%codeparam%codeversion(1:nb_lines) + if (nverbose .ge. 4) then + print *,'size(equil_out_ids%code%version)= ',size(equil_out_ids%code%version) + print *,'equil_out_ids%code%version(1) = ',equil_out_ids%code%version(1)(70:100) + print *,'len(equil_out_ids%code%version(1)) = ',len(equil_out_ids%code%version(1)) + end if + end if + if (associated(equil_in_itm(nb_times)%codeparam%parameters)) then + nb_lines = size(equil_in_itm(nb_times)%codeparam%parameters) + else + nb_lines = 0 + end if + if (nverbose .ge. 4) print *,'nb_lines for parameters = ',nb_lines + if ( nb_lines .gt. 0) then + allocate(equil_out_ids%code%parameters(nb_lines)) + equil_out_ids%code%parameters(1:nb_lines) = equil_in_itm(nb_times)%codeparam%parameters(1:nb_lines) + if (nverbose .ge. 4) print *,'equil_out_ids%code%parameters(1)= ',equil_out_ids%code%parameters(1) + else + allocate(equil_out_ids%code%parameters(1)) + equil_out_ids%code%parameters(1) = 'to have something' + end if + ! + flag_status = 0 + ! + return +END subroutine copy_itm_to_ids_equilibrium diff --git a/src-f90/cotrol.f90 b/src-f90/cotrol.f90 index bc2f8d986213fddfc0a2e6a651f2992b6c6b31fd..0850917ad42bf7dedc48b206c7f47430219e428d 100644 --- a/src-f90/cotrol.f90 +++ b/src-f90/cotrol.f90 @@ -211,17 +211,6 @@ SUBROUTINE COTROL COCOS_OUT = 13 ENDIF ! - IF (NFUNRHO .GE. 1) THEN - IF (NVERBOSE .GE. 1) write(*,*) 'EXP. PROFILES MAY BE NOT GIVEN IN TERMS OF RHO PSI' - IF (((NPPFUN .NE. 4) .AND. (NPPFUN .NE. 8)) .OR. (NFUNC .NE. 4)) THEN - write(0,*) ' NFUNRHO>=1 ONLY WITH NPPFUN=4 or 8 AND NFUNC=4' - eqchease_out(index_out)%codeparam%output_diag(1) = & - & 'in cotrol: NFUNRHO>=1 ONLY WITH NPPFUN=4 or 8 AND NFUNC=4' - eqchease_out(index_out)%codeparam%output_flag = -794 - return - ENDIF - ENDIF - ! ! CHECK FLAGS IN COMDIM ! IF (NIDEAL.EQ.0 .AND. MFLGMAR.NE.1) THEN diff --git a/src-f90/euitm_xml_parser.f90 b/src-f90/euitm_xml_parser.f90 index 845faa0f15a8ff5eef4d321c99a4d199be8cc260..a5428c524f9b051b62e70eb0e252b9c188017f7c 100644 --- a/src-f90/euitm_xml_parser.f90 +++ b/src-f90/euitm_xml_parser.f90 @@ -15,7 +15,7 @@ module euitm_xml_parser ! ! The parser requires version 4.07b of the euitm_schemas and up. !---------------------------------------------------------------------------- - + use itm_types use string_manipulation_tools @@ -46,24 +46,30 @@ contains type(tree) :: parameter_list integer(itm_i4) :: nparm - integer(itm_i4) :: i, length + integer(itm_i4) :: i, length, idebug + + idebug = 0 if (.not. associated(code_parameters%parameters)) then write(0,*) 'code_parameters%parameters not associated in euitm_xml_parse' return else - write(6, *) 'number of XML input lines : ', & - size(code_parameters%parameters) + if (idebug .ge. 3) write(6, *) 'number of XML input lines : ', size(code_parameters%parameters) end if - call build_xml_tree(code_parameters%schema, parameter_list) + if (.not. associated(code_parameters%schema)) then + write(0,*) 'code_parameters%schema not associated in euitm_xml_parse' + return + else + call build_xml_tree(code_parameters%schema, parameter_list) + end if length = 0 do i = 1, size(code_parameters%parameters) length = length + len(code_parameters%parameters(i)) end do - write(*, *) 'length of parameter_string = ', length + if (idebug .ge. 3) write(*, *) 'length of parameter_string = ', length call parse_xml_string(code_parameters%parameters, length, nparm, & parameter_list) @@ -85,13 +91,14 @@ contains logical :: been_here type(element), pointer :: temp_pointer + integer :: idebug = 0 !-- check schema if (.not. associated(schema)) then write(0,*) ' ERROR: No schema specified! Cannot build tree in build_xml_tree' return else - write(6, *) 'number of XML lines in schema: ', size(schema) + if (idebug .ge. 3) write(6, *) 'number of XML lines in schema: ', size(schema) end if !-- calculate length of schema_string @@ -100,7 +107,7 @@ contains length = length + len(schema(i)) end do - write(*, *) 'length of schema_string = ', length + if (idebug .ge. 3) write(*, *) 'length of schema_string = ', length call build_tree(schema, length, branches, parameter_list) @@ -156,7 +163,7 @@ contains = schema(i) start_index = start_index + len(schema(i)) end do - + !-- replace line feeds do i = 1, len(parameter_string) if (iachar(parameter_string(i : i)) == 10) & @@ -258,7 +265,7 @@ contains !-- scan for occurrences of ' ref="', count number of children do i = index(parameter_string(found%ind_start : found%ind_end), & - ' ref="') + ' ref="') if (i == 0) then if (no_of_children == 0) then branches = branches + 1 @@ -280,7 +287,7 @@ contains child => parent%child else allocate(child%sibling) ! next child - child => child%sibling + child => child%sibling end if allocate(child%cname(j - i + 1)) child%cname = str2char(parameter_string(i : j)) @@ -314,7 +321,7 @@ contains type(element), pointer :: temp_pointer type(interval) :: full_string, bounds character(len = length) :: parameter_string - integer(itm_i4) :: i, start_index + integer(itm_i4) :: i, start_index, idebug = 0 !-- concatenate strings in textv with spaces instead of line feeds @@ -323,9 +330,9 @@ contains do i = 1, size(textv) parameter_string(start_index : start_index + len(textv(i)) - 1) & = textv(i) - start_index = start_index + len(textv(i)) - end do - + start_index = start_index + len(textv(i)) + end do + !-- replace line feeds do i = 1, len(parameter_string) if (iachar(parameter_string(i : i)) == 10) & @@ -342,7 +349,7 @@ contains else temp_pointer => parameter_list%first end if - + !-- parse for document element call parse_xml_element(parameter_string, temp_pointer%cname, & full_string, bounds) @@ -370,8 +377,8 @@ contains return end if - write(*,*) 'number of parameters in XML file: ', nparm - + if (idebug .ge. 3) write(*,*) 'number of parameters in XML file: ', nparm + end subroutine parse_xml_string recursive subroutine parse_xml_tree(parameter_string, tree_pointer, & @@ -437,7 +444,7 @@ contains character, dimension(:) :: ctag character(len = size(ctag)) :: tag type(interval) :: search, found - integer(itm_i4) :: i + integer(itm_i4) :: i do i = 1, size(ctag) tag(i : i) = ctag(i) diff --git a/src-f90/futils_src/Makefile.gfortran b/src-f90/futils_src/Makefile.gfortran index 63b49098bc8d40eacad0013cb09846fb8b2113ed..ae5f9289a20b6748072e420c2a3e619f29cf0d12 100644 --- a/src-f90/futils_src/Makefile.gfortran +++ b/src-f90/futils_src/Makefile.gfortran @@ -1,18 +1,20 @@ PREFIX=$(HOME)/gcc -F90 = mpif90 +F90 = gfortran OPT = -g -fbounds-check -fbacktrace # only from 4.3.x OPT = -g -fbounds-check -F90FLAGS = $(OPT) -I${HDF5}/lib -I${HDF5}/include +F90FLAGS = $(OPT) $(INCL_HDF5) CC = cc -CFLAGS = -O2 -LDFLAGS = $(OPT) -L. -L${HDF5}/lib +CFLAGS = -O2 -Impiuni +LDFLAGS = $(OPT) -L. $(LIBS_HDF5) -LIBS = -lfutils -lhdf5_fortran -lhdf5 -lz +LIBS = -lfutils -lhdf5_fortran -lhdf5 -lz -lmpiuni .SUFFIXES: .SUFFIXES: .o .c .f90 +.PHONY: mpiuni + .f90.o: $(F90) $(F90FLAGS) -c $< @@ -21,47 +23,28 @@ lib: libfutils.a getfile getfile: getfile.o $(F90) $(LDFLAGS) -o $@ $< $(LIBS) -libfutils.a: futils.o cutils.o buffer.o vis3d.o +libfutils.a: futils.o cutils.o buffer.o uniproc.o ar r $@ $? ranlib $@ -futils.o: append.tpl zappend.tpl \ - putarr.tpl cputarr.tpl putarrnd.tpl cputarrnd.tpl \ - getarr.tpl cgetarr.tpl getarrnd.tpl cgetarrnd.tpl - -buffer.o: futils.o - -vis3d.o: futils.o - -test: - make -C ../examples test_s test_p - -install: debug opt - -debug: - make distclean - make "OPT = -g -fbounds-check" libfutils.a - mkdir -p $(PREFIX)/{lib,include}/g - cp -p libfutils.a $(PREFIX)/lib/g - cp -p *.mod $(PREFIX)/include/g +mpiuni: + $(MAKE) -C mpiuni lib FC="$(F90)" FFLAGS="$(OPT)" CC=$(CC) -opt: - make distclean - make "OPT = -O2" libfutils.a - mkdir -p $(PREFIX)/{lib,include}/O - cp -p libfutils.a $(PREFIX)/lib/O - cp -p *.mod $(PREFIX)/include/O +futils.o: mpiuni \ + append.tpl zappend.tpl \ + putarr.tpl cputarr.tpl \ + getarr.tpl cgetarr.tpl + $(F90) $(F90FLAGS) -Impiuni -c futils.f90 -uninstall: - rm -f $(PREFIX)/include{O,g}/futils.mod - rm -f $(PREFIX)/include{O,g}/hashtable.mod - rm -f $(PREFIX)/include{O,g}/vis3d.mod - rm -f $(PREFIX)/lib{O,g}/libfutils.a +buffer.o: mpiuni futils.o + $(F90) $(F90FLAGS) -Impiuni -c buffer.f90 getfile.o: libfutils.a clean: - rm -f *.o *~ a.out fort.* *.h5* + rm -f *.o *~ a.out + make -C mpiuni clean distclean: clean - rm -f getfile *.a *.mod TAGS + rm -f $(SERIAL) ex6 getfile *.h5 *.a *.mod + make -C mpiuni distclean diff --git a/src-f90/globals.f90 b/src-f90/globals.f90 index 823723a614704c7b4abe8757c914de0fe9cf936a..d2ff529bf8bf352114887d1371259ced29713a3d 100644 --- a/src-f90/globals.f90 +++ b/src-f90/globals.f90 @@ -140,6 +140,7 @@ MODULE globals INTEGER, SAVE :: ni = 0 INTEGER, SAVE :: nideal = 6 INTEGER, SAVE :: nin = 0 + INTEGER, SAVE :: ninblopt = 0 INTEGER, SAVE :: ninmap = 0 INTEGER, SAVE :: ninsca = 0 INTEGER, SAVE :: nipr = 0 @@ -261,7 +262,7 @@ MODULE globals INTEGER, SAVE :: nxtor = 0 INTEGER, SAVE :: nxtorp = 0 INTEGER, SAVE :: nzbox = 0 - INTEGER, SAVE :: NVERBOSE = 3 + INTEGER, SAVE :: NVERBOSE = 1 INTEGER, DIMENSION(10), SAVE :: nzbox_xtor = 0 INTEGER, SAVE :: shift_p = 0 !HL for xtor ! @@ -488,6 +489,7 @@ MODULE globals REAL(RKIND), SAVE :: pangle = 0._RKIND REAL(RKIND), DIMENSION( :), ALLOCATABLE, SAVE :: pcs REAL(RKIND), DIMENSION( :), ALLOCATABLE, SAVE :: pcsm + REAL(RKIND), SAVE :: pprime_bal_max = 0._RKIND REAL(RKIND), SAVE :: predge = 0._RKIND REAL(RKIND), SAVE :: psi0 = 0._RKIND REAL(RKIND), SAVE :: psibndexp = -9.E40_RKIND @@ -851,6 +853,7 @@ MODULE globals CHARACTER(len=32), DIMENSION(2), SAVE :: tree_user = 'xxx' CHARACTER(len=32), DIMENSION(2), SAVE :: tree_tokamak ='test' CHARACTER(len=1), DIMENSION(2), SAVE :: tree_majorversion = '3' + CHARACTER(len=80), SAVE :: EXPEQ_IN_FILENAME = '' ! ! types type(type_equilibrium),pointer, SAVE :: eqchease_in(:) diff --git a/src-f90/gloqua.f90 b/src-f90/gloqua.f90 index 9ac19516cb33a3a02c47bd0ddabe8fb76930e63b..e23b0f9dd9391a559aca9e30de4f09dda5794129 100644 --- a/src-f90/gloqua.f90 +++ b/src-f90/gloqua.f90 @@ -126,6 +126,10 @@ SUBROUTINE GLOQUA(PSM,KPSM,KCASE) CTORSRF = eqchease_out(index_out)%profiles_1d%phi(KPSM1) CSMTOR(1:KPSM-1) = SQRT(eqchease_out(index_out)%profiles_1d%phi(2:KPSM)/CTORSRF) CSMTOR(KPSM) = 1._RKIND +!!$ rewind(41) +!!$ write(41,'(A)') '% ZPSISMP1 rhopsismp1 q (0,CSMTOR)' +!!$ ZDUMMY1=(/0._RKIND, (CSMTOR(J10),J10=1,KPSM) /) +!!$ write(41,'(1p4e14.6)') (ZPSISMP1(J10),sqrt(ZPSISMP1(J10)/ZPSISMP1(KPSM1)),eqchease_out(index_out)%profiles_1d%q(J10),ZDUMMY1(J10),J10=1,KPSM1) ! assume PHI normalized by R0^2 B0 and rho_tor=sqrt(Phi/pi/B0) with same B0, thus do not use Bvacuum(Rgeom(edge)) as before version 788 eqchease_out(index_out)%profiles_1d%rho_tor(1:KPSM1) = sqrt(eqchease_out(index_out)%profiles_1d%phi(1:KPSM1) / PI ) !dpsicheasedrhotor=B0*rhotor/q (B0 disappears in CHEASE units) (to convert d/dpsi in dprime = d/drho_tor=d/dpsi * dpsi/drho_tor) diff --git a/src-f90/gloqua_imas.f90 b/src-f90/gloqua_imas.f90 deleted file mode 100644 index fec1a818147b7b8dbfe890bc14a83883a7dd8954..0000000000000000000000000000000000000000 --- a/src-f90/gloqua_imas.f90 +++ /dev/null @@ -1,299 +0,0 @@ -SUBROUTINE GLOQUA(PSM,KPSM,KCASE) - ! ################################## - ! - !********************************************************************** - ! - ! GLOBAL EQUILIBRIUM QUANTITIES IN TABLE 1 OF PUBLICATION - ! VARIOUS QUANTITITES ON PSM MESH WHICH HAVE NOT BEEN CALCULATED IN CHIPSIMETRICS - ! COMPUTE ON WHOLE PROFILE AND DO INTERPOLATION ON PS MESH IF NEEDED - ! - ! THIS HAS BEEN CHANGED SO THAT QUANTITIES ARE CALCULATED ON THE WHOLE MESH - ! SAME AS THE ONE USED IN SURFACE AND CHIPSIMETRICS (FOR MOST NIDEAL CASES) - ! - ! routine SURFACE computes on mesh psiiso and SMISO(1:NISO1EFF) - ! This routine computes on mesh [0 SMISO]=SMISOP1(1:NISO1EFF1) - ! - ! CS REMOVED SINCE ALL COMPUTED ON SINGLE PSM MESH - !********************************************************************** - ! - USE globals - USE interpol - use interpos_module - IMPLICIT NONE - ! - INTEGER, INTENT(IN) :: KPSM, KCASE - REAL(RKIND), INTENT(IN) :: PSM(KPSM) - ! - REAL(RKIND) :: ZPSISM(KPSM) & - & ,ZDUMMY1(KPSM+1), ZDUMMY2(KPSM+1), ZPSISMP1(KPSM+1), ZIP(KPSM+1) & - & ,SIGMA(KPSM+1), ZJBS2(KPSM+1), ZBET(KPSM+1), & - & ZPPR(KPSM+1) - REAL(RKIND) :: TENS_DEF, ZIP2, ZIB2, ZS1, ZS2, ZS3, ZF1, ZF2, ZF3, ZS95, ZBMAG - INTEGER :: I, J10, JQMIN, J1, JQ95, KPSM1 - - REAL(RKIND) :: FIT0CUB, XX(1:4), YY(1:4), XXX - FIT0CUB(XXX) = FCCCC0(YY(1),YY(2),YY(3),YY(4),XX(1),XX(2),XX(3),XX(4),XXX) - - ! - !----*----*----*---*----*----*----*----*----*----*----*----*----*----*- - ! - ! - DO J10=1,KPSM - ! 1) INTERPOLATE J5 TO OBTAIN J5' REQUIRED FOR LOCAL INTERCHANGE - ! STABILITY CRITERIA. - ! I1 = J10 - ! IF (j10.eq.1) I1 = 2 - ! IF (j10.eq.KP) I1 = KP-1 - ! RJ5P(J10) = FQQQ1(RJ5(I1-1),RJ5(I1),RJ5(I1+1), - ! , PSM(I1-1),PSM(I1),PSM(I1+1), - ! , PSM(J10)) - ! RJ5P(J10) = RJ5P(J10) / (2.*PSM(J10)*CPSRF) - ! CDQ(J10) = FQQQ1(QPSI(I1-1),QPSI(I1),QPSI(I1+1), - ! , PSM(I1-1),PSM(I1),PSM(I1+1), - ! , PSM(J10)) - ! CDQ(J10) = CDQ(J10) / (2.*PSM(J10)*CPSRF) - ! 2) COMPUTE MERCIER PARAMETER -D_I (EQ.(19) IN CHEASE PAPER) - SMERCI(J10) = (CPPR(J10)*TMF(J10)*RJ2(J10)/CDQ(J10) - .5_RKIND)**2 + & - & CPPR(J10) * (RJ5P(J10) - CPPR(J10) * RJ3(J10)) * & - & (TMF(J10)**2 * RJ1(J10) + RJ4(J10)) / CDQ(J10)**2 - ! 3) COMPUTE H OF GREENE, GLASSER, JOHNSON (EQ.(21) IN CHEASE PAPER) - HMERCR(J10) = TMF(J10) * CPPR(J10) / CDQ(J10) * & - & (RJ2(J10) - RJ5(J10) * (RJ4(J10) + TMF(J10)**2 * & - & RJ1(J10)) / (RJ6(J10) + TMF(J10)**2 * RJ4(J10))) - ! 4) COMPUTE RESISTIVE INTERCHANGE PARAMETER -D_R - ! (EQ.(20) IN CHEASE PAPER) - SMERCR(J10) = SMERCI(J10) - (HMERCR(J10) - .5_RKIND)**2 - END DO - ! - IF (KCASE .EQ. 2) return - ! - KPSM1 = KPSM + 1 - ! - ! Quantities which can be computed directly from surface results (and where in chipsimetrics before) - eqchease_out(index_out)%profiles_1d%psi = eqchease_out(index_out)%coord_sys%grid%dim1 - eqchease_out(index_out)%profiles_1d%F_dia(1:KPSM1) = (/ T0, tmf(1:KPSM) /) - eqchease_out(index_out)%profiles_1d%pressure(1:KPSM1) = (/ CP0, cpr(1:KPSM) /) - eqchease_out(index_out)%profiles_1d%ffprime(1:KPSM1) = (/ DTTP0, ttp(1:KPSM) /) - eqchease_out(index_out)%profiles_1d%pprime(1:KPSM1) = (/ DPDP0, cppr(1:KPSM) /) - eqchease_out(index_out)%profiles_1d%q(1:KPSM1) = (/ q0, qpsi(1:KPSM) /) - ! jphi=<jphi/R>/<1/R> - eqchease_out(index_out)%profiles_1d%jphi(1:KPSM1) = (/ RIPR0, ripr(1:KPSM) /) - eqchease_out(index_out)%profiles_1d%ftrap(1:KPSM1) = (/ 0._rkind, (1._rkind - RFCIRC(1:KPSM)) /) - eqchease_out(index_out)%profiles_1d%gm1(1:KPSM1) = (/ 1./RMAG**2, RJ4(1:KPSM)/RJ5(1:KPSM) /) - ! B0EXP is the B0 for normalization "outide" chease, thus B0_chease=1 by construction even if not edge value with Rgeom - ! eqchease_jparallel = <j.B>/B0=<j.B>chease/B0_chease=<j.B>chease, Iparallel=rjdotb=<j.B>/R0/<Bphi/R>=<j.Bchease>/TMF(:)/<1/R**2> - eqchease_out(index_out)%profiles_1d%jparallel(1:KPSM1) = (/ RJDTB0, rjdotb(1:KPSM) /) * eqchease_out(index_out)%profiles_1d%F_dia(1:KPSM1) & - & * eqchease_out(index_out)%profiles_1d%gm1(1:KPSM1) - ZBMAG = T0/RMAG - eqchease_out(index_out)%profiles_1d%gm4(1:KPSM1) = (/ 1._RKIND/ZBMAG**2, RIBI2(1:KPSM)/RIVOL(1:KPSM) /) - eqchease_out(index_out)%profiles_1d%gm5(1:KPSM1) = (/ ZBMAG**2, RB2AV(1:KPSM) /) - eqchease_out(index_out)%profiles_1d%gm8(1:KPSM1) = (/ RMAG, RJ7s(1:KPSM,4)/RJ5(1:KPSM) /) - eqchease_out(index_out)%profiles_1d%gm9(1:KPSM1) = (/ 1._RKIND/RMAG, RJ7s(1:KPSM,3)/RJ5(1:KPSM) /) - eqchease_out(index_out)%profiles_1d%b_av(1:KPSM1) = (/ ZBMAG, RIB(1:KPSM)/RIVOL(1:KPSM) /) - ! - ! extra 1D quantities: for ogyropsi or other use - eqchease_out_add_1d(1:KPSM1,iidqdpsi) = (/ DQDP0, cdq(1:KPSM) /) !dqdpsi - ! YC: note that the array above is overwritten below by interpos output - ! - ! Quantities integrated and/or fitted on psi mesh. Use interpos for integral, in this way accurate and integrals on same mesh points - ! - ZPSISM(1:KPSM) = CPSRF * PSM(1:KPSM)**2 - ZPSISMP1(1:KPSM1) = (/0._rkind, ZPSISM(1:KPSM)/) - ! - ! - SIGMA=(/1000._RKIND, (REAL(1.,RKIND),I=1,KPSM) /) - TENS_DEF = -0.1_RKIND - ! - ! dIBS/dpsi = <j.B> / <B**2> * 2 pi q(psi), as jBS = gam(psi)*B, IBS=int(dpsi) int(dlp/(RBp)) <j.B> / <B**2> * G/R - ZDUMMY1(2:KPSM1) = TWOPI * QPSI(1:KPSM) / RB2AV(1:KPSM) - ZDUMMY1(1) = 0._RKIND - CALL INTERPOS(ZPSISMP1,(/0._RKIND, RJBSOS(1:KPSM,1)/)*ZDUMMY1(1:KPSM1),N=KPSM1,TENSION=TENS_DEF,xscal=ZPSISM(KPSM),& - & yscalint=RITBS,sigma=sigma,nbcscal=(/2, 0/), ybcscal=(/0._rkind, 0._rkind/)) - CALL INTERPOS(ZPSISMP1,(/0._RKIND, RJBSOS(1:KPSM,2)/)*ZDUMMY1(1:KPSM1),NIN=KPSM1,TENSION=TENS_DEF,YOUTINT=ZJBS2(1:KPSM1), & - & sigma=sigma,nbc=(/2, 0/), ybc=(/0._rkind, 0._rkind/)) - RITBSC = ZJBS2(KPSM1) - ! Assumes ZPSISM(KPSM) is edge value (like cs(npsi1) before - CALL INTERPOS(ZPSISMP1,(/0._RKIND, RJBSOS(1:KPSM,3)/)*ZDUMMY1(1:KPSM1),N=KPSM1,TENSION=TENS_DEF,xscal=ZPSISM(KPSM), & - & yscalint=RITBSC2,sigma=sigma,nbcscal=(/2, 0/), ybcscal=(/0._rkind, 0._rkind/)) - CALL INTERPOS(ZPSISMP1,(/0._RKIND, RJBSOS(1:KPSM,4)/)*ZDUMMY1(1:KPSM1),N=KPSM1,TENSION=TENS_DEF,xscal=ZPSISM(KPSM), & - & yscalint=RITBSC3,sigma=sigma,nbcscal=(/2, 0/), ybcscal=(/0._rkind, 0._rkind/)) - ! - CALL INTERPOS(ZPSISMP1,eqchease_out(index_out)%profiles_1d%q,KPSM1,TENSION=TENS_DEF,YOUT=ZDUMMY1(1:KPSM1), & - & YOUTPP=ZDUMMY2(1:KPSM1),YOUTINT=eqchease_out(index_out)%profiles_1d%phi(1:KPSM1), & - & nbc=(/2, 2/), ybc=(/ eqchease_out(index_out)%profiles_1d%q(1), eqchease_out(index_out)%profiles_1d%q(KPSM1) /) ) - eqchease_out(index_out)%profiles_1d%phi(1:KPSM1) = eqchease_out(index_out)%profiles_1d%phi(1:KPSM1) * TWOPI - CTORSRF = eqchease_out(index_out)%profiles_1d%phi(KPSM1) - CSMTOR(1:KPSM-1) = SQRT(eqchease_out(index_out)%profiles_1d%phi(2:KPSM)/CTORSRF) - CSMTOR(KPSM) = 1._RKIND - ! assume PHI normalized by R0^2 B0 and rho_tor=sqrt(Phi/pi/B0) with same B0, thus do not use Bvacuum(Rgeom(edge)) as before version 788 - eqchease_out(index_out)%profiles_1d%rho_tor(1:KPSM1) = sqrt(eqchease_out(index_out)%profiles_1d%phi(1:KPSM1) / PI ) - !dpsicheasedrhotor=B0*rhotor/q (B0 disappears in CHEASE units) (to convert d/dpsi in dprime = d/drho_tor=d/dpsi * dpsi/drho_tor) - eqchease_out(index_out)%profiles_1d%dpsidrho_tor(1:KPSM1) = eqchease_out(index_out)%profiles_1d%rho_tor(1:KPSM1) / eqchease_out(index_out)%profiles_1d%q(1:KPSM1) - CALL INTERPOS(eqchease_out(index_out)%profiles_1d%rho_tor(1:KPSM1),eqchease_out(index_out)%profiles_1d%dpsidrho_tor(1:KPSM1), & - & nin=KPSM1,TENSION=-1._rkind,YOUT=eqchease_out(index_out)%profiles_1d%dpsidrho_tor(1:KPSM1),nbc=(/2, 0/), ybc=(/RC0P, RC0P/)) - eqchease_out(index_out)%profiles_1d%dpsidrho_tor(1) = RC0P ! Avoid round-off errors - - ! alpha= -2 MU0 Rgeom(edge) Q(rho)**2 / B0**2 * DP/DRHOTOR(rho) - eqchease_out_add_1d(:,iialpha) = - 2._rkind * eqchease_out_add_1d(KPSM1,iirgeo) * eqchease_out(index_out)%profiles_1d%q**2 & - & / (TMF(KPSM)/eqchease_out_add_1d(KPSM1,iirgeo))**2 * (/DPDP0, CPPR(1:KPSM) /) * eqchease_out(index_out)%profiles_1d%dpsidrho_tor(:) - - ! Calculate dV/dpsi=Vprime. Add point at s=0 since int(0)=0, but dV/dpsi(0) is not 0. - IF (NVERBOSE .GE. 4) print *,'ZPSISMP1, RIVOL, profiles_1d%vprime, profiles_1d%volume' - CALL INTERPOS(ZPSISMP1,(/RIVOL(1), RIVOL(1:KPSM)/),nin=KPSM1,TENSION=TENS_DEF,YOUT=eqchease_out(index_out)%profiles_1d%vprime, & - & YOUTPP=ZDUMMY2(1:KPSM1),YOUTINT=eqchease_out(index_out)%profiles_1d%volume,SIGMA=SIGMA,nbc=(/0, 2/), ybc=(/RC0P, RIVOL(KPSM)/)) - ! CHEASE misses 2 pi in RIVOL definition - eqchease_out(index_out)%profiles_1d%vprime = TWOPI * eqchease_out(index_out)%profiles_1d%vprime - eqchease_out(index_out)%profiles_1d%volume(1:KPSM1) = TWOPI * eqchease_out(index_out)%profiles_1d%volume(1:KPSM1) - ! Calculate dV/drho_tor (use dV/drho_tor(0)=0) - CALL INTERPOS(eqchease_out(index_out)%profiles_1d%rho_tor(1:KPSM1),eqchease_out(index_out)%profiles_1d%volume(1:KPSM1), & - & nin=KPSM1,TENSION=TENS_DEF,YOUTP=eqchease_out(index_out)%profiles_1d%dvdrho, & - & nbc=(/1, 2/), ybc=(/RC0P, eqchease_out(index_out)%profiles_1d%volume(KPSM1)/)) - IF (NVERBOSE .GE. 4) write(*,'(i3,1p4e15.6)') & - & (i,ZPSISMP1(i),RIVOL(i),eqchease_out(index_out)%profiles_1d%vprime(i),eqchease_out(index_out)%profiles_1d%volume(i),i=1,1) - IF (NVERBOSE .GE. 4) write(*,'(i3,1p4e15.6)') & - & (i,ZPSISMP1(i),RIVOL(i-1),eqchease_out(index_out)%profiles_1d%vprime(i),eqchease_out(index_out)%profiles_1d%volume(i),i=2,KPSM1) - eqchease_out(index_out)%profiles_1d%rho_vol(1:KPSM) = & - & sqrt(eqchease_out(index_out)%profiles_1d%volume(1:KPSM)/eqchease_out(index_out)%profiles_1d%volume(KPSM1)) - eqchease_out(index_out)%profiles_1d%rho_vol(KPSM1) = 1._RKIND - ! - CALL INTERPOS(ZPSISMP1,(/RARE(1), RARE(1:KPSM)/),nin=KPSM1,TENSION=TENS_DEF,YOUT=eqchease_out(index_out)%profiles_1d%aprime, & - & YOUTINT=eqchease_out(index_out)%profiles_1d%area,SIGMA=SIGMA,nbc=(/0, 2/), ybc=(/RC0P, RARE(KPSM)/)) - AREA = eqchease_out(index_out)%profiles_1d%area(KPSM1) - ! - ! use full definition of int(p*dV) instead of int. by part which neglects p(edge) non zero - ! This way same result irrespective of r0exp when using SI inputs like IMAS database pressure for example - CALL INTERPOS(eqchease_out(index_out)%profiles_1d%volume,eqchease_out(index_out)%profiles_1d%pressure(1:KPSM1) & - & ,KPSM1,TENSION=TENS_DEF,YOUTINT=ZBET(1:KPSM1)) - ZBET(1:KPSM1) = -ZBET(1:KPSM1) / twopi ! volume has already 2pi and minus sign from previous int by part -!!$OS why area now, seems because of ITM strange definitions CALL INTERPOS(ZPSISMP1,(/0._rkind, CPPR(1:KPSM)/)*eqchease_out(index_out)%profiles_1d%area(1:KPSM1) & -!!$ & ,KPSM1,TENSION=TENS_DEF,YOUTINT=ZBET(1:KPSM1),SIGMA=SIGMA,nbc=(/2, 0/), ybc=(/0._rkind, 0._rkind/)) - ! - eqchease_out_add_1d(1:KPSM1,iiIplas) = (/RC0P, RIIR(1:KPSM)/) - eqchease_out(index_out)%profiles_1d%beta_pol(1:KPSM1) = -8._RKIND * cpi * ZBET(1:KPSM1) & - & / eqchease_out_add_1d(1:KPSM1,iiIplas)**2 / eqchease_out_add_1d(1:KPSM1,iirgeo) - XX(1:4)=SMISOP1(2:5) - YY(1:4)=eqchease_out(index_out)%profiles_1d%beta_pol(2:5) - eqchease_out(index_out)%profiles_1d%beta_pol(1) = FIT0CUB(RC0P) - ! - CALL INTERPOS(ZPSISMP1,(/RC0P, RIP2(1:KPSM)/),KPSM1,TENSION=TENS_DEF,xscal=ZPSISM(KPSM),yscalint=ZIP2,SIGMA=SIGMA, & - & nbcscal=(/2, 2/), ybcscal=(/0._rkind, RIP2(KPSM)/)) - CALL INTERPOS(ZPSISMP1,(/RC0P, RIP(1:KPSM)/),KPSM1,TENSION=TENS_DEF,YOUTINT=ZIP(1:KPSM1),SIGMA=SIGMA, & - & nbc=(/2, 2/), ybc=(/0._rkind, RIP(KPSM)/),option=-12) - CALL INTERPOS(ZPSISMP1,(/RC0P, RIB2(1:KPSM)/),KPSM1,TENSION=TENS_DEF,xscal=ZPSISM(KPSM),yscalint=ZIB2,SIGMA=SIGMA, & - & nbcscal=(/2, 2/), ybcscal=(/0._rkind, RIB2(KPSM)/)) - ! - CALL INTERPOS(ZPSISMP1,eqchease_out_add_1d(1:KPSM1,iiIplas),nin=KPSM1,TENSION=TENS_DEF,YOUTINT=eqchease_out(index_out)%profiles_1d%li & - & ,SIGMA=SIGMA,nbc=(/2, 2/), ybc=(/eqchease_out_add_1d(1,iiIplas), eqchease_out_add_1d(KPSM1,iiIplas)/)) - eqchease_out(index_out)%profiles_1d%li(2:KPSM1) = 4._RKIND*CPI * eqchease_out(index_out)%profiles_1d%li(2:KPSM1) & - & / eqchease_out_add_1d(2:KPSM1,iirgeo) / eqchease_out_add_1d(2:KPSM1,iiIplas)**2 - XX=SMISOP1(2:5) - YY=eqchease_out(index_out)%profiles_1d%li(2:5) - eqchease_out(index_out)%profiles_1d%li(1)=FIT0CUB(RC0P) - CALL INTERPOS(sqrt(ZPSISMP1),eqchease_out(index_out)%profiles_1d%li,nin=KPSM1,TENSION=TENS_DEF,YOUT=eqchease_out(index_out)%profiles_1d%li, & - & YOUTPP=ZDUMMY2(1:KPSM1),SIGMA=SIGMA,nbc=(/1, 2/),ybc=(/0._rkind, eqchease_out(index_out)%profiles_1d%li(KPSM1) /)) - ! To check how to get value on-axis, with interpos or else. - eqchease_out(index_out)%profiles_1d%gm2(2:KPSM1) = RJ6(1:KPSM)/RJ5(1:KPSM) / eqchease_out(index_out)%profiles_1d%dpsidrho_tor(2:KPSM1)**2 - eqchease_out(index_out)%profiles_1d%gm3(2:KPSM1) = RJ7s(1:KPSM,1)/RJ5(1:KPSM) / eqchease_out(index_out)%profiles_1d%dpsidrho_tor(2:KPSM1)**2 - eqchease_out(index_out)%profiles_1d%gm6(2:KPSM1) = RJ7s(1:KPSM,6)/RJ5(1:KPSM) / eqchease_out(index_out)%profiles_1d%dpsidrho_tor(2:KPSM1)**2 - eqchease_out(index_out)%profiles_1d%gm7(2:KPSM1) = RJ7s(1:KPSM,2)/RJ5(1:KPSM) / eqchease_out(index_out)%profiles_1d%dpsidrho_tor(2:KPSM1) - XX(1:4)=SMISOP1(2:5) - YY(1:4)=eqchease_out(index_out)%profiles_1d%gm2(2:5) - eqchease_out(index_out)%profiles_1d%gm2(1) = FIT0CUB(RC0P) - YY(1:4)=eqchease_out(index_out)%profiles_1d%gm3(2:5) - eqchease_out(index_out)%profiles_1d%gm3(1) = FIT0CUB(RC0P) - YY(1:4)=eqchease_out(index_out)%profiles_1d%gm6(2:5) - eqchease_out(index_out)%profiles_1d%gm6(1) = FIT0CUB(RC0P) - YY(1:4)=eqchease_out(index_out)%profiles_1d%gm7(2:5) - eqchease_out(index_out)%profiles_1d%gm7(1) = FIT0CUB(RC0P) - - VOLUME = eqchease_out(index_out)%profiles_1d%volume(KPSM1) - CPBAR = ZIP(KPSM1) / VOLUME * TWOPI - RITOT = eqchease_out_add_1d(KPSM1,iiIplas) - RINOR = RITOT / (ASPCT * TMF(KPSM)) - BETA = 2._RKIND * ZIP(KPSM1) / ZIB2 - - BETAP = eqchease_out(index_out)%profiles_1d%beta_pol(KPSM1) - BETAS = 2._RKIND * SQRT(ZIP2 * VOLUME/TWOPI) / ZIB2 - BETAX = 2._RKIND * CPBAR * ( eqchease_out_add_1d(KPSM1,iirgeo)/TMF(KPSM) )**2 - CONVF = 0.5_RKIND * RLENG(KPSM)**2 * eqchease_out_add_1d(KPSM1,iirgeo)/ VOLUME - RIBSNOR = RITBS / (ASPCT * TMF(KPSM)) - ! - IF (CPBAR .EQ. 0._RKIND) THEN - CPPF = 0._RKIND - ELSE - CPPF = CP0 / CPBAR - ENDIF - ! - DPRIME(1:KPSM) = 0.5_RKIND * eqchease_out(index_out)%profiles_1d%li(2:KPSM1) + eqchease_out(index_out)%profiles_1d%beta_pol(2:KPSM1) - ! - ! ITM shear is with rhotor, historically CHEASE closer to shear with rhovol but changed to rhotor since March 2015 and version 4.10b of CPO including shear - CALL INTERPOS(eqchease_out(index_out)%profiles_1d%rho_tor,eqchease_out(index_out)%profiles_1d%q,KPSM1,TENSION=TENS_DEF, & - & YOUT=ZDUMMY1(1:KPSM1),YOUTP=eqchease_out_add_1d(:,iishear), & - & nbc=(/2, 2/), ybc=(/eqchease_out(index_out)%profiles_1d%q(1), eqchease_out(index_out)%profiles_1d%q(KPSM1)/)) - eqchease_out_add_1d(:,iishear) = eqchease_out(index_out)%profiles_1d%rho_tor * eqchease_out_add_1d(:,iishear) & - & / eqchease_out(index_out)%profiles_1d%q - CDRQ(1:KPSM) = eqchease_out_add_1d(2:KPSM1,iishear) - ! - !eqchease_out(index_out)%profiles_1d%shear(1:KPSM1) = eqchease_out_add_1d(1:KPSM1,iishear) - ! - CALL INTERPOS(eqchease_out(index_out)%profiles_1d%psi,eqchease_out_add_1d(:,iishear),KPSM1,TENSION=TENS_DEF, & - & YOUTP=eqchease_out_add_1d(:,iidsheardpsi)) - ! - CALL INTERPOS(eqchease_out(index_out)%profiles_1d%psi,eqchease_out(index_out)%profiles_1d%q,KPSM1,TENSION=TENS_DEF, & - & YOUTP=eqchease_out_add_1d(:,iidqdpsi),YOUTPP=eqchease_out_add_1d(:,iid2qdpsi2), & - & nbc=(/2, 2/), ybc=(/eqchease_out(index_out)%profiles_1d%q(1), eqchease_out(index_out)%profiles_1d%q(KPSM1) /)) - ! - CALL INTERPOS(eqchease_out(index_out)%profiles_1d%rho_vol,(/RELL(1), RELL(1:KPSM)/),KPSM1,TENSION=TENS_DEF, & - & YOUT=ZDUMMY2(1:KPSM1),YOUTP=RDEDR(1:KPSM1),SIGMA=SIGMA) - ! - CALL INTERPOS(eqchease_out(index_out)%profiles_1d%rho_vol,(/CPR(1), CPR(1:KPSM)/),NIN=KPSM1,TENSION=TENS_DEF,YOUTP=ZPPR(1:KPSM1), & - & SIGMA=SIGMA) - RDI(1:KPSM) = .25_RKIND + 2._RKIND * eqchease_out(index_out)%profiles_1d%rho_vol(2:KPSM1) * ZPPR(1:KPSM) / (T0*CDRQ(1:KPSM))**2 * & - & (1._RKIND - eqchease_out(index_out)%profiles_1d%q(2:KPSM1)**2 * (1._RKIND + 1.5_RKIND*DPRIME(1:KPSM)*RDEDR(1:KPSM) - & - & .75_RKIND * (2._RKIND*ZDUMMY2(2:KPSM1) + eqchease_out(index_out)%profiles_1d%rho_vol(2:KPSM1) * RDEDR(1:KPSM)))) - RSY(1:KPSM) = .25_RKIND + 2._RKIND * eqchease_out(index_out)%profiles_1d%rho_vol(2:KPSM1) * ZPPR(2:KPSM1) / (T0*CDRQ(1:KPSM))**2 * & - & (1._RKIND - ZDUMMY1(2:KPSM1)**2) - ! - ! DIAGNOSTICS TYPE 1-3 - if (NDIAGOP .GE. 0) then - CALL GLOADD(ZPSISMP1(1:KPSM1),ZJBS2(1:KPSM1),ZBET(1:KPSM1),KPSM1,1) - CALL GLOADD(ZPSISMP1(1:KPSM1),ZJBS2(1:KPSM1),ZBET(1:KPSM1),KPSM1,2) - CALL GLOADD(ZPSISMP1(1:KPSM1),ZJBS2(1:KPSM1),ZBET(1:KPSM1),KPSM1,3) -!!$ CALL GLOADD(ZPSISMP1(1:KPSM1),ZJBS2(1:KPSM1),ZBET(1:KPSM1),KPSM1,4) ! Note: could not check if works with new smisop1 mesh (0., csm(:)), only if EXPDATA given (to implement new flag) - end if - ! - JQMIN = 1 - QMIN = Q0 - ZS95 = SQRT(0.95_RKIND) - ! - DO J1=1,KPSM - IF ( QPSI(J1) .LT. QMIN ) THEN - JQMIN = J1 - QMIN = QPSI(JQMIN) - ENDIF - IF ( SMISO(J1) .LT. ZS95 ) THEN - JQ95 = J1 - ENDIF - enddo - ! - CSQMIN=SMISO(JQMIN) - ! - ! QUADRATIC INTERPOLATION FOR QMIN - ! - IF (JQMIN.ne.1 .and. JQMIN.ne.KPSM) then - ZS1 = SMISO(JQMIN-1) - ZF1 = QPSI(JQMIN-1) - ZS2 = SMISO(JQMIN) - ZF2 = QPSI(JQMIN) - ZS3 = SMISO(JQMIN+1) - ZF3 = QPSI(JQMIN+1) - CSQMIN = - FB1(ZF1,ZF2,ZF3,ZS1,ZS2,ZS3) / FB2(ZF1,ZF2,ZF3,ZS1,ZS2,ZS3) * 0.5_RKIND - QMIN = FQQQ0(ZF1,ZF2,ZF3,ZS1,ZS2,ZS3,CSQMIN) - endif - ! - ! QUADRATIC INTERPOLATION FOR Q95 - ! - Q95 = FQQQ0(QPSI(JQ95-1),QPSI(JQ95),QPSI(JQ95+1),SMISO(JQ95-1),SMISO(JQ95),SMISO(JQ95+1),ZS95) - ! - RETURN -END SUBROUTINE GLOQUA diff --git a/src-f90/guess.f90 b/src-f90/guess.f90 index e5e2d69b8a3b42e21d099deded85df24d08cb1be..4365fe5d6ca5ab502426eb8f5b2d5a5486e02f85 100644 --- a/src-f90/guess.f90 +++ b/src-f90/guess.f90 @@ -52,7 +52,7 @@ SUBROUTINE GUESS(KGUESS) REAL(RKIND) :: ZS REAL(RKIND) :: ZZ REAL(RKIND) :: ZR - REAL(RKIND) :: ZWORK + REAL(RKIND) :: ZWORK, TENS_DEF INTEGER :: J1 INTEGER :: J6 INTEGER :: KGUESS @@ -61,7 +61,7 @@ SUBROUTINE GUESS(KGUESS) & IC(NPT+NPPSI1), IS0(NPT+NPPSI1), IS0I(NPPSI1), IT0(NPT+NPPSI1), & & ZBND(NPT), ZPCEL(NPT,16), ZF(NPT,16), & & ZS(NPT), ZT(NPT), ZSIGMA(NPT), & - & ZT1(NPT), ZT2(NPT), ZS1(NPT), ZS2(NPT), ZWORK(NPISOEFF) + & ZT1(NPT), ZT2(NPT), ZS1(NPT), ZS2(NPT), ZWORK(NPISOEFF+1) ! !---*----*----*----*----*----*----*----*----*----*----*----*----*----* ! @@ -212,7 +212,7 @@ SUBROUTINE GUESS(KGUESS) ! SPSIM = CPSICL(1) ! - IF (NSTTP .GE. 2) THEN + IF (NSTTP .GE. 1) THEN ! CALL RESETI(IC,NISO,1) DO JS = 1,NISOO @@ -360,7 +360,7 @@ SUBROUTINE GUESS(KGUESS) END DO END DO ! - IF (NSTTP .GE. 2) THEN + IF (NSTTP .GE. 1) THEN ! CALL VZERO(CID0,NPISOEFF) CALL VZERO(CIDQ,NPISOEFF) @@ -389,26 +389,23 @@ SUBROUTINE GUESS(KGUESS) END DO ! ! COMPUTE RHO_TOR MESH IF NEEDED TO GET PROFILES - IF (NRHOMESH .GE. 0) THEN - ! COMPUTE RHOTOR ON CSIPRI MESH, ASSUME T=1 CST - CIDRTOR(1)=0._RKIND - DO J1=2,NISO - CIDRTOR(J1) = CIDRTOR(J1-1) + CIDQ(J1-1)*SPSIM*(CSIPRI(J1-1)**2-CSIPRI(J1)**2) - END DO - CIDRTOR(1:NISO) = sqrt(CIDRTOR(1:NISO)/CIDRTOR(NISO)) -!!$ PRINT *,'CSIPRI, CIDRTOR, NISO= ',NISO -!!$ WRITE(*,'1P2E15.5') (CSIPRI(J1), CIDRTOR(J1), J1=1,NISO) - CALL SPLINE(NISO,CSIPRI,CIDRTOR,D2CIDRTOR,ZWORK) + IF (NRHOMESH .GT. 0) THEN ! Formally NRHOMESH=1 is for rhotor, so should be .EQ. 1, but other cases not yet defined + ! COMPUTE RHOTOR ON CSIPRI MESH, ASSUME T=1 CST + ZWORK(2:NISO+1) = CIDQ(1:NISO) + ZWORK(1) = FCCCC0(ZWORK(2),ZWORK(3),ZWORK(4),ZWORK(5), & + & SMISOP1(2),SMISOP1(3),SMISOP1(4),SMISOP1(5),SMISOP1(1)) + ! COMPUTE RHOTOR ON CSIPRI MESH TO GET FULL RANGE (nt same as CSIPR) + TENS_DEF = -0.1_RKIND + CALL INTERPOS(SMISOP1(1:NISO+1)**2,ZWORK(1:NISO+1),nin=NISO+1,nout=NISO,TENSION=TENS_DEF,XOUT=CSIPRI(1:NISO)**2,YOUTINT=CIDRTOR(1:NISO), & + & nbc=(/0, 2/), ybc=(/ 0._rkind, ZWORK(NISO+1) /) ) + CIDRTOR(1:NISO) = sqrt(CIDRTOR(1:NISO)/CIDRTOR(NISO)) + CIDRTOR(1)=0._RKIND + CIDRTOR(NISO)=1._RKIND + CALL SPLINE(NISO,CSIPRI,CIDRTOR,D2CIDRTOR,ZWORK) ENDIF ! ! ISTAR_TARGET based on guess psi, CIDQ, etc !*******************Compute Istar for the case NSTTP = 5 ************************** - IF (NSTTP .EQ. 5) THEN -!!$ DO i=1,NISO -!!$ istar_target(i) = 2.5*(1-CSIPR(i)*CSIPR(i)*CSIPR(i)*CSIPR(i)) -!!$ END DO - QSPEC = RFUN(1) - END IF ! IF ((NSTTP .EQ. 3) .OR. (NSTTP .EQ. 4)) THEN ! diff --git a/src-f90/ids_routines.f90 b/src-f90/ids_routines.f90 index d827dbb22628052921a7e1439925ea4f1cfe0a90..478c5e36fb15bd17de986f1b287a1dff02aeaeb9 120000 --- a/src-f90/ids_routines.f90 +++ b/src-f90/ids_routines.f90 @@ -1 +1 @@ -ids_routines_vDD3_5.3PUAL3.3.8.f90 \ No newline at end of file +ids_routines_v3.39.0-4.11.6-2020b.f90 \ No newline at end of file diff --git a/src-f90/ids_routines_v3.38.1-4.11.4-2020b.f90 b/src-f90/ids_routines_v3.38.1-4.11.4-2020b.f90 new file mode 100644 index 0000000000000000000000000000000000000000..0e50d58097c70f5248d1ef6232af15201a1d2df9 --- /dev/null +++ b/src-f90/ids_routines_v3.38.1-4.11.4-2020b.f90 @@ -0,0 +1,1218 @@ + +module ids_routines +use ids_schemas +use ual_low_level_wrap +use utilities_copy_struct +use utilities_deallocate_struct + + + +use amns_data_put_struct +use amns_data_put_slice_struct +use amns_data_get_struct +use amns_data_get_slice_struct +use amns_data_delete +use amns_data_copy_struct +use amns_data_deallocate_struct + +use barometry_put_struct +use barometry_put_slice_struct +use barometry_get_struct +use barometry_get_slice_struct +use barometry_delete +use barometry_copy_struct +use barometry_deallocate_struct + +use bolometer_put_struct +use bolometer_put_slice_struct +use bolometer_get_struct +use bolometer_get_slice_struct +use bolometer_delete +use bolometer_copy_struct +use bolometer_deallocate_struct + +use bremsstrahlung_visible_put_struct +use bremsstrahlung_visible_put_slice_struct +use bremsstrahlung_visible_get_struct +use bremsstrahlung_visible_get_slice_struct +use bremsstrahlung_visible_delete +use bremsstrahlung_visible_copy_struct +use bremsstrahlung_visible_deallocate_struct + +use calorimetry_put_struct +use calorimetry_put_slice_struct +use calorimetry_get_struct +use calorimetry_get_slice_struct +use calorimetry_delete +use calorimetry_copy_struct +use calorimetry_deallocate_struct + +use camera_ir_put_struct +use camera_ir_put_slice_struct +use camera_ir_get_struct +use camera_ir_get_slice_struct +use camera_ir_delete +use camera_ir_copy_struct +use camera_ir_deallocate_struct + +use camera_visible_put_struct +use camera_visible_put_slice_struct +use camera_visible_get_struct +use camera_visible_get_slice_struct +use camera_visible_delete +use camera_visible_copy_struct +use camera_visible_deallocate_struct + +use camera_x_rays_put_struct +use camera_x_rays_put_slice_struct +use camera_x_rays_get_struct +use camera_x_rays_get_slice_struct +use camera_x_rays_delete +use camera_x_rays_copy_struct +use camera_x_rays_deallocate_struct + +use charge_exchange_put_struct +use charge_exchange_put_slice_struct +use charge_exchange_get_struct +use charge_exchange_get_slice_struct +use charge_exchange_delete +use charge_exchange_copy_struct +use charge_exchange_deallocate_struct + +use coils_non_axisymmetric_put_struct +use coils_non_axisymmetric_put_slice_struct +use coils_non_axisymmetric_get_struct +use coils_non_axisymmetric_get_slice_struct +use coils_non_axisymmetric_delete +use coils_non_axisymmetric_copy_struct +use coils_non_axisymmetric_deallocate_struct + +use controllers_put_struct +use controllers_put_slice_struct +use controllers_get_struct +use controllers_get_slice_struct +use controllers_delete +use controllers_copy_struct +use controllers_deallocate_struct + +use core_instant_changes_put_struct +use core_instant_changes_put_slice_struct +use core_instant_changes_get_struct +use core_instant_changes_get_slice_struct +use core_instant_changes_delete +use core_instant_changes_copy_struct +use core_instant_changes_deallocate_struct + +use core_profiles_put_struct +use core_profiles_put_slice_struct +use core_profiles_get_struct +use core_profiles_get_slice_struct +use core_profiles_delete +use core_profiles_copy_struct +use core_profiles_deallocate_struct + +use core_sources_put_struct +use core_sources_put_slice_struct +use core_sources_get_struct +use core_sources_get_slice_struct +use core_sources_delete +use core_sources_copy_struct +use core_sources_deallocate_struct + +use core_transport_put_struct +use core_transport_put_slice_struct +use core_transport_get_struct +use core_transport_get_slice_struct +use core_transport_delete +use core_transport_copy_struct +use core_transport_deallocate_struct + +use cryostat_put_struct +use cryostat_put_slice_struct +use cryostat_get_struct +use cryostat_get_slice_struct +use cryostat_delete +use cryostat_copy_struct +use cryostat_deallocate_struct + +use dataset_description_put_struct +use dataset_description_put_slice_struct +use dataset_description_get_struct +use dataset_description_get_slice_struct +use dataset_description_delete +use dataset_description_copy_struct +use dataset_description_deallocate_struct + +use dataset_fair_put_struct +use dataset_fair_put_slice_struct +use dataset_fair_get_struct +use dataset_fair_get_slice_struct +use dataset_fair_delete +use dataset_fair_copy_struct +use dataset_fair_deallocate_struct + +use disruption_put_struct +use disruption_put_slice_struct +use disruption_get_struct +use disruption_get_slice_struct +use disruption_delete +use disruption_copy_struct +use disruption_deallocate_struct + +use distribution_sources_put_struct +use distribution_sources_put_slice_struct +use distribution_sources_get_struct +use distribution_sources_get_slice_struct +use distribution_sources_delete +use distribution_sources_copy_struct +use distribution_sources_deallocate_struct + +use distributions_put_struct +use distributions_put_slice_struct +use distributions_get_struct +use distributions_get_slice_struct +use distributions_delete +use distributions_copy_struct +use distributions_deallocate_struct + +use divertors_put_struct +use divertors_put_slice_struct +use divertors_get_struct +use divertors_get_slice_struct +use divertors_delete +use divertors_copy_struct +use divertors_deallocate_struct + +use ec_launchers_put_struct +use ec_launchers_put_slice_struct +use ec_launchers_get_struct +use ec_launchers_get_slice_struct +use ec_launchers_delete +use ec_launchers_copy_struct +use ec_launchers_deallocate_struct + +use ece_put_struct +use ece_put_slice_struct +use ece_get_struct +use ece_get_slice_struct +use ece_delete +use ece_copy_struct +use ece_deallocate_struct + +use edge_profiles_put_struct +use edge_profiles_put_slice_struct +use edge_profiles_get_struct +use edge_profiles_get_slice_struct +use edge_profiles_delete +use edge_profiles_copy_struct +use edge_profiles_deallocate_struct + +use edge_sources_put_struct +use edge_sources_put_slice_struct +use edge_sources_get_struct +use edge_sources_get_slice_struct +use edge_sources_delete +use edge_sources_copy_struct +use edge_sources_deallocate_struct + +use edge_transport_put_struct +use edge_transport_put_slice_struct +use edge_transport_get_struct +use edge_transport_get_slice_struct +use edge_transport_delete +use edge_transport_copy_struct +use edge_transport_deallocate_struct + +use em_coupling_put_struct +use em_coupling_put_slice_struct +use em_coupling_get_struct +use em_coupling_get_slice_struct +use em_coupling_delete +use em_coupling_copy_struct +use em_coupling_deallocate_struct + +use equilibrium_put_struct +use equilibrium_put_slice_struct +use equilibrium_get_struct +use equilibrium_get_slice_struct +use equilibrium_delete +use equilibrium_copy_struct +use equilibrium_deallocate_struct + +use gas_injection_put_struct +use gas_injection_put_slice_struct +use gas_injection_get_struct +use gas_injection_get_slice_struct +use gas_injection_delete +use gas_injection_copy_struct +use gas_injection_deallocate_struct + +use gas_pumping_put_struct +use gas_pumping_put_slice_struct +use gas_pumping_get_struct +use gas_pumping_get_slice_struct +use gas_pumping_delete +use gas_pumping_copy_struct +use gas_pumping_deallocate_struct + +use gyrokinetics_put_struct +use gyrokinetics_put_slice_struct +use gyrokinetics_get_struct +use gyrokinetics_get_slice_struct +use gyrokinetics_delete +use gyrokinetics_copy_struct +use gyrokinetics_deallocate_struct + +use hard_x_rays_put_struct +use hard_x_rays_put_slice_struct +use hard_x_rays_get_struct +use hard_x_rays_get_slice_struct +use hard_x_rays_delete +use hard_x_rays_copy_struct +use hard_x_rays_deallocate_struct + +use ic_antennas_put_struct +use ic_antennas_put_slice_struct +use ic_antennas_get_struct +use ic_antennas_get_slice_struct +use ic_antennas_delete +use ic_antennas_copy_struct +use ic_antennas_deallocate_struct + +use interferometer_put_struct +use interferometer_put_slice_struct +use interferometer_get_struct +use interferometer_get_slice_struct +use interferometer_delete +use interferometer_copy_struct +use interferometer_deallocate_struct + +use iron_core_put_struct +use iron_core_put_slice_struct +use iron_core_get_struct +use iron_core_get_slice_struct +use iron_core_delete +use iron_core_copy_struct +use iron_core_deallocate_struct + +use langmuir_probes_put_struct +use langmuir_probes_put_slice_struct +use langmuir_probes_get_struct +use langmuir_probes_get_slice_struct +use langmuir_probes_delete +use langmuir_probes_copy_struct +use langmuir_probes_deallocate_struct + +use lh_antennas_put_struct +use lh_antennas_put_slice_struct +use lh_antennas_get_struct +use lh_antennas_get_slice_struct +use lh_antennas_delete +use lh_antennas_copy_struct +use lh_antennas_deallocate_struct + +use magnetics_put_struct +use magnetics_put_slice_struct +use magnetics_get_struct +use magnetics_get_slice_struct +use magnetics_delete +use magnetics_copy_struct +use magnetics_deallocate_struct + +use mhd_put_struct +use mhd_put_slice_struct +use mhd_get_struct +use mhd_get_slice_struct +use mhd_delete +use mhd_copy_struct +use mhd_deallocate_struct + +use mhd_linear_put_struct +use mhd_linear_put_slice_struct +use mhd_linear_get_struct +use mhd_linear_get_slice_struct +use mhd_linear_delete +use mhd_linear_copy_struct +use mhd_linear_deallocate_struct + +use mse_put_struct +use mse_put_slice_struct +use mse_get_struct +use mse_get_slice_struct +use mse_delete +use mse_copy_struct +use mse_deallocate_struct + +use nbi_put_struct +use nbi_put_slice_struct +use nbi_get_struct +use nbi_get_slice_struct +use nbi_delete +use nbi_copy_struct +use nbi_deallocate_struct + +use neutron_diagnostic_put_struct +use neutron_diagnostic_put_slice_struct +use neutron_diagnostic_get_struct +use neutron_diagnostic_get_slice_struct +use neutron_diagnostic_delete +use neutron_diagnostic_copy_struct +use neutron_diagnostic_deallocate_struct + +use ntms_put_struct +use ntms_put_slice_struct +use ntms_get_struct +use ntms_get_slice_struct +use ntms_delete +use ntms_copy_struct +use ntms_deallocate_struct + +use pellets_put_struct +use pellets_put_slice_struct +use pellets_get_struct +use pellets_get_slice_struct +use pellets_delete +use pellets_copy_struct +use pellets_deallocate_struct + +use pf_active_put_struct +use pf_active_put_slice_struct +use pf_active_get_struct +use pf_active_get_slice_struct +use pf_active_delete +use pf_active_copy_struct +use pf_active_deallocate_struct + +use pf_passive_put_struct +use pf_passive_put_slice_struct +use pf_passive_get_struct +use pf_passive_get_slice_struct +use pf_passive_delete +use pf_passive_copy_struct +use pf_passive_deallocate_struct + +use plasma_initiation_put_struct +use plasma_initiation_put_slice_struct +use plasma_initiation_get_struct +use plasma_initiation_get_slice_struct +use plasma_initiation_delete +use plasma_initiation_copy_struct +use plasma_initiation_deallocate_struct + +use polarimeter_put_struct +use polarimeter_put_slice_struct +use polarimeter_get_struct +use polarimeter_get_slice_struct +use polarimeter_delete +use polarimeter_copy_struct +use polarimeter_deallocate_struct + +use pulse_schedule_put_struct +use pulse_schedule_put_slice_struct +use pulse_schedule_get_struct +use pulse_schedule_get_slice_struct +use pulse_schedule_delete +use pulse_schedule_copy_struct +use pulse_schedule_deallocate_struct + +use radiation_put_struct +use radiation_put_slice_struct +use radiation_get_struct +use radiation_get_slice_struct +use radiation_delete +use radiation_copy_struct +use radiation_deallocate_struct + +use real_time_data_put_struct +use real_time_data_put_slice_struct +use real_time_data_get_struct +use real_time_data_get_slice_struct +use real_time_data_delete +use real_time_data_copy_struct +use real_time_data_deallocate_struct + +use reflectometer_profile_put_struct +use reflectometer_profile_put_slice_struct +use reflectometer_profile_get_struct +use reflectometer_profile_get_slice_struct +use reflectometer_profile_delete +use reflectometer_profile_copy_struct +use reflectometer_profile_deallocate_struct + +use refractometer_put_struct +use refractometer_put_slice_struct +use refractometer_get_struct +use refractometer_get_slice_struct +use refractometer_delete +use refractometer_copy_struct +use refractometer_deallocate_struct + +use sawteeth_put_struct +use sawteeth_put_slice_struct +use sawteeth_get_struct +use sawteeth_get_slice_struct +use sawteeth_delete +use sawteeth_copy_struct +use sawteeth_deallocate_struct + +use soft_x_rays_put_struct +use soft_x_rays_put_slice_struct +use soft_x_rays_get_struct +use soft_x_rays_get_slice_struct +use soft_x_rays_delete +use soft_x_rays_copy_struct +use soft_x_rays_deallocate_struct + +use spectrometer_mass_put_struct +use spectrometer_mass_put_slice_struct +use spectrometer_mass_get_struct +use spectrometer_mass_get_slice_struct +use spectrometer_mass_delete +use spectrometer_mass_copy_struct +use spectrometer_mass_deallocate_struct + +use spectrometer_uv_put_struct +use spectrometer_uv_put_slice_struct +use spectrometer_uv_get_struct +use spectrometer_uv_get_slice_struct +use spectrometer_uv_delete +use spectrometer_uv_copy_struct +use spectrometer_uv_deallocate_struct + +use spectrometer_visible_put_struct +use spectrometer_visible_put_slice_struct +use spectrometer_visible_get_struct +use spectrometer_visible_get_slice_struct +use spectrometer_visible_delete +use spectrometer_visible_copy_struct +use spectrometer_visible_deallocate_struct + +use spectrometer_x_ray_crystal_put_struct +use spectrometer_x_ray_crystal_put_slice_struct +use spectrometer_x_ray_crystal_get_struct +use spectrometer_x_ray_crystal_get_slice_struct +use spectrometer_x_ray_crystal_delete +use spectrometer_x_ray_crystal_copy_struct +use spectrometer_x_ray_crystal_deallocate_struct + +use summary_put_struct +use summary_put_slice_struct +use summary_get_struct +use summary_get_slice_struct +use summary_delete +use summary_copy_struct +use summary_deallocate_struct + +use temporary_put_struct +use temporary_put_slice_struct +use temporary_get_struct +use temporary_get_slice_struct +use temporary_delete +use temporary_copy_struct +use temporary_deallocate_struct + +use thomson_scattering_put_struct +use thomson_scattering_put_slice_struct +use thomson_scattering_get_struct +use thomson_scattering_get_slice_struct +use thomson_scattering_delete +use thomson_scattering_copy_struct +use thomson_scattering_deallocate_struct + +use tf_put_struct +use tf_put_slice_struct +use tf_get_struct +use tf_get_slice_struct +use tf_delete +use tf_copy_struct +use tf_deallocate_struct + +use transport_solver_numerics_put_struct +use transport_solver_numerics_put_slice_struct +use transport_solver_numerics_get_struct +use transport_solver_numerics_get_slice_struct +use transport_solver_numerics_delete +use transport_solver_numerics_copy_struct +use transport_solver_numerics_deallocate_struct + +use turbulence_put_struct +use turbulence_put_slice_struct +use turbulence_get_struct +use turbulence_get_slice_struct +use turbulence_delete +use turbulence_copy_struct +use turbulence_deallocate_struct + +use wall_put_struct +use wall_put_slice_struct +use wall_get_struct +use wall_get_slice_struct +use wall_delete +use wall_copy_struct +use wall_deallocate_struct + +use waves_put_struct +use waves_put_slice_struct +use waves_get_struct +use waves_get_slice_struct +use waves_delete +use waves_copy_struct +use waves_deallocate_struct + +use workflow_put_struct +use workflow_put_slice_struct +use workflow_get_struct +use workflow_get_slice_struct +use workflow_delete +use workflow_copy_struct +use workflow_deallocate_struct + + +#if defined(__INTEL_COMPILER) +use ifport, only : getpid ! required for getpid() in ifort +#endif +#if defined(NAGFOR) +use f90_unix, only : getpid ! required for getpid() in nagfor +#endif + +contains + +subroutine ids_get_times(pulseCtx,path,time) +use ual_low_level_wrap +use ids_types +implicit none + +integer(ids_int) :: pulsectx, opctx, status +character*(*) :: path +real(ids_real), pointer :: time(:) +integer(ids_int) :: dim1 + +call ual_begin_global_action(pulsectx, path, READ_OP, opctx, status) +if (status.ne.0) then + STOP 'Error in ual_begin_global_action from ids_get_times' +end if + +call get_vect1d_double(opctx, "time", "time", time, dim1, status) + +call ual_end_action(opctx, status) + +end subroutine + +! Turn an IDS into a bunch of bytes +subroutine ids_serialize(ids_in, buffer, protocol) + class(IDS_base) :: ids_in ! no intent(in) because ids_put also does not have that + integer(ids_int), intent(in), optional :: protocol + character(len=1), dimension(:), allocatable :: buffer + + character(len=:), allocatable :: fname + integer(ids_int) :: my_protocol + integer(ids_int) :: pulsectx + integer(ids_int) :: status + integer(ids_int) :: unit + integer(ids_int) :: file_size + + my_protocol = DEFAULT_SERIALIZER_PROTOCOL + if (present(protocol)) my_protocol = protocol + + if (my_protocol .eq. ASCII_SERIALIZER_PROTOCOL) then + fname = generate_tmp_file() + if (len_trim(fname) .eq. 0) then + write(*,*) 'SERIALIZE: ERROR generating temporary file name' + return + end if + + ! Write to file + call ual_begin_pulse_action(ASCII_BACKEND, 0, 0, 'serialize', 'serialize', '3', pulsectx) + call ual_open_pulse(pulsectx, FORCE_CREATE_PULSE, '-fullpath ' // fname, status) + if (status .ne. 0) then + write(*,*) "SERIALIZE: ERROR opening ASCII backend - ual_open_pulse" + buffer = '' + return + end if + + ! I think if we implement an object-oriented ids_in->put the select type here becomes unnecessary + select type (ids_in) + + class is (ids_amns_data) + call ids_put(pulsectx, 'amns_data', ids_in) + + class is (ids_barometry) + call ids_put(pulsectx, 'barometry', ids_in) + + class is (ids_bolometer) + call ids_put(pulsectx, 'bolometer', ids_in) + + class is (ids_bremsstrahlung_visible) + call ids_put(pulsectx, 'bremsstrahlung_visible', ids_in) + + class is (ids_calorimetry) + call ids_put(pulsectx, 'calorimetry', ids_in) + + class is (ids_camera_ir) + call ids_put(pulsectx, 'camera_ir', ids_in) + + class is (ids_camera_visible) + call ids_put(pulsectx, 'camera_visible', ids_in) + + class is (ids_camera_x_rays) + call ids_put(pulsectx, 'camera_x_rays', ids_in) + + class is (ids_charge_exchange) + call ids_put(pulsectx, 'charge_exchange', ids_in) + + class is (ids_coils_non_axisymmetric) + call ids_put(pulsectx, 'coils_non_axisymmetric', ids_in) + + class is (ids_controllers) + call ids_put(pulsectx, 'controllers', ids_in) + + class is (ids_core_instant_changes) + call ids_put(pulsectx, 'core_instant_changes', ids_in) + + class is (ids_core_profiles) + call ids_put(pulsectx, 'core_profiles', ids_in) + + class is (ids_core_sources) + call ids_put(pulsectx, 'core_sources', ids_in) + + class is (ids_core_transport) + call ids_put(pulsectx, 'core_transport', ids_in) + + class is (ids_cryostat) + call ids_put(pulsectx, 'cryostat', ids_in) + + class is (ids_dataset_description) + call ids_put(pulsectx, 'dataset_description', ids_in) + + class is (ids_dataset_fair) + call ids_put(pulsectx, 'dataset_fair', ids_in) + + class is (ids_disruption) + call ids_put(pulsectx, 'disruption', ids_in) + + class is (ids_distribution_sources) + call ids_put(pulsectx, 'distribution_sources', ids_in) + + class is (ids_distributions) + call ids_put(pulsectx, 'distributions', ids_in) + + class is (ids_divertors) + call ids_put(pulsectx, 'divertors', ids_in) + + class is (ids_ec_launchers) + call ids_put(pulsectx, 'ec_launchers', ids_in) + + class is (ids_ece) + call ids_put(pulsectx, 'ece', ids_in) + + class is (ids_edge_profiles) + call ids_put(pulsectx, 'edge_profiles', ids_in) + + class is (ids_edge_sources) + call ids_put(pulsectx, 'edge_sources', ids_in) + + class is (ids_edge_transport) + call ids_put(pulsectx, 'edge_transport', ids_in) + + class is (ids_em_coupling) + call ids_put(pulsectx, 'em_coupling', ids_in) + + class is (ids_equilibrium) + call ids_put(pulsectx, 'equilibrium', ids_in) + + class is (ids_gas_injection) + call ids_put(pulsectx, 'gas_injection', ids_in) + + class is (ids_gas_pumping) + call ids_put(pulsectx, 'gas_pumping', ids_in) + + class is (ids_gyrokinetics) + call ids_put(pulsectx, 'gyrokinetics', ids_in) + + class is (ids_hard_x_rays) + call ids_put(pulsectx, 'hard_x_rays', ids_in) + + class is (ids_ic_antennas) + call ids_put(pulsectx, 'ic_antennas', ids_in) + + class is (ids_interferometer) + call ids_put(pulsectx, 'interferometer', ids_in) + + class is (ids_iron_core) + call ids_put(pulsectx, 'iron_core', ids_in) + + class is (ids_langmuir_probes) + call ids_put(pulsectx, 'langmuir_probes', ids_in) + + class is (ids_lh_antennas) + call ids_put(pulsectx, 'lh_antennas', ids_in) + + class is (ids_magnetics) + call ids_put(pulsectx, 'magnetics', ids_in) + + class is (ids_mhd) + call ids_put(pulsectx, 'mhd', ids_in) + + class is (ids_mhd_linear) + call ids_put(pulsectx, 'mhd_linear', ids_in) + + class is (ids_mse) + call ids_put(pulsectx, 'mse', ids_in) + + class is (ids_nbi) + call ids_put(pulsectx, 'nbi', ids_in) + + class is (ids_neutron_diagnostic) + call ids_put(pulsectx, 'neutron_diagnostic', ids_in) + + class is (ids_ntms) + call ids_put(pulsectx, 'ntms', ids_in) + + class is (ids_pellets) + call ids_put(pulsectx, 'pellets', ids_in) + + class is (ids_pf_active) + call ids_put(pulsectx, 'pf_active', ids_in) + + class is (ids_pf_passive) + call ids_put(pulsectx, 'pf_passive', ids_in) + + class is (ids_plasma_initiation) + call ids_put(pulsectx, 'plasma_initiation', ids_in) + + class is (ids_polarimeter) + call ids_put(pulsectx, 'polarimeter', ids_in) + + class is (ids_pulse_schedule) + call ids_put(pulsectx, 'pulse_schedule', ids_in) + + class is (ids_radiation) + call ids_put(pulsectx, 'radiation', ids_in) + + class is (ids_real_time_data) + call ids_put(pulsectx, 'real_time_data', ids_in) + + class is (ids_reflectometer_profile) + call ids_put(pulsectx, 'reflectometer_profile', ids_in) + + class is (ids_refractometer) + call ids_put(pulsectx, 'refractometer', ids_in) + + class is (ids_sawteeth) + call ids_put(pulsectx, 'sawteeth', ids_in) + + class is (ids_soft_x_rays) + call ids_put(pulsectx, 'soft_x_rays', ids_in) + + class is (ids_spectrometer_mass) + call ids_put(pulsectx, 'spectrometer_mass', ids_in) + + class is (ids_spectrometer_uv) + call ids_put(pulsectx, 'spectrometer_uv', ids_in) + + class is (ids_spectrometer_visible) + call ids_put(pulsectx, 'spectrometer_visible', ids_in) + + class is (ids_spectrometer_x_ray_crystal) + call ids_put(pulsectx, 'spectrometer_x_ray_crystal', ids_in) + + class is (ids_summary) + call ids_put(pulsectx, 'summary', ids_in) + + class is (ids_temporary) + call ids_put(pulsectx, 'temporary', ids_in) + + class is (ids_thomson_scattering) + call ids_put(pulsectx, 'thomson_scattering', ids_in) + + class is (ids_tf) + call ids_put(pulsectx, 'tf', ids_in) + + class is (ids_transport_solver_numerics) + call ids_put(pulsectx, 'transport_solver_numerics', ids_in) + + class is (ids_turbulence) + call ids_put(pulsectx, 'turbulence', ids_in) + + class is (ids_wall) + call ids_put(pulsectx, 'wall', ids_in) + + class is (ids_waves) + call ids_put(pulsectx, 'waves', ids_in) + + class is (ids_workflow) + call ids_put(pulsectx, 'workflow', ids_in) + + class default + write(*,*) "SERIALIZE: ERROR selecting IDS type" + end select + + + call ual_close_pulse(pulsectx, FORCE_CREATE_PULSE, '', status) + if (status .ne. 0) then + write(*,*) "SERIALIZE: ERROR closing ASCII backend - ual_close_pulse" + buffer = '' + call ual_end_action(pulsectx, status) + return + end if + call ual_end_action(pulsectx, status) + if (status .ne. 0) then + write(*,*) "SERIALIZE: ERROR closing ASCII backend - ual_end_action" + buffer = '' + return + end if + + + ! Read from file + unit = get_file_unit() + open(unit=unit, file=fname, action='read', status='old', form='unformatted', access='stream') + inquire(unit=unit, size=file_size) + allocate(character(1) :: buffer(file_size + 1)) + buffer(1) = char(ASCII_SERIALIZER_PROTOCOL) + read(unit) buffer(2:) + close(unit, status='delete') + else + write(*,*) 'SERIALIZE: ERROR, unrecognized serialization protocol' + end if +end subroutine ids_serialize + +! Turn a bunch of bytes into an IDS +subroutine ids_deserialize(buffer, ids_out) + class(IDS_base) :: ids_out ! it is up to you to pass the correct buffer and ids type + character(len=1), dimension(:), allocatable, intent(in) :: buffer + + integer(ids_int) :: protocol + character(len=:), allocatable :: fname + integer(ids_int) :: pulsectx + integer(ids_int) :: status + integer(ids_int) :: unit + integer(ids_int) :: file_size + + protocol = ichar(buffer(1)) + + if (protocol .eq. ASCII_SERIALIZER_PROTOCOL) then + fname = generate_tmp_file() + if (len_trim(fname) .eq. 0) then + write(*,*) 'SERIALIZE: ERROR generating temporary file name' + return + end if + + ! Write to file + unit = get_file_unit() + open(unit=unit, file=fname, action='write', status='new', form='unformatted', access='stream') + write(unit) buffer(2:) + ! keep the file open, so we can delete it later in one go + flush(unit) + + + call ual_begin_pulse_action(ASCII_BACKEND, 0, 0, 'serialize', 'serialize', '3', pulsectx) + call ual_open_pulse(pulsectx, FORCE_OPEN_PULSE, '-fullpath ' // fname, status) + if (status .ne. 0) then + write(*,*) "SERIALIZE: ERROR opening ASCII backend - ual_open_pulse" + return + end if + + ! I think if we implement an object-oriented ids_in->put the select type here becomes unnecessary + select type (ids_out) + + class is (ids_amns_data) + call ids_get(pulsectx, 'amns_data', ids_out) + + class is (ids_barometry) + call ids_get(pulsectx, 'barometry', ids_out) + + class is (ids_bolometer) + call ids_get(pulsectx, 'bolometer', ids_out) + + class is (ids_bremsstrahlung_visible) + call ids_get(pulsectx, 'bremsstrahlung_visible', ids_out) + + class is (ids_calorimetry) + call ids_get(pulsectx, 'calorimetry', ids_out) + + class is (ids_camera_ir) + call ids_get(pulsectx, 'camera_ir', ids_out) + + class is (ids_camera_visible) + call ids_get(pulsectx, 'camera_visible', ids_out) + + class is (ids_camera_x_rays) + call ids_get(pulsectx, 'camera_x_rays', ids_out) + + class is (ids_charge_exchange) + call ids_get(pulsectx, 'charge_exchange', ids_out) + + class is (ids_coils_non_axisymmetric) + call ids_get(pulsectx, 'coils_non_axisymmetric', ids_out) + + class is (ids_controllers) + call ids_get(pulsectx, 'controllers', ids_out) + + class is (ids_core_instant_changes) + call ids_get(pulsectx, 'core_instant_changes', ids_out) + + class is (ids_core_profiles) + call ids_get(pulsectx, 'core_profiles', ids_out) + + class is (ids_core_sources) + call ids_get(pulsectx, 'core_sources', ids_out) + + class is (ids_core_transport) + call ids_get(pulsectx, 'core_transport', ids_out) + + class is (ids_cryostat) + call ids_get(pulsectx, 'cryostat', ids_out) + + class is (ids_dataset_description) + call ids_get(pulsectx, 'dataset_description', ids_out) + + class is (ids_dataset_fair) + call ids_get(pulsectx, 'dataset_fair', ids_out) + + class is (ids_disruption) + call ids_get(pulsectx, 'disruption', ids_out) + + class is (ids_distribution_sources) + call ids_get(pulsectx, 'distribution_sources', ids_out) + + class is (ids_distributions) + call ids_get(pulsectx, 'distributions', ids_out) + + class is (ids_divertors) + call ids_get(pulsectx, 'divertors', ids_out) + + class is (ids_ec_launchers) + call ids_get(pulsectx, 'ec_launchers', ids_out) + + class is (ids_ece) + call ids_get(pulsectx, 'ece', ids_out) + + class is (ids_edge_profiles) + call ids_get(pulsectx, 'edge_profiles', ids_out) + + class is (ids_edge_sources) + call ids_get(pulsectx, 'edge_sources', ids_out) + + class is (ids_edge_transport) + call ids_get(pulsectx, 'edge_transport', ids_out) + + class is (ids_em_coupling) + call ids_get(pulsectx, 'em_coupling', ids_out) + + class is (ids_equilibrium) + call ids_get(pulsectx, 'equilibrium', ids_out) + + class is (ids_gas_injection) + call ids_get(pulsectx, 'gas_injection', ids_out) + + class is (ids_gas_pumping) + call ids_get(pulsectx, 'gas_pumping', ids_out) + + class is (ids_gyrokinetics) + call ids_get(pulsectx, 'gyrokinetics', ids_out) + + class is (ids_hard_x_rays) + call ids_get(pulsectx, 'hard_x_rays', ids_out) + + class is (ids_ic_antennas) + call ids_get(pulsectx, 'ic_antennas', ids_out) + + class is (ids_interferometer) + call ids_get(pulsectx, 'interferometer', ids_out) + + class is (ids_iron_core) + call ids_get(pulsectx, 'iron_core', ids_out) + + class is (ids_langmuir_probes) + call ids_get(pulsectx, 'langmuir_probes', ids_out) + + class is (ids_lh_antennas) + call ids_get(pulsectx, 'lh_antennas', ids_out) + + class is (ids_magnetics) + call ids_get(pulsectx, 'magnetics', ids_out) + + class is (ids_mhd) + call ids_get(pulsectx, 'mhd', ids_out) + + class is (ids_mhd_linear) + call ids_get(pulsectx, 'mhd_linear', ids_out) + + class is (ids_mse) + call ids_get(pulsectx, 'mse', ids_out) + + class is (ids_nbi) + call ids_get(pulsectx, 'nbi', ids_out) + + class is (ids_neutron_diagnostic) + call ids_get(pulsectx, 'neutron_diagnostic', ids_out) + + class is (ids_ntms) + call ids_get(pulsectx, 'ntms', ids_out) + + class is (ids_pellets) + call ids_get(pulsectx, 'pellets', ids_out) + + class is (ids_pf_active) + call ids_get(pulsectx, 'pf_active', ids_out) + + class is (ids_pf_passive) + call ids_get(pulsectx, 'pf_passive', ids_out) + + class is (ids_plasma_initiation) + call ids_get(pulsectx, 'plasma_initiation', ids_out) + + class is (ids_polarimeter) + call ids_get(pulsectx, 'polarimeter', ids_out) + + class is (ids_pulse_schedule) + call ids_get(pulsectx, 'pulse_schedule', ids_out) + + class is (ids_radiation) + call ids_get(pulsectx, 'radiation', ids_out) + + class is (ids_real_time_data) + call ids_get(pulsectx, 'real_time_data', ids_out) + + class is (ids_reflectometer_profile) + call ids_get(pulsectx, 'reflectometer_profile', ids_out) + + class is (ids_refractometer) + call ids_get(pulsectx, 'refractometer', ids_out) + + class is (ids_sawteeth) + call ids_get(pulsectx, 'sawteeth', ids_out) + + class is (ids_soft_x_rays) + call ids_get(pulsectx, 'soft_x_rays', ids_out) + + class is (ids_spectrometer_mass) + call ids_get(pulsectx, 'spectrometer_mass', ids_out) + + class is (ids_spectrometer_uv) + call ids_get(pulsectx, 'spectrometer_uv', ids_out) + + class is (ids_spectrometer_visible) + call ids_get(pulsectx, 'spectrometer_visible', ids_out) + + class is (ids_spectrometer_x_ray_crystal) + call ids_get(pulsectx, 'spectrometer_x_ray_crystal', ids_out) + + class is (ids_summary) + call ids_get(pulsectx, 'summary', ids_out) + + class is (ids_temporary) + call ids_get(pulsectx, 'temporary', ids_out) + + class is (ids_thomson_scattering) + call ids_get(pulsectx, 'thomson_scattering', ids_out) + + class is (ids_tf) + call ids_get(pulsectx, 'tf', ids_out) + + class is (ids_transport_solver_numerics) + call ids_get(pulsectx, 'transport_solver_numerics', ids_out) + + class is (ids_turbulence) + call ids_get(pulsectx, 'turbulence', ids_out) + + class is (ids_wall) + call ids_get(pulsectx, 'wall', ids_out) + + class is (ids_waves) + call ids_get(pulsectx, 'waves', ids_out) + + class is (ids_workflow) + call ids_get(pulsectx, 'workflow', ids_out) + + class default + write(*,*) "SERIALIZE: ERROR selecting IDS type" + end select + + + call ual_close_pulse(pulsectx, FORCE_OPEN_PULSE, '', status) + if (status .ne. 0) then + write(*,*) "SERIALIZE: ERROR closing ASCII backend - ual_close_pulse" + call ual_end_action(pulsectx, status) + return + end if + call ual_end_action(pulsectx, status) + if (status .ne. 0) then + write(*,*) "SERIALIZE: ERROR closing ASCII backend - ual_end_action" + return + end if + + ! delete file + close(unit, status='delete') + else + write(*,*) 'SERIALIZE: ERROR, unrecognized serialization protocol' + end if +end subroutine ids_deserialize + +function generate_tmp_file() result(fname) + character(len=:), allocatable :: fname + ! Follow same approach as the Python standard library in generating a random temporary file + character(len=*), parameter :: fs_safe_characters = 'abcdefghijklmnopqrstuvwxyz0123456789_' + integer, parameter :: n = 8 ! number of random characters in the file + integer, parameter :: MAX_TMP_FILES = 1000 + + ! On Windows and Mac OSX, use the current working directory as temporary directory (since /dev/shm does not exist). + ! On any recent Linux (2.6 or later according to Wikipedia [1]) the /dev/shm folder exists for shared memory. + ! Since glibc assumes this to exist anyway [2], we will as well. + ! [1] https://en.wikipedia.org/wiki/Shared_memory + ! [2] https://www.kernel.org/doc/Documentation/filesystems/tmpfs.txt +#if defined(_Linux) +# define SERIALIZE_TEMPORARY_DIRECTORY '/dev/shm/' +#else +# define SERIALIZE_TEMPORARY_DIRECTORY '' +#endif + + real, dimension(n) :: rd + integer :: string_base_length + integer :: i, j, k + integer :: unit ! Unit number to open file with + integer :: iostat + integer :: ipid + character(10) :: cpid + + ipid = getpid() + ! Convert to characters, using I0 to left-justify without leading 0s + write(cpid, '(I0)') ipid + + ! Setup the base of the filename + string_base_length = len(SERIALIZE_TEMPORARY_DIRECTORY) + len('al_serialize_') + len_trim(cpid) + 1 + fname = SERIALIZE_TEMPORARY_DIRECTORY // 'al_serialize_' // trim(cpid) // "_" // repeat(' ', n) ! implicitly allocates to the right size + + ! get a free unit number + unit = get_file_unit() + + do i=1,MAX_TMP_FILES + call random_number(rd) + do j=1,n + k = ceiling(rd(j)*len(fs_safe_characters)) + fname(string_base_length + j:string_base_length + j) = fs_safe_characters(k:k) + end do + + open(unit=unit, action='write', file=fname, status='new', iostat=iostat) + if (iostat .gt. 0) cycle + + ! if we get here the file was opened successfully. Delete it, and return the filename found + close(unit=unit, status='delete') + return ! implies fname + end do + fname = '' +end function generate_tmp_file + +function get_file_unit() result(unit) + ! Get a free file unit description number without using Fortran 2008 newunit feature. + integer :: unit, iostat + logical :: opened + + do unit = 97,1,-1 + inquire (unit=unit, opened=opened, iostat=iostat) + if (iostat .ne. 0) cycle + if (.not. opened) exit + end do +end function get_file_unit + +end module diff --git a/src-f90/ids_routines_v3.39.0-4.11.6-2020b.f90 b/src-f90/ids_routines_v3.39.0-4.11.6-2020b.f90 new file mode 100644 index 0000000000000000000000000000000000000000..17407364d89d17861246a357c1bd4994ad68e57c --- /dev/null +++ b/src-f90/ids_routines_v3.39.0-4.11.6-2020b.f90 @@ -0,0 +1,1370 @@ + +module ids_routines +use ids_schemas +use al_low_level_wrap +use utilities_copy_struct +use utilities_deallocate_struct + + + +use ids_schemas_amns_data +use amns_data_put_struct +use amns_data_put_slice_struct +use amns_data_get_struct +use amns_data_get_slice_struct +use amns_data_delete +use amns_data_copy_struct +use amns_data_deallocate_struct + +use ids_schemas_barometry +use barometry_put_struct +use barometry_put_slice_struct +use barometry_get_struct +use barometry_get_slice_struct +use barometry_delete +use barometry_copy_struct +use barometry_deallocate_struct + +use ids_schemas_b_field_non_axisymmetric +use b_field_non_axisymmetric_put_struct +use b_field_non_axisymmetric_put_slice_struct +use b_field_non_axisymmetric_get_struct +use b_field_non_axisymmetric_get_slice_struct +use b_field_non_axisymmetric_delete +use b_field_non_axisymmetric_copy_struct +use b_field_non_axisymmetric_deallocate_struct + +use ids_schemas_bolometer +use bolometer_put_struct +use bolometer_put_slice_struct +use bolometer_get_struct +use bolometer_get_slice_struct +use bolometer_delete +use bolometer_copy_struct +use bolometer_deallocate_struct + +use ids_schemas_bremsstrahlung_visible +use bremsstrahlung_visible_put_struct +use bremsstrahlung_visible_put_slice_struct +use bremsstrahlung_visible_get_struct +use bremsstrahlung_visible_get_slice_struct +use bremsstrahlung_visible_delete +use bremsstrahlung_visible_copy_struct +use bremsstrahlung_visible_deallocate_struct + +use ids_schemas_calorimetry +use calorimetry_put_struct +use calorimetry_put_slice_struct +use calorimetry_get_struct +use calorimetry_get_slice_struct +use calorimetry_delete +use calorimetry_copy_struct +use calorimetry_deallocate_struct + +use ids_schemas_camera_ir +use camera_ir_put_struct +use camera_ir_put_slice_struct +use camera_ir_get_struct +use camera_ir_get_slice_struct +use camera_ir_delete +use camera_ir_copy_struct +use camera_ir_deallocate_struct + +use ids_schemas_camera_visible +use camera_visible_put_struct +use camera_visible_put_slice_struct +use camera_visible_get_struct +use camera_visible_get_slice_struct +use camera_visible_delete +use camera_visible_copy_struct +use camera_visible_deallocate_struct + +use ids_schemas_camera_x_rays +use camera_x_rays_put_struct +use camera_x_rays_put_slice_struct +use camera_x_rays_get_struct +use camera_x_rays_get_slice_struct +use camera_x_rays_delete +use camera_x_rays_copy_struct +use camera_x_rays_deallocate_struct + +use ids_schemas_charge_exchange +use charge_exchange_put_struct +use charge_exchange_put_slice_struct +use charge_exchange_get_struct +use charge_exchange_get_slice_struct +use charge_exchange_delete +use charge_exchange_copy_struct +use charge_exchange_deallocate_struct + +use ids_schemas_coils_non_axisymmetric +use coils_non_axisymmetric_put_struct +use coils_non_axisymmetric_put_slice_struct +use coils_non_axisymmetric_get_struct +use coils_non_axisymmetric_get_slice_struct +use coils_non_axisymmetric_delete +use coils_non_axisymmetric_copy_struct +use coils_non_axisymmetric_deallocate_struct + +use ids_schemas_controllers +use controllers_put_struct +use controllers_put_slice_struct +use controllers_get_struct +use controllers_get_slice_struct +use controllers_delete +use controllers_copy_struct +use controllers_deallocate_struct + +use ids_schemas_core_instant_changes +use core_instant_changes_put_struct +use core_instant_changes_put_slice_struct +use core_instant_changes_get_struct +use core_instant_changes_get_slice_struct +use core_instant_changes_delete +use core_instant_changes_copy_struct +use core_instant_changes_deallocate_struct + +use ids_schemas_core_profiles +use core_profiles_put_struct +use core_profiles_put_slice_struct +use core_profiles_get_struct +use core_profiles_get_slice_struct +use core_profiles_delete +use core_profiles_copy_struct +use core_profiles_deallocate_struct + +use ids_schemas_core_sources +use core_sources_put_struct +use core_sources_put_slice_struct +use core_sources_get_struct +use core_sources_get_slice_struct +use core_sources_delete +use core_sources_copy_struct +use core_sources_deallocate_struct + +use ids_schemas_core_transport +use core_transport_put_struct +use core_transport_put_slice_struct +use core_transport_get_struct +use core_transport_get_slice_struct +use core_transport_delete +use core_transport_copy_struct +use core_transport_deallocate_struct + +use ids_schemas_cryostat +use cryostat_put_struct +use cryostat_put_slice_struct +use cryostat_get_struct +use cryostat_get_slice_struct +use cryostat_delete +use cryostat_copy_struct +use cryostat_deallocate_struct + +use ids_schemas_dataset_description +use dataset_description_put_struct +use dataset_description_put_slice_struct +use dataset_description_get_struct +use dataset_description_get_slice_struct +use dataset_description_delete +use dataset_description_copy_struct +use dataset_description_deallocate_struct + +use ids_schemas_dataset_fair +use dataset_fair_put_struct +use dataset_fair_put_slice_struct +use dataset_fair_get_struct +use dataset_fair_get_slice_struct +use dataset_fair_delete +use dataset_fair_copy_struct +use dataset_fair_deallocate_struct + +use ids_schemas_disruption +use disruption_put_struct +use disruption_put_slice_struct +use disruption_get_struct +use disruption_get_slice_struct +use disruption_delete +use disruption_copy_struct +use disruption_deallocate_struct + +use ids_schemas_distribution_sources +use distribution_sources_put_struct +use distribution_sources_put_slice_struct +use distribution_sources_get_struct +use distribution_sources_get_slice_struct +use distribution_sources_delete +use distribution_sources_copy_struct +use distribution_sources_deallocate_struct + +use ids_schemas_distributions +use distributions_put_struct +use distributions_put_slice_struct +use distributions_get_struct +use distributions_get_slice_struct +use distributions_delete +use distributions_copy_struct +use distributions_deallocate_struct + +use ids_schemas_divertors +use divertors_put_struct +use divertors_put_slice_struct +use divertors_get_struct +use divertors_get_slice_struct +use divertors_delete +use divertors_copy_struct +use divertors_deallocate_struct + +use ids_schemas_ec_launchers +use ec_launchers_put_struct +use ec_launchers_put_slice_struct +use ec_launchers_get_struct +use ec_launchers_get_slice_struct +use ec_launchers_delete +use ec_launchers_copy_struct +use ec_launchers_deallocate_struct + +use ids_schemas_ece +use ece_put_struct +use ece_put_slice_struct +use ece_get_struct +use ece_get_slice_struct +use ece_delete +use ece_copy_struct +use ece_deallocate_struct + +use ids_schemas_edge_profiles +use edge_profiles_put_struct +use edge_profiles_put_slice_struct +use edge_profiles_get_struct +use edge_profiles_get_slice_struct +use edge_profiles_delete +use edge_profiles_copy_struct +use edge_profiles_deallocate_struct + +use ids_schemas_edge_sources +use edge_sources_put_struct +use edge_sources_put_slice_struct +use edge_sources_get_struct +use edge_sources_get_slice_struct +use edge_sources_delete +use edge_sources_copy_struct +use edge_sources_deallocate_struct + +use ids_schemas_edge_transport +use edge_transport_put_struct +use edge_transport_put_slice_struct +use edge_transport_get_struct +use edge_transport_get_slice_struct +use edge_transport_delete +use edge_transport_copy_struct +use edge_transport_deallocate_struct + +use ids_schemas_em_coupling +use em_coupling_put_struct +use em_coupling_put_slice_struct +use em_coupling_get_struct +use em_coupling_get_slice_struct +use em_coupling_delete +use em_coupling_copy_struct +use em_coupling_deallocate_struct + +use ids_schemas_equilibrium +use equilibrium_put_struct +use equilibrium_put_slice_struct +use equilibrium_get_struct +use equilibrium_get_slice_struct +use equilibrium_delete +use equilibrium_copy_struct +use equilibrium_deallocate_struct + +use ids_schemas_focs +use focs_put_struct +use focs_put_slice_struct +use focs_get_struct +use focs_get_slice_struct +use focs_delete +use focs_copy_struct +use focs_deallocate_struct + +use ids_schemas_gas_injection +use gas_injection_put_struct +use gas_injection_put_slice_struct +use gas_injection_get_struct +use gas_injection_get_slice_struct +use gas_injection_delete +use gas_injection_copy_struct +use gas_injection_deallocate_struct + +use ids_schemas_gas_pumping +use gas_pumping_put_struct +use gas_pumping_put_slice_struct +use gas_pumping_get_struct +use gas_pumping_get_slice_struct +use gas_pumping_delete +use gas_pumping_copy_struct +use gas_pumping_deallocate_struct + +use ids_schemas_gyrokinetics +use gyrokinetics_put_struct +use gyrokinetics_put_slice_struct +use gyrokinetics_get_struct +use gyrokinetics_get_slice_struct +use gyrokinetics_delete +use gyrokinetics_copy_struct +use gyrokinetics_deallocate_struct + +use ids_schemas_hard_x_rays +use hard_x_rays_put_struct +use hard_x_rays_put_slice_struct +use hard_x_rays_get_struct +use hard_x_rays_get_slice_struct +use hard_x_rays_delete +use hard_x_rays_copy_struct +use hard_x_rays_deallocate_struct + +use ids_schemas_ic_antennas +use ic_antennas_put_struct +use ic_antennas_put_slice_struct +use ic_antennas_get_struct +use ic_antennas_get_slice_struct +use ic_antennas_delete +use ic_antennas_copy_struct +use ic_antennas_deallocate_struct + +use ids_schemas_interferometer +use interferometer_put_struct +use interferometer_put_slice_struct +use interferometer_get_struct +use interferometer_get_slice_struct +use interferometer_delete +use interferometer_copy_struct +use interferometer_deallocate_struct + +use ids_schemas_iron_core +use iron_core_put_struct +use iron_core_put_slice_struct +use iron_core_get_struct +use iron_core_get_slice_struct +use iron_core_delete +use iron_core_copy_struct +use iron_core_deallocate_struct + +use ids_schemas_langmuir_probes +use langmuir_probes_put_struct +use langmuir_probes_put_slice_struct +use langmuir_probes_get_struct +use langmuir_probes_get_slice_struct +use langmuir_probes_delete +use langmuir_probes_copy_struct +use langmuir_probes_deallocate_struct + +use ids_schemas_lh_antennas +use lh_antennas_put_struct +use lh_antennas_put_slice_struct +use lh_antennas_get_struct +use lh_antennas_get_slice_struct +use lh_antennas_delete +use lh_antennas_copy_struct +use lh_antennas_deallocate_struct + +use ids_schemas_magnetics +use magnetics_put_struct +use magnetics_put_slice_struct +use magnetics_get_struct +use magnetics_get_slice_struct +use magnetics_delete +use magnetics_copy_struct +use magnetics_deallocate_struct + +use ids_schemas_mhd +use mhd_put_struct +use mhd_put_slice_struct +use mhd_get_struct +use mhd_get_slice_struct +use mhd_delete +use mhd_copy_struct +use mhd_deallocate_struct + +use ids_schemas_mhd_linear +use mhd_linear_put_struct +use mhd_linear_put_slice_struct +use mhd_linear_get_struct +use mhd_linear_get_slice_struct +use mhd_linear_delete +use mhd_linear_copy_struct +use mhd_linear_deallocate_struct + +use ids_schemas_mse +use mse_put_struct +use mse_put_slice_struct +use mse_get_struct +use mse_get_slice_struct +use mse_delete +use mse_copy_struct +use mse_deallocate_struct + +use ids_schemas_nbi +use nbi_put_struct +use nbi_put_slice_struct +use nbi_get_struct +use nbi_get_slice_struct +use nbi_delete +use nbi_copy_struct +use nbi_deallocate_struct + +use ids_schemas_neutron_diagnostic +use neutron_diagnostic_put_struct +use neutron_diagnostic_put_slice_struct +use neutron_diagnostic_get_struct +use neutron_diagnostic_get_slice_struct +use neutron_diagnostic_delete +use neutron_diagnostic_copy_struct +use neutron_diagnostic_deallocate_struct + +use ids_schemas_ntms +use ntms_put_struct +use ntms_put_slice_struct +use ntms_get_struct +use ntms_get_slice_struct +use ntms_delete +use ntms_copy_struct +use ntms_deallocate_struct + +use ids_schemas_pellets +use pellets_put_struct +use pellets_put_slice_struct +use pellets_get_struct +use pellets_get_slice_struct +use pellets_delete +use pellets_copy_struct +use pellets_deallocate_struct + +use ids_schemas_pf_active +use pf_active_put_struct +use pf_active_put_slice_struct +use pf_active_get_struct +use pf_active_get_slice_struct +use pf_active_delete +use pf_active_copy_struct +use pf_active_deallocate_struct + +use ids_schemas_pf_passive +use pf_passive_put_struct +use pf_passive_put_slice_struct +use pf_passive_get_struct +use pf_passive_get_slice_struct +use pf_passive_delete +use pf_passive_copy_struct +use pf_passive_deallocate_struct + +use ids_schemas_plasma_initiation +use plasma_initiation_put_struct +use plasma_initiation_put_slice_struct +use plasma_initiation_get_struct +use plasma_initiation_get_slice_struct +use plasma_initiation_delete +use plasma_initiation_copy_struct +use plasma_initiation_deallocate_struct + +use ids_schemas_polarimeter +use polarimeter_put_struct +use polarimeter_put_slice_struct +use polarimeter_get_struct +use polarimeter_get_slice_struct +use polarimeter_delete +use polarimeter_copy_struct +use polarimeter_deallocate_struct + +use ids_schemas_pulse_schedule +use pulse_schedule_put_struct +use pulse_schedule_put_slice_struct +use pulse_schedule_get_struct +use pulse_schedule_get_slice_struct +use pulse_schedule_delete +use pulse_schedule_copy_struct +use pulse_schedule_deallocate_struct + +use ids_schemas_radiation +use radiation_put_struct +use radiation_put_slice_struct +use radiation_get_struct +use radiation_get_slice_struct +use radiation_delete +use radiation_copy_struct +use radiation_deallocate_struct + +use ids_schemas_real_time_data +use real_time_data_put_struct +use real_time_data_put_slice_struct +use real_time_data_get_struct +use real_time_data_get_slice_struct +use real_time_data_delete +use real_time_data_copy_struct +use real_time_data_deallocate_struct + +use ids_schemas_reflectometer_profile +use reflectometer_profile_put_struct +use reflectometer_profile_put_slice_struct +use reflectometer_profile_get_struct +use reflectometer_profile_get_slice_struct +use reflectometer_profile_delete +use reflectometer_profile_copy_struct +use reflectometer_profile_deallocate_struct + +use ids_schemas_reflectometer_fluctuation +use reflectometer_fluctuation_put_struct +use reflectometer_fluctuation_put_slice_struct +use reflectometer_fluctuation_get_struct +use reflectometer_fluctuation_get_slice_struct +use reflectometer_fluctuation_delete +use reflectometer_fluctuation_copy_struct +use reflectometer_fluctuation_deallocate_struct + +use ids_schemas_refractometer +use refractometer_put_struct +use refractometer_put_slice_struct +use refractometer_get_struct +use refractometer_get_slice_struct +use refractometer_delete +use refractometer_copy_struct +use refractometer_deallocate_struct + +use ids_schemas_runaway_electrons +use runaway_electrons_put_struct +use runaway_electrons_put_slice_struct +use runaway_electrons_get_struct +use runaway_electrons_get_slice_struct +use runaway_electrons_delete +use runaway_electrons_copy_struct +use runaway_electrons_deallocate_struct + +use ids_schemas_sawteeth +use sawteeth_put_struct +use sawteeth_put_slice_struct +use sawteeth_get_struct +use sawteeth_get_slice_struct +use sawteeth_delete +use sawteeth_copy_struct +use sawteeth_deallocate_struct + +use ids_schemas_soft_x_rays +use soft_x_rays_put_struct +use soft_x_rays_put_slice_struct +use soft_x_rays_get_struct +use soft_x_rays_get_slice_struct +use soft_x_rays_delete +use soft_x_rays_copy_struct +use soft_x_rays_deallocate_struct + +use ids_schemas_spectrometer_mass +use spectrometer_mass_put_struct +use spectrometer_mass_put_slice_struct +use spectrometer_mass_get_struct +use spectrometer_mass_get_slice_struct +use spectrometer_mass_delete +use spectrometer_mass_copy_struct +use spectrometer_mass_deallocate_struct + +use ids_schemas_spectrometer_uv +use spectrometer_uv_put_struct +use spectrometer_uv_put_slice_struct +use spectrometer_uv_get_struct +use spectrometer_uv_get_slice_struct +use spectrometer_uv_delete +use spectrometer_uv_copy_struct +use spectrometer_uv_deallocate_struct + +use ids_schemas_spectrometer_visible +use spectrometer_visible_put_struct +use spectrometer_visible_put_slice_struct +use spectrometer_visible_get_struct +use spectrometer_visible_get_slice_struct +use spectrometer_visible_delete +use spectrometer_visible_copy_struct +use spectrometer_visible_deallocate_struct + +use ids_schemas_spectrometer_x_ray_crystal +use spectrometer_x_ray_crystal_put_struct +use spectrometer_x_ray_crystal_put_slice_struct +use spectrometer_x_ray_crystal_get_struct +use spectrometer_x_ray_crystal_get_slice_struct +use spectrometer_x_ray_crystal_delete +use spectrometer_x_ray_crystal_copy_struct +use spectrometer_x_ray_crystal_deallocate_struct + +use ids_schemas_summary +use summary_put_struct +use summary_put_slice_struct +use summary_get_struct +use summary_get_slice_struct +use summary_delete +use summary_copy_struct +use summary_deallocate_struct + +use ids_schemas_temporary +use temporary_put_struct +use temporary_put_slice_struct +use temporary_get_struct +use temporary_get_slice_struct +use temporary_delete +use temporary_copy_struct +use temporary_deallocate_struct + +use ids_schemas_thomson_scattering +use thomson_scattering_put_struct +use thomson_scattering_put_slice_struct +use thomson_scattering_get_struct +use thomson_scattering_get_slice_struct +use thomson_scattering_delete +use thomson_scattering_copy_struct +use thomson_scattering_deallocate_struct + +use ids_schemas_tf +use tf_put_struct +use tf_put_slice_struct +use tf_get_struct +use tf_get_slice_struct +use tf_delete +use tf_copy_struct +use tf_deallocate_struct + +use ids_schemas_transport_solver_numerics +use transport_solver_numerics_put_struct +use transport_solver_numerics_put_slice_struct +use transport_solver_numerics_get_struct +use transport_solver_numerics_get_slice_struct +use transport_solver_numerics_delete +use transport_solver_numerics_copy_struct +use transport_solver_numerics_deallocate_struct + +use ids_schemas_turbulence +use turbulence_put_struct +use turbulence_put_slice_struct +use turbulence_get_struct +use turbulence_get_slice_struct +use turbulence_delete +use turbulence_copy_struct +use turbulence_deallocate_struct + +use ids_schemas_wall +use wall_put_struct +use wall_put_slice_struct +use wall_get_struct +use wall_get_slice_struct +use wall_delete +use wall_copy_struct +use wall_deallocate_struct + +use ids_schemas_waves +use waves_put_struct +use waves_put_slice_struct +use waves_get_struct +use waves_get_slice_struct +use waves_delete +use waves_copy_struct +use waves_deallocate_struct + +use ids_schemas_workflow +use workflow_put_struct +use workflow_put_slice_struct +use workflow_get_struct +use workflow_get_slice_struct +use workflow_delete +use workflow_copy_struct +use workflow_deallocate_struct + + +#if defined(__INTEL_COMPILER) +use ifport, only : getpid ! required for getpid() in ifort +#endif +#if defined(NAGFOR) +use f90_unix, only : getpid ! required for getpid() in nagfor +#endif + +contains + +subroutine ids_get_times(pulseCtx,path,time) +use al_low_level_wrap +use ids_types +implicit none + +integer(ids_int) :: pulsectx, opctx, status +character*(*) :: path +real(ids_real), pointer :: time(:) +integer(ids_int) :: dim1 + +call al_begin_global_action(pulsectx, path, READ_OP, opctx, status) +if (status.ne.0) then + STOP 'Error in al_begin_global_action from ids_get_times' +end if + +call get_vect1d_double(opctx, "time", "time", time, dim1, status) + +call al_end_action(opctx, status) + +end subroutine + +! Turn an IDS into a bunch of bytes +subroutine ids_serialize(ids_in, buffer, protocol) +#if defined(_Linux) +# define SERIALIZE_TEMPORARY_DIRECTORY '/dev/shm/' +#else +# define SERIALIZE_TEMPORARY_DIRECTORY '' +#endif + class(IDS_base) :: ids_in ! no intent(in) because ids_put also does not have that + integer(ids_int), intent(in), optional :: protocol + character(len=1), dimension(:), allocatable :: buffer + + character(len=:), allocatable :: fname + integer(ids_int) :: my_protocol + integer(ids_int) :: pulsectx + integer(ids_int) :: status + integer(ids_int) :: unit + integer(ids_int) :: file_size + integer(ids_int) :: index + character(STRMAXLEN):: uri + character(STRMAXLEN):: filename + + my_protocol = DEFAULT_SERIALIZER_PROTOCOL + if (present(protocol)) my_protocol = protocol + + if (my_protocol .eq. ASCII_SERIALIZER_PROTOCOL) then + fname = generate_tmp_file() + if (len_trim(fname) .eq. 0) then + write(*,*) 'SERIALIZE: ERROR generating temporary file name' + return + end if + + index = SCAN(fname,'/', .TRUE.) + filename=fname(index+1:) + ! Write to file + !call al_build_uri_from_legacy_parameters(ASCII_BACKEND, 0, 0, 'serialize', 'serialize', '3','-fullpath '//fname, uri, status) + uri = "imas:ascii?path=" // SERIALIZE_TEMPORARY_DIRECTORY // ";filename="//filename + call al_begin_dataentry_action(uri, FORCE_CREATE_PULSE, pulsectx, status) + if (status .ne. 0) then + write(*,*) "SERIALIZE: ERROR opening ASCII backend - al_open_pulse" + buffer = '' + return + end if + + ! I think if we implement an object-oriented ids_in->put the select type here becomes unnecessary + select type (ids_in) + + class is (ids_amns_data) + call ids_put(pulsectx, 'amns_data', ids_in) + + class is (ids_barometry) + call ids_put(pulsectx, 'barometry', ids_in) + + class is (ids_b_field_non_axisymmetric) + call ids_put(pulsectx, 'b_field_non_axisymmetric', ids_in) + + class is (ids_bolometer) + call ids_put(pulsectx, 'bolometer', ids_in) + + class is (ids_bremsstrahlung_visible) + call ids_put(pulsectx, 'bremsstrahlung_visible', ids_in) + + class is (ids_calorimetry) + call ids_put(pulsectx, 'calorimetry', ids_in) + + class is (ids_camera_ir) + call ids_put(pulsectx, 'camera_ir', ids_in) + + class is (ids_camera_visible) + call ids_put(pulsectx, 'camera_visible', ids_in) + + class is (ids_camera_x_rays) + call ids_put(pulsectx, 'camera_x_rays', ids_in) + + class is (ids_charge_exchange) + call ids_put(pulsectx, 'charge_exchange', ids_in) + + class is (ids_coils_non_axisymmetric) + call ids_put(pulsectx, 'coils_non_axisymmetric', ids_in) + + class is (ids_controllers) + call ids_put(pulsectx, 'controllers', ids_in) + + class is (ids_core_instant_changes) + call ids_put(pulsectx, 'core_instant_changes', ids_in) + + class is (ids_core_profiles) + call ids_put(pulsectx, 'core_profiles', ids_in) + + class is (ids_core_sources) + call ids_put(pulsectx, 'core_sources', ids_in) + + class is (ids_core_transport) + call ids_put(pulsectx, 'core_transport', ids_in) + + class is (ids_cryostat) + call ids_put(pulsectx, 'cryostat', ids_in) + + class is (ids_dataset_description) + call ids_put(pulsectx, 'dataset_description', ids_in) + + class is (ids_dataset_fair) + call ids_put(pulsectx, 'dataset_fair', ids_in) + + class is (ids_disruption) + call ids_put(pulsectx, 'disruption', ids_in) + + class is (ids_distribution_sources) + call ids_put(pulsectx, 'distribution_sources', ids_in) + + class is (ids_distributions) + call ids_put(pulsectx, 'distributions', ids_in) + + class is (ids_divertors) + call ids_put(pulsectx, 'divertors', ids_in) + + class is (ids_ec_launchers) + call ids_put(pulsectx, 'ec_launchers', ids_in) + + class is (ids_ece) + call ids_put(pulsectx, 'ece', ids_in) + + class is (ids_edge_profiles) + call ids_put(pulsectx, 'edge_profiles', ids_in) + + class is (ids_edge_sources) + call ids_put(pulsectx, 'edge_sources', ids_in) + + class is (ids_edge_transport) + call ids_put(pulsectx, 'edge_transport', ids_in) + + class is (ids_em_coupling) + call ids_put(pulsectx, 'em_coupling', ids_in) + + class is (ids_equilibrium) + call ids_put(pulsectx, 'equilibrium', ids_in) + + class is (ids_focs) + call ids_put(pulsectx, 'focs', ids_in) + + class is (ids_gas_injection) + call ids_put(pulsectx, 'gas_injection', ids_in) + + class is (ids_gas_pumping) + call ids_put(pulsectx, 'gas_pumping', ids_in) + + class is (ids_gyrokinetics) + call ids_put(pulsectx, 'gyrokinetics', ids_in) + + class is (ids_hard_x_rays) + call ids_put(pulsectx, 'hard_x_rays', ids_in) + + class is (ids_ic_antennas) + call ids_put(pulsectx, 'ic_antennas', ids_in) + + class is (ids_interferometer) + call ids_put(pulsectx, 'interferometer', ids_in) + + class is (ids_iron_core) + call ids_put(pulsectx, 'iron_core', ids_in) + + class is (ids_langmuir_probes) + call ids_put(pulsectx, 'langmuir_probes', ids_in) + + class is (ids_lh_antennas) + call ids_put(pulsectx, 'lh_antennas', ids_in) + + class is (ids_magnetics) + call ids_put(pulsectx, 'magnetics', ids_in) + + class is (ids_mhd) + call ids_put(pulsectx, 'mhd', ids_in) + + class is (ids_mhd_linear) + call ids_put(pulsectx, 'mhd_linear', ids_in) + + class is (ids_mse) + call ids_put(pulsectx, 'mse', ids_in) + + class is (ids_nbi) + call ids_put(pulsectx, 'nbi', ids_in) + + class is (ids_neutron_diagnostic) + call ids_put(pulsectx, 'neutron_diagnostic', ids_in) + + class is (ids_ntms) + call ids_put(pulsectx, 'ntms', ids_in) + + class is (ids_pellets) + call ids_put(pulsectx, 'pellets', ids_in) + + class is (ids_pf_active) + call ids_put(pulsectx, 'pf_active', ids_in) + + class is (ids_pf_passive) + call ids_put(pulsectx, 'pf_passive', ids_in) + + class is (ids_plasma_initiation) + call ids_put(pulsectx, 'plasma_initiation', ids_in) + + class is (ids_polarimeter) + call ids_put(pulsectx, 'polarimeter', ids_in) + + class is (ids_pulse_schedule) + call ids_put(pulsectx, 'pulse_schedule', ids_in) + + class is (ids_radiation) + call ids_put(pulsectx, 'radiation', ids_in) + + class is (ids_real_time_data) + call ids_put(pulsectx, 'real_time_data', ids_in) + + class is (ids_reflectometer_profile) + call ids_put(pulsectx, 'reflectometer_profile', ids_in) + + class is (ids_reflectometer_fluctuation) + call ids_put(pulsectx, 'reflectometer_fluctuation', ids_in) + + class is (ids_refractometer) + call ids_put(pulsectx, 'refractometer', ids_in) + + class is (ids_runaway_electrons) + call ids_put(pulsectx, 'runaway_electrons', ids_in) + + class is (ids_sawteeth) + call ids_put(pulsectx, 'sawteeth', ids_in) + + class is (ids_soft_x_rays) + call ids_put(pulsectx, 'soft_x_rays', ids_in) + + class is (ids_spectrometer_mass) + call ids_put(pulsectx, 'spectrometer_mass', ids_in) + + class is (ids_spectrometer_uv) + call ids_put(pulsectx, 'spectrometer_uv', ids_in) + + class is (ids_spectrometer_visible) + call ids_put(pulsectx, 'spectrometer_visible', ids_in) + + class is (ids_spectrometer_x_ray_crystal) + call ids_put(pulsectx, 'spectrometer_x_ray_crystal', ids_in) + + class is (ids_summary) + call ids_put(pulsectx, 'summary', ids_in) + + class is (ids_temporary) + call ids_put(pulsectx, 'temporary', ids_in) + + class is (ids_thomson_scattering) + call ids_put(pulsectx, 'thomson_scattering', ids_in) + + class is (ids_tf) + call ids_put(pulsectx, 'tf', ids_in) + + class is (ids_transport_solver_numerics) + call ids_put(pulsectx, 'transport_solver_numerics', ids_in) + + class is (ids_turbulence) + call ids_put(pulsectx, 'turbulence', ids_in) + + class is (ids_wall) + call ids_put(pulsectx, 'wall', ids_in) + + class is (ids_waves) + call ids_put(pulsectx, 'waves', ids_in) + + class is (ids_workflow) + call ids_put(pulsectx, 'workflow', ids_in) + + class default + write(*,*) "SERIALIZE: ERROR selecting IDS type" + end select + + + call al_close_pulse(pulsectx, CLOSE_PULSE, status) + if (status .ne. 0) then + write(*,*) "SERIALIZE: ERROR closing ASCII backend - al_close_pulse" + buffer = '' + call al_end_action(pulsectx, status) + return + end if + call al_end_action(pulsectx, status) + if (status .ne. 0) then + write(*,*) "SERIALIZE: ERROR closing ASCII backend - al_end_action" + buffer = '' + return + end if + + + ! Read from file + unit = get_file_unit() + open(unit=unit, file=fname, action='read', status='old', form='unformatted', access='stream') + inquire(unit=unit, size=file_size) + allocate(character(1) :: buffer(file_size + 1)) + buffer(1) = char(ASCII_SERIALIZER_PROTOCOL) + read(unit) buffer(2:) + close(unit, status='delete') + else + write(*,*) 'SERIALIZE: ERROR, unrecognized serialization protocol' + end if +end subroutine ids_serialize + +! Turn a bunch of bytes into an IDS +subroutine ids_deserialize(buffer, ids_out) +#if defined(_Linux) +# define SERIALIZE_TEMPORARY_DIRECTORY '/dev/shm/' +#else +# define SERIALIZE_TEMPORARY_DIRECTORY '' +#endif + class(IDS_base) :: ids_out ! it is up to you to pass the correct buffer and ids type + character(len=1), dimension(:), allocatable, intent(in) :: buffer + + integer(ids_int) :: protocol + character(len=:), allocatable :: fname + integer(ids_int) :: pulsectx + integer(ids_int) :: status + integer(ids_int) :: unit + integer(ids_int) :: file_size + integer(ids_int) :: index + character(STRMAXLEN):: uri + character(STRMAXLEN):: filename + + protocol = ichar(buffer(1)) + + if (protocol .eq. ASCII_SERIALIZER_PROTOCOL) then + fname = generate_tmp_file() + + if (len_trim(fname) .eq. 0) then + write(*,*) 'SERIALIZE: ERROR generating temporary file name' + return + end if + + index = SCAN(fname,'/', .TRUE.) + filename=fname(index+1:) + ! Write to file + unit = get_file_unit() + open(unit=unit, file=fname, action='write', status='new', form='unformatted', access='stream') + write(unit) buffer(2:) + ! keep the file open, so we can delete it later in one go + flush(unit) + + !call al_build_uri_from_legacy_parameters(ASCII_BACKEND, 0, 0, 'serialize', 'serialize', '3','-fullpath '//fname, uri, status) + uri = "imas:ascii?path=" // SERIALIZE_TEMPORARY_DIRECTORY // ";filename="//filename + call al_begin_dataentry_action(uri, FORCE_CREATE_PULSE, pulsectx, status) + if (status .ne. 0) then + write(*,*) "SERIALIZE: ERROR opening ASCII backend - al_open_pulse" + return + end if + + ! I think if we implement an object-oriented ids_in->put the select type here becomes unnecessary + select type (ids_out) + + class is (ids_amns_data) + call ids_get(pulsectx, 'amns_data', ids_out) + + class is (ids_barometry) + call ids_get(pulsectx, 'barometry', ids_out) + + class is (ids_b_field_non_axisymmetric) + call ids_get(pulsectx, 'b_field_non_axisymmetric', ids_out) + + class is (ids_bolometer) + call ids_get(pulsectx, 'bolometer', ids_out) + + class is (ids_bremsstrahlung_visible) + call ids_get(pulsectx, 'bremsstrahlung_visible', ids_out) + + class is (ids_calorimetry) + call ids_get(pulsectx, 'calorimetry', ids_out) + + class is (ids_camera_ir) + call ids_get(pulsectx, 'camera_ir', ids_out) + + class is (ids_camera_visible) + call ids_get(pulsectx, 'camera_visible', ids_out) + + class is (ids_camera_x_rays) + call ids_get(pulsectx, 'camera_x_rays', ids_out) + + class is (ids_charge_exchange) + call ids_get(pulsectx, 'charge_exchange', ids_out) + + class is (ids_coils_non_axisymmetric) + call ids_get(pulsectx, 'coils_non_axisymmetric', ids_out) + + class is (ids_controllers) + call ids_get(pulsectx, 'controllers', ids_out) + + class is (ids_core_instant_changes) + call ids_get(pulsectx, 'core_instant_changes', ids_out) + + class is (ids_core_profiles) + call ids_get(pulsectx, 'core_profiles', ids_out) + + class is (ids_core_sources) + call ids_get(pulsectx, 'core_sources', ids_out) + + class is (ids_core_transport) + call ids_get(pulsectx, 'core_transport', ids_out) + + class is (ids_cryostat) + call ids_get(pulsectx, 'cryostat', ids_out) + + class is (ids_dataset_description) + call ids_get(pulsectx, 'dataset_description', ids_out) + + class is (ids_dataset_fair) + call ids_get(pulsectx, 'dataset_fair', ids_out) + + class is (ids_disruption) + call ids_get(pulsectx, 'disruption', ids_out) + + class is (ids_distribution_sources) + call ids_get(pulsectx, 'distribution_sources', ids_out) + + class is (ids_distributions) + call ids_get(pulsectx, 'distributions', ids_out) + + class is (ids_divertors) + call ids_get(pulsectx, 'divertors', ids_out) + + class is (ids_ec_launchers) + call ids_get(pulsectx, 'ec_launchers', ids_out) + + class is (ids_ece) + call ids_get(pulsectx, 'ece', ids_out) + + class is (ids_edge_profiles) + call ids_get(pulsectx, 'edge_profiles', ids_out) + + class is (ids_edge_sources) + call ids_get(pulsectx, 'edge_sources', ids_out) + + class is (ids_edge_transport) + call ids_get(pulsectx, 'edge_transport', ids_out) + + class is (ids_em_coupling) + call ids_get(pulsectx, 'em_coupling', ids_out) + + class is (ids_equilibrium) + call ids_get(pulsectx, 'equilibrium', ids_out) + + class is (ids_focs) + call ids_get(pulsectx, 'focs', ids_out) + + class is (ids_gas_injection) + call ids_get(pulsectx, 'gas_injection', ids_out) + + class is (ids_gas_pumping) + call ids_get(pulsectx, 'gas_pumping', ids_out) + + class is (ids_gyrokinetics) + call ids_get(pulsectx, 'gyrokinetics', ids_out) + + class is (ids_hard_x_rays) + call ids_get(pulsectx, 'hard_x_rays', ids_out) + + class is (ids_ic_antennas) + call ids_get(pulsectx, 'ic_antennas', ids_out) + + class is (ids_interferometer) + call ids_get(pulsectx, 'interferometer', ids_out) + + class is (ids_iron_core) + call ids_get(pulsectx, 'iron_core', ids_out) + + class is (ids_langmuir_probes) + call ids_get(pulsectx, 'langmuir_probes', ids_out) + + class is (ids_lh_antennas) + call ids_get(pulsectx, 'lh_antennas', ids_out) + + class is (ids_magnetics) + call ids_get(pulsectx, 'magnetics', ids_out) + + class is (ids_mhd) + call ids_get(pulsectx, 'mhd', ids_out) + + class is (ids_mhd_linear) + call ids_get(pulsectx, 'mhd_linear', ids_out) + + class is (ids_mse) + call ids_get(pulsectx, 'mse', ids_out) + + class is (ids_nbi) + call ids_get(pulsectx, 'nbi', ids_out) + + class is (ids_neutron_diagnostic) + call ids_get(pulsectx, 'neutron_diagnostic', ids_out) + + class is (ids_ntms) + call ids_get(pulsectx, 'ntms', ids_out) + + class is (ids_pellets) + call ids_get(pulsectx, 'pellets', ids_out) + + class is (ids_pf_active) + call ids_get(pulsectx, 'pf_active', ids_out) + + class is (ids_pf_passive) + call ids_get(pulsectx, 'pf_passive', ids_out) + + class is (ids_plasma_initiation) + call ids_get(pulsectx, 'plasma_initiation', ids_out) + + class is (ids_polarimeter) + call ids_get(pulsectx, 'polarimeter', ids_out) + + class is (ids_pulse_schedule) + call ids_get(pulsectx, 'pulse_schedule', ids_out) + + class is (ids_radiation) + call ids_get(pulsectx, 'radiation', ids_out) + + class is (ids_real_time_data) + call ids_get(pulsectx, 'real_time_data', ids_out) + + class is (ids_reflectometer_profile) + call ids_get(pulsectx, 'reflectometer_profile', ids_out) + + class is (ids_reflectometer_fluctuation) + call ids_get(pulsectx, 'reflectometer_fluctuation', ids_out) + + class is (ids_refractometer) + call ids_get(pulsectx, 'refractometer', ids_out) + + class is (ids_runaway_electrons) + call ids_get(pulsectx, 'runaway_electrons', ids_out) + + class is (ids_sawteeth) + call ids_get(pulsectx, 'sawteeth', ids_out) + + class is (ids_soft_x_rays) + call ids_get(pulsectx, 'soft_x_rays', ids_out) + + class is (ids_spectrometer_mass) + call ids_get(pulsectx, 'spectrometer_mass', ids_out) + + class is (ids_spectrometer_uv) + call ids_get(pulsectx, 'spectrometer_uv', ids_out) + + class is (ids_spectrometer_visible) + call ids_get(pulsectx, 'spectrometer_visible', ids_out) + + class is (ids_spectrometer_x_ray_crystal) + call ids_get(pulsectx, 'spectrometer_x_ray_crystal', ids_out) + + class is (ids_summary) + call ids_get(pulsectx, 'summary', ids_out) + + class is (ids_temporary) + call ids_get(pulsectx, 'temporary', ids_out) + + class is (ids_thomson_scattering) + call ids_get(pulsectx, 'thomson_scattering', ids_out) + + class is (ids_tf) + call ids_get(pulsectx, 'tf', ids_out) + + class is (ids_transport_solver_numerics) + call ids_get(pulsectx, 'transport_solver_numerics', ids_out) + + class is (ids_turbulence) + call ids_get(pulsectx, 'turbulence', ids_out) + + class is (ids_wall) + call ids_get(pulsectx, 'wall', ids_out) + + class is (ids_waves) + call ids_get(pulsectx, 'waves', ids_out) + + class is (ids_workflow) + call ids_get(pulsectx, 'workflow', ids_out) + + class default + write(*,*) "SERIALIZE: ERROR selecting IDS type" + end select + + + call al_close_pulse(pulsectx, CLOSE_PULSE, status) + if (status .ne. 0) then + write(*,*) "SERIALIZE: ERROR closing ASCII backend - al_close_pulse" + call al_end_action(pulsectx, status) + return + end if + call al_end_action(pulsectx, status) + if (status .ne. 0) then + write(*,*) "SERIALIZE: ERROR closing ASCII backend - al_end_action" + return + end if + + ! delete file + close(unit, status='delete') + else + write(*,*) 'SERIALIZE: ERROR, unrecognized serialization protocol' + end if +end subroutine ids_deserialize + +function generate_tmp_file() result(fname) + character(len=:), allocatable :: fname + ! Follow same approach as the Python standard library in generating a random temporary file + character(len=*), parameter :: fs_safe_characters = 'abcdefghijklmnopqrstuvwxyz0123456789_' + integer, parameter :: n = 8 ! number of random characters in the file + integer, parameter :: MAX_TMP_FILES = 1000 + + ! On Windows and Mac OSX, use the current working directory as temporary directory (since /dev/shm does not exist). + ! On any recent Linux (2.6 or later according to Wikipedia [1]) the /dev/shm folder exists for shared memory. + ! Since glibc assumes this to exist anyway [2], we will as well. + ! [1] https://en.wikipedia.org/wiki/Shared_memory + ! [2] https://www.kernel.org/doc/Documentation/filesystems/tmpfs.txt +#if defined(_Linux) +# define SERIALIZE_TEMPORARY_DIRECTORY '/dev/shm/' +#else +# define SERIALIZE_TEMPORARY_DIRECTORY '' +#endif + + real, dimension(n) :: rd + integer :: string_base_length + integer :: i, j, k + integer :: unit ! Unit number to open file with + integer :: iostat + integer :: ipid + character(10) :: cpid + + ipid = getpid() + ! Convert to characters, using I0 to left-justify without leading 0s + write(cpid, '(I0)') ipid + + ! Setup the base of the filename + string_base_length = len(SERIALIZE_TEMPORARY_DIRECTORY) + len('al_serialize_') + len_trim(cpid) + 1 + fname = SERIALIZE_TEMPORARY_DIRECTORY // 'al_serialize_' // trim(cpid) // "_" // repeat(' ', n) ! implicitly allocates to the right size + + ! get a free unit number + unit = get_file_unit() + + do i=1,MAX_TMP_FILES + call random_number(rd) + do j=1,n + k = ceiling(rd(j)*len(fs_safe_characters)) + fname(string_base_length + j:string_base_length + j) = fs_safe_characters(k:k) + end do + + open(unit=unit, action='write', file=fname, status='new', iostat=iostat) + if (iostat .gt. 0) cycle + + ! if we get here the file was opened successfully. Delete it, and return the filename found + close(unit=unit, status='delete') + return ! implies fname + end do + fname = '' +end function generate_tmp_file + +function get_file_unit() result(unit) + ! Get a free file unit description number without using Fortran 2008 newunit feature. + integer :: unit, iostat + logical :: opened + + do unit = 97,1,-1 + inquire (unit=unit, opened=opened, iostat=iostat) + if (iostat .ne. 0) cycle + if (.not. opened) exit + end do +end function get_file_unit + +end module diff --git a/src-f90/ids_schemas.f90 b/src-f90/ids_schemas.f90 index 0f9acf756bafacfd5ed3b2c55fce6924c809e1a3..83351cec94279c540201a6f7825002340ba329b2 120000 --- a/src-f90/ids_schemas.f90 +++ b/src-f90/ids_schemas.f90 @@ -1 +1 @@ -ids_schemas_vDD3.5.3_PUAL3.3.8.f90 \ No newline at end of file +ids_schemas_v3.39.0-4.11.6-2020b.f90 \ No newline at end of file diff --git a/src-f90/ids_schemas_v3.38.1-4.11.4-2020b.f90 b/src-f90/ids_schemas_v3.38.1-4.11.4-2020b.f90 new file mode 100644 index 0000000000000000000000000000000000000000..2fea7d5b9096791f329405d81d74c1c1fe0e2af5 --- /dev/null +++ b/src-f90/ids_schemas_v3.38.1-4.11.4-2020b.f90 @@ -0,0 +1,15447 @@ + +! IDS FORTRAN 90 type definitions +! Contains the type definition of all IDSs + + +module ids_types ! declare the size of real and integer variables to be used in all sub-trees, along with the invalid numbers. + + use iso_c_binding, only: ids_real => c_double, & + ids_int => c_int32_t, & + ids_complex => c_double_complex + + implicit none + + integer(ids_int), parameter :: ids_string_length = 132_ids_int + + integer(ids_int), parameter :: ids_int_invalid = -999999999_ids_int + real(ids_real), parameter :: ids_real_invalid = -9.0E40_ids_real + complex(ids_real), parameter :: ids_complex_invalid = CMPLX(-9.0E40_ids_real,-9.0E40_ids_real) + + integer(ids_int), parameter :: ids_data_dictionary_version(3) = (/ ids_int_invalid , ids_int_invalid , ids_int_invalid /) !! NOTE: to be filled with e.g. (/3,7,4/). + + ! ids_is_valid - Function for testing the validity of scalar and arrays of integers and real numbers + interface ids_is_valid + module procedure & + ids_is_valid_int, & + ids_is_valid_ids_real, & + ids_is_valid_array_of_int, & + ids_is_valid_array_of_real + end interface + +contains + + logical function ids_is_valid_int(in) + implicit none + integer(ids_int) :: in + ids_is_valid_int = in .ne. ids_int_invalid + return + end function ids_is_valid_int + + logical function ids_is_valid_ids_real(in) + real(ids_real) :: in + ids_is_valid_ids_real = abs(in - ids_real_invalid) .gt. tiny(ids_real_invalid) + return + end function ids_is_valid_ids_real + + logical function ids_is_valid_array_of_int(in) + integer(ids_int) :: in(:) + ids_is_valid_array_of_int = .not. any( in(:) .eq. ids_int_invalid ) + return + end function ids_is_valid_array_of_int + + logical function ids_is_valid_array_of_real(in) + real(ids_real) :: in(:) + ids_is_valid_array_of_real = .not. any( abs(in(:) - ids_real_invalid) .le. tiny(ids_real_invalid) ) + return + end function ids_is_valid_array_of_real + + !!! to be defined if needed !!! + !logical function ids_is_valid_array_of_complex(in) + +end module ids_types + + + + + +module ids_utilities ! declare the set of types common to all sub-trees + +use ids_types + + + + type ids_identifier !Standard type for identifiers (constant). The three fields: name, index and description are all representations of the same inform! + !ation. Associated with each application of this identifier-type, there should be a translation table defining the three fields for! + ! all objects to be identified. + character(len=ids_string_length), dimension(:), pointer :: name => null() !Short string identifier + integer(ids_int) :: index=ids_int_invalid !Integer identifier (enumeration index within a list). Private identifier values must be indicated by a negative index. + character(len=ids_string_length), dimension(:), pointer :: description => null() !Verbose description + end type + + type ids_identifier_static !Standard type for identifiers (static). The three fields: name, index and description are all representations of the same informat! + !ion. Associated with each application of this identifier-type, there should be a translation table defining the three fields for a! + !ll objects to be identified. + character(len=ids_string_length), dimension(:), pointer :: name => null() !Short string identifier + integer(ids_int) :: index=ids_int_invalid !Integer identifier (enumeration index within a list). Private identifier values must be indicated by a negative index. + character(len=ids_string_length), dimension(:), pointer :: description => null() !Verbose description + end type + + type ids_identifier_static_1d !Standard type for identifiers (static, 1D). The three fields: name, index and description are all representations of the same info! + !rmation. Associated with each application of this identifier-type, there should be a translation table defining the three fields f! + !or all objects to be identified. + character(len=ids_string_length), dimension(:), pointer :: names => null() !Short string identifiers + integer(ids_int), pointer :: indices(:) => null() !Integer identifiers (enumeration index within a list). Private identifier values must be indicated by a negative index. + character(len=ids_string_length), dimension(:), pointer :: descriptions => null() !Verbose description + end type + + type ids_identifier_dynamic_aos3_1d !Standard type for identifiers (1D arrays for each node), dynamic within type 3 array of structures (index on time). The three fiel! + !ds: name, index and description are all representations of the same information. Associated with each application of this identifi! + !er-type, there should be a translation table defining the three fields for all objects to be identified. + character(len=ids_string_length), dimension(:), pointer :: names => null() !Short string identifiers + integer(ids_int), pointer :: indices(:) => null() !Integer identifiers (enumeration index within a list). Private identifier values must be indicated by a negative index. + character(len=ids_string_length), dimension(:), pointer :: descriptions => null() !Verbose description + end type + + type ids_identifier_dynamic_aos3 !Standard type for identifiers (dynamic within type 3 array of structures (index on time)). The three fields: name, index and descr! + !iption are all representations of the same information. Associated with each application of this identifier-type, there should be ! + !a translation table defining the three fields for all objects to be identified. + character(len=ids_string_length), dimension(:), pointer :: name => null() !Short string identifier + integer(ids_int) :: index=ids_int_invalid !Integer identifier (enumeration index within a list). Private identifier values must be indicated by a negative index. + character(len=ids_string_length), dimension(:), pointer :: description => null() !Verbose description + end type + + type ids_data_flt_0d_constant_validity !Constant data (FLT_0D) with validity flag + real(ids_real) :: data=ids_real_invalid !Data + real(ids_real) :: data_error_upper=ids_real_invalid !Upper error for "data" + real(ids_real) :: data_error_lower=ids_real_invalid !Lower error for "data" + integer(ids_int) :: data_error_index=ids_int_invalid !Index in the error_description list for "data" + integer(ids_int) :: validity=ids_int_invalid !Indicator of the validity of the data for the whole acquisition period. 0: valid from automated processing, 1: valid and certified! + ! by the diagnostic RO; - 1 means problem identified in the data processing (request verification by the diagnostic RO), -2: invali! + !d data, should not be used (values lower than -2 have a code-specific meaning detailing the origin of their invalidity) + end type + + type ids_signal_flt_1d !Signal (FLT_1D) with its time base + real(ids_real), pointer :: data(:) => null() !Data + real(ids_real), pointer :: data_error_upper(:) => null() !Upper error for "data" + real(ids_real), pointer :: data_error_lower(:) => null() !Lower error for "data" + integer(ids_int) :: data_error_index=ids_int_invalid !Index in the error_description list for "data" + real(ids_real), pointer :: time(:) => null() !Time + end type + + type ids_signal_flt_1d_units_level_2 !Signal (FLT_1D) with its time base, data units 2 levels above + real(ids_real), pointer :: data(:) => null() !Data + real(ids_real), pointer :: data_error_upper(:) => null() !Upper error for "data" + real(ids_real), pointer :: data_error_lower(:) => null() !Lower error for "data" + integer(ids_int) :: data_error_index=ids_int_invalid !Index in the error_description list for "data" + real(ids_real), pointer :: time(:) => null() !Time + end type + + type ids_signal_flt_1d_validity !Signal (FLT_1D) with its time base and validity flags + real(ids_real), pointer :: data(:) => null() !Data + real(ids_real), pointer :: data_error_upper(:) => null() !Upper error for "data" + real(ids_real), pointer :: data_error_lower(:) => null() !Lower error for "data" + integer(ids_int) :: data_error_index=ids_int_invalid !Index in the error_description list for "data" + integer(ids_int), pointer :: validity_timed(:) => null() !Indicator of the validity of the data for each time slice. 0: valid from automated processing, 1: valid and certified by the diagn! + !ostic RO; - 1 means problem identified in the data processing (request verification by the diagnostic RO), -2: invalid data, shoul! + !d not be used (values lower than -2 have a code-specific meaning detailing the origin of their invalidity) + integer(ids_int) :: validity=ids_int_invalid !Indicator of the validity of the data for the whole acquisition period. 0: valid from automated processing, 1: valid and certified! + ! by the diagnostic RO; - 1 means problem identified in the data processing (request verification by the diagnostic RO), -2: invali! + !d data, should not be used (values lower than -2 have a code-specific meaning detailing the origin of their invalidity) + real(ids_real), pointer :: time(:) => null() !Time + end type + + type ids_signal_flt_1d_validity_position !Signal (FLT_1D) with its time base and validity flags and rho_tor_norm position + real(ids_real), pointer :: data(:) => null() !Data + real(ids_real), pointer :: data_error_upper(:) => null() !Upper error for "data" + real(ids_real), pointer :: data_error_lower(:) => null() !Lower error for "data" + integer(ids_int) :: data_error_index=ids_int_invalid !Index in the error_description list for "data" + real(ids_real), pointer :: rho_tor_norm(:) => null() !Normalised toroidal flux coordinate of the measurement + real(ids_real), pointer :: rho_tor_norm_error_upper(:) => null() !Upper error for "rho_tor_norm" + real(ids_real), pointer :: rho_tor_norm_error_lower(:) => null() !Lower error for "rho_tor_norm" + integer(ids_int) :: rho_tor_norm_error_index=ids_int_invalid !Index in the error_description list for "rho_tor_norm" + integer(ids_int), pointer :: validity_timed(:) => null() !Indicator of the validity of the data for each time slice. 0: valid from automated processing, 1: valid and certified by the diagn! + !ostic RO; - 1 means problem identified in the data processing (request verification by the diagnostic RO), -2: invalid data, shoul! + !d not be used (values lower than -2 have a code-specific meaning detailing the origin of their invalidity) + integer(ids_int) :: validity=ids_int_invalid !Indicator of the validity of the data for the whole acquisition period. 0: valid from automated processing, 1: valid and certified! + ! by the diagnostic RO; - 1 means problem identified in the data processing (request verification by the diagnostic RO), -2: invali! + !d data, should not be used (values lower than -2 have a code-specific meaning detailing the origin of their invalidity) + real(ids_real), pointer :: time(:) => null() !Time + end type + + type ids_signal_flt_2d !Signal (FLT_2D) with its time base + real(ids_real), pointer :: data(:,:) => null() !Data + real(ids_real), pointer :: data_error_upper(:,:) => null() !Upper error for "data" + real(ids_real), pointer :: data_error_lower(:,:) => null() !Lower error for "data" + integer(ids_int) :: data_error_index=ids_int_invalid !Index in the error_description list for "data" + real(ids_real), pointer :: time(:) => null() !Time + end type + + type ids_signal_flt_2d_validity !Signal (FLT_2D) with its time base and validity flags + real(ids_real), pointer :: data(:,:) => null() !Data + real(ids_real), pointer :: data_error_upper(:,:) => null() !Upper error for "data" + real(ids_real), pointer :: data_error_lower(:,:) => null() !Lower error for "data" + integer(ids_int) :: data_error_index=ids_int_invalid !Index in the error_description list for "data" + integer(ids_int), pointer :: validity_timed(:) => null() !Indicator of the validity of the data for each time slice. 0: valid from automated processing, 1: valid and certified by the diagn! + !ostic RO; - 1 means problem identified in the data processing (request verification by the diagnostic RO), -2: invalid data, shoul! + !d not be used (values lower than -2 have a code-specific meaning detailing the origin of their invalidity) + integer(ids_int) :: validity=ids_int_invalid !Indicator of the validity of the data for the whole acquisition period. 0: valid from automated processing, 1: valid and certified! + ! by the diagnostic RO; - 1 means problem identified in the data processing (request verification by the diagnostic RO), -2: invali! + !d data, should not be used (values lower than -2 have a code-specific meaning detailing the origin of their invalidity) + real(ids_real), pointer :: time(:) => null() !Time + end type + + type ids_signal_flt_3d !Signal (FLT_3D) with its time base + real(ids_real), pointer :: data(:,:,:) => null() !Data + real(ids_real), pointer :: data_error_upper(:,:,:) => null() !Upper error for "data" + real(ids_real), pointer :: data_error_lower(:,:,:) => null() !Lower error for "data" + integer(ids_int) :: data_error_index=ids_int_invalid !Index in the error_description list for "data" + real(ids_real), pointer :: time(:) => null() !Time + end type + + type ids_signal_flt_4d !Signal (FLT_4D) with its time base + real(ids_real), pointer :: data(:,:,:,:) => null() !Data + real(ids_real), pointer :: data_error_upper(:,:,:,:) => null() !Upper error for "data" + real(ids_real), pointer :: data_error_lower(:,:,:,:) => null() !Lower error for "data" + integer(ids_int) :: data_error_index=ids_int_invalid !Index in the error_description list for "data" + real(ids_real), pointer :: time(:) => null() !Time + end type + + type ids_signal_flt_5d !Signal (FLT_5D) with its time base + real(ids_real), pointer :: data(:,:,:,:,:) => null() !Data + real(ids_real), pointer :: data_error_upper(:,:,:,:,:) => null() !Upper error for "data" + real(ids_real), pointer :: data_error_lower(:,:,:,:,:) => null() !Lower error for "data" + integer(ids_int) :: data_error_index=ids_int_invalid !Index in the error_description list for "data" + real(ids_real), pointer :: time(:) => null() !Time + end type + + type ids_signal_flt_6d !Signal (FLT_6D) with its time base + real(ids_real), pointer :: data(:,:,:,:,:,:) => null() !Data + real(ids_real), pointer :: data_error_upper(:,:,:,:,:,:) => null() !Upper error for "data" + real(ids_real), pointer :: data_error_lower(:,:,:,:,:,:) => null() !Lower error for "data" + integer(ids_int) :: data_error_index=ids_int_invalid !Index in the error_description list for "data" + real(ids_real), pointer :: time(:) => null() !Time + end type + + type ids_signal_int_1d !Signal (INT_1D) with its time base + integer(ids_int), pointer :: data(:) => null() !Data + real(ids_real), pointer :: time(:) => null() !Time + end type + + type ids_signal_int_2d !Signal (INT_2D) with its time base + integer(ids_int), pointer :: data(:,:) => null() !Data + real(ids_real), pointer :: time(:) => null() !Time + end type + + type ids_signal_int_3d !Signal (INT_3D) with its time base + integer(ids_int), pointer :: data(:,:,:) => null() !Data + real(ids_real), pointer :: time(:) => null() !Time + end type + + type ids_physical_quantity_flt_1d_time_1 !Similar to a signal (FLT_1D) but with time base one level above (NB : since this is described in the utilities section, the timeba! + !se must be directly below the closest AoS) + real(ids_real), pointer :: data(:) => null() !Data + real(ids_real), pointer :: data_error_upper(:) => null() !Upper error for "data" + real(ids_real), pointer :: data_error_lower(:) => null() !Lower error for "data" + integer(ids_int) :: data_error_index=ids_int_invalid !Index in the error_description list for "data" + integer(ids_int), pointer :: validity_timed(:) => null() !Indicator of the validity of the data for each time slice. 0: valid from automated processing, 1: valid and certified by the diagn! + !ostic RO; - 1 means problem identified in the data processing (request verification by the diagnostic RO), -2: invalid data, shoul! + !d not be used (values lower than -2 have a code-specific meaning detailing the origin of their invalidity) + integer(ids_int) :: validity=ids_int_invalid !Indicator of the validity of the data for the whole acquisition period. 0: valid from automated processing, 1: valid and certified! + ! by the diagnostic RO; - 1 means problem identified in the data processing (request verification by the diagnostic RO), -2: invali! + !d data, should not be used (values lower than -2 have a code-specific meaning detailing the origin of their invalidity) + end type + + type ids_physical_quantity_flt_2d_time_1 !Similar to a signal (FLT_2D) but with time base one level above (NB : since this is described in the utilities section, the timeba! + !se must be directly below the closest AoS) + real(ids_real), pointer :: data(:,:) => null() !Data + real(ids_real), pointer :: data_error_upper(:,:) => null() !Upper error for "data" + real(ids_real), pointer :: data_error_lower(:,:) => null() !Lower error for "data" + integer(ids_int) :: data_error_index=ids_int_invalid !Index in the error_description list for "data" + integer(ids_int), pointer :: validity_timed(:) => null() !Indicator of the validity of the data for each time slice. 0: valid from automated processing, 1: valid and certified by the diagn! + !ostic RO; - 1 means problem identified in the data processing (request verification by the diagnostic RO), -2: invalid data, shoul! + !d not be used (values lower than -2 have a code-specific meaning detailing the origin of their invalidity) + integer(ids_int) :: validity=ids_int_invalid !Indicator of the validity of the data for the whole acquisition period. 0: valid from automated processing, 1: valid and certified! + ! by the diagnostic RO; - 1 means problem identified in the data processing (request verification by the diagnostic RO), -2: invali! + !d data, should not be used (values lower than -2 have a code-specific meaning detailing the origin of their invalidity) + end type + + type ids_plasma_composition_ion_state_constant !Definition of an ion state (when describing the plasma composition) (constant) + real(ids_real) :: z_min=ids_real_invalid !Minimum Z of the charge state bundle (z_min = z_max = 0 for a neutral) + real(ids_real) :: z_min_error_upper=ids_real_invalid !Upper error for "z_min" + real(ids_real) :: z_min_error_lower=ids_real_invalid !Lower error for "z_min" + integer(ids_int) :: z_min_error_index=ids_int_invalid !Index in the error_description list for "z_min" + real(ids_real) :: z_max=ids_real_invalid !Maximum Z of the charge state bundle (equal to z_min if no bundle) + real(ids_real) :: z_max_error_upper=ids_real_invalid !Upper error for "z_max" + real(ids_real) :: z_max_error_lower=ids_real_invalid !Lower error for "z_max" + integer(ids_int) :: z_max_error_index=ids_int_invalid !Index in the error_description list for "z_max" + character(len=ids_string_length), dimension(:), pointer :: label => null() !String identifying ion state (e.g. C+, C+2 , C+3, C+4, C+5, C+6, ...) + character(len=ids_string_length), dimension(:), pointer :: electron_configuration => null() !Configuration of atomic orbitals of this state, e.g. 1s2-2s1 + real(ids_real) :: vibrational_level=ids_real_invalid !Vibrational level (can be bundled) + real(ids_real) :: vibrational_level_error_upper=ids_real_invalid !Upper error for "vibrational_level" + real(ids_real) :: vibrational_level_error_lower=ids_real_invalid !Lower error for "vibrational_level" + integer(ids_int) :: vibrational_level_error_index=ids_int_invalid !Index in the error_description list for "vibrational_level" + character(len=ids_string_length), dimension(:), pointer :: vibrational_mode => null() !Vibrational mode of this state, e.g. "A_g". Need to define, or adopt a standard nomenclature. + end type + + type ids_plasma_composition_neutral_state_constant !Definition of a neutral state (when describing the plasma composition) (constant) + character(len=ids_string_length), dimension(:), pointer :: label => null() !String identifying neutral state + character(len=ids_string_length), dimension(:), pointer :: electron_configuration => null() !Configuration of atomic orbitals of this state, e.g. 1s2-2s1 + real(ids_real) :: vibrational_level=ids_real_invalid !Vibrational level (can be bundled) + real(ids_real) :: vibrational_level_error_upper=ids_real_invalid !Upper error for "vibrational_level" + real(ids_real) :: vibrational_level_error_lower=ids_real_invalid !Lower error for "vibrational_level" + integer(ids_int) :: vibrational_level_error_index=ids_int_invalid !Index in the error_description list for "vibrational_level" + character(len=ids_string_length), dimension(:), pointer :: vibrational_mode => null() !Vibrational mode of this state, e.g. "A_g". Need to define, or adopt a standard nomenclature. + type(ids_identifier) :: neutral_type !Neutral type, in terms of energy. ID =1: cold; 2: thermal; 3: fast; 4: NBI + end type + + type ids_plasma_composition_ion_state !Definition of an ion state (when describing the plasma composition) (within a type 3 AoS) + real(ids_real) :: z_min=ids_real_invalid !Minimum Z of the charge state bundle (z_min = z_max = 0 for a neutral) + real(ids_real) :: z_min_error_upper=ids_real_invalid !Upper error for "z_min" + real(ids_real) :: z_min_error_lower=ids_real_invalid !Lower error for "z_min" + integer(ids_int) :: z_min_error_index=ids_int_invalid !Index in the error_description list for "z_min" + real(ids_real) :: z_max=ids_real_invalid !Maximum Z of the charge state bundle (equal to z_min if no bundle) + real(ids_real) :: z_max_error_upper=ids_real_invalid !Upper error for "z_max" + real(ids_real) :: z_max_error_lower=ids_real_invalid !Lower error for "z_max" + integer(ids_int) :: z_max_error_index=ids_int_invalid !Index in the error_description list for "z_max" + character(len=ids_string_length), dimension(:), pointer :: label => null() !String identifying ion state (e.g. C+, C+2 , C+3, C+4, C+5, C+6, ...) + character(len=ids_string_length), dimension(:), pointer :: electron_configuration => null() !Configuration of atomic orbitals of this state, e.g. 1s2-2s1 + real(ids_real) :: vibrational_level=ids_real_invalid !Vibrational level (can be bundled) + real(ids_real) :: vibrational_level_error_upper=ids_real_invalid !Upper error for "vibrational_level" + real(ids_real) :: vibrational_level_error_lower=ids_real_invalid !Lower error for "vibrational_level" + integer(ids_int) :: vibrational_level_error_index=ids_int_invalid !Index in the error_description list for "vibrational_level" + character(len=ids_string_length), dimension(:), pointer :: vibrational_mode => null() !Vibrational mode of this state, e.g. "A_g". Need to define, or adopt a standard nomenclature. + end type + + type ids_plasma_composition_ions_constant !Description of plasma ions (constant) + type(ids_plasma_composition_neutral_element_constant), pointer :: element(:) => null() !List of elements forming the atom or molecule + real(ids_real) :: z_ion=ids_real_invalid !Ion charge (of the dominant ionisation state; lumped ions are allowed) + real(ids_real) :: z_ion_error_upper=ids_real_invalid !Upper error for "z_ion" + real(ids_real) :: z_ion_error_lower=ids_real_invalid !Lower error for "z_ion" + integer(ids_int) :: z_ion_error_index=ids_int_invalid !Index in the error_description list for "z_ion" + character(len=ids_string_length), dimension(:), pointer :: label => null() !String identifying ion (e.g. H+, D+, T+, He+2, C+, ...) + type(ids_plasma_composition_ion_state_constant) :: state !Quantities related to the different states of the species (ionisation, energy, excitation, ...) + end type + + type ids_plasma_composition_neutral_constant !Definition of plasma neutral (constant) + type(ids_plasma_composition_neutral_element_constant), pointer :: element(:) => null() !List of elements forming the atom or molecule + character(len=ids_string_length), dimension(:), pointer :: label => null() !String identifying neutral (e.g. H, D, T, He, C, ...) + type(ids_plasma_composition_neutral_state_constant) :: state !State of the species (energy, excitation, ...) + end type + + type ids_gas_mixture_constant !Description of a neutral species within a gas mixture (constant) + type(ids_plasma_composition_neutral_element_constant), pointer :: element(:) => null() !List of elements forming the atom or molecule + character(len=ids_string_length), dimension(:), pointer :: label => null() !String identifying neutral (e.g. H, D, T, He, C, ...) + real(ids_real) :: fraction=ids_real_invalid !Relative fraction of this species (in molecules) in the gas mixture + real(ids_real) :: fraction_error_upper=ids_real_invalid !Upper error for "fraction" + real(ids_real) :: fraction_error_lower=ids_real_invalid !Lower error for "fraction" + integer(ids_int) :: fraction_error_index=ids_int_invalid !Index in the error_description list for "fraction" + end type + + type ids_plasma_composition_ions !Array of plasma ions (within a type 3 AoS) + type(ids_plasma_composition_neutral_element), pointer :: element(:) => null() !List of elements forming the atom or molecule + real(ids_real) :: z_ion=ids_real_invalid !Ion charge (of the dominant ionisation state; lumped ions are allowed) + real(ids_real) :: z_ion_error_upper=ids_real_invalid !Upper error for "z_ion" + real(ids_real) :: z_ion_error_lower=ids_real_invalid !Lower error for "z_ion" + integer(ids_int) :: z_ion_error_index=ids_int_invalid !Index in the error_description list for "z_ion" + character(len=ids_string_length), dimension(:), pointer :: label => null() !String identifying ion (e.g. H+, D+, T+, He+2, C+, ...) + integer(ids_int) :: multiple_states_flag=ids_int_invalid !Multiple states calculation flag : 0-Only one state is considered; 1-Multiple states are considered and are described in the state! + ! structure + type(ids_plasma_composition_ion_state), pointer :: state(:) => null() !Quantities related to the different states of the species (ionisation, energy, excitation, ...) + end type + + type ids_plasma_composition_species !Description of simple species (elements) without declaration of their ionisation state + real(ids_real) :: a=ids_real_invalid !Mass of atom + real(ids_real) :: a_error_upper=ids_real_invalid !Upper error for "a" + real(ids_real) :: a_error_lower=ids_real_invalid !Lower error for "a" + integer(ids_int) :: a_error_index=ids_int_invalid !Index in the error_description list for "a" + real(ids_real) :: z_n=ids_real_invalid !Nuclear charge + real(ids_real) :: z_n_error_upper=ids_real_invalid !Upper error for "z_n" + real(ids_real) :: z_n_error_lower=ids_real_invalid !Lower error for "z_n" + integer(ids_int) :: z_n_error_index=ids_int_invalid !Index in the error_description list for "z_n" + character(len=ids_string_length), dimension(:), pointer :: label => null() !String identifying the species (e.g. H, D, T, ...) + end type + + type ids_plasma_composition_neutral_element_constant !Element entering in the composition of the neutral atom or molecule (constant) + real(ids_real) :: a=ids_real_invalid !Mass of atom + real(ids_real) :: a_error_upper=ids_real_invalid !Upper error for "a" + real(ids_real) :: a_error_lower=ids_real_invalid !Lower error for "a" + integer(ids_int) :: a_error_index=ids_int_invalid !Index in the error_description list for "a" + real(ids_real) :: z_n=ids_real_invalid !Nuclear charge + real(ids_real) :: z_n_error_upper=ids_real_invalid !Upper error for "z_n" + real(ids_real) :: z_n_error_lower=ids_real_invalid !Lower error for "z_n" + integer(ids_int) :: z_n_error_index=ids_int_invalid !Index in the error_description list for "z_n" + integer(ids_int) :: atoms_n=ids_int_invalid !Number of atoms of this element in the molecule + real(ids_real) :: multiplicity=ids_real_invalid !Multiplicity of the atom + real(ids_real) :: multiplicity_error_upper=ids_real_invalid !Upper error for "multiplicity" + real(ids_real) :: multiplicity_error_lower=ids_real_invalid !Lower error for "multiplicity" + integer(ids_int) :: multiplicity_error_index=ids_int_invalid !Index in the error_description list for "multiplicity" + end type + + type ids_plasma_composition_neutral_element !Element entering in the composition of the neutral atom or molecule (within a type 3 AoS) + real(ids_real) :: a=ids_real_invalid !Mass of atom + real(ids_real) :: a_error_upper=ids_real_invalid !Upper error for "a" + real(ids_real) :: a_error_lower=ids_real_invalid !Lower error for "a" + integer(ids_int) :: a_error_index=ids_int_invalid !Index in the error_description list for "a" + real(ids_real) :: z_n=ids_real_invalid !Nuclear charge + real(ids_real) :: z_n_error_upper=ids_real_invalid !Upper error for "z_n" + real(ids_real) :: z_n_error_lower=ids_real_invalid !Lower error for "z_n" + integer(ids_int) :: z_n_error_index=ids_int_invalid !Index in the error_description list for "z_n" + integer(ids_int) :: atoms_n=ids_int_invalid !Number of atoms of this element in the molecule + real(ids_real) :: multiplicity=ids_real_invalid !Multiplicity of the atom + real(ids_real) :: multiplicity_error_upper=ids_real_invalid !Upper error for "multiplicity" + real(ids_real) :: multiplicity_error_lower=ids_real_invalid !Lower error for "multiplicity" + integer(ids_int) :: multiplicity_error_index=ids_int_invalid !Index in the error_description list for "multiplicity" + end type + + type ids_plasma_composition_neutral !Definition of a neutral atom or molecule + type(ids_plasma_composition_neutral_element), pointer :: element(:) => null() !List of elements forming the atom or molecule + type(ids_identifier), pointer :: type(:) => null() !List of neutral types, in terms of energy, considered for that neutral species. ID =1: cold; 2: thermal; 3: fast; 4: NBI + character(len=ids_string_length), dimension(:), pointer :: label => null() !String identifying the atom or molecule (e.g. D2, DT, CD4, ...) + end type + + type ids_code_partial_constant !Description of code-specific parameters and constant output flag + character(len=ids_string_length), dimension(:), pointer :: parameters => null() !List of the code specific parameters in XML format + integer(ids_int) :: output_flag=ids_int_invalid !Output flag : 0 means the run is successful, other values mean some difficulty has been encountered, the exact meaning is then cod! + !e specific. Negative values mean the result shall not be used. + end type + + type ids_code_with_timebase !Description of code-specific parameters when they are gathered below an array of structure (e.g. in case of multiple models or sou! + !rces gathered in a single IDS). The only difference with the generic code element is the existence of a data+time structure for th! + !e dynamic signals (output_flag) + character(len=ids_string_length), dimension(:), pointer :: name => null() !Name of software used + character(len=ids_string_length), dimension(:), pointer :: commit => null() !Unique commit reference of software + character(len=ids_string_length), dimension(:), pointer :: version => null() !Unique version (tag) of software + character(len=ids_string_length), dimension(:), pointer :: repository => null() !URL of software repository + character(len=ids_string_length), dimension(:), pointer :: parameters => null() !List of the code specific parameters in XML format + type(ids_signal_int_1d) :: output_flag !Output flag : 0 means the run is successful, other values mean some difficulty has been encountered, the exact meaning is then cod! + !e specific. Negative values mean the result shall not be used. + end type + + type ids_code_constant !Description of code-specific parameters without dynamic output_flag parameter + character(len=ids_string_length), dimension(:), pointer :: name => null() !Name of software used + character(len=ids_string_length), dimension(:), pointer :: commit => null() !Unique commit reference of software + character(len=ids_string_length), dimension(:), pointer :: version => null() !Unique version (tag) of software + character(len=ids_string_length), dimension(:), pointer :: repository => null() !URL of software repository + character(len=ids_string_length), dimension(:), pointer :: parameters => null() !List of the code specific parameters in XML format + end type + + type ids_library !Library used by the code that has produced this IDS + character(len=ids_string_length), dimension(:), pointer :: name => null() !Name of software + character(len=ids_string_length), dimension(:), pointer :: commit => null() !Unique commit reference of software + character(len=ids_string_length), dimension(:), pointer :: version => null() !Unique version (tag) of software + character(len=ids_string_length), dimension(:), pointer :: repository => null() !URL of software repository + character(len=ids_string_length), dimension(:), pointer :: parameters => null() !List of the code specific parameters in XML format + end type + + type ids_b_tor_vacuum_1 !Characteristics of the vacuum toroidal field. Time coordinate at the root of the IDS + real(ids_real) :: r0=ids_real_invalid !Reference major radius where the vacuum toroidal magnetic field is given (usually a fixed position such as the middle of the vesse! + !l at the equatorial midplane) + real(ids_real) :: r0_error_upper=ids_real_invalid !Upper error for "r0" + real(ids_real) :: r0_error_lower=ids_real_invalid !Lower error for "r0" + integer(ids_int) :: r0_error_index=ids_int_invalid !Index in the error_description list for "r0" + real(ids_real), pointer :: b0(:) => null() !Vacuum toroidal field at R0 [T]; Positive sign means anti-clockwise when viewing from above. The product R0B0 must be consistent w! + !ith the b_tor_vacuum_r field of the tf IDS. + real(ids_real), pointer :: b0_error_upper(:) => null() !Upper error for "b0" + real(ids_real), pointer :: b0_error_lower(:) => null() !Lower error for "b0" + integer(ids_int) :: b0_error_index=ids_int_invalid !Index in the error_description list for "b0" + end type + + type ids_b_tor_vacuum_aos3 !Characteristics of the vacuum toroidal field, dynamic within a type 3 AoS + real(ids_real) :: r0=ids_real_invalid !Reference major radius where the vacuum toroidal magnetic field is given (usually a fixed position such as the middle of the vesse! + !l at the equatorial midplane) + real(ids_real) :: r0_error_upper=ids_real_invalid !Upper error for "r0" + real(ids_real) :: r0_error_lower=ids_real_invalid !Lower error for "r0" + integer(ids_int) :: r0_error_index=ids_int_invalid !Index in the error_description list for "r0" + real(ids_real) :: b0=ids_real_invalid !Vacuum toroidal field at b0. Positive sign means anti-clockwise when viewing from above. The product r0*b0 must be consistent with! + ! the b_tor_vacuum_r field of the tf IDS. + real(ids_real) :: b0_error_upper=ids_real_invalid !Upper error for "b0" + real(ids_real) :: b0_error_lower=ids_real_invalid !Lower error for "b0" + integer(ids_int) :: b0_error_index=ids_int_invalid !Index in the error_description list for "b0" + end type + + type ids_psi_normalization !Quantities used to normalize psi, as a function of time + real(ids_real), pointer :: psi_magnetic_axis(:) => null() !Value of the poloidal magnetic flux at the magnetic axis + real(ids_real), pointer :: psi_magnetic_axis_error_upper(:) => null() !Upper error for "psi_magnetic_axis" + real(ids_real), pointer :: psi_magnetic_axis_error_lower(:) => null() !Lower error for "psi_magnetic_axis" + integer(ids_int) :: psi_magnetic_axis_error_index=ids_int_invalid !Index in the error_description list for "psi_magnetic_axis" + real(ids_real), pointer :: psi_boundary(:) => null() !Value of the poloidal magnetic flux at the plasma boundary + real(ids_real), pointer :: psi_boundary_error_upper(:) => null() !Upper error for "psi_boundary" + real(ids_real), pointer :: psi_boundary_error_lower(:) => null() !Lower error for "psi_boundary" + integer(ids_int) :: psi_boundary_error_index=ids_int_invalid !Index in the error_description list for "psi_boundary" + real(ids_real), pointer :: time(:) => null() !Time for the R,Z,phi coordinates + end type + + type ids_core_profiles_vector_components_1 !Vector components in predefined directions for 1D profiles, assuming core_radial_grid one level above + real(ids_real), pointer :: radial(:) => null() !Radial component + real(ids_real), pointer :: radial_error_upper(:) => null() !Upper error for "radial" + real(ids_real), pointer :: radial_error_lower(:) => null() !Lower error for "radial" + integer(ids_int) :: radial_error_index=ids_int_invalid !Index in the error_description list for "radial" + real(ids_real), pointer :: diamagnetic(:) => null() !Diamagnetic component + real(ids_real), pointer :: diamagnetic_error_upper(:) => null() !Upper error for "diamagnetic" + real(ids_real), pointer :: diamagnetic_error_lower(:) => null() !Lower error for "diamagnetic" + integer(ids_int) :: diamagnetic_error_index=ids_int_invalid !Index in the error_description list for "diamagnetic" + real(ids_real), pointer :: parallel(:) => null() !Parallel component + real(ids_real), pointer :: parallel_error_upper(:) => null() !Upper error for "parallel" + real(ids_real), pointer :: parallel_error_lower(:) => null() !Lower error for "parallel" + integer(ids_int) :: parallel_error_index=ids_int_invalid !Index in the error_description list for "parallel" + real(ids_real), pointer :: poloidal(:) => null() !Poloidal component + real(ids_real), pointer :: poloidal_error_upper(:) => null() !Upper error for "poloidal" + real(ids_real), pointer :: poloidal_error_lower(:) => null() !Lower error for "poloidal" + integer(ids_int) :: poloidal_error_index=ids_int_invalid !Index in the error_description list for "poloidal" + real(ids_real), pointer :: toroidal(:) => null() !Toroidal component + real(ids_real), pointer :: toroidal_error_upper(:) => null() !Upper error for "toroidal" + real(ids_real), pointer :: toroidal_error_lower(:) => null() !Lower error for "toroidal" + integer(ids_int) :: toroidal_error_index=ids_int_invalid !Index in the error_description list for "toroidal" + end type + + type ids_core_profiles_vector_components_2 !Vector components in predefined directions for 1D profiles, assuming core_radial_grid two levels above + real(ids_real), pointer :: radial(:) => null() !Radial component + real(ids_real), pointer :: radial_error_upper(:) => null() !Upper error for "radial" + real(ids_real), pointer :: radial_error_lower(:) => null() !Lower error for "radial" + integer(ids_int) :: radial_error_index=ids_int_invalid !Index in the error_description list for "radial" + real(ids_real), pointer :: diamagnetic(:) => null() !Diamagnetic component + real(ids_real), pointer :: diamagnetic_error_upper(:) => null() !Upper error for "diamagnetic" + real(ids_real), pointer :: diamagnetic_error_lower(:) => null() !Lower error for "diamagnetic" + integer(ids_int) :: diamagnetic_error_index=ids_int_invalid !Index in the error_description list for "diamagnetic" + real(ids_real), pointer :: parallel(:) => null() !Parallel component + real(ids_real), pointer :: parallel_error_upper(:) => null() !Upper error for "parallel" + real(ids_real), pointer :: parallel_error_lower(:) => null() !Lower error for "parallel" + integer(ids_int) :: parallel_error_index=ids_int_invalid !Index in the error_description list for "parallel" + real(ids_real), pointer :: poloidal(:) => null() !Poloidal component + real(ids_real), pointer :: poloidal_error_upper(:) => null() !Upper error for "poloidal" + real(ids_real), pointer :: poloidal_error_lower(:) => null() !Lower error for "poloidal" + integer(ids_int) :: poloidal_error_index=ids_int_invalid !Index in the error_description list for "poloidal" + real(ids_real), pointer :: toroidal(:) => null() !Toroidal component + real(ids_real), pointer :: toroidal_error_upper(:) => null() !Upper error for "toroidal" + real(ids_real), pointer :: toroidal_error_lower(:) => null() !Lower error for "toroidal" + integer(ids_int) :: toroidal_error_index=ids_int_invalid !Index in the error_description list for "toroidal" + end type + + type ids_core_profiles_vector_components_3 !Vector components in predefined directions for 1D profiles, assuming core_radial_grid 3 levels above + real(ids_real), pointer :: radial(:) => null() !Radial component + real(ids_real), pointer :: radial_error_upper(:) => null() !Upper error for "radial" + real(ids_real), pointer :: radial_error_lower(:) => null() !Lower error for "radial" + integer(ids_int) :: radial_error_index=ids_int_invalid !Index in the error_description list for "radial" + real(ids_real), pointer :: diamagnetic(:) => null() !Diamagnetic component + real(ids_real), pointer :: diamagnetic_error_upper(:) => null() !Upper error for "diamagnetic" + real(ids_real), pointer :: diamagnetic_error_lower(:) => null() !Lower error for "diamagnetic" + integer(ids_int) :: diamagnetic_error_index=ids_int_invalid !Index in the error_description list for "diamagnetic" + real(ids_real), pointer :: parallel(:) => null() !Parallel component + real(ids_real), pointer :: parallel_error_upper(:) => null() !Upper error for "parallel" + real(ids_real), pointer :: parallel_error_lower(:) => null() !Lower error for "parallel" + integer(ids_int) :: parallel_error_index=ids_int_invalid !Index in the error_description list for "parallel" + real(ids_real), pointer :: poloidal(:) => null() !Poloidal component + real(ids_real), pointer :: poloidal_error_upper(:) => null() !Upper error for "poloidal" + real(ids_real), pointer :: poloidal_error_lower(:) => null() !Lower error for "poloidal" + integer(ids_int) :: poloidal_error_index=ids_int_invalid !Index in the error_description list for "poloidal" + real(ids_real), pointer :: toroidal(:) => null() !Toroidal component + real(ids_real), pointer :: toroidal_error_upper(:) => null() !Upper error for "toroidal" + real(ids_real), pointer :: toroidal_error_lower(:) => null() !Lower error for "toroidal" + integer(ids_int) :: toroidal_error_index=ids_int_invalid !Index in the error_description list for "toroidal" + end type + + type ids_core_radial_grid !1D radial grid for core* IDSs + real(ids_real), pointer :: rho_tor_norm(:) => null() !Normalised toroidal flux coordinate. The normalizing value for rho_tor_norm, is the toroidal flux coordinate at the equilibrium bo! + !undary (LCFS or 99.x % of the LCFS in case of a fixed boundary equilibium calculation, see time_slice/boundary/b_flux_pol_norm in ! + !the equilibrium IDS) + real(ids_real), pointer :: rho_tor_norm_error_upper(:) => null() !Upper error for "rho_tor_norm" + real(ids_real), pointer :: rho_tor_norm_error_lower(:) => null() !Lower error for "rho_tor_norm" + integer(ids_int) :: rho_tor_norm_error_index=ids_int_invalid !Index in the error_description list for "rho_tor_norm" + real(ids_real), pointer :: rho_tor(:) => null() !Toroidal flux coordinate. rho_tor = sqrt(b_flux_tor/(pi*b0)) ~ sqrt(pi*r^2*b0/(pi*b0)) ~ r [m]. The toroidal field used in its def! + !inition is indicated under vacuum_toroidal_field/b0 + real(ids_real), pointer :: rho_tor_error_upper(:) => null() !Upper error for "rho_tor" + real(ids_real), pointer :: rho_tor_error_lower(:) => null() !Lower error for "rho_tor" + integer(ids_int) :: rho_tor_error_index=ids_int_invalid !Index in the error_description list for "rho_tor" + real(ids_real), pointer :: rho_pol_norm(:) => null() !Normalised poloidal flux coordinate = sqrt((psi(rho)-psi(magnetic_axis)) / (psi(LCFS)-psi(magnetic_axis))) + real(ids_real), pointer :: rho_pol_norm_error_upper(:) => null() !Upper error for "rho_pol_norm" + real(ids_real), pointer :: rho_pol_norm_error_lower(:) => null() !Lower error for "rho_pol_norm" + integer(ids_int) :: rho_pol_norm_error_index=ids_int_invalid !Index in the error_description list for "rho_pol_norm" + real(ids_real), pointer :: psi(:) => null() !Poloidal magnetic flux + real(ids_real), pointer :: psi_error_upper(:) => null() !Upper error for "psi" + real(ids_real), pointer :: psi_error_lower(:) => null() !Lower error for "psi" + integer(ids_int) :: psi_error_index=ids_int_invalid !Index in the error_description list for "psi" + real(ids_real), pointer :: volume(:) => null() !Volume enclosed inside the magnetic surface + real(ids_real), pointer :: volume_error_upper(:) => null() !Upper error for "volume" + real(ids_real), pointer :: volume_error_lower(:) => null() !Lower error for "volume" + integer(ids_int) :: volume_error_index=ids_int_invalid !Index in the error_description list for "volume" + real(ids_real), pointer :: area(:) => null() !Cross-sectional area of the flux surface + real(ids_real), pointer :: area_error_upper(:) => null() !Upper error for "area" + real(ids_real), pointer :: area_error_lower(:) => null() !Lower error for "area" + integer(ids_int) :: area_error_index=ids_int_invalid !Index in the error_description list for "area" + real(ids_real), pointer :: surface(:) => null() !Surface area of the toroidal flux surface + real(ids_real), pointer :: surface_error_upper(:) => null() !Upper error for "surface" + real(ids_real), pointer :: surface_error_lower(:) => null() !Lower error for "surface" + integer(ids_int) :: surface_error_index=ids_int_invalid !Index in the error_description list for "surface" + real(ids_real) :: psi_magnetic_axis=ids_real_invalid !Value of the poloidal magnetic flux at the magnetic axis (useful to normalize the psi array values when the radial grid doesn't go! + ! from the magnetic axis to the plasma boundary) + real(ids_real) :: psi_magnetic_axis_error_upper=ids_real_invalid !Upper error for "psi_magnetic_axis" + real(ids_real) :: psi_magnetic_axis_error_lower=ids_real_invalid !Lower error for "psi_magnetic_axis" + integer(ids_int) :: psi_magnetic_axis_error_index=ids_int_invalid !Index in the error_description list for "psi_magnetic_axis" + real(ids_real) :: psi_boundary=ids_real_invalid !Value of the poloidal magnetic flux at the plasma boundary (useful to normalize the psi array values when the radial grid doesn't ! + !go from the magnetic axis to the plasma boundary) + real(ids_real) :: psi_boundary_error_upper=ids_real_invalid !Upper error for "psi_boundary" + real(ids_real) :: psi_boundary_error_lower=ids_real_invalid !Lower error for "psi_boundary" + integer(ids_int) :: psi_boundary_error_index=ids_int_invalid !Index in the error_description list for "psi_boundary" + end type + + type ids_core_profiles_1D_fit !Core profile fit information + real(ids_real), pointer :: measured(:) => null() !Measured values + real(ids_real), pointer :: measured_error_upper(:) => null() !Upper error for "measured" + real(ids_real), pointer :: measured_error_lower(:) => null() !Lower error for "measured" + integer(ids_int) :: measured_error_index=ids_int_invalid !Index in the error_description list for "measured" + character(len=ids_string_length), dimension(:), pointer :: source => null() !Path to the source data for each measurement in the IMAS data dictionary, e.g. ece/channel(i)/t_e for the electron temperature on ! + !the i-th channel in the ECE IDS + real(ids_real), pointer :: time_measurement(:) => null() !Exact time slices used from the time array of the measurement source data. If the time slice does not exist in the time array of t! + !he source data, it means linear interpolation has been used + real(ids_real), pointer :: time_measurement_error_upper(:) => null() !Upper error for "time_measurement" + real(ids_real), pointer :: time_measurement_error_lower(:) => null() !Lower error for "time_measurement" + integer(ids_int) :: time_measurement_error_index=ids_int_invalid !Index in the error_description list for "time_measurement" + type(ids_identifier_dynamic_aos3) :: time_measurement_slice_method !Method used to slice the data : index = 0 means using exact time slice of the measurement, 1 means linear interpolation, ... + real(ids_real), pointer :: time_measurement_width(:) => null() !In case the measurements are averaged over a time interval, this node is the full width of this time interval (empty otherwise). I! + !n case the slicing/averaging method doesn't use a hard time interval cutoff, this width is the characteristic time span of the sli! + !cing/averaging method. By convention, the time interval starts at time_measurement-time_width and ends at time_measurement. + real(ids_real), pointer :: time_measurement_width_error_upper(:) => null() !Upper error for "time_measurement_width" + real(ids_real), pointer :: time_measurement_width_error_lower(:) => null() !Lower error for "time_measurement_width" + integer(ids_int) :: time_measurement_width_error_index=ids_int_invalid !Index in the error_description list for "time_measurement_width" + integer(ids_int), pointer :: local(:) => null() !Integer flag : 1 means local measurement, 0 means line-integrated measurement + real(ids_real), pointer :: rho_tor_norm(:) => null() !Normalised toroidal flux coordinate of each measurement (local value for a local measurement, minimum value reached by the line of! + ! sight for a line measurement) + real(ids_real), pointer :: rho_tor_norm_error_upper(:) => null() !Upper error for "rho_tor_norm" + real(ids_real), pointer :: rho_tor_norm_error_lower(:) => null() !Lower error for "rho_tor_norm" + integer(ids_int) :: rho_tor_norm_error_index=ids_int_invalid !Index in the error_description list for "rho_tor_norm" + real(ids_real), pointer :: weight(:) => null() !Weight given to each measured value + real(ids_real), pointer :: weight_error_upper(:) => null() !Upper error for "weight" + real(ids_real), pointer :: weight_error_lower(:) => null() !Lower error for "weight" + integer(ids_int) :: weight_error_index=ids_int_invalid !Index in the error_description list for "weight" + real(ids_real), pointer :: reconstructed(:) => null() !Value reconstructed from the fit + real(ids_real), pointer :: reconstructed_error_upper(:) => null() !Upper error for "reconstructed" + real(ids_real), pointer :: reconstructed_error_lower(:) => null() !Lower error for "reconstructed" + integer(ids_int) :: reconstructed_error_index=ids_int_invalid !Index in the error_description list for "reconstructed" + real(ids_real), pointer :: chi_squared(:) => null() !Squared error normalized by the weighted standard deviation considered in the minimization process : chi_squared = weight^2 *(reco! + !nstructed - measured)^2 / sigma^2, where sigma is the standard deviation of the measurement error + real(ids_real), pointer :: chi_squared_error_upper(:) => null() !Upper error for "chi_squared" + real(ids_real), pointer :: chi_squared_error_lower(:) => null() !Lower error for "chi_squared" + integer(ids_int) :: chi_squared_error_index=ids_int_invalid !Index in the error_description list for "chi_squared" + character(len=ids_string_length), dimension(:), pointer :: parameters => null() !List of the fit specific parameters in XML format + end type + + type ids_core_profiles_ions_charge_states2 !Quantities related to the a given state of the ion species + real(ids_real) :: z_min=ids_real_invalid !Minimum Z of the charge state bundle + real(ids_real) :: z_min_error_upper=ids_real_invalid !Upper error for "z_min" + real(ids_real) :: z_min_error_lower=ids_real_invalid !Lower error for "z_min" + integer(ids_int) :: z_min_error_index=ids_int_invalid !Index in the error_description list for "z_min" + real(ids_real) :: z_max=ids_real_invalid !Maximum Z of the charge state bundle (equal to z_min if no bundle) + real(ids_real) :: z_max_error_upper=ids_real_invalid !Upper error for "z_max" + real(ids_real) :: z_max_error_lower=ids_real_invalid !Lower error for "z_max" + integer(ids_int) :: z_max_error_index=ids_int_invalid !Index in the error_description list for "z_max" + real(ids_real) :: z_average=ids_real_invalid !Average Z of the charge state bundle, volume averaged over the plasma radius (equal to z_min if no bundle), = sum (Z*x_z) where x_! + !z is the relative concentration of a given charge state in the bundle, i.e. sum(x_z) = 1 over the bundle. + real(ids_real) :: z_average_error_upper=ids_real_invalid !Upper error for "z_average" + real(ids_real) :: z_average_error_lower=ids_real_invalid !Lower error for "z_average" + integer(ids_int) :: z_average_error_index=ids_int_invalid !Index in the error_description list for "z_average" + real(ids_real) :: z_square_average=ids_real_invalid !Average Z square of the charge state bundle, volume averaged over the plasma radius (equal to z_min squared if no bundle), = sum (! + !Z^2*x_z) where x_z is the relative concentration of a given charge state in the bundle, i.e. sum(x_z) = 1 over the bundle. + real(ids_real) :: z_square_average_error_upper=ids_real_invalid !Upper error for "z_square_average" + real(ids_real) :: z_square_average_error_lower=ids_real_invalid !Lower error for "z_square_average" + integer(ids_int) :: z_square_average_error_index=ids_int_invalid !Index in the error_description list for "z_square_average" + real(ids_real), pointer :: z_average_1d(:) => null() !Average charge profile of the charge state bundle (equal to z_min if no bundle), = sum (Z*x_z) where x_z is the relative concentra! + !tion of a given charge state in the bundle, i.e. sum(x_z) = 1 over the bundle. + real(ids_real), pointer :: z_average_1d_error_upper(:) => null() !Upper error for "z_average_1d" + real(ids_real), pointer :: z_average_1d_error_lower(:) => null() !Lower error for "z_average_1d" + integer(ids_int) :: z_average_1d_error_index=ids_int_invalid !Index in the error_description list for "z_average_1d" + real(ids_real), pointer :: z_average_square_1d(:) => null() !Average square charge profile of the charge state bundle (equal to z_min squared if no bundle), = sum (Z^2*x_z) where x_z is the r! + !elative concentration of a given charge state in the bundle, i.e. sum(x_z) = 1 over the bundle. + real(ids_real), pointer :: z_average_square_1d_error_upper(:) => null() !Upper error for "z_average_square_1d" + real(ids_real), pointer :: z_average_square_1d_error_lower(:) => null() !Lower error for "z_average_square_1d" + integer(ids_int) :: z_average_square_1d_error_index=ids_int_invalid !Index in the error_description list for "z_average_square_1d" + real(ids_real) :: ionisation_potential=ids_real_invalid !Cumulative and average ionisation potential to reach a given bundle. Defined as sum (x_z* (sum of Epot from z'=0 to z-1)), where E! + !pot is the ionisation potential of ion Xz’+, and x_z is the relative concentration of a given charge state in the bundle, i.e. sum! + !(x_z) = 1 over the bundle. + real(ids_real) :: ionisation_potential_error_upper=ids_real_invalid !Upper error for "ionisation_potential" + real(ids_real) :: ionisation_potential_error_lower=ids_real_invalid !Lower error for "ionisation_potential" + integer(ids_int) :: ionisation_potential_error_index=ids_int_invalid !Index in the error_description list for "ionisation_potential" + character(len=ids_string_length), dimension(:), pointer :: label => null() !String identifying state (e.g. C+, C+2 , C+3, C+4, C+5, C+6, ...) + character(len=ids_string_length), dimension(:), pointer :: electron_configuration => null() !Configuration of atomic orbitals of this state, e.g. 1s2-2s1 + real(ids_real) :: vibrational_level=ids_real_invalid !Vibrational level (can be bundled) + real(ids_real) :: vibrational_level_error_upper=ids_real_invalid !Upper error for "vibrational_level" + real(ids_real) :: vibrational_level_error_lower=ids_real_invalid !Lower error for "vibrational_level" + integer(ids_int) :: vibrational_level_error_index=ids_int_invalid !Index in the error_description list for "vibrational_level" + character(len=ids_string_length), dimension(:), pointer :: vibrational_mode => null() !Vibrational mode of this state, e.g. "A_g". Need to define, or adopt a standard nomenclature. + type(ids_core_profiles_vector_components_3) :: velocity !Velocity + real(ids_real), pointer :: rotation_frequency_tor(:) => null() !Toroidal rotation frequency (i.e. toroidal velocity divided by the major radius at which the toroidal velocity is taken) + real(ids_real), pointer :: rotation_frequency_tor_error_upper(:) => null() !Upper error for "rotation_frequency_tor" + real(ids_real), pointer :: rotation_frequency_tor_error_lower(:) => null() !Lower error for "rotation_frequency_tor" + integer(ids_int) :: rotation_frequency_tor_error_index=ids_int_invalid !Index in the error_description list for "rotation_frequency_tor" + real(ids_real), pointer :: temperature(:) => null() !Temperature + real(ids_real), pointer :: temperature_error_upper(:) => null() !Upper error for "temperature" + real(ids_real), pointer :: temperature_error_lower(:) => null() !Lower error for "temperature" + integer(ids_int) :: temperature_error_index=ids_int_invalid !Index in the error_description list for "temperature" + real(ids_real), pointer :: density(:) => null() !Density (thermal+non-thermal) + real(ids_real), pointer :: density_error_upper(:) => null() !Upper error for "density" + real(ids_real), pointer :: density_error_lower(:) => null() !Lower error for "density" + integer(ids_int) :: density_error_index=ids_int_invalid !Index in the error_description list for "density" + type(ids_core_profiles_1D_fit) :: density_fit !Information on the fit used to obtain the density profile + real(ids_real), pointer :: density_thermal(:) => null() !Density of thermal particles + real(ids_real), pointer :: density_thermal_error_upper(:) => null() !Upper error for "density_thermal" + real(ids_real), pointer :: density_thermal_error_lower(:) => null() !Lower error for "density_thermal" + integer(ids_int) :: density_thermal_error_index=ids_int_invalid !Index in the error_description list for "density_thermal" + real(ids_real), pointer :: density_fast(:) => null() !Density of fast (non-thermal) particles + real(ids_real), pointer :: density_fast_error_upper(:) => null() !Upper error for "density_fast" + real(ids_real), pointer :: density_fast_error_lower(:) => null() !Lower error for "density_fast" + integer(ids_int) :: density_fast_error_index=ids_int_invalid !Index in the error_description list for "density_fast" + real(ids_real), pointer :: pressure(:) => null() !Pressure (thermal+non-thermal) + real(ids_real), pointer :: pressure_error_upper(:) => null() !Upper error for "pressure" + real(ids_real), pointer :: pressure_error_lower(:) => null() !Lower error for "pressure" + integer(ids_int) :: pressure_error_index=ids_int_invalid !Index in the error_description list for "pressure" + real(ids_real), pointer :: pressure_thermal(:) => null() !Pressure (thermal) associated with random motion ~average((v-average(v))^2) + real(ids_real), pointer :: pressure_thermal_error_upper(:) => null() !Upper error for "pressure_thermal" + real(ids_real), pointer :: pressure_thermal_error_lower(:) => null() !Lower error for "pressure_thermal" + integer(ids_int) :: pressure_thermal_error_index=ids_int_invalid !Index in the error_description list for "pressure_thermal" + real(ids_real), pointer :: pressure_fast_perpendicular(:) => null() !Fast (non-thermal) perpendicular pressure + real(ids_real), pointer :: pressure_fast_perpendicular_error_upper(:) => null() !Upper error for "pressure_fast_perpendicular" + real(ids_real), pointer :: pressure_fast_perpendicular_error_lower(:) => null() !Lower error for "pressure_fast_perpendicular" + integer(ids_int) :: pressure_fast_perpendicular_error_index=ids_int_invalid !Index in the error_description list for "pressure_fast_perpendicular" + real(ids_real), pointer :: pressure_fast_parallel(:) => null() !Fast (non-thermal) parallel pressure + real(ids_real), pointer :: pressure_fast_parallel_error_upper(:) => null() !Upper error for "pressure_fast_parallel" + real(ids_real), pointer :: pressure_fast_parallel_error_lower(:) => null() !Lower error for "pressure_fast_parallel" + integer(ids_int) :: pressure_fast_parallel_error_index=ids_int_invalid !Index in the error_description list for "pressure_fast_parallel" + end type + + type ids_core_profile_ions !Quantities related to a given ion species + type(ids_plasma_composition_neutral_element), pointer :: element(:) => null() !List of elements forming the atom or molecule + real(ids_real) :: z_ion=ids_real_invalid !Ion charge (of the dominant ionisation state; lumped ions are allowed), volume averaged over plasma radius + real(ids_real) :: z_ion_error_upper=ids_real_invalid !Upper error for "z_ion" + real(ids_real) :: z_ion_error_lower=ids_real_invalid !Lower error for "z_ion" + integer(ids_int) :: z_ion_error_index=ids_int_invalid !Index in the error_description list for "z_ion" + character(len=ids_string_length), dimension(:), pointer :: label => null() !String identifying ion (e.g. H, D, T, He, C, D2, ...) + integer(ids_int) :: neutral_index=ids_int_invalid !Index of the corresponding neutral species in the ../../neutral array + real(ids_real), pointer :: z_ion_1d(:) => null() !Average charge of the ion species (sum of states charge weighted by state density and divided by ion density) + real(ids_real), pointer :: z_ion_1d_error_upper(:) => null() !Upper error for "z_ion_1d" + real(ids_real), pointer :: z_ion_1d_error_lower(:) => null() !Lower error for "z_ion_1d" + integer(ids_int) :: z_ion_1d_error_index=ids_int_invalid !Index in the error_description list for "z_ion_1d" + real(ids_real), pointer :: z_ion_square_1d(:) => null() !Average square charge of the ion species (sum of states square charge weighted by state density and divided by ion density) + real(ids_real), pointer :: z_ion_square_1d_error_upper(:) => null() !Upper error for "z_ion_square_1d" + real(ids_real), pointer :: z_ion_square_1d_error_lower(:) => null() !Lower error for "z_ion_square_1d" + integer(ids_int) :: z_ion_square_1d_error_index=ids_int_invalid !Index in the error_description list for "z_ion_square_1d" + real(ids_real), pointer :: temperature(:) => null() !Temperature (average over charge states when multiple charge states are considered) + real(ids_real), pointer :: temperature_error_upper(:) => null() !Upper error for "temperature" + real(ids_real), pointer :: temperature_error_lower(:) => null() !Lower error for "temperature" + integer(ids_int) :: temperature_error_index=ids_int_invalid !Index in the error_description list for "temperature" + integer(ids_int) :: temperature_validity=ids_int_invalid !Indicator of the validity of the temperature profile. 0: valid from automated processing, 1: valid and certified by the RO; - 1 me! + !ans problem identified in the data processing (request verification by the RO), -2: invalid data, should not be used + type(ids_core_profiles_1D_fit) :: temperature_fit !Information on the fit used to obtain the temperature profile + real(ids_real), pointer :: density(:) => null() !Density (thermal+non-thermal) (sum over charge states when multiple charge states are considered) + real(ids_real), pointer :: density_error_upper(:) => null() !Upper error for "density" + real(ids_real), pointer :: density_error_lower(:) => null() !Lower error for "density" + integer(ids_int) :: density_error_index=ids_int_invalid !Index in the error_description list for "density" + integer(ids_int) :: density_validity=ids_int_invalid !Indicator of the validity of the density profile. 0: valid from automated processing, 1: valid and certified by the RO; - 1 means ! + !problem identified in the data processing (request verification by the RO), -2: invalid data, should not be used + type(ids_core_profiles_1D_fit) :: density_fit !Information on the fit used to obtain the density profile + real(ids_real), pointer :: density_thermal(:) => null() !Density (thermal) (sum over charge states when multiple charge states are considered) + real(ids_real), pointer :: density_thermal_error_upper(:) => null() !Upper error for "density_thermal" + real(ids_real), pointer :: density_thermal_error_lower(:) => null() !Lower error for "density_thermal" + integer(ids_int) :: density_thermal_error_index=ids_int_invalid !Index in the error_description list for "density_thermal" + real(ids_real), pointer :: density_fast(:) => null() !Density of fast (non-thermal) particles (sum over charge states when multiple charge states are considered) + real(ids_real), pointer :: density_fast_error_upper(:) => null() !Upper error for "density_fast" + real(ids_real), pointer :: density_fast_error_lower(:) => null() !Lower error for "density_fast" + integer(ids_int) :: density_fast_error_index=ids_int_invalid !Index in the error_description list for "density_fast" + real(ids_real), pointer :: pressure(:) => null() !Pressure (thermal+non-thermal) (sum over charge states when multiple charge states are considered) + real(ids_real), pointer :: pressure_error_upper(:) => null() !Upper error for "pressure" + real(ids_real), pointer :: pressure_error_lower(:) => null() !Lower error for "pressure" + integer(ids_int) :: pressure_error_index=ids_int_invalid !Index in the error_description list for "pressure" + real(ids_real), pointer :: pressure_thermal(:) => null() !Pressure (thermal) associated with random motion ~average((v-average(v))^2) (sum over charge states when multiple charge states ar! + !e considered) + real(ids_real), pointer :: pressure_thermal_error_upper(:) => null() !Upper error for "pressure_thermal" + real(ids_real), pointer :: pressure_thermal_error_lower(:) => null() !Lower error for "pressure_thermal" + integer(ids_int) :: pressure_thermal_error_index=ids_int_invalid !Index in the error_description list for "pressure_thermal" + real(ids_real), pointer :: pressure_fast_perpendicular(:) => null() !Fast (non-thermal) perpendicular pressure (sum over charge states when multiple charge states are considered) + real(ids_real), pointer :: pressure_fast_perpendicular_error_upper(:) => null() !Upper error for "pressure_fast_perpendicular" + real(ids_real), pointer :: pressure_fast_perpendicular_error_lower(:) => null() !Lower error for "pressure_fast_perpendicular" + integer(ids_int) :: pressure_fast_perpendicular_error_index=ids_int_invalid !Index in the error_description list for "pressure_fast_perpendicular" + real(ids_real), pointer :: pressure_fast_parallel(:) => null() !Fast (non-thermal) parallel pressure (sum over charge states when multiple charge states are considered) + real(ids_real), pointer :: pressure_fast_parallel_error_upper(:) => null() !Upper error for "pressure_fast_parallel" + real(ids_real), pointer :: pressure_fast_parallel_error_lower(:) => null() !Lower error for "pressure_fast_parallel" + integer(ids_int) :: pressure_fast_parallel_error_index=ids_int_invalid !Index in the error_description list for "pressure_fast_parallel" + real(ids_real), pointer :: velocity_tor(:) => null() !Toroidal velocity (average over charge states when multiple charge states are considered) + real(ids_real), pointer :: velocity_tor_error_upper(:) => null() !Upper error for "velocity_tor" + real(ids_real), pointer :: velocity_tor_error_lower(:) => null() !Lower error for "velocity_tor" + integer(ids_int) :: velocity_tor_error_index=ids_int_invalid !Index in the error_description list for "velocity_tor" + real(ids_real), pointer :: velocity_pol(:) => null() !Poloidal velocity (average over charge states when multiple charge states are considered) + real(ids_real), pointer :: velocity_pol_error_upper(:) => null() !Upper error for "velocity_pol" + real(ids_real), pointer :: velocity_pol_error_lower(:) => null() !Lower error for "velocity_pol" + integer(ids_int) :: velocity_pol_error_index=ids_int_invalid !Index in the error_description list for "velocity_pol" + real(ids_real), pointer :: rotation_frequency_tor(:) => null() !Toroidal rotation frequency (i.e. toroidal velocity divided by the major radius at which the toroidal velocity is taken) (average! + ! over charge states when multiple charge states are considered) + real(ids_real), pointer :: rotation_frequency_tor_error_upper(:) => null() !Upper error for "rotation_frequency_tor" + real(ids_real), pointer :: rotation_frequency_tor_error_lower(:) => null() !Lower error for "rotation_frequency_tor" + integer(ids_int) :: rotation_frequency_tor_error_index=ids_int_invalid !Index in the error_description list for "rotation_frequency_tor" + type(ids_core_profiles_vector_components_2) :: velocity !Velocity (average over charge states when multiple charge states are considered) at the position of maximum major radius on every ! + !flux surface + integer(ids_int) :: multiple_states_flag=ids_int_invalid !Multiple states calculation flag : 0-Only the 'ion' level is considered and the 'state' array of structure is empty; 1-Ion states ! + !are considered and are described in the 'state' array of structure + type(ids_core_profiles_ions_charge_states2), pointer :: state(:) => null() !Quantities related to the different states of the species (ionisation, energy, excitation, ...) + end type + + type ids_core_profiles_neutral_state !Quantities related to the a given state of the neutral species + character(len=ids_string_length), dimension(:), pointer :: label => null() !String identifying state + character(len=ids_string_length), dimension(:), pointer :: electron_configuration => null() !Configuration of atomic orbitals of this state, e.g. 1s2-2s1 + real(ids_real) :: vibrational_level=ids_real_invalid !Vibrational level (can be bundled) + real(ids_real) :: vibrational_level_error_upper=ids_real_invalid !Upper error for "vibrational_level" + real(ids_real) :: vibrational_level_error_lower=ids_real_invalid !Lower error for "vibrational_level" + integer(ids_int) :: vibrational_level_error_index=ids_int_invalid !Index in the error_description list for "vibrational_level" + character(len=ids_string_length), dimension(:), pointer :: vibrational_mode => null() !Vibrational mode of this state, e.g. "A_g". Need to define, or adopt a standard nomenclature. + type(ids_identifier_dynamic_aos3) :: neutral_type !Neutral type (if the considered state is a neutral), in terms of energy. ID =1: cold; 2: thermal; 3: fast; 4: NBI + type(ids_core_profiles_vector_components_3) :: velocity !Velocity + real(ids_real), pointer :: temperature(:) => null() !Temperature + real(ids_real), pointer :: temperature_error_upper(:) => null() !Upper error for "temperature" + real(ids_real), pointer :: temperature_error_lower(:) => null() !Lower error for "temperature" + integer(ids_int) :: temperature_error_index=ids_int_invalid !Index in the error_description list for "temperature" + real(ids_real), pointer :: density(:) => null() !Density (thermal+non-thermal) + real(ids_real), pointer :: density_error_upper(:) => null() !Upper error for "density" + real(ids_real), pointer :: density_error_lower(:) => null() !Lower error for "density" + integer(ids_int) :: density_error_index=ids_int_invalid !Index in the error_description list for "density" + real(ids_real), pointer :: density_thermal(:) => null() !Density of thermal particles + real(ids_real), pointer :: density_thermal_error_upper(:) => null() !Upper error for "density_thermal" + real(ids_real), pointer :: density_thermal_error_lower(:) => null() !Lower error for "density_thermal" + integer(ids_int) :: density_thermal_error_index=ids_int_invalid !Index in the error_description list for "density_thermal" + real(ids_real), pointer :: density_fast(:) => null() !Density of fast (non-thermal) particles + real(ids_real), pointer :: density_fast_error_upper(:) => null() !Upper error for "density_fast" + real(ids_real), pointer :: density_fast_error_lower(:) => null() !Lower error for "density_fast" + integer(ids_int) :: density_fast_error_index=ids_int_invalid !Index in the error_description list for "density_fast" + real(ids_real), pointer :: pressure(:) => null() !Pressure (thermal+non-thermal) + real(ids_real), pointer :: pressure_error_upper(:) => null() !Upper error for "pressure" + real(ids_real), pointer :: pressure_error_lower(:) => null() !Lower error for "pressure" + integer(ids_int) :: pressure_error_index=ids_int_invalid !Index in the error_description list for "pressure" + real(ids_real), pointer :: pressure_thermal(:) => null() !Pressure (thermal) associated with random motion ~average((v-average(v))^2) + real(ids_real), pointer :: pressure_thermal_error_upper(:) => null() !Upper error for "pressure_thermal" + real(ids_real), pointer :: pressure_thermal_error_lower(:) => null() !Lower error for "pressure_thermal" + integer(ids_int) :: pressure_thermal_error_index=ids_int_invalid !Index in the error_description list for "pressure_thermal" + real(ids_real), pointer :: pressure_fast_perpendicular(:) => null() !Fast (non-thermal) perpendicular pressure + real(ids_real), pointer :: pressure_fast_perpendicular_error_upper(:) => null() !Upper error for "pressure_fast_perpendicular" + real(ids_real), pointer :: pressure_fast_perpendicular_error_lower(:) => null() !Lower error for "pressure_fast_perpendicular" + integer(ids_int) :: pressure_fast_perpendicular_error_index=ids_int_invalid !Index in the error_description list for "pressure_fast_perpendicular" + real(ids_real), pointer :: pressure_fast_parallel(:) => null() !Fast (non-thermal) parallel pressure + real(ids_real), pointer :: pressure_fast_parallel_error_upper(:) => null() !Upper error for "pressure_fast_parallel" + real(ids_real), pointer :: pressure_fast_parallel_error_lower(:) => null() !Lower error for "pressure_fast_parallel" + integer(ids_int) :: pressure_fast_parallel_error_index=ids_int_invalid !Index in the error_description list for "pressure_fast_parallel" + end type + + type ids_core_profile_neutral !Quantities related to a given neutral species + type(ids_plasma_composition_neutral_element), pointer :: element(:) => null() !List of elements forming the atom or molecule + character(len=ids_string_length), dimension(:), pointer :: label => null() !String identifying the species (e.g. H, D, T, He, C, D2, DT, CD4, ...) + integer(ids_int) :: ion_index=ids_int_invalid !Index of the corresponding ion species in the ../../ion array + real(ids_real), pointer :: temperature(:) => null() !Temperature (average over charge states when multiple charge states are considered) + real(ids_real), pointer :: temperature_error_upper(:) => null() !Upper error for "temperature" + real(ids_real), pointer :: temperature_error_lower(:) => null() !Lower error for "temperature" + integer(ids_int) :: temperature_error_index=ids_int_invalid !Index in the error_description list for "temperature" + real(ids_real), pointer :: density(:) => null() !Density (thermal+non-thermal) (sum over charge states when multiple charge states are considered) + real(ids_real), pointer :: density_error_upper(:) => null() !Upper error for "density" + real(ids_real), pointer :: density_error_lower(:) => null() !Lower error for "density" + integer(ids_int) :: density_error_index=ids_int_invalid !Index in the error_description list for "density" + real(ids_real), pointer :: density_thermal(:) => null() !Density (thermal) (sum over charge states when multiple charge states are considered) + real(ids_real), pointer :: density_thermal_error_upper(:) => null() !Upper error for "density_thermal" + real(ids_real), pointer :: density_thermal_error_lower(:) => null() !Lower error for "density_thermal" + integer(ids_int) :: density_thermal_error_index=ids_int_invalid !Index in the error_description list for "density_thermal" + real(ids_real), pointer :: density_fast(:) => null() !Density of fast (non-thermal) particles (sum over charge states when multiple charge states are considered) + real(ids_real), pointer :: density_fast_error_upper(:) => null() !Upper error for "density_fast" + real(ids_real), pointer :: density_fast_error_lower(:) => null() !Lower error for "density_fast" + integer(ids_int) :: density_fast_error_index=ids_int_invalid !Index in the error_description list for "density_fast" + real(ids_real), pointer :: pressure(:) => null() !Pressure (thermal+non-thermal) (sum over charge states when multiple charge states are considered) + real(ids_real), pointer :: pressure_error_upper(:) => null() !Upper error for "pressure" + real(ids_real), pointer :: pressure_error_lower(:) => null() !Lower error for "pressure" + integer(ids_int) :: pressure_error_index=ids_int_invalid !Index in the error_description list for "pressure" + real(ids_real), pointer :: pressure_thermal(:) => null() !Pressure (thermal) associated with random motion ~average((v-average(v))^2) (sum over charge states when multiple charge states ar! + !e considered) + real(ids_real), pointer :: pressure_thermal_error_upper(:) => null() !Upper error for "pressure_thermal" + real(ids_real), pointer :: pressure_thermal_error_lower(:) => null() !Lower error for "pressure_thermal" + integer(ids_int) :: pressure_thermal_error_index=ids_int_invalid !Index in the error_description list for "pressure_thermal" + real(ids_real), pointer :: pressure_fast_perpendicular(:) => null() !Fast (non-thermal) perpendicular pressure (sum over charge states when multiple charge states are considered) + real(ids_real), pointer :: pressure_fast_perpendicular_error_upper(:) => null() !Upper error for "pressure_fast_perpendicular" + real(ids_real), pointer :: pressure_fast_perpendicular_error_lower(:) => null() !Lower error for "pressure_fast_perpendicular" + integer(ids_int) :: pressure_fast_perpendicular_error_index=ids_int_invalid !Index in the error_description list for "pressure_fast_perpendicular" + real(ids_real), pointer :: pressure_fast_parallel(:) => null() !Fast (non-thermal) parallel pressure (sum over charge states when multiple charge states are considered) + real(ids_real), pointer :: pressure_fast_parallel_error_upper(:) => null() !Upper error for "pressure_fast_parallel" + real(ids_real), pointer :: pressure_fast_parallel_error_lower(:) => null() !Lower error for "pressure_fast_parallel" + integer(ids_int) :: pressure_fast_parallel_error_index=ids_int_invalid !Index in the error_description list for "pressure_fast_parallel" + type(ids_core_profiles_vector_components_2) :: velocity !Velocity (average over charge states when multiple charge states are considered) + integer(ids_int) :: multiple_states_flag=ids_int_invalid !Multiple states calculation flag : 0-Only one state is considered; 1-Multiple states are considered and are described in the state! + ! structure + type(ids_core_profiles_neutral_state), pointer :: state(:) => null() !Quantities related to the different states of the species (energy, excitation, ...) + end type + + type ids_core_profiles_profiles_1d_electrons !Quantities related to electrons + real(ids_real), pointer :: temperature(:) => null() !Temperature + real(ids_real), pointer :: temperature_error_upper(:) => null() !Upper error for "temperature" + real(ids_real), pointer :: temperature_error_lower(:) => null() !Lower error for "temperature" + integer(ids_int) :: temperature_error_index=ids_int_invalid !Index in the error_description list for "temperature" + integer(ids_int) :: temperature_validity=ids_int_invalid !Indicator of the validity of the temperature profile. 0: valid from automated processing, 1: valid and certified by the RO; - 1 me! + !ans problem identified in the data processing (request verification by the RO), -2: invalid data, should not be used + type(ids_core_profiles_1D_fit) :: temperature_fit !Information on the fit used to obtain the temperature profile + real(ids_real), pointer :: density(:) => null() !Density (thermal+non-thermal) + real(ids_real), pointer :: density_error_upper(:) => null() !Upper error for "density" + real(ids_real), pointer :: density_error_lower(:) => null() !Lower error for "density" + integer(ids_int) :: density_error_index=ids_int_invalid !Index in the error_description list for "density" + integer(ids_int) :: density_validity=ids_int_invalid !Indicator of the validity of the density profile. 0: valid from automated processing, 1: valid and certified by the RO; - 1 means ! + !problem identified in the data processing (request verification by the RO), -2: invalid data, should not be used + type(ids_core_profiles_1D_fit) :: density_fit !Information on the fit used to obtain the density profile + real(ids_real), pointer :: density_thermal(:) => null() !Density of thermal particles + real(ids_real), pointer :: density_thermal_error_upper(:) => null() !Upper error for "density_thermal" + real(ids_real), pointer :: density_thermal_error_lower(:) => null() !Lower error for "density_thermal" + integer(ids_int) :: density_thermal_error_index=ids_int_invalid !Index in the error_description list for "density_thermal" + real(ids_real), pointer :: density_fast(:) => null() !Density of fast (non-thermal) particles + real(ids_real), pointer :: density_fast_error_upper(:) => null() !Upper error for "density_fast" + real(ids_real), pointer :: density_fast_error_lower(:) => null() !Lower error for "density_fast" + integer(ids_int) :: density_fast_error_index=ids_int_invalid !Index in the error_description list for "density_fast" + real(ids_real), pointer :: pressure(:) => null() !Pressure (thermal+non-thermal) + real(ids_real), pointer :: pressure_error_upper(:) => null() !Upper error for "pressure" + real(ids_real), pointer :: pressure_error_lower(:) => null() !Lower error for "pressure" + integer(ids_int) :: pressure_error_index=ids_int_invalid !Index in the error_description list for "pressure" + real(ids_real), pointer :: pressure_thermal(:) => null() !Pressure (thermal) associated with random motion ~average((v-average(v))^2) + real(ids_real), pointer :: pressure_thermal_error_upper(:) => null() !Upper error for "pressure_thermal" + real(ids_real), pointer :: pressure_thermal_error_lower(:) => null() !Lower error for "pressure_thermal" + integer(ids_int) :: pressure_thermal_error_index=ids_int_invalid !Index in the error_description list for "pressure_thermal" + real(ids_real), pointer :: pressure_fast_perpendicular(:) => null() !Fast (non-thermal) perpendicular pressure + real(ids_real), pointer :: pressure_fast_perpendicular_error_upper(:) => null() !Upper error for "pressure_fast_perpendicular" + real(ids_real), pointer :: pressure_fast_perpendicular_error_lower(:) => null() !Lower error for "pressure_fast_perpendicular" + integer(ids_int) :: pressure_fast_perpendicular_error_index=ids_int_invalid !Index in the error_description list for "pressure_fast_perpendicular" + real(ids_real), pointer :: pressure_fast_parallel(:) => null() !Fast (non-thermal) parallel pressure + real(ids_real), pointer :: pressure_fast_parallel_error_upper(:) => null() !Upper error for "pressure_fast_parallel" + real(ids_real), pointer :: pressure_fast_parallel_error_lower(:) => null() !Lower error for "pressure_fast_parallel" + integer(ids_int) :: pressure_fast_parallel_error_index=ids_int_invalid !Index in the error_description list for "pressure_fast_parallel" + real(ids_real), pointer :: velocity_tor(:) => null() !Toroidal velocity + real(ids_real), pointer :: velocity_tor_error_upper(:) => null() !Upper error for "velocity_tor" + real(ids_real), pointer :: velocity_tor_error_lower(:) => null() !Lower error for "velocity_tor" + integer(ids_int) :: velocity_tor_error_index=ids_int_invalid !Index in the error_description list for "velocity_tor" + real(ids_real), pointer :: velocity_pol(:) => null() !Poloidal velocity + real(ids_real), pointer :: velocity_pol_error_upper(:) => null() !Upper error for "velocity_pol" + real(ids_real), pointer :: velocity_pol_error_lower(:) => null() !Lower error for "velocity_pol" + integer(ids_int) :: velocity_pol_error_index=ids_int_invalid !Index in the error_description list for "velocity_pol" + type(ids_core_profiles_vector_components_2) :: velocity !Velocity + real(ids_real), pointer :: collisionality_norm(:) => null() !Collisionality normalised to the bounce frequency + real(ids_real), pointer :: collisionality_norm_error_upper(:) => null() !Upper error for "collisionality_norm" + real(ids_real), pointer :: collisionality_norm_error_lower(:) => null() !Lower error for "collisionality_norm" + integer(ids_int) :: collisionality_norm_error_index=ids_int_invalid !Index in the error_description list for "collisionality_norm" + end type + + type ids_core_profiles_profiles_1d !1D radial profiles for core and edge + type(ids_core_radial_grid) :: grid !Radial grid + type(ids_core_profiles_profiles_1d_electrons) :: electrons !Quantities related to the electrons + type(ids_core_profile_ions), pointer :: ion(:) => null() !Quantities related to the different ion species, in the sense of isonuclear or isomolecular sequences. Ionisation states (or other! + ! types of states) must be differentiated at the state level below + type(ids_core_profile_neutral), pointer :: neutral(:) => null() !Quantities related to the different neutral species + real(ids_real), pointer :: t_i_average(:) => null() !Ion temperature (averaged on charge states and ion species) + real(ids_real), pointer :: t_i_average_error_upper(:) => null() !Upper error for "t_i_average" + real(ids_real), pointer :: t_i_average_error_lower(:) => null() !Lower error for "t_i_average" + integer(ids_int) :: t_i_average_error_index=ids_int_invalid !Index in the error_description list for "t_i_average" + type(ids_core_profiles_1D_fit) :: t_i_average_fit !Information on the fit used to obtain the t_i_average profile + real(ids_real), pointer :: n_i_total_over_n_e(:) => null() !Ratio of total ion density (sum over species and charge states) over electron density. (thermal+non-thermal) + real(ids_real), pointer :: n_i_total_over_n_e_error_upper(:) => null() !Upper error for "n_i_total_over_n_e" + real(ids_real), pointer :: n_i_total_over_n_e_error_lower(:) => null() !Lower error for "n_i_total_over_n_e" + integer(ids_int) :: n_i_total_over_n_e_error_index=ids_int_invalid !Index in the error_description list for "n_i_total_over_n_e" + real(ids_real), pointer :: n_i_thermal_total(:) => null() !Total ion thermal density (sum over species and charge states) + real(ids_real), pointer :: n_i_thermal_total_error_upper(:) => null() !Upper error for "n_i_thermal_total" + real(ids_real), pointer :: n_i_thermal_total_error_lower(:) => null() !Lower error for "n_i_thermal_total" + integer(ids_int) :: n_i_thermal_total_error_index=ids_int_invalid !Index in the error_description list for "n_i_thermal_total" + real(ids_real), pointer :: momentum_tor(:) => null() !Total plasma toroidal momentum, summed over ion species and electrons weighted by their density and major radius, i.e. sum_over_sp! + !ecies(n*R*m*Vphi) + real(ids_real), pointer :: momentum_tor_error_upper(:) => null() !Upper error for "momentum_tor" + real(ids_real), pointer :: momentum_tor_error_lower(:) => null() !Lower error for "momentum_tor" + integer(ids_int) :: momentum_tor_error_index=ids_int_invalid !Index in the error_description list for "momentum_tor" + real(ids_real), pointer :: zeff(:) => null() !Effective charge + real(ids_real), pointer :: zeff_error_upper(:) => null() !Upper error for "zeff" + real(ids_real), pointer :: zeff_error_lower(:) => null() !Lower error for "zeff" + integer(ids_int) :: zeff_error_index=ids_int_invalid !Index in the error_description list for "zeff" + type(ids_core_profiles_1D_fit) :: zeff_fit !Information on the fit used to obtain the zeff profile + real(ids_real), pointer :: pressure_ion_total(:) => null() !Total (sum over ion species) thermal ion pressure + real(ids_real), pointer :: pressure_ion_total_error_upper(:) => null() !Upper error for "pressure_ion_total" + real(ids_real), pointer :: pressure_ion_total_error_lower(:) => null() !Lower error for "pressure_ion_total" + integer(ids_int) :: pressure_ion_total_error_index=ids_int_invalid !Index in the error_description list for "pressure_ion_total" + real(ids_real), pointer :: pressure_thermal(:) => null() !Thermal pressure (electrons+ions) + real(ids_real), pointer :: pressure_thermal_error_upper(:) => null() !Upper error for "pressure_thermal" + real(ids_real), pointer :: pressure_thermal_error_lower(:) => null() !Lower error for "pressure_thermal" + integer(ids_int) :: pressure_thermal_error_index=ids_int_invalid !Index in the error_description list for "pressure_thermal" + real(ids_real), pointer :: pressure_perpendicular(:) => null() !Total perpendicular pressure (electrons+ions, thermal+non-thermal) + real(ids_real), pointer :: pressure_perpendicular_error_upper(:) => null() !Upper error for "pressure_perpendicular" + real(ids_real), pointer :: pressure_perpendicular_error_lower(:) => null() !Lower error for "pressure_perpendicular" + integer(ids_int) :: pressure_perpendicular_error_index=ids_int_invalid !Index in the error_description list for "pressure_perpendicular" + real(ids_real), pointer :: pressure_parallel(:) => null() !Total parallel pressure (electrons+ions, thermal+non-thermal) + real(ids_real), pointer :: pressure_parallel_error_upper(:) => null() !Upper error for "pressure_parallel" + real(ids_real), pointer :: pressure_parallel_error_lower(:) => null() !Lower error for "pressure_parallel" + integer(ids_int) :: pressure_parallel_error_index=ids_int_invalid !Index in the error_description list for "pressure_parallel" + real(ids_real), pointer :: j_total(:) => null() !Total parallel current density = average(jtot.B) / B0, where B0 = Core_Profiles/Vacuum_Toroidal_Field/ B0 + real(ids_real), pointer :: j_total_error_upper(:) => null() !Upper error for "j_total" + real(ids_real), pointer :: j_total_error_lower(:) => null() !Lower error for "j_total" + integer(ids_int) :: j_total_error_index=ids_int_invalid !Index in the error_description list for "j_total" + real(ids_real), pointer :: current_parallel_inside(:) => null() !Parallel current driven inside the flux surface. Cumulative surface integral of j_total + real(ids_real), pointer :: current_parallel_inside_error_upper(:) => null() !Upper error for "current_parallel_inside" + real(ids_real), pointer :: current_parallel_inside_error_lower(:) => null() !Lower error for "current_parallel_inside" + integer(ids_int) :: current_parallel_inside_error_index=ids_int_invalid !Index in the error_description list for "current_parallel_inside" + real(ids_real), pointer :: j_tor(:) => null() !Total toroidal current density = average(J_Tor/R) / average(1/R) + real(ids_real), pointer :: j_tor_error_upper(:) => null() !Upper error for "j_tor" + real(ids_real), pointer :: j_tor_error_lower(:) => null() !Lower error for "j_tor" + integer(ids_int) :: j_tor_error_index=ids_int_invalid !Index in the error_description list for "j_tor" + real(ids_real), pointer :: j_ohmic(:) => null() !Ohmic parallel current density = average(J_Ohmic.B) / B0, where B0 = Core_Profiles/Vacuum_Toroidal_Field/ B0 + real(ids_real), pointer :: j_ohmic_error_upper(:) => null() !Upper error for "j_ohmic" + real(ids_real), pointer :: j_ohmic_error_lower(:) => null() !Lower error for "j_ohmic" + integer(ids_int) :: j_ohmic_error_index=ids_int_invalid !Index in the error_description list for "j_ohmic" + real(ids_real), pointer :: j_non_inductive(:) => null() !Non-inductive (includes bootstrap) parallel current density = average(jni.B) / B0, where B0 = Core_Profiles/Vacuum_Toroidal_Field/! + ! B0 + real(ids_real), pointer :: j_non_inductive_error_upper(:) => null() !Upper error for "j_non_inductive" + real(ids_real), pointer :: j_non_inductive_error_lower(:) => null() !Lower error for "j_non_inductive" + integer(ids_int) :: j_non_inductive_error_index=ids_int_invalid !Index in the error_description list for "j_non_inductive" + real(ids_real), pointer :: j_bootstrap(:) => null() !Bootstrap current density = average(J_Bootstrap.B) / B0, where B0 = Core_Profiles/Vacuum_Toroidal_Field/ B0 + real(ids_real), pointer :: j_bootstrap_error_upper(:) => null() !Upper error for "j_bootstrap" + real(ids_real), pointer :: j_bootstrap_error_lower(:) => null() !Lower error for "j_bootstrap" + integer(ids_int) :: j_bootstrap_error_index=ids_int_invalid !Index in the error_description list for "j_bootstrap" + real(ids_real), pointer :: conductivity_parallel(:) => null() !Parallel conductivity + real(ids_real), pointer :: conductivity_parallel_error_upper(:) => null() !Upper error for "conductivity_parallel" + real(ids_real), pointer :: conductivity_parallel_error_lower(:) => null() !Lower error for "conductivity_parallel" + integer(ids_int) :: conductivity_parallel_error_index=ids_int_invalid !Index in the error_description list for "conductivity_parallel" + real(ids_real), pointer :: e_field_parallel(:) => null() !Parallel electric field = average(E.B) / B0, where Core_Profiles/Vacuum_Toroidal_Field/ B0 + real(ids_real), pointer :: e_field_parallel_error_upper(:) => null() !Upper error for "e_field_parallel" + real(ids_real), pointer :: e_field_parallel_error_lower(:) => null() !Lower error for "e_field_parallel" + integer(ids_int) :: e_field_parallel_error_index=ids_int_invalid !Index in the error_description list for "e_field_parallel" + type(ids_core_profiles_vector_components_1) :: e_field !Electric field, averaged on the magnetic surface. E.g for the parallel component, average(E.B) / B0, using core_profiles/vacuum_to! + !roidal_field/b0 + real(ids_real), pointer :: phi_potential(:) => null() !Electrostatic potential, averaged on the magnetic flux surface + real(ids_real), pointer :: phi_potential_error_upper(:) => null() !Upper error for "phi_potential" + real(ids_real), pointer :: phi_potential_error_lower(:) => null() !Lower error for "phi_potential" + integer(ids_int) :: phi_potential_error_index=ids_int_invalid !Index in the error_description list for "phi_potential" + real(ids_real), pointer :: rotation_frequency_tor_sonic(:) => null() !Derivative of the flux surface averaged electrostatic potential with respect to the poloidal flux, multiplied by -1. This quantity! + ! is the toroidal angular rotation frequency due to the ExB drift, introduced in formula (43) of Hinton and Wong, Physics of Fluids! + ! 3082 (1985), also referred to as sonic flow in regimes in which the toroidal velocity is dominant over the poloidal velocity + real(ids_real), pointer :: rotation_frequency_tor_sonic_error_upper(:) => null() !Upper error for "rotation_frequency_tor_sonic" + real(ids_real), pointer :: rotation_frequency_tor_sonic_error_lower(:) => null() !Lower error for "rotation_frequency_tor_sonic" + integer(ids_int) :: rotation_frequency_tor_sonic_error_index=ids_int_invalid !Index in the error_description list for "rotation_frequency_tor_sonic" + real(ids_real), pointer :: q(:) => null() !Safety factor (IMAS uses COCOS=11: only positive when toroidal current and magnetic field are in same direction) + real(ids_real), pointer :: q_error_upper(:) => null() !Upper error for "q" + real(ids_real), pointer :: q_error_lower(:) => null() !Lower error for "q" + integer(ids_int) :: q_error_index=ids_int_invalid !Index in the error_description list for "q" + real(ids_real), pointer :: magnetic_shear(:) => null() !Magnetic shear, defined as rho_tor/q . dq/drho_tor + real(ids_real), pointer :: magnetic_shear_error_upper(:) => null() !Upper error for "magnetic_shear" + real(ids_real), pointer :: magnetic_shear_error_lower(:) => null() !Lower error for "magnetic_shear" + integer(ids_int) :: magnetic_shear_error_index=ids_int_invalid !Index in the error_description list for "magnetic_shear" + real(ids_real) :: time=ids_real_invalid !Time + end type + + type ids_detector_energy_band !Detector energy band + real(ids_real) :: lower_bound=ids_real_invalid !Lower bound of the energy band + real(ids_real) :: lower_bound_error_upper=ids_real_invalid !Upper error for "lower_bound" + real(ids_real) :: lower_bound_error_lower=ids_real_invalid !Lower error for "lower_bound" + integer(ids_int) :: lower_bound_error_index=ids_int_invalid !Index in the error_description list for "lower_bound" + real(ids_real) :: upper_bound=ids_real_invalid !Upper bound of the energy band + real(ids_real) :: upper_bound_error_upper=ids_real_invalid !Upper error for "upper_bound" + real(ids_real) :: upper_bound_error_lower=ids_real_invalid !Lower error for "upper_bound" + integer(ids_int) :: upper_bound_error_index=ids_int_invalid !Index in the error_description list for "upper_bound" + real(ids_real), pointer :: energies(:) => null() !Array of discrete energy values inside the band + real(ids_real), pointer :: energies_error_upper(:) => null() !Upper error for "energies" + real(ids_real), pointer :: energies_error_lower(:) => null() !Lower error for "energies" + integer(ids_int) :: energies_error_index=ids_int_invalid !Index in the error_description list for "energies" + real(ids_real), pointer :: detection_efficiency(:) => null() !Probability of detection of a photon impacting the detector as a function of its energy + real(ids_real), pointer :: detection_efficiency_error_upper(:) => null() !Upper error for "detection_efficiency" + real(ids_real), pointer :: detection_efficiency_error_lower(:) => null() !Lower error for "detection_efficiency" + integer(ids_int) :: detection_efficiency_error_index=ids_int_invalid !Index in the error_description list for "detection_efficiency" + end type + + type ids_detector_wavelength !Detector wavelength range and detection efficiency + real(ids_real) :: wavelength_lower=ids_real_invalid !Lower bound of the detector wavelength range + real(ids_real) :: wavelength_lower_error_upper=ids_real_invalid !Upper error for "wavelength_lower" + real(ids_real) :: wavelength_lower_error_lower=ids_real_invalid !Lower error for "wavelength_lower" + integer(ids_int) :: wavelength_lower_error_index=ids_int_invalid !Index in the error_description list for "wavelength_lower" + real(ids_real) :: wavelength_upper=ids_real_invalid !Upper bound of the detector wavelength range + real(ids_real) :: wavelength_upper_error_upper=ids_real_invalid !Upper error for "wavelength_upper" + real(ids_real) :: wavelength_upper_error_lower=ids_real_invalid !Lower error for "wavelength_upper" + integer(ids_int) :: wavelength_upper_error_index=ids_int_invalid !Index in the error_description list for "wavelength_upper" + real(ids_real), pointer :: wavelengths(:) => null() !Array of wavelength values + real(ids_real), pointer :: wavelengths_error_upper(:) => null() !Upper error for "wavelengths" + real(ids_real), pointer :: wavelengths_error_lower(:) => null() !Lower error for "wavelengths" + integer(ids_int) :: wavelengths_error_index=ids_int_invalid !Index in the error_description list for "wavelengths" + real(ids_real), pointer :: detection_efficiency(:) => null() !Probability of detection of a photon impacting the detector as a function of its wavelength + real(ids_real), pointer :: detection_efficiency_error_upper(:) => null() !Upper error for "detection_efficiency" + real(ids_real), pointer :: detection_efficiency_error_lower(:) => null() !Lower error for "detection_efficiency" + integer(ids_int) :: detection_efficiency_error_index=ids_int_invalid !Index in the error_description list for "detection_efficiency" + end type + + type ids_filter_wavelength !Spectrocscopy filter wavelength range and detection efficiency + real(ids_real) :: wavelength_lower=ids_real_invalid !Lower bound of the filter wavelength range + real(ids_real) :: wavelength_lower_error_upper=ids_real_invalid !Upper error for "wavelength_lower" + real(ids_real) :: wavelength_lower_error_lower=ids_real_invalid !Lower error for "wavelength_lower" + integer(ids_int) :: wavelength_lower_error_index=ids_int_invalid !Index in the error_description list for "wavelength_lower" + real(ids_real) :: wavelength_upper=ids_real_invalid !Upper bound of the filter wavelength range + real(ids_real) :: wavelength_upper_error_upper=ids_real_invalid !Upper error for "wavelength_upper" + real(ids_real) :: wavelength_upper_error_lower=ids_real_invalid !Lower error for "wavelength_upper" + integer(ids_int) :: wavelength_upper_error_index=ids_int_invalid !Index in the error_description list for "wavelength_upper" + real(ids_real), pointer :: wavelengths(:) => null() !Array of wavelength values + real(ids_real), pointer :: wavelengths_error_upper(:) => null() !Upper error for "wavelengths" + real(ids_real), pointer :: wavelengths_error_lower(:) => null() !Lower error for "wavelengths" + integer(ids_int) :: wavelengths_error_index=ids_int_invalid !Index in the error_description list for "wavelengths" + real(ids_real), pointer :: detection_efficiency(:) => null() !Probability of detection of a photon impacting the detector as a function of its wavelength + real(ids_real), pointer :: detection_efficiency_error_upper(:) => null() !Upper error for "detection_efficiency" + real(ids_real), pointer :: detection_efficiency_error_lower(:) => null() !Lower error for "detection_efficiency" + integer(ids_int) :: detection_efficiency_error_index=ids_int_invalid !Index in the error_description list for "detection_efficiency" + end type + + type ids_distribution_markers_orbit_instant !Test particles for a given time slice : orbit integrals + character(len=ids_string_length), dimension(:), pointer :: expressions => null() !List of the expressions f(eq) used in the orbit integrals + real(ids_real), pointer :: time_orbit(:) => null() !Time array along the markers last orbit + real(ids_real), pointer :: time_orbit_error_upper(:) => null() !Upper error for "time_orbit" + real(ids_real), pointer :: time_orbit_error_lower(:) => null() !Lower error for "time_orbit" + integer(ids_int) :: time_orbit_error_index=ids_int_invalid !Index in the error_description list for "time_orbit" + complex(ids_real), pointer :: values(:,:,:) => null() !Values of the orbit integrals + complex(ids_real), pointer :: values_error_upper(:,:,:) => null() !Upper error for "values" + complex(ids_real), pointer :: values_error_lower(:,:,:) => null() !Lower error for "values" + integer(ids_int) :: values_error_index=ids_int_invalid !Index in the error_description list for "values" + end type + + type ids_distribution_markers_orbit !Test particles for a given time slice : orbit integrals + character(len=ids_string_length), dimension(:), pointer :: expressions => null() !List of the expressions f(n_tor,m_pol,k,q,...) used in the orbit integrals + integer(ids_int), pointer :: n_tor(:) => null() !Array of toroidal mode numbers, n_tor, where quantities vary as exp(i.n_tor.phi) and phi runs anticlockwise when viewed from above + integer(ids_int), pointer :: m_pol(:) => null() !Array of poloidal mode numbers, where quantities vary as exp(-i.m_pol.theta) and theta is the angle defined by the choice of ../..! + !/coordinate_identifier, with its centre at the magnetic axis recalled at the root of this IDS + integer(ids_int), pointer :: bounce_harmonics(:) => null() !Array of bounce harmonics k + complex(ids_real), pointer :: values(:,:,:,:,:) => null() !Values of the orbit integrals + complex(ids_real), pointer :: values_error_upper(:,:,:,:,:) => null() !Upper error for "values" + complex(ids_real), pointer :: values_error_lower(:,:,:,:,:) => null() !Lower error for "values" + integer(ids_int) :: values_error_index=ids_int_invalid !Index in the error_description list for "values" + end type + + type ids_distribution_markers !Test particles for a given time slice + type(ids_identifier_dynamic_aos3), pointer :: coordinate_identifier(:) => null() !Set of coordinate identifiers, coordinates on which the markers are represented + real(ids_real), pointer :: weights(:) => null() !Weight of the markers, i.e. number of real particles represented by each marker. The dimension of the vector correspond to the num! + !ber of markers + real(ids_real), pointer :: weights_error_upper(:) => null() !Upper error for "weights" + real(ids_real), pointer :: weights_error_lower(:) => null() !Lower error for "weights" + integer(ids_int) :: weights_error_index=ids_int_invalid !Index in the error_description list for "weights" + real(ids_real), pointer :: positions(:,:) => null() !Position of the markers in the set of coordinates. The first dimension corresponds to the number of markers, the second dimension ! + !to the set of coordinates + real(ids_real), pointer :: positions_error_upper(:,:) => null() !Upper error for "positions" + real(ids_real), pointer :: positions_error_lower(:,:) => null() !Lower error for "positions" + integer(ids_int) :: positions_error_index=ids_int_invalid !Index in the error_description list for "positions" + type(ids_distribution_markers_orbit) :: orbit_integrals !Integrals along the markers orbit. These dimensionless expressions are of the form: (1/tau) integral (f(n_tor,m_pol,k,eq,...) dt) ! + !from time - tau to time, where tau is the transit/trapping time of the marker and f() a dimensionless function (phase factor,drift! + !,etc) of the equilibrium (e.g. q) and perturbation (Fourier harmonics n_tor,m_pol and bounce harmonic k) along the particles orbit! + !s. In fact the integrals are taken during the last orbit of each marker at the time value of the time node below + type(ids_distribution_markers_orbit_instant) :: orbit_integrals_instant !Integrals/quantities along the markers orbit. These dimensionless expressions are of the form: (1/tau) integral ( f(eq) dt) from t! + !ime - tau to time_orbit for different values of time_orbit in the interval from time - tau to time, where tau is the transit/trapp! + !ing time of the marker and f(eq) a dimensionless function (phase, drift,q,etc) of the equilibrium along the markers orbits. The in! + !tegrals are taken during the last orbit of each marker at the time value of the time node below + integer(ids_int) :: toroidal_mode=ids_int_invalid !In case the orbit integrals are calculated for a given MHD perturbation, index of the toroidal mode considered. Refers to the time! + !_slice/toroidal_mode array of the MHD_LINEAR IDS in which this perturbation is described + real(ids_real) :: time=ids_real_invalid !Time + end type + + type ids_distribution_species !Description of a species in a distribution function related IDS + type(ids_identifier) :: type !Species type. index=1 for electron; index=2 for ion species in a single/average state (refer to ion structure); index=3 for ion sp! + !ecies in a particular state (refer to ion/state structure); index=4 for neutral species in a single/average state (refer to neutr! + !al structure); index=5 for neutral species in a particular state (refer to neutral/state structure); index=6 for neutron; index=7! + ! for photon + type(ids_plasma_composition_ions_constant) :: ion !Description of the ion or neutral species, used if type/index = 2 or 3 + type(ids_plasma_composition_neutral_constant) :: neutral !Description of the neutral species, used if type/index = 4 or 5 + end type + + type ids_distribution_process_identifier !Identifier an NBI or fusion reaction process intervening affecting a distribution function + type(ids_identifier) :: type !Process type. index=1 for NBI; index=2 for nuclear reaction (reaction unspecified); index=3 for nuclear reaction: T(d,n)4He [D+T->! + !He4+n]; index=4 for nuclear reaction: He3(d,p)4He [He3+D->He4+p]; index=5 for nuclear reaction: D(d,p)T [D+D->T+p]; index=6 for nu! + !clear reaction: D(d,n)3He [D+D->He3+n]; index=7 for runaway processes + type(ids_identifier) :: reactant_energy !For nuclear reaction source, energy of the reactants. index = 0 for a sum over all energies; index = 1 for thermal-thermal; index ! + != 2 for beam-beam; index = 3 for beam-thermal + type(ids_identifier) :: nbi_energy !For NBI source, energy of the accelerated species considered. index = 0 for a sum over all energies; index = 1 for full energiy; i! + !ndex = 2 for half energy; index = 3 for third energy + integer(ids_int) :: nbi_unit=ids_int_invalid !Index of the NBI unit considered. Refers to the "unit" array of the NBI IDS. 0 means sum over all NBI units. + integer(ids_int) :: nbi_beamlets_group=ids_int_invalid !Index of the NBI beamlets group considered. Refers to the "unit/beamlets_group" array of the NBI IDS. 0 means sum over all beamlet! + !s groups. + end type + + type ids_generic_grid_scalar_single_position !Scalar values at a single position on a generic grid (dynamic within a type 3 AoS) + integer(ids_int) :: grid_index=ids_int_invalid !Index of the grid used to represent this quantity + integer(ids_int) :: grid_subset_index=ids_int_invalid !Index of the grid subset the data is provided on + real(ids_real) :: value=ids_real_invalid !Scalar value of the quantity on the grid subset (corresponding to a single local position or to an integrated value over the subse! + !t) + real(ids_real) :: value_error_upper=ids_real_invalid !Upper error for "value" + real(ids_real) :: value_error_lower=ids_real_invalid !Lower error for "value" + integer(ids_int) :: value_error_index=ids_int_invalid !Index in the error_description list for "value" + end type + + type ids_generic_grid_scalar !Scalar values on a generic grid (dynamic within a type 3 AoS) + integer(ids_int) :: grid_index=ids_int_invalid !Index of the grid used to represent this quantity + integer(ids_int) :: grid_subset_index=ids_int_invalid !Index of the grid subset the data is provided on + real(ids_real), pointer :: values(:) => null() !One scalar value is provided per element in the grid subset. + real(ids_real), pointer :: values_error_upper(:) => null() !Upper error for "values" + real(ids_real), pointer :: values_error_lower(:) => null() !Lower error for "values" + integer(ids_int) :: values_error_index=ids_int_invalid !Index in the error_description list for "values" + real(ids_real), pointer :: coefficients(:,:) => null() !Interpolation coefficients, to be used for a high precision evaluation of the physical quantity with finite elements, provided per! + ! element in the grid subset (first dimension). + real(ids_real), pointer :: coefficients_error_upper(:,:) => null() !Upper error for "coefficients" + real(ids_real), pointer :: coefficients_error_lower(:,:) => null() !Lower error for "coefficients" + integer(ids_int) :: coefficients_error_index=ids_int_invalid !Index in the error_description list for "coefficients" + end type + + type ids_generic_grid_identifier !Identifier values on a generic grid (dynamic within a type 3 AoS) + integer(ids_int) :: grid_index=ids_int_invalid !Index of the grid used to represent this quantity + integer(ids_int) :: grid_subset_index=ids_int_invalid !Index of the grid subset the data is provided on + type(ids_identifier_dynamic_aos3_1d) :: identifiers !Identifier values, one value is provided per element in the grid subset. If the size of the child arrays is 1, their value applies! + ! to all elements of the subset. + end type + + type ids_generic_grid_vector !Vector values on a generic grid (dynamic within a type 3 AoS) + integer(ids_int) :: grid_index=ids_int_invalid !Index of the grid used to represent this quantity + integer(ids_int) :: grid_subset_index=ids_int_invalid !Index of the grid subset the data is provided on + real(ids_real), pointer :: values(:,:) => null() !List of vector components, one list per element in the grid subset. First dimenstion: element index. Second dimension: vector comp! + !onent index. + real(ids_real), pointer :: values_error_upper(:,:) => null() !Upper error for "values" + real(ids_real), pointer :: values_error_lower(:,:) => null() !Lower error for "values" + integer(ids_int) :: values_error_index=ids_int_invalid !Index in the error_description list for "values" + real(ids_real), pointer :: coefficients(:,:,:) => null() !Interpolation coefficients, to be used for a high precision evaluation of the physical quantity with finite elements, provided per! + ! element in the grid subset (first dimension). Second dimension: vector component index. Third dimension: coefficient index + real(ids_real), pointer :: coefficients_error_upper(:,:,:) => null() !Upper error for "coefficients" + real(ids_real), pointer :: coefficients_error_lower(:,:,:) => null() !Lower error for "coefficients" + integer(ids_int) :: coefficients_error_index=ids_int_invalid !Index in the error_description list for "coefficients" + end type + + type ids_generic_grid_vector_components !Vector components in predefined directions on a generic grid (dynamic within a type 3 AoS) + integer(ids_int) :: grid_index=ids_int_invalid !Index of the grid used to represent this quantity + integer(ids_int) :: grid_subset_index=ids_int_invalid !Index of the grid subset the data is provided on + real(ids_real), pointer :: radial(:) => null() !Radial component, one scalar value is provided per element in the grid subset. + real(ids_real), pointer :: radial_error_upper(:) => null() !Upper error for "radial" + real(ids_real), pointer :: radial_error_lower(:) => null() !Lower error for "radial" + integer(ids_int) :: radial_error_index=ids_int_invalid !Index in the error_description list for "radial" + real(ids_real), pointer :: radial_coefficients(:,:) => null() !Interpolation coefficients for the radial component, to be used for a high precision evaluation of the physical quantity with fini! + !te elements, provided per element in the grid subset (first dimension). + real(ids_real), pointer :: radial_coefficients_error_upper(:,:) => null() !Upper error for "radial_coefficients" + real(ids_real), pointer :: radial_coefficients_error_lower(:,:) => null() !Lower error for "radial_coefficients" + integer(ids_int) :: radial_coefficients_error_index=ids_int_invalid !Index in the error_description list for "radial_coefficients" + real(ids_real), pointer :: diamagnetic(:) => null() !Diamagnetic component, one scalar value is provided per element in the grid subset. + real(ids_real), pointer :: diamagnetic_error_upper(:) => null() !Upper error for "diamagnetic" + real(ids_real), pointer :: diamagnetic_error_lower(:) => null() !Lower error for "diamagnetic" + integer(ids_int) :: diamagnetic_error_index=ids_int_invalid !Index in the error_description list for "diamagnetic" + real(ids_real), pointer :: diamagnetic_coefficients(:,:) => null() !Interpolation coefficients for the diamagnetic component, to be used for a high precision evaluation of the physical quantity with! + ! finite elements, provided per element in the grid subset (first dimension). + real(ids_real), pointer :: diamagnetic_coefficients_error_upper(:,:) => null() !Upper error for "diamagnetic_coefficients" + real(ids_real), pointer :: diamagnetic_coefficients_error_lower(:,:) => null() !Lower error for "diamagnetic_coefficients" + integer(ids_int) :: diamagnetic_coefficients_error_index=ids_int_invalid !Index in the error_description list for "diamagnetic_coefficients" + real(ids_real), pointer :: parallel(:) => null() !Parallel component, one scalar value is provided per element in the grid subset. + real(ids_real), pointer :: parallel_error_upper(:) => null() !Upper error for "parallel" + real(ids_real), pointer :: parallel_error_lower(:) => null() !Lower error for "parallel" + integer(ids_int) :: parallel_error_index=ids_int_invalid !Index in the error_description list for "parallel" + real(ids_real), pointer :: parallel_coefficients(:,:) => null() !Interpolation coefficients for the parallel component, to be used for a high precision evaluation of the physical quantity with fi! + !nite elements, provided per element in the grid subset (first dimension). + real(ids_real), pointer :: parallel_coefficients_error_upper(:,:) => null() !Upper error for "parallel_coefficients" + real(ids_real), pointer :: parallel_coefficients_error_lower(:,:) => null() !Lower error for "parallel_coefficients" + integer(ids_int) :: parallel_coefficients_error_index=ids_int_invalid !Index in the error_description list for "parallel_coefficients" + real(ids_real), pointer :: poloidal(:) => null() !Poloidal component, one scalar value is provided per element in the grid subset. + real(ids_real), pointer :: poloidal_error_upper(:) => null() !Upper error for "poloidal" + real(ids_real), pointer :: poloidal_error_lower(:) => null() !Lower error for "poloidal" + integer(ids_int) :: poloidal_error_index=ids_int_invalid !Index in the error_description list for "poloidal" + real(ids_real), pointer :: poloidal_coefficients(:,:) => null() !Interpolation coefficients for the poloidal component, to be used for a high precision evaluation of the physical quantity with fi! + !nite elements, provided per element in the grid subset (first dimension). + real(ids_real), pointer :: poloidal_coefficients_error_upper(:,:) => null() !Upper error for "poloidal_coefficients" + real(ids_real), pointer :: poloidal_coefficients_error_lower(:,:) => null() !Lower error for "poloidal_coefficients" + integer(ids_int) :: poloidal_coefficients_error_index=ids_int_invalid !Index in the error_description list for "poloidal_coefficients" + real(ids_real), pointer :: toroidal(:) => null() !Toroidal component, one scalar value is provided per element in the grid subset. + real(ids_real), pointer :: toroidal_error_upper(:) => null() !Upper error for "toroidal" + real(ids_real), pointer :: toroidal_error_lower(:) => null() !Lower error for "toroidal" + integer(ids_int) :: toroidal_error_index=ids_int_invalid !Index in the error_description list for "toroidal" + real(ids_real), pointer :: toroidal_coefficients(:,:) => null() !Interpolation coefficients for the toroidal component, to be used for a high precision evaluation of the physical quantity with fi! + !nite elements, provided per element in the grid subset (first dimension). + real(ids_real), pointer :: toroidal_coefficients_error_upper(:,:) => null() !Upper error for "toroidal_coefficients" + real(ids_real), pointer :: toroidal_coefficients_error_lower(:,:) => null() !Lower error for "toroidal_coefficients" + integer(ids_int) :: toroidal_coefficients_error_index=ids_int_invalid !Index in the error_description list for "toroidal_coefficients" + real(ids_real), pointer :: r(:) => null() !Component along the major radius axis, one scalar value is provided per element in the grid subset. + real(ids_real), pointer :: r_error_upper(:) => null() !Upper error for "r" + real(ids_real), pointer :: r_error_lower(:) => null() !Lower error for "r" + integer(ids_int) :: r_error_index=ids_int_invalid !Index in the error_description list for "r" + real(ids_real), pointer :: r_coefficients(:,:) => null() !Interpolation coefficients for the component along the major radius axis, to be used for a high precision evaluation of the physic! + !al quantity with finite elements, provided per element in the grid subset (first dimension). + real(ids_real), pointer :: r_coefficients_error_upper(:,:) => null() !Upper error for "r_coefficients" + real(ids_real), pointer :: r_coefficients_error_lower(:,:) => null() !Lower error for "r_coefficients" + integer(ids_int) :: r_coefficients_error_index=ids_int_invalid !Index in the error_description list for "r_coefficients" + real(ids_real), pointer :: z(:) => null() !Component along the height axis, one scalar value is provided per element in the grid subset. + real(ids_real), pointer :: z_error_upper(:) => null() !Upper error for "z" + real(ids_real), pointer :: z_error_lower(:) => null() !Lower error for "z" + integer(ids_int) :: z_error_index=ids_int_invalid !Index in the error_description list for "z" + real(ids_real), pointer :: z_coefficients(:,:) => null() !Interpolation coefficients for the component along the height axis, to be used for a high precision evaluation of the physical qua! + !ntity with finite elements, provided per element in the grid subset (first dimension). + real(ids_real), pointer :: z_coefficients_error_upper(:,:) => null() !Upper error for "z_coefficients" + real(ids_real), pointer :: z_coefficients_error_lower(:,:) => null() !Lower error for "z_coefficients" + integer(ids_int) :: z_coefficients_error_index=ids_int_invalid !Index in the error_description list for "z_coefficients" + end type + + type ids_generic_grid_matrix !Matrix values on a generic grid (dynamic within a type 3 AoS) + integer(ids_int) :: grid_index=ids_int_invalid !Index of the grid used to represent this quantity + integer(ids_int) :: grid_subset_index=ids_int_invalid !Index of the grid subset the data is provided on + real(ids_real), pointer :: values(:,:,:) => null() !List of matrix components, one list per element in the grid subset. First dimenstion: element index. Second dimension: first matri! + !x index. Third dimension: second matrix index. + real(ids_real), pointer :: values_error_upper(:,:,:) => null() !Upper error for "values" + real(ids_real), pointer :: values_error_lower(:,:,:) => null() !Lower error for "values" + integer(ids_int) :: values_error_index=ids_int_invalid !Index in the error_description list for "values" + real(ids_real), pointer :: coefficients(:,:,:,:) => null() !Interpolation coefficients, to be used for a high precision evaluation of the physical quantity with finite elements, provided per! + ! element in the grid subset (first dimension). Second dimension: first matrix index. Third dimension: second matrix index. Fourth ! + !dimension: coefficient index + real(ids_real), pointer :: coefficients_error_upper(:,:,:,:) => null() !Upper error for "coefficients" + real(ids_real), pointer :: coefficients_error_lower(:,:,:,:) => null() !Lower error for "coefficients" + integer(ids_int) :: coefficients_error_index=ids_int_invalid !Index in the error_description list for "coefficients" + end type + + type ids_generic_grid_dynamic_space_dimension_object_boundary !Generic grid, description of an object boundary and its neighbours (dynamic within a type 3 AoS) + integer(ids_int) :: index=ids_int_invalid !Index of this (n-1)-dimensional boundary object + integer(ids_int), pointer :: neighbours(:) => null() !List of indices of the n-dimensional objects adjacent to the given n-dimensional object. An object can possibly have multiple neig! + !hbours on a boundary + end type + + type ids_generic_grid_dynamic_space_dimension_object !Generic grid, list of objects of a given dimension within a space (dynamic within a type 3 AoS) + type(ids_generic_grid_dynamic_space_dimension_object_boundary), pointer :: boundary(:) => null() !Set of (n-1)-dimensional objects defining the boundary of this n-dimensional object + real(ids_real), pointer :: geometry(:) => null() !Geometry data associated with the object, its detailed content is defined by ../../geometry_content. Its dimension depends on the ! + !type of object, geometry and coordinate considered. + real(ids_real), pointer :: geometry_error_upper(:) => null() !Upper error for "geometry" + real(ids_real), pointer :: geometry_error_lower(:) => null() !Lower error for "geometry" + integer(ids_int) :: geometry_error_index=ids_int_invalid !Index in the error_description list for "geometry" + integer(ids_int), pointer :: nodes(:) => null() !List of nodes forming this object (indices to objects_per_dimension(1)%object(:) in Fortran notation) + real(ids_real) :: measure=ids_real_invalid !Measure of the space object, i.e. physical size (length for 1d, area for 2d, volume for 3d objects,...) + real(ids_real) :: measure_error_upper=ids_real_invalid !Upper error for "measure" + real(ids_real) :: measure_error_lower=ids_real_invalid !Lower error for "measure" + integer(ids_int) :: measure_error_index=ids_int_invalid !Index in the error_description list for "measure" + real(ids_real), pointer :: geometry_2d(:,:) => null() !2D geometry data associated with the object. Its dimension depends on the type of object, geometry and coordinate considered. Typi! + !cally, the first dimension represents the object coordinates, while the second dimension would represent the values of the various! + ! degrees of freedom of the finite element attached to the object. + real(ids_real), pointer :: geometry_2d_error_upper(:,:) => null() !Upper error for "geometry_2d" + real(ids_real), pointer :: geometry_2d_error_lower(:,:) => null() !Lower error for "geometry_2d" + integer(ids_int) :: geometry_2d_error_index=ids_int_invalid !Index in the error_description list for "geometry_2d" + end type + + type ids_generic_grid_dynamic_space_dimension !Generic grid, list of dimensions within a space (dynamic within a type 3 AoS) + type(ids_generic_grid_dynamic_space_dimension_object), pointer :: object(:) => null() !Set of objects for a given dimension + type(ids_identifier_dynamic_aos3) :: geometry_content !Content of the ../object/geometry node for this dimension + end type + + type ids_generic_grid_dynamic_space !Generic grid space (dynamic within a type 3 AoS) + type(ids_identifier_dynamic_aos3) :: identifier !Space identifier + type(ids_identifier_dynamic_aos3) :: geometry_type !Type of space geometry (0: standard, 1:Fourier, >1: Fourier with periodicity) + integer(ids_int), pointer :: coordinates_type(:) => null() !Type of coordinates describing the physical space, for every coordinate of the space. The size of this node therefore defines the ! + !dimension of the space. The meaning of these predefined integer constants can be found in the Data Dictionary under utilities/coor! + !dinate_identifier.xml + type(ids_generic_grid_dynamic_space_dimension), pointer :: objects_per_dimension(:) => null() !Definition of the space objects for every dimension (from one to the dimension of the highest-dimensional objects). The index corr! + !espond to 1=nodes, 2=edges, 3=faces, 4=cells/volumes, .... For every index, a collection of objects of that dimension is described! + !. + end type + + type ids_generic_grid_dynamic_grid_subset_element_object !Generic grid, object part of an element part of a grid_subset (dynamic within a type 3 AoS) + integer(ids_int) :: space=ids_int_invalid !Index of the space from which that object is taken + integer(ids_int) :: dimension=ids_int_invalid !Dimension of the object + integer(ids_int) :: index=ids_int_invalid !Object index + end type + + type ids_generic_grid_dynamic_grid_subset_element !Generic grid, element part of a grid_subset (dynamic within a type 3 AoS) + type(ids_generic_grid_dynamic_grid_subset_element_object), pointer :: object(:) => null() !Set of objects defining the element + end type + + type ids_generic_grid_dynamic_grid_subset_metric !Generic grid, metric description for a given grid_subset and base (dynamic within a type 3 AoS) + real(ids_real), pointer :: jacobian(:) => null() !Metric Jacobian + real(ids_real), pointer :: jacobian_error_upper(:) => null() !Upper error for "jacobian" + real(ids_real), pointer :: jacobian_error_lower(:) => null() !Lower error for "jacobian" + integer(ids_int) :: jacobian_error_index=ids_int_invalid !Index in the error_description list for "jacobian" + real(ids_real), pointer :: tensor_covariant(:,:,:) => null() !Covariant metric tensor, given on each element of the subgrid (first dimension) + real(ids_real), pointer :: tensor_covariant_error_upper(:,:,:) => null() !Upper error for "tensor_covariant" + real(ids_real), pointer :: tensor_covariant_error_lower(:,:,:) => null() !Lower error for "tensor_covariant" + integer(ids_int) :: tensor_covariant_error_index=ids_int_invalid !Index in the error_description list for "tensor_covariant" + real(ids_real), pointer :: tensor_contravariant(:,:,:) => null() !Contravariant metric tensor, given on each element of the subgrid (first dimension) + real(ids_real), pointer :: tensor_contravariant_error_upper(:,:,:) => null() !Upper error for "tensor_contravariant" + real(ids_real), pointer :: tensor_contravariant_error_lower(:,:,:) => null() !Lower error for "tensor_contravariant" + integer(ids_int) :: tensor_contravariant_error_index=ids_int_invalid !Index in the error_description list for "tensor_contravariant" + end type + + type ids_generic_grid_dynamic_grid_subset !Generic grid grid_subset (dynamic within a type 3 AoS) + type(ids_identifier_dynamic_aos3) :: identifier !Grid subset identifier + integer(ids_int) :: dimension=ids_int_invalid !Space dimension of the grid subset elements. This must be equal to the sum of the dimensions of the individual objects forming the! + ! element. + type(ids_generic_grid_dynamic_grid_subset_element), pointer :: element(:) => null() !Set of elements defining the grid subset. An element is defined by a combination of objects from potentially all spaces + type(ids_generic_grid_dynamic_grid_subset_metric), pointer :: base(:) => null() !Set of bases for the grid subset. For each base, the structure describes the projection of the base vectors on the canonical frame! + ! of the grid. + type(ids_generic_grid_dynamic_grid_subset_metric) :: metric !Metric of the canonical frame onto Cartesian coordinates + end type + + type ids_generic_grid_dynamic !Generic grid (dynamic within a type 3 AoS) + type(ids_identifier_dynamic_aos3) :: identifier !Grid identifier + character(len=ids_string_length), dimension(:), pointer :: path => null() !Path of the grid, including the IDS name, in case of implicit reference to a grid_ggd node described in another IDS. To be filled ! + !only if the grid is not described explicitly in this grid_ggd structure. Example syntax: 'wall:0/description_ggd(1)/grid_ggd', mea! + !ns that the grid is located in the wall IDS, occurrence 0, with ids path 'description_ggd(1)/grid_ggd'. See the link below for mor! + !e details about IDS paths + type(ids_generic_grid_dynamic_space), pointer :: space(:) => null() !Set of grid spaces + type(ids_generic_grid_dynamic_grid_subset), pointer :: grid_subset(:) => null() !Grid subsets + end type + + type ids_generic_grid_aos3_root !Generic grid (being itself the root of a type 3 AoS) + type(ids_identifier_dynamic_aos3) :: identifier !Grid identifier + character(len=ids_string_length), dimension(:), pointer :: path => null() !Path of the grid, including the IDS name, in case of implicit reference to a grid_ggd node described in another IDS. To be filled ! + !only if the grid is not described explicitly in this grid_ggd structure. Example syntax: IDS::wall/0/description_ggd(1)/grid_ggd, ! + !means that the grid is located in the wall IDS, occurrence 0, with relative path description_ggd(1)/grid_ggd, using Fortran index ! + !convention (here : first index of the array) + type(ids_generic_grid_dynamic_space), pointer :: space(:) => null() !Set of grid spaces + type(ids_generic_grid_dynamic_grid_subset), pointer :: grid_subset(:) => null() !Grid subsets + real(ids_real) :: time=ids_real_invalid !Time + end type + + type ids_geometry_matrix_emission !Emission grid for the geometry matrix of a detector + type(ids_identifier_static) :: grid_type !Grid type + real(ids_real), pointer :: dim1(:) => null() !First dimension values + real(ids_real), pointer :: dim1_error_upper(:) => null() !Upper error for "dim1" + real(ids_real), pointer :: dim1_error_lower(:) => null() !Lower error for "dim1" + integer(ids_int) :: dim1_error_index=ids_int_invalid !Index in the error_description list for "dim1" + real(ids_real), pointer :: dim2(:) => null() !Second dimension values + real(ids_real), pointer :: dim2_error_upper(:) => null() !Upper error for "dim2" + real(ids_real), pointer :: dim2_error_lower(:) => null() !Lower error for "dim2" + integer(ids_int) :: dim2_error_index=ids_int_invalid !Index in the error_description list for "dim2" + real(ids_real), pointer :: dim3(:) => null() !Third dimension values + real(ids_real), pointer :: dim3_error_upper(:) => null() !Upper error for "dim3" + real(ids_real), pointer :: dim3_error_lower(:) => null() !Lower error for "dim3" + integer(ids_int) :: dim3_error_index=ids_int_invalid !Index in the error_description list for "dim3" + end type + + type ids_equilibrium_profiles_2d_grid !Definition of the 2D grid + real(ids_real), pointer :: dim1(:) => null() !First dimension values + real(ids_real), pointer :: dim1_error_upper(:) => null() !Upper error for "dim1" + real(ids_real), pointer :: dim1_error_lower(:) => null() !Lower error for "dim1" + integer(ids_int) :: dim1_error_index=ids_int_invalid !Index in the error_description list for "dim1" + real(ids_real), pointer :: dim2(:) => null() !Second dimension values + real(ids_real), pointer :: dim2_error_upper(:) => null() !Upper error for "dim2" + real(ids_real), pointer :: dim2_error_lower(:) => null() !Lower error for "dim2" + integer(ids_int) :: dim2_error_index=ids_int_invalid !Index in the error_description list for "dim2" + real(ids_real), pointer :: volume_element(:,:) => null() !Elementary plasma volume of plasma enclosed in the cell formed by the nodes [dim1(i) dim2(j)], [dim1(i+1) dim2(j)], [dim1(i) dim2(! + !j+1)] and [dim1(i+1) dim2(j+1)] + real(ids_real), pointer :: volume_element_error_upper(:,:) => null() !Upper error for "volume_element" + real(ids_real), pointer :: volume_element_error_lower(:,:) => null() !Lower error for "volume_element" + integer(ids_int) :: volume_element_error_index=ids_int_invalid !Index in the error_description list for "volume_element" + end type + + type ids_equilibrium_coordinate_system !Flux surface coordinate system on a square grid of flux and poloidal angle + type(ids_identifier_dynamic_aos3) :: grid_type !Type of coordinate system + type(ids_equilibrium_profiles_2d_grid) :: grid !Definition of the 2D grid + real(ids_real), pointer :: r(:,:) => null() !Values of the major radius on the grid + real(ids_real), pointer :: r_error_upper(:,:) => null() !Upper error for "r" + real(ids_real), pointer :: r_error_lower(:,:) => null() !Lower error for "r" + integer(ids_int) :: r_error_index=ids_int_invalid !Index in the error_description list for "r" + real(ids_real), pointer :: z(:,:) => null() !Values of the Height on the grid + real(ids_real), pointer :: z_error_upper(:,:) => null() !Upper error for "z" + real(ids_real), pointer :: z_error_lower(:,:) => null() !Lower error for "z" + integer(ids_int) :: z_error_index=ids_int_invalid !Index in the error_description list for "z" + real(ids_real), pointer :: jacobian(:,:) => null() !Absolute value of the jacobian of the coordinate system + real(ids_real), pointer :: jacobian_error_upper(:,:) => null() !Upper error for "jacobian" + real(ids_real), pointer :: jacobian_error_lower(:,:) => null() !Lower error for "jacobian" + integer(ids_int) :: jacobian_error_index=ids_int_invalid !Index in the error_description list for "jacobian" + real(ids_real), pointer :: tensor_covariant(:,:,:,:) => null() !Covariant metric tensor on every point of the grid described by grid_type + real(ids_real), pointer :: tensor_covariant_error_upper(:,:,:,:) => null() !Upper error for "tensor_covariant" + real(ids_real), pointer :: tensor_covariant_error_lower(:,:,:,:) => null() !Lower error for "tensor_covariant" + integer(ids_int) :: tensor_covariant_error_index=ids_int_invalid !Index in the error_description list for "tensor_covariant" + real(ids_real), pointer :: tensor_contravariant(:,:,:,:) => null() !Contravariant metric tensor on every point of the grid described by grid_type + real(ids_real), pointer :: tensor_contravariant_error_upper(:,:,:,:) => null() !Upper error for "tensor_contravariant" + real(ids_real), pointer :: tensor_contravariant_error_lower(:,:,:,:) => null() !Lower error for "tensor_contravariant" + integer(ids_int) :: tensor_contravariant_error_index=ids_int_invalid !Index in the error_description list for "tensor_contravariant" + real(ids_real), pointer :: g11_covariant(:,:) => null() !metric coefficients g11, covariant metric tensor for the grid described by grid_type + real(ids_real), pointer :: g11_covariant_error_upper(:,:) => null() !Upper error for "g11_covariant" + real(ids_real), pointer :: g11_covariant_error_lower(:,:) => null() !Lower error for "g11_covariant" + integer(ids_int) :: g11_covariant_error_index=ids_int_invalid !Index in the error_description list for "g11_covariant" + real(ids_real), pointer :: g12_covariant(:,:) => null() !metric coefficients g12, covariant metric tensor for the grid described by grid_type + real(ids_real), pointer :: g12_covariant_error_upper(:,:) => null() !Upper error for "g12_covariant" + real(ids_real), pointer :: g12_covariant_error_lower(:,:) => null() !Lower error for "g12_covariant" + integer(ids_int) :: g12_covariant_error_index=ids_int_invalid !Index in the error_description list for "g12_covariant" + real(ids_real), pointer :: g13_covariant(:,:) => null() !metric coefficients g13, covariant metric tensor for the grid described by grid_type + real(ids_real), pointer :: g13_covariant_error_upper(:,:) => null() !Upper error for "g13_covariant" + real(ids_real), pointer :: g13_covariant_error_lower(:,:) => null() !Lower error for "g13_covariant" + integer(ids_int) :: g13_covariant_error_index=ids_int_invalid !Index in the error_description list for "g13_covariant" + real(ids_real), pointer :: g22_covariant(:,:) => null() !metric coefficients g22, covariant metric tensor for the grid described by grid_type + real(ids_real), pointer :: g22_covariant_error_upper(:,:) => null() !Upper error for "g22_covariant" + real(ids_real), pointer :: g22_covariant_error_lower(:,:) => null() !Lower error for "g22_covariant" + integer(ids_int) :: g22_covariant_error_index=ids_int_invalid !Index in the error_description list for "g22_covariant" + real(ids_real), pointer :: g23_covariant(:,:) => null() !metric coefficients g23, covariant metric tensor for the grid described by grid_type + real(ids_real), pointer :: g23_covariant_error_upper(:,:) => null() !Upper error for "g23_covariant" + real(ids_real), pointer :: g23_covariant_error_lower(:,:) => null() !Lower error for "g23_covariant" + integer(ids_int) :: g23_covariant_error_index=ids_int_invalid !Index in the error_description list for "g23_covariant" + real(ids_real), pointer :: g33_covariant(:,:) => null() !metric coefficients g33, covariant metric tensor for the grid described by grid_type + real(ids_real), pointer :: g33_covariant_error_upper(:,:) => null() !Upper error for "g33_covariant" + real(ids_real), pointer :: g33_covariant_error_lower(:,:) => null() !Lower error for "g33_covariant" + integer(ids_int) :: g33_covariant_error_index=ids_int_invalid !Index in the error_description list for "g33_covariant" + real(ids_real), pointer :: g11_contravariant(:,:) => null() !metric coefficients g11, contravariant metric tensor for the grid described by grid_type + real(ids_real), pointer :: g11_contravariant_error_upper(:,:) => null() !Upper error for "g11_contravariant" + real(ids_real), pointer :: g11_contravariant_error_lower(:,:) => null() !Lower error for "g11_contravariant" + integer(ids_int) :: g11_contravariant_error_index=ids_int_invalid !Index in the error_description list for "g11_contravariant" + real(ids_real), pointer :: g12_contravariant(:,:) => null() !metric coefficients g12, contravariant metric tensor for the grid described by grid_type + real(ids_real), pointer :: g12_contravariant_error_upper(:,:) => null() !Upper error for "g12_contravariant" + real(ids_real), pointer :: g12_contravariant_error_lower(:,:) => null() !Lower error for "g12_contravariant" + integer(ids_int) :: g12_contravariant_error_index=ids_int_invalid !Index in the error_description list for "g12_contravariant" + real(ids_real), pointer :: g13_contravariant(:,:) => null() !metric coefficients g13, contravariant metric tensor for the grid described by grid_type + real(ids_real), pointer :: g13_contravariant_error_upper(:,:) => null() !Upper error for "g13_contravariant" + real(ids_real), pointer :: g13_contravariant_error_lower(:,:) => null() !Lower error for "g13_contravariant" + integer(ids_int) :: g13_contravariant_error_index=ids_int_invalid !Index in the error_description list for "g13_contravariant" + real(ids_real), pointer :: g22_contravariant(:,:) => null() !metric coefficients g22, contravariant metric tensor for the grid described by grid_type + real(ids_real), pointer :: g22_contravariant_error_upper(:,:) => null() !Upper error for "g22_contravariant" + real(ids_real), pointer :: g22_contravariant_error_lower(:,:) => null() !Lower error for "g22_contravariant" + integer(ids_int) :: g22_contravariant_error_index=ids_int_invalid !Index in the error_description list for "g22_contravariant" + real(ids_real), pointer :: g23_contravariant(:,:) => null() !metric coefficients g23, contravariant metric tensor for the grid described by grid_type + real(ids_real), pointer :: g23_contravariant_error_upper(:,:) => null() !Upper error for "g23_contravariant" + real(ids_real), pointer :: g23_contravariant_error_lower(:,:) => null() !Lower error for "g23_contravariant" + integer(ids_int) :: g23_contravariant_error_index=ids_int_invalid !Index in the error_description list for "g23_contravariant" + real(ids_real), pointer :: g33_contravariant(:,:) => null() !metric coefficients g33, contravariant metric tensor for the grid described by grid_type + real(ids_real), pointer :: g33_contravariant_error_upper(:,:) => null() !Upper error for "g33_contravariant" + real(ids_real), pointer :: g33_contravariant_error_lower(:,:) => null() !Lower error for "g33_contravariant" + integer(ids_int) :: g33_contravariant_error_index=ids_int_invalid !Index in the error_description list for "g33_contravariant" + end type + + type ids_delta_rzphi0d_static !Structure for R, Z, Phi relative positions (0D, static) + real(ids_real) :: delta_r=ids_real_invalid !Major radius (relative to a reference point) + real(ids_real) :: delta_r_error_upper=ids_real_invalid !Upper error for "delta_r" + real(ids_real) :: delta_r_error_lower=ids_real_invalid !Lower error for "delta_r" + integer(ids_int) :: delta_r_error_index=ids_int_invalid !Index in the error_description list for "delta_r" + real(ids_real) :: delta_z=ids_real_invalid !Height (relative to a reference point) + real(ids_real) :: delta_z_error_upper=ids_real_invalid !Upper error for "delta_z" + real(ids_real) :: delta_z_error_lower=ids_real_invalid !Lower error for "delta_z" + integer(ids_int) :: delta_z_error_index=ids_int_invalid !Index in the error_description list for "delta_z" + real(ids_real) :: delta_phi=ids_real_invalid !Toroidal angle (relative to a reference point) + real(ids_real) :: delta_phi_error_upper=ids_real_invalid !Upper error for "delta_phi" + real(ids_real) :: delta_phi_error_lower=ids_real_invalid !Lower error for "delta_phi" + integer(ids_int) :: delta_phi_error_index=ids_int_invalid !Index in the error_description list for "delta_phi" + end type + + type ids_delta_rzphi1d_static !Structure for R, Z, Phi relative positions (1D, static) + real(ids_real), pointer :: delta_r(:) => null() !Major radii (relative to a reference point) + real(ids_real), pointer :: delta_r_error_upper(:) => null() !Upper error for "delta_r" + real(ids_real), pointer :: delta_r_error_lower(:) => null() !Lower error for "delta_r" + integer(ids_int) :: delta_r_error_index=ids_int_invalid !Index in the error_description list for "delta_r" + real(ids_real), pointer :: delta_z(:) => null() !Heights (relative to a reference point) + real(ids_real), pointer :: delta_z_error_upper(:) => null() !Upper error for "delta_z" + real(ids_real), pointer :: delta_z_error_lower(:) => null() !Lower error for "delta_z" + integer(ids_int) :: delta_z_error_index=ids_int_invalid !Index in the error_description list for "delta_z" + real(ids_real), pointer :: delta_phi(:) => null() !Toroidal angles (relative to a reference point) + real(ids_real), pointer :: delta_phi_error_upper(:) => null() !Upper error for "delta_phi" + real(ids_real), pointer :: delta_phi_error_lower(:) => null() !Lower error for "delta_phi" + integer(ids_int) :: delta_phi_error_index=ids_int_invalid !Index in the error_description list for "delta_phi" + end type + + type ids_rzphi0d_static !Structure for R, Z, Phi positions (0D, static) + real(ids_real) :: r=ids_real_invalid !Major radius + real(ids_real) :: r_error_upper=ids_real_invalid !Upper error for "r" + real(ids_real) :: r_error_lower=ids_real_invalid !Lower error for "r" + integer(ids_int) :: r_error_index=ids_int_invalid !Index in the error_description list for "r" + real(ids_real) :: z=ids_real_invalid !Height + real(ids_real) :: z_error_upper=ids_real_invalid !Upper error for "z" + real(ids_real) :: z_error_lower=ids_real_invalid !Lower error for "z" + integer(ids_int) :: z_error_index=ids_int_invalid !Index in the error_description list for "z" + real(ids_real) :: phi=ids_real_invalid !Toroidal angle (oriented counter-clockwise when viewing from above) + real(ids_real) :: phi_error_upper=ids_real_invalid !Upper error for "phi" + real(ids_real) :: phi_error_lower=ids_real_invalid !Lower error for "phi" + integer(ids_int) :: phi_error_index=ids_int_invalid !Index in the error_description list for "phi" + end type + + type ids_rzphi0d_dynamic_aos3 !Structure for R, Z, Phi positions (0D, dynamic within a type 3 array of structures (index on time)) + real(ids_real) :: r=ids_real_invalid !Major radius + real(ids_real) :: r_error_upper=ids_real_invalid !Upper error for "r" + real(ids_real) :: r_error_lower=ids_real_invalid !Lower error for "r" + integer(ids_int) :: r_error_index=ids_int_invalid !Index in the error_description list for "r" + real(ids_real) :: z=ids_real_invalid !Height + real(ids_real) :: z_error_upper=ids_real_invalid !Upper error for "z" + real(ids_real) :: z_error_lower=ids_real_invalid !Lower error for "z" + integer(ids_int) :: z_error_index=ids_int_invalid !Index in the error_description list for "z" + real(ids_real) :: phi=ids_real_invalid !Toroidal angle (oriented counter-clockwise when viewing from above) + real(ids_real) :: phi_error_upper=ids_real_invalid !Upper error for "phi" + real(ids_real) :: phi_error_lower=ids_real_invalid !Lower error for "phi" + integer(ids_int) :: phi_error_index=ids_int_invalid !Index in the error_description list for "phi" + end type + + type ids_rzphi1d_grid !R, Z, Phi structured grid, in which R, Z and phi don't necessarily have the same number of elements + real(ids_real), pointer :: r(:) => null() !Major radius + real(ids_real), pointer :: r_error_upper(:) => null() !Upper error for "r" + real(ids_real), pointer :: r_error_lower(:) => null() !Lower error for "r" + integer(ids_int) :: r_error_index=ids_int_invalid !Index in the error_description list for "r" + real(ids_real), pointer :: z(:) => null() !Height + real(ids_real), pointer :: z_error_upper(:) => null() !Upper error for "z" + real(ids_real), pointer :: z_error_lower(:) => null() !Lower error for "z" + integer(ids_int) :: z_error_index=ids_int_invalid !Index in the error_description list for "z" + real(ids_real), pointer :: phi(:) => null() !Toroidal angle (oriented counter-clockwise when viewing from above) + real(ids_real), pointer :: phi_error_upper(:) => null() !Upper error for "phi" + real(ids_real), pointer :: phi_error_lower(:) => null() !Lower error for "phi" + integer(ids_int) :: phi_error_index=ids_int_invalid !Index in the error_description list for "phi" + end type + + type ids_rzphi1d_static !Structure for list of R, Z, Phi positions (1D, static) + real(ids_real), pointer :: r(:) => null() !Major radius + real(ids_real), pointer :: r_error_upper(:) => null() !Upper error for "r" + real(ids_real), pointer :: r_error_lower(:) => null() !Lower error for "r" + integer(ids_int) :: r_error_index=ids_int_invalid !Index in the error_description list for "r" + real(ids_real), pointer :: z(:) => null() !Height + real(ids_real), pointer :: z_error_upper(:) => null() !Upper error for "z" + real(ids_real), pointer :: z_error_lower(:) => null() !Lower error for "z" + integer(ids_int) :: z_error_index=ids_int_invalid !Index in the error_description list for "z" + real(ids_real), pointer :: phi(:) => null() !Toroidal angle (oriented counter-clockwise when viewing from above) + real(ids_real), pointer :: phi_error_upper(:) => null() !Upper error for "phi" + real(ids_real), pointer :: phi_error_lower(:) => null() !Lower error for "phi" + integer(ids_int) :: phi_error_index=ids_int_invalid !Index in the error_description list for "phi" + end type + + type ids_rzphi2d_static !Structure for list of R, Z, Phi positions (2D, static) + real(ids_real), pointer :: r(:,:) => null() !Major radius + real(ids_real), pointer :: r_error_upper(:,:) => null() !Upper error for "r" + real(ids_real), pointer :: r_error_lower(:,:) => null() !Lower error for "r" + integer(ids_int) :: r_error_index=ids_int_invalid !Index in the error_description list for "r" + real(ids_real), pointer :: z(:,:) => null() !Height + real(ids_real), pointer :: z_error_upper(:,:) => null() !Upper error for "z" + real(ids_real), pointer :: z_error_lower(:,:) => null() !Lower error for "z" + integer(ids_int) :: z_error_index=ids_int_invalid !Index in the error_description list for "z" + real(ids_real), pointer :: phi(:,:) => null() !Toroidal angle (oriented counter-clockwise when viewing from above) + real(ids_real), pointer :: phi_error_upper(:,:) => null() !Upper error for "phi" + real(ids_real), pointer :: phi_error_lower(:,:) => null() !Lower error for "phi" + integer(ids_int) :: phi_error_index=ids_int_invalid !Index in the error_description list for "phi" + end type + + type ids_rzphi1d_dynamic_aos1 !Structure for list of R, Z, Phi positions (1D, dynamic within a type 1 array of structures (indexed on objects, data/time structur! + !e) + type(ids_signal_flt_1d) :: r !Major radius + type(ids_signal_flt_1d) :: z !Height + type(ids_signal_flt_1d) :: phi !Toroidal angle (oriented counter-clockwise when viewing from above) + end type + + type ids_rzphi1d_dynamic_aos1_common_time !Structure for R, Z, Phi positions (1D, dynamic within a type 1 array of structure and with a common time base at the same level) + real(ids_real), pointer :: r(:) => null() !Major radius + real(ids_real), pointer :: r_error_upper(:) => null() !Upper error for "r" + real(ids_real), pointer :: r_error_lower(:) => null() !Lower error for "r" + integer(ids_int) :: r_error_index=ids_int_invalid !Index in the error_description list for "r" + real(ids_real), pointer :: z(:) => null() !Height + real(ids_real), pointer :: z_error_upper(:) => null() !Upper error for "z" + real(ids_real), pointer :: z_error_lower(:) => null() !Lower error for "z" + integer(ids_int) :: z_error_index=ids_int_invalid !Index in the error_description list for "z" + real(ids_real), pointer :: phi(:) => null() !Toroidal angle + real(ids_real), pointer :: phi_error_upper(:) => null() !Upper error for "phi" + real(ids_real), pointer :: phi_error_lower(:) => null() !Lower error for "phi" + integer(ids_int) :: phi_error_index=ids_int_invalid !Index in the error_description list for "phi" + real(ids_real), pointer :: time(:) => null() !Time for the R,Z,phi coordinates + end type + + type ids_rzphirhopsitheta1d_dynamic_aos1 !Structure for list of R, Z, Phi, rho_tor_norm, psi, theta positions (1D, dynamic within a type 1 array of structures (indexed on o! + !bjects, data/time structure) + type(ids_signal_flt_1d) :: r !Major radius + type(ids_signal_flt_1d) :: z !Height + type(ids_signal_flt_1d) :: phi !Toroidal angle (oriented counter-clockwise when viewing from above) + type(ids_signal_flt_1d) :: psi !Poloidal flux + type(ids_signal_flt_1d) :: rho_tor_norm !Normalised toroidal flux coordinate + type(ids_signal_flt_1d) :: theta !Poloidal angle (oriented clockwise when viewing the poloidal cross section on the right hand side of the tokamak axis of symmetry,! + ! with the origin placed on the plasma magnetic axis) + end type + + type ids_rzphirhopsitheta1d_dynamic_aos1_common_time_1 !Structure for list of R, Z, Phi, rho_tor_norm, psi, theta positions (1D, dynamic within a type 1 array of structures, assuming a c! + !ommon time array one level above + real(ids_real), pointer :: r(:) => null() !Major radius + real(ids_real), pointer :: r_error_upper(:) => null() !Upper error for "r" + real(ids_real), pointer :: r_error_lower(:) => null() !Lower error for "r" + integer(ids_int) :: r_error_index=ids_int_invalid !Index in the error_description list for "r" + real(ids_real), pointer :: z(:) => null() !Height + real(ids_real), pointer :: z_error_upper(:) => null() !Upper error for "z" + real(ids_real), pointer :: z_error_lower(:) => null() !Lower error for "z" + integer(ids_int) :: z_error_index=ids_int_invalid !Index in the error_description list for "z" + real(ids_real), pointer :: phi(:) => null() !Toroidal angle (oriented counter-clockwise when viewing from above) + real(ids_real), pointer :: phi_error_upper(:) => null() !Upper error for "phi" + real(ids_real), pointer :: phi_error_lower(:) => null() !Lower error for "phi" + integer(ids_int) :: phi_error_index=ids_int_invalid !Index in the error_description list for "phi" + real(ids_real), pointer :: psi(:) => null() !Poloidal flux + real(ids_real), pointer :: psi_error_upper(:) => null() !Upper error for "psi" + real(ids_real), pointer :: psi_error_lower(:) => null() !Lower error for "psi" + integer(ids_int) :: psi_error_index=ids_int_invalid !Index in the error_description list for "psi" + real(ids_real), pointer :: rho_tor_norm(:) => null() !Normalised toroidal flux coordinate + real(ids_real), pointer :: rho_tor_norm_error_upper(:) => null() !Upper error for "rho_tor_norm" + real(ids_real), pointer :: rho_tor_norm_error_lower(:) => null() !Lower error for "rho_tor_norm" + integer(ids_int) :: rho_tor_norm_error_index=ids_int_invalid !Index in the error_description list for "rho_tor_norm" + real(ids_real), pointer :: theta(:) => null() !Poloidal angle (oriented clockwise when viewing the poloidal cross section on the right hand side of the tokamak axis of symmetry,! + ! with the origin placed on the plasma magnetic axis) + real(ids_real), pointer :: theta_error_upper(:) => null() !Upper error for "theta" + real(ids_real), pointer :: theta_error_lower(:) => null() !Lower error for "theta" + integer(ids_int) :: theta_error_index=ids_int_invalid !Index in the error_description list for "theta" + end type + + type ids_rzphi1d_dynamic_aos1_definition !Structure for list of R, Z, Phi positions (1D, dynamic within a type 1 array of structures (indexed on objects, data/time structur! + !e), including a definition of the reference point + character(len=ids_string_length), dimension(:), pointer :: definition => null() !Definition of the reference point + type(ids_signal_flt_1d) :: r !Major radius + type(ids_signal_flt_1d) :: z !Height + type(ids_signal_flt_1d) :: phi !Toroidal angle (oriented counter-clockwise when viewing from above) + end type + + type ids_rzphi1d_dynamic_aos3 !Structure for R, Z, Phi positions (1D, dynamic within a type 3 array of structure) + real(ids_real), pointer :: r(:) => null() !Major radius + real(ids_real), pointer :: r_error_upper(:) => null() !Upper error for "r" + real(ids_real), pointer :: r_error_lower(:) => null() !Lower error for "r" + integer(ids_int) :: r_error_index=ids_int_invalid !Index in the error_description list for "r" + real(ids_real), pointer :: z(:) => null() !Height + real(ids_real), pointer :: z_error_upper(:) => null() !Upper error for "z" + real(ids_real), pointer :: z_error_lower(:) => null() !Lower error for "z" + integer(ids_int) :: z_error_index=ids_int_invalid !Index in the error_description list for "z" + real(ids_real), pointer :: phi(:) => null() !Toroidal angle (oriented counter-clockwise when viewing from above) + real(ids_real), pointer :: phi_error_upper(:) => null() !Upper error for "phi" + real(ids_real), pointer :: phi_error_lower(:) => null() !Lower error for "phi" + integer(ids_int) :: phi_error_index=ids_int_invalid !Index in the error_description list for "phi" + end type + + type ids_rzphipsitheta1d_dynamic_aos3 !Structure for R, Z, Phi, Psi, Theta positions (1D, dynamic within a type 3 array of structures) + real(ids_real), pointer :: r(:) => null() !Major radius + real(ids_real), pointer :: r_error_upper(:) => null() !Upper error for "r" + real(ids_real), pointer :: r_error_lower(:) => null() !Lower error for "r" + integer(ids_int) :: r_error_index=ids_int_invalid !Index in the error_description list for "r" + real(ids_real), pointer :: z(:) => null() !Height + real(ids_real), pointer :: z_error_upper(:) => null() !Upper error for "z" + real(ids_real), pointer :: z_error_lower(:) => null() !Lower error for "z" + integer(ids_int) :: z_error_index=ids_int_invalid !Index in the error_description list for "z" + real(ids_real), pointer :: phi(:) => null() !Toroidal angle (oriented counter-clockwise when viewing from above) + real(ids_real), pointer :: phi_error_upper(:) => null() !Upper error for "phi" + real(ids_real), pointer :: phi_error_lower(:) => null() !Lower error for "phi" + integer(ids_int) :: phi_error_index=ids_int_invalid !Index in the error_description list for "phi" + real(ids_real), pointer :: psi(:) => null() !Poloidal flux + real(ids_real), pointer :: psi_error_upper(:) => null() !Upper error for "psi" + real(ids_real), pointer :: psi_error_lower(:) => null() !Lower error for "psi" + integer(ids_int) :: psi_error_index=ids_int_invalid !Index in the error_description list for "psi" + real(ids_real), pointer :: theta(:) => null() !Poloidal angle (oriented clockwise when viewing the poloidal cross section on the right hand side of the tokamak axis of symmetry,! + ! with the origin placed on the plasma magnetic axis) + real(ids_real), pointer :: theta_error_upper(:) => null() !Upper error for "theta" + real(ids_real), pointer :: theta_error_lower(:) => null() !Lower error for "theta" + integer(ids_int) :: theta_error_index=ids_int_invalid !Index in the error_description list for "theta" + end type + + type ids_rz1d_constant !Structure for list of R, Z positions (1D, constant) + real(ids_real), pointer :: r(:) => null() !Major radius + real(ids_real), pointer :: r_error_upper(:) => null() !Upper error for "r" + real(ids_real), pointer :: r_error_lower(:) => null() !Lower error for "r" + integer(ids_int) :: r_error_index=ids_int_invalid !Index in the error_description list for "r" + real(ids_real), pointer :: z(:) => null() !Height + real(ids_real), pointer :: z_error_upper(:) => null() !Upper error for "z" + real(ids_real), pointer :: z_error_lower(:) => null() !Lower error for "z" + integer(ids_int) :: z_error_index=ids_int_invalid !Index in the error_description list for "z" + end type + + type ids_rz0d_dynamic_aos !Structure for scalar R, Z positions, dynamic within a type 3 array of structures (index on time) + real(ids_real) :: r=ids_real_invalid !Major radius + real(ids_real) :: r_error_upper=ids_real_invalid !Upper error for "r" + real(ids_real) :: r_error_lower=ids_real_invalid !Lower error for "r" + integer(ids_int) :: r_error_index=ids_int_invalid !Index in the error_description list for "r" + real(ids_real) :: z=ids_real_invalid !Height + real(ids_real) :: z_error_upper=ids_real_invalid !Upper error for "z" + real(ids_real) :: z_error_lower=ids_real_invalid !Lower error for "z" + integer(ids_int) :: z_error_index=ids_int_invalid !Index in the error_description list for "z" + end type + + type ids_rz1d_dynamic_aos !Structure for list of R, Z positions (1D list of Npoints, dynamic within a type 3 array of structures (index on time)) + real(ids_real), pointer :: r(:) => null() !Major radius + real(ids_real), pointer :: r_error_upper(:) => null() !Upper error for "r" + real(ids_real), pointer :: r_error_lower(:) => null() !Lower error for "r" + integer(ids_int) :: r_error_index=ids_int_invalid !Index in the error_description list for "r" + real(ids_real), pointer :: z(:) => null() !Height + real(ids_real), pointer :: z_error_upper(:) => null() !Upper error for "z" + real(ids_real), pointer :: z_error_lower(:) => null() !Lower error for "z" + integer(ids_int) :: z_error_index=ids_int_invalid !Index in the error_description list for "z" + end type + + type ids_rz1d_dynamic_aos_time !Structure for list of R, Z positions (1D list of Npoints, dynamic within a type 3 array of structures (index on time), with time a! + !s sibling) + real(ids_real), pointer :: r(:) => null() !Major radius + real(ids_real), pointer :: r_error_upper(:) => null() !Upper error for "r" + real(ids_real), pointer :: r_error_lower(:) => null() !Lower error for "r" + integer(ids_int) :: r_error_index=ids_int_invalid !Index in the error_description list for "r" + real(ids_real), pointer :: z(:) => null() !Height + real(ids_real), pointer :: z_error_upper(:) => null() !Upper error for "z" + real(ids_real), pointer :: z_error_lower(:) => null() !Lower error for "z" + integer(ids_int) :: z_error_index=ids_int_invalid !Index in the error_description list for "z" + real(ids_real) :: time=ids_real_invalid !Time + end type + + type ids_rz1d_dynamic_1 !Structure for list of R, Z positions (1D, dynamic), time at the root of the IDS + real(ids_real), pointer :: r(:) => null() !Major radius + real(ids_real), pointer :: r_error_upper(:) => null() !Upper error for "r" + real(ids_real), pointer :: r_error_lower(:) => null() !Lower error for "r" + integer(ids_int) :: r_error_index=ids_int_invalid !Index in the error_description list for "r" + real(ids_real), pointer :: z(:) => null() !Height + real(ids_real), pointer :: z_error_upper(:) => null() !Upper error for "z" + real(ids_real), pointer :: z_error_lower(:) => null() !Lower error for "z" + integer(ids_int) :: z_error_index=ids_int_invalid !Index in the error_description list for "z" + end type + + type ids_rz1d_static_closed_flag !Structure for list of R, Z positions (1D, constant) and closed flag + real(ids_real), pointer :: r(:) => null() !Major radius + real(ids_real), pointer :: r_error_upper(:) => null() !Upper error for "r" + real(ids_real), pointer :: r_error_lower(:) => null() !Lower error for "r" + integer(ids_int) :: r_error_index=ids_int_invalid !Index in the error_description list for "r" + real(ids_real), pointer :: z(:) => null() !Height + real(ids_real), pointer :: z_error_upper(:) => null() !Upper error for "z" + real(ids_real), pointer :: z_error_lower(:) => null() !Lower error for "z" + integer(ids_int) :: z_error_index=ids_int_invalid !Index in the error_description list for "z" + integer(ids_int) :: closed=ids_int_invalid !Flag identifying whether the contour is closed (1) or open (0) + end type + + type ids_rz1d_static !Structure for list of R, Z positions (1D, constant) + real(ids_real), pointer :: r(:) => null() !Major radius + real(ids_real), pointer :: r_error_upper(:) => null() !Upper error for "r" + real(ids_real), pointer :: r_error_lower(:) => null() !Lower error for "r" + integer(ids_int) :: r_error_index=ids_int_invalid !Index in the error_description list for "r" + real(ids_real), pointer :: z(:) => null() !Height + real(ids_real), pointer :: z_error_upper(:) => null() !Upper error for "z" + real(ids_real), pointer :: z_error_lower(:) => null() !Lower error for "z" + integer(ids_int) :: z_error_index=ids_int_invalid !Index in the error_description list for "z" + end type + + type ids_x1x21d_static !Structure for list of X1, X2 positions (1D, static) + real(ids_real), pointer :: x1(:) => null() !Positions along x1 axis + real(ids_real), pointer :: x1_error_upper(:) => null() !Upper error for "x1" + real(ids_real), pointer :: x1_error_lower(:) => null() !Lower error for "x1" + integer(ids_int) :: x1_error_index=ids_int_invalid !Index in the error_description list for "x1" + real(ids_real), pointer :: x2(:) => null() !Positions along x2 axis + real(ids_real), pointer :: x2_error_upper(:) => null() !Upper error for "x2" + real(ids_real), pointer :: x2_error_lower(:) => null() !Lower error for "x2" + integer(ids_int) :: x2_error_index=ids_int_invalid !Index in the error_description list for "x2" + end type + + type ids_xyz0d_static !Structure for list of X, Y, Z components (0D, static) + real(ids_real) :: x=ids_real_invalid !Component along X axis + real(ids_real) :: x_error_upper=ids_real_invalid !Upper error for "x" + real(ids_real) :: x_error_lower=ids_real_invalid !Lower error for "x" + integer(ids_int) :: x_error_index=ids_int_invalid !Index in the error_description list for "x" + real(ids_real) :: y=ids_real_invalid !Component along Y axis + real(ids_real) :: y_error_upper=ids_real_invalid !Upper error for "y" + real(ids_real) :: y_error_lower=ids_real_invalid !Lower error for "y" + integer(ids_int) :: y_error_index=ids_int_invalid !Index in the error_description list for "y" + real(ids_real) :: z=ids_real_invalid !Component along Z axis + real(ids_real) :: z_error_upper=ids_real_invalid !Upper error for "z" + real(ids_real) :: z_error_lower=ids_real_invalid !Lower error for "z" + integer(ids_int) :: z_error_index=ids_int_invalid !Index in the error_description list for "z" + end type + + type ids_xyz2d_static !Structure for list of X, Y, Z components (2D, static) + real(ids_real), pointer :: x(:,:) => null() !Component along X axis + real(ids_real), pointer :: x_error_upper(:,:) => null() !Upper error for "x" + real(ids_real), pointer :: x_error_lower(:,:) => null() !Lower error for "x" + integer(ids_int) :: x_error_index=ids_int_invalid !Index in the error_description list for "x" + real(ids_real), pointer :: y(:,:) => null() !Component along Y axis + real(ids_real), pointer :: y_error_upper(:,:) => null() !Upper error for "y" + real(ids_real), pointer :: y_error_lower(:,:) => null() !Lower error for "y" + integer(ids_int) :: y_error_index=ids_int_invalid !Index in the error_description list for "y" + real(ids_real), pointer :: z(:,:) => null() !Component along Z axis + real(ids_real), pointer :: z_error_upper(:,:) => null() !Upper error for "z" + real(ids_real), pointer :: z_error_lower(:,:) => null() !Lower error for "z" + integer(ids_int) :: z_error_index=ids_int_invalid !Index in the error_description list for "z" + end type + + type ids_rz0d_static !Structure for a single R, Z position (0D, static) + real(ids_real) :: r=ids_real_invalid !Major radius + real(ids_real) :: r_error_upper=ids_real_invalid !Upper error for "r" + real(ids_real) :: r_error_lower=ids_real_invalid !Lower error for "r" + integer(ids_int) :: r_error_index=ids_int_invalid !Index in the error_description list for "r" + real(ids_real) :: z=ids_real_invalid !Height + real(ids_real) :: z_error_upper=ids_real_invalid !Upper error for "z" + real(ids_real) :: z_error_lower=ids_real_invalid !Lower error for "z" + integer(ids_int) :: z_error_index=ids_int_invalid !Index in the error_description list for "z" + end type + + type ids_rz0d_constant !Structure for a single R, Z position (0D, constant) + real(ids_real) :: r=ids_real_invalid !Major radius + real(ids_real) :: r_error_upper=ids_real_invalid !Upper error for "r" + real(ids_real) :: r_error_lower=ids_real_invalid !Lower error for "r" + integer(ids_int) :: r_error_index=ids_int_invalid !Index in the error_description list for "r" + real(ids_real) :: z=ids_real_invalid !Height + real(ids_real) :: z_error_upper=ids_real_invalid !Upper error for "z" + real(ids_real) :: z_error_lower=ids_real_invalid !Lower error for "z" + integer(ids_int) :: z_error_index=ids_int_invalid !Index in the error_description list for "z" + end type + + type ids_filter_window !Characteristics of the filter window (largely derived from curved_object), with some filter specific additions + character(len=ids_string_length), dimension(:), pointer :: identifier => null() !ID of the filter + type(ids_identifier_static) :: geometry_type !Geometry of the filter contour. Note that there is some flexibility in the choice of the local coordinate system (X1,X2,X3). The d! + !ata provider should choose the most convenient coordinate system for the filter, respecting the definitions of (X1,X2,X3) indicate! + !d below. + type(ids_identifier_static) :: curvature_type !Curvature of the filter. + type(ids_rzphi0d_static) :: centre !Coordinates of the origin of the local coordinate system (X1,X2,X3) describing the filter. This origin is located within the filte! + !r area and should be the middle point of the filter surface. If geometry_type=2, it's the centre of the circular filter. If geomet! + !ry_type=3, it's the centre of the rectangular filter. + real(ids_real) :: radius=ids_real_invalid !Radius of the circle, used only if geometry_type/index = 2 + real(ids_real) :: radius_error_upper=ids_real_invalid !Upper error for "radius" + real(ids_real) :: radius_error_lower=ids_real_invalid !Lower error for "radius" + integer(ids_int) :: radius_error_index=ids_int_invalid !Index in the error_description list for "radius" + type(ids_xyz0d_static) :: x1_unit_vector !Components of the X1 direction unit vector in the (X,Y,Z) coordinate system, where X is the major radius axis for phi = 0, Y is th! + !e major radius axis for phi = pi/2, and Z is the height axis. The X1 vector is more horizontal than X2 (has a smaller abs(Z) compo! + !nent) and oriented in the positive phi direction (counter-clockwise when viewing from above). + type(ids_xyz0d_static) :: x2_unit_vector !Components of the X2 direction unit vector in the (X,Y,Z) coordinate system, where X is the major radius axis for phi = 0, Y is th! + !e major radius axis for phi = pi/2, and Z is the height axis. The X2 axis is orthonormal so that uX2 = uX3 x uX1. + type(ids_xyz0d_static) :: x3_unit_vector !Components of the X3 direction unit vector in the (X,Y,Z) coordinate system, where X is the major radius axis for phi = 0, Y is th! + !e major radius axis for phi = pi/2, and Z is the height axis. The X3 axis is normal to the filter surface and oriented towards the! + ! plasma. + real(ids_real) :: x1_width=ids_real_invalid !Full width of the filter in the X1 direction, used only if geometry_type/index = 3 + real(ids_real) :: x1_width_error_upper=ids_real_invalid !Upper error for "x1_width" + real(ids_real) :: x1_width_error_lower=ids_real_invalid !Lower error for "x1_width" + integer(ids_int) :: x1_width_error_index=ids_int_invalid !Index in the error_description list for "x1_width" + real(ids_real) :: x2_width=ids_real_invalid !Full width of the filter in the X2 direction, used only if geometry_type/index = 3 + real(ids_real) :: x2_width_error_upper=ids_real_invalid !Upper error for "x2_width" + real(ids_real) :: x2_width_error_lower=ids_real_invalid !Lower error for "x2_width" + integer(ids_int) :: x2_width_error_index=ids_int_invalid !Index in the error_description list for "x2_width" + type(ids_x1x21d_static) :: outline !Irregular outline of the filter in the (X1, X2) coordinate system, used only if geometry_type/index=1. Do NOT repeat the first poi! + !nt. + real(ids_real) :: x1_curvature=ids_real_invalid !Radius of curvature in the X1 direction, to be filled only for curvature_type/index = 2, 4 or 5 + real(ids_real) :: x1_curvature_error_upper=ids_real_invalid !Upper error for "x1_curvature" + real(ids_real) :: x1_curvature_error_lower=ids_real_invalid !Lower error for "x1_curvature" + integer(ids_int) :: x1_curvature_error_index=ids_int_invalid !Index in the error_description list for "x1_curvature" + real(ids_real) :: x2_curvature=ids_real_invalid !Radius of curvature in the X2 direction, to be filled only for curvature_type/index = 3 or 5 + real(ids_real) :: x2_curvature_error_upper=ids_real_invalid !Upper error for "x2_curvature" + real(ids_real) :: x2_curvature_error_lower=ids_real_invalid !Lower error for "x2_curvature" + integer(ids_int) :: x2_curvature_error_index=ids_int_invalid !Index in the error_description list for "x2_curvature" + real(ids_real) :: surface=ids_real_invalid !Surface of the filter, derived from the above geometric data + real(ids_real) :: surface_error_upper=ids_real_invalid !Upper error for "surface" + real(ids_real) :: surface_error_lower=ids_real_invalid !Lower error for "surface" + integer(ids_int) :: surface_error_index=ids_int_invalid !Index in the error_description list for "surface" + type(ids_identifier_static) :: material !Material of the filter window + real(ids_real) :: thickness=ids_real_invalid !Thickness of the filter window + real(ids_real) :: thickness_error_upper=ids_real_invalid !Upper error for "thickness" + real(ids_real) :: thickness_error_lower=ids_real_invalid !Lower error for "thickness" + integer(ids_int) :: thickness_error_index=ids_int_invalid !Index in the error_description list for "thickness" + real(ids_real) :: wavelength_lower=ids_real_invalid !Lower bound of the filter wavelength range + real(ids_real) :: wavelength_lower_error_upper=ids_real_invalid !Upper error for "wavelength_lower" + real(ids_real) :: wavelength_lower_error_lower=ids_real_invalid !Lower error for "wavelength_lower" + integer(ids_int) :: wavelength_lower_error_index=ids_int_invalid !Index in the error_description list for "wavelength_lower" + real(ids_real) :: wavelength_upper=ids_real_invalid !Upper bound of the filter wavelength range + real(ids_real) :: wavelength_upper_error_upper=ids_real_invalid !Upper error for "wavelength_upper" + real(ids_real) :: wavelength_upper_error_lower=ids_real_invalid !Lower error for "wavelength_upper" + integer(ids_int) :: wavelength_upper_error_index=ids_int_invalid !Index in the error_description list for "wavelength_upper" + real(ids_real), pointer :: wavelengths(:) => null() !Array of wavelength values + real(ids_real), pointer :: wavelengths_error_upper(:) => null() !Upper error for "wavelengths" + real(ids_real), pointer :: wavelengths_error_lower(:) => null() !Lower error for "wavelengths" + integer(ids_int) :: wavelengths_error_index=ids_int_invalid !Index in the error_description list for "wavelengths" + real(ids_real), pointer :: photon_absorption(:) => null() !Probability of absorbing a photon passing through the filter as a function of its wavelength + real(ids_real), pointer :: photon_absorption_error_upper(:) => null() !Upper error for "photon_absorption" + real(ids_real), pointer :: photon_absorption_error_lower(:) => null() !Lower error for "photon_absorption" + integer(ids_int) :: photon_absorption_error_index=ids_int_invalid !Index in the error_description list for "photon_absorption" + end type + + type ids_detector_aperture !Generic description of a plane detector or collimating aperture + integer(ids_int) :: geometry_type=ids_int_invalid !Type of geometry used to describe the surface of the detector or aperture (1:'outline', 2:'circular', 3:'rectangle'). In case of '! + !outline', the surface is described by an outline of point in a local coordinate system defined by a centre and three unit vectors ! + !X1, X2, X3. Note that there is some flexibility here and the data provider should choose the most convenient coordinate system for! + ! the object, respecting the definitions of (X1,X2,X3) indicated below. In case of 'circular', the surface is a circle defined by i! + !ts centre, radius, and normal vector oriented towards the plasma X3. In case of 'rectangle', the surface is a rectangle defined b! + !y its centre, widths in the X1 and X2 directions, and normal vector oriented towards the plasma X3. + type(ids_rzphi0d_static) :: centre !If geometry_type=2, coordinates of the centre of the circle. If geometry_type=1 or 3, coordinates of the origin of the local coord! + !inate system (X1,X2,X3) describing the plane detector/aperture. This origin is located within the detector/aperture area. + real(ids_real) :: radius=ids_real_invalid !Radius of the circle, used only if geometry_type = 2 + real(ids_real) :: radius_error_upper=ids_real_invalid !Upper error for "radius" + real(ids_real) :: radius_error_lower=ids_real_invalid !Lower error for "radius" + integer(ids_int) :: radius_error_index=ids_int_invalid !Index in the error_description list for "radius" + type(ids_xyz0d_static) :: x1_unit_vector !Components of the X1 direction unit vector in the (X,Y,Z) coordinate system, where X is the major radius axis for phi = 0, Y is th! + !e major radius axis for phi = pi/2, and Z is the height axis. The X1 vector is more horizontal than X2 (has a smaller abs(Z) compo! + !nent) and oriented in the positive phi direction (counter-clockwise when viewing from above). + type(ids_xyz0d_static) :: x2_unit_vector !Components of the X2 direction unit vector in the (X,Y,Z) coordinate system, where X is the major radius axis for phi = 0, Y is th! + !e major radius axis for phi = pi/2, and Z is the height axis. The X2 axis is orthonormal so that uX2 = uX3 x uX1. + type(ids_xyz0d_static) :: x3_unit_vector !Components of the X3 direction unit vector in the (X,Y,Z) coordinate system, where X is the major radius axis for phi = 0, Y is th! + !e major radius axis for phi = pi/2, and Z is the height axis. The X3 axis is normal to the detector/aperture plane and oriented to! + !wards the plasma. + real(ids_real) :: x1_width=ids_real_invalid !Full width of the aperture in the X1 direction, used only if geometry_type = 3 + real(ids_real) :: x1_width_error_upper=ids_real_invalid !Upper error for "x1_width" + real(ids_real) :: x1_width_error_lower=ids_real_invalid !Lower error for "x1_width" + integer(ids_int) :: x1_width_error_index=ids_int_invalid !Index in the error_description list for "x1_width" + real(ids_real) :: x2_width=ids_real_invalid !Full width of the aperture in the X2 direction, used only if geometry_type = 3 + real(ids_real) :: x2_width_error_upper=ids_real_invalid !Upper error for "x2_width" + real(ids_real) :: x2_width_error_lower=ids_real_invalid !Lower error for "x2_width" + integer(ids_int) :: x2_width_error_index=ids_int_invalid !Index in the error_description list for "x2_width" + type(ids_x1x21d_static) :: outline !Irregular outline of the detector/aperture in the (X1, X2) coordinate system. Do NOT repeat the first point. + real(ids_real) :: surface=ids_real_invalid !Surface of the detector/aperture, derived from the above geometric data + real(ids_real) :: surface_error_upper=ids_real_invalid !Upper error for "surface" + real(ids_real) :: surface_error_lower=ids_real_invalid !Lower error for "surface" + integer(ids_int) :: surface_error_index=ids_int_invalid !Index in the error_description list for "surface" + end type + + type ids_curved_object !Generic description of a small plane or curved object (crystal, reflector, ...), using a generalization of the detector_aperture c! + !omplexType + character(len=ids_string_length), dimension(:), pointer :: identifier => null() !ID of the object + type(ids_identifier_static) :: geometry_type !Geometry of the object contour. Note that there is some flexibility in the choice of the local coordinate system (X1,X2,X3). The d! + !ata provider should choose the most convenient coordinate system for the object, respecting the definitions of (X1,X2,X3) indicate! + !d below. + type(ids_identifier_static) :: curvature_type !Curvature of the object. + type(ids_identifier_static) :: material !Material of the object + type(ids_rzphi0d_static) :: centre !Coordinates of the origin of the local coordinate system (X1,X2,X3) describing the object. This origin is located within the objec! + !t area and should be the middle point of the object surface. If geometry_type=2, it's the centre of the circular object. If geomet! + !ry_type=3, it's the centre of the rectangular object. + real(ids_real) :: radius=ids_real_invalid !Radius of the circle, used only if geometry_type/index = 2 + real(ids_real) :: radius_error_upper=ids_real_invalid !Upper error for "radius" + real(ids_real) :: radius_error_lower=ids_real_invalid !Lower error for "radius" + integer(ids_int) :: radius_error_index=ids_int_invalid !Index in the error_description list for "radius" + type(ids_xyz0d_static) :: x1_unit_vector !Components of the X1 direction unit vector in the (X,Y,Z) coordinate system, where X is the major radius axis for phi = 0, Y is th! + !e major radius axis for phi = pi/2, and Z is the height axis. The X1 vector is more horizontal than X2 (has a smaller abs(Z) compo! + !nent) and oriented in the positive phi direction (counter-clockwise when viewing from above). + type(ids_xyz0d_static) :: x2_unit_vector !Components of the X2 direction unit vector in the (X,Y,Z) coordinate system, where X is the major radius axis for phi = 0, Y is th! + !e major radius axis for phi = pi/2, and Z is the height axis. The X2 axis is orthonormal so that uX2 = uX3 x uX1. + type(ids_xyz0d_static) :: x3_unit_vector !Components of the X3 direction unit vector in the (X,Y,Z) coordinate system, where X is the major radius axis for phi = 0, Y is th! + !e major radius axis for phi = pi/2, and Z is the height axis. The X3 axis is normal to the object surface and oriented towards the! + ! plasma. + real(ids_real) :: x1_width=ids_real_invalid !Full width of the object in the X1 direction, used only if geometry_type/index = 3 + real(ids_real) :: x1_width_error_upper=ids_real_invalid !Upper error for "x1_width" + real(ids_real) :: x1_width_error_lower=ids_real_invalid !Lower error for "x1_width" + integer(ids_int) :: x1_width_error_index=ids_int_invalid !Index in the error_description list for "x1_width" + real(ids_real) :: x2_width=ids_real_invalid !Full width of the object in the X2 direction, used only if geometry_type/index = 3 + real(ids_real) :: x2_width_error_upper=ids_real_invalid !Upper error for "x2_width" + real(ids_real) :: x2_width_error_lower=ids_real_invalid !Lower error for "x2_width" + integer(ids_int) :: x2_width_error_index=ids_int_invalid !Index in the error_description list for "x2_width" + type(ids_x1x21d_static) :: outline !Irregular outline of the object in the (X1, X2) coordinate system, used only if geometry_type/index=1. Do NOT repeat the first poi! + !nt. + real(ids_real) :: x1_curvature=ids_real_invalid !Radius of curvature in the X1 direction, to be filled only for curvature_type/index = 2, 4 or 5 + real(ids_real) :: x1_curvature_error_upper=ids_real_invalid !Upper error for "x1_curvature" + real(ids_real) :: x1_curvature_error_lower=ids_real_invalid !Lower error for "x1_curvature" + integer(ids_int) :: x1_curvature_error_index=ids_int_invalid !Index in the error_description list for "x1_curvature" + real(ids_real) :: x2_curvature=ids_real_invalid !Radius of curvature in the X2 direction, to be filled only for curvature_type/index = 3 or 5 + real(ids_real) :: x2_curvature_error_upper=ids_real_invalid !Upper error for "x2_curvature" + real(ids_real) :: x2_curvature_error_lower=ids_real_invalid !Lower error for "x2_curvature" + integer(ids_int) :: x2_curvature_error_index=ids_int_invalid !Index in the error_description list for "x2_curvature" + real(ids_real) :: surface=ids_real_invalid !Surface of the object, derived from the above geometric data + real(ids_real) :: surface_error_upper=ids_real_invalid !Upper error for "surface" + real(ids_real) :: surface_error_lower=ids_real_invalid !Lower error for "surface" + integer(ids_int) :: surface_error_index=ids_int_invalid !Index in the error_description list for "surface" + end type + + type ids_polarizer !Generic description of a polarizer (extension of the detector_aperture complex type) + type(ids_rzphi0d_static) :: centre !If geometry_type=2, coordinates of the centre of the circle. If geometry_type=1 or 3, coordinates of the origin of the local coord! + !inate system (X1,X2,X3) describing the plane polarizer. This origin is located within the polarizer area. Note that there is some ! + !flexibility here and the data provider should choose the most convenient coordinate system for the object, respecting the definiti! + !ons of (X1,X2,X3) indicated below. + real(ids_real) :: radius=ids_real_invalid !Radius of the circle, used only if geometry_type = 2 + real(ids_real) :: radius_error_upper=ids_real_invalid !Upper error for "radius" + real(ids_real) :: radius_error_lower=ids_real_invalid !Lower error for "radius" + integer(ids_int) :: radius_error_index=ids_int_invalid !Index in the error_description list for "radius" + type(ids_xyz0d_static) :: x1_unit_vector !Components of the X1 direction unit vector in the (X,Y,Z) coordinate system, where X is the major radius axis for phi = 0, Y is th! + !e major radius axis for phi = pi/2, and Z is the height axis. The X1 vector is more horizontal than X2 (has a smaller abs(Z) compo! + !nent) and oriented in the positive phi direction (counter-clockwise when viewing from above). + type(ids_xyz0d_static) :: x2_unit_vector !Components of the X2 direction unit vector in the (X,Y,Z) coordinate system, where X is the major radius axis for phi = 0, Y is th! + !e major radius axis for phi = pi/2, and Z is the height axis. The X2 axis is orthonormal so that uX2 = uX3 x uX1. + type(ids_xyz0d_static) :: x3_unit_vector !Components of the X3 direction unit vector in the (X,Y,Z) coordinate system, where X is the major radius axis for phi = 0, Y is th! + !e major radius axis for phi = pi/2, and Z is the height axis. The X3 axis is normal to the polarizer plane and oriented towards th! + !e plasma. + real(ids_real) :: polarization_angle=ids_real_invalid !Alignment angle of the polarizer in the (x1,x2) plane. Electric fields parallel to the polarizer angle will be reflected. The angl! + !e is defined with respect to the x1 unit vector, positive in the counter-clockwise direction when looking towards the plasma + real(ids_real) :: polarization_angle_error_upper=ids_real_invalid !Upper error for "polarization_angle" + real(ids_real) :: polarization_angle_error_lower=ids_real_invalid !Lower error for "polarization_angle" + integer(ids_int) :: polarization_angle_error_index=ids_int_invalid !Index in the error_description list for "polarization_angle" + end type + + type ids_line_of_sight_2points_rz !Generic description of a line of sight, defined by two points, in R and Z only + type(ids_rz0d_static) :: first_point !Position of the first point + type(ids_rz0d_static) :: second_point !Position of the second point + end type + + type ids_line_of_sight_2points !Generic description of a line of sight, defined by two points + type(ids_rzphi0d_static) :: first_point !Position of the first point + type(ids_rzphi0d_static) :: second_point !Position of the second point + end type + + type ids_line_of_sight_2points_rzphi_2d !Generic description of a line of sight, defined by two points + type(ids_rzphi2d_static) :: first_point !Position of the first point + type(ids_rzphi2d_static) :: second_point !Position of the second point + end type + + type ids_line_of_sight_2points_dynamic_aos1 !Generic description of a line of sight, defined by two points, dynamic within an AoS1 (1st point fixed, 2nd point is dynamic) + type(ids_rzphi0d_static) :: first_point !Position of the first point + type(ids_rzphi1d_dynamic_aos1_common_time) :: second_point !Position of the second point (possibly dynamic) + type(ids_identifier) :: moving_mode !Moving mode of the line of sight. Index = 0 : no movement, fixed position. Index = 1 : oscillating + type(ids_signal_flt_1d) :: position_parameter !In case of line of sight moving during a pulse, position parameter allowing to record and compute the line of sight position as a ! + !function of time + real(ids_real) :: amplitude_parameter=ids_real_invalid !Amplitude of the line of sight position parameter oscillation (in case moving_mode/index = 1) + real(ids_real) :: amplitude_parameter_error_upper=ids_real_invalid !Upper error for "amplitude_parameter" + real(ids_real) :: amplitude_parameter_error_lower=ids_real_invalid !Lower error for "amplitude_parameter" + integer(ids_int) :: amplitude_parameter_error_index=ids_int_invalid !Index in the error_description list for "amplitude_parameter" + real(ids_real) :: period=ids_real_invalid !Period of the line of sight oscillation (in case moving_mode/index = 1) + real(ids_real) :: period_error_upper=ids_real_invalid !Upper error for "period" + real(ids_real) :: period_error_lower=ids_real_invalid !Lower error for "period" + integer(ids_int) :: period_error_index=ids_int_invalid !Index in the error_description list for "period" + end type + + type ids_line_of_sight_2points_dynamic_aos3 !Generic description of a line of sight, defined by two points, dynamic within a type 3 array of structures (index on time) + type(ids_rzphi0d_dynamic_aos3) :: first_point !Position of the first point + type(ids_rzphi0d_dynamic_aos3) :: second_point !Position of the second point + end type + + type ids_line_of_sight_3points !Generic description of a line of sight, defined by two points (one way) and an optional third point to indicate the direction of r! + !eflection if the second point is e.g. the position of a mirror reflecting the line-of-sight + type(ids_rzphi0d_static) :: first_point !Position of the first point + type(ids_rzphi0d_static) :: second_point !Position of the second point + type(ids_rzphi0d_static) :: third_point !Position of the third point + end type + + type ids_camera_geometry !Camera geometry. The orientation of the camera is described as follows : pixels are aligned along x1 and x2 unit vectors while x3 ! + !is normal to the detector plane. + character(len=ids_string_length), dimension(:), pointer :: identifier => null() !ID of the camera + real(ids_real), pointer :: pixel_dimensions(:) => null() !Pixel dimension in each direction (x1, x2) + real(ids_real), pointer :: pixel_dimensions_error_upper(:) => null() !Upper error for "pixel_dimensions" + real(ids_real), pointer :: pixel_dimensions_error_lower(:) => null() !Lower error for "pixel_dimensions" + integer(ids_int) :: pixel_dimensions_error_index=ids_int_invalid !Index in the error_description list for "pixel_dimensions" + integer(ids_int), pointer :: pixels_n(:) => null() !Number of pixels in each direction (x1, x2) + type(ids_rzphi2d_static) :: pixel_position !Position of the centre of each pixel. First dimension : line index (x1 axis). Second dimension: column index (x2 axis). + real(ids_real), pointer :: camera_dimensions(:) => null() !Total camera dimension in each direction (x1, x2) + real(ids_real), pointer :: camera_dimensions_error_upper(:) => null() !Upper error for "camera_dimensions" + real(ids_real), pointer :: camera_dimensions_error_lower(:) => null() !Lower error for "camera_dimensions" + integer(ids_int) :: camera_dimensions_error_index=ids_int_invalid !Index in the error_description list for "camera_dimensions" + type(ids_rzphi0d_static) :: centre !Position of the camera centre + type(ids_xyz0d_static) :: x1_unit_vector !Components of the X1 direction unit vector in the (X,Y,Z) coordinate system, where X is the major radius axis for phi = 0, Y is th! + !e major radius axis for phi = pi/2, and Z is the height axis. The X1 vector is more horizontal than X2 (has a smaller abs(Z) compo! + !nent) and oriented in the positive phi direction (counter-clockwise when viewing from above). + type(ids_xyz0d_static) :: x2_unit_vector !Components of the X2 direction unit vector in the (X,Y,Z) coordinate system, where X is the major radius axis for phi = 0, Y is th! + !e major radius axis for phi = pi/2, and Z is the height axis. The X2 axis is orthonormal so that uX2 = uX3 x uX1. + type(ids_xyz0d_static) :: x3_unit_vector !Components of the X3 direction unit vector in the (X,Y,Z) coordinate system, where X is the major radius axis for phi = 0, Y is th! + !e major radius axis for phi = pi/2, and Z is the height axis. The X3 axis is normal to the camera plane and oriented towards the p! + !lasma. + type(ids_line_of_sight_2points_rzphi_2d) :: line_of_sight !Description of the line of sight for each pixel, given by 2 points. For each coordinate : first dimension : line index (x1 axis); ! + !second dimension: column index (x2 axis). + end type + + type ids_entry_tag !Tag qualifying an entry or a list of entries + character(len=ids_string_length), dimension(:), pointer :: name => null() !Name of the tag + character(len=ids_string_length), dimension(:), pointer :: comment => null() !Any comment describing the content of the tagged list of entries + end type + + type ids_oblique_static !Description of a 2D parallelogram + real(ids_real) :: r=ids_real_invalid !Major radius of the reference point (from which the alpha and beta angles are defined, marked by a + on the diagram) + real(ids_real) :: r_error_upper=ids_real_invalid !Upper error for "r" + real(ids_real) :: r_error_lower=ids_real_invalid !Lower error for "r" + integer(ids_int) :: r_error_index=ids_int_invalid !Index in the error_description list for "r" + real(ids_real) :: z=ids_real_invalid !Height of the reference point (from which the alpha and beta angles are defined, marked by a + on the diagram) + real(ids_real) :: z_error_upper=ids_real_invalid !Upper error for "z" + real(ids_real) :: z_error_lower=ids_real_invalid !Lower error for "z" + integer(ids_int) :: z_error_index=ids_int_invalid !Index in the error_description list for "z" + real(ids_real) :: length_alpha=ids_real_invalid !Length of the parallelogram side inclined with angle alpha with respect to the major radius axis + real(ids_real) :: length_alpha_error_upper=ids_real_invalid !Upper error for "length_alpha" + real(ids_real) :: length_alpha_error_lower=ids_real_invalid !Lower error for "length_alpha" + integer(ids_int) :: length_alpha_error_index=ids_int_invalid !Index in the error_description list for "length_alpha" + real(ids_real) :: length_beta=ids_real_invalid !Length of the parallelogram side inclined with angle beta with respect to the height axis + real(ids_real) :: length_beta_error_upper=ids_real_invalid !Upper error for "length_beta" + real(ids_real) :: length_beta_error_lower=ids_real_invalid !Lower error for "length_beta" + integer(ids_int) :: length_beta_error_index=ids_int_invalid !Index in the error_description list for "length_beta" + real(ids_real) :: alpha=ids_real_invalid !Inclination of first angle measured counter-clockwise from horizontal outwardly directed radial vector (grad R). + real(ids_real) :: alpha_error_upper=ids_real_invalid !Upper error for "alpha" + real(ids_real) :: alpha_error_lower=ids_real_invalid !Lower error for "alpha" + integer(ids_int) :: alpha_error_index=ids_int_invalid !Index in the error_description list for "alpha" + real(ids_real) :: beta=ids_real_invalid !Inclination of second angle measured counter-clockwise from vertically upwards directed vector (grad Z). If both alpha and beta ar! + !e zero (rectangle) then the simpler rectangular elements description should be used. + real(ids_real) :: beta_error_upper=ids_real_invalid !Upper error for "beta" + real(ids_real) :: beta_error_lower=ids_real_invalid !Lower error for "beta" + integer(ids_int) :: beta_error_index=ids_int_invalid !Index in the error_description list for "beta" + end type + + type ids_thick_line_static !2D contour approximated by two points and a thickness (in the direction perpendicular to the segment) in the poloidal cross-sectio! + !n + type(ids_rz0d_static) :: first_point !Position of the first point + type(ids_rz0d_static) :: second_point !Position of the second point + real(ids_real) :: thickness=ids_real_invalid !Thickness + real(ids_real) :: thickness_error_upper=ids_real_invalid !Upper error for "thickness" + real(ids_real) :: thickness_error_lower=ids_real_invalid !Lower error for "thickness" + integer(ids_int) :: thickness_error_index=ids_int_invalid !Index in the error_description list for "thickness" + end type + + type ids_arcs_of_circle_static !Arcs of circle description of a 2D contour + real(ids_real), pointer :: r(:) => null() !Major radii of the start point of each arc of circle + real(ids_real), pointer :: r_error_upper(:) => null() !Upper error for "r" + real(ids_real), pointer :: r_error_lower(:) => null() !Lower error for "r" + integer(ids_int) :: r_error_index=ids_int_invalid !Index in the error_description list for "r" + real(ids_real), pointer :: z(:) => null() !Height of the start point of each arc of circle + real(ids_real), pointer :: z_error_upper(:) => null() !Upper error for "z" + real(ids_real), pointer :: z_error_lower(:) => null() !Lower error for "z" + integer(ids_int) :: z_error_index=ids_int_invalid !Index in the error_description list for "z" + real(ids_real), pointer :: curvature_radii(:) => null() !Curvature radius of each arc of circle + real(ids_real), pointer :: curvature_radii_error_upper(:) => null() !Upper error for "curvature_radii" + real(ids_real), pointer :: curvature_radii_error_lower(:) => null() !Lower error for "curvature_radii" + integer(ids_int) :: curvature_radii_error_index=ids_int_invalid !Index in the error_description list for "curvature_radii" + end type + + type ids_rectangle_static !Rectangular description of a 2D object + real(ids_real) :: r=ids_real_invalid !Geometric centre R + real(ids_real) :: r_error_upper=ids_real_invalid !Upper error for "r" + real(ids_real) :: r_error_lower=ids_real_invalid !Lower error for "r" + integer(ids_int) :: r_error_index=ids_int_invalid !Index in the error_description list for "r" + real(ids_real) :: z=ids_real_invalid !Geometric centre Z + real(ids_real) :: z_error_upper=ids_real_invalid !Upper error for "z" + real(ids_real) :: z_error_lower=ids_real_invalid !Lower error for "z" + integer(ids_int) :: z_error_index=ids_int_invalid !Index in the error_description list for "z" + real(ids_real) :: width=ids_real_invalid !Horizontal full width + real(ids_real) :: width_error_upper=ids_real_invalid !Upper error for "width" + real(ids_real) :: width_error_lower=ids_real_invalid !Lower error for "width" + integer(ids_int) :: width_error_index=ids_int_invalid !Index in the error_description list for "width" + real(ids_real) :: height=ids_real_invalid !Vertical full height + real(ids_real) :: height_error_upper=ids_real_invalid !Upper error for "height" + real(ids_real) :: height_error_lower=ids_real_invalid !Lower error for "height" + integer(ids_int) :: height_error_index=ids_int_invalid !Index in the error_description list for "height" + end type + + type ids_annulus_static !Annulus description (2D object) + real(ids_real) :: r=ids_real_invalid !Centre major radius + real(ids_real) :: r_error_upper=ids_real_invalid !Upper error for "r" + real(ids_real) :: r_error_lower=ids_real_invalid !Lower error for "r" + integer(ids_int) :: r_error_index=ids_int_invalid !Index in the error_description list for "r" + real(ids_real) :: z=ids_real_invalid !Centre height + real(ids_real) :: z_error_upper=ids_real_invalid !Upper error for "z" + real(ids_real) :: z_error_lower=ids_real_invalid !Lower error for "z" + integer(ids_int) :: z_error_index=ids_int_invalid !Index in the error_description list for "z" + real(ids_real) :: radius_inner=ids_real_invalid !Inner radius + real(ids_real) :: radius_inner_error_upper=ids_real_invalid !Upper error for "radius_inner" + real(ids_real) :: radius_inner_error_lower=ids_real_invalid !Lower error for "radius_inner" + integer(ids_int) :: radius_inner_error_index=ids_int_invalid !Index in the error_description list for "radius_inner" + real(ids_real) :: radius_outer=ids_real_invalid !Outer radius + real(ids_real) :: radius_outer_error_upper=ids_real_invalid !Upper error for "radius_outer" + real(ids_real) :: radius_outer_error_lower=ids_real_invalid !Lower error for "radius_outer" + integer(ids_int) :: radius_outer_error_index=ids_int_invalid !Index in the error_description list for "radius_outer" + end type + + type ids_outline_2d_geometry_static !Description of 2D geometry + integer(ids_int) :: geometry_type=ids_int_invalid !Type used to describe the element shape (1:'outline', 2:'rectangle', 3:'oblique', 4:'arcs of circle, 5: 'annulus', 6 : 'thick line! + !') + type(ids_rz1d_static) :: outline !Irregular outline of the element. Do NOT repeat the first point. + type(ids_rectangle_static) :: rectangle !Rectangular description of the element + type(ids_oblique_static) :: oblique !Parallelogram description of the element + type(ids_arcs_of_circle_static) :: arcs_of_circle !Description of the element contour by a set of arcs of circle. For each of these, the position of the start point is given togethe! + !r with the curvature radius. The end point is given by the start point of the next arc of circle. + type(ids_annulus_static) :: annulus !The element is an annulus of centre R, Z, with inner radius radius_inner and outer radius radius_outer + type(ids_thick_line_static) :: thick_line !The element is approximated by a rectangle defined by a central segment and a thickness in the direction perpendicular to the segm! + !ent + end type + + type ids_pf_coils_elements !Each PF coil is comprised of a number of cross-section elements described individually + character(len=ids_string_length), dimension(:), pointer :: name => null() !Name of this element + character(len=ids_string_length), dimension(:), pointer :: identifier => null() !Identifier of this element + real(ids_real) :: turns_with_sign=ids_real_invalid !Number of effective turns in the element for calculating magnetic fields of the coil/loop; includes the sign of the number of turn! + !s (positive means current is counter-clockwise when seen from above) + real(ids_real) :: turns_with_sign_error_upper=ids_real_invalid !Upper error for "turns_with_sign" + real(ids_real) :: turns_with_sign_error_lower=ids_real_invalid !Lower error for "turns_with_sign" + integer(ids_int) :: turns_with_sign_error_index=ids_int_invalid !Index in the error_description list for "turns_with_sign" + real(ids_real) :: area=ids_real_invalid !Cross-sectional areas of the element + real(ids_real) :: area_error_upper=ids_real_invalid !Upper error for "area" + real(ids_real) :: area_error_lower=ids_real_invalid !Lower error for "area" + integer(ids_int) :: area_error_index=ids_int_invalid !Index in the error_description list for "area" + type(ids_outline_2d_geometry_static) :: geometry !Cross-sectional shape of the element + end type + + type ids_temperature_reference !Structure describing the reference temperature for which static data are given + character(len=ids_string_length), dimension(:), pointer :: description => null() !Description of how the reference temperature is defined : for which object, at which location, ... + real(ids_real) :: data=ids_real_invalid !Reference temperature + real(ids_real) :: data_error_upper=ids_real_invalid !Upper error for "data" + real(ids_real) :: data_error_lower=ids_real_invalid !Lower error for "data" + integer(ids_int) :: data_error_index=ids_int_invalid !Index in the error_description list for "data" + end type + + type ids_vessel_2d_element !2D vessel block element description + character(len=ids_string_length), dimension(:), pointer :: name => null() !Name of the block element + type(ids_rz1d_static_closed_flag) :: outline !Outline of the block element. Do NOT repeat the first point for closed contours + real(ids_real) :: resistivity=ids_real_invalid !Resistivity of the block element + real(ids_real) :: resistivity_error_upper=ids_real_invalid !Upper error for "resistivity" + real(ids_real) :: resistivity_error_lower=ids_real_invalid !Lower error for "resistivity" + integer(ids_int) :: resistivity_error_index=ids_int_invalid !Index in the error_description list for "resistivity" + type(ids_signal_flt_1d) :: j_tor !Toroidal current induced in this block element + real(ids_real) :: resistance=ids_real_invalid !Resistance of the block element + real(ids_real) :: resistance_error_upper=ids_real_invalid !Upper error for "resistance" + real(ids_real) :: resistance_error_lower=ids_real_invalid !Lower error for "resistance" + integer(ids_int) :: resistance_error_index=ids_int_invalid !Index in the error_description list for "resistance" + end type + + type ids_vessel_2d_annular !2D vessel annular description + type(ids_rz1d_static_closed_flag) :: outline_inner !Inner vessel outline. Do NOT repeat the first point for closed contours + type(ids_rz1d_static_closed_flag) :: outline_outer !Outer vessel outline. Do NOT repeat the first point for closed contours + type(ids_rz1d_static_closed_flag) :: centreline !Centreline, i.e. middle of the vessel layer as a series of point. Do NOT repeat the first point for closed contours + real(ids_real), pointer :: thickness(:) => null() !Thickness of the vessel layer in the perpendicular direction to the centreline. Thickness(i) is the thickness of the layer betwee! + !n centreline/r(i),z(i) and centreline/r(i+1),z(i+1) + real(ids_real), pointer :: thickness_error_upper(:) => null() !Upper error for "thickness" + real(ids_real), pointer :: thickness_error_lower(:) => null() !Lower error for "thickness" + integer(ids_int) :: thickness_error_index=ids_int_invalid !Index in the error_description list for "thickness" + real(ids_real) :: resistivity=ids_real_invalid !Resistivity of the vessel unit + real(ids_real) :: resistivity_error_upper=ids_real_invalid !Upper error for "resistivity" + real(ids_real) :: resistivity_error_lower=ids_real_invalid !Lower error for "resistivity" + integer(ids_int) :: resistivity_error_index=ids_int_invalid !Index in the error_description list for "resistivity" + end type + + type ids_vessel_2d_unit !2D vessel unit description + character(len=ids_string_length), dimension(:), pointer :: name => null() !Name of the unit + character(len=ids_string_length), dimension(:), pointer :: identifier => null() !Identifier of the unit + type(ids_vessel_2d_annular) :: annular !Annular representation of a layer by two contours, inner and outer. Alternatively, the layer can be described by a centreline and ! + !thickness. + type(ids_vessel_2d_element), pointer :: element(:) => null() !Set of block elements + end type + + type ids_vessel_2d !2D vessel description + type(ids_identifier_static) :: type !Type of the description. index = 0 for the official single/multiple annular representation and 1 for the official block element re! + !presentation for each unit. Additional representations needed on a code-by-code basis follow same incremental pair tagging startin! + !g on index=2 + type(ids_vessel_2d_unit), pointer :: unit(:) => null() !Set of units + end type + + type ids_waves_coherent_wave_identifier !Wave identifier + type(ids_identifier) :: type !Wave/antenna type. index=1 for name=EC; index=2 for name=IC; index=3 for name=LH + character(len=ids_string_length), dimension(:), pointer :: antenna_name => null() !Name of the antenna that launches this wave. Corresponds to the name specified in antennas/ec(i)/name, or antennas/ic(i)/name or a! + !ntennas/lh(i)/name (depends of antenna/wave type) in the ANTENNAS IDS. + integer(ids_int) :: index_in_antenna=ids_int_invalid !Index of the wave (starts at 1), separating different waves generated from a single antenna. + end type + + type ids_version_dd_al !Version of the access layer package used to PUT this IDS + character(len=ids_string_length), dimension(:), pointer :: data_dictionary => null() !Version of Data Dictionary used to PUT this IDS + character(len=ids_string_length), dimension(:), pointer :: access_layer => null() !Version of Access Layer used to PUT this IDS + character(len=ids_string_length), dimension(:), pointer :: access_layer_language => null() !Programming language of the Access Layer high level API used to PUT this IDS + end type + + type ids_data_entry !Definition of a data entry + character(len=ids_string_length), dimension(:), pointer :: user => null() !Username + character(len=ids_string_length), dimension(:), pointer :: machine => null() !Name of the experimental device to which this data is related + character(len=ids_string_length), dimension(:), pointer :: pulse_type => null() !Type of the data entry, e.g. "pulse", "simulation", ... + integer(ids_int) :: pulse=ids_int_invalid !Pulse number + integer(ids_int) :: run=ids_int_invalid !Run number + end type + + type ids_ids_provenance_node !Provenance information for a given node of the IDS + character(len=ids_string_length), dimension(:), pointer :: path => null() !Path of the node within the IDS, following the syntax given in the link below. If empty, means the provenance information applies ! + !to the whole IDS. + character(len=ids_string_length), dimension(:), pointer :: sources => null() !List of sources used to import or calculate this node, identified as explained below. In case the node is the result of of a calcu! + !lation / data processing, the source is an input to the process described in the "code" structure at the root of the IDS. The sour! + !ce can be an IDS (identified by a URI or a persitent identifier, see syntax in the link below) or non-IDS data imported directly f! + !rom an non-IMAS database (identified by the command used to import the source, or the persistent identifier of the data source). O! + !ften data are obtained by a chain of processes, however only the last process input are recorded here. The full chain of provenanc! + !e has then to be reconstructed recursively from the provenance information contained in the data sources. + end type + + type ids_ids_provenance !Provenance information about the IDS + type(ids_ids_provenance_node), pointer :: node(:) => null() !Set of IDS nodes for which the provenance is given. The provenance information applies to the whole structure below the IDS node. ! + !For documenting provenance information for the whole IDS, set the size of this array of structure to 1 and leave the child "path" ! + !node empty + end type + + type ids_ids_identification !Identifier of an IDS + character(len=ids_string_length), dimension(:), pointer :: name => null() !IDS name + integer(ids_int) :: occurrence=ids_int_invalid !IDS occurrence + type(ids_data_entry) :: data_entry !Data entry to which this IDS belongs + end type + + type ids_plasma_composition !Generic declaration of Plasma Composition for a simulation + type(ids_plasma_composition_ions), pointer :: ion(:) => null() !Array of plasma ions + end type + + type ids_code !Generic decription of the code-specific parameters for the code that has produced this IDS + character(len=ids_string_length), dimension(:), pointer :: name => null() !Name of software generating IDS + character(len=ids_string_length), dimension(:), pointer :: commit => null() !Unique commit reference of software + character(len=ids_string_length), dimension(:), pointer :: version => null() !Unique version (tag) of software + character(len=ids_string_length), dimension(:), pointer :: repository => null() !URL of software repository + character(len=ids_string_length), dimension(:), pointer :: parameters => null() !List of the code specific parameters in XML format + integer(ids_int), pointer :: output_flag(:) => null() !Output flag : 0 means the run is successful, other values mean some difficulty has been encountered, the exact meaning is then cod! + !e specific. Negative values mean the result shall not be used. + type(ids_library), pointer :: library(:) => null() !List of external libraries used by the code that has produced this IDS + end type + + type ids_parameters_input !Code parameters block passed from the wrapper to the subroutine. Does not appear as such in the data structure. This is inserted i! + !n DD_Support.xsd for automatic declaration in the Fortran and C++ type definitions. + character(len=ids_string_length), dimension(:), pointer :: parameters_value => null() !Actual value of the code parameters (instance of Code_Parameters/Parameters in XML format) + character(len=ids_string_length), dimension(:), pointer :: parameters_default => null() !Default value of the code parameters (instance of Code_Parameters/Parameters in XML format) + character(len=ids_string_length), dimension(:), pointer :: schema => null() !Code parameters schema + end type + + type ids_error_description !Error description, an array of this structure is passed as argument of the access layer calls (get and put) for handling errorbars! + !. Does not appear as such in the data structure. This is inserted in dd_support.xsd for automatic declaration in the Fortran and C! + !++ type definitions. + integer(ids_int) :: symmetric=ids_int_invalid !Flag indicating whether the error is “+/-“ symmetric (1) or not (0) + type(ids_identifier) :: type !Type of error bar description which is used (assumed to be identical for the lower and upper error): constant_absolute|constant_re! + !lative|explicit_values|expression + character(len=ids_string_length), dimension(:), pointer :: expression_upper_0d => null() !Upper error expression (absolute value taken), for 1D dynamic quantities + character(len=ids_string_length), dimension(:), pointer :: expression_upper_1d => null() !Upper error expression (absolute value taken), for 2D dynamic quantities. If its dimension is equal to 1, the same error expressio! + !n is applied to all indices of the original physical quantity + character(len=ids_string_length), dimension(:), pointer :: expression_lower_0d => null() !Lower error expression (absolute value taken), for 1D dynamic quantities + character(len=ids_string_length), dimension(:), pointer :: expression_lower_1d => null() !Lower error expression (absolute value taken), for 2D dynamic quantities. If its dimension is equal to 1, the same error expressio! + !n is applied to all indices of the original physical quantity + end type + + type ids_ids_properties !Interface Data Structure properties. This element identifies the node above as an IDS + character(len=ids_string_length), dimension(:), pointer :: comment => null() !Any comment describing the content of this IDS + integer(ids_int) :: homogeneous_time=ids_int_invalid !This node must be filled (with 0, 1, or 2) for the IDS to be valid. If 1, the time of this IDS is homogeneous, i.e. the time value! + !s for this IDS are stored in the time node just below the root of this IDS. If 0, the time values are stored in the various time f! + !ields at lower levels in the tree. In the case only constant or static nodes are filled within the IDS, homogeneous_time must be s! + !et to 2 + character(len=ids_string_length), dimension(:), pointer :: source => null() !Source of the data (any comment describing the origin of the data : code, path to diagnostic signals, processing method, ...). Sup! + !erseeded by the new provenance structure. + character(len=ids_string_length), dimension(:), pointer :: provider => null() !Name of the person in charge of producing this data + character(len=ids_string_length), dimension(:), pointer :: creation_date => null() !Date at which this data has been produced + type(ids_version_dd_al) :: version_put !Version of the access layer package used to PUT this IDS + type(ids_ids_provenance) :: provenance !Provenance information about this IDS + end type + + +end module ! end of the utilities module + + + +module ids_schemas ! declaration of all IDSs + +use ids_utilities + + + +interface set_c_data + + module procedure set_c_data_amns_data + module procedure set_c_data_barometry + module procedure set_c_data_bolometer + module procedure set_c_data_bremsstrahlung_visible + module procedure set_c_data_calorimetry + module procedure set_c_data_camera_ir + module procedure set_c_data_camera_visible + module procedure set_c_data_camera_x_rays + module procedure set_c_data_charge_exchange + module procedure set_c_data_coils_non_axisymmetric + module procedure set_c_data_controllers + module procedure set_c_data_core_instant_changes + module procedure set_c_data_core_profiles + module procedure set_c_data_core_sources + module procedure set_c_data_core_transport + module procedure set_c_data_cryostat + module procedure set_c_data_dataset_description + module procedure set_c_data_dataset_fair + module procedure set_c_data_disruption + module procedure set_c_data_distribution_sources + module procedure set_c_data_distributions + module procedure set_c_data_divertors + module procedure set_c_data_ec_launchers + module procedure set_c_data_ece + module procedure set_c_data_edge_profiles + module procedure set_c_data_edge_sources + module procedure set_c_data_edge_transport + module procedure set_c_data_em_coupling + module procedure set_c_data_equilibrium + module procedure set_c_data_gas_injection + module procedure set_c_data_gas_pumping + module procedure set_c_data_gyrokinetics + module procedure set_c_data_hard_x_rays + module procedure set_c_data_ic_antennas + module procedure set_c_data_interferometer + module procedure set_c_data_iron_core + module procedure set_c_data_langmuir_probes + module procedure set_c_data_lh_antennas + module procedure set_c_data_magnetics + module procedure set_c_data_mhd + module procedure set_c_data_mhd_linear + module procedure set_c_data_mse + module procedure set_c_data_nbi + module procedure set_c_data_neutron_diagnostic + module procedure set_c_data_ntms + module procedure set_c_data_pellets + module procedure set_c_data_pf_active + module procedure set_c_data_pf_passive + module procedure set_c_data_plasma_initiation + module procedure set_c_data_polarimeter + module procedure set_c_data_pulse_schedule + module procedure set_c_data_radiation + module procedure set_c_data_real_time_data + module procedure set_c_data_reflectometer_profile + module procedure set_c_data_refractometer + module procedure set_c_data_sawteeth + module procedure set_c_data_soft_x_rays + module procedure set_c_data_spectrometer_mass + module procedure set_c_data_spectrometer_uv + module procedure set_c_data_spectrometer_visible + module procedure set_c_data_spectrometer_x_ray_crystal + module procedure set_c_data_summary + module procedure set_c_data_temporary + module procedure set_c_data_thomson_scattering + module procedure set_c_data_tf + module procedure set_c_data_transport_solver_numerics + module procedure set_c_data_turbulence + module procedure set_c_data_wall + module procedure set_c_data_waves + module procedure set_c_data_workflow +end interface + +interface is_c_data + + module procedure is_c_data_amns_data + module procedure is_c_data_barometry + module procedure is_c_data_bolometer + module procedure is_c_data_bremsstrahlung_visible + module procedure is_c_data_calorimetry + module procedure is_c_data_camera_ir + module procedure is_c_data_camera_visible + module procedure is_c_data_camera_x_rays + module procedure is_c_data_charge_exchange + module procedure is_c_data_coils_non_axisymmetric + module procedure is_c_data_controllers + module procedure is_c_data_core_instant_changes + module procedure is_c_data_core_profiles + module procedure is_c_data_core_sources + module procedure is_c_data_core_transport + module procedure is_c_data_cryostat + module procedure is_c_data_dataset_description + module procedure is_c_data_dataset_fair + module procedure is_c_data_disruption + module procedure is_c_data_distribution_sources + module procedure is_c_data_distributions + module procedure is_c_data_divertors + module procedure is_c_data_ec_launchers + module procedure is_c_data_ece + module procedure is_c_data_edge_profiles + module procedure is_c_data_edge_sources + module procedure is_c_data_edge_transport + module procedure is_c_data_em_coupling + module procedure is_c_data_equilibrium + module procedure is_c_data_gas_injection + module procedure is_c_data_gas_pumping + module procedure is_c_data_gyrokinetics + module procedure is_c_data_hard_x_rays + module procedure is_c_data_ic_antennas + module procedure is_c_data_interferometer + module procedure is_c_data_iron_core + module procedure is_c_data_langmuir_probes + module procedure is_c_data_lh_antennas + module procedure is_c_data_magnetics + module procedure is_c_data_mhd + module procedure is_c_data_mhd_linear + module procedure is_c_data_mse + module procedure is_c_data_nbi + module procedure is_c_data_neutron_diagnostic + module procedure is_c_data_ntms + module procedure is_c_data_pellets + module procedure is_c_data_pf_active + module procedure is_c_data_pf_passive + module procedure is_c_data_plasma_initiation + module procedure is_c_data_polarimeter + module procedure is_c_data_pulse_schedule + module procedure is_c_data_radiation + module procedure is_c_data_real_time_data + module procedure is_c_data_reflectometer_profile + module procedure is_c_data_refractometer + module procedure is_c_data_sawteeth + module procedure is_c_data_soft_x_rays + module procedure is_c_data_spectrometer_mass + module procedure is_c_data_spectrometer_uv + module procedure is_c_data_spectrometer_visible + module procedure is_c_data_spectrometer_x_ray_crystal + module procedure is_c_data_summary + module procedure is_c_data_temporary + module procedure is_c_data_thomson_scattering + module procedure is_c_data_tf + module procedure is_c_data_transport_solver_numerics + module procedure is_c_data_turbulence + module procedure is_c_data_wall + module procedure is_c_data_waves + module procedure is_c_data_workflow +end interface + +interface get_max_occurrences + + module procedure get_max_occurrences_amns_data + module procedure get_max_occurrences_barometry + module procedure get_max_occurrences_bolometer + module procedure get_max_occurrences_bremsstrahlung_visible + module procedure get_max_occurrences_calorimetry + module procedure get_max_occurrences_camera_ir + module procedure get_max_occurrences_camera_visible + module procedure get_max_occurrences_camera_x_rays + module procedure get_max_occurrences_charge_exchange + module procedure get_max_occurrences_coils_non_axisymmetric + module procedure get_max_occurrences_controllers + module procedure get_max_occurrences_core_instant_changes + module procedure get_max_occurrences_core_profiles + module procedure get_max_occurrences_core_sources + module procedure get_max_occurrences_core_transport + module procedure get_max_occurrences_cryostat + module procedure get_max_occurrences_dataset_description + module procedure get_max_occurrences_dataset_fair + module procedure get_max_occurrences_disruption + module procedure get_max_occurrences_distribution_sources + module procedure get_max_occurrences_distributions + module procedure get_max_occurrences_divertors + module procedure get_max_occurrences_ec_launchers + module procedure get_max_occurrences_ece + module procedure get_max_occurrences_edge_profiles + module procedure get_max_occurrences_edge_sources + module procedure get_max_occurrences_edge_transport + module procedure get_max_occurrences_em_coupling + module procedure get_max_occurrences_equilibrium + module procedure get_max_occurrences_gas_injection + module procedure get_max_occurrences_gas_pumping + module procedure get_max_occurrences_gyrokinetics + module procedure get_max_occurrences_hard_x_rays + module procedure get_max_occurrences_ic_antennas + module procedure get_max_occurrences_interferometer + module procedure get_max_occurrences_iron_core + module procedure get_max_occurrences_langmuir_probes + module procedure get_max_occurrences_lh_antennas + module procedure get_max_occurrences_magnetics + module procedure get_max_occurrences_mhd + module procedure get_max_occurrences_mhd_linear + module procedure get_max_occurrences_mse + module procedure get_max_occurrences_nbi + module procedure get_max_occurrences_neutron_diagnostic + module procedure get_max_occurrences_ntms + module procedure get_max_occurrences_pellets + module procedure get_max_occurrences_pf_active + module procedure get_max_occurrences_pf_passive + module procedure get_max_occurrences_plasma_initiation + module procedure get_max_occurrences_polarimeter + module procedure get_max_occurrences_pulse_schedule + module procedure get_max_occurrences_radiation + module procedure get_max_occurrences_real_time_data + module procedure get_max_occurrences_reflectometer_profile + module procedure get_max_occurrences_refractometer + module procedure get_max_occurrences_sawteeth + module procedure get_max_occurrences_soft_x_rays + module procedure get_max_occurrences_spectrometer_mass + module procedure get_max_occurrences_spectrometer_uv + module procedure get_max_occurrences_spectrometer_visible + module procedure get_max_occurrences_spectrometer_x_ray_crystal + module procedure get_max_occurrences_summary + module procedure get_max_occurrences_temporary + module procedure get_max_occurrences_thomson_scattering + module procedure get_max_occurrences_tf + module procedure get_max_occurrences_transport_solver_numerics + module procedure get_max_occurrences_turbulence + module procedure get_max_occurrences_wall + module procedure get_max_occurrences_waves + module procedure get_max_occurrences_workflow +end interface + + +type, abstract :: IDS_base +end type + + +! declare each IDS and their substructures + + ! *********** amns_data IDS internal structures declaration + + type :: ids_amns_data_process_reactant + character(len=ids_string_length), dimension(:), pointer :: label => null() !String identifying reaction participant (e.g. "D", "e", "W", "CD4", "photon", "n") + type(ids_plasma_composition_neutral_element_constant), pointer :: element(:) => null() !List of elements forming the atom (in such case, this array should be of size 1) or molecule. Mass of atom and nuclear charge shou! + !ld be set to 0 for photons and electrons. The mass of atom shouldn't be set for an atomic process that is not isotope dependent. + type(ids_identifier) :: role !Identifier for the role of this paricipant in the reaction. For surface reactions distinguish between projectile and wall. + real(ids_real) :: mass=ids_real_invalid !Mass of the participant + real(ids_real) :: mass_error_upper=ids_real_invalid !Upper error for "mass" + real(ids_real) :: mass_error_lower=ids_real_invalid !Lower error for "mass" + integer(ids_int) :: mass_error_index=ids_int_invalid !Index in the error_description list for "mass" + real(ids_real) :: charge=ids_real_invalid !Charge number of the participant + real(ids_real) :: charge_error_upper=ids_real_invalid !Upper error for "charge" + real(ids_real) :: charge_error_lower=ids_real_invalid !Lower error for "charge" + integer(ids_int) :: charge_error_index=ids_int_invalid !Index in the error_description list for "charge" + integer(ids_int) :: relative_charge=ids_int_invalid !This is a flag indicating that charges are absolute (if set to 0), relative (if 1) or irrelevant (-1); relative would be used to c! + !ategorize the ionization reactions from i to i+1 for all charge states; in the case of bundles, the +1 relative indicates the next! + ! bundle + real(ids_real) :: multiplicity=ids_real_invalid !Multiplicity in the reaction + real(ids_real) :: multiplicity_error_upper=ids_real_invalid !Upper error for "multiplicity" + real(ids_real) :: multiplicity_error_lower=ids_real_invalid !Lower error for "multiplicity" + integer(ids_int) :: multiplicity_error_index=ids_int_invalid !Index in the error_description list for "multiplicity" + integer(ids_int), pointer :: metastable(:) => null() !An array identifying the metastable; if zero-length, then not a metastable; if of length 1, then the value indicates the electroni! + !c level for the metastable (mostly used for atoms/ions); if of length 2, then the 1st would indicate the electronic level and the ! + !second the vibrational level for the metastable (mostly used for molecules and molecular ions); if of length 3, then the 1st would! + ! indicate the electronic level, the second the vibrational level and the third the rotational level for the metastable (mostly use! + !d for molecules and molecular ions) + character(len=ids_string_length), dimension(:), pointer :: metastable_label => null() !Label identifying in text form the metastable + end type + + type :: ids_amns_data_process_charge_state + character(len=ids_string_length), dimension(:), pointer :: label => null() !String identifying charge state (e.g. C+, C+2 , C+3, C+4, C+5, C+6, ...) + real(ids_real) :: z_min=ids_real_invalid !Minimum Z of the charge state bundle + real(ids_real) :: z_min_error_upper=ids_real_invalid !Upper error for "z_min" + real(ids_real) :: z_min_error_lower=ids_real_invalid !Lower error for "z_min" + integer(ids_int) :: z_min_error_index=ids_int_invalid !Index in the error_description list for "z_min" + real(ids_real) :: z_max=ids_real_invalid !Maximum Z of the charge state bundle (equal to z_min if no bundle) + real(ids_real) :: z_max_error_upper=ids_real_invalid !Upper error for "z_max" + real(ids_real) :: z_max_error_lower=ids_real_invalid !Lower error for "z_max" + integer(ids_int) :: z_max_error_index=ids_int_invalid !Index in the error_description list for "z_max" + real(ids_real) :: table_0d=ids_real_invalid !0D table describing the process data + real(ids_real) :: table_0d_error_upper=ids_real_invalid !Upper error for "table_0d" + real(ids_real) :: table_0d_error_lower=ids_real_invalid !Lower error for "table_0d" + integer(ids_int) :: table_0d_error_index=ids_int_invalid !Index in the error_description list for "table_0d" + real(ids_real), pointer :: table_1d(:) => null() !1D table describing the process data + real(ids_real), pointer :: table_1d_error_upper(:) => null() !Upper error for "table_1d" + real(ids_real), pointer :: table_1d_error_lower(:) => null() !Lower error for "table_1d" + integer(ids_int) :: table_1d_error_index=ids_int_invalid !Index in the error_description list for "table_1d" + real(ids_real), pointer :: table_2d(:,:) => null() !2D table describing the process data + real(ids_real), pointer :: table_2d_error_upper(:,:) => null() !Upper error for "table_2d" + real(ids_real), pointer :: table_2d_error_lower(:,:) => null() !Lower error for "table_2d" + integer(ids_int) :: table_2d_error_index=ids_int_invalid !Index in the error_description list for "table_2d" + real(ids_real), pointer :: table_3d(:,:,:) => null() !3D table describing the process data + real(ids_real), pointer :: table_3d_error_upper(:,:,:) => null() !Upper error for "table_3d" + real(ids_real), pointer :: table_3d_error_lower(:,:,:) => null() !Lower error for "table_3d" + integer(ids_int) :: table_3d_error_index=ids_int_invalid !Index in the error_description list for "table_3d" + real(ids_real), pointer :: table_4d(:,:,:,:) => null() !4D table describing the process data + real(ids_real), pointer :: table_4d_error_upper(:,:,:,:) => null() !Upper error for "table_4d" + real(ids_real), pointer :: table_4d_error_lower(:,:,:,:) => null() !Lower error for "table_4d" + integer(ids_int) :: table_4d_error_index=ids_int_invalid !Index in the error_description list for "table_4d" + real(ids_real), pointer :: table_5d(:,:,:,:,:) => null() !5D table describing the process data + real(ids_real), pointer :: table_5d_error_upper(:,:,:,:,:) => null() !Upper error for "table_5d" + real(ids_real), pointer :: table_5d_error_lower(:,:,:,:,:) => null() !Lower error for "table_5d" + integer(ids_int) :: table_5d_error_index=ids_int_invalid !Index in the error_description list for "table_5d" + real(ids_real), pointer :: table_6d(:,:,:,:,:,:) => null() !6D table describing the process data + real(ids_real), pointer :: table_6d_error_upper(:,:,:,:,:,:) => null() !Upper error for "table_6d" + real(ids_real), pointer :: table_6d_error_lower(:,:,:,:,:,:) => null() !Lower error for "table_6d" + integer(ids_int) :: table_6d_error_index=ids_int_invalid !Index in the error_description list for "table_6d" + end type + + type :: ids_amns_data_process + character(len=ids_string_length), dimension(:), pointer :: source => null() !Filename or subroutine name used to provide this data + character(len=ids_string_length), dimension(:), pointer :: provider => null() !Name of the person in charge of producing this data + character(len=ids_string_length), dimension(:), pointer :: citation => null() !Reference to publication(s) + character(len=ids_string_length), dimension(:), pointer :: label => null() !String identifying the process (e.g. EI, RC, ...) + type(ids_amns_data_process_reactant), pointer :: reactants(:) => null() !Set of reactants involved in this process + type(ids_amns_data_process_reactant), pointer :: products(:) => null() !Set of products resulting of this process + integer(ids_int) :: table_dimension=ids_int_invalid !Table dimensionality of the process (1 to 6), valid for all charge states. Indicates which of the tables is filled (below the char! + !ge_state node) + integer(ids_int) :: coordinate_index=ids_int_invalid !Index in tables_coord, specifying what coordinate systems to use for this process (valid for all tables) + character(len=ids_string_length), dimension(:), pointer :: result_label => null() !Description of the process result (rate, cross section, sputtering yield, ...) + character(len=ids_string_length), dimension(:), pointer :: result_units => null() !Units of the process result + integer(ids_int) :: result_transformation=ids_int_invalid !Transformation of the process result. Integer flag: 0=no transformation; 1=10^; 2=exp() + type(ids_amns_data_process_charge_state), pointer :: charge_state(:) => null() !Process tables for a set of charge states. Only one table is used for that process, defined by process(:)/table_dimension + end type + + type :: ids_amns_data_coordinate_system_coordinate + character(len=ids_string_length), dimension(:), pointer :: label => null() !Description of coordinate (e.g. "Electron temperature") + real(ids_real), pointer :: values(:) => null() !Coordinate values + real(ids_real), pointer :: values_error_upper(:) => null() !Upper error for "values" + real(ids_real), pointer :: values_error_lower(:) => null() !Lower error for "values" + integer(ids_int) :: values_error_index=ids_int_invalid !Index in the error_description list for "values" + integer(ids_int) :: interpolation_type=ids_int_invalid !Interpolation strategy in this coordinate direction. Integer flag: 0=discrete (no interpolation); 1=linear; ... + integer(ids_int), pointer :: extrapolation_type(:) => null() !Extrapolation strategy when leaving the domain. The first value of the vector describes the behaviour at lower bound, the second d! + !escribes the at upper bound. Possible values: 0=none, report error; 1=boundary value; 2=linear extrapolation + character(len=ids_string_length), dimension(:), pointer :: value_labels => null() !String description of discrete coordinate values (if interpolation_type=0). E.g., for spectroscopic lines, the spectroscopic descr! + !iption of the transition. + character(len=ids_string_length), dimension(:), pointer :: units => null() !Units of coordinate (e.g. eV) + integer(ids_int) :: transformation=ids_int_invalid !Coordinate transformation applied to coordinate values stored in coord. Integer flag: 0=none; 1=log10; 2=ln + integer(ids_int) :: spacing=ids_int_invalid !Flag for specific coordinate spacing (for optimization purposes). Integer flag: 0=undefined; 1=uniform; ... + end type + + type :: ids_amns_data_coordinate_system + type(ids_amns_data_coordinate_system_coordinate), pointer :: coordinate(:) => null() !Set of coordinates for that coordinate system. A coordinate an be either a range of real values or a set of discrete values (if in! + !terpolation_type=0) + end type + + type :: ids_amns_data_data_entry + character(len=ids_string_length), dimension(:), pointer :: description => null() !Description of this data entry + integer(ids_int) :: shot=ids_int_invalid !Shot number = Mass*1000+Nuclear_charge + integer(ids_int) :: run=ids_int_invalid !Which run number is the active run number for this version + end type + + type :: ids_amns_data_release + character(len=ids_string_length), dimension(:), pointer :: description => null() !Description of this release + character(len=ids_string_length), dimension(:), pointer :: date => null() !Date of this release + type(ids_amns_data_data_entry), pointer :: data_entry(:) => null() !For this release, list of each data item (i.e. shot/run pair containing the actual data) included in this release + end type + + + ! *********** amns_data IDS + type, extends(IDS_base) :: ids_amns_data !Atomic, molecular, nuclear and surface physics data. Each occurrence contains the data for a given element (nuclear charge), descr! + !ibing various physical processes. For each process, data tables are organized by charge states. The coordinate system used by the ! + !data tables is described under the coordinate_system node. + logical, private :: c_data = .FALSE. ! Fortran specific metadata telling whether the IDS has been populated from C allocated data (LL) or not + integer, private :: max_occurrence = 2! Maximum occurrence allowed as defined in the DD + + type(ids_ids_properties) :: ids_properties !Interface Data Structure properties. This element identifies the node above as an IDS + real(ids_real) :: z_n=ids_real_invalid !Nuclear charge + real(ids_real) :: z_n_error_upper=ids_real_invalid !Upper error for "z_n" + real(ids_real) :: z_n_error_lower=ids_real_invalid !Lower error for "z_n" + integer(ids_int) :: z_n_error_index=ids_int_invalid !Index in the error_description list for "z_n" + real(ids_real) :: a=ids_real_invalid !Mass of atom + real(ids_real) :: a_error_upper=ids_real_invalid !Upper error for "a" + real(ids_real) :: a_error_lower=ids_real_invalid !Lower error for "a" + integer(ids_int) :: a_error_index=ids_int_invalid !Index in the error_description list for "a" + type(ids_amns_data_process), pointer :: process(:) => null() !Description and data for a set of physical processes. + type(ids_amns_data_coordinate_system), pointer :: coordinate_system(:) => null() !Array of possible coordinate systems for process tables + type(ids_amns_data_release), pointer :: release(:) => null() !List of available releases of the AMNS data; each element contains information about the AMNS data that is included in the release! + !. This part of the IDS is filled and stored only into shot/run=0/1, playing the role of a catalogue. + type(ids_code) :: code !Generic decription of the code-specific parameters for the code that has produced this IDS + real(ids_real), pointer :: time(:) => null() !Generic time + end type + + ! *********** barometry IDS internal structures declaration + + type :: ids_barometry_gauge + character(len=ids_string_length), dimension(:), pointer :: name => null() !Name of the gauge + type(ids_identifier_static) :: type !Type of the gauge (index = 1: Penning; index = 2: Baratron) + type(ids_rzphi0d_static) :: position !Position of the measurements + type(ids_signal_flt_1d) :: pressure !Pressure + real(ids_real) :: calibration_coefficient=ids_real_invalid !Coefficient used for converting raw signal into absolute pressure + real(ids_real) :: calibration_coefficient_error_upper=ids_real_invalid !Upper error for "calibration_coefficient" + real(ids_real) :: calibration_coefficient_error_lower=ids_real_invalid !Lower error for "calibration_coefficient" + integer(ids_int) :: calibration_coefficient_error_index=ids_int_invalid !Index in the error_description list for "calibration_coefficient" + end type + + + ! *********** barometry IDS + type, extends(IDS_base) :: ids_barometry !Pressure measurements in the vacuum vessel. NB will need to change the type of the pressure node to signal_1d when moving to the n! + !ew LL. + logical, private :: c_data = .FALSE. ! Fortran specific metadata telling whether the IDS has been populated from C allocated data (LL) or not + integer, private :: max_occurrence = 2! Maximum occurrence allowed as defined in the DD + + type(ids_ids_properties) :: ids_properties !Interface Data Structure properties. This element identifies the node above as an IDS + type(ids_barometry_gauge), pointer :: gauge(:) => null() !Set of gauges + real(ids_real) :: latency=ids_real_invalid !Upper bound of the delay between physical information received by the detector and data available on the real-time (RT) network. + real(ids_real) :: latency_error_upper=ids_real_invalid !Upper error for "latency" + real(ids_real) :: latency_error_lower=ids_real_invalid !Lower error for "latency" + integer(ids_int) :: latency_error_index=ids_int_invalid !Index in the error_description list for "latency" + type(ids_code) :: code !Generic decription of the code-specific parameters for the code that has produced this IDS + real(ids_real), pointer :: time(:) => null() !Generic time + end type + + ! *********** bolometer IDS internal structures declaration + + type :: ids_bolometer_channel + character(len=ids_string_length), dimension(:), pointer :: name => null() !Name of the channel + character(len=ids_string_length), dimension(:), pointer :: identifier => null() !ID of the channel + type(ids_detector_aperture) :: detector !Detector description + type(ids_detector_aperture), pointer :: aperture(:) => null() !Description of a set of collimating apertures + real(ids_real) :: etendue=ids_real_invalid !Etendue (geometric extent) of the channel's optical system + real(ids_real) :: etendue_error_upper=ids_real_invalid !Upper error for "etendue" + real(ids_real) :: etendue_error_lower=ids_real_invalid !Lower error for "etendue" + integer(ids_int) :: etendue_error_index=ids_int_invalid !Index in the error_description list for "etendue" + type(ids_identifier_static) :: etendue_method !Method used to calculate the etendue. Index = 0 : exact calculation with a 4D integral; 1 : approximation with first order formula! + ! (detector surface times solid angle subtended by the apertures); 2 : other methods + type(ids_line_of_sight_3points) :: line_of_sight !Description of the reference line of sight of the channel, defined by two points when the beam is not reflected, a third point is ! + !added to define the reflected beam path + type(ids_signal_flt_1d) :: power !Power received on the detector + type(ids_signal_int_1d) :: validity_timed !Indicator of the validity of the channel as a function of time (0 means valid, negative values mean non-valid) + integer(ids_int) :: validity=ids_int_invalid !Indicator of the validity of the channel for the whole acquisition period (0 means valid, negative values mean non-valid) + end type + + + ! *********** bolometer IDS + type, extends(IDS_base) :: ids_bolometer !Bolometer diagnostic + logical, private :: c_data = .FALSE. ! Fortran specific metadata telling whether the IDS has been populated from C allocated data (LL) or not + integer, private :: max_occurrence = 2! Maximum occurrence allowed as defined in the DD + + type(ids_ids_properties) :: ids_properties !Interface Data Structure properties. This element identifies the node above as an IDS + type(ids_bolometer_channel), pointer :: channel(:) => null() !Set of channels (detector or pixel of a camera) + real(ids_real), pointer :: power_radiated_total(:) => null() !Total radiated power reconstructed from bolometry data + real(ids_real), pointer :: power_radiated_total_error_upper(:) => null() !Upper error for "power_radiated_total" + real(ids_real), pointer :: power_radiated_total_error_lower(:) => null() !Lower error for "power_radiated_total" + integer(ids_int) :: power_radiated_total_error_index=ids_int_invalid !Index in the error_description list for "power_radiated_total" + real(ids_real), pointer :: power_radiated_inside_lcfs(:) => null() !Radiated power from the plasma inside the Last Closed Flux Surface, reconstructed from bolometry data + real(ids_real), pointer :: power_radiated_inside_lcfs_error_upper(:) => null() !Upper error for "power_radiated_inside_lcfs" + real(ids_real), pointer :: power_radiated_inside_lcfs_error_lower(:) => null() !Lower error for "power_radiated_inside_lcfs" + integer(ids_int) :: power_radiated_inside_lcfs_error_index=ids_int_invalid !Index in the error_description list for "power_radiated_inside_lcfs" + integer(ids_int), pointer :: power_radiated_validity(:) => null() !Validity flag related to the radiated power reconstructions + real(ids_real) :: latency=ids_real_invalid !Upper bound of the delay between physical information received by the detector and data available on the real-time (RT) network. + real(ids_real) :: latency_error_upper=ids_real_invalid !Upper error for "latency" + real(ids_real) :: latency_error_lower=ids_real_invalid !Lower error for "latency" + integer(ids_int) :: latency_error_index=ids_int_invalid !Index in the error_description list for "latency" + type(ids_code) :: code !Generic decription of the code-specific parameters for the code that has produced this IDS + real(ids_real), pointer :: time(:) => null() !Generic time + end type + + ! *********** bremsstrahlung_visible IDS internal structures declaration + + type :: ids_bremsstrahlung_channel + character(len=ids_string_length), dimension(:), pointer :: name => null() !Name of the channel + type(ids_line_of_sight_2points) :: line_of_sight !Description of the line of sight of the channel, given by 2 points + type(ids_filter_wavelength) :: filter !Filter wavelength range and detection efficiency + type(ids_signal_flt_1d) :: intensity !Intensity, i.e. number of photoelectrons detected by unit time, taking into account electronic gain compensation and channels rela! + !tive calibration + type(ids_signal_flt_1d) :: radiance_spectral !Calibrated spectral radiance (radiance per unit wavelength) + type(ids_signal_flt_1d_validity) :: zeff_line_average !Average effective charge along the line of sight + end type + + + ! *********** bremsstrahlung_visible IDS + type, extends(IDS_base) :: ids_bremsstrahlung_visible !Diagnostic for measuring the bremsstrahlung from thermal particules in the visible light range, in view of determining the effecti! + !ve charge of the plasma. + logical, private :: c_data = .FALSE. ! Fortran specific metadata telling whether the IDS has been populated from C allocated data (LL) or not + integer, private :: max_occurrence = 2! Maximum occurrence allowed as defined in the DD + + type(ids_ids_properties) :: ids_properties !Interface Data Structure properties. This element identifies the node above as an IDS + type(ids_bremsstrahlung_channel), pointer :: channel(:) => null() !Set of channels (detector or pixel of a camera) + real(ids_real) :: latency=ids_real_invalid !Upper bound of the delay between physical information received by the detector and data available on the real-time (RT) network. + real(ids_real) :: latency_error_upper=ids_real_invalid !Upper error for "latency" + real(ids_real) :: latency_error_lower=ids_real_invalid !Lower error for "latency" + integer(ids_int) :: latency_error_index=ids_int_invalid !Index in the error_description list for "latency" + type(ids_code) :: code !Generic decription of the code-specific parameters for the code that has produced this IDS + real(ids_real), pointer :: time(:) => null() !Generic time + end type + + ! *********** calorimetry IDS internal structures declaration + + type :: ids_calorimetry_group_component + character(len=ids_string_length), dimension(:), pointer :: name => null() !Name of the component + character(len=ids_string_length), dimension(:), pointer :: identifier => null() !ID of the component + type(ids_signal_flt_1d_validity) :: power !Power extracted from the component + type(ids_signal_flt_1d_validity) :: energy_cumulated !Energy extracted from the component since the start of the pulse + type(ids_data_flt_0d_constant_validity) :: energy_total !Energy extracted from the component on the whole plasma discharge, including the return to thermal equilibrium of the component in! + ! the post-pulse phase + type(ids_signal_flt_1d_validity) :: temperature_in !Temperature of the coolant when entering the component + type(ids_signal_flt_1d_validity) :: temperature_out !Temperature of the coolant when exiting the component + type(ids_signal_flt_1d_validity) :: mass_flow !Mass flow of the coolant going through the component + type(ids_signal_flt_1d_validity) :: transit_time !Transit time for the coolant to go from the input to the output of the component + end type + + type :: ids_calorimetry_group + character(len=ids_string_length), dimension(:), pointer :: name => null() !Name of the group + character(len=ids_string_length), dimension(:), pointer :: identifier => null() !ID of the group + type(ids_calorimetry_group_component), pointer :: component(:) => null() !Set of components on which calorimetry measurements are carried out + end type + + type :: ids_calorimetry_cooling_loop + character(len=ids_string_length), dimension(:), pointer :: name => null() !Name of the loop + character(len=ids_string_length), dimension(:), pointer :: identifier => null() !ID of the loop + type(ids_signal_flt_1d_validity) :: temperature_in !Temperature of the coolant when entering the loop + type(ids_signal_flt_1d_validity) :: temperature_out !Temperature of the coolant when exiting the loop + type(ids_signal_flt_1d_validity) :: mass_flow !Mass flow of the coolant going through the loop + end type + + + ! *********** calorimetry IDS + type, extends(IDS_base) :: ids_calorimetry !Calometry measurements on various tokamak subsystems + logical, private :: c_data = .FALSE. ! Fortran specific metadata telling whether the IDS has been populated from C allocated data (LL) or not + integer, private :: max_occurrence = 2! Maximum occurrence allowed as defined in the DD + + type(ids_ids_properties) :: ids_properties !Interface Data Structure properties. This element identifies the node above as an IDS + type(ids_calorimetry_group), pointer :: group(:) => null() !Set of groups of components on which calorimetry measurements are carried out (grouped by tokamak subsystems or localisation on th! + !e machine) + type(ids_calorimetry_cooling_loop), pointer :: cooling_loop(:) => null() !Set of cooling loops + real(ids_real) :: latency=ids_real_invalid !Upper bound of the delay between physical information received by the detector and data available on the real-time (RT) network. + real(ids_real) :: latency_error_upper=ids_real_invalid !Upper error for "latency" + real(ids_real) :: latency_error_lower=ids_real_invalid !Lower error for "latency" + integer(ids_int) :: latency_error_index=ids_int_invalid !Index in the error_description list for "latency" + type(ids_code) :: code !Generic decription of the code-specific parameters for the code that has produced this IDS + real(ids_real), pointer :: time(:) => null() !Generic time + end type + + ! *********** camera_ir IDS internal structures declaration + + type :: ids_camera_ir_calibration + integer(ids_int), pointer :: luminance_to_temperature(:,:) => null() !Luminance to temperature conversion table + integer(ids_int), pointer :: transmission_barrel(:,:) => null() !Transmission of the optical barrel + integer(ids_int), pointer :: transmission_mirror(:,:) => null() !Transmission of the mirror + integer(ids_int), pointer :: transmission_window(:,:) => null() !Transmission of the window + integer(ids_int), pointer :: optical_temperature(:,:) => null() !Temperature of the optical components (digital levels) + end type + + type :: ids_camera_ir_frame + real(ids_real), pointer :: surface_temperature(:,:) => null() !Surface temperature image. First dimension : line index (horizontal axis). Second dimension: column index (vertical axis). + real(ids_real), pointer :: surface_temperature_error_upper(:,:) => null() !Upper error for "surface_temperature" + real(ids_real), pointer :: surface_temperature_error_lower(:,:) => null() !Lower error for "surface_temperature" + integer(ids_int) :: surface_temperature_error_index=ids_int_invalid !Index in the error_description list for "surface_temperature" + real(ids_real) :: time=ids_real_invalid !Time + end type + + type :: ids_camera_ir_frame_analysis + real(ids_real) :: sol_heat_decay_length=ids_real_invalid !Heat flux decay length in SOL at divertor entrance, mapped to the mid-plane, this is the lambda_q parameter defined in reference T! + !. Eich et al, Nucl. Fusion 53 (2013) 093031 + real(ids_real) :: sol_heat_decay_length_error_upper=ids_real_invalid !Upper error for "sol_heat_decay_length" + real(ids_real) :: sol_heat_decay_length_error_lower=ids_real_invalid !Lower error for "sol_heat_decay_length" + integer(ids_int) :: sol_heat_decay_length_error_index=ids_int_invalid !Index in the error_description list for "sol_heat_decay_length" + real(ids_real), pointer :: distance_separatrix_midplane(:) => null() !Distance between the measurement position and the separatrix, mapped along flux surfaces to the outboard midplane, in the major ra! + !dius direction. Positive value means the measurement is outside of the separatrix. + real(ids_real), pointer :: distance_separatrix_midplane_error_upper(:) => null() !Upper error for "distance_separatrix_midplane" + real(ids_real), pointer :: distance_separatrix_midplane_error_lower(:) => null() !Lower error for "distance_separatrix_midplane" + integer(ids_int) :: distance_separatrix_midplane_error_index=ids_int_invalid !Index in the error_description list for "distance_separatrix_midplane" + real(ids_real), pointer :: power_flux_parallel(:) => null() !Parallel heat flux received by the element monitored by the camera, along the distance_separatrix_midplane coordinate + real(ids_real), pointer :: power_flux_parallel_error_upper(:) => null() !Upper error for "power_flux_parallel" + real(ids_real), pointer :: power_flux_parallel_error_lower(:) => null() !Lower error for "power_flux_parallel" + integer(ids_int) :: power_flux_parallel_error_index=ids_int_invalid !Index in the error_description list for "power_flux_parallel" + real(ids_real) :: time=ids_real_invalid !Time + end type + + + ! *********** camera_ir IDS + type, extends(IDS_base) :: ids_camera_ir !Infrared camera for monitoring of Plasma Facing Components + logical, private :: c_data = .FALSE. ! Fortran specific metadata telling whether the IDS has been populated from C allocated data (LL) or not + integer, private :: max_occurrence = 10! Maximum occurrence allowed as defined in the DD + + type(ids_ids_properties) :: ids_properties !Interface Data Structure properties. This element identifies the node above as an IDS + character(len=ids_string_length), dimension(:), pointer :: name => null() !Name of the camera + type(ids_camera_ir_calibration) :: calibration !Calibration data + type(ids_camera_ir_frame), pointer :: frame(:) => null() !Set of frames + type(ids_identifier_static) :: midplane !Choice of midplane definition for the mapping of measurements on an equilibrium + type(ids_camera_ir_frame_analysis), pointer :: frame_analysis(:) => null() !Quantities deduced from frame analysis for a set of time slices + real(ids_real) :: latency=ids_real_invalid !Upper bound of the delay between physical information received by the detector and data available on the real-time (RT) network. + real(ids_real) :: latency_error_upper=ids_real_invalid !Upper error for "latency" + real(ids_real) :: latency_error_lower=ids_real_invalid !Lower error for "latency" + integer(ids_int) :: latency_error_index=ids_int_invalid !Index in the error_description list for "latency" + type(ids_code) :: code !Generic decription of the code-specific parameters for the code that has produced this IDS + real(ids_real), pointer :: time(:) => null() !Generic time + end type + + ! *********** camera_visible IDS internal structures declaration + + type :: ids_camera_visible_frame + integer(ids_int), pointer :: image_raw(:,:) => null() !Raw image (unprocessed) (digital levels). First dimension : line index (horizontal axis). Second dimension: column index (vertical! + ! axis). + real(ids_real), pointer :: radiance(:,:) => null() !Radiance image. First dimension : line index (horizontal axis). Second dimension: column index (vertical axis). + real(ids_real), pointer :: radiance_error_upper(:,:) => null() !Upper error for "radiance" + real(ids_real), pointer :: radiance_error_lower(:,:) => null() !Lower error for "radiance" + integer(ids_int) :: radiance_error_index=ids_int_invalid !Index in the error_description list for "radiance" + real(ids_real) :: time=ids_real_invalid !Time + end type + + type :: ids_camera_visible_geometry_matrix_step2 + real(ids_real), pointer :: data(:) => null() !The Ray Transfer Matrix (RTM, or geometry matrix) here provides transformation of the signal from each individual unit light sourc! + !e (voxel) to each pixel of the receiver (detector). The emission profile has [photons.m^-3.s^-1.sr^-1] units and radiance signal h! + !as [photons.m^-2.s^-1.sr^-1] units. So the RTM has [m] units. This data is stored in a sparse form, i.e. the array contains only t! + !he non-zero element of the Ray transfer matrix. The voxel index corresponding to an element of this array can be found in voxel_in! + !dices. The pixel indices corresponding to an element of this array can be found in pixel_indices + real(ids_real), pointer :: data_error_upper(:) => null() !Upper error for "data" + real(ids_real), pointer :: data_error_lower(:) => null() !Lower error for "data" + integer(ids_int) :: data_error_index=ids_int_invalid !Index in the error_description list for "data" + integer(ids_int), pointer :: voxel_indices(:) => null() !List of voxel indices (defined in the voxel map) used in the sparse data array + integer(ids_int), pointer :: pixel_indices(:,:) => null() !List of pixel indices used in the sparse data array. The first dimension refers to the data array index. The second dimension list! + !s the line index (horizontal axis) in first position, then the column index (vertical axis). + end type + + type :: ids_camera_visible_geometry_matrix_interpolated + real(ids_real), pointer :: r(:) => null() !Major radius of interpolation knots + real(ids_real), pointer :: r_error_upper(:) => null() !Upper error for "r" + real(ids_real), pointer :: r_error_lower(:) => null() !Lower error for "r" + integer(ids_int) :: r_error_index=ids_int_invalid !Index in the error_description list for "r" + real(ids_real), pointer :: z(:) => null() !Height of interpolation knots + real(ids_real), pointer :: z_error_upper(:) => null() !Upper error for "z" + real(ids_real), pointer :: z_error_lower(:) => null() !Lower error for "z" + integer(ids_int) :: z_error_index=ids_int_invalid !Index in the error_description list for "z" + real(ids_real), pointer :: phi(:) => null() !Toroidal angle (oriented counter-clockwise when viewing from above) of interpolation knots + real(ids_real), pointer :: phi_error_upper(:) => null() !Upper error for "phi" + real(ids_real), pointer :: phi_error_lower(:) => null() !Lower error for "phi" + integer(ids_int) :: phi_error_index=ids_int_invalid !Index in the error_description list for "phi" + real(ids_real), pointer :: data(:,:,:) => null() !Interpolated Ray Transfer Matrix (RTM, or geometry matrix), which provides transformation of the reflected light from each interpo! + !lation knot to the receiver (detector pixel). When convolving with an emission profile, the values must be interpolated to the emi! + !ssion grid and multiplied by the volume of the grid cells. The interpolated matrix is given on an array of interpolation knots of ! + !coordinates r, z and phi (third dimension of this array). The first two dimension correspond to the detector pixels : first dimens! + !ion : line index (horizontal axis); second dimension: column index (vertical axis). + real(ids_real), pointer :: data_error_upper(:,:,:) => null() !Upper error for "data" + real(ids_real), pointer :: data_error_lower(:,:,:) => null() !Lower error for "data" + integer(ids_int) :: data_error_index=ids_int_invalid !Index in the error_description list for "data" + end type + + type :: ids_camera_visible_geometry_matrix + type(ids_camera_visible_geometry_matrix_step2) :: with_reflections !Geometry matrix with reflections + type(ids_camera_visible_geometry_matrix_step2) :: without_reflections !Geometry matrix without reflections + type(ids_camera_visible_geometry_matrix_interpolated) :: interpolated !Interpolated geometry matrix for reflected light + integer(ids_int), pointer :: voxel_map(:,:,:) => null() !Voxel map for geometry matrix. The cells with same number are merged in the computation into a single emission source meta-cell (t! + !he voxel). Cells with number -1 are excluded. Voxel count starts from 0. + integer(ids_int) :: voxels_n=ids_int_invalid !Number of voxels defined in the voxel_map. + type(ids_geometry_matrix_emission) :: emission_grid !Grid defining the light emission cells + end type + + type :: ids_camera_visible_detector + real(ids_real), pointer :: pixel_to_alpha(:) => null() !Alpha angle of each pixel in the horizontal axis + real(ids_real), pointer :: pixel_to_alpha_error_upper(:) => null() !Upper error for "pixel_to_alpha" + real(ids_real), pointer :: pixel_to_alpha_error_lower(:) => null() !Lower error for "pixel_to_alpha" + integer(ids_int) :: pixel_to_alpha_error_index=ids_int_invalid !Index in the error_description list for "pixel_to_alpha" + real(ids_real), pointer :: pixel_to_beta(:) => null() !Beta angle of each pixel in the vertical axis + real(ids_real), pointer :: pixel_to_beta_error_upper(:) => null() !Upper error for "pixel_to_beta" + real(ids_real), pointer :: pixel_to_beta_error_lower(:) => null() !Lower error for "pixel_to_beta" + integer(ids_int) :: pixel_to_beta_error_index=ids_int_invalid !Index in the error_description list for "pixel_to_beta" + real(ids_real) :: wavelength_lower=ids_real_invalid !Lower bound of the detector wavelength range + real(ids_real) :: wavelength_lower_error_upper=ids_real_invalid !Upper error for "wavelength_lower" + real(ids_real) :: wavelength_lower_error_lower=ids_real_invalid !Lower error for "wavelength_lower" + integer(ids_int) :: wavelength_lower_error_index=ids_int_invalid !Index in the error_description list for "wavelength_lower" + real(ids_real) :: wavelength_upper=ids_real_invalid !Upper bound of the detector wavelength range + real(ids_real) :: wavelength_upper_error_upper=ids_real_invalid !Upper error for "wavelength_upper" + real(ids_real) :: wavelength_upper_error_lower=ids_real_invalid !Lower error for "wavelength_upper" + integer(ids_int) :: wavelength_upper_error_index=ids_int_invalid !Index in the error_description list for "wavelength_upper" + real(ids_real), pointer :: counts_to_radiance(:,:) => null() !Counts to radiance factor, for each pixel of the detector. Includes both the transmission losses in the relay optics and the quant! + !um efficiency of the camera itself, integrated over the wavelength range + real(ids_real), pointer :: counts_to_radiance_error_upper(:,:) => null() !Upper error for "counts_to_radiance" + real(ids_real), pointer :: counts_to_radiance_error_lower(:,:) => null() !Lower error for "counts_to_radiance" + integer(ids_int) :: counts_to_radiance_error_index=ids_int_invalid !Index in the error_description list for "counts_to_radiance" + real(ids_real) :: exposure_time=ids_real_invalid !Exposure time + real(ids_real) :: exposure_time_error_upper=ids_real_invalid !Upper error for "exposure_time" + real(ids_real) :: exposure_time_error_lower=ids_real_invalid !Lower error for "exposure_time" + integer(ids_int) :: exposure_time_error_index=ids_int_invalid !Index in the error_description list for "exposure_time" + real(ids_real) :: noise=ids_real_invalid !Detector noise (e.g. read-out noise) (rms counts per second exposure time) + real(ids_real) :: noise_error_upper=ids_real_invalid !Upper error for "noise" + real(ids_real) :: noise_error_lower=ids_real_invalid !Lower error for "noise" + integer(ids_int) :: noise_error_index=ids_int_invalid !Index in the error_description list for "noise" + integer(ids_int) :: columns_n=ids_int_invalid !Number of pixel columns in the horizontal direction + integer(ids_int) :: lines_n=ids_int_invalid !Number of pixel lines in the vertical direction + type(ids_camera_visible_frame), pointer :: frame(:) => null() !Set of frames + type(ids_camera_visible_geometry_matrix) :: geometry_matrix !Description of geometry matrix (ray transfer matrix) + end type + + type :: ids_camera_visible_channel + character(len=ids_string_length), dimension(:), pointer :: name => null() !Name of the channel + type(ids_detector_aperture), pointer :: aperture(:) => null() !Description of apertures between plasma and the detectors (position, outline shape and orientation) + real(ids_real), pointer :: viewing_angle_alpha_bounds(:) => null() !Minimum and maximum values of alpha angle of the field of view, where alpha is the agle between the axis X3 and projection of the ! + !chord of view on the plane X1X3 counted clockwise from the top view of X2 axis. X1, X2, X3 are the ones of the first aperture (i.! + !e. the closest to the plasma). + real(ids_real), pointer :: viewing_angle_alpha_bounds_error_upper(:) => null() !Upper error for "viewing_angle_alpha_bounds" + real(ids_real), pointer :: viewing_angle_alpha_bounds_error_lower(:) => null() !Lower error for "viewing_angle_alpha_bounds" + integer(ids_int) :: viewing_angle_alpha_bounds_error_index=ids_int_invalid !Index in the error_description list for "viewing_angle_alpha_bounds" + real(ids_real), pointer :: viewing_angle_beta_bounds(:) => null() !Minimum and maximum values of beta angle of the field of view, where beta is the angle between the axis X3 and projection of the c! + !hord of view on the plane X2X3 counted clockwise from the top view of X1 axis. X1, X2, X3 are the ones of the first aperture (i.e.! + ! the closest to the plasma). + real(ids_real), pointer :: viewing_angle_beta_bounds_error_upper(:) => null() !Upper error for "viewing_angle_beta_bounds" + real(ids_real), pointer :: viewing_angle_beta_bounds_error_lower(:) => null() !Lower error for "viewing_angle_beta_bounds" + integer(ids_int) :: viewing_angle_beta_bounds_error_index=ids_int_invalid !Index in the error_description list for "viewing_angle_beta_bounds" + type(ids_camera_visible_detector), pointer :: detector(:) => null() !Set of detectors + end type + + + ! *********** camera_visible IDS + type, extends(IDS_base) :: ids_camera_visible !Camera in the visible light range + logical, private :: c_data = .FALSE. ! Fortran specific metadata telling whether the IDS has been populated from C allocated data (LL) or not + integer, private :: max_occurrence = 20! Maximum occurrence allowed as defined in the DD + + type(ids_ids_properties) :: ids_properties !Interface Data Structure properties. This element identifies the node above as an IDS + character(len=ids_string_length), dimension(:), pointer :: name => null() !Name of the camera + type(ids_camera_visible_channel), pointer :: channel(:) => null() !Set of channels (a front aperture, possibly followed by others, viewing the plasma recorded by one or more detectors e.g. for diff! + !erent wavelength ranges) + real(ids_real) :: latency=ids_real_invalid !Upper bound of the delay between physical information received by the detector and data available on the real-time (RT) network. + real(ids_real) :: latency_error_upper=ids_real_invalid !Upper error for "latency" + real(ids_real) :: latency_error_lower=ids_real_invalid !Lower error for "latency" + integer(ids_int) :: latency_error_index=ids_int_invalid !Index in the error_description list for "latency" + type(ids_code) :: code !Generic decription of the code-specific parameters for the code that has produced this IDS + real(ids_real), pointer :: time(:) => null() !Generic time + end type + + ! *********** camera_x_rays IDS internal structures declaration + + type :: ids_camera_x_rays_frame + integer(ids_int), pointer :: counts_n(:,:) => null() !Number of counts detected on each pixel during one exposure time. First dimension : line index (horizontal axis). Second dimension! + !: column index (vertical axis). + real(ids_real) :: time=ids_real_invalid !Time + end type + + + ! *********** camera_x_rays IDS + type, extends(IDS_base) :: ids_camera_x_rays !X-rays imaging camera (can be used for soft or hard X-rays imaging systems) + logical, private :: c_data = .FALSE. ! Fortran specific metadata telling whether the IDS has been populated from C allocated data (LL) or not + integer, private :: max_occurrence = 6! Maximum occurrence allowed as defined in the DD + + type(ids_ids_properties) :: ids_properties !Interface Data Structure properties. This element identifies the node above as an IDS + character(len=ids_string_length), dimension(:), pointer :: name => null() !Name of the camera + type(ids_camera_x_rays_frame), pointer :: frame(:) => null() !Set of frames. Each time step corresponds to the beginning of the photon integration of each image + real(ids_real), pointer :: photon_energy(:) => null() !List of values of the photon energy (coordinate for quantum_effiency) + real(ids_real), pointer :: photon_energy_error_upper(:) => null() !Upper error for "photon_energy" + real(ids_real), pointer :: photon_energy_error_lower(:) => null() !Lower error for "photon_energy" + integer(ids_int) :: photon_energy_error_index=ids_int_invalid !Index in the error_description list for "photon_energy" + real(ids_real), pointer :: quantum_efficiency(:,:,:) => null() !Quantum efficiency of the detector, i.e. conversion factor multiplying the number of counts to obtain the number of photons impact! + !ing the detector, tabulated as a function of the photon energy, for each pixel of the detector. If all pixels have the same quantu! + !m efficiency, just set the size of the first and second dimensions to 1 + real(ids_real), pointer :: quantum_efficiency_error_upper(:,:,:) => null() !Upper error for "quantum_efficiency" + real(ids_real), pointer :: quantum_efficiency_error_lower(:,:,:) => null() !Lower error for "quantum_efficiency" + integer(ids_int) :: quantum_efficiency_error_index=ids_int_invalid !Index in the error_description list for "quantum_efficiency" + real(ids_real), pointer :: energy_threshold_lower(:,:) => null() !Lower energy detection threshold on each pixel of the detector (photons are counted only if their energy is above this value) + real(ids_real), pointer :: energy_threshold_lower_error_upper(:,:) => null() !Upper error for "energy_threshold_lower" + real(ids_real), pointer :: energy_threshold_lower_error_lower(:,:) => null() !Lower error for "energy_threshold_lower" + integer(ids_int) :: energy_threshold_lower_error_index=ids_int_invalid !Index in the error_description list for "energy_threshold_lower" + character(len=ids_string_length), dimension(:), pointer :: energy_configuration_name => null() !Name of the chosen energy configuration (energy detection threshold) + integer(ids_int), pointer :: pixel_status(:,:) => null() !Status of each pixel : +1 for valid pixels, -1 for inactive pixels, -2 for mis-calibrated pixels. + type(ids_detector_aperture) :: aperture !Description of the collimating aperture of the diagnostic + type(ids_camera_geometry) :: camera !Characteristics of the camera used. The orientation of the camera is described as follows : pixels are aligned along x1 and x2 uni! + !t vectors while x3 is normal to the detector plane. + type(ids_filter_window) :: filter_window !Characteristics of the filter window + real(ids_real) :: exposure_time=ids_real_invalid !Exposure time + real(ids_real) :: exposure_time_error_upper=ids_real_invalid !Upper error for "exposure_time" + real(ids_real) :: exposure_time_error_lower=ids_real_invalid !Lower error for "exposure_time" + integer(ids_int) :: exposure_time_error_index=ids_int_invalid !Index in the error_description list for "exposure_time" + real(ids_real) :: readout_time=ids_real_invalid !Time used to read out each frame on the detector + real(ids_real) :: readout_time_error_upper=ids_real_invalid !Upper error for "readout_time" + real(ids_real) :: readout_time_error_lower=ids_real_invalid !Lower error for "readout_time" + integer(ids_int) :: readout_time_error_index=ids_int_invalid !Index in the error_description list for "readout_time" + real(ids_real) :: latency=ids_real_invalid !Upper bound of the delay between physical information received by the detector and data available on the real-time (RT) network. + real(ids_real) :: latency_error_upper=ids_real_invalid !Upper error for "latency" + real(ids_real) :: latency_error_lower=ids_real_invalid !Lower error for "latency" + integer(ids_int) :: latency_error_index=ids_int_invalid !Index in the error_description list for "latency" + type(ids_signal_flt_1d) :: detector_humidity !Fraction of humidity (0-1) measured at the detector level + type(ids_signal_flt_1d) :: detector_temperature !Temperature measured at the detector level + type(ids_code) :: code !Generic decription of the code-specific parameters for the code that has produced this IDS + real(ids_real), pointer :: time(:) => null() !Generic time + end type + + ! *********** charge_exchange IDS internal structures declaration + + type :: ids_charge_exchange_channel_ion + real(ids_real) :: a=ids_real_invalid !Mass of atom of the ion + real(ids_real) :: a_error_upper=ids_real_invalid !Upper error for "a" + real(ids_real) :: a_error_lower=ids_real_invalid !Lower error for "a" + integer(ids_int) :: a_error_index=ids_int_invalid !Index in the error_description list for "a" + real(ids_real) :: z_ion=ids_real_invalid !Ion charge + real(ids_real) :: z_ion_error_upper=ids_real_invalid !Upper error for "z_ion" + real(ids_real) :: z_ion_error_lower=ids_real_invalid !Lower error for "z_ion" + integer(ids_int) :: z_ion_error_index=ids_int_invalid !Index in the error_description list for "z_ion" + real(ids_real) :: z_n=ids_real_invalid !Nuclear charge + real(ids_real) :: z_n_error_upper=ids_real_invalid !Upper error for "z_n" + real(ids_real) :: z_n_error_lower=ids_real_invalid !Lower error for "z_n" + integer(ids_int) :: z_n_error_index=ids_int_invalid !Index in the error_description list for "z_n" + character(len=ids_string_length), dimension(:), pointer :: label => null() !String identifying the ion (e.g. H+, D+, T+, He+2, C+6, ...) + type(ids_signal_flt_1d) :: t_i !Ion temperature at the channel measurement point + type(ids_identifier) :: t_i_method !Description of the method used to derive the ion temperature + type(ids_signal_flt_1d) :: velocity_tor !Toroidal velocity of the ion (oriented counter-clockwise when seen from above) at the channel measurement point + type(ids_identifier) :: velocity_tor_method !Description of the method used to reconstruct the ion toroidal velocity + type(ids_signal_flt_1d) :: velocity_pol !Poloidal velocity of the ion (oriented clockwise when seen from front on the right side of the tokamak axi-symmetry axis) at the c! + !hannel measurement point + type(ids_identifier) :: velocity_pol_method !Description of the method used to reconstruct the ion poloidal velocity + type(ids_signal_flt_1d) :: n_i_over_n_e !Ion concentration (ratio of the ion density over the electron density) at the channel measurement point + type(ids_identifier) :: n_i_over_n_e_method !Description of the method used to derive the ion concentration + end type + + type :: ids_charge_exchange_channel_bes + real(ids_real) :: a=ids_real_invalid !Mass of atom of the diagnostic neutral beam particle + real(ids_real) :: a_error_upper=ids_real_invalid !Upper error for "a" + real(ids_real) :: a_error_lower=ids_real_invalid !Lower error for "a" + integer(ids_int) :: a_error_index=ids_int_invalid !Index in the error_description list for "a" + real(ids_real) :: z_ion=ids_real_invalid !Ion charge of the diagnostic neutral beam particle + real(ids_real) :: z_ion_error_upper=ids_real_invalid !Upper error for "z_ion" + real(ids_real) :: z_ion_error_lower=ids_real_invalid !Lower error for "z_ion" + integer(ids_int) :: z_ion_error_index=ids_int_invalid !Index in the error_description list for "z_ion" + real(ids_real) :: z_n=ids_real_invalid !Nuclear charge of the diagnostic neutral beam particle + real(ids_real) :: z_n_error_upper=ids_real_invalid !Upper error for "z_n" + real(ids_real) :: z_n_error_lower=ids_real_invalid !Lower error for "z_n" + integer(ids_int) :: z_n_error_index=ids_int_invalid !Index in the error_description list for "z_n" + character(len=ids_string_length), dimension(:), pointer :: label => null() !String identifying the diagnostic neutral beam particle + real(ids_real) :: transition_wavelength=ids_real_invalid !Unshifted wavelength of the BES transition + real(ids_real) :: transition_wavelength_error_upper=ids_real_invalid !Upper error for "transition_wavelength" + real(ids_real) :: transition_wavelength_error_lower=ids_real_invalid !Lower error for "transition_wavelength" + integer(ids_int) :: transition_wavelength_error_index=ids_int_invalid !Index in the error_description list for "transition_wavelength" + type(ids_signal_flt_1d) :: doppler_shift !Doppler shift due to the diagnostic neutral beam particle velocity + type(ids_signal_flt_1d) :: lorentz_shift !Lorentz shift due to the Lorentz electric field (vxB) in the frame of the diagnostic neutral beam particles moving with a velocity! + ! v across the magnetic field B + type(ids_signal_flt_2d) :: radiances !Calibrated intensities of the 9 splitted lines (Stark effect due to Lorentz electric field). Note: radiances are integrated over t! + !he sightline crossing the neutral beam + end type + + type :: ids_charge_exchange_channel_ion_fast + real(ids_real) :: a=ids_real_invalid !Mass of atom of the fast ion + real(ids_real) :: a_error_upper=ids_real_invalid !Upper error for "a" + real(ids_real) :: a_error_lower=ids_real_invalid !Lower error for "a" + integer(ids_int) :: a_error_index=ids_int_invalid !Index in the error_description list for "a" + real(ids_real) :: z_ion=ids_real_invalid !Fast ion charge + real(ids_real) :: z_ion_error_upper=ids_real_invalid !Upper error for "z_ion" + real(ids_real) :: z_ion_error_lower=ids_real_invalid !Lower error for "z_ion" + integer(ids_int) :: z_ion_error_index=ids_int_invalid !Index in the error_description list for "z_ion" + real(ids_real) :: z_n=ids_real_invalid !Nuclear charge of the fast ion + real(ids_real) :: z_n_error_upper=ids_real_invalid !Upper error for "z_n" + real(ids_real) :: z_n_error_lower=ids_real_invalid !Lower error for "z_n" + integer(ids_int) :: z_n_error_index=ids_int_invalid !Index in the error_description list for "z_n" + character(len=ids_string_length), dimension(:), pointer :: label => null() !String identifying the fast ion (e.g. H+, D+, T+, He+2, C+6, ...) + real(ids_real) :: transition_wavelength=ids_real_invalid !Unshifted wavelength of the fast ion charge exchange transition + real(ids_real) :: transition_wavelength_error_upper=ids_real_invalid !Upper error for "transition_wavelength" + real(ids_real) :: transition_wavelength_error_lower=ids_real_invalid !Lower error for "transition_wavelength" + integer(ids_int) :: transition_wavelength_error_index=ids_int_invalid !Index in the error_description list for "transition_wavelength" + type(ids_signal_flt_1d) :: radiance !Calibrated radiance of the fast ion charge exchange spectrum assuming the shape is pre-defined (e.g. by the Fokker-Planck slowing-! + !down function). Note: radiance is integrated over the sightline crossing the neutral beam + type(ids_identifier) :: radiance_spectral_method !Description of the method used to reconstruct the fast ion charge exchange spectrum (e.g. what pre-defined slowing-down and source! + ! functions used) + end type + + type :: ids_charge_exchange_channel_processed_line + character(len=ids_string_length), dimension(:), pointer :: label => null() !String identifying the processed spectral line: Spectroscopy notation emitting element (e.g. D I, Be IV, W I, C VI), transition -! + ! if known - between round brackets (e.g. (3-2) ) and indication type of charge exchange - if applicable - between square brackets ! + !(e.g. [ACX] or [PCX]). Example for beryllium active charge exchange line at 468.5 nm: 'Be IV (8-6) [ACX]'. Example for impact exci! + !tation tungsten line coming from the plasma edge: 'W I' + real(ids_real) :: wavelength_central=ids_real_invalid !Unshifted central wavelength of the processed spectral line + real(ids_real) :: wavelength_central_error_upper=ids_real_invalid !Upper error for "wavelength_central" + real(ids_real) :: wavelength_central_error_lower=ids_real_invalid !Lower error for "wavelength_central" + integer(ids_int) :: wavelength_central_error_index=ids_int_invalid !Index in the error_description list for "wavelength_central" + type(ids_signal_flt_1d) :: radiance !Calibrated, background subtracted radiance (integrated over the spectrum for this line) + type(ids_signal_flt_1d) :: intensity !Non-calibrated intensity (integrated over the spectrum for this line), i.e. number of photoelectrons detected by unit time, taking! + ! into account electronic gain compensation and channels relative calibration + type(ids_signal_flt_1d) :: width !Full width at Half Maximum (FWHM) of the emission line + type(ids_signal_flt_1d) :: shift !Shift of the emission line wavelength with respected to the unshifted cental wavelength (e.g. Doppler shift) + end type + + type :: ids_charge_exchange_channel_spectrum + real(ids_real) :: grating=ids_real_invalid !Number of grating lines per unit length + real(ids_real) :: grating_error_upper=ids_real_invalid !Upper error for "grating" + real(ids_real) :: grating_error_lower=ids_real_invalid !Lower error for "grating" + integer(ids_int) :: grating_error_index=ids_int_invalid !Index in the error_description list for "grating" + real(ids_real) :: slit_width=ids_real_invalid !Width of the slit (placed in the object focal plane) + real(ids_real) :: slit_width_error_upper=ids_real_invalid !Upper error for "slit_width" + real(ids_real) :: slit_width_error_lower=ids_real_invalid !Lower error for "slit_width" + integer(ids_int) :: slit_width_error_index=ids_int_invalid !Index in the error_description list for "slit_width" + real(ids_real), pointer :: instrument_function(:,:) => null() !Array of Gaussian widths and amplitudes which as a sum make up the instrument fuction. IF(lambda) = sum( instrument_function(1,i)/! + !sqrt(2 * pi * instrument_function(2,i)^2 ) * exp( -lambda^2/(2 * instrument_function(2,i)^2) ) ),whereby sum( instrument_functio! + !n(1,i) ) = 1 + real(ids_real), pointer :: instrument_function_error_upper(:,:) => null() !Upper error for "instrument_function" + real(ids_real), pointer :: instrument_function_error_lower(:,:) => null() !Lower error for "instrument_function" + integer(ids_int) :: instrument_function_error_index=ids_int_invalid !Index in the error_description list for "instrument_function" + real(ids_real) :: exposure_time=ids_real_invalid !Exposure time + real(ids_real) :: exposure_time_error_upper=ids_real_invalid !Upper error for "exposure_time" + real(ids_real) :: exposure_time_error_lower=ids_real_invalid !Lower error for "exposure_time" + integer(ids_int) :: exposure_time_error_index=ids_int_invalid !Index in the error_description list for "exposure_time" + real(ids_real), pointer :: wavelengths(:) => null() !Measured wavelengths + real(ids_real), pointer :: wavelengths_error_upper(:) => null() !Upper error for "wavelengths" + real(ids_real), pointer :: wavelengths_error_lower(:) => null() !Lower error for "wavelengths" + integer(ids_int) :: wavelengths_error_index=ids_int_invalid !Index in the error_description list for "wavelengths" + type(ids_signal_flt_2d) :: intensity_spectrum !Intensity spectrum (not calibrated), i.e. number of photoelectrons detected by unit time by a wavelength pixel of the channel, tak! + !ing into account electronic gain compensation and channels relative calibration + type(ids_signal_flt_2d) :: radiance_spectral !Calibrated spectral radiance (radiance per unit wavelength) + type(ids_charge_exchange_channel_processed_line), pointer :: processed_line(:) => null() !Set of processed spectral lines + real(ids_real), pointer :: radiance_calibration(:) => null() !Radiance calibration + real(ids_real), pointer :: radiance_calibration_error_upper(:) => null() !Upper error for "radiance_calibration" + real(ids_real), pointer :: radiance_calibration_error_lower(:) => null() !Lower error for "radiance_calibration" + integer(ids_int) :: radiance_calibration_error_index=ids_int_invalid !Index in the error_description list for "radiance_calibration" + character(len=ids_string_length), dimension(:), pointer :: radiance_calibration_date => null() !Date of the radiance calibration (yyyy_mm_dd) + character(len=ids_string_length), dimension(:), pointer :: wavelength_calibration_date => null() !Date of the wavelength calibration (yyyy_mm_dd) + type(ids_signal_flt_2d) :: radiance_continuum !Calibrated continuum intensity in the middle of the spectrum per unit wavelength + end type + + type :: ids_charge_exchange_channel + character(len=ids_string_length), dimension(:), pointer :: name => null() !Name of the channel + character(len=ids_string_length), dimension(:), pointer :: identifier => null() !ID of the channel + type(ids_rzphi1d_dynamic_aos1) :: position !Position of the measurements + type(ids_signal_flt_1d) :: t_i_average !Ion temperature (averaged on charge states and ion species) at the channel measurement point + type(ids_identifier) :: t_i_average_method !Description of the method used to reconstruct the average ion temperature + type(ids_signal_flt_1d) :: zeff !Local ionic effective charge at the channel measurement point + type(ids_identifier) :: zeff_method !Description of the method used to reconstruct the local effective charge + type(ids_signal_flt_1d) :: zeff_line_average !Ionic effective charge, line average along the channel line-of-sight + type(ids_identifier) :: zeff_line_average_method !Description of the method used to reconstruct the line average effective charge + type(ids_signal_flt_1d) :: momentum_tor !Total plasma toroidal momentum, summed over ion species and electrons weighted by their density and major radius, i.e. sum_over_sp! + !ecies(n*R*m*Vphi), at the channel measurement point + type(ids_identifier) :: momentum_tor_method !Description of the method used to reconstruct the total plasma toroidal momentum + type(ids_charge_exchange_channel_ion), pointer :: ion(:) => null() !Physical quantities related to ion species and charge stage (H+, D+, T+, He+2, Li+3, Be+4, C+6, N+7, O+8, Ne+10, Si+14, Ar+16 or A! + !r+18) derived from the measured charge exchange emission of each species, at the position of the measurement + type(ids_charge_exchange_channel_bes) :: bes !Derived Beam Emission Spectroscopy (BES) parameters + type(ids_charge_exchange_channel_ion_fast), pointer :: ion_fast(:) => null() !Derived Fast Ion Charge eXchange (FICX) parameters + type(ids_charge_exchange_channel_spectrum), pointer :: spectrum(:) => null() !Set of spectra obtained by various gratings + end type + + + ! *********** charge_exchange IDS + type, extends(IDS_base) :: ids_charge_exchange !Charge exchange spectroscopy diagnostic + logical, private :: c_data = .FALSE. ! Fortran specific metadata telling whether the IDS has been populated from C allocated data (LL) or not + integer, private :: max_occurrence = 4! Maximum occurrence allowed as defined in the DD + + type(ids_ids_properties) :: ids_properties !Interface Data Structure properties. This element identifies the node above as an IDS + type(ids_detector_aperture) :: aperture !Description of the collimating aperture of the diagnostic, relevant to all lines-of-sight (channels) + real(ids_real) :: etendue=ids_real_invalid !Etendue (geometric extent) of the optical system + real(ids_real) :: etendue_error_upper=ids_real_invalid !Upper error for "etendue" + real(ids_real) :: etendue_error_lower=ids_real_invalid !Lower error for "etendue" + integer(ids_int) :: etendue_error_index=ids_int_invalid !Index in the error_description list for "etendue" + type(ids_identifier_static) :: etendue_method !Method used to calculate the etendue. Index = 0 : exact calculation with a 4D integral; 1 : approximation with first order formula! + ! (detector surface times solid angle subtended by the apertures); 2 : other methods + type(ids_charge_exchange_channel), pointer :: channel(:) => null() !Set of channels (lines-of-sight). The line-of-sight is defined by the centre of the collimating aperture and the position of the m! + !easurements. + real(ids_real) :: latency=ids_real_invalid !Upper bound of the delay between physical information received by the detector and data available on the real-time (RT) network. + real(ids_real) :: latency_error_upper=ids_real_invalid !Upper error for "latency" + real(ids_real) :: latency_error_lower=ids_real_invalid !Lower error for "latency" + integer(ids_int) :: latency_error_index=ids_int_invalid !Index in the error_description list for "latency" + type(ids_code) :: code !Generic decription of the code-specific parameters for the code that has produced this IDS + real(ids_real), pointer :: time(:) => null() !Generic time + end type + + ! *********** coils_non_axisymmetric IDS internal structures declaration + + type :: ids_coil_conductor_elements + character(len=ids_string_length), dimension(:), pointer :: names => null() !Name or description of every element + integer(ids_int), pointer :: types(:) => null() !Type of every element: 1: line segment, its ends are given by the start and end points; index = 2: arc of a circle; index = 3: ful! + !l circle + type(ids_rzphi1d_static) :: start_points !Position of the start point of every element + type(ids_rzphi1d_static) :: intermediate_points !Position of an intermediate point along the arc of circle, for every element, providing the orientation of the element (must defin! + !e with the corresponding start point an aperture angle strictly inferior to PI). Meaningful only if type/index = 2, fill with defa! + !ult/empty value otherwise + type(ids_rzphi1d_static) :: end_points !Position of the end point of every element. Meaningful only if type/index = 1 or 2, fill with default/empty value otherwise + type(ids_rzphi1d_static) :: centres !Position of the centre of the arc of a circle of every element (meaningful only if type/index = 2 or 3, fill with default/empty va! + !lue otherwise) + end type + + type :: ids_coil_conductor + type(ids_coil_conductor_elements) :: elements !Set of geometrical elements (line segments and/or arcs of a circle) describing the contour of the conductor centre + type(ids_delta_rzphi1d_static) :: cross_section !The cross-section perpendicular to the conductor contour is described by a series of contour points, given by their relative posit! + !ion with respect to the start point of the first element. This cross-section is assumed constant for all elements. + real(ids_real) :: resistance=ids_real_invalid !conductor resistance + real(ids_real) :: resistance_error_upper=ids_real_invalid !Upper error for "resistance" + real(ids_real) :: resistance_error_lower=ids_real_invalid !Lower error for "resistance" + integer(ids_int) :: resistance_error_index=ids_int_invalid !Index in the error_description list for "resistance" + type(ids_signal_flt_1d) :: current !Current in the conductor (positive when it flows from the first to the last element) + type(ids_signal_flt_1d) :: voltage !Voltage on the conductor terminals + end type + + type :: ids_coil + character(len=ids_string_length), dimension(:), pointer :: name => null() !Name of the coil + character(len=ids_string_length), dimension(:), pointer :: identifier => null() !Alphanumeric identifier of coil + type(ids_coil_conductor), pointer :: conductor(:) => null() !Set of conductors inside the coil. The structure can be used with size 1 for a simplified description as a single conductor. A con! + !ductor is composed of several elements, serially connected, i.e. transporting the same current. + real(ids_real) :: turns=ids_real_invalid !Number of total turns in the coil. May be a fraction when describing the coil connections. + real(ids_real) :: turns_error_upper=ids_real_invalid !Upper error for "turns" + real(ids_real) :: turns_error_lower=ids_real_invalid !Lower error for "turns" + integer(ids_int) :: turns_error_index=ids_int_invalid !Index in the error_description list for "turns" + real(ids_real) :: resistance=ids_real_invalid !Coil resistance + real(ids_real) :: resistance_error_upper=ids_real_invalid !Upper error for "resistance" + real(ids_real) :: resistance_error_lower=ids_real_invalid !Lower error for "resistance" + integer(ids_int) :: resistance_error_index=ids_int_invalid !Index in the error_description list for "resistance" + type(ids_signal_flt_1d) :: current !Current in one turn of the coil (to be multiplied by the number of turns to calculate the magnetic field generated). Sign conventi! + !on : a positive current generates a positive radial magnetic field + type(ids_signal_flt_1d) :: voltage !Voltage on the coil terminals. Sign convention : a positive power supply voltage (and power supply current) generates a positive r! + !adial magnetic field + end type + + + ! *********** coils_non_axisymmetric IDS + type, extends(IDS_base) :: ids_coils_non_axisymmetric !Non axisymmetric active coils system (e.g. ELM control coils, error field correction coils, ...) + logical, private :: c_data = .FALSE. ! Fortran specific metadata telling whether the IDS has been populated from C allocated data (LL) or not + integer, private :: max_occurrence = 5! Maximum occurrence allowed as defined in the DD + + type(ids_ids_properties) :: ids_properties !Interface Data Structure properties. This element identifies the node above as an IDS + type(ids_coil), pointer :: coil(:) => null() !Set of coils + real(ids_real) :: latency=ids_real_invalid !Upper bound of the delay between input command received from the RT network and actuator starting to react. Applies globally to th! + !e system described by this IDS unless specific latencies (e.g. channel-specific or antenna-specific) are provided at a deeper leve! + !l in the IDS structure. + real(ids_real) :: latency_error_upper=ids_real_invalid !Upper error for "latency" + real(ids_real) :: latency_error_lower=ids_real_invalid !Lower error for "latency" + integer(ids_int) :: latency_error_index=ids_int_invalid !Index in the error_description list for "latency" + type(ids_code) :: code !Generic decription of the code-specific parameters for the code that has produced this IDS + real(ids_real), pointer :: time(:) => null() !Generic time + end type + + ! *********** controllers IDS internal structures declaration + + type :: ids_controllers_statespace + character(len=ids_string_length), dimension(:), pointer :: state_names => null() !Names of the states + type(ids_signal_flt_3d) :: a !A matrix + type(ids_signal_flt_3d) :: b !B matrix + type(ids_signal_flt_3d) :: c !C matrix + type(ids_signal_flt_3d) :: d !D matrix, normally proper and D=0 + type(ids_signal_flt_1d) :: deltat !Discrete time sampling interval ; if less than 1e-10, the controller is considered to be expressed in continuous time + end type + + type :: ids_controllers_pid + type(ids_signal_flt_3d) :: p !Proportional term + type(ids_signal_flt_3d) :: i !Integral term + type(ids_signal_flt_3d) :: d !Derivative term + type(ids_signal_flt_1d) :: tau !Filter time-constant for the D-term + end type + + type :: ids_controllers_linear_controller + character(len=ids_string_length), dimension(:), pointer :: name => null() !Name of this controller + character(len=ids_string_length), dimension(:), pointer :: description => null() !Description of this controller + character(len=ids_string_length), dimension(:), pointer :: controller_class => null() !One of a known class of controllers + character(len=ids_string_length), dimension(:), pointer :: input_names => null() !Names of the input signals, following the SDN convention + character(len=ids_string_length), dimension(:), pointer :: output_names => null() !Names of the output signals following the SDN convention + type(ids_controllers_statespace) :: statespace !Statespace controller in discrete or continuous time + type(ids_controllers_pid) :: pid !Filtered PID controller + type(ids_signal_flt_2d) :: inputs !Input signals; the timebase is common to inputs and outputs for any particular controller + type(ids_signal_flt_2d) :: outputs !Output signals; the timebase is common to inputs and outputs for any particular controller + end type + + type :: ids_controllers_nonlinear_controller + character(len=ids_string_length), dimension(:), pointer :: name => null() !Name of this controller + character(len=ids_string_length), dimension(:), pointer :: description => null() !Description of this controller + character(len=ids_string_length), dimension(:), pointer :: controller_class => null() !One of a known class of controllers + character(len=ids_string_length), dimension(:), pointer :: input_names => null() !Names of the input signals, following the SDN convention + character(len=ids_string_length), dimension(:), pointer :: output_names => null() !Output signal names following the SDN convention + character(len=ids_string_length), dimension(:), pointer :: function => null() !Method to be defined + type(ids_signal_flt_2d) :: inputs !Input signals; the timebase is common to inputs and outputs for any particular controller + type(ids_signal_flt_2d) :: outputs !Output signals; the timebase is common to inputs and outputs for any particular controller + end type + + + ! *********** controllers IDS + type, extends(IDS_base) :: ids_controllers !Feedback and feedforward controllers + logical, private :: c_data = .FALSE. ! Fortran specific metadata telling whether the IDS has been populated from C allocated data (LL) or not + integer, private :: max_occurrence = 2! Maximum occurrence allowed as defined in the DD + + type(ids_ids_properties) :: ids_properties !Interface Data Structure properties. This element identifies the node above as an IDS + type(ids_controllers_linear_controller), pointer :: linear_controller(:) => null() !A linear controller, this is rather conventional + type(ids_controllers_nonlinear_controller), pointer :: nonlinear_controller(:) => null() !A non-linear controller, this is less conventional and will have to be developed + real(ids_real), pointer :: time(:) => null() !Generic time + type(ids_code) :: code !Generic decription of the code-specific parameters for the code that has produced this IDS + end type + + ! *********** core_instant_changes IDS internal structures declaration + + type :: ids_core_instant_changes_change + type(ids_identifier) :: identifier !Instant change term identifier + type(ids_core_profiles_profiles_1d), pointer :: profiles_1d(:) => null() !Changes in 1D core profiles for various time slices. This structure mirrors core_profiles/profiles_1d and describes instant change! + !s to each of these physical quantities (i.e. a signed difference quantity after change - quantity before change) + end type + + + ! *********** core_instant_changes IDS + type, extends(IDS_base) :: ids_core_instant_changes !Instant changes of the radial core plasma profiles due to pellet, MHD, ... + logical, private :: c_data = .FALSE. ! Fortran specific metadata telling whether the IDS has been populated from C allocated data (LL) or not + integer, private :: max_occurrence = 3! Maximum occurrence allowed as defined in the DD + + type(ids_ids_properties) :: ids_properties !Interface Data Structure properties. This element identifies the node above as an IDS + type(ids_b_tor_vacuum_1) :: vacuum_toroidal_field !Characteristics of the vacuum toroidal field (used in Rho_Tor definition and in the normalization of current densities) + type(ids_core_instant_changes_change), pointer :: change(:) => null() !Set of instant change terms (each being due to a different phenomenon) + type(ids_code) :: code !Generic decription of the code-specific parameters for the code that has produced this IDS + real(ids_real), pointer :: time(:) => null() !Generic time + end type + + ! *********** core_profiles IDS internal structures declaration + + type :: ids_core_profiles_global_quantities_ion + real(ids_real), pointer :: t_i_volume_average(:) => null() !Volume averaged temperature of this ion species (averaged over the plasma volume up to the LCFS) + real(ids_real), pointer :: t_i_volume_average_error_upper(:) => null() !Upper error for "t_i_volume_average" + real(ids_real), pointer :: t_i_volume_average_error_lower(:) => null() !Lower error for "t_i_volume_average" + integer(ids_int) :: t_i_volume_average_error_index=ids_int_invalid !Index in the error_description list for "t_i_volume_average" + real(ids_real), pointer :: n_i_volume_average(:) => null() !Volume averaged density of this ion species (averaged over the plasma volume up to the LCFS) + real(ids_real), pointer :: n_i_volume_average_error_upper(:) => null() !Upper error for "n_i_volume_average" + real(ids_real), pointer :: n_i_volume_average_error_lower(:) => null() !Lower error for "n_i_volume_average" + integer(ids_int) :: n_i_volume_average_error_index=ids_int_invalid !Index in the error_description list for "n_i_volume_average" + end type + + type :: ids_core_profiles_global_quantities + real(ids_real), pointer :: ip(:) => null() !Total plasma current (toroidal component). Positive sign means anti-clockwise when viewed from above. + real(ids_real), pointer :: ip_error_upper(:) => null() !Upper error for "ip" + real(ids_real), pointer :: ip_error_lower(:) => null() !Lower error for "ip" + integer(ids_int) :: ip_error_index=ids_int_invalid !Index in the error_description list for "ip" + real(ids_real), pointer :: current_non_inductive(:) => null() !Total non-inductive current (toroidal component). Positive sign means anti-clockwise when viewed from above. + real(ids_real), pointer :: current_non_inductive_error_upper(:) => null() !Upper error for "current_non_inductive" + real(ids_real), pointer :: current_non_inductive_error_lower(:) => null() !Lower error for "current_non_inductive" + integer(ids_int) :: current_non_inductive_error_index=ids_int_invalid !Index in the error_description list for "current_non_inductive" + real(ids_real), pointer :: current_bootstrap(:) => null() !Bootstrap current (toroidal component). Positive sign means anti-clockwise when viewed from above. + real(ids_real), pointer :: current_bootstrap_error_upper(:) => null() !Upper error for "current_bootstrap" + real(ids_real), pointer :: current_bootstrap_error_lower(:) => null() !Lower error for "current_bootstrap" + integer(ids_int) :: current_bootstrap_error_index=ids_int_invalid !Index in the error_description list for "current_bootstrap" + real(ids_real), pointer :: v_loop(:) => null() !LCFS loop voltage (positive value drives positive ohmic current that flows anti-clockwise when viewed from above) + real(ids_real), pointer :: v_loop_error_upper(:) => null() !Upper error for "v_loop" + real(ids_real), pointer :: v_loop_error_lower(:) => null() !Lower error for "v_loop" + integer(ids_int) :: v_loop_error_index=ids_int_invalid !Index in the error_description list for "v_loop" + real(ids_real), pointer :: li(:) => null() !Internal inductance. The li_3 definition is used, i.e. li_3 = 2/R0/mu0^2/Ip^2 * int(Bp^2 dV). + real(ids_real), pointer :: li_error_upper(:) => null() !Upper error for "li" + real(ids_real), pointer :: li_error_lower(:) => null() !Lower error for "li" + integer(ids_int) :: li_error_index=ids_int_invalid !Index in the error_description list for "li" + real(ids_real), pointer :: li_3(:) => null() !Internal inductance. The li_3 definition is used, i.e. li_3 = 2/R0/mu0^2/Ip^2 * int(Bp^2 dV). + real(ids_real), pointer :: li_3_error_upper(:) => null() !Upper error for "li_3" + real(ids_real), pointer :: li_3_error_lower(:) => null() !Lower error for "li_3" + integer(ids_int) :: li_3_error_index=ids_int_invalid !Index in the error_description list for "li_3" + real(ids_real), pointer :: beta_tor(:) => null() !Toroidal beta, defined as the volume-averaged total perpendicular pressure divided by (B0^2/(2*mu0)), i.e. beta_toroidal = 2 mu0 i! + !nt(p dV) / V / B0^2 + real(ids_real), pointer :: beta_tor_error_upper(:) => null() !Upper error for "beta_tor" + real(ids_real), pointer :: beta_tor_error_lower(:) => null() !Lower error for "beta_tor" + integer(ids_int) :: beta_tor_error_index=ids_int_invalid !Index in the error_description list for "beta_tor" + real(ids_real), pointer :: beta_tor_norm(:) => null() !Normalised toroidal beta, defined as 100 * beta_tor * a[m] * B0 [T] / ip [MA] + real(ids_real), pointer :: beta_tor_norm_error_upper(:) => null() !Upper error for "beta_tor_norm" + real(ids_real), pointer :: beta_tor_norm_error_lower(:) => null() !Lower error for "beta_tor_norm" + integer(ids_int) :: beta_tor_norm_error_index=ids_int_invalid !Index in the error_description list for "beta_tor_norm" + real(ids_real), pointer :: beta_pol(:) => null() !Poloidal beta. Defined as betap = 4 int(p dV) / [R_0 * mu_0 * Ip^2] + real(ids_real), pointer :: beta_pol_error_upper(:) => null() !Upper error for "beta_pol" + real(ids_real), pointer :: beta_pol_error_lower(:) => null() !Lower error for "beta_pol" + integer(ids_int) :: beta_pol_error_index=ids_int_invalid !Index in the error_description list for "beta_pol" + real(ids_real), pointer :: energy_diamagnetic(:) => null() !Plasma energy content = 3/2 * integral over the plasma volume of the total perpendicular pressure + real(ids_real), pointer :: energy_diamagnetic_error_upper(:) => null() !Upper error for "energy_diamagnetic" + real(ids_real), pointer :: energy_diamagnetic_error_lower(:) => null() !Lower error for "energy_diamagnetic" + integer(ids_int) :: energy_diamagnetic_error_index=ids_int_invalid !Index in the error_description list for "energy_diamagnetic" + real(ids_real), pointer :: z_eff_resistive(:) => null() !Volume average plasma effective charge, estimated from the flux consumption in the ohmic phase + real(ids_real), pointer :: z_eff_resistive_error_upper(:) => null() !Upper error for "z_eff_resistive" + real(ids_real), pointer :: z_eff_resistive_error_lower(:) => null() !Lower error for "z_eff_resistive" + integer(ids_int) :: z_eff_resistive_error_index=ids_int_invalid !Index in the error_description list for "z_eff_resistive" + real(ids_real), pointer :: t_e_peaking(:) => null() !Electron temperature peaking factor, defined as the Te value at the magnetic axis divided by the volume averaged Te (average over ! + !the plasma volume up to the LCFS) + real(ids_real), pointer :: t_e_peaking_error_upper(:) => null() !Upper error for "t_e_peaking" + real(ids_real), pointer :: t_e_peaking_error_lower(:) => null() !Lower error for "t_e_peaking" + integer(ids_int) :: t_e_peaking_error_index=ids_int_invalid !Index in the error_description list for "t_e_peaking" + real(ids_real), pointer :: t_i_average_peaking(:) => null() !Ion temperature (averaged over ion species and states) peaking factor, defined as the Ti value at the magnetic axis divided by the! + ! volume averaged Ti (average over the plasma volume up to the LCFS) + real(ids_real), pointer :: t_i_average_peaking_error_upper(:) => null() !Upper error for "t_i_average_peaking" + real(ids_real), pointer :: t_i_average_peaking_error_lower(:) => null() !Lower error for "t_i_average_peaking" + integer(ids_int) :: t_i_average_peaking_error_index=ids_int_invalid !Index in the error_description list for "t_i_average_peaking" + real(ids_real), pointer :: resistive_psi_losses(:) => null() !Resistive part of the poloidal flux losses, defined as the volume-averaged scalar product of the electric field and the ohmic curr! + !ent density, normalized by the plasma current and integrated in time from the beginning of the plasma discharge: int ( (int(E_fiel! + !d_tor.j_ohm_tor) dV) / Ip ) dt) + real(ids_real), pointer :: resistive_psi_losses_error_upper(:) => null() !Upper error for "resistive_psi_losses" + real(ids_real), pointer :: resistive_psi_losses_error_lower(:) => null() !Lower error for "resistive_psi_losses" + integer(ids_int) :: resistive_psi_losses_error_index=ids_int_invalid !Index in the error_description list for "resistive_psi_losses" + real(ids_real), pointer :: ejima(:) => null() !Ejima coefficient : resistive psi losses divided by (mu0*R*Ip). See S. Ejima et al, Nuclear Fusion, Vol.22, No.10 (1982), 1313 + real(ids_real), pointer :: ejima_error_upper(:) => null() !Upper error for "ejima" + real(ids_real), pointer :: ejima_error_lower(:) => null() !Lower error for "ejima" + integer(ids_int) :: ejima_error_index=ids_int_invalid !Index in the error_description list for "ejima" + real(ids_real), pointer :: t_e_volume_average(:) => null() !Volume averaged electron temperature (average over the plasma volume up to the LCFS) + real(ids_real), pointer :: t_e_volume_average_error_upper(:) => null() !Upper error for "t_e_volume_average" + real(ids_real), pointer :: t_e_volume_average_error_lower(:) => null() !Lower error for "t_e_volume_average" + integer(ids_int) :: t_e_volume_average_error_index=ids_int_invalid !Index in the error_description list for "t_e_volume_average" + real(ids_real), pointer :: n_e_volume_average(:) => null() !Volume averaged electron density (average over the plasma volume up to the LCFS) + real(ids_real), pointer :: n_e_volume_average_error_upper(:) => null() !Upper error for "n_e_volume_average" + real(ids_real), pointer :: n_e_volume_average_error_lower(:) => null() !Lower error for "n_e_volume_average" + integer(ids_int) :: n_e_volume_average_error_index=ids_int_invalid !Index in the error_description list for "n_e_volume_average" + type(ids_core_profiles_global_quantities_ion), pointer :: ion(:) => null() !Quantities related to the different ion species, in the sense of isonuclear or isomolecular sequences. The set of ion species of t! + !his array must be the same as the one defined in profiles_1d/ion, at the time slice indicated in ion_time_slice + real(ids_real) :: ion_time_slice=ids_real_invalid !Time slice of the profiles_1d array used to define the ion composition of the global_quantities/ion array. + real(ids_real) :: ion_time_slice_error_upper=ids_real_invalid !Upper error for "ion_time_slice" + real(ids_real) :: ion_time_slice_error_lower=ids_real_invalid !Lower error for "ion_time_slice" + integer(ids_int) :: ion_time_slice_error_index=ids_int_invalid !Index in the error_description list for "ion_time_slice" + end type + + + ! *********** core_profiles IDS + type, extends(IDS_base) :: ids_core_profiles !Core plasma radial profiles + logical, private :: c_data = .FALSE. ! Fortran specific metadata telling whether the IDS has been populated from C allocated data (LL) or not + integer, private :: max_occurrence = 15! Maximum occurrence allowed as defined in the DD + + type(ids_ids_properties) :: ids_properties !Interface Data Structure properties. This element identifies the node above as an IDS + type(ids_core_profiles_profiles_1d), pointer :: profiles_1d(:) => null() !Core plasma radial profiles for various time slices + type(ids_core_profiles_global_quantities) :: global_quantities !Various global quantities derived from the profiles + type(ids_b_tor_vacuum_1) :: vacuum_toroidal_field !Characteristics of the vacuum toroidal field (used in rho_tor definition and in the normalization of current densities) + type(ids_code) :: code !Generic decription of the code-specific parameters for the code that has produced this IDS + real(ids_real), pointer :: time(:) => null() !Generic time + end type + + ! *********** core_sources IDS internal structures declaration + + type :: ids_core_sources_source_global_electrons + real(ids_real) :: particles=ids_real_invalid !Electron particle source + real(ids_real) :: particles_error_upper=ids_real_invalid !Upper error for "particles" + real(ids_real) :: particles_error_lower=ids_real_invalid !Lower error for "particles" + integer(ids_int) :: particles_error_index=ids_int_invalid !Index in the error_description list for "particles" + real(ids_real) :: power=ids_real_invalid !Power coupled to electrons + real(ids_real) :: power_error_upper=ids_real_invalid !Upper error for "power" + real(ids_real) :: power_error_lower=ids_real_invalid !Lower error for "power" + integer(ids_int) :: power_error_index=ids_int_invalid !Index in the error_description list for "power" + end type + + type :: ids_core_sources_source_global + real(ids_real) :: power=ids_real_invalid !Total power coupled to the plasma + real(ids_real) :: power_error_upper=ids_real_invalid !Upper error for "power" + real(ids_real) :: power_error_lower=ids_real_invalid !Lower error for "power" + integer(ids_int) :: power_error_index=ids_int_invalid !Index in the error_description list for "power" + real(ids_real) :: total_ion_particles=ids_real_invalid !Total ion particle source (summed over ion species) + real(ids_real) :: total_ion_particles_error_upper=ids_real_invalid !Upper error for "total_ion_particles" + real(ids_real) :: total_ion_particles_error_lower=ids_real_invalid !Lower error for "total_ion_particles" + integer(ids_int) :: total_ion_particles_error_index=ids_int_invalid !Index in the error_description list for "total_ion_particles" + real(ids_real) :: total_ion_power=ids_real_invalid !Total power coupled to ion species (summed over ion species) + real(ids_real) :: total_ion_power_error_upper=ids_real_invalid !Upper error for "total_ion_power" + real(ids_real) :: total_ion_power_error_lower=ids_real_invalid !Lower error for "total_ion_power" + integer(ids_int) :: total_ion_power_error_index=ids_int_invalid !Index in the error_description list for "total_ion_power" + type(ids_core_sources_source_global_electrons) :: electrons !Sources for electrons + real(ids_real) :: torque_tor=ids_real_invalid !Toroidal torque + real(ids_real) :: torque_tor_error_upper=ids_real_invalid !Upper error for "torque_tor" + real(ids_real) :: torque_tor_error_lower=ids_real_invalid !Lower error for "torque_tor" + integer(ids_int) :: torque_tor_error_index=ids_int_invalid !Index in the error_description list for "torque_tor" + real(ids_real) :: current_parallel=ids_real_invalid !Parallel current driven + real(ids_real) :: current_parallel_error_upper=ids_real_invalid !Upper error for "current_parallel" + real(ids_real) :: current_parallel_error_lower=ids_real_invalid !Lower error for "current_parallel" + integer(ids_int) :: current_parallel_error_index=ids_int_invalid !Index in the error_description list for "current_parallel" + real(ids_real) :: time=ids_real_invalid !Time + end type + + type :: ids_core_sources_source_profiles_1d_particles_decomposed_3 + real(ids_real), pointer :: implicit_part(:) => null() !Implicit part of the source term, i.e. to be multiplied by the equation's primary quantity + real(ids_real), pointer :: implicit_part_error_upper(:) => null() !Upper error for "implicit_part" + real(ids_real), pointer :: implicit_part_error_lower(:) => null() !Lower error for "implicit_part" + integer(ids_int) :: implicit_part_error_index=ids_int_invalid !Index in the error_description list for "implicit_part" + real(ids_real), pointer :: explicit_part(:) => null() !Explicit part of the source term + real(ids_real), pointer :: explicit_part_error_upper(:) => null() !Upper error for "explicit_part" + real(ids_real), pointer :: explicit_part_error_lower(:) => null() !Lower error for "explicit_part" + integer(ids_int) :: explicit_part_error_index=ids_int_invalid !Index in the error_description list for "explicit_part" + end type + + type :: ids_core_sources_source_profiles_1d_energy_decomposed_3 + real(ids_real), pointer :: implicit_part(:) => null() !Implicit part of the source term, i.e. to be multiplied by the equation's primary quantity + real(ids_real), pointer :: implicit_part_error_upper(:) => null() !Upper error for "implicit_part" + real(ids_real), pointer :: implicit_part_error_lower(:) => null() !Lower error for "implicit_part" + integer(ids_int) :: implicit_part_error_index=ids_int_invalid !Index in the error_description list for "implicit_part" + real(ids_real), pointer :: explicit_part(:) => null() !Explicit part of the source term + real(ids_real), pointer :: explicit_part_error_upper(:) => null() !Upper error for "explicit_part" + real(ids_real), pointer :: explicit_part_error_lower(:) => null() !Lower error for "explicit_part" + integer(ids_int) :: explicit_part_error_index=ids_int_invalid !Index in the error_description list for "explicit_part" + end type + + type :: ids_core_sources_source_profiles_1d_electrons + real(ids_real), pointer :: particles(:) => null() !Source term for electron density equation + real(ids_real), pointer :: particles_error_upper(:) => null() !Upper error for "particles" + real(ids_real), pointer :: particles_error_lower(:) => null() !Lower error for "particles" + integer(ids_int) :: particles_error_index=ids_int_invalid !Index in the error_description list for "particles" + type(ids_core_sources_source_profiles_1d_particles_decomposed_3) :: particles_decomposed !Decomposition of the source term for electron density equation into implicit and explicit parts + real(ids_real), pointer :: particles_inside(:) => null() !Electron source inside the flux surface. Cumulative volume integral of the source term for the electron density equation. + real(ids_real), pointer :: particles_inside_error_upper(:) => null() !Upper error for "particles_inside" + real(ids_real), pointer :: particles_inside_error_lower(:) => null() !Lower error for "particles_inside" + integer(ids_int) :: particles_inside_error_index=ids_int_invalid !Index in the error_description list for "particles_inside" + real(ids_real), pointer :: energy(:) => null() !Source term for the electron energy equation + real(ids_real), pointer :: energy_error_upper(:) => null() !Upper error for "energy" + real(ids_real), pointer :: energy_error_lower(:) => null() !Lower error for "energy" + integer(ids_int) :: energy_error_index=ids_int_invalid !Index in the error_description list for "energy" + type(ids_core_sources_source_profiles_1d_energy_decomposed_3) :: energy_decomposed !Decomposition of the source term for electron energy equation into implicit and explicit parts + real(ids_real), pointer :: power_inside(:) => null() !Power coupled to electrons inside the flux surface. Cumulative volume integral of the source term for the electron energy equation + real(ids_real), pointer :: power_inside_error_upper(:) => null() !Upper error for "power_inside" + real(ids_real), pointer :: power_inside_error_lower(:) => null() !Lower error for "power_inside" + integer(ids_int) :: power_inside_error_index=ids_int_invalid !Index in the error_description list for "power_inside" + end type + + type :: ids_core_sources_source_profiles_1d_energy_decomposed_2 + real(ids_real), pointer :: implicit_part(:) => null() !Implicit part of the source term, i.e. to be multiplied by the equation's primary quantity + real(ids_real), pointer :: implicit_part_error_upper(:) => null() !Upper error for "implicit_part" + real(ids_real), pointer :: implicit_part_error_lower(:) => null() !Lower error for "implicit_part" + integer(ids_int) :: implicit_part_error_index=ids_int_invalid !Index in the error_description list for "implicit_part" + real(ids_real), pointer :: explicit_part(:) => null() !Explicit part of the source term + real(ids_real), pointer :: explicit_part_error_upper(:) => null() !Upper error for "explicit_part" + real(ids_real), pointer :: explicit_part_error_lower(:) => null() !Lower error for "explicit_part" + integer(ids_int) :: explicit_part_error_index=ids_int_invalid !Index in the error_description list for "explicit_part" + end type + + type :: ids_core_sources_source_profiles_1d_momentum_decomposed_4 + real(ids_real), pointer :: implicit_part(:) => null() !Implicit part of the source term, i.e. to be multiplied by the equation's primary quantity + real(ids_real), pointer :: implicit_part_error_upper(:) => null() !Upper error for "implicit_part" + real(ids_real), pointer :: implicit_part_error_lower(:) => null() !Lower error for "implicit_part" + integer(ids_int) :: implicit_part_error_index=ids_int_invalid !Index in the error_description list for "implicit_part" + real(ids_real), pointer :: explicit_part(:) => null() !Explicit part of the source term + real(ids_real), pointer :: explicit_part_error_upper(:) => null() !Upper error for "explicit_part" + real(ids_real), pointer :: explicit_part_error_lower(:) => null() !Lower error for "explicit_part" + integer(ids_int) :: explicit_part_error_index=ids_int_invalid !Index in the error_description list for "explicit_part" + end type + + type :: ids_core_sources_source_profiles_1d_components_2 + real(ids_real), pointer :: radial(:) => null() !Radial component + real(ids_real), pointer :: radial_error_upper(:) => null() !Upper error for "radial" + real(ids_real), pointer :: radial_error_lower(:) => null() !Lower error for "radial" + integer(ids_int) :: radial_error_index=ids_int_invalid !Index in the error_description list for "radial" + real(ids_real), pointer :: diamagnetic(:) => null() !Diamagnetic component + real(ids_real), pointer :: diamagnetic_error_upper(:) => null() !Upper error for "diamagnetic" + real(ids_real), pointer :: diamagnetic_error_lower(:) => null() !Lower error for "diamagnetic" + integer(ids_int) :: diamagnetic_error_index=ids_int_invalid !Index in the error_description list for "diamagnetic" + real(ids_real), pointer :: parallel(:) => null() !Parallel component + real(ids_real), pointer :: parallel_error_upper(:) => null() !Upper error for "parallel" + real(ids_real), pointer :: parallel_error_lower(:) => null() !Lower error for "parallel" + integer(ids_int) :: parallel_error_index=ids_int_invalid !Index in the error_description list for "parallel" + real(ids_real), pointer :: poloidal(:) => null() !Poloidal component + real(ids_real), pointer :: poloidal_error_upper(:) => null() !Upper error for "poloidal" + real(ids_real), pointer :: poloidal_error_lower(:) => null() !Lower error for "poloidal" + integer(ids_int) :: poloidal_error_index=ids_int_invalid !Index in the error_description list for "poloidal" + real(ids_real), pointer :: toroidal(:) => null() !Toroidal component + real(ids_real), pointer :: toroidal_error_upper(:) => null() !Upper error for "toroidal" + real(ids_real), pointer :: toroidal_error_lower(:) => null() !Lower error for "toroidal" + integer(ids_int) :: toroidal_error_index=ids_int_invalid !Index in the error_description list for "toroidal" + type(ids_core_sources_source_profiles_1d_momentum_decomposed_4) :: toroidal_decomposed !Decomposition of the source term for ion toroidal momentum equation into implicit and explicit parts + end type + + type :: ids_core_sources_source_profiles_1d_particles_decomposed_4 + real(ids_real), pointer :: implicit_part(:) => null() !Implicit part of the source term, i.e. to be multiplied by the equation's primary quantity + real(ids_real), pointer :: implicit_part_error_upper(:) => null() !Upper error for "implicit_part" + real(ids_real), pointer :: implicit_part_error_lower(:) => null() !Lower error for "implicit_part" + integer(ids_int) :: implicit_part_error_index=ids_int_invalid !Index in the error_description list for "implicit_part" + real(ids_real), pointer :: explicit_part(:) => null() !Explicit part of the source term + real(ids_real), pointer :: explicit_part_error_upper(:) => null() !Upper error for "explicit_part" + real(ids_real), pointer :: explicit_part_error_lower(:) => null() !Lower error for "explicit_part" + integer(ids_int) :: explicit_part_error_index=ids_int_invalid !Index in the error_description list for "explicit_part" + end type + + type :: ids_core_sources_source_profiles_1d_energy_decomposed_4 + real(ids_real), pointer :: implicit_part(:) => null() !Implicit part of the source term, i.e. to be multiplied by the equation's primary quantity + real(ids_real), pointer :: implicit_part_error_upper(:) => null() !Upper error for "implicit_part" + real(ids_real), pointer :: implicit_part_error_lower(:) => null() !Lower error for "implicit_part" + integer(ids_int) :: implicit_part_error_index=ids_int_invalid !Index in the error_description list for "implicit_part" + real(ids_real), pointer :: explicit_part(:) => null() !Explicit part of the source term + real(ids_real), pointer :: explicit_part_error_upper(:) => null() !Upper error for "explicit_part" + real(ids_real), pointer :: explicit_part_error_lower(:) => null() !Lower error for "explicit_part" + integer(ids_int) :: explicit_part_error_index=ids_int_invalid !Index in the error_description list for "explicit_part" + end type + + type :: ids_core_sources_source_profiles_1d_ions_charge_states + real(ids_real) :: z_min=ids_real_invalid !Minimum Z of the charge state bundle + real(ids_real) :: z_min_error_upper=ids_real_invalid !Upper error for "z_min" + real(ids_real) :: z_min_error_lower=ids_real_invalid !Lower error for "z_min" + integer(ids_int) :: z_min_error_index=ids_int_invalid !Index in the error_description list for "z_min" + real(ids_real) :: z_max=ids_real_invalid !Maximum Z of the charge state bundle + real(ids_real) :: z_max_error_upper=ids_real_invalid !Upper error for "z_max" + real(ids_real) :: z_max_error_lower=ids_real_invalid !Lower error for "z_max" + integer(ids_int) :: z_max_error_index=ids_int_invalid !Index in the error_description list for "z_max" + character(len=ids_string_length), dimension(:), pointer :: label => null() !String identifying charge state (e.g. C+, C+2 , C+3, C+4, C+5, C+6, ...) + real(ids_real) :: vibrational_level=ids_real_invalid !Vibrational level (can be bundled) + real(ids_real) :: vibrational_level_error_upper=ids_real_invalid !Upper error for "vibrational_level" + real(ids_real) :: vibrational_level_error_lower=ids_real_invalid !Lower error for "vibrational_level" + integer(ids_int) :: vibrational_level_error_index=ids_int_invalid !Index in the error_description list for "vibrational_level" + character(len=ids_string_length), dimension(:), pointer :: vibrational_mode => null() !Vibrational mode of this state, e.g. "A_g". Need to define, or adopt a standard nomenclature. + integer(ids_int) :: is_neutral=ids_int_invalid !Flag specifying if this state corresponds to a neutral (1) or not (0) + type(ids_identifier_dynamic_aos3) :: neutral_type !Neutral type (if the considered state is a neutral), in terms of energy. ID =1: cold; 2: thermal; 3: fast; 4: NBI + character(len=ids_string_length), dimension(:), pointer :: electron_configuration => null() !Configuration of atomic orbitals of this state, e.g. 1s2-2s1 + real(ids_real), pointer :: particles(:) => null() !Source term for the charge state density transport equation + real(ids_real), pointer :: particles_error_upper(:) => null() !Upper error for "particles" + real(ids_real), pointer :: particles_error_lower(:) => null() !Lower error for "particles" + integer(ids_int) :: particles_error_index=ids_int_invalid !Index in the error_description list for "particles" + type(ids_core_sources_source_profiles_1d_particles_decomposed_4) :: particles_decomposed !Decomposition of the source term for state density equation into implicit and explicit parts + real(ids_real), pointer :: energy(:) => null() !Source terms for the charge state energy transport equation + real(ids_real), pointer :: energy_error_upper(:) => null() !Upper error for "energy" + real(ids_real), pointer :: energy_error_lower(:) => null() !Lower error for "energy" + integer(ids_int) :: energy_error_index=ids_int_invalid !Index in the error_description list for "energy" + type(ids_core_sources_source_profiles_1d_energy_decomposed_4) :: energy_decomposed !Decomposition of the source term for state energy equation into implicit and explicit parts + end type + + type :: ids_core_sources_source_profiles_1d_ions + type(ids_plasma_composition_neutral_element), pointer :: element(:) => null() !List of elements forming the atom or molecule + real(ids_real) :: z_ion=ids_real_invalid !Ion charge (of the dominant ionisation state; lumped ions are allowed) + real(ids_real) :: z_ion_error_upper=ids_real_invalid !Upper error for "z_ion" + real(ids_real) :: z_ion_error_lower=ids_real_invalid !Lower error for "z_ion" + integer(ids_int) :: z_ion_error_index=ids_int_invalid !Index in the error_description list for "z_ion" + character(len=ids_string_length), dimension(:), pointer :: label => null() !String identifying ion (e.g. H, D, T, He, C, D2, ...) + integer(ids_int) :: neutral_index=ids_int_invalid !Index of the corresponding neutral species in the ../../neutral array + real(ids_real), pointer :: particles(:) => null() !Source term for ion density equation + real(ids_real), pointer :: particles_error_upper(:) => null() !Upper error for "particles" + real(ids_real), pointer :: particles_error_lower(:) => null() !Lower error for "particles" + integer(ids_int) :: particles_error_index=ids_int_invalid !Index in the error_description list for "particles" + type(ids_core_sources_source_profiles_1d_particles_decomposed_3) :: particles_decomposed !Decomposition of the source term for ion density equation into implicit and explicit parts + real(ids_real), pointer :: energy(:) => null() !Source term for the ion energy transport equation. + real(ids_real), pointer :: energy_error_upper(:) => null() !Upper error for "energy" + real(ids_real), pointer :: energy_error_lower(:) => null() !Lower error for "energy" + integer(ids_int) :: energy_error_index=ids_int_invalid !Index in the error_description list for "energy" + type(ids_core_sources_source_profiles_1d_energy_decomposed_3) :: energy_decomposed !Decomposition of the source term for ion energy equation into implicit and explicit parts + type(ids_core_sources_source_profiles_1d_components_2) :: momentum !Source term for the ion momentum transport equations along various components (directions) + integer(ids_int) :: multiple_states_flag=ids_int_invalid !Multiple states calculation flag : 0-Only the 'ion' level is considered and the 'state' array of structure is empty; 1-Ion states ! + !are considered and are described in the 'state' array of structure + type(ids_core_sources_source_profiles_1d_ions_charge_states), pointer :: state(:) => null() !Source terms related to the different charge states of the species (ionisation, energy, excitation, ...) + end type + + type :: ids_core_sources_source_profiles_1d_neutral_state + character(len=ids_string_length), dimension(:), pointer :: label => null() !String identifying state + real(ids_real) :: vibrational_level=ids_real_invalid !Vibrational level (can be bundled) + real(ids_real) :: vibrational_level_error_upper=ids_real_invalid !Upper error for "vibrational_level" + real(ids_real) :: vibrational_level_error_lower=ids_real_invalid !Lower error for "vibrational_level" + integer(ids_int) :: vibrational_level_error_index=ids_int_invalid !Index in the error_description list for "vibrational_level" + character(len=ids_string_length), dimension(:), pointer :: vibrational_mode => null() !Vibrational mode of this state, e.g. "A_g". Need to define, or adopt a standard nomenclature. + type(ids_identifier_dynamic_aos3) :: neutral_type !Neutral type (if the considered state is a neutral), in terms of energy. ID =1: cold; 2: thermal; 3: fast; 4: NBI + character(len=ids_string_length), dimension(:), pointer :: electron_configuration => null() !Configuration of atomic orbitals of this state, e.g. 1s2-2s1 + real(ids_real), pointer :: particles(:) => null() !Source term for the state density transport equation + real(ids_real), pointer :: particles_error_upper(:) => null() !Upper error for "particles" + real(ids_real), pointer :: particles_error_lower(:) => null() !Lower error for "particles" + integer(ids_int) :: particles_error_index=ids_int_invalid !Index in the error_description list for "particles" + real(ids_real), pointer :: energy(:) => null() !Source terms for the state energy transport equation + real(ids_real), pointer :: energy_error_upper(:) => null() !Upper error for "energy" + real(ids_real), pointer :: energy_error_lower(:) => null() !Lower error for "energy" + integer(ids_int) :: energy_error_index=ids_int_invalid !Index in the error_description list for "energy" + end type + + type :: ids_core_sources_source_profiles_1d_neutral + type(ids_plasma_composition_neutral_element), pointer :: element(:) => null() !List of elements forming the atom or molecule + character(len=ids_string_length), dimension(:), pointer :: label => null() !String identifying the neutral species (e.g. H, D, T, He, C, ...) + integer(ids_int) :: ion_index=ids_int_invalid !Index of the corresponding ion species in the ../../ion array + real(ids_real), pointer :: particles(:) => null() !Source term for neutral density equation + real(ids_real), pointer :: particles_error_upper(:) => null() !Upper error for "particles" + real(ids_real), pointer :: particles_error_lower(:) => null() !Lower error for "particles" + integer(ids_int) :: particles_error_index=ids_int_invalid !Index in the error_description list for "particles" + real(ids_real), pointer :: energy(:) => null() !Source term for the neutral energy transport equation. + real(ids_real), pointer :: energy_error_upper(:) => null() !Upper error for "energy" + real(ids_real), pointer :: energy_error_lower(:) => null() !Lower error for "energy" + integer(ids_int) :: energy_error_index=ids_int_invalid !Index in the error_description list for "energy" + integer(ids_int) :: multiple_states_flag=ids_int_invalid !Multiple states calculation flag : 0-Only one state is considered; 1-Multiple states are considered and are described in the state! + ! structure + type(ids_core_sources_source_profiles_1d_neutral_state), pointer :: state(:) => null() !Source terms related to the different charge states of the species (energy, excitation, ...) + end type + + type :: ids_core_sources_source_profiles_1d + type(ids_core_radial_grid) :: grid !Radial grid + type(ids_core_sources_source_profiles_1d_electrons) :: electrons !Sources for electrons + real(ids_real), pointer :: total_ion_energy(:) => null() !Source term for the total (summed over ion species) energy equation + real(ids_real), pointer :: total_ion_energy_error_upper(:) => null() !Upper error for "total_ion_energy" + real(ids_real), pointer :: total_ion_energy_error_lower(:) => null() !Lower error for "total_ion_energy" + integer(ids_int) :: total_ion_energy_error_index=ids_int_invalid !Index in the error_description list for "total_ion_energy" + type(ids_core_sources_source_profiles_1d_energy_decomposed_2) :: total_ion_energy_decomposed !Decomposition of the source term for total ion energy equation into implicit and explicit parts + real(ids_real), pointer :: total_ion_power_inside(:) => null() !Total power coupled to ion species (summed over ion species) inside the flux surface. Cumulative volume integral of the source te! + !rm for the total ion energy equation + real(ids_real), pointer :: total_ion_power_inside_error_upper(:) => null() !Upper error for "total_ion_power_inside" + real(ids_real), pointer :: total_ion_power_inside_error_lower(:) => null() !Lower error for "total_ion_power_inside" + integer(ids_int) :: total_ion_power_inside_error_index=ids_int_invalid !Index in the error_description list for "total_ion_power_inside" + real(ids_real), pointer :: momentum_tor(:) => null() !Source term for total toroidal momentum equation + real(ids_real), pointer :: momentum_tor_error_upper(:) => null() !Upper error for "momentum_tor" + real(ids_real), pointer :: momentum_tor_error_lower(:) => null() !Lower error for "momentum_tor" + integer(ids_int) :: momentum_tor_error_index=ids_int_invalid !Index in the error_description list for "momentum_tor" + real(ids_real), pointer :: torque_tor_inside(:) => null() !Toroidal torque inside the flux surface. Cumulative volume integral of the source term for the total toroidal momentum equation + real(ids_real), pointer :: torque_tor_inside_error_upper(:) => null() !Upper error for "torque_tor_inside" + real(ids_real), pointer :: torque_tor_inside_error_lower(:) => null() !Lower error for "torque_tor_inside" + integer(ids_int) :: torque_tor_inside_error_index=ids_int_invalid !Index in the error_description list for "torque_tor_inside" + real(ids_real), pointer :: momentum_tor_j_cross_b_field(:) => null() !Contribution to the toroidal momentum source term (already included in the momentum_tor node) corresponding to the toroidal torque! + !s onto the thermal plasma due to Lorentz force associated with radial currents. These currents appear as return-currents (enforcin! + !g quasi-neutrality, div(J)=0) balancing radial currents of non-thermal particles, e.g. radial currents of fast and trapped neutral! + !-beam-ions. + real(ids_real), pointer :: momentum_tor_j_cross_b_field_error_upper(:) => null() !Upper error for "momentum_tor_j_cross_b_field" + real(ids_real), pointer :: momentum_tor_j_cross_b_field_error_lower(:) => null() !Lower error for "momentum_tor_j_cross_b_field" + integer(ids_int) :: momentum_tor_j_cross_b_field_error_index=ids_int_invalid !Index in the error_description list for "momentum_tor_j_cross_b_field" + real(ids_real), pointer :: j_parallel(:) => null() !Parallel current density source, average(J.B) / B0, where B0 = core_sources/vacuum_toroidal_field/b0 + real(ids_real), pointer :: j_parallel_error_upper(:) => null() !Upper error for "j_parallel" + real(ids_real), pointer :: j_parallel_error_lower(:) => null() !Lower error for "j_parallel" + integer(ids_int) :: j_parallel_error_index=ids_int_invalid !Index in the error_description list for "j_parallel" + real(ids_real), pointer :: current_parallel_inside(:) => null() !Parallel current driven inside the flux surface. Cumulative surface integral of j_parallel + real(ids_real), pointer :: current_parallel_inside_error_upper(:) => null() !Upper error for "current_parallel_inside" + real(ids_real), pointer :: current_parallel_inside_error_lower(:) => null() !Lower error for "current_parallel_inside" + integer(ids_int) :: current_parallel_inside_error_index=ids_int_invalid !Index in the error_description list for "current_parallel_inside" + real(ids_real), pointer :: conductivity_parallel(:) => null() !Parallel conductivity due to this source + real(ids_real), pointer :: conductivity_parallel_error_upper(:) => null() !Upper error for "conductivity_parallel" + real(ids_real), pointer :: conductivity_parallel_error_lower(:) => null() !Lower error for "conductivity_parallel" + integer(ids_int) :: conductivity_parallel_error_index=ids_int_invalid !Index in the error_description list for "conductivity_parallel" + type(ids_core_sources_source_profiles_1d_ions), pointer :: ion(:) => null() !Source terms related to the different ions species, in the sense of isonuclear or isomolecular sequences. Ionisation states (and o! + !ther types of states) must be differentiated at the state level below + type(ids_core_sources_source_profiles_1d_neutral), pointer :: neutral(:) => null() !Source terms related to the different neutral species + real(ids_real) :: time=ids_real_invalid !Time + end type + + type :: ids_core_sources_source + type(ids_identifier) :: identifier !Source term identifier (process causing this source term) + type(ids_distribution_species) :: species !Species causing this source term (if relevant, e.g. a particular ion or neutral state in case of line radiation) + type(ids_core_sources_source_global), pointer :: global_quantities(:) => null() !Total source quantities integrated over the plasma volume or surface + type(ids_core_sources_source_profiles_1d), pointer :: profiles_1d(:) => null() !Source profiles for various time slices. Source terms are positive (resp. negative) when there is a gain (resp. a loss) to the con! + !sidered channel. + end type + + + ! *********** core_sources IDS + type, extends(IDS_base) :: ids_core_sources !Core plasma thermal source terms (for the transport equations of the thermal species). Energy terms correspond to the full kinetic! + ! energy equation (i.e. the energy flux takes into account the energy transported by the particle flux) + logical, private :: c_data = .FALSE. ! Fortran specific metadata telling whether the IDS has been populated from C allocated data (LL) or not + integer, private :: max_occurrence = 15! Maximum occurrence allowed as defined in the DD + + type(ids_ids_properties) :: ids_properties !Interface Data Structure properties. This element identifies the node above as an IDS + type(ids_b_tor_vacuum_1) :: vacuum_toroidal_field !Characteristics of the vacuum toroidal field (used in Rho_Tor definition and in the normalization of current densities) + type(ids_core_sources_source), pointer :: source(:) => null() !Set of source terms + type(ids_code) :: code !Generic decription of the code-specific parameters for the code that has produced this IDS + real(ids_real), pointer :: time(:) => null() !Generic time + end type + + ! *********** core_transport IDS internal structures declaration + + type :: ids_core_transport_model_2_density + real(ids_real), pointer :: d(:) => null() !Effective diffusivity + real(ids_real), pointer :: d_error_upper(:) => null() !Upper error for "d" + real(ids_real), pointer :: d_error_lower(:) => null() !Lower error for "d" + integer(ids_int) :: d_error_index=ids_int_invalid !Index in the error_description list for "d" + real(ids_real), pointer :: v(:) => null() !Effective convection + real(ids_real), pointer :: v_error_upper(:) => null() !Upper error for "v" + real(ids_real), pointer :: v_error_lower(:) => null() !Lower error for "v" + integer(ids_int) :: v_error_index=ids_int_invalid !Index in the error_description list for "v" + real(ids_real), pointer :: flux(:) => null() !Flux + real(ids_real), pointer :: flux_error_upper(:) => null() !Upper error for "flux" + real(ids_real), pointer :: flux_error_lower(:) => null() !Lower error for "flux" + integer(ids_int) :: flux_error_index=ids_int_invalid !Index in the error_description list for "flux" + end type + + type :: ids_core_transport_model_2_energy + real(ids_real), pointer :: d(:) => null() !Effective diffusivity + real(ids_real), pointer :: d_error_upper(:) => null() !Upper error for "d" + real(ids_real), pointer :: d_error_lower(:) => null() !Lower error for "d" + integer(ids_int) :: d_error_index=ids_int_invalid !Index in the error_description list for "d" + real(ids_real), pointer :: v(:) => null() !Effective convection + real(ids_real), pointer :: v_error_upper(:) => null() !Upper error for "v" + real(ids_real), pointer :: v_error_lower(:) => null() !Lower error for "v" + integer(ids_int) :: v_error_index=ids_int_invalid !Index in the error_description list for "v" + real(ids_real), pointer :: flux(:) => null() !Flux + real(ids_real), pointer :: flux_error_upper(:) => null() !Upper error for "flux" + real(ids_real), pointer :: flux_error_lower(:) => null() !Lower error for "flux" + integer(ids_int) :: flux_error_index=ids_int_invalid !Index in the error_description list for "flux" + end type + + type :: ids_core_transport_model_electrons + type(ids_core_transport_model_2_density) :: particles !Transport quantities for the electron density equation + type(ids_core_transport_model_2_energy) :: energy !Transport quantities for the electron energy equation + end type + + type :: ids_core_transport_model_1_energy + real(ids_real), pointer :: d(:) => null() !Effective diffusivity + real(ids_real), pointer :: d_error_upper(:) => null() !Upper error for "d" + real(ids_real), pointer :: d_error_lower(:) => null() !Lower error for "d" + integer(ids_int) :: d_error_index=ids_int_invalid !Index in the error_description list for "d" + real(ids_real), pointer :: v(:) => null() !Effective convection + real(ids_real), pointer :: v_error_upper(:) => null() !Upper error for "v" + real(ids_real), pointer :: v_error_lower(:) => null() !Lower error for "v" + integer(ids_int) :: v_error_index=ids_int_invalid !Index in the error_description list for "v" + real(ids_real), pointer :: flux(:) => null() !Flux + real(ids_real), pointer :: flux_error_upper(:) => null() !Upper error for "flux" + real(ids_real), pointer :: flux_error_lower(:) => null() !Lower error for "flux" + integer(ids_int) :: flux_error_index=ids_int_invalid !Index in the error_description list for "flux" + end type + + type :: ids_core_transport_model_1_momentum + real(ids_real), pointer :: d(:) => null() !Effective diffusivity + real(ids_real), pointer :: d_error_upper(:) => null() !Upper error for "d" + real(ids_real), pointer :: d_error_lower(:) => null() !Lower error for "d" + integer(ids_int) :: d_error_index=ids_int_invalid !Index in the error_description list for "d" + real(ids_real), pointer :: v(:) => null() !Effective convection + real(ids_real), pointer :: v_error_upper(:) => null() !Upper error for "v" + real(ids_real), pointer :: v_error_lower(:) => null() !Lower error for "v" + integer(ids_int) :: v_error_index=ids_int_invalid !Index in the error_description list for "v" + real(ids_real), pointer :: flux(:) => null() !Flux + real(ids_real), pointer :: flux_error_upper(:) => null() !Upper error for "flux" + real(ids_real), pointer :: flux_error_lower(:) => null() !Lower error for "flux" + integer(ids_int) :: flux_error_index=ids_int_invalid !Index in the error_description list for "flux" + end type + + type :: ids_core_transport_model_3_momentum + real(ids_real), pointer :: d(:) => null() !Effective diffusivity + real(ids_real), pointer :: d_error_upper(:) => null() !Upper error for "d" + real(ids_real), pointer :: d_error_lower(:) => null() !Lower error for "d" + integer(ids_int) :: d_error_index=ids_int_invalid !Index in the error_description list for "d" + real(ids_real), pointer :: v(:) => null() !Effective convection + real(ids_real), pointer :: v_error_upper(:) => null() !Upper error for "v" + real(ids_real), pointer :: v_error_lower(:) => null() !Lower error for "v" + integer(ids_int) :: v_error_index=ids_int_invalid !Index in the error_description list for "v" + real(ids_real), pointer :: flux(:) => null() !Flux + real(ids_real), pointer :: flux_error_upper(:) => null() !Upper error for "flux" + real(ids_real), pointer :: flux_error_lower(:) => null() !Lower error for "flux" + integer(ids_int) :: flux_error_index=ids_int_invalid !Index in the error_description list for "flux" + real(ids_real), pointer :: flow_damping_rate(:) => null() !Damping rate for this flow component (e.g. due to collisions, calculated from a neoclassical model) + real(ids_real), pointer :: flow_damping_rate_error_upper(:) => null() !Upper error for "flow_damping_rate" + real(ids_real), pointer :: flow_damping_rate_error_lower(:) => null() !Lower error for "flow_damping_rate" + integer(ids_int) :: flow_damping_rate_error_index=ids_int_invalid !Index in the error_description list for "flow_damping_rate" + end type + + type :: ids_core_transport_model_components_3_momentum + type(ids_core_transport_model_3_momentum) :: radial !Radial component + type(ids_core_transport_model_3_momentum) :: diamagnetic !Diamagnetic component + type(ids_core_transport_model_3_momentum) :: parallel !Parallel component + type(ids_core_transport_model_3_momentum) :: poloidal !Poloidal component + type(ids_core_transport_model_3_momentum) :: toroidal !Toroidal component + end type + + type :: ids_core_transport_model_3_density + real(ids_real), pointer :: d(:) => null() !Effective diffusivity + real(ids_real), pointer :: d_error_upper(:) => null() !Upper error for "d" + real(ids_real), pointer :: d_error_lower(:) => null() !Lower error for "d" + integer(ids_int) :: d_error_index=ids_int_invalid !Index in the error_description list for "d" + real(ids_real), pointer :: v(:) => null() !Effective convection + real(ids_real), pointer :: v_error_upper(:) => null() !Upper error for "v" + real(ids_real), pointer :: v_error_lower(:) => null() !Lower error for "v" + integer(ids_int) :: v_error_index=ids_int_invalid !Index in the error_description list for "v" + real(ids_real), pointer :: flux(:) => null() !Flux + real(ids_real), pointer :: flux_error_upper(:) => null() !Upper error for "flux" + real(ids_real), pointer :: flux_error_lower(:) => null() !Lower error for "flux" + integer(ids_int) :: flux_error_index=ids_int_invalid !Index in the error_description list for "flux" + end type + + type :: ids_core_transport_model_3_energy + real(ids_real), pointer :: d(:) => null() !Effective diffusivity + real(ids_real), pointer :: d_error_upper(:) => null() !Upper error for "d" + real(ids_real), pointer :: d_error_lower(:) => null() !Lower error for "d" + integer(ids_int) :: d_error_index=ids_int_invalid !Index in the error_description list for "d" + real(ids_real), pointer :: v(:) => null() !Effective convection + real(ids_real), pointer :: v_error_upper(:) => null() !Upper error for "v" + real(ids_real), pointer :: v_error_lower(:) => null() !Lower error for "v" + integer(ids_int) :: v_error_index=ids_int_invalid !Index in the error_description list for "v" + real(ids_real), pointer :: flux(:) => null() !Flux + real(ids_real), pointer :: flux_error_upper(:) => null() !Upper error for "flux" + real(ids_real), pointer :: flux_error_lower(:) => null() !Lower error for "flux" + integer(ids_int) :: flux_error_index=ids_int_invalid !Index in the error_description list for "flux" + end type + + type :: ids_core_transport_model_4_momentum + real(ids_real), pointer :: d(:) => null() !Effective diffusivity + real(ids_real), pointer :: d_error_upper(:) => null() !Upper error for "d" + real(ids_real), pointer :: d_error_lower(:) => null() !Lower error for "d" + integer(ids_int) :: d_error_index=ids_int_invalid !Index in the error_description list for "d" + real(ids_real), pointer :: v(:) => null() !Effective convection + real(ids_real), pointer :: v_error_upper(:) => null() !Upper error for "v" + real(ids_real), pointer :: v_error_lower(:) => null() !Lower error for "v" + integer(ids_int) :: v_error_index=ids_int_invalid !Index in the error_description list for "v" + real(ids_real), pointer :: flux(:) => null() !Flux + real(ids_real), pointer :: flux_error_upper(:) => null() !Upper error for "flux" + real(ids_real), pointer :: flux_error_lower(:) => null() !Lower error for "flux" + integer(ids_int) :: flux_error_index=ids_int_invalid !Index in the error_description list for "flux" + real(ids_real), pointer :: flow_damping_rate(:) => null() !Damping rate for this flow component (e.g. due to collisions, calculated from a neoclassical model) + real(ids_real), pointer :: flow_damping_rate_error_upper(:) => null() !Upper error for "flow_damping_rate" + real(ids_real), pointer :: flow_damping_rate_error_lower(:) => null() !Lower error for "flow_damping_rate" + integer(ids_int) :: flow_damping_rate_error_index=ids_int_invalid !Index in the error_description list for "flow_damping_rate" + end type + + type :: ids_core_transport_model_components_4_momentum + type(ids_core_transport_model_4_momentum) :: radial !Radial component + type(ids_core_transport_model_4_momentum) :: diamagnetic !Diamagnetic component + type(ids_core_transport_model_4_momentum) :: parallel !Parallel component + type(ids_core_transport_model_4_momentum) :: poloidal !Poloidal component + type(ids_core_transport_model_4_momentum) :: toroidal !Toroidal component + end type + + type :: ids_core_transport_model_ions_charge_states + real(ids_real) :: z_min=ids_real_invalid !Minimum Z of the charge state bundle + real(ids_real) :: z_min_error_upper=ids_real_invalid !Upper error for "z_min" + real(ids_real) :: z_min_error_lower=ids_real_invalid !Lower error for "z_min" + integer(ids_int) :: z_min_error_index=ids_int_invalid !Index in the error_description list for "z_min" + real(ids_real) :: z_max=ids_real_invalid !Maximum Z of the charge state bundle + real(ids_real) :: z_max_error_upper=ids_real_invalid !Upper error for "z_max" + real(ids_real) :: z_max_error_lower=ids_real_invalid !Lower error for "z_max" + integer(ids_int) :: z_max_error_index=ids_int_invalid !Index in the error_description list for "z_max" + character(len=ids_string_length), dimension(:), pointer :: label => null() !String identifying charge state (e.g. C+, C+2 , C+3, C+4, C+5, C+6, ...) + real(ids_real) :: vibrational_level=ids_real_invalid !Vibrational level (can be bundled) + real(ids_real) :: vibrational_level_error_upper=ids_real_invalid !Upper error for "vibrational_level" + real(ids_real) :: vibrational_level_error_lower=ids_real_invalid !Lower error for "vibrational_level" + integer(ids_int) :: vibrational_level_error_index=ids_int_invalid !Index in the error_description list for "vibrational_level" + character(len=ids_string_length), dimension(:), pointer :: vibrational_mode => null() !Vibrational mode of this state, e.g. "A_g". Need to define, or adopt a standard nomenclature. + integer(ids_int) :: is_neutral=ids_int_invalid !Flag specifying if this state corresponds to a neutral (1) or not (0) + type(ids_identifier_dynamic_aos3) :: neutral_type !Neutral type (if the considered state is a neutral), in terms of energy. ID =1: cold; 2: thermal; 3: fast; 4: NBI + character(len=ids_string_length), dimension(:), pointer :: electron_configuration => null() !Configuration of atomic orbitals of this state, e.g. 1s2-2s1 + type(ids_core_transport_model_3_density) :: particles !Transport quantities related to density equation of the charge state considered (thermal+non-thermal) + type(ids_core_transport_model_3_energy) :: energy !Transport quantities related to the energy equation of the charge state considered + type(ids_core_transport_model_components_4_momentum) :: momentum !Transport coefficients related to the state momentum equations for various components (directions) + end type + + type :: ids_core_transport_model_ions + type(ids_plasma_composition_neutral_element), pointer :: element(:) => null() !List of elements forming the atom or molecule + real(ids_real) :: z_ion=ids_real_invalid !Ion charge (of the dominant ionisation state; lumped ions are allowed) + real(ids_real) :: z_ion_error_upper=ids_real_invalid !Upper error for "z_ion" + real(ids_real) :: z_ion_error_lower=ids_real_invalid !Lower error for "z_ion" + integer(ids_int) :: z_ion_error_index=ids_int_invalid !Index in the error_description list for "z_ion" + character(len=ids_string_length), dimension(:), pointer :: label => null() !String identifying ion (e.g. H, D, T, He, C, D2, ...) + integer(ids_int) :: neutral_index=ids_int_invalid !Index of the corresponding neutral species in the ../../neutral array + type(ids_core_transport_model_2_density) :: particles !Transport related to the ion density equation + type(ids_core_transport_model_2_energy) :: energy !Transport coefficients related to the ion energy equation + type(ids_core_transport_model_components_3_momentum) :: momentum !Transport coefficients related to the ion momentum equations for various components (directions) + integer(ids_int) :: multiple_states_flag=ids_int_invalid !Multiple states calculation flag : 0-Only the 'ion' level is considered and the 'state' array of structure is empty; 1-Ion states ! + !are considered and are described in the 'state' array of structure + type(ids_core_transport_model_ions_charge_states), pointer :: state(:) => null() !Transport coefficients related to the different states of the species + end type + + type :: ids_core_transport_model_neutral_state + character(len=ids_string_length), dimension(:), pointer :: label => null() !String identifying state + real(ids_real) :: vibrational_level=ids_real_invalid !Vibrational level (can be bundled) + real(ids_real) :: vibrational_level_error_upper=ids_real_invalid !Upper error for "vibrational_level" + real(ids_real) :: vibrational_level_error_lower=ids_real_invalid !Lower error for "vibrational_level" + integer(ids_int) :: vibrational_level_error_index=ids_int_invalid !Index in the error_description list for "vibrational_level" + character(len=ids_string_length), dimension(:), pointer :: vibrational_mode => null() !Vibrational mode of this state, e.g. "A_g". Need to define, or adopt a standard nomenclature. + character(len=ids_string_length), dimension(:), pointer :: electron_configuration => null() !Configuration of atomic orbitals of this state, e.g. 1s2-2s1 + type(ids_core_transport_model_3_density) :: particles !Transport quantities related to density equation of the charge state considered (thermal+non-thermal) + type(ids_core_transport_model_3_energy) :: energy !Transport quantities related to the energy equation of the charge state considered + end type + + type :: ids_core_transport_model_neutral + type(ids_plasma_composition_neutral_element), pointer :: element(:) => null() !List of elements forming the atom or molecule + character(len=ids_string_length), dimension(:), pointer :: label => null() !String identifying ion (e.g. H+, D+, T+, He+2, C+, ...) + integer(ids_int) :: ion_index=ids_int_invalid !Index of the corresponding ion species in the ../../ion array + type(ids_core_transport_model_2_density) :: particles !Transport related to the neutral density equation + type(ids_core_transport_model_2_energy) :: energy !Transport coefficients related to the neutral energy equation + integer(ids_int) :: multiple_states_flag=ids_int_invalid !Multiple states calculation flag : 0-Only one state is considered; 1-Multiple states are considered and are described in the state! + ! structure + type(ids_core_transport_model_neutral_state), pointer :: state(:) => null() !Transport coefficients related to the different states of the species + end type + + type :: ids_core_transport_model_profiles_1d + type(ids_core_radial_grid) :: grid_d !Grid for effective diffusivities and parallel conductivity + type(ids_core_radial_grid) :: grid_v !Grid for effective convections + type(ids_core_radial_grid) :: grid_flux !Grid for fluxes + real(ids_real), pointer :: conductivity_parallel(:) => null() !Parallel conductivity + real(ids_real), pointer :: conductivity_parallel_error_upper(:) => null() !Upper error for "conductivity_parallel" + real(ids_real), pointer :: conductivity_parallel_error_lower(:) => null() !Lower error for "conductivity_parallel" + integer(ids_int) :: conductivity_parallel_error_index=ids_int_invalid !Index in the error_description list for "conductivity_parallel" + type(ids_core_transport_model_electrons) :: electrons !Transport quantities related to the electrons + type(ids_core_transport_model_1_energy) :: total_ion_energy !Transport coefficients for the total (summed over ion species) energy equation + type(ids_core_transport_model_1_momentum) :: momentum_tor !Transport coefficients for total toroidal momentum equation + real(ids_real), pointer :: e_field_radial(:) => null() !Radial component of the electric field (calculated e.g. by a neoclassical model) + real(ids_real), pointer :: e_field_radial_error_upper(:) => null() !Upper error for "e_field_radial" + real(ids_real), pointer :: e_field_radial_error_lower(:) => null() !Lower error for "e_field_radial" + integer(ids_int) :: e_field_radial_error_index=ids_int_invalid !Index in the error_description list for "e_field_radial" + type(ids_core_transport_model_ions), pointer :: ion(:) => null() !Transport coefficients related to the various ion species, in the sense of isonuclear or isomolecular sequences. Ionisation states! + ! (and other types of states) must be differentiated at the state level below + type(ids_core_transport_model_neutral), pointer :: neutral(:) => null() !Transport coefficients related to the various neutral species + real(ids_real) :: time=ids_real_invalid !Time + end type + + type :: ids_core_transport_model + character(len=ids_string_length), dimension(:), pointer :: comment => null() !Any comment describing the model + type(ids_identifier) :: identifier !Transport model identifier + real(ids_real) :: flux_multiplier=ids_real_invalid !Multiplier applied to the particule flux when adding its contribution in the expression of the heat flux : can be 0, 3/2 or 5/2 + real(ids_real) :: flux_multiplier_error_upper=ids_real_invalid !Upper error for "flux_multiplier" + real(ids_real) :: flux_multiplier_error_lower=ids_real_invalid !Lower error for "flux_multiplier" + integer(ids_int) :: flux_multiplier_error_index=ids_int_invalid !Index in the error_description list for "flux_multiplier" + type(ids_core_transport_model_profiles_1d), pointer :: profiles_1d(:) => null() !Transport coefficient profiles for various time slices. Fluxes and convection are positive (resp. negative) when outwards i.e. tow! + !ards the LCFS (resp. inwards i.e. towards the magnetic axes). + type(ids_code_with_timebase) :: code !Code-specific parameters used for this model + end type + + + ! *********** core_transport IDS + type, extends(IDS_base) :: ids_core_transport !Core plasma transport of particles, energy, momentum and poloidal flux. The transport of particles, energy and momentum is describ! + !ed by diffusion coefficients, D, and convection velocities, v. These are defined by the total fluxes of particles, energy and mome! + !ntum, across a flux surface given by : V' [-D Y' <|grad(rho_tor_norm)|^2gt; + v Y <|grad(rho_tor_norm)|>], where Y represents the ! + !particles, energy and momentum density, respectively, while V is the volume inside a flux surface, the primes denote derivatives w! + !ith respect to rho_tor_norm and < X > is the flux surface average of a quantity X. This formulation remains valid when changing si! + !multaneously rho_tor_norm into rho_tor in the gradient terms and in the derivatives denoted by the prime. The average flux stored ! + !in the IDS as sibling of D and v is the total flux described above divided by the flux surface area V' <|grad(rho_tor_norm)|>. Not! + !e that the energy flux includes the energy transported by the particle flux. + logical, private :: c_data = .FALSE. ! Fortran specific metadata telling whether the IDS has been populated from C allocated data (LL) or not + integer, private :: max_occurrence = 10! Maximum occurrence allowed as defined in the DD + + type(ids_ids_properties) :: ids_properties !Interface Data Structure properties. This element identifies the node above as an IDS + type(ids_b_tor_vacuum_1) :: vacuum_toroidal_field !Characteristics of the vacuum toroidal field (used in Rho_Tor definition and in the normalization of current densities) + type(ids_core_transport_model), pointer :: model(:) => null() !Transport is described by a combination of various transport models + type(ids_code) :: code !Generic decription of the code-specific parameters for the code that has produced this IDS + real(ids_real), pointer :: time(:) => null() !Generic time + end type + + ! *********** cryostat IDS internal structures declaration + + type :: ids_cryostat_2d + type(ids_vessel_2d) :: cryostat !Mechanical structure of the cryostat. It is described as a set of nested layers with given physics properties; Two representations! + ! are admitted for each vessel unit : annular (two contours) or block elements. + type(ids_vessel_2d) :: thermal_shield !Mechanical structure of the cryostat thermal shield. It is described as a set of nested layers with given physics properties; Two ! + !representations are admitted for each vessel unit : annular (two contours) or block elements. + end type + + + ! *********** cryostat IDS + type, extends(IDS_base) :: ids_cryostat !Description of the cryostat surrounding the machine (if any) + logical, private :: c_data = .FALSE. ! Fortran specific metadata telling whether the IDS has been populated from C allocated data (LL) or not + integer, private :: max_occurrence = 1! Maximum occurrence allowed as defined in the DD + + type(ids_ids_properties) :: ids_properties !Interface Data Structure properties. This element identifies the node above as an IDS + type(ids_cryostat_2d), pointer :: description_2d(:) => null() !Set of 2D cryostat descriptions, for each type of possible physics or engineering configurations necessary + type(ids_code) :: code !Generic decription of the code-specific parameters for the code that has produced this IDS + real(ids_real), pointer :: time(:) => null() !Generic time + end type + + ! *********** dataset_description IDS internal structures declaration + + type :: ids_dataset_description_epoch_time + integer(ids_int) :: seconds=ids_int_invalid !Elapsed seconds since the Unix Epoch time (01/01/1970 00:00:00 UTC) + integer(ids_int) :: nanoseconds=ids_int_invalid !Elapsed nanoseconds since the time in seconds indicated above + end type + + type :: ids_dataset_description_simulation + character(len=ids_string_length), dimension(:), pointer :: comment_before => null() !Comment made when launching a simulation + character(len=ids_string_length), dimension(:), pointer :: comment_after => null() !Comment made at the end of a simulation + real(ids_real) :: time_begin=ids_real_invalid !Start time + real(ids_real) :: time_begin_error_upper=ids_real_invalid !Upper error for "time_begin" + real(ids_real) :: time_begin_error_lower=ids_real_invalid !Lower error for "time_begin" + integer(ids_int) :: time_begin_error_index=ids_int_invalid !Index in the error_description list for "time_begin" + real(ids_real) :: time_step=ids_real_invalid !Time interval between main steps, e.g. storage step (if relevant and constant) + real(ids_real) :: time_step_error_upper=ids_real_invalid !Upper error for "time_step" + real(ids_real) :: time_step_error_lower=ids_real_invalid !Lower error for "time_step" + integer(ids_int) :: time_step_error_index=ids_int_invalid !Index in the error_description list for "time_step" + real(ids_real) :: time_end=ids_real_invalid !Stop time + real(ids_real) :: time_end_error_upper=ids_real_invalid !Upper error for "time_end" + real(ids_real) :: time_end_error_lower=ids_real_invalid !Lower error for "time_end" + integer(ids_int) :: time_end_error_index=ids_int_invalid !Index in the error_description list for "time_end" + real(ids_real) :: time_restart=ids_real_invalid !Time of the last restart done during the simulation + real(ids_real) :: time_restart_error_upper=ids_real_invalid !Upper error for "time_restart" + real(ids_real) :: time_restart_error_lower=ids_real_invalid !Lower error for "time_restart" + integer(ids_int) :: time_restart_error_index=ids_int_invalid !Index in the error_description list for "time_restart" + real(ids_real) :: time_current=ids_real_invalid !Current time of the simulation + real(ids_real) :: time_current_error_upper=ids_real_invalid !Upper error for "time_current" + real(ids_real) :: time_current_error_lower=ids_real_invalid !Lower error for "time_current" + integer(ids_int) :: time_current_error_index=ids_int_invalid !Index in the error_description list for "time_current" + character(len=ids_string_length), dimension(:), pointer :: time_begun => null() !Actual wall-clock time simulation started + character(len=ids_string_length), dimension(:), pointer :: time_ended => null() !Actual wall-clock time simulation finished + character(len=ids_string_length), dimension(:), pointer :: workflow => null() !Description of the workflow which has been used to produce this data entry (e.g. copy of the Kepler MOML if using Kepler) + end type + + + ! *********** dataset_description IDS + type, extends(IDS_base) :: ids_dataset_description !General description of the dataset (collection of all IDSs within the given database entry). Main description text to be put in id! + !s_properties/comment + logical, private :: c_data = .FALSE. ! Fortran specific metadata telling whether the IDS has been populated from C allocated data (LL) or not + integer, private :: max_occurrence = 1! Maximum occurrence allowed as defined in the DD + + type(ids_ids_properties) :: ids_properties !Interface Data Structure properties. This element identifies the node above as an IDS + type(ids_data_entry) :: data_entry !Definition of this data entry + type(ids_data_entry) :: parent_entry !Definition of the parent data entry, if the present data entry has been generated by applying a given workflow to a unique parent ! + !entry + character(len=ids_string_length), dimension(:), pointer :: pulse_time_begin => null() !Date and time (UTC) at which the pulse started on the experiment, expressed in a human readable form (ISO 8601) : the format of th! + !e string shall be : YYYY-MM-DDTHH:MM:SSZ. Example : 2020-07-24T14:19:00Z + type(ids_dataset_description_epoch_time) :: pulse_time_begin_epoch !Time at which the pulse started on the experiment, expressed in Unix Epoch time. Temporarily represented as two integers, since fo! + !r the moment IMAS is missing 64bits long integers to represent epoch time with nanoseconds resolution + type(ids_dataset_description_epoch_time) :: pulse_time_end_epoch !Time at which the pulse ended on the experiment, expressed in Unix Epoch time. Temporarily represented as two integers, since for ! + !the moment IMAS is missing 64bits long integers to represent epoch time with nanoseconds resolution + character(len=ids_string_length), dimension(:), pointer :: imas_version => null() !Version of the IMAS infrastructure used to produce this data entry. Refers to the global IMAS repository which links to versions o! + !f every infrastructure tools + character(len=ids_string_length), dimension(:), pointer :: dd_version => null() !Version of the physics data dictionary of this dataset + type(ids_dataset_description_simulation) :: simulation !Description of the general simulation characteristics, if this data entry has been produced by a simulation. Several nodes describ! + !e typical time-dependent simulation with a time evolution as the main loop + real(ids_real), pointer :: time(:) => null() !Generic time + end type + + ! *********** dataset_fair IDS internal structures declaration + + + ! *********** dataset_fair IDS + type, extends(IDS_base) :: ids_dataset_fair !FAIR metadata related to the dataset, providing inforrmation on licensing, annotations, references using this dataset, versioning ! + !and validity, provenance. This IDS is using Dublin Core metadata standard whenever possible + logical, private :: c_data = .FALSE. ! Fortran specific metadata telling whether the IDS has been populated from C allocated data (LL) or not + integer, private :: max_occurrence = 1! Maximum occurrence allowed as defined in the DD + + type(ids_ids_properties) :: ids_properties !Interface Data Structure properties. This element identifies the node above as an IDS + character(len=ids_string_length), dimension(:), pointer :: identifier => null() !Persistent identifier allowing to cite this data in a public and persistent way, should be provided as HTTP URIs + character(len=ids_string_length), dimension(:), pointer :: replaces => null() !Persistent identifier referencing the previous version of this data + character(len=ids_string_length), dimension(:), pointer :: is_replaced_by => null() !Persistent identifier referencing the new version of this data (replacing the present version) + character(len=ids_string_length), dimension(:), pointer :: valid => null() !Date range during which the data is or was valid. Expressed as YYYY-MM-DD/YYYY-MM-DD, where the former (resp. latter) date is the ! + !data at which the data started (resp. ceased) to be valid. If the data is still valid, the slash should still be present, i.e. ind! + !icate the validity start date with YYYY-MM-DD/. If the data ceased being valid but there is no information on the validity start d! + !ate, indicate /YYYY-MM-DD. + character(len=ids_string_length), dimension(:), pointer :: rights_holder => null() !The organisation owning or managing rights over this data + character(len=ids_string_length), dimension(:), pointer :: license => null() !License(s) under which the data is made available (license description or, more convenient, publicly accessible URL pointing to th! + !e full license text) + character(len=ids_string_length), dimension(:), pointer :: is_referenced_by => null() !List of documents (e.g. publications) or datasets making use of this data entry (e.g. PIDs of other datasets using this data entry! + ! as input) + real(ids_real), pointer :: time(:) => null() !Generic time + end type + + ! *********** disruption IDS internal structures declaration + + type :: ids_disruption_global_quantities + real(ids_real), pointer :: current_halo_pol(:) => null() !Poloidal halo current + real(ids_real), pointer :: current_halo_pol_error_upper(:) => null() !Upper error for "current_halo_pol" + real(ids_real), pointer :: current_halo_pol_error_lower(:) => null() !Lower error for "current_halo_pol" + integer(ids_int) :: current_halo_pol_error_index=ids_int_invalid !Index in the error_description list for "current_halo_pol" + real(ids_real), pointer :: current_halo_tor(:) => null() !Toroidal halo current + real(ids_real), pointer :: current_halo_tor_error_upper(:) => null() !Upper error for "current_halo_tor" + real(ids_real), pointer :: current_halo_tor_error_lower(:) => null() !Lower error for "current_halo_tor" + integer(ids_int) :: current_halo_tor_error_index=ids_int_invalid !Index in the error_description list for "current_halo_tor" + real(ids_real), pointer :: power_ohm(:) => null() !Total ohmic power + real(ids_real), pointer :: power_ohm_error_upper(:) => null() !Upper error for "power_ohm" + real(ids_real), pointer :: power_ohm_error_lower(:) => null() !Lower error for "power_ohm" + integer(ids_int) :: power_ohm_error_index=ids_int_invalid !Index in the error_description list for "power_ohm" + real(ids_real), pointer :: power_ohm_halo(:) => null() !Ohmic power in the halo region + real(ids_real), pointer :: power_ohm_halo_error_upper(:) => null() !Upper error for "power_ohm_halo" + real(ids_real), pointer :: power_ohm_halo_error_lower(:) => null() !Lower error for "power_ohm_halo" + integer(ids_int) :: power_ohm_halo_error_index=ids_int_invalid !Index in the error_description list for "power_ohm_halo" + real(ids_real), pointer :: power_parallel_halo(:) => null() !Power of the parallel heat flux in the halo region + real(ids_real), pointer :: power_parallel_halo_error_upper(:) => null() !Upper error for "power_parallel_halo" + real(ids_real), pointer :: power_parallel_halo_error_lower(:) => null() !Lower error for "power_parallel_halo" + integer(ids_int) :: power_parallel_halo_error_index=ids_int_invalid !Index in the error_description list for "power_parallel_halo" + real(ids_real), pointer :: power_radiated_electrons_impurities(:) => null() !Total power radiated by electrons on impurities + real(ids_real), pointer :: power_radiated_electrons_impurities_error_upper(:) => null() !Upper error for "power_radiated_electrons_impurities" + real(ids_real), pointer :: power_radiated_electrons_impurities_error_lower(:) => null() !Lower error for "power_radiated_electrons_impurities" + integer(ids_int) :: power_radiated_electrons_impurities_error_index=ids_int_invalid !Index in the error_description list for "power_radiated_electrons_impurities" + real(ids_real), pointer :: power_radiated_electrons_impurities_halo(:) => null() !Power radiated by electrons on impurities in the halo region + real(ids_real), pointer :: power_radiated_electrons_impurities_halo_error_upper(:) => null() !Upper error for "power_radiated_electrons_impurities_halo" + real(ids_real), pointer :: power_radiated_electrons_impurities_halo_error_lower(:) => null() !Lower error for "power_radiated_electrons_impurities_halo" + integer(ids_int) :: power_radiated_electrons_impurities_halo_error_index=ids_int_invalid !Index in the error_description list for "power_radiated_electrons_impurities_halo" + real(ids_real), pointer :: energy_ohm(:) => null() !Total ohmic cumulated energy (integral of the power over the disruption duration) + real(ids_real), pointer :: energy_ohm_error_upper(:) => null() !Upper error for "energy_ohm" + real(ids_real), pointer :: energy_ohm_error_lower(:) => null() !Lower error for "energy_ohm" + integer(ids_int) :: energy_ohm_error_index=ids_int_invalid !Index in the error_description list for "energy_ohm" + real(ids_real), pointer :: energy_ohm_halo(:) => null() !Ohmic cumulated energy (integral of the power over the disruption duration) in the halo region + real(ids_real), pointer :: energy_ohm_halo_error_upper(:) => null() !Upper error for "energy_ohm_halo" + real(ids_real), pointer :: energy_ohm_halo_error_lower(:) => null() !Lower error for "energy_ohm_halo" + integer(ids_int) :: energy_ohm_halo_error_index=ids_int_invalid !Index in the error_description list for "energy_ohm_halo" + real(ids_real), pointer :: energy_parallel_halo(:) => null() !Cumulated parallel energy (integral of the heat flux parallel power over the disruption duration) in the halo region + real(ids_real), pointer :: energy_parallel_halo_error_upper(:) => null() !Upper error for "energy_parallel_halo" + real(ids_real), pointer :: energy_parallel_halo_error_lower(:) => null() !Lower error for "energy_parallel_halo" + integer(ids_int) :: energy_parallel_halo_error_index=ids_int_invalid !Index in the error_description list for "energy_parallel_halo" + real(ids_real), pointer :: energy_radiated_electrons_impurities(:) => null() !Total cumulated energy (integral of the power over the disruption duration) radiated by electrons on impurities + real(ids_real), pointer :: energy_radiated_electrons_impurities_error_upper(:) => null() !Upper error for "energy_radiated_electrons_impurities" + real(ids_real), pointer :: energy_radiated_electrons_impurities_error_lower(:) => null() !Lower error for "energy_radiated_electrons_impurities" + integer(ids_int) :: energy_radiated_electrons_impurities_error_index=ids_int_invalid !Index in the error_description list for "energy_radiated_electrons_impurities" + real(ids_real), pointer :: energy_radiated_electrons_impurities_halo(:) => null() !Cumulated energy (integral of the power over the disruption duration) radiated by electrons on impurities in the halo region + real(ids_real), pointer :: energy_radiated_electrons_impurities_halo_error_upper(:) => null() !Upper error for "energy_radiated_electrons_impurities_halo" + real(ids_real), pointer :: energy_radiated_electrons_impurities_halo_error_lower(:) => null() !Lower error for "energy_radiated_electrons_impurities_halo" + integer(ids_int) :: energy_radiated_electrons_impurities_halo_error_index=ids_int_invalid !Index in the error_description list for "energy_radiated_electrons_impurities_halo" + real(ids_real), pointer :: psi_halo_boundary(:) => null() !Poloidal flux at halo region boundary + real(ids_real), pointer :: psi_halo_boundary_error_upper(:) => null() !Upper error for "psi_halo_boundary" + real(ids_real), pointer :: psi_halo_boundary_error_lower(:) => null() !Lower error for "psi_halo_boundary" + integer(ids_int) :: psi_halo_boundary_error_index=ids_int_invalid !Index in the error_description list for "psi_halo_boundary" + end type + + type :: ids_disruption_halo_currents_area + type(ids_rz0d_dynamic_aos) :: start_point !Position of the start point of this area + type(ids_rz0d_dynamic_aos) :: end_point !Position of the end point of this area + real(ids_real) :: current_halo_pol=ids_real_invalid !Poloidal halo current crossing through this area + real(ids_real) :: current_halo_pol_error_upper=ids_real_invalid !Upper error for "current_halo_pol" + real(ids_real) :: current_halo_pol_error_lower=ids_real_invalid !Lower error for "current_halo_pol" + integer(ids_int) :: current_halo_pol_error_index=ids_int_invalid !Index in the error_description list for "current_halo_pol" + end type + + type :: ids_disruption_halo_currents + type(ids_disruption_halo_currents_area), pointer :: area(:) => null() !Set of wall areas through which there are halo currents + type(ids_rz0d_dynamic_aos) :: active_wall_point !R,Z position of the point of the plasma boundary in contact with the wall + real(ids_real) :: time=ids_real_invalid !Time + end type + + type :: ids_disruption_profiles_1d + type(ids_core_radial_grid) :: grid !Radial grid + real(ids_real), pointer :: j_runaways(:) => null() !Runaways parallel current density = average(j.B) / B0, where B0 = Disruption/Vacuum_Toroidal_Field/ B0 + real(ids_real), pointer :: j_runaways_error_upper(:) => null() !Upper error for "j_runaways" + real(ids_real), pointer :: j_runaways_error_lower(:) => null() !Lower error for "j_runaways" + integer(ids_int) :: j_runaways_error_index=ids_int_invalid !Index in the error_description list for "j_runaways" + real(ids_real), pointer :: power_density_conductive_losses(:) => null() !Power density of conductive losses to the wall (positive sign for losses) + real(ids_real), pointer :: power_density_conductive_losses_error_upper(:) => null() !Upper error for "power_density_conductive_losses" + real(ids_real), pointer :: power_density_conductive_losses_error_lower(:) => null() !Lower error for "power_density_conductive_losses" + integer(ids_int) :: power_density_conductive_losses_error_index=ids_int_invalid !Index in the error_description list for "power_density_conductive_losses" + real(ids_real), pointer :: power_density_radiative_losses(:) => null() !Power density of radiative losses (positive sign for losses) + real(ids_real), pointer :: power_density_radiative_losses_error_upper(:) => null() !Upper error for "power_density_radiative_losses" + real(ids_real), pointer :: power_density_radiative_losses_error_lower(:) => null() !Lower error for "power_density_radiative_losses" + integer(ids_int) :: power_density_radiative_losses_error_index=ids_int_invalid !Index in the error_description list for "power_density_radiative_losses" + real(ids_real) :: time=ids_real_invalid !Time + end type + + + ! *********** disruption IDS + type, extends(IDS_base) :: ids_disruption !Description of physics quantities of specific interest during a disruption, in particular halo currents, etc ... + logical, private :: c_data = .FALSE. ! Fortran specific metadata telling whether the IDS has been populated from C allocated data (LL) or not + integer, private :: max_occurrence = 1! Maximum occurrence allowed as defined in the DD + + type(ids_ids_properties) :: ids_properties !Interface Data Structure properties. This element identifies the node above as an IDS + type(ids_disruption_global_quantities) :: global_quantities !Global quantities + type(ids_disruption_halo_currents), pointer :: halo_currents(:) => null() !Halo currents geometry and values for a set of time slices + type(ids_disruption_profiles_1d), pointer :: profiles_1d(:) => null() !Radial profiles for a set of time slices + type(ids_b_tor_vacuum_1) :: vacuum_toroidal_field !Characteristics of the vacuum toroidal field (used in rho_tor definition and in the normalization of current densities) + type(ids_code) :: code !Generic decription of the code-specific parameters for the code that has produced this IDS + real(ids_real), pointer :: time(:) => null() !Generic time + end type + + ! *********** distribution_sources IDS internal structures declaration + + type :: ids_distribution_sources_source_global_shinethrough + real(ids_real) :: power=ids_real_invalid !Power losses due to shinethrough + real(ids_real) :: power_error_upper=ids_real_invalid !Upper error for "power" + real(ids_real) :: power_error_lower=ids_real_invalid !Lower error for "power" + integer(ids_int) :: power_error_index=ids_int_invalid !Index in the error_description list for "power" + real(ids_real) :: particles=ids_real_invalid !Particle losses due to shinethrough + real(ids_real) :: particles_error_upper=ids_real_invalid !Upper error for "particles" + real(ids_real) :: particles_error_lower=ids_real_invalid !Lower error for "particles" + integer(ids_int) :: particles_error_index=ids_int_invalid !Index in the error_description list for "particles" + real(ids_real) :: torque_tor=ids_real_invalid !Toroidal torque losses due to shinethrough + real(ids_real) :: torque_tor_error_upper=ids_real_invalid !Upper error for "torque_tor" + real(ids_real) :: torque_tor_error_lower=ids_real_invalid !Lower error for "torque_tor" + integer(ids_int) :: torque_tor_error_index=ids_int_invalid !Index in the error_description list for "torque_tor" + end type + + type :: ids_distribution_sources_source_global_quantities + real(ids_real) :: power=ids_real_invalid !Total power of the source + real(ids_real) :: power_error_upper=ids_real_invalid !Upper error for "power" + real(ids_real) :: power_error_lower=ids_real_invalid !Lower error for "power" + integer(ids_int) :: power_error_index=ids_int_invalid !Index in the error_description list for "power" + real(ids_real) :: torque_tor=ids_real_invalid !Total toroidal torque of the source + real(ids_real) :: torque_tor_error_upper=ids_real_invalid !Upper error for "torque_tor" + real(ids_real) :: torque_tor_error_lower=ids_real_invalid !Lower error for "torque_tor" + integer(ids_int) :: torque_tor_error_index=ids_int_invalid !Index in the error_description list for "torque_tor" + real(ids_real) :: particles=ids_real_invalid !Particle source rate + real(ids_real) :: particles_error_upper=ids_real_invalid !Upper error for "particles" + real(ids_real) :: particles_error_lower=ids_real_invalid !Lower error for "particles" + integer(ids_int) :: particles_error_index=ids_int_invalid !Index in the error_description list for "particles" + type(ids_distribution_sources_source_global_shinethrough) :: shinethrough !Shinethrough losses + real(ids_real) :: time=ids_real_invalid !Time + end type + + type :: ids_distribution_sources_source_profiles_1d + type(ids_core_radial_grid) :: grid !Radial grid + real(ids_real), pointer :: energy(:) => null() !Source term for the energy transport equation + real(ids_real), pointer :: energy_error_upper(:) => null() !Upper error for "energy" + real(ids_real), pointer :: energy_error_lower(:) => null() !Lower error for "energy" + integer(ids_int) :: energy_error_index=ids_int_invalid !Index in the error_description list for "energy" + real(ids_real), pointer :: momentum_tor(:) => null() !Source term for the toroidal momentum equation + real(ids_real), pointer :: momentum_tor_error_upper(:) => null() !Upper error for "momentum_tor" + real(ids_real), pointer :: momentum_tor_error_lower(:) => null() !Lower error for "momentum_tor" + integer(ids_int) :: momentum_tor_error_index=ids_int_invalid !Index in the error_description list for "momentum_tor" + real(ids_real), pointer :: particles(:) => null() !Source term for the density transport equation + real(ids_real), pointer :: particles_error_upper(:) => null() !Upper error for "particles" + real(ids_real), pointer :: particles_error_lower(:) => null() !Lower error for "particles" + integer(ids_int) :: particles_error_index=ids_int_invalid !Index in the error_description list for "particles" + real(ids_real) :: time=ids_real_invalid !Time + end type + + type :: ids_distribution_sources_source_ggd + type(ids_generic_grid_dynamic) :: grid !Grid description + type(ids_generic_grid_scalar), pointer :: particles(:) => null() !Source density of particles in phase space, for various grid subsets + integer(ids_int), pointer :: discrete(:) => null() !List of indices of grid spaces (refers to ../grid/space) for which the source is discretely distributed. For example consider a so! + !urce of 3.5 MeV alpha particles provided on a grid with two coordinates (spaces); rho_tor and energy. To specify that the source i! + !s given at energies exactly equal to 3.5 MeV, let discret have length 1 and set discrete(1)=2 since energy is dimension number 2. ! + !The source is then proportional to delta( 1 - energy / 3.5MeV ), where delta is the direct delta distribution. Discrete dimensions! + ! can only be used when the grid is rectangular. + real(ids_real) :: time=ids_real_invalid !Time + end type + + type :: ids_distribution_sources_source + type(ids_distribution_process_identifier), pointer :: process(:) => null() !Set of processes (NBI units, fusion reactions, ...) that provide the source. + integer(ids_int) :: gyro_type=ids_int_invalid !Defines how to interpret the spatial coordinates: 1 = given at the actual particle birth point; 2 =given at the gyro centre of the! + ! birth point + type(ids_distribution_species) :: species !Species injected or consumed by this source/sink + type(ids_distribution_sources_source_global_quantities), pointer :: global_quantities(:) => null() !Global quantities for various time slices + type(ids_distribution_sources_source_profiles_1d), pointer :: profiles_1d(:) => null() !Source radial profiles (flux surface averaged quantities) for various time slices + type(ids_distribution_sources_source_ggd), pointer :: ggd(:) => null() !Source terms in phase space (real space, velocity space, spin state), represented using the ggd, for various time slices + type(ids_distribution_markers), pointer :: markers(:) => null() !Source given as a group of markers (test particles) born per second, for various time slices + end type + + + ! *********** distribution_sources IDS + type, extends(IDS_base) :: ids_distribution_sources !Sources of particles for input to kinetic equations, e.g. Fokker-Planck calculation. The sources could originate from e.g. NBI or ! + !fusion reactions. + logical, private :: c_data = .FALSE. ! Fortran specific metadata telling whether the IDS has been populated from C allocated data (LL) or not + integer, private :: max_occurrence = 4! Maximum occurrence allowed as defined in the DD + + type(ids_ids_properties) :: ids_properties !Interface Data Structure properties. This element identifies the node above as an IDS + type(ids_distribution_sources_source), pointer :: source(:) => null() !Set of source/sink terms. A source/sink term corresponds to the particle source due to an NBI injection unit, a nuclear reaction o! + !r any combination of them (described in "identifier") + type(ids_b_tor_vacuum_1) :: vacuum_toroidal_field !Characteristics of the vacuum toroidal field (used in rho_tor definition) + type(ids_rz1d_dynamic_1) :: magnetic_axis !Magnetic axis position (used to define a poloidal angle for the 2D profiles) + type(ids_code) :: code !Generic decription of the code-specific parameters for the code that has produced this IDS + real(ids_real), pointer :: time(:) => null() !Generic time + end type + + ! *********** distributions IDS internal structures declaration + + type :: ids_distributions_d_global_quantities_collisions_electrons + real(ids_real) :: power_thermal=ids_real_invalid !Collisional power to the thermal particle population + real(ids_real) :: power_thermal_error_upper=ids_real_invalid !Upper error for "power_thermal" + real(ids_real) :: power_thermal_error_lower=ids_real_invalid !Lower error for "power_thermal" + integer(ids_int) :: power_thermal_error_index=ids_int_invalid !Index in the error_description list for "power_thermal" + real(ids_real) :: power_fast=ids_real_invalid !Collisional power to the fast particle population + real(ids_real) :: power_fast_error_upper=ids_real_invalid !Upper error for "power_fast" + real(ids_real) :: power_fast_error_lower=ids_real_invalid !Lower error for "power_fast" + integer(ids_int) :: power_fast_error_index=ids_int_invalid !Index in the error_description list for "power_fast" + real(ids_real) :: torque_thermal_tor=ids_real_invalid !Collisional toroidal torque to the thermal particle population + real(ids_real) :: torque_thermal_tor_error_upper=ids_real_invalid !Upper error for "torque_thermal_tor" + real(ids_real) :: torque_thermal_tor_error_lower=ids_real_invalid !Lower error for "torque_thermal_tor" + integer(ids_int) :: torque_thermal_tor_error_index=ids_int_invalid !Index in the error_description list for "torque_thermal_tor" + real(ids_real) :: torque_fast_tor=ids_real_invalid !Collisional toroidal torque to the fast particle population + real(ids_real) :: torque_fast_tor_error_upper=ids_real_invalid !Upper error for "torque_fast_tor" + real(ids_real) :: torque_fast_tor_error_lower=ids_real_invalid !Lower error for "torque_fast_tor" + integer(ids_int) :: torque_fast_tor_error_index=ids_int_invalid !Index in the error_description list for "torque_fast_tor" + end type + + type :: ids_distributions_d_global_quantities_collisions_ion_state + real(ids_real) :: z_min=ids_real_invalid !Minimum Z of the charge state bundle (z_min = z_max = 0 for a neutral) + real(ids_real) :: z_min_error_upper=ids_real_invalid !Upper error for "z_min" + real(ids_real) :: z_min_error_lower=ids_real_invalid !Lower error for "z_min" + integer(ids_int) :: z_min_error_index=ids_int_invalid !Index in the error_description list for "z_min" + real(ids_real) :: z_max=ids_real_invalid !Maximum Z of the charge state bundle (equal to z_min if no bundle) + real(ids_real) :: z_max_error_upper=ids_real_invalid !Upper error for "z_max" + real(ids_real) :: z_max_error_lower=ids_real_invalid !Lower error for "z_max" + integer(ids_int) :: z_max_error_index=ids_int_invalid !Index in the error_description list for "z_max" + character(len=ids_string_length), dimension(:), pointer :: label => null() !String identifying charge state (e.g. C+, C+2 , C+3, C+4, C+5, C+6, ...) + character(len=ids_string_length), dimension(:), pointer :: electron_configuration => null() !Configuration of atomic orbitals of this state, e.g. 1s2-2s1 + real(ids_real) :: vibrational_level=ids_real_invalid !Vibrational level (can be bundled) + real(ids_real) :: vibrational_level_error_upper=ids_real_invalid !Upper error for "vibrational_level" + real(ids_real) :: vibrational_level_error_lower=ids_real_invalid !Lower error for "vibrational_level" + integer(ids_int) :: vibrational_level_error_index=ids_int_invalid !Index in the error_description list for "vibrational_level" + character(len=ids_string_length), dimension(:), pointer :: vibrational_mode => null() !Vibrational mode of this state, e.g. "A_g". Need to define, or adopt a standard nomenclature. + real(ids_real) :: power_thermal=ids_real_invalid !Collisional power to the thermal particle population + real(ids_real) :: power_thermal_error_upper=ids_real_invalid !Upper error for "power_thermal" + real(ids_real) :: power_thermal_error_lower=ids_real_invalid !Lower error for "power_thermal" + integer(ids_int) :: power_thermal_error_index=ids_int_invalid !Index in the error_description list for "power_thermal" + real(ids_real) :: power_fast=ids_real_invalid !Collisional power to the fast particle population + real(ids_real) :: power_fast_error_upper=ids_real_invalid !Upper error for "power_fast" + real(ids_real) :: power_fast_error_lower=ids_real_invalid !Lower error for "power_fast" + integer(ids_int) :: power_fast_error_index=ids_int_invalid !Index in the error_description list for "power_fast" + real(ids_real) :: torque_thermal_tor=ids_real_invalid !Collisional toroidal torque to the thermal particle population + real(ids_real) :: torque_thermal_tor_error_upper=ids_real_invalid !Upper error for "torque_thermal_tor" + real(ids_real) :: torque_thermal_tor_error_lower=ids_real_invalid !Lower error for "torque_thermal_tor" + integer(ids_int) :: torque_thermal_tor_error_index=ids_int_invalid !Index in the error_description list for "torque_thermal_tor" + real(ids_real) :: torque_fast_tor=ids_real_invalid !Collisional toroidal torque to the fast particle population + real(ids_real) :: torque_fast_tor_error_upper=ids_real_invalid !Upper error for "torque_fast_tor" + real(ids_real) :: torque_fast_tor_error_lower=ids_real_invalid !Lower error for "torque_fast_tor" + integer(ids_int) :: torque_fast_tor_error_index=ids_int_invalid !Index in the error_description list for "torque_fast_tor" + end type + + type :: ids_distributions_d_global_quantities_collisions_ion + type(ids_plasma_composition_neutral_element), pointer :: element(:) => null() !List of elements forming the atom or molecule + real(ids_real) :: z_ion=ids_real_invalid !Ion charge (of the dominant ionisation state; lumped ions are allowed). + real(ids_real) :: z_ion_error_upper=ids_real_invalid !Upper error for "z_ion" + real(ids_real) :: z_ion_error_lower=ids_real_invalid !Lower error for "z_ion" + integer(ids_int) :: z_ion_error_index=ids_int_invalid !Index in the error_description list for "z_ion" + character(len=ids_string_length), dimension(:), pointer :: label => null() !String identifying the species (e.g. H+, D+, T+, He+2, C+, D2, DT, CD4, ...) + integer(ids_int) :: neutral_index=ids_int_invalid !Index of the corresponding neutral species in the ../../neutral array + real(ids_real) :: power_thermal=ids_real_invalid !Collisional power to the thermal particle population + real(ids_real) :: power_thermal_error_upper=ids_real_invalid !Upper error for "power_thermal" + real(ids_real) :: power_thermal_error_lower=ids_real_invalid !Lower error for "power_thermal" + integer(ids_int) :: power_thermal_error_index=ids_int_invalid !Index in the error_description list for "power_thermal" + real(ids_real) :: power_fast=ids_real_invalid !Collisional power to the fast particle population + real(ids_real) :: power_fast_error_upper=ids_real_invalid !Upper error for "power_fast" + real(ids_real) :: power_fast_error_lower=ids_real_invalid !Lower error for "power_fast" + integer(ids_int) :: power_fast_error_index=ids_int_invalid !Index in the error_description list for "power_fast" + real(ids_real) :: torque_thermal_tor=ids_real_invalid !Collisional toroidal torque to the thermal particle population + real(ids_real) :: torque_thermal_tor_error_upper=ids_real_invalid !Upper error for "torque_thermal_tor" + real(ids_real) :: torque_thermal_tor_error_lower=ids_real_invalid !Lower error for "torque_thermal_tor" + integer(ids_int) :: torque_thermal_tor_error_index=ids_int_invalid !Index in the error_description list for "torque_thermal_tor" + real(ids_real) :: torque_fast_tor=ids_real_invalid !Collisional toroidal torque to the fast particle population + real(ids_real) :: torque_fast_tor_error_upper=ids_real_invalid !Upper error for "torque_fast_tor" + real(ids_real) :: torque_fast_tor_error_lower=ids_real_invalid !Lower error for "torque_fast_tor" + integer(ids_int) :: torque_fast_tor_error_index=ids_int_invalid !Index in the error_description list for "torque_fast_tor" + integer(ids_int) :: multiple_states_flag=ids_int_invalid !Multiple state calculation flag : 0-Only one state is considered; 1-Multiple states are considered and are described in the state ! + !structure + type(ids_distributions_d_global_quantities_collisions_ion_state), pointer :: state(:) => null() !Collisional exchange with the various states of the ion species (ionisation, energy, excitation, ...) + end type + + type :: ids_distributions_d_global_quantities_collisions + type(ids_distributions_d_global_quantities_collisions_electrons) :: electrons !Collisional exchange with electrons + type(ids_distributions_d_global_quantities_collisions_ion), pointer :: ion(:) => null() !Collisional exchange with the various ion species + end type + + type :: ids_distributions_d_global_quantities_thermalised + real(ids_real) :: particles=ids_real_invalid !Source rate of thermal particles due to the thermalisation of fast particles + real(ids_real) :: particles_error_upper=ids_real_invalid !Upper error for "particles" + real(ids_real) :: particles_error_lower=ids_real_invalid !Lower error for "particles" + integer(ids_int) :: particles_error_index=ids_int_invalid !Index in the error_description list for "particles" + real(ids_real) :: power=ids_real_invalid !Power input to the thermal particle population due to the thermalisation of fast particles + real(ids_real) :: power_error_upper=ids_real_invalid !Upper error for "power" + real(ids_real) :: power_error_lower=ids_real_invalid !Lower error for "power" + integer(ids_int) :: power_error_index=ids_int_invalid !Index in the error_description list for "power" + real(ids_real) :: torque=ids_real_invalid !Torque input to the thermal particle population due to the thermalisation of fast particles + real(ids_real) :: torque_error_upper=ids_real_invalid !Upper error for "torque" + real(ids_real) :: torque_error_lower=ids_real_invalid !Lower error for "torque" + integer(ids_int) :: torque_error_index=ids_int_invalid !Index in the error_description list for "torque" + end type + + type :: ids_distributions_d_source_identifier + type(ids_identifier_dynamic_aos3) :: type !Type of the source term. Index = 1 for a wave, index = 2 for a particle source process + integer(ids_int) :: wave_index=ids_int_invalid !Index into distribution/wave + integer(ids_int) :: process_index=ids_int_invalid !Index into distribution/process + end type + + type :: ids_distributions_d_global_quantities_source + type(ids_distributions_d_source_identifier) :: identifier !Identifier of the wave or particle source process, defined respectively in distribution/wave or distribution/process + real(ids_real) :: particles=ids_real_invalid !Particle source rate + real(ids_real) :: particles_error_upper=ids_real_invalid !Upper error for "particles" + real(ids_real) :: particles_error_lower=ids_real_invalid !Lower error for "particles" + integer(ids_int) :: particles_error_index=ids_int_invalid !Index in the error_description list for "particles" + real(ids_real) :: power=ids_real_invalid !Total power of the source + real(ids_real) :: power_error_upper=ids_real_invalid !Upper error for "power" + real(ids_real) :: power_error_lower=ids_real_invalid !Lower error for "power" + integer(ids_int) :: power_error_index=ids_int_invalid !Index in the error_description list for "power" + real(ids_real) :: torque_tor=ids_real_invalid !Total toroidal torque of the source + real(ids_real) :: torque_tor_error_upper=ids_real_invalid !Upper error for "torque_tor" + real(ids_real) :: torque_tor_error_lower=ids_real_invalid !Lower error for "torque_tor" + integer(ids_int) :: torque_tor_error_index=ids_int_invalid !Index in the error_description list for "torque_tor" + end type + + type :: ids_distributions_d_global_quantities + real(ids_real) :: particles_n=ids_real_invalid !Number of particles in the distribution, i.e. the volume integral of the density (note: this is the number of real particles and n! + !ot markers) + real(ids_real) :: particles_n_error_upper=ids_real_invalid !Upper error for "particles_n" + real(ids_real) :: particles_n_error_lower=ids_real_invalid !Lower error for "particles_n" + integer(ids_int) :: particles_n_error_index=ids_int_invalid !Index in the error_description list for "particles_n" + real(ids_real) :: particles_fast_n=ids_real_invalid !Number of fast particles in the distribution, i.e. the volume integral of the density (note: this is the number of real particles ! + !and not markers) + real(ids_real) :: particles_fast_n_error_upper=ids_real_invalid !Upper error for "particles_fast_n" + real(ids_real) :: particles_fast_n_error_lower=ids_real_invalid !Lower error for "particles_fast_n" + integer(ids_int) :: particles_fast_n_error_index=ids_int_invalid !Index in the error_description list for "particles_fast_n" + real(ids_real) :: energy=ids_real_invalid !Total energy in the distribution + real(ids_real) :: energy_error_upper=ids_real_invalid !Upper error for "energy" + real(ids_real) :: energy_error_lower=ids_real_invalid !Lower error for "energy" + integer(ids_int) :: energy_error_index=ids_int_invalid !Index in the error_description list for "energy" + real(ids_real) :: energy_fast=ids_real_invalid !Total energy of the fast particles in the distribution + real(ids_real) :: energy_fast_error_upper=ids_real_invalid !Upper error for "energy_fast" + real(ids_real) :: energy_fast_error_lower=ids_real_invalid !Lower error for "energy_fast" + integer(ids_int) :: energy_fast_error_index=ids_int_invalid !Index in the error_description list for "energy_fast" + real(ids_real) :: energy_fast_parallel=ids_real_invalid !Parallel energy of the fast particles in the distribution + real(ids_real) :: energy_fast_parallel_error_upper=ids_real_invalid !Upper error for "energy_fast_parallel" + real(ids_real) :: energy_fast_parallel_error_lower=ids_real_invalid !Lower error for "energy_fast_parallel" + integer(ids_int) :: energy_fast_parallel_error_index=ids_int_invalid !Index in the error_description list for "energy_fast_parallel" + real(ids_real) :: torque_tor_j_radial=ids_real_invalid !Toroidal torque due to radial currents + real(ids_real) :: torque_tor_j_radial_error_upper=ids_real_invalid !Upper error for "torque_tor_j_radial" + real(ids_real) :: torque_tor_j_radial_error_lower=ids_real_invalid !Lower error for "torque_tor_j_radial" + integer(ids_int) :: torque_tor_j_radial_error_index=ids_int_invalid !Index in the error_description list for "torque_tor_j_radial" + real(ids_real) :: current_tor=ids_real_invalid !Toroidal current driven by the distribution + real(ids_real) :: current_tor_error_upper=ids_real_invalid !Upper error for "current_tor" + real(ids_real) :: current_tor_error_lower=ids_real_invalid !Lower error for "current_tor" + integer(ids_int) :: current_tor_error_index=ids_int_invalid !Index in the error_description list for "current_tor" + type(ids_distributions_d_global_quantities_collisions) :: collisions !Power and torque exchanged between the species described by the distribution and the different plasma species through collisions + type(ids_distributions_d_global_quantities_thermalised) :: thermalisation !Volume integrated source of thermal particles, momentum and energy due to thermalisation. Here thermalisation refers to non-therma! + !l particles, sufficiently assimilated to the thermal background to be re-categorised as thermal particles. Note that this source m! + !ay also be negative if thermal particles are being accelerated such that they form a distinct non-thermal contribution, e.g. due r! + !un-away of RF interactions. + type(ids_distributions_d_global_quantities_source), pointer :: source(:) => null() !Set of volume integrated sources and sinks of particles, momentum and energy included in the Fokker-Planck modelling, related to t! + !he various waves or particle source processes affecting the distribution + real(ids_real) :: time=ids_real_invalid !Time + end type + + type :: ids_distributions_d_fast_filter + type(ids_identifier_dynamic_aos3) :: method !Method used to separate the fast and thermal particle population (indices TBD) + real(ids_real), pointer :: energy(:) => null() !Energy at which the fast and thermal particle populations were separated, as a function of radius + real(ids_real), pointer :: energy_error_upper(:) => null() !Upper error for "energy" + real(ids_real), pointer :: energy_error_lower(:) => null() !Lower error for "energy" + integer(ids_int) :: energy_error_index=ids_int_invalid !Index in the error_description list for "energy" + end type + + type :: ids_distributions_d_profiles_1d_collisions_electrons + real(ids_real), pointer :: power_thermal(:) => null() !Collisional power density to the thermal particle population + real(ids_real), pointer :: power_thermal_error_upper(:) => null() !Upper error for "power_thermal" + real(ids_real), pointer :: power_thermal_error_lower(:) => null() !Lower error for "power_thermal" + integer(ids_int) :: power_thermal_error_index=ids_int_invalid !Index in the error_description list for "power_thermal" + real(ids_real), pointer :: power_fast(:) => null() !Collisional power density to the fast particle population + real(ids_real), pointer :: power_fast_error_upper(:) => null() !Upper error for "power_fast" + real(ids_real), pointer :: power_fast_error_lower(:) => null() !Lower error for "power_fast" + integer(ids_int) :: power_fast_error_index=ids_int_invalid !Index in the error_description list for "power_fast" + real(ids_real), pointer :: torque_thermal_tor(:) => null() !Collisional toroidal torque density to the thermal particle population + real(ids_real), pointer :: torque_thermal_tor_error_upper(:) => null() !Upper error for "torque_thermal_tor" + real(ids_real), pointer :: torque_thermal_tor_error_lower(:) => null() !Lower error for "torque_thermal_tor" + integer(ids_int) :: torque_thermal_tor_error_index=ids_int_invalid !Index in the error_description list for "torque_thermal_tor" + real(ids_real), pointer :: torque_fast_tor(:) => null() !Collisional toroidal torque density to the fast particle population + real(ids_real), pointer :: torque_fast_tor_error_upper(:) => null() !Upper error for "torque_fast_tor" + real(ids_real), pointer :: torque_fast_tor_error_lower(:) => null() !Lower error for "torque_fast_tor" + integer(ids_int) :: torque_fast_tor_error_index=ids_int_invalid !Index in the error_description list for "torque_fast_tor" + end type + + type :: ids_distributions_d_profiles_1d_collisions_ion_state + real(ids_real) :: z_min=ids_real_invalid !Minimum Z of the charge state bundle (z_min = z_max = 0 for a neutral) + real(ids_real) :: z_min_error_upper=ids_real_invalid !Upper error for "z_min" + real(ids_real) :: z_min_error_lower=ids_real_invalid !Lower error for "z_min" + integer(ids_int) :: z_min_error_index=ids_int_invalid !Index in the error_description list for "z_min" + real(ids_real) :: z_max=ids_real_invalid !Maximum Z of the charge state bundle (equal to z_min if no bundle) + real(ids_real) :: z_max_error_upper=ids_real_invalid !Upper error for "z_max" + real(ids_real) :: z_max_error_lower=ids_real_invalid !Lower error for "z_max" + integer(ids_int) :: z_max_error_index=ids_int_invalid !Index in the error_description list for "z_max" + character(len=ids_string_length), dimension(:), pointer :: label => null() !String identifying charge state (e.g. C+, C+2 , C+3, C+4, C+5, C+6, ...) + character(len=ids_string_length), dimension(:), pointer :: electron_configuration => null() !Configuration of atomic orbitals of this state, e.g. 1s2-2s1 + real(ids_real) :: vibrational_level=ids_real_invalid !Vibrational level (can be bundled) + real(ids_real) :: vibrational_level_error_upper=ids_real_invalid !Upper error for "vibrational_level" + real(ids_real) :: vibrational_level_error_lower=ids_real_invalid !Lower error for "vibrational_level" + integer(ids_int) :: vibrational_level_error_index=ids_int_invalid !Index in the error_description list for "vibrational_level" + character(len=ids_string_length), dimension(:), pointer :: vibrational_mode => null() !Vibrational mode of this state, e.g. "A_g". Need to define, or adopt a standard nomenclature. + real(ids_real), pointer :: power_thermal(:) => null() !Collisional power density to the thermal particle population + real(ids_real), pointer :: power_thermal_error_upper(:) => null() !Upper error for "power_thermal" + real(ids_real), pointer :: power_thermal_error_lower(:) => null() !Lower error for "power_thermal" + integer(ids_int) :: power_thermal_error_index=ids_int_invalid !Index in the error_description list for "power_thermal" + real(ids_real), pointer :: power_fast(:) => null() !Collisional power density to the fast particle population + real(ids_real), pointer :: power_fast_error_upper(:) => null() !Upper error for "power_fast" + real(ids_real), pointer :: power_fast_error_lower(:) => null() !Lower error for "power_fast" + integer(ids_int) :: power_fast_error_index=ids_int_invalid !Index in the error_description list for "power_fast" + real(ids_real), pointer :: torque_thermal_tor(:) => null() !Collisional toroidal torque density to the thermal particle population + real(ids_real), pointer :: torque_thermal_tor_error_upper(:) => null() !Upper error for "torque_thermal_tor" + real(ids_real), pointer :: torque_thermal_tor_error_lower(:) => null() !Lower error for "torque_thermal_tor" + integer(ids_int) :: torque_thermal_tor_error_index=ids_int_invalid !Index in the error_description list for "torque_thermal_tor" + real(ids_real), pointer :: torque_fast_tor(:) => null() !Collisional toroidal torque density to the fast particle population + real(ids_real), pointer :: torque_fast_tor_error_upper(:) => null() !Upper error for "torque_fast_tor" + real(ids_real), pointer :: torque_fast_tor_error_lower(:) => null() !Lower error for "torque_fast_tor" + integer(ids_int) :: torque_fast_tor_error_index=ids_int_invalid !Index in the error_description list for "torque_fast_tor" + end type + + type :: ids_distributions_d_profiles_1d_collisions_ion + type(ids_plasma_composition_neutral_element), pointer :: element(:) => null() !List of elements forming the atom or molecule + real(ids_real) :: z_ion=ids_real_invalid !Ion charge (of the dominant ionisation state; lumped ions are allowed). + real(ids_real) :: z_ion_error_upper=ids_real_invalid !Upper error for "z_ion" + real(ids_real) :: z_ion_error_lower=ids_real_invalid !Lower error for "z_ion" + integer(ids_int) :: z_ion_error_index=ids_int_invalid !Index in the error_description list for "z_ion" + character(len=ids_string_length), dimension(:), pointer :: label => null() !String identifying the species (e.g. H+, D+, T+, He+2, C+, D2, DT, CD4, ...) + integer(ids_int) :: neutral_index=ids_int_invalid !Index of the corresponding neutral species in the ../../neutral array + real(ids_real), pointer :: power_thermal(:) => null() !Collisional power density to the thermal particle population + real(ids_real), pointer :: power_thermal_error_upper(:) => null() !Upper error for "power_thermal" + real(ids_real), pointer :: power_thermal_error_lower(:) => null() !Lower error for "power_thermal" + integer(ids_int) :: power_thermal_error_index=ids_int_invalid !Index in the error_description list for "power_thermal" + real(ids_real), pointer :: power_fast(:) => null() !Collisional power density to the fast particle population + real(ids_real), pointer :: power_fast_error_upper(:) => null() !Upper error for "power_fast" + real(ids_real), pointer :: power_fast_error_lower(:) => null() !Lower error for "power_fast" + integer(ids_int) :: power_fast_error_index=ids_int_invalid !Index in the error_description list for "power_fast" + real(ids_real), pointer :: torque_thermal_tor(:) => null() !Collisional toroidal torque density to the thermal particle population + real(ids_real), pointer :: torque_thermal_tor_error_upper(:) => null() !Upper error for "torque_thermal_tor" + real(ids_real), pointer :: torque_thermal_tor_error_lower(:) => null() !Lower error for "torque_thermal_tor" + integer(ids_int) :: torque_thermal_tor_error_index=ids_int_invalid !Index in the error_description list for "torque_thermal_tor" + real(ids_real), pointer :: torque_fast_tor(:) => null() !Collisional toroidal torque density to the fast particle population + real(ids_real), pointer :: torque_fast_tor_error_upper(:) => null() !Upper error for "torque_fast_tor" + real(ids_real), pointer :: torque_fast_tor_error_lower(:) => null() !Lower error for "torque_fast_tor" + integer(ids_int) :: torque_fast_tor_error_index=ids_int_invalid !Index in the error_description list for "torque_fast_tor" + integer(ids_int) :: multiple_states_flag=ids_int_invalid !Multiple state calculation flag : 0-Only one state is considered; 1-Multiple states are considered and are described in the state ! + !structure + type(ids_distributions_d_profiles_1d_collisions_ion_state), pointer :: state(:) => null() !Collisional exchange with the various states of the ion species (ionisation, energy, excitation, ...) + end type + + type :: ids_distributions_d_profiles_1d_collisions + type(ids_distributions_d_profiles_1d_collisions_electrons) :: electrons !Collisional exchange with electrons + type(ids_distributions_d_profiles_1d_collisions_ion), pointer :: ion(:) => null() !Collisional exchange with the various ion species + end type + + type :: ids_distributions_d_profiles_1d_thermalised + real(ids_real), pointer :: particles(:) => null() !Source rate of thermal particle density due to the thermalisation of fast particles + real(ids_real), pointer :: particles_error_upper(:) => null() !Upper error for "particles" + real(ids_real), pointer :: particles_error_lower(:) => null() !Lower error for "particles" + integer(ids_int) :: particles_error_index=ids_int_invalid !Index in the error_description list for "particles" + real(ids_real), pointer :: energy(:) => null() !Source rate of energy density within the thermal particle population due to the thermalisation of fast particles + real(ids_real), pointer :: energy_error_upper(:) => null() !Upper error for "energy" + real(ids_real), pointer :: energy_error_lower(:) => null() !Lower error for "energy" + integer(ids_int) :: energy_error_index=ids_int_invalid !Index in the error_description list for "energy" + real(ids_real), pointer :: momentum_tor(:) => null() !Source rate of toroidal angular momentum density within the thermal particle population due to the thermalisation of fast particle! + !s + real(ids_real), pointer :: momentum_tor_error_upper(:) => null() !Upper error for "momentum_tor" + real(ids_real), pointer :: momentum_tor_error_lower(:) => null() !Lower error for "momentum_tor" + integer(ids_int) :: momentum_tor_error_index=ids_int_invalid !Index in the error_description list for "momentum_tor" + end type + + type :: ids_distributions_d_profiles_1d_source + type(ids_distributions_d_source_identifier) :: identifier !Identifier of the wave or particle source process, defined respectively in distribution/wave or distribution/process + real(ids_real), pointer :: particles(:) => null() !Source rate of thermal particle density + real(ids_real), pointer :: particles_error_upper(:) => null() !Upper error for "particles" + real(ids_real), pointer :: particles_error_lower(:) => null() !Lower error for "particles" + integer(ids_int) :: particles_error_index=ids_int_invalid !Index in the error_description list for "particles" + real(ids_real), pointer :: energy(:) => null() !Source rate of energy density + real(ids_real), pointer :: energy_error_upper(:) => null() !Upper error for "energy" + real(ids_real), pointer :: energy_error_lower(:) => null() !Lower error for "energy" + integer(ids_int) :: energy_error_index=ids_int_invalid !Index in the error_description list for "energy" + real(ids_real), pointer :: momentum_tor(:) => null() !Source rate of toroidal angular momentum density + real(ids_real), pointer :: momentum_tor_error_upper(:) => null() !Upper error for "momentum_tor" + real(ids_real), pointer :: momentum_tor_error_lower(:) => null() !Lower error for "momentum_tor" + integer(ids_int) :: momentum_tor_error_index=ids_int_invalid !Index in the error_description list for "momentum_tor" + end type + + type :: ids_distributions_d_profiles_1d_partial_collisions_electrons + real(ids_real), pointer :: power_thermal(:) => null() !Collisional power density to the thermal particle population + real(ids_real), pointer :: power_thermal_error_upper(:) => null() !Upper error for "power_thermal" + real(ids_real), pointer :: power_thermal_error_lower(:) => null() !Lower error for "power_thermal" + integer(ids_int) :: power_thermal_error_index=ids_int_invalid !Index in the error_description list for "power_thermal" + real(ids_real), pointer :: power_fast(:) => null() !Collisional power density to the fast particle population + real(ids_real), pointer :: power_fast_error_upper(:) => null() !Upper error for "power_fast" + real(ids_real), pointer :: power_fast_error_lower(:) => null() !Lower error for "power_fast" + integer(ids_int) :: power_fast_error_index=ids_int_invalid !Index in the error_description list for "power_fast" + real(ids_real), pointer :: torque_thermal_tor(:) => null() !Collisional toroidal torque density to the thermal particle population + real(ids_real), pointer :: torque_thermal_tor_error_upper(:) => null() !Upper error for "torque_thermal_tor" + real(ids_real), pointer :: torque_thermal_tor_error_lower(:) => null() !Lower error for "torque_thermal_tor" + integer(ids_int) :: torque_thermal_tor_error_index=ids_int_invalid !Index in the error_description list for "torque_thermal_tor" + real(ids_real), pointer :: torque_fast_tor(:) => null() !Collisional toroidal torque density to the fast particle population + real(ids_real), pointer :: torque_fast_tor_error_upper(:) => null() !Upper error for "torque_fast_tor" + real(ids_real), pointer :: torque_fast_tor_error_lower(:) => null() !Lower error for "torque_fast_tor" + integer(ids_int) :: torque_fast_tor_error_index=ids_int_invalid !Index in the error_description list for "torque_fast_tor" + end type + + type :: ids_distributions_d_profiles_1d_partial_collisions_ion_state + real(ids_real) :: z_min=ids_real_invalid !Minimum Z of the charge state bundle (z_min = z_max = 0 for a neutral) + real(ids_real) :: z_min_error_upper=ids_real_invalid !Upper error for "z_min" + real(ids_real) :: z_min_error_lower=ids_real_invalid !Lower error for "z_min" + integer(ids_int) :: z_min_error_index=ids_int_invalid !Index in the error_description list for "z_min" + real(ids_real) :: z_max=ids_real_invalid !Maximum Z of the charge state bundle (equal to z_min if no bundle) + real(ids_real) :: z_max_error_upper=ids_real_invalid !Upper error for "z_max" + real(ids_real) :: z_max_error_lower=ids_real_invalid !Lower error for "z_max" + integer(ids_int) :: z_max_error_index=ids_int_invalid !Index in the error_description list for "z_max" + character(len=ids_string_length), dimension(:), pointer :: label => null() !String identifying charge state (e.g. C+, C+2 , C+3, C+4, C+5, C+6, ...) + character(len=ids_string_length), dimension(:), pointer :: electron_configuration => null() !Configuration of atomic orbitals of this state, e.g. 1s2-2s1 + real(ids_real) :: vibrational_level=ids_real_invalid !Vibrational level (can be bundled) + real(ids_real) :: vibrational_level_error_upper=ids_real_invalid !Upper error for "vibrational_level" + real(ids_real) :: vibrational_level_error_lower=ids_real_invalid !Lower error for "vibrational_level" + integer(ids_int) :: vibrational_level_error_index=ids_int_invalid !Index in the error_description list for "vibrational_level" + character(len=ids_string_length), dimension(:), pointer :: vibrational_mode => null() !Vibrational mode of this state, e.g. "A_g". Need to define, or adopt a standard nomenclature. + real(ids_real), pointer :: power_thermal(:) => null() !Collisional power density to the thermal particle population + real(ids_real), pointer :: power_thermal_error_upper(:) => null() !Upper error for "power_thermal" + real(ids_real), pointer :: power_thermal_error_lower(:) => null() !Lower error for "power_thermal" + integer(ids_int) :: power_thermal_error_index=ids_int_invalid !Index in the error_description list for "power_thermal" + real(ids_real), pointer :: power_fast(:) => null() !Collisional power density to the fast particle population + real(ids_real), pointer :: power_fast_error_upper(:) => null() !Upper error for "power_fast" + real(ids_real), pointer :: power_fast_error_lower(:) => null() !Lower error for "power_fast" + integer(ids_int) :: power_fast_error_index=ids_int_invalid !Index in the error_description list for "power_fast" + real(ids_real), pointer :: torque_thermal_tor(:) => null() !Collisional toroidal torque density to the thermal particle population + real(ids_real), pointer :: torque_thermal_tor_error_upper(:) => null() !Upper error for "torque_thermal_tor" + real(ids_real), pointer :: torque_thermal_tor_error_lower(:) => null() !Lower error for "torque_thermal_tor" + integer(ids_int) :: torque_thermal_tor_error_index=ids_int_invalid !Index in the error_description list for "torque_thermal_tor" + real(ids_real), pointer :: torque_fast_tor(:) => null() !Collisional toroidal torque density to the fast particle population + real(ids_real), pointer :: torque_fast_tor_error_upper(:) => null() !Upper error for "torque_fast_tor" + real(ids_real), pointer :: torque_fast_tor_error_lower(:) => null() !Lower error for "torque_fast_tor" + integer(ids_int) :: torque_fast_tor_error_index=ids_int_invalid !Index in the error_description list for "torque_fast_tor" + end type + + type :: ids_distributions_d_profiles_1d_partial_collisions_ion + type(ids_plasma_composition_neutral_element), pointer :: element(:) => null() !List of elements forming the atom or molecule + real(ids_real) :: z_ion=ids_real_invalid !Ion charge (of the dominant ionisation state; lumped ions are allowed). + real(ids_real) :: z_ion_error_upper=ids_real_invalid !Upper error for "z_ion" + real(ids_real) :: z_ion_error_lower=ids_real_invalid !Lower error for "z_ion" + integer(ids_int) :: z_ion_error_index=ids_int_invalid !Index in the error_description list for "z_ion" + character(len=ids_string_length), dimension(:), pointer :: label => null() !String identifying the species (e.g. H+, D+, T+, He+2, C+, D2, DT, CD4, ...) + integer(ids_int) :: neutral_index=ids_int_invalid !Index of the corresponding neutral species in the ../../neutral array + real(ids_real), pointer :: power_thermal(:) => null() !Collisional power density to the thermal particle population + real(ids_real), pointer :: power_thermal_error_upper(:) => null() !Upper error for "power_thermal" + real(ids_real), pointer :: power_thermal_error_lower(:) => null() !Lower error for "power_thermal" + integer(ids_int) :: power_thermal_error_index=ids_int_invalid !Index in the error_description list for "power_thermal" + real(ids_real), pointer :: power_fast(:) => null() !Collisional power density to the fast particle population + real(ids_real), pointer :: power_fast_error_upper(:) => null() !Upper error for "power_fast" + real(ids_real), pointer :: power_fast_error_lower(:) => null() !Lower error for "power_fast" + integer(ids_int) :: power_fast_error_index=ids_int_invalid !Index in the error_description list for "power_fast" + real(ids_real), pointer :: torque_thermal_tor(:) => null() !Collisional toroidal torque density to the thermal particle population + real(ids_real), pointer :: torque_thermal_tor_error_upper(:) => null() !Upper error for "torque_thermal_tor" + real(ids_real), pointer :: torque_thermal_tor_error_lower(:) => null() !Lower error for "torque_thermal_tor" + integer(ids_int) :: torque_thermal_tor_error_index=ids_int_invalid !Index in the error_description list for "torque_thermal_tor" + real(ids_real), pointer :: torque_fast_tor(:) => null() !Collisional toroidal torque density to the fast particle population + real(ids_real), pointer :: torque_fast_tor_error_upper(:) => null() !Upper error for "torque_fast_tor" + real(ids_real), pointer :: torque_fast_tor_error_lower(:) => null() !Lower error for "torque_fast_tor" + integer(ids_int) :: torque_fast_tor_error_index=ids_int_invalid !Index in the error_description list for "torque_fast_tor" + integer(ids_int) :: multiple_states_flag=ids_int_invalid !Multiple state calculation flag : 0-Only one state is considered; 1-Multiple states are considered and are described in the state ! + !structure + type(ids_distributions_d_profiles_1d_partial_collisions_ion_state), pointer :: state(:) => null() !Collisional exchange with the various states of the ion species (ionisation, energy, excitation, ...) + end type + + type :: ids_distributions_d_profiles_1d_partial_collisions + type(ids_distributions_d_profiles_1d_partial_collisions_electrons) :: electrons !Collisional exchange with electrons + type(ids_distributions_d_profiles_1d_partial_collisions_ion), pointer :: ion(:) => null() !Collisional exchange with the various ion species + end type + + type :: ids_distributions_d_profiles_1d_partial_source + type(ids_distributions_d_source_identifier) :: identifier !Identifier of the wave or particle source process, defined respectively in distribution/wave or distribution/process + real(ids_real), pointer :: particles(:) => null() !Source rate of thermal particle density + real(ids_real), pointer :: particles_error_upper(:) => null() !Upper error for "particles" + real(ids_real), pointer :: particles_error_lower(:) => null() !Lower error for "particles" + integer(ids_int) :: particles_error_index=ids_int_invalid !Index in the error_description list for "particles" + real(ids_real), pointer :: energy(:) => null() !Source rate of energy density + real(ids_real), pointer :: energy_error_upper(:) => null() !Upper error for "energy" + real(ids_real), pointer :: energy_error_lower(:) => null() !Lower error for "energy" + integer(ids_int) :: energy_error_index=ids_int_invalid !Index in the error_description list for "energy" + real(ids_real), pointer :: momentum_tor(:) => null() !Source rate of toroidal angular momentum density + real(ids_real), pointer :: momentum_tor_error_upper(:) => null() !Upper error for "momentum_tor" + real(ids_real), pointer :: momentum_tor_error_lower(:) => null() !Lower error for "momentum_tor" + integer(ids_int) :: momentum_tor_error_index=ids_int_invalid !Index in the error_description list for "momentum_tor" + end type + + type :: ids_distributions_d_profiles_1d_partial + real(ids_real), pointer :: density(:) => null() !Density (thermal+non-thermal) + real(ids_real), pointer :: density_error_upper(:) => null() !Upper error for "density" + real(ids_real), pointer :: density_error_lower(:) => null() !Lower error for "density" + integer(ids_int) :: density_error_index=ids_int_invalid !Index in the error_description list for "density" + real(ids_real), pointer :: density_fast(:) => null() !Density of fast particles + real(ids_real), pointer :: density_fast_error_upper(:) => null() !Upper error for "density_fast" + real(ids_real), pointer :: density_fast_error_lower(:) => null() !Lower error for "density_fast" + integer(ids_int) :: density_fast_error_index=ids_int_invalid !Index in the error_description list for "density_fast" + real(ids_real), pointer :: pressure(:) => null() !Pressure (thermal+non-thermal) + real(ids_real), pointer :: pressure_error_upper(:) => null() !Upper error for "pressure" + real(ids_real), pointer :: pressure_error_lower(:) => null() !Lower error for "pressure" + integer(ids_int) :: pressure_error_index=ids_int_invalid !Index in the error_description list for "pressure" + real(ids_real), pointer :: pressure_fast(:) => null() !Pressure of fast particles + real(ids_real), pointer :: pressure_fast_error_upper(:) => null() !Upper error for "pressure_fast" + real(ids_real), pointer :: pressure_fast_error_lower(:) => null() !Lower error for "pressure_fast" + integer(ids_int) :: pressure_fast_error_index=ids_int_invalid !Index in the error_description list for "pressure_fast" + real(ids_real), pointer :: pressure_fast_parallel(:) => null() !Pressure of fast particles in the parallel direction + real(ids_real), pointer :: pressure_fast_parallel_error_upper(:) => null() !Upper error for "pressure_fast_parallel" + real(ids_real), pointer :: pressure_fast_parallel_error_lower(:) => null() !Lower error for "pressure_fast_parallel" + integer(ids_int) :: pressure_fast_parallel_error_index=ids_int_invalid !Index in the error_description list for "pressure_fast_parallel" + real(ids_real), pointer :: current_tor(:) => null() !Total toroidal driven current density (including electron and thermal ion back-current, or drag-current) + real(ids_real), pointer :: current_tor_error_upper(:) => null() !Upper error for "current_tor" + real(ids_real), pointer :: current_tor_error_lower(:) => null() !Lower error for "current_tor" + integer(ids_int) :: current_tor_error_index=ids_int_invalid !Index in the error_description list for "current_tor" + real(ids_real), pointer :: current_fast_tor(:) => null() !Total toroidal driven current density of fast (non-thermal) particles (excluding electron and thermal ion back-current, or drag-cu! + !rrent) + real(ids_real), pointer :: current_fast_tor_error_upper(:) => null() !Upper error for "current_fast_tor" + real(ids_real), pointer :: current_fast_tor_error_lower(:) => null() !Lower error for "current_fast_tor" + integer(ids_int) :: current_fast_tor_error_index=ids_int_invalid !Index in the error_description list for "current_fast_tor" + real(ids_real), pointer :: torque_tor_j_radial(:) => null() !Toroidal torque due to radial currents + real(ids_real), pointer :: torque_tor_j_radial_error_upper(:) => null() !Upper error for "torque_tor_j_radial" + real(ids_real), pointer :: torque_tor_j_radial_error_lower(:) => null() !Lower error for "torque_tor_j_radial" + integer(ids_int) :: torque_tor_j_radial_error_index=ids_int_invalid !Index in the error_description list for "torque_tor_j_radial" + type(ids_distributions_d_profiles_1d_partial_collisions) :: collisions !Power and torque exchanged between the species described by the distribution and the different plasma species through collisions + type(ids_distributions_d_profiles_1d_partial_source), pointer :: source(:) => null() !Set of flux averaged sources and sinks of particles, momentum and energy included in the Fokker-Planck modelling, related to the v! + !arious waves or particle source processes affecting the distribution + end type + + type :: ids_distributions_d_profiles_1d + type(ids_core_radial_grid) :: grid !Radial grid + type(ids_distributions_d_fast_filter) :: fast_filter !Description of how the fast and the thermal particle populations are separated + real(ids_real), pointer :: density(:) => null() !Density (thermal+non-thermal) + real(ids_real), pointer :: density_error_upper(:) => null() !Upper error for "density" + real(ids_real), pointer :: density_error_lower(:) => null() !Lower error for "density" + integer(ids_int) :: density_error_index=ids_int_invalid !Index in the error_description list for "density" + real(ids_real), pointer :: density_fast(:) => null() !Density of fast particles + real(ids_real), pointer :: density_fast_error_upper(:) => null() !Upper error for "density_fast" + real(ids_real), pointer :: density_fast_error_lower(:) => null() !Lower error for "density_fast" + integer(ids_int) :: density_fast_error_index=ids_int_invalid !Index in the error_description list for "density_fast" + real(ids_real), pointer :: pressure(:) => null() !Pressure (thermal+non-thermal) + real(ids_real), pointer :: pressure_error_upper(:) => null() !Upper error for "pressure" + real(ids_real), pointer :: pressure_error_lower(:) => null() !Lower error for "pressure" + integer(ids_int) :: pressure_error_index=ids_int_invalid !Index in the error_description list for "pressure" + real(ids_real), pointer :: pressure_fast(:) => null() !Pressure of fast particles + real(ids_real), pointer :: pressure_fast_error_upper(:) => null() !Upper error for "pressure_fast" + real(ids_real), pointer :: pressure_fast_error_lower(:) => null() !Lower error for "pressure_fast" + integer(ids_int) :: pressure_fast_error_index=ids_int_invalid !Index in the error_description list for "pressure_fast" + real(ids_real), pointer :: pressure_fast_parallel(:) => null() !Pressure of fast particles in the parallel direction + real(ids_real), pointer :: pressure_fast_parallel_error_upper(:) => null() !Upper error for "pressure_fast_parallel" + real(ids_real), pointer :: pressure_fast_parallel_error_lower(:) => null() !Lower error for "pressure_fast_parallel" + integer(ids_int) :: pressure_fast_parallel_error_index=ids_int_invalid !Index in the error_description list for "pressure_fast_parallel" + real(ids_real), pointer :: current_tor(:) => null() !Total toroidal driven current density (including electron and thermal ion back-current, or drag-current) + real(ids_real), pointer :: current_tor_error_upper(:) => null() !Upper error for "current_tor" + real(ids_real), pointer :: current_tor_error_lower(:) => null() !Lower error for "current_tor" + integer(ids_int) :: current_tor_error_index=ids_int_invalid !Index in the error_description list for "current_tor" + real(ids_real), pointer :: current_fast_tor(:) => null() !Total toroidal driven current density of fast (non-thermal) particles (excluding electron and thermal ion back-current, or drag-cu! + !rrent) + real(ids_real), pointer :: current_fast_tor_error_upper(:) => null() !Upper error for "current_fast_tor" + real(ids_real), pointer :: current_fast_tor_error_lower(:) => null() !Lower error for "current_fast_tor" + integer(ids_int) :: current_fast_tor_error_index=ids_int_invalid !Index in the error_description list for "current_fast_tor" + real(ids_real), pointer :: torque_tor_j_radial(:) => null() !Toroidal torque due to radial currents + real(ids_real), pointer :: torque_tor_j_radial_error_upper(:) => null() !Upper error for "torque_tor_j_radial" + real(ids_real), pointer :: torque_tor_j_radial_error_lower(:) => null() !Lower error for "torque_tor_j_radial" + integer(ids_int) :: torque_tor_j_radial_error_index=ids_int_invalid !Index in the error_description list for "torque_tor_j_radial" + type(ids_distributions_d_profiles_1d_collisions) :: collisions !Power and torque exchanged between the species described by the distribution and the different plasma species through collisions + type(ids_distributions_d_profiles_1d_thermalised) :: thermalisation !Flux surface averaged source of thermal particles, momentum and energy due to thermalisation. Here thermalisation refers to non-th! + !ermal particles, sufficiently assimilated to the thermal background to be re-categorised as thermal particles. Note that this sour! + !ce may also be negative if thermal particles are being accelerated such that they form a distinct non-thermal contribution, e.g. d! + !ue run-away of RF interactions. + type(ids_distributions_d_profiles_1d_source), pointer :: source(:) => null() !Set of flux averaged sources and sinks of particles, momentum and energy included in the Fokker-Planck modelling, related to the v! + !arious waves or particle source processes affecting the distribution + type(ids_distributions_d_profiles_1d_partial) :: trapped !Flux surface averaged profile evaluated using the trapped particle part of the distribution. + type(ids_distributions_d_profiles_1d_partial) :: co_passing !Flux surface averaged profile evaluated using the co-passing particle part of the distribution. + type(ids_distributions_d_profiles_1d_partial) :: counter_passing !Flux surface averaged profile evaluated using the counter-passing particle part of the distribution. + real(ids_real) :: time=ids_real_invalid !Time + end type + + type :: ids_distributions_d_profiles_2d_grid + type(ids_identifier_dynamic_aos3) :: type !Grid type: index=0: Rectangular grid in the (R,Z) coordinates; index=1: Rectangular grid in the (radial, theta_geometric) coordina! + !tes; index=2: Rectangular grid in the (radial, theta_straight) coordinates. + real(ids_real), pointer :: r(:) => null() !Major radius + real(ids_real), pointer :: r_error_upper(:) => null() !Upper error for "r" + real(ids_real), pointer :: r_error_lower(:) => null() !Lower error for "r" + integer(ids_int) :: r_error_index=ids_int_invalid !Index in the error_description list for "r" + real(ids_real), pointer :: z(:) => null() !Height + real(ids_real), pointer :: z_error_upper(:) => null() !Upper error for "z" + real(ids_real), pointer :: z_error_lower(:) => null() !Lower error for "z" + integer(ids_int) :: z_error_index=ids_int_invalid !Index in the error_description list for "z" + real(ids_real), pointer :: theta_straight(:) => null() !Straight field line poloidal angle + real(ids_real), pointer :: theta_straight_error_upper(:) => null() !Upper error for "theta_straight" + real(ids_real), pointer :: theta_straight_error_lower(:) => null() !Lower error for "theta_straight" + integer(ids_int) :: theta_straight_error_index=ids_int_invalid !Index in the error_description list for "theta_straight" + real(ids_real), pointer :: theta_geometric(:) => null() !Geometrical poloidal angle + real(ids_real), pointer :: theta_geometric_error_upper(:) => null() !Upper error for "theta_geometric" + real(ids_real), pointer :: theta_geometric_error_lower(:) => null() !Lower error for "theta_geometric" + integer(ids_int) :: theta_geometric_error_index=ids_int_invalid !Index in the error_description list for "theta_geometric" + real(ids_real), pointer :: rho_tor_norm(:) => null() !Normalised toroidal flux coordinate. The normalizing value for rho_tor_norm, is the toroidal flux coordinate at the equilibrium bo! + !undary (LCFS or 99.x % of the LCFS in case of a fixed boundary equilibium calculation) + real(ids_real), pointer :: rho_tor_norm_error_upper(:) => null() !Upper error for "rho_tor_norm" + real(ids_real), pointer :: rho_tor_norm_error_lower(:) => null() !Lower error for "rho_tor_norm" + integer(ids_int) :: rho_tor_norm_error_index=ids_int_invalid !Index in the error_description list for "rho_tor_norm" + real(ids_real), pointer :: rho_tor(:) => null() !Toroidal flux coordinate. The toroidal field used in its definition is indicated under vacuum_toroidal_field/b0 + real(ids_real), pointer :: rho_tor_error_upper(:) => null() !Upper error for "rho_tor" + real(ids_real), pointer :: rho_tor_error_lower(:) => null() !Lower error for "rho_tor" + integer(ids_int) :: rho_tor_error_index=ids_int_invalid !Index in the error_description list for "rho_tor" + real(ids_real), pointer :: psi(:) => null() !Poloidal magnetic flux + real(ids_real), pointer :: psi_error_upper(:) => null() !Upper error for "psi" + real(ids_real), pointer :: psi_error_lower(:) => null() !Lower error for "psi" + integer(ids_int) :: psi_error_index=ids_int_invalid !Index in the error_description list for "psi" + real(ids_real), pointer :: volume(:) => null() !Volume enclosed inside the magnetic surface + real(ids_real), pointer :: volume_error_upper(:) => null() !Upper error for "volume" + real(ids_real), pointer :: volume_error_lower(:) => null() !Lower error for "volume" + integer(ids_int) :: volume_error_index=ids_int_invalid !Index in the error_description list for "volume" + real(ids_real), pointer :: area(:) => null() !Cross-sectional area of the flux surface + real(ids_real), pointer :: area_error_upper(:) => null() !Upper error for "area" + real(ids_real), pointer :: area_error_lower(:) => null() !Lower error for "area" + integer(ids_int) :: area_error_index=ids_int_invalid !Index in the error_description list for "area" + end type + + type :: ids_distributions_d_profiles_2d_collisions_electrons + real(ids_real), pointer :: power_thermal(:,:) => null() !Collisional power density to the thermal particle population + real(ids_real), pointer :: power_thermal_error_upper(:,:) => null() !Upper error for "power_thermal" + real(ids_real), pointer :: power_thermal_error_lower(:,:) => null() !Lower error for "power_thermal" + integer(ids_int) :: power_thermal_error_index=ids_int_invalid !Index in the error_description list for "power_thermal" + real(ids_real), pointer :: power_fast(:,:) => null() !Collisional power density to the fast particle population + real(ids_real), pointer :: power_fast_error_upper(:,:) => null() !Upper error for "power_fast" + real(ids_real), pointer :: power_fast_error_lower(:,:) => null() !Lower error for "power_fast" + integer(ids_int) :: power_fast_error_index=ids_int_invalid !Index in the error_description list for "power_fast" + real(ids_real), pointer :: torque_thermal_tor(:,:) => null() !Collisional toroidal torque density to the thermal particle population + real(ids_real), pointer :: torque_thermal_tor_error_upper(:,:) => null() !Upper error for "torque_thermal_tor" + real(ids_real), pointer :: torque_thermal_tor_error_lower(:,:) => null() !Lower error for "torque_thermal_tor" + integer(ids_int) :: torque_thermal_tor_error_index=ids_int_invalid !Index in the error_description list for "torque_thermal_tor" + real(ids_real), pointer :: torque_fast_tor(:,:) => null() !Collisional toroidal torque density to the fast particle population + real(ids_real), pointer :: torque_fast_tor_error_upper(:,:) => null() !Upper error for "torque_fast_tor" + real(ids_real), pointer :: torque_fast_tor_error_lower(:,:) => null() !Lower error for "torque_fast_tor" + integer(ids_int) :: torque_fast_tor_error_index=ids_int_invalid !Index in the error_description list for "torque_fast_tor" + end type + + type :: ids_distributions_d_profiles_2d_collisions_ion_state + real(ids_real) :: z_min=ids_real_invalid !Minimum Z of the charge state bundle (z_min = z_max = 0 for a neutral) + real(ids_real) :: z_min_error_upper=ids_real_invalid !Upper error for "z_min" + real(ids_real) :: z_min_error_lower=ids_real_invalid !Lower error for "z_min" + integer(ids_int) :: z_min_error_index=ids_int_invalid !Index in the error_description list for "z_min" + real(ids_real) :: z_max=ids_real_invalid !Maximum Z of the charge state bundle (equal to z_min if no bundle) + real(ids_real) :: z_max_error_upper=ids_real_invalid !Upper error for "z_max" + real(ids_real) :: z_max_error_lower=ids_real_invalid !Lower error for "z_max" + integer(ids_int) :: z_max_error_index=ids_int_invalid !Index in the error_description list for "z_max" + character(len=ids_string_length), dimension(:), pointer :: label => null() !String identifying charge state (e.g. C+, C+2 , C+3, C+4, C+5, C+6, ...) + character(len=ids_string_length), dimension(:), pointer :: electron_configuration => null() !Configuration of atomic orbitals of this state, e.g. 1s2-2s1 + real(ids_real) :: vibrational_level=ids_real_invalid !Vibrational level (can be bundled) + real(ids_real) :: vibrational_level_error_upper=ids_real_invalid !Upper error for "vibrational_level" + real(ids_real) :: vibrational_level_error_lower=ids_real_invalid !Lower error for "vibrational_level" + integer(ids_int) :: vibrational_level_error_index=ids_int_invalid !Index in the error_description list for "vibrational_level" + character(len=ids_string_length), dimension(:), pointer :: vibrational_mode => null() !Vibrational mode of this state, e.g. "A_g". Need to define, or adopt a standard nomenclature. + real(ids_real), pointer :: power_thermal(:,:) => null() !Collisional power density to the thermal particle population + real(ids_real), pointer :: power_thermal_error_upper(:,:) => null() !Upper error for "power_thermal" + real(ids_real), pointer :: power_thermal_error_lower(:,:) => null() !Lower error for "power_thermal" + integer(ids_int) :: power_thermal_error_index=ids_int_invalid !Index in the error_description list for "power_thermal" + real(ids_real), pointer :: power_fast(:,:) => null() !Collisional power density to the fast particle population + real(ids_real), pointer :: power_fast_error_upper(:,:) => null() !Upper error for "power_fast" + real(ids_real), pointer :: power_fast_error_lower(:,:) => null() !Lower error for "power_fast" + integer(ids_int) :: power_fast_error_index=ids_int_invalid !Index in the error_description list for "power_fast" + real(ids_real), pointer :: torque_thermal_tor(:,:) => null() !Collisional toroidal torque density to the thermal particle population + real(ids_real), pointer :: torque_thermal_tor_error_upper(:,:) => null() !Upper error for "torque_thermal_tor" + real(ids_real), pointer :: torque_thermal_tor_error_lower(:,:) => null() !Lower error for "torque_thermal_tor" + integer(ids_int) :: torque_thermal_tor_error_index=ids_int_invalid !Index in the error_description list for "torque_thermal_tor" + real(ids_real), pointer :: torque_fast_tor(:,:) => null() !Collisional toroidal torque density to the fast particle population + real(ids_real), pointer :: torque_fast_tor_error_upper(:,:) => null() !Upper error for "torque_fast_tor" + real(ids_real), pointer :: torque_fast_tor_error_lower(:,:) => null() !Lower error for "torque_fast_tor" + integer(ids_int) :: torque_fast_tor_error_index=ids_int_invalid !Index in the error_description list for "torque_fast_tor" + end type + + type :: ids_distributions_d_profiles_2d_collisions_ion + type(ids_plasma_composition_neutral_element), pointer :: element(:) => null() !List of elements forming the atom or molecule + real(ids_real) :: z_ion=ids_real_invalid !Ion charge (of the dominant ionisation state; lumped ions are allowed). + real(ids_real) :: z_ion_error_upper=ids_real_invalid !Upper error for "z_ion" + real(ids_real) :: z_ion_error_lower=ids_real_invalid !Lower error for "z_ion" + integer(ids_int) :: z_ion_error_index=ids_int_invalid !Index in the error_description list for "z_ion" + character(len=ids_string_length), dimension(:), pointer :: label => null() !String identifying the species (e.g. H+, D+, T+, He+2, C+, D2, DT, CD4, ...) + integer(ids_int) :: neutral_index=ids_int_invalid !Index of the corresponding neutral species in the ../../neutral array + real(ids_real), pointer :: power_thermal(:,:) => null() !Collisional power density to the thermal particle population + real(ids_real), pointer :: power_thermal_error_upper(:,:) => null() !Upper error for "power_thermal" + real(ids_real), pointer :: power_thermal_error_lower(:,:) => null() !Lower error for "power_thermal" + integer(ids_int) :: power_thermal_error_index=ids_int_invalid !Index in the error_description list for "power_thermal" + real(ids_real), pointer :: power_fast(:,:) => null() !Collisional power density to the fast particle population + real(ids_real), pointer :: power_fast_error_upper(:,:) => null() !Upper error for "power_fast" + real(ids_real), pointer :: power_fast_error_lower(:,:) => null() !Lower error for "power_fast" + integer(ids_int) :: power_fast_error_index=ids_int_invalid !Index in the error_description list for "power_fast" + real(ids_real), pointer :: torque_thermal_tor(:,:) => null() !Collisional toroidal torque density to the thermal particle population + real(ids_real), pointer :: torque_thermal_tor_error_upper(:,:) => null() !Upper error for "torque_thermal_tor" + real(ids_real), pointer :: torque_thermal_tor_error_lower(:,:) => null() !Lower error for "torque_thermal_tor" + integer(ids_int) :: torque_thermal_tor_error_index=ids_int_invalid !Index in the error_description list for "torque_thermal_tor" + real(ids_real), pointer :: torque_fast_tor(:,:) => null() !Collisional toroidal torque density to the fast particle population + real(ids_real), pointer :: torque_fast_tor_error_upper(:,:) => null() !Upper error for "torque_fast_tor" + real(ids_real), pointer :: torque_fast_tor_error_lower(:,:) => null() !Lower error for "torque_fast_tor" + integer(ids_int) :: torque_fast_tor_error_index=ids_int_invalid !Index in the error_description list for "torque_fast_tor" + integer(ids_int) :: multiple_states_flag=ids_int_invalid !Multiple state calculation flag : 0-Only one state is considered; 1-Multiple states are considered and are described in the state ! + !structure + type(ids_distributions_d_profiles_2d_collisions_ion_state), pointer :: state(:) => null() !Collisional exchange with the various states of the ion species (ionisation, energy, excitation, ...) + end type + + type :: ids_distributions_d_profiles_2d_collisions + type(ids_distributions_d_profiles_2d_collisions_electrons) :: electrons !Collisional exchange with electrons + type(ids_distributions_d_profiles_2d_collisions_ion), pointer :: ion(:) => null() !Collisional exchange with the various ion species + end type + + type :: ids_distributions_d_profiles_2d_partial_collisions_electrons + real(ids_real), pointer :: power_thermal(:,:) => null() !Collisional power density to the thermal particle population + real(ids_real), pointer :: power_thermal_error_upper(:,:) => null() !Upper error for "power_thermal" + real(ids_real), pointer :: power_thermal_error_lower(:,:) => null() !Lower error for "power_thermal" + integer(ids_int) :: power_thermal_error_index=ids_int_invalid !Index in the error_description list for "power_thermal" + real(ids_real), pointer :: power_fast(:,:) => null() !Collisional power density to the fast particle population + real(ids_real), pointer :: power_fast_error_upper(:,:) => null() !Upper error for "power_fast" + real(ids_real), pointer :: power_fast_error_lower(:,:) => null() !Lower error for "power_fast" + integer(ids_int) :: power_fast_error_index=ids_int_invalid !Index in the error_description list for "power_fast" + real(ids_real), pointer :: torque_thermal_tor(:,:) => null() !Collisional toroidal torque density to the thermal particle population + real(ids_real), pointer :: torque_thermal_tor_error_upper(:,:) => null() !Upper error for "torque_thermal_tor" + real(ids_real), pointer :: torque_thermal_tor_error_lower(:,:) => null() !Lower error for "torque_thermal_tor" + integer(ids_int) :: torque_thermal_tor_error_index=ids_int_invalid !Index in the error_description list for "torque_thermal_tor" + real(ids_real), pointer :: torque_fast_tor(:,:) => null() !Collisional toroidal torque density to the fast particle population + real(ids_real), pointer :: torque_fast_tor_error_upper(:,:) => null() !Upper error for "torque_fast_tor" + real(ids_real), pointer :: torque_fast_tor_error_lower(:,:) => null() !Lower error for "torque_fast_tor" + integer(ids_int) :: torque_fast_tor_error_index=ids_int_invalid !Index in the error_description list for "torque_fast_tor" + end type + + type :: ids_distributions_d_profiles_2d_partial_collisions_ion_state + real(ids_real) :: z_min=ids_real_invalid !Minimum Z of the charge state bundle (z_min = z_max = 0 for a neutral) + real(ids_real) :: z_min_error_upper=ids_real_invalid !Upper error for "z_min" + real(ids_real) :: z_min_error_lower=ids_real_invalid !Lower error for "z_min" + integer(ids_int) :: z_min_error_index=ids_int_invalid !Index in the error_description list for "z_min" + real(ids_real) :: z_max=ids_real_invalid !Maximum Z of the charge state bundle (equal to z_min if no bundle) + real(ids_real) :: z_max_error_upper=ids_real_invalid !Upper error for "z_max" + real(ids_real) :: z_max_error_lower=ids_real_invalid !Lower error for "z_max" + integer(ids_int) :: z_max_error_index=ids_int_invalid !Index in the error_description list for "z_max" + character(len=ids_string_length), dimension(:), pointer :: label => null() !String identifying charge state (e.g. C+, C+2 , C+3, C+4, C+5, C+6, ...) + character(len=ids_string_length), dimension(:), pointer :: electron_configuration => null() !Configuration of atomic orbitals of this state, e.g. 1s2-2s1 + real(ids_real) :: vibrational_level=ids_real_invalid !Vibrational level (can be bundled) + real(ids_real) :: vibrational_level_error_upper=ids_real_invalid !Upper error for "vibrational_level" + real(ids_real) :: vibrational_level_error_lower=ids_real_invalid !Lower error for "vibrational_level" + integer(ids_int) :: vibrational_level_error_index=ids_int_invalid !Index in the error_description list for "vibrational_level" + character(len=ids_string_length), dimension(:), pointer :: vibrational_mode => null() !Vibrational mode of this state, e.g. "A_g". Need to define, or adopt a standard nomenclature. + real(ids_real), pointer :: power_thermal(:,:) => null() !Collisional power density to the thermal particle population + real(ids_real), pointer :: power_thermal_error_upper(:,:) => null() !Upper error for "power_thermal" + real(ids_real), pointer :: power_thermal_error_lower(:,:) => null() !Lower error for "power_thermal" + integer(ids_int) :: power_thermal_error_index=ids_int_invalid !Index in the error_description list for "power_thermal" + real(ids_real), pointer :: power_fast(:,:) => null() !Collisional power density to the fast particle population + real(ids_real), pointer :: power_fast_error_upper(:,:) => null() !Upper error for "power_fast" + real(ids_real), pointer :: power_fast_error_lower(:,:) => null() !Lower error for "power_fast" + integer(ids_int) :: power_fast_error_index=ids_int_invalid !Index in the error_description list for "power_fast" + real(ids_real), pointer :: torque_thermal_tor(:,:) => null() !Collisional toroidal torque density to the thermal particle population + real(ids_real), pointer :: torque_thermal_tor_error_upper(:,:) => null() !Upper error for "torque_thermal_tor" + real(ids_real), pointer :: torque_thermal_tor_error_lower(:,:) => null() !Lower error for "torque_thermal_tor" + integer(ids_int) :: torque_thermal_tor_error_index=ids_int_invalid !Index in the error_description list for "torque_thermal_tor" + real(ids_real), pointer :: torque_fast_tor(:,:) => null() !Collisional toroidal torque density to the fast particle population + real(ids_real), pointer :: torque_fast_tor_error_upper(:,:) => null() !Upper error for "torque_fast_tor" + real(ids_real), pointer :: torque_fast_tor_error_lower(:,:) => null() !Lower error for "torque_fast_tor" + integer(ids_int) :: torque_fast_tor_error_index=ids_int_invalid !Index in the error_description list for "torque_fast_tor" + end type + + type :: ids_distributions_d_profiles_2d_partial_collisions_ion + type(ids_plasma_composition_neutral_element), pointer :: element(:) => null() !List of elements forming the atom or molecule + real(ids_real) :: z_ion=ids_real_invalid !Ion charge (of the dominant ionisation state; lumped ions are allowed). + real(ids_real) :: z_ion_error_upper=ids_real_invalid !Upper error for "z_ion" + real(ids_real) :: z_ion_error_lower=ids_real_invalid !Lower error for "z_ion" + integer(ids_int) :: z_ion_error_index=ids_int_invalid !Index in the error_description list for "z_ion" + character(len=ids_string_length), dimension(:), pointer :: label => null() !String identifying the species (e.g. H+, D+, T+, He+2, C+, D2, DT, CD4, ...) + integer(ids_int) :: neutral_index=ids_int_invalid !Index of the corresponding neutral species in the ../../neutral array + real(ids_real), pointer :: power_thermal(:,:) => null() !Collisional power density to the thermal particle population + real(ids_real), pointer :: power_thermal_error_upper(:,:) => null() !Upper error for "power_thermal" + real(ids_real), pointer :: power_thermal_error_lower(:,:) => null() !Lower error for "power_thermal" + integer(ids_int) :: power_thermal_error_index=ids_int_invalid !Index in the error_description list for "power_thermal" + real(ids_real), pointer :: power_fast(:,:) => null() !Collisional power density to the fast particle population + real(ids_real), pointer :: power_fast_error_upper(:,:) => null() !Upper error for "power_fast" + real(ids_real), pointer :: power_fast_error_lower(:,:) => null() !Lower error for "power_fast" + integer(ids_int) :: power_fast_error_index=ids_int_invalid !Index in the error_description list for "power_fast" + real(ids_real), pointer :: torque_thermal_tor(:,:) => null() !Collisional toroidal torque density to the thermal particle population + real(ids_real), pointer :: torque_thermal_tor_error_upper(:,:) => null() !Upper error for "torque_thermal_tor" + real(ids_real), pointer :: torque_thermal_tor_error_lower(:,:) => null() !Lower error for "torque_thermal_tor" + integer(ids_int) :: torque_thermal_tor_error_index=ids_int_invalid !Index in the error_description list for "torque_thermal_tor" + real(ids_real), pointer :: torque_fast_tor(:,:) => null() !Collisional toroidal torque density to the fast particle population + real(ids_real), pointer :: torque_fast_tor_error_upper(:,:) => null() !Upper error for "torque_fast_tor" + real(ids_real), pointer :: torque_fast_tor_error_lower(:,:) => null() !Lower error for "torque_fast_tor" + integer(ids_int) :: torque_fast_tor_error_index=ids_int_invalid !Index in the error_description list for "torque_fast_tor" + integer(ids_int) :: multiple_states_flag=ids_int_invalid !Multiple state calculation flag : 0-Only one state is considered; 1-Multiple states are considered and are described in the state ! + !structure + type(ids_distributions_d_profiles_2d_partial_collisions_ion_state), pointer :: state(:) => null() !Collisional exchange with the various states of the ion species (ionisation, energy, excitation, ...) + end type + + type :: ids_distributions_d_profiles_2d_partial_collisions + type(ids_distributions_d_profiles_2d_partial_collisions_electrons) :: electrons !Collisional exchange with electrons + type(ids_distributions_d_profiles_2d_partial_collisions_ion), pointer :: ion(:) => null() !Collisional exchange with the various ion species + end type + + type :: ids_distributions_d_profiles_2d_partial + real(ids_real), pointer :: density(:,:) => null() !Density (thermal+non-thermal) + real(ids_real), pointer :: density_error_upper(:,:) => null() !Upper error for "density" + real(ids_real), pointer :: density_error_lower(:,:) => null() !Lower error for "density" + integer(ids_int) :: density_error_index=ids_int_invalid !Index in the error_description list for "density" + real(ids_real), pointer :: density_fast(:,:) => null() !Density of fast particles + real(ids_real), pointer :: density_fast_error_upper(:,:) => null() !Upper error for "density_fast" + real(ids_real), pointer :: density_fast_error_lower(:,:) => null() !Lower error for "density_fast" + integer(ids_int) :: density_fast_error_index=ids_int_invalid !Index in the error_description list for "density_fast" + real(ids_real), pointer :: pressure(:,:) => null() !Pressure (thermal+non-thermal) + real(ids_real), pointer :: pressure_error_upper(:,:) => null() !Upper error for "pressure" + real(ids_real), pointer :: pressure_error_lower(:,:) => null() !Lower error for "pressure" + integer(ids_int) :: pressure_error_index=ids_int_invalid !Index in the error_description list for "pressure" + real(ids_real), pointer :: pressure_fast(:,:) => null() !Pressure of fast particles + real(ids_real), pointer :: pressure_fast_error_upper(:,:) => null() !Upper error for "pressure_fast" + real(ids_real), pointer :: pressure_fast_error_lower(:,:) => null() !Lower error for "pressure_fast" + integer(ids_int) :: pressure_fast_error_index=ids_int_invalid !Index in the error_description list for "pressure_fast" + real(ids_real), pointer :: pressure_fast_parallel(:,:) => null() !Pressure of fast particles in the parallel direction + real(ids_real), pointer :: pressure_fast_parallel_error_upper(:,:) => null() !Upper error for "pressure_fast_parallel" + real(ids_real), pointer :: pressure_fast_parallel_error_lower(:,:) => null() !Lower error for "pressure_fast_parallel" + integer(ids_int) :: pressure_fast_parallel_error_index=ids_int_invalid !Index in the error_description list for "pressure_fast_parallel" + real(ids_real), pointer :: current_tor(:,:) => null() !Total toroidal driven current density (including electron and thermal ion back-current, or drag-current) + real(ids_real), pointer :: current_tor_error_upper(:,:) => null() !Upper error for "current_tor" + real(ids_real), pointer :: current_tor_error_lower(:,:) => null() !Lower error for "current_tor" + integer(ids_int) :: current_tor_error_index=ids_int_invalid !Index in the error_description list for "current_tor" + real(ids_real), pointer :: current_fast_tor(:,:) => null() !Total toroidal driven current density of fast (non-thermal) particles (excluding electron and thermal ion back-current, or drag-cu! + !rrent) + real(ids_real), pointer :: current_fast_tor_error_upper(:,:) => null() !Upper error for "current_fast_tor" + real(ids_real), pointer :: current_fast_tor_error_lower(:,:) => null() !Lower error for "current_fast_tor" + integer(ids_int) :: current_fast_tor_error_index=ids_int_invalid !Index in the error_description list for "current_fast_tor" + real(ids_real), pointer :: torque_tor_j_radial(:,:) => null() !Toroidal torque due to radial currents + real(ids_real), pointer :: torque_tor_j_radial_error_upper(:,:) => null() !Upper error for "torque_tor_j_radial" + real(ids_real), pointer :: torque_tor_j_radial_error_lower(:,:) => null() !Lower error for "torque_tor_j_radial" + integer(ids_int) :: torque_tor_j_radial_error_index=ids_int_invalid !Index in the error_description list for "torque_tor_j_radial" + type(ids_distributions_d_profiles_2d_partial_collisions) :: collisions !Power and torque exchanged between the species described by the distribution and the different plasma species through collisions + end type + + type :: ids_distributions_d_profiles_2d + type(ids_distributions_d_profiles_2d_grid) :: grid !Grid. The grid has to be rectangular in a pair of coordinates, as specified in type + real(ids_real), pointer :: density(:,:) => null() !Density (thermal+non-thermal) + real(ids_real), pointer :: density_error_upper(:,:) => null() !Upper error for "density" + real(ids_real), pointer :: density_error_lower(:,:) => null() !Lower error for "density" + integer(ids_int) :: density_error_index=ids_int_invalid !Index in the error_description list for "density" + real(ids_real), pointer :: density_fast(:,:) => null() !Density of fast particles + real(ids_real), pointer :: density_fast_error_upper(:,:) => null() !Upper error for "density_fast" + real(ids_real), pointer :: density_fast_error_lower(:,:) => null() !Lower error for "density_fast" + integer(ids_int) :: density_fast_error_index=ids_int_invalid !Index in the error_description list for "density_fast" + real(ids_real), pointer :: pressure(:,:) => null() !Pressure (thermal+non-thermal) + real(ids_real), pointer :: pressure_error_upper(:,:) => null() !Upper error for "pressure" + real(ids_real), pointer :: pressure_error_lower(:,:) => null() !Lower error for "pressure" + integer(ids_int) :: pressure_error_index=ids_int_invalid !Index in the error_description list for "pressure" + real(ids_real), pointer :: pressure_fast(:,:) => null() !Pressure of fast particles + real(ids_real), pointer :: pressure_fast_error_upper(:,:) => null() !Upper error for "pressure_fast" + real(ids_real), pointer :: pressure_fast_error_lower(:,:) => null() !Lower error for "pressure_fast" + integer(ids_int) :: pressure_fast_error_index=ids_int_invalid !Index in the error_description list for "pressure_fast" + real(ids_real), pointer :: pressure_fast_parallel(:,:) => null() !Pressure of fast particles in the parallel direction + real(ids_real), pointer :: pressure_fast_parallel_error_upper(:,:) => null() !Upper error for "pressure_fast_parallel" + real(ids_real), pointer :: pressure_fast_parallel_error_lower(:,:) => null() !Lower error for "pressure_fast_parallel" + integer(ids_int) :: pressure_fast_parallel_error_index=ids_int_invalid !Index in the error_description list for "pressure_fast_parallel" + real(ids_real), pointer :: current_tor(:,:) => null() !Total toroidal driven current density (including electron and thermal ion back-current, or drag-current) + real(ids_real), pointer :: current_tor_error_upper(:,:) => null() !Upper error for "current_tor" + real(ids_real), pointer :: current_tor_error_lower(:,:) => null() !Lower error for "current_tor" + integer(ids_int) :: current_tor_error_index=ids_int_invalid !Index in the error_description list for "current_tor" + real(ids_real), pointer :: current_fast_tor(:,:) => null() !Total toroidal driven current density of fast (non-thermal) particles (excluding electron and thermal ion back-current, or drag-cu! + !rrent) + real(ids_real), pointer :: current_fast_tor_error_upper(:,:) => null() !Upper error for "current_fast_tor" + real(ids_real), pointer :: current_fast_tor_error_lower(:,:) => null() !Lower error for "current_fast_tor" + integer(ids_int) :: current_fast_tor_error_index=ids_int_invalid !Index in the error_description list for "current_fast_tor" + real(ids_real), pointer :: torque_tor_j_radial(:,:) => null() !Toroidal torque due to radial currents + real(ids_real), pointer :: torque_tor_j_radial_error_upper(:,:) => null() !Upper error for "torque_tor_j_radial" + real(ids_real), pointer :: torque_tor_j_radial_error_lower(:,:) => null() !Lower error for "torque_tor_j_radial" + integer(ids_int) :: torque_tor_j_radial_error_index=ids_int_invalid !Index in the error_description list for "torque_tor_j_radial" + type(ids_distributions_d_profiles_2d_collisions) :: collisions !Power and torque exchanged between the species described by the distribution and the different plasma species through collisions + type(ids_distributions_d_profiles_2d_partial) :: trapped !Flux surface averaged profile evaluated using the trapped particle part of the distribution. + type(ids_distributions_d_profiles_2d_partial) :: co_passing !Flux surface averaged profile evaluated using the co-passing particle part of the distribution. + type(ids_distributions_d_profiles_2d_partial) :: counter_passing !Flux surface averaged profile evaluated using the counter-passing particle part of the distribution. + real(ids_real) :: time=ids_real_invalid !Time + end type + + type :: ids_distributions_d_ggd_expansion + type(ids_generic_grid_scalar), pointer :: grid_subset(:) => null() !Values of the distribution function expansion, for various grid subsets + end type + + type :: ids_distributions_d_ggd + type(ids_generic_grid_dynamic) :: grid !Grid description + real(ids_real), pointer :: temperature(:) => null() !Reference temperature profile used to define the local thermal energy and the thermal velocity (for normalisation of the grid coor! + !dinates) + real(ids_real), pointer :: temperature_error_upper(:) => null() !Upper error for "temperature" + real(ids_real), pointer :: temperature_error_lower(:) => null() !Lower error for "temperature" + integer(ids_int) :: temperature_error_index=ids_int_invalid !Index in the error_description list for "temperature" + type(ids_distributions_d_ggd_expansion), pointer :: expansion(:) => null() !Distribution function expanded into a vector of successive approximations. The first element in the vector (expansion(1)) is the z! + !eroth order distribution function, while the K:th element in the vector (expansion(K)) is the K:th correction, such that the total! + ! distribution function is a sum over all elements in the expansion vector. + type(ids_distributions_d_ggd_expansion), pointer :: expansion_fd3v(:) => null() !Distribution function multiplied by the volume of the local velocity cell d3v, expanded into a vector of successive approximations! + !. The first element in the vector (expansion(1)) is the zeroth order distribution function, while the K:th element in the vector (! + !expansion(K)) is the K:th correction, such that the total distribution function is a sum over all elements in the expansion vector! + !. + real(ids_real) :: time=ids_real_invalid !Time + end type + + type :: ids_distributions_d + type(ids_waves_coherent_wave_identifier), pointer :: wave(:) => null() !List all waves affecting the distribution, identified as in waves/coherent_wave(i)/identifier in the waves IDS + type(ids_distribution_process_identifier), pointer :: process(:) => null() !List all processes (NBI units, fusion reactions, ...) affecting the distribution, identified as in distribution_sources/source(i)/! + !process in the DISTRIBUTION_SOURCES IDS + integer(ids_int) :: gyro_type=ids_int_invalid !Defines how to interpret the spatial coordinates: 1 = given at the actual particle birth point; 2 =given at the gyro centre of the! + ! birth point + type(ids_distribution_species) :: species !Species described by this distribution + type(ids_distributions_d_global_quantities), pointer :: global_quantities(:) => null() !Global quantities (integrated over plasma volume for moments of the distribution, collisional exchange and source terms), for vari! + !ous time slices + type(ids_distributions_d_profiles_1d), pointer :: profiles_1d(:) => null() !Radial profiles (flux surface averaged quantities) for various time slices + type(ids_distributions_d_profiles_2d), pointer :: profiles_2d(:) => null() !2D profiles in the poloidal plane for various time slices + integer(ids_int) :: is_delta_f=ids_int_invalid !If is_delta_f=1, then the distribution represents the deviation from a Maxwellian; is_delta_f=0, then the distribution represents ! + !all particles, i.e. the full-f solution + type(ids_distributions_d_ggd), pointer :: ggd(:) => null() !Distribution represented using the ggd, for various time slices + type(ids_distribution_markers), pointer :: markers(:) => null() !Distribution represented by a set of markers (test particles) + end type + + + ! *********** distributions IDS + type, extends(IDS_base) :: ids_distributions !Distribution function(s) of one or many particle species. This structure is specifically designed to handle non-Maxwellian distrib! + !ution function generated during heating and current drive, typically solved using a Fokker-Planck calculation perturbed by a heati! + !ng scheme (e.g. IC, EC, LH, NBI, or alpha heating) and then relaxed by Coloumb collisions. + logical, private :: c_data = .FALSE. ! Fortran specific metadata telling whether the IDS has been populated from C allocated data (LL) or not + integer, private :: max_occurrence = 8! Maximum occurrence allowed as defined in the DD + + type(ids_ids_properties) :: ids_properties !Interface Data Structure properties. This element identifies the node above as an IDS + type(ids_distributions_d), pointer :: distribution(:) => null() !Set of distribution functions. Every distribution function has to be associated with only one particle species, specified in distr! + !i_vec/species/, but there could be multiple distribution function for each species. In this case, the fast particle populations sh! + !ould be superposed + type(ids_b_tor_vacuum_1) :: vacuum_toroidal_field !Characteristics of the vacuum toroidal field (used in rho_tor definition and in the normalization of current densities) + type(ids_rz1d_dynamic_1) :: magnetic_axis !Magnetic axis position (used to define a poloidal angle for the 2D profiles) + type(ids_code) :: code !Generic decription of the code-specific parameters for the code that has produced this IDS + real(ids_real), pointer :: time(:) => null() !Generic time + end type + + ! *********** divertors IDS internal structures declaration + + type :: ids_divertor_target_two_point_model + real(ids_real) :: t_e_target=ids_real_invalid !Electron temperature at divertor target + real(ids_real) :: t_e_target_error_upper=ids_real_invalid !Upper error for "t_e_target" + real(ids_real) :: t_e_target_error_lower=ids_real_invalid !Lower error for "t_e_target" + integer(ids_int) :: t_e_target_error_index=ids_int_invalid !Index in the error_description list for "t_e_target" + real(ids_real) :: n_e_target=ids_real_invalid !Electron density at divertor target + real(ids_real) :: n_e_target_error_upper=ids_real_invalid !Upper error for "n_e_target" + real(ids_real) :: n_e_target_error_lower=ids_real_invalid !Lower error for "n_e_target" + integer(ids_int) :: n_e_target_error_index=ids_int_invalid !Index in the error_description list for "n_e_target" + real(ids_real) :: sol_heat_decay_length=ids_real_invalid !Heat flux decay length in SOL at divertor entrance, mapped to the mid-plane, this is the lambda_q parameter defined in reference T! + !. Eich et al, Nucl. Fusion 53 (2013) 093031 + real(ids_real) :: sol_heat_decay_length_error_upper=ids_real_invalid !Upper error for "sol_heat_decay_length" + real(ids_real) :: sol_heat_decay_length_error_lower=ids_real_invalid !Lower error for "sol_heat_decay_length" + integer(ids_int) :: sol_heat_decay_length_error_index=ids_int_invalid !Index in the error_description list for "sol_heat_decay_length" + real(ids_real) :: sol_heat_spreading_length=ids_real_invalid !Heat flux spreading length in SOL at equatorial mid-plane, this is the S power spreading parameter defined in reference T. Eich et! + ! al, Nucl. Fusion 53 (2013) 093031. Relevant only for attached plasmas. + real(ids_real) :: sol_heat_spreading_length_error_upper=ids_real_invalid !Upper error for "sol_heat_spreading_length" + real(ids_real) :: sol_heat_spreading_length_error_lower=ids_real_invalid !Lower error for "sol_heat_spreading_length" + integer(ids_int) :: sol_heat_spreading_length_error_index=ids_int_invalid !Index in the error_description list for "sol_heat_spreading_length" + real(ids_real) :: time=ids_real_invalid !Time + end type + + type :: ids_divertor_target_tile + character(len=ids_string_length), dimension(:), pointer :: name => null() !Name of the tile + character(len=ids_string_length), dimension(:), pointer :: identifier => null() !Alphanumeric identifier of tile + type(ids_rzphi1d_static) :: surface_outline !Outline of the tile surface facing the plasma + real(ids_real) :: surface_area=ids_real_invalid !Area of the tile surface facing the plasma + real(ids_real) :: surface_area_error_upper=ids_real_invalid !Upper error for "surface_area" + real(ids_real) :: surface_area_error_lower=ids_real_invalid !Lower error for "surface_area" + integer(ids_int) :: surface_area_error_index=ids_int_invalid !Index in the error_description list for "surface_area" + type(ids_signal_flt_1d) :: current_incident !Total current incident on this tile + integer(ids_int) :: shunt_index=ids_int_invalid !If the tile carries a measurement shunt, index of that shunt (in the magnetics IDS shunt array) + end type + + type :: ids_divertor_target + character(len=ids_string_length), dimension(:), pointer :: name => null() !Name of the target + character(len=ids_string_length), dimension(:), pointer :: identifier => null() !Alphanumeric identifier of target + real(ids_real) :: heat_flux_steady_limit_max=ids_real_invalid !Maximum steady state heat flux allowed on divertor target surface (engineering design limit) + real(ids_real) :: temperature_limit_max=ids_real_invalid !Maximum surface target temperature allowed to prevent damage (melting, recrystallization, sublimation, etc...) + real(ids_real) :: t_e_target_sputtering_limit_max=ids_real_invalid !Maximum plasma temperature allowed on the divertor target to avoid excessive sputtering + type(ids_signal_flt_1d) :: power_flux_peak !Peak power flux on the divertor target surface + type(ids_signal_flt_1d) :: flux_expansion !Magnetic flux expansion as defined by Stangeby : ratio between the poloidal field at the midplane separatrix and the poloidal fiel! + !d at the strike-point see formula attached, where u means upstream (midplane separatrix) and t means at divertor target (downstrea! + !m). + type(ids_divertor_target_two_point_model), pointer :: two_point_model(:) => null() !Description of SOL according to the two point model, the downstream point being on this target, for various time slices + type(ids_signal_flt_1d) :: tilt_angle_pol !Angle between field lines projected in poloidal plane and target, measured clockwise from the target to the projected field lines + real(ids_real) :: extension_r=ids_real_invalid !Target length projected on the major radius axis + real(ids_real) :: extension_r_error_upper=ids_real_invalid !Upper error for "extension_r" + real(ids_real) :: extension_r_error_lower=ids_real_invalid !Lower error for "extension_r" + integer(ids_int) :: extension_r_error_index=ids_int_invalid !Index in the error_description list for "extension_r" + real(ids_real) :: extension_z=ids_real_invalid !Target length projected on the height axis + real(ids_real) :: extension_z_error_upper=ids_real_invalid !Upper error for "extension_z" + real(ids_real) :: extension_z_error_lower=ids_real_invalid !Lower error for "extension_z" + integer(ids_int) :: extension_z_error_index=ids_int_invalid !Index in the error_description list for "extension_z" + type(ids_signal_flt_1d) :: wetted_area !Wetted area of the target, defined by the SOL heat flux decay length (lambda_q) mapped to the target using flux expansion and spre! + !ading factor and the target toroidal circumference. In other words, this is the area getting heat flux from the maximum value down! + ! to one e-fold decay. + type(ids_signal_flt_1d) :: power_incident_fraction !Power fraction incident on the target (normalized to the total power incident on the divertor) + type(ids_signal_flt_1d) :: power_incident !Total power incident on this target. This power is split in the various physical categories listed below + type(ids_signal_flt_1d) :: power_conducted !Power conducted by the plasma on this divertor target + type(ids_signal_flt_1d) :: power_convected !Power convected by the plasma on this divertor target + type(ids_signal_flt_1d) :: power_radiated !Net radiated power on this divertor target (incident - reflected) + type(ids_signal_flt_1d) :: power_black_body !Black body radiated power emitted from this divertor target (emissivity is included) + type(ids_signal_flt_1d) :: power_neutrals !Net power from neutrals on this divertor target (positive means power is deposited on the target) + type(ids_signal_flt_1d) :: power_recombination_plasma !Power deposited on this divertor target due to recombination of plasma ions + type(ids_signal_flt_1d) :: power_recombination_neutrals !Power deposited on this divertor target due to recombination of neutrals into a ground state (e.g. molecules) + type(ids_signal_flt_1d) :: power_currents !Power deposited on this divertor target due to electric currents (positive means power is deposited on the target) + type(ids_signal_flt_1d) :: current_incident !Total current incident on this target + type(ids_divertor_target_tile), pointer :: tile(:) => null() !Set of divertor tiles belonging to this target + end type + + type :: ids_divertor + character(len=ids_string_length), dimension(:), pointer :: name => null() !Name of the divertor + character(len=ids_string_length), dimension(:), pointer :: identifier => null() !Alphanumeric identifier of divertor + type(ids_divertor_target), pointer :: target(:) => null() !Set of divertor targets + type(ids_signal_flt_1d) :: wetted_area !Wetted area of the divertor (sum over all targets) + type(ids_signal_flt_1d) :: power_incident !Total power incident on the divertor (sum over all targets). This power is split in the various physical categories listed below + type(ids_signal_flt_1d) :: power_conducted !Power conducted by the plasma on the divertor targets (sum over all targets) + type(ids_signal_flt_1d) :: power_convected !Power convected by the plasma on the divertor targets (sum over all targets) + type(ids_signal_flt_1d) :: power_radiated !Net radiated power on the divertor targets (incident - reflected) (sum over all targets) + type(ids_signal_flt_1d) :: power_black_body !Black body radiated power emitted from the divertor targets (emissivity is included) (sum over all targets) + type(ids_signal_flt_1d) :: power_neutrals !Net power from neutrals on the divertor targets (positive means power is deposited on the target) (sum over all targets) + type(ids_signal_flt_1d) :: power_recombination_plasma !Power deposited on the divertor targets due to recombination of plasma ions (sum over all targets) + type(ids_signal_flt_1d) :: power_recombination_neutrals !Power deposited on the divertor targets due to recombination of neutrals into a ground state (e.g. molecules) (sum over all target! + !s) + type(ids_signal_flt_1d) :: power_currents !Power deposited on the divertor targets due to electric currents (positive means power is deposited on the target) (sum over all t! + !argets) + type(ids_signal_flt_1d) :: particle_flux_recycled_total !Total recycled particle flux from the divertor (in equivalent electrons) + type(ids_signal_flt_1d) :: current_incident !Total current incident on this divertor + end type + + + ! *********** divertors IDS + type, extends(IDS_base) :: ids_divertors !Description of divertors + logical, private :: c_data = .FALSE. ! Fortran specific metadata telling whether the IDS has been populated from C allocated data (LL) or not + integer, private :: max_occurrence = 2! Maximum occurrence allowed as defined in the DD + + type(ids_ids_properties) :: ids_properties !Interface Data Structure properties. This element identifies the node above as an IDS + type(ids_identifier_static) :: midplane !Choice of midplane definition (use the lowest index number if more than one value is relevant) + type(ids_divertor), pointer :: divertor(:) => null() !Set of divertors + type(ids_code) :: code !Generic decription of the code-specific parameters for the code that has produced this IDS + real(ids_real), pointer :: time(:) => null() !Generic time + end type + + ! *********** ec_launchers IDS internal structures declaration + + type :: ids_ec_launchers_launching_position + real(ids_real), pointer :: r(:) => null() !Major radius + real(ids_real), pointer :: r_error_upper(:) => null() !Upper error for "r" + real(ids_real), pointer :: r_error_lower(:) => null() !Lower error for "r" + integer(ids_int) :: r_error_index=ids_int_invalid !Index in the error_description list for "r" + real(ids_real) :: r_limit_min=ids_real_invalid !Major radius lower limit for the system + real(ids_real) :: r_limit_max=ids_real_invalid !Major radius upper limit for the system + real(ids_real), pointer :: z(:) => null() !Height + real(ids_real), pointer :: z_error_upper(:) => null() !Upper error for "z" + real(ids_real), pointer :: z_error_lower(:) => null() !Lower error for "z" + integer(ids_int) :: z_error_index=ids_int_invalid !Index in the error_description list for "z" + real(ids_real), pointer :: phi(:) => null() !Toroidal angle + real(ids_real), pointer :: phi_error_upper(:) => null() !Upper error for "phi" + real(ids_real), pointer :: phi_error_lower(:) => null() !Lower error for "phi" + integer(ids_int) :: phi_error_index=ids_int_invalid !Index in the error_description list for "phi" + end type + + type :: ids_ec_launchers_beam_spot + real(ids_real), pointer :: size(:,:) => null() !Size of the spot ellipse + real(ids_real), pointer :: size_error_upper(:,:) => null() !Upper error for "size" + real(ids_real), pointer :: size_error_lower(:,:) => null() !Lower error for "size" + integer(ids_int) :: size_error_index=ids_int_invalid !Index in the error_description list for "size" + real(ids_real), pointer :: angle(:) => null() !Rotation angle for the spot ellipse + real(ids_real), pointer :: angle_error_upper(:) => null() !Upper error for "angle" + real(ids_real), pointer :: angle_error_lower(:) => null() !Lower error for "angle" + integer(ids_int) :: angle_error_index=ids_int_invalid !Index in the error_description list for "angle" + end type + + type :: ids_ec_launchers_beam_phase + real(ids_real), pointer :: curvature(:,:) => null() !Inverse curvature radii for the phase ellipse, positive/negative for divergent/convergent beams + real(ids_real), pointer :: curvature_error_upper(:,:) => null() !Upper error for "curvature" + real(ids_real), pointer :: curvature_error_lower(:,:) => null() !Lower error for "curvature" + integer(ids_int) :: curvature_error_index=ids_int_invalid !Index in the error_description list for "curvature" + real(ids_real), pointer :: angle(:) => null() !Rotation angle for the phase ellipse + real(ids_real), pointer :: angle_error_upper(:) => null() !Upper error for "angle" + real(ids_real), pointer :: angle_error_lower(:) => null() !Lower error for "angle" + integer(ids_int) :: angle_error_index=ids_int_invalid !Index in the error_description list for "angle" + end type + + type :: ids_ec_launchers_beam + character(len=ids_string_length), dimension(:), pointer :: name => null() !Beam name + character(len=ids_string_length), dimension(:), pointer :: identifier => null() !Beam identifier + type(ids_signal_flt_1d) :: frequency !Frequency + type(ids_signal_flt_1d) :: power_launched !Beam power launched into the vacuum vessel + integer(ids_int) :: mode=ids_int_invalid !Identifier for the main plasma wave mode excited by the EC beam. For the ordinary mode (O-mode), mode=1. For the extraordinary mod! + !e (X-mode), mode=-1 + type(ids_ec_launchers_launching_position) :: launching_position !Launching position of the beam + real(ids_real), pointer :: steering_angle_pol(:) => null() !Steering angle of the EC beam in the R,Z plane (from the -R axis towards the -Z axis), angle_pol=atan2(-k_Z,-k_R), where k_Z and k! + !_R are the Z and R components of the mean wave vector in the EC beam + real(ids_real), pointer :: steering_angle_pol_error_upper(:) => null() !Upper error for "steering_angle_pol" + real(ids_real), pointer :: steering_angle_pol_error_lower(:) => null() !Lower error for "steering_angle_pol" + integer(ids_int) :: steering_angle_pol_error_index=ids_int_invalid !Index in the error_description list for "steering_angle_pol" + real(ids_real), pointer :: steering_angle_tor(:) => null() !Steering angle of the EC beam away from the poloidal plane that is increasing towards the positive phi axis, angle_tor=arcsin(k_ph! + !i/k), where k_phi is the component of the wave vector in the phi direction and k is the length of the wave vector. Here the term w! + !ave vector refers to the mean wave vector in the EC beam + real(ids_real), pointer :: steering_angle_tor_error_upper(:) => null() !Upper error for "steering_angle_tor" + real(ids_real), pointer :: steering_angle_tor_error_lower(:) => null() !Lower error for "steering_angle_tor" + integer(ids_int) :: steering_angle_tor_error_index=ids_int_invalid !Index in the error_description list for "steering_angle_tor" + type(ids_ec_launchers_beam_spot) :: spot !Spot ellipse characteristics + type(ids_ec_launchers_beam_phase) :: phase !Phase ellipse characteristics + real(ids_real), pointer :: time(:) => null() !Time base used for position, angle, spot and phase quantities + end type + + + ! *********** ec_launchers IDS + type, extends(IDS_base) :: ids_ec_launchers !Launchers for heating and current drive in the electron cyclotron (EC) frequencies. + logical, private :: c_data = .FALSE. ! Fortran specific metadata telling whether the IDS has been populated from C allocated data (LL) or not + integer, private :: max_occurrence = 2! Maximum occurrence allowed as defined in the DD + + type(ids_ids_properties) :: ids_properties !Interface Data Structure properties. This element identifies the node above as an IDS + type(ids_ec_launchers_beam), pointer :: beam(:) => null() !Set of Electron Cyclotron beams + real(ids_real) :: latency=ids_real_invalid !Upper bound of the delay between input command received from the RT network and actuator starting to react. Applies globally to th! + !e system described by this IDS unless specific latencies (e.g. channel-specific or antenna-specific) are provided at a deeper leve! + !l in the IDS structure. + real(ids_real) :: latency_error_upper=ids_real_invalid !Upper error for "latency" + real(ids_real) :: latency_error_lower=ids_real_invalid !Lower error for "latency" + integer(ids_int) :: latency_error_index=ids_int_invalid !Index in the error_description list for "latency" + type(ids_code) :: code !Generic decription of the code-specific parameters for the code that has produced this IDS + real(ids_real), pointer :: time(:) => null() !Generic time + end type + + ! *********** ece IDS internal structures declaration + + type :: ids_ece_channel_beam_spot + type(ids_signal_flt_2d) :: size !Size of the spot ellipse + type(ids_signal_flt_1d) :: angle !Rotation angle for the spot ellipse + end type + + type :: ids_ece_channel_beam_phase + type(ids_signal_flt_2d) :: curvature !Inverse curvature radii for the phase ellipse, positive/negative for divergent/convergent beams + type(ids_signal_flt_1d) :: angle !Rotation angle for the phase ellipse + end type + + type :: ids_ece_channel_beam + type(ids_ece_channel_beam_spot) :: spot !Spot ellipse characteristics + type(ids_ece_channel_beam_phase) :: phase !Phase ellipse characteristics + end type + + type :: ids_ece_channel + character(len=ids_string_length), dimension(:), pointer :: name => null() !Name of the channel + character(len=ids_string_length), dimension(:), pointer :: identifier => null() !ID of the channel + type(ids_physical_quantity_flt_1d_time_1) :: frequency !Frequency of the channel + type(ids_physical_quantity_flt_1d_time_1) :: harmonic !Harmonic detected by the channel. 1 corresponds to the "O1" mode, while 2 corresponds to the "X2" mode. + real(ids_real) :: if_bandwidth=ids_real_invalid !Full-width of the Intermediate Frequency (IF) bandpass filter + real(ids_real) :: if_bandwidth_error_upper=ids_real_invalid !Upper error for "if_bandwidth" + real(ids_real) :: if_bandwidth_error_lower=ids_real_invalid !Lower error for "if_bandwidth" + integer(ids_int) :: if_bandwidth_error_index=ids_int_invalid !Index in the error_description list for "if_bandwidth" + type(ids_rzphirhopsitheta1d_dynamic_aos1_common_time_1) :: position !Position of the measurements (taking into account the suprathermal shift) + type(ids_rzphirhopsitheta1d_dynamic_aos1_common_time_1) :: delta_position_suprathermal !Simple estimate of the difference in position induced by the presence of suprathermal electrons. Position without corrections = po! + !sition - delta_position_suprathermal + type(ids_physical_quantity_flt_1d_time_1) :: t_e !Electron temperature + type(ids_signal_flt_1d_validity) :: t_e_voltage !Raw voltage measured on each channel, from which the calibrated temperature data is then derived + type(ids_physical_quantity_flt_1d_time_1) :: optical_depth !Optical depth of the plasma at the position of the measurement. This parameter is a proxy for the local / non-local character of t! + !he ECE emission. It must be greater than 1 to guarantee that the measurement is dominated by local ECE emission (non-local otherwi! + !se) + real(ids_real), pointer :: time(:) => null() !Timebase for the processed dynamic data of this channel (outside of the beam structure) + type(ids_ece_channel_beam) :: beam !ECE Gaussian optics parameters taken at the line_of_sight/first_point position (for synthetic modelling of the ECE emission) + end type + + + ! *********** ece IDS + type, extends(IDS_base) :: ids_ece !Electron cyclotron emission diagnostic + logical, private :: c_data = .FALSE. ! Fortran specific metadata telling whether the IDS has been populated from C allocated data (LL) or not + integer, private :: max_occurrence = 3! Maximum occurrence allowed as defined in the DD + + type(ids_ids_properties) :: ids_properties !Interface Data Structure properties. This element identifies the node above as an IDS + type(ids_line_of_sight_2points) :: line_of_sight !Description of the line of sight of the diagnostic (valid for all channels), defined by two points. By convention, the first point! + ! is the closest to the diagnostic + type(ids_signal_flt_1d_validity_position) :: t_e_central !Electron temperature from the closest channel to the magnetic axis, together with its radial location + type(ids_ece_channel), pointer :: channel(:) => null() !Set of channels (frequency) + type(ids_polarizer), pointer :: polarizer(:) => null() !Set of polarizers placed in front of the diagnostic (if any). Polarizers are assumed to be orthogonal to the line of sight, so tha! + !t the x3 unit vector is aligned with the line of sight + type(ids_psi_normalization) :: psi_normalization !Quantities to use to normalize psi, as a function of time + real(ids_real) :: latency=ids_real_invalid !Upper bound of the delay between physical information received by the detector and data available on the real-time (RT) network. + real(ids_real) :: latency_error_upper=ids_real_invalid !Upper error for "latency" + real(ids_real) :: latency_error_lower=ids_real_invalid !Lower error for "latency" + integer(ids_int) :: latency_error_index=ids_int_invalid !Index in the error_description list for "latency" + type(ids_code) :: code !Generic decription of the code-specific parameters for the code that has produced this IDS + real(ids_real), pointer :: time(:) => null() !Generic time + end type + + ! *********** edge_profiles IDS internal structures declaration + + type :: ids_edge_radial_grid + real(ids_real), pointer :: rho_pol_norm(:) => null() !Normalised poloidal flux coordinate = sqrt((psi(rho)-psi(magnetic_axis) / (psi(LCFS)-psi(magnetic_axis))) + real(ids_real), pointer :: rho_pol_norm_error_upper(:) => null() !Upper error for "rho_pol_norm" + real(ids_real), pointer :: rho_pol_norm_error_lower(:) => null() !Lower error for "rho_pol_norm" + integer(ids_int) :: rho_pol_norm_error_index=ids_int_invalid !Index in the error_description list for "rho_pol_norm" + real(ids_real), pointer :: psi(:) => null() !Poloidal magnetic flux + real(ids_real), pointer :: psi_error_upper(:) => null() !Upper error for "psi" + real(ids_real), pointer :: psi_error_lower(:) => null() !Lower error for "psi" + integer(ids_int) :: psi_error_index=ids_int_invalid !Index in the error_description list for "psi" + real(ids_real), pointer :: rho_tor_norm(:) => null() !Normalised toroidal flux coordinate. The normalizing value for rho_tor_norm, is the toroidal flux coordinate at the equilibrium bo! + !undary (LCFS or 99.x % of the LCFS in case of a fixed boundary equilibium calculation, see time_slice/boundary/b_flux_pol_norm in ! + !the equilibrium IDS) + real(ids_real), pointer :: rho_tor_norm_error_upper(:) => null() !Upper error for "rho_tor_norm" + real(ids_real), pointer :: rho_tor_norm_error_lower(:) => null() !Lower error for "rho_tor_norm" + integer(ids_int) :: rho_tor_norm_error_index=ids_int_invalid !Index in the error_description list for "rho_tor_norm" + real(ids_real), pointer :: rho_tor(:) => null() !Toroidal flux coordinate. rho_tor = sqrt(b_flux_tor/(pi*b0)) ~ sqrt(pi*r^2*b0/(pi*b0)) ~ r [m]. The toroidal field used in its def! + !inition is indicated under vacuum_toroidal_field/b0 + real(ids_real), pointer :: rho_tor_error_upper(:) => null() !Upper error for "rho_tor" + real(ids_real), pointer :: rho_tor_error_lower(:) => null() !Lower error for "rho_tor" + integer(ids_int) :: rho_tor_error_index=ids_int_invalid !Index in the error_description list for "rho_tor" + real(ids_real), pointer :: volume(:) => null() !Volume enclosed inside the magnetic surface + real(ids_real), pointer :: volume_error_upper(:) => null() !Upper error for "volume" + real(ids_real), pointer :: volume_error_lower(:) => null() !Lower error for "volume" + integer(ids_int) :: volume_error_index=ids_int_invalid !Index in the error_description list for "volume" + real(ids_real), pointer :: area(:) => null() !Cross-sectional area of the flux surface + real(ids_real), pointer :: area_error_upper(:) => null() !Upper error for "area" + real(ids_real), pointer :: area_error_lower(:) => null() !Lower error for "area" + integer(ids_int) :: area_error_index=ids_int_invalid !Index in the error_description list for "area" + real(ids_real) :: psi_magnetic_axis=ids_real_invalid !Value of the poloidal magnetic flux at the magnetic axis (useful to normalize the psi array values when the radial grid doesn't go! + ! from the magnetic axis to the plasma boundary) + real(ids_real) :: psi_magnetic_axis_error_upper=ids_real_invalid !Upper error for "psi_magnetic_axis" + real(ids_real) :: psi_magnetic_axis_error_lower=ids_real_invalid !Lower error for "psi_magnetic_axis" + integer(ids_int) :: psi_magnetic_axis_error_index=ids_int_invalid !Index in the error_description list for "psi_magnetic_axis" + real(ids_real) :: psi_boundary=ids_real_invalid !Value of the poloidal magnetic flux at the plasma boundary (useful to normalize the psi array values when the radial grid doesn't ! + !go from the magnetic axis to the plasma boundary) + real(ids_real) :: psi_boundary_error_upper=ids_real_invalid !Upper error for "psi_boundary" + real(ids_real) :: psi_boundary_error_lower=ids_real_invalid !Lower error for "psi_boundary" + integer(ids_int) :: psi_boundary_error_index=ids_int_invalid !Index in the error_description list for "psi_boundary" + end type + + type :: ids_edge_profiles_1d_fit + real(ids_real), pointer :: measured(:) => null() !Measured values + real(ids_real), pointer :: measured_error_upper(:) => null() !Upper error for "measured" + real(ids_real), pointer :: measured_error_lower(:) => null() !Lower error for "measured" + integer(ids_int) :: measured_error_index=ids_int_invalid !Index in the error_description list for "measured" + character(len=ids_string_length), dimension(:), pointer :: source => null() !Path to the source data for each measurement in the IMAS data dictionary, e.g. ece/channel(i)/t_e for the electron temperature on ! + !the i-th channel in the ECE IDS + real(ids_real), pointer :: time_measurement(:) => null() !Exact time slices used from the time array of the measurement source data. If the time slice does not exist in the time array of t! + !he source data, it means linear interpolation has been used + real(ids_real), pointer :: time_measurement_error_upper(:) => null() !Upper error for "time_measurement" + real(ids_real), pointer :: time_measurement_error_lower(:) => null() !Lower error for "time_measurement" + integer(ids_int) :: time_measurement_error_index=ids_int_invalid !Index in the error_description list for "time_measurement" + type(ids_identifier_dynamic_aos3) :: time_measurement_slice_method !Method used to slice the data : index = 0 means using exact time slice of the measurement, 1 means linear interpolation, ... + real(ids_real), pointer :: time_measurement_width(:) => null() !In case the measurements are averaged over a time interval, this node is the full width of this time interval (empty otherwise). I! + !n case the slicing/averaging method doesn't use a hard time interval cutoff, this width is the characteristic time span of the sli! + !cing/averaging method. By convention, the time interval starts at time_measurement-time_width and ends at time_measurement. + real(ids_real), pointer :: time_measurement_width_error_upper(:) => null() !Upper error for "time_measurement_width" + real(ids_real), pointer :: time_measurement_width_error_lower(:) => null() !Lower error for "time_measurement_width" + integer(ids_int) :: time_measurement_width_error_index=ids_int_invalid !Index in the error_description list for "time_measurement_width" + integer(ids_int), pointer :: local(:) => null() !Integer flag : 1 means local measurement, 0 means line-integrated measurement + real(ids_real), pointer :: rho_tor_norm(:) => null() !Normalised toroidal flux coordinate of each measurement (local value for a local measurement, minimum value reached by the line of! + ! sight for a line measurement) + real(ids_real), pointer :: rho_tor_norm_error_upper(:) => null() !Upper error for "rho_tor_norm" + real(ids_real), pointer :: rho_tor_norm_error_lower(:) => null() !Lower error for "rho_tor_norm" + integer(ids_int) :: rho_tor_norm_error_index=ids_int_invalid !Index in the error_description list for "rho_tor_norm" + real(ids_real), pointer :: rho_pol_norm(:) => null() !Normalised poloidal flux coordinate of each measurement (local value for a local measurement, minimum value reached by the line of! + ! sight for a line measurement) + real(ids_real), pointer :: rho_pol_norm_error_upper(:) => null() !Upper error for "rho_pol_norm" + real(ids_real), pointer :: rho_pol_norm_error_lower(:) => null() !Lower error for "rho_pol_norm" + integer(ids_int) :: rho_pol_norm_error_index=ids_int_invalid !Index in the error_description list for "rho_pol_norm" + real(ids_real), pointer :: weight(:) => null() !Weight given to each measured value + real(ids_real), pointer :: weight_error_upper(:) => null() !Upper error for "weight" + real(ids_real), pointer :: weight_error_lower(:) => null() !Lower error for "weight" + integer(ids_int) :: weight_error_index=ids_int_invalid !Index in the error_description list for "weight" + real(ids_real), pointer :: reconstructed(:) => null() !Value reconstructed from the fit + real(ids_real), pointer :: reconstructed_error_upper(:) => null() !Upper error for "reconstructed" + real(ids_real), pointer :: reconstructed_error_lower(:) => null() !Lower error for "reconstructed" + integer(ids_int) :: reconstructed_error_index=ids_int_invalid !Index in the error_description list for "reconstructed" + real(ids_real), pointer :: chi_squared(:) => null() !Squared error normalized by the weighted standard deviation considered in the minimization process : chi_squared = weight^2 *(reco! + !nstructed - measured)^2 / sigma^2, where sigma is the standard deviation of the measurement error + real(ids_real), pointer :: chi_squared_error_upper(:) => null() !Upper error for "chi_squared" + real(ids_real), pointer :: chi_squared_error_lower(:) => null() !Lower error for "chi_squared" + integer(ids_int) :: chi_squared_error_index=ids_int_invalid !Index in the error_description list for "chi_squared" + character(len=ids_string_length), dimension(:), pointer :: parameters => null() !List of the fit specific parameters in XML format + end type + + type :: ids_edge_profiles_vector_components_2 + real(ids_real), pointer :: radial(:) => null() !Radial component + real(ids_real), pointer :: radial_error_upper(:) => null() !Upper error for "radial" + real(ids_real), pointer :: radial_error_lower(:) => null() !Lower error for "radial" + integer(ids_int) :: radial_error_index=ids_int_invalid !Index in the error_description list for "radial" + real(ids_real), pointer :: diamagnetic(:) => null() !Diamagnetic component + real(ids_real), pointer :: diamagnetic_error_upper(:) => null() !Upper error for "diamagnetic" + real(ids_real), pointer :: diamagnetic_error_lower(:) => null() !Lower error for "diamagnetic" + integer(ids_int) :: diamagnetic_error_index=ids_int_invalid !Index in the error_description list for "diamagnetic" + real(ids_real), pointer :: parallel(:) => null() !Parallel component + real(ids_real), pointer :: parallel_error_upper(:) => null() !Upper error for "parallel" + real(ids_real), pointer :: parallel_error_lower(:) => null() !Lower error for "parallel" + integer(ids_int) :: parallel_error_index=ids_int_invalid !Index in the error_description list for "parallel" + real(ids_real), pointer :: poloidal(:) => null() !Poloidal component + real(ids_real), pointer :: poloidal_error_upper(:) => null() !Upper error for "poloidal" + real(ids_real), pointer :: poloidal_error_lower(:) => null() !Lower error for "poloidal" + integer(ids_int) :: poloidal_error_index=ids_int_invalid !Index in the error_description list for "poloidal" + real(ids_real), pointer :: toroidal(:) => null() !Toroidal component + real(ids_real), pointer :: toroidal_error_upper(:) => null() !Upper error for "toroidal" + real(ids_real), pointer :: toroidal_error_lower(:) => null() !Lower error for "toroidal" + integer(ids_int) :: toroidal_error_index=ids_int_invalid !Index in the error_description list for "toroidal" + end type + + type :: ids_edge_profiles_profiles_1d_electrons + real(ids_real), pointer :: temperature(:) => null() !Temperature + real(ids_real), pointer :: temperature_error_upper(:) => null() !Upper error for "temperature" + real(ids_real), pointer :: temperature_error_lower(:) => null() !Lower error for "temperature" + integer(ids_int) :: temperature_error_index=ids_int_invalid !Index in the error_description list for "temperature" + integer(ids_int) :: temperature_validity=ids_int_invalid !Indicator of the validity of the temperature profile. 0: valid from automated processing, 1: valid and certified by the RO; - 1 me! + !ans problem identified in the data processing (request verification by the RO), -2: invalid data, should not be used + type(ids_edge_profiles_1d_fit) :: temperature_fit !Information on the fit used to obtain the temperature profile + real(ids_real), pointer :: density(:) => null() !Density (thermal+non-thermal) + real(ids_real), pointer :: density_error_upper(:) => null() !Upper error for "density" + real(ids_real), pointer :: density_error_lower(:) => null() !Lower error for "density" + integer(ids_int) :: density_error_index=ids_int_invalid !Index in the error_description list for "density" + integer(ids_int) :: density_validity=ids_int_invalid !Indicator of the validity of the density profile. 0: valid from automated processing, 1: valid and certified by the RO; - 1 means ! + !problem identified in the data processing (request verification by the RO), -2: invalid data, should not be used + type(ids_edge_profiles_1d_fit) :: density_fit !Information on the fit used to obtain the density profile + real(ids_real), pointer :: density_thermal(:) => null() !Density of thermal particles + real(ids_real), pointer :: density_thermal_error_upper(:) => null() !Upper error for "density_thermal" + real(ids_real), pointer :: density_thermal_error_lower(:) => null() !Lower error for "density_thermal" + integer(ids_int) :: density_thermal_error_index=ids_int_invalid !Index in the error_description list for "density_thermal" + real(ids_real), pointer :: density_fast(:) => null() !Density of fast (non-thermal) particles + real(ids_real), pointer :: density_fast_error_upper(:) => null() !Upper error for "density_fast" + real(ids_real), pointer :: density_fast_error_lower(:) => null() !Lower error for "density_fast" + integer(ids_int) :: density_fast_error_index=ids_int_invalid !Index in the error_description list for "density_fast" + real(ids_real), pointer :: pressure(:) => null() !Pressure (thermal+non-thermal) + real(ids_real), pointer :: pressure_error_upper(:) => null() !Upper error for "pressure" + real(ids_real), pointer :: pressure_error_lower(:) => null() !Lower error for "pressure" + integer(ids_int) :: pressure_error_index=ids_int_invalid !Index in the error_description list for "pressure" + real(ids_real), pointer :: pressure_thermal(:) => null() !Pressure (thermal) associated with random motion ~average((v-average(v))^2) + real(ids_real), pointer :: pressure_thermal_error_upper(:) => null() !Upper error for "pressure_thermal" + real(ids_real), pointer :: pressure_thermal_error_lower(:) => null() !Lower error for "pressure_thermal" + integer(ids_int) :: pressure_thermal_error_index=ids_int_invalid !Index in the error_description list for "pressure_thermal" + real(ids_real), pointer :: pressure_fast_perpendicular(:) => null() !Fast (non-thermal) perpendicular pressure + real(ids_real), pointer :: pressure_fast_perpendicular_error_upper(:) => null() !Upper error for "pressure_fast_perpendicular" + real(ids_real), pointer :: pressure_fast_perpendicular_error_lower(:) => null() !Lower error for "pressure_fast_perpendicular" + integer(ids_int) :: pressure_fast_perpendicular_error_index=ids_int_invalid !Index in the error_description list for "pressure_fast_perpendicular" + real(ids_real), pointer :: pressure_fast_parallel(:) => null() !Fast (non-thermal) parallel pressure + real(ids_real), pointer :: pressure_fast_parallel_error_upper(:) => null() !Upper error for "pressure_fast_parallel" + real(ids_real), pointer :: pressure_fast_parallel_error_lower(:) => null() !Lower error for "pressure_fast_parallel" + integer(ids_int) :: pressure_fast_parallel_error_index=ids_int_invalid !Index in the error_description list for "pressure_fast_parallel" + real(ids_real), pointer :: velocity_tor(:) => null() !Toroidal velocity + real(ids_real), pointer :: velocity_tor_error_upper(:) => null() !Upper error for "velocity_tor" + real(ids_real), pointer :: velocity_tor_error_lower(:) => null() !Lower error for "velocity_tor" + integer(ids_int) :: velocity_tor_error_index=ids_int_invalid !Index in the error_description list for "velocity_tor" + real(ids_real), pointer :: velocity_pol(:) => null() !Poloidal velocity + real(ids_real), pointer :: velocity_pol_error_upper(:) => null() !Upper error for "velocity_pol" + real(ids_real), pointer :: velocity_pol_error_lower(:) => null() !Lower error for "velocity_pol" + integer(ids_int) :: velocity_pol_error_index=ids_int_invalid !Index in the error_description list for "velocity_pol" + type(ids_edge_profiles_vector_components_2) :: velocity !Velocity + real(ids_real), pointer :: collisionality_norm(:) => null() !Collisionality normalised to the bounce frequency + real(ids_real), pointer :: collisionality_norm_error_upper(:) => null() !Upper error for "collisionality_norm" + real(ids_real), pointer :: collisionality_norm_error_lower(:) => null() !Lower error for "collisionality_norm" + integer(ids_int) :: collisionality_norm_error_index=ids_int_invalid !Index in the error_description list for "collisionality_norm" + end type + + type :: ids_edge_profiles_vector_components_3 + real(ids_real), pointer :: radial(:) => null() !Radial component + real(ids_real), pointer :: radial_error_upper(:) => null() !Upper error for "radial" + real(ids_real), pointer :: radial_error_lower(:) => null() !Lower error for "radial" + integer(ids_int) :: radial_error_index=ids_int_invalid !Index in the error_description list for "radial" + real(ids_real), pointer :: diamagnetic(:) => null() !Diamagnetic component + real(ids_real), pointer :: diamagnetic_error_upper(:) => null() !Upper error for "diamagnetic" + real(ids_real), pointer :: diamagnetic_error_lower(:) => null() !Lower error for "diamagnetic" + integer(ids_int) :: diamagnetic_error_index=ids_int_invalid !Index in the error_description list for "diamagnetic" + real(ids_real), pointer :: parallel(:) => null() !Parallel component + real(ids_real), pointer :: parallel_error_upper(:) => null() !Upper error for "parallel" + real(ids_real), pointer :: parallel_error_lower(:) => null() !Lower error for "parallel" + integer(ids_int) :: parallel_error_index=ids_int_invalid !Index in the error_description list for "parallel" + real(ids_real), pointer :: poloidal(:) => null() !Poloidal component + real(ids_real), pointer :: poloidal_error_upper(:) => null() !Upper error for "poloidal" + real(ids_real), pointer :: poloidal_error_lower(:) => null() !Lower error for "poloidal" + integer(ids_int) :: poloidal_error_index=ids_int_invalid !Index in the error_description list for "poloidal" + real(ids_real), pointer :: toroidal(:) => null() !Toroidal component + real(ids_real), pointer :: toroidal_error_upper(:) => null() !Upper error for "toroidal" + real(ids_real), pointer :: toroidal_error_lower(:) => null() !Lower error for "toroidal" + integer(ids_int) :: toroidal_error_index=ids_int_invalid !Index in the error_description list for "toroidal" + end type + + type :: ids_edge_profiles_ions_charge_states2 + real(ids_real) :: z_min=ids_real_invalid !Minimum Z of the charge state bundle + real(ids_real) :: z_min_error_upper=ids_real_invalid !Upper error for "z_min" + real(ids_real) :: z_min_error_lower=ids_real_invalid !Lower error for "z_min" + integer(ids_int) :: z_min_error_index=ids_int_invalid !Index in the error_description list for "z_min" + real(ids_real) :: z_max=ids_real_invalid !Maximum Z of the charge state bundle (equal to z_min if no bundle) + real(ids_real) :: z_max_error_upper=ids_real_invalid !Upper error for "z_max" + real(ids_real) :: z_max_error_lower=ids_real_invalid !Lower error for "z_max" + integer(ids_int) :: z_max_error_index=ids_int_invalid !Index in the error_description list for "z_max" + real(ids_real) :: z_average=ids_real_invalid !Average Z of the charge state bundle, volume averaged over the plasma radius (equal to z_min if no bundle), = sum (Z*x_z) where x_! + !z is the relative concentration of a given charge state in the bundle, i.e. sum(x_z) = 1 over the bundle. + real(ids_real) :: z_average_error_upper=ids_real_invalid !Upper error for "z_average" + real(ids_real) :: z_average_error_lower=ids_real_invalid !Lower error for "z_average" + integer(ids_int) :: z_average_error_index=ids_int_invalid !Index in the error_description list for "z_average" + real(ids_real) :: z_square_average=ids_real_invalid !Average Z square of the charge state bundle, volume averaged over the plasma radius (equal to z_min squared if no bundle), = sum (! + !Z^2*x_z) where x_z is the relative concentration of a given charge state in the bundle, i.e. sum(x_z) = 1 over the bundle. + real(ids_real) :: z_square_average_error_upper=ids_real_invalid !Upper error for "z_square_average" + real(ids_real) :: z_square_average_error_lower=ids_real_invalid !Lower error for "z_square_average" + integer(ids_int) :: z_square_average_error_index=ids_int_invalid !Index in the error_description list for "z_square_average" + real(ids_real), pointer :: z_average_1d(:) => null() !Average charge profile of the charge state bundle (equal to z_min if no bundle), = sum (Z*x_z) where x_z is the relative concentra! + !tion of a given charge state in the bundle, i.e. sum(x_z) = 1 over the bundle. + real(ids_real), pointer :: z_average_1d_error_upper(:) => null() !Upper error for "z_average_1d" + real(ids_real), pointer :: z_average_1d_error_lower(:) => null() !Lower error for "z_average_1d" + integer(ids_int) :: z_average_1d_error_index=ids_int_invalid !Index in the error_description list for "z_average_1d" + real(ids_real), pointer :: z_average_square_1d(:) => null() !Average square charge profile of the charge state bundle (equal to z_min squared if no bundle), = sum (Z^2*x_z) where x_z is the r! + !elative concentration of a given charge state in the bundle, i.e. sum(x_z) = 1 over the bundle. + real(ids_real), pointer :: z_average_square_1d_error_upper(:) => null() !Upper error for "z_average_square_1d" + real(ids_real), pointer :: z_average_square_1d_error_lower(:) => null() !Lower error for "z_average_square_1d" + integer(ids_int) :: z_average_square_1d_error_index=ids_int_invalid !Index in the error_description list for "z_average_square_1d" + real(ids_real) :: ionisation_potential=ids_real_invalid !Cumulative and average ionisation potential to reach a given bundle. Defined as sum (x_z* (sum of Epot from z'=0 to z-1)), where E! + !pot is the ionisation potential of ion Xz_+, and x_z is the relative concentration of a given charge state in the bundle, i.e. sum! + !(x_z) = 1 over the bundle. + real(ids_real) :: ionisation_potential_error_upper=ids_real_invalid !Upper error for "ionisation_potential" + real(ids_real) :: ionisation_potential_error_lower=ids_real_invalid !Lower error for "ionisation_potential" + integer(ids_int) :: ionisation_potential_error_index=ids_int_invalid !Index in the error_description list for "ionisation_potential" + character(len=ids_string_length), dimension(:), pointer :: label => null() !String identifying state (e.g. C+, C+2 , C+3, C+4, C+5, C+6, ...) + character(len=ids_string_length), dimension(:), pointer :: electron_configuration => null() !Configuration of atomic orbitals of this state, e.g. 1s2-2s1 + real(ids_real) :: vibrational_level=ids_real_invalid !Vibrational level (can be bundled) + real(ids_real) :: vibrational_level_error_upper=ids_real_invalid !Upper error for "vibrational_level" + real(ids_real) :: vibrational_level_error_lower=ids_real_invalid !Lower error for "vibrational_level" + integer(ids_int) :: vibrational_level_error_index=ids_int_invalid !Index in the error_description list for "vibrational_level" + character(len=ids_string_length), dimension(:), pointer :: vibrational_mode => null() !Vibrational mode of this state, e.g. "A_g". Need to define, or adopt a standard nomenclature. + type(ids_edge_profiles_vector_components_3) :: velocity !Velocity + real(ids_real), pointer :: rotation_frequency_tor(:) => null() !Toroidal rotation frequency (i.e. toroidal velocity divided by the major radius at which the toroidal velocity is taken) + real(ids_real), pointer :: rotation_frequency_tor_error_upper(:) => null() !Upper error for "rotation_frequency_tor" + real(ids_real), pointer :: rotation_frequency_tor_error_lower(:) => null() !Lower error for "rotation_frequency_tor" + integer(ids_int) :: rotation_frequency_tor_error_index=ids_int_invalid !Index in the error_description list for "rotation_frequency_tor" + real(ids_real), pointer :: temperature(:) => null() !Temperature + real(ids_real), pointer :: temperature_error_upper(:) => null() !Upper error for "temperature" + real(ids_real), pointer :: temperature_error_lower(:) => null() !Lower error for "temperature" + integer(ids_int) :: temperature_error_index=ids_int_invalid !Index in the error_description list for "temperature" + real(ids_real), pointer :: density(:) => null() !Density (thermal+non-thermal) + real(ids_real), pointer :: density_error_upper(:) => null() !Upper error for "density" + real(ids_real), pointer :: density_error_lower(:) => null() !Lower error for "density" + integer(ids_int) :: density_error_index=ids_int_invalid !Index in the error_description list for "density" + type(ids_edge_profiles_1d_fit) :: density_fit !Information on the fit used to obtain the density profile + real(ids_real), pointer :: density_thermal(:) => null() !Density of thermal particles + real(ids_real), pointer :: density_thermal_error_upper(:) => null() !Upper error for "density_thermal" + real(ids_real), pointer :: density_thermal_error_lower(:) => null() !Lower error for "density_thermal" + integer(ids_int) :: density_thermal_error_index=ids_int_invalid !Index in the error_description list for "density_thermal" + real(ids_real), pointer :: density_fast(:) => null() !Density of fast (non-thermal) particles + real(ids_real), pointer :: density_fast_error_upper(:) => null() !Upper error for "density_fast" + real(ids_real), pointer :: density_fast_error_lower(:) => null() !Lower error for "density_fast" + integer(ids_int) :: density_fast_error_index=ids_int_invalid !Index in the error_description list for "density_fast" + real(ids_real), pointer :: pressure(:) => null() !Pressure (thermal+non-thermal) + real(ids_real), pointer :: pressure_error_upper(:) => null() !Upper error for "pressure" + real(ids_real), pointer :: pressure_error_lower(:) => null() !Lower error for "pressure" + integer(ids_int) :: pressure_error_index=ids_int_invalid !Index in the error_description list for "pressure" + real(ids_real), pointer :: pressure_thermal(:) => null() !Pressure (thermal) associated with random motion ~average((v-average(v))^2) + real(ids_real), pointer :: pressure_thermal_error_upper(:) => null() !Upper error for "pressure_thermal" + real(ids_real), pointer :: pressure_thermal_error_lower(:) => null() !Lower error for "pressure_thermal" + integer(ids_int) :: pressure_thermal_error_index=ids_int_invalid !Index in the error_description list for "pressure_thermal" + real(ids_real), pointer :: pressure_fast_perpendicular(:) => null() !Fast (non-thermal) perpendicular pressure + real(ids_real), pointer :: pressure_fast_perpendicular_error_upper(:) => null() !Upper error for "pressure_fast_perpendicular" + real(ids_real), pointer :: pressure_fast_perpendicular_error_lower(:) => null() !Lower error for "pressure_fast_perpendicular" + integer(ids_int) :: pressure_fast_perpendicular_error_index=ids_int_invalid !Index in the error_description list for "pressure_fast_perpendicular" + real(ids_real), pointer :: pressure_fast_parallel(:) => null() !Fast (non-thermal) parallel pressure + real(ids_real), pointer :: pressure_fast_parallel_error_upper(:) => null() !Upper error for "pressure_fast_parallel" + real(ids_real), pointer :: pressure_fast_parallel_error_lower(:) => null() !Lower error for "pressure_fast_parallel" + integer(ids_int) :: pressure_fast_parallel_error_index=ids_int_invalid !Index in the error_description list for "pressure_fast_parallel" + end type + + type :: ids_edge_profile_ions + type(ids_plasma_composition_neutral_element), pointer :: element(:) => null() !List of elements forming the atom or molecule + real(ids_real) :: z_ion=ids_real_invalid !Ion charge (of the dominant ionisation state; lumped ions are allowed), volume averaged over plasma radius + real(ids_real) :: z_ion_error_upper=ids_real_invalid !Upper error for "z_ion" + real(ids_real) :: z_ion_error_lower=ids_real_invalid !Lower error for "z_ion" + integer(ids_int) :: z_ion_error_index=ids_int_invalid !Index in the error_description list for "z_ion" + character(len=ids_string_length), dimension(:), pointer :: label => null() !String identifying ion (e.g. H, D, T, He, C, D2, ...) + integer(ids_int) :: neutral_index=ids_int_invalid !Index of the corresponding neutral species in the ../../neutral array + real(ids_real), pointer :: z_ion_1d(:) => null() !Average charge of the ion species (sum of states charge weighted by state density and divided by ion density) + real(ids_real), pointer :: z_ion_1d_error_upper(:) => null() !Upper error for "z_ion_1d" + real(ids_real), pointer :: z_ion_1d_error_lower(:) => null() !Lower error for "z_ion_1d" + integer(ids_int) :: z_ion_1d_error_index=ids_int_invalid !Index in the error_description list for "z_ion_1d" + real(ids_real), pointer :: z_ion_square_1d(:) => null() !Average square charge of the ion species (sum of states square charge weighted by state density and divided by ion density) + real(ids_real), pointer :: z_ion_square_1d_error_upper(:) => null() !Upper error for "z_ion_square_1d" + real(ids_real), pointer :: z_ion_square_1d_error_lower(:) => null() !Lower error for "z_ion_square_1d" + integer(ids_int) :: z_ion_square_1d_error_index=ids_int_invalid !Index in the error_description list for "z_ion_square_1d" + real(ids_real), pointer :: temperature(:) => null() !Temperature (average over charge states when multiple charge states are considered) + real(ids_real), pointer :: temperature_error_upper(:) => null() !Upper error for "temperature" + real(ids_real), pointer :: temperature_error_lower(:) => null() !Lower error for "temperature" + integer(ids_int) :: temperature_error_index=ids_int_invalid !Index in the error_description list for "temperature" + integer(ids_int) :: temperature_validity=ids_int_invalid !Indicator of the validity of the temperature profile. 0: valid from automated processing, 1: valid and certified by the RO; - 1 me! + !ans problem identified in the data processing (request verification by the RO), -2: invalid data, should not be used + type(ids_edge_profiles_1d_fit) :: temperature_fit !Information on the fit used to obtain the temperature profile + real(ids_real), pointer :: density(:) => null() !Density (thermal+non-thermal) (sum over charge states when multiple charge states are considered) + real(ids_real), pointer :: density_error_upper(:) => null() !Upper error for "density" + real(ids_real), pointer :: density_error_lower(:) => null() !Lower error for "density" + integer(ids_int) :: density_error_index=ids_int_invalid !Index in the error_description list for "density" + integer(ids_int) :: density_validity=ids_int_invalid !Indicator of the validity of the density profile. 0: valid from automated processing, 1: valid and certified by the RO; - 1 means ! + !problem identified in the data processing (request verification by the RO), -2: invalid data, should not be used + type(ids_edge_profiles_1d_fit) :: density_fit !Information on the fit used to obtain the density profile + real(ids_real), pointer :: density_thermal(:) => null() !Density (thermal) (sum over charge states when multiple charge states are considered) + real(ids_real), pointer :: density_thermal_error_upper(:) => null() !Upper error for "density_thermal" + real(ids_real), pointer :: density_thermal_error_lower(:) => null() !Lower error for "density_thermal" + integer(ids_int) :: density_thermal_error_index=ids_int_invalid !Index in the error_description list for "density_thermal" + real(ids_real), pointer :: density_fast(:) => null() !Density of fast (non-thermal) particles (sum over charge states when multiple charge states are considered) + real(ids_real), pointer :: density_fast_error_upper(:) => null() !Upper error for "density_fast" + real(ids_real), pointer :: density_fast_error_lower(:) => null() !Lower error for "density_fast" + integer(ids_int) :: density_fast_error_index=ids_int_invalid !Index in the error_description list for "density_fast" + real(ids_real), pointer :: pressure(:) => null() !Pressure (thermal+non-thermal) (sum over charge states when multiple charge states are considered) + real(ids_real), pointer :: pressure_error_upper(:) => null() !Upper error for "pressure" + real(ids_real), pointer :: pressure_error_lower(:) => null() !Lower error for "pressure" + integer(ids_int) :: pressure_error_index=ids_int_invalid !Index in the error_description list for "pressure" + real(ids_real), pointer :: pressure_thermal(:) => null() !Pressure (thermal) associated with random motion ~average((v-average(v))^2) (sum over charge states when multiple charge states ar! + !e considered) + real(ids_real), pointer :: pressure_thermal_error_upper(:) => null() !Upper error for "pressure_thermal" + real(ids_real), pointer :: pressure_thermal_error_lower(:) => null() !Lower error for "pressure_thermal" + integer(ids_int) :: pressure_thermal_error_index=ids_int_invalid !Index in the error_description list for "pressure_thermal" + real(ids_real), pointer :: pressure_fast_perpendicular(:) => null() !Fast (non-thermal) perpendicular pressure (sum over charge states when multiple charge states are considered) + real(ids_real), pointer :: pressure_fast_perpendicular_error_upper(:) => null() !Upper error for "pressure_fast_perpendicular" + real(ids_real), pointer :: pressure_fast_perpendicular_error_lower(:) => null() !Lower error for "pressure_fast_perpendicular" + integer(ids_int) :: pressure_fast_perpendicular_error_index=ids_int_invalid !Index in the error_description list for "pressure_fast_perpendicular" + real(ids_real), pointer :: pressure_fast_parallel(:) => null() !Fast (non-thermal) parallel pressure (sum over charge states when multiple charge states are considered) + real(ids_real), pointer :: pressure_fast_parallel_error_upper(:) => null() !Upper error for "pressure_fast_parallel" + real(ids_real), pointer :: pressure_fast_parallel_error_lower(:) => null() !Lower error for "pressure_fast_parallel" + integer(ids_int) :: pressure_fast_parallel_error_index=ids_int_invalid !Index in the error_description list for "pressure_fast_parallel" + real(ids_real), pointer :: velocity_tor(:) => null() !Toroidal velocity (average over charge states when multiple charge states are considered) + real(ids_real), pointer :: velocity_tor_error_upper(:) => null() !Upper error for "velocity_tor" + real(ids_real), pointer :: velocity_tor_error_lower(:) => null() !Lower error for "velocity_tor" + integer(ids_int) :: velocity_tor_error_index=ids_int_invalid !Index in the error_description list for "velocity_tor" + real(ids_real), pointer :: velocity_pol(:) => null() !Poloidal velocity (average over charge states when multiple charge states are considered) + real(ids_real), pointer :: velocity_pol_error_upper(:) => null() !Upper error for "velocity_pol" + real(ids_real), pointer :: velocity_pol_error_lower(:) => null() !Lower error for "velocity_pol" + integer(ids_int) :: velocity_pol_error_index=ids_int_invalid !Index in the error_description list for "velocity_pol" + real(ids_real), pointer :: rotation_frequency_tor(:) => null() !Toroidal rotation frequency (i.e. toroidal velocity divided by the major radius at which the toroidal velocity is taken) (average! + ! over charge states when multiple charge states are considered) + real(ids_real), pointer :: rotation_frequency_tor_error_upper(:) => null() !Upper error for "rotation_frequency_tor" + real(ids_real), pointer :: rotation_frequency_tor_error_lower(:) => null() !Lower error for "rotation_frequency_tor" + integer(ids_int) :: rotation_frequency_tor_error_index=ids_int_invalid !Index in the error_description list for "rotation_frequency_tor" + type(ids_edge_profiles_vector_components_2) :: velocity !Velocity (average over charge states when multiple charge states are considered) at the position of maximum major radius on every ! + !flux surface + integer(ids_int) :: multiple_states_flag=ids_int_invalid !Multiple states calculation flag : 0-Only the 'ion' level is considered and the 'state' array of structure is empty; 1-Ion states ! + !are considered and are described in the 'state' array of structure + type(ids_edge_profiles_ions_charge_states2), pointer :: state(:) => null() !Quantities related to the different states of the species (ionisation, energy, excitation, ...) + end type + + type :: ids_edge_profiles_neutral_state + character(len=ids_string_length), dimension(:), pointer :: label => null() !String identifying state + character(len=ids_string_length), dimension(:), pointer :: electron_configuration => null() !Configuration of atomic orbitals of this state, e.g. 1s2-2s1 + real(ids_real) :: vibrational_level=ids_real_invalid !Vibrational level (can be bundled) + real(ids_real) :: vibrational_level_error_upper=ids_real_invalid !Upper error for "vibrational_level" + real(ids_real) :: vibrational_level_error_lower=ids_real_invalid !Lower error for "vibrational_level" + integer(ids_int) :: vibrational_level_error_index=ids_int_invalid !Index in the error_description list for "vibrational_level" + character(len=ids_string_length), dimension(:), pointer :: vibrational_mode => null() !Vibrational mode of this state, e.g. "A_g". Need to define, or adopt a standard nomenclature. + type(ids_identifier_dynamic_aos3) :: neutral_type !Neutral type (if the considered state is a neutral), in terms of energy. ID =1: cold; 2: thermal; 3: fast; 4: NBI + type(ids_edge_profiles_vector_components_3) :: velocity !Velocity + real(ids_real), pointer :: temperature(:) => null() !Temperature + real(ids_real), pointer :: temperature_error_upper(:) => null() !Upper error for "temperature" + real(ids_real), pointer :: temperature_error_lower(:) => null() !Lower error for "temperature" + integer(ids_int) :: temperature_error_index=ids_int_invalid !Index in the error_description list for "temperature" + real(ids_real), pointer :: density(:) => null() !Density (thermal+non-thermal) + real(ids_real), pointer :: density_error_upper(:) => null() !Upper error for "density" + real(ids_real), pointer :: density_error_lower(:) => null() !Lower error for "density" + integer(ids_int) :: density_error_index=ids_int_invalid !Index in the error_description list for "density" + real(ids_real), pointer :: density_thermal(:) => null() !Density of thermal particles + real(ids_real), pointer :: density_thermal_error_upper(:) => null() !Upper error for "density_thermal" + real(ids_real), pointer :: density_thermal_error_lower(:) => null() !Lower error for "density_thermal" + integer(ids_int) :: density_thermal_error_index=ids_int_invalid !Index in the error_description list for "density_thermal" + real(ids_real), pointer :: density_fast(:) => null() !Density of fast (non-thermal) particles + real(ids_real), pointer :: density_fast_error_upper(:) => null() !Upper error for "density_fast" + real(ids_real), pointer :: density_fast_error_lower(:) => null() !Lower error for "density_fast" + integer(ids_int) :: density_fast_error_index=ids_int_invalid !Index in the error_description list for "density_fast" + real(ids_real), pointer :: pressure(:) => null() !Pressure (thermal+non-thermal) + real(ids_real), pointer :: pressure_error_upper(:) => null() !Upper error for "pressure" + real(ids_real), pointer :: pressure_error_lower(:) => null() !Lower error for "pressure" + integer(ids_int) :: pressure_error_index=ids_int_invalid !Index in the error_description list for "pressure" + real(ids_real), pointer :: pressure_thermal(:) => null() !Pressure (thermal) associated with random motion ~average((v-average(v))^2) + real(ids_real), pointer :: pressure_thermal_error_upper(:) => null() !Upper error for "pressure_thermal" + real(ids_real), pointer :: pressure_thermal_error_lower(:) => null() !Lower error for "pressure_thermal" + integer(ids_int) :: pressure_thermal_error_index=ids_int_invalid !Index in the error_description list for "pressure_thermal" + real(ids_real), pointer :: pressure_fast_perpendicular(:) => null() !Fast (non-thermal) perpendicular pressure + real(ids_real), pointer :: pressure_fast_perpendicular_error_upper(:) => null() !Upper error for "pressure_fast_perpendicular" + real(ids_real), pointer :: pressure_fast_perpendicular_error_lower(:) => null() !Lower error for "pressure_fast_perpendicular" + integer(ids_int) :: pressure_fast_perpendicular_error_index=ids_int_invalid !Index in the error_description list for "pressure_fast_perpendicular" + real(ids_real), pointer :: pressure_fast_parallel(:) => null() !Fast (non-thermal) parallel pressure + real(ids_real), pointer :: pressure_fast_parallel_error_upper(:) => null() !Upper error for "pressure_fast_parallel" + real(ids_real), pointer :: pressure_fast_parallel_error_lower(:) => null() !Lower error for "pressure_fast_parallel" + integer(ids_int) :: pressure_fast_parallel_error_index=ids_int_invalid !Index in the error_description list for "pressure_fast_parallel" + end type + + type :: ids_edge_profile_neutral + type(ids_plasma_composition_neutral_element), pointer :: element(:) => null() !List of elements forming the atom or molecule + character(len=ids_string_length), dimension(:), pointer :: label => null() !String identifying the species (e.g. H, D, T, He, C, D2, DT, CD4, ...) + integer(ids_int) :: ion_index=ids_int_invalid !Index of the corresponding ion species in the ../../ion array + real(ids_real), pointer :: temperature(:) => null() !Temperature (average over charge states when multiple charge states are considered) + real(ids_real), pointer :: temperature_error_upper(:) => null() !Upper error for "temperature" + real(ids_real), pointer :: temperature_error_lower(:) => null() !Lower error for "temperature" + integer(ids_int) :: temperature_error_index=ids_int_invalid !Index in the error_description list for "temperature" + real(ids_real), pointer :: density(:) => null() !Density (thermal+non-thermal) (sum over charge states when multiple charge states are considered) + real(ids_real), pointer :: density_error_upper(:) => null() !Upper error for "density" + real(ids_real), pointer :: density_error_lower(:) => null() !Lower error for "density" + integer(ids_int) :: density_error_index=ids_int_invalid !Index in the error_description list for "density" + real(ids_real), pointer :: density_thermal(:) => null() !Density (thermal) (sum over charge states when multiple charge states are considered) + real(ids_real), pointer :: density_thermal_error_upper(:) => null() !Upper error for "density_thermal" + real(ids_real), pointer :: density_thermal_error_lower(:) => null() !Lower error for "density_thermal" + integer(ids_int) :: density_thermal_error_index=ids_int_invalid !Index in the error_description list for "density_thermal" + real(ids_real), pointer :: density_fast(:) => null() !Density of fast (non-thermal) particles (sum over charge states when multiple charge states are considered) + real(ids_real), pointer :: density_fast_error_upper(:) => null() !Upper error for "density_fast" + real(ids_real), pointer :: density_fast_error_lower(:) => null() !Lower error for "density_fast" + integer(ids_int) :: density_fast_error_index=ids_int_invalid !Index in the error_description list for "density_fast" + real(ids_real), pointer :: pressure(:) => null() !Pressure (thermal+non-thermal) (sum over charge states when multiple charge states are considered) + real(ids_real), pointer :: pressure_error_upper(:) => null() !Upper error for "pressure" + real(ids_real), pointer :: pressure_error_lower(:) => null() !Lower error for "pressure" + integer(ids_int) :: pressure_error_index=ids_int_invalid !Index in the error_description list for "pressure" + real(ids_real), pointer :: pressure_thermal(:) => null() !Pressure (thermal) associated with random motion ~average((v-average(v))^2) (sum over charge states when multiple charge states ar! + !e considered) + real(ids_real), pointer :: pressure_thermal_error_upper(:) => null() !Upper error for "pressure_thermal" + real(ids_real), pointer :: pressure_thermal_error_lower(:) => null() !Lower error for "pressure_thermal" + integer(ids_int) :: pressure_thermal_error_index=ids_int_invalid !Index in the error_description list for "pressure_thermal" + real(ids_real), pointer :: pressure_fast_perpendicular(:) => null() !Fast (non-thermal) perpendicular pressure (sum over charge states when multiple charge states are considered) + real(ids_real), pointer :: pressure_fast_perpendicular_error_upper(:) => null() !Upper error for "pressure_fast_perpendicular" + real(ids_real), pointer :: pressure_fast_perpendicular_error_lower(:) => null() !Lower error for "pressure_fast_perpendicular" + integer(ids_int) :: pressure_fast_perpendicular_error_index=ids_int_invalid !Index in the error_description list for "pressure_fast_perpendicular" + real(ids_real), pointer :: pressure_fast_parallel(:) => null() !Fast (non-thermal) parallel pressure (sum over charge states when multiple charge states are considered) + real(ids_real), pointer :: pressure_fast_parallel_error_upper(:) => null() !Upper error for "pressure_fast_parallel" + real(ids_real), pointer :: pressure_fast_parallel_error_lower(:) => null() !Lower error for "pressure_fast_parallel" + integer(ids_int) :: pressure_fast_parallel_error_index=ids_int_invalid !Index in the error_description list for "pressure_fast_parallel" + type(ids_edge_profiles_vector_components_2) :: velocity !Velocity (average over charge states when multiple charge states are considered) + integer(ids_int) :: multiple_states_flag=ids_int_invalid !Multiple states calculation flag : 0-Only one state is considered; 1-Multiple states are considered and are described in the state! + ! structure + type(ids_edge_profiles_neutral_state), pointer :: state(:) => null() !Quantities related to the different states of the species (energy, excitation, ...) + end type + + type :: ids_edge_profiles_vector_components_1 + real(ids_real), pointer :: radial(:) => null() !Radial component + real(ids_real), pointer :: radial_error_upper(:) => null() !Upper error for "radial" + real(ids_real), pointer :: radial_error_lower(:) => null() !Lower error for "radial" + integer(ids_int) :: radial_error_index=ids_int_invalid !Index in the error_description list for "radial" + real(ids_real), pointer :: diamagnetic(:) => null() !Diamagnetic component + real(ids_real), pointer :: diamagnetic_error_upper(:) => null() !Upper error for "diamagnetic" + real(ids_real), pointer :: diamagnetic_error_lower(:) => null() !Lower error for "diamagnetic" + integer(ids_int) :: diamagnetic_error_index=ids_int_invalid !Index in the error_description list for "diamagnetic" + real(ids_real), pointer :: parallel(:) => null() !Parallel component + real(ids_real), pointer :: parallel_error_upper(:) => null() !Upper error for "parallel" + real(ids_real), pointer :: parallel_error_lower(:) => null() !Lower error for "parallel" + integer(ids_int) :: parallel_error_index=ids_int_invalid !Index in the error_description list for "parallel" + real(ids_real), pointer :: poloidal(:) => null() !Poloidal component + real(ids_real), pointer :: poloidal_error_upper(:) => null() !Upper error for "poloidal" + real(ids_real), pointer :: poloidal_error_lower(:) => null() !Lower error for "poloidal" + integer(ids_int) :: poloidal_error_index=ids_int_invalid !Index in the error_description list for "poloidal" + real(ids_real), pointer :: toroidal(:) => null() !Toroidal component + real(ids_real), pointer :: toroidal_error_upper(:) => null() !Upper error for "toroidal" + real(ids_real), pointer :: toroidal_error_lower(:) => null() !Lower error for "toroidal" + integer(ids_int) :: toroidal_error_index=ids_int_invalid !Index in the error_description list for "toroidal" + end type + + type :: ids_edge_profiles_profiles_1d + type(ids_edge_radial_grid) :: grid !Radial grid + type(ids_edge_profiles_profiles_1d_electrons) :: electrons !Quantities related to the electrons + type(ids_edge_profile_ions), pointer :: ion(:) => null() !Quantities related to the different ion species, in the sense of isonuclear or isomolecular sequences. Ionisation states (and othe! + !r types of states) must be differentiated at the state level below + type(ids_edge_profile_neutral), pointer :: neutral(:) => null() !Quantities related to the different neutral species + real(ids_real), pointer :: t_i_average(:) => null() !Ion temperature (averaged on charge states and ion species) + real(ids_real), pointer :: t_i_average_error_upper(:) => null() !Upper error for "t_i_average" + real(ids_real), pointer :: t_i_average_error_lower(:) => null() !Lower error for "t_i_average" + integer(ids_int) :: t_i_average_error_index=ids_int_invalid !Index in the error_description list for "t_i_average" + type(ids_edge_profiles_1d_fit) :: t_i_average_fit !Information on the fit used to obtain the t_i_average profile + real(ids_real), pointer :: n_i_total_over_n_e(:) => null() !Ratio of total ion density (sum over species and charge states) over electron density. (thermal+non-thermal) + real(ids_real), pointer :: n_i_total_over_n_e_error_upper(:) => null() !Upper error for "n_i_total_over_n_e" + real(ids_real), pointer :: n_i_total_over_n_e_error_lower(:) => null() !Lower error for "n_i_total_over_n_e" + integer(ids_int) :: n_i_total_over_n_e_error_index=ids_int_invalid !Index in the error_description list for "n_i_total_over_n_e" + real(ids_real), pointer :: n_i_thermal_total(:) => null() !Total ion thermal density (sum over species and charge states) + real(ids_real), pointer :: n_i_thermal_total_error_upper(:) => null() !Upper error for "n_i_thermal_total" + real(ids_real), pointer :: n_i_thermal_total_error_lower(:) => null() !Lower error for "n_i_thermal_total" + integer(ids_int) :: n_i_thermal_total_error_index=ids_int_invalid !Index in the error_description list for "n_i_thermal_total" + real(ids_real), pointer :: momentum_tor(:) => null() !Total plasma toroidal momentum, summed over ion species and electrons weighted by their density and major radius, i.e. sum_over_sp! + !ecies(n*R*m*Vphi) + real(ids_real), pointer :: momentum_tor_error_upper(:) => null() !Upper error for "momentum_tor" + real(ids_real), pointer :: momentum_tor_error_lower(:) => null() !Lower error for "momentum_tor" + integer(ids_int) :: momentum_tor_error_index=ids_int_invalid !Index in the error_description list for "momentum_tor" + real(ids_real), pointer :: zeff(:) => null() !Effective charge + real(ids_real), pointer :: zeff_error_upper(:) => null() !Upper error for "zeff" + real(ids_real), pointer :: zeff_error_lower(:) => null() !Lower error for "zeff" + integer(ids_int) :: zeff_error_index=ids_int_invalid !Index in the error_description list for "zeff" + type(ids_edge_profiles_1d_fit) :: zeff_fit !Information on the fit used to obtain the zeff profile + real(ids_real), pointer :: pressure_ion_total(:) => null() !Total (sum over ion species) thermal ion pressure + real(ids_real), pointer :: pressure_ion_total_error_upper(:) => null() !Upper error for "pressure_ion_total" + real(ids_real), pointer :: pressure_ion_total_error_lower(:) => null() !Lower error for "pressure_ion_total" + integer(ids_int) :: pressure_ion_total_error_index=ids_int_invalid !Index in the error_description list for "pressure_ion_total" + real(ids_real), pointer :: pressure_thermal(:) => null() !Thermal pressure (electrons+ions) + real(ids_real), pointer :: pressure_thermal_error_upper(:) => null() !Upper error for "pressure_thermal" + real(ids_real), pointer :: pressure_thermal_error_lower(:) => null() !Lower error for "pressure_thermal" + integer(ids_int) :: pressure_thermal_error_index=ids_int_invalid !Index in the error_description list for "pressure_thermal" + real(ids_real), pointer :: pressure_perpendicular(:) => null() !Total perpendicular pressure (electrons+ions, thermal+non-thermal) + real(ids_real), pointer :: pressure_perpendicular_error_upper(:) => null() !Upper error for "pressure_perpendicular" + real(ids_real), pointer :: pressure_perpendicular_error_lower(:) => null() !Lower error for "pressure_perpendicular" + integer(ids_int) :: pressure_perpendicular_error_index=ids_int_invalid !Index in the error_description list for "pressure_perpendicular" + real(ids_real), pointer :: pressure_parallel(:) => null() !Total parallel pressure (electrons+ions, thermal+non-thermal) + real(ids_real), pointer :: pressure_parallel_error_upper(:) => null() !Upper error for "pressure_parallel" + real(ids_real), pointer :: pressure_parallel_error_lower(:) => null() !Lower error for "pressure_parallel" + integer(ids_int) :: pressure_parallel_error_index=ids_int_invalid !Index in the error_description list for "pressure_parallel" + real(ids_real), pointer :: j_total(:) => null() !Total parallel current density = average(jtot.B) / B0, where B0 = edge_profiles/Vacuum_Toroidal_Field/ B0 + real(ids_real), pointer :: j_total_error_upper(:) => null() !Upper error for "j_total" + real(ids_real), pointer :: j_total_error_lower(:) => null() !Lower error for "j_total" + integer(ids_int) :: j_total_error_index=ids_int_invalid !Index in the error_description list for "j_total" + real(ids_real), pointer :: current_parallel_inside(:) => null() !Parallel current driven inside the flux surface. Cumulative surface integral of j_total + real(ids_real), pointer :: current_parallel_inside_error_upper(:) => null() !Upper error for "current_parallel_inside" + real(ids_real), pointer :: current_parallel_inside_error_lower(:) => null() !Lower error for "current_parallel_inside" + integer(ids_int) :: current_parallel_inside_error_index=ids_int_invalid !Index in the error_description list for "current_parallel_inside" + real(ids_real), pointer :: j_tor(:) => null() !Total toroidal current density = average(J_Tor/R) / average(1/R) + real(ids_real), pointer :: j_tor_error_upper(:) => null() !Upper error for "j_tor" + real(ids_real), pointer :: j_tor_error_lower(:) => null() !Lower error for "j_tor" + integer(ids_int) :: j_tor_error_index=ids_int_invalid !Index in the error_description list for "j_tor" + real(ids_real), pointer :: j_ohmic(:) => null() !Ohmic parallel current density = average(J_Ohmic.B) / B0, where B0 = edge_profiles/Vacuum_Toroidal_Field/ B0 + real(ids_real), pointer :: j_ohmic_error_upper(:) => null() !Upper error for "j_ohmic" + real(ids_real), pointer :: j_ohmic_error_lower(:) => null() !Lower error for "j_ohmic" + integer(ids_int) :: j_ohmic_error_index=ids_int_invalid !Index in the error_description list for "j_ohmic" + real(ids_real), pointer :: j_non_inductive(:) => null() !Non-inductive (includes bootstrap) parallel current density = average(jni.B) / B0, where B0 = edge_profiles/Vacuum_Toroidal_Field/! + ! B0 + real(ids_real), pointer :: j_non_inductive_error_upper(:) => null() !Upper error for "j_non_inductive" + real(ids_real), pointer :: j_non_inductive_error_lower(:) => null() !Lower error for "j_non_inductive" + integer(ids_int) :: j_non_inductive_error_index=ids_int_invalid !Index in the error_description list for "j_non_inductive" + real(ids_real), pointer :: j_bootstrap(:) => null() !Bootstrap current density = average(J_Bootstrap.B) / B0, where B0 = edge_profiles/Vacuum_Toroidal_Field/ B0 + real(ids_real), pointer :: j_bootstrap_error_upper(:) => null() !Upper error for "j_bootstrap" + real(ids_real), pointer :: j_bootstrap_error_lower(:) => null() !Lower error for "j_bootstrap" + integer(ids_int) :: j_bootstrap_error_index=ids_int_invalid !Index in the error_description list for "j_bootstrap" + real(ids_real), pointer :: conductivity_parallel(:) => null() !Parallel conductivity + real(ids_real), pointer :: conductivity_parallel_error_upper(:) => null() !Upper error for "conductivity_parallel" + real(ids_real), pointer :: conductivity_parallel_error_lower(:) => null() !Lower error for "conductivity_parallel" + integer(ids_int) :: conductivity_parallel_error_index=ids_int_invalid !Index in the error_description list for "conductivity_parallel" + real(ids_real), pointer :: e_field_parallel(:) => null() !Parallel electric field = average(E.B) / B0, where edge_profiles/Vacuum_Toroidal_Field/ B0 + real(ids_real), pointer :: e_field_parallel_error_upper(:) => null() !Upper error for "e_field_parallel" + real(ids_real), pointer :: e_field_parallel_error_lower(:) => null() !Lower error for "e_field_parallel" + integer(ids_int) :: e_field_parallel_error_index=ids_int_invalid !Index in the error_description list for "e_field_parallel" + type(ids_edge_profiles_vector_components_1) :: e_field !Electric field, averaged on the magnetic surface. E.g for the parallel component, average(E.B) / B0, using edge_profiles/vacuum_to! + !roidal_field/b0 + real(ids_real), pointer :: phi_potential(:) => null() !Electrostatic potential, averaged on the magnetic flux surface + real(ids_real), pointer :: phi_potential_error_upper(:) => null() !Upper error for "phi_potential" + real(ids_real), pointer :: phi_potential_error_lower(:) => null() !Lower error for "phi_potential" + integer(ids_int) :: phi_potential_error_index=ids_int_invalid !Index in the error_description list for "phi_potential" + real(ids_real), pointer :: rotation_frequency_tor_sonic(:) => null() !Derivative of the flux surface averaged electrostatic potential with respect to the poloidal flux, multiplied by -1. This quantity! + ! is the toroidal angular rotation frequency due to the ExB drift, introduced in formula (43) of Hinton and Wong, Physics of Fluids! + ! 3082 (1985), also referred to as sonic flow in regimes in which the toroidal velocity is dominant over the poloidal velocity + real(ids_real), pointer :: rotation_frequency_tor_sonic_error_upper(:) => null() !Upper error for "rotation_frequency_tor_sonic" + real(ids_real), pointer :: rotation_frequency_tor_sonic_error_lower(:) => null() !Lower error for "rotation_frequency_tor_sonic" + integer(ids_int) :: rotation_frequency_tor_sonic_error_index=ids_int_invalid !Index in the error_description list for "rotation_frequency_tor_sonic" + real(ids_real), pointer :: q(:) => null() !Safety factor + real(ids_real), pointer :: q_error_upper(:) => null() !Upper error for "q" + real(ids_real), pointer :: q_error_lower(:) => null() !Lower error for "q" + integer(ids_int) :: q_error_index=ids_int_invalid !Index in the error_description list for "q" + real(ids_real), pointer :: magnetic_shear(:) => null() !Magnetic shear, defined as rho_tor/q . dq/drho_tor + real(ids_real), pointer :: magnetic_shear_error_upper(:) => null() !Upper error for "magnetic_shear" + real(ids_real), pointer :: magnetic_shear_error_lower(:) => null() !Lower error for "magnetic_shear" + integer(ids_int) :: magnetic_shear_error_index=ids_int_invalid !Index in the error_description list for "magnetic_shear" + real(ids_real) :: time=ids_real_invalid !Time + end type + + type :: ids_edge_profiles_time_slice_electrons + type(ids_generic_grid_scalar), pointer :: temperature(:) => null() !Temperature, given on various grid subsets + type(ids_generic_grid_scalar), pointer :: density(:) => null() !Density (thermal+non-thermal), given on various grid subsets + type(ids_generic_grid_scalar), pointer :: density_fast(:) => null() !Density of fast (non-thermal) particles, given on various grid subsets + type(ids_generic_grid_scalar), pointer :: pressure(:) => null() !Pressure, given on various grid subsets + type(ids_generic_grid_scalar), pointer :: pressure_fast_perpendicular(:) => null() !Fast (non-thermal) perpendicular pressure, given on various grid subsets + type(ids_generic_grid_scalar), pointer :: pressure_fast_parallel(:) => null() !Fast (non-thermal) parallel pressure, given on various grid subsets + type(ids_generic_grid_vector_components), pointer :: velocity(:) => null() !Velocity, given on various grid subsets + type(ids_generic_grid_scalar), pointer :: distribution_function(:) => null() !Distribution function, given on various grid subsets + end type + + type :: ids_edge_profiles_time_slice_ion_charge_state + real(ids_real) :: z_min=ids_real_invalid !Minimum Z of the state bundle (z_min = z_max = 0 for a neutral) + real(ids_real) :: z_min_error_upper=ids_real_invalid !Upper error for "z_min" + real(ids_real) :: z_min_error_lower=ids_real_invalid !Lower error for "z_min" + integer(ids_int) :: z_min_error_index=ids_int_invalid !Index in the error_description list for "z_min" + real(ids_real) :: z_max=ids_real_invalid !Maximum Z of the state bundle (equal to z_min if no bundle) + real(ids_real) :: z_max_error_upper=ids_real_invalid !Upper error for "z_max" + real(ids_real) :: z_max_error_lower=ids_real_invalid !Lower error for "z_max" + integer(ids_int) :: z_max_error_index=ids_int_invalid !Index in the error_description list for "z_max" + type(ids_generic_grid_scalar), pointer :: z_average(:) => null() !Average Z of the state bundle (equal to z_min if no bundle), = sum (Z*x_z) where x_z is the relative concentration of a given char! + !ge state in the bundle, i.e. sum(x_z) = 1 over the bundle, given on various grid subsets + type(ids_generic_grid_scalar), pointer :: z_square_average(:) => null() !Average Z square of the state bundle (equal to z_min if no bundle), = sum (Z^2*x_z) where x_z is the relative concentration of a g! + !iven charge state in the bundle, i.e. sum(x_z) = 1 over the bundle, given on various grid subsets + type(ids_generic_grid_scalar), pointer :: ionisation_potential(:) => null() !Cumulative and average ionisation potential to reach a given bundle. Defined as sum (x_z* (sum of Epot from z'=0 to z-1)), where E! + !pot is the ionisation potential of ion Xz_+, and x_z is the relative concentration of a given charge state in the bundle, i.e. sum! + !(x_z) = 1 over the bundle, given on various grid subsets + character(len=ids_string_length), dimension(:), pointer :: label => null() !String identifying state (e.g. C+, C+2 , C+3, C+4, C+5, C+6, ...) + character(len=ids_string_length), dimension(:), pointer :: electron_configuration => null() !Configuration of atomic orbitals of this state, e.g. 1s2-2s1 + real(ids_real) :: vibrational_level=ids_real_invalid !Vibrational level (can be bundled) + real(ids_real) :: vibrational_level_error_upper=ids_real_invalid !Upper error for "vibrational_level" + real(ids_real) :: vibrational_level_error_lower=ids_real_invalid !Lower error for "vibrational_level" + integer(ids_int) :: vibrational_level_error_index=ids_int_invalid !Index in the error_description list for "vibrational_level" + character(len=ids_string_length), dimension(:), pointer :: vibrational_mode => null() !Vibrational mode of this state, e.g. "A_g". Need to define, or adopt a standard nomenclature. + type(ids_generic_grid_scalar), pointer :: temperature(:) => null() !Temperature, given on various grid subsets + type(ids_generic_grid_scalar), pointer :: density(:) => null() !Density (thermal+non-thermal), given on various grid subsets + type(ids_generic_grid_scalar), pointer :: density_fast(:) => null() !Density of fast (non-thermal) particles, given on various grid subsets + type(ids_generic_grid_scalar), pointer :: pressure(:) => null() !Pressure, given on various grid subsets + type(ids_generic_grid_scalar), pointer :: pressure_fast_perpendicular(:) => null() !Fast (non-thermal) perpendicular pressure, given on various grid subsets + type(ids_generic_grid_scalar), pointer :: pressure_fast_parallel(:) => null() !Fast (non-thermal) parallel pressure, given on various grid subsets + type(ids_generic_grid_vector_components), pointer :: velocity(:) => null() !Velocity, given on various grid subsets + type(ids_generic_grid_vector_components), pointer :: velocity_diamagnetic(:) => null() !Velocity due to the diamagnetic drift, given on various grid subsets + type(ids_generic_grid_vector_components), pointer :: velocity_exb(:) => null() !Velocity due to the ExB drift, given on various grid subsets + type(ids_generic_grid_scalar), pointer :: energy_density_kinetic(:) => null() !Kinetic energy density, given on various grid subsets + type(ids_generic_grid_scalar), pointer :: distribution_function(:) => null() !Distribution function, given on various grid subsets + end type + + type :: ids_edge_profiles_time_slice_ion + type(ids_plasma_composition_neutral_element), pointer :: element(:) => null() !List of elements forming the atom or molecule + real(ids_real) :: z_ion=ids_real_invalid !Ion charge (of the dominant ionisation state; lumped ions are allowed). + real(ids_real) :: z_ion_error_upper=ids_real_invalid !Upper error for "z_ion" + real(ids_real) :: z_ion_error_lower=ids_real_invalid !Lower error for "z_ion" + integer(ids_int) :: z_ion_error_index=ids_int_invalid !Index in the error_description list for "z_ion" + character(len=ids_string_length), dimension(:), pointer :: label => null() !String identifying the species (e.g. H+, D+, T+, He+2, C+, D2, DT, CD4, ...) + integer(ids_int) :: neutral_index=ids_int_invalid !Index of the corresponding neutral species in the ../../neutral array + type(ids_generic_grid_scalar), pointer :: temperature(:) => null() !Temperature (average over states when multiple states are considered), given on various grid subsets + type(ids_generic_grid_scalar), pointer :: density(:) => null() !Density (thermal+non-thermal) (sum over states when multiple states are considered), given on various grid subsets + type(ids_generic_grid_scalar), pointer :: density_fast(:) => null() !Density of fast (non-thermal) particles (sum over states when multiple states are considered), given on various grid subsets + type(ids_generic_grid_scalar), pointer :: pressure(:) => null() !Pressure (average over states when multiple states are considered), given on various grid subsets + type(ids_generic_grid_scalar), pointer :: pressure_fast_perpendicular(:) => null() !Fast (non-thermal) perpendicular pressure (average over states when multiple states are considered), given on various grid subsets + type(ids_generic_grid_scalar), pointer :: pressure_fast_parallel(:) => null() !Fast (non-thermal) parallel pressure (average over states when multiple states are considered), given on various grid subsets + type(ids_generic_grid_vector_components), pointer :: velocity(:) => null() !Velocity (average over states when multiple states are considered), given on various grid subsets + type(ids_generic_grid_scalar), pointer :: energy_density_kinetic(:) => null() !Kinetic energy density (sum over states when multiple states are considered), given on various grid subsets + integer(ids_int) :: multiple_states_flag=ids_int_invalid !Multiple state calculation flag : 0-Only one state is considered; 1-Multiple states are considered and are described in the state ! + !structure + type(ids_edge_profiles_time_slice_ion_charge_state), pointer :: state(:) => null() !Quantities related to the different states of the species (ionisation, energy, excitation, ...) + end type + + type :: ids_edge_profiles_time_slice_neutral_state + character(len=ids_string_length), dimension(:), pointer :: label => null() !String identifying state + character(len=ids_string_length), dimension(:), pointer :: electron_configuration => null() !Configuration of atomic orbitals of this state, e.g. 1s2-2s1 + real(ids_real) :: vibrational_level=ids_real_invalid !Vibrational level (can be bundled) + real(ids_real) :: vibrational_level_error_upper=ids_real_invalid !Upper error for "vibrational_level" + real(ids_real) :: vibrational_level_error_lower=ids_real_invalid !Lower error for "vibrational_level" + integer(ids_int) :: vibrational_level_error_index=ids_int_invalid !Index in the error_description list for "vibrational_level" + character(len=ids_string_length), dimension(:), pointer :: vibrational_mode => null() !Vibrational mode of this state, e.g. "A_g". Need to define, or adopt a standard nomenclature. + type(ids_identifier_dynamic_aos3) :: neutral_type !Neutral type, in terms of energy. ID =1: cold; 2: thermal; 3: fast; 4: NBI + type(ids_generic_grid_scalar), pointer :: temperature(:) => null() !Temperature, given on various grid subsets + type(ids_generic_grid_scalar), pointer :: density(:) => null() !Density (thermal+non-thermal), given on various grid subsets + type(ids_generic_grid_scalar), pointer :: density_fast(:) => null() !Density of fast (non-thermal) particles, given on various grid subsets + type(ids_generic_grid_scalar), pointer :: pressure(:) => null() !Pressure, given on various grid subsets + type(ids_generic_grid_scalar), pointer :: pressure_fast_perpendicular(:) => null() !Fast (non-thermal) perpendicular pressure, given on various grid subsets + type(ids_generic_grid_scalar), pointer :: pressure_fast_parallel(:) => null() !Fast (non-thermal) parallel pressure, given on various grid subsets + type(ids_generic_grid_vector_components), pointer :: velocity(:) => null() !Velocity, given on various grid subsets + type(ids_generic_grid_vector_components), pointer :: velocity_diamagnetic(:) => null() !Velocity due to the diamagnetic drift, given on various grid subsets + type(ids_generic_grid_vector_components), pointer :: velocity_exb(:) => null() !Velocity due to the ExB drift, given on various grid subsets + type(ids_generic_grid_scalar), pointer :: energy_density_kinetic(:) => null() !Kinetic energy density, given on various grid subsets + type(ids_generic_grid_scalar), pointer :: distribution_function(:) => null() !Distribution function, given on various grid subsets + end type + + type :: ids_edge_profiles_time_slice_neutral + type(ids_plasma_composition_neutral_element), pointer :: element(:) => null() !List of elements forming the atom or molecule + character(len=ids_string_length), dimension(:), pointer :: label => null() !String identifying the species (e.g. H, D, T, He, C, D2, DT, CD4, ...) + integer(ids_int) :: ion_index=ids_int_invalid !Index of the corresponding ion species in the ../../ion array + type(ids_generic_grid_scalar), pointer :: temperature(:) => null() !Temperature (average over states when multiple states are considered), given on various grid subsets + type(ids_generic_grid_scalar), pointer :: density(:) => null() !Density (thermal+non-thermal) (sum over states when multiple states are considered), given on various grid subsets + type(ids_generic_grid_scalar), pointer :: density_fast(:) => null() !Density of fast (non-thermal) particles (sum over states when multiple states are considered), given on various grid subsets + type(ids_generic_grid_scalar), pointer :: pressure(:) => null() !Pressure (average over states when multiple states are considered), given on various grid subsets + type(ids_generic_grid_scalar), pointer :: pressure_fast_perpendicular(:) => null() !Fast (non-thermal) perpendicular pressure (average over states when multiple states are considered), given on various grid subsets + type(ids_generic_grid_scalar), pointer :: pressure_fast_parallel(:) => null() !Fast (non-thermal) parallel pressure (average over states when multiple states are considered), given on various grid subsets + type(ids_generic_grid_vector_components), pointer :: velocity(:) => null() !Velocity (average over states when multiple states are considered), given on various grid subsets + type(ids_generic_grid_scalar), pointer :: energy_density_kinetic(:) => null() !Kinetic energy density (sum over states when multiple states are considered), given on various grid subsets + integer(ids_int) :: multiple_states_flag=ids_int_invalid !Multiple state calculation flag : 0-Only one state is considered; 1-Multiple states are considered and are described in the state ! + !structure + type(ids_edge_profiles_time_slice_neutral_state), pointer :: state(:) => null() !Quantities related to the different states of the species (energy, excitation, ...) + end type + + type :: ids_edge_profiles_time_slice + type(ids_edge_profiles_time_slice_electrons) :: electrons !Quantities related to the electrons + type(ids_edge_profiles_time_slice_ion), pointer :: ion(:) => null() !Quantities related to the different ion species + type(ids_edge_profiles_time_slice_neutral), pointer :: neutral(:) => null() !Quantities related to the different neutral species + type(ids_generic_grid_scalar), pointer :: t_i_average(:) => null() !Ion temperature (averaged on ion species), given on various grid subsets + type(ids_generic_grid_scalar), pointer :: n_i_total_over_n_e(:) => null() !Ratio of total ion density (sum over ion species) over electron density. (thermal+non-thermal), given on various grid subsets + type(ids_generic_grid_scalar), pointer :: zeff(:) => null() !Effective charge, given on various grid subsets + type(ids_generic_grid_scalar), pointer :: pressure_thermal(:) => null() !Thermal pressure (electrons+ions), given on various grid subsets + type(ids_generic_grid_scalar), pointer :: pressure_perpendicular(:) => null() !Total perpendicular pressure (electrons+ions, thermal+non-thermal), given on various grid subsets + type(ids_generic_grid_scalar), pointer :: pressure_parallel(:) => null() !Total parallel pressure (electrons+ions, thermal+non-thermal), given on various grid subsets + type(ids_generic_grid_vector_components), pointer :: j_total(:) => null() !Total current density, given on various grid subsets + type(ids_generic_grid_scalar), pointer :: j_parallel(:) => null() !Current due to parallel electric and thermo-electric conductivity and potential and electron temperature gradients along the field! + ! line, differences away from ambipolar flow in the parallel direction between ions and electrons (this is not the parallel compone! + !nt of j_total) + type(ids_generic_grid_vector_components), pointer :: j_anomalous(:) => null() !Anomalous current density, given on various grid subsets + type(ids_generic_grid_vector_components), pointer :: j_inertial(:) => null() !Inertial current density, given on various grid subsets + type(ids_generic_grid_vector_components), pointer :: j_ion_neutral_friction(:) => null() !Current density due to ion neutral friction, given on various grid subsets + type(ids_generic_grid_vector_components), pointer :: j_parallel_viscosity(:) => null() !Current density due to the parallel viscosity, given on various grid subsets + type(ids_generic_grid_vector_components), pointer :: j_perpendicular_viscosity(:) => null() !Current density due to the perpendicular viscosity, given on various grid subsets + type(ids_generic_grid_vector_components), pointer :: j_heat_viscosity(:) => null() !Current density due to the heat viscosity, given on various grid subsets + type(ids_generic_grid_vector_components), pointer :: j_pfirsch_schlueter(:) => null() !Current density due to Pfirsch-Schlüter effects, given on various grid subsets + type(ids_generic_grid_vector_components), pointer :: j_diamagnetic(:) => null() !Current density due to the diamgnetic drift, given on various grid subsets + type(ids_generic_grid_vector_components), pointer :: e_field(:) => null() !Electric field, given on various grid subsets + type(ids_generic_grid_scalar), pointer :: phi_potential(:) => null() !Electric potential, given on various grid subsets + real(ids_real) :: time=ids_real_invalid !Time + end type + + type :: ids_edge_profiles_ggd_fast_electrons + type(ids_generic_grid_scalar_single_position), pointer :: temperature(:) => null() !Temperature, given at various positions (grid subset of size 1) + type(ids_generic_grid_scalar_single_position), pointer :: density(:) => null() !Density (thermal+non-thermal), given at various positions (grid subset of size 1) + end type + + type :: ids_edge_profiles_ggd_fast_ion + type(ids_plasma_composition_neutral_element), pointer :: element(:) => null() !List of elements forming the atom or molecule + real(ids_real) :: z_ion=ids_real_invalid !Ion charge (of the dominant ionisation state; lumped ions are allowed). + real(ids_real) :: z_ion_error_upper=ids_real_invalid !Upper error for "z_ion" + real(ids_real) :: z_ion_error_lower=ids_real_invalid !Lower error for "z_ion" + integer(ids_int) :: z_ion_error_index=ids_int_invalid !Index in the error_description list for "z_ion" + character(len=ids_string_length), dimension(:), pointer :: label => null() !String identifying the species (e.g. H+, D+, T+, He+2, C+, D2, DT, CD4, ...) + integer(ids_int) :: neutral_index=ids_int_invalid !Index of the corresponding neutral species in the ../../neutral array + type(ids_generic_grid_scalar_single_position), pointer :: content(:) => null() !Particle content = total number of particles for this ion species in the volume of the grid subset, for various grid subsets + type(ids_generic_grid_scalar_single_position), pointer :: temperature(:) => null() !Temperature (average over states when multiple states are considered), given at various positions (grid subset of size 1) + type(ids_generic_grid_scalar_single_position), pointer :: density(:) => null() !Density (thermal+non-thermal) (sum over states when multiple states are considered), given at various positions (grid subset of si! + !ze 1) + end type + + type :: ids_edge_profiles_ggd_fast + type(ids_edge_profiles_ggd_fast_electrons) :: electrons !Quantities related to the electrons + type(ids_edge_profiles_ggd_fast_ion), pointer :: ion(:) => null() !Quantities related to the different ion species + type(ids_generic_grid_scalar_single_position), pointer :: energy_thermal(:) => null() !Plasma energy content = 3/2 * integral over the volume of the grid subset of the thermal pressure (summed over all species), for v! + !arious grid subsets + real(ids_real) :: time=ids_real_invalid !Time + end type + + + ! *********** edge_profiles IDS + type, extends(IDS_base) :: ids_edge_profiles !Edge plasma profiles (includes the scrape-off layer and possibly part of the confined plasma) + logical, private :: c_data = .FALSE. ! Fortran specific metadata telling whether the IDS has been populated from C allocated data (LL) or not + integer, private :: max_occurrence = 10! Maximum occurrence allowed as defined in the DD + + type(ids_ids_properties) :: ids_properties !Interface Data Structure properties. This element identifies the node above as an IDS + type(ids_b_tor_vacuum_1) :: vacuum_toroidal_field !Characteristics of the vacuum toroidal field (used in rho_tor definition and in the normalization of current densities) + type(ids_identifier_static) :: midplane !Choice of midplane definition (use the lowest index number if more than one value is relevant) + type(ids_edge_profiles_profiles_1d), pointer :: profiles_1d(:) => null() !SOL radial profiles for various time slices, taken on outboard equatorial mid-plane + type(ids_generic_grid_aos3_root), pointer :: grid_ggd(:) => null() !Grid (using the Generic Grid Description), for various time slices. The timebase of this array of structure must be a subset of th! + !e ggd timebase + type(ids_edge_profiles_time_slice), pointer :: ggd(:) => null() !Edge plasma quantities represented using the general grid description, for various time slices. The timebase of this array of stru! + !cture must be a subset of the ggd_fast timebase (only if the ggd_fast array of structure is used) + type(ids_edge_profiles_ggd_fast), pointer :: ggd_fast(:) => null() !Quantities provided at a faster sampling rate than the full ggd quantities. These are either integrated quantities or local quanti! + !ties provided on a reduced set of positions. Positions and integration domains are described by a set of grid_subsets (of size 1 f! + !or a position). + type(ids_code) :: code !Generic decription of the code-specific parameters for the code that has produced this IDS + real(ids_real), pointer :: time(:) => null() !Generic time + end type + + ! *********** edge_sources IDS internal structures declaration + + type :: ids_edge_sources_source_ggd_electrons + type(ids_generic_grid_scalar), pointer :: particles(:) => null() !Source term for electron density equation, given on various grid subsets + type(ids_generic_grid_scalar), pointer :: energy(:) => null() !Source term for the electron energy equation, given on various grid subsets + end type + + type :: ids_edge_sources_source_ggd_ion_state + real(ids_real) :: z_min=ids_real_invalid !Minimum Z of the state bundle + real(ids_real) :: z_min_error_upper=ids_real_invalid !Upper error for "z_min" + real(ids_real) :: z_min_error_lower=ids_real_invalid !Lower error for "z_min" + integer(ids_int) :: z_min_error_index=ids_int_invalid !Index in the error_description list for "z_min" + real(ids_real) :: z_max=ids_real_invalid !Maximum Z of the state bundle + real(ids_real) :: z_max_error_upper=ids_real_invalid !Upper error for "z_max" + real(ids_real) :: z_max_error_lower=ids_real_invalid !Lower error for "z_max" + integer(ids_int) :: z_max_error_index=ids_int_invalid !Index in the error_description list for "z_max" + character(len=ids_string_length), dimension(:), pointer :: label => null() !String identifying state (e.g. C+, C+2 , C+3, C+4, C+5, C+6, ...) + real(ids_real) :: vibrational_level=ids_real_invalid !Vibrational level (can be bundled) + real(ids_real) :: vibrational_level_error_upper=ids_real_invalid !Upper error for "vibrational_level" + real(ids_real) :: vibrational_level_error_lower=ids_real_invalid !Lower error for "vibrational_level" + integer(ids_int) :: vibrational_level_error_index=ids_int_invalid !Index in the error_description list for "vibrational_level" + character(len=ids_string_length), dimension(:), pointer :: vibrational_mode => null() !Vibrational mode of this state, e.g. "A_g". Need to define, or adopt a standard nomenclature. + character(len=ids_string_length), dimension(:), pointer :: electron_configuration => null() !Configuration of atomic orbitals of this state, e.g. 1s2-2s1 + type(ids_generic_grid_scalar), pointer :: particles(:) => null() !Source term for the state density transport equation + type(ids_generic_grid_scalar), pointer :: energy(:) => null() !Source terms for the state energy transport equation + type(ids_generic_grid_vector_components), pointer :: momentum(:) => null() !Source term for momentum equations, on various grid subsets + end type + + type :: ids_edge_sources_source_ggd_ion + type(ids_plasma_composition_neutral_element), pointer :: element(:) => null() !List of elements forming the atom or molecule + real(ids_real) :: z_ion=ids_real_invalid !Ion charge (of the dominant ionisation state; lumped ions are allowed) + real(ids_real) :: z_ion_error_upper=ids_real_invalid !Upper error for "z_ion" + real(ids_real) :: z_ion_error_lower=ids_real_invalid !Lower error for "z_ion" + integer(ids_int) :: z_ion_error_index=ids_int_invalid !Index in the error_description list for "z_ion" + character(len=ids_string_length), dimension(:), pointer :: label => null() !String identifying ion (e.g. H, D, T, He, C, D2, ...) + integer(ids_int) :: neutral_index=ids_int_invalid !Index of the corresponding neutral species in the ../../neutral array + type(ids_generic_grid_scalar), pointer :: particles(:) => null() !Source term for ion density equation, on various grid subsets + type(ids_generic_grid_scalar), pointer :: energy(:) => null() !Source term for the ion energy transport equation, on various grid subsets + type(ids_generic_grid_vector_components), pointer :: momentum(:) => null() !Source term for momentum equations (sum over states when multiple states are considered), on various grid subsets + integer(ids_int) :: multiple_states_flag=ids_int_invalid !Multiple states calculation flag : 0-Only the 'ion' level is considered and the 'state' array of structure is empty; 1-Ion states ! + !are considered and are described in the 'state' array of structure + type(ids_edge_sources_source_ggd_ion_state), pointer :: state(:) => null() !Source terms related to the different states of the species (ionisation, energy, excitation, ...) + end type + + type :: ids_edge_sources_source_ggd_neutral_state + character(len=ids_string_length), dimension(:), pointer :: label => null() !String identifying state + real(ids_real) :: vibrational_level=ids_real_invalid !Vibrational level (can be bundled) + real(ids_real) :: vibrational_level_error_upper=ids_real_invalid !Upper error for "vibrational_level" + real(ids_real) :: vibrational_level_error_lower=ids_real_invalid !Lower error for "vibrational_level" + integer(ids_int) :: vibrational_level_error_index=ids_int_invalid !Index in the error_description list for "vibrational_level" + character(len=ids_string_length), dimension(:), pointer :: vibrational_mode => null() !Vibrational mode of this state, e.g. "A_g". Need to define, or adopt a standard nomenclature. + character(len=ids_string_length), dimension(:), pointer :: electron_configuration => null() !Configuration of atomic orbitals of this state, e.g. 1s2-2s1 + type(ids_identifier_dynamic_aos3) :: neutral_type !Neutral type, in terms of energy. ID =1: cold; 2: thermal; 3: fast; 4: NBI + type(ids_generic_grid_scalar), pointer :: particles(:) => null() !Source term for the state density transport equation + type(ids_generic_grid_scalar), pointer :: energy(:) => null() !Source terms for the state energy transport equation + type(ids_generic_grid_vector_components), pointer :: momentum(:) => null() !Source term for momentum equations, on various grid subsets + end type + + type :: ids_edge_sources_source_ggd_neutral + type(ids_plasma_composition_neutral_element), pointer :: element(:) => null() !List of elements forming the atom or molecule + character(len=ids_string_length), dimension(:), pointer :: label => null() !String identifying neutral (e.g. H, D, T, He, C, ...) + integer(ids_int) :: ion_index=ids_int_invalid !Index of the corresponding ion species in the ../../ion array + type(ids_generic_grid_scalar), pointer :: particles(:) => null() !Source term for ion density equation, on various grid subsets + type(ids_generic_grid_scalar), pointer :: energy(:) => null() !Source term for the ion energy transport equation, on various grid subsets + type(ids_generic_grid_vector_components), pointer :: momentum(:) => null() !Source term for momentum equations (sum over states when multiple states are considered), on various grid subsets + integer(ids_int) :: multiple_states_flag=ids_int_invalid !Multiple states calculation flag : 0-Only one state is considered; 1-Multiple states are considered and are described in the state! + ! structure + type(ids_edge_sources_source_ggd_neutral_state), pointer :: state(:) => null() !Source terms related to the different states of the species (energy, excitation, ...) + end type + + type :: ids_edge_sources_source_ggd + type(ids_edge_sources_source_ggd_electrons) :: electrons !Sources for electrons + type(ids_edge_sources_source_ggd_ion), pointer :: ion(:) => null() !Source terms related to the different ion species, in the sense of isonuclear or isomolecular sequences. Ionisation states (and ot! + !her types of states) must be differentiated at the state level below + type(ids_edge_sources_source_ggd_neutral), pointer :: neutral(:) => null() !Source terms related to the different neutral species + type(ids_generic_grid_scalar), pointer :: total_ion_energy(:) => null() !Source term for the total (summed over ion species) energy equation, on various grid subsets + type(ids_generic_grid_vector_components), pointer :: momentum(:) => null() !Source term for total momentum equations, on various grid subsets + type(ids_generic_grid_scalar), pointer :: current(:) => null() !Current density source + real(ids_real) :: time=ids_real_invalid !Time + end type + + type :: ids_edge_sources_source_ggd_fast_ion + type(ids_plasma_composition_neutral_element), pointer :: element(:) => null() !List of elements forming the atom or molecule + real(ids_real) :: z_ion=ids_real_invalid !Ion charge (of the dominant ionisation state; lumped ions are allowed) + real(ids_real) :: z_ion_error_upper=ids_real_invalid !Upper error for "z_ion" + real(ids_real) :: z_ion_error_lower=ids_real_invalid !Lower error for "z_ion" + integer(ids_int) :: z_ion_error_index=ids_int_invalid !Index in the error_description list for "z_ion" + character(len=ids_string_length), dimension(:), pointer :: label => null() !String identifying ion (e.g. H+, D+, T+, He+2, C+, ...) + integer(ids_int) :: neutral_index=ids_int_invalid !Index of the corresponding neutral species in the ../../neutral array + type(ids_generic_grid_scalar_single_position), pointer :: power(:) => null() !Total power source or sink related to this ion species, integrated over the volume of the grid subset, for various grid subsets. + end type + + type :: ids_edge_sources_source_ggd_fast + type(ids_edge_sources_source_ggd_fast_ion), pointer :: ion(:) => null() !Source term integrals related to the various ion species + real(ids_real) :: time=ids_real_invalid !Time + end type + + type :: ids_edge_sources_source + type(ids_identifier) :: identifier !Source term identifier (process causing this source term) + type(ids_distribution_species) :: species !Species causing this source term (if relevant, e.g. a particular ion or neutral state in case of line radiation) + type(ids_edge_sources_source_ggd), pointer :: ggd(:) => null() !Source terms represented using the general grid description, for various time slices + type(ids_edge_sources_source_ggd_fast), pointer :: ggd_fast(:) => null() !Quantities provided at a faster sampling rate than the full ggd quantities. These are either integrated quantities or local quanti! + !ties provided on a reduced set of positions. Positions and integration domains are described by a set of grid_subsets (of size 1 f! + !or a position). + end type + + + ! *********** edge_sources IDS + type, extends(IDS_base) :: ids_edge_sources !Edge plasma sources. Energy terms correspond to the full kinetic energy equation (i.e. the energy flux takes into account the ener! + !gy transported by the particle flux) + logical, private :: c_data = .FALSE. ! Fortran specific metadata telling whether the IDS has been populated from C allocated data (LL) or not + integer, private :: max_occurrence = 10! Maximum occurrence allowed as defined in the DD + + type(ids_ids_properties) :: ids_properties !Interface Data Structure properties. This element identifies the node above as an IDS + type(ids_identifier_static) :: midplane !Choice of midplane definition (use the lowest index number if more than one value is relevant) + type(ids_generic_grid_aos3_root), pointer :: grid_ggd(:) => null() !Grid (using the Generic Grid Description), for various time slices. The timebase of this array of structure must be a subset of th! + !e ggd timebases + type(ids_edge_sources_source), pointer :: source(:) => null() !Set of source terms + type(ids_code) :: code !Generic decription of the code-specific parameters for the code that has produced this IDS + real(ids_real), pointer :: time(:) => null() !Generic time + end type + + ! *********** edge_transport IDS internal structures declaration + + type :: ids_edge_transport_model_density + type(ids_generic_grid_scalar), pointer :: d(:) => null() !Effective diffusivity, on various grid subsets + type(ids_generic_grid_scalar), pointer :: v(:) => null() !Effective convection, on various grid subsets + type(ids_generic_grid_scalar), pointer :: flux(:) => null() !Flux, on various grid subsets + type(ids_generic_grid_scalar), pointer :: flux_limiter(:) => null() !Flux limiter coefficient, on various grid subsets + end type + + type :: ids_edge_transport_model_energy + type(ids_generic_grid_scalar), pointer :: d(:) => null() !Effective diffusivity, on various grid subsets + type(ids_generic_grid_scalar), pointer :: v(:) => null() !Effective convection, on various grid subsets + type(ids_generic_grid_scalar), pointer :: flux(:) => null() !Flux, on various grid subsets + type(ids_generic_grid_scalar), pointer :: flux_limiter(:) => null() !Flux limiter coefficient, on various grid subsets + end type + + type :: ids_edge_transport_model_electrons + type(ids_edge_transport_model_density) :: particles !Transport quantities for the electron density equation + type(ids_edge_transport_model_energy) :: energy !Transport quantities for the electron energy equation + end type + + type :: ids_edge_transport_model_momentum + type(ids_generic_grid_vector_components), pointer :: d(:) => null() !Effective diffusivity, on various grid subsets + type(ids_generic_grid_vector_components), pointer :: v(:) => null() !Effective convection, on various grid subsets + type(ids_generic_grid_vector_components), pointer :: flux(:) => null() !Flux, on various grid subsets + type(ids_generic_grid_vector_components), pointer :: flux_limiter(:) => null() !Flux limiter coefficient, on various grid subsets + end type + + type :: ids_edge_transport_model_ion_state + real(ids_real) :: z_min=ids_real_invalid !Minimum Z of the state bundle + real(ids_real) :: z_min_error_upper=ids_real_invalid !Upper error for "z_min" + real(ids_real) :: z_min_error_lower=ids_real_invalid !Lower error for "z_min" + integer(ids_int) :: z_min_error_index=ids_int_invalid !Index in the error_description list for "z_min" + real(ids_real) :: z_max=ids_real_invalid !Maximum Z of the state bundle + real(ids_real) :: z_max_error_upper=ids_real_invalid !Upper error for "z_max" + real(ids_real) :: z_max_error_lower=ids_real_invalid !Lower error for "z_max" + integer(ids_int) :: z_max_error_index=ids_int_invalid !Index in the error_description list for "z_max" + character(len=ids_string_length), dimension(:), pointer :: label => null() !String identifying state (e.g. C+, C+2 , C+3, C+4, C+5, C+6, ...) + real(ids_real) :: vibrational_level=ids_real_invalid !Vibrational level (can be bundled) + real(ids_real) :: vibrational_level_error_upper=ids_real_invalid !Upper error for "vibrational_level" + real(ids_real) :: vibrational_level_error_lower=ids_real_invalid !Lower error for "vibrational_level" + integer(ids_int) :: vibrational_level_error_index=ids_int_invalid !Index in the error_description list for "vibrational_level" + character(len=ids_string_length), dimension(:), pointer :: vibrational_mode => null() !Vibrational mode of this state, e.g. "A_g". Need to define, or adopt a standard nomenclature. + character(len=ids_string_length), dimension(:), pointer :: electron_configuration => null() !Configuration of atomic orbitals of this state, e.g. 1s2-2s1 + type(ids_edge_transport_model_density) :: particles !Transport quantities related to density equation of the state considered (thermal+non-thermal) + type(ids_edge_transport_model_energy) :: energy !Transport quantities related to the energy equation of the state considered + type(ids_edge_transport_model_momentum) :: momentum !Transport coefficients related to the momentum equations of the state considered. The various components two levels below this nod! + !e refer to the momentum vector components, while their flux is given in the direction perpendicular to the edges or faces of the g! + !rid. + end type + + type :: ids_edge_transport_model_ion + type(ids_plasma_composition_neutral_element), pointer :: element(:) => null() !List of elements forming the atom or molecule + real(ids_real) :: z_ion=ids_real_invalid !Ion charge (of the dominant ionisation state; lumped ions are allowed) + real(ids_real) :: z_ion_error_upper=ids_real_invalid !Upper error for "z_ion" + real(ids_real) :: z_ion_error_lower=ids_real_invalid !Lower error for "z_ion" + integer(ids_int) :: z_ion_error_index=ids_int_invalid !Index in the error_description list for "z_ion" + character(len=ids_string_length), dimension(:), pointer :: label => null() !String identifying ion (e.g. H, D, T, He, C, D2, ...) + integer(ids_int) :: neutral_index=ids_int_invalid !Index of the corresponding neutral species in the ../../neutral array + type(ids_edge_transport_model_density) :: particles !Transport related to the ion density equation + type(ids_edge_transport_model_energy) :: energy !Transport coefficients related to the ion energy equation + type(ids_edge_transport_model_momentum) :: momentum !Transport coefficients for the ion momentum equations. The various components two levels below this node refer to the momentum vec! + !tor components, while their flux is given in the direction perpendicular to the edges or faces of the grid. + integer(ids_int) :: multiple_states_flag=ids_int_invalid !Multiple states calculation flag : 0-Only the 'ion' level is considered and the 'state' array of structure is empty; 1-Ion states ! + !are considered and are described in the 'state' array of structure + type(ids_edge_transport_model_ion_state), pointer :: state(:) => null() !Transport coefficients related to the different states of the species + end type + + type :: ids_edge_transport_model_neutral_state + character(len=ids_string_length), dimension(:), pointer :: label => null() !String identifying state + real(ids_real) :: vibrational_level=ids_real_invalid !Vibrational level (can be bundled) + real(ids_real) :: vibrational_level_error_upper=ids_real_invalid !Upper error for "vibrational_level" + real(ids_real) :: vibrational_level_error_lower=ids_real_invalid !Lower error for "vibrational_level" + integer(ids_int) :: vibrational_level_error_index=ids_int_invalid !Index in the error_description list for "vibrational_level" + character(len=ids_string_length), dimension(:), pointer :: vibrational_mode => null() !Vibrational mode of this state, e.g. "A_g". Need to define, or adopt a standard nomenclature. + type(ids_identifier_dynamic_aos3) :: neutral_type !Neutral type, in terms of energy. ID =1: cold; 2: thermal; 3: fast; 4: NBI + character(len=ids_string_length), dimension(:), pointer :: electron_configuration => null() !Configuration of atomic orbitals of this state, e.g. 1s2-2s1 + type(ids_edge_transport_model_density) :: particles !Transport quantities related to density equation of the state considered (thermal+non-thermal) + type(ids_edge_transport_model_energy) :: energy !Transport quantities related to the energy equation of the state considered + type(ids_edge_transport_model_momentum) :: momentum !Transport coefficients related to the momentum equations of the state considered. The various components two levels below this nod! + !e refer to the momentum vector components, while their flux is given in the direction perpendicular to the edges or faces of the g! + !rid. + end type + + type :: ids_edge_transport_model_neutral + type(ids_plasma_composition_neutral_element), pointer :: element(:) => null() !List of elements forming the atom or molecule + character(len=ids_string_length), dimension(:), pointer :: label => null() !String identifying neutral (e.g. H, D, T, He, C, ...) + integer(ids_int) :: ion_index=ids_int_invalid !Index of the corresponding ion species in the ../../ion array + type(ids_edge_transport_model_density) :: particles !Transport related to the ion density equation + type(ids_edge_transport_model_energy) :: energy !Transport coefficients related to the ion energy equation + type(ids_edge_transport_model_momentum) :: momentum !Transport coefficients for the neutral momentum equations. The various components two levels below this node refer to the momentum! + ! vector components, while their flux is given in the direction perpendicular to the edges or faces of the grid. + integer(ids_int) :: multiple_states_flag=ids_int_invalid !Multiple states calculation flag : 0-Only one state is considered; 1-Multiple states are considered and are described in the state! + ! structure + type(ids_edge_transport_model_neutral_state), pointer :: state(:) => null() !Transport coefficients related to the different states of the species + end type + + type :: ids_edge_transport_model_ggd + type(ids_generic_grid_vector_components), pointer :: conductivity(:) => null() !Conductivity, on various grid subsets + type(ids_edge_transport_model_electrons) :: electrons !Transport quantities related to the electrons + type(ids_edge_transport_model_energy) :: total_ion_energy !Transport coefficients for the total (summed over ion species) energy equation + type(ids_edge_transport_model_momentum) :: momentum !Transport coefficients for total momentum equation. The various components two levels below this node refer to the momentum vector! + ! components, while their flux is given in the direction perpendicular to the edges or faces of the grid. + type(ids_edge_transport_model_ion), pointer :: ion(:) => null() !Transport coefficients related to the various ion species, in the sense of isonuclear or isomolecular sequences. Ionisation states! + ! (and other types of states) must be differentiated at the state level below + type(ids_edge_transport_model_neutral), pointer :: neutral(:) => null() !Transport coefficients related to the various neutral species + real(ids_real) :: time=ids_real_invalid !Time + end type + + type :: ids_edge_transport_model_ggd_fast_electrons + type(ids_generic_grid_scalar_single_position), pointer :: particle_flux_integrated(:) => null() !Total number of particles of this species crossing a surface per unit time, for various surfaces (grid subsets) + type(ids_generic_grid_scalar_single_position), pointer :: power(:) => null() !Power carried by this species crossing a surface, for various surfaces (grid subsets) + end type + + type :: ids_edge_transport_model_ggd_fast_ion + type(ids_plasma_composition_neutral_element), pointer :: element(:) => null() !List of elements forming the atom or molecule + real(ids_real) :: z_ion=ids_real_invalid !Ion charge (of the dominant ionisation state; lumped ions are allowed) + real(ids_real) :: z_ion_error_upper=ids_real_invalid !Upper error for "z_ion" + real(ids_real) :: z_ion_error_lower=ids_real_invalid !Lower error for "z_ion" + integer(ids_int) :: z_ion_error_index=ids_int_invalid !Index in the error_description list for "z_ion" + character(len=ids_string_length), dimension(:), pointer :: label => null() !String identifying ion (e.g. H, D, T, He, C, D2, ...) + integer(ids_int) :: neutral_index=ids_int_invalid !Index of the corresponding neutral species in the ../../neutral array + type(ids_generic_grid_scalar_single_position), pointer :: particle_flux_integrated(:) => null() !Total number of particles of this species crossing a surface per unit time, for various surfaces (grid subsets) + end type + + type :: ids_edge_transport_model_ggd_fast_neutral + type(ids_plasma_composition_neutral_element), pointer :: element(:) => null() !List of elements forming the atom or molecule + character(len=ids_string_length), dimension(:), pointer :: label => null() !String identifying neutral (e.g. H, D, T, He, C, ...) + integer(ids_int) :: ion_index=ids_int_invalid !Index of the corresponding ion species in the ../../ion array + type(ids_generic_grid_scalar_single_position), pointer :: particle_flux_integrated(:) => null() !Total number of particles of this species crossing a surface per unit time, for various surfaces (grid subsets) + end type + + type :: ids_edge_transport_model_ggd_fast + type(ids_edge_transport_model_ggd_fast_electrons) :: electrons !Transport quantities and flux integrals related to the electrons + type(ids_edge_transport_model_ggd_fast_ion), pointer :: ion(:) => null() !Transport coefficients and flux integrals related to the various ion species, in the sense of isonuclear or isomolecular sequences! + !. Ionisation states (and other types of states) must be differentiated at the state level below + type(ids_edge_transport_model_ggd_fast_neutral), pointer :: neutral(:) => null() !Transport coefficients and flux integrals related to the various ion and neutral species + type(ids_generic_grid_scalar_single_position), pointer :: power_ion_total(:) => null() !Power carried by all ions (sum over ions species) crossing a surface, for various surfaces (grid subsets) + type(ids_generic_grid_scalar_single_position), pointer :: energy_flux_max(:) => null() !Maximum power density over a surface, for various surfaces (grid subsets) + type(ids_generic_grid_scalar_single_position), pointer :: power(:) => null() !Power (sum over all species) crossing a surface, for various surfaces (grid subsets) + real(ids_real) :: time=ids_real_invalid !Time + end type + + type :: ids_edge_transport_model + type(ids_identifier) :: identifier !Transport model identifier + real(ids_real) :: flux_multiplier=ids_real_invalid !Multiplier applied to the particule flux when adding its contribution in the expression of the heat flux : can be 0, 3/2 or 5/2 + real(ids_real) :: flux_multiplier_error_upper=ids_real_invalid !Upper error for "flux_multiplier" + real(ids_real) :: flux_multiplier_error_lower=ids_real_invalid !Lower error for "flux_multiplier" + integer(ids_int) :: flux_multiplier_error_index=ids_int_invalid !Index in the error_description list for "flux_multiplier" + type(ids_edge_transport_model_ggd), pointer :: ggd(:) => null() !Transport coefficients represented using the general grid description, for various time slices. Fluxes are given in the direction ! + !perpendicular to the edges or faces of the grid (flow crossing that surface divided by its actual area). Radial fluxes are positiv! + !e when they are directed away from the magnetic axis. Poloidal fluxes are positive when they are directed in such a way that they ! + !travel clockwise around the magnetic axis (poloidal plane viewed such that the centerline of the tokamak is on the left). Parallel! + ! fluxes are positive when they are co-directed with the magnetic field. Toroidal fluxes are positive if travelling counter-clockwi! + !se when looking at the plasma from above + type(ids_edge_transport_model_ggd_fast), pointer :: ggd_fast(:) => null() !Quantities provided at a faster sampling rate than the full ggd quantities. These are either integrated quantities or local quanti! + !ties provided on a reduced set of positions. Positions and integration domains are described by a set of grid_subsets (of size 1 f! + !or a position). + type(ids_code_with_timebase) :: code !Code-specific parameters used for this model + end type + + + ! *********** edge_transport IDS + type, extends(IDS_base) :: ids_edge_transport !Edge plasma transport. Energy terms correspond to the full kinetic energy equation (i.e. the energy flux takes into account the en! + !ergy transported by the particle flux) + logical, private :: c_data = .FALSE. ! Fortran specific metadata telling whether the IDS has been populated from C allocated data (LL) or not + integer, private :: max_occurrence = 10! Maximum occurrence allowed as defined in the DD + + type(ids_ids_properties) :: ids_properties !Interface Data Structure properties. This element identifies the node above as an IDS + type(ids_identifier_static) :: midplane !Choice of midplane definition (use the lowest index number if more than one value is relevant) + type(ids_generic_grid_aos3_root), pointer :: grid_ggd(:) => null() !Grid (using the Generic Grid Description), for various time slices. The timebase of this array of structure must be a subset of th! + !e ggd timebases + type(ids_edge_transport_model), pointer :: model(:) => null() !Transport is described by a combination of various transport models + type(ids_code) :: code !Generic decription of the code-specific parameters for the code that has produced this IDS + real(ids_real), pointer :: time(:) => null() !Generic time + end type + + ! *********** em_coupling IDS internal structures declaration + + + ! *********** em_coupling IDS + type, extends(IDS_base) :: ids_em_coupling !Description of the axisymmetric mutual electromagnetics; does not include non-axisymmetric coil systems; the convention is Quantit! + !y_Sensor_Source + logical, private :: c_data = .FALSE. ! Fortran specific metadata telling whether the IDS has been populated from C allocated data (LL) or not + integer, private :: max_occurrence = 3! Maximum occurrence allowed as defined in the DD + + type(ids_ids_properties) :: ids_properties !Interface Data Structure properties. This element identifies the node above as an IDS + real(ids_real), pointer :: mutual_active_active(:,:) => null() !Mutual inductance coupling from active coils to active coils + real(ids_real), pointer :: mutual_active_active_error_upper(:,:) => null() !Upper error for "mutual_active_active" + real(ids_real), pointer :: mutual_active_active_error_lower(:,:) => null() !Lower error for "mutual_active_active" + integer(ids_int) :: mutual_active_active_error_index=ids_int_invalid !Index in the error_description list for "mutual_active_active" + real(ids_real), pointer :: mutual_passive_active(:,:) => null() !Mutual inductance coupling from active coils to passive loops + real(ids_real), pointer :: mutual_passive_active_error_upper(:,:) => null() !Upper error for "mutual_passive_active" + real(ids_real), pointer :: mutual_passive_active_error_lower(:,:) => null() !Lower error for "mutual_passive_active" + integer(ids_int) :: mutual_passive_active_error_index=ids_int_invalid !Index in the error_description list for "mutual_passive_active" + real(ids_real), pointer :: mutual_loops_active(:,:) => null() !Mutual inductance coupling from active coils to poloidal flux loops + real(ids_real), pointer :: mutual_loops_active_error_upper(:,:) => null() !Upper error for "mutual_loops_active" + real(ids_real), pointer :: mutual_loops_active_error_lower(:,:) => null() !Lower error for "mutual_loops_active" + integer(ids_int) :: mutual_loops_active_error_index=ids_int_invalid !Index in the error_description list for "mutual_loops_active" + real(ids_real), pointer :: field_probes_active(:,:) => null() !Poloidal field coupling from active coils to poloidal field probes + real(ids_real), pointer :: field_probes_active_error_upper(:,:) => null() !Upper error for "field_probes_active" + real(ids_real), pointer :: field_probes_active_error_lower(:,:) => null() !Lower error for "field_probes_active" + integer(ids_int) :: field_probes_active_error_index=ids_int_invalid !Index in the error_description list for "field_probes_active" + real(ids_real), pointer :: mutual_passive_passive(:,:) => null() !Mutual inductance coupling from passive loops to passive loops + real(ids_real), pointer :: mutual_passive_passive_error_upper(:,:) => null() !Upper error for "mutual_passive_passive" + real(ids_real), pointer :: mutual_passive_passive_error_lower(:,:) => null() !Lower error for "mutual_passive_passive" + integer(ids_int) :: mutual_passive_passive_error_index=ids_int_invalid !Index in the error_description list for "mutual_passive_passive" + real(ids_real), pointer :: mutual_loops_passive(:,:) => null() !Mutual inductance coupling from passive loops to poloidal flux loops + real(ids_real), pointer :: mutual_loops_passive_error_upper(:,:) => null() !Upper error for "mutual_loops_passive" + real(ids_real), pointer :: mutual_loops_passive_error_lower(:,:) => null() !Lower error for "mutual_loops_passive" + integer(ids_int) :: mutual_loops_passive_error_index=ids_int_invalid !Index in the error_description list for "mutual_loops_passive" + real(ids_real), pointer :: field_probes_passive(:,:) => null() !Poloidal field coupling from passive loops to poloidal field probes + real(ids_real), pointer :: field_probes_passive_error_upper(:,:) => null() !Upper error for "field_probes_passive" + real(ids_real), pointer :: field_probes_passive_error_lower(:,:) => null() !Lower error for "field_probes_passive" + integer(ids_int) :: field_probes_passive_error_index=ids_int_invalid !Index in the error_description list for "field_probes_passive" + real(ids_real), pointer :: mutual_grid_grid(:,:) => null() !Mutual inductance from equilibrium grid to itself + real(ids_real), pointer :: mutual_grid_grid_error_upper(:,:) => null() !Upper error for "mutual_grid_grid" + real(ids_real), pointer :: mutual_grid_grid_error_lower(:,:) => null() !Lower error for "mutual_grid_grid" + integer(ids_int) :: mutual_grid_grid_error_index=ids_int_invalid !Index in the error_description list for "mutual_grid_grid" + real(ids_real), pointer :: mutual_grid_active(:,:) => null() !Mutual inductance coupling from active coils to equilibrium grid + real(ids_real), pointer :: mutual_grid_active_error_upper(:,:) => null() !Upper error for "mutual_grid_active" + real(ids_real), pointer :: mutual_grid_active_error_lower(:,:) => null() !Lower error for "mutual_grid_active" + integer(ids_int) :: mutual_grid_active_error_index=ids_int_invalid !Index in the error_description list for "mutual_grid_active" + real(ids_real), pointer :: mutual_grid_passive(:,:) => null() !Mutual inductance coupling from passive loops to equilibrium grid + real(ids_real), pointer :: mutual_grid_passive_error_upper(:,:) => null() !Upper error for "mutual_grid_passive" + real(ids_real), pointer :: mutual_grid_passive_error_lower(:,:) => null() !Lower error for "mutual_grid_passive" + integer(ids_int) :: mutual_grid_passive_error_index=ids_int_invalid !Index in the error_description list for "mutual_grid_passive" + real(ids_real), pointer :: field_probes_grid(:,:) => null() !Poloidal field coupling from equilibrium grid to poloidal field probes + real(ids_real), pointer :: field_probes_grid_error_upper(:,:) => null() !Upper error for "field_probes_grid" + real(ids_real), pointer :: field_probes_grid_error_lower(:,:) => null() !Lower error for "field_probes_grid" + integer(ids_int) :: field_probes_grid_error_index=ids_int_invalid !Index in the error_description list for "field_probes_grid" + real(ids_real), pointer :: mutual_loops_grid(:,:) => null() !Mutual inductance from equilibrium grid to poloidal flux loops + real(ids_real), pointer :: mutual_loops_grid_error_upper(:,:) => null() !Upper error for "mutual_loops_grid" + real(ids_real), pointer :: mutual_loops_grid_error_lower(:,:) => null() !Lower error for "mutual_loops_grid" + integer(ids_int) :: mutual_loops_grid_error_index=ids_int_invalid !Index in the error_description list for "mutual_loops_grid" + character(len=ids_string_length), dimension(:), pointer :: active_coils => null() !List of the names of the active PF+CS coils + character(len=ids_string_length), dimension(:), pointer :: passive_loops => null() !List of the names of the passive loops + character(len=ids_string_length), dimension(:), pointer :: poloidal_probes => null() !List of the names of poloidal field probes + character(len=ids_string_length), dimension(:), pointer :: flux_loops => null() !List of the names of the axisymmetric flux loops + character(len=ids_string_length), dimension(:), pointer :: grid_points => null() !List of the names of the plasma region grid points + type(ids_code) :: code !Generic decription of the code-specific parameters for the code that has produced this IDS + real(ids_real), pointer :: time(:) => null() !Generic time + end type + + ! *********** equilibrium IDS internal structures declaration + + type :: ids_equilibrium_ggd_array + type(ids_generic_grid_dynamic), pointer :: grid(:) => null() !Set of GGD grids for describing the equilibrium, at a given time slice + real(ids_real) :: time=ids_real_invalid !Time + end type + + type :: ids_equilibrium_boundary + integer(ids_int) :: type=ids_int_invalid !0 (limiter) or 1 (diverted) + type(ids_rz1d_dynamic_aos) :: outline !RZ outline of the plasma boundary + type(ids_rz1d_dynamic_aos) :: lcfs !RZ description of the plasma boundary + real(ids_real) :: psi_norm=ids_real_invalid !Value of the normalised poloidal flux at which the boundary is taken (typically 99.x %), the flux being normalised to its value at! + ! the separatrix + real(ids_real) :: psi_norm_error_upper=ids_real_invalid !Upper error for "psi_norm" + real(ids_real) :: psi_norm_error_lower=ids_real_invalid !Lower error for "psi_norm" + integer(ids_int) :: psi_norm_error_index=ids_int_invalid !Index in the error_description list for "psi_norm" + real(ids_real) :: b_flux_pol_norm=ids_real_invalid !Value of the normalised poloidal flux at which the boundary is taken + real(ids_real) :: b_flux_pol_norm_error_upper=ids_real_invalid !Upper error for "b_flux_pol_norm" + real(ids_real) :: b_flux_pol_norm_error_lower=ids_real_invalid !Lower error for "b_flux_pol_norm" + integer(ids_int) :: b_flux_pol_norm_error_index=ids_int_invalid !Index in the error_description list for "b_flux_pol_norm" + real(ids_real) :: psi=ids_real_invalid !Value of the poloidal flux at which the boundary is taken + real(ids_real) :: psi_error_upper=ids_real_invalid !Upper error for "psi" + real(ids_real) :: psi_error_lower=ids_real_invalid !Lower error for "psi" + integer(ids_int) :: psi_error_index=ids_int_invalid !Index in the error_description list for "psi" + type(ids_rz0d_dynamic_aos) :: geometric_axis !RZ position of the geometric axis (defined as (Rmin+Rmax) / 2 and (Zmin+Zmax) / 2 of the boundary) + real(ids_real) :: minor_radius=ids_real_invalid !Minor radius of the plasma boundary (defined as (Rmax-Rmin) / 2 of the boundary) + real(ids_real) :: minor_radius_error_upper=ids_real_invalid !Upper error for "minor_radius" + real(ids_real) :: minor_radius_error_lower=ids_real_invalid !Lower error for "minor_radius" + integer(ids_int) :: minor_radius_error_index=ids_int_invalid !Index in the error_description list for "minor_radius" + real(ids_real) :: elongation=ids_real_invalid !Elongation of the plasma boundary + real(ids_real) :: elongation_error_upper=ids_real_invalid !Upper error for "elongation" + real(ids_real) :: elongation_error_lower=ids_real_invalid !Lower error for "elongation" + integer(ids_int) :: elongation_error_index=ids_int_invalid !Index in the error_description list for "elongation" + real(ids_real) :: elongation_upper=ids_real_invalid !Elongation (upper half w.r.t. geometric axis) of the plasma boundary + real(ids_real) :: elongation_upper_error_upper=ids_real_invalid !Upper error for "elongation_upper" + real(ids_real) :: elongation_upper_error_lower=ids_real_invalid !Lower error for "elongation_upper" + integer(ids_int) :: elongation_upper_error_index=ids_int_invalid !Index in the error_description list for "elongation_upper" + real(ids_real) :: elongation_lower=ids_real_invalid !Elongation (lower half w.r.t. geometric axis) of the plasma boundary + real(ids_real) :: elongation_lower_error_upper=ids_real_invalid !Upper error for "elongation_lower" + real(ids_real) :: elongation_lower_error_lower=ids_real_invalid !Lower error for "elongation_lower" + integer(ids_int) :: elongation_lower_error_index=ids_int_invalid !Index in the error_description list for "elongation_lower" + real(ids_real) :: triangularity=ids_real_invalid !Triangularity of the plasma boundary + real(ids_real) :: triangularity_error_upper=ids_real_invalid !Upper error for "triangularity" + real(ids_real) :: triangularity_error_lower=ids_real_invalid !Lower error for "triangularity" + integer(ids_int) :: triangularity_error_index=ids_int_invalid !Index in the error_description list for "triangularity" + real(ids_real) :: triangularity_upper=ids_real_invalid !Upper triangularity of the plasma boundary + real(ids_real) :: triangularity_upper_error_upper=ids_real_invalid !Upper error for "triangularity_upper" + real(ids_real) :: triangularity_upper_error_lower=ids_real_invalid !Lower error for "triangularity_upper" + integer(ids_int) :: triangularity_upper_error_index=ids_int_invalid !Index in the error_description list for "triangularity_upper" + real(ids_real) :: triangularity_lower=ids_real_invalid !Lower triangularity of the plasma boundary + real(ids_real) :: triangularity_lower_error_upper=ids_real_invalid !Upper error for "triangularity_lower" + real(ids_real) :: triangularity_lower_error_lower=ids_real_invalid !Lower error for "triangularity_lower" + integer(ids_int) :: triangularity_lower_error_index=ids_int_invalid !Index in the error_description list for "triangularity_lower" + real(ids_real) :: squareness_upper_inner=ids_real_invalid !Upper inner squareness of the plasma boundary (definition from T. Luce, Plasma Phys. Control. Fusion 55 (2013) 095009) + real(ids_real) :: squareness_upper_inner_error_upper=ids_real_invalid !Upper error for "squareness_upper_inner" + real(ids_real) :: squareness_upper_inner_error_lower=ids_real_invalid !Lower error for "squareness_upper_inner" + integer(ids_int) :: squareness_upper_inner_error_index=ids_int_invalid !Index in the error_description list for "squareness_upper_inner" + real(ids_real) :: squareness_upper_outer=ids_real_invalid !Upper outer squareness of the plasma boundary (definition from T. Luce, Plasma Phys. Control. Fusion 55 (2013) 095009) + real(ids_real) :: squareness_upper_outer_error_upper=ids_real_invalid !Upper error for "squareness_upper_outer" + real(ids_real) :: squareness_upper_outer_error_lower=ids_real_invalid !Lower error for "squareness_upper_outer" + integer(ids_int) :: squareness_upper_outer_error_index=ids_int_invalid !Index in the error_description list for "squareness_upper_outer" + real(ids_real) :: squareness_lower_inner=ids_real_invalid !Lower inner squareness of the plasma boundary (definition from T. Luce, Plasma Phys. Control. Fusion 55 (2013) 095009) + real(ids_real) :: squareness_lower_inner_error_upper=ids_real_invalid !Upper error for "squareness_lower_inner" + real(ids_real) :: squareness_lower_inner_error_lower=ids_real_invalid !Lower error for "squareness_lower_inner" + integer(ids_int) :: squareness_lower_inner_error_index=ids_int_invalid !Index in the error_description list for "squareness_lower_inner" + real(ids_real) :: squareness_lower_outer=ids_real_invalid !Lower outer squareness of the plasma boundary (definition from T. Luce, Plasma Phys. Control. Fusion 55 (2013) 095009) + real(ids_real) :: squareness_lower_outer_error_upper=ids_real_invalid !Upper error for "squareness_lower_outer" + real(ids_real) :: squareness_lower_outer_error_lower=ids_real_invalid !Lower error for "squareness_lower_outer" + integer(ids_int) :: squareness_lower_outer_error_index=ids_int_invalid !Index in the error_description list for "squareness_lower_outer" + type(ids_rz0d_dynamic_aos), pointer :: x_point(:) => null() !Array of X-points, for each of them the RZ position is given + type(ids_rz0d_dynamic_aos), pointer :: strike_point(:) => null() !Array of strike points, for each of them the RZ position is given + type(ids_rz0d_dynamic_aos) :: active_limiter_point !RZ position of the active limiter point (point of the plasma boundary in contact with the limiter) + end type + + type :: ids_equilibrium_boundary_closest + real(ids_real) :: r=ids_real_invalid !Major radius + real(ids_real) :: r_error_upper=ids_real_invalid !Upper error for "r" + real(ids_real) :: r_error_lower=ids_real_invalid !Lower error for "r" + integer(ids_int) :: r_error_index=ids_int_invalid !Index in the error_description list for "r" + real(ids_real) :: z=ids_real_invalid !Height + real(ids_real) :: z_error_upper=ids_real_invalid !Upper error for "z" + real(ids_real) :: z_error_lower=ids_real_invalid !Lower error for "z" + integer(ids_int) :: z_error_index=ids_int_invalid !Index in the error_description list for "z" + real(ids_real) :: distance=ids_real_invalid !Distance to the plasma boundary + real(ids_real) :: distance_error_upper=ids_real_invalid !Upper error for "distance" + real(ids_real) :: distance_error_lower=ids_real_invalid !Lower error for "distance" + integer(ids_int) :: distance_error_index=ids_int_invalid !Index in the error_description list for "distance" + end type + + type :: ids_equilibrium_gap + character(len=ids_string_length), dimension(:), pointer :: name => null() !Name of the gap + character(len=ids_string_length), dimension(:), pointer :: identifier => null() !Identifier of the gap + real(ids_real) :: r=ids_real_invalid !Major radius of the reference point + real(ids_real) :: r_error_upper=ids_real_invalid !Upper error for "r" + real(ids_real) :: r_error_lower=ids_real_invalid !Lower error for "r" + integer(ids_int) :: r_error_index=ids_int_invalid !Index in the error_description list for "r" + real(ids_real) :: z=ids_real_invalid !Height of the reference point + real(ids_real) :: z_error_upper=ids_real_invalid !Upper error for "z" + real(ids_real) :: z_error_lower=ids_real_invalid !Lower error for "z" + integer(ids_int) :: z_error_index=ids_int_invalid !Index in the error_description list for "z" + real(ids_real) :: angle=ids_real_invalid !Angle measured clockwise from radial cylindrical vector (grad R) to gap vector (pointing away from reference point) + real(ids_real) :: angle_error_upper=ids_real_invalid !Upper error for "angle" + real(ids_real) :: angle_error_lower=ids_real_invalid !Lower error for "angle" + integer(ids_int) :: angle_error_index=ids_int_invalid !Index in the error_description list for "angle" + real(ids_real) :: value=ids_real_invalid !Value of the gap, i.e. distance between the reference point and the separatrix along the gap direction + real(ids_real) :: value_error_upper=ids_real_invalid !Upper error for "value" + real(ids_real) :: value_error_lower=ids_real_invalid !Lower error for "value" + integer(ids_int) :: value_error_index=ids_int_invalid !Index in the error_description list for "value" + end type + + type :: ids_equilibrium_boundary_separatrix + integer(ids_int) :: type=ids_int_invalid !0 (limiter) or 1 (diverted) + type(ids_rz1d_dynamic_aos) :: outline !RZ outline of the plasma boundary + real(ids_real) :: psi=ids_real_invalid !Value of the poloidal flux at the separatrix + real(ids_real) :: psi_error_upper=ids_real_invalid !Upper error for "psi" + real(ids_real) :: psi_error_lower=ids_real_invalid !Lower error for "psi" + integer(ids_int) :: psi_error_index=ids_int_invalid !Index in the error_description list for "psi" + type(ids_rz0d_dynamic_aos) :: geometric_axis !RZ position of the geometric axis (defined as (Rmin+Rmax) / 2 and (Zmin+Zmax) / 2 of the boundary) + real(ids_real) :: minor_radius=ids_real_invalid !Minor radius of the plasma boundary (defined as (Rmax-Rmin) / 2 of the boundary) + real(ids_real) :: minor_radius_error_upper=ids_real_invalid !Upper error for "minor_radius" + real(ids_real) :: minor_radius_error_lower=ids_real_invalid !Lower error for "minor_radius" + integer(ids_int) :: minor_radius_error_index=ids_int_invalid !Index in the error_description list for "minor_radius" + real(ids_real) :: elongation=ids_real_invalid !Elongation of the plasma boundary + real(ids_real) :: elongation_error_upper=ids_real_invalid !Upper error for "elongation" + real(ids_real) :: elongation_error_lower=ids_real_invalid !Lower error for "elongation" + integer(ids_int) :: elongation_error_index=ids_int_invalid !Index in the error_description list for "elongation" + real(ids_real) :: elongation_upper=ids_real_invalid !Elongation (upper half w.r.t. geometric axis) of the plasma boundary + real(ids_real) :: elongation_upper_error_upper=ids_real_invalid !Upper error for "elongation_upper" + real(ids_real) :: elongation_upper_error_lower=ids_real_invalid !Lower error for "elongation_upper" + integer(ids_int) :: elongation_upper_error_index=ids_int_invalid !Index in the error_description list for "elongation_upper" + real(ids_real) :: elongation_lower=ids_real_invalid !Elongation (lower half w.r.t. geometric axis) of the plasma boundary + real(ids_real) :: elongation_lower_error_upper=ids_real_invalid !Upper error for "elongation_lower" + real(ids_real) :: elongation_lower_error_lower=ids_real_invalid !Lower error for "elongation_lower" + integer(ids_int) :: elongation_lower_error_index=ids_int_invalid !Index in the error_description list for "elongation_lower" + real(ids_real) :: triangularity=ids_real_invalid !Triangularity of the plasma boundary + real(ids_real) :: triangularity_error_upper=ids_real_invalid !Upper error for "triangularity" + real(ids_real) :: triangularity_error_lower=ids_real_invalid !Lower error for "triangularity" + integer(ids_int) :: triangularity_error_index=ids_int_invalid !Index in the error_description list for "triangularity" + real(ids_real) :: triangularity_upper=ids_real_invalid !Upper triangularity of the plasma boundary + real(ids_real) :: triangularity_upper_error_upper=ids_real_invalid !Upper error for "triangularity_upper" + real(ids_real) :: triangularity_upper_error_lower=ids_real_invalid !Lower error for "triangularity_upper" + integer(ids_int) :: triangularity_upper_error_index=ids_int_invalid !Index in the error_description list for "triangularity_upper" + real(ids_real) :: triangularity_lower=ids_real_invalid !Lower triangularity of the plasma boundary + real(ids_real) :: triangularity_lower_error_upper=ids_real_invalid !Upper error for "triangularity_lower" + real(ids_real) :: triangularity_lower_error_lower=ids_real_invalid !Lower error for "triangularity_lower" + integer(ids_int) :: triangularity_lower_error_index=ids_int_invalid !Index in the error_description list for "triangularity_lower" + real(ids_real) :: squareness_upper_inner=ids_real_invalid !Upper inner squareness of the plasma boundary (definition from T. Luce, Plasma Phys. Control. Fusion 55 (2013) 095009) + real(ids_real) :: squareness_upper_inner_error_upper=ids_real_invalid !Upper error for "squareness_upper_inner" + real(ids_real) :: squareness_upper_inner_error_lower=ids_real_invalid !Lower error for "squareness_upper_inner" + integer(ids_int) :: squareness_upper_inner_error_index=ids_int_invalid !Index in the error_description list for "squareness_upper_inner" + real(ids_real) :: squareness_upper_outer=ids_real_invalid !Upper outer squareness of the plasma boundary (definition from T. Luce, Plasma Phys. Control. Fusion 55 (2013) 095009) + real(ids_real) :: squareness_upper_outer_error_upper=ids_real_invalid !Upper error for "squareness_upper_outer" + real(ids_real) :: squareness_upper_outer_error_lower=ids_real_invalid !Lower error for "squareness_upper_outer" + integer(ids_int) :: squareness_upper_outer_error_index=ids_int_invalid !Index in the error_description list for "squareness_upper_outer" + real(ids_real) :: squareness_lower_inner=ids_real_invalid !Lower inner squareness of the plasma boundary (definition from T. Luce, Plasma Phys. Control. Fusion 55 (2013) 095009) + real(ids_real) :: squareness_lower_inner_error_upper=ids_real_invalid !Upper error for "squareness_lower_inner" + real(ids_real) :: squareness_lower_inner_error_lower=ids_real_invalid !Lower error for "squareness_lower_inner" + integer(ids_int) :: squareness_lower_inner_error_index=ids_int_invalid !Index in the error_description list for "squareness_lower_inner" + real(ids_real) :: squareness_lower_outer=ids_real_invalid !Lower outer squareness of the plasma boundary (definition from T. Luce, Plasma Phys. Control. Fusion 55 (2013) 095009) + real(ids_real) :: squareness_lower_outer_error_upper=ids_real_invalid !Upper error for "squareness_lower_outer" + real(ids_real) :: squareness_lower_outer_error_lower=ids_real_invalid !Lower error for "squareness_lower_outer" + integer(ids_int) :: squareness_lower_outer_error_index=ids_int_invalid !Index in the error_description list for "squareness_lower_outer" + type(ids_rz0d_dynamic_aos), pointer :: x_point(:) => null() !Array of X-points, for each of them the RZ position is given + type(ids_rz0d_dynamic_aos), pointer :: strike_point(:) => null() !Array of strike points, for each of them the RZ position is given + type(ids_rz0d_dynamic_aos) :: active_limiter_point !RZ position of the active limiter point (point of the plasma boundary in contact with the limiter) + type(ids_equilibrium_boundary_closest) :: closest_wall_point !Position and distance to the plasma boundary of the point of the first wall which is the closest to plasma boundary + type(ids_rz0d_dynamic_aos) :: dr_dz_zero_point !Outboard point on the separatrix on which dr/dz = 0 (local maximum of the major radius of the separatrix). In case of multiple loc! + !al maxima, the closest one from z=z_magnetic_axis is chosen. + type(ids_equilibrium_gap), pointer :: gap(:) => null() !Set of gaps, defined by a reference point and a direction. + end type + + type :: ids_equilibrium_boundary_second_separatrix + type(ids_rz1d_dynamic_aos) :: outline !RZ outline of the plasma boundary + real(ids_real) :: psi=ids_real_invalid !Value of the poloidal flux at the separatrix + real(ids_real) :: psi_error_upper=ids_real_invalid !Upper error for "psi" + real(ids_real) :: psi_error_lower=ids_real_invalid !Lower error for "psi" + integer(ids_int) :: psi_error_index=ids_int_invalid !Index in the error_description list for "psi" + real(ids_real) :: distance_inner_outer=ids_real_invalid !Distance between the inner and outer separatrices, in the major radius direction, at the plasma outboard and at the height corresp! + !onding to the maximum R for the inner separatrix. + real(ids_real) :: distance_inner_outer_error_upper=ids_real_invalid !Upper error for "distance_inner_outer" + real(ids_real) :: distance_inner_outer_error_lower=ids_real_invalid !Lower error for "distance_inner_outer" + integer(ids_int) :: distance_inner_outer_error_index=ids_int_invalid !Index in the error_description list for "distance_inner_outer" + type(ids_rz0d_dynamic_aos), pointer :: x_point(:) => null() !Array of X-points, for each of them the RZ position is given + type(ids_rz0d_dynamic_aos), pointer :: strike_point(:) => null() !Array of strike points, for each of them the RZ position is given + end type + + type :: ids_equilibrium_constraints_0D + real(ids_real) :: measured=ids_real_invalid !Measured value + real(ids_real) :: measured_error_upper=ids_real_invalid !Upper error for "measured" + real(ids_real) :: measured_error_lower=ids_real_invalid !Lower error for "measured" + integer(ids_int) :: measured_error_index=ids_int_invalid !Index in the error_description list for "measured" + character(len=ids_string_length), dimension(:), pointer :: source => null() !Path to the source data for this measurement in the IMAS data dictionary + real(ids_real) :: time_measurement=ids_real_invalid !Exact time slice used from the time array of the measurement source data. If the time slice does not exist in the time array of th! + !e source data, it means linear interpolation has been used + real(ids_real) :: time_measurement_error_upper=ids_real_invalid !Upper error for "time_measurement" + real(ids_real) :: time_measurement_error_lower=ids_real_invalid !Lower error for "time_measurement" + integer(ids_int) :: time_measurement_error_index=ids_int_invalid !Index in the error_description list for "time_measurement" + integer(ids_int) :: exact=ids_int_invalid !Integer flag : 1 means exact data, taken as an exact input without being fitted; 0 means the equilibrium code does a least square ! + !fit + real(ids_real) :: weight=ids_real_invalid !Weight given to the measurement + real(ids_real) :: weight_error_upper=ids_real_invalid !Upper error for "weight" + real(ids_real) :: weight_error_lower=ids_real_invalid !Lower error for "weight" + integer(ids_int) :: weight_error_index=ids_int_invalid !Index in the error_description list for "weight" + real(ids_real) :: reconstructed=ids_real_invalid !Value calculated from the reconstructed equilibrium + real(ids_real) :: reconstructed_error_upper=ids_real_invalid !Upper error for "reconstructed" + real(ids_real) :: reconstructed_error_lower=ids_real_invalid !Lower error for "reconstructed" + integer(ids_int) :: reconstructed_error_index=ids_int_invalid !Index in the error_description list for "reconstructed" + real(ids_real) :: chi_squared=ids_real_invalid !Squared error normalized by the standard deviation considered in the minimization process : chi_squared = weight^2 *(reconstructed! + ! - measured)^2 / sigma^2, where sigma is the standard deviation of the measurement error + real(ids_real) :: chi_squared_error_upper=ids_real_invalid !Upper error for "chi_squared" + real(ids_real) :: chi_squared_error_lower=ids_real_invalid !Lower error for "chi_squared" + integer(ids_int) :: chi_squared_error_index=ids_int_invalid !Index in the error_description list for "chi_squared" + end type + + type :: ids_equilibrium_constraints_0D_one_like + real(ids_real) :: measured=ids_real_invalid !Measured value + real(ids_real) :: measured_error_upper=ids_real_invalid !Upper error for "measured" + real(ids_real) :: measured_error_lower=ids_real_invalid !Lower error for "measured" + integer(ids_int) :: measured_error_index=ids_int_invalid !Index in the error_description list for "measured" + character(len=ids_string_length), dimension(:), pointer :: source => null() !Path to the source data for this measurement in the IMAS data dictionary + real(ids_real) :: time_measurement=ids_real_invalid !Exact time slice used from the time array of the measurement source data. If the time slice does not exist in the time array of th! + !e source data, it means linear interpolation has been used + real(ids_real) :: time_measurement_error_upper=ids_real_invalid !Upper error for "time_measurement" + real(ids_real) :: time_measurement_error_lower=ids_real_invalid !Lower error for "time_measurement" + integer(ids_int) :: time_measurement_error_index=ids_int_invalid !Index in the error_description list for "time_measurement" + integer(ids_int) :: exact=ids_int_invalid !Integer flag : 1 means exact data, taken as an exact input without being fitted; 0 means the equilibrium code does a least square ! + !fit + real(ids_real) :: weight=ids_real_invalid !Weight given to the measurement + real(ids_real) :: weight_error_upper=ids_real_invalid !Upper error for "weight" + real(ids_real) :: weight_error_lower=ids_real_invalid !Lower error for "weight" + integer(ids_int) :: weight_error_index=ids_int_invalid !Index in the error_description list for "weight" + real(ids_real) :: reconstructed=ids_real_invalid !Value calculated from the reconstructed equilibrium + real(ids_real) :: reconstructed_error_upper=ids_real_invalid !Upper error for "reconstructed" + real(ids_real) :: reconstructed_error_lower=ids_real_invalid !Lower error for "reconstructed" + integer(ids_int) :: reconstructed_error_index=ids_int_invalid !Index in the error_description list for "reconstructed" + real(ids_real) :: chi_squared=ids_real_invalid !Squared error normalized by the standard deviation considered in the minimization process : chi_squared = weight^2 *(reconstructed! + ! - measured)^2 / sigma^2, where sigma is the standard deviation of the measurement error + real(ids_real) :: chi_squared_error_upper=ids_real_invalid !Upper error for "chi_squared" + real(ids_real) :: chi_squared_error_lower=ids_real_invalid !Lower error for "chi_squared" + integer(ids_int) :: chi_squared_error_index=ids_int_invalid !Index in the error_description list for "chi_squared" + end type + + type :: ids_equilibrium_constraints_0D_b0_like + real(ids_real) :: measured=ids_real_invalid !Measured value + real(ids_real) :: measured_error_upper=ids_real_invalid !Upper error for "measured" + real(ids_real) :: measured_error_lower=ids_real_invalid !Lower error for "measured" + integer(ids_int) :: measured_error_index=ids_int_invalid !Index in the error_description list for "measured" + character(len=ids_string_length), dimension(:), pointer :: source => null() !Path to the source data for this measurement in the IMAS data dictionary + real(ids_real) :: time_measurement=ids_real_invalid !Exact time slice used from the time array of the measurement source data. If the time slice does not exist in the time array of th! + !e source data, it means linear interpolation has been used + real(ids_real) :: time_measurement_error_upper=ids_real_invalid !Upper error for "time_measurement" + real(ids_real) :: time_measurement_error_lower=ids_real_invalid !Lower error for "time_measurement" + integer(ids_int) :: time_measurement_error_index=ids_int_invalid !Index in the error_description list for "time_measurement" + integer(ids_int) :: exact=ids_int_invalid !Integer flag : 1 means exact data, taken as an exact input without being fitted; 0 means the equilibrium code does a least square ! + !fit + real(ids_real) :: weight=ids_real_invalid !Weight given to the measurement + real(ids_real) :: weight_error_upper=ids_real_invalid !Upper error for "weight" + real(ids_real) :: weight_error_lower=ids_real_invalid !Lower error for "weight" + integer(ids_int) :: weight_error_index=ids_int_invalid !Index in the error_description list for "weight" + real(ids_real) :: reconstructed=ids_real_invalid !Value calculated from the reconstructed equilibrium + real(ids_real) :: reconstructed_error_upper=ids_real_invalid !Upper error for "reconstructed" + real(ids_real) :: reconstructed_error_lower=ids_real_invalid !Lower error for "reconstructed" + integer(ids_int) :: reconstructed_error_index=ids_int_invalid !Index in the error_description list for "reconstructed" + real(ids_real) :: chi_squared=ids_real_invalid !Squared error normalized by the standard deviation considered in the minimization process : chi_squared = weight^2 *(reconstructed! + ! - measured)^2 / sigma^2, where sigma is the standard deviation of the measurement error + real(ids_real) :: chi_squared_error_upper=ids_real_invalid !Upper error for "chi_squared" + real(ids_real) :: chi_squared_error_lower=ids_real_invalid !Lower error for "chi_squared" + integer(ids_int) :: chi_squared_error_index=ids_int_invalid !Index in the error_description list for "chi_squared" + end type + + type :: ids_equilibrium_constraints_0D_psi_like + real(ids_real) :: measured=ids_real_invalid !Measured value + real(ids_real) :: measured_error_upper=ids_real_invalid !Upper error for "measured" + real(ids_real) :: measured_error_lower=ids_real_invalid !Lower error for "measured" + integer(ids_int) :: measured_error_index=ids_int_invalid !Index in the error_description list for "measured" + character(len=ids_string_length), dimension(:), pointer :: source => null() !Path to the source data for this measurement in the IMAS data dictionary + real(ids_real) :: time_measurement=ids_real_invalid !Exact time slice used from the time array of the measurement source data. If the time slice does not exist in the time array of th! + !e source data, it means linear interpolation has been used + real(ids_real) :: time_measurement_error_upper=ids_real_invalid !Upper error for "time_measurement" + real(ids_real) :: time_measurement_error_lower=ids_real_invalid !Lower error for "time_measurement" + integer(ids_int) :: time_measurement_error_index=ids_int_invalid !Index in the error_description list for "time_measurement" + integer(ids_int) :: exact=ids_int_invalid !Integer flag : 1 means exact data, taken as an exact input without being fitted; 0 means the equilibrium code does a least square ! + !fit + real(ids_real) :: weight=ids_real_invalid !Weight given to the measurement + real(ids_real) :: weight_error_upper=ids_real_invalid !Upper error for "weight" + real(ids_real) :: weight_error_lower=ids_real_invalid !Lower error for "weight" + integer(ids_int) :: weight_error_index=ids_int_invalid !Index in the error_description list for "weight" + real(ids_real) :: reconstructed=ids_real_invalid !Value calculated from the reconstructed equilibrium + real(ids_real) :: reconstructed_error_upper=ids_real_invalid !Upper error for "reconstructed" + real(ids_real) :: reconstructed_error_lower=ids_real_invalid !Lower error for "reconstructed" + integer(ids_int) :: reconstructed_error_index=ids_int_invalid !Index in the error_description list for "reconstructed" + real(ids_real) :: chi_squared=ids_real_invalid !Squared error normalized by the standard deviation considered in the minimization process : chi_squared = weight^2 *(reconstructed! + ! - measured)^2 / sigma^2, where sigma is the standard deviation of the measurement error + real(ids_real) :: chi_squared_error_upper=ids_real_invalid !Upper error for "chi_squared" + real(ids_real) :: chi_squared_error_lower=ids_real_invalid !Lower error for "chi_squared" + integer(ids_int) :: chi_squared_error_index=ids_int_invalid !Index in the error_description list for "chi_squared" + end type + + type :: ids_equilibrium_constraints_0D_ip_like + real(ids_real) :: measured=ids_real_invalid !Measured value + real(ids_real) :: measured_error_upper=ids_real_invalid !Upper error for "measured" + real(ids_real) :: measured_error_lower=ids_real_invalid !Lower error for "measured" + integer(ids_int) :: measured_error_index=ids_int_invalid !Index in the error_description list for "measured" + character(len=ids_string_length), dimension(:), pointer :: source => null() !Path to the source data for this measurement in the IMAS data dictionary + real(ids_real) :: time_measurement=ids_real_invalid !Exact time slice used from the time array of the measurement source data. If the time slice does not exist in the time array of th! + !e source data, it means linear interpolation has been used + real(ids_real) :: time_measurement_error_upper=ids_real_invalid !Upper error for "time_measurement" + real(ids_real) :: time_measurement_error_lower=ids_real_invalid !Lower error for "time_measurement" + integer(ids_int) :: time_measurement_error_index=ids_int_invalid !Index in the error_description list for "time_measurement" + integer(ids_int) :: exact=ids_int_invalid !Integer flag : 1 means exact data, taken as an exact input without being fitted; 0 means the equilibrium code does a least square ! + !fit + real(ids_real) :: weight=ids_real_invalid !Weight given to the measurement + real(ids_real) :: weight_error_upper=ids_real_invalid !Upper error for "weight" + real(ids_real) :: weight_error_lower=ids_real_invalid !Lower error for "weight" + integer(ids_int) :: weight_error_index=ids_int_invalid !Index in the error_description list for "weight" + real(ids_real) :: reconstructed=ids_real_invalid !Value calculated from the reconstructed equilibrium + real(ids_real) :: reconstructed_error_upper=ids_real_invalid !Upper error for "reconstructed" + real(ids_real) :: reconstructed_error_lower=ids_real_invalid !Lower error for "reconstructed" + integer(ids_int) :: reconstructed_error_index=ids_int_invalid !Index in the error_description list for "reconstructed" + real(ids_real) :: chi_squared=ids_real_invalid !Squared error normalized by the standard deviation considered in the minimization process : chi_squared = weight^2 *(reconstructed! + ! - measured)^2 / sigma^2, where sigma is the standard deviation of the measurement error + real(ids_real) :: chi_squared_error_upper=ids_real_invalid !Upper error for "chi_squared" + real(ids_real) :: chi_squared_error_lower=ids_real_invalid !Lower error for "chi_squared" + integer(ids_int) :: chi_squared_error_index=ids_int_invalid !Index in the error_description list for "chi_squared" + end type + + type :: ids_equilibrium_constraints_magnetisation + type(ids_equilibrium_constraints_0D) :: magnetisation_r !Magnetisation M of the iron core segment along the major radius axis, assumed to be constant inside a given iron segment. Reminder! + ! : H = 1/mu0 * B - mur * M; + type(ids_equilibrium_constraints_0D) :: magnetisation_z !Magnetisation M of the iron core segment along the vertical axis, assumed to be constant inside a given iron segment. Reminder : H! + ! = 1/mu0 * B - mur * M; + end type + + type :: ids_equilibrium_constraints_0D_position + real(ids_real) :: measured=ids_real_invalid !Measured value + real(ids_real) :: measured_error_upper=ids_real_invalid !Upper error for "measured" + real(ids_real) :: measured_error_lower=ids_real_invalid !Lower error for "measured" + integer(ids_int) :: measured_error_index=ids_int_invalid !Index in the error_description list for "measured" + type(ids_rzphi0d_dynamic_aos3) :: position !Position at which this measurement is given + character(len=ids_string_length), dimension(:), pointer :: source => null() !Path to the source data for this measurement in the IMAS data dictionary + real(ids_real) :: time_measurement=ids_real_invalid !Exact time slice used from the time array of the measurement source data. If the time slice does not exist in the time array of th! + !e source data, it means linear interpolation has been used + real(ids_real) :: time_measurement_error_upper=ids_real_invalid !Upper error for "time_measurement" + real(ids_real) :: time_measurement_error_lower=ids_real_invalid !Lower error for "time_measurement" + integer(ids_int) :: time_measurement_error_index=ids_int_invalid !Index in the error_description list for "time_measurement" + integer(ids_int) :: exact=ids_int_invalid !Integer flag : 1 means exact data, taken as an exact input without being fitted; 0 means the equilibrium code does a least square ! + !fit + real(ids_real) :: weight=ids_real_invalid !Weight given to the measurement + real(ids_real) :: weight_error_upper=ids_real_invalid !Upper error for "weight" + real(ids_real) :: weight_error_lower=ids_real_invalid !Lower error for "weight" + integer(ids_int) :: weight_error_index=ids_int_invalid !Index in the error_description list for "weight" + real(ids_real) :: reconstructed=ids_real_invalid !Value calculated from the reconstructed equilibrium + real(ids_real) :: reconstructed_error_upper=ids_real_invalid !Upper error for "reconstructed" + real(ids_real) :: reconstructed_error_lower=ids_real_invalid !Lower error for "reconstructed" + integer(ids_int) :: reconstructed_error_index=ids_int_invalid !Index in the error_description list for "reconstructed" + real(ids_real) :: chi_squared=ids_real_invalid !Squared error normalized by the standard deviation considered in the minimization process : chi_squared = weight^2 *(reconstructed! + ! - measured)^2 / sigma^2, where sigma is the standard deviation of the measurement error + real(ids_real) :: chi_squared_error_upper=ids_real_invalid !Upper error for "chi_squared" + real(ids_real) :: chi_squared_error_lower=ids_real_invalid !Lower error for "chi_squared" + integer(ids_int) :: chi_squared_error_index=ids_int_invalid !Index in the error_description list for "chi_squared" + end type + + type :: ids_equilibrium_constraints_pure_position + type(ids_rz0d_dynamic_aos) :: position_measured !Measured or estimated position + character(len=ids_string_length), dimension(:), pointer :: source => null() !Path to the source data for this measurement in the IMAS data dictionary + real(ids_real) :: time_measurement=ids_real_invalid !Exact time slice used from the time array of the measurement source data. If the time slice does not exist in the time array of th! + !e source data, it means linear interpolation has been used + real(ids_real) :: time_measurement_error_upper=ids_real_invalid !Upper error for "time_measurement" + real(ids_real) :: time_measurement_error_lower=ids_real_invalid !Lower error for "time_measurement" + integer(ids_int) :: time_measurement_error_index=ids_int_invalid !Index in the error_description list for "time_measurement" + integer(ids_int) :: exact=ids_int_invalid !Integer flag : 1 means exact data, taken as an exact input without being fitted; 0 means the equilibrium code does a least square ! + !fit + real(ids_real) :: weight=ids_real_invalid !Weight given to the measurement + real(ids_real) :: weight_error_upper=ids_real_invalid !Upper error for "weight" + real(ids_real) :: weight_error_lower=ids_real_invalid !Lower error for "weight" + integer(ids_int) :: weight_error_index=ids_int_invalid !Index in the error_description list for "weight" + type(ids_rz0d_dynamic_aos) :: position_reconstructed !Position estimated from the reconstructed equilibrium + real(ids_real) :: chi_squared_r=ids_real_invalid !Squared error on the major radius normalized by the standard deviation considered in the minimization process : chi_squared = weig! + !ht^2 *(position_reconstructed/r - position_measured/r)^2 / sigma^2, where sigma is the standard deviation of the measurement error + real(ids_real) :: chi_squared_r_error_upper=ids_real_invalid !Upper error for "chi_squared_r" + real(ids_real) :: chi_squared_r_error_lower=ids_real_invalid !Lower error for "chi_squared_r" + integer(ids_int) :: chi_squared_r_error_index=ids_int_invalid !Index in the error_description list for "chi_squared_r" + real(ids_real) :: chi_squared_z=ids_real_invalid !Squared error on the altitude normalized by the standard deviation considered in the minimization process : chi_squared = weight^2! + ! *(position_reconstructed/z - position_measured/z)^2 / sigma^2, where sigma is the standard deviation of the measurement error + real(ids_real) :: chi_squared_z_error_upper=ids_real_invalid !Upper error for "chi_squared_z" + real(ids_real) :: chi_squared_z_error_lower=ids_real_invalid !Lower error for "chi_squared_z" + integer(ids_int) :: chi_squared_z_error_index=ids_int_invalid !Index in the error_description list for "chi_squared_z" + end type + + type :: ids_equilibrium_constraints + type(ids_equilibrium_constraints_0D) :: b_field_tor_vacuum_r !Vacuum field times major radius in the toroidal field magnet. Positive sign means anti-clockwise when viewed from above + type(ids_equilibrium_constraints_0D_one_like), pointer :: bpol_probe(:) => null() !Set of poloidal field probes + type(ids_equilibrium_constraints_0D_b0_like) :: diamagnetic_flux !Diamagnetic flux + type(ids_equilibrium_constraints_0D), pointer :: faraday_angle(:) => null() !Set of faraday angles + type(ids_equilibrium_constraints_0D), pointer :: mse_polarisation_angle(:) => null() !Set of MSE polarisation angles + type(ids_equilibrium_constraints_0D_psi_like), pointer :: flux_loop(:) => null() !Set of flux loops + type(ids_equilibrium_constraints_0D_ip_like) :: ip !Plasma current. Positive sign means anti-clockwise when viewed from above + type(ids_equilibrium_constraints_magnetisation), pointer :: iron_core_segment(:) => null() !Magnetisation M of a set of iron core segments + type(ids_equilibrium_constraints_0D), pointer :: n_e(:) => null() !Set of local density measurements + type(ids_equilibrium_constraints_0D), pointer :: n_e_line(:) => null() !Set of line integrated density measurements + type(ids_equilibrium_constraints_0D_ip_like), pointer :: pf_current(:) => null() !Current in a set of poloidal field coils + type(ids_equilibrium_constraints_0D), pointer :: pf_passive_current(:) => null() !Current in a set of axisymmetric passive conductors + type(ids_equilibrium_constraints_0D), pointer :: pressure(:) => null() !Set of total pressure estimates + type(ids_equilibrium_constraints_0D_position), pointer :: q(:) => null() !Set of safety factor estimates at various positions + type(ids_equilibrium_constraints_pure_position), pointer :: x_point(:) => null() !Array of X-points, for each of them the RZ position is given + type(ids_equilibrium_constraints_pure_position), pointer :: strike_point(:) => null() !Array of strike points, for each of them the RZ position is given + end type + + type :: ids_equilibrium_global_quantities_magnetic_axis + real(ids_real) :: r=ids_real_invalid !Major radius of the magnetic axis + real(ids_real) :: r_error_upper=ids_real_invalid !Upper error for "r" + real(ids_real) :: r_error_lower=ids_real_invalid !Lower error for "r" + integer(ids_int) :: r_error_index=ids_int_invalid !Index in the error_description list for "r" + real(ids_real) :: z=ids_real_invalid !Height of the magnetic axis + real(ids_real) :: z_error_upper=ids_real_invalid !Upper error for "z" + real(ids_real) :: z_error_lower=ids_real_invalid !Lower error for "z" + integer(ids_int) :: z_error_index=ids_int_invalid !Index in the error_description list for "z" + real(ids_real) :: b_tor=ids_real_invalid !Total toroidal magnetic field at the magnetic axis + real(ids_real) :: b_tor_error_upper=ids_real_invalid !Upper error for "b_tor" + real(ids_real) :: b_tor_error_lower=ids_real_invalid !Lower error for "b_tor" + integer(ids_int) :: b_tor_error_index=ids_int_invalid !Index in the error_description list for "b_tor" + real(ids_real) :: b_field_tor=ids_real_invalid !Total toroidal magnetic field at the magnetic axis + real(ids_real) :: b_field_tor_error_upper=ids_real_invalid !Upper error for "b_field_tor" + real(ids_real) :: b_field_tor_error_lower=ids_real_invalid !Lower error for "b_field_tor" + integer(ids_int) :: b_field_tor_error_index=ids_int_invalid !Index in the error_description list for "b_field_tor" + end type + + type :: ids_equilibrium_global_quantities_current_centre + real(ids_real) :: r=ids_real_invalid !Major radius of the current center, defined as integral over the poloidal cross section of (j_tor*r*dS) / Ip + real(ids_real) :: r_error_upper=ids_real_invalid !Upper error for "r" + real(ids_real) :: r_error_lower=ids_real_invalid !Lower error for "r" + integer(ids_int) :: r_error_index=ids_int_invalid !Index in the error_description list for "r" + real(ids_real) :: z=ids_real_invalid !Height of the current center, defined as integral over the poloidal cross section of (j_tor*z*dS) / Ip + real(ids_real) :: z_error_upper=ids_real_invalid !Upper error for "z" + real(ids_real) :: z_error_lower=ids_real_invalid !Lower error for "z" + integer(ids_int) :: z_error_index=ids_int_invalid !Index in the error_description list for "z" + real(ids_real) :: velocity_z=ids_real_invalid !Vertical velocity of the current center + real(ids_real) :: velocity_z_error_upper=ids_real_invalid !Upper error for "velocity_z" + real(ids_real) :: velocity_z_error_lower=ids_real_invalid !Lower error for "velocity_z" + integer(ids_int) :: velocity_z_error_index=ids_int_invalid !Index in the error_description list for "velocity_z" + end type + + type :: ids_equilibrium_global_quantities_qmin + real(ids_real) :: value=ids_real_invalid !Minimum q value + real(ids_real) :: value_error_upper=ids_real_invalid !Upper error for "value" + real(ids_real) :: value_error_lower=ids_real_invalid !Lower error for "value" + integer(ids_int) :: value_error_index=ids_int_invalid !Index in the error_description list for "value" + real(ids_real) :: rho_tor_norm=ids_real_invalid !Minimum q position in normalised toroidal flux coordinate + real(ids_real) :: rho_tor_norm_error_upper=ids_real_invalid !Upper error for "rho_tor_norm" + real(ids_real) :: rho_tor_norm_error_lower=ids_real_invalid !Lower error for "rho_tor_norm" + integer(ids_int) :: rho_tor_norm_error_index=ids_int_invalid !Index in the error_description list for "rho_tor_norm" + end type + + type :: ids_equlibrium_global_quantities + real(ids_real) :: beta_pol=ids_real_invalid !Poloidal beta. Defined as betap = 4 int(p dV) / [R_0 * mu_0 * Ip^2] + real(ids_real) :: beta_pol_error_upper=ids_real_invalid !Upper error for "beta_pol" + real(ids_real) :: beta_pol_error_lower=ids_real_invalid !Lower error for "beta_pol" + integer(ids_int) :: beta_pol_error_index=ids_int_invalid !Index in the error_description list for "beta_pol" + real(ids_real) :: beta_tor=ids_real_invalid !Toroidal beta, defined as the volume-averaged total perpendicular pressure divided by (B0^2/(2*mu0)), i.e. beta_toroidal = 2 mu0 i! + !nt(p dV) / V / B0^2 + real(ids_real) :: beta_tor_error_upper=ids_real_invalid !Upper error for "beta_tor" + real(ids_real) :: beta_tor_error_lower=ids_real_invalid !Lower error for "beta_tor" + integer(ids_int) :: beta_tor_error_index=ids_int_invalid !Index in the error_description list for "beta_tor" + real(ids_real) :: beta_normal=ids_real_invalid !Normalised toroidal beta, defined as 100 * beta_tor * a[m] * B0 [T] / ip [MA] + real(ids_real) :: beta_normal_error_upper=ids_real_invalid !Upper error for "beta_normal" + real(ids_real) :: beta_normal_error_lower=ids_real_invalid !Lower error for "beta_normal" + integer(ids_int) :: beta_normal_error_index=ids_int_invalid !Index in the error_description list for "beta_normal" + real(ids_real) :: ip=ids_real_invalid !Plasma current (toroidal component). Positive sign means anti-clockwise when viewed from above. + real(ids_real) :: ip_error_upper=ids_real_invalid !Upper error for "ip" + real(ids_real) :: ip_error_lower=ids_real_invalid !Lower error for "ip" + integer(ids_int) :: ip_error_index=ids_int_invalid !Index in the error_description list for "ip" + real(ids_real) :: li_3=ids_real_invalid !Internal inductance + real(ids_real) :: li_3_error_upper=ids_real_invalid !Upper error for "li_3" + real(ids_real) :: li_3_error_lower=ids_real_invalid !Lower error for "li_3" + integer(ids_int) :: li_3_error_index=ids_int_invalid !Index in the error_description list for "li_3" + real(ids_real) :: volume=ids_real_invalid !Total plasma volume + real(ids_real) :: volume_error_upper=ids_real_invalid !Upper error for "volume" + real(ids_real) :: volume_error_lower=ids_real_invalid !Lower error for "volume" + integer(ids_int) :: volume_error_index=ids_int_invalid !Index in the error_description list for "volume" + real(ids_real) :: area=ids_real_invalid !Area of the LCFS poloidal cross section + real(ids_real) :: area_error_upper=ids_real_invalid !Upper error for "area" + real(ids_real) :: area_error_lower=ids_real_invalid !Lower error for "area" + integer(ids_int) :: area_error_index=ids_int_invalid !Index in the error_description list for "area" + real(ids_real) :: surface=ids_real_invalid !Surface area of the toroidal flux surface + real(ids_real) :: surface_error_upper=ids_real_invalid !Upper error for "surface" + real(ids_real) :: surface_error_lower=ids_real_invalid !Lower error for "surface" + integer(ids_int) :: surface_error_index=ids_int_invalid !Index in the error_description list for "surface" + real(ids_real) :: length_pol=ids_real_invalid !Poloidal length of the magnetic surface + real(ids_real) :: length_pol_error_upper=ids_real_invalid !Upper error for "length_pol" + real(ids_real) :: length_pol_error_lower=ids_real_invalid !Lower error for "length_pol" + integer(ids_int) :: length_pol_error_index=ids_int_invalid !Index in the error_description list for "length_pol" + real(ids_real) :: psi_axis=ids_real_invalid !Poloidal flux at the magnetic axis + real(ids_real) :: psi_axis_error_upper=ids_real_invalid !Upper error for "psi_axis" + real(ids_real) :: psi_axis_error_lower=ids_real_invalid !Lower error for "psi_axis" + integer(ids_int) :: psi_axis_error_index=ids_int_invalid !Index in the error_description list for "psi_axis" + real(ids_real) :: psi_boundary=ids_real_invalid !Poloidal flux at the selected plasma boundary + real(ids_real) :: psi_boundary_error_upper=ids_real_invalid !Upper error for "psi_boundary" + real(ids_real) :: psi_boundary_error_lower=ids_real_invalid !Lower error for "psi_boundary" + integer(ids_int) :: psi_boundary_error_index=ids_int_invalid !Index in the error_description list for "psi_boundary" + type(ids_equilibrium_global_quantities_magnetic_axis) :: magnetic_axis !Magnetic axis position and toroidal field + type(ids_equilibrium_global_quantities_current_centre) :: current_centre !Position and vertical velocity of the current centre + real(ids_real) :: q_axis=ids_real_invalid !q at the magnetic axis + real(ids_real) :: q_axis_error_upper=ids_real_invalid !Upper error for "q_axis" + real(ids_real) :: q_axis_error_lower=ids_real_invalid !Lower error for "q_axis" + integer(ids_int) :: q_axis_error_index=ids_int_invalid !Index in the error_description list for "q_axis" + real(ids_real) :: q_95=ids_real_invalid !q at the 95% poloidal flux surface (IMAS uses COCOS=11: only positive when toroidal current and magnetic field are in same directi! + !on) + real(ids_real) :: q_95_error_upper=ids_real_invalid !Upper error for "q_95" + real(ids_real) :: q_95_error_lower=ids_real_invalid !Lower error for "q_95" + integer(ids_int) :: q_95_error_index=ids_int_invalid !Index in the error_description list for "q_95" + type(ids_equilibrium_global_quantities_qmin) :: q_min !Minimum q value and position + real(ids_real) :: energy_mhd=ids_real_invalid !Plasma energy content = 3/2 * int(p,dV) with p being the total pressure (thermal + fast particles) [J]. Time-dependent; Scalar + real(ids_real) :: energy_mhd_error_upper=ids_real_invalid !Upper error for "energy_mhd" + real(ids_real) :: energy_mhd_error_lower=ids_real_invalid !Lower error for "energy_mhd" + integer(ids_int) :: energy_mhd_error_index=ids_int_invalid !Index in the error_description list for "energy_mhd" + real(ids_real) :: w_mhd=ids_real_invalid !Plasma energy content = 3/2 * int(p,dV) with p being the total pressure (thermal + fast particles) [J]. Time-dependent; Scalar + real(ids_real) :: w_mhd_error_upper=ids_real_invalid !Upper error for "w_mhd" + real(ids_real) :: w_mhd_error_lower=ids_real_invalid !Lower error for "w_mhd" + integer(ids_int) :: w_mhd_error_index=ids_int_invalid !Index in the error_description list for "w_mhd" + real(ids_real) :: psi_external_average=ids_real_invalid !Average (over the plasma poloidal cross section) plasma poloidal magnetic flux produced by all external circuits (CS and PF coils,! + ! eddy currents, VS in-vessel coils), given by the following formula : int(psi_external.j_tor.dS) / Ip + real(ids_real) :: psi_external_average_error_upper=ids_real_invalid !Upper error for "psi_external_average" + real(ids_real) :: psi_external_average_error_lower=ids_real_invalid !Lower error for "psi_external_average" + integer(ids_int) :: psi_external_average_error_index=ids_int_invalid !Index in the error_description list for "psi_external_average" + real(ids_real) :: v_external=ids_real_invalid !External voltage, i.e. time derivative of psi_external_average (with a minus sign : - d_psi_external_average/d_time) + real(ids_real) :: v_external_error_upper=ids_real_invalid !Upper error for "v_external" + real(ids_real) :: v_external_error_lower=ids_real_invalid !Lower error for "v_external" + integer(ids_int) :: v_external_error_index=ids_int_invalid !Index in the error_description list for "v_external" + real(ids_real) :: plasma_inductance=ids_real_invalid !Plasma inductance 2 E_magnetic/Ip^2, where E_magnetic = 1/2 * int(psi.j_tor.dS) (integral over the plasma poloidal cross-section) + real(ids_real) :: plasma_inductance_error_upper=ids_real_invalid !Upper error for "plasma_inductance" + real(ids_real) :: plasma_inductance_error_lower=ids_real_invalid !Lower error for "plasma_inductance" + integer(ids_int) :: plasma_inductance_error_index=ids_int_invalid !Index in the error_description list for "plasma_inductance" + real(ids_real) :: plasma_resistance=ids_real_invalid !Plasma resistance = int(e_field.j.dV) / Ip^2 + real(ids_real) :: plasma_resistance_error_upper=ids_real_invalid !Upper error for "plasma_resistance" + real(ids_real) :: plasma_resistance_error_lower=ids_real_invalid !Lower error for "plasma_resistance" + integer(ids_int) :: plasma_resistance_error_index=ids_int_invalid !Index in the error_description list for "plasma_resistance" + end type + + type :: ids_equilibrium_profiles_1d_rz1d_dynamic_aos + real(ids_real), pointer :: r(:) => null() !Major radius + real(ids_real), pointer :: r_error_upper(:) => null() !Upper error for "r" + real(ids_real), pointer :: r_error_lower(:) => null() !Lower error for "r" + integer(ids_int) :: r_error_index=ids_int_invalid !Index in the error_description list for "r" + real(ids_real), pointer :: z(:) => null() !Height + real(ids_real), pointer :: z_error_upper(:) => null() !Upper error for "z" + real(ids_real), pointer :: z_error_lower(:) => null() !Lower error for "z" + integer(ids_int) :: z_error_index=ids_int_invalid !Index in the error_description list for "z" + end type + + type :: ids_equilibrium_profiles_1d + real(ids_real), pointer :: psi(:) => null() !Poloidal flux + real(ids_real), pointer :: psi_error_upper(:) => null() !Upper error for "psi" + real(ids_real), pointer :: psi_error_lower(:) => null() !Lower error for "psi" + integer(ids_int) :: psi_error_index=ids_int_invalid !Index in the error_description list for "psi" + real(ids_real), pointer :: phi(:) => null() !Toroidal flux + real(ids_real), pointer :: phi_error_upper(:) => null() !Upper error for "phi" + real(ids_real), pointer :: phi_error_lower(:) => null() !Lower error for "phi" + integer(ids_int) :: phi_error_index=ids_int_invalid !Index in the error_description list for "phi" + real(ids_real), pointer :: pressure(:) => null() !Pressure + real(ids_real), pointer :: pressure_error_upper(:) => null() !Upper error for "pressure" + real(ids_real), pointer :: pressure_error_lower(:) => null() !Lower error for "pressure" + integer(ids_int) :: pressure_error_index=ids_int_invalid !Index in the error_description list for "pressure" + real(ids_real), pointer :: f(:) => null() !Diamagnetic function (F=R B_Phi) + real(ids_real), pointer :: f_error_upper(:) => null() !Upper error for "f" + real(ids_real), pointer :: f_error_lower(:) => null() !Lower error for "f" + integer(ids_int) :: f_error_index=ids_int_invalid !Index in the error_description list for "f" + real(ids_real), pointer :: dpressure_dpsi(:) => null() !Derivative of pressure w.r.t. psi + real(ids_real), pointer :: dpressure_dpsi_error_upper(:) => null() !Upper error for "dpressure_dpsi" + real(ids_real), pointer :: dpressure_dpsi_error_lower(:) => null() !Lower error for "dpressure_dpsi" + integer(ids_int) :: dpressure_dpsi_error_index=ids_int_invalid !Index in the error_description list for "dpressure_dpsi" + real(ids_real), pointer :: f_df_dpsi(:) => null() !Derivative of F w.r.t. Psi, multiplied with F + real(ids_real), pointer :: f_df_dpsi_error_upper(:) => null() !Upper error for "f_df_dpsi" + real(ids_real), pointer :: f_df_dpsi_error_lower(:) => null() !Lower error for "f_df_dpsi" + integer(ids_int) :: f_df_dpsi_error_index=ids_int_invalid !Index in the error_description list for "f_df_dpsi" + real(ids_real), pointer :: j_tor(:) => null() !Flux surface averaged toroidal current density = average(j_tor/R) / average(1/R) + real(ids_real), pointer :: j_tor_error_upper(:) => null() !Upper error for "j_tor" + real(ids_real), pointer :: j_tor_error_lower(:) => null() !Lower error for "j_tor" + integer(ids_int) :: j_tor_error_index=ids_int_invalid !Index in the error_description list for "j_tor" + real(ids_real), pointer :: j_parallel(:) => null() !Flux surface averaged parallel current density = average(j.B) / B0, where B0 = Equilibrium/Global/Toroidal_Field/B0 + real(ids_real), pointer :: j_parallel_error_upper(:) => null() !Upper error for "j_parallel" + real(ids_real), pointer :: j_parallel_error_lower(:) => null() !Lower error for "j_parallel" + integer(ids_int) :: j_parallel_error_index=ids_int_invalid !Index in the error_description list for "j_parallel" + real(ids_real), pointer :: q(:) => null() !Safety factor (IMAS uses COCOS=11: only positive when toroidal current and magnetic field are in same direction) + real(ids_real), pointer :: q_error_upper(:) => null() !Upper error for "q" + real(ids_real), pointer :: q_error_lower(:) => null() !Lower error for "q" + integer(ids_int) :: q_error_index=ids_int_invalid !Index in the error_description list for "q" + real(ids_real), pointer :: magnetic_shear(:) => null() !Magnetic shear, defined as rho_tor/q . dq/drho_tor + real(ids_real), pointer :: magnetic_shear_error_upper(:) => null() !Upper error for "magnetic_shear" + real(ids_real), pointer :: magnetic_shear_error_lower(:) => null() !Lower error for "magnetic_shear" + integer(ids_int) :: magnetic_shear_error_index=ids_int_invalid !Index in the error_description list for "magnetic_shear" + real(ids_real), pointer :: r_inboard(:) => null() !Radial coordinate (major radius) on the inboard side of the magnetic axis + real(ids_real), pointer :: r_inboard_error_upper(:) => null() !Upper error for "r_inboard" + real(ids_real), pointer :: r_inboard_error_lower(:) => null() !Lower error for "r_inboard" + integer(ids_int) :: r_inboard_error_index=ids_int_invalid !Index in the error_description list for "r_inboard" + real(ids_real), pointer :: r_outboard(:) => null() !Radial coordinate (major radius) on the outboard side of the magnetic axis + real(ids_real), pointer :: r_outboard_error_upper(:) => null() !Upper error for "r_outboard" + real(ids_real), pointer :: r_outboard_error_lower(:) => null() !Lower error for "r_outboard" + integer(ids_int) :: r_outboard_error_index=ids_int_invalid !Index in the error_description list for "r_outboard" + real(ids_real), pointer :: rho_tor(:) => null() !Toroidal flux coordinate = sqrt(phi/(pi*b0)), where the toroidal flux, phi, corresponds to time_slice/profiles_1d/phi, the toroida! + !l magnetic field, b0, corresponds to vacuum_toroidal_field/b0 and pi can be found in the IMAS constants + real(ids_real), pointer :: rho_tor_error_upper(:) => null() !Upper error for "rho_tor" + real(ids_real), pointer :: rho_tor_error_lower(:) => null() !Lower error for "rho_tor" + integer(ids_int) :: rho_tor_error_index=ids_int_invalid !Index in the error_description list for "rho_tor" + real(ids_real), pointer :: rho_tor_norm(:) => null() !Normalised toroidal flux coordinate. The normalizing value for rho_tor_norm, is the toroidal flux coordinate at the equilibrium bo! + !undary (LCFS or 99.x % of the LCFS in case of a fixed boundary equilibium calculation) + real(ids_real), pointer :: rho_tor_norm_error_upper(:) => null() !Upper error for "rho_tor_norm" + real(ids_real), pointer :: rho_tor_norm_error_lower(:) => null() !Lower error for "rho_tor_norm" + integer(ids_int) :: rho_tor_norm_error_index=ids_int_invalid !Index in the error_description list for "rho_tor_norm" + real(ids_real), pointer :: dpsi_drho_tor(:) => null() !Derivative of Psi with respect to Rho_Tor + real(ids_real), pointer :: dpsi_drho_tor_error_upper(:) => null() !Upper error for "dpsi_drho_tor" + real(ids_real), pointer :: dpsi_drho_tor_error_lower(:) => null() !Lower error for "dpsi_drho_tor" + integer(ids_int) :: dpsi_drho_tor_error_index=ids_int_invalid !Index in the error_description list for "dpsi_drho_tor" + type(ids_equilibrium_profiles_1d_rz1d_dynamic_aos) :: geometric_axis !RZ position of the geometric axis of the magnetic surfaces (defined as (Rmin+Rmax) / 2 and (Zmin+Zmax) / 2 of the surface) + real(ids_real), pointer :: elongation(:) => null() !Elongation + real(ids_real), pointer :: elongation_error_upper(:) => null() !Upper error for "elongation" + real(ids_real), pointer :: elongation_error_lower(:) => null() !Lower error for "elongation" + integer(ids_int) :: elongation_error_index=ids_int_invalid !Index in the error_description list for "elongation" + real(ids_real), pointer :: triangularity_upper(:) => null() !Upper triangularity w.r.t. magnetic axis + real(ids_real), pointer :: triangularity_upper_error_upper(:) => null() !Upper error for "triangularity_upper" + real(ids_real), pointer :: triangularity_upper_error_lower(:) => null() !Lower error for "triangularity_upper" + integer(ids_int) :: triangularity_upper_error_index=ids_int_invalid !Index in the error_description list for "triangularity_upper" + real(ids_real), pointer :: triangularity_lower(:) => null() !Lower triangularity w.r.t. magnetic axis + real(ids_real), pointer :: triangularity_lower_error_upper(:) => null() !Upper error for "triangularity_lower" + real(ids_real), pointer :: triangularity_lower_error_lower(:) => null() !Lower error for "triangularity_lower" + integer(ids_int) :: triangularity_lower_error_index=ids_int_invalid !Index in the error_description list for "triangularity_lower" + real(ids_real), pointer :: squareness_upper_inner(:) => null() !Upper inner squareness (definition from T. Luce, Plasma Phys. Control. Fusion 55 (2013) 095009) + real(ids_real), pointer :: squareness_upper_inner_error_upper(:) => null() !Upper error for "squareness_upper_inner" + real(ids_real), pointer :: squareness_upper_inner_error_lower(:) => null() !Lower error for "squareness_upper_inner" + integer(ids_int) :: squareness_upper_inner_error_index=ids_int_invalid !Index in the error_description list for "squareness_upper_inner" + real(ids_real), pointer :: squareness_upper_outer(:) => null() !Upper outer squareness (definition from T. Luce, Plasma Phys. Control. Fusion 55 (2013) 095009) + real(ids_real), pointer :: squareness_upper_outer_error_upper(:) => null() !Upper error for "squareness_upper_outer" + real(ids_real), pointer :: squareness_upper_outer_error_lower(:) => null() !Lower error for "squareness_upper_outer" + integer(ids_int) :: squareness_upper_outer_error_index=ids_int_invalid !Index in the error_description list for "squareness_upper_outer" + real(ids_real), pointer :: squareness_lower_inner(:) => null() !Lower inner squareness (definition from T. Luce, Plasma Phys. Control. Fusion 55 (2013) 095009) + real(ids_real), pointer :: squareness_lower_inner_error_upper(:) => null() !Upper error for "squareness_lower_inner" + real(ids_real), pointer :: squareness_lower_inner_error_lower(:) => null() !Lower error for "squareness_lower_inner" + integer(ids_int) :: squareness_lower_inner_error_index=ids_int_invalid !Index in the error_description list for "squareness_lower_inner" + real(ids_real), pointer :: squareness_lower_outer(:) => null() !Lower outer squareness (definition from T. Luce, Plasma Phys. Control. Fusion 55 (2013) 095009) + real(ids_real), pointer :: squareness_lower_outer_error_upper(:) => null() !Upper error for "squareness_lower_outer" + real(ids_real), pointer :: squareness_lower_outer_error_lower(:) => null() !Lower error for "squareness_lower_outer" + integer(ids_int) :: squareness_lower_outer_error_index=ids_int_invalid !Index in the error_description list for "squareness_lower_outer" + real(ids_real), pointer :: volume(:) => null() !Volume enclosed in the flux surface + real(ids_real), pointer :: volume_error_upper(:) => null() !Upper error for "volume" + real(ids_real), pointer :: volume_error_lower(:) => null() !Lower error for "volume" + integer(ids_int) :: volume_error_index=ids_int_invalid !Index in the error_description list for "volume" + real(ids_real), pointer :: rho_volume_norm(:) => null() !Normalised square root of enclosed volume (radial coordinate). The normalizing value is the enclosed volume at the equilibrium bou! + !ndary (LCFS or 99.x % of the LCFS in case of a fixed boundary equilibium calculation) + real(ids_real), pointer :: rho_volume_norm_error_upper(:) => null() !Upper error for "rho_volume_norm" + real(ids_real), pointer :: rho_volume_norm_error_lower(:) => null() !Lower error for "rho_volume_norm" + integer(ids_int) :: rho_volume_norm_error_index=ids_int_invalid !Index in the error_description list for "rho_volume_norm" + real(ids_real), pointer :: dvolume_dpsi(:) => null() !Radial derivative of the volume enclosed in the flux surface with respect to Psi + real(ids_real), pointer :: dvolume_dpsi_error_upper(:) => null() !Upper error for "dvolume_dpsi" + real(ids_real), pointer :: dvolume_dpsi_error_lower(:) => null() !Lower error for "dvolume_dpsi" + integer(ids_int) :: dvolume_dpsi_error_index=ids_int_invalid !Index in the error_description list for "dvolume_dpsi" + real(ids_real), pointer :: dvolume_drho_tor(:) => null() !Radial derivative of the volume enclosed in the flux surface with respect to Rho_Tor + real(ids_real), pointer :: dvolume_drho_tor_error_upper(:) => null() !Upper error for "dvolume_drho_tor" + real(ids_real), pointer :: dvolume_drho_tor_error_lower(:) => null() !Lower error for "dvolume_drho_tor" + integer(ids_int) :: dvolume_drho_tor_error_index=ids_int_invalid !Index in the error_description list for "dvolume_drho_tor" + real(ids_real), pointer :: area(:) => null() !Cross-sectional area of the flux surface + real(ids_real), pointer :: area_error_upper(:) => null() !Upper error for "area" + real(ids_real), pointer :: area_error_lower(:) => null() !Lower error for "area" + integer(ids_int) :: area_error_index=ids_int_invalid !Index in the error_description list for "area" + real(ids_real), pointer :: darea_dpsi(:) => null() !Radial derivative of the cross-sectional area of the flux surface with respect to psi + real(ids_real), pointer :: darea_dpsi_error_upper(:) => null() !Upper error for "darea_dpsi" + real(ids_real), pointer :: darea_dpsi_error_lower(:) => null() !Lower error for "darea_dpsi" + integer(ids_int) :: darea_dpsi_error_index=ids_int_invalid !Index in the error_description list for "darea_dpsi" + real(ids_real), pointer :: darea_drho_tor(:) => null() !Radial derivative of the cross-sectional area of the flux surface with respect to rho_tor + real(ids_real), pointer :: darea_drho_tor_error_upper(:) => null() !Upper error for "darea_drho_tor" + real(ids_real), pointer :: darea_drho_tor_error_lower(:) => null() !Lower error for "darea_drho_tor" + integer(ids_int) :: darea_drho_tor_error_index=ids_int_invalid !Index in the error_description list for "darea_drho_tor" + real(ids_real), pointer :: surface(:) => null() !Surface area of the toroidal flux surface + real(ids_real), pointer :: surface_error_upper(:) => null() !Upper error for "surface" + real(ids_real), pointer :: surface_error_lower(:) => null() !Lower error for "surface" + integer(ids_int) :: surface_error_index=ids_int_invalid !Index in the error_description list for "surface" + real(ids_real), pointer :: trapped_fraction(:) => null() !Trapped particle fraction + real(ids_real), pointer :: trapped_fraction_error_upper(:) => null() !Upper error for "trapped_fraction" + real(ids_real), pointer :: trapped_fraction_error_lower(:) => null() !Lower error for "trapped_fraction" + integer(ids_int) :: trapped_fraction_error_index=ids_int_invalid !Index in the error_description list for "trapped_fraction" + real(ids_real), pointer :: gm1(:) => null() !Flux surface averaged 1/R^2 + real(ids_real), pointer :: gm1_error_upper(:) => null() !Upper error for "gm1" + real(ids_real), pointer :: gm1_error_lower(:) => null() !Lower error for "gm1" + integer(ids_int) :: gm1_error_index=ids_int_invalid !Index in the error_description list for "gm1" + real(ids_real), pointer :: gm2(:) => null() !Flux surface averaged |grad_rho_tor|^2/R^2 + real(ids_real), pointer :: gm2_error_upper(:) => null() !Upper error for "gm2" + real(ids_real), pointer :: gm2_error_lower(:) => null() !Lower error for "gm2" + integer(ids_int) :: gm2_error_index=ids_int_invalid !Index in the error_description list for "gm2" + real(ids_real), pointer :: gm3(:) => null() !Flux surface averaged |grad_rho_tor|^2 + real(ids_real), pointer :: gm3_error_upper(:) => null() !Upper error for "gm3" + real(ids_real), pointer :: gm3_error_lower(:) => null() !Lower error for "gm3" + integer(ids_int) :: gm3_error_index=ids_int_invalid !Index in the error_description list for "gm3" + real(ids_real), pointer :: gm4(:) => null() !Flux surface averaged 1/B^2 + real(ids_real), pointer :: gm4_error_upper(:) => null() !Upper error for "gm4" + real(ids_real), pointer :: gm4_error_lower(:) => null() !Lower error for "gm4" + integer(ids_int) :: gm4_error_index=ids_int_invalid !Index in the error_description list for "gm4" + real(ids_real), pointer :: gm5(:) => null() !Flux surface averaged B^2 + real(ids_real), pointer :: gm5_error_upper(:) => null() !Upper error for "gm5" + real(ids_real), pointer :: gm5_error_lower(:) => null() !Lower error for "gm5" + integer(ids_int) :: gm5_error_index=ids_int_invalid !Index in the error_description list for "gm5" + real(ids_real), pointer :: gm6(:) => null() !Flux surface averaged |grad_rho_tor|^2/B^2 + real(ids_real), pointer :: gm6_error_upper(:) => null() !Upper error for "gm6" + real(ids_real), pointer :: gm6_error_lower(:) => null() !Lower error for "gm6" + integer(ids_int) :: gm6_error_index=ids_int_invalid !Index in the error_description list for "gm6" + real(ids_real), pointer :: gm7(:) => null() !Flux surface averaged |grad_rho_tor| + real(ids_real), pointer :: gm7_error_upper(:) => null() !Upper error for "gm7" + real(ids_real), pointer :: gm7_error_lower(:) => null() !Lower error for "gm7" + integer(ids_int) :: gm7_error_index=ids_int_invalid !Index in the error_description list for "gm7" + real(ids_real), pointer :: gm8(:) => null() !Flux surface averaged R + real(ids_real), pointer :: gm8_error_upper(:) => null() !Upper error for "gm8" + real(ids_real), pointer :: gm8_error_lower(:) => null() !Lower error for "gm8" + integer(ids_int) :: gm8_error_index=ids_int_invalid !Index in the error_description list for "gm8" + real(ids_real), pointer :: gm9(:) => null() !Flux surface averaged 1/R + real(ids_real), pointer :: gm9_error_upper(:) => null() !Upper error for "gm9" + real(ids_real), pointer :: gm9_error_lower(:) => null() !Lower error for "gm9" + integer(ids_int) :: gm9_error_index=ids_int_invalid !Index in the error_description list for "gm9" + real(ids_real), pointer :: b_average(:) => null() !Flux surface averaged B + real(ids_real), pointer :: b_average_error_upper(:) => null() !Upper error for "b_average" + real(ids_real), pointer :: b_average_error_lower(:) => null() !Lower error for "b_average" + integer(ids_int) :: b_average_error_index=ids_int_invalid !Index in the error_description list for "b_average" + real(ids_real), pointer :: b_field_average(:) => null() !Flux surface averaged modulus of B (always positive, irrespective of the sign convention for the B-field direction). + real(ids_real), pointer :: b_field_average_error_upper(:) => null() !Upper error for "b_field_average" + real(ids_real), pointer :: b_field_average_error_lower(:) => null() !Lower error for "b_field_average" + integer(ids_int) :: b_field_average_error_index=ids_int_invalid !Index in the error_description list for "b_field_average" + real(ids_real), pointer :: b_min(:) => null() !Minimum(B) on the flux surface + real(ids_real), pointer :: b_min_error_upper(:) => null() !Upper error for "b_min" + real(ids_real), pointer :: b_min_error_lower(:) => null() !Lower error for "b_min" + integer(ids_int) :: b_min_error_index=ids_int_invalid !Index in the error_description list for "b_min" + real(ids_real), pointer :: b_field_min(:) => null() !Minimum(modulus(B)) on the flux surface (always positive, irrespective of the sign convention for the B-field direction) + real(ids_real), pointer :: b_field_min_error_upper(:) => null() !Upper error for "b_field_min" + real(ids_real), pointer :: b_field_min_error_lower(:) => null() !Lower error for "b_field_min" + integer(ids_int) :: b_field_min_error_index=ids_int_invalid !Index in the error_description list for "b_field_min" + real(ids_real), pointer :: b_max(:) => null() !Maximum(B) on the flux surface + real(ids_real), pointer :: b_max_error_upper(:) => null() !Upper error for "b_max" + real(ids_real), pointer :: b_max_error_lower(:) => null() !Lower error for "b_max" + integer(ids_int) :: b_max_error_index=ids_int_invalid !Index in the error_description list for "b_max" + real(ids_real), pointer :: b_field_max(:) => null() !Maximum(modulus(B)) on the flux surface (always positive, irrespective of the sign convention for the B-field direction) + real(ids_real), pointer :: b_field_max_error_upper(:) => null() !Upper error for "b_field_max" + real(ids_real), pointer :: b_field_max_error_lower(:) => null() !Lower error for "b_field_max" + integer(ids_int) :: b_field_max_error_index=ids_int_invalid !Index in the error_description list for "b_field_max" + real(ids_real), pointer :: beta_pol(:) => null() !Poloidal beta profile. Defined as betap = 4 int(p dV) / [R_0 * mu_0 * Ip^2] + real(ids_real), pointer :: beta_pol_error_upper(:) => null() !Upper error for "beta_pol" + real(ids_real), pointer :: beta_pol_error_lower(:) => null() !Lower error for "beta_pol" + integer(ids_int) :: beta_pol_error_index=ids_int_invalid !Index in the error_description list for "beta_pol" + real(ids_real), pointer :: mass_density(:) => null() !Mass density + real(ids_real), pointer :: mass_density_error_upper(:) => null() !Upper error for "mass_density" + real(ids_real), pointer :: mass_density_error_lower(:) => null() !Lower error for "mass_density" + integer(ids_int) :: mass_density_error_index=ids_int_invalid !Index in the error_description list for "mass_density" + end type + + type :: ids_equilibrium_profiles_2d + type(ids_identifier_dynamic_aos3) :: type !Type of profiles (distinguishes contribution from plasma, vaccum fields and total fields) + type(ids_identifier_dynamic_aos3) :: grid_type !Selection of one of a set of grid types + type(ids_equilibrium_profiles_2d_grid) :: grid !Definition of the 2D grid (the content of dim1 and dim2 is defined by the selected grid_type) + real(ids_real), pointer :: r(:,:) => null() !Values of the major radius on the grid + real(ids_real), pointer :: r_error_upper(:,:) => null() !Upper error for "r" + real(ids_real), pointer :: r_error_lower(:,:) => null() !Lower error for "r" + integer(ids_int) :: r_error_index=ids_int_invalid !Index in the error_description list for "r" + real(ids_real), pointer :: z(:,:) => null() !Values of the Height on the grid + real(ids_real), pointer :: z_error_upper(:,:) => null() !Upper error for "z" + real(ids_real), pointer :: z_error_lower(:,:) => null() !Lower error for "z" + integer(ids_int) :: z_error_index=ids_int_invalid !Index in the error_description list for "z" + real(ids_real), pointer :: psi(:,:) => null() !Values of the poloidal flux at the grid in the poloidal plane + real(ids_real), pointer :: psi_error_upper(:,:) => null() !Upper error for "psi" + real(ids_real), pointer :: psi_error_lower(:,:) => null() !Lower error for "psi" + integer(ids_int) :: psi_error_index=ids_int_invalid !Index in the error_description list for "psi" + real(ids_real), pointer :: theta(:,:) => null() !Values of the poloidal angle on the grid + real(ids_real), pointer :: theta_error_upper(:,:) => null() !Upper error for "theta" + real(ids_real), pointer :: theta_error_lower(:,:) => null() !Lower error for "theta" + integer(ids_int) :: theta_error_index=ids_int_invalid !Index in the error_description list for "theta" + real(ids_real), pointer :: phi(:,:) => null() !Toroidal flux + real(ids_real), pointer :: phi_error_upper(:,:) => null() !Upper error for "phi" + real(ids_real), pointer :: phi_error_lower(:,:) => null() !Lower error for "phi" + integer(ids_int) :: phi_error_index=ids_int_invalid !Index in the error_description list for "phi" + real(ids_real), pointer :: j_tor(:,:) => null() !Toroidal plasma current density + real(ids_real), pointer :: j_tor_error_upper(:,:) => null() !Upper error for "j_tor" + real(ids_real), pointer :: j_tor_error_lower(:,:) => null() !Lower error for "j_tor" + integer(ids_int) :: j_tor_error_index=ids_int_invalid !Index in the error_description list for "j_tor" + real(ids_real), pointer :: j_parallel(:,:) => null() !Defined as (j.B)/B0 where j and B are the current density and magnetic field vectors and B0 is the (signed) vacuum toroidal magnet! + !ic field strength at the geometric reference point (R0,Z0). It is formally not the component of the plasma current density paralle! + !l to the magnetic field + real(ids_real), pointer :: j_parallel_error_upper(:,:) => null() !Upper error for "j_parallel" + real(ids_real), pointer :: j_parallel_error_lower(:,:) => null() !Lower error for "j_parallel" + integer(ids_int) :: j_parallel_error_index=ids_int_invalid !Index in the error_description list for "j_parallel" + real(ids_real), pointer :: b_r(:,:) => null() !R component of the poloidal magnetic field + real(ids_real), pointer :: b_r_error_upper(:,:) => null() !Upper error for "b_r" + real(ids_real), pointer :: b_r_error_lower(:,:) => null() !Lower error for "b_r" + integer(ids_int) :: b_r_error_index=ids_int_invalid !Index in the error_description list for "b_r" + real(ids_real), pointer :: b_field_r(:,:) => null() !R component of the poloidal magnetic field + real(ids_real), pointer :: b_field_r_error_upper(:,:) => null() !Upper error for "b_field_r" + real(ids_real), pointer :: b_field_r_error_lower(:,:) => null() !Lower error for "b_field_r" + integer(ids_int) :: b_field_r_error_index=ids_int_invalid !Index in the error_description list for "b_field_r" + real(ids_real), pointer :: b_z(:,:) => null() !Z component of the poloidal magnetic field + real(ids_real), pointer :: b_z_error_upper(:,:) => null() !Upper error for "b_z" + real(ids_real), pointer :: b_z_error_lower(:,:) => null() !Lower error for "b_z" + integer(ids_int) :: b_z_error_index=ids_int_invalid !Index in the error_description list for "b_z" + real(ids_real), pointer :: b_field_z(:,:) => null() !Z component of the poloidal magnetic field + real(ids_real), pointer :: b_field_z_error_upper(:,:) => null() !Upper error for "b_field_z" + real(ids_real), pointer :: b_field_z_error_lower(:,:) => null() !Lower error for "b_field_z" + integer(ids_int) :: b_field_z_error_index=ids_int_invalid !Index in the error_description list for "b_field_z" + real(ids_real), pointer :: b_tor(:,:) => null() !Toroidal component of the magnetic field + real(ids_real), pointer :: b_tor_error_upper(:,:) => null() !Upper error for "b_tor" + real(ids_real), pointer :: b_tor_error_lower(:,:) => null() !Lower error for "b_tor" + integer(ids_int) :: b_tor_error_index=ids_int_invalid !Index in the error_description list for "b_tor" + real(ids_real), pointer :: b_field_tor(:,:) => null() !Toroidal component of the magnetic field + real(ids_real), pointer :: b_field_tor_error_upper(:,:) => null() !Upper error for "b_field_tor" + real(ids_real), pointer :: b_field_tor_error_lower(:,:) => null() !Lower error for "b_field_tor" + integer(ids_int) :: b_field_tor_error_index=ids_int_invalid !Index in the error_description list for "b_field_tor" + end type + + type :: ids_equilibrium_ggd + type(ids_generic_grid_dynamic) :: grid !Grid description + type(ids_generic_grid_scalar), pointer :: r(:) => null() !Values of the major radius on various grid subsets + type(ids_generic_grid_scalar), pointer :: z(:) => null() !Values of the Height on various grid subsets + type(ids_generic_grid_scalar), pointer :: psi(:) => null() !Values of the poloidal flux, given on various grid subsets + type(ids_generic_grid_scalar), pointer :: phi(:) => null() !Values of the toroidal flux, given on various grid subsets + type(ids_generic_grid_scalar), pointer :: theta(:) => null() !Values of the poloidal angle, given on various grid subsets + type(ids_generic_grid_scalar), pointer :: j_tor(:) => null() !Toroidal plasma current density, given on various grid subsets + type(ids_generic_grid_scalar), pointer :: j_parallel(:) => null() !Parallel (to magnetic field) plasma current density, given on various grid subsets + type(ids_generic_grid_scalar), pointer :: b_field_r(:) => null() !R component of the poloidal magnetic field, given on various grid subsets + type(ids_generic_grid_scalar), pointer :: b_field_z(:) => null() !Z component of the poloidal magnetic field, given on various grid subsets + type(ids_generic_grid_scalar), pointer :: b_field_tor(:) => null() !Toroidal component of the magnetic field, given on various grid subsets + end type + + type :: ids_equilibrium_convergence + integer(ids_int) :: iterations_n=ids_int_invalid !Number of iterations carried out in the convergence loop + type(ids_identifier_dynamic_aos3) :: grad_shafranov_deviation_expression !Expression for calculating the residual deviation between the left and right hand side of the Grad Shafranov equation + real(ids_real) :: grad_shafranov_deviation_value=ids_real_invalid !Value of the residual deviation between the left and right hand side of the Grad Shafranov equation, evaluated as per grad_shafran! + !ov_deviation_expression + real(ids_real) :: grad_shafranov_deviation_value_error_upper=ids_real_invalid !Upper error for "grad_shafranov_deviation_value" + real(ids_real) :: grad_shafranov_deviation_value_error_lower=ids_real_invalid !Lower error for "grad_shafranov_deviation_value" + integer(ids_int) :: grad_shafranov_deviation_value_error_index=ids_int_invalid !Index in the error_description list for "grad_shafranov_deviation_value" + end type + + type :: ids_equilibrium_time_slice + type(ids_equilibrium_boundary) :: boundary !Description of the plasma boundary used by fixed-boundary codes and typically chosen at psi_norm = 99.x% of the separatrix + type(ids_equilibrium_boundary_separatrix) :: boundary_separatrix !Description of the plasma boundary at the separatrix + type(ids_equilibrium_boundary_second_separatrix) :: boundary_secondary_separatrix !Geometry of the secondary separatrix, defined as the outer flux surface with an X-point + type(ids_equilibrium_constraints) :: constraints !In case of equilibrium reconstruction under constraints, measurements used to constrain the equilibrium, reconstructed values and ! + !accuracy of the fit. The names of the child nodes correspond to the following definition: the solver aims at minimizing a cost fun! + !ction defined as : J=1/2*sum_i [ weight_i^2 (reconstructed_i - measured_i)^2 / sigma_i^2 ]. in which sigma_i is the standard devia! + !tion of the measurement error (to be found in the IDS of the measurement) + type(ids_equlibrium_global_quantities) :: global_quantities !0D parameters of the equilibrium + type(ids_equilibrium_profiles_1d) :: profiles_1d !Equilibrium profiles (1D radial grid) as a function of the poloidal flux + type(ids_equilibrium_profiles_2d), pointer :: profiles_2d(:) => null() !Equilibrium 2D profiles in the poloidal plane. Multiple 2D representations of the equilibrium can be stored here. + type(ids_equilibrium_ggd), pointer :: ggd(:) => null() !Set of equilibrium representations using the generic grid description + type(ids_equilibrium_coordinate_system) :: coordinate_system !Flux surface coordinate system on a square grid of flux and poloidal angle + type(ids_equilibrium_convergence) :: convergence !Convergence details + real(ids_real) :: time=ids_real_invalid !Time + end type + + + ! *********** equilibrium IDS + type, extends(IDS_base) :: ids_equilibrium !Description of a 2D, axi-symmetric, tokamak equilibrium; result of an equilibrium code. + logical, private :: c_data = .FALSE. ! Fortran specific metadata telling whether the IDS has been populated from C allocated data (LL) or not + integer, private :: max_occurrence = 3! Maximum occurrence allowed as defined in the DD + + type(ids_ids_properties) :: ids_properties !Interface Data Structure properties. This element identifies the node above as an IDS + type(ids_b_tor_vacuum_1) :: vacuum_toroidal_field !Characteristics of the vacuum toroidal field (used in rho_tor definition and in the normalization of current densities) + type(ids_equilibrium_ggd_array), pointer :: grids_ggd(:) => null() !Grids (using the Generic Grid Description), for various time slices. The timebase of this array of structure must be a subset of t! + !he time_slice timebase + type(ids_equilibrium_time_slice), pointer :: time_slice(:) => null() !Set of equilibria at various time slices + type(ids_code) :: code !Generic decription of the code-specific parameters for the code that has produced this IDS + real(ids_real), pointer :: time(:) => null() !Generic time + end type + + ! *********** gas_injection IDS internal structures declaration + + type :: ids_gas_injection_pipe + character(len=ids_string_length), dimension(:), pointer :: name => null() !Name of the injection pipe + character(len=ids_string_length), dimension(:), pointer :: identifier => null() !ID of the injection pipe + type(ids_gas_mixture_constant), pointer :: species(:) => null() !Species injected by the pipe (may be more than one in case the valve injects a gas mixture) + real(ids_real) :: length=ids_real_invalid !Pipe length + real(ids_real) :: length_error_upper=ids_real_invalid !Upper error for "length" + real(ids_real) :: length_error_lower=ids_real_invalid !Lower error for "length" + integer(ids_int) :: length_error_index=ids_int_invalid !Index in the error_description list for "length" + type(ids_rzphi0d_static) :: exit_position !Exit position of the pipe in the vaccum vessel + type(ids_rzphi0d_static) :: second_point !Second point indicating (combined with the exit_position) the direction of the gas injection towards the plasma + type(ids_signal_flt_1d) :: flow_rate !Flow rate at the exit of the pipe + integer(ids_int), pointer :: valve_indices(:) => null() !Indices (from the ../../valve array of structure) of the valve(s) that are feeding this pipe + end type + + type :: ids_gas_injection_valve_response + real(ids_real), pointer :: voltage(:) => null() !Voltage applied to open the valve + real(ids_real), pointer :: voltage_error_upper(:) => null() !Upper error for "voltage" + real(ids_real), pointer :: voltage_error_lower(:) => null() !Lower error for "voltage" + integer(ids_int) :: voltage_error_index=ids_int_invalid !Index in the error_description list for "voltage" + real(ids_real), pointer :: flow_rate(:) => null() !Flow rate at the exit of the valve + real(ids_real), pointer :: flow_rate_error_upper(:) => null() !Upper error for "flow_rate" + real(ids_real), pointer :: flow_rate_error_lower(:) => null() !Lower error for "flow_rate" + integer(ids_int) :: flow_rate_error_index=ids_int_invalid !Index in the error_description list for "flow_rate" + end type + + type :: ids_gas_injection_pipe_valve + character(len=ids_string_length), dimension(:), pointer :: name => null() !Name of the valve + character(len=ids_string_length), dimension(:), pointer :: identifier => null() !ID of the valve + type(ids_gas_mixture_constant), pointer :: species(:) => null() !Species injected by the valve (may be more than one in case the valve injects a gas mixture) + real(ids_real) :: flow_rate_min=ids_real_invalid !Minimum flow rate of the valve + real(ids_real) :: flow_rate_min_error_upper=ids_real_invalid !Upper error for "flow_rate_min" + real(ids_real) :: flow_rate_min_error_lower=ids_real_invalid !Lower error for "flow_rate_min" + integer(ids_int) :: flow_rate_min_error_index=ids_int_invalid !Index in the error_description list for "flow_rate_min" + real(ids_real) :: flow_rate_max=ids_real_invalid !Maximum flow rate of the valve + real(ids_real) :: flow_rate_max_error_upper=ids_real_invalid !Upper error for "flow_rate_max" + real(ids_real) :: flow_rate_max_error_lower=ids_real_invalid !Lower error for "flow_rate_max" + integer(ids_int) :: flow_rate_max_error_index=ids_int_invalid !Index in the error_description list for "flow_rate_max" + type(ids_signal_flt_1d) :: flow_rate !Flow rate at the exit of the valve + type(ids_signal_flt_1d) :: electron_rate !Number of electrons injected per second + integer(ids_int), pointer :: pipe_indices(:) => null() !Indices (from the ../../pipe array of structure) of the pipe(s) that are fed by this valve + type(ids_signal_flt_1d) :: voltage !Voltage applied to open the valve (raw data used to compute the gas flow rate) + type(ids_gas_injection_valve_response) :: response_curve !Response curve of the valve, i.e. gas flow rate obtained as a function of the applied voltage. + end type + + + ! *********** gas_injection IDS + type, extends(IDS_base) :: ids_gas_injection !Gas injection by a system of pipes and valves + logical, private :: c_data = .FALSE. ! Fortran specific metadata telling whether the IDS has been populated from C allocated data (LL) or not + integer, private :: max_occurrence = 2! Maximum occurrence allowed as defined in the DD + + type(ids_ids_properties) :: ids_properties !Interface Data Structure properties. This element identifies the node above as an IDS + type(ids_gas_injection_pipe), pointer :: pipe(:) => null() !Set of gas injection pipes + type(ids_gas_injection_pipe_valve), pointer :: valve(:) => null() !Set of valves connecting a gas bottle to pipes + real(ids_real) :: latency=ids_real_invalid !Upper bound of the delay between input command received from the RT network and actuator starting to react. Applies globally to th! + !e system described by this IDS unless specific latencies (e.g. channel-specific or antenna-specific) are provided at a deeper leve! + !l in the IDS structure. + real(ids_real) :: latency_error_upper=ids_real_invalid !Upper error for "latency" + real(ids_real) :: latency_error_lower=ids_real_invalid !Lower error for "latency" + integer(ids_int) :: latency_error_index=ids_int_invalid !Index in the error_description list for "latency" + type(ids_code) :: code !Generic decription of the code-specific parameters for the code that has produced this IDS + real(ids_real), pointer :: time(:) => null() !Generic time + end type + + ! *********** gas_pumping IDS internal structures declaration + + type :: ids_gas_pumping_species + type(ids_plasma_composition_neutral_element_constant), pointer :: element(:) => null() !List of elements forming the gas molecule + character(len=ids_string_length), dimension(:), pointer :: label => null() !String identifying the neutral molecule (e.g. H2, D2, T2, N2, ...) + type(ids_signal_flt_1d) :: flow_rate !Pumping flow rate of that species + end type + + type :: ids_gas_pumping_duct + character(len=ids_string_length), dimension(:), pointer :: name => null() !Name of the pumping duct + character(len=ids_string_length), dimension(:), pointer :: identifier => null() !ID of the pumping duct + type(ids_gas_pumping_species), pointer :: species(:) => null() !Molecular species pumped via this duct + type(ids_signal_flt_1d) :: flow_rate !Total pumping flow rate via this duct + end type + + + ! *********** gas_pumping IDS + type, extends(IDS_base) :: ids_gas_pumping !Gas pumping by a set of ducts + logical, private :: c_data = .FALSE. ! Fortran specific metadata telling whether the IDS has been populated from C allocated data (LL) or not + integer, private :: max_occurrence = 2! Maximum occurrence allowed as defined in the DD + + type(ids_ids_properties) :: ids_properties !Interface Data Structure properties. This element identifies the node above as an IDS + type(ids_gas_pumping_duct), pointer :: duct(:) => null() !Set of gas pumping ducts + type(ids_code) :: code !Generic decription of the code-specific parameters for the code that has produced this IDS + real(ids_real), pointer :: time(:) => null() !Generic time + end type + + ! *********** gyrokinetics IDS internal structures declaration + + type :: ids_gyrokinetics_input_normalizing + real(ids_real) :: t_e=ids_real_invalid !Electron temperature at outboard equatorial midplane of the flux surface (poloidal_angle = 0) + real(ids_real) :: t_e_error_upper=ids_real_invalid !Upper error for "t_e" + real(ids_real) :: t_e_error_lower=ids_real_invalid !Lower error for "t_e" + integer(ids_int) :: t_e_error_index=ids_int_invalid !Index in the error_description list for "t_e" + real(ids_real) :: n_e=ids_real_invalid !Electron density at outboard equatorial midplane of the flux surface (poloidal_angle = 0) + real(ids_real) :: n_e_error_upper=ids_real_invalid !Upper error for "n_e" + real(ids_real) :: n_e_error_lower=ids_real_invalid !Lower error for "n_e" + integer(ids_int) :: n_e_error_index=ids_int_invalid !Index in the error_description list for "n_e" + real(ids_real) :: r=ids_real_invalid !Major radius of the flux surface of interest, defined as (min(R)+max(R))/2 + real(ids_real) :: r_error_upper=ids_real_invalid !Upper error for "r" + real(ids_real) :: r_error_lower=ids_real_invalid !Lower error for "r" + integer(ids_int) :: r_error_index=ids_int_invalid !Index in the error_description list for "r" + real(ids_real) :: b_field_tor=ids_real_invalid !Toroidal magnetic field at major radius r + real(ids_real) :: b_field_tor_error_upper=ids_real_invalid !Upper error for "b_field_tor" + real(ids_real) :: b_field_tor_error_lower=ids_real_invalid !Lower error for "b_field_tor" + integer(ids_int) :: b_field_tor_error_index=ids_int_invalid !Index in the error_description list for "b_field_tor" + end type + + type :: ids_gyrokinetics_flux_surface + real(ids_real) :: r_minor_norm=ids_real_invalid !Normalised minor radius of the flux surface of interest = 1/2 * (max(R) - min(R))/L_ref + real(ids_real) :: r_minor_norm_error_upper=ids_real_invalid !Upper error for "r_minor_norm" + real(ids_real) :: r_minor_norm_error_lower=ids_real_invalid !Lower error for "r_minor_norm" + integer(ids_int) :: r_minor_norm_error_index=ids_int_invalid !Index in the error_description list for "r_minor_norm" + real(ids_real) :: elongation=ids_real_invalid !Elongation + real(ids_real) :: elongation_error_upper=ids_real_invalid !Upper error for "elongation" + real(ids_real) :: elongation_error_lower=ids_real_invalid !Lower error for "elongation" + integer(ids_int) :: elongation_error_index=ids_int_invalid !Index in the error_description list for "elongation" + real(ids_real) :: delongation_dr_minor_norm=ids_real_invalid !Derivative of the elongation with respect to r_minor_norm + real(ids_real) :: delongation_dr_minor_norm_error_upper=ids_real_invalid !Upper error for "delongation_dr_minor_norm" + real(ids_real) :: delongation_dr_minor_norm_error_lower=ids_real_invalid !Lower error for "delongation_dr_minor_norm" + integer(ids_int) :: delongation_dr_minor_norm_error_index=ids_int_invalid !Index in the error_description list for "delongation_dr_minor_norm" + real(ids_real) :: dgeometric_axis_r_dr_minor=ids_real_invalid !Derivative of the major radius of the surface geometric axis with respect to r_minor + real(ids_real) :: dgeometric_axis_r_dr_minor_error_upper=ids_real_invalid !Upper error for "dgeometric_axis_r_dr_minor" + real(ids_real) :: dgeometric_axis_r_dr_minor_error_lower=ids_real_invalid !Lower error for "dgeometric_axis_r_dr_minor" + integer(ids_int) :: dgeometric_axis_r_dr_minor_error_index=ids_int_invalid !Index in the error_description list for "dgeometric_axis_r_dr_minor" + real(ids_real) :: dgeometric_axis_z_dr_minor=ids_real_invalid !Derivative of the height of the surface geometric axis with respect to r_minor + real(ids_real) :: dgeometric_axis_z_dr_minor_error_upper=ids_real_invalid !Upper error for "dgeometric_axis_z_dr_minor" + real(ids_real) :: dgeometric_axis_z_dr_minor_error_lower=ids_real_invalid !Lower error for "dgeometric_axis_z_dr_minor" + integer(ids_int) :: dgeometric_axis_z_dr_minor_error_index=ids_int_invalid !Index in the error_description list for "dgeometric_axis_z_dr_minor" + real(ids_real) :: q=ids_real_invalid !Safety factor + real(ids_real) :: q_error_upper=ids_real_invalid !Upper error for "q" + real(ids_real) :: q_error_lower=ids_real_invalid !Lower error for "q" + integer(ids_int) :: q_error_index=ids_int_invalid !Index in the error_description list for "q" + real(ids_real) :: magnetic_shear_r_minor=ids_real_invalid !Magnetic shear, defined as r_minor_norm/q . dq/dr_minor_norm (different definition from the equilibrium IDS) + real(ids_real) :: magnetic_shear_r_minor_error_upper=ids_real_invalid !Upper error for "magnetic_shear_r_minor" + real(ids_real) :: magnetic_shear_r_minor_error_lower=ids_real_invalid !Lower error for "magnetic_shear_r_minor" + integer(ids_int) :: magnetic_shear_r_minor_error_index=ids_int_invalid !Index in the error_description list for "magnetic_shear_r_minor" + real(ids_real) :: pressure_gradient_norm=ids_real_invalid !Normalised pressure gradient (derivative with respect to r_minor_norm) + real(ids_real) :: pressure_gradient_norm_error_upper=ids_real_invalid !Upper error for "pressure_gradient_norm" + real(ids_real) :: pressure_gradient_norm_error_lower=ids_real_invalid !Lower error for "pressure_gradient_norm" + integer(ids_int) :: pressure_gradient_norm_error_index=ids_int_invalid !Index in the error_description list for "pressure_gradient_norm" + real(ids_real) :: ip_sign=ids_real_invalid !Sign of the plasma current + real(ids_real) :: ip_sign_error_upper=ids_real_invalid !Upper error for "ip_sign" + real(ids_real) :: ip_sign_error_lower=ids_real_invalid !Lower error for "ip_sign" + integer(ids_int) :: ip_sign_error_index=ids_int_invalid !Index in the error_description list for "ip_sign" + real(ids_real) :: b_field_tor_sign=ids_real_invalid !Sign of the toroidal magnetic field + real(ids_real) :: b_field_tor_sign_error_upper=ids_real_invalid !Upper error for "b_field_tor_sign" + real(ids_real) :: b_field_tor_sign_error_lower=ids_real_invalid !Lower error for "b_field_tor_sign" + integer(ids_int) :: b_field_tor_sign_error_index=ids_int_invalid !Index in the error_description list for "b_field_tor_sign" + real(ids_real), pointer :: shape_coefficients_c(:) => null() !'c' coefficients in the formula defining the shape of the flux surface + real(ids_real), pointer :: shape_coefficients_c_error_upper(:) => null() !Upper error for "shape_coefficients_c" + real(ids_real), pointer :: shape_coefficients_c_error_lower(:) => null() !Lower error for "shape_coefficients_c" + integer(ids_int) :: shape_coefficients_c_error_index=ids_int_invalid !Index in the error_description list for "shape_coefficients_c" + real(ids_real), pointer :: dc_dr_minor_norm(:) => null() !Derivative of the 'c' shape coefficients with respect to r_minor_norm + real(ids_real), pointer :: dc_dr_minor_norm_error_upper(:) => null() !Upper error for "dc_dr_minor_norm" + real(ids_real), pointer :: dc_dr_minor_norm_error_lower(:) => null() !Lower error for "dc_dr_minor_norm" + integer(ids_int) :: dc_dr_minor_norm_error_index=ids_int_invalid !Index in the error_description list for "dc_dr_minor_norm" + real(ids_real), pointer :: shape_coefficients_s(:) => null() !'s' coefficients in the formula defining the shape of the flux surface + real(ids_real), pointer :: shape_coefficients_s_error_upper(:) => null() !Upper error for "shape_coefficients_s" + real(ids_real), pointer :: shape_coefficients_s_error_lower(:) => null() !Lower error for "shape_coefficients_s" + integer(ids_int) :: shape_coefficients_s_error_index=ids_int_invalid !Index in the error_description list for "shape_coefficients_s" + real(ids_real), pointer :: ds_dr_minor_norm(:) => null() !Derivative of the 's' shape coefficients with respect to r_minor_norm + real(ids_real), pointer :: ds_dr_minor_norm_error_upper(:) => null() !Upper error for "ds_dr_minor_norm" + real(ids_real), pointer :: ds_dr_minor_norm_error_lower(:) => null() !Lower error for "ds_dr_minor_norm" + integer(ids_int) :: ds_dr_minor_norm_error_index=ids_int_invalid !Index in the error_description list for "ds_dr_minor_norm" + end type + + type :: ids_gyrokinetics_model + integer(ids_int) :: include_centrifugal_effects=ids_int_invalid !Flag = 1 if centrifugal effects are retained, 0 otherwise + integer(ids_int) :: include_a_field_parallel=ids_int_invalid !Flag = 1 if fluctuations of the parallel vector potential are retained, 0 otherwise + integer(ids_int) :: include_b_field_parallel=ids_int_invalid !Flag = 1 if fluctuations of the parallel magnetic field are retained, 0 otherwise + integer(ids_int) :: include_full_curvature_drift=ids_int_invalid !Flag = 1 if all contributions to the curvature drift are included (including beta_prime), 0 otherwise. Neglecting the beta_prime c! + !ontribution (Flag=0) is only recommended together with the neglect of parallel magnetic field fluctuations + integer(ids_int) :: collisions_pitch_only=ids_int_invalid !Flag = 1 if only pitch-angle scattering is retained, 0 otherwise + integer(ids_int) :: collisions_momentum_conservation=ids_int_invalid !Flag = 1 if the collision operator conserves momentum, 0 otherwise + integer(ids_int) :: collisions_energy_conservation=ids_int_invalid !Flag = 1 if the collision operator conserves energy, 0 otherwise + integer(ids_int) :: collisions_finite_larmor_radius=ids_int_invalid !Flag = 1 if finite larmor radius effects are retained in the collision operator, 0 otherwise + integer(ids_int) :: non_linear_run=ids_int_invalid !Flag = 1 if this is a non-linear run, 0 for a linear run + real(ids_real), pointer :: time_interval_norm(:) => null() !Normalised time interval used to average fluxes in non-linear runs + real(ids_real), pointer :: time_interval_norm_error_upper(:) => null() !Upper error for "time_interval_norm" + real(ids_real), pointer :: time_interval_norm_error_lower(:) => null() !Lower error for "time_interval_norm" + integer(ids_int) :: time_interval_norm_error_index=ids_int_invalid !Index in the error_description list for "time_interval_norm" + end type + + type :: ids_gyrokinetics_input_species_global + real(ids_real) :: beta_reference=ids_real_invalid !Reference plasma beta (see detailed documentation at the root of the IDS) + real(ids_real) :: beta_reference_error_upper=ids_real_invalid !Upper error for "beta_reference" + real(ids_real) :: beta_reference_error_lower=ids_real_invalid !Lower error for "beta_reference" + integer(ids_int) :: beta_reference_error_index=ids_int_invalid !Index in the error_description list for "beta_reference" + real(ids_real) :: velocity_tor_norm=ids_real_invalid !Normalised toroidal velocity of species (all species are assumed to have a purely toroidal velocity with a common toroidal angular! + ! frequency) + real(ids_real) :: velocity_tor_norm_error_upper=ids_real_invalid !Upper error for "velocity_tor_norm" + real(ids_real) :: velocity_tor_norm_error_lower=ids_real_invalid !Lower error for "velocity_tor_norm" + integer(ids_int) :: velocity_tor_norm_error_index=ids_int_invalid !Index in the error_description list for "velocity_tor_norm" + real(ids_real) :: zeff=ids_real_invalid !Effective charge + real(ids_real) :: zeff_error_upper=ids_real_invalid !Upper error for "zeff" + real(ids_real) :: zeff_error_lower=ids_real_invalid !Lower error for "zeff" + integer(ids_int) :: zeff_error_index=ids_int_invalid !Index in the error_description list for "zeff" + real(ids_real) :: debye_length_reference=ids_real_invalid !Debye length computed from the reference quantities (see detailed documentation at the root of the IDS) + real(ids_real) :: debye_length_reference_error_upper=ids_real_invalid !Upper error for "debye_length_reference" + real(ids_real) :: debye_length_reference_error_lower=ids_real_invalid !Lower error for "debye_length_reference" + integer(ids_int) :: debye_length_reference_error_index=ids_int_invalid !Index in the error_description list for "debye_length_reference" + real(ids_real) :: shearing_rate_norm=ids_real_invalid !Normalised ExB shearing rate (for non-linear runs only) + real(ids_real) :: shearing_rate_norm_error_upper=ids_real_invalid !Upper error for "shearing_rate_norm" + real(ids_real) :: shearing_rate_norm_error_lower=ids_real_invalid !Lower error for "shearing_rate_norm" + integer(ids_int) :: shearing_rate_norm_error_index=ids_int_invalid !Index in the error_description list for "shearing_rate_norm" + end type + + type :: ids_gyrokinetics_species + real(ids_real) :: charge_norm=ids_real_invalid !Normalised charge + real(ids_real) :: charge_norm_error_upper=ids_real_invalid !Upper error for "charge_norm" + real(ids_real) :: charge_norm_error_lower=ids_real_invalid !Lower error for "charge_norm" + integer(ids_int) :: charge_norm_error_index=ids_int_invalid !Index in the error_description list for "charge_norm" + real(ids_real) :: mass_norm=ids_real_invalid !Normalised mass + real(ids_real) :: mass_norm_error_upper=ids_real_invalid !Upper error for "mass_norm" + real(ids_real) :: mass_norm_error_lower=ids_real_invalid !Lower error for "mass_norm" + integer(ids_int) :: mass_norm_error_index=ids_int_invalid !Index in the error_description list for "mass_norm" + real(ids_real) :: density_norm=ids_real_invalid !Normalised density + real(ids_real) :: density_norm_error_upper=ids_real_invalid !Upper error for "density_norm" + real(ids_real) :: density_norm_error_lower=ids_real_invalid !Lower error for "density_norm" + integer(ids_int) :: density_norm_error_index=ids_int_invalid !Index in the error_description list for "density_norm" + real(ids_real) :: density_log_gradient_norm=ids_real_invalid !Normalised logarithmic gradient (with respect to r_minor_norm) of the density + real(ids_real) :: density_log_gradient_norm_error_upper=ids_real_invalid !Upper error for "density_log_gradient_norm" + real(ids_real) :: density_log_gradient_norm_error_lower=ids_real_invalid !Lower error for "density_log_gradient_norm" + integer(ids_int) :: density_log_gradient_norm_error_index=ids_int_invalid !Index in the error_description list for "density_log_gradient_norm" + real(ids_real) :: temperature_norm=ids_real_invalid !Normalised temperature + real(ids_real) :: temperature_norm_error_upper=ids_real_invalid !Upper error for "temperature_norm" + real(ids_real) :: temperature_norm_error_lower=ids_real_invalid !Lower error for "temperature_norm" + integer(ids_int) :: temperature_norm_error_index=ids_int_invalid !Index in the error_description list for "temperature_norm" + real(ids_real) :: temperature_log_gradient_norm=ids_real_invalid !Normalised logarithmic gradient (with respect to r_minor_norm) of the temperature + real(ids_real) :: temperature_log_gradient_norm_error_upper=ids_real_invalid !Upper error for "temperature_log_gradient_norm" + real(ids_real) :: temperature_log_gradient_norm_error_lower=ids_real_invalid !Lower error for "temperature_log_gradient_norm" + integer(ids_int) :: temperature_log_gradient_norm_error_index=ids_int_invalid !Index in the error_description list for "temperature_log_gradient_norm" + real(ids_real) :: velocity_tor_gradient_norm=ids_real_invalid !Normalised gradient (with respect to r_minor_norm) of the toroidal velocity + real(ids_real) :: velocity_tor_gradient_norm_error_upper=ids_real_invalid !Upper error for "velocity_tor_gradient_norm" + real(ids_real) :: velocity_tor_gradient_norm_error_lower=ids_real_invalid !Lower error for "velocity_tor_gradient_norm" + integer(ids_int) :: velocity_tor_gradient_norm_error_index=ids_int_invalid !Index in the error_description list for "velocity_tor_gradient_norm" + end type + + type :: ids_gyrokinetics_collisions + real(ids_real), pointer :: collisionality_norm(:,:) => null() !Normalised collisionality between two species + real(ids_real), pointer :: collisionality_norm_error_upper(:,:) => null() !Upper error for "collisionality_norm" + real(ids_real), pointer :: collisionality_norm_error_lower(:,:) => null() !Lower error for "collisionality_norm" + integer(ids_int) :: collisionality_norm_error_index=ids_int_invalid !Index in the error_description list for "collisionality_norm" + end type + + type :: ids_gyrokinetics_moments + complex(ids_real), pointer :: density(:,:) => null() !Normalised density + complex(ids_real), pointer :: density_error_upper(:,:) => null() !Upper error for "density" + complex(ids_real), pointer :: density_error_lower(:,:) => null() !Lower error for "density" + integer(ids_int) :: density_error_index=ids_int_invalid !Index in the error_description list for "density" + complex(ids_real), pointer :: density_gyroav(:,:) => null() !Normalised density (gyroaveraged) + complex(ids_real), pointer :: density_gyroav_error_upper(:,:) => null() !Upper error for "density_gyroav" + complex(ids_real), pointer :: density_gyroav_error_lower(:,:) => null() !Lower error for "density_gyroav" + integer(ids_int) :: density_gyroav_error_index=ids_int_invalid !Index in the error_description list for "density_gyroav" + complex(ids_real), pointer :: j_parallel(:,:) => null() !Normalised parallel current density + complex(ids_real), pointer :: j_parallel_error_upper(:,:) => null() !Upper error for "j_parallel" + complex(ids_real), pointer :: j_parallel_error_lower(:,:) => null() !Lower error for "j_parallel" + integer(ids_int) :: j_parallel_error_index=ids_int_invalid !Index in the error_description list for "j_parallel" + complex(ids_real), pointer :: j_parallel_gyroav(:,:) => null() !Normalised parallel current density (gyroaveraged) + complex(ids_real), pointer :: j_parallel_gyroav_error_upper(:,:) => null() !Upper error for "j_parallel_gyroav" + complex(ids_real), pointer :: j_parallel_gyroav_error_lower(:,:) => null() !Lower error for "j_parallel_gyroav" + integer(ids_int) :: j_parallel_gyroav_error_index=ids_int_invalid !Index in the error_description list for "j_parallel_gyroav" + complex(ids_real), pointer :: pressure_parallel(:,:) => null() !Normalised parallel temperature + complex(ids_real), pointer :: pressure_parallel_error_upper(:,:) => null() !Upper error for "pressure_parallel" + complex(ids_real), pointer :: pressure_parallel_error_lower(:,:) => null() !Lower error for "pressure_parallel" + integer(ids_int) :: pressure_parallel_error_index=ids_int_invalid !Index in the error_description list for "pressure_parallel" + complex(ids_real), pointer :: pressure_parallel_gyroav(:,:) => null() !Normalised parallel temperature (gyroaveraged) + complex(ids_real), pointer :: pressure_parallel_gyroav_error_upper(:,:) => null() !Upper error for "pressure_parallel_gyroav" + complex(ids_real), pointer :: pressure_parallel_gyroav_error_lower(:,:) => null() !Lower error for "pressure_parallel_gyroav" + integer(ids_int) :: pressure_parallel_gyroav_error_index=ids_int_invalid !Index in the error_description list for "pressure_parallel_gyroav" + complex(ids_real), pointer :: pressure_perpendicular(:,:) => null() !Normalised perpendicular temperature + complex(ids_real), pointer :: pressure_perpendicular_error_upper(:,:) => null() !Upper error for "pressure_perpendicular" + complex(ids_real), pointer :: pressure_perpendicular_error_lower(:,:) => null() !Lower error for "pressure_perpendicular" + integer(ids_int) :: pressure_perpendicular_error_index=ids_int_invalid !Index in the error_description list for "pressure_perpendicular" + complex(ids_real), pointer :: pressure_perpendicular_gyroav(:,:) => null() !Normalised perpendicular temperature (gyroaveraged) + complex(ids_real), pointer :: pressure_perpendicular_gyroav_error_upper(:,:) => null() !Upper error for "pressure_perpendicular_gyroav" + complex(ids_real), pointer :: pressure_perpendicular_gyroav_error_lower(:,:) => null() !Lower error for "pressure_perpendicular_gyroav" + integer(ids_int) :: pressure_perpendicular_gyroav_error_index=ids_int_invalid !Index in the error_description list for "pressure_perpendicular_gyroav" + complex(ids_real), pointer :: heat_flux_parallel(:,:) => null() !Normalised parallel heat flux (integral of 0.5 * m * v_par * v^2) + complex(ids_real), pointer :: heat_flux_parallel_error_upper(:,:) => null() !Upper error for "heat_flux_parallel" + complex(ids_real), pointer :: heat_flux_parallel_error_lower(:,:) => null() !Lower error for "heat_flux_parallel" + integer(ids_int) :: heat_flux_parallel_error_index=ids_int_invalid !Index in the error_description list for "heat_flux_parallel" + complex(ids_real), pointer :: heat_flux_parallel_gyroav(:,:) => null() !Normalised parallel heat flux (integral of 0.5 * m * v_par * v^2, gyroaveraged) + complex(ids_real), pointer :: heat_flux_parallel_gyroav_error_upper(:,:) => null() !Upper error for "heat_flux_parallel_gyroav" + complex(ids_real), pointer :: heat_flux_parallel_gyroav_error_lower(:,:) => null() !Lower error for "heat_flux_parallel_gyroav" + integer(ids_int) :: heat_flux_parallel_gyroav_error_index=ids_int_invalid !Index in the error_description list for "heat_flux_parallel_gyroav" + complex(ids_real), pointer :: v_parallel_energy_perpendicular(:,:) => null() !Normalised moment (integral over 0.5 * m * v_par * v_perp^2) + complex(ids_real), pointer :: v_parallel_energy_perpendicular_error_upper(:,:) => null() !Upper error for "v_parallel_energy_perpendicular" + complex(ids_real), pointer :: v_parallel_energy_perpendicular_error_lower(:,:) => null() !Lower error for "v_parallel_energy_perpendicular" + integer(ids_int) :: v_parallel_energy_perpendicular_error_index=ids_int_invalid !Index in the error_description list for "v_parallel_energy_perpendicular" + complex(ids_real), pointer :: v_parallel_energy_perpendicular_gyroav(:,:) => null() !Normalised moment (integral over 0.5 * m * v_par * v_perp^2, gyroaveraged) + complex(ids_real), pointer :: v_parallel_energy_perpendicular_gyroav_error_upper(:,:) => null() !Upper error for "v_parallel_energy_perpendicular_gyroav" + complex(ids_real), pointer :: v_parallel_energy_perpendicular_gyroav_error_lower(:,:) => null() !Lower error for "v_parallel_energy_perpendicular_gyroav" + integer(ids_int) :: v_parallel_energy_perpendicular_gyroav_error_index=ids_int_invalid !Index in the error_description list for "v_parallel_energy_perpendicular_gyroav" + complex(ids_real), pointer :: v_perpendicular_square_energy(:,:) => null() !Normalised moment (integral over 0.5 * m * v_perp^2 * v^2) + complex(ids_real), pointer :: v_perpendicular_square_energy_error_upper(:,:) => null() !Upper error for "v_perpendicular_square_energy" + complex(ids_real), pointer :: v_perpendicular_square_energy_error_lower(:,:) => null() !Lower error for "v_perpendicular_square_energy" + integer(ids_int) :: v_perpendicular_square_energy_error_index=ids_int_invalid !Index in the error_description list for "v_perpendicular_square_energy" + complex(ids_real), pointer :: v_perpendicular_square_energy_gyroav(:,:) => null() !Normalised moment (integral over 0.5 * m * v_perp^2 * v^2, gyroaveraged) + complex(ids_real), pointer :: v_perpendicular_square_energy_gyroav_error_upper(:,:) => null() !Upper error for "v_perpendicular_square_energy_gyroav" + complex(ids_real), pointer :: v_perpendicular_square_energy_gyroav_error_lower(:,:) => null() !Lower error for "v_perpendicular_square_energy_gyroav" + integer(ids_int) :: v_perpendicular_square_energy_gyroav_error_index=ids_int_invalid !Index in the error_description list for "v_perpendicular_square_energy_gyroav" + end type + + type :: ids_gyrokinetics_moments_particles + complex(ids_real), pointer :: density(:,:) => null() !Normalised density + complex(ids_real), pointer :: density_error_upper(:,:) => null() !Upper error for "density" + complex(ids_real), pointer :: density_error_lower(:,:) => null() !Lower error for "density" + integer(ids_int) :: density_error_index=ids_int_invalid !Index in the error_description list for "density" + complex(ids_real), pointer :: j_parallel(:,:) => null() !Normalised parallel current density + complex(ids_real), pointer :: j_parallel_error_upper(:,:) => null() !Upper error for "j_parallel" + complex(ids_real), pointer :: j_parallel_error_lower(:,:) => null() !Lower error for "j_parallel" + integer(ids_int) :: j_parallel_error_index=ids_int_invalid !Index in the error_description list for "j_parallel" + complex(ids_real), pointer :: pressure_parallel(:,:) => null() !Normalised parallel temperature + complex(ids_real), pointer :: pressure_parallel_error_upper(:,:) => null() !Upper error for "pressure_parallel" + complex(ids_real), pointer :: pressure_parallel_error_lower(:,:) => null() !Lower error for "pressure_parallel" + integer(ids_int) :: pressure_parallel_error_index=ids_int_invalid !Index in the error_description list for "pressure_parallel" + complex(ids_real), pointer :: pressure_perpendicular(:,:) => null() !Normalised perpendicular temperature + complex(ids_real), pointer :: pressure_perpendicular_error_upper(:,:) => null() !Upper error for "pressure_perpendicular" + complex(ids_real), pointer :: pressure_perpendicular_error_lower(:,:) => null() !Lower error for "pressure_perpendicular" + integer(ids_int) :: pressure_perpendicular_error_index=ids_int_invalid !Index in the error_description list for "pressure_perpendicular" + complex(ids_real), pointer :: heat_flux_parallel(:,:) => null() !Normalised parallel heat flux (integral of 0.5 * m * v_par * v^2) + complex(ids_real), pointer :: heat_flux_parallel_error_upper(:,:) => null() !Upper error for "heat_flux_parallel" + complex(ids_real), pointer :: heat_flux_parallel_error_lower(:,:) => null() !Lower error for "heat_flux_parallel" + integer(ids_int) :: heat_flux_parallel_error_index=ids_int_invalid !Index in the error_description list for "heat_flux_parallel" + complex(ids_real), pointer :: v_parallel_energy_perpendicular(:,:) => null() !Normalised moment (integral over 0.5 * m * v_par * v_perp^2) + complex(ids_real), pointer :: v_parallel_energy_perpendicular_error_upper(:,:) => null() !Upper error for "v_parallel_energy_perpendicular" + complex(ids_real), pointer :: v_parallel_energy_perpendicular_error_lower(:,:) => null() !Lower error for "v_parallel_energy_perpendicular" + integer(ids_int) :: v_parallel_energy_perpendicular_error_index=ids_int_invalid !Index in the error_description list for "v_parallel_energy_perpendicular" + complex(ids_real), pointer :: v_perpendicular_square_energy(:,:) => null() !Normalised moment (integral over 0.5 * m * v_perp^2 * v^2) + complex(ids_real), pointer :: v_perpendicular_square_energy_error_upper(:,:) => null() !Upper error for "v_perpendicular_square_energy" + complex(ids_real), pointer :: v_perpendicular_square_energy_error_lower(:,:) => null() !Lower error for "v_perpendicular_square_energy" + integer(ids_int) :: v_perpendicular_square_energy_error_index=ids_int_invalid !Index in the error_description list for "v_perpendicular_square_energy" + end type + + type :: ids_gyrokinetics_fluxes + real(ids_real) :: particles_phi_potential=ids_real_invalid !Contribution of the perturbed electrostatic potential to the normalised particle flux + real(ids_real) :: particles_phi_potential_error_upper=ids_real_invalid !Upper error for "particles_phi_potential" + real(ids_real) :: particles_phi_potential_error_lower=ids_real_invalid !Lower error for "particles_phi_potential" + integer(ids_int) :: particles_phi_potential_error_index=ids_int_invalid !Index in the error_description list for "particles_phi_potential" + real(ids_real) :: particles_a_field_parallel=ids_real_invalid !Contribution of the perturbed parallel electromagnetic potential to the normalised particle flux + real(ids_real) :: particles_a_field_parallel_error_upper=ids_real_invalid !Upper error for "particles_a_field_parallel" + real(ids_real) :: particles_a_field_parallel_error_lower=ids_real_invalid !Lower error for "particles_a_field_parallel" + integer(ids_int) :: particles_a_field_parallel_error_index=ids_int_invalid !Index in the error_description list for "particles_a_field_parallel" + real(ids_real) :: particles_b_field_parallel=ids_real_invalid !Contribution of the perturbed parallel magnetic field to the normalised particle flux + real(ids_real) :: particles_b_field_parallel_error_upper=ids_real_invalid !Upper error for "particles_b_field_parallel" + real(ids_real) :: particles_b_field_parallel_error_lower=ids_real_invalid !Lower error for "particles_b_field_parallel" + integer(ids_int) :: particles_b_field_parallel_error_index=ids_int_invalid !Index in the error_description list for "particles_b_field_parallel" + real(ids_real) :: energy_phi_potential=ids_real_invalid !Contribution of the perturbed electrostatic potential to the normalised energy flux + real(ids_real) :: energy_phi_potential_error_upper=ids_real_invalid !Upper error for "energy_phi_potential" + real(ids_real) :: energy_phi_potential_error_lower=ids_real_invalid !Lower error for "energy_phi_potential" + integer(ids_int) :: energy_phi_potential_error_index=ids_int_invalid !Index in the error_description list for "energy_phi_potential" + real(ids_real) :: energy_a_field_parallel=ids_real_invalid !Contribution of the perturbed parallel electromagnetic potential to the normalised energy flux + real(ids_real) :: energy_a_field_parallel_error_upper=ids_real_invalid !Upper error for "energy_a_field_parallel" + real(ids_real) :: energy_a_field_parallel_error_lower=ids_real_invalid !Lower error for "energy_a_field_parallel" + integer(ids_int) :: energy_a_field_parallel_error_index=ids_int_invalid !Index in the error_description list for "energy_a_field_parallel" + real(ids_real) :: energy_b_field_parallel=ids_real_invalid !Contribution of the perturbed parallel magnetic field to the normalised energy flux + real(ids_real) :: energy_b_field_parallel_error_upper=ids_real_invalid !Upper error for "energy_b_field_parallel" + real(ids_real) :: energy_b_field_parallel_error_lower=ids_real_invalid !Lower error for "energy_b_field_parallel" + integer(ids_int) :: energy_b_field_parallel_error_index=ids_int_invalid !Index in the error_description list for "energy_b_field_parallel" + real(ids_real) :: momentum_tor_parallel_phi_potential=ids_real_invalid !Contribution of the perturbed electrostatic potential to the parallel component of the normalised toroidal momentum flux + real(ids_real) :: momentum_tor_parallel_phi_potential_error_upper=ids_real_invalid !Upper error for "momentum_tor_parallel_phi_potential" + real(ids_real) :: momentum_tor_parallel_phi_potential_error_lower=ids_real_invalid !Lower error for "momentum_tor_parallel_phi_potential" + integer(ids_int) :: momentum_tor_parallel_phi_potential_error_index=ids_int_invalid !Index in the error_description list for "momentum_tor_parallel_phi_potential" + real(ids_real) :: momentum_tor_parallel_a_field_parallel=ids_real_invalid !Contribution of the perturbed parallel electromagnetic potential to the parallel component of the normalised toroidal momentum flu! + !x + real(ids_real) :: momentum_tor_parallel_a_field_parallel_error_upper=ids_real_invalid !Upper error for "momentum_tor_parallel_a_field_parallel" + real(ids_real) :: momentum_tor_parallel_a_field_parallel_error_lower=ids_real_invalid !Lower error for "momentum_tor_parallel_a_field_parallel" + integer(ids_int) :: momentum_tor_parallel_a_field_parallel_error_index=ids_int_invalid !Index in the error_description list for "momentum_tor_parallel_a_field_parallel" + real(ids_real) :: momentum_tor_parallel_b_field_parallel=ids_real_invalid !Contribution of the perturbed parallel magnetic field to the parallel component of the normalised toroidal momentum flux + real(ids_real) :: momentum_tor_parallel_b_field_parallel_error_upper=ids_real_invalid !Upper error for "momentum_tor_parallel_b_field_parallel" + real(ids_real) :: momentum_tor_parallel_b_field_parallel_error_lower=ids_real_invalid !Lower error for "momentum_tor_parallel_b_field_parallel" + integer(ids_int) :: momentum_tor_parallel_b_field_parallel_error_index=ids_int_invalid !Index in the error_description list for "momentum_tor_parallel_b_field_parallel" + real(ids_real) :: momentum_tor_perpendicular_phi_potential=ids_real_invalid !Contribution of the perturbed electrostatic potential to the perpendicular component of the normalised toroidal momentum flux + real(ids_real) :: momentum_tor_perpendicular_phi_potential_error_upper=ids_real_invalid !Upper error for "momentum_tor_perpendicular_phi_potential" + real(ids_real) :: momentum_tor_perpendicular_phi_potential_error_lower=ids_real_invalid !Lower error for "momentum_tor_perpendicular_phi_potential" + integer(ids_int) :: momentum_tor_perpendicular_phi_potential_error_index=ids_int_invalid !Index in the error_description list for "momentum_tor_perpendicular_phi_potential" + real(ids_real) :: momentum_tor_perpendicular_a_field_parallel=ids_real_invalid !Contribution of the perturbed parallel electromagnetic potential to the perpendicular component of the normalised toroidal momentu! + !m flux + real(ids_real) :: momentum_tor_perpendicular_a_field_parallel_error_upper=ids_real_invalid !Upper error for "momentum_tor_perpendicular_a_field_parallel" + real(ids_real) :: momentum_tor_perpendicular_a_field_parallel_error_lower=ids_real_invalid !Lower error for "momentum_tor_perpendicular_a_field_parallel" + integer(ids_int) :: momentum_tor_perpendicular_a_field_parallel_error_index=ids_int_invalid !Index in the error_description list for "momentum_tor_perpendicular_a_field_parallel" + real(ids_real) :: momentum_tor_perpendicular_b_field_parallel=ids_real_invalid !Contribution of the perturbed parallel magnetic field to the perpendicular component of the normalised toroidal momentum flux + real(ids_real) :: momentum_tor_perpendicular_b_field_parallel_error_upper=ids_real_invalid !Upper error for "momentum_tor_perpendicular_b_field_parallel" + real(ids_real) :: momentum_tor_perpendicular_b_field_parallel_error_lower=ids_real_invalid !Lower error for "momentum_tor_perpendicular_b_field_parallel" + integer(ids_int) :: momentum_tor_perpendicular_b_field_parallel_error_index=ids_int_invalid !Index in the error_description list for "momentum_tor_perpendicular_b_field_parallel" + end type + + type :: ids_gyrokinetics_fluxes_moments + type(ids_gyrokinetics_moments) :: moments_norm_gyrocenter !Moments (normalised) of the perturbed distribution function of gyrocenters + type(ids_gyrokinetics_moments_particles) :: moments_norm_particle !Moments (normalised) of the perturbed distribution function of particles + type(ids_gyrokinetics_fluxes) :: fluxes_norm_gyrocenter !Normalised gyrocenter fluxes in the laboratory frame + type(ids_gyrokinetics_fluxes) :: fluxes_norm_gyrocenter_rotating_frame !Normalised gyrocenter fluxes in the rotating frame + type(ids_gyrokinetics_fluxes) :: fluxes_norm_particle !Normalised particle fluxes in the laboratory frame + type(ids_gyrokinetics_fluxes) :: fluxes_norm_particle_rotating_frame !Normalised particle fluxes in the rotating frame + end type + + type :: ids_gyrokinetics_eigenmode + integer(ids_int) :: poloidal_turns=ids_int_invalid !Number of poloidal turns considered in the flux-tube simulation + real(ids_real) :: growth_rate_norm=ids_real_invalid !Growth rate + real(ids_real) :: growth_rate_norm_error_upper=ids_real_invalid !Upper error for "growth_rate_norm" + real(ids_real) :: growth_rate_norm_error_lower=ids_real_invalid !Lower error for "growth_rate_norm" + integer(ids_int) :: growth_rate_norm_error_index=ids_int_invalid !Index in the error_description list for "growth_rate_norm" + real(ids_real) :: frequency_norm=ids_real_invalid !Frequency + real(ids_real) :: frequency_norm_error_upper=ids_real_invalid !Upper error for "frequency_norm" + real(ids_real) :: frequency_norm_error_lower=ids_real_invalid !Lower error for "frequency_norm" + integer(ids_int) :: frequency_norm_error_index=ids_int_invalid !Index in the error_description list for "frequency_norm" + real(ids_real) :: growth_rate_tolerance=ids_real_invalid !Relative tolerance on the growth rate (convergence of the simulation) + real(ids_real) :: growth_rate_tolerance_error_upper=ids_real_invalid !Upper error for "growth_rate_tolerance" + real(ids_real) :: growth_rate_tolerance_error_lower=ids_real_invalid !Lower error for "growth_rate_tolerance" + integer(ids_int) :: growth_rate_tolerance_error_index=ids_int_invalid !Index in the error_description list for "growth_rate_tolerance" + real(ids_real), pointer :: phi_potential_perturbed_weight(:) => null() !Amplitude of the perturbed electrostatic potential normalised to the sum of amplitudes of all perturbed fields + real(ids_real), pointer :: phi_potential_perturbed_weight_error_upper(:) => null() !Upper error for "phi_potential_perturbed_weight" + real(ids_real), pointer :: phi_potential_perturbed_weight_error_lower(:) => null() !Lower error for "phi_potential_perturbed_weight" + integer(ids_int) :: phi_potential_perturbed_weight_error_index=ids_int_invalid !Index in the error_description list for "phi_potential_perturbed_weight" + real(ids_real), pointer :: phi_potential_perturbed_parity(:) => null() !Parity of the perturbed electrostatic potential with respect to theta = 0 (poloidal angle) + real(ids_real), pointer :: phi_potential_perturbed_parity_error_upper(:) => null() !Upper error for "phi_potential_perturbed_parity" + real(ids_real), pointer :: phi_potential_perturbed_parity_error_lower(:) => null() !Lower error for "phi_potential_perturbed_parity" + integer(ids_int) :: phi_potential_perturbed_parity_error_index=ids_int_invalid !Index in the error_description list for "phi_potential_perturbed_parity" + real(ids_real), pointer :: a_field_parallel_perturbed_weight(:) => null() !Amplitude of the perturbed parallel vector potential normalised to the sum of amplitudes of all perturbed fields + real(ids_real), pointer :: a_field_parallel_perturbed_weight_error_upper(:) => null() !Upper error for "a_field_parallel_perturbed_weight" + real(ids_real), pointer :: a_field_parallel_perturbed_weight_error_lower(:) => null() !Lower error for "a_field_parallel_perturbed_weight" + integer(ids_int) :: a_field_parallel_perturbed_weight_error_index=ids_int_invalid !Index in the error_description list for "a_field_parallel_perturbed_weight" + real(ids_real), pointer :: a_field_parallel_perturbed_parity(:) => null() !Parity of the perturbed parallel vector potential with respect to theta = 0 (poloidal angle) + real(ids_real), pointer :: a_field_parallel_perturbed_parity_error_upper(:) => null() !Upper error for "a_field_parallel_perturbed_parity" + real(ids_real), pointer :: a_field_parallel_perturbed_parity_error_lower(:) => null() !Lower error for "a_field_parallel_perturbed_parity" + integer(ids_int) :: a_field_parallel_perturbed_parity_error_index=ids_int_invalid !Index in the error_description list for "a_field_parallel_perturbed_parity" + real(ids_real), pointer :: b_field_parallel_perturbed_weight(:) => null() !Amplitude of the perturbed parallel magnetic field normalised to the sum of amplitudes of all perturbed fields + real(ids_real), pointer :: b_field_parallel_perturbed_weight_error_upper(:) => null() !Upper error for "b_field_parallel_perturbed_weight" + real(ids_real), pointer :: b_field_parallel_perturbed_weight_error_lower(:) => null() !Lower error for "b_field_parallel_perturbed_weight" + integer(ids_int) :: b_field_parallel_perturbed_weight_error_index=ids_int_invalid !Index in the error_description list for "b_field_parallel_perturbed_weight" + real(ids_real), pointer :: b_field_parallel_perturbed_parity(:) => null() !Parity of the perturbed parallel magnetic field with respect to theta = 0 (poloidal angle) + real(ids_real), pointer :: b_field_parallel_perturbed_parity_error_upper(:) => null() !Upper error for "b_field_parallel_perturbed_parity" + real(ids_real), pointer :: b_field_parallel_perturbed_parity_error_lower(:) => null() !Lower error for "b_field_parallel_perturbed_parity" + integer(ids_int) :: b_field_parallel_perturbed_parity_error_index=ids_int_invalid !Index in the error_description list for "b_field_parallel_perturbed_parity" + real(ids_real), pointer :: poloidal_angle(:) => null() !Poloidal angle grid (see detailed documentation at the root of the IDS) + real(ids_real), pointer :: poloidal_angle_error_upper(:) => null() !Upper error for "poloidal_angle" + real(ids_real), pointer :: poloidal_angle_error_lower(:) => null() !Lower error for "poloidal_angle" + integer(ids_int) :: poloidal_angle_error_index=ids_int_invalid !Index in the error_description list for "poloidal_angle" + complex(ids_real), pointer :: phi_potential_perturbed_norm(:,:) => null() !Normalised perturbed electrostatic potential + complex(ids_real), pointer :: phi_potential_perturbed_norm_error_upper(:,:) => null() !Upper error for "phi_potential_perturbed_norm" + complex(ids_real), pointer :: phi_potential_perturbed_norm_error_lower(:,:) => null() !Lower error for "phi_potential_perturbed_norm" + integer(ids_int) :: phi_potential_perturbed_norm_error_index=ids_int_invalid !Index in the error_description list for "phi_potential_perturbed_norm" + complex(ids_real), pointer :: a_field_parallel_perturbed_norm(:,:) => null() !Normalised perturbed parallel vector potential + complex(ids_real), pointer :: a_field_parallel_perturbed_norm_error_upper(:,:) => null() !Upper error for "a_field_parallel_perturbed_norm" + complex(ids_real), pointer :: a_field_parallel_perturbed_norm_error_lower(:,:) => null() !Lower error for "a_field_parallel_perturbed_norm" + integer(ids_int) :: a_field_parallel_perturbed_norm_error_index=ids_int_invalid !Index in the error_description list for "a_field_parallel_perturbed_norm" + complex(ids_real), pointer :: b_field_parallel_perturbed_norm(:,:) => null() !Normalised perturbed parallel magnetic field + complex(ids_real), pointer :: b_field_parallel_perturbed_norm_error_upper(:,:) => null() !Upper error for "b_field_parallel_perturbed_norm" + complex(ids_real), pointer :: b_field_parallel_perturbed_norm_error_lower(:,:) => null() !Lower error for "b_field_parallel_perturbed_norm" + integer(ids_int) :: b_field_parallel_perturbed_norm_error_index=ids_int_invalid !Index in the error_description list for "b_field_parallel_perturbed_norm" + real(ids_real), pointer :: time_norm(:) => null() !Normalised time of the gyrokinetic simulation + real(ids_real), pointer :: time_norm_error_upper(:) => null() !Upper error for "time_norm" + real(ids_real), pointer :: time_norm_error_lower(:) => null() !Lower error for "time_norm" + integer(ids_int) :: time_norm_error_index=ids_int_invalid !Index in the error_description list for "time_norm" + type(ids_gyrokinetics_fluxes_moments), pointer :: fluxes_moments(:) => null() !Fluxes and moments of the perturbed distribution function, for this eigenmode and for each species. The fluxes are time averaged f! + !or non-linear runs (using model/ time_interval_norm) and given at the last time step for linear runs. + type(ids_code_partial_constant) :: code !Code-specific parameters used for this eigenmode + integer(ids_int) :: initial_value_run=ids_int_invalid !Flag = 1 if this is an initial value run, 0 for an eigenvalue run + end type + + type :: ids_gyrokinetics_wavevector + real(ids_real) :: radial_component_norm=ids_real_invalid !Normalised radial component of the wavevector + real(ids_real) :: radial_component_norm_error_upper=ids_real_invalid !Upper error for "radial_component_norm" + real(ids_real) :: radial_component_norm_error_lower=ids_real_invalid !Lower error for "radial_component_norm" + integer(ids_int) :: radial_component_norm_error_index=ids_int_invalid !Index in the error_description list for "radial_component_norm" + real(ids_real) :: binormal_component_norm=ids_real_invalid !Normalised binormal component of the wavevector + real(ids_real) :: binormal_component_norm_error_upper=ids_real_invalid !Upper error for "binormal_component_norm" + real(ids_real) :: binormal_component_norm_error_lower=ids_real_invalid !Lower error for "binormal_component_norm" + integer(ids_int) :: binormal_component_norm_error_index=ids_int_invalid !Index in the error_description list for "binormal_component_norm" + type(ids_gyrokinetics_eigenmode), pointer :: eigenmode(:) => null() !Set of eigenmode for this wavector + end type + + + ! *********** gyrokinetics IDS + type, extends(IDS_base) :: ids_gyrokinetics !Description of a gyrokinetic simulation (delta-f, flux-tube). All quantities within this IDS are normalised (apart from time and f! + !rom the normalizing quantities structure), thus independent of rhostar, consistently with the local approximation and a spectral r! + !epresentation is assumed in the perpendicular plane (i.e. homogeneous turbulence). + logical, private :: c_data = .FALSE. ! Fortran specific metadata telling whether the IDS has been populated from C allocated data (LL) or not + integer, private :: max_occurrence = 1! Maximum occurrence allowed as defined in the DD + + type(ids_ids_properties) :: ids_properties !Interface Data Structure properties. This element identifies the node above as an IDS + type(ids_entry_tag), pointer :: tag(:) => null() !Set of tags to which this entry belongs + type(ids_gyrokinetics_input_normalizing) :: normalizing_quantities !Physical quantities used for normalization (useful to link to the original simulation/experience) + type(ids_gyrokinetics_flux_surface) :: flux_surface !Flux surface characteristics + type(ids_gyrokinetics_model) :: model !Assumptions of the GK calculations + type(ids_gyrokinetics_input_species_global) :: species_all !Physical quantities common to all species + type(ids_gyrokinetics_species), pointer :: species(:) => null() !Set of species (including electrons) used in the calculation and related quantities + type(ids_gyrokinetics_collisions) :: collisions !Collisions related quantities + type(ids_gyrokinetics_wavevector), pointer :: wavevector(:) => null() !Set of wavevectors + type(ids_gyrokinetics_fluxes), pointer :: fluxes_integrated_norm(:) => null() !Normalised fluxes of particles computed in the laboratory frame per species, summed over all wavevectors, and averaged over the ti! + !me interval specified in model/time_interval_norm (non-linear runs only) + type(ids_code) :: code !Generic decription of the code-specific parameters for the code that has produced this IDS + real(ids_real), pointer :: time(:) => null() !Generic time + end type + + ! *********** hard_x_rays IDS internal structures declaration + + type :: ids_hxr_channel + character(len=ids_string_length), dimension(:), pointer :: name => null() !Name of the channel + character(len=ids_string_length), dimension(:), pointer :: identifier => null() !ID of the channel + type(ids_detector_aperture) :: detector !Detector description + type(ids_detector_aperture), pointer :: aperture(:) => null() !Description of a set of collimating apertures + real(ids_real) :: etendue=ids_real_invalid !Etendue (geometric extent) of the channel's optical system + real(ids_real) :: etendue_error_upper=ids_real_invalid !Upper error for "etendue" + real(ids_real) :: etendue_error_lower=ids_real_invalid !Lower error for "etendue" + integer(ids_int) :: etendue_error_index=ids_int_invalid !Index in the error_description list for "etendue" + type(ids_identifier_static) :: etendue_method !Method used to calculate the etendue. Index = 0 : exact calculation with a 4D integral; 1 : approximation with first order formula! + ! (detector surface times solid angle subtended by the apertures); 2 : other methods + type(ids_line_of_sight_2points) :: line_of_sight !Description of the line of sight of the channel, given by 2 points + type(ids_filter_window), pointer :: filter_window(:) => null() !Set of filter windows + type(ids_detector_energy_band), pointer :: energy_band(:) => null() !Set of energy bands in which photons are counted by the detector + type(ids_signal_flt_2d_validity) :: radiance !Photons received by the detector per unit time, per unit solid angle and per unit area (i.e. photon flux divided by the etendue), ! + !in multiple energy bands if available from the detector + end type + + type :: ids_hxr_emissivity_profile + real(ids_real) :: lower_bound=ids_real_invalid !Lower bound of the energy band + real(ids_real) :: lower_bound_error_upper=ids_real_invalid !Upper error for "lower_bound" + real(ids_real) :: lower_bound_error_lower=ids_real_invalid !Lower error for "lower_bound" + integer(ids_int) :: lower_bound_error_index=ids_int_invalid !Index in the error_description list for "lower_bound" + real(ids_real) :: upper_bound=ids_real_invalid !Upper bound of the energy band + real(ids_real) :: upper_bound_error_upper=ids_real_invalid !Upper error for "upper_bound" + real(ids_real) :: upper_bound_error_lower=ids_real_invalid !Lower error for "upper_bound" + integer(ids_int) :: upper_bound_error_index=ids_int_invalid !Index in the error_description list for "upper_bound" + real(ids_real), pointer :: rho_tor_norm(:) => null() !Normalised toroidal flux coordinate grid + real(ids_real), pointer :: rho_tor_norm_error_upper(:) => null() !Upper error for "rho_tor_norm" + real(ids_real), pointer :: rho_tor_norm_error_lower(:) => null() !Lower error for "rho_tor_norm" + integer(ids_int) :: rho_tor_norm_error_index=ids_int_invalid !Index in the error_description list for "rho_tor_norm" + real(ids_real), pointer :: emissivity(:,:) => null() !Radial profile of the plasma emissivity in this energy band + real(ids_real), pointer :: emissivity_error_upper(:,:) => null() !Upper error for "emissivity" + real(ids_real), pointer :: emissivity_error_lower(:,:) => null() !Lower error for "emissivity" + integer(ids_int) :: emissivity_error_index=ids_int_invalid !Index in the error_description list for "emissivity" + real(ids_real), pointer :: peak_position(:) => null() !Normalised toroidal flux coordinate position at which the emissivity peaks + real(ids_real), pointer :: peak_position_error_upper(:) => null() !Upper error for "peak_position" + real(ids_real), pointer :: peak_position_error_lower(:) => null() !Lower error for "peak_position" + integer(ids_int) :: peak_position_error_index=ids_int_invalid !Index in the error_description list for "peak_position" + real(ids_real), pointer :: half_width_internal(:) => null() !Internal (towards magnetic axis) half width of the emissivity peak (in normalised toroidal flux) + real(ids_real), pointer :: half_width_internal_error_upper(:) => null() !Upper error for "half_width_internal" + real(ids_real), pointer :: half_width_internal_error_lower(:) => null() !Lower error for "half_width_internal" + integer(ids_int) :: half_width_internal_error_index=ids_int_invalid !Index in the error_description list for "half_width_internal" + real(ids_real), pointer :: half_width_external(:) => null() !External (towards separatrix) half width of the emissivity peak (in normalised toroidal flux) + real(ids_real), pointer :: half_width_external_error_upper(:) => null() !Upper error for "half_width_external" + real(ids_real), pointer :: half_width_external_error_lower(:) => null() !Lower error for "half_width_external" + integer(ids_int) :: half_width_external_error_index=ids_int_invalid !Index in the error_description list for "half_width_external" + integer(ids_int), pointer :: validity_timed(:) => null() !Indicator of the validity of the emissivity profile data for each time slice. 0: valid from automated processing, 1: valid and cer! + !tified by the diagnostic RO; - 1 means problem identified in the data processing (request verification by the diagnostic RO), -2: ! + !invalid data, should not be used (values lower than -2 have a code-specific meaning detailing the origin of their invalidity) + real(ids_real), pointer :: time(:) => null() !Time + end type + + + ! *********** hard_x_rays IDS + type, extends(IDS_base) :: ids_hard_x_rays !Hard X-rays tomography diagnostic + logical, private :: c_data = .FALSE. ! Fortran specific metadata telling whether the IDS has been populated from C allocated data (LL) or not + integer, private :: max_occurrence = 2! Maximum occurrence allowed as defined in the DD + + type(ids_ids_properties) :: ids_properties !Interface Data Structure properties. This element identifies the node above as an IDS + type(ids_hxr_channel), pointer :: channel(:) => null() !Set of channels (detector or pixel of a camera) + type(ids_hxr_emissivity_profile), pointer :: emissivity_profile_1d(:) => null() !Emissivity profile per energy band (assumed common to all channels used in the profile reconstruction) + real(ids_real) :: latency=ids_real_invalid !Upper bound of the delay between physical information received by the detector and data available on the real-time (RT) network. + real(ids_real) :: latency_error_upper=ids_real_invalid !Upper error for "latency" + real(ids_real) :: latency_error_lower=ids_real_invalid !Lower error for "latency" + integer(ids_int) :: latency_error_index=ids_int_invalid !Index in the error_description list for "latency" + type(ids_code) :: code !Generic decription of the code-specific parameters for the code that has produced this IDS + real(ids_real), pointer :: time(:) => null() !Generic time + end type + + ! *********** ic_antennas IDS internal structures declaration + + type :: ids_ic_antennas_measurement + character(len=ids_string_length), dimension(:), pointer :: name => null() !Name + character(len=ids_string_length), dimension(:), pointer :: identifier => null() !Identifier + type(ids_rzphi0d_static) :: position !Position of the measurement + type(ids_signal_flt_1d_units_level_2) :: amplitude !Amplitude of the measurement + type(ids_signal_flt_1d) :: phase !Phase of the measurement + end type + + type :: ids_ic_antennas_matching_element + character(len=ids_string_length), dimension(:), pointer :: name => null() !Name + type(ids_identifier_static) :: type !Type of the matching element. Index = 1 : capacitor (fill capacitance); Index = 2 : stub (fill phase) + type(ids_signal_flt_1d) :: capacitance !Capacitance of the macthing element + type(ids_signal_flt_1d) :: phase !Phase delay induced by the stub + end type + + type :: ids_ic_antennas_strap + type(ids_rzphi1d_static) :: outline !Strap outline + real(ids_real) :: width_tor=ids_real_invalid !Width of strap in the toroidal direction + real(ids_real) :: width_tor_error_upper=ids_real_invalid !Upper error for "width_tor" + real(ids_real) :: width_tor_error_lower=ids_real_invalid !Lower error for "width_tor" + integer(ids_int) :: width_tor_error_index=ids_int_invalid !Index in the error_description list for "width_tor" + real(ids_real) :: distance_to_conductor=ids_real_invalid !Distance to conducting wall or other conductor behind the antenna strap + real(ids_real) :: distance_to_conductor_error_upper=ids_real_invalid !Upper error for "distance_to_conductor" + real(ids_real) :: distance_to_conductor_error_lower=ids_real_invalid !Lower error for "distance_to_conductor" + integer(ids_int) :: distance_to_conductor_error_index=ids_int_invalid !Index in the error_description list for "distance_to_conductor" + type(ids_outline_2d_geometry_static) :: geometry !Cross-sectional shape of the strap + type(ids_signal_flt_1d) :: current !Root mean square current flowing along the strap + type(ids_signal_flt_1d) :: phase !Phase of the strap current + end type + + type :: ids_ic_antennas_antenna_module + character(len=ids_string_length), dimension(:), pointer :: name => null() !Name of the module + character(len=ids_string_length), dimension(:), pointer :: identifier => null() !Identifier of the module + type(ids_signal_flt_1d) :: frequency !Frequency + type(ids_signal_flt_1d) :: power_launched !Power launched from this module into the vacuum vessel + type(ids_signal_flt_1d) :: power_forward !Forward power arriving to the back of the module + type(ids_signal_flt_1d) :: power_reflected !Reflected power + type(ids_signal_flt_1d) :: reflection_coefficient !Power reflection coefficient + type(ids_signal_flt_1d) :: phase_forward !Phase of the forward power with respect to the first module + type(ids_signal_flt_1d) :: phase_reflected !Phase of the reflected power with respect to the forward power of this module + type(ids_ic_antennas_measurement), pointer :: voltage(:) => null() !Set of voltage measurements + type(ids_ic_antennas_measurement), pointer :: current(:) => null() !Set of current measurements + type(ids_ic_antennas_measurement), pointer :: pressure(:) => null() !Set of pressure measurements + type(ids_ic_antennas_matching_element), pointer :: matching_element(:) => null() !Set of matching elements + type(ids_ic_antennas_strap), pointer :: strap(:) => null() !Set of IC antenna straps + end type + + type :: ids_ic_antennas_surface_current + integer(ids_int), pointer :: m_pol(:) => null() !Poloidal mode numbers, used to describe the spectrum of the antenna current. The poloidal angle is defined from the reference poin! + !t; the angle at a point (R,Z) is given by atan((Z-Zref)/(R-Rref)), where Rref=reference_point/r and Zref=reference_point/z + integer(ids_int), pointer :: n_tor(:) => null() !Toroidal mode numbers, used to describe the spectrum of the antenna current + real(ids_real), pointer :: spectrum(:,:) => null() !Spectrum of the total surface current on the antenna strap and passive components expressed in poloidal and toroidal modes + real(ids_real), pointer :: spectrum_error_upper(:,:) => null() !Upper error for "spectrum" + real(ids_real), pointer :: spectrum_error_lower(:,:) => null() !Lower error for "spectrum" + integer(ids_int) :: spectrum_error_index=ids_int_invalid !Index in the error_description list for "spectrum" + real(ids_real) :: time=ids_real_invalid !Time + end type + + type :: ids_ic_antennas_antenna + character(len=ids_string_length), dimension(:), pointer :: name => null() !Name of the antenna (unique within the set of all antennas of the experiment) + character(len=ids_string_length), dimension(:), pointer :: identifier => null() !Identifier of the antenna (unique within the set of all antennas of the experiment) + type(ids_signal_flt_1d) :: frequency !Frequency (average over modules) + type(ids_signal_flt_1d) :: power_launched !Power launched from this antenna into the vacuum vessel + type(ids_signal_flt_1d) :: power_forward !Forward power arriving to the back of the antenna + type(ids_signal_flt_1d) :: power_reflected !Reflected power + type(ids_ic_antennas_antenna_module), pointer :: module(:) => null() !Set of antenna modules (each module is fed by a single transmission line) + type(ids_ic_antennas_surface_current), pointer :: surface_current(:) => null() !Description of the IC surface current on the antenna straps and on passive components, for every time slice + end type + + + ! *********** ic_antennas IDS + type, extends(IDS_base) :: ids_ic_antennas !Antenna systems for heating and current drive in the ion cyclotron (IC) frequencies. + logical, private :: c_data = .FALSE. ! Fortran specific metadata telling whether the IDS has been populated from C allocated data (LL) or not + integer, private :: max_occurrence = 2! Maximum occurrence allowed as defined in the DD + + type(ids_ids_properties) :: ids_properties !Interface Data Structure properties. This element identifies the node above as an IDS + type(ids_rz0d_constant) :: reference_point !Reference point used to define the poloidal angle, e.g. the geometrical centre of the vacuum vessel. Used to define the poloidal m! + !ode numbers under antenna/surface_current + type(ids_ic_antennas_antenna), pointer :: antenna(:) => null() !Set of Ion Cyclotron antennas + type(ids_signal_flt_1d) :: power_launched !Power launched into the vacuum vessel by the whole ICRH system (sum over antennas) + real(ids_real) :: latency=ids_real_invalid !Upper bound of the delay between input command received from the RT network and actuator starting to react. Applies globally to th! + !e system described by this IDS unless specific latencies (e.g. channel-specific or antenna-specific) are provided at a deeper leve! + !l in the IDS structure. + real(ids_real) :: latency_error_upper=ids_real_invalid !Upper error for "latency" + real(ids_real) :: latency_error_lower=ids_real_invalid !Lower error for "latency" + integer(ids_int) :: latency_error_index=ids_int_invalid !Index in the error_description list for "latency" + type(ids_code) :: code !Generic decription of the code-specific parameters for the code that has produced this IDS + real(ids_real), pointer :: time(:) => null() !Generic time + end type + + ! *********** interferometer IDS internal structures declaration + + type :: ids_interferometer_channel_wavelength_interf + real(ids_real) :: value=ids_real_invalid !Wavelength value + real(ids_real) :: value_error_upper=ids_real_invalid !Upper error for "value" + real(ids_real) :: value_error_lower=ids_real_invalid !Lower error for "value" + integer(ids_int) :: value_error_index=ids_int_invalid !Index in the error_description list for "value" + type(ids_signal_flt_1d) :: phase_corrected !Phase measured for this wavelength, corrected from fringe jumps + integer(ids_int), pointer :: fringe_jump_correction(:) => null() !Signed number of 2pi phase corrections applied to remove a fringe jump, for each time slice on which a correction has been made + real(ids_real), pointer :: fringe_jump_correction_times(:) => null() !List of time slices of the pulse on which a fringe jump correction has been made + real(ids_real), pointer :: fringe_jump_correction_times_error_upper(:) => null() !Upper error for "fringe_jump_correction_times" + real(ids_real), pointer :: fringe_jump_correction_times_error_lower(:) => null() !Lower error for "fringe_jump_correction_times" + integer(ids_int) :: fringe_jump_correction_times_error_index=ids_int_invalid !Index in the error_description list for "fringe_jump_correction_times" + real(ids_real) :: phase_to_n_e_line=ids_real_invalid !Conversion factor to be used to convert phase into line density for this wavelength + real(ids_real) :: phase_to_n_e_line_error_upper=ids_real_invalid !Upper error for "phase_to_n_e_line" + real(ids_real) :: phase_to_n_e_line_error_lower=ids_real_invalid !Lower error for "phase_to_n_e_line" + integer(ids_int) :: phase_to_n_e_line_error_index=ids_int_invalid !Index in the error_description list for "phase_to_n_e_line" + end type + + type :: ids_interferometer_channel + character(len=ids_string_length), dimension(:), pointer :: name => null() !Name of the channel + character(len=ids_string_length), dimension(:), pointer :: identifier => null() !ID of the channel + type(ids_line_of_sight_3points) :: line_of_sight !Description of the line of sight of the channel, defined by two points when the beam is not reflected, a third point is added to d! + !efine the reflected beam path + type(ids_interferometer_channel_wavelength_interf), pointer :: wavelength(:) => null() !Set of wavelengths used for interferometry + type(ids_signal_flt_1d) :: path_length_variation !Optical path length variation due to the plasma + type(ids_signal_flt_1d_validity) :: n_e_line !Line integrated density, possibly obtained by a combination of multiple interferometry wavelengths. Corresponds to the density int! + !egrated along the full line-of-sight (i.e. forward AND return for a reflected channel: NO dividing by 2 correction) + type(ids_signal_flt_1d_validity) :: n_e_line_average !Line average density, possibly obtained by a combination of multiple interferometry wavelengths. Corresponds to the density integr! + !ated along the full line-of-sight and then divided by the length of the line-of-sight + end type + + + ! *********** interferometer IDS + type, extends(IDS_base) :: ids_interferometer !Interferometer diagnostic + logical, private :: c_data = .FALSE. ! Fortran specific metadata telling whether the IDS has been populated from C allocated data (LL) or not + integer, private :: max_occurrence = 5! Maximum occurrence allowed as defined in the DD + + type(ids_ids_properties) :: ids_properties !Interface Data Structure properties. This element identifies the node above as an IDS + type(ids_interferometer_channel), pointer :: channel(:) => null() !Set of channels (lines-of-sight) + type(ids_signal_flt_1d_validity) :: n_e_volume_average !Volume average plasma density estimated from the line densities measured by the various channels + type(ids_signal_flt_1d_validity) :: electrons_n !Total number of electrons in the plasma, estimated from the line densities measured by the various channels + real(ids_real) :: latency=ids_real_invalid !Upper bound of the delay between physical information received by the detector and data available on the real-time (RT) network. + real(ids_real) :: latency_error_upper=ids_real_invalid !Upper error for "latency" + real(ids_real) :: latency_error_lower=ids_real_invalid !Lower error for "latency" + integer(ids_int) :: latency_error_index=ids_int_invalid !Index in the error_description list for "latency" + type(ids_code) :: code !Generic decription of the code-specific parameters for the code that has produced this IDS + real(ids_real), pointer :: time(:) => null() !Generic time + end type + + ! *********** iron_core IDS internal structures declaration + + type :: ids_iron_core_segment + character(len=ids_string_length), dimension(:), pointer :: name => null() !Name of the segment + character(len=ids_string_length), dimension(:), pointer :: identifier => null() !ID of the segment + real(ids_real), pointer :: b_field(:) => null() !Array of magnetic field values, for each of which the relative permeability is given + real(ids_real), pointer :: b_field_error_upper(:) => null() !Upper error for "b_field" + real(ids_real), pointer :: b_field_error_lower(:) => null() !Lower error for "b_field" + integer(ids_int) :: b_field_error_index=ids_int_invalid !Index in the error_description list for "b_field" + real(ids_real), pointer :: permeability_relative(:) => null() !Relative permeability of the iron segment + real(ids_real), pointer :: permeability_relative_error_upper(:) => null() !Upper error for "permeability_relative" + real(ids_real), pointer :: permeability_relative_error_lower(:) => null() !Lower error for "permeability_relative" + integer(ids_int) :: permeability_relative_error_index=ids_int_invalid !Index in the error_description list for "permeability_relative" + type(ids_outline_2d_geometry_static) :: geometry !Cross-sectional shape of the segment + type(ids_signal_flt_1d) :: magnetisation_r !Magnetisation M of the iron segment along the major radius axis, assumed to be constant inside a given iron segment. Reminder : H ! + != 1/mu0 * B - mur * M; + type(ids_signal_flt_1d) :: magnetisation_z !Magnetisation M of the iron segment along the vertical axis, assumed to be constant inside a given iron segment. Reminder : H = 1/! + !mu0 * B - mur * M; + end type + + + ! *********** iron_core IDS + type, extends(IDS_base) :: ids_iron_core !Iron core description + logical, private :: c_data = .FALSE. ! Fortran specific metadata telling whether the IDS has been populated from C allocated data (LL) or not + integer, private :: max_occurrence = 1! Maximum occurrence allowed as defined in the DD + + type(ids_ids_properties) :: ids_properties !Interface Data Structure properties. This element identifies the node above as an IDS + type(ids_iron_core_segment), pointer :: segment(:) => null() !The iron core is describred as a set of segments + type(ids_code) :: code !Generic decription of the code-specific parameters for the code that has produced this IDS + real(ids_real), pointer :: time(:) => null() !Generic time + end type + + ! *********** langmuir_probes IDS internal structures declaration + + type :: ids_langmuir_probes_multi_temperature + type(ids_physical_quantity_flt_1d_time_1) :: t_e !Electron temperature + type(ids_physical_quantity_flt_1d_time_1) :: t_i !Ion temperature + real(ids_real), pointer :: time(:) => null() !Timebase for the dynamic nodes of this probe located at this level of the IDS structure + end type + + type :: ids_langmuir_probes_embedded + character(len=ids_string_length), dimension(:), pointer :: name => null() !Name of the probe + character(len=ids_string_length), dimension(:), pointer :: identifier => null() !ID of the probe + type(ids_rzphi0d_static) :: position !Position of the measurements + real(ids_real) :: surface_area=ids_real_invalid !Area of the probe surface exposed to the plasma (use when assuming constant effective collection area) + real(ids_real) :: surface_area_error_upper=ids_real_invalid !Upper error for "surface_area" + real(ids_real) :: surface_area_error_lower=ids_real_invalid !Lower error for "surface_area" + integer(ids_int) :: surface_area_error_index=ids_int_invalid !Index in the error_description list for "surface_area" + type(ids_physical_quantity_flt_1d_time_1) :: surface_area_effective !Effective collection area of the probe surface, varying with time due to e.g. changes in the magnetic field line incidence angle + type(ids_physical_quantity_flt_1d_time_1) :: v_floating !Floating potential + type(ids_physical_quantity_flt_1d_time_1) :: v_floating_sigma !Standard deviation of the floating potential, corresponding to the fluctuations of the quantity over time + type(ids_physical_quantity_flt_1d_time_1) :: v_plasma !Plasma potential + type(ids_physical_quantity_flt_1d_time_1) :: t_e !Electron temperature + type(ids_physical_quantity_flt_1d_time_1) :: n_e !Electron density + type(ids_physical_quantity_flt_1d_time_1) :: t_i !Ion temperature + type(ids_physical_quantity_flt_1d_time_1) :: j_i_parallel !Ion parallel current density at the probe position + type(ids_physical_quantity_flt_1d_time_1) :: j_i_parallel_sigma !Standard deviation of ion parallel current density at the probe position + type(ids_physical_quantity_flt_1d_time_1) :: ion_saturation_current !Ion saturation current measured by the probe + type(ids_physical_quantity_flt_1d_time_1) :: j_i_saturation !Ion saturation current density + type(ids_physical_quantity_flt_1d_time_1) :: j_i_saturation_skew !Skew of the ion saturation current density + type(ids_physical_quantity_flt_1d_time_1) :: j_i_saturation_kurtosis !Pearson kurtosis of the ion saturation current density + type(ids_physical_quantity_flt_1d_time_1) :: j_i_saturation_sigma !Standard deviation of the ion saturation current density, corresponding to the fluctuations of the quantity over time + type(ids_physical_quantity_flt_1d_time_1) :: heat_flux_parallel !Parallel heat flux at the probe position + type(ids_physical_quantity_flt_1d_time_1) :: b_field_angle !Incident angle of the magnetic field with respect to PFC surface + type(ids_physical_quantity_flt_1d_time_1) :: distance_separatrix_midplane !Distance between the measurement position and the separatrix, mapped along flux surfaces to the outboard midplane, in the major ra! + !dius direction. Positive value means the measurement is outside of the separatrix. + type(ids_langmuir_probes_multi_temperature), pointer :: multi_temperature_fits(:) => null() !Set of temperatures describing the electron and ion distribution functions in case of multi-temperature fits + real(ids_real), pointer :: time(:) => null() !Timebase for the dynamic nodes of this probe located at this level of the IDS structure + end type + + type :: ids_langmuir_probes_position_reciprocating + real(ids_real), pointer :: r(:) => null() !Major radius + real(ids_real), pointer :: r_error_upper(:) => null() !Upper error for "r" + real(ids_real), pointer :: r_error_lower(:) => null() !Lower error for "r" + integer(ids_int) :: r_error_index=ids_int_invalid !Index in the error_description list for "r" + real(ids_real), pointer :: z(:) => null() !Height + real(ids_real), pointer :: z_error_upper(:) => null() !Upper error for "z" + real(ids_real), pointer :: z_error_lower(:) => null() !Lower error for "z" + integer(ids_int) :: z_error_index=ids_int_invalid !Index in the error_description list for "z" + real(ids_real), pointer :: phi(:) => null() !Toroidal angle + real(ids_real), pointer :: phi_error_upper(:) => null() !Upper error for "phi" + real(ids_real), pointer :: phi_error_lower(:) => null() !Lower error for "phi" + integer(ids_int) :: phi_error_index=ids_int_invalid !Index in the error_description list for "phi" + integer(ids_int), pointer :: validity_timed(:) => null() !Indicator of the validity of the position data for each time slice. 0: valid from automated processing, 1: valid and certified by ! + !the diagnostic RO; - 1 means problem identified in the data processing (request verification by the diagnostic RO), -2: invalid da! + !ta, should not be used (values lower than -2 have a code-specific meaning detailing the origin of their invalidity) + integer(ids_int) :: validity=ids_int_invalid !Indicator of the validity of the position data for the whole plunge. 0: valid from automated processing, 1: valid and certified by! + ! the diagnostic RO; - 1 means problem identified in the data processing (request verification by the diagnostic RO), -2: invalid d! + !ata, should not be used (values lower than -2 have a code-specific meaning detailing the origin of their invalidity) + end type + + type :: ids_langmuir_probes_plunge_physical_quantity_2 + real(ids_real), pointer :: data(:) => null() !Data + real(ids_real), pointer :: data_error_upper(:) => null() !Upper error for "data" + real(ids_real), pointer :: data_error_lower(:) => null() !Lower error for "data" + integer(ids_int) :: data_error_index=ids_int_invalid !Index in the error_description list for "data" + integer(ids_int), pointer :: validity_timed(:) => null() !Indicator of the validity of the data for each time slice. 0: valid from automated processing, 1: valid and certified by the diagn! + !ostic RO; - 1 means problem identified in the data processing (request verification by the diagnostic RO), -2: invalid data, shoul! + !d not be used (values lower than -2 have a code-specific meaning detailing the origin of their invalidity) + integer(ids_int) :: validity=ids_int_invalid !Indicator of the validity of the data for the whole plunge. 0: valid from automated processing, 1: valid and certified by the diag! + !nostic RO; - 1 means problem identified in the data processing (request verification by the diagnostic RO), -2: invalid data, shou! + !ld not be used (values lower than -2 have a code-specific meaning detailing the origin of their invalidity) + end type + + type :: ids_langmuir_probes_plunge_collector + type(ids_langmuir_probes_position_reciprocating) :: position !Position of the collector + type(ids_langmuir_probes_plunge_physical_quantity_2) :: v_floating !Floating potential + type(ids_langmuir_probes_plunge_physical_quantity_2) :: v_floating_sigma !Standard deviation of the floating potential, corresponding to the fluctuations of the quantity over time + type(ids_langmuir_probes_plunge_physical_quantity_2) :: t_e !Electron temperature + type(ids_langmuir_probes_plunge_physical_quantity_2) :: t_i !Ion temperature + type(ids_langmuir_probes_plunge_physical_quantity_2) :: j_i_parallel !Ion parallel current density at the probe position + type(ids_langmuir_probes_plunge_physical_quantity_2) :: ion_saturation_current !Ion saturation current measured by the probe + type(ids_langmuir_probes_plunge_physical_quantity_2) :: j_i_saturation !Ion saturation current density + type(ids_langmuir_probes_plunge_physical_quantity_2) :: j_i_skew !Skew of the ion saturation current density + type(ids_langmuir_probes_plunge_physical_quantity_2) :: j_i_kurtosis !Pearson kurtosis of the ion saturation current density + type(ids_langmuir_probes_plunge_physical_quantity_2) :: j_i_sigma !Standard deviation of the ion saturation current density, corresponding to the fluctuations of the quantity over time + type(ids_langmuir_probes_plunge_physical_quantity_2) :: heat_flux_parallel !Parallel heat flux at the probe position + end type + + type :: ids_langmuir_probes_plunge_physical_quantity + real(ids_real), pointer :: data(:) => null() !Data + real(ids_real), pointer :: data_error_upper(:) => null() !Upper error for "data" + real(ids_real), pointer :: data_error_lower(:) => null() !Lower error for "data" + integer(ids_int) :: data_error_index=ids_int_invalid !Index in the error_description list for "data" + integer(ids_int), pointer :: validity_timed(:) => null() !Indicator of the validity of the data for each time slice. 0: valid from automated processing, 1: valid and certified by the diagn! + !ostic RO; - 1 means problem identified in the data processing (request verification by the diagnostic RO), -2: invalid data, shoul! + !d not be used (values lower than -2 have a code-specific meaning detailing the origin of their invalidity) + integer(ids_int) :: validity=ids_int_invalid !Indicator of the validity of the data for the whole plunge. 0: valid from automated processing, 1: valid and certified by the diag! + !nostic RO; - 1 means problem identified in the data processing (request verification by the diagnostic RO), -2: invalid data, shou! + !ld not be used (values lower than -2 have a code-specific meaning detailing the origin of their invalidity) + end type + + type :: ids_langmuir_probes_plunge + type(ids_langmuir_probes_position_reciprocating) :: position_average !Average position of the measurements derived from multiple collectors + type(ids_langmuir_probes_plunge_collector), pointer :: collector(:) => null() !Set of probe collectors including measurements specific to each collector + type(ids_langmuir_probes_plunge_physical_quantity) :: v_plasma !Plasma potential + type(ids_langmuir_probes_plunge_physical_quantity) :: t_e_average !Electron temperature (upstream to downstream average) + type(ids_langmuir_probes_plunge_physical_quantity) :: t_i_average !Ion temperature (upstream to downstream average) + type(ids_langmuir_probes_plunge_physical_quantity) :: n_e !Electron density + type(ids_langmuir_probes_plunge_physical_quantity) :: b_field_angle !Incident angle of the magnetic field with respect to PFC surface + type(ids_langmuir_probes_plunge_physical_quantity) :: distance_separatrix_midplane !Distance between the measurement position and the separatrix, mapped along flux surfaces to the outboard midplane, in the major ra! + !dius direction. Positive value means the measurement is outside of the separatrix. + type(ids_langmuir_probes_plunge_physical_quantity) :: distance_x_point_z !Distance in the z direction of the measurement position to the closest X-point (Zmeasurement-Zx_point) + type(ids_langmuir_probes_plunge_physical_quantity) :: mach_number_parallel !Parallel Mach number + real(ids_real), pointer :: time_within_plunge(:) => null() !Time vector for describing the dynamics within the plunge + real(ids_real), pointer :: time_within_plunge_error_upper(:) => null() !Upper error for "time_within_plunge" + real(ids_real), pointer :: time_within_plunge_error_lower(:) => null() !Lower error for "time_within_plunge" + integer(ids_int) :: time_within_plunge_error_index=ids_int_invalid !Index in the error_description list for "time_within_plunge" + real(ids_real) :: time=ids_real_invalid !Time of maximum penetration of the probe during a given plunge + end type + + type :: ids_langmuir_probes_reciprocating + character(len=ids_string_length), dimension(:), pointer :: name => null() !Name of the probe + character(len=ids_string_length), dimension(:), pointer :: identifier => null() !ID of the probe + real(ids_real), pointer :: surface_area(:) => null() !Area of the surface exposed to the plasma of each collector (constant assuming negligible dependence on e.g. the magnetic field li! + !ne angle) + real(ids_real), pointer :: surface_area_error_upper(:) => null() !Upper error for "surface_area" + real(ids_real), pointer :: surface_area_error_lower(:) => null() !Lower error for "surface_area" + integer(ids_int) :: surface_area_error_index=ids_int_invalid !Index in the error_description list for "surface_area" + type(ids_langmuir_probes_plunge), pointer :: plunge(:) => null() !Set of plunges of this probe during the pulse, each plunge being recorded as a time slice from the Access Layer point of view. The! + ! time child node corresponds to the time of maximum penetration of the probe during a given plunge. The dynamics of physicas quant! + !ities within the plunge are described via the time_within_plunge vector. + end type + + + ! *********** langmuir_probes IDS + type, extends(IDS_base) :: ids_langmuir_probes !Langmuir probes + logical, private :: c_data = .FALSE. ! Fortran specific metadata telling whether the IDS has been populated from C allocated data (LL) or not + integer, private :: max_occurrence = 3! Maximum occurrence allowed as defined in the DD + + type(ids_ids_properties) :: ids_properties !Interface Data Structure properties. This element identifies the node above as an IDS + type(ids_ids_identification) :: equilibrium_id !ID of the IDS equilibrium used to map measurements - we may decide that this is superseeded when the systematic documentation of i! + !nput provenance is adopted + type(ids_identifier_static) :: midplane !Choice of midplane definition for the mapping of measurements on an equilibrium (use the lowest index number if more than one valu! + !e is relevant) + type(ids_langmuir_probes_embedded), pointer :: embedded(:) => null() !Set of embedded (in a plasma facing component) probes + type(ids_langmuir_probes_reciprocating), pointer :: reciprocating(:) => null() !Set of reciprocating probes + real(ids_real) :: latency=ids_real_invalid !Upper bound of the delay between physical information received by the detector and data available on the real-time (RT) network. + real(ids_real) :: latency_error_upper=ids_real_invalid !Upper error for "latency" + real(ids_real) :: latency_error_lower=ids_real_invalid !Lower error for "latency" + integer(ids_int) :: latency_error_index=ids_int_invalid !Index in the error_description list for "latency" + type(ids_code) :: code !Generic decription of the code-specific parameters for the code that has produced this IDS + real(ids_real), pointer :: time(:) => null() !Generic time + end type + + ! *********** lh_antennas IDS internal structures declaration + + type :: ids_lh_antennas_antenna_module + character(len=ids_string_length), dimension(:), pointer :: name => null() !Name of the module + character(len=ids_string_length), dimension(:), pointer :: identifier => null() !Identifier of the module + type(ids_signal_flt_1d) :: power_launched !Power launched from this module into the vacuum vessel + type(ids_signal_flt_1d) :: power_forward !Forward power arriving to the back of the module + type(ids_signal_flt_1d) :: power_reflected !Reflected power + type(ids_signal_flt_1d) :: reflection_coefficient !Power reflection coefficient + type(ids_signal_flt_1d) :: phase !Phase of the forward power arriving at the back of this module + end type + + type :: ids_lh_antennas_antenna_row + character(len=ids_string_length), dimension(:), pointer :: name => null() !Name of the row + type(ids_rzphi1d_dynamic_aos1_common_time) :: position !Position of the middle on the row + real(ids_real), pointer :: n_tor(:) => null() !Refraction index in the toroidal direction + real(ids_real), pointer :: n_tor_error_upper(:) => null() !Upper error for "n_tor" + real(ids_real), pointer :: n_tor_error_lower(:) => null() !Lower error for "n_tor" + integer(ids_int) :: n_tor_error_index=ids_int_invalid !Index in the error_description list for "n_tor" + real(ids_real), pointer :: n_pol(:) => null() !Refraction index in the poloidal direction. The poloidal angle is defined from the reference point; the angle at a point (R,Z) is ! + !given by atan((Z-Zref)/(R-Rref)), where Rref=reference_point/r and Zref=reference_point/z + real(ids_real), pointer :: n_pol_error_upper(:) => null() !Upper error for "n_pol" + real(ids_real), pointer :: n_pol_error_lower(:) => null() !Lower error for "n_pol" + integer(ids_int) :: n_pol_error_index=ids_int_invalid !Index in the error_description list for "n_pol" + real(ids_real), pointer :: power_density_spectrum_1d(:,:) => null() !1D power density spectrum dP/dn_tor, as a function of time + real(ids_real), pointer :: power_density_spectrum_1d_error_upper(:,:) => null() !Upper error for "power_density_spectrum_1d" + real(ids_real), pointer :: power_density_spectrum_1d_error_lower(:,:) => null() !Lower error for "power_density_spectrum_1d" + integer(ids_int) :: power_density_spectrum_1d_error_index=ids_int_invalid !Index in the error_description list for "power_density_spectrum_1d" + real(ids_real), pointer :: power_density_spectrum_2d(:,:,:) => null() !2D power density spectrum d2P/(dn_tor.dn_pol), as a function of time + real(ids_real), pointer :: power_density_spectrum_2d_error_upper(:,:,:) => null() !Upper error for "power_density_spectrum_2d" + real(ids_real), pointer :: power_density_spectrum_2d_error_lower(:,:,:) => null() !Lower error for "power_density_spectrum_2d" + integer(ids_int) :: power_density_spectrum_2d_error_index=ids_int_invalid !Index in the error_description list for "power_density_spectrum_2d" + real(ids_real), pointer :: time(:) => null() !Timebase for the dynamic nodes of this probe located at this level of the IDS structure + end type + + type :: ids_lh_antennas_antenna + character(len=ids_string_length), dimension(:), pointer :: name => null() !Name of the antenna (unique within the set of all antennas of the experiment) + character(len=ids_string_length), dimension(:), pointer :: identifier => null() !Identifier of the antenna (unique within the set of all antennas of the experiment) + character(len=ids_string_length), dimension(:), pointer :: model_name => null() !Name of the antenna model used for antenna spectrum computation + real(ids_real) :: frequency=ids_real_invalid !Frequency + real(ids_real) :: frequency_error_upper=ids_real_invalid !Upper error for "frequency" + real(ids_real) :: frequency_error_lower=ids_real_invalid !Lower error for "frequency" + integer(ids_int) :: frequency_error_index=ids_int_invalid !Index in the error_description list for "frequency" + type(ids_signal_flt_1d) :: power_launched !Power launched from this antenna into the vacuum vessel + type(ids_signal_flt_1d) :: power_forward !Forward power arriving at the back of the antenna + type(ids_signal_flt_1d) :: power_reflected !Reflected power + type(ids_signal_flt_1d) :: reflection_coefficient !Power reflection coefficient, averaged over modules + type(ids_signal_flt_1d) :: phase_average !Phase difference between two neighbouring modules (average over modules), at the mouth (front) of the antenna + type(ids_signal_flt_1d) :: n_parallel_peak !Peak parallel refractive index of the launched wave spectrum (simple estimate based on the measured phase difference) + type(ids_rzphi1d_dynamic_aos1_definition) :: position !Position of a reference point on the antenna (allowing also tracking the possible movements of the antenna) + type(ids_signal_flt_1d) :: pressure_tank !Pressure in the vacuum tank of the antenna + real(ids_real), pointer :: distance_to_antenna(:) => null() !Radial distance to the antenna mouth (grid for the electron density profile). 0 at antenna mouth, increasing towards the plasma + real(ids_real), pointer :: distance_to_antenna_error_upper(:) => null() !Upper error for "distance_to_antenna" + real(ids_real), pointer :: distance_to_antenna_error_lower(:) => null() !Lower error for "distance_to_antenna" + integer(ids_int) :: distance_to_antenna_error_index=ids_int_invalid !Index in the error_description list for "distance_to_antenna" + type(ids_signal_flt_2d) :: n_e !Electron density profile in front of the antenna + type(ids_lh_antennas_antenna_module), pointer :: module(:) => null() !Set of antenna modules + type(ids_lh_antennas_antenna_row), pointer :: row(:) => null() !Set of horizontal rows of waveguides (corresponding to different poloidal positions). A power spectrum is provided for each row. + end type + + + ! *********** lh_antennas IDS + type, extends(IDS_base) :: ids_lh_antennas !Antenna systems for heating and current drive in the Lower Hybrid (LH) frequencies. In the definitions below, the front (or mouth)! + ! of the antenna refers to the plasma facing side of the antenna, while the back refers to the waveguides connected side of the ant! + !enna (towards the RF generators). + logical, private :: c_data = .FALSE. ! Fortran specific metadata telling whether the IDS has been populated from C allocated data (LL) or not + integer, private :: max_occurrence = 2! Maximum occurrence allowed as defined in the DD + + type(ids_ids_properties) :: ids_properties !Interface Data Structure properties. This element identifies the node above as an IDS + type(ids_rz0d_constant) :: reference_point !Reference point used to define the poloidal angle, e.g. the geometrical centre of the vacuum vessel. Used to define the poloidal r! + !efraction index under antenna/row + type(ids_lh_antennas_antenna), pointer :: antenna(:) => null() !Set of Lower Hybrid antennas + type(ids_signal_flt_1d) :: power !Power coupled to the plasma by the whole LH system (sum over antennas) + type(ids_signal_flt_1d) :: power_launched !Power launched into the vacuum vessel by the whole LH system (sum over antennas) + real(ids_real) :: latency=ids_real_invalid !Upper bound of the delay between input command received from the RT network and actuator starting to react. Applies globally to th! + !e system described by this IDS unless specific latencies (e.g. channel-specific or antenna-specific) are provided at a deeper leve! + !l in the IDS structure. + real(ids_real) :: latency_error_upper=ids_real_invalid !Upper error for "latency" + real(ids_real) :: latency_error_lower=ids_real_invalid !Lower error for "latency" + integer(ids_int) :: latency_error_index=ids_int_invalid !Index in the error_description list for "latency" + type(ids_code) :: code !Generic decription of the code-specific parameters for the code that has produced this IDS + real(ids_real), pointer :: time(:) => null() !Generic time + end type + + ! *********** magnetics IDS internal structures declaration + + type :: ids_magnetics_flux_loop + character(len=ids_string_length), dimension(:), pointer :: name => null() !Name of the flux loop + character(len=ids_string_length), dimension(:), pointer :: identifier => null() !ID of the flux loop + type(ids_identifier_static) :: type !Flux loop type + type(ids_rzphi0d_static), pointer :: position(:) => null() !List of (R,Z,phi) points defining the position of the loop (see data structure documentation FLUXLOOPposition.pdf) + integer(ids_int), pointer :: indices_differential(:) => null() !Indices (from the flux_loop array of structure) of the two flux loops used to build the flux difference flux(second index) - flux(! + !first index). Use only if ../type/index = 6, leave empty otherwise + real(ids_real) :: area=ids_real_invalid !Effective area (ratio between flux and average magnetic field over the loop) + real(ids_real) :: area_error_upper=ids_real_invalid !Upper error for "area" + real(ids_real) :: area_error_lower=ids_real_invalid !Lower error for "area" + integer(ids_int) :: area_error_index=ids_int_invalid !Index in the error_description list for "area" + real(ids_real) :: gm9=ids_real_invalid !Integral of 1/R over the loop area (ratio between flux and magnetic rigidity R0.B0). Use only if ../type/index = 3 to 6, leave emp! + !ty otherwise. + real(ids_real) :: gm9_error_upper=ids_real_invalid !Upper error for "gm9" + real(ids_real) :: gm9_error_lower=ids_real_invalid !Lower error for "gm9" + integer(ids_int) :: gm9_error_index=ids_int_invalid !Index in the error_description list for "gm9" + type(ids_signal_flt_1d_validity) :: flux !Measured magnetic flux over loop in which Z component of normal to loop is directed downwards (negative grad Z direction) + type(ids_signal_flt_1d_validity) :: voltage !Measured voltage between the loop terminals + end type + + type :: ids_magnetics_bpol_probe_non_linear + real(ids_real), pointer :: b_field_linear(:) => null() !Array of magnetic field values (corresponding to the assumption of a linear relation between magnetic field and probe coil current! + !), for each of which the probe non-linear response is given in ../b_field_non_linear + real(ids_real), pointer :: b_field_linear_error_upper(:) => null() !Upper error for "b_field_linear" + real(ids_real), pointer :: b_field_linear_error_lower(:) => null() !Lower error for "b_field_linear" + integer(ids_int) :: b_field_linear_error_index=ids_int_invalid !Index in the error_description list for "b_field_linear" + real(ids_real), pointer :: b_field_non_linear(:) => null() !Magnetic field value taking into account the non-linear response of the probe + real(ids_real), pointer :: b_field_non_linear_error_upper(:) => null() !Upper error for "b_field_non_linear" + real(ids_real), pointer :: b_field_non_linear_error_lower(:) => null() !Lower error for "b_field_non_linear" + integer(ids_int) :: b_field_non_linear_error_index=ids_int_invalid !Index in the error_description list for "b_field_non_linear" + end type + + type :: ids_magnetics_bpol_probe + character(len=ids_string_length), dimension(:), pointer :: name => null() !Name of the probe + character(len=ids_string_length), dimension(:), pointer :: identifier => null() !ID of the probe + type(ids_identifier_static) :: type !Probe type + type(ids_rzphi0d_static) :: position !R, Z, Phi position of the coil centre + real(ids_real) :: poloidal_angle=ids_real_invalid !Angle of the sensor normal vector (vector parallel to the the axis of the coil, n on the diagram) with respect to horizontal plane! + ! (clockwise theta-like angle). Zero if sensor normal vector fully in the horizontal plane and oriented towards increasing major ra! + !dius. Values in [0 , 2Pi] + real(ids_real) :: poloidal_angle_error_upper=ids_real_invalid !Upper error for "poloidal_angle" + real(ids_real) :: poloidal_angle_error_lower=ids_real_invalid !Lower error for "poloidal_angle" + integer(ids_int) :: poloidal_angle_error_index=ids_int_invalid !Index in the error_description list for "poloidal_angle" + real(ids_real) :: toroidal_angle=ids_real_invalid !Angle of the projection of the sensor normal vector (n) in the horizontal plane with the increasing R direction (i.e. grad(R)) (an! + !gle is counter-clockwise from above as in cocos=11 phi-like angle). Values should be taken modulo pi with values within (-pi/2,pi/! + !2]. Zero if projected sensor normal is parallel to grad(R), pi/2 if it is parallel to grad(phi). + real(ids_real) :: toroidal_angle_error_upper=ids_real_invalid !Upper error for "toroidal_angle" + real(ids_real) :: toroidal_angle_error_lower=ids_real_invalid !Lower error for "toroidal_angle" + integer(ids_int) :: toroidal_angle_error_index=ids_int_invalid !Index in the error_description list for "toroidal_angle" + integer(ids_int), pointer :: indices_differential(:) => null() !Indices (from the bpol_probe array of structure) of the two probes used to build the field difference field(second index) - field(! + !first index). Use only if ../type/index = 6, leave empty otherwise + real(ids_real), pointer :: bandwidth_3db(:) => null() !3dB bandwith (first index : lower frequency bound, second index : upper frequency bound) + real(ids_real), pointer :: bandwidth_3db_error_upper(:) => null() !Upper error for "bandwidth_3db" + real(ids_real), pointer :: bandwidth_3db_error_lower(:) => null() !Lower error for "bandwidth_3db" + integer(ids_int) :: bandwidth_3db_error_index=ids_int_invalid !Index in the error_description list for "bandwidth_3db" + real(ids_real) :: area=ids_real_invalid !Area of each turn of the sensor; becomes effective area when multiplied by the turns + real(ids_real) :: area_error_upper=ids_real_invalid !Upper error for "area" + real(ids_real) :: area_error_lower=ids_real_invalid !Lower error for "area" + integer(ids_int) :: area_error_index=ids_int_invalid !Index in the error_description list for "area" + real(ids_real) :: length=ids_real_invalid !Length of the sensor along it's normal vector (n) + real(ids_real) :: length_error_upper=ids_real_invalid !Upper error for "length" + real(ids_real) :: length_error_lower=ids_real_invalid !Lower error for "length" + integer(ids_int) :: length_error_index=ids_int_invalid !Index in the error_description list for "length" + integer(ids_int) :: turns=ids_int_invalid !Turns in the coil, including sign + type(ids_signal_flt_1d_validity) :: field !Magnetic field component in direction of sensor normal axis (n) averaged over sensor volume defined by area and length, where n = ! + !cos(poloidal_angle)*cos(toroidal_angle)*grad(R) - sin(poloidal_angle)*grad(Z) + cos(poloidal_angle)*sin(toroidal_angle)*grad(Phi)/! + !norm(grad(Phi)) + type(ids_signal_flt_1d_validity) :: voltage !Voltage on the coil terminals + type(ids_magnetics_bpol_probe_non_linear) :: non_linear_response !Non-linear response of the probe (typically in case of a Hall probe) + end type + + type :: ids_magnetics_rogowski + character(len=ids_string_length), dimension(:), pointer :: name => null() !Name of the coil + character(len=ids_string_length), dimension(:), pointer :: identifier => null() !ID of the coil + type(ids_identifier_static) :: measured_quantity !Quantity measured by the sensor + type(ids_rzphi0d_static), pointer :: position(:) => null() !List of (R,Z,phi) points defining the position of the coil guiding centre + integer(ids_int), pointer :: indices_compound(:) => null() !Indices (from the rogowski_coil array of structure) of the partial Rogoswkis used to build the coumpound signal (sum of the partia! + !l Rogoswki signals) Use only if ../measure_quantity/index = 5, leave empty otherwise + real(ids_real) :: area=ids_real_invalid !Effective area of the loop wrapped around the guiding centre. In case of multiple layers, sum of the areas of each layer + real(ids_real) :: area_error_upper=ids_real_invalid !Upper error for "area" + real(ids_real) :: area_error_lower=ids_real_invalid !Lower error for "area" + integer(ids_int) :: area_error_index=ids_int_invalid !Index in the error_description list for "area" + real(ids_real) :: turns_per_metre=ids_real_invalid !Number of turns per unit length. In case of multiple layers, turns are counted for a single layer + real(ids_real) :: turns_per_metre_error_upper=ids_real_invalid !Upper error for "turns_per_metre" + real(ids_real) :: turns_per_metre_error_lower=ids_real_invalid !Lower error for "turns_per_metre" + integer(ids_int) :: turns_per_metre_error_index=ids_int_invalid !Index in the error_description list for "turns_per_metre" + type(ids_signal_flt_1d_validity) :: current !Measured current inside the Rogowski coil contour. The normal direction to the Rogowski coil is defined by the order of points in ! + !the list of guiding centre positions. The current is positive when oriented in the same direction as the normal. + end type + + type :: ids_magnetics_shunt + character(len=ids_string_length), dimension(:), pointer :: name => null() !Name of the shunt + character(len=ids_string_length), dimension(:), pointer :: identifier => null() !Alphanumeric identifier of the shunt + type(ids_line_of_sight_2points_rz) :: position !Position of shunt terminals + real(ids_real) :: resistance=ids_real_invalid !Shunt resistance + real(ids_real) :: resistance_error_upper=ids_real_invalid !Upper error for "resistance" + real(ids_real) :: resistance_error_lower=ids_real_invalid !Lower error for "resistance" + integer(ids_int) :: resistance_error_index=ids_int_invalid !Index in the error_description list for "resistance" + type(ids_signal_flt_1d_validity) :: voltage !Voltage on the shunt terminals (Vfirst_point-Vsecond_point) + integer(ids_int) :: divertor_index=ids_int_invalid !If the shunt is located on a given divertor, index of that divertor in the divertors IDS + integer(ids_int) :: target_index=ids_int_invalid !If the shunt is located on a divertor target, index of that target in the divertors IDS + integer(ids_int) :: tile_index=ids_int_invalid !If the shunt is located on a divertor tile, index of that tile in the divertors IDS + end type + + type :: ids_magnetics_method + character(len=ids_string_length), dimension(:), pointer :: name => null() !Name of the data processing method + type(ids_signal_flt_1d) :: ip !Plasma current. Positive sign means anti-clockwise when viewed from above. + end type + + type :: ids_magnetics_method_distinct + character(len=ids_string_length), dimension(:), pointer :: method_name => null() !Name of the calculation method + real(ids_real), pointer :: data(:) => null() !Data + real(ids_real), pointer :: data_error_upper(:) => null() !Upper error for "data" + real(ids_real), pointer :: data_error_lower(:) => null() !Lower error for "data" + integer(ids_int) :: data_error_index=ids_int_invalid !Index in the error_description list for "data" + real(ids_real), pointer :: time(:) => null() !Time + end type + + + ! *********** magnetics IDS + type, extends(IDS_base) :: ids_magnetics !Magnetic diagnostics for equilibrium identification and plasma shape control. + logical, private :: c_data = .FALSE. ! Fortran specific metadata telling whether the IDS has been populated from C allocated data (LL) or not + integer, private :: max_occurrence = 3! Maximum occurrence allowed as defined in the DD + + type(ids_ids_properties) :: ids_properties !Interface Data Structure properties. This element identifies the node above as an IDS + type(ids_magnetics_flux_loop), pointer :: flux_loop(:) => null() !Flux loops; partial flux loops can be described + type(ids_magnetics_bpol_probe), pointer :: bpol_probe(:) => null() !Poloidal field probes + type(ids_magnetics_bpol_probe), pointer :: b_field_pol_probe(:) => null() !Poloidal field probes + type(ids_magnetics_bpol_probe), pointer :: b_field_tor_probe(:) => null() !Toroidal field probes + type(ids_magnetics_rogowski), pointer :: rogowski_coil(:) => null() !Set of Rogowski coils + type(ids_magnetics_shunt), pointer :: shunt(:) => null() !Set of shunt resistances through which currents in the divertor structure are measured. Shunts are modelled as piecewise straight ! + !line segments in the poloidal plane. + type(ids_magnetics_method), pointer :: method(:) => null() !A method generating processed quantities derived from the magnetic measurements + type(ids_magnetics_method_distinct), pointer :: ip(:) => null() !Plasma current. Positive sign means anti-clockwise when viewed from above. The array of structure corresponds to a set of calculat! + !ion methods (starting with the generally recommended method). + type(ids_magnetics_method_distinct), pointer :: diamagnetic_flux(:) => null() !Diamagnetic flux. The array of structure corresponds to a set of calculation methods (starting with the generally recommended meth! + !od). + real(ids_real) :: latency=ids_real_invalid !Upper bound of the delay between physical information received by the detector and data available on the real-time (RT) network. + real(ids_real) :: latency_error_upper=ids_real_invalid !Upper error for "latency" + real(ids_real) :: latency_error_lower=ids_real_invalid !Lower error for "latency" + integer(ids_int) :: latency_error_index=ids_int_invalid !Index in the error_description list for "latency" + type(ids_code) :: code !Generic decription of the code-specific parameters for the code that has produced this IDS + real(ids_real), pointer :: time(:) => null() !Generic time + end type + + ! *********** mhd IDS internal structures declaration + + type :: ids_mhd_ggd_electrons + type(ids_generic_grid_scalar), pointer :: temperature(:) => null() !Temperature, given on various grid subsets + end type + + type :: ids_mhd_ggd + type(ids_mhd_ggd_electrons) :: electrons !Quantities related to the electrons + type(ids_generic_grid_scalar), pointer :: t_i_average(:) => null() !Ion temperature (averaged on ion species), given on various grid subsets + type(ids_generic_grid_scalar), pointer :: n_i_total(:) => null() !Total ion density (sum over ion species and thermal+non-thermal), given on various grid subsets + type(ids_generic_grid_scalar), pointer :: zeff(:) => null() !Effective charge, given on various grid subsets + type(ids_generic_grid_scalar), pointer :: b_field_r(:) => null() !R component of the magnetic field, given on various grid subsets + type(ids_generic_grid_scalar), pointer :: b_field_z(:) => null() !Z component of the magnetic field, given on various grid subsets + type(ids_generic_grid_scalar), pointer :: b_field_tor(:) => null() !Toroidal component of the magnetic field, given on various grid subsets + type(ids_generic_grid_scalar), pointer :: a_field_r(:) => null() !R component of the magnetic vector potential, given on various grid subsets + type(ids_generic_grid_scalar), pointer :: a_field_z(:) => null() !Z component of the magnetic vector potential, given on various grid subsets + type(ids_generic_grid_scalar), pointer :: a_field_tor(:) => null() !Toroidal component of the magnetic vector potential, given on various grid subsets + type(ids_generic_grid_scalar), pointer :: psi(:) => null() !Poloidal flux, given on various grid subsets + type(ids_generic_grid_scalar), pointer :: velocity_r(:) => null() !R component of the plasma velocity, given on various grid subsets + type(ids_generic_grid_scalar), pointer :: velocity_z(:) => null() !Z component of the plasma velocity, given on various grid subsets + type(ids_generic_grid_scalar), pointer :: velocity_tor(:) => null() !Toroidal component of the plasma velocity, given on various grid subsets + type(ids_generic_grid_scalar), pointer :: velocity_parallel(:) => null() !Parallel (to magnetic field) component of the plasma velocity, given on various grid subsets + type(ids_generic_grid_scalar), pointer :: velocity_parallel_over_b_field(:) => null() !Parallel (to magnetic field) component of the plasma velocity divided by the modulus of the local magnetic field, given on various! + ! grid subsets + type(ids_generic_grid_scalar), pointer :: phi_potential(:) => null() !Electric potential, given on various grid subsets + type(ids_generic_grid_scalar), pointer :: vorticity(:) => null() !Vorticity, given on various grid subsets + type(ids_generic_grid_scalar), pointer :: vorticity_over_r(:) => null() !Vorticity divided by the local major radius, given on various grid subsets + type(ids_generic_grid_scalar), pointer :: j_r(:) => null() !R component of the current density, given on various grid subsets + type(ids_generic_grid_scalar), pointer :: j_z(:) => null() !Z component of the current density, given on various grid subsets + type(ids_generic_grid_scalar), pointer :: j_tor(:) => null() !Toroidal component of the current density, given on various grid subsets + type(ids_generic_grid_scalar), pointer :: j_tor_r(:) => null() !Toroidal component of the current density multiplied by the local major radius, given on various grid subsets + type(ids_generic_grid_scalar), pointer :: mass_density(:) => null() !Mass density, given on various grid subsets + real(ids_real) :: time=ids_real_invalid !Time + end type + + + ! *********** mhd IDS + type, extends(IDS_base) :: ids_mhd !Magnetohydrodynamic activity, description of perturbed fields and profiles using the Generic Grid Description. + logical, private :: c_data = .FALSE. ! Fortran specific metadata telling whether the IDS has been populated from C allocated data (LL) or not + integer, private :: max_occurrence = 2! Maximum occurrence allowed as defined in the DD + + type(ids_ids_properties) :: ids_properties !Interface Data Structure properties. This element identifies the node above as an IDS + type(ids_generic_grid_aos3_root), pointer :: grid_ggd(:) => null() !Grid (using the Generic Grid Description), for various time slices. The timebase of this array of structure must be a subset of th! + !e ggd timebase + type(ids_mhd_ggd), pointer :: ggd(:) => null() !Edge plasma quantities represented using the general grid description, for various time slices. + type(ids_code) :: code !Generic decription of the code-specific parameters for the code that has produced this IDS + real(ids_real), pointer :: time(:) => null() !Generic time + end type + + ! *********** mhd_linear IDS internal structures declaration + + type :: ids_mhd_coordinate_system + type(ids_identifier_dynamic_aos3) :: grid_type !Selection of one of a set of grid types + type(ids_equilibrium_profiles_2d_grid) :: grid !Definition of the 2D grid + real(ids_real), pointer :: r(:,:) => null() !Values of the major radius on the grid + real(ids_real), pointer :: r_error_upper(:,:) => null() !Upper error for "r" + real(ids_real), pointer :: r_error_lower(:,:) => null() !Lower error for "r" + integer(ids_int) :: r_error_index=ids_int_invalid !Index in the error_description list for "r" + real(ids_real), pointer :: z(:,:) => null() !Values of the Height on the grid + real(ids_real), pointer :: z_error_upper(:,:) => null() !Upper error for "z" + real(ids_real), pointer :: z_error_lower(:,:) => null() !Lower error for "z" + integer(ids_int) :: z_error_index=ids_int_invalid !Index in the error_description list for "z" + real(ids_real), pointer :: jacobian(:,:) => null() !Absolute value of the jacobian of the coordinate system + real(ids_real), pointer :: jacobian_error_upper(:,:) => null() !Upper error for "jacobian" + real(ids_real), pointer :: jacobian_error_lower(:,:) => null() !Lower error for "jacobian" + integer(ids_int) :: jacobian_error_index=ids_int_invalid !Index in the error_description list for "jacobian" + real(ids_real), pointer :: tensor_covariant(:,:,:,:) => null() !Covariant metric tensor on every point of the grid described by grid_type + real(ids_real), pointer :: tensor_covariant_error_upper(:,:,:,:) => null() !Upper error for "tensor_covariant" + real(ids_real), pointer :: tensor_covariant_error_lower(:,:,:,:) => null() !Lower error for "tensor_covariant" + integer(ids_int) :: tensor_covariant_error_index=ids_int_invalid !Index in the error_description list for "tensor_covariant" + real(ids_real), pointer :: tensor_contravariant(:,:,:,:) => null() !Contravariant metric tensor on every point of the grid described by grid_type + real(ids_real), pointer :: tensor_contravariant_error_upper(:,:,:,:) => null() !Upper error for "tensor_contravariant" + real(ids_real), pointer :: tensor_contravariant_error_lower(:,:,:,:) => null() !Lower error for "tensor_contravariant" + integer(ids_int) :: tensor_contravariant_error_index=ids_int_invalid !Index in the error_description list for "tensor_contravariant" + end type + + type :: ids_complex_2d_dynamic_aos_mhd_scalar + real(ids_real), pointer :: real(:,:) => null() !Real part + real(ids_real), pointer :: real_error_upper(:,:) => null() !Upper error for "real" + real(ids_real), pointer :: real_error_lower(:,:) => null() !Lower error for "real" + integer(ids_int) :: real_error_index=ids_int_invalid !Index in the error_description list for "real" + real(ids_real), pointer :: imaginary(:,:) => null() !Imaginary part + real(ids_real), pointer :: imaginary_error_upper(:,:) => null() !Upper error for "imaginary" + real(ids_real), pointer :: imaginary_error_lower(:,:) => null() !Lower error for "imaginary" + integer(ids_int) :: imaginary_error_index=ids_int_invalid !Index in the error_description list for "imaginary" + real(ids_real), pointer :: coefficients_real(:,:,:) => null() !Interpolation coefficients, to be used for a high precision evaluation of the physical quantity (real part) with finite elements, ! + !provided on the 2D grid + real(ids_real), pointer :: coefficients_real_error_upper(:,:,:) => null() !Upper error for "coefficients_real" + real(ids_real), pointer :: coefficients_real_error_lower(:,:,:) => null() !Lower error for "coefficients_real" + integer(ids_int) :: coefficients_real_error_index=ids_int_invalid !Index in the error_description list for "coefficients_real" + real(ids_real), pointer :: coefficients_imaginary(:,:,:) => null() !Interpolation coefficients, to be used for a high precision evaluation of the physical quantity (imaginary part) with finite eleme! + !nts, provided on the 2D grid + real(ids_real), pointer :: coefficients_imaginary_error_upper(:,:,:) => null() !Upper error for "coefficients_imaginary" + real(ids_real), pointer :: coefficients_imaginary_error_lower(:,:,:) => null() !Lower error for "coefficients_imaginary" + integer(ids_int) :: coefficients_imaginary_error_index=ids_int_invalid !Index in the error_description list for "coefficients_imaginary" + end type + + type :: ids_complex_2d_dynamic_aos_mhd_linear_vector + real(ids_real), pointer :: real(:,:) => null() !Real part + real(ids_real), pointer :: real_error_upper(:,:) => null() !Upper error for "real" + real(ids_real), pointer :: real_error_lower(:,:) => null() !Lower error for "real" + integer(ids_int) :: real_error_index=ids_int_invalid !Index in the error_description list for "real" + real(ids_real), pointer :: imaginary(:,:) => null() !Imaginary part + real(ids_real), pointer :: imaginary_error_upper(:,:) => null() !Upper error for "imaginary" + real(ids_real), pointer :: imaginary_error_lower(:,:) => null() !Lower error for "imaginary" + integer(ids_int) :: imaginary_error_index=ids_int_invalid !Index in the error_description list for "imaginary" + real(ids_real), pointer :: coefficients_real(:,:,:) => null() !Interpolation coefficients, to be used for a high precision evaluation of the physical quantity (real part) with finite elements, ! + !provided on the 2D grid + real(ids_real), pointer :: coefficients_real_error_upper(:,:,:) => null() !Upper error for "coefficients_real" + real(ids_real), pointer :: coefficients_real_error_lower(:,:,:) => null() !Lower error for "coefficients_real" + integer(ids_int) :: coefficients_real_error_index=ids_int_invalid !Index in the error_description list for "coefficients_real" + real(ids_real), pointer :: coefficients_imaginary(:,:,:) => null() !Interpolation coefficients, to be used for a high precision evaluation of the physical quantity (imaginary part) with finite eleme! + !nts, provided on the 2D grid + real(ids_real), pointer :: coefficients_imaginary_error_upper(:,:,:) => null() !Upper error for "coefficients_imaginary" + real(ids_real), pointer :: coefficients_imaginary_error_lower(:,:,:) => null() !Lower error for "coefficients_imaginary" + integer(ids_int) :: coefficients_imaginary_error_index=ids_int_invalid !Index in the error_description list for "coefficients_imaginary" + end type + + type :: ids_mhd_linear_vector + type(ids_complex_2d_dynamic_aos_mhd_linear_vector) :: coordinate1 !First coordinate (radial) + type(ids_complex_2d_dynamic_aos_mhd_linear_vector) :: coordinate2 !Second coordinate (poloidal) + type(ids_complex_2d_dynamic_aos_mhd_linear_vector) :: coordinate3 !Third coordinate (toroidal) + end type + + type :: ids_complex_1d_mhd_alfven_spectrum + real(ids_real), pointer :: real(:) => null() !Real part of the frequency, for a given radial position and every root found at this position + real(ids_real), pointer :: real_error_upper(:) => null() !Upper error for "real" + real(ids_real), pointer :: real_error_lower(:) => null() !Lower error for "real" + integer(ids_int) :: real_error_index=ids_int_invalid !Index in the error_description list for "real" + real(ids_real), pointer :: imaginary(:) => null() !Imaginary part of the frequency, for a given radial position and every root found at this position + real(ids_real), pointer :: imaginary_error_upper(:) => null() !Upper error for "imaginary" + real(ids_real), pointer :: imaginary_error_lower(:) => null() !Lower error for "imaginary" + integer(ids_int) :: imaginary_error_index=ids_int_invalid !Index in the error_description list for "imaginary" + end type + + type :: ids_complex_3d_mhd_stress_tensor + real(ids_real), pointer :: real(:,:,:) => null() !Real part of the stress tensor, for various radial positions + real(ids_real), pointer :: real_error_upper(:,:,:) => null() !Upper error for "real" + real(ids_real), pointer :: real_error_lower(:,:,:) => null() !Lower error for "real" + integer(ids_int) :: real_error_index=ids_int_invalid !Index in the error_description list for "real" + real(ids_real), pointer :: imaginary(:,:,:) => null() !Imaginary part of the stress tensor, for various radial positions + real(ids_real), pointer :: imaginary_error_upper(:,:,:) => null() !Upper error for "imaginary" + real(ids_real), pointer :: imaginary_error_lower(:,:,:) => null() !Lower error for "imaginary" + integer(ids_int) :: imaginary_error_index=ids_int_invalid !Index in the error_description list for "imaginary" + end type + + type :: ids_mhd_linear_time_slice_toroidal_mode_plasma + type(ids_identifier_dynamic_aos3) :: grid_type !Selection of one of a set of grid types + type(ids_equilibrium_profiles_2d_grid) :: grid !Definition of the 2D grid (the content of dim1 and dim2 is defined by the selected grid_type) + type(ids_mhd_coordinate_system) :: coordinate_system !Flux surface coordinate system of the equilibrium used for the MHD calculation on a square grid of flux and poloidal angle + type(ids_complex_2d_dynamic_aos_mhd_scalar) :: displacement_perpendicular !Perpendicular displacement of the modes + type(ids_complex_2d_dynamic_aos_mhd_scalar) :: displacement_parallel !Parallel displacement of the modes + real(ids_real), pointer :: tau_alfven(:) => null() !Alven time=R/vA=R0 sqrt(mi ni(rho))/B0 + real(ids_real), pointer :: tau_alfven_error_upper(:) => null() !Upper error for "tau_alfven" + real(ids_real), pointer :: tau_alfven_error_lower(:) => null() !Lower error for "tau_alfven" + integer(ids_int) :: tau_alfven_error_index=ids_int_invalid !Index in the error_description list for "tau_alfven" + real(ids_real), pointer :: tau_resistive(:) => null() !Resistive time = mu_0 rho*rho/1.22/eta_neo + real(ids_real), pointer :: tau_resistive_error_upper(:) => null() !Upper error for "tau_resistive" + real(ids_real), pointer :: tau_resistive_error_lower(:) => null() !Lower error for "tau_resistive" + integer(ids_int) :: tau_resistive_error_index=ids_int_invalid !Index in the error_description list for "tau_resistive" + type(ids_mhd_linear_vector) :: a_field_perturbed !Pertubed vector potential for given toroidal mode number + type(ids_mhd_linear_vector) :: b_field_perturbed !Pertubed magnetic field for given toroidal mode number + type(ids_mhd_linear_vector) :: velocity_perturbed !Pertubed velocity for given toroidal mode number + type(ids_complex_2d_dynamic_aos_mhd_scalar) :: pressure_perturbed !Perturbed pressure for given toroidal mode number + type(ids_complex_2d_dynamic_aos_mhd_scalar) :: mass_density_perturbed !Perturbed mass density for given toroidal mode number + type(ids_complex_2d_dynamic_aos_mhd_scalar) :: temperature_perturbed !Perturbed temperature for given toroidal mode number + type(ids_complex_2d_dynamic_aos_mhd_scalar) :: phi_potential_perturbed !Perturbed electrostatic potential for given toroidal mode number + type(ids_complex_2d_dynamic_aos_mhd_scalar) :: psi_potential_perturbed !Perturbed electromagnetic super-potential for given toroidal mode number, see ref [Antonsen/Lane Phys Fluids 23(6) 1980, formula 3! + !4], so that A_field_parallel=1/(i*2pi*frequency) (grad psi_potential)_parallel + type(ids_complex_1d_mhd_alfven_spectrum), pointer :: alfven_frequency_spectrum(:) => null() !Local shear Alfven spectrum as a function of radius (only in case grid/dim1 is a radial coordinate) + type(ids_complex_3d_mhd_stress_tensor) :: stress_maxwell !Maxwell stress tensor + type(ids_complex_3d_mhd_stress_tensor) :: stress_reynolds !Reynolds stress tensor + type(ids_complex_3d_mhd_stress_tensor) :: ntv !Neoclassical toroidal viscosity tensor + end type + + type :: ids_mhd_linear_time_slice_toroidal_mode_vacuum + type(ids_identifier_dynamic_aos3) :: grid_type !Selection of one of a set of grid types + type(ids_equilibrium_profiles_2d_grid) :: grid !Definition of the 2D grid (the content of dim1 and dim2 is defined by the selected grid_type) + type(ids_mhd_coordinate_system) :: coordinate_system !Flux surface coordinate system of the equilibrium used for the MHD calculation on a square grid of flux and poloidal angle + type(ids_mhd_linear_vector) :: a_field_perturbed !Pertubed vector potential for given toroidal mode number + type(ids_mhd_linear_vector) :: b_field_perturbed !Pertubed magnetic field for given toroidal mode number + end type + + type :: ids_mhd_linear_time_slice_toroidal_modes + type(ids_identifier_dynamic_aos3) :: perturbation_type !Type of the perturbation + integer(ids_int) :: n_tor=ids_int_invalid !Toroidal mode number of the MHD mode + real(ids_real) :: m_pol_dominant=ids_real_invalid !Dominant poloidal mode number defining the mode rational surface; for TAEs the lower of the two main m's has to be specified + real(ids_real) :: m_pol_dominant_error_upper=ids_real_invalid !Upper error for "m_pol_dominant" + real(ids_real) :: m_pol_dominant_error_lower=ids_real_invalid !Lower error for "m_pol_dominant" + integer(ids_int) :: m_pol_dominant_error_index=ids_int_invalid !Index in the error_description list for "m_pol_dominant" + type(ids_identifier_dynamic_aos3) :: ballooning_type !Ballooning type of the mode : ballooning 0; anti-ballooning:1; flute-like:2 + real(ids_real) :: radial_mode_number=ids_real_invalid !Radial mode number + real(ids_real) :: radial_mode_number_error_upper=ids_real_invalid !Upper error for "radial_mode_number" + real(ids_real) :: radial_mode_number_error_lower=ids_real_invalid !Lower error for "radial_mode_number" + integer(ids_int) :: radial_mode_number_error_index=ids_int_invalid !Index in the error_description list for "radial_mode_number" + real(ids_real) :: growthrate=ids_real_invalid !Linear growthrate of the mode + real(ids_real) :: growthrate_error_upper=ids_real_invalid !Upper error for "growthrate" + real(ids_real) :: growthrate_error_lower=ids_real_invalid !Lower error for "growthrate" + integer(ids_int) :: growthrate_error_index=ids_int_invalid !Index in the error_description list for "growthrate" + real(ids_real) :: frequency=ids_real_invalid !Frequency of the mode + real(ids_real) :: frequency_error_upper=ids_real_invalid !Upper error for "frequency" + real(ids_real) :: frequency_error_lower=ids_real_invalid !Lower error for "frequency" + integer(ids_int) :: frequency_error_index=ids_int_invalid !Index in the error_description list for "frequency" + real(ids_real) :: phase=ids_real_invalid !Additional phase offset of mode + real(ids_real) :: phase_error_upper=ids_real_invalid !Upper error for "phase" + real(ids_real) :: phase_error_lower=ids_real_invalid !Lower error for "phase" + integer(ids_int) :: phase_error_index=ids_int_invalid !Index in the error_description list for "phase" + real(ids_real) :: energy_perturbed=ids_real_invalid !Perturbed energy associated to the mode + real(ids_real) :: energy_perturbed_error_upper=ids_real_invalid !Upper error for "energy_perturbed" + real(ids_real) :: energy_perturbed_error_lower=ids_real_invalid !Lower error for "energy_perturbed" + integer(ids_int) :: energy_perturbed_error_index=ids_int_invalid !Index in the error_description list for "energy_perturbed" + real(ids_real) :: amplitude_multiplier=ids_real_invalid !Multiplier that is needed to convert the linear mode structures to the amplitude of a non-linearly saturated mode in physical unit! + !s. If empty, it means that the structures contains no information about non-linearly saturated mode + real(ids_real) :: amplitude_multiplier_error_upper=ids_real_invalid !Upper error for "amplitude_multiplier" + real(ids_real) :: amplitude_multiplier_error_lower=ids_real_invalid !Lower error for "amplitude_multiplier" + integer(ids_int) :: amplitude_multiplier_error_index=ids_int_invalid !Index in the error_description list for "amplitude_multiplier" + type(ids_mhd_linear_time_slice_toroidal_mode_plasma) :: plasma !MHD modes in the confined plasma + type(ids_mhd_linear_time_slice_toroidal_mode_vacuum) :: vacuum !MHD modes in the vacuum + end type + + type :: ids_mhd_linear_time_slice + type(ids_mhd_linear_time_slice_toroidal_modes), pointer :: toroidal_mode(:) => null() !Vector of toroidal modes. Each mode is described as exp(i(n_tor.phi - m_pol.theta - 2.pi.frequency.t - phase)) + real(ids_real) :: time=ids_real_invalid !Time + end type + + + ! *********** mhd_linear IDS + type, extends(IDS_base) :: ids_mhd_linear !Magnetohydronamic linear stability + logical, private :: c_data = .FALSE. ! Fortran specific metadata telling whether the IDS has been populated from C allocated data (LL) or not + integer, private :: max_occurrence = 10! Maximum occurrence allowed as defined in the DD + + type(ids_ids_properties) :: ids_properties !Interface Data Structure properties. This element identifies the node above as an IDS + type(ids_identifier) :: model_type !Type of model used to populate this IDS + type(ids_identifier) :: equations !Type of MHD equations used to populate this IDS + integer(ids_int) :: fluids_n=ids_int_invalid !Number of fluids considered in the model + integer(ids_int) :: ideal_flag=ids_int_invalid !1 if ideal MHD is used to populate this IDS, 0 for non-ideal MHD + type(ids_b_tor_vacuum_1) :: vacuum_toroidal_field !Characteristics of the vacuum toroidal field (used in rho_tor definition and in the normalization of current densities) + type(ids_mhd_linear_time_slice), pointer :: time_slice(:) => null() !Core plasma radial profiles for various time slices + type(ids_code) :: code !Generic decription of the code-specific parameters for the code that has produced this IDS + real(ids_real), pointer :: time(:) => null() !Generic time + end type + + ! *********** mse IDS internal structures declaration + + type :: ids_mse_channel_resolution + type(ids_rzphi0d_dynamic_aos3) :: centre !Position of the centre of the spatially resolved zone + type(ids_rzphi0d_dynamic_aos3) :: width !Full width of the spatially resolved zone in the R, Z and phi directions + real(ids_real), pointer :: geometric_coefficients(:) => null() !Set of 9 geometric coefficients providing the MSE polarisation angle as a function of the local electric and magnetic field compon! + !ents (these are related to the angle between beam and line of sight). The list is ordered as follows : coefficients of BZ, BR, Bph! + !i, ER (numerator of the MSE angle expression); coefficients of BZ, BR, Bphi, ER, EZ (denominator) + real(ids_real), pointer :: geometric_coefficients_error_upper(:) => null() !Upper error for "geometric_coefficients" + real(ids_real), pointer :: geometric_coefficients_error_lower(:) => null() !Lower error for "geometric_coefficients" + integer(ids_int) :: geometric_coefficients_error_index=ids_int_invalid !Index in the error_description list for "geometric_coefficients" + real(ids_real) :: time=ids_real_invalid !Time + end type + + type :: ids_mse_channel + character(len=ids_string_length), dimension(:), pointer :: name => null() !Name of the channel + type(ids_detector_aperture) :: detector !Detector description + type(ids_detector_aperture), pointer :: aperture(:) => null() !Description of a set of collimating apertures + type(ids_line_of_sight_2points) :: line_of_sight !Description of the line of sight of the channel, given by 2 points + type(ids_mse_channel_resolution), pointer :: active_spatial_resolution(:) => null() !Spatial resolution of the measurement, calculated as a convolution of the atomic smearing, magnetic and beam geometry smearing and! + ! detector projection, for a set of time slices (use a single time slice for the whole pulse if the beam and the line of sight are ! + !not moving during the pulse) + type(ids_signal_flt_1d_validity) :: polarisation_angle !MSE polarisation angle + end type + + + ! *********** mse IDS + type, extends(IDS_base) :: ids_mse !Motional Stark Effect diagnostic + logical, private :: c_data = .FALSE. ! Fortran specific metadata telling whether the IDS has been populated from C allocated data (LL) or not + integer, private :: max_occurrence = 2! Maximum occurrence allowed as defined in the DD + + type(ids_ids_properties) :: ids_properties !Interface Data Structure properties. This element identifies the node above as an IDS + type(ids_mse_channel), pointer :: channel(:) => null() !Set of channels (lines of sight) + real(ids_real) :: latency=ids_real_invalid !Upper bound of the delay between physical information received by the detector and data available on the real-time (RT) network. + real(ids_real) :: latency_error_upper=ids_real_invalid !Upper error for "latency" + real(ids_real) :: latency_error_lower=ids_real_invalid !Lower error for "latency" + integer(ids_int) :: latency_error_index=ids_int_invalid !Index in the error_description list for "latency" + type(ids_code) :: code !Generic decription of the code-specific parameters for the code that has produced this IDS + real(ids_real), pointer :: time(:) => null() !Generic time + end type + + ! *********** nbi IDS internal structures declaration + + type :: ids_nbi_unit_beamlets_group_tilting + type(ids_rzphi0d_dynamic_aos3) :: delta_position !Variation of the position of the beamlet group centre + real(ids_real) :: delta_tangency_radius=ids_real_invalid !Variation of the tangency radius (major radius where the central line of a NBI unit is tangent to a circle around the torus) + real(ids_real) :: delta_tangency_radius_error_upper=ids_real_invalid !Upper error for "delta_tangency_radius" + real(ids_real) :: delta_tangency_radius_error_lower=ids_real_invalid !Lower error for "delta_tangency_radius" + integer(ids_int) :: delta_tangency_radius_error_index=ids_int_invalid !Index in the error_description list for "delta_tangency_radius" + real(ids_real) :: delta_angle=ids_real_invalid !Variation of the angle of inclination between a beamlet at the centre of the injection unit surface and the horiontal plane + real(ids_real) :: delta_angle_error_upper=ids_real_invalid !Upper error for "delta_angle" + real(ids_real) :: delta_angle_error_lower=ids_real_invalid !Lower error for "delta_angle" + integer(ids_int) :: delta_angle_error_index=ids_int_invalid !Index in the error_description list for "delta_angle" + real(ids_real) :: time=ids_real_invalid !Time + end type + + type :: ids_nbi_unit_beamlets_group_focus + real(ids_real) :: focal_length_horizontal=ids_real_invalid !Horizontal focal length along the beam line, i.e. the point along the centre of the beamlet-group where the beamlet-group has its ! + !minimum horizontal width + real(ids_real) :: focal_length_horizontal_error_upper=ids_real_invalid !Upper error for "focal_length_horizontal" + real(ids_real) :: focal_length_horizontal_error_lower=ids_real_invalid !Lower error for "focal_length_horizontal" + integer(ids_int) :: focal_length_horizontal_error_index=ids_int_invalid !Index in the error_description list for "focal_length_horizontal" + real(ids_real) :: focal_length_vertical=ids_real_invalid !Vertical focal length along the beam line, i.e. the point along the centre of the beamlet-group where the beamlet-group has its mi! + !nimum vertical width + real(ids_real) :: focal_length_vertical_error_upper=ids_real_invalid !Upper error for "focal_length_vertical" + real(ids_real) :: focal_length_vertical_error_lower=ids_real_invalid !Lower error for "focal_length_vertical" + integer(ids_int) :: focal_length_vertical_error_index=ids_int_invalid !Index in the error_description list for "focal_length_vertical" + real(ids_real) :: width_min_horizontal=ids_real_invalid !The horizontal width of the beamlets group at the at the horizontal focal point + real(ids_real) :: width_min_horizontal_error_upper=ids_real_invalid !Upper error for "width_min_horizontal" + real(ids_real) :: width_min_horizontal_error_lower=ids_real_invalid !Lower error for "width_min_horizontal" + integer(ids_int) :: width_min_horizontal_error_index=ids_int_invalid !Index in the error_description list for "width_min_horizontal" + real(ids_real) :: width_min_vertical=ids_real_invalid !The vertical width of the beamlets group at the at the vertical focal point + real(ids_real) :: width_min_vertical_error_upper=ids_real_invalid !Upper error for "width_min_vertical" + real(ids_real) :: width_min_vertical_error_lower=ids_real_invalid !Lower error for "width_min_vertical" + integer(ids_int) :: width_min_vertical_error_index=ids_int_invalid !Index in the error_description list for "width_min_vertical" + end type + + type :: ids_nbi_unit_beamlets_group_divergence + real(ids_real) :: particles_fraction=ids_real_invalid !Fraction of injected particles in the component + real(ids_real) :: particles_fraction_error_upper=ids_real_invalid !Upper error for "particles_fraction" + real(ids_real) :: particles_fraction_error_lower=ids_real_invalid !Lower error for "particles_fraction" + integer(ids_int) :: particles_fraction_error_index=ids_int_invalid !Index in the error_description list for "particles_fraction" + real(ids_real) :: vertical=ids_real_invalid !The vertical beamlet divergence of the component. Here the divergence is defined for Gaussian beams as the angel where the beam de! + !nsity is reduced by a factor 1/e compared to the maximum density. For non-Gaussian beams the divergence is sqrt(2)*mean((x-mean(x)! + !)**2), where x is the angle and the mean should be performed over the beam density, P(x): mean(y)=int(y*P(x)*dx). + real(ids_real) :: vertical_error_upper=ids_real_invalid !Upper error for "vertical" + real(ids_real) :: vertical_error_lower=ids_real_invalid !Lower error for "vertical" + integer(ids_int) :: vertical_error_index=ids_int_invalid !Index in the error_description list for "vertical" + real(ids_real) :: horizontal=ids_real_invalid !The horiztonal beamlet divergence of the component. Here the divergence is defined for Gaussian beams as the angel where the beam ! + !density is reduced by a factor 1/e compared to the maximum density. For non-Gaussian beams the divergence is sqrt(2)*mean((x-mean(! + !x))**2), where x is the angle and the mean should be performed over the beam density, P(x): mean(y)=int(y*P(x)*dx). + real(ids_real) :: horizontal_error_upper=ids_real_invalid !Upper error for "horizontal" + real(ids_real) :: horizontal_error_lower=ids_real_invalid !Lower error for "horizontal" + integer(ids_int) :: horizontal_error_index=ids_int_invalid !Index in the error_description list for "horizontal" + end type + + type :: ids_nbi_unit_beamlets_group_beamlets + type(ids_rzphi1d_static) :: positions !Position of each beamlet + real(ids_real), pointer :: tangency_radii(:) => null() !Tangency radius (major radius where the central line of a beamlet is tangent to a circle around the torus), for each beamlet + real(ids_real), pointer :: tangency_radii_error_upper(:) => null() !Upper error for "tangency_radii" + real(ids_real), pointer :: tangency_radii_error_lower(:) => null() !Lower error for "tangency_radii" + integer(ids_int) :: tangency_radii_error_index=ids_int_invalid !Index in the error_description list for "tangency_radii" + real(ids_real), pointer :: angles(:) => null() !Angle of inclination between a line at the centre of a beamlet and the horizontal plane, for each beamlet + real(ids_real), pointer :: angles_error_upper(:) => null() !Upper error for "angles" + real(ids_real), pointer :: angles_error_lower(:) => null() !Lower error for "angles" + integer(ids_int) :: angles_error_index=ids_int_invalid !Index in the error_description list for "angles" + real(ids_real), pointer :: power_fractions(:) => null() !Fraction of power of a unit injected by each beamlet + real(ids_real), pointer :: power_fractions_error_upper(:) => null() !Upper error for "power_fractions" + real(ids_real), pointer :: power_fractions_error_lower(:) => null() !Lower error for "power_fractions" + integer(ids_int) :: power_fractions_error_index=ids_int_invalid !Index in the error_description list for "power_fractions" + end type + + type :: ids_nbi_unit_beamlets_group + type(ids_rzphi0d_static) :: position !R, Z, Phi position of the beamlet group centre + real(ids_real) :: tangency_radius=ids_real_invalid !Tangency radius (major radius where the central line of a NBI unit is tangent to a circle around the torus) + real(ids_real) :: tangency_radius_error_upper=ids_real_invalid !Upper error for "tangency_radius" + real(ids_real) :: tangency_radius_error_lower=ids_real_invalid !Lower error for "tangency_radius" + integer(ids_int) :: tangency_radius_error_index=ids_int_invalid !Index in the error_description list for "tangency_radius" + real(ids_real) :: angle=ids_real_invalid !Angle of inclination between a beamlet at the centre of the injection unit surface and the horiontal plane + real(ids_real) :: angle_error_upper=ids_real_invalid !Upper error for "angle" + real(ids_real) :: angle_error_lower=ids_real_invalid !Lower error for "angle" + integer(ids_int) :: angle_error_index=ids_int_invalid !Index in the error_description list for "angle" + type(ids_nbi_unit_beamlets_group_tilting), pointer :: tilting(:) => null() !In case of dynamic beam tilting (i.e. during the pulse), e.g. for some Beam Emission Spectroscopy use cases, variations of positio! + !n, tangency radius and angle with respect to their static value, for various time slices + integer(ids_int) :: direction=ids_int_invalid !Direction of the beam seen from above the torus: -1 = clockwise; 1 = counter clockwise + real(ids_real) :: width_horizontal=ids_real_invalid !Horizontal width of the beam group at the injection unit surface (or grounded grid) + real(ids_real) :: width_horizontal_error_upper=ids_real_invalid !Upper error for "width_horizontal" + real(ids_real) :: width_horizontal_error_lower=ids_real_invalid !Lower error for "width_horizontal" + integer(ids_int) :: width_horizontal_error_index=ids_int_invalid !Index in the error_description list for "width_horizontal" + real(ids_real) :: width_vertical=ids_real_invalid !Vertical width of the beam group at the injection unit surface (or grounded grid) + real(ids_real) :: width_vertical_error_upper=ids_real_invalid !Upper error for "width_vertical" + real(ids_real) :: width_vertical_error_lower=ids_real_invalid !Lower error for "width_vertical" + integer(ids_int) :: width_vertical_error_index=ids_int_invalid !Index in the error_description list for "width_vertical" + type(ids_nbi_unit_beamlets_group_focus) :: focus !Describes how the beamlet group is focused + type(ids_nbi_unit_beamlets_group_divergence), pointer :: divergence_component(:) => null() !Detailed information on beamlet divergence. Divergence is described as a superposition of Gaussian components with amplitide "part! + !icles_fraction" and vertical/horizontal divergence. Note that for positive ion NBI the divergence is well described by a single Ga! + !ussian + type(ids_nbi_unit_beamlets_group_beamlets) :: beamlets !Detailed information on beamlets + end type + + type :: ids_nbi_unit + character(len=ids_string_length), dimension(:), pointer :: name => null() !Name of the NBI unit + character(len=ids_string_length), dimension(:), pointer :: identifier => null() !ID of the NBI unit + type(ids_plasma_composition_species) :: species !Injected species + type(ids_signal_flt_1d) :: power_launched !Power launched from this unit into the vacuum vessel + type(ids_signal_flt_1d) :: energy !Full energy of the injected species (acceleration of a single atom) + type(ids_signal_flt_2d) :: beam_current_fraction !Fractions of beam current distributed among the different energies, the first index corresponds to the fast neutrals energy (1:ful! + !l, 2: half, 3: one third) + type(ids_signal_flt_2d) :: beam_power_fraction !Fractions of beam power distributed among the different energies, the first index corresponds to the fast neutrals energy (1:full,! + ! 2: half, 3: one third) + type(ids_nbi_unit_beamlets_group), pointer :: beamlets_group(:) => null() !Group of beamlets with common vertical and horizontal focal point. If there are no common focal points, then select small groups o! + !f beamlets such that a focal point description of the beamlets group provides a fair description + type(ids_detector_aperture) :: source !Description of the surface of the ion source from which the beam is extracted + type(ids_detector_aperture), pointer :: aperture(:) => null() !Description of a set of collimating apertures through which the beam is launched + end type + + + ! *********** nbi IDS + type, extends(IDS_base) :: ids_nbi !Neutral Beam Injection systems and description of the fast neutrals that arrive into the torus + logical, private :: c_data = .FALSE. ! Fortran specific metadata telling whether the IDS has been populated from C allocated data (LL) or not + integer, private :: max_occurrence = 3! Maximum occurrence allowed as defined in the DD + + type(ids_ids_properties) :: ids_properties !Interface Data Structure properties. This element identifies the node above as an IDS + type(ids_nbi_unit), pointer :: unit(:) => null() !The NBI system is described as a set of units of which the power can be controlled individually. + real(ids_real) :: latency=ids_real_invalid !Upper bound of the delay between input command received from the RT network and actuator starting to react. Applies globally to th! + !e system described by this IDS unless specific latencies (e.g. channel-specific or antenna-specific) are provided at a deeper leve! + !l in the IDS structure. + real(ids_real) :: latency_error_upper=ids_real_invalid !Upper error for "latency" + real(ids_real) :: latency_error_lower=ids_real_invalid !Lower error for "latency" + integer(ids_int) :: latency_error_index=ids_int_invalid !Index in the error_description list for "latency" + type(ids_code) :: code !Generic decription of the code-specific parameters for the code that has produced this IDS + real(ids_real), pointer :: time(:) => null() !Generic time + end type + + ! *********** neutron_diagnostic IDS internal structures declaration + + type :: ids_neutron_diagnostic_characteristics_reaction_mode + integer(ids_int) :: index=ids_int_invalid !Index of Measuring Mode + character(len=ids_string_length), dimension(:), pointer :: name => null() !Name of Measuring Mode + real(ids_real) :: count_limit_max=ids_real_invalid !Maximum count limit of recent Measuring Mode and plasma reaction + real(ids_real) :: count_limit_min=ids_real_invalid !Minimum count limit of recent Measuring Mode and plasma reaction + end type + + type :: ids_neutron_diagnostic_characteristics_reaction + integer(ids_int) :: index=ids_int_invalid !Index of plasma reaction type + real(ids_real) :: error=ids_real_invalid !Diagnostic's relative uncertainty for recent plasma reaction + real(ids_real) :: error_error_upper=ids_real_invalid !Upper error for "error" + real(ids_real) :: error_error_lower=ids_real_invalid !Lower error for "error" + integer(ids_int) :: error_error_index=ids_int_invalid !Index in the error_description list for "error" + real(ids_real) :: probability_overlap=ids_real_invalid !Pulse probability overlap for recent plasma reaction + real(ids_real) :: probability_overlap_error_upper=ids_real_invalid !Upper error for "probability_overlap" + real(ids_real) :: probability_overlap_error_lower=ids_real_invalid !Lower error for "probability_overlap" + integer(ids_int) :: probability_overlap_error_index=ids_int_invalid !Index in the error_description list for "probability_overlap" + type(ids_neutron_diagnostic_characteristics_reaction_mode), pointer :: mode(:) => null() !Characteristics of counting linear limits in recent Measuring modes for recent Plasma reaction type + end type + + type :: ids_neutron_diagnostic_characteristics + real(ids_real) :: dead_time=ids_real_invalid !Dead time of detectors + real(ids_real) :: dead_time_error_upper=ids_real_invalid !Upper error for "dead_time" + real(ids_real) :: dead_time_error_lower=ids_real_invalid !Lower error for "dead_time" + integer(ids_int) :: dead_time_error_index=ids_int_invalid !Index in the error_description list for "dead_time" + real(ids_real) :: pulse_length=ids_real_invalid !Lower counting limit of recent Measuring Mode and plasma reaction + real(ids_real) :: pulse_length_error_upper=ids_real_invalid !Upper error for "pulse_length" + real(ids_real) :: pulse_length_error_lower=ids_real_invalid !Lower error for "pulse_length" + integer(ids_int) :: pulse_length_error_index=ids_int_invalid !Index in the error_description list for "pulse_length" + type(ids_neutron_diagnostic_characteristics_reaction), pointer :: reaction(:) => null() !Plasma reaction (1 -'DT'; 2 - 'DD') + end type + + type :: ids_neutron_diagnostic_detectors_radiation + integer(ids_int) :: index=ids_int_invalid !Index of radiation type + character(len=ids_string_length), dimension(:), pointer :: converter_name => null() !Name of detector's converter for resent particle + real(ids_real) :: converter_volume=ids_real_invalid !Volume of detector's converter for resent particle + real(ids_real) :: converter_volume_error_upper=ids_real_invalid !Upper error for "converter_volume" + real(ids_real) :: converter_volume_error_lower=ids_real_invalid !Lower error for "converter_volume" + integer(ids_int) :: converter_volume_error_index=ids_int_invalid !Index in the error_description list for "converter_volume" + real(ids_real) :: converter_nuclear_density=ids_real_invalid !Nuclear density of detector's converter for resent particle + real(ids_real) :: converter_nuclear_density_error_upper=ids_real_invalid !Upper error for "converter_nuclear_density" + real(ids_real) :: converter_nuclear_density_error_lower=ids_real_invalid !Lower error for "converter_nuclear_density" + integer(ids_int) :: converter_nuclear_density_error_index=ids_int_invalid !Index in the error_description list for "converter_nuclear_density" + real(ids_real), pointer :: converter_temperature(:) => null() !Temperature of detector's converter + real(ids_real), pointer :: converter_temperature_error_upper(:) => null() !Upper error for "converter_temperature" + real(ids_real), pointer :: converter_temperature_error_lower(:) => null() !Lower error for "converter_temperature" + integer(ids_int) :: converter_temperature_error_index=ids_int_invalid !Index in the error_description list for "converter_temperature" + end type + + type :: ids_neutron_diagnostic_detectors_mode + character(len=ids_string_length), dimension(:), pointer :: name => null() !Name of Measuring Mode + type(ids_signal_flt_1d) :: counting !Counting in Measuring Mode in Dynamic + end type + + type :: ids_neutron_diagnostic_adc + integer(ids_int) :: power_switch=ids_int_invalid !Power switch (1=on, 0=off) + integer(ids_int) :: discriminator_level_lower=ids_int_invalid !Lower level discriminator of ADC + integer(ids_int) :: discriminator_level_upper=ids_int_invalid !Upper level discriminator of ADC + integer(ids_int) :: sampling_rate=ids_int_invalid !Number of samples recorded per second + real(ids_real) :: bias=ids_real_invalid !ADC signal bias + real(ids_real) :: bias_error_upper=ids_real_invalid !Upper error for "bias" + real(ids_real) :: bias_error_lower=ids_real_invalid !Lower error for "bias" + integer(ids_int) :: bias_error_index=ids_int_invalid !Index in the error_description list for "bias" + real(ids_real) :: input_range=ids_real_invalid !ADC input range + real(ids_real) :: input_range_error_upper=ids_real_invalid !Upper error for "input_range" + real(ids_real) :: input_range_error_lower=ids_real_invalid !Lower error for "input_range" + integer(ids_int) :: input_range_error_index=ids_int_invalid !Index in the error_description list for "input_range" + real(ids_real) :: impedance=ids_real_invalid !ADC impedance + real(ids_real) :: impedance_error_upper=ids_real_invalid !Upper error for "impedance" + real(ids_real) :: impedance_error_lower=ids_real_invalid !Lower error for "impedance" + integer(ids_int) :: impedance_error_index=ids_int_invalid !Index in the error_description list for "impedance" + end type + + type :: ids_neutron_diagnostic_supply + integer(ids_int) :: power_switch=ids_int_invalid !Power switch (1=on, 0=off) + type(ids_signal_flt_1d) :: voltage_set !Voltage set + type(ids_signal_flt_1d) :: voltage_out !Voltage at the supply output + end type + + type :: ids_neutron_diagnostic_test_generator + integer(ids_int) :: power_switch=ids_int_invalid !Power switch (1=on, 0=off) + type(ids_identifier) :: shape !Signal shape. Index : 1 – rectangular, 2 – gaussian + real(ids_real) :: rise_time=ids_real_invalid !Peak rise time + real(ids_real) :: rise_time_error_upper=ids_real_invalid !Upper error for "rise_time" + real(ids_real) :: rise_time_error_lower=ids_real_invalid !Lower error for "rise_time" + integer(ids_int) :: rise_time_error_index=ids_int_invalid !Index in the error_description list for "rise_time" + real(ids_real) :: fall_time=ids_real_invalid !Peak fall time + real(ids_real) :: fall_time_error_upper=ids_real_invalid !Upper error for "fall_time" + real(ids_real) :: fall_time_error_lower=ids_real_invalid !Lower error for "fall_time" + integer(ids_int) :: fall_time_error_index=ids_int_invalid !Index in the error_description list for "fall_time" + type(ids_signal_flt_1d) :: frequency !Generated signal frequency + type(ids_signal_flt_1d) :: amplitude !Generated signal amplitude + end type + + type :: ids_xyz3d_static + real(ids_real), pointer :: x(:,:,:) => null() !Components along X axis for each voxel + real(ids_real), pointer :: x_error_upper(:,:,:) => null() !Upper error for "x" + real(ids_real), pointer :: x_error_lower(:,:,:) => null() !Lower error for "x" + integer(ids_int) :: x_error_index=ids_int_invalid !Index in the error_description list for "x" + real(ids_real), pointer :: y(:,:,:) => null() !Component along Y axis for each voxel + real(ids_real), pointer :: y_error_upper(:,:,:) => null() !Upper error for "y" + real(ids_real), pointer :: y_error_lower(:,:,:) => null() !Lower error for "y" + integer(ids_int) :: y_error_index=ids_int_invalid !Index in the error_description list for "y" + real(ids_real), pointer :: z(:,:,:) => null() !Component along Z axis for each voxel + real(ids_real), pointer :: z_error_upper(:,:,:) => null() !Upper error for "z" + real(ids_real), pointer :: z_error_lower(:,:,:) => null() !Lower error for "z" + integer(ids_int) :: z_error_index=ids_int_invalid !Index in the error_description list for "z" + end type + + type :: ids_neutron_diagnostic_field_of_view + real(ids_real), pointer :: solid_angle(:,:,:) => null() !Average solid angle that the detector covers within the voxel + real(ids_real), pointer :: solid_angle_error_upper(:,:,:) => null() !Upper error for "solid_angle" + real(ids_real), pointer :: solid_angle_error_lower(:,:,:) => null() !Lower error for "solid_angle" + integer(ids_int) :: solid_angle_error_index=ids_int_invalid !Index in the error_description list for "solid_angle" + type(ids_rzphi1d_grid) :: emission_grid !Grid defining the neutron emission cells in the plasma + type(ids_xyz3d_static) :: direction_to_detector !Vector that points from the centre of the voxel to the centre of the detector, described in the (X,Y,Z) coordinate system, where X! + ! is the major radius axis for phi = 0, Y is the major radius axis for phi = pi/2, and Z is the height axis. + end type + + type :: ids_neutron_diagnostic_event + type(ids_identifier_static) :: type !Type of the event + real(ids_real), pointer :: values(:) => null() !Array of values for the event + real(ids_real), pointer :: values_error_upper(:) => null() !Upper error for "values" + real(ids_real), pointer :: values_error_lower(:) => null() !Lower error for "values" + integer(ids_int) :: values_error_index=ids_int_invalid !Index in the error_description list for "values" + end type + + type :: ids_neutron_diagnostic_green + real(ids_real), pointer :: source_neutron_energies(:) => null() !Array of source neutron energy bins + real(ids_real), pointer :: source_neutron_energies_error_upper(:) => null() !Upper error for "source_neutron_energies" + real(ids_real), pointer :: source_neutron_energies_error_lower(:) => null() !Lower error for "source_neutron_energies" + integer(ids_int) :: source_neutron_energies_error_index=ids_int_invalid !Index in the error_description list for "source_neutron_energies" + type(ids_neutron_diagnostic_event) :: event_in_detector_neutron_flux !5th dimension for the neutron_flux Green function representing values of events measured in the detector. The type of events monit! + !ored depends on the detector and can be defined by the user. It can be energy of neutrons, or electrical signal, or time of flight! + ! ... (defined by type below) + real(ids_real), pointer :: neutron_flux(:,:,:,:,:) => null() !Grouped neutron flux in the detector from one neutron energy bin emitted by the current plasma voxel towards the detector + real(ids_real), pointer :: neutron_flux_error_upper(:,:,:,:,:) => null() !Upper error for "neutron_flux" + real(ids_real), pointer :: neutron_flux_error_lower(:,:,:,:,:) => null() !Lower error for "neutron_flux" + integer(ids_int) :: neutron_flux_error_index=ids_int_invalid !Index in the error_description list for "neutron_flux" + type(ids_neutron_diagnostic_event) :: event_in_detector_response_function !5th dimension for the response_function Green function representing values of events measured in the detector. The type of events ! + !monitored depends on the detector and can be defined by the user. It can be energy of neutrons, or electrical signal, or time of f! + !light ... (defined by type below) + real(ids_real), pointer :: response_function(:,:,:,:,:) => null() !Number of events occurring in the detector from one neutron energy bin emitted by the current plasma voxel towards the detector + real(ids_real), pointer :: response_function_error_upper(:,:,:,:,:) => null() !Upper error for "response_function" + real(ids_real), pointer :: response_function_error_lower(:,:,:,:,:) => null() !Lower error for "response_function" + integer(ids_int) :: response_function_error_index=ids_int_invalid !Index in the error_description list for "response_function" + end type + + type :: ids_neutron_diagnostic_detectors + character(len=ids_string_length), dimension(:), pointer :: name => null() !Name of Detector + type(ids_neutron_diagnostic_detectors_radiation), pointer :: radiation(:) => null() !Radiation type on detector's converter (1 - 'neutrons'; 2 - 'gamma-rays') + type(ids_rzphi0d_static) :: position !Detector Position Data SHOULD BE REMOVED, REDUNDANT WITH THE NEW DETECTOR DESCRIPTION + type(ids_detector_aperture) :: detector !Detector description + type(ids_detector_aperture), pointer :: aperture(:) => null() !Description of a set of collimating apertures + type(ids_neutron_diagnostic_detectors_mode), pointer :: mode(:) => null() !Measuring Mode Properties and Data + type(ids_detector_energy_band), pointer :: energy_band(:) => null() !Set of energy bands in which neutrons are counted by the detector + real(ids_real) :: start_time=ids_real_invalid !Time stamp of the moment diagnostic starts recording data + real(ids_real) :: start_time_error_upper=ids_real_invalid !Upper error for "start_time" + real(ids_real) :: start_time_error_lower=ids_real_invalid !Lower error for "start_time" + integer(ids_int) :: start_time_error_index=ids_int_invalid !Index in the error_description list for "start_time" + real(ids_real) :: end_time=ids_real_invalid !Time stamp of the moment diagnostic ends recording data + real(ids_real) :: end_time_error_upper=ids_real_invalid !Upper error for "end_time" + real(ids_real) :: end_time_error_lower=ids_real_invalid !Lower error for "end_time" + integer(ids_int) :: end_time_error_index=ids_int_invalid !Index in the error_description list for "end_time" + real(ids_real) :: spectrum_sampling_time=ids_real_invalid !Sampling time used to obtain one spectrum time slice + real(ids_real) :: spectrum_sampling_time_error_upper=ids_real_invalid !Upper error for "spectrum_sampling_time" + real(ids_real) :: spectrum_sampling_time_error_lower=ids_real_invalid !Lower error for "spectrum_sampling_time" + integer(ids_int) :: spectrum_sampling_time_error_index=ids_int_invalid !Index in the error_description list for "spectrum_sampling_time" + type(ids_signal_flt_1d) :: amplitude_raw !Raw amplitude of the measured signal + type(ids_signal_flt_1d) :: amplitude_peak !Processed peak amplitude of the measured signal + integer(ids_int), pointer :: spectrum_total(:) => null() !Detected count per energy channel, integrated over the whole acquisition duration + type(ids_signal_int_2d) :: spectrum !Detected count per energy channel as a function of time + type(ids_neutron_diagnostic_adc) :: adc !Description of analogic-digital converter + type(ids_neutron_diagnostic_supply) :: supply_high_voltage !Description of high voltage power supply + type(ids_neutron_diagnostic_supply) :: supply_low_voltage !Description of low voltage power supply + type(ids_neutron_diagnostic_test_generator) :: test_generator !Test generator characteristics + type(ids_neutron_diagnostic_test_generator) :: b_field_sensor !Magnetic field sensor + type(ids_neutron_diagnostic_test_generator) :: temperature_sensor !Temperature sensor + type(ids_neutron_diagnostic_field_of_view) :: field_of_view !Field of view associated to this detector. The field of view is described by a voxelized plasma volume. Each voxel, with indexes i! + !_R, i_Z, and i_phi, has an associated solid angle scalar and a detector direction vector. + type(ids_neutron_diagnostic_green) :: green_functions !Green function coefficients used to represent the detector response based on its field of view + end type + + type :: ids_neutron_diagnostic_synthetic_signals + real(ids_real), pointer :: total_neutron_flux(:) => null() !Total Neutron Flux in Dynamic + real(ids_real), pointer :: total_neutron_flux_error_upper(:) => null() !Upper error for "total_neutron_flux" + real(ids_real), pointer :: total_neutron_flux_error_lower(:) => null() !Lower error for "total_neutron_flux" + integer(ids_int) :: total_neutron_flux_error_index=ids_int_invalid !Index in the error_description list for "total_neutron_flux" + real(ids_real), pointer :: fusion_power(:) => null() !Fusion Power + real(ids_real), pointer :: fusion_power_error_upper(:) => null() !Upper error for "fusion_power" + real(ids_real), pointer :: fusion_power_error_lower(:) => null() !Lower error for "fusion_power" + integer(ids_int) :: fusion_power_error_index=ids_int_invalid !Index in the error_description list for "fusion_power" + end type + + type :: ids_neutron_diagnostic_unit_source_radiation_reaction + real(ids_real), pointer :: energy(:) => null() !Energy boundaries for Detector Radiator Flux + real(ids_real), pointer :: energy_error_upper(:) => null() !Upper error for "energy" + real(ids_real), pointer :: energy_error_lower(:) => null() !Lower error for "energy" + integer(ids_int) :: energy_error_index=ids_int_invalid !Index in the error_description list for "energy" + real(ids_real), pointer :: flux(:,:) => null() !Radiation flux from Unit Ring Source in recent detector's converter + real(ids_real), pointer :: flux_error_upper(:,:) => null() !Upper error for "flux" + real(ids_real), pointer :: flux_error_lower(:,:) => null() !Lower error for "flux" + integer(ids_int) :: flux_error_index=ids_int_invalid !Index in the error_description list for "flux" + real(ids_real), pointer :: d2flux_drdz(:,:) => null() !Second deriviation of Radiation flux from Unit Ring Source in recent detector's converter for "spline" reconstruction + real(ids_real), pointer :: d2flux_drdz_error_upper(:,:) => null() !Upper error for "d2flux_drdz" + real(ids_real), pointer :: d2flux_drdz_error_lower(:,:) => null() !Lower error for "d2flux_drdz" + integer(ids_int) :: d2flux_drdz_error_index=ids_int_invalid !Index in the error_description list for "d2flux_drdz" + real(ids_real), pointer :: reaction_rate(:,:) => null() !Reaction Rate on converter's material from Unit Ring Source in recent detector's converter + real(ids_real), pointer :: reaction_rate_error_upper(:,:) => null() !Upper error for "reaction_rate" + real(ids_real), pointer :: reaction_rate_error_lower(:,:) => null() !Lower error for "reaction_rate" + integer(ids_int) :: reaction_rate_error_index=ids_int_invalid !Index in the error_description list for "reaction_rate" + real(ids_real), pointer :: sensitivity(:,:) => null() !Sensitivity of converter's material in recent detector's converter + real(ids_real), pointer :: sensitivity_error_upper(:,:) => null() !Upper error for "sensitivity" + real(ids_real), pointer :: sensitivity_error_lower(:,:) => null() !Lower error for "sensitivity" + integer(ids_int) :: sensitivity_error_index=ids_int_invalid !Index in the error_description list for "sensitivity" + end type + + type :: ids_neutron_diagnostic_unit_source_radiation + type(ids_neutron_diagnostic_unit_source_radiation_reaction), pointer :: reaction(:) => null() !Plasma reaction (1 - 'DT'; 2 - 'DD') + end type + + type :: ids_neutron_diagnostic_unit_source + type(ids_rz0d_static) :: position !Position of ring unit sources inside ITER vacuum vessel + type(ids_neutron_diagnostic_unit_source_radiation), pointer :: radiation(:) => null() !Radiation type on detector's converter (1 - 'neutrons'; 2 - 'gamma-rays') + end type + + + ! *********** neutron_diagnostic IDS + type, extends(IDS_base) :: ids_neutron_diagnostic !Neutron diagnostic such as DNFM, NFM or MFC + logical, private :: c_data = .FALSE. ! Fortran specific metadata telling whether the IDS has been populated from C allocated data (LL) or not + integer, private :: max_occurrence = 3! Maximum occurrence allowed as defined in the DD + + type(ids_ids_properties) :: ids_properties !Interface Data Structure properties. This element identifies the node above as an IDS + type(ids_neutron_diagnostic_characteristics) :: characteristics !Description of Diagnostic's module detection characteristics for differen plasma modes based on Design Description + type(ids_neutron_diagnostic_detectors), pointer :: detectors(:) => null() !Description of Detectors properties and Data in Neutron Diagnostic Module + type(ids_neutron_diagnostic_synthetic_signals) :: synthetic_signals !Output Data from Neutron Diagnostic's Module + type(ids_neutron_diagnostic_unit_source), pointer :: unit_source(:) => null() !Unit ring sources description + real(ids_real) :: latency=ids_real_invalid !Upper bound of the delay between physical information received by the detector and data available on the real-time (RT) network. + real(ids_real) :: latency_error_upper=ids_real_invalid !Upper error for "latency" + real(ids_real) :: latency_error_lower=ids_real_invalid !Lower error for "latency" + integer(ids_int) :: latency_error_index=ids_int_invalid !Index in the error_description list for "latency" + type(ids_code) :: code !Generic decription of the code-specific parameters for the code that has produced this IDS + real(ids_real), pointer :: time(:) => null() !Generic time + end type + + ! *********** ntms IDS internal structures declaration + + type :: ids_ntm_time_slice_mode_onset + real(ids_real) :: width=ids_real_invalid !Seed island full width at onset time + real(ids_real) :: width_error_upper=ids_real_invalid !Upper error for "width" + real(ids_real) :: width_error_lower=ids_real_invalid !Lower error for "width" + integer(ids_int) :: width_error_index=ids_int_invalid !Index in the error_description list for "width" + real(ids_real) :: time_onset=ids_real_invalid !Onset time + real(ids_real) :: time_onset_error_upper=ids_real_invalid !Upper error for "time_onset" + real(ids_real) :: time_onset_error_lower=ids_real_invalid !Lower error for "time_onset" + integer(ids_int) :: time_onset_error_index=ids_int_invalid !Index in the error_description list for "time_onset" + real(ids_real) :: time_offset=ids_real_invalid !Offset time (when a mode disappears). If the mode reappears later in the simulation, use another index of the mode array of struct! + !ure + real(ids_real) :: time_offset_error_upper=ids_real_invalid !Upper error for "time_offset" + real(ids_real) :: time_offset_error_lower=ids_real_invalid !Lower error for "time_offset" + integer(ids_int) :: time_offset_error_index=ids_int_invalid !Index in the error_description list for "time_offset" + real(ids_real) :: phase=ids_real_invalid !Phase of the mode at onset + real(ids_real) :: phase_error_upper=ids_real_invalid !Upper error for "phase" + real(ids_real) :: phase_error_lower=ids_real_invalid !Lower error for "phase" + integer(ids_int) :: phase_error_index=ids_int_invalid !Index in the error_description list for "phase" + integer(ids_int) :: n_tor=ids_int_invalid !Toroidal mode number + integer(ids_int) :: m_pol=ids_int_invalid !Poloidal mode number + character(len=ids_string_length), dimension(:), pointer :: cause => null() !Cause of the mode onset + end type + + type :: ids_ntm_time_slice_mode_evolution_deltaw + real(ids_real) :: value=ids_real_invalid !Value of the contribution + real(ids_real) :: value_error_upper=ids_real_invalid !Upper error for "value" + real(ids_real) :: value_error_lower=ids_real_invalid !Lower error for "value" + integer(ids_int) :: value_error_index=ids_int_invalid !Index in the error_description list for "value" + character(len=ids_string_length), dimension(:), pointer :: name => null() !Name of the contribution + end type + + type :: ids_ntm_time_slice_mode_evolution_torque + real(ids_real) :: value=ids_real_invalid !Value of the contribution + real(ids_real) :: value_error_upper=ids_real_invalid !Upper error for "value" + real(ids_real) :: value_error_lower=ids_real_invalid !Lower error for "value" + integer(ids_int) :: value_error_index=ids_int_invalid !Index in the error_description list for "value" + character(len=ids_string_length), dimension(:), pointer :: name => null() !Name of the contribution + end type + + type :: ids_ntm_time_slice_mode_detailed_evolution_deltaw + real(ids_real), pointer :: value(:) => null() !Value of the contribution + real(ids_real), pointer :: value_error_upper(:) => null() !Upper error for "value" + real(ids_real), pointer :: value_error_lower(:) => null() !Lower error for "value" + integer(ids_int) :: value_error_index=ids_int_invalid !Index in the error_description list for "value" + character(len=ids_string_length), dimension(:), pointer :: name => null() !Name of the contribution + end type + + type :: ids_ntm_time_slice_mode_detailed_evolution_torque + real(ids_real), pointer :: value(:) => null() !Value of the contribution + real(ids_real), pointer :: value_error_upper(:) => null() !Upper error for "value" + real(ids_real), pointer :: value_error_lower(:) => null() !Lower error for "value" + integer(ids_int) :: value_error_index=ids_int_invalid !Index in the error_description list for "value" + character(len=ids_string_length), dimension(:), pointer :: name => null() !Name of the contribution + end type + + type :: ids_ntm_time_slice_mode_detailed_evolution + real(ids_real), pointer :: time_detailed(:) => null() !Time array used to describe the detailed evolution of the NTM + real(ids_real), pointer :: time_detailed_error_upper(:) => null() !Upper error for "time_detailed" + real(ids_real), pointer :: time_detailed_error_lower(:) => null() !Lower error for "time_detailed" + integer(ids_int) :: time_detailed_error_index=ids_int_invalid !Index in the error_description list for "time_detailed" + real(ids_real), pointer :: width(:) => null() !Full width of the mode + real(ids_real), pointer :: width_error_upper(:) => null() !Upper error for "width" + real(ids_real), pointer :: width_error_lower(:) => null() !Lower error for "width" + integer(ids_int) :: width_error_index=ids_int_invalid !Index in the error_description list for "width" + real(ids_real), pointer :: dwidth_dt(:) => null() !Time derivative of the full width of the mode + real(ids_real), pointer :: dwidth_dt_error_upper(:) => null() !Upper error for "dwidth_dt" + real(ids_real), pointer :: dwidth_dt_error_lower(:) => null() !Lower error for "dwidth_dt" + integer(ids_int) :: dwidth_dt_error_index=ids_int_invalid !Index in the error_description list for "dwidth_dt" + real(ids_real), pointer :: phase(:) => null() !Phase of the mode + real(ids_real), pointer :: phase_error_upper(:) => null() !Upper error for "phase" + real(ids_real), pointer :: phase_error_lower(:) => null() !Lower error for "phase" + integer(ids_int) :: phase_error_index=ids_int_invalid !Index in the error_description list for "phase" + real(ids_real), pointer :: dphase_dt(:) => null() !Time derivative of the phase of the mode + real(ids_real), pointer :: dphase_dt_error_upper(:) => null() !Upper error for "dphase_dt" + real(ids_real), pointer :: dphase_dt_error_lower(:) => null() !Lower error for "dphase_dt" + integer(ids_int) :: dphase_dt_error_index=ids_int_invalid !Index in the error_description list for "dphase_dt" + real(ids_real), pointer :: frequency(:) => null() !Frequency of the mode + real(ids_real), pointer :: frequency_error_upper(:) => null() !Upper error for "frequency" + real(ids_real), pointer :: frequency_error_lower(:) => null() !Lower error for "frequency" + integer(ids_int) :: frequency_error_index=ids_int_invalid !Index in the error_description list for "frequency" + real(ids_real), pointer :: dfrequency_dt(:) => null() !Time derivative of the frequency of the mode + real(ids_real), pointer :: dfrequency_dt_error_upper(:) => null() !Upper error for "dfrequency_dt" + real(ids_real), pointer :: dfrequency_dt_error_lower(:) => null() !Lower error for "dfrequency_dt" + integer(ids_int) :: dfrequency_dt_error_index=ids_int_invalid !Index in the error_description list for "dfrequency_dt" + integer(ids_int) :: n_tor=ids_int_invalid !Toroidal mode number + integer(ids_int) :: m_pol=ids_int_invalid !Poloidal mode number + type(ids_ntm_time_slice_mode_detailed_evolution_deltaw), pointer :: deltaw(:) => null() !deltaw contributions to the Rutherford equation + type(ids_ntm_time_slice_mode_detailed_evolution_torque), pointer :: torque(:) => null() !torque contributions to the Rutherford equation + character(len=ids_string_length), dimension(:), pointer :: calculation_method => null() !Description of how the mode evolution is calculated + real(ids_real), pointer :: delta_diff(:,:) => null() !Extra diffusion coefficient for the transport equations of Te, ne, Ti + real(ids_real), pointer :: delta_diff_error_upper(:,:) => null() !Upper error for "delta_diff" + real(ids_real), pointer :: delta_diff_error_lower(:,:) => null() !Lower error for "delta_diff" + integer(ids_int) :: delta_diff_error_index=ids_int_invalid !Index in the error_description list for "delta_diff" + real(ids_real), pointer :: rho_tor_norm(:) => null() !Normalised flux coordinate on which the mode is centred + real(ids_real), pointer :: rho_tor_norm_error_upper(:) => null() !Upper error for "rho_tor_norm" + real(ids_real), pointer :: rho_tor_norm_error_lower(:) => null() !Lower error for "rho_tor_norm" + integer(ids_int) :: rho_tor_norm_error_index=ids_int_invalid !Index in the error_description list for "rho_tor_norm" + real(ids_real), pointer :: rho_tor(:) => null() !Flux coordinate on which the mode is centred + real(ids_real), pointer :: rho_tor_error_upper(:) => null() !Upper error for "rho_tor" + real(ids_real), pointer :: rho_tor_error_lower(:) => null() !Lower error for "rho_tor" + integer(ids_int) :: rho_tor_error_index=ids_int_invalid !Index in the error_description list for "rho_tor" + end type + + type :: ids_ntm_time_slice_mode + type(ids_ntm_time_slice_mode_onset) :: onset !NTM onset characteristics + real(ids_real) :: width=ids_real_invalid !Full width of the mode + real(ids_real) :: width_error_upper=ids_real_invalid !Upper error for "width" + real(ids_real) :: width_error_lower=ids_real_invalid !Lower error for "width" + integer(ids_int) :: width_error_index=ids_int_invalid !Index in the error_description list for "width" + real(ids_real) :: dwidth_dt=ids_real_invalid !Time derivative of the full width of the mode + real(ids_real) :: dwidth_dt_error_upper=ids_real_invalid !Upper error for "dwidth_dt" + real(ids_real) :: dwidth_dt_error_lower=ids_real_invalid !Lower error for "dwidth_dt" + integer(ids_int) :: dwidth_dt_error_index=ids_int_invalid !Index in the error_description list for "dwidth_dt" + real(ids_real) :: phase=ids_real_invalid !Phase of the mode + real(ids_real) :: phase_error_upper=ids_real_invalid !Upper error for "phase" + real(ids_real) :: phase_error_lower=ids_real_invalid !Lower error for "phase" + integer(ids_int) :: phase_error_index=ids_int_invalid !Index in the error_description list for "phase" + real(ids_real) :: dphase_dt=ids_real_invalid !Time derivative of the phase of the mode + real(ids_real) :: dphase_dt_error_upper=ids_real_invalid !Upper error for "dphase_dt" + real(ids_real) :: dphase_dt_error_lower=ids_real_invalid !Lower error for "dphase_dt" + integer(ids_int) :: dphase_dt_error_index=ids_int_invalid !Index in the error_description list for "dphase_dt" + real(ids_real) :: frequency=ids_real_invalid !Frequency of the mode + real(ids_real) :: frequency_error_upper=ids_real_invalid !Upper error for "frequency" + real(ids_real) :: frequency_error_lower=ids_real_invalid !Lower error for "frequency" + integer(ids_int) :: frequency_error_index=ids_int_invalid !Index in the error_description list for "frequency" + real(ids_real) :: dfrequency_dt=ids_real_invalid !Time derivative of the frequency of the mode + real(ids_real) :: dfrequency_dt_error_upper=ids_real_invalid !Upper error for "dfrequency_dt" + real(ids_real) :: dfrequency_dt_error_lower=ids_real_invalid !Lower error for "dfrequency_dt" + integer(ids_int) :: dfrequency_dt_error_index=ids_int_invalid !Index in the error_description list for "dfrequency_dt" + integer(ids_int) :: n_tor=ids_int_invalid !Toroidal mode number + integer(ids_int) :: m_pol=ids_int_invalid !Poloidal mode number + type(ids_ntm_time_slice_mode_evolution_deltaw), pointer :: deltaw(:) => null() !deltaw contributions to the Rutherford equation + type(ids_ntm_time_slice_mode_evolution_torque), pointer :: torque(:) => null() !torque contributions to the Rutherford equation + character(len=ids_string_length), dimension(:), pointer :: calculation_method => null() !Description of how the mode evolution is calculated + real(ids_real), pointer :: delta_diff(:) => null() !Extra diffusion coefficient for the transport equations of Te, ne, Ti + real(ids_real), pointer :: delta_diff_error_upper(:) => null() !Upper error for "delta_diff" + real(ids_real), pointer :: delta_diff_error_lower(:) => null() !Lower error for "delta_diff" + integer(ids_int) :: delta_diff_error_index=ids_int_invalid !Index in the error_description list for "delta_diff" + real(ids_real) :: rho_tor_norm=ids_real_invalid !Normalised flux coordinate on which the mode is centred + real(ids_real) :: rho_tor_norm_error_upper=ids_real_invalid !Upper error for "rho_tor_norm" + real(ids_real) :: rho_tor_norm_error_lower=ids_real_invalid !Lower error for "rho_tor_norm" + integer(ids_int) :: rho_tor_norm_error_index=ids_int_invalid !Index in the error_description list for "rho_tor_norm" + real(ids_real) :: rho_tor=ids_real_invalid !Flux coordinate on which the mode is centred + real(ids_real) :: rho_tor_error_upper=ids_real_invalid !Upper error for "rho_tor" + real(ids_real) :: rho_tor_error_lower=ids_real_invalid !Lower error for "rho_tor" + integer(ids_int) :: rho_tor_error_index=ids_int_invalid !Index in the error_description list for "rho_tor" + type(ids_ntm_time_slice_mode_detailed_evolution) :: detailed_evolution !Detailed NTM evolution on a finer timebase than the time_slice array of structure + end type + + type :: ids_ntm_time_slice + type(ids_ntm_time_slice_mode), pointer :: mode(:) => null() !List of the various NTM modes appearing during the simulation. If a mode appears several times, use several indices in this array ! + !of structure with the same m,n values. + real(ids_real) :: time=ids_real_invalid !Time + end type + + + ! *********** ntms IDS + type, extends(IDS_base) :: ids_ntms !Description of neoclassical tearing modes + logical, private :: c_data = .FALSE. ! Fortran specific metadata telling whether the IDS has been populated from C allocated data (LL) or not + integer, private :: max_occurrence = 1! Maximum occurrence allowed as defined in the DD + + type(ids_ids_properties) :: ids_properties !Interface Data Structure properties. This element identifies the node above as an IDS + type(ids_b_tor_vacuum_1) :: vacuum_toroidal_field !Characteristics of the vacuum toroidal field (used in rho_tor definition) + type(ids_ntm_time_slice), pointer :: time_slice(:) => null() !Description of neoclassical tearing modes for various time slices + type(ids_code) :: code !Generic decription of the code-specific parameters for the code that has produced this IDS + real(ids_real), pointer :: time(:) => null() !Generic time + end type + + ! *********** pellets IDS internal structures declaration + + type :: ids_pellets_time_slice_pellet_shape + type(ids_identifier_dynamic_aos3) :: type !Identifier structure for the shape type: 1-spherical; 2-cylindrical; 3-rectangular + real(ids_real), pointer :: size(:) => null() !Size of the pellet in the various dimensions, depending on the shape type. Spherical pellets: size(1) is the radius of the pellet.! + ! Cylindrical pellets: size(1) is the radius and size(2) is the height of the cylinder. Rectangular pellets: size(1) is the height,! + ! size(2) is the width and size(3) is the length + real(ids_real), pointer :: size_error_upper(:) => null() !Upper error for "size" + real(ids_real), pointer :: size_error_lower(:) => null() !Lower error for "size" + integer(ids_int) :: size_error_index=ids_int_invalid !Index in the error_description list for "size" + end type + + type :: ids_pellets_time_slice_pellet_species + real(ids_real) :: a=ids_real_invalid !Mass of atom + real(ids_real) :: a_error_upper=ids_real_invalid !Upper error for "a" + real(ids_real) :: a_error_lower=ids_real_invalid !Lower error for "a" + integer(ids_int) :: a_error_index=ids_int_invalid !Index in the error_description list for "a" + real(ids_real) :: z_n=ids_real_invalid !Nuclear charge + real(ids_real) :: z_n_error_upper=ids_real_invalid !Upper error for "z_n" + real(ids_real) :: z_n_error_lower=ids_real_invalid !Lower error for "z_n" + integer(ids_int) :: z_n_error_index=ids_int_invalid !Index in the error_description list for "z_n" + character(len=ids_string_length), dimension(:), pointer :: label => null() !String identifying the species (e.g. H, D, T, ...) + real(ids_real) :: density=ids_real_invalid !Material density of the species in the pellet + real(ids_real) :: density_error_upper=ids_real_invalid !Upper error for "density" + real(ids_real) :: density_error_lower=ids_real_invalid !Lower error for "density" + integer(ids_int) :: density_error_index=ids_int_invalid !Index in the error_description list for "density" + real(ids_real) :: fraction=ids_real_invalid !Atomic fraction of the species in the pellet + real(ids_real) :: fraction_error_upper=ids_real_invalid !Upper error for "fraction" + real(ids_real) :: fraction_error_lower=ids_real_invalid !Lower error for "fraction" + integer(ids_int) :: fraction_error_index=ids_int_invalid !Index in the error_description list for "fraction" + real(ids_real) :: sublimation_energy=ids_real_invalid !Sublimation energy per atom + real(ids_real) :: sublimation_energy_error_upper=ids_real_invalid !Upper error for "sublimation_energy" + real(ids_real) :: sublimation_energy_error_lower=ids_real_invalid !Lower error for "sublimation_energy" + integer(ids_int) :: sublimation_energy_error_index=ids_int_invalid !Index in the error_description list for "sublimation_energy" + end type + + type :: ids_pellets_time_slice_pellet_path_profiles + real(ids_real), pointer :: distance(:) => null() !Distance along the pellet path, with the origin taken at path_geometry/first_point. Used as the main coordinate for the path_profi! + !les structure + real(ids_real), pointer :: distance_error_upper(:) => null() !Upper error for "distance" + real(ids_real), pointer :: distance_error_lower(:) => null() !Lower error for "distance" + integer(ids_int) :: distance_error_index=ids_int_invalid !Index in the error_description list for "distance" + real(ids_real), pointer :: rho_tor_norm(:) => null() !Normalised toroidal coordinate along the pellet path + real(ids_real), pointer :: rho_tor_norm_error_upper(:) => null() !Upper error for "rho_tor_norm" + real(ids_real), pointer :: rho_tor_norm_error_lower(:) => null() !Lower error for "rho_tor_norm" + integer(ids_int) :: rho_tor_norm_error_index=ids_int_invalid !Index in the error_description list for "rho_tor_norm" + real(ids_real), pointer :: psi(:) => null() !Poloidal flux along the pellet path + real(ids_real), pointer :: psi_error_upper(:) => null() !Upper error for "psi" + real(ids_real), pointer :: psi_error_lower(:) => null() !Lower error for "psi" + integer(ids_int) :: psi_error_index=ids_int_invalid !Index in the error_description list for "psi" + real(ids_real), pointer :: velocity(:) => null() !Pellet velocity along the pellet path + real(ids_real), pointer :: velocity_error_upper(:) => null() !Upper error for "velocity" + real(ids_real), pointer :: velocity_error_lower(:) => null() !Lower error for "velocity" + integer(ids_int) :: velocity_error_index=ids_int_invalid !Index in the error_description list for "velocity" + real(ids_real), pointer :: n_e(:) => null() !Electron density along the pellet path + real(ids_real), pointer :: n_e_error_upper(:) => null() !Upper error for "n_e" + real(ids_real), pointer :: n_e_error_lower(:) => null() !Lower error for "n_e" + integer(ids_int) :: n_e_error_index=ids_int_invalid !Index in the error_description list for "n_e" + real(ids_real), pointer :: t_e(:) => null() !Electron temperature along the pellet path + real(ids_real), pointer :: t_e_error_upper(:) => null() !Upper error for "t_e" + real(ids_real), pointer :: t_e_error_lower(:) => null() !Lower error for "t_e" + integer(ids_int) :: t_e_error_index=ids_int_invalid !Index in the error_description list for "t_e" + real(ids_real), pointer :: ablation_rate(:) => null() !Ablation rate (electrons) along the pellet path + real(ids_real), pointer :: ablation_rate_error_upper(:) => null() !Upper error for "ablation_rate" + real(ids_real), pointer :: ablation_rate_error_lower(:) => null() !Lower error for "ablation_rate" + integer(ids_int) :: ablation_rate_error_index=ids_int_invalid !Index in the error_description list for "ablation_rate" + real(ids_real), pointer :: ablated_particles(:) => null() !Number of ablated particles (electrons) along the pellet path + real(ids_real), pointer :: ablated_particles_error_upper(:) => null() !Upper error for "ablated_particles" + real(ids_real), pointer :: ablated_particles_error_lower(:) => null() !Lower error for "ablated_particles" + integer(ids_int) :: ablated_particles_error_index=ids_int_invalid !Index in the error_description list for "ablated_particles" + real(ids_real), pointer :: rho_tor_norm_drift(:) => null() !Difference to due ExB drifts between the ablation and the final deposition locations, in terms of the normalised toroidal flux coo! + !rdinate + real(ids_real), pointer :: rho_tor_norm_drift_error_upper(:) => null() !Upper error for "rho_tor_norm_drift" + real(ids_real), pointer :: rho_tor_norm_drift_error_lower(:) => null() !Lower error for "rho_tor_norm_drift" + integer(ids_int) :: rho_tor_norm_drift_error_index=ids_int_invalid !Index in the error_description list for "rho_tor_norm_drift" + type(ids_rzphi1d_dynamic_aos3) :: position !Position along the pellet path + end type + + type :: ids_pellets_propellant_gas + type(ids_plasma_composition_neutral_element), pointer :: element(:) => null() !List of elements forming the gas molecule + character(len=ids_string_length), dimension(:), pointer :: label => null() !String identifying the neutral molecule (e.g. H2, D2, T2, N2, ...) + real(ids_real) :: molecules_n=ids_real_invalid !Number of molecules of the propellant gas injected in the vacuum vessel when launching the pellet + real(ids_real) :: molecules_n_error_upper=ids_real_invalid !Upper error for "molecules_n" + real(ids_real) :: molecules_n_error_lower=ids_real_invalid !Lower error for "molecules_n" + integer(ids_int) :: molecules_n_error_index=ids_int_invalid !Index in the error_description list for "molecules_n" + end type + + type :: ids_pellets_time_slice_pellet + type(ids_pellets_time_slice_pellet_shape) :: shape !Initial shape of a pellet at launch + type(ids_pellets_time_slice_pellet_species), pointer :: species(:) => null() !Set of atomic species included in the pellet composition + real(ids_real) :: velocity_initial=ids_real_invalid !Initial velocity of the pellet as it enters the vaccum chamber + real(ids_real) :: velocity_initial_error_upper=ids_real_invalid !Upper error for "velocity_initial" + real(ids_real) :: velocity_initial_error_lower=ids_real_invalid !Lower error for "velocity_initial" + integer(ids_int) :: velocity_initial_error_index=ids_int_invalid !Index in the error_description list for "velocity_initial" + type(ids_line_of_sight_2points_dynamic_aos3) :: path_geometry !Geometry of the pellet path in the vaccuum chamber + type(ids_pellets_time_slice_pellet_path_profiles) :: path_profiles !1-D profiles of plasma and pellet along the pellet path + type(ids_pellets_propellant_gas) :: propellant_gas !Propellant gas + end type + + type :: ids_pellets_time_slice + type(ids_pellets_time_slice_pellet), pointer :: pellet(:) => null() !Set of pellets ablated in the plasma at a given time + real(ids_real) :: time=ids_real_invalid !Time + end type + + + ! *********** pellets IDS + type, extends(IDS_base) :: ids_pellets !Description of pellets launched into the plasma + logical, private :: c_data = .FALSE. ! Fortran specific metadata telling whether the IDS has been populated from C allocated data (LL) or not + integer, private :: max_occurrence = 2! Maximum occurrence allowed as defined in the DD + + type(ids_ids_properties) :: ids_properties !Interface Data Structure properties. This element identifies the node above as an IDS + type(ids_pellets_time_slice), pointer :: time_slice(:) => null() !Description of the pellets launched at various time slices. The time of this structure corresponds to the full ablation of the pel! + !let inside the plasma. + real(ids_real) :: latency=ids_real_invalid !Upper bound of the delay between input command received from the RT network and actuator starting to react. Applies globally to th! + !e system described by this IDS unless specific latencies (e.g. channel-specific or antenna-specific) are provided at a deeper leve! + !l in the IDS structure. + real(ids_real) :: latency_error_upper=ids_real_invalid !Upper error for "latency" + real(ids_real) :: latency_error_lower=ids_real_invalid !Lower error for "latency" + integer(ids_int) :: latency_error_index=ids_int_invalid !Index in the error_description list for "latency" + type(ids_code) :: code !Generic decription of the code-specific parameters for the code that has produced this IDS + real(ids_real), pointer :: time(:) => null() !Generic time + end type + + ! *********** pf_active IDS internal structures declaration + + type :: ids_pf_coils + character(len=ids_string_length), dimension(:), pointer :: name => null() !Name of the coil + character(len=ids_string_length), dimension(:), pointer :: identifier => null() !Alphanumeric identifier of coils used for convenience + type(ids_identifier_static), pointer :: function(:) => null() !Set of functions for which this coil may be used + real(ids_real) :: resistance=ids_real_invalid !Coil resistance + real(ids_real) :: resistance_error_upper=ids_real_invalid !Upper error for "resistance" + real(ids_real) :: resistance_error_lower=ids_real_invalid !Lower error for "resistance" + integer(ids_int) :: resistance_error_index=ids_int_invalid !Index in the error_description list for "resistance" + type(ids_signal_flt_1d) :: resistance_additional !Additional resistance due to e.g. dynamically switchable resistors. The coil effective resistance is obtained by adding this dynam! + !ic quantity to the static resistance of the coil. + real(ids_real) :: energy_limit_max=ids_real_invalid !Maximum Energy to be dissipated in the coil + real(ids_real), pointer :: current_limit_max(:,:) => null() !Maximum tolerable current in the conductor + real(ids_real), pointer :: b_field_max(:) => null() !List of values of the maximum magnetic field on the conductor surface (coordinate for current_limit_max) + real(ids_real), pointer :: b_field_max_error_upper(:) => null() !Upper error for "b_field_max" + real(ids_real), pointer :: b_field_max_error_lower(:) => null() !Lower error for "b_field_max" + integer(ids_int) :: b_field_max_error_index=ids_int_invalid !Index in the error_description list for "b_field_max" + real(ids_real), pointer :: temperature(:) => null() !List of values of the conductor temperature (coordinate for current_limit_max) + real(ids_real), pointer :: temperature_error_upper(:) => null() !Upper error for "temperature" + real(ids_real), pointer :: temperature_error_lower(:) => null() !Lower error for "temperature" + integer(ids_int) :: temperature_error_index=ids_int_invalid !Index in the error_description list for "temperature" + type(ids_signal_flt_1d) :: b_field_max_timed !Maximum absolute value of the magnetic field on the conductor surface + type(ids_pf_coils_elements), pointer :: element(:) => null() !Each PF coil is comprised of a number of cross-section elements described individually + type(ids_signal_flt_1d) :: current !Current fed in the coil (for 1 turn, to be multiplied by the number of turns to obtain the generated magnetic field), positive whe! + !n flowing from side 1 to side 2 of the coil (inside the coil), this numbering being made consistently with the convention that the! + ! current is counter-clockwise when seen from above. + type(ids_signal_flt_1d) :: voltage !Voltage on the coil terminals (Vside1-Vside2) - including additional resistors if any + end type + + type :: ids_pf_forces + character(len=ids_string_length), dimension(:), pointer :: name => null() !Name of the force combination + real(ids_real), pointer :: combination(:) => null() !Coils involved in the force combinations. Normally the force would be the full set of coils, but in some cases, we want to have a ! + !difference in forces, such as a CS coil separation force. We therefore give each coil a force weight which we call the combination + real(ids_real), pointer :: combination_error_upper(:) => null() !Upper error for "combination" + real(ids_real), pointer :: combination_error_lower(:) => null() !Lower error for "combination" + integer(ids_int) :: combination_error_index=ids_int_invalid !Index in the error_description list for "combination" + real(ids_real) :: limit_max=ids_real_invalid !Maximum force combination limit + real(ids_real) :: limit_max_error_upper=ids_real_invalid !Upper error for "limit_max" + real(ids_real) :: limit_max_error_lower=ids_real_invalid !Lower error for "limit_max" + integer(ids_int) :: limit_max_error_index=ids_int_invalid !Index in the error_description list for "limit_max" + real(ids_real) :: limit_min=ids_real_invalid !Minimum force combination limit + real(ids_real) :: limit_min_error_upper=ids_real_invalid !Upper error for "limit_min" + real(ids_real) :: limit_min_error_lower=ids_real_invalid !Lower error for "limit_min" + integer(ids_int) :: limit_min_error_index=ids_int_invalid !Index in the error_description list for "limit_min" + type(ids_signal_flt_1d) :: force !Force (positive when upwards for a vertical force, positive when outwards for a radial force) + end type + + type :: ids_pf_circuits + character(len=ids_string_length), dimension(:), pointer :: name => null() !Name of the circuit + character(len=ids_string_length), dimension(:), pointer :: identifier => null() !ID of the circuit + character(len=ids_string_length), dimension(:), pointer :: type => null() !Type of the circuit + integer(ids_int), pointer :: connections(:,:) => null() !Description of the supplies and coils connections (nodes) across the circuit. Nodes of the circuit are listed as the first dimensi! + !on of the matrix. Supplies (listed first) and coils (listed second) SIDES are listed as the second dimension. Thus the second dime! + !nsion has a size equal to 2*(N_supplies+N_coils). N_supplies (resp. N_coils) is the total number of supplies (resp. coils) listed ! + !in the supply (resp.coil) array of structure, i.e. including also supplies/coils that are not part of the actual circuit. The (i,j! + !) matrix elements are 1 if the j-th supply or coil side is connected to the i-th node, or 0 otherwise. For coils, sides are listed! + ! so that a current flowing from side 1 to side 2 (inside the coil) is positive (i.e. counter-clockwise when seen from above). + type(ids_signal_flt_1d) :: voltage !Voltage on the circuit between the sides of the group of supplies (only for circuits with a single supply or in which supplies are! + ! grouped) + type(ids_signal_flt_1d) :: current !Current in the circuit between the sides of the group of supplies (only for circuits with a single supply or in which supplies are! + ! grouped) + end type + + type :: ids_pf_supplies + character(len=ids_string_length), dimension(:), pointer :: name => null() !Name of the PF supply + character(len=ids_string_length), dimension(:), pointer :: identifier => null() !Identifier of the supply + integer(ids_int) :: type=ids_int_invalid !Type of the supply; TBD add free description of non-linear power supplies + real(ids_real) :: resistance=ids_real_invalid !Power supply internal resistance + real(ids_real) :: resistance_error_upper=ids_real_invalid !Upper error for "resistance" + real(ids_real) :: resistance_error_lower=ids_real_invalid !Lower error for "resistance" + integer(ids_int) :: resistance_error_index=ids_int_invalid !Index in the error_description list for "resistance" + real(ids_real) :: delay=ids_real_invalid !Pure delay in the supply + real(ids_real) :: delay_error_upper=ids_real_invalid !Upper error for "delay" + real(ids_real) :: delay_error_lower=ids_real_invalid !Lower error for "delay" + integer(ids_int) :: delay_error_index=ids_int_invalid !Index in the error_description list for "delay" + real(ids_real), pointer :: filter_numerator(:) => null() !Coefficients of the numerator, in increasing order : a0 + a1*s + ... + an*s^n; used for a linear supply description + real(ids_real), pointer :: filter_numerator_error_upper(:) => null() !Upper error for "filter_numerator" + real(ids_real), pointer :: filter_numerator_error_lower(:) => null() !Lower error for "filter_numerator" + integer(ids_int) :: filter_numerator_error_index=ids_int_invalid !Index in the error_description list for "filter_numerator" + real(ids_real), pointer :: filter_denominator(:) => null() !Coefficients of the denominator, in increasing order : b0 + b1*s + ... + bm*s^m; used for a linear supply description + real(ids_real), pointer :: filter_denominator_error_upper(:) => null() !Upper error for "filter_denominator" + real(ids_real), pointer :: filter_denominator_error_lower(:) => null() !Lower error for "filter_denominator" + integer(ids_int) :: filter_denominator_error_index=ids_int_invalid !Index in the error_description list for "filter_denominator" + real(ids_real) :: current_limit_max=ids_real_invalid !Maximum current in the supply + real(ids_real) :: current_limit_min=ids_real_invalid !Minimum current in the supply + real(ids_real) :: voltage_limit_max=ids_real_invalid !Maximum voltage from the supply + real(ids_real) :: voltage_limit_min=ids_real_invalid !Minimum voltage from the supply + real(ids_real) :: current_limiter_gain=ids_real_invalid !Gain to prevent overcurrent in a linear model of the supply + real(ids_real) :: current_limiter_gain_error_upper=ids_real_invalid !Upper error for "current_limiter_gain" + real(ids_real) :: current_limiter_gain_error_lower=ids_real_invalid !Lower error for "current_limiter_gain" + integer(ids_int) :: current_limiter_gain_error_index=ids_int_invalid !Index in the error_description list for "current_limiter_gain" + real(ids_real) :: energy_limit_max=ids_real_invalid !Maximum energy to be dissipated in the supply during a pulse + character(len=ids_string_length), dimension(:), pointer :: nonlinear_model => null() !Description of the nonlinear transfer function of the supply + type(ids_signal_flt_1d) :: voltage !Voltage at the supply output (Vside1-Vside2) + type(ids_signal_flt_1d) :: current !Current at the supply output, defined positive if it flows from point 1 to point 2 in the circuit connected to the supply (outside! + ! the supply) + end type + + + ! *********** pf_active IDS + type, extends(IDS_base) :: ids_pf_active !Description of the axisymmetric active poloidal field (PF) coils and supplies; includes the limits of these systems; includes the ! + !forces on them; does not include non-axisymmetric coil systems + logical, private :: c_data = .FALSE. ! Fortran specific metadata telling whether the IDS has been populated from C allocated data (LL) or not + integer, private :: max_occurrence = 3! Maximum occurrence allowed as defined in the DD + + type(ids_ids_properties) :: ids_properties !Interface Data Structure properties. This element identifies the node above as an IDS + type(ids_pf_coils), pointer :: coil(:) => null() !Active PF coils + type(ids_pf_forces), pointer :: vertical_force(:) => null() !Vertical forces on the axisymmetric PF coil system + type(ids_pf_forces), pointer :: radial_force(:) => null() !Radial forces on the axisymmetric PF coil system + type(ids_pf_circuits), pointer :: circuit(:) => null() !Circuits, connecting multiple PF coils to multiple supplies, defining the current and voltage relationships in the system + type(ids_pf_supplies), pointer :: supply(:) => null() !PF power supplies + real(ids_real) :: latency=ids_real_invalid !Upper bound of the delay between input command received from the RT network and actuator starting to react. Applies globally to th! + !e system described by this IDS unless specific latencies (e.g. channel-specific or antenna-specific) are provided at a deeper leve! + !l in the IDS structure. + real(ids_real) :: latency_error_upper=ids_real_invalid !Upper error for "latency" + real(ids_real) :: latency_error_lower=ids_real_invalid !Lower error for "latency" + integer(ids_int) :: latency_error_index=ids_int_invalid !Index in the error_description list for "latency" + type(ids_code) :: code !Generic decription of the code-specific parameters for the code that has produced this IDS + real(ids_real), pointer :: time(:) => null() !Generic time + end type + + ! *********** pf_passive IDS internal structures declaration + + type :: ids_pf_passive_loops + character(len=ids_string_length), dimension(:), pointer :: name => null() !Name of the loop + real(ids_real) :: resistance=ids_real_invalid !Passive loop resistance + real(ids_real) :: resistance_error_upper=ids_real_invalid !Upper error for "resistance" + real(ids_real) :: resistance_error_lower=ids_real_invalid !Lower error for "resistance" + integer(ids_int) :: resistance_error_index=ids_int_invalid !Index in the error_description list for "resistance" + real(ids_real) :: resistivity=ids_real_invalid !Passive loop resistivity + real(ids_real) :: resistivity_error_upper=ids_real_invalid !Upper error for "resistivity" + real(ids_real) :: resistivity_error_lower=ids_real_invalid !Lower error for "resistivity" + integer(ids_int) :: resistivity_error_index=ids_int_invalid !Index in the error_description list for "resistivity" + type(ids_pf_coils_elements), pointer :: element(:) => null() !Each loop is comprised of a number of cross-section elements described individually + real(ids_real), pointer :: current(:) => null() !Passive loop current + real(ids_real), pointer :: current_error_upper(:) => null() !Upper error for "current" + real(ids_real), pointer :: current_error_lower(:) => null() !Lower error for "current" + integer(ids_int) :: current_error_index=ids_int_invalid !Index in the error_description list for "current" + real(ids_real), pointer :: time(:) => null() !Timebase for the dynamic nodes of this loop located at this level of the IDS structure + end type + + + ! *********** pf_passive IDS + type, extends(IDS_base) :: ids_pf_passive !Description of the axisymmetric passive conductors, currents flowing in them + logical, private :: c_data = .FALSE. ! Fortran specific metadata telling whether the IDS has been populated from C allocated data (LL) or not + integer, private :: max_occurrence = 3! Maximum occurrence allowed as defined in the DD + + type(ids_ids_properties) :: ids_properties !Interface Data Structure properties. This element identifies the node above as an IDS + type(ids_pf_passive_loops), pointer :: loop(:) => null() !Passive axisymmetric conductor description in the form of non-connected loops; any connected loops are expressed as active coil ci! + !rcuits with no power supply attached. + type(ids_code) :: code !Generic decription of the code-specific parameters for the code that has produced this IDS + real(ids_real), pointer :: time(:) => null() !Generic time + end type + + ! *********** plasma_initiation IDS internal structures declaration + + type :: ids_plasma_initiation_global_quantities + real(ids_real), pointer :: b_field_stray(:) => null() !Stray magnetic field at plasma position + real(ids_real), pointer :: b_field_stray_error_upper(:) => null() !Upper error for "b_field_stray" + real(ids_real), pointer :: b_field_stray_error_lower(:) => null() !Lower error for "b_field_stray" + integer(ids_int) :: b_field_stray_error_index=ids_int_invalid !Index in the error_description list for "b_field_stray" + real(ids_real), pointer :: b_field_perpendicular(:) => null() !Perpendicular magnetic field at plasma position. b_field_perpendicular = sqrt(b_field_stray^2+b_field_eddy^2) + real(ids_real), pointer :: b_field_perpendicular_error_upper(:) => null() !Upper error for "b_field_perpendicular" + real(ids_real), pointer :: b_field_perpendicular_error_lower(:) => null() !Lower error for "b_field_perpendicular" + integer(ids_int) :: b_field_perpendicular_error_index=ids_int_invalid !Index in the error_description list for "b_field_perpendicular" + real(ids_real), pointer :: connection_length(:) => null() !Average length of open magnetic field lines. In the case of fully closed field lines, connection_length = 1 + real(ids_real), pointer :: connection_length_error_upper(:) => null() !Upper error for "connection_length" + real(ids_real), pointer :: connection_length_error_lower(:) => null() !Lower error for "connection_length" + integer(ids_int) :: connection_length_error_index=ids_int_invalid !Index in the error_description list for "connection_length" + real(ids_real), pointer :: coulomb_logarithm(:) => null() !Coulomb logarithm + real(ids_real), pointer :: coulomb_logarithm_error_upper(:) => null() !Upper error for "coulomb_logarithm" + real(ids_real), pointer :: coulomb_logarithm_error_lower(:) => null() !Lower error for "coulomb_logarithm" + integer(ids_int) :: coulomb_logarithm_error_index=ids_int_invalid !Index in the error_description list for "coulomb_logarithm" + end type + + type :: ids_plasma_initiation_field_lines + type(ids_identifier_dynamic_aos3) :: grid_type !Selection of one of a set of grid types + type(ids_equilibrium_profiles_2d_grid) :: grid !Definition of the 2D grid (the content of dim1 and dim2 is defined by the selected grid_type) + type(ids_rz1d_dynamic_aos) :: townsend_or_closed_positions !List of all R, Z positions along all field lines encoutering Townsend condition or being closed field lines + type(ids_rz1d_dynamic_aos) :: townsend_or_closed_grid_positions !List of all R, Z grid positions (from ../grid) containing field lines encoutering Townsend condition or being closed field lines + type(ids_rz1d_dynamic_aos) :: starting_positions !Starting position to initiate field line tracing, for each field line + real(ids_real), pointer :: e_field_townsend(:) => null() !Townsend electric field along each field line + real(ids_real), pointer :: e_field_townsend_error_upper(:) => null() !Upper error for "e_field_townsend" + real(ids_real), pointer :: e_field_townsend_error_lower(:) => null() !Lower error for "e_field_townsend" + integer(ids_int) :: e_field_townsend_error_index=ids_int_invalid !Index in the error_description list for "e_field_townsend" + real(ids_real), pointer :: e_field_parallel(:) => null() !Parallel electric field along each field line + real(ids_real), pointer :: e_field_parallel_error_upper(:) => null() !Upper error for "e_field_parallel" + real(ids_real), pointer :: e_field_parallel_error_lower(:) => null() !Lower error for "e_field_parallel" + integer(ids_int) :: e_field_parallel_error_index=ids_int_invalid !Index in the error_description list for "e_field_parallel" + real(ids_real), pointer :: lengths(:) => null() !Length of each field line + real(ids_real), pointer :: lengths_error_upper(:) => null() !Upper error for "lengths" + real(ids_real), pointer :: lengths_error_lower(:) => null() !Lower error for "lengths" + integer(ids_int) :: lengths_error_index=ids_int_invalid !Index in the error_description list for "lengths" + real(ids_real) :: pressure=ids_real_invalid !Prefill gas pressure used in Townsend E field calculation + real(ids_real) :: pressure_error_upper=ids_real_invalid !Upper error for "pressure" + real(ids_real) :: pressure_error_lower=ids_real_invalid !Lower error for "pressure" + integer(ids_int) :: pressure_error_index=ids_int_invalid !Index in the error_description list for "pressure" + real(ids_real) :: open_fraction=ids_real_invalid !Fraction of open field lines : ratio open fields lines / (open+closed field lines) + real(ids_real) :: open_fraction_error_upper=ids_real_invalid !Upper error for "open_fraction" + real(ids_real) :: open_fraction_error_lower=ids_real_invalid !Lower error for "open_fraction" + integer(ids_int) :: open_fraction_error_index=ids_int_invalid !Index in the error_description list for "open_fraction" + real(ids_real) :: time=ids_real_invalid !Time + end type + + + ! *********** plasma_initiation IDS + type, extends(IDS_base) :: ids_plasma_initiation !Description the early phases of the plasma, before an equilibrium can be calculated + logical, private :: c_data = .FALSE. ! Fortran specific metadata telling whether the IDS has been populated from C allocated data (LL) or not + integer, private :: max_occurrence = 1! Maximum occurrence allowed as defined in the DD + + type(ids_ids_properties) :: ids_properties !Interface Data Structure properties. This element identifies the node above as an IDS + type(ids_plasma_initiation_global_quantities) :: global_quantities !Global quantities + type(ids_plasma_initiation_field_lines), pointer :: b_field_lines(:) => null() !Magnetic field line tracing results, given at various time slices + type(ids_code) :: code !Generic decription of the code-specific parameters for the code that has produced this IDS + real(ids_real), pointer :: time(:) => null() !Generic time + end type + + ! *********** polarimeter IDS internal structures declaration + + type :: ids_polarimeter_channel + character(len=ids_string_length), dimension(:), pointer :: name => null() !Name of the channel + character(len=ids_string_length), dimension(:), pointer :: identifier => null() !ID of the channel + type(ids_line_of_sight_3points) :: line_of_sight !Description of the line of sight of the channel, defined by two points when the beam is not reflected, a third point is added to d! + !efine the reflected beam path + real(ids_real) :: wavelength=ids_real_invalid !Wavelength used for polarimetry + real(ids_real) :: wavelength_error_upper=ids_real_invalid !Upper error for "wavelength" + real(ids_real) :: wavelength_error_lower=ids_real_invalid !Lower error for "wavelength" + integer(ids_int) :: wavelength_error_index=ids_int_invalid !Index in the error_description list for "wavelength" + real(ids_real) :: polarisation_initial=ids_real_invalid !Initial polarisation vector before entering the plasma + real(ids_real) :: polarisation_initial_error_upper=ids_real_invalid !Upper error for "polarisation_initial" + real(ids_real) :: polarisation_initial_error_lower=ids_real_invalid !Lower error for "polarisation_initial" + integer(ids_int) :: polarisation_initial_error_index=ids_int_invalid !Index in the error_description list for "polarisation_initial" + real(ids_real) :: ellipticity_initial=ids_real_invalid !Initial ellipticity before entering the plasma + real(ids_real) :: ellipticity_initial_error_upper=ids_real_invalid !Upper error for "ellipticity_initial" + real(ids_real) :: ellipticity_initial_error_lower=ids_real_invalid !Lower error for "ellipticity_initial" + integer(ids_int) :: ellipticity_initial_error_index=ids_int_invalid !Index in the error_description list for "ellipticity_initial" + type(ids_signal_flt_1d_validity) :: faraday_angle !Faraday angle (variation of the Faraday angle induced by crossing the plasma) + type(ids_signal_flt_1d_validity) :: ellipticity !Ellipticity + end type + + + ! *********** polarimeter IDS + type, extends(IDS_base) :: ids_polarimeter !Polarimeter diagnostic + logical, private :: c_data = .FALSE. ! Fortran specific metadata telling whether the IDS has been populated from C allocated data (LL) or not + integer, private :: max_occurrence = 2! Maximum occurrence allowed as defined in the DD + + type(ids_ids_properties) :: ids_properties !Interface Data Structure properties. This element identifies the node above as an IDS + type(ids_polarimeter_channel), pointer :: channel(:) => null() !Set of channels (lines-of-sight) + real(ids_real) :: latency=ids_real_invalid !Upper bound of the delay between physical information received by the detector and data available on the real-time (RT) network. + real(ids_real) :: latency_error_upper=ids_real_invalid !Upper error for "latency" + real(ids_real) :: latency_error_lower=ids_real_invalid !Lower error for "latency" + integer(ids_int) :: latency_error_index=ids_int_invalid !Index in the error_description list for "latency" + type(ids_code) :: code !Generic decription of the code-specific parameters for the code that has produced this IDS + real(ids_real), pointer :: time(:) => null() !Generic time + end type + + ! *********** pulse_schedule IDS internal structures declaration + + type :: ids_pulse_schedule_reference + character(len=ids_string_length), dimension(:), pointer :: reference_name => null() !Reference name (e.g. in the native pulse schedule system of the device) + type(ids_signal_flt_1d) :: reference !Reference waveform. Caution : error bars of the reference/data node are not used in the usual sense, instead they are used to desc! + !ribe the control envelope, with a meaning depending on the chosen envelope_type option. + integer(ids_int) :: reference_type=ids_int_invalid !Reference type: 0:relative (don't use for the moment, to be defined later when segments are introduced in the IDS structure); 1: ! + !absolute: the reference time trace is provided in the reference/data node + integer(ids_int) :: envelope_type=ids_int_invalid !Envelope type: 0:relative: means that the envelope upper and lower bound values are defined respectively as reference.data * refe! + !rence.data_error_upper and reference.data * reference.data_error_lower. 1: absolute: the envelope upper and lower bound values are! + ! given respectively by reference/data_error_upper and reference/data_error_lower. Lower are upper are taken in the strict mathemat! + !ical sense, without considering absolute values of the data + end type + + type :: ids_pulse_schedule_ic_antenna + character(len=ids_string_length), dimension(:), pointer :: name => null() !Name of the antenna + character(len=ids_string_length), dimension(:), pointer :: identifier => null() !Identifier of the antenna + type(ids_identifier_static) :: power_type !Type of power used in the sibling power node (defining which power is referred to in this pulse_schedule). Index = 1: power_launch! + !ed, 2: power_forward (see definitions in the ic_antennas IDS) + type(ids_pulse_schedule_reference) :: power !Power + type(ids_pulse_schedule_reference) :: phase !Phase + type(ids_pulse_schedule_reference) :: frequency !Frequency + end type + + type :: ids_pulse_schedule_ic + type(ids_pulse_schedule_ic_antenna), pointer :: antenna(:) => null() !Set of ICRH antennas + type(ids_signal_int_1d) :: mode !Control mode (operation mode and/or settings used by the controller) + end type + + type :: ids_pulse_schedule_ec_antenna + character(len=ids_string_length), dimension(:), pointer :: name => null() !Name of the launcher + character(len=ids_string_length), dimension(:), pointer :: identifier => null() !Identifier of the launcher + type(ids_pulse_schedule_reference) :: power !Power launched from this launcher into the vacuum vessel + type(ids_pulse_schedule_reference) :: frequency !Frequency + type(ids_pulse_schedule_reference) :: deposition_rho_tor_norm !Normalised toroidal flux coordinate at which the main deposition should occur + type(ids_pulse_schedule_reference) :: steering_angle_pol !Steering angle of the EC beam in the R,Z plane (from the -R axis towards the -Z axis), angle_pol=atan2(-k_Z,-k_R), where k_Z and k! + !_R are the Z and R components of the mean wave vector in the EC beam + type(ids_pulse_schedule_reference) :: steering_angle_tor !Steering angle of the EC beam away from the poloidal plane that is increasing towards the positive phi axis, angle_tor=arcsin(k_ph! + !i/k), where k_phi is the component of the wave vector in the phi direction and k is the length of the wave vector. Here the term w! + !ave vector refers to the mean wave vector in the EC beam + end type + + type :: ids_pulse_schedule_ec + type(ids_pulse_schedule_ec_antenna), pointer :: launcher(:) => null() !Set of ECRH launchers + type(ids_signal_int_1d) :: mode !Control mode (operation mode and/or settings used by the controller) + type(ids_pulse_schedule_reference) :: power !Total EC power (sum over the launchers) + end type + + type :: ids_pulse_schedule_lh_antenna + character(len=ids_string_length), dimension(:), pointer :: name => null() !Name of the antenna + character(len=ids_string_length), dimension(:), pointer :: identifier => null() !Identifier of the antenna + type(ids_identifier_static) :: power_type !Type of power used in the sibling power node (defining which power is referred to in this pulse_schedule). Index = 1: power_launch! + !ed, 2: power_forward (see definitions in the lh_antennas IDS) + type(ids_pulse_schedule_reference) :: power !Power + type(ids_pulse_schedule_reference) :: phase !Phasing between neighbour waveguides (in the toroidal direction) + type(ids_pulse_schedule_reference) :: n_parallel !Main parallel refractive index of the injected wave power spectrum + type(ids_pulse_schedule_reference) :: frequency !Frequency + end type + + type :: ids_pulse_schedule_lh + type(ids_pulse_schedule_lh_antenna), pointer :: antenna(:) => null() !Set of LH antennas + type(ids_signal_int_1d) :: mode !Control mode (operation mode and/or settings used by the controller) + end type + + type :: ids_pulse_schedule_nbi_unit + character(len=ids_string_length), dimension(:), pointer :: name => null() !Name of the NBI unit + character(len=ids_string_length), dimension(:), pointer :: identifier => null() !Identifier of the NBI unit + type(ids_gas_mixture_constant), pointer :: species(:) => null() !Species injected by the NBI unit (may be more than one in case the unit injects a gas mixture) + type(ids_pulse_schedule_reference) :: power !Power launched from this unit into the vacuum vessel + type(ids_pulse_schedule_reference) :: energy !Full energy of the injected species (acceleration of a single atom) + end type + + type :: ids_pulse_schedule_nbi + type(ids_pulse_schedule_nbi_unit), pointer :: unit(:) => null() !Set of NBI units + type(ids_signal_int_1d) :: mode !Control mode (operation mode and/or settings used by the controller) + type(ids_pulse_schedule_reference) :: power !Total NBI power (sum over the units) + end type + + type :: ids_pulse_schedule_density_control_valve + character(len=ids_string_length), dimension(:), pointer :: name => null() !Name of the valve + character(len=ids_string_length), dimension(:), pointer :: identifier => null() !Identifier of the valve + type(ids_pulse_schedule_reference) :: flow_rate !Flow rate of the valve + type(ids_gas_mixture_constant), pointer :: species(:) => null() !Species injected by the valve (may be more than one in case the valve injects a gas mixture) + end type + + type :: ids_pulse_schedule_density_control_ion + type(ids_plasma_composition_neutral_element_constant), pointer :: element(:) => null() !List of elements forming the atom or molecule + real(ids_real) :: z_ion=ids_real_invalid !Ion charge + real(ids_real) :: z_ion_error_upper=ids_real_invalid !Upper error for "z_ion" + real(ids_real) :: z_ion_error_lower=ids_real_invalid !Lower error for "z_ion" + integer(ids_int) :: z_ion_error_index=ids_int_invalid !Index in the error_description list for "z_ion" + character(len=ids_string_length), dimension(:), pointer :: label => null() !String identifying ion (e.g. H, D, T, He, C, D2, ...) + type(ids_pulse_schedule_reference) :: n_i_volume_average !Volume averaged ion density (average over the plasma volume up to the LCFS) + end type + + type :: ids_pulse_schedule_density_control + type(ids_pulse_schedule_density_control_valve), pointer :: valve(:) => null() !Set of injection valves. Time-dependent + type(ids_pulse_schedule_reference) :: n_e_line !Line integrated electron density + type(ids_identifier_static) :: n_e_line_method !Method for n_e_line calculation : Index = 1: integral over a line of sight in the whole vacuum chamber, 2 : integral over a line o! + !f sight within the LCFS, 3 : integral of a 1D core profile over rho_tor_norm up to the LCFS + type(ids_line_of_sight_3points) :: n_e_line_of_sight !Description of the line of sight for calculating n_e, defined by two points when the beam is not reflected, a third point is added! + ! to define the reflected beam path + type(ids_pulse_schedule_reference) :: n_e_volume_average !Volume averaged electron density (average over the plasma volume up to the LCFS) + type(ids_pulse_schedule_reference) :: zeff !Line averaged effective charge + type(ids_identifier_static) :: zeff_method !Method for zeff calculation : Index = 1: average over a line of sight in the whole vacuum chamber, 2 : average over a line of sigh! + !t within the LCFS, 3 : average of a 1D core profile over rho_tor_norm up to the LCFS + type(ids_line_of_sight_3points) :: zeff_line_of_sight !Description of the line of sight for calculating zeff, defined by two points when the beam is not reflected, a third point is adde! + !d to define the reflected beam path + type(ids_pulse_schedule_reference) :: n_t_over_n_d !Average ratio of tritium over deuterium density + type(ids_pulse_schedule_reference) :: n_h_over_n_d !Average ratio of hydrogen over deuterium density + type(ids_signal_int_1d) :: mode !Control mode (operation mode and/or settings used by the controller) + type(ids_pulse_schedule_density_control_ion), pointer :: ion(:) => null() !Quantities related to the different ion species, in the sense of isonuclear or isomolecular sequences + end type + + type :: ids_pulse_schedule_event + type(ids_identifier) :: type !Type of this event + character(len=ids_string_length), dimension(:), pointer :: identifier => null() !Unique identifier of this event provided by the scheduling / event handler + real(ids_real) :: time_stamp=ids_real_invalid !Time stamp of this event + real(ids_real) :: time_stamp_error_upper=ids_real_invalid !Upper error for "time_stamp" + real(ids_real) :: time_stamp_error_lower=ids_real_invalid !Lower error for "time_stamp" + integer(ids_int) :: time_stamp_error_index=ids_int_invalid !Index in the error_description list for "time_stamp" + real(ids_real) :: duration=ids_real_invalid !Duration of this event + real(ids_real) :: duration_error_upper=ids_real_invalid !Upper error for "duration" + real(ids_real) :: duration_error_lower=ids_real_invalid !Lower error for "duration" + integer(ids_int) :: duration_error_index=ids_int_invalid !Index in the error_description list for "duration" + type(ids_identifier) :: acquisition_strategy !Acquisition strategy related to this event: index = 1 : on-trigger; index = 2 : pre-trigger; index = 3 : post-trigger + type(ids_identifier) :: acquisition_state !Acquisition state of the related system : index = 1 : armed; index = 2 : on; index = 3 : off; index = 4 : closed + character(len=ids_string_length), dimension(:), pointer :: provider => null() !System having generated this event + character(len=ids_string_length), dimension(:), pointer :: listeners => null() !Systems listening to this event + end type + + type :: ids_pulse_schedule_flux_control + type(ids_pulse_schedule_reference) :: i_plasma !Plasma current + type(ids_pulse_schedule_reference) :: loop_voltage !Loop voltage + type(ids_pulse_schedule_reference) :: li_3 !Internal inductance + type(ids_pulse_schedule_reference) :: beta_normal !Normalised toroidal beta, defined as 100 * beta_tor * a[m] * B0 [T] / ip [MA] + type(ids_signal_int_1d) :: mode !Control mode (operation mode and/or settings used by the controller) + end type + + type :: ids_pulse_schedule_pf_active_coil + character(len=ids_string_length), dimension(:), pointer :: name => null() !Name of the coil + character(len=ids_string_length), dimension(:), pointer :: identifier => null() !Identifier of the coil + type(ids_pulse_schedule_reference) :: current !Current fed in the coil (for 1 turn, to be multiplied by the number of turns to obtain the generated magnetic field), positive whe! + !n flowing from side 1 to side 2 of the coil (inside the coil), this numbering being made consistently with the convention that the! + ! current is counter-clockwise when seen from above. + type(ids_pulse_schedule_reference) :: resistance_additional !Additional resistance due to e.g. dynamically switchable resistors + end type + + type :: ids_pulse_schedule_pf_active_supply + character(len=ids_string_length), dimension(:), pointer :: name => null() !Name of the supply + character(len=ids_string_length), dimension(:), pointer :: identifier => null() !Identifier of the supply + type(ids_pulse_schedule_reference) :: voltage !Voltage at the supply output (Vside1-Vside2) + end type + + type :: ids_pulse_schedule_pf_active + type(ids_pulse_schedule_pf_active_coil), pointer :: coil(:) => null() !Set of poloidal field coils + type(ids_pulse_schedule_pf_active_supply), pointer :: supply(:) => null() !Set of PF power supplies + type(ids_signal_int_1d) :: mode !Control mode (operation mode and/or settings used by the controller) + end type + + type :: ids_pulse_schedule_rz + type(ids_pulse_schedule_reference) :: r !Major radius + type(ids_pulse_schedule_reference) :: z !Height + end type + + type :: ids_pulse_schedule_outline + type(ids_pulse_schedule_reference) :: r !Major radius + type(ids_pulse_schedule_reference) :: z !Height + end type + + type :: ids_pulse_schedule_gap + character(len=ids_string_length), dimension(:), pointer :: name => null() !Name of the gap + character(len=ids_string_length), dimension(:), pointer :: identifier => null() !Identifier of the gap + real(ids_real) :: r=ids_real_invalid !Major radius of the reference point + real(ids_real) :: r_error_upper=ids_real_invalid !Upper error for "r" + real(ids_real) :: r_error_lower=ids_real_invalid !Lower error for "r" + integer(ids_int) :: r_error_index=ids_int_invalid !Index in the error_description list for "r" + real(ids_real) :: z=ids_real_invalid !Height of the reference point + real(ids_real) :: z_error_upper=ids_real_invalid !Upper error for "z" + real(ids_real) :: z_error_lower=ids_real_invalid !Lower error for "z" + integer(ids_int) :: z_error_index=ids_int_invalid !Index in the error_description list for "z" + real(ids_real) :: angle=ids_real_invalid !Angle between the direction in which the gap is measured (in the poloidal cross-section) and the horizontal axis. + real(ids_real) :: angle_error_upper=ids_real_invalid !Upper error for "angle" + real(ids_real) :: angle_error_lower=ids_real_invalid !Lower error for "angle" + integer(ids_int) :: angle_error_index=ids_int_invalid !Index in the error_description list for "angle" + type(ids_pulse_schedule_reference) :: value !Value of the gap, i.e. distance between the reference point and the separatrix along the gap direction + end type + + type :: ids_pulse_schedule_position + type(ids_pulse_schedule_rz) :: magnetic_axis !Magnetic axis position + type(ids_pulse_schedule_rz) :: geometric_axis !RZ position of the geometric axis (defined as (Rmin+Rmax) / 2 and (Zmin+Zmax) / 2 of the boundary) + type(ids_pulse_schedule_reference) :: minor_radius !Minor radius of the plasma boundary (defined as (Rmax-Rmin) / 2 of the boundary) + type(ids_pulse_schedule_reference) :: elongation !Elongation of the plasma boundary + type(ids_pulse_schedule_reference) :: elongation_upper !Elongation (upper half w.r.t. geometric axis) of the plasma boundary + type(ids_pulse_schedule_reference) :: elongation_lower !Elongation (lower half w.r.t. geometric axis) of the plasma boundary + type(ids_pulse_schedule_reference) :: triangularity !Triangularity of the plasma boundary + type(ids_pulse_schedule_reference) :: triangularity_upper !Upper triangularity of the plasma boundary + type(ids_pulse_schedule_reference) :: triangularity_lower !Lower triangularity of the plasma boundary + type(ids_pulse_schedule_rz), pointer :: x_point(:) => null() !Array of X-points, for each of them the RZ position is given + type(ids_pulse_schedule_rz), pointer :: strike_point(:) => null() !Array of strike points, for each of them the RZ position is given + type(ids_pulse_schedule_rz) :: active_limiter_point !RZ position of the active limiter point (point of the plasma boundary in contact with the limiter) + type(ids_pulse_schedule_outline), pointer :: boundary_outline(:) => null() !Set of (R,Z) points defining the outline of the plasma boundary + type(ids_pulse_schedule_gap), pointer :: gap(:) => null() !Set of gaps, defined by a reference point and a direction. + type(ids_signal_int_1d) :: mode !Control mode (operation mode and/or settings used by the controller) + end type + + type :: ids_pulse_schedule_tf + type(ids_pulse_schedule_reference) :: b_field_tor_vacuum_r !Vacuum field times major radius in the toroidal field magnet. Positive sign means anti-clockwise when viewed from above + type(ids_signal_int_1d) :: mode !Control mode (operation mode and/or settings used by the controller) + end type + + + ! *********** pulse_schedule IDS + type, extends(IDS_base) :: ids_pulse_schedule !Description of Pulse Schedule, described by subsystems waveform references and an enveloppe around them. The controllers, pulse sc! + !hedule and SDN are defined in separate IDSs. All names and identifiers of subsystems appearing in the pulse_schedule must be ident! + !ical to those used in the IDSs describing the related subsystems. + logical, private :: c_data = .FALSE. ! Fortran specific metadata telling whether the IDS has been populated from C allocated data (LL) or not + integer, private :: max_occurrence = 1! Maximum occurrence allowed as defined in the DD + + type(ids_ids_properties) :: ids_properties !Interface Data Structure properties. This element identifies the node above as an IDS + type(ids_pulse_schedule_ic) :: ic !Ion cyclotron heating and current drive system + type(ids_pulse_schedule_ec) :: ec !Electron cyclotron heating and current drive system + type(ids_pulse_schedule_lh) :: lh !Lower Hybrid heating and current drive system + type(ids_pulse_schedule_nbi) :: nbi !Neutral beam heating and current drive system + type(ids_pulse_schedule_density_control) :: density_control !Gas injection system and density control references + type(ids_pulse_schedule_event), pointer :: event(:) => null() !List of events, either predefined triggers or events recorded during the pulse + type(ids_pulse_schedule_flux_control) :: flux_control !Magnetic flux control references + type(ids_pulse_schedule_pf_active) :: pf_active !Poloidal field coil references + type(ids_pulse_schedule_position) :: position_control !Plasma position and shape control references + type(ids_pulse_schedule_tf) :: tf !Toroidal field references + type(ids_code) :: code !Generic decription of the code-specific parameters for the code that has produced this IDS + real(ids_real), pointer :: time(:) => null() !Generic time + end type + + ! *********** radiation IDS internal structures declaration + + type :: ids_radiation_process_global_volume + real(ids_real) :: power=ids_real_invalid !Total power emitted by all species + real(ids_real) :: power_error_upper=ids_real_invalid !Upper error for "power" + real(ids_real) :: power_error_lower=ids_real_invalid !Lower error for "power" + integer(ids_int) :: power_error_index=ids_int_invalid !Index in the error_description list for "power" + real(ids_real) :: power_ion_total=ids_real_invalid !Total power emitted by all ion species + real(ids_real) :: power_ion_total_error_upper=ids_real_invalid !Upper error for "power_ion_total" + real(ids_real) :: power_ion_total_error_lower=ids_real_invalid !Lower error for "power_ion_total" + integer(ids_int) :: power_ion_total_error_index=ids_int_invalid !Index in the error_description list for "power_ion_total" + real(ids_real) :: power_neutral_total=ids_real_invalid !Total power emitted by all neutral species + real(ids_real) :: power_neutral_total_error_upper=ids_real_invalid !Upper error for "power_neutral_total" + real(ids_real) :: power_neutral_total_error_lower=ids_real_invalid !Lower error for "power_neutral_total" + integer(ids_int) :: power_neutral_total_error_index=ids_int_invalid !Index in the error_description list for "power_neutral_total" + real(ids_real) :: power_electrons=ids_real_invalid !Power emitted by electrons + real(ids_real) :: power_electrons_error_upper=ids_real_invalid !Upper error for "power_electrons" + real(ids_real) :: power_electrons_error_lower=ids_real_invalid !Lower error for "power_electrons" + integer(ids_int) :: power_electrons_error_index=ids_int_invalid !Index in the error_description list for "power_electrons" + end type + + type :: ids_radiation_process_global + type(ids_radiation_process_global_volume) :: inside_lcfs !Emissions from the core plasma, inside the last closed flux surface + type(ids_radiation_process_global_volume) :: inside_vessel !Total emissions inside the vacuum vessel + real(ids_real) :: time=ids_real_invalid !Time + end type + + type :: ids_radiation_process_profiles_1d_electrons + real(ids_real), pointer :: emissivity(:) => null() !Emissivity from this species + real(ids_real), pointer :: emissivity_error_upper(:) => null() !Upper error for "emissivity" + real(ids_real), pointer :: emissivity_error_lower(:) => null() !Lower error for "emissivity" + integer(ids_int) :: emissivity_error_index=ids_int_invalid !Index in the error_description list for "emissivity" + real(ids_real), pointer :: power_inside(:) => null() !Radiated power from inside the flux surface (volume integral of the emissivity inside the flux surface) + real(ids_real), pointer :: power_inside_error_upper(:) => null() !Upper error for "power_inside" + real(ids_real), pointer :: power_inside_error_lower(:) => null() !Lower error for "power_inside" + integer(ids_int) :: power_inside_error_index=ids_int_invalid !Index in the error_description list for "power_inside" + end type + + type :: ids_radiation_process_profiles_1d_ions_charge_states + real(ids_real) :: z_min=ids_real_invalid !Minimum Z of the charge state bundle + real(ids_real) :: z_min_error_upper=ids_real_invalid !Upper error for "z_min" + real(ids_real) :: z_min_error_lower=ids_real_invalid !Lower error for "z_min" + integer(ids_int) :: z_min_error_index=ids_int_invalid !Index in the error_description list for "z_min" + real(ids_real) :: z_max=ids_real_invalid !Maximum Z of the charge state bundle + real(ids_real) :: z_max_error_upper=ids_real_invalid !Upper error for "z_max" + real(ids_real) :: z_max_error_lower=ids_real_invalid !Lower error for "z_max" + integer(ids_int) :: z_max_error_index=ids_int_invalid !Index in the error_description list for "z_max" + character(len=ids_string_length), dimension(:), pointer :: label => null() !String identifying charge state (e.g. C+, C+2 , C+3, C+4, C+5, C+6, ...) + real(ids_real) :: vibrational_level=ids_real_invalid !Vibrational level (can be bundled) + real(ids_real) :: vibrational_level_error_upper=ids_real_invalid !Upper error for "vibrational_level" + real(ids_real) :: vibrational_level_error_lower=ids_real_invalid !Lower error for "vibrational_level" + integer(ids_int) :: vibrational_level_error_index=ids_int_invalid !Index in the error_description list for "vibrational_level" + character(len=ids_string_length), dimension(:), pointer :: vibrational_mode => null() !Vibrational mode of this state, e.g. "A_g". Need to define, or adopt a standard nomenclature. + character(len=ids_string_length), dimension(:), pointer :: electron_configuration => null() !Configuration of atomic orbitals of this state, e.g. 1s2-2s1 + real(ids_real), pointer :: emissivity(:) => null() !Emissivity from this species + real(ids_real), pointer :: emissivity_error_upper(:) => null() !Upper error for "emissivity" + real(ids_real), pointer :: emissivity_error_lower(:) => null() !Lower error for "emissivity" + integer(ids_int) :: emissivity_error_index=ids_int_invalid !Index in the error_description list for "emissivity" + real(ids_real), pointer :: power_inside(:) => null() !Radiated power from inside the flux surface (volume integral of the emissivity inside the flux surface) + real(ids_real), pointer :: power_inside_error_upper(:) => null() !Upper error for "power_inside" + real(ids_real), pointer :: power_inside_error_lower(:) => null() !Lower error for "power_inside" + integer(ids_int) :: power_inside_error_index=ids_int_invalid !Index in the error_description list for "power_inside" + end type + + type :: ids_radiation_process_profiles_1d_ions + type(ids_plasma_composition_neutral_element), pointer :: element(:) => null() !List of elements forming the atom or molecule + real(ids_real) :: z_ion=ids_real_invalid !Ion charge (of the dominant ionisation state; lumped ions are allowed) + real(ids_real) :: z_ion_error_upper=ids_real_invalid !Upper error for "z_ion" + real(ids_real) :: z_ion_error_lower=ids_real_invalid !Lower error for "z_ion" + integer(ids_int) :: z_ion_error_index=ids_int_invalid !Index in the error_description list for "z_ion" + character(len=ids_string_length), dimension(:), pointer :: label => null() !String identifying ion (e.g. H+, D+, T+, He+2, C+, ...) + integer(ids_int) :: neutral_index=ids_int_invalid !Index of the corresponding neutral species in the ../../neutral array + real(ids_real), pointer :: emissivity(:) => null() !Emissivity from this species + real(ids_real), pointer :: emissivity_error_upper(:) => null() !Upper error for "emissivity" + real(ids_real), pointer :: emissivity_error_lower(:) => null() !Lower error for "emissivity" + integer(ids_int) :: emissivity_error_index=ids_int_invalid !Index in the error_description list for "emissivity" + real(ids_real), pointer :: power_inside(:) => null() !Radiated power from inside the flux surface (volume integral of the emissivity inside the flux surface) + real(ids_real), pointer :: power_inside_error_upper(:) => null() !Upper error for "power_inside" + real(ids_real), pointer :: power_inside_error_lower(:) => null() !Lower error for "power_inside" + integer(ids_int) :: power_inside_error_index=ids_int_invalid !Index in the error_description list for "power_inside" + integer(ids_int) :: multiple_states_flag=ids_int_invalid !Multiple states calculation flag : 0-Only one state is considered; 1-Multiple states are considered and are described in the state! + ! structure + type(ids_radiation_process_profiles_1d_ions_charge_states), pointer :: state(:) => null() !Process terms related to the different charge states of the species (ionisation, energy, excitation, ...) + end type + + type :: ids_radiation_process_profiles_1d_neutral_state + character(len=ids_string_length), dimension(:), pointer :: label => null() !String identifying state + real(ids_real) :: vibrational_level=ids_real_invalid !Vibrational level (can be bundled) + real(ids_real) :: vibrational_level_error_upper=ids_real_invalid !Upper error for "vibrational_level" + real(ids_real) :: vibrational_level_error_lower=ids_real_invalid !Lower error for "vibrational_level" + integer(ids_int) :: vibrational_level_error_index=ids_int_invalid !Index in the error_description list for "vibrational_level" + character(len=ids_string_length), dimension(:), pointer :: vibrational_mode => null() !Vibrational mode of this state, e.g. "A_g". Need to define, or adopt a standard nomenclature. + type(ids_identifier_dynamic_aos3) :: neutral_type !Neutral type (if the considered state is a neutral), in terms of energy. ID =1: cold; 2: thermal; 3: fast; 4: NBI + character(len=ids_string_length), dimension(:), pointer :: electron_configuration => null() !Configuration of atomic orbitals of this state, e.g. 1s2-2s1 + real(ids_real), pointer :: emissivity(:) => null() !Emissivity from this species + real(ids_real), pointer :: emissivity_error_upper(:) => null() !Upper error for "emissivity" + real(ids_real), pointer :: emissivity_error_lower(:) => null() !Lower error for "emissivity" + integer(ids_int) :: emissivity_error_index=ids_int_invalid !Index in the error_description list for "emissivity" + real(ids_real), pointer :: power_inside(:) => null() !Radiated power from inside the flux surface (volume integral of the emissivity inside the flux surface) + real(ids_real), pointer :: power_inside_error_upper(:) => null() !Upper error for "power_inside" + real(ids_real), pointer :: power_inside_error_lower(:) => null() !Lower error for "power_inside" + integer(ids_int) :: power_inside_error_index=ids_int_invalid !Index in the error_description list for "power_inside" + end type + + type :: ids_radiation_process_profiles_1d_neutral + type(ids_plasma_composition_neutral_element), pointer :: element(:) => null() !List of elements forming the atom or molecule + character(len=ids_string_length), dimension(:), pointer :: label => null() !String identifying the neutral species (e.g. H, D, T, He, C, ...) + integer(ids_int) :: ion_index=ids_int_invalid !Index of the corresponding ion species in the ../../ion array + real(ids_real), pointer :: emissivity(:) => null() !Emissivity from this species + real(ids_real), pointer :: emissivity_error_upper(:) => null() !Upper error for "emissivity" + real(ids_real), pointer :: emissivity_error_lower(:) => null() !Lower error for "emissivity" + integer(ids_int) :: emissivity_error_index=ids_int_invalid !Index in the error_description list for "emissivity" + real(ids_real), pointer :: power_inside(:) => null() !Radiated power from inside the flux surface (volume integral of the emissivity inside the flux surface) + real(ids_real), pointer :: power_inside_error_upper(:) => null() !Upper error for "power_inside" + real(ids_real), pointer :: power_inside_error_lower(:) => null() !Lower error for "power_inside" + integer(ids_int) :: power_inside_error_index=ids_int_invalid !Index in the error_description list for "power_inside" + integer(ids_int) :: multiple_states_flag=ids_int_invalid !Multiple states calculation flag : 0-Only one state is considered; 1-Multiple states are considered and are described in the state! + ! structure + type(ids_radiation_process_profiles_1d_neutral_state), pointer :: state(:) => null() !Process terms related to the different charge states of the species (energy, excitation, ...) + end type + + type :: ids_radiation_process_profiles_1d + type(ids_core_radial_grid) :: grid !Radial grid + type(ids_radiation_process_profiles_1d_electrons) :: electrons !Processs terms related to electrons + real(ids_real), pointer :: emissivity_ion_total(:) => null() !Emissivity (summed over ion species) + real(ids_real), pointer :: emissivity_ion_total_error_upper(:) => null() !Upper error for "emissivity_ion_total" + real(ids_real), pointer :: emissivity_ion_total_error_lower(:) => null() !Lower error for "emissivity_ion_total" + integer(ids_int) :: emissivity_ion_total_error_index=ids_int_invalid !Index in the error_description list for "emissivity_ion_total" + real(ids_real), pointer :: power_inside_ion_total(:) => null() !Total power from ion species (summed over ion species) inside the flux surface (volume integral of the emissivity inside the flux! + ! surface) + real(ids_real), pointer :: power_inside_ion_total_error_upper(:) => null() !Upper error for "power_inside_ion_total" + real(ids_real), pointer :: power_inside_ion_total_error_lower(:) => null() !Lower error for "power_inside_ion_total" + integer(ids_int) :: power_inside_ion_total_error_index=ids_int_invalid !Index in the error_description list for "power_inside_ion_total" + real(ids_real), pointer :: emissivity_neutral_total(:) => null() !Emissivity (summed over neutral species) + real(ids_real), pointer :: emissivity_neutral_total_error_upper(:) => null() !Upper error for "emissivity_neutral_total" + real(ids_real), pointer :: emissivity_neutral_total_error_lower(:) => null() !Lower error for "emissivity_neutral_total" + integer(ids_int) :: emissivity_neutral_total_error_index=ids_int_invalid !Index in the error_description list for "emissivity_neutral_total" + real(ids_real), pointer :: power_inside_neutral_total(:) => null() !Total power from ion species (summed over neutral species) inside the flux surface (volume integral of the emissivity inside the f! + !lux surface) + real(ids_real), pointer :: power_inside_neutral_total_error_upper(:) => null() !Upper error for "power_inside_neutral_total" + real(ids_real), pointer :: power_inside_neutral_total_error_lower(:) => null() !Lower error for "power_inside_neutral_total" + integer(ids_int) :: power_inside_neutral_total_error_index=ids_int_invalid !Index in the error_description list for "power_inside_neutral_total" + type(ids_radiation_process_profiles_1d_ions), pointer :: ion(:) => null() !Process terms related to the different ion species + type(ids_radiation_process_profiles_1d_neutral), pointer :: neutral(:) => null() !Process terms related to the different neutral species + real(ids_real) :: time=ids_real_invalid !Time + end type + + type :: ids_radiation_process_ggd_electrons + type(ids_generic_grid_scalar), pointer :: emissivity(:) => null() !Emissivity from this species, on various grid subsets + end type + + type :: ids_radiation_process_ggd_ion_charge_states + real(ids_real) :: z_min=ids_real_invalid !Minimum Z of the charge state bundle + real(ids_real) :: z_min_error_upper=ids_real_invalid !Upper error for "z_min" + real(ids_real) :: z_min_error_lower=ids_real_invalid !Lower error for "z_min" + integer(ids_int) :: z_min_error_index=ids_int_invalid !Index in the error_description list for "z_min" + real(ids_real) :: z_max=ids_real_invalid !Maximum Z of the charge state bundle + real(ids_real) :: z_max_error_upper=ids_real_invalid !Upper error for "z_max" + real(ids_real) :: z_max_error_lower=ids_real_invalid !Lower error for "z_max" + integer(ids_int) :: z_max_error_index=ids_int_invalid !Index in the error_description list for "z_max" + character(len=ids_string_length), dimension(:), pointer :: label => null() !String identifying charge state (e.g. C+, C+2 , C+3, C+4, C+5, C+6, ...) + real(ids_real) :: vibrational_level=ids_real_invalid !Vibrational level (can be bundled) + real(ids_real) :: vibrational_level_error_upper=ids_real_invalid !Upper error for "vibrational_level" + real(ids_real) :: vibrational_level_error_lower=ids_real_invalid !Lower error for "vibrational_level" + integer(ids_int) :: vibrational_level_error_index=ids_int_invalid !Index in the error_description list for "vibrational_level" + character(len=ids_string_length), dimension(:), pointer :: vibrational_mode => null() !Vibrational mode of this state, e.g. "A_g". Need to define, or adopt a standard nomenclature. + character(len=ids_string_length), dimension(:), pointer :: electron_configuration => null() !Configuration of atomic orbitals of this state, e.g. 1s2-2s1 + type(ids_generic_grid_scalar), pointer :: emissivity(:) => null() !Emissivity from this state, on various grid subsets + end type + + type :: ids_radiation_process_ggd_ion + type(ids_plasma_composition_neutral_element), pointer :: element(:) => null() !List of elements forming the atom or molecule + real(ids_real) :: z_ion=ids_real_invalid !Ion charge (of the dominant ionisation state; lumped ions are allowed) + real(ids_real) :: z_ion_error_upper=ids_real_invalid !Upper error for "z_ion" + real(ids_real) :: z_ion_error_lower=ids_real_invalid !Lower error for "z_ion" + integer(ids_int) :: z_ion_error_index=ids_int_invalid !Index in the error_description list for "z_ion" + character(len=ids_string_length), dimension(:), pointer :: label => null() !String identifying ion (e.g. H+, D+, T+, He+2, C+, ...) + integer(ids_int) :: neutral_index=ids_int_invalid !Index of the corresponding neutral species in the ../../neutral array + type(ids_generic_grid_scalar), pointer :: emissivity(:) => null() !Emissivity from this species, on various grid subsets + integer(ids_int) :: multiple_states_flag=ids_int_invalid !Multiple states calculation flag : 0-Only one state is considered; 1-Multiple states are considered and are described in the state! + ! structure + type(ids_radiation_process_ggd_ion_charge_states), pointer :: state(:) => null() !Process terms related to the different charge states of the species (ionisation, energy, excitation, ...) + end type + + type :: ids_radiation_process_ggd_neutral_state + character(len=ids_string_length), dimension(:), pointer :: label => null() !String identifying state + real(ids_real) :: vibrational_level=ids_real_invalid !Vibrational level (can be bundled) + real(ids_real) :: vibrational_level_error_upper=ids_real_invalid !Upper error for "vibrational_level" + real(ids_real) :: vibrational_level_error_lower=ids_real_invalid !Lower error for "vibrational_level" + integer(ids_int) :: vibrational_level_error_index=ids_int_invalid !Index in the error_description list for "vibrational_level" + character(len=ids_string_length), dimension(:), pointer :: vibrational_mode => null() !Vibrational mode of this state, e.g. "A_g". Need to define, or adopt a standard nomenclature. + type(ids_identifier_dynamic_aos3) :: neutral_type !Neutral type (if the considered state is a neutral), in terms of energy. ID =1: cold; 2: thermal; 3: fast; 4: NBI + character(len=ids_string_length), dimension(:), pointer :: electron_configuration => null() !Configuration of atomic orbitals of this state, e.g. 1s2-2s1 + type(ids_generic_grid_scalar), pointer :: emissivity(:) => null() !Emissivity from this state, on various grid subsets + end type + + type :: ids_radiation_process_ggd_neutral + type(ids_plasma_composition_neutral_element), pointer :: element(:) => null() !List of elements forming the atom or molecule + character(len=ids_string_length), dimension(:), pointer :: label => null() !String identifying the neutral species (e.g. H, D, T, He, C, ...) + integer(ids_int) :: ion_index=ids_int_invalid !Index of the corresponding ion species in the ../../ion array + type(ids_generic_grid_scalar), pointer :: emissivity(:) => null() !Emissivity from this species, on various grid subsets + integer(ids_int) :: multiple_states_flag=ids_int_invalid !Multiple states calculation flag : 0-Only one state is considered; 1-Multiple states are considered and are described in the state! + ! structure + type(ids_radiation_process_ggd_neutral_state), pointer :: state(:) => null() !Process terms related to the different charge states of the species (energy, excitation, ...) + end type + + type :: ids_radiation_process_ggd + type(ids_radiation_process_ggd_electrons) :: electrons !Process terms related to electrons + type(ids_radiation_process_ggd_ion), pointer :: ion(:) => null() !Process terms related to the different ion species + type(ids_radiation_process_ggd_neutral), pointer :: neutral(:) => null() !Process terms related to the different neutral species + real(ids_real) :: time=ids_real_invalid !Time + end type + + type :: ids_radiation_process + type(ids_identifier) :: identifier !Process identifier + type(ids_radiation_process_global), pointer :: global_quantities(:) => null() !Scalar volume integrated quantities + type(ids_radiation_process_profiles_1d), pointer :: profiles_1d(:) => null() !Emissivity radial profiles for various time slices + type(ids_radiation_process_ggd), pointer :: ggd(:) => null() !Emissivities represented using the general grid description, for various time slices + end type + + + ! *********** radiation IDS + type, extends(IDS_base) :: ids_radiation !Radiation emitted by the plasma and neutrals + logical, private :: c_data = .FALSE. ! Fortran specific metadata telling whether the IDS has been populated from C allocated data (LL) or not + integer, private :: max_occurrence = 2! Maximum occurrence allowed as defined in the DD + + type(ids_ids_properties) :: ids_properties !Interface Data Structure properties. This element identifies the node above as an IDS + type(ids_b_tor_vacuum_1) :: vacuum_toroidal_field !Characteristics of the vacuum toroidal field (used in rho_tor definition) + type(ids_generic_grid_aos3_root), pointer :: grid_ggd(:) => null() !Grid (using the Generic Grid Description), for various time slices. The timebase of this array of structure must be a subset of th! + !e process/ggd timebases + type(ids_radiation_process), pointer :: process(:) => null() !Set of emission processes. The radiation characteristics are described at the level of the originating entity. For instance descri! + !be line radiation from neutrals under profiles_1d/neutral. Line and recombination radiation under profiles_1d/ion. Bremsstrahlung ! + !radiation under profiles_1d/neutral and ion ... + type(ids_code) :: code !Generic decription of the code-specific parameters for the code that has produced this IDS + real(ids_real), pointer :: time(:) => null() !Generic time + end type + + ! *********** real_time_data IDS internal structures declaration + + type :: ids_rtd_allocatable_signals + character(len=ids_string_length), dimension(:), pointer :: name => null() !Signal name + character(len=ids_string_length), dimension(:), pointer :: definition => null() !Signal definition + integer(ids_int) :: allocated_position=ids_int_invalid !Allocation of signal to a position in the SDN (1..N); this will be implementation specific + type(ids_signal_flt_1d) :: value !Signal value + type(ids_signal_int_1d) :: quality !Indicator of the quality of the signal. Following ITER PCS documentation (https://user.iter.org/?uid=354SJ3&action=get_document), ! + !possible values are: 1 - GOOD (the nominal state); 2 - INVALID (data no usable); 3 - DATA INTEGRITY ERROR (e.g. out of bounds with! + ! respect to expectations, calibration error,...) + end type + + type :: ids_rtd_topic + character(len=ids_string_length), dimension(:), pointer :: name => null() !Topic name + type(ids_rtd_allocatable_signals), pointer :: signal(:) => null() !List of signals that are allocated to the PCS interface + end type + + + ! *********** real_time_data IDS + type, extends(IDS_base) :: ids_real_time_data !Description of the data bus circulating on the real time data network of the machine. This is typically used (but not only) as an ! + !interface to the Plasma Control System (PCS) + logical, private :: c_data = .FALSE. ! Fortran specific metadata telling whether the IDS has been populated from C allocated data (LL) or not + integer, private :: max_occurrence = 3! Maximum occurrence allowed as defined in the DD + + type(ids_ids_properties) :: ids_properties !Interface Data Structure properties. This element identifies the node above as an IDS + type(ids_rtd_topic), pointer :: topic(:) => null() !List of topics. Signals are grouped by topic + type(ids_code) :: code !Generic decription of the code-specific parameters for the code that has produced this IDS + real(ids_real), pointer :: time(:) => null() !Generic time + end type + + ! *********** reflectometer_profile IDS internal structures declaration + + type :: ids_reflectometer_profile_position + real(ids_real), pointer :: r(:,:) => null() !Major radius + real(ids_real), pointer :: r_error_upper(:,:) => null() !Upper error for "r" + real(ids_real), pointer :: r_error_lower(:,:) => null() !Lower error for "r" + integer(ids_int) :: r_error_index=ids_int_invalid !Index in the error_description list for "r" + real(ids_real), pointer :: z(:,:) => null() !Height + real(ids_real), pointer :: z_error_upper(:,:) => null() !Upper error for "z" + real(ids_real), pointer :: z_error_lower(:,:) => null() !Lower error for "z" + integer(ids_int) :: z_error_index=ids_int_invalid !Index in the error_description list for "z" + real(ids_real), pointer :: phi(:,:) => null() !Toroidal angle (oriented counter-clockwise when viewing from above) + real(ids_real), pointer :: phi_error_upper(:,:) => null() !Upper error for "phi" + real(ids_real), pointer :: phi_error_lower(:,:) => null() !Lower error for "phi" + integer(ids_int) :: phi_error_index=ids_int_invalid !Index in the error_description list for "phi" + real(ids_real), pointer :: psi(:,:) => null() !Poloidal flux + real(ids_real), pointer :: psi_error_upper(:,:) => null() !Upper error for "psi" + real(ids_real), pointer :: psi_error_lower(:,:) => null() !Lower error for "psi" + integer(ids_int) :: psi_error_index=ids_int_invalid !Index in the error_description list for "psi" + real(ids_real), pointer :: rho_tor_norm(:,:) => null() !Normalised toroidal flux coordinate + real(ids_real), pointer :: rho_tor_norm_error_upper(:,:) => null() !Upper error for "rho_tor_norm" + real(ids_real), pointer :: rho_tor_norm_error_lower(:,:) => null() !Lower error for "rho_tor_norm" + integer(ids_int) :: rho_tor_norm_error_index=ids_int_invalid !Index in the error_description list for "rho_tor_norm" + real(ids_real), pointer :: theta(:,:) => null() !Poloidal angle (oriented clockwise when viewing the poloidal cross section on the right hand side of the tokamak axis of symmetry,! + ! with the origin placed on the plasma magnetic axis) + real(ids_real), pointer :: theta_error_upper(:,:) => null() !Upper error for "theta" + real(ids_real), pointer :: theta_error_lower(:,:) => null() !Lower error for "theta" + integer(ids_int) :: theta_error_index=ids_int_invalid !Index in the error_description list for "theta" + end type + + type :: ids_reflectometer_channel + character(len=ids_string_length), dimension(:), pointer :: name => null() !Name of the channel + character(len=ids_string_length), dimension(:), pointer :: identifier => null() !ID of the channel + character(len=ids_string_length), dimension(:), pointer :: mode => null() !Detection mode "X" or "O" + type(ids_line_of_sight_2points) :: line_of_sight_emission !Description of the line of sight of the emission antenna. The first point corresponds to the antenna mouth. The second point corre! + !spond to the interception of the line of sight with the reflection surface on the inner wall. + type(ids_line_of_sight_2points) :: line_of_sight_detection !Description of the line of sight of the detection antenna, to be filled only if its position is distinct from the emission antenna! + !. The first point corresponds to the antenna mouth. The second point correspond to the interception of the line of sight with the ! + !reflection surface on the inner wall. + real(ids_real) :: sweep_time=ids_real_invalid !Duration of a sweep + real(ids_real) :: sweep_time_error_upper=ids_real_invalid !Upper error for "sweep_time" + real(ids_real) :: sweep_time_error_lower=ids_real_invalid !Lower error for "sweep_time" + integer(ids_int) :: sweep_time_error_index=ids_int_invalid !Index in the error_description list for "sweep_time" + real(ids_real), pointer :: frequencies(:) => null() !Array of frequencies scanned during a sweep + real(ids_real), pointer :: frequencies_error_upper(:) => null() !Upper error for "frequencies" + real(ids_real), pointer :: frequencies_error_lower(:) => null() !Lower error for "frequencies" + integer(ids_int) :: frequencies_error_index=ids_int_invalid !Index in the error_description list for "frequencies" + type(ids_signal_flt_2d) :: phase !Measured phase of the probing wave for each frequency and time slice (corresponding to the begin time of a sweep), relative to the! + ! phase at launch + type(ids_reflectometer_profile_position) :: position !Position of the density measurements + type(ids_signal_flt_2d) :: n_e !Electron density + real(ids_real), pointer :: cut_off_frequency(:,:) => null() !Cut-off frequency as a function of measurement position and time + real(ids_real), pointer :: cut_off_frequency_error_upper(:,:) => null() !Upper error for "cut_off_frequency" + real(ids_real), pointer :: cut_off_frequency_error_lower(:,:) => null() !Lower error for "cut_off_frequency" + integer(ids_int) :: cut_off_frequency_error_index=ids_int_invalid !Index in the error_description list for "cut_off_frequency" + end type + + + ! *********** reflectometer_profile IDS + type, extends(IDS_base) :: ids_reflectometer_profile !Profile reflectometer diagnostic. Multiple reflectometers are considered as independent diagnostics to be handled with different o! + !ccurrence numbers + logical, private :: c_data = .FALSE. ! Fortran specific metadata telling whether the IDS has been populated from C allocated data (LL) or not + integer, private :: max_occurrence = 2! Maximum occurrence allowed as defined in the DD + + type(ids_ids_properties) :: ids_properties !Interface Data Structure properties. This element identifies the node above as an IDS + character(len=ids_string_length), dimension(:), pointer :: type => null() !Type of reflectometer (frequency_swept, radar, ...) + type(ids_reflectometer_channel), pointer :: channel(:) => null() !Set of channels, e.g. different reception antennas or frequency bandwidths of the reflectometer + type(ids_reflectometer_profile_position) :: position !Position associated to the density reconstruction from multiple channels + type(ids_signal_flt_2d) :: n_e !Electron density reconstructed from multiple channels + type(ids_psi_normalization) :: psi_normalization !Quantities to use to normalize psi, as a function of time + real(ids_real) :: latency=ids_real_invalid !Upper bound of the delay between physical information received by the detector and data available on the real-time (RT) network. + real(ids_real) :: latency_error_upper=ids_real_invalid !Upper error for "latency" + real(ids_real) :: latency_error_lower=ids_real_invalid !Lower error for "latency" + integer(ids_int) :: latency_error_index=ids_int_invalid !Index in the error_description list for "latency" + type(ids_code) :: code !Generic decription of the code-specific parameters for the code that has produced this IDS + real(ids_real), pointer :: time(:) => null() !Generic time + end type + + ! *********** refractometer IDS internal structures declaration + + type :: ids_refractometer_channel_bandwidth + real(ids_real) :: frequency_main=ids_real_invalid !Main frequency used to probe the plasma (before upshifting and modulating) + real(ids_real) :: frequency_main_error_upper=ids_real_invalid !Upper error for "frequency_main" + real(ids_real) :: frequency_main_error_lower=ids_real_invalid !Lower error for "frequency_main" + integer(ids_int) :: frequency_main_error_index=ids_int_invalid !Index in the error_description list for "frequency_main" + real(ids_real), pointer :: phase(:) => null() !Phase of the envelope of the probing signal, relative to the phase at launch + real(ids_real), pointer :: phase_error_upper(:) => null() !Upper error for "phase" + real(ids_real), pointer :: phase_error_lower(:) => null() !Lower error for "phase" + integer(ids_int) :: phase_error_index=ids_int_invalid !Index in the error_description list for "phase" + real(ids_real), pointer :: i_component(:,:) => null() !I component of the IQ detector used to retrieve the phase of signal's envelope, sampled on a high resolution time_detector grid ju! + !st before each measurement time slice represented by the ../time vector + real(ids_real), pointer :: i_component_error_upper(:,:) => null() !Upper error for "i_component" + real(ids_real), pointer :: i_component_error_lower(:,:) => null() !Lower error for "i_component" + integer(ids_int) :: i_component_error_index=ids_int_invalid !Index in the error_description list for "i_component" + real(ids_real), pointer :: q_component(:,:) => null() !Q component of the IQ detector used to retrieve the phase of signal's envelope, sampled on a high resolution time_detector grid ju! + !st before each measurement time slice represented by the ../time vector + real(ids_real), pointer :: q_component_error_upper(:,:) => null() !Upper error for "q_component" + real(ids_real), pointer :: q_component_error_lower(:,:) => null() !Lower error for "q_component" + integer(ids_int) :: q_component_error_index=ids_int_invalid !Index in the error_description list for "q_component" + type(ids_signal_flt_1d) :: n_e_line !Integral of the electron density along the line of sight, deduced from the envelope phase measurements + type(ids_signal_flt_2d) :: phase_quadrature !In-phase and Quadrature components of the analysed signal. They are returned by an IQ-detector, that takes carrying and reference ! + !signals as the input and yields I and Q components. These are respectively stored as the first and the second index of the first d! + !imension of the data child. + real(ids_real), pointer :: time_detector(:,:) => null() !High sampling timebase of the IQ-detector signal measurements + real(ids_real), pointer :: time_detector_error_upper(:,:) => null() !Upper error for "time_detector" + real(ids_real), pointer :: time_detector_error_lower(:,:) => null() !Lower error for "time_detector" + integer(ids_int) :: time_detector_error_index=ids_int_invalid !Index in the error_description list for "time_detector" + real(ids_real), pointer :: time(:) => null() !Timebase for this bandwidth + end type + + type :: ids_refractometer_shape_approximation + type(ids_identifier) :: formula !Analytical formula representing the electron density profile as a function of a radial coordinate and adjustable parameters f(rho_! + !tor_norm, alpha1, ... alphaN) + real(ids_real), pointer :: parameters(:,:) => null() !Values of the formula's parameters alpha1, ..., alphaN + real(ids_real), pointer :: parameters_error_upper(:,:) => null() !Upper error for "parameters" + real(ids_real), pointer :: parameters_error_lower(:,:) => null() !Lower error for "parameters" + integer(ids_int) :: parameters_error_index=ids_int_invalid !Index in the error_description list for "parameters" + end type + + type :: ids_refractometer_channel + character(len=ids_string_length), dimension(:), pointer :: name => null() !Name of the channel + character(len=ids_string_length), dimension(:), pointer :: identifier => null() !ID of the channel + character(len=ids_string_length), dimension(:), pointer :: mode => null() !Detection mode "X" or "O" + type(ids_line_of_sight_2points) :: line_of_sight !Description of the line of sight. The first point corresponds to the probing wave emission point. The second point corresponds to ! + !the probing wave detection point + type(ids_refractometer_channel_bandwidth), pointer :: bandwidth(:) => null() !Set of frequency bandwidths + type(ids_signal_flt_1d) :: n_e_line !Integral of the electron density along the line of sight, deduced from the envelope phase measurements + type(ids_refractometer_shape_approximation) :: n_e_profile_approximation !Approximation of the radial electron density profile with an array of parameters and an approximation formula, used by post-proces! + !sing programs for the identification of the electron density profile. + end type + + + ! *********** refractometer IDS + type, extends(IDS_base) :: ids_refractometer !Density profile refractometer diagnostic + logical, private :: c_data = .FALSE. ! Fortran specific metadata telling whether the IDS has been populated from C allocated data (LL) or not + integer, private :: max_occurrence = 2! Maximum occurrence allowed as defined in the DD + + type(ids_ids_properties) :: ids_properties !Interface Data Structure properties. This element identifies the node above as an IDS + character(len=ids_string_length), dimension(:), pointer :: type => null() !Type of refractometer (differential, impulse, ...) + type(ids_refractometer_channel), pointer :: channel(:) => null() !Set of channels, e.g. different reception antennas of the refractometer + real(ids_real) :: latency=ids_real_invalid !Upper bound of the delay between physical information received by the detector and data available on the real-time (RT) network. + real(ids_real) :: latency_error_upper=ids_real_invalid !Upper error for "latency" + real(ids_real) :: latency_error_lower=ids_real_invalid !Lower error for "latency" + integer(ids_int) :: latency_error_index=ids_int_invalid !Index in the error_description list for "latency" + type(ids_code) :: code !Generic decription of the code-specific parameters for the code that has produced this IDS + real(ids_real), pointer :: time(:) => null() !Generic time + end type + + ! *********** sawteeth IDS internal structures declaration + + type :: ids_sawteeth_profiles_1d + type(ids_core_radial_grid) :: grid !Radial grid + real(ids_real), pointer :: t_e(:) => null() !Electron temperature + real(ids_real), pointer :: t_e_error_upper(:) => null() !Upper error for "t_e" + real(ids_real), pointer :: t_e_error_lower(:) => null() !Lower error for "t_e" + integer(ids_int) :: t_e_error_index=ids_int_invalid !Index in the error_description list for "t_e" + real(ids_real), pointer :: t_i_average(:) => null() !Ion temperature (averaged on charge states and ion species) + real(ids_real), pointer :: t_i_average_error_upper(:) => null() !Upper error for "t_i_average" + real(ids_real), pointer :: t_i_average_error_lower(:) => null() !Lower error for "t_i_average" + integer(ids_int) :: t_i_average_error_index=ids_int_invalid !Index in the error_description list for "t_i_average" + real(ids_real), pointer :: n_e(:) => null() !Electron density (thermal+non-thermal) + real(ids_real), pointer :: n_e_error_upper(:) => null() !Upper error for "n_e" + real(ids_real), pointer :: n_e_error_lower(:) => null() !Lower error for "n_e" + integer(ids_int) :: n_e_error_index=ids_int_invalid !Index in the error_description list for "n_e" + real(ids_real), pointer :: n_e_fast(:) => null() !Density of fast (non-thermal) electrons + real(ids_real), pointer :: n_e_fast_error_upper(:) => null() !Upper error for "n_e_fast" + real(ids_real), pointer :: n_e_fast_error_lower(:) => null() !Lower error for "n_e_fast" + integer(ids_int) :: n_e_fast_error_index=ids_int_invalid !Index in the error_description list for "n_e_fast" + real(ids_real), pointer :: n_i_total_over_n_e(:) => null() !Ratio of total ion density (sum over species and charge states) over electron density. (thermal+non-thermal) + real(ids_real), pointer :: n_i_total_over_n_e_error_upper(:) => null() !Upper error for "n_i_total_over_n_e" + real(ids_real), pointer :: n_i_total_over_n_e_error_lower(:) => null() !Lower error for "n_i_total_over_n_e" + integer(ids_int) :: n_i_total_over_n_e_error_index=ids_int_invalid !Index in the error_description list for "n_i_total_over_n_e" + real(ids_real), pointer :: momentum_tor(:) => null() !Total plasma toroidal momentum, summed over ion species and electrons + real(ids_real), pointer :: momentum_tor_error_upper(:) => null() !Upper error for "momentum_tor" + real(ids_real), pointer :: momentum_tor_error_lower(:) => null() !Lower error for "momentum_tor" + integer(ids_int) :: momentum_tor_error_index=ids_int_invalid !Index in the error_description list for "momentum_tor" + real(ids_real), pointer :: zeff(:) => null() !Effective charge + real(ids_real), pointer :: zeff_error_upper(:) => null() !Upper error for "zeff" + real(ids_real), pointer :: zeff_error_lower(:) => null() !Lower error for "zeff" + integer(ids_int) :: zeff_error_index=ids_int_invalid !Index in the error_description list for "zeff" + real(ids_real), pointer :: p_e(:) => null() !Electron pressure + real(ids_real), pointer :: p_e_error_upper(:) => null() !Upper error for "p_e" + real(ids_real), pointer :: p_e_error_lower(:) => null() !Lower error for "p_e" + integer(ids_int) :: p_e_error_index=ids_int_invalid !Index in the error_description list for "p_e" + real(ids_real), pointer :: p_e_fast_perpendicular(:) => null() !Fast (non-thermal) electron perpendicular pressure + real(ids_real), pointer :: p_e_fast_perpendicular_error_upper(:) => null() !Upper error for "p_e_fast_perpendicular" + real(ids_real), pointer :: p_e_fast_perpendicular_error_lower(:) => null() !Lower error for "p_e_fast_perpendicular" + integer(ids_int) :: p_e_fast_perpendicular_error_index=ids_int_invalid !Index in the error_description list for "p_e_fast_perpendicular" + real(ids_real), pointer :: p_e_fast_parallel(:) => null() !Fast (non-thermal) electron parallel pressure + real(ids_real), pointer :: p_e_fast_parallel_error_upper(:) => null() !Upper error for "p_e_fast_parallel" + real(ids_real), pointer :: p_e_fast_parallel_error_lower(:) => null() !Lower error for "p_e_fast_parallel" + integer(ids_int) :: p_e_fast_parallel_error_index=ids_int_invalid !Index in the error_description list for "p_e_fast_parallel" + real(ids_real), pointer :: p_i_total(:) => null() !Total ion pressure (sum over the ion species) + real(ids_real), pointer :: p_i_total_error_upper(:) => null() !Upper error for "p_i_total" + real(ids_real), pointer :: p_i_total_error_lower(:) => null() !Lower error for "p_i_total" + integer(ids_int) :: p_i_total_error_index=ids_int_invalid !Index in the error_description list for "p_i_total" + real(ids_real), pointer :: p_i_total_fast_perpendicular(:) => null() !Fast (non-thermal) total ion (sum over the ion species) perpendicular pressure + real(ids_real), pointer :: p_i_total_fast_perpendicular_error_upper(:) => null() !Upper error for "p_i_total_fast_perpendicular" + real(ids_real), pointer :: p_i_total_fast_perpendicular_error_lower(:) => null() !Lower error for "p_i_total_fast_perpendicular" + integer(ids_int) :: p_i_total_fast_perpendicular_error_index=ids_int_invalid !Index in the error_description list for "p_i_total_fast_perpendicular" + real(ids_real), pointer :: p_i_total_fast_parallel(:) => null() !Fast (non-thermal) total ion (sum over the ion species) parallel pressure + real(ids_real), pointer :: p_i_total_fast_parallel_error_upper(:) => null() !Upper error for "p_i_total_fast_parallel" + real(ids_real), pointer :: p_i_total_fast_parallel_error_lower(:) => null() !Lower error for "p_i_total_fast_parallel" + integer(ids_int) :: p_i_total_fast_parallel_error_index=ids_int_invalid !Index in the error_description list for "p_i_total_fast_parallel" + real(ids_real), pointer :: pressure_thermal(:) => null() !Thermal pressure (electrons+ions) + real(ids_real), pointer :: pressure_thermal_error_upper(:) => null() !Upper error for "pressure_thermal" + real(ids_real), pointer :: pressure_thermal_error_lower(:) => null() !Lower error for "pressure_thermal" + integer(ids_int) :: pressure_thermal_error_index=ids_int_invalid !Index in the error_description list for "pressure_thermal" + real(ids_real), pointer :: pressure_perpendicular(:) => null() !Total perpendicular pressure (electrons+ions, thermal+non-thermal) + real(ids_real), pointer :: pressure_perpendicular_error_upper(:) => null() !Upper error for "pressure_perpendicular" + real(ids_real), pointer :: pressure_perpendicular_error_lower(:) => null() !Lower error for "pressure_perpendicular" + integer(ids_int) :: pressure_perpendicular_error_index=ids_int_invalid !Index in the error_description list for "pressure_perpendicular" + real(ids_real), pointer :: pressure_parallel(:) => null() !Total parallel pressure (electrons+ions, thermal+non-thermal) + real(ids_real), pointer :: pressure_parallel_error_upper(:) => null() !Upper error for "pressure_parallel" + real(ids_real), pointer :: pressure_parallel_error_lower(:) => null() !Lower error for "pressure_parallel" + integer(ids_int) :: pressure_parallel_error_index=ids_int_invalid !Index in the error_description list for "pressure_parallel" + real(ids_real), pointer :: j_total(:) => null() !Total parallel current density = average(jtot.B) / B0, where B0 = Core_Profiles/Vacuum_Toroidal_Field/ B0 + real(ids_real), pointer :: j_total_error_upper(:) => null() !Upper error for "j_total" + real(ids_real), pointer :: j_total_error_lower(:) => null() !Lower error for "j_total" + integer(ids_int) :: j_total_error_index=ids_int_invalid !Index in the error_description list for "j_total" + real(ids_real), pointer :: j_tor(:) => null() !Total toroidal current density = average(J_Tor/R) / average(1/R) + real(ids_real), pointer :: j_tor_error_upper(:) => null() !Upper error for "j_tor" + real(ids_real), pointer :: j_tor_error_lower(:) => null() !Lower error for "j_tor" + integer(ids_int) :: j_tor_error_index=ids_int_invalid !Index in the error_description list for "j_tor" + real(ids_real), pointer :: j_ohmic(:) => null() !Ohmic parallel current density = average(J_Ohmic.B) / B0, where B0 = Core_Profiles/Vacuum_Toroidal_Field/ B0 + real(ids_real), pointer :: j_ohmic_error_upper(:) => null() !Upper error for "j_ohmic" + real(ids_real), pointer :: j_ohmic_error_lower(:) => null() !Lower error for "j_ohmic" + integer(ids_int) :: j_ohmic_error_index=ids_int_invalid !Index in the error_description list for "j_ohmic" + real(ids_real), pointer :: j_non_inductive(:) => null() !Non-inductive (includes bootstrap) parallel current density = average(jni.B) / B0, where B0 = Core_Profiles/Vacuum_Toroidal_Field/! + ! B0 + real(ids_real), pointer :: j_non_inductive_error_upper(:) => null() !Upper error for "j_non_inductive" + real(ids_real), pointer :: j_non_inductive_error_lower(:) => null() !Lower error for "j_non_inductive" + integer(ids_int) :: j_non_inductive_error_index=ids_int_invalid !Index in the error_description list for "j_non_inductive" + real(ids_real), pointer :: j_bootstrap(:) => null() !Bootstrap current density = average(J_Bootstrap.B) / B0, where B0 = Core_Profiles/Vacuum_Toroidal_Field/ B0 + real(ids_real), pointer :: j_bootstrap_error_upper(:) => null() !Upper error for "j_bootstrap" + real(ids_real), pointer :: j_bootstrap_error_lower(:) => null() !Lower error for "j_bootstrap" + integer(ids_int) :: j_bootstrap_error_index=ids_int_invalid !Index in the error_description list for "j_bootstrap" + real(ids_real), pointer :: conductivity_parallel(:) => null() !Parallel conductivity + real(ids_real), pointer :: conductivity_parallel_error_upper(:) => null() !Upper error for "conductivity_parallel" + real(ids_real), pointer :: conductivity_parallel_error_lower(:) => null() !Lower error for "conductivity_parallel" + integer(ids_int) :: conductivity_parallel_error_index=ids_int_invalid !Index in the error_description list for "conductivity_parallel" + real(ids_real), pointer :: e_field_parallel(:) => null() !Parallel electric field = average(E.B) / B0, where Core_Profiles/Vacuum_Toroidal_Field/ B0 + real(ids_real), pointer :: e_field_parallel_error_upper(:) => null() !Upper error for "e_field_parallel" + real(ids_real), pointer :: e_field_parallel_error_lower(:) => null() !Lower error for "e_field_parallel" + integer(ids_int) :: e_field_parallel_error_index=ids_int_invalid !Index in the error_description list for "e_field_parallel" + real(ids_real), pointer :: q(:) => null() !Safety factor + real(ids_real), pointer :: q_error_upper(:) => null() !Upper error for "q" + real(ids_real), pointer :: q_error_lower(:) => null() !Lower error for "q" + integer(ids_int) :: q_error_index=ids_int_invalid !Index in the error_description list for "q" + real(ids_real), pointer :: magnetic_shear(:) => null() !Magnetic shear, defined as rho_tor/q . dq/drho_tor + real(ids_real), pointer :: magnetic_shear_error_upper(:) => null() !Upper error for "magnetic_shear" + real(ids_real), pointer :: magnetic_shear_error_lower(:) => null() !Lower error for "magnetic_shear" + integer(ids_int) :: magnetic_shear_error_index=ids_int_invalid !Index in the error_description list for "magnetic_shear" + real(ids_real), pointer :: phi(:) => null() !Toroidal flux + real(ids_real), pointer :: phi_error_upper(:) => null() !Upper error for "phi" + real(ids_real), pointer :: phi_error_lower(:) => null() !Lower error for "phi" + integer(ids_int) :: phi_error_index=ids_int_invalid !Index in the error_description list for "phi" + real(ids_real), pointer :: psi_star_pre_crash(:) => null() !Psi* = psi - phi, just before the sawtooth crash + real(ids_real), pointer :: psi_star_pre_crash_error_upper(:) => null() !Upper error for "psi_star_pre_crash" + real(ids_real), pointer :: psi_star_pre_crash_error_lower(:) => null() !Lower error for "psi_star_pre_crash" + integer(ids_int) :: psi_star_pre_crash_error_index=ids_int_invalid !Index in the error_description list for "psi_star_pre_crash" + real(ids_real), pointer :: psi_star_post_crash(:) => null() !Psi* = psi - phi, after the sawtooth crash + real(ids_real), pointer :: psi_star_post_crash_error_upper(:) => null() !Upper error for "psi_star_post_crash" + real(ids_real), pointer :: psi_star_post_crash_error_lower(:) => null() !Lower error for "psi_star_post_crash" + integer(ids_int) :: psi_star_post_crash_error_index=ids_int_invalid !Index in the error_description list for "psi_star_post_crash" + real(ids_real) :: time=ids_real_invalid !Time + end type + + type :: ids_sawteeth_diagnostics + real(ids_real), pointer :: magnetic_shear_q1(:) => null() !Magnetic shear at surface q = 1, defined as rho_tor/q . dq/drho_tor + real(ids_real), pointer :: magnetic_shear_q1_error_upper(:) => null() !Upper error for "magnetic_shear_q1" + real(ids_real), pointer :: magnetic_shear_q1_error_lower(:) => null() !Lower error for "magnetic_shear_q1" + integer(ids_int) :: magnetic_shear_q1_error_index=ids_int_invalid !Index in the error_description list for "magnetic_shear_q1" + real(ids_real), pointer :: rho_tor_norm_q1(:) => null() !Normalised toroidal flux coordinate at surface q = 1 + real(ids_real), pointer :: rho_tor_norm_q1_error_upper(:) => null() !Upper error for "rho_tor_norm_q1" + real(ids_real), pointer :: rho_tor_norm_q1_error_lower(:) => null() !Lower error for "rho_tor_norm_q1" + integer(ids_int) :: rho_tor_norm_q1_error_index=ids_int_invalid !Index in the error_description list for "rho_tor_norm_q1" + real(ids_real), pointer :: rho_tor_norm_inversion(:) => null() !Normalised toroidal flux coordinate at inversion radius + real(ids_real), pointer :: rho_tor_norm_inversion_error_upper(:) => null() !Upper error for "rho_tor_norm_inversion" + real(ids_real), pointer :: rho_tor_norm_inversion_error_lower(:) => null() !Lower error for "rho_tor_norm_inversion" + integer(ids_int) :: rho_tor_norm_inversion_error_index=ids_int_invalid !Index in the error_description list for "rho_tor_norm_inversion" + real(ids_real), pointer :: rho_tor_norm_mixing(:) => null() !Normalised toroidal flux coordinate at mixing radius + real(ids_real), pointer :: rho_tor_norm_mixing_error_upper(:) => null() !Upper error for "rho_tor_norm_mixing" + real(ids_real), pointer :: rho_tor_norm_mixing_error_lower(:) => null() !Lower error for "rho_tor_norm_mixing" + integer(ids_int) :: rho_tor_norm_mixing_error_index=ids_int_invalid !Index in the error_description list for "rho_tor_norm_mixing" + integer(ids_int), pointer :: previous_crash_trigger(:) => null() !Previous crash trigger. Flag indicating whether a crash condition has been satisfied : 0 = no crash. N(>0) = crash triggered due t! + !o condition N + real(ids_real), pointer :: previous_crash_time(:) => null() !Time at which the previous sawtooth crash occured + real(ids_real), pointer :: previous_crash_time_error_upper(:) => null() !Upper error for "previous_crash_time" + real(ids_real), pointer :: previous_crash_time_error_lower(:) => null() !Lower error for "previous_crash_time" + integer(ids_int) :: previous_crash_time_error_index=ids_int_invalid !Index in the error_description list for "previous_crash_time" + real(ids_real), pointer :: previous_period(:) => null() !Previous sawtooth period + real(ids_real), pointer :: previous_period_error_upper(:) => null() !Upper error for "previous_period" + real(ids_real), pointer :: previous_period_error_lower(:) => null() !Lower error for "previous_period" + integer(ids_int) :: previous_period_error_index=ids_int_invalid !Index in the error_description list for "previous_period" + end type + + + ! *********** sawteeth IDS + type, extends(IDS_base) :: ids_sawteeth !Description of sawtooth events. This IDS must be used in homogeneous_time = 1 mode + logical, private :: c_data = .FALSE. ! Fortran specific metadata telling whether the IDS has been populated from C allocated data (LL) or not + integer, private :: max_occurrence = 2! Maximum occurrence allowed as defined in the DD + + type(ids_ids_properties) :: ids_properties !Interface Data Structure properties. This element identifies the node above as an IDS + type(ids_b_tor_vacuum_1) :: vacuum_toroidal_field !Characteristics of the vacuum toroidal field (used in rho_tor definition) + integer(ids_int), pointer :: crash_trigger(:) => null() !Flag indicating whether a crash condition has been satisfied : 0 = no crash. N(>0) = crash triggered due to condition N as follows! + !. 1: crash triggered by the ideal kink criterion; 2: crash triggered by the ideal kink criterion including kinetic effects from fa! + !st particles; 31: crash triggered by the resistive kink criterion (meeting necessary conditions for reconnection); 32: crash trigg! + !ered by the resistive kink criterion (resistive kink mode is unstable). The distinction between 31 and 32 only indicates whether (! + !31) or (32) was the last criterion to be satisfied + type(ids_sawteeth_profiles_1d), pointer :: profiles_1d(:) => null() !Core profiles after sawtooth crash for various time slices + type(ids_sawteeth_diagnostics) :: diagnostics !Detailed information about the sawtooth characteristics + type(ids_code) :: code !Generic decription of the code-specific parameters for the code that has produced this IDS + real(ids_real), pointer :: time(:) => null() !Generic time + end type + + ! *********** soft_x_rays IDS internal structures declaration + + type :: ids_sxr_channel + character(len=ids_string_length), dimension(:), pointer :: name => null() !Name of the channel + character(len=ids_string_length), dimension(:), pointer :: identifier => null() !ID of the channel + type(ids_detector_aperture) :: detector !Detector description + type(ids_detector_aperture), pointer :: aperture(:) => null() !Description of a set of collimating apertures + real(ids_real) :: etendue=ids_real_invalid !Etendue (geometric extent) of the channel's optical system + real(ids_real) :: etendue_error_upper=ids_real_invalid !Upper error for "etendue" + real(ids_real) :: etendue_error_lower=ids_real_invalid !Lower error for "etendue" + integer(ids_int) :: etendue_error_index=ids_int_invalid !Index in the error_description list for "etendue" + type(ids_identifier_static) :: etendue_method !Method used to calculate the etendue. Index = 0 : exact calculation with a 4D integral; 1 : approximation with first order formula! + ! (detector surface times solid angle subtended by the apertures); 2 : other methods + type(ids_line_of_sight_2points) :: line_of_sight !Description of the line of sight of the channel, given by 2 points + type(ids_filter_window), pointer :: filter_window(:) => null() !Set of filter windows + type(ids_detector_energy_band), pointer :: energy_band(:) => null() !Set of energy bands in which photons are counted by the detector + type(ids_signal_flt_2d) :: brightness !Power flux received by the detector, per unit solid angle and per unit area (i.e. power divided by the etendue), in multiple energ! + !y bands if available from the detector + type(ids_signal_flt_2d) :: power !Power received on the detector, in multiple energy bands if available from the detector + type(ids_signal_int_1d) :: validity_timed !Indicator of the validity of the channel as a function of time (0 means valid, negative values mean non-valid) + integer(ids_int) :: validity=ids_int_invalid !Indicator of the validity of the channel for the whole acquisition period (0 means valid, negative values mean non-valid) + end type + + + ! *********** soft_x_rays IDS + type, extends(IDS_base) :: ids_soft_x_rays !Soft X-rays tomography diagnostic + logical, private :: c_data = .FALSE. ! Fortran specific metadata telling whether the IDS has been populated from C allocated data (LL) or not + integer, private :: max_occurrence = 1! Maximum occurrence allowed as defined in the DD + + type(ids_ids_properties) :: ids_properties !Interface Data Structure properties. This element identifies the node above as an IDS + type(ids_sxr_channel), pointer :: channel(:) => null() !Set of channels (detector or pixel of a camera) + real(ids_real) :: latency=ids_real_invalid !Upper bound of the delay between physical information received by the detector and data available on the real-time (RT) network. + real(ids_real) :: latency_error_upper=ids_real_invalid !Upper error for "latency" + real(ids_real) :: latency_error_lower=ids_real_invalid !Lower error for "latency" + integer(ids_int) :: latency_error_index=ids_int_invalid !Index in the error_description list for "latency" + type(ids_code) :: code !Generic decription of the code-specific parameters for the code that has produced this IDS + real(ids_real), pointer :: time(:) => null() !Generic time + end type + + ! *********** spectrometer_mass IDS internal structures declaration + + + ! *********** spectrometer_mass IDS + type, extends(IDS_base) :: ids_spectrometer_mass !Mass spectrometer diagnostic + logical, private :: c_data = .FALSE. ! Fortran specific metadata telling whether the IDS has been populated from C allocated data (LL) or not + integer, private :: max_occurrence = 4! Maximum occurrence allowed as defined in the DD + + type(ids_ids_properties) :: ids_properties !Interface Data Structure properties. This element identifies the node above as an IDS + character(len=ids_string_length), dimension(:), pointer :: name => null() !Name of the spectrometer + character(len=ids_string_length), dimension(:), pointer :: identifier => null() !ID of the spectrometer + real(ids_real), pointer :: a(:) => null() !Array of atomic masses for which partial pressures are recorded by the spectrometer + real(ids_real), pointer :: a_error_upper(:) => null() !Upper error for "a" + real(ids_real), pointer :: a_error_lower(:) => null() !Lower error for "a" + integer(ids_int) :: a_error_index=ids_int_invalid !Index in the error_description list for "a" + type(ids_signal_flt_2d_validity) :: pressures_partial !Partial pressures recorded by the spectrometer + real(ids_real) :: latency=ids_real_invalid !Upper bound of the delay between physical information received by the detector and data available on the real-time (RT) network. + real(ids_real) :: latency_error_upper=ids_real_invalid !Upper error for "latency" + real(ids_real) :: latency_error_lower=ids_real_invalid !Lower error for "latency" + integer(ids_int) :: latency_error_index=ids_int_invalid !Index in the error_description list for "latency" + type(ids_code) :: code !Generic decription of the code-specific parameters for the code that has produced this IDS + real(ids_real), pointer :: time(:) => null() !Generic time + end type + + ! *********** spectrometer_uv IDS internal structures declaration + + type :: ids_spectro_uv_detector + real(ids_real), pointer :: pixel_dimensions(:) => null() !Pixel dimension in each direction (horizontal, vertical) + real(ids_real), pointer :: pixel_dimensions_error_upper(:) => null() !Upper error for "pixel_dimensions" + real(ids_real), pointer :: pixel_dimensions_error_lower(:) => null() !Lower error for "pixel_dimensions" + integer(ids_int) :: pixel_dimensions_error_index=ids_int_invalid !Index in the error_description list for "pixel_dimensions" + integer(ids_int), pointer :: pixel_n(:) => null() !Number of pixels in each direction (horizontal, vertical) + real(ids_real), pointer :: detector_dimensions(:) => null() !Total detector dimension in each direction (horizontal, vertical) + real(ids_real), pointer :: detector_dimensions_error_upper(:) => null() !Upper error for "detector_dimensions" + real(ids_real), pointer :: detector_dimensions_error_lower(:) => null() !Lower error for "detector_dimensions" + integer(ids_int) :: detector_dimensions_error_index=ids_int_invalid !Index in the error_description list for "detector_dimensions" + end type + + type :: ids_spectro_uv_supply + character(len=ids_string_length), dimension(:), pointer :: object => null() !Name of the object connected to the power supply + type(ids_signal_flt_1d) :: voltage_set !Voltage set at the power supply + end type + + type :: ids_spectro_uv_channel_grating_image + type(ids_identifier_static) :: geometry_type !Surface geometry. Index = 1 : spherical. Index = 2 : plane + type(ids_rzphi0d_static) :: centre !Centre of the image surface in case it is spherical, or position of a point on the surface in case it is a plane + real(ids_real) :: curvature_radius=ids_real_invalid !Curvature radius of the image surface + real(ids_real) :: curvature_radius_error_upper=ids_real_invalid !Upper error for "curvature_radius" + real(ids_real) :: curvature_radius_error_lower=ids_real_invalid !Lower error for "curvature_radius" + integer(ids_int) :: curvature_radius_error_index=ids_int_invalid !Index in the error_description list for "curvature_radius" + type(ids_xyz0d_static) :: x3_unit_vector !Components of the X3 direction unit vector in the (X,Y,Z) coordinate system, where X is the major radius axis for phi = 0, Y is th! + !e major radius axis for phi = pi/2, and Z is the height axis. The X3 axis is normal to the surface ( in case it is plane) and orie! + !nted towards the plasma. + end type + + type :: ids_spectro_uv_channel_grating + type(ids_identifier_static) :: type !Grating type. Index = 1 : ruled. Index = 2 : holographic + real(ids_real) :: groove_density=ids_real_invalid !Number of grooves per unit length + real(ids_real) :: groove_density_error_upper=ids_real_invalid !Upper error for "groove_density" + real(ids_real) :: groove_density_error_lower=ids_real_invalid !Lower error for "groove_density" + integer(ids_int) :: groove_density_error_index=ids_int_invalid !Index in the error_description list for "groove_density" + type(ids_identifier_static) :: geometry_type !Grating geometry. Index = 1 : spherical. Index = 2 : toric + type(ids_rzphi0d_static) :: centre !Centre of the grating sphere (if grating is spherical) or torus (if grating is toric) + real(ids_real) :: curvature_radius=ids_real_invalid !Curvature radius of the spherical grating + real(ids_real) :: curvature_radius_error_upper=ids_real_invalid !Upper error for "curvature_radius" + real(ids_real) :: curvature_radius_error_lower=ids_real_invalid !Lower error for "curvature_radius" + integer(ids_int) :: curvature_radius_error_index=ids_int_invalid !Index in the error_description list for "curvature_radius" + type(ids_rzphi0d_static) :: summit !Position of the grating summit (defined as the point of contact of its concave side if the grating were put on a table). Used as t! + !he origin of the x1, x2, x3 vectors defined below + type(ids_xyz0d_static) :: x1_unit_vector !Components of the X1 direction unit vector in the (X,Y,Z) coordinate system, where X is the major radius axis for phi = 0, Y is th! + !e major radius axis for phi = pi/2, and Z is the height axis. The X1 vector is horizontal and oriented in the positive phi directi! + !on (counter-clockwise when viewing from above). + type(ids_xyz0d_static) :: x2_unit_vector !Components of the X2 direction unit vector in the (X,Y,Z) coordinate system, where X is the major radius axis for phi = 0, Y is th! + !e major radius axis for phi = pi/2, and Z is the height axis. The X2 axis is orthonormal so that uX2 = uX3 x uX1. + type(ids_xyz0d_static) :: x3_unit_vector !Components of the X3 direction unit vector in the (X,Y,Z) coordinate system, where X is the major radius axis for phi = 0, Y is th! + !e major radius axis for phi = pi/2, and Z is the height axis. The X3 axis is normal to the grating at its summit and oriented towa! + !rds the plasma. + type(ids_x1x21d_static) :: outline !List of the 4 extreme points of the spherical grating in the (X1, X2) coordinate system, using the summit as the origin. Do NOT re! + !peat the first point. + type(ids_spectro_uv_channel_grating_image) :: image_field !Surface on which the grating image is focused + end type + + type :: ids_spectro_uv_channel_processed_line + character(len=ids_string_length), dimension(:), pointer :: label => null() !String identifying the processed line. To avoid ambiguities, the following syntax is used : element with ionization state_waveleng! + !th in Angstrom (e.g. WI_4000) + real(ids_real) :: wavelength_central=ids_real_invalid !Central wavelength of the processed line + real(ids_real) :: wavelength_central_error_upper=ids_real_invalid !Upper error for "wavelength_central" + real(ids_real) :: wavelength_central_error_lower=ids_real_invalid !Lower error for "wavelength_central" + integer(ids_int) :: wavelength_central_error_index=ids_int_invalid !Index in the error_description list for "wavelength_central" + type(ids_signal_flt_1d) :: radiance !Calibrated, background subtracted radiance (integrated over the spectrum for this line) + type(ids_signal_flt_1d) :: intensity !Non-calibrated intensity (integrated over the spectrum for this line) + end type + + type :: ids_spectro_uv_channel_wavelength_calibration + real(ids_real) :: offset=ids_real_invalid !Offset + real(ids_real) :: offset_error_upper=ids_real_invalid !Upper error for "offset" + real(ids_real) :: offset_error_lower=ids_real_invalid !Lower error for "offset" + integer(ids_int) :: offset_error_index=ids_int_invalid !Index in the error_description list for "offset" + real(ids_real) :: gain=ids_real_invalid !Gain + real(ids_real) :: gain_error_upper=ids_real_invalid !Upper error for "gain" + real(ids_real) :: gain_error_lower=ids_real_invalid !Lower error for "gain" + integer(ids_int) :: gain_error_index=ids_int_invalid !Index in the error_description list for "gain" + end type + + type :: ids_spectro_uv_channel + character(len=ids_string_length), dimension(:), pointer :: name => null() !Name of the channel + type(ids_spectro_uv_detector) :: detector_layout !Dimensions of pixels and detector + type(ids_detector_aperture) :: detector !Description of the front face of the micro channel plate + type(ids_signal_flt_1d) :: detector_position_parameter !In case of detector moving during a pulse, position parameter allowing to record and compute the detector position as a function o! + !f time + type(ids_detector_aperture), pointer :: aperture(:) => null() !Description of a set of collimating apertures + type(ids_line_of_sight_2points_dynamic_aos1) :: line_of_sight !Description of the line of sight of the channel, given by 2 points. The 2nd point is allowed to evolve in case of dynamic line of ! + !sight. + type(ids_spectro_uv_supply), pointer :: supply_high_voltage(:) => null() !Set of high voltage power supplies applied to various parts of the diagnostic + type(ids_spectro_uv_channel_grating) :: grating !Description of the grating + real(ids_real), pointer :: wavelengths(:) => null() !Measured wavelengths + real(ids_real), pointer :: wavelengths_error_upper(:) => null() !Upper error for "wavelengths" + real(ids_real), pointer :: wavelengths_error_lower(:) => null() !Lower error for "wavelengths" + integer(ids_int) :: wavelengths_error_index=ids_int_invalid !Index in the error_description list for "wavelengths" + type(ids_signal_flt_2d) :: radiance_spectral !Calibrated spectral radiance (radiance per unit wavelength) + type(ids_signal_flt_2d) :: intensity_spectrum !Intensity spectrum (not calibrated), i.e. number of photoelectrons detected by unit time by a wavelength pixel of the channel, tak! + !ing into account electronic gain compensation and channels relative calibration + real(ids_real) :: exposure_time=ids_real_invalid !Exposure time + real(ids_real) :: exposure_time_error_upper=ids_real_invalid !Upper error for "exposure_time" + real(ids_real) :: exposure_time_error_lower=ids_real_invalid !Lower error for "exposure_time" + integer(ids_int) :: exposure_time_error_index=ids_int_invalid !Index in the error_description list for "exposure_time" + type(ids_spectro_uv_channel_processed_line), pointer :: processed_line(:) => null() !Set of processed spectral lines + real(ids_real), pointer :: radiance_calibration(:) => null() !Radiance calibration + real(ids_real), pointer :: radiance_calibration_error_upper(:) => null() !Upper error for "radiance_calibration" + real(ids_real), pointer :: radiance_calibration_error_lower(:) => null() !Lower error for "radiance_calibration" + integer(ids_int) :: radiance_calibration_error_index=ids_int_invalid !Index in the error_description list for "radiance_calibration" + character(len=ids_string_length), dimension(:), pointer :: radiance_calibration_date => null() !Date of the radiance calibration (yyyy_mm_dd) + type(ids_spectro_uv_channel_wavelength_calibration) :: wavelength_calibration !Wavelength calibration data. The wavelength is obtained from the pixel index k by: wavelength = k * gain + offset. k is starting ! + !from 1. + character(len=ids_string_length), dimension(:), pointer :: wavelength_calibration_date => null() !Date of the wavelength calibration (yyyy_mm_dd) + type(ids_signal_int_2d) :: validity_timed !Indicator of the validity of the data for each wavelength and each time slice. 0: valid from automated processing, 1: valid and ce! + !rtified by the diagnostic RO; - 1 means problem identified in the data processing (request verification by the diagnostic RO), -2:! + ! invalid data, should not be used (values lower than -2 have a code-specific meaning detailing the origin of their invalidity) + integer(ids_int) :: validity=ids_int_invalid !Indicator of the validity of the data for the whole acquisition period. 0: valid from automated processing, 1: valid and certified! + ! by the diagnostic RO; - 1 means problem identified in the data processing (request verification by the diagnostic RO), -2: invali! + !d data, should not be used (values lower than -2 have a code-specific meaning detailing the origin of their invalidity) + end type + + + ! *********** spectrometer_uv IDS + type, extends(IDS_base) :: ids_spectrometer_uv !Spectrometer in uv light range diagnostic + logical, private :: c_data = .FALSE. ! Fortran specific metadata telling whether the IDS has been populated from C allocated data (LL) or not + integer, private :: max_occurrence = 2! Maximum occurrence allowed as defined in the DD + + type(ids_ids_properties) :: ids_properties !Interface Data Structure properties. This element identifies the node above as an IDS + real(ids_real) :: etendue=ids_real_invalid !Etendue (geometric extent) of the optical system + real(ids_real) :: etendue_error_upper=ids_real_invalid !Upper error for "etendue" + real(ids_real) :: etendue_error_lower=ids_real_invalid !Lower error for "etendue" + integer(ids_int) :: etendue_error_index=ids_int_invalid !Index in the error_description list for "etendue" + type(ids_identifier_static) :: etendue_method !Method used to calculate the etendue. Index = 0 : exact calculation with a 4D integral; 1 : approximation with first order formula! + ! (detector surface times solid angle subtended by the apertures); 2 : other methods + type(ids_spectro_uv_channel), pointer :: channel(:) => null() !Set of channels (detector or pixel of a camera) + real(ids_real) :: latency=ids_real_invalid !Upper bound of the delay between physical information received by the detector and data available on the real-time (RT) network. + real(ids_real) :: latency_error_upper=ids_real_invalid !Upper error for "latency" + real(ids_real) :: latency_error_lower=ids_real_invalid !Lower error for "latency" + integer(ids_int) :: latency_error_index=ids_int_invalid !Index in the error_description list for "latency" + type(ids_code) :: code !Generic decription of the code-specific parameters for the code that has produced this IDS + real(ids_real), pointer :: time(:) => null() !Generic time + end type + + ! *********** spectrometer_visible IDS internal structures declaration + + type :: ids_detector_image_circular + real(ids_real) :: radius=ids_real_invalid !Radius of the circle + real(ids_real) :: radius_error_upper=ids_real_invalid !Upper error for "radius" + real(ids_real) :: radius_error_lower=ids_real_invalid !Lower error for "radius" + integer(ids_int) :: radius_error_index=ids_int_invalid !Index in the error_description list for "radius" + real(ids_real) :: ellipticity=ids_real_invalid !Ellipticity + real(ids_real) :: ellipticity_error_upper=ids_real_invalid !Upper error for "ellipticity" + real(ids_real) :: ellipticity_error_lower=ids_real_invalid !Lower error for "ellipticity" + integer(ids_int) :: ellipticity_error_index=ids_int_invalid !Index in the error_description list for "ellipticity" + end type + + type :: ids_detector_image + integer(ids_int) :: geometry_type=ids_int_invalid !Type of geometry used to describe the image (1:'outline', 2:'circular') + type(ids_rzphi1d_static) :: outline !Coordinates of the points shaping the polygon of the image + type(ids_detector_image_circular) :: circular !Description of circular or elliptic image + end type + + type :: ids_spectro_vis_channel_light_collection + real(ids_real), pointer :: values(:) => null() !Values of the light collection efficiencies + real(ids_real), pointer :: values_error_upper(:) => null() !Upper error for "values" + real(ids_real), pointer :: values_error_lower(:) => null() !Lower error for "values" + integer(ids_int) :: values_error_index=ids_int_invalid !Index in the error_description list for "values" + type(ids_rzphi1d_static) :: positions !List of positions for which the light collection efficiencies are provided + end type + + type :: ids_spectro_vis_channel_resolution + type(ids_rzphi0d_dynamic_aos3) :: centre !Position of the centre of the spatially resolved zone + type(ids_rzphi0d_dynamic_aos3) :: width !Full width of the spatially resolved zone in the R, Z and phi directions + real(ids_real) :: time=ids_real_invalid !Time + end type + + type :: ids_spectro_vis_channel_processed_line + character(len=ids_string_length), dimension(:), pointer :: label => null() !String identifying the processed line. To avoid ambiguities, the following syntax is used : element with ionization state_waveleng! + !th in Angstrom (e.g. WI_4000) + real(ids_real) :: wavelength_central=ids_real_invalid !Central wavelength of the processed line + real(ids_real) :: wavelength_central_error_upper=ids_real_invalid !Upper error for "wavelength_central" + real(ids_real) :: wavelength_central_error_lower=ids_real_invalid !Lower error for "wavelength_central" + integer(ids_int) :: wavelength_central_error_index=ids_int_invalid !Index in the error_description list for "wavelength_central" + type(ids_signal_flt_1d) :: radiance !Calibrated, background subtracted radiance (integrated over the spectrum for this line) + type(ids_signal_flt_1d) :: intensity !Non-calibrated intensity (integrated over the spectrum for this line) + end type + + type :: ids_spectro_vis_channel_wavelength_calibration + real(ids_real) :: offset=ids_real_invalid !Offset + real(ids_real) :: offset_error_upper=ids_real_invalid !Upper error for "offset" + real(ids_real) :: offset_error_lower=ids_real_invalid !Lower error for "offset" + integer(ids_int) :: offset_error_index=ids_int_invalid !Index in the error_description list for "offset" + real(ids_real) :: gain=ids_real_invalid !Gain + real(ids_real) :: gain_error_upper=ids_real_invalid !Upper error for "gain" + real(ids_real) :: gain_error_lower=ids_real_invalid !Lower error for "gain" + integer(ids_int) :: gain_error_index=ids_int_invalid !Index in the error_description list for "gain" + end type + + type :: ids_spectro_vis_channel_grating + real(ids_real) :: grating=ids_real_invalid !Number of grating lines per unit length + real(ids_real) :: grating_error_upper=ids_real_invalid !Upper error for "grating" + real(ids_real) :: grating_error_lower=ids_real_invalid !Lower error for "grating" + integer(ids_int) :: grating_error_index=ids_int_invalid !Index in the error_description list for "grating" + real(ids_real) :: slit_width=ids_real_invalid !Width of the slit (placed in the object focal plane) + real(ids_real) :: slit_width_error_upper=ids_real_invalid !Upper error for "slit_width" + real(ids_real) :: slit_width_error_lower=ids_real_invalid !Lower error for "slit_width" + integer(ids_int) :: slit_width_error_index=ids_int_invalid !Index in the error_description list for "slit_width" + real(ids_real), pointer :: wavelengths(:) => null() !Measured wavelengths + real(ids_real), pointer :: wavelengths_error_upper(:) => null() !Upper error for "wavelengths" + real(ids_real), pointer :: wavelengths_error_lower(:) => null() !Lower error for "wavelengths" + integer(ids_int) :: wavelengths_error_index=ids_int_invalid !Index in the error_description list for "wavelengths" + type(ids_signal_flt_2d) :: radiance_spectral !Calibrated spectral radiance (radiance per unit wavelength) + type(ids_signal_flt_2d) :: intensity_spectrum !Intensity spectrum (not calibrated), i.e. number of photoelectrons detected by unit time by a wavelength pixel of the channel, tak! + !ing into account electronic gain compensation and channels relative calibration + real(ids_real) :: exposure_time=ids_real_invalid !Exposure time + real(ids_real) :: exposure_time_error_upper=ids_real_invalid !Upper error for "exposure_time" + real(ids_real) :: exposure_time_error_lower=ids_real_invalid !Lower error for "exposure_time" + integer(ids_int) :: exposure_time_error_index=ids_int_invalid !Index in the error_description list for "exposure_time" + type(ids_spectro_vis_channel_processed_line), pointer :: processed_line(:) => null() !Set of processed spectral lines + real(ids_real), pointer :: radiance_calibration(:) => null() !Radiance calibration + real(ids_real), pointer :: radiance_calibration_error_upper(:) => null() !Upper error for "radiance_calibration" + real(ids_real), pointer :: radiance_calibration_error_lower(:) => null() !Lower error for "radiance_calibration" + integer(ids_int) :: radiance_calibration_error_index=ids_int_invalid !Index in the error_description list for "radiance_calibration" + character(len=ids_string_length), dimension(:), pointer :: radiance_calibration_date => null() !Date of the radiance calibration (yyyy_mm_dd) + type(ids_spectro_vis_channel_wavelength_calibration) :: wavelength_calibration !Wavelength calibration data. The wavelength is obtained from the pixel index k by: wavelength = k * gain + offset. k is starting ! + !from 1. + character(len=ids_string_length), dimension(:), pointer :: wavelength_calibration_date => null() !Date of the wavelength calibration (yyyy_mm_dd) + real(ids_real), pointer :: instrument_function(:,:) => null() !Array of Gaussian widths and amplitudes which as a sum make up the instrument function. The instrument function is the shape that ! + !would be measured by a grating spectrometer if perfectly monochromatic line emission would be used as input. F(lambda) = 1 / sqrt ! + !(2*pi) * sum( instrument_function(1,i) / instrument_function(2,i) ) * exp( -lambda^2 / (2 * instrument_function(2,i)^2) ) ), whe! + !reby sum( instrument_function(1,i) ) = 1 + real(ids_real), pointer :: instrument_function_error_upper(:,:) => null() !Upper error for "instrument_function" + real(ids_real), pointer :: instrument_function_error_lower(:,:) => null() !Lower error for "instrument_function" + integer(ids_int) :: instrument_function_error_index=ids_int_invalid !Index in the error_description list for "instrument_function" + end type + + type :: ids_spectro_vis_channel_filter + real(ids_real), pointer :: processed_lines(:) => null() !Central wavelength of the processed lines + real(ids_real), pointer :: processed_lines_error_upper(:) => null() !Upper error for "processed_lines" + real(ids_real), pointer :: processed_lines_error_lower(:) => null() !Lower error for "processed_lines" + integer(ids_int) :: processed_lines_error_index=ids_int_invalid !Index in the error_description list for "processed_lines" + character(len=ids_string_length), dimension(:), pointer :: line_labels => null() !String identifying the processed line. To avoid ambiguities, the following syntax is used : element with ionization state_waveleng! + !th in Angstrom (e.g. WI_4000) + type(ids_signal_flt_2d) :: line_radiances !Calibrated, background subtracted line integrals + type(ids_signal_flt_2d) :: line_radiances_adjusted !Calibrated, background subtracted line integrals, adjusted as if the line was centred at the peak responsivity of the system (for ! + !this line) + type(ids_signal_flt_2d) :: line_power_radiances !Calibrated, background subtracted power radiances + real(ids_real), pointer :: raw_lines(:) => null() !Central wavelength of the raw lines + real(ids_real), pointer :: raw_lines_error_upper(:) => null() !Upper error for "raw_lines" + real(ids_real), pointer :: raw_lines_error_lower(:) => null() !Lower error for "raw_lines" + integer(ids_int) :: raw_lines_error_index=ids_int_invalid !Index in the error_description list for "raw_lines" + type(ids_signal_flt_2d) :: output_voltage !Raw voltage output of the whole acquisition chain for each raw line + type(ids_signal_flt_2d) :: photoelectric_voltage !Gain corrected and background subtracted voltage for each raw line + type(ids_signal_flt_2d) :: photon_count !Detected photon count for each raw line + type(ids_signal_flt_2d) :: line_intensities !Line gross integral intensities + real(ids_real), pointer :: calibrated_lines(:) => null() !Central wavelength of the calibrated lines + real(ids_real), pointer :: calibrated_lines_error_upper(:) => null() !Upper error for "calibrated_lines" + real(ids_real), pointer :: calibrated_lines_error_lower(:) => null() !Lower error for "calibrated_lines" + integer(ids_int) :: calibrated_lines_error_index=ids_int_invalid !Index in the error_description list for "calibrated_lines" + type(ids_signal_flt_2d) :: calibrated_line_integrals !Calibrated line gross areas integrals + real(ids_real) :: exposure_time=ids_real_invalid !Exposure time + real(ids_real) :: exposure_time_error_upper=ids_real_invalid !Upper error for "exposure_time" + real(ids_real) :: exposure_time_error_lower=ids_real_invalid !Lower error for "exposure_time" + integer(ids_int) :: exposure_time_error_index=ids_int_invalid !Index in the error_description list for "exposure_time" + real(ids_real) :: radiance_calibration=ids_real_invalid !Radiance calibration + real(ids_real) :: radiance_calibration_error_upper=ids_real_invalid !Upper error for "radiance_calibration" + real(ids_real) :: radiance_calibration_error_lower=ids_real_invalid !Lower error for "radiance_calibration" + integer(ids_int) :: radiance_calibration_error_index=ids_int_invalid !Index in the error_description list for "radiance_calibration" + character(len=ids_string_length), dimension(:), pointer :: radiance_calibration_date => null() !Date of the radiance calibration (yyyy_mm_dd) + end type + + type :: ids_spectro_vis_channel_isotopes_isotope + type(ids_plasma_composition_neutral_element_constant), pointer :: element(:) => null() !List of elements forming the atom or molecule + character(len=ids_string_length), dimension(:), pointer :: label => null() !String identifying the species (H, D, T, He3, He4) + real(ids_real), pointer :: density_ratio(:) => null() !Ratio of the density of neutrals of this isotope over the summed neutral densities of all other isotopes described in the ../isoto! + !pe array + real(ids_real), pointer :: density_ratio_error_upper(:) => null() !Upper error for "density_ratio" + real(ids_real), pointer :: density_ratio_error_lower(:) => null() !Lower error for "density_ratio" + integer(ids_int) :: density_ratio_error_index=ids_int_invalid !Index in the error_description list for "density_ratio" + real(ids_real), pointer :: cold_neutrals_fraction(:) => null() !Fraction of cold neutrals for this isotope (n_cold_neutrals/(n_cold_neutrals+n_hot_neutrals)) + real(ids_real), pointer :: cold_neutrals_fraction_error_upper(:) => null() !Upper error for "cold_neutrals_fraction" + real(ids_real), pointer :: cold_neutrals_fraction_error_lower(:) => null() !Lower error for "cold_neutrals_fraction" + integer(ids_int) :: cold_neutrals_fraction_error_index=ids_int_invalid !Index in the error_description list for "cold_neutrals_fraction" + real(ids_real), pointer :: hot_neutrals_fraction(:) => null() !Fraction of hot neutrals for this isotope (n_hot_neutrals/(n_cold_neutrals+n_hot_neutrals)) + real(ids_real), pointer :: hot_neutrals_fraction_error_upper(:) => null() !Upper error for "hot_neutrals_fraction" + real(ids_real), pointer :: hot_neutrals_fraction_error_lower(:) => null() !Lower error for "hot_neutrals_fraction" + integer(ids_int) :: hot_neutrals_fraction_error_index=ids_int_invalid !Index in the error_description list for "hot_neutrals_fraction" + real(ids_real), pointer :: cold_neutrals_temperature(:) => null() !Temperature of cold neutrals for this isotope + real(ids_real), pointer :: cold_neutrals_temperature_error_upper(:) => null() !Upper error for "cold_neutrals_temperature" + real(ids_real), pointer :: cold_neutrals_temperature_error_lower(:) => null() !Lower error for "cold_neutrals_temperature" + integer(ids_int) :: cold_neutrals_temperature_error_index=ids_int_invalid !Index in the error_description list for "cold_neutrals_temperature" + real(ids_real), pointer :: hot_neutrals_temperature(:) => null() !Temperature of hot neutrals for this isotope + real(ids_real), pointer :: hot_neutrals_temperature_error_upper(:) => null() !Upper error for "hot_neutrals_temperature" + real(ids_real), pointer :: hot_neutrals_temperature_error_lower(:) => null() !Lower error for "hot_neutrals_temperature" + integer(ids_int) :: hot_neutrals_temperature_error_index=ids_int_invalid !Index in the error_description list for "hot_neutrals_temperature" + real(ids_real), pointer :: time(:) => null() !Timebase for dynamic quantities at this level of the data structure + end type + + type :: ids_spectro_vis_channel_isotopes + integer(ids_int), pointer :: validity_timed(:) => null() !Indicator of the validity of the isotope ratios as a function of time (0 means valid, negative values mean non-valid) + integer(ids_int) :: validity=ids_int_invalid !Indicator of the validity of the isotope ratios for the whole acquisition period (0 means valid, negative values mean non-valid) + real(ids_real), pointer :: signal_to_noise(:) => null() !Log10 of the ratio of the powers in two bands, one with the spectral lines of interest (signal) the other without spectral lines (! + !noise). + real(ids_real), pointer :: signal_to_noise_error_upper(:) => null() !Upper error for "signal_to_noise" + real(ids_real), pointer :: signal_to_noise_error_lower(:) => null() !Lower error for "signal_to_noise" + integer(ids_int) :: signal_to_noise_error_index=ids_int_invalid !Index in the error_description list for "signal_to_noise" + type(ids_identifier) :: method !Fitting method used to calculate isotope ratios + type(ids_spectro_vis_channel_isotopes_isotope), pointer :: isotope(:) => null() !Set of isotopes + real(ids_real), pointer :: time(:) => null() !Timebase for dynamic quantities at this level of the data structure + end type + + type :: ids_spectro_vis_channel_polarization + real(ids_real), pointer :: e_field_lh_r(:) => null() !Lower Hybrid electric field component in the major radius direction + real(ids_real), pointer :: e_field_lh_r_error_upper(:) => null() !Upper error for "e_field_lh_r" + real(ids_real), pointer :: e_field_lh_r_error_lower(:) => null() !Lower error for "e_field_lh_r" + integer(ids_int) :: e_field_lh_r_error_index=ids_int_invalid !Index in the error_description list for "e_field_lh_r" + real(ids_real), pointer :: e_field_lh_z(:) => null() !Lower Hybrid electric field component in the vertical direction + real(ids_real), pointer :: e_field_lh_z_error_upper(:) => null() !Upper error for "e_field_lh_z" + real(ids_real), pointer :: e_field_lh_z_error_lower(:) => null() !Lower error for "e_field_lh_z" + integer(ids_int) :: e_field_lh_z_error_index=ids_int_invalid !Index in the error_description list for "e_field_lh_z" + real(ids_real), pointer :: e_field_lh_tor(:) => null() !Lower Hybrid electric field component in the toroidal direction + real(ids_real), pointer :: e_field_lh_tor_error_upper(:) => null() !Upper error for "e_field_lh_tor" + real(ids_real), pointer :: e_field_lh_tor_error_lower(:) => null() !Lower error for "e_field_lh_tor" + integer(ids_int) :: e_field_lh_tor_error_index=ids_int_invalid !Index in the error_description list for "e_field_lh_tor" + real(ids_real), pointer :: b_field_modulus(:) => null() !Modulus of the magnetic field (always positive, irrespective of the sign convention for the B-field direction), obtained from Zeem! + !an effect fit + real(ids_real), pointer :: b_field_modulus_error_upper(:) => null() !Upper error for "b_field_modulus" + real(ids_real), pointer :: b_field_modulus_error_lower(:) => null() !Lower error for "b_field_modulus" + integer(ids_int) :: b_field_modulus_error_index=ids_int_invalid !Index in the error_description list for "b_field_modulus" + real(ids_real), pointer :: n_e(:) => null() !Electron density, obtained from Stark broadening fit + real(ids_real), pointer :: n_e_error_upper(:) => null() !Upper error for "n_e" + real(ids_real), pointer :: n_e_error_lower(:) => null() !Lower error for "n_e" + integer(ids_int) :: n_e_error_index=ids_int_invalid !Index in the error_description list for "n_e" + real(ids_real), pointer :: temperature_cold_neutrals(:) => null() !Fit of cold neutrals temperature + real(ids_real), pointer :: temperature_cold_neutrals_error_upper(:) => null() !Upper error for "temperature_cold_neutrals" + real(ids_real), pointer :: temperature_cold_neutrals_error_lower(:) => null() !Lower error for "temperature_cold_neutrals" + integer(ids_int) :: temperature_cold_neutrals_error_index=ids_int_invalid !Index in the error_description list for "temperature_cold_neutrals" + real(ids_real), pointer :: temperature_hot_neutrals(:) => null() !Fit of hot neutrals temperature + real(ids_real), pointer :: temperature_hot_neutrals_error_upper(:) => null() !Upper error for "temperature_hot_neutrals" + real(ids_real), pointer :: temperature_hot_neutrals_error_lower(:) => null() !Lower error for "temperature_hot_neutrals" + integer(ids_int) :: temperature_hot_neutrals_error_index=ids_int_invalid !Index in the error_description list for "temperature_hot_neutrals" + real(ids_real), pointer :: velocity_cold_neutrals(:) => null() !Projection of the cold neutral velocity along the line of sight, positive when going from first point to second point of the line ! + !of sight + real(ids_real), pointer :: velocity_cold_neutrals_error_upper(:) => null() !Upper error for "velocity_cold_neutrals" + real(ids_real), pointer :: velocity_cold_neutrals_error_lower(:) => null() !Lower error for "velocity_cold_neutrals" + integer(ids_int) :: velocity_cold_neutrals_error_index=ids_int_invalid !Index in the error_description list for "velocity_cold_neutrals" + real(ids_real), pointer :: velocity_hot_neutrals(:) => null() !Projection of the hot neutral velocity along the line of sight, positive when going from first point to second point of the line o! + !f sight + real(ids_real), pointer :: velocity_hot_neutrals_error_upper(:) => null() !Upper error for "velocity_hot_neutrals" + real(ids_real), pointer :: velocity_hot_neutrals_error_lower(:) => null() !Lower error for "velocity_hot_neutrals" + integer(ids_int) :: velocity_hot_neutrals_error_index=ids_int_invalid !Index in the error_description list for "velocity_hot_neutrals" + real(ids_real), pointer :: time(:) => null() !Timebase for dynamic quantities at this level of the data structure + end type + + type :: ids_spectro_vis_geometry_matrix_step2 + real(ids_real), pointer :: data(:) => null() !The Ray Transfer Matrix (RTM, or geometry matrix) here provides transformation of the signal from each individual unit light sourc! + !e (voxel) to the receiver (detector or head of an optic fibre). The emission profile has [photons.m^-3.s^-1.sr^-1] units and radia! + !nce signal has [photons.m^-2.s^-1.sr^-1] units. So the RTM has [m] units. This data is stored in a sparse form, i.e. the array con! + !tains only the non-zero element of the Ray transfer matrix. The voxel index corresponding to an element of this array can be found! + ! in voxel_indices + real(ids_real), pointer :: data_error_upper(:) => null() !Upper error for "data" + real(ids_real), pointer :: data_error_lower(:) => null() !Lower error for "data" + integer(ids_int) :: data_error_index=ids_int_invalid !Index in the error_description list for "data" + integer(ids_int), pointer :: voxel_indices(:) => null() !List of voxel indices (defined in the voxel map) used in the sparse data array + end type + + type :: ids_spectro_vis_geometry_matrix_interpolated + real(ids_real), pointer :: r(:) => null() !Major radius of interpolation knots + real(ids_real), pointer :: r_error_upper(:) => null() !Upper error for "r" + real(ids_real), pointer :: r_error_lower(:) => null() !Lower error for "r" + integer(ids_int) :: r_error_index=ids_int_invalid !Index in the error_description list for "r" + real(ids_real), pointer :: z(:) => null() !Height of interpolation knots + real(ids_real), pointer :: z_error_upper(:) => null() !Upper error for "z" + real(ids_real), pointer :: z_error_lower(:) => null() !Lower error for "z" + integer(ids_int) :: z_error_index=ids_int_invalid !Index in the error_description list for "z" + real(ids_real), pointer :: phi(:) => null() !Toroidal angle (oriented counter-clockwise when viewing from above) of interpolation knots + real(ids_real), pointer :: phi_error_upper(:) => null() !Upper error for "phi" + real(ids_real), pointer :: phi_error_lower(:) => null() !Lower error for "phi" + integer(ids_int) :: phi_error_index=ids_int_invalid !Index in the error_description list for "phi" + real(ids_real), pointer :: data(:) => null() !Interpolated Ray Transfer Matrix (RTM, or geometry matrix), which provides transformation of the reflected light from each interpo! + !lation knot to the receiver (detector or head of an optic fibre). When convolving with an emission profile, the values must be int! + !erpolated to the emission grid and multiplied by the volume of the grid cells. The interpolated matrix is given on an array of int! + !erpolation knots of coordinates r, z and phi + real(ids_real), pointer :: data_error_upper(:) => null() !Upper error for "data" + real(ids_real), pointer :: data_error_lower(:) => null() !Lower error for "data" + integer(ids_int) :: data_error_index=ids_int_invalid !Index in the error_description list for "data" + end type + + type :: ids_spectro_vis_geometry_matrix + type(ids_spectro_vis_geometry_matrix_step2) :: with_reflections !Geometry matrix with reflections + type(ids_spectro_vis_geometry_matrix_step2) :: without_reflections !Geometry matrix without reflections + type(ids_spectro_vis_geometry_matrix_interpolated) :: interpolated !Interpolated geometry matrix for reflected light + integer(ids_int), pointer :: voxel_map(:,:,:) => null() !Voxel map for geometry matrix. The cells with same number are merged in the computation into a single emission source meta-cell (t! + !he voxel). Cells with number -1 are excluded. Voxel count starts from 0. + integer(ids_int) :: voxels_n=ids_int_invalid !Number of voxels defined in the voxel_map. + type(ids_geometry_matrix_emission) :: emission_grid !Grid defining the light emission cells + end type + + type :: ids_spectro_vis_channel + character(len=ids_string_length), dimension(:), pointer :: name => null() !Name of the channel + character(len=ids_string_length), dimension(:), pointer :: object_observed => null() !Main object observed by the channel + type(ids_identifier_static) :: type !Type of spectrometer the channel is connected to (index=1: grating, 2: filter) + type(ids_detector_aperture) :: detector !Detector description + type(ids_detector_aperture), pointer :: aperture(:) => null() !Description of a set of collimating apertures + real(ids_real) :: etendue=ids_real_invalid !Etendue (geometric extent) of the channel's optical system + real(ids_real) :: etendue_error_upper=ids_real_invalid !Upper error for "etendue" + real(ids_real) :: etendue_error_lower=ids_real_invalid !Lower error for "etendue" + integer(ids_int) :: etendue_error_index=ids_int_invalid !Index in the error_description list for "etendue" + type(ids_identifier_static) :: etendue_method !Method used to calculate the etendue. Index = 0 : exact calculation with a 4D integral; 1 : approximation with first order formula! + ! (detector surface times solid angle subtended by the apertures); 2 : other methods + type(ids_line_of_sight_2points) :: line_of_sight !Description of the line of sight of the channel, given by 2 points + type(ids_detector_image) :: detector_image !Image of the detector or pixel on the focal plane of the optical system + type(ids_detector_image) :: fibre_image !Image of the optical fibre on the focal plane of the optical system + type(ids_spectro_vis_channel_light_collection) :: light_collection_efficiencies !Light collection efficiencies (fraction of the local emission detected by the optical system) for a list of points defining region! + !s of interest. To be used for non-pinhole optics. + type(ids_spectro_vis_channel_resolution), pointer :: active_spatial_resolution(:) => null() !In case of active spectroscopy, describes the spatial resolution of the measurement, calculated as a convolution of the atomic sme! + !aring, magnetic and beam geometry smearing and detector projection, for a set of time slices + type(ids_detector_aperture) :: polarizer !Polarizer description + integer(ids_int) :: polarizer_active=ids_int_invalid !Indicator of whether a polarizer is present and active in the optical system (set to 1 in this case, set to 0 or leave empty otthe! + !rwise) + type(ids_spectro_vis_channel_grating) :: grating_spectrometer !Quantities measured by the channel if connected to a grating spectrometer + type(ids_spectro_vis_channel_filter) :: filter_spectrometer !Quantities measured by the channel if connected to a filter spectrometer + type(ids_signal_int_1d) :: validity_timed !Indicator of the validity of the channel as a function of time (0 means valid, negative values mean non-valid) + integer(ids_int) :: validity=ids_int_invalid !Indicator of the validity of the channel for the whole acquisition period (0 means valid, negative values mean non-valid) + type(ids_spectro_vis_channel_isotopes) :: isotope_ratios !Isotope ratios and related information + type(ids_spectro_vis_channel_polarization) :: polarization_spectroscopy !Physics quantities measured from polarized light spectroscopy + type(ids_spectro_vis_geometry_matrix) :: geometry_matrix !Description of geometry matrix (ray transfer matrix) + end type + + + ! *********** spectrometer_visible IDS + type, extends(IDS_base) :: ids_spectrometer_visible !Spectrometer in visible light range diagnostic + logical, private :: c_data = .FALSE. ! Fortran specific metadata telling whether the IDS has been populated from C allocated data (LL) or not + integer, private :: max_occurrence = 1! Maximum occurrence allowed as defined in the DD + + type(ids_ids_properties) :: ids_properties !Interface Data Structure properties. This element identifies the node above as an IDS + character(len=ids_string_length), dimension(:), pointer :: detector_layout => null() !Layout of the detector grid employed. Ex: '4x16', '4x32', '1x18' + type(ids_spectro_vis_channel), pointer :: channel(:) => null() !Set of channels (detector or pixel of a camera) + real(ids_real) :: latency=ids_real_invalid !Upper bound of the delay between physical information received by the detector and data available on the real-time (RT) network. + real(ids_real) :: latency_error_upper=ids_real_invalid !Upper error for "latency" + real(ids_real) :: latency_error_lower=ids_real_invalid !Lower error for "latency" + integer(ids_int) :: latency_error_index=ids_int_invalid !Index in the error_description list for "latency" + type(ids_code) :: code !Generic decription of the code-specific parameters for the code that has produced this IDS + real(ids_real), pointer :: time(:) => null() !Generic time + end type + + ! *********** spectrometer_x_ray_crystal IDS internal structures declaration + + type :: ids_spectrometer_x_ray_crystal_crystal + character(len=ids_string_length), dimension(:), pointer :: identifier => null() !ID of the object + type(ids_identifier_static) :: geometry_type !Geometry of the object contour. Note that there is some flexibility in the choice of the local coordinate system (X1,X2,X3). The d! + !ata provider should choose the most convenient coordinate system for the object, respecting the definitions of (X1,X2,X3) indicate! + !d below. + type(ids_identifier_static) :: curvature_type !Curvature of the object. + type(ids_identifier_static) :: material !Material of the object + type(ids_rzphi0d_static) :: centre !Coordinates of the origin of the local coordinate system (X1,X2,X3) describing the object. This origin is located within the objec! + !t area and should be the middle point of the object surface. If geometry_type=2, it's the centre of the circular object. If geomet! + !ry_type=3, it's the centre of the rectangular object. + real(ids_real) :: radius=ids_real_invalid !Radius of the circle, used only if geometry_type/index = 2 + real(ids_real) :: radius_error_upper=ids_real_invalid !Upper error for "radius" + real(ids_real) :: radius_error_lower=ids_real_invalid !Lower error for "radius" + integer(ids_int) :: radius_error_index=ids_int_invalid !Index in the error_description list for "radius" + type(ids_xyz0d_static) :: x1_unit_vector !Components of the X1 direction unit vector in the (X,Y,Z) coordinate system, where X is the major radius axis for phi = 0, Y is th! + !e major radius axis for phi = pi/2, and Z is the height axis. The X1 vector is more horizontal than X2 (has a smaller abs(Z) compo! + !nent) and oriented in the positive phi direction (counter-clockwise when viewing from above). + type(ids_xyz0d_static) :: x2_unit_vector !Components of the X2 direction unit vector in the (X,Y,Z) coordinate system, where X is the major radius axis for phi = 0, Y is th! + !e major radius axis for phi = pi/2, and Z is the height axis. The X2 axis is orthonormal so that uX2 = uX3 x uX1. + type(ids_xyz0d_static) :: x3_unit_vector !Components of the X3 direction unit vector in the (X,Y,Z) coordinate system, where X is the major radius axis for phi = 0, Y is th! + !e major radius axis for phi = pi/2, and Z is the height axis. The X3 axis is normal to the object surface and oriented towards the! + ! plasma. + real(ids_real) :: x1_width=ids_real_invalid !Full width of the object in the X1 direction, used only if geometry_type/index = 3 + real(ids_real) :: x1_width_error_upper=ids_real_invalid !Upper error for "x1_width" + real(ids_real) :: x1_width_error_lower=ids_real_invalid !Lower error for "x1_width" + integer(ids_int) :: x1_width_error_index=ids_int_invalid !Index in the error_description list for "x1_width" + real(ids_real) :: x2_width=ids_real_invalid !Full width of the object in the X2 direction, used only if geometry_type/index = 3 + real(ids_real) :: x2_width_error_upper=ids_real_invalid !Upper error for "x2_width" + real(ids_real) :: x2_width_error_lower=ids_real_invalid !Lower error for "x2_width" + integer(ids_int) :: x2_width_error_index=ids_int_invalid !Index in the error_description list for "x2_width" + type(ids_x1x21d_static) :: outline !Irregular outline of the object in the (X1, X2) coordinate system, used only if geometry_type/index=1. Do NOT repeat the first poi! + !nt. + real(ids_real) :: x1_curvature=ids_real_invalid !Radius of curvature in the X1 direction, to be filled only for curvature_type/index = 2, 4 or 5 + real(ids_real) :: x1_curvature_error_upper=ids_real_invalid !Upper error for "x1_curvature" + real(ids_real) :: x1_curvature_error_lower=ids_real_invalid !Lower error for "x1_curvature" + integer(ids_int) :: x1_curvature_error_index=ids_int_invalid !Index in the error_description list for "x1_curvature" + real(ids_real) :: x2_curvature=ids_real_invalid !Radius of curvature in the X2 direction, to be filled only for curvature_type/index = 3 or 5 + real(ids_real) :: x2_curvature_error_upper=ids_real_invalid !Upper error for "x2_curvature" + real(ids_real) :: x2_curvature_error_lower=ids_real_invalid !Lower error for "x2_curvature" + integer(ids_int) :: x2_curvature_error_index=ids_int_invalid !Index in the error_description list for "x2_curvature" + real(ids_real) :: surface=ids_real_invalid !Surface of the object, derived from the above geometric data + real(ids_real) :: surface_error_upper=ids_real_invalid !Upper error for "surface" + real(ids_real) :: surface_error_lower=ids_real_invalid !Lower error for "surface" + integer(ids_int) :: surface_error_index=ids_int_invalid !Index in the error_description list for "surface" + real(ids_real) :: wavelength_bragg=ids_real_invalid !Bragg wavelength of the crystal + real(ids_real) :: wavelength_bragg_error_upper=ids_real_invalid !Upper error for "wavelength_bragg" + real(ids_real) :: wavelength_bragg_error_lower=ids_real_invalid !Lower error for "wavelength_bragg" + integer(ids_int) :: wavelength_bragg_error_index=ids_int_invalid !Index in the error_description list for "wavelength_bragg" + real(ids_real) :: angle_bragg=ids_real_invalid !Bragg angle of the crystal + real(ids_real) :: angle_bragg_error_upper=ids_real_invalid !Upper error for "angle_bragg" + real(ids_real) :: angle_bragg_error_lower=ids_real_invalid !Lower error for "angle_bragg" + integer(ids_int) :: angle_bragg_error_index=ids_int_invalid !Index in the error_description list for "angle_bragg" + real(ids_real) :: thickness=ids_real_invalid !Thickness of the crystal + real(ids_real) :: thickness_error_upper=ids_real_invalid !Upper error for "thickness" + real(ids_real) :: thickness_error_lower=ids_real_invalid !Lower error for "thickness" + integer(ids_int) :: thickness_error_index=ids_int_invalid !Index in the error_description list for "thickness" + integer(ids_int), pointer :: cut(:) => null() !Miller indices characterizing the cut of the crystal (can be of length 3 or 4) + type(ids_identifier_static) :: mesh_type !Crystal mesh type + end type + + type :: ids_spectrometer_x_ray_crystal_bin + integer(ids_int), pointer :: z_pixel_range(:) => null() !Vertical pixel index range indicating the corresponding binned detector area + real(ids_real), pointer :: wavelength(:) => null() !Wavelength of incoming photons on each horizontal pixel of this bin. + real(ids_real), pointer :: wavelength_error_upper(:) => null() !Upper error for "wavelength" + real(ids_real), pointer :: wavelength_error_lower(:) => null() !Lower error for "wavelength" + integer(ids_int) :: wavelength_error_index=ids_int_invalid !Index in the error_description list for "wavelength" + type(ids_line_of_sight_2points) :: line_of_sight !Description of the line of sight from the crystal to the plasma for this bin, defined by two points + end type + + type :: ids_spectrometer_x_ray_crystal_frame + real(ids_real), pointer :: counts_n(:,:) => null() !Number of counts detected on each pixel of the frame during one exposure time + real(ids_real), pointer :: counts_n_error_upper(:,:) => null() !Upper error for "counts_n" + real(ids_real), pointer :: counts_n_error_lower(:,:) => null() !Lower error for "counts_n" + integer(ids_int) :: counts_n_error_index=ids_int_invalid !Index in the error_description list for "counts_n" + real(ids_real), pointer :: counts_bin_n(:,:) => null() !Number of counts detected on each pixel/bin of the binned frame during one exposure time + real(ids_real), pointer :: counts_bin_n_error_upper(:,:) => null() !Upper error for "counts_bin_n" + real(ids_real), pointer :: counts_bin_n_error_lower(:,:) => null() !Lower error for "counts_bin_n" + integer(ids_int) :: counts_bin_n_error_index=ids_int_invalid !Index in the error_description list for "counts_bin_n" + real(ids_real) :: time=ids_real_invalid !Time + end type + + type :: ids_spectrometer_x_ray_crystal_flt_2d_time_1 + real(ids_real), pointer :: data(:,:) => null() !Data + real(ids_real), pointer :: data_error_upper(:,:) => null() !Upper error for "data" + real(ids_real), pointer :: data_error_lower(:,:) => null() !Lower error for "data" + integer(ids_int) :: data_error_index=ids_int_invalid !Index in the error_description list for "data" + integer(ids_int), pointer :: validity_timed(:) => null() !Indicator of the validity of the data for each time slice. 0: valid from automated processing, 1: valid and certified by the diagn! + !ostic RO; - 1 means problem identified in the data processing (request verification by the diagnostic RO), -2: invalid data, shoul! + !d not be used (values lower than -2 have a code-specific meaning detailing the origin of their invalidity) + integer(ids_int) :: validity=ids_int_invalid !Indicator of the validity of the data for the whole acquisition period. 0: valid from automated processing, 1: valid and certified! + ! by the diagnostic RO; - 1 means problem identified in the data processing (request verification by the diagnostic RO), -2: invali! + !d data, should not be used (values lower than -2 have a code-specific meaning detailing the origin of their invalidity) + end type + + type :: ids_spectrometer_x_ray_crystal_proxy + type(ids_rzphi1d_static) :: lines_of_sight_second_point !For each profile point, a line of sight is defined by a first point given by the centre of the crystal and a second point describe! + !d here. + type(ids_spectrometer_x_ray_crystal_flt_2d_time_1) :: lines_of_sight_rho_tor_norm !Shortest distance in rho_tor_norm between lines of sight and magnetic axis, signed with following convention : positive (resp. neg! + !ative) means the point of shortest distance is above (resp. below) the magnetic axis + type(ids_spectrometer_x_ray_crystal_flt_2d_time_1) :: t_i !Ion temperature (estimated from a spectral fit directly on the output line-integrated signal, without tomographic inversion) + type(ids_spectrometer_x_ray_crystal_flt_2d_time_1) :: t_e !Electron temperature (estimated from a spectral fit directly on the output line-integrated signal, without tomographic inversion) + type(ids_spectrometer_x_ray_crystal_flt_2d_time_1) :: velocity_tor !Toroidal velocity (estimated from a spectral fit directly on the output line-integrated signal, without tomographic inversion) + real(ids_real), pointer :: time(:) => null() !Timebase for the dynamic nodes of this probe located at this level of the IDS structure + end type + + type :: ids_spectrometer_x_ray_crystal_instrument_function + real(ids_real), pointer :: wavelengths(:) => null() !Array of wavelengths on which the instrument function is defined + real(ids_real), pointer :: wavelengths_error_upper(:) => null() !Upper error for "wavelengths" + real(ids_real), pointer :: wavelengths_error_lower(:) => null() !Lower error for "wavelengths" + integer(ids_int) :: wavelengths_error_index=ids_int_invalid !Index in the error_description list for "wavelengths" + real(ids_real), pointer :: values(:,:,:) => null() !Explicit instrument function values for the detector. When multiplied by the line-integrated emission spectrum in photons/second/s! + !r/m/m^2 received on a pixel of the detector, gives the detector pixel output in counts/seconds. + real(ids_real), pointer :: values_error_upper(:,:,:) => null() !Upper error for "values" + real(ids_real), pointer :: values_error_lower(:,:,:) => null() !Lower error for "values" + integer(ids_int) :: values_error_index=ids_int_invalid !Index in the error_description list for "values" + type(ids_identifier_static) :: type !Instrument function type + real(ids_real), pointer :: intensity(:,:) => null() !Scaling factor for the instrument function such that convolving the instrument function with an emission spectrum gives the counts! + ! per second on the detector + real(ids_real), pointer :: intensity_error_upper(:,:) => null() !Upper error for "intensity" + real(ids_real), pointer :: intensity_error_lower(:,:) => null() !Lower error for "intensity" + integer(ids_int) :: intensity_error_index=ids_int_invalid !Index in the error_description list for "intensity" + real(ids_real), pointer :: centre(:,:) => null() !Centre (in terms of absolute wavelength) of instrument function + real(ids_real), pointer :: centre_error_upper(:,:) => null() !Upper error for "centre" + real(ids_real), pointer :: centre_error_lower(:,:) => null() !Lower error for "centre" + integer(ids_int) :: centre_error_index=ids_int_invalid !Index in the error_description list for "centre" + real(ids_real), pointer :: sigma(:,:) => null() !Standard deviation of Gaussian instrument function + real(ids_real), pointer :: sigma_error_upper(:,:) => null() !Upper error for "sigma" + real(ids_real), pointer :: sigma_error_lower(:,:) => null() !Lower error for "sigma" + integer(ids_int) :: sigma_error_index=ids_int_invalid !Index in the error_description list for "sigma" + real(ids_real), pointer :: scale(:,:) => null() !Scale of Lorentzian instrument function (full width at half height) + real(ids_real), pointer :: scale_error_upper(:,:) => null() !Upper error for "scale" + real(ids_real), pointer :: scale_error_lower(:,:) => null() !Lower error for "scale" + integer(ids_int) :: scale_error_index=ids_int_invalid !Index in the error_description list for "scale" + end type + + type :: ids_spectrometer_x_ray_crystal_channel + real(ids_real) :: exposure_time=ids_real_invalid !Exposure time of the measurement + real(ids_real) :: exposure_time_error_upper=ids_real_invalid !Upper error for "exposure_time" + real(ids_real) :: exposure_time_error_lower=ids_real_invalid !Lower error for "exposure_time" + integer(ids_int) :: exposure_time_error_index=ids_int_invalid !Index in the error_description list for "exposure_time" + real(ids_real), pointer :: energy_bound_lower(:,:) => null() !Lower energy bound for the photon detection, for each pixel (horizontal, vertical) + real(ids_real), pointer :: energy_bound_lower_error_upper(:,:) => null() !Upper error for "energy_bound_lower" + real(ids_real), pointer :: energy_bound_lower_error_lower(:,:) => null() !Lower error for "energy_bound_lower" + integer(ids_int) :: energy_bound_lower_error_index=ids_int_invalid !Index in the error_description list for "energy_bound_lower" + real(ids_real), pointer :: energy_bound_upper(:,:) => null() !Upper energy bound for the photon detection, for each pixel (horizontal, vertical) + real(ids_real), pointer :: energy_bound_upper_error_upper(:,:) => null() !Upper error for "energy_bound_upper" + real(ids_real), pointer :: energy_bound_upper_error_lower(:,:) => null() !Lower error for "energy_bound_upper" + integer(ids_int) :: energy_bound_upper_error_index=ids_int_invalid !Index in the error_description list for "energy_bound_upper" + type(ids_detector_aperture) :: aperture !Collimating aperture + type(ids_curved_object), pointer :: reflector(:) => null() !Set of reflectors (optional) reflecting the light coming from the plasma towards the crystal. If empty, means that the plasma ligh! + !t directly arrives on the crystal. + type(ids_spectrometer_x_ray_crystal_crystal) :: crystal !Characteristics of the crystal used + type(ids_filter_window), pointer :: filter_window(:) => null() !Set of filter windows + type(ids_camera_geometry) :: camera !Characteristics of the camera used + real(ids_real), pointer :: z_frames(:) => null() !Height of the observed zone at the focal plane in the plasma, corresponding to the vertical dimension of the frame + real(ids_real), pointer :: z_frames_error_upper(:) => null() !Upper error for "z_frames" + real(ids_real), pointer :: z_frames_error_lower(:) => null() !Lower error for "z_frames" + integer(ids_int) :: z_frames_error_index=ids_int_invalid !Index in the error_description list for "z_frames" + real(ids_real), pointer :: wavelength_frames(:,:) => null() !Wavelength of incoming photons on each pixel of the frames, mainly varying accross the horizontal dimension of the frame. However ! + !a 2D map of the wavelength is given since it is not constant vertically due to the elliptical curvature of the photon iso-surfaces + real(ids_real), pointer :: wavelength_frames_error_upper(:,:) => null() !Upper error for "wavelength_frames" + real(ids_real), pointer :: wavelength_frames_error_lower(:,:) => null() !Lower error for "wavelength_frames" + integer(ids_int) :: wavelength_frames_error_index=ids_int_invalid !Index in the error_description list for "wavelength_frames" + type(ids_spectrometer_x_ray_crystal_bin), pointer :: bin(:) => null() !Set of bins (binning in the vertical dimension) defined to increase the signal to noise ratio of the spectra + type(ids_spectrometer_x_ray_crystal_frame), pointer :: frame(:) => null() !Set of frames + real(ids_real), pointer :: energies(:) => null() !Array of energy values for tabulation of the detection efficiency + real(ids_real), pointer :: energies_error_upper(:) => null() !Upper error for "energies" + real(ids_real), pointer :: energies_error_lower(:) => null() !Lower error for "energies" + integer(ids_int) :: energies_error_index=ids_int_invalid !Index in the error_description list for "energies" + real(ids_real), pointer :: detection_efficiency(:) => null() !Probability of detection of a photon impacting the detector as a function of its energy + real(ids_real), pointer :: detection_efficiency_error_upper(:) => null() !Upper error for "detection_efficiency" + real(ids_real), pointer :: detection_efficiency_error_lower(:) => null() !Lower error for "detection_efficiency" + integer(ids_int) :: detection_efficiency_error_index=ids_int_invalid !Index in the error_description list for "detection_efficiency" + type(ids_spectrometer_x_ray_crystal_proxy) :: profiles_line_integrated !Profiles proxies are given in the vertical direction of the detector. They are estimated directly from the camera, without tomogra! + !phic inversion. Binning is allowed so the number of profile points may be lower than the length of z_frames. Physical quantities d! + !educed from the measured spectra are given for each profile point. They correspond to the spectra integrated along lines of sight,! + ! defined by a first point given by the centre of the crystal and a second point (depending on the profile point) described below. + type(ids_spectrometer_x_ray_crystal_instrument_function) :: instrument_function !Instrument function, i.e. response of the detector to a monochromatic emission passing through the spectrometer. The resulting ima! + !ge on the detector will be a 2-D distribution of pixel values, for each wavelength. It can be given as explicit values for each de! + !tector pixel (values node) or as a parametric function of wavelength (described by the other nodes) + end type + + + ! *********** spectrometer_x_ray_crystal IDS + type, extends(IDS_base) :: ids_spectrometer_x_ray_crystal !X-crystal spectrometer diagnostic + logical, private :: c_data = .FALSE. ! Fortran specific metadata telling whether the IDS has been populated from C allocated data (LL) or not + integer, private :: max_occurrence = 2! Maximum occurrence allowed as defined in the DD + + type(ids_ids_properties) :: ids_properties !Interface Data Structure properties. This element identifies the node above as an IDS + type(ids_spectrometer_x_ray_crystal_channel), pointer :: channel(:) => null() !Measurement channel, composed of a camera, a crystal, and (optional) a set of reflectors. The light coming from the plasma passes ! + !through the (optional) set of reflectors, then the crystal and arrives at the camera + real(ids_real) :: latency=ids_real_invalid !Upper bound of the delay between physical information received by the detector and data available on the real-time (RT) network. + real(ids_real) :: latency_error_upper=ids_real_invalid !Upper error for "latency" + real(ids_real) :: latency_error_lower=ids_real_invalid !Lower error for "latency" + integer(ids_int) :: latency_error_index=ids_int_invalid !Index in the error_description list for "latency" + type(ids_code) :: code !Generic decription of the code-specific parameters for the code that has produced this IDS + real(ids_real), pointer :: time(:) => null() !Generic time + end type + + ! *********** summary IDS internal structures declaration + + type :: ids_summary_static_str_0d + character(len=ids_string_length), dimension(:), pointer :: value => null() !Value + character(len=ids_string_length), dimension(:), pointer :: source => null() !Source of the data (any comment describing the origin of the data : code, path to diagnostic signals, processing method, ...) + end type + + type :: ids_summary_static_int_0d + integer(ids_int) :: value=ids_int_invalid !Value + character(len=ids_string_length), dimension(:), pointer :: source => null() !Source of the data (any comment describing the origin of the data : code, path to diagnostic signals, processing method, ...) + end type + + type :: ids_summary_dynamic_int_1d_root + integer(ids_int), pointer :: value(:) => null() !Value + character(len=ids_string_length), dimension(:), pointer :: source => null() !Source of the data (any comment describing the origin of the data : code, path to diagnostic signals, processing method, ...) + end type + + type :: ids_summary_dynamic_flt_1d_root + real(ids_real), pointer :: value(:) => null() !Value + real(ids_real), pointer :: value_error_upper(:) => null() !Upper error for "value" + real(ids_real), pointer :: value_error_lower(:) => null() !Lower error for "value" + integer(ids_int) :: value_error_index=ids_int_invalid !Index in the error_description list for "value" + character(len=ids_string_length), dimension(:), pointer :: source => null() !Source of the data (any comment describing the origin of the data : code, path to diagnostic signals, processing method, ...) + end type + + type :: ids_summary_constant_flt_0d + real(ids_real) :: value=ids_real_invalid !Value + real(ids_real) :: value_error_upper=ids_real_invalid !Upper error for "value" + real(ids_real) :: value_error_lower=ids_real_invalid !Lower error for "value" + integer(ids_int) :: value_error_index=ids_int_invalid !Index in the error_description list for "value" + character(len=ids_string_length), dimension(:), pointer :: source => null() !Source of the data (any comment describing the origin of the data : code, path to diagnostic signals, processing method, ...) + end type + + type :: ids_summary_global_quantities + type(ids_summary_dynamic_flt_1d_root) :: ip !Total plasma current (toroidal component). Positive sign means anti-clockwise when viewed from above. + type(ids_summary_dynamic_flt_1d_root) :: current_non_inductive !Total non-inductive current (toroidal component). Positive sign means anti-clockwise when viewed from above. + type(ids_summary_dynamic_flt_1d_root) :: current_bootstrap !Bootstrap current (toroidal component). Positive sign means anti-clockwise when viewed from above. + type(ids_summary_dynamic_flt_1d_root) :: current_ohm !Ohmic current (toroidal component). Positive sign means anti-clockwise when viewed from above. + type(ids_summary_dynamic_flt_1d_root) :: current_alignment !Figure of merit of the alignment of the current profile sources, defined in the following reference: http://iopscience.iop.org/art! + !icle/10.1088/0029-5515/43/7/318 + type(ids_summary_dynamic_flt_1d_root) :: v_loop !LCFS loop voltage (positive value drives positive ohmic current that flows anti-clockwise when viewed from above) + type(ids_summary_dynamic_flt_1d_root) :: li !Internal inductance. The li_3 definition is used, i.e. li_3 = 2/R0/mu0^2/Ip^2 * int(Bp^2 dV). + type(ids_summary_dynamic_flt_1d_root) :: li_mhd !Internal inductance as determined by an equilibrium reconstruction code. Use this only when the li node above is used for another ! + !estimation method and there is a need to store a second value of li (determined by an equilibrium reconstruction code). The li_3 d! + !efinition is used, i.e. li_3 = 2/R0/mu0^2/Ip^2 * int(Bp^2 dV). + type(ids_summary_dynamic_flt_1d_root) :: beta_tor !Toroidal beta, defined as the volume-averaged total perpendicular pressure divided by (B0^2/(2*mu0)), i.e. beta_toroidal = 2 mu0 i! + !nt(p dV) / V / B0^2 + type(ids_summary_dynamic_flt_1d_root) :: beta_tor_mhd !Toroidal beta, using the pressure determined by an equilibrium reconstruction code + type(ids_summary_dynamic_flt_1d_root) :: beta_tor_norm !Normalised toroidal beta, defined as 100 * beta_tor * a[m] * B0 [T] / ip [MA] + type(ids_summary_dynamic_flt_1d_root) :: beta_tor_norm_mhd !Normalised toroidal beta, using the pressure determined by an equilibrium reconstruction code + type(ids_summary_dynamic_flt_1d_root) :: beta_tor_thermal_norm !Normalised toroidal beta from thermal pressure only, defined as 100 * beta_tor_thermal * a[m] * B0 [T] / ip [MA] + type(ids_summary_dynamic_flt_1d_root) :: beta_pol !Poloidal beta. Defined as betap = 4 int(p dV) / [R_0 * mu_0 * Ip^2] + type(ids_summary_dynamic_flt_1d_root) :: beta_pol_mhd !Poloidal beta estimated from the pressure determined by an equilibrium reconstruction code. Defined as betap = 4 int(p dV) / [R_0 ! + !* mu_0 * Ip^2] + type(ids_summary_dynamic_flt_1d_root) :: energy_diamagnetic !Plasma diamagnetic energy content = 3/2 * integral over the plasma volume of the total perpendicular pressure + type(ids_summary_dynamic_flt_1d_root) :: denergy_diamagnetic_dt !Time derivative of the diamagnetic plasma energy content + type(ids_summary_dynamic_flt_1d_root) :: energy_total !Plasma energy content = 3/2 * integral over the plasma volume of the total kinetic pressure + type(ids_summary_dynamic_flt_1d_root) :: energy_mhd !Plasma energy content = 3/2 * integral over the plasma volume of the total kinetic pressure (pressure determined by an equilibrium! + ! reconstruction code) + type(ids_summary_dynamic_flt_1d_root) :: energy_thermal !Thermal plasma energy content = 3/2 * integral over the plasma volume of the thermal pressure + type(ids_summary_dynamic_flt_1d_root) :: energy_ion_total_thermal !Thermal ion plasma energy content (sum over the ion species) = 3/2 * integral over the plasma volume of the thermal ion pressure + type(ids_summary_dynamic_flt_1d_root) :: energy_electrons_thermal !Thermal electron plasma energy content = 3/2 * integral over the plasma volume of the thermal electron pressure + type(ids_summary_dynamic_flt_1d_root) :: denergy_thermal_dt !Time derivative of the thermal plasma energy content + type(ids_summary_dynamic_flt_1d_root) :: energy_b_field_pol !Poloidal magnetic plasma energy content = 1/(2.mu0) * integral over the plasma volume of b_field_pol^2 + type(ids_summary_dynamic_flt_1d_root) :: energy_fast_perpendicular !Fast particles perpendicular energy content = 3/2 * integral over the plasma volume of the fast perpendicular pressure + type(ids_summary_dynamic_flt_1d_root) :: energy_fast_parallel !Fast particles parallel energy content = 3/2 * integral over the plasma volume of the fast parallel pressure + type(ids_summary_dynamic_flt_1d_root) :: volume !Volume of the confined plasma + type(ids_summary_dynamic_int_1d_root) :: h_mode !H-mode flag: 0 when the plasma is in L-mode and 1 when in H-mode + type(ids_summary_constant_flt_0d) :: r0 !Reference major radius where the vacuum toroidal magnetic field is given (usually a fixed position such as the middle of the vesse! + !l at the equatorial midplane) + type(ids_summary_dynamic_flt_1d_root) :: b0 !Vacuum toroidal field at R0. Positive sign means anti-clockwise when viewed from above. The product R0B0 must be consistent with t! + !he b_tor_vacuum_r field of the tf IDS. + type(ids_summary_dynamic_flt_1d_root) :: fusion_gain !Fusion gain : ratio of the power provided by fusion reactions to the auxiliary power needed to heat the plasma. Often noted as Q i! + !n the litterature. + type(ids_summary_dynamic_flt_1d_root) :: h_98 !Energy confinement time enhancement factor over the IPB98(y,2) scaling + type(ids_summary_dynamic_flt_1d_root) :: tau_energy !Energy confinement time + type(ids_summary_dynamic_flt_1d_root) :: tau_helium !Helium confinement time + type(ids_summary_dynamic_flt_1d_root) :: tau_resistive !Current diffusion characteristic time + type(ids_summary_dynamic_flt_1d_root) :: tau_energy_98 !Energy confinement time estimated from the IPB98(y,2) scaling + type(ids_summary_dynamic_flt_1d_root) :: ratio_tau_helium_fuel !Ratio of Helium confinement time to fuel confinement time + type(ids_summary_dynamic_flt_1d_root) :: resistance !Plasma electric resistance + type(ids_summary_dynamic_flt_1d_root) :: q_95 !q at the 95% poloidal flux surface (IMAS uses COCOS=11: only positive when toroidal current and magnetic field are in same directi! + !on) + type(ids_summary_dynamic_flt_1d_root) :: power_ohm !Ohmic power + type(ids_summary_dynamic_flt_1d_root) :: power_steady !Total power coupled to the plasma minus dW/dt (correcting from transient energy content) + type(ids_summary_dynamic_flt_1d_root) :: power_radiated !Total radiated power + type(ids_summary_dynamic_flt_1d_root) :: power_radiated_inside_lcfs !Radiated power from the plasma inside the Last Closed Flux Surface + type(ids_summary_dynamic_flt_1d_root) :: power_radiated_outside_lcfs !Radiated power from the plasma outside the Last Closed Flux Surface + type(ids_summary_dynamic_flt_1d_root) :: power_line !Radiated power from line radiation + type(ids_summary_dynamic_flt_1d_root) :: power_bremsstrahlung !Radiated power from Bremsstrahlung + type(ids_summary_dynamic_flt_1d_root) :: power_synchrotron !Radiated power from synchrotron radiation + type(ids_summary_dynamic_flt_1d_root) :: power_loss !Power through separatrix + type(ids_summary_dynamic_flt_1d_root) :: greenwald_fraction !Greenwald fraction =line_average/n_e/value divided by (global_quantities/ip/value *1e6 * pi * minor_radius^2) + type(ids_summary_dynamic_flt_1d_root) :: fusion_fluence !Fusion fluence : power provided by fusion reactions, integrated over time since the beginning of the pulse + type(ids_summary_dynamic_flt_1d_root) :: psi_external_average !Average (over the plasma poloidal cross section) plasma poloidal magnetic flux produced by all toroidal loops (active coils and pa! + !ssive loops) but the plasma, given by the following formula : int(psi_loops.j_tor.dS) / Ip + end type + + type :: ids_summary_local_position_r_z + real(ids_real), pointer :: rho_tor_norm(:) => null() !Normalised toroidal flux coordinate. The normalizing value for rho_tor_norm, is the toroidal flux coordinate at the equilibrium bo! + !undary (LCFS or 99.x % of the LCFS in case of a fixed boundary equilibium calculation, see time_slice/boundary/b_flux_pol_norm in ! + !the equilibrium IDS) + real(ids_real), pointer :: rho_tor_norm_error_upper(:) => null() !Upper error for "rho_tor_norm" + real(ids_real), pointer :: rho_tor_norm_error_lower(:) => null() !Lower error for "rho_tor_norm" + integer(ids_int) :: rho_tor_norm_error_index=ids_int_invalid !Index in the error_description list for "rho_tor_norm" + real(ids_real), pointer :: rho_tor(:) => null() !Toroidal flux coordinate. rho_tor = sqrt(b_flux_tor/(pi*b0)) ~ sqrt(pi*r^2*b0/(pi*b0)) ~ r [m]. The toroidal field used in its def! + !inition is indicated under global_quantities/b0 + real(ids_real), pointer :: rho_tor_error_upper(:) => null() !Upper error for "rho_tor" + real(ids_real), pointer :: rho_tor_error_lower(:) => null() !Lower error for "rho_tor" + integer(ids_int) :: rho_tor_error_index=ids_int_invalid !Index in the error_description list for "rho_tor" + real(ids_real), pointer :: psi(:) => null() !Poloidal magnetic flux + real(ids_real), pointer :: psi_error_upper(:) => null() !Upper error for "psi" + real(ids_real), pointer :: psi_error_lower(:) => null() !Lower error for "psi" + integer(ids_int) :: psi_error_index=ids_int_invalid !Index in the error_description list for "psi" + real(ids_real), pointer :: r(:) => null() !Major radius + real(ids_real), pointer :: r_error_upper(:) => null() !Upper error for "r" + real(ids_real), pointer :: r_error_lower(:) => null() !Lower error for "r" + integer(ids_int) :: r_error_index=ids_int_invalid !Index in the error_description list for "r" + real(ids_real), pointer :: z(:) => null() !Height + real(ids_real), pointer :: z_error_upper(:) => null() !Upper error for "z" + real(ids_real), pointer :: z_error_lower(:) => null() !Lower error for "z" + integer(ids_int) :: z_error_index=ids_int_invalid !Index in the error_description list for "z" + end type + + type :: ids_summary_dynamic_flt_1d_root_parent_2 + real(ids_real), pointer :: value(:) => null() !Value + real(ids_real), pointer :: value_error_upper(:) => null() !Upper error for "value" + real(ids_real), pointer :: value_error_lower(:) => null() !Lower error for "value" + integer(ids_int) :: value_error_index=ids_int_invalid !Index in the error_description list for "value" + character(len=ids_string_length), dimension(:), pointer :: source => null() !Source of the data (any comment describing the origin of the data : code, path to diagnostic signals, processing method, ...) + end type + + type :: ids_summary_species + type(ids_summary_dynamic_flt_1d_root_parent_2) :: hydrogen !Hydrogen (H) + type(ids_summary_dynamic_flt_1d_root_parent_2) :: deuterium !Deuterium (D) + type(ids_summary_dynamic_flt_1d_root_parent_2) :: tritium !Tritium (T) + type(ids_summary_dynamic_flt_1d_root_parent_2) :: helium_3 !Helium isotope with 3 nucleons (3He) + type(ids_summary_dynamic_flt_1d_root_parent_2) :: helium_4 !Helium isotope with 4 nucleons (4He) + type(ids_summary_dynamic_flt_1d_root_parent_2) :: beryllium !Beryllium (Be) + type(ids_summary_dynamic_flt_1d_root_parent_2) :: lithium !Lithium (Li) + type(ids_summary_dynamic_flt_1d_root_parent_2) :: carbon !Carbon (C) + type(ids_summary_dynamic_flt_1d_root_parent_2) :: nitrogen !Nitrogen (N) + type(ids_summary_dynamic_flt_1d_root_parent_2) :: neon !Neon (Ne) + type(ids_summary_dynamic_flt_1d_root_parent_2) :: argon !Argon (Ar) + type(ids_summary_dynamic_flt_1d_root_parent_2) :: xenon !Xenon (Xe) + type(ids_summary_dynamic_flt_1d_root_parent_2) :: oxygen !Oxygen (O) + type(ids_summary_dynamic_flt_1d_root_parent_2) :: tungsten !Tungsten (W) + type(ids_summary_dynamic_flt_1d_root_parent_2) :: iron !Iron (Fe) + type(ids_summary_dynamic_flt_1d_root_parent_2) :: krypton !Krypton (Kr) + end type + + type :: ids_summary_species_tor_angle + type(ids_summary_dynamic_flt_1d_root_parent_2) :: hydrogen !Hydrogen (H) + type(ids_summary_dynamic_flt_1d_root_parent_2) :: deuterium !Deuterium (D) + type(ids_summary_dynamic_flt_1d_root_parent_2) :: tritium !Tritium (T) + type(ids_summary_dynamic_flt_1d_root_parent_2) :: helium_3 !Helium isotope with 3 nucleons (3He) + type(ids_summary_dynamic_flt_1d_root_parent_2) :: helium_4 !Helium isotope with 4 nucleons (4He) + type(ids_summary_dynamic_flt_1d_root_parent_2) :: beryllium !Beryllium (Be) + type(ids_summary_dynamic_flt_1d_root_parent_2) :: lithium !Lithium (Li) + type(ids_summary_dynamic_flt_1d_root_parent_2) :: carbon !Carbon (C) + type(ids_summary_dynamic_flt_1d_root_parent_2) :: nitrogen !Nitrogen (N) + type(ids_summary_dynamic_flt_1d_root_parent_2) :: neon !Neon (Ne) + type(ids_summary_dynamic_flt_1d_root_parent_2) :: argon !Argon (Ar) + type(ids_summary_dynamic_flt_1d_root_parent_2) :: xenon !Xenon (Xe) + type(ids_summary_dynamic_flt_1d_root_parent_2) :: oxygen !Oxygen (O) + type(ids_summary_dynamic_flt_1d_root_parent_2) :: tungsten !Tungsten (W) + type(ids_summary_dynamic_flt_1d_root_parent_2) :: iron !Iron (Fe) + type(ids_summary_dynamic_flt_1d_root_parent_2) :: krypton !Krypton (Kr) + end type + + type :: ids_summary_local_quantities_r_z + type(ids_summary_local_position_r_z) :: position !Radial position at which physics quantities are evaluated + type(ids_summary_dynamic_flt_1d_root) :: t_e !Electron temperature + type(ids_summary_dynamic_flt_1d_root) :: t_i_average !Ion temperature (average over ion species) + type(ids_summary_dynamic_flt_1d_root) :: n_e !Electron density + type(ids_summary_species) :: n_i !Ion density per species + type(ids_summary_dynamic_flt_1d_root) :: n_i_total !Total ion density (sum over species) + type(ids_summary_dynamic_flt_1d_root) :: zeff !Effective charge + type(ids_summary_dynamic_flt_1d_root) :: momentum_tor !Total plasma toroidal momentum, summed over ion species and electrons + type(ids_summary_species_tor_angle) :: velocity_tor !Ion toroidal rotation velocity, per species + type(ids_summary_dynamic_flt_1d_root) :: q !Safety factor (IMAS uses COCOS=11: only positive when toroidal current and magnetic field are in same direction) + type(ids_summary_dynamic_flt_1d_root) :: magnetic_shear !Magnetic shear, defined as rho_tor/q . dq/drho_tor + type(ids_summary_dynamic_flt_1d_root) :: b_field !Magnetic field + type(ids_summary_dynamic_flt_1d_root) :: e_field_parallel !Average on the magnetic surface of (e_field.b_field) / B0, where B0 is global_quantities/b0/value + end type + + type :: ids_summary_local_position + real(ids_real), pointer :: rho_tor_norm(:) => null() !Normalised toroidal flux coordinate. The normalizing value for rho_tor_norm, is the toroidal flux coordinate at the equilibrium bo! + !undary (LCFS or 99.x % of the LCFS in case of a fixed boundary equilibium calculation, see time_slice/boundary/b_flux_pol_norm in ! + !the equilibrium IDS) + real(ids_real), pointer :: rho_tor_norm_error_upper(:) => null() !Upper error for "rho_tor_norm" + real(ids_real), pointer :: rho_tor_norm_error_lower(:) => null() !Lower error for "rho_tor_norm" + integer(ids_int) :: rho_tor_norm_error_index=ids_int_invalid !Index in the error_description list for "rho_tor_norm" + real(ids_real), pointer :: rho_tor(:) => null() !Toroidal flux coordinate. rho_tor = sqrt(b_flux_tor/(pi*b0)) ~ sqrt(pi*r^2*b0/(pi*b0)) ~ r [m]. The toroidal field used in its def! + !inition is indicated under global_quantities/b0 + real(ids_real), pointer :: rho_tor_error_upper(:) => null() !Upper error for "rho_tor" + real(ids_real), pointer :: rho_tor_error_lower(:) => null() !Lower error for "rho_tor" + integer(ids_int) :: rho_tor_error_index=ids_int_invalid !Index in the error_description list for "rho_tor" + real(ids_real), pointer :: psi(:) => null() !Poloidal magnetic flux + real(ids_real), pointer :: psi_error_upper(:) => null() !Upper error for "psi" + real(ids_real), pointer :: psi_error_lower(:) => null() !Lower error for "psi" + integer(ids_int) :: psi_error_index=ids_int_invalid !Index in the error_description list for "psi" + end type + + type :: ids_summary_local_quantities + type(ids_summary_local_position) :: position !Radial position at which physics quantities are evaluated + type(ids_summary_dynamic_flt_1d_root) :: t_e !Electron temperature + type(ids_summary_dynamic_flt_1d_root) :: t_i_average !Ion temperature (average over ion species) + type(ids_summary_dynamic_flt_1d_root) :: n_e !Electron density + type(ids_summary_species) :: n_i !Ion density per species + type(ids_summary_dynamic_flt_1d_root) :: n_i_total !Total ion density (sum over species) + type(ids_summary_dynamic_flt_1d_root) :: zeff !Effective charge + type(ids_summary_dynamic_flt_1d_root) :: momentum_tor !Total plasma toroidal momentum, summed over ion species and electrons + type(ids_summary_species_tor_angle) :: velocity_tor !Ion toroidal rotation velocity, per species + type(ids_summary_dynamic_flt_1d_root) :: q !Safety factor + type(ids_summary_dynamic_flt_1d_root) :: magnetic_shear !Magnetic shear, defined as rho_tor/q . dq/drho_tor + type(ids_summary_dynamic_flt_1d_root) :: e_field_parallel !Average on the magnetic surface of (e_field.b_field) / B0, where B0 is global_quantities/b0/value + end type + + type :: ids_summary_local_quantities_no_position_name + type(ids_summary_static_str_0d) :: name !Name of the limiter or divertor plate. Standard names are : LI (resp. LO) for lower inner (resp. outer) plates; UI (resp. UO) for! + ! upper inner (resp. outer) plates. + type(ids_summary_dynamic_flt_1d_root) :: t_e !Electron temperature + type(ids_summary_dynamic_flt_1d_root) :: t_i_average !Ion temperature (average over ion species) + type(ids_summary_dynamic_flt_1d_root) :: n_e !Electron density + type(ids_summary_species) :: n_i !Ion density per species + type(ids_summary_dynamic_flt_1d_root) :: n_i_total !Total ion density (sum over species) + type(ids_summary_dynamic_flt_1d_root) :: zeff !Effective charge + type(ids_summary_dynamic_flt_1d_root) :: flux_expansion !Magnetic flux expansion as defined by Stangeby : ratio between the poloidal field at the midplane separatrix and the poloidal fiel! + !d at the strike-point see formula attached, where u means upstream (midplane separatrix) and t means at divertor target (downstrea! + !m). + type(ids_summary_dynamic_flt_1d_root) :: power_flux_peak !Peak power flux on the divertor target or limiter surface + end type + + type :: ids_summary_local_quantities_stellerator + type(ids_summary_dynamic_flt_1d_root) :: effective_helical_ripple !Effective helical ripple for 1/nu neoclassical regime (see [Beidler, C. D., and W. N. G. Hitchon, 1994, Plasma Phys. Control. Fusi! + !on 35, 317]) + type(ids_summary_dynamic_flt_1d_root) :: plateau_factor !Plateau factor, as defined in equation (25) of reference [Stroth U. et al 1998 Plasma Phys. Control. Fusion 40 1551] + type(ids_summary_dynamic_flt_1d_root) :: iota !Rotational transform (1/q) + end type + + type :: ids_summary_local + type(ids_summary_local_quantities_r_z) :: magnetic_axis !Parameters at magnetic axis + type(ids_summary_local_quantities) :: separatrix !Parameters at separatrix (intersection of the separatrix and the outboard midplane) + type(ids_summary_local_quantities) :: separatrix_average !Flux surface averaged parameters at separatrix (flux-surface average over the entire core-SOL boundary separatrix) + type(ids_summary_local_quantities) :: pedestal !Parameters at pedestal top + type(ids_summary_local_quantities) :: itb !Parameters at internal transport barrier + type(ids_summary_local_quantities_no_position_name) :: limiter !Parameters at the limiter tangency point + type(ids_summary_local_quantities_no_position_name), pointer :: divertor_plate(:) => null() !Parameters at a divertor plate + type(ids_summary_local_quantities_no_position_name), pointer :: divertor_target(:) => null() !Parameters at a divertor target + type(ids_summary_local_quantities_stellerator) :: r_eff_norm_2_3 !Parameters at r_eff_norm = 2/3, where r_eff_norm is the stellarator effective minor radius normalised to its value at the last clo! + !sed flux surface + end type + + type :: ids_summary_constant_str_0d + character(len=ids_string_length), dimension(:), pointer :: value => null() !Value + character(len=ids_string_length), dimension(:), pointer :: source => null() !Source of the data (any comment describing the origin of the data : code, path to diagnostic signals, processing method, ...) + end type + + type :: ids_summary_rz1d_dynamic + real(ids_real), pointer :: r(:) => null() !Major radius + real(ids_real), pointer :: r_error_upper(:) => null() !Upper error for "r" + real(ids_real), pointer :: r_error_lower(:) => null() !Lower error for "r" + integer(ids_int) :: r_error_index=ids_int_invalid !Index in the error_description list for "r" + real(ids_real), pointer :: z(:) => null() !Height + real(ids_real), pointer :: z_error_upper(:) => null() !Upper error for "z" + real(ids_real), pointer :: z_error_lower(:) => null() !Lower error for "z" + integer(ids_int) :: z_error_index=ids_int_invalid !Index in the error_description list for "z" + character(len=ids_string_length), dimension(:), pointer :: source => null() !Source of the data (any comment describing the origin of the data : code, path to diagnostic signals, processing method, ...) + end type + + type :: ids_summary_boundary + type(ids_summary_dynamic_int_1d_root) :: type !0 (limiter), 1 (diverted), 11 (LSN), 12 (USN), 13 (DN), 14 (snowflake) + type(ids_summary_dynamic_flt_1d_root) :: geometric_axis_r !R position of the geometric axis (defined as (Rmax+Rmin) / 2 of the boundary) + type(ids_summary_dynamic_flt_1d_root) :: geometric_axis_z !Z position of the geometric axis (defined as (Zmax+Zmin) / 2 of the boundary) + type(ids_summary_dynamic_flt_1d_root) :: magnetic_axis_r !R position of the magnetic axis + type(ids_summary_dynamic_flt_1d_root) :: magnetic_axis_z !Z position of the magnetic axis + type(ids_summary_dynamic_flt_1d_root) :: minor_radius !Minor radius of the plasma boundary (defined as (Rmax-Rmin) / 2 of the boundary) + type(ids_summary_dynamic_flt_1d_root) :: elongation !Elongation of the plasma boundary + type(ids_summary_dynamic_flt_1d_root) :: triangularity_upper !Upper triangularity of the plasma boundary + type(ids_summary_dynamic_flt_1d_root) :: triangularity_lower !Lower triangularity of the plasma boundary + type(ids_summary_dynamic_flt_1d_root) :: strike_point_inner_r !R position of the inner strike point + type(ids_summary_dynamic_flt_1d_root) :: strike_point_inner_z !Z position of the inner strike point + type(ids_summary_dynamic_flt_1d_root) :: strike_point_outer_r !R position of the outer strike point + type(ids_summary_dynamic_flt_1d_root) :: strike_point_outer_z !Z position of the outer strike point + type(ids_summary_constant_str_0d) :: strike_point_configuration !String describing the configuration of the strike points (constant, may need to become dynamic when available) + type(ids_summary_dynamic_flt_1d_root) :: gap_limiter_wall !Distance between the separatrix and the nearest limiter or wall element + type(ids_summary_dynamic_flt_1d_root) :: distance_inner_outer_separatrices !Distance between the inner and outer separatrices, in the major radius direction, at the plasma outboard and at the height corresp! + !onding to the maximum R for the inner separatrix. + type(ids_summary_rz1d_dynamic) :: x_point_main !RZ position of the main X-point + end type + + type :: ids_summary_pedestal_fit_ne + type(ids_summary_dynamic_flt_1d_root_parent_2) :: separatrix !Value at separatrix + type(ids_summary_dynamic_flt_1d_root_parent_2) :: pedestal_height !Pedestal height + type(ids_summary_dynamic_flt_1d_root) :: pedestal_width !Pedestal full width in normalised poloidal flux + type(ids_summary_dynamic_flt_1d_root) :: pedestal_position !Pedestal position in normalised poloidal flux + type(ids_summary_dynamic_flt_1d_root_parent_2) :: offset !Offset of the parent quantity in the SOL + type(ids_summary_dynamic_flt_1d_root_parent_2) :: d_dpsi_norm !Core slope of the parent quantity + type(ids_summary_dynamic_flt_1d_root_parent_2) :: d_dpsi_norm_max !Maximum gradient of the parent quantity (with respect to the normalised poloidal flux) in the pedestal + type(ids_summary_dynamic_flt_1d_root) :: d_dpsi_norm_max_position !Position (in terms of normalised poloidal flux) of the maximum gradient of the parent quantity in the pedestal + end type + + type :: ids_summary_pedestal_fit_te + type(ids_summary_dynamic_flt_1d_root_parent_2) :: pedestal_height !Pedestal height + type(ids_summary_dynamic_flt_1d_root) :: pedestal_width !Pedestal full width in normalised poloidal flux + type(ids_summary_dynamic_flt_1d_root) :: pedestal_position !Pedestal position in normalised poloidal flux + type(ids_summary_dynamic_flt_1d_root_parent_2) :: offset !Offset of the parent quantity in the SOL + type(ids_summary_dynamic_flt_1d_root_parent_2) :: d_dpsi_norm !Core slope of the parent quantity + type(ids_summary_dynamic_flt_1d_root_parent_2) :: d_dpsi_norm_max !Maximum gradient of the parent quantity (with respect to the normalised poloidal flux) in the pedestal + type(ids_summary_dynamic_flt_1d_root) :: d_dpsi_norm_max_position !Position (in terms of normalised poloidal flux) of the maximum gradient of the parent quantity in the pedestal + end type + + type :: ids_summary_pedestal_fit_stability_method + type(ids_summary_dynamic_flt_1d_root) :: alpha_critical !Critical normalized pressure gradient determined with self-consistent runs with an MHD stability code. Details of the method for s! + !canning parameters in the series of runs must be described in the 'source' node + type(ids_summary_dynamic_flt_1d_root) :: alpha_ratio !Ratio of alpha_critical over alpha_experimental + type(ids_summary_dynamic_flt_1d_root) :: t_e_pedestal_top_critical !Critical electron temperature at pedestal top determined with self-consistent runs with an MHD stability code. Details of the meth! + !od for scanning parameters in the series of runs must be described in the 'source' node + end type + + type :: ids_summary_pedestal_fit_stability + type(ids_summary_dynamic_flt_1d_root) :: alpha_experimental !Experimental normalized pressure gradient reconstructed by an MHD stability code (with assumptions on the ion pressure). See defin! + !ition in [Miller PoP 5 (1998),973,Eq. 42] + type(ids_summary_pedestal_fit_stability_method) :: bootstrap_current_sauter !MHD calculations of the critical alpha parameter using the Sauter formula for the calculation of the bootstrap current, from Phys.! + ! Plasmas 6 (1999) 2834 + type(ids_summary_pedestal_fit_stability_method) :: bootstrap_current_hager !MHD calculations of the critical alpha parameter using the Hager formula for the calculation of the bootstrap current, from Phys. ! + !Plasmas 23 (2016) 042503 + end type + + type :: ids_summary_pedestal_fit + type(ids_summary_pedestal_fit_ne) :: n_e !Electron density related quantities + type(ids_summary_pedestal_fit_te) :: t_e !Electron temperature related quantities + type(ids_summary_pedestal_fit_ne) :: pressure_electron !Electron pressure related quantities + type(ids_summary_dynamic_flt_1d_root) :: energy_thermal_pedestal_electron !Pedestal stored thermal energy for electrons + type(ids_summary_dynamic_flt_1d_root) :: energy_thermal_pedestal_ion !Pedestal stored thermal energy for ions + type(ids_summary_dynamic_flt_1d_root) :: volume_inside_pedestal !Plasma volume enclosed between the magnetic axis and the top of the pedestal + type(ids_summary_dynamic_flt_1d_root) :: alpha_electron_pedestal_max !Maximum value in the pedestal of the alpha parameter for electron pressure (see [Miller PoP 5 (1998),973,Eq. 42]) + type(ids_summary_dynamic_flt_1d_root) :: alpha_electron_pedestal_max_position !Position in normalised poloidal flux of the maximum value in the pedestal of the alpha parameter for electron pressure (see [Mille! + !r PoP 5 (1998),973,Eq. 42]) + type(ids_summary_dynamic_flt_1d_root) :: beta_pol_pedestal_top_electron_average !Poloidal beta at pressure pedestal top for electrons using the flux surface average magnetic poloidal field + type(ids_summary_dynamic_flt_1d_root) :: beta_pol_pedestal_top_electron_lfs !Poloidal beta at pedestal top for electrons using the low field side magnetic poloidal field + type(ids_summary_dynamic_flt_1d_root) :: beta_pol_pedestal_top_electron_hfs !Poloidal beta at pressure pedestal top for electrons using the high field side magnetic poloidal field + type(ids_summary_dynamic_flt_1d_root) :: nustar_pedestal_top_electron !Normalised collisionality at pressure pedestal top for electrons + type(ids_summary_dynamic_flt_1d_root) :: rhostar_pedestal_top_electron_lfs !Normalised Larmor radius at pressure pedestal top for electrons using the low field side magnetic field (important for spherical t! + !okamaks) + type(ids_summary_dynamic_flt_1d_root) :: rhostar_pedestal_top_electron_hfs !Normalised Larmor radius at pressure pedestal top for electrons using the high field side magnetic field (important for spherical ! + !tokamaks) + type(ids_summary_dynamic_flt_1d_root) :: rhostar_pedestal_top_electron_magnetic_axis !Normalised Larmor radius at pressure pedestal top for electrons using the magnetic field on the magnetic axis (definition used in ! + !most tokamak litterature) + type(ids_summary_dynamic_flt_1d_root) :: b_field_pol_pedestal_top_average !Poloidal field calculated at the position of the pressure pedestal top (as determined by the fit) and averaged over the flux surfa! + !ce + type(ids_summary_dynamic_flt_1d_root) :: b_field_pol_pedestal_top_hfs !Poloidal field calculated at the position of the pressure pedestal top (as determined by the fit) on the high field side + type(ids_summary_dynamic_flt_1d_root) :: b_field_pol_pedestal_top_lfs !Poloidal field calculated at the position of the pressure pedestal top (as determined by the fit) on the low field side + type(ids_summary_dynamic_flt_1d_root) :: b_field_pedestal_top_hfs !Total magnetic field calculated at the position of the pressure pedestal top (as determined by the fit) on the high field side + type(ids_summary_dynamic_flt_1d_root) :: b_field_pedestal_top_lfs !Total magnetic field calculated at the position of the pressure pedestal top (as determined by the fit) on the low field side + type(ids_summary_dynamic_flt_1d_root) :: b_field_tor_pedestal_top_hfs !Toroidal field calculated at the position of the pressure pedestal top (as determined by the fit) on the high field side + type(ids_summary_dynamic_flt_1d_root) :: b_field_tor_pedestal_top_lfs !Toroidal field calculated at the position of the pressure pedestal top (as determined by the fit) on the low field side + type(ids_summary_dynamic_flt_1d_root) :: coulomb_factor_pedestal_top !Coulomb factor log(lambda) at the position of the pressure pedestal top (as determined by the fit) + type(ids_summary_pedestal_fit_stability) :: stability !MHD stability analysis of the pedestal (for this fit of the profiles) + real(ids_real), pointer :: parameters(:) => null() !Parameters of the fit + real(ids_real), pointer :: parameters_error_upper(:) => null() !Upper error for "parameters" + real(ids_real), pointer :: parameters_error_lower(:) => null() !Lower error for "parameters" + integer(ids_int) :: parameters_error_index=ids_int_invalid !Index in the error_description list for "parameters" + end type + + type :: ids_summary_pedestal_fit_linear_ne + type(ids_summary_dynamic_flt_1d_root_parent_2) :: separatrix !Value at separatrix + type(ids_summary_dynamic_flt_1d_root_parent_2) :: pedestal_height !Pedestal height + type(ids_summary_dynamic_flt_1d_root) :: pedestal_width !Pedestal full width in normalised poloidal flux + type(ids_summary_dynamic_flt_1d_root) :: pedestal_position !Pedestal position in normalised poloidal flux + type(ids_summary_dynamic_flt_1d_root_parent_2) :: offset !Offset of the parent quantity in the SOL + type(ids_summary_dynamic_flt_1d_root_parent_2) :: d_dpsi_norm !Core slope of the parent quantity + type(ids_summary_dynamic_flt_1d_root_parent_2) :: d_dpsi_norm_max !Maximum gradient of the parent quantity (with respect to the normalised poloidal flux) in the pedestal + end type + + type :: ids_summary_pedestal_fit_linear_te + type(ids_summary_dynamic_flt_1d_root_parent_2) :: pedestal_height !Pedestal height + type(ids_summary_dynamic_flt_1d_root) :: pedestal_width !Pedestal full width in normalised poloidal flux + type(ids_summary_dynamic_flt_1d_root) :: pedestal_position !Pedestal position in normalised poloidal flux + type(ids_summary_dynamic_flt_1d_root_parent_2) :: offset !Offset of the parent quantity in the SOL + type(ids_summary_dynamic_flt_1d_root_parent_2) :: d_dpsi_norm !Core slope of the parent quantity + type(ids_summary_dynamic_flt_1d_root_parent_2) :: d_dpsi_norm_max !Maximum gradient of the parent quantity (with respect to the normalised poloidal flux) in the pedestal + end type + + type :: ids_summary_pedestal_fit_linear + type(ids_summary_pedestal_fit_linear_ne) :: n_e !Electron density related quantities + type(ids_summary_pedestal_fit_linear_te) :: t_e !Electron temperature related quantities + type(ids_summary_pedestal_fit_ne) :: pressure_electron !Electron pressure related quantities + type(ids_summary_dynamic_flt_1d_root) :: energy_thermal_pedestal_electron !Pedestal stored thermal energy for electrons + type(ids_summary_dynamic_flt_1d_root) :: energy_thermal_pedestal_ion !Pedestal stored thermal energy for ions + type(ids_summary_dynamic_flt_1d_root) :: volume_inside_pedestal !Plasma volume enclosed between the magnetic axis and the top of the pedestal + type(ids_summary_dynamic_flt_1d_root) :: beta_pol_pedestal_top_electron_average !Poloidal beta at pressure pedestal top for electrons using the flux surface average magnetic poloidal field + type(ids_summary_dynamic_flt_1d_root) :: beta_pol_pedestal_top_electron_lfs !Poloidal beta at pressure pedestal top for electrons using the low field side magnetic poloidal field + type(ids_summary_dynamic_flt_1d_root) :: beta_pol_pedestal_top_electron_hfs !Poloidal beta at pressure pedestal top for electrons using the high field side magnetic poloidal field + type(ids_summary_dynamic_flt_1d_root) :: nustar_pedestal_top_electron !Normalised collisionality at pressure pedestal top for electrons + type(ids_summary_dynamic_flt_1d_root) :: rhostar_pedestal_top_electron_lfs !Normalised Larmor radius at pressure pedestal top for electrons using the low field side magnetic field (important for spherical t! + !okamaks) + type(ids_summary_dynamic_flt_1d_root) :: rhostar_pedestal_top_electron_hfs !Normalised Larmor radius at pressure pedestal top for electrons using the high field side magnetic field (important for spherical ! + !tokamaks) + type(ids_summary_dynamic_flt_1d_root) :: rhostar_pedestal_top_electron_magnetic_axis !Normalised Larmor radius at pressure pedestal top for electrons using the magnetic field on the magnetic axis (definition used in ! + !most tokamak literature) + type(ids_summary_dynamic_flt_1d_root) :: b_field_pol_pedestal_top_average !Poloidal field calculated at the position of the pressure pedestal top (as determined by the fit) and averaged over the flux surfa! + !ce + type(ids_summary_dynamic_flt_1d_root) :: b_field_pol_pedestal_top_hfs !Poloidal field calculated at the position of the pressure pedestal top (as determined by the fit) on the high field side + type(ids_summary_dynamic_flt_1d_root) :: b_field_pol_pedestal_top_lfs !Poloidal field calculated at the position of the pressure pedestal top (as determined by the fit) on the low field side + type(ids_summary_dynamic_flt_1d_root) :: b_field_pedestal_top_hfs !Total magnetic field calculated at the position of the pressure pedestal top (as determined by the fit) on the high field side + type(ids_summary_dynamic_flt_1d_root) :: b_field_pedestal_top_lfs !Total magnetic field calculated at the position of the pressure pedestal top (as determined by the fit) on the low field side + type(ids_summary_dynamic_flt_1d_root) :: b_field_tor_pedestal_top_hfs !Toroidal field calculated at the position of the pressure pedestal top (as determined by the fit) on the high field side + type(ids_summary_dynamic_flt_1d_root) :: b_field_tor_pedestal_top_lfs !Toroidal field calculated at the position of the pressure pedestal top (as determined by the fit) on the low field side + type(ids_summary_dynamic_flt_1d_root) :: coulomb_factor_pedestal_top !Coulomb factor log(lambda) at the position of the pressure pedestal top (as determined by the fit) + real(ids_real), pointer :: parameters(:) => null() !Parameters of the fit + real(ids_real), pointer :: parameters_error_upper(:) => null() !Upper error for "parameters" + real(ids_real), pointer :: parameters_error_lower(:) => null() !Lower error for "parameters" + integer(ids_int) :: parameters_error_index=ids_int_invalid !Index in the error_description list for "parameters" + end type + + type :: ids_summary_pedestal_fits + type(ids_summary_pedestal_fit) :: mtanh !Quantities related to "mtanh" fit + type(ids_summary_pedestal_fit_linear) :: linear !Quantities related to linear fit + end type + + type :: ids_summary_average_quantities + type(ids_summary_dynamic_flt_1d_root) :: t_e !Electron temperature + type(ids_summary_dynamic_flt_1d_root) :: t_i_average !Ion temperature (average over ion species) + type(ids_summary_dynamic_flt_1d_root) :: n_e !Electron density + type(ids_summary_dynamic_flt_1d_root) :: dn_e_dt !Time derivative of the electron density + type(ids_summary_species) :: n_i !Ion density per species + type(ids_summary_dynamic_flt_1d_root) :: n_i_total !Total ion density (sum over species) + type(ids_summary_dynamic_flt_1d_root) :: zeff !Effective charge + type(ids_summary_dynamic_flt_1d_root) :: meff_hydrogenic !Effective mass of the hydrogenic species (MH. nH+MD.nD+MT.nT)/(nH+nD+nT) + type(ids_summary_dynamic_flt_1d_root) :: isotope_fraction_hydrogen !Fraction of hydrogen density among the hydrogenic species (nH/(nH+nD+nT)) + end type + + type :: ids_summary_constant_int_0d + integer(ids_int) :: value=ids_int_invalid !Value + character(len=ids_string_length), dimension(:), pointer :: source => null() !Source of the data (any comment describing the origin of the data : code, path to diagnostic signals, processing method, ...) + end type + + type :: ids_summary_disruption + type(ids_summary_constant_flt_0d) :: time !Time of the disruption + type(ids_summary_constant_flt_0d) :: time_radiated_power_max !Time of maximum radiated power, relative to the time of the disruption + type(ids_summary_constant_flt_0d) :: time_half_ip !Time at which the plasma current has fallen to half of the initial current at the start of the disruption, relative to the time of! + ! the disruption + type(ids_summary_constant_int_0d) :: vertical_displacement !Direction of the plasma vertical displacement just before the disruption 1 (upwards) / 0 (no displacement)/ -1 (downwards) + type(ids_summary_constant_int_0d) :: mitigation_valve !Flag indicating whether any disruption mitigation valve has been used (1) or none (0) + end type + + type :: ids_summary_elms + type(ids_summary_dynamic_flt_1d_root) :: frequency !ELMs frequency + type(ids_summary_dynamic_int_1d_root) :: type !ELMs type (I, II, III, ...) + end type + + type :: ids_summary_neutron_reaction + type(ids_summary_dynamic_flt_1d_root) :: total !Total neutron flux coming from this reaction + type(ids_summary_dynamic_flt_1d_root) :: thermal !Neutron flux coming from thermal plasma + type(ids_summary_dynamic_flt_1d_root) :: beam_thermal !Neutron flux coming from NBI beam - plasma reactions + type(ids_summary_dynamic_flt_1d_root) :: beam_beam !Neutron flux coming from NBI beam self reactions + end type + + type :: ids_summary_neutron + type(ids_summary_dynamic_flt_1d_root) :: total !Total neutron flux from all reactions + type(ids_summary_dynamic_flt_1d_root) :: thermal !Neutron flux from all plasma thermal reactions + type(ids_summary_neutron_reaction) :: dd !Neutron fluxes from DD reactions + type(ids_summary_neutron_reaction) :: dt !Neutron fluxes from DT reactions + type(ids_summary_neutron_reaction) :: tt !Neutron fluxes from TT reactions + end type + + type :: ids_summary_neutron_rates_reaction + type(ids_summary_dynamic_flt_1d_root) :: total !Total neutron rate coming from this reaction + type(ids_summary_dynamic_flt_1d_root) :: thermal !Neutron rate coming from thermal plasma + type(ids_summary_dynamic_flt_1d_root) :: beam_thermal !Neutron rate coming from NBI beam - plasma reactions + type(ids_summary_dynamic_flt_1d_root) :: beam_beam !Neutron rate coming from NBI beam self reactions + end type + + type :: ids_summary_neutron_rates + type(ids_summary_dynamic_flt_1d_root) :: total !Total neutron rate from all reactions + type(ids_summary_dynamic_flt_1d_root) :: thermal !Neutron rate from all plasma thermal reactions + type(ids_summary_neutron_rates_reaction) :: dd !Neutron rates from DD reactions + type(ids_summary_neutron_rates_reaction) :: dt !Neutron rates from DT reactions + type(ids_summary_neutron_rates_reaction) :: tt !Neutron rates from TT reactions + end type + + type :: ids_summary_fusion + type(ids_summary_dynamic_flt_1d_root) :: power !Power coupled to the plasma by fusion reactions + type(ids_summary_dynamic_flt_1d_root) :: current !Parallel current driven by this fusion reactions + type(ids_summary_neutron) :: neutron_fluxes !Neutron fluxes from various reactions + type(ids_summary_neutron_rates) :: neutron_rates !Neutron rates from various reactions + type(ids_summary_dynamic_flt_1d_root) :: neutron_power_total !Total neutron power (from all reactions). Sum over each type of reaction (DD, DT, TT for thermal, beam-plasma, beam-beam, etc.) of! + ! the neutron production rate times the average neutron birth energy + end type + + type :: ids_summary_gas_injection + type(ids_summary_dynamic_flt_1d_root_parent_2) :: total !Total gas injection rate (sum over species) + type(ids_summary_dynamic_flt_1d_root_parent_2) :: midplane !Gas injection rate from all valves located near the equatorial midplane + type(ids_summary_dynamic_flt_1d_root_parent_2) :: top !Gas injection rate from all valves located near the top of the vaccuum chamber + type(ids_summary_dynamic_flt_1d_root_parent_2) :: bottom !Gas injection rate from all valves located near near the bottom of the vaccuum chamber + type(ids_summary_dynamic_flt_1d_root_parent_2) :: hydrogen !Hydrogen + type(ids_summary_dynamic_flt_1d_root_parent_2) :: deuterium !Deuterium + type(ids_summary_dynamic_flt_1d_root_parent_2) :: tritium !Tritium + type(ids_summary_dynamic_flt_1d_root_parent_2) :: helium_3 !Helium isotope with 3 nucleons + type(ids_summary_dynamic_flt_1d_root_parent_2) :: helium_4 !Helium isotope with 4 nucleons + type(ids_summary_constant_int_0d) :: impurity_seeding !Flag set to 1 if any gas other than H, D, T, He is puffed during the pulse, 0 otherwise + type(ids_summary_dynamic_flt_1d_root_parent_2) :: beryllium !Beryllium + type(ids_summary_dynamic_flt_1d_root_parent_2) :: lithium !Lithium + type(ids_summary_dynamic_flt_1d_root_parent_2) :: carbon !Carbon + type(ids_summary_dynamic_flt_1d_root_parent_2) :: oxygen !Oxygen + type(ids_summary_dynamic_flt_1d_root_parent_2) :: nitrogen !Nitrogen + type(ids_summary_dynamic_flt_1d_root_parent_2) :: neon !Neon + type(ids_summary_dynamic_flt_1d_root_parent_2) :: argon !Argon + type(ids_summary_dynamic_flt_1d_root_parent_2) :: xenon !Xenon + type(ids_summary_dynamic_flt_1d_root_parent_2) :: krypton !Krypton + type(ids_summary_dynamic_flt_1d_root_parent_2) :: methane !Methane (CH4) + type(ids_summary_dynamic_flt_1d_root_parent_2) :: methane_carbon_13 !Methane (CH4 with carbon 13) + type(ids_summary_dynamic_flt_1d_root_parent_2) :: methane_deuterated !Deuterated methane (CD4) + type(ids_summary_dynamic_flt_1d_root_parent_2) :: silane !Silane (SiH4) + type(ids_summary_dynamic_flt_1d_root_parent_2) :: ethylene !Ethylene (C2H4) + type(ids_summary_dynamic_flt_1d_root_parent_2) :: ethane !Ethane (C2H6) + type(ids_summary_dynamic_flt_1d_root_parent_2) :: propane !Propane (C3H8) + type(ids_summary_dynamic_flt_1d_root_parent_2) :: ammonia !Ammonia (NH3) + type(ids_summary_dynamic_flt_1d_root_parent_2) :: ammonia_deuterated !Deuterated ammonia (ND3) + end type + + type :: ids_summary_gas_injection_accumulated + type(ids_summary_dynamic_flt_1d_root_parent_2) :: total !Total accumulated injected gas (sum over species) + type(ids_summary_dynamic_flt_1d_root_parent_2) :: midplane !Accumulated gas injected from all valves located near the equatorial midplane + type(ids_summary_dynamic_flt_1d_root_parent_2) :: top !Accumulated gas injected from all valves located near the top of the vacuum chamber + type(ids_summary_dynamic_flt_1d_root_parent_2) :: bottom !Accumulated gas injected from all valves located near near the bottom of the vacuum chamber + type(ids_summary_dynamic_flt_1d_root_parent_2) :: hydrogen !Hydrogen + type(ids_summary_dynamic_flt_1d_root_parent_2) :: deuterium !Deuterium + type(ids_summary_dynamic_flt_1d_root_parent_2) :: tritium !Tritium + type(ids_summary_dynamic_flt_1d_root_parent_2) :: helium_3 !Helium isotope with 3 nucleons + type(ids_summary_dynamic_flt_1d_root_parent_2) :: helium_4 !Helium isotope with 4 nucleons + type(ids_summary_constant_int_0d) :: impurity_seeding !Flag set to 1 if any gas other than H, D, T, He is puffed during the pulse, 0 otherwise + type(ids_summary_dynamic_flt_1d_root_parent_2) :: beryllium !Beryllium + type(ids_summary_dynamic_flt_1d_root_parent_2) :: lithium !Lithium + type(ids_summary_dynamic_flt_1d_root_parent_2) :: carbon !Carbon + type(ids_summary_dynamic_flt_1d_root_parent_2) :: oxygen !Oxygen + type(ids_summary_dynamic_flt_1d_root_parent_2) :: nitrogen !Nitrogen + type(ids_summary_dynamic_flt_1d_root_parent_2) :: neon !Neon + type(ids_summary_dynamic_flt_1d_root_parent_2) :: argon !Argon + type(ids_summary_dynamic_flt_1d_root_parent_2) :: xenon !Xenon + type(ids_summary_dynamic_flt_1d_root_parent_2) :: krypton !Krypton + type(ids_summary_dynamic_flt_1d_root_parent_2) :: methane !Methane (CH4) + type(ids_summary_dynamic_flt_1d_root_parent_2) :: methane_carbon_13 !Methane (CH4 with carbon 13) + type(ids_summary_dynamic_flt_1d_root_parent_2) :: methane_deuterated !Deuterated methane (CD4) + type(ids_summary_dynamic_flt_1d_root_parent_2) :: silane !Silane (SiH4) + type(ids_summary_dynamic_flt_1d_root_parent_2) :: ethylene !Ethylene (C2H4) + type(ids_summary_dynamic_flt_1d_root_parent_2) :: ethane !Ethane (C2H6) + type(ids_summary_dynamic_flt_1d_root_parent_2) :: propane !Propane (C3H8) + type(ids_summary_dynamic_flt_1d_root_parent_2) :: ammonia !Ammonia (NH3) + type(ids_summary_dynamic_flt_1d_root_parent_2) :: ammonia_deuterated !Deuterated ammonia (ND3) + end type + + type :: ids_summary_constant_flt_0d_2 + real(ids_real) :: value=ids_real_invalid !Value + real(ids_real) :: value_error_upper=ids_real_invalid !Upper error for "value" + real(ids_real) :: value_error_lower=ids_real_invalid !Lower error for "value" + integer(ids_int) :: value_error_index=ids_int_invalid !Index in the error_description list for "value" + character(len=ids_string_length), dimension(:), pointer :: source => null() !Source of the data (any comment describing the origin of the data : code, path to diagnostic signals, processing method, ...) + end type + + type :: ids_summary_gas_injection_prefill + type(ids_summary_constant_flt_0d_2) :: total !Total accumulated injected gas (sum over species) + type(ids_summary_constant_flt_0d_2) :: midplane !Accumulated gas injected from all valves located near the equatorial midplane + type(ids_summary_constant_flt_0d_2) :: top !Accumulated gas injected from all valves located near the top of the vacuum chamber + type(ids_summary_constant_flt_0d_2) :: bottom !Accumulated gas injected from all valves located near near the bottom of the vacuum chamber + type(ids_summary_constant_flt_0d_2) :: hydrogen !Hydrogen + type(ids_summary_constant_flt_0d_2) :: deuterium !Deuterium + type(ids_summary_constant_flt_0d_2) :: tritium !Tritium + type(ids_summary_constant_flt_0d_2) :: helium_3 !Helium isotope with 3 nucleons + type(ids_summary_constant_flt_0d_2) :: helium_4 !Helium isotope with 4 nucleons + type(ids_summary_constant_int_0d) :: impurity_seeding !Flag set to 1 if any gas other than H, D, T, He is puffed during the prefill, 0 otherwise + type(ids_summary_constant_flt_0d_2) :: beryllium !Beryllium + type(ids_summary_constant_flt_0d_2) :: lithium !Lithium + type(ids_summary_constant_flt_0d_2) :: carbon !Carbon + type(ids_summary_constant_flt_0d_2) :: oxygen !Oxygen + type(ids_summary_constant_flt_0d_2) :: nitrogen !Nitrogen + type(ids_summary_constant_flt_0d_2) :: neon !Neon + type(ids_summary_constant_flt_0d_2) :: argon !Argon + type(ids_summary_constant_flt_0d_2) :: xenon !Xenon + type(ids_summary_constant_flt_0d_2) :: krypton !Krypton + type(ids_summary_constant_flt_0d_2) :: methane !Methane (CH4) + type(ids_summary_constant_flt_0d_2) :: methane_carbon_13 !Methane (CH4 with carbon 13) + type(ids_summary_constant_flt_0d_2) :: methane_deuterated !Deuterated methane (CD4) + type(ids_summary_constant_flt_0d_2) :: silane !Silane (SiH4) + type(ids_summary_constant_flt_0d_2) :: ethylene !Ethylene (C2H4) + type(ids_summary_constant_flt_0d_2) :: ethane !Ethane (C2H6) + type(ids_summary_constant_flt_0d) :: propane !Propane (C3H8) + type(ids_summary_constant_flt_0d_2) :: ammonia !Ammonia (NH3) + type(ids_summary_constant_flt_0d_2) :: ammonia_deuterated !Deuterated ammonia (ND3) + end type + + type :: ids_summary_h_cd_ec + type(ids_summary_dynamic_flt_1d_root) :: frequency !ECRH frequency + type(ids_summary_dynamic_flt_1d_root) :: position !Position of the maximum of the ECRH power deposition, in rho_tor_norm + type(ids_summary_dynamic_int_1d_root) :: polarisation !Polarisation of the ECRH waves (0 = O mode, 1 = X mode) + type(ids_summary_dynamic_int_1d_root) :: harmonic !Harmonic number of the absorbed ECRH waves + type(ids_summary_dynamic_flt_1d_root) :: angle_tor !Toroidal angle of ECRH at resonance + type(ids_summary_dynamic_flt_1d_root) :: angle_pol !Poloidal angle of ECRH at resonance + type(ids_summary_dynamic_flt_1d_root) :: power !Electron cyclotron heating power coupled to the plasma from this launcher + type(ids_summary_dynamic_flt_1d_root) :: power_launched !Electron cyclotron heating power launched into the vacuum vessel from this launcher + type(ids_summary_dynamic_flt_1d_root) :: current !Parallel current driven by EC waves + type(ids_summary_dynamic_flt_1d_root) :: energy_fast !Fast particle energy content driven by EC waves + end type + + type :: ids_summary_plasma_composition_species + type(ids_summary_constant_flt_0d) :: a !Mass of atom + type(ids_summary_constant_flt_0d) :: z_n !Nuclear charge + type(ids_summary_constant_str_0d) :: label !String identifying the species (e.g. H, D, T, ...) + end type + + type :: ids_summary_static_flt_0d + real(ids_real) :: value=ids_real_invalid !Value + real(ids_real) :: value_error_upper=ids_real_invalid !Upper error for "value" + real(ids_real) :: value_error_lower=ids_real_invalid !Lower error for "value" + integer(ids_int) :: value_error_index=ids_int_invalid !Index in the error_description list for "value" + character(len=ids_string_length), dimension(:), pointer :: source => null() !Source of the data (any comment describing the origin of the data : code, path to diagnostic signals, processing method, ...) + end type + + type :: ids_summary_rzphi0d_static + type(ids_summary_static_flt_0d) :: r !Major radius + type(ids_summary_static_flt_0d) :: z !Height + type(ids_summary_static_flt_0d) :: phi !Toroidal angle + end type + + type :: ids_summary_dynamic_flt_2d_fraction_2 + real(ids_real), pointer :: value(:,:) => null() !Value + real(ids_real), pointer :: value_error_upper(:,:) => null() !Upper error for "value" + real(ids_real), pointer :: value_error_lower(:,:) => null() !Lower error for "value" + integer(ids_int) :: value_error_index=ids_int_invalid !Index in the error_description list for "value" + character(len=ids_string_length), dimension(:), pointer :: source => null() !Source of the data (any comment describing the origin of the data : code, path to diagnostic signals, processing method, ...) + end type + + type :: ids_summary_h_cd_nbi + type(ids_summary_plasma_composition_species) :: species !Injected species + type(ids_summary_dynamic_flt_1d_root) :: power !NBI power coupled to the plasma by this unit (i.e. without shine-through and fast ion losses) + type(ids_summary_dynamic_flt_1d_root) :: power_launched !NBI power launched into the vacuum vessel from this unit + type(ids_summary_dynamic_flt_1d_root) :: current !Parallel current driven by this NBI unit + type(ids_summary_rzphi0d_static) :: position !R, Z, Phi position of the NBI unit centre + type(ids_summary_static_flt_0d) :: tangency_radius !Tangency radius (major radius where the central line of a NBI unit is tangent to a circle around the torus) + type(ids_summary_static_flt_0d) :: angle !Angle of inclination between a beamlet at the centre of the injection unit surface and the horizontal plane + type(ids_summary_static_int_0d) :: direction !Direction of the beam seen from above the torus: -1 = clockwise; 1 = counter clockwise + type(ids_summary_dynamic_flt_1d_root) :: energy !Full energy of the injected species (acceleration of a single atom) + type(ids_summary_dynamic_flt_2d_fraction_2) :: beam_current_fraction !Fractions of beam current distributed among the different energies, the first index corresponds to the fast neutrals energy (1:ful! + !l, 2: half, 3: one third) + type(ids_summary_dynamic_flt_2d_fraction_2) :: beam_power_fraction !Fractions of beam power distributed among the different energies, the first index corresponds to the fast neutrals energy (1:full,! + ! 2: half, 3: one third) + end type + + type :: ids_summary_h_cd_ic + type(ids_summary_dynamic_flt_1d_root) :: frequency !ICRH frequency + type(ids_summary_dynamic_flt_1d_root) :: position !Position of the maximum of the ICRH power deposition, in rho_tor_norm + type(ids_summary_dynamic_int_1d_root) :: n_tor !Main toroidal mode number of IC waves + type(ids_summary_dynamic_flt_1d_root) :: k_perpendicular !Main perpendicular wave number of IC waves + type(ids_summary_dynamic_flt_1d_root) :: e_field_plus_minus_ratio !Average E+/E- power ratio of IC waves + type(ids_summary_dynamic_int_1d_root) :: harmonic !Harmonic number of the absorbed ICRH waves + type(ids_summary_dynamic_flt_1d_root) :: phase !Phase between straps + type(ids_summary_dynamic_flt_1d_root) :: power !IC heating power coupled to the plasma from this launcher + type(ids_summary_dynamic_flt_1d_root) :: power_launched !IC heating power launched into the vacuum vessel from this launcher + type(ids_summary_dynamic_flt_1d_root) :: current !Parallel current driven by IC waves + type(ids_summary_dynamic_flt_1d_root) :: energy_fast !Fast particle energy content driven by IC waves + end type + + type :: ids_summary_h_cd_lh + type(ids_summary_dynamic_flt_1d_root) :: frequency !LH wave frequency + type(ids_summary_dynamic_flt_1d_root) :: position !Position of the maximum of the LH power deposition, in rho_tor_norm + type(ids_summary_dynamic_flt_1d_root) :: n_parallel !Main parallel refractive index of LH waves at launch + type(ids_summary_dynamic_flt_1d_root) :: power !LH heating power coupled to the plasma from this launcher + type(ids_summary_dynamic_flt_1d_root) :: power_launched !LH heating power launched into the vacuum vessel from this launcher + type(ids_summary_dynamic_flt_1d_root) :: current !Parallel current driven by LH waves + type(ids_summary_dynamic_flt_1d_root) :: energy_fast !Fast particle energy content driven by LH waves + end type + + type :: ids_summary_h_cd + type(ids_summary_h_cd_ec), pointer :: ec(:) => null() !Set of ECRH/ECCD launchers + type(ids_summary_h_cd_nbi), pointer :: nbi(:) => null() !Set of NBI units + type(ids_summary_h_cd_ic), pointer :: ic(:) => null() !Set of ICRH launchers + type(ids_summary_h_cd_lh), pointer :: lh(:) => null() !Set of LHCD launchers + type(ids_summary_dynamic_flt_1d_root) :: power_ec !Total EC power coupled to the plasma + type(ids_summary_dynamic_flt_1d_root) :: power_launched_ec !Total EC power launched from EC launchers into the vacuum vessel + type(ids_summary_dynamic_flt_1d_root) :: power_nbi !Total NBI power coupled to the plasma + type(ids_summary_dynamic_flt_1d_root) :: power_launched_nbi !Total NBI power launched from neutral beam injectors into the vacuum vessel + type(ids_summary_dynamic_flt_1d_root) :: power_launched_nbi_co_injected_ratio !Ratio of co-injected beam launched power to total NBI launched power. Is set to 1 for purely perpendicular injection + type(ids_summary_dynamic_flt_1d_root) :: power_ic !Total IC power coupled to the plasma + type(ids_summary_dynamic_flt_1d_root) :: power_launched_ic !Total IC power launched from IC antennas into the vacuum vessel + type(ids_summary_dynamic_flt_1d_root) :: power_lh !Total LH power coupled to the plasma + type(ids_summary_dynamic_flt_1d_root) :: power_launched_lh !Total LH power launched from LH antennas into the vacuum vessel + type(ids_summary_dynamic_flt_1d_root) :: power_additional !Total additional external power (NBI+EC+IC+LH, without ohmic) coupled to the plasma + end type + + type :: ids_summary_kicks + type(ids_summary_constant_int_0d) :: occurrence !Flag set to 1 if vertical kicks of the plasma position are used during the pulse, 0 otherwise + end type + + type :: ids_summary_pellets + type(ids_summary_constant_int_0d) :: occurrence !Flag set to 1 if there is any pellet injected during the pulse, 0 otherwise + end type + + type :: ids_summary_rmp + type(ids_summary_constant_int_0d) :: occurrence !Flag set to 1 if resonant magnetic perturbations are used during the pulse, 0 otherwise + end type + + type :: ids_summary_runaways + type(ids_summary_dynamic_flt_1d_root) :: particles !Number of runaway electrons + type(ids_summary_dynamic_flt_1d_root) :: current !Parallel current driven by the runaway electrons + end type + + type :: ids_summary_sol + type(ids_summary_dynamic_flt_1d_root) :: t_e_decay_length !Electron temperature radial decay length inv(grad Te/Te) + type(ids_summary_dynamic_flt_1d_root) :: t_i_average_decay_length !Ion temperature (average over ion species) radial decay length inv(grad Ti/Ti) + type(ids_summary_dynamic_flt_1d_root) :: n_e_decay_length !Electron density radial decay length inv(grad ne/ne) + type(ids_summary_dynamic_flt_1d_root) :: n_i_total_decay_length !Ion density radial decay length inv(grad ni/ni) + type(ids_summary_dynamic_flt_1d_root) :: heat_flux_e_decay_length !Electron heat flux radial decay length inv(grad qe/qe) + type(ids_summary_dynamic_flt_1d_root) :: heat_flux_i_decay_length !Ion heat flux radial decay length inv(grad qi/qi) + type(ids_summary_dynamic_flt_1d_root) :: power_radiated !Power radiated from the SOL + type(ids_summary_dynamic_flt_1d_root) :: pressure_neutral !Neutral pressure in the SOL + end type + + type :: ids_summary_wall + type(ids_identifier_static) :: material !Wall material + type(ids_summary_static_str_0d) :: evaporation !Chemical formula of the evaporated material or gas used to cover the vaccum vessel wall. NONE for no evaporation. + end type + + type :: ids_summary_limiter + type(ids_identifier_static) :: material !Limiter material + end type + + + ! *********** summary IDS + type, extends(IDS_base) :: ids_summary !Summary of physics quantities from a simulation or an experiment. Dynamic quantities are either taken at given time slices (indica! + !ted in the "time" vector) or time-averaged over an interval (in such case the "time_width" of the interval is indicated and the "t! + !ime" vector represents the end of each time interval). + logical, private :: c_data = .FALSE. ! Fortran specific metadata telling whether the IDS has been populated from C allocated data (LL) or not + integer, private :: max_occurrence = 1! Maximum occurrence allowed as defined in the DD + + type(ids_ids_properties) :: ids_properties !Interface Data Structure properties. This element identifies the node above as an IDS + type(ids_entry_tag) :: tag !Tag qualifying this data entry (or a list of data entries) + type(ids_summary_static_str_0d) :: configuration !Device configuration (the content may be device-specific) + type(ids_summary_static_int_0d) :: magnetic_shear_flag !Magnetic field shear indicator for stellarators: 0 for shearless stellarators (W7-A, W7-AS, W7-X); 1, otherwise. See [Stroth U. et! + ! al 1996 Nucl. Fusion 36 1063] + type(ids_summary_dynamic_int_1d_root) :: stationary_phase_flag !This flag is set to one if the pulse is in a stationary phase from the point of the of the energy content (if the time derivative ! + !of the energy dW/dt can be neglected when calculating tau_E as W/(P_abs-dW/dt).) + type(ids_identifier_static) :: midplane !Choice of midplane definition (use the lowest index number if more than one value is relevant) + type(ids_summary_global_quantities) :: global_quantities !Various global quantities derived from the profiles + type(ids_summary_local) :: local !Plasma parameter values at different locations + type(ids_summary_boundary) :: boundary !Description of the plasma boundary + type(ids_summary_pedestal_fits) :: pedestal_fits !Quantities derived from specific fits of pedestal profiles, typically used in the Pedestal Database. + type(ids_summary_average_quantities) :: line_average !Line average plasma parameters + type(ids_summary_average_quantities) :: volume_average !Volume average plasma parameters + type(ids_summary_disruption) :: disruption !Disruption characteristics, if the pulse is terminated by a disruption + type(ids_summary_elms) :: elms !Edge Localized Modes related quantities + type(ids_summary_fusion) :: fusion !Fusion reactions + type(ids_summary_gas_injection) :: gas_injection_rates !Gas injection rates in equivalent electrons.s^-1 + type(ids_summary_gas_injection_accumulated) :: gas_injection_accumulated !Accumulated injected gas since the plasma breakdown in equivalent electrons + type(ids_summary_gas_injection_prefill) :: gas_injection_prefill !Accumulated injected gas during the prefill in equivalent electrons + type(ids_summary_h_cd) :: heating_current_drive !Heating and current drive parameters + type(ids_summary_kicks) :: kicks !Vertical kicks of the plasma position + type(ids_summary_pellets) :: pellets !Pellet related quantities + type(ids_summary_rmp) :: rmps !Resonant magnetic perturbations related quantities + type(ids_summary_runaways) :: runaways !Runaway electrons + type(ids_summary_sol) :: scrape_off_layer !Scrape-Off-Layer (SOL) characteristics + type(ids_summary_wall) :: wall !Wall characteristics + type(ids_summary_limiter) :: limiter !Limiter characteristics + type(ids_summary_constant_flt_0d) :: time_breakdown !Time of the plasma breakdown + type(ids_summary_constant_flt_0d) :: plasma_duration !Duration of existence of a confined plasma during the pulse + real(ids_real), pointer :: time_width(:) => null() !In case the time-dependent quantities of this IDS are averaged over a time interval, this node is the width of this time interval ! + !(empty otherwise). By convention, the time interval starts at time-time_width and ends at time. + real(ids_real), pointer :: time_width_error_upper(:) => null() !Upper error for "time_width" + real(ids_real), pointer :: time_width_error_lower(:) => null() !Lower error for "time_width" + integer(ids_int) :: time_width_error_index=ids_int_invalid !Index in the error_description list for "time_width" + type(ids_code) :: code !Generic decription of the code-specific parameters for the code that has produced this IDS + real(ids_real), pointer :: time(:) => null() !Generic time + end type + + ! *********** temporary IDS internal structures declaration + + type :: ids_temporary_constant_quantities_float_0d + real(ids_real) :: value=ids_real_invalid !Value + real(ids_real) :: value_error_upper=ids_real_invalid !Upper error for "value" + real(ids_real) :: value_error_lower=ids_real_invalid !Lower error for "value" + integer(ids_int) :: value_error_index=ids_int_invalid !Index in the error_description list for "value" + type(ids_identifier) :: identifier !Description of the quantity using the standard identifier structure + end type + + type :: ids_temporary_constant_quantities_int_0d + integer(ids_int) :: value=ids_int_invalid !Value + type(ids_identifier) :: identifier !Description of the quantity using the standard identifier structure + end type + + type :: ids_temporary_constant_quantities_string_0d + character(len=ids_string_length), dimension(:), pointer :: value => null() !Value + type(ids_identifier) :: identifier !Description of the quantity using the standard identifier structure + end type + + type :: ids_temporary_constant_quantities_int_1d + integer(ids_int), pointer :: value(:) => null() !Value + type(ids_identifier) :: identifier !Description of the quantity using the standard identifier structure + end type + + type :: ids_temporary_constant_quantities_string_1d + character(len=ids_string_length), dimension(:), pointer :: value => null() !Value + type(ids_identifier) :: identifier !Description of the quantity using the standard identifier structure + end type + + type :: ids_temporary_constant_quantities_float_1d + real(ids_real), pointer :: value(:) => null() !Value + real(ids_real), pointer :: value_error_upper(:) => null() !Upper error for "value" + real(ids_real), pointer :: value_error_lower(:) => null() !Lower error for "value" + integer(ids_int) :: value_error_index=ids_int_invalid !Index in the error_description list for "value" + type(ids_identifier) :: identifier !Description of the quantity using the standard identifier structure + end type + + type :: ids_temporary_dynamic_quantities_float_1d + type(ids_signal_flt_1d) :: value !Value + type(ids_identifier) :: identifier !Description of the quantity using the standard identifier structure + end type + + type :: ids_temporary_dynamic_quantities_int_1d + type(ids_signal_int_1d) :: value !Value + type(ids_identifier) :: identifier !Description of the quantity using the standard identifier structure + end type + + type :: ids_temporary_constant_quantities_float_2d + real(ids_real), pointer :: value(:,:) => null() !Value + real(ids_real), pointer :: value_error_upper(:,:) => null() !Upper error for "value" + real(ids_real), pointer :: value_error_lower(:,:) => null() !Lower error for "value" + integer(ids_int) :: value_error_index=ids_int_invalid !Index in the error_description list for "value" + type(ids_identifier) :: identifier !Description of the quantity using the standard identifier structure + end type + + type :: ids_temporary_constant_quantities_int_2d + integer(ids_int), pointer :: value(:,:) => null() !Value + type(ids_identifier) :: identifier !Description of the quantity using the standard identifier structure + end type + + type :: ids_temporary_dynamic_quantities_float_2d + type(ids_signal_flt_2d) :: value !Value + type(ids_identifier) :: identifier !Description of the quantity using the standard identifier structure + end type + + type :: ids_temporary_dynamic_quantities_int_2d + type(ids_signal_int_2d) :: value !Value + type(ids_identifier) :: identifier !Description of the quantity using the standard identifier structure + end type + + type :: ids_temporary_constant_quantities_float_3d + real(ids_real), pointer :: value(:,:,:) => null() !Value + real(ids_real), pointer :: value_error_upper(:,:,:) => null() !Upper error for "value" + real(ids_real), pointer :: value_error_lower(:,:,:) => null() !Lower error for "value" + integer(ids_int) :: value_error_index=ids_int_invalid !Index in the error_description list for "value" + type(ids_identifier) :: identifier !Description of the quantity using the standard identifier structure + end type + + type :: ids_temporary_constant_quantities_int_3d + integer(ids_int), pointer :: value(:,:,:) => null() !Value + type(ids_identifier) :: identifier !Description of the quantity using the standard identifier structure + end type + + type :: ids_temporary_dynamic_quantities_float_3d + type(ids_signal_flt_3d) :: value !Value + type(ids_identifier) :: identifier !Description of the quantity using the standard identifier structure + end type + + type :: ids_temporary_dynamic_quantities_int_3d + type(ids_signal_int_3d) :: value !Value + type(ids_identifier) :: identifier !Description of the quantity using the standard identifier structure + end type + + type :: ids_temporary_constant_quantities_float_4d + real(ids_real), pointer :: value(:,:,:,:) => null() !Value + real(ids_real), pointer :: value_error_upper(:,:,:,:) => null() !Upper error for "value" + real(ids_real), pointer :: value_error_lower(:,:,:,:) => null() !Lower error for "value" + integer(ids_int) :: value_error_index=ids_int_invalid !Index in the error_description list for "value" + type(ids_identifier) :: identifier !Description of the quantity using the standard identifier structure + end type + + type :: ids_temporary_dynamic_quantities_float_4d + type(ids_signal_flt_4d) :: value !Value + type(ids_identifier) :: identifier !Description of the quantity using the standard identifier structure + end type + + type :: ids_temporary_constant_quantities_float_5d + real(ids_real), pointer :: value(:,:,:,:,:) => null() !Value + real(ids_real), pointer :: value_error_upper(:,:,:,:,:) => null() !Upper error for "value" + real(ids_real), pointer :: value_error_lower(:,:,:,:,:) => null() !Lower error for "value" + integer(ids_int) :: value_error_index=ids_int_invalid !Index in the error_description list for "value" + type(ids_identifier) :: identifier !Description of the quantity using the standard identifier structure + end type + + type :: ids_temporary_dynamic_quantities_float_5d + type(ids_signal_flt_5d) :: value !Value + type(ids_identifier) :: identifier !Description of the quantity using the standard identifier structure + end type + + type :: ids_temporary_constant_quantities_float_6d + real(ids_real), pointer :: value(:,:,:,:,:,:) => null() !Value + real(ids_real), pointer :: value_error_upper(:,:,:,:,:,:) => null() !Upper error for "value" + real(ids_real), pointer :: value_error_lower(:,:,:,:,:,:) => null() !Lower error for "value" + integer(ids_int) :: value_error_index=ids_int_invalid !Index in the error_description list for "value" + type(ids_identifier) :: identifier !Description of the quantity using the standard identifier structure + end type + + type :: ids_temporary_dynamic_quantities_float_6d + type(ids_signal_flt_6d) :: value !Value + type(ids_identifier) :: identifier !Description of the quantity using the standard identifier structure + end type + + + ! *********** temporary IDS + type, extends(IDS_base) :: ids_temporary !Storage of undeclared data model components + logical, private :: c_data = .FALSE. ! Fortran specific metadata telling whether the IDS has been populated from C allocated data (LL) or not + integer, private :: max_occurrence = 6! Maximum occurrence allowed as defined in the DD + + type(ids_ids_properties) :: ids_properties !Interface Data Structure properties. This element identifies the node above as an IDS + type(ids_temporary_constant_quantities_float_0d), pointer :: constant_float0d(:) => null() !Constant 0D float + type(ids_temporary_constant_quantities_int_0d), pointer :: constant_integer0d(:) => null() !Constant 0D integer + type(ids_temporary_constant_quantities_string_0d), pointer :: constant_string0d(:) => null() !Constant 0D string + type(ids_temporary_constant_quantities_int_1d), pointer :: constant_integer1d(:) => null() !Constant 1D integer + type(ids_temporary_constant_quantities_string_1d), pointer :: constant_string1d(:) => null() !Constant 1D string + type(ids_temporary_constant_quantities_float_1d), pointer :: constant_float1d(:) => null() !Constant 1D float + type(ids_temporary_dynamic_quantities_float_1d), pointer :: dynamic_float1d(:) => null() !Dynamic 1D float + type(ids_temporary_dynamic_quantities_int_1d), pointer :: dynamic_integer1d(:) => null() !Dynamic 1D integer + type(ids_temporary_constant_quantities_float_2d), pointer :: constant_float2d(:) => null() !Constant 2D float + type(ids_temporary_constant_quantities_int_2d), pointer :: constant_integer2d(:) => null() !Constant 2D integer + type(ids_temporary_dynamic_quantities_float_2d), pointer :: dynamic_float2d(:) => null() !Dynamic 2D float + type(ids_temporary_dynamic_quantities_int_2d), pointer :: dynamic_integer2d(:) => null() !Dynamic 2D integer + type(ids_temporary_constant_quantities_float_3d), pointer :: constant_float3d(:) => null() !Constant 3D float + type(ids_temporary_constant_quantities_int_3d), pointer :: constant_integer3d(:) => null() !Constant 3D integer + type(ids_temporary_dynamic_quantities_float_3d), pointer :: dynamic_float3d(:) => null() !Dynamic 3D float + type(ids_temporary_dynamic_quantities_int_3d), pointer :: dynamic_integer3d(:) => null() !Dynamic 3D integer + type(ids_temporary_constant_quantities_float_4d), pointer :: constant_float4d(:) => null() !Constant 4D float + type(ids_temporary_dynamic_quantities_float_4d), pointer :: dynamic_float4d(:) => null() !Dynamic 4D float + type(ids_temporary_constant_quantities_float_5d), pointer :: constant_float5d(:) => null() !Constant 5D float + type(ids_temporary_dynamic_quantities_float_5d), pointer :: dynamic_float5d(:) => null() !Dynamic 5D float + type(ids_temporary_constant_quantities_float_6d), pointer :: constant_float6d(:) => null() !Constant 6D float + type(ids_temporary_dynamic_quantities_float_6d), pointer :: dynamic_float6d(:) => null() !Dynamic 6D float + type(ids_code) :: code !Generic decription of the code-specific parameters for the code that has produced this IDS + real(ids_real), pointer :: time(:) => null() !Generic time + end type + + ! *********** thomson_scattering IDS internal structures declaration + + type :: ids_thomson_scattering_channel + character(len=ids_string_length), dimension(:), pointer :: name => null() !Name of the channel + character(len=ids_string_length), dimension(:), pointer :: identifier => null() !ID of the channel + type(ids_rzphi0d_static) :: position !Average position of the measurements (intersection between laser beam and line of sight) + type(ids_rzphi1d_dynamic_aos1_common_time) :: delta_position !Incremental variation of the position of the measurements, due to e.g. different lasers not intersecting the line of sight at the ! + !same position. The actual position is then the static position + delta_position + type(ids_signal_flt_1d) :: distance_separatrix_midplane !Distance between the measurement position and the separatrix, mapped along flux surfaces to the outboard midplane, in the major ra! + !dius direction. Positive value means the measurement is outside of the separatrix. + type(ids_signal_flt_1d) :: t_e !Electron temperature + type(ids_signal_flt_1d) :: n_e !Electron density + end type + + + ! *********** thomson_scattering IDS + type, extends(IDS_base) :: ids_thomson_scattering !Thomson scattering diagnostic + logical, private :: c_data = .FALSE. ! Fortran specific metadata telling whether the IDS has been populated from C allocated data (LL) or not + integer, private :: max_occurrence = 3! Maximum occurrence allowed as defined in the DD + + type(ids_ids_properties) :: ids_properties !Interface Data Structure properties. This element identifies the node above as an IDS + type(ids_ids_identification) :: equilibrium_id !ID of the IDS equilibrium used to map measurements - we may decide that this is superseeded when the systematic documentation of i! + !nput provenance is adopted + type(ids_identifier_static) :: midplane !Choice of midplane definition for the mapping of measurements on an equilibrium + type(ids_thomson_scattering_channel), pointer :: channel(:) => null() !Set of channels (lines-of-sight) + real(ids_real) :: latency=ids_real_invalid !Upper bound of the delay between physical information received by the detector and data available on the real-time (RT) network. + real(ids_real) :: latency_error_upper=ids_real_invalid !Upper error for "latency" + real(ids_real) :: latency_error_lower=ids_real_invalid !Lower error for "latency" + integer(ids_int) :: latency_error_index=ids_int_invalid !Index in the error_description list for "latency" + type(ids_code) :: code !Generic decription of the code-specific parameters for the code that has produced this IDS + real(ids_real), pointer :: time(:) => null() !Generic time + end type + + ! *********** tf IDS internal structures declaration + + type :: ids_tf_coil_conductor_elements + character(len=ids_string_length), dimension(:), pointer :: names => null() !Name or description of every element + integer(ids_int), pointer :: types(:) => null() !Type of every element: 1: line segment, its ends are given by the start and end points; index = 2: arc of a circle; index = 3: ful! + !l circle + type(ids_rzphi1d_static) :: start_points !Position of the start point of every element + type(ids_rzphi1d_static) :: intermediate_points !Position of an intermediate point along the arc of circle, for every element, providing the orientation of the element (must defin! + !e with the corresponding start point an aperture angle strictly inferior to PI). Meaningful only if type/index = 2, fill with defa! + !ult/empty value otherwise + type(ids_rzphi1d_static) :: end_points !Position of the end point of every element. Meaningful only if type/index = 1 or 2, fill with default/empty value otherwise + type(ids_rzphi1d_static) :: centres !Position of the centre of the arc of a circle of every element (meaningful only if type/index = 2 or 3, fill with default/empty va! + !lue otherwise) + end type + + type :: ids_tf_coil_conductor + type(ids_tf_coil_conductor_elements) :: elements !Set of geometrical elements (line segments and/or arcs of a circle) describing the contour of the TF conductor centre + type(ids_delta_rzphi1d_static) :: cross_section !The cross-section perpendicular to the TF conductor contour is described by a series of contour points, given by their relative po! + !sition with respect to the start point of the first element. This cross-section is assumed constant for all elements. + real(ids_real) :: resistance=ids_real_invalid !conductor resistance + real(ids_real) :: resistance_error_upper=ids_real_invalid !Upper error for "resistance" + real(ids_real) :: resistance_error_lower=ids_real_invalid !Lower error for "resistance" + integer(ids_int) :: resistance_error_index=ids_int_invalid !Index in the error_description list for "resistance" + type(ids_signal_flt_1d) :: current !Current in the conductor (positive when it flows from the first to the last element) + type(ids_signal_flt_1d) :: voltage !Voltage on the conductor terminals + end type + + type :: ids_tf_coil + character(len=ids_string_length), dimension(:), pointer :: name => null() !Name of the coil + character(len=ids_string_length), dimension(:), pointer :: identifier => null() !Alphanumeric identifier of coil used for convenience + type(ids_tf_coil_conductor), pointer :: conductor(:) => null() !Set of conductors inside the coil. The structure can be used with size 1 for a simplified description as a single conductor. A con! + !ductor is composed of several elements, serially connected, i.e. transporting the same current. + real(ids_real) :: turns=ids_real_invalid !Number of total turns in a toroidal field coil. May be a fraction when describing the coil connections. + real(ids_real) :: turns_error_upper=ids_real_invalid !Upper error for "turns" + real(ids_real) :: turns_error_lower=ids_real_invalid !Lower error for "turns" + integer(ids_int) :: turns_error_index=ids_int_invalid !Index in the error_description list for "turns" + real(ids_real) :: resistance=ids_real_invalid !Coil resistance + real(ids_real) :: resistance_error_upper=ids_real_invalid !Upper error for "resistance" + real(ids_real) :: resistance_error_lower=ids_real_invalid !Lower error for "resistance" + integer(ids_int) :: resistance_error_index=ids_int_invalid !Index in the error_description list for "resistance" + type(ids_signal_flt_1d) :: current !Current in the coil + type(ids_signal_flt_1d) :: voltage !Voltage on the coil terminals + end type + + type :: ids_tf_ggd + type(ids_generic_grid_dynamic) :: grid !Grid description + type(ids_generic_grid_scalar), pointer :: b_field_r(:) => null() !R component of the vacuum magnetic field, given on various grid subsets + type(ids_generic_grid_scalar), pointer :: b_field_z(:) => null() !Z component of the vacuum magnetic field, given on various grid subsets + type(ids_generic_grid_scalar), pointer :: b_field_tor(:) => null() !Toroidal component of the vacuum magnetic field, given on various grid subsets + type(ids_generic_grid_scalar), pointer :: a_field_r(:) => null() !R component of the vacuum vector potential, given on various grid subsets + type(ids_generic_grid_scalar), pointer :: a_field_z(:) => null() !Z component of the vacuum vector potential, given on various grid subsets + type(ids_generic_grid_scalar), pointer :: a_field_tor(:) => null() !Toroidal component of the vacuum vector potential, given on various grid subsets + real(ids_real) :: time=ids_real_invalid !Time + end type + + + ! *********** tf IDS + type, extends(IDS_base) :: ids_tf !Toroidal field coils + logical, private :: c_data = .FALSE. ! Fortran specific metadata telling whether the IDS has been populated from C allocated data (LL) or not + integer, private :: max_occurrence = 3! Maximum occurrence allowed as defined in the DD + + type(ids_ids_properties) :: ids_properties !Interface Data Structure properties. This element identifies the node above as an IDS + real(ids_real) :: r0=ids_real_invalid !Reference major radius of the device (from the official description of the device). This node is the placeholder for this official! + ! machine description quantity (typically the middle of the vessel at the equatorial midplane, although the exact definition may de! + !pend on the device) + real(ids_real) :: r0_error_upper=ids_real_invalid !Upper error for "r0" + real(ids_real) :: r0_error_lower=ids_real_invalid !Lower error for "r0" + integer(ids_int) :: r0_error_index=ids_int_invalid !Index in the error_description list for "r0" + integer(ids_int) :: is_periodic=ids_int_invalid !Flag indicating whether coils are described one by one in the coil() structure (flag=0) or whether the coil structure represents o! + !nly coils having different characteristics (flag = 1, n_coils must be filled in that case). In the latter case, the coil() sequenc! + !e is repeated periodically around the torus. + integer(ids_int) :: coils_n=ids_int_invalid !Number of coils around the torus, in case is_periodic = 1 + type(ids_tf_coil), pointer :: coil(:) => null() !Set of coils around the tokamak + type(ids_tf_ggd), pointer :: field_map(:) => null() !Map of the vacuum field at various time slices, represented using the generic grid description + type(ids_signal_flt_1d) :: b_field_tor_vacuum_r !Vacuum field times major radius in the toroidal field magnet. Positive sign means anti-clockwise when viewed from above + type(ids_signal_flt_1d) :: delta_b_field_tor_vacuum_r !Variation of (vacuum field times major radius in the toroidal field magnet) from the start of the plasma. + real(ids_real) :: latency=ids_real_invalid !Upper bound of the delay between input command received from the RT network and actuator starting to react. Applies globally to th! + !e system described by this IDS unless specific latencies (e.g. channel-specific or antenna-specific) are provided at a deeper leve! + !l in the IDS structure. + real(ids_real) :: latency_error_upper=ids_real_invalid !Upper error for "latency" + real(ids_real) :: latency_error_lower=ids_real_invalid !Lower error for "latency" + integer(ids_int) :: latency_error_index=ids_int_invalid !Index in the error_description list for "latency" + type(ids_code) :: code !Generic decription of the code-specific parameters for the code that has produced this IDS + real(ids_real), pointer :: time(:) => null() !Generic time + end type + + ! *********** transport_solver_numerics IDS internal structures declaration + + type :: ids_numerics_solver_1d_equation_primary + type(ids_identifier_dynamic_aos3) :: identifier !Identifier of the primary quantity of the transport equation. The description node contains the path to the quantity in the physic! + !s IDS (example: core_profiles/profiles_1d/ion(1)/density) + integer(ids_int) :: ion_index=ids_int_invalid !If the primary quantity is related to a ion species, index of the corresponding species in the core_profiles/profiles_1d/ion array + integer(ids_int) :: neutral_index=ids_int_invalid !If the primary quantity is related to a neutral species, index of the corresponding species in the core_profiles/profiles_1d/neutr! + !al array + integer(ids_int) :: state_index=ids_int_invalid !If the primary quantity is related to a particular state (of an ion or a neutral species), index of the corresponding state in the! + ! core_profiles/profiles_1d/ion (or neutral)/state array + real(ids_real), pointer :: profile(:) => null() !Profile of the primary quantity + real(ids_real), pointer :: profile_error_upper(:) => null() !Upper error for "profile" + real(ids_real), pointer :: profile_error_lower(:) => null() !Lower error for "profile" + integer(ids_int) :: profile_error_index=ids_int_invalid !Index in the error_description list for "profile" + real(ids_real), pointer :: d_dr(:) => null() !Radial derivative with respect to the primary coordinate + real(ids_real), pointer :: d_dr_error_upper(:) => null() !Upper error for "d_dr" + real(ids_real), pointer :: d_dr_error_lower(:) => null() !Lower error for "d_dr" + integer(ids_int) :: d_dr_error_index=ids_int_invalid !Index in the error_description list for "d_dr" + real(ids_real), pointer :: d2_dr2(:) => null() !Second order radial derivative with respect to the primary coordinate + real(ids_real), pointer :: d2_dr2_error_upper(:) => null() !Upper error for "d2_dr2" + real(ids_real), pointer :: d2_dr2_error_lower(:) => null() !Lower error for "d2_dr2" + integer(ids_int) :: d2_dr2_error_index=ids_int_invalid !Index in the error_description list for "d2_dr2" + real(ids_real), pointer :: d_dt(:) => null() !Time derivative + real(ids_real), pointer :: d_dt_error_upper(:) => null() !Upper error for "d_dt" + real(ids_real), pointer :: d_dt_error_lower(:) => null() !Lower error for "d_dt" + integer(ids_int) :: d_dt_error_index=ids_int_invalid !Index in the error_description list for "d_dt" + real(ids_real), pointer :: d_dt_cphi(:) => null() !Derivative with respect to time, at constant toroidal flux (for current diffusion equation) + real(ids_real), pointer :: d_dt_cphi_error_upper(:) => null() !Upper error for "d_dt_cphi" + real(ids_real), pointer :: d_dt_cphi_error_lower(:) => null() !Lower error for "d_dt_cphi" + integer(ids_int) :: d_dt_cphi_error_index=ids_int_invalid !Index in the error_description list for "d_dt_cphi" + real(ids_real), pointer :: d_dt_cr(:) => null() !Derivative with respect to time, at constant primary coordinate coordinate (for current diffusion equation) + real(ids_real), pointer :: d_dt_cr_error_upper(:) => null() !Upper error for "d_dt_cr" + real(ids_real), pointer :: d_dt_cr_error_lower(:) => null() !Lower error for "d_dt_cr" + integer(ids_int) :: d_dt_cr_error_index=ids_int_invalid !Index in the error_description list for "d_dt_cr" + end type + + type :: ids_numerics_solver_1d_equation_bc + type(ids_identifier_dynamic_aos3) :: type !Boundary condition type + real(ids_real), pointer :: value(:) => null() !Value of the boundary condition. For type/index = 1 to 3, only the first position in the vector is used. For type/index = 5, all t! + !hree positions are used, meaning respectively a1, a2, a3. + real(ids_real), pointer :: value_error_upper(:) => null() !Upper error for "value" + real(ids_real), pointer :: value_error_lower(:) => null() !Lower error for "value" + integer(ids_int) :: value_error_index=ids_int_invalid !Index in the error_description list for "value" + real(ids_real) :: position=ids_real_invalid !Position, in terms of the primary coordinate, at which the boundary condition is imposed. Outside this position, the value of the ! + !data are considered to be prescribed (in case of a single boundary condition). + real(ids_real) :: position_error_upper=ids_real_invalid !Upper error for "position" + real(ids_real) :: position_error_lower=ids_real_invalid !Lower error for "position" + integer(ids_int) :: position_error_index=ids_int_invalid !Index in the error_description list for "position" + end type + + type :: ids_numerics_solver_1d_equation_coefficient + real(ids_real), pointer :: profile(:) => null() !Radial profile of the numerical coefficient + real(ids_real), pointer :: profile_error_upper(:) => null() !Upper error for "profile" + real(ids_real), pointer :: profile_error_lower(:) => null() !Lower error for "profile" + integer(ids_int) :: profile_error_index=ids_int_invalid !Index in the error_description list for "profile" + end type + + type :: ids_numerics_convergence_equations_single_delta + real(ids_real) :: value=ids_real_invalid !Value of the relative deviation + real(ids_real) :: value_error_upper=ids_real_invalid !Upper error for "value" + real(ids_real) :: value_error_lower=ids_real_invalid !Lower error for "value" + integer(ids_int) :: value_error_index=ids_int_invalid !Index in the error_description list for "value" + character(len=ids_string_length), dimension(:), pointer :: expression => null() !Expression used by the solver to calculate the relative deviation + end type + + type :: ids_numerics_convergence_equations_single + integer(ids_int) :: iterations_n=ids_int_invalid !Number of iterations carried out in the convergence loop + type(ids_numerics_convergence_equations_single_delta) :: delta_relative !Relative deviation on the primary quantity of the transport equation between the present and the previous iteration of the solver + end type + + type :: ids_numerics_solver_1d_equation + type(ids_numerics_solver_1d_equation_primary) :: primary_quantity !Profile and derivatives of the primary quantity of the transport equation + type(ids_identifier_dynamic_aos3) :: computation_mode !Computation mode for this equation + type(ids_numerics_solver_1d_equation_bc), pointer :: boundary_condition(:) => null() !Set of boundary conditions of the transport equation + type(ids_numerics_solver_1d_equation_coefficient), pointer :: coefficient(:) => null() !Set of numerical coefficients involved in the transport equation + type(ids_numerics_convergence_equations_single) :: convergence !Convergence details + end type + + type :: ids_numerics_solver_1d_equation_control_int + integer(ids_int) :: value=ids_int_invalid !Value of the control parameter + end type + + type :: ids_numerics_solver_1d_equation_control_float + real(ids_real) :: value=ids_real_invalid !Value of the control parameter + real(ids_real) :: value_error_upper=ids_real_invalid !Upper error for "value" + real(ids_real) :: value_error_lower=ids_real_invalid !Lower error for "value" + integer(ids_int) :: value_error_index=ids_int_invalid !Index in the error_description list for "value" + end type + + type :: ids_numerics_solver_1d_equation_control_parameters + type(ids_numerics_solver_1d_equation_control_int), pointer :: integer0d(:) => null() !Set of integer type scalar control parameters + type(ids_numerics_solver_1d_equation_control_float), pointer :: real0d(:) => null() !Set of real type scalar control parameters + end type + + type :: ids_numerics_solver_1d + type(ids_core_radial_grid) :: grid !Radial grid + type(ids_numerics_solver_1d_equation), pointer :: equation(:) => null() !Set of transport equations + type(ids_numerics_solver_1d_equation_control_parameters) :: control_parameters !Solver-specific input or output quantities + real(ids_real), pointer :: drho_tor_dt(:) => null() !Partial derivative of the toroidal flux coordinate profile with respect to time + real(ids_real), pointer :: drho_tor_dt_error_upper(:) => null() !Upper error for "drho_tor_dt" + real(ids_real), pointer :: drho_tor_dt_error_lower(:) => null() !Lower error for "drho_tor_dt" + integer(ids_int) :: drho_tor_dt_error_index=ids_int_invalid !Index in the error_description list for "drho_tor_dt" + real(ids_real), pointer :: d_dvolume_drho_tor_dt(:) => null() !Partial derivative with respect to time of the derivative of the volume with respect to the toroidal flux coordinate + real(ids_real), pointer :: d_dvolume_drho_tor_dt_error_upper(:) => null() !Upper error for "d_dvolume_drho_tor_dt" + real(ids_real), pointer :: d_dvolume_drho_tor_dt_error_lower(:) => null() !Lower error for "d_dvolume_drho_tor_dt" + integer(ids_int) :: d_dvolume_drho_tor_dt_error_index=ids_int_invalid !Index in the error_description list for "d_dvolume_drho_tor_dt" + real(ids_real) :: time=ids_real_invalid !Time + end type + + type :: ids_numerics_profiles_1d_derivatives_electrons_d + real(ids_real), pointer :: temperature(:) => null() !Temperature + real(ids_real), pointer :: temperature_error_upper(:) => null() !Upper error for "temperature" + real(ids_real), pointer :: temperature_error_lower(:) => null() !Lower error for "temperature" + integer(ids_int) :: temperature_error_index=ids_int_invalid !Index in the error_description list for "temperature" + real(ids_real), pointer :: density(:) => null() !Density (thermal+non-thermal) + real(ids_real), pointer :: density_error_upper(:) => null() !Upper error for "density" + real(ids_real), pointer :: density_error_lower(:) => null() !Lower error for "density" + integer(ids_int) :: density_error_index=ids_int_invalid !Index in the error_description list for "density" + real(ids_real), pointer :: density_fast(:) => null() !Density of fast (non-thermal) particles + real(ids_real), pointer :: density_fast_error_upper(:) => null() !Upper error for "density_fast" + real(ids_real), pointer :: density_fast_error_lower(:) => null() !Lower error for "density_fast" + integer(ids_int) :: density_fast_error_index=ids_int_invalid !Index in the error_description list for "density_fast" + real(ids_real), pointer :: pressure(:) => null() !Pressure + real(ids_real), pointer :: pressure_error_upper(:) => null() !Upper error for "pressure" + real(ids_real), pointer :: pressure_error_lower(:) => null() !Lower error for "pressure" + integer(ids_int) :: pressure_error_index=ids_int_invalid !Index in the error_description list for "pressure" + real(ids_real), pointer :: pressure_fast_perpendicular(:) => null() !Fast (non-thermal) perpendicular pressure + real(ids_real), pointer :: pressure_fast_perpendicular_error_upper(:) => null() !Upper error for "pressure_fast_perpendicular" + real(ids_real), pointer :: pressure_fast_perpendicular_error_lower(:) => null() !Lower error for "pressure_fast_perpendicular" + integer(ids_int) :: pressure_fast_perpendicular_error_index=ids_int_invalid !Index in the error_description list for "pressure_fast_perpendicular" + real(ids_real), pointer :: pressure_fast_parallel(:) => null() !Fast (non-thermal) parallel pressure + real(ids_real), pointer :: pressure_fast_parallel_error_upper(:) => null() !Upper error for "pressure_fast_parallel" + real(ids_real), pointer :: pressure_fast_parallel_error_lower(:) => null() !Lower error for "pressure_fast_parallel" + integer(ids_int) :: pressure_fast_parallel_error_index=ids_int_invalid !Index in the error_description list for "pressure_fast_parallel" + real(ids_real), pointer :: velocity_tor(:) => null() !Toroidal velocity + real(ids_real), pointer :: velocity_tor_error_upper(:) => null() !Upper error for "velocity_tor" + real(ids_real), pointer :: velocity_tor_error_lower(:) => null() !Lower error for "velocity_tor" + integer(ids_int) :: velocity_tor_error_index=ids_int_invalid !Index in the error_description list for "velocity_tor" + real(ids_real), pointer :: velocity_pol(:) => null() !Poloidal velocity + real(ids_real), pointer :: velocity_pol_error_upper(:) => null() !Upper error for "velocity_pol" + real(ids_real), pointer :: velocity_pol_error_lower(:) => null() !Lower error for "velocity_pol" + integer(ids_int) :: velocity_pol_error_index=ids_int_invalid !Index in the error_description list for "velocity_pol" + end type + + type :: ids_numerics_profiles_1d_derivatives_electrons + type(ids_numerics_profiles_1d_derivatives_electrons_d) :: d_drho_tor_norm !Derivatives with respect to the normalised toroidal flux + type(ids_numerics_profiles_1d_derivatives_electrons_d) :: d2_drho_tor_norm2 !Second derivatives with respect to the normalised toroidal flux + type(ids_numerics_profiles_1d_derivatives_electrons_d) :: d_dt !Derivatives with respect to time + end type + + type :: ids_numerics_profiles_1d_derivatives_ion_d + real(ids_real), pointer :: temperature(:) => null() !Temperature (average over charge states when multiple charge states are considered) + real(ids_real), pointer :: temperature_error_upper(:) => null() !Upper error for "temperature" + real(ids_real), pointer :: temperature_error_lower(:) => null() !Lower error for "temperature" + integer(ids_int) :: temperature_error_index=ids_int_invalid !Index in the error_description list for "temperature" + real(ids_real), pointer :: density(:) => null() !Density (thermal+non-thermal) (sum over charge states when multiple charge states are considered) + real(ids_real), pointer :: density_error_upper(:) => null() !Upper error for "density" + real(ids_real), pointer :: density_error_lower(:) => null() !Lower error for "density" + integer(ids_int) :: density_error_index=ids_int_invalid !Index in the error_description list for "density" + real(ids_real), pointer :: density_fast(:) => null() !Density of fast (non-thermal) particles (sum over charge states when multiple charge states are considered) + real(ids_real), pointer :: density_fast_error_upper(:) => null() !Upper error for "density_fast" + real(ids_real), pointer :: density_fast_error_lower(:) => null() !Lower error for "density_fast" + integer(ids_int) :: density_fast_error_index=ids_int_invalid !Index in the error_description list for "density_fast" + real(ids_real), pointer :: pressure(:) => null() !Pressure (average over charge states when multiple charge states are considered) + real(ids_real), pointer :: pressure_error_upper(:) => null() !Upper error for "pressure" + real(ids_real), pointer :: pressure_error_lower(:) => null() !Lower error for "pressure" + integer(ids_int) :: pressure_error_index=ids_int_invalid !Index in the error_description list for "pressure" + real(ids_real), pointer :: pressure_fast_perpendicular(:) => null() !Fast (non-thermal) perpendicular pressure (average over charge states when multiple charge states are considered) + real(ids_real), pointer :: pressure_fast_perpendicular_error_upper(:) => null() !Upper error for "pressure_fast_perpendicular" + real(ids_real), pointer :: pressure_fast_perpendicular_error_lower(:) => null() !Lower error for "pressure_fast_perpendicular" + integer(ids_int) :: pressure_fast_perpendicular_error_index=ids_int_invalid !Index in the error_description list for "pressure_fast_perpendicular" + real(ids_real), pointer :: pressure_fast_parallel(:) => null() !Fast (non-thermal) parallel pressure (average over charge states when multiple charge states are considered) + real(ids_real), pointer :: pressure_fast_parallel_error_upper(:) => null() !Upper error for "pressure_fast_parallel" + real(ids_real), pointer :: pressure_fast_parallel_error_lower(:) => null() !Lower error for "pressure_fast_parallel" + integer(ids_int) :: pressure_fast_parallel_error_index=ids_int_invalid !Index in the error_description list for "pressure_fast_parallel" + real(ids_real), pointer :: velocity_tor(:) => null() !Toroidal velocity (average over charge states when multiple charge states are considered) + real(ids_real), pointer :: velocity_tor_error_upper(:) => null() !Upper error for "velocity_tor" + real(ids_real), pointer :: velocity_tor_error_lower(:) => null() !Lower error for "velocity_tor" + integer(ids_int) :: velocity_tor_error_index=ids_int_invalid !Index in the error_description list for "velocity_tor" + real(ids_real), pointer :: velocity_pol(:) => null() !Poloidal velocity (average over charge states when multiple charge states are considered) + real(ids_real), pointer :: velocity_pol_error_upper(:) => null() !Upper error for "velocity_pol" + real(ids_real), pointer :: velocity_pol_error_lower(:) => null() !Lower error for "velocity_pol" + integer(ids_int) :: velocity_pol_error_index=ids_int_invalid !Index in the error_description list for "velocity_pol" + end type + + type :: ids_numerics_profiles_1d_derivatives_charge_state_d + real(ids_real), pointer :: temperature(:) => null() !Temperature + real(ids_real), pointer :: temperature_error_upper(:) => null() !Upper error for "temperature" + real(ids_real), pointer :: temperature_error_lower(:) => null() !Lower error for "temperature" + integer(ids_int) :: temperature_error_index=ids_int_invalid !Index in the error_description list for "temperature" + real(ids_real), pointer :: density(:) => null() !Density (thermal+non-thermal) + real(ids_real), pointer :: density_error_upper(:) => null() !Upper error for "density" + real(ids_real), pointer :: density_error_lower(:) => null() !Lower error for "density" + integer(ids_int) :: density_error_index=ids_int_invalid !Index in the error_description list for "density" + real(ids_real), pointer :: density_fast(:) => null() !Density of fast (non-thermal) particles + real(ids_real), pointer :: density_fast_error_upper(:) => null() !Upper error for "density_fast" + real(ids_real), pointer :: density_fast_error_lower(:) => null() !Lower error for "density_fast" + integer(ids_int) :: density_fast_error_index=ids_int_invalid !Index in the error_description list for "density_fast" + real(ids_real), pointer :: pressure(:) => null() !Pressure + real(ids_real), pointer :: pressure_error_upper(:) => null() !Upper error for "pressure" + real(ids_real), pointer :: pressure_error_lower(:) => null() !Lower error for "pressure" + integer(ids_int) :: pressure_error_index=ids_int_invalid !Index in the error_description list for "pressure" + real(ids_real), pointer :: pressure_fast_perpendicular(:) => null() !Fast (non-thermal) perpendicular pressure + real(ids_real), pointer :: pressure_fast_perpendicular_error_upper(:) => null() !Upper error for "pressure_fast_perpendicular" + real(ids_real), pointer :: pressure_fast_perpendicular_error_lower(:) => null() !Lower error for "pressure_fast_perpendicular" + integer(ids_int) :: pressure_fast_perpendicular_error_index=ids_int_invalid !Index in the error_description list for "pressure_fast_perpendicular" + real(ids_real), pointer :: pressure_fast_parallel(:) => null() !Fast (non-thermal) parallel pressure + real(ids_real), pointer :: pressure_fast_parallel_error_upper(:) => null() !Upper error for "pressure_fast_parallel" + real(ids_real), pointer :: pressure_fast_parallel_error_lower(:) => null() !Lower error for "pressure_fast_parallel" + integer(ids_int) :: pressure_fast_parallel_error_index=ids_int_invalid !Index in the error_description list for "pressure_fast_parallel" + real(ids_real), pointer :: velocity_tor(:) => null() !Toroidal velocity + real(ids_real), pointer :: velocity_tor_error_upper(:) => null() !Upper error for "velocity_tor" + real(ids_real), pointer :: velocity_tor_error_lower(:) => null() !Lower error for "velocity_tor" + integer(ids_int) :: velocity_tor_error_index=ids_int_invalid !Index in the error_description list for "velocity_tor" + real(ids_real), pointer :: velocity_pol(:) => null() !Poloidal velocity + real(ids_real), pointer :: velocity_pol_error_upper(:) => null() !Upper error for "velocity_pol" + real(ids_real), pointer :: velocity_pol_error_lower(:) => null() !Lower error for "velocity_pol" + integer(ids_int) :: velocity_pol_error_index=ids_int_invalid !Index in the error_description list for "velocity_pol" + end type + + type :: ids_numerics_profiles_1d_derivatives_charge_state + real(ids_real) :: z_min=ids_real_invalid !Minimum Z of the charge state bundle + real(ids_real) :: z_min_error_upper=ids_real_invalid !Upper error for "z_min" + real(ids_real) :: z_min_error_lower=ids_real_invalid !Lower error for "z_min" + integer(ids_int) :: z_min_error_index=ids_int_invalid !Index in the error_description list for "z_min" + real(ids_real) :: z_max=ids_real_invalid !Maximum Z of the charge state bundle + real(ids_real) :: z_max_error_upper=ids_real_invalid !Upper error for "z_max" + real(ids_real) :: z_max_error_lower=ids_real_invalid !Lower error for "z_max" + integer(ids_int) :: z_max_error_index=ids_int_invalid !Index in the error_description list for "z_max" + character(len=ids_string_length), dimension(:), pointer :: label => null() !String identifying charge state (e.g. C+, C+2 , C+3, C+4, C+5, C+6, ...) + real(ids_real) :: vibrational_level=ids_real_invalid !Vibrational level (can be bundled) + real(ids_real) :: vibrational_level_error_upper=ids_real_invalid !Upper error for "vibrational_level" + real(ids_real) :: vibrational_level_error_lower=ids_real_invalid !Lower error for "vibrational_level" + integer(ids_int) :: vibrational_level_error_index=ids_int_invalid !Index in the error_description list for "vibrational_level" + character(len=ids_string_length), dimension(:), pointer :: vibrational_mode => null() !Vibrational mode of this state, e.g. "A_g". Need to define, or adopt a standard nomenclature. + integer(ids_int) :: is_neutral=ids_int_invalid !Flag specifying if this state corresponds to a neutral (1) or not (0) + type(ids_identifier_dynamic_aos3) :: neutral_type !Neutral type (if the considered state is a neutral), in terms of energy. ID =1: cold; 2: thermal; 3: fast; 4: NBI + character(len=ids_string_length), dimension(:), pointer :: electron_configuration => null() !Configuration of atomic orbitals of this state, e.g. 1s2-2s1 + type(ids_numerics_profiles_1d_derivatives_charge_state_d) :: d_drho_tor_norm !Derivatives with respect to the normalised toroidal flux + type(ids_numerics_profiles_1d_derivatives_charge_state_d) :: d2_drho_tor_norm2 !Second derivatives with respect to the normalised toroidal flux + type(ids_numerics_profiles_1d_derivatives_charge_state_d) :: d_dt !Derivatives with respect to time + end type + + type :: ids_numerics_profiles_1d_derivatives_ion + real(ids_real) :: a=ids_real_invalid !Mass of atom + real(ids_real) :: a_error_upper=ids_real_invalid !Upper error for "a" + real(ids_real) :: a_error_lower=ids_real_invalid !Lower error for "a" + integer(ids_int) :: a_error_index=ids_int_invalid !Index in the error_description list for "a" + real(ids_real) :: z_ion=ids_real_invalid !Ion charge (of the dominant ionisation state; lumped ions are allowed) + real(ids_real) :: z_ion_error_upper=ids_real_invalid !Upper error for "z_ion" + real(ids_real) :: z_ion_error_lower=ids_real_invalid !Lower error for "z_ion" + integer(ids_int) :: z_ion_error_index=ids_int_invalid !Index in the error_description list for "z_ion" + real(ids_real) :: z_n=ids_real_invalid !Nuclear charge + real(ids_real) :: z_n_error_upper=ids_real_invalid !Upper error for "z_n" + real(ids_real) :: z_n_error_lower=ids_real_invalid !Lower error for "z_n" + integer(ids_int) :: z_n_error_index=ids_int_invalid !Index in the error_description list for "z_n" + character(len=ids_string_length), dimension(:), pointer :: label => null() !String identifying ion (e.g. H+, D+, T+, He+2, C+, ...) + type(ids_numerics_profiles_1d_derivatives_ion_d) :: d_drho_tor_norm !Derivatives with respect to the normalised toroidal flux + type(ids_numerics_profiles_1d_derivatives_ion_d) :: d2_drho_tor_norm2 !Second derivatives with respect to the normalised toroidal flux + type(ids_numerics_profiles_1d_derivatives_ion_d) :: d_dt !Derivatives with respect to time + integer(ids_int) :: multiple_states_flag=ids_int_invalid !Multiple state calculation flag : 0-Only one state is considered; 1-Multiple states are considered and are described in the state ! + !structure + type(ids_numerics_profiles_1d_derivatives_charge_state), pointer :: state(:) => null() !Quantities related to the different states of the species (ionisation, energy, excitation, ...) + end type + + type :: ids_numerics_profiles_1d_derivatives_total_ions + real(ids_real), pointer :: n_i_total_over_n_e(:) => null() !Ratio of total ion density (sum over species and charge states) over electron density. (thermal+non-thermal) + real(ids_real), pointer :: n_i_total_over_n_e_error_upper(:) => null() !Upper error for "n_i_total_over_n_e" + real(ids_real), pointer :: n_i_total_over_n_e_error_lower(:) => null() !Lower error for "n_i_total_over_n_e" + integer(ids_int) :: n_i_total_over_n_e_error_index=ids_int_invalid !Index in the error_description list for "n_i_total_over_n_e" + real(ids_real), pointer :: pressure_ion_total(:) => null() !Total thermal ion pressure + real(ids_real), pointer :: pressure_ion_total_error_upper(:) => null() !Upper error for "pressure_ion_total" + real(ids_real), pointer :: pressure_ion_total_error_lower(:) => null() !Lower error for "pressure_ion_total" + integer(ids_int) :: pressure_ion_total_error_index=ids_int_invalid !Index in the error_description list for "pressure_ion_total" + end type + + type :: ids_numerics_profiles_1d_derivatives + type(ids_core_radial_grid) :: grid !Radial grid + type(ids_numerics_profiles_1d_derivatives_electrons) :: electrons !Quantities related to the electrons + type(ids_numerics_profiles_1d_derivatives_ion), pointer :: ion(:) => null() !Quantities related to the different ion species + type(ids_numerics_profiles_1d_derivatives_total_ions) :: d_drho_tor_norm !Derivatives of total ion quantities with respect to the normalised toroidal flux + type(ids_numerics_profiles_1d_derivatives_total_ions) :: d2_drho_tor_norm2 !Second derivatives of total ion quantities with respect to the normalised toroidal flux + type(ids_numerics_profiles_1d_derivatives_total_ions) :: d_dt !Derivatives of total ion quantities with respect to time + real(ids_real), pointer :: dpsi_dt(:) => null() !Derivative of the poloidal flux profile with respect to time + real(ids_real), pointer :: dpsi_dt_error_upper(:) => null() !Upper error for "dpsi_dt" + real(ids_real), pointer :: dpsi_dt_error_lower(:) => null() !Lower error for "dpsi_dt" + integer(ids_int) :: dpsi_dt_error_index=ids_int_invalid !Index in the error_description list for "dpsi_dt" + real(ids_real), pointer :: dpsi_dt_cphi(:) => null() !Derivative of the poloidal flux profile with respect to time, at constant toroidal flux + real(ids_real), pointer :: dpsi_dt_cphi_error_upper(:) => null() !Upper error for "dpsi_dt_cphi" + real(ids_real), pointer :: dpsi_dt_cphi_error_lower(:) => null() !Lower error for "dpsi_dt_cphi" + integer(ids_int) :: dpsi_dt_cphi_error_index=ids_int_invalid !Index in the error_description list for "dpsi_dt_cphi" + real(ids_real), pointer :: dpsi_dt_crho_tor_norm(:) => null() !Derivative of the poloidal flux profile with respect to time, at constant normalised toroidal flux coordinate + real(ids_real), pointer :: dpsi_dt_crho_tor_norm_error_upper(:) => null() !Upper error for "dpsi_dt_crho_tor_norm" + real(ids_real), pointer :: dpsi_dt_crho_tor_norm_error_lower(:) => null() !Lower error for "dpsi_dt_crho_tor_norm" + integer(ids_int) :: dpsi_dt_crho_tor_norm_error_index=ids_int_invalid !Index in the error_description list for "dpsi_dt_crho_tor_norm" + real(ids_real), pointer :: drho_tor_dt(:) => null() !Partial derivative of the toroidal flux coordinate profile with respect to time + real(ids_real), pointer :: drho_tor_dt_error_upper(:) => null() !Upper error for "drho_tor_dt" + real(ids_real), pointer :: drho_tor_dt_error_lower(:) => null() !Lower error for "drho_tor_dt" + integer(ids_int) :: drho_tor_dt_error_index=ids_int_invalid !Index in the error_description list for "drho_tor_dt" + real(ids_real), pointer :: d_dvolume_drho_tor_dt(:) => null() !Partial derivative with respect to time of the derivative of the volume with respect to the toroidal flux coordinate + real(ids_real), pointer :: d_dvolume_drho_tor_dt_error_upper(:) => null() !Upper error for "d_dvolume_drho_tor_dt" + real(ids_real), pointer :: d_dvolume_drho_tor_dt_error_lower(:) => null() !Lower error for "d_dvolume_drho_tor_dt" + integer(ids_int) :: d_dvolume_drho_tor_dt_error_index=ids_int_invalid !Index in the error_description list for "d_dvolume_drho_tor_dt" + real(ids_real), pointer :: dpsi_drho_tor(:) => null() !Derivative of the poloidal flux profile with respect to the toroidal flux coordinate + real(ids_real), pointer :: dpsi_drho_tor_error_upper(:) => null() !Upper error for "dpsi_drho_tor" + real(ids_real), pointer :: dpsi_drho_tor_error_lower(:) => null() !Lower error for "dpsi_drho_tor" + integer(ids_int) :: dpsi_drho_tor_error_index=ids_int_invalid !Index in the error_description list for "dpsi_drho_tor" + real(ids_real), pointer :: d2psi_drho_tor2(:) => null() !Second derivative of the poloidal flux profile with respect to the toroidal flux coordinate + real(ids_real), pointer :: d2psi_drho_tor2_error_upper(:) => null() !Upper error for "d2psi_drho_tor2" + real(ids_real), pointer :: d2psi_drho_tor2_error_lower(:) => null() !Lower error for "d2psi_drho_tor2" + integer(ids_int) :: d2psi_drho_tor2_error_index=ids_int_invalid !Index in the error_description list for "d2psi_drho_tor2" + real(ids_real) :: time=ids_real_invalid !Time + end type + + type :: ids_numerics_bc_1d_current + type(ids_identifier_dynamic_aos3) :: identifier !Identifier of the boundary condition type. ID = 1: poloidal flux; 2: ip; 3: loop voltage; 4: undefined; 5: generic boundary condit! + !ion y expressed as a1y'+a2y=a3. 6: equation not solved; + real(ids_real), pointer :: value(:) => null() !Value of the boundary condition. For ID = 1 to 3, only the first position in the vector is used. For ID = 5, all three positions a! + !re used, meaning respectively a1, a2, a3. + real(ids_real), pointer :: value_error_upper(:) => null() !Upper error for "value" + real(ids_real), pointer :: value_error_lower(:) => null() !Lower error for "value" + integer(ids_int) :: value_error_index=ids_int_invalid !Index in the error_description list for "value" + real(ids_real) :: rho_tor_norm=ids_real_invalid !Position, in normalised toroidal flux, at which the boundary condition is imposed. Outside this position, the value of the data ar! + !e considered to be prescribed. + real(ids_real) :: rho_tor_norm_error_upper=ids_real_invalid !Upper error for "rho_tor_norm" + real(ids_real) :: rho_tor_norm_error_lower=ids_real_invalid !Lower error for "rho_tor_norm" + integer(ids_int) :: rho_tor_norm_error_index=ids_int_invalid !Index in the error_description list for "rho_tor_norm" + end type + + type :: ids_numerics_bc_1d_bc + type(ids_identifier_dynamic_aos3) :: identifier !Identifier of the boundary condition type. ID = 1: value of the field y; 2: radial derivative of the field (-dy/drho_tor); 3: scal! + !e length of the field y/(-dy/drho_tor); 4: flux; 5: generic boundary condition y expressed as a1y'+a2y=a3. 6: equation not solved;! + ! + real(ids_real), pointer :: value(:) => null() !Value of the boundary condition. For ID = 1 to 4, only the first position in the vector is used. For ID = 5, all three positions a! + !re used, meaning respectively a1, a2, a3. + real(ids_real), pointer :: value_error_upper(:) => null() !Upper error for "value" + real(ids_real), pointer :: value_error_lower(:) => null() !Lower error for "value" + integer(ids_int) :: value_error_index=ids_int_invalid !Index in the error_description list for "value" + real(ids_real) :: rho_tor_norm=ids_real_invalid !Position, in normalised toroidal flux, at which the boundary condition is imposed. Outside this position, the value of the data ar! + !e considered to be prescribed. + real(ids_real) :: rho_tor_norm_error_upper=ids_real_invalid !Upper error for "rho_tor_norm" + real(ids_real) :: rho_tor_norm_error_lower=ids_real_invalid !Lower error for "rho_tor_norm" + integer(ids_int) :: rho_tor_norm_error_index=ids_int_invalid !Index in the error_description list for "rho_tor_norm" + end type + + type :: ids_numerics_bc_1d_electrons + type(ids_numerics_bc_1d_bc) :: particles !Boundary condition for the electron density equation (density if ID = 1) + type(ids_numerics_bc_1d_bc) :: energy !Boundary condition for the electron energy equation (temperature if ID = 1) + end type + + type :: ids_numerics_bc_1d_ion_charge_state + real(ids_real) :: z_min=ids_real_invalid !Minimum Z of the charge state bundle + real(ids_real) :: z_min_error_upper=ids_real_invalid !Upper error for "z_min" + real(ids_real) :: z_min_error_lower=ids_real_invalid !Lower error for "z_min" + integer(ids_int) :: z_min_error_index=ids_int_invalid !Index in the error_description list for "z_min" + real(ids_real) :: z_max=ids_real_invalid !Maximum Z of the charge state bundle + real(ids_real) :: z_max_error_upper=ids_real_invalid !Upper error for "z_max" + real(ids_real) :: z_max_error_lower=ids_real_invalid !Lower error for "z_max" + integer(ids_int) :: z_max_error_index=ids_int_invalid !Index in the error_description list for "z_max" + character(len=ids_string_length), dimension(:), pointer :: label => null() !String identifying charge state (e.g. C+, C+2 , C+3, C+4, C+5, C+6, ...) + real(ids_real) :: vibrational_level=ids_real_invalid !Vibrational level (can be bundled) + real(ids_real) :: vibrational_level_error_upper=ids_real_invalid !Upper error for "vibrational_level" + real(ids_real) :: vibrational_level_error_lower=ids_real_invalid !Lower error for "vibrational_level" + integer(ids_int) :: vibrational_level_error_index=ids_int_invalid !Index in the error_description list for "vibrational_level" + character(len=ids_string_length), dimension(:), pointer :: vibrational_mode => null() !Vibrational mode of this state, e.g. "A_g". Need to define, or adopt a standard nomenclature. + integer(ids_int) :: is_neutral=ids_int_invalid !Flag specifying if this state corresponds to a neutral (1) or not (0) + type(ids_identifier_dynamic_aos3) :: neutral_type !Neutral type (if the considered state is a neutral), in terms of energy. ID =1: cold; 2: thermal; 3: fast; 4: NBI + character(len=ids_string_length), dimension(:), pointer :: electron_configuration => null() !Configuration of atomic orbitals of this state, e.g. 1s2-2s1 + type(ids_numerics_bc_1d_bc) :: particles !Boundary condition for the charge state density equation (density if ID = 1) + type(ids_numerics_bc_1d_bc) :: energy !Boundary condition for the charge state energy equation (temperature if ID = 1) + end type + + type :: ids_numerics_bc_1d_ion + real(ids_real) :: a=ids_real_invalid !Mass of atom + real(ids_real) :: a_error_upper=ids_real_invalid !Upper error for "a" + real(ids_real) :: a_error_lower=ids_real_invalid !Lower error for "a" + integer(ids_int) :: a_error_index=ids_int_invalid !Index in the error_description list for "a" + real(ids_real) :: z_ion=ids_real_invalid !Ion charge (of the dominant ionisation state; lumped ions are allowed) + real(ids_real) :: z_ion_error_upper=ids_real_invalid !Upper error for "z_ion" + real(ids_real) :: z_ion_error_lower=ids_real_invalid !Lower error for "z_ion" + integer(ids_int) :: z_ion_error_index=ids_int_invalid !Index in the error_description list for "z_ion" + real(ids_real) :: z_n=ids_real_invalid !Nuclear charge + real(ids_real) :: z_n_error_upper=ids_real_invalid !Upper error for "z_n" + real(ids_real) :: z_n_error_lower=ids_real_invalid !Lower error for "z_n" + integer(ids_int) :: z_n_error_index=ids_int_invalid !Index in the error_description list for "z_n" + character(len=ids_string_length), dimension(:), pointer :: label => null() !String identifying ion (e.g. H+, D+, T+, He+2, C+, ...) + type(ids_numerics_bc_1d_bc) :: particles !Boundary condition for the ion density equation (density if ID = 1) + type(ids_numerics_bc_1d_bc) :: energy !Boundary condition for the ion energy equation (temperature if ID = 1) + integer(ids_int) :: multiple_states_flag=ids_int_invalid !Multiple states calculation flag : 0-Only one state is considered; 1-Multiple states are considered and are described in the state! + ! structure + type(ids_numerics_bc_1d_ion_charge_state), pointer :: state(:) => null() !Quantities related to the different states of the species (ionisation, energy, excitation, ...) + end type + + type :: ids_numerics_bc_1d + type(ids_numerics_bc_1d_current) :: current !Boundary condition for the current diffusion equation. + type(ids_numerics_bc_1d_electrons) :: electrons !Quantities related to the electrons + type(ids_numerics_bc_1d_ion), pointer :: ion(:) => null() !Quantities related to the different ion species + type(ids_numerics_bc_1d_bc) :: energy_ion_total !Boundary condition for the ion total (sum over ion species) energy equation (temperature if ID = 1) + type(ids_numerics_bc_1d_bc) :: momentum_tor !Boundary condition for the total plasma toroidal momentum equation (summed over ion species and electrons) (momentum if ID = 1) + real(ids_real) :: time=ids_real_invalid !Time + end type + + type :: ids_numerics_bc_ggd_current + type(ids_identifier_dynamic_aos3) :: identifier !Identifier of the boundary condition type. List of options TBD. + integer(ids_int) :: grid_index=ids_int_invalid !Index of the grid used to represent this quantity + integer(ids_int) :: grid_subset_index=ids_int_invalid !Index of the grid subset the data is provided on + real(ids_real), pointer :: values(:,:) => null() !List of vector components, one list per element in the grid subset. First dimenstion: element index. Second dimension: vector comp! + !onent index (for ID = 1 to 3, only the first position in the vector is used. For ID = 5, all three positions are used, meaning res! + !pectively a1, a2, a3) + real(ids_real), pointer :: values_error_upper(:,:) => null() !Upper error for "values" + real(ids_real), pointer :: values_error_lower(:,:) => null() !Lower error for "values" + integer(ids_int) :: values_error_index=ids_int_invalid !Index in the error_description list for "values" + end type + + type :: ids_numerics_bc_ggd_bc + type(ids_identifier_dynamic_aos3) :: identifier !Identifier of the boundary condition type. List of options TBD. + integer(ids_int) :: grid_index=ids_int_invalid !Index of the grid used to represent this quantity + integer(ids_int) :: grid_subset_index=ids_int_invalid !Index of the grid subset the data is provided on + real(ids_real), pointer :: values(:,:) => null() !List of vector components, one list per element in the grid subset. First dimenstion: element index. Second dimension: vector comp! + !onent index (for ID = 1 to 3, only the first position in the vector is used. For ID = 5, all three positions are used, meaning res! + !pectively a1, a2, a3) + real(ids_real), pointer :: values_error_upper(:,:) => null() !Upper error for "values" + real(ids_real), pointer :: values_error_lower(:,:) => null() !Lower error for "values" + integer(ids_int) :: values_error_index=ids_int_invalid !Index in the error_description list for "values" + end type + + type :: ids_numerics_bc_ggd_electrons + type(ids_numerics_bc_ggd_bc), pointer :: particles(:) => null() !Boundary condition for the electron density equation (density if ID = 1), on various grid subsets + type(ids_numerics_bc_ggd_bc), pointer :: energy(:) => null() !Boundary condition for the electron energy equation (temperature if ID = 1), on various grid subsets + end type + + type :: ids_numerics_bc_ggd_ion_charge_state + real(ids_real) :: z_min=ids_real_invalid !Minimum Z of the charge state bundle + real(ids_real) :: z_min_error_upper=ids_real_invalid !Upper error for "z_min" + real(ids_real) :: z_min_error_lower=ids_real_invalid !Lower error for "z_min" + integer(ids_int) :: z_min_error_index=ids_int_invalid !Index in the error_description list for "z_min" + real(ids_real) :: z_max=ids_real_invalid !Maximum Z of the charge state bundle + real(ids_real) :: z_max_error_upper=ids_real_invalid !Upper error for "z_max" + real(ids_real) :: z_max_error_lower=ids_real_invalid !Lower error for "z_max" + integer(ids_int) :: z_max_error_index=ids_int_invalid !Index in the error_description list for "z_max" + character(len=ids_string_length), dimension(:), pointer :: label => null() !String identifying charge state (e.g. C+, C+2 , C+3, C+4, C+5, C+6, ...) + real(ids_real) :: vibrational_level=ids_real_invalid !Vibrational level (can be bundled) + real(ids_real) :: vibrational_level_error_upper=ids_real_invalid !Upper error for "vibrational_level" + real(ids_real) :: vibrational_level_error_lower=ids_real_invalid !Lower error for "vibrational_level" + integer(ids_int) :: vibrational_level_error_index=ids_int_invalid !Index in the error_description list for "vibrational_level" + character(len=ids_string_length), dimension(:), pointer :: vibrational_mode => null() !Vibrational mode of this state, e.g. "A_g". Need to define, or adopt a standard nomenclature. + integer(ids_int) :: is_neutral=ids_int_invalid !Flag specifying if this state corresponds to a neutral (1) or not (0) + type(ids_identifier_dynamic_aos3) :: neutral_type !Neutral type (if the considered state is a neutral), in terms of energy. ID =1: cold; 2: thermal; 3: fast; 4: NBI + character(len=ids_string_length), dimension(:), pointer :: electron_configuration => null() !Configuration of atomic orbitals of this state, e.g. 1s2-2s1 + type(ids_numerics_bc_ggd_bc), pointer :: particles(:) => null() !Boundary condition for the charge state density equation (density if ID = 1), on various grid subsets + type(ids_numerics_bc_ggd_bc), pointer :: energy(:) => null() !Boundary condition for the charge state energy equation (temperature if ID = 1), on various grid subsets + end type + + type :: ids_numerics_bc_ggd_ion + real(ids_real) :: a=ids_real_invalid !Mass of atom + real(ids_real) :: a_error_upper=ids_real_invalid !Upper error for "a" + real(ids_real) :: a_error_lower=ids_real_invalid !Lower error for "a" + integer(ids_int) :: a_error_index=ids_int_invalid !Index in the error_description list for "a" + real(ids_real) :: z_ion=ids_real_invalid !Ion charge (of the dominant ionisation state; lumped ions are allowed) + real(ids_real) :: z_ion_error_upper=ids_real_invalid !Upper error for "z_ion" + real(ids_real) :: z_ion_error_lower=ids_real_invalid !Lower error for "z_ion" + integer(ids_int) :: z_ion_error_index=ids_int_invalid !Index in the error_description list for "z_ion" + real(ids_real) :: z_n=ids_real_invalid !Nuclear charge + real(ids_real) :: z_n_error_upper=ids_real_invalid !Upper error for "z_n" + real(ids_real) :: z_n_error_lower=ids_real_invalid !Lower error for "z_n" + integer(ids_int) :: z_n_error_index=ids_int_invalid !Index in the error_description list for "z_n" + character(len=ids_string_length), dimension(:), pointer :: label => null() !String identifying ion (e.g. H+, D+, T+, He+2, C+, ...) + type(ids_numerics_bc_ggd_bc), pointer :: particles(:) => null() !Boundary condition for the ion density equation (density if ID = 1), on various grid subsets + type(ids_numerics_bc_ggd_bc), pointer :: energy(:) => null() !Boundary condition for the ion energy equation (temperature if ID = 1), on various grid subsets + integer(ids_int) :: multiple_states_flag=ids_int_invalid !Multiple states calculation flag : 0-Only one state is considered; 1-Multiple states are considered and are described in the state! + ! structure + type(ids_numerics_bc_ggd_ion_charge_state), pointer :: state(:) => null() !Quantities related to the different states of the species (ionisation, energy, excitation, ...) + end type + + type :: ids_numerics_bc_ggd + type(ids_generic_grid_dynamic) :: grid !Grid description + type(ids_numerics_bc_ggd_current), pointer :: current(:) => null() !Boundary condition for the current diffusion equation, on various grid subsets + type(ids_numerics_bc_ggd_electrons) :: electrons !Quantities related to the electrons + type(ids_numerics_bc_ggd_ion), pointer :: ion(:) => null() !Quantities related to the different ion species + real(ids_real) :: time=ids_real_invalid !Time + end type + + type :: ids_numerics_convergence_equations_electrons + type(ids_numerics_convergence_equations_single) :: particles !Convergence details of the electron density equation + type(ids_numerics_convergence_equations_single) :: energy !Convergence details of the electron energy equation + end type + + type :: ids_numerics_convergence_equations_ion_charge_state + real(ids_real) :: z_min=ids_real_invalid !Minimum Z of the charge state bundle + real(ids_real) :: z_min_error_upper=ids_real_invalid !Upper error for "z_min" + real(ids_real) :: z_min_error_lower=ids_real_invalid !Lower error for "z_min" + integer(ids_int) :: z_min_error_index=ids_int_invalid !Index in the error_description list for "z_min" + real(ids_real) :: z_max=ids_real_invalid !Maximum Z of the charge state bundle + real(ids_real) :: z_max_error_upper=ids_real_invalid !Upper error for "z_max" + real(ids_real) :: z_max_error_lower=ids_real_invalid !Lower error for "z_max" + integer(ids_int) :: z_max_error_index=ids_int_invalid !Index in the error_description list for "z_max" + character(len=ids_string_length), dimension(:), pointer :: label => null() !String identifying charge state (e.g. C+, C+2 , C+3, C+4, C+5, C+6, ...) + real(ids_real) :: vibrational_level=ids_real_invalid !Vibrational level (can be bundled) + real(ids_real) :: vibrational_level_error_upper=ids_real_invalid !Upper error for "vibrational_level" + real(ids_real) :: vibrational_level_error_lower=ids_real_invalid !Lower error for "vibrational_level" + integer(ids_int) :: vibrational_level_error_index=ids_int_invalid !Index in the error_description list for "vibrational_level" + character(len=ids_string_length), dimension(:), pointer :: vibrational_mode => null() !Vibrational mode of this state, e.g. "A_g". Need to define, or adopt a standard nomenclature. + integer(ids_int) :: is_neutral=ids_int_invalid !Flag specifying if this state corresponds to a neutral (1) or not (0) + type(ids_identifier_dynamic_aos3) :: neutral_type !Neutral type (if the considered state is a neutral), in terms of energy. ID =1: cold; 2: thermal; 3: fast; 4: NBI + character(len=ids_string_length), dimension(:), pointer :: electron_configuration => null() !Configuration of atomic orbitals of this state, e.g. 1s2-2s1 + type(ids_numerics_convergence_equations_single) :: particles !Convergence details of the charge state density equation + type(ids_numerics_convergence_equations_single) :: energy !Convergence details of the charge state energy equation + end type + + type :: ids_numerics_convergence_equations_ion + real(ids_real) :: a=ids_real_invalid !Mass of atom + real(ids_real) :: a_error_upper=ids_real_invalid !Upper error for "a" + real(ids_real) :: a_error_lower=ids_real_invalid !Lower error for "a" + integer(ids_int) :: a_error_index=ids_int_invalid !Index in the error_description list for "a" + real(ids_real) :: z_ion=ids_real_invalid !Ion charge (of the dominant ionisation state; lumped ions are allowed) + real(ids_real) :: z_ion_error_upper=ids_real_invalid !Upper error for "z_ion" + real(ids_real) :: z_ion_error_lower=ids_real_invalid !Lower error for "z_ion" + integer(ids_int) :: z_ion_error_index=ids_int_invalid !Index in the error_description list for "z_ion" + real(ids_real) :: z_n=ids_real_invalid !Nuclear charge + real(ids_real) :: z_n_error_upper=ids_real_invalid !Upper error for "z_n" + real(ids_real) :: z_n_error_lower=ids_real_invalid !Lower error for "z_n" + integer(ids_int) :: z_n_error_index=ids_int_invalid !Index in the error_description list for "z_n" + character(len=ids_string_length), dimension(:), pointer :: label => null() !String identifying ion (e.g. H+, D+, T+, He+2, C+, ...) + type(ids_numerics_convergence_equations_single) :: particles !Convergence details of the ion density equation + type(ids_numerics_convergence_equations_single) :: energy !Convergence details of the ion energy equation + integer(ids_int) :: multiple_states_flag=ids_int_invalid !Multiple state calculation flag : 0-Only one state is considered; 1-Multiple states are considered and are described in the state ! + !structure + type(ids_numerics_convergence_equations_ion_charge_state), pointer :: state(:) => null() !Convergence details of the related to the different states transport equations + end type + + type :: ids_numerics_convergence_equation + type(ids_numerics_convergence_equations_single) :: current !Convergence details of the current diffusion equation + type(ids_numerics_convergence_equations_electrons) :: electrons !Quantities related to the electrons + type(ids_numerics_convergence_equations_ion), pointer :: ion(:) => null() !Quantities related to the different ion species + type(ids_numerics_convergence_equations_single) :: energy_ion_total !Convergence details of the ion total (sum over ion species) energy equation + real(ids_real) :: time=ids_real_invalid !Time + end type + + type :: ids_numerics_convergence + type(ids_signal_flt_1d) :: time_step !Internal time step used by the transport solver (assuming all transport equations are solved with the same time step) + type(ids_numerics_convergence_equation), pointer :: equations(:) => null() !Convergence details of the transport equations, for various time slices + end type + + type :: ids_numerics_restart + character(len=ids_string_length), dimension(:), pointer :: names => null() !Names of the restart files + character(len=ids_string_length), dimension(:), pointer :: descriptions => null() !Descriptions of the restart files + real(ids_real) :: time=ids_real_invalid !Time + end type + + + ! *********** transport_solver_numerics IDS + type, extends(IDS_base) :: ids_transport_solver_numerics !Numerical quantities used by transport solvers and convergence details + logical, private :: c_data = .FALSE. ! Fortran specific metadata telling whether the IDS has been populated from C allocated data (LL) or not + integer, private :: max_occurrence = 6! Maximum occurrence allowed as defined in the DD + + type(ids_ids_properties) :: ids_properties !Interface Data Structure properties. This element identifies the node above as an IDS + type(ids_signal_flt_1d) :: time_step !Internal time step used by the transport solver (assuming all transport equations are solved with the same time step) + type(ids_signal_flt_1d) :: time_step_average !Average internal time step used by the transport solver between the previous and the current time stored for this quantity (assumi! + !ng all transport equations are solved with the same time step) + type(ids_signal_flt_1d) :: time_step_min !Minimum internal time step used by the transport solver between the previous and the current time stored for this quantity (assumi! + !ng all transport equations are solved with the same time step) + type(ids_identifier) :: solver !Solver identifier + type(ids_identifier) :: primary_coordinate !Primary coordinate system with which the transport equations are solved. For a 1D transport solver: index = 1 means rho_tor_norm; ! + !2 = rho_tor. + type(ids_numerics_solver_1d), pointer :: solver_1d(:) => null() !Numerics related to 1D radial solver, for various time slices. + type(ids_numerics_profiles_1d_derivatives), pointer :: derivatives_1d(:) => null() !Radial profiles derivatives for various time slices. To be removed when the solver_1d structure is finalized. + type(ids_numerics_bc_1d), pointer :: boundary_conditions_1d(:) => null() !Boundary conditions of the radial transport equations for various time slices. To be removed when the solver_1d structure is final! + !ized. + type(ids_numerics_bc_ggd), pointer :: boundary_conditions_ggd(:) => null() !Boundary conditions of the transport equations, provided on the GGD, for various time slices + type(ids_numerics_convergence) :: convergence !Convergence details To be removed when the solver_1d structure is finalized. + type(ids_b_tor_vacuum_1) :: vacuum_toroidal_field !Characteristics of the vacuum toroidal field (used in rho_tor definition and in the normalization of current densities) + type(ids_numerics_restart), pointer :: restart_files(:) => null() !Set of code-specific restart files for a given time slice. These files are managed by a physical application to ensure its restart! + ! during long simulations + type(ids_code) :: code !Generic decription of the code-specific parameters for the code that has produced this IDS + real(ids_real), pointer :: time(:) => null() !Generic time + end type + + ! *********** turbulence IDS internal structures declaration + + type :: ids_turbulence_profiles_2d_grid + real(ids_real), pointer :: dim1(:) => null() !First dimension values + real(ids_real), pointer :: dim1_error_upper(:) => null() !Upper error for "dim1" + real(ids_real), pointer :: dim1_error_lower(:) => null() !Lower error for "dim1" + integer(ids_int) :: dim1_error_index=ids_int_invalid !Index in the error_description list for "dim1" + real(ids_real), pointer :: dim2(:) => null() !Second dimension values + real(ids_real), pointer :: dim2_error_upper(:) => null() !Upper error for "dim2" + real(ids_real), pointer :: dim2_error_lower(:) => null() !Lower error for "dim2" + integer(ids_int) :: dim2_error_index=ids_int_invalid !Index in the error_description list for "dim2" + real(ids_real) :: time=ids_real_invalid !Time + end type + + type :: ids_turbulence_profiles_2d_electrons + real(ids_real), pointer :: temperature(:,:) => null() !Temperature + real(ids_real), pointer :: temperature_error_upper(:,:) => null() !Upper error for "temperature" + real(ids_real), pointer :: temperature_error_lower(:,:) => null() !Lower error for "temperature" + integer(ids_int) :: temperature_error_index=ids_int_invalid !Index in the error_description list for "temperature" + real(ids_real), pointer :: density(:,:) => null() !Density (thermal+non-thermal) + real(ids_real), pointer :: density_error_upper(:,:) => null() !Upper error for "density" + real(ids_real), pointer :: density_error_lower(:,:) => null() !Lower error for "density" + integer(ids_int) :: density_error_index=ids_int_invalid !Index in the error_description list for "density" + real(ids_real), pointer :: density_thermal(:,:) => null() !Density of thermal particles + real(ids_real), pointer :: density_thermal_error_upper(:,:) => null() !Upper error for "density_thermal" + real(ids_real), pointer :: density_thermal_error_lower(:,:) => null() !Lower error for "density_thermal" + integer(ids_int) :: density_thermal_error_index=ids_int_invalid !Index in the error_description list for "density_thermal" + end type + + type :: ids_turbulence_profiles_2d_ions + type(ids_plasma_composition_neutral_element), pointer :: element(:) => null() !List of elements forming the atom or molecule + real(ids_real) :: z_ion=ids_real_invalid !Ion charge (of the dominant ionisation state; lumped ions are allowed), volume averaged over plasma radius + real(ids_real) :: z_ion_error_upper=ids_real_invalid !Upper error for "z_ion" + real(ids_real) :: z_ion_error_lower=ids_real_invalid !Lower error for "z_ion" + integer(ids_int) :: z_ion_error_index=ids_int_invalid !Index in the error_description list for "z_ion" + character(len=ids_string_length), dimension(:), pointer :: label => null() !String identifying ion (e.g. H+, D+, T+, He+2, C+, ...) + integer(ids_int) :: neutral_index=ids_int_invalid !Index of the corresponding neutral species in the ../../neutral array + real(ids_real), pointer :: temperature(:,:) => null() !Temperature (average over charge states when multiple charge states are considered) + real(ids_real), pointer :: temperature_error_upper(:,:) => null() !Upper error for "temperature" + real(ids_real), pointer :: temperature_error_lower(:,:) => null() !Lower error for "temperature" + integer(ids_int) :: temperature_error_index=ids_int_invalid !Index in the error_description list for "temperature" + real(ids_real), pointer :: density(:,:) => null() !Density (thermal+non-thermal) (sum over charge states when multiple charge states are considered) + real(ids_real), pointer :: density_error_upper(:,:) => null() !Upper error for "density" + real(ids_real), pointer :: density_error_lower(:,:) => null() !Lower error for "density" + integer(ids_int) :: density_error_index=ids_int_invalid !Index in the error_description list for "density" + real(ids_real), pointer :: density_thermal(:,:) => null() !Density (thermal) (sum over charge states when multiple charge states are considered) + real(ids_real), pointer :: density_thermal_error_upper(:,:) => null() !Upper error for "density_thermal" + real(ids_real), pointer :: density_thermal_error_lower(:,:) => null() !Lower error for "density_thermal" + integer(ids_int) :: density_thermal_error_index=ids_int_invalid !Index in the error_description list for "density_thermal" + end type + + type :: ids_turbulence_profiles_2d_neutral + type(ids_plasma_composition_neutral_element), pointer :: element(:) => null() !List of elements forming the atom or molecule + character(len=ids_string_length), dimension(:), pointer :: label => null() !String identifying ion (e.g. H+, D+, T+, He+2, C+, ...) + integer(ids_int) :: ion_index=ids_int_invalid !Index of the corresponding ion species in the ../../ion array + real(ids_real), pointer :: temperature(:,:) => null() !Temperature (average over charge states when multiple charge states are considered) + real(ids_real), pointer :: temperature_error_upper(:,:) => null() !Upper error for "temperature" + real(ids_real), pointer :: temperature_error_lower(:,:) => null() !Lower error for "temperature" + integer(ids_int) :: temperature_error_index=ids_int_invalid !Index in the error_description list for "temperature" + real(ids_real), pointer :: density(:,:) => null() !Density (thermal+non-thermal) (sum over charge states when multiple charge states are considered) + real(ids_real), pointer :: density_error_upper(:,:) => null() !Upper error for "density" + real(ids_real), pointer :: density_error_lower(:,:) => null() !Lower error for "density" + integer(ids_int) :: density_error_index=ids_int_invalid !Index in the error_description list for "density" + real(ids_real), pointer :: density_thermal(:,:) => null() !Density (thermal) (sum over charge states when multiple charge states are considered) + real(ids_real), pointer :: density_thermal_error_upper(:,:) => null() !Upper error for "density_thermal" + real(ids_real), pointer :: density_thermal_error_lower(:,:) => null() !Lower error for "density_thermal" + integer(ids_int) :: density_thermal_error_index=ids_int_invalid !Index in the error_description list for "density_thermal" + end type + + type :: ids_turbulence_profiles_2d + type(ids_turbulence_profiles_2d_electrons) :: electrons !Quantities related to electrons + type(ids_turbulence_profiles_2d_ions), pointer :: ion(:) => null() !Quantities related to the various ion species + type(ids_turbulence_profiles_2d_neutral), pointer :: neutral(:) => null() !Quantities related to the various neutral species + real(ids_real) :: time=ids_real_invalid !Time + end type + + + ! *********** turbulence IDS + type, extends(IDS_base) :: ids_turbulence !Description of plasma turbulence + logical, private :: c_data = .FALSE. ! Fortran specific metadata telling whether the IDS has been populated from C allocated data (LL) or not + integer, private :: max_occurrence = 2! Maximum occurrence allowed as defined in the DD + + type(ids_ids_properties) :: ids_properties !Interface Data Structure properties. This element identifies the node above as an IDS + type(ids_identifier) :: grid_2d_type !Selection of one of a set of grid types for grid_2d + type(ids_turbulence_profiles_2d_grid), pointer :: grid_2d(:) => null() !Values for the 2D grid, for various time slices. The timebase of this array of structure must be a subset of the profiles_2d timeb! + !ase + type(ids_turbulence_profiles_2d), pointer :: profiles_2d(:) => null() !Fluctuating physical quantities for various time slices + type(ids_code) :: code !Generic decription of the code-specific parameters for the code that has produced this IDS + real(ids_real), pointer :: time(:) => null() !Generic time + end type + + ! *********** wall IDS internal structures declaration + + type :: ids_wall_global_quantitites_electrons + real(ids_real), pointer :: pumping_speed(:) => null() !Pumped particle flux (in equivalent electrons) + real(ids_real), pointer :: pumping_speed_error_upper(:) => null() !Upper error for "pumping_speed" + real(ids_real), pointer :: pumping_speed_error_lower(:) => null() !Lower error for "pumping_speed" + integer(ids_int) :: pumping_speed_error_index=ids_int_invalid !Index in the error_description list for "pumping_speed" + real(ids_real), pointer :: particle_flux_from_plasma(:) => null() !Particle flux from the plasma (in equivalent electrons) + real(ids_real), pointer :: particle_flux_from_plasma_error_upper(:) => null() !Upper error for "particle_flux_from_plasma" + real(ids_real), pointer :: particle_flux_from_plasma_error_lower(:) => null() !Lower error for "particle_flux_from_plasma" + integer(ids_int) :: particle_flux_from_plasma_error_index=ids_int_invalid !Index in the error_description list for "particle_flux_from_plasma" + real(ids_real), pointer :: particle_flux_from_wall(:,:) => null() !Particle flux from the wall corresponding to the conversion into various neutral types (first dimension: 1: cold; 2: thermal; 3: f! + !ast), in equivalent electrons + real(ids_real), pointer :: particle_flux_from_wall_error_upper(:,:) => null() !Upper error for "particle_flux_from_wall" + real(ids_real), pointer :: particle_flux_from_wall_error_lower(:,:) => null() !Lower error for "particle_flux_from_wall" + integer(ids_int) :: particle_flux_from_wall_error_index=ids_int_invalid !Index in the error_description list for "particle_flux_from_wall" + real(ids_real), pointer :: gas_puff(:) => null() !Gas puff rate (in equivalent electrons) + real(ids_real), pointer :: gas_puff_error_upper(:) => null() !Upper error for "gas_puff" + real(ids_real), pointer :: gas_puff_error_lower(:) => null() !Lower error for "gas_puff" + integer(ids_int) :: gas_puff_error_index=ids_int_invalid !Index in the error_description list for "gas_puff" + real(ids_real), pointer :: power_inner_target(:) => null() !Electron power on the inner target + real(ids_real), pointer :: power_inner_target_error_upper(:) => null() !Upper error for "power_inner_target" + real(ids_real), pointer :: power_inner_target_error_lower(:) => null() !Lower error for "power_inner_target" + integer(ids_int) :: power_inner_target_error_index=ids_int_invalid !Index in the error_description list for "power_inner_target" + real(ids_real), pointer :: power_outer_target(:) => null() !Electron power on the inner target + real(ids_real), pointer :: power_outer_target_error_upper(:) => null() !Upper error for "power_outer_target" + real(ids_real), pointer :: power_outer_target_error_lower(:) => null() !Lower error for "power_outer_target" + integer(ids_int) :: power_outer_target_error_index=ids_int_invalid !Index in the error_description list for "power_outer_target" + end type + + type :: ids_wall_global_quantitites_neutral_origin + type(ids_plasma_composition_neutral_element_constant), pointer :: element(:) => null() !List of elements forming the atom or molecule of the incident species + character(len=ids_string_length), dimension(:), pointer :: label => null() !String identifying the incident species (e.g. H, D, CD4, ...) + real(ids_real), pointer :: energies(:) => null() !Array of energies of this incident species, on which the sputtering_physical_coefficient is tabulated + real(ids_real), pointer :: energies_error_upper(:) => null() !Upper error for "energies" + real(ids_real), pointer :: energies_error_lower(:) => null() !Lower error for "energies" + integer(ids_int) :: energies_error_index=ids_int_invalid !Index in the error_description list for "energies" + real(ids_real), pointer :: sputtering_physical_coefficient(:,:,:) => null() !Effective coefficient of physical sputtering for various neutral types (first dimension: 1: cold; 2: thermal; 3: fast), due to thi! + !s incident species and for various energies (second dimension) + real(ids_real), pointer :: sputtering_physical_coefficient_error_upper(:,:,:) => null() !Upper error for "sputtering_physical_coefficient" + real(ids_real), pointer :: sputtering_physical_coefficient_error_lower(:,:,:) => null() !Lower error for "sputtering_physical_coefficient" + integer(ids_int) :: sputtering_physical_coefficient_error_index=ids_int_invalid !Index in the error_description list for "sputtering_physical_coefficient" + real(ids_real), pointer :: sputtering_chemical_coefficient(:,:) => null() !Effective coefficient of chemical sputtering for various neutral types (first dimension: 1: cold; 2: thermal; 3: fast), due to thi! + !s incident species + real(ids_real), pointer :: sputtering_chemical_coefficient_error_upper(:,:) => null() !Upper error for "sputtering_chemical_coefficient" + real(ids_real), pointer :: sputtering_chemical_coefficient_error_lower(:,:) => null() !Lower error for "sputtering_chemical_coefficient" + integer(ids_int) :: sputtering_chemical_coefficient_error_index=ids_int_invalid !Index in the error_description list for "sputtering_chemical_coefficient" + end type + + type :: ids_wall_global_quantitites_neutral + type(ids_plasma_composition_neutral_element_constant), pointer :: element(:) => null() !List of elements forming the atom or molecule + character(len=ids_string_length), dimension(:), pointer :: label => null() !String identifying the species (e.g. H, D, CD4, ...) + real(ids_real), pointer :: pumping_speed(:) => null() !Pumped particle flux for that species + real(ids_real), pointer :: pumping_speed_error_upper(:) => null() !Upper error for "pumping_speed" + real(ids_real), pointer :: pumping_speed_error_lower(:) => null() !Lower error for "pumping_speed" + integer(ids_int) :: pumping_speed_error_index=ids_int_invalid !Index in the error_description list for "pumping_speed" + real(ids_real), pointer :: particle_flux_from_plasma(:) => null() !Particle flux from the plasma for that species + real(ids_real), pointer :: particle_flux_from_plasma_error_upper(:) => null() !Upper error for "particle_flux_from_plasma" + real(ids_real), pointer :: particle_flux_from_plasma_error_lower(:) => null() !Lower error for "particle_flux_from_plasma" + integer(ids_int) :: particle_flux_from_plasma_error_index=ids_int_invalid !Index in the error_description list for "particle_flux_from_plasma" + real(ids_real), pointer :: particle_flux_from_wall(:,:) => null() !Particle flux from the wall corresponding to the conversion into various neutral types (first dimension: 1: cold; 2: thermal; 3: f! + !ast) + real(ids_real), pointer :: particle_flux_from_wall_error_upper(:,:) => null() !Upper error for "particle_flux_from_wall" + real(ids_real), pointer :: particle_flux_from_wall_error_lower(:,:) => null() !Lower error for "particle_flux_from_wall" + integer(ids_int) :: particle_flux_from_wall_error_index=ids_int_invalid !Index in the error_description list for "particle_flux_from_wall" + real(ids_real), pointer :: gas_puff(:) => null() !Gas puff rate for that species + real(ids_real), pointer :: gas_puff_error_upper(:) => null() !Upper error for "gas_puff" + real(ids_real), pointer :: gas_puff_error_lower(:) => null() !Lower error for "gas_puff" + integer(ids_int) :: gas_puff_error_index=ids_int_invalid !Index in the error_description list for "gas_puff" + real(ids_real), pointer :: wall_inventory(:) => null() !Wall inventory, i.e. cumulated exchange of neutral species between plasma and wall from t = 0, positive if a species has gone to t! + !he wall, for that species + real(ids_real), pointer :: wall_inventory_error_upper(:) => null() !Upper error for "wall_inventory" + real(ids_real), pointer :: wall_inventory_error_lower(:) => null() !Lower error for "wall_inventory" + integer(ids_int) :: wall_inventory_error_index=ids_int_invalid !Index in the error_description list for "wall_inventory" + real(ids_real), pointer :: recycling_particles_coefficient(:,:) => null() !Particle recycling coefficient corresponding to the conversion into various neutral types (first dimension: 1: cold; 2: thermal; 3! + !: fast) + real(ids_real), pointer :: recycling_particles_coefficient_error_upper(:,:) => null() !Upper error for "recycling_particles_coefficient" + real(ids_real), pointer :: recycling_particles_coefficient_error_lower(:,:) => null() !Lower error for "recycling_particles_coefficient" + integer(ids_int) :: recycling_particles_coefficient_error_index=ids_int_invalid !Index in the error_description list for "recycling_particles_coefficient" + real(ids_real), pointer :: recycling_energy_coefficient(:,:) => null() !Energy recycling coefficient corresponding to the conversion into various neutral types (first dimension: 1: cold; 2: thermal; 3: ! + !fast) + real(ids_real), pointer :: recycling_energy_coefficient_error_upper(:,:) => null() !Upper error for "recycling_energy_coefficient" + real(ids_real), pointer :: recycling_energy_coefficient_error_lower(:,:) => null() !Lower error for "recycling_energy_coefficient" + integer(ids_int) :: recycling_energy_coefficient_error_index=ids_int_invalid !Index in the error_description list for "recycling_energy_coefficient" + type(ids_wall_global_quantitites_neutral_origin), pointer :: incident_species(:) => null() !Sputtering coefficients due to a set of incident species + end type + + type :: ids_wall_global_quantitites + type(ids_wall_global_quantitites_electrons) :: electrons !Quantities related to electrons + type(ids_wall_global_quantitites_neutral), pointer :: neutral(:) => null() !Quantities related to the various neutral species + real(ids_real), pointer :: temperature(:) => null() !Wall temperature + real(ids_real), pointer :: temperature_error_upper(:) => null() !Upper error for "temperature" + real(ids_real), pointer :: temperature_error_lower(:) => null() !Lower error for "temperature" + integer(ids_int) :: temperature_error_index=ids_int_invalid !Index in the error_description list for "temperature" + real(ids_real), pointer :: power_incident(:) => null() !Total power incident on the wall. This power is split in the various physical categories listed below + real(ids_real), pointer :: power_incident_error_upper(:) => null() !Upper error for "power_incident" + real(ids_real), pointer :: power_incident_error_lower(:) => null() !Lower error for "power_incident" + integer(ids_int) :: power_incident_error_index=ids_int_invalid !Index in the error_description list for "power_incident" + real(ids_real), pointer :: power_conducted(:) => null() !Power conducted by the plasma onto the wall + real(ids_real), pointer :: power_conducted_error_upper(:) => null() !Upper error for "power_conducted" + real(ids_real), pointer :: power_conducted_error_lower(:) => null() !Lower error for "power_conducted" + integer(ids_int) :: power_conducted_error_index=ids_int_invalid !Index in the error_description list for "power_conducted" + real(ids_real), pointer :: power_convected(:) => null() !Power convected by the plasma onto the wall + real(ids_real), pointer :: power_convected_error_upper(:) => null() !Upper error for "power_convected" + real(ids_real), pointer :: power_convected_error_lower(:) => null() !Lower error for "power_convected" + integer(ids_int) :: power_convected_error_index=ids_int_invalid !Index in the error_description list for "power_convected" + real(ids_real), pointer :: power_radiated(:) => null() !Net radiated power from plasma onto the wall (incident-reflected) + real(ids_real), pointer :: power_radiated_error_upper(:) => null() !Upper error for "power_radiated" + real(ids_real), pointer :: power_radiated_error_lower(:) => null() !Lower error for "power_radiated" + integer(ids_int) :: power_radiated_error_index=ids_int_invalid !Index in the error_description list for "power_radiated" + real(ids_real), pointer :: power_black_body(:) => null() !Black body radiated power emitted from the wall (emissivity is included) + real(ids_real), pointer :: power_black_body_error_upper(:) => null() !Upper error for "power_black_body" + real(ids_real), pointer :: power_black_body_error_lower(:) => null() !Lower error for "power_black_body" + integer(ids_int) :: power_black_body_error_index=ids_int_invalid !Index in the error_description list for "power_black_body" + real(ids_real), pointer :: power_neutrals(:) => null() !Net power from neutrals on the wall (positive means power is deposited on the wall) + real(ids_real), pointer :: power_neutrals_error_upper(:) => null() !Upper error for "power_neutrals" + real(ids_real), pointer :: power_neutrals_error_lower(:) => null() !Lower error for "power_neutrals" + integer(ids_int) :: power_neutrals_error_index=ids_int_invalid !Index in the error_description list for "power_neutrals" + real(ids_real), pointer :: power_recombination_plasma(:) => null() !Power deposited on the wall due to recombination of plasma ions + real(ids_real), pointer :: power_recombination_plasma_error_upper(:) => null() !Upper error for "power_recombination_plasma" + real(ids_real), pointer :: power_recombination_plasma_error_lower(:) => null() !Lower error for "power_recombination_plasma" + integer(ids_int) :: power_recombination_plasma_error_index=ids_int_invalid !Index in the error_description list for "power_recombination_plasma" + real(ids_real), pointer :: power_recombination_neutrals(:) => null() !Power deposited on the wall due to recombination of neutrals into a ground state (e.g. molecules) + real(ids_real), pointer :: power_recombination_neutrals_error_upper(:) => null() !Upper error for "power_recombination_neutrals" + real(ids_real), pointer :: power_recombination_neutrals_error_lower(:) => null() !Lower error for "power_recombination_neutrals" + integer(ids_int) :: power_recombination_neutrals_error_index=ids_int_invalid !Index in the error_description list for "power_recombination_neutrals" + real(ids_real), pointer :: power_currents(:) => null() !Power deposited on the wall due to electric currents (positive means power is deposited on the target) + real(ids_real), pointer :: power_currents_error_upper(:) => null() !Upper error for "power_currents" + real(ids_real), pointer :: power_currents_error_lower(:) => null() !Lower error for "power_currents" + integer(ids_int) :: power_currents_error_index=ids_int_invalid !Index in the error_description list for "power_currents" + real(ids_real), pointer :: power_to_cooling(:) => null() !Power to cooling systems + real(ids_real), pointer :: power_to_cooling_error_upper(:) => null() !Upper error for "power_to_cooling" + real(ids_real), pointer :: power_to_cooling_error_lower(:) => null() !Lower error for "power_to_cooling" + integer(ids_int) :: power_to_cooling_error_index=ids_int_invalid !Index in the error_description list for "power_to_cooling" + real(ids_real), pointer :: power_inner_target_ion_total(:) => null() !Total ion (summed over ion species) power on the inner target + real(ids_real), pointer :: power_inner_target_ion_total_error_upper(:) => null() !Upper error for "power_inner_target_ion_total" + real(ids_real), pointer :: power_inner_target_ion_total_error_lower(:) => null() !Lower error for "power_inner_target_ion_total" + integer(ids_int) :: power_inner_target_ion_total_error_index=ids_int_invalid !Index in the error_description list for "power_inner_target_ion_total" + real(ids_real), pointer :: power_density_inner_target_max(:) => null() !Maximum power density on the inner target + real(ids_real), pointer :: power_density_inner_target_max_error_upper(:) => null() !Upper error for "power_density_inner_target_max" + real(ids_real), pointer :: power_density_inner_target_max_error_lower(:) => null() !Lower error for "power_density_inner_target_max" + integer(ids_int) :: power_density_inner_target_max_error_index=ids_int_invalid !Index in the error_description list for "power_density_inner_target_max" + real(ids_real), pointer :: power_density_outer_target_max(:) => null() !Maximum power density on the outer target + real(ids_real), pointer :: power_density_outer_target_max_error_upper(:) => null() !Upper error for "power_density_outer_target_max" + real(ids_real), pointer :: power_density_outer_target_max_error_lower(:) => null() !Lower error for "power_density_outer_target_max" + integer(ids_int) :: power_density_outer_target_max_error_index=ids_int_invalid !Index in the error_description list for "power_density_outer_target_max" + real(ids_real), pointer :: current_tor(:) => null() !Toroidal current flowing in the vacuum vessel + real(ids_real), pointer :: current_tor_error_upper(:) => null() !Upper error for "current_tor" + real(ids_real), pointer :: current_tor_error_lower(:) => null() !Lower error for "current_tor" + integer(ids_int) :: current_tor_error_index=ids_int_invalid !Index in the error_description list for "current_tor" + end type + + type :: ids_wall_2d_limiter_unit + character(len=ids_string_length), dimension(:), pointer :: name => null() !Name of the limiter unit + integer(ids_int) :: closed=ids_int_invalid !Flag identifying whether the contour is closed (1) or open (0) + type(ids_rz1d_static) :: outline !Irregular outline of the limiting surface. Do NOT repeat the first point for closed contours + real(ids_real), pointer :: phi_extensions(:,:) => null() !Simplified description of toroidal angle extensions of the unit, by a list of zones defined by their centre and full width (in tor! + !oidal angle). In each of these zones, the unit outline remains the same. Leave this node empty for an axisymmetric unit. The firs! + !t dimension gives the centre and full width toroidal angle values for the unit. The second dimension represents the toroidal occur! + !rences of the unit countour (i.e. the number of toroidal zones). + real(ids_real), pointer :: phi_extensions_error_upper(:,:) => null() !Upper error for "phi_extensions" + real(ids_real), pointer :: phi_extensions_error_lower(:,:) => null() !Lower error for "phi_extensions" + integer(ids_int) :: phi_extensions_error_index=ids_int_invalid !Index in the error_description list for "phi_extensions" + real(ids_real) :: resistivity=ids_real_invalid !Resistivity of the limiter unit + real(ids_real) :: resistivity_error_upper=ids_real_invalid !Upper error for "resistivity" + real(ids_real) :: resistivity_error_lower=ids_real_invalid !Lower error for "resistivity" + integer(ids_int) :: resistivity_error_index=ids_int_invalid !Index in the error_description list for "resistivity" + end type + + type :: ids_wall_2d_limiter + type(ids_identifier_static) :: type !Type of the limiter description. index = 0 for the official single contour limiter and 1 for the official disjoint PFC structure l! + !ike first wall. Additional representations needed on a code-by-code basis follow same incremental pair tagging starting on index =! + !2 + type(ids_wall_2d_limiter_unit), pointer :: unit(:) => null() !Set of limiter units + end type + + type :: ids_wall_2d_mobile_unit + character(len=ids_string_length), dimension(:), pointer :: name => null() !Name of the mobile unit + integer(ids_int) :: closed=ids_int_invalid !Flag identifying whether the contour is closed (1) or open (0) + type(ids_rz1d_dynamic_aos_time), pointer :: outline(:) => null() !Irregular outline of the mobile unit, for a set of time slices. Do NOT repeat the first point for closed contours + real(ids_real), pointer :: phi_extensions(:,:) => null() !Simplified description of toroidal angle extensions of the unit, by a list of zones defined by their centre and full width (in tor! + !oidal angle). In each of these zones, the unit outline remains the same. Leave this node empty for an axisymmetric unit. The firs! + !t dimension gives the centre and full width toroidal angle values for the unit. The second dimension represents the toroidal occur! + !rences of the unit countour (i.e. the number of toroidal zones). + real(ids_real), pointer :: phi_extensions_error_upper(:,:) => null() !Upper error for "phi_extensions" + real(ids_real), pointer :: phi_extensions_error_lower(:,:) => null() !Lower error for "phi_extensions" + integer(ids_int) :: phi_extensions_error_index=ids_int_invalid !Index in the error_description list for "phi_extensions" + real(ids_real) :: resistivity=ids_real_invalid !Resistivity of the mobile unit + real(ids_real) :: resistivity_error_upper=ids_real_invalid !Upper error for "resistivity" + real(ids_real) :: resistivity_error_lower=ids_real_invalid !Lower error for "resistivity" + integer(ids_int) :: resistivity_error_index=ids_int_invalid !Index in the error_description list for "resistivity" + end type + + type :: ids_wall_2d_mobile + type(ids_identifier_static) :: type !Type of the description + type(ids_wall_2d_mobile_unit), pointer :: unit(:) => null() !Set of mobile units + end type + + type :: ids_wall_2d + type(ids_identifier_static) :: type !Type of the description. index = 0 for equilibrium codes (single closed limiter and vessel); 1 for gas-tight walls (disjoint PFCs ! + !with inner vessel as last limiter_unit; no vessel structure); 2 for free boundary codes (disjoint PFCs and vessel) + type(ids_wall_2d_limiter) :: limiter !Description of the immobile limiting surface(s) or plasma facing components for defining the Last Closed Flux Surface. + type(ids_wall_2d_mobile) :: mobile !In case of mobile plasma facing components, use the time-dependent description below this node to provide the full outline of the ! + !closest PFC surfaces to the plasma. Even in such a case, the 'limiter' structure is still used to provide the outermost limiting s! + !urface (can be used e.g. to define the boundary of the mesh of equilibrium reconstruction codes) + type(ids_vessel_2d) :: vessel !Mechanical structure of the vacuum vessel. The vessel is described as a set of nested layers with given physics properties; Two re! + !presentations are admitted for each vessel unit : annular (two contours) or block elements. + end type + + type :: ids_wall_description_ggd_material + type(ids_generic_grid_identifier), pointer :: grid_subset(:) => null() !Material is described for various wall components (grid subsets), using the identifier convention below + real(ids_real) :: time=ids_real_invalid !Time + end type + + type :: ids_wall_description_ggd_recycling_ion_state + real(ids_real) :: z_min=ids_real_invalid !Minimum Z of the charge state bundle + real(ids_real) :: z_min_error_upper=ids_real_invalid !Upper error for "z_min" + real(ids_real) :: z_min_error_lower=ids_real_invalid !Lower error for "z_min" + integer(ids_int) :: z_min_error_index=ids_int_invalid !Index in the error_description list for "z_min" + real(ids_real) :: z_max=ids_real_invalid !Maximum Z of the charge state bundle + real(ids_real) :: z_max_error_upper=ids_real_invalid !Upper error for "z_max" + real(ids_real) :: z_max_error_lower=ids_real_invalid !Lower error for "z_max" + integer(ids_int) :: z_max_error_index=ids_int_invalid !Index in the error_description list for "z_max" + character(len=ids_string_length), dimension(:), pointer :: label => null() !String identifying charge state (e.g. C+, C+2 , C+3, C+4, C+5, C+6, ...) + real(ids_real) :: vibrational_level=ids_real_invalid !Vibrational level (can be bundled) + real(ids_real) :: vibrational_level_error_upper=ids_real_invalid !Upper error for "vibrational_level" + real(ids_real) :: vibrational_level_error_lower=ids_real_invalid !Lower error for "vibrational_level" + integer(ids_int) :: vibrational_level_error_index=ids_int_invalid !Index in the error_description list for "vibrational_level" + character(len=ids_string_length), dimension(:), pointer :: vibrational_mode => null() !Vibrational mode of this state, e.g. "A_g". Need to define, or adopt a standard nomenclature. + character(len=ids_string_length), dimension(:), pointer :: electron_configuration => null() !Configuration of atomic orbitals of this state, e.g. 1s2-2s1 + type(ids_generic_grid_scalar), pointer :: coefficient(:) => null() !Recycling coefficient for various wall components (grid subsets) + end type + + type :: ids_wall_description_ggd_recycling_ion + type(ids_plasma_composition_neutral_element), pointer :: element(:) => null() !List of elements forming the atom or molecule + real(ids_real) :: z_ion=ids_real_invalid !Ion charge (of the dominant ionisation state; lumped ions are allowed) + real(ids_real) :: z_ion_error_upper=ids_real_invalid !Upper error for "z_ion" + real(ids_real) :: z_ion_error_lower=ids_real_invalid !Lower error for "z_ion" + integer(ids_int) :: z_ion_error_index=ids_int_invalid !Index in the error_description list for "z_ion" + character(len=ids_string_length), dimension(:), pointer :: label => null() !String identifying ion (e.g. H, D, T, He, C, D2, ...) + integer(ids_int) :: neutral_index=ids_int_invalid !Index of the corresponding neutral species in the ../../neutral array + type(ids_generic_grid_scalar), pointer :: coefficient(:) => null() !Recycling coefficient for various wall components (grid subsets) + integer(ids_int) :: multiple_states_flag=ids_int_invalid !Multiple states calculation flag : 0-Only the 'ion' level is considered and the 'state' array of structure is empty; 1-Ion states ! + !are considered and are described in the 'state' array of structure + type(ids_wall_description_ggd_recycling_ion_state), pointer :: state(:) => null() !Fluxes related to the different states of the species + end type + + type :: ids_wall_description_ggd_recycling_neutral_state + character(len=ids_string_length), dimension(:), pointer :: label => null() !String identifying state + real(ids_real) :: vibrational_level=ids_real_invalid !Vibrational level (can be bundled) + real(ids_real) :: vibrational_level_error_upper=ids_real_invalid !Upper error for "vibrational_level" + real(ids_real) :: vibrational_level_error_lower=ids_real_invalid !Lower error for "vibrational_level" + integer(ids_int) :: vibrational_level_error_index=ids_int_invalid !Index in the error_description list for "vibrational_level" + character(len=ids_string_length), dimension(:), pointer :: vibrational_mode => null() !Vibrational mode of this state, e.g. "A_g". Need to define, or adopt a standard nomenclature. + type(ids_identifier_dynamic_aos3) :: neutral_type !Neutral type, in terms of energy. ID =1: cold; 2: thermal; 3: fast; 4: NBI + character(len=ids_string_length), dimension(:), pointer :: electron_configuration => null() !Configuration of atomic orbitals of this state, e.g. 1s2-2s1 + type(ids_generic_grid_scalar), pointer :: coefficient(:) => null() !Recycling coefficient for various wall components (grid subsets) + end type + + type :: ids_wall_description_ggd_recycling_neutral + type(ids_plasma_composition_neutral_element), pointer :: element(:) => null() !List of elements forming the atom or molecule + character(len=ids_string_length), dimension(:), pointer :: label => null() !String identifying neutral (e.g. H, D, T, He, C, ...) + integer(ids_int) :: ion_index=ids_int_invalid !Index of the corresponding ion species in the ../../ion array + type(ids_generic_grid_scalar), pointer :: coefficient(:) => null() !Recycling coefficient for various wall components (grid subsets) + integer(ids_int) :: multiple_states_flag=ids_int_invalid !Multiple states calculation flag : 0-Only one state is considered; 1-Multiple states are considered and are described in the state! + ! structure + type(ids_wall_description_ggd_recycling_neutral_state), pointer :: state(:) => null() !Fluxes related to the different states of the species + end type + + type :: ids_wall_description_ggd_recycling + type(ids_wall_description_ggd_recycling_ion), pointer :: ion(:) => null() !Recycling coefficients for the various ion species, in the sense of isonuclear or isomolecular sequences. Ionisation states (and o! + !ther types of states) must be differentiated at the state level below + type(ids_wall_description_ggd_recycling_neutral), pointer :: neutral(:) => null() !Recycling coefficients for the various neutral species + end type + + type :: ids_wall_description_ggd_particle_el + type(ids_generic_grid_scalar), pointer :: incident(:) => null() !Incident fluxes for various wall components (grid subsets) + type(ids_generic_grid_scalar), pointer :: emitted(:) => null() !Emitted fluxes for various wall components (grid subsets) + end type + + type :: ids_wall_description_ggd_particle_ion_state + real(ids_real) :: z_min=ids_real_invalid !Minimum Z of the charge state bundle + real(ids_real) :: z_min_error_upper=ids_real_invalid !Upper error for "z_min" + real(ids_real) :: z_min_error_lower=ids_real_invalid !Lower error for "z_min" + integer(ids_int) :: z_min_error_index=ids_int_invalid !Index in the error_description list for "z_min" + real(ids_real) :: z_max=ids_real_invalid !Maximum Z of the charge state bundle + real(ids_real) :: z_max_error_upper=ids_real_invalid !Upper error for "z_max" + real(ids_real) :: z_max_error_lower=ids_real_invalid !Lower error for "z_max" + integer(ids_int) :: z_max_error_index=ids_int_invalid !Index in the error_description list for "z_max" + character(len=ids_string_length), dimension(:), pointer :: label => null() !String identifying charge state (e.g. C+, C+2 , C+3, C+4, C+5, C+6, ...) + real(ids_real) :: vibrational_level=ids_real_invalid !Vibrational level (can be bundled) + real(ids_real) :: vibrational_level_error_upper=ids_real_invalid !Upper error for "vibrational_level" + real(ids_real) :: vibrational_level_error_lower=ids_real_invalid !Lower error for "vibrational_level" + integer(ids_int) :: vibrational_level_error_index=ids_int_invalid !Index in the error_description list for "vibrational_level" + character(len=ids_string_length), dimension(:), pointer :: vibrational_mode => null() !Vibrational mode of this state, e.g. "A_g". Need to define, or adopt a standard nomenclature. + character(len=ids_string_length), dimension(:), pointer :: electron_configuration => null() !Configuration of atomic orbitals of this state, e.g. 1s2-2s1 + type(ids_generic_grid_scalar), pointer :: incident(:) => null() !Incident fluxes for various wall components (grid subsets) + type(ids_generic_grid_scalar), pointer :: emitted(:) => null() !Emitted fluxes for various wall components (grid subsets) + end type + + type :: ids_wall_description_ggd_particle_ion + type(ids_plasma_composition_neutral_element), pointer :: element(:) => null() !List of elements forming the atom or molecule + real(ids_real) :: z_ion=ids_real_invalid !Ion charge (of the dominant ionisation state; lumped ions are allowed) + real(ids_real) :: z_ion_error_upper=ids_real_invalid !Upper error for "z_ion" + real(ids_real) :: z_ion_error_lower=ids_real_invalid !Lower error for "z_ion" + integer(ids_int) :: z_ion_error_index=ids_int_invalid !Index in the error_description list for "z_ion" + character(len=ids_string_length), dimension(:), pointer :: label => null() !String identifying ion (e.g. H, D, T, He, C, D2, ...) + integer(ids_int) :: neutral_index=ids_int_invalid !Index of the corresponding neutral species in the ../../neutral array + type(ids_generic_grid_scalar), pointer :: incident(:) => null() !Incident fluxes for various wall components (grid subsets) + type(ids_generic_grid_scalar), pointer :: emitted(:) => null() !Emitted fluxes for various wall components (grid subsets) + integer(ids_int) :: multiple_states_flag=ids_int_invalid !Multiple states calculation flag : 0-Only the 'ion' level is considered and the 'state' array of structure is empty; 1-Ion states ! + !are considered and are described in the 'state' array of structure + type(ids_wall_description_ggd_particle_ion_state), pointer :: state(:) => null() !Fluxes related to the different states of the species + end type + + type :: ids_wall_description_ggd_particle_neutral_state + character(len=ids_string_length), dimension(:), pointer :: label => null() !String identifying state + real(ids_real) :: vibrational_level=ids_real_invalid !Vibrational level (can be bundled) + real(ids_real) :: vibrational_level_error_upper=ids_real_invalid !Upper error for "vibrational_level" + real(ids_real) :: vibrational_level_error_lower=ids_real_invalid !Lower error for "vibrational_level" + integer(ids_int) :: vibrational_level_error_index=ids_int_invalid !Index in the error_description list for "vibrational_level" + character(len=ids_string_length), dimension(:), pointer :: vibrational_mode => null() !Vibrational mode of this state, e.g. "A_g". Need to define, or adopt a standard nomenclature. + type(ids_identifier_dynamic_aos3) :: neutral_type !Neutral type, in terms of energy. ID =1: cold; 2: thermal; 3: fast; 4: NBI + character(len=ids_string_length), dimension(:), pointer :: electron_configuration => null() !Configuration of atomic orbitals of this state, e.g. 1s2-2s1 + type(ids_generic_grid_scalar), pointer :: incident(:) => null() !Incident fluxes for various wall components (grid subsets) + type(ids_generic_grid_scalar), pointer :: emitted(:) => null() !Emitted fluxes for various wall components (grid subsets) + end type + + type :: ids_wall_description_ggd_particle_neutral + type(ids_plasma_composition_neutral_element), pointer :: element(:) => null() !List of elements forming the atom or molecule + character(len=ids_string_length), dimension(:), pointer :: label => null() !String identifying neutral (e.g. H, D, T, He, C, ...) + integer(ids_int) :: ion_index=ids_int_invalid !Index of the corresponding ion species in the ../../ion array + type(ids_generic_grid_scalar), pointer :: incident(:) => null() !Incident fluxes for various wall components (grid subsets) + type(ids_generic_grid_scalar), pointer :: emitted(:) => null() !Emitted fluxes for various wall components (grid subsets) + integer(ids_int) :: multiple_states_flag=ids_int_invalid !Multiple states calculation flag : 0-Only one state is considered; 1-Multiple states are considered and are described in the state! + ! structure + type(ids_wall_description_ggd_particle_neutral_state), pointer :: state(:) => null() !Fluxes related to the different states of the species + end type + + type :: ids_wall_description_ggd_particle + type(ids_wall_description_ggd_particle_el) :: electrons !Electron fluxes + type(ids_wall_description_ggd_particle_ion), pointer :: ion(:) => null() !Fluxes related to the various ion species, in the sense of isonuclear or isomolecular sequences. Ionisation states (and other type! + !s of states) must be differentiated at the state level below + type(ids_wall_description_ggd_particle_neutral), pointer :: neutral(:) => null() !Neutral species fluxes + end type + + type :: ids_wall_description_ggd_energy_simple + type(ids_generic_grid_scalar), pointer :: incident(:) => null() !Incident fluxes for various wall components (grid subsets) + type(ids_generic_grid_scalar), pointer :: emitted(:) => null() !Emitted fluxes for various wall components (grid subsets) + end type + + type :: ids_wall_description_ggd_energy_ion_state + real(ids_real) :: z_min=ids_real_invalid !Minimum Z of the charge state bundle + real(ids_real) :: z_min_error_upper=ids_real_invalid !Upper error for "z_min" + real(ids_real) :: z_min_error_lower=ids_real_invalid !Lower error for "z_min" + integer(ids_int) :: z_min_error_index=ids_int_invalid !Index in the error_description list for "z_min" + real(ids_real) :: z_max=ids_real_invalid !Maximum Z of the charge state bundle + real(ids_real) :: z_max_error_upper=ids_real_invalid !Upper error for "z_max" + real(ids_real) :: z_max_error_lower=ids_real_invalid !Lower error for "z_max" + integer(ids_int) :: z_max_error_index=ids_int_invalid !Index in the error_description list for "z_max" + character(len=ids_string_length), dimension(:), pointer :: label => null() !String identifying charge state (e.g. C+, C+2 , C+3, C+4, C+5, C+6, ...) + real(ids_real) :: vibrational_level=ids_real_invalid !Vibrational level (can be bundled) + real(ids_real) :: vibrational_level_error_upper=ids_real_invalid !Upper error for "vibrational_level" + real(ids_real) :: vibrational_level_error_lower=ids_real_invalid !Lower error for "vibrational_level" + integer(ids_int) :: vibrational_level_error_index=ids_int_invalid !Index in the error_description list for "vibrational_level" + character(len=ids_string_length), dimension(:), pointer :: vibrational_mode => null() !Vibrational mode of this state, e.g. "A_g". Need to define, or adopt a standard nomenclature. + character(len=ids_string_length), dimension(:), pointer :: electron_configuration => null() !Configuration of atomic orbitals of this state, e.g. 1s2-2s1 + type(ids_generic_grid_scalar), pointer :: incident(:) => null() !Incident fluxes for various wall components (grid subsets) + type(ids_generic_grid_scalar), pointer :: emitted(:) => null() !Emitted fluxes for various wall components (grid subsets) + end type + + type :: ids_wall_description_ggd_energy_ion + type(ids_plasma_composition_neutral_element), pointer :: element(:) => null() !List of elements forming the atom or molecule + real(ids_real) :: z_ion=ids_real_invalid !Ion charge (of the dominant ionisation state; lumped ions are allowed) + real(ids_real) :: z_ion_error_upper=ids_real_invalid !Upper error for "z_ion" + real(ids_real) :: z_ion_error_lower=ids_real_invalid !Lower error for "z_ion" + integer(ids_int) :: z_ion_error_index=ids_int_invalid !Index in the error_description list for "z_ion" + character(len=ids_string_length), dimension(:), pointer :: label => null() !String identifying ion (e.g. H, D, T, He, C, D2, ...) + integer(ids_int) :: neutral_index=ids_int_invalid !Index of the corresponding neutral species in the ../../neutral array + type(ids_generic_grid_scalar), pointer :: incident(:) => null() !Incident fluxes for various wall components (grid subsets) + type(ids_generic_grid_scalar), pointer :: emitted(:) => null() !Emitted fluxes for various wall components (grid subsets) + integer(ids_int) :: multiple_states_flag=ids_int_invalid !Multiple states calculation flag : 0-Only the 'ion' level is considered and the 'state' array of structure is empty; 1-Ion states ! + !are considered and are described in the 'state' array of structure + type(ids_wall_description_ggd_energy_ion_state), pointer :: state(:) => null() !Fluxes related to the different states of the species + end type + + type :: ids_wall_description_ggd_recombination + type(ids_wall_description_ggd_energy_ion), pointer :: ion(:) => null() !Fluxes related to the various ion species, in the sense of isonuclear or isomolecular sequences. Ionisation states (and other type! + !s of states) must be differentiated at the state level below + type(ids_wall_description_ggd_particle_neutral), pointer :: neutral(:) => null() !Neutral species fluxes + end type + + type :: ids_wall_description_ggd_kinetic + type(ids_wall_description_ggd_energy_simple) :: electrons !Electron fluxes. Fluxes are given at the wall, after the sheath. + type(ids_wall_description_ggd_energy_ion), pointer :: ion(:) => null() !Fluxes related to the various ion species, in the sense of isonuclear or isomolecular sequences. Ionisation states (and other type! + !s of states) must be differentiated at the state level below. Fluxes are given at the wall, after the sheath. + type(ids_wall_description_ggd_particle_neutral), pointer :: neutral(:) => null() !Neutral species fluxes + end type + + type :: ids_wall_description_ggd_energy + type(ids_wall_description_ggd_energy_simple) :: radiation !Total radiation, not split by process + type(ids_wall_description_ggd_energy_simple) :: current !Current energy fluxes + type(ids_wall_description_ggd_recombination) :: recombination !Wall recombination + type(ids_wall_description_ggd_kinetic) :: kinetic !Energy fluxes due to the kinetic energy of particles + end type + + type :: ids_wall_description_ggd_ggd + type(ids_generic_grid_scalar), pointer :: power_density(:) => null() !Net power density arriving on the wall surface, for various wall components (grid subsets) + type(ids_generic_grid_scalar), pointer :: temperature(:) => null() !Temperature of the wall, for various wall components (grid subsets) + type(ids_generic_grid_scalar), pointer :: v_biasing(:) => null() !Electric potential applied to the wall element by outside means, for various wall components (grid subsets). Different from the pl! + !asma electric potential or the sheath potential drop. + type(ids_wall_description_ggd_recycling) :: recycling !Fraction of incoming particles that is reflected back to the vacuum chamber + type(ids_wall_description_ggd_particle) :: particle_fluxes !Particle fluxes. The incident and emitted components are distinguished. The net flux received by the wall is equal to incident - e! + !mitted + type(ids_wall_description_ggd_energy) :: energy_fluxes !Energy fluxes. The incident and emitted components are distinguished. The net flux received by the wall is equal to incident - emi! + !tted + real(ids_real) :: time=ids_real_invalid !Time + end type + + type :: ids_wall_description_ggd + type(ids_identifier_static) :: type !Type of wall: index = 0 for gas tight and 1 for a wall with holes/open ports + type(ids_generic_grid_aos3_root), pointer :: grid_ggd(:) => null() !Wall geometry described using the Generic Grid Description, for various time slices (in case of mobile wall elements). The timebas! + !e of this array of structure must be a subset of the timebase on which physical quantities are described (../ggd structure). Grid_! + !subsets are used to describe various wall components in a modular way. + type(ids_wall_description_ggd_material), pointer :: material(:) => null() !Material of each grid_ggd object, given for each slice of the grid_ggd time base (the material is not supposed to change, but grid! + !_ggd may evolve with time) + type(ids_wall_description_ggd_ggd), pointer :: ggd(:) => null() !Wall physics quantities represented using the general grid description, for various time slices. + end type + + + ! *********** wall IDS + type, extends(IDS_base) :: ids_wall !Description of the torus wall and its interaction with the plasma + logical, private :: c_data = .FALSE. ! Fortran specific metadata telling whether the IDS has been populated from C allocated data (LL) or not + integer, private :: max_occurrence = 5! Maximum occurrence allowed as defined in the DD + + type(ids_ids_properties) :: ids_properties !Interface Data Structure properties. This element identifies the node above as an IDS + type(ids_temperature_reference) :: temperature_reference !Reference temperature for which the machine description data is given in this IDS + real(ids_real) :: first_wall_surface_area=ids_real_invalid !First wall surface area + real(ids_real) :: first_wall_surface_area_error_upper=ids_real_invalid !Upper error for "first_wall_surface_area" + real(ids_real) :: first_wall_surface_area_error_lower=ids_real_invalid !Lower error for "first_wall_surface_area" + integer(ids_int) :: first_wall_surface_area_error_index=ids_int_invalid !Index in the error_description list for "first_wall_surface_area" + type(ids_signal_flt_1d) :: first_wall_power_flux_peak !Peak power flux on the first wall + real(ids_real) :: first_wall_enclosed_volume=ids_real_invalid !Volume available to gas or plasma enclosed by the first wall contour + real(ids_real) :: first_wall_enclosed_volume_error_upper=ids_real_invalid !Upper error for "first_wall_enclosed_volume" + real(ids_real) :: first_wall_enclosed_volume_error_lower=ids_real_invalid !Lower error for "first_wall_enclosed_volume" + integer(ids_int) :: first_wall_enclosed_volume_error_index=ids_int_invalid !Index in the error_description list for "first_wall_enclosed_volume" + type(ids_wall_global_quantitites) :: global_quantities !Simple 0D description of plasma-wall interaction + type(ids_wall_2d), pointer :: description_2d(:) => null() !Set of 2D wall descriptions, for each type of possible physics or engineering configurations necessary (gas tight vs wall with por! + !ts and holes, coarse vs fine representation, single contour limiter, disjoint gapped plasma facing components, ...). A simplified ! + !description of the toroidal extension of the 2D contours is also provided by using the phi_extensions nodes. + type(ids_wall_description_ggd), pointer :: description_ggd(:) => null() !Set of 3D wall descriptions, described using the GGD, for each type of possible physics or engineering configurations necessary (g! + !as tight vs wall with ports and holes, coarse vs fine representation, ...). + type(ids_code) :: code !Generic decription of the code-specific parameters for the code that has produced this IDS + real(ids_real), pointer :: time(:) => null() !Generic time + end type + + ! *********** waves IDS internal structures declaration + + type :: ids_waves_coherent_wave_global_quantities_electrons + real(ids_real) :: power_thermal=ids_real_invalid !Wave power absorbed by the thermal particle population + real(ids_real) :: power_thermal_error_upper=ids_real_invalid !Upper error for "power_thermal" + real(ids_real) :: power_thermal_error_lower=ids_real_invalid !Lower error for "power_thermal" + integer(ids_int) :: power_thermal_error_index=ids_int_invalid !Index in the error_description list for "power_thermal" + real(ids_real), pointer :: power_thermal_n_tor(:) => null() !Wave power absorbed by the thermal particle population per toroidal mode number + real(ids_real), pointer :: power_thermal_n_tor_error_upper(:) => null() !Upper error for "power_thermal_n_tor" + real(ids_real), pointer :: power_thermal_n_tor_error_lower(:) => null() !Lower error for "power_thermal_n_tor" + integer(ids_int) :: power_thermal_n_tor_error_index=ids_int_invalid !Index in the error_description list for "power_thermal_n_tor" + real(ids_real) :: power_fast=ids_real_invalid !Wave power absorbed by the fast particle population + real(ids_real) :: power_fast_error_upper=ids_real_invalid !Upper error for "power_fast" + real(ids_real) :: power_fast_error_lower=ids_real_invalid !Lower error for "power_fast" + integer(ids_int) :: power_fast_error_index=ids_int_invalid !Index in the error_description list for "power_fast" + real(ids_real), pointer :: power_fast_n_tor(:) => null() !Wave power absorbed by the fast particle population per toroidal mode number + real(ids_real), pointer :: power_fast_n_tor_error_upper(:) => null() !Upper error for "power_fast_n_tor" + real(ids_real), pointer :: power_fast_n_tor_error_lower(:) => null() !Lower error for "power_fast_n_tor" + integer(ids_int) :: power_fast_n_tor_error_index=ids_int_invalid !Index in the error_description list for "power_fast_n_tor" + integer(ids_int) :: distribution_assumption=ids_int_invalid !Assumption on the distribution function used by the wave solver to calculate the power deposition on this species: 0 = Maxwellian ! + !(linear absorption); 1 = quasi-linear (F given by a distributions IDS). + end type + + type :: ids_waves_coherent_wave_global_quantities_ion_state + real(ids_real) :: z_min=ids_real_invalid !Minimum Z of the charge state bundle (z_min = z_max = 0 for a neutral) + real(ids_real) :: z_min_error_upper=ids_real_invalid !Upper error for "z_min" + real(ids_real) :: z_min_error_lower=ids_real_invalid !Lower error for "z_min" + integer(ids_int) :: z_min_error_index=ids_int_invalid !Index in the error_description list for "z_min" + real(ids_real) :: z_max=ids_real_invalid !Maximum Z of the charge state bundle (equal to z_min if no bundle) + real(ids_real) :: z_max_error_upper=ids_real_invalid !Upper error for "z_max" + real(ids_real) :: z_max_error_lower=ids_real_invalid !Lower error for "z_max" + integer(ids_int) :: z_max_error_index=ids_int_invalid !Index in the error_description list for "z_max" + character(len=ids_string_length), dimension(:), pointer :: label => null() !String identifying charge state (e.g. C+, C+2 , C+3, C+4, C+5, C+6, ...) + character(len=ids_string_length), dimension(:), pointer :: electron_configuration => null() !Configuration of atomic orbitals of this state, e.g. 1s2-2s1 + real(ids_real) :: vibrational_level=ids_real_invalid !Vibrational level (can be bundled) + real(ids_real) :: vibrational_level_error_upper=ids_real_invalid !Upper error for "vibrational_level" + real(ids_real) :: vibrational_level_error_lower=ids_real_invalid !Lower error for "vibrational_level" + integer(ids_int) :: vibrational_level_error_index=ids_int_invalid !Index in the error_description list for "vibrational_level" + character(len=ids_string_length), dimension(:), pointer :: vibrational_mode => null() !Vibrational mode of this state, e.g. "A_g". Need to define, or adopt a standard nomenclature. + real(ids_real) :: power_thermal=ids_real_invalid !Wave power absorbed by the thermal particle population + real(ids_real) :: power_thermal_error_upper=ids_real_invalid !Upper error for "power_thermal" + real(ids_real) :: power_thermal_error_lower=ids_real_invalid !Lower error for "power_thermal" + integer(ids_int) :: power_thermal_error_index=ids_int_invalid !Index in the error_description list for "power_thermal" + real(ids_real), pointer :: power_thermal_n_tor(:) => null() !Wave power absorbed by the thermal particle population per toroidal mode number + real(ids_real), pointer :: power_thermal_n_tor_error_upper(:) => null() !Upper error for "power_thermal_n_tor" + real(ids_real), pointer :: power_thermal_n_tor_error_lower(:) => null() !Lower error for "power_thermal_n_tor" + integer(ids_int) :: power_thermal_n_tor_error_index=ids_int_invalid !Index in the error_description list for "power_thermal_n_tor" + real(ids_real) :: power_fast=ids_real_invalid !Wave power absorbed by the fast particle population + real(ids_real) :: power_fast_error_upper=ids_real_invalid !Upper error for "power_fast" + real(ids_real) :: power_fast_error_lower=ids_real_invalid !Lower error for "power_fast" + integer(ids_int) :: power_fast_error_index=ids_int_invalid !Index in the error_description list for "power_fast" + real(ids_real), pointer :: power_fast_n_tor(:) => null() !Wave power absorbed by the fast particle population per toroidal mode number + real(ids_real), pointer :: power_fast_n_tor_error_upper(:) => null() !Upper error for "power_fast_n_tor" + real(ids_real), pointer :: power_fast_n_tor_error_lower(:) => null() !Lower error for "power_fast_n_tor" + integer(ids_int) :: power_fast_n_tor_error_index=ids_int_invalid !Index in the error_description list for "power_fast_n_tor" + end type + + type :: ids_waves_coherent_wave_global_quantities_ion + type(ids_plasma_composition_neutral_element), pointer :: element(:) => null() !List of elements forming the atom or molecule + real(ids_real) :: z_ion=ids_real_invalid !Ion charge (of the dominant ionisation state; lumped ions are allowed). + real(ids_real) :: z_ion_error_upper=ids_real_invalid !Upper error for "z_ion" + real(ids_real) :: z_ion_error_lower=ids_real_invalid !Lower error for "z_ion" + integer(ids_int) :: z_ion_error_index=ids_int_invalid !Index in the error_description list for "z_ion" + character(len=ids_string_length), dimension(:), pointer :: label => null() !String identifying the species (e.g. H+, D+, T+, He+2, C+, D2, DT, CD4, ...) + real(ids_real) :: power_thermal=ids_real_invalid !Wave power absorbed by the thermal particle population + real(ids_real) :: power_thermal_error_upper=ids_real_invalid !Upper error for "power_thermal" + real(ids_real) :: power_thermal_error_lower=ids_real_invalid !Lower error for "power_thermal" + integer(ids_int) :: power_thermal_error_index=ids_int_invalid !Index in the error_description list for "power_thermal" + real(ids_real), pointer :: power_thermal_n_tor(:) => null() !Wave power absorbed by the thermal particle population per toroidal mode number + real(ids_real), pointer :: power_thermal_n_tor_error_upper(:) => null() !Upper error for "power_thermal_n_tor" + real(ids_real), pointer :: power_thermal_n_tor_error_lower(:) => null() !Lower error for "power_thermal_n_tor" + integer(ids_int) :: power_thermal_n_tor_error_index=ids_int_invalid !Index in the error_description list for "power_thermal_n_tor" + real(ids_real) :: power_fast=ids_real_invalid !Wave power absorbed by the fast particle population + real(ids_real) :: power_fast_error_upper=ids_real_invalid !Upper error for "power_fast" + real(ids_real) :: power_fast_error_lower=ids_real_invalid !Lower error for "power_fast" + integer(ids_int) :: power_fast_error_index=ids_int_invalid !Index in the error_description list for "power_fast" + real(ids_real), pointer :: power_fast_n_tor(:) => null() !Wave power absorbed by the fast particle population per toroidal mode number + real(ids_real), pointer :: power_fast_n_tor_error_upper(:) => null() !Upper error for "power_fast_n_tor" + real(ids_real), pointer :: power_fast_n_tor_error_lower(:) => null() !Lower error for "power_fast_n_tor" + integer(ids_int) :: power_fast_n_tor_error_index=ids_int_invalid !Index in the error_description list for "power_fast_n_tor" + integer(ids_int) :: multiple_states_flag=ids_int_invalid !Multiple state calculation flag : 0-Only one state is considered; 1-Multiple states are considered and are described in the state ! + !structure + integer(ids_int) :: distribution_assumption=ids_int_invalid !Assumption on the distribution function used by the wave solver to calculate the power deposition on this species: 0 = Maxwellian ! + !(linear absorption); 1 = quasi-linear (F given by a distributions IDS). + type(ids_waves_coherent_wave_global_quantities_ion_state), pointer :: state(:) => null() !Collisional exchange with the various states of the ion species (ionisation, energy, excitation, ...) + end type + + type :: ids_waves_coherent_wave_global_quantities + real(ids_real) :: frequency=ids_real_invalid !Wave frequency + real(ids_real) :: frequency_error_upper=ids_real_invalid !Upper error for "frequency" + real(ids_real) :: frequency_error_lower=ids_real_invalid !Lower error for "frequency" + integer(ids_int) :: frequency_error_index=ids_int_invalid !Index in the error_description list for "frequency" + integer(ids_int), pointer :: n_tor(:) => null() !Toroidal mode numbers + real(ids_real) :: power=ids_real_invalid !Total absorbed wave power + real(ids_real) :: power_error_upper=ids_real_invalid !Upper error for "power" + real(ids_real) :: power_error_lower=ids_real_invalid !Lower error for "power" + integer(ids_int) :: power_error_index=ids_int_invalid !Index in the error_description list for "power" + real(ids_real), pointer :: power_n_tor(:) => null() !Absorbed wave power per toroidal mode number + real(ids_real), pointer :: power_n_tor_error_upper(:) => null() !Upper error for "power_n_tor" + real(ids_real), pointer :: power_n_tor_error_lower(:) => null() !Lower error for "power_n_tor" + integer(ids_int) :: power_n_tor_error_index=ids_int_invalid !Index in the error_description list for "power_n_tor" + real(ids_real) :: current_tor=ids_real_invalid !Wave driven toroidal current from a stand alone calculation (not consistent with other sources) + real(ids_real) :: current_tor_error_upper=ids_real_invalid !Upper error for "current_tor" + real(ids_real) :: current_tor_error_lower=ids_real_invalid !Lower error for "current_tor" + integer(ids_int) :: current_tor_error_index=ids_int_invalid !Index in the error_description list for "current_tor" + real(ids_real), pointer :: current_tor_n_tor(:) => null() !Wave driven toroidal current from a stand alone calculation (not consistent with other sources) per toroidal mode number + real(ids_real), pointer :: current_tor_n_tor_error_upper(:) => null() !Upper error for "current_tor_n_tor" + real(ids_real), pointer :: current_tor_n_tor_error_lower(:) => null() !Lower error for "current_tor_n_tor" + integer(ids_int) :: current_tor_n_tor_error_index=ids_int_invalid !Index in the error_description list for "current_tor_n_tor" + type(ids_waves_coherent_wave_global_quantities_electrons) :: electrons !Quantities related to the electrons + type(ids_waves_coherent_wave_global_quantities_ion), pointer :: ion(:) => null() !Quantities related to the different ion species + real(ids_real) :: time=ids_real_invalid !Time + end type + + type :: ids_waves_CPX_amp_phase_1D + real(ids_real), pointer :: amplitude(:) => null() !Amplitude + real(ids_real), pointer :: amplitude_error_upper(:) => null() !Upper error for "amplitude" + real(ids_real), pointer :: amplitude_error_lower(:) => null() !Lower error for "amplitude" + integer(ids_int) :: amplitude_error_index=ids_int_invalid !Index in the error_description list for "amplitude" + real(ids_real), pointer :: phase(:) => null() !Phase + real(ids_real), pointer :: phase_error_upper(:) => null() !Upper error for "phase" + real(ids_real), pointer :: phase_error_lower(:) => null() !Lower error for "phase" + integer(ids_int) :: phase_error_index=ids_int_invalid !Index in the error_description list for "phase" + end type + + type :: ids_waves_profiles_1d_e_field_n_tor + type(ids_waves_CPX_amp_phase_1D) :: plus !Left hand polarised electric field component for every flux surface + type(ids_waves_CPX_amp_phase_1D) :: minus !Right hand polarised electric field component for every flux surface + type(ids_waves_CPX_amp_phase_1D) :: parallel !Parallel electric field component for every flux surface + end type + + type :: ids_waves_coherent_wave_profiles_1d_electrons + real(ids_real), pointer :: power_density_thermal(:) => null() !Flux surface averaged absorbed wave power density on the thermal species + real(ids_real), pointer :: power_density_thermal_error_upper(:) => null() !Upper error for "power_density_thermal" + real(ids_real), pointer :: power_density_thermal_error_lower(:) => null() !Lower error for "power_density_thermal" + integer(ids_int) :: power_density_thermal_error_index=ids_int_invalid !Index in the error_description list for "power_density_thermal" + real(ids_real), pointer :: power_density_thermal_n_tor(:,:) => null() !Flux surface averaged absorbed wave power density on the thermal species, per toroidal mode number + real(ids_real), pointer :: power_density_thermal_n_tor_error_upper(:,:) => null() !Upper error for "power_density_thermal_n_tor" + real(ids_real), pointer :: power_density_thermal_n_tor_error_lower(:,:) => null() !Lower error for "power_density_thermal_n_tor" + integer(ids_int) :: power_density_thermal_n_tor_error_index=ids_int_invalid !Index in the error_description list for "power_density_thermal_n_tor" + real(ids_real), pointer :: power_density_fast(:) => null() !Flux surface averaged absorbed wave power density on the fast species + real(ids_real), pointer :: power_density_fast_error_upper(:) => null() !Upper error for "power_density_fast" + real(ids_real), pointer :: power_density_fast_error_lower(:) => null() !Lower error for "power_density_fast" + integer(ids_int) :: power_density_fast_error_index=ids_int_invalid !Index in the error_description list for "power_density_fast" + real(ids_real), pointer :: power_density_fast_n_tor(:,:) => null() !Flux surface averaged absorbed wave power density on the fast species, per toroidal mode number + real(ids_real), pointer :: power_density_fast_n_tor_error_upper(:,:) => null() !Upper error for "power_density_fast_n_tor" + real(ids_real), pointer :: power_density_fast_n_tor_error_lower(:,:) => null() !Lower error for "power_density_fast_n_tor" + integer(ids_int) :: power_density_fast_n_tor_error_index=ids_int_invalid !Index in the error_description list for "power_density_fast_n_tor" + real(ids_real), pointer :: power_inside_thermal(:) => null() !Absorbed wave power on thermal species inside a flux surface (cumulative volume integral of the absorbed power density) + real(ids_real), pointer :: power_inside_thermal_error_upper(:) => null() !Upper error for "power_inside_thermal" + real(ids_real), pointer :: power_inside_thermal_error_lower(:) => null() !Lower error for "power_inside_thermal" + integer(ids_int) :: power_inside_thermal_error_index=ids_int_invalid !Index in the error_description list for "power_inside_thermal" + real(ids_real), pointer :: power_inside_thermal_n_tor(:,:) => null() !Absorbed wave power on thermal species inside a flux surface (cumulative volume integral of the absorbed power density), per toroi! + !dal mode number + real(ids_real), pointer :: power_inside_thermal_n_tor_error_upper(:,:) => null() !Upper error for "power_inside_thermal_n_tor" + real(ids_real), pointer :: power_inside_thermal_n_tor_error_lower(:,:) => null() !Lower error for "power_inside_thermal_n_tor" + integer(ids_int) :: power_inside_thermal_n_tor_error_index=ids_int_invalid !Index in the error_description list for "power_inside_thermal_n_tor" + real(ids_real), pointer :: power_inside_fast(:) => null() !Absorbed wave power on thermal species inside a flux surface (cumulative volume integral of the absorbed power density) + real(ids_real), pointer :: power_inside_fast_error_upper(:) => null() !Upper error for "power_inside_fast" + real(ids_real), pointer :: power_inside_fast_error_lower(:) => null() !Lower error for "power_inside_fast" + integer(ids_int) :: power_inside_fast_error_index=ids_int_invalid !Index in the error_description list for "power_inside_fast" + real(ids_real), pointer :: power_inside_fast_n_tor(:,:) => null() !Absorbed wave power on thermal species inside a flux surface (cumulative volume integral of the absorbed power density), per toroi! + !dal mode number + real(ids_real), pointer :: power_inside_fast_n_tor_error_upper(:,:) => null() !Upper error for "power_inside_fast_n_tor" + real(ids_real), pointer :: power_inside_fast_n_tor_error_lower(:,:) => null() !Lower error for "power_inside_fast_n_tor" + integer(ids_int) :: power_inside_fast_n_tor_error_index=ids_int_invalid !Index in the error_description list for "power_inside_fast_n_tor" + end type + + type :: ids_waves_coherent_wave_profiles_1d_ion_state + real(ids_real) :: z_min=ids_real_invalid !Minimum Z of the charge state bundle (z_min = z_max = 0 for a neutral) + real(ids_real) :: z_min_error_upper=ids_real_invalid !Upper error for "z_min" + real(ids_real) :: z_min_error_lower=ids_real_invalid !Lower error for "z_min" + integer(ids_int) :: z_min_error_index=ids_int_invalid !Index in the error_description list for "z_min" + real(ids_real) :: z_max=ids_real_invalid !Maximum Z of the charge state bundle (equal to z_min if no bundle) + real(ids_real) :: z_max_error_upper=ids_real_invalid !Upper error for "z_max" + real(ids_real) :: z_max_error_lower=ids_real_invalid !Lower error for "z_max" + integer(ids_int) :: z_max_error_index=ids_int_invalid !Index in the error_description list for "z_max" + character(len=ids_string_length), dimension(:), pointer :: label => null() !String identifying charge state (e.g. C+, C+2 , C+3, C+4, C+5, C+6, ...) + character(len=ids_string_length), dimension(:), pointer :: electron_configuration => null() !Configuration of atomic orbitals of this state, e.g. 1s2-2s1 + real(ids_real) :: vibrational_level=ids_real_invalid !Vibrational level (can be bundled) + real(ids_real) :: vibrational_level_error_upper=ids_real_invalid !Upper error for "vibrational_level" + real(ids_real) :: vibrational_level_error_lower=ids_real_invalid !Lower error for "vibrational_level" + integer(ids_int) :: vibrational_level_error_index=ids_int_invalid !Index in the error_description list for "vibrational_level" + character(len=ids_string_length), dimension(:), pointer :: vibrational_mode => null() !Vibrational mode of this state, e.g. "A_g". Need to define, or adopt a standard nomenclature. + real(ids_real), pointer :: power_density_thermal(:) => null() !Flux surface averaged absorbed wave power density on the thermal species + real(ids_real), pointer :: power_density_thermal_error_upper(:) => null() !Upper error for "power_density_thermal" + real(ids_real), pointer :: power_density_thermal_error_lower(:) => null() !Lower error for "power_density_thermal" + integer(ids_int) :: power_density_thermal_error_index=ids_int_invalid !Index in the error_description list for "power_density_thermal" + real(ids_real), pointer :: power_density_thermal_n_tor(:,:) => null() !Flux surface averaged absorbed wave power density on the thermal species, per toroidal mode number + real(ids_real), pointer :: power_density_thermal_n_tor_error_upper(:,:) => null() !Upper error for "power_density_thermal_n_tor" + real(ids_real), pointer :: power_density_thermal_n_tor_error_lower(:,:) => null() !Lower error for "power_density_thermal_n_tor" + integer(ids_int) :: power_density_thermal_n_tor_error_index=ids_int_invalid !Index in the error_description list for "power_density_thermal_n_tor" + real(ids_real), pointer :: power_density_fast(:) => null() !Flux surface averaged absorbed wave power density on the fast species + real(ids_real), pointer :: power_density_fast_error_upper(:) => null() !Upper error for "power_density_fast" + real(ids_real), pointer :: power_density_fast_error_lower(:) => null() !Lower error for "power_density_fast" + integer(ids_int) :: power_density_fast_error_index=ids_int_invalid !Index in the error_description list for "power_density_fast" + real(ids_real), pointer :: power_density_fast_n_tor(:,:) => null() !Flux surface averaged absorbed wave power density on the fast species, per toroidal mode number + real(ids_real), pointer :: power_density_fast_n_tor_error_upper(:,:) => null() !Upper error for "power_density_fast_n_tor" + real(ids_real), pointer :: power_density_fast_n_tor_error_lower(:,:) => null() !Lower error for "power_density_fast_n_tor" + integer(ids_int) :: power_density_fast_n_tor_error_index=ids_int_invalid !Index in the error_description list for "power_density_fast_n_tor" + real(ids_real), pointer :: power_inside_thermal(:) => null() !Absorbed wave power on thermal species inside a flux surface (cumulative volume integral of the absorbed power density) + real(ids_real), pointer :: power_inside_thermal_error_upper(:) => null() !Upper error for "power_inside_thermal" + real(ids_real), pointer :: power_inside_thermal_error_lower(:) => null() !Lower error for "power_inside_thermal" + integer(ids_int) :: power_inside_thermal_error_index=ids_int_invalid !Index in the error_description list for "power_inside_thermal" + real(ids_real), pointer :: power_inside_thermal_n_tor(:,:) => null() !Absorbed wave power on thermal species inside a flux surface (cumulative volume integral of the absorbed power density), per toroi! + !dal mode number + real(ids_real), pointer :: power_inside_thermal_n_tor_error_upper(:,:) => null() !Upper error for "power_inside_thermal_n_tor" + real(ids_real), pointer :: power_inside_thermal_n_tor_error_lower(:,:) => null() !Lower error for "power_inside_thermal_n_tor" + integer(ids_int) :: power_inside_thermal_n_tor_error_index=ids_int_invalid !Index in the error_description list for "power_inside_thermal_n_tor" + real(ids_real), pointer :: power_inside_fast(:) => null() !Absorbed wave power on thermal species inside a flux surface (cumulative volume integral of the absorbed power density) + real(ids_real), pointer :: power_inside_fast_error_upper(:) => null() !Upper error for "power_inside_fast" + real(ids_real), pointer :: power_inside_fast_error_lower(:) => null() !Lower error for "power_inside_fast" + integer(ids_int) :: power_inside_fast_error_index=ids_int_invalid !Index in the error_description list for "power_inside_fast" + real(ids_real), pointer :: power_inside_fast_n_tor(:,:) => null() !Absorbed wave power on thermal species inside a flux surface (cumulative volume integral of the absorbed power density), per toroi! + !dal mode number + real(ids_real), pointer :: power_inside_fast_n_tor_error_upper(:,:) => null() !Upper error for "power_inside_fast_n_tor" + real(ids_real), pointer :: power_inside_fast_n_tor_error_lower(:,:) => null() !Lower error for "power_inside_fast_n_tor" + integer(ids_int) :: power_inside_fast_n_tor_error_index=ids_int_invalid !Index in the error_description list for "power_inside_fast_n_tor" + end type + + type :: ids_waves_coherent_wave_profiles_1d_ion + type(ids_plasma_composition_neutral_element), pointer :: element(:) => null() !List of elements forming the atom or molecule + real(ids_real) :: z_ion=ids_real_invalid !Ion charge (of the dominant ionisation state; lumped ions are allowed). + real(ids_real) :: z_ion_error_upper=ids_real_invalid !Upper error for "z_ion" + real(ids_real) :: z_ion_error_lower=ids_real_invalid !Lower error for "z_ion" + integer(ids_int) :: z_ion_error_index=ids_int_invalid !Index in the error_description list for "z_ion" + character(len=ids_string_length), dimension(:), pointer :: label => null() !String identifying the species (e.g. H+, D+, T+, He+2, C+, D2, DT, CD4, ...) + real(ids_real), pointer :: power_density_thermal(:) => null() !Flux surface averaged absorbed wave power density on the thermal species + real(ids_real), pointer :: power_density_thermal_error_upper(:) => null() !Upper error for "power_density_thermal" + real(ids_real), pointer :: power_density_thermal_error_lower(:) => null() !Lower error for "power_density_thermal" + integer(ids_int) :: power_density_thermal_error_index=ids_int_invalid !Index in the error_description list for "power_density_thermal" + real(ids_real), pointer :: power_density_thermal_n_tor(:,:) => null() !Flux surface averaged absorbed wave power density on the thermal species, per toroidal mode number + real(ids_real), pointer :: power_density_thermal_n_tor_error_upper(:,:) => null() !Upper error for "power_density_thermal_n_tor" + real(ids_real), pointer :: power_density_thermal_n_tor_error_lower(:,:) => null() !Lower error for "power_density_thermal_n_tor" + integer(ids_int) :: power_density_thermal_n_tor_error_index=ids_int_invalid !Index in the error_description list for "power_density_thermal_n_tor" + real(ids_real), pointer :: power_density_fast(:) => null() !Flux surface averaged absorbed wave power density on the fast species + real(ids_real), pointer :: power_density_fast_error_upper(:) => null() !Upper error for "power_density_fast" + real(ids_real), pointer :: power_density_fast_error_lower(:) => null() !Lower error for "power_density_fast" + integer(ids_int) :: power_density_fast_error_index=ids_int_invalid !Index in the error_description list for "power_density_fast" + real(ids_real), pointer :: power_density_fast_n_tor(:,:) => null() !Flux surface averaged absorbed wave power density on the fast species, per toroidal mode number + real(ids_real), pointer :: power_density_fast_n_tor_error_upper(:,:) => null() !Upper error for "power_density_fast_n_tor" + real(ids_real), pointer :: power_density_fast_n_tor_error_lower(:,:) => null() !Lower error for "power_density_fast_n_tor" + integer(ids_int) :: power_density_fast_n_tor_error_index=ids_int_invalid !Index in the error_description list for "power_density_fast_n_tor" + real(ids_real), pointer :: power_inside_thermal(:) => null() !Absorbed wave power on thermal species inside a flux surface (cumulative volume integral of the absorbed power density) + real(ids_real), pointer :: power_inside_thermal_error_upper(:) => null() !Upper error for "power_inside_thermal" + real(ids_real), pointer :: power_inside_thermal_error_lower(:) => null() !Lower error for "power_inside_thermal" + integer(ids_int) :: power_inside_thermal_error_index=ids_int_invalid !Index in the error_description list for "power_inside_thermal" + real(ids_real), pointer :: power_inside_thermal_n_tor(:,:) => null() !Absorbed wave power on thermal species inside a flux surface (cumulative volume integral of the absorbed power density), per toroi! + !dal mode number + real(ids_real), pointer :: power_inside_thermal_n_tor_error_upper(:,:) => null() !Upper error for "power_inside_thermal_n_tor" + real(ids_real), pointer :: power_inside_thermal_n_tor_error_lower(:,:) => null() !Lower error for "power_inside_thermal_n_tor" + integer(ids_int) :: power_inside_thermal_n_tor_error_index=ids_int_invalid !Index in the error_description list for "power_inside_thermal_n_tor" + real(ids_real), pointer :: power_inside_fast(:) => null() !Absorbed wave power on thermal species inside a flux surface (cumulative volume integral of the absorbed power density) + real(ids_real), pointer :: power_inside_fast_error_upper(:) => null() !Upper error for "power_inside_fast" + real(ids_real), pointer :: power_inside_fast_error_lower(:) => null() !Lower error for "power_inside_fast" + integer(ids_int) :: power_inside_fast_error_index=ids_int_invalid !Index in the error_description list for "power_inside_fast" + real(ids_real), pointer :: power_inside_fast_n_tor(:,:) => null() !Absorbed wave power on thermal species inside a flux surface (cumulative volume integral of the absorbed power density), per toroi! + !dal mode number + real(ids_real), pointer :: power_inside_fast_n_tor_error_upper(:,:) => null() !Upper error for "power_inside_fast_n_tor" + real(ids_real), pointer :: power_inside_fast_n_tor_error_lower(:,:) => null() !Lower error for "power_inside_fast_n_tor" + integer(ids_int) :: power_inside_fast_n_tor_error_index=ids_int_invalid !Index in the error_description list for "power_inside_fast_n_tor" + integer(ids_int) :: multiple_states_flag=ids_int_invalid !Multiple state calculation flag : 0-Only one state is considered; 1-Multiple states are considered and are described in the state ! + !structure + type(ids_waves_coherent_wave_profiles_1d_ion_state), pointer :: state(:) => null() !Collisional exchange with the various states of the ion species (ionisation, energy, excitation, ...) + end type + + type :: ids_waves_coherent_wave_profiles_1d + type(ids_core_radial_grid) :: grid !Radial grid + integer(ids_int), pointer :: n_tor(:) => null() !Toroidal mode numbers + real(ids_real), pointer :: power_density(:) => null() !Flux surface averaged total absorbed wave power density (electrons + ion + fast populations) + real(ids_real), pointer :: power_density_error_upper(:) => null() !Upper error for "power_density" + real(ids_real), pointer :: power_density_error_lower(:) => null() !Lower error for "power_density" + integer(ids_int) :: power_density_error_index=ids_int_invalid !Index in the error_description list for "power_density" + real(ids_real), pointer :: power_density_n_tor(:,:) => null() !Flux surface averaged absorbed wave power density per toroidal mode number + real(ids_real), pointer :: power_density_n_tor_error_upper(:,:) => null() !Upper error for "power_density_n_tor" + real(ids_real), pointer :: power_density_n_tor_error_lower(:,:) => null() !Lower error for "power_density_n_tor" + integer(ids_int) :: power_density_n_tor_error_index=ids_int_invalid !Index in the error_description list for "power_density_n_tor" + real(ids_real), pointer :: power_inside(:) => null() !Total absorbed wave power (electrons + ion + fast populations) inside a flux surface (cumulative volume integral of the absorbed p! + !ower density) + real(ids_real), pointer :: power_inside_error_upper(:) => null() !Upper error for "power_inside" + real(ids_real), pointer :: power_inside_error_lower(:) => null() !Lower error for "power_inside" + integer(ids_int) :: power_inside_error_index=ids_int_invalid !Index in the error_description list for "power_inside" + real(ids_real), pointer :: power_inside_n_tor(:,:) => null() !Total absorbed wave power (electrons + ion + fast populations) inside a flux surface (cumulative volume integral of the absorbed p! + !ower density), per toroidal mode number + real(ids_real), pointer :: power_inside_n_tor_error_upper(:,:) => null() !Upper error for "power_inside_n_tor" + real(ids_real), pointer :: power_inside_n_tor_error_lower(:,:) => null() !Lower error for "power_inside_n_tor" + integer(ids_int) :: power_inside_n_tor_error_index=ids_int_invalid !Index in the error_description list for "power_inside_n_tor" + real(ids_real), pointer :: current_tor_inside(:) => null() !Wave driven toroidal current, inside a flux surface + real(ids_real), pointer :: current_tor_inside_error_upper(:) => null() !Upper error for "current_tor_inside" + real(ids_real), pointer :: current_tor_inside_error_lower(:) => null() !Lower error for "current_tor_inside" + integer(ids_int) :: current_tor_inside_error_index=ids_int_invalid !Index in the error_description list for "current_tor_inside" + real(ids_real), pointer :: current_tor_inside_n_tor(:,:) => null() !Wave driven toroidal current, inside a flux surface, per toroidal mode number + real(ids_real), pointer :: current_tor_inside_n_tor_error_upper(:,:) => null() !Upper error for "current_tor_inside_n_tor" + real(ids_real), pointer :: current_tor_inside_n_tor_error_lower(:,:) => null() !Lower error for "current_tor_inside_n_tor" + integer(ids_int) :: current_tor_inside_n_tor_error_index=ids_int_invalid !Index in the error_description list for "current_tor_inside_n_tor" + real(ids_real), pointer :: current_parallel_density(:) => null() !Flux surface averaged wave driven parallel current density = average(j.B) / B0, where B0 = vacuum_toroidal_field/b0. + real(ids_real), pointer :: current_parallel_density_error_upper(:) => null() !Upper error for "current_parallel_density" + real(ids_real), pointer :: current_parallel_density_error_lower(:) => null() !Lower error for "current_parallel_density" + integer(ids_int) :: current_parallel_density_error_index=ids_int_invalid !Index in the error_description list for "current_parallel_density" + real(ids_real), pointer :: current_parallel_density_n_tor(:,:) => null() !Flux surface averaged wave driven parallel current density, per toroidal mode number + real(ids_real), pointer :: current_parallel_density_n_tor_error_upper(:,:) => null() !Upper error for "current_parallel_density_n_tor" + real(ids_real), pointer :: current_parallel_density_n_tor_error_lower(:,:) => null() !Lower error for "current_parallel_density_n_tor" + integer(ids_int) :: current_parallel_density_n_tor_error_index=ids_int_invalid !Index in the error_description list for "current_parallel_density_n_tor" + type(ids_waves_profiles_1d_e_field_n_tor), pointer :: e_field_n_tor(:) => null() !Components of the electric field per toroidal mode number, averaged over the flux surface, where the averaged is weighted with the! + ! power deposition density, such that e_field = ave(e_field.power_density) / ave(power_density) + real(ids_real), pointer :: k_perpendicular(:,:) => null() !Perpendicular wave vector, averaged over the flux surface, where the averaged is weighted with the power deposition density, such! + ! that k_perpendicular = ave(k_perpendicular.power_density) / ave(power_density), for every flux surface and every toroidal number + real(ids_real), pointer :: k_perpendicular_error_upper(:,:) => null() !Upper error for "k_perpendicular" + real(ids_real), pointer :: k_perpendicular_error_lower(:,:) => null() !Lower error for "k_perpendicular" + integer(ids_int) :: k_perpendicular_error_index=ids_int_invalid !Index in the error_description list for "k_perpendicular" + type(ids_waves_coherent_wave_profiles_1d_electrons) :: electrons !Quantities related to the electrons + type(ids_waves_coherent_wave_profiles_1d_ion), pointer :: ion(:) => null() !Quantities related to the different ion species + real(ids_real) :: time=ids_real_invalid !Time + end type + + type :: ids_waves_coherent_wave_profiles_2d_grid + type(ids_identifier_dynamic_aos3) :: type !Grid type: index=0: Rectangular grid in the (R,Z) coordinates; index=1: Rectangular grid in the (radial, theta_geometric) coordina! + !tes; index=2: Rectangular grid in the (radial, theta_straight) coordinates. index=3: unstructured grid. + real(ids_real), pointer :: r(:,:) => null() !Major radius + real(ids_real), pointer :: r_error_upper(:,:) => null() !Upper error for "r" + real(ids_real), pointer :: r_error_lower(:,:) => null() !Lower error for "r" + integer(ids_int) :: r_error_index=ids_int_invalid !Index in the error_description list for "r" + real(ids_real), pointer :: z(:,:) => null() !Height + real(ids_real), pointer :: z_error_upper(:,:) => null() !Upper error for "z" + real(ids_real), pointer :: z_error_lower(:,:) => null() !Lower error for "z" + integer(ids_int) :: z_error_index=ids_int_invalid !Index in the error_description list for "z" + real(ids_real), pointer :: theta_straight(:,:) => null() !Straight field line poloidal angle + real(ids_real), pointer :: theta_straight_error_upper(:,:) => null() !Upper error for "theta_straight" + real(ids_real), pointer :: theta_straight_error_lower(:,:) => null() !Lower error for "theta_straight" + integer(ids_int) :: theta_straight_error_index=ids_int_invalid !Index in the error_description list for "theta_straight" + real(ids_real), pointer :: theta_geometric(:,:) => null() !Geometrical poloidal angle + real(ids_real), pointer :: theta_geometric_error_upper(:,:) => null() !Upper error for "theta_geometric" + real(ids_real), pointer :: theta_geometric_error_lower(:,:) => null() !Lower error for "theta_geometric" + integer(ids_int) :: theta_geometric_error_index=ids_int_invalid !Index in the error_description list for "theta_geometric" + real(ids_real), pointer :: rho_tor_norm(:,:) => null() !Normalised toroidal flux coordinate. The normalizing value for rho_tor_norm, is the toroidal flux coordinate at the equilibrium bo! + !undary (LCFS or 99.x % of the LCFS in case of a fixed boundary equilibium calculation) + real(ids_real), pointer :: rho_tor_norm_error_upper(:,:) => null() !Upper error for "rho_tor_norm" + real(ids_real), pointer :: rho_tor_norm_error_lower(:,:) => null() !Lower error for "rho_tor_norm" + integer(ids_int) :: rho_tor_norm_error_index=ids_int_invalid !Index in the error_description list for "rho_tor_norm" + real(ids_real), pointer :: rho_tor(:,:) => null() !Toroidal flux coordinate. The toroidal field used in its definition is indicated under vacuum_toroidal_field/b0 + real(ids_real), pointer :: rho_tor_error_upper(:,:) => null() !Upper error for "rho_tor" + real(ids_real), pointer :: rho_tor_error_lower(:,:) => null() !Lower error for "rho_tor" + integer(ids_int) :: rho_tor_error_index=ids_int_invalid !Index in the error_description list for "rho_tor" + real(ids_real), pointer :: psi(:,:) => null() !Poloidal magnetic flux + real(ids_real), pointer :: psi_error_upper(:,:) => null() !Upper error for "psi" + real(ids_real), pointer :: psi_error_lower(:,:) => null() !Lower error for "psi" + integer(ids_int) :: psi_error_index=ids_int_invalid !Index in the error_description list for "psi" + real(ids_real), pointer :: volume(:,:) => null() !Volume enclosed inside the magnetic surface + real(ids_real), pointer :: volume_error_upper(:,:) => null() !Upper error for "volume" + real(ids_real), pointer :: volume_error_lower(:,:) => null() !Lower error for "volume" + integer(ids_int) :: volume_error_index=ids_int_invalid !Index in the error_description list for "volume" + real(ids_real), pointer :: area(:,:) => null() !Cross-sectional area of the flux surface + real(ids_real), pointer :: area_error_upper(:,:) => null() !Upper error for "area" + real(ids_real), pointer :: area_error_lower(:,:) => null() !Lower error for "area" + integer(ids_int) :: area_error_index=ids_int_invalid !Index in the error_description list for "area" + end type + + type :: ids_waves_CPX_amp_phase_2D + real(ids_real), pointer :: amplitude(:,:) => null() !Amplitude + real(ids_real), pointer :: amplitude_error_upper(:,:) => null() !Upper error for "amplitude" + real(ids_real), pointer :: amplitude_error_lower(:,:) => null() !Lower error for "amplitude" + integer(ids_int) :: amplitude_error_index=ids_int_invalid !Index in the error_description list for "amplitude" + real(ids_real), pointer :: phase(:,:) => null() !Phase + real(ids_real), pointer :: phase_error_upper(:,:) => null() !Upper error for "phase" + real(ids_real), pointer :: phase_error_lower(:,:) => null() !Lower error for "phase" + integer(ids_int) :: phase_error_index=ids_int_invalid !Index in the error_description list for "phase" + end type + + type :: ids_waves_profiles_2d_e_field_n_tor + type(ids_waves_CPX_amp_phase_2D) :: plus !Left hand polarised electric field component + type(ids_waves_CPX_amp_phase_2D) :: minus !Right hand polarised electric field component + type(ids_waves_CPX_amp_phase_2D) :: parallel !Parallel electric field component + end type + + type :: ids_waves_coherent_wave_profiles_2d_electrons + real(ids_real), pointer :: power_density_thermal(:,:) => null() !Absorbed wave power density on the thermal species + real(ids_real), pointer :: power_density_thermal_error_upper(:,:) => null() !Upper error for "power_density_thermal" + real(ids_real), pointer :: power_density_thermal_error_lower(:,:) => null() !Lower error for "power_density_thermal" + integer(ids_int) :: power_density_thermal_error_index=ids_int_invalid !Index in the error_description list for "power_density_thermal" + real(ids_real), pointer :: power_density_thermal_n_tor(:,:,:) => null() !Absorbed wave power density on the thermal species, per toroidal mode number + real(ids_real), pointer :: power_density_thermal_n_tor_error_upper(:,:,:) => null() !Upper error for "power_density_thermal_n_tor" + real(ids_real), pointer :: power_density_thermal_n_tor_error_lower(:,:,:) => null() !Lower error for "power_density_thermal_n_tor" + integer(ids_int) :: power_density_thermal_n_tor_error_index=ids_int_invalid !Index in the error_description list for "power_density_thermal_n_tor" + real(ids_real), pointer :: power_density_fast(:,:) => null() !Absorbed wave power density on the fast species + real(ids_real), pointer :: power_density_fast_error_upper(:,:) => null() !Upper error for "power_density_fast" + real(ids_real), pointer :: power_density_fast_error_lower(:,:) => null() !Lower error for "power_density_fast" + integer(ids_int) :: power_density_fast_error_index=ids_int_invalid !Index in the error_description list for "power_density_fast" + real(ids_real), pointer :: power_density_fast_n_tor(:,:,:) => null() !Absorbed wave power density on the fast species, per toroidal mode number + real(ids_real), pointer :: power_density_fast_n_tor_error_upper(:,:,:) => null() !Upper error for "power_density_fast_n_tor" + real(ids_real), pointer :: power_density_fast_n_tor_error_lower(:,:,:) => null() !Lower error for "power_density_fast_n_tor" + integer(ids_int) :: power_density_fast_n_tor_error_index=ids_int_invalid !Index in the error_description list for "power_density_fast_n_tor" + end type + + type :: ids_waves_coherent_wave_profiles_2d_ion_state + real(ids_real) :: z_min=ids_real_invalid !Minimum Z of the charge state bundle (z_min = z_max = 0 for a neutral) + real(ids_real) :: z_min_error_upper=ids_real_invalid !Upper error for "z_min" + real(ids_real) :: z_min_error_lower=ids_real_invalid !Lower error for "z_min" + integer(ids_int) :: z_min_error_index=ids_int_invalid !Index in the error_description list for "z_min" + real(ids_real) :: z_max=ids_real_invalid !Maximum Z of the charge state bundle (equal to z_min if no bundle) + real(ids_real) :: z_max_error_upper=ids_real_invalid !Upper error for "z_max" + real(ids_real) :: z_max_error_lower=ids_real_invalid !Lower error for "z_max" + integer(ids_int) :: z_max_error_index=ids_int_invalid !Index in the error_description list for "z_max" + character(len=ids_string_length), dimension(:), pointer :: label => null() !String identifying charge state (e.g. C+, C+2 , C+3, C+4, C+5, C+6, ...) + character(len=ids_string_length), dimension(:), pointer :: electron_configuration => null() !Configuration of atomic orbitals of this state, e.g. 1s2-2s1 + real(ids_real) :: vibrational_level=ids_real_invalid !Vibrational level (can be bundled) + real(ids_real) :: vibrational_level_error_upper=ids_real_invalid !Upper error for "vibrational_level" + real(ids_real) :: vibrational_level_error_lower=ids_real_invalid !Lower error for "vibrational_level" + integer(ids_int) :: vibrational_level_error_index=ids_int_invalid !Index in the error_description list for "vibrational_level" + character(len=ids_string_length), dimension(:), pointer :: vibrational_mode => null() !Vibrational mode of this state, e.g. "A_g". Need to define, or adopt a standard nomenclature. + real(ids_real), pointer :: power_density_thermal(:,:) => null() !Absorbed wave power density on the thermal species + real(ids_real), pointer :: power_density_thermal_error_upper(:,:) => null() !Upper error for "power_density_thermal" + real(ids_real), pointer :: power_density_thermal_error_lower(:,:) => null() !Lower error for "power_density_thermal" + integer(ids_int) :: power_density_thermal_error_index=ids_int_invalid !Index in the error_description list for "power_density_thermal" + real(ids_real), pointer :: power_density_thermal_n_tor(:,:,:) => null() !Absorbed wave power density on the thermal species, per toroidal mode number + real(ids_real), pointer :: power_density_thermal_n_tor_error_upper(:,:,:) => null() !Upper error for "power_density_thermal_n_tor" + real(ids_real), pointer :: power_density_thermal_n_tor_error_lower(:,:,:) => null() !Lower error for "power_density_thermal_n_tor" + integer(ids_int) :: power_density_thermal_n_tor_error_index=ids_int_invalid !Index in the error_description list for "power_density_thermal_n_tor" + real(ids_real), pointer :: power_density_fast(:,:) => null() !Absorbed wave power density on the fast species + real(ids_real), pointer :: power_density_fast_error_upper(:,:) => null() !Upper error for "power_density_fast" + real(ids_real), pointer :: power_density_fast_error_lower(:,:) => null() !Lower error for "power_density_fast" + integer(ids_int) :: power_density_fast_error_index=ids_int_invalid !Index in the error_description list for "power_density_fast" + real(ids_real), pointer :: power_density_fast_n_tor(:,:,:) => null() !Absorbed wave power density on the fast species, per toroidal mode number + real(ids_real), pointer :: power_density_fast_n_tor_error_upper(:,:,:) => null() !Upper error for "power_density_fast_n_tor" + real(ids_real), pointer :: power_density_fast_n_tor_error_lower(:,:,:) => null() !Lower error for "power_density_fast_n_tor" + integer(ids_int) :: power_density_fast_n_tor_error_index=ids_int_invalid !Index in the error_description list for "power_density_fast_n_tor" + end type + + type :: ids_waves_coherent_wave_profiles_2d_ion + type(ids_plasma_composition_neutral_element), pointer :: element(:) => null() !List of elements forming the atom or molecule + real(ids_real) :: z_ion=ids_real_invalid !Ion charge (of the dominant ionisation state; lumped ions are allowed). + real(ids_real) :: z_ion_error_upper=ids_real_invalid !Upper error for "z_ion" + real(ids_real) :: z_ion_error_lower=ids_real_invalid !Lower error for "z_ion" + integer(ids_int) :: z_ion_error_index=ids_int_invalid !Index in the error_description list for "z_ion" + character(len=ids_string_length), dimension(:), pointer :: label => null() !String identifying the species (e.g. H+, D+, T+, He+2, C+, D2, DT, CD4, ...) + real(ids_real), pointer :: power_density_thermal(:,:) => null() !Absorbed wave power density on the thermal species + real(ids_real), pointer :: power_density_thermal_error_upper(:,:) => null() !Upper error for "power_density_thermal" + real(ids_real), pointer :: power_density_thermal_error_lower(:,:) => null() !Lower error for "power_density_thermal" + integer(ids_int) :: power_density_thermal_error_index=ids_int_invalid !Index in the error_description list for "power_density_thermal" + real(ids_real), pointer :: power_density_thermal_n_tor(:,:,:) => null() !Absorbed wave power density on the thermal species, per toroidal mode number + real(ids_real), pointer :: power_density_thermal_n_tor_error_upper(:,:,:) => null() !Upper error for "power_density_thermal_n_tor" + real(ids_real), pointer :: power_density_thermal_n_tor_error_lower(:,:,:) => null() !Lower error for "power_density_thermal_n_tor" + integer(ids_int) :: power_density_thermal_n_tor_error_index=ids_int_invalid !Index in the error_description list for "power_density_thermal_n_tor" + real(ids_real), pointer :: power_density_fast(:,:) => null() !Absorbed wave power density on the fast species + real(ids_real), pointer :: power_density_fast_error_upper(:,:) => null() !Upper error for "power_density_fast" + real(ids_real), pointer :: power_density_fast_error_lower(:,:) => null() !Lower error for "power_density_fast" + integer(ids_int) :: power_density_fast_error_index=ids_int_invalid !Index in the error_description list for "power_density_fast" + real(ids_real), pointer :: power_density_fast_n_tor(:,:,:) => null() !Absorbed wave power density on the fast species, per toroidal mode number + real(ids_real), pointer :: power_density_fast_n_tor_error_upper(:,:,:) => null() !Upper error for "power_density_fast_n_tor" + real(ids_real), pointer :: power_density_fast_n_tor_error_lower(:,:,:) => null() !Lower error for "power_density_fast_n_tor" + integer(ids_int) :: power_density_fast_n_tor_error_index=ids_int_invalid !Index in the error_description list for "power_density_fast_n_tor" + integer(ids_int) :: multiple_states_flag=ids_int_invalid !Multiple state calculation flag : 0-Only one state is considered; 1-Multiple states are considered and are described in the state ! + !structure + type(ids_waves_coherent_wave_profiles_2d_ion_state), pointer :: state(:) => null() !Collisional exchange with the various states of the ion species (ionisation, energy, excitation, ...) + end type + + type :: ids_waves_coherent_wave_profiles_2d + type(ids_waves_coherent_wave_profiles_2d_grid) :: grid !2D grid in a poloidal cross-section + integer(ids_int), pointer :: n_tor(:) => null() !Toroidal mode numbers + real(ids_real), pointer :: power_density(:,:) => null() !Total absorbed wave power density (electrons + ion + fast populations) + real(ids_real), pointer :: power_density_error_upper(:,:) => null() !Upper error for "power_density" + real(ids_real), pointer :: power_density_error_lower(:,:) => null() !Lower error for "power_density" + integer(ids_int) :: power_density_error_index=ids_int_invalid !Index in the error_description list for "power_density" + real(ids_real), pointer :: power_density_n_tor(:,:,:) => null() !Absorbed wave power density per toroidal mode number + real(ids_real), pointer :: power_density_n_tor_error_upper(:,:,:) => null() !Upper error for "power_density_n_tor" + real(ids_real), pointer :: power_density_n_tor_error_lower(:,:,:) => null() !Lower error for "power_density_n_tor" + integer(ids_int) :: power_density_n_tor_error_index=ids_int_invalid !Index in the error_description list for "power_density_n_tor" + type(ids_waves_profiles_2d_e_field_n_tor), pointer :: e_field_n_tor(:) => null() !Components of the electric field per toroidal mode number + type(ids_waves_coherent_wave_profiles_2d_electrons) :: electrons !Quantities related to the electrons + type(ids_waves_coherent_wave_profiles_2d_ion), pointer :: ion(:) => null() !Quantities related to the different ion species + real(ids_real) :: time=ids_real_invalid !Time + end type + + type :: ids_waves_rzphipsitheta1d_dynamic_aos3 + real(ids_real), pointer :: r(:) => null() !Major radius + real(ids_real), pointer :: r_error_upper(:) => null() !Upper error for "r" + real(ids_real), pointer :: r_error_lower(:) => null() !Lower error for "r" + integer(ids_int) :: r_error_index=ids_int_invalid !Index in the error_description list for "r" + real(ids_real), pointer :: z(:) => null() !Height + real(ids_real), pointer :: z_error_upper(:) => null() !Upper error for "z" + real(ids_real), pointer :: z_error_lower(:) => null() !Lower error for "z" + integer(ids_int) :: z_error_index=ids_int_invalid !Index in the error_description list for "z" + real(ids_real), pointer :: phi(:) => null() !Toroidal angle + real(ids_real), pointer :: phi_error_upper(:) => null() !Upper error for "phi" + real(ids_real), pointer :: phi_error_lower(:) => null() !Lower error for "phi" + integer(ids_int) :: phi_error_index=ids_int_invalid !Index in the error_description list for "phi" + real(ids_real), pointer :: psi(:) => null() !Poloidal flux + real(ids_real), pointer :: psi_error_upper(:) => null() !Upper error for "psi" + real(ids_real), pointer :: psi_error_lower(:) => null() !Lower error for "psi" + integer(ids_int) :: psi_error_index=ids_int_invalid !Index in the error_description list for "psi" + real(ids_real), pointer :: theta(:) => null() !Poloidal angle + real(ids_real), pointer :: theta_error_upper(:) => null() !Upper error for "theta" + real(ids_real), pointer :: theta_error_lower(:) => null() !Lower error for "theta" + integer(ids_int) :: theta_error_index=ids_int_invalid !Index in the error_description list for "theta" + end type + + type :: ids_waves_coherent_wave_beam_tracing_beam_k + real(ids_real), pointer :: k_r(:) => null() !Wave vector component in the major radius direction + real(ids_real), pointer :: k_r_error_upper(:) => null() !Upper error for "k_r" + real(ids_real), pointer :: k_r_error_lower(:) => null() !Lower error for "k_r" + integer(ids_int) :: k_r_error_index=ids_int_invalid !Index in the error_description list for "k_r" + real(ids_real), pointer :: k_z(:) => null() !Wave vector component in the vertical direction + real(ids_real), pointer :: k_z_error_upper(:) => null() !Upper error for "k_z" + real(ids_real), pointer :: k_z_error_lower(:) => null() !Lower error for "k_z" + integer(ids_int) :: k_z_error_index=ids_int_invalid !Index in the error_description list for "k_z" + real(ids_real), pointer :: k_tor(:) => null() !Wave vector component in the toroidal direction + real(ids_real), pointer :: k_tor_error_upper(:) => null() !Upper error for "k_tor" + real(ids_real), pointer :: k_tor_error_lower(:) => null() !Lower error for "k_tor" + integer(ids_int) :: k_tor_error_index=ids_int_invalid !Index in the error_description list for "k_tor" + real(ids_real), pointer :: n_parallel(:) => null() !Parallel refractive index + real(ids_real), pointer :: n_parallel_error_upper(:) => null() !Upper error for "n_parallel" + real(ids_real), pointer :: n_parallel_error_lower(:) => null() !Lower error for "n_parallel" + integer(ids_int) :: n_parallel_error_index=ids_int_invalid !Index in the error_description list for "n_parallel" + real(ids_real), pointer :: n_perpendicular(:) => null() !Perpendicular refractive index + real(ids_real), pointer :: n_perpendicular_error_upper(:) => null() !Upper error for "n_perpendicular" + real(ids_real), pointer :: n_perpendicular_error_lower(:) => null() !Lower error for "n_perpendicular" + integer(ids_int) :: n_perpendicular_error_index=ids_int_invalid !Index in the error_description list for "n_perpendicular" + integer(ids_int), pointer :: n_tor(:) => null() !Toroidal wave number, contains a single value if varying_ntor = 1 to avoid useless repetition constant values + integer(ids_int) :: varying_n_tor=ids_int_invalid !Flag telling whether n_tor is constant along the ray path (0) or varying (1) + end type + + type :: ids_waves_CPX_1D + real(ids_real), pointer :: real(:) => null() !Real part + real(ids_real), pointer :: real_error_upper(:) => null() !Upper error for "real" + real(ids_real), pointer :: real_error_lower(:) => null() !Lower error for "real" + integer(ids_int) :: real_error_index=ids_int_invalid !Index in the error_description list for "real" + real(ids_real), pointer :: imaginary(:) => null() !Imaginary part + real(ids_real), pointer :: imaginary_error_upper(:) => null() !Upper error for "imaginary" + real(ids_real), pointer :: imaginary_error_lower(:) => null() !Lower error for "imaginary" + integer(ids_int) :: imaginary_error_index=ids_int_invalid !Index in the error_description list for "imaginary" + end type + + type :: ids_waves_coherent_wave_beam_tracing_beam_e_field + type(ids_waves_CPX_1D) :: plus !Left hand polarised electric field component + type(ids_waves_CPX_1D) :: minus !Right hand polarised electric field component + type(ids_waves_CPX_1D) :: parallel !Parallel to magnetic field polarised electric field component + end type + + type :: ids_waves_coherent_wave_beam_tracing_power_flow + real(ids_real), pointer :: perpendicular(:) => null() !Normalized power flow in the direction perpendicular to the magnetic field + real(ids_real), pointer :: perpendicular_error_upper(:) => null() !Upper error for "perpendicular" + real(ids_real), pointer :: perpendicular_error_lower(:) => null() !Lower error for "perpendicular" + integer(ids_int) :: perpendicular_error_index=ids_int_invalid !Index in the error_description list for "perpendicular" + real(ids_real), pointer :: parallel(:) => null() !Normalized power flow in the direction parallel to the magnetic field + real(ids_real), pointer :: parallel_error_upper(:) => null() !Upper error for "parallel" + real(ids_real), pointer :: parallel_error_lower(:) => null() !Lower error for "parallel" + integer(ids_int) :: parallel_error_index=ids_int_invalid !Index in the error_description list for "parallel" + end type + + type :: ids_waves_coherent_wave_beam_tracing_electrons + real(ids_real), pointer :: power(:) => null() !Power absorbed along the beam by the species + real(ids_real), pointer :: power_error_upper(:) => null() !Upper error for "power" + real(ids_real), pointer :: power_error_lower(:) => null() !Lower error for "power" + integer(ids_int) :: power_error_index=ids_int_invalid !Index in the error_description list for "power" + end type + + type :: ids_waves_coherent_wave_beam_tracing_ion_state + real(ids_real) :: z_min=ids_real_invalid !Minimum Z of the charge state bundle (z_min = z_max = 0 for a neutral) + real(ids_real) :: z_min_error_upper=ids_real_invalid !Upper error for "z_min" + real(ids_real) :: z_min_error_lower=ids_real_invalid !Lower error for "z_min" + integer(ids_int) :: z_min_error_index=ids_int_invalid !Index in the error_description list for "z_min" + real(ids_real) :: z_max=ids_real_invalid !Maximum Z of the charge state bundle (equal to z_min if no bundle) + real(ids_real) :: z_max_error_upper=ids_real_invalid !Upper error for "z_max" + real(ids_real) :: z_max_error_lower=ids_real_invalid !Lower error for "z_max" + integer(ids_int) :: z_max_error_index=ids_int_invalid !Index in the error_description list for "z_max" + character(len=ids_string_length), dimension(:), pointer :: label => null() !String identifying charge state (e.g. C+, C+2 , C+3, C+4, C+5, C+6, ...) + character(len=ids_string_length), dimension(:), pointer :: electron_configuration => null() !Configuration of atomic orbitals of this state, e.g. 1s2-2s1 + real(ids_real) :: vibrational_level=ids_real_invalid !Vibrational level (can be bundled) + real(ids_real) :: vibrational_level_error_upper=ids_real_invalid !Upper error for "vibrational_level" + real(ids_real) :: vibrational_level_error_lower=ids_real_invalid !Lower error for "vibrational_level" + integer(ids_int) :: vibrational_level_error_index=ids_int_invalid !Index in the error_description list for "vibrational_level" + character(len=ids_string_length), dimension(:), pointer :: vibrational_mode => null() !Vibrational mode of this state, e.g. "A_g". Need to define, or adopt a standard nomenclature. + real(ids_real), pointer :: power(:) => null() !Power absorbed along the beam by the species + real(ids_real), pointer :: power_error_upper(:) => null() !Upper error for "power" + real(ids_real), pointer :: power_error_lower(:) => null() !Lower error for "power" + integer(ids_int) :: power_error_index=ids_int_invalid !Index in the error_description list for "power" + end type + + type :: ids_waves_coherent_wave_beam_tracing_ion + type(ids_plasma_composition_neutral_element), pointer :: element(:) => null() !List of elements forming the atom or molecule + real(ids_real) :: z_ion=ids_real_invalid !Ion charge (of the dominant ionisation state; lumped ions are allowed). + real(ids_real) :: z_ion_error_upper=ids_real_invalid !Upper error for "z_ion" + real(ids_real) :: z_ion_error_lower=ids_real_invalid !Lower error for "z_ion" + integer(ids_int) :: z_ion_error_index=ids_int_invalid !Index in the error_description list for "z_ion" + character(len=ids_string_length), dimension(:), pointer :: label => null() !String identifying the species (e.g. H+, D+, T+, He+2, C+, D2, DT, CD4, ...) + real(ids_real), pointer :: power(:) => null() !Power absorbed along the beam by the species + real(ids_real), pointer :: power_error_upper(:) => null() !Upper error for "power" + real(ids_real), pointer :: power_error_lower(:) => null() !Lower error for "power" + integer(ids_int) :: power_error_index=ids_int_invalid !Index in the error_description list for "power" + integer(ids_int) :: multiple_states_flag=ids_int_invalid !Multiple state calculation flag : 0-Only one state is considered; 1-Multiple states are considered and are described in the state ! + !structure + type(ids_waves_coherent_wave_beam_tracing_ion_state), pointer :: state(:) => null() !Collisional exchange with the various states of the ion species (ionisation, energy, excitation, ...) + end type + + type :: ids_waves_coherent_wave_beam_tracing_beam + real(ids_real) :: power_initial=ids_real_invalid !Initial power in the ray/beam + real(ids_real) :: power_initial_error_upper=ids_real_invalid !Upper error for "power_initial" + real(ids_real) :: power_initial_error_lower=ids_real_invalid !Lower error for "power_initial" + integer(ids_int) :: power_initial_error_index=ids_int_invalid !Index in the error_description list for "power_initial" + real(ids_real), pointer :: length(:) => null() !Ray/beam curvilinear length + real(ids_real), pointer :: length_error_upper(:) => null() !Upper error for "length" + real(ids_real), pointer :: length_error_lower(:) => null() !Lower error for "length" + integer(ids_int) :: length_error_index=ids_int_invalid !Index in the error_description list for "length" + type(ids_waves_rzphipsitheta1d_dynamic_aos3) :: position !Position of the ray/beam along its path + type(ids_waves_coherent_wave_beam_tracing_beam_k) :: wave_vector !Wave vector of the ray/beam along its path + type(ids_waves_coherent_wave_beam_tracing_beam_e_field) :: e_field !Electric field polarization of the ray/beam along its path + type(ids_waves_coherent_wave_beam_tracing_power_flow) :: power_flow_norm !Normalised power flow + type(ids_waves_coherent_wave_beam_tracing_electrons) :: electrons !Quantities related to the electrons + type(ids_waves_coherent_wave_beam_tracing_ion), pointer :: ion(:) => null() !Quantities related to the different ion species + end type + + type :: ids_waves_coherent_wave_beam_tracing + type(ids_waves_coherent_wave_beam_tracing_beam), pointer :: beam(:) => null() !Set of rays/beams describing the wave propagation + real(ids_real) :: time=ids_real_invalid !Time + end type + + type :: ids_waves_coherent_wave_full_wave_e_field + type(ids_generic_grid_scalar), pointer :: plus(:) => null() !Left hand circularly polarised component of the perpendicular (to the static magnetic field) electric field, given on various grid! + ! subsets + type(ids_generic_grid_scalar), pointer :: minus(:) => null() !Right hand circularly polarised component of the perpendicular (to the static magnetic field) electric field, given on various gri! + !d subsets + type(ids_generic_grid_scalar), pointer :: parallel(:) => null() !Parallel (to the static magnetic field) component of electric field, given on various grid subsets + type(ids_generic_grid_scalar), pointer :: normal(:) => null() !Magnitude of wave electric field normal to a flux surface, given on various grid subsets + type(ids_generic_grid_scalar), pointer :: bi_normal(:) => null() !Magnitude of perpendicular (to the static magnetic field) wave electric field tangent to a flux surface, given on various grid sub! + !sets + end type + + type :: ids_waves_coherent_wave_full_wave_b_field + type(ids_generic_grid_scalar), pointer :: parallel(:) => null() !Parallel (to the static magnetic field) component of the wave magnetic field, given on various grid subsets + type(ids_generic_grid_scalar), pointer :: normal(:) => null() !Magnitude of wave magnetic field normal to a flux surface, given on various grid subsets + type(ids_generic_grid_scalar), pointer :: bi_normal(:) => null() !Magnitude of perpendicular (to the static magnetic field) wave magnetic field tangent to a flux surface, given on various grid sub! + !sets + end type + + type :: ids_waves_coherent_wave_full_wave + type(ids_generic_grid_dynamic) :: grid !Grid description + type(ids_waves_coherent_wave_full_wave_e_field) :: e_field !Components of the wave electric field + type(ids_waves_coherent_wave_full_wave_b_field) :: b_field !Components of the wave magnetic field + type(ids_generic_grid_scalar), pointer :: k_perpendicular(:) => null() !Perpendicular wave vector, given on various grid subsets + real(ids_real) :: time=ids_real_invalid !Time + end type + + type :: ids_waves_coherent_wave + type(ids_waves_coherent_wave_identifier) :: identifier !Identifier of the coherent wave, in terms of the type and name of the antenna driving the wave and an index separating waves drive! + !n by the same antenna. + type(ids_identifier) :: wave_solver_type !Type of wave deposition solver used for this wave. Index = 1 for beam/ray tracing; index = 2 for full wave + type(ids_waves_coherent_wave_global_quantities), pointer :: global_quantities(:) => null() !Global quantities for various time slices + type(ids_waves_coherent_wave_profiles_1d), pointer :: profiles_1d(:) => null() !Source radial profiles (flux surface averaged quantities) for various time slices + type(ids_waves_coherent_wave_profiles_2d), pointer :: profiles_2d(:) => null() !2D profiles in poloidal cross-section, for various time slices + type(ids_waves_coherent_wave_beam_tracing), pointer :: beam_tracing(:) => null() !Beam tracing calculations, for various time slices + type(ids_waves_coherent_wave_full_wave), pointer :: full_wave(:) => null() !Solution by a full wave code, given on a generic grid description, for various time slices + end type + + + ! *********** waves IDS + type, extends(IDS_base) :: ids_waves !RF wave propagation and deposition. Note that current estimates in this IDS are a priori not taking into account synergies between! + ! multiple sources (a convergence loop with Fokker-Planck calculations is required to account for such synergies) + logical, private :: c_data = .FALSE. ! Fortran specific metadata telling whether the IDS has been populated from C allocated data (LL) or not + integer, private :: max_occurrence = 8! Maximum occurrence allowed as defined in the DD + + type(ids_ids_properties) :: ids_properties !Interface Data Structure properties. This element identifies the node above as an IDS + type(ids_waves_coherent_wave), pointer :: coherent_wave(:) => null() !Wave description for each frequency + type(ids_b_tor_vacuum_1) :: vacuum_toroidal_field !Characteristics of the vacuum toroidal field (used in rho_tor definition) + type(ids_rz1d_dynamic_1) :: magnetic_axis !Magnetic axis position (used to define a poloidal angle for the 2D profiles) + type(ids_code) :: code !Generic decription of the code-specific parameters for the code that has produced this IDS + real(ids_real), pointer :: time(:) => null() !Generic time + end type + + ! *********** workflow IDS internal structures declaration + + type :: ids_workflow_component + integer(ids_int) :: index=ids_int_invalid !Index of the component in the ../../../component array + integer(ids_int) :: execution_mode=ids_int_invalid !Component execution mode for current workflow cycle. 0 means the component is not executed and the workflow uses results from prev! + !ious workflow cycle. 1 means the component is executed for this workflow cycle. + real(ids_real) :: time_interval=ids_real_invalid !Simulation time interval during which this component has to compute its results. + real(ids_real) :: time_interval_error_upper=ids_real_invalid !Upper error for "time_interval" + real(ids_real) :: time_interval_error_lower=ids_real_invalid !Lower error for "time_interval" + integer(ids_int) :: time_interval_error_index=ids_int_invalid !Index in the error_description list for "time_interval" + real(ids_real), pointer :: control_float(:) => null() !Array of real workflow control parameters used by this component (component specific) + real(ids_real), pointer :: control_float_error_upper(:) => null() !Upper error for "control_float" + real(ids_real), pointer :: control_float_error_lower(:) => null() !Lower error for "control_float" + integer(ids_int) :: control_float_error_index=ids_int_invalid !Index in the error_description list for "control_float" + integer(ids_int), pointer :: control_integer(:) => null() !Array of integer workflow control parameters used by this component (component specific) + end type + + type :: ids_workflow_cycle + type(ids_workflow_component), pointer :: component(:) => null() !Control parameters for the set of participting components defined in ../../component + real(ids_real) :: time=ids_real_invalid !Time + end type + + type :: ids_workflow_time_loop + type(ids_code_constant), pointer :: component(:) => null() !List of components partcipating in the workflow + real(ids_real) :: time_end=ids_real_invalid !Termination time for the workflow main time loop + real(ids_real) :: time_end_error_upper=ids_real_invalid !Upper error for "time_end" + real(ids_real) :: time_end_error_lower=ids_real_invalid !Lower error for "time_end" + integer(ids_int) :: time_end_error_index=ids_int_invalid !Index in the error_description list for "time_end" + type(ids_workflow_cycle), pointer :: workflow_cycle(:) => null() !Set of time slices corresponding to the beginning of workflow cycles (main time loop of the workflow). During each workflow cycle,! + ! active components compute their result during their given time_interval. Components having completed their computation are frozen! + ! until the end of the workflow cycle. The next workflow cycle begins when the maximum time_interval (over the components) has been! + ! reached. + end type + + + ! *********** workflow IDS + type, extends(IDS_base) :: ids_workflow !Description of the workflow that has produced this data entry. The workflow IDS can also be used to communicate information about ! + !workflow state between workflow components. + logical, private :: c_data = .FALSE. ! Fortran specific metadata telling whether the IDS has been populated from C allocated data (LL) or not + integer, private :: max_occurrence = 1! Maximum occurrence allowed as defined in the DD + + type(ids_ids_properties) :: ids_properties !Interface Data Structure properties. This element identifies the node above as an IDS + type(ids_workflow_time_loop) :: time_loop !Description of a workflow based on a time loop which calls components defined in component_list sequentially during each cycle of! + ! the loop (workflow_cycle). + type(ids_code) :: code !Generic decription of the code-specific parameters for the code that has produced this IDS + real(ids_real), pointer :: time(:) => null() !Generic time + end type + + + +contains + + + subroutine set_c_data_amns_data(ids, bool) + type(ids_amns_data), intent(inout) :: ids + logical, intent(in) :: bool + ids%c_data = bool + end subroutine + subroutine is_c_data_amns_data(ids, bool) + type(ids_amns_data), intent(in) :: ids + logical, intent(out) :: bool + bool = ids%c_data + end subroutine + + subroutine set_c_data_barometry(ids, bool) + type(ids_barometry), intent(inout) :: ids + logical, intent(in) :: bool + ids%c_data = bool + end subroutine + subroutine is_c_data_barometry(ids, bool) + type(ids_barometry), intent(in) :: ids + logical, intent(out) :: bool + bool = ids%c_data + end subroutine + + subroutine set_c_data_bolometer(ids, bool) + type(ids_bolometer), intent(inout) :: ids + logical, intent(in) :: bool + ids%c_data = bool + end subroutine + subroutine is_c_data_bolometer(ids, bool) + type(ids_bolometer), intent(in) :: ids + logical, intent(out) :: bool + bool = ids%c_data + end subroutine + + subroutine set_c_data_bremsstrahlung_visible(ids, bool) + type(ids_bremsstrahlung_visible), intent(inout) :: ids + logical, intent(in) :: bool + ids%c_data = bool + end subroutine + subroutine is_c_data_bremsstrahlung_visible(ids, bool) + type(ids_bremsstrahlung_visible), intent(in) :: ids + logical, intent(out) :: bool + bool = ids%c_data + end subroutine + + subroutine set_c_data_calorimetry(ids, bool) + type(ids_calorimetry), intent(inout) :: ids + logical, intent(in) :: bool + ids%c_data = bool + end subroutine + subroutine is_c_data_calorimetry(ids, bool) + type(ids_calorimetry), intent(in) :: ids + logical, intent(out) :: bool + bool = ids%c_data + end subroutine + + subroutine set_c_data_camera_ir(ids, bool) + type(ids_camera_ir), intent(inout) :: ids + logical, intent(in) :: bool + ids%c_data = bool + end subroutine + subroutine is_c_data_camera_ir(ids, bool) + type(ids_camera_ir), intent(in) :: ids + logical, intent(out) :: bool + bool = ids%c_data + end subroutine + + subroutine set_c_data_camera_visible(ids, bool) + type(ids_camera_visible), intent(inout) :: ids + logical, intent(in) :: bool + ids%c_data = bool + end subroutine + subroutine is_c_data_camera_visible(ids, bool) + type(ids_camera_visible), intent(in) :: ids + logical, intent(out) :: bool + bool = ids%c_data + end subroutine + + subroutine set_c_data_camera_x_rays(ids, bool) + type(ids_camera_x_rays), intent(inout) :: ids + logical, intent(in) :: bool + ids%c_data = bool + end subroutine + subroutine is_c_data_camera_x_rays(ids, bool) + type(ids_camera_x_rays), intent(in) :: ids + logical, intent(out) :: bool + bool = ids%c_data + end subroutine + + subroutine set_c_data_charge_exchange(ids, bool) + type(ids_charge_exchange), intent(inout) :: ids + logical, intent(in) :: bool + ids%c_data = bool + end subroutine + subroutine is_c_data_charge_exchange(ids, bool) + type(ids_charge_exchange), intent(in) :: ids + logical, intent(out) :: bool + bool = ids%c_data + end subroutine + + subroutine set_c_data_coils_non_axisymmetric(ids, bool) + type(ids_coils_non_axisymmetric), intent(inout) :: ids + logical, intent(in) :: bool + ids%c_data = bool + end subroutine + subroutine is_c_data_coils_non_axisymmetric(ids, bool) + type(ids_coils_non_axisymmetric), intent(in) :: ids + logical, intent(out) :: bool + bool = ids%c_data + end subroutine + + subroutine set_c_data_controllers(ids, bool) + type(ids_controllers), intent(inout) :: ids + logical, intent(in) :: bool + ids%c_data = bool + end subroutine + subroutine is_c_data_controllers(ids, bool) + type(ids_controllers), intent(in) :: ids + logical, intent(out) :: bool + bool = ids%c_data + end subroutine + + subroutine set_c_data_core_instant_changes(ids, bool) + type(ids_core_instant_changes), intent(inout) :: ids + logical, intent(in) :: bool + ids%c_data = bool + end subroutine + subroutine is_c_data_core_instant_changes(ids, bool) + type(ids_core_instant_changes), intent(in) :: ids + logical, intent(out) :: bool + bool = ids%c_data + end subroutine + + subroutine set_c_data_core_profiles(ids, bool) + type(ids_core_profiles), intent(inout) :: ids + logical, intent(in) :: bool + ids%c_data = bool + end subroutine + subroutine is_c_data_core_profiles(ids, bool) + type(ids_core_profiles), intent(in) :: ids + logical, intent(out) :: bool + bool = ids%c_data + end subroutine + + subroutine set_c_data_core_sources(ids, bool) + type(ids_core_sources), intent(inout) :: ids + logical, intent(in) :: bool + ids%c_data = bool + end subroutine + subroutine is_c_data_core_sources(ids, bool) + type(ids_core_sources), intent(in) :: ids + logical, intent(out) :: bool + bool = ids%c_data + end subroutine + + subroutine set_c_data_core_transport(ids, bool) + type(ids_core_transport), intent(inout) :: ids + logical, intent(in) :: bool + ids%c_data = bool + end subroutine + subroutine is_c_data_core_transport(ids, bool) + type(ids_core_transport), intent(in) :: ids + logical, intent(out) :: bool + bool = ids%c_data + end subroutine + + subroutine set_c_data_cryostat(ids, bool) + type(ids_cryostat), intent(inout) :: ids + logical, intent(in) :: bool + ids%c_data = bool + end subroutine + subroutine is_c_data_cryostat(ids, bool) + type(ids_cryostat), intent(in) :: ids + logical, intent(out) :: bool + bool = ids%c_data + end subroutine + + subroutine set_c_data_dataset_description(ids, bool) + type(ids_dataset_description), intent(inout) :: ids + logical, intent(in) :: bool + ids%c_data = bool + end subroutine + subroutine is_c_data_dataset_description(ids, bool) + type(ids_dataset_description), intent(in) :: ids + logical, intent(out) :: bool + bool = ids%c_data + end subroutine + + subroutine set_c_data_dataset_fair(ids, bool) + type(ids_dataset_fair), intent(inout) :: ids + logical, intent(in) :: bool + ids%c_data = bool + end subroutine + subroutine is_c_data_dataset_fair(ids, bool) + type(ids_dataset_fair), intent(in) :: ids + logical, intent(out) :: bool + bool = ids%c_data + end subroutine + + subroutine set_c_data_disruption(ids, bool) + type(ids_disruption), intent(inout) :: ids + logical, intent(in) :: bool + ids%c_data = bool + end subroutine + subroutine is_c_data_disruption(ids, bool) + type(ids_disruption), intent(in) :: ids + logical, intent(out) :: bool + bool = ids%c_data + end subroutine + + subroutine set_c_data_distribution_sources(ids, bool) + type(ids_distribution_sources), intent(inout) :: ids + logical, intent(in) :: bool + ids%c_data = bool + end subroutine + subroutine is_c_data_distribution_sources(ids, bool) + type(ids_distribution_sources), intent(in) :: ids + logical, intent(out) :: bool + bool = ids%c_data + end subroutine + + subroutine set_c_data_distributions(ids, bool) + type(ids_distributions), intent(inout) :: ids + logical, intent(in) :: bool + ids%c_data = bool + end subroutine + subroutine is_c_data_distributions(ids, bool) + type(ids_distributions), intent(in) :: ids + logical, intent(out) :: bool + bool = ids%c_data + end subroutine + + subroutine set_c_data_divertors(ids, bool) + type(ids_divertors), intent(inout) :: ids + logical, intent(in) :: bool + ids%c_data = bool + end subroutine + subroutine is_c_data_divertors(ids, bool) + type(ids_divertors), intent(in) :: ids + logical, intent(out) :: bool + bool = ids%c_data + end subroutine + + subroutine set_c_data_ec_launchers(ids, bool) + type(ids_ec_launchers), intent(inout) :: ids + logical, intent(in) :: bool + ids%c_data = bool + end subroutine + subroutine is_c_data_ec_launchers(ids, bool) + type(ids_ec_launchers), intent(in) :: ids + logical, intent(out) :: bool + bool = ids%c_data + end subroutine + + subroutine set_c_data_ece(ids, bool) + type(ids_ece), intent(inout) :: ids + logical, intent(in) :: bool + ids%c_data = bool + end subroutine + subroutine is_c_data_ece(ids, bool) + type(ids_ece), intent(in) :: ids + logical, intent(out) :: bool + bool = ids%c_data + end subroutine + + subroutine set_c_data_edge_profiles(ids, bool) + type(ids_edge_profiles), intent(inout) :: ids + logical, intent(in) :: bool + ids%c_data = bool + end subroutine + subroutine is_c_data_edge_profiles(ids, bool) + type(ids_edge_profiles), intent(in) :: ids + logical, intent(out) :: bool + bool = ids%c_data + end subroutine + + subroutine set_c_data_edge_sources(ids, bool) + type(ids_edge_sources), intent(inout) :: ids + logical, intent(in) :: bool + ids%c_data = bool + end subroutine + subroutine is_c_data_edge_sources(ids, bool) + type(ids_edge_sources), intent(in) :: ids + logical, intent(out) :: bool + bool = ids%c_data + end subroutine + + subroutine set_c_data_edge_transport(ids, bool) + type(ids_edge_transport), intent(inout) :: ids + logical, intent(in) :: bool + ids%c_data = bool + end subroutine + subroutine is_c_data_edge_transport(ids, bool) + type(ids_edge_transport), intent(in) :: ids + logical, intent(out) :: bool + bool = ids%c_data + end subroutine + + subroutine set_c_data_em_coupling(ids, bool) + type(ids_em_coupling), intent(inout) :: ids + logical, intent(in) :: bool + ids%c_data = bool + end subroutine + subroutine is_c_data_em_coupling(ids, bool) + type(ids_em_coupling), intent(in) :: ids + logical, intent(out) :: bool + bool = ids%c_data + end subroutine + + subroutine set_c_data_equilibrium(ids, bool) + type(ids_equilibrium), intent(inout) :: ids + logical, intent(in) :: bool + ids%c_data = bool + end subroutine + subroutine is_c_data_equilibrium(ids, bool) + type(ids_equilibrium), intent(in) :: ids + logical, intent(out) :: bool + bool = ids%c_data + end subroutine + + subroutine set_c_data_gas_injection(ids, bool) + type(ids_gas_injection), intent(inout) :: ids + logical, intent(in) :: bool + ids%c_data = bool + end subroutine + subroutine is_c_data_gas_injection(ids, bool) + type(ids_gas_injection), intent(in) :: ids + logical, intent(out) :: bool + bool = ids%c_data + end subroutine + + subroutine set_c_data_gas_pumping(ids, bool) + type(ids_gas_pumping), intent(inout) :: ids + logical, intent(in) :: bool + ids%c_data = bool + end subroutine + subroutine is_c_data_gas_pumping(ids, bool) + type(ids_gas_pumping), intent(in) :: ids + logical, intent(out) :: bool + bool = ids%c_data + end subroutine + + subroutine set_c_data_gyrokinetics(ids, bool) + type(ids_gyrokinetics), intent(inout) :: ids + logical, intent(in) :: bool + ids%c_data = bool + end subroutine + subroutine is_c_data_gyrokinetics(ids, bool) + type(ids_gyrokinetics), intent(in) :: ids + logical, intent(out) :: bool + bool = ids%c_data + end subroutine + + subroutine set_c_data_hard_x_rays(ids, bool) + type(ids_hard_x_rays), intent(inout) :: ids + logical, intent(in) :: bool + ids%c_data = bool + end subroutine + subroutine is_c_data_hard_x_rays(ids, bool) + type(ids_hard_x_rays), intent(in) :: ids + logical, intent(out) :: bool + bool = ids%c_data + end subroutine + + subroutine set_c_data_ic_antennas(ids, bool) + type(ids_ic_antennas), intent(inout) :: ids + logical, intent(in) :: bool + ids%c_data = bool + end subroutine + subroutine is_c_data_ic_antennas(ids, bool) + type(ids_ic_antennas), intent(in) :: ids + logical, intent(out) :: bool + bool = ids%c_data + end subroutine + + subroutine set_c_data_interferometer(ids, bool) + type(ids_interferometer), intent(inout) :: ids + logical, intent(in) :: bool + ids%c_data = bool + end subroutine + subroutine is_c_data_interferometer(ids, bool) + type(ids_interferometer), intent(in) :: ids + logical, intent(out) :: bool + bool = ids%c_data + end subroutine + + subroutine set_c_data_iron_core(ids, bool) + type(ids_iron_core), intent(inout) :: ids + logical, intent(in) :: bool + ids%c_data = bool + end subroutine + subroutine is_c_data_iron_core(ids, bool) + type(ids_iron_core), intent(in) :: ids + logical, intent(out) :: bool + bool = ids%c_data + end subroutine + + subroutine set_c_data_langmuir_probes(ids, bool) + type(ids_langmuir_probes), intent(inout) :: ids + logical, intent(in) :: bool + ids%c_data = bool + end subroutine + subroutine is_c_data_langmuir_probes(ids, bool) + type(ids_langmuir_probes), intent(in) :: ids + logical, intent(out) :: bool + bool = ids%c_data + end subroutine + + subroutine set_c_data_lh_antennas(ids, bool) + type(ids_lh_antennas), intent(inout) :: ids + logical, intent(in) :: bool + ids%c_data = bool + end subroutine + subroutine is_c_data_lh_antennas(ids, bool) + type(ids_lh_antennas), intent(in) :: ids + logical, intent(out) :: bool + bool = ids%c_data + end subroutine + + subroutine set_c_data_magnetics(ids, bool) + type(ids_magnetics), intent(inout) :: ids + logical, intent(in) :: bool + ids%c_data = bool + end subroutine + subroutine is_c_data_magnetics(ids, bool) + type(ids_magnetics), intent(in) :: ids + logical, intent(out) :: bool + bool = ids%c_data + end subroutine + + subroutine set_c_data_mhd(ids, bool) + type(ids_mhd), intent(inout) :: ids + logical, intent(in) :: bool + ids%c_data = bool + end subroutine + subroutine is_c_data_mhd(ids, bool) + type(ids_mhd), intent(in) :: ids + logical, intent(out) :: bool + bool = ids%c_data + end subroutine + + subroutine set_c_data_mhd_linear(ids, bool) + type(ids_mhd_linear), intent(inout) :: ids + logical, intent(in) :: bool + ids%c_data = bool + end subroutine + subroutine is_c_data_mhd_linear(ids, bool) + type(ids_mhd_linear), intent(in) :: ids + logical, intent(out) :: bool + bool = ids%c_data + end subroutine + + subroutine set_c_data_mse(ids, bool) + type(ids_mse), intent(inout) :: ids + logical, intent(in) :: bool + ids%c_data = bool + end subroutine + subroutine is_c_data_mse(ids, bool) + type(ids_mse), intent(in) :: ids + logical, intent(out) :: bool + bool = ids%c_data + end subroutine + + subroutine set_c_data_nbi(ids, bool) + type(ids_nbi), intent(inout) :: ids + logical, intent(in) :: bool + ids%c_data = bool + end subroutine + subroutine is_c_data_nbi(ids, bool) + type(ids_nbi), intent(in) :: ids + logical, intent(out) :: bool + bool = ids%c_data + end subroutine + + subroutine set_c_data_neutron_diagnostic(ids, bool) + type(ids_neutron_diagnostic), intent(inout) :: ids + logical, intent(in) :: bool + ids%c_data = bool + end subroutine + subroutine is_c_data_neutron_diagnostic(ids, bool) + type(ids_neutron_diagnostic), intent(in) :: ids + logical, intent(out) :: bool + bool = ids%c_data + end subroutine + + subroutine set_c_data_ntms(ids, bool) + type(ids_ntms), intent(inout) :: ids + logical, intent(in) :: bool + ids%c_data = bool + end subroutine + subroutine is_c_data_ntms(ids, bool) + type(ids_ntms), intent(in) :: ids + logical, intent(out) :: bool + bool = ids%c_data + end subroutine + + subroutine set_c_data_pellets(ids, bool) + type(ids_pellets), intent(inout) :: ids + logical, intent(in) :: bool + ids%c_data = bool + end subroutine + subroutine is_c_data_pellets(ids, bool) + type(ids_pellets), intent(in) :: ids + logical, intent(out) :: bool + bool = ids%c_data + end subroutine + + subroutine set_c_data_pf_active(ids, bool) + type(ids_pf_active), intent(inout) :: ids + logical, intent(in) :: bool + ids%c_data = bool + end subroutine + subroutine is_c_data_pf_active(ids, bool) + type(ids_pf_active), intent(in) :: ids + logical, intent(out) :: bool + bool = ids%c_data + end subroutine + + subroutine set_c_data_pf_passive(ids, bool) + type(ids_pf_passive), intent(inout) :: ids + logical, intent(in) :: bool + ids%c_data = bool + end subroutine + subroutine is_c_data_pf_passive(ids, bool) + type(ids_pf_passive), intent(in) :: ids + logical, intent(out) :: bool + bool = ids%c_data + end subroutine + + subroutine set_c_data_plasma_initiation(ids, bool) + type(ids_plasma_initiation), intent(inout) :: ids + logical, intent(in) :: bool + ids%c_data = bool + end subroutine + subroutine is_c_data_plasma_initiation(ids, bool) + type(ids_plasma_initiation), intent(in) :: ids + logical, intent(out) :: bool + bool = ids%c_data + end subroutine + + subroutine set_c_data_polarimeter(ids, bool) + type(ids_polarimeter), intent(inout) :: ids + logical, intent(in) :: bool + ids%c_data = bool + end subroutine + subroutine is_c_data_polarimeter(ids, bool) + type(ids_polarimeter), intent(in) :: ids + logical, intent(out) :: bool + bool = ids%c_data + end subroutine + + subroutine set_c_data_pulse_schedule(ids, bool) + type(ids_pulse_schedule), intent(inout) :: ids + logical, intent(in) :: bool + ids%c_data = bool + end subroutine + subroutine is_c_data_pulse_schedule(ids, bool) + type(ids_pulse_schedule), intent(in) :: ids + logical, intent(out) :: bool + bool = ids%c_data + end subroutine + + subroutine set_c_data_radiation(ids, bool) + type(ids_radiation), intent(inout) :: ids + logical, intent(in) :: bool + ids%c_data = bool + end subroutine + subroutine is_c_data_radiation(ids, bool) + type(ids_radiation), intent(in) :: ids + logical, intent(out) :: bool + bool = ids%c_data + end subroutine + + subroutine set_c_data_real_time_data(ids, bool) + type(ids_real_time_data), intent(inout) :: ids + logical, intent(in) :: bool + ids%c_data = bool + end subroutine + subroutine is_c_data_real_time_data(ids, bool) + type(ids_real_time_data), intent(in) :: ids + logical, intent(out) :: bool + bool = ids%c_data + end subroutine + + subroutine set_c_data_reflectometer_profile(ids, bool) + type(ids_reflectometer_profile), intent(inout) :: ids + logical, intent(in) :: bool + ids%c_data = bool + end subroutine + subroutine is_c_data_reflectometer_profile(ids, bool) + type(ids_reflectometer_profile), intent(in) :: ids + logical, intent(out) :: bool + bool = ids%c_data + end subroutine + + subroutine set_c_data_refractometer(ids, bool) + type(ids_refractometer), intent(inout) :: ids + logical, intent(in) :: bool + ids%c_data = bool + end subroutine + subroutine is_c_data_refractometer(ids, bool) + type(ids_refractometer), intent(in) :: ids + logical, intent(out) :: bool + bool = ids%c_data + end subroutine + + subroutine set_c_data_sawteeth(ids, bool) + type(ids_sawteeth), intent(inout) :: ids + logical, intent(in) :: bool + ids%c_data = bool + end subroutine + subroutine is_c_data_sawteeth(ids, bool) + type(ids_sawteeth), intent(in) :: ids + logical, intent(out) :: bool + bool = ids%c_data + end subroutine + + subroutine set_c_data_soft_x_rays(ids, bool) + type(ids_soft_x_rays), intent(inout) :: ids + logical, intent(in) :: bool + ids%c_data = bool + end subroutine + subroutine is_c_data_soft_x_rays(ids, bool) + type(ids_soft_x_rays), intent(in) :: ids + logical, intent(out) :: bool + bool = ids%c_data + end subroutine + + subroutine set_c_data_spectrometer_mass(ids, bool) + type(ids_spectrometer_mass), intent(inout) :: ids + logical, intent(in) :: bool + ids%c_data = bool + end subroutine + subroutine is_c_data_spectrometer_mass(ids, bool) + type(ids_spectrometer_mass), intent(in) :: ids + logical, intent(out) :: bool + bool = ids%c_data + end subroutine + + subroutine set_c_data_spectrometer_uv(ids, bool) + type(ids_spectrometer_uv), intent(inout) :: ids + logical, intent(in) :: bool + ids%c_data = bool + end subroutine + subroutine is_c_data_spectrometer_uv(ids, bool) + type(ids_spectrometer_uv), intent(in) :: ids + logical, intent(out) :: bool + bool = ids%c_data + end subroutine + + subroutine set_c_data_spectrometer_visible(ids, bool) + type(ids_spectrometer_visible), intent(inout) :: ids + logical, intent(in) :: bool + ids%c_data = bool + end subroutine + subroutine is_c_data_spectrometer_visible(ids, bool) + type(ids_spectrometer_visible), intent(in) :: ids + logical, intent(out) :: bool + bool = ids%c_data + end subroutine + + subroutine set_c_data_spectrometer_x_ray_crystal(ids, bool) + type(ids_spectrometer_x_ray_crystal), intent(inout) :: ids + logical, intent(in) :: bool + ids%c_data = bool + end subroutine + subroutine is_c_data_spectrometer_x_ray_crystal(ids, bool) + type(ids_spectrometer_x_ray_crystal), intent(in) :: ids + logical, intent(out) :: bool + bool = ids%c_data + end subroutine + + subroutine set_c_data_summary(ids, bool) + type(ids_summary), intent(inout) :: ids + logical, intent(in) :: bool + ids%c_data = bool + end subroutine + subroutine is_c_data_summary(ids, bool) + type(ids_summary), intent(in) :: ids + logical, intent(out) :: bool + bool = ids%c_data + end subroutine + + subroutine set_c_data_temporary(ids, bool) + type(ids_temporary), intent(inout) :: ids + logical, intent(in) :: bool + ids%c_data = bool + end subroutine + subroutine is_c_data_temporary(ids, bool) + type(ids_temporary), intent(in) :: ids + logical, intent(out) :: bool + bool = ids%c_data + end subroutine + + subroutine set_c_data_thomson_scattering(ids, bool) + type(ids_thomson_scattering), intent(inout) :: ids + logical, intent(in) :: bool + ids%c_data = bool + end subroutine + subroutine is_c_data_thomson_scattering(ids, bool) + type(ids_thomson_scattering), intent(in) :: ids + logical, intent(out) :: bool + bool = ids%c_data + end subroutine + + subroutine set_c_data_tf(ids, bool) + type(ids_tf), intent(inout) :: ids + logical, intent(in) :: bool + ids%c_data = bool + end subroutine + subroutine is_c_data_tf(ids, bool) + type(ids_tf), intent(in) :: ids + logical, intent(out) :: bool + bool = ids%c_data + end subroutine + + subroutine set_c_data_transport_solver_numerics(ids, bool) + type(ids_transport_solver_numerics), intent(inout) :: ids + logical, intent(in) :: bool + ids%c_data = bool + end subroutine + subroutine is_c_data_transport_solver_numerics(ids, bool) + type(ids_transport_solver_numerics), intent(in) :: ids + logical, intent(out) :: bool + bool = ids%c_data + end subroutine + + subroutine set_c_data_turbulence(ids, bool) + type(ids_turbulence), intent(inout) :: ids + logical, intent(in) :: bool + ids%c_data = bool + end subroutine + subroutine is_c_data_turbulence(ids, bool) + type(ids_turbulence), intent(in) :: ids + logical, intent(out) :: bool + bool = ids%c_data + end subroutine + + subroutine set_c_data_wall(ids, bool) + type(ids_wall), intent(inout) :: ids + logical, intent(in) :: bool + ids%c_data = bool + end subroutine + subroutine is_c_data_wall(ids, bool) + type(ids_wall), intent(in) :: ids + logical, intent(out) :: bool + bool = ids%c_data + end subroutine + + subroutine set_c_data_waves(ids, bool) + type(ids_waves), intent(inout) :: ids + logical, intent(in) :: bool + ids%c_data = bool + end subroutine + subroutine is_c_data_waves(ids, bool) + type(ids_waves), intent(in) :: ids + logical, intent(out) :: bool + bool = ids%c_data + end subroutine + + subroutine set_c_data_workflow(ids, bool) + type(ids_workflow), intent(inout) :: ids + logical, intent(in) :: bool + ids%c_data = bool + end subroutine + subroutine is_c_data_workflow(ids, bool) + type(ids_workflow), intent(in) :: ids + logical, intent(out) :: bool + bool = ids%c_data + end subroutine + + function get_max_occurrences_amns_data(ids) + type(ids_amns_data), intent(in) :: ids + integer :: get_max_occurrences_amns_data + get_max_occurrences_amns_data = ids%max_occurrence + end function + + function get_max_occurrences_barometry(ids) + type(ids_barometry), intent(in) :: ids + integer :: get_max_occurrences_barometry + get_max_occurrences_barometry = ids%max_occurrence + end function + + function get_max_occurrences_bolometer(ids) + type(ids_bolometer), intent(in) :: ids + integer :: get_max_occurrences_bolometer + get_max_occurrences_bolometer = ids%max_occurrence + end function + + function get_max_occurrences_bremsstrahlung_visible(ids) + type(ids_bremsstrahlung_visible), intent(in) :: ids + integer :: get_max_occurrences_bremsstrahlung_visible + get_max_occurrences_bremsstrahlung_visible = ids%max_occurrence + end function + + function get_max_occurrences_calorimetry(ids) + type(ids_calorimetry), intent(in) :: ids + integer :: get_max_occurrences_calorimetry + get_max_occurrences_calorimetry = ids%max_occurrence + end function + + function get_max_occurrences_camera_ir(ids) + type(ids_camera_ir), intent(in) :: ids + integer :: get_max_occurrences_camera_ir + get_max_occurrences_camera_ir = ids%max_occurrence + end function + + function get_max_occurrences_camera_visible(ids) + type(ids_camera_visible), intent(in) :: ids + integer :: get_max_occurrences_camera_visible + get_max_occurrences_camera_visible = ids%max_occurrence + end function + + function get_max_occurrences_camera_x_rays(ids) + type(ids_camera_x_rays), intent(in) :: ids + integer :: get_max_occurrences_camera_x_rays + get_max_occurrences_camera_x_rays = ids%max_occurrence + end function + + function get_max_occurrences_charge_exchange(ids) + type(ids_charge_exchange), intent(in) :: ids + integer :: get_max_occurrences_charge_exchange + get_max_occurrences_charge_exchange = ids%max_occurrence + end function + + function get_max_occurrences_coils_non_axisymmetric(ids) + type(ids_coils_non_axisymmetric), intent(in) :: ids + integer :: get_max_occurrences_coils_non_axisymmetric + get_max_occurrences_coils_non_axisymmetric = ids%max_occurrence + end function + + function get_max_occurrences_controllers(ids) + type(ids_controllers), intent(in) :: ids + integer :: get_max_occurrences_controllers + get_max_occurrences_controllers = ids%max_occurrence + end function + + function get_max_occurrences_core_instant_changes(ids) + type(ids_core_instant_changes), intent(in) :: ids + integer :: get_max_occurrences_core_instant_changes + get_max_occurrences_core_instant_changes = ids%max_occurrence + end function + + function get_max_occurrences_core_profiles(ids) + type(ids_core_profiles), intent(in) :: ids + integer :: get_max_occurrences_core_profiles + get_max_occurrences_core_profiles = ids%max_occurrence + end function + + function get_max_occurrences_core_sources(ids) + type(ids_core_sources), intent(in) :: ids + integer :: get_max_occurrences_core_sources + get_max_occurrences_core_sources = ids%max_occurrence + end function + + function get_max_occurrences_core_transport(ids) + type(ids_core_transport), intent(in) :: ids + integer :: get_max_occurrences_core_transport + get_max_occurrences_core_transport = ids%max_occurrence + end function + + function get_max_occurrences_cryostat(ids) + type(ids_cryostat), intent(in) :: ids + integer :: get_max_occurrences_cryostat + get_max_occurrences_cryostat = ids%max_occurrence + end function + + function get_max_occurrences_dataset_description(ids) + type(ids_dataset_description), intent(in) :: ids + integer :: get_max_occurrences_dataset_description + get_max_occurrences_dataset_description = ids%max_occurrence + end function + + function get_max_occurrences_dataset_fair(ids) + type(ids_dataset_fair), intent(in) :: ids + integer :: get_max_occurrences_dataset_fair + get_max_occurrences_dataset_fair = ids%max_occurrence + end function + + function get_max_occurrences_disruption(ids) + type(ids_disruption), intent(in) :: ids + integer :: get_max_occurrences_disruption + get_max_occurrences_disruption = ids%max_occurrence + end function + + function get_max_occurrences_distribution_sources(ids) + type(ids_distribution_sources), intent(in) :: ids + integer :: get_max_occurrences_distribution_sources + get_max_occurrences_distribution_sources = ids%max_occurrence + end function + + function get_max_occurrences_distributions(ids) + type(ids_distributions), intent(in) :: ids + integer :: get_max_occurrences_distributions + get_max_occurrences_distributions = ids%max_occurrence + end function + + function get_max_occurrences_divertors(ids) + type(ids_divertors), intent(in) :: ids + integer :: get_max_occurrences_divertors + get_max_occurrences_divertors = ids%max_occurrence + end function + + function get_max_occurrences_ec_launchers(ids) + type(ids_ec_launchers), intent(in) :: ids + integer :: get_max_occurrences_ec_launchers + get_max_occurrences_ec_launchers = ids%max_occurrence + end function + + function get_max_occurrences_ece(ids) + type(ids_ece), intent(in) :: ids + integer :: get_max_occurrences_ece + get_max_occurrences_ece = ids%max_occurrence + end function + + function get_max_occurrences_edge_profiles(ids) + type(ids_edge_profiles), intent(in) :: ids + integer :: get_max_occurrences_edge_profiles + get_max_occurrences_edge_profiles = ids%max_occurrence + end function + + function get_max_occurrences_edge_sources(ids) + type(ids_edge_sources), intent(in) :: ids + integer :: get_max_occurrences_edge_sources + get_max_occurrences_edge_sources = ids%max_occurrence + end function + + function get_max_occurrences_edge_transport(ids) + type(ids_edge_transport), intent(in) :: ids + integer :: get_max_occurrences_edge_transport + get_max_occurrences_edge_transport = ids%max_occurrence + end function + + function get_max_occurrences_em_coupling(ids) + type(ids_em_coupling), intent(in) :: ids + integer :: get_max_occurrences_em_coupling + get_max_occurrences_em_coupling = ids%max_occurrence + end function + + function get_max_occurrences_equilibrium(ids) + type(ids_equilibrium), intent(in) :: ids + integer :: get_max_occurrences_equilibrium + get_max_occurrences_equilibrium = ids%max_occurrence + end function + + function get_max_occurrences_gas_injection(ids) + type(ids_gas_injection), intent(in) :: ids + integer :: get_max_occurrences_gas_injection + get_max_occurrences_gas_injection = ids%max_occurrence + end function + + function get_max_occurrences_gas_pumping(ids) + type(ids_gas_pumping), intent(in) :: ids + integer :: get_max_occurrences_gas_pumping + get_max_occurrences_gas_pumping = ids%max_occurrence + end function + + function get_max_occurrences_gyrokinetics(ids) + type(ids_gyrokinetics), intent(in) :: ids + integer :: get_max_occurrences_gyrokinetics + get_max_occurrences_gyrokinetics = ids%max_occurrence + end function + + function get_max_occurrences_hard_x_rays(ids) + type(ids_hard_x_rays), intent(in) :: ids + integer :: get_max_occurrences_hard_x_rays + get_max_occurrences_hard_x_rays = ids%max_occurrence + end function + + function get_max_occurrences_ic_antennas(ids) + type(ids_ic_antennas), intent(in) :: ids + integer :: get_max_occurrences_ic_antennas + get_max_occurrences_ic_antennas = ids%max_occurrence + end function + + function get_max_occurrences_interferometer(ids) + type(ids_interferometer), intent(in) :: ids + integer :: get_max_occurrences_interferometer + get_max_occurrences_interferometer = ids%max_occurrence + end function + + function get_max_occurrences_iron_core(ids) + type(ids_iron_core), intent(in) :: ids + integer :: get_max_occurrences_iron_core + get_max_occurrences_iron_core = ids%max_occurrence + end function + + function get_max_occurrences_langmuir_probes(ids) + type(ids_langmuir_probes), intent(in) :: ids + integer :: get_max_occurrences_langmuir_probes + get_max_occurrences_langmuir_probes = ids%max_occurrence + end function + + function get_max_occurrences_lh_antennas(ids) + type(ids_lh_antennas), intent(in) :: ids + integer :: get_max_occurrences_lh_antennas + get_max_occurrences_lh_antennas = ids%max_occurrence + end function + + function get_max_occurrences_magnetics(ids) + type(ids_magnetics), intent(in) :: ids + integer :: get_max_occurrences_magnetics + get_max_occurrences_magnetics = ids%max_occurrence + end function + + function get_max_occurrences_mhd(ids) + type(ids_mhd), intent(in) :: ids + integer :: get_max_occurrences_mhd + get_max_occurrences_mhd = ids%max_occurrence + end function + + function get_max_occurrences_mhd_linear(ids) + type(ids_mhd_linear), intent(in) :: ids + integer :: get_max_occurrences_mhd_linear + get_max_occurrences_mhd_linear = ids%max_occurrence + end function + + function get_max_occurrences_mse(ids) + type(ids_mse), intent(in) :: ids + integer :: get_max_occurrences_mse + get_max_occurrences_mse = ids%max_occurrence + end function + + function get_max_occurrences_nbi(ids) + type(ids_nbi), intent(in) :: ids + integer :: get_max_occurrences_nbi + get_max_occurrences_nbi = ids%max_occurrence + end function + + function get_max_occurrences_neutron_diagnostic(ids) + type(ids_neutron_diagnostic), intent(in) :: ids + integer :: get_max_occurrences_neutron_diagnostic + get_max_occurrences_neutron_diagnostic = ids%max_occurrence + end function + + function get_max_occurrences_ntms(ids) + type(ids_ntms), intent(in) :: ids + integer :: get_max_occurrences_ntms + get_max_occurrences_ntms = ids%max_occurrence + end function + + function get_max_occurrences_pellets(ids) + type(ids_pellets), intent(in) :: ids + integer :: get_max_occurrences_pellets + get_max_occurrences_pellets = ids%max_occurrence + end function + + function get_max_occurrences_pf_active(ids) + type(ids_pf_active), intent(in) :: ids + integer :: get_max_occurrences_pf_active + get_max_occurrences_pf_active = ids%max_occurrence + end function + + function get_max_occurrences_pf_passive(ids) + type(ids_pf_passive), intent(in) :: ids + integer :: get_max_occurrences_pf_passive + get_max_occurrences_pf_passive = ids%max_occurrence + end function + + function get_max_occurrences_plasma_initiation(ids) + type(ids_plasma_initiation), intent(in) :: ids + integer :: get_max_occurrences_plasma_initiation + get_max_occurrences_plasma_initiation = ids%max_occurrence + end function + + function get_max_occurrences_polarimeter(ids) + type(ids_polarimeter), intent(in) :: ids + integer :: get_max_occurrences_polarimeter + get_max_occurrences_polarimeter = ids%max_occurrence + end function + + function get_max_occurrences_pulse_schedule(ids) + type(ids_pulse_schedule), intent(in) :: ids + integer :: get_max_occurrences_pulse_schedule + get_max_occurrences_pulse_schedule = ids%max_occurrence + end function + + function get_max_occurrences_radiation(ids) + type(ids_radiation), intent(in) :: ids + integer :: get_max_occurrences_radiation + get_max_occurrences_radiation = ids%max_occurrence + end function + + function get_max_occurrences_real_time_data(ids) + type(ids_real_time_data), intent(in) :: ids + integer :: get_max_occurrences_real_time_data + get_max_occurrences_real_time_data = ids%max_occurrence + end function + + function get_max_occurrences_reflectometer_profile(ids) + type(ids_reflectometer_profile), intent(in) :: ids + integer :: get_max_occurrences_reflectometer_profile + get_max_occurrences_reflectometer_profile = ids%max_occurrence + end function + + function get_max_occurrences_refractometer(ids) + type(ids_refractometer), intent(in) :: ids + integer :: get_max_occurrences_refractometer + get_max_occurrences_refractometer = ids%max_occurrence + end function + + function get_max_occurrences_sawteeth(ids) + type(ids_sawteeth), intent(in) :: ids + integer :: get_max_occurrences_sawteeth + get_max_occurrences_sawteeth = ids%max_occurrence + end function + + function get_max_occurrences_soft_x_rays(ids) + type(ids_soft_x_rays), intent(in) :: ids + integer :: get_max_occurrences_soft_x_rays + get_max_occurrences_soft_x_rays = ids%max_occurrence + end function + + function get_max_occurrences_spectrometer_mass(ids) + type(ids_spectrometer_mass), intent(in) :: ids + integer :: get_max_occurrences_spectrometer_mass + get_max_occurrences_spectrometer_mass = ids%max_occurrence + end function + + function get_max_occurrences_spectrometer_uv(ids) + type(ids_spectrometer_uv), intent(in) :: ids + integer :: get_max_occurrences_spectrometer_uv + get_max_occurrences_spectrometer_uv = ids%max_occurrence + end function + + function get_max_occurrences_spectrometer_visible(ids) + type(ids_spectrometer_visible), intent(in) :: ids + integer :: get_max_occurrences_spectrometer_visible + get_max_occurrences_spectrometer_visible = ids%max_occurrence + end function + + function get_max_occurrences_spectrometer_x_ray_crystal(ids) + type(ids_spectrometer_x_ray_crystal), intent(in) :: ids + integer :: get_max_occurrences_spectrometer_x_ray_crystal + get_max_occurrences_spectrometer_x_ray_crystal = ids%max_occurrence + end function + + function get_max_occurrences_summary(ids) + type(ids_summary), intent(in) :: ids + integer :: get_max_occurrences_summary + get_max_occurrences_summary = ids%max_occurrence + end function + + function get_max_occurrences_temporary(ids) + type(ids_temporary), intent(in) :: ids + integer :: get_max_occurrences_temporary + get_max_occurrences_temporary = ids%max_occurrence + end function + + function get_max_occurrences_thomson_scattering(ids) + type(ids_thomson_scattering), intent(in) :: ids + integer :: get_max_occurrences_thomson_scattering + get_max_occurrences_thomson_scattering = ids%max_occurrence + end function + + function get_max_occurrences_tf(ids) + type(ids_tf), intent(in) :: ids + integer :: get_max_occurrences_tf + get_max_occurrences_tf = ids%max_occurrence + end function + + function get_max_occurrences_transport_solver_numerics(ids) + type(ids_transport_solver_numerics), intent(in) :: ids + integer :: get_max_occurrences_transport_solver_numerics + get_max_occurrences_transport_solver_numerics = ids%max_occurrence + end function + + function get_max_occurrences_turbulence(ids) + type(ids_turbulence), intent(in) :: ids + integer :: get_max_occurrences_turbulence + get_max_occurrences_turbulence = ids%max_occurrence + end function + + function get_max_occurrences_wall(ids) + type(ids_wall), intent(in) :: ids + integer :: get_max_occurrences_wall + get_max_occurrences_wall = ids%max_occurrence + end function + + function get_max_occurrences_waves(ids) + type(ids_waves), intent(in) :: ids + integer :: get_max_occurrences_waves + get_max_occurrences_waves = ids%max_occurrence + end function + + function get_max_occurrences_workflow(ids) + type(ids_workflow), intent(in) :: ids + integer :: get_max_occurrences_workflow + get_max_occurrences_workflow = ids%max_occurrence + end function + + +end module + + \ No newline at end of file diff --git a/src-f90/ids_schemas_v3.39.0-4.11.6-2020b.f90 b/src-f90/ids_schemas_v3.39.0-4.11.6-2020b.f90 new file mode 100644 index 0000000000000000000000000000000000000000..99103fbe1e245927f903fb00b156bea4096460af --- /dev/null +++ b/src-f90/ids_schemas_v3.39.0-4.11.6-2020b.f90 @@ -0,0 +1,79 @@ + + module ids_schemas + + use ids_schemas_amns_data + use ids_schemas_barometry + use ids_schemas_b_field_non_axisymmetric + use ids_schemas_bolometer + use ids_schemas_bremsstrahlung_visible + use ids_schemas_calorimetry + use ids_schemas_camera_ir + use ids_schemas_camera_visible + use ids_schemas_camera_x_rays + use ids_schemas_charge_exchange + use ids_schemas_coils_non_axisymmetric + use ids_schemas_controllers + use ids_schemas_core_instant_changes + use ids_schemas_core_profiles + use ids_schemas_core_sources + use ids_schemas_core_transport + use ids_schemas_cryostat + use ids_schemas_dataset_description + use ids_schemas_dataset_fair + use ids_schemas_disruption + use ids_schemas_distribution_sources + use ids_schemas_distributions + use ids_schemas_divertors + use ids_schemas_ec_launchers + use ids_schemas_ece + use ids_schemas_edge_profiles + use ids_schemas_edge_sources + use ids_schemas_edge_transport + use ids_schemas_em_coupling + use ids_schemas_equilibrium + use ids_schemas_focs + use ids_schemas_gas_injection + use ids_schemas_gas_pumping + use ids_schemas_gyrokinetics + use ids_schemas_hard_x_rays + use ids_schemas_ic_antennas + use ids_schemas_interferometer + use ids_schemas_iron_core + use ids_schemas_langmuir_probes + use ids_schemas_lh_antennas + use ids_schemas_magnetics + use ids_schemas_mhd + use ids_schemas_mhd_linear + use ids_schemas_mse + use ids_schemas_nbi + use ids_schemas_neutron_diagnostic + use ids_schemas_ntms + use ids_schemas_pellets + use ids_schemas_pf_active + use ids_schemas_pf_passive + use ids_schemas_plasma_initiation + use ids_schemas_polarimeter + use ids_schemas_pulse_schedule + use ids_schemas_radiation + use ids_schemas_real_time_data + use ids_schemas_reflectometer_profile + use ids_schemas_reflectometer_fluctuation + use ids_schemas_refractometer + use ids_schemas_runaway_electrons + use ids_schemas_sawteeth + use ids_schemas_soft_x_rays + use ids_schemas_spectrometer_mass + use ids_schemas_spectrometer_uv + use ids_schemas_spectrometer_visible + use ids_schemas_spectrometer_x_ray_crystal + use ids_schemas_summary + use ids_schemas_temporary + use ids_schemas_thomson_scattering + use ids_schemas_tf + use ids_schemas_transport_solver_numerics + use ids_schemas_turbulence + use ids_schemas_wall + use ids_schemas_waves + use ids_schemas_workflow + end module + \ No newline at end of file diff --git a/src-f90/iodisk.f90 b/src-f90/iodisk.f90 index 2571142ec72dd75e957a9344850fdfa03d3dad2e..b7e78018a92f7e53715853b83fe41abd2b7de480 100644 --- a/src-f90/iodisk.f90 +++ b/src-f90/iodisk.f90 @@ -23,6 +23,18 @@ SUBROUTINE IODISK(KOPT) REAL(RKIND), intent(out) :: RFIT(NBFIT), ZFIT(NBFIT) REAL(RKIND), intent(in), optional :: TENSION, R0, RZ0 end SUBROUTINE bndfit + SUBROUTINE WRITE_INFO_NPPFUN(IOSTATUS,NPPFUN_IN,NPPFUN) + IMPLICIT NONE + INTEGER, INTENT(IN) :: IOSTATUS,NPPFUN_IN + INTEGER, INTENT(INOUT) :: NPPFUN + end SUBROUTINE WRITE_INFO_NPPFUN + SUBROUTINE SET_QSPEC_FROM_QARRAY_in(CSSPEC,QSPEC,NPPF1,QPSIIN,NVERBOSE) + USE prec_const + IMPLICIT NONE + INTEGER, intent(in) :: NPPF1, NVERBOSE + REAL(RKIND), intent(inout) :: CSSPEC, QSPEC + REAL(RKIND), intent(in) :: QPSIIN(1:NPPF1) + end SUBROUTINE SET_QSPEC_FROM_QARRAY_in end interface ! INTEGER, INTENT(IN) :: KOPT @@ -36,16 +48,16 @@ SUBROUTINE IODISK(KOPT) REAL(RKIND) :: ZSHIFTZ, ZCOF, ZCOFP, ZCOFT, ZCOFPP, ZCOFTTP, ZCOFJ, ZMU0, & & ZPSINORM, ZDUM, ZPSIAX, ZPSIEDGE, ZRMAGXP, ZZMAGXP, ZR0EXP, ZB0EXP, & & ZDT, X2, F1, ZRGEOM, ZZGEOM, ZDX, ZSIGN_G, zpsi_signfactor, & - & ZRZ0C, ZASPCT, r0_eqgeom_geom, r0_global_toroid + & ZRZ0C, ZASPCT, r0_eqgeom_geom, r0_global_toroid, ZPPRIME_MAX, ZCOF_RFUN, ZCOF_RPPF REAL(RKIND), SAVE :: SIGNB0XP_IN, SIGNIPXP_IN ! INTEGER :: I, J, IBND, IS, L, INUM, IPPRIMEMAX(1) INTEGER :: IDATA, IDCHSE, IRMIN, IZMIN, IRMAX, IZMAX, INTMF0, INZBOX, INRBOX, & & IDUM, IDUMTOT, IMX, IMN, NPPF1, I0, I1, NPPF1_eff, Ippfun, ipropt_abs INTEGER :: iexp_Bp,isigma_Bp,isigma_RphiZ,isigma_rhothetaphi,isign_q_pos,isign_pprime_pos,isigma_RphiZ_out, & - & iexp_Bp_out, isigma_Bp_out, itheta_sign_clockwise_in, itheta_sign_clockwise_out, iadapt_r0exp + & iexp_Bp_out, isigma_Bp_out, itheta_sign_clockwise_in, itheta_sign_clockwise_out, iadapt_r0exp, NPPFUN_IN, iostatus ! - CHARACTER ZDATE*8, FILECOCOS*20 + CHARACTER ZDATE*8, FILECOCOS*20, LINE_IN*132 ! ! FUNCTIONS INTEGER :: ISMIN, ISMAX, ISRCHFGE @@ -80,12 +92,12 @@ SUBROUTINE IODISK(KOPT) & NBSOPT,NBSTRP IF (NISO .GE. NPISOEFF) THEN - PRINT *,'NISO IN NIN TOO LARGE, INCREASE NPSI IN INPUT OR SET NOPT=-2' - PRINT *,'NISO = ',NISO - PRINT *,'NPISOEFF = ',NPISOEFF eqchease_out(index_out)%codeparam%output_diag(1) = 'in iodisk: NISO IN NIN TOO LARGE, INCREASE NPSI IN INPUT OR SET NOPT=-2' write(eqchease_out(index_out)%codeparam%output_diag(2),*) 'NISO = ',NISO,' NPISOEFF = ',NPISOEFF - eqchease_out(index_out)%codeparam%output_flag = -121 + WRITE(6,*) trim(eqchease_out(index_out)%codeparam%output_diag(1)) + WRITE(6,*) trim(eqchease_out(index_out)%codeparam%output_diag(2)) + ! flag numbers > 1000 if linked to NaNs or to add a nb in between, otherwise linked to sections (as guidance) + eqchease_out(index_out)%codeparam%output_flag = -110 return END IF READ(NIN) CUROLD,SCALAC,BSFRAC,RZION,ETAEI,PREDGE @@ -118,6 +130,8 @@ SUBROUTINE IODISK(KOPT) !READ(NIN) (CIDR(J),J=1,NISO) !READ(NIN) (CIDQ(J),J=1,NISO) READ(NIN) (ISTAR_TARGET(J),J=1,NISO) + CALL DCOPY(NISO,CID3,1,CID3O,1) + CALL DCOPY(NISO,ISTAR_TARGET,1,ISTAR_TARGETO,1) END IF ! READ(NIN) (AT(J),J=1,10) @@ -174,13 +188,6 @@ SUBROUTINE IODISK(KOPT) ! ENDIF ! - IF (NSTTP.EQ.5) THEN !LILY - READ(NIN) (CID3(J),J=1,NISO) - !READ(NIN) (CIDR(J),J=1,NISO) - !READ(NIN) (CIDQ(J),J=1,NISO) - READ(NIN) (ISTAR_TARGET(J),J=1,NISO) - END IF - ! CLOSE(UNIT=NIN,STATUS='KEEP') RETURN ! @@ -223,6 +230,8 @@ SUBROUTINE IODISK(KOPT) !READ(NIN) (CIDR(J),J=1,NISO) !READ(NIN) (CIDQ(J),J=1,NISO) READ(NIN) (ISTAR_TARGET(J),J=1,NISO) + CALL DCOPY(NISO,CID3,1,CID3O,1) + CALL DCOPY(NISO,ISTAR_TARGET,1,ISTAR_TARGETO,1) END IF ! CLOSE(UNIT=NIN,STATUS='KEEP') @@ -359,9 +368,9 @@ SUBROUTINE IODISK(KOPT) IF (NSURF .EQ. 6) THEN READ(NXIN,*) NBPS IF (NBPS .GT. NPBPS) THEN - write(0,*) 'NBPS LARGER THAN NPBPS.RECOMPILE WITH LARGER NPBPS' eqchease_out(index_out)%codeparam%output_diag(1) = 'in iodisk: NBPS LARGER THAN NPBPS.RECOMPILE WITH LARGER NPBPS' - eqchease_out(index_out)%codeparam%output_flag = -122 + write(0,*) trim(eqchease_out(index_out)%codeparam%output_diag(1)) + eqchease_out(index_out)%codeparam%output_flag = -301 return ENDIF READ(NXIN,*) (RRBPS(L), RZBPS(L), L=1,NBPS) @@ -408,7 +417,9 @@ SUBROUTINE IODISK(KOPT) IF (NFUNC.EQ.4 .AND. (NPPFUN.EQ.4 .OR. NPPFUN.EQ.8)) THEN ! BOTH PROFILES GIVEN AS AN ARRAY OF NPPF1 POINTS VS S ! NPPFUN=8: P(S) GIVEN - READ(NXIN,*) NPPF1 + READ(NXIN,'(A)') LINE_IN + READ(LINE_IN,*,IOSTAT=iostatus) NPPF1, NPPFUN_IN + CALL WRITE_INFO_NPPFUN(IOSTATUS,NPPFUN_IN,NPPFUN) NRHOMESH = 0 IF (NFUNRHO .EQ. 0) THEN READ(NXIN,*) NSTTP @@ -416,12 +427,12 @@ SUBROUTINE IODISK(KOPT) ! NRHOMESH=0 (S-MESH AS WITH NFUNRHO=0), =1 (RHO_TOR MESH) READ(NXIN,*) NSTTP,NRHOMESH ENDIF - IF (NVERBOSE .GE. 1) PRINT *,'NFUNRHO, NRHOMESH= ',NFUNRHO, NRHOMESH + IF (NVERBOSE .GE. 1) WRITE(6,*) 'NFUNRHO, NRHOMESH= ',NFUNRHO, NRHOMESH ! IF (NPPF1 .GT. NPBPS) THEN - write(0,*) 'NPPF1 LARGER THAN NPBPS. RECOMPILE WITH LARGER NPBPS' eqchease_out(index_out)%codeparam%output_diag(1) = 'in iodisk: NPPF1 LARGER THAN NPBPS. RECOMPILE WITH LARGER NPBPS' - eqchease_out(index_out)%codeparam%output_flag = -123 + write(0,*) trim(eqchease_out(index_out)%codeparam%output_diag(1)) + eqchease_out(index_out)%codeparam%output_flag = -302 return ENDIF ! @@ -432,7 +443,7 @@ SUBROUTINE IODISK(KOPT) write(0,*) '********** ERROR **********' write(0,*) 'Nans is some inputs, idum = ',idum write(0,*) '********** ERROR **********' - eqchease_out(index_out)%codeparam%output_flag = -1240 + eqchease_out(index_out)%codeparam%output_flag = -3001 return end if IF (NFUNRHO.EQ.1 .AND. NRHOMESH.EQ.1) THEN @@ -441,12 +452,12 @@ SUBROUTINE IODISK(KOPT) FCSM(1:NPPF1) = FCSM(1:NPPF1) / FCSM(NPPF1) FCSM(NPPF1) = 1._RKIND ELSE + eqchease_out(index_out)%codeparam%output_diag(1) = 'in iodisk: Bad input, s(end) = 0., should have rho_tor with 0 in center' write(0,*) '********** ERROR **********' - write(0,*) 'Bad input, s(end) = 0., should have rho_tor with 0 in center' + write(0,*) trim(eqchease_out(index_out)%codeparam%output_diag(1)) write(0,*) '********** ERROR **********' flush(0) - eqchease_out(index_out)%codeparam%output_diag(1) = 'in iodisk: Bad input, s(end) = 0., should have rho_tor with 0 in center' - eqchease_out(index_out)%codeparam%output_flag = -124 + eqchease_out(index_out)%codeparam%output_flag = -303 return END IF END IF @@ -477,7 +488,7 @@ SUBROUTINE IODISK(KOPT) write(0,*) '********** ERROR **********' write(0,*) 'Nans is some inputs, idum = ',idum write(0,*) '********** ERROR **********' - eqchease_out(index_out)%codeparam%output_flag = -1241 + eqchease_out(index_out)%codeparam%output_flag = -3041 return end if RPPF(1:NPPF1_eff) = RPPF(iFCSM(1:NPPF1_eff)) @@ -488,6 +499,7 @@ SUBROUTINE IODISK(KOPT) call interpos(FCSM(1:NPPF1_eff),RPPF(1:NPPF1_eff),NPPF1_eff,tension=TENSPROF, & & yout=ZTEMP(1:NPPF1_eff),nbc=(/1,2/),ybc=(/RC0P, RPPF(NPPF1_eff)/)) RPPF(1:NPPF1_eff) = ZTEMP(1:NPPF1_eff) + IF (NVERBOSE .GE. 3) print *,'Added smoothing of RPPF profile with TENSPROF = ',TENSPROF END IF READ(NXIN,*) (RFUN(L), L=1,NPPF1) call checknanos(RFUN,NPPF1,'NaNs in RFUN',idum) @@ -496,7 +508,7 @@ SUBROUTINE IODISK(KOPT) write(0,*) '********** ERROR **********' write(0,*) 'Nans is some inputs, idum = ',idum write(0,*) '********** ERROR **********' - eqchease_out(index_out)%codeparam%output_flag = -1242 + eqchease_out(index_out)%codeparam%output_flag = -3042 if (allocated(ZTEMP_P)) deallocate(ZTEMP_P) return end if @@ -505,7 +517,7 @@ SUBROUTINE IODISK(KOPT) call interpos(FCSM(1:NPPF1_eff),RFUN(1:NPPF1_eff),NPPF1_eff,tension=TENSPROF, & & yout=ZTEMP(1:NPPF1_eff),nbc=(/1,2/),ybc=(/RC0P, RFUN(NPPF1_eff)/)) RFUN(1:NPPF1_eff) = ZTEMP(1:NPPF1_eff) - IF (NVERBOSE .GE. 1) print *,'Added smoothing of RFUNprofiles with TENSPROF = ',TENSPROF + IF (NVERBOSE .GE. 3) print *,'Added smoothing of RFUNprofiles with TENSPROF = ',TENSPROF END IF ! NPPF1 = NPPF1_eff @@ -527,9 +539,9 @@ SUBROUTINE IODISK(KOPT) READ(NXIN,*) NSOUR,NSTTP ! IF (NSOUR .GT. 10) THEN - write(0,*) ' NSOUR TOO LARGE IN EXPEQ' eqchease_out(index_out)%codeparam%output_diag(1) = 'in iodisk: NSOUR TOO LARGE IN EXPEQ' - eqchease_out(index_out)%codeparam%output_flag = -125 + write(0,*) trim(eqchease_out(index_out)%codeparam%output_diag(1)) + eqchease_out(index_out)%codeparam%output_flag = -310 if (allocated(ZTEMP_P)) deallocate(ZTEMP_P) return ENDIF @@ -542,23 +554,47 @@ SUBROUTINE IODISK(KOPT) ! ! P-PRIME PROFILE IF (NPPFUN .EQ. 4 .OR. NPPFUN .EQ. 8) THEN - READ(NXIN,*) NPPF1 - READ(NXIN,*) NSTTP + READ(NXIN,'(A)') LINE_IN + READ(LINE_IN,*,IOSTAT=iostatus) NPPF1, NPPFUN_IN + CALL WRITE_INFO_NPPFUN(IOSTATUS,NPPFUN_IN,NPPFUN) + NRHOMESH = 0 + IF (NFUNRHO .EQ. 0) THEN + READ(NXIN,*) NSTTP + ELSE + ! NRHOMESH=0 (S-MESH AS WITH NFUNRHO=0), =1 (RHO_TOR MESH) + READ(NXIN,*) NSTTP,NRHOMESH + ENDIF IF (NPPF1 .GT. NPBPS) THEN - write(0,*) 'NPPF1 LARGER THAN NPBPS. RECOMPILE WITH LARGER NPBPS' eqchease_out(index_out)%codeparam%output_diag(1) = 'in iodisk: NPPF1 LARGER THAN NPBPS. RECOMPILE WITH LARGER NPBPS' - eqchease_out(index_out)%codeparam%output_flag = -1260 + write(0,*) trim(eqchease_out(index_out)%codeparam%output_diag(1)) + eqchease_out(index_out)%codeparam%output_flag = -311 if (allocated(ZTEMP_P)) deallocate(ZTEMP_P) return ENDIF READ(NXIN,*) (FCSM(L), L=1,NPPF1) + IF (NFUNRHO.EQ.1 .AND. NRHOMESH.EQ.1) THEN + ! input s is rho_tor, use only rho_tor_norm, so renormalize to make sure + IF (FCSM(NPPF1) .NE. 0._rkind) THEN + FCSM(1:NPPF1) = FCSM(1:NPPF1) / FCSM(NPPF1) + FCSM(NPPF1) = 1._RKIND + ELSE + eqchease_out(index_out)%codeparam%output_diag(1) = 'in iodisk: Bad input, s(end) = 0., should have rho_tor with 0 in center' + write(0,*) '********** ERROR **********' + write(0,*) trim(eqchease_out(index_out)%codeparam%output_diag(1)) + write(0,*) '********** ERROR **********' + flush(0) + eqchease_out(index_out)%codeparam%output_flag = -312 + return + END IF + END IF + READ(NXIN,*) (RPPF(L), L=1,NPPF1) IF ((NPPFUN .NE. 8) .AND. (TENSPROF .NE. 0._RKIND)) THEN ! pressure done later to get derivative, so avoid smoothing twice call interpos(FCSM(1:NPPF1),RPPF(1:NPPF1),NPPF1,tension=TENSPROF, & & yout=ZTEMP(1:NPPF1),nbc=(/1,2/),ybc=(/RC0P, RPPF(NPPF1)/)) RPPF(1:NPPF1) = ZTEMP(1:NPPF1) - IF (NVERBOSE .GE. 1) print *,'Added smoothing of RPPF profile with TENSPROF = ',TENSPROF + IF (NVERBOSE .GE. 3) print *,'Added smoothing of RPPF profile with TENSPROF = ',TENSPROF END IF NPPF = NPPF1 - 1 IF (NPPFUN .EQ. 8) THEN @@ -576,21 +612,42 @@ SUBROUTINE IODISK(KOPT) ! TT-PRIME OR I-PRIME OR .. PROFILE IF (NFUNC .EQ. 4) THEN READ(NXIN,*) NPPF1 - READ(NXIN,*) NSTTP + NRHOMESH = 0 + IF (NFUNRHO .EQ. 0) THEN + READ(NXIN,*) NSTTP + ELSE + ! NRHOMESH=0 (S-MESH AS WITH NFUNRHO=0), =1 (RHO_TOR MESH) + READ(NXIN,*) NSTTP,NRHOMESH + ENDIF IF (NPPF1 .GT. NPBPS) THEN - write(0,*) 'NPPF1 LARGER THAN NPBPS. RECOMPILE WITH LARGER NPBPS' eqchease_out(index_out)%codeparam%output_diag(1) = 'in iodisk: NPPF1 LARGER THAN NPBPS. RECOMPILE WITH LARGER NPBPS' - eqchease_out(index_out)%codeparam%output_flag = -1261 + write(0,*) trim(eqchease_out(index_out)%codeparam%output_diag(1)) + eqchease_out(index_out)%codeparam%output_flag = -313 if (allocated(ZTEMP_P)) deallocate(ZTEMP_P) return ENDIF READ(NXIN,*) (FCSM(L), L=1,NPPF1) + IF (NFUNRHO.EQ.1 .AND. NRHOMESH.EQ.1) THEN + ! input s is rho_tor, use only rho_tor_norm, so renormalize to make sure + IF (FCSM(NPPF1) .NE. 0._rkind) THEN + FCSM(1:NPPF1) = FCSM(1:NPPF1) / FCSM(NPPF1) + FCSM(NPPF1) = 1._RKIND + ELSE + eqchease_out(index_out)%codeparam%output_diag(1) = 'in iodisk: Bad input, s(end) = 0., should have rho_tor with 0 in center' + eqchease_out(index_out)%codeparam%output_flag = -314 + write(0,*) '********** ERROR **********' + write(0,*) trim(eqchease_out(index_out)%codeparam%output_diag(1)) + write(0,*) '********** ERROR **********' + flush(0) + return + END IF + END IF READ(NXIN,*) (RFUN(L), L=1,NPPF1) IF (TENSPROF .NE. 0._RKIND) THEN call interpos(FCSM(1:NPPF1),RFUN(1:NPPF1),NPPF1,tension=TENSPROF, & & yout=ZTEMP(1:NPPF1),nbc=(/1,2/),ybc=(/RC0P, RFUN(NPPF1)/)) RFUN(1:NPPF1) = ZTEMP(1:NPPF1) - IF (NVERBOSE .GE. 1) print *,'Added smoothing of RFUNprofile with TENSPROF = ',TENSPROF + IF (NVERBOSE .GE. 3) print *,'Added smoothing of RFUNprofile with TENSPROF = ',TENSPROF END IF NPPF = NPPF1 - 1 ELSE IF (NFUNC .EQ. 1) THEN @@ -600,13 +657,12 @@ SUBROUTINE IODISK(KOPT) ENDIF ENDIF ! - ! NSTTP=5: q profile as input => NCSCAL=1, QSPEC=q0 and CSSPEC=0 + ! NSTTP=5: q profile as input => NCSCAL=1, QSPEC=q0/edge and CSSPEC=0/1 IF (NSTTP .EQ. 5) THEN - IF ((NCSCAL.NE.1) .AND. (NVERBOSE.GE.3)) PRINT *,'NCSCAL=',NCSCAL, & + IF ((NCSCAL.NE.1) .AND. (NVERBOSE.GE.3)) WRITE(6,*) 'NCSCAL=',NCSCAL, & & ' CHANGED TO 1 SINCE INPUT PROFILE IS Q' NCSCAL = 1 - QSPEC = RFUN(1) - CSSPEC = 0._RKIND + CALL SET_QSPEC_FROM_QARRAY_in(CSSPEC,QSPEC,NPPF1,RFUN,NVERBOSE) END IF ! ! CONSTRUCT PPRIME FROM P INPUT PROFILE @@ -618,7 +674,7 @@ SUBROUTINE IODISK(KOPT) & YOUTP=ZTEMPP,nbc=(/2,2/),ybc=(/RPPF(1), RPPF(NPPF1)/)) ! call interpos(FCSM(1:NPPF1)*FCSM(1:NPPF1),RPPF,NPPF1,tension=TENSPROF, & ! & YOUTP=ZTEMPP,nbc=(/1,2/),ybc=(/RC0P, RPPF(NPPF1)/)) - IF (NVERBOSE .GE. 1) print *,'Added smoothing of p profile with TENSPROF = ',TENSPROF + IF (NVERBOSE .GE. 3) print *,'Added smoothing of p profile with TENSPROF = ',TENSPROF ELSE call interpos(FCSM(1:NPPF1)*FCSM(1:NPPF1),RPPF,NPPF1,tension=TENSPROF, & & YOUTP=ZTEMPP,nbc=(/0,0/),ybc=(/RC0P, RC0P/)) @@ -627,13 +683,13 @@ SUBROUTINE IODISK(KOPT) ELSEIF (NFUNRHO.EQ.1 .AND. NRHOMESH.EQ.1) THEN ! P(RHOTOR) GIVEN, could compute here dp/drhotor but then dp/dpsi(0) can never be non-zero ! So has to compute dp/dpsi or dp/dpsi_norm on psi at each interation - ! RPPF(1:NPPF1) = p(drho_tor_in_norm) + ! RPPF(1:NPPF1) = p(rho_tor_in_norm) ELSE - WRITE(0,*) 'in iodisk: OPTION NOT YET IMPLEMENTED: NPPFUN=8 AND NFUNRHO= ',NFUNRHO,' , NRHOMESH= ',NRHOMESH - FLUSH(0) write(eqchease_out(index_out)%codeparam%output_diag(1),*) & & 'in iodisk: OPTION NOT YET IMPLEMENTED: NPPFUN=8 AND NFUNRHO= ',NFUNRHO,' , NRHOMESH= ',NRHOMESH - eqchease_out(index_out)%codeparam%output_flag = -1262 + WRITE(0,*) trim(eqchease_out(index_out)%codeparam%output_diag(1)) + FLUSH(0) + eqchease_out(index_out)%codeparam%output_flag = -315 if (allocated(ZTEMP_P)) deallocate(ZTEMP_P) return END IF @@ -666,7 +722,8 @@ SUBROUTINE IODISK(KOPT) ! ! Write equivalent expeq file in order to be able to test outside kepler if there is a problem IF (NVERBOSE .GE. 1) THEN - OPEN(UNIT=NXPQOUT,ACCESS='SEQUENTIAL',FORM='FORMATTED',FILE='EXPEQ_EXPEQ.IN') + EXPEQ_IN_FILENAME = "EXPEQ_EXPEQ.IN" + OPEN(UNIT=NXPQOUT,ACCESS='SEQUENTIAL',FORM='FORMATTED',FILE=TRIM(EXPEQ_IN_FILENAME)) REWIND(NXPQOUT) WRITE(NXPQOUT,1303) ASPCT,RZ0/R0EXP,PREDGE if (nsurf .eq. 6) then @@ -691,7 +748,7 @@ SUBROUTINE IODISK(KOPT) ! if (idumtot .gt. 0) then write(0,*) 'There were NaNs found in input data in EXPEQ file, do not continue' - eqchease_out(index_out)%codeparam%output_flag = -1249 + eqchease_out(index_out)%codeparam%output_flag = -3151 return end if ! @@ -702,7 +759,7 @@ SUBROUTINE IODISK(KOPT) 32 CONTINUE ! READ MKSA VALUES ! - IF (NVERBOSE .GE. 1) PRINT *,'READS FILE EXPEQ ASSUMING A FORMAT ALA EQDSK ASSUMING COCOS = ',COCOS_IN + IF (NVERBOSE .GE. 3) WRITE(6,*) 'READS FILE EXPEQ ASSUMING A FORMAT ALA EQDSK ASSUMING COCOS = ',COCOS_IN READ(NXIN,'(48X)',ADVANCE='NO') READ(NXIN,*) IDUM,INRBOX,INZBOX idumtot = 0 @@ -714,31 +771,29 @@ SUBROUTINE IODISK(KOPT) write(0,*) '********** ERROR **********' write(0,*) 'Nans is some inputs, idumtot = ',idumtot write(0,*) '********** ERROR **********' - eqchease_out(index_out)%codeparam%output_flag = -1270 + eqchease_out(index_out)%codeparam%output_flag = -3201 return end if - IF (NVERBOSE .GE. 1) THEN - PRINT *,' INRBOX= ',INRBOX - PRINT *,' INZBOX= ',INZBOX + IF (NVERBOSE .GE. 3) THEN + WRITE(6,*) ' INRBOX= ',INRBOX + WRITE(6,*) ' INZBOX= ',INZBOX END IF IF (INRBOX .GT. NPBPS) THEN - PRINT *,' NRBOX LARGER THAN NPBPS IN EQDSK, SHOULD .LE. ',NPBPS - PRINT *,' RECOMPILE CHEASE WITH LARGER NPBPS' write(eqchease_out(index_out)%codeparam%output_diag(1),*) & & ' NRBOX LARGER THAN NPBPS IN EQDSK, SHOULD .LE. ',NPBPS,& & ' ; RECOMPILE CHEASE WITH LARGER NPBPS' - eqchease_out(index_out)%codeparam%output_flag = -1271 + WRITE(6,*) trim(eqchease_out(index_out)%codeparam%output_diag(1)) + eqchease_out(index_out)%codeparam%output_flag = -320 return ENDIF IF (INRBOX*INZBOX .GT. NPBPS*NPBPS) THEN - write(0,*) ' NRBOX*NZBOX .GT. NPBPS*NPBPS: NRBOX= ',INRBOX, & - & ' NZBOX= ',INZBOX,' NPBPS= ',NPBPS - write(0,*) ' RECOMPILE CHEASE WITH LARGER NPBPS' write(eqchease_out(index_out)%codeparam%output_diag(1),*) & & ' NRBOX*NZBOX .GT. NPBPS*NPBPS: NRBOX= ',INRBOX, & & ' NZBOX= ',INZBOX,' NPBPS= ',NPBPS eqchease_out(index_out)%codeparam%output_diag(2) = ' RECOMPILE CHEASE WITH LARGER NPBPS' - eqchease_out(index_out)%codeparam%output_flag = -1272 + write(0,*) trim(eqchease_out(index_out)%codeparam%output_diag(1)) + write(0,*) trim(eqchease_out(index_out)%codeparam%output_diag(2)) + eqchease_out(index_out)%codeparam%output_flag = -321 return ENDIF ! @@ -758,7 +813,7 @@ SUBROUTINE IODISK(KOPT) write(0,*) '********** ERROR **********' write(0,*) 'Nans is some inputs, idumtot = ',idumtot write(0,*) '********** ERROR **********' - eqchease_out(index_out)%codeparam%output_flag = -1273 + eqchease_out(index_out)%codeparam%output_flag = -3221 return end if IF (RBOXLEN .LE. 0._RKIND) THEN @@ -789,7 +844,7 @@ SUBROUTINE IODISK(KOPT) write(0,*) '********** ERROR **********' write(0,*) 'Nans is some inputs, idumtot = ',idumtot write(0,*) '********** ERROR **********' - eqchease_out(index_out)%codeparam%output_flag = -1274 + eqchease_out(index_out)%codeparam%output_flag = -3222 return end if ! SIGNB0XP OR SIGNIPXP FROM NAMELIST SHOULD BE THE OUTPUT VALUES EXCEPT IF <-1 @@ -814,7 +869,7 @@ SUBROUTINE IODISK(KOPT) write(0,*) '********** ERROR **********' write(0,*) 'Nans is some inputs, idumtot = ',idumtot write(0,*) '********** ERROR **********' - eqchease_out(index_out)%codeparam%output_flag = -1275 + eqchease_out(index_out)%codeparam%output_flag = -3223 return end if ! @@ -839,7 +894,7 @@ SUBROUTINE IODISK(KOPT) INTMF0 = 0 IF (ABS(RFUN(1)-R0EXP*B0EXP) .LE. 1.E-04_RKIND*(ABS(RFUN(1)))) THEN INTMF0 = 1 - IF (NVERBOSE .GE. 1) THEN + IF (NVERBOSE .GE. 3) THEN WRITE(6,'(/," EQDSK HAS T(1) = R0*B0")') WRITE(6,'(" RFUN(1)= ",1PE12.4," R0EXP*B0EXP= ",E12.4,/)') & & RFUN(1),R0EXP*B0EXP @@ -876,7 +931,7 @@ SUBROUTINE IODISK(KOPT) write(0,*) '********** ERROR **********' write(0,*) 'Nans is some inputs, idumtot = ',idumtot write(0,*) '********** ERROR **********' - eqchease_out(index_out)%codeparam%output_flag = -1276 + eqchease_out(index_out)%codeparam%output_flag = -3224 return end if PREDGE = RPPF(NPPF1) @@ -892,18 +947,24 @@ SUBROUTINE IODISK(KOPT) call checknanos(RFUN,NPPF1,'NaNs in RFUN',idum) idumtot = idumtot + idum ! P' - READ(NXIN,9381) (RPPF(L), L=1,NPPF1) - call checknanos(RPPF,NPPF1,'NaNs in RPPF',idum) + ALLOCATE(ZCPPR(NPPF1)) + READ(NXIN,9381) (ZCPPR(L), L=1,NPPF1) + call checknanos(ZCPPR,NPPF1,'NaNs in RPPF',idum) idumtot = idumtot + idum + IPPRIMEMAX = MAXLOC(abs(ZCPPR(1:NPPF1))) + ZPPRIME_MAX = ZCPPR(IPPRIMEMAX(1)) + IF (NPPFUN .EQ. 4) RPPF(1:NPPF1) = ZCPPR(1:NPPF1) + deallocate(ZCPPR) ! READ(NXIN,9381) ((EQDSPSI(I,J),I=1,INRBOX),J=1,INZBOX) ! not critical, do not check ! READ(NXIN,9381) (QPSIIN(I),I=1,INRBOX) call checknanos(QPSIIN,INRBOX,'NaNs in QPSIIN',idum) ! not critical so do not add idum to idumtot - IF (NVERBOSE .GE. 1) THEN - PRINT *,' Q(0)= ', QPSIIN(1) - PRINT *,' Q(EDGE)= ',QPSIIN(INRBOX) + IF (NVERBOSE .GE. 3) THEN + WRITE(6,*) ' Q(0)= ', QPSIIN(1) + WRITE(6,*) ' Q(EDGE)= ',QPSIIN(INRBOX) END IF + IF (NSTTP .EQ. 5) RFUN(1:NPPF1) = QPSIIN(1:NPPF1) ! NPPF1 = INRBOX ! READ(NXIN,*) NBPS, NWALLPOS call checknanos(NBPS,'NaNs in NBPS',idum) @@ -912,14 +973,14 @@ SUBROUTINE IODISK(KOPT) write(0,*) '********** ERROR **********' write(0,*) 'Nans is some inputs, idumtot = ',idumtot write(0,*) '********** ERROR **********' - eqchease_out(index_out)%codeparam%output_flag = -1277 + eqchease_out(index_out)%codeparam%output_flag = -3225 return end if IF (NBPS .GT. NPBPS) THEN - write(0,*) 'NBPS= ',NBPS,' LARGER THAN NPBPS=',NPBPS,'.RECOMPILE WITH LARGER NPBPS' write(eqchease_out(index_out)%codeparam%output_diag(1),*) & & ' NBPS= ',NBPS,' LARGER THAN NPBPS=',NPBPS,'.RECOMPILE WITH LARGER NPBPS' - eqchease_out(index_out)%codeparam%output_flag = -1278 + write(0,*) trim(eqchease_out(index_out)%codeparam%output_diag(1)) + eqchease_out(index_out)%codeparam%output_flag = -323 return ENDIF ! @@ -932,7 +993,7 @@ SUBROUTINE IODISK(KOPT) write(0,*) '********** ERROR **********' write(0,*) 'Nans is some inputs, idumtot = ',idumtot write(0,*) '********** ERROR **********' - eqchease_out(index_out)%codeparam%output_flag = -1279 + eqchease_out(index_out)%codeparam%output_flag = -3231 return end if ! @@ -951,26 +1012,17 @@ SUBROUTINE IODISK(KOPT) end if ! ! AUXILIARY PARAMETERS - ! (COMMENT NEXT TWO LINES IF WANT TO CHANGE QSPEC IN NAMELIST) + ! IF (NVERBOSE .GE. 3) THEN - PRINT *,' QSPEC= ',QSPEC - PRINT *,' EQDSPSI(INRBOX,INZBOX)= ',EQDSPSI(INRBOX,INZBOX) - PRINT *,' QPSIIN= ',QPSIIN(1:INRBOX) - !IF (NSTTP .EQ. 5) QSPEC = RFUN(1) + WRITE(6,*) ' QSPEC= ',QSPEC + WRITE(6,*) ' EQDSPSI(INRBOX,INZBOX)= ',EQDSPSI(INRBOX,INZBOX) + WRITE(6,*) ' QPSIIN= ',QPSIIN(1:INRBOX) END IF - IF (QSPEC .GT. RC0P) THEN - QSPEC = ABS(QPSIIN(1)) - CSSPEC = 0.0_RKIND - ELSE - QSPEC = ABS(QSPEC) - ENDIF -!!$ IF (NSTTP .EQ. 5) THEN -!!$ QSPEC = RFUN(1) -!!$ NCSCAL = 4 -!!$ END IF + CALL SET_QSPEC_FROM_QARRAY_in(CSSPEC,QSPEC,NPPF1,QPSIIN,NVERBOSE) IF (NVERBOSE .GE. 3) THEN - PRINT *,' QSPEC= ',QSPEC - PRINT *,' NCSCAL= ',NCSCAL + WRITE(6,*) ' CSSPEC= ',CSSPEC + WRITE(6,*) ' QSPEC= ',QSPEC + WRITE(6,*) ' NCSCAL= ',NCSCAL END IF ! ! EQUIDISTANT MESH IN PSI @@ -980,14 +1032,14 @@ SUBROUTINE IODISK(KOPT) FCSM(I) = SQRT(REAL(I-1,RKIND)*ZCOF) END DO ! - IF (TENSPROF .NE. 0._RKIND) THEN + IF (TENSPROF .NE. 0._RKIND .AND. NPPFUN .NE. 8) THEN ! for pressure interpos used below when computing pprime call interpos(FCSM(1:NPPF1),RPPF(1:NPPF1),NPPF1,tension=TENSPROF, & & yout=ZTEMP(1:NPPF1),nbc=(/1,2/),ybc=(/RC0P, RPPF(NPPF1)/)) RPPF(1:NPPF1) = ZTEMP(1:NPPF1) call interpos(FCSM(1:NPPF1),RFUN(1:NPPF1),NPPF1,tension=TENSPROF, & & yout=ZTEMP(1:NPPF1),nbc=(/1,2/),ybc=(/RC0P, RFUN(NPPF1)/)) RFUN(1:NPPF1) = ZTEMP(1:NPPF1) - IF (NVERBOSE .GE. 1) print *,'Added smoothing of RFUNprofiles with TENSPROF = ',TENSPROF + IF (NVERBOSE .GE. 3) print *,'Added smoothing of input profiles with TENSPROF = ',TENSPROF END IF ! ! NORMALIZATION AND SIGNS, USE COCOS_IN INDEX @@ -1005,23 +1057,22 @@ SUBROUTINE IODISK(KOPT) END if ! Check some inputs IF (sign(RC1P,QPSIIN(INRBOX))*SIGNIPXP_IN*SIGNB0XP_IN*isigma_rhothetaphi .LT. 0.) THEN - IF (NVERBOSE .GE. 0) print *,'Input EQDSK is not consistent, q should be have sign(q)=', & + IF (NVERBOSE .GE. 3) print *,'Input EQDSK is not consistent, q should be have sign(q)=', & & SIGNIPXP_IN*SIGNB0XP_IN*isigma_rhothetaphi,' with COCOS_IN = ',COCOS_IN END IF IF (sign(RC1P,ZSIGN_G)*SIGNB0XP_IN .LT. 0) THEN - write(0,*) 'In iodisk: Input EQDSK is not consistent, SIGN(B0)=',SIGNB0XP_IN,' IS NOT EQUAL TO SIGN(G)=',sign(RC1P,ZSIGN_G) write(eqchease_out(index_out)%codeparam%output_diag(1),*) & & 'In iodisk: Input EQDSK is not consistent, SIGN(B0)=',SIGNB0XP_IN,' IS NOT EQUAL TO SIGN(G)=',sign(RC1P,ZSIGN_G) + write(0,*) trim(eqchease_out(index_out)%codeparam%output_diag(1)) END IF - IPPRIMEMAX = MAXLOC(abs(RPPF(1:NPPF1))) - IF (sign(RC1P,RPPF(ipprimemax(1))) .NE. -SIGNIPXP_IN*isigma_Bp) THEN + IF (sign(RC1P,ZPPRIME_MAX) .NE. -SIGNIPXP_IN*isigma_Bp) THEN print *,'Sign of pprime is not correct with respect to COCOS_IN = ',COCOS_IN - print *,'Sign of pprime = ',sign(RC1P,RPPF(ipprimemax(1))) + print *,'Sign of pprime = ',sign(RC1P,ZPPRIME_MAX) print *,'-SIGNIPXP_IN*isigma_Bp = ',-SIGNIPXP_IN*isigma_Bp write(eqchease_out(index_out)%codeparam%output_diag(1),*) & & 'In iodisk: Sign of pprime is not correct with respect to COCOS_IN = ',COCOS_IN write(eqchease_out(index_out)%codeparam%output_diag(1),*) & - & 'Sign of pprime = ',sign(RC1P,RPPF(ipprimemax(1))), & + & 'Sign of pprime = ',sign(RC1P,ZPPRIME_MAX), & & '; -SIGNIPXP_IN*isigma_Bp = ',-SIGNIPXP_IN*isigma_Bp END IF IF ((ZPSIAX .GT. ZPSIEDGE) .and. (SIGNIPXP_IN*isigma_Bp .GT. 0)) THEN @@ -1041,7 +1092,7 @@ SUBROUTINE IODISK(KOPT) ZCOFPP = SIGNIPXP_IN * isigma_Bp * (twopi)**iexp_Bp * ZMU0 * R0EXP**2 / ABS(B0EXP) ZCOFT = SIGNB0XP_IN / R0EXP / B0EXP ZCOFP = ZMU0 / B0EXP**2 - IF (NVERBOSE .GE. 1) PRINT *,'ZPSINORM, CURRT, ZCOFTTP, ZCOFPP, ZCOFT, ZCOFP = ', & + IF (NVERBOSE .GE. 3) WRITE(6,*) 'ZPSINORM, CURRT, ZCOFTTP, ZCOFPP, ZCOFT, ZCOFP = ', & & ZPSINORM, CURRT, ZCOFTTP, ZCOFPP, ZCOFT, ZCOFP ! ! NOW CAN IMPOSE B0EXP POSITIVE @@ -1056,12 +1107,30 @@ SUBROUTINE IODISK(KOPT) RZBPS(I) = RZBPS(I) * ZCOF END DO ! + ZCOF_RFUN = ZCOFTTP + IF (NSTTP .EQ. 5) ZCOF_RFUN = 1._RKIND + ZCOF_RPPF = ZCOFPP + IF (NPPFUN .EQ. 8) ZCOF_RPPF = ZCOFP DO I=1,NPPF1 - RFUN(I) = RFUN(I) * ZCOFTTP - RPPF(I) = RPPF(I) * ZCOFPP + RFUN(I) = RFUN(I) * ZCOF_RFUN + RPPF(I) = RPPF(I) * ZCOF_RPPF END DO PREDGE = PREDGE * ZCOFP ! + IF (NPPFUN .EQ. 8) THEN + IF (TENSPROF .NE. 0._RKIND) THEN + call interpos(FCSM(1:NPPF1)*FCSM(1:NPPF1),RPPF,NPPF1,tension=TENSPROF, & + & YOUTP=ZTEMPP,nbc=(/2,2/),ybc=(/RPPF(1), RPPF(NPPF1)/)) + ! call interpos(FCSM(1:NPPF1)*FCSM(1:NPPF1),RPPF,NPPF1,tension=TENSPROF, & + ! & YOUTP=ZTEMPP,nbc=(/1,2/),ybc=(/RC0P, RPPF(NPPF1)/)) + IF (NVERBOSE .GE. 3) print *,'Added smoothing of p profile with TENSPROF = ',TENSPROF + ELSE + call interpos(FCSM(1:NPPF1)*FCSM(1:NPPF1),RPPF,NPPF1,tension=TENSPROF, & + & YOUTP=ZTEMPP,nbc=(/0,0/),ybc=(/RC0P, RC0P/)) + END IF + RPPF(1:NPPF1)=ZTEMPP(1:NPPF1) ! RPPF = dp/dpsi_normalized + END IF + ! ! FIND PLASMA LIMITS IRMAX = ISMAX(NBPS,RRBPS,1) IRMIN = ISMIN(NBPS,RRBPS,1) @@ -1070,13 +1139,14 @@ SUBROUTINE IODISK(KOPT) RZ0 = 0.5_RKIND * (RZBPS(IZMIN) + RZBPS(IZMAX)) ASPCT = (RRBPS(IRMAX) - RRBPS(IRMIN)) & & / (RRBPS(IRMAX) + RRBPS(IRMIN)) - IF (NVERBOSE .GE. 1) WRITE(6,'(/,3(A,1PE13.4),/)') ' FROM EQDSK: ,R0GEOM= ', & + IF (NVERBOSE .GE. 3) WRITE(6,'(/,3(A,1PE13.4),/)') ' FROM EQDSK: ,R0GEOM= ', & & 0.5_RKIND * (RRBPS(IRMIN) + RRBPS(IRMAX)), & & ' Z0GEOM= ',RZ0,' INV. ASPECT RATIO= ',ASPCT ! ! Write equivalent expeq file in order to be able to test outside kepler if there is a problem IF (NVERBOSE .GE. 1) THEN - OPEN(UNIT=NXPQOUT,ACCESS='SEQUENTIAL',FORM='FORMATTED',FILE='EXPEQ_EQDSK.IN') + EXPEQ_IN_FILENAME = "EXPEQ_EQDSK.IN" + OPEN(UNIT=NXPQOUT,ACCESS='SEQUENTIAL',FORM='FORMATTED',FILE=TRIM(EXPEQ_IN_FILENAME)) REWIND(NXPQOUT) WRITE(NXPQOUT,1303) ASPCT,RZ0/R0EXP,PREDGE WRITE(NXPQOUT,1301) NBPS @@ -1096,18 +1166,17 @@ SUBROUTINE IODISK(KOPT) ! 35 CONTINUE ! READ MKSA VALUES - IF (NVERBOSE .GE. 1) PRINT *,'READS FILE EXPEQ ASSUMING AN EUITM STRUCTURE AND COCOS_IN = ',COCOS_IN + IF (NVERBOSE .GE. 3) WRITE(6,*) 'READS FILE EXPEQ ASSUMING AN EUITM STRUCTURE AND COCOS_IN = ',COCOS_IN ! ! for all cases: ! - print *,'index_in = ',index_in idumtot = 0 ZR0EXP = R0EXP ! NAMELIST VALUES ZB0EXP = B0EXP ! - CALL RVAR2('NAMELIST R0EXP',R0EXP,' B0EXP',B0EXP) + if (nverbose .ge. 3) CALL RVAR2('NAMELIST R0EXP',R0EXP,' B0EXP',B0EXP) ! ! Now machine values are usualy given and they should be the ones used for R0EXP/B0EXP, so first look at GLOBAL_PARAM%TOROID_FIELD -! but check if it is very different from EQGEOMETRY%GEOM_AXIS%R, if yes, use closest to geom from boundary + ! but check if it is very different from EQGEOMETRY%GEOM_AXIS%R, if yes, use closest to geom from boundary r0_global_toroid = EQCHEASE_IN(INDEX_IN)%GLOBAL_PARAM%TOROID_FIELD%R0 r0_eqgeom_geom = EQCHEASE_IN(INDEX_IN)%EQGEOMETRY%GEOM_AXIS%R if (EQCHEASE_IN(INDEX_IN)%GLOBAL_PARAM%TOROID_FIELD%R0 .GT. -1e+40_rkind) THEN @@ -1124,13 +1193,13 @@ SUBROUTINE IODISK(KOPT) write(0,*) '******* ERROR **********' write(0,*) 'EQCHEASE_IN(INDEX_IN)%EQGEOMETRY%BOUNDARY) not associated' write(0,*) '******* ERROR **********' - eqchease_out(index_out)%codeparam%output_flag = -1278 + eqchease_out(index_out)%codeparam%output_flag = -350 return else if (size(EQCHEASE_IN(INDEX_IN)%EQGEOMETRY%BOUNDARY) .lt. 1) then write(0,*) '******* ERROR **********' write(0,*) 'EQCHEASE_IN(INDEX_IN)%EQGEOMETRY%BOUNDARY) size < 1' write(0,*) '******* ERROR **********' - eqchease_out(index_out)%codeparam%output_flag = -1279 + eqchease_out(index_out)%codeparam%output_flag = -351 return else if (associated(EQCHEASE_IN(INDEX_IN)%EQGEOMETRY%BOUNDARY(1)%R)) then R0EXP = 0.5_rkind*(maxval(EQCHEASE_IN(INDEX_IN)%EQGEOMETRY%BOUNDARY(1)%R) + minval(EQCHEASE_IN(INDEX_IN)%EQGEOMETRY%BOUNDARY(1)%R)) @@ -1174,7 +1243,7 @@ SUBROUTINE IODISK(KOPT) write(0,*) '********** ERROR **********' write(0,*) 'Nans is some inputs, idumtot = ',idumtot write(0,*) '********** ERROR **********' - eqchease_out(index_out)%codeparam%output_flag = -1280 + eqchease_out(index_out)%codeparam%output_flag = -352 return end if ! @@ -1182,28 +1251,29 @@ SUBROUTINE IODISK(KOPT) write(0,*) '******* ERROR **********' write(0,*) 'EQCHEASE_IN(INDEX_IN)%EQGEOMETRY%BOUNDARY) not associated' write(0,*) '******* ERROR **********' - eqchease_out(index_out)%codeparam%output_flag = -12811 + eqchease_out(index_out)%codeparam%output_flag = -353 return else if (size(EQCHEASE_IN(INDEX_IN)%EQGEOMETRY%BOUNDARY) .lt. 1) then write(0,*) '******* ERROR **********' write(0,*) 'EQCHEASE_IN(INDEX_IN)%EQGEOMETRY%BOUNDARY) size < 1' write(0,*) '******* ERROR **********' - eqchease_out(index_out)%codeparam%output_flag = -12812 + eqchease_out(index_out)%codeparam%output_flag = -354 return else if (associated(EQCHEASE_IN(INDEX_IN)%EQGEOMETRY%BOUNDARY(1)%R) .AND. & & associated(EQCHEASE_IN(INDEX_IN)%EQGEOMETRY%BOUNDARY(1)%Z)) then NBPS = SIZE(EQCHEASE_IN(INDEX_IN)%EQGEOMETRY%BOUNDARY(1)%R) IF (NBPS .GT. NPBPS) THEN - write(0,*) 'NBPS= ',NBPS,' LARGER THAN NPBPS=',NPBPS,'.RECOMPILE WITH LARGER NPBPS' write(eqchease_out(index_out)%codeparam%output_diag(1),*) & & 'NBPS= ',NBPS,' LARGER THAN NPBPS=',NPBPS,'.RECOMPILE WITH LARGER NPBPS' - eqchease_out(index_out)%codeparam%output_flag = -12813 + write(0,*) trim(eqchease_out(index_out)%codeparam%output_diag(1)) + eqchease_out(index_out)%codeparam%output_flag = -355 return ENDIF RRBPS(1:NBPS) = EQCHEASE_IN(INDEX_IN)%EQGEOMETRY%BOUNDARY(1)%R(1:NBPS) RZBPS(1:NBPS) = EQCHEASE_IN(INDEX_IN)%EQGEOMETRY%BOUNDARY(1)%Z(1:NBPS) else - write(0,*) 'EQCHEASE_IN(INDEX_IN)%EQGEOMETRY%BOUNDARY(1)%R or EQCHEASE_IN(INDEX_IN)%EQGEOMETRY%BOUNDARY(1)%Z not associated' + eqchease_out(index_out)%codeparam%output_diag(1) = 'in iodisk: EQGEOMETRY%BOUNDARY(1)%R or %Z not associated' + write(0,*) trim(eqchease_out(index_out)%codeparam%output_diag(1)) write(0,*) 'EQCHEASE_IN(INDEX_IN)%EQGEOMETRY%BOUNDARY(1)%NPOINTS= ',size(EQCHEASE_IN(INDEX_IN)%EQGEOMETRY%BOUNDARY(1)%R) write(0,*) 'EQCHEASE_IN(INDEX_IN)%EQGEOMETRY%BOUNDARY(1)%R= ',EQCHEASE_IN(INDEX_IN)%EQGEOMETRY%BOUNDARY(1)%R write(0,*) 'EQCHEASE_IN(INDEX_IN)%EQGEOMETRY%BOUNDARY(1)%Z= ',EQCHEASE_IN(INDEX_IN)%EQGEOMETRY%BOUNDARY(1)%Z @@ -1211,8 +1281,7 @@ SUBROUTINE IODISK(KOPT) NBPS=size(EQCHEASE_IN(INDEX_IN)%EQGEOMETRY%BOUNDARY(1)%R) RRBPS(1:NBPS) = EQCHEASE_IN(INDEX_IN)%EQGEOMETRY%BOUNDARY(1)%R(1:NBPS) RZBPS(1:NBPS) = EQCHEASE_IN(INDEX_IN)%EQGEOMETRY%BOUNDARY(1)%Z(1:NBPS) - eqchease_out(index_out)%codeparam%output_diag(1) = 'in iodisk: EQGEOMETRY%BOUNDARY(1)%R or %Z not associated' - eqchease_out(index_out)%codeparam%output_flag = -1282 + eqchease_out(index_out)%codeparam%output_flag = -356 return end if ! @@ -1224,17 +1293,12 @@ SUBROUTINE IODISK(KOPT) write(0,*) '********** ERROR **********' write(0,*) 'Nans is some inputs, idumtot = ',idumtot write(0,*) '********** ERROR **********' - eqchease_out(index_out)%codeparam%output_flag = -12821 + eqchease_out(index_out)%codeparam%output_flag = -3561 return end if ! IF (TENSBND .NE. 0._RKIND) THEN IDUM = NBPS - print *,'size(ztemp)= ',size(ztemp),' NBPS= ',NBPS -!!$ print *,'RRBPS= ',RRBPS(1:NBPS) -!!$ print *,'RZBPS= ',RZBPS(1:NBPS) -!!$ print *,'TENSBND= ',TENSBND - call flush(6) call bndfit(RRBPS,RZBPS,NBPS,ZTEMP,ZTEMPP,IDUM,TENSBND) ! NBPS = IDUM RRBPS(1:NBPS) = ZTEMP(1:NBPS) @@ -1320,9 +1384,9 @@ SUBROUTINE IODISK(KOPT) if ( associated(eqchease_in(index_in)%profiles_1d%q) ) then QPSIIN(1:size(eqchease_in(index_in)%profiles_1d%q)) = SIGNIPXP_IN * SIGNB0XP_IN * isigma_rhothetaphi * & & eqchease_in(index_in)%profiles_1d%q(1:size(eqchease_in(index_in)%profiles_1d%q)) - IF (NVERBOSE .GE. 1) THEN - PRINT *,' Q(0)= ', QPSIIN(1) - PRINT *,' Q(EDGE)= ',QPSIIN(size(eqchease_in(index_in)%profiles_1d%q)) + IF (NVERBOSE .GE. 3) THEN + WRITE(6,*) ' Q(0)= ', QPSIIN(1) + WRITE(6,*) ' Q(EDGE)= ',QPSIIN(size(eqchease_in(index_in)%profiles_1d%q)) END IF else QPSIIN(1)=1._rkind @@ -1333,14 +1397,13 @@ SUBROUTINE IODISK(KOPT) if ((EQCHEASE_IN(INDEX_IN)%GLOBAL_PARAM%PSI_AX .gt. -1e+40_rkind) .AND. (EQCHEASE_IN(INDEX_IN)%GLOBAL_PARAM%PSI_BOUND .gt. -1e+40_rkind)) THEN ZPSIAX = EQCHEASE_IN(INDEX_IN)%GLOBAL_PARAM%PSI_AX ZPSIEDGE = EQCHEASE_IN(INDEX_IN)%GLOBAL_PARAM%PSI_BOUND - print *,'zpsiax, zpsiedge= ',zpsiax, zpsiedge else ! use 0, 1 with sign according to cocos: sign(dpsi)=sigma_Ip * sigma_Bp (assuming sigma_Ip is ok) ZPSIAX = 0.0_rkind ZPSIEDGE = sign(RC1P,isigma_Bp*SIGNIPXP_IN) IF (NVERBOSE .GE. 1) print *,'psiaxis and psiedge not given, choose from cocos_in convention and Ip sign' end if - IF (NVERBOSE .GE. 1) print *,' ZPSIAX= ',ZPSIAX,' ; ZPSIEDGE= ',ZPSIEDGE + IF (NVERBOSE .GE. 3) print *,' ZPSIAX= ',ZPSIAX,' ; ZPSIEDGE= ',ZPSIEDGE IF ((ZPSIAX .GT. ZPSIEDGE) .and. (SIGNIPXP_IN*isigma_Bp .GT. 0)) THEN IF (NVERBOSE .GE. 1) print *,'Input EQDSK is not consistent, psi should be increasing with COCOS_IN = ',COCOS_IN IF (NVERBOSE .GE. 1) print *,'dp/dpsi should be positive' @@ -1358,11 +1421,11 @@ SUBROUTINE IODISK(KOPT) fcsm(1:NPPF1)=SIGNIPXP_IN * isigma_Bp / twopi**iexp_Bp * eqchease_in(index_in)%profiles_1d%psi(1:NPPF1) / R0EXP**2 / B0EXP ZPSIAX = fcsm(1) ZPSIEDGE = fcsm(nppf1) - IF (NVERBOSE .GE. 1) print *,' ZPSIAX_CHEASE= ',ZPSIAX,' ; ZPSIEDGE_CHEASE= ',ZPSIEDGE + IF (NVERBOSE .GE. 3) print *,' ZPSIAX_CHEASE= ',ZPSIAX,' ; ZPSIEDGE_CHEASE= ',ZPSIEDGE else - write(0,*) 'in iodisk: profiles_1d%psi not associated, psi-mesh not given, return' eqchease_out(index_out)%codeparam%output_diag(1) = 'in iodisk: profiles_1d%psi not associated, psi-mesh not given, return' - eqchease_out(index_out)%codeparam%output_flag = -1283 + write(0,*) trim(eqchease_out(index_out)%codeparam%output_diag(1)) + eqchease_out(index_out)%codeparam%output_flag = -360 return end if ! s is sqrt(psi_norm) @@ -1382,11 +1445,11 @@ SUBROUTINE IODISK(KOPT) ! nrhomesh=1 is rhotornorm fcsm(1:NPPF1) = eqchease_in(index_in)%profiles_1d%rho_tor(1:NPPF1) if (fcsm(NPPF1) .EQ. 0) THEN - write(0,*) 'fcsm(NPPF1) = 0 from eqchease_in(index_in)%profiles_1d%rho_tor. Cannot continue' - flush(0) eqchease_out(index_out)%codeparam%output_diag(1) = & & 'in iodisk: fcsm(NPPF1) = 0 from eqchease_in(index_in)%profiles_1d%rho_tor. Cannot continue' - eqchease_out(index_out)%codeparam%output_flag = -1284 + write(0,*) trim(eqchease_out(index_out)%codeparam%output_diag(1)) + flush(0) + eqchease_out(index_out)%codeparam%output_flag = -361 return else fcsm(1:NPPF1) = fcsm(1:NPPF1) / fcsm(NPPF1) @@ -1394,18 +1457,18 @@ SUBROUTINE IODISK(KOPT) end if IF (NVERBOSE .GE. 3) print *,' fcsm(1)= ',fcsm(1),' ; fcsm(end)= ',fcsm(NPPF1) else - write(0,*) 'in iodisk: profiles_1d%rho_tor not associated; rho_tor mesh not given' eqchease_out(index_out)%codeparam%output_diag(1) = & & 'in iodisk: profiles_1d%rho_tor not associated; rho_tor mesh not given' - eqchease_out(index_out)%codeparam%output_flag = -1285 + write(0,*) trim(eqchease_out(index_out)%codeparam%output_diag(1)) + eqchease_out(index_out)%codeparam%output_flag = -362 return end if ELSE - write(0,*) 'Option NFUNRHO= ',NFUNRHO,' and NRHOMESH= ',NRHOMESH,' not yet implemented, ask O. Sauter' - flush(0) write(eqchease_out(index_out)%codeparam%output_diag(1),*) & & 'Option NFUNRHO= ',NFUNRHO,' and NRHOMESH= ',NRHOMESH,' not yet implemented, ask O. Sauter' - eqchease_out(index_out)%codeparam%output_flag = -1286 + write(0,*) trim(eqchease_out(index_out)%codeparam%output_diag(1)) + flush(0) + eqchease_out(index_out)%codeparam%output_flag = -363 return END IF call checknanos(FCSM,NPPF1,'NaNs in FCSM',idum) @@ -1433,10 +1496,10 @@ SUBROUTINE IODISK(KOPT) ! ! prepare so that can normalize on the fly the input quantities ! - IF (NVERBOSE .GE. 1) PRINT *,' R0EXP, ZRMAGXP, ZPSIAX, ZPSIEDGE, B0EXP, CURRT, COCOS_IN= ', & + IF (NVERBOSE .GE. 3) WRITE(6,*) ' R0EXP, ZRMAGXP, ZPSIAX, ZPSIEDGE, B0EXP, CURRT, COCOS_IN= ', & & R0EXP, ZRMAGXP, ZPSIAX, ZPSIEDGE, B0EXP, CURRT, COCOS_IN INTMF0 = 0 - IF (NVERBOSE .GE. 1) print *,'R0EXP, B0EXP= ',R0EXP, B0EXP + IF (NVERBOSE .GE. 3) print *,'R0EXP, B0EXP= ',R0EXP, B0EXP ! ! NORMALIZATION AND SIGNS, USE COCOS PAPER ! @@ -1449,12 +1512,12 @@ SUBROUTINE IODISK(KOPT) ! ZMU0 = 4.E-07_RKIND * CPI CURRT = CURRT*ZMU0/R0EXP/B0EXP - ZCOFTTP = 1._RKIND / B0EXP !LILY ZCOFTTP = ZOFQ ATTENTION VERIFIER S'IL NE MANQUE PAS UN FACTEUR 2pi + ZCOFTTP = 1._RKIND / B0EXP ZCOFPP = ZMU0 * R0EXP**2 / B0EXP ZCOFT = 1._RKIND / R0EXP / B0EXP ZCOFP = ZMU0 / B0EXP**2 ZCOFJ = ZMU0*R0EXP/B0EXP - IF (NVERBOSE .GE. 1) print *,'ZPSINORM, CURRT, ZCOFTTP, ZCOFPP, ZCOFT, ZCOFP = ', & + IF (NVERBOSE .GE. 3) print *,'ZPSINORM, CURRT, ZCOFTTP, ZCOFPP, ZCOFT, ZCOFP = ', & & ZPSINORM, CURRT, ZCOFTTP, ZCOFPP, ZCOFT, ZCOFP ! ! NORMALIZE USING R0EXP AND B0EXP @@ -1470,12 +1533,12 @@ SUBROUTINE IODISK(KOPT) ! specific inputs to be used ! if ((nppfun .eq. 4) .and. (.not. associated(eqchease_in(index_in)%profiles_1d%pprime)) ) then - write(0,*) 'WARNING*******************' - write(0,*) 'pprime not associated, changed nppfun from 4 to 8 and try with pressure profile' - write(0,*) 'WARNING*******************' eqchease_out(index_out)%codeparam%output_diag(1) = 'warning in output_diag(2)' eqchease_out(index_out)%codeparam%output_diag(2) = & & 'in iodisk: pprime not associated, changed nppfun from 4 to 8 and try with pressure profile' + write(0,*) 'WARNING*******************' + write(0,*) trim(eqchease_out(index_out)%codeparam%output_diag(2)) + write(0,*) 'WARNING*******************' nppfun = 8 end if if (nppfun .eq. 4) then @@ -1487,13 +1550,13 @@ SUBROUTINE IODISK(KOPT) call interpos(FCSM(1:NPPF1_eff),RPPF(1:NPPF1_eff),NPPF1_eff,tension=TENSPROF, & & yout=ZTEMP(1:NPPF1_eff),nbc=(/1,2/),ybc=(/RC0P, RPPF(NPPF1_eff)/)) rppf(1:NPPF1_eff) = ZTEMP(1:NPPF1_eff) - IF (NVERBOSE .GE. 1) print *,'Added smoothing of RPPF profile with TENSPROF = ',TENSPROF + IF (NVERBOSE .GE. 3) print *,'Added smoothing of RPPF profile with TENSPROF = ',TENSPROF END IF else - write(0,*) 'in iodisk: profiles_1d%pprime not associated. ' - flush(0) eqchease_out(index_out)%codeparam%output_diag(1) = 'in iodisk: profiles_1d%pprime not associated.' - eqchease_out(index_out)%codeparam%output_flag = -1287 + write(0,*) trim(eqchease_out(index_out)%codeparam%output_diag(1)) + flush(0) + eqchease_out(index_out)%codeparam%output_flag = -366 return end if elseif (nppfun .eq. 8) then @@ -1510,13 +1573,13 @@ SUBROUTINE IODISK(KOPT) write(0,*) '********** ERROR **********' write(0,*) 'Nans is some inputs, j = ',j write(0,*) '********** ERROR **********' - eqchease_out(index_out)%codeparam%output_flag = -1288 + eqchease_out(index_out)%codeparam%output_flag = -3671 return end if else - write(0,*) ' in iodisk: need p, eqchease_in(index_in)%profiles_1d%pressure not associated ' eqchease_out(index_out)%codeparam%output_diag(1) = ' in iodisk: need p, eqchease_in(index_in)%profiles_1d%pressure not associated ' - eqchease_out(index_out)%codeparam%output_flag = -1289 + write(0,*) trim(eqchease_out(index_out)%codeparam%output_diag(1)) + eqchease_out(index_out)%codeparam%output_flag = -367 return end if IF (PREDGE .LT. RC0P) THEN @@ -1530,7 +1593,7 @@ SUBROUTINE IODISK(KOPT) IF (TENSPROF .NE. 0._RKIND) THEN call interpos(FCSM(1:NPPF1_eff)*FCSM(1:NPPF1_eff),RPPF(1:NPPF1_eff),NPPF1_eff,tension=TENSPROF, & & YOUTP=ZTEMPP,nbc=(/2,2/),ybc=(/RPPF(1), RPPF(NPPF1_eff)/)) - IF (NVERBOSE .GE. 1) print *,'Added smoothing of p profile with TENSPROF = ',TENSPROF + IF (NVERBOSE .GE. 3) print *,'Added smoothing of p profile with TENSPROF = ',TENSPROF ELSE call interpos(FCSM(1:NPPF1_eff)*FCSM(1:NPPF1_eff),RPPF(1:NPPF1_eff),NPPF1_eff,tension=TENSPROF, & & YOUTP=ZTEMPP,nbc=(/0,0/),ybc=(/RC0P, RC0P/)) @@ -1542,11 +1605,11 @@ SUBROUTINE IODISK(KOPT) ! So has to compute dp/dpsi or dp/dpsi_norm on psi at each interation ! RPPF(1:NPPF1) = p(drho_tor_in_norm) ELSE - WRITE(0,*) 'OPTION NOT YET IMPLMENTED: NPPFUN=8 AND NFUNRHO= ',NFUNRHO,' , NRHOMESH= ',NRHOMESH - FLUSH(0) write(eqchease_out(index_out)%codeparam%output_diag(1),*) & & ' in iodisk: OPTION NOT YET IMPLMENTED: NPPFUN=8 AND NFUNRHO= ',NFUNRHO,' , NRHOMESH= ',NRHOMESH - eqchease_out(index_out)%codeparam%output_flag = -1290 + WRITE(0,*) trim(eqchease_out(index_out)%codeparam%output_diag(1)) + FLUSH(0) + eqchease_out(index_out)%codeparam%output_flag = -368 return END IF ! @@ -1555,13 +1618,14 @@ SUBROUTINE IODISK(KOPT) flush(0) eqchease_out(index_out)%codeparam%output_diag(1) = & & ' in iodisk: should have nppfun=4 or 8 if reading from array inputeqchease_in(index_in)%profiles_1d...' - eqchease_out(index_out)%codeparam%output_flag = -1291 + eqchease_out(index_out)%codeparam%output_flag = -369 return end if ! ! Write equivalent expeq file in order to be able to test outside kepler if there is a problem IF (NVERBOSE .GE. 1) THEN - OPEN(UNIT=NXPQOUT,ACCESS='SEQUENTIAL',FORM='FORMATTED',FILE='EXPEQ_KEPLER.IN') + EXPEQ_IN_FILENAME = "EXPEQ_KEPLER.IN" + OPEN(UNIT=NXPQOUT,ACCESS='SEQUENTIAL',FORM='FORMATTED',FILE=TRIM(EXPEQ_IN_FILENAME)) REWIND(NXPQOUT) WRITE(NXPQOUT,1303) ASPCT,RZ0C/R0EXP,PREDGE WRITE(NXPQOUT,1301) NBPS @@ -1584,19 +1648,19 @@ SUBROUTINE IODISK(KOPT) rfun(1:NPPF1) = SIGNIPXP_IN * isigma_Bp * twopi**iexp_Bp * eqchease_in(index_in)%profiles_1d%ffprime(1:NPPF1) * ZCOFTTP RFUN(1:NPPF1_eff) = RFUN(iFCSM(1:NPPF1_eff)) else - write(0,*) 'in iodisk: profiles_1d%ffprime not associated. stop' eqchease_out(index_out)%codeparam%output_diag(1) = & - & 'in iodisk: profiles_1d%ffprime not associated. stop' - eqchease_out(index_out)%codeparam%output_flag = -1292 + & 'in iodisk: profiles_1d%ffprime not associated. return' + write(0,*) trim(eqchease_out(index_out)%codeparam%output_diag(1)) + eqchease_out(index_out)%codeparam%output_flag = -371 return end if !!$ ! G to use G(end) to check r0*b0 !!$ IF ( ASSOCIATED(EQCHEASE_IN(INDEX_IN)%PROFILES_1D%F_DIA) ) THEN !!$ RFUN = EQCHEASE_IN(INDEX_IN)%PROFILES_1D%F_DIA -!!$ PRINT *,'F_DIA ASSOCIATED' +!!$ WRITE(6,*) 'F_DIA ASSOCIATED' !!$ ELSE !!$ RFUN(1:NPPF1) = -1 -!!$ PRINT *,'F_DIA NOT ASSOCIATED' +!!$ WRITE(6,*) 'F_DIA NOT ASSOCIATED' !!$ END IF ! elseif (nsttp .eq. 2) then @@ -1607,41 +1671,30 @@ SUBROUTINE IODISK(KOPT) rfun(1:NPPF1) = SIGNIPXP_IN * eqchease_in(index_in)%profiles_1d%jphi(1:NPPF1) * zcofj RFUN(1:NPPF1_eff) = RFUN(iFCSM(1:NPPF1_eff)) elseif ( associated(eqchease_in(index_in)%profiles_1d%jparallel) ) then - print *,'******************************************************' - print *,'jphi not associated, but jparallel is, so use it at this stage' - print *,'******************************************************' + write(0,*) '******************************************************' + write(0,*) 'jphi not associated, but jparallel is, so use it at this stage' + write(0,*) '******************************************************' rfun(1:NPPF1) = SIGNIPXP_IN * eqchease_in(index_in)%profiles_1d%jparallel(1:NPPF1) * zcofj RFUN(1:NPPF1_eff) = RFUN(iFCSM(1:NPPF1_eff)) else - write(0,*) 'in iodisk: profiles_1d%jphi not associated, nor profiles_1d%jparallel. stop' eqchease_out(index_out)%codeparam%output_diag(1) = & - & 'in iodisk: profiles_1d%jphi not associated, nor profiles_1d%jparallel. stop' - eqchease_out(index_out)%codeparam%output_flag = -1293 + & 'in iodisk: profiles_1d%jphi not associated, nor profiles_1d%jparallel. return' + write(0,*) trim(eqchease_out(index_out)%codeparam%output_diag(1)) + eqchease_out(index_out)%codeparam%output_flag = -372 return end if ! if (rfun(1) .lt. 0._rkind) then - print *,' Istar<0? wrong sign ?' - print *,'eqchease_in(index_in)%profiles_1d%jparallel(1) = ',eqchease_in(index_in)%profiles_1d%jparallel(1) - print *,'eqchease_in(index_in)%profiles_1d%jphi(1) = ',eqchease_in(index_in)%profiles_1d%jparallel(1) - print *,'EQCHEASE_IN(INDEX_IN)%GLOBAL_PARAM%I_PLASMA= ', EQCHEASE_IN(INDEX_IN)%GLOBAL_PARAM%I_PLASMA - print *,'use abs(rfun)' + if (nverbose .ge. 3) then + print *,' Istar<0? wrong sign ?' + print *,'eqchease_in(index_in)%profiles_1d%jparallel(1) = ',eqchease_in(index_in)%profiles_1d%jparallel(1) + print *,'eqchease_in(index_in)%profiles_1d%jphi(1) = ',eqchease_in(index_in)%profiles_1d%jparallel(1) + print *,'EQCHEASE_IN(INDEX_IN)%GLOBAL_PARAM%I_PLASMA= ', EQCHEASE_IN(INDEX_IN)%GLOBAL_PARAM%I_PLASMA + print *,'use abs(rfun)' + end if RFUN(1:NPPF1_eff) = abs(RFUN(1:NPPF1_eff)) end if ! - elseif (nsttp .eq. 5) then !LILY - ! - if ( associated(eqchease_in(index_in)%profiles_1d%q)) then - rfun(1:NPPF1) = abs(eqchease_in(index_in)%profiles_1d%q(1:NPPF1)) ! ATTENTION : que represente SIGNIPXP_IN ?? - RFUN(1:NPPF1_eff) = RFUN(iFCSM(1:NPPF1_eff)) - else - write(0,*) 'in iodisk: profiles_1d%q not associated. stop' - eqchease_out(index_out)%codeparam%output_diag(1) = & - & 'in iodisk: profiles_1d%q not associated. stop' - eqchease_out(index_out)%codeparam%output_flag = -1294 - return - end if - ! elseif (nsttp .eq. 3) then ! ! jpar, Ipar not defined as ITM jpar=<j.B>/B0 @@ -1667,21 +1720,23 @@ SUBROUTINE IODISK(KOPT) rfun(1:NPPF1) = SIGNIPXP_IN * eqchease_in(index_in)%profiles_1d%jphi(1:NPPF1) * zcofj RFUN(1:NPPF1_eff) = RFUN(iFCSM(1:NPPF1_eff)) else - write(0,*) 'in iodisk: profiles_1d%jphi not associated. stop' eqchease_out(index_out)%codeparam%output_diag(1) = & - & 'in iodisk: profiles_1d%jphi not associated. stop' - eqchease_out(index_out)%codeparam%output_flag = -1295 + & 'in iodisk: profiles_1d%jphi not associated. return' + write(0,*) trim(eqchease_out(index_out)%codeparam%output_diag(1)) + eqchease_out(index_out)%codeparam%output_flag = -374 return end if end if ! if (rfun(1) .lt. 0._rkind) then - print *,' Istar<0? wrong sign ?' - print *,'eqchease_in(index_in)%profiles_1d%jparallel(1) = ',eqchease_in(index_in)%profiles_1d%jparallel(1) - print *,'eqchease_in(index_in)%profiles_1d%jphi(1) = ',eqchease_in(index_in)%profiles_1d%jparallel(1) - print *,'EQCHEASE_IN(INDEX_IN)%GLOBAL_PARAM%I_PLASMA= ', EQCHEASE_IN(INDEX_IN)%GLOBAL_PARAM%I_PLASMA - print *,'eqchease_in(index_in)%profiles_1d%f_dia(1) = ',eqchease_in(index_in)%profiles_1d%f_dia(1) - print *,'use abs(rfun)' + if (nverbose .ge. 3) then + print *,' Istar<0? wrong sign ?' + print *,'eqchease_in(index_in)%profiles_1d%jparallel(1) = ',eqchease_in(index_in)%profiles_1d%jparallel(1) + print *,'eqchease_in(index_in)%profiles_1d%jphi(1) = ',eqchease_in(index_in)%profiles_1d%jparallel(1) + print *,'EQCHEASE_IN(INDEX_IN)%GLOBAL_PARAM%I_PLASMA= ', EQCHEASE_IN(INDEX_IN)%GLOBAL_PARAM%I_PLASMA + print *,'eqchease_in(index_in)%profiles_1d%f_dia(1) = ',eqchease_in(index_in)%profiles_1d%f_dia(1) + print *,'use abs(rfun)' + end if RFUN(1:NPPF1_eff) = abs(RFUN(1:NPPF1_eff)) end if ! @@ -1697,28 +1752,43 @@ SUBROUTINE IODISK(KOPT) rfun(1:NPPF1) = SIGNIPXP_IN * eqchease_in(index_in)%profiles_1d%jphi(1:NPPF1) * zcofj RFUN(1:NPPF1_eff) = RFUN(iFCSM(1:NPPF1_eff)) else - write(0,*) 'in iodisk: profiles_1d%jphi and jpar not associated. stop' eqchease_out(index_out)%codeparam%output_diag(1) = & - & 'in iodisk: profiles_1d%jphi and jpar not associated. stop' - eqchease_out(index_out)%codeparam%output_flag = -1296 + & 'in iodisk: profiles_1d%jphi and jpar not associated. return' + write(0,*) trim(eqchease_out(index_out)%codeparam%output_diag(1)) + eqchease_out(index_out)%codeparam%output_flag = -375 return end if end if ! if (rfun(1) .lt. 0._rkind) then - print *,' Istar<0? wrong sign ?' - print *,'eqchease_in(index_in)%profiles_1d%jparallel(1) = ',eqchease_in(index_in)%profiles_1d%jparallel(1) - print *,'eqchease_in(index_in)%profiles_1d%jphi(1) = ',eqchease_in(index_in)%profiles_1d%jparallel(1) - print *,'EQCHEASE_IN(INDEX_IN)%GLOBAL_PARAM%I_PLASMA= ', EQCHEASE_IN(INDEX_IN)%GLOBAL_PARAM%I_PLASMA - print *,'eqchease_in(index_in)%profiles_1d%f_dia(1) = ',eqchease_in(index_in)%profiles_1d%f_dia(1) - print *,'use abs(rfun)' + if (nverbose .ge. 3) then + print *,' Istar<0? wrong sign ?' + print *,'eqchease_in(index_in)%profiles_1d%jparallel(1) = ',eqchease_in(index_in)%profiles_1d%jparallel(1) + print *,'eqchease_in(index_in)%profiles_1d%jphi(1) = ',eqchease_in(index_in)%profiles_1d%jparallel(1) + print *,'EQCHEASE_IN(INDEX_IN)%GLOBAL_PARAM%I_PLASMA= ', EQCHEASE_IN(INDEX_IN)%GLOBAL_PARAM%I_PLASMA + print *,'eqchease_in(index_in)%profiles_1d%f_dia(1) = ',eqchease_in(index_in)%profiles_1d%f_dia(1) + print *,'use abs(rfun)' + end if RFUN(1:NPPF1_eff) = abs(RFUN(1:NPPF1_eff)) end if ! + elseif (nsttp .eq. 5) then + ! + if ( associated(eqchease_in(index_in)%profiles_1d%q)) then + rfun(1:NPPF1) = abs(eqchease_in(index_in)%profiles_1d%q(1:NPPF1)) + RFUN(1:NPPF1_eff) = RFUN(iFCSM(1:NPPF1_eff)) + else + eqchease_out(index_out)%codeparam%output_diag(1) = & + & 'in iodisk: profiles_1d%q not associated. return' + write(0,*) trim(eqchease_out(index_out)%codeparam%output_diag(1)) + eqchease_out(index_out)%codeparam%output_flag = -373 + return + end if + ! else - write(0,*) ' case nsttp= ',nsttp,' not defined yet' write(eqchease_out(index_out)%codeparam%output_diag(1),*) ' case nsttp= ',nsttp,' not defined yet' - eqchease_out(index_out)%codeparam%output_flag = -1297 + write(0,*) trim(eqchease_out(index_out)%codeparam%output_diag(1)) + eqchease_out(index_out)%codeparam%output_flag = -376 return ! end if @@ -1732,16 +1802,16 @@ SUBROUTINE IODISK(KOPT) write(0,*) '********** ERROR **********' write(0,*) 'Nans is some inputs, idumtot = ',idumtot write(0,*) '********** ERROR **********' - eqchease_out(index_out)%codeparam%output_flag = -12971 + eqchease_out(index_out)%codeparam%output_flag = -3771 return end if IF (TENSPROF .NE. 0._RKIND) THEN call interpos(FCSM(1:NPPF1_eff),RFUN(1:NPPF1_eff),NPPF1_eff,tension=TENSPROF, & & yout=ZTEMP(1:NPPF1_eff),nbc=(/1,2/),ybc=(/RC0P, RFUN(NPPF1_eff)/)) rfun(1:NPPF1_eff) = ZTEMP(1:NPPF1_eff) - IF (NVERBOSE .GE. 1) print *,'Added smoothing of RFUNprofile with TENSPROF = ',TENSPROF + IF (NVERBOSE .GE. 3) print *,'Added smoothing of RFUNprofile with TENSPROF = ',TENSPROF END IF - IF (NVERBOSE .GE. 1) THEN + IF (NVERBOSE .GE. 3) THEN WRITE(NXPQOUT,1303) (rfun(L), L=1,NPPF1_eff) if (nppfun .eq. 8) then WRITE(NXPQOUT,1303) (rppf(L), L=1,NPPF1_eff) @@ -1765,12 +1835,7 @@ SUBROUTINE IODISK(KOPT) print *,' QPSIIN= ',QPSIIN(1:nppf1) !IF (NSTTP .EQ. 5) QSPEC = RFUN(1) END IF - IF ((QSPEC .GT. RC0P) .and. (abs(QPSIIN(1)) .GT. RC0P)) THEN - QSPEC = abs(QPSIIN(1)) - CSSPEC = 0.0_RKIND - ELSE - QSPEC = ABS(QSPEC) - ENDIF + CALL SET_QSPEC_FROM_QARRAY_IN(CSSPEC,QSPEC,NPPF1,QPSIIN,NVERBOSE) !!$ IF (NSTTP .EQ. 5) THEN !!$ QSPEC = RFUN(1) !!$ NCSCAL= 4 @@ -1798,7 +1863,7 @@ SUBROUTINE IODISK(KOPT) RZ0 = 0.5_RKIND * (RZBPS(IZMIN) + RZBPS(IZMAX)) ASPCT = (RRBPS(IRMAX) - RRBPS(IRMIN)) & & / (RRBPS(IRMAX) + RRBPS(IRMIN)) - IF (NVERBOSE .GE. 1) WRITE(6,'(/,3(A,1PE13.4),/)') ' FROM euitm: ,R0GEOM= ', & + IF (NVERBOSE .GE. 3) WRITE(6,'(/,3(A,1PE13.4),/)') ' FROM euitm: ,R0GEOM= ', & & 0.5_RKIND * (RRBPS(IRMIN) + RRBPS(IRMAX)), & & ' Z0GEOM= ',RZ0,' INV. ASPECT RATIO= ',ASPCT ! @@ -1831,12 +1896,28 @@ SUBROUTINE IODISK(KOPT) ! 5. SAVE QUANTITIES FOR XTOR INTO "OUTXTOR", NIDEAL = 5 ! 50 CONTINUE + ! + INUM = 12 * NT + ZDT = TWOPI / REAL(INUM,RKIND) + DO J=1,INUM + ZT(J) = REAL(J-1,RKIND) * ZDT + END DO + ! + CALL BOUND(INUM,ZT,ZBND) + ! + DO J=1,INUM + ZR(J) = R0 + ZBND(J) * COS(ZT(J)) + ZZ(J) = RZ0 + ZBND(J) * SIN(ZT(J)) + END DO + ! + IMX = ISMAX(12*NT,ZR,1) + IMN = ISMIN(12*NT,ZR,1) ! OPEN(NXTOR,FILE='OUTXTOR',FORM='UNFORMATTED') REWIND NXTOR ! WRITE(NXTOR) 2*NPSI, NTNOVA - WRITE(NXTOR) RC / ASPCT, RMAG, RZMAG + WRITE(NXTOR) 0.5_rkind*(ZR(IMX)+ZR(IMN)) / ASPCT, RMAG, RZMAG ! WRITE(NXTOR) NCHI,MDT ! @@ -1898,10 +1979,10 @@ SUBROUTINE IODISK(KOPT) WRITE(NXPQOUT,1303) CP0,(CPR(L),L=1,NISO1EFF) WRITE(NXPQTOR,1303) CP0,(CPR(L),L=1,NISO1EFF) else - write(0,*) 'in iodisk: error with Ippfun = ',Ippfun - flush(0) write(eqchease_out(index_out)%codeparam%output_diag(1),*) 'in iodisk: error with Ippfun = ',Ippfun - eqchease_out(index_out)%codeparam%output_flag = -1298 + write(0,*) trim(eqchease_out(index_out)%codeparam%output_diag(1)) + flush(0) + eqchease_out(index_out)%codeparam%output_flag = -600 return end if ! @@ -1967,19 +2048,19 @@ SUBROUTINE IODISK(KOPT) ! USE TRANSFORMATIONS AS GIVEN IN SEC. III OF COCOS PAPER (Sauter and Medvedev in chease/trunk) ! IF (B0EXP .LT. 0._RKIND) THEN - write(0,*) 'B0EXP SHOULD BE POSITIVE. USE SIGNB0XP FOR SIGN OF B0EXP' - write(0,*) 'STOP IN IODISK FOR EQDSK OUT' eqchease_out(index_out)%codeparam%output_diag(1) = 'in iodisk: B0EXP SHOULD BE POSITIVE. USE SIGNB0XP FOR SIGN OF B0EXP' eqchease_out(index_out)%codeparam%output_diag(2) = 'return IN IODISK FOR EQDSK OUT' - eqchease_out(index_out)%codeparam%output_flag = -1299 + write(0,*) trim(eqchease_out(index_out)%codeparam%output_diag(1)) + write(0,*) trim(eqchease_out(index_out)%codeparam%output_diag(2)) + eqchease_out(index_out)%codeparam%output_flag = -700 return ENDIF IF (CURRT .LT. 0._RKIND) THEN - write(0,*) 'CURRT SHOULD BE POSITIVE. USE SIGNIPXP FOR SIGN OF IP' - write(0,*) 'STOP IN IODISK FOR EQDSK OUT' eqchease_out(index_out)%codeparam%output_diag(1) = 'in iodisk: CURRT SHOULD BE POSITIVE. USE SIGNIPXP FOR SIGN OF IP' eqchease_out(index_out)%codeparam%output_diag(2) = 'return IN IODISK FOR EQDSK OUT' - eqchease_out(index_out)%codeparam%output_flag = -129910 + write(0,*) trim(eqchease_out(index_out)%codeparam%output_diag(1)) + write(0,*) trim(eqchease_out(index_out)%codeparam%output_diag(2)) + eqchease_out(index_out)%codeparam%output_flag = -701 return ENDIF ! @@ -2017,8 +2098,8 @@ SUBROUTINE IODISK(KOPT) ! ZMU0 = 4.E-07_RKIND * CPI IF (R0EXP.EQ.1 .AND. B0EXP.EQ.1) THEN - PRINT *,'R0EXP=1 AND B0EXP=1. This used to imply mu0=1, but can be misleading on reading the EQDSK file' - PRINT *,'THUS ZMU0 = 1.0_RKIND IS NOT SET ANYMORE' + WRITE(6,*) 'R0EXP=1 AND B0EXP=1. This used to imply mu0=1, but can be misleading on reading the EQDSK file' + WRITE(6,*) 'THUS ZMU0 = 1.0_RKIND IS NOT SET ANYMORE' ! ZMU0 = 1.0_RKIND END IF WRITE(NUEQDSK,9381) RITOT*R0EXP*B0EXP/ZMU0, & @@ -2111,7 +2192,7 @@ SUBROUTINE IODISK(KOPT) WRITE(NUEQDSK,1204) NBPSOUT, NWALLPOS WRITE(NUEQDSKCOCOS,1204) NBPSOUT, NWALLPOS ZCOF = R0EXP - print *,'(RZMAG-RZMGEQD)*ZCOF= ',(RZMAG-RZMGEQD)*ZCOF + if (nverbose .ge. 3) print *,'(RZMAG-RZMGEQD)*ZCOF= ',(RZMAG-RZMGEQD)*ZCOF WRITE(NUEQDSK,9381) (RRBPSOU(I)*ZCOF, & & (RZBPSOU(I)-ZSHIFTZ)*ZCOF,I=1,NBPSOUT) WRITE(NUEQDSKCOCOS,9381) (RRBPSOU(I)*ZCOF, & @@ -2462,9 +2543,9 @@ SUBROUTINE IODISK(KOPT) ! SMISO end point is NISO1EFF, so cannot have IS+1 or IS+2 for IS = NISO1EFF IF (IS .GT. NISO1EFF-2) THEN IS = NISO1EFF - 2 - write(0,*) ' OS: SHOULD NEVER be here... so stop and ask O. Sauter' - eqchease_out(index_out)%codeparam%output_diag(1) = 'in iodisk: OS: SHOULD NEVER be here... so stop and ask O. Sauter' - eqchease_out(index_out)%codeparam%output_flag = -129920 + eqchease_out(index_out)%codeparam%output_diag(1) = 'in iodisk: OS: SHOULD NEVER be here... so return and ask O. Sauter' + write(0,*) trim(eqchease_out(index_out)%codeparam%output_diag(1)) + eqchease_out(index_out)%codeparam%output_flag = -1300 return END IF ! @@ -2573,3 +2654,66 @@ SUBROUTINE IODISK(KOPT) 9381 FORMAT(1P,5E16.9) ! END SUBROUTINE IODISK + +SUBROUTINE WRITE_INFO_NPPFUN(IOSTATUS,NPPFUN_IN,NPPFUN) + ! + ! Check when reading EXPEQ + ! NPPFUN might be read under full or mixed profiles provided as array, hence 2 checks at this stage + ! + IMPLICIT NONE + INTEGER, INTENT(IN) :: IOSTATUS,NPPFUN_IN + INTEGER, INTENT(INOUT) :: NPPFUN + CHARACTER :: TEXT_WARNING*132 + ! + IF (IOSTATUS .EQ. 0) THEN + ! BOTH INPUTS GIVEN, CHECK CONSISTENCY + IF (NPPFUN_IN .NE. NPPFUN) THEN + WRITE(TEXT_WARNING,'(A,I2,A)') 'WARNING: INPUT PRESSURE PROFILE IS NPPFUN_IN =',NPPFUN_IN, & + & ', NAMELIST VALUE CHANGED TO THIS SINCE INCONSISTENT' + WRITE(0,'(A)') TRIM(TEXT_WARNING) + WRITE(6,'(A)') TRIM(TEXT_WARNING) + NPPFUN = NPPFUN_IN + END IF + ELSEIF (IOSTATUS .LT. 0) THEN + WRITE(6,*) 'WARNING: COULD NOT CHECK NPPFUN FROM EXPEQ FILE' + ELSE + TEXT_WARNING = 'WARNING: PROBLEM READIN NB POINTS AND NPPFUN IN EXPEQ' + WRITE(0,'(A)') TRIM(TEXT_WARNING) + WRITE(6,'(A)') TRIM(TEXT_WARNING) + END IF + +END SUBROUTINE WRITE_INFO_NPPFUN + +SUBROUTINE SET_QSPEC_FROM_QARRAY_in(CSSPEC,QSPEC,NPPF1,QPSIIN,NVERBOSE) + ! + ! Set q target (qspec) from input q profile from eqdsk or IDS database + ! + ! Allow for value to be set from namelist if given negative + ! Otherwise use q(0) or q(edge) depending if CSSPEC<=0.5 or not (avoid interpolation at this stage) + ! + ! Previously, only csspec=0 was allowed + ! + USE prec_const + IMPLICIT NONE + INTEGER, intent(in) :: NPPF1, NVERBOSE + REAL(RKIND), intent(inout) :: CSSPEC, QSPEC + REAL(RKIND), intent(in) :: QPSIIN(1:NPPF1) + ! + IF (NVERBOSE .GE. 3) & + & WRITE(6,*) ' To specify QSPEC and CSSPEC from namelist, set QSPEC<0, then abs(QSPEC) at CSSPEC will be used, other qin(0)' + + IF (QSPEC .LT. 0._RKIND) THEN + ! keep CSSPEC/QSPEC from namelist + QSPEC = ABS(QSPEC) + ELSE + ! At this stage use either q0 or qedge from input eqdsk + IF ((abs(QPSIIN(1)) .GT. 0._RKIND) .AND. (CSSPEC .LE. 0.5_RKIND)) THEN + QSPEC = abs(QPSIIN(1)) + CSSPEC = 0.0_RKIND + ELSEIF ((abs(QPSIIN(NPPF1)) .GT. 0._RKIND) .AND. (CSSPEC .GT. 0.5_RKIND)) THEN + QSPEC = abs(QPSIIN(NPPF1)) + CSSPEC = 1.0_RKIND + ENDIF + ENDIF + +END SUBROUTINE SET_QSPEC_FROM_QARRAY_in diff --git a/src-f90/isofun.f90 b/src-f90/isofun.f90 index 6af4becd851ecb7da43c2e8ddb4fcefdf1e9adac..c1bee754cb158e7662e0b8254efb09702a5102cd 100644 --- a/src-f90/isofun.f90 +++ b/src-f90/isofun.f90 @@ -41,12 +41,12 @@ SUBROUTINE ISOFUN(KN) REAL(RKIND) :: ZPISO REAL(RKIND) :: ZS REAL(RKIND) :: ZS1 - INTEGER :: J1 + INTEGER :: J1, NPPF1 REAL(RKIND) :: ZCPPR INTEGER :: KN ! ! REAL(RKIND) :: X1(NISO1EFF) - REAL(RKIND) :: X2(NISO1EFF) + REAL(RKIND) :: X2(NISO1EFF), zrhotornorm(NISO1EFF) REAL(RKIND) :: Qtarget(NISO1EFF), dX2dpsi(NISO1EFF) INTEGER, SAVE :: ncount = 0 REAL(RKIND) :: alpha, sigma_psi(NISO1EFF+1) @@ -96,23 +96,23 @@ SUBROUTINE ISOFUN(KN) ! !%OS CALL SPLINE(IN,SMISO,ZCPPR,ZD2PPR,ZWORK) CALL SPLINE(IN,ZPISO,ZCPPR,ZD2PPR,ZWORK) - ztemp(1) = zd2ppr(1) - ztemp(in) = zd2ppr(in) - do j100 = 2,in-1 - ztemp(j100) = zd2ppr(j100) - if (abs(zd2ppr(j100)).lt.1.e3_RKIND) goto 100 - if (((zd2ppr(j100-1) .ge. 0._RKIND) .and. (zd2ppr(j100) .ge. 0._RKIND)) & - & .and. (zd2ppr(j100+1) .ge. 0._RKIND)) goto 100 - if (((zd2ppr(j100-1) .le. 0._RKIND) .and. (zd2ppr(j100) .le. 0._RKIND)) & - & .and. (zd2ppr(j100+1) .le. 0._RKIND)) goto 100 - IF (NVERBOSE .GE. 1) write(*,*) ' warning inaccurate integration, i =',j100 -100 CONTINUE - END DO +!!$ ztemp(1) = zd2ppr(1) +!!$ ztemp(in) = zd2ppr(in) + ztemp(1:in) = zd2ppr(1:in) + IF (NVERBOSE .GE. 3) THEN + do j100 = 2,in-1 + if (abs(zd2ppr(j100)).lt.1.e3_RKIND) goto 100 + if (((zd2ppr(j100-1) .ge. 0._RKIND) .and. (zd2ppr(j100) .ge. 0._RKIND)) & + & .and. (zd2ppr(j100+1) .ge. 0._RKIND)) goto 100 + if (((zd2ppr(j100-1) .le. 0._RKIND) .and. (zd2ppr(j100) .le. 0._RKIND)) & + & .and. (zd2ppr(j100+1) .le. 0._RKIND)) goto 100 + write(*,*) ' warning inaccurate integration, i =',j100 +100 CONTINUE + END DO + END IF if (ztemp(in-1)*ztemp(in).le.0._RKIND) ztemp(in) = 0._RKIND if (ztemp(1)*ztemp(2).le.0._RKIND) ztemp(1) = 0._RKIND - do j101 = 1,in - zd2ppr(j101) = ztemp(j101) - END do + zd2ppr(1:in) = ztemp(1:in) ! ZCPR(IN) = 0._rkind ! @@ -129,18 +129,20 @@ SUBROUTINE ISOFUN(KN) ! ! !%OS CHECK IF JUMP IN ZCPR (AS ZD2PPR CAN BE WILD) - ZFAC = 3._RKIND - DO I=11,IN-1 - IF (ABS(ZCPR(I+1)-ZCPR(I)) .GT. ABS( ZFAC * & - & 0.5_RKIND*(ZCPPR(I)+ZCPPR(I+1))*(ZPISO(I+1)-ZPISO(I)))) THEN - IF (NVERBOSE .GE. 2) THEN - PRINT *,' JUMP IN PRESSURE AT I= ',I - PRINT *,' I ZPISO ZCPPR ZD2PPR ZCPR' - WRITE(6,'(I3,1P4E14.5)') & - & (J,ZPISO(J),ZCPPR(J),ZD2PPR(J),ZCPR(J),J=1,IN) + IF (NVERBOSE .GE. 3) THEN + ZFAC = 3._RKIND + DO I=11,IN-1 + IF (ABS(ZCPR(I)) .GE. 0.1) THEN + IF (ABS(ZCPR(I+1)-ZCPR(I)) .GT. ABS( ZFAC * & + & 0.5_RKIND*(ZCPPR(I)+ZCPPR(I+1))*(ZPISO(I+1)-ZPISO(I)))) THEN + PRINT *,' JUMP IN PRESSURE AT I= ',I + PRINT *,' I ZPISO ZCPPR ZD2PPR ZCPR' + WRITE(6,'(I3,1P4E14.5)') & + & (J,ZPISO(J),ZCPPR(J),ZD2PPR(J),ZCPR(J),J=1,IN) + END IF END IF - END IF - END DO + END DO + END IF !%OS ! CALL DCOPY(KN,ZCPR,1,CPR,1) @@ -182,25 +184,33 @@ SUBROUTINE ISOFUN(KN) IF (NPROFZ .EQ. 0) THEN ! !*******************Compute Istar for the case NSTTP = 5 ************************** -! 2405 format(1P2E20.12) -! 2305 format(1P15E20.12) + ! IF (NSTTP .EQ. 5) THEN - !! Compute rhopol in ZS -!!$ DO i=1,NISO1EFF -!!$ ZS(i) = 1._RKIND - PSIISO(i) / SPSIM -!!$ ZPISO(I) = SPSIM*(1._RKIND-csipr(I)**2) -!!$ IF (ZS(i) .LE. 0._RKIND) THEN -!!$ ZS(i) = 0._RKIND -!!$ ELSE -!!$ ZS(i) = SQRT(ZS(i)) -!!$ END IF -!!$ END DO -!!$ IF (ZS(NISO1EFF) .GT. 1._RKIND) ZS(NISO1EFF) = 1._RKIND -!!$ print *,' sum of smiso-zs= ',sum((smiso(1:niso1eff)-zs(1:niso1eff))**2), ' SPSIM= ',SPSIM -!!$ write(*,'(1p3e25.15)') (smiso(i),zs(i),smiso(i)-zs(i),i=1,niso1eff) - ! smiso should be s of psiiso - ! CALL INTERPOS(FCSM(1:NPPF),RFUN(1:NPPF),NPPF,NISO1EFF,tension=-0.01_rkind,xout=SMISO(1:NISO1EFF),yout=Qtarget(1:NISO1EFF),nbc=(/2, 2/),ybc=(/RFUN(1), RFUN(NPPF)/)) - CALL INTERPOS(FCSM(1:NPPF),RFUN(1:NPPF),NPPF,NISO1EFF,tension=tensprof,xout=SMISO(1:NISO1EFF),yout=Qtarget(1:NISO1EFF),nbc=(/2, 2/),ybc=(/RFUN(1), RFUN(NPPF)/)) + NPPF1 = NPPF + 1 + IF (NFUNRHO.EQ.0 .OR. NRHOMESH.EQ.0) THEN + CALL INTERPOS(FCSM(1:NPPF1),RFUN(1:NPPF1),NPPF1,NISO1EFF,tension=tensprof,xout=SMISO(1:NISO1EFF),yout=Qtarget(1:NISO1EFF),nbc=(/2, 2/),ybc=(/RFUN(1), RFUN(NPPF1)/)) + ELSE IF (NFUNRHO.EQ.1 .AND. NRHOMESH.EQ.1) THEN + ! RFUN(FCSM) is q(rhotornorm), hence use CIDRTOR(CSIPRI) to get rhotor(smiso) to get q(rhopol=smiso) + CALL INTERPOS(CSIPRI(1:KN),CIDRTOR(1:KN),KN,NISO1EFF,tension=0._RKIND,xout=SMISO(1:NISO1EFF),yout=zrhotornorm(1:NISO1EFF)) + CALL INTERPOS(FCSM(1:NPPF1),RFUN(1:NPPF1),NPPF1,NISO1EFF,tension=tensprof,xout=zrhotornorm(1:NISO1EFF),yout=Qtarget(1:NISO1EFF),nbc=(/2, 2/),ybc=(/RFUN(1), RFUN(NPPF1)/)) + ELSE + write(0,*) 'NFUNRHO= ',NFUNRHO,' AND NRHOMESH= ',NRHOMESH,' NOT YET CODED IN' + write(eqchease_out(index_out)%codeparam%output_diag(1),*) & + & 'in isofun: NFUNRHO= ',NFUNRHO,' AND NRHOMESH= ',NRHOMESH,' NOT YET CODED IN' + eqchease_out(index_out)%codeparam%output_flag = -100 + return + ENDIF + ! +!!$ rewind 76 +!!$ write(76,'(A)') '% i FCSM RFUN' +!!$ write(76,'(I3,1p2e15.6)') (i,FCSM(i),RFUN(i),i=1,NPPF1) +!!$ rewind 77 +!!$ write(77,'(A)') '% i SMISO Qtarget' +!!$ write(77,'(I3,1p2e15.6)') (i,SMISO(i),Qtarget(i),i=1,NISO1EFF) +!!$ rewind 78 +!!$ write(78,'(A)') '% i CSIPRI CIDRTOR' +!!$ write(78,'(I3,1p2e15.6)') (i,CSIPRI(i),CIDRTOR(i),i=1,KN) + ! Do i=1,NISO1EFF X2(i) = CIDR(i)*CID3(i)*TMF(i)*CIDQ(i)/Qtarget(i) END DO @@ -212,24 +222,16 @@ SUBROUTINE ISOFUN(KN) CALL INTERPOS((/SPSIM,PSIISO(1:NISO1EFF)/),(/0._RKIND,X2(1:NISO1EFF)/),NISO1EFF+1,NISO1EFF,tension=tensprof/10._rkind,xout=PSIISO(1:NISO1EFF),yout=zpiso(1:NISO1EFF),youtp=dX2dpsi(1:NISO1EFF), & & nbc=(/2, 2/),ybc=(/0._RKIND, X2(NISO1EFF)/)) end if - ! X1(1:NISO1EFF) = (CID2(1:NISO1EFF)/CID0(1:NISO1EFF))*dX2dpsi(1:NISO1EFF)/(2*pi*CIDR(1:NISO1EFF)) -!!$ IF (ncount .LE. 10) THEN -!!$ WRITE(101,*) "% PSIISO CSIPR ZS Qtarget Q CID0=C0/C2 CIDR=C1 CIDQ=C2 CID2=C1/C2 CID3=C3/C2 TMF=T X1 X2 x2out dX2dpsi Istar_target", SPSIM -!!$ WRITE(101,2306) (PSIISO(i),CSIPR(i),ZS(i),Qtarget(i),TMF(i)*CIDQ(i)/(2*pi),CID0(i),CIDR(i),CIDQ(i),CID2(i),CID3(i),TMF(i),X1(i),X2(i),zpiso(i),dX2dpsi(i),istar_target(i),i=1,NISO1EFF) -!!$2306 format(1P16E20.12) -!!$ CLOSE(101) -!!$ end IF -!!$ IF (ncount .GT. 10) THEN -!!$ WRITE(102,*) "% PSIISO CSIPR ZS Qtarget Q CID0=C0/C2 CIDR=C1 CIDQ=C2 CID2=C1/C2 CID3=C3/C2 TMF=T X1 X2 x2out dX2dpsi Istar_target", SPSIM -!!$ WRITE(102,2306) (PSIISO(i),CSIPR(i),ZS(i),Qtarget(i),TMF(i)*CIDQ(i)/(2*pi),CID0(i),CIDR(i),CIDQ(i),CID2(i),CID3(i),TMF(i),X1(i),X2(i),zpiso(i),dX2dpsi(i),istar_target(i),i=1,NISO1EFF) -!!$ CLOSE(102) -!!$ end IF - - ! X2(1:NISO1EFF) = ZPISO(1:NISO1EFF) - - alpha=0.2_rkind + alpha=max(0.2_rkind,relax/2._rkind) ! print *,'ncount, nopt= ',ncount, nopt + if (KN .NE. NISO1EFF) THEN + write(0,*) 'KN= ',KN,' AND NISO1EFF= ',NISO1EFF,' do not match (isofun) but are expected to be equal' + write(eqchease_out(index_out)%codeparam%output_diag(1),*) & + & 'in isofun: KN= ',KN,' AND NISO1EFF= ',NISO1EFF,' do not match (isofun) but are expected to be equal' + eqchease_out(index_out)%codeparam%output_flag = -111 + return + ENDIF IF ((ncount .EQ. 0) .and. (abs(istar_target(1)) .LE. 1.E-15_RKIND)) THEN DO i=1,NISO1EFF istar_target(i) = 2.5*(1-CSIPR(i)*CSIPR(i)*CSIPR(i)*CSIPR(i)) @@ -244,10 +246,6 @@ SUBROUTINE ISOFUN(KN) ! CALL PRFUNC(KN,PSIISO,CIPR) ! -!!$ WRITE(301+ncount/5,'("% PSIISO CSIPR ZS Qtarget Q CID0=C0/C2 CIDR=C1 CIDQ=C2 CID2=C1/C2 CID3=C3/C2 TMF=T X1 X2 dX2dpsi Istar_target")') -!!$ WRITE(301+ncount/5,2305) (PSIISO(i),CSIPR(i),ZS(i),Qtarget(i),TMF(i)*CIDQ(i)/(2*pi),CID0(i),CIDR(i),CIDQ(i),CID2(i),CID3(i),TMF(i),X1(i),X2(i),dX2dpsi(i),istar_target(i),i=1,NISO1EFF) - !CLOSE(301+ncount/5) - ! ncount= ncount + 1 ! ! diff --git a/src-f90/itipr.f90 b/src-f90/itipr.f90 index 5487d9df4911868406cc8f53191bc621904ccf7b..72985eeef37369fb70e45b8a102ed0fe5292b562 100644 --- a/src-f90/itipr.f90 +++ b/src-f90/itipr.f90 @@ -27,7 +27,7 @@ SUBROUTINE ITIPR(NISOFORDIM) return end if ! - IF (NSTTP .EQ. 1) GOTO 4 + IF ( (NSTTP .EQ. 1) .AND. (NFUNRHO .EQ. 0) ) GOTO 4 ! CALL DCOPY(NISO,TTP,1,ZTTP,1) CALL DCOPY(NISO,CPPR,1,ZCPPR,1) @@ -49,11 +49,11 @@ SUBROUTINE ITIPR(NISOFORDIM) ! RESMAP = SQRT(ZNM/ZNDM) ! - ! IF NSTTP = 3/4 : RESCALE AT'S AT EVERY ITERATION OVER CURRENT - ! PROFILE IF NO BALLOONING OPTIMIZATION IS USED OR THE OPTIMIZED + ! IF NSTTP = 3/4 : RESCALE AT'S AT EVERY ITERATION OVER CURRENT + ! PROFILE IF NO BALLOONING OPTIMIZATION IS USED OR THE OPTIMIZED ! BALLOONING PRESSURE PROFILE IS RESCALED BY CPRESS. IF BALLOONING ! OPTIMIZATION IS USED, THIS OPERATION IS DONE ONLY AFTER EVERY - ! STEP OVER THE PRESSURE PROFILE, SINCE IT HAS BEEN OBSERVED THAT + ! STEP OVER THE PRESSURE PROFILE, SINCE IT HAS BEEN OBSERVED THAT ! THE CONVERGENCE IS FASTER IN THAT WAY. ! IF (((NSTTP.EQ.3) .OR. (NSTTP.EQ.4)) .AND. & @@ -84,7 +84,7 @@ SUBROUTINE ITIPR(NISOFORDIM) 1500 FORMAT(/,73X,' ***** ITERATION OVER CURRENT PROFILE NOT ', & & 'CONVERGED') ! -4 CONTINUE +4 CONTINUE ! RETURN END SUBROUTINE ITIPR diff --git a/src-f90/load_imas_with_rout.f90 b/src-f90/load_imas_with_rout.f90 index 46206c41054314e540ba5e628a05d763f3369837..51d207bf99f5e3c1d25ea4bf6dac0b2e59195e63 100644 --- a/src-f90/load_imas_with_rout.f90 +++ b/src-f90/load_imas_with_rout.f90 @@ -62,7 +62,6 @@ subroutine load_imas(equil_in,kitmopt,kitmshot,kitmrun,kitmocc,citmtree,kflag) call imas_close(idx) if (associated(equil_in%time)) then print *,'size(equil_in%time)= ',size(equil_in%time) - time_ref(1) = equil_in%time(1) if (nverbose .ge. 2) print *,'time_ref(1)= ',time_ref(1) ! print *,'equil_in%time= ',equil_in%time(1:min(4,size(equil_in%time))) else @@ -73,7 +72,7 @@ subroutine load_imas(equil_in,kitmopt,kitmshot,kitmrun,kitmocc,citmtree,kflag) end if kflag = -999 return - + end if ! return diff --git a/src-f90/load_itm_with_rout.f90 b/src-f90/load_itm_with_rout.f90 index d399d894ee3cf344cdedd14fd58b29109183dbfd..5aea728d16b45b0f64a0714590eb93610bf85351 100644 --- a/src-f90/load_itm_with_rout.f90 +++ b/src-f90/load_itm_with_rout.f90 @@ -52,7 +52,6 @@ integer, parameter :: DP=kind(1.0D0) i_interpol = 1 ! closest time call euitm_get_slice(idx,trim(str_equil),equil_in(1),time_ref(1),i_interpol) print *,'size(equil_in)= ',size(equil_in) - time_ref(1) = equil_in(1)%time print *,'time_ref(1)= ',time_ref(1) print *,'equil_in(1)%time= ',equil_in(1)%time else diff --git a/src-f90/mappin_imas.f90 b/src-f90/mappin_imas.f90 deleted file mode 100644 index 8c673653fa3895e1b4454b512c5f7c38761ed97d..0000000000000000000000000000000000000000 --- a/src-f90/mappin_imas.f90 +++ /dev/null @@ -1,309 +0,0 @@ -SUBROUTINE MAPPIN(KOPT) - ! - ! LEAD MAPPINGS FOR DIFFERENT CODES LINKED TO CHEASE - ! NEW FEATURE: WORK ON GENERIC MESH SMISO/PSIISO(1:NISO1EFF) CREATED IN PREMAP - ! IN THIS WAY MOST DIFFERENCES BETWEEN NIDEAL CASES ARE IN PREMAP FOR THE MESH DEFINITION - ! AND THEN AFTER THE CALCULATIONS OF THE VARIOUS QUANTITIES IN MAPPIN FOR THE CALUCLATIONS OF SPECIFIC - ! OUTPUT VALUES FOR EACH MAPPING - ! - ! THUS THE MESH "CS" DISAPPEARED SINCE WE ALSO DO THE INTEGRALS IN GLOQUA WITH INTERPOS, MORE PRECISE AND LOCATED ON SAME MESH - ! ALL QUANTITIES FORMERLY ON CS ARE NOW ON SMISOP1 THUS FROM 0 TO 1 AS WITH CS BUT SMISOP1=[0. SMISO(:)], - ! WITH TYPICALLY SMISO=CSM or CS. So CSM should disappear as well, using SMISO everywhere. - ! SURFACE is called on SMISO(1:NISO1EFF) thus SMISOP1(2:NISO1EFF1), from near-but-not-axis, s>0, to s=1. - ! - ! CANNOT HAVE ARRAYS ON SMISOP1, SINCE WOULD SHIFT ALL INDICES BY ONE OF MANY ARRAYS, SO KEEP SEPARATE VALUES ON-AXIS AS NOW - ! FOR EXAMPLE Q0 AND QPSI(:). BUT ALL ARRAYS IN EQCHEASE_... ARE ON SMISOP1 WITH MOST INFORMATION THERE - ! SO TRY TO USE EQCHEASE_... WHEN POSSIBLE - ! - ! CS MESH KEPT FOR EQ(1) AND EQ(3,..) IN ERDATA FOR EXAMPLE - ! - !********************************************************************** - ! - USE globals - USE interpol - IMPLICIT NONE - ! - interface - SUBROUTINE SURFACE(K,PSIGMA,PTETA,PGWGT,PS) - USE globals - USE interpol - USE sigmaneomod - IMPLICIT NONE - ! - INTEGER :: K - REAL(RKIND) :: PGWGT(*), PSIGMA(*), PTETA(*) - REAL(RKIND) :: PS - end SUBROUTINE SURFACE - end interface - ! - INTEGER, INTENT(IN) :: KOPT - ! - REAL(RKIND) :: ZTMF(NPISOEFF), ZTPR(NPISOEFF), ZCPR(NPISOEFF), & - & ZCPPR(NPISOEFF), ZQ(NPISOEFF), ZQP(NPISOEFF) - REAL(RKIND) :: ZMU0 - INTEGER :: IDCHSE - INTEGER :: I, J, L, JISO, J34, J33, IPEN, JPEN, NPESUR - ! - !----*----*----*---*----*----*----*----*----*----*----*----*----*----*- - ! - ZMU0 = 4.E-07_RKIND * CPI - ! - ! SINCE WE HAVE ALL ON CSM MESH, BUT PEOPLE WANT VALUES FROM CENTER TO EDGE, WE ADD AN EXTRA - ! POINT AT RHO=0, THUS MESH HAS NISO1EFF+1 POINTS (SMISOP1) - ! - ! NOW WE HAVE A GENERIC MESH PRE-DEFINED IN PRE-MAP, SO WE CAN DO GENERIC ALLOCATION BEFORE "GOTO" CASES - ! - NCHIEFF = NCHI - ! IF (NIDEAL .EQ. 5) NCHIEFF = NTNOVA - ! - ALLOCATE(EQCHEASE_OUT(INDEX_OUT)%PROFILES_1D%PSI(NISO1EFF1)) - ALLOCATE(EQCHEASE_OUT(INDEX_OUT)%PROFILES_1D%PHI(NISO1EFF1)) - ALLOCATE(EQCHEASE_OUT(INDEX_OUT)%PROFILES_1D%PRESSURE(NISO1EFF1)) - ALLOCATE(EQCHEASE_OUT(INDEX_OUT)%PROFILES_1D%F_DIA(NISO1EFF1)) - ALLOCATE(EQCHEASE_OUT(INDEX_OUT)%PROFILES_1D%PPRIME(NISO1EFF1)) - ALLOCATE(EQCHEASE_OUT(INDEX_OUT)%PROFILES_1D%FFPRIME(NISO1EFF1)) - ALLOCATE(EQCHEASE_OUT(INDEX_OUT)%PROFILES_1D%JPHI(NISO1EFF1)) - ALLOCATE(EQCHEASE_OUT(INDEX_OUT)%PROFILES_1D%JPARALLEL(NISO1EFF1)) - ALLOCATE(EQCHEASE_OUT(INDEX_OUT)%PROFILES_1D%Q(NISO1EFF1)) - ! ALLOCATE(EQCHEASE_OUT(INDEX_OUT)%PROFILES_1D%SHEAR(NISO1EFF1)) - ! - ALLOCATE(EQCHEASE_OUT(INDEX_OUT)%PROFILES_1D%R_INBOARD(NISO1EFF1)) - ALLOCATE(EQCHEASE_OUT(INDEX_OUT)%PROFILES_1D%R_OUTBOARD(NISO1EFF1)) - ALLOCATE(EQCHEASE_OUT(INDEX_OUT)%PROFILES_1D%RHO_TOR(NISO1EFF1)) - ALLOCATE(EQCHEASE_OUT(INDEX_OUT)%PROFILES_1D%DPSIDRHO_TOR(NISO1EFF1)) - ALLOCATE(EQCHEASE_OUT(INDEX_OUT)%PROFILES_1D%RHO_VOL(NISO1EFF1)) - ALLOCATE(EQCHEASE_OUT(INDEX_OUT)%PROFILES_1D%BETA_POL(NISO1EFF1)) - ALLOCATE(EQCHEASE_OUT(INDEX_OUT)%PROFILES_1D%LI(NISO1EFF1)) - ALLOCATE(EQCHEASE_OUT(INDEX_OUT)%PROFILES_1D%ELONGATION(NISO1EFF1)) - ALLOCATE(EQCHEASE_OUT(INDEX_OUT)%PROFILES_1D%TRIA_UPPER(NISO1EFF1)) - ALLOCATE(EQCHEASE_OUT(INDEX_OUT)%PROFILES_1D%TRIA_LOWER(NISO1EFF1)) - ALLOCATE(EQCHEASE_OUT(INDEX_OUT)%PROFILES_1D%VOLUME(NISO1EFF1)) - ALLOCATE(EQCHEASE_OUT(INDEX_OUT)%PROFILES_1D%VPRIME(NISO1EFF1)) - ALLOCATE(EQCHEASE_OUT(INDEX_OUT)%PROFILES_1D%DVDRHO(NISO1EFF1)) - ALLOCATE(EQCHEASE_OUT(INDEX_OUT)%PROFILES_1D%AREA(NISO1EFF1)) - ALLOCATE(EQCHEASE_OUT(INDEX_OUT)%PROFILES_1D%APRIME(NISO1EFF1)) - ALLOCATE(EQCHEASE_OUT(INDEX_OUT)%PROFILES_1D%SURFACE(NISO1EFF1)) - ALLOCATE(EQCHEASE_OUT(INDEX_OUT)%PROFILES_1D%FTRAP(NISO1EFF1)) - ALLOCATE(EQCHEASE_OUT(INDEX_OUT)%PROFILES_1D%GM1(NISO1EFF1)) - ALLOCATE(EQCHEASE_OUT(INDEX_OUT)%PROFILES_1D%GM2(NISO1EFF1)) - ALLOCATE(EQCHEASE_OUT(INDEX_OUT)%PROFILES_1D%GM3(NISO1EFF1)) - ALLOCATE(EQCHEASE_OUT(INDEX_OUT)%PROFILES_1D%GM4(NISO1EFF1)) - ALLOCATE(EQCHEASE_OUT(INDEX_OUT)%PROFILES_1D%GM5(NISO1EFF1)) - ALLOCATE(EQCHEASE_OUT(INDEX_OUT)%PROFILES_1D%GM6(NISO1EFF1)) - ALLOCATE(EQCHEASE_OUT(INDEX_OUT)%PROFILES_1D%GM7(NISO1EFF1)) - ALLOCATE(EQCHEASE_OUT(INDEX_OUT)%PROFILES_1D%GM8(NISO1EFF1)) - ALLOCATE(EQCHEASE_OUT(INDEX_OUT)%PROFILES_1D%GM9(NISO1EFF1)) - ALLOCATE(EQCHEASE_OUT(INDEX_OUT)%PROFILES_1D%B_AV(NISO1EFF1)) - ALLOCATE(EQCHEASE_OUT(INDEX_OUT)%PROFILES_1D%B_MIN(NISO1EFF1)) - ALLOCATE(EQCHEASE_OUT(INDEX_OUT)%PROFILES_1D%B_MAX(NISO1EFF1)) - ! Some special place holders - ALLOCATE(EQCHEASE_OUT(INDEX_OUT)%PROFILES_1D%phi_flow(NISO1EFF1)) ! DI - ALLOCATE(EQCHEASE_OUT(INDEX_OUT)%PROFILES_1D%s_flow(NISO1EFF1)) ! DR - ALLOCATE(EQCHEASE_OUT(INDEX_OUT)%PROFILES_1D%h_flow(NISO1EFF1)) ! NCBAL - ! - ALLOCATE(EQCHEASE_OUT(INDEX_OUT)%COORD_SYS%GRID%DIM1(NISO1EFF1)) - ALLOCATE(EQCHEASE_OUT(INDEX_OUT)%COORD_SYS%GRID%DIM2(NCHIEFF)) - ALLOCATE(EQCHEASE_OUT(INDEX_OUT)%COORD_SYS%JACOBIAN(NISO1EFF1,NCHIEFF)) - ALLOCATE(EQCHEASE_OUT(INDEX_OUT)%COORD_SYS%G_11(NISO1EFF1,NCHIEFF)) - ALLOCATE(EQCHEASE_OUT(INDEX_OUT)%COORD_SYS%G_12(NISO1EFF1,NCHIEFF)) - ALLOCATE(EQCHEASE_OUT(INDEX_OUT)%COORD_SYS%G_13(NISO1EFF1,NCHIEFF)) - EQCHEASE_OUT(INDEX_OUT)%COORD_SYS%G_13 = RC0P - ALLOCATE(EQCHEASE_OUT(INDEX_OUT)%COORD_SYS%G_22(NISO1EFF1,NCHIEFF)) - ALLOCATE(EQCHEASE_OUT(INDEX_OUT)%COORD_SYS%G_23(NISO1EFF1,NCHIEFF)) - EQCHEASE_OUT(INDEX_OUT)%COORD_SYS%G_23 = RC0P - ALLOCATE(EQCHEASE_OUT(INDEX_OUT)%COORD_SYS%G_33(NISO1EFF1,NCHIEFF)) - ALLOCATE(EQCHEASE_OUT(INDEX_OUT)%COORD_SYS%POSITION%R(NISO1EFF1,NCHIEFF)) - ALLOCATE(EQCHEASE_OUT(INDEX_OUT)%COORD_SYS%POSITION%Z(NISO1EFF1,NCHIEFF)) - ! - ! EQCHEASE_OUT_ADD MESH SO FAR WITHOUT EXTRA RHO=0 POINT, SHOULD BE ADDED AFTER - ! - if (index_out .eq. 1) then - ALLOCATE(EQCHEASE_OUT_ADD_1D(NISO1EFF1,27)) - ALLOCATE(EQCHEASE_OUT_ADD_2D(NISO1EFF1,NCHIEFF,14)) - ALLOCATE(EQCHEASE_OUT_ADD_2D_RZ(NRBOX,NZBOX,1)) - ! - ALLOCATE(EQCHEASE_OUT_ADD_1D_VARNAMES(27)) - EQCHEASE_OUT_ADD_1D_VARNAMES(IIRGEO) = 'RGEO' - EQCHEASE_OUT_ADD_1D_VARNAMES(IIAMIN) = 'AMIN' - EQCHEASE_OUT_ADD_1D_VARNAMES(IIDQDPSI) = 'DQDPSI' - EQCHEASE_OUT_ADD_1D_VARNAMES(IID2QDPSI2) = 'D2QDPSI2' - EQCHEASE_OUT_ADD_1D_VARNAMES(IISHEAR) = 'SHEAR' - EQCHEASE_OUT_ADD_1D_VARNAMES(IIDSHEARDPSI) = 'DSHEARDPSI' - EQCHEASE_OUT_ADD_1D_VARNAMES(IIGRADPSI_AV) = 'GRADPSI_AV' - EQCHEASE_OUT_ADD_1D_VARNAMES(IIA_AV) = 'A_AV' - EQCHEASE_OUT_ADD_1D_VARNAMES(IIR_AV) = 'R_AV' - EQCHEASE_OUT_ADD_1D_VARNAMES(IIBMAX) = 'BMAX' - EQCHEASE_OUT_ADD_1D_VARNAMES(IIBMIN) = 'BMIN' - EQCHEASE_OUT_ADD_1D_VARNAMES(IIALPHA) = 'ALPHA' - EQCHEASE_OUT_ADD_1D_VARNAMES(IIIPLAS) = 'IPLAS' - EQCHEASE_OUT_ADD_1D_VARNAMES(IITE) = 'TE' - EQCHEASE_OUT_ADD_1D_VARNAMES(IIDTEDPSI)= 'DTEDPSI' - EQCHEASE_OUT_ADD_1D_VARNAMES(IINE) = 'NE' - EQCHEASE_OUT_ADD_1D_VARNAMES(IIDNEDPSI)= 'DNEDPSI' - EQCHEASE_OUT_ADD_1D_VARNAMES(IITI) = 'TI' - EQCHEASE_OUT_ADD_1D_VARNAMES(IIDTIDPSI)= 'DTIDPSI' - EQCHEASE_OUT_ADD_1D_VARNAMES(IINI) = 'NI' - EQCHEASE_OUT_ADD_1D_VARNAMES(IIDNIDPSI)= 'DNIDPSI' - EQCHEASE_OUT_ADD_1D_VARNAMES(IIZEFF) = 'ZEFF' - EQCHEASE_OUT_ADD_1D_VARNAMES(IINUESTAR) = 'NUESTAR' - EQCHEASE_OUT_ADD_1D_VARNAMES(IISIGNEO) = 'SIGNEO' - EQCHEASE_OUT_ADD_1D_VARNAMES(IIJBSBAV) = 'JBSBAV' - ! - ALLOCATE(EQCHEASE_OUT_ADD_2D_VARNAMES(14)) - EQCHEASE_OUT_ADD_2D_VARNAMES(IIB) = 'B' - EQCHEASE_OUT_ADD_2D_VARNAMES(IIDBDPSI) = 'DBDPSI' - EQCHEASE_OUT_ADD_2D_VARNAMES(IIDBDCHI) = 'DBDCHI' - EQCHEASE_OUT_ADD_2D_VARNAMES(IIDPSIDR) = 'DPSIDR' - EQCHEASE_OUT_ADD_2D_VARNAMES(IIDPSIDZ) = 'DPSIDZ' - EQCHEASE_OUT_ADD_2D_VARNAMES(IIDCHIDR) = 'DCHIDR' - EQCHEASE_OUT_ADD_2D_VARNAMES(IIDCHIDZ) = 'DCHIDZ' - EQCHEASE_OUT_ADD_2D_VARNAMES(IIDRDPSI) = 'DRDPSI' - EQCHEASE_OUT_ADD_2D_VARNAMES(IIDRDCHI) = 'DRDCHI' - eqchease_out_add_2d_varnames(iidZdpsi) = 'dZdpsi' - eqchease_out_add_2d_varnames(iidZdchi) = 'dZdchi' - eqchease_out_add_2d_varnames(iiAh) = 'Ah' - eqchease_out_add_2d_varnames(iidAhdpsi) = 'dAhdpsi' - eqchease_out_add_2d_varnames(iitheta) = 'theta' - - ALLOCATE(EQCHEASE_OUT_ADD_2D_RZ_VARNAMES(1)) - ! Note chi(R,Z) computed in psibox.f90 uses R,Z mesh as for EQDSPSI (and eqdsk), so psi(R,Z) in EQDSPSI - eqchease_out_add_2d_RZ_varnames(iiRZ_chi) = 'chiRZ' - end if - ! - ! - eqchease_out(index_out)%coord_sys%grid%dim2(1:nchieff) = chim(1:nchi) - - ! - ! Perform calculations valid/useful for all cases. Could add here exception for "fast" version later - ! - ! - ! Loop on SMISO(1:niso1eff) flux surfaces without axis (which is not a surface per se) - ! same surfaces as SMISOP1(2:niso1eff1) - ! Note: could have done DO, JISO=2,niso1eff1 to save surface quantities on j=2:niso1eff1, but then need to make - ! sure indices are modified everywhere they are used. In addition, many surface integrals are not useful on axis - ! However, many are useful to be known on axis, so decide that ALL the eqchease_xxx quantities are on niso1eff+1 points - ! Note: all the outputs should thus use eqchease_xxx arrays on SMISOP1 mesh, since it is useful - ! - DO JISO=1,niso1eff - ! calculates quantities integrated on each flux surface - CALL SURFACE(JISO,SIGPSI(1,JISO),TETPSI(1,JISO),WGTPSI(1,JISO),SMISO(JISO)) - call chipsimetrics(jiso,SMISO(jiso),niso1eff) - ! - END DO - ! - ! evaluate all relevant values on-axis - ! - call surf_metrics_onaxis - ! - ! Compute quantities directly on full mesh once values on each flux surface are known - ! like psi integrals - CALL GLOQUA(SMISO,NISO1EFF,1) - ! - ! switch to specific mapping cases - ! - GOTO(10,20,30) KOPT - ! -10 CONTINUE - ! - RETURN - ! - !----*----*----*---*----*----*----*----*----*----*----*----*----*----*- - ! -20 CONTINUE - ! - IF (NIDEAL .EQ. 0) THEN - ! NUMERICAL INT. TRANSFORM - DO J34=1,NISO1EFF - CALL GIJLIN(J34,SMISO(J34)) - IF (NFFTOPT .EQ. 0) THEN - DO J33=1,MSMAX - CALL FOURIER(J34,SIGPSI(1,J34),TETPSI(1,J34), & - & WGTPSI(1,J34),J33-1) - IF (J34 .EQ. NISO1EFF .AND. REXT .GT. 1._RKIND) THEN - CALL VACUUM(J33-1) - ENDIF - END DO - ELSE - ! FFT TRANSFORM - CALL FOURFFT(J34,TETPSI(1,J34),MSMAX-1) - IF (J34 .EQ. NISO1EFF .AND. REXT .GT. 1._RKIND) & - & CALL VACUFFT(MSMAX-1) - ENDIF - END DO - ! - DO J=1,NSMAX - DO I=1,MSMAX - RM(I,J) = REAL(I - 1,RKIND) - RN(J) = REAL(J - 1,RKIND) - END DO - END DO - ! - ELSE IF (NIDEAL .EQ. 3) THEN - CALL OUTNVW - ! - ELSE IF (NIDEAL .EQ. 5) THEN - ! Note that the 3 routines, outxt, outastro and xtinit now write into record NXTOR - DO J=1,NISO1EFF - CALL TPSI(NISO1EFF,J,1) - CALL OUTXT(J,SMISO(J),1) - IF (REXT.GT.1._RKIND .AND. J.EQ.NISO1EFF) CALL VACUUMXT(1) - END DO - DO J=1,NISO1EFF - CALL TPSI(NISO1EFF,J,2) - CALL OUTXT(J,SMISO(J),2) - END DO - ! - IF (NOUTXTOR==1) THEN - CALL XTVERIFYDIMS(NISO1EFF) - CALL OUTASTRO(NISO1EFF) - CALL XTINIT(NISO1EFF,SMISO) - ENDIF - CLOSE(UNIT=NXTOR,STATUS='KEEP') - ENDIF - ! - RETURN - ! - !----*----*----*---*----*----*----*----*----*----*----*----*----*----*- - ! -30 CONTINUE - ! - ! - DO JPEN=1,NISO1EFF - IF (MOD(JPEN,6) .NE. 3) THEN - IPEN = IPEN + 1 - CALL TPSI(NISO1EFF,JPEN,0) - CALL OUTPEN(JPEN,IPEN) - ZTMF(IPEN) = TMF(JPEN) - ZTPR(IPEN) = TTP(JPEN)/TMF(JPEN) - ZCPR(IPEN) = CPR(JPEN) - ZCPPR(IPEN) = CPPR(JPEN) - ZQ(IPEN) = QPSI(JPEN) - ZQP(IPEN) = CDQ(JPEN) - ENDIF - END DO - ! - CLOSE(UNIT=NPENN,STATUS='KEEP') - ! - NPESUR = NPENN - ! - OPEN(UNIT=NPESUR,ACCESS='SEQUENTIAL',FORM='UNFORMATTED', & - & FILE='NPESUR') - REWIND NPESUR - ! - IDCHSE = 222 - ! - WRITE(NPESUR) IDCHSE - WRITE(NPESUR) NPSI, NCHI, NMGAUS - WRITE(NPESUR) RMAG, RZMAG, CPSRF, T0, Q0 - WRITE(NPESUR) (CSPEN(L),L=1,NPSI*(NMGAUS+1)) - WRITE(NPESUR) (CTPEN(L),L=1,NCHI*(NMGAUS+1)) - WRITE(NPESUR) (ZTMF(L),L=1,NPSI*(NMGAUS+1)) - WRITE(NPESUR) (ZTPR(L),L=1,NPSI*(NMGAUS+1)) - WRITE(NPESUR) (ZCPR(L),L=1,NPSI*(NMGAUS+1)) - WRITE(NPESUR) (ZCPPR(L),L=1,NPSI*(NMGAUS+1)) - WRITE(NPESUR) (ZQ(L),L=1,NPSI*(NMGAUS+1)) - WRITE(NPESUR) (ZQP(L),L=1,NPSI*(NMGAUS+1)) - CLOSE(UNIT=NPESUR,STATUS='KEEP') - ! - RETURN -END SUBROUTINE MAPPIN diff --git a/src-f90/mesh.f90 b/src-f90/mesh.f90 index 7376cf0289d6a47c0ed7b33b49de157119c2b4d3..40738fc5b8fccde5ea0be60cac9ad8116cbc3ac8 100644 --- a/src-f90/mesh.f90 +++ b/src-f90/mesh.f90 @@ -134,7 +134,7 @@ SUBROUTINE MESH(K) ! GOTO (100,200,300,400,500,600,700,800,900) K ! -100 CONTINUE +100 CONTINUE ! ZDPIPR = 1._RKIND / REAL(NISO - 1,RKIND) ! @@ -166,9 +166,9 @@ SUBROUTINE MESH(K) NISO1EFF = NISO SMISO(1:NISO1EFF) = CSIPR(1:NISO1EFF) !PSIISO(1:NISO1EFF) = SPSIM * (1._RKIND - SMISO(1:NISO1EFF)**2) (SPSIM=0 at this stage) - ! this case should not be called for mappin but since has already rho=0 do not add it - NISO1EFF1 = NISO1EFF - SMISOP1(1:NISO1EFF) = SMISO(1:NISO1EFF) + ! + NISO1EFF1 = NISO1EFF + 1 + SMISOP1(1:NISO1EFF1) = (/ 0._rkind, SMISO(1:NISO1EFF) /) ! !********************************************************************** ! * @@ -191,7 +191,7 @@ SUBROUTINE MESH(K) ! ASSUME DPLACE IN [-PI,+PI] TO EASE SYMMETRIC PACKING * ! * !********************************************************************** - ! + ! ISHIFT = 0 ! IF (NMESHD .NE. 0 .AND. NPOIDD .NE. 0 .AND. & @@ -215,7 +215,7 @@ SUBROUTINE MESH(K) IF (DPLACE(J105) .GT. CPI) & & DPLACE(J105) = DPLACE(J105) - 2._RKIND*CPI END DO - ! + ! ISHIFT = 1 ENDIF ! @@ -229,21 +229,21 @@ SUBROUTINE MESH(K) CALL TETARE(CT,NT) ISHIFT = 1 ENDIF - ! + ! !********************************************************************** ! * ! IF THETA MESH HAS BEEN PACKED OR NDIFT = 1 SHIFT THETA MESH FROM * ! [0 ; 2*PI] TO [(CT(NT)-2*PI)/2 ; 2*PI-(CT(NT)-2*PI)/2] * ! * !********************************************************************** - ! + ! IF (ISHIFT .EQ. 1) THEN ZT(1) = .5_RKIND * (CT(1) + CT(NT) - 2._RKIND*CPI) - ! + ! DO J106=2,NT1 ZT(J106) = .5_RKIND * (CT(J106) + CT(J106-1)) END DO - ! + ! CALL DCOPY(NT1,ZT,1,CT,1) ENDIF ! @@ -306,7 +306,7 @@ SUBROUTINE MESH(K) ! RETURN ! -200 CONTINUE +200 CONTINUE ! !********************************************************************** ! * @@ -405,7 +405,7 @@ SUBROUTINE MESH(K) ! RETURN ! -300 CONTINUE +300 CONTINUE ! !********************************************************************** ! * @@ -472,7 +472,7 @@ SUBROUTINE MESH(K) ! RETURN ! -400 CONTINUE +400 CONTINUE ! !********************************************************************** ! * @@ -497,7 +497,7 @@ SUBROUTINE MESH(K) ! IF (NMESHE .NE. 0 .AND. NPOIDE .NE. 0 .AND. & & SOLPDE .NE. 1._RKIND) THEN - ! + ! DO J402=1,NPOIDE IF (EPLACE(J402) .GT. CPI) THEN PRINT *,' EPLACE(',J402,')=',EPLACE(J402), & @@ -511,7 +511,7 @@ SUBROUTINE MESH(K) END DO CALL PACKMEP(NCHI1,NPOIDE,CHI,EPLACE,EWIDTH,SOLPDE,NMESHE,NMESHPOLEXP) - ! + ! DO J403=1,NPOIDE IF (EPLACE(J403) .GT. CPI) & & EPLACE(J403) = EPLACE(J403) - 2._RKIND*CPI @@ -530,7 +530,7 @@ SUBROUTINE MESH(K) ! RETURN ! -500 CONTINUE +500 CONTINUE ! IF (NVEXP .EQ. 0) THEN ! @@ -578,7 +578,7 @@ SUBROUTINE MESH(K) ! JITER = 0 ! -502 CONTINUE +502 CONTINUE ! ZFA = (ZALPHA**NV - 1._RKIND) / (ZALPHA - 1._RKIND) - ZQ JITER = JITER + 1 @@ -586,7 +586,7 @@ SUBROUTINE MESH(K) & (ZALPHA - 1._RKIND)**2 ZFA = ZFA / ZFPRIM ZALPHA = ZALPHA - ZFA - ! + ! IF (ABS(ZFA) .LT. RC1M12) GOTO 503 ! IF (JITER .LT. 500) GOTO 502 @@ -596,12 +596,12 @@ SUBROUTINE MESH(K) eqchease_out(index_out)%codeparam%output_flag = -161 return ! -503 CONTINUE +503 CONTINUE ! ZD1 = CS(NPSI1) - CS(NPSI) CSV(1) = 1._RKIND ZEXP = 1._RKIND - ! + ! DO J504=1,NV ZEXP = ZEXP * ZALPHA CSV(J504+1) = 1._RKIND + ZD1 * (ZEXP - 1._RKIND) / (ZALPHA - 1._RKIND) @@ -614,7 +614,7 @@ SUBROUTINE MESH(K) ! RETURN ! -600 CONTINUE +600 CONTINUE ! !********************************************************************** ! * @@ -658,7 +658,7 @@ SUBROUTINE MESH(K) ! * !********************************************************************** ! -700 CONTINUE +700 CONTINUE ! CALL DCOPY(NPSI,CS(2),1,CSPEN(5),5) CALL GAUSS(NMGAUS,ZRAC,ZWGT) @@ -697,7 +697,7 @@ SUBROUTINE MESH(K) ! IF (NMESHE .NE. 0 .AND. NPOIDE .NE. 0 .AND. & & SOLPDE .NE. 1._RKIND) THEN - ! + ! DO J704=1,NPOIDE IF (EPLACE(J704) .GT. CPI) THEN PRINT *,' EPLACE(',J704,')=',EPLACE(J704), & @@ -709,9 +709,9 @@ SUBROUTINE MESH(K) IF (EPLACE(J704) .LT. 0.0_RKIND) & & EPLACE(J704) = EPLACE(J704) + 2._RKIND*CPI END DO - ! + ! CALL PACKMEP(NCHI1,NPOIDE,ZT,EPLACE,EWIDTH,SOLPDE,NMESHE,NMESHPOLEXP) - ! + ! DO J705=1,NPOIDE IF (EPLACE(J705) .GT. CPI) & & EPLACE(J705) = EPLACE(J705) - 2._RKIND*CPI @@ -744,7 +744,7 @@ SUBROUTINE MESH(K) ! RETURN ! -800 CONTINUE +800 CONTINUE ! !********************************************************************** ! * @@ -766,7 +766,7 @@ SUBROUTINE MESH(K) ! RETURN ! -900 CONTINUE +900 CONTINUE ! !********************************************************************** ! * diff --git a/src-f90/metrictoitm.f90 b/src-f90/metrictoitm.f90 index 2ed639803c9fd1b4e3d5e6b1c5333e70e67720ae..e894289693904ae066bc230cb767288b9d467131 100644 --- a/src-f90/metrictoitm.f90 +++ b/src-f90/metrictoitm.f90 @@ -59,8 +59,8 @@ SUBROUTINE metrictoitm iCOCOS_in = 2 zIp_in = 1._rkind ! CHEASE ip sign zB0_in = 1._rkind ! - iIpsign_out = SIGNIPXP - iB0sign_out = SIGNB0XP + iIpsign_out = int(SIGNIPXP) + iB0sign_out = int(SIGNB0XP) call COCOS_values_coefficients(iCOCOS_in, COCOS_out, zIp_in, zB0_in, & & sigma_Ip_eff, sigma_B0_eff, sigma_Bp_eff, sigma_rhothetaphi_eff, sigma_RphiZ_eff, exp_Bp_eff, & & fact_psi, fact_q, fact_dpsi, fact_dtheta, iIpsign_out, iB0sign_out) ! do give desired output signs, since can be provided in namelist @@ -71,9 +71,8 @@ SUBROUTINE metrictoitm if (.not. associated(eqchease_out(index_out)%codeparam%codename)) allocate(eqchease_out(index_out)%codeparam%codename(1)) eqchease_out(index_out)%codeparam%codename(1) = 'CHEASE' if (.not. associated(eqchease_out(index_out)%codeparam%codeversion)) allocate(eqchease_out(index_out)%codeparam%codeversion(1)) - eqchease_out(index_out)%codeparam%codeversion(1) = & - & 'Id: $Id$ ; Global gitversion ' // GITREVISION - write(6,'(A)') trim(eqchease_out(index_out)%codeparam%codeversion(1)) + eqchease_out(index_out)%codeparam%codeversion(1) = 'git hash ' // GITREVISION + if (nverbose .ge. 1) write(6,'(A)') trim(eqchease_out(index_out)%codeparam%codeversion(1)) CALL DATE_AND_TIME(ZDATE) if (.not. associated(eqchease_out(index_out)%datainfo%putdate)) allocate(eqchease_out(index_out)%datainfo%putdate(1)) diff --git a/src-f90/ogyropsi.f90 b/src-f90/ogyropsi.f90 index 8c79f3937b0a46fbb7bd163c9a0454bef53df7f7..4c45a14de90f52ca8a999420af5b1e8e56dec9ed 100644 --- a/src-f90/ogyropsi.f90 +++ b/src-f90/ogyropsi.f90 @@ -15,10 +15,13 @@ SUBROUTINE OGYROPSI USE globals IMPLICIT NONE ! + REAL(RKIND), allocatable, DIMENSION(:) :: zwork INTEGER :: noutgyro_hdf5 ! ! Open ASCII and HDF5 files CALL INIT_WRITE_OUT(NOUTGYRO,noutgyro_hdf5,'ogyropsi') + ! Add EXPEQ.in file to HDF5 file + CALL WRITE_OUT_EXPEQ_IN(NOUTGYRO,noutgyro_hdf5, EXPEQ_IN_FILENAME) ! ! Saved Scalars CALL WRITE_OUT_SCALAR_INT("NPSI",NISO1EFF1,NOUTGYRO,noutgyro_hdf5,"/data") @@ -33,7 +36,7 @@ SUBROUTINE OGYROPSI CALL WRITE_OUT_1D("PSI",eqchease_out(index_out)%coord_sys%grid%dim1(1:NISO1EFF1),NISO1EFF1, & NOUTGYRO,noutgyro_hdf5,"/data/grid/PSI") CALL WRITE_OUT_1D("CHI",eqchease_out(index_out)%coord_sys%grid%dim2(1:NCHI),NCHI, & - NOUTGYRO,noutgyro_hdf5,"/data/grid/CHI") + NOUTGYRO,noutgyro_hdf5,"/data/grid/CHI") ! ! 1-dim quantities CALL WRITE_OUT_1D("Rgeom",eqchease_out_add_1d(1:NISO1EFF1,iirgeo),NISO1EFF1, & @@ -58,6 +61,14 @@ SUBROUTINE OGYROPSI NOUTGYRO,noutgyro_hdf5, "/data/var1d/Volume") CALL WRITE_OUT_1D("rho_t",eqchease_out(index_out)%profiles_1d%rho_tor(1:NISO1EFF1),NISO1EFF1, & NOUTGYRO,noutgyro_hdf5, "/data/var1d/rho_tor") + allocate(zwork(NISO1EFF1)) + zwork = sqrt((eqchease_out(index_out)%profiles_1d%psi(1:NISO1EFF1)-eqchease_out(index_out)%profiles_1d%psi(1)) /& + (eqchease_out(index_out)%profiles_1d%psi(NISO1EFF1)-eqchease_out(index_out)%profiles_1d%psi(1)) ) + zwork(1) = 0._rkind + zwork(NISO1EFF1) = 1._rkind + CALL WRITE_OUT_1D("rho_pol_norm",zwork(1:NISO1EFF1),NISO1EFF1, & + NOUTGYRO,noutgyro_hdf5, "/data/var1d/rho_pol_norm") + deallocate(zwork) CALL WRITE_OUT_1D("shear",eqchease_out_add_1d(1:NISO1EFF1,iishear),NISO1EFF1, & NOUTGYRO,noutgyro_hdf5, "/data/var1d/shear") CALL WRITE_OUT_1D("dsheardpsi",eqchease_out_add_1d(1:NISO1EFF1,iidsheardpsi),NISO1EFF1, & @@ -100,6 +111,8 @@ SUBROUTINE OGYROPSI NOUTGYRO,noutgyro_hdf5, "/data/var1d/signeo") CALL WRITE_OUT_1D(eqchease_out_add_1d_varnames(iijbsBav),eqchease_out_add_1d(1:NISO1EFF1,iijbsBav),NISO1EFF1, & NOUTGYRO,noutgyro_hdf5, "/data/var1d/jbsBav") + CALL WRITE_OUT_1D("jdotB_over_B0",eqchease_out(index_out)%profiles_1d%jparallel(1:NISO1EFF1),NISO1EFF1, & + NOUTGYRO,noutgyro_hdf5, "/data/var1d/jdotBoverB0") CALL WRITE_OUT_1D("Rmesh",eqchease_out(index_out)%profiles_2d(1)%grid%dim1(1:NRBOX),NRBOX, & NOUTGYRO,noutgyro_hdf5, "/data/var1d/rmesh") @@ -136,21 +149,21 @@ SUBROUTINE OGYROPSI CALL WRITE_OUT_2D("dPsidZ",eqchease_out_add_2d(1:NISO1EFF1,1:NCHI,iidpsidZ), & NISO1EFF1,NCHI,NOUTGYRO,noutgyro_hdf5,"/data/var2d/dPsidZ") CALL WRITE_OUT_2D("dChidR",eqchease_out_add_2d(1:NISO1EFF1,1:NCHI,iidchidR), & - NISO1EFF1,NCHI,NOUTGYRO,noutgyro_hdf5,"/data/var2d/dChidR") + NISO1EFF1,NCHI,NOUTGYRO,noutgyro_hdf5,"/data/var2d/dChidR") CALL WRITE_OUT_2D("dChidZ",eqchease_out_add_2d(1:NISO1EFF1,1:NCHI,iidchidZ), & NISO1EFF1,NCHI,NOUTGYRO,noutgyro_hdf5,"/data/var2d/dChidZ") CALL WRITE_OUT_2D("Jacobian",eqchease_out(index_out)%coord_sys%jacobian(1:NISO1EFF1,1:NCHI), & NISO1EFF1,NCHI,NOUTGYRO,noutgyro_hdf5,"/data/var2d/Jacobian") CALL WRITE_OUT_2D("R",eqchease_out(index_out)%coord_sys%position%R(1:NISO1EFF1,1:NCHI), & - NISO1EFF1,NCHI,NOUTGYRO,noutgyro_hdf5,"/data/var2d/R") + NISO1EFF1,NCHI,NOUTGYRO,noutgyro_hdf5,"/data/var2d/R") CALL WRITE_OUT_2D("Z",eqchease_out(index_out)%coord_sys%position%Z(1:NISO1EFF1,1:NCHI), & - NISO1EFF1,NCHI,NOUTGYRO,noutgyro_hdf5,"/data/var2d/Z") + NISO1EFF1,NCHI,NOUTGYRO,noutgyro_hdf5,"/data/var2d/Z") ! R, Z CALL WRITE_OUT_2D("psiRZ",eqchease_out(index_out)%profiles_2d(1)%psi(1:NRBOX,1:NZBOX), & NRBOX,NZBOX,NOUTGYRO,noutgyro_hdf5,"/data/var2d/psiRZ") CALL WRITE_OUT_2D(eqchease_out_add_2d_rz_varnames(iiRZ_chi),eqchease_out_add_2d_rz(1:NRBOX,1:NZBOX,iiRZ_chi), & - NRBOX,NZBOX,NOUTGYRO,noutgyro_hdf5,"/data/var2d/chiRZ") + NRBOX,NZBOX,NOUTGYRO,noutgyro_hdf5,"/data/var2d/chiRZ") ! ! CLOSE FILES CALL CLOSE_WRITE_OUT(NOUTGYRO,noutgyro_hdf5) diff --git a/src-f90/outastro.f90 b/src-f90/outastro.f90 index 0ff4bf5e8aeae3826b410304a1f0fd94da6ea07a..496581da31d52bc271f7ea5b8671ba6c47ad996d 100644 --- a/src-f90/outastro.f90 +++ b/src-f90/outastro.f90 @@ -12,7 +12,7 @@ SUBROUTINE outastro(KPSI1) INTEGER, PARAMETER :: NA_EQU = 16 REAL(RKIND), allocatable, DIMENSION(:,:,:) :: A_EQU ! - INTEGER :: I, IGMAX, IP, IRMAX, IRMIN, IS, ISHIFTZ, IT,& + INTEGER :: I, IGMAX, IP, IRMAX, IRMIN, IS, IT,& & IZMAX, IZMIN, J REAL(RKIND) :: PDPDR, PDPDZ,& & Z1, Z2, Z3, Z4,& @@ -46,17 +46,10 @@ SUBROUTINE outastro(KPSI1) ZRBOXLEN = 1.1_RKIND*(ZRMAX-ZRMIN) ZRBOXLFT = (ZRMIN + ZRMAX)*0.5_RKIND - ZRBOXLEN*0.5_RKIND ZZZLEN = MAX(ABS(ZZMIN),ABS(ZZMAX)) * 2._RKIND - ZZBOXLEN = 1.1_RKIND*ZZZLEN + ZZBOXLEN = 1.1_RKIND*(ZZMAX-ZZMIN) ! - ! Shift z-axis such that rzmag = 0.0 + ZBOTTOM=(ZZMIN + ZZMAX)*0.5_RKIND - ZZBOXLEN*0.5_RKIND ! - ISHIFTZ = 0 - ZBOTTOM = -0.5_RKIND*ZZBOXLEN - ! - IF (RZMAG .NE. 0.0_RKIND) THEN - ISHIFTZ = 1 - ZBOTTOM = RZMAG - 0.5_RKIND*ZZBOXLEN - ENDIF !---------------------------------------------------------------------- ! 2. Compute s, d/dR(psi) and d/dZ(psi) ! diff --git a/src-f90/outmksa.f90 b/src-f90/outmksa.f90 index 16671229d9d0528b22bb47babe1a754674c4ef8b..9b62656bfb3bf5cf154b71d80661bdbd64c3d817 100644 --- a/src-f90/outmksa.f90 +++ b/src-f90/outmksa.f90 @@ -73,7 +73,9 @@ SUBROUTINE OUTMKSA(KUNIT,KOPT) & CP0*B0EXP*B0EXP/ZMU0/1.602E-16_RKIND/1.E+19_RKIND WRITE(IUNIT,9101) BETA,' BETA' WRITE(IUNIT,9101) BETAS,' BETA* (SQRT(<P**2>))' - WRITE(IUNIT,9101) 2._rkind*cp0*( eqchease_out_add_1d(NISO1EFF1,iirgeo)/T0 )**2,' BETA-AXIS' + ! For XTOR: Approximates Baxis by T0/Rgeom(LCFS) instead of Raxis, print both + WRITE(IUNIT,9102) 2._rkind*cp0*( eqchease_out_add_1d(1,iirgeo)/T0 )**2,' BETA-AXIS=2p0/(T0/Rmag)^2; with Rmag->Rgeo(LCFS):', & + & 2._rkind*cp0*( eqchease_out_add_1d(NISO1EFF1,iirgeo)/T0 )**2 WRITE(IUNIT,9102) SPSIM, ' PSI-AXIS --> [T M**2] ', & & SPSIM*B0EXP*R0EXP**2 WRITE(IUNIT,9102) Z2PI*SPSIM,' 2*PI*PSI-AXIS --> ', & diff --git a/src-f90/output.f90 b/src-f90/output.f90 index 32c93a5ec6e67c261d7580a0d9bd3688363f7e2e..4ff4da6116566a065d3b79940c004a0c53bcb166 100644 --- a/src-f90/output.f90 +++ b/src-f90/output.f90 @@ -51,7 +51,8 @@ SUBROUTINE OUTPUT(K) REAL(RKIND) :: ZINORM REAL(RKIND) :: ZBXPER REAL(RKIND) :: ZBSPER - REAL(RKIND) :: ZBAXEPER + REAL(RKIND) :: ZBAXEPER_RGEOM + REAL(RKIND) :: ZBAXEPER_RAXIS REAL(RKIND) :: ZBPERC REAL(RKIND) :: ZMU0 REAL(RKIND) :: ZD2PST @@ -200,7 +201,8 @@ SUBROUTINE OUTPUT(K) ZBPERC = 100._RKIND * BETA ZBSPER = 100._RKIND * BETAS ZBXPER = 100._RKIND * BETAX - ZBAXEPER = 2._rkind*100._rkind*cp0*( eqchease_out_add_1d(NISO1EFF1,iirgeo)/T0 )**2 + ZBAXEPER_RAXIS = 2._rkind*cp0*( eqchease_out_add_1d(1,iirgeo)/T0 )**2 ! 2mu0 p0 / (Baxis=T0/Raxis)^2 in CHEASE units + ZBAXEPER_RGEOM = 2._rkind*cp0*( eqchease_out_add_1d(NISO1EFF1,iirgeo)/T0 )**2 ! For XTOR: use Rgeom(LCFS) instead of Raxis ZINORM = RINOR/ZMU0 ZIBSNO = RIBSNOR/ZMU0 ZGM = ZBPERC/ZINORM @@ -228,7 +230,8 @@ SUBROUTINE OUTPUT(K) CALL RVAR('BETA [%] ',ZBPERC) CALL RVAR('BETA* [%] ',ZBSPER) CALL RVAR('BETAX [%] ',ZBXPER) - CALL RVAR('BETA AXE [%] ',ZBAXEPER) + CALL RVAR('BETA AXE(Rmag) [%] ',ZBAXEPER_RAXIS) + CALL RVAR('BETA AXE(Rgeo) [%] ',ZBAXEPER_RGEOM) CALL RVAR('G (MA,T,M) ',ZGM ) CALL RVAR('G* (MA,T,M) ',ZGMSTA) CALL RVAR('GEXP (MA,T,M) ',ZGMX ) diff --git a/src-f90/pprime.f90 b/src-f90/pprime.f90 index ee67e6bf5b2abc4deff13af4795c213e56edc25c..5993348896fdd8ccd829d0e99007391c4f9dc3e6 100644 --- a/src-f90/pprime.f90 +++ b/src-f90/pprime.f90 @@ -281,7 +281,7 @@ SUBROUTINE PPRIME(KN,PP,PT) ZEXP = ((ZS1 - AP(1)) / AP(3))**2 ! IF (ZEXP .LT. 100._RKIND) THEN - ! + ! PT(J6) = - AP(2) * EXP(-ZEXP) + ZYSH ! ENDIF @@ -416,7 +416,7 @@ SUBROUTINE PPRIME(KN,PP,PT) ELSE IF (NPPFUN .EQ. 8) THEN ! !********************************************************************** - ! P'=dp/dpsiN (-1/psi0), interpolate dp/dpsiN given from p(sqrt(psiN)) * + ! P'=dp/dpsiN (-1/spsim), since psi_bnd=0, interpolate dp/dpsiN given from p(sqrt(psiN)) * ! INTERPOLATE P' WITH CUBIC SPLINES ON RPPF VALUES (IF P-PRIME IS * ! GIVEN BY A SET OF POINTS) * ! * @@ -448,15 +448,18 @@ SUBROUTINE PPRIME(KN,PP,PT) & nbc=(/0 , 0 /),ybc=(/ 0._rkind, 0._rkind /) ) end if ! Compute dp/dpsi_norm on ZS, use finite tension to be able to fix edge values - call interpos(CSIPR(1:NISO)**2,ZTEMP(1:NISO),nin=NISO,nout=KN,xout=ZS(1:KN)**2,tension=-0.1_rkind,YOUTP=PT, & + call interpos(CSIPRI(1:NISO)**2,ZTEMP(1:NISO),nin=NISO,nout=KN,xout=ZS(1:KN)**2,tension=-0.1_rkind,YOUTP=PT, & & nbc=(/2 , 2 /),ybc=(/ ZTEMP(1), ZTEMP(NISO) /) ) - PT = - PT / SPSIM !!$ rewind(38) +!!$ write(38,'(A)') '% FCSM RPPF' !!$ write(38,'(1p2e14.6)') (FCSM(J6),RPPF(J6),J6=1,NPPF1) !!$ rewind(39) -!!$ write(39,'(1p3e14.6)') (CSIPR(J6),CIDRTOR(J6),ZTEMP(J6),J6=1,NISO) +!!$ write(39,'(A)') '% CSIPRI CSIPR CIDRTOR rppf_rtor' +!!$ write(39,'(1p4e14.6)') (CSIPRI(J6),CSIPR(J6),CIDRTOR(J6),ZTEMP(J6),J6=1,NISO) !!$ rewind(40) +!!$ write(40,'(A)') '% ZS pprime' !!$ write(40,'(1p2e14.6)') (ZS(J6),PT(J6),J6=1,KN) + PT = - PT / SPSIM ELSE PRINT *,'NFUNRHO= ',NFUNRHO,' AND NRHOMESH= ',NRHOMESH,' NOT YET CODED IN' write(eqchease_out(index_out)%codeparam%output_diag(1),*) 'in pprime: NFUNRHO= ',NFUNRHO,' AND NRHOMESH= ',NRHOMESH,' NOT YET CODED IN' @@ -475,7 +478,7 @@ SUBROUTINE PPRIME(KN,PP,PT) ! * !********************************************************************** ! -11 CONTINUE +11 CONTINUE ! CALL PPSPLN(KN,PP,NPPR,PCSM,RPRM,D2RPRM,PT,ZDUMAR,0) ! diff --git a/src-f90/pprm.f90 b/src-f90/pprm.f90 index ecb6ab1d20b055ffd252e89de6c346cde58c82d4..89d74efaf168ef3cfaa6f4badc35752928ac5b61 100644 --- a/src-f90/pprm.f90 +++ b/src-f90/pprm.f90 @@ -19,9 +19,10 @@ SUBROUTINE PPRM(KPPR1,KFIN) ! REAL(RKIND) :: ZDIFF(KPPR1), ZWORK(KPPR1) INTEGER :: ISTAB, ISUM, IP01, J960, J910 - INTEGER :: J, J11, J12, J13, J14, J15, J16, J17, J18 - REAL(RKIND) :: ZEPS, ZERR - PARAMETER(ZEPS = 1.E-3_RKIND) + INTEGER :: J, J11, J12, J13, J14, J15, J16, J17, J18, iunit_output, iunit_cols + INTEGER, SAVE :: ICOUNT=0 + REAL(RKIND) :: ZEPS, ZERRMAX, ZERRTOT + PARAMETER(ZEPS = 1.E-2_RKIND) ! IF (KPPR1 .NE. NPPR+1) THEN write(0,*) 'PROBLEM IN PPRM, KPPR1=',KPPR1,' .NE. NPPR+1=',NPPR+1 @@ -30,11 +31,14 @@ SUBROUTINE PPRM(KPPR1,KFIN) return END IF ! - ZERR = 0._RKIND + ICOUNT = ICOUNT + 1 ISTAB = 10 - ! - WRITE(*,*) (NP4(J),NP3(J),NP2(J),NP1(J),NP0(J),J=1,NPPR+1) - WRITE(6,100) 'UNSTABLES VALUES : ' + ! Unit 95 also used (historical) + ! Unit 55 for all nblop outputs that used to be in stdout except the list of profiles/lambda which are now in 56/57 + iunit_output = 55 + iunit_cols = 56 ! and iunit_cols+1=57 used for columns with different layout + WRITE(iunit_output,*) (NP4(J),NP3(J),NP2(J),NP1(J),NP0(J),J=1,NPPR+1) + WRITE(iunit_output,100) 'UNSTABLES VALUES : ' ! DO J11=1,NPPR+1 ! @@ -47,7 +51,8 @@ SUBROUTINE PPRM(KPPR1,KFIN) NP2(J11) = NP1(J11) NP1(J11) = NP0(J11) ! - IF (SMERCI(J11) .GE. 0._RKIND .AND. NCBAL(J11) .EQ. 0) THEN + ! do not test for Mercier but limit to s>0.2 and q>1 in bltest + IF (NCBAL(J11) .EQ. 0) THEN ! STABLE IF (NP0(J11) .NE. 0) NP0(J11) = 1 ! @@ -58,9 +63,9 @@ SUBROUTINE PPRM(KPPR1,KFIN) ! ENDIF ! - ELSE IF (SMERCI(J11) .LT. 0._RKIND .OR. NCBAL(J11) .GE. 1) THEN + ELSE IF ( NCBAL(J11) .GE. 1) THEN ! UNSTABLE - WRITE(6,200) J11,XP0(J11) + WRITE(iunit_output,200) J11,XP0(J11) ! IF (NP0(J11) .NE. 0) NP0(J11) = - 1 ! @@ -75,13 +80,11 @@ SUBROUTINE PPRM(KPPR1,KFIN) ENDIF ENDIF ! - END DO + END DO ! WRITE(95,400) (PCSM(J),XP0(J),J=1,NPPR+1) WRITE(95,410) (PCSM(J),NP0(J),J=1,NPPR+1) ! - WRITE(6,*) - ! !*********************************************************************** ! * ! ISTAB=1 IF THE PROFILE IS STABLE EVERYWHERE * @@ -103,8 +106,8 @@ SUBROUTINE PPRM(KPPR1,KFIN) ! END DO ! - WRITE(*,*) 'MINIMUM FOUND' - WRITE(*,'(F15.8)') (XPPRMN(J),J=1,NPPR+1) + WRITE(iunit_output,*) 'MINIMUM FOUND' + WRITE(iunit_output,'(F15.8)') (XPPRMN(J),J=1,NPPR+1) ! NSRCH = 2 ! @@ -126,8 +129,8 @@ SUBROUTINE PPRM(KPPR1,KFIN) ! END DO ! - WRITE(*,*) - WRITE(*,*) 'MAXIMUM FOUND' + WRITE(iunit_output,*) + WRITE(iunit_output,*) 'MAXIMUM FOUND' ! NSRCH = 3 ! @@ -146,6 +149,7 @@ SUBROUTINE PPRM(KPPR1,KFIN) ! * !*********************************************************************** ! + write(iunit_output,*) 'KFIN = ',KFIN,' ISTAB = ',ISTAB,' NSRCH = ',NSRCH IF (KFIN .EQ. -1) THEN ! DO J14=1,NPPR+1 @@ -185,7 +189,11 @@ SUBROUTINE PPRM(KPPR1,KFIN) ! IF (NP0(J15) .EQ. 1 .AND. XP0(J15) .NE. 0._RKIND) THEN ! - XLAMB(J15) = 1.1_RKIND + if (icount .LE. 10) then + XLAMB(J15) = 1.4_RKIND + else + XLAMB(J15) = 1.15_RKIND + end if ! IF (XP0(J15) .NE. 0._RKIND) XP0(J15) = XP0(J15) - 0.02_RKIND ! @@ -199,10 +207,6 @@ SUBROUTINE PPRM(KPPR1,KFIN) ! IF (RPRM(J15) .GT. 0._RKIND) RPRM(J15) = 0._RKIND ! - ZDIFF(J15) = ABS(RPRM(J15) - XP0(J15)) - ! - IF (ZDIFF(J15) .GT. ZERR) ZERR = ZDIFF(J15) - ! END DO ! GOTO 9000 @@ -225,10 +229,6 @@ SUBROUTINE PPRM(KPPR1,KFIN) ! IF (RPRM(J16) .GT. 0._RKIND) RPRM(J16) = 0._RKIND ! - ZDIFF(J16) = ABS(RPRM(J16) - XP0(J16)) - ! - IF (ZDIFF(J16) .GT. ZERR) ZERR = ZDIFF(J16) - ! END DO ! GOTO 9000 @@ -236,15 +236,19 @@ SUBROUTINE PPRM(KPPR1,KFIN) ELSE IF (NSRCH .EQ. 3) THEN ! DO J17=1,NPPR+1 - ! - X2SRCH(J17) = 0.1_RKIND - XLAMB(J17) = 1._RKIND + ! + if (icount .LE. 20) then + X2SRCH(J17) = 0.3_RKIND + else + X2SRCH(J17) = 0.1_RKIND + end if + XLAMB(J17) = 1._RKIND ! IF (NP0(J17) .EQ. -1) THEN ! IF (XP0(J17) .GT. -.005_RKIND .AND. XP0(J17-1) .EQ. 0._RKIND) THEN ! - WRITE(*,*) J17,XP0(J17),' MIS A ZERO' + WRITE(iunit_output,*) J17,XP0(J17),' SET TO ZERO' ! XP0(J17) = 0._RKIND XPPRMN(J17) = 0._RKIND @@ -265,10 +269,6 @@ SUBROUTINE PPRM(KPPR1,KFIN) ! IF (RPRM(J17) .GT. 0._RKIND) RPRM(J17) = 0._RKIND ! - ZDIFF(J17) = ABS(RPRM(J17) - XP0(J17)) - ! - IF (ZDIFF(J17) .GT. ZERR) ZERR = ZDIFF(J17) - ! END DO ! NSRCH = 4 @@ -298,7 +298,7 @@ SUBROUTINE PPRM(KPPR1,KFIN) ! IF (XP0(J18) .GT. -.005_RKIND .AND. XP0(J18-1) .EQ. 0._RKIND) THEN ! - WRITE(*,*) J18,XP0(J18),' MIS A ZERO' + WRITE(iunit_output,*) J18,XP0(J18),' SET TO ZERO' ! XP0(J18) = 0._RKIND XPPRMN(J18) = 0._RKIND @@ -320,10 +320,6 @@ SUBROUTINE PPRM(KPPR1,KFIN) ! ENDIF ! - ZDIFF(J18) = ABS(RPRM(J18) - XP0(J18)) - ! - IF (ZDIFF(J18) .GT. ZERR) ZERR = ZDIFF(J18) - ! 18 CONTINUE END DO ! @@ -339,19 +335,17 @@ SUBROUTINE PPRM(KPPR1,KFIN) ! 9000 CONTINUE ! - WRITE(*,*) - WRITE(*,*) 'ISTAB : ',ISTAB,NSRCH - WRITE(*,*) - WRITE(*,*) ' I CSM P1P IP1', & - & ' P0P IP0', & - & ' LAMBDA PP' + ZDIFF(1:NPPR+1) = ABS(RPRM(1:NPPR+1) - XP0(1:NPPR+1)) + ZERRTOT = SUM(ZDIFF(1:NPPR+1)) / REAL(NPPR+1,RKIND) + ! + if (icount .eq. 1) WRITE(iunit_cols+1,'(A)') '% ICOUNT I CSM P1P IP1 P0P IP0 LAMBDA PP' DO J910=1,NPPR+1 - WRITE(*,250) J910,PCSM(J910),XP1(J910),NP1(J910), & + WRITE(iunit_cols+1,250) ICOUNT,J910,PCSM(J910),XP1(J910),NP1(J910), & & XP0(J910),NP0(J910), & & XLAMB(J910),RPRM(J910) END DO - WRITE(*,*) - WRITE(*,*) 'ERROR : ',ZERR,ZEPS + WRITE(iunit_output,*) 'ICOUNT = ',ICOUNT,': ERROR : ',ZERRTOT,ZEPS,' ISTAB,NSRCH : ',ISTAB,NSRCH + WRITE(6,*) 'PPRM: ICOUNT = ',ICOUNT,': ERROR : ',ZERRTOT,ZEPS,' ISTAB,NSRCH : ',ISTAB,NSRCH ! CALL SPLINE(NPPR+1,PCSM,RPRM,D2RPRM,ZWORK) ! @@ -359,37 +353,40 @@ SUBROUTINE PPRM(KPPR1,KFIN) ! 9500 CONTINUE ! - WRITE(*,*) - WRITE(*,*) 'ISTAB : ',ISTAB,NSRCH-3 - WRITE(*,*) - WRITE(*,*) ' I CSM PP0 IP0 ', & - & ' MIN MAX LAMBDA', & - & ' DIFF PP' + ZDIFF(1:NPPR+1) = ABS(RPRM(1:NPPR+1) - XP0(1:NPPR+1)) + ZERRMAX = MAXVAL(ZDIFF(1:NPPR+1)) + ZERRTOT = SUM(ZDIFF(1:NPPR+1)) / REAL(NPPR+1,RKIND) + ! + if (icount .eq. 1) WRITE(iunit_cols,'(A,A)') '% ICOUNT I CSM PP0 IP0 MIN MAX LAMBDA', & + & ' DIFF PP' DO J960=1,NPPR+1 - WRITE(*,260) J960,PCSM(J960),XP0(J960),NP0(J960), & + WRITE(iunit_cols,260) ICOUNT,J960,PCSM(J960),XP0(J960),NP0(J960), & & XPPRMN(J960),XPPRMX(J960),XLAMB(J960), & & ZDIFF(J960),RPRM(J960) END DO ! - WRITE(*,*) - ! - IF (ZERR .LE. ZEPS) THEN + IF (ZERRTOT .LE. ZEPS) THEN ! - IF (ZERR .EQ. 0._RKIND .AND. ISTAB .NE. 1) THEN - write(0,*) '(ZERR .EQ. 0._RKIND .AND. ISTAB .NE. 1)' - write(eqchease_out(index_out)%codeparam%output_diag(1),*) 'in pprm: (ZERR .EQ. 0._RKIND .AND. ISTAB .NE. 1)' + IF (ZERRTOT .EQ. 0._RKIND .AND. ISTAB .NE. 1) THEN + write(0,*) '(ZERRTOT .EQ. 0._RKIND .AND. ISTAB .NE. 1)' + write(eqchease_out(index_out)%codeparam%output_diag(1),*) 'in pprm: (ZERRTOT .EQ. 0._RKIND .AND. ISTAB .NE. 1)' eqchease_out(index_out)%codeparam%output_flag = -202 return END IF ! - WRITE(6,110) 'EPSILON > ERROR > EPSILON / 5._RKIND ' - WRITE(6,*) ZEPS,ZERR,ZEPS / 5._RKIND + WRITE(iunit_output,'(A,I3,A,1p3e11.2,A,2I3)') 'ICOUNT =',ICOUNT,' : EPSILON > ERROR > EPSILON / 5._RKIND: ',ZEPS,ZERRTOT,ZEPS/5._RKIND, & + & ' ISTAB, NSRCH-3: ',ISTAB,NSRCH-3 + WRITE(6,'(A,I3,A,1p3e11.2,A,2I3)') 'PPRM converged: ICOUNT =',ICOUNT,' : EPSILON > ERROR > EPSILON / 5._RKIND: ',ZEPS,ZERRTOT,ZEPS/5._RKIND, & + & ' ISTAB, NSRCH-3: ',ISTAB,NSRCH-3 ! KFIN = 3 ! ELSE ! - WRITE(*,*) 'ERROR > EPSILON ',ZERR,ZEPS + WRITE(iunit_output,'(A,I3,A,1p3e11.2,A,2I3)') 'ICOUNT =',ICOUNT,' : ERROR > EPSILON, ERROR MAX: ',ZERRTOT,ZEPS,ZERRMAX, & + & ' ISTAB, NSRCH-3: ',ISTAB,NSRCH-3 + WRITE(6,'(A,I3,A,1p3e11.2,A,2I3)') 'PPRM: ICOUNT =',ICOUNT,' : ERROR > EPSILON, ERROR MAX: ',ZERRTOT,ZEPS,ZERRMAX, & + & ' ISTAB, NSRCH-3: ',ISTAB,NSRCH-3 ! ENDIF ! @@ -401,8 +398,8 @@ SUBROUTINE PPRM(KPPR1,KFIN) 110 FORMAT (A,/) ! 200 FORMAT (I8,2X,F15.8,/) -250 FORMAT (I5,2X,F15.8,2(2X,F15.8,I5),2(2X,F15.8)) -260 FORMAT (I5,2(2X,F15.8),I5,5(2X,F15.8)) +250 FORMAT (2I5,2X,F15.8,2(2X,F15.8,I5),2(2X,F15.8)) +260 FORMAT (2I5,2(2X,F15.8),I5,5(2X,F15.8)) ! 400 FORMAT (E15.8,2X,E15.8) 410 FORMAT (E15.8,2X,I5) diff --git a/src-f90/premap.f90 b/src-f90/premap.f90 index d1e5af8177b4a636d7d7d18baa30aef1c411f213..b273853d86ef663521407d304e704ffe5120578e 100644 --- a/src-f90/premap.f90 +++ b/src-f90/premap.f90 @@ -46,9 +46,9 @@ SUBROUTINE PREMAP(K) NISO1EFF = NISO SMISO(1:NISO1EFF) = CSIPR(1:NISO1EFF) PSIISO(1:NISO1EFF) = SPSIM * (1._RKIND - SMISO(1:NISO1EFF)**2) - ! this case should not be called for mappin but since has already rho=0 do not add it - NISO1EFF1 = NISO1EFF - SMISOP1(1:NISO1EFF) = SMISO(1:NISO1EFF) + ! this case should not be called for mappin but since has already rho=0 do not add it (not true, csipr(1).ne.0) + NISO1EFF1 = NISO1EFF + 1 + SMISOP1(1:NISO1EFF1) = (/ 0._RKIND, SMISO(1:NISO1EFF) /) ! ELSE IF (K .EQ. 2) THEN ! @@ -56,7 +56,7 @@ SUBROUTINE PREMAP(K) SMISO(1:NISO1EFF) = PCSM(1:NISO1EFF) PSIISO(1:NISO1EFF) = SPSIM * (1._RKIND - SMISO(1:NISO1EFF)**2) NISO1EFF1 = NISO1EFF + 1 - SMISOP1(1:NISO1EFF+1) = (/ 0._RKIND, SMISO(1:NISO1EFF) /) + SMISOP1(1:NISO1EFF1) = (/ 0._RKIND, SMISO(1:NISO1EFF) /) ! ELSE IF (K .EQ. 3) THEN ! @@ -64,7 +64,7 @@ SUBROUTINE PREMAP(K) SMISO(1:NISO1EFF) = CS(2:NISO1EFF+1) PSIISO(1:NISO1EFF) = SPSIM * (1._RKIND - PSISCL * SMISO(1:NISO1EFF)**2) NISO1EFF1 = NISO1EFF + 1 - SMISOP1(1:NISO1EFF+1) = (/ 0._RKIND, SMISO(1:NISO1EFF) /) + SMISOP1(1:NISO1EFF1) = (/ 0._RKIND, SMISO(1:NISO1EFF) /) ! ELSE IF (K .EQ. 4) THEN ! @@ -92,7 +92,7 @@ SUBROUTINE PREMAP(K) END DO PSIISO(1:NISO1EFF) = SPSIM * (1._RKIND - PSISCL * SMISO(1:NISO1EFF)**2) NISO1EFF1 = NISO1EFF + 1 - SMISOP1(1:NISO1EFF+1) = (/ 0._RKIND, SMISO(1:NISO1EFF) /) + SMISOP1(1:NISO1EFF1) = (/ 0._RKIND, SMISO(1:NISO1EFF) /) ! ELSE IF (K .EQ. 6) THEN ! EQUIDISTANT WITH DX=1/(NPSI), FIRST POINT AT ZS=1/(NPSI), LAST AT ZS=1 @@ -102,11 +102,11 @@ SUBROUTINE PREMAP(K) END DO PSIISO(1:NISO1EFF) = SPSIM * (1._RKIND - PSISCL * SMISO(1:NISO1EFF)**2) NISO1EFF1 = NISO1EFF + 1 - SMISOP1(1:NISO1EFF+1) = (/ 0._RKIND, SMISO(1:NISO1EFF) /) + SMISOP1(1:NISO1EFF1) = (/ 0._RKIND, SMISO(1:NISO1EFF) /) ! ENDIF ! - IF (((NSTTP.EQ.3) .OR. (NSTTP.EQ.4)) .AND. K .GT. 2) THEN + IF (((NSTTP.EQ.3) .OR. (NSTTP.EQ.4) .OR. (NSTTP.EQ.5)) .AND. K .GT. 2) THEN ! CALL RESETI(IC,NISO1EFF,1) DO JS = 1,NISO @@ -133,6 +133,24 @@ SUBROUTINE PREMAP(K) ! END DO ! + IF (NSTTP.EQ.5) THEN + ! + DO J7=1,NISO1EFF + ! + ISIPR = IS0(J7) + ! + IF (ISIPR .GE. NISO - 2) ISIPR = NISO - 2 + IF (ISIPR .LE. 2) ISIPR = 2 + ! + ISTAR_TARGET(J7) = FCCCC0(ISTAR_TARGETO(ISIPR-1),ISTAR_TARGETO(ISIPR), & + & ISTAR_TARGETO(ISIPR+1),ISTAR_TARGETO(ISIPR+2), & + & CSIPR(ISIPR-1),CSIPR(ISIPR), & + & CSIPR(ISIPR+1),CSIPR(ISIPR+2), & + & SMISO(J7)) + ! + END DO + END IF + ! ENDIF ! CALL RMRAD(NISO1EFF,SPSIM,RC0P,RC0P,ZPAR,SIGMAP,TETMAP,NTP2) diff --git a/src-f90/preset.f90 b/src-f90/preset.f90 index bd5af6515a023873f1c193642d8476eb02eb8f8d..8860ee8b5c84d8df30a6a43ee69ece7472f7cddc 100644 --- a/src-f90/preset.f90 +++ b/src-f90/preset.f90 @@ -88,6 +88,7 @@ SUBROUTINE PRESET NFUNC = 1 NFUNRHO = 0 NIDEAL = 6 + NINBLOPT = 20 NINMAP = 30 NINSCA = 30 NIPR = 1 @@ -184,6 +185,7 @@ SUBROUTINE PRESET PANGLE = 0._RKIND PSISCL = 1._RKIND QSPEC = 1._RKIND + PPRIME_BAL_MAX = 6._RKIND PREDGE = 0._RKIND RBOXLEN = 0._RKIND RBOXLFT = 0._RKIND diff --git a/src-f90/prfunc.f90 b/src-f90/prfunc.f90 index 80feab47018f0ea63083d63412cd7f3a586f69f7..f76c40c476e123d37fbe9636e351ad91e0ebcc18 100644 --- a/src-f90/prfunc.f90 +++ b/src-f90/prfunc.f90 @@ -255,13 +255,18 @@ SUBROUTINE PRFUNC(KN,PP,PT) ELSE ZS(J6) = SQRT(ZS(J6)) END IF + IF (ZS(J6) .GT. 1._RKIND) ZS(J6) = 1._RKIND END DO IF (CSIPRI(NISO1EFF).LT.0.9) THEN PRINT *,'NISO1EFF, CSIPRI(NISO1EFF)= ',NISO1EFF, CSIPRI(NISO1EFF) ENDIF - CALL PPSPLN2(KN,ZS,NISO1EFF-1,CSIPRI,CIDRTOR,D2CIDRTOR,PT0,ZDUMAR,ZDUMAR) - ! GET FUNCTION FOR GIVEN RHOTOR - CALL PPSPLN2(KN,PT0,NPPF,FCSM,RFUN,D2RFUN,PT,ZDUMAR,ZDUMAR) + IF (NSTTP .NE. 5) THEN + CALL PPSPLN2(KN,ZS,NISO1EFF-1,CSIPRI,CIDRTOR,D2CIDRTOR,PT0,ZDUMAR,ZDUMAR) + ! GET FUNCTION FOR GIVEN RHOTOR + CALL PPSPLN2(KN,PT0,NPPF,FCSM,RFUN,D2RFUN,PT,ZDUMAR,ZDUMAR) + ELSEIF (NSTTP .EQ. 5) THEN + CALL INTERPOS(SMISO(1:NISO1EFF),istar_target(1:NISO1EFF),NISO1EFF,KN,tension=0._rkind,xout=ZS(1:KN),yout=PT(1:KN)) + ENDIF ELSE write(0,*) 'NFUNRHO= ',NFUNRHO,' AND NRHOMESH= ',NRHOMESH,' NOT YET CODED IN' write(eqchease_out(index_out)%codeparam%output_diag(1),*) & diff --git a/src-f90/prof2d_rz_to_fluxtheta.f90 b/src-f90/prof2d_rz_to_fluxtheta.f90 index 9d350cd5775481983766d671a7b1053c5d2a44ff..8fbdd471905637084d9f600a4dfb3d29815b3055 100644 --- a/src-f90/prof2d_rz_to_fluxtheta.f90 +++ b/src-f90/prof2d_rz_to_fluxtheta.f90 @@ -80,7 +80,7 @@ subroutine prof2d_rz_to_fluxtheta(RR,ZZ,f2darray_in,Rbnd,Zbnd,Raxis,Zaxis,flux_n ! kflag = 0 twopi = 2._R8 * PI_PARAM - nverbose = 3 + nverbose = 0 ! tension_eff = -0.1_R8 if (present(tension_in)) then @@ -143,7 +143,7 @@ subroutine prof2d_rz_to_fluxtheta(RR,ZZ,f2darray_in,Rbnd,Zbnd,Raxis,Zaxis,flux_n rhobnd_sorted(1:nbnd) = rhobnd(i_sorted(1:nbnd)) nbnd_eff = nbnd if (abs(thetabnd_sorted(nbnd)-twopi-thetabnd_sorted(1)) .lt. 1e-07_R8) then - if (NVERBOSE .GE. 0) write(6,*) 'in bndfit: end theta points given twice, remove it' + if (NVERBOSE .GE. 0) write(6,*) 'in prof2d_rz_to_fluxtheta: end theta points given twice, remove it' nbnd_eff = nbnd_eff - 1 end if ! check that there are not 2 points too close in rho (although now also done in interpos) @@ -156,7 +156,7 @@ subroutine prof2d_rz_to_fluxtheta(RR,ZZ,f2darray_in,Rbnd,Zbnd,Raxis,Zaxis,flux_n rhobnd_sorted(i) = rhobnd_sorted(j) end if end do - if ((nbnd_eff .GT. i) .AND. (NVERBOSE.GE.0)) write(6,*) & + if ((nbnd_eff .GT. i) .AND. (NVERBOSE.GE.1)) write(6,*) & & 'Some points along plasma boundary too close in theta and ignored in prof2dRZ_to_fluxtheta: nbnd_eff=', & & nbnd_eff,' reduced to ',i nbnd_eff = i; diff --git a/src-f90/profile.f90 b/src-f90/profile.f90 index 0c24982ecdff6ee492d81d65d3013a5ff2918616..89d972bb66d351dfec1a52c378459d251c104507 100644 --- a/src-f90/profile.f90 +++ b/src-f90/profile.f90 @@ -14,8 +14,9 @@ SUBROUTINE PROFILE(KN) ! USE globals USE interpol + use interpos_module IMPLICIT NONE - ! + ! INTEGER :: KN ! !----*----*----*---*----*----*----*----*----*----*----*----*----*----*- @@ -24,7 +25,7 @@ SUBROUTINE PROFILE(KN) ! ON THE OUTPUT WITH ZPSITEST WRITTEN BY BALLIT. ! REAL(RKIND) :: ZWORK(KN+1) - REAL(RKIND) :: ZCID0, ZCID2, ZCID3 + REAL(RKIND) :: ZCID0, ZCID2, ZCID3, TENS_DEF INTEGER :: IP, J1, J2 ! FUNCTION INTEGER :: ISRCHFGE @@ -111,54 +112,54 @@ SUBROUTINE PROFILE(KN) ! COMPUTE RHO_TOR MESH IF NEEDED TO GET PROFILES ! IF (NRHOMESH .GT. 0) THEN + tens_def = -0.1_rkind IF (KN .NE. NISO) THEN IF (NVERBOSE .GE. 1) PRINT *,'KN= ',KN,' .NE. NISO= ',NISO, & & ' => CIDRTOR NOT RECALCULATED SINCE TMF NOT YET DEFINED ON FULL MESH' IF (NVERBOSE .GE. 1) PRINT *,' TMF(KN)= ',TMF(1:KN) ! CASE OF MAPPING ON WHATEVER PSIISO SURFACES AND KN CAN BE WHATEVER. BETTER TO KEEP LAST - ! VALUES OF CIDRTOR WITH LAST TMF DURING ITERATIONS. MIGHT BE THAT ONE SHOULD RECALCULATED + ! VALUES OF CIDRTOR WITH LAST TMF DURING ITERATIONS. MIGHT BE THAT ONE SHOULD RECALCULATED ! ONCE EQUILIBRIUM HAS CONVERGED. ! NOTE, ONE COULD CALCULATE HERE TMF ON PRESENT PSIISO MESH... - ! + ! ELSE IF (NVERBOSE .GE. 3) PRINT *,'KN= ',KN,' , NISO= ',NISO,' CIDRTOR recalculated' IF (ABS(TMF(KN)) .LE. 1.E-08_RKIND) THEN IF (NVERBOSE .GE. 1) print *,' profile special case, KN= ',KN,' NISO= ',NISO,' TMF(KN)= ',TMF(KN) endif IF (ABS(TMF(KN)) .GT. 1.E-08_RKIND) THEN - ! COMPUTE RHOTOR ON CSIPRI MESH (EQUIVALENT TO CS MESH, SINCE CIDQ ON CSM MESH) - CIDRTOR(1)=0._RKIND - DO J2=2,KN - CIDRTOR(J2) = CIDRTOR(J2-1) + CIDQ(J2-1)*TMF(J2-1)*SPSIM*(CSIPRI(J2-1)**2-CSIPRI(J2)**2) - END DO - CIDRTOR(1:KN) = sqrt(CIDRTOR(1:KN)/CIDRTOR(KN)) + ZWORK(2:KN+1) = CIDQ(1:KN) * TMF(1:KN) ELSE ! ASSUME TMF=1 IF (NVERBOSE .GE. 1) PRINT *,' ASSUME T=1 TO COMPUTE CIDRTOR=RHOTOR ON CSIPRI MESH' - CIDRTOR(1)=0._RKIND - DO J2=2,KN - CIDRTOR(J2) = CIDRTOR(J2-1) + CIDQ(J2-1)*SPSIM*(CSIPRI(J2-1)**2-CSIPRI(J2)**2) - END DO - CIDRTOR(1:KN) = sqrt(CIDRTOR(1:KN)/CIDRTOR(KN)) + ZWORK(2:KN+1) = CIDQ(1:KN) ENDIF + ! CIDQ, TMF on SMISO/PSIISO, axis value not yet computed, assume same as 1st point + ZWORK(1) = FCCCC0(ZWORK(2),ZWORK(3),ZWORK(4),ZWORK(5), & + & SMISOP1(2),SMISOP1(3),SMISOP1(4),SMISOP1(5),SMISOP1(1)) + !ZWORK(1) = ZWORK(2) + ! COMPUTE RHOTOR ON CSIPRI MESH TO GET FULL RANGE (nt same as CSIPR) + CALL INTERPOS(SMISOP1(1:kn+1)**2,ZWORK(1:kn+1),nin=KN+1,nout=KN,TENSION=TENS_DEF,XOUT=CSIPRI(1:KN)**2,YOUTINT=CIDRTOR(1:KN), & + & nbc=(/0, 2/), ybc=(/ 0._rkind, ZWORK(KN+1) /) ) + CIDRTOR(1:KN) = sqrt(CIDRTOR(1:KN)/CIDRTOR(KN)) + CIDRTOR(1)=0._RKIND + CIDRTOR(KN)=1._RKIND +!!$ rewind(42) +!!$ write(42,'(A)') '% CSIPRI cidq CIDRTOR PSIISO SMISO TMF CSIPR SMISOP1 ZWORK' +!!$ write(42,'(1p9e14.6)') (CSIPRI(J2),cidq(J2),CIDRTOR(J2),PSIISO(J2),SMISO(J2),TMF(J2),CSIPR(J2),SMISOP1(J2),ZWORK(J2),J2=1,KN) +!!$ write(42,'(A,1pe14.6)') 'SMISOP1(KN+1) = ',SMISOP1(KN+1),' ZWORK(KN+1) = ',ZWORK(KN+1),' Q0= ',Q0 CALL SPLINE(KN,CSIPRI,CIDRTOR,D2CIDRTOR,ZWORK) ENDIF IF (KN .GE. NISO+5) THEN ! TMF NOT YET DEFINED (ON NEW MESH) COMPUTE RHOTOR ON CSIPRI MESH ASSUME TMF=1 ! THIS CASE WAS WHILE DEVELOPING, NOT SURE RELEVANT ACTION TO DO, BETTER KEEP LAST VALUE CALCULATED - ! IF THIS CASE STOPS HERE, CONTACT O. SAUTER FOR FURTHER DEVELOPMENT + ! IF THIS CASE STOPS HERE, CONTACT O. SAUTER FOR FURTHER DEVELOPMENT IF (NVERBOSE .GE. 0) write(0,*) ' contact O. Sauter, profile special case, KN= ',KN,' NISO= ',NISO write(eqchease_out(index_out)%codeparam%output_diag(1),*) & & ' contact O. Sauter, profile special case, KN= ',KN,' NISO= ',NISO eqchease_out(index_out)%codeparam%output_diag(2) = 'not sure how can get there, contact O. Sauter' eqchease_out(index_out)%codeparam%output_flag = -222 return - CIDRTOR(1)=0._RKIND - DO J2=2,KN - CIDRTOR(J2) = CIDRTOR(J2-1) + CIDQ(J2-1)*SPSIM*(CSIPRI(J2-1)**2-CSIPRI(J2)**2) - END DO - CIDRTOR(1:KN) = sqrt(CIDRTOR(1:KN)/CIDRTOR(KN)) - CALL SPLINE(KN,CSIPRI,CIDRTOR,D2CIDRTOR,ZWORK) ENDIF ENDIF ! diff --git a/src-f90/psibox.f90 b/src-f90/psibox.f90 index 06ce6af2a2fc9382bb87a6cfcfa3502a3b3c0d15..274a100eb67734fdfd940693dbfa84ea34fd4127 100644 --- a/src-f90/psibox.f90 +++ b/src-f90/psibox.f90 @@ -219,8 +219,9 @@ SUBROUTINE PSIBOX(KPSI1) ! Simple check: Check if a limiter point is inside (Rmin,Rmax,Zmin,Zmax) box IF ((WALLPOSR(I).GE.ZRMIN*R0EXP) .AND. (WALLPOSR(I).LE.ZRMAX*R0EXP) .AND. & & (WALLPOSZ(I).GE.ZZMIN*R0EXP) .AND. (WALLPOSZ(I).LE.ZZMAX*R0EXP)) THEN - print *,'I, WALLPOSR(I), WALLPOSZ(I), ZRMIN*R0EXP, ZRMAX*R0EXP, ZZMIN*R0EXP, ZZMAX*R0EXP= ', & - & I, WALLPOSR(I), WALLPOSZ(I), ZRMIN*R0EXP, ZRMAX*R0EXP, ZZMIN*R0EXP, ZZMAX*R0EXP + if (nverbose .ge. 1) & + & print *,'I, WALLPOSR(I), WALLPOSZ(I), ZRMIN*R0EXP, ZRMAX*R0EXP, ZZMIN*R0EXP, ZZMAX*R0EXP= ', & + & I, WALLPOSR(I), WALLPOSZ(I), ZRMIN*R0EXP, ZRMAX*R0EXP, ZZMIN*R0EXP, ZZMAX*R0EXP IFIXWALL=1 END IF END DO diff --git a/src-f90/runtim.f90 b/src-f90/runtim.f90 index d9c9997139cff448427b8fbef3b60b927acffb57..273296ef94b480569128a892e47ef91a30f18344 100644 --- a/src-f90/runtim.f90 +++ b/src-f90/runtim.f90 @@ -6,16 +6,16 @@ use prec_const use globals implicit none -! +! real(rkind) :: cptime ! CPTIME = 0._rkind -! +! call cpu_time(cptime) ! CPTIME = CPTIME - STIME ! - WRITE (6,9900) CPTIME + if (nverbose .ge. 1) WRITE (6,9900) CPTIME ! RETURN ! diff --git a/src-f90/stepon.f90 b/src-f90/stepon.f90 index 4ef4028adaea9d5ae8c245bb0254159f0fded873..bd554f998a335139706d4722775dea6afee33547 100644 --- a/src-f90/stepon.f90 +++ b/src-f90/stepon.f90 @@ -209,7 +209,7 @@ SUBROUTINE STEPON ! CALL PREMAP(6) This cannot be used without modifying the interpolation !in ogyropsi.f90 which assumes PSIISO on CSM ! only premap 3 allowed - CALL PREMAP(3) + CALL PREMAP(3) CALL NOREPT(NISO1EFF,1) CALL MAPPIN(1) ! @@ -446,7 +446,7 @@ SUBROUTINE STEPON IF (NIDEAL .EQ. 10) THEN CALL HAMADA CALL NEOART - ENDIF + ENDIF RETURN ! 2501 FORMAT(///,10X,'*******************************************', & diff --git a/src-f90/surf_metrics_onaxis.f90 b/src-f90/surf_metrics_onaxis.f90 index cea5f867f802f393873e1f95cb1076ae82c53c32..973f6346ce7bedabd51e4efb6a5c3a604c29adea 100644 --- a/src-f90/surf_metrics_onaxis.f90 +++ b/src-f90/surf_metrics_onaxis.f90 @@ -98,7 +98,15 @@ SUBROUTINE SURF_METRICS_ONAXIS ! eqchease_out(index_out)%coord_sys%g_11(1,:) = 0._rkind eqchease_out(index_out)%coord_sys%g_33(1,:) = 1._rkind/RMAG**2 - eqchease_out(index_out)%coord_sys%grid%dim1(1:NISO1EFF1)=(/0._rkind, psiiso(1:NISO1EFF) /) + if (psiiso(1) .GT. 0._RKIND) then + ! psiiso shifted by -SPSIM in NOREPT to be 0 on-axis, usual case + eqchease_out(index_out)%coord_sys%grid%dim1(1:NISO1EFF1)=(/0._RKIND, psiiso(1:NISO1EFF) /) + else + if (NVERBOSE .GE. 3) write(6,*) & + & 'calling surf_metrics_onaxis, hence mappin, without norept(xx,kopt=1) shifting psiiso, are you sure?' + eqchease_out(index_out)%coord_sys%grid%dim1(1:NISO1EFF1)=(/SPSIM, psiiso(1:NISO1EFF) /) + end if + ! allocate(zwork(NISO1EFF1)) do ichi=1,NCHI CALL INTERPOS(SMISOP1(2:NISO1EFF1),eqchease_out(index_out)%coord_sys%jacobian(2:NISO1EFF1,ichi),N=NISO1EFF1-1, & diff --git a/src-f90/write_ogyropsi.f90 b/src-f90/write_ogyropsi.f90 index 0cc8bd26cbb473a4635f73feda4bf7e827990d8a..a98d63ad2f24474d8a808ad3f38c10f356c89f20 100644 --- a/src-f90/write_ogyropsi.f90 +++ b/src-f90/write_ogyropsi.f90 @@ -27,6 +27,13 @@ SUBROUTINE INIT_WRITE_OUT(ioutgyro,hdf5_ioutgyro,pfile) END SUBROUTINE INIT_WRITE_OUT +SUBROUTINE WRITE_OUT_EXPEQ_IN(ioutgyro,hdf5_ioutgyro, EXPEQ_IN_FILENAME) + !! Dummy routine to match the hdf5 counterpart + IMPLICIT NONE + INTEGER :: ioutgyro, hdf5_ioutgyro + CHARACTER(len=*) :: EXPEQ_IN_FILENAME +END SUBROUTINE WRITE_OUT_EXPEQ_IN + SUBROUTINE CLOSE_WRITE_OUT(ioutgyro,hdf5_ioutgyro) ! Close ASCII fill IMPLICIT NONE diff --git a/src-f90/write_ogyropsi_hdf5.f90 b/src-f90/write_ogyropsi_hdf5.f90 index ed88996a081647b3bac28f85484741f0c9f430e3..bba6863a7508fcb9dd32fb37664f78ec7030190f 100644 --- a/src-f90/write_ogyropsi_hdf5.f90 +++ b/src-f90/write_ogyropsi_hdf5.f90 @@ -26,15 +26,26 @@ SUBROUTINE INIT_WRITE_OUT(ioutgyro,ioutgyro_hdf5,pfile) CALL creatg(ioutgyro_hdf5, "/data/var1d", "1-dim quantities fct of (PSI)") CALL creatg(ioutgyro_hdf5, "/data/var2d","2-dim quantities fct of (PSI,CHI)") CALL creatg(ioutgyro_hdf5, "/inputs", "Inputs specific to the run") - ! Write INPUT file in HDDF5 + ! Write INPUT file in HDF5 CALL putfile(ioutgyro_hdf5, '/inputs/STDIN', 'chease_namelist') ! - ! ! Open ASCII file OPEN(ioutgyro,file=PFILE//'.dat') END SUBROUTINE INIT_WRITE_OUT +SUBROUTINE WRITE_OUT_EXPEQ_IN(ioutgyro,ioutgyro_hdf5, EXPEQ_IN_FILENAME) + USE futils + IMPLICIT NONE + INTEGER :: ioutgyro, ioutgyro_hdf5 + CHARACTER(len=*) :: EXPEQ_IN_FILENAME + + ! Write INPUT EXPEQ.IN profiles in HDF5 if filename has been set + IF (LEN(TRIM(EXPEQ_IN_FILENAME)) > 0) THEN + CALL putfile(ioutgyro_hdf5, '/inputs/EXPEQ.IN', trim(EXPEQ_IN_FILENAME)) + END IF +END SUBROUTINE WRITE_OUT_EXPEQ_IN + SUBROUTINE CLOSE_WRITE_OUT(ioutgyro,ioutgyro_hdf5) ! Close HDF5 and ASCII fill USE futils diff --git a/src-f90/wrtplot.f90 b/src-f90/wrtplot.f90 index c6dd0b64f0ec622b92e44513307f322802c043d6..409752297b5e8cb12fed9d2aec24eb3e422e9283 100644 --- a/src-f90/wrtplot.f90 +++ b/src-f90/wrtplot.f90 @@ -14,9 +14,7 @@ SUBROUTINE WRTPLOT ! USE globals USE interpol -!cgv use interpos_module -!cgv IMPLICIT NONE INCLUDE 'COMDAT.inc' ! @@ -139,49 +137,49 @@ SUBROUTINE WRTPLOT CHARACTER*8 CDATE ! DIMENSION & - & IBALL(NPISOEFF), IMERCI(NPISOEFF), IMERCR(NPISOEFF) + & IBALL(NPISOEFF), IMERCI(NPISOEFF), IMERCR(NPISOEFF) DIMENSION & - & ZABIC(NPCHI1), ZABIPR(NPISOEFF), ZABIS(NPISOEFF), & - & ZABISG(NSP1), ZABIT(NTP1), ZABR (2*NPISOEFF+1), & - & ZABS (NPISOEFF), ZABSM(NPISOEFF), ZCHI(NPCHI1), & - & ZCSIPR(NPISOEFF), & - & ZOARS(NPISOEFF), ZOART(NTP1), ZOBETS(NPISOEFF), & - & ZOSHR(2*NPISOEFF+1), ZOSHS(NPISOEFF), ZOJBR(2*NPISOEFF+1), & - & ZOJBS(NPISOEFF), ZOJPR(2*NPISOEFF+1), ZOJPS(NPISOEFF), & - & ZOJBSR(2*NPISOEFF+1,4),ZOJBSS(NPISOEFF,4), ZODIS(NPISOEFF), & - & ZODRS(NPISOEFF), ZOBETR(2*NPISOEFF+1),ZOTRR(2*NPISOEFF+1), & - & ZOTRS(NPISOEFF), ZODQR(2*NPISOEFF+1), & - & ZOFR (2*NPISOEFF+1), ZODQS(NPISOEFF), ZOHS (NPISOEFF), & - & ZOIPR(2*NPISOEFF+1), ZOIPS(NPISOEFF), ZOJR (2*NPISOEFF+1), & - & ZOPPR(2*NPISOEFF+1), ZOPPS(NPISOEFF), ZOPR (2*NPISOEFF+1), & - & ZOPS (NPISOEFF), ZOQR (2*NPISOEFF+1), ZOQS (NPISOEFF), & - & ZOTR(2*NPISOEFF+1), ZOTS(NPISOEFF), ZOTTR(2*NPISOEFF+1), & - & ZOTTS(NPISOEFF), ZPAR(2*NPISOEFF+1), & - & ZR(12*NPT+1), ZRCHI(NPCHI1,NPISOEFF), ZRCURV(4*2*NPISOEFF), & - & ZRHOS(NTP1), & - & ZRSUR(6*NPT), ZRTET(NPT), ZSIG1(NPISOEFF), & - & ZTET(NTP1), ZTET1(NPISOEFF), ZTSUR(6*NPT), & - & ZZ(12*NPT+1), ZZCHI(NPCHI1,NPISOEFF), ZZCURV(4*2*NPISOEFF), & - & ZZTET(NPT), & - & ZZSUR(6*NPT), ZANGLE(1), ZBND1(1), ZBND2(1) -!cgv - integer :: jp - real(rkind) :: zcrv, zczv -! real(rkind), dimension(nrbox,nzbox) :: zchirz - real(rkind) :: zchirz - allocatable :: zchirz(:,:) + & ZABIC(NPCHI1), ZABIPR(NPISOEFF), ZABIS(NPISOEFF), & + & ZABISG(NSP1), ZABIT(NTP1), ZABR (2*NPISOEFF+1), & + & ZABS (NPISOEFF), ZABSM(NPISOEFF), ZCHI(NPCHI1), & + & ZCSIPR(NPISOEFF), & + & ZOARS(NPISOEFF), ZOART(NTP1), ZOBETS(NPISOEFF), & + & ZOSHR(2*NPISOEFF+1), ZOSHS(NPISOEFF), ZOJBR(2*NPISOEFF+1), & + & ZOJBS(NPISOEFF), ZOJPR(2*NPISOEFF+1), ZOJPS(NPISOEFF), & + & ZOJBSR(2*NPISOEFF+1,4),ZOJBSS(NPISOEFF,4), ZODIS(NPISOEFF), & + & ZODRS(NPISOEFF), ZOBETR(2*NPISOEFF+1),ZOTRR(2*NPISOEFF+1), & + & ZOTRS(NPISOEFF), ZODQR(2*NPISOEFF+1), & + & ZOFR (2*NPISOEFF+1), ZODQS(NPISOEFF), ZOHS (NPISOEFF), & + & ZOIPR(2*NPISOEFF+1), ZOIPS(NPISOEFF), ZOJR (2*NPISOEFF+1), & + & ZOPPR(2*NPISOEFF+1), ZOPPS(NPISOEFF), ZOPR (2*NPISOEFF+1), & + & ZOPS (NPISOEFF), ZOQR (2*NPISOEFF+1), ZOQS (NPISOEFF), & + & ZOTR(2*NPISOEFF+1), ZOTS(NPISOEFF), ZOTTR(2*NPISOEFF+1), & + & ZOTTS(NPISOEFF), ZPAR(2*NPISOEFF+1), & + & ZR(12*NPT+1), ZRCHI(NPCHI1,NPISOEFF), ZRCURV(4*2*NPISOEFF), & + & ZRHOS(NTP1), & + & ZRSUR(6*NPT), ZRTET(NPT), ZSIG1(NPISOEFF), & + & ZTET(NTP1), ZTET1(NPISOEFF), ZTSUR(6*NPT), & + & ZZ(12*NPT+1), ZZCHI(NPCHI1,NPISOEFF), ZZCURV(4*2*NPISOEFF), & + & ZZTET(NPT), & + & ZZSUR(6*NPT), ZANGLE(1), ZBND1(1), ZBND2(1) + ! + integer :: jp + real(rkind) :: zcrv, zczv + ! real(rkind), dimension(nrbox,nzbox) :: zchirz + real(rkind) :: zchirz + allocatable :: zchirz(:,:) - real(rkind) :: rjacobi, rg11u, rg12u, rg22u, rg33u - allocatable :: rjacobi(:,:), rg11u(:,:), rg12u(:,:), rg22u(:,:), rg33u(:,:) - real(rkind) :: d1rjacobi, d1rg11u, d1rg12u, d1rg22u, d1rg33u - allocatable :: d1rjacobi(:,:), d1rg11u(:,:), d1rg12u(:,:), d1rg22u(:,:), d1rg33u(:,:) - real(rkind) :: d2rjacobi, d2rg11u, d2rg12u, d2rg22u, d2rg33u - allocatable :: d2rjacobi(:,:), d2rg11u(:,:), d2rg12u(:,:), d2rg22u(:,:), d2rg33u(:,:) - real(rkind) :: d1r, d1z, d2r, d2z - allocatable :: d1r(:,:), d1z(:,:), d2r(:,:), d2z(:,:) - character*30 :: ztext - real(rkind) :: tens_def, tens_def2 -!cgv + real(rkind) :: rjacobi, rg11u, rg12u, rg22u, rg33u + allocatable :: rjacobi(:,:), rg11u(:,:), rg12u(:,:), rg22u(:,:), rg33u(:,:) + real(rkind) :: d1rjacobi, d1rg11u, d1rg12u, d1rg22u, d1rg33u + allocatable :: d1rjacobi(:,:), d1rg11u(:,:), d1rg12u(:,:), d1rg22u(:,:), d1rg33u(:,:) + real(rkind) :: d2rjacobi, d2rg11u, d2rg12u, d2rg22u, d2rg33u + allocatable :: d2rjacobi(:,:), d2rg11u(:,:), d2rg12u(:,:), d2rg22u(:,:), d2rg33u(:,:) + real(rkind) :: d1r, d1z, d2r, d2z + allocatable :: d1r(:,:), d1z(:,:), d2r(:,:), d2z(:,:) + character*30 :: ztext + real(rkind) :: tens_def, tens_def2 + ! ! !----*----*----*---*----*----*----*----*----*----*----*----*----*----*- @@ -346,16 +344,16 @@ SUBROUTINE WRTPLOT CALL BOUND(NT1,CT,ZRHOS) ! DO J281=1,NT - ! - ZR(J281) = ZRHOS(J281) * COS(CT(J281)) - ZZ(J281) = ZRHOS(J281) * SIN(CT(J281)) - ZRTET(J281) = ZR(J281) - ZZTET(J281) = ZZ(J281) - ZTET(J281) = CT(J281) - CT(1) - ZOART(J281+1) = ZOART(J281) + .25_RKIND * (CT(J281+1) - CT(J281)) * & - & (ZRHOS(J281)**2 + ZRHOS(J281+1)**2) - ZABIT(J281+1) = REAL(J281,RKIND) / REAL(NT,RKIND) - ! + ! + ZR(J281) = ZRHOS(J281) * COS(CT(J281)) + ZZ(J281) = ZRHOS(J281) * SIN(CT(J281)) + ZRTET(J281) = ZR(J281) + ZZTET(J281) = ZZ(J281) + ZTET(J281) = CT(J281) - CT(1) + ZOART(J281+1) = ZOART(J281) + .25_RKIND * (CT(J281+1) - CT(J281)) * & + & (ZRHOS(J281)**2 + ZRHOS(J281+1)**2) + ZABIT(J281+1) = REAL(J281,RKIND) / REAL(NT,RKIND) + ! END DO ! ZTET(NT1) = 2._RKIND * CPI @@ -376,9 +374,9 @@ SUBROUTINE WRTPLOT ZDT = 2._RKIND * CPI / (6 * NT - 1) ! DO J282=1,6*NT - ! - ZTSUR(J282) = (J282 - 1) * ZDT - ! + ! + ZTSUR(J282) = (J282 - 1) * ZDT + ! END DO ! CALL BOUND(6*NT,ZTSUR,ZRSUR) @@ -394,79 +392,78 @@ SUBROUTINE WRTPLOT IF (NSURF .EQ. 6) CALL BNDSPL ! DO J283=1,6*NT - ! - ZZSUR(J283) = ZRSUR(J283) * SIN(ZTSUR(J283)) - ZRSUR(J283) = ZRSUR(J283) * COS(ZTSUR(J283)) - ! + ! + ZZSUR(J283) = ZRSUR(J283) * SIN(ZTSUR(J283)) + ZRSUR(J283) = ZRSUR(J283) * COS(ZTSUR(J283)) + ! END DO -!cgv -!cgv..write plasma boundary coordinates -!cgv - open(81,file='plasma_wall_boundary.data',form='formatted') - rewind(81) - write(81,*) 'cgv---- plasma and wall boundary------------------' - write(81,*) 'r0,rz0,r0exp,r0w,rz0w' - write(81,*) r0,rz0,r0exp,r0w,rz0w - write(81,*) 'plasma mesh center: r0exp*r0,r0exp*rz0' - write(81,*) r0exp*r0,r0exp*rz0 - write(81,*) 'wall center: r0exp*r0w,r0exp*rz0w' - write(81,*) r0exp*r0w,r0exp*rz0w - write(81,*) 'R_plasma Z_plasma R_wall Z_wall' - do j=1,6*nt - write(81,990) r0exp*(r0+zrsur(j)),r0exp*(rz0+zzsur(j)), & - r0exp*(r0w+rext*(r0+zrsur(j)-r0w)), & - r0exp*(rz0w+rext*(rz0+zzsur(j)-rz0w)) - 990 format(1x,1p4e13.5) - enddo - close(81) -!cgv + ! + ! write plasma boundary coordinates + ! + open(81,file='plasma_wall_boundary.data',form='formatted') + rewind(81) + write(81,*) '---- plasma and wall boundary------------------' + write(81,*) 'r0,rz0,r0exp,r0w,rz0w' + write(81,*) r0,rz0,r0exp,r0w,rz0w + write(81,*) 'plasma mesh center: r0exp*r0,r0exp*rz0' + write(81,*) r0exp*r0,r0exp*rz0 + write(81,*) 'wall center: r0exp*r0w,r0exp*rz0w' + write(81,*) r0exp*r0w,r0exp*rz0w + write(81,*) 'R_plasma Z_plasma R_wall Z_wall' + do j=1,6*nt + write(81,990) r0exp*(r0+zrsur(j)),r0exp*(rz0+zzsur(j)), & + r0exp*(r0w+rext*(r0+zrsur(j)-r0w)), & + r0exp*(rz0w+rext*(rz0+zzsur(j)-rz0w)) +990 format(1x,1p4e13.5) + enddo + close(81) ! ! COMPUTE THE VALUES OF R ON RADIUS USED FOR PROFILE DEFINITION ! CALL RMRAD(NISO1EFF,RC0P,CPSRF,PANGLE,ZPAR(1),ZSIG1,ZTET1,1) CALL RMRAD(NISO1EFF,RC0P,CPSRF,PANGLE+CPI,ZPAR(NISO1EFF+1),ZSIG1, & - & ZTET1,1) + & ZTET1,1) ! DO J284=1,NISO1EFF - ! - I1 = NISO1EFF + J284 + 1 - I2 = NISO1EFF - J284 + 1 - ! - ZABR(I1) = ZPAR(J284) * ZBND1(1) - ZABR(I2) = - ZPAR(NISO1EFF+J284) * ZBND2(1) - ZOQR(I2) = QPSI(J284) - ZOQR(I1) = QPSI(J284) - ZOPPR(I2) = CPPR(J284) - ZOPPR(I1) = CPPR(J284) - ZOPR(I2) = CPR(J284) - ZOPR(I1) = CPR(J284) - ZOTTR(I2) = TTP(J284) - ZOTTR(I1) = TTP(J284) - ZOTR(I2) = TMF(J284) - ZOTR(I1) = TMF(J284) - ZOIPR(I2) = RIPR(J284) - ZOIPR(I1) = RIPR(J284) - ZOJBR(I2) = RJDOTB(J284) - ZOJBR(I1) = RJDOTB(J284) - ZODQR(I2) = CDQ(J284) - ZODQR(I1) = CDQ(J284) - ZOSHR(I2) = CDRQ(J284) - ZOSHR(I1) = CDRQ(J284) - ZOFR(I2) = SMISO(J284)**2 * CPSRF - ZOFR(I1) = SMISO(J284)**2 * CPSRF - ZOJR(I1) = - (ZABR(I1) + RMAG) * ZOPPR(I1) - & - & ZOTTR(I1) / (ZABR(I1) + RMAG) - ZOJR(I2) = - (ZABR(I2) + RMAG) * ZOPPR(I2) - & - & ZOTTR(I2) / (ZABR(I2) + RMAG) - ZOBETR(I2) = BETAB(J284) - ZOBETR(I1) = BETAB(J284) - ZOJPR(I2) = RJPAR(J284) - ZOJPR(I1) = RJPAR(J284) - ZOJBSR(I2,1:4) = RJBSOS(J284,1:4) - ZOJBSR(I1,1:4) = RJBSOS(J284,1:4) - ZOTRR(I2) = 1._RKIND - RFCIRC(J284) - ZOTRR(I1) = 1._RKIND - RFCIRC(J284) - ! + ! + I1 = NISO1EFF + J284 + 1 + I2 = NISO1EFF - J284 + 1 + ! + ZABR(I1) = ZPAR(J284) * ZBND1(1) + ZABR(I2) = - ZPAR(NISO1EFF+J284) * ZBND2(1) + ZOQR(I2) = QPSI(J284) + ZOQR(I1) = QPSI(J284) + ZOPPR(I2) = CPPR(J284) + ZOPPR(I1) = CPPR(J284) + ZOPR(I2) = CPR(J284) + ZOPR(I1) = CPR(J284) + ZOTTR(I2) = TTP(J284) + ZOTTR(I1) = TTP(J284) + ZOTR(I2) = TMF(J284) + ZOTR(I1) = TMF(J284) + ZOIPR(I2) = RIPR(J284) + ZOIPR(I1) = RIPR(J284) + ZOJBR(I2) = RJDOTB(J284) + ZOJBR(I1) = RJDOTB(J284) + ZODQR(I2) = CDQ(J284) + ZODQR(I1) = CDQ(J284) + ZOSHR(I2) = CDRQ(J284) + ZOSHR(I1) = CDRQ(J284) + ZOFR(I2) = SMISO(J284)**2 * CPSRF + ZOFR(I1) = SMISO(J284)**2 * CPSRF + ZOJR(I1) = - (ZABR(I1) + RMAG) * ZOPPR(I1) - & + & ZOTTR(I1) / (ZABR(I1) + RMAG) + ZOJR(I2) = - (ZABR(I2) + RMAG) * ZOPPR(I2) - & + & ZOTTR(I2) / (ZABR(I2) + RMAG) + ZOBETR(I2) = BETAB(J284) + ZOBETR(I1) = BETAB(J284) + ZOJPR(I2) = RJPAR(J284) + ZOJPR(I1) = RJPAR(J284) + ZOJBSR(I2,1:4) = RJBSOS(J284,1:4) + ZOJBSR(I1,1:4) = RJBSOS(J284,1:4) + ZOTRR(I2) = 1._RKIND - RFCIRC(J284) + ZOTRR(I1) = 1._RKIND - RFCIRC(J284) + ! END DO ! ZABR(NISO1EFF+1) = 0._RKIND @@ -495,11 +492,11 @@ SUBROUTINE WRTPLOT ZOJBS(1) = RJDTB0 ZOTRS(1) = 0._RKIND ZOHS(1) = FCCCC0(HMERCR(1),HMERCR(2),HMERCR(3),HMERCR(4), & - & SMISO(1),SMISO(2),SMISO(3),SMISO(4),RC0P) + & SMISO(1),SMISO(2),SMISO(3),SMISO(4),RC0P) ZODIS(1) = FCCCC0(SMERCI(1),SMERCI(2),SMERCI(3),SMERCI(4), & - & SMISO(1),SMISO(2),SMISO(3),SMISO(4),RC0P) + & SMISO(1),SMISO(2),SMISO(3),SMISO(4),RC0P) ZODRS(1) = FCCCC0(SMERCR(1),SMERCR(2),SMERCR(3),SMERCR(4), & - & SMISO(1),SMISO(2),SMISO(3),SMISO(4),RC0P) + & SMISO(1),SMISO(2),SMISO(3),SMISO(4),RC0P) ZOPPS(1) = DPDP0 ZOPS(1) = CP0 ZOTTS(1) = DTTP0 @@ -510,28 +507,28 @@ SUBROUTINE WRTPLOT ZOJBSS(1,:) = 0._RKIND ! DO J285=1,NISO1EFF - ! - ZABSM(J285+1) = SMISO(J285) - ZABS(J285) = SMISO(J285) - ZABIS(J285+1) = (J285 - .5_RKIND) / REAL(NISO1EFF-1,RKIND) - ZOHS(J285+1) = HMERCR(J285) - ZODIS(J285+1) = SMERCI(J285) - ZODRS(J285+1) = SMERCR(J285) - ZOBETS(J285) = BETAB(J285) - ZOQS(J285+1) = QPSI(J285) - ZODQS(J285+1) = CDQ(J285) - ZOSHS(J285) = CDRQ(J285) - ZOPPS(J285+1) = CPPR(J285) - ZOPS(J285+1) = CPR(J285) - ZOTTS(J285+1) = TTP(J285) - ZOTS(J285+1) = TMF(J285) - ZOIPS(J285+1) = RIPR(J285) - ZOJBS(J285+1) = RJDOTB(J285) - ZOARS(J285) = eqchease_out(index_out)%profiles_1d%rho_vol(J285) - ZOJPS(J285+1) = RJPAR(J285) - ZOJBSS(J285+1,1:4)= RJBSOS(J285,1:4) - ZOTRS(J285+1) = 1._RKIND - RFCIRC(J285) - ! + ! + ZABSM(J285+1) = SMISO(J285) + ZABS(J285) = SMISO(J285) + ZABIS(J285+1) = (J285 - .5_RKIND) / REAL(NISO1EFF-1,RKIND) + ZOHS(J285+1) = HMERCR(J285) + ZODIS(J285+1) = SMERCI(J285) + ZODRS(J285+1) = SMERCR(J285) + ZOBETS(J285) = BETAB(J285) + ZOQS(J285+1) = QPSI(J285) + ZODQS(J285+1) = CDQ(J285) + ZOSHS(J285) = CDRQ(J285) + ZOPPS(J285+1) = CPPR(J285) + ZOPS(J285+1) = CPR(J285) + ZOTTS(J285+1) = TTP(J285) + ZOTS(J285+1) = TMF(J285) + ZOIPS(J285+1) = RIPR(J285) + ZOJBS(J285+1) = RJDOTB(J285) + ZOARS(J285) = eqchease_out(index_out)%profiles_1d%rho_vol(J285) + ZOJPS(J285+1) = RJPAR(J285) + ZOJBSS(J285+1,1:4)= RJBSOS(J285,1:4) + ZOTRS(J285+1) = 1._RKIND - RFCIRC(J285) + ! END DO ! ZABIS(NISO1EFF+1) = 1._RKIND @@ -540,479 +537,471 @@ SUBROUTINE WRTPLOT ! !%OS JSCHI = NCHI / 25 + 1 JSCHI = 1 + do jj=1,nchi - write(14,'(a,i5,a,i5,a)') ' jchi = ',jj,' ipsi=1,',niso1eff,':' - write(14,'(1p2e13.5)') (cr(jj,j288),cz(jj,j288),j288=1,niso1eff) + write(14,'(a,i5,a,i5,a)') ' jchi = ',jj,' ipsi=1,',niso1eff,':' + write(14,'(1p2e13.5)') (cr(jj,j288),cz(jj,j288),j288=1,niso1eff) end do -!cgv -if (nideal.eq.0) then + ! + if (nideal.eq.0) then -! if nideal.eq.0, i.e., mapping for MARS, prepare also mappa_rz files -! i.e., R,Z(s,chi) files for plasma -! -! Note: now all quantities are already computed on both integer -! and half-integer meshes, thus there is no need for interpolation -! Note: odd elements of cr, cz correspond to cs mesh, even ones to csm! + ! if nideal.eq.0, i.e., mapping for MARS, prepare also mappa_rz files + ! i.e., R,Z(s,chi) files for plasma + ! + ! Note: now all quantities are already computed on both integer + ! and half-integer meshes, thus there is no need for interpolation + ! Note: odd elements of cr, cz correspond to cs mesh, even ones to csm! - open(114,file='mappa_rz_chicsm_mars',form='formatted') - write(114,'(a)') 'map of R,Z(chi,csm)' - write(114,'(a,i5)') 'npsi1=',npsi1 - do jp=1,npsi1 - write(114,'(1pe24.16)') csm(jp) - enddo - write(114,'(a,i5)') 'nchi=',nchi - do jj=1,nchi - write(114,'(1pe24.16)') chim(jj) - enddo - write(114,'(a)') 'cr(jchi,jp), cz(jchi,jp)' - do jp=2,niso1eff1,2 - write(114,'(a,i5)') 'jp=',jp - do j288=1,nchi - write(114,'(1p2e24.16)') cr(j288,jp),cz(j288,jp) - enddo - enddo -! add last point s=1 - jp=niso1eff1 + open(114,file='mappa_rz_chicsm_mars',form='formatted') + write(114,'(a)') 'map of R,Z(chi,csm)' + write(114,'(a,i5)') 'npsi1=',npsi1 + do jp=1,npsi1 + write(114,'(1pe24.16)') csm(jp) + enddo + write(114,'(a,i5)') 'nchi=',nchi + do jj=1,nchi + write(114,'(1pe24.16)') chim(jj) + enddo + write(114,'(a)') 'cr(jchi,jp), cz(jchi,jp)' + do jp=2,niso1eff1,2 write(114,'(a,i5)') 'jp=',jp do j288=1,nchi write(114,'(1p2e24.16)') cr(j288,jp),cz(j288,jp) enddo - write(114,'(a,1pe24.16,a,1pe24.16)') 'r0exp=',r0exp,' b0exp=',b0exp - close(114) + enddo + ! add last point s=1 + jp=niso1eff1 + write(114,'(a,i5)') 'jp=',jp + do j288=1,nchi + write(114,'(1p2e24.16)') cr(j288,jp),cz(j288,jp) + enddo + write(114,'(a,1pe24.16,a,1pe24.16)') 'r0exp=',r0exp,' b0exp=',b0exp + close(114) + + open(115,file='mappa_rz_chics_mars',form='formatted') + write(115,'(a)') 'map of R,Z(chi,cs)' + write(115,'(a,i5)') 'npsi1=',npsi1 + do jp=1,npsi1 + write(115,'(1pe24.16)') cs(jp) + enddo + write(115,'(a,i5)') 'nchi=',nchi + do jj=1,nchi + write(115,'(1pe24.16)') chim(jj) + enddo + write(115,'(a)') 'cr(jchi,jp), cz(jchi,jp)' + do jp=1,niso1eff1,2 + write(115,'(a,i5)') 'jp=',jp + do j288=1,nchi + write(115,'(1p2e24.16)') cr(j288,jp),cz(j288,jp) + enddo + enddo + write(115,'(a,1pe24.16,a,1pe24.16)') 'r0exp=',r0exp,' b0exp=',b0exp + close(115) + + ! now vacuum mappa files if vacuum mesh is computed, + ! i.e., R_vac,Z_vac(s,chi) files for vacuum - open(115,file='mappa_rz_chics_mars',form='formatted') - write(115,'(a)') 'map of R,Z(chi,cs)' - write(115,'(a,i5)') 'npsi1=',npsi1 - do jp=1,npsi1 - write(115,'(1pe24.16)') cs(jp) + if (rext.gt.1._rkind) then + open(214,file='mappa_rz_chicsmv_mars',form='formatted') + write(214,'(a)') 'map of R,Z(chi,vcsm)' + write(214,'(a,i5)') 'nv1=',nv1 + do jp=1,nv + write(214,'(1pe24.16)') csmv(jp) enddo - write(115,'(a,i5)') 'nchi=',nchi + !.....add by hand last point on half-integer mesh equal to csv(nv1) + write(214,'(1pe24.16)') csv(nv1) + write(214,'(a,i5)') 'nchi=',nchi do jj=1,nchi - write(115,'(1pe24.16)') chim(jj) + write(214,'(1pe24.16)') chim(jj) enddo - write(115,'(a)') 'cr(jchi,jp), cz(jchi,jp)' - do jp=1,niso1eff1,2 - write(115,'(a,i5)') 'jp=',jp + write(214,'(a)') 'crv(jchi,jp), czv(jchi,jp)' + do jp=1,nv + write(214,'(a,i5)') 'jp=',jp do j288=1,nchi - write(115,'(1p2e24.16)') cr(j288,jp),cz(j288,jp) + zcrv= r0w+csmv(jp)*(cr(j288,niso1eff1)-r0w) + zczv=rz0w+csmv(jp)*(cz(j288,niso1eff1)-rz0w) + write(214,'(1p2e24.16)') zcrv, zczv enddo enddo - write(115,'(a,1pe24.16,a,1pe24.16)') 'r0exp=',r0exp,' b0exp=',b0exp - close(115) - -! now vacuum mappa files if vacuum mesh is computed, -! i.e., R_vac,Z_vac(s,chi) files for vacuum - - if (rext.gt.1._rkind) then - open(214,file='mappa_rz_chicsmv_mars',form='formatted') - write(214,'(a)') 'map of R,Z(chi,vcsm)' - write(214,'(a,i5)') 'nv1=',nv1 - do jp=1,nv - write(214,'(1pe24.16)') csmv(jp) - enddo -!.....add by hand last point on half-integer mesh equal to csv(nv1) - write(214,'(1pe24.16)') csv(nv1) - write(214,'(a,i5)') 'nchi=',nchi - do jj=1,nchi - write(214,'(1pe24.16)') chim(jj) - enddo - write(214,'(a)') 'crv(jchi,jp), czv(jchi,jp)' - do jp=1,nv - write(214,'(a,i5)') 'jp=',jp - do j288=1,nchi - zcrv= r0w+csmv(jp)*(cr(j288,niso1eff1)-r0w) - zczv=rz0w+csmv(jp)*(cz(j288,niso1eff1)-rz0w) - write(214,'(1p2e24.16)') zcrv, zczv - enddo - enddo -! add last point s=1 - jp=nv1 - write(214,'(a,i5)') 'jp=',jp + ! add last point s=1 + jp=nv1 + write(214,'(a,i5)') 'jp=',jp + do j288=1,nchi + zcrv= r0w+csv(jp)*(cr(j288,niso1eff1)-r0w) + zczv=rz0w+csv(jp)*(cz(j288,niso1eff1)-rz0w) + write(214,'(1p2e24.16)') zcrv, zczv + enddo + write(214,'(a,1pe24.16,a,1pe24.16)') 'r0exp=',r0exp,' b0exp=',b0exp + close(214) + ! + open(215,file='mappa_rz_chicsv_mars',form='formatted') + write(215,'(a)') 'map of R,Z(chi,vcs)' + write(215,'(a,i5)') 'nv1=',nv1 + do jp=1,nv1 + write(215,'(1pe24.16)') csv(jp) + enddo + write(215,'(a,i5)') 'nchi=',nchi + do jj=1,nchi + write(215,'(1pe24.16)') chim(jj) + enddo + write(215,'(a)') 'crv(jchi,jp), czv(jchi,jp)' + do jp=1,nv1 + write(215,'(a,i5)') 'jp=',jp do j288=1,nchi zcrv= r0w+csv(jp)*(cr(j288,niso1eff1)-r0w) zczv=rz0w+csv(jp)*(cz(j288,niso1eff1)-rz0w) - write(214,'(1p2e24.16)') zcrv, zczv - enddo - write(214,'(a,1pe24.16,a,1pe24.16)') 'r0exp=',r0exp,' b0exp=',b0exp - close(214) -! - open(215,file='mappa_rz_chicsv_mars',form='formatted') - write(215,'(a)') 'map of R,Z(chi,vcs)' - write(215,'(a,i5)') 'nv1=',nv1 - do jp=1,nv1 - write(215,'(1pe24.16)') csv(jp) + write(215,'(1p2e24.16)') zcrv, zczv enddo - write(215,'(a,i5)') 'nchi=',nchi - do jj=1,nchi - write(215,'(1pe24.16)') chim(jj) - enddo - write(215,'(a)') 'crv(jchi,jp), czv(jchi,jp)' - do jp=1,nv1 - write(215,'(a,i5)') 'jp=',jp - do j288=1,nchi - zcrv= r0w+csv(jp)*(cr(j288,niso1eff1)-r0w) - zczv=rz0w+csv(jp)*(cz(j288,niso1eff1)-rz0w) - write(215,'(1p2e24.16)') zcrv, zczv - enddo - enddo - write(215,'(a,1pe24.16,a,1pe24.16)') 'r0exp=',r0exp,' b0exp=',b0exp - close(215) - endif -endif -!cgv 4/11/2013 -!!!!! - write(*,*) 'cgv, in wrtplot.f90:' - write(*,*) 'nrbox, nzbox:',nrbox, nzbox - write(*,*) 'spsim:',spsim - write(*,*) 'twopi:',twopi - write(*,*) 'iiRZ_chi:',iiRZ_chi - write(*,*) 'niso1eff1,nchieff:',niso1eff1,nchieff -!!!!! + enddo + write(215,'(a,1pe24.16,a,1pe24.16)') 'r0exp=',r0exp,' b0exp=',b0exp + close(215) + endif + endif - open (77,access='SEQUENTIAL',form='FORMATTED',file='mappa_s_chi_chease') + open (77,access='SEQUENTIAL',form='FORMATTED',file='mappa_s_chi_chease') - allocate(zchirz(nrbox,nzbox)) - do j=1,nzbox - do i=1,nrbox - if (eqchease_out_add_2d_rz(i,j,iiRZ_chi).lt.0._rkind) then - zchirz(i,j)=eqchease_out_add_2d_rz(i,j,iiRZ_chi)+twopi - else - zchirz(i,j)=eqchease_out_add_2d_rz(i,j,iiRZ_chi) - endif - enddo - enddo - write(77,6666) nrbox,nzbox - write(77,6666) eqchease_out(index_out)%profiles_2d(1)%grid%dim1 - write(77,6666) eqchease_out(index_out)%profiles_2d(1)%grid%dim2 - do j=1,nzbox - write(77,6666) (sqrt(abs(spsim-eqdspsi(i,j))/abs(spsim)),i=1,nrbox) - enddo - write(77,6666) - do j=1,nzbox - write(77,6666) (zchirz(i,j),i=1,nrbox) + allocate(zchirz(nrbox,nzbox)) + do j=1,nzbox + do i=1,nrbox + if (eqchease_out_add_2d_rz(i,j,iiRZ_chi).lt.0._rkind) then + zchirz(i,j)=eqchease_out_add_2d_rz(i,j,iiRZ_chi)+twopi + else + zchirz(i,j)=eqchease_out_add_2d_rz(i,j,iiRZ_chi) + endif enddo - close(77) + enddo + write(77,6666) nrbox,nzbox + write(77,6666) eqchease_out(index_out)%profiles_2d(1)%grid%dim1 + write(77,6666) eqchease_out(index_out)%profiles_2d(1)%grid%dim2 + do j=1,nzbox + write(77,6666) (sqrt(abs(spsim-eqdspsi(i,j))/abs(spsim)),i=1,nrbox) + enddo + write(77,6666) + do j=1,nzbox + write(77,6666) (zchirz(i,j),i=1,nrbox) + enddo + close(77) -! write output for python graphics -! write R(R,Z), Z(R,Z), s(R,Z), chi(R,Z) - open(unit=665,file='mappa_schi_RZ_chease_python.data',form='formatted') - do j=1,nzbox - write(665,6666) (eqchease_out(index_out)%profiles_2d(1)%grid%dim1(i),i=1,nrbox) - enddo - do j=1,nzbox - write(665,6666) (eqchease_out(index_out)%profiles_2d(1)%grid%dim2(j),i=1,nrbox) - enddo - do j=1,nzbox - write(665,6666) (sqrt(abs(spsim-eqdspsi(i,j))/abs(spsim)),i=1,nrbox) - enddo - do j=1,nzbox - write(665,6666) (zchirz(i,j),i=1,nrbox) - enddo - close(665) + ! write output for python graphics + ! write R(R,Z), Z(R,Z), s(R,Z), chi(R,Z) + open(unit=665,file='mappa_schi_RZ_chease_python.data',form='formatted') + do j=1,nzbox + write(665,6666) (eqchease_out(index_out)%profiles_2d(1)%grid%dim1(i),i=1,nrbox) + enddo + do j=1,nzbox + write(665,6666) (eqchease_out(index_out)%profiles_2d(1)%grid%dim2(j),i=1,nrbox) + enddo + do j=1,nzbox + write(665,6666) (sqrt(abs(spsim-eqdspsi(i,j))/abs(spsim)),i=1,nrbox) + enddo + do j=1,nzbox + write(665,6666) (zchirz(i,j),i=1,nrbox) + enddo + close(665) - deallocate(zchirz) + deallocate(zchirz) -! use itm quantities to derive quantities to be written in file data_input_metrica -! note: itm quantities not yet transformed to itm conventions, normalizations, etc., -! thus should be still in chease units... -! metric tensor elements compute by chease for itm are in [psi,chi] space, -! whereas mars/hymagyc require in [s,chi] space, thus transform accordingly... -! note: smisop1 is the union of cs and csm... -! a check on equidistant mesh should be inserted for GK ouputs... -! + ! use itm quantities to derive quantities to be written in file data_input_metrica + ! note: itm quantities not yet transformed to itm conventions, normalizations, etc., + ! thus should be still in chease units... + ! metric tensor elements compute by chease for itm are in [psi,chi] space, + ! whereas mars/hymagyc require in [s,chi] space, thus transform accordingly... + ! note: smisop1 is the union of cs and csm... + ! a check on equidistant mesh should be inserted for GK ouputs... + ! - open(78,form='FORMATTED',file='data_input_equil_chease') + open(78,form='FORMATTED',file='data_input_equil_chease') - write(78,*)niso1eff1,nchieff - write(78,*)rmag - write(78,*)spsim - do i=1,niso1eff1 -! write(78,*)tmf(i),ttp(i)/tmf(i)*2._rkind*smisop1(i)*abs(spsim) - write(78,*)eqchease_out(index_out)%profiles_1d%F_dia(i), & - & eqchease_out(index_out)%profiles_1d%ffprime(i)/eqchease_out(index_out)%profiles_1d%F_dia(i)*2._rkind*smisop1(i)*abs(spsim) - enddo + write(78,*)niso1eff1,nchieff + write(78,*)rmag + write(78,*)spsim + do i=1,niso1eff1 + ! write(78,*)tmf(i),ttp(i)/tmf(i)*2._rkind*smisop1(i)*abs(spsim) + write(78,*)eqchease_out(index_out)%profiles_1d%F_dia(i), & + & eqchease_out(index_out)%profiles_1d%ffprime(i)/eqchease_out(index_out)%profiles_1d%F_dia(i)*2._rkind*smisop1(i)*abs(spsim) + enddo - close(78) + close(78) - allocate(rjacobi(niso1eff1,nchieff)) - allocate(rg11u(niso1eff1,nchieff)) - allocate(rg12u(niso1eff1,nchieff)) - allocate(rg22u(niso1eff1,nchieff)) - allocate(rg33u(niso1eff1,nchieff)) - allocate(d1rjacobi(niso1eff1,nchieff)) - allocate(d1rg11u(niso1eff1,nchieff)) - allocate(d1rg12u(niso1eff1,nchieff)) - allocate(d1rg22u(niso1eff1,nchieff)) - allocate(d1rg33u(niso1eff1,nchieff)) - allocate(d2rjacobi(niso1eff1,nchieff)) - allocate(d2rg11u(niso1eff1,nchieff)) - allocate(d2rg12u(niso1eff1,nchieff)) - allocate(d2rg22u(niso1eff1,nchieff)) - allocate(d2rg33u(niso1eff1,nchieff)) - allocate(d1r(niso1eff1,nchieff)) - allocate(d1z(niso1eff1,nchieff)) - allocate(d2r(niso1eff1,nchieff)) - allocate(d2z(niso1eff1,nchieff)) + allocate(rjacobi(niso1eff1,nchieff)) + allocate(rg11u(niso1eff1,nchieff)) + allocate(rg12u(niso1eff1,nchieff)) + allocate(rg22u(niso1eff1,nchieff)) + allocate(rg33u(niso1eff1,nchieff)) + allocate(d1rjacobi(niso1eff1,nchieff)) + allocate(d1rg11u(niso1eff1,nchieff)) + allocate(d1rg12u(niso1eff1,nchieff)) + allocate(d1rg22u(niso1eff1,nchieff)) + allocate(d1rg33u(niso1eff1,nchieff)) + allocate(d2rjacobi(niso1eff1,nchieff)) + allocate(d2rg11u(niso1eff1,nchieff)) + allocate(d2rg12u(niso1eff1,nchieff)) + allocate(d2rg22u(niso1eff1,nchieff)) + allocate(d2rg33u(niso1eff1,nchieff)) + allocate(d1r(niso1eff1,nchieff)) + allocate(d1z(niso1eff1,nchieff)) + allocate(d2r(niso1eff1,nchieff)) + allocate(d2z(niso1eff1,nchieff)) - do j=1,nchieff - do i=2,niso1eff1 - rjacobi(i,j)=eqchease_out(index_out)%coord_sys%jacobian(i,j)*(2._rkind*smisop1(i)*abs(spsim)) - enddo -! set origin to zero - rjacobi(1,j)=0._rkind + do j=1,nchieff + do i=2,niso1eff1 + rjacobi(i,j)=eqchease_out(index_out)%coord_sys%jacobian(i,j)*(2._rkind*smisop1(i)*abs(spsim)) enddo - do j=1,nchieff - do i=2,niso1eff1 - rg11u(i,j)=eqchease_out(index_out)%coord_sys%g_11(i,j)/(2._rkind*smisop1(i)*abs(spsim))**2 - enddo -! now estrapolate to the origin (alternate calculation (to be written): use interpos...) - rg11u(1,j)=FCCCC0(rg11u(2,j),rg11u(3,j),rg11u(4,j),rg11u(5,j),smisop1(2),smisop1(3),smisop1(4),smisop1(5),0._rkind) + ! set origin to zero + rjacobi(1,j)=0._rkind + enddo + do j=1,nchieff + do i=2,niso1eff1 + rg11u(i,j)=eqchease_out(index_out)%coord_sys%g_11(i,j)/(2._rkind*smisop1(i)*abs(spsim))**2 enddo - do j=1,nchieff - do i=2,niso1eff1 - rg12u(i,j)=eqchease_out(index_out)%coord_sys%g_12(i,j)/(2._rkind*smisop1(i)*abs(spsim)) - enddo -! set the origin artificially to zero to avoid divergence... - rg12u(1,j)=0._rkind + ! now estrapolate to the origin (alternate calculation (to be written): use interpos...) + rg11u(1,j)=FCCCC0(rg11u(2,j),rg11u(3,j),rg11u(4,j),rg11u(5,j),smisop1(2),smisop1(3),smisop1(4),smisop1(5),0._rkind) + enddo + do j=1,nchieff + do i=2,niso1eff1 + rg12u(i,j)=eqchease_out(index_out)%coord_sys%g_12(i,j)/(2._rkind*smisop1(i)*abs(spsim)) enddo - do j=1,nchieff - do i=2,niso1eff1 - rg22u(i,j)=eqchease_out(index_out)%coord_sys%g_22(i,j) - enddo -! set the origin artificially to zero to avoid divergence... - rg22u(1,j)=0._rkind + ! set the origin artificially to zero to avoid divergence... + rg12u(1,j)=0._rkind + enddo + do j=1,nchieff + do i=2,niso1eff1 + rg22u(i,j)=eqchease_out(index_out)%coord_sys%g_22(i,j) enddo - do j=1,nchieff - do i=2,niso1eff1 - rg33u(i,j)=eqchease_out(index_out)%coord_sys%g_33(i,j) - enddo -! set the origin equal to 1/Rmag**2 - rg33u(1,j)=1._rkind/rmag**2 + ! set the origin artificially to zero to avoid divergence... + rg22u(1,j)=0._rkind + enddo + do j=1,nchieff + do i=2,niso1eff1 + rg33u(i,j)=eqchease_out(index_out)%coord_sys%g_33(i,j) enddo + ! set the origin equal to 1/Rmag**2 + rg33u(1,j)=1._rkind/rmag**2 + enddo -! now compute derivative with respect to first coordinate (cs) -! use interpos in a way similar to O. Sauter package -! .../numerical_tools/branches/equil_metric_derivatives/ + ! now compute derivative with respect to first coordinate (cs) + ! use interpos in a way similar to O. Sauter package + ! .../numerical_tools/branches/equil_metric_derivatives/ - tens_def=-0.1_rkind - tens_def2=-3.0_rkind + tens_def=-0.1_rkind + tens_def2=-3.0_rkind - do j=1,nchieff - call interpos(smisop1(1:niso1eff1),rjacobi(1:niso1eff1,j),niso1eff1,tension=tens_def, & - & youtp=d1rjacobi(1:niso1eff1,j),nbc=(/2,2/),ybc=(/rjacobi(1,j), rjacobi(niso1eff1,j)/)) - call interpos(smisop1(1:niso1eff1),rg11u(1:niso1eff1,j),niso1eff1,tension=tens_def, & - & youtp=d1rg11u(1:niso1eff1,j),nbc=(/2,2/),ybc=(/rg11u(1,j), rg11u(niso1eff1,j)/)) -! assume rg12u=rg12utild/s to construct derivative better close to axis - call interpos(smisop1(2:niso1eff1),rg12u(2:niso1eff1,j)*smisop1(2:niso1eff1), & - & nin=niso1eff1-1, tension=tens_def2, youtp=d1rg12u(2:niso1eff1,j), nbc=(/2,2/), & - & ybc=(/rg12u(2,j)*smisop1(2), rg12u(niso1eff1,j)*smisop1(niso1eff1)/)) - d1rg12u(2:niso1eff1,j)=d1rg12u(2:niso1eff1,j)/smisop1(2:niso1eff1)-rg12u(2:niso1eff1,j)/smisop1(2:niso1eff1) -! what follows is the way O. Sauter uses for d1rg22u, but -! d1rg12u(i,j), for fixed j, has not defined sign, thus, log function does not work for extrapolation; -! call interpos(smisop1(2:niso1eff1),log(sign(1._rkind,d1rg12u(2,j))*d1rg12u(2:niso1eff1,j)), & -! & N=niso1eff1-1,xscal=smisop1(1),yscal=d1rg12u(1,j),tension=tens_def2,nbcscal=(/2,2/), & -! & ybcscal=(/log(sign(1._rkind,d1rg12u(2,j))*d1rg12u(2,j)), log(sign(1._rkind,d1rg12u(2,j))*d1rg12u(niso1eff1,j))/)) -! d1rg12u(1,j) = sign(1._rkind,d1rg12u(2,j))*exp(d1rg12u(1,j)) -! instead, set d1rg12u(1,j)=0._rkind - d1rg12u(1,j)=0._rkind -! assume rg22u=rg22utild/s**2 to construct derivative better close to axis - call interpos(smisop1(2:niso1eff1),rg22u(2:niso1eff1,j)*smisop1(2:niso1eff1)**2, & - & nin=niso1eff1-1, tension=tens_def, youtp=d1rg22u(2:niso1eff1,j), nbc=(/2,2/), & - & ybc=(/rg22u(2,j)*smisop1(2)**2, rg22u(niso1eff1,j)*smisop1(niso1eff1)**2/)) - d1rg22u(2:niso1eff1,j)=d1rg22u(2:niso1eff1,j)/smisop1(2:niso1eff1)**2-2._rkind*rg22u(2:niso1eff1,j)/smisop1(2:niso1eff1) -! what follows is the way O. Sauter uses for d1rg22u: -! call interpos(smisop1(2:niso1eff1),log(sign(1._rkind,d1rg22u(2,j))*d1rg22u(2:niso1eff1,j)), & -! & N=niso1eff1-1,xscal=smisop1(1),yscal=d1rg22u(1,j),tension=tens_def,nbcscal=(/2,2/), & -! & ybcscal=(/log(sign(1._rkind,d1rg22u(2,j))*d1rg22u(2,j)), log(sign(1._rkind,d1rg22u(2,j))*d1rg22u(niso1eff1,j))/)) -! d1rg22u(1,j) = sign(1._rkind,d1rg22u(2,j))*exp(d1rg22u(1,j)) -! instead, set d1rg22u(1,j)=0._rkind - d1rg22u(1,j)=0._rkind - call interpos(smisop1(1:niso1eff1),rg33u(1:niso1eff1,j),niso1eff1,tension=tens_def, & - & youtp=d1rg33u(1:niso1eff1,j),nbc=(/2,2/),ybc=(/rg33u(1,j), rg33u(niso1eff1,j)/)) - call interpos(smisop1(1:niso1eff1),eqchease_out(index_out)%coord_sys%position%R(1:niso1eff1,j),niso1eff1,tension=tens_def, & - & youtp=d1r(1:niso1eff1,j),nbc=(/2,2/),ybc=(/eqchease_out(index_out)%coord_sys%position%R(1,j), eqchease_out(index_out)%coord_sys%position%R(niso1eff1,j)/)) - call interpos(smisop1(1:niso1eff1),eqchease_out(index_out)%coord_sys%position%Z(1:niso1eff1,j),niso1eff1,tension=tens_def, & - & youtp=d1z(1:niso1eff1,j),nbc=(/2,2/),ybc=(/eqchease_out(index_out)%coord_sys%position%Z(1,j), eqchease_out(index_out)%coord_sys%position%Z(niso1eff1,j)/)) - enddo + do j=1,nchieff + call interpos(smisop1(1:niso1eff1),rjacobi(1:niso1eff1,j),niso1eff1,tension=tens_def, & + & youtp=d1rjacobi(1:niso1eff1,j),nbc=(/2,2/),ybc=(/rjacobi(1,j), rjacobi(niso1eff1,j)/)) + call interpos(smisop1(1:niso1eff1),rg11u(1:niso1eff1,j),niso1eff1,tension=tens_def, & + & youtp=d1rg11u(1:niso1eff1,j),nbc=(/2,2/),ybc=(/rg11u(1,j), rg11u(niso1eff1,j)/)) + ! assume rg12u=rg12utild/s to construct derivative better close to axis + call interpos(smisop1(2:niso1eff1),rg12u(2:niso1eff1,j)*smisop1(2:niso1eff1), & + & nin=niso1eff1-1, tension=tens_def2, youtp=d1rg12u(2:niso1eff1,j), nbc=(/2,2/), & + & ybc=(/rg12u(2,j)*smisop1(2), rg12u(niso1eff1,j)*smisop1(niso1eff1)/)) + d1rg12u(2:niso1eff1,j)=d1rg12u(2:niso1eff1,j)/smisop1(2:niso1eff1)-rg12u(2:niso1eff1,j)/smisop1(2:niso1eff1) + ! what follows is the way O. Sauter uses for d1rg22u, but + ! d1rg12u(i,j), for fixed j, has not defined sign, thus, log function does not work for extrapolation; + ! call interpos(smisop1(2:niso1eff1),log(sign(1._rkind,d1rg12u(2,j))*d1rg12u(2:niso1eff1,j)), & + ! & N=niso1eff1-1,xscal=smisop1(1),yscal=d1rg12u(1,j),tension=tens_def2,nbcscal=(/2,2/), & + ! & ybcscal=(/log(sign(1._rkind,d1rg12u(2,j))*d1rg12u(2,j)), log(sign(1._rkind,d1rg12u(2,j))*d1rg12u(niso1eff1,j))/)) + ! d1rg12u(1,j) = sign(1._rkind,d1rg12u(2,j))*exp(d1rg12u(1,j)) + ! instead, set d1rg12u(1,j)=0._rkind + d1rg12u(1,j)=0._rkind + ! assume rg22u=rg22utild/s**2 to construct derivative better close to axis + call interpos(smisop1(2:niso1eff1),rg22u(2:niso1eff1,j)*smisop1(2:niso1eff1)**2, & + & nin=niso1eff1-1, tension=tens_def, youtp=d1rg22u(2:niso1eff1,j), nbc=(/2,2/), & + & ybc=(/rg22u(2,j)*smisop1(2)**2, rg22u(niso1eff1,j)*smisop1(niso1eff1)**2/)) + d1rg22u(2:niso1eff1,j)=d1rg22u(2:niso1eff1,j)/smisop1(2:niso1eff1)**2-2._rkind*rg22u(2:niso1eff1,j)/smisop1(2:niso1eff1) + ! what follows is the way O. Sauter uses for d1rg22u: + ! call interpos(smisop1(2:niso1eff1),log(sign(1._rkind,d1rg22u(2,j))*d1rg22u(2:niso1eff1,j)), & + ! & N=niso1eff1-1,xscal=smisop1(1),yscal=d1rg22u(1,j),tension=tens_def,nbcscal=(/2,2/), & + ! & ybcscal=(/log(sign(1._rkind,d1rg22u(2,j))*d1rg22u(2,j)), log(sign(1._rkind,d1rg22u(2,j))*d1rg22u(niso1eff1,j))/)) + ! d1rg22u(1,j) = sign(1._rkind,d1rg22u(2,j))*exp(d1rg22u(1,j)) + ! instead, set d1rg22u(1,j)=0._rkind + d1rg22u(1,j)=0._rkind + call interpos(smisop1(1:niso1eff1),rg33u(1:niso1eff1,j),niso1eff1,tension=tens_def, & + & youtp=d1rg33u(1:niso1eff1,j),nbc=(/2,2/),ybc=(/rg33u(1,j), rg33u(niso1eff1,j)/)) + call interpos(smisop1(1:niso1eff1),eqchease_out(index_out)%coord_sys%position%R(1:niso1eff1,j),niso1eff1,tension=tens_def, & + & youtp=d1r(1:niso1eff1,j),nbc=(/2,2/),ybc=(/eqchease_out(index_out)%coord_sys%position%R(1,j), eqchease_out(index_out)%coord_sys%position%R(niso1eff1,j)/)) + call interpos(smisop1(1:niso1eff1),eqchease_out(index_out)%coord_sys%position%Z(1:niso1eff1,j),niso1eff1,tension=tens_def, & + & youtp=d1z(1:niso1eff1,j),nbc=(/2,2/),ybc=(/eqchease_out(index_out)%coord_sys%position%Z(1,j), eqchease_out(index_out)%coord_sys%position%Z(niso1eff1,j)/)) + enddo -! now compute derivative with respect to second coordinate (chi) + ! now compute derivative with respect to second coordinate (chi) - do i=1,niso1eff1 - call interpos(chim(1:nchieff),rjacobi(i,1:nchieff),nchieff,tension=tens_def, & - & youtp=d2rjacobi(i,1:nchieff),nbc=-1,ybc=twopi) - call interpos(chim(1:nchieff),rg11u(i,1:nchieff),nchieff,tension=tens_def, & - & youtp=d2rg11u(i,1:nchieff),nbc=-1,ybc=twopi) - call interpos(chim(1:nchieff),rg12u(i,1:nchieff),nchieff,tension=tens_def, & - & youtp=d2rg12u(i,1:nchieff),nbc=-1,ybc=twopi) - call interpos(chim(1:nchieff),rg22u(i,1:nchieff),nchieff,tension=tens_def, & - & youtp=d2rg22u(i,1:nchieff),nbc=-1,ybc=twopi) - call interpos(chim(1:nchieff),rg33u(i,1:nchieff),nchieff,tension=tens_def, & - & youtp=d2rg33u(i,1:nchieff),nbc=-1,ybc=twopi) - call interpos(chim(1:nchieff),eqchease_out(index_out)%coord_sys%position%R(i,1:nchieff),nchieff,tension=tens_def, & - & youtp=d2r(i,1:nchieff),nbc=-1,ybc=twopi) - call interpos(chim(1:nchieff),eqchease_out(index_out)%coord_sys%position%Z(i,1:nchieff),nchieff,tension=tens_def, & - & youtp=d2z(i,1:nchieff),nbc=-1,ybc=twopi) - enddo + do i=1,niso1eff1 + call interpos(chim(1:nchieff),rjacobi(i,1:nchieff),nchieff,tension=tens_def, & + & youtp=d2rjacobi(i,1:nchieff),nbc=-1,ybc=twopi) + call interpos(chim(1:nchieff),rg11u(i,1:nchieff),nchieff,tension=tens_def, & + & youtp=d2rg11u(i,1:nchieff),nbc=-1,ybc=twopi) + call interpos(chim(1:nchieff),rg12u(i,1:nchieff),nchieff,tension=tens_def, & + & youtp=d2rg12u(i,1:nchieff),nbc=-1,ybc=twopi) + call interpos(chim(1:nchieff),rg22u(i,1:nchieff),nchieff,tension=tens_def, & + & youtp=d2rg22u(i,1:nchieff),nbc=-1,ybc=twopi) + call interpos(chim(1:nchieff),rg33u(i,1:nchieff),nchieff,tension=tens_def, & + & youtp=d2rg33u(i,1:nchieff),nbc=-1,ybc=twopi) + call interpos(chim(1:nchieff),eqchease_out(index_out)%coord_sys%position%R(i,1:nchieff),nchieff,tension=tens_def, & + & youtp=d2r(i,1:nchieff),nbc=-1,ybc=twopi) + call interpos(chim(1:nchieff),eqchease_out(index_out)%coord_sys%position%Z(i,1:nchieff),nchieff,tension=tens_def, & + & youtp=d2z(i,1:nchieff),nbc=-1,ybc=twopi) + enddo - open(80,form='FORMATTED',file='data_input_metrica_chease') + open(80,form='FORMATTED',file='data_input_metrica_chease') - write(80,6666) niso1eff1,nchieff - write(80,6666) rraxis,rzaxis -! write(80,6666) (cs(i),i=1,niso1eff1) - write(80,6666) (smisop1(i),i=1,niso1eff1) - write(80,6666) (chim(i),i=1,nchieff) - write(80,6666) ((eqchease_out(index_out)%coord_sys%position%R(i,j),i=1,niso1eff1),j=1,nchieff) - write(80,6666) ((eqchease_out(index_out)%coord_sys%position%Z(i,j),i=1,niso1eff1),j=1,nchieff) -! - ztext='rg11u' - write(80,6666)ztext,((rg11u(i,j),i=1,niso1eff1),j=1,nchieff) - ztext='rg12u' - write(80,6666)ztext,((rg12u(i,j),i=1,niso1eff1),j=1,nchieff) - ztext='rg22u' - write(80,6666)ztext,((rg22u(i,j),i=1,niso1eff1),j=1,nchieff) - ztext='rg33u' - write(80,6666)ztext,((rg33u(i,j),i=1,niso1eff1),j=1,nchieff) -! - ztext='d1g11u' - write(80,6666)ztext,((d1rg11u(i,j),i=1,niso1eff1),j=1,nchieff) - ztext='d1g12u' - write(80,6666)ztext,((d1rg12u(i,j),i=1,niso1eff1),j=1,nchieff) - ztext='d1g22u' - write(80,6666)ztext,((d1rg22u(i,j),i=1,niso1eff1),j=1,nchieff) - ztext='d1g33u' - write(80,6666)ztext,((d1rg33u(i,j),i=1,niso1eff1),j=1,nchieff) - ztext='d2g11u' - write(80,6666)ztext,((d2rg11u(i,j),i=1,niso1eff1),j=1,nchieff) - ztext='d2g12u' - write(80,6666)ztext,((d2rg12u(i,j),i=1,niso1eff1),j=1,nchieff) - ztext='d2g22u' - write(80,6666)ztext,((d2rg22u(i,j),i=1,niso1eff1),j=1,nchieff) - ztext='d2g33u' - write(80,6666)ztext,((d2rg33u(i,j),i=1,niso1eff1),j=1,nchieff) - ztext='d1r' - write(80,6666)ztext,((d1r(i,j),i=1,niso1eff1),j=1,nchieff) - ztext='d2r' - write(80,6666)ztext,((d2r(i,j),i=1,niso1eff1),j=1,nchieff) - ztext='d1z' - write(80,6666)ztext,((d1z(i,j),i=1,niso1eff1),j=1,nchieff) - ztext='d2z' - write(80,6666)ztext,((d2z(i,j),i=1,niso1eff1),j=1,nchieff) -! - ztext='rjacobi' - write(80,6666)ztext,((rjacobi(i,j),i=1,niso1eff1),j=1,nchieff) - ztext='d1rjacobi' - write(80,6666)ztext,((d1rjacobi(i,j),i=1,niso1eff1),j=1,nchieff) - ztext='d2rjacobi' - write(80,6666)ztext,((d2rjacobi(i,j),i=1,niso1eff1),j=1,nchieff) - ztext='g-psi-chi' - write(80,6666)ztext,((eqchease_out(index_out)%coord_sys%g_12(i,j),i=1,niso1eff1),j=1,nchieff) + write(80,6666) niso1eff1,nchieff + write(80,6666) rraxis,rzaxis + ! write(80,6666) (cs(i),i=1,niso1eff1) + write(80,6666) (smisop1(i),i=1,niso1eff1) + write(80,6666) (chim(i),i=1,nchieff) + write(80,6666) ((eqchease_out(index_out)%coord_sys%position%R(i,j),i=1,niso1eff1),j=1,nchieff) + write(80,6666) ((eqchease_out(index_out)%coord_sys%position%Z(i,j),i=1,niso1eff1),j=1,nchieff) + ! + ztext='rg11u' + write(80,6666)ztext,((rg11u(i,j),i=1,niso1eff1),j=1,nchieff) + ztext='rg12u' + write(80,6666)ztext,((rg12u(i,j),i=1,niso1eff1),j=1,nchieff) + ztext='rg22u' + write(80,6666)ztext,((rg22u(i,j),i=1,niso1eff1),j=1,nchieff) + ztext='rg33u' + write(80,6666)ztext,((rg33u(i,j),i=1,niso1eff1),j=1,nchieff) + ! + ztext='d1g11u' + write(80,6666)ztext,((d1rg11u(i,j),i=1,niso1eff1),j=1,nchieff) + ztext='d1g12u' + write(80,6666)ztext,((d1rg12u(i,j),i=1,niso1eff1),j=1,nchieff) + ztext='d1g22u' + write(80,6666)ztext,((d1rg22u(i,j),i=1,niso1eff1),j=1,nchieff) + ztext='d1g33u' + write(80,6666)ztext,((d1rg33u(i,j),i=1,niso1eff1),j=1,nchieff) + ztext='d2g11u' + write(80,6666)ztext,((d2rg11u(i,j),i=1,niso1eff1),j=1,nchieff) + ztext='d2g12u' + write(80,6666)ztext,((d2rg12u(i,j),i=1,niso1eff1),j=1,nchieff) + ztext='d2g22u' + write(80,6666)ztext,((d2rg22u(i,j),i=1,niso1eff1),j=1,nchieff) + ztext='d2g33u' + write(80,6666)ztext,((d2rg33u(i,j),i=1,niso1eff1),j=1,nchieff) + ztext='d1r' + write(80,6666)ztext,((d1r(i,j),i=1,niso1eff1),j=1,nchieff) + ztext='d2r' + write(80,6666)ztext,((d2r(i,j),i=1,niso1eff1),j=1,nchieff) + ztext='d1z' + write(80,6666)ztext,((d1z(i,j),i=1,niso1eff1),j=1,nchieff) + ztext='d2z' + write(80,6666)ztext,((d2z(i,j),i=1,niso1eff1),j=1,nchieff) + ! + ztext='rjacobi' + write(80,6666)ztext,((rjacobi(i,j),i=1,niso1eff1),j=1,nchieff) + ztext='d1rjacobi' + write(80,6666)ztext,((d1rjacobi(i,j),i=1,niso1eff1),j=1,nchieff) + ztext='d2rjacobi' + write(80,6666)ztext,((d2rjacobi(i,j),i=1,niso1eff1),j=1,nchieff) + ztext='g-psi-chi' + write(80,6666)ztext,((eqchease_out(index_out)%coord_sys%g_12(i,j),i=1,niso1eff1),j=1,nchieff) - close(80) + close(80) -! write also output for python graphics in unit 666 -! write R(s,chi), Z(s,chi), g11u(s,chi),... + ! write also output for python graphics in unit 666 + ! write R(s,chi), Z(s,chi), g11u(s,chi),... - open(unit=666,file='RZmetric_chease_python.data',form='formatted') + open(unit=666,file='RZmetric_chease_python.data',form='formatted') - write(666,6666) (smisop1(i),i=1,niso1eff1) - do j=1,nchieff - write(666,6666) (eqchease_out(index_out)%coord_sys%position%R(i,j),i=1,niso1eff1) - enddo - do j=1,nchieff - write(666,6666) (eqchease_out(index_out)%coord_sys%position%Z(i,j),i=1,niso1eff1) - enddo - do j=1,nchieff - write(666,6666) (rg11u(i,j),i=1,niso1eff1) - enddo - do j=1,nchieff - write(666,6666) (rg12u(i,j),i=1,niso1eff1) - enddo - do j=1,nchieff - write(666,6666) (rg22u(i,j),i=1,niso1eff1) - enddo - do j=1,nchieff - write(666,6666) (rg33u(i,j),i=1,niso1eff1) - enddo - do j=1,nchieff - write(666,6666) (d1rg11u(i,j),i=1,niso1eff1) - enddo - do j=1,nchieff - write(666,6666) (d1rg12u(i,j),i=1,niso1eff1) - enddo - do j=1,nchieff - write(666,6666) (d1rg22u(i,j),i=1,niso1eff1) - enddo - do j=1,nchieff - write(666,6666) (d1rg33u(i,j),i=1,niso1eff1) - enddo - do j=1,nchieff - write(666,6666) (d2rg11u(i,j),i=1,niso1eff1) - enddo - do j=1,nchieff - write(666,6666) (d2rg12u(i,j),i=1,niso1eff1) - enddo - do j=1,nchieff - write(666,6666) (d2rg22u(i,j),i=1,niso1eff1) - enddo - do j=1,nchieff - write(666,6666) (d2rg33u(i,j),i=1,niso1eff1) - enddo - do j=1,nchieff - write(666,6666) (d1r(i,j),i=1,niso1eff1) - enddo - do j=1,nchieff - write(666,6666) (d1z(i,j),i=1,niso1eff1) - enddo - do j=1,nchieff - write(666,6666) (d2r(i,j),i=1,niso1eff1) - enddo - do j=1,nchieff - write(666,6666) (d2z(i,j),i=1,niso1eff1) - enddo - do j=1,nchieff - write(666,6666) (rjacobi(i,j),i=1,niso1eff1) - enddo - do j=1,nchieff - write(666,6666) (d1rjacobi(i,j),i=1,niso1eff1) - enddo - do j=1,nchieff - write(666,6666) (d2rjacobi(i,j),i=1,niso1eff1) - enddo - do j=1,nchieff - write(666,6666)(eqchease_out(index_out)%coord_sys%g_12(i,j),i=1,niso1eff1) - enddo + write(666,6666) (smisop1(i),i=1,niso1eff1) + do j=1,nchieff + write(666,6666) (eqchease_out(index_out)%coord_sys%position%R(i,j),i=1,niso1eff1) + enddo + do j=1,nchieff + write(666,6666) (eqchease_out(index_out)%coord_sys%position%Z(i,j),i=1,niso1eff1) + enddo + do j=1,nchieff + write(666,6666) (rg11u(i,j),i=1,niso1eff1) + enddo + do j=1,nchieff + write(666,6666) (rg12u(i,j),i=1,niso1eff1) + enddo + do j=1,nchieff + write(666,6666) (rg22u(i,j),i=1,niso1eff1) + enddo + do j=1,nchieff + write(666,6666) (rg33u(i,j),i=1,niso1eff1) + enddo + do j=1,nchieff + write(666,6666) (d1rg11u(i,j),i=1,niso1eff1) + enddo + do j=1,nchieff + write(666,6666) (d1rg12u(i,j),i=1,niso1eff1) + enddo + do j=1,nchieff + write(666,6666) (d1rg22u(i,j),i=1,niso1eff1) + enddo + do j=1,nchieff + write(666,6666) (d1rg33u(i,j),i=1,niso1eff1) + enddo + do j=1,nchieff + write(666,6666) (d2rg11u(i,j),i=1,niso1eff1) + enddo + do j=1,nchieff + write(666,6666) (d2rg12u(i,j),i=1,niso1eff1) + enddo + do j=1,nchieff + write(666,6666) (d2rg22u(i,j),i=1,niso1eff1) + enddo + do j=1,nchieff + write(666,6666) (d2rg33u(i,j),i=1,niso1eff1) + enddo + do j=1,nchieff + write(666,6666) (d1r(i,j),i=1,niso1eff1) + enddo + do j=1,nchieff + write(666,6666) (d1z(i,j),i=1,niso1eff1) + enddo + do j=1,nchieff + write(666,6666) (d2r(i,j),i=1,niso1eff1) + enddo + do j=1,nchieff + write(666,6666) (d2z(i,j),i=1,niso1eff1) + enddo + do j=1,nchieff + write(666,6666) (rjacobi(i,j),i=1,niso1eff1) + enddo + do j=1,nchieff + write(666,6666) (d1rjacobi(i,j),i=1,niso1eff1) + enddo + do j=1,nchieff + write(666,6666) (d2rjacobi(i,j),i=1,niso1eff1) + enddo + do j=1,nchieff + write(666,6666)(eqchease_out(index_out)%coord_sys%g_12(i,j),i=1,niso1eff1) + enddo - close(666) + close(666) - deallocate(rjacobi) - deallocate(rg11u) - deallocate(rg12u) - deallocate(rg22u) - deallocate(rg33u) - deallocate(d1rjacobi) - deallocate(d1rg11u) - deallocate(d1rg12u) - deallocate(d1rg22u) - deallocate(d1rg33u) - deallocate(d2rjacobi) - deallocate(d2rg11u) - deallocate(d2rg12u) - deallocate(d2rg22u) - deallocate(d2rg33u) - deallocate(d1r) - deallocate(d1z) - deallocate(d2r) - deallocate(d2z) + deallocate(rjacobi) + deallocate(rg11u) + deallocate(rg12u) + deallocate(rg22u) + deallocate(rg33u) + deallocate(d1rjacobi) + deallocate(d1rg11u) + deallocate(d1rg12u) + deallocate(d1rg22u) + deallocate(d1rg33u) + deallocate(d2rjacobi) + deallocate(d2rg11u) + deallocate(d2rg12u) + deallocate(d2rg22u) + deallocate(d2rg33u) + deallocate(d1r) + deallocate(d1z) + deallocate(d2r) + deallocate(d2z) -!6666 format(1000e14.5) -! use new format construct: * means unlimit repetition -! of the block (" ",g0), g0 is a suitable format for the -! variable to be written, without any further indication... - 6666 format(*(" ",g0)) + !6666 format(1000e14.5) + ! use new format construct: * means unlimit repetition + ! of the block (" ",g0), g0 is a suitable format for the + ! variable to be written, without any further indication... +6666 format(*(" ",g0)) -! write Rgeo(s)-Rgeo(s=1): for circular cross sections, -! this corresponds to the Shafranov shift + ! write Rgeo(s)-Rgeo(s=1): for circular cross sections, + ! this corresponds to the Shafranov shift open(250,file='shafranov_shift.data',form='formatted') rewind(250) write(250,6666) niso1eff1,nchieff @@ -1028,20 +1017,19 @@ endif write(250,6666) eqchease_out_add_1d(1,iirgeo)-eqchease_out_add_1d(i,iirgeo), eqchease_out(index_out)%profiles_1d%q(i) enddo close(250) -!cgv ! DO J288=1,NISO1EFF - ! - JNB = 0 - ! - DO J287=1,NCHI,JSCHI - ! - JNB = JNB + 1 - ZRCHI(JNB,J288) = CR(J287,J288) - R0 - ZZCHI(JNB,J288) = CZ(J287,J288) - RZ0 - ! - END DO + ! + JNB = 0 + ! + DO J287=1,NCHI,JSCHI + ! + JNB = JNB + 1 + ZRCHI(JNB,J288) = CR(J287,J288) - R0 + ZZCHI(JNB,J288) = CZ(J287,J288) - RZ0 + ! + END DO END DO ! INBCHI = JNB @@ -1049,45 +1037,45 @@ endif ! BALLOONING AND MERCIER ! DO J289=1,NISO1EFF - ! - IMERCI(J289) = 0 - IMERCR(J289) = 0 - IBALL(J289) = 0 - ! - IF (SMERCI(J289) .LT. RC0P) IMERCI(J289) = 1 - IF (SMERCR(J289) .LT. RC0P) IMERCR(J289) = 1 - IF (NCBAL(J289) .NE. 0) IBALL(J289) = 1 - ! + ! + IMERCI(J289) = 0 + IMERCR(J289) = 0 + IBALL(J289) = 0 + ! + IF (SMERCI(J289) .LT. RC0P) IMERCI(J289) = 1 + IF (SMERCR(J289) .LT. RC0P) IMERCR(J289) = 1 + IF (NCBAL(J289) .NE. 0) IBALL(J289) = 1 + ! END DO ! DO J293=1,NCURV - ! - ZRCURV(J293) = RRCURV(J293) - R0 - ZZCURV(J293) = RZCURV(J293) - RZ0 - ! + ! + ZRCURV(J293) = RRCURV(J293) - R0 + ZZCURV(J293) = RZCURV(J293) - RZ0 + ! END DO ! ZCSIPR(1) = 0._RKIND ZABIPR(NISO+1) = 1._RKIND ! DO J294=1,NISO - ! - ZABIPR(J294) = REAL(J294-1,RKIND) / REAL(NISO,RKIND) - ZCSIPR(J294+1) = CSIPR(J294) - ! + ! + ZABIPR(J294) = REAL(J294-1,RKIND) / REAL(NISO,RKIND) + ZCSIPR(J294+1) = CSIPR(J294) + ! END DO ! DO J295=1,NCHI1 - ! - ZABIC(J295) = REAL(J295-1,RKIND) / REAL(NCHI,RKIND) - ZCHI(J295) = CHI(J295) - CHI(1) - ! + ! + ZABIC(J295) = REAL(J295-1,RKIND) / REAL(NCHI,RKIND) + ZCHI(J295) = CHI(J295) - CHI(1) + ! END DO ! DO J296=1,NS1 - ! - ZABISG(J296) = REAL(J296-1,RKIND) / REAL(NS,RKIND) - ! + ! + ZABISG(J296) = REAL(J296-1,RKIND) / REAL(NS,RKIND) + ! END DO ! INSUR = 6 * NT @@ -1099,13 +1087,13 @@ endif ! ! WRITE(NUPLO,1003) INSUR,NCHI,NCHI1,NISO1EFF-1,NISO1EFF,NS,NS1,NT,NT1, & - & INS,INR,INBCHI,INTEXT,NCURV,NMESHA,NMESHB, & - & NMESHC,NMESHD,NMESHE,NPOIDA,NPOIDB, & - & NPOIDC,NPOIDD,NPOIDE,NISO,NMGAUS + & INS,INR,INBCHI,INTEXT,NCURV,NMESHA,NMESHB, & + & NMESHC,NMESHD,NMESHE,NPOIDA,NPOIDB, & + & NPOIDC,NPOIDD,NPOIDE,NISO,NMGAUS DO J297=1,INTEXT - ! - WRITE(NUPLO,1005) TEXT(J297) - ! + ! + WRITE(NUPLO,1005) TEXT(J297) + ! END DO ! WRITE(NUPLO,1004)(IBALL(J),J=1,NISO1EFF) @@ -1113,7 +1101,7 @@ endif WRITE(NUPLO,1004)(IMERCR(J),J=1,NISO1EFF) ! WRITE(NUPLO,1006) SOLPDA,SOLPDB,SOLPDC,SOLPDD,SOLPDE, & - & ZRMAX,ZRMIN,ZZMAX,ZZMIN,PANGLE + & ZRMAX,ZRMIN,ZZMAX,ZZMIN,PANGLE WRITE(NUPLO,1006)(APLACE(J),J=1,10) WRITE(NUPLO,1006)(AWIDTH(J),J=1,10) WRITE(NUPLO,1006)(BPLACE(J),J=1,10) @@ -1143,11 +1131,11 @@ endif WRITE(NUPLO,1006)(ZABSM(J),J=1,INS) WRITE(NUPLO,1006)(ZABR (J),J=1,INR) !%OS - WRITE(21,*) INS,' = INS; SMISO(J),J=1,INS MESH, TO HAVE R(S)', & - & ' CORRESPONDANCE' - WRITE(21,1006) (ZABSM (J),J=1,INS) - WRITE(21,*) INR,' = INR; R(J),J=1,INR MESH OF SMISO AT Z=ZMAG' - WRITE(21,1006) (ZABR (J),J=1,INR) +!!$ WRITE(21,*) INS,' = INS; SMISO(J),J=1,INS MESH, TO HAVE R(S)', & +!!$ & ' CORRESPONDANCE' +!!$ WRITE(21,1006) (ZABSM (J),J=1,INS) +!!$ WRITE(21,*) INR,' = INR; R(J),J=1,INR MESH OF SMISO AT Z=ZMAG' +!!$ WRITE(21,1006) (ZABR (J),J=1,INR) !%OS WRITE(NUPLO,1006)(ZOQS (J),J=1,INS) WRITE(NUPLO,1006)(ZOQR (J),J=1,INR) @@ -1204,10 +1192,10 @@ endif CZ(:,:)=CZ(:,:) - RZ0 ! DO J301=1,NISO1EFF - ! - WRITE(NUPLO,1006)(RRISO(I,J301),I=1,NMGAUS*NT1) - WRITE(NUPLO,1006)(RZISO(I,J301),I=1,NMGAUS*NT1) - ! + ! + WRITE(NUPLO,1006)(RRISO(I,J301),I=1,NMGAUS*NT1) + WRITE(NUPLO,1006)(RZISO(I,J301),I=1,NMGAUS*NT1) + ! END DO ! WRITE(NUPLO,1006)(ZRCURV(J),J=1,NCURV) diff --git a/src-f90/xtinit.f90 b/src-f90/xtinit.f90 index e47378ed5650f7bacf0baa18476aa004362ac46c..a960a941d0c80b443320400906f31d96b7215a12 100644 --- a/src-f90/xtinit.f90 +++ b/src-f90/xtinit.f90 @@ -116,7 +116,9 @@ SUBROUTINE XTINIT(NPMAX,PSMISO) read(ifile,999) (zdummy(l),l=1,npmax+3) ! do jpop=1,npopulations - read(ifile,999) (n_particle(l,jpop),l=1,npmax+3) + read(ifile,999) (zdummy(l),l=1,npmax+3) + ! shift n_particle from 1 (s=h/2) to npmax (s=1) + n_particle(1:npmax,jpop)=zdummy(3:npmax+2) read(ifile,999) (zdummy(l),l=1,npmax+3) enddo ! @@ -169,9 +171,6 @@ SUBROUTINE XTINIT(NPMAX,PSMISO) ! Attention: ! chease arrays start with s(1)=h/2 ---> s(npmax)=1. , i.e. npmax gridpoints - ! in xtor, this corresponds to rmesh(2)=h/2 ---> rmesh(npmax+1)=1. - ! - ! Therefore, kpsi index in n_particle(kpsi+1,jpop) is shifted by +1 ! DO KPSI=1,NPMAX ! @@ -320,7 +319,7 @@ SUBROUTINE XTINIT(NPMAX,PSMISO) ! DO J=1,NT1 ! - RHOMAP(J) = n_particle(kpsi+1,jpop)*ZJAC(J) + RHOMAP(J) = n_particle(kpsi,jpop)*ZJAC(J) ! END DO RHOMAP(NT2) = RHOMAP(1)