V3FIT
Data Types | Functions/Subroutines | Variables
compression Module Reference

Defines the base class of the type compression_class. This class contains the code and buffers to hold compressed and uncompressed data. 2D matrix data is compressed using a singular value decomposition. See del-Castillo-Negrete et. al. doi:10.1016/j.jcp.2006.07.022. More...

Data Types

type  compression_class
 Base class containing buffers for compressed and uncompressed data. More...
 
interface  compression_construct
 Interface for the construction of compression_class types using compression_construct_new or compression_construct_netcdf. More...
 
type  compression_pointer
 Pointer to a compression object. Used for creating arrays of compression pointers. This is needed because fortran does not allow arrays of pointers directly. More...
 

Functions/Subroutines

type(compression_class) function, pointer compression_construct_new (data_in, svd_cut_off)
 Construct a compression_class object. More...
 
type(compression_class) function, pointer compression_construct_netcdf (ncid, name)
 Construct a compression_class object by reading from an netcdf. file. More...
 
subroutine compression_destruct (this)
 Deconstruct a compression_class object. More...
 
integer function compression_get_dimension1 (this)
 Get the ith dimension length. More...
 
integer function compression_get_dimension2 (this)
 Get the jth dimension length. More...
 
subroutine compression_decompress (this)
 Decompress the data. More...
 
subroutine compression_cleanup (this)
 Cleanup decompressed data. More...
 
subroutine compression_define (this, ncid, name)
 Define variables for the compressed data. More...
 
subroutine compression_write (this, ncid, name)
 Cleanup decompressed data. More...
 

Variables

real(rprec), parameter compression_max_percentage = 100.0
 Maximum compressed size before uncompressed buffers are stored.
 
character(len= *), parameter compression_data_buffer_post = 'data_buffer'
 Postfix for the data buffer.
 
character(len= *), parameter compression_u_buffer_post = 'u_buffer'
 Postfix for the data buffer.
 
character(len= *), parameter compression_wvt_buffer_post = 'wvt_buffer'
 Postfix for the data buffer.
 
character(len= *), parameter compression_data_dim_post = 'data_dim'
 Postfix for the data buffer.
 

Detailed Description

Defines the base class of the type compression_class. This class contains the code and buffers to hold compressed and uncompressed data. 2D matrix data is compressed using a singular value decomposition. See del-Castillo-Negrete et. al. doi:10.1016/j.jcp.2006.07.022.

Function/Subroutine Documentation

◆ compression_cleanup()

subroutine compression::compression_cleanup ( type (compression_class), pointer  this)

Cleanup decompressed data.

If the data dimensions arrays or the U and WVT is allocated, then delete the data buffer. Otherwise the data is stored uncompressed.

Parameters
[in,out]thisA compression_class instance.

Definition at line 496 of file compression.f.

◆ compression_construct_netcdf()

type (compression_class) function, pointer compression::compression_construct_netcdf ( integer, intent(in)  ncid,
character (len=*), intent(in)  name 
)

Construct a compression_class object by reading from an netcdf. file.

Constructs data from a precompressed netcdf file.

Parameters
[in]ncidA netcdf file id.
[in]nameA netcdf variable name id.
[in]nameFlag discribing how the data was compressed.
Returns
A pointer to a constructed compression_class object.

Definition at line 287 of file compression.f.

◆ compression_construct_new()

type (compression_class) function, pointer compression::compression_construct_new ( real (rprec), dimension(:,:), intent(in)  data_in,
real (rprec), intent(in)  svd_cut_off 
)

Construct a compression_class object.

Constructs compression object and compresses the data buffer if compression meets the specified criteria.

Parameters
[in]data_inData buffer to compress. This gets copied to the internal storage buffer.
[in]svn_cut_offCutoff value for determining the number of singular values to use for compression.
Returns
A pointer to a constructed compression_class object.

Definition at line 101 of file compression.f.

◆ compression_decompress()

subroutine compression::compression_decompress ( type (compression_class), pointer  this)

Decompress the data.

Checks if the U and WVT arrays are allocated. If they are not the data_buffer was left uncompressed. If the data dimensions is also unallocated, then the orginal data buffer was all zeros otherwise data is uncompressed by matrix a multiplication.

Parameters
[in,out]thisA compression_class instance.

Definition at line 459 of file compression.f.

◆ compression_define()

subroutine compression::compression_define ( type (compression_class), intent(in)  this,
integer, intent(in)  ncid,
character (len=*), intent(in)  name 
)

Define variables for the compressed data.

Defines the netcdf variables for writting compressed data to a netcdf file.

Parameters
[in]thisA compression_class instance.
[in]ncidNetcdf file id.
[in]nameBase name of variables to compress.
Returns
The flag indicating which buffer was stored.

Definition at line 524 of file compression.f.

◆ compression_destruct()

subroutine compression::compression_destruct ( type (compression_class), pointer  this)

Deconstruct a compression_class object.

Deallocates memory and uninitializes a compression_class object.

Parameters
[in,out]thisA compression_class instance.

Definition at line 356 of file compression.f.

◆ compression_get_dimension1()

integer function compression::compression_get_dimension1 ( type (compression_class), pointer  this)

Get the ith dimension length.

Retrives the uncompressed dimension of the first data buffer index. This can be used without needing to decompress the data first.

Parameters
[in,out]thisA compression_class instance.
Returns
The size of the ith dimension of the uncompressed data buffer.

Definition at line 395 of file compression.f.

◆ compression_get_dimension2()

integer function compression::compression_get_dimension2 ( type (compression_class), pointer  this)

Get the jth dimension length.

Retrives the uncompressed dimension of the second data buffer index. This can be used without needing to decompress the data first.

Parameters
[in,out]thisA compression_class instance.
Returns
The size of the jth dimension of the uncompressed data buffer.

Definition at line 425 of file compression.f.

◆ compression_write()

subroutine compression::compression_write ( type (compression_class), intent(in)  this,
integer, intent(in)  ncid,
character (len=*), intent(in)  name 
)

Cleanup decompressed data.

If the data dimensions arrays or the U and WVT is allocated, then delete the data buffer. Otherwise the data is stored uncompressed.

Parameters
[in,out]thisA compression_class instance.
[in]ncidA netcdf file handle.
[in]nameThe name to write the variable to.

Definition at line 562 of file compression.f.