emcsfc_snow2mdl  1.9.0
snow2mdl Module Reference

Interpolate snow data to model grid and grib the result. More...

Functions/Subroutines

subroutine, public interp
 Interpolate snow data to model grid. More...
 
subroutine intlon (iord, imon, imsk, m1, m2, k1, f1, f2)
 Convert data from the thinned (or reduced) to the full grid along a single row. More...
 
subroutine uninterpred (iord, kmsk, fi, f, lonl, latd, len, lonsperlat)
 Fills out full grid using thinned grid data. More...
 
subroutine write_grib1
 Write grib1 snow cover and depth on the model grid. More...
 
subroutine write_grib2
 Write grib2 snow cover and depth on the model grid. More...
 

Variables

real, dimension(:,:), allocatable snow_cvr_mdl
 snow cover on model grid in percent More...
 
real, dimension(:,:), allocatable snow_dep_mdl
 snow depth on model grid in meters More...
 

Detailed Description

Interpolate snow data to model grid and grib the result.

program history log:

  • 2005-Dec-16 gayno - initial version
  • 2007-Sep-20 gayno - Tested for b-grids. Added improved thinning for gfs grid.
  • 2008-Feb-04 gayno - Added autosnow data.
  • 2014-Sep-26 gayno - Added option to output analysed snow in grib2.

variable definitions:

  • snow_cvr_mdl -
  • snow_dep_mdl -
Author
George Gayno org: w/np2
Date
2005-Dec-16

Function/Subroutine Documentation

◆ interp()

subroutine, public snow2mdl::interp ( )

Interpolate snow data to model grid.

program history log: 2005-dec-16 gayno - initial version 2007-sep-20 gayno - tested for b-grids. added improved thinning for gfs grid. 2008-feb-04 gayno - add use of autosnow data 2014-sep-29 gayno - add option to output model snow data in grib2 format.

condition codes: all fatal 54 - selected input snow data not valid for model grid 55 - error in ipolates interpolating snow data

Note
The determination of cover and depth on the model grid depends on the input snow data selected.

nam grids:

1) nesdis/ims only - An analysis of snow cover on the model grid is produced. No depth analysis is produced.

2) afwa only - An analysis of snow cover and depth on the model grid is produced. Depth is determined from the afwa data. Cover is set to 100% where afwa indicates snow and 0% otherwise.

3) nesdis/ims and afwa - An analysis of snow cover and depth on the model grid is produced. Cover is determined by the nesdis/ims data. If cover is greater than user-defined threshold (variable snow_cvr_threshold) the depth is set to the afwa value or a nominal value, whichever is greater. The nominal value is user-defined (varaible min_snow_depth). If cover is less than user- defined threshold, the depth is set to 0, regardless of the afwa depth value.

gfs grid:

1) nesdis/ims and autosnow only - An analysis of snow cover and depth on the model grid is produced. Cover is determined from the ims and autosnow data. If cover is greater than the user-defined threshold (variable snow_cvr_threshold), the the depth is set to the user-defined default depth (variable min_snow_depth).

2) afwa only - An analysis of snow cover and depth on the model grid is produced. Depth is determined from the afwa data. Cover is set to 100% where afwa indicates snow and 0% otherwise.

3) nesdis/ims, autosnow and afwa - An analysis of snow cover and depth on the model grid is produced. Cover is determined by the ims and autosnow data. If cover is greater than user-defined threshold (variable snow_cvr_threshold) the depth is set to the afwa value or a nominal value, whichever is greater. The nominal value is user-defined (varaible min_snow_depth). If cover is less than user- defined threshold, the depth is set to 0, regardless of the afwa depth value.

Author
George Gayno org: w/np2
Date
2005-Dec-16

Definition at line 158 of file snow2mdl.F90.

References snowdat::afwa_res, snowdat::autosnow_res, snowdat::bitmap_afwa_global, snowdat::bitmap_afwa_nh, snowdat::bitmap_afwa_sh, snowdat::bitmap_autosnow, snowdat::bitmap_nesdis, snowdat::iafwa, snowdat::iautosnow, model_grid::ijmdl, model_grid::imdl, snowdat::inesdis, model_grid::ipts_mdl, snowdat::jafwa, snowdat::jautosnow, model_grid::jmdl, snowdat::jnesdis, model_grid::jpts_mdl, snowdat::kgds_afwa_global, snowdat::kgds_afwa_nh, snowdat::kgds_afwa_sh, snowdat::kgds_autosnow, model_grid::kgds_mdl, snowdat::kgds_nesdis, program_setup::lat_threshold, model_grid::lats_mdl, model_grid::lons_mdl, model_grid::lonsperlat_mdl, model_grid::lsmask_mdl, model_grid::lsmask_mdl_sav, program_setup::min_snow_depth, snowdat::nesdis_res, program_setup::output_grib2, model_grid::resol_mdl, snowdat::sea_ice_nesdis, snowdat::snow_cvr_autosnow, snow_cvr_mdl, snowdat::snow_cvr_nesdis, program_setup::snow_cvr_threshold, snowdat::snow_dep_afwa_global, snowdat::snow_dep_afwa_nh, snowdat::snow_dep_afwa_sh, snow_dep_mdl, model_grid::thinned, uninterpred(), snowdat::use_autosnow, snowdat::use_global_afwa, snowdat::use_nesdis, snowdat::use_nh_afwa, snowdat::use_sh_afwa, write_grib1(), and write_grib2().

