chgres_cube  1.13.0
 All Data Structures Files Functions Variables
atm_input_data Module Reference

Read atmospheric data on the input grid. More...

Public Member Functions

subroutine calcalpha_rotlatlon (latgrid, longrid, cenlat, cenlon, alpha)
 Calculate rotation angle for rotated latlon grids. More...
 
subroutine, public cleanup_input_atm_data
 Free up memory associated with atm data. More...
 
subroutine, public convert_winds_to_xyz
 Convert winds from 2-d to 3-d components. More...
 
subroutine, public read_input_atm_data (localpet)
 Read input grid atmospheric data driver. More...
 
subroutine read_input_atm_gfs_gaussian_nemsio_file (localpet)
 Read input atmospheric data from spectral gfs (global gaussian in nemsio format. More...
 
subroutine read_input_atm_grib2_file (localpet)
 Read input grid atmospheric fv3gfs grib2 files. More...
 
subroutine read_input_atm_tiled_history_file (localpet)
 Read input grid fv3 atmospheric tiled history files in netcdf format. More...
 
subroutine read_winds (u, v, localpet, octet_23, rlevs, lugb, pdt_num)
 Read winds from a grib2 file. More...
 

Data Fields

type(esmf_field), public dzdt_input_grid
 vert velocity More...
 
integer, public lev_input
 number of atmospheric layers More...
 
integer, public levp1_input
 number of atmos layer interfaces More...
 
type(esmf_field), public pres_input_grid
 3-d pressure More...
 
type(esmf_field), public ps_input_grid
 surface pressure More...
 
type(esmf_field), public temp_input_grid
 temperature More...
 
type(esmf_field), public terrain_input_grid
 terrain height More...
 
type(esmf_field), dimension(:),
allocatable, public 
tracers_input_grid
 tracers More...
 
type(esmf_field), public u_input_grid
 u/v wind at grid More...
 
type(esmf_field), public v_input_grid
 box center More...
 
type(esmf_field), public xwind_input_grid
 x-component wind More...
 
type(esmf_field), public ywind_input_grid
 y-component wind More...
 
type(esmf_field), public zwind_input_grid
 z-component wind More...
 

Private Member Functions

subroutine gridrot (lov, latin1, latin2, lon, rot)
 Compute grid rotation angle for non-latlon grids. More...
 
subroutine init_atm_esmf_fields
 Create atmospheric esmf fields. More...
 
subroutine read_input_atm_gaussian_nemsio_file (localpet)
 Read input grid atmospheric fv3 gaussian nemsio files. More...
 
subroutine read_input_atm_gaussian_netcdf_file (localpet)
 Read fv3 netcdf gaussian history file. More...
 
subroutine read_input_atm_gfs_sigio_file (localpet)
 Read input atmospheric data from spectral gfs (old sigio format). More...
 
subroutine read_input_atm_restart_file (localpet)
 Read input grid fv3 atmospheric data 'warm' restart files. More...
 

Private Attributes

type(esmf_field) dpres_input_grid
 pressure thickness More...
 
character(len=50), dimension(:),
allocatable, private 
slevs
 The atmospheric levels in the GRIB2 input file. More...
 

Detailed Description

Read atmospheric data on the input grid.

Supported formats include fv3 tiled 'restart' files, fv3 tiled 'history' files, fv3 gaussian history files, spectral gfs gaussian nemsio files, and spectral gfs sigio/sfcio files.

Public variables are defined below: "input" indicates field associated with the input grid.

Author
George Gayno NCEP/EMC

Definition at line 15 of file atm_input_data.F90.

Member Function/Subroutine Documentation

subroutine atm_input_data::calcalpha_rotlatlon ( real(esmf_kind_r8), dimension(i_input,j_input), intent(in)  latgrid,
  longrid,
real(esmf_kind_r4), intent(in)  cenlat,
real(esmf_kind_r4), intent(in)  cenlon,
real(esmf_kind_r4), dimension(i_input,j_input), intent(out)  alpha 
)

Calculate rotation angle for rotated latlon grids.

Needed to convert to earth-relative winds.

Parameters
[in]latgridgrid latitudes
[in]longridgrid longitudes
[in]cenlatcenter latitude
[in]cenloncenter longitude
[out]alphagrid rotation angle
Author
Larissa Reames

Definition at line 3251 of file atm_input_data.F90.

Referenced by read_winds().

subroutine, public atm_input_data::cleanup_input_atm_data ( )

Free up memory associated with atm data.

Author
George Gayno NCEP/EMC

Definition at line 3290 of file atm_input_data.F90.

Referenced by atmosphere::atmosphere_driver().

subroutine, public atm_input_data::convert_winds_to_xyz ( )
subroutine atm_input_data::gridrot ( real(esmf_kind_r4), intent(in)  lov,
real(esmf_kind_r4), intent(in)  latin1,
real(esmf_kind_r4), intent(in)  latin2,
real(esmf_kind_r8), dimension(i_input,j_input), intent(in)  lon,
real(esmf_kind_r4), dimension(i_input,j_input), intent(inout)  rot 
)
private

Compute grid rotation angle for non-latlon grids.

Note
The original gridrot subroutine was specific to polar stereographic grids. We need to compute it for Lambert Conformal grids. So we need lat1,lat2. This follows the ncl_ncarg source code: ncl_ncarg-6.6.2/ni/src/ncl/GetGrids.c
Parameters
[in]lovorientation angle
[in]latin1first tangent latitude
[in]latin2second tangent latitude
[in]lonlongitude
[in,out]rotrotation angle
Author
Larissa Reames

Definition at line 3210 of file atm_input_data.F90.

Referenced by read_winds().

subroutine atm_input_data::init_atm_esmf_fields ( )
private
subroutine, public atm_input_data::read_input_atm_data ( integer, intent(in)  localpet)

Read input grid atmospheric data driver.

Parameters
[in]localpetESMF local persistent execution thread
Author
George Gayno NCEP/EMC

Definition at line 77 of file atm_input_data.F90.

References read_input_atm_gaussian_nemsio_file(), read_input_atm_gaussian_netcdf_file(), read_input_atm_gfs_gaussian_nemsio_file(), read_input_atm_gfs_sigio_file(), read_input_atm_grib2_file(), read_input_atm_restart_file(), and read_input_atm_tiled_history_file().

Referenced by atmosphere::atmosphere_driver().

subroutine atm_input_data::read_input_atm_gaussian_nemsio_file ( integer, intent(in)  localpet)
private

Read input grid atmospheric fv3 gaussian nemsio files.

Parameters
[in]localpetESMF local persistent execution thread
Author
George Gayno NCEP/EMC

Definition at line 753 of file atm_input_data.F90.

References convert_winds_to_xyz(), utilities::error_handler(), and init_atm_esmf_fields().

Referenced by read_input_atm_data().

subroutine atm_input_data::read_input_atm_gaussian_netcdf_file ( integer, intent(in)  localpet)
private

Read fv3 netcdf gaussian history file.

Each task reads a horizontal slice.

Parameters
[in]localpetESMF local persistent execution thread
Author
George Gayno NCEP/EMC

Definition at line 1295 of file atm_input_data.F90.

References convert_winds_to_xyz(), utilities::error_handler(), init_atm_esmf_fields(), and utilities::netcdf_err().

Referenced by read_input_atm_data().

subroutine atm_input_data::read_input_atm_gfs_gaussian_nemsio_file ( integer, intent(in)  localpet)

Read input atmospheric data from spectral gfs (global gaussian in nemsio format.

Starting July 19, 2017).

Parameters
[in]localpetESMF local persistent execution thread
Author
George Gayno NCEP/EMC

Definition at line 500 of file atm_input_data.F90.

References convert_winds_to_xyz(), utilities::error_handler(), and init_atm_esmf_fields().

Referenced by read_input_atm_data().

subroutine atm_input_data::read_input_atm_gfs_sigio_file ( integer, intent(in)  localpet)
private

Read input atmospheric data from spectral gfs (old sigio format).

Note
Format used prior to July 19, 2017.
Parameters
[in]localpetESMF local persistent execution thread
Author
George Gayno NCEP/EMC

Definition at line 261 of file atm_input_data.F90.

References convert_winds_to_xyz(), utilities::error_handler(), and init_atm_esmf_fields().

Referenced by read_input_atm_data().

subroutine atm_input_data::read_input_atm_grib2_file ( integer, intent(in)  localpet)

Read input grid atmospheric fv3gfs grib2 files.

Parameters
[in]localpetESMF local persistent execution thread
Author
George Gayno NCEP/EMC

Definition at line 1970 of file atm_input_data.F90.

References grib2_util::convert_omega(), convert_winds_to_xyz(), utilities::dint2p(), utilities::error_handler(), program_setup::get_var_cond(), utilities::handle_grib_error(), init_atm_esmf_fields(), utilities::quicksort(), read_winds(), grib2_util::rh2spfh(), and grib2_util::rh2spfh_gfs().

Referenced by read_input_atm_data().

subroutine atm_input_data::read_input_atm_restart_file ( integer, intent(in)  localpet)
private

Read input grid fv3 atmospheric data 'warm' restart files.

Note
Routine reads tiled files in parallel. Tile 1 is read by localpet 0; tile 2 by localpet 1, etc. The number of pets must be equal to or greater than the number of tiled files. Logic only tested with global input data of six tiles.
Parameters
[in]localpetESMF local persistent execution thread
Author
George Gayno NCEP/EMC

Definition at line 1036 of file atm_input_data.F90.

References convert_winds_to_xyz(), utilities::error_handler(), init_atm_esmf_fields(), and utilities::netcdf_err().

Referenced by read_input_atm_data().

subroutine atm_input_data::read_input_atm_tiled_history_file ( integer, intent(in)  localpet)

Read input grid fv3 atmospheric tiled history files in netcdf format.

Note
Routine reads tiled files in parallel. Tile 1 is read by localpet 0; tile 2 by localpet 1, etc. The number of pets must be equal to or greater than the number of tiled files.
Parameters
[in]localpetESMF local persistent execution thread
Author
George Gayno NCEP/EMC

Definition at line 1679 of file atm_input_data.F90.

References convert_winds_to_xyz(), utilities::error_handler(), init_atm_esmf_fields(), and utilities::netcdf_err().

Referenced by read_input_atm_data().

subroutine atm_input_data::read_winds ( real(esmf_kind_r8), dimension(:,:,:), intent(inout), allocatable  u,
real(esmf_kind_r8), dimension(:,:,:), intent(inout), allocatable  v,
integer, intent(in)  localpet,
integer, intent(in)  octet_23,
real(esmf_kind_r8), dimension(lev_input), intent(in)  rlevs,
integer, intent(in)  lugb,
integer, intent(in)  pdt_num 
)

Read winds from a grib2 file.

Rotate winds to be earth relative if necessary.

Parameters
[in,out]uu-component wind
[in,out]vv-component wind
[in]localpetESMF local persistent execution thread
[in]octet_23Section 4/Octet 23 - Type of first fixed surface.
[in]rlevsArray of atmospheric level values
[in]lugbLogical unit number of GRIB2 file.
[in]pdt_numProduct definition template number.
Author
Larissa Reames

Definition at line 2937 of file atm_input_data.F90.

References calcalpha_rotlatlon(), utilities::error_handler(), program_setup::get_var_cond(), gridrot(), and utilities::handle_grib_error().

Referenced by read_input_atm_grib2_file().

Field Documentation

type(esmf_field) atm_input_data::dpres_input_grid
private

pressure thickness

Definition at line 49 of file atm_input_data.F90.

type(esmf_field), public atm_input_data::dzdt_input_grid

vert velocity

Definition at line 48 of file atm_input_data.F90.

integer, public atm_input_data::lev_input

number of atmospheric layers

Definition at line 62 of file atm_input_data.F90.

integer, public atm_input_data::levp1_input

number of atmos layer interfaces

Definition at line 63 of file atm_input_data.F90.

type(esmf_field), public atm_input_data::pres_input_grid

3-d pressure

Definition at line 50 of file atm_input_data.F90.

type(esmf_field), public atm_input_data::ps_input_grid

surface pressure

Definition at line 51 of file atm_input_data.F90.

character(len=50), dimension(:), allocatable, private atm_input_data::slevs
private

The atmospheric levels in the GRIB2 input file.

Definition at line 65 of file atm_input_data.F90.

type(esmf_field), public atm_input_data::temp_input_grid

temperature

Definition at line 53 of file atm_input_data.F90.

type(esmf_field), public atm_input_data::terrain_input_grid

terrain height

Definition at line 52 of file atm_input_data.F90.

type(esmf_field), dimension(:), allocatable, public atm_input_data::tracers_input_grid

tracers

Definition at line 60 of file atm_input_data.F90.

type(esmf_field), public atm_input_data::u_input_grid

u/v wind at grid

Definition at line 55 of file atm_input_data.F90.

type(esmf_field), public atm_input_data::v_input_grid

box center

Definition at line 56 of file atm_input_data.F90.

type(esmf_field), public atm_input_data::xwind_input_grid

x-component wind

Definition at line 57 of file atm_input_data.F90.

type(esmf_field), public atm_input_data::ywind_input_grid

y-component wind

Definition at line 58 of file atm_input_data.F90.

type(esmf_field), public atm_input_data::zwind_input_grid

z-component wind

Definition at line 59 of file atm_input_data.F90.


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