@@ -183,6 +183,7 @@ public class WriteNetCDFRichards1DDouble {
183
183
Variable psiICVar ;
184
184
Variable temperatureVar ;
185
185
Variable thetaVar ;
186
+ Variable saturationDegreeVar ;
186
187
Variable darcyVelocitiesVar ;
187
188
Variable darcyVelocitiesCapillaryVar ;
188
189
Variable darcyVelocitiesGravityVar ;
@@ -206,6 +207,7 @@ public class WriteNetCDFRichards1DDouble {
206
207
207
208
ArrayDouble .D2 dataPsi ;
208
209
ArrayDouble .D2 dataTheta ;
210
+ ArrayDouble .D2 dataSaturationDegree ;
209
211
ArrayDouble .D2 dataDarcyVelocities ;
210
212
ArrayDouble .D2 dataDarcyVelocitiesCapillary ;
211
213
ArrayDouble .D2 dataDarcyVelocitiesGravity ;
@@ -304,6 +306,10 @@ public void writeNetCDF() throws IOException {
304
306
dataFile .addVariableAttribute (thetaVar , new Attribute ("units" , " " ));
305
307
dataFile .addVariableAttribute (thetaVar , new Attribute ("long_name" , "theta for within soil and water depth." ));
306
308
309
+ saturationDegreeVar = dataFile .addVariable (null , "saturationDegree" , DataType .DOUBLE , dims );
310
+ dataFile .addVariableAttribute (saturationDegreeVar , new Attribute ("units" , "1" ));
311
+ dataFile .addVariableAttribute (saturationDegreeVar , new Attribute ("long_name" , "saturation degree." ));
312
+
307
313
if (outVariablesList .contains ("darcyVelocity" ) || outVariablesList .contains ("all" )) {
308
314
darcyVelocitiesVar = dataFile .addVariable (null , "darcyVelocity" , DataType .DOUBLE , dualDims );
309
315
dataFile .addVariableAttribute (darcyVelocitiesVar , new Attribute ("units" , "m/s" ));
@@ -431,6 +437,7 @@ public void writeNetCDF() throws IOException {
431
437
dataPsi = new ArrayDouble .D2 (NREC , KMAX );
432
438
dataTheta = new ArrayDouble .D2 (NREC , KMAX );
433
439
dataWaterVolume = new ArrayDouble .D2 (NREC , KMAX );
440
+ dataSaturationDegree = new ArrayDouble .D2 (NREC , KMAX );
434
441
dataError = new ArrayDouble .D1 (NREC );
435
442
dataTopBC = new ArrayDouble .D1 (NREC );
436
443
dataBottomBC = new ArrayDouble .D1 (NREC );
@@ -502,8 +509,15 @@ public void writeNetCDF() throws IOException {
502
509
503
510
}
504
511
512
+ tempVariable = entry .getValue ().get (3 );
513
+ for (int k = 0 ; k < KMAX ; k ++) {
514
+
515
+ dataSaturationDegree .set (i , k , tempVariable [k ]);
516
+
517
+ }
518
+
505
519
if (outVariablesList .contains ("darcyVelocity" ) || outVariablesList .contains ("all" )) {
506
- tempVariable = entry .getValue ().get (3 );
520
+ tempVariable = entry .getValue ().get (4 );
507
521
for (int k = 0 ; k < DUALKMAX ; k ++) {
508
522
509
523
dataDarcyVelocities .set (i , k , tempVariable [k ]);
@@ -512,7 +526,7 @@ public void writeNetCDF() throws IOException {
512
526
}
513
527
514
528
if (outVariablesList .contains ("darcyVelocityCapillary" ) || outVariablesList .contains ("all" )) {
515
- tempVariable = entry .getValue ().get (4 );
529
+ tempVariable = entry .getValue ().get (5 );
516
530
for (int k = 0 ; k < DUALKMAX ; k ++) {
517
531
518
532
dataDarcyVelocitiesCapillary .set (i , k , tempVariable [k ]);
@@ -521,7 +535,7 @@ public void writeNetCDF() throws IOException {
521
535
}
522
536
523
537
if (outVariablesList .contains ("darcyVelocityGravity" ) || outVariablesList .contains ("all" )) {
524
- tempVariable = entry .getValue ().get (5 );
538
+ tempVariable = entry .getValue ().get (6 );
525
539
for (int k = 0 ; k < DUALKMAX ; k ++) {
526
540
527
541
dataDarcyVelocitiesGravity .set (i , k , tempVariable [k ]);
@@ -530,7 +544,7 @@ public void writeNetCDF() throws IOException {
530
544
}
531
545
532
546
if (outVariablesList .contains ("poreVelocity" ) || outVariablesList .contains ("all" )) {
533
- tempVariable = entry .getValue ().get (6 );
547
+ tempVariable = entry .getValue ().get (7 );
534
548
for (int k = 0 ; k < DUALKMAX ; k ++) {
535
549
536
550
dataPoreVelocities .set (i ,k , tempVariable [k ]);
@@ -539,7 +553,7 @@ public void writeNetCDF() throws IOException {
539
553
}
540
554
541
555
if (outVariablesList .contains ("celerity" ) || outVariablesList .contains ("all" )) {
542
- tempVariable = entry .getValue ().get (7 );
556
+ tempVariable = entry .getValue ().get (8 );
543
557
for (int k = 0 ; k < DUALKMAX ; k ++) {
544
558
545
559
dataCelerity .set (i ,k , tempVariable [k ]);
@@ -548,21 +562,21 @@ public void writeNetCDF() throws IOException {
548
562
}
549
563
550
564
if (outVariablesList .contains ("kinematicRatio" ) || outVariablesList .contains ("all" )) {
551
- tempVariable = entry .getValue ().get (8 );
565
+ tempVariable = entry .getValue ().get (9 );
552
566
for (int k = 0 ; k < DUALKMAX ; k ++) {
553
567
554
568
dataKinematicRatio .set (i ,k , tempVariable [k ]);
555
569
556
570
}
557
571
}
558
572
559
- dataError .set (i , entry .getValue ().get (9 )[0 ]);
573
+ dataError .set (i , entry .getValue ().get (10 )[0 ]);
560
574
561
- dataTopBC .set (i , entry .getValue ().get (10 )[0 ]);
575
+ dataTopBC .set (i , entry .getValue ().get (11 )[0 ]);
562
576
563
- dataBottomBC .set (i , entry .getValue ().get (11 )[0 ]);
577
+ dataBottomBC .set (i , entry .getValue ().get (12 )[0 ]);
564
578
565
- dataRunOff .set (i , entry .getValue ().get (12 )[0 ]);
579
+ dataRunOff .set (i , entry .getValue ().get (13 )[0 ]);
566
580
567
581
i ++;
568
582
}
@@ -579,7 +593,8 @@ public void writeNetCDF() throws IOException {
579
593
dataFile .write (dataFile .findVariable ("time" ), time_origin , times );
580
594
dataFile .write (dataFile .findVariable ("psi" ), origin , dataPsi );
581
595
dataFile .write (dataFile .findVariable ("theta" ), origin , dataTheta );
582
- dataFile .write (dataFile .findVariable ("waterVolume" ), origin , dataWaterVolume );
596
+ dataFile .write (dataFile .findVariable ("waterVolume" ), origin , dataWaterVolume );
597
+ dataFile .write (dataFile .findVariable ("saturationDegree" ), origin , dataSaturationDegree );
583
598
584
599
if (outVariablesList .contains ("darcyVelocity" ) || outVariablesList .contains ("all" )) {
585
600
dataFile .write (dataFile .findVariable ("darcyVelocity" ), origin , dataDarcyVelocities );
0 commit comments