source: trunk/src/compute_erai_daily_region_2d.sh @ 13

Last change on this file since 13 was 11, checked in by pinsard, 13 years ago

add .sh extension to ml shell script + min. header + graph

File size: 10.8 KB
Line 
1#! /bin/sh
2#
3#+
4#
5# .. program:: compute_erai_daily_region_2d.sh
6#
7# .. _compute_erai_daily_region_2d.sh:
8#
9# ==========================================================================
10# compute_erai_daily_region_2d.sh - get ERA-I uninterpolated reference files
11# ==========================================================================
12#
13# SYNOPSIS
14# ========
15#
16# ::
17#
18#  $ compute_erai_daily_region_2d.sh
19#
20# DESCRIPTION
21# ===========
22#
23#     .. graphviz::
24#
25#        digraph compute_erai_daily_region_2d {
26#           graph [
27#           rankdir="LR",
28#           ]
29#           filein_lsp [shape=ellipse,fontname=Courier,label="/bdd/ERAI/NETCDF/GLOBAL_075/4xdaily/FC_SF/yyyy/mm/lsp.yyyymmdd*"];
30#           filein_cp [shape=ellipse,fontname=Courier,label="/bdd/ERAI/NETCDF/GLOBAL_075/4xdaily/FC_SF/yyyy/mm/cp.yyyymmdd*"];
31#           filein_e [shape=ellipse,fontname=Courier,label="/bdd/ERAI/NETCDF/GLOBAL_075/4xdaily/FC_SF/yyyy/mm/e.yyyymmdd*"];
32#           filein_slhf [shape=ellipse,fontname=Courier,label="/bdd/ERAI/NETCDF/GLOBAL_075/4xdaily/FC_SF/yyyy/mm/slhf.yyyymmdd*"];
33#           filein_ssr [shape=ellipse,fontname=Courier,label="/bdd/ERAI/NETCDF/GLOBAL_075/4xdaily/FC_SF/yyyy/mm/ssr.yyyymmdd*"];
34#           filein_trd [shape=ellipse,fontname=Courier,label="/bdd/ERAI/NETCDF/GLOBAL_075/4xdaily/FC_SF/yyyy/mm/trd.yyyymmdd*"];
35#           filein_sshf [shape=ellipse,fontname=Courier,label="/bdd/ERAI/NETCDF/GLOBAL_075/4xdaily/FC_SF/yyyy/mm/sshf.yyyymmdd*"];
36#           filein_ssrd [shape=ellipse,fontname=Courier,label="/bdd/ERAI/NETCDF/GLOBAL_075/4xdaily/FC_SF/yyyy/mm/ssrd.yyyymmdd*"];
37#           filein_str [shape=ellipse,fontname=Courier,label="/bdd/ERAI/NETCDF/GLOBAL_075/4xdaily/FC_SF/yyyy/mm/str.yyyymmdd*"];
38#           filein_ewss [shape=ellipse,fontname=Courier,label="/bdd/ERAI/NETCDF/GLOBAL_075/4xdaily/FC_SF/yyyy/mm/ewss.yyyymmdd*"];
39#           filein_nsss [shape=ellipse,fontname=Courier,label="/bdd/ERAI/NETCDF/GLOBAL_075/4xdaily/FC_SF/yyyy/mm/nsss.yyyymmdd*"];
40#           filein_geopt [shape=ellipse,fontname=Courier,label="/bdd/ERAI/NETCDF/GLOBAL_075/4xdaily/AN_SF/yyyy/mm/geopt.yyyymm.ashei.GLOBAL_075.nc"];
41#           filein_msl [shape=ellipse,fontname=Courier,label="/bdd/ERAI/NETCDF/GLOBAL_075/4xdaily/AN_SF/yyyy/mm/msl.yyyymm.ashei.GLOBAL_075.nc"];
42#           filein_sstk [shape=ellipse,fontname=Courier,label="/bdd/ERAI/NETCDF/GLOBAL_075/4xdaily/AN_SF/yyyy/mm/sstk.yyyymm.ashei.GLOBAL_075.nc"];
43#           filein_t2 [shape=ellipse,fontname=Courier,label="/bdd/ERAI/NETCDF/GLOBAL_075/4xdaily/AN_SF/yyyy/mm/t2.yyyymm.ashei.GLOBAL_075.nc"];
44#           filein_d2 [shape=ellipse,fontname=Courier,label="/bdd/ERAI/NETCDF/GLOBAL_075/4xdaily/AN_SF/yyyy/mm/d2.yyyymm.ashei.GLOBAL_075.nc"];
45#           filein_u10 [shape=ellipse,fontname=Courier,label="/bdd/ERAI/NETCDF/GLOBAL_075/4xdaily/AN_SF/yyyy/mm/u10.yyyymm.ashei.GLOBAL_075.nc"];
46#           filein_v10 [shape=ellipse,fontname=Courier,label="/bdd/ERAI/NETCDF/GLOBAL_075/4xdaily/AN_SF/yyyy/mm/v10.yyyymm.ashei.GLOBAL_075.nc"];
47#
48#           fileout_lsp [shape=ellipse,fontname=Courier,label="/bdd/IPCC/Reanalysis/ERAI/${reg}/erai_GLOB_1d_yyyy0101_yyyy1231_lsp_gridOrig.nc"];
49#           fileout_cp [shape=ellipse,fontname=Courier,label="/bdd/IPCC/Reanalysis/ERAI/${reg}/erai_GLOB_1d_yyyy0101_yyyy1231_cp_gridOrig.nc"];
50#           fileout_e [shape=ellipse,fontname=Courier,label="/bdd/IPCC/Reanalysis/ERAI/${reg}/erai_GLOB_1d_yyyy0101_yyyy1231_e_gridOrig.nc"];
51#           fileout_slhf [shape=ellipse,fontname=Courier,label="/bdd/IPCC/Reanalysis/ERAI/${reg}/erai_GLOB_1d_yyyy0101_yyyy1231_slhf_gridOrig.nc"];
52#           fileout_ssr [shape=ellipse,fontname=Courier,label="/bdd/IPCC/Reanalysis/ERAI/${reg}/erai_GLOB_1d_yyyy0101_yyyy1231_ssr_gridOrig.nc"];
53#           fileout_trd [shape=ellipse,fontname=Courier,label="/bdd/IPCC/Reanalysis/ERAI/${reg}/erai_GLOB_1d_yyyy0101_yyyy1231_trd_gridOrig.nc"];
54#           fileout_sshf [shape=ellipse,fontname=Courier,label="/bdd/IPCC/Reanalysis/ERAI/${reg}/erai_GLOB_1d_yyyy0101_yyyy1231_sshf_gridOrig.nc"];
55#           fileout_ssrd [shape=ellipse,fontname=Courier,label="/bdd/IPCC/Reanalysis/ERAI/${reg}/erai_GLOB_1d_yyyy0101_yyyy1231_ssrd_gridOrig.nc"];
56#           fileout_str [shape=ellipse,fontname=Courier,label="/bdd/IPCC/Reanalysis/ERAI/${reg}/erai_GLOB_1d_yyyy0101_yyyy1231_str_gridOrig.nc"];
57#           fileout_ewss [shape=ellipse,fontname=Courier,label="/bdd/IPCC/Reanalysis/ERAI/${reg}/erai_GLOB_1d_yyyy0101_yyyy1231_ewss_gridOrig.nc"];
58#           fileout_nsss [shape=ellipse,fontname=Courier,label="/bdd/IPCC/Reanalysis/ERAI/${reg}/erai_GLOB_1d_yyyy0101_yyyy1231_nsss_gridOrig.nc"];
59#           fileout_geopt [shape=ellipse,fontname=Courier,label="/bdd/IPCC/Reanalysis/ERAI/${reg}/erai_GLOB_1d_yyyy0101_yyyy1231_geopt_gridOrig.nc"];
60#           fileout_msl [shape=ellipse,fontname=Courier,label="/bdd/IPCC/Reanalysis/ERAI/${reg}/erai_GLOB_1d_yyyy0101_yyyy1231_msl_gridOrig.nc"];
61#           fileout_sstk [shape=ellipse,fontname=Courier,label="/bdd/IPCC/Reanalysis/ERAI/${reg}/erai_GLOB_1d_yyyy0101_yyyy1231_sstk_gridOrig.nc"];
62#           fileout_t2 [shape=ellipse,fontname=Courier,label="/bdd/IPCC/Reanalysis/ERAI/${reg}/erai_GLOB_1d_yyyy0101_yyyy1231_t2_gridOrig.nc"];
63#           fileout_d2 [shape=ellipse,fontname=Courier,label="/bdd/IPCC/Reanalysis/ERAI/${reg}/erai_GLOB_1d_yyyy0101_yyyy1231_d2_gridOrig.nc"];
64#           fileout_u10 [shape=ellipse,fontname=Courier,label="/bdd/IPCC/Reanalysis/ERAI/${reg}/erai_GLOB_1d_yyyy0101_yyyy1231_u10_gridOrig.nc"];
65#           fileout_v10 [shape=ellipse,fontname=Courier,label="/bdd/IPCC/Reanalysis/ERAI/${reg}/erai_GLOB_1d_yyyy0101_yyyy1231_v10_gridOrig.nc"];
66#
67#           compute_erai_daily_region_2d [shape=box,
68#           fontname=Courier,
69#           color=blue,
70#           URL="http://forge.ipsl.jussieu.fr/tropflux/browser/trunk/src/compute_erai_daily_region_2d.sh",
71#           label="${TROPFLUX}/src/compute_erai_daily_region_2d.sh"];
72#
73#           {filein_lsp filein_cp filein_e filein_slhf filein_ssr filein_trd filein_sshf filein_ssrd filein_trd filein_str filein_ewss filein_nsss filein_geopt filein_msl filein_sstk filein_t2 filein_d2 filein_u10 filein_v10} -> {compute_erai_daily_region_2d} -> {fileout_lsp fileout_cp fileout_e fileout_slhf fileout_ssr fileout_trd fileout_sshf fileout_ssrd fileout_trd fileout_str fileout_ewss fileout_nsss fileout_geopt fileout_msl fileout_sstk fileout_t2 fileout_d2 fileout_u10 fileout_v10}
74#
75#       }
76#
77# SEE ALSO
78# ========
79#
80# :ref:`guide data ERA-I <data_in_erai>`
81#
82# TODO
83# ====
84#
85# trace
86#
87# hard coded directory - usage of ${TROPFLUX_ID}
88#
89# coding rules
90#
91# EVOLUTIONS
92# ==========
93#
94# - fplod 20101216T110626Z aedon.locean-ipsl.upmc.fr (Darwin)
95#
96#   * add minimal header
97#   * add graph in header
98#
99#-
100#
101minlat=-90.
102maxlat=90.
103minlon=0.
104maxlon=360.
105reg=GLOB
106dirtemp=/home/mlengaig/ERAI/1d_2d_${reg}/
107dirin=/bdd/ERAI/NETCDF/GLOBAL_075/4xdaily/
108dirout=/bdd/IPCC/Reanalysis/ERAI/${reg}/
109mkdir ${dirout}
110mkdir ${dirtemp}
111\rm ${dirtemp}/*
112for var in lsp cp; do
113for date in 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010; do
114for month in 01 02 03 04 05 06 07 08 09 10 11 12; do
115for day in 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31; do
116ncpdq -U ${dirin}/FC_SF/${date}/${month}/${var}.${date}${month}${day}* ${dirtemp}/${var}.${date}${month}${day}.temp.GLOBAL_075.nc
117done
118ncrcat ${dirtemp}/${var}.${date}${month}*temp*  ${dirtemp}/${var}.${date}${month}.fshei.GLOBAL_075.nc
119\rm ${dirtemp}/${var}.${date}${month}*temp*
120ncks -d lat,${minlat},${maxlat} -d lon,${minlon},${maxlon} -d time,0,,5 ${dirtemp}/${var}.${date}${month}.fshei.GLOBAL_075.nc ${dirtemp}/temp_time0.nc
121ncks -d lat,${minlat},${maxlat} -d lon,${minlon},${maxlon} -d time,4,,5 ${dirtemp}/${var}.${date}${month}.fshei.GLOBAL_075.nc ${dirtemp}/temp_time4.nc
122ncflint -w -1,1 ${dirtemp}/temp_time0.nc ${dirtemp}/temp_time4.nc ${dirtemp}/temp_time.nc
123ncflint -w 1000.,0.0 ${dirtemp}/temp_time.nc ${dirtemp}/temp_time.nc ${dirtemp}/temp_int_${var}_${date}${month}.nc
124\rm ${dirtemp}/temp_time*
125\rm ${dirtemp}/${var}.${date}${month}.fshei.GLOBAL_075.nc
126done
127ncrcat ${dirtemp}/temp_int_${var}_${date}* /bdd/IPCC/Reanalysis/ERAI/${reg}/erai_${reg}_1d_${date}0101_${date}1231_${var}_gridOrig.nc
128\rm ${dirtemp}/temp_int_${var}_${date}*
129done
130done
131
132for var in e slhf ssr trd sshf ssrd str ewss nsss ; do
133for date in 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 ; do
134for month in 01 02 03 04 05 06 07 08 09 10 11 12; do
135for day in 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31; do
136ncpdq -U ${dirin}/FC_SF/${date}/${month}/${var}.${date}${month}${day}* ${dirtemp}/${var}.${date}${month}${day}.temp.GLOBAL_075.nc
137done
138ncrcat ${dirtemp}/${var}.${date}${month}*temp*  ${dirtemp}/${var}.${date}${month}.fshei.GLOBAL_075.nc
139\rm ${dirtemp}/${var}.${date}${month}*temp*
140ncks -d lat,${minlat},${maxlat} -d lon,${minlon},${maxlon} -d time,0,,5 ${dirtemp}/${var}.${date}${month}.fshei.GLOBAL_075.nc ${dirtemp}/temp_time0.nc
141ncks -d lat,${minlat},${maxlat} -d lon,${minlon},${maxlon} -d time,4,,5 ${dirtemp}/${var}.${date}${month}.fshei.GLOBAL_075.nc ${dirtemp}/temp_time4.nc
142ncflint -w 1.1574074,-1.1574074 ${dirtemp}/temp_time0.nc ${dirtemp}/temp_time4.nc ${dirtemp}/temp_time.nc
143ncflint -w 0.00001,0.0 ${dirtemp}/temp_time.nc ${dirtemp}/temp_time.nc ${dirtemp}/temp_int_${var}_${date}${month}.nc
144\rm ${dirtemp}/temp_time*
145\rm ${dirtemp}/${var}.${date}${month}.fshei.GLOBAL_075.nc
146done
147ncrcat ${dirtemp}/temp_int_${var}_${date}* /bdd/IPCC/Reanalysis/ERAI/${reg}/erai_${reg}_1d_${date}0101_${date}1231_${var}_gridOrig.nc
148\rm ${dirtemp}/temp_int_${var}_${date}*
149done
150done
151
152
153for var in geopt msl sstk t2 d2 u10 v10 ; do
154for date in 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010; do
155for month in 01 02 03 04 05 06 07 08 09 10 11 12; do
156
157ncpdq -U ${dirin}/AN_SF/${date}/${var}.${date}${month}.ashei.GLOBAL_075.nc ${dirtemp}/${var}.${date}${month}.ashei.GLOBAL_075.nc
158ncks -d lat,${minlat},${maxlat} -d lon,${minlon},${maxlon} -d time,0,,4 ${dirtemp}/${var}.${date}${month}.ashei.GLOBAL_075.nc ${dirtemp}/temp_time1.nc
159ncks -d lat,${minlat},${maxlat} -d lon,${minlon},${maxlon} -d time,1,,4 ${dirtemp}/${var}.${date}${month}.ashei.GLOBAL_075.nc ${dirtemp}/temp_time2.nc
160ncks -d lat,${minlat},${maxlat} -d lon,${minlon},${maxlon} -d time,2,,4 ${dirtemp}/${var}.${date}${month}.ashei.GLOBAL_075.nc ${dirtemp}/temp_time3.nc
161ncks -d lat,${minlat},${maxlat} -d lon,${minlon},${maxlon} -d time,3,,4 ${dirtemp}/${var}.${date}${month}.ashei.GLOBAL_075.nc ${dirtemp}/temp_time4.nc
162ncea ${dirtemp}/temp_time* ${dirtemp}/temp_int_${date}${month}.nc
163\rm ${dirtemp}/temp_time*
164\rm ${dirtemp}/${var}.${date}${month}.ashei.GLOBAL_075.nc
165done
166ncrcat ${dirtemp}/temp_int_${date}* /bdd/IPCC/Reanalysis/ERAI/${reg}/erai_${reg}_1d_${date}0101_${date}1231_${var}_gridOrig.nc
167
168\rm ${dirtemp}/temp_int_${date}*
169done
170done
Note: See TracBrowser for help on using the repository browser.