Linux  R2.6.5-7.282-sn2 FORTRAN90/SX         Rev.360        Tue Oct 11 12:33:23 2011
FILE NAME: namelist_util.f90
PROGRAM NAME: namelist_util
DIAGNOSTIC LIST

  LINE  LEVEL( NO.): DIAGNOSTIC MESSAGE

   283  vec  (   4): Vectorized array expression.
   283  vec  (   4): Vectorized array expression.
   284  vec  (   4): Vectorized array expression.
Linux  R2.6.5-7.282-sn2 FORTRAN90/SX         Rev.360        Tue Oct 11 12:33:23 2011
FILE NAME: namelist_util.f90
PROGRAM NAME: namelist_util
TRANSFORMATION LIST

  LINE                   FORTRAN STATEMENT

     1  != NAMELIST ファイル入力に関するユーティリティ
     2  !
     3  != Utilities for NAMELIST file input
     4  !
     5  ! Authors::   Yoshiyuki O. Takahashi, Yasuhiro MORIKAWA
     6  ! Version::   $Id: namelist_util.f90,v 1.1 2011-06-17 19:05:23 sugiyama Exp $
     7  ! Tag Name::  $Name: arare5-20111010 $
     8  ! Copyright:: Copyright (C) GFD Dennou Club, 2008. All rights reserved.
     9  ! License::   See COPYRIGHT[link:../../../COPYRIGHT]
    10  !
    11  
    12  module namelist_util
    13    !
    14    != NAMELIST ファイル入力に関するユーティリティ
    15    !
    16    != Utilities for NAMELIST file input
    17    !
    18    ! <b>Note that Japanese and English are described in parallel.</b>
    19    !
    20    !== Variables List
    21    !
    22    ! namelist_filename :: NAMELIST ファイルの名称.
    23    ! MaxNmlArySize     :: NAMELIST から読み込む配列の最大サイズ.
    24    ! ------------      :: ------------
    25    ! namelist_filename :: NAMELIST file name
    26    ! MaxNmlArySize     :: Maximum size of arrays loaded from NAMELIST
    27    !
    28    !== Procedures List
    29    !
    30    ! NmlutilInit      :: NAMELIST ファイル名の設定
    31    ! NmlutilMsg       :: NAMELIST ファイル入力に関するメッセージ表示
    32    ! NmlutilAryValid  :: NAMELIST ファイルから読み込んだ配列の有効性をチェック
    33    ! ------------  :: ------------
    34    ! NmlutilInit      :: Settings of NAMELIST file name
    35    ! NmlutilMsg       :: Print messages about NAMELIST file input
    36    ! NmlutilAryValid  :: Check validation of arrays loaded from NAMELIST file
    37  
    38    ! モジュール引用 ; USE statements
    39    !
    40  
    41    ! 種別型パラメタ
    42    ! Kind type parameter
    43    !
    44    use dc_types, only: STRING  ! 文字列. Strings.
    45  
    46    ! メッセージ出力
    47    ! Message output
    48    !
    49    use dc_message, only: MessageNotify
    50  
    51    ! 宣言文 ; Declaration statements
    52    !
    53    implicit none
    54    private
    55  
    56    ! 公開手続き
    57    ! Public procedure
    58    !
    59    public:: NmlutilInit, NmlutilMsg, NmlutilAryValid
    60  
    61    ! 公開変数
    62    ! Public variables
    63    !
    64    logical, save, public:: namelist_util_inited = .false.
    65                                ! 初期設定フラグ.
    66                                ! Initialization flag
    67    character(STRING), save, public:: namelist_filename = ''
    68                                ! NAMELIST ファイルの名称.
    69                                ! NAMELIST file name
    70  
    71    integer, parameter, public:: MaxNmlArySize = 256
    72                                ! NAMELIST から読み込む配列の最大サイズ.
    73                                ! Maximum size of arrays loaded from NAMELIST
    74  
    75    ! 非公開変数
    76    ! Private variables
    77    !
    78  
    79    !  NAMELIST 変数群
    80    !  NAMELIST group name
    81    !
    82  !!$  namelist /namelist_util_nml/ MaxNmlArySize
    83  
    84    character(*), parameter:: module_name = 'namelist_util'
    85                                ! モジュールの名称.
    86                                ! Module name
    87    character(*), parameter:: version = &
    88      & '$Name: arare5-20111010 $' // &
    89      & '$Id: namelist_util.f90,v 1.1 2011-06-17 19:05:23 sugiyama Exp $'
    90                                ! モジュールのバージョン
    91                                ! Module version
    92  
    93  contains
    94  
    95    subroutine NmlutilInit(  &
    96      & namelist_filename_in & ! (in)
    97      & )
    98      !
    99      ! namelist_util モジュールの初期設定を行います.
   100      !
   101      ! Initialize "namelist_util" module.
   102      !
   103  
   104      ! モジュール引用 ; USE statements
   105      !
   106  
   107      ! ファイル入出力補助
   108      ! File I/O support
   109      !
   110      use dc_iounit, only: FileOpen
   111  
   112      ! 宣言文 ; Declaration statements
   113      !
   114      implicit none
   115  
   116      character(*), intent(in ) :: namelist_filename_in
   117                                ! NAMELIST ファイルの名称.
   118                                ! NAMELIST file name
   119  
   120  !!$    integer:: unit_nml        ! NAMELIST ファイルオープン用装置番号.
   121  !!$                              ! Unit number for NAMELIST file open
   122  !!$    integer:: iostat_nml      ! NAMELIST 読み込み時の IOSTAT.
   123  !!$                              ! IOSTAT of NAMELIST read
   124  
   125      ! 実行文 ; Executable statement
   126      !
   127  
   128      if ( namelist_util_inited ) return
   129      namelist_filename = namelist_filename_in
   130  
   131      ! NAMELIST の読み込み
   132      ! NAMELIST is input
   133      !
   134  !!$    call FileOpen( unit_nml, &          ! (out)
   135  !!$      & namelist_filename, mode = 'r' ) ! (in)
   136  !!$
   137  !!$    rewind( unit_nml )
   138  !!$    read( unit_nml, &               ! (in)
   139  !!$      & nml = namelist_util_nml, &  ! (out)
   140  !!$      & iostat = iostat_nml )       ! (out)
   141  !!$    close( unit_nml )
   142  !!$
   143  !!$    call NmlutilMsg( iostat_nml, module_name ) ! (in)
   144  
   145      ! 印字 ; Print
   146      !
   147      call MessageNotify( 'M', module_name, '----- Initialization Messages -----' )
   148      call MessageNotify( 'M', module_name, '  MaxNmlArySize = %d', i = (/ MaxNmlArySize /) )
   149      call MessageNotify( 'M', module_name, '-- version = %c', c1 = trim(version) )
   150  
   151      namelist_util_inited = .true.
   152    end subroutine NmlutilInit
   153  
   154    subroutine NmlutilMsg( iostat, name & ! (in)
   155      & )
   156      !
   157      ! NAMELIST ファイル入力ステータスから
   158      ! 適切なメッセージを表示します.
   159      !
   160      ! Appropriate messages are output from
   161      ! status of NAMELIST file loading.
   162      !
   163  
   164      implicit none
   165      integer, intent(in):: iostat
   166                                ! NAMELIST 読み込み時のステータス.
   167                                ! Status of NAMELIST loading
   168      character(*), intent(in):: name
   169                                ! モジュールの名称.
   170                                ! Module name
   171  
   172      ! 実行文 ; Executable statement
   173      !
   174  
   175      if ( iostat == 0 ) then
   176        call MessageNotify( 'M', name, &
   177          & 'NAMELIST group "%c" is loaded from "%c".', &
   178          & c1 = trim(name) // '_nml', &
   179          & c2 = trim(namelist_filename) )
   180      else
   181        call MessageNotify( 'W', name, &
   182          & 'NAMELIST group "%c" is not found in "%c" (iostat=%d).', &
   183          & c1 = trim(name) // '_nml', &
   184          & c2 = trim(namelist_filename), &
   185          & i = (/iostat/) )
   186      end if
   187    end subroutine NmlutilMsg
   188  
   189    subroutine NmlutilAryValid( name, &               ! (in)
   190      & array, array_name, need_num, need_num_name, & ! (in)
   191      & valid_limit &                                 ! (in) optional
   192      )
   193      !
   194      ! NAMELIST から読み込んだ配列型データの妥当性を
   195      ! チェックします.
   196      !
   197      ! デフォルトでは, 正の値を有効と扱います.
   198      ! 無効であると検証された場合には, エラーを発生させます.
   199      !
   200      ! Check validation of array data loaded from NAMELIST.
   201      !
   202      ! By defaut, positive values are treated as valid values.
   203      ! If invalidation is checked, an error is occurred.
   204      !
   205  
   206      ! モジュール引用 ; USE statements
   207      !
   208  
   209      ! 種別型パラメタ
   210      ! Kind type parameter
   211      !
   212      use dc_types, only: DP      ! 倍精度実数型. Double precision.
   213  
   214      ! 宣言文 ; Declaration statements
   215      !
   216      implicit none
   217      character(*), intent(in):: name
   218                                ! このサブルーチンを呼び出すモジュールの名称.
   219                                ! Module name calling this subroutine
   220      real(DP), intent(in):: array(:)
   221                                ! 検証すべき配列データ.
   222                                ! Checked array data
   223      character(*), intent(in):: array_name
   224                                ! 検証すべき配列データの名前.
   225                                ! Name of checked array data
   226      integer, intent(in):: need_num
   227                                ! 必要なデータ数.
   228                                ! 0 未満の数を与えるとエラーを生じます.
   229                                !
   230                                ! Number of needed data.
   231                                ! If number less than 0, an error is occurred.
   232      character(*), intent(in):: need_num_name
   233                                ! 必要なデータ数を示す変数の名前.
   234                                ! Name of a variable that indicates number of needed data
   235      real(DP), intent(in), optional:: valid_limit
   236                                ! 有効下限値 (デフォルトは 0.0).
   237                                ! Lower limit of validation (defalt is 0.0)
   238  
   239      ! 作業変数
   240      ! Work variables
   241      !
   242      real(DP):: valid_limit_work
   243                                ! 有効下限値 (デフォルトは 0.0).
   244                                ! Lower limit of validation (defalt is 0.0)
   245      integer:: valid_count     ! 配列データの有効値の数.
   246                                ! Number of valid values in an array
   247      integer:: size_array      ! 配列データのサイズ
   248                                ! Size of array data
   249  
   250      ! 実行文 ; Executable statement
   251      !
   252  
   253      ! need_num が負ではないことをチェック
   254      ! Check that "need_num" is not negative
   255      !
   256      if ( need_num < 0 ) then
   257        call MessageNotify( 'E', name, '%c=<%d> must not be negative.', &
   258          &                 c1 = trim(need_num_name), i = (/ need_num /) )
   259      end if
   260  
   261      ! array のサイズが十分であることをチェック
   262      ! Check that size of "array" is enough
   263      !
   264      size_array = size(array)
   265      if ( need_num > size_array ) then
   266        call MessageNotify( 'E', name, &
   267          &  'Maximum size=<%d> of "%c" is too smaller than %c=<%d>. ' // &
   268          &  'Please search for a statement "MaxNmlArySize = %d" in ' // &
   269          &  '"namelist_util.f90", and change it into "MaxNmlArySize = %d".', &
   270  !!$        &  'Please add a following phrase to NAMELIST file. ' // &
   271  !!$        &  ' "&namelist_util_nml  MaxNmlArySize=%d /"', &
   272          &  i = (/ size_array, need_num, MaxNmlArySize, need_num /), &
   273          &  c1 = trim(array_name), c2 = trim(need_num_name) )
   274      end if
   275  
   276      ! array をチェック
   277      ! Check "array"
   278      !
   279      if ( need_num > 0 ) then
   280        valid_limit_work = 0.0_DP
   281        if ( present( valid_limit ) ) valid_limit_work = valid_limit
   282  
   283        if ( any( array(1:need_num) < valid_limit_work ) ) then
   284          valid_count = count( .not. ( array(1:need_num) < valid_limit_work ) )
   285          if ( valid_count > 0 ) then
   286            call MessageNotify( 'E', name, &
   287              &   'Number of valid data of %c=<%*f> is %d. ' // &
   288              &   'Valid data is %c=<%d> necessary.', &
   289              &   c1 = trim( array_name ), c2 = trim( need_num_name ), &
   290              &   d = array(1:valid_count), n = (/ valid_count /), &
   291              &   i = (/ valid_count, need_num /) )
   292          else
   293            call MessageNotify( 'E', name, &
   294              &   'Valid data of %c is nothing. ' // &
   295              &   'Valid data is %c=<%d> necessary.', &
   296              &   c1 = trim( array_name ), c2 = trim( need_num_name ), &
   297              &   i = (/ need_num /) )
   298          end if
   299        end if
   300      end if
   301  
   302    end subroutine NmlutilAryValid
   303  
   304  end module namelist_util
