/[lmdze]/trunk/misc/getfieldindex.f90
ViewVC logotype

Contents of /trunk/misc/getfieldindex.f90

Parent Directory Parent Directory | Revision Log Revision Log


Revision 328 - (show annotations)
Thu Jun 13 14:40:06 2019 UTC (4 years, 10 months ago) by guez
File size: 704 byte(s)
Change all `.f` suffixes to `.f90`. (The opposite was done in revision
82.)  Because of change of philosopy in GNUmakefile: we already had a
rewritten rule for `.f`, so it does not make the makefile longer to
replace it by a rule for `.f90`. And it spares us options of
makedepf90 and of the compiler. Also we prepare the way for a simpler
`CMakeLists.txt`.

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

  ViewVC Help
Powered by ViewVC 1.1.21