FLASH-X
Doxygen Generated Documentation From Interface Source Code
ut_randomSeed.F90
Go to the documentation of this file.
1!! NOTICE
2!! Copyright 2022 UChicago Argonne, LLC and contributors
3!!
4!! Licensed under the Apache License, Version 2.0 (the "License");
5!! you may not use this file except in compliance with the License.
6!!
7!! Unless required by applicable law or agreed to in writing, software
8!! distributed under the License is distributed on an "AS IS" BASIS,
9!! WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10!! See the License for the specific language governing permissions and
11!! limitations under the License.
12!!
29
30#ifndef __ABSOFT__
31
32
33subroutine ut_randomSeed(ut_size,ut_put, ut_get)
34 implicit none
35 integer, optional, dimension(:), intent(IN) :: ut_put
36 integer, optional, dimension(:), intent(OUT) :: ut_get
37 integer, optional, intent(OUT) :: ut_size
38
39 if(present(ut_size))call random_seed(size=ut_size)
40 if(present(ut_put))call random_seed(put=ut_put)
41 if(present(ut_get))call random_seed(get=ut_get)
42end subroutine ut_randomSeed
43
44
45
46#else
47
48!The original subroutine (above) cannot be compiled with Absoft 64-bit
49!Pro Fortran 11.1.4 on code.uchicago.edu which uses Centos-6.0 x86_64.
50!I have created a temporary version of this subroutine which can be
51!compiled by Absoft compiler.
52
53subroutine ut_randomSeed(ut_size,ut_put, ut_get)
54 implicit none
55 integer, optional, dimension(:), intent(IN) :: ut_put
56 integer, optional, dimension(:), intent(OUT) :: ut_get
57 integer, optional, intent(OUT) :: ut_size
58 integer, allocatable, dimension(:) :: ut_put_tmp
59
60 if (present(ut_size)) call random_seed(size=ut_size)
61 if (present(ut_put)) then
62 allocate(ut_put_tmp(lbound(ut_put,1):ubound(ut_put,1)))
63 ut_put_tmp = ut_put
64 call random_seed(put=ut_put_tmp)
65 deallocate(ut_put_tmp)
66 end if
67 if (present(ut_get)) call random_seed(get=ut_get)
68end subroutine ut_randomSeed
69
70#endif
subroutine ut_randomSeed(ut_size, ut_put, ut_get)