Changeset 4921 for CONFIG/UNIFORM/v7/ICOLMDZOR_v7/compile_icolmdzor.sh
- Timestamp:
- 02/10/20 15:10:20 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
CONFIG/UNIFORM/v7/ICOLMDZOR_v7/compile_icolmdzor.sh
r4663 r4921 18 18 optmode=prod 19 19 # Resolution if compiling LMDZ in regular mode without DYNAMICO 20 # Use for example following "./compile_icolmdzor.sh -regular_l onlat144x142x79"20 # Use for example following "./compile_icolmdzor.sh -regular_latlon 144x142x79" 21 21 regular_latlon=no 22 22 # fcm_arch … … 26 26 export fcm_arch parallel xios 27 27 full_flag="" 28 full_xios="" 29 full_lmdz="" 30 full_orch="" 31 full_dyna="" 32 28 33 # Default netcdf_lib is used for XIOS but can be change by argument 29 34 netcdf_lib="" … … 32 37 datestr=`LC_ALL=C date +"%Y%m%dT%H%M"` 33 38 outfile=$submitdir/out_compile_icolmdzor.$datestr 34 rm -f $outfile;echo > $outfile39 echo > $outfile 35 40 echo; echo "Text output from compilation will be stored in file out_compile_icolmdzor.$datestr"; echo 36 41 … … 39 44 while (($# > 0)) ; do 40 45 case $1 in 41 "-h") cat << fin46 "-h") cat <<end_help 42 47 43 48 ######################################################################## … … 63 68 ./compile_icolmdzor.sh -regular_latlon 144x142x79 64 69 65 fin 70 end_help 66 71 exit;; 67 72 68 "-parallel") 69 parallel=$2 ; shift ; shift ;; 70 71 "-arch") 72 fcm_arch="$2" ; shift ; shift ;; 73 74 "-xios") 75 xios="$2" ; shift ; shift ;; 76 77 "-optmode") 78 optmode=$2 ; shift ; shift ;; 79 80 "-debug") 81 optmode=debug ; shift ;; 82 83 "-dev") 84 optmode=dev ; shift ;; 85 86 "-prod") 87 optmode=prod ; shift ;; 88 89 "-regular_latlon") 90 regular_latlon=yes ; 91 resol_atm_3d=$2 ; shift ; shift ;; 92 93 "-full") 94 full_flag="-full"; shift ;; 95 96 "-netcdf_lib_seq") 97 netcdf_lib="--netcdf_lib netcdf4_seq"; shift ;; 98 99 *) 100 echo "unknown option "$2" , exiting..." 101 exit 73 "-parallel") parallel=$2 ; shift ; shift ;; 74 "-arch") fcm_arch="$2" ; shift ; shift ;; 75 "-xios") xios="$2" ; shift ; shift ;; 76 "-debug") optmode=debug ; shift ;; 77 "-dev") optmode=dev ; shift ;; 78 "-prod") optmode=prod ; shift ;; 79 "-regular_latlon") regular_latlon=yes ; resol_atm=$2 ; shift ; shift ;; 80 "-full") full_flag="-full"; full_xios="--full" ; full_lmdz="-full" ; full_orch="-full" ; full_dyna="-full" ; shift ;; 81 "-full_xios") full_xios="--full" ; shift ;; # Note only full_xios is using double dash: --full 82 "-full_lmdz") full_lmdz="-full" ; shift ;; 83 "-full_orch") full_orch="-full" ; shift ;; 84 "-full_dyna") full_dyna="-full" ; shift ;; 85 "-netcdf_lib_seq") netcdf_lib="--netcdf_lib netcdf4_seq"; shift ;; 86 *) echo "unknown option "$1" , exiting..." ; exit 102 87 esac 103 88 done 104 89 105 echo "Following arguments are set in current compiling:" >> $outfile 106 echo " optmode = $optmode, parallel = $parallel, fcm_arch = $fcm_arch, full_flag=$full_flag regular_latlon=$regular_latlon" >> $outfile 90 echo "Following options are set in current compiling:" >> $outfile 91 echo " regular_latlon=$regular_latlon (if yes, then resol_atm=${resol_atm})" >> $outfile 92 echo " optmode = $optmode, parallel = $parallel, fcm_arch = $fcm_arch " >> $outfile 93 echo " full_flag=$full_flag, full_xios=$full_xios, full_lmdz=$full_lmdz, full_orch=$full_orch, full_dyna=$full_dyna" >> $outfile 107 94 echo >> $outfile 108 95 … … 115 102 # Find out current host and source specific paths and commands for the host 116 103 case $( hostname -s ) in 117 ada*)118 fcm_arch=X64_ ADA;;104 jean-zay*) 105 fcm_arch=X64_JEANZAY;; 119 106 irene*) 120 107 fcm_arch=X64_IRENE;; … … 130 117 fi 131 118 132 # Set a link to arch.env and source the fileif arch-${fcm_arch}.env file exist for current fcm_arch.119 # Set a link to arch.env if arch-${fcm_arch}.env file exist for current fcm_arch. 133 120 # The link arch.env is also set in config.card and will be used by libIGCM to ensure the same running environnement. 134 121 if [ -f ARCH/arch-${fcm_arch}.env ] ; then 135 122 echo >> $outfile 136 echo "The file ARCH/arch-${fcm_arch}.env will now be sourced with modules needed for compilation ."137 echo "Note that this new environement willbe kept after compilation."138 echo " You might want to source again your personal environment after compilation. This must be done manually or by reconnection."123 echo "The file ARCH/arch-${fcm_arch}.env will now be sourced with modules needed for compilation for all components." 124 echo "Note that this new environement might be kept after compilation." 125 echo "If this is the case, source again your personal environment after compilation." 139 126 echo " Personal module list before sourcing of ARCH/arch.env file:" >> $outfile 140 127 module list >> $outfile 2>&1 141 128 129 # Make a link to this file, to be used also in config.card 142 130 rm -f ARCH/arch.env 143 131 ln -s arch-${fcm_arch}.env ARCH/arch.env 132 133 # Source the file 144 134 source ARCH/arch.env >> $outfile 2>&1 145 135 … … 167 157 echo; echo "NOW COMPILE XIOS" 168 158 echo >> $outfile ; echo " NOW COMPILE XIOS" >> $outfile 169 echo ./make_xios --$optmode --arch $fcm_arch --arch_path $arch_path ${netcdf_lib} --job 4 $full_ flag>> $outfile170 ./make_xios --$optmode --arch $fcm_arch --arch_path $arch_path ${netcdf_lib} --job 4 $full_ flag>> $outfile 2>&1159 echo ./make_xios --$optmode --arch $fcm_arch --arch_path $arch_path ${netcdf_lib} --job 4 $full_xios >> $outfile 160 ./make_xios --$optmode --arch $fcm_arch --arch_path $arch_path ${netcdf_lib} --job 4 $full_xios >> $outfile 2>&1 171 161 # Test if compiling succeded 172 162 if [[ $? != 0 ]] ; then … … 175 165 fi 176 166 # Move executables to modipsl/bin 177 if [ $modipsl/modeles/XIOS/bin/xios_server.exe ] ; then178 mv $modipsl/modeles/XIOS/bin/xios_server.exe $modipsl/bin/ .167 if [ -f $modipsl/modeles/XIOS/bin/xios_server.exe ] ; then 168 mv $modipsl/modeles/XIOS/bin/xios_server.exe $modipsl/bin/xios_server_${optmode}.exe 179 169 else 180 170 echo "THERE IS A PROBLEM IN XIOS COMPILATION EXECUTABLE MISSING - STOP" … … 188 178 echo >> $outfile ; echo " NOW COMPILE ORCHIDEE" >> $outfile 189 179 190 echo ./makeorchidee_fcm -j 8 -xios -parallel $parallel -$optmode -arch ${fcm_arch} $full_flag>> $outfile191 ./makeorchidee_fcm -j 8 -xios -parallel $parallel -$optmode -arch ${fcm_arch} $full_flag>> $outfile 2>&1180 echo ./makeorchidee_fcm -j 8 -xios -parallel $parallel -$optmode -arch ${fcm_arch} -arch_path $arch_path $full_orch >> $outfile 181 ./makeorchidee_fcm -j 8 -xios -parallel $parallel -$optmode -arch ${fcm_arch} -arch_path $arch_path $full_orch >> $outfile 2>&1 192 182 # Test if compiling finished 193 183 if [[ $? != 0 ]] ; then … … 195 185 exit 196 186 fi 187 188 # If orchide driver executables have been compiled (option -driver), then rename executables to contain $optmode 189 if [ -f $modipsl/bin/orchidee_ol ] ; then mv $modipsl/bin/orchidee_ol $modipsl/bin/orchidee_ol_${optmode} ; fi 190 if [ -f $modipsl/bin/orchideedriver ] ; then mv $modipsl/bin/orchideedriver $modipsl/bin/orchideedriver_${optmode} ; fi 191 197 192 198 193 ## 2.4 Compile lmdz … … 215 210 fi 216 211 217 echo ./makelmdz_fcm -p lmd -rrtm true -cosp true -$optmode -mem -parallel $parallel -libphy -v orchidee2.1 -io xios -arch $fcm_arch -j 8 $full_ flag>> $outfile218 ./makelmdz_fcm -p lmd -rrtm true -cosp true -$optmode -mem -parallel $parallel -libphy -v orchidee2.1 -io xios -arch $fcm_arch -j 8 $full_ flag>> $outfile 2>&1212 echo ./makelmdz_fcm -p lmd -rrtm true -cosp true -$optmode -mem -parallel $parallel -libphy -v orchidee2.1 -io xios -arch $fcm_arch -j 8 $full_lmdz >> $outfile 213 ./makelmdz_fcm -p lmd -rrtm true -cosp true -$optmode -mem -parallel $parallel -libphy -v orchidee2.1 -io xios -arch $fcm_arch -j 8 $full_lmdz >> $outfile 2>&1 219 214 # Test if compiling finished 220 215 if [[ $? != 0 ]] ; then … … 229 224 echo >> $outfile ; echo " NOW COMPILE DYNAMICO" >> $outfile 230 225 231 echo ./make_icosa -$optmode -parallel $parallel -external_ioipsl -with_xios -arch $fcm_arch -arch_path $arch_path -job 8 $full_ flag>> $outfile232 ./make_icosa -$optmode -parallel $parallel -external_ioipsl -with_xios -arch $fcm_arch -arch_path $arch_path -job 8 $full_ flag>> $outfile 2>&1226 echo ./make_icosa -$optmode -parallel $parallel -external_ioipsl -with_xios -arch $fcm_arch -arch_path $arch_path -job 8 $full_dyna >> $outfile 227 ./make_icosa -$optmode -parallel $parallel -external_ioipsl -with_xios -arch $fcm_arch -arch_path $arch_path -job 8 $full_dyna >> $outfile 2>&1 233 228 # Test if compiling finished 234 229 if [[ $? != 0 ]] ; then … … 242 237 echo >> $outfile ; echo " NOW COMPILE ICOSA_LMDZ" >> $outfile 243 238 244 echo ./make_icosa_lmdz -nodeps -p lmd -$optmode -parallel $parallel -with_orchidee -arch ${fcm_arch} -arch_path ${arch_path} -job 8 $full_ flag>> $outfile245 ./make_icosa_lmdz -nodeps -p lmd -$optmode -parallel $parallel -with_orchidee -arch ${fcm_arch} -arch_path ${arch_path} -job 8 $full_ flag>> $outfile 2>&1239 echo ./make_icosa_lmdz -nodeps -p lmd -$optmode -parallel $parallel -with_orchidee -arch ${fcm_arch} -arch_path ${arch_path} -job 8 $full_dyna >> $outfile 240 ./make_icosa_lmdz -nodeps -p lmd -$optmode -parallel $parallel -with_orchidee -arch ${fcm_arch} -arch_path ${arch_path} -job 8 $full_dyna >> $outfile 2>&1 246 241 # Test if compiling finished 247 242 if [[ $? != 0 ]] ; then … … 251 246 # Move executables to modipsl/bin 252 247 if [ $modipsl/modeles/ICOSA_LMDZ/bin/icosa_lmdz.exe ] ; then 253 mv $modipsl/modeles/ICOSA_LMDZ/bin/icosa_lmdz.exe $modipsl/bin/ .248 mv $modipsl/modeles/ICOSA_LMDZ/bin/icosa_lmdz.exe $modipsl/bin/icosa_lmdz_${optmode}.exe 254 249 else 255 250 echo "THERE IS A PROBLEM IN ICOSA_LMDZ COMPILATION EXECUTABLE MISSING - STOP" … … 264 259 cd $modipsl/modeles/LMDZ 265 260 # Compile LMDZ regular lat-lon exectuable 266 echo; echo "NOW COMPILE LMDZ REGULAR LAT-LON MODE. Resolution = ${resol_atm _3d}"267 echo >> $outfile ; echo " NOW COMPILE LMDZ REGULAR LAT-LON MODE. Resolution = ${resol_atm _3d}" >> $outfile261 echo; echo "NOW COMPILE LMDZ REGULAR LAT-LON MODE. Resolution = ${resol_atm}" 262 echo >> $outfile ; echo " NOW COMPILE LMDZ REGULAR LAT-LON MODE. Resolution = ${resol_atm}" >> $outfile 268 263 269 264 # Check if the compilation of LMDZ was previsouly interupted prematured. … … 279 274 rm -f .lock 280 275 fi 281 echo ./makelmdz_fcm -d ${resol_atm _3d} -p lmd -rrtm true -$optmode -mem -parallel $parallel -io xios -v orchidee2.1 -arch $fcm_arch -j 8 $full_flaggcm >> $outfile282 ./makelmdz_fcm -d ${resol_atm _3d} -p lmd -rrtm true -$optmode -mem -parallel $parallel -io xios -v orchidee2.1 -arch $fcm_arch -j 8 $full_flaggcm >> $outfile 2>&1276 echo ./makelmdz_fcm -d ${resol_atm} -p lmd -rrtm true -$optmode -mem -parallel $parallel -io xios -v orchidee2.1 -arch $fcm_arch -j 8 $full_lmdz gcm >> $outfile 277 ./makelmdz_fcm -d ${resol_atm} -p lmd -rrtm true -$optmode -mem -parallel $parallel -io xios -v orchidee2.1 -arch $fcm_arch -j 8 $full_lmdz gcm >> $outfile 2>&1 283 278 # Test if compiling finished 284 279 if [[ $? != 0 ]] ; then … … 288 283 289 284 # Compile ce0l initialization program for LMDZ regular lat-lon exectuable 290 echo; echo "NOW COMPILE CE0L OF LMDZ. Resolution = ${resol_atm _3d}"291 echo >> $outfile ; echo " NOW COMPILE CE0L OF LMDZ. Resolution = ${resol_atm _3d}" >> $outfile292 293 echo ./makelmdz_fcm -d ${resol_atm _3d} -p lmd -rrtm true -$optmode -mem -parallel $parallel -io xios -v orchidee2.1 -arch $fcm_arch -j 8 $full_flagce0l >> $outfile294 ./makelmdz_fcm -d ${resol_atm _3d} -p lmd -rrtm true -$optmode -mem -parallel $parallel -io xios -v orchidee2.1 -arch $fcm_arch -j 8 $full_flagce0l >> $outfile 2>&1285 echo; echo "NOW COMPILE CE0L OF LMDZ. Resolution = ${resol_atm}" 286 echo >> $outfile ; echo " NOW COMPILE CE0L OF LMDZ. Resolution = ${resol_atm}" >> $outfile 287 288 echo ./makelmdz_fcm -d ${resol_atm} -p lmd -rrtm true -$optmode -mem -parallel $parallel -io xios -v orchidee2.1 -arch $fcm_arch -j 8 $full_lmdz ce0l >> $outfile 289 ./makelmdz_fcm -d ${resol_atm} -p lmd -rrtm true -$optmode -mem -parallel $parallel -io xios -v orchidee2.1 -arch $fcm_arch -j 8 $full_lmdz ce0l >> $outfile 2>&1 295 290 # Test if compiling finished 296 291 if [[ $? != 0 ]] ; then … … 301 296 # Find executable suffix 302 297 if [ $parallel == seq ] || [ $parallel == none ] ; then 303 suffix=_${resol_atm _3d}_phylmd_seq_orch298 suffix=_${resol_atm}_phylmd_seq_orch.e 304 299 else 305 suffix=_${resol_atm _3d}_phylmd_para_mem_orch306 fi 307 echo suffix = $suffix300 suffix=_${resol_atm}_phylmd_para_mem_orch.e 301 fi 302 echo gcm suffix = $suffix 308 303 309 304 # Move executables to modipsl/bin folder 310 305 echo "Move gcm.e and ce0l executable to modipsl/bin" 311 if [ $modipsl/modeles/LMDZ/bin/gcm${suffix}.e ] ; then mv $modipsl/modeles/LMDZ/bin/gcm${suffix}.e $modipsl/bin/gcm_${resol_atm_3d}.e ; fi 312 if [ $modipsl/modeles/LMDZ/bin/ce0l${suffix}.e ] ; then mv $modipsl/modeles/LMDZ/bin/ce0l${suffix}.e $modipsl/bin/ce0l_${resol_atm_3d}.e ; fi 313 314 # Write .resol file 315 cd $submitdir 316 resol2D=$( echo ${resol_atm_3d} | awk '-Fx' '{print $1}' )$( echo ${resol_atm_3d} | awk '-Fx' '{print $2}' ) 317 echo "noORCAxLMD$resol2D" >.resol 318 echo "RESOL_ATM_3D=${resol_atm_3d}" >>.resol 306 if [ -f $modipsl/modeles/LMDZ/bin/gcm${suffix} ] ; then 307 mv $modipsl/modeles/LMDZ/bin/gcm${suffix} $modipsl/bin/gcm_${resol_atm}_${optmode}.e 308 else 309 echo "ERROR gcm${suffix} executable does not exist." 310 echo "THERE IS A PROBLEM IN LMDZ REGULAR LATLON COMPILATION - STOP" 311 exit 312 fi 313 314 if [ -f $modipsl/modeles/LMDZ/bin/ce0l${suffix} ] ; then 315 mv $modipsl/modeles/LMDZ/bin/ce0l${suffix} $modipsl/bin/ce0l_${resol_atm}_${optmode}.e 316 else 317 echo "ERROR ce0l${suffix} executable does not exist." 318 echo "THERE IS A PROBLEM IN LMDZ REGULAR LATLON COMPILATION - STOP" 319 exit 320 fi 319 321 fi 320 322
Note: See TracChangeset
for help on using the changeset viewer.