EPA-AA-IMS-82-3
   Derivation of I/M Benefits for Pre-1981
    Light Duty Vehicles for Low Altitude,
            Non-California Areas
                 June,  1982
              James Rutherford
      Inspection and Maintenance Staff
    Emission Control Technology Division
Office of Mobile Source Air Pollution Control
     Office of Air,  Noise, and Radiation
    U.S. Environmental Protection Agency

-------
                               TABLE  OF  CONTENTS
1.0   INTRODUCTION

1.1   Purpose
1.2 •  Methodological Improvements Over MOBILE1
1.3   Summary
2.0   RESULTS

2.1   Example Results For Archetypical Programs
2.2   Comparison With Previous Estimates


3.0   BACKGROUND AND GENERAL DESCRIPTION OF SIMULATION MODEL

3.1   Data Availability
3.1.1 Operating I/M Programs
3.1.2 Portland Study
3.1.3 Emission Factors Programs
3.2   Alternative Models
3.2.1 Previous Model
3.2.2 Stochastic Models
3.2.3 All Means Models
3.3   General Model Description
3.3.1 Calendar Year - Model Year Relationship
3.3.2 Vehicle Groupings
3.3.3 Initial Adjustment Of Sample
3.3.4 Simulation Cycle


4.0   DETAILED DESCRIPTION OF MODEL

4.1   Vehicle Sample
4.2   Adjustment To MOBILE2 Predictions
4.3   Calculation Of Initial Idle Values
4.4   Inspection
4.5   Reductions Due To Maintenance
4.6   Deterioration
4.7   Iterations
4.8   January 1 Percent Reductions
Appendix:  Computer Program Listing

-------
1.0 INTRODUCTION

1.1 Purpose

This  report  presents  the  derivation  of   the   Inspection/Maintenance   (l/M)
emission  reduction  benefits for  pre-1981  model  year  vehicles  (non-California
low  altitude)  which  were prepared  for use  in  EPA's  emission  factor model,
MOBILE2.*   MOBILE2   is   a  computer  program which  estimates   fleet  average
emissions  of the  three  regulated  pollutants (hydrocarbons,  carbon monoxide,
and  nitrous oxides)  at  various  points  in  time  under  varying  ambient  and
driving  conditions.   The  effects of  I/M  are  applied  in MOBILE2  as  percent
reductions,  or  credits,  to  average  emissions   for  various  segments   of  the
fleet.   The  I/M  benefits  for  1981   and   later  model  years  were  derived
independently  and  are  discussed  in  a separate report  ("Derivation  of  I/M
Benefits  for Post-1980  Light  Duty  Vehicles  for Low  Altitude   Non-California
Areas", EPA-AA-IMS-81-2).

Although  40 CFR 51  Appendix  N —  "Emission  Reductions  Achievable  through
Inspection  and Maintenance  of Light Duty  Vehicles, Motorcycles,  and Light  and
Heavy Duty  Trucks"  (the codification of EPA's first estimates of I/M  credits)
has been  obsolete  since  the release  of MOBILE1  (the  predecessor to MOBILE2),
many people still refer to whatever is  EPA's  current  set of I/M  credits and/or
the methodology used  to derive them as "Appendix  N".

1.2 Methodological Improvements Over MOBILE1

The  I/M  credits  described here  and  used in  MOBILE2  are  the  product  of  a
computerized simulation model  as  were  those  used in MOBILE1.  As will  be seen
in  the  following,  several  significant  improvements   have  been  made   in  the
model.  A brief listing of the important improvements is given here.

The  basic  sample  of  test  results  from Emission Factor  testing used  in  the
simulation  is   much  larger  in  MOBILE2.   Over   five   thousand  vehicles   are
included.  MOBILE1 used results from less  than eight hundred vehicles.

The  most  significant  improvements  come   from   the  analysis  of   testing  of
vehicles  involved  in real-world  I/M programs  (Portland Study and  New Jersey
test  lane data).  The  information  gleaned from  these  data  provide realistic
evaluations  of  maintenance effects,  deterioration following  maintenance,   the
effect  of mechanics'  training,  the effects  of   vehicle mileage  accumulation,
and the relationships among cutpoints,  idle  scores,  and Federal  Test Procedure
(FTP) results.
* The  I/M credits  documented  in this report are not  exactly  those included in
the  original  release of  the  MOBILE2 model.   A coding  error  was made  in the
computer  program  listed  in  this  report  and  as  a  result,   the  I/M  credits
originally included in  the MOBILE2 model  do  not give  the intended I/M credits,
especially for  HC emissions.    The  error  occurred in  subroutine  DTRATN listed
in pages 57 and  58 of this report.  Variable  PROJX(2)  was  inadvertantly coded
PROJX  instead  of  PROJX(P)  within  the  loops.   User  Information  Sheet  #6 for
MOBTLE2 presents the corrected  I/M credits for  these vehicles.

-------
There were also major  improvements  made in the derivation  of credits for 1981
and  later  vehicles.   These  improvements are  included  in  the above-mentioned
technical report (EPA-AA-IMS-81-2).

1.3 Summary

Section 2.0 gives a brief  discussion of the  I/M  credits  for pre-1981 vehicles
included in MOBILE2.   A sample of  the  credits  is presented.   The  credits are
briefly compared with credits in MOBILE1.

Sections  3.1  and 3.2  indicate  the data  and types  of models,  respectively,
which  were under  consideration  in  the development  of  the  I/M  simulation.
Section 3.3 gives a verbal  description of the general model structure and how
it was built.

Section  4.0  presents   the  simulation  model  step-by-step   with  formulae  and
parameters given in their entirety.

The  Appendix  is a  listing  of the  Fortran   IV  source  code  for the computer
program which produced the credits.

-------
2.0 RESULTS

2.1 Example Result's for Archetypical Programs

The MOBILE2  computer program  references I/M  credits  for  pre-1981  model year
cars on the basis  of  technology (Technology I refers  to pre-1975 model  years,
Technology II refers  to  1975-1980  model years),  pollutant, program  stringency,
vehicle age at  first inspection,  benefit year  (i.e.,  number of inspections),
and presence  or  absence of mechanic   training.*   The  general  trends  in  the
credits can be  seen  in  Figures 1-8.   The figures  present  all the credits used
by MOBILE2 for  pre-1981  model  year vehicles for a 20% stringency I/M program.
It  can be seen that  there  is  a  generally  increasing  trend  in  credit with
increasing benefit year  for  a given  age  of  first  inspection.    Conversely,
there   is  a generally increasing trend  in credit with  increasing  age of  first
inspection for  a given benefit year.   However,  this later trend is  drastically
less significant  for  Technology II.   The incremental  benefits  due  to mechanic
training  are  small relative to other  effects.  For  HC the  increments  are  on
the order of 0  to 2 percentage  points and for  CO they  are  in the range of 0 to
8 percentage  points.   Although not shown here,  the effects  of  stringency  are
also   small.    Generally,   for  stringency  ranging   from  10%   to  50%,   the
corresponding credits fluctuate by about  ten percentage  points of credit.

2.2 Comparison With Previous Estimates

Comparison between the I/M credits for  pre-1981  model year vehicles  in MOBILE1
and MOBILE2 is muddled by changes  in the basic emission factors  model and .by a
slightly  different  structure   of  the   I/M  credits  within  the   program.    For
example,  MOBILE2 estimates  fleet  average  emissions  as  of  January 1  of  the
evaluation year while MOBILE1  evaluated as  of July  1.   In terms of  structure,
MOBILE2 considers  age of vehicle  at  implementation  of  the I/M  program.  In
MOBILE1,  vehicles  received  credits at  first  inspection  based  on one  year  of
age regardless  of actual age.   This is  inaccurate  since the older a  vehicle is
at  first inspection, the greater is the  benefit at the first  few inspections.

A  general comparison  of the  two  sets  of  credits  can be  made based  on  the
effects on the  fleet emission  levels.    Figures  9  and  10  present  a  comparison
of  percent  reductions   in   the pre-1981  model  year  fleet average emission
estimates  for  January   1,  1988  from   MOBILE1  and  MOBILE2  for  I/M programs
beginning  January  1,  1983.    Since  MOBILE1  evaluates  for  July  1   dates and
assumes I/M  programs start  July  1,  interpolation was  required  for  comparison
with MOBHE2.   Although  this is only one  set  of  examples,  the  conclusions  to
be  drawn  are  generally  applicable.   For HC  (Figure  9)  there  is  very   little
effect  of  mechanic training from  MOBILE2.   The reductions  for  both with and
without mechanic training from MOBILE2  are  less  than those for  MOBILE1 with no
mechanic  training  at  all stringencies.   For CO  (Figure  10),  although there  is
a greater  effect  due to mechanic  training  in  MOBILE2 than  for  HC,  both  cases
fall   between  the   reductions  observed   in  MOBILE1   for  the   with  and
without-mechanic training cases.
* The  I/M  credits  documented  in this report are not  exactly  those included in
the  original  release of  the  MOBILE2 model.  Further  explanation  is presented
in the footnote on page 3 of  this report.

-------
3.0 BACKGROUND AND GENERAL DESCRIPTION OF SIMULATION MODEL

3.1 Data Availability

3.1.1 Operating I/M Programs

Although  there are  a  few operating  I/M  programs,   in  those  where  data is
recorded  from  testing there  is  generally only idle  or  other  short  test  data
available.

3.1.2 Portland Study

In order to obtain the necessary  data  from  an actual  I/M program, EPA has  been
conducting  tests   in   Portland,  Oregon  through  a contractor,   Hamilton  Test
Systems, since September,  1977.   As  input for the modeling  of the I/M process
EPA has four pertinent data sets  from  the  Portland Study.   The first data  set,
Element I,  is  a group  of as—received tests  on  about 2200  1975-77  model  year
cars from Portland.   Two  data sets come  from Element  II.   About  200 cars  each
from model  years   1972-74 (Technology I)  and model years  1975-77  (Technology
II)  were  tested   five  or  six  times  using  the   FTP:  as—received,  following
maintenance  if required   by   the  Portland  I/M  program,   and four  times at
quarterly intervals over  the  year following  the  initial  test.  The fourth  data
set, Element  III,  consists of testing similar to  that  done  in  Element  II on
about 300 1975-77 model year  cars.

3.1.3 Emission Factors .

From  Emission Factors  testing,  EPA's  ongoing   in-use  surveillance  program,
there are 2678 Technology I and 2456 Technology II cars  from the FY71 program
through the FY79  program.  These are  tests  from  low-altitude, non-California,
non-Phoenix (where I/M was operating) sites.  All tests are as-received.

3.2 Alternate Models

Before  arriving  at the current model,  several  alternatives  were considered.
EPA  began  by  looking at the  previous  model   to  determine  whether  minor
modifications would suffice.   EPA then  looked at  two more  general  classes of
models: stochastic models and all means  models.   Each of  these  are discussed
below.  It will be apparent that the current model is a hybrid of  the three.

3.2.1 Previous Model

The  previous  model was developed  before much data  was  available  relative to
I/M.   Deterioration  was  predicted  for  individual  vehicles  based  on  the
relationship between  their actual  test  measurements  and MOBILE1 predictions.
The  resultant  fleetwide  deterioration is  parallel to the  MOBILE1 without-I/M
deterioration.  Reductions were  determined  for individual  cars based on  single
pollutant  regression  equations  between  idle  and FTP.    Cars  designated as
failing only  one  pollutant were  simulated  as having  maintenance  effects  only
on that pollutant  in  the  absence  of mechanic training.   With mechanic training

-------
every  failed  car was  assumed to  be  emitting  at its  new car  standard after
maintenance.

3.2.2 Stochastic Models

Classical stochastic models were  considered.   The general approach would be to
determine   predictive   relationships   among  variables   of   interest.    The
stochastic  element  would  then enter as individual vehicles'  random deviations
from  the  strict relationships.   However,  upon examination of  available data,
EPA determined  that the variance-covariance structures among  the  variables of
interest  were  too  weak  to support this  approach.   In  other words,  the  data
showed  that the relationships among  the  variables on  individual  vehicles  are
too erratic to provide meaningful individual car predictions.

3.2.3 All Means Models

Given  the  problems  caused by  the erratic  behavior  of individual  vehicles as
described  above,  the  next  logical  approach  is  an  all means  model.   This
involves  the  same  basic  development  as  the  stochastic models  (i.e.,  finding
predictive  relationships  among   the  variables   of   interest),  but  with  the
variables entering  as means from  a  group  of vehicles.  The variability problem
is reduced.  The  stochastic  element could be  minimized  or discarded complete-
ly.   However,  problems arose  due to lack of  flexibility in  determining  the
results of  inspection.   It was not  possible to predict group  failure  rates in
a  satisfactory  manner  without looking at  the  individual  car  deterioration  and
the relationships between idle and FTP.

3.3 General Model Description

3.3.1 Calendar Year - Model Year Relationship

MOBILE2 requires  I/M credits  in  the.  form of  individual  percent reductions to
each model  year's  emission factor  as of  January  1  of a  given calendar  year.
The credit  is   further  specificed by start  date  of  the  I/M  program,  program
stringency, presence or absence  of mechanic's training,  and pollutant  (HC or
CO).   MOBILE2  applies   the  I/M  credit  to each model year's   emission  factor,
then combines the model years to form a  composite  fleet -emission factor.

In order  to derive  the  credits,  the  simulation used the entire  input  sample
for a given technology  to  produce a twenty-year emissions history  for a  given
age of  first  inspection and  stringency.   The  twenty-year histories were used
as described below  in Section 4.8  to determine model  year  credits which  are
referenced  in  MOBILE2  by age of  first  inspection and benefit year.  MOBILE2
uses calendar year,  model year, and start  date of  the I/M program  to determine
age of  first  inspection and  benefit  year for a  given model  year at a  given
calendar year.

3.3.2 Vehicle Groupings

As  discussed   in  Section  3.2,  the  production of the  twenty-year  emissions
histories was  accomplished by a  hybrid  model  which contains  aspects  of  the
previous  model,  stochastic models,  and  all  means  models.    At   the  time   of
inspection,  the  simulation   fleet  was   considered on  an individual vehicle

-------
                                       8

basis.   After  maintenance emissions were  determined  by failure group.(failing
HC,  CO,  or  both).   Deterioration  was  predicted  for  the  mean of the  entire
fleet.

3.3.3 Initial  Adjustment  of  Sample

The  best  sample   of  vehicle  test  data  available comes  from  EPA's   Emission
Factors  Programs   from  Fiscal  Years 1971,  1972,  1973,  1974,  1975,  1977,  and
1979.   Testing under  these  programs  spanned  the  calendar  years   1971  through
1980.  To  begin each twenty-year fleet  emissions  history,  a group of  vehicles
of the same  chronological age  is required.  Rather  than search the sample  for
vehicles of  the required  age  at time of  testing  which would  yield  small  or
null  samples  in  many  cases,  the  entire  sample  of  vehicles  of   the  required
technology was used.   The  sample  was adjusted  to simulate a  sample of  vehicles
at the  required age of  first  inspection.  Each stratum from a stratification
based  on model  year  and  calendar  year  of  the  Emission  Factor  testing  was
individually adjusted  to  obtain  a group of vehicles with mean odometer  reading
and  FTP emissions as  predicted by MOBILE2  for   the   required  age  of  first
inspection.   The  resulting  individually  adjusted  sample   of vehicles  then
received  adjustments  to  their   idle  scores  to  reflect  the  adjustments   to
mileage  and  FTP   emissions.-  The   idle adjustments  were   based   on   adjusted
mileage   and  FTP  emissions   plus   engine   size   (CID)    and   actual  idle
measurements.  The simulation  of the  twenty-year  emissions  history then  began
with  the  sample of vehicles adjusted  to the  chronological age  when the  first
inspection would  take place.  The  history  prior to this point  is  simply that
predicted by MOBHE2 in the  absence  of an  I/M program.

