emcsfc_snow2mdl  1.13.0
snowdat Module Reference

Read and qc afwa, nesdis/ims and autosnow snow data. More...

Functions/Subroutines

subroutine afwa_check (hemi)
 Check for corrupt afwa data. More...
 
subroutine nh_climo_check (kgds_data, snow_data, bitmap_data, idata, jdata, isrc, bad)
 Check for corrupt nh snow cover data. More...
 
subroutine read_afwa_binary (file_name, snow_dep_afwa)
 Read afwa binary snow depth file. More...
 
subroutine read_afwa_mask (file_name, bitmap_afwa)
 Read afwa land mask file to get a bitmap. More...
 
subroutine readafwa
 Read snow depth data and masks. More...
 
subroutine readautosnow
 Read autosnow snow cover. More...
 
subroutine readnesdis
 Read nesdis/ims snow cover/ice data. More...
 

Variables

real afwa_res
 Resolution of afwa data in km. More...
 
real autosnow_res
 Resolution of autosnow in km. More...
 
logical bad_afwa_global
 When true, the global afwa data failed its quality control check. More...
 
logical bad_afwa_nh
 When true, the northern hemisphere afwa data failed its quality control check. More...
 
logical bad_afwa_sh
 When true, the southern hemisphere afwa data failed its quality control check. More...
 
logical bad_nesdis
 When true, the nesdis data failed its quality control check. More...
 
logical *1, dimension(:,:), allocatable bitmap_afwa_global
 The global afwa data grib bitmap. More...
 
logical *1, dimension(:,:), allocatable bitmap_afwa_nh
 The northern hemisphere afwa data grib bitmap. More...
 
logical *1, dimension(:,:), allocatable bitmap_afwa_sh
 The southern hemisphere afwa data grib bitmap. More...
 
logical *1, dimension(:,:), allocatable bitmap_autosnow
 autosnow data grib bitmap (false-non land, true-land). More...
 
logical *1, dimension(:,:), allocatable bitmap_nesdis
 nesdis data grib bitmap (false-non land, true-land). More...
 
integer iafwa
 i-dimension of afwa grid More...
 
integer iautosnow
 i-dimension of autosnow grid More...
 
integer inesdis
 i-dimension of nesdis grid More...
 
integer jafwa
 j-dimension of afwa grid More...
 
integer jautosnow
 j-dimension of autosnow grid More...
 
integer jnesdis
 j-dimension of nesdis grid More...
 
integer, dimension(200) kgds_afwa_global
 grib1 grid description section for global afwa data. More...
 
integer, dimension(200) kgds_afwa_nh
 grib1 grid description section for northern hemisphere 16th mesh afwa data. More...
 
integer, dimension(200) kgds_afwa_nh_8th
 grib1 grid description section for northern hemisphere 8th mesh afwa data. More...
 
integer, dimension(200) kgds_afwa_sh
 grib1 grid description section for southern hemisphere 16th mesh afwa data. More...
 
integer, dimension(200) kgds_afwa_sh_8th
 grib1 grid description section for southern hemisphere 8th mesh afwa data. More...
 
integer, dimension(200) kgds_autosnow
 autosnow grid description section (grib section 2) More...
 
integer, dimension(200) kgds_nesdis
 nesdis/ims grid description section (grib section 2) More...
 
integer mesh_nesdis
 nesdis/ims data is 96th mesh (or bediant) More...
 
real nesdis_res
 Resolution of the nesdis data in km. More...
 
integer *1, dimension(:,:), allocatable sea_ice_nesdis
 nesdis/ims sea ice flag (0-open water, 1-ice) More...
 
real, dimension(:,:), allocatable snow_cvr_autosnow
 autosnow snow cover flag (0-no, 100-yes) More...
 
real, dimension(:,:), allocatable snow_cvr_nesdis
 nesdis/ims snow cover flag (0-no, 100-yes) More...
 
real, dimension(:,:), allocatable snow_dep_afwa_global
 The global afwa snow depth. More...
 
real, dimension(:,:), allocatable snow_dep_afwa_nh
 Northern hemisphere afwa snow depth. More...
 
real, dimension(:,:), allocatable snow_dep_afwa_sh
 Southern hemisphere afwa snow depth. More...
 
logical use_autosnow
 True if autosnow data to be used. More...
 
logical use_global_afwa
 True if global hemisphere afwa data to be used. More...
 
