1f8402805SBarry Smith! 2*dd01b7e5SBarry Smith! Tests random number generation routines from Fortran. 3f8402805SBarry Smith! 4f8402805SBarry Smith program main 5f8402805SBarry Smith 6f8402805SBarry Smith#include <petsc/finclude/petscsys.h> 7f8402805SBarry Smith use petscsys 8f8402805SBarry Smith implicit none 9f8402805SBarry Smith 10f8402805SBarry Smith PetscErrorCode ierr 11f8402805SBarry Smith PetscRandom r 12f8402805SBarry Smith PetscScalar rand 13f8402805SBarry Smith 14d8606c27SBarry Smith PetscCallA(PetscInitialize(ierr)) 15f8402805SBarry Smith 16f8402805SBarry Smith PetscCallA(PetscRandomCreate(PETSC_COMM_WORLD,r,ierr)) 17f8402805SBarry Smith PetscCallA(PetscRandomSetFromOptions(r,ierr)) 18f8402805SBarry Smith PetscCallA(PetscRandomGetValue(r,rand,ierr)) 19f8402805SBarry Smith print*, 'Random value:',rand 20f8402805SBarry Smith PetscCallA(PetscRandomDestroy(r,ierr)) 21f8402805SBarry Smith PetscCallA(PetscFinalize(ierr)) 22f8402805SBarry Smith end 23f8402805SBarry Smith 24f8402805SBarry Smith! 25f8402805SBarry Smith!/*TEST 26f8402805SBarry Smith! 27f8402805SBarry Smith! test: 28f8402805SBarry Smith! requires: !complex 29f8402805SBarry Smith! 30f8402805SBarry Smith!TEST*/ 31