source: BOL/LMDZ_Setup/interp_aerosols.sh @ 5215

Last change on this file since 5215 was 4615, checked in by asima, 17 months ago

Initial import of LMDZ_Setup environment
(former TEST_PROD which was distributed as tutorial_prod.tar).

See also related doc LMDZ_Setup_HowTo (former tutorial_prod_FAQ) :
https://docs.google.com/document/d/1OLZG6e-86NiXuv5-aALxKIh-QPkp4BdCwWtiBFot-6c

This initial import corresponds to TEST_PROD from
https://lmdz.lmd.jussieu.fr/pub/Training/Archive/tutorial_prod.tar_v20230707.

Previous versions of tutorial_prod.tar are available at
https://lmdz.lmd.jussieu.fr/pub/Training/Archive

File size: 1.3 KB
RevLine 
[4615]1#!/bin/bash
2
3. ./lmdz_env.sh
4
5ulimit -s unlimited
6
7year=$1
8echo Dans interp_aerosols.sh year= $year
9
10# Extraction d'un fichier de grille physique a partir de grilles_gcm.nc
11# ---------------------------------------------------------------------
12
13\rm -rf tmp*nc
14if [ 0 = 0 ] ; then
15imp1=`ncdump -h grilles_gcm.nc | grep lonv | head -1 | awk ' { print $3 } '`
16echo $imp1
17(( imm1 = $imp1 - 2 ))
18echo $imm1
19ncks -d lonv,0,$imm1 grilles_gcm.nc -v phis -O grille_phys.nc
20ncrename -v lonv,lon -v latu,lat -d lonv,lon -d latu,lat -O grille_phys.nc
21ncap2 -s "lon=-360.+lon" grille_phys.nc -O tmp.nc
22\mv -f tmp.nc grille_phys.nc
23#exit
24fi
25
26# Recuperation des fichiers d'origine
27# -----------------------------------
28
29orig=aerosols${year}_from_inca.nc
30ln -s $LMDZ_Init/$orig
31
32
33# Interpollation horizontale sur la grille cible
34# ----------------------------------------------
35
36# Un cdo direct ne marche pas. Il faut donner la liste des variables ...
37vars="" ; 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
38
39echo cdo remapcon,grille_phys.nc -selvar$vars $orig tmp.nc
40cdo remapcon,grille_phys.nc -selvar$vars $orig tmp.nc
41#ncks -v ps,ap,b,presnivs $orig -A tmp.nc
42nccopy -k classic tmp.nc aerosols.${year}.nc
Note: See TracBrowser for help on using the repository browser.