From 6ab72794d23cdc319112fd34c2dcf89eae5780b5 Mon Sep 17 00:00:00 2001 From: Meissam L Bahlali Date: Sat, 3 Aug 2024 12:39:14 +0100 Subject: [PATCH] Fix bug to pass tests. --- ICFERST/src/Multiphase_TimeLoop.F90 | 4 +++- ICFERST/src/multi_eos.F90 | 8 +++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ICFERST/src/Multiphase_TimeLoop.F90 b/ICFERST/src/Multiphase_TimeLoop.F90 index 208c8b971..76c63de29 100644 --- a/ICFERST/src/Multiphase_TimeLoop.F90 +++ b/ICFERST/src/Multiphase_TimeLoop.F90 @@ -875,7 +875,9 @@ subroutine MultiFluids_SolveTimeLoop( state, & end if ! Option if we want to have a copied field of the metal field BEFORE the exchange (dissolution or precipitation) happens. - call copy_metal_field(state, packed_state, Mdims, ndgln) + if ( have_option( '/material_phase[0]/scalar_field::CopiedField_Metal' ) ) then + call copy_metal_field(state, packed_state, Mdims, ndgln) + end if !Metal dissolution happens here if (have_option("/porous_media/Metal_dissolution"))call metal_dissolution(state, packed_state, Mdims, ndgln) diff --git a/ICFERST/src/multi_eos.F90 b/ICFERST/src/multi_eos.F90 index 78a0f720f..4b8d801a3 100644 --- a/ICFERST/src/multi_eos.F90 +++ b/ICFERST/src/multi_eos.F90 @@ -3322,11 +3322,9 @@ subroutine copy_metal_field(state, packed_state, Mdims, ndgln) call get_option("/material_phase[0]/scalar_field::CopiedField_Metal/diagnostic/metal_field_name",metal_field_name) - if ( have_option( '/material_phase[0]/scalar_field::CopiedField_Metal' ) ) then - metal_field=>extract_tensor_field(packed_state,"Packed"//trim(metal_field_name), stat) - metal_field_copied=>extract_scalar_field(state(1), "CopiedField_Metal", stat) - metal_field_copied%val(:) = metal_field%val(1,1,:) - end if + metal_field=>extract_tensor_field(packed_state,"Packed"//trim(metal_field_name), stat) + metal_field_copied=>extract_scalar_field(state(1), "CopiedField_Metal", stat) + metal_field_copied%val(:) = metal_field%val(1,1,:) end subroutine copy_metal_field