3.3.4 Simulation Cycle

At the  first  inspection of  the twenty-year  emissions history,  the  adjusted
idle  scores  from  the  sample were  used to determine   idle  emission cutpoints
which yield  the  specified  failure  (stringency)  rate.   These  cutpoints  were
retained through   the  remainder  of   the  twenty-year emissions  history.    Using
these cutpoints each vehicle was  designated as  passed,  HC failure,  CO failure,
or a  failure on both pollutants.  After maintenance mean emission  levels were
predicted  for  each  failure  group based  on mileage,  cutpoints,  failure mode,
and presence or absence of mechanic's  training.   The  passed  vehicles  retained
emission levels from before  inspection.   The after maintenance  emisson levels
were   recombined  to  form  fleet  emission levels.   Deterioration of  the  fleet
mean  emission  levels up to  the  next  inspection point  was  predicted  based  on
after  maintenance  fleet  mean  emissions   levels,  mileage,  and   the  MOBILE2
prediction of  non-I/M  fleet  emissions.   At the- next inspection,  each vehicle's
mileage  and  FTP emissions were  adjusted  based  on the  new  fleet   means.   The
idle   scores  for each vehicle were  predicted based  on  CID and  the  new mileage
and   FTP   emissions.    The  cycle  of   inspection,  emission   reduction,   and
deterioration  was   then  repeated until  the  fleet  completed  the  twenty-year
history.

-------
4.0  DETAILED  DESCRIPTION OF  MODEL

This section  presents  a  detailed  description  of the  steps  followed  in  the
simulation.   As  discussed  in  Section  3,  the  model  is  a  'hybrid  containing
aspects  of the previous  deterministic  model  (MOBILE1), stochastic models,  and
all  means  models.   The sample input  consisted  of test results and  information
on  individual  vehicles.   The  individual  vehicle  variables were   initially
adjusted  to  be consistent with MOBILE2 predictions for the  means.   Artificial
deviations were added  to simulate  the stochastic nature  of  the  relationship
among  idle scores and other variables.   Individual vehicles'  idle scores  were
used in  the  inspection process.  The effects of maintenance  and  deterioration
were based on  predictions of means.   The results  from  the mean predictions
were translated back to  the individual  vehicle variables for the purpose  of
subsequent inspection simulations.

4.1  Vehicle Sample

The  simulation started with  a  sample  from Emission  Factors  data.   These  are
data from the  same  cars which  are  used  in  determining the basic emission
factor equations  used  in MOBILE2.   The sample  has 2456 Technology II cars  and
2678 Technology  I  cars.   For each car  the  sample  contains the  vector  of
observations:

     x'i =  (xj.1, xi2, Xi3,  xi4, xi5,  xig,  x£7, xig); i  = !,•••, n;
  XQ2>  X03*   To  achieve  these  means   in  the
simulation  sample,  the simulation adjusted the sample in the following manner:
Let x*i = X£i (XQI/X^) where, x^ is the mean mileage of those vehicles in
the sample which have a common model year-program year combination.

Then x* = XQI ,  i.e., the model year-program year adjusted mean is equal
to the MOBILE2  predicted mean.  In a similar manner, individual vehicle FTP
emissions were  adjusted by


    =
Xi2  =  X£2(X02/X2^  an(* Xi3  = x£3(xQ3/x3) where X2 and X3

-------
                                      10

are the FTP HC  and  CO means  (before adjustment), respectively, averaged within
the program year-model year  groups.  The program  year-model  year designations
were used to maintain  appropriate mileage accumulation rates.

There  is  an implicit  assumption  that  the vehicles  are  being  adjusted  to the
same chronological  age within about two  or  three  months.  For a subsample of
the vehicles, build  date  was available.  In conjunction  with test date, build
date allows  for slightly increased  accuracy in age  determination relative to
the program year and  model year information.   However,  when the two methods of
adjustment  were  compared,   no substantial  differences   in  mileage  and  FTP
emissions distributions were detected.

4.3 Calculation of Initial Idle Values

Regression equations of the form

xij = bjo + bjlxil + bj2Xi2 + bj3Xi3 + bj6Xi6;  j-4,5; i - 1,  .... n

have been developed*  to predict idle scores  from the individual vehicle engine
sizes  and  adjusted  mileages  and  FTP scores.  The  regression coefficients are
given  in  Table 1.   In order  to  calculate  idle values  for  the  sample after
adjustment  of  mileages   and  FTP  scores  to  MOBILE2 predictions,  the  first
estimate is given by:

xij = bjo + bjlxil + bj2xi2 + bj3xi3 + bj6xi6J  J=4.5;

and, if X£4 <" 0, let X£4 = 1.; if £^5 <"0, let x^ =  . 1.  Then, let

rij = xij/xij> i=l>.«.n; j-4,5.  Using the individual deteriorated vectors,

      bjo + bjlxil + bj2xi2 + bj3xi3

    *            *            *            *
If x4 < 0, let x*4 =1.; if x*5 < 0, let x5 »  1.

Finally, let x£j = x-jjrijj i = l,...,n; j =4,5.  Then x^4 and x^5 are
assumed to  be  the idle "HC  and CO  values  respectively  for  the cars  at  first
inspection.  They have  been adjusted to account  for deterioration and have  a
synthetic  deviation  from a perfect  regression based  on the  actual  measured
idle scores for each car.

4.4 Inspection

At  the point  of  first  inspection,  the  derived  idle  scores were  used  to
determine  idle  cutpoints.  This  was  done  in  a manner  such  that  the  desired
failure  rate  was  obtained   concurrently   with   one   of  the   the  following
conditions**:
*  The  data  base  used  to  derive  the  regression  equations  consisted  of
as-received test  results  from 2552  Technology  I cars  and 2454  Technology  II
cars from Emission Factors data.
** These conditions are thought by EPA to result  in  a  reasonable  balance  of  HC
and CO  failures.   Some such  conditions  are necessary  to  establish  cutpoints,
since a desired failure rate alone does not determine them uniquely.

-------
                                       11

    1)  if  the  CO  outpoint is  greater  than or  equal  to  3.0,  then  the  HC
    cutpoint (in PPM) is  100 times  the  CO  outpoint  (in  percent);  or,

    2)  if  the  CO cutpoint  is  less  than 3.0, then  the  HC cutpoint is  150  plus
    fifty times  the CO cutpoint.

The derived idle scores  were then compared with  the  outpoints  to  determine
which cars  passed and  failed.   Since the  maintenance  effects were to  be based
on predictions  for  means  by failure mode  (i.e., whether  HC or CO or  both  were
failed),  the  individual vehicles were  assigned a  failure mode at  inspection.
The respective  failure rates  and mean FTP emissions were  calculated by failure
mode, i.e.,.f£j and FTPjjk, where

    i = 1:  pass HC,
        2:  fail HC;

    j - 1:  pass CO,
        2:  fail CO; and

    k = 2:  FTP HC,
        3:  FTP CO.

4.5 Reductions Due  to Maintenance

Overview

The mean  FTP emissions  for failed cars after maintenance  for pollutant k  (k  =
2:HC, 3:CO) and failure  group ij  (i  = 1;HC pass, 2:HC  fail; j  =  1:CO pass,
2:CO fail)  are given for each  Technology  (I  and  II) by
    FTPijk • dijko + dijklMij + dijk4  IHCC + dijk5  ICOC
where  M^j  is  mean  mileage for  the  (ij)  failure  group;   IHC^  and  ICO^  are
the  idle HC  and  idle  CO  outpoints  respectively;  and  there is  no mechanic
training.   The  passed  cars (i=l, j=l)  retained  the  mean  FTP  levels
and FTP) observed at inspection.
The mean FTP emissions  for  the  entire fleet (all four failure groups  combined)
after maintenance for pollutant k were estimated by;

     22                22
    ^>'    "^5"^  f  • T?TP- -, /  "S""1    ^"""    f • •
    Z^    2L_.  fij FTPijk/  ^f—  .  ^—    £ij'


where f^j is the proportion of the fleet  in each of  the  failure groups.

-------
                                       12

Detailed Derivation

The d^jk's were derived in a four step process:

1)  First, the a^'s were estimated by  regression  in:

xmk B ako + akixml + ak4 IHCCm + ak5 ICOCmi m • l,...,n; k * 4,5;
where  IHCcm is  the idle  HC outpoint  imposed on  the mth  vehicle by  an  I/M
program  at  reinspection  following  repair and  ICQcm  is  the  idle  CO cutpoint
applied  to  the  mth vehicle.  (Not  all  vehicles in  the  regression sample have
the same cutpoints  because the  sample comes from two  I/M  programs,  and one  of
these  imposes  cutpoints which  vary  by  vehicle make  and  model.) x^  for  k=4
and 5  are  the  idle HC  and CO measurements,  respectively, for the mth vehicle
at  reinspection.   x^  is  the  odometer  reading  for  the  mth  vehicle.    The
estimates  for   these  equations  are  given in  Table  2.   The  sample  used   in
estimating  the  a^ig   consists  of   after  maintenance  official  reinspection
tests  from  the  Portland and  New Jersey  I/M  programs.*   The  intention  was  to
quantify  empirically   the  average   margins  by  which  idle   emissions   after
maintenance  fall below the cutpoints  in an  I/M program.   Such margins  are
possible because I/M cutpoints  are  always set  well  above the idle emissions  of
well tuned vehicles.  Margins are expected since  repair  mechanics will tend  to
reduce  idle  emissions  well  below  the  program cutpoints  to  provide  a safety
margin to guard against failure at reinspection.

2)  Next, the c^j^'s were estimated by regression in

      cijko + cijkl*ml  + Cijk4*m4 + cijk5xm5J m a If -in; k -  2,3;
from  Portland  after  maintenance and  first quarter  tests  on  failed cars.**
This equation predicts  individual FTP  levels after maintenance from  individual
idle  levels  and mileage.   As  above,  (ij)  refers  to  failure  mode.   xmi,
x^, and ^3 are mileage, FTP HC, and FTP CO, respectively,  x^ and  x^
are the idle emissions as above.  The coefficients are given in Table 3.

3)  A first  iteration estimate for after maintenance  average  FTP emissions as
a  function  of  cutpoints for., each  failure  group  putting  together (l)  and  (2)
above is:
                          = cijko + C

                 (340 + a41Mij + a4'4 IHCC + a45

                 (a50 + a51Mij + a54 IHCC + a55
* From Elements  II and III of  the  Portland Study,  320 tests were  used.   From
New Jersey, 1333 tests recorded in 1975-1979 were used.

** For Technology  I,  159  tests  from'Element II were used.   For  Technology II,
386 tests from Elements II and III were used.

-------
                                      13

4)  To insure that  the  prediction at the mean  of  the  Portland observations is
correct, the following  relationship must hold:

          Sijk (MijL. IHCCL, ICOCL)FTPijkp/

                          , ICOCP)
where  P  refers  to Portland  and  L refers  to  local, i.e.,  the  program under
consideration.

To achieve this relationship, letting k^jk = FTPijkP/Sijk^MijP> IHCCP>

