snow_process Subroutine

public subroutine snow_process(j, jea, ida, mstruc, precip, tmn, tx)

Uses

  • proc~~snow_process~~UsesGraph proc~snow_process snow_process module~output output proc~snow_process->module~output module~utilities utilities module~output->module~utilities

Arguments

Type IntentOptional AttributesName
integer, intent(in) :: j
integer, intent(in) :: jea
integer, intent(in) :: ida
integer, intent(in), dimension(:, :, :):: mstruc
real(kind=dp), intent(in) :: precip
real(kind=dp), intent(in), dimension(:):: tmn
real(kind=dp), intent(in), dimension(:):: tx

Calls

proc~~snow_process~~CallsGraph proc~snow_process snow_process proc~output_store_hydrotope_value output_store_hydrotope_value proc~snow_process->proc~output_store_hydrotope_value proc~snow_glacier_melt snow_glacier_melt proc~snow_process->proc~snow_glacier_melt proc~snow_melting snow_melting proc~snow_process->proc~snow_melting

Called by

proc~~snow_process~~CalledByGraph proc~snow_process snow_process proc~runsubbasin runsubbasin proc~runsubbasin->proc~snow_process proc~time_process_day time_process_day proc~time_process_day->proc~runsubbasin proc~time_process_month time_process_month proc~time_process_month->proc~time_process_day proc~time_process_years time_process_years proc~time_process_years->proc~time_process_month program~swim swim program~swim->proc~time_process_years

Contents

Source Code


Source Code

  subroutine snow_process(j, jea, ida, mstruc, precip, tmn, tx)
    use output, only: output_store_hydrotope_value

    integer, intent(in) :: ida
    integer, dimension(:, :, :), intent(in) :: mstruc
    real(dp), intent(in) :: precip
    real(dp), dimension(:), intent(in) :: tmn
    real(dp), dimension(:), intent(in) :: tx
    integer, intent(in) :: j, jea
    real(dp) :: elevh

    smle = 0.
    snowVal = 0.
    gmle = 0.
    elevh = mstruc(j, jea, 5) ! hydrotope elevation
    vsn = 0.

    ! elevation-based correction of precipitation and air temperature
    if (precip > 0.) then
      precipe = precip * (1. + xgrad1 * (elevh - elev0(j)))
    else
      precipe = 0.
    end if
    precipe = max(0.0_dp, precipe)
    precip_elev_cor = precipe

    tmit = tx(j) + tgrad1 * (elevh - elev0(j))
    tmax = tmx(j) + tgrad1 * (elevh - elev0(j))
    tmin = tmn(j) + tgrad1 * (elevh - elev0(j))

    ! rsn = snow water density in HYDROTOPE, (g/cm3)
    ! snoa = snow water content, mm
    if (rsn(j, jea) > 0. ) then
      hsn0 = snoa(j, jea) * .1 / rsn(j, jea) ! hsn0 = snow depth, cm
    else
      hsn0 = 0.
    end if

    if (tmit <= tsnfall(j) ) then
      snoa(j, jea) = snoa(j, jea) + precipe * prcor! snow ! add precipitation to snow water content, mm
      snowVal = precipe * prcor ! actual snow fall, mm
      precipe = 0.
    end if

    if (snoa(j, jea) > 0. ) then
      call snow_melting(j, jea, ida)
    else
      if (gla(j, jea) > 0. ) call snow_glacier_melt(j, jea)
    end if

    if (ida == gla_day_out) &
      call output_store_hydrotope_value(glacier_weq_output_id, j, jea, gla(j, jea))

  end subroutine snow_process