CHyM tutorial Marco Verdecchia – Trieste, September 8/9, 2011 Outline Few suggestions (my opinion, not Gospel!) Quick description of CHyM user interface Homework Using CHyM to rebuild the basin DN (today) Modify CHyM to refine parameterization or calibration What happens if you run a numerical model? It does not work properly Code problem It works properly Parameterization problem CHyM is a complex numerical model, few preliminary steps are needed before to use of modify it. Understand what happens running it as it is What happens if you change a single parameter Modify only one parameter!! Add a wrong line in the code and see what happens… Try to apply CHyM to a basin you are familiar with CHyM: install procedures tar –xvf /afs/ictp/public/shared/smr2262/chym.tar.gz Create a chym directory with the chym code What CHyM directory will contain chym script chymlib.a museo -> /home/netapp-clima/scratch/museo If NCAR Graphic package is available You may want to use CHyM graphic tools ncarg -> /home/netapp-clima/scratch/ncarg bin/ chymlab What happens if you run CHyM script? The CHyM fortran code is created using the value of few csh parameters you set The fortran code is compiled and linked with CHyM libraries to create the executable Run chym executable that use museo db. Delete all the unneeded files chym.f compilation chym.exe run chymlib.a ncarglib museo files chym Output Run CHyM script and understand what is happening(1) Run CHyM script and understand what is happening(2) Run CHyM script and understand what is happening(3) Run CHyM script and understand what is happening(4) Run CHyM script and understand what is happening(5) Run CHyM script and check if it actually happen... tar –xvf /afs/ictp/public/shared/smr2262/chym.tar.gz cd chym ./chym What you need to modify inside CHyM script CHyM script parameters (1) CHyM parameters affecting CHyM output file CHyM script parameters (2) CHyM parameters affecting CHyM output file CHyM script parameters (3) CHyM parameters affecting Prec./Temp input Temperature field from MM5 Temperature field after CA algorithm ERA40-ERAInterim CHyM script parameters (3) CHyM script parameters (3) CHyM script parameters (4) CHyM parameters affecting Graphic output Using CHyM Model (1) Add error(s) to CHyM code and check what happen Set TITLE “CHyM 4.66 – ICTP School” Set TITLE “CHyM 4.66 – ICTP School do ih=1,nsli call groundwater do ih=1,nsli hello call groundwater What you need to modify inside CHyM script CHyM: script set NLON = 300 set NLAT = 175 set SLON = 6.50 set SLAT = 43.80 # number of longitudes set DIJ = 0.020 # number of latitudes set DEMF = 3 # 1st longitude # 1st latitude NLAT SLON,SLAT NLON # lat-lon resolution # 1 Italy, 2 world, 3 both Where CHyM script parameters are listed? (0) http://cetemps.aquila.infn.it/mvlib/11.html It contains: A table with the list and the documentation of the utilities included in the chymlib.a library. You may want to use this tools to develop your application A table with the information contained in the header of CHyM output files A table with CHyM script parameters It will contain (next week): A link to this presentation A link to the kit to the updated CHyM model kit (chym.tar.gz) A link to the reference manual (we are writing it…) Where CHyM script parameters are listed? (1) Where CHyM script parameters are listed? (2) Where CHyM script parameters are listed? (3) CHyMLab utility (1) •Requires that NCAR Graphic libraries are installed on your platform and allows to produce different graphic output •Allows offline analysis of CHyM output file •Interactive and bach interface •Provided but not supported… error may occurr. Bugs will be fixed, check new versions often CHyMLab utility (2) If you have not the “current directory” in the path you have to have to Invoke the utility specifying the path, namely: ./chymlab tmp/00123100.chym CHyMLab utility (3) CHyMLab utility (4) CHyMLab utility (5) CHyMLab utility (6) CHyMLab utility (7) CHyMLab> plot riverbasin 44 CHyM code (1) CHyM code (2) Modify CHyM code (0) An example. Use of a different DEM. Two different approaches: 1. Just wait… we are planning to include a more resolute DEM (100 m) for all the world 2. …be patient… (remember the first slide of this presentation) 2a. Before to edit any file, understand what you have to do 2b. Look the CHyM code and understand where to modify 2c. Implement the code Modify CHyM code (1) Your data: LAT LON 41.50 30.20 ….. ….. Array dem inside CHyM code 100.5 Calculate i,j hsl (m) 100.5 …. Modify CHyM code (2) Modify CHyM code (3) Modify CHyM code (4)