Class composition
In: setup/composition.f90

çµ������¢ã���������¨­å®�

Settings of array for atmospheric composition

Note that Japanese and English are described in parallel.

çµ������¢ã���������¨­å®�

Settings of array for atmospheric composition

Variables List

ncmax :����������
———— :————
ncmax :Number of minor comstituents

Procedures List

CompositionInit :çµ������¢ã���������¨­å®�
————— :————
CompositionInit :Settings of parameters for array for composition

NAMELIST

NAMELIST#composition_nml

Methods

Included Modules

dc_types dc_message namelist_util dc_iounit

Public Instance methods

Subroutine :

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

"composition" module is initialized. NAMELIST#composition_nml is loaded in this procedure.

This procedure input/output NAMELIST#composition_nml .

[Source]

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

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

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

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

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

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

    ! 宣�� ; Declaration statements
    !
    implicit none

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

    character(len=STRING) :: Names      (1:MaxNmlArySize)
    character(len=STRING) :: LongNames  (1:MaxNmlArySize)
    logical               :: FlagMassFix(1:MaxNmlArySize)
    logical               :: FlagAdv    (1:MaxNmlArySize)
    logical               :: FlagVDiff  (1:MaxNmlArySize)

    integer:: n               ! çµ����¹å�������� DO ���¼ã�����業å���
                              ! Work variables for DO loop in dimension of constituents

    ! NAMELIST å¤��°ç¾¤
    ! NAMELIST group name
    !
    namelist /composition_nml/ ncmax, Names, LongNames, FlagMassFix, FlagAdv, FlagVDiff
          !
          ! �����������¤ã���¤ã��������������ç¶� "composition#CompositionInit" 
          ! ���½ã�¼ã�¹ã�³ã�¼ã�������§ã������. 
          !
          ! Refer to source codes in the initialization procedure
          ! "composition#CompositionInit" for the default values. 
          !

    ! ���� ; Executable statement
    !

    if ( composition_inited ) return
