diff --git a/utils/obsproc/Ghrsst2Ioda.h b/utils/obsproc/Ghrsst2Ioda.h index 382572736..ccc22d6cc 100644 --- a/utils/obsproc/Ghrsst2Ioda.h +++ b/utils/obsproc/Ghrsst2Ioda.h @@ -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); @@ -135,9 +131,9 @@ namespace gdasapp { preqc[i][j] = 5 - static_cast(sstPreQC[0][i][j]); // bias corrected sst, regressed to the drifter depth - sst[i][j] = static_cast(sstObsVal[index]) * sstScaleFactor + sstOffSet + // Remove added sstOffSet for Celsius + sst[i][j] = static_cast(sstObsVal[index]) * sstScaleFactor - static_cast(sstObsBias[index]) * biasScaleFactor; - // mask if (sst[i][j] >= sstMin && sst[i][j] <= sstMax && preqc[i][j] ==0) { mask[i][j] = 1; diff --git a/utils/obsproc/NetCDFToIodaConverter.h b/utils/obsproc/NetCDFToIodaConverter.h index 9ff176c16..c2a2e8ace 100644 --- a/utils/obsproc/NetCDFToIodaConverter.h +++ b/utils/obsproc/NetCDFToIodaConverter.h @@ -120,7 +120,8 @@ namespace gdasapp { ioda::Variable iodaDatetime = ogrp.vars.createWithScales("MetaData/dateTime", {ogrp.vars["Location"]}, long_params); - iodaDatetime.atts.add("units", {iodaVarsAll.referenceDate_}, {1}); + // TODO(MD): Make sure units with iodaVarsAll when applying mpi + iodaDatetime.atts.add("units", {iodaVars.referenceDate_}, {1}); ioda::Variable iodaLat = ogrp.vars.createWithScales("MetaData/latitude", {ogrp.vars["Location"]}, float_params); diff --git a/utils/test/testinput/gdas_ghrsst2ioda.yaml b/utils/test/testinput/gdas_ghrsst2ioda.yaml index cd3ae6537..02c6cd78e 100644 --- a/utils/test/testinput/gdas_ghrsst2ioda.yaml +++ b/utils/test/testinput/gdas_ghrsst2ioda.yaml @@ -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 diff --git a/utils/test/testref/ghrsst2ioda.test b/utils/test/testref/ghrsst2ioda.test index 35e2ed25f..4700f1264 100644 --- a/utils/test/testref/ghrsst2ioda.test +++ b/utils/test/testref/ghrsst2ioda.test @@ -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