Changeset 2250 for LMDZ5


Ignore:
Timestamp:
Mar 26, 2015, 4:28:42 PM (9 years ago)
Author:
Ehouarn Millour
Message:

Improving the makelmdz* utilities:
Directory phy* in dynlonlat_phylonlat is assumed to be the same "root" as provided by the name of the physics package (e.g. "phylmd" for "phylmd_bis" or "phylmdmine" or "phylmd.2", etc.) to ease things for those who work with multiple copies of a physics directory.
FH

Location:
LMDZ5/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • LMDZ5/trunk/makelmdz

    r2242 r2250  
    284284for inc in $archfileline ; do INCLUDE="$INCLUDE `echo $inc | grep '\-I'`" ; done
    285285
     286phys_root=$physique
     287if [[ "${physique:0:3}" == "lmd" ]] ; then phys_root=lmd ; fi
     288if [[ "${physique:0:4}" == "mars" ]] ; then phys_root=mars ; fi
     289if [[ "${physique:0:3}" == "std" ]] ; then phys_root=std ; fi
     290if [[ "${physique:0:5}" == "venus" ]] ; then phys_root=venus ; fi
     291if [[ "${physique:0:5}" == "titan" ]] ; then phys_root=titan ; fi
     292if [[ "${physique:0:3}" == "mar" ]] ; then phys_root=mar ; fi
     293if [[ "${physique:0:3}" == "dev" ]] ; then phys_root=dev ; fi
     294
    286295if [[ "$physique" != "nophys" ]]
    287296then
     
    291300   lib_phy='-lphy'"$physique"
    292301   CPP_KEY="$CPP_KEY CPP_PHYS"
    293    if [[ "${physique:0:3}" == "lmd" ]]
    294    then
    295    #For lmd physics, default planet type is Earth
    296    CPP_KEY="$CPP_KEY CPP_EARTH"
     302   if [[ $phys_root == "lmd" ]]
     303      then
     304      #For lmd physics, default planet type is Earth
     305      CPP_KEY="$CPP_KEY CPP_EARTH"
    297306   fi
    298307fi
     
    501510   src_dirs="$src_dirs $filtre dyn3d_common dyn3d${FLAG_PARA}"
    502511   if [[ $physique != "nophys" ]] ; then
    503      src_dirs="$src_dirs dynlonlat_phylonlat dynlonlat_phylonlat/phy${physique}"
     512     src_dirs="$src_dirs dynlonlat_phylonlat dynlonlat_phylonlat/phy${phys_root}"
    504513     libdyn_phy="-ldynlonlat_phylonlat"
    505514     LIBDYN_PHYS='$(LIBO)/libdynlonlat_phylonlat.a'
    506515     INCLUDE="$INCLUDE "'-I$(LIBF)/dynlonlat_phylonlat'
    507      INCLUDE="$INCLUDE "'-I$(LIBF)/dynlonlat_phylonlat_'"${physique}"
     516     INCLUDE="$INCLUDE "'-I$(LIBF)/dynlonlat_phylonlat/'"phy${phys_root}"
    508517   fi
    509518   cd $LIBFGCM/grid
     
    561570cd $LMDGCM
    562571
    563 find libf -name '*.[Fh]' -print | sort > tmp77
    564 #find libf -name '*.[Fh]' -exec egrep -i " *use *ioipsl" {} \; -print > tmp90
    565 find libf -name '*.F90' -print | sort > tmp90
    566572
    567573if [[ -r .makelmdz ]]
     
    579585fi
    580586
    581 if [[ $configuration_change == "true" || ! ( -r makefile ) || ! ( -r liste_des_sources_f90 ) || ! ( -r liste_des_sources_f77 ) || ` diff tmp77 liste_des_sources_f77 | wc -w ` -ne 0 || ` diff tmp90 liste_des_sources_f90 | wc -w ` -ne 0 ]]
     587mkdir -p make_dir
     588suf_make=`echo $src_dirs | sed -e 's/\//_/g' -e 's/ /_/g'`
     589echo suf_make $suf_make
     590
     591\rm tmp77 tmp90
     592for dir in $src_dirs ; do
     593find libf/$dir -name '*.[Fh]' -print | sort >> tmp77
     594find libf/$dir -name '*.F90' -print | sort >> tmp90
     595done
     596
     597liste77=make_dir/liste_des_sources_f77_$suf_make
     598liste90=make_dir/liste_des_sources_f90_$suf_make
     599makefile=make_dir/makefile_$suf_make
     600
     601if [[ $configuration_change == "true" || ! ( -r $makefile ) || ! ( -r $liste_90 ) || ! ( -r $liste_77 ) || ` diff tmp77 $liste_77 | wc -w ` -ne 0 || ` diff tmp90 $liste_90 | wc -w ` -ne 0 ]]
    582602then
    583603  echo "les fichiers suivants ont ete crees ou detruits"
    584604  echo "ou les fichiers suivants sont passes ou ne sont plus en Fortran 90"
    585   diff liste_des_sources_f77 tmp77
    586   diff liste_des_sources_f90 tmp90
    587   \cp -f tmp77 liste_des_sources_f77
    588   \cp -f tmp90 liste_des_sources_f90
     605  diff $liste77 tmp77
     606  diff $liste90 tmp90
     607  \cp -f tmp77 $liste77
     608  \cp -f tmp90 $liste90
    589609  echo "Recreating the makefile"
    590610  echo "src_dirs: $src_dirs"
    591611  ./create_make_gcm $src_dirs > tmp
    592   \mv -f tmp makefile
     612  \mv -f tmp $makefile
    593613  echo "New makefile created"
    594614fi
     615
     616ln -sf $makefile makefile
    595617
    596618#Create a .makelmdz file containing main compilation option for later comparisons
     
    609631  dirmain=phy$physique
    610632  source_code=${code}.F90
    611 elif [[ -r $LMDGCM/libf/dynlonlat_phylonlat/phy$physique/${code}.F90 ]] ; then
    612   dirmain="dynlonlat_phylonlat/phy${physique}"
     633elif [[ -r $LMDGCM/libf/dynlonlat_phylonlat/phy$phys_root/${code}.F90 ]] ; then
     634  dirmain="dynlonlat_phylonlat/phy${phys_root}"
    613635  source_code=${code}.F90
    614636elif [[ -r $LMDGCM/libf/phy$physique/dyn1d/${code}.F90 ]] ; then
  • LMDZ5/trunk/makelmdz_fcm

    r2242 r2250  
    226226fi
    227227
     228phys_root=$physique
     229if [[ "${physique:0:3}" == "lmd" ]] ; then phys_root=lmd ; fi
     230if [[ "${physique:0:4}" == "mars" ]] ; then phys_root=mars ; fi
     231if [[ "${physique:0:3}" == "std" ]] ; then phys_root=std ; fi
     232if [[ "${physique:0:5}" == "venus" ]] ; then phys_root=venus ; fi
     233if [[ "${physique:0:5}" == "titan" ]] ; then phys_root=titan ; fi
     234if [[ "${physique:0:3}" == "mar" ]] ; then phys_root=mar ; fi
     235if [[ "${physique:0:3}" == "dev" ]] ; then phys_root=dev ; fi
     236
    228237if [[ "$physique" != "nophys" ]]
    229238then
    230239   #We'll use some physics
    231240   CPP_KEY="$CPP_KEY CPP_PHYS"
    232    if [[ "${physique:0:3}" == "lmd" ]]
     241   if [[ "${phys_root}" == "lmd" ]]
    233242   then
    234243   #For lmd physics, default planet type is Earth
     
    237246   # set the dyn/phys interface path
    238247   DYN_PHYS_PATH="${LIBFGCM}/dynlonlat_phylonlat"
    239    DYN_PHYS_SUB_PATH="${LIBFGCM}/dynlonlat_phylonlat/phy${physique}"
     248   DYN_PHYS_SUB_PATH="${LIBFGCM}/dynlonlat_phylonlat/phy${phys_root}"
    240249fi
    241250
Note: See TracChangeset for help on using the changeset viewer.