vector_init.f90

This is an example of how to use basic initialize function of the vector module. More details about this example.

00001 
00014 program vector_init
00015 #include "fml_constants.h" 
00016  use mod_vector     ! use vector module
00017   implicit none
00018 
00019   !********************************************* declaration  
00020   integer, parameter :: v1_size = 5 !size of v1
00021   ! declaration of vector v1
00022   type(vector) :: v1;  
00023 
00024   !********************************************* body
00025   
00026   ! init of a vector v1 
00027   call init(v1,v1_size);      !init:=v_init
00028   !initialize v1 by random values between 1.0 and 10.0
00029   call random(v1,low=p_notcast(1.0),high=p_notcast(10.0))   !random:=vc_random
00030     
00031   print*, "********************************************* display data"
00032 
00033   write(*,fmt='(A5)',advance='no')"* v1=";   !(advance='no' => without newline line)
00034   call print(v1);  !print v1  (print:=v_print)
00035   print*, ">>>>>>>>>>>>>size info: size v1=", v1%size 
00036   call destruct(v1)  ! destruct the vector v1  (don't forget to destruct the vector)
00037 end program vector_init
 All Classes Namespaces Files Functions Variables Defines