chgres_cube  1.13.0
All Data Structures Namespaces Files Functions Variables Pages
atm_input_data Module Reference

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

Functions/Subroutines

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 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, public read_input_atm_data (localpet)
 Read input grid atmospheric data driver. More...
 
subroutine read_input_atm_gaussian_netcdf_file (localpet)
 Read fv3 netcdf gaussian history file. More...
 
subroutine read_input_atm_grib2_file (localpet)
 Read input grid atmospheric fv3gfs grib2 files. More...
 
subroutine read_input_atm_restart_file (localpet)
 Read input grid fv3 atmospheric data 'warm' restart 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...
 

Variables

type(esmf_field) dpres_input_grid
 pressure thickness More...
 
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...
 
character(len=50), dimension(:), allocatable, private slevs
 The atmospheric levels in the GRIB2 input file. 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...
 

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

Function/Subroutine Documentation

◆ calcalpha_rotlatlon()

subroutine atm_input_data::calcalpha_rotlatlon ( real(esmf_kind_r8), dimension(i_input,j_input), intent(in)  latgrid,
real(esmf_kind_r8), dimension(i_input,j_input), intent(in)  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 3334 of file atm_input_data.F90.

References model_grid::i_input, and model_grid::j_input.

Referenced by read_winds().

◆ cleanup_input_atm_data()

subroutine, public atm_input_data::cleanup_input_atm_data ( )

◆ convert_winds_to_xyz()

subroutine, public atm_input_data::convert_winds_to_xyz ( )

◆ gridrot()

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 3293 of file atm_input_data.F90.

References model_grid::i_input, and model_grid::j_input.

Referenced by read_winds().

◆ init_atm_esmf_fields()

◆ read_input_atm_data()

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 80 of file atm_input_data.F90.

References program_setup::input_type, read_input_atm_gaussian_netcdf_file(), read_input_atm_grib2_file(), read_input_atm_restart_file(), and read_input_atm_tiled_history_file().

Referenced by atmosphere::atmosphere_driver().

◆ read_input_atm_gaussian_netcdf_file()

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

◆ read_input_atm_grib2_file()

◆ read_input_atm_restart_file()

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 1049 of file atm_input_data.F90.

References program_setup::atm_core_files_input_grid, program_setup::atm_tracer_files_input_grid, convert_winds_to_xyz(), program_setup::data_dir_input_grid, dpres_input_grid, dzdt_input_grid, model_grid::i_input, init_atm_esmf_fields(), model_grid::input_grid, model_grid::j_input, lev_input, levp1_input, model_grid::num_tiles_input_grid, program_setup::num_tracers_input, pres_input_grid, ps_input_grid, temp_input_grid, terrain_input_grid, program_setup::tracers_input, tracers_input_grid, u_input_grid, and v_input_grid.

Referenced by read_input_atm_data().

◆ read_input_atm_tiled_history_file()

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 1692 of file atm_input_data.F90.

References program_setup::atm_files_input_grid, convert_winds_to_xyz(), program_setup::data_dir_input_grid, dpres_input_grid, dzdt_input_grid, model_grid::i_input, init_atm_esmf_fields(), model_grid::input_grid, model_grid::j_input, lev_input, levp1_input, model_grid::num_tiles_input_grid, program_setup::num_tracers_input, pres_input_grid, ps_input_grid, temp_input_grid, terrain_input_grid, program_setup::tracers_input, tracers_input_grid, u_input_grid, and v_input_grid.

Referenced by read_input_atm_data().

◆ read_winds()

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 3020 of file atm_input_data.F90.

References calcalpha_rotlatlon(), program_setup::get_var_cond(), gridrot(), model_grid::i_input, model_grid::j_input, model_grid::jp1_input, model_grid::latitude_input_grid, lev_input, model_grid::longitude_input_grid, and slevs.

Referenced by read_input_atm_grib2_file().

Variable Documentation

◆ dpres_input_grid

type(esmf_field) atm_input_data::dpres_input_grid
private

◆ dzdt_input_grid

◆ lev_input

◆ levp1_input

integer, public atm_input_data::levp1_input

◆ pres_input_grid

◆ ps_input_grid

◆ slevs

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

The atmospheric levels in the GRIB2 input file.

Definition at line 67 of file atm_input_data.F90.

Referenced by read_input_atm_grib2_file(), and read_winds().

◆ temp_input_grid

◆ terrain_input_grid

◆ tracers_input_grid

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

◆ u_input_grid

type(esmf_field), public atm_input_data::u_input_grid

◆ v_input_grid

◆ xwind_input_grid

type(esmf_field), public atm_input_data::xwind_input_grid

◆ ywind_input_grid

type(esmf_field), public atm_input_data::ywind_input_grid

◆ zwind_input_grid

type(esmf_field), public atm_input_data::zwind_input_grid