Skip to content

Commit

Permalink
[Add] WOSS Release 1.13.0
Browse files Browse the repository at this point in the history
  • Loading branch information
MetalKnight committed Aug 4, 2024
1 parent 2ce8f12 commit ca7a892
Show file tree
Hide file tree
Showing 26 changed files with 2,062 additions and 192 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -156,3 +156,10 @@ v1.12.6 - fixed gcc-13 warnings
- TCL examples updated to GEBCO 2023
- removed warning in woss::BellhopWoss
- changed URL of main WOSS website

v1.13.0 - Added support for SSP NetCDF4 databases generated from WOA2023 dataset
- added bellhop autotools test unit
- improved the WossTest framework
- woss::ResReader fixed importing of bellhop's SPL and arrivals from binary mode
- woss::WossDbManager - added support for importing bathymetry, SSP and sediment from a string
- woss::WossManager - added API to erase all WOSS instances
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
# whose support is gratefully acknowledged.


AC_INIT([WOSS], [1.12.6], [woss@guerra-tlc.com])
AC_INIT([WOSS], [1.13.0], [woss@guerra-tlc.com])
AM_INIT_AUTOMAKE([foreign subdir-objects])

AC_MSG_NOTICE([WOSS AC_PACKAGE_VERSION])
Expand Down
17 changes: 13 additions & 4 deletions doxy/Mainpage.dox
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* @author Federico Guerra - federico@guerra-tlc.com
*
* @version 1.12.6
* @version 1.13.0
*
* This document provides a short techical description of the <i>World Ocean Simulation System</i> (WOSS) library
* and of its integration into <i>Multi InteRfAce Cross Layer Extension</i> (NS-Miracle).<p>
Expand Down Expand Up @@ -153,7 +153,7 @@
* woss::BellhopCreator];
* <li> interface implementation and custom NetCDF db of monthly averaged SSPs,
* calculated with the TEOS-10 exact formula [6] based on the temperature, salinity and depth data taken
* from the World Ocean Atlas database of 2001 [7], 2005 [8], 2009 [9], 2013 [10] and 2018 [11]
* from the World Ocean Atlas database of 2001 [7], 2005 [8], 2009 [9], 2013 [10], 2018 [11] and 2023 [12]
* [woss::SspWoa2005Db, woss::SspWoa2005DbCreator];
* <li> interface implementation for the GEBCO NetCDF bathymetry databases
* (all versions: 1D, 2D, 2008, 2014, 2019, 2020, 2021, 2022) [12], [woss::BathyGebcoDb, woss::BathyGebcoDbCreator];
Expand Down Expand Up @@ -185,6 +185,7 @@
* <li> World Ocean Atlas 2009, https://www.nodc.noaa.gov/OC5/WOA09/pr_woa09.html .
* <li> World Ocean Atlas 2013, https://www.nodc.noaa.gov/OC5/woa13/ .
* <li> World Ocean Atlas 2018, https://www.nodc.noaa.gov/OC5/woa18/ .
* <li> World Ocean Atlas 2023, https://www.nodc.noaa.gov/OC5/woa23/ .
* <li> General bathymetric chart of the oceans, http://www.gebco.net .
* <li> National geophysical data center, seafloor surficial sediment descriptions,
* http://www.ngdc.noaa.gov/mgg/geology/deck41.html .
Expand Down Expand Up @@ -231,7 +232,7 @@
* @see woss::SSP, woss::SspWoa2005Db, woss::SspWoa2005DbCreator
*
*
* \section ssp_db_2013 World Ocean Atlas 2001, 2013 and 2018 SSP Databases
* \section ssp_db_2013 World Ocean Atlas 2001, 2013, 2018 and 2023 SSP Databases
*
* These databases contain monthly, seasonal and annual average of sound speed profiles, calculated with the TEOS-10
* exact formula, and based on the depth, temperature and salinity provided by the World Ocean Atlas.
Expand Down Expand Up @@ -1319,7 +1320,15 @@
* <li> TCL examples updated to GEBCO 2023
* <li> removed warning in woss::BellhopWoss
* <li> changed URL of main WOSS website
</ul>
* </ul>
* <li> <b>v.1.13.0</b> <ul>
* <li> Added support for SSP NetCDF4 databases generated from WOA2023 dataset
* <li> added bellhop autotools test unit
* <li> improved the WossTest framework
* <li> woss::ResReader fixed importing of bellhop's SPL and arrivals from binary mode
* <li> woss::WossDbManager - added support for importing bathymetry, SSP and sediment from a string
* <li> woss::WossManager - added API to erase all WOSS instances
* </ul>
* </ul>
**/

