MONC
|
The NetCDF file type writer which performs actual writing of NetCDF files to the parallel filesystem. These are opened by all IO servers and all IO servers can participate as variables might be located across the different IO processes. More...
Functions/Subroutines | |
subroutine, public | initialise_netcdf_filetype () |
Initialises the NetCDF writing functionality. More... | |
subroutine, public | finalise_netcdf_filetype () |
Finalises the NetCDF writing functionality. More... | |
subroutine, public | define_netcdf_file (io_configuration, file_writer_information, timestep, time, time_points, termination_write) |
Defines a NetCDF file - which creates it, defines all dimensions and variables. This must be called by all IO server processes as the NetCDF operations here are collective. More... | |
subroutine, public | store_io_server_state (io_configuration, writer_entries, time_points, file_writer_information, timestep) |
Stores the IO server state in the NetCDF file. More... | |
type(writer_type) function, pointer, public | get_writer_entry_from_netcdf (field_name, timestep, terminated) |
Looks up and retrieves the writer entry that corresponds to this NetCDF file state. More... | |
subroutine, public | close_netcdf_file (io_configuration, field_name, timestep) |
Call back for the inter IO reduction which actually does the NetCDF file closing which is a collective (synchronous) operation. This also cleans up the file state as it is no longer required. More... | |
subroutine, public | write_variable (io_configuration, field_to_write_information, filename, timestep, time) |
Writes the contents of a variable to the NetCDF file. This also removes the written entries from the field information type in order to conserve memory. More... | |
integer function | get_dimension_identifier (dim_name, is_auto_dimension) |
Translates a dimension name to its numeric corresponding identifier. More... | |
integer function | get_dimension_original_size (dim_name, dimension_store) |
Retrieves the original size of a specific dimension (which is auto) More... | |
subroutine | write_coordinate_variable (file_state, coord_var_id, field_values) |
Writes a coordinate variable into the NetCDF file. More... | |
subroutine | write_condition_variable (file_state, c_var_id, field_values) |
Writes the conditional diagnostic variable names into the NetCDF file. More... | |
subroutine | write_contiguous_collective_variable_to_diagnostics (io_configuration, field_to_write_information, timestep, time, file_state) |
Writes contiguous collective variable blocks into the NetCDF files. These are blocks of data spanning multiple variables and multiple time points, the idea being to minimise the number of overall writes into the file. These variables are defined collective, so it might be that other IO servers have less contiguous data and hence more writes, therefore empty writes might need to be issued (at the end) to match up against these other servers. More... | |
type(write_field_collective_descriptor_type) function, pointer | get_next_collective_descriptor (iterator) |
Retrieves the next collective descriptor based upon the iterator. More... | |
type(write_field_collective_monc_info_type) function, pointer | get_next_specific_monc_info (iterator) |
Retrieves the next specific monc information item from the iterator. More... | |
subroutine | write_collective_variable_to_diagnostics (io_configuration, field_to_write_information, timestep, time, file_state) |
Writes collective variables, where we are working with the values from multiple MONCs and storing these in their own specific relative location in the diagnostics file. More... | |
subroutine | write_independent_variable_to_diagnostics (field_to_write_information, timestep, time, file_state) |
Writes independent variables to the diagnostics file. This writes the entire variable and works by writing all the memory up and then doing the write in one call. More... | |
subroutine | write_out_number_values (field_to_write_information, timestep, time, file_state) |
subroutine | write_out_map (field_to_write_information, timestep, time, file_state) |
subroutine | write_out_options (io_configuration, file_state) |
Writes out the options_database defining this model run. More... | |
subroutine | define_time_series_dimensions (file_state, file_writer_information, time, time_points, termination_write) |
Defines dimensions for all required dimensions. This is usually the number required plus one, but in some cases is entirely required depending how the output frequency and diagnostics write times match up. More... | |
integer function | get_number_timeseries_entries (time_points, previous_write_time, output_frequency, timestep_frequency, termination_write, last_write_entry) |
Retrieves the number of timeseries entries for a specific frequency and previous write time. This is based on the range of time points that are provided to the call. More... | |
integer function | define_coordinate_variable (file_state, coord_name) |
Defines a coordinate variable in the NetCDF file. More... | |
integer function | define_options_database_variable (file_state) |
Defines the options_database variable in the NetCDF file. More... | |
subroutine | define_variables (io_configuration, file_state, file_writer_information) |
Defines all variables in the file writer state. More... | |
integer function | retrieve_time_series_dimension_id_for_field (file_state, file_writer_information, field_index) |
For a specific field will retrieve the NetCDF id of the time series dimension most appropriate for this field. If a dimension can not be located then an error is raised. More... | |
type(netcdf_diagnostics_timeseries_type) function, pointer | get_specific_timeseries_dimension (file_state, output_frequency, timestep_frequency) |
Given the file state and the output frequency of a field will retrive the appropriate time series dimension entry that corresponds to this or null if none can be found. More... | |
subroutine | define_dimensions (file_state, dimension_sizing) |
Defines spatial dimensions in the diagnostics file. More... | |
type(netcdf_diagnostics_type) function, pointer | get_file_state (filename, timestep, dolock) |
Retrieves a file state based upon its timestep or null if none is found. More... | |
character(len=string_length) function | get_field_key (field_to_write_information) |
Retrieves the field key, corresponding to the field name in the NetCDF file and what we store against the id in the NetCDF file state internally. This is either the field name itself or the manipulation type appended if there is duplication. More... | |
subroutine | generate_unique_filename (old_name, new_name, configured_write_time, timestep) |
Generates a unique filename based upon the base one specified and the number of completed timesteps. More... | |
subroutine | write_out_global_attributes (io_configuration, ncid, file_writer_information, timestep, time) |
Writes out global attributes into the checkpoint. More... | |
Variables | |
type(hashmap_type), volatile | file_states |
integer, volatile | file_states_rwlock |
integer, volatile | netcdf_mutex |
logical | l_nc_dim |
logical | l_nd_dim |
integer | nc_dim_id |
integer | nd_dim_id |
integer | nopt_dim_id |
integer | nc_var_id_s |
integer | nd_var_id_s |
integer | nc_var_id_l |
integer | nd_var_id_l |
integer | nopt_var_id |
The NetCDF file type writer which performs actual writing of NetCDF files to the parallel filesystem. These are opened by all IO servers and all IO servers can participate as variables might be located across the different IO processes.
subroutine, public netcdf_filetype_writer_mod::close_netcdf_file | ( | type(io_configuration_type), intent(inout) | io_configuration, |
character(len=string_length) | field_name, | ||
integer | timestep | ||
) |
Call back for the inter IO reduction which actually does the NetCDF file closing which is a collective (synchronous) operation. This also cleans up the file state as it is no longer required.
io_configuration | The IO server configuration |
field_name | The field name that is being communicated |
timestep | The write timestep |
Definition at line 193 of file netcdf_filetype.F90.
|
private |
Defines a coordinate variable in the NetCDF file.
file_state | The NetCDF file state |
coord_name | The name of the coordinate |
Definition at line 923 of file netcdf_filetype.F90.
|
private |
Defines spatial dimensions in the diagnostics file.
file_state | The NetCDF file state |
dimension_sizing | All dimension name to size key value pairs |
Definition at line 1139 of file netcdf_filetype.F90.
subroutine, public netcdf_filetype_writer_mod::define_netcdf_file | ( | type(io_configuration_type), intent(inout) | io_configuration, |
type(writer_type), intent(inout), target | file_writer_information, | ||
integer, intent(in) | timestep, | ||
real, intent(in) | time, | ||
type(map_type), intent(inout) | time_points, | ||
logical, intent(in) | termination_write | ||
) |
Defines a NetCDF file - which creates it, defines all dimensions and variables. This must be called by all IO server processes as the NetCDF operations here are collective.
io_configuration | The IO server configuration |
file_writer_information | The writer entry that is being written |
timestep | The write timestep |
time | The write time |
Isolate these writes, as they may trip over one another
Write conditional diagnostics descriptors to file if file contains corresponding dimension.
Write options_database and height coordinates to all files.
Definition at line 69 of file netcdf_filetype.F90.
|
private |
Defines the options_database variable in the NetCDF file.
file_state | The NetCDF file state |
Definition at line 939 of file netcdf_filetype.F90.
|
private |
Defines dimensions for all required dimensions. This is usually the number required plus one, but in some cases is entirely required depending how the output frequency and diagnostics write times match up.
file_state | The state of the NetCDF file |
file_writer_information | Writer information |
time | The model write time |
Definition at line 841 of file netcdf_filetype.F90.
|
private |
Defines all variables in the file writer state.
file_state | The NetCDF file state |
file_writer_information | The file writer information |
Only enable writing of conditional diagnostics descriptor fields to this file if there is
Provide conditional diagnostic descriptions if data being used in this file.
Definition at line 956 of file netcdf_filetype.F90.
subroutine, public netcdf_filetype_writer_mod::finalise_netcdf_filetype |
Finalises the NetCDF writing functionality.
Definition at line 58 of file netcdf_filetype.F90.
|
private |
Generates a unique filename based upon the base one specified and the number of completed timesteps.
old_name | The existing name that is used as a base |
timestep | The current model timestep |
new_name | The new name that is produced by this subroutine |
Definition at line 1222 of file netcdf_filetype.F90.
|
private |
Translates a dimension name to its numeric corresponding identifier.
dim_name | The name of the dimension to look up |
is_auto_dimension | Optional parameter determining whether dimension is auto or not |
Definition at line 263 of file netcdf_filetype.F90.
|
private |
Retrieves the original size of a specific dimension (which is auto)
dim_name | The auto dimension (full) name |
dimension_store | The map of dimensions we are looking up |
Definition at line 292 of file netcdf_filetype.F90.
|
private |
Retrieves the field key, corresponding to the field name in the NetCDF file and what we store against the id in the NetCDF file state internally. This is either the field name itself or the manipulation type appended if there is duplication.
field_to_write_information | The field to get the key from |
Definition at line 1204 of file netcdf_filetype.F90.
|
private |
Retrieves a file state based upon its timestep or null if none is found.
filename | The filename to look up |
timestep | The timestep to look up |
dolock | Whether to issue a read lock or not |
Definition at line 1177 of file netcdf_filetype.F90.
|
private |
Retrieves the next collective descriptor based upon the iterator.
iterator | The iterator to retrieve from, this is updated to reference the proceeding entry |
Definition at line 496 of file netcdf_filetype.F90.
|
private |
Retrieves the next specific monc information item from the iterator.
iterator | The iterator to retrieve from, this is updated to reference the proceeding entry |
Definition at line 512 of file netcdf_filetype.F90.
|
private |
Retrieves the number of timeseries entries for a specific frequency and previous write time. This is based on the range of time points that are provided to the call.
time_points | The list of times that data has been sent over that is applicable to this write |
previous_write_time | When the field was previously written |
frequency | The frequency of outputs of the field |
Definition at line 883 of file netcdf_filetype.F90.
|
private |
Given the file state and the output frequency of a field will retrive the appropriate time series dimension entry that corresponds to this or null if none can be found.
file_state | The NetCDF file state that is being written |
output_frequency | Time frequency of writes |
timestep_frequency | The timestep frequency of data arrival/generation |
Definition at line 1110 of file netcdf_filetype.F90.
type(writer_type) function, pointer, public netcdf_filetype_writer_mod::get_writer_entry_from_netcdf | ( | character(len=string_length) | field_name, |
integer | timestep, | ||
logical, intent(out), optional | terminated | ||
) |
Looks up and retrieves the writer entry that corresponds to this NetCDF file state.
field_name | The field name that is being communicated |
timestep | The write timestep |
Definition at line 175 of file netcdf_filetype.F90.
subroutine, public netcdf_filetype_writer_mod::initialise_netcdf_filetype |
Initialises the NetCDF writing functionality.
Definition at line 52 of file netcdf_filetype.F90.
|
private |
For a specific field will retrieve the NetCDF id of the time series dimension most appropriate for this field. If a dimension can not be located then an error is raised.
file_state | NetCDF file state |
file_writer_information | The writer information |
field_index | Index of the field in the writer information contents that we are writing |
Definition at line 1086 of file netcdf_filetype.F90.
subroutine, public netcdf_filetype_writer_mod::store_io_server_state | ( | type(io_configuration_type), intent(inout) | io_configuration, |
type(writer_type), dimension(:), intent(inout), volatile | writer_entries, | ||
type(hashmap_type), intent(inout), volatile | time_points, | ||
type(writer_type), intent(inout), target | file_writer_information, | ||
integer, intent(in) | timestep | ||
) |
Stores the IO server state in the NetCDF file.
io_configuration | The IO server configuration |
file_writer_information | The file writer information |
timestep | The write timestep |
Definition at line 151 of file netcdf_filetype.F90.
|
private |
Writes collective variables, where we are working with the values from multiple MONCs and storing these in their own specific relative location in the diagnostics file.
field_to_write_information | The field that is going to be written |
timestep | The write timestep |
time | The write time |
file_state | File storate state |
Definition at line 531 of file netcdf_filetype.F90.
|
private |
Writes the conditional diagnostic variable names into the NetCDF file.
file_state | The NetCDF file state |
c_var_id | The variable id in the file |
field_values | The field values to write |
Definition at line 326 of file netcdf_filetype.F90.
|
private |
Writes contiguous collective variable blocks into the NetCDF files. These are blocks of data spanning multiple variables and multiple time points, the idea being to minimise the number of overall writes into the file. These variables are defined collective, so it might be that other IO servers have less contiguous data and hence more writes, therefore empty writes might need to be issued (at the end) to match up against these other servers.
io_configuration | The IO server configuration |
field_to_write_information | The field to write |
timestep | The current model timestep |
time | The current model time |
file_state | Specific file state descriptor |
Definition at line 357 of file netcdf_filetype.F90.
|
private |
Writes a coordinate variable into the NetCDF file.
file_state | The NetCDF file state |
coord_var_id | The coordinate variable id in the file |
field_values | The field values to write |
Definition at line 309 of file netcdf_filetype.F90.
|
private |
Writes independent variables to the diagnostics file. This writes the entire variable and works by writing all the memory up and then doing the write in one call.
field_to_write_information | The field that is going to be written |
timestep | The write timestep |
time | The write time |
file_state | File storate state |
Definition at line 648 of file netcdf_filetype.F90.
|
private |
Writes out global attributes into the checkpoint.
ncid | NetCDF file id |
Definition at line 1248 of file netcdf_filetype.F90.
|
private |
Definition at line 749 of file netcdf_filetype.F90.
|
private |
Definition at line 665 of file netcdf_filetype.F90.
|
private |
Writes out the options_database defining this model run.
io_configuration | The configuration of the IO server |
Definition at line 803 of file netcdf_filetype.F90.
subroutine, public netcdf_filetype_writer_mod::write_variable | ( | type(io_configuration_type), intent(inout) | io_configuration, |
type(writer_field_type), intent(inout) | field_to_write_information, | ||
character(len=*), intent(in) | filename, | ||
integer, intent(in) | timestep, | ||
real, intent(in) | time | ||
) |
Writes the contents of a variable to the NetCDF file. This also removes the written entries from the field information type in order to conserve memory.
field_to_write_information | The field that is going to be written |
filename | The name of the diagnostics file |
timestep | The write timestep |
time | The write time |
Definition at line 237 of file netcdf_filetype.F90.
|
private |
Definition at line 40 of file netcdf_filetype.F90.
|
private |
Definition at line 41 of file netcdf_filetype.F90.
|
private |
Definition at line 43 of file netcdf_filetype.F90.
|
private |
Definition at line 43 of file netcdf_filetype.F90.
|
private |
Definition at line 44 of file netcdf_filetype.F90.
|
private |
Definition at line 45 of file netcdf_filetype.F90.
|
private |
Definition at line 45 of file netcdf_filetype.F90.
|
private |
Definition at line 44 of file netcdf_filetype.F90.
|
private |
Definition at line 45 of file netcdf_filetype.F90.
|
private |
Definition at line 45 of file netcdf_filetype.F90.
|
private |
Definition at line 41 of file netcdf_filetype.F90.
|
private |
Definition at line 44 of file netcdf_filetype.F90.
|
private |
Definition at line 45 of file netcdf_filetype.F90.