source: BOL/Scripts_cel/ECDYN_ERA/get_ERA.sh @ 4904

Last change on this file since 4904 was 4904, checked in by musat, 5 weeks ago

Scripts to create ECDYN.nc file for a given date on spirit2, at IDRIS
or on your local machine
I.Musat

  • Property svn:executable set to *
File size: 1.5 KB
Line 
1#!/bin/bash
2
3###
4### This script (get_ERA.sh) extracts the data (u, v, ta, r, etc; see $VARS below)
5### from ERA5 reanalyses for a given date on your actual directory
6### on spirit2 or spirit1, at IDRIS or on your PC (host=spirit2/IDRIS/local)
7###
8### Author : Ionela MUSAT, 1st April 2022
9
10ana=$1
11host=$2
12mesologin=$3
13resol=$4
14freq=$5
15ddt=$6
16suf=$7
17ndpd=$8
18yr=$9
19mth=${10}
20day=${11}
21hr=${12}
22var=${13}
23
24echo $var
25
26if [ "${host}" == "ciclad" ] || [ "${host}" == "spirit2" ] || [ "${host}" == "spirit1 ]; then
27din=/bdd/${ana}/NETCDF/${resol}/${freq}/${ddt}/${yr}
28elif [ "${host}" == "IDRIS" ]; then
29din=/gpfsstore/rech/psl/rpsl376/${ana}/NETCDF/${resol}/${freq}/${ddt}/${yr}
30else
31din=/bdd/${ana}/NETCDF/${resol}/${freq}/${ddt}/${yr}
32fi
33
34fin=${var}.${yr}${mth}.${suf}.${resol}.nc
35fout=${var}.nc
36
37let "nt = (${day} - 1)*${ndpd} + ${hr}/6 + 1"
38echo $nt
39
40if [ "${host}" == "ciclad" ] || [ "${host}" == "IDRIS" ] || [ "${host}" == "spirit2" ] || [ "${host}" == "spirit1 ]; then
41  if [ ! -f ${fout} ]; then
42    echo ncks -O -F -d time,${nt} ${din}/${fin} ${fout} 
43    ncks -O -F -d time,${nt} ${din}/${fin} ${fout} 
44  fi
45else
46  if [ "${mesologin}" != "" ]; then
47    if [ ! -f ${fout} ]; then
48      scp ${mesologin}@spirit2.ipsl.fr:${din}/${fin} .
49      echo ncks -O -F -d time,${nt} ${fin} ${fout} 
50      ncks -O -F -d time,${nt} ${fin} ${fout} 
51    fi
52  else
53    echo
54    echo Have to give your meso-center login as mesologin in
55    echo the get_ERA.sh script in order to be able
56    echo to get ERA5 data from IPSL meso-centre
57    echo
58    exit
59  fi
60fi
61
62exit
Note: See TracBrowser for help on using the repository browser.