source: CPL/oasis3-mct/branches/OASIS3-MCT_2.0_branch/examples/test_interpolation/create_grids_masks_with_F90/script_create_grids_masks_f90.sh @ 4775

Last change on this file since 4775 was 4775, checked in by aclsce, 5 years ago
  • Imported oasis3-mct from Cerfacs svn server (not suppotred anymore).

The version has been extracted from https://oasis3mct.cerfacs.fr/svn/branches/OASIS3-MCT_2.0_branch/oasis3-mct@1818

  • Property svn:executable set to *
File size: 1.6 KB
Line 
1#!/bin/ksh
2#
3HOMEDIR=`pwd`
4#
5# Name of the grids in the initial files of each grid
6export srcgridini=torc
7export tgtgridini=lmdz
8# Name of the files containing each grid
9export srcgridfile=grid_model1.nc
10export tgtgridfile=grid_model2.nc
11# Name of the grids in the final files grids_und.nc and masks_und.nc (4 characters)
12export srcgridend=tore
13export tgtgridend=lmde
14#
15# WARNING : the coordinates must be double and the masks must be integer
16#
17RUNDIR=$HOMEDIR/wkdir_${srcgridend}_${tgtgridend}
18DATAGRIDS=$HOMEDIR/data
19#
20[ -d $RUNDIR ] || mkdir $RUNDIR
21cd $RUNDIR
22#
23# Copy grid and mask files for each grid in $RUNDIR
24ln -sf $DATAGRIDS/${srcgridfile} $RUNDIR/${srcgridfile}
25ln -sf $DATAGRIDS/${tgtgridfile} $RUNDIR/${tgtgridfile}
26#
27# In case the variables are defined with "_" and not "."
28ncrename -v ${srcgridini}_lon,${srcgridini}.lon $srcgridfile
29ncrename -v ${srcgridini}_lat,${srcgridini}.lat $srcgridfile
30ncrename -v ${srcgridini}_clo,${srcgridini}.clo $srcgridfile
31ncrename -v ${srcgridini}_cla,${srcgridini}.cla $srcgridfile
32ncrename -v ${srcgridini}_msk,${srcgridini}.msk $srcgridfile
33#
34ncrename -v ${tgtgridini}_lon,${tgtgridini}.lon $tgtgridfile
35ncrename -v ${tgtgridini}_lat,${tgtgridini}.lat $tgtgridfile 
36ncrename -v ${tgtgridini}_clo,${tgtgridini}.clo $tgtgridfile
37ncrename -v ${tgtgridini}_cla,${tgtgridini}.cla $tgtgridfile
38ncrename -v ${tgtgridini}_msk,${tgtgridini}.msk $tgtgridfile
39#
40# Construct grids_und.nc and masks_und.nc files (with _)
41echo "Running create_aux_files.ncl"
42cp $HOMEDIR/create_aux_files $RUNDIR/create_aux_files
43./create_aux_files $srcgridfile $tgtgridfile $srcgridini $tgtgridini $srcgridend $tgtgridend
44#
Note: See TracBrowser for help on using the repository browser.