!!$    call InitCheck

    ! �����������¤ã��¨­å®�
    ! Default values settings
    !
    ncmax        = 1

    Names    (1) = 'QVap'
    LongNames(1) = 'specific humidity'
    do n = 2, MaxNmlArySize
      Names    (n) = ''
      LongNames(n) = ''
    end do

    FlagMassFix = .true.

    FlagAdv     = .true.

    FlagVDiff   = .true.


    ! 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 = composition_nml, iostat = iostat_nml )
      close( unit_nml )

      call NmlutilMsg( iostat_nml, module_name ) ! (in)
      if ( iostat_nml == 0 ) write( STDOUT, nml = composition_nml )
    end if

    ! �����µã�¤ã�ºã�����§ã����
    ! Check number of array size
    !
    if ( ncmax < 1 ) then
      call MessageNotify( 'E', module_name, 'number of composition has to be greater than 0. ' // 'ncmax=%d' , i = (/ ncmax /) )
    end if


    ! Set variable name of constituents for ouptut
    !
    allocate( a_QMixName    ( ncmax ) )
    allocate( a_QMixLongName( ncmax ) )
    if ( ncmax > 99 ) then
      call MessageNotify( 'E', module_name, 'number of composition greater than 99 is inappropriate for current version. ' // 'ncmax=%d' , i = (/ ncmax /) )
    end if
    do n = 1, ncmax
      if ( Names(n) == '' ) then
        write( a_QMixName(n), '(a,i3.3)' ) "QMix", n
      else
        a_QMixName(n) = Names(n)
      end if
      if ( LongNames(n) == '' ) then
        a_QMixLongName(n) = a_QMixName(n)
      else
        a_QMixLongName(n) = LongNames(n)
      end if
    end do

    allocate( a_FlagMassFix( ncmax ) )
    do n = 1, ncmax
      a_FlagMassFix( n ) = FlagMassFix(n)
    end do

    allocate( a_FlagAdv( ncmax ) )
    do n = 1, ncmax
      a_FlagAdv( n ) = FlagAdv(n)
    end do

    allocate( a_FlagVDiff( ncmax ) )
    do n = 1, ncmax
      a_FlagVDiff( n ) = FlagVDiff(n)
    end do

    IndexH2OVap = -1
    do n = 1, ncmax
      if ( a_QMixName(n) == 'QVap' ) then
        IndexH2OVap = n
        exit
      end if
    end do


    ! æ°´è�¸æ����¤ã�³ã�������¹ã�����§ã����
    ! Check index for water vapor
    !
    if ( ( IndexH2OVap < 1 ) .or. ( IndexH2OVap > ncmax ) ) then
      call MessageNotify( 'E', module_name, 'IndexH2OVap has to be greater than or equal to 1 and less than or equal to ncmax. ' // 'IndexH2OVap=%d' , i = (/ IndexH2OVap /) )
    end if


    ! �°å� ; Print
    !
    call MessageNotify( 'M', module_name, '----- Initialization Messages -----' )
    call MessageNotify( 'M', module_name, '    ncmax              = %d', i = (/ ncmax /) )
    do n = 1, ncmax
      call MessageNotify( 'M', module_name, '    QMixName(%d)     = %c', i = (/ n /), c1 = trim(a_QMixName(n)) )
    end do
    do n = 1, ncmax
      call MessageNotify( 'M', module_name, '    QMixLongName(%d) = %c', i = (/ n /), c1 = trim(a_QMixLongName(n)) )
    end do
    do n = 1, ncmax
      call MessageNotify( 'M', module_name, '    FlagMassFix(%d)  = %b', i = (/ n /), l = (/ a_FlagMassFix(n) /) )
    end do
    do n = 1, ncmax
      call MessageNotify( 'M', module_name, '    FlagAdv(%d)      = %b', i = (/ n /), l = (/ a_FlagAdv(n) /) )
    end do
    do n = 1, ncmax
      call MessageNotify( 'M', module_name, '    FlagVDiff(%d)    = %b', i = (/ n /), l = (/ a_FlagVDiff(n) /) )
    end do
    call MessageNotify( 'M', module_name, '    IndexH2OVap        = %d', i = (/ IndexH2OVap /) )
    call MessageNotify( 'M', module_name, '-- version = %c', c1 = trim(version) )

    composition_inited = .true.
  end subroutine CompositionInit
Function :
FlagAdv :logical
Index :integer, intent(in )

Name �§ä���������������������§»æµ������°ã��è¿����¾ã��.

Inquiry of flag for advection of constituent

[Source]

  function CompositionInqFlagAdv( Index ) result( FlagAdv )
    !
    ! Name �§ä���������������������§»æµ������°ã��è¿����¾ã��. 
    !
    ! Inquiry of flag for advection of constituent
    !

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

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

    ! 宣�� ; Declaration statements
    !
    implicit none

    integer, intent(in ) :: Index

    logical :: FlagAdv


    ! ���� ; Executable statement
    !

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


    if ( ( Index < 1 ) .or. ( Index > ncmax ) ) then
      call MessageNotify( 'E', module_name, 'Index is inappropriate, Index = %d', i = (/ Index /) )
    end if

    FlagAdv = a_FlagAdv( Index )


  end function CompositionInqFlagAdv
Function :
FlagMassFix :logical
Index :integer, intent(in )

Name �§ä���������������������§»æµ������°ã��è¿������¾ã��.

Inquiry of flag for advection of constituent

[Source]

  function CompositionInqFlagMassFix( Index ) result( FlagMassFix )
    !
    ! Name �§ä���������������������§»æµ������°ã��è¿������¾ã��.
    !
    ! Inquiry of flag for advection of constituent
    !

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

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

    ! 宣�� ; Declaration statements
    !
    implicit none

    integer, intent(in ) :: Index

    logical :: FlagMassFix


    ! ���� ; Executable statement
    !

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


    if ( ( Index < 1 ) .or. ( Index > ncmax ) ) then
      call MessageNotify( 'E', module_name, 'Index is inappropriate, Index = %d', i = (/ Index /) )
    end if

    FlagMassFix = a_FlagMassFix( Index )


  end function CompositionInqFlagMassFix
Function :
FlagVDiff :logical
Index :integer, intent(in )

Name �§ä���������������������§»æµ������°ã��è¿������¾ã��.

Inquiry of flag for advection of constituent

[Source]

  function CompositionInqFlagVDiff( Index ) result( FlagVDiff )
    !
    ! Name �§ä���������������������§»æµ������°ã��è¿������¾ã��.
    !
    ! Inquiry of flag for advection of constituent
    !

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

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

    ! 宣�� ; Declaration statements
    !
    implicit none

    integer, intent(in ) :: Index

    logical :: FlagVDiff


    ! ���� ; Executable statement
    !

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


    if ( ( Index < 1 ) .or. ( Index > ncmax ) ) then
      call MessageNotify( 'E', module_name, 'Index is inappropriate, Index = %d', i = (/ Index /) )
    end if

    FlagVDiff = a_FlagVDiff( Index )


  end function CompositionInqFlagVDiff
Function :
Index :integer
Name :character(len=*), intent(in )

Name �§ä����������������������¤ã�³ã�����¹ã��è¿������¾ã��.

Inquiry of index of constituent

[Source]

  function CompositionInqIndex( Name ) result( Index )
    !
    ! Name �§ä����������������������¤ã�³ã�����¹ã��è¿������¾ã��. 
    !
    ! Inquiry of index of constituent
    !

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

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

    ! 宣�� ; Declaration statements
    !
    implicit none

    character(len=*), intent(in ) :: Name

    integer:: Index

    integer:: n               ! çµ����¹å�������� DO ���¼ã�����業å���
                              ! Work variables for DO loop in dimension of constituents

    ! ���� ; Executable statement
    !

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


    Index = -1

    do n = 1, ncmax
      if ( a_QMixName(n) == trim( Name ) ) then
        Index = n
        exit
      end if
    end do

!!$    if ( Index == -1 ) then
!!$      call MessageNotify( 'E', module_name, &
!!$        & 'Cannot find %c in a list of constituents.', c1 = trim( Name ) )
!!$    end if


  end function CompositionInqIndex
IndexH2OVap
Variable :
IndexH2OVap :integer , save, public
: æ°´è�¸æ����¤ã�³ã�������� Index for water vapor
a_QMixLongName
Variable :
a_QMixLongName(:) :character(STRING), save, public, allocatable
: �������·ã��å¤��°å�� Long name of variables for composition
a_QMixName
Variable :
a_QMixName(:) :character(STRING), save, public, allocatable
: ��������°å�� Name of variables for composition
composition_inited
Variable :
composition_inited = .false. :logical , save, public
: ����設������. Initialization flag
ncmax
Variable :
ncmax :integer , save, public
: �������� Number of composition

Private Instance methods

a_FlagAdv
Variable :
a_FlagAdv(:) :logical , save, allocatable
: ������§»æµ�è¨�ç®��������� Flag for advection calculation
a_FlagMassFix
Variable :
a_FlagMassFix(:) :logical , save, allocatable
: è³��ü¼�å­�è£�æ­£ã�������� Flag for mass fix
a_FlagVDiff
Variable :
a_FlagVDiff(:) :logical , save, allocatable
: ���´æ··����§»æµ�è¨�ç®��������� Flag for vertical diffusion
module_name
Constant :
module_name = ‘composition :character(*), parameter
: �¢ã�¸ã�¥ã�¼ã������ç§�. Module name
version
Constant :
version = ’$Name: $’ // ’$Id: composition.f90,v 1.6 2012/09/08 15:25:53 yot Exp $’ :character(*), parameter
: �¢ã�¸ã�¥ã�¼ã�������¼ã�¸ã�§ã�� Module version