SOLVER

Functions

slcode.SOLVER.Precomputation(ice_grid, sed_grid, topo_grid, Output_way, stop=26, step=0.5, maxdeg=512, irregular_time_step=None, backend=False, plot=False)

The Precomputation method prepare the different data to match temporal and spatial resolution of the modelisation. spatial resolution (m,n) and temporal resolution (step). The input data format is described in Mass grid format.

Attribute :

ice_griddict(name = str, grid = np.array((n_i,m_i,t_i)), time = np.array((t_i,)), lon = np.array((n_i)), lat = np.array((m_i)))

ice thickness grid

sed_griddict(name = str, grid = np.array((n_j,m_j,t_j)), time = np.array((t_j,)), lon = np.array((n_j)), lat = np.array((m_j)),frame = (lon1,lon2,lat1,lat2))

sediment thickness

topo_griddict(name = str, grid = np.array((n_k,m_k)), lon = np.array((n_j)), lat = np.array((m_j)))

present topography

Output_waystr

The filepath toward wich the different grid will be saved

stopfloat

age at wich the computation stop

stepfloat

time step used for the temporal resolution of the model

maxdegint

The maximum degree of spherical harmonics, that define the spatial resolution of the model. (m = 2*maxdeg, n = maxdeg)

irregular_time_stepnp.array((time_step_number,))

An irregular time array to compute the model over non regular time step

backendbool

If required you can ask a backend during the run of each computation. True, will generate a backend, False will not. Defaul is False

Plotbool

If needed you can ask plot of each output compared to the initial plot. You will need the cartopy doc.

Returns :

None

The data output of the function are saved to the output way.


slcode.SOLVER.SLE_forward_modeling(Input_way, ice_name, sed_name, topo_name, ocean_name, love_way, love_file, conv_lim, Output_way)

The SLE_forward_modeling method solve the SLE with no constrain on final topography. This result in a forward modeling of the SL. It can be used for test and exploration of models. For informations on iterations see description of iteration.

Attribute :

Input_waystr

File location of the input data (ice, sediment and topography)

ice_namestr

The name of the ice data file

sed_namestr

The name of the sediment data file

topo_namestr

The name of the topographic data file

ocean_namestr

The name of the output file containig the data on the ocean

love_waystr

way of the love numbers file used to compute earth visco elastic deformation

conv_limfloat

Limit of precision required for the convergence of the SLE resolution (10^-3)

output_waystr

filepath for saving results of the modelisation

Returns :

None

The resulting ocean class object (OCEAN_TIME_GRID) containing the ocean thickness is saved in the outputway under the name ocean.


slcode.SOLVER.SLE_solver(Input_way, ice_name, sed_name, topo_name, ocean_name, love_way, love_file, topo_lim, conv_lim, Output_way)

The SLE_solver solve the SLE and converge toward the actual topography. The computation of the SLE resolution is describe in Sea level equation resolution. For informations on iterations see description of iteration.

Attribute :

Input_waystr

File location of the input data (ice, sediment and topography)

ice_namestr

The name of the ice data file

sed_namestr

The name of the sediment data file

topo_namestr

The name of the topographic data file

ocean_namestr

The name of the output file containig the data on the ocean

love_waystr

way of the love numbers file used to compute earth visco elastic deformation

conv_limfloat

Limit of precision required for the convergence of the SLE resolution (10^-3)

topo_limfloat

Topography convergence limit toward wich the iteration will converge (1 m)

output_waystr

filepath for saving results of the modelisation

Returns :

None

The resulting ocean class object (OCEAN_TIME_GRID), updated ice thickness (ICE_TIME_GRID) and updated topography (TOPOGRAPHIC_TIME_GRID) are saved to output_way.


slcode.SOLVER.Post_process(Input_way, sed_name, ice_name, ocean_name, topo_name, love_way)

The Post_process calculate the earth viscoelastic response resulting from the different masses caculated with the SLE_solver. This computation is made for all models available in the files.

Attribute :

input_way_sedstr

way where the sediment precomputed are stored

input_way_model_outputstr

