Skip to content

Commit

Permalink
formato
Browse files Browse the repository at this point in the history
  • Loading branch information
fedebenelli committed Nov 15, 2022
1 parent a22a598 commit b1fc15c
Show file tree
Hide file tree
Showing 10 changed files with 42 additions and 16 deletions.
4 changes: 4 additions & 0 deletions unidad6/fortran/clase1/1er/00_historia/00-hist.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
## Historia

- Lenguaje desarrollado por *IBM* en 1957 (65 años 🥳)

- Primer lenguaje de alto nivel

- Se desarrolló con enfoque en aplicaciones científicas e ingenieriles (muchos
números)

- Destaca en eficiencia de cómputo en operaciones vectoriales
10 changes: 10 additions & 0 deletions unidad6/fortran/clase1/1er/00_historia/01-versions.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
## Versiones



### Fortran "clásico"
- FORTRAN I
- FORTRAN II :+ funciones y subrutinas
- FORTRAN IV :+ booleanos -funciones especificas de maquina
- FORTRAN 66 : ANSI estandariza lo anterior.
- FORTRAN 77 :+ bloques, character, parameter y save. Una revisión agregó do while



### Fortran "moderno"
- Fortran 90 :+ módulos, memoria dinámica, tipos de dato, mucho más
- Fortran 95 :+ forall, where, deloación automática de variables.
Expand All @@ -15,6 +19,12 @@
- Fortran 2018 : nada importante








- Fortran 66: had IF … GOTO but no IF…THEN
- Fortran 77: had IF..THEN..END IF and DO … END DO.
- Fortran90: had MODULE so you didn’t have to use COMMON anymore. Also TYPE. Also INTERFACE, but that was of limited use. Also array notation.
Expand Down
1 change: 0 additions & 1 deletion unidad6/fortran/clase1/1er/03_modules/02_modulo.f90
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ module mod1
implicit none ! Declara implicit none para TODO lo que esté en dentro.

real :: x

end module mod1

subroutine sub(var)
Expand Down
1 change: 0 additions & 1 deletion unidad6/fortran/clase1/1er/05_oop/01_oop.f90
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,4 @@ module oop
real :: x
real :: y
end type

end module
2 changes: 1 addition & 1 deletion unidad6/fortran/clase1/1er/05_oop/04_oop.f90
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
! Herencia
module oop
implicit none

Expand All @@ -11,7 +12,6 @@ module oop
procedure :: dot
end type

! Herencia
type, extends(vector) :: vector_3d
real :: z
end type
Expand Down
1 change: 1 addition & 0 deletions unidad6/fortran/clase1/1er/05_oop/05_oop.f90
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
! Overload de operadores
module oop
implicit none

Expand Down
2 changes: 1 addition & 1 deletion unidad6/fortran/clase1/1er/05_oop/06_oop.f90
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
! Nuevos operadores
module oop
implicit none

Expand All @@ -9,7 +10,6 @@ module oop
real :: y
end type

! Nuevos operadores
interface operator(.dot.)
module procedure :: dot
end interface
Expand Down
4 changes: 2 additions & 2 deletions unidad6/fortran/clase1/1er/09_extra/02_pure.f90
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ pure function f(x)
implicit none
real(8), intent(in) :: x
real(8) :: f
x = 3
print *, "No puedo printear desde procedimientos puros"
! x = 3
! print *, "No puedo printear desde procedimientos puros"
f = 2*x
end function f
31 changes: 23 additions & 8 deletions unidad6/fortran/clase1/1er/09_extra/03_elemental.f90
Original file line number Diff line number Diff line change
@@ -1,9 +1,24 @@
elemental function f(x)
! Un procedimiento elemental significa que puede operarse en
! vectores automaticamente (como numpy)
! para ser elemental es requisito que sea puro
module efun
contains
elemental function f(x)
! Un procedimiento elemental significa que puede operarse en
! vectores automaticamente (como numpy)
! para ser elemental es requisito que sea puro
implicit none
real(8), intent(in) :: x
real(8) :: f
f = 2*x
end function f
end module efun

program main
use efun, only: f
implicit none
real(8), intent(in) :: x
real(8) :: f
f = 2*x
end function f
real(8) :: x, x2(3)

x = 5
x2 = [1, 2, 3]

print *, "Variable escalar: ", f(x)
print *, "Variable vectorial: ", f(x2)
end program main
2 changes: 0 additions & 2 deletions unidad6/fortran/clase1/1er/09_extra/04_pdt.f90
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
! https://blog.hpc.qmul.ac.uk/fortran-parameterized-derived-types-1.html
!
! Tipos de datos parametrizados
!
module parametrized
Expand All @@ -21,4 +20,3 @@ program main
t%a = [1, 2, 3, 4, 5] ! No lee del 4to en adelante
print *, t%a
end program

0 comments on commit b1fc15c

Please sign in to comment.