Class | set_TWPICE_profile |
In: |
dynamics/set_TWPICE_profile.f90
|
Subroutine : | |
Time : | real(DP), intent(in ) |
xyz_Press(0:imax-1,1:jmax,1:kmax) : | real(DP), intent(in ) |
xyz_Exner(0:imax-1,1:jmax,1:kmax) : | real(DP), intent(in ) |
xyz_Height(0:imax-1,1:jmax,1:kmax) : | real(DP), intent(in ) |
xyz_DUDtPhy(0:imax-1,1:jmax,1:kmax) : | real(DP), intent(in ) |
xyz_DVDtPhy(0:imax-1,1:jmax,1:kmax) : | real(DP), intent(in ) |
xyz_DTempDtPhy(0:imax-1,1:jmax,1:kmax) : | real(DP), intent(in ) |
xyzf_DQMixDtPhy(0:imax-1,1:jmax,1:kmax,1:ncmax) : | real(DP), intent(in ) |
xy_PsB(0:imax-1,1:jmax) : | real(DP), intent(in ) |
xyz_UB(0:imax-1,1:jmax,1:kmax) : | real(DP), intent(in ) |
xyz_VB(0:imax-1,1:jmax,1:kmax) : | real(DP), intent(in ) |
xyz_TempB(0:imax-1,1:jmax,1:kmax) : | real(DP), intent(in ) |
xyzf_QMixB(0:imax-1,1:jmax,1:kmax,1:ncmax) : | real(DP), intent(in ) |
xy_PsA(0:imax-1,1:jmax) : | real(DP), intent(out) |
xyz_UA(0:imax-1,1:jmax,1:kmax) : | real(DP), intent(out) |
xyz_VA(0:imax-1,1:jmax,1:kmax) : | real(DP), intent(out) |
xyz_TempA(0:imax-1,1:jmax,1:kmax) : | real(DP), intent(out) |
xyzf_QMixA(0:imax-1,1:jmax,1:kmax,1:ncmax) : | real(DP), intent(out) |
subroutine SetTWPICEProfileDynamics( Time, xyz_Press, xyz_Exner, xyz_Height, xyz_DUDtPhy, xyz_DVDtPhy, xyz_DTempDtPhy, xyzf_DQMixDtPhy, xy_PsB, xyz_UB, xyz_VB, xyz_TempB, xyzf_QMixB, xy_PsA, xyz_UA, xyz_VA, xyz_TempA, xyzf_QMixA ) ! モジュール引用 ; USE statements ! ! ヒストリデータ出力 ! History data output ! use gtool_historyauto, only: HistoryAutoPut ! 物理定数設定 ! Physical constants settings ! use constants, only: Omega ! $ \Omega $ [s-1]. ! 回転角速度. ! Angular velocity ! 組成に関わる配列の設定 ! Settings of array for atmospheric composition ! use composition, only: ncmax, IndexH2OVap ! 座標データ設定 ! Axes data settings ! use axesset, only : y_Lat ! 格子点設定 ! Grid points settings ! use gridset, only: imax, jmax, kmax ! 鉛直層数. ! Number of vertical level ! 組成に関わる配列の設定 ! Settings of array for atmospheric composition ! use composition, only: ncmax, IndexH2OVap ! 時刻管理 ! Time control ! use timeset, only: DelTime ! $ \Delta t $ [s] ! 温度の半整数σレベルの補間, 気圧と高度の算出 ! Interpolate temperature on half sigma level, ! and calculate pressure and height ! use auxiliary, only: AuxVars real(DP), intent(in ) :: Time real(DP), intent(in ) :: xyz_Press(0:imax-1,1:jmax,1:kmax) real(DP), intent(in ) :: xyz_Exner(0:imax-1,1:jmax,1:kmax) real(DP), intent(in ) :: xyz_Height(0:imax-1,1:jmax,1:kmax) real(DP), intent(in ) :: xyz_DUDtPhy(0:imax-1,1:jmax,1:kmax) real(DP), intent(in ) :: xyz_DVDtPhy(0:imax-1,1:jmax,1:kmax) real(DP), intent(in ) :: xyz_DTempDtPhy (0:imax-1,1:jmax,1:kmax) real(DP), intent(in ) :: xyzf_DQMixDtPhy(0:imax-1,1:jmax,1:kmax,1:ncmax) real(DP), intent(in ) :: xy_PsB (0:imax-1,1:jmax) real(DP), intent(in ) :: xyz_UB (0:imax-1,1:jmax,1:kmax) real(DP), intent(in ) :: xyz_VB (0:imax-1,1:jmax,1:kmax) real(DP), intent(in ) :: xyz_TempB (0:imax-1,1:jmax,1:kmax) real(DP), intent(in ) :: xyzf_QMixB(0:imax-1,1:jmax,1:kmax,1:ncmax) real(DP), intent(out) :: xy_PsA (0:imax-1,1:jmax) real(DP), intent(out) :: xyz_UA (0:imax-1,1:jmax,1:kmax) real(DP), intent(out) :: xyz_VA (0:imax-1,1:jmax,1:kmax) real(DP), intent(out) :: xyz_TempA (0:imax-1,1:jmax,1:kmax) real(DP), intent(out) :: xyzf_QMixA(0:imax-1,1:jmax,1:kmax,1:ncmax) ! ! local variables ! character(len=STRING) :: InFileName character(len=STRING) :: InVarName real(DP) :: xyz_CorPar (0:imax-1,1:jmax,1:kmax) real(DP) :: xyz_PTempB (0:imax-1,1:jmax,1:kmax) real(DP) :: xyz_PTempA (0:imax-1,1:jmax,1:kmax) real(DP) :: xyz_ExnerA (0:imax-1,1:jmax,1:kmax) real(DP) :: xyz_UObs (0:imax-1,1:jmax,1:kmax) real(DP) :: xyz_VObs (0:imax-1,1:jmax,1:kmax) real(DP) :: xyz_WObs (0:imax-1,1:jmax,1:kmax) real(DP) :: xyz_DUDtVAdv(0:imax-1,1:jmax,1:kmax) real(DP) :: xyz_DVDtVAdv(0:imax-1,1:jmax,1:kmax) real(DP) :: xyz_DPTempDtHAdv(0:imax-1,1:jmax,1:kmax) real(DP) :: xyz_DQVapDtHAdv (0:imax-1,1:jmax,1:kmax) real(DP) :: xyz_DPTempDtVAdv(0:imax-1,1:jmax,1:kmax) real(DP) :: xyz_DQVapDtVAdv (0:imax-1,1:jmax,1:kmax) real(DP) :: xyz_DUDt (0:imax-1,1:jmax,1:kmax) real(DP) :: xyz_DVDt (0:imax-1,1:jmax,1:kmax) real(DP) :: xyz_DPTempDt(0:imax-1,1:jmax,1:kmax) real(DP) :: xyz_DQVapDt (0:imax-1,1:jmax,1:kmax) real(DP), parameter :: UVTimeConst = 2.0_DP * 60.0_DP * 60.0_DP integer :: j integer :: k integer :: n ! 初期化確認 ! Initialization check ! if ( .not. set_TWPICE_profile_inited ) then call MessageNotify( 'E', module_name, 'This module has not been initialized.' ) end if do k = 1, kmax do j = 1, jmax xyz_CorPar(:,j,k) = 2.0_DP * Omega * sin( y_Lat(j) ) end do end do InFileName = InFileNameSounding ! InVarName = 'u' call SetTWPICEProfileVerTimeInterp( InFileName, InVarName, Time, xyz_Press, xyz_UObs ) InVarName = 'v' call SetTWPICEProfileVerTimeInterp( InFileName, InVarName, Time, xyz_Press, xyz_VObs ) InFileName = InFileNameForcing ! InVarName = 'w' call SetTWPICEProfileVerTimeInterp( InFileName, InVarName, Time, xyz_Press, xyz_WObs ) InVarName = 'dptdtadvh' call SetTWPICEProfileVerTimeInterp( InFileName, InVarName, Time, xyz_Press, xyz_DPTempDtHAdv ) InVarName = 'dqdtadvh' call SetTWPICEProfileVerTimeInterp( InFileName, InVarName, Time, xyz_Press, xyz_DQVapDtHAdv ) call SetTWPICEProfileVerAdv( xyz_WObs, xyz_Height, xyz_UB, xyz_DUDtVAdv ) call SetTWPICEProfileVerAdv( xyz_WObs, xyz_Height, xyz_VB, xyz_DVDtVAdv ) xyz_PTempB = xyz_TempB / xyz_Exner call SetTWPICEProfileVerAdv( xyz_WObs, xyz_Height, xyz_PTempB, xyz_DPTempDtVAdv ) call SetTWPICEProfileVerAdv( xyz_WObs, xyz_Height, xyzf_QMixB(:,:,:,IndexH2OVap), xyz_DQVapDtVAdv ) xyz_DUDt = xyz_DUDtVAdv + xyz_CorPar * xyz_VB + xyz_DUDtPhy - ( xyz_UB - xyz_UObs ) / UVTimeConst xyz_DVDt = xyz_DVDtVAdv - xyz_CorPar * xyz_UB + xyz_DVDtPhy - ( xyz_VB - xyz_VObs ) / UVTimeConst xyz_DPTempDt = xyz_DPTempDtHAdv + xyz_DPTempDtVAdv + xyz_DTempDtPhy / xyz_Exner xyz_DQVapDt = xyz_DQVapDtHAdv + xyz_DQVapDtVAdv + xyzf_DQMixDtPhy(:,:,:,IndexH2OVap) call SetTWPICEProfilePsTimeInterp( Time, xy_PsA ) ! xyz_UA = xyz_UB + xyz_DUDt * ( 2.0_DP * DelTime ) xyz_VA = xyz_VB + xyz_DVDt * ( 2.0_DP * DelTime ) xyz_PTempA = xyz_PTempB + xyz_DPTempDt * ( 2.0_DP * DelTime ) do n = 1, IndexH2OVap-1 xyzf_QMixA(:,:,:,n) = xyzf_QMixB(:,:,:,n) + xyzf_DQMixDtPhy(:,:,:,n) * ( 2.0_DP * DelTime ) end do n = IndexH2OVap xyzf_QMixA(:,:,:,n) = xyzf_QMixB(:,:,:,n) + xyz_DQVapDt * ( 2.0_DP * DelTime ) do n = IndexH2OVap+1, ncmax xyzf_QMixA(:,:,:,n) = xyzf_QMixB(:,:,:,n) + xyzf_DQMixDtPhy(:,:,:,n) * ( 2.0_DP * DelTime ) end do xyzf_QMixA = max( xyzf_QMixA, 0.0_DP ) n = IndexH2OVap call AuxVars( xy_PsA, xyz_TempA, xyzf_QMixA(:,:,:,n), xyz_Exner = xyz_ExnerA ) xyz_TempA = xyz_PTempA * xyz_ExnerA call HistoryAutoPut( Time, 'TWPICEWObs' , xyz_WObs ) call HistoryAutoPut( Time, 'TWPICEDUDtVAdv' , xyz_DUDtVAdv ) call HistoryAutoPut( Time, 'TWPICEDVDtVAdv' , xyz_DVDtVAdv ) call HistoryAutoPut( Time, 'TWPICEDPTempDtVAdv' , xyz_DPTempDtVAdv ) call HistoryAutoPut( Time, 'TWPICEDPTempDtHAdv' , xyz_DPTempDtHAdv ) call HistoryAutoPut( Time, 'TWPICEDPTempDtPhy' , xyz_DTempDtPhy / xyz_Exner ) call HistoryAutoPut( Time, 'TWPICEDQVapDtVAdv' , xyz_DQVapDtVAdv ) call HistoryAutoPut( Time, 'TWPICEDQVapDtHAdv' , xyz_DQVapDtHAdv ) call HistoryAutoPut( Time, 'TWPICEDQVapDtPhy' , xyzf_DQMixDtPhy(:,:,:,IndexH2OVap) ) end subroutine SetTWPICEProfileDynamics
Subroutine : |
subroutine SetTWPICEProfileFinalize ! 宣言文 ; Declaration statements ! deallocate( z_InPress ) deallocate( a_InTime ) set_TWPICE_profile_inited = .false. end subroutine SetTWPICEProfileFinalize
Subroutine : |
This procedure input/output NAMELIST#set_TWPICE_profile_nml .
subroutine SetTWPICEProfileInit ! 文字列操作 ! Character handling ! use dc_string, only: toChar ! gtool データ入力 ! Gtool data input ! use gtool_history, only: HistoryGet, HistoryGetAttr ! ヒストリデータ出力 ! History data output ! use gtool_historyauto, only: HistoryAutoAddVariable ! NetCDF のラッパープログラム ! NetCDF wrapper ! use netcdf_wrapper, only : NWInqDimLen, NWGetAtt ! NAMELIST ファイル入力に関するユーティリティ ! Utilities for NAMELIST file input ! use namelist_util, only: namelist_filename, NmlutilMsg, NmlutilAryValid ! ファイル入出力補助 ! File I/O support ! use dc_iounit, only: FileOpen ! 時刻管理 ! Time control ! use timeset, only: InitialDate ! 計算開始日時. ! Start date of calculation ! 暦と日時の取り扱い ! Calendar and Date handler ! use dc_calendar, only: DC_CAL_DATE, DCCalDateCreate, DCCalDateDifference ! 宣言文 ; Declaration statements ! character(len=STRING) :: InFileName character(len=STRING) :: Units integer :: TWPICEDataStartYear integer :: TWPICEDataStartMonth integer :: TWPICEDataStartDay integer :: TWPICEDataStartHour integer :: TWPICEDataStartMin real(DP) :: TWPICEDataStartSec type(DC_CAL_DATE):: TWPICEDataStartDate logical :: flag_mpi_init integer:: unit_nml ! NAMELIST ファイルオープン用装置番号. ! Unit number for NAMELIST file open integer:: iostat_nml ! NAMELIST 読み込み時の IOSTAT. ! IOSTAT of NAMELIST read ! NAMELIST 変数群 ! NAMELIST group name ! namelist /set_TWPICE_profile_nml/ InFileNameSounding, InFileNameForcing ! ! デフォルト値については初期化手続 "set_GATE_profile#SetGATEProfileInit" ! のソースコードを参照のこと. ! ! Refer to source codes in the initialization procedure ! "set_GATE_profile#SetGATEProfileInit" for the default values. ! ! デフォルト値の設定 ! Default values settings ! InFileNameSounding = 'sounding.nc' InFileNameForcing = 'forcing.nc' ! NAMELIST の読み込み ! NAMELIST is input ! if ( trim(namelist_filename) /= '' ) then call FileOpen( unit_nml, namelist_filename, mode = 'r' ) ! (in) rewind( unit_nml ) read( unit_nml, nml = set_TWPICE_profile_nml, iostat = iostat_nml ) ! (out) close( unit_nml ) call NmlutilMsg( iostat_nml, module_name ) ! (in) end if InFileName = InFileNameSounding call NWInqDimLen( InFileName, 'levelnum', Inkmax ) call NWInqDimLen( InFileName, 'time', Intmax ) allocate( z_InPress( Inkmax ) ) allocate( a_InTime ( Intmax ) ) flag_mpi_init = .true. call HistoryGet( InFileName, 'plev', z_InPress, flag_mpi_split = flag_mpi_init ) call HistoryGet( InFileName, 'time', a_InTime, flag_mpi_split = flag_mpi_init ) ! Check unit call NWGetAtt( InFileName, 'time', 'units', Units ) if ( ( Units(1:4) /= "hour" ) .and. ( Units(1:4) /= "Hour" ) .and. ( Units(1:4) /= "HOUR" ) ) then call MessageNotify( 'E', module_name, 'Unit of time, %c is inappropriate.', c1 = trim(Units) ) end if ! Unit conversion from hour to second a_InTime = a_InTime * ( 60.0_DP * 60.0_DP ) ! Offset TWPICEDataStartYear = 2006 TWPICEDataStartMonth = 1 TWPICEDataStartDay = 18 TWPICEDataStartHour = 0 TWPICEDataStartMin = 0 TWPICEDataStartSec = 0.0_DP call DCCalDateCreate( year = TWPICEDataStartYear, month = TWPICEDataStartMonth, day = TWPICEDataStartDay, hour = TWPICEDataStartHour, min = TWPICEDataStartMin, sec = TWPICEDataStartSec, date = TWPICEDataStartDate ) ! (out) optional TimeAtDataStart = DCCalDateDifference( start_date = InitialDate, end_date = TWPICEDataStartDate ) a_InTime = a_InTime + TimeAtDataStart ! ヒストリデータ出力のためのへの変数登録 ! Register of variables for history data output ! call HistoryAutoAddVariable( 'TWPICEWObs', (/ 'lon ', 'lat ', 'sig ', 'time' /), 'vertical wind for TWP-ICE experiment', 'm s-1' ) call HistoryAutoAddVariable( 'TWPICEDUDtVAdv', (/ 'lon ', 'lat ', 'sig ', 'time' /), 'zonal wind tendency due to vertical advection', 'm s-2' ) call HistoryAutoAddVariable( 'TWPICEDVDtVAdv', (/ 'lon ', 'lat ', 'sig ', 'time' /), 'meridional wind tendency due to vertical advection', 'm s-2' ) call HistoryAutoAddVariable( 'TWPICEDPTempDtVAdv', (/ 'lon ', 'lat ', 'sig ', 'time' /), 'potential temperature tendency due to vertical advection', 'K s-1' ) call HistoryAutoAddVariable( 'TWPICEDPTempDtHAdv', (/ 'lon ', 'lat ', 'sig ', 'time' /), 'potential temperature tendency due to horizontal advection', 'K s-1' ) call HistoryAutoAddVariable( 'TWPICEDPTempDtPhy', (/ 'lon ', 'lat ', 'sig ', 'time' /), 'potential temperature tendency due to physical processes', 'K s-1' ) call HistoryAutoAddVariable( 'TWPICEDQVapDtVAdv', (/ 'lon ', 'lat ', 'sig ', 'time' /), 'specific humidity tendency due to vertical advection', 's-1' ) call HistoryAutoAddVariable( 'TWPICEDQVapDtHAdv', (/ 'lon ', 'lat ', 'sig ', 'time' /), 'specific humidity tendency due to horizontal advection', 's-1' ) call HistoryAutoAddVariable( 'TWPICEDQVapDtPhy', (/ 'lon ', 'lat ', 'sig ', 'time' /), 'specific humidity tendency due to physical processes', 's-1' ) ! 印字 ; Print ! call MessageNotify( 'M', module_name, '----- Initialization Messages -----' ) call MessageNotify( 'M', module_name, 'InFileNameSounding = %c', c1 = trim(InFileNameSounding) ) call MessageNotify( 'M', module_name, 'InFileNameForcing = %c', c1 = trim(InFileNameForcing ) ) call MessageNotify( 'M', module_name, '-- version = %c', c1 = trim(version) ) set_TWPICE_profile_inited = .true. end subroutine SetTWPICEProfileInit
Variable : | |||
set_TWPICE_profile_inited = .false. : | logical, save, public
|
Subroutine : | |
Time : | real(DP) , intent(in ) |
xy_Ps(0:imax-1,1:jmax) : | real(DP) , intent(out) |
subroutine SetTWPICEProfilePsTimeInterp( Time, xy_Ps ) ! gtool データ入力 ! Gtool data input ! use gtool_history, only: HistoryGet ! 格子点設定 ! Grid points settings ! use gridset, only: imax, jmax, kmax ! 鉛直層数. ! Number of vertical level ! 文字列操作 ! Character handling ! use dc_string, only: toChar !!$ character(*), intent(in ) :: InFileName !!$ character(*), intent(in ) :: InVarName real(DP) , intent(in ) :: Time real(DP) , intent(out) :: xy_Ps(0:imax-1,1:jmax) ! ! local variables ! real(DP) :: xyz_Array(0:imax-1,1:jmax,1:Inkmax) real(DP) :: z_InArray(1:Inkmax) character(len=STRING) :: InFileName character(len=STRING) :: InVarName real(DP) :: Ps1 real(DP) :: Ps2 integer :: k integer :: t integer :: TIndex logical :: flag_mpi_init ! 初期化確認 ! Initialization check ! if ( .not. set_TWPICE_profile_inited ) then call MessageNotify( 'E', module_name, 'This module has not been initialized.' ) end if if ( ( Time < a_InTime(1) ) .or. ( Time > a_InTime(Intmax) ) ) then call MessageNotify( 'E', module_name, 'Time of %f is out of range, %f < Time < %f.', d = (/Time, a_InTime(1), a_InTime(Intmax)/) ) end if do t = 2, Intmax if ( Time <= a_InTime(t) ) exit end do InFileName = InFileNameSounding InVarName = "plev" TIndex = t-1 call HistoryGet( InFileName, InVarName, xyz_Array, range = 'time=^'//toChar(t-1), flag_mpi_split = flag_mpi_init ) do k = 1, Inkmax z_InArray(k) = xyz_Array(0,1,k) end do Ps1 = z_InArray(1) TIndex = t call HistoryGet( InFileName, InVarName, xyz_Array, range = 'time=^'//toChar(t-1), flag_mpi_split = flag_mpi_init ) do k = 1, Inkmax z_InArray(k) = xyz_Array(0,1,k) end do Ps2 = z_InArray(1) xy_Ps = ( Ps2 - Ps1 ) / ( a_InTime(t) - a_InTime(t-1) ) * ( Time - a_InTime(t-1) ) + Ps1 end subroutine SetTWPICEProfilePsTimeInterp
Subroutine : | |
xyz_W(0:imax-1,1:jmax,1:kmax) : | real(DP), intent(in ) |
xyz_Height(0:imax-1,1:jmax,1:kmax) : | real(DP), intent(in ) |
xyz_Array(0:imax-1,1:jmax,1:kmax) : | real(DP), intent(in ) |
xyz_VAdv(0:imax-1,1:jmax,1:kmax) : | real(DP), intent(out) |
subroutine SetTWPICEProfileVerAdv( xyz_W, xyz_Height, xyz_Array, xyz_VAdv ) ! モジュール引用 ; USE statements ! ! 格子点設定 ! Grid points settings ! use gridset, only: imax, jmax, kmax ! 鉛直層数. ! Number of vertical level real(DP), intent(in ) :: xyz_W (0:imax-1,1:jmax,1:kmax) real(DP), intent(in ) :: xyz_Height(0:imax-1,1:jmax,1:kmax) real(DP), intent(in ) :: xyz_Array (0:imax-1,1:jmax,1:kmax) real(DP), intent(out) :: xyz_VAdv (0:imax-1,1:jmax,1:kmax) ! ! local variables ! integer :: i integer :: j integer :: k integer :: kp integer :: kn ! 初期化確認 ! Initialization check ! if ( .not. set_TWPICE_profile_inited ) then call MessageNotify( 'E', module_name, 'This module has not been initialized.' ) end if do k = 1, kmax do j = 1, jmax do i = 0, imax-1 !!$ kp = max( k - 1, 1 ) !!$ kn = min( k + 1, kmax ) if ( xyz_W(i,j,k) >= 0.0_DP ) then kp = max( k - 1, 1 ) kn = kp + 1 else kn = min( k + 1, kmax ) kp = kn - 1 end if xyz_VAdv(i,j,k) = - xyz_W(i,j,k) * ( xyz_Array (i,j,kn) - xyz_Array (i,j,kp) ) / ( xyz_Height(i,j,kn) - xyz_Height(i,j,kp) ) end do end do end do end subroutine SetTWPICEProfileVerAdv
Subroutine : | |
NLev : | integer , intent(in ) |
z_Press(1:NLev) : | real(DP), intent(in ) |
z_Array(1:NLev) : | real(DP), intent(in ) |
xyz_Press(0:imax-1,1:jmax,1:kmax) : | real(DP), intent(in ) |
xyz_Array(0:imax-1,1:jmax,1:kmax) : | real(DP), intent(out) |
subroutine SetTWPICEProfileVerInterpolate( NLev, z_Press, z_Array, xyz_Press, xyz_Array ) ! 格子点設定 ! Grid points settings ! use gridset, only: imax, jmax, kmax ! 鉛直層数. ! Number of vertical level integer , intent(in ) :: NLev real(DP), intent(in ) :: z_Press (1:NLev) real(DP), intent(in ) :: z_Array (1:NLev) real(DP), intent(in ) :: xyz_Press(0:imax-1,1:jmax,1:kmax) real(DP), intent(out) :: xyz_Array(0:imax-1,1:jmax,1:kmax) ! ! local variables ! integer :: k integer :: kk ! 初期化確認 ! Initiarization check ! if ( .not. set_TWPICE_profile_inited ) then call MessageNotify( 'E', module_name, 'This module has not been initialized.' ) end if do k = 1, kmax if( xyz_Press(0,1,k) <= z_Press(NLev) ) then xyz_Array(0,1,k) = z_Array(NLev) else search_loop : do kk = 2, Inkmax if( z_Press( kk ) < xyz_Press(0,1,k) ) exit search_loop end do search_loop if( kk > NLev ) stop 'Unexpected error in setting vertical profile' xyz_Array(0,1,k) = ( z_Array( kk ) - z_Array( kk-1 ) ) / ( log( z_Press( kk ) / z_Press( kk-1 ) ) ) * ( log( xyz_Press(0,1,k) / z_Press( kk-1 ) ) ) + z_Array( kk-1 ) end if end do do k = 1, kmax xyz_Array(:,:,k) = xyz_Array(0,1,k) end do end subroutine SetTWPICEProfileVerInterpolate
Subroutine : | |
InFileName : | character(*), intent(in ) |
InVarName : | character(*), intent(in ) |
Time : | real(DP) , intent(in ) |
xyz_Press(0:imax-1,1:jmax,1:kmax) : | real(DP) , intent(in ) |
xyz_Array(0:imax-1,1:jmax,1:kmax) : | real(DP) , intent(out) |
subroutine SetTWPICEProfileVerTimeInterp( InFileName, InVarName, Time, xyz_Press, xyz_Array ) ! gtool データ入力 ! Gtool data input ! use gtool_history, only: HistoryGet ! 文字列操作 ! Character handling ! use dc_string, only: toChar ! 文字列操作 ! Character handling ! use dc_string, only: toChar ! 格子点設定 ! Grid points settings ! use gridset, only: imax, jmax, kmax ! 鉛直層数. ! Number of vertical level character(*), intent(in ) :: InFileName character(*), intent(in ) :: InVarName real(DP) , intent(in ) :: Time real(DP) , intent(in ) :: xyz_Press(0:imax-1,1:jmax,1:kmax) real(DP) , intent(out) :: xyz_Array(0:imax-1,1:jmax,1:kmax) ! ! local variables ! real(DP) :: xyz_InArray(0:imax-1,1:jmax,1:Inkmax) real(DP) :: z_InArray(1:Inkmax) real(DP) :: xyz_Array1(0:imax-1,1:jmax,1:kmax) real(DP) :: xyz_Array2(0:imax-1,1:jmax,1:kmax) integer :: k integer :: t integer :: TIndex logical :: flag_mpi_init ! 初期化確認 ! Initialization check ! if ( .not. set_TWPICE_profile_inited ) then call MessageNotify( 'E', module_name, 'This module has not been initialized.' ) end if if ( ( Time < a_InTime(1) ) .or. ( Time > a_InTime(Intmax) ) ) then call MessageNotify( 'E', module_name, 'Time of %f is out of range, %f < Time < %f.', d = (/Time, a_InTime(1), a_InTime(Intmax)/) ) end if do t = 2, Intmax if ( Time <= a_InTime(t) ) exit end do TIndex = t-1 call HistoryGet( InFileName, InVarName, xyz_InArray, range = 'time=^'//toChar(t-1), flag_mpi_split = flag_mpi_init ) do k = 1, Inkmax z_InArray(k) = xyz_InArray(0,1,k) end do call SetTWPICEProfileVerInterpolate( Inkmax, z_InPress, z_InArray, xyz_Press, xyz_Array1 ) TIndex = t call HistoryGet( InFileName, InVarName, xyz_InArray, range = 'time=^'//toChar(t), flag_mpi_split = flag_mpi_init ) do k = 1, Inkmax z_InArray(k) = xyz_InArray(0,1,k) end do call SetTWPICEProfileVerInterpolate( Inkmax, z_InPress, z_InArray, xyz_Press, xyz_Array2 ) xyz_Array = ( xyz_Array2 - xyz_Array1 ) / ( a_InTime(t) - a_InTime(t-1) ) * ( Time - a_InTime(t-1) ) + xyz_Array1 end subroutine SetTWPICEProfileVerTimeInterp
Constant : | |||
module_name = ‘set_TWPICE_profile‘ : | character(*), parameter
|
Constant : | |||
version = ’$Name: dcpam5-20150129 $’ // ’$Id: set_TWPICE_profile.f90,v 1.1 2015/01/29 12:01:30 yot Exp $’ : | character(*), parameter
|