logical use_nesdis
 True if nesdis/ims data to be used. More...
 
logical use_nh_afwa
 True if northern hemisphere afwa data to be used. More...
 
logical use_sh_afwa
 True if southern hemisphere afwa data to be used. More...
 

Detailed Description

Read and qc afwa, nesdis/ims and autosnow snow data.

program history log:

  • 2005-dec-16 gayno - initial version
  • 2007-aug-10 gayno - Allow program to run with no nesdis/ims data. Add 16th mesh afwa grib data.
  • 2008-feb-04 gayno - Add autosnow cover data for sh.
  • 2009-jun-03 gayno - Add qc check for nesdis/ims and afwa data.
  • 2014-feb-07 gayno - Read nesdis/ims data in grib1 or grib 2 format.
  • 2014-sep-30 gayno - Convert weekly nh snow climatology - used to qc input data - to grib 2. variable definitions:
  • bad_afwa_Xh - is afwa data corrupt?
  • bitmap_afwa_Xh - bitmap of afwa grid (false-non land, true-land)
  • kgds_afwa_Xh - afwa grid description section (grib section 2)
  • nesdis_res - resolution of nesdis/ims data in km
  • snow_dep_afwa_Xh - afwa snow depth data (inches*10 on input, meters on output)
  • use_xh_afwa - true if afwa data to be used

Function/Subroutine Documentation

◆ afwa_check()

subroutine snowdat::afwa_check ( integer, intent(in)  hemi)

Check for corrupt afwa data.

Parameters
[in]hemi(1-nh, 2-sh)
Author
George Gayno org: w/np2
Date
2009-Jun-3

Definition at line 1126 of file snowdat.F90.

References bad_afwa_nh, bad_afwa_sh, kgds_afwa_nh, kgds_afwa_sh, snow_dep_afwa_nh, and snow_dep_afwa_sh.

Referenced by readafwa().

◆ nh_climo_check()

subroutine snowdat::nh_climo_check ( integer, dimension(200), intent(in)  kgds_data,
real, dimension(idata,jdata), intent(in)  snow_data,
logical*1, dimension(idata,jdata), intent(in)  bitmap_data,
integer, intent(in)  idata,
integer, intent(in)  jdata,
integer, intent(in)  isrc,
logical, intent(out)  bad 
)

Check for corrupt nh snow cover data.

Note
Check for corrupt nh data by comparing it to climatology.

program history log: 2009-jun-3 gayno - initial version 2011-apr-26 gayno - Perform gross check first, then check against climo. 2014-sep-30 gayno - Weekly climo file converted to grib 2.

Parameters
[in]kgds_dataGrib 1 grid description sect of data to be qcd.
[in]snow_dataSnow cover to be qcd.
[in]bitmap_databitmap of data to be qcd.
[in]idataI dimension of data to be qcd.
[in]jdataJ dimension of data to be qcd.
[in]isrcFlag indicating data source; 1- afwa depth, 2-ims cover.
[out]badWhen true, data failed check.

files: input:

  • NH weekly climatological snow cover file (grib 2).
Author
George Gayno org: w/np2
Date
2009-Jun-3

Definition at line 855 of file snowdat.F90.

References program_setup::climo_qc_file, grib2_free(), grib2_null(), program_setup::grib_century, program_setup::grib_day, program_setup::grib_month, and program_setup::grib_year.

Referenced by readafwa(), and readnesdis().

◆ read_afwa_binary()

subroutine snowdat::read_afwa_binary ( character*(*), intent(in)  file_name,
real, dimension(iafwa,jafwa), intent(out)  snow_dep_afwa 
)

Read afwa binary snow depth file.

Parameters
[in]file_namefile name
[out]snow_dep_afwasnow depth in meters

files: input:

  • nh/sh afwa data in simple binary format

condition codes: all fatal 60 - bad open of afwa file 61 - bad read of afwa file

Note
Read logic for binary data is taken from hua-lu's code, /nwprod/sorc/grib_snowgrib.fd.
Author
George Gayno org: w/np2
Date
2007-Nov-28

Definition at line 1234 of file snowdat.F90.

Referenced by readafwa().

◆ read_afwa_mask()

subroutine snowdat::read_afwa_mask ( character*(*), intent(in)  file_name,
logical*1, dimension(iafwa,jafwa), intent(out)  bitmap_afwa 
)

