Line data Source code
1 : ! Include shortname defintions, so that the F77 code does not have to be modified to 2 : ! reference the CARMA structure. 3 : #include "carma_globaer.h" 4 : 5 : !! This routine ensures limits all particle concentrations in a grid box 6 : !! to SMALL_PC. In bins where this limitation results in the particle 7 : !! concentration changing, the core mass fraction and second moment fraction 8 : !! are set to <FIX_COREF>. 9 : !! 10 : !! @author Andy Ackerman 11 : !! @version Oct-1997 12 >40753*10^7 : subroutine smallconc(carma, cstate, iz, ibin, ielem, rc) 13 : 14 : ! types 15 : use carma_precision_mod 16 : use carma_enums_mod 17 : use carma_constants_mod 18 : use carma_types_mod 19 : use carmastate_mod 20 : use carma_mod 21 : 22 : implicit none 23 : 24 : type(carma_type), intent(in) :: carma !! the carma object 25 : type(carmastate_type), intent(inout) :: cstate !! the carma state object 26 : integer, intent(in) :: iz !! z index 27 : integer, intent(in) :: ibin !! bin index 28 : integer, intent(in) :: ielem !! element index 29 : integer, intent(inout) :: rc !! return code, negative indicates failure 30 : 31 : ! Locals 32 : integer :: ig 33 : integer :: ip 34 : real(kind=f) :: small_val 35 : 36 : 37 >40753*10^7 : ig = igelem(ielem) 38 >40753*10^7 : ip = ienconc(ig) 39 : 40 : 41 : ! Element is particle concentration 42 >40753*10^7 : if (ielem == ip) then 43 >11643*10^7 : pc(iz,ibin,ielem) = max(pc(iz,ibin,ielem), SMALL_PC) 44 : else 45 : 46 : ! Element is core mass 47 >29109*10^7 : if ((itype(ielem) .eq. I_COREMASS) .or. (itype(ielem) .eq. I_VOLCORE)) then 48 >29109*10^7 : small_val = SMALL_PC * rmass(ibin,ig) * FIX_COREF 49 : 50 : ! Element is core second moment 51 0 : elseif (itype(ielem) .eq. I_CORE2MOM) then 52 0 : small_val = SMALL_PC * (rmass(ibin,ig) * FIX_COREF)**2 53 : end if 54 : 55 : ! Reset if either the particle concentration or the element mass are too small. 56 >29109*10^7 : if ((pc(iz,ibin,ip) <= SMALL_PC) .or. (pc(iz,ibin,ielem) < small_val)) then 57 2915852875 : pc(iz,ibin,ielem) = small_val 58 : endif 59 : endif 60 : 61 : ! Return to caller with particle concentrations limited to SMALL_PC 62 >40753*10^7 : return 63 >40753*10^7 : end