global_cycle
1.6.0
|
This module contains routines that read and write data. More...
Data Types | |
type | nsst_data |
Public Member Functions | |
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 (TSFFCS, SMCFCS, SNOFCS, STCFCS, TG3FCS, ZORFCS, CVFCS, CVBFCS, CVTFCS, ALBFCS, SLIFCS, VEGFCS, CNPFCS, F10M, VETFCS, SOTFCS, ALFFCS, USTAR, FMM, FHH, SIHFCS, SICFCS, SITFCS, TPRCP, SRFLAG, SWDFCS, VMNFCS, VMXFCS, SLCFCS, SLPFCS, ABSFCS, T2M, Q2M, SLMASK, ZSOIL, LSOIL, LENSFC, DO_NSST, 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) |
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, public | write_data (slifcs, tsffcs, snofcs, tg3fcs, zorfcs, albfcs, alffcs, vegfcs, cnpfcs, f10m, t2m, q2m, vetfcs, sotfcs, ustar, fmm, fhh, sicfcs, sihfcs, sitfcs, tprcp, srflag, swdfcs, vmnfcs, vmxfcs, slpfcs, absfcs, slcfcs, smcfcs, stcfcs, idim, jdim, lensfc, lsoil, do_nsst, nsst) |
Write out all surface records - and nsst records if selected - on a single cubed-sphere tile to a model restart file (in netcdf). More... | |
Data Fields | |
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... | |
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.
Definition at line 8 of file read_write_data.f90.
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 1959 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 1824 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 1996 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 1054 of file read_write_data.f90.
subroutine, public read_write_data::read_data | ( | real, dimension(lensfc), intent(out) | TSFFCS, |
real, dimension(lensfc,lsoil), intent(out) | SMCFCS, | ||
real, dimension(lensfc), intent(out) | SNOFCS, | ||
real, dimension(lensfc,lsoil), intent(out) | STCFCS, | ||
real, dimension(lensfc), intent(out) | TG3FCS, | ||
real, dimension(lensfc), intent(out) | ZORFCS, | ||
real, dimension(lensfc), intent(out) | CVFCS, | ||
real, dimension(lensfc), intent(out) | CVBFCS, | ||
real, dimension(lensfc), intent(out) | CVTFCS, | ||
real, dimension(lensfc,4), intent(out) | ALBFCS, | ||
real, dimension(lensfc), intent(out) | SLIFCS, | ||
real, dimension(lensfc), intent(out) | VEGFCS, | ||
real, dimension(lensfc), intent(out) | CNPFCS, | ||
real, dimension(lensfc), intent(out) | F10M, | ||
real, dimension(lensfc), intent(out) | VETFCS, | ||
real, dimension(lensfc), intent(out) | SOTFCS, | ||
real, dimension(lensfc,2), intent(out) | ALFFCS, | ||
real, dimension(lensfc), intent(out) | USTAR, | ||
real, dimension(lensfc), intent(out) | FMM, | ||
real, dimension(lensfc), intent(out) | FHH, | ||
real, dimension(lensfc), intent(out) | SIHFCS, | ||
real, dimension(lensfc), intent(out) | SICFCS, | ||
real, dimension(lensfc), intent(out) | SITFCS, | ||
real, dimension(lensfc), intent(out) | TPRCP, | ||
real, dimension(lensfc), intent(out) | SRFLAG, | ||
real, dimension(lensfc), intent(out) | SWDFCS, | ||
real, dimension(lensfc), intent(out) | VMNFCS, | ||
real, dimension(lensfc), intent(out) | VMXFCS, | ||
real, dimension(lensfc,lsoil), intent(out) | SLCFCS, | ||
real, dimension(lensfc), intent(out) | SLPFCS, | ||
real, dimension(lensfc), intent(out) | ABSFCS, | ||
real, dimension(lensfc), intent(out) | T2M, | ||
real, dimension(lensfc), intent(out) | Q2M, | ||
real, dimension(lensfc), intent(out) | SLMASK, | ||
real(kind=4), dimension(lsoil), intent(out) | ZSOIL, | ||
integer, intent(in) | LSOIL, | ||
integer, intent(in) | LENSFC, | ||
logical, intent(in) | DO_NSST, | ||
type(nsst_data) | 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] | TSFFCS | Skin Temperature. |
[out] | SMCFCS | Total volumetric soil moisture. |
[out] | SNOFCS | Liquid-equivalent snow depth. |
[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] | SWDFCS | Physical 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. |
Definition at line 1242 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 1087 of file read_write_data.f90.
References netcdf_err().
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 | ||
) |
Read latitude and longitude for the cubed-sphere tile from the 'grid' file.
Read the filtered and unfiltered orography 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 |
Definition at line 920 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 1883 of file read_write_data.f90.
References count(), and 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 1682 of file read_write_data.f90.
Referenced by get_tf_clm_ta().
subroutine, public read_write_data::write_data | ( | real, dimension(lensfc), intent(in) | slifcs, |
real, dimension(lensfc), intent(in) | tsffcs, | ||
real, dimension(lensfc), intent(in) | snofcs, | ||
real, dimension(lensfc), intent(in) | tg3fcs, | ||
real, dimension(lensfc), intent(in) | zorfcs, | ||
real, dimension(lensfc,4), intent(in) | albfcs, | ||
real, dimension(lensfc,2), intent(in) | alffcs, | ||
real, dimension(lensfc), intent(in) | vegfcs, | ||
real, dimension(lensfc), intent(in) | cnpfcs, | ||
real, dimension(lensfc), intent(in) | f10m, | ||
real, dimension(lensfc), intent(in) | t2m, | ||
real, dimension(lensfc), intent(in) | q2m, | ||
real, dimension(lensfc), intent(in) | vetfcs, | ||
real, dimension(lensfc), intent(in) | sotfcs, | ||
real, dimension(lensfc), intent(in) | ustar, | ||
real, dimension(lensfc), intent(in) | fmm, | ||
real, dimension(lensfc), intent(in) | fhh, | ||
real, dimension(lensfc), intent(in) | sicfcs, | ||
real, dimension(lensfc), intent(in) | sihfcs, | ||
real, dimension(lensfc), intent(in) | sitfcs, | ||
real, dimension(lensfc), intent(in) | tprcp, | ||
real, dimension(lensfc), intent(in) | srflag, | ||
real, dimension(lensfc), intent(in) | swdfcs, | ||
real, dimension(lensfc), intent(in) | vmnfcs, | ||
real, dimension(lensfc), intent(in) | vmxfcs, | ||
real, dimension(lensfc), intent(in) | slpfcs, | ||
real, dimension(lensfc), intent(in) | absfcs, | ||
real, dimension(lensfc,lsoil), intent(in) | slcfcs, | ||
real, dimension(lensfc,lsoil), intent(in) | smcfcs, | ||
real, dimension(lensfc,lsoil), intent(in) | stcfcs, | ||
integer, intent(in) | idim, | ||
integer, intent(in) | jdim, | ||
integer, intent(in) | lensfc, | ||
integer, intent(in) | lsoil, | ||
logical, intent(in) | do_nsst, | ||
type(nsst_data) | nsst | ||
) |
Write out all surface records - and nsst records if selected - on a single cubed-sphere tile to a model restart file (in netcdf).
[in] | slifcs | Land-sea mask. |
[in] | tsffcs | Skin temperature. |
[in] | snofcs | Liquid-equivalent snow depth. |
[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] | vegfcs | Vegetation greenness. |
[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] | 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] | nsst | Data structure containing nsst fields. |
Definition at line 117 of file read_write_data.f90.
References netcdf_err().
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.
integer, public read_write_data::idim_gaus |
'i' dimension of GSI gaussian grid.
Definition at line 38 of file read_write_data.f90.
integer, public read_write_data::jdim_gaus |
'j' dimension of GSI gaussian grid.
Definition at line 40 of file read_write_data.f90.
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.
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.
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.