Updated
Wed. 2/12/2025; updates are in red
Description and Overview
- Problem: 1-D linear and nonlinear advection
- Method: Lax-Wendroff
- Flow field: constant (for linear cases), nonlinear in third case.
- Evaluation: save and plot maximum absolute value vs. time
- Initial condition: Sine curve
- Boundary conditions: periodic
- Images fixed now - you should be able to see test case plots
- My "run" script is on Keeling - copy from ~bjewett/502/Pgm1/run
- Problem assignment handout: ComputerProb1.pdf (PDF,
contains official problem settings)
- Program-1 starting codes:
See these on Keeling at ~bjewett/502/Pgm1
- Deadline extended: 9 pm Friday Feb. 14, 2025
-- submit on Canvas - there is a place under Programs to do so now.
- FAQ/Questions+Answers section
is at the bottom of this page
Getting started on program
#1
- To use X-windows/x11 graphics:
- There are a few steps to do before logging in; you need
x11 graphics software.
- Linux PC: this capability should be built-in and ready to go.
- Mac: you need to install the free software Xquartz.
- You can/should start Xquartz once to make sure it works, but it should start on its own in the
future when needed. I am using version 2.8.5 .
- See the connection description below; you will need to type ssh -X or ssh -Y
for x11-forwarding to work
when you connect using Terminal or iTerm2.
- Windows:
- If using MobaXterm - I believe the x11 capability is built-in
- If using Xshell - Get and install the Xming X Server for windows (free), and start Xming before connecting with Xshell.
Note that starting Xming ... works, but you won't see anything happen - yet!
- Xshell (continued) - you need to configure your login settings for Keeling to do
graphics Tunneling also known
as X11 Forwarding in Xshell. If you already created a Session in Xshell to connect to Keeling,
go back, right-click on the Keeling Session on the left side of your Xshell window,
and select Properties at the bottom. When the "Properties of [new session]" window appears,
look for Category: Connection > SSH > Tunneling. Click
on the round button to choose
X DISPLAY: instead of Xmanager. Then click OK to save the settings.
Now when you connect to Keeling with Xshell, you should be able to use x11 graphics.
- Connect to Keeling with Xshell (on Windows), or type the
following in a Linux window or
Terminal / iTerm2 (on a Mac):
ssh -Y yourNetID@keeling.earth.illinois.edu
Note that:
- On Linux, ssh -X is recommended instead of ssh -Y. Info:
ssh -X vs. -Y
- If you are off campus in a cafe, apartment or private jet, you must first connect with
the campus VPN software before you can connect to Keeling.
- Using the Cisco Secure Client i.e. VPN software is a good idea on any public internet
like that in a cafe.
- If on a Mac, when installing the VPN software, choose
Not to allow the Cisco network filtering
to run. Your Mac should ask you whether to allow it after you install it.
This network filtering software apparently interferes with the Mac OS, and is unnecessary.
- Once logged in, type these Linux commands:
- cd
(takes
you to home directory)
- mkdir atms502
(make class directory)
- cd
atms502 (change to class directory)
- mkdir pgm1
(make subdirectory)
- cd
pgm1 (change to subdirectory)
- pwd
(print working directory)
- Now copy the Program 1
files from my Keeling directory:
- For Fortran: cp
~bjewett/502/Pgm1/Fortran/* .
(don't omit this trailing
dot "." !!)
- For C: cp
~bjewett/502/Pgm1/C/* .
(don't omit this trailing
dot "." !!)
- If you have not yet done so,
run this command: to get NCAR command language tools:
module load ncl
- This fixes the "ncargcc/ncargf90 not found" error.
- To avoid having to type this every time you login,
go to your home directory (cd),
and edit your Linux settings file ".profile" (e.g. with the
nano text editor),
and put module load ncl in there.
- Compile the code by
typing: make
It is necessary - before doing make - to run:
source ~bjewett/502/INTEL to acquire the necessary code building tools.
- Run it by typing: pgm1 (if that doesn't work, try putting a dot and slash first:
./pgm1
)
- A plot file is generated
called gmeta (do "ls"
to see if it exists)
- Convert this plot file to
a .zip file of GIFs:
~bjewett/502/Tools/metagif
gmeta -all -zip
- Send this .zip file to
your PC
- You can do this with tools like Xftp, FileZilla
etc.
- Or, if the (.zip) file isn't too large, use
linux Mail
(mail with a capital "M")
Mail
-a gmeta.zip yourNetID@illinois.edu
the "-a" option is used to send an email Attachment
enter a subject if you wish, and type control-D
to Send the Mail message.
Original code results - without changes - solutions damps
The program 1 code can and should be compiled and
run as is, with no changes, first.
I used these settings:
- Number of grid points: NX = 25 (this is the default)
- Courant number to use: 0.5
- Number of steps to run: 50
- Plot interval set to: 5
- Linear or nonlinear: L (linear)
Plots of the initial condition, solution at 10 and 20
steps, time trace of max absolute value and 3rd time-space
plot are shown below for Fortran and C. These were with
the default (no extra compile settings) OPTIONS in the
Makefile. Click on any image below for a
full-sized view.
Follow these links to see the text output from the
(unmodified program 1 files) code for Fortran
or C.
|
Step 0 (IC) |
Step 10 |
Step 20 |
Smax(t) |
Space/time plot |
Fortran |
 |
 |
 |
 |
 |
C |
 |
 |
 |
 |
 |
Fortran test case
results - with changes
In the results shown below I have left the grid point
count at 25 but have modified the code, namely:
- added the two lines to implement periodic boundaries
in the bc routine;
- altered the advection.f90
file for Lax-Wendroff for linear and nonlinear cases
To test your code, fix your bc.f90 and advection.f90
routines and run the code, still with NX=25.
Remember to change
the grid point count NX to 125 before
running the official problem to plot and hand in!!!!
For these test cases, nx should be left at 25.
Set the plot frequency to be as often as you wish (e.g.
every step).
The parameters used:
|