Skip to content

Commit

Permalink
Merge branch 'feature/submodule' into feature/submodule
Browse files Browse the repository at this point in the history
  • Loading branch information
CoryMartin-NOAA committed Jan 4, 2024
2 parents 0a604a1 + af74fb2 commit cfb8908
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 11 deletions.
8 changes: 2 additions & 6 deletions utils/obsproc/Ghrsst2Ioda.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@ namespace gdasapp {
fullConfig_.get("bounds.min", sstMin);
float sstMax;
fullConfig_.get("bounds.max", sstMax);
if ( sstUnits == "C" ) {
sstMin += 273.15;
sstMax += 273.15;
}

// Open the NetCDF file in read-only mode
netCDF::NcFile ncFile(fileName, netCDF::NcFile::read);
Expand Down Expand Up @@ -135,9 +131,9 @@ namespace gdasapp {
preqc[i][j] = 5 - static_cast<int>(sstPreQC[0][i][j]);

// bias corrected sst, regressed to the drifter depth
sst[i][j] = static_cast<float>(sstObsVal[index]) * sstScaleFactor + sstOffSet
// Remove added sstOffSet for Celsius
sst[i][j] = static_cast<float>(sstObsVal[index]) * sstScaleFactor
- static_cast<float>(sstObsBias[index]) * biasScaleFactor;

// mask
if (sst[i][j] >= sstMin && sst[i][j] <= sstMax && preqc[i][j] ==0) {
mask[i][j] = 1;
Expand Down
3 changes: 2 additions & 1 deletion utils/obsproc/NetCDFToIodaConverter.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,8 @@ namespace gdasapp {
ioda::Variable iodaDatetime =
ogrp.vars.createWithScales<int64_t>("MetaData/dateTime",
{ogrp.vars["Location"]}, long_params);
iodaDatetime.atts.add<std::string>("units", {iodaVarsAll.referenceDate_}, {1});
// TODO(MD): Make sure units with iodaVarsAll when applying mpi
iodaDatetime.atts.add<std::string>("units", {iodaVars.referenceDate_}, {1});
ioda::Variable iodaLat =
ogrp.vars.createWithScales<float>("MetaData/latitude",
{ogrp.vars["Location"]}, float_params);
Expand Down
1 change: 0 additions & 1 deletion utils/test/testinput/gdas_ghrsst2ioda.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ binning:
stride: 2
min number of obs: 1
bounds:
units: C
min: -3.0
max: 50.0
output file: ghrsst_sst_mb_20210701.ioda.nc
Expand Down
6 changes: 3 additions & 3 deletions utils/test/testref/ghrsst2ioda.test
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Reading: [ghrsst_sst_mb_202107010000.nc4,ghrsst_sst_mb_202107010100.nc4]
seconds since 1981-01-01T00:00:00Z
obsVal:
Min: 276.708
Max: 281.714
Sum: 10051.7
Min: 3.558
Max: 8.5635
Sum: 218.297
obsError:
Min: 0.32
Max: 0.61
Expand Down

0 comments on commit cfb8908

Please sign in to comment.