I've got this (very old fashioned) piece of code
The purpose is to use variables defined in the common statement (integer) to address elements in an array 'by name' (specifically, I'm talking about chemical species), e.g.
My question is: how to avoid using common and equivalence to translate this in fortran 90 standard?
Code:
COMMON /CHDATA/ HNO3 , HONO , HNO4 , CO , HO2H , OOH ,
& PAN , PPN , HCHO , CCHO , RCHO , MEK ,
& RNO3 , MGLY , AFG2 , SO2 , ETHE , OLE1 ,
& OLE2 , OLE3 , OLE4 , ALK1 , ALK2 , ARO1 ,
& ARO2 , O3 , NO , NO2 , NO3 , N2O5 ,
& HO2 , RO2 , CCO3 , C2CO , CRES
DIMENSION KINT(35)
EQUIVALENCE (KINT,KHNO3)
[...]
DATA KINT /1,2,3,4,5,6,7,8,9,10,....
The purpose is to use variables defined in the common statement (integer) to address elements in an array 'by name' (specifically, I'm talking about chemical species), e.g.
Code:
REAL conc(35)
print*,conc(HNO3)
My question is: how to avoid using common and equivalence to translate this in fortran 90 standard?