and reassembling the. above,

              dijko = kijk  )>

              dijkl s *ijk  (cijkl  + Cijk4 a41 + cijk5  a51),

              dijk4 = kijk  (cijk4  344 + cijkS 354), and

              dijk5 * kijk  (Cijk4
As  seen in  Table  4,  the  kijk  are  reasonably  close  to  one  (1)  indicating
consistency  in  the  model.   The  dijkm's  are   presented   in  Table  5.   The
simulation checked whether
    xmk = akO * akl Xml * ak4 IHCCm * ak5 ICOCm5 k = 4,5 yields

                    , or xm5>ICOCm.
Although  unlikely,  due to  the  statistical nature  of  the prediction  this may
occur  implying  the  car is  above  the  cutpoints after maintenance.   If  it did,
the simulation assigned xm4 = IHCcm, or xm5 =  ICOcm, respectively.
Then,

    FTPijk =-kijk  fcijko + Cijkl ftij + Cijk4

         Cijk5 
-------
                                       14

where dijki is the same as in  the without mechanic  training  case.   The
d'ijko> were derived by letting

     mean FTP?       FTP'ijk(MT)
     mean FTPu   FTPijk(Mu,

                           d'ijko + dijklMT
                 dijko + dijkl MU + dijk4  IHCCu

and  solving  for d'^j^.  T and U refer  to (Portland  Study)  mechanic  training
study  trained  and  untrained,  respectively.   Thus,  the  ratio  of  predicted
trained to untrained is  the same  as the observed ratio  at  the given  levels  of
the parameters.

If d'ijko^> dijko  +  dijk4  IHCCU + dijk5  ICOCD>
d'ijko was  set e3ual  to  c^e right-hand  side  of the  above  inequality.   There
was   a   further   restriction   that   FTP'^^  ^  FTP^j^.     Both    of    the
restrictions insure  that  after maintenance FTP levels are always predicted  the
same or lower with training  than without.   Due to the small sample size in  the
Portland  mechanic  training  study,  the  derivation  of  d'ko  was  carried  out
without  stratification by  failure mode  for  the  Technology  I  vehicles.    The
estimates for d's for mechanic  training are presented  in Table 6.

The mean FTP emissions  for  the entire fleet (all four failure groups combined)
after  maintenance  for  each  pollutant  then  is  estimated   by the   equation
presented in the overview in  Section 4.5.

4.6 Deterioration

Before  the  first  inspection,  the  fleet's   mean   FTP  emissions  deteriorate
according to equations given  by MOBILE2.

Following the  first  inspection we assume  that the  fleet would  be  back at  the
MOBILE2 FTP  line mk  (k  =» 2:  FTP  HC,  3; FTP  CO)  miles after the  inspection.
The  path  of  deterioration  ^ is   then  a  straight  line  between  the   after
maintenance mean and the point  on the MOBILE2  line tnk miles after  the  first
inspection.   (See Figure  11.)  The  mileage   intervals  required to  return to
MOBILE2  lines  are  given in  Table 7.   The mileage intervals  were  predicted
based on the fleetwide means  from  the  total Portland fleets  in Elements II  and
III of the Portland Study.

After each  subsequent annual  inspection-and-repair  point,  fleet deterioration
again  follows  the  path  from  the  after  maintenance level  to  the  point  mk
miles later on the MOBILE2 line.

If  the  deterioration path defined  by this rule  would reach  the MOBILE2  line
before the next  annual inspection is  due  (as  can occur only  for  Technology I
vehicles  with  low  age  at  first  inspection) ,  a   different  path  is   taken
instead.  This other  path is a straight -line  connecting  the  after  maintenance
point and the point on the MOBILE2 line at  the next  inspection point.

-------
                                       15

 4.7  Iterations

 At  the mth inspection,  x^i (mean mileage) is given by MOBILE2 and
 x*§3  (mean FTP emissions)  are given by deterioration following the (m-l)th
 inspection.   The  sample  mileages  and  FTP  emissions  were adjusted   in  the
 following way:


          •yin.  a  TT* . f»m./v*^ •  1 = 1?'}
          xij    xij vxoj' xj''  J   •L>^>J«

 Initial estimates  for individual idle values were obtained by

t?j  -  b'jo +  b'jixft + b'j2x?2 + b'J3x»3 + b'j6 x*6;

 i =  1,... ,n;  j  = 4,5.  If 3^4 ( 0, let x?4 = 1; if x?5 ^0, let x™5 = .1
 These  regression  coefficients,  b'jo,...,  b'jg  were  derived  from  Elements  I
 and  II of  the Portland  Study using  tests  after at  least one  inspection has
 occurred  and  less than  a year  has  passed  since  the  last  inspection.   This
 sample included 63 Technology I  vehicles  and 372 Technology  II  vehicles.  The
 coefficient estimates are given  in Table 1.  Synthetic  variability around the
 regressions was obtained by  letting

                      Xm.  = vm.......  i  =  i      n •  n = A   ^
                      ij   Xlj rlj>  X    is•••!"!  J   ^>  J»

 Using   the   cutpoints  determined  at  the  first  inspection,  inspection  and
 deterioration were carried out as  above and  the simulation continued  with the
 next iteration.

 4.8  January 1st Percent Reductions

 The   twenty-year  emissions   histories  for  a  given  Technology,  stringency,
 pollutant,  and presence or absence of mechanic  training  were  produced  for ages
 of' first inspection  from one to  nineteen.   The emissions  prior to the  first
 inspection   were  those   predicted   by MOBILE2   for  the  non-I/M  fleet.   I/M
 reductions  contained  in MOBILE2 are the percent  reductions  for each model year
.from the non-I/M  fleet  to  the I/M fleet  on  January 1 of the  evaluation  year.
 The  I/M  simulation  program  needed  to  combine  portions   of the  twenty-year
 emissions  histories to produce I/M model  year average emissions  as  of January
 1.   A  detailed description of this procedure follows.

 Vehicle  sales were assumed to be  evenly distributed over the  model  year  which
 runs from October  of  the model  year minus  one  through  September of the  model
 year.   In  this discussion it will be  conveninent to refer  to  new vehicles sold
 October  1   through  December  31  as  "first-quarter vehicles" and   those  sold
 January   1   through  September   30  as   "last-three-quarters  vehicles".   To
 facilitate  this dicussion the following new terminology is  defined:

     INT      =  zero mile emission rate as  predicted  by MOBILE2
     AGEIST   =  age at which  first-quarter  vehicles  are first inspected
     E(BY)    =  mean FTP  emissions  for model  year fleet on  January  1 following
                BYth inspection of first-quarter vehicles
     TFB(BY) =  mean FTP emissions  immediately before BYth inspection
     TFA(BY) =  mean FTP emissions  immediately after  BYth inspection

-------
                                       16

    LFB(BY)  =  mean  FTP emissions immediately  before  BYth inspection  for  cars
               having  first  inspection at  age AGEIST-1
    LFA(BY)  =  mean  FTP emissions  immediately  after  BYth  inspection  for  cars
               having  first  inspection at  age AGEIST-1

The  last four of  these values  come  from  the  simulated twenty-year  emissions
'history.

AGEIST -  1

Figure  12   indicates   the  pattern  o.f  emissions  for  the  first-quarter   and
last-three-quarters  vehicles  when the  I/M  program  is  in effect  before  the
first  quarter  vehicles reach  their  first  anniversary of  sales.   On January  1
of  calendar year  MY+1 the  first-quarter  vehicles  are  an average  of  one  and
one-half  months  past their first inspection.  The  last-three-quarters  vehicles
are an average seven  and  one-half months  before  their  first inspection.   The
January 1 I/M  fleet  mean  emission levels  for AGEIST=1 were calculated  from the
twenty-year  emissions  histories  as follows:

    E(l)  =    .25  [TFA(1)+1.5(TFB(2)-TFA(1))/12]
           +  .75  [INT+7.5(TFB(1)-INT)/12],
    and,  for BY=2  to 19,

    E(BY) =    .25  [TFA(BY)+1.5(TFB(BY+1)-TFA(BY))/12]
           +  .75  [TFA(BY-1)+7.5(TFB(BY)-TFA(BY-1))/12].

AGEIST -  2 to  19

Figure  13   indicates   the  pattern  of  emissions  for  the  first-quarter   and
last-three-quarters   vehicles   when   the   I/M   program   starts   after   the
first-quarter  vehicles have  passed  the  first  anniversary of  their  original
sale  but before  the   last-three-quarters  vehicles  have  passed  their  first
anniversary.   This  case  corresponds   to  AGEIST=2.  The  first year  for which
model year MY  would  show reductions due to I/M  on January 1 would be MY+2.  On
that day  first-quarter  vehicles  would be  an average of one and one-half  months
passed  their first  inspection.   The  last-three-quarters vehicles  would  be an
average of seven and one-half months  passed their first inspection.  Note  that
the age at  first inspection for  last-three-quarters vehicles  is  one less  than
for first-quarter  vehicles.   This pattern  continues through the I/M history of
all  vehicles  with  AGEIST greater  than  one.  The  January  1  I/M  fleet  mean
emission  levels  for  model years  with AGEIST greater  than  one  were calculated
from the  twenty-year emissions histories for  BY=1  to 20-AGEIST as follows;

    E(BY) =    .25  [TFA(BY)+1.5(TFB(BY+1)-TFA(BY))/12]
               .75  [LFA(BY)+7.5(LFB(BY+1)-LFA(BY))/12]

-------
                                      17

                                      Table 1
               Regression Coefficients for Predicting Idle Emissions

Technology I            Intercept      Miles/lOK     FTP HC      FTP CO      CID

Initial Idle HC
Initial Idle CO

Subsequent Idle HC
Subsequent Idle CO

Technology II

Initial Idle HC
Initial Idle CO

Subsequent Idle HC
Subsequent Idle CO
140.37
2.3937
-131.35
.6558
11.13
.4258
-.1164
.4796
6.17
.0120
24.94
-.0206
-.165
-.0118
-2.18
-.0672
76.22
.0534
28.08
.0382
102.23
.0843
59.22
.0398
-1.18
.0472
11.20
.0642
-.32
.0608
1.31
.0655
-.30
-.0055
-1.00
-.0051
.03
-.0017
.12
-.0011

-------
                             18

                          Table 2
Estimated a^1 for Predicting After Maintenance Idle Levels


            Technology I (Pre-1975 model years)

            Idle HC                           Idle CO
a40
a41
a44
a45


340
a41
344
a45
59.396
8.2111
0.0
12.106
Technology II (1975-79 model
Idle HC
27.814
4.6612
0.0
15.517
a50
a51
354
a55
years)
Idle
a50
a51
a54
a55
-.65963
.06151
0.0
.46582

CO
-.27163
0.0
0.0
.39050

-------
                              19
                           Table 3

Estimated Cjjki's for Predicting After Maintenance FTP Levels

             Technology I (Pre-1975 model years)

C2120
C2121
C2124
C2125
C1220
C1221
C1224
C1225
C2220
C2221
C2224
C2225

FTP HC
2.8093
0.0
0.0
0.0
2.4490
-.20922
.012067
0.0
1.0398
.21054
.004185
0.0
Technology II (1975-79
FTP HC
C2120
C2121
C2124
C2125
C1220
C1221
C1224
C1225
C2220
C2221
C2224
C2225
1.0906
0.0
.00464
0.0
.80638
.21934
0.0
0.0
1.0855
.14956
.0014085
0.0
FTP CO
C2120
C2121
C2124
C2125
C1220
C1221
C1224
C1225
C2220
C2221
C2224
C2225
model years)
FTP CO
C2130
C2131
C2134
C2135
'C1230
C1231
C1234
C1235
C2230
C2231
C2234
C2235
                                                      41.933
                                                      0.0
                                                      0.0
                                                      0.0

                                                      23.007
                                                      1.3794
                                                      0.0
                                                      6.6541

                                                      43.096
                                                      0.0
                                                      0.0
                                                      0.0
                                                      16.275
                                                      0.0
                                                      0.0
                                                      28.224

                                                      14.391
                                                      1.3610
                                                      0.0
                                                      -.021437

                                                      16.379
                                                      1.7465
                                                      0.0
                                                      9.6023

-------
                             20

                           Table  4

Estimated k^j^'s for Predicting After Maintenance FTP Levels

             Technology  I  (Pre-1975 model  years)


       FTP HO                        FTP CO
               .96569               k2i3     .65245
      k122    1.0647                k123     .99755
      k222    1.1575                k223    1.0489
               Technology II (1975-79 model years)
       FTP HC                        FTP CO

      k212    1.1237                k213    1.0771
      k!22     .92395               k123     .91849
      k222    1.0792                k223    1.0095

-------
Estimated
                       21

                     Table  5

            for  Predicting  After  Maintenance  FTP  Levels

       Technology  I  (Pre-1975 model  years)
FTP
d2120
d2121
d2125
d!220
d!221
d!225
d2220
d2221
d2225
HC
2.7129
0.0
0.0
3.3706
-.11727
.15554
1.4913
.28348
.05864
FTP
d2130
d2131
d2135
d!230
d!231
d!235
d2230
d2231
d2235
CO
27.359
0.0
0.0
18.572
1.7843
3.0920
45.203
0.0
0.0
       Technology  II  (1975-79 model years)
 FTP HC

d2120
d2121
d2125

d!220
d!221
d!225

d2220
d2221
d2225
               1.3705
               .02430
               .09655

               .74506
               .20266
               0.0

               1.2137
               .16849
               .02815
 FTP CO

d2130
d2131
d2135

d!230
d!231
d!235

d2230
d2231
d2235
9.2720
0.0
11.871

13.223
1.2501
-.00769

13.902
1.7631
3.7853

-------
                                      22

                                    Table  6

        Estimated d'ij^o's for Predicting After Maintenance FTP Levels

                     Technology I (Pre-1975 model years)*


                   FTP HC                        FTP CO

               d'2Q      3.7504              d'30      37.49



                      Technology  II  (1975-79 model  years)


                   FTP HC                        FTP CO

               d'2120    1-4671              ^'2130    11.358
               d'l220    .32275              d'l230    5.1816
               d'2220    1.2418              d'2230    17.687


* As noted above,  failure mode stratifications  (ij)  was  dropped  for Technology
I.

-------
                                      23

                                    Table 7 ,

         Predicted  Mileage  Intervals (m^) for  Fleet  Mean FTP Emissions
                 to Reach Non-I/M Levels  Following Maintenance

                                             HC          CO

Technology I (Pre-1975 Model Years)           7,400      40,000

Technology II (1975-79  Model Years)         27,000      57,200

-------
                                           24
                                        Figure  1



                         HC Credits  for Technology I Vehicles

             for a 20%  Stringency  I/M Program With No Mechan'ic Training
8
§
s't
§
S"
                                                                                    o  2


                                                                                    *  3
                                                                              RGE1ST


                                                                           o  1   *  11


                                                                                  •  12


                                                                                  i  13


                                                                                  *m


                                                                                  A  15


                                                                                  v  16


                                                                                  «  17


                                                                                  A  18


                                                                                  *  19
x  5


•  6


*  7


x  8


z  9
                                                                           Y 10
2.00      4.00      6.00
                                 3.00      10.00      12.00
                                    BENEFIT YEflR
                                                         u.co
                                                                 16.00
                                                                         18.00
                                                                                 20.00

-------
                                            25
                                         Figure 2

                          CO  Credits  for Technology  I Vehicles^
              for  a 20% Stringency I/M  Program With  No Mechanic  Training
Ss
§a
a
  S
RGE1ST
a
0
*
•f
X
»
*
X
z
Y
1
2
3
4
5
6
7
8
9
10
X 11
• 12
x 13
*m
A 15
v is
« 17
A 18
« 19

          2.00
                  4.00
                          6.00
                                  8.CO      IO.CO
                                     BENEFIT
14.00
        16.CC
                        :e.aj

-------
                                             26
                                          Figure  3



                          HC Credits for Technology I Vehicles,

               for  a 20%  Stringency I/M Program With Mechanic" Training

  S
x

•z
a
LU
ce
           2.00
                   4.00
                           6.00
                                   8.00       10.00      12.00.

                                       BENEFIT  YEfiR
                                                            u.co
                                                                     16.90
                                                                             I8.CO
RGE1ST
o
0
A
X
*
*
X
z
Y
1
2
3
5
6
7
8
9
10
X 11
i 12
z 13
A 15
v 16
« 17
A 18
« 19

:s.oo

-------
                                            27
                                        Figure 4
                         CO Credits for Technology I Vehicles
               for a 20%  Stringency  I/M Program  With Mechanic^Training

a
u
IT
 §
                             RGE1ST
                          a   1    -  11
                          e   2    -12
                          *   3    x  13
                          *   4    *m
                          x   5    A 15
                          •   6    v 16
                          *   7    « 17
                          x   8    A 18
                          z   9    • 19
                          Y 10
          2.00
                  4.00
                          6.00
                                  8.CO      10.00     I2.CO
                                     BENEFIT YEflR
u.oo
        16.CO
                18.CO
:c.:a

-------
                                          Figure  5
                          HC  Credits  for Technology II Vehicles
               for a 20^  Stringency  I/M Program With No Mecharfic Training
5s
a
LU
ce

          2.CO
                  4.00
                          s.oo
8.00      10.00      i:.co
   BENEFIT YEflR
                                                          u.co
                                                                  I6.CO
                                                                          18.CC
                                                      RGEIST
                                                   a  1   x 11
                                                          • 12
                                                          * 13
                                                      14   *i4
                                                          * 15
                                                          v is
                                                          o 17
                                                   x  8   A is
                                                   z  9   ^ 19
                                                   Y 10
e  2
*  3
*
x  5
•  6
»  7
                                                                                  2100

-------
                                              29
                                          Figure 6

                       ' .   CO Credits  for Technology II Vehicles
               for  a  20%  Stringency I/M Program With No  Mechanic Training

SB
5s
a
          2.00
                  4.CO
                          6.00
3.03      10.00      12.00
   BENEFIT YEflR
                                                          14.00
                                                                  IS.OO
                                                                          18.00
                                                                                       RGE1ST
o
0
*
+
X
*
*
X
z
Y
1
2
3
4
5
6
7
3
9
10
X 11
» 12
x 13
*14
A IS
v 16
9 17
A 18
• 19

                                                                                  20.00

-------
                                           30
                                        Figure  7



                         HC Credits  for Technology  II Vehicles

               for a  20% Stringency I/M Program With Mechanic* Training
  S
  g
  §
  8
gs
a
LJ
cr
                                                                                      RGE1ST
 §
 3
 §
 g.

 "too
                                                                          0  1



                                                                          a  2



                                                                          *  3



                                                                          +  4



                                                                          x  5



                                                                          •  6



                                                                          *  7



                                                                          x  8



                                                                          z  9



                                                                          Y 10
X 11



* 12



i 13






A 15



* 16


o 17



A 18



* 19
2-Cfl
                  4.00
                          S.CO
                                  8.00      10.00

                                     BENEFIT YEfiR
                                                         u.cc
                                                                 I6.BO
                                                                       2c.:o

-------
                                       Figure  8

                        CO  Credits for  Technology  H  Vehicles
              for a 20%  Stringency I/M Program With  Mechanic.Training
3
3
3
5t
§
at
3
St
                                                                                     RGE1ST
                                                          o  1

                                                          o  2

                                                          *  3



                                                          x  5

                                                          •  6

                                                          »  7

                                                          x  8

                                                          z  9

                                                          Y 10
* 11

• 12

x 13



A 15

v 16

* 17

A 18

« 19
§.... -_
"too
         2.00
e.co      3.:c      •:.::      t:.cc      ^.c:      is.oc      :s.ca
           BENEFIT  >ESS

-------
                                  32

                               Figure 9
                I/M Percent Reductions from January 1,  1988
                     HC Emission Levels Without I/M *
                          MOB1LE1 VS  MOBILES
 80
 75
 70
 65
u60
««
250
oHO
UJ
(=35
£30
£25
£20
"-15
  10
   5
   0
MOBILE2-NO MT
MOBILE2-MT
M08ILE1-NO MT
MOBILE1-MT
                                                80
                                                75
                                                70
                                                65
                                                60
                                                55
                                                50
                                                45
                                                40
                                                35
                                                30
                                                25
                                                20
                                                15
                                                10
                                                 5
                                                 0
       10
20            30
       STRINGENCY
            50
                                          1X3
     * Assumes LDV only  I/M program beginning  January 1,  1983;  Percent
     reduction in Technology I and II total non-evaporative HC emissions
     from LDVs.

-------
                                   33

                                Figure 10
                 I/M Percent Reduction from Janury 1,  1988
                     CO Emission Levels Without I/M*
                           MOBIIE1  YS HOBILE2
 80
 75
 70
 85
o60
u
z55
250
oUO
UJ
<=35
£30
£25
£20
  10
   5
   0
          M08ILE2-NO MT
          MOBILE2-MT
      	 M081LE1-NO MT
      +***- MOBILE1-MT
     80
     75
     70
     65
     60
     55
     50
     45
     40
     35
     30
     25
     20
     15
     10
       5
       0
       10
20            30
       STRINGENCY
50
                                          (X)
      * Assumes LDV only I/M program beginning January 1, 1983.  Percent
      reduction in Technology I and II CO emissions from LDVs.

-------
                                                      Figure 11

                                             Fleet Deterioration Methodology
Fleet
 FTP
Mean
             Reduction
             Due  to
            Maintenance
MOBILE2
(Non-I/M)
                                                                                                                       CJ
                               De terioration
                                                 Inspections

-------
                                              Figure  12
                           Emission Histories — Age At  First  Inspection:  1
Emissions
                                                                    Last  Three

                                                                  Quarters Vehicles
  First


Quarte
     X"

     Vehicles
                                                                                                                CO
                                                                                                                01
                                                                                             Time
          1/1/MY
                        1/1/MY+l
l/l/MY+2

-------
                                          Figure  13
                        Emissions Histories —  Age At First Inspection:  2
Emissions
                                                                 Last Three
                                                                Quarter s Vehicles
                                                                                                            00
                                                                                         Time
                                                                                 1/1 /MY+2

-------
         37
        Appendix:






Computer Program Listing

-------
                                    38
C
C                   THE NEW APPENDIX N PROGRAM
C                      DESIGNED AND DEVELOPED
C           BY THE TECHNICAL AND ANALYTICAL SUPPORT GROUP
C                             I/M STAFF
C                        2565 PLYMOUTH ROAD
C                       ANN ARBOR, MICHIGAN
C
        INTEGER FIRST,AGE,ITECH,ISTRIN,MT
C
C      TO CREATE A COMPLETE MATRIX OF PERCENT EMISSION REDUCTIONS
C      RESULTING FROM AN I/M PROGRAM, THE I/M PORTION OF THE
C      VEHICLES' LIFE IS RUN ONCE FOR EACH SETUP OF THE I/M PROGRAM.
C      2 TECHNOLOGIES (ITECH)
C      5 STRINGENCY CUTPOINTS (ISTRIN)
C      0% AND 100% MECHANICS TRAINING (MT)
C      19 VEHICLE AGES OF FIRST I/M INSPECTION (FIRST)
C
      DO 30 ITECH=1,2
C
        DO 30 ISTRIN=1,5
C
          DO 30 MT=1,2
C
            DO 30 FIRST=1,19
C                                          ;
C           STEP 1
C             READ IN AND INITIALIZE VARIABLES
C
              CALL INIT(FIRST,MT,ISTRIN,ITECH)
C
C           STEP 2
C             GO THROUGH THE I/M PORTION OF THE VEHICLES'  LIFE
C
              DO 20 AGE=FIRST,19
                CALL SETUP(FIRST,AGE)
                CALL INSPCT(AGE)
                CALL MNTNCE(AGE)
                CALL DTRATN(AGE) ,
  20          CONTINUE
C
C           STEP 3
C             NOW THAT WE HAVE THE FLEET AVERAGE EMISSIONS FOR EVERY
C            YEAR, CALCULATE THE AVERAGE EMISSIONS AND PERCENT
c             REDUCTIONS; >ON JANUARY i.
c
              CALL GETPR
C           STEP 4
C             STORE THE JANUARY 1  REDUCTIONS IN THE MATRIX
C             FOR INTERFACE WITH MOBILE2

-------
                                   39
C
              CALL MATRIX(MT,ISTRIN,ITECH)
C
 30   CONTINUE
      END

-------
                                    40
      SUBROUTINE INIT(FIRST,MT,ISTRIN,ITECH)
c
c
c
c
c
c
c
c
c
c
c
c



c
c
c
c
c
c
c
c
c
c
c
c
c
c
c
c
c


THE 'SAMPLE1 COMMON BLOCK CONTAINS ALL THE INITIAL VEHICLE DATA
THE MAXIMUM NUMBER

VARIABLE
ODOM(I)

FTP1ST(I,P)
IDLE1ST(I,P)
CID(I)
PY(I)
MY(I)
COMMON/SAMPLE/ODOM,
INTEGER*4 C ID (267 8)
REAL IDL1ST(2678,2)

OF CARS IS 2678

DESCRIPTION '
THE ODOM READING FOR THE ITH CAR
ALL ODOMETER READINGS ARE IN 10K MILES
FTP LEVEL FOR THE ITH CAR, PTH POLLUTANT
IDLE LEVEL FOR THE ITH CAR, PTH POLLUTANT
CID FOR THE ITH CAR
PROGRAM YEAR
MODEL YEAR
FTP1ST,IDL1ST,CID,PY,MY
,PY(2678),MY(2678)
,FTP1ST(2678,2),ODOM(2678)

THE 'CARS' COMMON BLOCK CONTAINS ALL THE ADJUSTED VEHICLE DATA
THE MAXIMUM NUMBER

VARIABLE
NCARS

ADJMIL(I)

FTP(I,P)
IDLE(I,P)
IDLRAT(I,P)

AVODOM(PY,MY)



OF CARS IS 2678

DESCRIPTION
NUMBER OF CARS IN THIS SAMPLE
MUST LESS THAN OR EQUAL TO 2678
THE ADJUSTED ODOM READING FOR THE ITH CAR
ALL ODOMETER READINGS ARE IN 10K MILES
FTP LEVEL FOR THE ITH CAR, PTH POLLUTANT
IDLE LEVEL FOR THE ITH CAR, PTH POLLUTANT
IDLE RATIO OF (ACTUAL IDLE) /(PREDICTED IDLE)
USING ORIGINAL MILEAGE AND FTP'S
AVERAGE ODOMETER READING MODEL AND PROGRAM YR
THERE ARE A MAXIMUM OF 15 PROGRAM YEARS
AND 8 MODEL YRS

      COMMON/CARS/NCARS,ADJMIL,FTP,IDLE,IDLRAT,AVODOM,AVFTP
      REAL*4    FTP(2678,2),IDLE(2678,2),ADJMIL(2678),
     +AVODOM( 15,8),IDLRAT(2678, 2) ,AVFTP( 15,8, 2)
      INTEGER NCARS
C
C     THE 'BKGRND' COMMON BLOCK CONTAINS BACKGROUND INFORMATION
C     NEEDED TO DEFINE THE I/M PROGRAM
C
C     VARIABLE          DESCRIPTION
C     TECH              TECHNOLOGY NUMBER
C     AGE1ST            AGE OF VEHICLES AT FIRST INSPECTION
C     MTP(BY)           MECHANIC TRAINING PERCENT AT BENEFIT YEAR 'BY'
C     CUTPTS(BY,P)      IDLE CUTPOINTS AT BENEFIT YEAR 'BY'
C                       FOR POLLUTANT 'P'
C     ESTSF             ESTIMATED STRINGENCY FACTOR
C     TABLES            LOGICAL VARIABLE TO SUPRESS OUTPUT OF TABLES
C
      COMMON/BKGRND/TECH,AGE1ST,MTP,CUTPTS,ESTSF,TABLES
      INTEGER*4 TECH,AGE1ST,ESTSF
      REAL*4    CUTPTS(2,2,19,5),-MTP(20)
      LOGICAL TABLES

-------
                                   41
C
C     THE 'MOB' COMMON BLOCK CONTAINS THE MOBILE2 .ESTIMATES
C     OF MILEAGE AND FTP EMISSION LEVELS
C     FOR EACH TECHNOLOGY BY AGE OF VEHICLE
C
C     THESE VARIBALES ARE ALL INITIALIZED IN A BLOCK DATA STATEMENT
C
C     VARIABLE                  DESCRIPTION
C     MILES(AGE)                ESTIMATED MILEAGE AT AGE 'AGE1
C     MOBFTP(AGE,P,TECH)        ESTIMATED FTP LEVEL AT AGE 'AGE1,
C                               TECHNOLOGY 'TECH' AND POLLUTANT 'P'
C     JMILES(AGE)               MILEAGE ON JAN 1 CY, WHERE AGE=CY-MY
C     JFTP(AGE,P,TECH)          NON I/M FLEET FTP ON JAN 1
C     INT(P,TECH)               MOBILE2 INTERCEPTS
C     SLOPE(P,TECH)             MOBILE2 SLOPES FOR EMISSIONS
C     STND(P,TECH)              FTP STANDARDS
C
      COMMON /MOB/ MILES, MOBFTP, JMILES, JFTP, INT, SLOPE, STND
      REAL*4 MILES(20), MOBFTP(20,2,2), JMILES(20), JFTP(20,2,2),
     1       INT(2,2), SLOPE(2,2), STND(2,2)
C     'MEANS' COMMON BLOCK CONTAINS MEAN MILEAGE,FTPHC ,FTPCO
C     WE HAVE TO MAKE OUR SAMPLE AGREE WITH THESE MEANS
C
C     VARIABLE              DESCRIPTION
C     MODOM                 MEAN ODOMETER
C     MFTP(P)               MEAN FTP FOR POLLUTANT  'P'
C                                                  •             '
      COMMON/MEANS /MODOM,MFTP
      REAL*4 MODOM,MFTP(2)
C
       REAL NOODOM(15,8)
      INTEGER FIRST,P,AGE,EVAL,UNIT
C
C     STEP 1
      AGE1ST=FIRST
      IF (.NOT.(dSTRIN.EQ.l)
     &    .AND.(MT.EQ.1).AND.(AGE1ST.EQ.1)))  GO TO 20
C
C     READ IN THE INITIAL SAMPLE OF VEHICLES
C     THE FIRST TIME THRU
C
C
       DO  5 1=1,15
         DO  5 J-1,8
           AVODOM(I,J)=0
           NOODOM(I,J)=0
           DO  5 P-1,2
             AVFTP(I,J,P) = 0.0
 5      CONTINUE
C  .
C
       READ(6,7) NCARS,TABLES
    7  FORMAT(14,L4)

-------
                                    42
C
      UNIT=7
     . IF(ITECH .EQ. 2) UNIT=8
C
       DO 16 I-l.NCARS
         READ(UNIT,10) ODOM(I),FTP1ST(I,1),FTP1ST(I,2),
     &                      IDL1ST(I,1),IDL1ST(I,2),
     &               CID(I),PY(I),MY(I)
C
 10      FORMAT(F8.5,F5.2,F6.2,F5.0,F5.2,I3,1X,I1,1X,I1)
C
 14      AVODOM(PY(I),MY(I))=AVODOM(PY(I),MY(I))+ODOM(I)
         NOODOM(PY(I),MY(I))=NOODOM(PY(I),MY(I))+1
         DO 16 P-1,2
           AVFTP(PY(I),MY(I),P) = FTP1ST(I,P) + AVFTP(PY(D, MY(D, P)
16    CONTINUE
C
C
C
C
       DO 18 1-1,15
         DO 18 J-1,8
           IF (NOODOM(I,J).EQ.O) GO TO 18
           AVODOM(I,J)=AVODOM(I,J)/NOODOM(I,J)
           DO 18 P-1,2
            AVFTP(I,J,P)=AVFTP(I,J,P)/NOODOM(I,J)
   18 CONTINUE
C
C     STEP 2
C     DEFINE THE BACKGROUND INFORMATION FOR THIS I/M PROGRAM
C
   20 CONTINUE
      DO 21 P=l,2
      DO 21 I=1,NCARS
      IDLE(I,P) - IDL1ST(I,P)
      FTP(I,P) = FTPIST(I.P)
21    CONTINUE
      TECH = ITECH
      ESTSF = ISTRIN * 10
      DO 25 1=1,20
      MTP(I) » MT - 1.
25    CONTINUE
 30   MODOM=MILES(AGE1ST)
      DO 35 P-1,2
 35      MFTP(P)=MOBFTP(AGE1ST,P,TECH)
C
C     STEP 4
C
C     SET UP THE NON I/M PORTION OF THE VEHICLES' LIFE
C     AND WRITE OUT ALL THE NON I/M EMISSION VALUES
      IF(.NOT.TABLES) GO TO 99
      WRITE(1,10 0)TECH,ESTSF
      WRITE(2,200)TECH,ESTSF
      WRITE(3,300)TECH,ESTSF

-------
                                     43


C     IF(AGElST.EQ.l) GO TO 41
C     LAST=AGE1ST-1
C     DO 40 AGE=1,LAST
C       WRITEC1,101)AGE,MILES(AGE),(MOBFTP(AGE,P,TECH),P=1,2)
C       WRITE(2,201)AGE
C     EVAL=AGE-1
C       WRITE(3,301)EVAL,JMILES(AGE),(JFTP(AGE,P,TECH),P=1,2)
C  40 CONTINUE
C  41 AGE=AGE1ST
C     EVAL=AGE-1
C       WRITE(3,301)EVAL,JMILES(AGE))(JFTP(AGEJP,TECH),P=1,2)
C
 100  FOKMATC-' ,T55, 'I/M SIMULATION PROGRAM ' ,T118, 'TECHNOLOGY' ,I3/
     &T61,'TABLE 1',T100,'ESTIMATED',13,'% STRINGENCY FACTOR'/,'  ',
     &T51,'FTP AVERAGES AT EACH INSPECTION1/,'0',
     &T40,'I/M FLEET',T64,'PASSED  CARS',T89,'FAILED CARS',/
     &T1, ' + ' ,T28,34C I),T64,11('_I),T78,34('_1)/
     &T53,'REDUCTION'7T103,'REDUCTION    %' ,T125, 'IDLE'/
     &T17,'NON I/M',T30,'BEFORE',T44,'AFTER',T54,'DUE TO',
     &T80,'BEFORE'  ,T94,  'AFTER1 ,T104, 'DUE TO1',
     &T114,'MECH',T122,'CUTPOINTS'/
     &T3,'AGE  MILES',T18,'FLEET',T30,'MNTNCE1,T43,'MNTNCE',
     &T54,'MNTNCE',T80,'MNTNCE',T93,'MNTNCE',
     &T10 4,'MNTNCE  TRAINING'/
     &T1,'(YRS) (10K)',T15,'HC     CO     HC    CO     HC    CO',
     &4X,'HC  CO      HC    CO     HC    CO     HC    CO',
     &4X,'HC  CO',T123,'HC    CO')
C
C101  FORMAT(I4,F7.1,2(3(F7.2,F6.1),I5,I4,2X),F6.2,F8.0,F5.1)
C
C
 200  FORMATC-' ,T55, 'I/M SIMULATION PROGRAM' ,T118, 'TECHNOLOGY' ,I2,/
     &T61,'TABLE2',T99,'ESTIMATED',13,'% STRINGENCY FACTOR1,/
     &T1,' ',T54,'FAILURE AND ERROR RATES'/
     &T1,'0',T55,'ERRORS OF',T77,'ERRORS OF',T97,'%',T108,'IDLE',/
     &T22,'AGE',T32,'FAILURE RATE',T56,'OMISSION',T77,'COMMISSION',
     &T95,'MECH' ,T104, 'CUTPOINTS'/
     &T1,'+',T32,12('_'),T54,12('_'),T76,12('_'),/
     &T21,'(YRS)',T27,3C     HC   CO BOTH     '),
     &T93,'TRAINING',T106,'HC   CO1//)
C
C201  FORMAT(T21,I3,3X,3(F7.2,F5.2,F5.2,5X)>F5.2>F10.0,F5.1)
C
C
 300  -FORMATC-' ,T55,'I/M SIMULATION PROGRAM ' ,T118, 'TECHNOLOGY' ,13/
     &T61,'TABLE 3',T100,'ESTIMATED',13,'% STRINGENCY FACTOR'/,'  ',
     &T49,'EMISSION INVENTORIES ON JANUARY I'/
     &T4 9,'FOR I/M PROGRAM' STARTING JANUARY 1'/, '0 ' ,
     &T47,'NO  I/M',T69,'I/M',T84,'PERCENT',T103,'%'/
     &T25,'AGE',T34,'MILES',T83,'REDUCTION',T101,'MECH'/
     &T24,'(YRS)',T33,'(10K)',T46,'HC',T53,'CO',T66,'HC',
     &T73,'CO',T83,'HC',T90,'CO1,T100,'TRAINING'/,'+',T24,5('_'),
    .&T33,5('_'),T45,4('_' ),T52,4('_'),T65,4('_'),T72,4( '_'),
    '&T83,2(I_I),T90,2(I_I),T100,8(I_1))

-------
                                     44

C
C 301  FORMAT(T26,I2,T33,F5.1,T44,F5.2,T51,F5.1,T64,F5.2)
C    &  T71,F5.1,T81,F4.2,T88,F4.2,T103,F3.2)
C
C
 400  FORMATd1 ,T55,'I/M SIMULATION PROGRAM ' ,T118, 'TECHNOLOGY' ,137
     &T61,'TABLE 4' ,T100, 'ESTIMATED1 ,13, '7, STRINGENCY FACTOR'/,'0',
     &T51,'EMISSION INVENTORIES ON JULY I'/
     &T51,'FOR I/M PROGRAM STARTING JULY 1'/,'-',
     &T47, 'NO  I/M'.Teg, 'I/M',T8-4, 'PERCENT1 ,T103, '%'/
     &T25,'AGE',T34,'MILES',T83,'REDUCTION',T101,'MECH'/
     &T24,'(YRS)',T33,'(10K)',T46,'HC',T53,'CO',T66,'HC',
     &T73,'CO',T83,'HC',T90,'CO1,T100,'TRAINING1/,'+',T24,5('_'),
     &T33,5('_' ),T45J4('_'),T52,4('_'),T65,4( '_'),T72,4( '_'),
     &T83,2('_I),T90,2(I_'),T100>8(1 '))
C
 99    RETURN
C
       END

-------
                                      45
      SUBROUTINE SETUP(FIRST,AGE)
C
C
C     THE 'BKGRND' COMMON BLOCK CONTAINS BACKGROUND INFORMATION
C     NEEDED TO DEFINE THE I/M PROGRAM
C
C     VARIABLE          DESCRIPTION
C     TECH              TECHNOLOGY NUMBER
C     AGE1ST            AGE OF VEHICLES AT FIRST INSPECTION
C     MTP(BY)           MECHANIC TRAINING PERCENT AT BENEFIT YEAR 'BY'
C     CUTPTS(BY,P)      IDLE CUTPOINTS AT BENEFIT YEAR 'BY'
C                       FOR POLLUTANT  'P'
C     ESTSF             ESTIMATED STRINGENCY FACTOR
C     TABLES            LOGICAL VARIABLE TO SUPRESS OUTPUT OF TABLES
C
      COMMON/BKGRND/TECH,AGE1ST,MTP,CUTPTS,ESTSF,TABLES
      INTEGER*4 TECH,AGE1ST,ESTSF
      REAL*4    CUTPTS(2,2,19,5),MTP(20)
      LOGICAL TABLES
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C

THE 'CARS

' COMMON BLOCK CONTAINS ALL THE ADJUSTED VEHICLE DATA
THE MAXIMUM NUMBER OF CARS IS 2678

VARIABLE
NCARS

ADJMIL(I)

FTP(I.P)
IDLE(I,P)
IDLRATd,

AVODOM(PY




DESCRIPTION
NUMBER OF CARS IN THIS SAMPLE
MUST LESS THAN OR EQUAL TO 2678
THE ADJUSTED ODOM READING FOR THE ITH CAR
ALL ODOMETER READINGS ARE IN 10K MILES
FTP LEVEL FOR THE ITH CAR, PTH POLLUTANT
IDLE LEVEL FOR THE ITH CAR, PTH POLLUTANT
P) IDLE RATIO OF (ACTUAL IDLE) /(PREDICTED IDLE)
USING ORIGINAL MILEAGE AND FTP'S
,MY) AVERAGE ODOMETER READING MODEL AND PROGRAM YR
THERE ARE A MAXIMUM OF 15 PROGRAM YEARS
AND 8 MODEL YRS

      COMMON/CARS/NCARS,ADJMIL,FTP,IDLE,IDLRAT,AVODOM.AVFTP
      REAL*4    FTP(2678,2),IDLE(2678,2),ADJMIL(2678),
     +AVODOM(15,8),IDLRAT(2678,2),AVFTP(l5,8,2)
      INTEGER NCARS
