Ignore:
Timestamp:
2015-06-19T17:18:00+02:00 (5 years ago)
Author:
davestorkey
Message:

Update 2015/dev_r5021_UKMO1_CICE_coupling branch to revision 5442 of the trunk.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2015/dev_r5021_UKMO1_CICE_coupling/NEMOGCM/TOOLS/MISCELLANEOUS/chk_wrk_alloc.sh

    r3294 r5443  
    1212#   ../TOOLS/MISCELLANEOUS/chk_wrk_alloc.sh 
    1313# 
    14 set -ue 
     14set -u 
    1515# 
    1616echo "check for all *90 files contained in "$( pwd )" and its subdirectories" 
    1717# 
    18 for ff in $( grep -il wrk_nemo_2 $( find . -name "*90" ) ) 
     18for ff in $( grep -il "^ *use  *wrk_nemo" $( find . -name "*90" )  $( find . -name "*h90" ) ) 
    1919do 
    20  
    2120    # number of lines with wrk_alloc 
    22     n1=$( grep -ic "call *wrk_alloc *(" $ff )   
    23     # replace wrk_alloc with wrk_dealloc and count the lines 
    24     n2=$( sed -e "s/wrk_alloc/wrk_dealloc/" $ff | grep -ic "call *wrk_dealloc *(" ) 
    25     # we should get n2 = 2 * n1... 
    26     [ $(( 2 * $n1 )) -ne $n2 ] && echo "problem with wrk_alloc in $ff"  
    27     
    28     # same story but for wrk_dealloc 
    29     n1=$( grep -ic "call *wrk_dealloc *(" $ff )   
    30     n2=$( sed -e "s/wrk_dealloc/wrk_alloc/" $ff | grep -ic "call *wrk_alloc *(" ) 
    31     [ $(( 2 * $n1 )) -ne $n2 ] && echo "problem with wrk_dealloc in $ff"  
    32     
     21    n1=$( grep -ic "call *wrk_alloc *(" $ff ) 
     22    # number of lines with wrk_dealloc 
     23    nn1=$( grep -ic "call *wrk_dealloc *(" $ff )   
     24     
     25    if [ $(( $n1 + $nn1 )) -ne 0 ] 
     26    then 
     27   # replace wrk_alloc with wrk_dealloc and count the lines 
     28   n2=$( sed -e "s/wrk_alloc/wrk_dealloc/" $ff | grep -ic "call *wrk_dealloc *(" ) 
     29   # we should get n2 = 2 * n1... 
     30   [ $(( 2 * $n1 )) -ne $n2 ] && echo "problem with wrk_alloc in $ff"  
     31    
     32   # same story but for wrk_dealloc 
     33   nn2=$( sed -e "s/wrk_dealloc/wrk_alloc/" $ff | grep -ic "call *wrk_alloc *(" ) 
     34   if [ $(( 2 * $nn1 )) -ne $nn2 ] 
     35   then 
     36       echo "problem with wrk_dealloc in $ff" 
     37       grep -i "call *wrk_alloc *(" $ff 
     38       grep -i "call *wrk_dealloc *(" $ff 
     39       echo 
     40   fi 
     41    fi 
     42     
    3343done 
Note: See TracChangeset for help on using the changeset viewer.