/[escript]/trunk/doc/examples/cookbook/example03a.py
ViewVC logotype

Diff of /trunk/doc/examples/cookbook/example03a.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3891 by jfenwick, Mon Oct 11 01:48:14 2010 UTC revision 3892 by jfenwick, Tue Apr 10 08:57:23 2012 UTC
# Line 51  from cblib import toXYTuple Line 51  from cblib import toXYTuple
51  ########################################################MPI WORLD CHECK  ########################################################MPI WORLD CHECK
52  if getMPISizeWorld() > 1:  if getMPISizeWorld() > 1:
53      import sys      import sys
54      print "This example will not run in an MPI world."      print("This example will not run in an MPI world.")
55      sys.exit(0)      sys.exit(0)
56    
57  #################################################ESTABLISHING VARIABLES  #################################################ESTABLISHING VARIABLES
# Line 83  tend=200.* yr #the time we want to end t Line 83  tend=200.* yr #the time we want to end t
83  outputs = 200 # number of time steps required.  outputs = 200 # number of time steps required.
84  h=(tend-t)/outputs #size of time step  h=(tend-t)/outputs #size of time step
85  #user warning  #user warning
86  print "Expected Number of Output Files is: ", outputs  print("Expected Number of Output Files is: ", outputs)
87  print "Step size is: ", h/day, "days"  print("Step size is: ", h/day, "days")
88  i=0 #loop counter  i=0 #loop counter
89  #the folder to put our outputs in, leave blank "" for script path  #the folder to put our outputs in, leave blank "" for script path
90  save_path= os.path.join("data","example03")  save_path= os.path.join("data","example03")
# Line 137  while t<=tend: Line 137  while t<=tend:
137        pl.ylabel("Depth (m)")        pl.ylabel("Depth (m)")
138        pl.savefig(os.path.join(save_path,"temp%03d.png"%i))        pl.savefig(os.path.join(save_path,"temp%03d.png"%i))
139        pl.clf()                    pl.clf()            
140        print "time step %s at t=%e days completed."%(i,t/day)        print("time step %s at t=%e days completed."%(i,t/day))
141    
142  #########################################################CREATE A MOVIE  #########################################################CREATE A MOVIE
143  # compile the *.png files to create an *.avi video that shows T change  # compile the *.png files to create an *.avi video that shows T change

Legend:
Removed from v.3891  
changed lines
  Added in v.3892

  ViewVC Help
Powered by ViewVC 1.1.26