Read afwa land mask file to get a bitmap.

Parameters
[in]file_nameland mask file name
[out]bitmap_afwa.true. if land

files: input:

  • afwa landmask in simple binary format

condition codes: all fatal 62 - bad open of afwa landmask file 63 - bad read of afwa landmask file

Author
George Gayno org: w/np2
Date
2007-Nov-28

Definition at line 1317 of file snowdat.F90.

Referenced by readafwa().

◆ readafwa()

subroutine snowdat::readafwa ( )

Read snow depth data and masks.

Note
Read afwa snow depth data and land sea mask.

program history log:

2005-dec-16 gayno - initial version 2007-nov-28 gayno - read 16th mesh afwa data in grib format

files: input:

  • global afwa data in grib 2 (if selected)
  • nh afwa data in grib 1 (if selected)
  • sh afwa data in grib 1 (if selected)

condition codes: 60 - bad open afwa file 61 - bad degrib of afwa file

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

Definition at line 532 of file snowdat.F90.

References afwa_check(), program_setup::afwa_lsmask_nh_file, program_setup::afwa_lsmask_sh_file, afwa_res, program_setup::afwa_snow_global_file, program_setup::afwa_snow_nh_file, program_setup::afwa_snow_sh_file, bad_afwa_global, bad_afwa_nh, bad_afwa_sh, bitmap_afwa_global, bitmap_afwa_nh, bitmap_afwa_sh, gdt_to_gds(), grib2_null(), grib_check(), iafwa, jafwa, kgds_afwa_global, kgds_afwa_nh, kgds_afwa_nh_8th, kgds_afwa_sh, kgds_afwa_sh_8th, nh_climo_check(), read_afwa_binary(), read_afwa_mask(), snow_dep_afwa_global, snow_dep_afwa_nh, snow_dep_afwa_sh, use_global_afwa, use_nh_afwa, and use_sh_afwa.

Referenced by driver().

◆ readautosnow()

subroutine snowdat::readautosnow ( )

Read autosnow snow cover.

program history log: 2008-feb-04 gayno - initial version

files: input:

  • autosnow data, grib 2, unit=lugb

condition codes: all fatal 74 - bad open of autosnow file 75 - bad read of autosnow file

Note
Autosnow data is available only for southern hemis. Autosnow data is in grib 2.
Author
George Gayno org: w/np2
Date
2008-Feb-04

Definition at line 118 of file snowdat.F90.

References program_setup::autosnow_file, autosnow_res, bitmap_autosnow, gdt_to_gds(), grib2_free(), grib2_null(), iautosnow, jautosnow, kgds_autosnow, snow_cvr_autosnow, and use_autosnow.

Referenced by driver().

◆ readnesdis()

subroutine snowdat::readnesdis ( )

Read nesdis/ims snow cover/ice data.

program history log: 2005-dec-16 gayno - initial version 2014-feb-07 gayno - Read 4km ims data in either grib1 or grib 2 format. files: input:

  • ims snow cover and ice file, grib 1 or grib 2
  • 16th-mesh ims land mask, binary

condition codes: all fatal 41 - ims file not grib 1 or grib 2 53 - ims data failed quality check 70 - bad read of ims snow cover data 71 - bad read of ims ice data 72 - bad read of ims grib 1 header 73 - bad open of ims file 87 - bad open ims land mask file 88 - bad read ims land mask file

Note
Nesdis/ims data available only for n hemis. Ims data used to be created by nesdis, hence the references to "nesdis" in this routine. Ims data is now created by the national ice center.
Author
George Gayno org: w/np2
Date
2005-Dec-16

Definition at line 223 of file snowdat.F90.

References bad_nesdis, bitmap_nesdis, gdt_to_gds(), grib2_free(), grib2_null(), grib_check(), inesdis, jnesdis, kgds_nesdis, mesh_nesdis, program_setup::nesdis_lsmask_file, nesdis_res, program_setup::nesdis_snow_file, nh_climo_check(), sea_ice_nesdis, snow_cvr_nesdis, and use_nesdis.

Referenced by driver().

Variable Documentation

◆ afwa_res

real snowdat::afwa_res

Resolution of afwa data in km.

Definition at line 84 of file snowdat.F90.

Referenced by snow2mdl::interp(), and readafwa().

◆ autosnow_res

real snowdat::autosnow_res

Resolution of autosnow in km.