C     'MEANS' COMMON BLOCK CONTAINS MEAN MILEAGE,FTPHC ,FTPCO
C     WE HAVE TO MAKE OUR SAMPLE AGREE WITH THESE MEANS
C
C     VARIABLE              DESCRIPTION          ., ,
C     MODOM                 MEAN ODOMETER
C     MFTP(P)               MEAN FTP FOR POLLUTANT 'P'
C
      COMMON/MEANS/MODOM,MFTP
      REAL*4 MODOM,MFTP(2)
C
C     THE 'SAMPLE' COMMON BLOCK CONTAINS ALL THE INITIAL VEHICLE DATA
C     THE MAXIMUM NUMBER OF CARS IS 2678

-------
                                    46

C
C     VARIABLE            DESCRIPTION
C     ODOM(I)             THE ODOM READING FOR THE ITH CAR
C                         ALL ODOMETER READINGS ARE IN 10K MILES
C     FTP1ST(I,P)            FTP LEVEL FOR THE ITH CAR, PTH POLLUTANT
C     IDLE1ST(I,P)           IDLE LEVEL FOR THE ITH CAR, PTH POLLUTANT
C     CID(I)              CID FOR THE ITH CAR
C     PY(I)               PROGRAM YEAR
C     MY(I)               MODEL YEAR
      COMMON/SAMPLE/ODOM,FTP1ST, IDL1ST ,"C ID, PY, MY
      INTEGER*4 CID(2678),PY(2678),MY(2678)
      REAL IDL1ST(2678,2),FTP1ST(2678,2),ODOM(2678)
