| Class | phy_radiation_flux |
| In: |
physics/phy_radiation_flux.f90
|
Note that Japanese and English are described in parallel.
温度, 比湿, 気圧から, 放射フラックスを計算します.
Calculate radiation flux from temperature, specific humidity, and air pressure.
| PhyRadFluxCreate : | PHYRADFLX 型変数の初期設定 |
| RadiationFlux : | 放射フラックスの計算 |
| RadiationDTempDt : | 放射フラックスによる温度変化の計算 |
| PhyRadFluxClose : | PHYRADFLX 型変数の終了処理 |
| PhyRadFluxPutLine : | PHYRADFLX 型変数に格納されている情報の印字 |
| PhyRadFluxInitialized : | PHYRADFLX 型変数が初期設定されているか否か |
| ———— : | ———— |
| PhyRadFluxCreate : | Constructor of "PHYRADFLX" |
| RadiationFlux : | Calculate radiation flux |
| RadiationDTempDt : | Calculate temperature tendency with radiation flux |
| PhyRadFluxClose : | Deconstructor of "PHYRADFLX" |
| PhyRadFluxPutLine : | Print information of "PHYRADFLX" |
| PhyRadFluxInitialized : | Check initialization of "PHYRADFLX" |
始めに, PHYRADFLX 型の変数を定義し, PhyRadFluxCreate で初期設定を行います. RadiationFlux を用いて放射フラックスを, RadiationDTempDt によって放射フラックスによる温度変化を計算します. PHYRADFLX 型の変数の終了処理には PhyRadFluxClose を用いてください.
First, initialize "PHYRADFLX" by "PhyRadFluxCreate". Calculate radiation flux by "RadiationFlux". And calculate temperature tendency with radiation flux by "RadiationFlux". In order to terminate "PHYRADFLX", use "PhyRadFluxClose".
| Derived Type : | |||
| initialized = .false. : | logical
| ||
| imax : | integer
| ||
| jmax : | integer
| ||
| kmax : | integer
| ||
| Grav : | real(DP)
| ||
| Cp : | real(DP)
| ||
| StB : | real(DP)
| ||
| y_Lat(:) =>null() : | real(DP), pointer
| ||
| xy_SurfTemp(:,:) =>null() : | real(DP), pointer
| ||
| xy_SurfAlbedo(:,:) =>null() : | real(DP), pointer
| ||
| current_time : | type(DC_DIFFTIME)
| ||
| delta_time : | type(DC_DIFFTIME)
| ||
| save_flag : | logical
| ||
| delta_time_RadLong : | type(DC_DIFFTIME)
| ||
| delta_time_value_RadLong : | real(DP)
| ||
| delta_time_unit_RadLong : | character(STRING)
| ||
| LongBandNumber = 4 : | integer
| ||
| LongAbsorpCoeffQVap(:) =>null() : | real(DP), pointer
| ||
| LongAbsorpCoeffDryAir(:) =>null() : | real(DP), pointer
| ||
| LongBandWeight(:) =>null() : | real(DP), pointer
| ||
| LongPathLengthFact = 1.5_DP : | real(DP)
| ||
| xy_TempSave(:,:) =>null() : | real(DP), pointer
| ||
| xyr_RadLFluxSave(:,:,:) =>null() : | real(DP), pointer
| ||
| xyra_DelRadLFluxSave(:,:,:,:) =>null() : | real(DP), pointer
| ||
| delta_time_RadShort : | type(DC_DIFFTIME)
| ||
| delta_time_value_RadShort : | real(DP)
| ||
| delta_time_unit_RadShort : | character(STRING)
| ||
| ShortBandNumber = 1 : | integer
| ||
| ShortAbsorpCoeffQVap(:) =>null() : | real(DP), pointer
| ||
| ShortAbsorpCoeffDryAir(:) =>null() : | real(DP), pointer
| ||
| ShortBandWeight(:) =>null() : | real(DP), pointer
| ||
| ShortSecScat = 1.66_DP : | real(DP)
| ||
| xyr_RadSFluxSave(:,:,:) =>null() : | real(DP), pointer
| ||
| SolarCoeff = 1380.0_DP : | real(DP)
| ||
| AtmosAlbedo = 0.2_DP : | real(DP)
| ||
| IncomAIns = 0.127_DP : | real(DP)
| ||
| IncomBIns = 0.183_DP : | real(DP)
| ||
| IncomAZet = 0.410_DP : | real(DP)
| ||
| IncomBZet = 0.590_DP : | real(DP)
| ||
| xy_IncomRadSFlux(:,:) =>null() : | real(DP), pointer
| ||
| xy_InAngle(:,:) =>null() : | real(DP), pointer
|
まず, PhyRadFluxCreate で "PHYRADFLX" 型の変数を初期設定して下さい. 初期設定された "PHYRADFLX" 型の変数を再度利用する際には, PhyRadFluxClose によって終了処理を行ってください.
Initialize "PHYRADFLX" variable by "PhyRadFluxCreate" before usage. If you reuse "PHYRADFLX" variable again for another application, terminate by "PhyRadFluxClose".
| Subroutine : | |||
| phy_radflx : | type(PHYRADFLX), intent(inout) | ||
| err : | logical, intent(out), optional
|
PHYRADFLX 型の変数の終了処理を行います. なお, 与えられた phy_radflx が PhyRadFluxCreate によって初期設定 されていない場合, プログラムはエラーを発生させます.
Deconstructor of "PHYRADFLX". Note that if phy_radflx is not initialized by "PhyRadFluxCreate" yet, error is occurred.
subroutine PhyRadFluxClose( phy_radflx, err )
!
! PHYRADFLX 型の変数の終了処理を行います.
! なお, 与えられた *phy_radflx* が PhyRadFluxCreate によって初期設定
! されていない場合, プログラムはエラーを発生させます.
!
! Deconstructor of "PHYRADFLX".
! Note that if *phy_radflx* is not initialized by "PhyRadFluxCreate" yet,
! error is occurred.
!
use dc_trace, only: BeginSub, EndSub
use dc_string, only: PutLine, Printf
use dc_types, only: DP, STRING, TOKEN, STDOUT
use dc_error, only: StoreError, DC_NOERR, DC_ENOTINIT
implicit none
type(PHYRADFLX), intent(inout):: phy_radflx
logical, intent(out), optional:: err
! 例外処理用フラグ.
! デフォルトでは, この手続き内でエラーが
! 生じた場合, プログラムは強制終了します.
! 引数 *err* が与えられる場合,
! プログラムは強制終了せず, 代わりに
! *err* に .true. が代入されます.
!
! Exception handling flag.
! By default, when error occur in
! this procedure, the program aborts.
! If this *err* argument is given,
! .true. is substituted to *err* and
! the program does not abort.
!-----------------------------------
! 作業変数
! Work variables
integer:: stat
character(STRING):: cause_c
character(*), parameter:: subname = 'PhyRadFluxClose'
continue
call BeginSub( subname )
stat = DC_NOERR
cause_c = ''
!-----------------------------------------------------------------
! 初期設定のチェック
! Check initialization
!-----------------------------------------------------------------
if ( .not. phy_radflx % initialized ) then
stat = DC_ENOTINIT
cause_c = 'PHYRADFLX'
goto 999
end if
!-----------------------------------------------------------------
! "PHYRADFLX" の設定の消去
! Clear the settings for "PHYRADFLX"
!-----------------------------------------------------------------
deallocate( phy_radflx % y_Lat )
deallocate( phy_radflx % xy_SurfTemp )
deallocate( phy_radflx % xy_SurfAlbedo )
deallocate( phy_radflx % xy_TempSave )
deallocate( phy_radflx % xyr_RadLFluxSave )
deallocate( phy_radflx % xyra_DelRadLFluxSave )
deallocate( phy_radflx % LongAbsorpCoeffQVap )
deallocate( phy_radflx % LongAbsorpCoeffDryAir )
deallocate( phy_radflx % LongBandWeight )
deallocate( phy_radflx % xyr_RadSFluxSave )
deallocate( phy_radflx % xy_IncomRadSFlux )
deallocate( phy_radflx % xy_InAngle )
!-----------------------------------------------------------------
! 終了処理, 例外処理
! Termination and Exception handling
!-----------------------------------------------------------------
phy_radflx % initialized = .false.
999 continue
call StoreError( stat, subname, err, cause_c )
call EndSub( subname )
end subroutine PhyRadFluxClose
| Subroutine : | |||
| phy_radflx : | type(PHYRADFLX), intent(inout) | ||
| imax : | integer, intent(in)
| ||
| jmax : | integer, intent(in)
| ||
| kmax : | integer, intent(in)
| ||
| y_Lat(0:jmax-1) : | real(DP), intent(in)
| ||
| Grav : | real(DP), intent(in)
| ||
| Cp : | real(DP), intent(in)
| ||
| StB : | real(DP), intent(in)
| ||
| xy_SurfTemp(0:imax-1, 0:jmax-1) : | real(DP), intent(in)
| ||
| xy_SurfAlbedo(0:imax-1, 0:jmax-1) : | real(DP), intent(in)
| ||
| current_time_value : | real(DP), intent(in), optional
| ||
| current_time_unit : | character(*), intent(in), optional
| ||
| delta_time_value : | real(DP), intent(in), optional
| ||
| delta_time_unit : | character(*), intent(in), optional
| ||
| delta_time_value_RadLong : | real(DP), intent(in), optional
| ||
| delta_time_unit_RadLong : | character(*), intent(in), optional
| ||
| delta_time_value_RadShort : | real(DP), intent(in), optional
| ||
| delta_time_unit_RadShort : | character(*), intent(in), optional
| ||
| LongBandNumber : | integer, intent(in), optional
| ||
| LongAbsorpCoeffQVap(:) : | real(DP), intent(in), optional
| ||
| LongAbsorpCoeffDryAir(:) : | real(DP), intent(in), optional
| ||
| LongBandWeight(:) : | real(DP), intent(in), optional
| ||
| LongPathLengthFact : | real(DP), intent(in), optional
| ||
| ShortBandNumber : | integer, intent(in), optional
| ||
| ShortAbsorpCoeffQVap(:) : | real(DP), intent(in), optional
| ||
| ShortAbsorpCoeffDryAir(:) : | real(DP), intent(in), optional
| ||
| ShortBandWeight(:) : | real(DP), intent(in), optional
| ||
| ShortSecScat : | real(DP), intent(in), optional
| ||
| SolarCoeff : | real(DP), intent(in), optional
| ||
| AtmosAlbedo : | real(DP), intent(in), optional
| ||
| IncomAIns : | real(DP), intent(in), optional
| ||
| IncomBIns : | real(DP), intent(in), optional
| ||
| IncomAZet : | real(DP), intent(in), optional
| ||
| IncomBZet : | real(DP), intent(in), optional
| ||
| nmlfile : | character(*), intent(in), optional
| ||
| err : | logical, intent(out), optional
|
PHYRADFLX 型の変数の初期設定を行います. 他のサブルーチンを使用する前に必ずこのサブルーチンによって PHYRADFLX 型の変数を初期設定してください.
なお, 与えられた phy_radflx が既に初期設定されている場合, プログラムはエラーを発生させます.
NAMELIST を利用する場合には引数 nmlfile に NAMELIST ファイル名 を与えてください. NAMELIST 変数群の詳細に関しては NAMELIST#phy_radiation_flux_nml を参照してください.
Constructor of "PHYRADFLX". Initialize phy_radflx by this subroutine, before other procedures are used,
Note that if phy_radflx is already initialized by this procedure, error is occurred.
In order to use NAMELIST, specify a NAMELIST filename to argument nmlfile. See "NAMELIST#phy_radiation_flux_nml" for details about a NAMELIST group.
subroutine PhyRadFluxCreate( phy_radflx, imax, jmax, kmax, y_Lat, Grav, Cp, StB, xy_SurfTemp, xy_SurfAlbedo, current_time_value, current_time_unit, delta_time_value, delta_time_unit, delta_time_value_RadLong, delta_time_unit_RadLong, delta_time_value_RadShort, delta_time_unit_RadShort, LongBandNumber, LongAbsorpCoeffQVap, LongAbsorpCoeffDryAir, LongBandWeight, LongPathLengthFact, ShortBandNumber, ShortAbsorpCoeffQVap, ShortAbsorpCoeffDryAir, ShortBandWeight, ShortSecScat, SolarCoeff, AtmosAlbedo, IncomAIns, IncomBIns, IncomAZet, IncomBZet, nmlfile, err )
!
! PHYRADFLX 型の変数の初期設定を行います.
! 他のサブルーチンを使用する前に必ずこのサブルーチンによって
! PHYRADFLX 型の変数を初期設定してください.
!
! なお, 与えられた *phy_radflx* が既に初期設定されている場合,
! プログラムはエラーを発生させます.
!
! NAMELIST を利用する場合には引数 *nmlfile* に NAMELIST ファイル名
! を与えてください. NAMELIST 変数群の詳細に関しては
! NAMELIST#phy_radiation_flux_nml を参照してください.
!
! Constructor of "PHYRADFLX".
! Initialize *phy_radflx* by this subroutine,
! before other procedures are used,
!
! Note that if *phy_radflx* is already initialized
! by this procedure, error is occurred.
!
! In order to use NAMELIST, specify a NAMELIST filename to
! argument *nmlfile*. See "NAMELIST#phy_radiation_flux_nml"
! for details about a NAMELIST group.
!
use dc_trace, only: BeginSub, EndSub
use dc_string, only: PutLine, Printf
use dc_types, only: DP, STRING, TOKEN, STDOUT
use dc_present, only: present_and_not_empty, present_and_true
use dc_message, only: MessageNotify
use dc_error, only: DC_NOERR, DC_EALREADYINIT, DC_EARGLACK, DC_ENEGATIVE, DC_ENOFILEREAD
use dc_date, only: DCDiffTimeCreate
use dcpam_error, only: StoreError, DCPAM_ENMLARRAYINSUFF
implicit none
type(PHYRADFLX), intent(inout):: phy_radflx
integer, intent(in):: imax ! 経度格子点数.
! Number of grid points in longitude
integer, intent(in):: jmax ! 緯度格子点数.
! Number of grid points in latitude
integer, intent(in):: kmax ! 鉛直層数.
! Number of vertical level
real(DP), intent(in):: Grav ! $ g $ . 重力加速度. Gravitational acceleration
real(DP), intent(in):: Cp ! $ C_p $ . 大気定圧比熱. Specific heat of air at constant pressure
real(DP), intent(in):: StB ! $ \sigma_{SB} $ . ステファンボルツマン定数. Stefan-Boltzmann constant
real(DP), intent(in):: y_Lat (0:jmax-1)
! 緯度. Latitude
real(DP), intent(in):: xy_SurfTemp (0:imax-1, 0:jmax-1)
! 地表面温度.
! Surface temperature
real(DP), intent(in):: xy_SurfAlbedo (0:imax-1, 0:jmax-1)
! 地表アルベド.
! Surface albedo
real(DP), intent(in), optional:: current_time_value
! 現在時刻の値. Value of current time
character(*), intent(in), optional:: current_time_unit
! 現在時刻の単位. Unit of current time
real(DP), intent(in), optional:: delta_time_value
! $ \Delta t $ . タイムステップの値. Value of time step
character(*), intent(in), optional:: delta_time_unit
! タイムステップの単位. Unit of time step
real(DP), intent(in), optional:: delta_time_value_RadLong
! 長波フラックスを計算するステップ間隔の数値.
! Value of step interval of long wave flux calculation
character(*), intent(in), optional:: delta_time_unit_RadLong
! 長波フラックスを計算するステップ間隔の単位.
! Unit of step interval of long wave flux calculation
real(DP), intent(in), optional:: delta_time_value_RadShort
! 短波 (日射) フラックスを計算するステップ間隔の数値.
! Value of step interval of short wave (insolation) flux calculation
character(*), intent(in), optional:: delta_time_unit_RadShort
! 短波 (日射) フラックスを計算するステップ間隔の単位.
! Unit of step interval of short wave (insolation) flux calculation
integer, intent(in), optional:: LongBandNumber
! 長波バンド数.
! Number of long wave band
real(DP), intent(in), optional:: LongAbsorpCoeffQVap(:)
! 水の吸収係数.
! Absorption coefficient of water
real(DP), intent(in), optional:: LongAbsorpCoeffDryAir(:)
! 空気の吸収係数.
! Absorption coefficient of air
real(DP), intent(in), optional:: LongBandWeight(:)
! バンドウェイト.
! Band weight
real(DP), intent(in), optional:: LongPathLengthFact
! 光路長のファクタ.
! Factor of optical length
integer, intent(in), optional:: ShortBandNumber
! 短波バンド数.
! Number of long wave band
real(DP), intent(in), optional:: ShortAbsorpCoeffQVap(:)
! 水の吸収係数.
! Absorption coefficient of water
real(DP), intent(in), optional:: ShortAbsorpCoeffDryAir(:)
! 空気の吸収係数.
! Absorption coefficient of air
real(DP), intent(in), optional:: ShortBandWeight(:)
! バンドウェイト.
! Band weight
real(DP), intent(in), optional:: ShortSecScat
! 散乱の $ sec \zeta $
! $ sec \zeta $ of scattering
real(DP), intent(in), optional:: SolarCoeff
! 太陽定数.
! Solar constant
real(DP), intent(in), optional:: AtmosAlbedo
! 大気アルベド.
! Albedo of air
!!$ real(DP), intent(in), optional:: EpsOrb
!!$ ! 赤道傾斜角.
!!$ ! Inclination of equator to orbit
!!$ real(DP), intent(in), optional:: EqnOrb
!!$ ! 昇降点黄経.
!!$ !
real(DP), intent(in), optional:: IncomAIns
! 年平均入射の係数.
! Coefficient of annual mean incoming radiation.
real(DP), intent(in), optional:: IncomBIns
! 年平均入射の係数. AIns に同じ.
! Coefficient of annual mean incoming radiation.
! Same as "AIns".
real(DP), intent(in), optional:: IncomAZet
! 年平均入射角の係数. AIns に同じ.
! Coefficient of annual mean incoming radiation.
! Same as "AIns".
real(DP), intent(in), optional:: IncomBZet
! 年平均入射角の係数. AIns に同じ.
! Coefficient of annual mean incoming radiation.
! Same as "AIns".
character(*), intent(in), optional:: nmlfile
! NAMELIST ファイルの名称.
! この引数に空文字以外を与えた場合,
! 指定されたファイルから
! NAMELIST 変数群を読み込みます.
! ファイルを読み込めない場合にはエラーを
! 生じます.
!
! NAMELIST 変数群の詳細に関しては
! NAMELIST#phy_radiation_flux_nml
! を参照してください.
!
! NAMELIST file name.
! If nonnull character is specified to
! this argument,
! NAMELIST group name is loaded from the
! file.
! If the file can not be read,
! an error occurs.
!
! See "NAMELIST#phy_radiation_flux_nml"
! for details about a NAMELIST group.
!
logical, intent(out), optional:: err
! 例外処理用フラグ.
! デフォルトでは, この手続き内でエラーが
! 生じた場合, プログラムは強制終了します.
! 引数 *err* が与えられる場合,
! プログラムは強制終了せず, 代わりに
! *err* に .true. が代入されます.
!
! Exception handling flag.
! By default, when error occur in
! this procedure, the program aborts.
! If this *err* argument is given,
! .true. is substituted to *err* and
! the program does not abort.
!-----------------------------------
! NAMELIST 読み込み用変数
! Variables for loading NAMELIST
real(DP), parameter:: invalid_value = -9999.0
integer:: ary_size, loaded_ary_size, err_count
real(DP), pointer:: a_loaded_array(:), a_loaded_array_tmp(:), a_default_array(:)
real(DP), target:: long_default(1:4), short_default(1:1)
character(STRING):: warn_msg, ok_msg, loaded_array_name
!-----------------------------------
! 作業変数
! Work variables
integer:: stat
character(STRING):: cause_c
character(*), parameter:: subname = 'PhyRadFluxCreate'
continue
call BeginSub( subname, version )
stat = DC_NOERR
cause_c = ''
!-----------------------------------------------------------------
! 初期設定のチェック
! Check initialization
!-----------------------------------------------------------------
if ( phy_radflx % initialized ) then
stat = DC_EALREADYINIT
cause_c = 'PHYRADFLX'
goto 999
end if
!-----------------------------------------------------------------
! 引数の正当性のチェック
! Validate arguments
!-----------------------------------------------------------------
if (imax < 1) then
stat = DC_ENEGATIVE
cause_c = 'imax'
goto 999
end if
if (jmax < 1) then
stat = DC_ENEGATIVE
cause_c = 'jmax'
goto 999
end if
if (kmax < 1) then
stat = DC_ENEGATIVE
cause_c = 'kmax'
goto 999
end if
!-----------------------------------------------------------------
! "PHYRADFLX" の設定
! Configure the settings for "PHYRADFLX"
!-----------------------------------------------------------------
phy_radflx % imax = imax
phy_radflx % jmax = jmax
phy_radflx % kmax = kmax
phy_radflx % Grav = Grav
phy_radflx % Cp = Cp
phy_radflx % StB = StB
allocate( phy_radflx % y_Lat (0:phy_radflx%jmax-1) )
phy_radflx % y_Lat = y_Lat
allocate( phy_radflx % xy_SurfTemp (0:phy_radflx%imax-1, 0:phy_radflx%jmax-1) )
allocate( phy_radflx % xy_SurfAlbedo (0:phy_radflx%imax-1, 0:phy_radflx%jmax-1) )
phy_radflx % xy_SurfTemp = xy_SurfTemp
phy_radflx % xy_SurfAlbedo = xy_SurfAlbedo
!-----------------------------------------------------------------
! 保存用変数の割付
! Allocate variables for save
!-----------------------------------------------------------------
phy_radflx % save_flag = .false.
allocate( phy_radflx % xy_TempSave (0:phy_radflx%imax-1, 0:phy_radflx%jmax-1) )
allocate( phy_radflx % xyr_RadLFluxSave (0:phy_radflx%imax-1, 0:phy_radflx%jmax-1, 0:phy_radflx%kmax) )
allocate( phy_radflx % xyr_RadSFluxSave (0:phy_radflx%imax-1, 0:phy_radflx%jmax-1, 0:phy_radflx%kmax) )
allocate( phy_radflx % xyra_DelRadLFluxSave (0:phy_radflx%imax-1, 0:phy_radflx%jmax-1, 0:phy_radflx%kmax, 0:1) )
phy_radflx % xy_TempSave = 0.0_DP
phy_radflx % xyr_RadLFluxSave = 0.0_DP
phy_radflx % xyr_RadSFluxSave = 0.0_DP
phy_radflx % xyra_DelRadLFluxSave = 0.0_DP
!-----------------------------------------------------------------
! NAMELIST の取得
! Get NAMELIST
!-----------------------------------------------------------------
!-------------------------
! 割り付け
! Allocation
allocate( phy_radflx % LongAbsorpCoeffQVap ( MaximumBandNumber ) )
allocate( phy_radflx % LongAbsorpCoeffDryAir ( MaximumBandNumber ) )
allocate( phy_radflx % LongBandWeight ( MaximumBandNumber ) )
phy_radflx % LongAbsorpCoeffQVap = invalid_value
phy_radflx % LongAbsorpCoeffDryAir = invalid_value
phy_radflx % LongBandWeight = invalid_value
allocate( phy_radflx % ShortAbsorpCoeffQVap ( MaximumBandNumber ) )
allocate( phy_radflx % ShortAbsorpCoeffDryAir ( MaximumBandNumber ) )
allocate( phy_radflx % ShortBandWeight ( MaximumBandNumber ) )
phy_radflx % ShortAbsorpCoeffQVap = invalid_value
phy_radflx % ShortAbsorpCoeffDryAir = invalid_value
phy_radflx % ShortBandWeight = invalid_value
!-------------------------
! オプショナル引数からの値
! Values from optional arguments
phy_radflx % delta_time_value_RadLong = -1.0_DP
phy_radflx % delta_time_unit_RadLong = 'sec'
phy_radflx % delta_time_value_RadShort = -1.0_DP
phy_radflx % delta_time_unit_RadShort = 'sec'
if ( present( delta_time_value_RadLong ) ) phy_radflx % delta_time_value_RadLong = delta_time_value_RadLong
if ( present( delta_time_unit_RadLong ) ) phy_radflx % delta_time_unit_RadLong = delta_time_unit_RadLong
if ( present( delta_time_value_RadShort ) ) phy_radflx % delta_time_value_RadShort = delta_time_value_RadShort
if ( present( delta_time_unit_RadShort ) ) phy_radflx % delta_time_unit_RadShort = delta_time_unit_RadShort
if ( present( LongBandNumber ) ) phy_radflx % LongBandNumber = LongBandNumber
if ( present( LongPathLengthFact ) ) phy_radflx % LongPathLengthFact = LongPathLengthFact
if ( present( LongAbsorpCoeffQVap ) ) then
ary_size = size( LongAbsorpCoeffQVap )
phy_radflx % LongAbsorpCoeffQVap(1:ary_size) = LongAbsorpCoeffQVap
end if
if ( present( LongAbsorpCoeffDryAir ) ) then
ary_size = size( LongAbsorpCoeffDryAir )
phy_radflx % LongAbsorpCoeffDryAir(1:ary_size) = LongAbsorpCoeffDryAir
end if
if ( present( LongBandWeight ) ) then
ary_size = size( LongBandWeight )
phy_radflx % LongBandWeight(1:ary_size) = LongBandWeight
end if
if ( present( ShortBandNumber ) ) phy_radflx % ShortBandNumber = ShortBandNumber
if ( present( ShortSecScat ) ) phy_radflx % ShortSecScat = ShortSecScat
if ( present( ShortAbsorpCoeffQVap ) ) then
ary_size = size( ShortAbsorpCoeffQVap )
phy_radflx % ShortAbsorpCoeffQVap(1:ary_size) = ShortAbsorpCoeffQVap
end if
if ( present( ShortAbsorpCoeffDryAir ) ) then
ary_size = size( ShortAbsorpCoeffDryAir )
phy_radflx % ShortAbsorpCoeffDryAir(1:ary_size) = ShortAbsorpCoeffDryAir
end if
if ( present( ShortBandWeight ) ) then
ary_size = size( ShortBandWeight )
phy_radflx % ShortBandWeight(1:ary_size) = ShortBandWeight
end if
if ( present( SolarCoeff ) ) phy_radflx % SolarCoeff = SolarCoeff
if ( present( AtmosAlbedo) ) phy_radflx % AtmosAlbedo = AtmosAlbedo
!!$ if ( present( EpsOrb ) ) phy_radflx % EpsOrb = EpsOrb
!!$ if ( present( EqnOrb ) ) phy_radflx % EqnOrb = EqnOrb
if ( present( IncomAIns ) ) phy_radflx % IncomAIns = IncomAIns
if ( present( IncomBIns ) ) phy_radflx % IncomBIns = IncomBIns
if ( present( IncomAZet ) ) phy_radflx % IncomAZet = IncomAZet
if ( present( IncomBZet ) ) phy_radflx % IncomBZet = IncomBZet
!-------------------------
! NAMELIST からの値
! Values from NAMELIST
if ( present_and_not_empty(nmlfile) ) then
call MessageNotify( 'M', subname, 'Loading NAMELIST file "%c" ...', c1 = trim(nmlfile) )
call NmlRead ( nmlfile = nmlfile, delta_time_value_RadLong = phy_radflx % delta_time_value_RadLong, delta_time_unit_RadLong_ = phy_radflx % delta_time_unit_RadLong, delta_time_value_RadShort = phy_radflx % delta_time_value_RadShort, delta_time_unit_RadShort_ = phy_radflx % delta_time_unit_RadShort, LongBandNumber = phy_radflx % LongBandNumber, LongAbsorpCoeffQVap = phy_radflx % LongAbsorpCoeffQVap, LongAbsorpCoeffDryAir = phy_radflx % LongAbsorpCoeffDryAir, LongBandWeight = phy_radflx % LongBandWeight, LongPathLengthFact = phy_radflx % LongPathLengthFact, ShortBandNumber = phy_radflx % ShortBandNumber, ShortAbsorpCoeffQVap = phy_radflx % ShortAbsorpCoeffQVap, ShortAbsorpCoeffDryAir = phy_radflx % ShortAbsorpCoeffDryAir, ShortBandWeight = phy_radflx % ShortBandWeight, ShortSecScat = phy_radflx % ShortSecScat, SolarCoeff = phy_radflx % SolarCoeff, AtmosAlbedo = phy_radflx % AtmosAlbedo, IncomAIns = phy_radflx % IncomAIns, IncomBIns = phy_radflx % IncomBIns, IncomAZet = phy_radflx % IncomAZet, IncomBZet = phy_radflx % IncomBZet, err = err ) ! (out)
if ( present_and_true(err) ) then
call MessageNotify( 'W', subname, '"%c" can not be read.', c1 = trim(nmlfile) )
stat = DC_ENOFILEREAD
cause_c = nmlfile
goto 999
end if
end if
!-----------------------------------------------------------------
! オプショナル引数および NAMELIST から得られた設定値の正当性のチェック
! Validate setting values from optional arguments and NAMELIST
!-----------------------------------------------------------------
err_count = 0
warn_msg = 'Number of data "%c" is "%d" (insufficient). ' // 'Number of data must be "%d".'
ok_msg = '%c(%d:%d) = %*f'
!-----------------------------------
! 長波フラックス用情報管理
! Information control for long wave flux
if (phy_radflx % LongBandNumber < 1) then
stat = DC_ENEGATIVE
cause_c = 'LongBandNumber'
goto 999
else
ary_size = phy_radflx % LongBandNumber
end if
a_loaded_array => phy_radflx % LongAbsorpCoeffQVap
loaded_array_name = 'LongAbsorpCoeffQVap'
long_default = (/ 8.0_DP, 1.0_DP, 0.1_DP, 0.0_DP /)
a_default_array => long_default
call array_validation_check ! これは内部サブルーチン. This is an internal subroutine
phy_radflx % LongAbsorpCoeffQVap => a_loaded_array
a_loaded_array => phy_radflx % LongAbsorpCoeffDryAir
loaded_array_name = 'LongAbsorpCoeffDryAir'
long_default = (/ 0.0_DP, 0.0_DP, 0.0_DP, 5.0e-5_DP /)
a_default_array => long_default
call array_validation_check ! これは内部サブルーチン. This is an internal subroutine
phy_radflx % LongAbsorpCoeffDryAir => a_loaded_array
a_loaded_array => phy_radflx % LongBandWeight
long_default = (/ 0.2_DP, 0.1_DP, 0.1_DP, 0.6_DP /)
a_default_array => long_default
loaded_array_name = 'LongBandWeight'
call array_validation_check ! これは内部サブルーチン. This is an internal subroutine
phy_radflx % LongBandWeight => a_loaded_array
if (phy_radflx % LongPathLengthFact < 0.0_DP) then
stat = DC_ENEGATIVE
cause_c = 'LongPathLengthFact'
goto 999
end if
!-----------------------------------
! 短波フラックス用情報管理
! Information control for short wave flux
if (phy_radflx % ShortBandNumber < 1) then
stat = DC_ENEGATIVE
cause_c = 'ShortBandNumber'
goto 999
else
ary_size = phy_radflx % ShortBandNumber
end if
a_loaded_array => phy_radflx % ShortAbsorpCoeffQVap
loaded_array_name = 'ShortAbsorpCoeffQVap'
short_default = (/ 0.002_DP /)
a_default_array => short_default
call array_validation_check ! これは内部サブルーチン. This is an internal subroutine
phy_radflx % ShortAbsorpCoeffQVap => a_loaded_array
a_loaded_array => phy_radflx % ShortAbsorpCoeffDryAir
loaded_array_name = 'ShortAbsorpCoeffDryAir'
short_default = (/ 0.0_DP /)
a_default_array => short_default
call array_validation_check ! これは内部サブルーチン. This is an internal subroutine
phy_radflx % ShortAbsorpCoeffDryAir => a_loaded_array
a_loaded_array => phy_radflx % ShortBandWeight
short_default = (/ 1.0_DP /)
a_default_array => short_default
loaded_array_name = 'ShortBandWeight'
call array_validation_check ! これは内部サブルーチン. This is an internal subroutine
phy_radflx % ShortBandWeight => a_loaded_array
if (phy_radflx % ShortSecScat < 0.0_DP) then
stat = DC_ENEGATIVE
cause_c = 'ShortSecScat'
goto 999
end if
!-----------------------------------
! 短波入射用情報管理
! Information control for short wave incomming
if (phy_radflx % SolarCoeff < 0.0_DP) then
stat = DC_ENEGATIVE
cause_c = 'SolarCoeff'
goto 999
end if
if (phy_radflx % AtmosAlbedo < 0.0_DP) then
stat = DC_ENEGATIVE
cause_c = 'AtmosAlbedo'
goto 999
end if
!!$ if (phy_radflx % EpsOrb < 0.0_DP) then
!!$ stat = DC_ENEGATIVE
!!$ cause_c = 'EpsOrb'
!!$ goto 999
!!$ end if
!!$ if (phy_radflx % EqnOrb < 0.0_DP) then
!!$ stat = DC_ENEGATIVE
!!$ cause_c = 'EqnOrb'
!!$ goto 999
!!$ end if
if (phy_radflx % IncomAIns < 0.0_DP) then
stat = DC_ENEGATIVE
cause_c = 'IncomAIns'
goto 999
end if
if (phy_radflx % IncomBIns < 0.0_DP) then
stat = DC_ENEGATIVE
cause_c = 'IncomBIns'
goto 999
end if
if (phy_radflx % IncomAZet < 0.0_DP) then
stat = DC_ENEGATIVE
cause_c = 'IncomAZet'
goto 999
end if
if (phy_radflx % IncomBZet < 0.0_DP) then
stat = DC_ENEGATIVE
cause_c = 'IncomBZet'
goto 999
end if
if ( err_count > 0 ) then
stat = DCPAM_ENMLARRAYINSUFF
cause_c = ''
goto 999
end if
!-----------------------------------------------------------------
! 時刻の設定
! Configure time
!-----------------------------------------------------------------
if ( present(current_time_value) .and. present(current_time_unit) ) then
call DCDiffTimeCreate( diff = phy_radflx % current_time, value = current_time_value, unit = current_time_unit ) ! (in)
else
call DCDiffTimeCreate( diff = phy_radflx % current_time, value = 0.0_DP, unit = 'sec' ) ! (in)
end if
if ( present(delta_time_value) .and. present(delta_time_unit) ) then
call DCDiffTimeCreate( diff = phy_radflx % delta_time, value = delta_time_value, unit = delta_time_unit ) ! (in)
else
call DCDiffTimeCreate( diff = phy_radflx % delta_time, value = 1.0_DP, unit = 'sec' ) ! (in)
end if
call DCDiffTimeCreate( diff = phy_radflx % delta_time_RadLong, value = phy_radflx % delta_time_value_RadLong, unit = phy_radflx % delta_time_unit_RadLong ) ! (in)
call DCDiffTimeCreate( diff = phy_radflx % delta_time_RadShort, value = phy_radflx % delta_time_value_RadShort, unit = phy_radflx % delta_time_unit_RadShort ) ! (in)
!-----------------------------------------------------------------
! 初期化フラグの設定
! Set initialization flag
!-----------------------------------------------------------------
phy_radflx % initialized = .true.
!-----------------------------------------------------------------
! 短波入射の計算
! Calculate short wave (insolation) incoming radiation
!-----------------------------------------------------------------
allocate( phy_radflx % xy_IncomRadSFlux (0:phy_radflx%imax-1, 0:phy_radflx%jmax-1) )
allocate( phy_radflx % xy_InAngle (0:phy_radflx%imax-1, 0:phy_radflx%jmax-1) )
call ShortIncoming( phy_radflx = phy_radflx, xy_IncomRadSFlux = phy_radflx % xy_IncomRadSFlux, xy_InAngle = phy_radflx % xy_InAngle ) ! (out)
!-----------------------------------------------------------------
! 終了処理, 例外処理
! Termination and Exception handling
!-----------------------------------------------------------------
999 continue
call StoreError( stat, subname, err, cause_c )
if ( present_and_true(err) ) then
if ( associated( phy_radflx % xy_TempSave ) ) deallocate( phy_radflx % xy_TempSave )
if ( associated( phy_radflx % xyr_RadLFluxSave ) ) deallocate( phy_radflx % xyr_RadLFluxSave )
if ( associated( phy_radflx % xyra_DelRadLFluxSave ) ) deallocate( phy_radflx % xyra_DelRadLFluxSave )
if ( associated( phy_radflx % LongAbsorpCoeffQVap ) ) deallocate( phy_radflx % LongAbsorpCoeffQVap )
if ( associated( phy_radflx % LongAbsorpCoeffDryAir ) ) deallocate( phy_radflx % LongAbsorpCoeffDryAir )
if ( associated( phy_radflx % LongBandWeight ) ) deallocate( phy_radflx % LongBandWeight )
end if
call EndSub( subname )
contains
subroutine array_validation_check
!
! 配列型データを NAMELIST から読み込んだ際の値の妥当性を
! チェックする.
!
! 妥当性が検証された場合には, a_loaded_array に, 過不足ない
! 配列サイズのデータが格納される.
!
! 一方, 妥当性が検証されない場合には, err_count の値が
! プラス 1 され, 警告メッセージが表示される.
!
!
! Check validation when array data is loaded from NAMELIST.
!
! If validation is checked, just enough data is stored in
! "a_loaded_array".
!
! Otherwise, if validation is not checked, add 1 to
! value of "err_count", and display warning messages.
!
loaded_ary_size = count( a_loaded_array > invalid_value + 1.0_DP )
if ( loaded_ary_size == 0 ) then
loaded_ary_size = size( a_default_array )
deallocate( a_loaded_array )
a_loaded_array => a_default_array
end if
if ( loaded_ary_size == ary_size ) then
call MessageNotify( 'M', subname, ok_msg, c1 = trim(loaded_array_name), i = (/1, loaded_ary_size/), d = a_loaded_array, n = (/loaded_ary_size/) )
allocate( a_loaded_array_tmp(1:loaded_ary_size) )
a_loaded_array_tmp(1:loaded_ary_size) = a_loaded_array(1:loaded_ary_size)
nullify( a_loaded_array )
a_loaded_array => a_loaded_array_tmp
nullify( a_loaded_array_tmp )
else
call MessageNotify( 'W', subname, warn_msg, c1 = trim(loaded_array_name), i = (/loaded_ary_size, ary_size/) )
err_count = err_count + 1
end if
end subroutine array_validation_check
end subroutine PhyRadFluxCreate
| Function : | |
| result : | logical |
| phy_radflx : | type(PHYRADFLX), intent(in) |
phy_radflx が初期設定されている場合には .true. が, 初期設定されていない場合には .false. が返ります.
If phy_radflx is initialized, .true. is returned. If phy_radflx is not initialized, .false. is returned.
logical function PhyRadFluxInitialized( phy_radflx ) result(result)
!
! *phy_radflx* が初期設定されている場合には .true. が,
! 初期設定されていない場合には .false. が返ります.
!
! If *phy_radflx* is initialized, .true. is returned.
! If *phy_radflx* is not initialized, .false. is returned.
!
implicit none
type(PHYRADFLX), intent(in):: phy_radflx
continue
result = phy_radflx % initialized
end function PhyRadFluxInitialized
| Subroutine : | |||
| phy_radflx : | type(PHYRADFLX), intent(in) | ||
| unit : | integer, intent(in), optional
| ||
| indent : | character(*), intent(in), optional
| ||
| err : | logical, intent(out), optional
|
引数 phy_radflx に設定されている情報を印字します. デフォルトではメッセージは標準出力に出力されます. unit に装置番号を指定することで, 出力先を変更することが可能です.
Print information of phy_radflx. By default messages are output to standard output. Unit number for output can be changed by unit argument.
subroutine PhyRadFluxPutLine( phy_radflx, unit, indent, err )
!
! 引数 *phy_radflx* に設定されている情報を印字します.
! デフォルトではメッセージは標準出力に出力されます.
! *unit* に装置番号を指定することで, 出力先を変更することが可能です.
!
! Print information of *phy_radflx*.
! By default messages are output to standard output.
! Unit number for output can be changed by *unit* argument.
!
use dc_trace, only: BeginSub, EndSub
use dc_string, only: PutLine, Printf
use dc_types, only: DP, STRING, TOKEN, STDOUT
use dc_error, only: StoreError, DC_NOERR, DC_ENOTINIT
use dc_date, only: toChar
implicit none
type(PHYRADFLX), intent(in):: phy_radflx
integer, intent(in), optional:: unit
! 出力先の装置番号.
! デフォルトの出力先は標準出力.
!
! Unit number for output.
! Default value is standard output.
character(*), intent(in), optional:: indent
! 表示されるメッセージの字下げ.
!
! Indent of displayed messages.
logical, intent(out), optional:: err
! 例外処理用フラグ.
! デフォルトでは, この手続き内でエラーが
! 生じた場合, プログラムは強制終了します.
! 引数 *err* が与えられる場合,
! プログラムは強制終了せず, 代わりに
! *err* に .true. が代入されます.
!
! Exception handling flag.
! By default, when error occur in
! this procedure, the program aborts.
! If this *err* argument is given,
! .true. is substituted to *err* and
! the program does not abort.
!-----------------------------------
! 作業変数
! Work variables
integer:: stat
character(STRING):: cause_c
integer:: out_unit
integer:: indent_len
character(STRING):: indent_str
character(*), parameter:: subname = 'PhyRadFluxPutLine'
continue
call BeginSub( subname )
stat = DC_NOERR
cause_c = ''
!-----------------------------------------------------------------
! 初期設定のチェック
! Check initialization
!-----------------------------------------------------------------
if ( present(unit) ) then
out_unit = unit
else
out_unit = STDOUT
end if
indent_len = 0
indent_str = ''
if ( present(indent) ) then
if ( len(indent) /= 0 ) then
indent_len = len(indent)
indent_str(1:indent_len) = indent
end if
end if
!-----------------------------------------------------------------
! "PHYRADFLX" の設定の印字
! Print the settings for "PHYRADFLX"
!-----------------------------------------------------------------
if ( phy_radflx % initialized ) then
call Printf( out_unit, indent_str(1:indent_len) // '#<PHYRADFLX:: @initialized=%y', l = (/phy_radflx % initialized/) )
call Printf( out_unit, indent_str(1:indent_len) // ' @imax=%d @jmax=%d @kmax=%d', i = (/phy_radflx % imax, phy_radflx % jmax, phy_radflx % kmax/) )
call PutLine( phy_radflx % y_Lat, unit = out_unit, lbounds = lbound(phy_radflx % y_Lat), ubounds = ubound(phy_radflx % y_Lat), indent = indent_str(1:indent_len) // ' @y_Lat=' )
call Printf( out_unit, indent_str(1:indent_len) // ' @Grav=%f @Cp=%f @StB=%f', d = (/ phy_radflx % Grav, phy_radflx % Cp, phy_radflx % StB/) )
call Printf( out_unit, indent_str(1:indent_len) // ' @current_time=%c', c1 = trim( toChar(phy_radflx % current_time) ) )
call Printf( out_unit, indent_str(1:indent_len) // ' @delta_time=%c', c1 = trim( toChar(phy_radflx % delta_time) ) )
call Printf( out_unit, indent_str(1:indent_len) // ' @delta_time_RadLong=%c', c1 = trim( toChar(phy_radflx % delta_time_RadLong) ) )
call Printf( out_unit, indent_str(1:indent_len) // ' @delta_time_RadShort=%c', c1 = trim( toChar(phy_radflx % delta_time_RadShort) ) )
call Printf( out_unit, indent_str(1:indent_len) // ' @LongBandNumber=%d, @LongPathLengthFact=%f', i = (/ phy_radflx % LongBandNumber /), d = (/ phy_radflx % LongPathLengthFact /) )
call Printf( out_unit, indent_str(1:indent_len) // ' @LongAbsorpCoeffQVap=%*f', d = (/ phy_radflx % LongAbsorpCoeffQVap /), n = (/ phy_radflx % LongBandNumber /) )
call Printf( out_unit, indent_str(1:indent_len) // ' @LongAbsorpCoeffDryAir=%*f', d = (/ phy_radflx % LongAbsorpCoeffDryAir /), n = (/ phy_radflx % LongBandNumber /) )
call Printf( out_unit, indent_str(1:indent_len) // ' @LongBandWeight=%*f', d = (/ phy_radflx % LongBandWeight /), n = (/ phy_radflx % LongBandNumber /) )
call Printf( out_unit, indent_str(1:indent_len) // ' @ShortBandNumber=%d, @ShortSecScat=%f', i = (/ phy_radflx % ShortBandNumber /), d = (/ phy_radflx % ShortSecScat /) )
call Printf( out_unit, indent_str(1:indent_len) // ' @ShortAbsorpCoeffQVap=%*f', d = (/ phy_radflx % ShortAbsorpCoeffQVap /), n = (/ phy_radflx % ShortBandNumber /) )
call Printf( out_unit, indent_str(1:indent_len) // ' @ShortAbsorpCoeffDryAir=%*f', d = (/ phy_radflx % ShortAbsorpCoeffDryAir /), n = (/ phy_radflx % ShortBandNumber /) )
call Printf( out_unit, indent_str(1:indent_len) // ' @ShortBandWeight=%*f', d = (/ phy_radflx % ShortBandWeight /), n = (/ phy_radflx % ShortBandNumber /) )
call Printf( out_unit, indent_str(1:indent_len) // ' @SolarCoeff=%f, @AtmosAlbedo=%f', d = (/ phy_radflx % SolarCoeff, phy_radflx % AtmosAlbedo /) )
!!$ call Printf( out_unit, &
!!$ & indent_str(1:indent_len) // &
!!$ & ' @EpsOrb=%f, @EqnOrb=%f', &
!!$ & d = (/ phy_radflx % EpsOrb, phy_radflx % EqnOrb /) )
call Printf( out_unit, indent_str(1:indent_len) // ' @IncomAIns=%f, @IncomBIns=%f', d = (/ phy_radflx % IncomAIns, phy_radflx % IncomBIns /) )
call Printf( out_unit, indent_str(1:indent_len) // ' @IncomAZet=%f, @IncomBZet=%f', d = (/ phy_radflx % IncomAZet, phy_radflx % IncomBZet /) )
call PutLine( phy_radflx % xy_SurfTemp, unit = out_unit, lbounds = lbound(phy_radflx % xy_SurfTemp), ubounds = ubound(phy_radflx % xy_SurfTemp), indent = indent_str(1:indent_len) // ' @xy_SurfTemp=' )
call PutLine( phy_radflx % xy_SurfAlbedo, unit = out_unit, lbounds = lbound(phy_radflx % xy_SurfAlbedo), ubounds = ubound(phy_radflx % xy_SurfAlbedo), indent = indent_str(1:indent_len) // ' @xy_SurfAlbedo=' )
call PutLine( phy_radflx % xy_TempSave, unit = out_unit, lbounds = lbound(phy_radflx % xy_TempSave), ubounds = ubound(phy_radflx % xy_TempSave), indent = indent_str(1:indent_len) // ' @xy_TempSave=' )
call PutLine( phy_radflx % xyr_RadLFluxSave, unit = out_unit, lbounds = lbound(phy_radflx % xyr_RadLFluxSave), ubounds = ubound(phy_radflx % xyr_RadLFluxSave), indent = indent_str(1:indent_len) // ' @xyr_RadLFluxSave=' )
call PutLine( phy_radflx % xyra_DelRadLFluxSave, unit = out_unit, lbounds = lbound(phy_radflx % xyra_DelRadLFluxSave), ubounds = ubound(phy_radflx % xyra_DelRadLFluxSave), indent = indent_str(1:indent_len) // ' @xyra_DelRadLFluxSave=' )
call PutLine( phy_radflx % xy_IncomRadSFlux, unit = out_unit, lbounds = lbound(phy_radflx % xy_IncomRadSFlux), ubounds = ubound(phy_radflx % xy_IncomRadSFlux), indent = indent_str(1:indent_len) // ' @xy_IncomRadSFlux=' )
call PutLine( phy_radflx % xy_InAngle, unit = out_unit, lbounds = lbound(phy_radflx % xy_InAngle), ubounds = ubound(phy_radflx % xy_InAngle), indent = indent_str(1:indent_len) // ' @xy_InAngle=' )
call Printf( out_unit, indent_str(1:indent_len) // '>' )
else
call Printf( out_unit, indent_str(1:indent_len) // '#<PHYRADFLX:: @initialized=%y>', l = (/phy_radflx % initialized/) )
end if
!-----------------------------------------------------------------
! 終了処理, 例外処理
! Termination and Exception handling
!-----------------------------------------------------------------
999 continue
call StoreError( stat, subname, err, cause_c )
call EndSub( subname )
end subroutine PhyRadFluxPutLine
| Subroutine : | |||
| phy_radflx : | type(PHYRADFLX), intent(inout) | ||
| xyr_RadLFlux(0:phy_radflx%imax-1, 0:phy_radflx%jmax-1, 0:phy_radflx%kmax) : | real(DP), intent(in)
| ||
| xyr_RadSFlux(0:phy_radflx%imax-1, 0:phy_radflx%jmax-1, 0:phy_radflx%kmax) : | real(DP), intent(in)
| ||
| xyr_Press(0:phy_radflx%imax-1, 0:phy_radflx%jmax-1, 0:phy_radflx%kmax) : | real(DP), intent(in)
| ||
| xyz_DRadLTempDt(0:phy_radflx%imax-1, 0:phy_radflx%jmax-1, 0:phy_radflx%kmax-1) : | real(DP), intent(out)
| ||
| xyz_DRadSTempDt(0:phy_radflx%imax-1, 0:phy_radflx%jmax-1, 0:phy_radflx%kmax-1) : | real(DP), intent(out)
| ||
| err : | logical, intent(out), optional
|
放射による温度変化率を計算します.
なお, 与えられた phy_radflx が PhyRadFluxCreate によって初期設定 されていない場合, プログラムはエラーを発生させます.
Calculate temperature tendency with radiation.
If phy_radflx is not initialized by "PhyRadFluxCreate" yet, error is occurred.
Alias for PhyRadFluxDTempDt
| Subroutine : | |||
| phy_radflx : | type(PHYRADFLX), intent(inout) | ||
| xyz_Temp(0:phy_radflx%imax-1, 0:phy_radflx%jmax-1, 0:phy_radflx%kmax-1) : | real(DP), intent(in)
| ||
| xyz_QVap(0:phy_radflx%imax-1, 0:phy_radflx%jmax-1, 0:phy_radflx%kmax-1) : | real(DP), intent(in)
| ||
| xyr_Press(0:phy_radflx%imax-1, 0:phy_radflx%jmax-1, 0:phy_radflx%kmax) : | real(DP), intent(in)
| ||
| xyr_RadLFlux(0:phy_radflx%imax-1, 0:phy_radflx%jmax-1, 0:phy_radflx%kmax) : | real(DP), intent(out)
| ||
| xya_SurfRadLMatrix(0:phy_radflx%imax-1, 0:phy_radflx%jmax-1, -1:1) : | real(DP), intent(out)
| ||
| xyra_DelRadLFlux(0:phy_radflx%imax-1, 0:phy_radflx%jmax-1, 0:phy_radflx%kmax, 0:1) : | real(DP), intent(out)
| ||
| xyr_RadSFlux(0:phy_radflx%imax-1, 0:phy_radflx%jmax-1, 0:phy_radflx%kmax) : | real(DP), intent(out)
| ||
| err : | logical, intent(out), optional
|
温度, 比湿, 気圧から, 放射フラックスを計算します.
なお, 与えられた phy_radflx が PhyRadFluxCreate によって初期設定 されていない場合, プログラムはエラーを発生させます.
Calculate radiation flux from temperature, specific humidity, and air pressure.
If phy_radflx is not initialized by "PhyRadFluxCreate" yet, error is occurred.
Alias for PhyRadFluxRadiationFlux
| Subroutine : | |||
| phy_radflx : | type(PHYRADFLX), intent(inout) | ||
| xyr_RadLFlux(0:phy_radflx%imax-1, 0:phy_radflx%jmax-1, 0:phy_radflx%kmax) : | real(DP), intent(out)
| ||
| xyra_DelRadLFlux(0:phy_radflx%imax-1, 0:phy_radflx%jmax-1, 0:phy_radflx%kmax, 0:1) : | real(DP), intent(out)
| ||
| xyz_Temp(0:phy_radflx%imax-1, 0:phy_radflx%jmax-1, 0:phy_radflx%kmax-1) : | real(DP), intent(in)
| ||
| xy_SurfTemp(0:phy_radflx%imax-1, 0:phy_radflx%jmax-1) : | real(DP), intent(in)
| ||
| xyr_TauQVap(0:phy_radflx%imax-1, 0:phy_radflx%jmax-1, 0:phy_radflx%kmax) : | real(DP), intent(in)
| ||
| xyr_TauDryAir(0:phy_radflx%imax-1, 0:phy_radflx%jmax-1, 0:phy_radflx%kmax) : | real(DP), intent(in)
| ||
| err : | logical, intent(out), optional
|
長波フラックスの計算
なお, 与えられた phy_radflx が PhyRadFluxCreate によって初期設定 されていない場合, プログラムはエラーを発生させます.
Calculate long wave flux
If phy_radflx is not initialized by "PhyRadFluxCreate" yet, error is occurred.
Alias for PhyRadFluxLongFlux
| Constant : | |||
| MaximumBandNumber = 256 : | integer, parameter
|
| Subroutine : | |||
| nmlfile : | character(*), intent(in)
| ||
| delta_time_value_RadLong : | real(DP), intent(inout)
| ||
| delta_time_unit_RadLong_ : | character(*), intent(inout) | ||
| delta_time_value_RadShort : | real(DP), intent(inout)
| ||
| delta_time_unit_RadShort_ : | character(*), intent(inout) | ||
| LongBandNumber : | integer, intent(inout)
| ||
| LongAbsorpCoeffQVap(1:MaximumBandNumber) : | real(DP), intent(inout)
| ||
| LongAbsorpCoeffDryAir(1:MaximumBandNumber) : | real(DP), intent(inout)
| ||
| LongBandWeight(1:MaximumBandNumber) : | real(DP), intent(inout)
| ||
| LongPathLengthFact : | real(DP), intent(inout)
| ||
| ShortBandNumber : | integer, intent(inout)
| ||
| ShortAbsorpCoeffQVap(1:MaximumBandNumber) : | real(DP), intent(inout)
| ||
| ShortAbsorpCoeffDryAir(1:MaximumBandNumber) : | real(DP), intent(inout)
| ||
| ShortBandWeight(1:MaximumBandNumber) : | real(DP), intent(inout)
| ||
| ShortSecScat : | real(DP), intent(inout)
| ||
| SolarCoeff : | real(DP), intent(inout)
| ||
| AtmosAlbedo : | real(DP), intent(inout)
| ||
| IncomAIns : | real(DP), intent(inout)
| ||
| IncomBIns : | real(DP), intent(inout)
| ||
| IncomAZet : | real(DP), intent(inout)
| ||
| IncomBZet : | real(DP), intent(inout)
| ||
| err : | logical, intent(out), optional
|
NAMELIST ファイル nmlfile から値を入力するための 内部サブルーチンです. PhyRadFluxCreate 内で呼び出されることを 想定しています.
値が NAMELIST ファイル内で指定されていない場合には, 入力された値がそのまま返ります.
なお, nmlfile に空文字が与えられた場合, または 与えられた nmlfile を読み込むことができない場合, プログラムはエラーを発生させます.
This is an internal subroutine to input values from NAMELIST file nmlfile. This subroutine is expected to be called by "PhyRadFluxCreate".
A value not specified in NAMELIST file is returned without change.
If nmlfile is empty, or nmlfile can not be read, error is occurred.
This procedure input/output NAMELIST#phy_radiation_flux_nml .
Alias for PhyRadFluxNmlRead
| Subroutine : | |||
| phy_radflx : | type(PHYRADFLX), intent(inout) | ||
| xyr_RadLFlux(0:phy_radflx%imax-1, 0:phy_radflx%jmax-1, 0:phy_radflx%kmax) : | real(DP), intent(in)
| ||
| xyr_RadSFlux(0:phy_radflx%imax-1, 0:phy_radflx%jmax-1, 0:phy_radflx%kmax) : | real(DP), intent(in)
| ||
| xyr_Press(0:phy_radflx%imax-1, 0:phy_radflx%jmax-1, 0:phy_radflx%kmax) : | real(DP), intent(in)
| ||
| xyz_DRadLTempDt(0:phy_radflx%imax-1, 0:phy_radflx%jmax-1, 0:phy_radflx%kmax-1) : | real(DP), intent(out)
| ||
| xyz_DRadSTempDt(0:phy_radflx%imax-1, 0:phy_radflx%jmax-1, 0:phy_radflx%kmax-1) : | real(DP), intent(out)
| ||
| err : | logical, intent(out), optional
|
放射による温度変化率を計算します.
なお, 与えられた phy_radflx が PhyRadFluxCreate によって初期設定 されていない場合, プログラムはエラーを発生させます.
Calculate temperature tendency with radiation.
If phy_radflx is not initialized by "PhyRadFluxCreate" yet, error is occurred.
subroutine PhyRadFluxDTempDt( phy_radflx, xyr_RadLFlux, xyr_RadSFlux, xyr_Press, xyz_DRadLTempDt, xyz_DRadSTempDt, err )
!
! 放射による温度変化率を計算します.
!
! なお, 与えられた *phy_radflx* が PhyRadFluxCreate によって初期設定
! されていない場合, プログラムはエラーを発生させます.
!
! Calculate temperature tendency with radiation.
!
! If *phy_radflx* is not initialized by "PhyRadFluxCreate" yet,
! error is occurred.
!
use dc_trace, only: BeginSub, EndSub
use dc_string, only: PutLine, Printf
use dc_types, only: DP, STRING, TOKEN, STDOUT
use dc_error, only: StoreError, DC_NOERR, DC_ENOTINIT
implicit none
type(PHYRADFLX), intent(inout):: phy_radflx
real(DP), intent(in):: xyr_RadLFlux (0:phy_radflx%imax-1, 0:phy_radflx%jmax-1, 0:phy_radflx%kmax)
! 長波フラックス.
! Long wave flux
real(DP), intent(in):: xyr_RadSFlux (0:phy_radflx%imax-1, 0:phy_radflx%jmax-1, 0:phy_radflx%kmax)
! 短波 (日射) フラックス.
! Short wave (insolation) flux
real(DP), intent(in):: xyr_Press (0:phy_radflx%imax-1, 0:phy_radflx%jmax-1, 0:phy_radflx%kmax)
! $ P_s $ . 地表面気圧 (半整数レベル).
! Surface pressure (half level)
real(DP), intent(out):: xyz_DRadLTempDt (0:phy_radflx%imax-1, 0:phy_radflx%jmax-1, 0:phy_radflx%kmax-1)
! 長波加熱率.
! Temperature tendency with long wave
real(DP), intent(out):: xyz_DRadSTempDt (0:phy_radflx%imax-1, 0:phy_radflx%jmax-1, 0:phy_radflx%kmax-1)
! 短波加熱率.
! Temperature tendency with short wave
logical, intent(out), optional:: err
! 例外処理用フラグ.
! デフォルトでは, この手続き内でエラーが
! 生じた場合, プログラムは強制終了します.
! 引数 *err* が与えられる場合,
! プログラムは強制終了せず, 代わりに
! *err* に .true. が代入されます.
!
! Exception handling flag.
! By default, when error occur in
! this procedure, the program aborts.
! If this *err* argument is given,
! .true. is substituted to *err* and
! the program does not abort.
!-----------------------------------
! 作業変数
! Work variables
integer:: kmax ! 鉛直層数.
! Number of vertical level
real(DP):: Grav ! $ g $ . 重力加速度. Gravitational acceleration
real(DP):: Cp ! $ C_p $ . 大気定圧比熱. Specific heat of air at constant pressure
integer:: k ! DO ループ用作業変数
! Work variables for DO loop
integer:: stat
character(STRING):: cause_c
character(*), parameter:: subname = 'PhyRadFluxDTempDt'
continue
call BeginSub( subname )
stat = DC_NOERR
cause_c = ''
!-----------------------------------------------------------------
! 初期設定のチェック
! Check initialization
!-----------------------------------------------------------------
if ( .not. phy_radflx % initialized ) then
stat = DC_ENOTINIT
cause_c = 'PHYRADFLX'
goto 999
end if
!-----------------------------------------------------------------
! *phy_radflx* に格納されている設定値の取り出し
! Fetch setting values stored in *phy_radflx*
!-----------------------------------------------------------------
kmax = phy_radflx % kmax
Grav = phy_radflx % Grav
Cp = phy_radflx % Cp
!----------------------------------------------------------------
! 放射冷却率の演算
! Calculate radiation cooling rate
!----------------------------------------------------------------
do k = 0, kmax - 1
xyz_DRadLTempDt(:,:,k) = ( xyr_RadLFlux(:,:,k) - xyr_RadLFlux(:,:,k+1) ) / ( xyr_Press(:,:,k) - xyr_Press(:,:,k+1) ) / Cp * Grav
xyz_DRadSTempDt(:,:,k) = ( xyr_RadSFlux(:,:,k) - xyr_RadSFlux(:,:,k+1) ) / ( xyr_Press(:,:,k) - xyr_Press(:,:,k+1) ) / Cp * Grav
end do
!-----------------------------------------------------------------
! 終了処理, 例外処理
! Termination and Exception handling
!-----------------------------------------------------------------
999 continue
call StoreError( stat, subname, err, cause_c )
call EndSub( subname )
end subroutine PhyRadFluxDTempDt
| Subroutine : | |||
| phy_radflx : | type(PHYRADFLX), intent(inout) | ||
| xyr_RadLFlux(0:phy_radflx%imax-1, 0:phy_radflx%jmax-1, 0:phy_radflx%kmax) : | real(DP), intent(out)
| ||
| xyra_DelRadLFlux(0:phy_radflx%imax-1, 0:phy_radflx%jmax-1, 0:phy_radflx%kmax, 0:1) : | real(DP), intent(out)
| ||
| xyz_Temp(0:phy_radflx%imax-1, 0:phy_radflx%jmax-1, 0:phy_radflx%kmax-1) : | real(DP), intent(in)
| ||
| xy_SurfTemp(0:phy_radflx%imax-1, 0:phy_radflx%jmax-1) : | real(DP), intent(in)
| ||
| xyr_TauQVap(0:phy_radflx%imax-1, 0:phy_radflx%jmax-1, 0:phy_radflx%kmax) : | real(DP), intent(in)
| ||
| xyr_TauDryAir(0:phy_radflx%imax-1, 0:phy_radflx%jmax-1, 0:phy_radflx%kmax) : | real(DP), intent(in)
| ||
| err : | logical, intent(out), optional
|
長波フラックスの計算
なお, 与えられた phy_radflx が PhyRadFluxCreate によって初期設定 されていない場合, プログラムはエラーを発生させます.
Calculate long wave flux
If phy_radflx is not initialized by "PhyRadFluxCreate" yet, error is occurred.
subroutine PhyRadFluxLongFlux( phy_radflx, xyr_RadLFlux, xyra_DelRadLFlux, xyz_Temp, xy_SurfTemp, xyr_TauQVap, xyr_TauDryAir, err )
!
! 長波フラックスの計算
!
! なお, 与えられた *phy_radflx* が PhyRadFluxCreate によって初期設定
! されていない場合, プログラムはエラーを発生させます.
!
! Calculate long wave flux
!
! If *phy_radflx* is not initialized by "PhyRadFluxCreate" yet,
! error is occurred.
!
use dc_trace, only: BeginSub, EndSub
use dc_string, only: PutLine, Printf
use dc_types, only: DP, STRING, TOKEN, STDOUT
use dc_error, only: StoreError, DC_NOERR, DC_ENOTINIT
implicit none
type(PHYRADFLX), intent(inout):: phy_radflx
real(DP), intent(out):: xyr_RadLFlux (0:phy_radflx%imax-1, 0:phy_radflx%jmax-1, 0:phy_radflx%kmax)
! 長波フラックス.
! Long wave flux
real(DP), intent(out):: xyra_DelRadLFlux (0:phy_radflx%imax-1, 0:phy_radflx%jmax-1, 0:phy_radflx%kmax, 0:1)
! 長波地表温度変化.
! Surface temperature tendency with long wave
real(DP), intent(in):: xyz_Temp (0:phy_radflx%imax-1, 0:phy_radflx%jmax-1, 0:phy_radflx%kmax-1)
! $ T $ . 温度. Temperature
real(DP), intent(in):: xy_SurfTemp (0:phy_radflx%imax-1, 0:phy_radflx%jmax-1)
! 地表面温度.
! Surface temperature
real(DP), intent(in):: xyr_TauQVap (0:phy_radflx%imax-1, 0:phy_radflx%jmax-1, 0:phy_radflx%kmax)
! 光学的厚さ:水
! Optical depth of water
real(DP), intent(in):: xyr_TauDryAir (0:phy_radflx%imax-1, 0:phy_radflx%jmax-1, 0:phy_radflx%kmax)
! 光学的厚さ:空気
! Optical depth of air
logical, intent(out), optional:: err
! 例外処理用フラグ.
! デフォルトでは, この手続き内でエラーが
! 生じた場合, プログラムは強制終了します.
! 引数 *err* が与えられる場合,
! プログラムは強制終了せず, 代わりに
! *err* に .true. が代入されます.
!
! Exception handling flag.
! By default, when error occur in
! this procedure, the program aborts.
! If this *err* argument is given,
! .true. is substituted to *err* and
! the program does not abort.
!-----------------------------------
! 作業変数
! Work variables
integer:: kmax ! 鉛直層数.
! Number of vertical level
real(DP):: StB ! $ \sigma_{SB} $ . ステファンボルツマン定数. Stefan-Boltzmann constant
real(DP):: xyr_Trans (0:phy_radflx%imax-1, 0:phy_radflx%jmax-1, 0:phy_radflx%kmax)
! 透過係数.
! Transmission coefficient
real(DP):: xyr_Trans1 (0:phy_radflx%imax-1, 0:phy_radflx%jmax-1, 0:phy_radflx%kmax)
! 1/2 レベルからの透過係数.
! Transmission coefficient above 1/2 level
real(DP):: xyr_Trans2 (0:phy_radflx%imax-1, 0:phy_radflx%jmax-1, 0:phy_radflx%kmax)
! 3/2 レベルからの透過係数.
! Transmission coefficient above 3/2 level
real(DP):: xyz_PiB (0:phy_radflx%imax-1, 0:phy_radflx%jmax-1, 0:phy_radflx%kmax-1)
! $ \pi B = \sigma T^{4} $
real(DP):: xy_SurfPiB (0:phy_radflx%imax-1, 0:phy_radflx%jmax-1)
! 地表面の $ \pi B $ .
! $ \pi B $ on surface
integer:: kk , bn
real(DP):: BandWeightSum
integer:: BandNumber
! 長波バンド数.
! Number of long wave band
real(DP), pointer:: AbsorpCoeffQVap(:)
! 水の吸収係数.
! Absorption coefficient of water
real(DP), pointer:: AbsorpCoeffDryAir(:)
! 空気の吸収係数.
! Absorption coefficient of air
real(DP), pointer:: BandWeight(:)
! バンドウェイト.
! Band weight
real(DP):: PathLengthFact
! 光路長のファクタ.
! Factor of optical length
integer:: k ! DO ループ用作業変数
! Work variables for DO loop
integer:: stat
character(STRING):: cause_c
character(*), parameter:: subname = 'PhyRadFluxLongFlux'
continue
call BeginSub( subname )
stat = DC_NOERR
cause_c = ''
!-----------------------------------------------------------------
! 初期設定のチェック
! Check initialization
!-----------------------------------------------------------------
if ( .not. phy_radflx % initialized ) then
stat = DC_ENOTINIT
cause_c = 'PHYRADFLX'
goto 999
end if
!-----------------------------------------------------------------
! *phy_radflx* に格納されている設定値の取り出し
! Fetch setting values stored in *phy_radflx*
!-----------------------------------------------------------------
kmax = phy_radflx % kmax
StB = phy_radflx % StB
BandNumber = phy_radflx % LongBandNumber
AbsorpCoeffQVap => phy_radflx % LongAbsorpCoeffQVap
AbsorpCoeffDryAir => phy_radflx % LongAbsorpCoeffDryAir
BandWeight => phy_radflx % LongBandWeight
PathLengthFact = phy_radflx % LongPathLengthFact
!-----------------------------------------------------------------
! バンドウェイトの設定
! Configure band weight
!-----------------------------------------------------------------
BandWeightSum = 0.0_DP
do bn = 1, BandNumber
BandWeightSum = BandWeightSum + BandWeight(bn)
end do
do bn = 1, BandNumber
BandWeight(bn) = BandWeight(bn) / BandWeightSum
end do
!-----------------------------------------------------------------
! $ \pi B $ の計算
! Calculate $ \pi B $
!-----------------------------------------------------------------
xyz_PiB = StB * ( xyz_Temp**4 )
xy_SurfPiB = StB * ( xy_SurfTemp**4 )
do k = 0, kmax
!---------------------------------------------------------------
! 透過関数計算
! Calculate transmission functions
!---------------------------------------------------------------
xyr_Trans = 0.0_DP
do bn = 1, BandNumber
do kk = 0, kmax
xyr_Trans(:,:,kk) = xyr_Trans(:,:,kk) + BandWeight(bn) * exp( - PathLengthFact * ( AbsorpCoeffQVap(bn) * abs( xyr_TauQVap(:,:,kk) - xyr_TauQVap(:,:,k) ) + AbsorpCoeffDryAir(bn) * abs( xyr_TauDryAir(:,:,kk) - xyr_TauDryAir(:,:,k) ) ) )
end do
end do
!---------------------------------------------------------------
! 放射フラックス計算
! Calculate radiation flux
!---------------------------------------------------------------
xyr_RadLFlux(:,:,k) = xy_SurfPiB * xyr_Trans(:,:,0)
do kk = 0, kmax-1
xyr_RadLFlux(:,:,k) = xyr_RadLFlux(:,:,k) - xyz_PiB(:,:,kk) * ( xyr_Trans(:,:,kk) - xyr_Trans(:,:,kk+1) )
end do
!---------------------------------------------------------------
! 補正項計算用透過関数計算
! Calculate transmission functions for correction terms
!---------------------------------------------------------------
xyr_Trans1(:,:,k) = xyr_Trans(:,:,0)
xyr_Trans2(:,:,k) = xyr_Trans(:,:,1)
end do
!-----------------------------------------------------------------
! 長波地表温度変化の計算
! Calclate surface temperature tendency with long wave
!-----------------------------------------------------------------
do k = 0, kmax
xyra_DelRadLFlux(:,:,k,0) = 4.0_DP * xy_SurfPiB / xy_SurfTemp * xyr_Trans1(:,:,k)
xyra_DelRadLFlux(:,:,k,1) = 4.0_DP * xyz_PiB(:,:,0) / xyz_Temp(:,:,0) * ( xyr_Trans2(:,:,k) - xyr_Trans1(:,:,k) )
end do
!-----------------------------------------------------------------
! 終了処理, 例外処理
! Termination and Exception handling
!-----------------------------------------------------------------
999 continue
call StoreError( stat, subname, err, cause_c )
call EndSub( subname )
end subroutine PhyRadFluxLongFlux
| Subroutine : | |||
| nmlfile : | character(*), intent(in)
| ||
| delta_time_value_RadLong : | real(DP), intent(inout)
| ||
| delta_time_unit_RadLong_ : | character(*), intent(inout) | ||
| delta_time_value_RadShort : | real(DP), intent(inout)
| ||
| delta_time_unit_RadShort_ : | character(*), intent(inout) | ||
| LongBandNumber : | integer, intent(inout)
| ||
| LongAbsorpCoeffQVap(1:MaximumBandNumber) : | real(DP), intent(inout)
| ||
| LongAbsorpCoeffDryAir(1:MaximumBandNumber) : | real(DP), intent(inout)
| ||
| LongBandWeight(1:MaximumBandNumber) : | real(DP), intent(inout)
| ||
| LongPathLengthFact : | real(DP), intent(inout)
| ||
| ShortBandNumber : | integer, intent(inout)
| ||
| ShortAbsorpCoeffQVap(1:MaximumBandNumber) : | real(DP), intent(inout)
| ||
| ShortAbsorpCoeffDryAir(1:MaximumBandNumber) : | real(DP), intent(inout)
| ||
| ShortBandWeight(1:MaximumBandNumber) : | real(DP), intent(inout)
| ||
| ShortSecScat : | real(DP), intent(inout)
| ||
| SolarCoeff : | real(DP), intent(inout)
| ||
| AtmosAlbedo : | real(DP), intent(inout)
| ||
| IncomAIns : | real(DP), intent(inout)
| ||
| IncomBIns : | real(DP), intent(inout)
| ||
| IncomAZet : | real(DP), intent(inout)
| ||
| IncomBZet : | real(DP), intent(inout)
| ||
| err : | logical, intent(out), optional
|
NAMELIST ファイル nmlfile から値を入力するための 内部サブルーチンです. PhyRadFluxCreate 内で呼び出されることを 想定しています.
値が NAMELIST ファイル内で指定されていない場合には, 入力された値がそのまま返ります.
なお, nmlfile に空文字が与えられた場合, または 与えられた nmlfile を読み込むことができない場合, プログラムはエラーを発生させます.
This is an internal subroutine to input values from NAMELIST file nmlfile. This subroutine is expected to be called by "PhyRadFluxCreate".
A value not specified in NAMELIST file is returned without change.
If nmlfile is empty, or nmlfile can not be read, error is occurred.
This procedure input/output NAMELIST#phy_radiation_flux_nml .
subroutine PhyRadFluxNmlRead( nmlfile, delta_time_value_RadLong, delta_time_unit_RadLong_, delta_time_value_RadShort, delta_time_unit_RadShort_, LongBandNumber, LongAbsorpCoeffQVap, LongAbsorpCoeffDryAir, LongBandWeight, LongPathLengthFact, ShortBandNumber, ShortAbsorpCoeffQVap, ShortAbsorpCoeffDryAir, ShortBandWeight, ShortSecScat, SolarCoeff, AtmosAlbedo, IncomAIns, IncomBIns, IncomAZet, IncomBZet, err )
!
! NAMELIST ファイル *nmlfile* から値を入力するための
! 内部サブルーチンです. PhyRadFluxCreate 内で呼び出されることを
! 想定しています.
!
! 値が NAMELIST ファイル内で指定されていない場合には,
! 入力された値がそのまま返ります.
!
! なお, *nmlfile* に空文字が与えられた場合, または
! 与えられた *nmlfile* を読み込むことができない場合,
! プログラムはエラーを発生させます.
!
! This is an internal subroutine to input values from
! NAMELIST file *nmlfile*. This subroutine is expected to be
! called by "PhyRadFluxCreate".
!
! A value not specified in NAMELIST file is returned
! without change.
!
! If *nmlfile* is empty, or *nmlfile* can not be read,
! error is occurred.
!
use dc_trace, only: BeginSub, EndSub
use dc_string, only: PutLine, Printf
use dc_types, only: DP, STRING, TOKEN, STDOUT
use dc_iounit, only: FileOpen
use dc_message, only: MessageNotify
use dc_present, only: present_and_true
use dc_error, only: StoreError, DC_NOERR, DC_ENOFILEREAD
implicit none
character(*), intent(in):: nmlfile
! NAMELIST ファイルの名称.
! NAMELIST file name
real(DP), intent(inout):: delta_time_value_RadLong
! 長波フラックスを計算するステップ間隔の数値.
! Value of step interval of long wave flux calculation
character(*), intent(inout):: delta_time_unit_RadLong_
character(STRING):: delta_time_unit_RadLong
! 長波フラックスを計算するステップ間隔の単位.
! Unit of step interval of long wave flux calculation
real(DP), intent(inout):: delta_time_value_RadShort
! 短波 (日射) フラックスを計算するステップ間隔の数値.
! Value of step interval of short wave (insolation) flux calculation
character(*), intent(inout):: delta_time_unit_RadShort_
character(STRING):: delta_time_unit_RadShort
! 短波 (日射) フラックスを計算するステップ間隔の単位.
! Unit of step interval of short wave (insolation) flux calculation
integer, intent(inout):: LongBandNumber
! 長波バンド数.
! Number of long wave band
real(DP), intent(inout):: LongAbsorpCoeffQVap(1:MaximumBandNumber)
! 水の吸収係数.
! Absorption coefficient of water
real(DP), intent(inout):: LongAbsorpCoeffDryAir(1:MaximumBandNumber)
! 空気の吸収係数.
! Absorption coefficient of air
real(DP), intent(inout):: LongBandWeight(1:MaximumBandNumber)
! バンドウェイト.
! Band weight
real(DP), intent(inout):: LongPathLengthFact
! 光路長のファクタ.
! Factor of optical length
integer, intent(inout):: ShortBandNumber
! 短波バンド数.
! Number of long wave band
real(DP), intent(inout):: ShortAbsorpCoeffQVap(1:MaximumBandNumber)
! 水の吸収係数.
! Absorption coefficient of water
real(DP), intent(inout):: ShortAbsorpCoeffDryAir(1:MaximumBandNumber)
! 空気の吸収係数.
! Absorption coefficient of air
real(DP), intent(inout):: ShortBandWeight(1:MaximumBandNumber)
! バンドウェイト.
! Band weight
real(DP), intent(inout):: ShortSecScat
! 散乱の $ sec \zeta $
! $ sec \zeta $ of scattering
real(DP), intent(inout):: SolarCoeff
! 太陽定数.
! Solar constant
real(DP), intent(inout):: AtmosAlbedo
! 大気アルベド.
! Albedo of air
!!$ real(DP), intent(inout):: EpsOrb
!!$ ! 赤道傾斜角.
!!$ ! Inclination of equator to orbit
!!$ real(DP), intent(inout):: EqnOrb
!!$ ! 昇降点黄経.
!!$ !
real(DP), intent(inout):: IncomAIns
! 年平均入射の係数.
! Coefficient of annual mean incoming radiation.
real(DP), intent(inout):: IncomBIns
! 年平均入射の係数. AIns に同じ.
! Coefficient of annual mean incoming radiation.
! Same as "AIns".
real(DP), intent(inout):: IncomAZet
! 年平均入射角の係数. AIns に同じ.
! Coefficient of annual mean incoming radiation.
! Same as "AIns".
real(DP), intent(inout):: IncomBZet
! 年平均入射角の係数. AIns に同じ.
! Coefficient of annual mean incoming radiation.
! Same as "AIns".
logical, intent(out), optional:: err
! 例外処理用フラグ.
! デフォルトでは, この手続き内でエラーが
! 生じた場合, プログラムは強制終了します.
! 引数 *err* が与えられる場合,
! プログラムは強制終了せず, 代わりに
! *err* に .true. が代入されます.
!
! Exception handling flag.
! By default, when error occur in
! this procedure, the program aborts.
! If this *err* argument is given,
! .true. is substituted to *err* and
! the program does not abort.
namelist /phy_radiation_flux_nml/ delta_time_value_RadLong, delta_time_unit_RadLong, delta_time_value_RadShort, delta_time_unit_RadShort, LongBandNumber, LongAbsorpCoeffQVap, LongAbsorpCoeffDryAir, LongBandWeight, LongPathLengthFact, ShortBandNumber, ShortAbsorpCoeffQVap, ShortAbsorpCoeffDryAir, ShortBandWeight, ShortSecScat, SolarCoeff, AtmosAlbedo, IncomAIns, IncomBIns, IncomAZet, IncomBZet
! phy_radiation_flux モジュール用
! NAMELIST 変数群名.
!
! phy_radiation_flux#Create を使用する際に,
! オプショナル引数 *nmlfile* へ NAMELIST
! ファイル名を指定することで, そのファイルから
! この NAMELIST 変数群を読み込みます.
!
! NAMELIST group name for
! "phy_radiation_flux" module.
!
! If a NAMELIST filename is specified to
! an optional argument *nmlfile*
! when "phy_radiation_flux#Create" is used,
! this NAMELIST group is loaded from
! the file.
!-----------------------------------
! 作業変数
! Work variables
integer:: stat
character(STRING):: cause_c
integer:: unit_nml ! NAMELIST ファイルオープン用装置番号.
! Unit number for NAMELIST file open
integer:: iostat_nml ! NAMELIST 読み込み時の IOSTAT.
! IOSTAT of NAMELIST read
character(*), parameter:: subname = 'PhyRadFluxNmlRead'
continue
call BeginSub( subname )
stat = DC_NOERR
cause_c = ''
!-----------------------------------------------------------------
! 文字型引数を NAMELIST 変数群へ代入
! Substitute character arguments to NAMELIST group
!-----------------------------------------------------------------
delta_time_unit_RadLong = delta_time_unit_RadLong_
delta_time_unit_RadShort = delta_time_unit_RadShort_
!----------------------------------------------------------------
! NAMELIST ファイルのオープン
! Open NAMELIST file
!----------------------------------------------------------------
call FileOpen( unit = unit_nml, file = nmlfile, mode = 'r', err = err ) ! (out)
if ( present_and_true(err) ) then
stat = DC_ENOFILEREAD
cause_c = nmlfile
goto 999
end if
!-----------------------------------------------------------------
! NAMELIST 変数群の取得
! Get NAMELIST group
!-----------------------------------------------------------------
read( unit = unit_nml, nml = phy_radiation_flux_nml, iostat = iostat_nml ) ! (out)
if ( iostat_nml == 0 ) then
call MessageNotify( 'M', subname, 'NAMELIST group "%c" is loaded from "%c".', c1 = 'phy_radiation_flux_nml', c2 = trim(nmlfile) )
!!$ write(STDOUT, nml = phy_radiation_flux_nml)
else
call MessageNotify( 'W', subname, 'NAMELIST group "%c" is not found in "%c" (iostat=%d).', c1 = 'phy_radiation_flux_nml', c2 = trim(nmlfile), i = (/iostat_nml/) )
end if
close( unit_nml )
!-----------------------------------------------------------------
! NAMELIST 変数群を文字型引数へ代入
! Substitute NAMELIST group to character arguments
!-----------------------------------------------------------------
delta_time_unit_RadLong_ = delta_time_unit_RadLong
delta_time_unit_RadShort_ = delta_time_unit_RadShort
!-----------------------------------------------------------------
! 終了処理, 例外処理
! Termination and Exception handling
!-----------------------------------------------------------------
999 continue
call StoreError( stat, subname, err, cause_c )
call EndSub( subname )
end subroutine PhyRadFluxNmlRead
| Subroutine : | |||
| phy_radflx : | type(PHYRADFLX), intent(inout) | ||
| xyz_Temp(0:phy_radflx%imax-1, 0:phy_radflx%jmax-1, 0:phy_radflx%kmax-1) : | real(DP), intent(in)
| ||
| xyz_QVap(0:phy_radflx%imax-1, 0:phy_radflx%jmax-1, 0:phy_radflx%kmax-1) : | real(DP), intent(in)
| ||
| xyr_Press(0:phy_radflx%imax-1, 0:phy_radflx%jmax-1, 0:phy_radflx%kmax) : | real(DP), intent(in)
| ||
| xyr_RadLFlux(0:phy_radflx%imax-1, 0:phy_radflx%jmax-1, 0:phy_radflx%kmax) : | real(DP), intent(out)
| ||
| xya_SurfRadLMatrix(0:phy_radflx%imax-1, 0:phy_radflx%jmax-1, -1:1) : | real(DP), intent(out)
| ||
| xyra_DelRadLFlux(0:phy_radflx%imax-1, 0:phy_radflx%jmax-1, 0:phy_radflx%kmax, 0:1) : | real(DP), intent(out)
| ||
| xyr_RadSFlux(0:phy_radflx%imax-1, 0:phy_radflx%jmax-1, 0:phy_radflx%kmax) : | real(DP), intent(out)
| ||
| err : | logical, intent(out), optional
|
温度, 比湿, 気圧から, 放射フラックスを計算します.
なお, 与えられた phy_radflx が PhyRadFluxCreate によって初期設定 されていない場合, プログラムはエラーを発生させます.
Calculate radiation flux from temperature, specific humidity, and air pressure.
If phy_radflx is not initialized by "PhyRadFluxCreate" yet, error is occurred.
subroutine PhyRadFluxRadiationFlux( phy_radflx, xyz_Temp, xyz_QVap, xyr_Press, xyr_RadLFlux, xya_SurfRadLMatrix, xyra_DelRadLFlux, xyr_RadSFlux, err )
!
! 温度, 比湿, 気圧から, 放射フラックスを計算します.
!
! なお, 与えられた *phy_radflx* が PhyRadFluxCreate によって初期設定
! されていない場合, プログラムはエラーを発生させます.
!
! Calculate radiation flux from temperature, specific humidity, and
! air pressure.
!
! If *phy_radflx* is not initialized by "PhyRadFluxCreate" yet,
! error is occurred.
!
use dc_trace, only: BeginSub, EndSub, DbgMessage
use dc_string, only: PutLine, Printf
use dc_types, only: DP, STRING, TOKEN, STDOUT
use dc_error, only: StoreError, DC_NOERR, DC_ENOTINIT
use dc_date, only: EvalSec, EvalByUnit, mod, operator(*), operator(==), operator(<), operator(/), operator(+), operator(-)
implicit none
type(PHYRADFLX), intent(inout):: phy_radflx
real(DP), intent(in):: xyz_Temp (0:phy_radflx%imax-1, 0:phy_radflx%jmax-1, 0:phy_radflx%kmax-1)
! $ T $ . 温度. Temperature
real(DP), intent(in):: xyz_QVap (0:phy_radflx%imax-1, 0:phy_radflx%jmax-1, 0:phy_radflx%kmax-1)
! $ q $ . 比湿. Specific humidity
real(DP), intent(in):: xyr_Press (0:phy_radflx%imax-1, 0:phy_radflx%jmax-1, 0:phy_radflx%kmax)
! $ P_s $ . 地表面気圧 (半整数レベル).
! Surface pressure (half level)
real(DP), intent(out):: xyr_RadLFlux (0:phy_radflx%imax-1, 0:phy_radflx%jmax-1, 0:phy_radflx%kmax)
! 長波フラックス.
! Long wave flux
real(DP), intent(out):: xya_SurfRadLMatrix (0:phy_radflx%imax-1, 0:phy_radflx%jmax-1, -1:1)
! $ T $ 陰解行列: 地表.
! $ T $ implicit matrix: surface
real(DP), intent(out):: xyra_DelRadLFlux (0:phy_radflx%imax-1, 0:phy_radflx%jmax-1, 0:phy_radflx%kmax, 0:1)
! 長波地表温度変化.
! Surface temperature tendency with long wave
real(DP), intent(out):: xyr_RadSFlux (0:phy_radflx%imax-1, 0:phy_radflx%jmax-1, 0:phy_radflx%kmax)
! 短波 (日射) フラックス.
! Short wave (insolation) flux
logical, intent(out), optional:: err
! 例外処理用フラグ.
! デフォルトでは, この手続き内でエラーが
! 生じた場合, プログラムは強制終了します.
! 引数 *err* が与えられる場合,
! プログラムは強制終了せず, 代わりに
! *err* に .true. が代入されます.
!
! Exception handling flag.
! By default, when error occur in
! this procedure, the program aborts.
! If this *err* argument is given,
! .true. is substituted to *err* and
! the program does not abort.
!-----------------------------------
! 作業変数
! Work variables
integer:: kmax ! 鉛直層数.
! Number of vertical level
real(DP):: Grav ! $ g $ . 重力加速度. Gravitational acceleration
real(DP):: xy_SurfTemp (0:phy_radflx%imax-1, 0:phy_radflx%jmax-1)
! 地表面温度.
! Surface temperature
real(DP):: xy_TempSave (0:phy_radflx%imax-1, 0:phy_radflx%jmax-1)
! $ T $ . 温度 (保存用). Temperature (for save)
real(DP):: xyr_RadLFluxSave (0:phy_radflx%imax-1, 0:phy_radflx%jmax-1, 0:phy_radflx%kmax)
! 長波フラックス (保存用).
! Long wave flux (for save)
real(DP):: xyr_RadSFluxSave (0:phy_radflx%imax-1, 0:phy_radflx%jmax-1, 0:phy_radflx%kmax)
! 短波 (日射) フラックス (保存用).
! Short wave (insolation) flux (for save)
real(DP):: xyra_DelRadLFluxSave (0:phy_radflx%imax-1, 0:phy_radflx%jmax-1, 0:phy_radflx%kmax, 0:1)
! 長波地表温度変化 (保存用).
! Surface temperature tendency with long wave (for save)
real(DP):: xyr_TauQVap (0:phy_radflx%imax-1, 0:phy_radflx%jmax-1, 0:phy_radflx%kmax)
! 光学的厚さ:水
! Optical depth of water
real(DP):: xyr_TauDryAir (0:phy_radflx%imax-1, 0:phy_radflx%jmax-1, 0:phy_radflx%kmax)
! 光学的厚さ:空気
! Optical depth of air
integer:: k ! DO ループ用作業変数
! Work variables for DO loop
integer:: stat
character(STRING):: cause_c
character(*), parameter:: subname = 'PhyRadFluxRadiationFlux'
continue
call BeginSub( subname )
stat = DC_NOERR
cause_c = ''
!-----------------------------------------------------------------
! 初期設定のチェック
! Check initialization
!-----------------------------------------------------------------
if ( .not. phy_radflx % initialized ) then
stat = DC_ENOTINIT
cause_c = 'PHYRADFLX'
goto 999
end if
!-----------------------------------------------------------------
! *phy_radflx* に格納されている設定値の取り出し
! Fetch setting values stored in *phy_radflx*
!-----------------------------------------------------------------
kmax = phy_radflx % kmax
Grav = phy_radflx % Grav
xy_SurfTemp = phy_radflx % xy_SurfTemp
xyr_RadSFlux = 0.0_DP
xyr_RadSFlux(:,:,kmax) = phy_radflx % xy_IncomRadSFlux
xy_TempSave = phy_radflx % xy_TempSave
xyr_RadLFluxSave = phy_radflx % xyr_RadLFluxSave
xyr_RadSFluxSave = phy_radflx % xyr_RadSFluxSave
xyra_DelRadLFluxSave = phy_radflx % xyra_DelRadLFluxSave
!-----------------------------------------------------------------
! 光学的厚さの計算
! Calculate optical depth
!-----------------------------------------------------------------
xyr_TauQVap = 0.0_DP
xyr_TauDryAir = 0.0_DP
do k = kmax-1 , 0, -1
xyr_TauQVap(:,:,k) = xyr_TauQVap(:,:,k+1) + xyz_QVap(:,:,k) * ( xyr_Press(:,:,k) - xyr_Press(:,:,k+1) ) / Grav
xyr_TauDryAir(:,:,k) = xyr_TauDryAir(:,:,k+1) + ( xyr_Press(:,:,k) - xyr_Press(:,:,k+1) ) / Grav
end do
!-----------------------------------------------------------------
! 長波フラックスの算出
! Calculate long wave flux
!-----------------------------------------------------------------
!---------------------------------------------
! current_time / delta_time_RadLong == 0, または
! delta_time_RadLong 未設定, または
! まだ一度も計算していない場合には計算を行う.
!
! If current_time / delta_time_RadLong == 0, or
! "delta_time_RadLong" is not configured, or
! calculation was never performed,
! calculation is performed.
if ( mod( phy_radflx % current_time, phy_radflx % delta_time_RadLong) == 0 .or. EvalSec( phy_radflx % delta_time_RadLong ) < 0.0_DP .or. .not. phy_radflx % save_flag ) then
call DbgMessage( 'LongFlux is calculated' )
call LongFlux( phy_radflx = phy_radflx, xyr_RadLFlux = xyr_RadLFlux, xyra_DelRadLFlux = xyra_DelRadLFlux, xyz_Temp = xyz_Temp, xy_SurfTemp = xy_SurfTemp, xyr_TauQVap = xyr_TauQVap, xyr_TauDryAir = xyr_TauDryAir ) ! (in)
!-----------------------------------
! 前回の値を利用
! Use values in last time
else
call DbgMessage( 'LongFlux is not calculated. Save values are used' )
xyr_RadLFlux = xyr_RadLFluxSave
xyra_DelRadLFlux = xyra_DelRadLFluxSave
do k = 0, kmax
xyr_RadLFlux(:,:,k) = xyr_RadLFlux(:,:,k) + xyra_DelRadLFlux(:,:,k,1) * ( xyz_Temp(:,:,0) - xy_TempSave )
xyra_DelRadLFlux(:,:,k,1) = xyra_DelRadLFlux(:,:,k,1) / ( xy_TempSave**3 ) * ( xyz_Temp(:,:,0)**3 )
end do
end if
!-----------------------------------------------------------------
! 長波陰解用行列の算出
! Calculate long wave implicit matrix
!-----------------------------------------------------------------
xya_SurfRadLMatrix(:,:,0) = xyra_DelRadLFlux(:,:,0,0)
xya_SurfRadLMatrix(:,:,1) = xyra_DelRadLFlux(:,:,0,1)
xya_SurfRadLMatrix(:,:,-1) = 0.0_DP
!-----------------------------------------------------------------
! 短波 (日射) フラックスの算出
! Calculate short wave (insolation)
!-----------------------------------------------------------------
!---------------------------------------------
! current_time / delta_time_RadShort == 0, または
! delta_time_RadShort 未設定, または
! まだ一度も計算していない場合には計算を行う.
!
! If current_time / delta_time_RadShort == 0, or
! "delta_time_RadShort" is not configured, or
! calculation was never performed,
! calculation is performed.
if ( mod( phy_radflx % current_time, phy_radflx % delta_time_RadShort) == 0 .or. EvalSec( phy_radflx % delta_time_RadShort ) < 0.0_DP .or. .not. phy_radflx % save_flag ) then
call DbgMessage( 'ShortFlux is calculated' )
!---------------------------------
! 短波フラックスの計算
! Calculate short wave (insolation) flux
call ShortFlux( phy_radflx = phy_radflx, xyr_RadSFlux = xyr_RadSFlux, xyr_TauQVap = xyr_TauQVap, xyr_TauDryAir = xyr_TauDryAir ) ! (in)
!-----------------------------------
! 前回の値を利用
! Use values in last time
else
call DbgMessage( 'ShortFlux is not calculated. Save values are used' )
xyr_RadSFlux = xyr_RadSFluxSave
end if
!-----------------------------------------------------------------
! 今回計算した値を保存
! Save calculated values in this time
!-----------------------------------------------------------------
phy_radflx % xy_TempSave = xyz_Temp (:,:,0)
phy_radflx % xyr_RadLFluxSave = xyr_RadLFlux
phy_radflx % xyr_RadSFluxSave = xyr_RadSFlux
phy_radflx % xyra_DelRadLFluxSave = xyra_DelRadLFlux
phy_radflx % save_flag = .true.
!-----------------------------------------------------------------
! 時刻の更新
! Update time
!-----------------------------------------------------------------
phy_radflx % current_time = phy_radflx % current_time + phy_radflx % delta_time
!-----------------------------------------------------------------
! 終了処理, 例外処理
! Termination and Exception handling
!-----------------------------------------------------------------
999 continue
call StoreError( stat, subname, err, cause_c )
call EndSub( subname )
end subroutine PhyRadFluxRadiationFlux
| Subroutine : | |||
| phy_radflx : | type(PHYRADFLX), intent(inout) | ||
| xyr_RadSFlux(0:phy_radflx%imax-1, 0:phy_radflx%jmax-1, 0:phy_radflx%kmax) : | real(DP), intent(inout)
| ||
| xyr_TauQVap(0:phy_radflx%imax-1, 0:phy_radflx%jmax-1, 0:phy_radflx%kmax) : | real(DP), intent(in)
| ||
| xyr_TauDryAir(0:phy_radflx%imax-1, 0:phy_radflx%jmax-1, 0:phy_radflx%kmax) : | real(DP), intent(in)
| ||
| err : | logical, intent(out), optional
|
長波フラックスの計算
なお, 与えられた phy_radflx が PhyRadFluxCreate によって初期設定 されていない場合, プログラムはエラーを発生させます.
Calculate long wave flux
If phy_radflx is not initialized by "PhyRadFluxCreate" yet, error is occurred.
subroutine PhyRadFluxShortFlux( phy_radflx, xyr_RadSFlux, xyr_TauQVap, xyr_TauDryAir, err )
!
! 長波フラックスの計算
!
! なお, 与えられた *phy_radflx* が PhyRadFluxCreate によって初期設定
! されていない場合, プログラムはエラーを発生させます.
!
! Calculate long wave flux
!
! If *phy_radflx* is not initialized by "PhyRadFluxCreate" yet,
! error is occurred.
!
use dc_trace, only: BeginSub, EndSub
use dc_string, only: PutLine, Printf
use dc_types, only: DP, STRING, TOKEN, STDOUT
use dc_error, only: StoreError, DC_NOERR, DC_ENOTINIT
implicit none
type(PHYRADFLX), intent(inout):: phy_radflx
real(DP), intent(inout):: xyr_RadSFlux (0:phy_radflx%imax-1, 0:phy_radflx%jmax-1, 0:phy_radflx%kmax)
! 短波 (日射) フラックス.
! Short wave (insolation) flux
real(DP), intent(in):: xyr_TauQVap (0:phy_radflx%imax-1, 0:phy_radflx%jmax-1, 0:phy_radflx%kmax)
! 光学的厚さ:水
! Optical depth of water
real(DP), intent(in):: xyr_TauDryAir (0:phy_radflx%imax-1, 0:phy_radflx%jmax-1, 0:phy_radflx%kmax)
! 光学的厚さ:空気
! Optical depth of air
logical, intent(out), optional:: err
! 例外処理用フラグ.
! デフォルトでは, この手続き内でエラーが
! 生じた場合, プログラムは強制終了します.
! 引数 *err* が与えられる場合,
! プログラムは強制終了せず, 代わりに
! *err* に .true. が代入されます.
!
! Exception handling flag.
! By default, when error occur in
! this procedure, the program aborts.
! If this *err* argument is given,
! .true. is substituted to *err* and
! the program does not abort.
!-----------------------------------
! 作業変数
! Work variables
integer:: kmax ! 鉛直層数.
! Number of vertical level
real(DP):: xy_InAngle (0:phy_radflx%imax-1, 0:phy_radflx%jmax-1)
! sec (入射角).
! sec (angle of incidence)
real(DP):: xy_SurfAlbedo (0:phy_radflx%imax-1, 0:phy_radflx%jmax-1)
! 地表アルベド.
! Surface albedo
integer:: bn
real(DP):: BandWeightSum
integer:: BandNumber
! 短波バンド数.
! Number of short wave band
real(DP), pointer:: AbsorpCoeffQVap(:)
! 水の吸収係数.
! Absorption coefficient of water
real(DP), pointer:: AbsorpCoeffDryAir(:)
! 空気の吸収係数.
! Absorption coefficient of air
real(DP), pointer:: BandWeight(:)
! バンドウェイト.
! Band weight
real(DP):: SecScat
! 散乱の $ sec \zeta $
! $ sec \zeta $ of scattering
integer:: k ! DO ループ用作業変数
! Work variables for DO loop
integer:: stat
character(STRING):: cause_c
character(*), parameter:: subname = 'PhyRadFluxShortFlux'
continue
call BeginSub( subname )
stat = DC_NOERR
cause_c = ''
!-----------------------------------------------------------------
! 初期設定のチェック
! Check initialization
!-----------------------------------------------------------------
if ( .not. phy_radflx % initialized ) then
stat = DC_ENOTINIT
cause_c = 'PHYRADFLX'
goto 999
end if
!-----------------------------------------------------------------
! *phy_radflx* に格納されている設定値の取り出し
! Fetch setting values stored in *phy_radflx*
!-----------------------------------------------------------------
kmax = phy_radflx % kmax
xy_InAngle = phy_radflx % xy_InAngle
xy_SurfAlbedo = phy_radflx % xy_SurfAlbedo
BandNumber = phy_radflx % ShortBandNumber
AbsorpCoeffQVap => phy_radflx % ShortAbsorpCoeffQVap
AbsorpCoeffDryAir => phy_radflx % ShortAbsorpCoeffDryAir
BandWeight => phy_radflx % ShortBandWeight
SecScat = phy_radflx % ShortSecScat
!-----------------------------------------------------------------
! バンドウェイトの設定
! Configure band weight
!-----------------------------------------------------------------
BandWeightSum = 0.0_DP
do bn = 1, BandNumber
BandWeightSum = BandWeightSum + BandWeight(bn)
end do
do bn = 1, BandNumber
BandWeight(bn) = BandWeight(bn) / BandWeightSum
end do
do bn = 1, BandNumber
do k = 0, kmax
!-------------------------------------------------------------
! 各レベルでの下向き透過
! Downward transmission on each level
!-------------------------------------------------------------
if ( k /= kmax ) then
xyr_RadSFlux(:,:,k) = xyr_RadSFlux(:,:,k) + BandWeight(bn) * xyr_RadSFlux(:,:,kmax) * exp( - xy_InAngle(:,:) * ( AbsorpCoeffQVap(bn) * xyr_TauQVap(:,:,k) + AbsorpCoeffDryAir(bn) * xyr_TauDryAir(:,:,k) ) )
end if
!-------------------------------------------------------------
! 各レベルでの上向き透過
! Upward transmission on each level
!-------------------------------------------------------------
xyr_RadSFlux(:,:,k) = xyr_RadSFlux(:,:,k) - BandWeight(bn) * xyr_RadSFlux(:,:,kmax) * exp( - xy_InAngle(:,:) * ( AbsorpCoeffQVap(bn) * xyr_TauQVap(:,:,0) + AbsorpCoeffDryAir(bn) * xyr_TauDryAir(:,:,0) ) ) * xy_SurfAlbedo * exp( - SecScat * ( AbsorpCoeffQVap(bn) * ( xyr_TauQVap(:,:,0) - xyr_TauQVap(:,:,k) ) + AbsorpCoeffDryAir(bn) * ( xyr_TauDryAir(:,:,0) - xyr_TauDryAir(:,:,k) ) ) )
end do
end do
!-----------------------------------------------------------------
! 吸収なしの場合
! In the case of no absorption
!-----------------------------------------------------------------
if ( BandNumber == 0 ) then
do k = 0, kmax
xyr_RadSFlux(:,:,k) = ( 1.0_DP - xy_SurfAlbedo ) * xyr_RadSFlux(:,:,kmax)
end do
end if
!-----------------------------------------------------------------
! 終了処理, 例外処理
! Termination and Exception handling
!-----------------------------------------------------------------
999 continue
call StoreError( stat, subname, err, cause_c )
call EndSub( subname )
end subroutine PhyRadFluxShortFlux
| Subroutine : | |||
| phy_radflx : | type(PHYRADFLX), intent(inout) | ||
| xy_IncomRadSFlux(0:phy_radflx%imax-1, 0:phy_radflx%jmax-1) : | real(DP), intent(out)
| ||
| xy_InAngle(0:phy_radflx%imax-1, 0:phy_radflx%jmax-1) : | real(DP), intent(out)
| ||
| err : | logical, intent(out), optional
|
短波入射を計算します.
なお, 与えられた phy_radflx が PhyRadFluxCreate によって初期設定 されていない場合, プログラムはエラーを発生させます.
Calculate short wave (insolation) incoming radiation.
If phy_radflx is not initialized by "PhyRadFluxCreate" yet, error is occurred.
subroutine PhyRadFluxShortIncoming( phy_radflx, xy_IncomRadSFlux, xy_InAngle, err )
!
! 短波入射を計算します.
!
! なお, 与えられた *phy_radflx* が PhyRadFluxCreate によって初期設定
! されていない場合, プログラムはエラーを発生させます.
!
! Calculate short wave (insolation) incoming radiation.
!
! If *phy_radflx* is not initialized by "PhyRadFluxCreate" yet,
! error is occurred.
!
use dc_trace, only: BeginSub, EndSub
use dc_string, only: PutLine, Printf
use dc_types, only: DP, STRING, TOKEN, STDOUT
use dc_error, only: StoreError, DC_NOERR, DC_ENOTINIT
implicit none
type(PHYRADFLX), intent(inout):: phy_radflx
real(DP), intent(out):: xy_IncomRadSFlux (0:phy_radflx%imax-1, 0:phy_radflx%jmax-1)
! 短波 (日射) フラックス.
! Short wave (insolation) flux
real(DP), intent(out):: xy_InAngle (0:phy_radflx%imax-1, 0:phy_radflx%jmax-1)
! sec (入射角).
! sec (angle of incidence)
logical, intent(out), optional:: err
! 例外処理用フラグ.
! デフォルトでは, この手続き内でエラーが
! 生じた場合, プログラムは強制終了します.
! 引数 *err* が与えられる場合,
! プログラムは強制終了せず, 代わりに
! *err* に .true. が代入されます.
!
! Exception handling flag.
! By default, when error occur in
! this procedure, the program aborts.
! If this *err* argument is given,
! .true. is substituted to *err* and
! the program does not abort.
!-----------------------------------
! 作業変数
! Work variables
integer:: imax ! 経度格子点数.
! Number of grid points in longitude
integer:: jmax ! 緯度格子点数.
! Number of grid points in latitude
real(DP):: y_Lat (0:phy_radflx%jmax-1)
! 緯度 (ラジアン). Latitude (radian)
real(DP):: SolarCoeff
! 太陽定数.
! Solar constant
real(DP):: AtmosAlbedo
! 大気アルベド.
! Albedo of air
!!$ real(DP):: EpsOrb
!!$ ! 赤道傾斜角.
!!$ ! Inclination of equator to orbit
!!$ real(DP):: EqnOrb
!!$ ! 昇降点黄経.
!!$ !
real(DP):: AIns
! 年平均入射の係数.
! Coefficient of annual mean incoming radiation.
real(DP):: BIns
! 年平均入射の係数. AIns に同じ.
! Coefficient of annual mean incoming radiation.
! Same as "AIns".
real(DP):: AZet
! 年平均入射角の係数. AIns に同じ.
! Coefficient of annual mean incoming radiation.
! Same as "AIns".
real(DP):: BZet
! 年平均入射角の係数. AIns に同じ.
! Coefficient of annual mean incoming radiation.
! Same as "AIns".
integer:: i, j ! DO ループ用作業変数
! Work variables for DO loop
integer:: stat
character(STRING):: cause_c
character(*), parameter:: subname = 'PhyRadFluxShortIncoming'
continue
call BeginSub( subname )
stat = DC_NOERR
cause_c = ''
!-----------------------------------------------------------------
! 初期設定のチェック
! Check initialization
!-----------------------------------------------------------------
if ( .not. phy_radflx % initialized ) then
stat = DC_ENOTINIT
cause_c = 'PHYRADFLX'
goto 999
end if
!-----------------------------------------------------------------
! *phy_radflx* に格納されている設定値の取り出し
! Fetch setting values stored in *phy_radflx*
!-----------------------------------------------------------------
imax = phy_radflx % imax
jmax = phy_radflx % jmax
y_Lat = phy_radflx % y_Lat
SolarCoeff = phy_radflx % SolarCoeff
AtmosAlbedo = phy_radflx % AtmosAlbedo
!!$ EpsOrb = phy_radflx % EpsOrb
!!$ EqnOrb = phy_radflx % EqnOrb
AIns = phy_radflx % IncomAIns
BIns = phy_radflx % IncomBIns
AZet = phy_radflx % IncomAZet
BZet = phy_radflx % IncomBZet
!-----------------------------------------------------------------
! 年, 日平均日射の計算
! Calculate annual mean, daily mean insolation
!-----------------------------------------------------------------
do i = 0, imax - 1
do j = 0, jmax - 1
xy_IncomRadSFlux(i,j) = - SolarCoeff * (1.0_DP - AtmosAlbedo ) * ( AIns + BIns * cos( y_Lat(j) )**2 )
if ( xy_IncomRadSFlux(i,j) < 0.0_DP ) then
xy_InAngle(i,j) = 1.0_DP / ( AZet + BZet * cos( y_Lat(j) )**2 )
else
xy_IncomRadSFlux(i,j) = 0.0_DP
xy_InAngle(i,j) = 0.0_DP
end if
end do
end do
!-----------------------------------------------------------------
! 季節変化, 日変化がある場合の計算
! Calculate with seasonal change and diurnal change
!-----------------------------------------------------------------
! 近く AGCM5 から移植予定.
! Importation from AGCM5 is planed within days
!-----------------------------------------------------------------
! 終了処理, 例外処理
! Termination and Exception handling
!-----------------------------------------------------------------
999 continue
call StoreError( stat, subname, err, cause_c )
call EndSub( subname )
end subroutine PhyRadFluxShortIncoming
| Subroutine : | |||
| phy_radflx : | type(PHYRADFLX), intent(inout) | ||
| xyr_RadSFlux(0:phy_radflx%imax-1, 0:phy_radflx%jmax-1, 0:phy_radflx%kmax) : | real(DP), intent(inout)
| ||
| xyr_TauQVap(0:phy_radflx%imax-1, 0:phy_radflx%jmax-1, 0:phy_radflx%kmax) : | real(DP), intent(in)
| ||
| xyr_TauDryAir(0:phy_radflx%imax-1, 0:phy_radflx%jmax-1, 0:phy_radflx%kmax) : | real(DP), intent(in)
| ||
| err : | logical, intent(out), optional
|
長波フラックスの計算
なお, 与えられた phy_radflx が PhyRadFluxCreate によって初期設定 されていない場合, プログラムはエラーを発生させます.
Calculate long wave flux
If phy_radflx is not initialized by "PhyRadFluxCreate" yet, error is occurred.
Alias for PhyRadFluxShortFlux
| Subroutine : | |||
| phy_radflx : | type(PHYRADFLX), intent(inout) | ||
| xy_IncomRadSFlux(0:phy_radflx%imax-1, 0:phy_radflx%jmax-1) : | real(DP), intent(out)
| ||
| xy_InAngle(0:phy_radflx%imax-1, 0:phy_radflx%jmax-1) : | real(DP), intent(out)
| ||
| err : | logical, intent(out), optional
|
短波入射を計算します.
なお, 与えられた phy_radflx が PhyRadFluxCreate によって初期設定 されていない場合, プログラムはエラーを発生させます.
Calculate short wave (insolation) incoming radiation.
If phy_radflx is not initialized by "PhyRadFluxCreate" yet, error is occurred.
Alias for PhyRadFluxShortIncoming
| Subroutine : |
配列型データを NAMELIST から読み込んだ際の値の妥当性を チェックする.
妥当性が検証された場合には, a_loaded_array に, 過不足ない 配列サイズのデータが格納される.
一方, 妥当性が検証されない場合には, err_count の値が プラス 1 され, 警告メッセージが表示される.
Check validation when array data is loaded from NAMELIST.
If validation is checked, just enough data is stored in "a_loaded_array".
Otherwise, if validation is not checked, add 1 to value of "err_count", and display warning messages.
subroutine array_validation_check
!
! 配列型データを NAMELIST から読み込んだ際の値の妥当性を
! チェックする.
!
! 妥当性が検証された場合には, a_loaded_array に, 過不足ない
! 配列サイズのデータが格納される.
!
! 一方, 妥当性が検証されない場合には, err_count の値が
! プラス 1 され, 警告メッセージが表示される.
!
!
! Check validation when array data is loaded from NAMELIST.
!
! If validation is checked, just enough data is stored in
! "a_loaded_array".
!
! Otherwise, if validation is not checked, add 1 to
! value of "err_count", and display warning messages.
!
loaded_ary_size = count( a_loaded_array > invalid_value + 1.0_DP )
if ( loaded_ary_size == 0 ) then
loaded_ary_size = size( a_default_array )
deallocate( a_loaded_array )
a_loaded_array => a_default_array
end if
if ( loaded_ary_size == ary_size ) then
call MessageNotify( 'M', subname, ok_msg, c1 = trim(loaded_array_name), i = (/1, loaded_ary_size/), d = a_loaded_array, n = (/loaded_ary_size/) )
allocate( a_loaded_array_tmp(1:loaded_ary_size) )
a_loaded_array_tmp(1:loaded_ary_size) = a_loaded_array(1:loaded_ary_size)
nullify( a_loaded_array )
a_loaded_array => a_loaded_array_tmp
nullify( a_loaded_array_tmp )
else
call MessageNotify( 'W', subname, warn_msg, c1 = trim(loaded_array_name), i = (/loaded_ary_size, ary_size/) )
err_count = err_count + 1
end if
end subroutine array_validation_check
| Constant : | |
| version = ’$Name: dcpam4-20080609-1 $’ // ’$Id: phy_radiation_flux.f90,v 1.10 2008-03-02 22:34:19 morikawa Exp $’ : | character(*), parameter |