Skip to content

Commit

Permalink
initial version 3
Browse files Browse the repository at this point in the history
  • Loading branch information
sundmanbo committed Jun 1, 2015
1 parent d43af11 commit acfa71c
Show file tree
Hide file tree
Showing 140 changed files with 51,219 additions and 34,449 deletions.
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
OBJS=metlib3.o tpfun4.o lukasnum.o pmod25.o matsmin.o smp1.o pmon6.o
EXE=oc2A
OBJS=metlib3.o tpfun4.o lukasnum.o gtp3.o matsmin.o smp1.o pmon6.o
EXE=oc3A

all:
gfortran -o linkoc linkocdate.F90
Expand All @@ -16,8 +16,8 @@ tpfun4.o: utilities/tpfun4.F90
lukasnum.o: numlib/lukasnum.F90
gfortran -c -fbounds-check -finit-local-zero numlib/lukasnum.F90

pmod25.o: models/pmod25.F90
gfortran -c -fbounds-check -finit-local-zero models/pmod25.F90
gtp3.o: models/gtp3.F90
gfortran -c -fbounds-check -finit-local-zero models/gtp3.F90

matsmin.o: minimizer/matsmin.F90
gfortran -c -fbounds-check -finit-local-zero minimizer/matsmin.F90
Expand All @@ -31,6 +31,6 @@ pmon6.o: userif/pmon6.F90
$(EXE):
make $(OBJS)
# liboceq.a
ar sq liboceq.a metlib3.o tpfun4.o lukasnum.o pmod25.o matsmin.o
ar sq liboceq.a metlib3.o tpfun4.o lukasnum.o gtp3.o matsmin.o
# oc2A
gfortran -o $(EXE) -fbounds-check pmain1.F90 pmon6.o smp1.o liboceq.a
File renamed without changes.
File renamed without changes.
File renamed without changes.
126 changes: 63 additions & 63 deletions TQlib/C/cexample1/readme.txt → TQ3lib-clean/C/cexample1/readme.txt
Original file line number Diff line number Diff line change
@@ -1,63 +1,63 @@
This is an example of a C program calling the OC TQ library
The main program is testc1.c
As I know almost nothing about C it is very primitive. I did not even
manage to loop the calculation asking for several values of the
conditions for calculations.
You must copy the following files from the OC or TQ folders
liboceq.a compiled Fortran library with the basic OC routines
liboctq.o compiled Fortran subroutines for the TQ interface
liboctq.mod module information about the TQ and EQ packages
The other files are
crfe.TDB the database file for the Cr-Fe system
liboctqc.F90 a Fortran subroutine callable from C to access the TQ library
linktqc1.txt a Windows command file to compile and link the test program
readme.txt this file
tqexc1.c a main program in C for testing the C interface
The linktqc1.txt must be changed to a linktqc1.cmd to be executed in a
Windows environment. On linux or other OS one can create makefiles or
other scripts to do the same.
The liboctq.F90 should be compiled with access to the liboceq.mod file
compiled and this generates a liboctq.o and liboctq.mod files. When
compiling the liboctqc.F90 it need access to liboctq.mod file.
When compiling and linking tqexc1.c it need access to liboctqc.o,
liboctq.o and liboceq.a
The files liboceq.a and liboceq.mod are created when compiling the
main OC program. They should normally be copied from that compilation
but are provided here to simplify.
The C program will initiate the OC workspace, read the crfe.TDB file
and write some information about the system. It will then set the
conditions P=1E5 (1 bar) and N=1 (system size 1 mole) and then it will
ask for a temperature. I suggest 800 (Kelvin) as a first value. Then
it will ask for a mole fraction of Cr and 0.3 is a good value.
Then there will be some output from OC which will eventually be removed
but can be useful while testing.
If the calculation is successful the total Gibbs energy and the
chemical potentials of the components will be listed.
If a C expert helps one can the loop to calculate again with another
temperature and composition but with my limited understanding of C
I have failed to implement this.
The liboctq.F90 and the liboctqc.F90 libraries are currently very
limited, much more can be implemented. See also the Fortran examples
which are more elaborated. For example they allow arrays of data to
be extracted from the OC library, I do not know how to do this in C.
Good luck and do not hesitate to ask questions and suggest changes.
[email protected]

This is an example of a C program calling the OC TQ library

The main program is testc1.c

As I know almost nothing about C it is very primitive. I did not even
manage to loop the calculation asking for several values of the
conditions for calculations.

You must copy the following files from the OC or TQ folders

liboceq.a compiled Fortran library with the basic OC routines
liboctq.o compiled Fortran subroutines for the TQ interface
liboctq.mod module information about the TQ and EQ packages

The other files are

crfe.TDB the database file for the Cr-Fe system
liboctqc.F90 a Fortran subroutine callable from C to access the TQ library
linktqc1.txt a Windows command file to compile and link the test program
readme.txt this file
tqexc1.c a main program in C for testing the C interface

The linktqc1.txt must be changed to a linktqc1.cmd to be executed in a
Windows environment. On linux or other OS one can create makefiles or
other scripts to do the same.

The liboctq.F90 should be compiled with access to the liboceq.mod file
compiled and this generates a liboctq.o and liboctq.mod files. When
compiling the liboctqc.F90 it need access to liboctq.mod file.

When compiling and linking tqexc1.c it need access to liboctqc.o,
liboctq.o and liboceq.a

The files liboceq.a and liboceq.mod are created when compiling the
main OC program. They should normally be copied from that compilation
but are provided here to simplify.

The C program will initiate the OC workspace, read the crfe.TDB file
and write some information about the system. It will then set the
conditions P=1E5 (1 bar) and N=1 (system size 1 mole) and then it will
ask for a temperature. I suggest 800 (Kelvin) as a first value. Then
it will ask for a mole fraction of Cr and 0.3 is a good value.

Then there will be some output from OC which will eventually be removed
but can be useful while testing.

If the calculation is successful the total Gibbs energy and the
chemical potentials of the components will be listed.

If a C expert helps one can the loop to calculate again with another
temperature and composition but with my limited understanding of C
I have failed to implement this.

The liboctq.F90 and the liboctqc.F90 libraries are currently very
limited, much more can be implemented. See also the Fortran examples
which are more elaborated. For example they allow arrays of data to
be extracted from the OC library, I do not know how to do this in C.

Good luck and do not hesitate to ask questions and suggest changes.

[email protected]

File renamed without changes.
File renamed without changes.
Loading

0 comments on commit acfa71c

Please sign in to comment.