Referenced by driver().

◆ intlon()

subroutine snow2mdl::intlon ( integer, intent(in)  iord,
integer, intent(in)  imon,
integer, intent(in)  imsk,
integer, intent(in)  m1,
integer, intent(in)  m2,
integer, dimension(m1), intent(in)  k1,
real, dimension(m1), intent(in)  f1,
real, dimension(m2), intent(out)  f2 
)
private

Convert data from the thinned (or reduced) to the full grid along a single row.

Parameters
[in]iordInterpolation method. '1' neighbor; '2' bilinear.
[in]imonNot used.
[in]imskFlag to account for mask during conversion. '0' - use mask.
[in]m1Number of points along a row of the thinned grid.
[in]m2Number of points along a row on the full grid.
[in]k1Mask of input data.
[in]f1Data on the thinned (or reduced) grid.
[out]f2Data on the full grid.
Author
George Gayno org: w/np2
Date
2005-Dec-16

Definition at line 1152 of file snow2mdl.F90.

Referenced by uninterpred().

◆ uninterpred()

subroutine snow2mdl::uninterpred ( integer, intent(in)  iord,
integer, dimension(lonl*latd), intent(in)  kmsk,
real, dimension(len), intent(in)  fi,
real, dimension(lonl,latd), intent(out)  f,
integer, intent(in)  lonl,
integer, intent(in)  latd,
integer, intent(in)  len,
integer, dimension(latd/2), intent(in)  lonsperlat 
)
private

Fills out full grid using thinned grid data.

Use an iord of "1" to use a nearest neighbor approach.

Parameters
[in]iordInterpolation method. '1' neighbor; '2' bilinear.
[in]kmskMask of the input data. For masked fields, set to '1' for defined points, '0' for undefined points. Not used for unmasked fields - set to '0'.
[in]fi1-d array to be processed.
[out]f2-d array on the full grid.
[in]lonl'i' dimension of 2-d data.
[in]latd'j' dimension of 2-d data.
[in]lenNumber of elements of 1-d data.
[in]lonsperlatDefinition of thinned (or reduced) grid. Number of "i" points for each 'j' row.
Author
George Gayno org: w/np2
Date
2005-Dec-16

Definition at line 1101 of file snow2mdl.F90.

References intlon().

Referenced by interp().

◆ write_grib1()

subroutine snow2mdl::write_grib1 ( )

Write grib1 snow cover and depth on the model grid.

program history log: 2005-dec-16 gayno - Initial version 2014-sep-26 gayno - Rename as write_grib1 (was gribit).

output file:

  • snow on model grid, grib 1, unit=lugb

condition codes:

  • 57 - error writing model snow depth record
  • 58 - error writing model snow cover record
  • 59 - error opening model snow file
Author
George Gayno org: w/np2
Date
2005-Dec-16

Definition at line 989 of file snow2mdl.F90.

References program_setup::grib_century, program_setup::grib_day, program_setup::grib_hour, program_setup::grib_month, program_setup::grib_year, model_grid::grid_id_mdl, model_grid::kgds_mdl, model_grid::lsmask_mdl, program_setup::model_snow_file, snow_cvr_mdl, snow_dep_mdl, snowdat::use_global_afwa, snowdat::use_nh_afwa, and snowdat::use_sh_afwa.

Referenced by interp().

◆ write_grib2()

subroutine snow2mdl::write_grib2 ( )

Write grib2 snow cover and depth on the model grid.

program history log: 2014-sep-26 gayno - initial version

output file:

  • snow on the model grid, grib 2, unit=lugb

condition codes: all fatal

  • 48 error writing model snow flie
  • 49 error opening model snow flie
Author
George Gayno org: w/np2
Date
2014-Sep-26

Definition at line 809 of file snow2mdl.F90.

References grib2_check(), program_setup::grib_century, program_setup::grib_day, program_setup::grib_hour, program_setup::grib_month, program_setup::grib_year, model_grid::imdl, init_grib2(), model_grid::jmdl, model_grid::kgds_mdl, model_grid::lat11, model_grid::latlast, model_grid::lon11, model_grid::lonlast, model_grid::lsmask_mdl, program_setup::model_snow_file, snow_cvr_mdl, snow_dep_mdl, snowdat::use_global_afwa, snowdat::use_nh_afwa, and snowdat::use_sh_afwa.

Referenced by interp().

Variable Documentation

◆ snow_cvr_mdl

real, dimension(:,:), allocatable snow2mdl::snow_cvr_mdl
private

snow cover on model grid in percent

Definition at line 85 of file snow2mdl.F90.

Referenced by interp(), write_grib1(), and write_grib2().

◆ snow_dep_mdl

real, dimension(:,:), allocatable snow2mdl::snow_dep_mdl
private

snow depth on model grid in meters

Definition at line 86 of file snow2mdl.F90.

Referenced by interp(), write_grib1(), and write_grib2().