%%%%%%%%%%%
% units.m %
%%%%%%%%%%%

M_IN_M  = (1);
CM_IN_M = (1e-2);
M_IN_CM = (1./CM_IN_M);
CM2_IN_M2 = (CM_IN_M * CM_IN_M);
M2_IN_CM2  = (1./CM2_IN_M2);

% barn is unit for cross-section %
  
BARN_IN_M2= (1e-24 * CM2_IN_M2);
M2_IN_BARN = (1./BARN_IN_M2);
CM3_IN_M3 = (CM2_IN_M2 * CM_IN_M);
M3_IN_CM3  = (1./CM3_IN_M3);
MM_IN_M   = (1e-3);
M_IN_MM    = (1./MM_IN_M);
UM_IN_M   = (1e-6);
M_IN_UM    = (1./UM_IN_M);
NM_IN_M   = (1e-9);
M_IN_NM    = (1./NM_IN_M);
A_IN_M    = (1e-10);
M_IN_A     = (1./A_IN_M);
A2_IN_M2  = (A_IN_M * A_IN_M);
M2_IN_A2   = (1./A2_IN_M2);
A3_IN_M3  = (A2_IN_M2 * A_IN_M);
M3_IN_A3   = (1./A3_IN_M3);
A_IN_CM   = (A_IN_M * M_IN_CM);
CM_IN_A    = (1./A_IN_CM);
A2_IN_CM2 = (A_IN_CM * A_IN_CM);
CM2_IN_A2  = (1./A2_IN_CM2);
A3_IN_CM3 = (A2_IN_CM2 * A_IN_CM);
CM3_IN_A3  = (1./A3_IN_CM3);
A_IN_MM   = (A_IN_M * M_IN_MM);
MM_IN_A    = (1./A_IN_MM);
A2_IN_MM2 = (A_IN_MM * A_IN_MM);
MM2_IN_A2  = (1./A2_IN_MM2);
A3_IN_MM3 = (A2_IN_MM2 * A_IN_MM);
MM3_IN_A3  = (1./A3_IN_MM3);
A_IN_UM   = (A_IN_M * M_IN_UM);
UM_IN_A    = (1./A_IN_UM);
A2_IN_UM2 = (A_IN_UM * A_IN_UM);
UM2_IN_A2  = (1./A2_IN_UM2);
A3_IN_UM3 = (A2_IN_UM2 * A_IN_UM);
UM3_IN_A3  = (1./A3_IN_UM3);
A_IN_NM   = (A_IN_M * M_IN_NM);
NM_IN_A    = (1./A_IN_NM);
A2_IN_NM2 = (A_IN_NM * A_IN_NM);
NM2_IN_A2  = (1./A2_IN_NM2);
A3_IN_NM3 = (A2_IN_NM2 * A_IN_NM);
NM3_IN_A3  = (1./A3_IN_NM3);
FEET_IN_M = (3.048e-01);
M_IN_FEET  = (1./FEET_IN_M);
INCH_IN_M = (FEET_IN_M / 12);
M_IN_INCH  = (1./INCH_IN_M);

LITER_IN_CM3 = 1000;
CM3_IN_LITER = (1./LITER_IN_CM3);
LITER_IN_M3 = LITER_IN_CM3 * CM3_IN_M3;
M3_IN_LITER = (1./LITER_IN_M3);

S_IN_S   = (1);
MS_IN_S  = (1e-3);
S_IN_MS   = (1./MS_IN_S);
US_IN_S  = (1e-6);
S_IN_US   = (1./US_IN_S);
NS_IN_S  = (1e-9);
S_IN_NS   = (1./NS_IN_S);
PS_IN_S  = (1e-12);
S_IN_PS   = (1./PS_IN_S);
FS_IN_S  = (1e-15);
S_IN_FS   = (1./FS_IN_S);
MIN_IN_S = (60.);
S_IN_MIN  = (1./MIN_IN_S);
HOUR_IN_S= (24 * MIN_IN_S);
S_IN_HOUR = (1./HOUR_IN_S);
% this is a solar year %
YEAR_IN_S= (31556925.974592);
S_IN_YEAR = (1./YEAR_IN_S);

