1 |
module getfieldindex_m |
2 |
|
3 |
implicit none |
4 |
|
5 |
contains |
6 |
|
7 |
integer function GetFieldIndex(name) |
8 |
|
9 |
USE createnewfield_m, ONLY: fieldname, nbfield |
10 |
|
11 |
character(len=*), intent(in):: name |
12 |
|
13 |
! Local: |
14 |
character(len(name)) TrueName |
15 |
|
16 |
!-------------------------------------------------- |
17 |
|
18 |
TrueName = ADJUSTL(name) |
19 |
|
20 |
if (NbField >= 1) then |
21 |
GetFieldIndex = 1 |
22 |
|
23 |
do while (TrueName /= FieldName(getfieldindex) & |
24 |
.and. GetFieldIndex < NbField) |
25 |
GetFieldIndex = GetFieldIndex + 1 |
26 |
end do |
27 |
|
28 |
if (TrueName /= FieldName(getfieldindex)) GetFieldIndex = - 1 |
29 |
else |
30 |
GetFieldIndex = - 1 |
31 |
end if |
32 |
|
33 |
end function GetFieldIndex |
34 |
|
35 |
end module getfieldindex_m |