C
C
C
C
C
C
      INTEGER P,FIRST,AGE,T
      REAL LEVEL
      REAL SMALL(2),RATIO(3),BETA(5,2,2,2)
C     BETA(1-5,HC/CO,INITIAL/AFTER MAINTENANCE,TECH)
      DATA SMALL/1.0,.01/
C
      DATA BE-TA/140.36, 6.17, 76.32, -1.18, -.30,
     &          2.3972, .0120, .0532, .0472, -.0055,
     &          -131.35, 24.94, 28.08, 11.20, -1.00,
     &          .6558, -.0206, .0382, .0642, -.0051,
     &           11.12,-1.65,102.23,-.32,.03,
     &          .4258,-.0118,.0843,.0681,-.0017,
     &          -11.64,-2.18,59.22,1.31,.12,
     &          .4796,-.0672,.0398,.0655,-.001I/
C
C	STEP 1
C	DO ALL THE INITIAL PROCESSING FOR THE FIRST SETUP
C
      IF(FIRST.NE.AGE) GO TO 15
      T=l
       IF(FIRST .NE.  1) GO TO 11
      DO 10 I=1,NCARS
C
      DO 10 P-1,2
C
C     STEP 1.2
C     FIND PREDICTED IDLE BASED ON ACTUAL FTP'S AND MILEAGE
C     COMPUTE 'IDLRAT' : ACTUAL/PREDICTED
      PREDCT = AMAX1(SMALL(P), ( BETA(1,P,T,TECH) +
     &               ....           BETA(2,P,T,TECH)*ODOM(I) +
     &                           BETA(3,P,T,TECH)*FTP(I,1)  +
     &                           BETA(4,P,T,TECH)*FTP(I,2)   +
     &                           BETA(5,P,T,TECH)*CID(I)    ))
      IDLRAT(I,P)= IDLE(I,P) /PREDCT
   10 CONTINUE

-------
                                      47
   11 DO 12 1=1,NCARS
C     STEP 1.1
C     ADJUST THE MILEAGES SO THAT THE FLEET AVERAGE ODOM
C     EQUALS THE'TARGET MEAN 'MODOM'
      ADJMIL(I)=ODOM(I)*MODOM/AVODOM(PY(I),MY(I))
C
      DO 12 P=l,2
C     STEP 1.3
C     ADJUST FTP ACCORDING TO PY, MY STRATIFICATION"
      FTP(I,P) » FTP(I.P) * MFTP(P) / AVFTP(PY(l), MY(I), P)
 12   CONTINUE
      GO TO 31
C
C
C	STEP 2
C	DO ALL THE PROCESSING NEEDED WHEN ITS NOT THE FIRST TIME THROUGH
 15   T=2
C     STEP 2.1
C     ADJUST THE MILEAGES SO THAT THE FLEET AVERAGE ODOM
C     EQUALS THE TARGET MEAN 'MODOM1
      RATIO(3)=MODOM/AVER(NCARS,ADJMIL)
 20   DO 25 1=1,NCARS
      ADJMIL(I)=ADJMIL(I)*RATIO(3)
 25   CONTINUE
C
C
C	STEP 3
C	EVERYBODY GOES THROUGH THIS PART
C     STEP 3.1
C     ADJUST THE FTP'S SO THAT THE AVERAGE FLEET FTP'S
C     EQUAL THE TARGET MEANS 'MFTP'
 31   DO 32 P-1,2
 32      RATIO(P)=MFTP(P)/AVER(NCARS,FTP(1,P))
      DO 35 1=1,NCARS                    :
      DO 35 P-1,2
         FTP(I,P)=FTP(I,P)*RATIO(P)
C
C     STEP 3.2
C     ADUST THE IDLE LEVELS
      LEVEL = BETA(1,P,T,TECH) +
     &  BETA(2,P,T,TECH)*ADJMIL(I) +
     &  BETA(3,P,T,TECH)*FTP(I,1) +
     & BETA(4,P,T,TECH)*FTP(I,2)  +
     & BETA(5,P,T,TECH)*CID(I)
      IF(LEVEL.GT.SMALL(P)) GOTO 33
        LEVEL = SMALL(P)
 33   CONTINUE
      IDLE(I.P) = IDLRAT(I,P) * LEVEL
 35   CONTINUE
C
 99   RETURN
      END

-------
                                    48


      SUBROUTINE INSPCT(AGE)
C
C     THE 'CARS' COMMON BLOCK CONTAINS ALL THE ADJUSTED VEHICLE DATA
C     THE MAXIMUM NUMBER OF CARS IS 2678
C
C     VARIABLE            DESCRIPTION
C     NCARS               NUMBER OF CARS IN THIS SAMPLE
C                         MUST LESS THAN OR EQUAL TO 2678
C     ADJMIL(I)           THE ADJUSTED ODOM READING FOR THE ITH CAR
C                         ALL ODOMETER READINGS ARE IN 10K MILES
C     FTP(I,P)            FTP LEVEL FOR THE ITH CAR, PTH POLLUTANT
C     IDLE(I,P)           IDLE LEVEL FOR THE ITH CAR, PTH POLLUTANT
C     IDLRAT(I,P)         IDLE RATIO OF (ACTUAL IDLE)/(PREDICTED IDLE)
C                         USING ORIGINAL MILEAGE AND FTP'S
C     AVODOM(PY,MY)       AVERAGE ODOMETER READING  MODEL AND PROGRAM YR
C                         THERE ARE A MAXIMUM OF 15 PROGRAM YEARS
C                             AND 8 MODEL YRS
C
      COMMON/CARS/NCARS,ADJMIL,FTP,IDLE,IDLRAT,AVODOM.AVFTP
      REAL*4    FTP(2678,2),IDLE(2678,2),ADJMIL(2678),
     +AVODOM(15,8),IDLRAT(2678,2),AVFTP(15,8,2)
      INTEGER NCARS
C     'MEANS' COMMON BLOCK CONTAINS MEAN MILEAGE,FTPHC ,FTPCO
C     WE HAVE TO MAKE OUR SAMPLE AGREE WITH THESE MEANS
C
C     VARIABLE              DESCRIPTION
C     MODOM                 MEAN ODOMETER
C     MFTP(P)               MEAN FTP FOR POLLUTANT 'P1
C
      COMMON/MEANS /MODOM,MFTP
      REAL*4 MODOM,MFTP(2)
C
C     THE 'BKGRND' COMMON BLOCK CONTAINS BACKGROUND INFORMATION
C     NEEDED TO DEFINE THE I/M PROGRAM
C
C     VARIABLE          DESCRIPTION
C     TECH              TECHNOLOGY NUMBER
C     AGE1ST            AGE OF VEHICLES AT FIRST INSPECTION
C     MTP(BY)           MECHANIC TRAINING PERCENT AT BENEFIT YEAR 'BY'
C     CUTPTS(BY.P)      IDLE CUTPOINTS AT BENEFIT YEAR 'BY'
C                       FOR POLLUTANT 'P1
C     ESTSF             ESTIMATED STRINGENCY FACTOR
C     TABLES            LOGICAL VARIABLE TO SUPRESS OUTPUT OF TABLES
C
      COMMON/BKGRND/TECH.AGEIST,MTP,CUTPTS,ESTSF,TABLES
      INTEGER*4 TECH,AGE1ST,ESTSF
      REAL*4    CUTPTS(2,2,19,5),MTP(20)
      LOGICAL TABLES
C
C     THE 'MOB' COMMON BLOCK CONTAINS THE MOBILE2 ESTIMATES
C     OF MILEAGE AND FTP EMISSION LEVELS
C     FOR EACH TECHNOLOGY BY AGE OF VEHICLE

-------
                                     49
C
C     THESE VARIBALES ARE ALL INITIALIZED IN A BLOCK DATA STATEMENT
C
C     VARIABLE                  DESCRIPTION
C     MILES(AGE)                ESTIMATED MILEAGE AT AGE  'AGE1
C     MOBFTPCAGE,P,TECH)        ESTIMATED FTP LEVEL AT AGE  'AGE1,
C                               TECHNOLOGY 'TECH' AND POLLUTANT  'P1
C     JMILES(AGE)               MILEAGE ON JAN 1 CY, WHERE AGE=CY-MY
C     JFTP(AGE,P,TECH)          NON I/M FLEET FTP ON JAN 1
C     INT(P,TECH)               MOBILE2 INTERCEPTS
C     SLOPE(P.TECH)             MOBILE2 SLOPES FOR EMISSIONS
C     STND(P,TECH)              FTP STANDARDS
C
      COMMON /MOB/ MILES, MOBFTP, JMILES, JFTP, INT, SLOPE, STND
      REAL*4 MILES(20), MOBFTP(20,2,2), JMILES(20)j JFTP(20,2,2),  •
     1       INT(2,2), SLOPE(2,2), STND(2,2)
C
C     'HSTRY1 COMMON BLOCK CONTAINS EMISSION HISTORY THROUGHOUT PROGRAM
C
C     VARIABLE                   DESCRIPTION
C     TFB(AGE,P)                 .TOTAL FLEET FTP BEFORE INSPECTION
C     TFA(AGE.P)                 TOTAL FLEET FTP AFTER INSPECTION
C     F                          F=l PASSED THE TEST
C                                 =2 FAILED FOR HC ONLY
C       .                          =3 FAILED FOR CO ONLY
C                                 =4 FAILED FOR BOTH
C     NF(F)                      NUMBER IN EACH GROUP
C     TOTFTP(P,F)                TOTAL FTP IN EACH GROUP
C     PR(P,BY)                   PERCENT REDUCTION ON JANUARY 1ST
C     AVGMIL(F)         .         AVERAGE MILEAGE FOR FAILURE GROUP
C
      COMMON/HSTRY/ TFB,TFA,NF,TOTFTP,AVGMIL,PR
      REAL*4 TFB(20,2),TFA(20,2),TOTFTP(2,4),AVGMIL(4)
      INTEGER*4 NF(4),PR(2,2 0)
