From 023ce56174807df08df262158758b8844ae6f7b5 Mon Sep 17 00:00:00 2001 From: Nick Wogan Date: Fri, 31 May 2024 11:53:57 -0700 Subject: [PATCH] particles can only be made from evolving gases --- src/input/photochem_input_read.f90 | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/input/photochem_input_read.f90 b/src/input/photochem_input_read.f90 index e5b7e42..99d8059 100644 --- a/src/input/photochem_input_read.f90 +++ b/src/input/photochem_input_read.f90 @@ -393,14 +393,20 @@ subroutine get_rxmechanism(mapping, infile, dat, var, err) if (dat%particle_formation_method(i) == CondensingParticle) then ! if a condensing molecule ind = findloc(dat%species_names,dat%particle_gas_phase(i)) - if (ind(1) /= 0) then - dat%particle_gas_phase_ind(i) = ind(1) - else + if (ind(1) == 0) then err = "IOError: particle "//trim(dat%particle_names(i))// & " can not be made from "//trim(dat%particle_gas_phase(i))// & " because "//trim(dat%particle_gas_phase(i))//" is not a gas"// & " in the model." return + elseif (ind(1) > dat%nq .or. ind(1) < dat%ng_1) then + err = "Particle "//trim(dat%particle_names(i))// & + " can not be made from "//trim(dat%particle_gas_phase(i))// & + " because "//trim(dat%particle_gas_phase(i))//" is"// & + " is a particle, short-lived species, or background gas." + return + else + dat%particle_gas_phase_ind(i) = ind(1) endif endif enddo