KG_IN_KG = (1);
G_IN_KG  = (1e-3);
KG_IN_G   = (1./G_IN_KG);
TON_IN_KG= (1e3);
KG_IN_TON = (1./TON_IN_KG);

AVOIRDUPOIS_POUND_IN_KG =(0.4536);
KG_IN_AVOIRDUPOIS_POUND = (1./AVOIRDUPOIS_POUND_IN_KG);

AVOIRDUPOIS_OUNCE_IN_KG =(AVOIRDUPOIS_POUND_IN_KG / 16);

APOTHECARY_POUND_IN_KG= (0.37);
APOTHECARY_OUNCE_IN_KG= (APOTHECARY_POUND_IN_KG / 12);

N_IN_KG_M__S2 = (1.);
% Newton as force %
J_IN_KG_M2__S2= (1.); 
% Joule as energy %
W_IN_KG_M2__S3= (1.); 
% Watt as power   %
PA_IN_KG__M_S2= (1.); 
% Pascal as pressure %

% dyne as force %
DYNE_IN_N= (0.00001);
N_IN_DYNE= (1./DYNE_IN_N);

ERG_IN_J = (1E-07);
J_IN_ERG = (1./ERG_IN_J);

% Rad versus Degree for angles %
R_IN_D   = (180./pi);
D_IN_R   = (pi/180.);

% HZ is the unit of frequency (nu), one period per second %
HZ_IN__S = (1.);
KHZ_IN_HZ= (1e3);
HZ_IN_KHZ = (1./KHZ_IN_HZ);
MHZ_IN_HZ= (1e6);
HZ_IN_MHZ = (1./MHZ_IN_HZ);
GHZ_IN_HZ= (1e9);
HZ_IN_GHZ = (1./GHZ_IN_HZ);
THZ_IN_HZ= (1e12);
HZ_IN_THZ = (1./THZ_IN_HZ);

% R__S is the unit of circular frequency (omega) %
NU_IN_HZ_TO_OMEGA_IN_R__S = (2 * pi);
OMEGA_IN_R__S_TO_NU_IN_HZ = (1./NU_IN_HZ_TO_OMEGA_IN_R__S);
OMEGA_IN_R__S_TO_NU_IN_MHZ= (OMEGA_IN_R__S_TO_NU_IN_HZ * HZ_IN_MHZ);
OMEGA_IN_R__S_TO_NU_IN_GHZ= (OMEGA_IN_R__S_TO_NU_IN_HZ * HZ_IN_GHZ);
OMEGA_IN_R__S_TO_NU_IN_THZ= (OMEGA_IN_R__S_TO_NU_IN_HZ * HZ_IN_THZ);
NU_IN_MHZ_TO_OMEGA_IN_R__S= (1./OMEGA_IN_R__S_TO_NU_IN_MHZ);
NU_IN_GHZ_TO_OMEGA_IN_R__S= (1./OMEGA_IN_R__S_TO_NU_IN_GHZ);
NU_IN_THZ_TO_OMEGA_IN_R__S= (1./OMEGA_IN_R__S_TO_NU_IN_THZ);

% mnemonics %
HZ_IN_R__S   = NU_IN_HZ_TO_OMEGA_IN_R__S;
R__S_IN_HZ   = OMEGA_IN_R__S_TO_NU_IN_HZ;
OMEGA_TO_HZ  = OMEGA_IN_R__S_TO_NU_IN_HZ;
OMEGA_TO_MHZ = OMEGA_IN_R__S_TO_NU_IN_MHZ;
OMEGA_TO_GHZ = OMEGA_IN_R__S_TO_NU_IN_GHZ;
OMEGA_TO_THZ = OMEGA_IN_R__S_TO_NU_IN_THZ;
HZ_TO_OMEGA = (1./OMEGA_TO_HZ);
MHZ_TO_OMEGA= (1./OMEGA_TO_MHZ);
GHZ_TO_OMEGA= (1./OMEGA_TO_GHZ);
THZ_TO_OMEGA= (1./OMEGA_TO_THZ);

