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