Ignore:
Timestamp:
Jul 1, 2025, 11:53:15 AM (9 months ago)
Author:
lguez
Message:

First proposal

File:
1 edited

Legend:

Unmodified
Added
Removed
  • LMDZ6/branches/LMDZ_compilation/makelmdz_fcm

    r5726 r5731  
    131131[-arch_path path]          : path to architecture files (default: $arch_default_path)
    132132[-force_compile]           : recompile although there seems to be an on-going compilation
     133[-dir]                     : build directory (default: libo in current directory)
     134[-config]                  : config name (default: automatic creation of name based on other options of makelmdz_fcm)
    133135 -arch nom_arch            : target architecture
    134136 exec                      : executable to build
     
    139141          dim=$2 ; shift ; shift ;;
    140142     
     143      "-dir")
     144          LIBOGCM=$2 ; shift ; shift ;;
     145
     146      "-config")
     147          config_name=$2 ; shift ; shift ;;
     148
    141149      "-p")
    142150          physique="$2" ;  shift ; shift ;;
     
    493501fi
    494502
    495 INCLUDE="$INCLUDE ${NETCDF95_INCDIR}"
    496 LIB="$LIB ${NETCDF95_LIBDIR} ${NETCDF95_LIB}"
    497 
    498503if [[ $io == ioipsl ]]
    499504then
     
    734739rm -f $config_fcm
    735740touch $config_fcm
    736 if [ ! X"${code}${SUFF_NAME}" == X ] ; then
    737   rm -f bin/${code}${SUFF_NAME}
    738 fi
    739 rm -f bin/${code}.e
    740741rm -f arch.fcm
    741742rm -f arch.opt
     743config_name=${config_name:-$arch$SUFF_NAME}
     744
     745if [[ -f $LIBOGCM/$config_name/config_description.txt ]]
     746then
     747    read <$LIBOGCM/$config_name/config_description.txt
     748
     749    if [[ $REPLY != $SUFF_NAME ]]
     750    then
     751        echo "Configuration directory was created for other options"
     752        rm -f $LIBFGCM/grid/dimensions_mod.f90
     753        exit 1
     754    fi
     755fi
    742756
    743757echo "%ARCH          $arch"          >> $config_fcm
     758echo "%CONFIG_NAME   $config_name"   >> $config_fcm
    744759echo "%INCDIR        $INCLUDE"       >> $config_fcm
    745760echo "%LIB           $LIB"           >> $config_fcm
     
    762777echo "%CPP_KEY       $CPP_KEY"       >> $config_fcm
    763778echo "%EXEC          $code"          >> $config_fcm
    764 echo "%SUFF_NAME     $SUFF_NAME"     >> $config_fcm
    765779echo "%COMPIL_FFLAGS $COMPIL_FFLAGS" >> $config_fcm
    766780echo "%PARA_FFLAGS   $PARA_FFLAGS"   >> $config_fcm
     
    785799set +e
    786800
    787 rm -f $LIBOGCM/${arch}${SUFF_NAME}/.config/fcm.bld.lock
     801rm -f $LIBOGCM/${config_name}/.config/fcm.bld.lock
    788802./build_gcm ${fcm_path} -j $job $full
    789803build_status=$?
    790804
    791 rm -rf tmp_src
    792 rm -rf config
    793 ln -s $LIBOGCM/${arch}${SUFF_NAME}/.config config
    794 ln -s $LIBOGCM/${arch}${SUFF_NAME}/.config/ppsrc tmp_src
    795 
    796805if [[ -r $LIBFGCM/grid/dimensions_mod.f90 ]]
    797806then
     
    800809fi
    801810
    802 # build netcdf95 library necessary for the makelmdz script
    803 if [[ $build_status = 0 ]]
    804 then
    805   cp bin/${code}${SUFF_NAME} bin/${code}.e
    806   if [[ ! -d tools/netcdf95/include ]]
    807   then
    808       mkdir tools/netcdf95/include tools/netcdf95/lib
    809       cp config/inc/netcdf95.mod config/inc/nf95_*mod tools/netcdf95/include
    810       cp config/obj/netcdf95.o config/obj/nf95_*o config/obj/check_start_count_m.o tools/netcdf95/lib
    811       cd tools/netcdf95/lib; ar rv libnetcdf95.a *.o; ranlib libnetcdf95.a
    812       cd -
    813     fi
     811if [[ ! -f $LIBOGCM/$config_name/config_description.txt ]]
     812then
     813    echo $SUFF_NAME >$LIBOGCM/$config_name/config_description.txt
    814814fi
    815815
Note: See TracChangeset for help on using the changeset viewer.