filepath to the different masses calculated by the SLE solver

love_waystr

way to the love number output

Returns :

None

The resulting LOAD and GEOID are stored in a LOAD file in the same file then the input files. The structure is based on the LOAD_TIME_GRID class object.


slcode.SOLVER.calculate_deformation(love_number, ice_time_grid, sed_time_grid, ocean_time_grid, a, Me, Output_way, backend=False, plot={'plot': False})

The calculate_deformation method calculate the earth viscoelastic response resulting from the different masses caculated with the SLE_solver. This computation follows the decomposition of the SLE described in Computation of ground and geoid subsidence from different load source

Attribute :

love_numberLOVE

The loaded love number in the form of a LOVE class object

ice_time_gridgrid.ICE_TIME_GRID

ice thickness in the form of ICE_TIME_GRID class object

sed_time_gridgrid.SEDIMENT_TIME_GRID

sediment thickness in the form of SEDIMENT_TIME_GRID class object

ocean_time_gridgrid.OCEAN_TIME_GRID

ocean thickness calculated using the SLE solver in the form of OCEAN_TIME_GRID class object

afloat

radius of earth in meter

Mefloat

mass of earth (kg)

Output_waystr

way of the output where the load is calculated

backendbool

set if the function is writing its state of computation

Returns :

None

The resulting LOAD and GEOID are stored in a LOAD file in the same file then the input files. The structure is based on the LOAD_TIME_GRID class object.


slcode.SOLVER.calculate_sediment_ocean_interaction(love_number, ice_time_grid, sed_time_grid, ocean_time_grid, a, Me, topo_time_grid, Output_way, backend=False, plot={'plot': False})

The calculate_sediment_ocean_interaction method calculate the earth viscoelastic response resulting from sediment under sea surface. This is used to retrieve the effect of ocean replacement by sediment on the sediment load. The resulting subsidence is the true subsidence induced by sediment. The problems and resolution in equation is described in True sediment subsidence.

Attribute :

love_numberLOVE

The loaded love number in the form of a LOVE class object

ice_time_gridgrid.ICE_TIME_GRID

ice thickness in the form of ICE_TIME_GRID class object

sed_time_gridgrid.SEDIMENT_TIME_GRID

sediment thickness in the form of SED_TIME_GRID class object

ocean_time_gridgrid.OCEAN_TIME_GRID

ocean thickness calculated using the SLE solver in the form of OCEAN_TIME_GRID class object

afloat

radius of earth in meter

Mefloat

mass of earth (kg)

Output_waystr

way of the output where the load is calculated

backendbool

set if the function is writing its state of computation

Returns :

None

The resulting LOAD and GEOID are stored in a LOAD file in the same file then the input files. The structure is based on the LOAD_TIME_GRID class object.


slcode.SOLVER.find_files(filename, search_path)

Data_extractor

slcode.SOLVER.calc_transect(Input_way, time, transect, point_density, type, type_bis)

The calc_transect function evaluate the spherical harmonics coefficient function run the plot functions for all type of load. This function use the plot_frame function, see this function for more details.

Attribute :

input_way_sedstr

way where the load data are located. If you are using the function from SL_C0de.SOLVER library, this way should be xxx/model_output/earth_model_name.

timefloat

The selected time to plot the transect.

transect(lat1,lon1,lat2,lon2)

The coordinate of the beginning and the end of the transect.

point_dentityint

Number of points along the transect, this will define the resolution

typestr

This define the type of load considered. Must be “SEDIMENT”, “NO_SEDIMENT”, “OCEAN”, “ICE” or “TOTAL”.

type_bisstr

This define if the plot concern the geoid of the ground deformation. Must be “LOAD” or “GEOID”.

Returns :

None


slcode.SOLVER.calc_point(Input_way, points, type, type_bis)

The calc_point function evaluate the spherical harmonics coefficient for a type of model output at precise points locations.

Attribute :

Input_waystr

way where the load data are located. If you are using the function from SL_C0de.SOLVER library, this way should be xxx/model_output/earth_model_name.

timefloat

The selected time to plot the transect.