Definition at line 83 of file snowdat.F90.

Referenced by snow2mdl::interp(), and readautosnow().

◆ bad_afwa_global

logical snowdat::bad_afwa_global

When true, the global afwa data failed its quality control check.

Definition at line 66 of file snowdat.F90.

Referenced by readafwa().

◆ bad_afwa_nh

logical snowdat::bad_afwa_nh

When true, the northern hemisphere afwa data failed its quality control check.

Definition at line 60 of file snowdat.F90.

Referenced by afwa_check(), and readafwa().

◆ bad_afwa_sh

logical snowdat::bad_afwa_sh

When true, the southern hemisphere afwa data failed its quality control check.

Definition at line 62 of file snowdat.F90.

Referenced by afwa_check(), and readafwa().

◆ bad_nesdis

logical snowdat::bad_nesdis

When true, the nesdis data failed its quality control check.

Definition at line 64 of file snowdat.F90.

Referenced by readnesdis().

◆ bitmap_afwa_global

logical*1, dimension(:,:), allocatable snowdat::bitmap_afwa_global

The global afwa data grib bitmap.

(false-non land, true-land).

Definition at line 68 of file snowdat.F90.

Referenced by snow2mdl::interp(), and readafwa().

◆ bitmap_afwa_nh

logical*1, dimension(:,:), allocatable snowdat::bitmap_afwa_nh

The northern hemisphere afwa data grib bitmap.

(false-non land, true-land).

Definition at line 70 of file snowdat.F90.

Referenced by snow2mdl::interp(), and readafwa().

◆ bitmap_afwa_sh

logical*1, dimension(:,:), allocatable snowdat::bitmap_afwa_sh

The southern hemisphere afwa data grib bitmap.

(false-non land, true-land).

Definition at line 72 of file snowdat.F90.

Referenced by snow2mdl::interp(), and readafwa().

◆ bitmap_autosnow

logical*1, dimension(:,:), allocatable snowdat::bitmap_autosnow

autosnow data grib bitmap (false-non land, true-land).

Definition at line 75 of file snowdat.F90.

Referenced by snow2mdl::interp(), and readautosnow().

◆ bitmap_nesdis

logical*1, dimension(:,:), allocatable snowdat::bitmap_nesdis

nesdis data grib bitmap (false-non land, true-land).

Definition at line 74 of file snowdat.F90.

Referenced by snow2mdl::interp(), and readnesdis().

◆ iafwa

integer snowdat::iafwa

i-dimension of afwa grid

Definition at line 40 of file snowdat.F90.

Referenced by snow2mdl::interp(), and readafwa().

◆ iautosnow

integer snowdat::iautosnow

i-dimension of autosnow grid

Definition at line 41 of file snowdat.F90.

Referenced by snow2mdl::interp(), and readautosnow().

◆ inesdis

integer snowdat::inesdis

i-dimension of nesdis grid

Definition at line 42 of file snowdat.F90.

Referenced by snow2mdl::interp(), and readnesdis().

◆ jafwa

integer snowdat::jafwa

j-dimension of afwa grid

Definition at line 43 of file snowdat.F90.

Referenced by snow2mdl::interp(), and readafwa().

◆ jautosnow

integer snowdat::jautosnow

j-dimension of autosnow grid

Definition at line 44 of file snowdat.F90.

Referenced by snow2mdl::interp(), and readautosnow().

◆ jnesdis

integer snowdat::jnesdis

j-dimension of nesdis grid

Definition at line 45 of file snowdat.F90.

Referenced by snow2mdl::interp(), and readnesdis().

◆ kgds_afwa_global

integer, dimension(200) snowdat::kgds_afwa_global

grib1 grid description section for global afwa data.

Definition at line 46 of file snowdat.F90.

Referenced by snow2mdl::interp(), and readafwa().

◆ kgds_afwa_nh

integer, dimension(200) snowdat::kgds_afwa_nh

grib1 grid description section for northern hemisphere 16th mesh afwa data.

Definition at line 48 of file snowdat.F90.

Referenced by afwa_check(), snow2mdl::interp(), and readafwa().

◆ kgds_afwa_nh_8th

integer, dimension(200) snowdat::kgds_afwa_nh_8th

grib1 grid description section for northern hemisphere 8th mesh afwa data.

Definition at line 50 of file snowdat.F90.

Referenced by readafwa().

◆ kgds_afwa_sh

