1 / 78

MARS environment Sommaire (click on each chapter to go directly in)

Mars_Agrif2_V9.06 “MARS ENVIRONMENT’s manual” Valérie GARNIER, Sébastien THEETTEN (easier to consult this documentation activating slide (diaporama) in order to show links ). MARS environment Sommaire (click on each chapter to go directly in). Why this MARS environment

aldan
Download Presentation

MARS environment Sommaire (click on each chapter to go directly in)

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Mars_Agrif2_V9.06“MARS ENVIRONMENT’s manual”Valérie GARNIER, Sébastien THEETTEN(easier to consult this documentation activating slide (diaporama)in order to show links ) 1

  2. MARS environmentSommaire (click on each chapter to go directly in) • Why this MARS environment • What is the MARS environment • Setting up MARS environment • MARS requirements • List of useful commands • How to implement a new configuration • How to update a configuration • MARS environment : SUMMARY • Choice of CPP Keys • How to prepare parametrization before running • How to run a job • Run a job : SUMMARY • How to decompose domain for MPI purpose • How to use a test case • How to set a new test case • How to modify MARS - coding rules 2

  3. Why this MARS environment (1) Frequentlyobservedproblems • Difficulty in following MARS evolutionsled to different MARS codes ! • Numericaldevelopments and configurations must beperformedfollowing a few usualrules, otherwisetheygetlost MARS isusedthrough a workingenvironmentbased on C-shell scripts Goals • Management of MARS versions • Easiertracking of configuration changes • Easierkeeping up to date of configurations • Direct visualization of user’s modifications • Sharing of configurations • Saving of diskspace 3

  4. Why this MARS environment (2) Super-users • management and distribution (V. Garnier) • developments / evolutions (F. Dumas, V. Garnier, B. Thouvenin) • teaching and user’s help (S. Theetten) MARS code The complete MARS code (sources, namelist, environment, documentation and netcdf libraries) is located in a directory defined by the environment variable $HOMEMARS Users • Run the code for personal configuration or use test cases • Improve the code (numerical developments…) • Report encountered problems or needs • Follow code improvements, keep configurations up to date 4

  5. Retour au Sommaire Reference MARS environment (3) Reference MARS environmentisoriginallyderivedfrom utility named Drakkar Config Manager and developped by J. M. Molines and S. Theetten. Similarenvironments are usedwith MARS code, NEMO code (DRAKKAR projects and followings) and SYMPHONIE code (soon). 5

  6. What is the MARS environment (1) 3 directories (user) 3 scripts (user) • mkconfdir : create the directories of a configuration MARS_CONFIG : compilation / code modification • makefile : manage the configuration (choice of rank, test case, previous configurations), compile the code by calling : • Makefile.linux (or Makefile.caparmor) COMPILE_MARS : compilation directory, where the user must not go (otherwise user’s changes might be lost) RUN_MARS : run simulation, input and ouput files 6

  7. What is the MARS environment (2) The originial code (reference code) is placed in the Reference directory $HOMEMARS/.. (super user) which contains : MARS sources, Scripts of MARS environment, Makefile for the compilation, Input files as namelists and *.dat (river.dat, outflow.dat…) Documentation : manuals, faq Module example (fortran) Libraries (netcdf, io_netcdf) Code rules Retour au Sommaire $HOMEMARS/../ $HOMEMARS/ LIB Netcdf, io_netcdf.. EXAMPLES input files, Makefile.. DOC Manual, faq TOOLS bathy, connect, … Mars_Agrif2 Reference Sources code 7

  8. MARS environment : setting up (1) #------------------------------ #  MARS DEVELOPMENT ENVIRONMENT #----------------------------- setenv HOMEMARS /export/home11/mars/CODE_MARS/CODE_MARS_V9/V9.06/Mars_Agrif2 setenv UDIR /export/home/${USER}/MARS/MARS_CONFIG setenv CDIR /export/home/${USER}/MARS/COMPILE_MARS setenv RDIR /export/home/${USER}/MARS/RUN_MARS setenv HTTPSVNROOT https://forge.ifremer.fr/svn/mars3d setenvextranet_loginyours setenv PATH ${PATH}:$HOMEMARS/../TOOLS/MARSENV alias mkconfdir  "$HOMEMARS/../TOOLS/MARSENV/mkconfdir_caparmor“ alias mkconfdir_bisc  "$HOMEMARS/../TOOLS/MARSENV/mkconfdir_caparmor_bisc“ Directory where is the reference code Allow you to use commands useful to the setting up MARS Site gforge useful to update your MARS version Set your extranet_login name 1/Inside your .cshrc, add following environment variables and paths : 2/type :source .cshrc 8

  9. MARS environment : setting up (2) (bash use) If bash use, add following environmental variables and paths : 1/create a new file (env_MARS_V9.06 for instance) : #------------------------------ #  MARS DEVELOPMENT ENVIRONMENT #------------------------------ export HOMEMARS = /export/home11/mars/CODE_MARS/CODE_MARS_V9/V9.06/Mars_Agrif2 export UDIR=/export/home/${USER}/MARS/MARS_CONFIG export CDIR=/export/home/${USER}/MARS/COMPILE_MARS export RDIR=/export/home/${USER}/MARS/RUN_MARS alias mkconfdir=‘$HOMEMARS/../TOOLS/MARSENV/mkconfdir_linux’ alias getfile=‘$HOMEMARS/../TOOLS/MARSENV/getfile’ alias update=‘$HOMEMARS/../TOOLS/MARSENV/update’ 2/type :source env_MARS_V9.06 9

  10. MARS environment : setting up (3) 3/create the 3 directories necessary for MARS environment : # UDIR : type : mkdir /export/home/${USER}/MARS/MARS_CONFIG # CDIR : type : mkdir /export/home/${USER}/MARS/COMPILE_MARS # RDIR : type : mkdir /export/home/${USER}/MARS/RUN_MARS # CODE_MARS (if the reference MARS code is locally saved – not for IFREMER users) type : mkdir /export/home/${USER}/MARS/CODE_MARS 10

  11. MARS environment : setting up (4) Important remark • meant for research institutes, private societies or labtop use • IFREMER users have no need to duplicate the code under their account Step local setting up(not for caparmor users) • Get the code from mars3d projet under forge with the following command : svn –username $extranet_login checkout $HTTPSVNROOT/tags/V9.06 • cd V9.06/EXAMPLES • vi Makefile.linux : modify library paths of netcdf, io_netcdf. • (if make use, replace all ‘gmake’ by ‘make’ in makefile_env_linux or link gmake to make in your linux environment) Rq 1 : changes inside Makefile.linux (and makefile_env_linux) are the only ones allowed in CODE_MARS directory Rq 2 : no help from PHYSED if the source code has been modified 11

  12. MARS environment : setting up (5) Important remarks • MARS requires fortran compiler, netcdf4 library (netcdf4 requires hdf5 and zlib librairies) • MARS results are easily visualized with ferret (free) or matlab… • Library NCO is useful for files management For users working on caparmor : Return to sommaire Informations on Fortran, netcdf4, netcdf, click here 12

  13. MARS environment : local setting up (6) Fortran compiler setting up • Download free Intel Fortran compiler from http://www.intel.com/cd/software/products/asmo-na/eng/index.htm(a - register at « Free Non Commercial Download » to receive a number authorization by mail; b – choose ‘Intel Fortran Compiler Profressional Edition for linux’) • Installation from file /export/home/l_fc_p_10.X.XXX.tar.gz • If library stcd++ is missing : yum install libstdc++.so.5 • Set compiler environment : source /opt/intel/fce/10.X.XXX/bin/ifortvars.csh 13

  14. MARS environment : local setting up (7)Netcdf4 (1/3) We assume the netcdf4 library is installed under /export/home/logiciel/netcdf4 zlib library Create installation directory cd export/home/logiciel/netcdf4 ; mkdir install ; cd install Download of zlib-1.2.5.tar from http://zlib.net/ (get the sources and not the binaries) bunzip2 zlib-1.2.5.tar.bz2 ; tar xvf zlib-1.2.5.tar Installation 14

  15. MARS environment : local setting up (8)Netcdf4 (2/3) We assume the netcdf4 library is installed under /export/home/logiciel/netcdf4 hdf5 library Go to installation directory cd export/home/logiciel/netcdf4/install Download http://www.hdfgroup.org/ftp/HDF5/prev-releases/hdf5-1.8.6/src/hdf5-1.8.6.tar.gz(get the sources and not the binaries) gunzip file ; tar xvf file Installation 15

  16. MARS environment : local setting up (9)Netcdf4 (3/3) We assume the netcdf4 library is installed under /export/home/logiciel/netcdf4 netcdf4 library Go to the installation directory (cd export/home/logiciel/netcdf4/install) Download of netcdf-4.1.2.tar.gz from http://www.unidata.ucar.edu/downloads/netcdf/netcdf-4_1_2/index.jsp(get the sources and not the binaries) gunzip file ; tar xvf file Installation 16

  17. MARS environment : local setting up (10) IO_NETCDF library (to be compiled only if used by software other than MARS) Libionc4 is an interface between NetCDF4 and MARS (or other softwares). This library is developed by IFREMER/PHYSED and supplied with MARS under $HOMEMARS/../LIB/libionc4. It is a module of MARS software. • cd $HOMEMARS/../LIB/libionc4/src • ln -s $HOMEMARS/INC/comionc4.F90 • ln -s $HOMEMARS/PHYS/OUT/ionc4.F90 • Prepare directories • cd .. • ./install.csh (2 directories are created intel-seq and intel-mpi; the will store the library and the include files) • edit Makefile and modify • create the library : • gmake clean ; gmake Library libionc4.a is under $HOMEMARS/../LIB/libionc4/intel-XXX/lib module files comionc4.mod and ionc4.mod are under $HOMEMARS/../LIB/libionc4/intel-XXX/inc 17

  18. MARS environment : local setting up (11) File connexion This fortran code developed by IFREMER/PHYSED to gather MPI output files is supplied with MARS under $HOMEMARS/../TOOLS/CONNECT cd $HOMEMARS/../TOOLS/connect Modify the library paths in compile_cap Compile_cap The connect.exe is created under the directory $HOMEMARS/../TOOLS/connect. It will be automatically copied under $RDIR/CONF/CONF-CASE[/rank_X] 18

  19. MARS environment : local setting up (12) Domain cutting out executable (for MPI purpose) This fortran code has been developed by IFREMER/RIC to divide the regional model in X sub-domains. It is available in $HOMEMARS/../TOOLS/MPI2D_DOMAIN cd $HOMEMARS/../TOOLS/MPI2D_DOMAIN Modify the library paths in makefile make The ./run executable is created under the directory $HOMEMARS/../TOOLS/MPI2D_DOMAIN. A user manual is available from http://wwz.ifremer.fr/dyneco/Moyens-Outils/Logiciels/MARS/Documentation 19

  20. Retour au Sommaire MARS environment : local setting up (13) FERRET • Download files from http://ferret.pmel.noaa.gov/static/Downloads/ • Follow instructions of installation NCO tools : yum install nco nedit editor : yum install nedit 20

  21. MARS environment : commands (1/2) Useful commands • mkconfdir : creates all directories required for the implementation of a configuration (for more details of what mkconfdir does, click here) • gmake install : sets the reference code into the directory of compilation (for more details, click here) • gmake : compiles with user’s routines (for more details, click here) • gmake clean : cleans *.o and *.f • gmake cleaninst : empties the directory of compilation (useful when you want to remove a user’s routine) • gmake update ["OLDREV=XXX" "NEWREV=YYY"]: sets the reference code into the directory of compilationand updates user’s routines from revision XXX to revision YYY All these commands are launched from the directory MARS_CONFIG/conf/conf-case, location where the user prepares the code he will run. 21

  22. Retour au Sommaire MARS environment : commands (2/2) Useful commands • getfile WORK/routine.F90 : allows the user to modify the reference code source (for more details, click here) • rmfile routine.F90 : remove a filefrom MARS_CONFIG/CONF/CONF-CASE. (for more details, click here) • cmpfile routine.F90 : Easy way for making either a diff between a file in the MARS_CONFIG/CONF/CONF-CASE directory and the corresponding file in the HOMEMARS directory. (for more details, click here) All these commands are launched from the directory MARS_CONFIG/conf/conf-case, location where the user prepares the code he will run. 22

  23. MARS environmentmkconfdir commandcreates all directories required for the implementation of a configuration without rank (click here) with rank (click here) Usage : mkconfdir CONF CASE (number of ranks) 23

  24. Return Liste commands paramain.txt, paraspec.txt, paracom.txt, parasubs.txt, parasedim.txt, parabiolo.txt that allows the user to define the output files to run the executable to gather MPI output files (l_out_nc4par=.false.) Return new config MARS environmentmkconfdir command (without rank) mkconfdir CONF CASE (CONF for geographic configuration – CASE for one case of this configuration) $UDIR/CONF/CONF-CASE • 1. Create in $UDIR create empty directories copy the makefile and Makefile.caparmor files INC PHYS TRAJ BIOLO SEDIM SWAN AGRIF makefile The makefile file manages the MARS environment and calls to Makefile.caparmor for compilation Makefile.caparmor Makefile. where user chooses cpp keys and compiling option • 2. Create in $CDIR Create empty directory $CDIR/WCONF-CASE • 3. Create in $RDIR Create directories $RDIR/CONF/CONF-CASE$RDIR/CONF/inputs • default namelist files • output.dat file • script and batchs • batch_connect and connect.exe files - examples of files *.dat to give the formats of the files managing rivers, outflows, variables, trajectories… + example of head.CONF file 24

  25. MARS environmentmkconfdir command (with rank) mkconfdir CONF CASE 3 (if X=3 ranks) (CONF for geographic configuration – CASE for one case of this configuration) Return Liste commands paramain.txt, paracom.txt paraspec.txt, parasubs.txt…. allows the user to define the output files to run the executable to gather MPI output files (l_out_nc4par=.false.) Return new config $UDIR/CONF/CONF-CASE • 1. Create in $UDIR create empty directories copy the makefile and Makefile.caparmor files INC PHYS TRAJ BIOLO SEDIM SWAN AGRIF makefile_rankX The makefile file manages the MARS environment and calls to Makefile.caparmor for compilation Makefile.caparmor_rankX Makefile. where user chooses cpp keys and compiling option • 2. Create in $CDIR Create empty directory $CDIR/WCONF-CASE • 3. Create in $RDIR Create directories $RDIR/CONF/CONF-CASE $RDIR/CONF/inputs $RDIR/CONF/CONF-CASE /rank_0, rank_1 et rank_2 each contains : • default namelist files - examples of files *.dat to give the formats of the files managing rivers, outflows, variables, trajectories… • default namelist files • output.dat file • script and batchs • batch_connect and connect.exe files + example of head.CONF file 25

  26. Return Liste commands All routines are available from WORK directory But NEVER go or work directly under this WORK directory Return new config MARS environmentgmake install command The setting up (user’s modification of the code, compiling) of the configuration is done from directory $UDIR/CONF/CONF-CASE Usage : cd $UDIR/CONF/CONF-CASE gmake install • This command copies the reference MARS code in $CDIR/WCONF-CASE • And creates a link to the directory WORK in $UDIR/CONF/CONF-CASE CODE_MARS Reference ($HOMEMARS) COMPILE_MARS/WCONF-CASE Reference code MARS_CONFIG/CONF/CONF-CASE/WORK In WORK : all MARS routines – as link to $CDIR 26

  27. MARS environmentExecution : gmake This command prepares the code, compiles it and copy the executable to $RDIR Return Liste commands COMPILE_MARS/WCONF-CASE Reference code + modified user’s routines MARS_CONFIG/CONF/CONF-CASE User’s routines smallf90 is a link $CDIR, NEVER work under this directory smallf90 In smallf90, the user can see all routines used when compiling (after pre-processing) RUN_MARS/CONF-CASE/CASE(rank*) Executable (mars_exe) Return new config Usage : cd $UDIR/CONF/CONF-CASE gmake • Copy modified user’s routines in $CDIR +executable exe smallf90 smallf90 • Creates smallf90 directory • Compiles the code to get the executable (exe => mars_exe in $RDIR) 27

  28. Return Liste commands After the modification of the routine by the user You have to compile the code again by gmake which takes into account the modified routine Return new config MARS environmentExecution : modification of the reference code source Usage : cd $UDIR/CONF/CONF-CASE getfile WORK/routine.F90 • gets a routine and saves it at the correct location in MARS_CONFIG/CONF/CONF-CASE. • Then, this routine can be modified by the user directly from the directory MARS_CONFIG/CONF/CONF-CASE. (links are automatically made) 28

  29. MARS environmentremove a file modified by user and back to reference After asking for confirmation (twice), it deletes the local link to routine.F90 and moves the file from its actual position to the .trash directory (this directory is created if it doesn't exist). It is the user responsability to empty the .trash directory ! Return Liste commands Usage : cd $UDIR/CONF/CONF-CASE rmfile routine.F90 • Remove a filefrom MARS_CONFIG/CONF/CONF-CASE • Restore the removed file from the REFERENCES (HOMEMARS,REF_CONFIG), 29

  30. MARS environmentvisualize differences between user’s routine and reference code Return Liste commands Usage : cd $UDIR/CONF/CONF-CASE cmpfile routine.F90 Easy way for making either a diff between a file in the MARS_CONFIG/CONF/CONF-CASE directory and the corresponding file in the HOMEMARS directory. • Default option launches tkdiff wheter -t option produces a diff -bic listing. • It can be used as template for personnal improvement. 30

  31. Retour au Sommaire MARS environmentnew configuration • New configuration without rank • New configuration with ranks • New configuration using (copying) an other configuration (PREV_CONFIG) • New configuration recovering an other configuration updated by an other user (REF_CONFIG) WITHOUT RANK • New configuration recovering an other configuration updated by an other user (REF_CONFIG) WITH RANKS • Usage of PREV_CONFIG and REF_CONFIG • Before compilation : choice of CPP Keys (list) • After compilation and before running 31

  32. MARS environmentnew configuration without rank The rank_0 does not supply the rank_1 with open boundary conditions ssh -X -l username caparmor (connection to caparmor ) mkconfdirMENOR V9.06 (create directories for your configuration (here CONF= MENOR, CASE= V9.06) cd …(follow the screen directive) (go in the directory $UDIR/CONFIG/CASE) gmake install(install the code for your configuration) vi Makefile.caparmorand choice of CPP keys, compilation option getfile WORK/parameters.F90 and change specific parameters to your configuration gmake(compilation) modification of the code by the user : getfileWORK/routine.F90 modification of routine.F90 gmake Return new configuration list 32

  33. MARS environmentnew configuration with ranks The rank_0 supplies the rank_1 with open boundary conditions (SSH) ssh -X -l username caparmor (connection to caparmor ) mkconfdirMENOR V9.06 4 (for ranks 0, 1 ,2 et 3) (create directories for your configuration (here CONF= MENOR, CASE= V9.06, 4 ranks) cd …(follow the screen directive) (go in the directory $UDIR/CONFIG/CASE) gmake install (install the code for your configuration) vi Makefile.caparmor_rankXand choice of CPP keys, compilation option for each rank getfile WORK/parameters.F90_rank0 cp INC/parameters.F90_rank0 INC/parameters.F90_rank1, cp INC/parameters.F90_rank0 INC/parameters.F90_rank2 ... modification of INC/parameters.F90_rank* (no=, nrac=,imax=,jmax=,kmax=) vi makefile and change rank=0,1 or 2 in order to compile the code for this rank gmake clean ; gmake(compilation) Return new configuration list 33

  34. MARS environmentwhy variables REF_CONFIG et PREV_CONFIG (1/2) PREV_CONFIG (with gmake copyconfig) • During the evolution of a configuration, the creation of a new configuration CONF-CASE and the use of “gmake copyconfig” • allows to get exactly the same code as in configuration PREV_CONFIG (‘gmake copyconfig’ command copies user’s routines and Makefile.linux(or .caparmor) from directory PREV_CONFIG to $UDIR/CONF/CONF-CASE) • allows to keep a saving of configuration PREV_CONFIG • This command is used when updating a configuration with a new version of the reference code (the user get directly the routines he may have to update) REF_CONFIG • Useful when several users use the same configuration • Only one user is in charge of updating the REF_CONFIG configuration • At each evolution of the reference MARS code, other users have to update their owns routines only • Routines of directory REF_CONFIG are directly copied from REF_CONFIG directory to the compiling directory : the user does not see them in $UDIR/CONF/CONF-CASE but he uses them 34

  35. Return new configuration list MARS environmentRemarks on variables REF_CONFIG et PREV_CONFIG (2/2) PREV_CONFIG and REF_CONFIG • The variables PREV_CONFIG and REF_CONFIG allow to manage the code but not the input files : they have an influence in directory $UDIR/CONF/CONF-CASE only • The user must copy namelists paraspec.txt, paramain.txt, paracom.txt, parasubs.txt, parasedim.txt and parabiolo.txt (+ output.dat file and mpi.txt) relative to the configuration PREV_CONFIG or REF_CONFIG PREV_CONFIG • Makefile.linux files is copied from PREV_CONFIG directory –> update the path in INCDIR and CPP variables REF_CONFIG • Makefile.linux is not changed –> the user has to change it in order to use the same cpp keys and the same compiling options as the ones used in REF_CONFIG directory 35

  36. MARS environmentRecovery of a previous configurationuse of variable PREV_CONFIG in makefile ssh -X -l username caparmor (connection to caparmor ) mkconfdirMENOR V9.06 [3] (3if ranks) (create directories for your configuration (here CONF= MENOR, CASE= V9.06, 3 ranks) cd …(follow the screen directive) (go in the directory $UDIR/CONFIG/CASE) gmake install (install the code for your configuration) vi makefile : PREV_CONFIG =/export/home11/mars/CONFIG/MENOR/MARS/MARS_CONFIG/MENOR/MENOR-V9.06 (choose the name of the configuration you want to copy … without any blank at the end of the line) gmake copyconfig (Rk : all user’s routines of MENOR-V9.06 are copied to the configuration). vi Makefile.caparmor[_rankX] update the file(if new cpp key or routines have been introduced in a new version of the reference code ) (compare with Makefile.caparmor_ref) vi makefile and change rank=0,1 or 2 in order to compile the code for this rank (gmake clean ); gmake(compilation) (To make sure you have the same code, compare smallf90 directory with PREV_CONFIG/smallf90 directory) Return new configuration list Click for summary of what PREV_CONFIG is doing 36

  37. $UDIR/CONF/CONF-CASE makefile Makefile.caparmor[_rankX] tree of the reference code $RDIR/CONF/CONF-CASE Return new configuration list link WORK link compilation smallf90 MARS environment (PREV_CONFIG summary) $HOMEMARS (reference code) mkconfdir CONF CASE (rank) gmake install gmake copyconfig gmake OLD_CONFIG (configuration to be used) $CDIR/WCONF-CASE reference code PREV_CONFIG = OLD_CONFIG (makefile) OLD_CONFIG routines user’s routines user’s routines of OLD_CONFIG Makefile.caparmor[_rankX] user’s routines mars_exe Verification : diff WORK OLD_CONFIG/WORK ; diff smallf90[_rankX] OLD_CONFIG/ smallf90[_rankX] 37

  38. MARS environmentRecovery of a previous configuration (without rank)use of variable REF_CONFIG in makefile ssh -X -l username caparmor (connection to caparmor ) mkconfdirMENOR V9.06 (create directories for your configuration (here CONF= MENOR, CASE= V9.06) cd …(follow the screen directive) (go in the directory $UDIR/CONFIG/CASE) vi makefile : REF_CONFIG =/export/home11/mars/CONFIG/MENOR/MARS/MARS_CONFIG/MENOR/MENOR-V9.06 (choice the name of the configuration you wants to copy … without blank at the end of the line) vi Makefile.caparmor Choose the same compiling options and cpp keys… as those in REF_CONFIG/Makefile.caparmor If ranks : cp REF_CONFIG/INC/parameters.F90_rank* INC/. If test case : cp REF_CONFIG/INC/parameters.F90_casXXX INC/. gmake install(install the code for your configuration) gmake(compilation) (To make sure you have the same code, compare smallf90 directory with REF_CONFIG/smallf90 directory) Return new configuration list Rk : all user’s routines of MENOR-V9.06 are compiled but they are not copied in your directory $UDIR/CONF/CONF-CASE. NEVER ERASE DIRECTORY REF_CONFIG !!!!! 38

  39. MARS environmentRecovery of a previous configuration (with rank)use of variable REF_CONFIG in makefile ssh -X -l username caparmor (connection to caparmor ) mkconfdirMENOR V9.06 2 (create directories for your configuration (here CONF= MENOR, CASE= V9.06, 2 ranks) cd …(follow the screen directive) (go in the directory $UDIR/CONFIG/CASE) vi makefile : REF_CONFIG= /export/home1/vgarnier/MARS_CONFIG/calv/calv-V9.06 (choice the name of the configuration you wants to copy … without blank at the end of the line) get routines parameters.F90 of each rank cp /export/home1/vgarnier/MARS_CONFIG/calv/calv-V9.06/INC/parameters.F90_rank* INC/. vi Makefile.caparmor_rankX Choose the same compiling options and cpp keys… as those in REF_CONFIG/Makefile.caparmor gmake install(install the code for your configuration) vi makefile (change RANK =) ; gmake clean;gmake(compilation of each rank) Return new configuration list Rk : all user’s routines of MENOR-V9.06 are compiled but they are not copied in your directory $UDIR/CONF/CONF-CASE. NEVER ERASE THE REF_CONFIG DIRECTORY !!!!! 39

  40. Return new configuration list MARS environment (REF_CONFIG summary) $UDIR/CONF/CONF-CASE makefile Makefile.caparmor[_rankX] tree of the reference code $RDIR/CONF/CONF-CASE $HOMEMARS (reference code) mkconfdir CONF CASE (rank) gmake install gmake OLD_CONFIG (configuration to be used) $CDIR/WCONF-CASE reference code REF_CONFIG = OLD_CONFIG (makefile) user’s routines OLD_CONFIG routines user’s routines cp OLD_CONFIG/Makefile_caparmor[_rankX] . (modify INCDIR,CPP) cp OLD_CONFIG/parameters.F90_rank* INC/. mars_exe Verification : diff WORK OLD_CONFIG/WORK ; diff smallf90[_rankX] OLD_CONFIG/ smallf90[_rankX] 40

  41. MARS environment : Update of a configuration (1) change the number of reference code version in .cshrc.caparmor (or env_MARS_VX.XX) setenv HOMEMARS /export/home11/mars/CODE_MARS/CODE_MARS_V9/V9.06/Mars_Agrif2  Verify you have in .cshrc.caparmor : setenv HTTPSVNROOT https://forge.ifremer.fr/svn/mars3d setenv extranet_loginyours (Set your extranet_login name)  Run .cshrc.caparmor typing : source .cshrc.caparmor 41

  42. MARS environment : Update of a configuration (2) create a new configuration: mkconfdirMENOR V9.06 (CONFIG=MENOR, new case or new version : V9.06) cd ... (follow the screen directive) gmake install(install the code for your configuration – useless if you update with subversion) vi makefile : PREV_CONFIG = /export/home1/vgarnier/MARS_CONFIG/MENOR/MENOR-old gmake copyconfig vi Makefile.caparmor[_rankX] : update if new cpp key or routines have been introduced in the new version(compare to Makefile.caparmor_ref) update user's routines without SubVersioN use click here or with SubversioN use: click here WARNING : No gmake at this step 42

  43. MARS environment : Update of a configuration (2) [without SubVersioN use] update user's routines without SubVersioN use a - notice which user’s routines has been modified in reference MARS code (the list of modified routines is published at each new version – or compare the routines between the old and the new $HOMEMARS) b – visualize the modifications introduced by the user vimdiff WORK/routine.F90 $HOMEMARS/../Mars_Agrif2_old/...../routine.F90 c - visualize the modifications introduced into the new reference version in comparison to the old reference version vimdiff $HOMEMARS/../Mars_Agrif2_XXX/...../routine.F90 $HOMEMARS/../Mars_Agrif2_old/...../routine.F90 43

  44. MARS environment : Update of a configuration (3) [without SubVersioN use] d - 2 cases 1st case : the number of modifications introduced by the user is small ---> getfile WORK/routine.F90 (get the routine of the new reference code because the code has not been compiled yet) ---> introduce user’s modifications 2nd case : the number of modifications introduced by the user is larger that the number of modifications introduced into the new reference code ---> introduce modifications of the new reference code into the user’s routine choice CPP Keys (in Makefile_caparmor) thengmake cd $RDIR/CONF/CASE (click here to continue) 44

  45. MARS environment : Update of a configuration (2’) [with SubVersion] install and update user's routines gmake update "OLDREV=XXX" "NEWREV=YYY" (check the number into $HOMEMARS/../DOC/list_version -FIRST COLUMN- ) [vi $HOMEMARS/../DOC/list_version to get XXX YYY relative to the old and new versions] this command updates all the routines of the current tree from an old revision XXX to the current one YYY using SubVersioN (you need a client of SubVersioN installed on your machine. Available under caparmor for all the users) resolve conflicts for routines described by “C” a –open 3 windows b –windows 1 : visualize modifications introduced by the user in old version Setenv HOMEMARS /export/home11/mars/CODE_MARS/V7.71 (only in this window) Cmpfile routine.F90 b –windows 2 : visualize modifications introduced into the new reference version by comparison to the old reference version vimdiff $HOMEMARS/...../routine.F90 /export/home11/mars/CODE_MARS/V7.71/Mars_Agrif2/…/routine.F90 c –windows 3 : correct user’s changes taking care of the modifications added in the reference code. Delete warning comments relative to the merge (<<<<.working ; >>>>.merge.right.rXXX ; >>>>>>.merge.left.rXXX) Cmpfile routine.F90 choice CPP Keys (in Makefile_caparmor) thengmake cd $RDIR/CONF/CASE 45

  46. Return new configuration list MARS environment : Update of a configuration (4)  update files paramain.txt… under $RDIR/CONF/CONF-CASE  Run the new configuration and the old one in sequential with no optimization option de compilation (FLAG = -r8 –O0) The update is finished and secured • If you get exactly the same results (all digits) when you compare files named “listing”, files that contain maximum velocities at different time steps, • Otherwise, if you can explain differences. Consequently, you need to get exactly the same results before introducing the corrections or evolutions that modify results. These corrections/evolutions are listed in the file list_modif_V6 supplied at each new version. 46

  47. MARS environment (summary) mkconfdir CONF CASE (rank); gmake install; gmake; getfile WORK/casvortex.F90 $UDIR/CONF/CONF-CASE makefile Makefile.caparmor[_rankX] tree of the reference code INC; PHYS/*; BIOLO; TRAJ; SEDIM; SWAN; .. WORK/all the routines of the reference code (link to $CDIR) Version (contains used $HOMEMARS) (edit makefile and choose the RANK or test case) (edit Makefile.caparmor[_rankX] and choose CPP keys and compiling options) smallf90[_rankX] (link to $CDIR) PHYS/KTEST/casvortex.F90 casvortex.F90 (link to PHYS/KTEST/casvortex.F90) edit and modify casvortex.F90, then compile $CDIR/WCONF-CASE copy of the entire reference code WORK contains all the routine (links to PHYS/*…) smallf90[_rankX] contains all the compiled routines after preprocessing 47

  48. Retour au Sommaire MARS environment (summary) $RDIR/CONF/CONF-CASE namelists : paramain.txt, paraspec.txt, paracom.txt, parasubs.txt,parasedim.txt,parabiolo.txt output.dat batch_seq, batch_omp, runmpi_connect (which uses batch_mpi and batch_connect(bydate) ), runmpt_connect… mpi.txt (for MPI purpose) mars_exe Before running, the user has to : • define all the parameters in the different namelist (para*) • under inputs directory, define head.CONF • under inputs directory, add the input files (like bathymetry, initial condition, open boundary conditions…) • under inputs directory, define all default .dat files read by the simulation (ex river.dat) 48

  49. Before compilation – choice of CPP keys (1/5) In Makefile.caparmor : add CPP_keys in CPPFLAGS = FORMAT BATHY FILE TO READ -Dkey_bathy_final to read definite bathymetry in netCDF format file (no more changes) TIDES - choice of harmonic components -Dkey_tide_schwid schwiderski model (1980), modele de pg Islande-Portugal (5 km) (on progress) -Dkey_tide_fes2004 FES 2004 -Dkey_tide_shom CST -Dkey_tide_lagoon lagoons of Banuyls and Marseilles -Dkey_tide_lagoon_marseille tide for Marseilles -Dkey_tide_lagoon_banyuls tide for Banyuls MOMENTUM NON LINEAR TERMS default centered -Dkey_dyn_adv_quick QUICK -Dkey_dyn_adv_quickest QUICKEST -Dkey_dyn_adv_linear no nonlinear terms PRESSURE GRADIENT default pressure jacobian -Dkey_dyn_pg_djcs Shchepetkin et al. 2004 WET DRYING -Dkey_dyn_wetdry_fct use of Flux Corrected Transport to correct ssh and velocity estimates and keep positive water depths 49

  50. Before compilation – choice of CPP keys (2/5) In Makefile.caparmor : add CPP_keys in CPPFLAGS = TRACER ADVECTION (xy direction) default Quick / Euler-Upwind scheme -Dkey_tssub_adv_ultimatequickest quickest scheme (xy direction) + ultimate limiter -Dkey_tssub_adv_ultimatequickestmacho quickest scheme (xy direction) + ultimate limiter + multidimensional extension macho -Dkey_tssub_adv_fourthorder fourth order centred scheme (xy direction) (along z) default centered scheme -Dkey_tssub_wquickupwind QUICK scheme along the vertical (tracer advection) -Dkey_tssub_wcompact Upwind Compact and Conservative scheme along the vertical TRACER DIFFUSION default along sigma -Dkey_ts_diffh_geo along geopotential -Dkey_ts_diffh_rho along isopycnes 50

More Related