|
V3FIT
|
Go to the documentation of this file.
13 USE stel_kinds,
only: rprec
28 CHARACTER (len=*),
PARAMETER ::
33 CHARACTER (len=*),
PARAMETER ::
52 CHARACTER (len=*),
PARAMETER ::
nc_flags =
'mddc_mrf_flags'
56 CHARACTER (len=*),
PARAMETER ::
nc_name =
'mddc_mrf_code_name'
59 &
'mddc_mrf_code_version'
61 CHARACTER (len=*),
PARAMETER ::
nc_date =
'mddc_mrf_date_run'
64 &
'mddc_mrf_field_coils_id'
69 &
'mddc_mrf_n_field_cg'
72 &
'mddc_mrf_rdiag_coilg_1'
75 &
'mddc_mrf_extcur_mg'
79 CHARACTER (len=*),
PARAMETER ::
nc_num_t =
'mddc_mrf_kp'
81 CHARACTER (len=*),
PARAMETER ::
nc_num_r =
'mddc_mrf_ir'
83 CHARACTER (len=*),
PARAMETER ::
nc_num_z =
'mddc_mrf_jz'
85 CHARACTER (len=*),
PARAMETER ::
nc_rmin =
'mddc_mrf_rmin'
87 CHARACTER (len=*),
PARAMETER ::
nc_rmax =
'mddc_mrf_rmax'
89 CHARACTER (len=*),
PARAMETER ::
nc_zmin =
'mddc_mrf_zmin'
91 CHARACTER (len=*),
PARAMETER ::
nc_zmax =
'mddc_mrf_zmax'
94 &
'mddc_mrf_n_field_periods'
99 &
'mddc_mrf_lstell_sym'
102 CHARACTER (len=*),
PARAMETER ::
nc_a_r =
'mddc_mrf_a_r'
104 CHARACTER (len=*),
PARAMETER ::
nc_a_f =
'mddc_mrf_a_f'
106 CHARACTER (len=*),
PARAMETER ::
nc_a_z =
'mddc_mrf_a_z'
112 &
'mddc_mrf_use_con_shell'
115 &
'mddc_mrf_kp_shell'
118 CHARACTER (len=*),
PARAMETER ::
nc_a_s_r =
'mddc_mrf_a_s_r'
120 CHARACTER (len=*),
PARAMETER ::
nc_a_s_f =
'mddc_mrf_a_s_f'
122 CHARACTER (len=*),
PARAMETER ::
nc_a_s_z =
'mddc_mrf_a_s_z'
127 &
'mddc_mrf_position'
130 &
'mddc_mrf_direction'
146 CHARACTER (len=magnetic_response_len) :: name
148 CHARACTER (len=magnetic_response_len) :: version
150 CHARACTER (len=magnetic_response_len) :: date
152 CHARACTER (len=magnetic_response_len) :: coil_id
156 INTEGER :: n_field_cg
158 REAL (rprec),
DIMENSION(:),
POINTER :: inductance => null()
160 REAL (rprec),
DIMENSION(:),
POINTER :: current_scale => null()
175 INTEGER :: n_field_periods
178 INTEGER :: num_t_shell
202 REAL (rprec),
DIMENSION(3) :: position
204 REAL (rprec),
DIMENSION(3) :: direction
259 & coil_id, inductance, &
261 & num_t, num_t_shell, &
262 & rmin, rmax, zmin, zmax, &
264 & stell_sym, a_r, a_f, a_z, &
265 & a_s_r, a_s_f, a_s_z, &
274 CHARACTER (len=*),
INTENT(in) :: name
275 CHARACTER (len=*),
INTENT(in) :: date
276 CHARACTER (len=*),
INTENT(in) :: coil_id
277 REAL (rprec),
DIMENSION(:),
POINTER :: inductance
278 REAL (rprec),
DIMENSION(:),
POINTER :: current_scale
279 INTEGER,
INTENT(in) :: num_t
280 INTEGER,
INTENT(in) :: num_t_shell
281 REAL (rprec),
INTENT(in) :: rmin
282 REAL (rprec),
INTENT(in) :: rmax
283 REAL (rprec),
INTENT(in) :: zmin
284 REAL (rprec),
INTENT(in) :: zmax
285 INTEGER,
INTENT(in) :: n_field_periods
286 LOGICAL,
INTENT(in) :: stell_sym
287 REAL (rprec),
DIMENSION(:,:,:),
POINTER :: a_r
288 REAL (rprec),
DIMENSION(:,:,:),
POINTER :: a_f
289 REAL (rprec),
DIMENSION(:,:,:),
POINTER :: a_z
290 REAL (rprec),
DIMENSION(:,:),
POINTER :: a_s_r
291 REAL (rprec),
DIMENSION(:,:),
POINTER :: a_s_f
292 REAL (rprec),
DIMENSION(:,:),
POINTER :: a_s_z
293 REAL (rprec),
INTENT(in) :: svd_cut_off
297 REAL (rprec) :: start_time
314 IF (
ASSOCIATED(inductance))
THEN
325 IF (
ASSOCIATED(current_scale))
THEN
327 &
SIZE(current_scale)))
347 IF (
ASSOCIATED(a_r))
THEN
352 CALL assert(
ASSOCIATED(a_f),
'a_f response function not ' //
354 CALL assert(
ASSOCIATED(a_z),
'a_z response function not ' //
361 DO phi = 1,
SIZE(a_r, 3)
372 IF (
ASSOCIATED(a_s_r))
THEN
377 CALL assert(
ASSOCIATED(a_s_f),
'a_s_f response function ' //
379 CALL assert(
ASSOCIATED(a_s_z),
'a_s_z response function ' //
410 & coil_id, position, &
411 & direction, vacuum, &
420 CHARACTER (len=*),
INTENT(in) :: name
421 CHARACTER (len=*),
INTENT(in) :: date
422 CHARACTER (len=*),
INTENT(in) :: coil_id
423 REAL (rprec),
DIMENSION(3) :: position
424 REAL (rprec),
DIMENSION(3) :: direction
425 REAL (rprec),
DIMENSION(:),
POINTER :: vacuum
426 REAL (rprec),
DIMENSION(:),
POINTER :: current_scale
429 REAL (rprec) :: start_time
454 IF (
ASSOCIATED(vacuum))
THEN
465 IF (
ASSOCIATED(current_scale))
THEN
467 &
SIZE(current_scale)))
496 INTEGER,
INTENT(in) :: mdsig_iou
497 REAL (rprec),
INTENT(in) :: svd_cut_off
500 REAL(rprec),
DIMENSION(:,:,:),
ALLOCATABLE :: temp_buffer
501 LOGICAL :: temp_logical
502 INTEGER,
DIMENSION(3) :: dim_lengths
504 REAL (rprec) :: start_time
512 CALL cdf_read(mdsig_iou,
nc_name,
516 CALL cdf_read(mdsig_iou,
nc_date,
538 IF (temp_logical)
THEN
545 IF (temp_logical)
THEN
563 IF (temp_logical)
THEN
602 CALL cdf_read(mdsig_iou,
nc_rmin,
604 CALL cdf_read(mdsig_iou,
nc_rmax,
606 CALL cdf_read(mdsig_iou,
nc_zmin,
608 CALL cdf_read(mdsig_iou,
nc_zmax,
613 CALL cdf_inquire(mdsig_iou,
nc_a_r, dim_lengths)
614 ALLOCATE(temp_buffer(dim_lengths(1),
618 CALL cdf_read(mdsig_iou,
nc_a_r, temp_buffer)
621 DO phi = 1, dim_lengths(3)
626 CALL cdf_read(mdsig_iou,
nc_a_f, temp_buffer)
629 DO phi = 1, dim_lengths(3)
634 CALL cdf_read(mdsig_iou,
nc_a_z, temp_buffer)
637 DO phi = 1, dim_lengths(3)
642 DEALLOCATE(temp_buffer)
651 CALL cdf_inquire(mdsig_iou,
nc_a_s_r, dim_lengths(1:2))
652 ALLOCATE(temp_buffer(1,dim_lengths(1),dim_lengths(2)))
654 CALL cdf_read(mdsig_iou,
nc_a_s_r, temp_buffer(1,:,:))
658 CALL cdf_read(mdsig_iou,
nc_a_s_f, temp_buffer(1,:,:))
662 CALL cdf_read(mdsig_iou,
nc_a_s_z, temp_buffer(1,:,:))
666 DEALLOCATE(temp_buffer)
697 TYPE (magnetic_response_class),
POINTER :: this
703 IF (ASSOCIATED(this%inductance)) THEN
704 DEALLOCATE(this%inductance)
705 this%inductance => null()
708 IF (
ASSOCIATED(this%current_scale))
THEN
709 DEALLOCATE(this%current_scale)
710 this%current_scale => null()
713 IF (
ASSOCIATED(this%a_r))
THEN
714 DO phi = 1,
SIZE(this%a_r)
721 IF (
ASSOCIATED(this%a_f))
THEN
722 DO phi = 1,
SIZE(this%a_f)
729 IF (
ASSOCIATED(this%a_z))
THEN
730 DO phi = 1,
SIZE(this%a_z)
737 IF (
ASSOCIATED(this%a_s_r))
THEN
742 IF (
ASSOCIATED(this%a_s_f))
THEN
747 IF (
ASSOCIATED(this%a_s_z))
THEN
777 REAL (rprec) :: start_time
808 REAL (rprec) :: start_time
839 REAL (rprec) :: start_time
870 REAL (rprec) :: start_time
897 TYPE (magnetic_response_class),
INTENT(inout) :: this
900 REAL (rprec) :: start_time
930 REAL (rprec) :: start_time
960 TYPE (magnetic_response_class),
INTENT(in) :: this
961 INTEGER,
INTENT(in) :: mdsig_iou
964 REAL (rprec),
DIMENSION(:,:,:),
ALLOCATABLE :: temp_buffer
966 REAL (rprec) :: start_time
972 CALL cdf_define(mdsig_iou,
nc_flags, this%flags)
975 CALL cdf_define(mdsig_iou,
nc_name, this%name)
976 CALL cdf_define(mdsig_iou,
nc_version, this%version)
977 CALL cdf_define(mdsig_iou,
nc_date, this%date)
978 CALL cdf_define(mdsig_iou,
nc_coil_id, this%coil_id)
985 & this%current_scale)
990 CALL cdf_define(mdsig_iou,
nc_num_t, this%num_t)
991 CALL cdf_define(mdsig_iou,
nc_rmin, this%rmin)
992 CALL cdf_define(mdsig_iou,
nc_rmax, this%rmax)
993 CALL cdf_define(mdsig_iou,
nc_zmin, this%zmin)
994 CALL cdf_define(mdsig_iou,
nc_zmax, this%zmax)
996 & this%n_field_periods)
1005 CALL cdf_define(mdsig_iou,
nc_a_r, temp_buffer)
1006 CALL cdf_define(mdsig_iou,
nc_a_f, temp_buffer)
1007 CALL cdf_define(mdsig_iou,
nc_a_z, temp_buffer)
1009 DEALLOCATE(temp_buffer)
1019 ALLOCATE(temp_buffer(1,
1023 CALL cdf_define(mdsig_iou,
nc_a_s_r, temp_buffer(1,:,:))
1024 CALL cdf_define(mdsig_iou,
nc_a_s_f, temp_buffer(1,:,:))
1025 CALL cdf_define(mdsig_iou,
nc_a_s_z, temp_buffer(1,:,:))
1027 DEALLOCATE(temp_buffer)
1032 CALL cdf_define(mdsig_iou,
nc_position, this%position)
1033 CALL cdf_define(mdsig_iou,
nc_direction, this%direction)
1054 TYPE (magnetic_response_class),
INTENT(in) :: this
1055 INTEGER,
INTENT(in) :: mdsig_iou
1058 REAL (rprec),
DIMENSION(:,:,:),
ALLOCATABLE :: temp_buffer
1060 REAL (rprec) :: start_time
1066 CALL cdf_write(mdsig_iou,
nc_flags, this%flags)
1069 CALL cdf_write(mdsig_iou,
nc_name, this%name)
1070 CALL cdf_write(mdsig_iou,
nc_version, this%version)
1071 CALL cdf_write(mdsig_iou,
nc_date, this%date)
1072 CALL cdf_write(mdsig_iou,
nc_coil_id, this%coil_id)
1083 CALL cdf_write(mdsig_iou,
nc_num_t, this%num_t)
1084 CALL cdf_write(mdsig_iou,
nc_rmin, this%rmin)
1085 CALL cdf_write(mdsig_iou,
nc_rmax, this%rmax)
1086 CALL cdf_write(mdsig_iou,
nc_zmin, this%zmin)
1087 CALL cdf_write(mdsig_iou,
nc_zmax, this%zmax)
1089 & this%n_field_periods)
1095 ALLOCATE(temp_buffer(
SIZE(this%a_r(1)%p%data_buffer, 1),
1096 &
SIZE(this%a_r(1)%p%data_buffer, 2),
1099 temp_buffer(:,:,1) = this%a_r(1)%p%data_buffer
1101 DO phi = 2,
SIZE(this%a_r)
1103 temp_buffer(:,:,phi) = this%a_r(phi)%p%data_buffer
1106 CALL cdf_write(mdsig_iou,
nc_a_r, temp_buffer)
1108 DO phi = 1,
SIZE(this%a_f)
1110 temp_buffer(:,:,phi) = this%a_f(phi)%p%data_buffer
1113 CALL cdf_write(mdsig_iou,
nc_a_f, temp_buffer)
1115 DO phi = 1,
SIZE(this%a_z)
1117 temp_buffer(:,:,phi) = this%a_z(phi)%p%data_buffer
1120 CALL cdf_write(mdsig_iou,
nc_a_z, temp_buffer)
1122 DEALLOCATE(temp_buffer)
1131 CALL cdf_write(mdsig_iou,
nc_a_s_r, this%a_s_r%data_buffer)
1135 CALL cdf_write(mdsig_iou,
nc_a_s_f, this%a_s_f%data_buffer)
1139 CALL cdf_write(mdsig_iou,
nc_a_s_z, this%a_s_z%data_buffer)
1145 CALL cdf_write(mdsig_iou,
nc_position, this%position)
1146 CALL cdf_write(mdsig_iou,
nc_direction, this%direction)
character(len= *), parameter nc_flags
NETCDF configureation flags.
character(len= *), parameter nc_a_r
NETCDF radial response grid variable.
Defines functions for measuring an tabulating performance of function and subroutine calls....
Interface for the construction of magnetic_response_class types using magnetic_response_construct_new...
character(len= *), parameter nc_date
NETCDF date run variable.
integer function compression_get_dimension2(this)
Get the jth dimension length.
character(len= *), parameter nc_stell_sym
NETCDF stell symmetric variable.
subroutine compression_cleanup(this)
Cleanup decompressed data.
logical function magnetic_response_use_shell(this)
Checks if the conducting shell flag is set.
character(len= *), parameter nc_num_z
NETCDF number vertical grid points variable.
character(len= *), parameter nc_version
NETCDF version variable.
character(len= *), parameter nc_a_s_z
NETCDF vertical response shell grid variable.
character(len= *), parameter nc_inductance
NETCDF mutual inductance variable.
integer, parameter magnetic_response_is_point_flag
Bit position for the use conducting shell flag.
subroutine magnetic_response_define(this, mdsig_iou)
Defines the variables for the NETCDF file.
character(len= *), parameter nc_current_scale
NETCDF current scale variable.
character(len= *), parameter nc_rmax
NETCDF maximum radial grid variable.
logical function magnetic_response_use_plasma(this)
Checks if the plasma flag is set.
character(len= *), parameter nc_num_t
NETCDF number torodial planes variable.
logical function magnetic_response_is_stell_sym(this)
Checks if the stellarator symmetric flag is set.
character(len= *), parameter nc_a_s_f
NETCDF toroidal response shell grid variable.
character(len= *), parameter nc_rmin
NETCDF minimum radial grid variable.
character(len= *), parameter nc_coil_id
NETCDF coil identifier variable.
subroutine magnetic_response_write(this, mdsig_iou)
Write variables to the NETCDF file.
integer, parameter magnetic_response_len
Length for strings.
integer, parameter magnetic_response_use_plasma_flag
Bit position for the force coil response flag.
character(len= *), parameter nc_num_r
NETCDF number radial grid points variable.
character(len= *), parameter nc_a_f
NETCDF toroidal response grid variable.
integer, parameter magnetic_response_stell_sym_flag
Bit position for the stellerator symmetry flag.
character(len= *), parameter nc_a_s_r
NETCDF radial response shell grid variable.
character(len= *), parameter nc_direction
NETCDF number torodial shell grid points variable.
real(rprec) function profiler_get_start_time()
Gets the start time of profiled function.
logical function magnetic_response_is_point(this)
Checks if the coil response flag is set.
type(magnetic_response_class) function, pointer magnetic_response_construct_point(name, date, coil_id, position, direction, vacuum, current_scale)
Construct a magnetic_response_class object.
character(len= *), parameter nc_use_shell
NETCDF use conducting shell variable.
character(len= *), parameter nc_n_field_cg
NETCDF number of field coils variable.
subroutine compression_decompress(this)
Decompress the data.
character(len= *), parameter nc_num_t_shell
NETCDF number torodial shell grid points variable.
character(len= *), parameter nc_name
NETCDF code name variable.
Pointer to a compression object. Used for creating arrays of compression pointers....
subroutine magnetic_response_destruct(this)
Deconstruct a magnetic_response_class object.
Base class representing a magnetic signal response function.
type(magnetic_response_class) function, pointer magnetic_response_construct_new(name, date, coil_id, inductance, current_scale, num_t, num_t_shell, rmin, rmax, zmin, zmax, n_field_periods, stell_sym, a_r, a_f, a_z, a_s_r, a_s_f, a_s_z, svd_cut_off)
Construct a magnetic_response_class object.
logical function magnetic_response_use_coil(this)
Checks if the coil response flag is set.
Defines the base class of the type compression_class. This class contains the code and buffers to hol...
subroutine profiler_set_stop_time(symbol_name, start_time)
Gets the end time of profiled function.
character(len= *), parameter magnetic_response_20140928
Version for the MDSIG files. This version adds the conducting shell.
character(len= *), parameter nc_a_z
NETCDF vertical response grid variable.
character(len= *), parameter nc_zmin
NETCDF minimum vertical grid variable.
Defines the base class of the type magnetic_response_class.
character(len= *), parameter magnetic_response_current
Version for the MDSIG files. This version adds the point diagnostics.
type(magnetic_response_class) function, pointer magnetic_response_construct_netcdf(mdsig_iou, svd_cut_off)
Construct a magnetic_response_class object.
subroutine magnetic_response_clr_use_coil(this)
Clears the coil response bit.
integer function compression_get_dimension1(this)
Get the ith dimension length.
Base class containing buffers for compressed and uncompressed data.
character(len= *), parameter nc_zmax
NETCDF maximum vertical grid variable.
Interface for the construction of compression_class types using compression_construct_new or compress...
character(len= *), parameter nc_position
NETCDF use conducting shell variable.
subroutine compression_destruct(this)
Deconstruct a compression_class object.
integer, parameter magnetic_response_use_shell_flag
Bit position for the use conducting shell flag.
integer, parameter magnetic_response_use_coil_flag
Bit position for the use coil response flag.
character(len= *), parameter nc_n_field_periods
NETCDF number of field periods variable.