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 |
---|
8 | module purge |
---|
9 | source /scratch/cnt0027/lmd1167/adelavois/models/code/XIOS/arch.env |
---|
10 | module load nco/4.7.9-gcc-4.8.5-hdf5-1.8.18-openmpi-2.0.4 |
---|
11 | |
---|
12 | #conversion to netcdf 3 in order to rename and add variables, not properly done with netcdf4 files |
---|
13 | nccopy -k 'classic' startfi_prefinalize.nc startphy_icosa_nc3.nc |
---|
14 | |
---|
15 | # rename lat and lon variables as latitude and longitude and put result in |
---|
16 | # file startphy.nc |
---|
17 | ncrename -v lon,longitude -v lat,latitude -d cell,physical_points\ |
---|
18 | startphy_icosa_nc3.nc startphy_nc3.nc |
---|
19 | # Temporarily added because program is not yet able to read topography |
---|
20 | # SSO parameters are now taken from a dedicated startarchive.nc |
---|
21 | # see start2archive_SSO.f90 |
---|
22 | #ncks -A -v albedodat,ZMEA,ZSTD,ZSIG,ZGAM,ZTHE \ |
---|
23 | # startphy_icosa_ref.nc startphy_nc3.nc |
---|
24 | #Temporay soildepth array from Dynamico restartfi |
---|
25 | ncks -A -v soildepth \ |
---|
26 | ../../mars_dynamico_update_basic/startfi_0.nc startphy_nc3.nc |
---|
27 | |
---|
28 | nccopy -k 'netCDF-4' startphy_nc3.nc startfi.nc |
---|
29 | |
---|
30 | #Temporary Time variable from start2archive; should be added with xios |
---|
31 | ncks -A -v Time \ |
---|
32 | start_archive_nc4.nc startfi.nc |
---|
33 | |
---|
34 | rearrange_startphy > rearrange_startphy.out 2>&1 |
---|
35 | |
---|
36 | # make a proper start.nc file based on start_icosa.nc |
---|
37 | cp start_icosa_prefinalize.nc start_icosa.nc |
---|
38 | |
---|
39 | # add u,u_lat,u_lon,bounds_lat_u and bound_lon_u from start_icosa_ref.nc |
---|
40 | ncks -A -v u,lon_u,lat_u,bounds_lon_u,bounds_lat_u \ |
---|
41 | start_icosa_ref.nc start_icosa.nc |
---|
42 | ncrename -d cell,cell_mesh \ |
---|
43 | start_icosa.nc |
---|
44 | ncrename -d nvertex,nvertex_mesh \ |
---|
45 | start_icosa.nc |
---|
46 | ncks -A -v xcell,ycell,zcell \ |
---|
47 | start_icosa_ref.nc start_icosa.nc |
---|
48 | |
---|
49 | # cleanup |
---|
50 | rm -rf startphy_icosa_nc3.nc startphy_nc3.nc |
---|