global_cycle  1.4.0
 All Data Structures Files Functions Variables
read_write_data Module Reference

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)
 Read file from the GSI containing the foundation temperature increments and mask. 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...
 

Detailed Description

This module contains routines that read and write data.

Author
Xu Li, Hang Lei, George Gayno NOAA/EMC

Definition at line 8 of file read_write_data.f90.


Data Type Documentation

type read_write_data::nsst_data

Definition at line 16 of file read_write_data.f90.

Data Fields
real, dimension(:), allocatable c_0
real, dimension(:), allocatable c_d
real, dimension(:), allocatable d_conv
real, dimension(:), allocatable dt_cool
real, dimension(:), allocatable ifd
real, dimension(:), allocatable qrain
real, dimension(:), allocatable tfinc
real, dimension(:), allocatable tref
real, dimension(:), allocatable w_0
real, dimension(:), allocatable w_d
real, dimension(:), allocatable xs
real, dimension(:), allocatable xt
real, dimension(:), allocatable xtts
real, dimension(:), allocatable xu
real, dimension(:), allocatable xv
real, dimension(:), allocatable xz
real, dimension(:), allocatable xzts
real, dimension(:), allocatable z_c
real, dimension(:), allocatable zm

Member Function/Subroutine Documentation

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.

Parameters
[in]filenameName 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.
Author
Xu Li NOAA/EMC

Definition at line 1897 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.

Parameters
[in]file_sstFile name of the sst file.
[in]mlat_sstThe 'j' dimension of the data.
[in]mlon_sstThe 'i' dimension of the data.
Author
Xu Li NOAA/EMC
Date
2019-03-13

Definition at line 1762 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.

Parameters
[in]statusNetCDF status code.
Author
Xu Li NOAA/EMC

Definition at line 1934 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.

Parameters
[in]ERRNetCDF error code.
[in]STRINGUser-defined error message.
Author
George Gayno NOAA/EMC

Definition at line 1045 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.

Parameters
[in]LSOILNumber of soil layers.
[in]LENSFCTotal number of points on a tile.
[in]DO_NSSTWhen true, nsst fields are read.
[out]TSFFCSSkin Temperature.
[out]SMCFCSTotal volumetric soil moisture.
[out]SNOFCSLiquid-equivalent snow depth.
[out]STCFCSSoil temperature.
[out]TG3FCSSoil substrate temperature.
[out]ZORFCSRoughness length.
[out]CVFCSCloud cover.
[out]CVBFCSCloud base.
[out]CVTFCSCloud top.
[out]ALBFCSSnow-free albedo.
[out]SLIFCSLand-sea mask including ice flag.
[out]VEGFCSVegetation greenness.
[out]CNPFCSPlant canopy moisture content.
[out]F10Mlog((z0+10)/z0). See model routine sfc_diff.f for details.
[out]VETFCSVegetation type.
[out]SOTFCSSoil type.
[out]ALFFCSFractional coverage for strong/weak zenith angle dependent albedo.
[out]USTARFriction velocity.
[out]FMMlog((z0+z1)/z0). See model routine sfc_diff.f for details.
[out]FHHlog((ztmax+z1)/ztmax). See model routine sfc_diff.f for details.
[out]SIHFCSSea ice depth.
[out]SICFCSSea ice concentration.
[out]SITFCSSea ice temperature.
[out]TPRCPPrecipitation.
[out]SRFLAGSnow/rain flag.
[out]SWDFCSPhysical snow depth.
[out]VMNFCSMinimum vegetation greenness.
[out]VMXFCSMaximum vegetation greenness.
[out]SLCFCSLiquid portion of volumetric soil moisture.
[out]SLPFCSSlope type.
[out]ABSFCSMaximum snow albedo.
[out]T2MTwo-meter air temperature.
[out]Q2MTwo-meter specific humidity.
[out]SLMASKLand-sea mask without ice flag.
[out]ZSOILSoil layer thickness.
[out]NSSTData structure containing nsst fields.
Author
George Gayno NOAA/EMC

Definition at line 1180 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)

