Class subsurface_diffusion_heat
In: surface_flux/subsurface_diffusion_heat.f90

�°ä������´æ�¡æ��

Vertical diffusion under the ground

Note that Japanese and English are described in parallel.

Procedures List

SubsurfaceDiffusion :�±ä�å°����������¹ã���ç®�
SubsurfaceDiffusionInit :�������µã�����¼ã����
———————— :————
SubsurfaceDiffusion :Calculate thermal conduction flux
SubsurfaceDiffusionInit :Initialization

Methods

Included Modules

gridset dc_types dc_message timeset axesset constants_snowseaice namelist_util dc_iounit dc_string gtool_historyauto

Public Instance methods

Subroutine :
xy_DeepSubSurfHeatFlux(0:imax-1, 1:jmax) :real(DP), intent(in )
: �°ä¸­�±ã����������. "Deep subsurface heat flux" Heat flux at the bottom of surface/soil layer.
xy_SoilHeatCap(0:imax-1, 1:jmax) :real(DP), intent(in )
: ��å£��±å��� (J K-1 kg-1) Specific heat of soil (J K-1 kg-1)
xy_SoilHeatDiffCoef(0:imax-1, 1:jmax) :real(DP), intent(in )
: ��å£��±ä�å°���� (J m-3 K-1) Heat conduction coefficient of soil (J m-3 K-1)
xy_SurfTemp(0:imax-1, 1:jmax) :real(DP), intent(in )
: �°è¡¨�¢æ¸©åº�. Surface temperature
xyz_SoilTemp(0:imax-1, 1:jmax, 1:kslmax) :real(DP), intent(in )
: ��å£�æ¸�º¦ (K) Soil temperature (K)
xy_SurfSnowB(0:imax-1, 1:jmax) :real(DP), intent(in )
: �����. Surface snow amount.
xyr_SoilTempTransCoef(0:imax-1, 1:jmax, 0:kslmax) :real(DP), intent(out)
: 輸é��ä¿��°ï���å£�æ¸�º¦. Transfer coefficient: soil temperature
xyr_SoilHeatFlux(0:imax-1, 1:jmax, 0:kslmax) :real(DP), intent(out)
: ��å£�中ã���±ã����������. Heat flux in sub-surface soil

����å¤��������ç®���è¡����¾ã��.

Calculate tendencies.

[Source]

  subroutine SubsurfaceDiffusion( xy_DeepSubSurfHeatFlux, xy_SoilHeatCap, xy_SoilHeatDiffCoef, xy_SurfTemp, xyz_SoilTemp, xy_SurfSnowB, xyr_SoilTempTransCoef, xyr_SoilHeatFlux )
    !
    ! ����å¤��������ç®���è¡����¾ã��. 
    !
    ! Calculate tendencies. 
    !

    ! �¢ã�¸ã�¥ã�¼ã����� ; USE statements
    !

    ! ���»ç���
    ! Time control
    !
    use timeset, only: TimesetClockStart, TimesetClockStop

    ! 座æ����¼ã�¿è¨­å®�
    ! Axes data settings
    !
    use axesset, only: r_SSDepth, z_SSDepth    ! subsurface grid at midpoint of layer

    ! ����µ·æ°·ã����°ã��¨­å®�
    ! Setting constants of snow and sea ice
    !
    use constants_snowseaice, only: SnowDens, SnowMaxThermDepth, SnowThermCondCoef

    ! 宣�� ; Declaration statements
    !
    implicit none

    real(DP), intent(in ):: xy_DeepSubSurfHeatFlux (0:imax-1, 1:jmax)
                              ! �°ä¸­�±ã����������. 
                              ! "Deep subsurface heat flux"
                              ! Heat flux at the bottom of surface/soil layer.
    real(DP), intent(in ):: xy_SoilHeatCap (0:imax-1, 1:jmax)
                              ! ��å£��±å��� (J K-1 kg-1)
                              ! Specific heat of soil (J K-1 kg-1)
    real(DP), intent(in ):: xy_SoilHeatDiffCoef (0:imax-1, 1:jmax)
                              ! ��å£��±ä�å°���� (J m-3 K-1)
                              ! Heat conduction coefficient of soil (J m-3 K-1)
    real(DP), intent(in ):: xy_SurfTemp (0:imax-1, 1:jmax)
                              ! �°è¡¨�¢æ¸©åº�. 
                              ! Surface temperature
    real(DP), intent(in ):: xyz_SoilTemp (0:imax-1, 1:jmax, 1:kslmax)
                              ! ��å£�æ¸�º¦ (K)
                              ! Soil temperature (K)
    real(DP), intent(in ):: xy_SurfSnowB (0:imax-1, 1:jmax)
                              ! �����.
                              ! Surface snow amount.
    real(DP), intent(out):: xyr_SoilTempTransCoef (0:imax-1, 1:jmax, 0:kslmax)
                              ! 輸é��ä¿��°ï���å£�æ¸�º¦.
                              ! Transfer coefficient: soil temperature
    real(DP), intent(out):: xyr_SoilHeatFlux (0:imax-1, 1:jmax, 0:kslmax)
                              ! ��å£�中ã���±ã����������. 
                              ! Heat flux in sub-surface soil



    ! �業��
    ! Work variables
    !
    integer:: k               ! ���´æ�¹å�������� DO ���¼ã�����業å���
                              ! Work variables for DO loop in vertical direction

    ! ���� ; Executable statement
    !

    ! ������確è�
    ! Initialization check
    !
    if ( .not. subsurface_diffusion_inited ) then
      call MessageNotify( 'E', module_name, 'This module has not been initialized.' )
    end if


    ! �����������
    ! Start measurement of computation time
    !
    call TimesetClockStart( module_name )



    ! ��å£�æ¸�º¦è¨�ç®�����¼¸��ä¿��°ã���ç®�
    ! Calculate transfer coefficient for heat diffusion in the soil
    !
    k = 0
    if ( kslmax == 0 ) then
      ! This line is used when kslmax == 0, because z_SSDepth(k+1) does not exist. 
      xyr_SoilTempTransCoef(:,:,k) = 0.0_DP
    else
