From 8a3173ab3e2c53c98c3079c1edf54d12c85fb8b5 Mon Sep 17 00:00:00 2001 From: Darth Vader Date: Tue, 19 Nov 2024 18:06:24 +0000 Subject: [PATCH] Squashed 'src/phast/PhreeqcRM/' changes from ad80557e..cdec3e04 cdec3e04 Merge commit 'e6f26f763f2a9f972969ff59a8325e6474201d34' e6f26f76 Squashed 'src/' changes from 5b3b2308..b738c1e5 b078faca Merge pull request #179 from dlparkhurst/module aedff253 Merge branch 'master' into module 95f8d016 Fix for debug checking with multiple PhreeqcRM instances git-subtree-dir: src/phast/PhreeqcRM git-subtree-split: cdec3e041cb0c7fdf718d2f2f10ada454b20b381 --- src/RM_interface.F90 | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/RM_interface.F90 b/src/RM_interface.F90 index fcbfb5d8..a2996d42 100644 --- a/src/RM_interface.F90 +++ b/src/RM_interface.F90 @@ -394,6 +394,7 @@ SUBROUTINE Chk_CreateMapping(id, grid2chem) INTEGER, INTENT(in), DIMENSION(:) :: grid2chem INTEGER :: errors errors = 0 + rmf_nxyz = RM_GetGridCellCount(id) errors = errors + Chk_Integer1D(id, grid2chem, rmf_nxyz, "Grid2chem mapping", "RM_Createmapping") if (errors .gt. 0) then errors = RM_Abort(id, -3, "Invalid argument(s) in RM_Createmapping") @@ -1639,6 +1640,7 @@ SUBROUTINE Chk_GetGasCompMoles(id, gas_moles) INTEGER :: errors, rmf_ngas_comps errors = 0 rmf_ngas_comps = RM_GetGasComponentsCount(id) + rmf_nxyz = RM_GetGridCellCount(id) errors = errors + Chk_Double2D(id, gas_moles, rmf_nxyz, rmf_ngas_comps, "gas_moles", "RM_GetGasCompMoles") if (errors .gt. 0) then errors = RM_Abort(id, -3, "Invalid argument(s) in RM_GetGasCompMoles") @@ -4429,6 +4431,7 @@ SUBROUTINE Chk_InitialPhreeqc2Module(id, ic1, ic2, f1) real(kind=8), INTENT(IN), DIMENSION(:,:) , OPTIONAL :: f1 INTEGER :: errors errors = 0 + rmf_nxyz = RM_GetGridCellCount(id) errors = errors + Chk_Integer2D(id, ic1, rmf_nxyz, 7, "ic1", "RM_InitialPhreeqc2Module") if (present(ic2)) then errors = errors + Chk_Integer2D(id, ic2, rmf_nxyz, 7, "ic2", "RM_InitialPhreeqc2Module") @@ -5528,6 +5531,7 @@ END FUNCTION RMF_GetComponentCount INTEGER :: errors errors = 0 rmf_ncomps = RMF_GetComponentCount(id) + rmf_nxyz = RM_GetGridCellCount(id) errors = errors + Chk_Double2D(id, c, rmf_nxyz, rmf_ncomps, "concentration", "RM_SetConcentrations") if (errors .gt. 0) then errors = RM_Abort(id, -3, "Invalid argument in RM_SetConcentrations") @@ -5664,6 +5668,7 @@ SUBROUTINE Chk_SetDensityUser(id, density) real(kind=8), INTENT(in), DIMENSION(:) :: density INTEGER :: errors errors = 0 + rmf_nxyz = RM_GetGridCellCount(id) errors = errors + Chk_Double1D(id, density, rmf_nxyz, "density", "RM_SetDensityUser") if (errors .gt. 0) then errors = RM_Abort(id, -3, "Invalid argument in RM_SetDensityUser") @@ -5870,6 +5875,7 @@ SUBROUTINE Chk_SetGasCompMoles(id, gas_moles) INTEGER :: errors, rmf_ngas_comps errors = 0 rmf_ngas_comps = RM_GetGasComponentsCount(id) + rmf_nxyz = RM_GetGridCellCount(id) errors = errors + Chk_Double2D(id, gas_moles, rmf_nxyz, rmf_ngas_comps, "gas moles", "RM_SetGasCompMoles") if (errors .gt. 0) then errors = RM_Abort(id, -3, "Invalid argument in RM_SetGasCompMoles") @@ -5933,6 +5939,7 @@ SUBROUTINE Chk_SetGasPhaseVolume(id, gas_volume) INTEGER :: errors, rmf_ngas_comps errors = 0 rmf_ngas_comps = RM_GetGasComponentsCount(id) + rmf_nxyz = RM_GetGridCellCount(id) errors = errors + Chk_Double1D(id, gas_volume, rmf_nxyz, "gas volume", "RM_SetGasPhaseVolume") if (errors .gt. 0) then errors = RM_Abort(id, -3, "Invalid argument in RM_SetGasPhaseVolume") @@ -6303,6 +6310,7 @@ SUBROUTINE Chk_SetPorosity(id, por) real(kind=8), INTENT(in), DIMENSION(:) :: por INTEGER :: errors errors = 0 + rmf_nxyz = RM_GetGridCellCount(id) errors = errors + Chk_Double1D(id, por, rmf_nxyz, "porosity", "RM_SetPorosity") if (errors .gt. 0) then errors = RM_Abort(id, -3, "Invalid argument in RM_SetPorosity") @@ -6354,6 +6362,7 @@ SUBROUTINE Chk_SetPressure(id, p) real(kind=8), INTENT(in), DIMENSION(:) :: p INTEGER :: errors errors = 0 + rmf_nxyz = RM_GetGridCellCount(id) errors = errors + Chk_Double1D(id, p, rmf_nxyz, "pressure", "RM_SetPressure") if (errors .gt. 0) then errors = RM_Abort(id, -3, "Invalid argument in RM_SetPressure") @@ -6410,6 +6419,7 @@ SUBROUTINE Chk_SetPrintChemistryMask(id, cell_mask) INTEGER, INTENT(in), DIMENSION(:) :: cell_mask INTEGER :: errors errors = 0 + rmf_nxyz = RM_GetGridCellCount(id) errors = errors + Chk_Integer1D(id, cell_mask, rmf_nxyz, "cell_mask", "RM_SetPrintChemistryMask") if (errors .gt. 0) then errors = RM_Abort(id, -3, "Invalid argument in RM_SetPrintChemistryMask") @@ -6665,6 +6675,7 @@ SUBROUTINE Chk_SetSaturationUser(id, sat) real(kind=8), INTENT(in), DIMENSION(:) :: sat INTEGER :: errors errors = 0 + rmf_nxyz = RM_GetGridCellCount(id) errors = errors + Chk_Double1D(id, sat, rmf_nxyz, "sataturation", "RM_SetSaturationUser") if (errors .gt. 0) then errors = RM_Abort(id, -3, "Invalid argument in RM_SetSaturationUser") @@ -6850,6 +6861,7 @@ SUBROUTINE Chk_SetTemperature(id, t) real(kind=8), INTENT(in), DIMENSION(:) :: t INTEGER :: errors errors = 0 + rmf_nxyz = RM_GetGridCellCount(id) errors = errors + Chk_Double1D(id, t, rmf_nxyz, "temperature", "RM_SetTemperature") if (errors .gt. 0) then errors = RM_Abort(id, -3, "Invalid argument in RM_SetTemperature") @@ -7435,6 +7447,7 @@ SUBROUTINE Chk_SpeciesConcentrations2Module(id, species_conc) INTEGER :: errors, nspecies nspecies = RM_GetSpeciesCount(id) errors = 0 + rmf_nxyz = RM_GetGridCellCount(id) errors = errors + Chk_Double2D(id, species_conc, rmf_nxyz, nspecies, "species_conc", "RM_SpeciesConcentrations2Module") if (errors .gt. 0) then errors = RM_Abort(id, -3, "Invalid argument in RM_SpeciesConcentrations2Module")