read parameter subroutine

This commit is contained in:
ignis 2019-09-15 02:36:24 +09:00
parent 8364f044ee
commit d6e2ad74e5
3 changed files with 51 additions and 10 deletions

View file

@ -18,6 +18,8 @@ module m_parameters
real :: prof_wr,min_wr,min_fsd,min_c,refwr
real :: pre,ac,bc,c_cut,c_ref
real :: lambda1, lambda2, beta1, hrp, beta
character(100) :: reaction_type
! Constants
real, parameter :: pi=3.14159265358979323846d0
@ -33,15 +35,15 @@ module m_parameters
real :: absolute_tolerence=1e-8
real :: dt,tf,t_now,t_uf,dt_uf
! Input File
LOGICAL :: read_itape, read_stdin
CHARACTER(100) :: itape_name
CHARACTER(100) :: reaction_type
integer :: table_size
real :: rate_relaxation (2,100)
integer :: table_size
CHARACTER(LEN=8) :: cdum
INTEGER :: itape=300, otape=301
contains
@ -56,8 +58,21 @@ contains
END SUBROUTINE SET_CHEMISTRY
SUBROUTINE READ_INTRO
CHARACTER(LEN=8) :: cdum
INTEGER :: itape=300,otape=301
IMPLICIT NONE
INTERFACE READ_PARAMETER
SUBROUTINE READ_INT (x)
integer :: x
END SUBROUTINE READ_INT
SUBROUTINE READ_REAL (x)
real :: x
END SUBROUTINE READ_REAL
END INTERFACE
INTEGER :: i
CALL SET_CHEMISTRY
@ -69,8 +84,10 @@ contains
END IF
OPEN(otape,FILE='otape')
READ(itape,*) cdum,nx
WRITE(otape,*) cdum,nx
!READ(itape,*) cdum,nx
!WRITE(otape,*) cdum,nx
CALL READ_PARAMETER (nx)
READ(itape,*) cdum,l_0
WRITE(otape,*) cdum,l_0
READ(itape,*) cdum,int_pr

View file

@ -12,12 +12,15 @@ endif
compiler = gfortran
ex : test.o ysolve.o m_chemistry.o m_parameters.o m_compact.o
${compiler} -o ex test.o ysolve.o m_chemistry.o m_parameters.o m_compact.o
ex : test.o read_parameter.o ysolve.o m_chemistry.o m_parameters.o m_compact.o
${compiler} -o ex test.o read_parameter.o ysolve.o m_chemistry.o m_parameters.o m_compact.o
test.o : test.f90 ysolve.mod m_compact.mod
${compiler} -c ${flags} test.f90
read_parameter.o : read_parameter.f90 m_parameters.o
${compiler} -c ${flags} read_parameter.f90
ysolve.o ysolve.mod : ysolve.f90 m_compact.mod m_chemistry.mod m_parameters.mod
${compiler} -c ${flags} ysolve.f90

21
code/read_parameter.f90 Normal file
View file

@ -0,0 +1,21 @@
subroutine read_int (x)
use m_parameters
implicit none
integer :: x
READ(itape,*) cdum,x
WRITE(otape,*) cdum,x
end subroutine read_int
subroutine read_real (x)
use m_parameters
implicit none
real :: x
READ(itape,*) cdum,x
WRITE(otape,*) cdum,x
end subroutine read_real