!!$      xyr_SoilTempTransCoef(:,:,k) = &
!!$        & xy_SoilHeatDiffCoef(:,:) / ( z_SSDepth(k+1) - 0.0_DP )
      xyr_SoilTempTransCoef(:,:,k) = (   ( z_SSDepth(k+1) - 0.0_DP ) / xy_SoilHeatDiffCoef - min( max( xy_SurfSnowB / SnowDens, 0.0_DP ), SnowMaxThermDepth ) / SnowThermCondCoef )**(-1)

    end if
    do k = 1, kslmax-1
      xyr_SoilTempTransCoef(:,:,k) = xy_SoilHeatDiffCoef(:,:) / ( z_SSDepth(k+1) - z_SSDepth(k) )
    end do
    k = kslmax
    xyr_SoilTempTransCoef(:,:,k) = 0.0_DP


    ! ��å£�中ã���±ã���������¹ã���ç®�
    ! Calculate heat flux in sub-surface soil
    !
    k = 0
    if ( kslmax == 0 ) then
      ! This line is used when kslmax == 0, because xyz_SoilTemp(:,:,k+1) does not exist. 
      xyr_SoilHeatFlux(:,:,k) = 0.0_DP
    else
      xyr_SoilHeatFlux(:,:,k) = - xyr_SoilTempTransCoef(:,:,k) * ( xyz_SoilTemp(:,:,1) - xy_SurfTemp(:,:) )
    end if
    do k = 1, kslmax-1
      xyr_SoilHeatFlux(:,:,k) = - xyr_SoilTempTransCoef(:,:,k) * ( xyz_SoilTemp(:,:,k+1) - xyz_SoilTemp(:,:,k) )
    end do
    k = kslmax
    xyr_SoilHeatFlux(:,:,k) = xy_DeepSubSurfHeatFlux


    ! ��������������
    ! Pause measurement of computation time
    !
    call TimesetClockStop( module_name )

  end subroutine SubsurfaceDiffusion
Subroutine :

subsurface_diffusion_heat �¢ã�¸ã�¥ã�¼ã������������è¡����¾ã��. NAMELIST#subsurface_diffusion_heat_nml ����¿è¾¼�¿ã��������ç¶����§è�����¾ã��.

"subsurface_diffusion_heat" module is initialized. "NAMELIST#subsurface_diffusion_heat_nml" is loaded in this procedure.