Read file from the GSI containing the foundation temperature increments and mask.

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.

Parameters
[in]GSI_FILEPath/name of the GSI file to be read.
Author
George Gayno NOAA/EMC

Definition at line 1075 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.

Parameters
[in]IDIM'i' dimension of cubed-sphere tile.
[in]JDIM'j' dimension of cubed-sphere tile.
[in]IJDIMTotal number of points on the cubed-sphere tile.
[out]RLALatitude on the cubed-sphere tile.
[out]RLOLongitude on the cubed-sphere tile.
[out]OROGFiltered orography.
[out]OROG_UFUnfiltered orography.
[out]TILE_NUMCubed-sphere tile number
Author
George Gayno NOAA/EMC

Definition at line 911 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.

Parameters
[in]filenameThe name of the climatology file.
[in]nlatThe 'j' dimension of the data in the file.
[in]nlonThe 'i' dimension of the data in the file.
[in]itimeThe monthly record to read.
[out]xlatsThe latitude of the data points.
[out]xlonsThe longitude of the data points.
[out]salThe salinity.
Author
Xu Li NOAA/EMC

Definition at line 1821 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.

Note
The data is stored from north to south, but this routine flips the poles.
Parameters
[in]file_sstFile name of the sst file.
[in]mlat_sst'j' dimension of the sst data.
[in]mlon_sst'i' dimension of the sst data.
[in]monThe month of the year.
[out]sstThe sst analysis data.
[out]rlats_sstThe latitudes of the sst data points.
[out]rlons_sstThe longitudes of the sst data points.
Author
Xu Li NOAA/EMC
Date
2019-03-13

Definition at line 1620 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).

Note
The model restart files contain an additional snow field - snow cover (snocvr). That field is required for bit identical reproducability. If that record does not exist, the model will compute it as an initialization step. Because this program does not contain the snow cover algorithm, it will let the model compute it.
Parameters
[in]slifcsLand-sea mask.
[in]tsffcsSkin temperature.
[in]snofcsLiquid-equivalent snow depth.
[in]tg3fcsSoil substrate temperature.
[in]zorfcsRoughness length.
[in]albfcsSnow-free albedo.
[in]alffcsFractional coverage for strong/weak zenith angle dependent albedo.
[in]vegfcsVegetation greenness.
[in]cnpfcsPlant canopy moisture content.
[in]f10mlog((z0+10)/z0). See model routine sfc_diff.f for details.
[in]t2mTwo-meter air temperature.
[in]q2mTwo-meter specific humidity.
[in]vetfcsVegetation type.
[in]sotfcsSoil type.
[in]ustarFriction velocity.
[in]fmmlog((z0+z1)/z0). See model routine sfc_diff.f for details.
[in]fhhlog(ztmax+z1)/ztmax). See model routine sfc_diff.f for details.
[in]sicfcsSea ice concentraton.
[in]sihfcsSea ice depth.
[in]sitfcsSea ice temperature.
[in]tprcpPrecipitation.
[in]srflagSnow/rain flag.
[in]swdfcsPhysical snow depth.
[in]vmnfcsMinimum vegetation greenness.
[in]vmxfcsMaximum vegetation greenness.
[in]slpfcsSlope type.
[in]absfcsMaximum snow albedo.
[in]slcfcsLiquid portion of volumetric soil moisture.
[in]smcfcsTotal volumetric soil moisture.
[in]stcfcsSoil temperature.
[in]idim'i' dimension of a tile.
[in]jdim'j' dimension of a tile.
[in]lensfcTotal number of points on a tile.
[in]lsoilNumber of soil layers.
[in]do_nsstWhen true, nsst fields were processed.
[in]nsstData structure containing nsst fields.
Author
George Gayno NOAA/EMC

Definition at line 108 of file read_write_data.f90.

References netcdf_err().

Referenced by sfcdrv().

Field Documentation

real, dimension(:,:), allocatable, public read_write_data::dtref_gaus

GSI foundation temperature increment on the gaussian grid.

Definition at line 45 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.


The documentation for this module was generated from the following file: