Prev: XP Pro vs Win2k: Installing CVF 6.6
Next: Looking for some advice on string passing and dealing with hardcoded constants
From: Allamarein on 11 May 2010 16:46 Let's suppose I produced 2 arrays REAL, DIMENSION (0:MAX_SIZE) :: T,Y where max_size is an appropriate integer. May you suggest a code that create a GRAPH.PLT to see a T (x axis)- Y(y axis) plot by gnuplot ? I would export T and Y in a single file called DATA.DAT too. May you proposed codes?
From: Craig Powers on 11 May 2010 17:01 Allamarein wrote: > Let's suppose I produced 2 arrays > > REAL, DIMENSION (0:MAX_SIZE) :: T,Y > > where max_size is an appropriate integer. > May you suggest a code that create a GRAPH.PLT to see a T (x axis)- > Y(y axis) plot by gnuplot ? > I would export T and Y in a single file called DATA.DAT too. > > May you proposed codes? OPEN(UNIT=out_unit, FILE='DATA.DAT', STATUS='NEW') DO I = 0, MAX_SIZE WRITE(out_unit,*) T(I), Y(I) ENDDO Assumes appropriate declarations for I and out_unit. 'NEW' may not be the best status, but it's an appropriate approximation. List-directed format may not end up being what you want, but it's a nice easy starting point. I'm not familiar with gnuplot, so I'll leave the manipulation of the data file as an exercise to you or other follow-ups.
From: Allamarein on 11 May 2010 17:08 On 11 Mag, 23:01, Craig Powers <craig.pow...(a)invalid.invalid> wrote: > Allamarein wrote: > > Let's suppose I produced 2 arrays > > > REAL, DIMENSION (0:MAX_SIZE) :: T,Y > > > where max_size is an appropriate integer. > > May you suggest a code that create a GRAPH.PLT to see a T (x axis)- > > Y(y axis) plot by gnuplot ? > > I would export T and Y in a single file called DATA.DAT too. > > > May you proposed codes? > > OPEN(UNIT=out_unit, FILE='DATA.DAT', STATUS='NEW') > > DO I = 0, MAX_SIZE > WRITE(out_unit,*) T(I), Y(I) > ENDDO > > Assumes appropriate declarations for I and out_unit. 'NEW' may not be > the best status, but it's an appropriate approximation. List-directed > format may not end up being what you want, but it's a nice easy starting > point. > > I'm not familiar with gnuplot, so I'll leave the manipulation of the > data file as an exercise to you or other follow-ups. I'm a newbie. What means 'Assumes appropriate declarations for I and out_unit' ? Sorry, be patient....
From: Craig Powers on 11 May 2010 17:20 Allamarein wrote: > On 11 Mag, 23:01, Craig Powers <craig.pow...(a)invalid.invalid> wrote: >> Allamarein wrote: >>> Let's suppose I produced 2 arrays >>> REAL, DIMENSION (0:MAX_SIZE) :: T,Y >>> where max_size is an appropriate integer. >>> May you suggest a code that create a GRAPH.PLT to see a T (x axis)- >>> Y(y axis) plot by gnuplot ? >>> I would export T and Y in a single file called DATA.DAT too. >>> May you proposed codes? >> OPEN(UNIT=out_unit, FILE='DATA.DAT', STATUS='NEW') >> >> DO I = 0, MAX_SIZE >> WRITE(out_unit,*) T(I), Y(I) >> ENDDO >> >> Assumes appropriate declarations for I and out_unit. 'NEW' may not be >> the best status, but it's an appropriate approximation. List-directed >> format may not end up being what you want, but it's a nice easy starting >> point. >> >> I'm not familiar with gnuplot, so I'll leave the manipulation of the >> data file as an exercise to you or other follow-ups. > > I'm a newbie. > What means 'Assumes appropriate declarations for I and out_unit' ? > Sorry, be patient.... INTEGER :: I INTEGER, PARAMETER :: out_unit = 20 out_unit doesn't have to be 20, but it should probably be greater than 9 (single-digit unit numbers risk colliding into compiler extensions that pre-connect units with special destinations, like stderr, stdin, stdout, and so on).
From: Allamarein on 11 May 2010 17:42
On 11 Mag, 23:20, Craig Powers <craig.pow...(a)invalid.invalid> wrote: > Allamarein wrote: > > On 11 Mag, 23:01, Craig Powers <craig.pow...(a)invalid.invalid> wrote: > >> Allamarein wrote: > >>> Let's suppose I produced 2 arrays > >>> REAL, DIMENSION (0:MAX_SIZE) :: T,Y > >>> where max_size is an appropriate integer. > >>> May you suggest a code that create a GRAPH.PLT to see a T (x axis)- > >>> Y(y axis) plot by gnuplot ? > >>> I would export T and Y in a single file called DATA.DAT too. > >>> May you proposed codes? > >> OPEN(UNIT=out_unit, FILE='DATA.DAT', STATUS='NEW') > > >> DO I = 0, MAX_SIZE > >> WRITE(out_unit,*) T(I), Y(I) > >> ENDDO > > >> Assumes appropriate declarations for I and out_unit. 'NEW' may not be > >> the best status, but it's an appropriate approximation. List-directed > >> format may not end up being what you want, but it's a nice easy starting > >> point. > > >> I'm not familiar with gnuplot, so I'll leave the manipulation of the > >> data file as an exercise to you or other follow-ups. > > > I'm a newbie. > > What means 'Assumes appropriate declarations for I and out_unit' ? > > Sorry, be patient.... > > INTEGER :: I > INTEGER, PARAMETER :: out_unit = 20 > > out_unit doesn't have to be 20, but it should probably be greater than 9 > (single-digit unit numbers risk colliding into compiler extensions that > pre-connect units with special destinations, like stderr, stdin, stdout, > and so on). status="new" gets error if I have just the file (of course). Shall I delete that before re-run? How can I modify my code? |