Initialisation data may be specified in a Fortran program in several ways, for example:
REAL(KIND=4),PARAMETER :: dtr = ATAN(1.0)/90.0 REAL lat / 52.18 / REAL(KIND=4) :: lon = -ATAN((180.0/COS(52.18*dtr))/3960.0)/dtr ! 180 miles west REAL(KIND=4) :: ht DATA ht / 245.0 /
As in the case of Fortran parameters, the real and complex values in the data specifications must all be converted to the emulated derived types when the variables are converted. When a Fortran parameter occurs in a data specification, the value component must be specified, even though this is the only component in the derived type. The converted code is:
TYPE (em_real_k4),PARAMETER :: dtr = em_real_k4(ATAN(1.0)/90.0) TYPE (em_real_k4) lat / em_real_k4(52.18) / TYPE (em_real_k4) :: lon = em_real_k4(-ATAN((180.0/COS(52.18*dtr%value))/3960.0)/dtr%value) ! 180 miles west TYPE (em_real_k4) :: ht DATA ht / em_real_k4(245.0) /