source: CONFIG/LMDZOR/branches/LMDZOR_v4/CREATE/SCRIPT/add_step.x @ 1169

Last change on this file since 1169 was 1169, checked in by jgipsl, 14 years ago

Modification in developement branch LMDZOR_v4 :

  • added resolution 280x280x39 with zoom Africa (cordex grid)
  • bug correction in CREATE experience for calendar=leap (anneref=year and calend=gregorian)
  • added always nudging(ok_guide=y)
  • added scripts for interpolating ERAI analysis to model horizontal grid. These scripts have to be used by hand, on other machine.
  • Property svn:executable set to *
File size: 1.9 KB
Line 
1#!/bin/csh
2#set verbose echo
3
4set an_debut=$1
5set an_fin=$2
6set mois_debut=$3
7set mois_fin=$4
8
9# suf : file name must look like u$suf$an-$mois.nc (par default suf=_ERAI_)
10set suf=$5
11# outdir : repertoire ou sont stocke les fichiers interpole
12set outdir=$6
13
14
15echo 'Entering add_step.x'
16echo an_debut=$an_debut an_fin=$an_fin
17echo mois_debut=$mois_debut mois_fin=$mois_fin
18echo 'premier fichier : '$outdir/u$suf$an_debut-$mois_debut.nc
19echo outdir=$outdir
20echo ' '
21
22##################################################
23cd $outdir
24##################################################
25# Debut boucle sur annees
26#
27# Si moins d'un an, mettre mois_fin inferieur a 12
28##################################################
29set an=$an_debut
30set imois=$mois_debut
31while ( $an <= $an_fin )
32    #####################
33    # Boucle sur les mois
34    ######################
35    while ( $imois <= $mois_fin )
36        if ( $imois <= 9 ) then
37            set mois=0$imois
38        else
39            set mois=$imois
40        endif
41        ###############################
42        # Determination du mois suivant
43        ###############################
44        set anp1=$an
45        set imoisp1=`expr $imois + 1`
46        if ( $imoisp1 == 13 ) then
47            set anp1=`expr $an + 1`
48            set imoisp1=1
49        endif
50   
51        if ( $imoisp1 <= 9 ) then
52            set moisp1=0$imoisp1
53        else
54            set moisp1=$imoisp1
55        endif
56
57
58        set outsuf=$suf$an-$mois.nc
59        set outsufp1=$suf$anp1-$moisp1.nc
60       
61        if ( -f u$outsufp1 ) then
62            echo First time step from file u$outsufp1 will be added in file u$outsuf 
63            ncks -O -d THOUR,0,0 u$outsufp1 u1.nc
64            ncrcat -O u$outsuf u1.nc u$outsuf
65        else
66            echo File u$outsufp1 does not exist
67        endif
68
69        if ( -f v$outsufp1 ) then
70            echo First time step from file v$outsufp1 will be added in file v$outsuf 
71            ncks -O -d THOUR,0,0 v$outsufp1 v1.nc
72            ncrcat -O v$outsuf v1.nc v$outsuf
73        else
74            echo File v$outsufp1 does not exist
75        endif
76
77        # Mois prochain
78        set imois=`expr $imois + 1`
79    end
80    set an=`expr $an + 1`
81    set imois=1
82end
Note: See TracBrowser for help on using the repository browser.