program multiply_array
implicit none
real, dimension(10, 10, 10) :: data_array
real :: constant = 2.5
integer :: depth, longitude, latitude
real :: original_value, new_value
! 初始化数组
data_array = reshape((/ (i, i = 1, 1000) /), shape(data_array))
! 特定位置
depth = 2
longitude = 3
latitude = 4
! 获取原始值
original_value = data_array(depth, longitude, latitude)
! 所有元素乘以常数
data_array = data_array * constant
! 获取新值
new_value = data_array(depth, longitude, latitude)
! 输出结果
write(*,*) '原始值 at (depth, longitude, latitude) = (', depth, ',', longitude, ',', latitude, ') 是: ', original_value
write(*,*) '新值 at (depth, longitude, latitude) = (', depth, ',', longitude, ',', latitude, ') 是: ', new_value
end program multiply_array