pointsnp.array(n_p*[lat,lon])

The locations of the different points you wan’t to extract data.

typestr

This define the type of load considered. Must be “SEDIMENT”, “NO_SEDIMENT”, “OCEAN”, “ICE” or “TOTAL”.

type_bisstr

This define if the plot concern the geoid of the ground deformation. Must be “LOAD” or “GEOID”.

Returns :

None


slcode.SOLVER.calculate_dESL(Input_way)

The calculate_dESL function compute the ESL variation over time including a varaible ocean surface.

Attribute :

Input_waystr

way where the load data are located. If you are using the function from SL_C0de.SOLVER library, this way should be xxx/model_output/earth_model_name.

Returns :

dESLnp.array([time_step_number,])

The variation of the ESL at each time step.


Plot functions

Frame :

slcode.SOLVER.plot_model_result_map(Input_way, plot)

The plot_model_result_map function run the plot functions for all type of load. This function use the plot_frame function, see this function for more details.

Attribute :

input_way_sedstr

way where the load data are located. If you are using the function from SL_C0de.SOLVER library, this way should be xxx/model_output/earth_model_name.

plotdict(plot=True,times=[n_t],frames=[n_f*(lon1,lon1,lat1,lat2)],frames_resolution=[n_f],frames_min_max=np.array([[[min_load],max_load,min_geoid,max_geoid]]),contours_v=[n_f*2*[contours…]],transects=[n_t*(lat1,lon1,lat2,lon2)],point_density=[n_t], transect_min_max=[n_t(min_load,max_load,min_geoid,max_geoid)], points=np.array([n_p[lat,lon]]))

The plot dictionnary used to define all the plot parameters of the output. In this dictionary, there is three main group of parameters, the frame plot parameters, the transect plot parameters and the points plot parameters. The frame plot parameters contain the frame locations in frames, the frames resolution in frames_resolution, the frames min and max value to plot in frames_min_max and the contours value to plot in contours_v. The transect plot parameters contains the location of the begining and end of the transects in transects, the point density along the transect in point_density and the min max value of the transect in transect_min_max. The points plot parameters contains the locations of the differents plots in points.

Returns :

None


slcode.SOLVER.plot_frame(Input_way, plot, Output_way, type)

The plot_frame function define the spherical harmonic coefficient to be expanded into a grid and plot in the frame defined in plot. This function make the difference between sediment subsidence and true sediment subsidence where water replaced by sediment is included.

Attribute :

Input_waystr

way where the load data are located. If you are using the function from SL_C0de.SOLVER library, this way should be xxx/model_output/earth_model_name.

plotdict(plot=True,times=[n_t],frames=[n_f*(lon1,lon1,lat1,lat2)],frames_resolution=[n_f],frames_min_max=np.array([[[min_load],max_load,min_geoid,max_geoid]]),contours_v=[n_f*2*[contours…]],transects=[n_t*(lat1,lon1,lat2,lon2)],point_density=[n_t], transect_min_max=[n_t(min_load,max_load,min_geoid,max_geoid)], points=np.array([n_p[lat,lon]]))

The plot dictionnary used to define all the plot parameters of the output. In this dictionary, there is three main group of parameters, the frame plot parameters, the transect plot parameters and the points plot parameters. The frame plot parameters contain the frame locations in frames, the frames resolution in frames_resolution, the frames min and max value to plot in frames_min_max and the contours value to plot in contours_v. The transect plot parameters contains the location of the begining and end of the transects in transects, the point density along the transect in point_density and the min max value of the transect in transect_min_max. The points plot parameters contains the locations of the differents plots in points.

Output_waystr

way where the plot will be saved.

typestr

This define the type of load considered. Must be “SEDIMENT”, “NO_SEDIMENT”, “OCEAN”, “ICE” or “TOTAL”.

Returns :

None


slcode.SOLVER.plot_model_output(time_grid, plot, Output_way, type=None, vmin=None, vmax=None, contours_v=None)

The plot_model_output function plot the frames for each frames and at each time steps.

Attribute :

