The reference directory is dirhome=${sdirhome}/Modal_Energetics/Version_3.1 where sdirhome is in general /home/user The directory ${dirhome} is defined in the directory ./Config Read the CFG_ksh_Readme.txt inside this directory and edit ./Config/Config_Dir to define your own ${dirhome} and ${dirdata} Note that the directory ${sdirhome} must be the one you install the directory Modal_Energetics/. If not, you must to move the directory Modal_Energetics/* to your ${sdirhome} All changes you need to do are at the files inside ./Config See the *_Readme.txt inside directory ./Config Note: Inside ./Config/Config_Dir there also three numeric variables nchdird, nchsdr1 and nchsdr2: it reffers to the length of parts of ${dirdata}. Suppose that dirata=/disk/data/user/Modal_Energetics/Version_3.1 Then nchdird=16, that is the length of /disk/data/user/ nchsdr1=17, that is the length of Modal_Energetics/ nchsdr2=11, that is the length of Version_3.1 This is necessary to the korn shell script ./Make_Dir_Data inside ./Config make the data outuput subdirectories at the correct place you choose. The directory dirdinp is the main directory where your data is located. In the following items there is a guide to compute the modal energetics. After read these clues go to ./Config and see the *_Readme.txt and make the changes you want for your own use. 1 - The directory ./Pressure_Levels has the files with the pressure levels data for the reference case cvsm. The name of the file is: PressureLevels_csvm.Lkkk where csvm is a identificer for the case with five letters, defined at i${dirhome}/Config/Reference_Case and kkk is a i three digit number of levels (Kmax), e.g. if Kmax=37, kkk=037 These data contains mean surface pressure and pressure levels from surface to top. Note that BAMHY and SMNAH have the same vertical pressure levels, and ERA_5, CFSR1 and CFSV2 has also have the same vertical pressure levels. ERA_5 is selected as the reference case. If you want to create a new case (CNEW) you have to edit a file PressureLevels_CNEW.Lknw with the corresponding knw pressure levels and the same format. You need to incluce CNEW at file Cases_List inside ./Config. See the PL_Read.me at directory ./Pressure_Levels for further tips. 2 - The first program to run is to generate the vertical modes for each case you will analyse, to perform the vertical decomposition. To do that use go to directory ./Vertical_Modes/source and do make and then cd ../run and run ./Run_VModes Run_VModes has no arguments and uses the reference case to generated the vertical modes. Run ./Run_VModes -h for extra tips. 3 - If you want to classify the vertical modes into classes, and get predefined vertical pressure layers go to directory ./Get_Cls_Prs_Lay/source and do make and then cd ../run and run ./Run_GClsPrs and the result will be at ./Get_Cls_Prs_Lay/txt Run_VModes has no arguments and uses the reference case to get pressure layers and vertical modes distribution by classes. Run ./Run_GClsPrs -h for extra tips. 4 - Now it is necessary to generate the horizontal resolution. Go to the directory ./Get_Rhomb_Res_GLats/source and do make and then cd ../run and run ./Run_GRhoResGL Mmax where Mmax is the number of zonal waves (Rhomb+1) See GRG_Readme.txt inside the directory ./Get_Rhomb_Res_GLats or do ./Run_GRhoResGL -h for further details. 5 - The next step is to genetared the horizontal modes (Hough functions), to perform the horizontal decomposition. To do that go to directory Hough_Functions/source and do make then cd ../run and run ./Run_Hough caso Mmax nhn at the directory Hough_Functions, for nhn = 1, to Kmax Mmax refers to the selected quadratic Rhomboidal grid, it is Rhomb+1 and represents the number of zonal waves including the zonal mean (+1). ./Run_Hough uses the reference case to generate the Hough Functions. Run ./Run_Hough -h for description of the arguments. 6 - Then, to generate the inital condition for modal energy analysis has 3 steps: a) go to ./Data_Pressure and open GrADS with the comand grads. Then run the GrADS script: Get_Data caso epoca casestudy mean This will generate the initial data as 5 netcdf files (zonal wind, meridional wind, temperature, specific humidity and geopotential height) Run GetData -h inside grads command for description of the arguments. b) go to directory ./Get_Netcdf/source inside ./Data_Pressure and do make, then cd ../run and run: ./Run_Netcdf caso epoca casestudy mean DelFileInp A single binary file with the variables zonal wind, meridional wind, temperature, specific humidity and geopotential height will be generated. Run ./Run_Netcdf -h for description of the arguments. c) go to directory ./Get_ENER_UVZ/source inside ./Data_Pressure and do make, then cd ../run and run: ./Run_GEUVZ CasoInp KmaxInp eoca casestudy mean DelFileInp MmaxOut GrdInp CasoClm Then a quadratic gaussian Rhomboidal grid RB(MmaxOut-1) in a GrADS sequential format data file with zonal wind, meridional wind and geopotential height will be generated to be read by the program that performs the vertical decomposition. Run ./Run_GEUVZ -h for description of the arguments. The layout of the initial data for is a file in REAL(KIND=4) with sequential records and in a selected horizontal Rhomboidal grid, with Kmax pressure levels from the reference case (the first 1000 hPa): zonal wind (m/s) for each layer as record (Kmax records) meridional wind (m/s) for each layer as record (Kmax records) geopotential height (m) for each layer as record (Kmax records) You can geneterate the initial data with this layout using another procedure than GrADS. Vertical interpolation to the reference case is done in this procedure, then all cases has the same vertical modes as the reference case and the same vertical distribution by vertical classes. 7 - Now the modal decomposition will begin. Go to the directory ./Vertical_Decomposition/source and do make and then cd ../run and run ./Run_VDecomp caso epoca casestudy mean Mmax to perform the vertical modal decomposition. Run ./Run_VDecomp -h for description of the arguments. 8 - To perform the horizontal modal decomposition go to the directory ./Horizontal_Decomposition/source and do make and then cd ../run and run ./Run_HDecomp caso epoca casestudy mean Mmax See Run_HDecomp -h for description of the arguments. 9 - To perform the calculation of the interaction among horizontal and vertical modes go to the directory ./Interaction_Horizontal_Vertical/source and do make and then cd ../run and run ./Run_IntHV caso Kmax datei datef [Rhomb] Run ./Run_IntHV -h for description of the arguments. 10 - Finally you can plot figures using GrADS scripts (name.gs) at the directories ./Vertical_Modes/gs ./Vertical_Decomposition/gs ./Horizontal_Decomposition/gs ./Interaction_Horizontal_Vertical/gs See the scripts inside these directories because they have instruction how to run them. We can design your own GrADS scripts. To see the usage of the available GrADS script type name.gs -h inside GrADS application (grads) and it will be displayed the arguments and their default values. Before run the GrADS scripts it is necessary to run the korn shell script ./Make_Dir_png inside ./Config to create the output directories for the figures. 12 - Before run the ksh scripts it is necessary to compile the sources which are in FORTRAN 90. Then, go to the subdirectory source and execute the make. There are two options for compilers (See FTN.Comp_Readme.txt at the directory ./Config) 1 - The compiler GNU gfortran it is necessary to do module load gnu9 module load openmpi4/4.1.1 at egeon. 2 - The compiler intel ifort it is necessary to do module unload gnu9 module unload openmpi4/4.1.1 module load intel/2022.1.0 module load mpi/2021.5.1 at egeon. If you want to change the FORTRAN compiler, you need to to that changing the file FTN_Compiler at ./Config and load de corresponding module (if necessary). 3 - To use grads that opens netcdf files used at egeon: module load opengrads/2.2.1 export GASCRP=/home/ioper/bin/opengrads-2.2.1.oga.1/Contents/Resources/Scripts export GADDIR=/home/ioper/bin/opengrads-2.2.1.oga.1/Contents/Resources/SupportData 4 - The commands module (1, 2 and 3) and export (3) must be included at the file .bashrc at your ${HOME}. 5 - At the directory ./Docs there is a pdf file describing all the theory envolved in this system of energetics analysis (in portuguese): Pressure_Nomal_Modes_Decomposition_Enegetics_and_Interactions_Theory.pdf