15 USE stel_kinds,
only: rprec
37 TYPE (
vertex),
POINTER :: chord_path => null()
39 INTEGER :: profile_number
82 INTEGER :: profile_number
93 INTEGER :: profile_number
99 INTEGER :: flags = model_state_all_off
108 INTEGER :: profile_number
123 INTEGER :: profile_number
127 REAL (rprec),
DIMENSION(3) :: xcart
176 REAL (rprec),
DIMENSION(3),
INTENT(in) :: start_path
177 REAL (rprec),
DIMENSION(3),
INTENT(in) :: end_path
178 REAL (rprec),
INTENT(in) :: geo
179 INTEGER,
INTENT(in) :: profile_number
182 REAL (rprec) :: start_time
185 start_time = profiler_get_start_time()
197 CALL profiler_set_stop_time(
'sxrem_emiss_construct', start_time)
217 REAL (rprec),
DIMENSION(3),
INTENT(in) :: start_path
218 REAL (rprec),
DIMENSION(3),
INTENT(in) :: end_path
219 INTEGER,
INTENT(in) :: profile_number
222 REAL (rprec) :: start_time
225 start_time = profiler_get_start_time()
235 CALL profiler_set_stop_time(
'sxrem_ti_construct', start_time)
254 TYPE (sxrem_class),
INTENT(inout) :: this
257 IF (
ASSOCIATED(this%chord_path))
THEN
259 this%chord_path => null()
262 this%profile_number = 0
278 TYPE (sxrem_emiss_class),
INTENT(inout) :: this
309 REAL (rprec),
DIMENSION(4),
INTENT(out) :: sigma
310 REAL (rprec),
DIMENSION(4),
INTENT(in) :: last_value
313 CHARACTER(len=1),
ALLOCATABLE :: context(:)
314 INTEGER :: context_length
316 REAL (rprec) :: start_time
319 start_time = profiler_get_start_time()
323 IF (btest(a_model%state_flags, model_state_vmec_flag) .or.
324 & btest(a_model%state_flags, model_state_siesta_flag) .or.
325 & btest(a_model%state_flags, model_state_shift_flag) .or.
326 & btest(a_model%state_flags, model_state_sxrem_flag +
327 & (this%profile_number - 1)) .or.
328 & btest(a_model%state_flags, model_state_signal_flag))
THEN
331 sxr_context%profile_number = this%profile_number
332 sxr_context%model => a_model
336 context_length =
SIZE(transfer(sxr_context, context))
337 ALLOCATE(context(context_length))
338 context = transfer(sxr_context, context)
346 CALL this%scale_and_offset(a_model,
352 CALL profiler_set_stop_time(
'sxrem_emiss_get_modeled_signal',
378 REAL (rprec),
DIMENSION(4),
INTENT(out) :: sigma
379 REAL (rprec),
DIMENSION(4),
INTENT(in) :: last_value
382 CHARACTER(len=1),
ALLOCATABLE :: context(:)
383 INTEGER :: context_length
385 REAL (rprec) :: start_time
388 start_time = profiler_get_start_time()
392 IF (btest(a_model%state_flags, model_state_vmec_flag) .or.
393 & btest(a_model%state_flags, model_state_siesta_flag) .or.
394 & btest(a_model%state_flags, model_state_shift_flag) .or.
395 & btest(a_model%state_flags, model_state_ti_flag) .or.
396 & btest(a_model%state_flags, model_state_sxrem_flag +
397 & (this%profile_number - 1)) .or.
398 & btest(a_model%state_flags, model_state_signal_flag))
THEN
401 sxr_context%profile_number = this%profile_number
402 sxr_context%model => a_model
406 context_length =
SIZE(transfer(sxr_context, context))
407 ALLOCATE(context(context_length))
408 context = transfer(sxr_context, context)
416 CALL this%scale_and_offset(a_model,
422 CALL profiler_set_stop_time(
'sxrem_ti_get_modeled_signal',
445 REAL (rprec) :: start_time
448 start_time = profiler_get_start_time()
452 CALL profiler_set_stop_time(
'sxrem_emiss_get_type', start_time)
454 1000
FORMAT(
'sxrch(',i2,
')')
476 REAL (rprec) :: start_time
479 start_time = profiler_get_start_time()
483 CALL profiler_set_stop_time(
'sxrem_ti_get_type', start_time)
485 1000
FORMAT(
'sxrch_ti(',i2,
')')
510 INTEGER,
INTENT(in) :: i
511 INTEGER,
INTENT(in) :: flags
514 REAL (rprec) :: start_time
515 CHARACTER(len=1),
ALLOCATABLE :: context(:)
516 INTEGER :: context_length
520 start_time = profiler_get_start_time()
522 gp_context%profile_number = this%profile_number
523 gp_context%model => a_model
525 gp_context%flags = flags
529 context_length =
SIZE(transfer(gp_context, context))
530 ALLOCATE(context(context_length))
531 context = transfer(gp_context, context)
542 CALL profiler_set_stop_time(
'sxrem_emiss_get_gp_i', start_time)
567 INTEGER,
INTENT(in) :: i
568 INTEGER,
INTENT(in) :: flags
571 REAL (rprec) :: start_time
572 CHARACTER(len=1),
ALLOCATABLE :: context(:)
573 INTEGER :: context_length
577 start_time = profiler_get_start_time()
579 gp_context%profile_number = this%profile_number
580 gp_context%model => a_model
582 gp_context%flags = flags
586 context_length =
SIZE(transfer(gp_context, context))
587 ALLOCATE(context(context_length))
588 context = transfer(gp_context, context)
598 CALL profiler_set_stop_time(
'sxrem_ti_get_gp_i', start_time)
624 INTEGER,
INTENT(in) :: flags
627 REAL (rprec) :: start_time
628 CHARACTER(len=1),
ALLOCATABLE :: context(:)
629 INTEGER :: context_length
633 start_time = profiler_get_start_time()
635 gp_context%profile_number = this%profile_number
636 gp_context%model => a_model
637 gp_context%signal =>
signal
638 gp_context%flags = flags
642 context_length =
SIZE(transfer(gp_context, context))
643 ALLOCATE(context(context_length))
644 context = transfer(gp_context, context)
655 CALL profiler_set_stop_time(
'sxrem_emiss_get_gp_s', start_time)
680 INTEGER,
INTENT(in) :: flags
683 REAL (rprec) :: start_time
684 CHARACTER(len=1),
ALLOCATABLE :: context(:)
685 INTEGER :: context_length
689 start_time = profiler_get_start_time()
691 gp_context%profile_number = this%profile_number
692 gp_context%model => a_model
693 gp_context%signal =>
signal
694 gp_context%flags = flags
698 context_length =
SIZE(transfer(gp_context, context))
699 ALLOCATE(context(context_length))
700 context = transfer(gp_context, context)
710 CALL profiler_set_stop_time(
'sxrem_ti_get_gp_s', start_time)
735 REAL (rprec),
DIMENSION(3),
INTENT(in) :: x_cart
736 INTEGER,
INTENT(in) :: flags
739 REAL (rprec) :: start_time
740 CHARACTER (len=1),
ALLOCATABLE :: context(:)
741 INTEGER :: context_length
745 start_time = profiler_get_start_time()
747 gp_context%profile_number = this%profile_number
748 gp_context%model => a_model
749 gp_context%xcart = x_cart
753 context_length =
SIZE(transfer(gp_context, context))
754 ALLOCATE(context(context_length))
755 context = transfer(gp_context, context)
764 CALL profiler_set_stop_time(
'sxrem_emiss_get_gp_x', start_time)
789 REAL (rprec),
DIMENSION(3),
INTENT(in) :: x_cart
790 INTEGER,
INTENT(in) :: flags
793 REAL (rprec) :: start_time
794 CHARACTER (len=1),
ALLOCATABLE :: context(:)
795 INTEGER :: context_length
799 start_time = profiler_get_start_time()
801 gp_context%profile_number = this%profile_number
802 gp_context%model => a_model
803 gp_context%xcart = x_cart
804 gp_context%flags = flags
808 context_length =
SIZE(transfer(gp_context, context))
809 ALLOCATE(context(context_length))
810 context = transfer(gp_context, context)
818 CALL profiler_set_stop_time(
'sxrem_ti_get_gp_x', start_time)
842 FUNCTION sxr_function(context, xcart, dxcart, length, dx)
848 CHARACTER (len=1),
INTENT(in) :: context(:)
849 REAL (rprec),
DIMENSION(3),
INTENT(in) :: xcart
850 REAL (rprec),
DIMENSION(3),
INTENT(in) :: dxcart
851 REAL (rprec),
INTENT(in) :: length
852 REAL (rprec),
INTENT(in) :: dx
856 REAL (rprec) :: start_time
859 start_time = profiler_get_start_time()
861 sxr_context = transfer(context, sxr_context)
863 & sxr_context%profile_number)*dx
865 CALL profiler_set_stop_time(
'sxr_function', start_time)
887 FUNCTION ti_function(context, xcart, dxcart, length, dx)
893 CHARACTER (len=1),
INTENT(in) :: context(:)
894 REAL (rprec),
DIMENSION(3),
INTENT(in) :: xcart
895 REAL (rprec),
DIMENSION(3),
INTENT(in) :: dxcart
896 REAL (rprec),
INTENT(in) :: length
897 REAL (rprec),
INTENT(in) :: dx
901 REAL (rprec) :: start_time
904 start_time = profiler_get_start_time()
906 sxr_context = transfer(context, sxr_context)
908 & sxr_context%profile_number)
911 CALL profiler_set_stop_time(
'ti_function', start_time)
939 CHARACTER (len=1),
INTENT(in) :: context(:)
940 REAL (rprec),
DIMENSION(3),
INTENT(in) :: xcart
941 REAL (rprec),
DIMENSION(3),
INTENT(in) :: dxcart
942 REAL (rprec),
INTENT(in) :: length
943 REAL (rprec),
INTENT(in) :: dx
947 REAL (rprec) :: start_time
950 start_time = profiler_get_start_time()
952 gp_context = transfer(context, gp_context)
955 & gp_context%profile_number)*dx
957 CALL profiler_set_stop_time(
'gp_emiss_function_i', start_time)
987 CHARACTER (len=1),
INTENT(in) :: context(:)
988 REAL (rprec),
DIMENSION(3),
INTENT(in) :: xcart
989 REAL (rprec),
DIMENSION(3),
INTENT(in) :: dxcart
990 REAL (rprec),
INTENT(in) :: length
991 REAL (rprec),
INTENT(in) :: dx
995 REAL (rprec) :: start_time
998 start_time = profiler_get_start_time()
1000 gp_context = transfer(context, gp_context)
1001 IF (btest(gp_context%flags, model_state_sxrem_flag +
1002 & (gp_context%profile_number - 1)))
THEN
1005 & gp_context%profile_number) *
1007 ELSE IF (btest(gp_context%flags, model_state_ti_flag))
THEN
1011 & gp_context%profile_number)
1018 CALL profiler_set_stop_time(
'gp_ti_function_i', start_time)
1045 CHARACTER (len=1),
INTENT(in) :: context(:)
1046 REAL (rprec),
DIMENSION(3),
INTENT(in) :: xcart
1047 REAL (rprec),
DIMENSION(3),
INTENT(in) :: dxcart
1048 REAL (rprec),
INTENT(in) :: length
1049 REAL (rprec),
INTENT(in) :: dx
1053 REAL (rprec) :: start_time
1056 start_time = profiler_get_start_time()
1058 gp_context = transfer(context, gp_context)
1065 CALL profiler_set_stop_time(
'gp_function_s', start_time)
1091 CHARACTER (len=1),
INTENT(in) :: context(:)
1092 REAL (rprec),
DIMENSION(3),
INTENT(in) :: xcart
1093 REAL (rprec),
DIMENSION(3),
INTENT(in) :: dxcart
1094 REAL (rprec),
INTENT(in) :: length
1095 REAL (rprec),
INTENT(in) :: dx
1099 REAL (rprec) :: start_time
1102 start_time = profiler_get_start_time()
1104 gp_context = transfer(context, gp_context)
1106 IF (btest(gp_context%flags, model_state_sxrem_flag +
1107 & (gp_context%profile_number - 1)))
THEN
1112 ELSE IF (btest(gp_context%flags, model_state_ti_flag))
THEN
1117 & gp_context%profile_number)
1124 CALL profiler_set_stop_time(
'gp_function_s', start_time)
1150 CHARACTER (len=1),
INTENT(in) :: context(:)
1151 REAL (rprec),
DIMENSION(3),
INTENT(in) :: xcart
1152 REAL (rprec),
DIMENSION(3),
INTENT(in) :: dxcart
1153 REAL (rprec),
INTENT(in) :: length
1154 REAL (rprec),
INTENT(in) :: dx
1158 REAL (rprec) :: start_time
1161 start_time = profiler_get_start_time()
1164 gp_context = transfer(context, gp_context)
1167 & gp_context%profile_number)*dx
1169 CALL profiler_set_stop_time(
'gp_emiss_function_x', start_time)
1196 CHARACTER (len=1),
INTENT(in) :: context(:)
1197 REAL (rprec),
DIMENSION(3),
INTENT(in) :: xcart
1198 REAL (rprec),
DIMENSION(3),
INTENT(in) :: dxcart
1199 REAL (rprec),
INTENT(in) :: length
1200 REAL (rprec),
INTENT(in) :: dx
1204 REAL (rprec) :: start_time
1207 start_time = profiler_get_start_time()
1210 gp_context = transfer(context, gp_context)
1211 IF (btest(gp_context%flags, model_state_sxrem_flag +
1212 & (gp_context%profile_number - 1)))
THEN
1216 & gp_context%profile_number) *
1218 ELSE IF (btest(gp_context%flags, model_state_ti_flag))
THEN
1222 & gp_context%profile_number)
1229 CALL profiler_set_stop_time(
'gp_ti_function_x', start_time)