time_grid : TIME_GRID from ref:{TIME_GRID <TIME_GRID>} plot : dict(plot=True,times=[n_t],frames=[n_f*(lon1,lon1,lat1,lat2)],frames_resolution=[n_f],frames_min_max=np.array([[[min_load],max_load,min_geoid,max_geoid]]),contours_v=[n_f*2*[contours…]],transects=[n_t*(lat1,lon1,lat2,lon2)],point_density=[n_t], transect_min_max=[n_t(min_load,max_load,min_geoid,max_geoid)], points=np.array([n_p[lat,lon]]))

The plot dictionnary used to define all the plot parameters of the output. In this dictionary, there is three main group of parameters, the frame plot parameters, the transect plot parameters and the points plot parameters. The frame plot parameters contain the frame locations in frames, the frames resolution in frames_resolution, the frames min and max value to plot in frames_min_max and the contours value to plot in contours_v. The transect plot parameters contains the location of the begining and end of the transects in transects, the point density along the transect in point_density and the min max value of the transect in transect_min_max. The points plot parameters contains the locations of the differents plots in points.

Output_waystr

way where the plot will be saved.

typestr

This define the type of load considered. Must be “SEDIMENT”, “NO_SEDIMENT”, “OCEAN”, “ICE” or “TOTAL”.

vminfloat

The minimal value for the colormap of your plot

vmaxfloat

The maximal value for the colormap of your plot

contours_vlist

List of the contours values to be plot

Returns :

None


slcode.SOLVER.plot_load_frame(ax, data, frame, time, resolution, name, add_contour=None, vmin=None, vmax=None, vcenter=0, contour=[None], color=None)

The plot_load_frame function plot the data in entry into a defined frame following different arguments fro the plot.

Attribute :

axmatplotlib.pyplot.axes

The axis on wich the data will be plot.

dataLOAD_TIME_GRID

A LOAD_TIME_GRID object with the LOAD_TIME_GRID.coeff to be ploted.

frame(lon1,lon2,lat1,lat2)

The coordinate of the frame to plot.

timefloat

The time of the plot that will be plot

resolutionint

The resolution of the plot, the resulting resolution will be resolution x resolution*2

namestr

The name of the plot, will be used in the title and legend of the plot

vminfloat

The minimal value of the plot colormap

vmaxfloat

The maximal value of the plot colormap

vcenterfloat

The central value of the plot colormap

contournp.array([n_c])

The contour that will be ploted on the map

colornp.array([n_c])

The contour fill color to be ploted

Returns :

axmatplotlib.pyplot.axes

The axis updated from the plots


Cross section :

slcode.SOLVER.plot_model_result_cross_section(Input_way, plot)

The plot_model_result_cross_section function evaluate the spherical harmonics coefficient function and plot the results along a defined transect in plot.

Attribute :

Input_way_sedstr

way where the load data are located. If you are using the function from SL_C0de.SOLVER library, this way should be xxx/model_output/earth_model_name.

plotdict(plot=True,times=[n_t],frames=[n_f*(lon1,lon1,lat1,lat2)],frames_resolution=[n_f],frames_min_max=np.array([[[min_load],max_load,min_geoid,max_geoid]]),contours_v=[n_f*2*[contours…]],transects=[n_t*(lat1,lon1,lat2,lon2)],point_density=[n_t], transect_min_max=[n_t(min_load,max_load,min_geoid,max_geoid)], points=np.array([n_p[lat,lon]]))

The plot dictionnary used to define all the plot parameters of the output. In this dictionary, there is three main group of parameters, the frame plot parameters, the transect plot parameters and the points plot parameters. The frame plot parameters contain the frame locations in frames, the frames resolution in frames_resolution, the frames min and max value to plot in frames_min_max and the contours value to plot in contours_v. The transect plot parameters contains the location of the begining and end of the transects in transects, the point density along the transect in point_density and the min max value of the transect in transect_min_max. The points plot parameters contains the locations of the differents plots in points.

Returns :

None


Points :

slcode.SOLVER.plot_model_output_points(Input_way, plot)

The plot_model_output_points function plot the output of the model at different points.

