Class albedo_Matthews
In: surface_properties/albedo_Matthews.f90

Methods

Included Modules

dc_types gridset dc_date dc_date_types timeset namelist_util dc_iounit dc_message

Public Instance methods

Subroutine :
xy_SurfCond( 0:imax-1, 1:jmax ) :integer , intent(in )
: 地表状態 (0: 固定, 1: 可変). Surface condition (0: fixed, 1: variable)
xy_SurfAlbedo( 0:imax-1, 1:jmax ) :real(DP), intent(out)
: 地表アルベド. Surface albedo

[Source]

  subroutine SetAlbedoMathews( xy_SurfCond, xy_SurfAlbedo )

    ! モジュール引用 ; USE statements
    !

    ! 格子点設定
    ! Grid points settings
    !
    use gridset, only: imax, jmax, kmax    ! 鉛直層数.
                               ! Number of vertical level

    ! 日付および時刻の取り扱い
    ! Date and time handler
    !
    use dc_date, only: DC_DIFFTIME, EvalDay, EvalSec

    use dc_date_types, only: DAY_SECONDS, YEAR_DAYS

    ! 時刻管理
    ! Time control
    !
    use timeset, only: TimeN

    ! 宣言文 ; Declaration statements
    !
    integer , intent(in ) :: xy_SurfCond  ( 0:imax-1, 1:jmax )
                              ! 地表状態 (0: 固定, 1: 可変).
                              ! Surface condition (0: fixed, 1: variable)
    real(DP), intent(out) :: xy_SurfAlbedo( 0:imax-1, 1:jmax )
                              ! 地表アルベド.
                              ! Surface albedo

    ! 作業変数
    ! Work variables
    !
    real(DP):: SecOfYear
    real(DP):: a_Data_SOY_Ex( 0:nseason+1 )
    real(DP):: xya_SurfAlbedoLocal( 0:imax-1, 1:jmax, 1:2 )
    integer :: i               ! 経度方向に回る DO ループ用作業変数
                              ! Work variables for DO loop in longitude
    integer :: j               ! 緯度方向に回る DO ループ用作業変数
                              ! Work variables for DO loop in latitude
    integer :: l
    integer :: t
    integer :: tindex
    integer :: a_tindex(1:2)


    if ( .not. albedo_mathews_inited ) call SetAlbedoInit


    if ( flag_annual_mean ) then

      !
      ! Now, annual mean value is used, temporarily.
      !
      xy_SurfAlbedo = 0.0d0

      do l = 1, nseason
        do j = 1, jmax
          do i = 0, imax-1
            xy_SurfAlbedo(i,j) = xy_SurfAlbedo(i,j) + xy_Data_Albedo( l, xy_SurfCond(i,j) )
          end do
        end do
      end do

      xy_SurfAlbedo = xy_SurfAlbedo / dble( nseason )

    else

      SecOfYear = mod( EvalSec( TimeN ), YEAR_DAYS * DAY_SECONDS )
      if ( SecOfYear > YEAR_DAYS * DAY_SECONDS ) SecOfYear = YEAR_DAYS * DAY_SECONDS

      a_Data_SOY_Ex(0) = ( 0.0d0 - ( YEAR_DAYS - a_Data_DOY(nseason) ) ) * DAY_SECONDS
      do t = 1, nseason
        a_Data_SOY_Ex(t) = a_Data_DOY(t) * DAY_SECONDS
      end do
      a_Data_SOY_Ex(nseason+1) = ( YEAR_DAYS + a_Data_DOY(1) ) * DAY_SECONDS


      a_tindex(1) = 0
      a_tindex(2) = 1
      do t = 1, nseason
        if ( a_Data_DOY(t) * DAY_SECONDS <= SecOfYear ) then
          a_tindex(1) = t
          a_tindex(2) = t+1
        end if
      end do

      do t = 1, 2
        ! for northern hemisphere
        tindex = a_tindex(t)
        if ( tindex == 0 ) then
          tindex = nseason
        else if ( tindex == nseason+1 ) then
          tindex = 1
        else
          tindex = tindex
        end if
        do j = jmax/2+1, jmax
          do i = 0, imax-1
            xya_SurfAlbedoLocal(i,j,t) = xy_Data_Albedo( tindex, xy_SurfCond(i,j) )
          end do
        end do
        ! for southern hemisphere
        tindex = a_tindex(t) + nseason / 2
        if ( tindex > nseason ) tindex = tindex - nseason
        if ( tindex == 0 ) then
          tindex = nseason
        else if ( tindex == nseason+1 ) then
          tindex = 1
        else
          tindex = tindex
        end if
        do j = 1, jmax/2
          do i = 0, imax-1
            xya_SurfAlbedoLocal(i,j,t) = xy_Data_Albedo( tindex, xy_SurfCond(i,j) )
          end do
        end do
      end do

      xy_SurfAlbedo = ( xya_SurfAlbedoLocal(:,:,2) - xya_SurfAlbedoLocal(:,:,1) ) / ( a_Data_SOY_Ex(a_tindex(2)) - a_Data_SOY_Ex(a_tindex(1)) ) * ( SecOfYear                  - a_Data_SOY_Ex(a_tindex(1)) ) + xya_SurfAlbedoLocal(:,:,1)

    end if


  end subroutine SetAlbedoMathews
