global_cycle 1.14.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. | |
subroutine, public | get_tf_clm_dim (file_sst, mlat_sst, mlon_sst) |
Get the i/j dimensions of RTG SST climatology file. | |
subroutine | nc_check (status) |
Check the NetCDF status code. | |
subroutine | netcdf_err (err, string) |
If a NetCDF call returns an error, print out a user-supplied message and the NetCDF library message. | |
subroutine, public | read_data (lsoil, lensfc, do_nsst, is_noahmp, fname_inc, 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, lsoil_incr, slpfcs, absfcs, t2m, q2m, slmask, zsoil, nsst) |
Read the first guess surface records and nsst records (if selected) for a single cubed-sphere tile. | |
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. | |
subroutine, public | read_lat_lon_orog (rla, rlo, orog, orog_uf, tile_num, idim, jdim, ijdim, landfrac, lakefrac) |
Read latitude and longitude for the cubed-sphere tile from the 'grid' file. | |
subroutine, public | read_salclm_gfs_nc (filename, sal, xlats, xlons, nlat, nlon, itime) |
Read the woa05 salinity monthly climatology file. | |
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. | |
subroutine | remove_checksum (ncid, id_var) |
Remove the checksum attribute from a netcdf record. | |
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). | |
Variables | |
real, dimension(:,:), allocatable, public | dtref_gaus |
GSI foundation temperature increment on the gaussian grid. | |
integer, public | idim_gaus |
'i' dimension of GSI gaussian grid. | |
integer, public | jdim_gaus |
'j' dimension of GSI gaussian grid. | |
real, dimension(:,:,:), allocatable, public | slc_inc_gaus |
GSI soil moisture increments on the gaussian grid. | |
integer, dimension(:,:), allocatable, public | slmsk_gaus |
GSI land mask on the gaussian grid. | |
integer, dimension(:,:), allocatable, public | soilsnow_gaus |
GSI soil / snow mask for land on the gaussian grid. | |
real, dimension(:,:,:), allocatable, public | stc_inc_gaus |
GSI soil temperature increments on the gaussian grid. | |
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 1979 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 1850 of file read_write_data.f90.
Referenced by get_tf_clm().
|
private |
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 2016 of file read_write_data.f90.
Referenced by get_dim_nc(), and read_salclm_gfs_nc().
|
private |
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 885 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(out), optional | is_noahmp, | ||
character(len=50), intent(in), optional | fname_inc, | ||
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, | ||
integer, intent(in), optional | lsoil_incr, | ||
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. |
[out] | IS_NOAHMP | When true, process for the Noah-MP LSM. |
[in] | FNAME_INC | Name of the increment file. |
[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 |
[in] | LSOIL_INCR | Number of soil layers (from top) to apply soil increments to |
Definition at line 1094 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 918 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, | ||
real(kind=kind_io8), dimension(ijdim), intent(out), optional | lakefrac ) |
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. |
[out] | LAKEFRAC | Lake fraction. |
Definition at line 732 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 1908 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 1708 of file read_write_data.f90.
Referenced by get_tf_clm_ta().
|
private |
Remove the checksum attribute from a netcdf record.
[in] | ncid | netcdf file id |
[in] | id_var | netcdf variable id. |
Definition at line 692 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 123 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().