mHM
The mesoscale Hydrological Model
|
Creates NetCDF output for different fluxes and state variables of mHM. More...
Data Types | |
interface | outputdataset |
interface | outputvariable |
Functions/Subroutines | |
character(3) function, public | data_dtype (double_precision) |
Output variable dtype for single or double precision. | |
character(16) function, dimension(3), public | data_dims () |
Output variable dimension names. | |
type(outputvariable) function | newoutputvariable (nc, name, dtype, dims, ncells, mask, deflate_level, avg) |
Initialize OutputVariable. | |
subroutine | updatevariable (self, data) |
Update OutputVariable. | |
subroutine | writevariabletimestep (self, current_time_step) |
Write timestep to file. | |
type(outputdataset) function | newoutputdataset (idomain, level, file_name, double_precision, outputs_frequence, time_reference) |
Initialize OutputDataset. | |
subroutine | writetimestep (self, current_time_step) |
Write all accumulated data. | |
subroutine | close (self) |
Close the file. | |
type(ncdataset) function | createoutputfile (idomain, level, file_name, double_precision, outputs_frequence, time_reference) |
Create and initialize output file for X & Y coordinate system. | |
subroutine, public | set_attributes (var, long_name, unit, double_precision, add_coords, standard_name, axis, bounds) |
Write output variable attributes. | |
Creates NetCDF output for different fluxes and state variables of mHM.
NetCDF is first initialized and later on variables are put to the NetCDF.
COPYING
and COPYING.LESSER
provided with this software. The complete GNU license text can also be found at http://www.gnu.org/licenses/.
|
private |
Close the file.
Close the file associated with variable of type(OutputDataset)
Definition at line 273 of file mo_nc_output.f90.
|
private |
Create and initialize output file for X & Y coordinate system.
Create output file, write all non-dynamic variables and global attributes for the given domain for X & Y coordinate system
[in] | idomain | selected domain |
[in] | level | level definitions for all domains |
[in] | file_name | long name of the variable |
[in] | double_precision | mask on desired level |
[in] | outputs_frequence | write out frequence (-3, -2, -1, 0, >0) |
[in] | time_reference | time stamp reference (0: begin, 1: center, 2: end of time interval) |
Definition at line 301 of file mo_nc_output.f90.
References mo_common_variables::contact, mo_common_variables::conventions, data_dtype(), mo_common_variables::dirout, mo_common_mhm_mrm_variables::evalper, mo_grid::geocoordinates(), mo_common_variables::history, mo_common_variables::iflag_cordinate_sys, mo_grid::mapcoordinates(), mo_common_variables::mhm_details, mo_common_variables::project_details, set_attributes(), mo_common_variables::setup_description, mo_common_variables::simulation_type, mo_common_mhm_mrm_variables::timestep, and mo_file::version.
Referenced by newoutputdataset().
character(16) function, dimension(3), public mo_nc_output::data_dims |
Output variable dimension names.
Definition at line 94 of file mo_nc_output.f90.
References data_dims(), and mo_common_variables::iflag_cordinate_sys.
Referenced by data_dims(), mo_mrm_write_fluxes_states::gw_outputdataset(), mo_write_fluxes_states::mhm_outputdataset(), and mo_mrm_write_fluxes_states::mrm_outputdataset().
character(3) function, public mo_nc_output::data_dtype | ( | logical, intent(in) | double_precision | ) |
Output variable dtype for single or double precision.
[in] | double_precision | flag to use double precision |
Definition at line 82 of file mo_nc_output.f90.
References data_dtype().
Referenced by createoutputfile(), data_dtype(), mo_mrm_write_fluxes_states::gw_outputdataset(), mo_write_fluxes_states::mhm_outputdataset(), and mo_mrm_write_fluxes_states::mrm_outputdataset().
|
private |
Initialize OutputDataset.
Create and initialize the output file. If new a new output variable needs to be written, this is the first of two procedures to change (second: updateDataset)
[in] | idomain | domain id |
[in] | level | level definitions for all domains |
[in] | file_name | long name of the variable |
[in] | double_precision | mask on desired level |
[in] | outputs_frequence | write out frequence (-3, -2, -1, 0, >0) |
[in] | time_reference | time stamp reference (0: begin, 1: center, 2: end of time interval) |
Definition at line 189 of file mo_nc_output.f90.
References createoutputfile(), and mo_common_mhm_mrm_variables::timestep.
|
private |
Initialize OutputVariable.
Modifications:
[in] | nc | NcDataset which contains the variable |
[in] | name | name of the variable |
[in] | dtype | data type of the variable |
[in] | dims | dimensions of the variable (by name) |
[in] | ncells | number of cells in domain |
[in] | mask | mask of the variable |
[in] | deflate_level | deflate level for compression |
[in] | avg | flag to average the data before writing |
Definition at line 111 of file mo_nc_output.f90.
subroutine, public mo_nc_output::set_attributes | ( | type(ncvariable), intent(inout) | var, |
character(*), intent(in), optional | long_name, | ||
character(*), intent(in), optional | unit, | ||
logical, intent(in), optional | double_precision, | ||
logical, intent(in), optional | add_coords, | ||
character(*), intent(in), optional | standard_name, | ||
character(*), intent(in), optional | axis, | ||
character(*), intent(in), optional | bounds | ||
) |
Write output variable attributes.
Modifications:
[in,out] | var | NetCDF variable |
[in] | long_name | long name of the variable |
[in] | unit | unit of the variable |
[in] | double_precision | precision flag, if missing, no fill-value and missing-value is written |
[in] | add_coords | whether to add the "coordiantes" attribute "lat lon", .true. by defult |
[in] | standard_name | standard name of the variable |
[in] | axis | axis attribute |
[in] | bounds | bounds attribute |
Definition at line 463 of file mo_nc_output.f90.
References mo_common_constants::nodata_dp.
Referenced by createoutputfile(), mo_mrm_write_fluxes_states::gw_outputdataset(), mo_write_fluxes_states::mhm_outputdataset(), and mo_mrm_write_fluxes_states::mrm_outputdataset().
|
private |
Update OutputVariable.
Add the array given as actual argument to the derived type's component 'data'
[in] | data | data for current time step |
Definition at line 140 of file mo_nc_output.f90.
|
private |
Write all accumulated data.
Write all accumulated and potentially averaged data to disk.
[in] | current_time_step | The model timestep to write |
Definition at line 228 of file mo_nc_output.f90.
|
private |
Write timestep to file.
Write the content of the derived types's component 'data' to file, average if necessary
[in] | current_time_step | index along the time dimension of the netcdf variable |
Definition at line 158 of file mo_nc_output.f90.
References mo_common_constants::nodata_dp.