-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from vijaygopalchilkuri/prob4
Prob4
- Loading branch information
Showing
121 changed files
with
1,916 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
.TH "IRPF90 entities" l limit "IRPF90 entities" limit | ||
.SH Declaration | ||
.nf | ||
integer :: limit | ||
integer :: term1 | ||
integer :: term2 | ||
.ni | ||
.SH Description | ||
! enter limit | ||
.SH File | ||
.P | ||
limit.irp.f | ||
.SH Needed by | ||
sum | ||
.br |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
.TH "IRPF90 entities" l sum "IRPF90 entities" sum | ||
.SH Declaration | ||
.nf | ||
integer :: sum | ||
.ni | ||
.SH Description | ||
! calculates the sum of the factors of | ||
! two integers between 1 to limit | ||
.SH File | ||
.P | ||
sum.irp.f | ||
.SH Needs | ||
limit | ||
.br |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
.TH "IRPF90 entities" l term1 "IRPF90 entities" term1 | ||
.SH Declaration | ||
.nf | ||
integer :: limit | ||
integer :: term1 | ||
integer :: term2 | ||
.ni | ||
.SH Description | ||
! enter limit | ||
.SH File | ||
.P | ||
limit.irp.f | ||
.SH Needed by | ||
sum | ||
.br |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
.TH "IRPF90 entities" l term2 "IRPF90 entities" term2 | ||
.SH Declaration | ||
.nf | ||
integer :: limit | ||
integer :: term1 | ||
integer :: term2 | ||
.ni | ||
.SH Description | ||
! enter limit | ||
.SH File | ||
.P | ||
limit.irp.f | ||
.SH Needed by | ||
sum | ||
.br |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
IRPF90 = irpf90 #-a -d | ||
FC = gfortran | ||
FCFLAGS= -O2 | ||
|
||
SRC= | ||
OBJ= | ||
LIB= | ||
|
||
include irpf90.make | ||
|
||
irpf90.make: $(wildcard *.irp.f) | ||
$(IRPF90) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
PROBLEM 2 | ||
---------- | ||
|
||
* Each new term in the Fibonacci sequence is generated by adding the previous | ||
two terms. By starting with 1 and 2, the first 10 terms will be: | ||
|
||
1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ... | ||
|
||
By considering the terms in the Fibonacci sequence whose values do not exceed | ||
four million, find the sum of the even-valued terms. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
|
||
module irp_stack_mod | ||
integer, parameter :: STACKMAX=1000 | ||
character*(128),allocatable :: irp_stack(:,:) | ||
double precision,allocatable :: irp_cpu(:,:) | ||
integer,allocatable :: stack_index(:) | ||
logical :: alloc = .False. | ||
character*(128) :: white = '' | ||
end module | ||
|
||
subroutine irp_enter(irp_where) | ||
use irp_stack_mod | ||
integer :: ithread | ||
integer :: nthread | ||
character*(*) :: irp_where | ||
|
||
!$OMP CRITICAL | ||
ithread = 0 | ||
nthread = 1 | ||
|
||
!$OMP END CRITICAL | ||
|
||
|
||
end subroutine | ||
|
||
subroutine irp_leave (irp_where) | ||
use irp_stack_mod | ||
character*(*) :: irp_where | ||
integer :: ithread | ||
double precision :: cpu | ||
|
||
!$OMP CRITICAL | ||
ithread = 0 | ||
|
||
|
||
!$OMP END CRITICAL | ||
end subroutine | ||
|
Binary file not shown.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
subroutine irp_finalize_1930907644 | ||
use sum_mod | ||
use limit_mod | ||
end |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
SRC += IRPF90_temp/irp_stack.irp.F90 IRPF90_temp/irp_touches.irp.F90 IRPF90_temp/prob2.irp.F90 IRPF90_temp/prob2.irp.module.F90 IRPF90_temp/sum.irp.F90 IRPF90_temp/sum.irp.module.F90 IRPF90_temp/limit.irp.F90 IRPF90_temp/limit.irp.module.F90 | ||
OBJ += IRPF90_temp/irp_stack.irp.o IRPF90_temp/sum.irp.o IRPF90_temp/sum.irp.module.o IRPF90_temp/limit.irp.o IRPF90_temp/limit.irp.module.o | ||
OBJ1 = $(patsubst %, IRPF90_temp/%,$(notdir $(OBJ))) IRPF90_temp/irp_touches.irp.o | ||
ALL = prob2 | ||
ALL_OBJ = prob2.irp.module.o prob2.irp.o | ||
ALL_OBJ1 = $(patsubst %, IRPF90_temp/%,$(notdir $(ALL_OBJ))) | ||
all:$(ALL) | ||
@$(MAKE) -s move | ||
prob2: IRPF90_temp/prob2.irp.o IRPF90_temp/prob2.irp.module.o $(OBJ1) | ||
$(FC) -o $@ IRPF90_temp/$@.irp.o IRPF90_temp/$@.irp.module.o $(OBJ1) $(LIB) | ||
@$(MAKE) -s move | ||
IRPF90_temp/prob2.irp.o: IRPF90_temp/prob2.irp.module.o IRPF90_temp/sum.irp.module.o | ||
IRPF90_temp/sum.irp.o: IRPF90_temp/sum.irp.module.o IRPF90_temp/limit.irp.module.o | ||
IRPF90_temp/limit.irp.o: IRPF90_temp/limit.irp.module.o | ||
IRPF90_temp/irp_touches.irp.o: IRPF90_temp/sum.irp.o IRPF90_temp/sum.irp.o IRPF90_temp/limit.irp.o IRPF90_temp/limit.irp.o | ||
IRPF90_temp/%.irp.module.o: IRPF90_temp/%.irp.module.F90 | ||
$(FC) $(FCFLAGS) -c IRPF90_temp/$*.irp.module.F90 -o IRPF90_temp/$*.irp.module.o | ||
IRPF90_temp/%.irp.o: IRPF90_temp/%.irp.module.o IRPF90_temp/%.irp.F90 | ||
$(FC) $(FCFLAGS) -c IRPF90_temp/$*.irp.F90 -o IRPF90_temp/$*.irp.o | ||
IRPF90_temp/%.irp.o: IRPF90_temp/%.irp.F90 | ||
$(FC) $(FCFLAGS) -c IRPF90_temp/$*.irp.F90 -o IRPF90_temp/$*.irp.o | ||
IRPF90_temp/%.o: %.F90 | ||
$(FC) $(FCFLAGS) -c $*.F90 -o IRPF90_temp/$*.o | ||
IRPF90_temp/%.o: %.f90 | ||
$(FC) $(FCFLAGS) -c $*.f90 -o IRPF90_temp/$*.o | ||
IRPF90_temp/%.o: %.f | ||
$(FC) $(FCFLAGS) -c $*.f -o IRPF90_temp/$*.o | ||
IRPF90_temp/%.o: %.F | ||
$(FC) $(FCFLAGS) -c $*.F -o IRPF90_temp/$*.o | ||
IRPF90_temp/%.irp.F90: irpf90.make | ||
|
||
move: | ||
@mv -f *.mod IRPF90_temp/ 2> /dev/null | DO_NOTHING= | ||
|
||
clean: | ||
rm -rf $(EXE) $(OBJ1) $(ALL_OBJ1) $(ALL) | ||
|
||
veryclean: | ||
- $(MAKE) clean | ||
|
||
- rm -rf IRPF90_temp/ IRPF90_man/ irpf90.make irpf90_variables dist | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
limit.irp.f : integer :: limit | ||
sum.irp.f : integer :: sum | ||
limit.irp.f : integer :: term1 | ||
limit.irp.f : integer :: term2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
! -*- F90 -*- | ||
! | ||
!-----------------------------------------------! | ||
! This file was generated with the irpf90 tool. ! | ||
! ! | ||
! DO NOT MODIFY IT BY HAND ! | ||
!-----------------------------------------------! | ||
|
||
subroutine provide_limit | ||
use limit_mod | ||
implicit none | ||
character*(13) :: irp_here = 'provide_limit' | ||
integer :: irp_err | ||
logical :: irp_dimensions_OK | ||
if (.not.limit_is_built) then | ||
call bld_limit | ||
limit_is_built = .True. | ||
|
||
endif | ||
end subroutine provide_limit | ||
|
||
subroutine bld_limit | ||
use limit_mod | ||
character*(5) :: irp_here = 'limit' ! limit.irp.f: 1 | ||
write(6,*)'limit?' ! limit.irp.f: 7 | ||
read(5,*)limit ! limit.irp.f: 8 | ||
write(6,*)'term1?' ! limit.irp.f: 9 | ||
read(5,*)term1 ! limit.irp.f: 10 | ||
write(6,*)'term2?' ! limit.irp.f: 11 | ||
read(5,*)term2 ! limit.irp.f: 12 | ||
end subroutine bld_limit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
BEGIN_PROVIDER [integer, limit] | ||
&BEGIN_PROVIDER [integer, term1] | ||
&BEGIN_PROVIDER [integer, term2] | ||
BEGIN_DOC | ||
! enter limit | ||
END_DOC | ||
write(6,*)'limit?' | ||
read(5,*)limit | ||
write(6,*)'term1?' | ||
read(5,*)term1 | ||
write(6,*)'term2?' | ||
read(5,*)term2 | ||
|
||
END_PROVIDER |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
! -*- F90 -*- | ||
! | ||
!-----------------------------------------------! | ||
! This file was generated with the irpf90 tool. ! | ||
! ! | ||
! DO NOT MODIFY IT BY HAND ! | ||
!-----------------------------------------------! | ||
|
||
module limit_mod | ||
integer :: limit | ||
logical :: limit_is_built = .False. | ||
integer :: term2 | ||
integer :: term1 | ||
end module limit_mod |
Binary file not shown.
Binary file not shown.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
! -*- F90 -*- | ||
! | ||
!-----------------------------------------------! | ||
! This file was generated with the irpf90 tool. ! | ||
! ! | ||
! DO NOT MODIFY IT BY HAND ! | ||
!-----------------------------------------------! | ||
|
||
program irp_program ! prob1: 0 | ||
call prob1 ! prob2.irp.f: 0 | ||
call irp_finalize_1930907644() ! prob2.irp.f: 0 | ||
end program ! prob2.irp.f: 0 | ||
subroutine prob1 ! prob2.irp.f: 1 | ||
use sum_mod | ||
implicit none ! prob2.irp.f: 3 | ||
character*(5) :: irp_here = 'prob1' ! prob2.irp.f: 1 | ||
if (.not.sum_is_built) then | ||
call provide_sum | ||
endif | ||
write(6,*)sum ! prob2.irp.f: 5 | ||
end ! prob2.irp.f: 7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
program prob1 | ||
|
||
implicit none | ||
|
||
write(6,*)sum | ||
|
||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
! -*- F90 -*- | ||
! | ||
!-----------------------------------------------! | ||
! This file was generated with the irpf90 tool. ! | ||
! ! | ||
! DO NOT MODIFY IT BY HAND ! | ||
!-----------------------------------------------! | ||
|
||
module prob2_mod | ||
end module prob2_mod |
Binary file not shown.
Binary file not shown.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.