Changeset 4956 for BOL/LMDZ_Setup_amaury
- Timestamp:
- Jun 3, 2024, 1:06:29 PM (6 months ago)
- Location:
- BOL/LMDZ_Setup_amaury
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
BOL/LMDZ_Setup_amaury/interp_aerosols.sh
r4615 r4956 6 6 7 7 year=$1 8 echo Dans interp_aerosols.sh year= $year8 echo "Dans interp_aerosols.sh year= $year" 9 9 10 10 # Extraction d'un fichier de grille physique a partir de grilles_gcm.nc … … 12 12 13 13 \rm -rf tmp*nc 14 if [ 0 = 0 ]; then15 imp1=`ncdump -h grilles_gcm.nc | grep lonv | head -1 | awk ' { print $3 } '` 16 echo $imp1 17 (( imm1 = $imp1 - 2 ))18 echo $imm1 19 ncks -d lonv,0,$imm1grilles_gcm.nc -v phis -O grille_phys.nc20 ncrename -v lonv,lon -v latu,lat -d lonv,lon -d latu,lat -O grille_phys.nc21 ncap2 -s "lon=-360.+lon" grille_phys.nc -O tmp.nc22 \mv -f tmp.nc grille_phys.nc23 #exit 14 if [[ 0 = 0 ]]; then 15 imp1=$(ncdump -h grilles_gcm.nc | grep lonv | head -1 | awk ' { print $3 } ') 16 echo "$imp1" 17 (( imm1 = imp1 - 2 )) 18 echo "$imm1" 19 ncks -d "lonv,0,$imm1" grilles_gcm.nc -v phis -O grille_phys.nc 20 ncrename -v lonv,lon -v latu,lat -d lonv,lon -d latu,lat -O grille_phys.nc 21 ncap2 -s "lon=-360.+lon" grille_phys.nc -O tmp.nc 22 \mv -f tmp.nc grille_phys.nc 23 #exit 1 24 24 fi 25 25 … … 28 28 29 29 orig=aerosols${year}_from_inca.nc 30 ln -s $LMDZ_Init/$orig30 ln -s "$LMDZ_INIT/$orig" . 31 31 32 32 … … 35 35 36 36 # Un cdo direct ne marche pas. Il faut donner la liste des variables ... 37 vars="" ; for var in `ncdump -h $orig | grep float | sed -e 's/^.*.float //' | cut -d'(' -f1 | sed -e 's/ ;//' -e /lat/d -e /lon/d` ; do vars="$vars,$var" ; done 37 vars="" 38 for var in $(ncdump -h "$orig" | grep float | sed -e 's/^.*.float //' | cut -d'(' -f1 | sed -e 's/;//' -e /lat/d -e /lon/d); do 39 vars="$vars,$var" 40 done 38 41 39 echo cdo remapcon,grille_phys.nc -selvar$vars $origtmp.nc40 cdo remapcon,grille_phys.nc -selvar$vars $origtmp.nc42 echo cdo remapcon,grille_phys.nc "-selvar$vars" "$orig" tmp.nc 43 cdo remapcon,grille_phys.nc "-selvar$vars" "$orig" tmp.nc 41 44 #ncks -v ps,ap,b,presnivs $orig -A tmp.nc 42 nccopy -k classic tmp.nc aerosols.${year}.nc45 nccopy -k classic tmp.nc "aerosols.$year.nc" -
BOL/LMDZ_Setup_amaury/lmdz_env.sh
r4955 r4956 35 35 # * On peut aussi ne pas installer les scripts a la racine de STORE, 36 36 # mais dans STORED=$STORE/your_folder 37 SIMRESDIR=$STORE 38 SIMRUNTOPDIR="$SCRATCH/LMDZ_Setup" 37 SIMRUNBASEDIR="$SCRATCH/LMDZ_Setup" 39 38 LMDZD=$WORK 40 39 NB_MPI_MAX=2000 … … 47 46 48 47 ;; 49 *) # TODO mettre clairement dans ce paragraphe une doc de chaque param 48 *) echo "WARNING: RUNNING THIS SCRIPT ON A LOCAL COMPUTER IS DISCOURAGED (lacklusted cpus and memory)" 49 local_env_dir="/home/abarral/PycharmProjects/installLMDZ/LMDZ_Setup"; if [[ ! -d $local_env_dir ]]; then echo "STOP: local_env_dir $local_env_dir not found, either you are running on an unsupported cluster, or you haven't edited lmdz_env.sh properly"; exit 1; fi # Can't use $(pwd) since this script gets copied and ran from several locations 50 50 ARCH="local-gfortran-parallel" 51 # submit=". " 52 # run="mpirun -np " 53 SIMRUNTOPDIR="/tmp/SCRATCH/LMDZ_Setup/" # Where the simulations will be executed # TODO Change name if it's actually the SIMRUNDIR 54 SIMRESDIR=~"/TMP/LMDZ_Setup" # Where to store the relevant outputs of the simulations 55 LMDZD="$(pwd)/LMDZD" # Where the sources will be downloaded and compiled 56 LMDZ_INIT="$(pwd)/LMDZ_Init" # Where to store shared files used for initialisation 57 NB_MPI_MAX=999999 # Max number of MPI cores 58 NB_OMP_MAX=999999 # Max number of OMP threads 51 SIMRUNBASEDIR="/tmp/SCRATCH/" # Where the simulations will be executed ($SIMRUNBASEDIR/LMDZ_Setup/...) 52 LMDZD="$local_env_dir/LMDZD" # Where the sources will be downloaded and compiled 53 LMDZ_INIT="$local_env_dir/LMDZ_Init" # Where to store shared files used for initialisation 54 NB_MPI_MAX=2 # Max number of MPI cores 55 NB_OMP_MAX=1 # Max number of OMP threads 59 56 GROUPE="" # the group to execute the job as 60 RUNCMD="mpirun -n" # command to run a job, as $runcmd <nprocs> <script> 61 SUBMITCMD="mpirun" # command to sumbit a job, as $submitcmd <script> 57 RUNCMD="mpirun -np" # command to run a job, as $runcmd <nprocs> <script> 58 SUBMITCMD="." # command to sumbit a job, as $submitcmd <script> 59 ;; 62 60 esac 63 64 65 #echo LMDZ_Init dans lmdz_env $LMDZ_Init -
BOL/LMDZ_Setup_amaury/script_SIMU
r4955 r4956 19 19 20 20 set -ex 21 set +u # Amaury 06/24: for local use (no $SLURM_CPUS_PER_TASK) - should be removed if we ever rewrite this whole legacy script properly... 21 22 22 23 # Number of MPI processes : 23 24 ntasks=8 25 # number of OpenMP threads 26 nthreads=8 27 export OMP_NUM_THREADS=$nthreads 24 28 25 29 # For Jean-Zay (replacing the next 3 lines, commented out) 26 export OMP_NUM_THREADS=$SLURM_CPUS_PER_TASK 27 ## number of OpenMP threads 28 ##nthreads=8 29 ##export OMP_NUM_THREADS=$nthreads 30 #export OMP_NUM_THREADS=$SLURM_CPUS_PER_TASK 30 31 31 32 # private memory for each thread … … 133 134 if [ "$climato" = "0" ] ; then calend=gregorian ; else calend=earth_360d ; fi 134 135 bisextile=0 135 if [ $(( $year % 4 )) = 0 -a $calend = gregorian] ; then bisextile=1 ; fi136 if [[ $(( year % 4 )) = 0 && $calend = gregorian ]] ; then bisextile=1 ; fi 136 137 if [ $paran = 0 ] ; then 137 138 if [ "$calend" = "gregorian" ] ; then … … 211 212 fi 212 213 213 ## Ca doit etre la meme liste de fichiers rapatriee par setup.sh dans $LMDZ_I nit/SPLA_Init214 ## Ca doit etre la meme liste de fichiers rapatriee par setup.sh dans $LMDZ_INIT/SPLA_Init 214 215 ## et interpolee (setup.sh aussi) dans $SPLADIR 215 216 if [ $aerosols = spla ] ; then … … 244 245 set +e ; for t in stomate sechiba ; do cp $SIMUDIR/start_$t.$ym.nc ${t}_rest_in.nc ; done ; set -e 245 246 if [ "`grep RIVER_ROUTING orchidee.def |grep -i y`" ] ; then 246 set +e ; ln -s $LMDZ_I nit/routing_simple.nc . ; ln -s $LMDZ_Init/routing.nc .247 set +e ; ln -s $LMDZ_INIT/routing_simple.nc . ; ln -s $LMDZ_INIT/routing.nc . 247 248 cp $SIMUDIR/start_routing.$ym.nc routing_start.nc ; set -e 248 249 fi … … 258 259 echo "Autoinitialisation d'orchidee au besoin" 259 260 echo '#########################################################' 260 get="ln -s $LMDZ_I nit/"261 get="ln -s $LMDZ_INIT/" 261 262 for file in cartepente2d_15min.nc \ 262 263 lai2D.nc soils_param.nc soil_bulk_and_ph.nc alb_bg_modisopt_2D_ESA_v2.nc reftemp.nc ; do ${get}$file ; done … … 273 274 274 275 if [ $veget = 7994 ] ; then 275 get="ln -s $LMDZ_I nit/"276 get="ln -s $LMDZ_INIT/" 276 277 for file in ndep_nhx.nc ndep_noy.nc nfert_cropland.nc nfert_pasture.nc nmanure_cropland.nc nmanure_pasture.nc bnf.nc ; do ${get}$file ; done 277 278 fi … … 306 307 echo '##################################################################' 307 308 308 time $ run$ntasks ./gcm.e > listing309 time $RUNCMD $ntasks ./gcm.e > listing 309 310 if [ ! -f restartphy.nc ] ; then 310 311 echo PROBLEME PAS DE FICHIER RESTARTPHY -
BOL/LMDZ_Setup_amaury/setup.sh
r4955 r4956 374 374 375 375 function setup_simu { 376 SIMRUNTOPDIR="$SIMRUNBASEDIR/$(basename "$local")" 376 377 SIMRUNDIR=$SIMRUNTOPDIR 377 378 mkdir -p "$SIMRUNDIR" … … 437 438 -e "s/cpus-per-task=.*.$/cpus-per-task=$omp/" \ 438 439 -e "s/nthreads=.*./nthreads=$omp/" \ 439 -e "s/MAINDIR=.*.$/MAINDIR=$(basename "$ SIMRUNTOPDIR")/" \440 -e "s:STORED=.*.*:STORED=$ SIMRESDIR:" \441 -e "s:SCRATCHD=.*.*:SCRATCHD=$ (dirname "$SIMRUNTOPDIR"):" \440 -e "s/MAINDIR=.*.$/MAINDIR=$(basename "$local")/" \ 441 -e "s:STORED=.*.*:STORED=$(dirname $local):" \ 442 -e "s:SCRATCHD=.*.*:SCRATCHD=$SIMRUNBASEDIR:" \ 442 443 -e "s/stopsim=.*.$/stopsim=$stopsim/" \ 443 444 -e "s/^veget=.*.$/veget=$veget/" \ … … 537 538 function run_sim_or_init { 538 539 cd "$local" 540 539 541 if [[ $init = 1 ]]; then 540 542 ##################################################################### … … 634 636 635 637 # ANCIEN MULTI STEP interp ) 636 if [ $aerosols = clim]; then637 cp $local/interp_aerosols.sh .; chmod +x interp_aerosols.sh638 # Les aerosols de l'annee 2000 ont ete remplaces par "9999" qui pointe vers un fichier moyen sur 1995-2014639 #for year in 2000 1850; do ./interp_aerosols.sh \$year; done640 #mv aerosols.2000.nc aerosols.clim.nc; mv aerosols.1850.nc aerosols.nat.nc641 for year in 9999 1850; do ./interp_aerosols.sh \$year; done642 mv aerosols.9999.nc aerosols.clim.nc; mv aerosols.1850.nc aerosols.nat.nc638 if [[ $aerosols = clim ]]; then 639 cp $local/interp_aerosols.sh .; chmod +x interp_aerosols.sh 640 # Les aerosols de l'annee 2000 ont été remplacés par "9999" qui pointe vers un fichier moyen sur 1995-2014 641 #for year in 2000 1850; do ./interp_aerosols.sh \$year; done 642 #mv aerosols.2000.nc aerosols.clim.nc; mv aerosols.1850.nc aerosols.nat.nc 643 for year in 9999 1850; do ./interp_aerosols.sh \$year; done 644 mv aerosols.9999.nc aerosols.clim.nc; mv aerosols.1850.nc aerosols.nat.nc 643 645 fi 644 646
Note: See TracChangeset
for help on using the changeset viewer.