albedo_mathews_inited
Variable :
albedo_mathews_inited = .false. :logical, save, public
: 初期設定フラグ. Initialization flag

Private Instance methods

NAlbType
Constant :
NAlbType = 32 :integer , parameter
NSeason
Constant :
NSeason = 4 :integer , parameter
OceanAlbedo
Variable :
OceanAlbedo :real(DP) , save
Subroutine :

This procedure input/output NAMELIST#albedo_Matthews_nml .

[Source]

  subroutine SetAlbedoInit

    ! NAMELIST ファイル入力に関するユーティリティ
    ! Utilities for NAMELIST file input
    !
    use namelist_util, only: namelist_filename, NmlutilMsg, NmlutilAryValid

    ! ファイル入出力補助
    ! File I/O support
    !
    use dc_iounit, only: FileOpen

    ! メッセージ出力
    ! Message output
    !
    use dc_message, only: MessageNotify

    ! 作業変数
    ! Work variables
    !
    integer:: unit_nml        ! NAMELIST ファイルオープン用装置番号.
                              ! Unit number for NAMELIST file open
    integer:: iostat_nml      ! NAMELIST 読み込み時の IOSTAT.
                              ! IOSTAT of NAMELIST read

    ! NAMELIST 変数群
    ! NAMELIST group name
    !
    namelist /albedo_Matthews_nml/ flag_annual_mean, OceanAlbedo
          !
          ! デフォルト値については初期化手続 "surface_flux_bulk#SurfFluxInit"
          ! のソースコードを参照のこと.
          !
          ! Refer to source codes in the initialization procedure
          ! "surface_flux_bulk#SurfFluxInit" for the default values.
          !


    ! デフォルト値の設定
    ! Default values settings
    !
    flag_annual_mean = .false.
    OceanAlbedo      = 0.1d0


    ! NAMELIST の読み込み
    ! NAMELIST is input
    !
    if ( trim(namelist_filename) /= '' ) then
      call FileOpen( unit_nml, namelist_filename, mode = 'r' ) ! (in)

      rewind( unit_nml )
      read( unit_nml, nml = albedo_Matthews_nml, iostat = iostat_nml )        ! (out)
      close( unit_nml )

      call NmlutilMsg( iostat_nml, module_name ) ! (in)
    end if



    xy_Data_Albedo = xy_Data_Albedo * 1.0d-2


    xy_Data_Albedo(:,0) = OceanAlbedo



    ! 印字 ; Print
    !
    call MessageNotify( 'M', module_name, '----- Initialization Messages -----' )
    call MessageNotify( 'M', module_name, '  flag_annual_mean = %b', l = (/ flag_annual_mean /) )
    call MessageNotify( 'M', module_name, '  OceanAlbedo      = %f', d = (/ OceanAlbedo      /) )
    call MessageNotify( 'M', module_name, '-- version = %c', c1 = trim(version) )


    albedo_mathews_inited = .true.

  end subroutine SetAlbedoInit
a_Data_DOY
Variable :
a_Data_DOY( NSeason ) :real(DP), save
flag_annual_mean
Variable :
flag_annual_mean :logical , save
module_name
Constant :
module_name = ‘albedo_Matthews :character(*), parameter
: モジュールの名称. Module name
version
Constant :
version = ’$Name: dcpam5-20100424 $’ // ’$Id: albedo_Matthews.f90,v 1.2 2010-02-24 08:07:54 yot Exp $’ :character(*), parameter
: モジュールのバージョン Module version
xy_Data_Albedo
Variable :
xy_Data_Albedo( NSeason, 0:NAlbType ) :real(DP), save