Linux  R2.6.5-7.282-sn2 FORTRAN90/SX         Rev.360        Tue Oct 11 12:33:23 2011
FILE NAME: namelist_util.f90
PROGRAM NAME: namelist_util
FORMAT LIST

  LINE    LOOP     FORTRAN STATEMENT

     1:            != NAMELIST ファイル入力に関するユーティリティ
     2:            !
     3:            != Utilities for NAMELIST file input
     4:            !
     5:            ! Authors::   Yoshiyuki O. Takahashi, Yasuhiro MORIKAWA
     6:            ! Version::   $Id: namelist_util.f90,v 1.1 2011-06-17 19:05:23 sugiyama Exp $ 
     7:            ! Tag Name::  $Name: arare5-20111010 $
     8:            ! Copyright:: Copyright (C) GFD Dennou Club, 2008. All rights reserved.
     9:            ! License::   See COPYRIGHT[link:../../../COPYRIGHT]
    10:            !
    11:            
    12:            module namelist_util
    13:              !
    14:              != NAMELIST ファイル入力に関するユーティリティ
    15:              !
    16:              != Utilities for NAMELIST file input
    17:              !
    18:              ! <b>Note that Japanese and English are described in parallel.</b>
    19:              !
    20:              !== Variables List
    21:              !
    22:              ! namelist_filename :: NAMELIST ファイルの名称. 
    23:              ! MaxNmlArySize     :: NAMELIST から読み込む配列の最大サイズ. 
    24:              ! ------------      :: ------------
    25:              ! namelist_filename :: NAMELIST file name
    26:              ! MaxNmlArySize     :: Maximum size of arrays loaded from NAMELIST
    27:              !
    28:              !== Procedures List
    29:              !
    30:              ! NmlutilInit      :: NAMELIST ファイル名の設定
    31:              ! NmlutilMsg       :: NAMELIST ファイル入力に関するメッセージ表示
    32:              ! NmlutilAryValid  :: NAMELIST ファイルから読み込んだ配列の有効性をチェック
    33:              ! ------------  :: ------------
    34:              ! NmlutilInit      :: Settings of NAMELIST file name
    35:              ! NmlutilMsg       :: Print messages about NAMELIST file input
    36:              ! NmlutilAryValid  :: Check validation of arrays loaded from NAMELIST file
    37:            
    38:              ! モジュール引用 ; USE statements
    39:              !
    40:            
    41:              ! 種別型パラメタ
    42:              ! Kind type parameter
    43:              !
    44:              use dc_types, only: STRING  ! 文字列. Strings. 
    45:            
    46:              ! メッセージ出力
    47:              ! Message output
    48:              !
    49:              use dc_message, only: MessageNotify
    50:            
    51:              ! 宣言文 ; Declaration statements
    52:              !
    53:              implicit none
    54:              private
    55:            
    56:              ! 公開手続き
    57:              ! Public procedure
    58:              !
    59:              public:: NmlutilInit, NmlutilMsg, NmlutilAryValid
    60:            
    61:              ! 公開変数
    62:              ! Public variables
    63:              !
    64:              logical, save, public:: namelist_util_inited = .false.
    65:                                          ! 初期設定フラグ. 
    66:                                          ! Initialization flag
    67:              character(STRING), save, public:: namelist_filename = ''
    68:                                          ! NAMELIST ファイルの名称. 
    69:                                          ! NAMELIST file name
    70:            
    71:              integer, parameter, public:: MaxNmlArySize = 256
    72:                                          ! NAMELIST から読み込む配列の最大サイズ. 
    73:                                          ! Maximum size of arrays loaded from NAMELIST
    74:            
    75:              ! 非公開変数
    76:              ! Private variables
    77:              !
    78:            
    79:              !  NAMELIST 変数群
    80:              !  NAMELIST group name
    81:              !
    82:            !!$  namelist /namelist_util_nml/ MaxNmlArySize
    83:            
    84:              character(*), parameter:: module_name = 'namelist_util'
    85:                                          ! モジュールの名称. 
    86:                                          ! Module name
    87:              character(*), parameter:: version = &
    88:                & '$Name: arare5-20111010 $' // &
    89:                & '$Id: namelist_util.f90,v 1.1 2011-06-17 19:05:23 sugiyama Exp $'
    90:                                          ! モジュールのバージョン
    91:                                          ! Module version
    92:            
    93:            contains
    94:            
    95:              subroutine NmlutilInit(  &
    96:                & namelist_filename_in & ! (in)
    97:                & )
    98:                !
    99:                ! namelist_util モジュールの初期設定を行います. 
   100:                !
   101:                ! Initialize "namelist_util" module. 
   102:                !
   103:            
   104:                ! モジュール引用 ; USE statements
   105:                !
   106:            
   107:                ! ファイル入出力補助
   108:                ! File I/O support
   109:                !
   110:                use dc_iounit, only: FileOpen
   111:            
   112:                ! 宣言文 ; Declaration statements
   113:                !
   114:                implicit none
   115:            
   116:                character(*), intent(in ) :: namelist_filename_in
   117:                                          ! NAMELIST ファイルの名称. 
   118:                                          ! NAMELIST file name
   119:            
   120:            !!$    integer:: unit_nml        ! NAMELIST ファイルオープン用装置番号. 
   121:            !!$                              ! Unit number for NAMELIST file open
   122:            !!$    integer:: iostat_nml      ! NAMELIST 読み込み時の IOSTAT. 
   123:            !!$                              ! IOSTAT of NAMELIST read
   124:            
   125:                ! 実行文 ; Executable statement
   126:                !
   127:            
   128:                if ( namelist_util_inited ) return
   129:                namelist_filename = namelist_filename_in
   130:            
   131:                ! NAMELIST の読み込み
   132:                ! NAMELIST is input
   133:                !
   134:            !!$    call FileOpen( unit_nml, &          ! (out)
   135:            !!$      & namelist_filename, mode = 'r' ) ! (in)
   136:            !!$
   137:            !!$    rewind( unit_nml )
   138:            !!$    read( unit_nml, &               ! (in)
   139:            !!$      & nml = namelist_util_nml, &  ! (out)
   140:            !!$      & iostat = iostat_nml )       ! (out)
   141:            !!$    close( unit_nml )
   142:            !!$
   143:            !!$    call NmlutilMsg( iostat_nml, module_name ) ! (in)
   144:            
   145:                ! 印字 ; Print
   146:                !
   147:                call MessageNotify( 'M', module_name, '----- Initialization Messages -----' )
   148:                call MessageNotify( 'M', module_name, '  MaxNmlArySize = %d', i = (/ MaxNmlArySize /) )
   149:                call MessageNotify( 'M', module_name, '-- version = %c', c1 = trim(version) )
   150:            
   151:                namelist_util_inited = .true.
   152:              end subroutine NmlutilInit
   153:            
   154:              subroutine NmlutilMsg( iostat, name & ! (in)
   155:                & )
   156:                !
   157:                ! NAMELIST ファイル入力ステータスから
   158:                ! 適切なメッセージを表示します. 
   159:                !
   160:                ! Appropriate messages are output from 
   161:                ! status of NAMELIST file loading. 
   162:                !
   163:            
   164:                implicit none
   165:                integer, intent(in):: iostat
   166:                                          ! NAMELIST 読み込み時のステータス. 
   167:                                          ! Status of NAMELIST loading
   168:                character(*), intent(in):: name
   169:                                          ! モジュールの名称. 
   170:                                          ! Module name
   171:            
   172:                ! 実行文 ; Executable statement
   173:                !
   174:            
   175:                if ( iostat == 0 ) then
   176:                  call MessageNotify( 'M', name, &
   177:                    & 'NAMELIST group "%c" is loaded from "%c".', &
   178:                    & c1 = trim(name) // '_nml', &
   179:                    & c2 = trim(namelist_filename) )
   180:                else
   181:                  call MessageNotify( 'W', name, &
   182:                    & 'NAMELIST group "%c" is not found in "%c" (iostat=%d).', &
   183:                    & c1 = trim(name) // '_nml', &
   184:                    & c2 = trim(namelist_filename), &
   185:                    & i = (/iostat/) )
   186:                end if
   187:              end subroutine NmlutilMsg
   188:            
   189:              subroutine NmlutilAryValid( name, &               ! (in)
   190:                & array, array_name, need_num, need_num_name, & ! (in)
   191:                & valid_limit &                                 ! (in) optional
   192:                )
   193:                !
   194:                ! NAMELIST から読み込んだ配列型データの妥当性を
   195:                ! チェックします. 
   196:                ! 
   197:                ! デフォルトでは, 正の値を有効と扱います. 
   198:                ! 無効であると検証された場合には, エラーを発生させます. 
   199:                ! 
   200:                ! Check validation of array data loaded from NAMELIST. 
   201:                !
   202:                ! By defaut, positive values are treated as valid values.
   203:                ! If invalidation is checked, an error is occurred. 
   204:                ! 
   205:            
   206:                ! モジュール引用 ; USE statements
   207:                !
   208:            
   209:                ! 種別型パラメタ
   210:                ! Kind type parameter
   211:                !
   212:                use dc_types, only: DP      ! 倍精度実数型. Double precision. 
   213:            
   214:                ! 宣言文 ; Declaration statements
   215:                !
   216:                implicit none
   217:                character(*), intent(in):: name
   218:                                          ! このサブルーチンを呼び出すモジュールの名称. 
   219:                                          ! Module name calling this subroutine
   220:                real(DP), intent(in):: array(:)
   221:                                          ! 検証すべき配列データ. 
   222:                                          ! Checked array data 
   223:                character(*), intent(in):: array_name
   224:                                          ! 検証すべき配列データの名前. 
   225:                                          ! Name of checked array data 
   226:                integer, intent(in):: need_num
   227:                                          ! 必要なデータ数. 
   228:                                          ! 0 未満の数を与えるとエラーを生じます. 
   229:                                          ! 
   230:                                          ! Number of needed data. 
   231:                                          ! If number less than 0, an error is occurred. 
   232:                character(*), intent(in):: need_num_name
   233:                                          ! 必要なデータ数を示す変数の名前. 
   234:                                          ! Name of a variable that indicates number of needed data
   235:                real(DP), intent(in), optional:: valid_limit
   236:                                          ! 有効下限値 (デフォルトは 0.0). 
   237:                                          ! Lower limit of validation (defalt is 0.0) 
   238:            
   239:                ! 作業変数
   240:                ! Work variables
   241:                !
   242:                real(DP):: valid_limit_work
   243:                                          ! 有効下限値 (デフォルトは 0.0). 
   244:                                          ! Lower limit of validation (defalt is 0.0) 
   245:                integer:: valid_count     ! 配列データの有効値の数. 
   246:                                          ! Number of valid values in an array
   247:                integer:: size_array      ! 配列データのサイズ
   248:                                          ! Size of array data
   249:            
   250:                ! 実行文 ; Executable statement
   251:                !
   252:            
   253:                ! need_num が負ではないことをチェック
   254:                ! Check that "need_num" is not negative 
   255:                !
   256:                if ( need_num < 0 ) then
   257:                  call MessageNotify( 'E', name, '%c=<%d> must not be negative.', &
   258:                    &                 c1 = trim(need_num_name), i = (/ need_num /) )
   259:                end if
   260:            
   261:                ! array のサイズが十分であることをチェック
   262:                ! Check that size of "array" is enough
   263:                !
   264:                size_array = size(array)
   265:                if ( need_num > size_array ) then
   266:                  call MessageNotify( 'E', name, &
   267:                    &  'Maximum size=<%d> of "%c" is too smaller than %c=<%d>. ' // &
   268:                    &  'Please search for a statement "MaxNmlArySize = %d" in ' // &
   269:                    &  '"namelist_util.f90", and change it into "MaxNmlArySize = %d".', &
   270:            !!$        &  'Please add a following phrase to NAMELIST file. ' // &
   271:            !!$        &  ' "&namelist_util_nml  MaxNmlArySize=%d /"', &
   272:                    &  i = (/ size_array, need_num, MaxNmlArySize, need_num /), &
   273:                    &  c1 = trim(array_name), c2 = trim(need_num_name) )
   274:                end if
   275:            
   276:                ! array をチェック
   277:                ! Check "array"
   278:                !
   279:                if ( need_num > 0 ) then
   280:                  valid_limit_work = 0.0_DP
   281:                  if ( present( valid_limit ) ) valid_limit_work = valid_limit
   282:            
   283: V======          if ( any( array(1:need_num) < valid_limit_work ) ) then
   284: V======            valid_count = count( .not. ( array(1:need_num) < valid_limit_work ) )
   285:                    if ( valid_count > 0 ) then
   286:                      call MessageNotify( 'E', name, &
   287:                        &   'Number of valid data of %c=<%*f> is %d. ' // &
   288:                        &   'Valid data is %c=<%d> necessary.', &
   289:                        &   c1 = trim( array_name ), c2 = trim( need_num_name ), &
   290:                        &   d = array(1:valid_count), n = (/ valid_count /), &
   291:                        &   i = (/ valid_count, need_num /) )
   292:                    else
   293:                      call MessageNotify( 'E', name, &
   294:                        &   'Valid data of %c is nothing. ' // &
   295:                        &   'Valid data is %c=<%d> necessary.', &
   296:                        &   c1 = trim( array_name ), c2 = trim( need_num_name ), &
   297:                        &   i = (/ need_num /) )
   298:                    end if
   299:                  end if
   300:                end if
   301:            
   302:              end subroutine NmlutilAryValid
   303:            
   304:            end module namelist_util
