Sets the spectrum instances based on input spectrum array. This implementation is for setting 1-d spectrum into 2-d physical space of 2-d spectrum into 1-d physical space.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(domain_type), | intent(inout) | :: | self | Domain instance |
||
real(kind=rk), | intent(in), | dimension(:,:,:) | :: | spectrum_array | Spectrum array |
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed arrows point from an interface to procedures which implement that interface. This could include the module procedures in a generic interface or the implementation in a submodule of an interface in a parent module.
pure subroutine setSpectrumArray1d2d(self,spectrum_array)
!! Sets the spectrum instances based on input spectrum array.
!! This implementation is for setting 1-d spectrum into 2-d physical space
!! of 2-d spectrum into 1-d physical space.
class(domain_type),intent(inout) :: self
!! Domain instance
real(kind=rk),dimension(:,:,:),intent(in) :: spectrum_array
!! Spectrum array
integer(kind=ik) :: i,j
associate(lb => self % lb,ub => self % ub)
if(lb(2) == ub(2))then
! Setting 2-d spectrum into 1-d physical space
do concurrent(i=lb(1):ub(1),j=lb(2):ub(2))
call self % spectrum(i,j) % setSpectrum(spectrum_array(:,:,i))
enddo
else
! Setting 1-d spectrum into 2-d physical space
do concurrent(i=lb(1):ub(1),j=lb(2):ub(2))
call self % spectrum(i,j) % setSpectrum(spectrum_array(:,i,j))
enddo
endif
endassociate
endsubroutine setSpectrumArray1d2d