Changeset 5850 for BOL/LMDZ_Setup
- Timestamp:
- Oct 6, 2025, 5:38:06 PM (7 weeks ago)
- Location:
- BOL/LMDZ_Setup
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
BOL/LMDZ_Setup/era2gcm.sh
r5848 r5850 1 1 #!/bin/bash 2 2 3 #--------------------------------------------------------------------------- 4 # Getting and interpolating reanalaysis on the LMDZ grid for nudging 5 #--------------------------------------------------------------------------- 6 # 7 # Developed by LMDZ team : 8 # F. Hourdin, A. Sima et al. 9 # 10 # 2025/10/03 : factorizing the code. era2gcm_tuto.sh should be obsolete. 11 # u10m and v10m to be added optionnally to make 12 # era2gcm_uv10m.sh obsolete too 13 # Automatic access to reanalysis on lmdz.lmd.jussieu.fr 14 # 15 # 16 # NB: for "cleanest" guiding, the 1st step of the next month should be 17 # added at the end of each month. 18 # wget http://forge.ipsl.jussieu.fr/igcmg/browser/TOOLS/INTERP_NUDGE 3 . lmdz_env.sh 4 5 set -eu 6 7 #----------------------------------------------------------------------------- 8 # 9 # Script for interpolating monthly ERA* files to the LMDZ grid; 10 # it creates the folder structure required by the LMDZ_Setup scripts 11 # 12 # NB: for "cleanest" guiding, the 1st step of the next month should be added at the end of each month. 13 # If you need such precision, you should use the scripts here - AND adjust "ERADIR" in script_SIMU ! 14 # wget http://forge.ipsl.jussieu.fr/igcmg/browser/TOOLS/INTERP_NUDGE 19 15 # documented on LMDZpedia (search for "Guidage" ) 20 16 # 21 #--------------------------------------------------------------------------- 17 #----------------------------------------------------------------------------- 22 18 # Requires : netcdf, ferret, nco, cdo 23 #--------------------------------------------------------------------------- 24 . lmdz_env.sh 25 set -eu 26 27 #--------------------------------------------------------------------------- 19 #----------------------------------------------------------------------------- 20 21 #------------------------------------------------ 28 22 # User choices 29 #------------------------------------------------ ---------------------------23 #------------------------------------------------ 30 24 # Periode : 31 25 mth_i=200001 32 mth_f=20 201226 mth_f=200212 33 27 # 34 28 vars="u v ta q" … … 39 33 resol_rea=075 40 34 41 #--------------------------------------------------------------------------- 42 # Paths 43 #--------------------------------------------------------------------------- 35 #------------------------------------------------ 36 44 37 ERA5_PATH="/gpfsstore/rech/psl/rpsl376/ergon/ERA5/" 45 38 ERAI_PATH="/gpfsstore/rech/psl/rpsl376/ergon/ERAI/" … … 52 45 #@ADS SCRATCH=$SCRATCHDIR 53 46 47 set -u # raise error if path if unset on machine 48 echo "Paths: $ERA5_PATH $ERAI_PATH $SCRATCH" 49 set +u 50 54 51 GRID_DIR=./INIT 55 52 56 #--------------------------------------------------------------------------- 53 #----------------------------------------------------------------------------- 57 54 #Utilite du block suivant a re-examiner : 58 #--------------------------------------------------------------------------- 55 #----------------------------------------------------------------------------- 59 56 #L'utilisateur a maintenant des choix a faire en plus de mth* : type de guidage, et "rea" 60 57 # Alors c'est plus facile d'editer&modifier le script, puis lancer avec ./era2gcm.sh, que de donner tous les params … … 135 132 if [ ! -d $ANA_DIR ] ; then echo Directory $ANA_DIR does not exist ; exit 1 ; fi 136 133 137 ######################################################################## 134 ################################################################################# 138 135 # Loop on variables among u, v, ta, q 139 ######################################################################## 136 ################################################################################# 140 137 141 138 for var in $vars ; do … … 153 150 file_rea="$ANA_DIR/AN_PL/$an/$var.$an$mois.$suf.nc" 154 151 155 ################################################################### 152 ############################################################################ 156 153 # Automatically downloading reanalysis if needed 157 ################################################################### 154 ############################################################################ 158 155 if [ "$( echo $ERAI_PATH | grep 3DInputData )" != "" ] ; then 159 156 if [ ! -f $file_rea ] ; then … … 164 161 fi 165 162 fi 166 ################################################################### 163 ############################################################################ 167 164 # Checking the avaibility of reanalysis native file 168 ################################################################### 165 ############################################################################ 169 166 if [ ! -f $file_rea ] ; then echo Reanalysis file $file_rea missing ; exit 1 ; fi 170 167 171 ################################################################### 168 ############################################################################ 172 169 # Special treatments 173 ################################################################### 170 ############################################################################ 174 171 if [ "$rea" = "ERAI" ] ; then 175 172 # original data in "short" should be changed to "float" for ferret 176 ncap2 -s $var'=float('$var')' $file_rea -O tmp .nc173 ncap2 -s $var'=float('$var')' $file_rea -O tmp_in.nc 177 174 elif [ "$rea" = "ERA5" -a $an -ge 2022 ] ; then 178 175 # Recent analysis available on a daily basis 179 cdo selhour,0,6,12,18 $file_rea -O tmp .nc176 cdo selhour,0,6,12,18 $file_rea -O tmp_in.nc 180 177 else 181 ln -sf $file_rea tmp .nc182 fi 183 184 ################################################################### 178 ln -sf $file_rea tmp_in.nc 179 fi 180 181 ############################################################################ 185 182 # Dimensions of horizontal grid 186 ################################################################### 183 ############################################################################ 187 184 case $var in 188 185 v) imjm="i=1:$iip1,j=1:$jjm" ;; … … 190 187 esac 191 188 192 ################################################################### 189 ############################################################################ 193 190 # Grid to be used from grilles_gcm.nc 194 ################################################################### 191 ############################################################################ 195 192 case $var in 196 193 u|v) grid=grille_$var ;; … … 198 195 esac 199 196 200 ################################################################### 197 ############################################################################ 201 198 # Interpolating with ferret 202 ################################################################### 199 ############################################################################ 203 200 cat <<.........eod......... >| tmp.jnl 204 201 ! NB : Augmenter la memoire (plus de 512) peut faire planter 205 202 set memory/size=512 206 203 use "$GRID_FI" 207 use tmp .nc204 use tmp_in.nc 208 205 define axis/t="1-${month}-${an}:00:00":"${nday}-${month}-${an}:18:00":6/units=hours thour 209 206 ! Pour regrid horizontal on utilise la variable grille_s(lonv,latu) du fichier grilles_gcm.nc 210 207 !! Alors il faut renommer la variable à la fin (ncrename), car le code cherche "UWND", "VWND". 211 save/clobber/file=" $out_file" $var[d=2,gxy=${grid}[d=1],$imjm,$t0,gt=thour@asn]212 repeat/$t1tn save/file=" $out_file"/append $var[d=2,gxy=${grid}[d=1],$imjm,gt=thour@asn]208 save/clobber/file="tmp_out.nc" $var[d=2,gxy=${grid}[d=1],$imjm,$t0,gt=thour@asn] 209 repeat/$t1tn save/file="tmp_out.nc"/append $var[d=2,gxy=${grid}[d=1],$imjm,gt=thour@asn] 213 210 .........eod......... 214 211 212 set +e 215 213 ferret -nojnl <<.........eod......... 216 214 go tmp.jnl 217 215 quit 216 fi 218 217 .........eod......... 219 220 ################################################################### 218 if [ $? != 0 ] ; then 219 echo Something went wrong when running ferret with script tmp.jnl : 220 cat tmp.jnl 221 echo On $PWD 222 exit 1 223 else 224 set -e 225 mv tmp_out.nc $out_file 226 fi 227 228 ############################################################################ 221 229 # Changing variable names 222 ################################################################### 230 ############################################################################ 223 231 case $var in 224 232 u) out_var=UWND ;; … … 227 235 ta) out_var=AIR 228 236 esac 229 # ferret a ecrit $varu en majuscules, 230 # l'equivalent en bash est ${varu^^} 231 # (Note : inversement, ${varu,,} passe $varu de majuscules 232 # en minuscules) 237 #Ferret a ecrit $varu en majuscules, l'equivalent en bash est ${varu^^} 238 # (Note : inversement, ${varu,,} passe $varu de majuscules en minuscules) 233 239 ncrename -v ${var^^},$out_var $out_file 234 240 fi … … 236 242 237 243 238 ######################################################################### 244 ############################################################################ 239 245 # Updating month counter 240 ######################################################################### 246 ############################################################################ 241 247 echo AN MTH $an $mois 242 248 (( mth = $mth + 1 )) -
BOL/LMDZ_Setup/main.sh
r5604 r5850 26 26 version="20241018.trunk" 27 27 version="20250327.trunk" 28 version="20251001.trunk -unstable" 28 29 29 30 svn="" -
BOL/LMDZ_Setup/setup.sh
r5723 r5850 682 682 #@JZ# de Slurm "multithread" fait bien référence à l'hyperthreading. 683 683 #@JZ#SBATCH --hint=nomultithread # 1 thread par coeur physique (pas d'hyperthreading) 684 #@JZ#SBATCH --time=0 0:10:00 # Temps d'exécution maximum demandé (HH:MM:SS)684 #@JZ#SBATCH --time=01:00:00 # Temps d'exécution maximum demandé (HH:MM:SS) 685 685 #@JZ#SBATCH --output=Init%j.out # Nom du fichier de sortie 686 686 #@JZ#SBATCH --error=Init%j.out # Nom du fichier d'erreur (ici commun avec la sortie) … … 692 692 #@SP#SBATCH --cpus-per-task=1 693 693 #@SP#SBATCH --hint=nomultithread 694 #@SP#SBATCH --time=0 0:10:00694 #@SP#SBATCH --time=01:00:00 695 695 #@SP#SBATCH --output=Init%j.out 696 696 #@SP#SBATCH --error=Init%j.out
Note: See TracChangeset
for help on using the changeset viewer.
