Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions src/convert/b2co_movies_cdf.F
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ subroutine b2co_movies_cdf(nx, ny, ns, natm, nmol, ntri, tim)
integer, save :: write_b25_state_variables = 1
integer, save :: write_b25_fluxes = 0
integer, save :: write_b25_sources = 0
integer, save :: write_b25_transport = 0
integer, save :: write_eirene_state_variables = 0
integer, save :: write_eirene_fluxes = 0
integer, save :: write_eirene_sources = 0
Expand All @@ -43,6 +44,7 @@ subroutine b2co_movies_cdf(nx, ny, ns, natm, nmol, ntri, tim)
1 write_b25_state_variables)
call ipgeti ('cdfmovie_b25_fluxes', write_b25_fluxes)
call ipgeti ('cdfmovie_b25_sources', write_b25_sources)
call ipgeti ('cdfmovie_b25_transport', write_b25_transport)
call ipgeti ('cdfmovie_eirene_state_variables',
1 write_eirene_state_variables)
call ipgeti ('cdfmovie_eirene_fluxes', write_eirene_fluxes)
Expand Down Expand Up @@ -167,6 +169,8 @@ subroutine b2co_movies_cdf(nx, ny, ns, natm, nmol, ntri, tim)
1 'Ion density', 'm^-3')
call create_cdf_field2(ncid2, 'ne',
1 'Electron density', 'm^-3')
call create_cdf_field3(ncid2, 'ua', 1,
1 'Ion parallel velocity', 'm s^-1')
call create_cdf_field2(ncid2, 'te',
1 'Electron temperature', 'eV')
call create_cdf_field2(ncid2, 'ti',
Expand Down Expand Up @@ -221,6 +225,22 @@ subroutine b2co_movies_cdf(nx, ny, ns, natm, nmol, ntri, tim)
1 'Volumetric line radiation rate', 'W m^-3')
call create_cdf_field2(ncid2, 'rqradsum',
1 'Total volumetric line radiation rate', 'W m^-3')
endif
if (write_b25_transport.ge.1) then
call create_cdf_field3(ncid2, 'dna', 1,
1 'Particle density-driven diffusivity', 'm^-2 s^-1')
call create_cdf_field3(ncid2, 'dpa', 1,
1 'Particle pressure-driven diffusivity', 'm^-2 s^-1')
call create_cdf_field2(ncid2, 'hci',
1 'Ion thermal anomalous diffusivity', 'm^-2 s^-1')
call create_cdf_field2(ncid2, 'hce',
1 'Electron thermal anomalous diffusivity', 'm^-2 s^-1')
call create_cdf_field3(ncid2, 'vlax', 1,
1 'Poloidal anomalous pinch velocity', 'm s^-1')
call create_cdf_field3(ncid2, 'vlay', 1,
1 'Radial anomalous pinch velocity', 'm s^-1')
call create_cdf_field3(ncid2, 'vsa', 1,
1 'Anomalous viscosity', 'm kg^-1 s^-1')
endif
if (write_eirene_state_variables.ge.1) then
if(natm.gt.0) then
Expand Down
25 changes: 15 additions & 10 deletions src/convert/b2co_time_cdf.F
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
subroutine b2co_time_cdf(nx, ny, ns, tim, batch_only)
subroutine b2co_time_cdf(nx, ny, ns, nnatmi, nnmoli, tim,
. batch_only)
use b2mod_types
use b2mod_geo
use b2mod_mwti
Expand All @@ -9,7 +10,7 @@ subroutine b2co_time_cdf(nx, ny, ns, tim, batch_only)
#ifndef NO_CDF
# include <netcdf.inc>
#endif
integer nx, ny, ns
integer :: nx, ny, ns, nnatmi, nnmoli
real (kind=R8) :: tim
logical :: batch_only
integer :: jxi, jxa, jsep
Expand All @@ -33,6 +34,8 @@ subroutine b2co_time_cdf(nx, ny, ns, tim, batch_only)
3 start(NF_MAX_VAR_DIMS), count(NF_MAX_VAR_DIMS)
real (kind=R8) :: scale
real (kind=R8), allocatable :: data1(:), data2(:,:), data3(:,:,:)
real (kind=R8) :: dsl(-1:ny), dsi(-1:ny), dsa(-1:ny),
1 dsr(-1:ny), dstl(-1:ny), dstr(-1:ny)
character*(NF_MAX_NAME) :: varname, dimname, attname
character :: units*(24)
character*4 :: extension
Expand All @@ -49,10 +52,12 @@ subroutine b2co_time_cdf(nx, ny, ns, tim, batch_only)
call ipgeti ('b2mwti_2dwrite', write_2d)
call ipgeti ('b2mndt_av_ntim_batch', ntim_batch)
call ipgeti ('b2mwti_target_offset', target_offset)
call output_ds(ny, -1,+target_offset,jsep,iylstrt,iylend,'dsl')
call output_ds(ny,jxi,0,jsep,iyistrt,iyiend,'dsi')
call output_ds(ny,jxa,0,jsep,iyastrt,iyaend,'dsa')
call output_ds(ny, nx,-target_offset,jsep,iyrstrt,iyrend,'dsr')
call output_ds(ny, -1,+target_offset,jsep,iylstrt,iylend,
. 'dsl',dsl)
call output_ds(ny,jxi,0,jsep,iyistrt,iyiend,'dsi',dsi)
call output_ds(ny,jxa,0,jsep,iyastrt,iyaend,'dsa',dsa)
call output_ds(ny, nx,-target_offset,jsep,iyrstrt,iyrend,
. 'dsr',dsr)
call xertst (0.lt.ns, 'faulty argument ns')
#ifndef NO_CDF
if (nnreg(0).ge.7) then
Expand All @@ -67,9 +72,9 @@ subroutine b2co_time_cdf(nx, ny, ns, tim, batch_only)
ixtr=ixtr+1
enddo
call output_ds(ny,ixtl,-target_offset,jsep,
. iytlstrt,iytlend,'dstl')
. iytlstrt,iytlend,'dstl',dstl)
call output_ds(ny,ixtr,+target_offset,jsep,
. iytrstrt,iytrend,'dstr')
. iytrstrt,iytrend,'dstr',dstr)
nytl = iytlend - iytlstrt + 1
nytr = iytrend - iytrstrt + 1
else
Expand Down Expand Up @@ -222,8 +227,8 @@ subroutine b2co_time_cdf(nx, ny, ns, tim, batch_only)
status=nf_create(trim(filename),NF_NOCLOBBER,ncid2)
call check_cdf_status(status)
call b2crtimecdf(filename, nx, ny, nybl, nytl, nytr, nybr,
. nya, nyi, nc, ns, write_2d, ncid2,
. batch_only, iret)
. nya, nyi, nc, ns, nnatmi, nnmoli, write_2d,
. ncid2, batch_only, iret)
status=nf_open(trim(filename),NF_WRITE,ncid2)
call check_cdf_status(status)

