subroutine hs94forcing_init( x_Lon , y_Lat , z_Sigma )
!==== Dependency
!=end
implicit none
!=begin
!==== Input
!
type(AXISINFO), intent(in) :: x_Lon , y_Lat , z_Sigma ! σレベル(整数)座標
!=end
integer(INTKIND) :: i, j, k
real(DBKIND) :: RadDegFact ! ラジアンと度数の変換係数
character(STRING), parameter:: subname = "hs94forcing_init"
continue
!----------------------------------------------------------------
! Check Initialization
!----------------------------------------------------------------
call BeginSub(subname)
if (hs94forcing_initialized) then
call EndSub( subname, '%c is already called.', c1=trim(subname) )
return
else
hs94forcing_initialized = .true.
endif
!----------------------------------------------------------------
! Version identifier
!----------------------------------------------------------------
call DbgMessage('%c :: %c', c1=trim(version), c2=trim(tagname))
!-----------------------------------------------------------------
! Initialize Dependent modules
!-----------------------------------------------------------------
call constants_init
call grid_3d_init
call io_gt4_out_init
!-------------------------------------------------------------------
! Setting Ouput Data by io_gt4_out_set_Vars
!-------------------------------------------------------------------
call io_gt4_out_SetVars('xyz_VelLon_phy')
call io_gt4_out_SetVars('xyz_VelLat_phy')
call io_gt4_out_SetVars('xyz_Temp_phy')
call io_gt4_out_SetVars('xyz_TempEQ')
call io_gt4_out_SetVars('xyz_PotTempEQ')
call io_gt4_out_SetVars('1.0/xyz_kt')
call io_gt4_out_SetVars('1.0/max(xyz_kv, 1.0/86400d2)/86400.0')
call io_gt4_out_SetVArs('xyz_kv')
!-----------------------------------------------------------------
! Allocate variables
!-----------------------------------------------------------------
allocate( xyz_Sigma(im, jm, km) , xyz_kv(im, jm, km) , xyz_Press_b(im, jm, km) , xyz_SinLat(im, jm, km) , xyz_CosLat(im, jm, km) , xyz_TempEQ(im,jm,km) , xyz_kt(im,jm,km) ) ! k_t
!----------------------------------------------------------------
! 全体で用いる変数
!----------------------------------------------------------------
do k = 1, km
xyz_Sigma(:,:,k) = z_Sigma%a_Dim(k)
enddo
!----------------------------------------------------------------
! xyz_Temp_phy を求めるための変数
!----------------------------------------------------------------
if ( StrHead( 'radians', trim(LChar(y_Lat%axisinfo%units)) ) .or. StrHead( 'rad.', trim(LChar(y_Lat%axisinfo%units)) ) ) then
RadDegFact = 1.
else
RadDegFact = pi / 180.
end if
do j = 1, jm
xyz_SinLat(:,j,:) = sin( y_Lat%a_Dim(j) * RadDegFact )
xyz_CosLat(:,j,:) = cos( y_Lat%a_Dim(j) * RadDegFact )
enddo
call DataDump('xyz_SinLat', xyz_SinLat, strlen=70)
call DataDump('xyz_CosLat', xyz_CosLat, strlen=70)
call EndSub(subname)
end subroutine hs94forcing_init