global_cycle
1.13.0
|
This module contains routines that read and write data. More...
Data Types | |
type | nsst_data |
Functions/Subroutines | |
subroutine, public | get_dim_nc (filename, nlat, nlon) |
Get the i/j dimensions of the data from a NetCDF file. More... | |
subroutine, public | get_tf_clm_dim (file_sst, mlat_sst, mlon_sst) |
Get the i/j dimensions of RTG SST climatology file. More... | |
subroutine | nc_check (status) |
Check the NetCDF status code. More... | |
subroutine | netcdf_err (ERR, STRING) |
If a NetCDF call returns an error, print out a user-supplied message and the NetCDF library message. More... | |
subroutine, public | read_data (LSOIL, LENSFC, DO_NSST, DO_SNO_INC_JEDI, DO_SOI_INC_JEDI, INC_FILE, IS_NOAHMP, TSFFCS, SMCFCS, SWEFCS, STCFCS, TG3FCS, ZORFCS, CVFCS, CVBFCS, CVTFCS, ALBFCS, VEGFCS, SLIFCS, CNPFCS, F10M, VETFCS, SOTFCS, ALFFCS, USTAR, FMM, FHH, SIHFCS, SICFCS, SITFCS, TPRCP, SRFLAG, SNDFCS, VMNFCS, VMXFCS, SLCFCS, STCINC, SLCINC, SLPFCS, ABSFCS, T2M, Q2M, SLMASK, ZSOIL, NSST) |
Read the first guess surface records and nsst records (if selected) for a single cubed-sphere tile. More... | |
subroutine, public | read_gsi_data (GSI_FILE, FILE_TYPE, LSOIL) |
Read increment file from the GSI containing either the foundation temperature increments and mask, or the soil increments. More... | |
subroutine, public | read_lat_lon_orog (RLA, RLO, OROG, OROG_UF, TILE_NUM, IDIM, JDIM, IJDIM, LANDFRAC) |
Read latitude and longitude for the cubed-sphere tile from the 'grid' file. More... | |
subroutine, public | read_salclm_gfs_nc (filename, sal, xlats, xlons, nlat, nlon, itime) |
Read the woa05 salinity monthly climatology file. More... | |
subroutine, public | read_tf_clim_grb (file_sst, sst, rlats_sst, rlons_sst, mlat_sst, mlon_sst, mon) |
Read a GRIB1 sst climatological analysis file. More... | |
subroutine | remove_checksum (ncid, id_var) |
Remove the checksum attribute from a netcdf record. More... | |
subroutine, public | write_data (lensfc, idim, jdim, lsoil, do_nsst, inc_file, nsst, slifcs, tsffcs, vegfcs, swefcs, tg3fcs, zorfcs, albfcs, alffcs, cnpfcs, f10m, t2m, q2m, vetfcs, sotfcs, ustar, fmm, fhh, sicfcs, sihfcs, sitfcs, tprcp, srflag, swdfcs, vmnfcs, vmxfcs, slpfcs, absfcs, slcfcs, smcfcs, stcfcs, stcinc, slcinc) |
Update surface records - and nsst records if selected - on a single cubed-sphere tile to a pre-existing model restart file (in netcdf). More... | |
Variables | |
real, dimension(:,:), allocatable, public | dtref_gaus |
GSI foundation temperature increment on the gaussian grid. More... | |
integer, public | idim_gaus |
'i' dimension of GSI gaussian grid. More... | |
integer, public | jdim_gaus |
'j' dimension of GSI gaussian grid. More... | |
real, dimension(:,:,:), allocatable, public | slc_inc_gaus |
GSI soil moisture increments on the gaussian grid. More... | |
integer, dimension(:,:), allocatable, public | slmsk_gaus |
GSI land mask on the gaussian grid. More... | |
integer, dimension(:,:), allocatable, public | soilsnow_gaus |
GSI soil / snow mask for land on the gaussian grid. More... | |
real, dimension(:,:,:), allocatable, public | stc_inc_gaus |
GSI soil temperature increments on the gaussian grid. More... | |
This module contains routines that read and write data.
type read_write_data::nsst_data |
Definition at line 16 of file read_write_data.f90.
subroutine, public read_write_data::get_dim_nc | ( | character (len=*), intent(in) | filename, |
integer, intent(out) | nlat, | ||
integer, intent(out) | nlon | ||
) |
Get the i/j dimensions of the data from a NetCDF file.
[in] | filename | Name of the file to be read. |
[out] | nlat | 'j' dimension of the data in the file. |
[out] | nlon | 'i' dimension of the data in the file. |
Definition at line 1922 of file read_write_data.f90.
References nc_check().
Referenced by get_sal_clm().
subroutine, public read_write_data::get_tf_clm_dim | ( | character(*), intent(in) | file_sst, |
integer, intent(out) | mlat_sst, | ||
integer, intent(out) | mlon_sst | ||
) |
Get the i/j dimensions of RTG SST climatology file.
The file is GRIB1.
[in] | file_sst | File name of the sst file. |
[in] | mlat_sst | The 'j' dimension of the data. |
[in] | mlon_sst | The 'i' dimension of the data. |
Definition at line 1793 of file read_write_data.f90.
Referenced by get_tf_clm().
subroutine read_write_data::nc_check | ( | integer, intent(in) | status | ) |
Check the NetCDF status code.
If there is an error, print the library error message and stop processing.
[in] | status | NetCDF status code. |
Definition at line 1959 of file read_write_data.f90.
Referenced by get_dim_nc(), and read_salclm_gfs_nc().
subroutine read_write_data::netcdf_err | ( | integer, intent(in) | ERR, |
character(len=*), intent(in) | STRING | ||
) |
If a NetCDF call returns an error, print out a user-supplied message and the NetCDF library message.
Then stop processing.
[in] | ERR | NetCDF error code. |
[in] | STRING | User-defined error message. |
Definition at line 876 of file read_write_data.f90.
Referenced by read_data(), read_gsi_data(), read_lat_lon_orog(), remove_checksum(), and write_data().
subroutine, public read_write_data::read_data | ( | integer, intent(in) | LSOIL, |
integer, intent(in) | LENSFC, | ||
logical, intent(in) | DO_NSST, | ||
logical, intent(in) | DO_SNO_INC_JEDI, | ||
logical, intent(in) | DO_SOI_INC_JEDI, | ||
logical, intent(in) | INC_FILE, | ||
logical, intent(out), optional | IS_NOAHMP, | ||
real, dimension(lensfc), intent(out), optional | TSFFCS, | ||
real, dimension(lensfc,lsoil), intent(out), optional | SMCFCS, | ||
real, dimension(lensfc), intent(out), optional | SWEFCS, | ||
real, dimension(lensfc,lsoil), intent(out), optional | STCFCS, | ||
real, dimension(lensfc), intent(out), optional | TG3FCS, | ||
real, dimension(lensfc), intent(out), optional | ZORFCS, | ||
real, dimension(lensfc), intent(out), optional | CVFCS, | ||
real, dimension(lensfc), intent(out), optional | CVBFCS, | ||
real, dimension(lensfc), intent(out), optional | CVTFCS, | ||
real, dimension(lensfc,4), intent(out), optional | ALBFCS, | ||
real, dimension(lensfc), intent(out), optional | VEGFCS, | ||
real, dimension(lensfc), intent(out), optional | SLIFCS, | ||
real, dimension(lensfc), intent(out), optional | CNPFCS, | ||
real, dimension(lensfc), intent(out), optional | F10M, | ||
real, dimension(lensfc), intent(out), optional | VETFCS, | ||
real, dimension(lensfc), intent(out), optional | SOTFCS, | ||
real, dimension(lensfc,2), intent(out), optional | ALFFCS, | ||
real, dimension(lensfc), intent(out), optional | USTAR, | ||
real, dimension(lensfc), intent(out), optional | FMM, | ||
real, dimension(lensfc), intent(out), optional | FHH, | ||
real, dimension(lensfc), intent(out), optional | SIHFCS, | ||
real, dimension(lensfc), intent(out), optional | SICFCS, | ||
real, dimension(lensfc), intent(out), optional | SITFCS, | ||
real, dimension(lensfc), intent(out), optional | TPRCP, | ||
real, dimension(lensfc), intent(out), optional | SRFLAG, | ||
real, dimension(lensfc), intent(out), optional | SNDFCS, | ||
real, dimension(lensfc), intent(out), optional | VMNFCS, | ||
real, dimension(lensfc), intent(out), optional | VMXFCS, | ||
real, dimension(lensfc,lsoil), intent(out), optional | SLCFCS, | ||
real, dimension(lensfc,lsoil), intent(out), optional | STCINC, | ||
real, dimension(lensfc,lsoil), intent(out), optional | SLCINC, | ||
real, dimension(lensfc), intent(out), optional | SLPFCS, | ||
real, dimension(lensfc), intent(out), optional | ABSFCS, | ||
real, dimension(lensfc), intent(out), optional | T2M, | ||
real, dimension(lensfc), intent(out), optional | Q2M, | ||
real, dimension(lensfc), intent(out), optional | SLMASK, | ||
real(kind=4), dimension(lsoil), intent(out), optional | ZSOIL, | ||
type(nsst_data), optional | NSST | ||
) |
Read the first guess surface records and nsst records (if selected) for a single cubed-sphere tile.
[in] | LSOIL | Number of soil layers. |
[in] | LENSFC | Total number of points on a tile. |
[in] | DO_NSST | When true, nsst fields are read. |
[in] | DO_SNO_INC_JEDI | When true, read in snow increment file |
[in] | DO_SOI_INC_JEDI | When true, read in soil increment file |
[in] | INC_FILE | When true, read from an increment file. False reads from a restart file. increments are on the cubed-sphere tiles |
[out] | IS_NOAHMP | When true, process for the Noah-MP LSM. |
[out] | TSFFCS | Skin Temperature. |
[out] | SMCFCS | Total volumetric soil moisture. |
[out] | SWEFCS | Snow water equivalent. |
[out] | STCFCS | Soil temperature. |
[out] | TG3FCS | Soil substrate temperature. |
[out] | ZORFCS | Roughness length. |
[out] | CVFCS | Cloud cover. |
[out] | CVBFCS | Cloud base. |
[out] | CVTFCS | Cloud top. |
[out] | ALBFCS | Snow-free albedo. |
[out] | SLIFCS | Land-sea mask including ice flag. |
[out] | VEGFCS | Vegetation greenness. |
[out] | CNPFCS | Plant canopy moisture content. |
[out] | F10M | log((z0+10)/z0). See model routine sfc_diff.f for details. |
[out] | VETFCS | Vegetation type. |
[out] | SOTFCS | Soil type. |
[out] | ALFFCS | Fractional coverage for strong/weak zenith angle dependent albedo. |
[out] | USTAR | Friction velocity. |
[out] | FMM | log((z0+z1)/z0). See model routine sfc_diff.f for details. |
[out] | FHH | log((ztmax+z1)/ztmax). See model routine sfc_diff.f for details. |
[out] | SIHFCS | Sea ice depth. |
[out] | SICFCS | Sea ice concentration. |
[out] | SITFCS | Sea ice temperature. |
[out] | TPRCP | Precipitation. |
[out] | SRFLAG | Snow/rain flag. |
[out] | SNDFCS | Snow depth. |
[out] | VMNFCS | Minimum vegetation greenness. |
[out] | VMXFCS | Maximum vegetation greenness. |
[out] | SLCFCS | Liquid portion of volumetric soil moisture. |
[out] | SLPFCS | Slope type. |
[out] | ABSFCS | Maximum snow albedo. |
[out] | T2M | Two-meter air temperature. |
[out] | Q2M | Two-meter specific humidity. |
[out] | SLMASK | Land-sea mask without ice flag. |
[out] | ZSOIL | Soil layer thickness. |
[out] | NSST | Data structure containing nsst fields. |
[in] | SLCINC | Liquid soil moisture increments on the cubed-sphere tiles |
[in] | STCINC | Soil temperature increments on the cubed-sphere tiles |
Definition at line 1101 of file read_write_data.f90.
References netcdf_err().
Referenced by sfcdrv().
subroutine, public read_write_data::read_gsi_data | ( | character(len=*), intent(in) | GSI_FILE, |
character(len=3), intent(in) | FILE_TYPE, | ||
integer, intent(in), optional | LSOIL | ||
) |
Read increment file from the GSI containing either the foundation temperature increments and mask, or the soil increments.
The data is in NetCDF and on a gaussian grid. The grid contains two extra rows for each pole. The interpolation from gaussian to native grid assumes no pole points, so these are removed.
[in] | GSI_FILE | Path/name of the GSI file to be read. |
[in] | FILE_TYPE | file-type to be read in, 'NST' or 'LND'. |
[in] | LSOIL | Number of model soil levels. |
Definition at line 909 of file read_write_data.f90.
References dtref_gaus, idim_gaus, jdim_gaus, netcdf_err(), slc_inc_gaus, slmsk_gaus, soilsnow_gaus, and stc_inc_gaus.
Referenced by sfcdrv().
subroutine, public read_write_data::read_lat_lon_orog | ( | real, dimension(ijdim), intent(out) | RLA, |
real, dimension(ijdim), intent(out) | RLO, | ||
real, dimension(ijdim), intent(out) | OROG, | ||
real, dimension(ijdim), intent(out) | OROG_UF, | ||
character(len=5), intent(out) | TILE_NUM, | ||
integer, intent(in) | IDIM, | ||
integer, intent(in) | JDIM, | ||
integer, intent(in) | IJDIM, | ||
real(kind=kind_io8), dimension(ijdim), intent(out), optional | LANDFRAC | ||
) |
Read latitude and longitude for the cubed-sphere tile from the 'grid' file.
Read the filtered and unfiltered orography and optionally the land fraction from the 'orography' file.
[in] | IDIM | 'i' dimension of cubed-sphere tile. |
[in] | JDIM | 'j' dimension of cubed-sphere tile. |
[in] | IJDIM | Total number of points on the cubed-sphere tile. |
[out] | RLA | Latitude on the cubed-sphere tile. |
[out] | RLO | Longitude on the cubed-sphere tile. |
[out] | OROG | Filtered orography. |
[out] | OROG_UF | Unfiltered orography. |
[out] | TILE_NUM | Cubed-sphere tile number |
[out] | LANDFRAC | Land fraction. |
Definition at line 733 of file read_write_data.f90.
References netcdf_err().
Referenced by sfcdrv().
subroutine, public read_write_data::read_salclm_gfs_nc | ( | character (len=*), intent(in) | filename, |
real, dimension(nlon,nlat), intent(out) | sal, | ||
real, dimension(nlat), intent(out) | xlats, | ||
real, dimension(nlon), intent(out) | xlons, | ||
integer, intent(in) | nlat, | ||
integer, intent(in) | nlon, | ||
integer, intent(in) | itime | ||
) |
Read the woa05 salinity monthly climatology file.
The file is NetCDF.
[in] | filename | The name of the climatology file. |
[in] | nlat | The 'j' dimension of the data in the file. |
[in] | nlon | The 'i' dimension of the data in the file. |
[in] | itime | The monthly record to read. |
[out] | xlats | The latitude of the data points. |
[out] | xlons | The longitude of the data points. |
[out] | sal | The salinity. |
Definition at line 1851 of file read_write_data.f90.
References nc_check().
Referenced by get_sal_clm_ta().
subroutine, public read_write_data::read_tf_clim_grb | ( | character(*), intent(in) | file_sst, |
real, dimension(mlon_sst,mlat_sst), intent(out) | sst, | ||
real, dimension(mlat_sst), intent(out) | rlats_sst, | ||
real, dimension(mlon_sst), intent(out) | rlons_sst, | ||
integer, intent(in) | mlat_sst, | ||
integer, intent(in) | mlon_sst, | ||
integer, intent(in) | mon | ||
) |
Read a GRIB1 sst climatological analysis file.
Read the sst analysis and save it as an expanded and transposed array.
[in] | file_sst | File name of the sst file. |
[in] | mlat_sst | 'j' dimension of the sst data. |
[in] | mlon_sst | 'i' dimension of the sst data. |
[in] | mon | The month of the year. |
[out] | sst | The sst analysis data. |
[out] | rlats_sst | The latitudes of the sst data points. |
[out] | rlons_sst | The longitudes of the sst data points. |
Definition at line 1651 of file read_write_data.f90.
Referenced by get_tf_clm_ta().
subroutine read_write_data::remove_checksum | ( | integer, intent(in) | ncid, |
integer, intent(in) | id_var | ||
) |
Remove the checksum attribute from a netcdf record.
[in] | ncid | netcdf file id |
[in] | id_var | netcdf variable id. |
Definition at line 693 of file read_write_data.f90.
References netcdf_err().
Referenced by write_data().
subroutine, public read_write_data::write_data | ( | integer, intent(in) | lensfc, |
integer, intent(in) | idim, | ||
integer, intent(in) | jdim, | ||
integer, intent(in) | lsoil, | ||
logical, intent(in) | do_nsst, | ||
logical, intent(in) | inc_file, | ||
type(nsst_data), intent(in) | nsst, | ||
real, dimension(lensfc), intent(in), optional | slifcs, | ||
real, dimension(lensfc), intent(in), optional | tsffcs, | ||
real, dimension(lensfc), intent(in), optional | vegfcs, | ||
real, dimension(lensfc), intent(in), optional | swefcs, | ||
real, dimension(lensfc), intent(in), optional | tg3fcs, | ||
real, dimension(lensfc), intent(in), optional | zorfcs, | ||
real, dimension(lensfc,4), intent(in), optional | albfcs, | ||
real, dimension(lensfc,2), intent(in), optional | alffcs, | ||
real, dimension(lensfc), intent(in), optional | cnpfcs, | ||
real, dimension(lensfc), intent(in), optional | f10m, | ||
real, dimension(lensfc), intent(in), optional | t2m, | ||
real, dimension(lensfc), intent(in), optional | q2m, | ||
real, dimension(lensfc), intent(in), optional | vetfcs, | ||
real, dimension(lensfc), intent(in), optional | sotfcs, | ||
real, dimension(lensfc), intent(in), optional | ustar, | ||
real, dimension(lensfc), intent(in), optional | fmm, | ||
real, dimension(lensfc), intent(in), optional | fhh, | ||
real, dimension(lensfc), intent(in), optional | sicfcs, | ||
real, dimension(lensfc), intent(in), optional | sihfcs, | ||
real, dimension(lensfc), intent(in), optional | sitfcs, | ||
real, dimension(lensfc), intent(in), optional | tprcp, | ||
real, dimension(lensfc), intent(in), optional | srflag, | ||
real, dimension(lensfc), intent(in), optional | swdfcs, | ||
real, dimension(lensfc), intent(in), optional | vmnfcs, | ||
real, dimension(lensfc), intent(in), optional | vmxfcs, | ||
real, dimension(lensfc), intent(in), optional | slpfcs, | ||
real, dimension(lensfc), intent(in), optional | absfcs, | ||
real, dimension(lensfc,lsoil), intent(in), optional | slcfcs, | ||
real, dimension(lensfc,lsoil), intent(in), optional | smcfcs, | ||
real, dimension(lensfc,lsoil), intent(in), optional | stcfcs, | ||
real, dimension(lensfc,lsoil), intent(in), optional | stcinc, | ||
real, dimension(lensfc,lsoil), intent(in), optional | slcinc | ||
) |
Update surface records - and nsst records if selected - on a single cubed-sphere tile to a pre-existing model restart file (in netcdf).
[in] | idim | 'i' dimension of a tile. |
[in] | jdim | 'j' dimension of a tile. |
[in] | lensfc | Total number of points on a tile. |
[in] | lsoil | Number of soil layers. |
[in] | do_nsst | When true, nsst fields were processed. |
[in] | inc_file | When true, write out increments to files |
[in] | nsst | Data structure containing nsst fields. |
[in] | slifcs | Land-sea mask. |
[in] | tsffcs | Skin temperature. |
[in] | vegfcs | Vegetation greenness. |
[in] | swefcs | Snow water equivalent |
[in] | tg3fcs | Soil substrate temperature. |
[in] | zorfcs | Roughness length. |
[in] | albfcs | Snow-free albedo. |
[in] | alffcs | Fractional coverage for strong/weak zenith angle dependent albedo. |
[in] | cnpfcs | Plant canopy moisture content. |
[in] | f10m | log((z0+10)/z0). See model routine sfc_diff.f for details. |
[in] | t2m | Two-meter air temperature. |
[in] | q2m | Two-meter specific humidity. |
[in] | vetfcs | Vegetation type. |
[in] | sotfcs | Soil type. |
[in] | ustar | Friction velocity. |
[in] | fmm | log((z0+z1)/z0). See model routine sfc_diff.f for details. |
[in] | fhh | log(ztmax+z1)/ztmax). See model routine sfc_diff.f for details. |
[in] | sicfcs | Sea ice concentraton. |
[in] | sihfcs | Sea ice depth. |
[in] | sitfcs | Sea ice temperature. |
[in] | tprcp | Precipitation. |
[in] | srflag | Snow/rain flag. |
[in] | swdfcs | Physical snow depth. |
[in] | vmnfcs | Minimum vegetation greenness. |
[in] | vmxfcs | Maximum vegetation greenness. |
[in] | slpfcs | Slope type. |
[in] | absfcs | Maximum snow albedo. |
[in] | slcfcs | Liquid portion of volumetric soil moisture. |
[in] | smcfcs | Total volumetric soil moisture. |
[in] | stcfcs | Soil temperature. |
[in] | stcinc | Soil temperature increments on the cubed-sphere tiles |
[in] | slcinc | Liquid soil moisture increments on the cubed-sphere tiles |
Definition at line 132 of file read_write_data.f90.
References netcdf_err(), and remove_checksum().
Referenced by sfcdrv().
real, dimension(:,:), allocatable, public read_write_data::dtref_gaus |
GSI foundation temperature increment on the gaussian grid.
Definition at line 49 of file read_write_data.f90.
Referenced by adjust_nsst(), and read_gsi_data().
integer, public read_write_data::idim_gaus |
'i' dimension of GSI gaussian grid.
Definition at line 38 of file read_write_data.f90.
Referenced by adjust_nsst(), land_increments::gaussian_to_fv3_interp(), and read_gsi_data().
integer, public read_write_data::jdim_gaus |
'j' dimension of GSI gaussian grid.
Definition at line 40 of file read_write_data.f90.
Referenced by adjust_nsst(), land_increments::gaussian_to_fv3_interp(), and read_gsi_data().
real, dimension(:,:,:), allocatable, public read_write_data::slc_inc_gaus |
GSI soil moisture increments on the gaussian grid.
Definition at line 55 of file read_write_data.f90.
Referenced by land_increments::gaussian_to_fv3_interp(), and read_gsi_data().
integer, dimension(:,:), allocatable, public read_write_data::slmsk_gaus |
GSI land mask on the gaussian grid.
Definition at line 42 of file read_write_data.f90.
Referenced by adjust_nsst(), and read_gsi_data().
integer, dimension(:,:), allocatable, public read_write_data::soilsnow_gaus |
GSI soil / snow mask for land on the gaussian grid.
1 - soil, 2 - snow, 0 - not land
Definition at line 45 of file read_write_data.f90.
Referenced by land_increments::gaussian_to_fv3_interp(), and read_gsi_data().
real, dimension(:,:,:), allocatable, public read_write_data::stc_inc_gaus |
GSI soil temperature increments on the gaussian grid.
Definition at line 52 of file read_write_data.f90.
Referenced by land_increments::gaussian_to_fv3_interp(), and read_gsi_data().