SCALE-RM
|
module FILE I/O (netcdf) More...
Functions/Subroutines | |
subroutine, public | fileio_setup |
Setup. More... | |
subroutine, public | fileio_set_coordinates (LON, LONX, LONY, LONXY, LAT, LATX, LATY, LATXY, CZ, FZ) |
set latlon and z More... | |
subroutine, public | fileio_set_axes (fid, dtype, xy) |
write axis to the file More... | |
subroutine | fileio_read_1d (var, basename, varname, axistype, step) |
Read 1D data from file. More... | |
subroutine | fileio_read_2d (var, basename, varname, axistype, step) |
Read 2D data from file. More... | |
subroutine | fileio_read_3d (var, basename, varname, axistype, step) |
Read 3D data from file. More... | |
subroutine | fileio_read_4d (var, basename, varname, axistype, step) |
Read 4D data from file. More... | |
subroutine | fileio_write_1d (var, basename, title, varname, desc, unit, axistype, datatype, date, subsec, append) |
Write 1D data to file. More... | |
subroutine | fileio_write_2d (var, basename, title, varname, desc, unit, axistype, datatype, date, subsec, append, nohalo, nozcoord) |
Write 2D data to file. More... | |
subroutine | fileio_write_3d (var, basename, title, varname, desc, unit, axistype, datatype, date, subsec, append, nohalo) |
Write 3D data to file. More... | |
subroutine | fileio_write_3d_t (var, basename, title, varname, desc, unit, axistype, datatype, timeintv, tsince, append, timetarg, nohalo) |
Write 3D data with time dimension to file. More... | |
subroutine | fileio_write_4d (var, basename, title, varname, desc, unit, axistype, datatype, timeintv, tsince, append, timetarg, nohalo) |
Write 4D data to file. More... | |
subroutine | getcftunits (tunits, date) |
module FILE I/O (netcdf)
subroutine, public scale_fileio::fileio_setup | ( | ) |
Setup.
Definition at line 78 of file scale_fileio.F90.
References scale_stdio::h_institute, scale_stdio::h_source, scale_grid_index::imaxb, scale_stdio::io_fid_log, scale_stdio::io_l, and scale_grid_index::jmaxb.
Referenced by mod_rm_driver::scalerm(), and mod_rm_prep::scalerm_prep().
subroutine, public scale_fileio::fileio_set_coordinates | ( | real(rp), dimension (ia,ja), intent(in) | LON, |
real(rp), dimension(ia,ja), intent(in) | LONX, | ||
real(rp), dimension(ia,ja), intent(in) | LONY, | ||
real(rp), dimension(ia,ja), intent(in) | LONXY, | ||
real(rp), dimension (ia,ja), intent(in) | LAT, | ||
real(rp), dimension(ia,ja), intent(in) | LATX, | ||
real(rp), dimension(ia,ja), intent(in) | LATY, | ||
real(rp), dimension(ia,ja), intent(in) | LATXY, | ||
real(rp), dimension ( ka,ia,ja), intent(in) | CZ, | ||
real(rp), dimension (0:ka,ia,ja), intent(in) | FZ | ||
) |
set latlon and z
Definition at line 114 of file scale_fileio.F90.
References scale_const::const_d2r, scale_grid_index::ieb, scale_grid_index::isb, scale_grid_index::jeb, and scale_grid_index::jsb.
Referenced by scale_grid_real::real_setup(), and scale_grid_real::real_update_z().
subroutine, public scale_fileio::fileio_set_axes | ( | integer, intent(in) | fid, |
integer, intent(in) | dtype, | ||
logical, intent(in), optional | xy | ||
) |
write axis to the file
Definition at line 148 of file scale_fileio.F90.
References gtool_file::filesettattr(), scale_grid::grid_cbfx, scale_grid::grid_cbfxg, scale_grid::grid_cbfy, scale_grid::grid_cbfyg, scale_grid::grid_cbfz, scale_grid::grid_cdx, scale_grid::grid_cdy, scale_grid::grid_cdz, scale_grid::grid_cx, scale_grid::grid_cxg, scale_grid::grid_cy, scale_grid::grid_cyg, scale_grid::grid_cz, scale_grid::grid_fbfx, scale_grid::grid_fbfxg, scale_grid::grid_fbfy, scale_grid::grid_fbfyg, scale_grid::grid_fbfz, scale_grid::grid_fdx, scale_grid::grid_fdy, scale_grid::grid_fdz, scale_grid::grid_fx, scale_grid::grid_fxg, scale_grid::grid_fy, scale_grid::grid_fyg, scale_grid::grid_fz, scale_land_grid::grid_lcz, scale_land_grid::grid_lfz, scale_urban_grid::grid_ucz, scale_urban_grid::grid_ufz, scale_grid_index::ieb, scale_grid_index::isb, scale_grid_index::jeb, scale_grid_index::jsb, scale_grid_index::ke, scale_grid_index::ks, scale_land_grid_index::lke, scale_land_grid_index::lks, scale_urban_grid_index::uke, and scale_urban_grid_index::uks.
Referenced by fileio_write_1d(), fileio_write_2d(), fileio_write_3d(), fileio_write_3d_t(), and fileio_write_4d().
subroutine scale_fileio::fileio_read_1d | ( | real(rp), dimension(:), intent(out) | var, |
character(len=*), intent(in) | basename, | ||
character(len=*), intent(in) | varname, | ||
character(len=*), intent(in) | axistype, | ||
integer, intent(in) | step | ||
) |
Read 1D data from file.
[out] | var | value of the variable |
[in] | basename | basename of the file |
[in] | varname | name of the variable |
[in] | axistype | axis type (Z/X/Y) |
[in] | step | step number |
Definition at line 323 of file scale_fileio.F90.
References scale_grid_index::ieb, scale_grid_index::imaxb, scale_stdio::io_fid_log, scale_stdio::io_l, scale_grid_index::isb, scale_grid_index::jeb, scale_grid_index::jmaxb, scale_grid_index::jsb, scale_grid_index::ke, scale_grid_index::kmax, scale_grid_index::ks, scale_process::prc_mpistop(), scale_process::prc_myrank, scale_prof::prof_rapend(), and scale_prof::prof_rapstart().
subroutine scale_fileio::fileio_read_2d | ( | real(rp), dimension(:,:), intent(out) | var, |
character(len=*), intent(in) | basename, | ||
character(len=*), intent(in) | varname, | ||
character(len=*), intent(in) | axistype, | ||
integer, intent(in) | step | ||
) |
Read 2D data from file.
[out] | var | value of the variable |
[in] | basename | basename of the file |
[in] | varname | name of the variable |
[in] | axistype | axis type (Z/X/Y) |
[in] | step | step number |
Definition at line 381 of file scale_fileio.F90.
References scale_grid_index::ieb, scale_grid_index::imaxb, scale_stdio::io_fid_log, scale_stdio::io_l, scale_grid_index::isb, scale_grid_index::jeb, scale_grid_index::jmaxb, scale_grid_index::jsb, scale_grid_index::ke, scale_grid_index::kmax, scale_grid_index::ks, scale_process::prc_mpistop(), scale_process::prc_myrank, scale_prof::prof_rapend(), and scale_prof::prof_rapstart().
subroutine scale_fileio::fileio_read_3d | ( | real(rp), dimension(:,:,:), intent(out) | var, |
character(len=*), intent(in) | basename, | ||
character(len=*), intent(in) | varname, | ||
character(len=*), intent(in) | axistype, | ||
integer, intent(in) | step | ||
) |
Read 3D data from file.
[out] | var | value of the variable |
[in] | basename | basename of the file |
[in] | varname | name of the variable |
[in] | axistype | axis type (Z/X/Y/T) |
[in] | step | step number |
Definition at line 442 of file scale_fileio.F90.
References scale_grid_index::ieb, scale_grid_index::imaxb, scale_stdio::io_fid_log, scale_stdio::io_l, scale_grid_index::isb, scale_grid_index::jeb, scale_grid_index::jmaxb, scale_grid_index::jsb, scale_grid_index::ke, scale_grid_index::kmax, scale_grid_index::ks, scale_land_grid_index::lke, scale_land_grid_index::lkmax, scale_land_grid_index::lks, scale_process::prc_mpistop(), scale_process::prc_myrank, scale_prof::prof_rapend(), scale_prof::prof_rapstart(), scale_urban_grid_index::uke, scale_urban_grid_index::ukmax, and scale_urban_grid_index::uks.
subroutine scale_fileio::fileio_read_4d | ( | real(rp), dimension(:,:,:,:), intent(out) | var, |
character(len=*), intent(in) | basename, | ||
character(len=*), intent(in) | varname, | ||
character(len=*), intent(in) | axistype, | ||
integer, intent(in) | step | ||
) |
Read 4D data from file.
[out] | var | value of the variable |
[in] | basename | basename of the file |
[in] | varname | name of the variable |
[in] | axistype | axis type (Z/X/Y/Time) |
[in] | step | step number |
Definition at line 530 of file scale_fileio.F90.
References scale_grid_index::ieb, scale_grid_index::imaxb, scale_stdio::io_fid_log, scale_stdio::io_l, scale_grid_index::isb, scale_grid_index::jeb, scale_grid_index::jmaxb, scale_grid_index::jsb, scale_grid_index::ke, scale_grid_index::kmax, scale_grid_index::ks, scale_process::prc_mpistop(), scale_process::prc_myrank, scale_prof::prof_rapend(), and scale_prof::prof_rapstart().
subroutine scale_fileio::fileio_write_1d | ( | real(rp), dimension(:), intent(in) | var, |
character(len=*), intent(in) | basename, | ||
character(len=*), intent(in) | title, | ||
character(len=*), intent(in) | varname, | ||
character(len=*), intent(in) | desc, | ||
character(len=*), intent(in) | unit, | ||
character(len=*), intent(in) | axistype, | ||
character(len=*), intent(in) | datatype, | ||
integer, dimension(6), intent(in), optional | date, | ||
real(dp), intent(in), optional | subsec, | ||
logical, intent(in), optional | append | ||
) |
Write 1D data to file.
[in] | var | value of the variable |
[in] | basename | basename of the file |
[in] | title | title of the file |
[in] | varname | name of the variable |
[in] | desc | description of the variable |
[in] | unit | unit of the variable |
[in] | axistype | axis type (Z/X/Y) |
[in] | datatype | data type (REAL8/REAL4/default) |
[in] | date | ymdhms of the time |
[in] | subsec | subsec of the time |
[in] | append | switch whether append existing file or not (default=false) |
Definition at line 598 of file scale_fileio.F90.
References gtool_file_h::file_real4, gtool_file_h::file_real8, gtool_file::filecreate(), fileio_set_axes(), getcftunits(), scale_stdio::h_institute, scale_stdio::h_source, scale_grid_index::ieb, scale_grid_index::imaxb, scale_grid_index::isb, scale_grid_index::jeb, scale_grid_index::jmaxb, scale_grid_index::jsb, scale_grid_index::ke, scale_grid_index::kmax, scale_grid_index::ks, scale_rm_process::prc_2drank, scale_process::prc_masterrank, scale_process::prc_mpistop(), scale_process::prc_myrank, scale_prof::prof_rapend(), scale_prof::prof_rapstart(), scale_precision::rp, scale_time::time_nowdate, scale_time::time_nowdaysec, and scale_time::time_nowms.
subroutine scale_fileio::fileio_write_2d | ( | real(rp), dimension(:,:), intent(in) | var, |
character(len=*), intent(in) | basename, | ||
character(len=*), intent(in) | title, | ||
character(len=*), intent(in) | varname, | ||
character(len=*), intent(in) | desc, | ||
character(len=*), intent(in) | unit, | ||
character(len=*), intent(in) | axistype, | ||
character(len=*), intent(in) | datatype, | ||
integer, dimension(6), intent(in), optional | date, | ||
real(dp), intent(in), optional | subsec, | ||
logical, intent(in), optional | append, | ||
logical, intent(in), optional | nohalo, | ||
logical, intent(in), optional | nozcoord | ||
) |
Write 2D data to file.
[in] | var | value of the variable |
[in] | basename | basename of the file |
[in] | title | title of the file |
[in] | varname | name of the variable |
[in] | desc | description of the variable |
[in] | unit | unit of the variable |
[in] | axistype | axis type (Z/X/Y) |
[in] | datatype | data type (REAL8/REAL4/default) |
[in] | date | ymdhms of the time |
[in] | subsec | subsec of the time |
[in] | append | switch whether append existing file or not (default=false) |
[in] | nohalo | switch whether include halo data or not (default=false) |
[in] | nozcoord | switch whether include zcoordinate or not (default=false) |
Definition at line 738 of file scale_fileio.F90.
References gtool_file_h::file_real4, gtool_file_h::file_real8, gtool_file::filecreate(), fileio_set_axes(), getcftunits(), scale_stdio::h_institute, scale_stdio::h_source, scale_grid_index::ia, scale_grid_index::ie, scale_grid_index::ieb, scale_grid_index::imaxb, scale_grid_index::is, scale_grid_index::isb, scale_grid_index::ja, scale_grid_index::je, scale_grid_index::jeb, scale_grid_index::jmaxb, scale_grid_index::js, scale_grid_index::jsb, scale_grid_index::ke, scale_grid_index::kmax, scale_grid_index::ks, scale_rm_process::prc_2drank, scale_process::prc_masterrank, scale_process::prc_mpistop(), scale_process::prc_myrank, scale_prof::prof_rapend(), scale_prof::prof_rapstart(), gtool_file::rmiss, scale_precision::rp, scale_time::time_nowdate, scale_time::time_nowdaysec, and scale_time::time_nowms.
subroutine scale_fileio::fileio_write_3d | ( | real(rp), dimension(:,:,:), intent(in) | var, |
character(len=*), intent(in) | basename, | ||
character(len=*), intent(in) | title, | ||
character(len=*), intent(in) | varname, | ||
character(len=*), intent(in) | desc, | ||
character(len=*), intent(in) | unit, | ||
character(len=*), intent(in) | axistype, | ||
character(len=*), intent(in) | datatype, | ||
integer, dimension(6), intent(in), optional | date, | ||
real(dp), intent(in), optional | subsec, | ||
logical, intent(in), optional | append, | ||
logical, intent(in), optional | nohalo | ||
) |
Write 3D data to file.
[in] | var | value of the variable |
[in] | basename | basename of the file |
[in] | title | title of the file |
[in] | varname | name of the variable |
[in] | desc | description of the variable |
[in] | unit | unit of the variable |
[in] | axistype | axis type (Z/X/Y) |
[in] | datatype | data type (REAL8/REAL4/default) |
[in] | date | ymdhms of the time |
[in] | subsec | subsec of the time |
[in] | append | append existing (closed) file? |
[in] | nohalo | include halo data? |
Definition at line 942 of file scale_fileio.F90.
References gtool_file_h::file_real4, gtool_file_h::file_real8, gtool_file::filecreate(), fileio_set_axes(), getcftunits(), scale_stdio::h_institute, scale_stdio::h_source, scale_grid_index::ia, scale_grid_index::ie, scale_grid_index::ieb, scale_grid_index::imaxb, scale_grid_index::is, scale_grid_index::isb, scale_grid_index::ja, scale_grid_index::je, scale_grid_index::jeb, scale_grid_index::jmaxb, scale_grid_index::js, scale_grid_index::jsb, scale_grid_index::ke, scale_grid_index::kmax, scale_grid_index::ks, scale_land_grid_index::lke, scale_land_grid_index::lkmax, scale_land_grid_index::lks, scale_rm_process::prc_2drank, scale_process::prc_masterrank, scale_process::prc_mpistop(), scale_process::prc_myrank, scale_prof::prof_rapend(), scale_prof::prof_rapstart(), gtool_file::rmiss, scale_precision::rp, scale_time::time_nowdate, scale_time::time_nowdaysec, scale_time::time_nowms, scale_urban_grid_index::uke, scale_urban_grid_index::ukmax, and scale_urban_grid_index::uks.
subroutine scale_fileio::fileio_write_3d_t | ( | real(rp), dimension(:,:,:), intent(in) | var, |
character(len=*), intent(in) | basename, | ||
character(len=*), intent(in) | title, | ||
character(len=*), intent(in) | varname, | ||
character(len=*), intent(in) | desc, | ||
character(len=*), intent(in) | unit, | ||
character(len=*), intent(in) | axistype, | ||
character(len=*), intent(in) | datatype, | ||
real(rp), intent(in) | timeintv, | ||
integer, dimension(6), intent(in) | tsince, | ||
logical, intent(in), optional | append, | ||
integer, intent(in), optional | timetarg, | ||
logical, intent(in), optional | nohalo | ||
) |
Write 3D data with time dimension to file.
[in] | var | value of the variable |
[in] | basename | basename of the file |
[in] | title | title of the file |
[in] | varname | name of the variable |
[in] | desc | description of the variable |
[in] | unit | unit of the variable |
[in] | axistype | axis type (X/Y/Time) |
[in] | datatype | data type (REAL8/REAL4/default) |
[in] | timeintv | time interval [sec] |
[in] | tsince | start time |
[in] | append | append existing (closed) file? |
[in] | timetarg | target timestep (optional) |
[in] | nohalo | include halo data? |
Definition at line 1188 of file scale_fileio.F90.
References gtool_file_h::file_real4, gtool_file_h::file_real8, gtool_file::filecreate(), fileio_set_axes(), scale_stdio::h_institute, scale_stdio::h_source, scale_grid_index::ia, scale_grid_index::ie, scale_grid_index::ieb, scale_grid_index::imaxb, scale_grid_index::is, scale_grid_index::isb, scale_grid_index::ja, scale_grid_index::je, scale_grid_index::jeb, scale_grid_index::jmaxb, scale_grid_index::js, scale_grid_index::jsb, scale_rm_process::prc_2drank, scale_process::prc_masterrank, scale_process::prc_mpistop(), scale_process::prc_myrank, scale_prof::prof_rapend(), scale_prof::prof_rapstart(), gtool_file::rmiss, and scale_precision::rp.
subroutine scale_fileio::fileio_write_4d | ( | real(rp), dimension(:,:,:,:), intent(in) | var, |
character(len=*), intent(in) | basename, | ||
character(len=*), intent(in) | title, | ||
character(len=*), intent(in) | varname, | ||
character(len=*), intent(in) | desc, | ||
character(len=*), intent(in) | unit, | ||
character(len=*), intent(in) | axistype, | ||
character(len=*), intent(in) | datatype, | ||
real(rp), intent(in) | timeintv, | ||
integer, dimension(6), intent(in) | tsince, | ||
logical, intent(in), optional | append, | ||
integer, intent(in), optional | timetarg, | ||
logical, intent(in), optional | nohalo | ||
) |
Write 4D data to file.
[in] | var | value of the variable |
[in] | basename | basename of the file |
[in] | title | title of the file |
[in] | varname | name of the variable |
[in] | desc | description of the variable |
[in] | unit | unit of the variable |
[in] | axistype | axis type (Z/X/Y/Time) |
[in] | datatype | data type (REAL8/REAL4/default) |
[in] | timeintv | time interval [sec] |
[in] | tsince | start time |
[in] | append | append existing (closed) file? |
[in] | timetarg | target timestep (optional) |
[in] | nohalo | include halo data? |
Definition at line 1400 of file scale_fileio.F90.
References gtool_file_h::file_real4, gtool_file_h::file_real8, gtool_file::filecreate(), fileio_set_axes(), getcftunits(), scale_stdio::h_institute, scale_stdio::h_source, scale_grid_index::ia, scale_grid_index::ie, scale_grid_index::ieb, scale_grid_index::imaxb, scale_grid_index::is, scale_grid_index::isb, scale_grid_index::ja, scale_grid_index::je, scale_grid_index::jeb, scale_grid_index::jmaxb, scale_grid_index::js, scale_grid_index::jsb, scale_grid_index::ke, scale_grid_index::kmax, scale_grid_index::ks, scale_rm_process::prc_2drank, scale_process::prc_masterrank, scale_process::prc_mpistop(), scale_process::prc_myrank, scale_prof::prof_rapend(), scale_prof::prof_rapstart(), gtool_file::rmiss, and scale_precision::rp.
subroutine scale_fileio::getcftunits | ( | character(len=34), intent(out) | tunits, |
integer, dimension(6), intent(in) | date | ||
) |
Definition at line 1619 of file scale_fileio.F90.
Referenced by fileio_write_1d(), fileio_write_2d(), fileio_write_3d(), and fileio_write_4d().