RivinHD / Tsunami-Simulation

https://rivinhd.github.io/Tsunami-Simulation/
Other
0 stars 1 forks source link

Fixing the note from submission 5. Large Data Input and Output #53

Closed RivinHD closed 11 months ago

RivinHD commented 11 months ago

"Finally, in accordance with convention, we calculate the latitude and longitude values by converting metres to degrees and write them to our netCDF file if we are using degrees as our unit:"


"First, the variable to store the ID is created on the name that the netCdf uses as an alias for the longitude. In this case, the aliases are lon, longitude, x, X and a check is made to see if any of them are included in the file."

[alex@jenalex tmp]$ ncdump artificialtsunami_bathymetry_1000.nc  | head -n 500
netcdf artificialtsunami_bathymetry_1000 {
dimensions:
    x = 1000 ;
    y = 1000 ;
variables:
    float x(x) ;
    float y(y) ;
    float z(y, x) ;

// global attributes:
        :Conventions = "COARDS" ;
data:

 x = -4995, -4985, -4975, -4965, -4955, -4945, -4935, -4925, -4915, -4905, 
    -4895, -4885, -4875, -4865, -4855, -4845, -4835, -4825, -4815, -4805, 
[...]

        case VarType::CHAR:
            outData[i].array = new char[length];
            break;
        case VarType::SHORT:
            outData[i].array = new short[length];
            break;
        case VarType::INT:
            outData[i].array = new int[length];
            break;
[...]

(tsunami_lab) tsunami_19@LeChuck:~/05_large_io/gerlach_hofer/Tsunami-Simulation/build$ ./sanitize_test 
 writing to 'solutions/simulation/WriteNetCDF.test.nc'
 writing to 'solutions/simulation/WriteNetCDF.test.nc'
 writing to 'solutions/simulation/WriteNetCDF.test.nc'
 writing to 'solutions/simulation/WriteNetCDF.test.nc'
 writing to 'solutions/simulation/WriteNetCDF.test.nc'
 [...]

" -M use meters as unit for the X-Axis and Y-Axis instead of the Longitude and Latitude units degrees_east and degrees_north."


    l_setup = new tsunami_lab::setups::TsunamiEvent2d( "resources/artificialtsunami_bathymetry_1000.nc",
                                                       variables,
                                                       "resources/artificialtsunami_displ_1000.nc",
                                                       variables,
                                                       l_scaleX,
                                                       l_scaleY );

#include <cmath>
#include <math.h>