Attribute :

Input_waystr

way where the load data are located. If you are using the function from SL_C0de.SOLVER library, this way should be xxx/model_output/earth_model_name.

plotdict(plot=True,times=[n_t],frames=[n_f*(lon1,lon1,lat1,lat2)],frames_resolution=[n_f],frames_min_max=np.array([[[min_load],max_load,min_geoid,max_geoid]]),contours_v=[n_f*2*[contours…]],transects=[n_t*(lat1,lon1,lat2,lon2)],point_density=[n_t], transect_min_max=[n_t(min_load,max_load,min_geoid,max_geoid)], points=np.array([n_p[lat,lon]]))

The plot dictionnary used to define all the plot parameters of the output. In this dictionary, there is three main group of parameters, the frame plot parameters, the transect plot parameters and the points plot parameters. The frame plot parameters contain the frame locations in frames, the frames resolution in frames_resolution, the frames min and max value to plot in frames_min_max and the contours value to plot in contours_v. The transect plot parameters contains the location of the begining and end of the transects in transects, the point density along the transect in point_density and the min max value of the transect in transect_min_max. The points plot parameters contains the locations of the differents plots in points.

Returns :

None


Precomputation

slcode.SOLVER.plot_precomputation(initial_time_step, initial_grid, precomputed_grid, selected_time=1, area=None, save_way='', lon_init=None, lat_init=None, topo=False, vmin=None, vmax=None, vcenter=0, cmap=<matplotlib.colors.LinearSegmentedColormap object>)

The plot_precomputation function plot the output of the precomputation as the ice, sediment and totpography. These plot allow you to compare the entry and the output to be sure there is no errors.

Attribute :

Input_waystr

way where the load data are located. If you are using the function from SL_C0de.SOLVER library, this way should be xxx/model_output/earth_model_name.

plotdict(plot=True,times=[n_t],frames=[n_f*(lon1,lon1,lat1,lat2)],frames_resolution=[n_f],frames_min_max=np.array([[[min_load],max_load,min_geoid,max_geoid]]),contours_v=[n_f*2*[contours…]],transects=[n_t*(lat1,lon1,lat2,lon2)],point_density=[n_t], transect_min_max=[n_t(min_load,max_load,min_geoid,max_geoid)], points=np.array([n_p[lat,lon]]))

The plot dictionnary used to define all the plot parameters of the output. In this dictionary, there is three main group of parameters, the frame plot parameters, the transect plot parameters and the points plot parameters. The frame plot parameters contain the frame locations in frames, the frames resolution in frames_resolution, the frames min and max value to plot in frames_min_max and the contours value to plot in contours_v. The transect plot parameters contains the location of the begining and end of the transects in transects, the point density along the transect in point_density and the min max value of the transect in transect_min_max. The points plot parameters contains the locations of the differents plots in points.

Output_waystr

way where the plot will be saved.

typestr

This define the type of load considered. Must be “SEDIMENT”, “NO_SEDIMENT”, “OCEAN”, “ICE” or “TOTAL”.

vminfloat

The minimal value for the colormap of your plot

vmaxfloat

The maximal value for the colormap of your plot

Returns :

None


Utils functions

slcode.SOLVER.export_to_netcdf(Input_way, time, resolution, frame, save_way, type, type_bis)

The export_to_netcdf function export the data from the input_way, type and type_bis, of the frame shape into a netcdf file. This file can be open in any gis software.

Attribute :

Input_waystr

way where the load data are located. If you are using the function from SL_C0de.SOLVER library, this way should be xxx/model_output/earth_model_name.

timefloat

The time of the plot in kyr

resolutionint

the spatial resolution of the plot. ! This resolution concern the entire globe and not juste the frame.

frame(lon1,lon2,lat1,lat2)

The coordinate of the frame to plot.

save_waystr

The filepath to save the netcdf file

typestr

The type of loading taken into account. Can be : “SEDIMENT”, “OCEAN”, “ICE”, “NO_SEDIMENT”.

type_bisstr

The type of affected surface by the loading. Can be : “GEOID”, “LOAD”.