Expand Down
2 changes: 1 addition & 1 deletion samples/test_aloha_with_dbs.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ WOSS/Creator/Database/NetCDF/SSP/WOA2013/MonthlyAverage set debug 0
WOSS/Creator/Database/NetCDF/SSP/WOA2013/MonthlyAverage set woss_db_debug 0

set db_ssp [new "WOSS/Creator/Database/NetCDF/SSP/WOA2013/MonthlyAverage"]
$db_ssp setDbPathName "${opt(db_path)}/ssp/WOA2018/WOA2018_SSP_June.nc"
$db_ssp setDbPathName "${opt(db_path)}/ssp/WOA2023/WOA2023_SSP_July.nc"


WOSS/Creator/Database/NetCDF/Bathymetry/GEBCO set debug 0
Expand Down
4 changes: 3 additions & 1 deletion tests/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ LDADD = @NETCDF_LIBADD@ @NETCDF4_LIBADD@ @UW_WOSS_LIBADD@ @UW_WOSS_PHY_LIBADD@
#TEST_EXTENSIONS = .sh

# These are the tests programs.
TESTPROGRAMS = woss-coord-definitions-test-bin
TESTPROGRAMS = woss-coord-definitions-test-bin woss-bellhop-test-bin

if NETCDF_BUILD
#TESTPROGRAMS +=
Expand All @@ -48,6 +48,8 @@ TESTS = $(TESTPROGRAMS)
# Here's the source code for the programs.
woss_coord_definitions_test_bin_SOURCES = woss-test.cpp woss-coord-definitions-test.cpp

woss_bellhop_test_bin_SOURCES = woss-test.cpp woss-bellhop-test.cpp

EXTRA_DIST = woss-test.h

# Cleaning up files created during the process.
Expand Down
262 changes: 262 additions & 0 deletions tests/woss-bellhop-test.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,262 @@
/* WOSS - World Ocean Simulation System -
*
* Copyright (C) 2024 Federico Guerra
* and regents of the SIGNET lab, University of Padova
*
* Author: Federico Guerra - federico@guerra-tlc.com
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation;
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/

/*
* This software has been developed by Federico Guerra and SIGNET lab,
* University of Padova, in collaboration with the NATO Centre for
* Maritime Research and Experimentation (http://www.cmre.nato.int ;
* E-mail: pao@cmre.nato.int), whose support is gratefully acknowledged.
*/


/**
* @file woss-bellhop-test.cpp
* @author Federico Guerra
*
* \brief
*
*
*/


#include <iostream>
#include <vector>
#include "woss-test.h"

using namespace std;
using namespace woss;

class WossBellhopTest : public WossTest {

public:

WossBellhopTest();

virtual ~WossBellhopTest() {}

void setTxCoordZVector(vector<CoordZ>& tx) {
tx_coordz_vector.clear(); tx_coordz_vector = tx; }

void setRxCoordZVector(vector<CoordZ>& rx) {
rx_coordz_vector.clear(); rx_coordz_vector = rx; }

private:

virtual void doConfig();

virtual void doInit();

virtual void doRun();

vector<CoordZ> tx_coordz_vector;

vector<CoordZ> rx_coordz_vector;

vector<double> frequencies_vector;

string db_path;

string res_path;

};

