Personal tools

Mohid facts

From MohidWiki

Revision as of 09:46, 22 April 2010 by Guillaume (talk | contribs)
Jump to: navigation, search

Linux is great to quickly get some trivia related with the MOHID software suite. These numbers contemplate only the MOHIDWater, MOHIDLand, MOHIDBase1 and MOHIDBase2 code and omit the suite of MOHID related tools built in Fortran or Visual Basic.

Code related facts (as of 2010-04-21)

How many keywords are there in MohidWater (including Base1 and Base2 libraries)?

> for i in `find | grep MOHID | grep -v Land | grep -v River | grep F90`; do cat $i | grep -re "call GetData" ; done | wc -l

3436


And in MohidWater and MohidLand together?

> for i in `find | grep MOHID | grep F90`; do cat $i | grep -re "call GetData" ; done | wc -l

4082


How many lines of code is there in MohidWater and MohidLand (including Base1 and Base2)?

> for i in `find | grep MOHID | grep F90`; do cat $i; done | wc -l              

703820


And without empty lines?

> for i in `find | grep MOHID | grep F90`; do cat $i | grep "\w"; done | wc -l  

476330


And without comment-lines?

> for i in `find | grep MOHID | grep F90`; do cat $i | grep -v "^ *\!"; done | wc -l

400500


How many parallel openmp zones is there in the code?

> for i in `find | grep MOHID | grep F90`; do cat $i | grep "OMP PARALLEL"; done | wc -l

284


How many subroutines is there in the code?

> for i in `find | grep MOHID | grep F90`; do cat $i | grep -r "^ *subroutine"; done | wc -l

6466


How many ifs are there in the code?

> for i in `find | grep MOHID | grep F90`; do cat $i | grep -r "^ *if ("; done | wc -l

40366


How many calls are there in the code?

> for i in `find | grep MOHID | grep F90`; do cat $i | grep -r "^ *call "; done | wc -l

29770


How many types are there in the code?

> for i in `find | grep MOHID | grep F90`; do cat $i | grep -r "^ *type "; done | wc -l

4994


How many allocates are there in the code?

> for i in `find | grep MOHID | grep F90`; do cat $i | grep -r "^ *allocate "; done | wc -l

1860


And deallocates?

> for i in `find | grep MOHID | grep F90`; do cat $i | grep -r "^ *deallocate "; done | wc -l

1322

Could there be memory leaks? Maybe not, as one deallocate command may free several allocated arrays... It would be a good thing enforce one deallocate command per allocate command. That would make a quick check for memory leaks in the program...


How many do loops are there in the code?

> for i in `find | grep MOHID | grep F90`; do cat $i | grep -r "^ *do "; done | wc -l

8096


Related links