@@ -541,12 +541,14 @@ subroutine perteq_iterate(perteq, precond, fdm)
541
541
write (postfix, postfix_fmt) kiter
542
542
Bn_prev% DOF(:) = perteq% Bn% DOF
543
543
Bn_prev% comp_phi(:) = perteq% Bn% comp_phi
544
- ! compute B_(n+1) = K * B_n + B_vac ... different from next_iteration_arnoldi
545
- if (kiter <= 1 .and. conf % debug_MFEM ) then
544
+ # ifdef USE_MFEM
545
+ if (kiter <= 1 ) then
546
546
call MFEM_test(perteq% pn)
547
547
call perteq_write(' ("iter/", a, "MFEM_' // postfix // ' ")' , &
548
548
' (after MFEM iteration)' , presn = perteq% pn, presmn = perteq% pn)
549
549
end if
550
+ #endif
551
+ ! compute B_(n+1) = K * B_n + B_vac ... different from next_iteration_arnoldi
550
552
call compute_presn(perteq, fdm, conf% damp)
551
553
if (kiter <= 1 ) then
552
554
call perteq_write(' ("iter/", a, "' // postfix // ' ")' , &
@@ -634,16 +636,16 @@ subroutine debug_initial_iteration(perteq, fdm)
634
636
if (conf% debug_initial) then
635
637
perteq% Bn% DOF(:) = vac% Bn% DOF
636
638
perteq% Bn% comp_phi(:) = vac% Bn% comp_phi
637
- if (conf % debug_MFEM) then
638
- call MFEM_test(perteq% pn)
639
- call perteq_write(' ("debug_MFEM_initial/MFEM_", a)' , &
640
- ' (initial MFEM iteration)' , presn = perteq% pn, presmn = perteq% pn)
641
- end if
639
+ # ifdef USE_MFEM
640
+ call MFEM_test(perteq% pn)
641
+ call perteq_write(' ("debug_MFEM_initial/MFEM_", a)' , &
642
+ ' (initial MFEM iteration)' , presn = perteq% pn, presmn = perteq% pn)
643
+ # endif
642
644
call compute_presn(perteq, fdm, .false. )
643
- if (conf % debug_MFEM) then
644
- call perteq_write(' ("debug_MFEM_initial/", a)' , &
645
- ' (initial iteration)' , presn = perteq% pn, presmn = perteq% pn)
646
- end if
645
+ # ifdef USE_MFEM
646
+ call perteq_write(' ("debug_MFEM_initial/", a)' , &
647
+ ' (initial iteration)' , presn = perteq% pn, presmn = perteq% pn)
648
+ # endif
647
649
call compute_currn(perteq, fdm, .false. , .true. )
648
650
perteq% Bn% DOF(:) = vac% Bn% DOF
649
651
perteq% Bn% comp_phi(:) = vac% Bn% comp_phi
@@ -705,6 +707,7 @@ subroutine presn_inhom(R, Z, scalar) bind(C, name = 'presn_inhom')
705
707
scalar = - dp0_dpsi * (B_n(1 ) * B_0(3 ) - B_n(3 ) * B_0(1 )) * R / sqrt (sum (B_0 * B_0))
706
708
end subroutine presn_inhom
707
709
710
+ #ifdef USE_MFEM
708
711
subroutine MFEM_test (pn )
709
712
use iso_c_binding, only: c_int, c_null_char, c_loc, c_funloc
710
713
use mephit_conf, only: conf, logger, basename_suffix, decorate_filename
@@ -720,6 +723,7 @@ subroutine MFEM_test(pn)
720
723
call logger% write_msg
721
724
end if
722
725
end subroutine MFEM_test
726
+ #endif
723
727
724
728
subroutine FDM_init (fdm , nnz )
725
729
type (FDM_t), intent (inout ) :: fdm
0 commit comments