get_fctp.f90 4.07 KB
Newer Older
capdevil's avatar
   
capdevil committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!                                                                                  !
!Author (partial) : Yann Capdeville                                                !
!                                                                                  !
!Contact: yann.capdeville at  univ-nantes.fr                                       !
!                                                                                  !
!This program is free software: you can redistribute it and/or modify it under     !
!the terms of the GNU General Public License as published by the Free Software     !
!Foundation, either version 3 of the License, or (at your option) any later        !
!version.                                                                          !
!                                                                                  !
!This program is distributed in the hope that it will be useful, but WITHOUT ANY   !
!WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A   !
!PARTICULAR PURPOSE. See the GNU General Public License for more details.          !
!                                                                                  !
!You should have received a copy of the GNU General Public License along with      !
!this program. If not, see http://www.gnu.org/licenses/.                           !
!                                                                                  !
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 

capdevil's avatar
capdevil committed
21
22
23
24
25
!--------------------------------------------------------
program get_fctp
!--------------------------------------------------------
  use util_fctp
  implicit none
capdevil's avatar
   
capdevil committed
26
27
28
  character(len=100) :: file,prog_name
  integer :: s,n,l,unit,minN,maxN,narg
  character(len=10) :: name,scode,ncode,lcode
capdevil's avatar
capdevil committed
29

capdevil's avatar
   
capdevil committed
30
31
32
33
34
35
  narg = command_argument_count()
  if (narg /= 4) then
     call get_command_argument(0,prog_name)
     write(*,*) "Usage : "//trim(adjustl(prog_name))//" eigenfile_prefix function_code n l"
     write(*,*) "With : "
     print*, "- eigenfile_prefix: eigen function file prefix"
36
     print*, "- function_code: 1=U,11,Up,2=V,22=Vp,3=W,33=Wp,4=P,44=Pp"
capdevil's avatar
   
capdevil committed
37
38
39
40
41
     print*, "- n: radial order"
     print*, "- l: angular order"
     print*, "Remark: if n<0 then all the available n will be output"
     stop 
  endif
capdevil's avatar
capdevil committed
42
  unit=117
capdevil's avatar
   
capdevil committed
43
44
45
46
47
48
49
50
!!$  print*,'Enter prefix of eigenfunction files:'
!!$  read(*,'(a80)') file  
!!$  print*,'Enter code (1=U,11,Up,2=V,22=Vp,3=W,33=Wp), n and l:'
!!$  read*,s,n,l
  call get_command_argument(1,file)
  call get_command_argument(2,scode); read(scode,*) s
  call get_command_argument(3,ncode); read(ncode,*) n
  call get_command_argument(4,lcode); read(lcode,*) l  
capdevil's avatar
capdevil committed
51
52
53
54
55
  if (s.eq.3.or.s.eq.33) then  
     call open_fctp1(file,'T')
  else
     call open_fctp1(file,'S') 
  endif
capdevil's avatar
   
capdevil committed
56
57
58
59
60
61
62
63
64
65
66
67
  if (n<0) then
     call get_minmaxN(s,l,minN,maxN)
  else
     minN=n
     maxN=n
  endif
  do n=minN,maxN
     select case(s)
     case(1) 
        write(name,'(i4.4,"U",i4.4)') n,l
     case(11)
        write(name,'(i4.4,"Up",i4.4)') n,l
68
69
70
71
     case(4) 
        write(name,'(i4.4,"P",i4.4)') n,l
     case(44)
        write(name,'(i4.4,"Pp",i4.4)') n,l
capdevil's avatar
   
capdevil committed
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
     case(2) 
        print*,'Warning, output will be multiplied by sqrt(l(l+1))'
        write(name,'(i4.4,"V",i4.4)') n,l
     case(22)
        print*,'Warning, output will be multiplied by sqrt(l(l+1))'
        write(name,'(i4.4,"Vp",i4.4)') n,l
     case(3) 
        print*,'Warning, output will be multiplied by sqrt(l(l+1))'
        write(name,'(i4.4,"W",i4.4)') n,l
     case(33)
        print*,'Warning, output will be multiplied by sqrt(l(l+1))'
        write(name,'(i4.4,"Wp",i4.4)') n,l
     end select
     open(unit,file=name,status='replace')
     if (s.eq.3.or.s.eq.33) then  
        call write_modeT_ascii(unit,s,n,l)
     else
        call write_modeS_ascii(unit,s,n,l)
     endif
     close(unit)
     print*,'Ouput has been written in : ',name
  enddo
capdevil's avatar
capdevil committed
94
95
96
!--------------------------------------------------------
end program get_fctp
!--------------------------------------------------------