@@ -541,12 +541,14 @@ subroutine perteq_iterate(perteq, precond, fdm)
541541 write (postfix, postfix_fmt) kiter
542542 Bn_prev% DOF(:) = perteq% Bn% DOF
543543 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
546546 call MFEM_test(perteq% pn)
547547 call perteq_write(' ("iter/", a, "MFEM_' // postfix // ' ")' , &
548548 ' (after MFEM iteration)' , presn = perteq% pn, presmn = perteq% pn)
549549 end if
550+ #endif
551+ ! compute B_(n+1) = K * B_n + B_vac ... different from next_iteration_arnoldi
550552 call compute_presn(perteq, fdm, conf% damp)
551553 if (kiter <= 1 ) then
552554 call perteq_write(' ("iter/", a, "' // postfix // ' ")' , &
@@ -634,16 +636,16 @@ subroutine debug_initial_iteration(perteq, fdm)
634636 if (conf% debug_initial) then
635637 perteq% Bn% DOF(:) = vac% Bn% DOF
636638 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
642644 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
647649 call compute_currn(perteq, fdm, .false. , .true. )
648650 perteq% Bn% DOF(:) = vac% Bn% DOF
649651 perteq% Bn% comp_phi(:) = vac% Bn% comp_phi
@@ -705,6 +707,7 @@ subroutine presn_inhom(R, Z, scalar) bind(C, name = 'presn_inhom')
705707 scalar = - dp0_dpsi * (B_n(1 ) * B_0(3 ) - B_n(3 ) * B_0(1 )) * R / sqrt (sum (B_0 * B_0))
706708 end subroutine presn_inhom
707709
710+ #ifdef USE_MFEM
708711 subroutine MFEM_test (pn )
709712 use iso_c_binding, only: c_int, c_null_char, c_loc, c_funloc
710713 use mephit_conf, only: conf, logger, basename_suffix, decorate_filename
@@ -720,6 +723,7 @@ subroutine MFEM_test(pn)
720723 call logger% write_msg
721724 end if
722725 end subroutine MFEM_test
726+ #endif
723727
724728 subroutine FDM_init (fdm , nnz )
725729 type (FDM_t), intent (inout ) :: fdm
0 commit comments