Changeset 634


Ignore:
Timestamp:
Apr 26, 2012, 10:03:22 AM (13 years ago)
Author:
emillour
Message:

All GCMs:

  • Improved 'create_make_gcm' scripts: better control of wether files are identified as main programs or routines.

EM

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.COMMON/create_make_gcm

    r134 r634  
    141141      do
    142142         fili=`basename $i .F`
    143          test=` (  head $i | grep '      PROGRAM' ) `
     143         # Check if file is a routine or main program
     144         # i.e: look for the "program" keword preceeded by leading spaces
     145         test=` (  head $i | grep -i '^ *program' ) `
    144146         if [ "$test" = "" ] ; then
     147            # if it is not a main program, add it to the list
    145148            listlib=$listlib" "$fili
    146149         fi
     
    149152      do
    150153         fili=`basename $i .F90`
    151          test=` (  head $i | grep '      PROGRAM' ) `
     154         # Check if file is a routine or main program
     155         # i.e. look for "program" keyword (with possibly some leading spaces)
     156         test=` (  head $i | grep -i '^ \{0,\}program' ) `
    152157         if [ "$test" = "" ] ; then
     158            # if it is not a main program, add it to the list
    153159            listlib=$listlib" "$fili
    154160         fi
     
    249255      do
    250256         fili=`basename $i .c`
    251          test=` (  head $i | grep '      PROGRAM' ) `
     257         # Check if file is a function or main program
     258         # i.e. look for "int main" keywords (with possibly some leading spaces)
     259         test=` (  head $i | grep '^ \{0,\}int main' ) `
    252260         if [ "$test" = "" ] ; then
     261            # if it is not a main program, add it to the list
    253262            listlib=$listlib" "$fili
    254263         fi
  • trunk/LMDZ.GENERIC/create_make_gcm

    r375 r634  
    153153      do
    154154         fili=`basename $i .F`
    155          test=` (  head $i | grep '      PROGRAM' ) `
     155         # Check if file is a routine or main program
     156         # i.e: look for the "program" keword preceeded by leading spaces
     157         test=` (  head $i | grep -i '^ *program' ) `
    156158         if [ "$test" = "" ] ; then
     159            # if it is not a main program, add it to the list
    157160            listlib=$listlib" "$fili
    158161         fi
     
    161164      do
    162165         fili=`basename $i .F90`
    163          test=` (  head $i | grep '      PROGRAM' ) `
     166         # Check if file is a routine or main program
     167         # i.e. look for "program" keyword (with possibly some leading spaces)
     168         test=` (  head $i | grep -i '^ \{0,\}program' ) `
    164169         if [ "$test" = "" ] ; then
     170            # if it is not a main program, add it to the list
    165171            listlib=$listlib" "$fili
    166172         fi
     
    238244              echo '    $(COMPILE90) $(LIBF)/'$diri'/'$trufile' ; \'
    239245           fi
     246           ## If a module, handle created module descriptor file
    240247           MODU=0; egrep -i '^ *module ' $trufile> /dev/null 2>&1 && MODU=1
    241248            if [ "$MODU" -eq '1' -a "$CRAY" != '1' ] ; then
  • trunk/LMDZ.MARS/create_make_gcm

    r519 r634  
    150150      do
    151151         fili=`basename $i .F`
    152          test=` (  head $i | grep '      PROGRAM' ) `
     152         # Check if file is a routine or main program
     153         # i.e: look for the "program" keword preceeded by leading spaces
     154         test=` (  head $i | grep -i '^ *program' ) `
    153155         if [ "$test" = "" ] ; then
     156            # if it is not a main program, add it to the list
    154157            listlib=$listlib" "$fili
    155158         fi
     
    158161      do
    159162         fili=`basename $i .F90`
    160          test=` (  head $i | grep '      PROGRAM' ) `
     163         # Check if file is a routine or main program
     164         # i.e. look for "program" keyword (with possibly some leading spaces)
     165         test=` (  head $i | grep -i '^ \{0,\}program' ) `
    161166         if [ "$test" = "" ] ; then
     167            # if it is not a main program, add it to the list
    162168            listlib=$listlib" "$fili
    163169         fi
     
    228234         else
    229235         ## Fortran 90
    230            echo '       cd $(LOCAL_DIR); \'
    231236           if [ -f $fili.F90 ] ; then
    232237           ## Free Form Fortran 90
Note: See TracChangeset for help on using the changeset viewer.