![Page 1: Practical Training: Plotting Model outputs using Matlab :](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815a91550346895dc807d5/html5/thumbnails/1.jpg)
Practical Training:
Plotting Model outputs using Matlab:Time series, vertical profiles, 2D plot
Canadian Network for Regional Climate and Weather Processes
Contact: [email protected] [email protected]
Bureau: PK 6425
![Page 2: Practical Training: Plotting Model outputs using Matlab :](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815a91550346895dc807d5/html5/thumbnails/2.jpg)
Model output ConfigurationIn practice, model data are in 5D format:
Variable of interest: temperature, Wind, … Valid Time Vertical position: pressure (hPa), height
(m), … Latitude position Longitude position
Example: TT(2005010103,500hPa,30°N,60°W)
![Page 3: Practical Training: Plotting Model outputs using Matlab :](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815a91550346895dc807d5/html5/thumbnails/3.jpg)
Login to the Computer …Access to Skynet3:
ssh -Y [email protected]
Copy the directory in your home: cp –r /home/nikiema/Workshop_CNRCWP ./
Enter into the work directory:cd Workshop_CNRCWP
Check the list of files in your directory:ls –al
Open Matlab:matlab&
![Page 4: Practical Training: Plotting Model outputs using Matlab :](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815a91550346895dc807d5/html5/thumbnails/4.jpg)
In Directory: /skynet3_exec2/nikiema/Data_Workshop3 files: (Use VOIR to check these informations)
• Model output: dp_... 2005-01-01-03 to 2005-02-01-00 each 3h Var.: TT , UU, VV and GZ 26 pressure levels• Era-Interim data: era-… 2005-01-01-03 to 2005-02-01-00 each 6h Var.: TT , UU, VV and GZ 34 pressure levels• LoLa: latitude and longitude information
Data files used by Matlab programs
![Page 5: Practical Training: Plotting Model outputs using Matlab :](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815a91550346895dc807d5/html5/thumbnails/5.jpg)
Data files used by Matlab programsvoir -iment « Filename » -style | more
Example:
IP1: Pressure codeCMC time code IP2: forecast hours ?
For instance:IP2=1 for one hour
prevision
![Page 6: Practical Training: Plotting Model outputs using Matlab :](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815a91550346895dc807d5/html5/thumbnails/6.jpg)
voir -iment « NOM DE FICHIER » –style Exemple:
Initial date: 2004-11-01-00h
IP2: 30*24+3=723
GZ data on: 2004-12-01-03h
Data files used by Matlab programs
![Page 7: Practical Training: Plotting Model outputs using Matlab :](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815a91550346895dc807d5/html5/thumbnails/7.jpg)
Getfld6.m Matlab function used to convert RPN
to binary fromat
Conversion: RPN to binary format
Getfld6.m: works only with E32 format
It is possible to change data format by using: r.diag repack …
Sometimes, you need to uncompress the data by using:
fstuncompress -fstin « input file » -fstout « output file »
![Page 8: Practical Training: Plotting Model outputs using Matlab :](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815a91550346895dc807d5/html5/thumbnails/8.jpg)
Getfld6.m: Matlab function used to convert RPN
to binary fromat
Syntax:
Conversion: RPN to binary format
![Page 9: Practical Training: Plotting Model outputs using Matlab :](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815a91550346895dc807d5/html5/thumbnails/9.jpg)
Conversion: RPN to binary format
![Page 10: Practical Training: Plotting Model outputs using Matlab :](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815a91550346895dc807d5/html5/thumbnails/10.jpg)
r.date –Sn « DATE »
Example:
options : -n to add end of line character, -S to get CMC time stamp (time code), -L to get date in this form YYYY MM DD HH MM SS-V to get in this form YYYYMMDDHHMMSS00
Result:
Result:
Useful Fortran programs …
![Page 11: Practical Training: Plotting Model outputs using Matlab :](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815a91550346895dc807d5/html5/thumbnails/11.jpg)
r.ip1 -kn « PRESSION » 2
NB: k =====> kind
options : -n to add end of line character, -k to get height code knowing the level in hPa, m, …-o to get the level value (in hPa, m, …) knowing code
kind : level type (the number express the level unity)-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
0 : m [metres] (height with respect to sea level) 1 : sg [sigma] (0.0 ----> 1.0) 2 : mb [mbars] (pressure in millibars) 3 : [others] (arbitrary code) 4 : M [metres] (height with respect to ground level) 5 : hy [hybrid] (0.0 ----> 1.0) 6 : th [theta]
Useful Fortran programs …
![Page 12: Practical Training: Plotting Model outputs using Matlab :](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815a91550346895dc807d5/html5/thumbnails/12.jpg)
r.ip1 -kn « PRESSION » 2
Examples:
Result:
Result:
Useful Fortran programs …
options : -n to add end of line character, -k to get height code knowing the level in hPa, m, …-o to get the level value (in hPa, m, …) knowing code
![Page 13: Practical Training: Plotting Model outputs using Matlab :](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815a91550346895dc807d5/html5/thumbnails/13.jpg)
2. 1D plot of the Vertical profileScript: Vertical_Profile_1D.m
![Page 14: Practical Training: Plotting Model outputs using Matlab :](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815a91550346895dc807d5/html5/thumbnails/14.jpg)
2. 1D plot of the time series
Script: Time_series_1D.m
![Page 15: Practical Training: Plotting Model outputs using Matlab :](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815a91550346895dc807d5/html5/thumbnails/15.jpg)
3. 2D plot: Latitude-height cross section
Script: Vertical_Profile_2D_Along_long_v1.m
![Page 16: Practical Training: Plotting Model outputs using Matlab :](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815a91550346895dc807d5/html5/thumbnails/16.jpg)
3. 2D plot: Latitude-height cross section
Sometimes, it is better to plot the cross section With Log of the pressure.
Script: Vertical_Profile_2D_Along_long_v2.m
![Page 17: Practical Training: Plotting Model outputs using Matlab :](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815a91550346895dc807d5/html5/thumbnails/17.jpg)
3. 2D plot: Vertical profile of zonal-mean Temperature
Script: Vertical_Profile_2D_Zavg.m
![Page 18: Practical Training: Plotting Model outputs using Matlab :](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815a91550346895dc807d5/html5/thumbnails/18.jpg)
3. 2D plot: Longitude-height cross section
Script: Vertical_Profile_2D_Along_lat_v2.m
![Page 19: Practical Training: Plotting Model outputs using Matlab :](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815a91550346895dc807d5/html5/thumbnails/19.jpg)
4. 2D plot: horizontal map of temperature
![Page 20: Practical Training: Plotting Model outputs using Matlab :](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815a91550346895dc807d5/html5/thumbnails/20.jpg)
4. 2D plot: horizontal map of temperature
![Page 21: Practical Training: Plotting Model outputs using Matlab :](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815a91550346895dc807d5/html5/thumbnails/21.jpg)
quiverm
==> to see wind vectors
![Page 22: Practical Training: Plotting Model outputs using Matlab :](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815a91550346895dc807d5/html5/thumbnails/22.jpg)
There are too much vectors, so you have to reduce the numbers of vectors
![Page 23: Practical Training: Plotting Model outputs using Matlab :](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815a91550346895dc807d5/html5/thumbnails/23.jpg)
Ouvrir et exécuter: Visu_vent2D_2.m
![Page 24: Practical Training: Plotting Model outputs using Matlab :](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815a91550346895dc807d5/html5/thumbnails/24.jpg)
5. Comparison: Model vs Era-Interim1D vertical profile of the domaine-
averaged
![Page 25: Practical Training: Plotting Model outputs using Matlab :](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815a91550346895dc807d5/html5/thumbnails/25.jpg)
5. Comparison: Model vs Era-InterimTime series plot of the domaine-
averaged
![Page 26: Practical Training: Plotting Model outputs using Matlab :](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815a91550346895dc807d5/html5/thumbnails/26.jpg)
5. Comparison: Model vs Era-Interim