Expand Down
217 changes: 201 additions & 16 deletions src/documentation/b2input.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2821,14 +2821,93 @@
<default>3</default>
<type>integer</type>
<description>
..set the contribution ic in NEOART
0 --- classical particle flux
1 --- banana plateau contribution
2 --- Pfirsch-Schlueter contribution
3 --- both banana and PS
4 --- all contributions
mind that B2.5 already calculates the classical transport !
avoid double transport, 0+4 for cross-checks only !
This switch controls the type of neoclassical component calculated by NEOART and added to the B2.5 transport coefficients, if b2tqna_user_transport.eq.8.
If neoclassical_ic.eq.0, then only the classical component of the neoclassical transport coefficients is added.
If neoclassical_ic.eq.1, then only the banana-plateau component of the neoclassical transport coefficients is added.
If neoclassical_ic.eq.2, then only the Pfirsch-Schlueter component of the neoclassical transport coefficients is added.
If neoclassical_ic.eq.3, then both banana-plateau and Pfirsch-Schlueter components of the neoclassical transport coefficients are added.
If neoclassical_ic.eq.4, then all components of the neoclassical transport coefficients are added.
B2.5 already consistently calculates the classical transport components, therefore the options 0 and 4 should only used for testing or cross-checks. Additionally, if facdrift.eq.1, also the Pfirsch-Schlueter fluxes are already self-consistently calculated, therefore using the options 2 and 3 should be avoided as well.
</description>
</switch>
<switch>
<name>b2tqna_neoclassical_time_steps</name>
<default>1</default>
<type>integer</type>
<description>
Specifies the number of timesteps between successive recalculations of the neoclassical transport coefficients by NEOART, if b2tqna_user_transport.eq.8.
</description>
</switch>
<switch>
<name>b2tqna_neoclassical_iystart</name>
<default>See description (integer)</default>
<type>integer</type>
<description>
Radial cell index, on the basis mesh, defining the first poloidal ring of the region in which the neoclassical coefficients are added to the B2.5 transport coefficients, if b2tqna_user_transport.eq.8. By default equal to -1. In any case the neoclassical coefficients are only added if the poloidal ring belongs to the closed flux region.
</description>
</switch>
<switch>
<name>b2tqna_neoclassical_iyend</name>
<default>See description (integer)</default>
<type>integer</type>
<description>
Radial cell index, on the basis mesh, defining the last poloidal ring of the region in which the neoclassical coefficients are added to the B2.5 transport coefficients, if b2tqna_user_transport.eq.8. By default equal to jsep. In any case the neoclassical coefficients are only added if the poloidal ring belongs to the closed flux region.
</description>
</switch>
<switch>
<name>b2tqna_neoclassical_dna</name>
<default>1</default>
<type>integer</type>
<description>
If neoclassical_dna.eq.1 the neoclassical transport component calculated by NEOART is added to the particle diffusivity, if b2tqna_user_transport.eq.8.
</description>
</switch>
<switch>
<name>b2tqna_neoclassical_vla</name>
<default>1</default>
<type>integer</type>
<description>
If neoclassical_vla.eq.1 the neoclassical transport component calculated by NEOART is added to the radial convective velocity, if b2tqna_user_transport.eq.8.
</description>
</switch>
<switch>
<name>b2tqna_neoclassical_hci</name>
<default>1</default>
<type>integer</type>
<description>
If neoclassical_hci.eq.1 the neoclassical transport component calculated by NEOART is added to the ion thermal conductivity, if b2tqna_user_transport.eq.8.
</description>
</switch>
<switch>
<name>b2tqna_neoclassical_hvi</name>
<default>1</default>
<type>integer</type>
<description>
If neoclassical_hvi.eq.1 the neoclassical transport component calculated by NEOART is added to the radial ion thermal strange velocity, if b2tqna_user_transport.eq.8.
</description>
</switch>
<switch>
<name>b2tqna_neoclassical_hce</name>
<default>1</default>
<type>integer</type>
<description>
If neoclassical_hce.eq.1 the neoclassical transport component calculated by NEOART is added to the electron thermal conductivity, if b2tqna_user_transport.eq.8.
</description>
</switch>
<switch>
<name>b2tqna_neoclassical_hve</name>
<default>1</default>
<type>integer</type>
<description>
If neoclassical_hve.eq.1 the neoclassical transport component calculated by NEOART is added to the radial electron thermal strange velocity, if b2tqna_user_transport.eq.8.
</description>
</switch>
<switch>
<name>b2tqna_neoclassical_output</name>
<default>0</default>
<type>integer</type>
<description>
If neoclassical_output.eq.1 the neoclassical transport coefficients calculated by NEOART at all time steps at which it is called are outputted to the b2neo.nc file, if b2tqna_user_transport.eq.8.
</description>
</switch>
</category>
Expand Down Expand Up @@ -2929,6 +3008,14 @@
Controls the quantities outputted to b2movies.nc. If cdfmovie_b25_sources.ge.1 then the sources calculated by B2.5 (i.e. by atomic processes, electron cooling and line radiation) over the B2.5 grid are outputted.
</description>
</switch>
<switch>
<name>cdfmovie_b25_transport</name>
<default>0</default>
<type>integer</type>
<description>
Controls the quantities outputted to b2movies.nc. If cdfmovie_b25_transport.ge.1 then the anomalous transport coefficients over the B2.5 grid are outputted.
</description>
</switch>
<switch>
<name>cdfmovie_eirene_state_variables</name>
<default>0</default>
Expand Down Expand Up @@ -7263,28 +7350,109 @@
</description>
</switch>
<switch>
<name>ELM_TIME_BEGIN</name>
<name>ELM_TIME_PERIOD</name>
<default>0.0</default>
<type>real</type>
<description>
Time (in seconds) modulo ELM_TIME_PERIOD at which the ELM phase begins and the ELM data must be used.
Indicates the real period (in seconds) of simulated ELMs. If zero, no ELM profiles are used.
</description>
</switch>
<switch>
<name>ELM_DYNAMICS_MULTIPLE</name>
<default>.false.</default>
<type>logical</type>
<description>
If .true., different dynamics for the ELM phases to each of the 9 types of transport coefficients.
</description>
</switch>
<switch>
<name>ELM_TIME_BEGIN</name>
<default>0.0</default>
<type>real array of size 9</type>
<description>
Times (in seconds) modulo ELM_TIME_PERIOD at which the overall ELM phase begins (i.e. the transport coefficients
start to ramp up from the TDATA(2,ir,ik,is) values to the TDATA(3,ir,ik,is) values).
If ELM_DYNAMICS_MULTIPLE is .false. then the first value is applied to all the 9 types of transport coefficients.
If ELM_DYNAMICS_MULTIPLE is .true. then different values are applied to the 9 types of transport coefficients.
</description>
</switch>
<switch>
<name>ELM_TIME_PLATEAU</name>
<default>0.0</default>
<type>real array of size 9</type>
<description>
Times (in seconds) modulo ELM_TIME_PERIOD at which the ELM phase reaches its plateau (i.e. the transport coefficients
start keeping constant values equal to the TDATA(3,ir,ik,is)).
If ELM_DYNAMICS_MULTIPLE is .false. then the first value is applied to all the 9 types of transport coefficients.
If ELM_DYNAMICS_MULTIPLE is .true. then different values are applied to the 9 types of transport coefficients.
</description>
</switch>
<switch>
<name>ELM_TIME_RECOVERY</name>
<default>0.0</default>
<type>real array of size 9</type>
<description>
Times (in seconds) modulo ELM_TIME_PERIOD at which the ELM plateau phase ends (i.e. the transport coefficients
start to ramp down from the TDATA(3,ir,ik,is) values to the TDATA(2,ir,ik,is) values).
If ELM_DYNAMICS_MULTIPLE is .false. then the first value is applied to all the 9 types of transport coefficients.
If ELM_DYNAMICS_MULTIPLE is .true. then different values are applied to the 9 types of transport coefficients.
</description>
</switch>
<switch>
<name>ELM_TIME_END</name>
<default>0.0</default>
<type>real</type>
<type>real array of size 9</type>
<description>
Time (in seconds) modulo ELM_TIME_PERIOD at which the ELM phase ends and the ELM data is no longer used.
Times (in seconds) modulo ELM_TIME_PERIOD at which the overall ELM phase ends (i.e. the transport coefficients
start again keeping costant values equal to the TDATA(2,ir,ik,is)).
If ELM_DYNAMICS_MULTIPLE is .false. then the first value is applied to all the 9 types of transport coefficients.
If ELM_DYNAMICS_MULTIPLE is .true. then different values are applied to the 9 types of transport coefficients.
</description>
</switch>
<switch>
<name>ELM_TIME_PERIOD</name>
<name>ELM_CRASH_FACTOR</name>
<default>1.0E-10</default>
<type>real array of size 9</type>
<description>
Factor describing the logarithmic increase of the transport coefficients from the TDATA(2,ir,ik,is) values
to the TDATA(3,ir,ik,is) values during the ELM crash phase. By default (very low values) the increase is linear in time.
For higher values, the increase is faster at the beginning and slower towards the end of the crash phase.
If ELM_DYNAMICS_MULTIPLE is .false. then the first value is applied to all the 9 types of transport coefficients.
If ELM_DYNAMICS_MULTIPLE is .true. then different values are applied to the 9 types of transport coefficients.
</description>
</switch>
<switch>
<name>ELM_RECOVERY_FACTOR</name>
<default>1.0E-10</default>
<type>real array of size 9</type>
<description>
Factor describing the exponential decrease of the transport coefficients from the TDATA(3,ir,ik,is) values
to the TDATA(2,ir,ik,is) values during the ELM recovery phase. By default (very low values) the decrease is linear in time.
For higher values, the decrease is faster at the beginning and slower towards the end of the recovery phase.
If ELM_DYNAMICS_MULTIPLE is .false. then the first value is applied to all the 9 types of transport coefficients.
If ELM_DYNAMICS_MULTIPLE is .true. then different values are applied to the 9 types of transport coefficients.
</description>
</switch>
<switch>
<name>ELM_BALLOONING_EXP</name>
<default>0.0</default>
<type>real</type>
<type>real array of size 9</type>
<description>
Indicates the real frequency of simulated ELMs. See above for usage.
If zero, no ELM profiles are used.
Exponent of a ballooning-type cosine distribution describing a poloidal dependence of the ELM profiles, with
peaking at the poloidal location with index ELM_IXREF to the TDATA(3,ir,ik,is) values.
Higher values mean stronger peaking. If equal to 0.0, then the ELM profiles are poloidally constant, in the region
limited by ELM_IX_BEGIN and ELM_IX_END, and given by the TDATA(3,ir,ik,is) values.
If ELM_DYNAMICS_MULTIPLE is .false. then the first value is applied to all the 9 types of transport coefficients.
If ELM_DYNAMICS_MULTIPLE is .true. then different values are applied to the 9 types of transport coefficients.
</description>
</switch>
<switch>
<name>ELM_IXREF</name>
<default>jxa</default>
<type>integer</type>
<description>
Poloidal index of the location where the ELM profiles peak to the TDATA(3,ir,ik,is) values, according to a
ballooning-type cosine distribution with exponent ELM_BALLOONING_EXP.
</description>
</switch>
<switch>
Expand Down Expand Up @@ -8297,6 +8465,23 @@
</description>
</switch>
</category>
<category name="b2.neoclassical_transport.parameters">
<introduction>
<namelist>NEOCLASSICAL_TRANSPORT</namelist>
<description>
Read if 'b2tqna_user_transport' is set to 8.
Used to set the calculation of neoclassical transport coefficients for specific species.
</description>
</introduction>
<switch>
<name>NEO_NS_SET</name>
<default>.true.</default>
<type>logical array of size(0:NS-1)</type>
<description>
Specifies whether the neoclassical contribution is applied to particle diffusivity and radial convective velocity for the species (is).
</description>
</switch>
</category>
<category name="linear.geometry">
<introduction>
<namelist>GRID</namelist>
Expand Down
6 changes: 3 additions & 3 deletions src/driver/b2co.F
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ program b2co
call find_file(filename,file_exists)
if(file_exists) then
write(*,*) 'Truncating ', trim(filename)
call b2co_time_cdf(nx, ny, ns, tim, .false.)
call b2co_time_cdf(nx, ny, ns, nnatmi, nnmoli, tim, .false.)
write(*,*) 'Returned from b2co_time_cdf'
else
write(*,*) 'Skipped calling b2co_time_cdf because '//
Expand All @@ -419,7 +419,7 @@ program b2co
call find_file(filename,file_exists)
if(file_exists) then
write(*,*) 'Truncating ', trim(filename)
call b2co_time_cdf(nx, ny, ns, tim, .true.)
call b2co_time_cdf(nx, ny, ns, nnatmi, nnmoli, tim, .true.)
write(*,*) 'Returned from b2co_time_cdf'
else
write(*,*) 'Skipped calling b2co_time_cdf because '//
Expand Down Expand Up @@ -474,7 +474,7 @@ program b2co
write(*,*) 'Returned from b2co_movies_cdf'
else
write(*,*) 'Skipped calling b2co_movies_cdf because '//
. 'no b2movies.nc file found'
. 'no b2movies.nc found'
end if
end if
* ..close other files
Expand Down
Loading