diff --git a/sorc/emcsfc_snow2mdl.fd/driver.f b/sorc/emcsfc_snow2mdl.fd/driver.f index b0521155b..6d212a87a 100755 --- a/sorc/emcsfc_snow2mdl.fd/driver.f +++ b/sorc/emcsfc_snow2mdl.fd/driver.f @@ -1,10 +1,11 @@ !> @file -!! -!! @brief Create a snow cover and snow depth analysis on a nam +!! @brief Create a snow cover and snow depth analysis. +!! @author gayno @date 2005-dec-16 + +!> Create a snow cover and snow depth analysis on a nam !! or global gfs gaussian grid using nesdis/ims snow cover, autosnow snow !! cover and/or afwa depth data. -!! @author gayno @date 2005-dec-16 -!! +!! !! Program History Log !! - 2005-dec-16 gayno initial version !! - 2007-nov-30 gayno added processing of nam b-grids. @@ -138,6 +139,8 @@ !! defined threshold, the depth is set to 0, !! regardless of the afwa depth value. !! +!! @return 0 for success, error code otherwise. +!! @author gayno @date 2005-dec-16 program driver use snowdat, only : readnesdis, & diff --git a/sorc/emcsfc_snow2mdl.fd/grib_utils.f b/sorc/emcsfc_snow2mdl.fd/grib_utils.f index c01d99ab0..841200e5d 100644 --- a/sorc/emcsfc_snow2mdl.fd/grib_utils.f +++ b/sorc/emcsfc_snow2mdl.fd/grib_utils.f @@ -602,10 +602,9 @@ subroutine init_grib2(century, year, month, day, hour, kgds, & end subroutine init_grib2 -!> Nullify the grib2 gribfield pointers. +!> Nullify the grib2 gribfield pointers. !! !! @param[in] gfld a gribfield data structure -!! @param[out] gfld a gribfield data structure !! !! @author George Gayno org: w/np2 @date 2014-Sep-28 subroutine grib2_null(gfld) @@ -631,7 +630,6 @@ end subroutine grib2_null !> Deallocate the grib2 gribfield pointers. !! !! @param[in] gfld a gribfield data structure -!! @param[in] gfld a gribfield data structure !! !! @author George Gayno org: w/np2 @date 2014-Sep-28 subroutine grib2_free(gfld) diff --git a/sorc/emcsfc_snow2mdl.fd/model_grid.f b/sorc/emcsfc_snow2mdl.fd/model_grid.f index 0ef5b2bb4..9cb9b5902 100755 --- a/sorc/emcsfc_snow2mdl.fd/model_grid.f +++ b/sorc/emcsfc_snow2mdl.fd/model_grid.f @@ -1,6 +1,9 @@ !> @file !! @brief Read in data defining the model grid. -!! +!! @author George Gayno org: w/np2 @date 2005-Dec-16 + +!> Read in data defining the model grid. +!! !! program history log: !! - 2005-dec-16 gayno - initial version !! - 2007-nov-30 gayno - improved method for thinning gfs grids. @@ -9,26 +12,8 @@ !! landmask data in grib2. !! !! variable definitions: -!! - grid_id_mdl - grib id of model grid, 4-gaussian, 203-egrid -!! - i/jpts_mdl - i/j index of point on full grid -!! - imdl - i-dimension of model grid -!! - jmdl - j-dimension of model grid -!! - ijmdl - total number of model land points -!! - kgds_mdl - holds grib gds info of model grid -!! - lats_mdl - latitudes of model grid points -!! - lons_mdl - longitudes of model grid points !! - lonsperlat - for global grids, the number of i points !! in each row (decrease toward pole) -!! - lsmask_mdl - land mask of model grid (0 - non land, 1-land) -!! for global grids run thinned, will contain -!! a modified version of the original mask -!! that has land at all points encompassed by a -!! thinned point -!! - lsmask_mdl_sav - saved copy of land mask of model grid (0 - non land, 1-land) -!! only used for global thinned grids. -!! - resol_mdl - approximate model resolution in km. -!! - thinned - when true, global grids will run thinned -!! (# i points decrease toward pole) !! !! @author George Gayno org: w/np2 @date 2005-Dec-16 module model_grid @@ -38,24 +23,33 @@ module model_grid model_lat_file, & gfs_lpl_file - integer :: grid_id_mdl - integer :: imdl - integer :: jmdl - integer :: ijmdl ! only land points - integer, allocatable :: ipts_mdl(:), jpts_mdl(:) - - integer :: kgds_mdl(200) - integer, allocatable :: lonsperlat_mdl (:) + integer :: grid_id_mdl !< grib id of model grid, 4-gaussian, 203-egrid + integer :: imdl !< i-dimension of model grid + integer :: jmdl !< j-dimension of model grid + integer :: ijmdl !< total number of model land points + integer, allocatable :: ipts_mdl(:) !< i index of point on full grid + integer, allocatable :: jpts_mdl(:) !< j index of point on full grid + + integer :: kgds_mdl(200) !< holds grib gds info of model grid + integer, allocatable :: lonsperlat_mdl (:) !< Number of longitudes (i-points) + !! for each latitude (row). Used + !! for global thinned (reduced) grids. - logical :: thinned - - real, allocatable :: lats_mdl (:) - real :: lat11, latlast - real :: lon11, lonlast - real, allocatable :: lons_mdl (:) - real, allocatable :: lsmask_mdl (:,:) - real, allocatable :: lsmask_mdl_sav (:,:) - real :: resol_mdl ! in km + logical :: thinned !< When true, global grids will run thinned + !! (number of i points decrease toward pole) + + real, allocatable :: lats_mdl(:) !< Latitudes of model grid points + real :: lat11 !< Corner point latitude (1,1) of model grid. + real :: latlast !< Corner point latitude (imdl,jmdl) of model grid. + real :: lon11 !< Corner point longitude (1,1) of model grid. + real :: lonlast !< Corner point longitude (imdl,jmdl) of model grid. + real, allocatable :: lons_mdl(:) !< longitudes of model grid points + real, allocatable :: lsmask_mdl(:,:) !< land mask of model grid (0 - non land, 1-land) for global + !! grids run thinned, will contain a modified version of the original + !! mask that has land at all points encompassed by a thinned point + real, allocatable :: lsmask_mdl_sav(:,:) !< saved copy of land mask of model grid (0 - non land, 1-land) + !! only used for global thinned grids. + real :: resol_mdl !< approximate model resolution in km. contains !> Read mdl grid. @@ -572,14 +566,14 @@ subroutine read_mdl_grid_info end subroutine read_mdl_grid_info -!> Clean up allocatable arrays. +!> Clean up allocatable arrays. !! !! This deallocate this module's allocatable array. !! !! program history log: !! 2005-dec-16 gayno - initial version !! -!! @author George Gayno org: w/np2 @Date 2005-Dec-16 +!! @author George Gayno org: w/np2 @date Dec 16, 2005 subroutine model_grid_cleanup implicit none diff --git a/sorc/emcsfc_snow2mdl.fd/program_setup.f b/sorc/emcsfc_snow2mdl.fd/program_setup.f index 85b5c84e4..63b6869a9 100755 --- a/sorc/emcsfc_snow2mdl.fd/program_setup.f +++ b/sorc/emcsfc_snow2mdl.fd/program_setup.f @@ -1,87 +1,67 @@ !> @file -!! @brief This module reads in data from the program's configuration +!! @brief This module reads in data from the program's configuration. +!! namelist. +!! @author George Gayno org: w/np2 @date 2005-DEC-16 + +!> This module reads in data from the program's configuration !! namelist. -!! -!! @author gayno org: w/np2 @date 2005-DEC-16 !! !! program history log: !! - 2005-DEC-16 gayno - initial version !! - 2008-Feb-01 gayno - added autosnow data !! - 2014-Sep-30 gayno - added 'output_grib2' flag !! -!! variable definitions: -!! - afwa_snow_nh_file - path/name afwa n hemis snow depth -!! - afwa_snow_sh_file - path/name afwa s hemis snow depth -!! - afwa_lsmask_nh_file - path/name afwa n hemis land/sea mask -!! - afwa_lsmask_sh_file - path/name afwa s hemis land/sea mask -!! - autosnow_file - path/name s hemis autosnow file -!! - grib_century/day/hour/month/year - -!! date of the final merged -!! snow product that will be placed -!! in grib header. -!! - model_lat_file - path/name lats on the model grid -!! - model_lon_file - path/name lons on the model grid -!! - nesdis_lsmask_file - path/name nesdis/ims land mask -!! - nesdis_snow_file - path/name nesdis/ims snow cover -!! - lat_threshold - equatorward of this latitude, model -!! points with undefined cover or depth -!! (because the interpolation routines -!! could not find valid snow data) -!! are set to a default value of zero. -!! poleward, undefined points are set -!! according to logic in module snow2mdl -!! - min_snow_depth - minimum snow depth in meters at model -!! points with coverage exceeding threshold. -!! - output_grib2 - when true, output model snow analysis -!! is grib 2. when false, grib 1. -!! - snow_cvr_threshold - if percent coverage according to nesdis/ims -!! or autosnow exceeds this value, then -!! non-zero snow depth is assigned. below -!! this threshold, depth is set to zero. -!! +!! @author George Gayno org: w/np2 @date 2005-DEC-16 module program_setup implicit none private - character*200, public :: afwa_snow_global_file - character*150, public :: afwa_snow_nh_file - character*150, public :: afwa_snow_sh_file - character*150, public :: afwa_lsmask_nh_file - character*150, public :: afwa_lsmask_sh_file - character*150, public :: autosnow_file - character*150, public :: climo_qc_file - character*150, public :: gfs_lpl_file - character*150, public :: model_lat_file - character*150, public :: model_lon_file - character*150, public :: model_lsmask_file - character*150, public :: model_snow_file - character*150, public :: nesdis_lsmask_file - character*150, public :: nesdis_snow_file - - integer, public :: grib_century - integer, public :: grib_day - integer, public :: grib_hour - integer, public :: grib_month - integer, public :: grib_year - - logical, public :: output_grib2 - - real, public :: lat_threshold - real, public :: min_snow_depth - real, public :: snow_cvr_threshold - - public :: read_config_nml + character*200, public :: afwa_snow_global_file !< global afwa snow file. + character*150, public :: afwa_snow_nh_file !< path/name afwa n hemis snow depth + character*150, public :: afwa_snow_sh_file !< path/name afwa s hemis snow depth + character*150, public :: afwa_lsmask_nh_file !< path/name afwa n hemis land/sea mask + character*150, public :: afwa_lsmask_sh_file !< path/name afwa s hemis land/sea mask + character*150, public :: autosnow_file !< path/name s hemis autosnow file + character*150, public :: climo_qc_file !< Climatological snow cover + !! file. Used to quality control snow data. + character*150, public :: gfs_lpl_file !< GFS gaussian thinned (reduced) grid + !! definition file. Contains the number of + !! longitudes (i-points) for each latitude (row). + character*150, public :: model_lat_file !< path/name lats on the model grid + character*150, public :: model_lon_file !< path/name lons on the model grid + character*150, public :: model_lsmask_file !< path/name nesdis/ims land mask + character*150, public :: model_snow_file !< path/name nesdis/ims snow cover + character*150, public :: nesdis_lsmask_file !< nesdis/ims land mask file + character*150, public :: nesdis_snow_file !< nesdis/ims snow file + + integer, public :: grib_century !< date of the final merged snow product that will be placed in grib header. + + integer, public :: grib_day !< date of the final merged snow product that will be placed in grib header. + integer, public :: grib_hour !< date of the final merged snow product that will be placed in grib header. + integer, public :: grib_month !< date of the final merged snow product that will be placed in grib header. + integer, public :: grib_year !< date of the final merged snow product that will be placed in grib header. + + logical, public :: output_grib2 !< when true, output model snow analysis is grib 2. when false, grib 1. + + real, public :: lat_threshold !< equatorward of this latitude, model points with undefined cover or depth + !! (because the interpolation routines could not find valid snow data) + !! are set to a default value of zero. poleward, undefined points are set + !! according to logic in module snow2mdl. + real, public :: min_snow_depth !< minimum snow depth in meters at model points with coverage exceeding threshold. + real, public :: snow_cvr_threshold !< if percent coverage according to nesdis/ims or autosnow exceeds this value, then + !! non-zero snow depth is assigned. below this threshold, depth is set to zero. + + public :: read_config_nml !< Read configuration namelist. contains -!> read namelist controls -!! @author George Gayno org: w/np2 @date 2005-Dec-16 +!> Read namelist control. !! -!! @note this subroutine reads the program's configuration namelist -!! that contains the the paths/filenames for input and output, and -!! other program control flags. +!! @note This subroutine reads the program's configuration namelist +!! that contains the the paths/filenames for input and output, and +!! other program control flags. !! !! program history log: !! 2005-dec-16 gayno - initial version @@ -93,9 +73,10 @@ module program_setup !! - program configuration namelist, fort.41 !! !! condition codes: all fatal -!! 77 - bad open on configuration namelist -!! 78 - bad read on configuration namelist +!! - 77 - bad open on configuration namelist +!! - 78 - bad read on configuration namelist !! +!! @author George Gayno org: w/np2 @date 2005-Dec-16 subroutine read_config_nml implicit none diff --git a/sorc/emcsfc_snow2mdl.fd/snow2mdl.f b/sorc/emcsfc_snow2mdl.fd/snow2mdl.f index 721c096e2..43e7bd000 100755 --- a/sorc/emcsfc_snow2mdl.fd/snow2mdl.f +++ b/sorc/emcsfc_snow2mdl.fd/snow2mdl.f @@ -1,5 +1,8 @@ !> @file !! @brief Interpolate snow data to model grid and grib the result. +!! @author George Gayno org: w/np2 @date 2005-Dec-16 + +!> Interpolate snow data to model grid and grib the result. !! !! program history log: !! - 2005-Dec-16 gayno - initial version @@ -10,8 +13,8 @@ !! snow in grib2. !! !! variable definitions: -!! - snow_cvr_mdl - snow cover on model grid in percent -!! - snow_dep_mdl - snow depth on model grid in meters +!! - snow_cvr_mdl - +!! - snow_dep_mdl - !! !! @author George Gayno org: w/np2 @date 2005-Dec-16 module snow2mdl @@ -79,14 +82,13 @@ module snow2mdl private - real, allocatable :: snow_cvr_mdl(:,:) ! cover in % on mdl grid - real, allocatable :: snow_dep_mdl(:,:) ! depth on model grid + real, allocatable :: snow_cvr_mdl(:,:) !< snow cover on model grid in percent + real, allocatable :: snow_dep_mdl(:,:) !< snow depth on model grid in meters - public :: interp + public :: interp !< Interpolate snow data to model grid. contains -!> Interpolate snow data to model grid. -!! +!> Interpolate snow data to model grid. !! !! program history log: !! 2005-dec-16 gayno - initial version @@ -100,8 +102,8 @@ module snow2mdl !! 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. +!! @note The determination of cover and depth on the model +!! grid depends on the input snow data selected. !! !! nam grids: !! --------- @@ -153,9 +155,6 @@ module snow2mdl !! defined threshold, the depth is set to 0, !! regardless of the afwa depth value. !! -!! language: fortran 90 -!! machine: IBM WCOSS -!! !! @author George Gayno org: w/np2 @date 2005-Dec-16 subroutine interp use gdswzd_mod @@ -795,21 +794,19 @@ subroutine interp end subroutine interp -!> Write grib2 snow cover and depth on the model grid. +!> Write grib2 snow cover and depth on the model grid. !! !! program history log: !! 2014-sep-26 gayno - initial version !! -!! files: -!! -!! output: +!! 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 +!! - 48 error writing model snow flie +!! - 49 error opening model snow flie !! -!! @author George Gayno org: w/np2 @date 2014-Sep-26 +!! @author George Gayno org: w/np2 @date 2014-Sep-26 subroutine write_grib2 use grib_mod @@ -975,22 +972,21 @@ subroutine write_grib2 end subroutine write_grib2 -!> Write grib1 snow cover and depth on the model grid. +!> 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). !! -!! files! -!! output: +!! 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 +!! - 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 +!! @author George Gayno org: w/np2 @date 2005-Dec-16 subroutine write_grib1 implicit none @@ -1087,22 +1083,22 @@ subroutine write_grib1 end subroutine write_grib1 -!----------------------------------------------------------------------- -! fills out full grid using thinned grid data. use an iord of -! "1" to use a nearest neighbor approach. -!----------------------------------------------------------------------- -!> ??? +!> Fills out full grid using thinned grid data. Use an iord of +!! "1" to use a nearest neighbor approach. !! -!! @param iord -!! @param kmsk -!! @param fi -!! @param f -!! @param lonl -!! @param latd -!! @param len -!! @param lonsperlat +!! @param[in] iord Interpolation method. '1' neighbor; '2' bilinear. +!! @param[in] kmsk Mask 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'. +!! @param[in] fi 1-d array to be processed. +!! @param[out] f 2-d array on the full grid. +!! @param[in] lonl 'i' dimension of 2-d data. +!! @param[in] latd 'j' dimension of 2-d data. +!! @param[in] len Number of elements of 1-d data. +!! @param[in] lonsperlat Definition of thinned (or reduced) grid. Number of +!! "i" points for each 'j' row. !! -!! @ author unknown +!! @author George Gayno org: w/np2 @date 2005-Dec-16 subroutine uninterpred(iord,kmsk,fi,f,lonl,latd,len,lonsperlat) implicit none @@ -1140,18 +1136,20 @@ subroutine uninterpred(iord,kmsk,fi,f,lonl,latd,len,lonsperlat) enddo end subroutine uninterpred -!> ??? + +!> Convert data from the thinned (or reduced) to the full grid +!! along a single row. !! -!! @param iord -!! @param imon -!! @param imsk -!! @param m1 -!! @param m2 -!! @param k1 -!! @param k2 -!! @param f2 +!! @param[in] iord Interpolation method. '1' neighbor; '2' bilinear. +!! @param[in] imon Not used. +!! @param[in] imsk Flag to account for mask during conversion. '0' - use mask. +!! @param[in] m1 Number of points along a row of the thinned grid. +!! @param[in] m2 Number of points along a row on the full grid. +!! @param[in] k1 Mask of input data. +!! @param[in] f1 Data on the thinned (or reduced) grid. +!! @param[out] f2 Data on the full grid. !! -!! @author unknown +!! @author George Gayno org: w/np2 @date 2005-Dec-16 subroutine intlon(iord,imon,imsk,m1,m2,k1,f1,f2) implicit none diff --git a/sorc/emcsfc_snow2mdl.fd/snowdat.f b/sorc/emcsfc_snow2mdl.fd/snowdat.f index 4f93d15c7..c9f91ee65 100755 --- a/sorc/emcsfc_snow2mdl.fd/snowdat.f +++ b/sorc/emcsfc_snow2mdl.fd/snowdat.f @@ -1,11 +1,9 @@ !> @file !! @brief Read and qc afwa, nesdis/ims and autosnow snow data. -!! !! @author gayno org: w/np2 @date 2005-dec-16 -!! -!> @module -!! @brief Read and qc afwa, nesdis/ims and autosnow snow data. +!> 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. @@ -17,31 +15,13 @@ !! - 2014-sep-30 gayno - Convert weekly nh snow climatology - used to !! qc input data - to grib 2. !! variable definitions: -!! - afwa_res - resolution of afwa data in km -!! - autosnow_res - resolution of autosnow in km -!! - bad_afwa_Xh !< is afwa data corrupt? -!! - bad_nesdis !< is nesdis ims data corrupt? -!! - bitmap_afwa_Xh !< bitmap of afwa grid (false-non land, true-land) -!! - bitmap_nesdis - bitmap of nesdis grid (false-non land, true-land) -!! - iafwa - i-dimension of afwa grid -!! - jafwa - j-dimension of afwa grid -!! - iautosnow - i-dimension of autosnow grid -!! - jautosnow - j-dimension of autosnow grid -!! - inesdis - i-dimension of nesdis grid -!! - jnesdis - j-dimension of nesdis grid +!! - 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) -!! - kgds_autosnow - autosnow grid description section (grib section 2) -!! - kgds_nesdis - nesdis/ims grid description section (grib section 2) -!! - mesh_nesdis - nesdis/ims data is 96th mesh (or bediant) !! - nesdis_res - resolution of nesdis/ims data in km -!! - sea_ice_nesdis - nesdis/ims sea ice flag (0-open water, 1-ice) -!! - snow_cvr_autosnow - autosnow snow cover flag (0-no, 100-yes) -!! - snow_cvr_nesdis - nesdis/ims snow cover flag (0-no, 100-yes) !! - 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 -!! - use_autosnow - true if autosnow data to be used -!! - use_nesdis - true if nesdis/ims data to be used !! module snowdat @@ -63,36 +43,51 @@ module snowdat integer :: jafwa !< j-dimension of afwa grid integer :: jautosnow !< j-dimension of autosnow grid integer :: jnesdis !< j-dimension of nesdis grid - integer :: kgds_afwa_global(200) - integer :: kgds_afwa_nh(200) - integer :: kgds_afwa_nh_8th(200) - integer :: kgds_afwa_sh(200) - integer :: kgds_afwa_sh_8th(200) + integer :: kgds_afwa_global(200) !< grib1 grid description section for + !! global afwa data. + integer :: kgds_afwa_nh(200) !< grib1 grid description section for northern + !! hemisphere 16th mesh afwa data. + integer :: kgds_afwa_nh_8th(200) !< grib1 grid description section for + !! northern hemisphere 8th mesh afwa data. + integer :: kgds_afwa_sh(200) !< grib1 grid description section for southern + !! hemisphere 16th mesh afwa data. + integer :: kgds_afwa_sh_8th(200) !< grib1 grid description section for + !! southern hemisphere 8th mesh afwa data. integer :: kgds_autosnow(200) !< autosnow grid description section (grib section 2) integer :: kgds_nesdis(200) !< nesdis/ims grid description section (grib section 2) integer :: mesh_nesdis !< nesdis/ims data is 96th mesh (or bediant) integer*1, allocatable :: sea_ice_nesdis(:,:) !< nesdis/ims sea ice flag (0-open water, 1-ice) - logical :: bad_afwa_nh - logical :: bad_afwa_sh - logical :: bad_nesdis !< is nesdis ims data corrupt? - logical :: bad_afwa_global - logical*1, allocatable :: bitmap_afwa_global(:,:) - logical*1, allocatable :: bitmap_afwa_nh(:,:) - logical*1, allocatable :: bitmap_afwa_sh(:,:) - logical*1, allocatable :: bitmap_nesdis(:,:) !< bitmap of nesdis grid (false-non land, true-land) - logical*1, allocatable :: bitmap_autosnow(:,:) - logical :: use_nh_afwa, use_sh_afwa, use_global_afwa - logical :: use_autosnow - logical :: use_nesdis !< true if nesdis/ims data to be used - - real :: autosnow_res !< resolution of autosnow in km - real :: afwa_res !< resolution of afwa data in km - real :: nesdis_res + logical :: bad_afwa_nh !< When true, the northern hemisphere afwa data failed + !! its quality control check. + logical :: bad_afwa_sh !< When true, the southern hemisphere afwa data failed + !! its quality control check. + logical :: bad_nesdis !< When true, the nesdis data failed its quality + !! control check. + logical :: bad_afwa_global !< When true, the global afwa data failed its quality + !! control check. + logical*1, allocatable :: bitmap_afwa_global(:,:) !< The global afwa data grib bitmap. + !!(false-non land, true-land). + logical*1, allocatable :: bitmap_afwa_nh(:,:) !< The northern hemisphere afwa data grib bitmap. + !! (false-non land, true-land). + logical*1, allocatable :: bitmap_afwa_sh(:,:) !< The southern hemisphere afwa data grib bitmap. + !! (false-non land, true-land). + logical*1, allocatable :: bitmap_nesdis(:,:) !< nesdis data grib bitmap (false-non land, true-land). + logical*1, allocatable :: bitmap_autosnow(:,:) !< autosnow data grib bitmap (false-non land, + !! true-land). + logical :: use_nh_afwa !< True if northern hemisphere afwa data to be used. + logical :: use_sh_afwa !< True if southern hemisphere afwa data to be used. + logical :: use_global_afwa !< True if global hemisphere afwa data to be used. + logical :: use_autosnow !< True if autosnow data to be used + logical :: use_nesdis !< True if nesdis/ims data to be used + + real :: autosnow_res !< Resolution of autosnow in km + real :: afwa_res !< Resolution of afwa data in km + real :: nesdis_res !< Resolution of the nesdis data in km. real, allocatable :: snow_cvr_nesdis(:,:) !< nesdis/ims snow cover flag (0-no, 100-yes) real, allocatable :: snow_cvr_autosnow(:,:) !< autosnow snow cover flag (0-no, 100-yes) - real, allocatable :: snow_dep_afwa_global(:,:) - real, allocatable :: snow_dep_afwa_nh(:,:) - real, allocatable :: snow_dep_afwa_sh(:,:) + real, allocatable :: snow_dep_afwa_global(:,:) !< The global afwa snow depth. + real, allocatable :: snow_dep_afwa_nh(:,:) !< Northern hemisphere afwa snow depth. + real, allocatable :: snow_dep_afwa_sh(:,:) !< Southern hemisphere afwa snow depth. ! the afwa 8th mesh binary data has no grib header, so set it from these ! data statements. needed for ipolates routines. @@ -102,7 +97,7 @@ module snowdat data kgds_afwa_sh_8th/5,2*512,20826,-125000,8,-80000,2*47625,128, & 9*0,255,180*0/ contains -!> Read autosnow snow cover. +!> Read autosnow snow cover. !! !! program history log: !! 2008-feb-04 gayno - initial version @@ -839,15 +834,13 @@ end subroutine readafwa !! 2014-sep-30 gayno - Weekly climo file converted !! to grib 2. !! -!! argument list: -!! @param[in] kgds_dat a Grib 1 grid description sect of data to be qcd. -!! @param[in] snow_data Snow cover to be qcd. -!! @param[in] bitmap_data bitmap of data to be qcd. -!! @param[in] idata I dimension of data to be qcd. -!! @param[in] jdata J dimension of data to be qcd. -!! @param[in] isrc Flag indicating data source; 1- afwa depth, 2-ims cover. -!! -!! @param[out] bad When true, data failed check. +!! @param[in] kgds_data Grib 1 grid description sect of data to be qcd. +!! @param[in] snow_data Snow cover to be qcd. +!! @param[in] bitmap_data bitmap of data to be qcd. +!! @param[in] idata I dimension of data to be qcd. +!! @param[in] jdata J dimension of data to be qcd. +!! @param[in] isrc Flag indicating data source; 1- afwa depth, 2-ims cover. +!! @param[out] bad When true, data failed check. !! !! files: !! input: @@ -1122,13 +1115,9 @@ subroutine nh_climo_check(kgds_data,snow_data,bitmap_data,idata,jdata,isrc,bad) end subroutine nh_climo_check -!> Check for corrupt afwa data. +!> Check for corrupt afwa data. !! -!! program history log: -!! 2009-jun-3 gayno - initial version -!! -!! argument list -!! @param[in] hemi (1-nh, 2-sh) +!! @param[in] hemi (1-nh, 2-sh) !! @author George Gayno org: w/np2 @date 2009-Jun-3 subroutine afwa_check(hemi) use gdswzd_mod @@ -1221,15 +1210,10 @@ subroutine afwa_check(hemi) end subroutine afwa_check -!> Read afwa binary snow depth file. -!! -!! program history log: -!! 2007-nov-28 gayno - initial version +!> Read afwa binary snow depth file. !! -!! argument list: -!! @param[in] file_name - file name -!! -!! @param[out] snow_dep_afwa - snow depth in meters +!! @param[in] file_name file name +!! @param[out] snow_dep_afwa snow depth in meters !! !! files: !! input: @@ -1239,8 +1223,8 @@ end subroutine afwa_check !! 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. +!! @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 subroutine read_afwa_binary(file_name, snow_dep_afwa) @@ -1314,10 +1298,6 @@ end subroutine read_afwa_binary !> Read afwa land mask file to get a bitmap. !! -!! program history log: -!! 2007-nov-28 gayno - initial version -!! -!! argument list: !! @param[in] file_name land mask file name !! @param[out] bitmap_afwa .true. if land !!