How to install an compile harmonie_MUSC and run a simple test ============================================================= LR 21.11.2011 laura.rontu@fmi.fi harmonie_MUSC setup during the working days is based on 1) code built by Sami Saarinen based on cycle 37h1 and package 37t1_bf.01.GFORTRAN442.x.tar.gz and local.tar.gz by Eric Bazile. 2) an ARPEGE-based MUTEST test case from Eric Bazile with initfile_25_L70 : is the initfile (ICMSH type) namus_37t1_ARPEGE : namelist 3) ddh_toolbox by Meteo France, with documentation and tools + a script lfa2ascii to handle output, originally x.sh, by Eric Bazile 4) utilities to compose MUSC input, either based on Meteo France code: acadfa_exe, pgd_exe, prepsurf_exe or HARMONIE gl by Ulf Andrae et al. 5) scripts mur, Runmusc, Putin2MUSC.sh, lfa2ascii.sh to be applied in users home directory 6) Harmonie gl-toolbox to work with different file formats 7) (later: graphics tools to be applied to ASCII output from MUSC) harmonie_MUSC and test experiment are preliminary! Most notably, connection with SURFEX is not yet there. You can obtain the 37t-based MUSC code with the command svn co https://svn.hirlam.org/branches/harmonie_MUSC You will get everything needed for running MUSC, tools for input and output, and the test case files. You might give this command in a reference directory, e.g. /home/hirlam/, to get the reference code under /home/hirlam/harmonie_MUSC. This is to make sure you will not unintendly edit the reference code but play with experiments in your own working directory /home/$USER/musc . 1. Compile the reference code using makeup: First please check you have needed software in your computer. You will need gcc and gfortran > v. 4.4, mpi libraries (e.g. in Debian libmpich2-dev), lapack-blas library (e.g. in Debian liblapack-dev), ksh, flex, bison. Please ask your systems package installation tool to bring these to you, e.g. in Debian or Ubuntu 'apt-get install bison' etc. There are MUSC configurations for debian, ubuntu, redhat gfortran, work with fedora has been started. The configuration files are in util/makeup . Next, build the code: cd /home/hirlam/harmonie_MUSC util/makeup/build config.debian.gfortran This will produce the main executable file /home/hirlam/harmonie_MUSC/bin/MASTER, which can be later linked to your experiment. In addition, several utilities will be compiled and added to the same directory. You will need DDH toolbox. Compile it separately: cd /home/hirlam/harmonie_MUSC/util/ddhtoolbox/tools sh ./install.sh Please find documentation of toolbox usage in /home/hirlam/harmonie_MUSC/util/ddhtoolbox/documentation. 2) The test data for your experiment are in the package musctest.tgz. Please open it in your own home directory: cd cp /home/hirlam/harmonie_MUSC/musctest.tgz . tar xvfz musctest.tgz and copy also the reference scripts: cd musc cp -r /home/hirlam/harmonie_MUSC/scr . cp scr/mur $HOME/bin/ 3) Please check the scripts mur and Runmusc for the directory definitions and usage alternatives! Now you are ready to say: scr/mur MUTEST The script 'mur' will set your experiment environment and bring you to the new experiment directory $HOME/musc/EXP/MUTEST. It is also called $MU_WD for your convenience. With the test package, you already got test data to your new $MU_WD. 'mur' creates a defitinion file tool.path and advises you to run it as '. ./tool.path' to make utilities and scripts available in your $PATH. Do not forget to do as advised! In $MU_WD you should say ./Runmusc > musc.log to run Eric's test case and use the ddh tools with Eric's script lfa2ascii.sh to convert main output files to ASCII. You can have a look at them or try something. However, we are working with the next step, i.e. visualisation tools for the lot of ASCII files of the instant and accumulated profiles or different variables. You might want to produce your own atmospheric column for MUSC input, instead of the initfile provided by the test package. For this, gl -l -n naminterp_fa ICMSHHARM+0006_aladin (you should have got naminterp_fa and ICMSHHARM+0006_aladin with the test package, newest version!). gl should produce you a file ICMSHHARM+0006_aladin.fa, which is ready for input to your experiment. Not that gl should be the one recently compiled in $refmusc/bin! Please copy the reference Runmusc to Runmusc_testinput and modify it by changing klev value as needed (command 'gl -l ICMSHHARM+0006_aladin | grep lev' gives the needed number). 'chmod 755 Runmusc_testinput' and ./Runmusc_testinput. And yes, copy the ICMSHHARM+0006_aladin.fa to a file with the name Runmusc_testinput expects. Check the directory OUTPUT for new files. Works? Got the idea? By the way, it might be in the future better to create a directory $MU_WRK/muscin and go there for input preparation, to avoid extra mess with the files. Later, you might study the script 'mur' to understand its options. You can modify harmonie_MUSC source codes in your $MU_WD. For example, to modify apl_arome.F90 in an experiment called MY01 you do this: mkdir -p src/arp/phys_dmn cp $refmusc/src/arp/phys_dmn/apl_arome.F90 src/arp/phys_dmn cd src/arp/phys_dmn [modify apl_arome.F90 as wanted, save] cd $MU_WD mur MY01 recompile Your modifications will be copied over the reference code in $MU_WRK/lib/src/arp/phys_dmn and compiled. After successful compilation, you can again say ./Runmusc and see the results. Please note that if you indeed modified apl_arome.F90, you will see no difference with the testset MUTEST because it does not use AROME!