This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
! compile using the command: | |
! gfortran `pkg-config --cflags --libs plplot-f95` -o myplot myplot.f90 | |
program myplot | |
use plplot | |
implicit none | |
integer, parameter :: dp=kind(0.0d0) | |
real(kind=plflt), dimension(3):: x, y | |
x = [1,2,3] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
program hard | |
double precision, allocatable :: a(:) | |
a = [10 , 12, 13] ! no need to count size beforehand | |
print *, a | |
end program hard |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# dollar exchange rate | |
url="http://download.finance.yahoo.com/d/quotes.csv?s=USDGBP=X&f=nl1d1t1" | |
curl -s -L $url > usd.csv & | |
# download regular tickers | |
PRE="http://download.finance.yahoo.com/d/quotes.csv?s=" | |
POST="&f=sl1c1p2&e=.csv" |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# example of using coprocesses with dc | |
coproc mydc { dc; } # run process dc, calling it `mydc' | |
# define convenience functions for writing/reading to mydc | |
say () { echo "$1" >&"${mydc[1]}" ; } # echo 1st argument to mydc | |
get () { read res <&"${mydc[0]}" ; } # set var `res' is response | |
say "0" # initialise stack with 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff -aurN datetime-fortran-1.2.0.pristine/Makefile datetime-fortran-1.2.0.new/Makefile | |
--- datetime-fortran-1.2.0.pristine/Makefile 2016-01-23 10:12:05.230627072 +0000 | |
+++ datetime-fortran-1.2.0.new/Makefile 2016-01-23 10:12:33.990628308 +0000 | |
@@ -1,12 +1,37 @@ | |
+# To compile a file foo.f90 containing `use datetime_module' | |
+# issue a command like: | |
+# gfortran -o foo `pkg-config --cflags datetime-fortran` foo.f90 -ldatetime | |
+ | |
+# If Arch Linux, assume a package manager, and go to /usr | |
+ifneq ("$(wildcard /etc/arch-release)","") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define PRERR(e) print *, 'e', e | |
program mkepics | |
use netcdf | |
!use maff | |
use datetime_module | |
use fates | |
use yahoo | |
implicit none |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Example of reading data in HDF | |
Compile using: | |
gcc h5print.c -lhdf5 | |
Dataset is available in UUENCODED format at: | |
https://gist.github.com/blippy/82c23d1d0cdb932a4c29 | |
Quite possibly not all resources have been cleaned up | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
x |