New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
basic_stats.sh in NEMO/releases – NEMO

source: NEMO/releases/basic_stats.sh @ 10864

Last change on this file since 10864 was 10864, checked in by nicolasmartin, 5 years ago

Add a simple script to calculate basic numbers on NEMO releases

                                            code    comm(ratio)   total
release-3.4/NEMOGCM/NEMO/LIM_SRC_2          6358    1975(23,7%)    8333
release-3.4/NEMOGCM/NEMO/LIM_SRC_3         13015    4019(23,5%)   17034
release-3.4/NEMOGCM/NEMO/NST_SRC            2071     358(14,7%)    2429
release-3.4/NEMOGCM/NEMO/OFF_SRC            1967     588(23,0%)    2555
release-3.4/NEMOGCM/NEMO/OPA_SRC           96005   29926(23,7%)  125931
release-3.4/NEMOGCM/NEMO/OPATAM_SRC        37209   12706(25,4%)   49915
release-3.4/NEMOGCM/NEMO/TOP_SRC           20111    5932(22,7%)   26043
                                   total  176736   55504(23,8%)  232240
release-3.6/NEMOGCM/NEMO/LIM_SRC_2          6552    1991(23,3%)    8543
release-3.6/NEMOGCM/NEMO/LIM_SRC_3         11200    3631(24,4%)   14831
release-3.6/NEMOGCM/NEMO/NST_SRC            4408    1091(19,8%)    5499
release-3.6/NEMOGCM/NEMO/OFF_SRC            2037     593(22,5%)    2630
release-3.6/NEMOGCM/NEMO/OOO_SRC            4495     945(17,3%)    5440
release-3.6/NEMOGCM/NEMO/OPA_SRC          113711   33269(22,6%)  146980
release-3.6/NEMOGCM/NEMO/SAS_SRC            1855     659(26,2%)    2514
release-3.6/NEMOGCM/NEMO/TOP_SRC           22371    6823(23,3%)   29194
                                   total  166629   49002(22,7%)  215631
release-4.0/src/ICE                        13721    4951(26,5%)   18672
release-4.0/src/NST                         5565    1537(21,6%)    7102
release-4.0/src/OCE                        96572   29102(23,1%)  125674
release-4.0/src/OFF                         1285     399(23,6%)    1684
release-4.0/src/SAO                         2530     464(15,4%)    2994
release-4.0/src/SAS                         1805     606(25,1%)    2411
release-4.0/src/TOP                        24789    7690(23,6%)   32479
                                   total  146267   44749(23,4%)  191016
  • Property svn:executable set to *
File size: 1.1 KB
Line 
1#!/bin/sh
2
3## Basic statitics on code / comments lines in NEMO sources per release
4
5printf "%40s %7s %7s(ratio) %7s\n\n" '' code comm total
6
7for release_srcs in "release-3.4/NEMOGCM/NEMO/*" "release-3.6/NEMOGCM/NEMO/*" "release-4.0/src/*"; do
8
9    total_code=0; total_comm=0; total_line=0
10
11    for dir in $release_srcs; do
12        printf "%-40s " $dir
13        nb_code_lines=$( find $dir -name *.[fFh]90 -exec grep '^ *[^!]' {} \; | wc -l )
14        nb_comm_lines=$( find $dir -name *.[fFh]90 -exec grep '^ *!'    {} \; | wc -l )
15        ratio=$( echo "scale = 3; ( $nb_comm_lines / ( $nb_code_lines + $nb_comm_lines ) ) * 100 " | bc | tr . , )
16        printf "%7d %7d(%4.1f%%) %7d\n" $nb_code_lines $nb_comm_lines $ratio $(( nb_code_lines + nb_comm_lines ))
17        total_code=$(( total_code + nb_code_lines                 ))
18        total_comm=$(( total_comm                 + nb_comm_lines ))
19        total_line=$(( total_line + nb_code_lines + nb_comm_lines ))
20    done
21
22    ratio=$( echo "scale = 3; ( $total_comm / $total_line ) * 100 " | bc | tr . , )
23    printf "%40s %7d %7d(%4.1f%%) %7d\n\n" total $total_code $total_comm $ratio $total_line
24
25done
26
27exit 0
Note: See TracBrowser for help on using the repository browser.