Prev: Assumed-shape array of variable-length strings
Next: Why is Ada considered "too specialized" for scientific use
From: Uno on 5 Jun 2010 06:01 [normally, I would put OT in the subject. I hope that this forum tolerates wildly errant source regarding the gulf spill until it is less errant] What silly thing have I done here so as to f up the output? Dir for this script: E:\fortran_stuff\ E:\fortran_stuff>gfortran -Wall -Wextra p1.f90 -o out.exe e:/fortran_ E:\fortran_stuff>gfortran -Wall -Wextra p1.f90 -o out.exe e:/fortran_stuff/bin/../lib/gcc/x86_64-pc-mingw32/4.6.0/../../../../x86_64-pc-mi ngw32/bin/ld.exe: cannot find -lgfortran e:/fortran_stuff/bin/../lib/gcc/x86_64-pc-mingw32/4.6.0/../../../../x86_64-pc-mi ngw32/bin/ld.exe: cannot find -lgcc e:/fortran_stuff/bin/../lib/gcc/x86_64-pc-mingw32/4.6.0/../../../../x86_64-pc-mi ngw32/bin/ld.exe: cannot find -lgcc collect2: ld returned 1 exit status E:\fortran_stuff> print *, "atmos is ", atmos endprogram ! gfortran -Wall -Wextra p1.f90 -o out.exe implicit none real :: mile_in_feet, atm_per_mile, atmos mile_in_feet = 5280 atm_per_mile = 32.808399169 atmos = mile_in_feet / atm_per_mile print *, "atmos is ", atmos endprogram ! gfortran -Wall -Wextra p1.f90 -o out.exe q1) Consider a half-inch copper pipe. Temperature is constant. If you ran it for a minute into a pool, you would get a certain volume, say, x. If you ran it for a minute at 32.8 ft below water level, what volume of spewed water results? q2) How would this vary if salt were added in the amounts of the gulf of mexico? -- Uno
From: robin on 5 Jun 2010 07:10 "Uno" <merrilljensen(a)q.com> wrote in message news:86ulj7Ff3dU1(a)mid.individual.net... | What silly thing have I done here so as to f up the output? | | E:\fortran_stuff> | print *, "atmos is ", atmos | | endprogram | ! gfortran -Wall -Wextra p1.f90 -o out.exe | | implicit none | | real :: mile_in_feet, atm_per_mile, atmos | | mile_in_feet = 5280 | atm_per_mile = 32.808399169 BTW, without the kind, this is a single-precision constant. | atmos = mile_in_feet / atm_per_mile | | print *, "atmos is ", atmos | | endprogram
From: Ron Shepard on 5 Jun 2010 13:26 In article <86ulj7Ff3dU1(a)mid.individual.net>, Uno <merrilljensen(a)q.com> wrote: > implicit none > > real :: mile_in_feet, atm_per_mile, atmos > > mile_in_feet = 5280 This is feet per mile, right? > atm_per_mile = 32.808399169 This is feet per atmosphere, right? > > atmos = mile_in_feet / atm_per_mile This is atmospheres per mile, right? Your variable names are a little confusing. > > print *, "atmos is ", atmos > > endprogram > ! gfortran -Wall -Wextra p1.f90 -o out.exe > > q1) Consider a half-inch copper pipe. Temperature is constant. If you > ran it for a minute into a pool, you would get a certain volume, say, x. > If you ran it for a minute at 32.8 ft below water level, what volume > of spewed water results? You cannot know. If the pressure within the pipe is greater than the pressure at 32.8 ft, then the liquid will continue to flow, but at a slower rate. If the pressure within the pipe is less than the pressure at 32.8 ft, then it will flow in the opposite direction. So you need an additional important piece of information to answer the question. > q2) How would this vary if salt were added in the amounts of the gulf > of mexico? You need to look up the density of sea water and compare that to fresh water. You can then determine the feet per atmosphere of pressure for sea water, and that should give you enough info to answer the question. $.02 -Ron Shepard
From: Uno on 5 Jun 2010 22:25 On 6/5/2010 4:10 AM, robin wrote: > BTW, without the kind, this is a single-precision constant. Thx, robin, default precision is fine for starters. I want to make this as legible as possible. We're all familiar with kind values, but they might be a stumbling block to people who haven't seen fortran for a decade or two. E:\gcc_eq32>gfortran -Wall -Wextra p1.f90 -o out.exe E:\gcc_eq32>out atmos is 160.93440 E:\gcc_eq32>type p1.f90 implicit none real :: feet_per_mile, atm_per_mile, atmos feet_per_mile = 5280 atm_per_mile = 32.808399169 atmos = feet_per_mile / atm_per_mile print *, "atmos is ", atmos endprogram ! gfortran -Wall -Wextra p1.f90 -o out.exe E:\gcc_eq32> I have no idea why this didn't work last night. -- Uno
From: Uno on 5 Jun 2010 22:56
On 6/5/2010 10:26 AM, Ron Shepard wrote: > In article<86ulj7Ff3dU1(a)mid.individual.net>, Uno<merrilljensen(a)q.com> > You cannot know. If the pressure within the pipe is greater than the > pressure at 32.8 ft, then the liquid will continue to flow, but at a > slower rate. If the pressure within the pipe is less than the pressure > at 32.8 ft, then it will flow in the opposite direction. > > So you need an additional important piece of information to answer the > question. Right. Let's say the pressure is typical city water pressure. This isn't too hard for anyone to measure. E:\gcc_eq32>gfortran -Wall -Wextra p1.f90 -o out.exe E:\gcc_eq32>out atmos is 160.93440 city_pressure is 65.000000 atmos2 is 4.5699549 depth is 149.93291 E:\gcc_eq32>type p1.f90 implicit none real :: feet_per_mile, feet_per_atmos, atmos real :: city_pressure, atmos_per_pound, atmos2 real :: depth ! values feet_per_mile = 5280 feet_per_atmos = 32.808399169 city_pressure = 65 !typical water pressure in lb/in^2 ! http://en.wikipedia.org/wiki/Atmosphere_(unit) atmos_per_pound = 70.307E-3 ! calculations atmos = feet_per_mile / feet_per_atmos atmos2 = city_pressure * atmos_per_pound depth = feet_per_atmos*atmos2 !output print *, "atmos is ", atmos print *, "city_pressure is ", city_pressure print *, "atmos2 is ", atmos2 print *, "depth is ", depth endprogram ! gfortran -Wall -Wextra p1.f90 -o out.exe E:\gcc_eq32> So, if instead of opening a water spigot at seal level, you went 150 feet down, would it have no net flux? > >> q2) How would this vary if salt were added in the amounts of the gulf >> of mexico? > > You need to look up the density of sea water and compare that to fresh > water. You can then determine the feet per atmosphere of pressure for > sea water, and that should give you enough info to answer the question. Ok. Gotta run -- Uno |