Skip to content

Commit

Permalink
Added parachor
Browse files Browse the repository at this point in the history
  • Loading branch information
fedebenelli committed Mar 7, 2024
1 parent 9cc7944 commit 984a393
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion example/main.f90
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ program main
sus(2) = Substance("ethanol", only=only_this)

print *, sus%critical%critical_temperature%value
end program
print *, sus%parachor%value
end program
6 changes: 4 additions & 2 deletions src/substance.f90
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module forsus_substance
use forsus_properties, only: CriticalConstants
use forsus_properties, only: ScalarProperty, CriticalConstants
implicit none

type :: Substance
Expand Down Expand Up @@ -59,8 +59,9 @@ module forsus_substance
!! ```
character(len=:), allocatable :: name
!! Substance name
type(CriticalConstants) :: critical
type(CriticalConstants) :: critical
!! Critical constants
type(ScalarProperty) :: parachor
end type

! Setting this interface allows to use `init_json` as the object init
Expand All @@ -86,6 +87,7 @@ type(Substance) function init_json(name, path, only)

init_json%name = trim(name)
if (.not. present(only)) then
call init_json%parachor%from_json("Parachor", init_json%name//".json", path)
call init_json%critical%from_json(init_json%name//".json", path)
else
do i=1,size(only)
Expand Down

0 comments on commit 984a393

Please sign in to comment.