C
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
C
      LOGICAL*! PASS(2,3)
      INTEGER*2 NFAIL(3),NEO(3),NEC(3),FTEST,ITEST,TEST,HC,CO,P,FGRP
      INTEGER*4 AGE
      REAL*4 FR(3),EC(3),EO(3)
C
C     VARIABLE          DESCRIPTION
C     PASS(FTEST,HC)    TRUE IF CAR PASSES FTP HC
C     PASS(ITEST,HC)   TRUE IF CAR PASSES IDLE HC                     •
C     PASS(FTEST,CO)    TRUE IF CAR PASSES FTP CO
C     PASS(ITEST,CO)   TRUE IF CAR PASSES IDLE CO
C     NFAIL(HC)         NUMBER OF CARS FAILING IDLE HC
C     NFAIL(CO)         NUMBER OF CARS FAILING IDLE CO
C     .NFAIL(TEST)       NUMBER OF CARS FAILING IDLE TEST
C     FR(P)                      FAILURE RATE P:l HC,  2 CO,  3 OVERALL
C     EC(P)                      ERRORS OF COMMISSION
C     EO(P)                      ERRORS OF OMISSION

-------
                                    50
      FTEST=1
      ITEST=2
      HC-1
      C0=2
      TEST«=3
C
C     STEP 1
C     INITIALIZE
      ISTRIN=ESTSF/10
      DO 10 P-1,3
        NFAIL(P)=0
        NEC(P)=0
        NEO(P)=0
        FR(P)=0
        EC(P)=0
        EO(P)=0
 10   CONTINUE
C
        DO 11 FGRP-1,4
          NF(FGRP)=0
          AVGMIL(FGRP) =0.0
      DO 11 P-1,2
          TOTFTP(P,FGRP)=0
 11   CONTINUE
C
C
C     STEP 2
C     FIND OUT WHO PASSED AND WHO FAILED
      DO 29 I=1,NCARS
        DO 13 J-1,2
          DO 13 K-1,3
 13         PASS(J,K) = .TRUE.
        FGRP=0
        DO 25 P-1,2
C
C     DID THEY PASS FTP FOR THIS POLLUTANT?
          IF(FTP(I,P).LT.STND(P,TECH))GO TO 22
            PAS S (-FTEST, P ) =. FALSE.
            PASS(FTEST,TEST) = . FALSE.
C
C     DID THEY PASS IDLE FOR THIS POLLUTANT?
 22       IF(IDLE(I,P).LE.CUTPTS(P,TECH,AGE1ST,ISTRIN))GO TO 25
            FGRP=FGRP+P
            NFAIL(P)-NFAIL(P)+1
            PASS(ITEST,P)=.FALSE.
            PASS(ITEST,TEST) = .FALSE.
C
C
 25     CONTINUE
C

-------
                                    51
C     ADD FTP'S TO THE PROPER GROUP
      FGRP=FGRP+1
      AVGMIL(FGRP) = AVGMIL(FGRP) + ADJMIL(I)
      NF(FGRP)=NF(FGRP)+1
      TOTFTP(HC,FGRP)=TOTFTP(HC,FGRP)+FTP(I,HC)
      TOTFTP(CO,FGRP)=TOTFTP(CO,FGRP)+FTP(I,CO)
C
C     ANY ERRORS OF COMMISSION OR OMISSION?
        DO 27 P-1,3
          IF(PASS(ITEST,P) .AND. .NOT.PASS(FTEST,P))
     &      NEO(P)=NEO(P)+1
          IF(.NOT.PASS(ITEST,P) .AND. PASS(FTEST,P))
     &      NEC(P)=NEC(P)+1
 27     CONTINUE
C
 29   CONTINUE
C
C     STEP' 3
C     FIND TOTALS AND FAILURE AND ERROR RATES
      NFAIL(TEST)=NCARS - NF(l)
C
C   Calculate average mileage in each failure group
      DO 34 FGRP=1,4
        IF (NF(FGRP) .NE. 0) AVGMIL(FGRP)=AVGMIL(FGRP) / NF(FGRP)
34    CONTINUE
      DO 39 P-1,3
        FR(P)=1.0*NFAIL(P)/NCARS
        EC(P)=1.0*NEC(P)/NCARS
        EO(P)=1.0*NEO(P)/NCARS  .
 39   CONTINUE
C
C     STEP 4
C     WRITE OUT THE FAILURE AND ERROR RATES
      IF (.NOT. TABLES) GOTO 99 .
      IMTP^MTP(AGE)*100.+.5
      WRITE(2,201)AGE,(FR(P),P-1,3),(EO(P),P-1,3),(EC(P),P-1,3),
     + 'IMTP ,(CUTPTS(P,TECH,AGE1ST,ISTRIN),P=1,2)
C
C
 201  FORMAT(T21,13, 4X, 3( F7.2,F5.2,F5.2, 5X), 15,F10.0,F5. 1>-
C
99    RETURN
      END

-------
                                    52


      SUBROUTINE MNTNCE(AGE)
C
C     THE 'BKGRND' COMMON BLOCK CONTAINS BACKGROUND INFORMATION
C     NEEDED TO DEFINE THE I/M PROGRAM
C
C     VARIABLE          DESCRIPTION
C     TECH              TECHNOLOGY NUMBER
C     AGE1ST            AGE OF VEHICLES AT FIRST INSPECTION
C     MTP(BY)           MECHANIC TRAINING PERCENT AT BENEFIT YEAR 'BY1
C     CUTPTS(BY,P)      IDLE CUTPOINTS AT BENEFIT YEAR 'BY'
C                       FOR POLLUTANT 'P'
C     ESTSF             ESTIMATED STRINGENCY FACTOR
C     TABLES            LOGICAL VARIABLE TO SUPRESS OUTPUT OF TABLES
C
      COMMON/BKGRHD/TECH.AGEIST.MTP.CUTPTS,ESTSF,TABLES
      INTEGER*4 TECH.AGEIST,ESTSF
      REAL*4    CUTPTS(2,2,19,5),MTP(20)
      LOGICAL TABLES
C
C     'HSTRY' COMMON BLOCK CONTAINS EMISSION HISTORY THROUGHOUT PROGRAM
C
C     VARIABLE                   DESCRIPTION
C     TFB(AGE,P)                 TOTAL FLEET FTP BEFORE INSPECTION
C     TFA(AGE.P)                 TOTAL FLEET FTP AFTER INSPECTION
C     F                          F*l PASSED THE TEST
C                                 =2 FAILED FOR HC ONLY
C                                 =3 FAILED FOR CO ONLY
C                                 =4 FAILED FOR BOTH
C     NF(F.)                       NUMBER IN EACH GROUP
C     TOTFTP(P,F)                TOTAL FTP IN EACH GROUP
C     PR(P,BY)                   PERCENT REDUCTION ON JANUARY 1ST
C     AVGMIL(F)                  AVERAGE MILEAGE FOR FAILURE GROUP
C
      COMMON/HSTRY/ TFB,TFA,NF,TOTFTP,AVGMIL,PR
      REAL*4 TFB(20,2),TFA(20,2),TOTFTP(2,4),AVGMIL(4)
      INTEGER*4 NF(4),PR(2,20)
C
C     THE 'MOB1 COMMON BLOCK CONTAINS THE MOBILE2 ESTIMATES
C     OF MILEAGE AND FTP EMISSION LEVELS
C     FOR EACH TECHNOLOGY BY AGE OF VEHICLE
C
C     THESE VARIBALES ARE ALL INITIALIZED IN A BLOCK DATA STATEMENT
C
C     VARIABLE                  DESCRIPTION
C     MILES(AGE)                ESTIMATED MILEAGE AT AGE 'AGE'
C     MOBFTPCAGE,P,TECH)        ESTIMATED FTP LEVEL AT  AGE 'AGE1,
C                               TECHNOLOGY 'TECH' AND POLLUTANT 'P1
C     JMILES(AGE)               MILEAGE ON JAN 1 CY,  WHERE AGE=CY-MY
C     JFTP(AGE,P,TECH)          NON I/M FLEET FTP ON JAN 1
C     INT(P,TECH)               MOBILE2 INTERCEPTS
C     SLOPE(P,TECH)             MOBILE2 SLOPES FOR EMISSIONS
C     STND(P,TECH)              FTP STANDARDS

-------
                                   53
      COMMON /MOB/ MILES, MOBFTP, JMILES, JFTP, INT, SLOPE, STND
      REAL*4 MILES(20), MOBFTP(20,2,2), JMILES(20), JFTP(20,2,2),
     1       INT(2,2), SLOPE(2,2), STND(2,2)
C
C     This subroutine performs maintenance on  failed cars.
C     The after maintenance mean ftp emissions for pollutant p  (p=l,hc; p=2,co)
C     and failure group (hcpass?, copass?) is  given for each technology
C     by
C        ftp(hcpass,copass,p)  =  d(hcpass,copass,p,0)  +  d(hcpass,copass,p,1)*
mean mileage(hepass,copass)
C       +  d(hcpass,copsas,p,4)* idlehc cutpoints  + d(hcpass,   copass,  p,  5)  *
idleco cutpoints
C
C     Variables are used as follows:
C     amftpChcpass, copass, technology, with without mechanic training)
C       is the After Maintenance FTP
C
C
      INTEGER*2 P.FGRP
      INTEGER*4 TFPR(2) ,FFPR(2) ,AGE
      REAL*4 PF(2),FFB(2),FFA(2)
C     VARIABLE                   DESCRIPTION
C
C     TFPR(P)                    TOTAL FLEET % REDUCTION IN FTP
C                                DUE TO MAINTENANCE
C     PF(P)                      PASSED FLEET  EMISSION
C     FFB(P)                     FAILED FLEET FTP BEFORE MNTNCE
C     FFA(P)                     FAILED FLEET FTP AFTER MNTNCE
C     FFPR(P)                    FAILED FLEET % REDUCTION IN FTP
C                                DUE TO MAINTENANCE
C
C     THIS ROUTINE MUST SIMULATE MAINTENANCE
C     THE 'FFA'(FAILED FLEET AFTER MAINTENANCE) VARIABLE AND
C     'TFA'(TOTAL  FLEET AFTER MAINTENANCE) MUST BE COMPUTED
C
C
C     STEP 1
C   -
C     GRP(FGRP)      where GRP =
C                    1 if pass idle he and co
C                    2  if fail idle he
C                    3 if fail idle co
C                    4 if fail both idle he and co
C     D(hcpass?, copass?, pollutant, tech) and
C          are parameters determined from statistical analysis
C     DPRIME(hcpass?, copass?, pollutant,  tech)
C          are parameters determined for calculating  after
C          maintenance values for cars with mechanic training
C     AMFTP(hcpass?,  copass?,  p, with/without mechanic training
C          is the after maintenance FTP level.

-------
                                     54
INTEGER GRP(2
REAL AMFTP(2,
REAL
*
REAL
*0.0,
*0.0,
*0.0,
*0.0,
*0.0,
*0.0,
*0.0,
*0.0,
REAL
*0.0,
*0.0,
REAL
*0.0,
*0.0,
REAL
*0.0,
*0.0,
,2)71, 2,
2, 2, 2)
.A(2, 3,2)7 59.396

C(2,2,2,
2.8093 ,
1.0906 ,
0.0
0.0
0.0 ,
.00464 ,
0.0
0.0
DPRIME (2
3.7504 ,
1.4671 ,
0(2,2,2,
-.0624,
.0243 ,
K(2,2,2,
.96569 ,
1.1237 ,
27.814
2,4)7
2.4490
.80638
-.20922
.21934
.012067
0.0
0.0
0.0
,2,2,2)7
3.7504
.32275
2)7
-.0624 ,
.20266 ,
2)7
1.0647
.92395


,
»
»
>
>
j
,
,

>
,

-


,
>
3, 47
,IREG(2)
, -.6596
, -.2716

1.0398
1.0855
.21054
.14956
.004185
.0014085
0.0
0.0

3.7504
1.2418

.0624 ,0
.16849,0

1.1575
1.0792




}
>
»
>
i
>
i
i

i
>

•
.

»
>

>
j

0.
0.
0.
0.
0.
0.
0.
0.

0.
0.

o,
o,

0.
0.
INTEGER BY,HCPASS,COPASS,WITH/1/,

8.
4.

o,
o,
o,
o,
o,
o,
o,
0,

o,
o,



2111 , .0615 , 12.
6612 , 0.

41.933 ,
16.275 ,
0.0
0.0
0.0
0.0
o?o
28.224 ,

37.49
11.358

.33, .33
0.

o,
0,
0, 1.2501

.65245 ,
1.0771 ,
0 , 18.

23.007 ,
14.391 ,
1.3794 ,
1.3610 ,
0.0
0.0
6.6541 ,
-.021437,

, 37.49
, 5.1816

, .33
, 1.7631

.99755 ,
.91849 ,


106 , .4658 ,
517

43
16
0
1.
0.
0.
0.
9.

>
>

>
7

1.
1.
, .3905 /

.096 ,
.379 ,
•0 ,
7465 ,
o
o
o
6023 /

37.49
17.687 /




0489 ,
0095 7
WTHOUT/2/
      IF(AGE .GT. AGE1ST) GO TO 2
      DO 1 P-1,2
    1 TFB(AGE,P)=MOBFTP(AGE,P,TECH)
    2 CONTINUE
      ISTRIN=ESTSF/10
      BY = AGE - AGE1ST + 1
      NUMFLD = NF(2) + NF(3) + NF(4)
C
      DO 5 P=l,2
        PF(P) = 0
        FFB(P)  = 0
        IF (NF(1) .NE. 0) PF(P) = TOTFTP(P,1) / NF(l)
        IF(NUMFLD .NE. 0) FFB(P) =
     &             (TOTFTP(P,2)+TOTFTP(P,3)+TOTFTP(P,4)) / NUMFLD
5     CONTINUE
C     Perform maintenance on failed cars.
        DO 11 P-1,2
          FFA(P) = 0
          FFPR(P) = 0
          IF( NUMFLD .EQ. 0) GOTO 14
          DO 11 COPASS=1,2
            DO 11 HCPASS=1,2
      IF( HCPASS.EQ.l .AND. COPASS.EQ.l ) GO TO 11
C
      AMFTP(HCPASS,COPASS,P,WITH)=0.0
      IF(NF(GRP(HCPASS,COPASS)) .EQ. 0) GO TO 11
      DO 12 IP-1,2

-------
                                     55
   12 IREG(IP)=AMIN1(CUTPTS(IP,TECH,AGE1ST,ISTRIN),
    . &           A(IP,1,TECH)
     &          +A(IP,2,TECH)*AVGMIL(GRP(HCPASS,COPASS))
     &          +A(IP,3,TECH)*CUTPTS.(2,TECH,AGE1ST,ISTRIN))
C
      AMFTP(HCPASS)COPASS,PJWTHOUT)= K(HCPASS,COPASS.P,TECH) *
     &         ( C(HCPASS,COPASS,P,TECH,1)
     &          +C(HCPASS,COPASS,P,TECH,2)*AVGMIL(GRP(HCPASS,COPASS))
     &          +C(HCPASS,COPASS.P,TECH,3)*IREG(1)
     &          +C(HCPASS,COPASS,P,TECH,4)*IREG(2))
C
      AMFTP(HCPASS,COPASS,P,WITH)=AMIN1(AMFTP(HCPASS,COPASS,P,WTHOUT),
     &     DPRIME (HCPASS , COPASS , P,TECH)
     &     +D(HCPASS,COPASS,P,TECH)*AVGMIL(GRP(HCPASS,COPASS)))
