source: trunk/LMDZ.MARS/util/startarchive2icosa/icosa_finalize.bash @ 3325

Last change on this file since 3325 was 2941, checked in by romain.vande, 20 months ago

Mars Dynamico : Adapt routines to the new version of Dynamico and the subslope parametrization.

  • Property svn:executable set to *
File size: 2.2 KB
Line 
1#!/usr/bin/bash
2#
3# Bash script to post-process files startphy_icosa.nc and start_icosa.nc
4# generated by start_archive2icosa and create files
5# start.nc and startphy.nc (usable as inputs for icosa_lmdz.exe)
6
7# load nco module
8module purge
9source ../trunk/XIOS/arch.env #You have to adapt to your own path
10#module load nco/4.7.9-gcc-4.8.5-hdf5-1.8.18-openmpi-2.0.4 #Example of version of the module needed
11module load nco
12
13#conversion to netcdf 3 in order to rename and add variables, not properly done with netcdf4 files
14nccopy -k 'classic' startfi_prefinalize.nc startphy_icosa_nc3.nc
15
16# rename lat and lon variables as latitude and longitude and put result in
17# file startphy.nc
18ncrename -v lon,longitude -v lat,latitude -d cell,physical_points\
19         startphy_icosa_nc3.nc startphy_nc3.nc
20#Temporay soildepth array from Dynamico restartfi
21ncks -A -v soildepth restartfi.nc startphy_nc3.nc #You have to adapt to your own path
22ncks -A -v subslope_dist restartfi.nc startphy_nc3.nc
23ncks -A -v def_slope restartfi.nc startphy_nc3.nc
24
25nccopy -k 4 startphy_nc3.nc startfi.nc
26
27#Temporary Time variable from start2archive; should be added with xios
28ncks -O -x -v time_counter startfi.nc startfi.nc_tmp
29ncks -A -v Time start.nc startfi.nc_tmp
30ncks -A -v flux_geo restartfi.nc startfi.nc_tmp
31ncks -A -v wstar restartfi.nc startfi.nc_tmp
32ncks -A -v hmons restartfi.nc startfi.nc_tmp
33ncks -A -v summit restartfi.nc startfi.nc_tmp
34ncks -A -v base restartfi.nc startfi.nc_tmp
35cp startfi.nc_tmp startfi.nc
36
37./rearrange_startphy > rearrange_startphy.out 2>&1
38
39# make a proper start.nc file based on start_icosa.nc
40cp start_icosa_prefinalize.nc start_icosa.nc
41
42# add u,u_lat,u_lon,bounds_lat_u and bound_lon_u from start_icosa_ref.nc
43ncks -A -v u,lon_u,lat_u,bounds_lon_u,bounds_lat_u \
44     start_icosa_ref.nc start_icosa.nc
45ncrename -d cell,cell_mesh \
46         start_icosa.nc
47ncrename -d nvertex,nvertex_mesh \
48         start_icosa.nc
49ncks -A -v xcell,ycell,zcell \
50     start_icosa_ref.nc start_icosa.nc
51
52ncks -A -v W,geopot,q,nq start_icosa_ref.nc start_icosa.nc
53
54# In the current version of Dynamico, the variable q for tracer is needed but unused.
55# To create this unused variable simply run this short python code
56
57# cleanup
58rm -rf startphy_icosa_nc3.nc startphy_nc3.nc
Note: See TracBrowser for help on using the repository browser.