\contentsline {chapter}{\numberline {1}Introduction}{1}{chapter.1} \contentsline {chapter}{\numberline {2}Subversion: svn}{3}{chapter.2} \contentsline {chapter}{\numberline {3}Model Setup}{5}{chapter.3} \contentsline {section}{\numberline {3.1}The top-level region directory}{5}{section.3.1} \contentsline {subsection}{\numberline {3.1.1}Setting up a new region}{6}{subsection.3.1.1} \contentsline {section}{\numberline {3.2}Topography}{6}{section.3.2} \contentsline {subsection}{\numberline {3.2.1}Importing a model topography}{7}{subsection.3.2.1} \contentsline {subsection}{\numberline {3.2.2}Create a nested model topography }{8}{subsection.3.2.2} \contentsline {subsection}{\numberline {3.2.3}Help routines for setting up topo-files}{8}{subsection.3.2.3} \contentsline {section}{\numberline {3.3}The experiment directories}{9}{section.3.3} \contentsline {subsection}{\numberline {3.3.1}Setting up experiments}{9}{subsection.3.3.1} \contentsline {subsection}{\numberline {3.3.2}When to set up new experiments}{10}{subsection.3.3.2} \contentsline {subsection}{\numberline {3.3.3}How to create/copy and backup experiment}{11}{subsection.3.3.3} \contentsline {subsection}{\numberline {3.3.4}Generating MPI partitions }{12}{subsection.3.3.4} \contentsline {subsection}{\numberline {3.3.5}Precribed barotropic inflow: ports.input }{13}{subsection.3.3.5} \contentsline {section}{\numberline {3.4}Relaxation}{13}{section.3.4} \contentsline {subsection}{\numberline {3.4.1}Routines for generating relaxation fields}{14}{subsection.3.4.1} \contentsline {subsection}{\numberline {3.4.2}Prerequisites for generating relaxation fields}{16}{subsection.3.4.2} \contentsline {subsection}{\numberline {3.4.3}Procedure for generating relaxation fields}{16}{subsection.3.4.3} \contentsline {section}{\numberline {3.5}Forcing}{16}{section.3.5} \contentsline {subsection}{\numberline {3.5.1}Prerequisites for generating forcing fields}{17}{subsection.3.5.1} \contentsline {section}{\numberline {3.6}Nesting setup (subdirectory nest\_nersc)}{17}{section.3.6} \contentsline {section}{\numberline {3.7}Tide setup (subdirectory tides\_nersc)}{18}{section.3.7} \contentsline {section}{\numberline {3.8}Other setup routines (subdirectory other\_nersc)}{18}{section.3.8} \contentsline {chapter}{\numberline {4}Model Code}{19}{chapter.4} \contentsline {section}{\numberline {4.1}Differences from standard HYCOM}{19}{section.4.1} \contentsline {subsection}{\numberline {4.1.1}Input/Output}{19}{subsection.4.1.1} \contentsline {subsection}{\numberline {4.1.2}Diagnostics}{20}{subsection.4.1.2} \contentsline {subsection}{\numberline {4.1.3}Nesting}{20}{subsection.4.1.3} \contentsline {subsection}{\numberline {4.1.4}Tides}{20}{subsection.4.1.4} \contentsline {subsection}{\numberline {4.1.5}Ice dynamics: EVP, MIZ and ICESTATE}{21}{subsection.4.1.5} \contentsline {subsection}{\numberline {4.1.6}Thermodynamic forcing}{21}{subsection.4.1.6} \contentsline {subsection}{\numberline {4.1.7}Atmospheric forcing}{21}{subsection.4.1.7} \contentsline {subsection}{\numberline {4.1.8}Random forcing}{21}{subsection.4.1.8} \contentsline {section}{\numberline {4.2}Code setup}{22}{section.4.2} \contentsline {subsection}{\numberline {4.2.1}Setup of directories}{22}{subsection.4.2.1} \contentsline {subsection}{\numberline {4.2.2}Setup of model dimensions}{22}{subsection.4.2.2} \contentsline {subsection}{\numberline {4.2.3}Setup of Makefile configuration files}{23}{subsection.4.2.3} \contentsline {subsection}{\numberline {4.2.4}Setup of CPP flags}{23}{subsection.4.2.4} \contentsline {subsection}{\numberline {4.2.5}Compilation}{24}{subsection.4.2.5} \contentsline {chapter}{\numberline {5}Final model setup and running the model}{27}{chapter.5} \contentsline {section}{\numberline {5.1}Overview of a model run}{27}{section.5.1} \contentsline {subsection}{\numberline {5.1.1}blkdat.input}{28}{subsection.5.1.1} \contentsline {subsection}{\numberline {5.1.2}EXPT.src}{29}{subsection.5.1.2} \contentsline {subsection}{\numberline {5.1.3}infile.in}{30}{subsection.5.1.3} \contentsline {subsection}{\numberline {5.1.4}infile2.in}{31}{subsection.5.1.4} \contentsline {subsection}{\numberline {5.1.5}infile.evp}{32}{subsection.5.1.5} \contentsline {subsection}{\numberline {5.1.6}infile\_gp.in}{32}{subsection.5.1.6} \contentsline {subsection}{\numberline {5.1.7}Pre- and post-processing routines and job scripts}{33}{subsection.5.1.7} \contentsline {section}{\numberline {5.2}Tidbits}{34}{section.5.2} \contentsline {subsection}{\numberline {5.2.1}Activating outer nesting}{34}{subsection.5.2.1} \contentsline {subsection}{\numberline {5.2.2}Activating inner nesting}{34}{subsection.5.2.2} \contentsline {subsection}{\numberline {5.2.3}Initializing the model from climatology}{34}{subsection.5.2.3} \contentsline {subsection}{\numberline {5.2.4}Starting the model from a restart file with ``wrong date''}{34}{subsection.5.2.4} \contentsline {subsection}{\numberline {5.2.5}Starting the model from a curviint restart file}{35}{subsection.5.2.5} \contentsline {subsection}{\numberline {5.2.6}Quick access to data and scratch directories}{35}{subsection.5.2.6} \contentsline {section}{\numberline {5.3}Running the model}{35}{section.5.3} \contentsline {chapter}{\numberline {6}Overview of auxillary routines and scripts}{37}{chapter.6} \contentsline {section}{\numberline {6.1}Main directory}{37}{section.6.1} \contentsline {section}{\numberline {6.2}The ``src/'' directory}{38}{section.6.2} \contentsline {subsection}{\numberline {6.2.1}Overview}{38}{subsection.6.2.1} \contentsline {subsection}{\numberline {6.2.2}Configuring the make include file}{38}{subsection.6.2.2} \contentsline {subsection}{\numberline {6.2.3}Compiling the code}{38}{subsection.6.2.3} \contentsline {section}{\numberline {6.3}The ``src/Nersclib/'' directories and its libraries}{39}{section.6.3} \contentsline {paragraph}{mod\_za, mod\_xc and mod\_grid:}{40}{section*.15} \contentsline {paragraph}{mod\_spline\_calc:}{40}{section*.16} \contentsline {paragraph}{mod\_hycomfile\_io:}{41}{section*.17} \contentsline {paragraph}{mod\_confmap:}{41}{section*.18} \contentsline {section}{\numberline {6.4}Quick explanation of the rest of ``src/''}{41}{section.6.4} \contentsline {subsection}{\numberline {6.4.1}Average - Create 3D averages of HYCOM files}{42}{subsection.6.4.1} \contentsline {subsection}{\numberline {6.4.2}Barstrf - Create Barotropic streamfunction}{42}{subsection.6.4.2} \contentsline {subsection}{\numberline {6.4.3}Conf\_grid - generation of model grids}{42}{subsection.6.4.3} \contentsline {subsection}{\numberline {6.4.4}ConfmapRoutines - Going between grid indexes and geographical positions}{42}{subsection.6.4.4} \contentsline {subsection}{\numberline {6.4.5}Copymem - copies ensemble members}{42}{subsection.6.4.5} \contentsline {subsection}{\numberline {6.4.6}Curviint - restart file interpolation}{42}{subsection.6.4.6} \contentsline {subsection}{\numberline {6.4.7}DateTools - convert between ordinal day to real date}{42}{subsection.6.4.7} \contentsline {subsection}{\numberline {6.4.8}DProfile - Vertical profiles.}{42}{subsection.6.4.8} \contentsline {subsection}{\numberline {6.4.9}Ensstat - calculates ensemble/time statistics}{42}{subsection.6.4.9} \contentsline {subsection}{\numberline {6.4.10}ExtractNC2D - Convert from hycom files to 2D netcdf files}{42}{subsection.6.4.10} \contentsline {subsection}{\numberline {6.4.11}ExtractNC3D - Convert from hycom files to 3D netcdf fields}{42}{subsection.6.4.11} \contentsline {subsection}{\numberline {6.4.12}FindLayer - find layer thickness between threshoolds}{43}{subsection.6.4.12} \contentsline {subsection}{\numberline {6.4.13}GP - extract data from grid point files}{43}{subsection.6.4.13} \contentsline {subsection}{\numberline {6.4.14}GPdens - grid point time series statistics}{43}{subsection.6.4.14} \contentsline {subsection}{\numberline {6.4.15}GridToLL - interpolation to regular lon/lat grid}{43}{subsection.6.4.15} \contentsline {subsection}{\numberline {6.4.16}Hyc2proj - interpolation to projection grid and z-levels}{43}{subsection.6.4.16} \contentsline {subsection}{\numberline {6.4.17}IceDrift - calculation of sea-ice drift}{44}{subsection.6.4.17} \contentsline {subsection}{\numberline {6.4.18}Idealized\_Grid - Setting up idealized grids and restart files}{44}{subsection.6.4.18} \contentsline {subsection}{\numberline {6.4.19}InterpTest - unfinished interpolation ``toolchain'' }{44}{subsection.6.4.19} \contentsline {subsection}{\numberline {6.4.20}MkEnsemble - creating a model ensemble}{44}{subsection.6.4.20} \contentsline {subsection}{\numberline {6.4.21}Model\_input-x.x.xx: utility file}{45}{subsection.6.4.21} \contentsline {subsection}{\numberline {6.4.22}Multiproc\_New - Calculate hycom average and mean SSH fields}{45}{subsection.6.4.22} \contentsline {subsection}{\numberline {6.4.23}NCARG-test - visualization routines}{45}{subsection.6.4.23} \contentsline {subsection}{\numberline {6.4.24}Nestbat - smoothing bathymetry towards an ``outer'' model}{45}{subsection.6.4.24} \contentsline {subsection}{\numberline {6.4.25}Nesting-2.2}{45}{subsection.6.4.25} \contentsline {subsection}{\numberline {6.4.26}Nest\_Offline-2.1}{45}{subsection.6.4.26} \contentsline {subsection}{\numberline {6.4.27}NORSEXClim - climatology from NORSEX ice concentration}{46}{subsection.6.4.27} \contentsline {subsection}{\numberline {6.4.28}ObsCompare - compare model with observations}{46}{subsection.6.4.28} \contentsline {subsection}{\numberline {6.4.29}Old\_Forcing - Routines for creating ``old'' forcing files.}{46}{subsection.6.4.29} \contentsline {subsection}{\numberline {6.4.30}Old\_Levitus - Routines for creating ``old'' SST and SSS fields}{46}{subsection.6.4.30} \contentsline {subsection}{\numberline {6.4.31}Relax - model relaxation utilities }{46}{subsection.6.4.31} \contentsline {subsection}{\numberline {6.4.32}RelaxToNetCDF - Get relaxation fields into NetCDF files}{47}{subsection.6.4.32} \contentsline {subsection}{\numberline {6.4.33}River\_Forcing - prepare river forcing from point sources}{47}{subsection.6.4.33} \contentsline {subsection}{\numberline {6.4.34}Section - Extract section data and transports}{47}{subsection.6.4.34} \contentsline {subsection}{\numberline {6.4.35}SSHFromState - calculate SSH from restart files}{49}{subsection.6.4.35} \contentsline {subsection}{\numberline {6.4.36}Synoptic\_Forcing-X.X.X- Creating forcing fields for HYCOM }{49}{subsection.6.4.36} \contentsline {subsection}{\numberline {6.4.37}Tides\_CSR - CSR tidal forcing}{50}{subsection.6.4.37} \contentsline {subsection}{\numberline {6.4.38}Tides\_FES - FES tidal forcing}{50}{subsection.6.4.38} \contentsline {subsection}{\numberline {6.4.39}TRIP - river forcing}{50}{subsection.6.4.39} \contentsline {subsection}{\numberline {6.4.40}ZONAL}{50}{subsection.6.4.40} \contentsline {section}{\numberline {6.5}The ``Input/'' directory - examples of input files}{50}{section.6.5} \contentsline {subsection}{\numberline {6.5.1}``extract'' files}{50}{subsection.6.5.1} \contentsline {subsection}{\numberline {6.5.2}Projection file ``proj.in'' }{51}{subsection.6.5.2} \contentsline {paragraph}{``regular'' projection option:}{51}{section*.21} \contentsline {paragraph}{``native'' projection option:}{53}{section*.22} \contentsline {paragraph}{``polar\_stereographic'' projection option:}{53}{section*.23} \contentsline {paragraph}{``mercator'' projection option:}{54}{section*.24} \contentsline {subsection}{\numberline {6.5.3}Stations file ``stations.in'' }{54}{subsection.6.5.3} \contentsline {subsection}{\numberline {6.5.4}Depthlevels file ``depthlevels.in'' }{55}{subsection.6.5.4} \contentsline {subsection}{\numberline {6.5.5}Section file ``sections.in'' }{55}{subsection.6.5.5} \contentsline {subsection}{\numberline {6.5.6}Transport file ``transport.in'' and scalar transport file ``scalartransport.in''}{56}{subsection.6.5.6} \contentsline {paragraph}{Transport file {\bf transport.in}}{56}{section*.25} \contentsline {paragraph}{Scalar transport - ``scalartransport.in''}{56}{section*.26} \contentsline {subsection}{\numberline {6.5.7}The regiondefs file ``regiondefs.in'' }{57}{subsection.6.5.7} \contentsline {subsection}{\numberline {6.5.8}The NCAR graphics input files - ``cplot.in'' and ``cvplot.in'' }{58}{subsection.6.5.8} \contentsline {section}{\numberline {6.6}Matlab tools}{58}{section.6.6} \contentsline {subsection}{\numberline {6.6.1}abfile}{58}{subsection.6.6.1} \contentsline {paragraph}{Initializing file objects}{58}{section*.28} \contentsline {paragraph}{Reading field data}{58}{section*.29} \contentsline {paragraph}{Reading point data}{58}{section*.30} \contentsline {paragraph}{Inquiring on the contents of a file}{58}{section*.31} \contentsline {subsection}{\numberline {6.6.2}Hycomvis}{59}{subsection.6.6.2} \contentsline {subsection}{\numberline {6.6.3}Topofix}{60}{subsection.6.6.3} \contentsline {chapter}{\numberline {A}Checklists for setting up a model}{63}{appendix.A} \contentsline {section}{\numberline {A.1}Standard setup}{63}{section.A.1} \contentsline {subsection}{\numberline {A.1.1}Step 0. Retrieve code and compile}{63}{subsection.A.1.1} \contentsline {subsection}{\numberline {A.1.2}Step 1. Configure region}{63}{subsection.A.1.2} \contentsline {subsection}{\numberline {A.1.3}Configure topographies}{63}{subsection.A.1.3} \contentsline {subsection}{\numberline {A.1.4}Configure experiment}{64}{subsection.A.1.4} \contentsline {subsection}{\numberline {A.1.5}Configure relaxation data files}{64}{subsection.A.1.5} \contentsline {subsection}{\numberline {A.1.6}Configure forcing files}{64}{subsection.A.1.6} \contentsline {subsection}{\numberline {A.1.7}Configure MPI and compile}{65}{subsection.A.1.7} \contentsline {subsection}{\numberline {A.1.8}Configure run-time options and run}{65}{subsection.A.1.8} \contentsline {section}{\numberline {A.2}Other setup options}{66}{section.A.2} \contentsline {subsection}{\numberline {A.2.1}Nesting (outer)}{66}{subsection.A.2.1} \contentsline {subsection}{\numberline {A.2.2}Nesting (inner)}{66}{subsection.A.2.2} \contentsline {subsection}{\numberline {A.2.3}Tidal forcing}{66}{subsection.A.2.3} \contentsline {chapter}{\numberline {B}Conformal mapping tool}{67}{appendix.B} \contentsline {section}{\numberline {B.1}Input files}{67}{section.B.1} \contentsline {section}{\numberline {B.2}Model Grid generation with the conformal mapping tools}{67}{section.B.2} \contentsline {paragraph}{Inreasing the east-west range}{69}{section*.36} \contentsline {paragraph}{Increasing grid points in the east-west direction}{70}{section*.37} \contentsline {paragraph}{Increasing the Mercator Factor}{70}{section*.38} \contentsline {paragraph}{Increasing the grid points in the south-north direction}{70}{section*.39} \contentsline {paragraph}{Adjusting resolution while keeping the same coverage}{70}{section*.40} \contentsline {subsubsection}{Final tips}{70}{section*.41}