J_IN_J   = (1);
KJ_IN_J  = (1000.);
J_IN_KJ  = (1./KJ_IN_J);
% calorie as heat & energy %
CAL_IN_J = (4.1868);
J_IN_CAL = (1./CAL_IN_J);
KCAL_IN_J= (CAL_IN_J * 1000.);

MPA_IN_PA = (1e6);
PA_IN_MPA  = (1./MPA_IN_PA);
GPA_IN_PA = (1e9);
PA_IN_GPA  = (1./GPA_IN_PA);
ATM_IN_PA = (1.013250e+05);
PA_IN_ATM  = (1./ATM_IN_PA);
ATM_IN_MPA= (ATM_IN_PA * PA_IN_MPA);
MPA_IN_ATM = (1./ATM_IN_MPA);
ATM_IN_GPA= (ATM_IN_PA * PA_IN_GPA);
GPA_IN_ATM = (1./ATM_IN_GPA);
BAR_IN_PA = (1e+05);
PA_IN_BAR  = (1./BAR_IN_PA);
BAR_IN_MPA= (BAR_IN_PA * PA_IN_MPA);
MPA_IN_BAR = (1./BAR_IN_MPA);
BAR_IN_GPA= (BAR_IN_PA * PA_IN_GPA);
GPA_IN_BAR  = (1./BAR_IN_GPA);
MBAR_IN_BAR= (1e+06);
BAR_IN_MBAR = (1./MBAR_IN_BAR);
MBAR_IN_PA = (MBAR_IN_BAR * BAR_IN_PA);
PA_IN_MBAR  = (1./MBAR_IN_PA);
MBAR_IN_MPA= (MBAR_IN_BAR * BAR_IN_MPA);
MPA_IN_MBAR = (1./MBAR_IN_MPA);
MBAR_IN_GPA= (MBAR_IN_BAR * BAR_IN_GPA);
GPA_IN_MBAR = (1./MBAR_IN_GPA);

% viscosity %
POISEUILLE_IN_PA_S = (1.);
PA_S_IN_POISEUILLE = (1./POISEUILLE_IN_PA_S);
POISE_IN_POISEUILLE = (0.1);
POISEUILLE_IN_POISE = (1./POISE_IN_POISEUILLE);
CENTIPOISE_IN_POISE = (0.01);
POISE_IN_CENTIPOISE = (1./CENTIPOISE_IN_POISE);
CENTIPOISE_IN_POISEUILLE = (CENTIPOISE_IN_POISE * POISE_IN_POISEUILLE);
POISEUILLE_IN_CENTIPOISE = (1./CENTIPOISE_IN_POISEUILLE);
CENTIPOISE_IN_PA_S = (CENTIPOISE_IN_POISEUILLE * POISEUILLE_IN_PA_S);
PA_S_IN_CENTIPOISE = (1./CENTIPOISE_IN_PA_S);

%* this world's physical constants *%

% Boltzmann constant kB %
% version around 2000
BOLZ_IN_J__K= (1.380658e-23);
BOLZ_IN_J__K= (1.380649e-23); 
% Effective from 20 May 2019, the international System of Units
BOLZ = BOLZ_IN_J__K;

% Planck constant h %
% PLANCK_IN_J_S = (6.6260755e-34);
PLANCK_IN_J_S = 6.62607015e-34;

