16 USE stel_kinds,
only: rprec, dp
42 TYPE (
vertex),
POINTER :: chord_path => null()
61 REAL (rprec) :: wavelength
83 INTEGER :: flags = model_state_all_off
96 INTEGER :: flags = model_state_all_off
107 REAL (rprec),
DIMENSION(3) :: xcart
153 REAL (rprec),
DIMENSION(:,:) :: chord_paths
157 REAL (rprec) :: start_time
164 DO i = 1,
SIZE(chord_paths, 1)
191 REAL (rprec),
INTENT(in) :: wavelength
192 LOGICAL,
INTENT(in) :: in_degrees
193 REAL (rprec),
DIMENSION(:,:) :: chord_paths
197 REAL (rprec) :: start_time
204 DO i = 1,
SIZE(chord_paths, 1)
231 TYPE (intpol_class),
INTENT(inout) :: this
235 IF (
ASSOCIATED(this%chord_path))
THEN
237 this%chord_path => null()
254 TYPE (intpol_pol_class),
INTENT(inout) :: this
258 this%in_degrees = .false.
286 REAL (rprec),
DIMENSION(4),
INTENT(out) :: sigma
287 REAL (rprec),
DIMENSION(4),
INTENT(in) :: last_value
290 CHARACTER(len=1),
ALLOCATABLE :: context(:)
291 INTEGER :: context_length
292 REAL (rprec) :: start_time
299 IF (btest(a_model%state_flags, model_state_vmec_flag) .or.
300 & btest(a_model%state_flags, model_state_siesta_flag) .or.
301 & btest(a_model%state_flags, model_state_ne_flag) .or.
302 & btest(a_model%state_flags, model_state_shift_flag) .or.
303 & btest(a_model%state_flags, model_state_signal_flag))
THEN
307 context_length =
SIZE(transfer(a_model, context))
308 ALLOCATE(context(context_length))
309 context = transfer(a_model, context)
317 CALL this%scale_and_offset(a_model,
349 REAL (rprec),
DIMENSION(4),
INTENT(out) :: sigma
350 REAL (rprec),
DIMENSION(4),
INTENT(in) :: last_value
353 CHARACTER(len=1),
ALLOCATABLE :: context(:)
354 INTEGER :: context_length
355 REAL (rprec) :: start_time
362 IF (btest(a_model%state_flags, model_state_vmec_flag) .or.
363 & btest(a_model%state_flags, model_state_siesta_flag) .or.
364 & btest(a_model%state_flags, model_state_ne_flag) .or.
365 & btest(a_model%state_flags, model_state_shift_flag) .or.
366 & btest(a_model%state_flags, model_state_signal_flag))
THEN
370 context_length =
SIZE(transfer(a_model, context))
371 ALLOCATE(context(context_length))
372 context = transfer(a_model, context)
378 IF (this%in_degrees)
THEN
385 CALL this%scale_and_offset(a_model,
414 REAL (rprec) :: start_time
446 INTEGER,
INTENT(in) :: i
447 INTEGER,
INTENT(in) :: flags
450 CHARACTER(len=1),
ALLOCATABLE :: context(:)
451 INTEGER :: context_length
453 REAL (rprec) :: start_time
459 gp_context%model => a_model
461 gp_context%flags = flags
465 context_length =
SIZE(transfer(gp_context, context))
466 ALLOCATE(context(context_length))
467 context = transfer(gp_context, context)
504 INTEGER,
INTENT(in) :: flags
507 CHARACTER(len=1),
ALLOCATABLE :: context(:)
508 INTEGER :: context_length
510 REAL (rprec) :: start_time
515 gp_context%model => a_model
516 gp_context%signal =>
signal
517 gp_context%flags = flags
521 context_length =
SIZE(transfer(gp_context, context))
522 ALLOCATE(context(context_length))
523 context = transfer(gp_context, context)
558 REAL (rprec),
DIMENSION(3),
INTENT(in) :: x_cart
559 INTEGER,
INTENT(in) :: flags
562 REAL (rprec) :: start_time
563 CHARACTER(len=1),
ALLOCATABLE :: context(:)
564 INTEGER :: context_length
570 gp_context%model => a_model
571 gp_context%xcart = x_cart
575 context_length =
SIZE(transfer(gp_context, context))
576 ALLOCATE(context(context_length))
577 context = transfer(gp_context, context)
612 INTEGER,
INTENT(in) :: i
613 INTEGER,
INTENT(in) :: flags
616 CHARACTER(len=1),
ALLOCATABLE :: context(:)
617 INTEGER :: context_length
619 REAL (rprec) :: start_time
625 gp_context%model => a_model
627 gp_context%flags = flags
631 context_length =
SIZE(transfer(gp_context, context))
632 ALLOCATE(context(context_length))
633 context = transfer(gp_context, context)
636 & * (this%wavelength**2.0_dp)
644 IF (this%in_degrees)
THEN
676 INTEGER,
INTENT(in) :: flags
679 CHARACTER(len=1),
ALLOCATABLE :: context(:)
680 INTEGER :: context_length
682 REAL (rprec) :: start_time
688 gp_context%model => a_model
689 gp_context%signal =>
signal
690 gp_context%flags = flags
694 context_length =
SIZE(transfer(gp_context, context))
695 ALLOCATE(context(context_length))
696 context = transfer(gp_context, context)
699 & * (this%wavelength**2.0_dp)
707 IF (this%in_degrees)
THEN
737 REAL (rprec),
DIMENSION(3),
INTENT(in) :: x_cart
738 INTEGER,
INTENT(in) :: flags
741 REAL (rprec) :: start_time
742 CHARACTER(len=1),
ALLOCATABLE :: context(:)
743 INTEGER :: context_length
749 gp_context%model => a_model
750 gp_context%xcart = x_cart
754 context_length =
SIZE(transfer(gp_context, context))
755 ALLOCATE(context(context_length))
756 context = transfer(gp_context, context)
759 & * (this%wavelength**2.0_dp)
767 IF (this%in_degrees)
THEN
795 FUNCTION int_function(context, xcart, dxcart, length, dx)
800 CHARACTER (len=1),
INTENT(in) :: context(:)
801 REAL (rprec),
DIMENSION(3),
INTENT(in) :: xcart
802 REAL (rprec),
DIMENSION(3),
INTENT(in) :: dxcart
803 REAL (rprec),
INTENT(in) :: length
804 REAL (rprec),
INTENT(in) :: dx
809 REAL (rprec) :: start_time
814 a_model = transfer(context, a_model)
839 FUNCTION pol_function(context, xcart, dxcart, length, dx)
844 CHARACTER (len=1),
INTENT(in) :: context(:)
845 REAL (rprec),
DIMENSION(3),
INTENT(in) :: xcart
846 REAL (rprec),
DIMENSION(3),
INTENT(in) :: dxcart
847 REAL (rprec),
INTENT(in) :: length
848 REAL (rprec),
INTENT(in) :: dx
853 REAL (rprec),
DIMENSION(3) :: bcart
854 REAL (rprec) :: start_time
859 a_model = transfer(context, a_model)
861 bcart = equilibrium_get_b_vec(a_model%equilibrium, xcart, .false.)
863 &
model_get_ne(a_model, xcart)*dot_product(bcart, dxcart)
894 CHARACTER (len=1),
INTENT(in) :: context(:)
895 REAL (rprec),
DIMENSION(3),
INTENT(in) :: xcart
896 REAL (rprec),
DIMENSION(3),
INTENT(in) :: dxcart
897 REAL (rprec),
INTENT(in) :: length
898 REAL (rprec),
INTENT(in) :: dx
902 REAL (rprec) :: start_time
907 gp_context = transfer(context, gp_context)
940 CHARACTER (len=1),
INTENT(in) :: context(:)
941 REAL (rprec),
DIMENSION(3),
INTENT(in) :: xcart
942 REAL (rprec),
DIMENSION(3),
INTENT(in) :: dxcart
943 REAL (rprec),
INTENT(in) :: length
944 REAL (rprec),
INTENT(in) :: dx
948 REAL (rprec),
DIMENSION(3) :: bcart
949 REAL (rprec) :: start_time
954 gp_context = transfer(context, gp_context)
955 bcart = equilibrium_get_b_vec(gp_context%model%equilibrium, xcart,
959 & * dot_product(bcart, dxcart)
989 CHARACTER (len=1),
INTENT(in) :: context(:)
990 REAL (rprec),
DIMENSION(3),
INTENT(in) :: xcart
991 REAL (rprec),
DIMENSION(3),
INTENT(in) :: dxcart
992 REAL (rprec),
INTENT(in) :: length
993 REAL (rprec),
INTENT(in) :: dx
997 REAL (rprec) :: start_time
1002 gp_context = transfer(context, gp_context)
1003 gp_function_s = gp_context%signal%get_gp(gp_context%model, xcart,
1004 & gp_context%flags)*dx
1034 CHARACTER (len=1),
INTENT(in) :: context(:)
1035 REAL (rprec),
DIMENSION(3),
INTENT(in) :: xcart
1036 REAL (rprec),
DIMENSION(3),
INTENT(in) :: dxcart
1037 REAL (rprec),
INTENT(in) :: length
1038 REAL (rprec),
INTENT(in) :: dx
1042 REAL (rprec),
DIMENSION(3) :: bcart
1043 REAL (rprec) :: start_time
1048 gp_context = transfer(context, gp_context)
1049 bcart = equilibrium_get_b_vec(gp_context%model%equilibrium, xcart,
1054 & * dot_product(bcart, dxcart)
1081 CHARACTER (len=1),
INTENT(in) :: context(:)
1082 REAL (rprec),
DIMENSION(3),
INTENT(in) :: xcart
1083 REAL (rprec),
DIMENSION(3),
INTENT(in) :: dxcart
1084 REAL (rprec),
INTENT(in) :: length
1085 REAL (rprec),
INTENT(in) :: dx
1089 REAL (rprec) :: start_time
1095 gp_context = transfer(context, gp_context)
1097 & xcart, gp_context%xcart)*dx
1124 CHARACTER (len=1),
INTENT(in) :: context(:)
1125 REAL (rprec),
DIMENSION(3),
INTENT(in) :: xcart
1126 REAL (rprec),
DIMENSION(3),
INTENT(in) :: dxcart
1127 REAL (rprec),
INTENT(in) :: length
1128 REAL (rprec),
INTENT(in) :: dx
1132 REAL (rprec),
DIMENSION(3) :: bcart
1133 REAL (rprec) :: start_time
1139 gp_context = transfer(context, gp_context)
1140 bcart = equilibrium_get_b_vec(gp_context%model%equilibrium, xcart,
1143 & xcart, gp_context%xcart)
1144 & * dot_product(bcart, dxcart)