Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UA SWE/SNWD Reader for LVT #129

Merged
merged 7 commits into from
Jun 28, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions lvt/configs/lvt.config.master
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ LVT output methodology: "2d gridspace"
#latex: ``USCRN soil moisture'' & USCRN soil moisture data\\
#latex: ``SMAP soil moistu'' & SMAP soil moisture data\\
#latex: ``SMAP vegetation water content'' & SMAP vegetation water content\\
#latex: ``UA SNOW'' & University of Arizona SWE/Snow depth data\\
#latex: ``SMAP L3 Tb'' & SMAP L3 brightness temperature\\
#latex: \end{tabular}
#latex:
Expand Down Expand Up @@ -2860,6 +2861,20 @@ WG SWRC observation directory:
WG SWRC station list file:
#latex: END_CONFIG

#latex: BEGIN_DESCRIPTION
#latex: \subsubsection{UA SNOW observations}
#latex: END_DESCRIPTION

#latex: BEGIN_DESCRIPTION
#latex: \var{UA SNOW observation directory:} specifies the location of
#latex: the University of Arizona SWE data
#latex:
#latex: END_DESCRIPTION

#latex: BEGIN_CONFIG
UA SNOW observation directory: ./UA_SNOW
#latex: END_CONFIG

#latex: BEGIN_DESCRIPTION
#latex: \subsection{OptUE processing options} \label{ssec:optue}
#latex: This section of the config file specifies the details of the
Expand Down
158 changes: 158 additions & 0 deletions lvt/datastreams/UA_SNOW/UASNOW_obsMod.F90
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
!-----------------------BEGIN NOTICE -- DO NOT EDIT-----------------------------
! NASA GSFC Land surface Verification Toolkit (LVT) V1.0
!-------------------------END NOTICE -- DO NOT EDIT-----------------------------
!BOP
!
! !MODULE: UASNOW_obsMod
! \label(UASNOW_obsMod)
!
! !INTERFACE:
module UASNOW_obsMod
!
! !USES:
use ESMF

implicit none
PRIVATE
!
! !INPUT PARAMETERS:
!
! !OUTPUT PARAMETERS:
!
! !DESCRIPTION:
! This module handles the observation plugin for the
! University of Arizona (UA) SWE/Snow Depth data v01.
! The UA SNOW data is provided in the NAD 1983 grid
! with ~4-km resolution. The domain extents are from
! approximately (24N, -125W) to (50N, -66.5W).
! The data entries are 16-bit signed integers.
!
! Temporal coverage is from 1 Oct 1981 - 30 Sep 2017.
! The data is organized by Water Years.
!
! !FILES USED:
!
! !REVISION HISTORY:
! 28 May 2019: Rhae Sung Kim, Initial Specification!
! 19 Jun 2019: David Mocko, Set valid time of data to 12Z
!
!EOP

PUBLIC :: UASNOW_obsinit
PUBLIC :: uasnowobs

type, public :: uasnowobsdec
character*100 :: odir
integer :: nc, nr
integer :: yr
type(ESMF_Time) :: startTime
type(ESMF_TimeInterval) :: timeStep

real, allocatable :: rlat(:)
real, allocatable :: rlon(:)
integer, allocatable :: n11(:)
integer, allocatable :: n12(:)
integer, allocatable :: n21(:)
integer, allocatable :: n22(:)
real, allocatable :: w11(:)
real, allocatable :: w12(:)
real, allocatable :: w21(:)
real, allocatable :: w22(:)
real, allocatable :: swe(:,:)
real, allocatable :: snwd(:,:)
end type uasnowobsdec

type(uasnowobsdec), allocatable :: uasnowobs(:)

contains

!BOP
!
! !ROUTINE: UASNOW_obsinit
! \label{UASNOW_obsinit}
!
! !INTERFACE:
subroutine UASNOW_obsinit(i)
!
! !USES:
use ESMF
use LVT_coreMod
use LVT_histDataMod
use LVT_timeMgrMod
use LVT_logMod

implicit none
!
! !INPUT PARAMETERS:
integer, intent(IN) :: i
!
! !OUTPUT PARAMETERS:
!
! !DESCRIPTION:
! This subroutine initializes and sets up the data structures
! required for reading UA SNOW data.
!
! !FILES USED:
!
!EOP

real :: gridDesci(50)
integer :: status

if(.not.allocated(uasnowobs)) then
allocate(uasnowobs(LVT_rc%nDataStreams))
endif

call ESMF_ConfigGetAttribute(LVT_config, uasnowobs(i)%odir, &
label='UA SNOW observation directory:',rc=status)
call LVT_verify(status, 'UA SNOW observation directory: not defined')

gridDesci = 0
call LVT_update_timestep(LVT_rc, 3600)

allocate(uasnowobs(i)%rlat(LVT_rc%lnc*LVT_rc%lnr))
allocate(uasnowobs(i)%rlon(LVT_rc%lnc*LVT_rc%lnr))

allocate(uasnowobs(i)%w11(LVT_rc%lnc*LVT_rc%lnr))
allocate(uasnowobs(i)%w12(LVT_rc%lnc*LVT_rc%lnr))
allocate(uasnowobs(i)%w21(LVT_rc%lnc*LVT_rc%lnr))
allocate(uasnowobs(i)%w22(LVT_rc%lnc*LVT_rc%lnr))

allocate(uasnowobs(i)%n11(LVT_rc%lnc*LVT_rc%lnr))
allocate(uasnowobs(i)%n12(LVT_rc%lnc*LVT_rc%lnr))
allocate(uasnowobs(i)%n21(LVT_rc%lnc*LVT_rc%lnr))
allocate(uasnowobs(i)%n22(LVT_rc%lnc*LVT_rc%lnr))

uasnowobs(i)%nc = 1405
uasnowobs(i)%nr = 621

gridDesci(1) = 0
gridDesci(2) = 1405
gridDesci(3) = 621
gridDesci(4) = 24.0833340
gridDesci(5) = -125.0000
gridDesci(6) = 128
gridDesci(7) = 49.9166679
gridDesci(8) = -66.5000
gridDesci(9) = 0.04166662697178698
gridDesci(10) = 0.04166662697178698
gridDesci(20) = 64

call bilinear_interp_input(gridDesci,LVT_rc%gridDesc,&
LVT_rc%lnc*LVT_rc%lnr, &
uasnowobs(i)%rlat, uasnowobs(i)%rlon, &
uasnowobs(i)%n11, uasnowobs(i)%n12, &
uasnowobs(i)%n21, uasnowobs(i)%n22, &
uasnowobs(i)%w11, uasnowobs(i)%w12, &
uasnowobs(i)%w21, uasnowobs(i)%w22)

allocate(uasnowobs(i)%swe(uasnowobs(i)%nc,uasnowobs(i)%nr))
allocate(uasnowobs(i)%snwd(uasnowobs(i)%nc,uasnowobs(i)%nr))

call ESMF_TimeIntervalSet(uasnowobs(i)%timestep, s=86400, rc=status)
call LVT_verify(status, 'error in setting timestep (uasnowobs)')

end subroutine UASNOW_obsinit


end module UASNOW_obsMod
Loading