Please enable JavaScript.
Coggle requires JavaScript to display documents.
Main.f90, interv - asks about and designates interventions for DE cells
…
Main.f90
Modaray.f90 (modary)
-
-
-
modary - model initialization
- asks user whether adding risk factors
-- if yes, calls addrfs
- deletes .def modifies and copies Input folder versions to module and throws errors if not found (first population and DE files and second DH specific files)
- asks users about whether to modify core arrays (e.g., PopUSA, PRFP; currently 32 options)
- Calls initial
- describes the "unpacking" of the MDIS-style array final column for different number of risk factors
- Assigns mean values to cells played out in the MDIS-style format
- generates modrfp (used to adjust pop distribution based on prevalences without disrupting calibration to incidence (i.e., hold alpha constant)
- calls ipfalg (iterative proportional fitting) to generate adjusted RFP for diabetes and HF, and regular RFP for DE overall
- generates adjusted incidences (e.g., incadj, incstrokadj, incchfadj) that will be used in fitting alpha
- calls intercpt to calculate alphas that are fit to incidence inputs
-
-
explan (subroutine in Main if error in initialization, kicks a missing file error)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
interv - asks about and designates interventions for DE cells
- user questions/inputs to set up DE interventions (what factors to adjust and how/magnitude; among whom to intervene; intervention cost and QALY tolls; includes a different series of questions/inputs for each risk factor extension)
- loops through cells and flags each as intervened or not; then adjusts risk factor averages using calculations specific to the type of change; followed by BMI link adjustments from interventions
- ends with inquiry about DH interventions and stops there
core internal vars:
- nintr (number of DE interventions)
- icount = number of levels within a given effect size intervention (max of 10)
- ntype(nintr) = percent, absolute, or redefine
- adj(nintr) = magnitude of adjustment
- provost(nintr) - intervention cost for a cell
- prvlif(nintr) = QALY reduction each year of specific treatment assigned to a cell
- icellon(I, j) = 1 if intervene, 0 if not (need to clarify how it iterates)
- decellstat(nintr,iage,isex, idbp, isc, ismok, imrwi) <<- stores info on whether intervention hits cell and and the risk factor to intervene on (later ncat); has dimension of up to 300 interventions, 6 levels of age, 2 levels of gender, 3, 3, 3, up to 243 in last column)
- celltouch(indexed on age, sex, and all risk factors) - set to 1 if touched during intervention; cumulative array for all interventions
- decellvals(sintr, tage, sex, idbp, isk, ismok, imrwi) contains data on costs and qaly adjustments for intervention
-
addrfs - adding risk factors beyond 4
- prompt users (or read in .inp info) on risk factor setup
- based on responses, sets up model to understand file dimention expectations (e.g. 8spk has 8 risk factors, MDIS last column of 243, etc)
core internal variables:
- ibase = basic RF set (e.g., 4)
- irft= number of risk factors in setup for model purposes
- rfn = number attached to risk factor extension (e.g. 6 in 6sbd)
- rfk = risk factor extension (e.g., sbp)
- SBPflag = 1 if SBP included; 0 if not
- irfdem = dimensionality of the final column in MDIS-like files (e.g., 27 for 6 risk factors, 243 for 8)
intercpt - determines alpha calibrated to incidence and contains the following subroutines used in determining the alphas
- funcd
- rtsafe (Newton-Raphson method from Numerical Recipes)
-
ipfalg - iterative proportional fitting procedure that creates the to create RFP (MDIS+PRFP/xprfp)
- calls subs margins and margins, which calculate the marginal distributions from the RFP
core output:
- RFP.dat written to Input folder
- rfphf.dat and RFPdia.dat written to Output folder
askspecs - sets up years for simulation, print, CEA sums, and discount factor; establishes whether there are DE and DH interventions and years these will start
core internal variables:
summation start and end years (isumst, isumstp); discount info (dr = discount rate; ndry = start year); summation start and end years (isumst, isumstp); variables indicating whether there are interventions in DE and/or DH and start years
initbd - initialization subroutine for the DH module
- reads in CHDR and chdr35, state QALY weights, event QALY tolls
- calculates starting CVD population over age and gender and distributed into states
core output written to Input folder
- nnchd(iage, isex, kstate) -- individual ages and kstate=1, ndhstate; ndhstate currently =10
- nnchd35.dat (incoming 35 year old population over simulation)
dynamc - determines the risk of events in each cell
- collapses age to age range
- calculates and prints annual PRFP and RSKAV
- rate subroutine is called to calculate rate of each outcome (with CHD calls there is some smoking category complications)
- cycle through all cells to compute non-cvd population, cvd population, number of deaths, number of 95yo survivors, and number treated; loops are done age-by-age starting at the oldest (94 years) and moving them to 95 yo survivors and ending with the addition of the new 35 year olds
core output:
- prfpann(nage,isex,icat,ilvl) = annual PRFP = nnmargin(nage,isex,icat,ilvl)/nntotsum(nage,isex)
- rskaveann(nage, aises, icat, ilvl)=rskavesum(nage,isex,icat,ilvl)/nnmargin(nage,isex,icat,ilvl)
core internal variables:
- oldpop - count of people stratified into DE cells, gets set to the population in the prior year before removing events and deaths
- tpopb(nage,isex) = population by age and sex at the beginning of the year
- n95(isex) = number of 95 year olds remaining after those who died or moved to DH in the 95th year are removed
- nn(nage+1, aises, idbp, musc, ismok, i-everything-else) = oldpop(prob stayed in DE)(prob survived non-CVD death)
- mm(I, idbp, isc, ismok, all-others) = nn(age+1... this becomes the updated population
- nchd(nage, aises) = need to clarify
- nchds(nage, aises) = need to clarify
- nchdps = need to clarify
- brgcvd(by cell) = number of new CHD cases
- nod(nage, aises) = number of non-CVD deaths
- nstrokde(nage, isex) = number of new ischemic strokes = rate of ischemic stroke stroke x DE population less those dying from non-CVD death
- nhstrokde(nage, aises) = number of new hem strokes in DE
- tpop(nage,isex) = total DE pop by age and sex, collapses nn over risk factors
- tcbkg(nage, isex) = background costs as a linear function of the square root of the non-cvd death rate
- itreat(number of DE interventions, age, sex, and all risk factor cell combinations) = indicator of cell touched * starting population
- variables representing new intervened outcomes by age and sex (xnodi, nchdi, intstrok, inthstrok, nchditot, folktreat
transp - calculates event and death probabilities and unit costs to be used by bridge and dynamdh
- calls timekeeper, date and time
- calls interp1 (evaluates user input
- prompts user for DH interventions and intervention type (primary DH var, secondary or risk factor adjustment, or both); depending on choice, calls picfile, choos, dosedit, newfile, delfile; includes whether to change choice of DH file through modfile selection
- interdh - called when user wants to conduct a DH risk factor intervention; calls deter to mark information on interventions; collects cost and QALY per intervention information; flags cells for intervention
- initdh - called when user choses a DH event value adjustment
- calculates probabilities of events and deaths for bridge (pbridg, psbridg, ppsbridg;) and
Core internal variables:
- elev12th = 11.0/12.0 for 11 out of 12 months in bridge sub
- arrynum = ageramge*2
- interp1: inum = largest valid number; ins = returned interpreted answer
- chg: array = name of array being modified; ins = variable subscript being modified; iflg = type of change (=1 for single value change; =2 for 1-D array; =3 for 2-D array); ival = returned value
- pereduc(I,j,k)
- bridge event probabilities: pbridg, psbridg, ppsbridg
- bridge death probabilities: dbridg, dsbridg, dpsbridg
- DH event probabilities: pe(age range, sex, state, event), peP
Variables in interdh:
- nintr = intervention counter
- dhadj = magnitude of adjustment for risk factor intervention
- I think deter collects information on what cells are intervened on
- cost = cost collected according to intervention
- qalyans = reduction in qalys per intervention
- icellon(I,j) = flag for intervention
- ntyp = indicator for percent, absolute, or reset intervenion
- rfpctadj = percent that the risk factor will be adjusted in a given intervention (New mean/old mean; percent multiplier for the old mean to get the adjusted intervened mean)
Main - Model brain stem
- contains modules to store/pass variables
- calls all subroutines
- embeds one minor subroutine (explan)
<-- modules in Main
replaces "common blocks" and allows use of variables throughout the model subroutines
subroutines -->
chunks of code that are called up to complete model tasks (listed in order of operation); first level subroutines are called by Main itself; additional subroutine calls are embedded within the given subroutines
figure out subroutines (or "calls")
- timekeeper (called in main)
- date and time (in modary)
- system (called in modary) - I think this is basically telling the "cmd" window to delete and then copy stuff from one directory to another
- interp1 (called in modary I think about what will be through modfile)
- picfile (in modary I think is selecting modified file from list)
- choos (I think asks for the file to alter)
- doseedit
- Newfile (I think indicates new file to use in modfile)
- delfile (I believe somehow replaces old file with new file)
-
Business end of the DH population starting state and transitions based on new events in the year; applies probabilities of events to states (including 1-10 DH states and the "rest of the year following event" DH states 11-17)
Initial - reads in all core model files defining the population and risk factors to set up DE and the split of population into DH; good place to check for variable names for user-defined arrays as understood by FORTRAN throughout the code
subs.f90 - contains many subroutines and functions used in various parts of the model (shorter routines, several no longer used but still included)
year
deter (interprets and evaluates one-to-many user inputs for interv)
readinpt
rdn
dosfile
rdfile
crtfile
chgary
ask
bad (simple routine to throw an error when input is illogical)
chg1 (used when changing single value)
ctype (small sub for defining the type of intervention - percent, absolute, or reset)
killfile
interp1 (how to interpret an input from the user (ins) vis-a-vis maximum valid number (inum)
yesno (
timekeeper
badyr (invoked to tell user their year inputs don't make sense)
pagebrk (relates to print routine)
pedit (allows editing of file I think through command window)
chasm (no longer used; replaced by DHRFP)
choos
picfile (employed when choosing a modfile replacement file option)
newfile (I think this is the entry for .out label but not sure)
delfile (not currently used; about deleting files I think)
dosedit (not a function we currently use)
INTEGER FUNCTION ssunpack to understand the MDIS-style file and the last column
bridge
- applies event and death probabilities for bridge to the population to determine new events, event type (with allocation built into CHD probabilities), and survived vs. fatal events