Skip to content

Commit 168c812

Browse files
committed
Add new getInstance method.
1 parent b1f9541 commit 168c812

File tree

1 file changed

+49
-5
lines changed
  • src/main/java/it/geoframe/blogspot/closureequation/closureequation

1 file changed

+49
-5
lines changed

src/main/java/it/geoframe/blogspot/closureequation/closureequation/Parameters.java

Lines changed: 49 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,28 @@ public static Parameters getInstance() {
1313
}
1414

1515
public static Parameters getInstance(double waterDensity, double iceDensity, double specificThermalCapacityWater,
16-
double specificThermalCapacityIce, double thermalConductivityWater, double thermalConductivityIce, double latentHeatFusion, double temperatureRef,
16+
double specificThermalCapacityIce, double thermalConductivityWater, double thermalConductivityIce, double latentHeatFusion, double referenceTemperatureInternalEnergy,
17+
double referenceTemperatureSWRC, double beta0,
1718
double[] thetaS, double[] thetaR, double[] soilParticlesDensity, double[] specificThermalCapacitySoilParticles, double[] thermalConductivitySoilParticles,
1819
double[] meltingTemperature, double[] par1, double[] par2, double[] par3, double[] par4, double[] par5, double[] kappaSaturation,
1920
double[] alphaSpecificStorage, double[] betaSpecificStorage) {
2021
if (uniqueInstance == null) {
2122
uniqueInstance = new Parameters(waterDensity, iceDensity, specificThermalCapacityWater,
22-
specificThermalCapacityIce, thermalConductivityWater, thermalConductivityIce, latentHeatFusion, temperatureRef,
23+
specificThermalCapacityIce, thermalConductivityWater, thermalConductivityIce, latentHeatFusion, referenceTemperatureInternalEnergy, referenceTemperatureSWRC, beta0,
2324
thetaS, thetaR, soilParticlesDensity, specificThermalCapacitySoilParticles, thermalConductivitySoilParticles,
2425
meltingTemperature, par1, par2, par3, par4, par5, kappaSaturation, alphaSpecificStorage, betaSpecificStorage);
2526
}
2627
return uniqueInstance;
2728
}
2829

30+
public static Parameters getInstance(double referenceTemperatureSWRC, double beta0, double[] thetaS, double[] thetaR, double[] par1, double[] par2, double[] par3, double[] par4, double[] par5, double[] kappaSaturation,
31+
double[] alphaSpecificStorage, double[] betaSpecificStorage) {
32+
if (uniqueInstance == null) {
33+
uniqueInstance = new Parameters(referenceTemperatureSWRC, beta0, thetaS, thetaR, par1, par2, par3, par4, par5, kappaSaturation, alphaSpecificStorage, betaSpecificStorage);
34+
}
35+
return uniqueInstance;
36+
}
37+
2938

3039
public double waterDensity;
3140
public double iceDensity;
@@ -34,7 +43,10 @@ public static Parameters getInstance(double waterDensity, double iceDensity, dou
3443
public double thermalConductivityWater;
3544
public double thermalConductivityIce;
3645
public double latentHeatFusion;
37-
public double temperatureRef;
46+
public double referenceTemperatureInternalEnergy;
47+
public double referenceTemperatureSWRC;
48+
public double beta0;
49+
3850
public double[] thetaS;
3951
public double[] thetaR;
4052
public double[] soilParticlesDensity;
@@ -52,7 +64,7 @@ public static Parameters getInstance(double waterDensity, double iceDensity, dou
5264

5365

5466
private Parameters(double waterDensity, double iceDensity, double specificThermalCapacityWater,
55-
double specificThermalCapacityIce, double thermalConductivityWater, double thermalConductivityIce, double latentHeatFusion, double temperatureRef,
67+
double specificThermalCapacityIce, double thermalConductivityWater, double thermalConductivityIce, double latentHeatFusion, double referenceTemperatureInternalEnergy, double referenceTemperatureSWRC, double beta0,
5668
double[] thetaS, double[] thetaR, double[] soilParticlesDensity, double[] specificThermalCapacitySoilParticles, double[] thermalConductivitySoilParticles,
5769
double[] meltingTemperature, double[] par1, double[] par2, double[] par3, double[] par4, double[] par5, double[] kappaSaturation,
5870
double[] alphaSpecificStorage, double[] betaSpecificStorage) {
@@ -63,7 +75,9 @@ private Parameters(double waterDensity, double iceDensity, double specificTherma
6375
this.thermalConductivityWater = thermalConductivityWater;
6476
this.thermalConductivityIce = thermalConductivityIce;
6577
this.latentHeatFusion = latentHeatFusion;
66-
this.temperatureRef = temperatureRef;
78+
this.referenceTemperatureInternalEnergy = referenceTemperatureInternalEnergy;
79+
this.referenceTemperatureSWRC = referenceTemperatureSWRC;
80+
this.beta0 = beta0;
6781
this.thetaS = thetaS.clone();
6882
this.thetaR = thetaR.clone();
6983
this.soilParticlesDensity = soilParticlesDensity.clone();
@@ -82,5 +96,35 @@ private Parameters(double waterDensity, double iceDensity, double specificTherma
8296

8397
}
8498

99+
100+
private Parameters(double referenceTemperatureSWRC, double beta0, double[] thetaS, double[] thetaR, double[] par1, double[] par2, double[] par3, double[] par4, double[] par5, double[] kappaSaturation,
101+
double[] alphaSpecificStorage, double[] betaSpecificStorage) {
102+
this.waterDensity = -9999.0;
103+
this.iceDensity = -9999.0;
104+
this.specificThermalCapacityIce = -9999.0;
105+
this.specificThermalCapacityWater = -9999.0;
106+
this.thermalConductivityWater = -9999.0;
107+
this.thermalConductivityIce = -9999.0;
108+
this.latentHeatFusion = -9999.0;
109+
this.referenceTemperatureSWRC = referenceTemperatureSWRC;
110+
this.beta0 = beta0;
111+
this.thetaS = thetaS.clone();
112+
this.thetaR = thetaR.clone();
113+
this.soilParticlesDensity = null;
114+
this.specificThermalCapacitySoilParticles = null;
115+
this.thermalConductivitySoilParticles = null;
116+
this.meltingTemperature = null;
117+
this.par1 = par1.clone();
118+
this.par2 = par2.clone();
119+
this.par3 = par3.clone();
120+
this.par4 = par4.clone();
121+
this.par5 = par5.clone();
122+
this.kappaSaturation = kappaSaturation.clone();
123+
this.alphaSpecificStorage = alphaSpecificStorage.clone();
124+
this.betaSpecificStorage = betaSpecificStorage.clone();
125+
126+
127+
}
128+
85129

86130
}

0 commit comments

Comments
 (0)