PLANCK_IN_J__HZ = PLANCK_IN_J_S;
PLANCK         =  PLANCK_IN_J_S;
HBAR_IN_J_S__R= (PLANCK_IN_J_S / 2 / pi);
HBAR          =   HBAR_IN_J_S__R;

% Elementary charge e %
%ifndef ELEMENTARY_CHARGE_IN_C
ELEMENTARY_CHARGE_IN_C= (1.60217733e-19);
ELEMENTARY_CHARGE_IN_C= (1.602176634e-19);
% Effective from 20 May 2019, the international System of Units

%endif
ELEMENTARY_CHARGE  =      ELEMENTARY_CHARGE_IN_C;
EV_IN_J = ELEMENTARY_CHARGE_IN_C;
J_IN_EV  = (1./EV_IN_J);
MEV_IN_EV = 1e+6;
EV_IN_MEV = (1./MEV_IN_EV);
MEV_IN_J = (MEV_IN_EV * EV_IN_J);
J_IN_MEV  = (1./MEV_IN_J);
mEV_IN_EV = 1e-3;
EV_IN_mEV = (1./mEV_IN_EV);
mEV_IN_J = (mEV_IN_EV * EV_IN_J);
J_IN_mEV  = (1./mEV_IN_J);

ERG_IN_EV= (ERG_IN_J * J_IN_EV);
EV_IN_ERG= (1./ERG_IN_EV);

% Avogadro constant %
AVO      = (6.02214199e+23);
AVO      = (6.02214076e+23);
% Effective from 20 May 2019, the international System of Units

KJ__MOL_IN_EV  = (KJ_IN_J * J_IN_EV / AVO);
EV_IN_KJ__MOL   = (1./KJ__MOL_IN_EV);

KCAL__MOL_IN_EV= (KCAL_IN_J * J_IN_EV / AVO);
EV_IN_KCAL__MOL = (1./KCAL__MOL_IN_EV);

% Faraday constant
FARADAY_IN_C__MOL = ELEMENTARY_CHARGE_IN_C * AVO;
FARADAY = FARADAY_IN_C__MOL;

% (Electric) epsilon_0 %
%ifndef VACUUM_PERMITTIVITY_IN_C2__J_M  
VACUUM_PERMITTIVITY_IN_C2__J_M= (8.854187817e-12);
VACUUM_PERMITTIVITY_IN_C2__J_M= (8.8541878128e-12);
% Effective from 20 May 2019, the international System of Units
%endif
VACUUM_PERMITTIVITY      =       VACUUM_PERMITTIVITY_IN_C2__J_M;

% (Magnetic) mu_0 %
%ifndef VACUUM_PERMEABILITY_IN_T2_M3__J  
VACUUM_PERMEABILITY_IN_T2_M3__J= (4e-7 * pi);
%endif
VACUUM_PERMEABILITY       =       VACUUM_PERMEABILITY_IN_T2_M3__J;

% speed of light in vacuum %
LIGHT_SPEED_IN_M__S = (1./sqrt(VACUUM_PERMITTIVITY * VACUUM_PERMEABILITY));
LIGHT_SPEED =  LIGHT_SPEED_IN_M__S;

% wavenumber %
WAVENUMBER__CM_IN_HZ = (LIGHT_SPEED * M_IN_CM);
WAVENUMBER__CM_IN_J  = (WAVENUMBER__CM_IN_HZ * PLANCK_IN_J__HZ);
WAVENUMBER__CM_IN_EV = (WAVENUMBER__CM_IN_J * J_IN_EV);
WAVENUMBER__CM_IN_mEV = (WAVENUMBER__CM_IN_EV * EV_IN_mEV);

AMU_IN_KG= (G_IN_KG / AVO);
KG_IN_AMU= (1./AMU_IN_KG);
AMU_IN_G = (1. / AVO);
G_IN_AMU = (1./AMU_IN_G);
    
M3__MOL_IN_A3__ATOM= (M3_IN_A3 / AVO);
A3__ATOM_IN_M3__MOL= (1./M3__MOL_IN_A3__ATOM);
    
