Changeset 5415 for BOL/LMDZ_Setup/interp_aerosols.sh
- Timestamp:
- Dec 17, 2024, 2:02:51 PM (34 hours ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
BOL/LMDZ_Setup/interp_aerosols.sh
r4615 r5415 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 33 # Interpol lation horizontale sur la grille cible33 # Interpolation horizontale sur la grille cible 34 34 # ---------------------------------------------- 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"
Note: See TracChangeset
for help on using the changeset viewer.