[Source]

  subroutine SubsurfaceDiffusionInit
    !
    ! subsurface_diffusion_heat �¢ã�¸ã�¥ã�¼ã������������è¡����¾ã��. 
    ! NAMELIST#subsurface_diffusion_heat_nml ����¿è¾¼�¿ã��������ç¶����§è�����¾ã��. 
    !
    ! "subsurface_diffusion_heat" module is initialized. 
    ! "NAMELIST#subsurface_diffusion_heat_nml" is loaded in this procedure. 
    !

    ! �¢ã�¸ã�¥ã�¼ã����� ; USE statements
    !

    ! NAMELIST ���¡ã�¤ã���¥å�����¢ã�������¼ã���£ã������
    ! Utilities for NAMELIST file input
    !
    use namelist_util, only: namelist_filename, NmlutilMsg, NmlutilAryValid

    ! ���¡ã�¤ã���¥å�ºå��è£���
    ! File I/O support
    !
    use dc_iounit, only: FileOpen

    ! ç¨��¥å�������¡ã��
    ! Kind type parameter
    !
    use dc_types, only: STDOUT ! æ¨�æº��ºå�����ç½����. Unit number of standard output

    ! ��������
    ! Character handling
    !
    use dc_string, only: StoA

    ! ���¹ã�������¼ã�¿å�ºå��
    ! History data output
    !
    use gtool_historyauto, only: HistoryAutoAddVariable

    ! �¡ã���»ã�¼ã�¸å�ºå��
    ! Message output
    !
    use dc_message, only: MessageNotify

    ! 宣�� ; Declaration statements
    !
    implicit none

    ! �業��
    ! Work variables
    !
!!$    integer:: unit_nml        ! NAMELIST ���¡ã�¤ã�����¼ã���³ç���ç½����. 
!!$                              ! Unit number for NAMELIST file open
!!$    integer:: iostat_nml      ! NAMELIST 読ã�¿è¾¼�¿æ���� IOSTAT. 
!!$                              ! IOSTAT of NAMELIST read

!!$    real(DP) :: SoilHeatCap
!!$    real(DP) :: SoilHeatDiffCoef

    ! NAMELIST å¤��°ç¾¤
    ! NAMELIST group name
    !
!!$    namelist /subsurface_diffusion_heat_nml/ &
!!$      & SoilHeatCap, SoilHeatDiffCoef
!!$          !
!!$          ! �����������¤ã���¤ã��������������ç¶� "subsurface_diffusion_heat#SubSurfaceDiffusionInit" 
!!$          ! ���½ã�¼ã�¹ã�³ã�¼ã�������§ã������. 
!!$          !
!!$          ! Refer to source codes in the initialization procedure
!!$          ! "subsurface_diffusion_heat#SubsurfaceDiffusionInit" for the default values. 
!!$          !

    ! ���� ; Executable statement
    !

    if ( subsurface_diffusion_inited ) return

    ! �����������¤ã��¨­å®�
    ! Default values settings
    !


    ! NAMELIST ����¿è¾¼��
    ! NAMELIST is input
    !
!!$    if ( trim(namelist_filename) /= '' ) then
!!$      call FileOpen( unit_nml, &          ! (out)
!!$        & namelist_filename, mode = 'r' ) ! (in)
!!$
!!$      rewind( unit_nml )
!!$      read( unit_nml, &           ! (in)
!!$        & nml = subsurface_diffusion_heat_nml, &  ! (out)
!!$        & iostat = iostat_nml )   ! (out)
!!$      close( unit_nml )
!!$
!!$      call NmlutilMsg( iostat_nml, module_name ) ! (in)
!!$    end if


    ! �°å� ; Print
    !
    call MessageNotify( 'M', module_name, '----- Initialization Messages -----' )
    call MessageNotify( 'M', module_name, '-- version = %c', c1 = trim(version) )

    subsurface_diffusion_inited = .true.

  end subroutine SubsurfaceDiffusionInit

Private Instance methods

module_name
Constant :
module_name = ‘subsurface_diffusion_heat :character(*), parameter
: �¢ã�¸ã�¥ã�¼ã������ç§�. Module name
subsurface_diffusion_inited
Variable :
subsurface_diffusion_inited = .false. :logical, save
: ����設������. Initialization flag
version
Constant :
version = ’$Name: $’ // ’$Id: subsurface_diffusion_heat.f90,v 1.10 2015/01/29 12:07:59 yot Exp $’ :character(*), parameter
: �¢ã�¸ã�¥ã�¼ã�������¼ã�¸ã�§ã�� Module version