WossBellhopTest::WossBellhopTest()
: WossTest(),
tx_coordz_vector(),
rx_coordz_vector(),
frequencies_vector(),
db_path(),
res_path("./bh_test_out/")
{

}

void WossBellhopTest::doConfig() {
setWossTestDebug(false);

setWossRandomGenStream(1);

setResDbCreatorDebug(false);
setResDbDebug(false);
setResDbUseBinary(false);
setResDbUseTimeArr(false);
setResDbUsePressure(false);
setResDbFilePath(res_path);
setResDbFileName("bh_test.bin");

setWossDbManagerDebug(false);

//db_path = "";

if (db_path != "") {
setSedimDeck41DbType(DECK41_DB_V2_TYPE);
setSedimDbCoordFilePath(db_path + "/seafloor_sediment/DECK41_V2_coordinates.nc");
setSedimDbMarsdenFilePath(db_path + "seafloor_sediment/DECK41_V2_marsden_square.nc");
setSedimDbMarsdenOneFilePath(db_path + "seafloor_sediment/DECK41_V2_marsden_one_degree.nc");

setSspDbFilePath(db_path + "/ssp/WOA2018/WOA2018_SSP_June.nc");
setSspWoaDbType(WOA_DB_TYPE_2013);

setBathyDbFilePath(db_path + "bathymetry/GEBCO_2023.nc");
setBathyDbGebcoFormat(GEBCO_2D_15_SECONDS_BATHY_TYPE);
}

//setWossBellhopPath();
setWossCreatorDebug(false);
setWossWorkDirPath(res_path);
setWossClearWorkDir(true);
setWossDebug(false);
setWossSimTime(SimTime(Time(1, 8, 2018), Time(1, 8, 2018)));
setWossEvolutionTimeQuantum(-1.0);
setWossTotalRuns(1);
setWossFrequencyStep(0.0);
setWossTotalRangeSteps(50.0);
setWossTxMinDepthOffset(0.0);
setWossTxMaxDepthOffset(0.0);
setWossTotalTransmitters(1);
setWossTotalRxDepths(1);
setWossRxMinDepthOffset(0.0);
setWossRxMaxDepthOffset(0.0);
setWossTotalRxRanges(1);
setWossRxMinRangeOffset(0.0);
setWossRxMaxRangeOffset(0.0);
setWossTotalRays(2000);
setWossMinAngle(-75.0);
setWossMaxAngle(75.0);
setWossUseThorpeAtt(true);
setWossSspDepthPrecision(1.0E-8);
setWossNormalizedSspDepthSteps(100000);
setWossBellhopMode("a");
setWossBellhopBeamOptions("B");
setWossBellhopBathyType("L");
setWossBellhopBathyMethod("S");
setWossBellhopAltimType("L");
setWossBellhopArraySyntax(BELLHOP_CREATOR_ARR_FILE_SYNTAX_2);
setWossBellhopShdSyntax(BELLHOP_CREATOR_SHD_FILE_SYNTAX_1);
setWossBoxDepth(-3000.0);
setWossBoxRange(-3000.0);

setWossManagerDebug(false);
setWossManagerTimeEvoActive(false);
setWossManagerThreads(0.0);
setWossManagerSpaceSampling(0.0);
setWossManagerUseMultiThread(true);

tx_coordz_vector.push_back(CoordZ(42.59, 10.125, 80.0));
rx_coordz_vector.push_back(CoordZ(42.59, 10.1615, 1.0));
for (int i = 0; i < 25; ++i)
{
frequencies_vector.push_back(500.0 + i*1000.0);
}
}

void WossBellhopTest::doInit() {
if (db_path == "") {
woss_db_manager->setCustomBathymetry("5|0.0|100.0|100.0|200.0|300.0|150.0|400.0|100.0|700.0|300.0", CoordZ(42.59, 10.125, 80.0));
woss_db_manager->setCustomSediment("TestSediment|1560.0|200.0|1.5|0.9|0.8|300.0");
woss_db_manager->setCustomSSP("12|0|1508.42|10|1508.02|20|1507.71|30|1507.53|50|1507.03|75|1507.56|100|1508.08|125|1508.49|150|1508.91|200|1509.75|250|1510.58|300|1511.42");
}
}


