Changeset 519


Ignore:
Timestamp:
Feb 9, 2012, 3:48:30 PM (13 years ago)
Author:
emillour
Message:

Mars GCM:

  • Updated the makegcm(s) so that default behaviour is to set LMDGCM env variable to be the directory in which the makegcm script is. Updated the makegcm_* to use "SOURCE" to identify main program to compile.
  • Adapted "create_make_gcm" script so that it can compile a main program that is either something.F or something.F90. Also added that object files are removed from archive before compiling a new version.

EM

Location:
trunk/LMDZ.MARS
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.MARS/README

    r517 r519  
    13781378   Also updated "phymars/comdiurn.h", "aeronomars/conc.h" and
    13791379   "aeronomars/chimiedata.h" to be fixed/free form compatible.
     1380
     1381== 09/02/12 == EM
     1382>> Updated the makegcm(s) so that default behaviour is to set LMDGCM env variable
     1383   to be the directory in which the makegcm script is. Updated the makegcm_*
     1384   to use "SOURCE" to identify main program to compile
     1385>> Adapted "create_make_gcm" script so that it can compile a main program that
     1386   is either something.F or something.F90. Also added that object files are
     1387   removed from archive before compiling a new version.
  • trunk/LMDZ.MARS/create_make_gcm

    r38 r519  
    109109echo '  cd $(LIBO) ; $(RANLIB) lib*.a ; cd $(GCM) ;\'
    110110echo '  cd $(LOCAL_DIR); \'
    111 echo '  $(COMPILE90) $(LIBF)/$(DIRMAIN)/$(PROG).F -o $(PROG).o ; \'
     111echo '  $(COMPILE90) $(LIBF)/$(DIRMAIN)/$(SOURCE) -o $(PROG).o ; \'
    112112if [ "$CRAY" = '0' ] ; then
    113113echo '  $(LINK) $(PROG).o -L$(LIBO) $(L_DYN) $(L_ADJNT) $(L_FILTRE) $(L_AERONOMARS) $(L_PHY) $(L_BIBIO) $(L_DYN) $(L_AERONOMARS) $(OPLINK) $(OPTION_LINK) -o $(LOCAL_DIR)/$(PROG).e ; $(RM) $(PROG).o '
     
    219219         done
    220220         echo $str1
     221         # Compile in LOCAL_DIR directory, and before compiling,
     222         # remove the object from the library
     223         echo ' cd $(LOCAL_DIR); \'
     224         echo ' $(AR) d $(LIBO)/lib'$diri'.a '$fili'.o ; \'
    221225         if [ "$F90" -eq '0' ] ; then
    222            echo '       cd $(LOCAL_DIR); \'
     226         ## Fixed Form Fortran 77
    223227           echo '       $(COMPILE) $(LIBF)/'$diri'/'$trufile' ; \'
    224228         else
     229         ## Fortran 90
    225230           echo '       cd $(LOCAL_DIR); \'
    226231           if [ -f $fili.F90 ] ; then
    227               echo '    $(COMPTRU90) $(LIBF)/'$diri'/'$trufile' ; \'
     232           ## Free Form Fortran 90
     233              echo '    $(COMPTRU90) $(LIBF)/'$diri'/'$trufile' ; \'
    228234           else
    229               echo '    $(COMPILE90) $(LIBF)/'$diri'/'$trufile' ; \'
     235           ## Fixed Form Fortran 90
     236              echo '    $(COMPILE90) $(LIBF)/'$diri'/'$trufile' ; \'
    230237           fi
     238           ## If a module, handle created module descriptor file
    231239           MODU=0; egrep -i '^ *module ' $trufile> /dev/null 2>&1 && MODU=1
    232240            if [ "$MODU" -eq '1' -a "$CRAY" != '1' ] ; then
     
    242250           echo '       sxar r $(LIBO)/libsx'$diri'.a '$fili'.o ; \'
    243251         fi
     252         # Put generated object in library
    244253         echo ' $(AR) r $(LIBO)/lib'$diri'.a '$fili'.o ; $(RM) '$fili'.o ; \'
    245254         echo ' cd $(GCM)'
  • trunk/LMDZ.MARS/makegcm

    r148 r519  
    2121####  relying on the C-shell environment variables)
    2222# default LMDGCM to where makegcm script is located:
    23 #setenv LMDGCM "`dirname $0`"
     23set scriptdir=`dirname $0`
     24setenv LMDGCM `readlink -f $scriptdir`
    2425# You may set LIBOGCM to something else; otherwise we default to:
    25 #setenv LIBOGCM $LMDGCM/libo
     26setenv LIBOGCM $LMDGCM/libo
    2627## NetCDF Libraries: what follows is OK for LMD 32 and 64bit Linux Machines
    2728#if ( `uname -m` == "x86_64" ) then
    2829## 64 bit machines
    29 #  setenv NCDFLIB /donnees/emlmd/netcdf64-4.0.1_pgi/lib
    30 #  setenv NCDFINC /donnees/emlmd/netcdf64-4.0.1_pgi/include
     30  setenv NCDFLIB /donnees/emlmd/netcdf64-4.0.1_pgi/lib
     31  setenv NCDFINC /donnees/emlmd/netcdf64-4.0.1_pgi/include
    3132#else
    3233#  setenv NCDFLIB /donnees/emlmd/netcdf-4.0.1_pgi/lib
     
    735736cd $localdir
    736737
     738## locate main program (could be in dyn3d or phy$physique
     739##                      and could be .F or .F90)
     740set source_code=${code}.F
     741if ( -f $LMDGCM/libf/dyn3d/${code}.F90 ) then
     742  set source_code=${code}.F90
     743endif
     744if ( -f $LMDGCM/libf/phy${physique}/${code}.F ) then
     745  set source_code=${code}.F
     746endif
     747if ( -f $LMDGCM/libf/phy${physique}/${code}.F90 ) then
     748  set source_code=${code}.F90
     749endif
     750
     751## locate directory where main program is located
     752if ( $dimension == 3 ) then
     753  if ( -f $LMDGCM/libf/dyn3d/${source_code} ) then
     754    set dyn="DIRMAIN=dyn3d "
     755  endif
     756  if ( -f $LMDGCM/libf/phy${physique}/${source_code} ) then
     757    set dyn="DIRMAIN=phy${physique} "
     758  endif
     759endif
     760
    737761echo $make -f $LMDGCM/makefile \
    738762OPTION_DEP="$opt_dep" OPTION_LINK="$opt_link" \
     
    757781MOD_SUFFIX=$mod_suffix \
    758782AR=$ar \
     783SOURCE=$source_code \
    759784PROG=$code
    760785
     
    782807MOD_SUFFIX=$mod_suffix \
    783808AR=$ar \
     809SOURCE=$source_code \
    784810PROG=$code
    785811
  • trunk/LMDZ.MARS/makegcm_g95

    r148 r519  
    2121####  relying on the C-shell environment variables)
    2222# default LMDGCM to where makegcm script is located:
    23 #setenv LMDGCM "`dirname $0`"
     23set scriptdir=`dirname $0`
     24setenv LMDGCM `readlink -f $scriptdir`
    2425# You may set LIBOGCM to something else; otherwise we default to:
    25 #setenv LIBOGCM $LMDGCM/libo
     26setenv LIBOGCM $LMDGCM/libo
    2627## NetCDF Libraries: what follows is OK for LMD 32 and 64bit Linux Machines
    2728#if ( `uname -m` == "x86_64" ) then
    2829## 64 bit machines
    29 #  setenv NCDFLIB /donnees/emlmd/netcdf64-4.0.1_g95/lib
    30 #  setenv NCDFINC /donnees/emlmd/netcdf64-4.0.1_g95/include
     30  setenv NCDFLIB /donnees/emlmd/netcdf64-4.0.1_g95/lib
     31  setenv NCDFINC /donnees/emlmd/netcdf64-4.0.1_g95/include
    3132#else
    3233#  setenv NCDFLIB /donnees/emlmd/netcdf-4.0.1_g95/lib
     
    736737cd $localdir
    737738
     739## locate main program (could be in dyn3d or phy$physique
     740##                      and could be .F or .F90)
     741set source_code=${code}.F
     742if ( -f $LMDGCM/libf/dyn3d/${code}.F90 ) then
     743  set source_code=${code}.F90
     744endif
     745if ( -f $LMDGCM/libf/phy${physique}/${code}.F ) then
     746  set source_code=${code}.F
     747endif
     748if ( -f $LMDGCM/libf/phy${physique}/${code}.F90 ) then
     749  set source_code=${code}.F90
     750endif
     751
     752## locate directory where main program is located
     753if ( $dimension == 3 ) then
     754  if ( -f $LMDGCM/libf/dyn3d/${source_code} ) then
     755    set dyn="DIRMAIN=dyn3d "
     756  endif
     757  if ( -f $LMDGCM/libf/phy${physique}/${source_code} ) then
     758    set dyn="DIRMAIN=phy${physique} "
     759  endif
     760endif
     761
    738762echo $make -f $LMDGCM/makefile \
    739763OPTION_DEP="$opt_dep" OPTION_LINK="$opt_link" \
     
    758782MOD_SUFFIX=$mod_suffix \
    759783AR=$ar \
     784SOURCE=$source_code \
    760785PROG=$code
    761786
     
    783808MOD_SUFFIX=$mod_suffix \
    784809AR=$ar \
     810SOURCE=$source_code \
    785811PROG=$code
    786812
  • trunk/LMDZ.MARS/makegcm_gfortran

    r148 r519  
    2121####  relying on the C-shell environment variables)
    2222# default LMDGCM to where makegcm script is located:
    23 #setenv LMDGCM "`dirname $0`"
     23set scriptdir=`dirname $0`
     24setenv LMDGCM `readlink -f $scriptdir`
    2425# You may set LIBOGCM to something else; otherwise we default to:
    25 #setenv LIBOGCM $LMDGCM/libo
     26setenv LIBOGCM $LMDGCM/libo
    2627## NetCDF Libraries: what follows is OK for LMD 32 and 64bit Linux Machines
    2728#if ( `uname -m` == "x86_64" ) then
    2829# 64 bit machines
    29 #  setenv NCDFLIB /donnees/emlmd/netcdf64-4.0.1_gfortran/lib
    30 #  setenv NCDFINC /donnees/emlmd/netcdf64-4.0.1_gfortran/include
     30  setenv NCDFLIB /donnees/emlmd/netcdf64-4.0.1_gfortran/lib
     31  setenv NCDFINC /donnees/emlmd/netcdf64-4.0.1_gfortran/include
    3132#else
    3233#  setenv NCDFLIB /donnees/emlmd/netcdf-4.0.1_gfortran/lib
     
    734735cd $localdir
    735736
     737## locate main program (could be in dyn3d or phy$physique
     738##                      and could be .F or .F90)
     739set source_code=${code}.F
     740if ( -f $LMDGCM/libf/dyn3d/${code}.F90 ) then
     741  set source_code=${code}.F90
     742endif
     743if ( -f $LMDGCM/libf/phy${physique}/${code}.F ) then
     744  set source_code=${code}.F
     745endif
     746if ( -f $LMDGCM/libf/phy${physique}/${code}.F90 ) then
     747  set source_code=${code}.F90
     748endif
     749
     750## locate directory where main program is located
     751if ( $dimension == 3 ) then
     752  if ( -f $LMDGCM/libf/dyn3d/${source_code} ) then
     753    set dyn="DIRMAIN=dyn3d "
     754  endif
     755  if ( -f $LMDGCM/libf/phy${physique}/${source_code} ) then
     756    set dyn="DIRMAIN=phy${physique} "
     757  endif
     758endif
     759
    736760echo $make -f $LMDGCM/makefile \
    737761OPTION_DEP="$opt_dep" OPTION_LINK="$opt_link" \
     
    756780MOD_SUFFIX=$mod_suffix \
    757781AR=$ar \
     782SOURCE=$source_code \
    758783PROG=$code
    759784
     
    781806MOD_SUFFIX=$mod_suffix \
    782807AR=$ar \
     808SOURCE=$source_code \
    783809PROG=$code
    784810
  • trunk/LMDZ.MARS/makegcm_ifort

    r352 r519  
    2121####  relying on the C-shell environment variables)
    2222# default LMDGCM to where makegcm script is located:
    23 #setenv LMDGCM "`dirname $0`"
     23set scriptdir=`dirname $0`
     24setenv LMDGCM `readlink -f $scriptdir`
    2425# You may set LIBOGCM to something else; otherwise we default to:
    2526setenv LIBOGCM $LMDGCM/libo
     
    740741cd $localdir
    741742
     743## locate main program (could be in dyn3d or phy$physique
     744##                      and could be .F or .F90)
     745set source_code=${code}.F
     746if ( -f $LMDGCM/libf/dyn3d/${code}.F90 ) then
     747  set source_code=${code}.F90
     748endif
     749if ( -f $LMDGCM/libf/phy${physique}/${code}.F ) then
     750  set source_code=${code}.F
     751endif
     752if ( -f $LMDGCM/libf/phy${physique}/${code}.F90 ) then
     753  set source_code=${code}.F90
     754endif
     755
     756## locate directory where main program is located
     757if ( $dimension == 3 ) then
     758  if ( -f $LMDGCM/libf/dyn3d/${source_code} ) then
     759    set dyn="DIRMAIN=dyn3d "
     760  endif
     761  if ( -f $LMDGCM/libf/phy${physique}/${source_code} ) then
     762    set dyn="DIRMAIN=phy${physique} "
     763  endif
     764endif
     765
    742766echo $make -f $LMDGCM/makefile \
    743767OPTION_DEP="$opt_dep" OPTION_LINK="$opt_link" \
     
    762786MOD_SUFFIX=$mod_suffix \
    763787AR=$ar \
     788SOURCE=$source_code \
    764789PROG=$code
    765790
     
    787812MOD_SUFFIX=$mod_suffix \
    788813AR=$ar \
     814SOURCE=$source_code \
    789815PROG=$code
    790816
Note: See TracChangeset for help on using the changeset viewer.