C
C     Calculate after maintenace FTP. If there is no mechanic training,
C     then we will just take the 'without' value. If there is a training
C     program, then calculate after maintenance emissions with & withoug
C     mechanic training and apply the mechanic training percentages to
C     the difference
            AMFTP(HCPASS,COPASS,P,WITH)-AMPTP(HCPASS,COPASS,P.WTHOUT)
     &      -(AMFTP(HCPASS,COPASS,P,WTHOUT)-AMFTP(HCPASS.COPASS,P,WITH))
     &      * MTP(BY)
C
        AMFTP(HCPASS, COPASS, P, WITH) = AMINK
     *    (TOTFTP(P,GRP( HCPASS, COPASS)) / NF (GRP (HCPASS , COPASS))),
     *    AMFTP(HCPASS, COPASS, P, WITH)      )
C
11     CONTINUE
C
   14 CONTINUE
C
C     Calculate Failed Fleet After maintenace emissions, a composite.
C
      DO 20 P-1,2
      IF(NUMFLD.LE.O) GO TO 15
        FFA(P) = (AMFTP(1,2,P,WITH) * NF(GRP(1,2))+
     &  AMFTP(2,1,P,WITH)' *'NF(GRP(2,1)) +
     &  AMFTP(2,2,P,WITH) * NF(GRP(2,2))) / NUMFLD
      FFPR(P)= ( FFB(P)-FFA(P) ) / FFB(P) *100.0 + .5
 15   TFA(AGE,P)=( PF(P)*NF(1) + FFA(P)*NUMFLD )/ (NF(1)+NUMFLD)
      TFPR(P)= ( TFB(AGE,P)-TFA(AGE,P) ) / TFB(AGE,P) *100.0 + .5
20    CONTINUE
C
C
C
C     LAST STEP
C     WRITE OUT INFORMATION IN TABLE 1
      IF(.NOT.TABLES) GO TO 99
      IMTP=MTP(AGE)*100.+.5
        WRI TE(1,101)AGE,MILES(AGE),(MOBFTP(AGE,P,TECH),P=l,2)
     & ,(TFB(AGE,P)',P-1,2),(TFA(AGE,P),P-1,2),(TFPR(P),P-1,2)
     & ,(PF(P),P=1,2)}(FFB(P),P=1,2),(FFA(P),P=1,2),(FFPR(P),P=1,2)
     & ,IMTPJ(CUTPTS(P,TECH,AGE1ST,ISTRIN),P=1,2)

-------
                                    56
C
C
 101  FORMAT(I4,F7.1,2(3(F7.2,F6.1),15,14,2X),I6,F8.0,F5.1)
C
   99 RETURN
      END

-------
                                   57
      SUBROUTINE DTRATN(AGE)
C
C     THE 'MOB' COMMON BLOCK CONTAINS THE MOBILE2 ESTIMATES
C     OF MILEAGE AND FTP EMISSION LEVELS
C     FOR EACH TECHNOLOGY BY AGE OF VEHICLE
C
C     THESE VARIBALES ARE ALL INITIALIZED IN A BLOCK DATA STATEMENT
C
C     VARIABLE                  DESCRIPTION
"C     MILES (AGE)                ESTIMATED MILEAGE AT AGE 'AGE'
C     MOBFTP(AGE,P,TECH)        ESTIMATED FTP LEVEL AT AGE  'AGE',
C                               TECHNOLOGY 'TECH' AND POLLUTANT  'P'
C     JMILES(AGE)               MILEAGE ON JAN 1 CY, WHERE AGE=CY-MY
C     JFTP(AGE,P,TECH)          NON I/M FLEET FTP ON JAN 1
C     INT(P,TECH)               MOBILE2 INTERCEPTS
C     SLOPE(P,TECH)             MOBILE2 SLOPES FOR EMISSIONS
C     STND(P.TECH)              FTP STANDARDS
C
      COMMON /MOB/ MILES, MOBFTP, JMILES, JFTP, INT, SLOPE, STND
      REAL*4 MILES(20), MOBFTP(20,2,2), JMILES(20), JFTP(20,2,2),
     1       INT(2,2), SLOPE(2,2), STND(2,2)
C
C     THE 'BKGRND1 COMMON BLOCK CONTAINS BACKGROUND INFORMATION
C     NEEDED TO DEFINE THE I/M PROGRAM
C
C     VARIABLE          DESCRIPTION
C     TECH              TECHNOLOGY NUMBER
C     AGE1ST            AGE OF VEHICLES AT FIRST INSPECTION
C     MTP(BY)           MECHANIC TRAINING PERCENT AT BENEFIT YEAR  'BY'
C     CUTPTS(BY,P)      IDLE CUTPOINTS AT BENEFIT YEAR 'BY'
C                       FOR POLLUTANT 'P1
C     ESTSF             ESTIMATED STRINGENCY FACTOR
C     TABLES            LOGICAL VARIABLE TO SUPRESS OUTPUT OF TABLES
C
      COMMON/BKGRND/TECH,AGE1ST, MTP,CUTPTS,ESTSF,TABLES
      INTEGER*4 TECH,AGE1ST,ESTSF
      REAL*4    CUTPTS(2,2,19,5),MTP(20)
      LOGICAL TABLES   .
C     'MEANS' COMMON BLOCK CONTAINS MEAN MILEAGE,FTPHC ,FTPCO
C     WE HAVE TO MAKE OUR SAMPLE AGREE WITH THESE MEANS
C
C     VARIABLE              DESCRIPTION
C     MODOM                 MEAN ODOMETER
C     MFTP(P)               MEAN FTP FOR POLLUTANT 'P'
C
      COMMON/MEANS/MODOM,MFTP
      REAL*4 MODOM,MFTP(2)
C
C     'HSTRY1 COMMON BLOCK CONTAINS EMISSION HISTORY THROUGHOUT PROGRAM
C
C     VARIABLE                   DESCRIPTION
C     TFB(AGE,P)                 TOTAL FLEET FTP BEFORE INSPECTION
C     TFA(AGE,P)   .              TOTAL FLEET FTP AFTER INSPECTION

-------
                                      58
C     F                          F-l PASSED THE TEST
C                                 =2 FAILED FOR HC ONLY
C                                 =3 FAILED FOR CO ONLY
C                            •     =4 FAILED FOR BOTH
C     NF(F)                      NUMBER IN EACH GROUP
C     TOTFTP(P,F)                TOTAL FTP IN EACH GROUP
C     PR(P,BY)                   PERCENT REDUCTION ON JANUARY 1ST
C     AVGMIL(F)                  AVERAGE MILEAGE FOR FAILURE GROUP
C
      COMMON/HSTRY/ TFB,TFA,NF,TOTFTP,AVGMIL,PR
      REAL*4 TFB(20,2),TFA(20,2),TOTFTP(2,4),AVGMIL(4)
      INTEGER*4 NF(4),PR(2,20)
C
C     AFTER A YEAR ON THE ROAD, MILAGE IS EXPECTED TO INCREASE BY
C     'MILE'. PROJECTED MILEAGE IS MILES(AGE) + MILE. PLUG THIS
C     INTO THE MOBILE 2 EQUATION TO DETERMINE THE PROJECTED
C     EMISSIONS
C
      INTEGER AGE, P
      REAL PROJYC2), PROJX(2)
      REAL MILE(2,2)/.74, 4.0, 2.70, 5.72/
      DO 5 P-1,2
        PROJX(P) = MILES(AGE) + MILE(P,TECH)
        PROJY(P) = PROJX(P) * SLOPE(P, TECH) + INT(P, TECH)
5     CONTINUE
C
C     USING THE AFTER MAINTENANCE MEAN FTP EMISSIONS AT THE
C     PROJECTED MILEAGE, AND THE EMISSIONS AFTER ONE YEAR AS
C     PREDICTED BY MOBILE 2 EQUATIONS (CALCULATED ABOVE),
C     COMPUTE THE EQUATION OF  'ACTUAL' DETERIORATION AND
C     DETERMINE WHAT THE EMISSIONS ARE AT THE NEXT MILEAGE
C     FROM THIS NEW EQUATION
C
C     RECALL
C     Y - Yl = (Y2 - Yl/ X2 - Xl)*( X - XI)
C     WHERE
C     Y2 = TFA(AGE,P)          Yl = PROJY(P)
C     X2 = MILES(AGE)          XI =. PROJX(P)
C     X = MILES(AGE + 1)
C
      DO 10 P-1,2
        MFTP(P) = (TFA(AGE,P) - PROJY(P)) / (MILES(AGE) - PROJX(P))
     1 * (MILES( AGE + 1 ) -PROJX(P)) + PROJY(P)
        MFTP(P)=AMIN1(MFTPOP),MOBFTP(AGE+1,P,TECH))
      TFB(AGE+1,P)=MFTP(P)
10    CONTINUE             .
C
      MODOM = MILES( AGE +1)
      RETURN
      END

-------
                                    59


      SUBROUTINE GETPR.
C
C     THE 'BKGRND1 COMMON BLOCK CONTAINS BACKGROUND INFORMATION
C     NEEDED TO DEFINE THE I/M PROGRAM
C
C     VARIABLE          DESCRIPTION
C     TECH              TECHNOLOGY NUMBER
C     AGE1ST            AGE OF VEHICLES AT FIRST INSPECTION
C     MTP(BY)           MECHANIC TRAINING PERCENT AT BENEFIT YEAR 'BY1
C     CUTPTS(BY,P)      IDLE CUTPOINTS AT BENEFIT YEAR 'BY'
C                       FOR POLLUTANT 'P'
C     ESTSF             ESTIMATED STRINGENCY FACTOR
C     TABLES            LOGICAL VARIABLE TO SUPRESS OUTPUT OF TABLES
C
      COMMON/BKGRND/TECH,AGE1ST,MTP,CUTPTS,ESTSF,TABLES
      INTEGER*4 TECH,AGE1ST,ESTSF
      REAL*4    CUTPTS(2,2,19,5),MTP(20)
      LOGICAL TABLES
C
C     THE 'MOB1 COMMON BLOCK CONTAINS THE MOBILE2 ESTIMATES
C     OF MILEAGE AND FTP EMISSION LEVELS
C     FOR EACH TECHNOLOGY BY AGE OF VEHICLE
C
C     THESE VARIBALES ARE ALL INITIALIZED IN A BLOCK DATA STATEMENT
C
C     VARIABLE                  DESCRIPTION
C     MILES(AGE)                ESTIMATED MILEAGE AT AGE 'AGE'
C     MOBFTP(AGE,P,TECH).        ESTIMATED FTP LEVEL AT AGE 'AGE',
C                               TECHNOLOGY 'TECH1 AND POLLUTANT  'P'
C     JMILES(AGE)               MILEAGE ON JAN 1 CY, WHERE AGE=CY-MY
C     JFTP(AGE,P,TECH)          NON I/M FLEET FTP ON JAN 1
C     INT(P.TECH)               MOBILE2 INTERCEPTS
C     SLOPE(P,TECH)             MOBILE2 SLOPES FOR EMISSIONS
C     STND(P,TECH)              FTP STANDARDS
C
      COMMON /MOB/ MILES,  MOBFTP,  JMILES, JFTP, INT, SLOPE, STND
      REAL*4 MILESC20),  MOBFTP(20,2,2),  JMILES(20), JFTP(20,2,2),
     1       INT(2,2), SLOPE(2,2), STND(2,2)
C
C     'HSTRY' COMMON BLOCK CONTAINS EMISSION HISTORY THROUGHOUT PROGRAM
C
C     VARIABLE                   DESCRIPTION
C     TFB(AGE,P)                 TOTAL FLEET FTP BEFORE INSPECTION
C     TFA(AGE,P)                 TOTAL FLEET FTP AFTER INSPECTION
C     F                          F=l PASSED THE TEST
C                                 =2 FAILED FOR HC ONLY
C                                 =3 FAILED FOR CO ONLY
C                                 =4 FAILED FOR BOTH
C     NF(F)                      NUMBER IN EACH GROUP
C     TOTFTP(P,F)                TOTAL FTP IN EACH GROUP
C     PR(P,BY)                   PERCENT REDUCTION ON JANUARY 1ST
C     AVGMIL(F)                  AVERAGE MILEAGE FOR FAILURE GROUP

-------
                                    60
      COMMON/HSTRY/ TFB,TFA,NF,TOTFTP,AVGMIL,PR
      REAL*4 TFB(20,2),TFA(20,2),TOTFTP(2,4),AVGMIL(4)
      INTEGER*4 NF(4),PR(2,20)
C     'MEANS' COMMON BLOCK-CONTAINS MEAN MILEAGE,FTPHC .FTPCO
C     WE HAVE TO MAKE OUR SAMPLE AGREE WITH THESE MEANS
C
C     VARIABLE              DESCRIPTION
C     MODOM                 MEAN ODOMETER
C     MFTP(P)               MEAN FTP FOR POLLUTANT 'P'
C
      COMMON/MEANS/MODOM,MFTP
      REAL*4 MODOM,MFTP(2)
C
C     THIS SUBROUTINE CALCULATES THE AVERAGE FLEET EMISSIONS '
C     ON JAN 1 FOR EACH CALENDER YEAR STARTING MY+1
C
C
C
C      THE 'TFL' COMMON BLOCK HOLDS BEFORE AND AFTER
C      FLEET MEAN EMISSIONS FROM THE LAST AGE1ST
C      TFAL(BY,P) = TFA(BY.P) FROM THE LAST TIME
C      TFBL(BY,P) = TFB(BY,P) FROM THE LAST TIME
C          THESE VARIABLES ARE ONLY "COMMON" TO THIS SUBROUTINE I
C
      COMMON/TFL/TFAL,TFBL
      REAL TFAL(20,2),TFBL(20,2)
C
      INTEGER EVAL,AGE,P,BY
      REAL EMIS(2,20)
C
C     VARIABLE       DESCRIPTION
C     EMIS(P.BY)   I/M EMISSIONS ON JAN 1ST
C
      LAST= 20 - AGE1ST
C
C
C     STEP 1                                          .   .
C     CALCULATE EMISSIONS OF THE I/M FLEET ON JAN1
      IF(AGE1ST .GT. 1) GO TO 11
      DO 10 P»l,2
        EMIS(P.l) " .75*(.375*INT(P,TECH) + .625*MOBFTP(l,P)TECH)
     +            + .25*(.875*TFA(1,P) + .125*TFB(2,P))
      DO 10 BY=2,19
       AGE=BY
        EMIS(P.BY) = .75*(.375*TFA(AGE-1,P) + .625*TFB(AGE,P))
     +             + .25*(.875*TFA(AGE,P) + .125*TFB(AGE+1,P))
   10 CONTINUE
      GO TO 13
   11 CONTINUE
      DO 12 BY=1,LAST
        AGE=BY+AGE1ST-1

-------
                                  61
      DO 12 P=l,2
       . EMIS(P.BY) = .75*(.375*TFAL(AGE-1,P)  + .625*TFBL(AGE,P))
     +             + .25*(.875*TFA(AGE,P) + .125*TFB(AGE+1,P))
   12 CONTINUE
   13 CONTINUE
C
C     STEP 2
C     CALCULATE PERCENT REDUCTIONS ON JAN1
      DO 20 P-1,2
      DO 20 BY=1,LAST
      AGE=-AGE1ST+BY-1
        PR(P,BY)=(JFTP(AGE+1,P,TECH)-EMIS(P,BY))
     &       / JFTP(AGE+1,P,TECH) *100. +.5
      TFAL(AGE,P)=TFA(AGE,P)
      TFBL(AGE,P)=TFB(AGE,P)
 20   CONTINUE
C
C     STEP 3
      IF (.NOT.TABLES)  GO TO 99
C
C     WRITE OUT THE RESULTS ON TABLE 3
      DO 30 BY-1.LAST
      AGE=AGE1ST+BY-1
      IMTP=MTP(AGE)*100.+.5
        WRITE(3,301)AGE,JMILES(AGE+1),(JFTP(AGE+1,P,TECH),P=1,2)
     &       (EMIS(P,BY),P-1,2),(PR(P,BY),P-1,2)>IMTP
 30   CONTINUE
