\chapter{Introduction}
This manuscript describes the version of HYCOM use at NERSC. HYCOM has been used in NERSC for the past 15 years, starting from MICOM and then moving to HYCOM following the development made within the community. The NERSC version of HYCOM had significantly drifted away from the standard version of HYCOM and used different methods for: nesting, tidal boundary, ice modelling and thermodynamics and forcing field.
In 2008, Knut Arild Lis\ae ter initiated a convergence of the NERSC code towards the standard one developed at Stenis. In the present version of NERSC HYCOM the main discrepancies are in: the coupled ice modelling (EVP, MIZ, MIZ+waves, ICESTATE), different way to handle atmospheric forcing fields, allow for running perturbed ensemble run, different river forcing methodology, coupling with NORWECOM ecosystem model ...
Last but not least, the code is developed to allow a user friendly usage of the HYCOM code. Numerous scripts, allows you to set up a model grid without to ''dig" into the code and set up the code easily. This effort is highly indebted to Knut Arild Lis\ae ter, which developed most of the utility routines and drafted the first version of this document. The effort is currently continued by Francois Counillon, and others - Annette Samuelsen, Vincent Vionnet, Dany Dumont, Intissar Keghouche and Laurent Bertino to name a few. 
All the code developed at  NERSC is separated from the main HYCOM code (when it is not possible CPP FLAGS are used) so that it is easy to maintain our code up-to-date with the most recent version of the HYCOM community.
Currently the most recent version of the code is 2.2.37, which is the latest available. 

\chapter{Subversion: svn}
Subversion is a useful tool, to maintain community code. It allows several persons to work on the code at similar time. It is possible to only update a small part of the code but to avoid conflict, you cannot update a file if it is not initially based on the most recent version of the code. You can also check the difference, or the status of each bit of your code. The NERSC Version of HYCOM is put on the nersc server. The svn is accessible to everyone, so if you get trouble to access it, you should contact us. To retrieve the code you need to install the program subversion.
On hexagon, the program is already installed and all you have to do is to load the module, type:\\
module load subversion\\
To retrieve the whole NERSC-HYCOM code and utilities, type the following command:\\
\file{svn checkout https://svn.nersc.no/repos/hycom/ .}\\
You will get a hycom folder that contains four subfolders: HYCOM\_2.2.12 and  HYCOM\_2.2.37 and MSCPROGS Doc.  The latter corresponds to the latex folder that has been used for creating this pdf. HYCOM\_2.2.12 and  HYCOM\_2.2.37 corresponds to the two latest versions of the NERSC-HYCOM code that have been merged with the standard hycom. MSCPROGS contains utility routines developed at the Mohn Sverdrup Center to plot, compute diagnostic or help setting up a model configuration. Among this two versions of HYCOM available, it is hard to recommended one of them. The most recent often offers newer appealing scheme and proposes correction of older bugs, while the older one is better tested and thus ``safer".
The writing permission is restricted to few editors, so that you wont be able to commit changes yourself. If you notice a bug that need to be correct you may contact us (francois.counillon@nersc.no) or (Annette.samuelsen@nersc.no) if it is part of the ecosystem model.\\
We would also be very pleased to have more contributors to this code so if you are interested you may be given an administrator account.\\
In the following we give you some useful command:
\begin{itemize}
\item to update you code, type:\\
\file{svn update}\\
This will update all the part of your code that has not been modified.
\item To status of your code, type:\\
\file{svn status}\\
This will return a list of the files that differ from the one saved in the svn. ``!" will be reported if the file from the svn is missing, ``?" is used if the file is not present in the svn, and ``M" is used if the file has been modified.
\item To add a file or a folder into the svn, type:\\
\file{svn add $<$filename$>$}
\item To remove a file or a folder from the svn, type:\\ 
\file{svn delete $<$filename$>$}
\item To use an older version of the code type:\\
\file{svn update -r  $<$version\_number$>$}
\item To commit a change on the svn, tyoe:\\
\file{svn ci -m ''Text explaining the change briefly" $<$files or dir$>$}
\end{itemize}
Please not that it is not possible to copy a folder from svn and call it differently because svn add a lot of .svn folder into each directory. To remove the annoying .svn file, you can use the following command:\\
\file{find $<$initial\_folder $> |$ grep -v '/$\setminus$.' $|$ $<$destination\_folder$>$}\\
This will copy the intial\_folder into destination folder without copying the .svn dir.\\


The svn is also combined with a program call Trac. This allows you to browse the code, check the wiki of the code,  the Timeline of the change (you can visualise the change, search for a key word, ...)  on the following website:\\
\file{https://svn.nersc.no/hycom/timeline} \\
There is also a section called ticket, this corresponds to known bug in the code, that are not yet solved, but we have not got the time to solve it.

