source: trunk/LMDZ.PLUTO/util/startarchive2icosa/icosa_finalize.bash @ 3721

Last change on this file since 3721 was 3721, checked in by emillour, 2 months ago

Pluto PCM:
Some update/cleanup of examples in "startarchive2icosa", now that the
"rearrange" step is no longer needed.
EM

  • Property svn:executable set to *
File size: 2.7 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
9# change to your LMDZ install dir or set "export LMDZ=/path/lmdz" in your .bashrc
10LMDZ=${LMDZ:-../../..}
11source $LMDZ/XIOS/arch.env
12#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
13module load nco
14
15
16#conversion to netcdf 3 in order to rename and add variables, not properly done with netcdf4 files
17nccopy -k 'classic' startfi_prefinalize.nc startphy_icosa_nc3.nc
18
19# rename lat and lon variables as latitude and longitude and put result in
20# file startphy.nc
21ncrename -v lon,longitude -v lat,latitude -d cell,physical_points\
22         startphy_icosa_nc3.nc startphy_nc3.nc
23#Temporay soildepth array from Dynamico startphy_icosa_ref
24ncks -A -v soildepth startphy_icosa_ref.nc startphy_nc3.nc #You have to adapt to your own path
25# ncks -A -v subslope_dist startphy_icosa_ref.nc startphy_nc3.nc
26# ncks -A -v def_slope startphy_icosa_ref.nc startphy_nc3.nc
27
28nccopy -k 4 startphy_nc3.nc startfi.nc
29#cp startfi.nc startfi_before_finalize.nc
30
31#Temporary Time variable from start2archive; should be added with xios
32ncks -O -x -v time_counter startfi.nc startfi.nc_tmp
33#ncks -A -v Time start.nc startfi.nc_tmp
34# ncks -A -v flux_geo startphy_icosa_ref.nc startfi.nc_tmp
35# ncks -A -v wstar startphy_icosa_ref.nc startfi.nc_tmp
36# ncks -A -v hmons startphy_icosa_ref.nc startfi.nc_tmp
37# ncks -A -v summit startphy_icosa_ref.nc startfi.nc_tmp
38# ncks -A -v base startphy_icosa_ref.nc startfi.nc_tmp
39cp startfi.nc_tmp startfi.nc
40
41#./rearrange_startphy.e > rearrange_startphy.out 2>&1
42
43# make a proper start.nc file based on start_icosa.nc
44cp start_icosa_prefinalize.nc start_icosa.nc
45
46# add u,u_lat,u_lon,bounds_lat_u and bound_lon_u from start_icosa_ref.nc
47ncks -A -v u,lon_u,lat_u,bounds_lon_u,bounds_lat_u \
48     start_icosa_ref.nc start_icosa.nc
49ncrename -d cell,cell_mesh \
50         start_icosa.nc
51ncrename -d nvertex,nvertex_mesh \
52         start_icosa.nc
53ncks -A -v xcell,ycell,zcell \
54     start_icosa_ref.nc start_icosa.nc
55
56#ncks -A -v q,nq start_icosa_ref.nc start_icosa.nc
57
58#ncks -A -v latitude,longitude startphy_icosa_ref.nc startfi.nc
59#ncks -A -v latitude,longitude startphy.nc startfi.nc
60# In the current version of Dynamico, the variable q for tracer is needed but unused.
61# To create this unused variable simply run this short python code
62
63# cleanup
64rm -rf startphy_icosa_nc3.nc startphy_nc3.nc startfi.nc_tmp
65
66# copy icosa start files in icosa_starts folder
67mkdir -p icosa_starts
68mv start_icosa.nc icosa_starts/start.nc
69mv startfi.nc icosa_starts/startfi.nc
Note: See TracBrowser for help on using the repository browser.