integer, dimension(200) snowdat::kgds_afwa_sh

grib1 grid description section for southern hemisphere 16th mesh afwa data.

Definition at line 52 of file snowdat.F90.

Referenced by afwa_check(), snow2mdl::interp(), and readafwa().

◆ kgds_afwa_sh_8th

integer, dimension(200) snowdat::kgds_afwa_sh_8th

grib1 grid description section for southern hemisphere 8th mesh afwa data.

Definition at line 54 of file snowdat.F90.

Referenced by readafwa().

◆ kgds_autosnow

integer, dimension(200) snowdat::kgds_autosnow

autosnow grid description section (grib section 2)

Definition at line 56 of file snowdat.F90.

Referenced by snow2mdl::interp(), and readautosnow().

◆ kgds_nesdis

integer, dimension(200) snowdat::kgds_nesdis

nesdis/ims grid description section (grib section 2)

Definition at line 57 of file snowdat.F90.

Referenced by snow2mdl::interp(), and readnesdis().

◆ mesh_nesdis

integer snowdat::mesh_nesdis

nesdis/ims data is 96th mesh (or bediant)

Definition at line 58 of file snowdat.F90.

Referenced by readnesdis().

◆ nesdis_res

real snowdat::nesdis_res

Resolution of the nesdis data in km.

Definition at line 85 of file snowdat.F90.

Referenced by snow2mdl::interp(), and readnesdis().

◆ sea_ice_nesdis

integer*1, dimension(:,:), allocatable snowdat::sea_ice_nesdis

nesdis/ims sea ice flag (0-open water, 1-ice)

Definition at line 59 of file snowdat.F90.

Referenced by snow2mdl::interp(), and readnesdis().

◆ snow_cvr_autosnow

real, dimension(:,:), allocatable snowdat::snow_cvr_autosnow

autosnow snow cover flag (0-no, 100-yes)

Definition at line 87 of file snowdat.F90.

Referenced by snow2mdl::interp(), and readautosnow().

◆ snow_cvr_nesdis

real, dimension(:,:), allocatable snowdat::snow_cvr_nesdis

nesdis/ims snow cover flag (0-no, 100-yes)

Definition at line 86 of file snowdat.F90.

Referenced by snow2mdl::interp(), and readnesdis().

◆ snow_dep_afwa_global

real, dimension(:,:), allocatable snowdat::snow_dep_afwa_global

The global afwa snow depth.

Definition at line 88 of file snowdat.F90.

Referenced by snow2mdl::interp(), and readafwa().

◆ snow_dep_afwa_nh

real, dimension(:,:), allocatable snowdat::snow_dep_afwa_nh

Northern hemisphere afwa snow depth.

Definition at line 89 of file snowdat.F90.

Referenced by afwa_check(), snow2mdl::interp(), and readafwa().

◆ snow_dep_afwa_sh

real, dimension(:,:), allocatable snowdat::snow_dep_afwa_sh

Southern hemisphere afwa snow depth.

Definition at line 90 of file snowdat.F90.

Referenced by afwa_check(), snow2mdl::interp(), and readafwa().

◆ use_autosnow

logical snowdat::use_autosnow

True if autosnow data to be used.

Definition at line 80 of file snowdat.F90.

Referenced by snow2mdl::interp(), and readautosnow().

◆ use_global_afwa

logical snowdat::use_global_afwa

True if global hemisphere afwa data to be used.

Definition at line 79 of file snowdat.F90.

Referenced by snow2mdl::interp(), readafwa(), snow2mdl::write_grib1(), and snow2mdl::write_grib2().

◆ use_nesdis

logical snowdat::use_nesdis

True if nesdis/ims data to be used.

Definition at line 81 of file snowdat.F90.

Referenced by snow2mdl::interp(), and readnesdis().

◆ use_nh_afwa

logical snowdat::use_nh_afwa

True if northern hemisphere afwa data to be used.

Definition at line 77 of file snowdat.F90.

Referenced by snow2mdl::interp(), readafwa(), snow2mdl::write_grib1(), and snow2mdl::write_grib2().

◆ use_sh_afwa

logical snowdat::use_sh_afwa

True if southern hemisphere afwa data to be used.

Definition at line 78 of file snowdat.F90.

Referenced by snow2mdl::interp(), readafwa(), snow2mdl::write_grib1(), and snow2mdl::write_grib2().