MOL__M3_IN_ATOM__A3 = A3__ATOM_IN_M3__MOL;
ATOM__A3_IN_MOL__M3 = M3__MOL_IN_A3__ATOM;

G__CM3_IN_KG__M3 = (G_IN_KG / CM3_IN_M3);
KG__M3_IN_G__CM3 = (1./G__CM3_IN_KG__M3);
G__CM3_IN_AMU__A3= (G_IN_AMU / CM3_IN_A3);
AMU__A3_IN_G__CM3= (1./G__CM3_IN_AMU__A3);

M3__KG_IN_CM3__G  = G__CM3_IN_KG__M3;
CM3__G_IN_M3__KG  = KG__M3_IN_G__CM3;
A3__AMU_IN_CM3__G = G__CM3_IN_AMU__A3;
CM3__G_IN_A3__AMU = AMU__A3_IN_G__CM3;

% electron's rest mass %
%ifndef ELECTRON_REST_MASS_IN_KG
ELECTRON_REST_MASS_IN_KG= (9.1093897e-31);
%endif
ELECTRON_REST_MASS  =     ELECTRON_REST_MASS_IN_KG;

% Newton's "universal" law %
%ifndef GRAVITATIONAL_CONSTANT_IN_J_M__KG2
GRAVITATIONAL_CONSTANT_IN_J_M__KG2= (6.67384e-11);
%endif
GRAVITATIONAL_CONSTANT    =          GRAVITATIONAL_CONSTANT_IN_J_M__KG2;

% hydrogen's electronic semi-classical orbit %
%ifndef BOHR_RADIUS_IN_M
BOHR_RADIUS_IN_M= (5.29177e-11);
%endif
BOHR_RADIUS_IN_A= (BOHR_RADIUS_IN_M * M_IN_A);
HARTREE_IN_J= (ELEMENTARY_CHARGE * ELEMENTARY_CHARGE ...
               / 4 / pi / VACUUM_PERMITTIVITY / BOHR_RADIUS_IN_M);
HARTREE_IN_EV= (HARTREE_IN_J * J_IN_EV);
HARTREE_IN_KJ__MOL= (HARTREE_IN_EV * EV_IN_KJ__MOL);
KJ__MOL_IN_HARTREE= (1./HARTREE_IN_KJ__MOL);
HARTREE_IN_KCAL__MOL= (HARTREE_IN_EV * EV_IN_KCAL__MOL);
KCAL__MOL_IN_HARTREE= (1./HARTREE_IN_KCAL__MOL);

RYDBERG_IN_EV= (HARTREE_IN_EV / 2.);
EV_IN_RYDBERG= (1./RYDBERG_IN_EV);

% earth's average gravitational acceleration %
%ifndef EARTH_G_IN_M__S2
EARTH_G_IN_M__S2= (9.80665);
%endif
EARTH_G      =     EARTH_G_IN_M__S2;

% temperature measures %   
ABSOLUTE_ZERO_SHIFT = 273.15;
% CENTIGRADE_TO_K(C)= ((C)+ABSOLUTE_ZERO_SHIFT); %
% K_TO_CENTIGRADE(K)= ((K)-ABSOLUTE_ZERO_SHIFT); %
% FAHRENHEIT_TO_CENTIGRADE(F)= (((F)-32.)*5./9.); %
% CENTIGRADE_TO_FAHRENHEIT(C)= ((C)*9./5.+32.); %
% FAHRENHEIT_TO_K(F) (CENTIGRADE_TO_K(FAHRENHEIT_TO_CENTIGRADE(F))); %
% K_TO_FAHRENHEIT(K) (CENTIGRADE_TO_FAHRENHEIT(K_TO_CENTIGRADE(K))); %

EV__A3_IN_GPA = EV_IN_J / A3_IN_M3 / 1e9;