void WossBellhopTest::doRun() {
WossManager* curr_woss_manager = woss_controller->getWossManager();

for (vector< CoordZ >::iterator it = tx_coordz_vector.begin(); it != tx_coordz_vector.end(); ++it) {
for (vector< CoordZ >::iterator it2 = rx_coordz_vector.begin(); it2 != rx_coordz_vector.end(); ++it2) {
for (vector< double >::iterator it3 = frequencies_vector.begin(); it3 != frequencies_vector.end(); ++it3 ) {
if (debug) {
cout << endl << endl;
cout << "tx coordz = " << (*it) << endl;
cout << "rx coordz = " << (*it2) << endl;
cout << "freq = " << (*it3) << endl;
}
// we need to erase the current woss in order to run it again with different setting
curr_woss_manager->eraseAllWoss();
bellhop_creator->setBhMode("A");
bellhop_creator->setWrkDirPath(res_path + "arr_asc/");

TimeArr* curr_time_arr_asc = curr_woss_manager->getWossTimeArr((*it), (*it2), (*it3), (*it3));

if (curr_time_arr_asc == NULL) {
throw WOSS_EXCEPTION(WOSS_ERROR_OUT_OF_MEMORY);
}

Pressure* press_temp_asc = SDefHandler::instance()->getPressure()->create( *curr_time_arr_asc );

if (press_temp_asc == NULL) {
throw WOSS_EXCEPTION(WOSS_ERROR_OUT_OF_MEMORY);
}

// we need to erase the current woss in order to run it again with Pressure setting
curr_woss_manager->eraseAllWoss();
bellhop_creator->setBhMode("a");
bellhop_creator->setWrkDirPath(res_path + "arr_bin/");

TimeArr* curr_time_arr_bin = curr_woss_manager->getWossTimeArr((*it), (*it2), (*it3), (*it3));

if (curr_time_arr_bin == NULL) {
throw WOSS_EXCEPTION(WOSS_ERROR_OUT_OF_MEMORY);
}

Pressure* press_temp_bin = SDefHandler::instance()->getPressure()->create( *curr_time_arr_bin );

if (press_temp_bin == NULL) {
throw WOSS_EXCEPTION(WOSS_ERROR_OUT_OF_MEMORY);
}

if ( abs(press_temp_bin->getTxLossDb() - press_temp_asc->getTxLossDb()) > 1.0) {
throw WOSS_EXCEPTION(WOSS_ERROR_OUT_OF_RANGE_PARAM);
}

// we need to erase the current woss in order to run it again with Pressure setting
curr_woss_manager->eraseAllWoss();
bellhop_creator->setBhMode("C");
bellhop_creator->setWrkDirPath(res_path + "press_shd/");

Pressure* curr_pressure = curr_woss_manager->getWossPressure((*it), (*it2), (*it3), (*it3));

if (curr_pressure == NULL) {
throw WOSS_EXCEPTION(WOSS_ERROR_OUT_OF_MEMORY);
}

if (debug) {
cout << endl;
cout << "curr_time_arr_asc = " << (*curr_time_arr_asc) << endl;
cout << "curr_time_arr_bin = " << (*curr_time_arr_bin) << endl;
cout << "time_arr_asc TL = " << (*press_temp_asc) << endl;
cout << "time_arr_bin TL = " << (*press_temp_bin) << endl;
cout << "curr_pressure = " << (*curr_pressure) << endl;
}
}
}
}
}


int main(int argc, char* argv [])
{
WossBellhopTest* woss_bh_test = new WossBellhopTest();
woss_bh_test->run();
delete woss_bh_test;

return 0;
}
Loading

0 comments on commit ca7a892

Please sign in to comment.