== Compilation instructions == 1. Extraction of the source code: {{{ $ svn co http://svn.lmd.jussieu.fr/LMDZ_WRF/trunk LMDZ_WRF }}} 2. Copy (not int the repository folder...) folder `WRFV3` to the desired spatial resolution (F77 legacy). As example one for 80x90x39. There are two possible ways: 1. check out in ${WORKDIR} only the WRFV3 folder from the repository and make a local copy of the file `dimensions.orig.h`: {{{ $ svn co http://svn.lmd.jussieu.fr/LMDZ_WRF/trunk/WRFV3 ${WORKDIR}/WRFV3_80x90x39 $ cp ${WORKDIR}/WRFV3_80x90x39/lmdz/dimensions.orig.h ${WORKDIR}/WRFV3_80x90x39/lmdz/dimensions.h }}} 1. Make a simbolic link in ${WORKDIR} and make a local copy of the file `dimensions.orig.h`: {{{ $ ln -s LMDZ_WRF/WRFV3 ${WORKDIR}/WRFV3_80x90x39 $ cd ${WORKDIR}/WRFV3_80x90x39 $ rm lmdz/dimension.h $ cp LMDZ_WRF/WRFV3/lmdz/dimensions.orig.h ${WORKDIR}/WRFV3_80x90x39/lmdz/dimensions.h }}} 3. Go to the `${WORKDIR}` and compile there {{{ $ cd ${WORKDIR}/WRFV3_80x90x39 }}} 4. Define domain size for LMDZ editing file `lmdz/dimensions.h` (see documentation for more details) {{{ $ cat lmdz/dimensions.h INTEGER iim,jjm,llm,ndm,wiim,wjjm,wbdym PARAMETER (iim= 1, jjm=7031, llm=38,ndm=1,wiim=79,wjjm=89,wbdym=5) }}} jjm = (dimx-1) * (dimy -1) [[br]] llm = (dimz - 1) [[br]] wiim = dimx - 1 [[br]] wjjm = dimy - 1 [[br]] wbdym = 5 (up to now, mandatory to run WRF with 5 grid points in the sponge zone) [[br]] 5. run script `tools/prepare_compilation.bash` ('-h', for help. copy netCDF libraries and other staff not automatized) {{{ $ ./prepare_compilation.bash [WRF_LMDZsrc] [NETCDFhome] ${WORKDIR}/WRFV3_80x90x39 }}} 6. prepare compilation (ready for 'lmd' machines in serial, `$cp configure.serial_lmdz2wrf.lmd.wrf configure.wrf`) if not, edit 1. `$ ./configure ` 1. add pre-compiler flag `-DLMDZ` after `-DNETCDF` (inside `configure.wrf`) 1. modify `lmdz/Makefile` with that values from the `configure.wrf` 7. prepare compilation modifying Registry files (already done, have a look just in case): 1. `$ ls -lrta Registry/Registry.EM` {{{ Registry/Registry.EM -> Registry.EM.LMDZ }}} 1. $ `ls -lrta Registry/registry.dimspec` {{{ Registry/registry.dimspec -> registry.dimspec.lmdz }}} 8. Compile as usual {{{ $ export WRFIO_NCD_LARGE_FILE_SUPPORT=1 $ compile em_real >& compile.log }}} 9. Compile manually a lmdz subroutine (not working, not knowing why). Example with gfortran serial in lmdz machines {{{ $ cd lmdz $ gfortran -O3 -ftree-vectorize -ftree-loop-linear -funroll-loops -w -ffree-form -ffree-line-length-none -fconvert=big-endian -frecord-marker=4 -fconvert=big-endian -frecord-marker=4 -O3 -ftree-vectorize -ftree-loop-linear -funroll-loops -w -ffree-form -ffree-line-length-none -fconvert=big-endian -frecord-marker=4 -g -O0 -fbacktrace -Wall -fbounds-check -c -L/u/lflmd/bin/gcc_netcdf-4.3.0/lib -lnetcdf -lnetcdff -I/u/lflmd/bin/gcc_netcdf-4.3.0/include lmdz_wrf_variables_mod.f90 $ cd .. }}} 10. run script for second time `tools/prepare_compilation.bash` {{{ $ ./prepare_compilation.bash [WRF_LMDZsrc] [NETCDFhome] ${WORKDIR}/WRFV3_80x90x39 }}} 11. Recompile as usual {{{ $ compile em_real >& compile.log }}} 12. Checking compilation (empty outputs) * `$ cat -n compile.log | grep Error` * `$ cat -n compile.log | grep Erreur` (just in case you are in a French speaking computer) 13. Running simulation 1. Run all the steps `WPS` and `real.exe` as usual 1. folder `WRFV3/run` is not completed (no binaries in repository!), thus get a copy of the right WRF version and use the original source ( here [[attachment:WRFV3.3_run.tar.gz]] a compressed copy of the folder for WRFV3.3) 1. Make a local copy of `namelist.input.orig` as `namelist.input` and modify it 1. Add all the LMDZ *def files provided in `WRF/run` folder: `config.def`, `gcm.def`, `physiq.def`, `run.def`, `traceur.def` 14. You're done, Have fun!