NLSL: testmods.f90 Source File

NLSL

- Main Page
- Modules
- Data Types List
- Files

- File List
- File Members

testmods.f90
Go to the documentation of this file.
1 ! NLSL Version 1.9.0 beta 2/12/15
2 !
3 program testmods
4
5 use eprprm
6 use errmsg
7 use lpnam
8 implicit none
9
10 integer, external :: ipfind, isfind, itrim
11
12 ! Build instructions for the initial version of this program:
13 ! gfortran -g -ffixed-form -c nlsdim.f90
14 ! gfortran -g -ffixed-form -c parcom.f90
15 ! gfortran -g -ffixed-form -c eprprm.f90
16 ! gfortran -g testmods.f90 nlsdim.o parcom.o eprprm.o -o testmods
17 ! To build for testing in Windows, using the Intel compiler:
18 ! ifort /debug /fixed /c nlsdim.f90
19 ! ifort /debug /fixed /c parcom.f90
20 ! ifort /debug /fixed /c eprprm.f90
21 ! ifort /debug /o testmods testmods.f90 nlsdim.obj parcom.obj eprprm.obj
22
23 integer :: i, j, itest, iitest, iftest, info, isel, ltok, lnam
24 double precision :: ftest
25 character*6 :: token=' '
26
27 print *, 'Initializing fparm and iparm...'
28 do j = 1, mxsite
29 do i = 1, nfprm
30 fparm(i,j) = (j-1) * nfprm + i
31 end do
32 do i = 1, niprm
33 iparm(i,j) = (j-1) * niprm + i
34 end do
35 end do
36
37 print *
38 print *, 'Starting test of eprprm pointers with changing sites...'
39 print *, 'Correct values advance by 24 and 43.0 for each new site'
40 do j = 1, mxsite
41 print("('Spot testing values for site', i3 ,'...')"), j
42 call select_site(j)
43 iitest = immn
44 iftest = ipmzz
45 itest = mmn
46 ftest = pmzz
47 print("('The expected values for site', i3, &
48 & ', indexes', i3, ' and', i3, ':', i5, f7.1)"), &
49 & j, iitest, iftest, iparm(iitest,j), fparm(iftest,j)
50 print("('Fetched by pointers for site', i3, &
51 & ', indexes', i3, ' and', i3, ':', i5, f7.1)"), &
52 & j, iitest, iftest, itest, ftest
53 ! now try some tests from within a subroutine
54 call arbsub(j,immn,ipmzz,mmn,pmzz)
55 print("('From array pointers for site', i3, &
56 & ', indexes', i3, ' and', i3, ':', i5, f7.1)"), &
57 & j, iitest, iftest, iepr(iitest), fepr(iftest)
58 end do
59
60 print *
61 print *, 'Starting spot checks of lpnam name arrays...'
62 isel = immn
63 token = iprnam(isel)
64 ltok = itrim(token)
65 lnam = ipfind(token,ltok)
66 print("('The iprnam associated with index', i3, ' is ', a4)"), &
67 & isel, token(:ltok)
68 print("('When given token ', a4, ', ipfind returns ', i3, &
69 & ', equating to index ', i3)"), &
70 & token(:ltok), lnam, lnam-100
71 isel = ipmzz
72 token = parnam(isel)
73 ltok = itrim(token)
74 lnam = ipfind(token,ltok)
75 print("('The parnam associated with index', i3, ' is ', a4)"), &
76 & isel, token(:ltok)
77 print("('When given token ', a4, ', ipfind returns ', i3, &
78 & ', equating to index ', i3)"), &
79 & token(:ltok), lnam, lnam
80 isel = 4
81 token = symbol(4)
82 ltok = itrim(token)
83 lnam = isfind(token,ltok)
84 print("('The symbol associated with index', i3, ' is ', a4)"), &
85 & isel, token(:ltok)
86 print("('When given token ', a4, ', isfind returns ', i3, &
87 & ', equating to index ', i3)"), &
88 & token(:ltok), lnam, lnam
89
90 print *
91 print *, 'Starting spot checks of error message arrays...'
92 print("('The eprerr message associated with DIMBIG=', i3, ': ', &
93 & a32)"), dimbig, eprerr(dimbig)(1:30)
94 info = 11
95 print("('The minerr message associated with info =', i3, ': ', &
96 & a32)"), info, minerr(info)(1:30)
97 print *
98
99 contains
100
101 subroutine arbsub(jjj,kiarb,kfarb,iarb,farb)
102 integer :: jjj, kiarb, kfarb, iarb
103 double precision :: farb
104 print("('Via passed pointers for site', i3, &
105 & ', indexes', i3, ' and', i3, ':', i5, f7.1)"), &
106 & jjj, kiarb, kfarb, iarb, farb
107 farb = farb * 1.5
108 iarb = iarb + 100
109 print("('Manipulated in call for site', i3, &
110 & ', indexes', i3, ' and', i3, ':', i5, f7.1)"), &
111 & jjj, kiarb, kfarb, iarb, farb
112 end subroutine arbsub
113
114 end program testmods
eprprm::iepr
integer, dimension(niprm), target, save iepr
Definition: eprprm.f90:56
lpnam::symbol
character *10, dimension(nsymbl), save symbol
Definition: lpnam.f90:60
testmods
program testmods
Definition: testmods.f90:3
eprprm::mmn
integer, pointer, save mmn
Definition: eprprm.f90:69
eprprm::fepr
double precision, dimension(nfprm), target, save fepr
Definition: eprprm.f90:55
errmsg::minerr
character *32, dimension(0:nmnerr-1), save minerr
Definition: errmsg.f90:88
lpnam
Definition: lpnam.f90:18
eprprm::pmzz
double precision, pointer, save pmzz
Definition: eprprm.f90:58
eprprm
Definition: eprprm.f90:51
eprprm::ipmzz
integer, parameter ipmzz
Definition: eprprm.f90:92
errmsg::eprerr
character *50, dimension(neperr), save eprerr
Definition: errmsg.f90:59
lpnam::parnam
character *6, dimension(nfprm), save parnam
Definition: lpnam.f90:27
errmsg::dimbig
integer, parameter dimbig
Definition: errmsg.f90:51
arbsub
subroutine arbsub(jjj, kiarb, kfarb, iarb, farb)
Definition: testmods.f90:102
lpnam::iprnam
character *6, dimension(niprm), save iprnam
Definition: lpnam.f90:38
eprprm::immn
integer, parameter immn
Definition: eprprm.f90:108
errmsg
Definition: errmsg.f90:46