我在F2008
module mod_Blood
use mod_liquid
implicit none
type, public :: typ_BloodComponents
character(len=5) :: name
real(DP):: salt
real(DP):: RBC
end type typ_BloodComponents
type, public :: typ_BloodWork
real(DP) :: DrugConc
real(DP) :: Dilution
real(DP) :: volume
type(typ_BloodComponents) :: vein, artery
contains
procedure :: SetParameters => blood_SetParameters
procedure :: BloodProteinParams => blood_BloodProteinParams
end type typ_BloodWork
end mod_Blood
我知道静脉和动脉都有变量静脉%名称,静脉%盐,静脉%RBC和动脉%名称,动脉%盐和动脉%RBC。
如何将其转移到 C#?模块是命名空间吗?FORTRAN“类型”是 C# 中的一个类吗?
如果我这样做是否有意义:
class BloodComponents
{
string name;
double salt;
double RBC;
}
class BloodWork
{
double drugConc
double dil
double volume
class Vein : BloodComponents
{}
class Artery : BloodComponents
{}
void SetParameters()
{...}
void BloodComponentParameter()
{...}
}
还是我对 FORTRAN 的解释有误?