Fork of: https://github.com/brodeau/barakuda
Pierre-Yves Barriat 48a0384519 rebuild nemo scripts | преди 2 години | |
---|---|---|
cdftools_light | преди 2 години | |
configs | преди 2 години | |
data | преди 2 години | |
platform | преди 6 години | |
python | преди 2 години | |
src | преди 2 години | |
.gitignore | преди 2 години | |
LICENSE | преди 6 години | |
README.md | преди 2 години | |
barakuda.sh | преди 2 години | |
build_clim.sh | преди 2 години | |
compare_time-series.sh | преди 6 години | |
rebuild.sh | преди 2 години | |
rebuild_pbs.sh | преди 2 години | |
seaice_diags.nc | преди 2 години | |
tmp_ice.nc | преди 2 години |
Fork of:
Example of a set of web pages generated by Barakuda: https://brodeau.github.io/barakuda/example/
A FORTRAN 90 compiler
netcdf library with support for the appropriate F90 compiler
NCO
'convert' from ImageMagick if you want to generate GIF movies
'ffmpeg' with x264 support if you want to generate MP4 movies
For time-series and 2D plots, the following up-to-date packages: => python-netcdf4 (from netCDF4 import Dataset) and Matplotlib => for map projections you'll also need the Basemap package
A good idea is to install a shiny python distribution, something like Canopy: => https://www.enthought.com/products/canopy/
In any case, specify the appropriate "PYTHON_HOME" environment variable in your ${BARAKUDAROOT}/configs/config${MYCONF}.sh or ./config_${MYCONF}.sh file
For NEMO 3.6 and above some appropriate sets of xml configuration files for XIOS2 can be found in: src/xios2_xml/
To create the NEMO mesh_mask.nc just launch the relevant NEMO experiment with the namelist parameter nn_msh set to 1 !
For both ORCA1 and ORCA025 configs (regardless of the number of levels) it is safe to use the basin_mask.nc provided in the "data/" sub-directory of Barakuda.
If you want to create your own basin_mask.nc containing your favorite seas/regions, proceed as follow:
use the "python/exec/orca_mesh_mask_to_bitmap.py" python script to create a black-and-white bitmap image of the land-sea-mask from the mesh_mask.nc generated by NEMO.
use your favorite rater image editor (Gimp, PhotoShop, Paint, etc) to easily edit the bitmap image and create a new image of your sea/region of interest. Save it as a "tiff" image!
then you can use "python/exec/tiff_to_orca_mask.py" python script to generate the new basin_mask.nc netcdf file out of your tiff images!
CDFTOOLS is a set of FORTRAN executables intended to perform a multitude of ocean diagnostics based on NEMO output (https://github.com/meom-group/CDFTOOLS). However, this is a slightly modified light version here... SO DO NOT USE AN OFFICIAL CDFTOOLS DISTRIBUTION, stick to the one that comes with Barakuda!
move to the 'barakuda/cdftools_light' directory
configure your own 'make.macro' for your system (some templates for gfortran and Intel are provided...) => just copy or link your own "macro.your_arch" to "make.macro" ! => F90 compiler and related netcdf library to use
compile with 'gmake'
if that was successful the 'barakuda/bin' directory should contain the 8 following executables:
* cdficediags.x
* cdfmaxmoc.x
* cdfmhst.x
* cdfmoc.x
* cdfpsi.x
* cdfsigtrp.x
* cdficeflux.x
* cdftransportiz.x
* cdfvT.x
All setup related to your host, simulation, location of third party files is defined in the "config_${MYCONF}.sh" file.
You can either used to chose a config file located in the "${BARAKUDA_ROOT}/configs" directory of Barakuda: ('${BARAKUDAROOT}/configs/config${MYCONF}.sh')
Or, in case you have no write access into ${BARAKUDAROOT}/ and call the Barakuda suite of scripts from another location, hereafter "work directory", you can use a "config${MYCONF}.sh" present in the "work directory".
Note: if a given "config_${MYCONF}.sh" exists both in "${BARAKUDAROOT}/configs" and the "work directory", Barakuda will always refer to "config${MYCONF}.sh" present in the "work directory".
IMPORTANT: Always refer to the most relevant '${BARAKUDAROOT}/configs/config*_TEMPLATE.sh' file to design or re-adjust yours! These are symbolic links pointing to the last officially supported and most up-to-date config files. It should be sufficiently well commented for you to be able to adjust your own config file.
MY_CONF should always be of the form: "(e)ORCA<RES>_L<NLEV>_<blabla>.sh"
( with NLEV being the number of z levels )
NEMO output files must be monthly averages and of the following form:
<EXP NAME>_1m_<YEAR>0101_<YEAR>1231_<GRID_TYPE>.nc(.gz)
(GRID_TYPE=grid_T/grid_U/grid_V/icemod)
Gzipped or not!
All files for all years must all be saved in the same directory (see NEMO_OUT_STRCT in the config file). Better if this directory only contains NEMO output files and nothing else!
Alternatively NEMO files can be saved/organized in sub-directories a la EC-Earth: (ex: year 1995 of experiment started in 1990 is the 6th year so files for 1995 are saved into sub-directory (of NEMO_OUT_STRCT) "006" (set 'ece_exp' to 1 or 2 then).
If you want to perform the "climatology" plots (see section IV) you will need monthly "observed" 2D and 3D of T and S (and sea-ice fraction) data interpolated on the ORCA grid you are using. Usually you should already have them since they are needed to initialize your simulation (initial state for T & S). These are the following files in your Barakuda config file: F_T_OBS_3D_12, F_S_OBS_3D_12, F_SST_OBS_12, F_ICE_OBS_12.
Alternatively, you can download these climatologies for the ORCA1.L75 and ORCA025.L75 configurations here: http://misu228.misu.su.se/barakuda/input_barakuda/ORCA1.L75_barakuda.tar http://misu228.misu.su.se/barakuda/input_barakuda/ORCA025.L75_barakuda.tar
The "CONF_INI_DIR" variable in your config file should point to the location of the directory you created by untaring one of these tar archives.
Launch "barakuda.sh"
./barakuda.sh -C <MY_CONF> -R <EXP> -f <years> -y <YYYY>
(ex: ./barakuda.sh -C ORCA1_L75_v36_triolith -R SL36C00)
Use the -h switch to see available options.
To only generate time-series plots use the "-e" switch:
./barakuda.sh -C <MY_CONF> -R <EXP> -e
(ex: ./barakuda.sh -C ORCA1_L75_v36_triolith -R SL36C00 -e)
To generate time-series + 2D climatology plots use the "-E" switch, provided you have built the monthly/annual climatology (based on N years of your simulation) out of your experiment with the "build_clim.sh" script (see next bullet point):
./barakuda.sh -C <MY_CONF> -R <EXP> -E
To be able to create the "climatology" plots (maps, sections, etc, based on a monthly climatology of a few years) you will have to
create the climatology with the "build_clim.sh" script:
./build_clim.sh -C <MY_CONF> -R <EXP> -i <first_year> -e <last_year>
Use the -h switch to see available options.
To compare time-series between at least 2 (already diagnosed) experiments:
./compare_time-series.sh -C <MY_CONF> -R <EXP1>,<EXP2>,...,<EXPn>
(ex: ./compare_time-series.sh -C ORCA1_L75_v36_triolith -R SL36C00,SL36EIE )