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.
Changeset 5535 for branches/UKMO/dev_r5107_eorca025_closea/NEMOGCM/TOOLS/MISCELLANEOUS/chk_wrk_alloc.sh – NEMO

Ignore:
Timestamp:
2015-07-02T16:00:36+02:00 (9 years ago)
Author:
davestorkey
Message:

Update UKMO/dev_r5107_eorca025_closea branch to rev 5518 of trunk
(= branching point of NEMO 3.6_stable).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/UKMO/dev_r5107_eorca025_closea/NEMOGCM/TOOLS/MISCELLANEOUS/chk_wrk_alloc.sh

    r5449 r5535  
    1818for ff in $( grep -il "^ *use  *wrk_nemo" $( find . -name "*90" )  $( find . -name "*h90" ) ) 
    1919do 
     20    ierr=0 
     21     
    2022    # number of lines with wrk_alloc 
    2123    n1=$( grep -ic "call *wrk_alloc *(" $ff ) 
     
    2830   n2=$( sed -e "s/wrk_alloc/wrk_dealloc/" $ff | grep -ic "call *wrk_dealloc *(" ) 
    2931   # we should get n2 = 2 * n1... 
    30    [ $(( 2 * $n1 )) -ne $n2 ] && echo "problem with wrk_alloc in $ff"  
    31     
     32   if [ $(( 2 * $n1 )) -ne $n2 ] 
     33   then 
     34       ierr=1 
     35       echo "problem with wrk_alloc in $ff"  
     36   fi 
    3237   # same story but for wrk_dealloc 
    3338   nn2=$( sed -e "s/wrk_dealloc/wrk_alloc/" $ff | grep -ic "call *wrk_alloc *(" ) 
    3439   if [ $(( 2 * $nn1 )) -ne $nn2 ] 
    3540   then 
    36        echo "problem with wrk_dealloc in $ff" 
     41       ierr=1 
     42       echo "problem with wrk_dealloc in $ff"  
     43   fi 
     44 
     45   if [ $ierr -eq 0 ] # check that wrk_alloc block is the same as wrk_dealloc block 
     46   then 
     47       grep -i "call *wrk_alloc *("   $ff | sed -e "s/ //g" | sed -e "s/!.*//g" > txt1$$ 
     48       grep -i "call *wrk_dealloc *(" $ff | sed -e "s/wrk_dealloc/wrk_alloc/"  | sed -e "s/ //g" | sed -e "s/!.*//g" > txt2$$ 
     49       cmp txt1$$ txt2$$ 
     50       if [ $? -ne 0 ] 
     51       then 
     52      echo "different syntax in wrk_alloc and wrk_dealloc in $ff" 
     53      echo 
     54      for ll in $( seq 1 $n1 )  # compare each line 
     55      do 
     56          sed -n ${ll}p txt1$$ > ll1$$ 
     57          sed -n ${ll}p txt2$$ > ll2$$ 
     58          cmp ll1$$ ll2$$ > /dev/null 
     59          if [ $? -ne 0 ] 
     60          then 
     61         grep -i "call *wrk_alloc *("   $ff | sed -n ${ll}p 
     62         grep -i "call *wrk_dealloc *(" $ff | sed -n ${ll}p 
     63         echo 
     64          fi 
     65          rm -f ll1$$ ll2$$ 
     66      done 
     67       fi 
     68       rm -f txt1$$ txt2$$ 
     69   else 
    3770       grep -i "call *wrk_alloc *(" $ff 
    38        grep -i "call *wrk_dealloc *(" $ff 
     71       echo 
     72       grep -i "call *wrk_dealloc *(" $ff  
    3973       echo 
    4074   fi 
     75    
    4176    fi 
    4277     
Note: See TracChangeset for help on using the changeset viewer.