LEILABLYTHE
Technical User
Hello everyone,
You may find these questions stupid but I prefer to ask and not to walk as a blind person in FORTRAN! would be really kind of you if you can help me.
I am using Fortran 90 to simulate the plasma chemistry. Simulation consists of 6 species and 32 reactions. I would like to store the information about a matrix in time which reveal the info about participation of each reactions in production or consumption of each species. I am using the following commands:
double precision :: SourceTerm(species_max,reactions_max)
! SourceTerm Matrix will be produced in a time loop
open(13,file=species_name(1)//"SourceTerm1")
open(14,file=species_name(1)//"SourceTerm2")
open(15,file=species_name(1)//"SourceTerm3")
open(16,file=species_name(1)//"SourceTerm4")
write(13,'(99(A16))',advance='yes')(trim(reaction_sign(i)),i=1, 8)
write(14,'(99(A16))',advance='yes')(trim(reaction_sign(i)),i=9,16)
write(15,'(99(A16))',advance='yes')(trim(reaction_sign(i)),i=17,24 )
write(16,'(99(A18))',advance='yes')(trim(reaction_sign(i)),i=25,32 )
write(13,'(99(1pe16.6))',advance='yes') SourceTerm(1,1:8)
write(14,'(99(1pe16.6))',advance='yes') SourceTerm(1,9:16)
write(15,'(99(1pe16.6))',advance='yes') SourceTerm(1,17:24)
write(16,'(99(1pe19.6))',advance='yes') SourceTerm(1,25:32)
close(13)
close(14)
close(15)
close(16)
There are some problems
1- These really basic commands and if I want to change the program to another would take to much time to change the writing part only! e.g. by species_name(1) I will get the info about species 1, but since I can not write info about 32 reactions in 1 file I divide it to 4 files but I want to have the produce the name of the files also in a loop but I do not know how to write numbers (1-4) after trim in the file name.
2- The time step are 1.0d-15 but I want this info only at e certain times, e.g. 1.0d-9, 1.0d-6, 1.0d-3, etc. How can I do it?
3- I copy and paste the format of the output files so I do not understand exactly what '(99(A16))',advance='yes' and '(99(1pe16.6))' means! Is there any other way to store this info? The numbers that I got are in the order of 1.0d-12 to 1.0d12.
Thanks in advance.
Leila
You may find these questions stupid but I prefer to ask and not to walk as a blind person in FORTRAN! would be really kind of you if you can help me.
I am using Fortran 90 to simulate the plasma chemistry. Simulation consists of 6 species and 32 reactions. I would like to store the information about a matrix in time which reveal the info about participation of each reactions in production or consumption of each species. I am using the following commands:
double precision :: SourceTerm(species_max,reactions_max)
! SourceTerm Matrix will be produced in a time loop
open(13,file=species_name(1)//"SourceTerm1")
open(14,file=species_name(1)//"SourceTerm2")
open(15,file=species_name(1)//"SourceTerm3")
open(16,file=species_name(1)//"SourceTerm4")
write(13,'(99(A16))',advance='yes')(trim(reaction_sign(i)),i=1, 8)
write(14,'(99(A16))',advance='yes')(trim(reaction_sign(i)),i=9,16)
write(15,'(99(A16))',advance='yes')(trim(reaction_sign(i)),i=17,24 )
write(16,'(99(A18))',advance='yes')(trim(reaction_sign(i)),i=25,32 )
write(13,'(99(1pe16.6))',advance='yes') SourceTerm(1,1:8)
write(14,'(99(1pe16.6))',advance='yes') SourceTerm(1,9:16)
write(15,'(99(1pe16.6))',advance='yes') SourceTerm(1,17:24)
write(16,'(99(1pe19.6))',advance='yes') SourceTerm(1,25:32)
close(13)
close(14)
close(15)
close(16)
There are some problems
1- These really basic commands and if I want to change the program to another would take to much time to change the writing part only! e.g. by species_name(1) I will get the info about species 1, but since I can not write info about 32 reactions in 1 file I divide it to 4 files but I want to have the produce the name of the files also in a loop but I do not know how to write numbers (1-4) after trim in the file name.
2- The time step are 1.0d-15 but I want this info only at e certain times, e.g. 1.0d-9, 1.0d-6, 1.0d-3, etc. How can I do it?
3- I copy and paste the format of the output files so I do not understand exactly what '(99(A16))',advance='yes' and '(99(1pe16.6))' means! Is there any other way to store this info? The numbers that I got are in the order of 1.0d-12 to 1.0d12.
Thanks in advance.
Leila