Skip to content

Instantly share code, notes, and snippets.

View huijunchen9260's full-sized avatar

Hui-Jun Chen huijunchen9260

View GitHub Profile
@zzj99
zzj99 / binary.f90
Created May 28, 2016 13:51
read unformatted / binary fortran file with python
program test
integer :: i
open(1, file='test.dat', access='stream', form='unformatted')
do i = 1, 10
write(1) i
write(1) dble(i)**2
end do
close(1)
end program test
@plampite
plampite / mod_fint.F90
Last active July 21, 2024 14:01
A simple, multi-dimensional linear interpolation function in Fortran. Roughly inspired by FINT in Cernlib, but hopefully more readable and easy to understand.
!Copyright 2024 Paolo Lampitella
!This code is licensed under the terms of the MIT license
MODULE mod_fint
IMPLICIT NONE
INTEGER, PARAMETER :: IP4 = SELECTED_INT_KIND(9)
INTEGER, PARAMETER :: WP = SELECTED_REAL_KIND(15,307)
CONTAINS
@Gavinok
Gavinok / groffconceal.vim
Last active October 8, 2020 19:27
add this to your .vim/after/syntax/groff.vim
fun! s:GroffConceal(group,pat,cchar)
exe 'syn match '.a:group." '".a:pat."' contained conceal cchar=".a:cchar
endfun
if exists('g:groff_greek')
call s:GroffConceal('roffGreek' ,'\<alpha\>' ,'α')
call s:GroffConceal('roffGreek' ,'\<beta\>' ,'β')
call s:GroffConceal('roffGreek' ,'\<gamma\>' ,'γ')
call s:GroffConceal('roffGreek' ,'\<delta\>' ,'δ')
call s:GroffConceal('roffGreek' ,'\<epsilon\>' ,'ϵ')