C
 301  FORMAT(T26,I2,T33,F5.1,T44,F5.2,T51,F5.1,T64,F5.2,
     &  T71,F5.1,T82,I3,T89,I3,T99,I6)
C
 99   RETURN
      END

-------
                                  62
      FUNCTION AVER(N,ARRAY)
C
      REAL ARRAY(2678)
      INTEGER N
C
      SUM=0
      DO 5 1=1,N
 5    SUM=SUM+ARRAY(I)
C
      AVER=SUM/N
      RETURN
      END

-------
                                     63

      BLOCK DATA
COMMON/MOB/MILES,MFTP1,MFTP2, JMILES,JFTP1,JFTP2,INT1,INT2,SLOPE1,SLOPE2,STND
C
      REAL MILES(20),MFTP1(20,2),MFTP2(20,2)
      REAL JMILES(20),JFTP1(20,2),JFTP2(20,2)
      REAL INT1(2),INT2(2),SLOPE1(2),SLOPE2(2),STND(2,2)
C
C     STANDARDS ARE NOT REALLY RIGHT
C     WE ARE USING STANDARDS FOR 68-74 FOR TECH 1,
C     AND IGNORING PRE 68'S
      DATA STND/3.05,34.05,1.55,15.057
      DATA MILES/
C     MILES BY AGE
     &  1.440,  2.830,  4.170,  5.460,  6.690,  7.870,  8.990, 10.060,
     & 11.080, 12.040, 12.950, 13.810, 14.610, 15.360, 16.060, 16.700,
     & 17.290, 17.830, 18.320, 18.750/
      DATA JMILES/
C     AVERAGE FLEET MILEAGE ON JAN 1
     &  0.180,  1.078,  2.481,  3.833,  5.136,  6.381,  7.573,  8.708,
     &  9.791, 10.823, 11.798, 12.721, 13.593, 14.408, 15.171, 15.883,
     & 16.538, 17.141, 17.693, 18.196 /
      DATA MFTP2/
C     FTP HC BY AGE
     &  1.51,  1.91,  2.30,  2.67,  3.03,  3.37,  3.70,  4.01,  4.30,
     &  4.58,  4.85,  5.09,  5.33,  5.54,  5.75,  5.93,  6.10,  6.26,
     &  6.40,  6.53,
C     FTP CO BY AGE
     & 22.15, 26.12, 29.96, 33.65, 37.16, 40.54, 43.74, 46.80, 49.72,
     & 52.46, 55.07, 57.53, 59.81,. 61.96, 63.96, 65.79, 67.48, 69.02,
     & 70.43, 71.65/
      DATA JFTP2/
C     AVERAGE FLEET FTP HC ON JAN 1
     &  1.14,  1.40,  1.81,  2.20,  2.58,  2.94,  3.29,  3.62,  3.93,
     &  4.23,  4.51,  4.78,  5.03,  5.27,  5.49,  5.70,  5.89,  6.06,
     &  6.22,  6.37,
C     AVERAGE FLEET FTP CO ON. JAN 1
     & 18.54, 21.11, 25.13, 28.99, 32.72, 36.28, 39.69, 42.94, 46.03, „
     & 48.98, 51.77, 54.41, 56.91, 59.24, 61.42, 63.46, 65.33, 67.05,
     & 68.63, 70.07 /
C
      DATA MFTP1/
C     FTP HC BY AGE
     &  3.60,  3.84, , 4.07,  4.29,  4.50,  4.70,  4.89,  5.07,  5.24,
     &  5.41,  5.56,  5.71,  5.84,  5.97,  6.09,  6.20,  6.30,  6.39,
     &  6.47,  6.55,
C     FTP CO BY AGE
     & 44.29, 47.69, 50.95, 54.10, 57.10, 59.98,  62.72, 65.33, 67.82,
     & 70.16, 72.38, 74.48, 76.43, 78.26, 79.97,  81.53, 82.97, 84.29,
     & 85.48, 86.53/
      DATA JFTP1/

-------
4.
5.
3.
5.
23,
81,
31,
94,
4
5
56
77
•44,
•94,
.35,
.80,
4.
6.
59.
79.
65,
06,
26,
53,
4.
6.
62.
81.
84,
17,
03,
13,
5.
6.
64.
82.
02,
27,
67,
60,
 AVERAGE FLEET FTP HC ON JAN  1
&  3.39,  3.54,  3.78,  4.01,
&  5.20,  5.37,  5.52,  5.67,
&  6.37,  6.45,
 AVERAGE FLEET FTP CO ON JAN  1
& 41.22, 43.41, 46.83, 50.13, !
& 67.19, 69.57, 71.82, 73.95, 1
& 83.95, 85.18 /
 DATA IHT1/3.36, 40.78/
 DATA SLOPE1/.17, 2.44/
 DATA INT2/1.09.18.03/
 DATA SLOPE2/.29.2.86/
 END
 BLOCK DATA
 COMMON/BKGRND/TECH,AGE1ST,MTP,
*CUTPT1,CUTPT2,CUTPT3,CUTPT4,CUTPT5,ESTSF.TABLES
 INTEGER*4 TECH,AGE1ST,ESTSF
 REAL*4 CUTPT1(2,2,19),CUTPT2(2,2,19),CUTPT3(2,2,19),
*CUTPT4(2,2,19),CUTPT5(2,2,19),MTP(20)
 LOGICAL TABLES
 DATA CUTPT1/               801.6, 8.02, 590.3, 5.90,
* 854.3, 8.54, 708.1, 7.08, 903.7, 9.04, 824.5, 8.24,
* 951.5, 9.51, 935.3, 9.35,1004.0,10.04,1038.8,10.39,
*1054.4,10.54,1139.9,11.40,1104.4,11.04,1232.6,12.33,
*1148.8,11.49,1316.9,13.17,1193.0,11.93,1398.9,13. 99,
*1223.7,12.24,1477.6,14.78,1252.1,12.52,1563.1,15.63,
*1287.8,12.88,1637.0,16.37,1319.3,13.19,1709.9,17.10,
*1351.2,13.51,1772.2,17.72,1377.9,13.78,1830.6,18.31,
*1406.5,14.07,1883.7,18.84,1424.5,14.24,1932.8,19.33,
*1443.3,14.43,1977.8,19.78,1463.0,14.63,2024.0.20.24/
                            584.5, 5.85, 388.
                        68,
 DATA CUTPT2/
* 624.3, 6.24, 468.4, 4
* 697.2, 6.97, 617.4, 6
         7.64, 758.9, 7
* 763.8,
* 824.2, 8.24,
* 882.6, 8.83,
      5,
  938.
  983.
      883.4,  8.83,
      993.1,  9.93,
9.38,1091.4,10.91,
    661.7,
17, 729.6,
59, 793.9,
    854.7,
          1, 3.88,
6.62, 545.8, 5.46,
7.30, 689.5, 6.89,
7.94, 822.1, 8.22,
8.55, 939.9, 9.40,
    912.0, 9.12,1043.8,10.44,
    963.6, 9.64,1135.7,11.36,
      5, 9.83,1179.4,11.79,1005.7,10.06,1216.4,12.16,
*1025. 7,10.26,1251. 6,12. 52,1044.8,10.4.5,1290. 5,12. 90,
*1059.0,10.59,1318.5,13.18,1071.2,10.71,1343.9,13.44/
DATA
* 513.
* 575.
* 631.
* 679.
* 725.
* 767.
* 804.
* 834.
* 859.
DATA
* 423.
CUTPT37
1,
4,
3,
3,
7,
1,
1,
1,
3,
5.13,
5.75,
6.31,
6.79,
7.26,
7.67,
8.04,
8.34,
8.59,
303.
398.
483.
562.
636.
700.
755.
804.
851.
9,
1,
5,
9,
o,
6,
8,
1,
2,
3.04,
3.98,
4.84,
5.63,
6.36,
7.01,
7.56,
8.04,
8.51,
CUTPT4/
4,
4.23,
227.
2,
1.54,
478.
543.
604.
655.
703.
748.
786.
820.
847.
870.
395.
449.
1,
8,
5,
4,
3,
1,
9,
4,
6,
o,
2,
6,
4.78,
5.44,
6.04,
6.55,
7.03,
7.48,
7.87,
8.20,
8.48,
8.70,
3.95,
4.50,
272.
350.
440.
523.
599.
669.
728.
783.
825.
868.
209.
247.
2,
5,
2,
2,
o,
3,
8,
3,
3,
o,
7,
6,
2.44,
3.50,
4.40,
5.23,
5.99,
6.69,
7.29,
7.83,
8.25,
8.687
1.19,
1.95,

-------
                            65
* 475.5, 4.75, 266.8, 2.33, 501.3, 5.01, 284.1, 2.68,
* 522.
* 564.
* 602.
* 640.
* 673.
* 699.
* 720.
DATA
* 336.
* 378.
* 417.
* 450.
* 479.
* 507.
* 529.
* 550.
* 567.
END
9,
7,
4,
6,
4,
5,
3,
5.23,
5.65,
6.02,
6.41,
6.73,
7.00,
7.20,
304.
355.
395.
437.
470.
502.
526.
7,
6,
5,
3,
2,
8,
9,
3.
3.
3.
4.
4.
5.
5.
05,
56,
96,
37,
70,
03,
27,
CUTPT5 /
4,
o,
5,
o,
3,
4,
2,
3,
7,

3.36,
3.78,
4.17,
4.50,
4.79,
5.07,
5.29,
5.50,
5.68,

180.
196.
213.
230.
248.
265.
282.
299.
313.

7,
8,
5,
3,
o,
6,
5,
3,
5,

0.
0.
1.
1.
1.
2.
2.
2.
3.

61,
93,
26,
60,
95,
31,
64,
98,
13,

543.6,
584.4,
621.1,
657.1,
686.9,
710.6,
729.5,
316.1,
355.6,
398.1,
434.7,
464.9,
494.0,
518.2,
540.5,
559.3,
575.4,

5.44,
5.84,
6.21,
6.57,
6.87,
7.11,
7.29,
3.16,
3.56,
3.98,
4.35,
4.65,
4.94,
5.18,
5.40,
5.59,
5.75,

331.
379.
419.
454.
489.
515.
537.
174.
188.
206.
221.
240.
255.
274.
290.
306.
321.

2,
4,
1,
3,
2,
4,
4,
9,
1,
2,
3,
7,
9,
7,
9,
4,
5,

3.31,
3.79,
4.19,
4.54,
4.89,
5.15,
5.37/
0.49,
0.76,
1.12,
1.42,
1.81,
2.11,
2.49,
2.81,
3.06,
3.227


-------
                                  bb
      SUBROUTINE MATRIX(MT,ISTRIN,ITECH)
C
C
C     'HSTRY' COMMON BLOCK CONTAINS EMISSION HISTORY THROUGHOUT PROGRAM
C
C     VARIABLE                   DESCRIPTION
C     TFB(AGE,P)                 TOTAL FLEET FTP BEFORE INSPECTION
C     TFA(AGE.P)                 TOTAL FLEET FTP AFTER INSPECTION
C     F                          F-l PASSED THE TEST
C                                 =2 FAILED FOR HC ONLY
C                                 =3 FAILED FOR CO ONLY
C                                 =4 FAILED FOR BOTH
C     NF(F)                      NUMBER IN EACH GROUP
C     TOTFTP(P,F)                TOTAL FTP IN EACH GROUP
C     PR(P,BY)                   PERCENT REDUCTION ON JANUARY 1ST
C     AVGMIL(F)    '              AVERAGE MILEAGE FOR FAILURE GROUP
C
      COMMON/HSTRY/ TFB,TFA,NF,TOTFTP,AVGMIL,PR
      REAL*4 TFB(20,2))TFA(20,2),TOTFTP(2>4),AVGMIL(4)
      INTEGER*4 NF(4),PR(2,20)
C
C
C
C
C
C
C
C
C
C
C
C
C

THE 'BKGRND'

COMMON BLOCK CONTAINS BACKGROUND INFORMATION
NEEDED TO DEFINE THE I/M PROGRAM

VARIABLE
TECH
AGE1ST
MTP(BY)
CUTPTS(BY.P)

ESTSF
TABLES


DESCRIPTION
TECHNOLOGY NUMBER
AGE OF VEHICLES AT FIRST INSPECTION
MECHANIC TRAINING PERCENT AT BENEFIT YEAR 'BY1
IDLE CUTPOINTS AT BENEFIT YEAR 'BY'
FOR POLLUTANT 'P1
ESTIMATED STRINGENCY FACTOR
LOGICAL VARIABLE TO SUPRESS OUTPUT OF TABLES

      COMMON/BKGRND/TECH,AGE1ST,MTP,CUTPTS,ESTSF,TABLES
      INTEGER*4 TECH,AGE1ST,ESTSF
      REAL*4    CUTPTS(2,2,19,5),MTP(20)
      LOGICAL TABLES
C
      INTEGER BY,BYLAST,P,EED(19,20,5,2,2)
C
C  ,    THIS SUBROUTINE FORMS THE JANUARY 1 EMISSION REDUCTION
C      MATRIX FOR MOBILE2.
C      SINCE THE REDUCTIONS FORM A TRIANGULAR MATRIX,  HALF OF IT
C      IS STORED IN REVERSE ORDER IN THE LOWER HALF OF THE ARRAY
C      TO SAVE SPACE.
C
C      STEP 1
C      STORE THE CURRENT JANUARY REDUCTIONS IN THE REDUCTION
C      MATRIX.  IF THERE IS MECHANICS TRAINING, (MT=2),  STORE
C      THE REDUCTIONS IN THE LOWER HALF OF THE ARRAY.

-------
      BYLAST=20-AGE1ST
      IF(MT.EQ.2) GO TO 30
C
      DO 20 P=l,2
        DO 20 BY=1,BYLAST
 20       RED(BY,AGE1ST,ISTRIN,ITECH,P)=PR(P,BY)
      GO TO 40
C
 30   DO *35- P-l, 2
        DO 35 BY=1,BYLAST
 35       RED(20-BY,21-AGE1ST,ISTRIN,ITECH,P)=PR(P,BY)
C
C      STEP 2
C      IF THE I/M SEQUENCE IS COMPLETE, WRITE OUT THE MATRIX IN THE
C      FORM OF 20 DATA BLOCKS FOR USE BY MOBILE2.
C
 40   IF(.NOT.((ITECH.EQ.2).AND.(ISTRIN.EQ.5)
     &    .AND.(MT.EQ.2).AND.(AGE1ST.EQ.19))) GO TO 99
C
      WRITE(5,100)
 100  FORMATCC      INSPECTION/MA INTENANCE PERCENT REDUCTIONS:')
C
      ICOUNT=1
C
      DO 90 P=l,2
        DO 90 ITECH-1,2
          DO 90 ISTRIN=1,5
C
            IF(ICOUNT.LT.IO)  WHITE(5,150) ICOUNT,
     &         (RED(BY,1,ISTRIN,ITECH,P),BY='1,19)
            IF(ICOUNT.GE.IO)  WRITE(5,160) ICOUNT,
     &         (RED(BY,l,ISTRIN,ITECH,P),BY=l,19)
 150        FORMAT(6X,'DATA R1,11,'/',19(12,','))
 160        FORMAT(6X,'DATA R',12,'/',19(12,','))
            ICOUNT=ICOUNT-t-l
C
            DO 60 AGE1ST=2,19
 60         WRITE(5,200)(RED(BY,AGE1ST,ISTRIN,ITECH,P),  BY=1,19)
 200        FORMATC5X,'*',8X,19(12,','))
C
            WRITE(5,250)(RED(BY,20,ISTRIN,ITECH,P), BY=1,19)
 250        FORMAT(5X,'*',8X,18(12,','),I2,'/')
C
 90   CONTINUE
C
 99   RETURN
      END

-------