New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
Changeset 3094 – NEMO

Changeset 3094


Ignore:
Timestamp:
2011-11-14T16:28:04+01:00 (12 years ago)
Author:
acc
Message:

Branch dev_NOC_UKMO_MERGE #890. Step 2. Merge in changes from the dev_UKM0_2011 branch with unwanted changes reverted

Location:
branches/2011/dev_NOC_UKMO_MERGE
Files:
1 deleted
99 edited
20 copied

Legend:

Unmodified
Added
Removed
  • branches/2011/dev_NOC_UKMO_MERGE/DOC/TexFiles/Biblio/Biblio.bib

    r2541 r3094  
    13061306  volume = {23}, 
    13071307  pages = {2428--2446} 
     1308} 
     1309 
     1310@ARTICLE{Hunke2008, 
     1311  author = {E.C. Hunke and W.H. Lipscomb}, 
     1312  title = {CICE: the Los Alamos sea ice model documentation and software user's manual,  
     1313        Version 4.0}, 
     1314  publisher = {LA-CC-06-012, Los Alamos National Laboratory, N.M.}, 
     1315  year = {2008} 
    13081316} 
    13091317 
  • branches/2011/dev_NOC_UKMO_MERGE/DOC/TexFiles/Chapters/Chap_ASM.tex

    r2483 r3094  
    1515The ASM code adds the functionality to apply increments to the model variables:  
    1616temperature, salinity, sea surface height, velocity and sea ice concentration.  
    17 These are read into the model from a NetCDF file which may be produced by data 
    18 assimilation.  The code can also output model background fields which are used 
     17These are read into the model from a NetCDF file which may be produced by separate data 
     18assimilation code.  The code can also output model background fields which are used 
    1919as an input to data assimilation code. This is all controlled by the namelist 
    2020\textit{nam\_asminc}.  There is a brief description of all the namelist options 
  • branches/2011/dev_NOC_UKMO_MERGE/DOC/TexFiles/Chapters/Chap_OBS.tex

    r2483 r3094  
    1313$\ $\newline    % force a new line 
    1414 
    15 The observation and model comparison code (OBS) reads in observation files 
    16 (profile temperature and salinity, sea surface temperature, sea level anomaly, 
    17 sea ice concentration, and velocity) and calculates  an interpolated model equivalent 
    18 value at the observation location and nearest model timestep. The OBS code is 
    19 called from \np{opa.F90} in order to initialise the model and to calculate the 
    20 model equivalent values for observations on the 0th timestep. The code is then 
    21 called again after each timestep from \np{step.F90}. The code was originally 
    22 developed for use with NEMOVAR.  
    23  
    24 For all data types a 2D horizontal  interpolator is needed 
    25 to interpolate the model fields to the observation location. 
    26 For {\em in situ} profiles, a 1D vertical interpolator is needed in addition to 
    27 provide model fields at the observation depths. Currently this only works in 
    28 z-level model configurations, but is being developed to work with a 
    29 generalised vertical coordinate system. 
    30 Temperature data from moored buoys (TAO, TRITON, PIRATA) in the 
    31 ENACT/ENSEMBLES data-base are available as daily averaged quantities. For this 
    32 type of observation the 
    33 observation operator will compare such observations to the model temperature 
     15The observation and model comparison code (OBS) reads in observation files (profile 
     16temperature and salinity, sea surface temperature, sea level anomaly, sea ice concentration, 
     17and velocity) and calculates  an interpolated model equivalent value at the observation 
     18location and nearest model timestep. The resulting data are saved in a ``feedback'' file (or 
     19files). The code was originally developed for use with the NEMOVAR data assimilation code, but 
     20can be used for validation or verification of model or  any other data assimilation system. 
     21 
     22The OBS code is called from \np{opa.F90} for model initialisation and to calculate the model 
     23equivalent values for observations on the 0th timestep. The code is then called again after 
     24each timestep from \np{step.F90}. To build with the OBS code active \key{diaobs} must be 
     25set. 
     26 
     27For all data types a 2D horizontal  interpolator is needed to interpolate the model fields to 
     28the observation location. For {\em in situ} profiles, a 1D vertical interpolator is needed in 
     29addition to provide model fields at the observation depths. Currently this only works in 
     30z-level model configurations, but is being developed to work with a generalised vertical 
     31coordinate system. Temperature data from moored buoys (TAO, TRITON, PIRATA) in the 
     32ENACT/ENSEMBLES data-base are available as daily averaged quantities. For this type of 
     33observation the observation operator will compare such observations to the model temperature 
    3434fields averaged over one day. The relevant observation type may be specified in the namelist 
    35 using \np{endailyavtypes}. Otherwise the model value from the nearest 
    36 timestep to the observation time is used. 
    37  
    38 The resulting data are saved in a ``feedback'' file (or files) which can be used 
    39 for model validation and verification and also to provide information for data 
    40 assimilation. This code is controlled by the namelist \textit{nam\_obs}. To 
    41 build with the OBS code active \key{diaobs} must be set. 
    42  
    43 Section~\ref{OBS_example} introduces a test example of the observation operator 
    44 code including where to obtain data and how to setup the namelist. 
    45 Section~\ref{OBS_details} introduces some more technical details of the 
    46 different observation types used and also shows a more complete namelist. 
    47 Finally section~\ref{OBS_theory} introduces some of the theoretical aspects of 
    48 the observation operator including interpolation methods and running on multiple 
    49 processors.  
     35using \np{endailyavtypes}. Otherwise the model value from the nearest timestep to the 
     36observation time is used. 
     37 
     38The code is controlled by the namelist \textit{nam\_obs}. See the following sections for more 
     39details on setting up the namelist.  
     40 
     41Section~\ref{OBS_example} introduces a test example of the observation operator code including 
     42where to obtain data and how to setup the namelist. Section~\ref{OBS_details} introduces some 
     43more technical details of the different observation types used and also shows a more complete 
     44namelist. Section~\ref{OBS_theory} introduces some of the theoretical aspects of the 
     45observation operator including interpolation methods and running on multiple processors. 
     46Section~\ref{OBS_obsutils} introduces some utilities to help working with the files produced 
     47by the OBS code. 
    5048 
    5149% ================================================================ 
     
    6967\item Add the following to the NEMO namelist to run the observation 
    7068operator on this data. Set the \np{enactfiles} namelist parameter to the 
    71 observation  file name (or link in to \np{profiles\_01\.nc}): 
     69observation  file name: 
    7270\end{enumerate} 
    7371 
     
    7674%------------------------------------------------------------------------------------------------------------- 
    7775 
    78 The option \np{ln\_t3d} and \np{ln\_s3d} switch on the temperature and salinity 
     76The options \np{ln\_t3d} and \np{ln\_s3d} switch on the temperature and salinity 
    7977profile observation operator code. The \np{ln\_ena} switch turns on the reading 
    8078of ENACT/ENSEMBLES type profile data. The filename or array of filenames are 
     
    8886Setting \np{ln\_grid\_global} means that the code distributes the observations 
    8987evenly between processors. Alternatively each processor will work with 
    90 observations located within the model subdomain. 
    91  
    92 The NEMOVAR system contains utilities to plot the feedback files, convert and 
    93 recombine the files. These are available on request from the NEMOVAR team. 
     88observations located within the model subdomain (see section~\ref{OBS_parallel}). 
     89 
     90A number of utilities are now provided to plot the feedback files, convert and 
     91recombine the files. These are explained in more detail in section~\ref{OBS_obsutils}. 
    9492 
    9593\section{Technical details} 
     
    713711 
    714712\subsection{Parallel aspects of horizontal interpolation} 
     713\label{OBS_parallel} 
    715714 
    716715For horizontal interpolation, there is the basic problem that the 
     
    779778\subsection{Vertical interpolation operator} 
    780779 
    781 The vertical interpolation is achieved using either a cubic spline or 
     780Vertical interpolation is achieved using either a cubic spline or 
    782781linear interpolation. For the cubic spline, the top and 
    783782bottom boundary conditions for the second derivative of the  
    784783interpolating polynomial in the spline are set to zero. 
    785784At the bottom boundary, this is done using the land-ocean mask. 
     785 
     786\newpage 
     787 
     788\section{Observation Utilities} 
     789\label{OBS_obsutils} 
     790 
     791Some tools for viewing and processing of observation and feedback files are provided in the 
     792NEMO repository for convenience. These include OBSTOOLS which are a collection of Fortran 
     793programs which are helpful to deal with feedback files. They do such tasks as observation file 
     794conversion, printing of file contents, some basic statistical analysis of feedback files. The 
     795other tool is an IDL program called dataplot which uses a graphical interface to visualise 
     796observations and feedback files. OBSTOOLS and dataplot are described in more detail below.   
     797 
     798\subsection{Obstools} 
     799 
     800A series of Fortran utilities is provided with NEMO called OBSTOOLS. This are helpful in 
     801handling observation files and the feedback file output from the NEMO observation operator. 
     802The utilities are as follows 
     803 
     804\subsubsection{corio2fb} 
     805 
     806The program corio2fb converts profile observation files from the Coriolis format to the 
     807standard feedback format. The program is called in the following way: 
     808 
     809\begin{alltt} 
     810\footnotesize 
     811\begin{verbatim} 
     812corio2fb.exe outputfile inputfile1 inputfile2 ... 
     813\end{verbatim} 
     814\end{alltt} 
     815 
     816\subsubsection{enact2fb} 
     817 
     818The program enact2fb converts profile observation files from the ENACT format to the standard 
     819feedback format. The program is called in the following way: 
     820 
     821\begin{alltt} 
     822\footnotesize 
     823\begin{verbatim} 
     824enact2fb.exe outputfile inputfile1 inputfile2 ... 
     825\end{verbatim} 
     826\end{alltt} 
     827 
     828\subsubsection{fbcomb} 
     829 
     830The program fbcomb combines multiple feedback files produced by individual processors in an 
     831MPI run of NEMO into a single feedback file. The program is called in the following way: 
     832 
     833\begin{alltt} 
     834\footnotesize 
     835\begin{verbatim} 
     836fbcomb.exe outputfile inputfile1 inputfile2 ... 
     837\end{verbatim} 
     838\end{alltt} 
     839 
     840\subsubsection{fbmatchup} 
     841 
     842The program fbmatchup will match observations from two feedback files. The program is called 
     843in the following way: 
     844 
     845\begin{alltt} 
     846\footnotesize 
     847\begin{verbatim} 
     848fbmatchup.exe outputfile inputfile1 varname1 inputfile2 varname2 ... 
     849\end{verbatim} 
     850\end{alltt} 
     851 
     852 
     853\subsubsection{fbprint} 
     854 
     855The program fbprint will print the contents of a feedback file or files to standard output. 
     856Selected information can be output using optional arguments. The program is called in the 
     857following way: 
     858 
     859\begin{alltt} 
     860\footnotesize 
     861\begin{verbatim} 
     862fbprint.exe [options] inputfile 
     863 
     864options: 
     865     -b            shorter output 
     866     -q            Select observations based on QC flags 
     867     -Q            Select observations based on QC flags 
     868     -B            Select observations based on QC flags 
     869     -u            unsorted 
     870     -s ID         select station ID   
     871     -t TYPE       select observation type 
     872     -v NUM1-NUM2  select variable range to print by number  
     873                      (default all) 
     874     -a NUM1-NUM2  select additional variable range to print by number  
     875                      (default all) 
     876     -e NUM1-NUM2  select extra variable range to print by number  
     877                      (default all) 
     878     -d            output date range 
     879     -D            print depths 
     880     -z            use zipped files 
     881\end{verbatim} 
     882\end{alltt} 
     883 
     884\subsubsection{fbsel} 
     885 
     886The program fbsel will select or subsample observations. The program is called in the 
     887following way: 
     888 
     889\begin{alltt} 
     890\footnotesize 
     891\begin{verbatim} 
     892fbsel.exe <input filename> <output filename> 
     893\end{verbatim} 
     894\end{alltt} 
     895 
     896\subsubsection{fbstat} 
     897 
     898The program fbstat will output summary statistics in different global areas into a number of 
     899files. The program is called in the following way: 
     900 
     901\begin{alltt} 
     902\footnotesize 
     903\begin{verbatim} 
     904fbstat.exe [-nmlev] <filenames> 
     905\end{verbatim} 
     906\end{alltt} 
     907 
     908\subsubsection{fbthin} 
     909 
     910The program fbthin will thin the data to 1 degree resolution. The code could easily be 
     911modified to thin to a different resolution. The program is called in the following way: 
     912 
     913\begin{alltt} 
     914\footnotesize 
     915\begin{verbatim} 
     916fbthin.exe inputfile outputfile 
     917\end{verbatim} 
     918\end{alltt} 
     919 
     920\subsubsection{sla2fb} 
     921 
     922The program sla2fb will convert an AVISO SLA format file to feedback format. The program is 
     923called in the following way: 
     924 
     925\begin{alltt} 
     926\footnotesize 
     927\begin{verbatim} 
     928sla2fb.exe [-s type] outputfile inputfile1 inputfile2 ... 
     929 
     930Option: 
     931     -s            Select altimeter data_source 
     932\end{verbatim} 
     933\end{alltt} 
     934 
     935\subsubsection{vel2fb} 
     936 
     937The program vel2fb will convert TAO/PIRATA/RAMA currents files to feedback format. The program 
     938is called in the following way: 
     939 
     940\begin{alltt} 
     941\footnotesize 
     942\begin{verbatim} 
     943vel2fb.exe outputfile inputfile1 inputfile2 ... 
     944\end{verbatim} 
     945\end{alltt} 
     946 
     947\subsection{building the obstools} 
     948 
     949To build the obstools use in the tools directory use ./maketools -n OBSTOOLS -m [ARCH]. 
     950 
     951\subsection{Dataplot} 
     952 
     953An IDL program called dataplot is included which uses a graphical interface to visualise 
     954observations and feedback files. It is possible to zoom in, plot individual profiles and 
     955calculate some basic statistics. To plot some data run IDL and then: 
     956\begin{alltt} 
     957\footnotesize 
     958\begin{verbatim} 
     959IDL> dataplot, "filename" 
     960\end{verbatim} 
     961\end{alltt} 
     962 
     963To read multiple files into dataplot, for example multiple feedback files from different 
     964processors or from different days, the easiest method is to use the spawn command to generate 
     965a list of files which can then be passed to dataplot. 
     966\begin{alltt} 
     967\footnotesize 
     968\begin{verbatim} 
     969IDL> spawn, 'ls profb*.nc', files 
     970IDL> dataplot, files 
     971\end{verbatim} 
     972\end{alltt} 
     973 
     974Fig~\ref{fig:obsdataplotmain} shows the main window which is launched when dataplot starts. 
     975This is split into three parts. At the top there is a menu bar which contains a variety of 
     976drop down menus. Areas - zooms into prespecified regions; plot - plots the data as a 
     977timeseries or a T-S diagram if appropriate; Find - allows data to be searched; Config - sets 
     978various configuration options. 
     979 
     980The middle part is a plot of the geographical location of the observations. This will plot the 
     981observation value, the model background value or observation minus background value depending 
     982on the option selected in the radio button at the bottom of the window. The plotting colour 
     983range can be changed by clicking on the colour bar. The title of the plot gives some basic 
     984information about the date range and depth range shown, the extreme values, and the mean and 
     985rms values. It is possible to zoom in using a drag-box. You may also zoom in or out using the 
     986mouse wheel. 
     987 
     988The bottom part of the window controls what is visible in the plot above. There are two bars 
     989which select the level range plotted (for profile data). The other bars below select the date 
     990range shown. The bottom of the figure allows the option to plot the mean, root mean square, 
     991standard deviation or mean square values. As mentioned above you can choose to plot the 
     992observation value, the model background value or observation minus background value. The next 
     993group of radio buttons selects the map projection. This can either be regular latitude 
     994longitude grid, or north or south polar stereographic. The next group of radio buttons will 
     995plot bad observations, switch to salinity and plot density for profile observations. The 
     996rightmost group of buttons will print the plot window as a postscript, save it as png, or exit 
     997from dataplot. 
     998 
     999%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     1000\begin{figure}     \begin{center} 
     1001%\includegraphics[width=10cm,height=12cm,angle=-90.]{./TexFiles/Figures/Fig_OBS_dataplot_main} 
     1002\includegraphics[width=9cm,angle=-90.]{./TexFiles/Figures/Fig_OBS_dataplot_main} 
     1003\caption{      \label{fig:obsdataplotmain} 
     1004Main window of dataplot.} 
     1005\end{center}     \end{figure} 
     1006%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     1007 
     1008If a profile point is clicked with the mouse button a plot of the observation and background 
     1009values as a function of depth (Fig~\ref{fig:obsdataplotprofile}). 
     1010 
     1011%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     1012\begin{figure}     \begin{center} 
     1013%\includegraphics[width=10cm,height=12cm,angle=-90.]{./TexFiles/Figures/Fig_OBS_dataplot_prof} 
     1014\includegraphics[width=7cm,angle=-90.]{./TexFiles/Figures/Fig_OBS_dataplot_prof} 
     1015\caption{      \label{fig:obsdataplotprofile} 
     1016Profile plot from dataplot produced by right clicking on a point in the main window.} 
     1017\end{center}     \end{figure} 
     1018%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     1019 
     1020 
     1021 
     1022 
  • branches/2011/dev_NOC_UKMO_MERGE/DOC/TexFiles/Chapters/Chap_SBC.tex

    r2541 r3094  
    602602\footnote{The \key{oasis4} exist. It activates portion of the code that are still under development.}.  
    603603It has been successfully used to interface \NEMO to most of the European atmospheric  
    604 GCM (ARPEGE, ECHAM, ECMWF, HadAM, LMDz),  
     604GCM (ARPEGE, ECHAM, ECMWF, HadAM, HadGAM, LMDz),  
    605605as well as to \href{http://wrf-model.org/}{WRF} (Weather Research and Forecasting Model). 
    606606 
     
    610610When PISCES biogeochemical model (\key{top} and \key{pisces}) is also used in the coupled system,  
    611611the whole carbon cycle is computed by defining \key{cpl\_carbon\_cycle}. In this case,  
    612 CO$_2$ fluxes are exchanged between the atmosphere and the ice-ocean system. 
     612CO$_2$ fluxes will be exchanged between the atmosphere and the ice-ocean system (and need to be activated 
     613in namsbc{\_}cpl). 
     614 
     615The new namelist above allows control of various aspects of the coupling fields (particularly for 
     616vectors) and now allows for any coupling fields to have multiple sea ice categories (as required by LIM3 
     617and CICE).  When indicating a multi-category coupling field in namsbc{\_}cpl the number of categories will be 
     618determined by the number used in the sea ice model.  In some limited cases it may be possible to specify  
     619single category coupling fields even when the sea ice model is running with multiple categories - in this 
     620case the user should examine the code to be sure the assumptions made are satisfactory.  In cases where 
     621this is definitely not possible the model should abort with an error message.  The new code has been tested using 
     622ECHAM with LIM2, and HadGAM3 with CICE but although it will compile with \key{lim3} additional minor code changes 
     623may be required to run using LIM3. 
    613624 
    614625 
     
    909920ice-ocean fluxes, that are combined with the air-sea fluxes using the ice fraction of  
    910921each model cell to provide the surface ocean fluxes. Note that the activation of a  
    911 sea-ice model is is done by defining a CPP key (\key{lim2} or \key{lim3}).  
    912 The activation automatically ovewrite the read value of nn{\_}ice to its appropriate  
    913 value ($i.e.$ $2$ for LIM-2 and $3$ for LIM-3). 
     922sea-ice model is is done by defining a CPP key (\key{lim2}, \key{lim3} or \key{cice}).  
     923The activation automatically overwrites the read value of nn{\_}ice to its appropriate  
     924value ($i.e.$ $2$ for LIM-2, $3$ for LIM-3 or $4$ for CICE). 
    914925\end{description} 
    915926 
    916927% {Description of Ice-ocean interface to be added here or in LIM 2 and 3 doc ?} 
     928 
     929\subsection   [Interface to CICE (\textit{sbcice\_cice})] 
     930         {Interface to CICE (\mdl{sbcice\_cice})} 
     931\label{SBC_cice} 
     932 
     933It is now possible to couple a global NEMO configuration (without AGRIF) to the CICE sea-ice 
     934model by using \key{cice}.  The CICE code can be obtained from  
     935\href{http://oceans11.lanl.gov/trac/CICE/}{LANL} and the additional 'hadgem3' drivers will be required,  
     936even with the latest code release.  Input grid files consistent with those used in NEMO will also be needed,  
     937and CICE CPP keys \textbf{ORCA\_GRID}, \textbf{CICE\_IN\_NEMO} and \textbf{coupled} should be used (seek advice from UKMO  
     938if necessary).  Currently the code is only designed to work when using the CORE forcing option for NEMO (with 
     939\textit{calc\_strair~=~true} and \textit{calc\_Tsfc~=~true} in the CICE name-list), or alternatively when NEMO  
     940is coupled to the HadGAM3 atmosphere model (with \textit{calc\_strair~=~false} and \textit{calc\_Tsfc~=~false}). 
     941The code is intended to be used with \np{nn\_fsbc} set to 1 (although coupling ocean and ice less frequently  
     942should work, it is possible the calculation of some of the ocean-ice fluxes needs to be modified slightly - the 
     943user should check that results are not significantly different to the standard case). 
     944 
     945There are two options for the technical coupling between NEMO and CICE.  The standard version allows 
     946complete flexibility for the domain decompositions in the individual models, but this is at the expense of global 
     947gather and scatter operations in the coupling which become very expensive on larger numbers of processors. The 
     948alternative option (using \key{nemocice\_decomp} for both NEMO and CICE) ensures that the domain decomposition is 
     949identical in both models (provided domain parameters are set appropriately, and  
     950\textit{processor\_shape~=~square-ice} and \textit{distribution\_wght~=~block} in the CICE name-list) and allows 
     951much more efficient direct coupling on individual processors.  This solution scales much better although it is at  
     952the expense of having more idle CICE processors in areas where there is no sea ice. 
     953 
    917954 
    918955% ------------------------------------------------------------------------------------------------------------- 
  • branches/2011/dev_NOC_UKMO_MERGE/DOC/TexFiles/Chapters/Introduction.tex

    r2570 r3094  
    6363\citep{OASIS2006}. Two-way nesting is also available through an interface to the 
    6464AGRIF package (Adaptative Grid Refinement in \textsc{Fortran}) \citep{Debreu_al_CG2008}. 
     65The interface code for coupling to an alternative sea ice model (CICE, \citet{Hunke2008}) is now  
     66available although this is currently only designed for global domains, without the use of AGRIF. 
    6567 
    6668Other model characteristics are the lateral boundary conditions (chapter~\ref{LBC}).   
  • branches/2011/dev_NOC_UKMO_MERGE/DOC/TexFiles/Namelist/namobs_example

    r2298 r3094  
    5757   ln_s3d = .true. 
    5858   ln_ena = .true. 
    59    enactfiles = 'profiles_01.nc' 
     59   enactfiles = 'enact.1.nc' 
    6060   ln_grid_global = .true. 
    6161   ln_grid_search_lookup = .true. 
  • branches/2011/dev_NOC_UKMO_MERGE/DOC/TexFiles/Namelist/namsbc_cpl

    r2540 r3094  
    22&namsbc_cpl    !   coupled ocean/atmosphere model                       ("key_coupled") 
    33!----------------------------------------------------------------------- 
    4 !                                      ! send 
    5 cn_snd_temperature= 'weighted oce and ice'  !  'oce only' 'weighted oce and ice' 'mixed oce-ice' 
    6 cn_snd_albedo     = 'weighted ice'          !  'none' 'weighted ice' 'mixed oce-ice' 
    7 cn_snd_thickness  = 'none'                  !  'none' 'weighted ice and snow' 
    8 cn_snd_crt_nature = 'none'                  !  'none' 'oce only' 'weighted oce and ice' 'mixed oce-ice' 
    9 cn_snd_crt_refere = 'spherical'             !  'spherical' 'cartesian' 
    10 cn_snd_crt_orient = 'eastward-northward'    !  'eastward-northward' or 'local grid' 
    11 cn_snd_crt_grid   = 'T'                     !  'T' 
    12 !                                      ! receive 
    13 cn_rcv_w10m       = 'none'                  !  'none' 'coupled' 
    14 cn_rcv_taumod     = 'coupled'               !  'none' 'coupled' 
    15 cn_rcv_tau_nature = 'oce only'              !  'oce only' 'oce and ice' 'mixed oce-ice' 
    16 cn_rcv_tau_refere = 'cartesian'             !  'spherical' 'cartesian' 
    17 cn_rcv_tau_orient = 'eastward-northward'    !  'eastward-northward' or 'local grid' 
    18 cn_rcv_tau_grid   = 'U,V'                   !  'T' 'U,V' 'U,V,F' 'U,V,I' 'T,F' 'T,I' 'T,U,V' 
    19 cn_rcv_dqnsdt     = 'coupled'               !  'none' 'coupled' 
    20 cn_rcv_qsr        = 'oce and ice'           !  'conservative' 'oce and ice' 'mixed oce-ice' 
    21 cn_rcv_qns        = 'oce and ice'           !  'conservative' 'oce and ice' 'mixed oce-ice' 
    22 cn_rcv_emp        = 'conservative'          !  'conservative' 'oce and ice' 'mixed oce-ice' 
    23 cn_rcv_rnf        = 'coupled'               !  'coupled' 'climato' 'mixed' 
    24 cn_rcv_cal        = 'coupled'               !  'none' 'coupled' 
     4!                    !     description       !  multiple  !    vector   !      vector          ! vector ! 
     5!                    !                       ! categories !  reference  !    orientation       ! grids  ! 
     6! send 
     7sn_snd_temp   =       'weighted oce and ice' ,    'no'    ,     ''      ,         ''           ,   ''     
     8sn_snd_alb    =       'weighted ice'         ,    'no'    ,     ''      ,         ''           ,   ''     
     9sn_snd_thick  =       'none'                 ,    'no'    ,     ''      ,         ''           ,   ''     
     10sn_snd_crt    =       'none'                 ,    'no'    , 'spherical' , 'eastward-northward' ,  'T'        
     11sn_snd_co2    =       'coupled'              ,    'no'    ,     ''      ,         ''           ,   ''         
     12! receive 
     13sn_rcv_w10m   =       'none'                 ,    'no'    ,     ''      ,         ''          ,   ''     
     14sn_rcv_taumod =       'coupled'              ,    'no'    ,     ''      ,         ''          ,   ''     
     15sn_rcv_tau    =       'oce only'             ,    'no'    , 'cartesian' , 'eastward-northward',  'U,V'    
     16sn_rcv_dqnsdt =       'coupled'              ,    'no'    ,     ''      ,         ''          ,   ''     
     17sn_rcv_qsr    =       'oce and ice'          ,    'no'    ,     ''      ,         ''          ,   ''     
     18sn_rcv_qns    =       'oce and ice'          ,    'no'    ,     ''      ,         ''          ,   ''     
     19sn_rcv_emp    =       'conservative'         ,    'no'    ,     ''      ,         ''          ,   ''     
     20sn_rcv_rnf    =       'coupled'              ,    'no'    ,     ''      ,         ''          ,   ''     
     21sn_rcv_cal    =       'coupled'              ,    'no'    ,     ''      ,         ''          ,   ''     
     22sn_rcv_co2    =       'coupled'              ,    'no'    ,     ''      ,         ''          ,   ''     
    2523/ 
  • branches/2011/dev_NOC_UKMO_MERGE/NEMOGCM/CONFIG/GYRE/EXP00/namelist

    r2715 r3094  
    33!! namelists    2 - Domain           (namzgr, namzgr_sco, namdom, namdta_tem, namdta_sal) 
    44!!              3 - Surface boundary (namsbc, namsbc_ana, namsbc_flx, namsbc_clio, namsbc_core 
    5 !!                                    namsbc_cpl, namsbc_cpl_co2 namtra_qsr, namsbc_rnf,  
     5!!                                    namsbc_cpl, namtra_qsr, namsbc_rnf,  
    66!!                                    namsbc_apr, namsbc_ssr, namsbc_alb) 
    77!!              4 - lateral boundary (namlbc, namcla, namobc, namagrif, nambdy, nambdy_tide) 
     
    121121!!   namsbc_core     CORE bulk formulea formulation 
    122122!!   namsbc_cpl      CouPLed            formulation                     ("key_coupled") 
    123 !!   namsbc_cpl_co2  coupled ocean/biogeo/atmosphere model              ("key_cpl_carbon_cycle") 
    124123!!   namtra_qsr      penetrative solar radiation 
    125124!!   namsbc_rnf      river runoffs 
     
    212211&namsbc_cpl    !   coupled ocean/atmosphere model                       ("key_coupled") 
    213212!----------------------------------------------------------------------- 
    214 !                                      ! send 
    215 cn_snd_temperature= 'weighted oce and ice'  !  'oce only' 'weighted oce and ice' 'mixed oce-ice' 
    216 cn_snd_albedo     = 'weighted ice'          !  'none' 'weighted ice' 'mixed oce-ice' 
    217 cn_snd_thickness  = 'none'                  !  'none' 'weighted ice and snow' 
    218 cn_snd_crt_nature = 'none'                  !  'none' 'oce only' 'weighted oce and ice' 'mixed oce-ice' 
    219 cn_snd_crt_refere = 'spherical'             !  'spherical' 'cartesian' 
    220 cn_snd_crt_orient = 'eastward-northward'    !  'eastward-northward' or 'local grid' 
    221 cn_snd_crt_grid   = 'T'                     !  'T' 
    222 !                                      ! receive 
    223 cn_rcv_w10m       = 'none'                  !  'none' 'coupled' 
    224 cn_rcv_taumod     = 'coupled'               !  'none' 'coupled' 
    225 cn_rcv_tau_nature = 'oce only'              !  'oce only' 'oce and ice' 'mixed oce-ice' 
    226 cn_rcv_tau_refere = 'cartesian'             !  'spherical' 'cartesian' 
    227 cn_rcv_tau_orient = 'eastward-northward'    !  'eastward-northward' or 'local grid' 
    228 cn_rcv_tau_grid   = 'U,V'                   !  'T' 'U,V' 'U,V,F' 'U,V,I' 'T,F' 'T,I' 'T,U,V' 
    229 cn_rcv_dqnsdt     = 'coupled'               !  'none' 'coupled' 
    230 cn_rcv_qsr        = 'oce and ice'           !  'conservative' 'oce and ice' 'mixed oce-ice' 
    231 cn_rcv_qns        = 'oce and ice'           !  'conservative' 'oce and ice' 'mixed oce-ice' 
    232 cn_rcv_emp        = 'conservative'          !  'conservative' 'oce and ice' 'mixed oce-ice' 
    233 cn_rcv_rnf        = 'coupled'               !  'coupled' 'climato' 'mixed' 
    234 cn_rcv_cal        = 'coupled'               !  'none' 'coupled' 
    235 / 
    236 !----------------------------------------------------------------------- 
    237 &namsbc_cpl_co2   !   coupled ocean/biogeo/atmosphere model             ("key_cpl_carbon_cycle") 
    238 !----------------------------------------------------------------------- 
    239    cn_snd_co2     = 'coupled'         ! send    : 'none' 'coupled' 
    240    cn_rcv_co2     = 'coupled'         ! receive : 'none' 'coupled' 
     213!                    !     description       !  multiple  !    vector   !      vector          ! vector ! 
     214!                    !                       ! categories !  reference  !    orientation       ! grids  ! 
     215! send 
     216sn_snd_temp   =       'weighted oce and ice' ,    'no'    ,     ''      ,         ''           ,   ''     
     217sn_snd_alb    =       'weighted ice'         ,    'no'    ,     ''      ,         ''           ,   ''     
     218sn_snd_thick  =       'none'                 ,    'no'   ,     ''      ,         ''           ,   ''     
     219sn_snd_crt    =       'none'                 ,    'no'    , 'spherical' , 'eastward-northward' ,  'T'        
     220sn_snd_co2    =       'coupled'              ,    'no'    ,     ''      ,         ''           ,   ''         
     221! receive 
     222sn_rcv_w10m   =       'none'                 ,    'no'    ,     ''      ,         ''          ,   ''     
     223sn_rcv_taumod =       'coupled'              ,    'no'    ,     ''      ,         ''          ,   ''     
     224sn_rcv_tau    =       'oce only'             ,    'no'    , 'cartesian' , 'eastward-northward',  'U,V'    
     225sn_rcv_dqnsdt =       'coupled'              ,    'no'    ,     ''      ,         ''          ,   ''     
     226sn_rcv_qsr    =       'oce and ice'          ,    'no'    ,     ''      ,         ''          ,   ''     
     227sn_rcv_qns    =       'oce and ice'          ,    'no'    ,     ''      ,         ''          ,   ''     
     228sn_rcv_emp    =       'conservative'         ,    'no'    ,     ''      ,         ''          ,   ''     
     229sn_rcv_rnf    =       'coupled'              ,    'no'    ,     ''      ,         ''          ,   ''     
     230sn_rcv_cal    =       'coupled'              ,    'no'    ,     ''      ,         ''          ,   ''     
     231sn_rcv_co2    =       'coupled'              ,    'no'    ,     ''      ,         ''          ,   ''     
    241232/ 
    242233!----------------------------------------------------------------------- 
  • branches/2011/dev_NOC_UKMO_MERGE/NEMOGCM/CONFIG/ORCA2_LIM/EXP00/1_namelist

    r2735 r3094  
    33!! namelists    2 - Domain           (namzgr, namzgr_sco, namdom, namdta_tem, namdta_sal) 
    44!!              3 - Surface boundary (namsbc, namsbc_ana, namsbc_flx, namsbc_clio, namsbc_core 
    5 !!                                    namsbc_cpl, namsbc_cpl_co2 namtra_qsr, namsbc_rnf,  
     5!!                                    namsbc_cpl, namtra_qsr, namsbc_rnf,  
    66!!                                    namsbc_apr, namsbc_ssr, namsbc_alb) 
    77!!              4 - lateral boundary (namlbc, namcla, namobc, namagrif, nambdy, nambdy_tide) 
     
    121121!!   namsbc_core     CORE bulk formulea formulation 
    122122!!   namsbc_cpl      CouPLed            formulation                     ("key_coupled") 
    123 !!   namsbc_cpl_co2  coupled ocean/biogeo/atmosphere model              ("key_cpl_carbon_cycle") 
    124123!!   namtra_qsr      penetrative solar radiation 
    125124!!   namsbc_rnf      river runoffs 
     
    212211&namsbc_cpl    !   coupled ocean/atmosphere model                       ("key_coupled") 
    213212!----------------------------------------------------------------------- 
    214 !                                      ! send 
    215 cn_snd_temperature= 'weighted oce and ice'  !  'oce only' 'weighted oce and ice' 'mixed oce-ice' 
    216 cn_snd_albedo     = 'weighted ice'          !  'none' 'weighted ice' 'mixed oce-ice' 
    217 cn_snd_thickness  = 'none'                  !  'none' 'weighted ice and snow' 
    218 cn_snd_crt_nature = 'none'                  !  'none' 'oce only' 'weighted oce and ice' 'mixed oce-ice' 
    219 cn_snd_crt_refere = 'spherical'             !  'spherical' 'cartesian' 
    220 cn_snd_crt_orient = 'eastward-northward'    !  'eastward-northward' or 'local grid' 
    221 cn_snd_crt_grid   = 'T'                     !  'T' 
    222 !                                      ! receive 
    223 cn_rcv_w10m       = 'none'                  !  'none' 'coupled' 
    224 cn_rcv_taumod     = 'coupled'               !  'none' 'coupled' 
    225 cn_rcv_tau_nature = 'oce only'              !  'oce only' 'oce and ice' 'mixed oce-ice' 
    226 cn_rcv_tau_refere = 'cartesian'             !  'spherical' 'cartesian' 
    227 cn_rcv_tau_orient = 'eastward-northward'    !  'eastward-northward' or 'local grid' 
    228 cn_rcv_tau_grid   = 'U,V'                   !  'T' 'U,V' 'U,V,F' 'U,V,I' 'T,F' 'T,I' 'T,U,V' 
    229 cn_rcv_dqnsdt     = 'coupled'               !  'none' 'coupled' 
    230 cn_rcv_qsr        = 'oce and ice'           !  'conservative' 'oce and ice' 'mixed oce-ice' 
    231 cn_rcv_qns        = 'oce and ice'           !  'conservative' 'oce and ice' 'mixed oce-ice' 
    232 cn_rcv_emp        = 'conservative'          !  'conservative' 'oce and ice' 'mixed oce-ice' 
    233 cn_rcv_rnf        = 'coupled'               !  'coupled' 'climato' 'mixed' 
    234 cn_rcv_cal        = 'coupled'               !  'none' 'coupled' 
    235 / 
    236 !----------------------------------------------------------------------- 
    237 &namsbc_cpl_co2   !   coupled ocean/biogeo/atmosphere model             ("key_cpl_carbon_cycle") 
    238 !----------------------------------------------------------------------- 
    239    cn_snd_co2     = 'coupled'         ! send    : 'none' 'coupled' 
    240    cn_rcv_co2     = 'coupled'         ! receive : 'none' 'coupled' 
     213!                    !     description       !  multiple  !    vector   !      vector          ! vector ! 
     214!                    !                       ! categories !  reference  !    orientation       ! grids  ! 
     215! send 
     216sn_snd_temp   =       'weighted oce and ice' ,    'no'    ,     ''      ,         ''           ,   ''     
     217sn_snd_alb    =       'weighted ice'         ,    'no'    ,     ''      ,         ''           ,   ''     
     218sn_snd_thick  =       'none'                 ,    'no'   ,     ''      ,         ''           ,   ''     
     219sn_snd_crt    =       'none'                 ,    'no'    , 'spherical' , 'eastward-northward' ,  'T'        
     220sn_snd_co2    =       'coupled'              ,    'no'    ,     ''      ,         ''           ,   ''         
     221! receive 
     222sn_rcv_w10m   =       'none'                 ,    'no'    ,     ''      ,         ''          ,   ''     
     223sn_rcv_taumod =       'coupled'              ,    'no'    ,     ''      ,         ''          ,   ''     
     224sn_rcv_tau    =       'oce only'             ,    'no'    , 'cartesian' , 'eastward-northward',  'U,V'    
     225sn_rcv_dqnsdt =       'coupled'              ,    'no'    ,     ''      ,         ''          ,   ''     
     226sn_rcv_qsr    =       'oce and ice'          ,    'no'    ,     ''      ,         ''          ,   ''     
     227sn_rcv_qns    =       'oce and ice'          ,    'no'    ,     ''      ,         ''          ,   ''     
     228sn_rcv_emp    =       'conservative'         ,    'no'    ,     ''      ,         ''          ,   ''     
     229sn_rcv_rnf    =       'coupled'              ,    'no'    ,     ''      ,         ''          ,   ''     
     230sn_rcv_cal    =       'coupled'              ,    'no'    ,     ''      ,         ''          ,   ''     
     231sn_rcv_co2    =       'coupled'              ,    'no'    ,     ''      ,         ''          ,   ''     
    241232/ 
    242233!----------------------------------------------------------------------- 
  • branches/2011/dev_NOC_UKMO_MERGE/NEMOGCM/CONFIG/ORCA2_LIM/EXP00/namelist

    r2715 r3094  
    33!! namelists    2 - Domain           (namzgr, namzgr_sco, namdom, namdta_tem, namdta_sal) 
    44!!              3 - Surface boundary (namsbc, namsbc_ana, namsbc_flx, namsbc_clio, namsbc_core 
    5 !!                                    namsbc_cpl, namsbc_cpl_co2 namtra_qsr, namsbc_rnf,  
     5!!                                    namsbc_cpl, namtra_qsr, namsbc_rnf,  
    66!!                                    namsbc_apr, namsbc_ssr, namsbc_alb) 
    77!!              4 - lateral boundary (namlbc, namcla, namobc, namagrif, nambdy, nambdy_tide) 
     
    121121!!   namsbc_core     CORE bulk formulea formulation 
    122122!!   namsbc_cpl      CouPLed            formulation                     ("key_coupled") 
    123 !!   namsbc_cpl_co2  coupled ocean/biogeo/atmosphere model              ("key_cpl_carbon_cycle") 
    124123!!   namtra_qsr      penetrative solar radiation 
    125124!!   namsbc_rnf      river runoffs 
     
    212211&namsbc_cpl    !   coupled ocean/atmosphere model                       ("key_coupled") 
    213212!----------------------------------------------------------------------- 
    214 !                                      ! send 
    215 cn_snd_temperature= 'weighted oce and ice'  !  'oce only' 'weighted oce and ice' 'mixed oce-ice' 
    216 cn_snd_albedo     = 'weighted ice'          !  'none' 'weighted ice' 'mixed oce-ice' 
    217 cn_snd_thickness  = 'none'                  !  'none' 'weighted ice and snow' 
    218 cn_snd_crt_nature = 'none'                  !  'none' 'oce only' 'weighted oce and ice' 'mixed oce-ice' 
    219 cn_snd_crt_refere = 'spherical'             !  'spherical' 'cartesian' 
    220 cn_snd_crt_orient = 'eastward-northward'    !  'eastward-northward' or 'local grid' 
    221 cn_snd_crt_grid   = 'T'                     !  'T' 
    222 !                                      ! receive 
    223 cn_rcv_w10m       = 'none'                  !  'none' 'coupled' 
    224 cn_rcv_taumod     = 'coupled'               !  'none' 'coupled' 
    225 cn_rcv_tau_nature = 'oce only'              !  'oce only' 'oce and ice' 'mixed oce-ice' 
    226 cn_rcv_tau_refere = 'cartesian'             !  'spherical' 'cartesian' 
    227 cn_rcv_tau_orient = 'eastward-northward'    !  'eastward-northward' or 'local grid' 
    228 cn_rcv_tau_grid   = 'U,V'                   !  'T' 'U,V' 'U,V,F' 'U,V,I' 'T,F' 'T,I' 'T,U,V' 
    229 cn_rcv_dqnsdt     = 'coupled'               !  'none' 'coupled' 
    230 cn_rcv_qsr        = 'oce and ice'           !  'conservative' 'oce and ice' 'mixed oce-ice' 
    231 cn_rcv_qns        = 'oce and ice'           !  'conservative' 'oce and ice' 'mixed oce-ice' 
    232 cn_rcv_emp        = 'conservative'          !  'conservative' 'oce and ice' 'mixed oce-ice' 
    233 cn_rcv_rnf        = 'coupled'               !  'coupled' 'climato' 'mixed' 
    234 cn_rcv_cal        = 'coupled'               !  'none' 'coupled' 
    235 / 
    236 !----------------------------------------------------------------------- 
    237 &namsbc_cpl_co2   !   coupled ocean/biogeo/atmosphere model             ("key_cpl_carbon_cycle") 
    238 !----------------------------------------------------------------------- 
    239    cn_snd_co2     = 'coupled'         ! send    : 'none' 'coupled' 
    240    cn_rcv_co2     = 'coupled'         ! receive : 'none' 'coupled' 
     213!                    !     description       !  multiple  !    vector   !      vector          ! vector ! 
     214!                    !                       ! categories !  reference  !    orientation       ! grids  ! 
     215! send 
     216sn_snd_temp   =       'weighted oce and ice' ,    'no'    ,     ''      ,         ''           ,   ''     
     217sn_snd_alb    =       'weighted ice'         ,    'no'    ,     ''      ,         ''           ,   ''     
     218sn_snd_thick  =       'none'                 ,    'no'   ,     ''      ,         ''           ,   ''     
     219sn_snd_crt    =       'none'                 ,    'no'    , 'spherical' , 'eastward-northward' ,  'T'        
     220sn_snd_co2    =       'coupled'              ,    'no'    ,     ''      ,         ''           ,   ''         
     221! receive 
     222sn_rcv_w10m   =       'none'                 ,    'no'    ,     ''      ,         ''          ,   ''     
     223sn_rcv_taumod =       'coupled'              ,    'no'    ,     ''      ,         ''          ,   ''     
     224sn_rcv_tau    =       'oce only'             ,    'no'    , 'cartesian' , 'eastward-northward',  'U,V'    
     225sn_rcv_dqnsdt =       'coupled'              ,    'no'    ,     ''      ,         ''          ,   ''     
     226sn_rcv_qsr    =       'oce and ice'          ,    'no'    ,     ''      ,         ''          ,   ''     
     227sn_rcv_qns    =       'oce and ice'          ,    'no'    ,     ''      ,         ''          ,   ''     
     228sn_rcv_emp    =       'conservative'         ,    'no'    ,     ''      ,         ''          ,   ''     
     229sn_rcv_rnf    =       'coupled'              ,    'no'    ,     ''      ,         ''          ,   ''     
     230sn_rcv_cal    =       'coupled'              ,    'no'    ,     ''      ,         ''          ,   ''     
     231sn_rcv_co2    =       'coupled'              ,    'no'    ,     ''      ,         ''          ,   ''     
    241232/ 
    242233!----------------------------------------------------------------------- 
  • branches/2011/dev_NOC_UKMO_MERGE/NEMOGCM/CONFIG/ORCA2_OFF_PISCES/EXP00/namelist

    r2715 r3094  
    33!! namelists    2 - Domain           (namzgr, namzgr_sco, namdom, namdta_tem, namdta_sal) 
    44!!              3 - Surface boundary (namsbc, namsbc_ana, namsbc_flx, namsbc_clio, namsbc_core 
    5 !!                                    namsbc_cpl, namsbc_cpl_co2 namtra_qsr, namsbc_rnf,  
     5!!                                    namsbc_cpl, namtra_qsr, namsbc_rnf,  
    66!!                                    namsbc_apr, namsbc_ssr, namsbc_alb) 
    77!!              4 - lateral boundary (namlbc, namcla, namobc, namagrif, nambdy, nambdy_tide) 
     
    121121!!   namsbc_core     CORE bulk formulea formulation 
    122122!!   namsbc_cpl      CouPLed            formulation                     ("key_coupled") 
    123 !!   namsbc_cpl_co2  coupled ocean/biogeo/atmosphere model              ("key_cpl_carbon_cycle") 
    124123!!   namtra_qsr      penetrative solar radiation 
    125124!!   namsbc_rnf      river runoffs 
     
    212211&namsbc_cpl    !   coupled ocean/atmosphere model                       ("key_coupled") 
    213212!----------------------------------------------------------------------- 
    214 !                                      ! send 
    215 cn_snd_temperature= 'weighted oce and ice'  !  'oce only' 'weighted oce and ice' 'mixed oce-ice' 
    216 cn_snd_albedo     = 'weighted ice'          !  'none' 'weighted ice' 'mixed oce-ice' 
    217 cn_snd_thickness  = 'none'                  !  'none' 'weighted ice and snow' 
    218 cn_snd_crt_nature = 'none'                  !  'none' 'oce only' 'weighted oce and ice' 'mixed oce-ice' 
    219 cn_snd_crt_refere = 'spherical'             !  'spherical' 'cartesian' 
    220 cn_snd_crt_orient = 'eastward-northward'    !  'eastward-northward' or 'local grid' 
    221 cn_snd_crt_grid   = 'T'                     !  'T' 
    222 !                                      ! receive 
    223 cn_rcv_w10m       = 'none'                  !  'none' 'coupled' 
    224 cn_rcv_taumod     = 'coupled'               !  'none' 'coupled' 
    225 cn_rcv_tau_nature = 'oce only'              !  'oce only' 'oce and ice' 'mixed oce-ice' 
    226 cn_rcv_tau_refere = 'cartesian'             !  'spherical' 'cartesian' 
    227 cn_rcv_tau_orient = 'eastward-northward'    !  'eastward-northward' or 'local grid' 
    228 cn_rcv_tau_grid   = 'U,V'                   !  'T' 'U,V' 'U,V,F' 'U,V,I' 'T,F' 'T,I' 'T,U,V' 
    229 cn_rcv_dqnsdt     = 'coupled'               !  'none' 'coupled' 
    230 cn_rcv_qsr        = 'oce and ice'           !  'conservative' 'oce and ice' 'mixed oce-ice' 
    231 cn_rcv_qns        = 'oce and ice'           !  'conservative' 'oce and ice' 'mixed oce-ice' 
    232 cn_rcv_emp        = 'conservative'          !  'conservative' 'oce and ice' 'mixed oce-ice' 
    233 cn_rcv_rnf        = 'coupled'               !  'coupled' 'climato' 'mixed' 
    234 cn_rcv_cal        = 'coupled'               !  'none' 'coupled' 
    235 / 
    236 !----------------------------------------------------------------------- 
    237 &namsbc_cpl_co2   !   coupled ocean/biogeo/atmosphere model             ("key_cpl_carbon_cycle") 
    238 !----------------------------------------------------------------------- 
    239 cn_snd_co2        = 'coupled'         ! send    :  'none' 'coupled' 
    240 cn_rcv_co2        = 'coupled'         ! receive : 'none' 'coupled' 
     213!                    !     description       !  multiple  !    vector   !      vector          ! vector ! 
     214!                    !                       ! categories !  reference  !    orientation       ! grids  ! 
     215! send 
     216sn_snd_temp   =       'weighted oce and ice' ,    'no'    ,     ''      ,         ''           ,   ''     
     217sn_snd_alb    =       'weighted ice'         ,    'no'    ,     ''      ,         ''           ,   ''     
     218sn_snd_thick  =       'none'                 ,    'no'   ,     ''      ,         ''           ,   ''     
     219sn_snd_crt    =       'none'                 ,    'no'    , 'spherical' , 'eastward-northward' ,  'T'        
     220sn_snd_co2    =       'coupled'              ,    'no'    ,     ''      ,         ''           ,   ''         
     221! receive 
     222sn_rcv_w10m   =       'none'                 ,    'no'    ,     ''      ,         ''          ,   ''     
     223sn_rcv_taumod =       'coupled'              ,    'no'    ,     ''      ,         ''          ,   ''     
     224sn_rcv_tau    =       'oce only'             ,    'no'    , 'cartesian' , 'eastward-northward',  'U,V'    
     225sn_rcv_dqnsdt =       'coupled'              ,    'no'    ,     ''      ,         ''          ,   ''     
     226sn_rcv_qsr    =       'oce and ice'          ,    'no'    ,     ''      ,         ''          ,   ''     
     227sn_rcv_qns    =       'oce and ice'          ,    'no'    ,     ''      ,         ''          ,   ''     
     228sn_rcv_emp    =       'conservative'         ,    'no'    ,     ''      ,         ''          ,   ''     
     229sn_rcv_rnf    =       'coupled'              ,    'no'    ,     ''      ,         ''          ,   ''     
     230sn_rcv_cal    =       'coupled'              ,    'no'    ,     ''      ,         ''          ,   ''     
     231sn_rcv_co2    =       'coupled'              ,    'no'    ,     ''      ,         ''          ,   ''     
    241232/ 
    242233!----------------------------------------------------------------------- 
  • branches/2011/dev_NOC_UKMO_MERGE/NEMOGCM/CONFIG/POMME/EXP00/namelist

    r2650 r3094  
    33!! namelists    2 - Domain           (namzgr, namzgr_sco, namdom, namdta_tem, namdta_sal) 
    44!!              3 - Surface boundary (namsbc, namsbc_ana, namsbc_flx, namsbc_clio, namsbc_core 
    5 !!                                    namsbc_cpl, namsbc_cpl_co2 namtra_qsr, namsbc_rnf,  
     5!!                                    namsbc_cpl, namtra_qsr, namsbc_rnf,  
    66!!                                    namsbc_apr, namsbc_ssr, namsbc_alb) 
    77!!              4 - lateral boundary (namlbc, namcla, namobc, namagrif, nambdy, nambdy_tide) 
     
    121121!!   namsbc_core     CORE bulk formulea formulation 
    122122!!   namsbc_cpl      CouPLed            formulation                     ("key_coupled") 
    123 !!   namsbc_cpl_co2  coupled ocean/biogeo/atmosphere model              ("key_cpl_carbon_cycle") 
    124123!!   namtra_qsr      penetrative solar radiation 
    125124!!   namsbc_rnf      river runoffs 
     
    212211&namsbc_cpl    !   coupled ocean/atmosphere model                       ("key_coupled") 
    213212!----------------------------------------------------------------------- 
    214 !                                      ! send 
    215 cn_snd_temperature= 'weighted oce and ice'  !  'oce only' 'weighted oce and ice' 'mixed oce-ice' 
    216 cn_snd_albedo     = 'weighted ice'          !  'none' 'weighted ice' 'mixed oce-ice' 
    217 cn_snd_thickness  = 'none'                  !  'none' 'weighted ice and snow' 
    218 cn_snd_crt_nature = 'none'                  !  'none' 'oce only' 'weighted oce and ice' 'mixed oce-ice' 
    219 cn_snd_crt_refere = 'spherical'             !  'spherical' 'cartesian' 
    220 cn_snd_crt_orient = 'eastward-northward'    !  'eastward-northward' or 'local grid' 
    221 cn_snd_crt_grid   = 'T'                     !  'T' 
    222 !                                      ! receive 
    223 cn_rcv_w10m       = 'none'                  !  'none' 'coupled' 
    224 cn_rcv_taumod     = 'coupled'               !  'none' 'coupled' 
    225 cn_rcv_tau_nature = 'oce only'              !  'oce only' 'oce and ice' 'mixed oce-ice' 
    226 cn_rcv_tau_refere = 'cartesian'             !  'spherical' 'cartesian' 
    227 cn_rcv_tau_orient = 'eastward-northward'    !  'eastward-northward' or 'local grid' 
    228 cn_rcv_tau_grid   = 'U,V'                   !  'T' 'U,V' 'U,V,F' 'U,V,I' 'T,F' 'T,I' 'T,U,V' 
    229 cn_rcv_dqnsdt     = 'coupled'               !  'none' 'coupled' 
    230 cn_rcv_qsr        = 'oce and ice'           !  'conservative' 'oce and ice' 'mixed oce-ice' 
    231 cn_rcv_qns        = 'oce and ice'           !  'conservative' 'oce and ice' 'mixed oce-ice' 
    232 cn_rcv_emp        = 'conservative'          !  'conservative' 'oce and ice' 'mixed oce-ice' 
    233 cn_rcv_rnf        = 'coupled'               !  'coupled' 'climato' 'mixed' 
    234 cn_rcv_cal        = 'coupled'               !  'none' 'coupled' 
    235 / 
    236 !----------------------------------------------------------------------- 
    237 &namsbc_cpl_co2   !   coupled ocean/biogeo/atmosphere model             ("key_cpl_carbon_cycle") 
    238 !----------------------------------------------------------------------- 
    239    cn_snd_co2     = 'coupled'         ! send    : 'none' 'coupled' 
    240    cn_rcv_co2     = 'coupled'         ! receive : 'none' 'coupled' 
     213!                    !     description       !  multiple  !    vector   !      vector          ! vector ! 
     214!                    !                       ! categories !  reference  !    orientation       ! grids  ! 
     215! send 
     216sn_snd_temp   =       'weighted oce and ice' ,    'no'    ,     ''      ,         ''           ,   ''     
     217sn_snd_alb    =       'weighted ice'         ,    'no'    ,     ''      ,         ''           ,   ''     
     218sn_snd_thick  =       'none'                 ,    'no'   ,     ''      ,         ''           ,   ''     
     219sn_snd_crt    =       'none'                 ,    'no'    , 'spherical' , 'eastward-northward' ,  'T'        
     220sn_snd_co2    =       'coupled'              ,    'no'    ,     ''      ,         ''           ,   ''         
     221! receive 
     222sn_rcv_w10m   =       'none'                 ,    'no'    ,     ''      ,         ''          ,   ''     
     223sn_rcv_taumod =       'coupled'              ,    'no'    ,     ''      ,         ''          ,   ''     
     224sn_rcv_tau    =       'oce only'             ,    'no'    , 'cartesian' , 'eastward-northward',  'U,V'    
     225sn_rcv_dqnsdt =       'coupled'              ,    'no'    ,     ''      ,         ''          ,   ''     
     226sn_rcv_qsr    =       'oce and ice'          ,    'no'    ,     ''      ,         ''          ,   ''     
     227sn_rcv_qns    =       'oce and ice'          ,    'no'    ,     ''      ,         ''          ,   ''     
     228sn_rcv_emp    =       'conservative'         ,    'no'    ,     ''      ,         ''          ,   ''     
     229sn_rcv_rnf    =       'coupled'              ,    'no'    ,     ''      ,         ''          ,   ''     
     230sn_rcv_cal    =       'coupled'              ,    'no'    ,     ''      ,         ''          ,   ''     
     231sn_rcv_co2    =       'coupled'              ,    'no'    ,     ''      ,         ''          ,   ''     
    241232/ 
    242233!----------------------------------------------------------------------- 
  • branches/2011/dev_NOC_UKMO_MERGE/NEMOGCM/NEMO/LIM_SRC_2/limsbc_2.F90

    r2715 r3094  
    2727   USE sbc_ice          ! surface boundary condition: ice 
    2828   USE sbc_oce          ! surface boundary condition: ocean 
     29   USE sbccpl 
    2930 
    3031   USE albedo           ! albedo parameters 
     
    234235      !-----------------------------------------------! 
    235236 
    236       IF( lk_cpl ) THEN          ! coupled case 
    237          tn_ice(:,:,1) = sist(:,:)          ! sea-ice surface temperature        
    238          !                                  ! Computation of snow/ice and ocean albedo 
    239          CALL albedo_ice( tn_ice, reshape( hicif, (/jpi,jpj,1/) ), reshape( hsnif, (/jpi,jpj,1/) ), zalbp, zalb ) 
    240          alb_ice(:,:,1) =  0.5 * ( zalbp(:,:,1) + zalb (:,:,1) )   ! Ice albedo (mean clear and overcast skys) 
    241          CALL iom_put( "icealb_cea", alb_ice(:,:,1) * fr_i(:,:) )  ! ice albedo 
    242       ENDIF 
     237#if defined key_coupled 
     238      tn_ice(:,:,1) = sist(:,:)          ! sea-ice surface temperature        
     239      ht_i(:,:,1) = hicif(:,:) 
     240      ht_s(:,:,1) = hsnif(:,:) 
     241      a_i(:,:,1) = fr_i(:,:) 
     242      !                                  ! Computation of snow/ice and ocean albedo 
     243      CALL albedo_ice( tn_ice, ht_i, ht_s, zalbp, zalb ) 
     244      alb_ice(:,:,1) =  0.5 * ( zalbp(:,:,1) + zalb (:,:,1) )   ! Ice albedo (mean clear and overcast skys) 
     245      CALL iom_put( "icealb_cea", alb_ice(:,:,1) * fr_i(:,:) )  ! ice albedo 
     246#endif 
    243247 
    244248      IF(ln_ctl) THEN            ! control print 
  • branches/2011/dev_NOC_UKMO_MERGE/NEMOGCM/NEMO/LIM_SRC_2/limthd_zdf_2.F90

    r2715 r3094  
    372372          DO ji = kideb, kiut 
    373373             sist_1d(ji) = MIN( ztsmlt(ji) , sist_1d(ji) ) 
     374             qla_ice_1d(ji) = -9999.   ! default definition, not used as parsub = 0. in this case 
    374375             zfcsu(ji)  = zksndh(ji) * ( ztbif(ji) - sist_1d(ji) ) 
    375376          END DO 
  • branches/2011/dev_NOC_UKMO_MERGE/NEMOGCM/NEMO/OPA_SRC/DIA/diahsb.F90

    r2528 r3094  
    1818   USE lib_mpp         ! distributed memory computing library 
    1919   USE trabbc          ! bottom boundary condition 
     20   USE obc_par         ! (for lk_obc) 
    2021   USE bdy_par         ! (for lk_bdy) 
    21    USE obc_par         ! (for lk_obc) 
    2222 
    2323   IMPLICIT NONE 
     
    205205      WRITE(numout,*) "dia_hsb: heat salt volume budgets activated" 
    206206      WRITE(numout,*) "~~~~~~~  output written in the 'heat_salt_volume_budgets.txt' ASCII file" 
    207       IF( lk_obc .OR. lk_bdy) THEN 
     207      IF( lk_obc .or. lk_bdy ) THEN 
    208208         CALL ctl_warn( 'dia_hsb does not take open boundary fluxes into account' )          
    209209      ENDIF 
  • branches/2011/dev_NOC_UKMO_MERGE/NEMOGCM/NEMO/OPA_SRC/DOM/dom_oce.F90

    r2715 r3094  
    150150   LOGICAL, PUBLIC, PARAMETER ::   lk_vvl = .FALSE.   !: fixed grid flag 
    151151#endif 
    152    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   hur  , hvr    !: inverse of u and v-points ocean depth (1/m) 
    153    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   hu   , hv     !: depth at u- and v-points (meters) 
    154    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   hu_0 , hv_0   !: refernce depth at u- and v-points (meters) 
     152   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:), TARGET ::   hur  , hvr    !: inverse of u and v-points ocean depth (1/m) 
     153   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)         ::   hu   , hv     !: depth at u- and v-points (meters) 
     154   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)         ::   hu_0 , hv_0   !: refernce depth at u- and v-points (meters) 
    155155 
    156156   INTEGER, PUBLIC ::   nla10              !: deepest    W level Above  ~10m (nlb10 - 1) 
  • branches/2011/dev_NOC_UKMO_MERGE/NEMOGCM/NEMO/OPA_SRC/DOM/dommsk.F90

    r2715 r3094  
    2525   USE oce             ! ocean dynamics and tracers 
    2626   USE dom_oce         ! ocean space and time domain 
    27    USE obc_oce         ! ocean open boundary conditions 
    2827   USE in_out_manager  ! I/O manager 
    2928   USE lbclnk          ! ocean lateral boundary conditions (or mpp link) 
  • branches/2011/dev_NOC_UKMO_MERGE/NEMOGCM/NEMO/OPA_SRC/DOM/domzgr.F90

    r2715 r3094  
    14951495      ! 
    14961496!!    H. Liu, POL. April 2009. Added for passing the scale check for the new released vvl code. 
     1497      where (e3t   (:,:,:).eq.0.0)  e3t(:,:,:) = 1.0 
     1498      where (e3u   (:,:,:).eq.0.0)  e3u(:,:,:) = 1.0 
     1499      where (e3v   (:,:,:).eq.0.0)  e3v(:,:,:) = 1.0 
     1500      where (e3f   (:,:,:).eq.0.0)  e3f(:,:,:) = 1.0 
     1501      where (e3w   (:,:,:).eq.0.0)  e3w(:,:,:) = 1.0 
     1502      where (e3uw  (:,:,:).eq.0.0)  e3uw(:,:,:) = 1.0 
     1503      where (e3vw  (:,:,:).eq.0.0)  e3vw(:,:,:) = 1.0 
     1504 
    14971505 
    14981506      fsdept(:,:,:) = gdept (:,:,:) 
  • branches/2011/dev_NOC_UKMO_MERGE/NEMOGCM/NEMO/OPA_SRC/DOM/phycst.F90

    r2528 r3094  
    99   !!              -   !  2006-08  (G. Madec)  style  
    1010   !!             3.2  !  2006-08  (S. Masson, G. Madec)  suppress useless variables + style  
     11   !!             3.4  !  2011-11  (C. Harris)  minor changes for CICE constants  
    1112   !!---------------------------------------------------------------------- 
    1213 
     
    4849#endif 
    4950 
     51#if defined key_cice 
     52   REAL(wp), PUBLIC ::   rau0     = 1026._wp      !: reference volumic mass (density)  (kg/m3) 
     53#else 
    5054   REAL(wp), PUBLIC ::   rau0     = 1035._wp      !: reference volumic mass (density)  (kg/m3) 
     55#endif 
    5156   REAL(wp), PUBLIC ::   rau0r                    !: reference specific volume         (m3/kg) 
    5257   REAL(wp), PUBLIC ::   rcp      =    4.e+3_wp   !: ocean specific heat 
    5358   REAL(wp), PUBLIC ::   ro0cpr                   !: = 1. / ( rau0 * rcp ) 
    5459 
    55 #if defined key_lim3 
     60#if defined key_lim3 || defined key_cice 
    5661   REAL(wp), PUBLIC ::   rcdsn   =   0.31_wp      !: thermal conductivity of snow 
    5762   REAL(wp), PUBLIC ::   rcdic   =   2.034396_wp  !: thermal conductivity of fresh ice 
     
    100105      rsiyea = 365.25 * rday * 2. * rpi / 6.283076 
    101106      rsiday = rday / ( 1. + rday / rsiyea ) 
     107#if defined key_cice 
     108      omega =  7.292116e-05 
     109#else 
    102110      omega  = 2. * rpi / rsiday  
     111#endif 
    103112 
    104113      rau0r  = 1. /   rau0   
     
    155164         WRITE(numout,*) '          latent heat of fusion of fresh ice / snow = ', lfus    , ' J/kg' 
    156165         WRITE(numout,*) '          latent heat of subl.  of fresh ice / snow = ', lsub    , ' J/kg' 
     166#elif defined key_cice 
     167         WRITE(numout,*) '          latent heat of fusion of fresh ice / snow = ', lfus    , ' J/kg' 
    157168#else 
    158169         WRITE(numout,*) '          density times specific heat for snow      = ', rcpsn   , ' J/m^3/K'  
  • branches/2011/dev_NOC_UKMO_MERGE/NEMOGCM/NEMO/OPA_SRC/DYN/divcur.F90

    r2715 r3094  
    2727   USE sbc_oce, ONLY : ln_rnf   ! surface boundary condition: ocean 
    2828   USE sbcrnf          ! river runoff  
    29    USE obc_oce         ! ocean lateral open boundary condition 
    3029   USE cla             ! cross land advection             (cla_div routine) 
    3130   USE in_out_manager  ! I/O manager 
     
    121120         END DO 
    122121 
    123 #if defined key_obc 
    124          IF( Agrif_Root() ) THEN 
    125             ! open boundaries (div must be zero behind the open boundary) 
    126             !  mpp remark: The zeroing of hdivn can probably be extended to 1->jpi/jpj for the correct row/column 
    127             IF( lp_obc_east  )   hdivn(nie0p1:nie1p1,nje0  :nje1  ,jk) = 0.e0      ! east 
    128             IF( lp_obc_west  )   hdivn(niw0  :niw1  ,njw0  :njw1  ,jk) = 0.e0      ! west 
    129             IF( lp_obc_north )   hdivn(nin0  :nin1  ,njn0p1:njn1p1,jk) = 0.e0      ! north 
    130             IF( lp_obc_south )   hdivn(nis0  :nis1  ,njs0  :njs1  ,jk) = 0.e0      ! south 
    131          ENDIF 
    132 #endif          
    133122         IF( .NOT. AGRIF_Root() ) THEN 
    134123            IF ((nbondi ==  1).OR.(nbondi == 2)) hdivn(nlci-1 , :     ,jk) = 0.e0      ! east 
     
    304293         END DO   
    305294 
    306 #if defined key_obc 
    307          IF( Agrif_Root() ) THEN 
    308             ! open boundaries (div must be zero behind the open boundary) 
    309             !  mpp remark: The zeroing of hdivn can probably be extended to 1->jpi/jpj for the correct row/column 
    310             IF( lp_obc_east  )   hdivn(nie0p1:nie1p1,nje0  :nje1  ,jk) = 0.e0      ! east 
    311             IF( lp_obc_west  )   hdivn(niw0  :niw1  ,njw0  :njw1  ,jk) = 0.e0      ! west 
    312             IF( lp_obc_north )   hdivn(nin0  :nin1  ,njn0p1:njn1p1,jk) = 0.e0      ! north 
    313             IF( lp_obc_south )   hdivn(nis0  :nis1  ,njs0  :njs1  ,jk) = 0.e0      ! south 
    314          ENDIF 
    315 #endif          
    316295         IF( .NOT. AGRIF_Root() ) THEN 
    317296            IF ((nbondi ==  1).OR.(nbondi == 2)) hdivn(nlci-1 , :     ,jk) = 0.e0      ! east 
  • branches/2011/dev_NOC_UKMO_MERGE/NEMOGCM/NEMO/OPA_SRC/DYN/dynnxt.F90

    r2779 r3094  
    3333   USE obcdyn_bt       ! 2D open boundary condition for momentum (obc_dyn_bt routine) 
    3434   USE obcvol          ! ocean open boundary condition (obc_vol routines) 
    35    USE bdy_oce         ! unstructured open boundary conditions 
    36    USE bdydta          ! unstructured open boundary conditions 
    37    USE bdydyn          ! unstructured open boundary conditions 
     35   USE bdy_oce         ! ocean open boundary conditions 
     36   USE bdydta          ! ocean open boundary conditions 
     37   USE bdydyn          ! ocean open boundary conditions 
     38   USE bdyvol          ! ocean open boundary condition (bdy_vol routines) 
    3839   USE in_out_manager  ! I/O manager 
    3940   USE lbclnk          ! lateral boundary condition (or mpp link) 
     
    7778      !!              * Apply lateral boundary conditions on after velocity  
    7879      !!             at the local domain boundaries through lbc_lnk call, 
    79       !!             at the radiative open boundaries (lk_obc=T), 
    80       !!             at the relaxed   open boundaries (lk_bdy=T), and 
     80      !!             at the one-way open boundaries (lk_obc=T), 
    8181      !!             at the AGRIF zoom     boundaries (lk_agrif=T) 
    8282      !! 
     
    174174      ENDIF 
    175175      ! 
    176 # elif defined key_bdy  
     176# elif defined key_bdy 
    177177      !                                !* BDY open boundaries 
    178       IF( .NOT. lk_dynspg_flt ) THEN 
    179          CALL bdy_dyn_frs( kt ) 
    180 #  if ! defined key_vvl 
    181          ua_e(:,:) = 0.e0 
    182          va_e(:,:) = 0.e0 
    183          ! Set these variables for use in bdy_dyn_fla 
    184          hur_e(:,:) = hur(:,:) 
    185          hvr_e(:,:) = hvr(:,:) 
    186          DO jk = 1, jpkm1   !! Vertically integrated momentum trends 
    187             ua_e(:,:) = ua_e(:,:) + fse3u(:,:,jk) * umask(:,:,jk) * ua(:,:,jk) 
    188             va_e(:,:) = va_e(:,:) + fse3v(:,:,jk) * vmask(:,:,jk) * va(:,:,jk) 
    189          END DO 
    190          ua_e(:,:) = ua_e(:,:) * hur(:,:) 
    191          va_e(:,:) = va_e(:,:) * hvr(:,:) 
    192          DO jk = 1 , jpkm1 
    193             ua(:,:,jk) = ua(:,:,jk) - ua_e(:,:) 
    194             va(:,:,jk) = va(:,:,jk) - va_e(:,:) 
    195          END DO 
    196          CALL bdy_dta_fla( kt+1, 0,2*nn_baro) 
    197          CALL bdy_dyn_fla( sshn_b ) 
    198          CALL lbc_lnk( ua_e, 'U', -1. )   ! Boundary points should be updated 
    199          CALL lbc_lnk( va_e, 'V', -1. )   ! 
    200          DO jk = 1 , jpkm1 
    201             ua(:,:,jk) = ( ua(:,:,jk) + ua_e(:,:) ) * umask(:,:,jk) 
    202             va(:,:,jk) = ( va(:,:,jk) + va_e(:,:) ) * vmask(:,:,jk) 
    203          END DO 
    204 #  endif 
    205       ENDIF 
     178      IF( lk_dynspg_exp ) CALL bdy_dyn( kt ) 
     179      IF( lk_dynspg_ts )  CALL bdy_dyn( kt, dyn3d_only=.true. ) 
     180 
     181!!$   Do we need a call to bdy_vol here?? 
     182      ! 
    206183# endif 
    207184      ! 
  • branches/2011/dev_NOC_UKMO_MERGE/NEMOGCM/NEMO/OPA_SRC/DYN/dynspg.F90

    r2715 r3094  
    1515   USE dom_oce        ! ocean space and time domain variables 
    1616   USE phycst         ! physical constants 
    17    USE obc_oce        ! ocean open boundary conditions 
    1817   USE sbc_oce        ! surface boundary condition: ocean 
    1918   USE sbcapr         ! surface boundary condition: atmospheric pressure 
     
    222221      ENDIF 
    223222 
    224 #if defined key_obc 
    225       !                        ! Conservation of ocean volume (key_dynspg_flt) 
    226       IF( lk_dynspg_flt )   ln_vol_cst = .true. 
    227  
    228       !                        ! Application of Flather's algorithm at open boundaries 
    229       IF( lk_dynspg_flt )   ln_obc_fla = .false. 
    230       IF( lk_dynspg_exp )   ln_obc_fla = .true. 
    231       IF( lk_dynspg_ts  )   ln_obc_fla = .true. 
    232 #endif 
    233223      ! 
    234224   END SUBROUTINE dyn_spg_init 
  • branches/2011/dev_NOC_UKMO_MERGE/NEMOGCM/NEMO/OPA_SRC/DYN/dynspg_exp.F90

    r2715 r3094  
    2121   USE phycst          ! physical constants 
    2222   USE obc_par         ! open boundary condition parameters 
    23    USE obcdta          ! open boundary condition data     (obc_dta_bt routine) 
     23   USE obcdta          ! open boundary condition data     (bdy_dta_bt routine) 
    2424   USE in_out_manager  ! I/O manager 
    2525   USE lib_mpp         ! distributed memory computing library 
  • branches/2011/dev_NOC_UKMO_MERGE/NEMOGCM/NEMO/OPA_SRC/DYN/dynspg_flt.F90

    r2715 r3094  
    2626   USE sbc_oce         ! surface boundary condition: ocean 
    2727   USE obc_oce         ! Lateral open boundary condition 
     28   USE bdy_oce         ! Lateral open boundary condition 
    2829   USE sol_oce         ! ocean elliptic solver 
    2930   USE phycst          ! physical constants 
     
    3334   USE solpcg          ! preconditionned conjugate gradient solver 
    3435   USE solsor          ! Successive Over-relaxation solver 
    35    USE obcdyn          ! ocean open boundary condition (obc_dyn routines) 
    36    USE obcvol          ! ocean open boundary condition (obc_vol routines) 
    37    USE bdy_oce         ! Unstructured open boundaries condition 
    38    USE bdydyn          ! Unstructured open boundaries condition (bdy_dyn routine)  
    39    USE bdyvol          ! Unstructured open boundaries condition (bdy_vol routine) 
     36   USE obcdyn          ! ocean open boundary condition on dynamics 
     37   USE obcvol          ! ocean open boundary condition (obc_vol routine) 
     38   USE bdydyn          ! ocean open boundary condition on dynamics 
     39   USE bdyvol          ! ocean open boundary condition (bdy_vol routine) 
    4040   USE cla             ! cross land advection 
    4141   USE in_out_manager  ! I/O manager 
     
    187187#endif 
    188188#if defined key_bdy 
    189       CALL bdy_dyn_frs( kt )       ! Update velocities on unstructured boundary using the Flow Relaxation Scheme 
    190       CALL bdy_vol( kt )           ! Correction of the barotropic component velocity to control the volume of the system 
     189      CALL bdy_dyn( kt )      ! Update velocities on each open boundary 
     190      CALL bdy_vol( kt )      ! Correction of the barotropic component velocity to control the volume of the system 
    191191#endif 
    192192#if defined key_agrif 
     
    304304#if defined key_obc 
    305305            ! caution : grad D = 0 along open boundaries 
     306            ! Remark: The filtering force could be reduced here in the FRS zone 
     307            !         by multiplying spgu/spgv by (1-alpha) ??   
    306308            spgu(ji,jj) = z2dt * ztdgu * obcumask(ji,jj) 
    307309            spgv(ji,jj) = z2dt * ztdgv * obcvmask(ji,jj) 
    308310#elif defined key_bdy 
    309311            ! caution : grad D = 0 along open boundaries 
    310             ! Remark: The filtering force could be reduced here in the FRS zone 
    311             !         by multiplying spgu/spgv by (1-alpha) ??   
    312312            spgu(ji,jj) = z2dt * ztdgu * bdyumask(ji,jj) 
    313             spgv(ji,jj) = z2dt * ztdgv * bdyvmask(ji,jj)            
     313            spgv(ji,jj) = z2dt * ztdgv * bdyvmask(ji,jj) 
    314314#else 
    315315            spgu(ji,jj) = z2dt * ztdgu 
  • branches/2011/dev_NOC_UKMO_MERGE/NEMOGCM/NEMO/OPA_SRC/DYN/dynspg_oce.F90

    r2715 r3094  
    3434 
    3535  !                                                                         !!! Time splitting scheme (key_dynspg_ts)  
    36    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   sshn_e, ssha_e   ! sea surface heigth (now, after, average) 
    37    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   ua_e  , va_e     ! barotropic velocities (after) 
    38    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   hu_e  , hv_e     ! now ocean depth ( = Ho+sshn_e ) 
    39    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   hur_e , hvr_e    ! inverse of hu_e and hv_e 
    40    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   sshn_b       ! before field without time-filter 
     36   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:), TARGET ::   sshn_e, ssha_e   ! sea surface heigth (now, after, average) 
     37   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:), TARGET ::   ua_e  , va_e     ! barotropic velocities (after) 
     38   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)         ::   hu_e  , hv_e     ! now ocean depth ( = Ho+sshn_e ) 
     39   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:), TARGET ::   hur_e , hvr_e    ! inverse of hu_e and hv_e 
     40   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:), TARGET ::   sshn_b           ! before field without time-filter 
    4141 
    4242   !!---------------------------------------------------------------------- 
  • branches/2011/dev_NOC_UKMO_MERGE/NEMOGCM/NEMO/OPA_SRC/DYN/dynspg_ts.F90

    r2724 r3094  
    2525   USE domvvl          ! variable volume 
    2626   USE zdfbfr          ! bottom friction 
    27    USE obcdta          ! open boundary condition data      
    28    USE obcfla          ! Flather open boundary condition   
    2927   USE dynvor          ! vorticity term 
    3028   USE obc_oce         ! Lateral open boundary condition 
    3129   USE obc_par         ! open boundary condition parameters 
    32    USE bdy_oce         ! unstructured open boundaries 
    33    USE bdy_par         ! unstructured open boundaries 
    34    USE bdydta          ! unstructured open boundaries 
    35    USE bdydyn          ! unstructured open boundaries 
    36    USE bdytides        ! tidal forcing at unstructured open boundaries. 
     30   USE obcdta          ! open boundary condition data      
     31   USE obcfla          ! Flather open boundary condition   
     32   USE bdy_par         ! for lk_bdy 
     33   USE bdy_oce         ! Lateral open boundary condition 
     34   USE bdydta          ! open boundary condition data      
     35   USE bdydyn2d        ! open boundary conditions on barotropic variables 
    3736   USE lib_mpp         ! distributed memory computing library 
    3837   USE lbclnk          ! ocean lateral boundary conditions (or mpp link) 
     
    367366         IF( jn == 1 )   z2dt_e = rdt / nn_baro 
    368367 
    369          !                                                !* Update the forcing (OBC, BDY and tides) 
     368         !                                                !* Update the forcing (BDY and tides) 
    370369         !                                                !  ------------------ 
    371370         IF( lk_obc )   CALL obc_dta_bt ( kt, jn   ) 
    372          IF( lk_bdy )   CALL bdy_dta_fla( kt, jn+1, icycle ) 
     371         IF( lk_bdy )   CALL bdy_dta ( kt, jit=jn, time_offset=+1 ) 
    373372 
    374373         !                                                !* after ssh_e 
     
    489488         !                                                !* domain lateral boundary 
    490489         !                                                !  ----------------------- 
    491          !                                                      ! Flather's boundary condition for the barotropic loop : 
    492          !                                                      !         - Update sea surface height on each open boundary 
    493          !                                                      !         - Correct the velocity 
    494  
     490 
     491                                                               ! OBC open boundaries 
    495492         IF( lk_obc               )   CALL obc_fla_ts ( ua_e, va_e, sshn_e, ssha_e ) 
    496          IF( lk_bdy .OR. ln_tides )   CALL bdy_dyn_fla( sshn_e )  
     493 
     494                                                               ! BDY open boundaries 
     495#if defined key_bdy 
     496         pssh => sshn_e 
     497         phur => hur_e 
     498         phvr => hvr_e 
     499         pu2d => ua_e 
     500         pv2d => va_e 
     501 
     502         IF( lk_bdy )   CALL bdy_dyn2d( kt )  
     503#endif 
     504 
    497505         ! 
    498506         CALL lbc_lnk( ua_e  , 'U', -1. )                      ! local domain boundaries  
  • branches/2011/dev_NOC_UKMO_MERGE/NEMOGCM/NEMO/OPA_SRC/DYN/sshwzv.F90

    r2715 r3094  
    182182#if defined key_bdy 
    183183      ssha(:,:) = ssha(:,:) * bdytmask(:,:) 
    184       CALL lbc_lnk( ssha, 'T', 1. )  
     184      CALL lbc_lnk( ssha, 'T', 1. )                 ! absolutly compulsory !! (jmm) 
    185185#endif 
    186186 
  • branches/2011/dev_NOC_UKMO_MERGE/NEMOGCM/NEMO/OPA_SRC/FLO/floblk.F90

    r2715 r3094  
    345345      ! more time.       
    346346# if defined key_obc 
    347       DO jfl = 1, jpnfl 
    348          IF( lp_obc_east ) THEN 
    349             IF( jped <=  zgjfl(jfl) .AND. zgjfl(jfl) <= jpef .AND. nieob-1 <=  zgifl(jfl) ) THEN 
    350                zgifl (jfl) = INT(zgifl(jfl)) + 0.5 
    351                zgjfl (jfl) = INT(zgjfl(jfl)) + 0.5 
    352                zagefl(jfl) = rdt 
    353             END IF 
    354          END IF 
    355          IF( lp_obc_west ) THEN 
    356             IF( jpwd <= zgjfl(jfl) .AND. zgjfl(jfl) <= jpwf .AND. niwob >=  zgifl(jfl) ) THEN 
    357                zgifl (jfl) = INT(zgifl(jfl)) + 0.5 
    358                zgjfl (jfl) = INT(zgjfl(jfl)) + 0.5 
    359                zagefl(jfl) = rdt 
    360             END IF 
    361          END IF 
    362          IF( lp_obc_north ) THEN 
    363             IF( jpnd <=  zgifl(jfl) .AND. zgifl(jfl) <= jpnf .AND. njnob-1 >=  zgjfl(jfl) ) THEN 
    364                zgifl (jfl) = INT(zgifl(jfl)) + 0.5 
    365                zgjfl (jfl) = INT(zgjfl(jfl)) + 0.5 
    366                zagefl(jfl) = rdt 
    367             END IF 
    368          END IF 
    369          IF( lp_obc_south ) THEN 
    370             IF( jpsd <=  zgifl(jfl) .AND. zgifl(jfl) <= jpsf .AND.  njsob >= zgjfl(jfl) ) THEN 
    371                zgifl (jfl) = INT(zgifl(jfl)) + 0.5 
    372                zgjfl (jfl) = INT(zgjfl(jfl)) + 0.5 
    373                zagefl(jfl) = rdt 
    374             END IF 
    375          END IF 
    376       END DO 
     347!!!!!!!! NEED TO SORT THIS OUT !!!!!!!! 
     348!!$      DO jfl = 1, jpnfl 
     349!!$         IF( lp_obc_east ) THEN 
     350!!$            IF( jped <=  zgjfl(jfl) .AND. zgjfl(jfl) <= jpef .AND. nieob-1 <=  zgifl(jfl) ) THEN 
     351!!$               zgifl (jfl) = INT(zgifl(jfl)) + 0.5 
     352!!$               zgjfl (jfl) = INT(zgjfl(jfl)) + 0.5 
     353!!$               zagefl(jfl) = rdt 
     354!!$            END IF 
     355!!$         END IF 
     356!!$         IF( lp_obc_west ) THEN 
     357!!$            IF( jpwd <= zgjfl(jfl) .AND. zgjfl(jfl) <= jpwf .AND. niwob >=  zgifl(jfl) ) THEN 
     358!!$               zgifl (jfl) = INT(zgifl(jfl)) + 0.5 
     359!!$               zgjfl (jfl) = INT(zgjfl(jfl)) + 0.5 
     360!!$               zagefl(jfl) = rdt 
     361!!$            END IF 
     362!!$         END IF 
     363!!$         IF( lp_obc_north ) THEN 
     364!!$            IF( jpnd <=  zgifl(jfl) .AND. zgifl(jfl) <= jpnf .AND. njnob-1 >=  zgjfl(jfl) ) THEN 
     365!!$               zgifl (jfl) = INT(zgifl(jfl)) + 0.5 
     366!!$               zgjfl (jfl) = INT(zgjfl(jfl)) + 0.5 
     367!!$               zagefl(jfl) = rdt 
     368!!$            END IF 
     369!!$         END IF 
     370!!$         IF( lp_obc_south ) THEN 
     371!!$            IF( jpsd <=  zgifl(jfl) .AND. zgifl(jfl) <= jpsf .AND.  njsob >= zgjfl(jfl) ) THEN 
     372!!$               zgifl (jfl) = INT(zgifl(jfl)) + 0.5 
     373!!$               zgjfl (jfl) = INT(zgjfl(jfl)) + 0.5 
     374!!$               zagefl(jfl) = rdt 
     375!!$            END IF 
     376!!$         END IF 
     377!!$      END DO 
    377378#endif 
    378379 
  • branches/2011/dev_NOC_UKMO_MERGE/NEMOGCM/NEMO/OPA_SRC/IOM/prtctl.F90

    r2715 r3094  
    55   !!====================================================================== 
    66   !! History :  9.0  !  05-07  (C. Talandier) original code 
     7   !!            3.4  !  11-11  (C. Harris) decomposition changes for running with CICE 
    78   !!---------------------------------------------------------------------- 
    89   USE dom_oce          ! ocean space and time domain variables 
     
    434435 
    435436      ijpi = ( jpiglo-2*jpreci + (isplt-1) ) / isplt + 2*jpreci 
     437#if defined key_nemocice_decomp 
     438      ijpj = ( jpjglo+1-2*jprecj + (jsplt-1) ) / jsplt + 2*jprecj  
     439#else 
    436440      ijpj = ( jpjglo-2*jprecj + (jsplt-1) ) / jsplt + 2*jprecj 
     441#endif 
    437442 
    438443      ALLOCATE(ilcitl (isplt,jsplt)) 
     
    445450 
    446451      IF(  irestil == 0 )   irestil = isplt 
     452#if defined key_nemocice_decomp 
     453 
     454      ! In order to match CICE the size of domains in NEMO has to be changed 
     455      ! The last line of blocks (west) will have fewer points  
     456      DO jj = 1, jsplt  
     457         DO ji=1, isplt-1  
     458            ilcitl(ji,jj) = ijpi  
     459         END DO  
     460         ilcitl(isplt,jj) = jpiglo - (isplt - 1) * (ijpi - nrecil) 
     461      END DO  
     462 
     463#else  
     464 
    447465      DO jj = 1, jsplt 
    448466         DO ji = 1, irestil 
     
    453471         END DO 
    454472      END DO 
     473 
     474#endif 
    455475       
    456476      IF( irestjl == 0 )   irestjl = jsplt 
     477#if defined key_nemocice_decomp  
     478 
     479      ! Same change to domains in North-South direction as in East-West.  
     480      DO ji = 1, isplt  
     481         DO jj=1, jsplt-1  
     482            ilcjtl(ji,jj) = ijpj  
     483         END DO  
     484         ilcjtl(ji,jsplt) = jpjglo - (jsplt - 1) * (ijpj - nrecjl) 
     485      END DO  
     486 
     487#else  
     488 
    457489      DO ji = 1, isplt 
    458490         DO jj = 1, irestjl 
     
    463495         END DO 
    464496      END DO 
    465        
     497 
     498#endif 
    466499      zidom = nrecil 
    467500      DO ji = 1, isplt 
  • branches/2011/dev_NOC_UKMO_MERGE/NEMOGCM/NEMO/OPA_SRC/LBC/lib_mpp.F90

    r2731 r3094  
    4747   !!   mppsync       : 
    4848   !!   mppstop       : 
    49    !!   mppobc        : variant of mpp_lnk for open boundary condition 
    5049   !!   mpp_ini_north : initialisation of north fold 
    5150   !!   mpp_lbc_north : north fold processors gathering 
     
    6463   PUBLIC   mpp_min, mpp_max, mpp_sum, mpp_minloc, mpp_maxloc 
    6564   PUBLIC   mpp_lnk_3d, mpp_lnk_3d_gather, mpp_lnk_2d, mpp_lnk_2d_e 
    66    PUBLIC   mppobc, mpp_ini_ice, mpp_ini_znl 
     65   PUBLIC   mpp_ini_ice, mpp_ini_znl 
    6766   PUBLIC   mppsize 
    6867   PUBLIC   lib_mpp_alloc   ! Called in nemogcm.F90 
     
    17261725   END SUBROUTINE mppstop 
    17271726 
    1728  
    1729    SUBROUTINE mppobc( ptab, kd1, kd2, kl, kk, ktype, kij , kumout) 
    1730       !!---------------------------------------------------------------------- 
    1731       !!                  ***  routine mppobc  *** 
    1732       !!  
    1733       !! ** Purpose :   Message passing manadgement for open boundary 
    1734       !!     conditions array 
    1735       !! 
    1736       !! ** Method  :   Use mppsend and mpprecv function for passing mask 
    1737       !!       between processors following neighboring subdomains. 
    1738       !!       domain parameters 
    1739       !!                    nlci   : first dimension of the local subdomain 
    1740       !!                    nlcj   : second dimension of the local subdomain 
    1741       !!                    nbondi : mark for "east-west local boundary" 
    1742       !!                    nbondj : mark for "north-south local boundary" 
    1743       !!                    noea   : number for local neighboring processors  
    1744       !!                    nowe   : number for local neighboring processors 
    1745       !!                    noso   : number for local neighboring processors 
    1746       !!                    nono   : number for local neighboring processors 
    1747       !! 
    1748       !!---------------------------------------------------------------------- 
    1749       USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released 
    1750       USE wrk_nemo, ONLY:   ztab => wrk_2d_1 
    1751       ! 
    1752       INTEGER , INTENT(in   )                     ::   kd1, kd2   ! starting and ending indices 
    1753       INTEGER , INTENT(in   )                     ::   kl         ! index of open boundary 
    1754       INTEGER , INTENT(in   )                     ::   kk         ! vertical dimension 
    1755       INTEGER , INTENT(in   )                     ::   ktype      ! define north/south or east/west cdt 
    1756       !                                                           !  = 1  north/south  ;  = 2  east/west 
    1757       INTEGER , INTENT(in   )                     ::   kij        ! horizontal dimension 
    1758       INTEGER , INTENT(in   )                     ::   kumout     ! ocean.output logical unit 
    1759       REAL(wp), INTENT(inout), DIMENSION(kij,kk)  ::   ptab       ! variable array 
    1760       ! 
    1761       INTEGER ::   ji, jj, jk, jl        ! dummy loop indices 
    1762       INTEGER ::   iipt0, iipt1, ilpt1   ! local integers 
    1763       INTEGER ::   ijpt0, ijpt1          !   -       - 
    1764       INTEGER ::   imigr, iihom, ijhom   !   -       - 
    1765       INTEGER ::   ml_req1, ml_req2, ml_err    ! for key_mpi_isend 
    1766       INTEGER ::   ml_stat(MPI_STATUS_SIZE)    ! for key_mpi_isend 
    1767       !!---------------------------------------------------------------------- 
    1768  
    1769       IF( wrk_in_use(2, 1) ) THEN 
    1770          WRITE(kumout, cform_err) 
    1771          WRITE(kumout,*) 'mppobc : requested workspace array unavailable' 
    1772          CALL mppstop 
    1773       ENDIF 
    1774  
    1775       ! boundary condition initialization 
    1776       ! --------------------------------- 
    1777       ztab(:,:) = 0.e0 
    1778       ! 
    1779       IF( ktype==1 ) THEN                                  ! north/south boundaries 
    1780          iipt0 = MAX( 1, MIN(kd1 - nimpp+1, nlci     ) ) 
    1781          iipt1 = MAX( 0, MIN(kd2 - nimpp+1, nlci - 1 ) ) 
    1782          ilpt1 = MAX( 1, MIN(kd2 - nimpp+1, nlci     ) ) 
    1783          ijpt0 = MAX( 1, MIN(kl  - njmpp+1, nlcj     ) ) 
    1784          ijpt1 = MAX( 0, MIN(kl  - njmpp+1, nlcj - 1 ) ) 
    1785       ELSEIF( ktype==2 ) THEN                              ! east/west boundaries 
    1786          iipt0 = MAX( 1, MIN(kl  - nimpp+1, nlci     ) ) 
    1787          iipt1 = MAX( 0, MIN(kl  - nimpp+1, nlci - 1 ) ) 
    1788          ijpt0 = MAX( 1, MIN(kd1 - njmpp+1, nlcj     ) ) 
    1789          ijpt1 = MAX( 0, MIN(kd2 - njmpp+1, nlcj - 1 ) ) 
    1790          ilpt1 = MAX( 1, MIN(kd2 - njmpp+1, nlcj     ) ) 
    1791       ELSE 
    1792          WRITE(kumout, cform_err) 
    1793          WRITE(kumout,*) 'mppobc : bad ktype' 
    1794          CALL mppstop 
    1795       ENDIF 
    1796        
    1797       ! Communication level by level 
    1798       ! ---------------------------- 
    1799 !!gm Remark : this is very time consumming!!! 
    1800       !                                         ! ------------------------ ! 
    1801       DO jk = 1, kk                             !   Loop over the levels   ! 
    1802          !                                      ! ------------------------ ! 
    1803          ! 
    1804          IF( ktype == 1 ) THEN                               ! north/south boundaries 
    1805             DO jj = ijpt0, ijpt1 
    1806                DO ji = iipt0, iipt1 
    1807                   ztab(ji,jj) = ptab(ji,jk) 
    1808                END DO 
    1809             END DO 
    1810          ELSEIF( ktype == 2 ) THEN                           ! east/west boundaries 
    1811             DO jj = ijpt0, ijpt1 
    1812                DO ji = iipt0, iipt1 
    1813                   ztab(ji,jj) = ptab(jj,jk) 
    1814                END DO 
    1815             END DO 
    1816          ENDIF 
    1817  
    1818  
    1819          ! 1. East and west directions 
    1820          ! --------------------------- 
    1821          ! 
    1822          IF( nbondi /= 2 ) THEN         ! Read Dirichlet lateral conditions 
    1823             iihom = nlci-nreci 
    1824             DO jl = 1, jpreci 
    1825                t2ew(:,jl,1) = ztab(jpreci+jl,:) 
    1826                t2we(:,jl,1) = ztab(iihom +jl,:) 
    1827             END DO 
    1828          ENDIF 
    1829          ! 
    1830          !                              ! Migrations 
    1831          imigr=jpreci*jpj 
    1832          ! 
    1833          IF( nbondi == -1 ) THEN 
    1834             CALL mppsend( 2, t2we(1,1,1), imigr, noea, ml_req1 ) 
    1835             CALL mpprecv( 1, t2ew(1,1,2), imigr ) 
    1836             IF(l_isend)   CALL mpi_wait( ml_req1, ml_stat, ml_err ) 
    1837          ELSEIF( nbondi == 0 ) THEN 
    1838             CALL mppsend( 1, t2ew(1,1,1), imigr, nowe, ml_req1 ) 
    1839             CALL mppsend( 2, t2we(1,1,1), imigr, noea, ml_req2 ) 
    1840             CALL mpprecv( 1, t2ew(1,1,2), imigr ) 
    1841             CALL mpprecv( 2, t2we(1,1,2), imigr ) 
    1842             IF(l_isend)   CALL mpi_wait( ml_req1, ml_stat, ml_err ) 
    1843             IF(l_isend)   CALL mpi_wait( ml_req2, ml_stat, ml_err ) 
    1844          ELSEIF( nbondi == 1 ) THEN 
    1845             CALL mppsend( 1, t2ew(1,1,1), imigr, nowe, ml_req1 ) 
    1846             CALL mpprecv( 2, t2we(1,1,2), imigr ) 
    1847             IF(l_isend) CALL mpi_wait( ml_req1, ml_stat, ml_err ) 
    1848          ENDIF 
    1849          ! 
    1850          !                              ! Write Dirichlet lateral conditions 
    1851          iihom = nlci-jpreci 
    1852          ! 
    1853          IF( nbondi == 0 .OR. nbondi == 1 ) THEN 
    1854             DO jl = 1, jpreci 
    1855                ztab(jl,:) = t2we(:,jl,2) 
    1856             END DO 
    1857          ENDIF 
    1858          IF( nbondi == -1 .OR. nbondi == 0 ) THEN 
    1859             DO jl = 1, jpreci 
    1860                ztab(iihom+jl,:) = t2ew(:,jl,2) 
    1861             END DO 
    1862          ENDIF 
    1863  
    1864  
    1865          ! 2. North and south directions 
    1866          ! ----------------------------- 
    1867          ! 
    1868          IF( nbondj /= 2 ) THEN         ! Read Dirichlet lateral conditions 
    1869             ijhom = nlcj-nrecj 
    1870             DO jl = 1, jprecj 
    1871                t2sn(:,jl,1) = ztab(:,ijhom +jl) 
    1872                t2ns(:,jl,1) = ztab(:,jprecj+jl) 
    1873             END DO 
    1874          ENDIF 
    1875          ! 
    1876          !                              ! Migrations 
    1877          imigr = jprecj * jpi 
    1878          ! 
    1879          IF( nbondj == -1 ) THEN 
    1880             CALL mppsend( 4, t2sn(1,1,1), imigr, nono, ml_req1 ) 
    1881             CALL mpprecv( 3, t2ns(1,1,2), imigr ) 
    1882             IF(l_isend) CALL mpi_wait( ml_req1, ml_stat, ml_err ) 
    1883          ELSEIF( nbondj == 0 ) THEN 
    1884             CALL mppsend( 3, t2ns(1,1,1), imigr, noso, ml_req1 ) 
    1885             CALL mppsend( 4, t2sn(1,1,1), imigr, nono, ml_req2 ) 
    1886             CALL mpprecv( 3, t2ns(1,1,2), imigr ) 
    1887             CALL mpprecv( 4, t2sn(1,1,2), imigr ) 
    1888             IF( l_isend )   CALL mpi_wait( ml_req1, ml_stat, ml_err ) 
    1889             IF( l_isend )   CALL mpi_wait( ml_req2, ml_stat, ml_err ) 
    1890          ELSEIF( nbondj == 1 ) THEN 
    1891             CALL mppsend( 3, t2ns(1,1,1), imigr, noso, ml_req1 ) 
    1892             CALL mpprecv( 4, t2sn(1,1,2), imigr) 
    1893             IF( l_isend )   CALL mpi_wait( ml_req1, ml_stat, ml_err ) 
    1894          ENDIF 
    1895          ! 
    1896          !                              ! Write Dirichlet lateral conditions 
    1897          ijhom = nlcj - jprecj 
    1898          IF( nbondj == 0 .OR. nbondj == 1 ) THEN 
    1899             DO jl = 1, jprecj 
    1900                ztab(:,jl) = t2sn(:,jl,2) 
    1901             END DO 
    1902          ENDIF 
    1903          IF( nbondj == 0 .OR. nbondj == -1 ) THEN 
    1904             DO jl = 1, jprecj 
    1905                ztab(:,ijhom+jl) = t2ns(:,jl,2) 
    1906             END DO 
    1907          ENDIF 
    1908          IF( ktype==1 .AND. kd1 <= jpi+nimpp-1 .AND. nimpp <= kd2 ) THEN 
    1909             DO jj = ijpt0, ijpt1            ! north/south boundaries 
    1910                DO ji = iipt0,ilpt1 
    1911                   ptab(ji,jk) = ztab(ji,jj)   
    1912                END DO 
    1913             END DO 
    1914          ELSEIF( ktype==2 .AND. kd1 <= jpj+njmpp-1 .AND. njmpp <= kd2 ) THEN 
    1915             DO jj = ijpt0, ilpt1            ! east/west boundaries 
    1916                DO ji = iipt0,iipt1 
    1917                   ptab(jj,jk) = ztab(ji,jj)  
    1918                END DO 
    1919             END DO 
    1920          ENDIF 
    1921          ! 
    1922       END DO 
    1923       ! 
    1924       IF( wrk_not_released(2, 1) ) THEN 
    1925          WRITE(kumout, cform_err) 
    1926          WRITE(kumout,*) 'mppobc : failed to release workspace array' 
    1927          CALL mppstop 
    1928       ENDIF 
    1929       ! 
    1930    END SUBROUTINE mppobc 
    1931     
    1932  
    19331727   SUBROUTINE mpp_comm_free( kcom ) 
    19341728      !!---------------------------------------------------------------------- 
     
    24882282      MODULE PROCEDURE mppmin_a_int, mppmin_int, mppmin_a_real, mppmin_real 
    24892283   END INTERFACE 
    2490    INTERFACE mppobc 
    2491       MODULE PROCEDURE mppobc_1d, mppobc_2d, mppobc_3d, mppobc_4d 
    2492    END INTERFACE 
    24932284   INTERFACE mpp_minloc 
    24942285      MODULE PROCEDURE mpp_minloc2d ,mpp_minloc3d 
     
    26032394      WRITE(*,*) 'mppmin_int: You should not have seen this print! error?', kint, kcom 
    26042395   END SUBROUTINE mppmin_int 
    2605  
    2606    SUBROUTINE mppobc_1d( parr, kd1, kd2, kl, kk, ktype, kij, knum ) 
    2607       INTEGER  ::   kd1, kd2, kl , kk, ktype, kij, knum 
    2608       REAL, DIMENSION(:) ::   parr           ! variable array 
    2609       WRITE(*,*) 'mppobc: You should not have seen this print! error?', parr(1), kd1, kd2, kl, kk, ktype, kij, knum 
    2610    END SUBROUTINE mppobc_1d 
    2611  
    2612    SUBROUTINE mppobc_2d( parr, kd1, kd2, kl, kk, ktype, kij, knum ) 
    2613       INTEGER  ::   kd1, kd2, kl , kk, ktype, kij, knum 
    2614       REAL, DIMENSION(:,:) ::   parr           ! variable array 
    2615       WRITE(*,*) 'mppobc: You should not have seen this print! error?', parr(1,1), kd1, kd2, kl, kk, ktype, kij, knum 
    2616    END SUBROUTINE mppobc_2d 
    2617  
    2618    SUBROUTINE mppobc_3d( parr, kd1, kd2, kl, kk, ktype, kij, knum ) 
    2619       INTEGER  ::   kd1, kd2, kl , kk, ktype, kij, knum 
    2620       REAL, DIMENSION(:,:,:) ::   parr           ! variable array 
    2621       WRITE(*,*) 'mppobc: You should not have seen this print! error?', parr(1,1,1), kd1, kd2, kl, kk, ktype, kij, knum 
    2622    END SUBROUTINE mppobc_3d 
    2623  
    2624    SUBROUTINE mppobc_4d( parr, kd1, kd2, kl, kk, ktype, kij, knum ) 
    2625       INTEGER  ::   kd1, kd2, kl , kk, ktype, kij, knum 
    2626       REAL, DIMENSION(:,:,:,:) ::   parr           ! variable array 
    2627       WRITE(*,*) 'mppobc: You should not have seen this print! error?', parr(1,1,1,1), kd1, kd2, kl, kk, ktype, kij, knum 
    2628    END SUBROUTINE mppobc_4d 
    26292396 
    26302397   SUBROUTINE mpp_minloc2d( ptab, pmask, pmin, ki, kj ) 
  • branches/2011/dev_NOC_UKMO_MERGE/NEMOGCM/NEMO/OPA_SRC/LBC/mppini.F90

    r2715 r3094  
    125125      !!        !  98-05  (M. Imbard, J. Escobar, L. Colombet )  SHMEM and MPI versions 
    126126      !!   8.5  !  02-08  (G. Madec)  F90 : free form 
     127      !!   3.4  !  11-11  (C. Harris) decomposition changes for running with CICE 
    127128      !!---------------------------------------------------------------------- 
    128129      INTEGER  ::   ji, jj, jn   ! dummy loop indices 
     
    152153 
    153154      IF(  iresti == 0 )   iresti = jpni 
     155 
     156#if defined key_nemocice_decomp 
     157      ! In order to match CICE the size of domains in NEMO has to be changed 
     158      ! The last line of blocks (west) will have fewer points 
     159 
     160      DO jj = 1, jpnj 
     161         DO ji=1, jpni-1 
     162            ilcit(ji,jj) = jpi 
     163         END DO 
     164         ilcit(jpni,jj) = jpiglo - (jpni - 1) * (jpi - nreci) 
     165      END DO 
     166 
     167#else 
     168 
    154169      DO jj = 1, jpnj 
    155170         DO ji = 1, iresti 
     
    161176      END DO 
    162177       
     178#endif 
    163179      IF( irestj == 0 )   irestj = jpnj 
     180 
     181#if defined key_nemocice_decomp 
     182      ! Same change to domains in North-South direction as in East-West.  
     183      DO ji=1,jpni 
     184         DO jj=1,jpnj-1 
     185            ilcjt(ji,jj) = jpj 
     186         END DO 
     187         ilcjt(ji,jpnj) = jpjglo - (jpnj - 1) * (jpj - nrecj) 
     188      END DO 
     189 
     190#else 
     191 
    164192      DO ji = 1, jpni 
    165193         DO jj = 1, irestj 
     
    171199      END DO 
    172200       
     201#endif 
    173202      IF(lwp) THEN 
    174203         WRITE(numout,*) 
  • branches/2011/dev_NOC_UKMO_MERGE/NEMOGCM/NEMO/OPA_SRC/SBC/cpl_oasis3.F90

    r2715 r3094  
    1313   !!   " "  !  06-01  (W. Park) modification of physical part 
    1414   !!   " "  !  06-02  (R. Redler, W. Park) buffer array fix for root exchange 
     15   !!   3.4  !  11-11  (C. Harris) Changes to allow mutiple category fields 
    1516   !!---------------------------------------------------------------------- 
    1617#if defined key_oasis3 
     
    5253   INTEGER, PARAMETER ::   nmaxfld=40    ! Maximum number of coupling fields 
    5354    
    54    TYPE, PUBLIC ::   FLD_CPL            !: Type for coupling field information 
    55       LOGICAL            ::   laction   ! To be coupled or not 
    56       CHARACTER(len = 8) ::   clname    ! Name of the coupling field    
    57       CHARACTER(len = 1) ::   clgrid    ! Grid type   
    58       REAL(wp)           ::   nsgn      ! Control of the sign change 
    59       INTEGER            ::   nid       ! Id of the field 
     55   TYPE, PUBLIC ::   FLD_CPL               !: Type for coupling field information 
     56      LOGICAL               ::   laction   ! To be coupled or not 
     57      CHARACTER(len = 8)    ::   clname    ! Name of the coupling field    
     58      CHARACTER(len = 1)    ::   clgrid    ! Grid type   
     59      REAL(wp)              ::   nsgn      ! Control of the sign change 
     60      INTEGER, DIMENSION(9) ::   nid       ! Id of the field (no more than 9 categories) 
     61      INTEGER               ::   nct       ! Number of categories in field 
    6062   END TYPE FLD_CPL 
    6163 
     
    118120      INTEGER :: paral(5)       ! OASIS3 box partition 
    119121      INTEGER :: ishape(2,2)    ! shape of arrays passed to PSMILe 
    120       INTEGER :: ji             ! local loop indicees 
     122      INTEGER :: ji,jc          ! local loop indicees 
     123      CHARACTER(LEN=8) :: zclname 
    121124      !!-------------------------------------------------------------------- 
    122125 
     
    164167      DO ji = 1, ksnd 
    165168         IF ( ssnd(ji)%laction ) THEN  
    166             CALL prism_def_var_proto (ssnd(ji)%nid, ssnd(ji)%clname, id_part, (/ 2, 0/),  & 
    167                &                      PRISM_Out   , ishape   , PRISM_REAL, nerror) 
    168             IF ( nerror /= PRISM_Ok ) THEN 
    169                WRITE(numout,*) 'Failed to define transient ', ji, TRIM(ssnd(ji)%clname) 
    170                CALL prism_abort_proto ( ssnd(ji)%nid, 'cpl_prism_define', 'Failure in prism_def_var') 
    171             ENDIF 
     169            DO jc = 1, ssnd(ji)%nct 
     170               IF ( ssnd(ji)%nct .gt. 1 ) THEN 
     171                  WRITE(zclname,'( a7, i1)') ssnd(ji)%clname,jc 
     172               ELSE 
     173                  zclname=ssnd(ji)%clname 
     174               ENDIF 
     175               WRITE(numout,*) "Define",ji,jc,zclname," for",PRISM_Out 
     176               CALL prism_def_var_proto (ssnd(ji)%nid(jc), zclname, id_part, (/ 2, 0/),   & 
     177                    PRISM_Out, ishape, PRISM_REAL, nerror) 
     178               IF ( nerror /= PRISM_Ok ) THEN 
     179                  WRITE(numout,*) 'Failed to define transient ', ji, TRIM(zclname) 
     180                  CALL prism_abort_proto ( ssnd(ji)%nid(jc), 'cpl_prism_define', 'Failure in prism_def_var') 
     181               ENDIF 
     182            END DO 
    172183         ENDIF 
    173184      END DO 
     
    177188      DO ji = 1, krcv 
    178189         IF ( srcv(ji)%laction ) THEN  
    179             CALL prism_def_var_proto ( srcv(ji)%nid, srcv(ji)%clname, id_part, (/ 2, 0/),   & 
    180                &                      PRISM_In    , ishape   , PRISM_REAL, nerror) 
    181             IF ( nerror /= PRISM_Ok ) THEN 
    182                WRITE(numout,*) 'Failed to define transient ', ji, TRIM(srcv(ji)%clname) 
    183                CALL prism_abort_proto ( srcv(ji)%nid, 'cpl_prism_define', 'Failure in prism_def_var') 
    184             ENDIF 
     190            DO jc = 1, srcv(ji)%nct 
     191               IF ( srcv(ji)%nct .gt. 1 ) THEN 
     192                  WRITE(zclname,'( a7, i1)') srcv(ji)%clname,jc 
     193               ELSE 
     194                  zclname=srcv(ji)%clname 
     195               ENDIF 
     196               WRITE(numout,*) "Define",ji,jc,zclname," for",PRISM_In 
     197               CALL prism_def_var_proto ( srcv(ji)%nid(jc), zclname, id_part, (/ 2, 0/),   & 
     198                    &                      PRISM_In    , ishape   , PRISM_REAL, nerror) 
     199               IF ( nerror /= PRISM_Ok ) THEN 
     200                  WRITE(numout,*) 'Failed to define transient ', ji, TRIM(zclname) 
     201                  CALL prism_abort_proto ( srcv(ji)%nid(jc), 'cpl_prism_define', 'Failure in prism_def_var') 
     202               ENDIF 
     203            END DO 
    185204         ENDIF 
    186205      END DO 
     
    203222      !!      like sst or ice cover to the coupler or remote application. 
    204223      !!---------------------------------------------------------------------- 
    205       INTEGER                 , INTENT(in   ) ::   kid       ! variable index in the array 
    206       INTEGER                 , INTENT(  out) ::   kinfo     ! OASIS3 info argument 
    207       INTEGER                 , INTENT(in   ) ::   kstep     ! ocean time-step in seconds 
    208       REAL(wp), DIMENSION(:,:), INTENT(in   ) ::   pdata 
     224      INTEGER                   , INTENT(in   ) ::   kid       ! variable index in the array 
     225      INTEGER                   , INTENT(  out) ::   kinfo     ! OASIS3 info argument 
     226      INTEGER                   , INTENT(in   ) ::   kstep     ! ocean time-step in seconds 
     227      REAL(wp), DIMENSION(:,:,:), INTENT(in   ) ::   pdata 
     228      !! 
     229      INTEGER                                   ::   jc        ! local loop index 
    209230      !!-------------------------------------------------------------------- 
    210231      ! 
    211232      ! snd data to OASIS3 
    212233      ! 
    213       CALL prism_put_proto ( ssnd(kid)%nid, kstep, pdata(nldi:nlei, nldj:nlej), kinfo ) 
    214        
    215       IF ( ln_ctl ) THEN         
    216          IF ( kinfo == PRISM_Sent     .OR. kinfo == PRISM_ToRest .OR.   & 
    217             & kinfo == PRISM_SentOut  .OR. kinfo == PRISM_ToRestOut ) THEN 
    218             WRITE(numout,*) '****************' 
    219             WRITE(numout,*) 'prism_put_proto: Outgoing ', ssnd(kid)%clname 
    220             WRITE(numout,*) 'prism_put_proto: ivarid ', ssnd(kid)%nid 
    221             WRITE(numout,*) 'prism_put_proto:  kstep ', kstep 
    222             WRITE(numout,*) 'prism_put_proto:   info ', kinfo 
    223             WRITE(numout,*) '     - Minimum value is ', MINVAL(pdata) 
    224             WRITE(numout,*) '     - Maximum value is ', MAXVAL(pdata) 
    225             WRITE(numout,*) '     -     Sum value is ', SUM(pdata) 
    226             WRITE(numout,*) '****************' 
     234      DO jc = 1, ssnd(kid)%nct 
     235 
     236         CALL prism_put_proto ( ssnd(kid)%nid(jc), kstep, pdata(nldi:nlei, nldj:nlej,jc), kinfo ) 
     237          
     238         IF ( ln_ctl ) THEN         
     239            IF ( kinfo == PRISM_Sent     .OR. kinfo == PRISM_ToRest .OR.   & 
     240                 & kinfo == PRISM_SentOut  .OR. kinfo == PRISM_ToRestOut ) THEN 
     241               WRITE(numout,*) '****************' 
     242               WRITE(numout,*) 'prism_put_proto: Outgoing ', ssnd(kid)%clname 
     243               WRITE(numout,*) 'prism_put_proto: ivarid ', ssnd(kid)%nid(jc) 
     244               WRITE(numout,*) 'prism_put_proto:  kstep ', kstep 
     245               WRITE(numout,*) 'prism_put_proto:   info ', kinfo 
     246               WRITE(numout,*) '     - Minimum value is ', MINVAL(pdata(:,:,jc)) 
     247               WRITE(numout,*) '     - Maximum value is ', MAXVAL(pdata(:,:,jc)) 
     248               WRITE(numout,*) '     -     Sum value is ', SUM(pdata(:,:,jc)) 
     249               WRITE(numout,*) '****************' 
     250            ENDIF 
    227251         ENDIF 
    228       ENDIF 
     252 
     253      ENDDO 
    229254      ! 
    230255    END SUBROUTINE cpl_prism_snd 
     
    238263      !!      like stresses and fluxes from the coupler or remote application. 
    239264      !!---------------------------------------------------------------------- 
    240       INTEGER                 , INTENT(in   ) ::   kid       ! variable index in the array 
    241       INTEGER                 , INTENT(in   ) ::   kstep     ! ocean time-step in seconds 
    242       REAL(wp), DIMENSION(:,:), INTENT(inout) ::   pdata     ! IN to keep the value if nothing is done 
    243       INTEGER                 , INTENT(  out) ::   kinfo     ! OASIS3 info argument 
    244       !! 
    245       LOGICAL ::   llaction 
     265      INTEGER                   , INTENT(in   ) ::   kid       ! variable index in the array 
     266      INTEGER                   , INTENT(in   ) ::   kstep     ! ocean time-step in seconds 
     267      REAL(wp), DIMENSION(:,:,:), INTENT(inout) ::   pdata     ! IN to keep the value if nothing is done 
     268      INTEGER                   , INTENT(  out) ::   kinfo     ! OASIS3 info argument 
     269      !! 
     270      INTEGER                                   ::   jc        ! local loop index 
     271      LOGICAL                                   ::   llaction 
    246272      !!-------------------------------------------------------------------- 
    247273      ! 
    248274      ! receive local data from OASIS3 on every process 
    249275      ! 
    250       CALL prism_get_proto ( srcv(kid)%nid, kstep, exfld, kinfo )          
    251  
    252       llaction = .false. 
    253       IF( kinfo == PRISM_Recvd   .OR. kinfo == PRISM_FromRest .OR.   & 
    254           kinfo == PRISM_RecvOut .OR. kinfo == PRISM_FromRestOut )   llaction = .TRUE. 
    255  
    256       IF ( ln_ctl )   WRITE(numout,*) "llaction, kinfo, kstep, ivarid: " , llaction, kinfo, kstep, srcv(kid)%nid 
    257  
    258       IF ( llaction ) THEN 
    259  
    260          kinfo = OASIS_Rcv 
    261          pdata(nldi:nlei, nldj:nlej) = exfld(:,:) 
    262           
    263          !--- Fill the overlap areas and extra hallows (mpp) 
    264          !--- check periodicity conditions (all cases) 
    265          CALL lbc_lnk( pdata, srcv(kid)%clgrid, srcv(kid)%nsgn )    
    266           
    267          IF ( ln_ctl ) THEN         
    268             WRITE(numout,*) '****************' 
    269             WRITE(numout,*) 'prism_get_proto: Incoming ', srcv(kid)%clname 
    270             WRITE(numout,*) 'prism_get_proto: ivarid '  , srcv(kid)%nid 
    271             WRITE(numout,*) 'prism_get_proto:   kstep', kstep 
    272             WRITE(numout,*) 'prism_get_proto:   info ', kinfo 
    273             WRITE(numout,*) '     - Minimum value is ', MINVAL(pdata) 
    274             WRITE(numout,*) '     - Maximum value is ', MAXVAL(pdata) 
    275             WRITE(numout,*) '     -     Sum value is ', SUM(pdata) 
    276             WRITE(numout,*) '****************' 
     276      DO jc = 1, srcv(kid)%nct 
     277 
     278         CALL prism_get_proto ( srcv(kid)%nid(jc), kstep, exfld, kinfo )          
     279          
     280         llaction = .false. 
     281         IF( kinfo == PRISM_Recvd   .OR. kinfo == PRISM_FromRest .OR.   & 
     282              kinfo == PRISM_RecvOut .OR. kinfo == PRISM_FromRestOut )   llaction = .TRUE. 
     283          
     284         IF ( ln_ctl )   WRITE(numout,*) "llaction, kinfo, kstep, ivarid: " , llaction, kinfo, kstep, srcv(kid)%nid(jc) 
     285          
     286         IF ( llaction ) THEN 
     287             
     288            kinfo = OASIS_Rcv 
     289            pdata(nldi:nlei, nldj:nlej,jc) = exfld(:,:) 
     290             
     291            !--- Fill the overlap areas and extra hallows (mpp) 
     292            !--- check periodicity conditions (all cases) 
     293            CALL lbc_lnk( pdata(:,:,jc), srcv(kid)%clgrid, srcv(kid)%nsgn )    
     294             
     295            IF ( ln_ctl ) THEN         
     296               WRITE(numout,*) '****************' 
     297               WRITE(numout,*) 'prism_get_proto: Incoming ', srcv(kid)%clname 
     298               WRITE(numout,*) 'prism_get_proto: ivarid '  , srcv(kid)%nid(jc) 
     299               WRITE(numout,*) 'prism_get_proto:   kstep', kstep 
     300               WRITE(numout,*) 'prism_get_proto:   info ', kinfo 
     301               WRITE(numout,*) '     - Minimum value is ', MINVAL(pdata(:,:,jc)) 
     302               WRITE(numout,*) '     - Maximum value is ', MAXVAL(pdata(:,:,jc)) 
     303               WRITE(numout,*) '     -     Sum value is ', SUM(pdata(:,:,jc)) 
     304               WRITE(numout,*) '****************' 
     305            ENDIF 
     306             
     307         ELSE 
     308            kinfo = OASIS_idle      
    277309         ENDIF 
    278        
    279       ELSE 
    280          kinfo = OASIS_idle      
    281       ENDIF 
     310          
     311      ENDDO 
    282312      ! 
    283313   END SUBROUTINE cpl_prism_rcv 
  • branches/2011/dev_NOC_UKMO_MERGE/NEMOGCM/NEMO/OPA_SRC/SBC/fldread.F90

    r2777 r3094  
    2424   IMPLICIT NONE 
    2525   PRIVATE    
     26  
     27   PUBLIC   fld_map    ! routine called by tides_init 
    2628 
    2729   TYPE, PUBLIC ::   FLD_N      !: Namelist field informations 
     
    5658      LOGICAL                         ::   rotn         ! flag to indicate whether field has been rotated 
    5759   END TYPE FLD 
     60 
     61   TYPE, PUBLIC ::   MAP_POINTER      !: Array of integer pointers to 1D arrays 
     62      INTEGER, POINTER   ::  ptr(:) 
     63   END TYPE MAP_POINTER 
    5864 
    5965!$AGRIF_DO_NOT_TREAT 
     
    98104CONTAINS 
    99105 
    100    SUBROUTINE fld_read( kt, kn_fsbc, sd ) 
     106   SUBROUTINE fld_read( kt, kn_fsbc, sd, map, jit, time_offset ) 
    101107      !!--------------------------------------------------------------------- 
    102108      !!                    ***  ROUTINE fld_read  *** 
     
    113119      INTEGER  , INTENT(in   )               ::   kn_fsbc   ! sbc computation period (in time step)  
    114120      TYPE(FLD), INTENT(inout), DIMENSION(:) ::   sd        ! input field related variables 
     121      TYPE(MAP_POINTER),INTENT(in), OPTIONAL, DIMENSION(:) ::   map   ! global-to-local mapping index 
     122      INTEGER  , INTENT(in   ), OPTIONAL     ::   jit       ! subcycle timestep for timesplitting option 
     123      INTEGER  , INTENT(in   ), OPTIONAL     ::   time_offset ! provide fields at time other than "now" 
     124                                                              ! time_offset = -1 => fields at "before" time level 
     125                                                              ! time_offset = +1 => fields at "after" time levels 
     126                                                              ! etc. 
    115127      !! 
    116128      INTEGER  ::   imf        ! size of the structure sd 
     
    119131      INTEGER  ::   isecend    ! number of second since Jan. 1st 00h of nit000 year at nitend 
    120132      INTEGER  ::   isecsbc    ! number of seconds between Jan. 1st 00h of nit000 year and the middle of sbc time step 
     133      INTEGER  ::   time_add   ! local time_offset variable 
    121134      LOGICAL  ::   llnxtyr    ! open next year  file? 
    122135      LOGICAL  ::   llnxtmth   ! open next month file? 
    123136      LOGICAL  ::   llstop     ! stop is the file does not exist 
     137      LOGICAL  ::   ll_firstcall ! true if this is the first call to fld_read for this set of fields 
    124138      REAL(wp) ::   ztinta     ! ratio applied to after  records when doing time interpolation 
    125139      REAL(wp) ::   ztintb     ! ratio applied to before records when doing time interpolation 
    126140      CHARACTER(LEN=1000) ::   clfmt   ! write format 
    127141      !!--------------------------------------------------------------------- 
     142      ll_firstcall = .false. 
     143      IF( PRESENT(jit) ) THEN 
     144         IF(kt == nit000 .and. jit == 1) ll_firstcall = .true. 
     145      ELSE 
     146         IF(kt == nit000) ll_firstcall = .true. 
     147      ENDIF 
     148 
     149      time_add = 0 
     150      IF( PRESENT(time_offset) ) THEN 
     151         time_add = time_offset 
     152      ENDIF 
     153          
    128154      ! Note that shifting time to be centrered in the middle of sbc time step impacts only nsec_* variables of the calendar  
    129       isecsbc = nsec_year + nsec1jan000 + NINT(0.5 * REAL(kn_fsbc - 1,wp) * rdttra(1))   ! middle of sbc time step 
     155      IF( present(jit) ) THEN  
     156         ! ignore kn_fsbc in this case 
     157         isecsbc = nsec_year + nsec1jan000 + (jit+time_add)*rdt/REAL(nn_baro,wp)  
     158      ELSE 
     159         isecsbc = nsec_year + nsec1jan000 + NINT(0.5 * REAL(kn_fsbc - 1,wp) * rdttra(1)) + time_add * rdttra(1)  ! middle of sbc time step 
     160      ENDIF 
    130161      imf = SIZE( sd ) 
    131162      ! 
    132       IF( kt == nit000 ) THEN                      ! initialization 
    133          DO jf = 1, imf  
    134             CALL fld_init( kn_fsbc, sd(jf) )       ! read each before field (put them in after as they will be swapped) 
    135          END DO 
     163      IF( ll_firstcall ) THEN                      ! initialization 
     164         IF( PRESENT(map) ) THEN 
     165            DO jf = 1, imf  
     166               CALL fld_init( kn_fsbc, sd(jf), map(jf)%ptr )  ! read each before field (put them in after as they will be swapped) 
     167            END DO 
     168         ELSE 
     169            DO jf = 1, imf  
     170               CALL fld_init( kn_fsbc, sd(jf) )       ! read each before field (put them in after as they will be swapped) 
     171            END DO 
     172         ENDIF 
    136173         IF( lwp ) CALL wgt_print()                ! control print 
    137174         CALL fld_rot( kt, sd )                    ! rotate vector fiels if needed 
     
    143180         DO jf = 1, imf                            ! ---   loop over field   --- ! 
    144181             
    145             IF( isecsbc > sd(jf)%nrec_a(2) .OR. kt == nit000 ) THEN  ! read/update the after data? 
     182            IF( isecsbc > sd(jf)%nrec_a(2) .OR. ll_firstcall ) THEN  ! read/update the after data? 
    146183 
    147184               IF( sd(jf)%ln_tint ) THEN                             ! swap before record field and informations 
     
    151188               ENDIF 
    152189 
    153                CALL fld_rec( kn_fsbc, sd(jf) )                       ! update record informations 
     190               IF( PRESENT(jit) ) THEN 
     191                  CALL fld_rec( kn_fsbc, sd(jf), jit=jit )              ! update record informations 
     192               ELSE 
     193                  CALL fld_rec( kn_fsbc, sd(jf) )                       ! update record informations 
     194               ENDIF 
    154195 
    155196               ! do we have to change the year/month/week/day of the forcing field??  
     
    212253 
    213254               ! read after data 
    214                CALL fld_get( sd(jf) ) 
     255               IF( PRESENT(map) ) THEN 
     256                  CALL fld_get( sd(jf), map(jf)%ptr ) 
     257               ELSE 
     258                  CALL fld_get( sd(jf) ) 
     259               ENDIF 
    215260 
    216261            ENDIF 
     
    225270                  clfmt = "('fld_read: var ', a, ' kt = ', i8, ' (', f7.2,' days), Y/M/D = ', i4.4,'/', i2.2,'/', i2.2," //   & 
    226271                     &    "', records b/a: ', i4.4, '/', i4.4, ' (days ', f7.2,'/', f7.2, ')')" 
    227                   WRITE(numout, clfmt)  TRIM( sd(jf)%clvar ), kt, REAL(isecsbc,wp)/rday, nyear, nmonth, nday,   & 
     272                  WRITE(numout, clfmt)  TRIM( sd(jf)%clvar ), kt, REAL(isecsbc,wp)/rday, nyear, nmonth, nday,   &             
    228273                     & sd(jf)%nrec_b(1), sd(jf)%nrec_a(1), REAL(sd(jf)%nrec_b(2),wp)/rday, REAL(sd(jf)%nrec_a(2),wp)/rday 
     274                  WRITE(numout, *) 'time_add is : ',time_add 
    229275               ENDIF 
    230276               ! temporal interpolation weights 
     
    253299 
    254300 
    255    SUBROUTINE fld_init( kn_fsbc, sdjf ) 
     301   SUBROUTINE fld_init( kn_fsbc, sdjf, map ) 
    256302      !!--------------------------------------------------------------------- 
    257303      !!                    ***  ROUTINE fld_init  *** 
     
    262308      INTEGER  , INTENT(in   ) ::   kn_fsbc   ! sbc computation period (in time step)  
    263309      TYPE(FLD), INTENT(inout) ::   sdjf      ! input field related variables 
     310      INTEGER  , INTENT(in), OPTIONAL, DIMENSION(:) :: map ! global-to-local mapping indices 
    264311      !! 
    265312      LOGICAL :: llprevyr              ! are we reading previous year  file? 
     
    364411 
    365412         ! read before data  
    366          CALL fld_get( sdjf )  ! read before values in after arrays(as we will swap it later) 
     413         IF( PRESENT(map) ) THEN 
     414            CALL fld_get( sdjf, map )  ! read before values in after arrays(as we will swap it later) 
     415         ELSE 
     416            CALL fld_get( sdjf )  ! read before values in after arrays(as we will swap it later) 
     417         ENDIF 
    367418 
    368419         clfmt = "('fld_init : time-interpolation for ', a, ' read previous record = ', i4, ' at time = ', f7.2, ' days')" 
     
    396447 
    397448 
    398    SUBROUTINE fld_rec( kn_fsbc, sdjf, ldbefore ) 
     449   SUBROUTINE fld_rec( kn_fsbc, sdjf, ldbefore, jit ) 
    399450      !!--------------------------------------------------------------------- 
    400451      !!                    ***  ROUTINE fld_rec  *** 
     
    410461      TYPE(FLD), INTENT(inout)           ::   sdjf      ! input field related variables 
    411462      LOGICAL  , INTENT(in   ), OPTIONAL ::   ldbefore  ! sent back before record values (default = .FALSE.) 
     463      INTEGER  , INTENT(in   ), OPTIONAL ::   jit       ! index of barotropic subcycle 
    412464                                                        ! used only if sdjf%ln_tint = .TRUE. 
    413465      !! 
     
    443495            !                             
    444496            ztmp = REAL( nday, wp ) / REAL( nyear_len(1), wp ) + 0.5 
     497            IF( PRESENT(jit) ) ztmp = ztmp + jit*rdt/REAL(nn_baro,wp) 
    445498            sdjf%nrec_a(1) = 1 + INT( ztmp ) - COUNT((/llbefore/)) 
    446499            ! swap at the middle of the year 
     
    471524            !                             
    472525            ztmp = REAL( nday, wp ) / REAL( nmonth_len(nmonth), wp ) + 0.5 
     526            IF( PRESENT(jit) ) ztmp = ztmp + jit*rdt/REAL(nn_baro,wp) 
    473527            imth = nmonth + INT( ztmp ) - COUNT((/llbefore/)) 
    474528            IF( sdjf%cltype == 'monthly' ) THEN   ;   sdjf%nrec_a(1) = 1 + INT( ztmp ) - COUNT((/llbefore/)) 
     
    498552         ztmp = ztmp + 0.5 * REAL(kn_fsbc - 1, wp) * rdttra(1)   ! shift time to be centrered in the middle of sbc time step 
    499553         ztmp = ztmp + 0.01 * rdttra(1)                          ! add 0.01 time step to avoid truncation error  
     554         IF( PRESENT(jit) ) ztmp = ztmp + jit*rdt/REAL(nn_baro,wp) 
    500555         IF( sdjf%ln_tint ) THEN                ! time interpolation, shift by 1/2 record 
    501556            ! 
     
    546601 
    547602 
    548    SUBROUTINE fld_get( sdjf ) 
    549       !!--------------------------------------------------------------------- 
    550       !!                    ***  ROUTINE fld_clopn  *** 
     603   SUBROUTINE fld_get( sdjf, map ) 
     604      !!--------------------------------------------------------------------- 
     605      !!                    ***  ROUTINE fld_get  *** 
    551606      !! 
    552607      !! ** Purpose :   read the data 
    553608      !!---------------------------------------------------------------------- 
    554609      TYPE(FLD), INTENT(inout) ::   sdjf   ! input field related variables 
     610      INTEGER  , INTENT(in), OPTIONAL, DIMENSION(:) :: map ! global-to-local mapping indices 
    555611      !! 
    556612      INTEGER                  ::   ipk    ! number of vertical levels of sdjf%fdta ( 2D: ipk=1 ; 3D: ipk=jpk ) 
     
    559615             
    560616      ipk = SIZE( sdjf%fnow, 3 ) 
    561       IF( LEN(TRIM(sdjf%wgtname)) > 0 ) THEN 
     617 
     618      IF( PRESENT(map) ) THEN 
     619         IF( sdjf%ln_tint ) THEN   ;   CALL fld_map( sdjf%num, sdjf%clvar, sdjf%fdta(:,:,:,2), sdjf%nrec_a(1), map ) 
     620         ELSE                      ;   CALL fld_map( sdjf%num, sdjf%clvar, sdjf%fnow(:,:,:  ), sdjf%nrec_a(1), map ) 
     621         ENDIF 
     622      ELSE IF( LEN(TRIM(sdjf%wgtname)) > 0 ) THEN 
    562623         CALL wgt_list( sdjf, iw ) 
    563624         IF( sdjf%ln_tint ) THEN   ;   CALL fld_interp( sdjf%num, sdjf%clvar, iw , ipk  , sdjf%fdta(:,:,:,2), sdjf%nrec_a(1) ) 
     
    581642   END SUBROUTINE fld_get 
    582643 
     644   SUBROUTINE fld_map( num, clvar, dta, nrec, map ) 
     645      !!--------------------------------------------------------------------- 
     646      !!                    ***  ROUTINE fld_get  *** 
     647      !! 
     648      !! ** Purpose :   read global data from file and map onto local data 
     649      !!                using a general mapping (for open boundaries) 
     650      !!---------------------------------------------------------------------- 
     651#if defined key_bdy 
     652      USE bdy_oce, ONLY:  dta_global         ! workspace to read in global data arrays 
     653#endif  
     654 
     655      INTEGER                   , INTENT(in ) ::   num     ! stream number 
     656      CHARACTER(LEN=*)          , INTENT(in ) ::   clvar   ! variable name 
     657      REAL(wp), DIMENSION(:,:,:), INTENT(out) ::   dta   ! output field on model grid (2 dimensional) 
     658      INTEGER                   , INTENT(in ) ::   nrec    ! record number to read (ie time slice) 
     659      INTEGER,  DIMENSION(:)    , INTENT(in ) ::   map     ! global-to-local mapping indices 
     660      !! 
     661      INTEGER                                 ::   ipi      ! length of boundary data on local process 
     662      INTEGER                                 ::   ipj      ! length of dummy dimension ( = 1 ) 
     663      INTEGER                                 ::   ipk      ! number of vertical levels of dta ( 2D: ipk=1 ; 3D: ipk=jpk ) 
     664      INTEGER                                 ::   ilendta  ! length of data in file 
     665      INTEGER                                 ::   idvar    ! variable ID 
     666      INTEGER                                 ::   ib, ik   ! loop counters 
     667      INTEGER                                 ::   ierr 
     668      REAL(wp), POINTER, DIMENSION(:,:,:)     ::   dta_read ! work space for global data 
     669      !!--------------------------------------------------------------------- 
     670             
     671#if defined key_bdy 
     672      dta_read => dta_global 
     673#endif 
     674 
     675      ipi = SIZE( dta, 1 ) 
     676      ipj = 1 
     677      ipk = SIZE( dta, 3 ) 
     678 
     679      idvar   = iom_varid( num, clvar ) 
     680      ilendta = iom_file(num)%dimsz(1,idvar) 
     681      IF(lwp) WRITE(numout,*) 'Dim size for ',TRIM(clvar),' is ', ilendta 
     682      IF(lwp) WRITE(numout,*) 'Number of levels for ',TRIM(clvar),' is ', ipk 
     683 
     684      SELECT CASE( ipk ) 
     685      CASE(1)    
     686         CALL iom_get ( num, jpdom_unknown, clvar, dta_read(1:ilendta,1:ipj,1    ), nrec ) 
     687      CASE DEFAULT 
     688         CALL iom_get ( num, jpdom_unknown, clvar, dta_read(1:ilendta,1:ipj,1:ipk), nrec ) 
     689      END SELECT 
     690      ! 
     691      DO ib = 1, ipi 
     692         DO ik = 1, ipk 
     693            dta(ib,1,ik) =  dta_read(map(ib),1,ik) 
     694         END DO 
     695      END DO 
     696 
     697   END SUBROUTINE fld_map 
     698 
    583699 
    584700   SUBROUTINE fld_rot( kt, sd ) 
    585701      !!--------------------------------------------------------------------- 
    586       !!                    ***  ROUTINE fld_clopn  *** 
     702      !!                    ***  ROUTINE fld_rot  *** 
    587703      !! 
    588704      !! ** Purpose :   Vector fields may need to be rotated onto the local grid direction 
    589705      !!---------------------------------------------------------------------- 
    590706      USE wrk_nemo, ONLY: wrk_in_use, wrk_not_released 
    591       USE wrk_nemo, ONLY: utmp => wrk_2d_4, vtmp => wrk_2d_5      ! 2D workspace 
     707      USE wrk_nemo, ONLY: utmp => wrk_2d_24, vtmp => wrk_2d_25      ! 2D workspace 
    592708      !! 
    593709      INTEGER  , INTENT(in   )               ::   kt        ! ocean time step 
     
    601717      !!--------------------------------------------------------------------- 
    602718 
    603       IF(wrk_in_use(2, 4,5) ) THEN 
     719      IF(wrk_in_use(2, 24,25) ) THEN 
    604720         CALL ctl_stop('fld_rot: ERROR: requested workspace arrays are unavailable.')   ;   RETURN 
    605721      END IF 
     
    638754       END DO 
    639755      ! 
    640       IF(wrk_not_released(2, 4,5) )    CALL ctl_stop('fld_rot: ERROR: failed to release workspace arrays.') 
     756      IF(wrk_not_released(2, 24,25) )    CALL ctl_stop('fld_rot: ERROR: failed to release workspace arrays.') 
    641757      ! 
    642758   END SUBROUTINE fld_rot 
     
    672788      ! 
    673789      CALL iom_open( sdjf%clname, sdjf%num, ldstop = ldstop, ldiof =  LEN(TRIM(sdjf%wgtname)) > 0 ) 
    674       ! 
     790     ! 
    675791   END SUBROUTINE fld_clopn 
    676792 
  • branches/2011/dev_NOC_UKMO_MERGE/NEMOGCM/NEMO/OPA_SRC/SBC/sbc_ice.F90

    r2777 r3094  
    66   !! History :  3.0  ! 2006-08  (G. Madec)  Surface module 
    77   !!            3.2  ! 2009-06  (S. Masson) merge with ice_oce 
    8    !!            4.0  ! 2011-01  (A. R. Porter, STFC Daresbury) dynamical allocation 
     8   !!            3.3.1! 2011-01  (A. R. Porter, STFC Daresbury) dynamical allocation 
     9   !!            3.4  ! 2011-11  (C. Harris) CICE added as an option 
    910   !!---------------------------------------------------------------------- 
    10 #if defined key_lim3 || defined key_lim2 
     11#if defined key_lim3 || defined key_lim2 || defined key_cice 
    1112   !!---------------------------------------------------------------------- 
    1213   !!   'key_lim2' or 'key_lim3' :             LIM-2 or LIM-3 sea-ice model 
     
    1920   USE par_ice_2        ! LIM-2 parameters 
    2021# endif 
     22# if defined key_cice  
     23   USE ice_domain_size, only: ncat  
     24#endif 
    2125   USE lib_mpp          ! MPP library 
    2226   USE in_out_manager   ! I/O manager 
     
    3034   LOGICAL         , PUBLIC, PARAMETER ::   lk_lim2    = .TRUE.   !: LIM-2 ice model 
    3135   LOGICAL         , PUBLIC, PARAMETER ::   lk_lim3    = .FALSE.  !: no LIM-3 
     36   LOGICAL         , PUBLIC, PARAMETER ::   lk_cice    = .FALSE.  !: no CICE  
    3237#  if defined key_lim2_vp 
    3338   CHARACTER(len=1), PUBLIC, PARAMETER ::   cp_ice_msh = 'I'      !: VP : 'I'-grid ice-velocity (B-grid lower left corner) 
     
    3944   LOGICAL         , PUBLIC, PARAMETER ::   lk_lim2    = .FALSE.  !: no LIM-2 
    4045   LOGICAL         , PUBLIC, PARAMETER ::   lk_lim3    = .TRUE.   !: LIM-3 ice model 
     46   LOGICAL         , PUBLIC, PARAMETER ::   lk_cice    = .FALSE.  !: no CICE  
    4147   CHARACTER(len=1), PUBLIC, PARAMETER ::   cp_ice_msh = 'C'      !: 'C'-grid ice-velocity 
    4248# endif 
     49# if defined  key_cice 
     50   LOGICAL         , PUBLIC, PARAMETER ::   lk_lim2    = .FALSE.  !: no LIM-2 
     51   LOGICAL         , PUBLIC, PARAMETER ::   lk_lim3    = .FALSE.  !: no LIM-3 
     52   LOGICAL         , PUBLIC, PARAMETER ::   lk_cice    = .TRUE.   !: CICE ice model 
     53   CHARACTER(len=1), PUBLIC            ::   cp_ice_msh = 'F'      !: 'F'-grid ice-velocity 
     54# endif 
    4355 
     56#if defined key_lim3 || defined key_lim2  
    4457   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   qns_ice   !: non solar heat flux over ice                  [W/m2] 
    4558   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   qsr_ice   !: solar heat flux over ice                      [W/m2] 
     
    6073# endif 
    6174 
     75#elif defined key_cice 
     76   ! 
     77   ! for consistency with LIM, these are declared with three dimensions 
     78   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   qlw_ice            !: incoming long-wave 
     79   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   qla_ice            !: latent flux over ice           [W/m2] 
     80   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   qsr_ice            !: solar heat flux over ice       [W/m2] 
     81   ! 
     82   ! other forcing arrays are two dimensional 
     83   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   ss_iou             !: x ice-ocean surface stress at NEMO U point 
     84   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   ss_iov             !: y ice-ocean surface stress at NEMO V point 
     85   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   emp_ice            !: sublimation-snow budget over ice    [kg/m2] 
     86   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   tatm_ice           !: air temperature 
     87   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   qatm_ice           !: specific humidity 
     88   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   wndi_ice           !: i wind at T point 
     89   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   wndj_ice           !: j wind at T point 
     90   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   nfrzmlt            !: NEMO frzmlt 
     91   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   fr_iu              !: ice fraction at NEMO U point 
     92   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   fr_iv              !: ice fraction at NEMO V point 
     93   ! 
     94   ! finally, arrays corresponding to different ice categories 
     95   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   a_i                !: category ice fraction 
     96   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   topmelt           !: category topmelt 
     97   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   botmelt           !: category botmelt 
     98#endif 
     99 
    62100   !!---------------------------------------------------------------------- 
    63101   !! NEMO/OPA 4.0 , NEMO Consortium (2011) 
     
    71109      !!                     ***  FUNCTION sbc_ice_alloc  *** 
    72110      !!---------------------------------------------------------------------- 
     111#if defined key_lim3 || defined key_lim2 
    73112      ALLOCATE( qns_ice (jpi,jpj,jpl) , qsr_ice (jpi,jpj,jpl) ,     & 
    74113         &      qla_ice (jpi,jpj,jpl) , dqla_ice(jpi,jpj,jpl) ,     & 
     
    77116         &      utau_ice(jpi,jpj)     , vtau_ice(jpi,jpj)     ,     & 
    78117         &      fr1_i0  (jpi,jpj)     , fr2_i0  (jpi,jpj)     ,     & 
    79 # if defined key_lim3 
     118#if defined key_lim3 
    80119         &      emp_ice(jpi,jpj)      , tatm_ice(jpi,jpj)     , STAT= sbc_ice_alloc ) 
    81 # else 
     120#else 
    82121         &      emp_ice(jpi,jpj)                              , STAT= sbc_ice_alloc ) 
    83 # endif 
     122#endif 
     123#elif defined key_cice 
     124      ALLOCATE( qla_ice(jpi,jpj,1)    , qlw_ice(jpi,jpj,1)    , qsr_ice(jpi,jpj,1)    , & 
     125                wndi_ice(jpi,jpj)     , tatm_ice(jpi,jpj)     , qatm_ice(jpi,jpj)     , & 
     126                wndj_ice(jpi,jpj)     , nfrzmlt(jpi,jpj)      , ss_iou(jpi,jpj)       , & 
     127                ss_iov(jpi,jpj)       , fr_iu(jpi,jpj)        , fr_iv(jpi,jpj)        , & 
     128                a_i(jpi,jpj,ncat)     , topmelt(jpi,jpj,ncat) , botmelt(jpi,jpj,ncat), STAT= sbc_ice_alloc ) 
     129#endif 
    84130         ! 
    85131      IF( lk_mpp            )   CALL mpp_sum ( sbc_ice_alloc ) 
     
    89135#else 
    90136   !!---------------------------------------------------------------------- 
    91    !!   Default option                      NO LIM 2.0 or 3.0 sea-ice model 
     137   !!   Default option                      NO LIM 2.0 or 3.0 or CICE sea-ice model 
    92138   !!---------------------------------------------------------------------- 
    93139   LOGICAL         , PUBLIC, PARAMETER ::   lk_lim2    = .FALSE.  !: no LIM-2 ice model 
    94140   LOGICAL         , PUBLIC, PARAMETER ::   lk_lim3    = .FALSE.  !: no LIM-3 ice model 
     141   LOGICAL         , PUBLIC, PARAMETER ::   lk_cice    = .FALSE.  !: no CICE  ice model 
    95142   CHARACTER(len=1), PUBLIC, PARAMETER ::   cp_ice_msh = '-'      !: no grid ice-velocity 
    96143#endif 
  • branches/2011/dev_NOC_UKMO_MERGE/NEMOGCM/NEMO/OPA_SRC/SBC/sbcapr.F90

    r2715 r3094  
    1010   !!   sbc_apr        : read atmospheric pressure in netcdf files  
    1111   !!---------------------------------------------------------------------- 
    12    USE bdy_par         ! Unstructured boundary parameters 
    1312   USE obc_par         ! open boundary condition parameters 
    1413   USE dom_oce         ! ocean space and time domain 
     
    3029   !                                         !!* namsbc_apr namelist (Atmospheric PRessure) * 
    3130   LOGICAL, PUBLIC ::   ln_apr_obc = .FALSE.  !: inverse barometer added to OBC ssh data  
    32    LOGICAL, PUBLIC ::   ln_apr_bdy = .FALSE.  !: inverse barometer added to BDY ssh data 
    3331   LOGICAL, PUBLIC ::   ln_ref_apr = .FALSE.  !: ref. pressure: global mean Patm (F) or a constant (F) 
    3432 
     
    115113         ! 
    116114         !                                            !* control check 
    117          IF( ln_apr_obc .OR. ln_apr_bdy  )   & 
    118             CALL ctl_stop( 'sbc_apr: inverse barometer added to OBC or BDY ssh data not yet implemented ' ) 
     115         IF( ln_apr_obc )   & 
     116            CALL ctl_stop( 'sbc_apr: inverse barometer added to OBC ssh data not yet implemented ' ) 
    119117         IF( ln_apr_obc .AND. .NOT. lk_obc )   & 
    120118            CALL ctl_stop( 'sbc_apr: add inverse barometer to OBC requires to use key_obc' ) 
    121          IF( ln_apr_bdy .AND. .NOT. lk_bdy )   & 
    122             CALL ctl_stop( 'sbc_apr: add inverse barometer to OBC requires to use key_bdy' ) 
    123          IF( ( ln_apr_obc .OR. ln_apr_bdy ) .AND. .NOT. lk_dynspg_ts )   & 
     119         IF( ( ln_apr_obc ) .AND. .NOT. lk_dynspg_ts )   & 
    124120            CALL ctl_stop( 'sbc_apr: use inverse barometer ssh at open boundary ONLY possible with time-splitting' ) 
    125          IF( ( ln_apr_obc .OR. ln_apr_bdy ) .AND. .NOT. ln_apr_dyn   )   & 
     121         IF( ( ln_apr_obc ) .AND. .NOT. ln_apr_dyn   )   & 
    126122            CALL ctl_stop( 'sbc_apr: use inverse barometer ssh at open boundary ONLY requires ln_apr_dyn=T' ) 
    127123      ENDIF 
  • branches/2011/dev_NOC_UKMO_MERGE/NEMOGCM/NEMO/OPA_SRC/SBC/sbcblk_core.F90

    r2777 r3094  
    1414   !!            3.2  !  2009-04  (B. Lemaire)  Introduce iom_put 
    1515   !!            3.3  !  2010-10  (S. Masson)  add diurnal cycle 
     16   !!            3.4  !  2011-11  (C. Harris) Fill arrays required by CICE 
    1617   !!---------------------------------------------------------------------- 
    1718 
     
    3435   USE lbclnk          ! ocean lateral boundary conditions (or mpp link) 
    3536   USE prtctl          ! Print control 
    36 #if defined key_lim3 
     37#if defined key_lim3 || defined key_cice 
    3738   USE sbc_ice         ! Surface boundary condition: ice fields 
    3839#endif 
     
    182183      !                                                        ! surface ocean fluxes computed with CLIO bulk formulea 
    183184      IF( MOD( kt - 1, nn_fsbc ) == 0 )   CALL blk_oce_core( sf, sst_m, ssu_m, ssv_m ) 
     185 
     186#if defined key_cice 
     187      IF( MOD( kt - 1, nn_fsbc ) == 0 )   THEN 
     188         qlw_ice(:,:,1)   = sf(jp_qlw)%fnow(:,:,1)  
     189         qsr_ice(:,:,1)   = sf(jp_qsr)%fnow(:,:,1) 
     190         tatm_ice(:,:)    = sf(jp_tair)%fnow(:,:,1)          
     191         qatm_ice(:,:)    = sf(jp_humi)%fnow(:,:,1) 
     192         tprecip(:,:)     = sf(jp_prec)%fnow(:,:,1) * rn_pfac 
     193         sprecip(:,:)     = sf(jp_snow)%fnow(:,:,1) * rn_pfac 
     194         wndi_ice(:,:)    = sf(jp_wndi)%fnow(:,:,1) 
     195         wndj_ice(:,:)    = sf(jp_wndj)%fnow(:,:,1) 
     196      ENDIF 
     197#endif 
    184198      ! 
    185199   END SUBROUTINE sbc_blk_core 
  • branches/2011/dev_NOC_UKMO_MERGE/NEMOGCM/NEMO/OPA_SRC/SBC/sbccpl.F90

    r2715 r3094  
    77   !!            3.0  ! 2008-02  (G. Madec, C Talandier)  surface module 
    88   !!            3.1  ! 2009_02  (G. Madec, S. Masson, E. Maisonave, A. Caubel) generic coupled interface 
     9   !!            3.4  ! 2011_11  (C. Harris) more flexibility + multi-category fields 
    910   !!---------------------------------------------------------------------- 
    1011#if defined key_oasis3 || defined key_oasis4 
     
    4142   USE geo2ocean       !  
    4243   USE restart         ! 
    43    USE oce   , ONLY : tn, un, vn 
     44   USE oce   , ONLY : tsn, un, vn 
    4445   USE albedo          ! 
    4546   USE in_out_manager  ! I/O manager 
     
    5152#endif 
    5253   USE diaar5, ONLY :   lk_diaar5 
     54#if defined key_cice 
     55   USE ice_domain_size, only: ncat 
     56#endif 
    5357   IMPLICIT NONE 
    5458   PRIVATE 
     
    8993   INTEGER, PARAMETER ::   jpr_cal    = 29            ! calving 
    9094   INTEGER, PARAMETER ::   jpr_taum   = 30            ! wind stress module 
    91 #if ! defined key_cpl_carbon_cycle 
    92    INTEGER, PARAMETER ::   jprcv      = 30            ! total number of fields received 
    93 #else 
    9495   INTEGER, PARAMETER ::   jpr_co2    = 31 
    95    INTEGER, PARAMETER ::   jprcv      = 31            ! total number of fields received 
    96 #endif    
     96   INTEGER, PARAMETER ::   jpr_topm   = 32            ! topmeltn 
     97   INTEGER, PARAMETER ::   jpr_botm   = 33            ! botmeltn 
     98   INTEGER, PARAMETER ::   jprcv      = 33            ! total number of fields received 
     99 
    97100   INTEGER, PARAMETER ::   jps_fice   =  1            ! ice fraction  
    98101   INTEGER, PARAMETER ::   jps_toce   =  2            ! ocean temperature 
     
    109112   INTEGER, PARAMETER ::   jps_ivy1   = 13            ! 
    110113   INTEGER, PARAMETER ::   jps_ivz1   = 14            ! 
    111 #if ! defined key_cpl_carbon_cycle 
    112    INTEGER, PARAMETER ::   jpsnd      = 14            ! total number of fields sended 
    113 #else 
    114114   INTEGER, PARAMETER ::   jps_co2    = 15 
    115115   INTEGER, PARAMETER ::   jpsnd      = 15            ! total number of fields sended 
    116 #endif    
     116 
    117117   !                                                         !!** namelist namsbc_cpl ** 
    118    ! Send to the atmosphere                                   ! 
    119    CHARACTER(len=100) ::   cn_snd_temperature = 'oce only'    ! 'oce only' 'weighted oce and ice' or 'mixed oce-ice' 
    120    CHARACTER(len=100) ::   cn_snd_albedo      = 'none'        ! 'none' 'weighted ice' or 'mixed oce-ice' 
    121    CHARACTER(len=100) ::   cn_snd_thickness   = 'none'        ! 'none' or 'weighted ice and snow' 
    122    CHARACTER(len=100) ::   cn_snd_crt_nature  = 'none'        ! 'none' 'oce only' 'weighted oce and ice' or 'mixed oce-ice'    
    123    CHARACTER(len=100) ::   cn_snd_crt_refere  = 'spherical'   ! 'spherical' or 'cartesian' 
    124    CHARACTER(len=100) ::   cn_snd_crt_orient  = 'local grid'  ! 'eastward-northward' or 'local grid' 
    125    CHARACTER(len=100) ::   cn_snd_crt_grid    = 'T'           ! always at 'T' point 
    126 #if defined key_cpl_carbon_cycle  
    127    CHARACTER(len=100) ::   cn_snd_co2         = 'none'        ! 'none' or 'coupled' 
     118   TYPE ::   FLD_C 
     119      CHARACTER(len = 32) ::   cldes                  ! desciption of the coupling strategy 
     120      CHARACTER(len = 32) ::   clcat                  ! multiple ice categories strategy 
     121      CHARACTER(len = 32) ::   clvref                 ! reference of vector ('spherical' or 'cartesian') 
     122      CHARACTER(len = 32) ::   clvor                  ! orientation of vector fields ('eastward-northward' or 'local grid') 
     123      CHARACTER(len = 32) ::   clvgrd                 ! grids on which is located the vector fields 
     124   END TYPE FLD_C 
     125   ! Send to the atmosphere                           ! 
     126   TYPE(FLD_C) ::   sn_snd_temp, sn_snd_alb, sn_snd_thick, sn_snd_crt, sn_snd_co2                         
     127   ! Received from the atmosphere                     ! 
     128   TYPE(FLD_C) ::   sn_rcv_w10m, sn_rcv_taumod, sn_rcv_tau, sn_rcv_dqnsdt, sn_rcv_qsr, sn_rcv_qns, sn_rcv_emp, sn_rcv_rnf 
     129   TYPE(FLD_C) ::   sn_rcv_cal, sn_rcv_iceflx, sn_rcv_co2                         
     130 
     131   TYPE ::   DYNARR      
     132      REAL(wp), POINTER, DIMENSION(:,:,:)    ::   z3    
     133   END TYPE DYNARR 
     134 
     135   TYPE( DYNARR ), SAVE, DIMENSION(jprcv) ::   frcv                      ! all fields recieved from the atmosphere 
     136 
     137   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   albedo_oce_mix     ! ocean albedo sent to atmosphere (mix clear/overcast sky) 
     138 
     139   INTEGER , ALLOCATABLE, SAVE, DIMENSION(    :) ::   nrcvinfo           ! OASIS info argument 
     140 
     141#if ! defined key_lim2   &&   ! defined key_lim3 
     142   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   u_ice, v_ice,fr1_i0,fr2_i0          ! jpi, jpj 
     143   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   tn_ice, alb_ice, qns_ice, dqns_ice  ! (jpi,jpj,jpl) 
    128144#endif 
    129    ! Received from the atmosphere                             ! 
    130    CHARACTER(len=100) ::   cn_rcv_tau_nature  = 'oce only'    ! 'oce only' 'oce and ice' or 'mixed oce-ice' 
    131    CHARACTER(len=100) ::   cn_rcv_tau_refere  = 'spherical'   ! 'spherical' or 'cartesian' 
    132    CHARACTER(len=100) ::   cn_rcv_tau_orient  = 'local grid'  ! 'eastward-northward' or 'local grid' 
    133    CHARACTER(len=100) ::   cn_rcv_tau_grid    = 'T'           ! 'T', 'U,V', 'U,V,I', 'T,I', or 'T,U,V' 
    134    CHARACTER(len=100) ::   cn_rcv_w10m        = 'none'        ! 'none' or 'coupled' 
    135    CHARACTER(len=100) ::   cn_rcv_dqnsdt      = 'none'        ! 'none' or 'coupled' 
    136    CHARACTER(len=100) ::   cn_rcv_qsr         = 'oce only'    ! 'oce only' 'conservative' 'oce and ice' or 'mixed oce-ice' 
    137    CHARACTER(len=100) ::   cn_rcv_qns         = 'oce only'    ! 'oce only' 'conservative' 'oce and ice' or 'mixed oce-ice' 
    138    CHARACTER(len=100) ::   cn_rcv_emp         = 'oce only'    ! 'oce only' 'conservative' or 'oce and ice' 
    139    CHARACTER(len=100) ::   cn_rcv_rnf         = 'coupled'     ! 'coupled' 'climato' or 'mixed' 
    140    CHARACTER(len=100) ::   cn_rcv_cal         = 'none'        ! 'none' or 'coupled' 
    141    CHARACTER(len=100) ::   cn_rcv_taumod      = 'none'        ! 'none' or 'coupled' 
    142 #if defined key_cpl_carbon_cycle  
    143    CHARACTER(len=100) ::   cn_rcv_co2         = 'none'        ! 'none' or 'coupled' 
     145 
     146#if defined key_cice 
     147   INTEGER, PARAMETER ::   jpl = ncat 
     148#elif ! defined key_lim2   &&   ! defined key_lim3 
     149   INTEGER, PARAMETER ::   jpl = 1  
     150   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   emp_ice 
     151   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   qsr_ice 
    144152#endif 
    145153 
    146 !!   CHARACTER(len=100), PUBLIC ::   cn_rcv_rnf   !: ???             ==>>  !!gm   treat this case in a different maner 
    147     
    148    CHARACTER(len=100), DIMENSION(4) ::   cn_snd_crt           ! array combining cn_snd_crt_* 
    149    CHARACTER(len=100), DIMENSION(4) ::   cn_rcv_tau           ! array combining cn_rcv_tau_* 
    150  
    151    REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   albedo_oce_mix     ! ocean albedo sent to atmosphere (mix clear/overcast sky) 
    152  
    153    REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   frcv               ! all fields recieved from the atmosphere 
    154    INTEGER , ALLOCATABLE, SAVE, DIMENSION(    :) ::   nrcvinfo           ! OASIS info argument 
    155  
    156 #if ! defined key_lim2   &&   ! defined key_lim3 
    157    ! quick patch to be able to run the coupled model without sea-ice... 
    158    INTEGER, PARAMETER ::   jpl = 1  
    159    REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   hicif, hsnif, u_ice, v_ice,fr1_i0,fr2_i0 ! jpi, jpj 
    160    REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   tn_ice, alb_ice ! (jpi,jpj,jpl) 
    161    REAL(wp) ::  lfus 
     154#if ! defined key_lim3   &&  ! defined key_cice 
     155   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::  a_i 
     156#endif 
     157 
     158#if ! defined key_lim3 
     159   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::  ht_i, ht_s 
     160#endif 
     161 
     162#if ! defined key_cice 
     163   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::  topmelt, botmelt 
    162164#endif 
    163165 
     
    176178      !!             ***  FUNCTION sbc_cpl_alloc  *** 
    177179      !!---------------------------------------------------------------------- 
    178       INTEGER :: ierr(2) 
     180      INTEGER :: ierr(4),jn 
    179181      !!---------------------------------------------------------------------- 
    180182      ierr(:) = 0 
    181183      ! 
    182       ALLOCATE( albedo_oce_mix(jpi,jpj), frcv(jpi,jpj,jprcv), nrcvinfo(jprcv),  STAT=ierr(1) ) 
     184      ALLOCATE( albedo_oce_mix(jpi,jpj), nrcvinfo(jprcv),  STAT=ierr(1) ) 
    183185      ! 
    184186#if ! defined key_lim2 && ! defined key_lim3 
    185187      ! quick patch to be able to run the coupled model without sea-ice... 
    186       ALLOCATE( hicif(jpi,jpj) , u_ice(jpi,jpj) , fr1_i0(jpi,jpj) , tn_ice (jpi,jpj,jpl) ,     & 
    187                 hsnif(jpi,jpj) , v_ice(jpi,jpj) , fr2_i0(jpi,jpj) , alb_ice(jpi,jpj,jpl) , STAT=ierr(2) ) 
     188      ALLOCATE( u_ice(jpi,jpj) , fr1_i0(jpi,jpj) , tn_ice (jpi,jpj,1) ,     & 
     189                v_ice(jpi,jpj) , fr2_i0(jpi,jpj) , alb_ice(jpi,jpj,1),      & 
     190                emp_ice(jpi,jpj) , qns_ice(jpi,jpj,1) , dqns_ice(jpi,jpj,1) , STAT=ierr(2) ) 
     191#endif 
     192 
     193#if ! defined key_lim3 && ! defined key_cice 
     194      ALLOCATE( a_i(jpi,jpj,jpl) , STAT=ierr(3) ) 
     195#endif 
     196 
     197#if defined key_cice || defined key_lim2 
     198      ALLOCATE( ht_i(jpi,jpj,jpl) , ht_s(jpi,jpj,jpl) , STAT=ierr(4) ) 
    188199#endif 
    189200      sbc_cpl_alloc = MAXVAL( ierr ) 
     
    213224      INTEGER ::   jn   ! dummy loop index 
    214225      !! 
    215       NAMELIST/namsbc_cpl/  cn_snd_temperature, cn_snd_albedo    , cn_snd_thickness,                 &           
    216          cn_snd_crt_nature, cn_snd_crt_refere , cn_snd_crt_orient, cn_snd_crt_grid ,                 & 
    217          cn_rcv_w10m      , cn_rcv_taumod     ,                                                      & 
    218          cn_rcv_tau_nature, cn_rcv_tau_refere , cn_rcv_tau_orient, cn_rcv_tau_grid ,                 & 
    219          cn_rcv_dqnsdt    , cn_rcv_qsr        , cn_rcv_qns       , cn_rcv_emp      , cn_rcv_rnf , cn_rcv_cal 
    220 #if defined key_cpl_carbon_cycle  
    221       NAMELIST/namsbc_cpl_co2/  cn_snd_co2, cn_rcv_co2 
    222 #endif 
     226      NAMELIST/namsbc_cpl/  sn_snd_temp, sn_snd_alb   , sn_snd_thick, sn_snd_crt   , sn_snd_co2,   & 
     227         &                  sn_rcv_w10m, sn_rcv_taumod, sn_rcv_tau  , sn_rcv_dqnsdt, sn_rcv_qsr,   & 
     228         &                  sn_rcv_qns , sn_rcv_emp   , sn_rcv_rnf  , sn_rcv_cal   , sn_rcv_iceflx  , sn_rcv_co2 
    223229      !!--------------------------------------------------------------------- 
    224230 
     
    230236      !      Namelist informations       ! 
    231237      ! ================================ ! 
     238 
     239      ! default definitions 
     240      !                    !     description       !  multiple  !    vector   !      vector          ! vector ! 
     241      !                    !                       ! categories !  reference  !    orientation       ! grids  ! 
     242      ! send 
     243      sn_snd_temp   = FLD_C( 'weighted oce and ice',    'no'    ,     ''      ,         ''           ,   ''   )  
     244      sn_snd_alb    = FLD_C( 'weighted ice'        ,    'no'    ,     ''      ,         ''           ,   ''   )  
     245      sn_snd_thick  = FLD_C( 'none'                ,    'no'    ,     ''      ,         ''           ,   ''   )  
     246      sn_snd_crt    = FLD_C( 'none'                ,    'no'    , 'spherical' , 'eastward-northward' ,  'T'   )      
     247      sn_snd_co2    = FLD_C( 'none'                ,    'no'    ,     ''      ,         ''           ,   ''   )      
     248      ! receive 
     249      sn_rcv_w10m   = FLD_C( 'none'                ,    'no'    ,     ''      ,         ''          ,   ''    ) 
     250      sn_rcv_taumod = FLD_C( 'coupled'             ,    'no'    ,     ''      ,         ''          ,   ''    ) 
     251      sn_rcv_tau    = FLD_C( 'oce only'            ,    'no'    , 'cartesian' , 'eastward-northward',  'U,V'  )   
     252      sn_rcv_dqnsdt = FLD_C( 'coupled'             ,    'no'    ,     ''      ,         ''          ,   ''    ) 
     253      sn_rcv_qsr    = FLD_C( 'oce and ice'         ,    'no'    ,     ''      ,         ''          ,   ''    ) 
     254      sn_rcv_qns    = FLD_C( 'oce and ice'         ,    'no'    ,     ''      ,         ''          ,   ''    ) 
     255      sn_rcv_emp    = FLD_C( 'conservative'        ,    'no'    ,     ''      ,         ''          ,   ''    ) 
     256      sn_rcv_rnf    = FLD_C( 'coupled'             ,    'no'    ,     ''      ,         ''          ,   ''    ) 
     257      sn_rcv_cal    = FLD_C( 'coupled'             ,    'no'    ,     ''      ,         ''          ,   ''    ) 
     258      sn_rcv_iceflx = FLD_C( 'none'                ,    'no'    ,     ''      ,         ''          ,   ''    ) 
     259      sn_rcv_co2    = FLD_C( 'none'                ,    'no'    ,     ''      ,         ''          ,   ''    ) 
    232260 
    233261      REWIND( numnam )                    ! ... read namlist namsbc_cpl 
     
    238266         WRITE(numout,*)'sbc_cpl_init : namsbc_cpl namelist ' 
    239267         WRITE(numout,*)'~~~~~~~~~~~~' 
    240          WRITE(numout,*)'   received fields' 
    241          WRITE(numout,*)'       10m wind module                    cn_rcv_w10m        = ', cn_rcv_w10m  
    242          WRITE(numout,*)'       surface stress - nature            cn_rcv_tau_nature  = ', cn_rcv_tau_nature 
    243          WRITE(numout,*)'                      - referential       cn_rcv_tau_refere  = ', cn_rcv_tau_refere 
    244          WRITE(numout,*)'                      - orientation       cn_rcv_tau_orient  = ', cn_rcv_tau_orient 
    245          WRITE(numout,*)'                      - mesh              cn_rcv_tau_grid    = ', cn_rcv_tau_grid 
    246          WRITE(numout,*)'       non-solar heat flux sensitivity    cn_rcv_dqnsdt      = ', cn_rcv_dqnsdt 
    247          WRITE(numout,*)'       solar heat flux                    cn_rcv_qsr         = ', cn_rcv_qsr   
    248          WRITE(numout,*)'       non-solar heat flux                cn_rcv_qns         = ', cn_rcv_qns 
    249          WRITE(numout,*)'       freshwater budget                  cn_rcv_emp         = ', cn_rcv_emp 
    250          WRITE(numout,*)'       runoffs                            cn_rcv_rnf         = ', cn_rcv_rnf 
    251          WRITE(numout,*)'       calving                            cn_rcv_cal         = ', cn_rcv_cal  
    252          WRITE(numout,*)'       stress module                      cn_rcv_taumod      = ', cn_rcv_taumod 
    253          WRITE(numout,*)'   sent fields' 
    254          WRITE(numout,*)'       surface temperature                cn_snd_temperature = ', cn_snd_temperature 
    255          WRITE(numout,*)'       albedo                             cn_snd_albedo      = ', cn_snd_albedo 
    256          WRITE(numout,*)'       ice/snow thickness                 cn_snd_thickness   = ', cn_snd_thickness   
    257          WRITE(numout,*)'       surface current - nature           cn_snd_crt_nature  = ', cn_snd_crt_nature  
    258          WRITE(numout,*)'                       - referential      cn_snd_crt_refere  = ', cn_snd_crt_refere  
    259          WRITE(numout,*)'                       - orientation      cn_snd_crt_orient  = ', cn_snd_crt_orient 
    260          WRITE(numout,*)'                       - mesh             cn_snd_crt_grid    = ', cn_snd_crt_grid  
    261       ENDIF 
    262  
    263 #if defined key_cpl_carbon_cycle  
    264       REWIND( numnam )                    ! read namlist namsbc_cpl_co2 
    265       READ  ( numnam, namsbc_cpl_co2 ) 
    266       IF(lwp) THEN                        ! control print 
    267          WRITE(numout,*) 
    268          WRITE(numout,*)'sbc_cpl_init : namsbc_cpl_co2 namelist ' 
    269          WRITE(numout,*)'~~~~~~~~~~~~' 
    270          WRITE(numout,*)'   received fields' 
    271          WRITE(numout,*)'       atm co2                            cn_rcv_co2         = ', cn_rcv_co2 
    272          WRITE(numout,*)'   sent fields' 
    273          WRITE(numout,*)'      oce co2 flux                        cn_snd_co2         = ', cn_snd_co2 
    274           WRITE(numout,*) 
    275       ENDIF 
    276 #endif 
    277       ! save current & stress in an array and suppress possible blank in the name 
    278       cn_snd_crt(1) = TRIM( cn_snd_crt_nature )   ;   cn_snd_crt(2) = TRIM( cn_snd_crt_refere ) 
    279       cn_snd_crt(3) = TRIM( cn_snd_crt_orient )   ;   cn_snd_crt(4) = TRIM( cn_snd_crt_grid   ) 
    280       cn_rcv_tau(1) = TRIM( cn_rcv_tau_nature )   ;   cn_rcv_tau(2) = TRIM( cn_rcv_tau_refere ) 
    281       cn_rcv_tau(3) = TRIM( cn_rcv_tau_orient )   ;   cn_rcv_tau(4) = TRIM( cn_rcv_tau_grid   ) 
    282  
    283       !                                   ! allocate zdfric arrays 
     268         WRITE(numout,*)'  received fields (mutiple ice categogies)' 
     269         WRITE(numout,*)'      10m wind module                 = ', TRIM(sn_rcv_w10m%cldes  ), ' (', TRIM(sn_rcv_w10m%clcat  ), ')' 
     270         WRITE(numout,*)'      stress module                   = ', TRIM(sn_rcv_taumod%cldes), ' (', TRIM(sn_rcv_taumod%clcat), ')' 
     271         WRITE(numout,*)'      surface stress                  = ', TRIM(sn_rcv_tau%cldes   ), ' (', TRIM(sn_rcv_tau%clcat   ), ')' 
     272         WRITE(numout,*)'                     - referential    = ', sn_rcv_tau%clvref 
     273         WRITE(numout,*)'                     - orientation    = ', sn_rcv_tau%clvor 
     274         WRITE(numout,*)'                     - mesh           = ', sn_rcv_tau%clvgrd 
     275         WRITE(numout,*)'      non-solar heat flux sensitivity = ', TRIM(sn_rcv_dqnsdt%cldes), ' (', TRIM(sn_rcv_dqnsdt%clcat), ')' 
     276         WRITE(numout,*)'      solar heat flux                 = ', TRIM(sn_rcv_qsr%cldes   ), ' (', TRIM(sn_rcv_qsr%clcat   ), ')' 
     277         WRITE(numout,*)'      non-solar heat flux             = ', TRIM(sn_rcv_qns%cldes   ), ' (', TRIM(sn_rcv_qns%clcat   ), ')' 
     278         WRITE(numout,*)'      freshwater budget               = ', TRIM(sn_rcv_emp%cldes   ), ' (', TRIM(sn_rcv_emp%clcat   ), ')' 
     279         WRITE(numout,*)'      runoffs                         = ', TRIM(sn_rcv_rnf%cldes   ), ' (', TRIM(sn_rcv_rnf%clcat   ), ')' 
     280         WRITE(numout,*)'      calving                         = ', TRIM(sn_rcv_cal%cldes   ), ' (', TRIM(sn_rcv_cal%clcat   ), ')' 
     281         WRITE(numout,*)'      sea ice heat fluxes             = ', TRIM(sn_rcv_iceflx%cldes), ' (', TRIM(sn_rcv_iceflx%clcat), ')' 
     282         WRITE(numout,*)'      atm co2                         = ', TRIM(sn_rcv_co2%cldes   ), ' (', TRIM(sn_rcv_co2%clcat   ), ')' 
     283         WRITE(numout,*)'  sent fields (multiple ice categories)' 
     284         WRITE(numout,*)'      surface temperature             = ', TRIM(sn_snd_temp%cldes  ), ' (', TRIM(sn_snd_temp%clcat  ), ')' 
     285         WRITE(numout,*)'      albedo                          = ', TRIM(sn_snd_alb%cldes   ), ' (', TRIM(sn_snd_alb%clcat   ), ')' 
     286         WRITE(numout,*)'      ice/snow thickness              = ', TRIM(sn_snd_thick%cldes ), ' (', TRIM(sn_snd_thick%clcat ), ')' 
     287         WRITE(numout,*)'      surface current                 = ', TRIM(sn_snd_crt%cldes   ), ' (', TRIM(sn_snd_crt%clcat   ), ')' 
     288         WRITE(numout,*)'                      - referential   = ', sn_snd_crt%clvref  
     289         WRITE(numout,*)'                      - orientation   = ', sn_snd_crt%clvor 
     290         WRITE(numout,*)'                      - mesh          = ', sn_snd_crt%clvgrd 
     291         WRITE(numout,*)'      oce co2 flux                    = ', TRIM(sn_snd_co2%cldes   ), ' (', TRIM(sn_snd_co2%clcat   ), ')' 
     292      ENDIF 
     293 
     294      !                                   ! allocate sbccpl arrays 
    284295      IF( sbc_cpl_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'sbc_cpl_alloc : unable to allocate arrays' ) 
    285296      
     
    294305 
    295306      ! default definitions of srcv 
    296       srcv(:)%laction = .FALSE.   ;   srcv(:)%clgrid = 'T'   ;   srcv(:)%nsgn = 1. 
     307      srcv(:)%laction = .FALSE.   ;   srcv(:)%clgrid = 'T'   ;   srcv(:)%nsgn = 1.   ;   srcv(:)%nct = 1 
    297308 
    298309      !                                                      ! ------------------------- ! 
     
    315326      !  
    316327      ! Vectors: change of sign at north fold ONLY if on the local grid 
    317       IF( TRIM( cn_rcv_tau(3) ) == 'local grid' )   srcv(jpr_otx1:jpr_itz2)%nsgn = -1. 
     328      IF( TRIM( sn_rcv_tau%clvor ) == 'local grid' )   srcv(jpr_otx1:jpr_itz2)%nsgn = -1. 
    318329       
    319330      !                                                           ! Set grid and action 
    320       SELECT CASE( TRIM( cn_rcv_tau(4) ) )      !  'T', 'U,V', 'U,V,I', 'U,V,F', 'T,I', 'T,F', or 'T,U,V' 
     331      SELECT CASE( TRIM( sn_rcv_tau%clvgrd ) )      !  'T', 'U,V', 'U,V,I', 'U,V,F', 'T,I', 'T,F', or 'T,U,V' 
    321332      CASE( 'T' )  
    322333         srcv(jpr_otx1:jpr_itz2)%clgrid  = 'T'        ! oce and ice components given at T-point 
     
    364375         srcv(jpr_itx1:jpr_itz2)%laction = .TRUE.     ! receive ice components on grid 1 & 2 
    365376      CASE default    
    366          CALL ctl_stop( 'sbc_cpl_init: wrong definition of cn_rcv_tau(4)' ) 
     377         CALL ctl_stop( 'sbc_cpl_init: wrong definition of sn_rcv_tau%clvgrd' ) 
    367378      END SELECT 
    368379      ! 
    369       IF( TRIM( cn_rcv_tau(2) ) == 'spherical' )   &           ! spherical: 3rd component not received 
     380      IF( TRIM( sn_rcv_tau%clvref ) == 'spherical' )   &           ! spherical: 3rd component not received 
    370381         &     srcv( (/jpr_otz1, jpr_otz2, jpr_itz1, jpr_itz2/) )%laction = .FALSE.  
    371382      ! 
    372       IF( TRIM( cn_rcv_tau(1) ) /= 'oce and ice' ) THEN        ! 'oce and ice' case ocean stress on ocean mesh used 
     383      IF( TRIM( sn_rcv_tau%cldes ) /= 'oce and ice' ) THEN        ! 'oce and ice' case ocean stress on ocean mesh used 
    373384         srcv(jpr_itx1:jpr_itz2)%laction = .FALSE.    ! ice components not received 
    374385         srcv(jpr_itx1)%clgrid = 'U'                  ! ocean stress used after its transformation 
     
    388399      srcv(jpr_semp)%clname = 'OISubMSn'      ! ice solid water budget = sublimation - solid precipitation 
    389400      srcv(jpr_oemp)%clname = 'OOEvaMPr'      ! ocean water budget = ocean Evap - ocean precip 
    390       SELECT CASE( TRIM( cn_rcv_emp ) ) 
     401      SELECT CASE( TRIM( sn_rcv_emp%cldes ) ) 
    391402      CASE( 'oce only'      )   ;   srcv(                                 jpr_oemp   )%laction = .TRUE.  
    392403      CASE( 'conservative'  )   ;   srcv( (/jpr_rain, jpr_snow, jpr_ievp, jpr_tevp/) )%laction = .TRUE. 
    393404      CASE( 'oce and ice'   )   ;   srcv( (/jpr_ievp, jpr_sbpr, jpr_semp, jpr_oemp/) )%laction = .TRUE. 
    394       CASE default              ;   CALL ctl_stop( 'sbc_cpl_init: wrong definition of cn_rcv_emp' ) 
     405      CASE default              ;   CALL ctl_stop( 'sbc_cpl_init: wrong definition of sn_rcv_emp%cldes' ) 
    395406      END SELECT 
    396407 
     
    398409      !                                                      !     Runoffs & Calving     !    
    399410      !                                                      ! ------------------------- ! 
    400       srcv(jpr_rnf   )%clname = 'O_Runoff'   ;   IF( TRIM( cn_rcv_rnf ) == 'coupled' )   srcv(jpr_rnf)%laction = .TRUE. 
    401                                                  IF( TRIM( cn_rcv_rnf ) == 'climato' )   THEN   ;   ln_rnf = .TRUE. 
    402                                                  ELSE                                           ;   ln_rnf = .FALSE. 
    403                                                  ENDIF 
    404       srcv(jpr_cal   )%clname = 'OCalving'   ;   IF( TRIM( cn_rcv_cal ) == 'coupled' )   srcv(jpr_cal)%laction = .TRUE. 
     411      srcv(jpr_rnf   )%clname = 'O_Runoff'   ;   IF( TRIM( sn_rcv_rnf%cldes ) == 'coupled' )   srcv(jpr_rnf)%laction = .TRUE. 
     412! This isn't right - really just want ln_rnf_emp changed 
     413!                                                 IF( TRIM( sn_rcv_rnf%cldes ) == 'climato' )   THEN   ;   ln_rnf = .TRUE. 
     414!                                                 ELSE                                                 ;   ln_rnf = .FALSE. 
     415!                                                 ENDIF 
     416      srcv(jpr_cal   )%clname = 'OCalving'   ;   IF( TRIM( sn_rcv_cal%cldes ) == 'coupled' )   srcv(jpr_cal)%laction = .TRUE. 
    405417 
    406418      !                                                      ! ------------------------- ! 
     
    410422      srcv(jpr_qnsice)%clname = 'O_QnsIce' 
    411423      srcv(jpr_qnsmix)%clname = 'O_QnsMix' 
    412       SELECT CASE( TRIM( cn_rcv_qns ) ) 
     424      SELECT CASE( TRIM( sn_rcv_qns%cldes ) ) 
    413425      CASE( 'oce only'      )   ;   srcv(               jpr_qnsoce   )%laction = .TRUE. 
    414426      CASE( 'conservative'  )   ;   srcv( (/jpr_qnsice, jpr_qnsmix/) )%laction = .TRUE. 
    415427      CASE( 'oce and ice'   )   ;   srcv( (/jpr_qnsice, jpr_qnsoce/) )%laction = .TRUE. 
    416428      CASE( 'mixed oce-ice' )   ;   srcv(               jpr_qnsmix   )%laction = .TRUE.  
    417       CASE default              ;   CALL ctl_stop( 'sbc_cpl_init: wrong definition of cn_rcv_qns' ) 
     429      CASE default              ;   CALL ctl_stop( 'sbc_cpl_init: wrong definition of sn_rcv_qns%cldes' ) 
    418430      END SELECT 
    419  
     431      IF( TRIM( sn_rcv_qns%cldes ) == 'mixed oce-ice' .AND. jpl > 1 ) & 
     432         CALL ctl_stop( 'sbc_cpl_init: sn_rcv_qns%cldes not currently allowed to be mixed oce-ice for multi-category ice' ) 
    420433      !                                                      ! ------------------------- ! 
    421434      !                                                      !    solar radiation        !   Qsr 
     
    424437      srcv(jpr_qsrice)%clname = 'O_QsrIce' 
    425438      srcv(jpr_qsrmix)%clname = 'O_QsrMix' 
    426       SELECT CASE( TRIM( cn_rcv_qsr ) ) 
     439      SELECT CASE( TRIM( sn_rcv_qsr%cldes ) ) 
    427440      CASE( 'oce only'      )   ;   srcv(               jpr_qsroce   )%laction = .TRUE. 
    428441      CASE( 'conservative'  )   ;   srcv( (/jpr_qsrice, jpr_qsrmix/) )%laction = .TRUE. 
    429442      CASE( 'oce and ice'   )   ;   srcv( (/jpr_qsrice, jpr_qsroce/) )%laction = .TRUE. 
    430443      CASE( 'mixed oce-ice' )   ;   srcv(               jpr_qsrmix   )%laction = .TRUE.  
    431       CASE default              ;   CALL ctl_stop( 'sbc_cpl_init: wrong definition of cn_rcv_qsr' ) 
     444      CASE default              ;   CALL ctl_stop( 'sbc_cpl_init: wrong definition of sn_rcv_qsr%cldes' ) 
    432445      END SELECT 
    433  
     446      IF( TRIM( sn_rcv_qsr%cldes ) == 'mixed oce-ice' .AND. jpl > 1 ) & 
     447         CALL ctl_stop( 'sbc_cpl_init: sn_rcv_qsr%cldes not currently allowed to be mixed oce-ice for multi-category ice' ) 
    434448      !                                                      ! ------------------------- ! 
    435449      !                                                      !   non solar sensitivity   !   d(Qns)/d(T) 
    436450      !                                                      ! ------------------------- ! 
    437451      srcv(jpr_dqnsdt)%clname = 'O_dQnsdT'    
    438       IF( TRIM( cn_rcv_dqnsdt ) == 'coupled' )   srcv(jpr_dqnsdt)%laction = .TRUE. 
    439       ! 
    440       ! non solar sensitivity mandatory for ice model 
    441       IF( TRIM( cn_rcv_dqnsdt ) == 'none' .AND. k_ice /= 0 ) & 
    442          CALL ctl_stop( 'sbc_cpl_init: cn_rcv_dqnsdt must be coupled in namsbc_cpl namelist' ) 
     452      IF( TRIM( sn_rcv_dqnsdt%cldes ) == 'coupled' )   srcv(jpr_dqnsdt)%laction = .TRUE. 
     453      ! 
     454      ! non solar sensitivity mandatory for LIM ice model 
     455      IF( TRIM( sn_rcv_dqnsdt%cldes ) == 'none' .AND. k_ice /= 0 .AND. k_ice /= 4) & 
     456         CALL ctl_stop( 'sbc_cpl_init: sn_rcv_dqnsdt%cldes must be coupled in namsbc_cpl namelist' ) 
    443457      ! non solar sensitivity mandatory for mixed oce-ice solar radiation coupling technique 
    444       IF( TRIM( cn_rcv_dqnsdt ) == 'none' .AND. TRIM( cn_rcv_qns ) == 'mixed oce-ice' ) & 
    445          CALL ctl_stop( 'sbc_cpl_init: namsbc_cpl namelist mismatch between cn_rcv_qns and cn_rcv_dqnsdt' ) 
     458      IF( TRIM( sn_rcv_dqnsdt%cldes ) == 'none' .AND. TRIM( sn_rcv_qns%cldes ) == 'mixed oce-ice' ) & 
     459         CALL ctl_stop( 'sbc_cpl_init: namsbc_cpl namelist mismatch between sn_rcv_qns%cldes and sn_rcv_dqnsdt%cldes' ) 
    446460      !                                                      ! ------------------------- ! 
    447461      !                                                      !    Ice Qsr penetration    !    
     
    456470      !                                                      !      10m wind module      !    
    457471      !                                                      ! ------------------------- ! 
    458       srcv(jpr_w10m)%clname = 'O_Wind10'   ;   IF( TRIM(cn_rcv_w10m  ) == 'coupled' )   srcv(jpr_w10m)%laction = .TRUE.  
     472      srcv(jpr_w10m)%clname = 'O_Wind10'   ;   IF( TRIM(sn_rcv_w10m%cldes  ) == 'coupled' )   srcv(jpr_w10m)%laction = .TRUE.  
    459473      ! 
    460474      !                                                      ! ------------------------- ! 
    461475      !                                                      !   wind stress module      !    
    462476      !                                                      ! ------------------------- ! 
    463       srcv(jpr_taum)%clname = 'O_TauMod'   ;   IF( TRIM(cn_rcv_taumod) == 'coupled' )   srcv(jpr_taum)%laction = .TRUE. 
     477      srcv(jpr_taum)%clname = 'O_TauMod'   ;   IF( TRIM(sn_rcv_taumod%cldes) == 'coupled' )   srcv(jpr_taum)%laction = .TRUE. 
    464478      lhftau = srcv(jpr_taum)%laction 
    465479 
    466 #if defined key_cpl_carbon_cycle 
    467480      !                                                      ! ------------------------- ! 
    468481      !                                                      !      Atmospheric CO2      ! 
    469482      !                                                      ! ------------------------- ! 
    470       srcv(jpr_co2 )%clname = 'O_AtmCO2'   ;   IF( TRIM(cn_rcv_co2   ) == 'coupled' )    srcv(jpr_co2 )%laction = .TRUE. 
    471 #endif 
    472       
     483      srcv(jpr_co2 )%clname = 'O_AtmCO2'   ;   IF( TRIM(sn_rcv_co2%cldes   ) == 'coupled' )    srcv(jpr_co2 )%laction = .TRUE. 
     484      !                                                      ! ------------------------- ! 
     485      !                                                      !   topmelt and botmelt     !    
     486      !                                                      ! ------------------------- ! 
     487      srcv(jpr_topm )%clname = 'OTopMlt' 
     488      srcv(jpr_botm )%clname = 'OBotMlt' 
     489      IF( TRIM(sn_rcv_iceflx%cldes) == 'coupled' ) THEN 
     490         IF ( TRIM( sn_rcv_iceflx%clcat ) == 'yes' ) THEN 
     491            srcv(jpr_topm:jpr_botm)%nct = jpl 
     492         ELSE 
     493            CALL ctl_stop( 'sbc_cpl_init: sn_rcv_iceflx%clcat should always be set to yes currently' ) 
     494         ENDIF 
     495         srcv(jpr_topm:jpr_botm)%laction = .TRUE. 
     496      ENDIF 
     497 
     498      ! Allocate all parts of frcv used for received fields 
     499      DO jn = 1, jprcv 
     500         IF ( srcv(jn)%laction ) ALLOCATE( frcv(jn)%z3(jpi,jpj,srcv(jn)%nct) ) 
     501      END DO 
     502      ! Allocate taum part of frcv which is used even when not received as coupling field 
     503      IF ( .NOT. srcv(jpr_taum)%laction ) ALLOCATE( frcv(jpr_taum)%z3(jpi,jpj,srcv(jn)%nct) ) 
     504 
    473505      ! ================================ ! 
    474506      !     Define the send interface    ! 
    475507      ! ================================ ! 
    476       ! for each field: define the OASIS name                           (srcv(:)%clname) 
    477       !                 define send or not from the namelist parameters (srcv(:)%laction) 
    478       !                 define the north fold type of lbc               (srcv(:)%nsgn) 
     508      ! for each field: define the OASIS name                           (ssnd(:)%clname) 
     509      !                 define send or not from the namelist parameters (ssnd(:)%laction) 
     510      !                 define the north fold type of lbc               (ssnd(:)%nsgn) 
    479511       
    480512      ! default definitions of nsnd 
    481       ssnd(:)%laction = .FALSE.   ;   ssnd(:)%clgrid = 'T'   ;   ssnd(:)%nsgn = 1. 
     513      ssnd(:)%laction = .FALSE.   ;   ssnd(:)%clgrid = 'T'   ;   ssnd(:)%nsgn = 1.  ; ssnd(:)%nct = 1 
    482514          
    483515      !                                                      ! ------------------------- ! 
     
    487519      ssnd(jps_tice)%clname = 'O_TepIce' 
    488520      ssnd(jps_tmix)%clname = 'O_TepMix' 
    489       SELECT CASE( TRIM( cn_snd_temperature ) ) 
     521      SELECT CASE( TRIM( sn_snd_temp%cldes ) ) 
    490522      CASE( 'oce only'             )   ;   ssnd(   jps_toce             )%laction = .TRUE. 
    491       CASE( 'weighted oce and ice' )   ;   ssnd( (/jps_toce, jps_tice/) )%laction = .TRUE. 
     523      CASE( 'weighted oce and ice' ) 
     524         ssnd( (/jps_toce, jps_tice/) )%laction = .TRUE. 
     525         IF ( TRIM( sn_snd_temp%clcat ) == 'yes' )  ssnd(jps_tice)%nct = jpl 
    492526      CASE( 'mixed oce-ice'        )   ;   ssnd(   jps_tmix             )%laction = .TRUE. 
    493       CASE default   ;   CALL ctl_stop( 'sbc_cpl_init: wrong definition of cn_snd_temperature' ) 
     527      CASE default   ;   CALL ctl_stop( 'sbc_cpl_init: wrong definition of sn_snd_temp%cldes' ) 
    494528      END SELECT 
    495529      
     
    499533      ssnd(jps_albice)%clname = 'O_AlbIce'  
    500534      ssnd(jps_albmix)%clname = 'O_AlbMix' 
    501       SELECT CASE( TRIM( cn_snd_albedo ) ) 
     535      SELECT CASE( TRIM( sn_snd_alb%cldes ) ) 
    502536      CASE( 'none'          )       ! nothing to do 
    503537      CASE( 'weighted ice'  )   ;   ssnd(jps_albice)%laction = .TRUE. 
    504538      CASE( 'mixed oce-ice' )   ;   ssnd(jps_albmix)%laction = .TRUE. 
    505       CASE default   ;   CALL ctl_stop( 'sbc_cpl_init: wrong definition of cn_snd_albedo' ) 
     539      CASE default   ;   CALL ctl_stop( 'sbc_cpl_init: wrong definition of sn_snd_alb%cldes' ) 
    506540      END SELECT 
    507541      ! 
     
    509543      !     1. sending mixed oce-ice albedo or 
    510544      !     2. receiving mixed oce-ice solar radiation  
    511       IF ( TRIM ( cn_snd_albedo ) == 'mixed oce-ice' .OR. TRIM ( cn_rcv_qsr ) == 'mixed oce-ice' ) THEN 
     545      IF ( TRIM ( sn_snd_alb%cldes ) == 'mixed oce-ice' .OR. TRIM ( sn_rcv_qsr%cldes ) == 'mixed oce-ice' ) THEN 
    512546         CALL albedo_oce( zaos, zacs ) 
    513547         ! Due to lack of information on nebulosity : mean clear/overcast sky 
     
    518552      !                                                      !  Ice fraction & Thickness !  
    519553      !                                                      ! ------------------------- ! 
    520       ssnd(jps_fice)%clname = 'OIceFrac'    
    521       ssnd(jps_hice)%clname = 'O_IceTck' 
    522       ssnd(jps_hsnw)%clname = 'O_SnwTck' 
    523       IF( k_ice /= 0 )   ssnd(jps_fice)%laction = .TRUE.       ! if ice treated in the ocean (even in climato case) 
    524       IF( TRIM( cn_snd_thickness ) == 'weighted ice and snow' )   ssnd( (/jps_hice, jps_hsnw/) )%laction = .TRUE. 
    525           
     554      ssnd(jps_fice)%clname = 'OIceFrc' 
     555      ssnd(jps_hice)%clname = 'OIceTck' 
     556      ssnd(jps_hsnw)%clname = 'OSnwTck' 
     557      IF( k_ice /= 0 ) THEN 
     558         ssnd(jps_fice)%laction = .TRUE.                  ! if ice treated in the ocean (even in climato case) 
     559! Currently no namelist entry to determine sending of multi-category ice fraction so use the thickness entry for now 
     560         IF ( TRIM( sn_snd_thick%clcat ) == 'yes' ) ssnd(jps_fice)%nct = jpl 
     561      ENDIF 
     562 
     563      SELECT CASE ( TRIM( sn_snd_thick%cldes ) ) 
     564      CASE ( 'ice and snow' )  
     565         ssnd(jps_hice:jps_hsnw)%laction = .TRUE. 
     566         IF ( TRIM( sn_snd_thick%clcat ) == 'yes' ) THEN 
     567            ssnd(jps_hice:jps_hsnw)%nct = jpl 
     568         ELSE 
     569            IF ( jpl > 1 ) THEN 
     570               CALL ctl_stop( 'sbc_cpl_init: use weighted ice and snow option for sn_snd_thick%cldes if not exchanging category fields' ) 
     571            ENDIF 
     572         ENDIF 
     573      CASE ( 'weighted ice and snow' )  
     574         ssnd(jps_hice:jps_hsnw)%laction = .TRUE. 
     575         IF ( TRIM( sn_snd_thick%clcat ) == 'yes' ) ssnd(jps_hice:jps_hsnw)%nct = jpl 
     576      CASE default   ;   CALL ctl_stop( 'sbc_cpl_init: wrong definition of sn_snd_thick%cldes' ) 
     577      END SELECT 
     578 
    526579      !                                                      ! ------------------------- ! 
    527580      !                                                      !      Surface current      ! 
     
    534587      ssnd(jps_ocx1:jps_ivz1)%nsgn = -1.   ! vectors: change of the sign at the north fold 
    535588 
    536       IF( cn_snd_crt(4) /= 'T' )   CALL ctl_stop( 'cn_snd_crt(4) must be equal to T' ) 
    537       ssnd(jps_ocx1:jps_ivz1)%clgrid  = 'T'      ! all oce and ice components on the same unique grid 
    538  
     589      IF( sn_snd_crt%clvgrd == 'U,V' ) THEN 
     590         ssnd(jps_ocx1)%clgrid = 'U' ; ssnd(jps_ocy1)%clgrid = 'V' 
     591      ELSE IF( sn_snd_crt%clvgrd /= 'T' ) THEN   
     592         CALL ctl_stop( 'sn_snd_crt%clvgrd must be equal to T' ) 
     593         ssnd(jps_ocx1:jps_ivz1)%clgrid  = 'T'      ! all oce and ice components on the same unique grid 
     594      ENDIF 
    539595      ssnd(jps_ocx1:jps_ivz1)%laction = .TRUE.   ! default: all are send 
    540       IF( TRIM( cn_snd_crt(2) ) == 'spherical' )   ssnd( (/jps_ocz1, jps_ivz1/) )%laction = .FALSE.  
    541       SELECT CASE( TRIM( cn_snd_crt(1) ) ) 
     596      IF( TRIM( sn_snd_crt%clvref ) == 'spherical' )   ssnd( (/jps_ocz1, jps_ivz1/) )%laction = .FALSE.  
     597      IF( TRIM( sn_snd_crt%clvor ) == 'eastward-northward' ) ssnd(jps_ocx1:jps_ivz1)%nsgn = 1. 
     598      SELECT CASE( TRIM( sn_snd_crt%cldes ) ) 
    542599      CASE( 'none'                 )   ;   ssnd(jps_ocx1:jps_ivz1)%laction = .FALSE. 
    543600      CASE( 'oce only'             )   ;   ssnd(jps_ivx1:jps_ivz1)%laction = .FALSE. 
    544601      CASE( 'weighted oce and ice' )   !   nothing to do 
    545602      CASE( 'mixed oce-ice'        )   ;   ssnd(jps_ivx1:jps_ivz1)%laction = .FALSE. 
    546       CASE default   ;   CALL ctl_stop( 'sbc_cpl_init: wrong definition of cn_snd_crt(1)' ) 
     603      CASE default   ;   CALL ctl_stop( 'sbc_cpl_init: wrong definition of sn_snd_crt%cldes' ) 
    547604      END SELECT 
    548605 
    549 #if defined key_cpl_carbon_cycle 
    550606      !                                                      ! ------------------------- ! 
    551607      !                                                      !          CO2 flux         ! 
    552608      !                                                      ! ------------------------- ! 
    553       ssnd(jps_co2)%clname = 'O_CO2FLX' ;  IF( TRIM(cn_snd_co2) == 'coupled' )    ssnd(jps_co2 )%laction = .TRUE. 
    554 #endif 
     609      ssnd(jps_co2)%clname = 'O_CO2FLX' ;  IF( TRIM(sn_snd_co2%cldes) == 'coupled' )    ssnd(jps_co2 )%laction = .TRUE. 
    555610      ! 
    556611      ! ================================ ! 
     
    636691      isec = ( kt - nit000 ) * NINT( rdttra(1) )             ! date of exchanges 
    637692      DO jn = 1, jprcv                                       ! received fields sent by the atmosphere 
    638          IF( srcv(jn)%laction )   CALL cpl_prism_rcv( jn, isec, frcv(:,:,jn), nrcvinfo(jn) ) 
     693         IF( srcv(jn)%laction )   CALL cpl_prism_rcv( jn, isec, frcv(jn)%z3, nrcvinfo(jn) ) 
    639694      END DO 
    640695 
     
    642697      IF( srcv(jpr_otx1)%laction ) THEN                      !  ocean stress components  ! 
    643698         !                                                   ! ========================= ! 
    644          ! define frcv(:,:,jpr_otx1) and frcv(:,:,jpr_oty1): stress at U/V point along model grid 
     699         ! define frcv(jpr_otx1)%z3(:,:,1) and frcv(jpr_oty1)%z3(:,:,1): stress at U/V point along model grid 
    645700         ! => need to be done only when we receive the field 
    646701         IF(  nrcvinfo(jpr_otx1) == OASIS_Rcv ) THEN 
    647702            ! 
    648             IF( TRIM( cn_rcv_tau(2) ) == 'cartesian' ) THEN            ! 2 components on the sphere 
     703            IF( TRIM( sn_rcv_tau%clvref ) == 'cartesian' ) THEN            ! 2 components on the sphere 
    649704               !                                                       ! (cartesian to spherical -> 3 to 2 components) 
    650705               ! 
    651                CALL geo2oce( frcv(:,:,jpr_otx1), frcv(:,:,jpr_oty1), frcv(:,:,jpr_otz1),   & 
     706               CALL geo2oce( frcv(jpr_otx1)%z3(:,:,1), frcv(jpr_oty1)%z3(:,:,1), frcv(jpr_otz1)%z3(:,:,1),   & 
    652707                  &          srcv(jpr_otx1)%clgrid, ztx, zty ) 
    653                frcv(:,:,jpr_otx1) = ztx(:,:)   ! overwrite 1st comp. on the 1st grid 
    654                frcv(:,:,jpr_oty1) = zty(:,:)   ! overwrite 2nd comp. on the 1st grid 
     708               frcv(jpr_otx1)%z3(:,:,1) = ztx(:,:)   ! overwrite 1st comp. on the 1st grid 
     709               frcv(jpr_oty1)%z3(:,:,1) = zty(:,:)   ! overwrite 2nd comp. on the 1st grid 
    655710               ! 
    656711               IF( srcv(jpr_otx2)%laction ) THEN 
    657                   CALL geo2oce( frcv(:,:,jpr_otx2), frcv(:,:,jpr_oty2), frcv(:,:,jpr_otz2),   & 
     712                  CALL geo2oce( frcv(jpr_otx2)%z3(:,:,1), frcv(jpr_oty2)%z3(:,:,1), frcv(jpr_otz2)%z3(:,:,1),   & 
    658713                     &          srcv(jpr_otx2)%clgrid, ztx, zty ) 
    659                   frcv(:,:,jpr_otx2) = ztx(:,:)   ! overwrite 1st comp. on the 2nd grid 
    660                   frcv(:,:,jpr_oty2) = zty(:,:)   ! overwrite 2nd comp. on the 2nd grid 
     714                  frcv(jpr_otx2)%z3(:,:,1) = ztx(:,:)   ! overwrite 1st comp. on the 2nd grid 
     715                  frcv(jpr_oty2)%z3(:,:,1) = zty(:,:)   ! overwrite 2nd comp. on the 2nd grid 
    661716               ENDIF 
    662717               ! 
    663718            ENDIF 
    664719            ! 
    665             IF( TRIM( cn_rcv_tau(3) ) == 'eastward-northward' ) THEN   ! 2 components oriented along the local grid 
     720            IF( TRIM( sn_rcv_tau%clvor ) == 'eastward-northward' ) THEN   ! 2 components oriented along the local grid 
    666721               !                                                       ! (geographical to local grid -> rotate the components) 
    667                CALL rot_rep( frcv(:,:,jpr_otx1), frcv(:,:,jpr_oty1), srcv(jpr_otx1)%clgrid, 'en->i', ztx )    
    668                frcv(:,:,jpr_otx1) = ztx(:,:)      ! overwrite 1st component on the 1st grid 
     722               CALL rot_rep( frcv(jpr_otx1)%z3(:,:,1), frcv(jpr_oty1)%z3(:,:,1), srcv(jpr_otx1)%clgrid, 'en->i', ztx )    
     723               frcv(jpr_otx1)%z3(:,:,1) = ztx(:,:)      ! overwrite 1st component on the 1st grid 
    669724               IF( srcv(jpr_otx2)%laction ) THEN 
    670                   CALL rot_rep( frcv(:,:,jpr_otx2), frcv(:,:,jpr_oty2), srcv(jpr_otx2)%clgrid, 'en->j', zty )    
    671                ELSE 
    672                   CALL rot_rep( frcv(:,:,jpr_otx1), frcv(:,:,jpr_oty1), srcv(jpr_otx1)%clgrid, 'en->j', zty )   
     725                  CALL rot_rep( frcv(jpr_otx2)%z3(:,:,1), frcv(jpr_oty2)%z3(:,:,1), srcv(jpr_otx2)%clgrid, 'en->j', zty )    
     726               ELSE   
     727                  CALL rot_rep( frcv(jpr_otx1)%z3(:,:,1), frcv(jpr_oty1)%z3(:,:,1), srcv(jpr_otx1)%clgrid, 'en->j', zty )   
    673728               ENDIF 
    674                frcv(:,:,jpr_oty1) = zty(:,:)      ! overwrite 2nd component on the 2nd grid 
     729               frcv(jpr_oty1)%z3(:,:,1) = zty(:,:)      ! overwrite 2nd component on the 2nd grid 
    675730            ENDIF 
    676731            !                               
     
    678733               DO jj = 2, jpjm1                                          ! T ==> (U,V) 
    679734                  DO ji = fs_2, fs_jpim1   ! vector opt. 
    680                      frcv(ji,jj,jpr_otx1) = 0.5 * ( frcv(ji+1,jj  ,jpr_otx1) + frcv(ji,jj,jpr_otx1) ) 
    681                      frcv(ji,jj,jpr_oty1) = 0.5 * ( frcv(ji  ,jj+1,jpr_oty1) + frcv(ji,jj,jpr_oty1) ) 
     735                     frcv(jpr_otx1)%z3(ji,jj,1) = 0.5 * ( frcv(jpr_otx1)%z3(ji+1,jj  ,1) + frcv(jpr_otx1)%z3(ji,jj,1) ) 
     736                     frcv(jpr_oty1)%z3(ji,jj,1) = 0.5 * ( frcv(jpr_oty1)%z3(ji  ,jj+1,1) + frcv(jpr_oty1)%z3(ji,jj,1) ) 
    682737                  END DO 
    683738               END DO 
    684                CALL lbc_lnk( frcv(:,:,jpr_otx1), 'U',  -1. )   ;   CALL lbc_lnk( frcv(:,:,jpr_oty1), 'V',  -1. ) 
     739               CALL lbc_lnk( frcv(jpr_otx1)%z3(:,:,1), 'U',  -1. )   ;   CALL lbc_lnk( frcv(jpr_oty1)%z3(:,:,1), 'V',  -1. ) 
    685740            ENDIF 
    686741            llnewtx = .TRUE. 
     
    691746      ELSE                                                   !   No dynamical coupling   ! 
    692747         !                                                   ! ========================= ! 
    693          frcv(:,:,jpr_otx1) = 0.e0                               ! here simply set to zero  
    694          frcv(:,:,jpr_oty1) = 0.e0                               ! an external read in a file can be added instead 
     748         frcv(jpr_otx1)%z3(:,:,1) = 0.e0                               ! here simply set to zero  
     749         frcv(jpr_oty1)%z3(:,:,1) = 0.e0                               ! an external read in a file can be added instead 
    695750         llnewtx = .TRUE. 
    696751         ! 
     
    708763!CDIR NOVERRCHK 
    709764               DO ji = fs_2, fs_jpim1   ! vect. opt. 
    710                   zzx = frcv(ji-1,jj  ,jpr_otx1) + frcv(ji,jj,jpr_otx1)  
    711                   zzy = frcv(ji  ,jj-1,jpr_oty1) + frcv(ji,jj,jpr_oty1)  
    712                   frcv(ji,jj,jpr_taum) = 0.5 * SQRT( zzx * zzx + zzy * zzy ) 
     765                  zzx = frcv(jpr_otx1)%z3(ji-1,jj  ,1) + frcv(jpr_otx1)%z3(ji,jj,1) 
     766                  zzy = frcv(jpr_oty1)%z3(ji  ,jj-1,1) + frcv(jpr_oty1)%z3(ji,jj,1) 
     767                  frcv(jpr_taum)%z3(ji,jj,1) = 0.5 * SQRT( zzx * zzx + zzy * zzy ) 
    713768               END DO 
    714769            END DO 
    715             CALL lbc_lnk( frcv(:,:,jpr_taum), 'T', 1. ) 
     770            CALL lbc_lnk( frcv(jpr_taum)%z3(:,:,1), 'T', 1. ) 
    716771            llnewtau = .TRUE. 
    717772         ELSE 
     
    722777         ! Stress module can be negative when received (interpolation problem) 
    723778         IF( llnewtau ) THEN  
    724             DO jj = 1, jpj 
    725                DO ji = 1, jpi  
    726                   frcv(ji,jj,jpr_taum) = MAX( 0.0e0, frcv(ji,jj,jpr_taum) ) 
    727                END DO 
    728             END DO 
     779            frcv(jpr_taum)%z3(:,:,1) = MAX( 0.0e0, frcv(jpr_taum)%z3(:,:,1) ) 
    729780         ENDIF 
    730781      ENDIF 
     
    742793!CDIR NOVERRCHK 
    743794               DO ji = 1, jpi  
    744                   frcv(ji,jj,jpr_w10m) = SQRT( frcv(ji,jj,jpr_taum) * zcoef ) 
     795                  wndm(ji,jj) = SQRT( frcv(jpr_taum)%z3(ji,jj,1) * zcoef ) 
    745796               END DO 
    746797            END DO 
    747798         ENDIF 
    748       ENDIF 
    749  
    750       ! u(v)tau and taum will be modified by ice model (wndm will be changed by PISCES) 
     799      ELSE 
     800         IF ( nrcvinfo(jpr_w10m) == OASIS_Rcv ) wndm(:,:) = frcv(jpr_w10m)%z3(:,:,1) 
     801      ENDIF 
     802 
     803      ! u(v)tau and taum will be modified by ice model 
    751804      ! -> need to be reset before each call of the ice/fsbc       
    752805      IF( MOD( kt-1, k_fsbc ) == 0 ) THEN 
    753806         ! 
    754          utau(:,:) = frcv(:,:,jpr_otx1)                    
    755          vtau(:,:) = frcv(:,:,jpr_oty1) 
    756          taum(:,:) = frcv(:,:,jpr_taum) 
    757          wndm(:,:) = frcv(:,:,jpr_w10m) 
     807         utau(:,:) = frcv(jpr_otx1)%z3(:,:,1) 
     808         vtau(:,:) = frcv(jpr_oty1)%z3(:,:,1) 
     809         taum(:,:) = frcv(jpr_taum)%z3(:,:,1) 
    758810         CALL iom_put( "taum_oce", taum )   ! output wind stress module 
    759811         !   
    760812      ENDIF 
     813 
     814#if defined key_cpl_carbon_cycle 
     815      !                                                              ! atmosph. CO2 (ppm) 
     816      IF( srcv(jpr_co2)%laction )   atm_co2(:,:) = frcv(jpr_co2)%z3(:,:,1) 
     817#endif 
     818 
    761819      !                                                      ! ========================= ! 
    762820      IF( k_ice <= 1 ) THEN                                  !  heat & freshwater fluxes ! (Ocean only case) 
     
    764822         ! 
    765823         !                                                       ! non solar heat flux over the ocean (qns) 
    766          IF( srcv(jpr_qnsoce)%laction )   qns(:,:) = frcv(:,:,jpr_qnsoce) 
    767          IF( srcv(jpr_qnsmix)%laction )   qns(:,:) = frcv(:,:,jpr_qnsmix)   
     824         IF( srcv(jpr_qnsoce)%laction )   qns(:,:) = frcv(jpr_qnsoce)%z3(:,:,1) 
     825         IF( srcv(jpr_qnsmix)%laction )   qns(:,:) = frcv(jpr_qnsmix)%z3(:,:,1) 
    768826         ! add the latent heat of solid precip. melting 
    769          IF( srcv(jpr_snow  )%laction )   qns(:,:) = qns(:,:) - frcv(:,:,jpr_snow) * lfus               
     827         IF( srcv(jpr_snow  )%laction )   qns(:,:) = qns(:,:) - frcv(jpr_snow)%z3(:,:,1) * lfus               
    770828 
    771829         !                                                       ! solar flux over the ocean          (qsr) 
    772          IF( srcv(jpr_qsroce)%laction )   qsr(:,:) = frcv(:,:,jpr_qsroce)  
    773          IF( srcv(jpr_qsrmix)%laction )   qsr(:,:) = frcv(:,:,jpr_qsrmix) 
     830         IF( srcv(jpr_qsroce)%laction )   qsr(:,:) = frcv(jpr_qsroce)%z3(:,:,1) 
     831         IF( srcv(jpr_qsrmix)%laction )   qsr(:,:) = frcv(jpr_qsrmix)%z3(:,:,1) 
    774832         IF( ln_dm2dc )   qsr(:,:) = sbc_dcy( qsr )                           ! modify qsr to include the diurnal cycle 
    775833         ! 
    776834         !                                                       ! total freshwater fluxes over the ocean (emp, emps) 
    777          SELECT CASE( TRIM( cn_rcv_emp ) )                                    ! evaporation - precipitation 
     835         SELECT CASE( TRIM( sn_rcv_emp%cldes ) )                                    ! evaporation - precipitation 
    778836         CASE( 'conservative' ) 
    779             emp(:,:) = frcv(:,:,jpr_tevp) - ( frcv(:,:,jpr_rain) + frcv(:,:,jpr_snow) ) 
     837            emp(:,:) = frcv(jpr_tevp)%z3(:,:,1) - ( frcv(jpr_rain)%z3(:,:,1) + frcv(jpr_snow)%z3(:,:,1) ) 
    780838         CASE( 'oce only', 'oce and ice' ) 
    781             emp(:,:) = frcv(:,:,jpr_oemp) 
     839            emp(:,:) = frcv(jpr_oemp)%z3(:,:,1) 
    782840         CASE default 
    783             CALL ctl_stop( 'sbc_cpl_rcv: wrong definition of cn_rcv_emp' ) 
     841            CALL ctl_stop( 'sbc_cpl_rcv: wrong definition of sn_rcv_emp%cldes' ) 
    784842         END SELECT 
    785843         ! 
    786844         !                                                        ! runoffs and calving (added in emp) 
    787          IF( srcv(jpr_rnf)%laction )   emp(:,:) = emp(:,:) - frcv(:,:,jpr_rnf)         
    788          IF( srcv(jpr_cal)%laction )   emp(:,:) = emp(:,:) - frcv(:,:,jpr_cal) 
     845         IF( srcv(jpr_rnf)%laction )   emp(:,:) = emp(:,:) - frcv(jpr_rnf)%z3(:,:,1) 
     846         IF( srcv(jpr_cal)%laction )   emp(:,:) = emp(:,:) - frcv(jpr_cal)%z3(:,:,1) 
    789847         ! 
    790848!!gm :  this seems to be internal cooking, not sure to need that in a generic interface  
    791849!!gm                                       at least should be optional... 
    792 !!         IF( TRIM( cn_rcv_rnf ) == 'coupled' ) THEN     ! add to the total freshwater budget 
     850!!         IF( TRIM( sn_rcv_rnf%cldes ) == 'coupled' ) THEN     ! add to the total freshwater budget 
    793851!!            ! remove negative runoff 
    794 !!            zcumulpos = SUM( MAX( frcv(:,:,jpr_rnf), 0.e0 ) * e1t(:,:) * e2t(:,:) * tmask_i(:,:) )  
    795 !!            zcumulneg = SUM( MIN( frcv(:,:,jpr_rnf), 0.e0 ) * e1t(:,:) * e2t(:,:) * tmask_i(:,:) ) 
     852!!            zcumulpos = SUM( MAX( frcv(jpr_rnf)%z3(:,:,1), 0.e0 ) * e1t(:,:) * e2t(:,:) * tmask_i(:,:) )  
     853!!            zcumulneg = SUM( MIN( frcv(jpr_rnf)%z3(:,:,1), 0.e0 ) * e1t(:,:) * e2t(:,:) * tmask_i(:,:) ) 
    796854!!            IF( lk_mpp )   CALL mpp_sum( zcumulpos )   ! sum over the global domain 
    797855!!            IF( lk_mpp )   CALL mpp_sum( zcumulneg )  
    798856!!            IF( zcumulpos /= 0. ) THEN                 ! distribute negative runoff on positive runoff grid points 
    799857!!               zcumulneg = 1.e0 + zcumulneg / zcumulpos 
    800 !!               frcv(:,:,jpr_rnf) = MAX( frcv(:,:,jpr_rnf), 0.e0 ) * zcumulneg 
     858!!               frcv(jpr_rnf)%z3(:,:,1) = MAX( frcv(jpr_rnf)%z3(:,:,1), 0.e0 ) * zcumulneg 
    801859!!            ENDIF      
    802860!!            ! add runoff to e-p  
    803 !!            emp(:,:) = emp(:,:) - frcv(:,:,jpr_rnf) 
     861!!            emp(:,:) = emp(:,:) - frcv(jpr_rnf)%z3(:,:,1) 
    804862!!         ENDIF 
    805863!!gm  end of internal cooking 
     
    807865         emps(:,:) = emp(:,:)                                        ! concentration/dilution = emp 
    808866   
    809          !                                                           ! 10 m wind speed 
    810          IF( srcv(jpr_w10m)%laction )   wndm(:,:) = frcv(:,:,jpr_w10m) 
    811          ! 
    812 #if defined  key_cpl_carbon_cycle 
    813          !                                                              ! atmosph. CO2 (ppm) 
    814          IF( srcv(jpr_co2)%laction )   atm_co2(:,:) = frcv(:,:,jpr_co2) 
    815 #endif 
    816  
    817867      ENDIF 
    818868      ! 
     
    880930            !                                                   ! ======================= ! 
    881931            !   
    882             IF( TRIM( cn_rcv_tau(2) ) == 'cartesian' ) THEN            ! 2 components on the sphere 
     932            IF( TRIM( sn_rcv_tau%clvref ) == 'cartesian' ) THEN            ! 2 components on the sphere 
    883933               !                                                       ! (cartesian to spherical -> 3 to 2 components) 
    884                CALL geo2oce( frcv(:,:,jpr_itx1), frcv(:,:,jpr_ity1), frcv(:,:,jpr_itz1),   & 
     934               CALL geo2oce(  frcv(jpr_itx1)%z3(:,:,1), frcv(jpr_ity1)%z3(:,:,1), frcv(jpr_itz1)%z3(:,:,1),   & 
    885935                  &          srcv(jpr_itx1)%clgrid, ztx, zty ) 
    886                frcv(:,:,jpr_itx1) = ztx(:,:)   ! overwrite 1st comp. on the 1st grid 
    887                frcv(:,:,jpr_itx1) = zty(:,:)   ! overwrite 2nd comp. on the 1st grid 
     936               frcv(jpr_itx1)%z3(:,:,1) = ztx(:,:)   ! overwrite 1st comp. on the 1st grid 
     937               frcv(jpr_ity1)%z3(:,:,1) = zty(:,:)   ! overwrite 2nd comp. on the 1st grid 
    888938               ! 
    889939               IF( srcv(jpr_itx2)%laction ) THEN 
    890                   CALL geo2oce( frcv(:,:,jpr_itx2), frcv(:,:,jpr_ity2), frcv(:,:,jpr_itz2),   & 
     940                  CALL geo2oce( frcv(jpr_itx2)%z3(:,:,1), frcv(jpr_ity2)%z3(:,:,1), frcv(jpr_itz2)%z3(:,:,1),   & 
    891941                     &          srcv(jpr_itx2)%clgrid, ztx, zty ) 
    892                   frcv(:,:,jpr_itx2) = ztx(:,:)   ! overwrite 1st comp. on the 2nd grid 
    893                   frcv(:,:,jpr_ity2) = zty(:,:)   ! overwrite 2nd comp. on the 2nd grid 
     942                  frcv(jpr_itx2)%z3(:,:,1) = ztx(:,:)   ! overwrite 1st comp. on the 2nd grid 
     943                  frcv(jpr_ity2)%z3(:,:,1) = zty(:,:)   ! overwrite 2nd comp. on the 2nd grid 
    894944               ENDIF 
    895945               ! 
    896946            ENDIF 
    897947            ! 
    898             IF( TRIM( cn_rcv_tau(3) ) == 'eastward-northward' ) THEN   ! 2 components oriented along the local grid 
     948            IF( TRIM( sn_rcv_tau%clvor ) == 'eastward-northward' ) THEN   ! 2 components oriented along the local grid 
    899949               !                                                       ! (geographical to local grid -> rotate the components) 
    900                CALL rot_rep( frcv(:,:,jpr_itx1), frcv(:,:,jpr_ity1), srcv(jpr_itx1)%clgrid, 'en->i', ztx )    
    901                frcv(:,:,jpr_itx1) = ztx(:,:)      ! overwrite 1st component on the 1st grid 
     950               CALL rot_rep( frcv(jpr_itx1)%z3(:,:,1), frcv(jpr_ity1)%z3(:,:,1), srcv(jpr_itx1)%clgrid, 'en->i', ztx )    
     951               frcv(jpr_itx1)%z3(:,:,1) = ztx(:,:)      ! overwrite 1st component on the 1st grid 
    902952               IF( srcv(jpr_itx2)%laction ) THEN 
    903                   CALL rot_rep( frcv(:,:,jpr_itx2), frcv(:,:,jpr_ity2), srcv(jpr_itx2)%clgrid, 'en->j', zty )    
     953                  CALL rot_rep( frcv(jpr_itx2)%z3(:,:,1), frcv(jpr_ity2)%z3(:,:,1), srcv(jpr_itx2)%clgrid, 'en->j', zty )    
    904954               ELSE 
    905                   CALL rot_rep( frcv(:,:,jpr_itx1), frcv(:,:,jpr_ity1), srcv(jpr_itx1)%clgrid, 'en->j', zty )   
     955                  CALL rot_rep( frcv(jpr_itx1)%z3(:,:,1), frcv(jpr_ity1)%z3(:,:,1), srcv(jpr_itx1)%clgrid, 'en->j', zty )   
    906956               ENDIF 
    907                frcv(:,:,jpr_ity1) = zty(:,:)      ! overwrite 2nd component on the 1st grid 
     957               frcv(jpr_ity1)%z3(:,:,1) = zty(:,:)      ! overwrite 2nd component on the 1st grid 
    908958            ENDIF 
    909959            !                                                   ! ======================= ! 
    910960         ELSE                                                   !     use ocean stress    ! 
    911961            !                                                   ! ======================= ! 
    912             frcv(:,:,jpr_itx1) = frcv(:,:,jpr_otx1) 
    913             frcv(:,:,jpr_ity1) = frcv(:,:,jpr_oty1) 
     962            frcv(jpr_itx1)%z3(:,:,1) = frcv(jpr_otx1)%z3(:,:,1) 
     963            frcv(jpr_ity1)%z3(:,:,1) = frcv(jpr_oty1)%z3(:,:,1) 
    914964            ! 
    915965         ENDIF 
     
    934984               DO jj = 2, jpjm1                                   ! (U,V) ==> I 
    935985                  DO ji = 2, jpim1   ! NO vector opt. 
    936                      p_taui(ji,jj) = 0.5 * ( frcv(ji-1,jj  ,jpr_itx1) + frcv(ji-1,jj-1,jpr_itx1) ) 
    937                      p_tauj(ji,jj) = 0.5 * ( frcv(ji  ,jj-1,jpr_ity1) + frcv(ji-1,jj-1,jpr_ity1) ) 
     986                     p_taui(ji,jj) = 0.5 * ( frcv(jpr_itx1)%z3(ji-1,jj  ,1) + frcv(jpr_itx1)%z3(ji-1,jj-1,1) ) 
     987                     p_tauj(ji,jj) = 0.5 * ( frcv(jpr_ity1)%z3(ji  ,jj-1,1) + frcv(jpr_ity1)%z3(ji-1,jj-1,1) ) 
    938988                  END DO 
    939989               END DO 
     
    941991               DO jj = 2, jpjm1                                   ! F ==> I 
    942992                  DO ji = 2, jpim1   ! NO vector opt. 
    943                      p_taui(ji,jj) = frcv(ji-1,jj-1,jpr_itx1)  
    944                      p_tauj(ji,jj) = frcv(ji-1,jj-1,jpr_ity1)   
     993                     p_taui(ji,jj) = frcv(jpr_itx1)%z3(ji-1,jj-1,1) 
     994                     p_tauj(ji,jj) = frcv(jpr_ity1)%z3(ji-1,jj-1,1) 
    945995                  END DO 
    946996               END DO 
     
    948998               DO jj = 2, jpjm1                                   ! T ==> I 
    949999                  DO ji = 2, jpim1   ! NO vector opt. 
    950                      p_taui(ji,jj) = 0.25 * ( frcv(ji,jj  ,jpr_itx1) + frcv(ji-1,jj  ,jpr_itx1)   & 
    951                         &                   + frcv(ji,jj-1,jpr_itx1) + frcv(ji-1,jj-1,jpr_itx1) )  
    952                      p_tauj(ji,jj) = 0.25 * ( frcv(ji,jj  ,jpr_ity1) + frcv(ji-1,jj  ,jpr_ity1)   & 
    953                         &                   + frcv(ji,jj-1,jpr_ity1) + frcv(ji-1,jj-1,jpr_ity1) ) 
     1000                     p_taui(ji,jj) = 0.25 * ( frcv(jpr_itx1)%z3(ji,jj  ,1) + frcv(jpr_itx1)%z3(ji-1,jj  ,1)   & 
     1001                        &                   + frcv(jpr_itx1)%z3(ji,jj-1,1) + frcv(jpr_itx1)%z3(ji-1,jj-1,1) )  
     1002                     p_tauj(ji,jj) = 0.25 * ( frcv(jpr_ity1)%z3(ji,jj  ,1) + frcv(jpr_ity1)%z3(ji-1,jj  ,1)   & 
     1003                        &                   + frcv(jpr_oty1)%z3(ji,jj-1,1) + frcv(jpr_ity1)%z3(ji-1,jj-1,1) ) 
    9541004                  END DO 
    9551005               END DO 
    9561006            CASE( 'I' ) 
    957                p_taui(:,:) = frcv(:,:,jpr_itx1)                   ! I ==> I 
    958                p_tauj(:,:) = frcv(:,:,jpr_ity1) 
     1007               p_taui(:,:) = frcv(jpr_itx1)%z3(:,:,1)                   ! I ==> I 
     1008               p_tauj(:,:) = frcv(jpr_ity1)%z3(:,:,1) 
    9591009            END SELECT 
    9601010            IF( srcv(jpr_itx1)%clgrid /= 'I' ) THEN  
     
    9671017               DO jj = 2, jpjm1                                   ! (U,V) ==> F 
    9681018                  DO ji = fs_2, fs_jpim1   ! vector opt. 
    969                      p_taui(ji,jj) = 0.5 * ( frcv(ji,jj,jpr_itx1) + frcv(ji  ,jj+1,jpr_itx1) ) 
    970                      p_tauj(ji,jj) = 0.5 * ( frcv(ji,jj,jpr_ity1) + frcv(ji+1,jj  ,jpr_ity1) ) 
     1019                     p_taui(ji,jj) = 0.5 * ( frcv(jpr_itx1)%z3(ji,jj,1) + frcv(jpr_itx1)%z3(ji  ,jj+1,1) ) 
     1020                     p_tauj(ji,jj) = 0.5 * ( frcv(jpr_ity1)%z3(ji,jj,1) + frcv(jpr_ity1)%z3(ji+1,jj  ,1) ) 
    9711021                  END DO 
    9721022               END DO 
     
    9741024               DO jj = 2, jpjm1                                   ! I ==> F 
    9751025                  DO ji = 2, jpim1   ! NO vector opt. 
    976                      p_taui(ji,jj) = frcv(ji+1,jj+1,jpr_itx1)  
    977                      p_tauj(ji,jj) = frcv(ji+1,jj+1,jpr_ity1)   
     1026                     p_taui(ji,jj) = frcv(jpr_itx1)%z3(ji+1,jj+1,1) 
     1027                     p_tauj(ji,jj) = frcv(jpr_ity1)%z3(ji+1,jj+1,1) 
    9781028                  END DO 
    9791029               END DO 
     
    9811031               DO jj = 2, jpjm1                                   ! T ==> F 
    9821032                  DO ji = 2, jpim1   ! NO vector opt. 
    983                      p_taui(ji,jj) = 0.25 * ( frcv(ji,jj  ,jpr_itx1) + frcv(ji+1,jj  ,jpr_itx1)   & 
    984                         &                   + frcv(ji,jj+1,jpr_itx1) + frcv(ji+1,jj+1,jpr_itx1) )  
    985                      p_tauj(ji,jj) = 0.25 * ( frcv(ji,jj  ,jpr_ity1) + frcv(ji+1,jj  ,jpr_ity1)   & 
    986                         &                   + frcv(ji,jj+1,jpr_ity1) + frcv(ji+1,jj+1,jpr_ity1) ) 
     1033                     p_taui(ji,jj) = 0.25 * ( frcv(jpr_itx1)%z3(ji,jj  ,1) + frcv(jpr_itx1)%z3(ji+1,jj  ,1)   & 
     1034                        &                   + frcv(jpr_itx1)%z3(ji,jj+1,1) + frcv(jpr_itx1)%z3(ji+1,jj+1,1) )  
     1035                     p_tauj(ji,jj) = 0.25 * ( frcv(jpr_ity1)%z3(ji,jj  ,1) + frcv(jpr_ity1)%z3(ji+1,jj  ,1)   & 
     1036                        &                   + frcv(jpr_ity1)%z3(ji,jj+1,1) + frcv(jpr_ity1)%z3(ji+1,jj+1,1) ) 
    9871037                  END DO 
    9881038               END DO 
    9891039            CASE( 'F' ) 
    990                p_taui(:,:) = frcv(:,:,jpr_itx1)                   ! F ==> F 
    991                p_tauj(:,:) = frcv(:,:,jpr_ity1) 
     1040               p_taui(:,:) = frcv(jpr_itx1)%z3(:,:,1)                   ! F ==> F 
     1041               p_tauj(:,:) = frcv(jpr_ity1)%z3(:,:,1) 
    9921042            END SELECT 
    9931043            IF( srcv(jpr_itx1)%clgrid /= 'F' ) THEN  
     
    9981048            SELECT CASE ( srcv(jpr_itx1)%clgrid ) 
    9991049            CASE( 'U' ) 
    1000                p_taui(:,:) = frcv(:,:,jpr_itx1)                   ! (U,V) ==> (U,V) 
    1001                p_tauj(:,:) = frcv(:,:,jpr_ity1) 
     1050               p_taui(:,:) = frcv(jpr_itx1)%z3(:,:,1)                   ! (U,V) ==> (U,V) 
     1051               p_tauj(:,:) = frcv(jpr_ity1)%z3(:,:,1) 
    10021052            CASE( 'F' ) 
    10031053               DO jj = 2, jpjm1                                   ! F ==> (U,V) 
    10041054                  DO ji = fs_2, fs_jpim1   ! vector opt. 
    1005                      p_taui(ji,jj) = 0.5 * ( frcv(ji,jj,jpr_itx1) + frcv(ji  ,jj-1,jpr_itx1) ) 
    1006                      p_tauj(ji,jj) = 0.5 * ( frcv(ji,jj,jpr_ity1) + frcv(ji-1,jj  ,jpr_ity1) ) 
     1055                     p_taui(ji,jj) = 0.5 * ( frcv(jpr_itx1)%z3(ji,jj,1) + frcv(jpr_itx1)%z3(ji  ,jj-1,1) ) 
     1056                     p_tauj(ji,jj) = 0.5 * ( frcv(jpr_ity1)%z3(jj,jj,1) + frcv(jpr_ity1)%z3(ji-1,jj  ,1) ) 
    10071057                  END DO 
    10081058               END DO 
     
    10101060               DO jj = 2, jpjm1                                   ! T ==> (U,V) 
    10111061                  DO ji = fs_2, fs_jpim1   ! vector opt. 
    1012                      p_taui(ji,jj) = 0.5 * ( frcv(ji+1,jj  ,jpr_itx1) + frcv(ji,jj,jpr_itx1) ) 
    1013                      p_tauj(ji,jj) = 0.5 * ( frcv(ji  ,jj+1,jpr_ity1) + frcv(ji,jj,jpr_ity1) ) 
     1062                     p_taui(ji,jj) = 0.5 * ( frcv(jpr_itx1)%z3(ji+1,jj  ,1) + frcv(jpr_itx1)%z3(ji,jj,1) ) 
     1063                     p_tauj(ji,jj) = 0.5 * ( frcv(jpr_ity1)%z3(ji  ,jj+1,1) + frcv(jpr_ity1)%z3(ji,jj,1) ) 
    10141064                  END DO 
    10151065               END DO 
     
    10171067               DO jj = 2, jpjm1                                   ! I ==> (U,V) 
    10181068                  DO ji = 2, jpim1   ! NO vector opt. 
    1019                      p_taui(ji,jj) = 0.5 * ( frcv(ji+1,jj+1,jpr_itx1) + frcv(ji+1,jj  ,jpr_itx1) ) 
    1020                      p_tauj(ji,jj) = 0.5 * ( frcv(ji+1,jj+1,jpr_ity1) + frcv(ji  ,jj+1,jpr_ity1) ) 
     1069                     p_taui(ji,jj) = 0.5 * ( frcv(jpr_itx1)%z3(ji+1,jj+1,1) + frcv(jpr_itx1)%z3(ji+1,jj  ,1) ) 
     1070                     p_tauj(ji,jj) = 0.5 * ( frcv(jpr_ity1)%z3(ji+1,jj+1,1) + frcv(jpr_ity1)%z3(ji  ,jj+1,1) ) 
    10211071                  END DO 
    10221072               END DO 
     
    10271077         END SELECT 
    10281078 
    1029          !!gm Should be useless as sbc_cpl_ice_tau only called at coupled frequency 
    1030          ! The receive stress are transformed such that in all case frcv(:,:,jpr_itx1), frcv(:,:,jpr_ity1) 
    1031          ! become the i-component and j-component of the stress at the right grid point  
    1032          !!gm  frcv(:,:,jpr_itx1) = p_taui(:,:) 
    1033          !!gm  frcv(:,:,jpr_ity1) = p_tauj(:,:) 
    1034          !!gm 
    10351079      ENDIF 
    10361080      !    
     
    10401084    
    10411085 
    1042    SUBROUTINE sbc_cpl_ice_flx( p_frld  ,                                  & 
    1043       &                        pqns_tot, pqns_ice, pqsr_tot , pqsr_ice,   & 
    1044       &                        pemp_tot, pemp_ice, pdqns_ice, psprecip,   & 
    1045       &                        palbi   , psst    , pist                 ) 
     1086   SUBROUTINE sbc_cpl_ice_flx( p_frld  , palbi   , psst    , pist    ) 
    10461087      !!---------------------------------------------------------------------- 
    1047       !!             ***  ROUTINE sbc_cpl_ice_flx_rcv  *** 
     1088      !!             ***  ROUTINE sbc_cpl_ice_flx  *** 
    10481089      !! 
    10491090      !! ** Purpose :   provide the heat and freshwater fluxes of the  
     
    10661107      !!             the atmosphere 
    10671108      !! 
    1068       !!             N.B. - fields over sea-ice are passed in argument so that 
    1069       !!                 the module can be compile without sea-ice. 
    10701109      !!                  - the fluxes have been separated from the stress as 
    10711110      !!                 (a) they are updated at each ice time step compare to 
     
    10781117      !! 
    10791118      !! ** Action  :   update at each nf_ice time step: 
    1080       !!                   pqns_tot, pqsr_tot  non-solar and solar total heat fluxes 
    1081       !!                   pqns_ice, pqsr_ice  non-solar and solar heat fluxes over the ice 
    1082       !!                   pemp_tot            total evaporation - precipitation(liquid and solid) (-runoff)(-calving) 
    1083       !!                   pemp_ice            ice sublimation - solid precipitation over the ice 
    1084       !!                   pdqns_ice           d(non-solar heat flux)/d(Temperature) over the ice 
     1119      !!                   qns_tot, qsr_tot  non-solar and solar total heat fluxes 
     1120      !!                   qns_ice, qsr_ice  non-solar and solar heat fluxes over the ice 
     1121      !!                   emp_tot            total evaporation - precipitation(liquid and solid) (-runoff)(-calving) 
     1122      !!                   emp_ice            ice sublimation - solid precipitation over the ice 
     1123      !!                   dqns_ice           d(non-solar heat flux)/d(Temperature) over the ice 
    10851124      !!                   sprecip             solid precipitation over the ocean   
    10861125      !!---------------------------------------------------------------------- 
    10871126      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released 
    1088       USE wrk_nemo, ONLY:   zcptn  => wrk_2d_1   ! rcp * tn(:,:,1) 
    1089       USE wrk_nemo, ONLY:   ztmp   => wrk_2d_2   ! temporary array 
    1090       USE wrk_nemo, ONLY:   zsnow  => wrk_2d_3   ! snow precipitation  
    1091       USE wrk_nemo, ONLY:   zicefr => wrk_3d_4   ! ice fraction  
    1092       !! 
    1093       REAL(wp), INTENT(in   ), DIMENSION(:,:,:) ::   p_frld     ! lead fraction                [0 to 1] 
    1094       REAL(wp), INTENT(  out), DIMENSION(:,:  ) ::   pqns_tot   ! total non solar heat flux    [W/m2] 
    1095       REAL(wp), INTENT(  out), DIMENSION(:,:,:) ::   pqns_ice   ! ice   non solar heat flux    [W/m2] 
    1096       REAL(wp), INTENT(  out), DIMENSION(:,:  ) ::   pqsr_tot   ! total     solar heat flux    [W/m2] 
    1097       REAL(wp), INTENT(  out), DIMENSION(:,:,:) ::   pqsr_ice   ! ice       solar heat flux    [W/m2] 
    1098       REAL(wp), INTENT(  out), DIMENSION(:,:  ) ::   pemp_tot   ! total     freshwater budget        [Kg/m2/s] 
    1099       REAL(wp), INTENT(  out), DIMENSION(:,:  ) ::   pemp_ice   ! solid freshwater budget over ice   [Kg/m2/s] 
    1100       REAL(wp), INTENT(  out), DIMENSION(:,:  ) ::   psprecip   ! Net solid precipitation (=emp_ice) [Kg/m2/s] 
    1101       REAL(wp), INTENT(  out), DIMENSION(:,:,:) ::   pdqns_ice  ! d(Q non solar)/d(Temperature) over ice 
     1127      USE wrk_nemo, ONLY:   zcptn  => wrk_2d_2   ! rcp * tn(:,:,1) 
     1128      USE wrk_nemo, ONLY:   ztmp   => wrk_2d_3   ! temporary array 
     1129      USE wrk_nemo, ONLY:   zicefr => wrk_2d_4   ! ice fraction  
     1130      !! 
     1131      REAL(wp), INTENT(in   ), DIMENSION(:,:)   ::   p_frld     ! lead fraction                [0 to 1] 
    11021132      ! optional arguments, used only in 'mixed oce-ice' case 
    11031133      REAL(wp), INTENT(in   ), DIMENSION(:,:,:), OPTIONAL ::   palbi   ! ice albedo  
    11041134      REAL(wp), INTENT(in   ), DIMENSION(:,:  ), OPTIONAL ::   psst    ! sea surface temperature     [Celcius] 
    11051135      REAL(wp), INTENT(in   ), DIMENSION(:,:,:), OPTIONAL ::   pist    ! ice surface temperature     [Kelvin] 
    1106       !! 
    1107       INTEGER ::   ji, jj           ! dummy loop indices 
    1108       INTEGER ::   isec, info       ! temporary integer 
    1109       REAL(wp)::   zcoef, ztsurf    ! temporary scalar 
     1136      ! 
     1137      INTEGER ::   jl   ! dummy loop index 
    11101138      !!---------------------------------------------------------------------- 
    11111139 
    1112       IF( wrk_in_use(2, 1,2,3) .OR. wrk_in_use(3, 4) ) THEN 
     1140      IF( wrk_in_use(2, 2,3,4) ) THEN 
    11131141         CALL ctl_stop('sbc_cpl_ice_flx: requested workspace arrays unavailable')   ;   RETURN 
    11141142      ENDIF 
    11151143 
    1116       zicefr(:,:,1) = 1.- p_frld(:,:,1) 
    1117       IF( lk_diaar5 )   zcptn(:,:) = rcp * tn(:,:,1) 
     1144      zicefr(:,:) = 1.- p_frld(:,:) 
     1145      IF( lk_diaar5 )   zcptn(:,:) = rcp * tsn(:,:,1,1) 
    11181146      ! 
    11191147      !                                                      ! ========================= ! 
     
    11241152      !                                                           ! solid precipitation  - sublimation       (emp_ice) 
    11251153      !                                                           ! solid Precipitation                      (sprecip) 
    1126       SELECT CASE( TRIM( cn_rcv_emp ) ) 
     1154      SELECT CASE( TRIM( sn_rcv_emp%cldes ) ) 
    11271155      CASE( 'conservative'  )   ! received fields: jpr_rain, jpr_snow, jpr_ievp, jpr_tevp 
    1128          pemp_tot(:,:) = frcv(:,:,jpr_tevp) - frcv(:,:,jpr_rain) - frcv(:,:,jpr_snow) 
    1129          pemp_ice(:,:) = frcv(:,:,jpr_ievp) - frcv(:,:,jpr_snow) 
    1130          zsnow   (:,:) = frcv(:,:,jpr_snow) 
    1131                            CALL iom_put( 'rain'         , frcv(:,:,jpr_rain)              )   ! liquid precipitation  
    1132          IF( lk_diaar5 )   CALL iom_put( 'hflx_rain_cea', frcv(:,:,jpr_rain) * zcptn(:,:) )   ! heat flux from liq. precip.  
    1133          ztmp(:,:) = frcv(:,:,jpr_tevp) - frcv(:,:,jpr_ievp) * zicefr(:,:,1) 
     1156         sprecip(:,:) = frcv(jpr_snow)%z3(:,:,1)                 ! May need to ensure positive here 
     1157         tprecip(:,:) = frcv(jpr_rain)%z3(:,:,1) + sprecip (:,:) ! May need to ensure positive here 
     1158         emp_tot(:,:) = frcv(jpr_tevp)%z3(:,:,1) - tprecip(:,:) 
     1159         emp_ice(:,:) = frcv(jpr_ievp)%z3(:,:,1) - frcv(jpr_snow)%z3(:,:,1) 
     1160                           CALL iom_put( 'rain'         , frcv(jpr_rain)%z3(:,:,1)              )   ! liquid precipitation  
     1161         IF( lk_diaar5 )   CALL iom_put( 'hflx_rain_cea', frcv(jpr_rain)%z3(:,:,1) * zcptn(:,:) )   ! heat flux from liq. precip.  
     1162         ztmp(:,:) = frcv(jpr_tevp)%z3(:,:,1) - frcv(jpr_ievp)%z3(:,:,1) * zicefr(:,:) 
    11341163                           CALL iom_put( 'evap_ao_cea'  , ztmp                            )   ! ice-free oce evap (cell average) 
    11351164         IF( lk_diaar5 )   CALL iom_put( 'hflx_evap_cea', ztmp(:,:         ) * zcptn(:,:) )   ! heat flux from from evap (cell ave) 
    1136       CASE( 'oce and ice'   )   ! received fields: jpr_sbpr, jpr_semp, jpr_oemp 
    1137          pemp_tot(:,:) = p_frld(:,:,1) * frcv(:,:,jpr_oemp) + zicefr(:,:,1) * frcv(:,:,jpr_sbpr)  
    1138          pemp_ice(:,:) = frcv(:,:,jpr_semp) 
    1139          zsnow   (:,:) = - frcv(:,:,jpr_semp) + frcv(:,:,jpr_ievp) 
     1165      CASE( 'oce and ice'   )   ! received fields: jpr_sbpr, jpr_semp, jpr_oemp, jpr_ievp 
     1166         emp_tot(:,:) = p_frld(:,:) * frcv(jpr_oemp)%z3(:,:,1) + zicefr(:,:) * frcv(jpr_sbpr)%z3(:,:,1) 
     1167         emp_ice(:,:) = frcv(jpr_semp)%z3(:,:,1) 
     1168         sprecip(:,:) = - frcv(jpr_semp)%z3(:,:,1) + frcv(jpr_ievp)%z3(:,:,1) 
    11401169      END SELECT 
    1141       psprecip(:,:) = - pemp_ice(:,:) 
    1142       CALL iom_put( 'snowpre'    , zsnow                               )   ! Snow 
    1143       CALL iom_put( 'snow_ao_cea', zsnow(:,:         ) * p_frld(:,:,1) )   ! Snow        over ice-free ocean  (cell average) 
    1144       CALL iom_put( 'snow_ai_cea', zsnow(:,:         ) * zicefr(:,:,1) )   ! Snow        over sea-ice         (cell average) 
    1145       CALL iom_put( 'subl_ai_cea', frcv (:,:,jpr_ievp) * zicefr(:,:,1) )   ! Sublimation over sea-ice         (cell average) 
     1170 
     1171      CALL iom_put( 'snowpre'    , sprecip                                )   ! Snow 
     1172      CALL iom_put( 'snow_ao_cea', sprecip(:,:         ) * p_frld(:,:)    )   ! Snow        over ice-free ocean  (cell average) 
     1173      CALL iom_put( 'snow_ai_cea', sprecip(:,:         ) * zicefr(:,:)    )   ! Snow        over sea-ice         (cell average) 
     1174      CALL iom_put( 'subl_ai_cea', frcv(jpr_ievp)%z3(:,:,1) * zicefr(:,:) )   ! Sublimation over sea-ice         (cell average) 
    11461175      !    
    11471176      !                                                           ! runoffs and calving (put in emp_tot) 
    11481177      IF( srcv(jpr_rnf)%laction ) THEN  
    1149          pemp_tot(:,:) = pemp_tot(:,:) - frcv(:,:,jpr_rnf) 
    1150                            CALL iom_put( 'runoffs'      , frcv(:,:,jpr_rnf )              )   ! rivers 
    1151          IF( lk_diaar5 )   CALL iom_put( 'hflx_rnf_cea' , frcv(:,:,jpr_rnf ) * zcptn(:,:) )   ! heat flux from rivers 
     1178         emp_tot(:,:) = emp_tot(:,:) - frcv(jpr_rnf)%z3(:,:,1) 
     1179                           CALL iom_put( 'runoffs'      , frcv(jpr_rnf)%z3(:,:,1)              )   ! rivers 
     1180         IF( lk_diaar5 )   CALL iom_put( 'hflx_rnf_cea' , frcv(jpr_rnf)%z3(:,:,1) * zcptn(:,:) )   ! heat flux from rivers 
    11521181      ENDIF 
    11531182      IF( srcv(jpr_cal)%laction ) THEN  
    1154          pemp_tot(:,:) = pemp_tot(:,:) - frcv(:,:,jpr_cal) 
    1155          CALL iom_put( 'calving', frcv(:,:,jpr_cal) ) 
     1183         emp_tot(:,:) = emp_tot(:,:) - frcv(jpr_cal)%z3(:,:,1) 
     1184         CALL iom_put( 'calving', frcv(jpr_cal)%z3(:,:,1) ) 
    11561185      ENDIF 
    11571186      ! 
     
    11591188!!gm                                       at least should be optional... 
    11601189!!       ! remove negative runoff                            ! sum over the global domain 
    1161 !!       zcumulpos = SUM( MAX( frcv(:,:,jpr_rnf), 0.e0 ) * e1t(:,:) * e2t(:,:) * tmask_i(:,:) )  
    1162 !!       zcumulneg = SUM( MIN( frcv(:,:,jpr_rnf), 0.e0 ) * e1t(:,:) * e2t(:,:) * tmask_i(:,:) ) 
     1190!!       zcumulpos = SUM( MAX( frcv(jpr_rnf)%z3(:,:,1), 0.e0 ) * e1t(:,:) * e2t(:,:) * tmask_i(:,:) )  
     1191!!       zcumulneg = SUM( MIN( frcv(jpr_rnf)%z3(:,:,1), 0.e0 ) * e1t(:,:) * e2t(:,:) * tmask_i(:,:) ) 
    11631192!!       IF( lk_mpp )   CALL mpp_sum( zcumulpos ) 
    11641193!!       IF( lk_mpp )   CALL mpp_sum( zcumulneg )  
    11651194!!       IF( zcumulpos /= 0. ) THEN                          ! distribute negative runoff on positive runoff grid points 
    11661195!!          zcumulneg = 1.e0 + zcumulneg / zcumulpos 
    1167 !!          frcv(:,:,jpr_rnf) = MAX( frcv(:,:,jpr_rnf), 0.e0 ) * zcumulneg 
     1196!!          frcv(jpr_rnf)%z3(:,:,1) = MAX( frcv(jpr_rnf)%z3(:,:,1), 0.e0 ) * zcumulneg 
    11681197!!       ENDIF      
    1169 !!       pemp_tot(:,:) = pemp_tot(:,:) - frcv(:,:,jpr_rnf)   ! add runoff to e-p  
     1198!!       emp_tot(:,:) = emp_tot(:,:) - frcv(jpr_rnf)%z3(:,:,1)   ! add runoff to e-p  
    11701199!! 
    11711200!!gm  end of internal cooking 
    11721201 
    1173  
    11741202      !                                                      ! ========================= ! 
    1175       SELECT CASE( TRIM( cn_rcv_qns ) )                      !   non solar heat fluxes   !   (qns) 
     1203      SELECT CASE( TRIM( sn_rcv_qns%cldes ) )                !   non solar heat fluxes   !   (qns) 
    11761204      !                                                      ! ========================= ! 
     1205      CASE( 'oce only' )                                     ! the required field is directly provided 
     1206         qns_tot(:,:  ) = frcv(jpr_qnsoce)%z3(:,:,1) 
    11771207      CASE( 'conservative' )                                      ! the required fields are directly provided 
    1178          pqns_tot(:,:  ) = frcv(:,:,jpr_qnsmix) 
    1179          pqns_ice(:,:,1) = frcv(:,:,jpr_qnsice) 
     1208         qns_tot(:,:  ) = frcv(jpr_qnsmix)%z3(:,:,1) 
     1209         IF ( TRIM(sn_rcv_qns%clcat) == 'yes' ) THEN 
     1210            qns_ice(:,:,1:jpl) = frcv(jpr_qnsice)%z3(:,:,1:jpl) 
     1211         ELSE 
     1212            ! Set all category values equal for the moment 
     1213            DO jl=1,jpl 
     1214               qns_ice(:,:,jl) = frcv(jpr_qnsice)%z3(:,:,1) 
     1215            ENDDO 
     1216         ENDIF 
    11801217      CASE( 'oce and ice' )       ! the total flux is computed from ocean and ice fluxes 
    1181          pqns_tot(:,:  ) =  p_frld(:,:,1) * frcv(:,:,jpr_qnsoce) + zicefr(:,:,1) * frcv(:,:,jpr_qnsice) 
    1182          pqns_ice(:,:,1) =  frcv(:,:,jpr_qnsice) 
     1218         qns_tot(:,:  ) =  p_frld(:,:) * frcv(jpr_qnsoce)%z3(:,:,1) 
     1219         IF ( TRIM(sn_rcv_qns%clcat) == 'yes' ) THEN 
     1220            DO jl=1,jpl 
     1221               qns_tot(:,:   ) = qns_tot(:,:) + a_i(:,:,jl) * frcv(jpr_qnsice)%z3(:,:,jl)    
     1222               qns_ice(:,:,jl) = frcv(jpr_qnsice)%z3(:,:,jl) 
     1223            ENDDO 
     1224         ELSE 
     1225            DO jl=1,jpl 
     1226               qns_tot(:,:   ) = qns_tot(:,:) + zicefr(:,:) * frcv(jpr_qnsice)%z3(:,:,1) 
     1227               qns_ice(:,:,jl) = frcv(jpr_qnsice)%z3(:,:,1) 
     1228            ENDDO 
     1229         ENDIF 
    11831230      CASE( 'mixed oce-ice' )     ! the ice flux is cumputed from the total flux, the SST and ice informations 
    1184          pqns_tot(:,:  ) = frcv(:,:,jpr_qnsmix) 
    1185          pqns_ice(:,:,1) = frcv(:,:,jpr_qnsmix)    & 
    1186             &            + frcv(:,:,jpr_dqnsdt) * ( pist(:,:,1) - ( (rt0 + psst(:,:  ) ) * p_frld(:,:,1)   & 
    1187             &                                                   +          pist(:,:,1)   * zicefr(:,:,1) ) ) 
     1231! ** NEED TO SORT OUT HOW THIS SHOULD WORK IN THE MULTI-CATEGORY CASE - CURRENTLY NOT ALLOWED WHEN INTERFACE INITIALISED ** 
     1232         qns_tot(:,:  ) = frcv(jpr_qnsmix)%z3(:,:,1) 
     1233         qns_ice(:,:,1) = frcv(jpr_qnsmix)%z3(:,:,1)    & 
     1234            &            + frcv(jpr_dqnsdt)%z3(:,:,1) * ( pist(:,:,1) - ( (rt0 + psst(:,:  ) ) * p_frld(:,:)   & 
     1235            &                                                   +          pist(:,:,1)   * zicefr(:,:) ) ) 
    11881236      END SELECT 
    1189       ztmp(:,:) = p_frld(:,:,1) * zsnow(:,:) * lfus               ! add the latent heat of solid precip. melting 
    1190       pqns_tot(:,:) = pqns_tot(:,:) - ztmp(:,:)                   ! over free ocean  
    1191       IF( lk_diaar5 )   CALL iom_put( 'hflx_snow_cea', ztmp + zsnow(:,:) * zcptn(:,:) )   ! heat flux from snow (cell average) 
     1237      ztmp(:,:) = p_frld(:,:) * sprecip(:,:) * lfus               ! add the latent heat of solid precip. melting 
     1238      qns_tot(:,:) = qns_tot(:,:) - ztmp(:,:)                     ! over free ocean  
     1239      IF( lk_diaar5 )   CALL iom_put( 'hflx_snow_cea', ztmp + sprecip(:,:) * zcptn(:,:) )   ! heat flux from snow (cell average) 
    11921240!!gm 
    11931241!!    currently it is taken into account in leads budget but not in the qns_tot, and thus not in  
     
    11991247      !                                      
    12001248      IF( srcv(jpr_cal)%laction ) THEN                            ! Iceberg melting  
    1201          ztmp(:,:) = frcv(:,:,jpr_cal) * lfus                     ! add the latent heat of iceberg melting  
    1202          pqns_tot(:,:) = pqns_tot(:,:) - ztmp(:,:) 
    1203          IF( lk_diaar5 )   CALL iom_put( 'hflx_cal_cea', ztmp + frcv(:,:,jpr_cal) * zcptn(:,:) )   ! heat flux from calving 
     1249         ztmp(:,:) = frcv(jpr_cal)%z3(:,:,1) * lfus               ! add the latent heat of iceberg melting  
     1250         qns_tot(:,:) = qns_tot(:,:) - ztmp(:,:) 
     1251         IF( lk_diaar5 )   CALL iom_put( 'hflx_cal_cea', ztmp + frcv(jpr_cal)%z3(:,:,1) * zcptn(:,:) )   ! heat flux from calving 
    12041252      ENDIF 
    12051253 
    12061254      !                                                      ! ========================= ! 
    1207       SELECT CASE( TRIM( cn_rcv_qsr ) )                      !      solar heat fluxes    !   (qsr) 
     1255      SELECT CASE( TRIM( sn_rcv_qsr%cldes ) )                !      solar heat fluxes    !   (qsr) 
    12081256      !                                                      ! ========================= ! 
     1257      CASE( 'oce only' ) 
     1258         qsr_tot(:,:  ) = MAX(0.0,frcv(jpr_qsroce)%z3(:,:,1)) 
    12091259      CASE( 'conservative' ) 
    1210          pqsr_tot(:,:  ) = frcv(:,:,jpr_qsrmix) 
    1211          pqsr_ice(:,:,1) = frcv(:,:,jpr_qsrice) 
     1260         qsr_tot(:,:  ) = frcv(jpr_qsrmix)%z3(:,:,1) 
     1261         IF ( TRIM(sn_rcv_qsr%clcat) == 'yes' ) THEN 
     1262            qsr_ice(:,:,1:jpl) = frcv(jpr_qsrice)%z3(:,:,1:jpl) 
     1263         ELSE 
     1264            ! Set all category values equal for the moment 
     1265            DO jl=1,jpl 
     1266               qsr_ice(:,:,jl) = frcv(jpr_qsrice)%z3(:,:,1) 
     1267            ENDDO 
     1268         ENDIF 
     1269         qsr_tot(:,:  ) = frcv(jpr_qsrmix)%z3(:,:,1) 
     1270         qsr_ice(:,:,1) = frcv(jpr_qsrice)%z3(:,:,1) 
    12121271      CASE( 'oce and ice' ) 
    1213          pqsr_tot(:,:  ) =  p_frld(:,:,1) * frcv(:,:,jpr_qsroce) + zicefr(:,:,1) * frcv(:,:,jpr_qsrice) 
    1214          pqsr_ice(:,:,1) =  frcv(:,:,jpr_qsrice) 
     1272         qsr_tot(:,:  ) =  p_frld(:,:) * frcv(jpr_qsroce)%z3(:,:,1) 
     1273         IF ( TRIM(sn_rcv_qsr%clcat) == 'yes' ) THEN 
     1274            DO jl=1,jpl 
     1275               qsr_tot(:,:   ) = qsr_tot(:,:) + a_i(:,:,jl) * frcv(jpr_qsrice)%z3(:,:,jl)    
     1276               qsr_ice(:,:,jl) = frcv(jpr_qsrice)%z3(:,:,jl) 
     1277            ENDDO 
     1278         ELSE 
     1279            DO jl=1,jpl 
     1280               qsr_tot(:,:   ) = qsr_tot(:,:) + zicefr(:,:) * frcv(jpr_qsrice)%z3(:,:,1) 
     1281               qsr_ice(:,:,jl) = frcv(jpr_qsrice)%z3(:,:,1) 
     1282            ENDDO 
     1283         ENDIF 
    12151284      CASE( 'mixed oce-ice' ) 
    1216          pqsr_tot(:,:  ) = frcv(:,:,jpr_qsrmix) 
     1285         qsr_tot(:,:  ) = frcv(jpr_qsrmix)%z3(:,:,1) 
     1286! ** NEED TO SORT OUT HOW THIS SHOULD WORK IN THE MULTI-CATEGORY CASE - CURRENTLY NOT ALLOWED WHEN INTERFACE INITIALISED ** 
    12171287!       Create solar heat flux over ice using incoming solar heat flux and albedos 
    12181288!       ( see OASIS3 user guide, 5th edition, p39 ) 
    1219          pqsr_ice(:,:,1) = frcv(:,:,jpr_qsrmix) * ( 1.- palbi(:,:,1) )   & 
    1220             &            / (  1.- ( albedo_oce_mix(:,:  ) * p_frld(:,:,1)   & 
    1221             &                     + palbi         (:,:,1) * zicefr(:,:,1) ) ) 
     1289         qsr_ice(:,:,1) = frcv(jpr_qsrmix)%z3(:,:,1) * ( 1.- palbi(:,:,1) )   & 
     1290            &            / (  1.- ( albedo_oce_mix(:,:  ) * p_frld(:,:)       & 
     1291            &                     + palbi         (:,:,1) * zicefr(:,:) ) ) 
    12221292      END SELECT 
    12231293      IF( ln_dm2dc ) THEN   ! modify qsr to include the diurnal cycle 
    1224          pqsr_tot(:,:  ) = sbc_dcy( pqsr_tot(:,:  ) ) 
    1225          pqsr_ice(:,:,1) = sbc_dcy( pqsr_ice(:,:,1) ) 
    1226       ENDIF 
    1227  
    1228       SELECT CASE( TRIM( cn_rcv_dqnsdt ) ) 
     1294         qsr_tot(:,:  ) = sbc_dcy( qsr_tot(:,:  ) ) 
     1295         DO jl=1,jpl 
     1296            qsr_ice(:,:,jl) = sbc_dcy( qsr_ice(:,:,jl) ) 
     1297         ENDDO 
     1298      ENDIF 
     1299 
     1300      SELECT CASE( TRIM( sn_rcv_dqnsdt%cldes ) ) 
    12291301      CASE ('coupled') 
    1230           pdqns_ice(:,:,1) = frcv(:,:,jpr_dqnsdt) 
     1302         IF ( TRIM(sn_rcv_dqnsdt%clcat) == 'yes' ) THEN 
     1303            dqns_ice(:,:,1:jpl) = frcv(jpr_dqnsdt)%z3(:,:,1:jpl) 
     1304         ELSE 
     1305            ! Set all category values equal for the moment 
     1306            DO jl=1,jpl 
     1307               dqns_ice(:,:,jl) = frcv(jpr_dqnsdt)%z3(:,:,1) 
     1308            ENDDO 
     1309         ENDIF 
    12311310      END SELECT 
    12321311 
    1233       IF( wrk_not_released(2, 1,2,3)  .OR.   & 
    1234           wrk_not_released(3, 4)      )   CALL ctl_stop('sbc_cpl_ice_flx: failed to release workspace arrays') 
     1312      SELECT CASE( TRIM( sn_rcv_iceflx%cldes ) ) 
     1313      CASE ('coupled') 
     1314         topmelt(:,:,:)=frcv(jpr_topm)%z3(:,:,:) 
     1315         botmelt(:,:,:)=frcv(jpr_botm)%z3(:,:,:) 
     1316      END SELECT 
     1317 
     1318      IF( wrk_not_released(2, 2,3,4) ) CALL ctl_stop('sbc_cpl_ice_flx: failed to release workspace arrays') 
    12351319      ! 
    12361320   END SUBROUTINE sbc_cpl_ice_flx 
     
    12491333      USE wrk_nemo, ONLY:   zfr_l => wrk_2d_1   ! 1. - fr_i(:,:) 
    12501334      USE wrk_nemo, ONLY:   ztmp1 => wrk_2d_2 , ztmp2 => wrk_2d_3 
     1335      USE wrk_nemo, ONLY:   ztmp3 => wrk_3d_1 , ztmp4 => wrk_3d_2 
    12511336      USE wrk_nemo, ONLY:   zotx1 => wrk_2d_4 , zoty1 => wrk_2d_5 , zotz1 => wrk_2d_6 
    12521337      USE wrk_nemo, ONLY:   zitx1 => wrk_2d_7 , zity1 => wrk_2d_8 , zitz1 => wrk_2d_9 
     
    12541339      INTEGER, INTENT(in) ::   kt 
    12551340      ! 
    1256       INTEGER ::   ji, jj       ! dummy loop indices 
     1341      INTEGER ::   ji, jj, jl   ! dummy loop indices 
    12571342      INTEGER ::   isec, info   ! local integer 
    12581343      !!---------------------------------------------------------------------- 
    12591344 
    1260       IF( wrk_in_use(2, 1,2,3,4,5,6,7,8,9) ) THEN 
     1345      IF( wrk_in_use(2, 1,2,3,4,5,6,7,8,9) .OR. wrk_in_use(3, 1,2)  ) THEN 
    12611346         CALL ctl_stop('sbc_cpl_snd: requested workspace arrays are unavailable')   ;   RETURN 
    12621347      ENDIF 
     
    12691354      !                                                      !    Surface temperature    !   in Kelvin 
    12701355      !                                                      ! ------------------------- ! 
    1271       SELECT CASE( cn_snd_temperature) 
    1272       CASE( 'oce only'             )   ;   ztmp1(:,:) =   tn(:,:,1) + rt0 
    1273       CASE( 'weighted oce and ice' )   ;   ztmp1(:,:) = ( tn(:,:,1) + rt0 ) * zfr_l(:,:)    
    1274                                            ztmp2(:,:) =   tn_ice(:,:,1)     *  fr_i(:,:) 
    1275       CASE( 'mixed oce-ice'        )   ;   ztmp1(:,:) = ( tn(:,:,1) + rt0 ) * zfr_l(:,:) + tn_ice(:,:,1) * fr_i(:,:) 
    1276       CASE default                     ;   CALL ctl_stop( 'sbc_cpl_snd: wrong definition of cn_snd_temperature' ) 
     1356      SELECT CASE( sn_snd_temp%cldes) 
     1357      CASE( 'oce only'             )   ;   ztmp1(:,:) =   tsn(:,:,1,1) + rt0 
     1358      CASE( 'weighted oce and ice' )   ;   ztmp1(:,:) = ( tsn(:,:,1,1) + rt0 ) * zfr_l(:,:)    
     1359         SELECT CASE( sn_snd_temp%clcat ) 
     1360         CASE( 'yes' )    
     1361            ztmp3(:,:,1:jpl) = tn_ice(:,:,1:jpl) * a_i(:,:,1:jpl) 
     1362         CASE( 'no' ) 
     1363            ztmp3(:,:,:) = 0.0 
     1364            DO jl=1,jpl 
     1365               ztmp3(:,:,1) = ztmp3(:,:,1) + tn_ice(:,:,jl) * a_i(:,:,jl) 
     1366            ENDDO 
     1367         CASE default                  ;   CALL ctl_stop( 'sbc_cpl_snd: wrong definition of sn_snd_temp%clcat' ) 
     1368         END SELECT 
     1369      CASE( 'mixed oce-ice'        )    
     1370         ztmp1(:,:) = ( tsn(:,:,1,1) + rt0 ) * zfr_l(:,:)  
     1371         DO jl=1,jpl 
     1372            ztmp1(:,:) = ztmp1(:,:) + tn_ice(:,:,jl) * a_i(:,:,jl) 
     1373         ENDDO 
     1374      CASE default                     ;   CALL ctl_stop( 'sbc_cpl_snd: wrong definition of sn_snd_temp%cldes' ) 
    12771375      END SELECT 
    1278       IF( ssnd(jps_toce)%laction )   CALL cpl_prism_snd( jps_toce, isec, ztmp1, info ) 
    1279       IF( ssnd(jps_tice)%laction )   CALL cpl_prism_snd( jps_tice, isec, ztmp2, info ) 
    1280       IF( ssnd(jps_tmix)%laction )   CALL cpl_prism_snd( jps_tmix, isec, ztmp1, info ) 
     1376      IF( ssnd(jps_toce)%laction )   CALL cpl_prism_snd( jps_toce, isec, RESHAPE ( ztmp1, (/jpi,jpj,1/) ), info ) 
     1377      IF( ssnd(jps_tice)%laction )   CALL cpl_prism_snd( jps_tice, isec, ztmp3, info ) 
     1378      IF( ssnd(jps_tmix)%laction )   CALL cpl_prism_snd( jps_tmix, isec, RESHAPE ( ztmp1, (/jpi,jpj,1/) ), info ) 
    12811379      ! 
    12821380      !                                                      ! ------------------------- ! 
     
    12841382      !                                                      ! ------------------------- ! 
    12851383      IF( ssnd(jps_albice)%laction ) THEN                         ! ice  
    1286          ztmp1(:,:) = alb_ice(:,:,1) * fr_i(:,:) 
    1287          CALL cpl_prism_snd( jps_albice, isec, ztmp1, info ) 
     1384         ztmp3(:,:,1:jpl) = alb_ice(:,:,1:jpl) * a_i(:,:,1:jpl) 
     1385         CALL cpl_prism_snd( jps_albice, isec, ztmp3, info ) 
    12881386      ENDIF 
    12891387      IF( ssnd(jps_albmix)%laction ) THEN                         ! mixed ice-ocean 
    1290          ztmp1(:,:) = albedo_oce_mix(:,:) * zfr_l(:,:) + alb_ice(:,:,1) * fr_i(:,:) 
    1291          CALL cpl_prism_snd( jps_albmix, isec, ztmp1, info ) 
     1388         ztmp1(:,:) = albedo_oce_mix(:,:) * zfr_l(:,:) 
     1389         DO jl=1,jpl 
     1390            ztmp1(:,:) = ztmp1(:,:) + alb_ice(:,:,jl) * a_i(:,:,jl) 
     1391         ENDDO 
     1392         CALL cpl_prism_snd( jps_albmix, isec, RESHAPE ( ztmp1, (/jpi,jpj,1/) ), info ) 
    12921393      ENDIF 
    12931394      !                                                      ! ------------------------- ! 
    12941395      !                                                      !  Ice fraction & Thickness !  
    12951396      !                                                      ! ------------------------- ! 
    1296       IF( ssnd(jps_fice)%laction )   CALL cpl_prism_snd( jps_fice, isec, fr_i                  , info ) 
    1297       IF( ssnd(jps_hice)%laction )   CALL cpl_prism_snd( jps_hice, isec, hicif(:,:) * fr_i(:,:), info ) 
    1298       IF( ssnd(jps_hsnw)%laction )   CALL cpl_prism_snd( jps_hsnw, isec, hsnif(:,:) * fr_i(:,:), info ) 
     1397      ! Send ice fraction field  
     1398      SELECT CASE( sn_snd_thick%clcat ) 
     1399         CASE( 'yes' )    
     1400            ztmp3(:,:,1:jpl) =  a_i(:,:,1:jpl) 
     1401         CASE( 'no' ) 
     1402            ztmp3(:,:,1) = fr_i(:,:) 
     1403      CASE default                     ;   CALL ctl_stop( 'sbc_cpl_snd: wrong definition of sn_snd_thick%clcat' ) 
     1404      END SELECT 
     1405      IF( ssnd(jps_fice)%laction ) CALL cpl_prism_snd( jps_fice, isec, ztmp3, info ) 
     1406 
     1407      ! Send ice and snow thickness field  
     1408      SELECT CASE( sn_snd_thick%cldes) 
     1409      CASE( 'weighted ice and snow' )    
     1410         SELECT CASE( sn_snd_thick%clcat ) 
     1411         CASE( 'yes' )    
     1412            ztmp3(:,:,1:jpl) =  ht_i(:,:,1:jpl) * a_i(:,:,1:jpl) 
     1413            ztmp4(:,:,1:jpl) =  ht_s(:,:,1:jpl) * a_i(:,:,1:jpl) 
     1414         CASE( 'no' ) 
     1415            ztmp3(:,:,:) = 0.0   ;  ztmp4(:,:,:) = 0.0 
     1416            DO jl=1,jpl 
     1417               ztmp3(:,:,1) = ztmp3(:,:,1) + ht_i(:,:,jl) * a_i(:,:,jl) 
     1418               ztmp4(:,:,1) = ztmp4(:,:,1) + ht_s(:,:,jl) * a_i(:,:,jl) 
     1419            ENDDO 
     1420         CASE default                  ;   CALL ctl_stop( 'sbc_cpl_snd: wrong definition of sn_snd_thick%clcat' ) 
     1421         END SELECT 
     1422      CASE( 'ice and snow'         )    
     1423         ztmp3(:,:,1:jpl) = ht_i(:,:,1:jpl) 
     1424         ztmp4(:,:,1:jpl) = ht_s(:,:,1:jpl) 
     1425      CASE default                     ;   CALL ctl_stop( 'sbc_cpl_snd: wrong definition of sn_snd_thick%cldes' ) 
     1426      END SELECT 
     1427      IF( ssnd(jps_hice)%laction )   CALL cpl_prism_snd( jps_hice, isec, ztmp3, info ) 
     1428      IF( ssnd(jps_hsnw)%laction )   CALL cpl_prism_snd( jps_hsnw, isec, ztmp4, info ) 
    12991429      ! 
    13001430#if defined key_cpl_carbon_cycle 
     
    13021432      !                                                      !  CO2 flux from PISCES     !  
    13031433      !                                                      ! ------------------------- ! 
    1304       IF( ssnd(jps_co2)%laction )   CALL cpl_prism_snd( jps_co2, isec, oce_co2 , info ) 
     1434      IF( ssnd(jps_co2)%laction )   CALL cpl_prism_snd( jps_co2, isec, RESHAPE ( oce_co2, (/jpi,jpj,1/) ) , info ) 
    13051435      ! 
    13061436#endif 
     1437      !                                                      ! ------------------------- ! 
    13071438      IF( ssnd(jps_ocx1)%laction ) THEN                      !      Surface current      ! 
    13081439         !                                                   ! ------------------------- ! 
     
    13161447         !                                                              i-1  i   i 
    13171448         !                                                               i      i+1 (for I) 
    1318          SELECT CASE( TRIM( cn_snd_crt(1) ) ) 
     1449         SELECT CASE( TRIM( sn_snd_crt%cldes ) ) 
    13191450         CASE( 'oce only'             )      ! C-grid ==> T 
    13201451            DO jj = 2, jpjm1 
     
    13941525            END SELECT 
    13951526         END SELECT 
    1396          CALL lbc_lnk( zotx1, 'T', -1. )   ;   CALL lbc_lnk( zoty1, 'T', -1. ) 
     1527         CALL lbc_lnk( zotx1, ssnd(jps_ocx1)%clgrid, -1. )   ;   CALL lbc_lnk( zoty1, ssnd(jps_ocy1)%clgrid, -1. ) 
    13971528         ! 
    13981529         ! 
    1399          IF( TRIM( cn_snd_crt(3) ) == 'eastward-northward' ) THEN             ! Rotation of the components 
     1530         IF( TRIM( sn_snd_crt%clvor ) == 'eastward-northward' ) THEN             ! Rotation of the components 
    14001531            !                                                                     ! Ocean component 
    14011532            CALL rot_rep( zotx1, zoty1, ssnd(jps_ocx1)%clgrid, 'ij->e', ztmp1 )       ! 1st component  
     
    14121543         ! 
    14131544         ! spherical coordinates to cartesian -> 2 components to 3 components 
    1414          IF( TRIM( cn_snd_crt(2) ) == 'cartesian' ) THEN 
     1545         IF( TRIM( sn_snd_crt%clvref ) == 'cartesian' ) THEN 
    14151546            ztmp1(:,:) = zotx1(:,:)                     ! ocean currents 
    14161547            ztmp2(:,:) = zoty1(:,:) 
     
    14241555         ENDIF 
    14251556         ! 
    1426          IF( ssnd(jps_ocx1)%laction )   CALL cpl_prism_snd( jps_ocx1, isec, zotx1, info )   ! ocean x current 1st grid 
    1427          IF( ssnd(jps_ocy1)%laction )   CALL cpl_prism_snd( jps_ocy1, isec, zoty1, info )   ! ocean y current 1st grid 
    1428          IF( ssnd(jps_ocz1)%laction )   CALL cpl_prism_snd( jps_ocz1, isec, zotz1, info )   ! ocean z current 1st grid 
     1557         IF( ssnd(jps_ocx1)%laction )   CALL cpl_prism_snd( jps_ocx1, isec, RESHAPE ( zotx1, (/jpi,jpj,1/) ), info )   ! ocean x current 1st grid 
     1558         IF( ssnd(jps_ocy1)%laction )   CALL cpl_prism_snd( jps_ocy1, isec, RESHAPE ( zoty1, (/jpi,jpj,1/) ), info )   ! ocean y current 1st grid 
     1559         IF( ssnd(jps_ocz1)%laction )   CALL cpl_prism_snd( jps_ocz1, isec, RESHAPE ( zotz1, (/jpi,jpj,1/) ), info )   ! ocean z current 1st grid 
    14291560         ! 
    1430          IF( ssnd(jps_ivx1)%laction )   CALL cpl_prism_snd( jps_ivx1, isec, zitx1, info )   ! ice   x current 1st grid 
    1431          IF( ssnd(jps_ivy1)%laction )   CALL cpl_prism_snd( jps_ivy1, isec, zity1, info )   ! ice   y current 1st grid 
    1432          IF( ssnd(jps_ivz1)%laction )   CALL cpl_prism_snd( jps_ivz1, isec, zitz1, info )   ! ice   z current 1st grid 
     1561         IF( ssnd(jps_ivx1)%laction )   CALL cpl_prism_snd( jps_ivx1, isec, RESHAPE ( zitx1, (/jpi,jpj,1/) ), info )   ! ice   x current 1st grid 
     1562         IF( ssnd(jps_ivy1)%laction )   CALL cpl_prism_snd( jps_ivy1, isec, RESHAPE ( zity1, (/jpi,jpj,1/) ), info )   ! ice   y current 1st grid 
     1563         IF( ssnd(jps_ivz1)%laction )   CALL cpl_prism_snd( jps_ivz1, isec, RESHAPE ( zitz1, (/jpi,jpj,1/) ), info )   ! ice   z current 1st grid 
    14331564         !  
    14341565      ENDIF 
    14351566      ! 
    1436       IF( wrk_not_released(2, 1,2,3,4,5,6,7,8,9) )   CALL ctl_stop('sbc_cpl_snd: failed to release workspace arrays') 
     1567      IF( wrk_not_released(2, 1,2,3,4,5,6,7,8,9) .OR. wrk_not_released(3, 1,2) )   CALL ctl_stop('sbc_cpl_snd: failed to release workspace arrays') 
    14371568      ! 
    14381569   END SUBROUTINE sbc_cpl_snd 
     
    14591590   END SUBROUTINE sbc_cpl_ice_tau 
    14601591   ! 
    1461    SUBROUTINE sbc_cpl_ice_flx( p_frld  ,                                  & 
    1462       &                        pqns_tot, pqns_ice, pqsr_tot , pqsr_ice,   & 
    1463       &                        pemp_tot, pemp_ice, pdqns_ice, psprecip,   & 
    1464       &                        palbi   , psst    , pist                ) 
    1465       REAL(wp), INTENT(in   ), DIMENSION(:,:,:) ::   p_frld     ! lead fraction                [0 to 1] 
    1466       REAL(wp), INTENT(  out), DIMENSION(:,:  ) ::   pqns_tot   ! total non solar heat flux    [W/m2] 
    1467       REAL(wp), INTENT(  out), DIMENSION(:,:,:) ::   pqns_ice   ! ice   non solar heat flux    [W/m2] 
    1468       REAL(wp), INTENT(  out), DIMENSION(:,:  ) ::   pqsr_tot   ! total     solar heat flux    [W/m2] 
    1469       REAL(wp), INTENT(  out), DIMENSION(:,:,:) ::   pqsr_ice   ! ice       solar heat flux    [W/m2] 
    1470       REAL(wp), INTENT(  out), DIMENSION(:,:  ) ::   pemp_tot   ! total     freshwater budget  [Kg/m2/s] 
    1471       REAL(wp), INTENT(  out), DIMENSION(:,:  ) ::   pemp_ice   ! ice solid freshwater budget  [Kg/m2/s] 
    1472       REAL(wp), INTENT(  out), DIMENSION(:,:,:) ::   pdqns_ice  ! d(Q non solar)/d(Temperature) over ice 
    1473       REAL(wp), INTENT(  out), DIMENSION(:,:  ) ::   psprecip   ! solid precipitation          [Kg/m2/s] 
     1592   SUBROUTINE sbc_cpl_ice_flx( p_frld , palbi   , psst    , pist  ) 
     1593      REAL(wp), INTENT(in   ), DIMENSION(:,:  ) ::   p_frld     ! lead fraction                [0 to 1] 
    14741594      REAL(wp), INTENT(in   ), DIMENSION(:,:,:), OPTIONAL ::   palbi   ! ice albedo 
    14751595      REAL(wp), INTENT(in   ), DIMENSION(:,:  ), OPTIONAL ::   psst    ! sea surface temperature      [Celcius] 
    14761596      REAL(wp), INTENT(in   ), DIMENSION(:,:,:), OPTIONAL ::   pist    ! ice surface temperature      [Kelvin] 
    1477       WRITE(*,*) 'sbc_cpl_snd: You should not have seen this print! error?', p_frld(1,1,1), palbi(1,1,1), psst(1,1), pist(1,1,1)  
    1478       ! stupid definition to avoid warning message when compiling... 
    1479       pqns_tot(:,:) = 0. ; pqns_ice(:,:,:) = 0. ; pdqns_ice(:,:,:) = 0. 
    1480       pqsr_tot(:,:) = 0. ; pqsr_ice(:,:,:) = 0.  
    1481       pemp_tot(:,:) = 0. ; pemp_ice(:,:)   = 0. ; psprecip(:,:) = 0. 
     1597      WRITE(*,*) 'sbc_cpl_snd: You should not have seen this print! error?', p_frld(1,1), palbi(1,1,1), psst(1,1), pist(1,1,1)  
    14821598   END SUBROUTINE sbc_cpl_ice_flx 
    14831599    
  • branches/2011/dev_NOC_UKMO_MERGE/NEMOGCM/NEMO/OPA_SRC/SBC/sbcice_if.F90

    r2715 r3094  
    1616   USE eosbn2          ! equation of state 
    1717   USE sbc_oce         ! surface boundary condition: ocean fields 
     18   USE sbccpl 
    1819   USE fldread         ! read input field 
    1920   USE iom             ! I/O manager library 
     
    9798          
    9899         fr_i(:,:) = tfreez( sss_m ) * tmask(:,:,1)      ! sea surface freezing temperature [Celcius] 
     100#if defined key_coupled  
     101         a_i(:,:,1) = fr_i(:,:)          
     102#endif 
    99103 
    100104         ! Flux and ice fraction computation 
  • branches/2011/dev_NOC_UKMO_MERGE/NEMOGCM/NEMO/OPA_SRC/SBC/sbcice_lim_2.F90

    r2715 r3094  
    202202#if defined key_coupled 
    203203         !                                             ! Ice surface fluxes in coupled mode  
    204          IF( ksbc == 5 )   CALL sbc_cpl_ice_flx( reshape( frld, (/jpi,jpj,1/) ),                 & 
    205             &                                             qns_tot, qns_ice, qsr_tot , qsr_ice,   & 
    206             &                                             emp_tot, emp_ice, dqns_ice, sprecip,   & 
     204         IF( ksbc == 5 )   THEN 
     205            a_i(:,:,1)=fr_i 
     206            CALL sbc_cpl_ice_flx( frld,                                              & 
    207207            !                                optional arguments, used only in 'mixed oce-ice' case 
    208208            &                                             palbi = zalb_ice_cs, psst = sst_m, pist = zsist ) 
     209            sprecip(:,:) = - emp_ice(:,:)   ! Ugly patch, WARNING, in coupled mode, sublimation included in snow (parsub = 0.) 
     210         ENDIF 
    209211#endif 
    210212                           CALL lim_thd_2      ( kt )      ! Ice thermodynamics  
  • branches/2011/dev_NOC_UKMO_MERGE/NEMOGCM/NEMO/OPA_SRC/SBC/sbcmod.F90

    r2715 r3094  
    1111   !!             -   ! 2010-11  (G. Madec) ice-ocean stress always computed at each ocean time-step 
    1212   !!             -   ! 2010-10  (J. Chanut, C. Bricaud, G. Madec)  add the surface pressure forcing 
     13   !!            3.4  ! 2011-11  (C. Harris) CICE added as an option 
    1314   !!---------------------------------------------------------------------- 
    1415 
     
    3233   USE sbcice_lim       ! surface boundary condition: LIM 3.0 sea-ice model 
    3334   USE sbcice_lim_2     ! surface boundary condition: LIM 2.0 sea-ice model 
     35   USE sbcice_cice      ! surface boundary condition: CICE    sea-ice model 
    3436   USE sbccpl           ! surface boundary condition: coupled florulation 
    3537   USE cpl_oasis3, ONLY:lk_cpl      ! are we in coupled mode? 
     
    3840   USE sbcfwb           ! surface boundary condition: freshwater budget 
    3941   USE closea           ! closed sea 
    40    USE bdy_par          ! unstructured open boundary data variables 
    41    USE bdyice           ! unstructured open boundary data  (bdy_ice_frs routine) 
     42   USE bdy_par          ! for lk_bdy 
     43   USE bdyice_lim2      ! unstructured open boundary data  (bdy_ice_lim_2 routine) 
    4244 
    4345   USE prtctl           ! Print control                    (prt_ctl routine) 
     
    9496        IF( lk_lim2 )   nn_ice      = 2 
    9597        IF( lk_lim3 )   nn_ice      = 3 
     98        IF( lk_cice )   nn_ice      = 4 
    9699      ENDIF 
    97100      IF( cp_cfg == 'gyre' ) THEN            ! GYRE configuration 
     
    144147         &  CALL ctl_warn( 'nn_fsbc is NOT a multiple of the number of time steps in a day' ) 
    145148      ! 
    146       IF( nn_ice == 2 .AND. .NOT.( ln_blk_clio .OR. ln_blk_core .OR. lk_cpl ) )   & 
    147          &   CALL ctl_stop( 'sea-ice model requires a bulk formulation or coupled configuration' ) 
     149      IF( ( nn_ice == 2 .OR. nn_ice ==3 ) .AND. .NOT.( ln_blk_clio .OR. ln_blk_core .OR. lk_cpl ) )   & 
     150         &   CALL ctl_stop( 'LIM sea-ice model requires a bulk formulation or coupled configuration' ) 
     151      IF( nn_ice == 4 .AND. .NOT.( ln_blk_core .OR. lk_cpl ) )   & 
     152         &   CALL ctl_stop( 'CICE sea-ice model requires ln_blk_core or lk_cpl' ) 
     153      IF( nn_ice == 4 .AND. ( .NOT. ( cp_cfg == 'orca' ) .OR. lk_agrif ) )   & 
     154         &   CALL ctl_stop( 'CICE sea-ice model currently only available in a global ORCA configuration without AGRIF' ) 
    148155       
    149156      IF( ln_dm2dc )   nday_qsr = -1   ! initialisation flag 
     
    182189         IF( nsbc ==  5 )   WRITE(numout,*) '              coupled formulation' 
    183190      ENDIF 
     191 
     192      IF( nn_ice == 4 )   CALL cice_sbc_init (nsbc) 
    184193      ! 
    185194   END SUBROUTINE sbc_init 
     
    253262         !                                                       
    254263      CASE(  2 )   ;       CALL sbc_ice_lim_2( kt, nsbc )            ! LIM-2 ice model 
    255          IF( lk_bdy )      CALL bdy_ice_frs  ( kt )                  ! BDY boundary condition 
     264         IF( lk_bdy )      CALL bdy_ice_lim_2( kt )                  ! BDY boundary condition 
    256265         !                                                      
    257266      CASE(  3 )   ;       CALL sbc_ice_lim  ( kt, nsbc )            ! LIM-3 ice model 
     267         ! 
     268      CASE(  4 )   ;       CALL sbc_ice_cice ( kt, nsbc )            ! CICE ice model 
    258269      END SELECT                                               
    259270 
     
    338349            &         tab2d_2=vtau      , clinfo2=' vtau     - : ', mask2=vmask, ovlap=1 ) 
    339350      ENDIF 
     351 
     352      IF( kt == nitend )   CALL sbc_final         ! Close down surface module if necessary 
    340353      ! 
    341354   END SUBROUTINE sbc 
     355 
     356   SUBROUTINE sbc_final 
     357      !!--------------------------------------------------------------------- 
     358      !!                    ***  ROUTINE sbc_final  *** 
     359      !!--------------------------------------------------------------------- 
     360 
     361      !----------------------------------------------------------------- 
     362      ! Finalize CICE (if used) 
     363      !----------------------------------------------------------------- 
     364 
     365      IF( nn_ice == 4 )   CALL cice_sbc_final 
     366      ! 
     367   END SUBROUTINE sbc_final 
    342368 
    343369   !!====================================================================== 
  • branches/2011/dev_NOC_UKMO_MERGE/NEMOGCM/NEMO/OPA_SRC/SOL/solver.F90

    r2715 r3094  
    2323   USE dynspg_oce      ! choice/control of key cpp for surface pressure gradient 
    2424   USE solmat          ! matrix of the solver 
    25    USE obc_oce         ! Lateral open boundary condition 
    2625   USE in_out_manager  ! I/O manager 
    2726   USE lbclnk          ! ocean lateral boundary conditions (or mpp link) 
  • branches/2011/dev_NOC_UKMO_MERGE/NEMOGCM/NEMO/OPA_SRC/TRA/traadv.F90

    r2715 r3094  
    9393      ! 
    9494      IF( lk_traldf_eiv .AND. .NOT. ln_traldf_grif )   & 
    95          &              CALL tra_adv_eiv( kt, zun, zvn, zwn, 'TRA' )          ! add the eiv transport (if necessary) 
     95         &              CALL tra_adv_eiv( kt, nit000, zun, zvn, zwn, 'TRA' )    ! add the eiv transport (if necessary) 
    9696      ! 
    9797      CALL iom_put( "uocetr_eff", zun )                                         ! output effective transport       
     
    100100 
    101101      SELECT CASE ( nadv )                            !==  compute advection trend and add it to general trend  ==! 
    102       CASE ( 1 )   ;    CALL tra_adv_cen2  ( kt, 'TRA',         zun, zvn, zwn, tsb, tsn, tsa, jpts )   !  2nd order centered 
    103       CASE ( 2 )   ;    CALL tra_adv_tvd   ( kt, 'TRA', r2dtra, zun, zvn, zwn, tsb, tsn, tsa, jpts )   !  TVD  
    104       CASE ( 3 )   ;    CALL tra_adv_muscl ( kt, 'TRA', r2dtra, zun, zvn, zwn, tsb,      tsa, jpts )   !  MUSCL  
    105       CASE ( 4 )   ;    CALL tra_adv_muscl2( kt, 'TRA', r2dtra, zun, zvn, zwn, tsb, tsn, tsa, jpts )   !  MUSCL2  
    106       CASE ( 5 )   ;    CALL tra_adv_ubs   ( kt, 'TRA', r2dtra, zun, zvn, zwn, tsb, tsn, tsa, jpts )   !  UBS  
    107       CASE ( 6 )   ;    CALL tra_adv_qck   ( kt, 'TRA', r2dtra, zun, zvn, zwn, tsb, tsn, tsa, jpts )   !  QUICKEST  
     102      CASE ( 1 )   ;    CALL tra_adv_cen2  ( kt, nit000, 'TRA',         zun, zvn, zwn, tsb, tsn, tsa, jpts )   !  2nd order centered 
     103      CASE ( 2 )   ;    CALL tra_adv_tvd   ( kt, nit000, 'TRA', r2dtra, zun, zvn, zwn, tsb, tsn, tsa, jpts )   !  TVD  
     104      CASE ( 3 )   ;    CALL tra_adv_muscl ( kt, nit000, 'TRA', r2dtra, zun, zvn, zwn, tsb,      tsa, jpts )   !  MUSCL  
     105      CASE ( 4 )   ;    CALL tra_adv_muscl2( kt, nit000, 'TRA', r2dtra, zun, zvn, zwn, tsb, tsn, tsa, jpts )   !  MUSCL2  
     106      CASE ( 5 )   ;    CALL tra_adv_ubs   ( kt, nit000, 'TRA', r2dtra, zun, zvn, zwn, tsb, tsn, tsa, jpts )   !  UBS  
     107      CASE ( 6 )   ;    CALL tra_adv_qck   ( kt, nit000, 'TRA', r2dtra, zun, zvn, zwn, tsb, tsn, tsa, jpts )   !  QUICKEST  
    108108      ! 
    109109      CASE (-1 )                                      !==  esopa: test all possibility with control print  ==! 
    110          CALL tra_adv_cen2  ( kt, 'TRA',         zun, zvn, zwn, tsb, tsn, tsa, jpts )           
     110         CALL tra_adv_cen2  ( kt, nit000, 'TRA',         zun, zvn, zwn, tsb, tsn, tsa, jpts )           
    111111         CALL prt_ctl( tab3d_1=tsa(:,:,:,jp_tem), clinfo1=' adv0 - Ta: ', mask1=tmask,               & 
    112112            &          tab3d_2=tsa(:,:,:,jp_sal), clinfo2=       ' Sa: ', mask2=tmask, clinfo3='tra' ) 
    113          CALL tra_adv_tvd   ( kt, 'TRA', r2dtra, zun, zvn, zwn, tsb, tsn, tsa, jpts )           
     113         CALL tra_adv_tvd   ( kt, nit000, 'TRA', r2dtra, zun, zvn, zwn, tsb, tsn, tsa, jpts )           
    114114         CALL prt_ctl( tab3d_1=tsa(:,:,:,jp_tem), clinfo1=' adv1 - Ta: ', mask1=tmask,               & 
    115115            &          tab3d_2=tsa(:,:,:,jp_sal), clinfo2=       ' Sa: ', mask2=tmask, clinfo3='tra' ) 
    116          CALL tra_adv_muscl ( kt, 'TRA', r2dtra, zun, zvn, zwn, tsb,      tsa, jpts )           
     116         CALL tra_adv_muscl ( kt, nit000, 'TRA', r2dtra, zun, zvn, zwn, tsb,      tsa, jpts )           
    117117         CALL prt_ctl( tab3d_1=tsa(:,:,:,jp_tem), clinfo1=' adv3 - Ta: ', mask1=tmask,               & 
    118118            &          tab3d_2=tsa(:,:,:,jp_sal), clinfo2=       ' Sa: ', mask2=tmask, clinfo3='tra' ) 
    119          CALL tra_adv_muscl2( kt, 'TRA', r2dtra, zun, zvn, zwn, tsb, tsn, tsa, jpts )           
     119         CALL tra_adv_muscl2( kt, nit000, 'TRA', r2dtra, zun, zvn, zwn, tsb, tsn, tsa, jpts )           
    120120         CALL prt_ctl( tab3d_1=tsa(:,:,:,jp_tem), clinfo1=' adv4 - Ta: ', mask1=tmask,               & 
    121121            &          tab3d_2=tsa(:,:,:,jp_sal), clinfo2=       ' Sa: ', mask2=tmask, clinfo3='tra' ) 
    122          CALL tra_adv_ubs   ( kt, 'TRA', r2dtra, zun, zvn, zwn, tsb, tsn, tsa, jpts )           
     122         CALL tra_adv_ubs   ( kt, nit000, 'TRA', r2dtra, zun, zvn, zwn, tsb, tsn, tsa, jpts )           
    123123         CALL prt_ctl( tab3d_1=tsa(:,:,:,jp_tem), clinfo1=' adv5 - Ta: ', mask1=tmask,               & 
    124124            &          tab3d_2=tsa(:,:,:,jp_sal), clinfo2=       ' Sa: ', mask2=tmask, clinfo3='tra' ) 
    125          CALL tra_adv_qck   ( kt, 'TRA', r2dtra, zun, zvn, zwn, tsb, tsn, tsa, jpts )           
     125         CALL tra_adv_qck   ( kt, nit000, 'TRA', r2dtra, zun, zvn, zwn, tsb, tsn, tsa, jpts )           
    126126         CALL prt_ctl( tab3d_1=tsa(:,:,:,jp_tem), clinfo1=' adv6 - Ta: ', mask1=tmask,               & 
    127127            &          tab3d_2=tsa(:,:,:,jp_sal), clinfo2=       ' Sa: ', mask2=tmask, clinfo3='tra' ) 
  • branches/2011/dev_NOC_UKMO_MERGE/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_cen2.F90

    r2715 r3094  
    5353CONTAINS 
    5454 
    55    SUBROUTINE tra_adv_cen2( kt, cdtype, pun, pvn, pwn,        & 
     55   SUBROUTINE tra_adv_cen2( kt, kit000, cdtype, pun, pvn, pwn,     & 
    5656      &                                 ptb, ptn, pta, kjpt   )  
    5757      !!---------------------------------------------------------------------- 
     
    116116      ! 
    117117      INTEGER                              , INTENT(in   ) ::   kt              ! ocean time-step index 
     118      INTEGER                              , INTENT(in   ) ::   kit000          ! first time step index 
    118119      CHARACTER(len=3)                     , INTENT(in   ) ::   cdtype          ! =TRA or TRC (tracer indicator) 
    119120      INTEGER                              , INTENT(in   ) ::   kjpt            ! number of tracers 
     
    131132      !!---------------------------------------------------------------------- 
    132133 
    133       IF( wrk_in_use(2, 1) .OR. wrk_in_use(3, 1,2) ) THEN 
     134      IF( wrk_in_use(2, 35) .OR. wrk_in_use(3, 14,15) ) THEN 
    134135         CALL ctl_stop('tra_adv_cen2: requested workspace arrays unavailable')   ;   RETURN 
    135136      ENDIF 
    136137 
    137       IF( kt == nit000 )  THEN 
     138      IF( kt == kit000 )  THEN 
    138139         IF(lwp) WRITE(numout,*) 
    139140         IF(lwp) WRITE(numout,*) 'tra_adv_cen2 : 2nd order centered advection scheme on ', cdtype 
     
    141142         IF(lwp) WRITE(numout,*) 
    142143         ! 
    143          ALLOCATE( upsmsk(jpi,jpj), STAT=ierr ) 
    144          IF( ierr /= 0 )   CALL ctl_stop('STOP', 'tra_adv_cen2: unable to allocate array') 
     144         IF (.not. ALLOCATED(upsmsk))THEN 
     145             ALLOCATE( upsmsk(jpi,jpj), STAT=ierr ) 
     146             IF( ierr /= 0 )   CALL ctl_stop('STOP', 'tra_adv_cen2: unable to allocate array') 
     147         ENDIF 
     148 
    145149         ! 
    146150         upsmsk(:,:) = 0._wp                             ! not upstream by default 
     
    275279      ENDIF 
    276280      ! 
    277       IF( wrk_not_released(2, 1)   .OR.   & 
    278           wrk_not_released(3, 1,2) )   CALL ctl_stop('tra_adv_cen2: failed to release workspace arrays') 
     281      IF( wrk_not_released(2, 35)   .OR.   & 
     282          wrk_not_released(3, 14,15) )   CALL ctl_stop('tra_adv_cen2: failed to release workspace arrays') 
    279283      ! 
    280284   END SUBROUTINE tra_adv_cen2 
  • branches/2011/dev_NOC_UKMO_MERGE/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_eiv.F90

    r2715 r3094  
    4545CONTAINS 
    4646 
    47    SUBROUTINE tra_adv_eiv( kt, pun, pvn, pwn, cdtype ) 
     47   SUBROUTINE tra_adv_eiv( kt, kit000, pun, pvn, pwn, cdtype ) 
    4848      !!---------------------------------------------------------------------- 
    4949      !!                  ***  ROUTINE tra_adv_eiv  *** 
     
    6969#endif 
    7070      INTEGER                         , INTENT(in   ) ::   kt       ! ocean time-step index 
     71      INTEGER                         , INTENT(in   ) ::   kit000   ! first time step index 
    7172      CHARACTER(len=3)                , INTENT(in   ) ::   cdtype   ! =TRA or TRC (tracer indicator) 
    7273      REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(inout) ::   pun      ! in : 3 ocean velocity components  
     
    9091      ENDIF 
    9192 
    92       IF( kt == nit000 )  THEN 
     93      IF( kt == kit000 )  THEN 
    9394         IF(lwp) WRITE(numout,*) 
    9495         IF(lwp) WRITE(numout,*) 'tra_adv_eiv : eddy induced advection on ', cdtype,' :' 
     
    203204   !!---------------------------------------------------------------------- 
    204205CONTAINS 
    205    SUBROUTINE tra_adv_eiv( kt, pun, pvn, pwn, cdtype )              ! Empty routine 
     206   SUBROUTINE tra_adv_eiv( kt, kit000, pun, pvn, pwn, cdtype )              ! Empty routine 
    206207      INTEGER  ::   kt     
     208      INTEGER  ::   kit000     
    207209      CHARACTER(len=3) ::   cdtype 
    208210      REAL, DIMENSION(:,:,:) ::   pun, pvn, pwn 
  • branches/2011/dev_NOC_UKMO_MERGE/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_muscl.F90

    r2715 r3094  
    4444CONTAINS 
    4545 
    46    SUBROUTINE tra_adv_muscl( kt, cdtype, p2dt, pun, pvn, pwn, & 
     46   SUBROUTINE tra_adv_muscl( kt, kit000, cdtype, p2dt, pun, pvn, pwn, & 
    4747      &                                        ptb, pta, kjpt ) 
    4848      !!---------------------------------------------------------------------- 
     
    6666      ! 
    6767      INTEGER                              , INTENT(in   ) ::   kt              ! ocean time-step index 
     68      INTEGER                              , INTENT(in   ) ::   kit000          ! first time step index 
    6869      CHARACTER(len=3)                     , INTENT(in   ) ::   cdtype          ! =TRA or TRC (tracer indicator) 
    6970      INTEGER                              , INTENT(in   ) ::   kjpt            ! number of tracers 
     
    8384      ENDIF 
    8485 
    85       IF( kt == nit000 )  THEN 
     86      IF( kt == kit000 )  THEN 
    8687         IF(lwp) WRITE(numout,*) 
    8788         IF(lwp) WRITE(numout,*) 'tra_adv : MUSCL advection scheme on ', cdtype 
  • branches/2011/dev_NOC_UKMO_MERGE/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_muscl2.F90

    r2715 r3094  
    4242CONTAINS 
    4343 
    44    SUBROUTINE tra_adv_muscl2( kt, cdtype, p2dt, pun, pvn, pwn,      & 
     44   SUBROUTINE tra_adv_muscl2( kt, kit000, cdtype, p2dt, pun, pvn, pwn,      & 
    4545      &                                         ptb, ptn, pta, kjpt ) 
    4646      !!---------------------------------------------------------------------- 
     
    6464      !! 
    6565      INTEGER                              , INTENT(in   ) ::   kt              ! ocean time-step index 
     66      INTEGER                              , INTENT(in   ) ::   kit000          ! first time step index 
    6667      CHARACTER(len=3)                     , INTENT(in   ) ::   cdtype          ! =TRA or TRC (tracer indicator) 
    6768      INTEGER                              , INTENT(in   ) ::   kjpt            ! number of tracers 
     
    8182      ENDIF 
    8283 
    83       IF( kt == nit000 )  THEN 
     84      IF( kt == kit000 )  THEN 
    8485         IF(lwp) WRITE(numout,*) 
    8586         IF(lwp) WRITE(numout,*) 'tra_adv_muscl2 : MUSCL2 advection scheme on ', cdtype 
  • branches/2011/dev_NOC_UKMO_MERGE/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_qck.F90

    r2715 r3094  
    4545CONTAINS 
    4646 
    47    SUBROUTINE tra_adv_qck ( kt, cdtype, p2dt, pun, pvn, pwn,      & 
     47   SUBROUTINE tra_adv_qck ( kt, kit000, cdtype, p2dt, pun, pvn, pwn,      & 
    4848      &                                       ptb, ptn, pta, kjpt ) 
    4949      !!---------------------------------------------------------------------- 
     
    8282      !!---------------------------------------------------------------------- 
    8383      INTEGER                              , INTENT(in   ) ::   kt              ! ocean time-step index 
     84      INTEGER                              , INTENT(in   ) ::   kit000          ! first time step index 
    8485      CHARACTER(len=3)                     , INTENT(in   ) ::   cdtype          ! =TRA or TRC (tracer indicator) 
    8586      INTEGER                              , INTENT(in   ) ::   kjpt            ! number of tracers 
     
    9091      !!---------------------------------------------------------------------- 
    9192 
    92       IF( kt == nit000 )  THEN 
     93      IF( kt == kit000 )  THEN 
    9394         IF(lwp) WRITE(numout,*) 
    9495         IF(lwp) WRITE(numout,*) 'tra_adv_qck : 3rd order quickest advection scheme on ', cdtype 
  • branches/2011/dev_NOC_UKMO_MERGE/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_tvd.F90

    r2715 r3094  
    5151CONTAINS 
    5252 
    53    SUBROUTINE tra_adv_tvd ( kt, cdtype, p2dt, pun, pvn, pwn,      & 
     53   SUBROUTINE tra_adv_tvd ( kt, kit000, cdtype, p2dt, pun, pvn, pwn,      & 
    5454      &                                       ptb, ptn, pta, kjpt ) 
    5555      !!---------------------------------------------------------------------- 
     
    7171      ! 
    7272      INTEGER                              , INTENT(in   ) ::   kt              ! ocean time-step index 
     73      INTEGER                              , INTENT(in   ) ::   kit000          ! first time step index 
    7374      CHARACTER(len=3)                     , INTENT(in   ) ::   cdtype          ! =TRA or TRC (tracer indicator) 
    7475      INTEGER                              , INTENT(in   ) ::   kjpt            ! number of tracers 
     
    8990      ENDIF 
    9091 
    91       IF( kt == nit000 )  THEN 
     92      IF( kt == kit000 )  THEN 
    9293         IF(lwp) WRITE(numout,*) 
    9394         IF(lwp) WRITE(numout,*) 'tra_adv_tvd : TVD advection scheme on ', cdtype 
  • branches/2011/dev_NOC_UKMO_MERGE/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_ubs.F90

    r2715 r3094  
    4040CONTAINS 
    4141 
    42    SUBROUTINE tra_adv_ubs ( kt, cdtype, p2dt, pun, pvn, pwn,      & 
     42   SUBROUTINE tra_adv_ubs ( kt, kit000, cdtype, p2dt, pun, pvn, pwn,      & 
    4343      &                                       ptb, ptn, pta, kjpt ) 
    4444      !!---------------------------------------------------------------------- 
     
    8080      ! 
    8181      INTEGER                              , INTENT(in   ) ::   kt              ! ocean time-step index 
     82      INTEGER                              , INTENT(in   ) ::   kit000          ! first time step index 
    8283      CHARACTER(len=3)                     , INTENT(in   ) ::   cdtype          ! =TRA or TRC (tracer indicator) 
    8384      INTEGER                              , INTENT(in   ) ::   kjpt            ! number of tracers 
     
    9798      ENDIF 
    9899 
    99       IF( kt == nit000 )  THEN 
     100      IF( kt == kit000 )  THEN 
    100101         IF(lwp) WRITE(numout,*) 
    101102         IF(lwp) WRITE(numout,*) 'tra_adv_ubs :  horizontal UBS advection scheme on ', cdtype 
  • branches/2011/dev_NOC_UKMO_MERGE/NEMOGCM/NEMO/OPA_SRC/TRA/trabbl.F90

    r2715 r3094  
    106106      !!---------------------------------------------------------------------- 
    107107 
    108       IF( l_trdtra )   THEN                    !* Save ta and sa trends 
     108      IF( l_trdtra )   THEN                        !* Save ta and sa trends 
    109109         ALLOCATE( ztrdt(jpi,jpj,jpk) )   ;    ztrdt(:,:,:) = tsa(:,:,:,jp_tem)  
    110110         ALLOCATE( ztrds(jpi,jpj,jpk) )   ;    ztrds(:,:,:) = tsa(:,:,:,jp_sal) 
    111111      ENDIF 
    112112 
    113       IF( l_bbl )   CALL bbl( kt, 'TRA' )       !* bbl coef. and transport (only if not already done in trcbbl) 
    114  
    115  
    116       IF( nn_bbl_ldf == 1 ) THEN                !* Diffusive bbl 
     113      IF( l_bbl )  CALL bbl( kt, nit000, 'TRA' )   !* bbl coef. and transport (only if not already done in trcbbl) 
     114 
     115 
     116      IF( nn_bbl_ldf == 1 ) THEN                   !* Diffusive bbl 
    117117         CALL tra_bbl_dif( tsb, tsa, jpts ) 
    118118         IF( ln_ctl )  & 
     
    311311 
    312312 
    313    SUBROUTINE bbl( kt, cdtype ) 
     313   SUBROUTINE bbl( kt, kit000, cdtype ) 
    314314      !!---------------------------------------------------------------------- 
    315315      !!                  ***  ROUTINE bbl  *** 
     
    343343      ! 
    344344      INTEGER         , INTENT(in   ) ::   kt       ! ocean time-step index 
     345      INTEGER         , INTENT(in   ) ::   kit000          ! first time step index 
    345346      CHARACTER(len=3), INTENT(in   ) ::   cdtype   ! =TRA or TRC (tracer indicator) 
    346347      !! 
     
    389390      ENDIF 
    390391      
    391       IF( kt == nit000 )  THEN 
     392      IF( kt == kit000 )  THEN 
    392393         IF(lwp)  WRITE(numout,*) 
    393394         IF(lwp)  WRITE(numout,*) 'trabbl:bbl : Compute bbl velocities and diffusive coefficients in ', cdtype 
     
    537538      !! 
    538539      !! ** Method  :   Read the nambbl namelist and check the parameters 
    539       !!              called by nemo_init at the first timestep (nit000) 
     540      !!              called by nemo_init at the first timestep (kit000) 
    540541      !!---------------------------------------------------------------------- 
    541542      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released 
  • branches/2011/dev_NOC_UKMO_MERGE/NEMOGCM/NEMO/OPA_SRC/TRA/traldf.F90

    r2715 r3094  
    6868 
    6969      SELECT CASE ( nldf )                       ! compute lateral mixing trend and add it to the general trend 
    70       CASE ( 0 )   ;   CALL tra_ldf_lap     ( kt, 'TRA', gtsu, gtsv, tsb, tsa, jpts        )  ! iso-level laplacian 
     70      CASE ( 0 )   ;   CALL tra_ldf_lap     ( kt, nit000, 'TRA', gtsu, gtsv, tsb, tsa, jpts        )  ! iso-level laplacian 
    7171      CASE ( 1 )                                                                              ! rotated laplacian 
    7272         IF( ln_traldf_grif ) THEN                                                           
    73                        CALL tra_ldf_iso_grif( kt, 'TRA', gtsu, gtsv, tsb, tsa, jpts, ahtb0 )      ! Griffies operator 
     73                       CALL tra_ldf_iso_grif( kt, nit000,'TRA', gtsu, gtsv, tsb, tsa, jpts, ahtb0 )      ! Griffies operator 
    7474         ELSE                                                                                 
    75                        CALL tra_ldf_iso     ( kt, 'TRA', gtsu, gtsv, tsb, tsa, jpts, ahtb0 )      ! Madec operator 
    76          ENDIF 
    77       CASE ( 2 )   ;   CALL tra_ldf_bilap   ( kt, 'TRA', gtsu, gtsv, tsb, tsa, jpts        )  ! iso-level bilaplacian 
    78       CASE ( 3 )   ;   CALL tra_ldf_bilapg  ( kt, 'TRA',             tsb, tsa, jpts        )  ! s-coord. geopot. bilap. 
     75                       CALL tra_ldf_iso     ( kt, nit000, 'TRA', gtsu, gtsv, tsb, tsa, jpts, ahtb0 )      ! Madec operator 
     76         ENDIF 
     77      CASE ( 2 )   ;   CALL tra_ldf_bilap   ( kt, nit000, 'TRA', gtsu, gtsv, tsb, tsa, jpts        )  ! iso-level bilaplacian 
     78      CASE ( 3 )   ;   CALL tra_ldf_bilapg  ( kt, nit000, 'TRA',             tsb, tsa, jpts        )  ! s-coord. geopot. bilap. 
    7979         ! 
    8080      CASE ( -1 )                                ! esopa: test all possibility with control print 
    81          CALL tra_ldf_lap   ( kt, 'TRA', gtsu, gtsv, tsb, tsa, jpts        )  
     81         CALL tra_ldf_lap   ( kt, nit000, 'TRA', gtsu, gtsv, tsb, tsa, jpts        )  
    8282         CALL prt_ctl( tab3d_1=tsa(:,:,:,jp_tem), clinfo1=' ldf0 - Ta: ', mask1=tmask,               & 
    8383         &             tab3d_2=tsa(:,:,:,jp_sal), clinfo2=       ' Sa: ', mask2=tmask, clinfo3='tra' ) 
    8484         IF( ln_traldf_grif ) THEN 
    85             CALL tra_ldf_iso_grif( kt, 'TRA', gtsu, gtsv, tsb, tsa, jpts, ahtb0 ) 
     85            CALL tra_ldf_iso_grif( kt, nit000, 'TRA', gtsu, gtsv, tsb, tsa, jpts, ahtb0 ) 
    8686         ELSE 
    87             CALL tra_ldf_iso     ( kt, 'TRA', gtsu, gtsv, tsb, tsa, jpts, ahtb0 )   
     87            CALL tra_ldf_iso     ( kt, nit000, 'TRA', gtsu, gtsv, tsb, tsa, jpts, ahtb0 )   
    8888         ENDIF 
    8989         CALL prt_ctl( tab3d_1=tsa(:,:,:,jp_tem), clinfo1=' ldf1 - Ta: ', mask1=tmask,               & 
    9090         &             tab3d_2=tsa(:,:,:,jp_sal), clinfo2=       ' Sa: ', mask2=tmask, clinfo3='tra' ) 
    91          CALL tra_ldf_bilap ( kt, 'TRA', gtsu, gtsv, tsb, tsa, jpts        )  
     91         CALL tra_ldf_bilap ( kt, nit000, 'TRA', gtsu, gtsv, tsb, tsa, jpts        )  
    9292         CALL prt_ctl( tab3d_1=tsa(:,:,:,jp_tem), clinfo1=' ldf2 - Ta: ', mask1=tmask,               & 
    9393         &             tab3d_2=tsa(:,:,:,jp_sal), clinfo2=       ' Sa: ', mask2=tmask, clinfo3='tra' ) 
    94          CALL tra_ldf_bilapg( kt, 'TRA',             tsb, tsa, jpts        )  
     94         CALL tra_ldf_bilapg( kt, nit000, 'TRA',             tsb, tsa, jpts        )  
    9595         CALL prt_ctl( tab3d_1=tsa(:,:,:,jp_tem), clinfo1=' ldf3 - Ta: ', mask1=tmask,               & 
    9696         &             tab3d_2=tsa(:,:,:,jp_sal), clinfo2=       ' Sa: ', mask2=tmask, clinfo3='tra' ) 
     
    297297      ! Compute the ldf trends 
    298298      ! ---------------------- 
    299       CALL tra_ldf( nit000+1 )      ! horizontal components (+1: no more init) 
    300       CALL tra_zdf( nit000   )      ! vertical component (if necessary nit000 to performed the init) 
     299      CALL tra_ldf( nit000 + 1 )      ! horizontal components (+1: no more init) 
     300      CALL tra_zdf( nit000     )      ! vertical component (if necessary nit000 to performed the init) 
    301301 
    302302      ! finalise the computation and recover all arrays 
  • branches/2011/dev_NOC_UKMO_MERGE/NEMOGCM/NEMO/OPA_SRC/TRA/traldf_bilap.F90

    r2715 r3094  
    4747CONTAINS 
    4848  
    49    SUBROUTINE tra_ldf_bilap( kt, cdtype, pgu, pgv,      & 
     49   SUBROUTINE tra_ldf_bilap( kt, kit000, cdtype, pgu, pgv,      & 
    5050      &                                  ptb, pta, kjpt )   
    5151      !!---------------------------------------------------------------------- 
     
    7979      !! 
    8080      INTEGER                              , INTENT(in   ) ::   kt         ! ocean time-step index 
     81      INTEGER                              , INTENT(in   ) ::   kit000          ! first time step index 
    8182      CHARACTER(len=3)                     , INTENT(in   ) ::   cdtype     ! =TRA or TRC (tracer indicator) 
    8283      INTEGER                              , INTENT(in   ) ::   kjpt       ! number of tracers 
     
    9394      ENDIF 
    9495 
    95       IF( kt == nit000 )  THEN 
     96      IF( kt == kit000 )  THEN 
    9697         IF(lwp) WRITE(numout,*) 
    9798         IF(lwp) WRITE(numout,*) 'tra_ldf_bilap : iso-level biharmonic operator on ', cdtype 
  • branches/2011/dev_NOC_UKMO_MERGE/NEMOGCM/NEMO/OPA_SRC/TRA/traldf_bilapg.F90

    r2715 r3094  
    4242CONTAINS 
    4343 
    44    SUBROUTINE tra_ldf_bilapg( kt, cdtype, ptb, pta, kjpt ) 
     44   SUBROUTINE tra_ldf_bilapg( kt, kit000, cdtype, ptb, pta, kjpt ) 
    4545      !!---------------------------------------------------------------------- 
    4646      !!                 ***  ROUTINE tra_ldf_bilapg  *** 
     
    7070      ! 
    7171      INTEGER         , INTENT(in   )                      ::   kt       ! ocean time-step index 
     72      INTEGER         , INTENT(in   )                      ::   kit000   ! first time step index 
    7273      CHARACTER(len=3), INTENT(in   )                      ::   cdtype   ! =TRA or TRC (tracer indicator) 
    7374      INTEGER         , INTENT(in   )                      ::   kjpt     ! number of tracers 
     
    8283      ENDIF 
    8384 
    84       IF( kt == nit000 )  THEN 
     85      IF( kt == kit000 )  THEN 
    8586         IF(lwp) WRITE(numout,*) 
    8687         IF(lwp) WRITE(numout,*) 'tra_ldf_bilapg : horizontal biharmonic operator in s-coordinate on ', cdtype 
     
    345346   !!---------------------------------------------------------------------- 
    346347CONTAINS 
    347    SUBROUTINE tra_ldf_bilapg( kt, cdtype, ptb, pta, kjpt )      ! Empty routine 
     348   SUBROUTINE tra_ldf_bilapg( kt, kit000, cdtype, ptb, pta, kjpt )      ! Empty routine 
     349      INTEGER :: kt, kit000 
    348350      CHARACTER(len=3) ::   cdtype 
    349351      REAL, DIMENSION(:,:,:,:) ::   ptb, pta 
    350       WRITE(*,*) 'tra_ldf_iso: You should not have seen this print! error?', kt, cdtype, ptb(1,1,1,1), pta(1,1,1,1), kjpt 
     352      WRITE(*,*) 'tra_ldf_iso: You should not have seen this print! error?', & 
     353        &         kt, kit000, cdtype, ptb(1,1,1,1), pta(1,1,1,1), kjpt 
    351354   END SUBROUTINE tra_ldf_bilapg 
    352355#endif 
  • branches/2011/dev_NOC_UKMO_MERGE/NEMOGCM/NEMO/OPA_SRC/TRA/traldf_iso.F90

    r2715 r3094  
    4949CONTAINS 
    5050 
    51    SUBROUTINE tra_ldf_iso( kt, cdtype, pgu, pgv,              & 
     51   SUBROUTINE tra_ldf_iso( kt, kit000, cdtype, pgu, pgv,              & 
    5252      &                                ptb, pta, kjpt, pahtb0 ) 
    5353      !!---------------------------------------------------------------------- 
     
    9696      ! 
    9797      INTEGER                              , INTENT(in   ) ::   kt         ! ocean time-step index 
     98      INTEGER                              , INTENT(in   ) ::   kit000          ! first time step index 
    9899      CHARACTER(len=3)                     , INTENT(in   ) ::   cdtype     ! =TRA or TRC (tracer indicator) 
    99100      INTEGER                              , INTENT(in   ) ::   kjpt       ! number of tracers 
     
    116117      ENDIF 
    117118 
    118       IF( kt == nit000 )  THEN 
     119      IF( kt == kit000 )  THEN 
    119120         IF(lwp) WRITE(numout,*) 
    120121         IF(lwp) WRITE(numout,*) 'tra_ldf_iso : rotated laplacian diffusion operator on ', cdtype 
     
    301302   !!---------------------------------------------------------------------- 
    302303CONTAINS 
    303    SUBROUTINE tra_ldf_iso( kt, cdtype, pgu, pgv, ptb, pta, kjpt, pahtb0 )      ! Empty routine 
     304   SUBROUTINE tra_ldf_iso( kt, kit000,cdtype, pgu, pgv, ptb, pta, kjpt, pahtb0 )      ! Empty routine 
     305      INTEGER:: kt, kit000 
    304306      CHARACTER(len=3) ::   cdtype 
    305307      REAL, DIMENSION(:,:,:) ::   pgu, pgv   ! tracer gradient at pstep levels 
    306308      REAL, DIMENSION(:,:,:,:) ::   ptb, pta 
    307       WRITE(*,*) 'tra_ldf_iso: You should not have seen this print! error?', kt, cdtype, pgu(1,1,1), pgv(1,1,1),   & 
    308          &                                                             ptb(1,1,1,1), pta(1,1,1,1), kjpt, pahtb0 
     309      WRITE(*,*) 'tra_ldf_iso: You should not have seen this print! error?', kt, kit000, cdtype,   & 
     310         &                       pgu(1,1,1), pgv(1,1,1), ptb(1,1,1,1), pta(1,1,1,1), kjpt, pahtb0 
    309311   END SUBROUTINE tra_ldf_iso 
    310312#endif 
  • branches/2011/dev_NOC_UKMO_MERGE/NEMOGCM/NEMO/OPA_SRC/TRA/traldf_iso_grif.F90

    r2715 r3094  
    4848CONTAINS 
    4949 
    50   SUBROUTINE tra_ldf_iso_grif( kt, cdtype, pgu, pgv,              & 
     50  SUBROUTINE tra_ldf_iso_grif( kt, kit000, cdtype, pgu, pgv,              & 
    5151       &                                   ptb, pta, kjpt, pahtb0 ) 
    5252      !!---------------------------------------------------------------------- 
     
    9595      ! 
    9696      INTEGER                              , INTENT(in   ) ::   kt         ! ocean time-step index 
     97      INTEGER                              , INTENT(in   ) ::   kit000          ! first time step index 
    9798      CHARACTER(len=3)                     , INTENT(in   ) ::   cdtype     ! =TRA or TRC (tracer indicator) 
    9899      INTEGER                              , INTENT(in   ) ::   kjpt       ! number of tracers 
     
    127128      !zdkt(1:jpi,1:jpj,0:1) => wrk_3d_9(:,:,1:2) 
    128129 
    129       IF( kt == nit000 )  THEN 
     130      IF( kt == kit000 )  THEN 
    130131         IF(lwp) WRITE(numout,*) 
    131132         IF(lwp) WRITE(numout,*) 'tra_ldf_iso_grif : rotated laplacian diffusion operator on ', cdtype 
    132133         IF(lwp) WRITE(numout,*) '                   WARNING: STILL UNDER TEST, NOT RECOMMENDED. USE AT YOUR OWN PERIL' 
    133134         IF(lwp) WRITE(numout,*) '~~~~~~~~~~~' 
    134          ALLOCATE( ah_wslp2(jpi,jpj,jpk) , zdkt(jpi,jpj,0:1), STAT=ierr ) 
     135         IF (.not. ALLOCATED(ah_wslp2))THEN 
     136             ALLOCATE( ah_wslp2(jpi,jpj,jpk) , zdkt(jpi,jpj,0:1), STAT=ierr ) 
     137         ENDIF 
    135138         IF( lk_mpp   )   CALL mpp_sum ( ierr ) 
    136139         IF( ierr > 0 )   CALL ctl_stop('STOP', 'tra_ldf_iso_grif: unable to allocate arrays') 
    137140         IF( ln_traldf_gdia ) THEN 
    138             ALLOCATE( psix_eiv(jpi,jpj,jpk) , psiy_eiv(jpi,jpj,jpk) , STAT=ierr ) 
    139             IF( lk_mpp   )   CALL mpp_sum ( ierr ) 
    140             IF( ierr > 0 )   CALL ctl_stop('STOP', 'tra_ldf_iso_grif: unable to allocate diagnostics') 
     141            IF (.not. ALLOCATED(psix_eiv))THEN 
     142                ALLOCATE( psix_eiv(jpi,jpj,jpk) , psiy_eiv(jpi,jpj,jpk) , STAT=ierr ) 
     143                IF( lk_mpp   )   CALL mpp_sum ( ierr ) 
     144                IF( ierr > 0 )   CALL ctl_stop('STOP', 'tra_ldf_iso_grif: unable to allocate diagnostics') 
     145            ENDIF 
    141146         ENDIF 
    142147      ENDIF 
  • branches/2011/dev_NOC_UKMO_MERGE/NEMOGCM/NEMO/OPA_SRC/TRA/traldf_lap.F90

    r2715 r3094  
    4444CONTAINS 
    4545 
    46    SUBROUTINE tra_ldf_lap( kt, cdtype, pgu, pgv,      & 
     46   SUBROUTINE tra_ldf_lap( kt, kit000, cdtype, pgu, pgv,      & 
    4747      &                                ptb, pta, kjpt )  
    4848      !!---------------------------------------------------------------------- 
     
    6666      ! 
    6767      INTEGER                              , INTENT(in   ) ::   kt         ! ocean time-step index 
     68      INTEGER                              , INTENT(in   ) ::   kit000          ! first time step index 
    6869      CHARACTER(len=3)                     , INTENT(in   ) ::   cdtype     ! =TRA or TRC (tracer indicator) 
    6970      INTEGER                              , INTENT(in   ) ::   kjpt       ! number of tracers 
     
    7778      !!---------------------------------------------------------------------- 
    7879       
    79       IF( kt == nit000 )  THEN 
     80      IF( kt == kit000 )  THEN 
    8081         IF(lwp) WRITE(numout,*) 
    8182         IF(lwp) WRITE(numout,*) 'tra_ldf_lap : iso-level laplacian diffusion on ', cdtype 
  • branches/2011/dev_NOC_UKMO_MERGE/NEMOGCM/NEMO/OPA_SRC/TRA/tranxt.F90

    r2715 r3094  
    3636   USE obc_oce 
    3737   USE obctra          ! open boundary condition (obc_tra routine) 
    38    USE bdy_par         ! Unstructured open boundary condition (bdy_tra_frs routine) 
    39    USE bdytra          ! Unstructured open boundary condition (bdy_tra_frs routine) 
     38   USE bdy_oce 
     39   USE bdytra          ! open boundary condition (bdy_tra routine) 
    4040   USE in_out_manager  ! I/O manager 
    4141   USE lbclnk          ! ocean lateral boundary conditions (or mpp link) 
     
    4343   USE traqsr          ! penetrative solar radiation (needed for nksr) 
    4444   USE traswp          ! swap array 
    45    USE obc_oce  
    4645#if defined key_agrif 
    4746   USE agrif_opa_update 
     
    8180      !!              - Apply lateral boundary conditions on (ta,sa)  
    8281      !!             at the local domain   boundaries through lbc_lnk call,  
    83       !!             at the radiative open boundaries (lk_obc=T),  
    84       !!             at the relaxed   open boundaries (lk_bdy=T), and 
     82      !!             at the one-way open boundaries (lk_obc=T),  
    8583      !!             at the AGRIF zoom     boundaries (lk_agrif=T) 
    8684      !! 
     
    119117#endif 
    120118#if defined key_bdy  
    121       IF( lk_bdy )   CALL bdy_tra_frs( kt )  ! BDY open boundaries 
     119      IF( lk_bdy )   CALL bdy_tra( kt )  ! BDY open boundaries 
    122120#endif 
    123121#if defined key_agrif 
     
    148146      ELSE                                            ! Leap-Frog + Asselin filter time stepping 
    149147         ! 
    150          IF( lk_vvl )  THEN   ;   CALL tra_nxt_vvl( kt, 'TRA', tsb, tsn, tsa, jpts )  ! variable volume level (vvl)      
    151          ELSE                 ;   CALL tra_nxt_fix( kt, 'TRA', tsb, tsn, tsa, jpts )  ! fixed    volume level  
     148         IF( lk_vvl )  THEN   ;   CALL tra_nxt_vvl( kt, nit000, 'TRA', tsb, tsn, tsa, jpts )  ! variable volume level (vvl)      
     149         ELSE                 ;   CALL tra_nxt_fix( kt, nit000, 'TRA', tsb, tsn, tsa, jpts )  ! fixed    volume level  
    152150         ENDIF 
    153151      ENDIF  
     
    179177 
    180178 
    181    SUBROUTINE tra_nxt_fix( kt, cdtype, ptb, ptn, pta, kjpt ) 
     179   SUBROUTINE tra_nxt_fix( kt, kit000, cdtype, ptb, ptn, pta, kjpt ) 
    182180      !!---------------------------------------------------------------------- 
    183181      !!                   ***  ROUTINE tra_nxt_fix  *** 
     
    203201      !!---------------------------------------------------------------------- 
    204202      INTEGER         , INTENT(in   )                               ::   kt       ! ocean time-step index 
     203      INTEGER         , INTENT(in   )                               ::   kit000   ! first time step index 
    205204      CHARACTER(len=3), INTENT(in   )                               ::   cdtype   ! =TRA or TRC (tracer indicator) 
    206205      INTEGER         , INTENT(in   )                               ::   kjpt     ! number of tracers 
     
    214213      !!---------------------------------------------------------------------- 
    215214 
    216       IF( kt == nit000 )  THEN 
     215      IF( kt == kit000 )  THEN 
    217216         IF(lwp) WRITE(numout,*) 
    218          IF(lwp) WRITE(numout,*) 'tra_nxt_fix : time stepping' 
     217         IF(lwp) WRITE(numout,*) 'tra_nxt_fix : time stepping', cdtype 
    219218         IF(lwp) WRITE(numout,*) '~~~~~~~~~~~' 
    220219      ENDIF 
     
    245244 
    246245 
    247    SUBROUTINE tra_nxt_vvl( kt, cdtype, ptb, ptn, pta, kjpt ) 
     246   SUBROUTINE tra_nxt_vvl( kt, kit000, cdtype, ptb, ptn, pta, kjpt ) 
    248247      !!---------------------------------------------------------------------- 
    249248      !!                   ***  ROUTINE tra_nxt_vvl  *** 
     
    270269      !!---------------------------------------------------------------------- 
    271270      INTEGER         , INTENT(in   )                               ::   kt       ! ocean time-step index 
     271      INTEGER         , INTENT(in   )                               ::   kit000   ! first time step index 
    272272      CHARACTER(len=3), INTENT(in   )                               ::   cdtype   ! =TRA or TRC (tracer indicator) 
    273273      INTEGER         , INTENT(in   )                               ::   kjpt     ! number of tracers 
     
    282282      !!---------------------------------------------------------------------- 
    283283 
    284       IF( kt == nit000 ) THEN 
     284      IF( kt == kit000 ) THEN 
    285285         IF(lwp) WRITE(numout,*) 
    286          IF(lwp) WRITE(numout,*) 'tra_nxt_vvl : time stepping' 
     286         IF(lwp) WRITE(numout,*) 'tra_nxt_vvl : time stepping', cdtype 
    287287         IF(lwp) WRITE(numout,*) '~~~~~~~~~~~' 
    288288      ENDIF 
  • branches/2011/dev_NOC_UKMO_MERGE/NEMOGCM/NEMO/OPA_SRC/TRA/trazdf.F90

    r2715 r3094  
    7676 
    7777      SELECT CASE ( nzdf )                       ! compute lateral mixing trend and add it to the general trend 
    78       CASE ( 0 )    ;    CALL tra_zdf_exp( kt, 'TRA', r2dtra, nn_zdfexp, tsb, tsa, jpts )  !   explicit scheme  
    79       CASE ( 1 )    ;    CALL tra_zdf_imp( kt, 'TRA', r2dtra,            tsb, tsa, jpts )  !   implicit scheme  
     78      CASE ( 0 )    ;    CALL tra_zdf_exp( kt, nit000, 'TRA', r2dtra, nn_zdfexp, tsb, tsa, jpts )  !   explicit scheme  
     79      CASE ( 1 )    ;    CALL tra_zdf_imp( kt, nit000, 'TRA', r2dtra,            tsb, tsa, jpts )  !   implicit scheme  
    8080      CASE ( -1 )                                       ! esopa: test all possibility with control print 
    81          CALL tra_zdf_exp( kt, 'TRA', r2dtra, nn_zdfexp, tsb, tsa, jpts ) 
     81         CALL tra_zdf_exp( kt, nit000, 'TRA', r2dtra, nn_zdfexp, tsb, tsa, jpts ) 
    8282         CALL prt_ctl( tab3d_1=tsa(:,:,:,jp_tem), clinfo1=' zdf0 - Ta: ', mask1=tmask,               & 
    8383         &             tab3d_2=tsa(:,:,:,jp_sal), clinfo2=       ' Sa: ', mask2=tmask, clinfo3='tra' ) 
    84          CALL tra_zdf_imp( kt, 'TRA', r2dtra,            tsb, tsa, jpts )  
     84         CALL tra_zdf_imp( kt, nit000, 'TRA', r2dtra,            tsb, tsa, jpts )  
    8585         CALL prt_ctl( tab3d_1=tsa(:,:,:,jp_tem), clinfo1=' zdf1 - Ta: ', mask1=tmask,               & 
    8686         &             tab3d_2=tsa(:,:,:,jp_sal), clinfo2=       ' Sa: ', mask2=tmask, clinfo3='tra' ) 
  • branches/2011/dev_NOC_UKMO_MERGE/NEMOGCM/NEMO/OPA_SRC/TRA/trazdf_exp.F90

    r2715 r3094  
    4848CONTAINS 
    4949 
    50    SUBROUTINE tra_zdf_exp( kt, cdtype, p2dt, kn_zdfexp,   & 
     50   SUBROUTINE tra_zdf_exp( kt, kit000, cdtype, p2dt, kn_zdfexp,   & 
    5151      &                                ptb , pta      , kjpt ) 
    5252      !!---------------------------------------------------------------------- 
     
    7777      ! 
    7878      INTEGER                              , INTENT(in   ) ::   kt          ! ocean time-step index 
     79      INTEGER                              , INTENT(in   ) ::   kit000      ! first time step index 
    7980      CHARACTER(len=3)                     , INTENT(in   ) ::   cdtype      ! =TRA or TRC (tracer indicator) 
    8081      INTEGER                              , INTENT(in   ) ::   kjpt        ! number of tracers 
     
    9394      ENDIF 
    9495 
    95       IF( kt == nit000 )  THEN 
     96      IF( kt == kit000 )  THEN 
    9697         IF(lwp) WRITE(numout,*) 
    9798         IF(lwp) WRITE(numout,*) 'tra_zdf_exp : explicit vertical mixing on ', cdtype 
  • branches/2011/dev_NOC_UKMO_MERGE/NEMOGCM/NEMO/OPA_SRC/TRA/trazdf_imp.F90

    r2715 r3094  
    5555CONTAINS 
    5656  
    57    SUBROUTINE tra_zdf_imp( kt, cdtype, p2dt, ptb, pta, kjpt )  
     57   SUBROUTINE tra_zdf_imp( kt, kit000, cdtype, p2dt, ptb, pta, kjpt )  
    5858      !!---------------------------------------------------------------------- 
    5959      !!                  ***  ROUTINE tra_zdf_imp  *** 
     
    7979      ! 
    8080      INTEGER                              , INTENT(in   ) ::   kt       ! ocean time-step index 
     81      INTEGER                              , INTENT(in   ) ::   kit000          ! first time step index 
    8182      CHARACTER(len=3)                     , INTENT(in   ) ::   cdtype   ! =TRA or TRC (tracer indicator) 
    8283      INTEGER                              , INTENT(in   ) ::   kjpt     ! number of tracers 
     
    9394      ENDIF 
    9495 
    95       IF( kt == nit000 )  THEN 
     96      IF( kt == kit000 )  THEN 
    9697         IF(lwp)WRITE(numout,*) 
    9798         IF(lwp)WRITE(numout,*) 'tra_zdf_imp : implicit vertical mixing on ', cdtype 
  • branches/2011/dev_NOC_UKMO_MERGE/NEMOGCM/NEMO/OPA_SRC/nemogcm.F90

    r2715 r3094  
    2727   !!            3.3  ! 2010-05  (K. Mogensen, A. Weaver, M. Martin, D. Lea) Assimilation interface  
    2828   !!             -   ! 2010-10  (C. Ethe, G. Madec) reorganisation of initialisation phase 
    29    !!            4.0  ! 2011-01  (A. R. Porter, STFC Daresbury) dynamical allocation 
     29   !!            3.3.1! 2011-01  (A. R. Porter, STFC Daresbury) dynamical allocation 
     30   !!            3.4  ! 2011-11  (C. Harris) decomposition changes for running with CICE 
    3031   !!---------------------------------------------------------------------- 
    3132 
     
    4647   USE domain          ! domain initialization             (dom_init routine) 
    4748   USE obcini          ! open boundary cond. initialization (obc_ini routine) 
    48    USE bdyini          ! unstructured open boundary cond. initialization (bdy_init routine) 
     49   USE bdyini          ! open boundary cond. initialization (bdy_init routine) 
     50   USE bdydta          ! open boundary cond. initialization (bdy_dta_init routine) 
     51   USE bdytides        ! open boundary cond. initialization (tide_init routine) 
    4952   USE istate          ! initial state setting          (istate_init routine) 
    5053   USE ldfdyn          ! lateral viscosity setting      (ldfdyn_init routine) 
     
    245248      IF( Agrif_Root() ) THEN 
    246249         jpi = ( jpiglo-2*jpreci + (jpni-1) ) / jpni + 2*jpreci   ! first  dim. 
     250#if defined key_nemocice_decomp 
     251         jpj = ( jpjglo+1-2*jprecj + (jpnj-1) ) / jpnj + 2*jprecj ! second dim.  
     252#else 
    247253         jpj = ( jpjglo-2*jprecj + (jpnj-1) ) / jpnj + 2*jprecj   ! second dim. 
     254#endif 
    248255         jpk = jpkdta                                             ! third dim 
    249256         jpim1 = jpi-1                                            ! inner domain indices 
     
    295302 
    296303      IF( lk_obc        )   CALL     obc_init   ! Open boundaries  
    297       IF( lk_bdy        )   CALL     bdy_init   ! Unstructured open boundaries 
     304      IF( lk_bdy        )   CALL     bdy_init       ! Open boundaries initialisation 
     305      IF( lk_bdy        )   CALL     bdy_dta_init   ! Open boundaries initialisation of external data arrays 
     306      IF( lk_bdy        )   CALL     tide_init      ! Open boundaries initialisation of tidal harmonic forcing 
    298307 
    299308                            CALL  istate_init   ! ocean initial state (Dynamics and tracers) 
  • branches/2011/dev_NOC_UKMO_MERGE/NEMOGCM/NEMO/OPA_SRC/oce.F90

    r2715 r3094  
    3535   !! free surface                                      !  before  ! now    ! after  ! 
    3636   !! ------------                                      !  fields  ! fields ! trends ! 
    37    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   sshb   , sshn   , ssha   !: sea surface height at t-point [m] 
    38    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   sshu_b , sshu_n , sshu_a !: sea surface height at u-point [m] 
    39    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   sshv_b , sshv_n , sshv_a !: sea surface height at u-point [m] 
    40    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::            sshf_n          !: sea surface height at f-point [m] 
     37   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:), TARGET ::   sshb   , sshn   , ssha   !: sea surface height at t-point [m] 
     38   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)         ::   sshu_b , sshu_n , sshu_a !: sea surface height at u-point [m] 
     39   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)         ::   sshv_b , sshv_n , sshv_a !: sea surface height at u-point [m] 
     40   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)         ::            sshf_n          !: sea surface height at f-point [m] 
    4141   ! 
    4242   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   spgu, spgv               !: horizontal surface pressure gradient 
  • branches/2011/dev_NOC_UKMO_MERGE/NEMOGCM/NEMO/OPA_SRC/par_oce.F90

    r2715 r3094  
    8181   !!--------------------------------------------------------------------- 
    8282#             include "par_POMME_R025.h90" 
     83#elif defined key_amm_12km 
     84   !!--------------------------------------------------------------------- 
     85   !!   'key_amm_12km':                    Atlantic Margin Model : AMM12km  
     86   !!--------------------------------------------------------------------- 
     87#             include "par_AMM_12km.h90" 
    8388#else 
    8489   !!--------------------------------------------------------------------- 
  • branches/2011/dev_NOC_UKMO_MERGE/NEMOGCM/NEMO/OPA_SRC/step.F90

    r2715 r3094  
    9999      IF( lk_obc     )   CALL obc_dta( kstp )         ! update dynamic and tracer data at open boundaries 
    100100      IF( lk_obc     )   CALL obc_rad( kstp )         ! compute phase velocities at open boundaries 
    101       IF( lk_bdy     )   CALL bdy_dta_frs( kstp )     ! update dynamic and tracer data for FRS conditions (BDY) 
     101      IF( lk_bdy     )   CALL bdy_dta( kstp, time_offset=+1 ) ! update dynamic and tracer data at open boundaries 
    102102 
    103103      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
  • branches/2011/dev_NOC_UKMO_MERGE/NEMOGCM/NEMO/OPA_SRC/step_oce.F90

    r2528 r3094  
    5353   USE obcrad           ! open boundary cond. radiation    (obc_rad routine) 
    5454 
    55    USE bdy_par          ! unstructured open boundary data variables 
    56    USE bdydta           ! unstructured open boundary data  (bdy_dta routine) 
     55   USE bdy_par          ! for lk_bdy 
     56   USE bdydta           ! open boundary condition data     (bdy_dta routine) 
    5757 
    5858   USE sshwzv           ! vertical velocity and ssh        (ssh_wzv routine) 
  • branches/2011/dev_NOC_UKMO_MERGE/NEMOGCM/NEMO/TOP_SRC/C14b/trcsms_c14b.F90

    r2715 r3094  
    119119      ENDIF 
    120120 
    121       IF( kt == nit000 )  THEN         ! Computation of decay coeffcient 
     121      IF( kt == nittrc000 )  THEN         ! Computation of decay coeffcient 
    122122         zdemi   = 5730._wp 
    123123         xlambda = LOG(2.) / zdemi / ( nyear_len(1) * rday ) 
  • branches/2011/dev_NOC_UKMO_MERGE/NEMOGCM/NEMO/TOP_SRC/CFC/trcnam_cfc.F90

    r2715 r3094  
    3737      !! 
    3838      !! ** Method  :   Read the namcfc namelist and check the parameter  
    39       !!       values called at the first timestep (nit000) 
     39      !!       values called at the first timestep (nittrc000) 
    4040      !! 
    4141      !! ** input   :   Namelist namcfc 
  • branches/2011/dev_NOC_UKMO_MERGE/NEMOGCM/NEMO/TOP_SRC/CFC/trcsms_cfc.F90

    r2715 r3094  
    9797      ENDIF 
    9898 
    99       IF( kt == nit000 )   CALL trc_cfc_cst 
     99      IF( kt == nittrc000 )   CALL trc_cfc_cst 
    100100 
    101101      ! Temporal interpolation 
  • branches/2011/dev_NOC_UKMO_MERGE/NEMOGCM/NEMO/TOP_SRC/LOBSTER/trcbio.F90

    r2715 r3094  
    9595#endif 
    9696 
    97       IF( kt == nit000 ) THEN 
     97      IF( kt == nittrc000 ) THEN 
    9898         IF(lwp) WRITE(numout,*) 
    9999         IF(lwp) WRITE(numout,*) ' trc_bio: LOBSTER bio-model' 
  • branches/2011/dev_NOC_UKMO_MERGE/NEMOGCM/NEMO/TOP_SRC/LOBSTER/trcexp.F90

    r2715 r3094  
    6161      !!--------------------------------------------------------------------- 
    6262 
    63       IF( kt == nit000 ) THEN 
     63      IF( kt == nittrc000 ) THEN 
    6464         IF(lwp) WRITE(numout,*) 
    6565         IF(lwp) WRITE(numout,*) ' trc_exp: LOBSTER export' 
  • branches/2011/dev_NOC_UKMO_MERGE/NEMOGCM/NEMO/TOP_SRC/LOBSTER/trcopt.F90

    r2715 r3094  
    7272      END IF 
    7373 
    74       IF( kt == nit000 ) THEN 
     74      IF( kt == nittrc000 ) THEN 
    7575         IF(lwp) WRITE(numout,*) 
    7676         IF(lwp) WRITE(numout,*) ' trc_opt : LOBSTER optic-model' 
  • branches/2011/dev_NOC_UKMO_MERGE/NEMOGCM/NEMO/TOP_SRC/LOBSTER/trcsed.F90

    r2715 r3094  
    7474      END IF 
    7575 
    76       IF( kt == nit000 ) THEN 
     76      IF( kt == nittrc000 ) THEN 
    7777         IF(lwp) WRITE(numout,*) 
    7878         IF(lwp) WRITE(numout,*) ' trc_sed: LOBSTER sedimentation' 
  • branches/2011/dev_NOC_UKMO_MERGE/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zsed.F90

    r2774 r3094  
    329329 
    330330      ! Calendar computation 
    331       IF( kt == nit000 .OR. imois /= nflx1 ) THEN 
    332  
    333          IF( kt == nit000 )  nflx1  = 0 
     331      IF( kt == nittrc000 .OR. imois /= nflx1 ) THEN 
     332 
     333         IF( kt == nittrc000 )  nflx1  = 0 
    334334 
    335335         ! nflx1 number of the first file record used in the simulation 
  • branches/2011/dev_NOC_UKMO_MERGE/NEMOGCM/NEMO/TOP_SRC/PISCES/trcrst_pisces.F90

    r2715 r3094  
    245245#if defined key_dtatrc 
    246246      ! Restore close seas values to initial data 
    247       CALL trc_dta( nit000 )  
     247      CALL trc_dta( nittrc000 )  
    248248      DO jn = 1, jptra 
    249249         IF( lutini(jn) ) THEN 
  • branches/2011/dev_NOC_UKMO_MERGE/NEMOGCM/NEMO/TOP_SRC/PISCES/trcsms_pisces.F90

    r2715 r3094  
    7272      !!--------------------------------------------------------------------- 
    7373 
    74       IF( kt == nit000 )   CALL trc_sms_pisces_init    ! Initialization (first time-step only) 
     74      IF( kt == nittrc000 )   CALL trc_sms_pisces_init    ! Initialization (first time-step only) 
    7575 
    7676      IF( wrk_in_use(3,1) )  THEN 
  • branches/2011/dev_NOC_UKMO_MERGE/NEMOGCM/NEMO/TOP_SRC/SED/sedini.F90

    r2761 r3094  
    449449 
    450450      dtsed = rdt 
    451       nitsed000 = nit000 
     451      nitsed000 = nittrc000 
    452452      nitsedend = nitend 
    453453#if ! defined key_sed_off 
  • branches/2011/dev_NOC_UKMO_MERGE/NEMOGCM/NEMO/TOP_SRC/SED/sedmodel.F90

    r2528 r3094  
    3535 
    3636 
    37       IF( kt == nit000 ) CALL sed_init       ! Initialization of sediment model 
     37      IF( kt == nittrc000 ) CALL sed_init       ! Initialization of sediment model 
    3838 
    3939                         CALL sed_stp( kt )  ! Time stepping of Sediment model 
  • branches/2011/dev_NOC_UKMO_MERGE/NEMOGCM/NEMO/TOP_SRC/SED/sedwri.F90

    r2761 r3094  
    5656      ! Initialisation 
    5757      ! -----------------  
    58       IF( kt == nit000 )   ALLOCATE( ndext52(jpij*jpksed), ndext51(jpij) ) 
     58      IF( kt == nittrc000 )   ALLOCATE( ndext52(jpij*jpksed), ndext51(jpij) ) 
    5959 
    6060      ! Define frequency of output and means 
  • branches/2011/dev_NOC_UKMO_MERGE/NEMOGCM/NEMO/TOP_SRC/TRP/trcadv.F90

    r2715 r3094  
    3535   INTEGER ::   nadv   ! choice of the type of advection scheme 
    3636   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:) ::   r2dt  ! vertical profile time-step, = 2 rdttra 
    37    !                                                    ! except at nit000 (=rdttra) if neuler=0 
     37   !                                                    ! except at nitrrc000 (=rdttra) if neuler=0 
    3838 
    3939   !! * Substitutions 
     
    8080      ENDIF 
    8181 
    82       IF( kt == nit000 )   CALL trc_adv_ctl          ! initialisation & control of options 
     82      IF( kt == nittrc000 )   CALL trc_adv_ctl          ! initialisation & control of options 
    8383 
    8484#if ! defined key_pisces 
    85       IF( neuler == 0 .AND. kt == nit000 ) THEN     ! at nit000 
     85      IF( neuler == 0 .AND. kt == nittrc000 ) THEN     ! at nittrc000 
    8686         r2dt(:) =  rdttrc(:)           ! = rdttrc (restarting with Euler time stepping) 
    87       ELSEIF( kt <= nit000 + nn_dttrc ) THEN          ! at nit000 or nit000+1 
     87      ELSEIF( kt <= nittrc000 + nn_dttrc ) THEN          ! at nittrc000 or nittrc000+1 
    8888         r2dt(:) = 2. * rdttrc(:)       ! = 2 rdttrc (leapfrog) 
    8989      ENDIF 
     
    103103 
    104104      !                                                   ! add the eiv transport (if necessary) 
    105       IF( lk_traldf_eiv )   CALL tra_adv_eiv( kt, zun, zvn, zwn, 'TRC' ) 
     105      IF( lk_traldf_eiv )   CALL tra_adv_eiv( kt, nittrc000, zun, zvn, zwn, 'TRC' ) 
    106106      ! 
    107107      SELECT CASE ( nadv )                            !==  compute advection trend and add it to general trend  ==! 
    108       CASE ( 1 )   ;    CALL tra_adv_cen2  ( kt, 'TRC',       zun, zvn, zwn, trb, trn, tra, jptra )   !  2nd order centered 
    109       CASE ( 2 )   ;    CALL tra_adv_tvd   ( kt, 'TRC', r2dt, zun, zvn, zwn, trb, trn, tra, jptra )   !  TVD  
    110       CASE ( 3 )   ;    CALL tra_adv_muscl ( kt, 'TRC', r2dt, zun, zvn, zwn, trb,      tra, jptra )   !  MUSCL  
    111       CASE ( 4 )   ;    CALL tra_adv_muscl2( kt, 'TRC', r2dt, zun, zvn, zwn, trb, trn, tra, jptra )   !  MUSCL2  
    112       CASE ( 5 )   ;    CALL tra_adv_ubs   ( kt, 'TRC', r2dt, zun, zvn, zwn, trb, trn, tra, jptra )   !  UBS  
    113       CASE ( 6 )   ;    CALL tra_adv_qck   ( kt, 'TRC', r2dt, zun, zvn, zwn, trb, trn, tra, jptra )   !  QUICKEST  
     108      CASE ( 1 )   ;    CALL tra_adv_cen2  ( kt, nittrc000, 'TRC',       zun, zvn, zwn, trb, trn, tra, jptra )   !  2nd order centered 
     109      CASE ( 2 )   ;    CALL tra_adv_tvd   ( kt, nittrc000, 'TRC', r2dt, zun, zvn, zwn, trb, trn, tra, jptra )   !  TVD  
     110      CASE ( 3 )   ;    CALL tra_adv_muscl ( kt, nittrc000, 'TRC', r2dt, zun, zvn, zwn, trb,      tra, jptra )   !  MUSCL  
     111      CASE ( 4 )   ;    CALL tra_adv_muscl2( kt, nittrc000, 'TRC', r2dt, zun, zvn, zwn, trb, trn, tra, jptra )   !  MUSCL2  
     112      CASE ( 5 )   ;    CALL tra_adv_ubs   ( kt, nittrc000, 'TRC', r2dt, zun, zvn, zwn, trb, trn, tra, jptra )   !  UBS  
     113      CASE ( 6 )   ;    CALL tra_adv_qck   ( kt, nittrc000, 'TRC', r2dt, zun, zvn, zwn, trb, trn, tra, jptra )   !  QUICKEST  
    114114      ! 
    115115      CASE (-1 )                                      !==  esopa: test all possibility with control print  ==! 
    116          CALL tra_adv_cen2  ( kt, 'TRC',       zun, zvn, zwn, trb, trn, tra, jptra )           
     116         CALL tra_adv_cen2  ( kt, nittrc000, 'TRC',       zun, zvn, zwn, trb, trn, tra, jptra )           
    117117         WRITE(charout, FMT="('adv1')")  ; CALL prt_ctl_trc_info(charout) 
    118118                                           CALL prt_ctl_trc(tab4d=tra, mask=tmask, clinfo=ctrcnm,clinfo2='trd') 
    119          CALL tra_adv_tvd   ( kt, 'TRC', r2dt, zun, zvn, zwn, trb, trn, tra, jptra )           
     119         CALL tra_adv_tvd   ( kt, nittrc000, 'TRC', r2dt, zun, zvn, zwn, trb, trn, tra, jptra )           
    120120         WRITE(charout, FMT="('adv2')")  ; CALL prt_ctl_trc_info(charout) 
    121121                                           CALL prt_ctl_trc(tab4d=tra, mask=tmask, clinfo=ctrcnm,clinfo2='trd') 
    122          CALL tra_adv_muscl ( kt, 'TRC', r2dt, zun, zvn, zwn, trb,      tra, jptra )           
     122         CALL tra_adv_muscl ( kt, nittrc000, 'TRC', r2dt, zun, zvn, zwn, trb,      tra, jptra )           
    123123         WRITE(charout, FMT="('adv3')")  ; CALL prt_ctl_trc_info(charout) 
    124124                                           CALL prt_ctl_trc(tab4d=tra, mask=tmask, clinfo=ctrcnm,clinfo2='trd') 
    125          CALL tra_adv_muscl2( kt, 'TRC', r2dt, zun, zvn, zwn, trb, trn, tra, jptra )           
     125         CALL tra_adv_muscl2( kt, nittrc000, 'TRC', r2dt, zun, zvn, zwn, trb, trn, tra, jptra )           
    126126         WRITE(charout, FMT="('adv4')")  ; CALL prt_ctl_trc_info(charout) 
    127127                                           CALL prt_ctl_trc(tab4d=tra, mask=tmask, clinfo=ctrcnm,clinfo2='trd') 
    128          CALL tra_adv_ubs   ( kt, 'TRC', r2dt, zun, zvn, zwn, trb, trn, tra, jptra )           
     128         CALL tra_adv_ubs   ( kt, nittrc000, 'TRC', r2dt, zun, zvn, zwn, trb, trn, tra, jptra )           
    129129         WRITE(charout, FMT="('adv5')")  ; CALL prt_ctl_trc_info(charout) 
    130130                                           CALL prt_ctl_trc(tab4d=tra, mask=tmask, clinfo=ctrcnm,clinfo2='trd') 
    131          CALL tra_adv_qck   ( kt, 'TRC', r2dt, zun, zvn, zwn, trb, trn, tra, jptra )           
     131         CALL tra_adv_qck   ( kt, nittrc000, 'TRC', r2dt, zun, zvn, zwn, trb, trn, tra, jptra )           
    132132         WRITE(charout, FMT="('adv6')")  ; CALL prt_ctl_trc_info(charout) 
    133133                                           CALL prt_ctl_trc(tab4d=tra, mask=tmask, clinfo=ctrcnm,clinfo2='trd') 
  • branches/2011/dev_NOC_UKMO_MERGE/NEMOGCM/NEMO/TOP_SRC/TRP/trcbbl.F90

    r2528 r3094  
    5656      !!---------------------------------------------------------------------- 
    5757 
    58       IF( .NOT. lk_offline ) THEN 
    59          CALL bbl( kt, 'TRC' )         ! Online coupling with dynamics  : Computation of bbl coef and bbl transport 
    60          l_bbl = .FALSE.               ! Offline coupling with dynamics : Read bbl coef and bbl transport from input files 
     58      IF( .NOT. lk_offline .AND. nn_dttrc == 1 ) THEN 
     59         CALL bbl( kt, nittrc000, 'TRC' )      ! Online coupling with dynamics  : Computation of bbl coef and bbl transport 
     60         l_bbl = .FALSE.                       ! Offline coupling with dynamics : Read bbl coef and bbl transport from input files 
    6161      ENDIF 
    6262 
    6363      IF( l_trdtrc )  THEN 
    64          ALLOCATE( ztrtrd(jpi,jpj,jpk,jptra) )   ! temporary save of trends 
     64         ALLOCATE( ztrtrd(jpi,jpj,jpk,jptra) ) ! temporary save of trends 
    6565         ztrtrd(:,:,:,:)  = tra(:,:,:,:) 
    6666      ENDIF 
  • branches/2011/dev_NOC_UKMO_MERGE/NEMOGCM/NEMO/TOP_SRC/TRP/trcdmp.F90

    r2715 r3094  
    9494      ! 0. Initialization (first time-step only) 
    9595      !    -------------- 
    96       IF( kt == nit000 ) CALL trc_dmp_init 
     96      IF( kt == nittrc000 ) CALL trc_dmp_init 
    9797 
    9898      IF( l_trdtrc )   ALLOCATE( ztrtrd(jpi,jpj,jpk) )   ! temporary save of trends 
     
    173173      !! 
    174174      !! ** Method  :   read the nammbf namelist and check the parameters 
    175       !!              called by trc_dmp at the first timestep (nit000) 
     175      !!              called by trc_dmp at the first timestep (nittrc000) 
    176176      !!---------------------------------------------------------------------- 
    177177 
  • branches/2011/dev_NOC_UKMO_MERGE/NEMOGCM/NEMO/TOP_SRC/TRP/trcldf.F90

    r2715 r3094  
    5959      !!---------------------------------------------------------------------- 
    6060 
    61       IF( kt == nit000 )   CALL ldf_ctl          ! initialisation & control of options 
     61      IF( kt == nittrc000 )   CALL ldf_ctl          ! initialisation & control of options 
    6262 
    6363      IF( l_trdtrc )  THEN  
     
    6767 
    6868      SELECT CASE ( nldf )                       ! compute lateral mixing trend and add it to the general trend 
    69       CASE ( 0 )   ;   CALL tra_ldf_lap   ( kt, 'TRC', gtru, gtrv, trb, tra, jptra            )  ! iso-level laplacian 
    70       CASE ( 1 )   ;   CALL tra_ldf_iso   ( kt, 'TRC', gtru, gtrv, trb, tra, jptra, rn_ahtb_0 )  ! rotated laplacian  
    71       CASE ( 2 )   ;   CALL tra_ldf_bilap ( kt, 'TRC', gtru, gtrv, trb, tra, jptra            )  ! iso-level bilaplacian 
    72       CASE ( 3 )   ;   CALL tra_ldf_bilapg( kt, 'TRC',             trb, tra, jptra            )  ! s-coord. horizontal bilaplacian 
     69      CASE ( 0 )   ;   CALL tra_ldf_lap   ( kt, nittrc000, 'TRC', gtru, gtrv, trb, tra, jptra            )  ! iso-level laplacian 
     70      CASE ( 1 )   ;   CALL tra_ldf_iso   ( kt, nittrc000, 'TRC', gtru, gtrv, trb, tra, jptra, rn_ahtb_0 )  ! rotated laplacian  
     71      CASE ( 2 )   ;   CALL tra_ldf_bilap ( kt, nittrc000, 'TRC', gtru, gtrv, trb, tra, jptra            )  ! iso-level bilaplacian 
     72      CASE ( 3 )   ;   CALL tra_ldf_bilapg( kt, nittrc000, 'TRC',             trb, tra, jptra            )  ! s-coord. horizontal bilaplacian 
    7373         ! 
    7474      CASE ( -1 )                                     ! esopa: test all possibility with control print 
    75          CALL tra_ldf_lap   ( kt, 'TRC', gtru, gtrv, trb, tra, jptra            ) 
     75         CALL tra_ldf_lap   ( kt, nittrc000, 'TRC', gtru, gtrv, trb, tra, jptra            ) 
    7676         WRITE(charout, FMT="('ldf0 ')") ;  CALL prt_ctl_trc_info(charout) 
    7777                                            CALL prt_ctl_trc( tab4d=tra, mask=tmask, clinfo=ctrcnm, clinfo2='trd' ) 
    78          CALL tra_ldf_iso   ( kt, 'TRC', gtru, gtrv, trb, tra, jptra, rn_ahtb_0 ) 
     78         CALL tra_ldf_iso   ( kt, nittrc000, 'TRC', gtru, gtrv, trb, tra, jptra, rn_ahtb_0 ) 
    7979         WRITE(charout, FMT="('ldf1 ')") ;  CALL prt_ctl_trc_info(charout) 
    8080                                            CALL prt_ctl_trc( tab4d=tra, mask=tmask, clinfo=ctrcnm, clinfo2='trd' ) 
    81          CALL tra_ldf_bilap ( kt, 'TRC', gtru, gtrv, trb, tra, jptra            ) 
     81         CALL tra_ldf_bilap ( kt, nittrc000, 'TRC', gtru, gtrv, trb, tra, jptra            ) 
    8282         WRITE(charout, FMT="('ldf2 ')") ;  CALL prt_ctl_trc_info(charout) 
    8383                                            CALL prt_ctl_trc( tab4d=tra, mask=tmask, clinfo=ctrcnm, clinfo2='trd' ) 
    84          CALL tra_ldf_bilapg( kt, 'TRC',             trb, tra, jptra            ) 
     84         CALL tra_ldf_bilapg( kt, nittrc000, 'TRC',             trb, tra, jptra            ) 
    8585         WRITE(charout, FMT="('ldf3 ')") ;  CALL prt_ctl_trc_info(charout) 
    8686                                            CALL prt_ctl_trc( tab4d=tra, mask=tmask, clinfo=ctrcnm, clinfo2='trd' ) 
  • branches/2011/dev_NOC_UKMO_MERGE/NEMOGCM/NEMO/TOP_SRC/TRP/trcnxt.F90

    r2715 r3094  
    9696      !!---------------------------------------------------------------------- 
    9797 
    98       IF( kt == nit000 .AND. lwp ) THEN 
     98      IF( kt == nittrc000 .AND. lwp ) THEN 
    9999         WRITE(numout,*) 
    100100         WRITE(numout,*) 'trc_nxt : time stepping on passive tracers' 
     
    119119 
    120120      ! set time step size (Euler/Leapfrog) 
    121       IF( neuler == 0 .AND. kt ==  nit000) THEN  ;  r2dt(:) =     rdttrc(:)   ! at nit000             (Euler) 
    122       ELSEIF( kt <= nit000 + 1 )           THEN  ;  r2dt(:) = 2.* rdttrc(:)   ! at nit000 or nit000+1 (Leapfrog) 
     121      IF( neuler == 0 .AND. kt ==  nittrc000) THEN  ;  r2dt(:) =     rdttrc(:)   ! at nittrc000             (Euler) 
     122      ELSEIF( kt <= nittrc000 +  nn_dttrc )           THEN  ;  r2dt(:) = 2.* rdttrc(:)   ! at nit000 or nit000+1 (Leapfrog) 
    123123      ENDIF 
    124124 
     
    129129      ENDIF 
    130130      ! Leap-Frog + Asselin filter time stepping 
    131       IF( neuler == 0 .AND. kt == nit000 ) THEN        ! Euler time-stepping at first time-step 
    132          !                                             ! (only swap) 
     131      IF( neuler == 0 .AND. kt == nittrc000 ) THEN        ! Euler time-stepping at first time-step 
     132         !                                                ! (only swap) 
    133133         DO jn = 1, jptra 
    134134            DO jk = 1, jpkm1 
     
    139139      ELSE 
    140140         ! Leap-Frog + Asselin filter time stepping 
    141          IF( lk_vvl ) THEN   ;   CALL tra_nxt_vvl( kt, 'TRC', trb, trn, tra, jptra )      ! variable volume level (vvl)  
    142          ELSE                ;   CALL tra_nxt_fix( kt, 'TRC', trb, trn, tra, jptra )      ! fixed    volume level  
     141         IF( lk_vvl ) THEN   ;   CALL tra_nxt_vvl( kt,nittrc000, 'TRC', trb, trn, tra, jptra )      ! variable volume level (vvl)  
     142         ELSE                ;   CALL tra_nxt_fix( kt,nittrc000, 'TRC', trb, trn, tra, jptra )      ! fixed    volume level  
    143143         ENDIF 
    144144      ENDIF 
  • branches/2011/dev_NOC_UKMO_MERGE/NEMOGCM/NEMO/TOP_SRC/TRP/trcrad.F90

    r2715 r3094  
    5353      !!---------------------------------------------------------------------- 
    5454 
    55       IF( kt == nit000 ) THEN 
     55      IF( kt == nittrc000 ) THEN 
    5656         IF(lwp) WRITE(numout,*) 
    5757         IF(lwp) WRITE(numout,*) 'trc_rad : Correct artificial negative concentrations ' 
  • branches/2011/dev_NOC_UKMO_MERGE/NEMOGCM/NEMO/TOP_SRC/TRP/trcsbc.F90

    r2715 r3094  
    7272      END IF 
    7373 
    74       IF( kt == nit000 ) THEN 
     74      IF( kt == nittrc000 ) THEN 
    7575         IF(lwp) WRITE(numout,*) 
    7676         IF(lwp) WRITE(numout,*) 'trc_sbc : Passive tracers surface boundary condition' 
  • branches/2011/dev_NOC_UKMO_MERGE/NEMOGCM/NEMO/TOP_SRC/TRP/trczdf.F90

    r2715 r3094  
    3232      !                                ! defined from ln_zdf...  namlist logicals) 
    3333   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:) ::  r2dt   ! vertical profile time-step, = 2 rdttra 
    34       !                                                 ! except at nit000 (=rdttra) if neuler=0 
     34      !                                                 ! except at nittrc000 (=rdttra) if neuler=0 
    3535 
    3636   !! * Substitutions 
     
    6969      !!--------------------------------------------------------------------- 
    7070 
    71       IF( kt == nit000 )   CALL zdf_ctl          ! initialisation & control of options 
     71      IF( kt == nittrc000 )   CALL zdf_ctl          ! initialisation & control of options 
    7272 
    7373#if ! defined key_pisces 
    74       IF( neuler == 0 .AND. kt == nit000 ) THEN     ! at nit000 
     74      IF( neuler == 0 .AND. kt == nittrc000 ) THEN     ! at nittrc000 
    7575         r2dt(:) =  rdttrc(:)           ! = rdttrc (restarting with Euler time stepping) 
    76       ELSEIF( kt <= nit000 + nn_dttrc ) THEN          ! at nit000 or nit000+1 
     76      ELSEIF( kt <= nittrc000 + nn_dttrc ) THEN          ! at nittrc000 or nittrc000+nn_dttrc 
    7777         r2dt(:) = 2. * rdttrc(:)       ! = 2 rdttrc (leapfrog) 
    7878      ENDIF 
     
    8888      SELECT CASE ( nzdf )                       ! compute lateral mixing trend and add it to the general trend 
    8989      CASE ( -1 )                                       ! esopa: test all possibility with control print 
    90          CALL tra_zdf_exp( kt, 'TRC', r2dt, nn_trczdf_exp, trb, tra, jptra )  
     90         CALL tra_zdf_exp( kt,nittrc000, 'TRC', r2dt, nn_trczdf_exp, trb, tra, jptra )  
    9191         WRITE(charout, FMT="('zdf1 ')") ;  CALL prt_ctl_trc_info(charout) 
    9292                                            CALL prt_ctl_trc( tab4d=tra, mask=tmask, clinfo=ctrcnm, clinfo2='trd' ) 
    93          CALL tra_zdf_imp( kt, 'TRC', r2dt,                trb, tra, jptra )  
     93         CALL tra_zdf_imp( kt,nittrc000, 'TRC', r2dt,                trb, tra, jptra )  
    9494         WRITE(charout, FMT="('zdf2 ')") ;  CALL prt_ctl_trc_info(charout) 
    9595                                            CALL prt_ctl_trc( tab4d=tra, mask=tmask, clinfo=ctrcnm, clinfo2='trd' ) 
    96       CASE ( 0 ) ;  CALL tra_zdf_exp( kt, 'TRC', r2dt, nn_trczdf_exp, trb, tra, jptra )    !   explicit scheme  
    97       CASE ( 1 ) ;  CALL tra_zdf_imp( kt, 'TRC', r2dt,                trb, tra, jptra )    !   implicit scheme           
     96      CASE ( 0 ) ;  CALL tra_zdf_exp( kt,nittrc000, 'TRC', r2dt, nn_trczdf_exp, trb, tra, jptra )    !   explicit scheme  
     97      CASE ( 1 ) ;  CALL tra_zdf_imp( kt,nittrc000, 'TRC', r2dt,                trb, tra, jptra )    !   implicit scheme           
    9898 
    9999      END SELECT 
  • branches/2011/dev_NOC_UKMO_MERGE/NEMOGCM/NEMO/TOP_SRC/TRP/trdmld_trc.F90

    r2715 r3094  
    475475      ! II.1 Set before values of vertically averages passive tracers 
    476476      ! ------------------------------------------------------------- 
    477       IF( kt > nit000 ) THEN 
     477      IF( kt > nittrc000 ) THEN 
    478478         DO jn = 1, jptra 
    479479            IF( ln_trdtrc(jn) ) THEN 
     
    497497      ! II.3 Initialize mixed-layer "before" arrays for the 1rst analysis window     
    498498      ! ------------------------------------------------------------------------ 
    499       IF( kt == 2 ) THEN  !  i.e. ( .NOT. ln_rstart ).AND.( kt == nit000 + 1)    ??? 
     499      IF( kt == nittrc000 + nn_dttrc ) THEN  !  i.e. ( .NOT. ln_rstart ).AND.( kt == nit000 + 1)    ??? 
    500500         ! 
    501501         DO jn = 1, jptra 
     
    560560      tmltrd_trc(:,:,:,:) = tmltrd_trc(:,:,:,:) * rn_ucf_trc 
    561561 
    562       itmod = kt - nit000 + 1 
     562      itmod = kt - nittrc000 + 1 
    563563      it    = kt 
    564564 
     
    980980      ! II.3 Initialize mixed-layer "before" arrays for the 1rst analysis window 
    981981      ! ------------------------------------------------------------------------ 
    982       IF( kt == 2 ) THEN  !  i.e. ( .NOT. ln_rstart ).AND.( kt == nit000 + 1) 
     982      IF( kt == nittrc000 + nn_dttrc ) THEN  !  i.e. ( .NOT. ln_rstart ).AND.( kt == nit000 + 1) 
    983983         ! 
    984984         tmltrd_csum_ub_bio (:,:,:) = 0.e0 
     
    10861086 
    10871087      ! define time axis 
    1088       itmod = kt - nit000 + 1 
     1088      itmod = kt - nittrc000 + 1 
    10891089      it    = kt 
    10901090 
     
    13311331      zjulian = zjulian - adatrj   !   set calendar origin to the beginning of the experiment 
    13321332      IF(lwp) WRITE(numout,*)' '   
    1333       IF(lwp) WRITE(numout,*)' Date 0 used :', nit000                  & 
     1333      IF(lwp) WRITE(numout,*)' Date 0 used :', nittrc000               & 
    13341334           &   ,' YEAR ', nyear, ' MONTH ', nmonth,' DAY ', nday       & 
    13351335           &   ,'Julian day : ', zjulian 
     
    13601360            CALL dia_nam( clhstnam, nn_trd_trc, csuff ) 
    13611361            CALL histbeg( clhstnam, jpi, glamt, jpj, gphit,                                            & 
    1362                &        1, jpi, 1, jpj, nit000, zjulian, rdt, nh_t(jn), nidtrd(jn), domain_id=nidom, snc4chunks=snc4set ) 
     1362               &        1, jpi, 1, jpj, nittrc000, zjulian, rdt, nh_t(jn), nidtrd(jn), domain_id=nidom, snc4chunks=snc4set ) 
    13631363       
    13641364            !-- Define the ML depth variable 
     
    13731373          CALL dia_nam( clhstnam, nn_trd_trc, 'trdbio' ) 
    13741374          CALL histbeg( clhstnam, jpi, glamt, jpj, gphit,                                            & 
    1375              &             1, jpi, 1, jpj, nit000, zjulian, rdt, nh_tb, nidtrdbio, domain_id=nidom, snc4chunks=snc4set ) 
     1375             &             1, jpi, 1, jpj, nittrc000, zjulian, rdt, nh_tb, nidtrdbio, domain_id=nidom, snc4chunks=snc4set ) 
    13761376#endif 
    13771377 
  • branches/2011/dev_NOC_UKMO_MERGE/NEMOGCM/NEMO/TOP_SRC/TRP/trdmod_trc.F90

    r2528 r3094  
    5050      !!---------------------------------------------------------------------- 
    5151 
    52       IF( kt == nit000 ) THEN 
     52      IF( kt == nittrc000 ) THEN 
    5353!         IF(lwp)WRITE(numout,*) 
    5454!         IF(lwp)WRITE(numout,*) 'trd_mod_trc:' 
  • branches/2011/dev_NOC_UKMO_MERGE/NEMOGCM/NEMO/TOP_SRC/oce_trc.F90

    r2787 r3094  
    108108   USE dom_oce , ONLY :   e3w_0      =>   e3w_0      !: reference depth of w-points (m) 
    109109   USE dom_oce , ONLY :   gdepw_0    =>   gdepw_0    !: reference depth of w-points (m) 
     110# if ! defined key_zco 
    110111   USE dom_oce , ONLY :   gdep3w     =>  gdep3w      !: ??? 
    111112   USE dom_oce , ONLY :   gdept      =>  gdept       !: depth of t-points (m) 
     
    118119   USE dom_oce , ONLY :   e3uw       =>  e3uw        !: uw-points (m) 
    119120   USE dom_oce , ONLY :   e3vw       =>  e3vw        !: vw-points (m) 
    120  
     121# endif 
    121122   USE dom_oce , ONLY :   ln_zps     =>  ln_zps      !: partial steps flag 
    122123   USE dom_oce , ONLY :   ln_sco     =>  ln_sco      !: s-coordinate flag 
     
    192193   USE oce , ONLY :   rhd     =>    rhd     !: in situ density anomalie rhd=(rho-rau0)/rau0 (no units) 
    193194   USE oce , ONLY :   hdivn   =>    hdivn   !: horizontal divergence (1/s) 
     195   USE oce , ONLY :   rotn    =>    rotn    !: relative vorticity    [s-1] 
     196   USE oce , ONLY :   hdivb   =>    hdivb   !: horizontal divergence (1/s) 
     197   USE oce , ONLY :   rotb    =>    rotb    !: relative vorticity    [s-1] 
     198   USE oce , ONLY :   sshn    =>    sshn    !: sea surface height at t-point [m]    
     199   USE oce , ONLY :   sshb    =>    sshb    !: sea surface height at t-point [m]    
     200   USE oce , ONLY :   ssha    =>    ssha    !: sea surface height at t-point [m]    
     201   USE oce , ONLY :   sshu_n  =>    sshu_n  !: sea surface height at u-point [m]    
     202   USE oce , ONLY :   sshu_b  =>    sshu_b  !: sea surface height at u-point [m]    
     203   USE oce , ONLY :   sshu_a  =>    sshu_a  !: sea surface height at u-point [m]    
     204   USE oce , ONLY :   sshv_n  =>    sshv_n  !: sea surface height at v-point [m]    
     205   USE oce , ONLY :   sshv_b  =>    sshv_b  !: sea surface height at v-point [m]    
     206   USE oce , ONLY :   sshv_a  =>    sshv_a  !: sea surface height at v-point [m]    
     207   USE oce , ONLY :   sshf_n  =>    sshf_n  !: sea surface height at v-point [m]    
     208   USE oce , ONLY :   l_traldf_rot   =>   l_traldf_rot !: rotated laplacian operator for lateral diffusion     
    194209   USE oce , ONLY :   l_traldf_rot => l_traldf_rot  !: rotated laplacian operator for lateral diffusion 
    195210#if defined key_offline 
     
    212227   USE sbc_oce , ONLY :   qsr        =>    qsr        !: penetrative solar radiation (w m-2)   
    213228   USE sbc_oce , ONLY :   emp        =>    emp        !: freshwater budget: volume flux               [Kg/m2/s] 
     229   USE sbc_oce , ONLY :   emp_b      =>    emp_b      !: freshwater budget: volume flux               [Kg/m2/s] 
    214230   USE sbc_oce , ONLY :   emps       =>    emps       !: freshwater budget: concentration/dillution   [Kg/m2/s] 
    215231   USE sbc_oce , ONLY :   rnf        =>    rnf        !: river runoff   [Kg/m2/s] 
     
    222238   USE sbcrnf  , ONLY :   rnfmsk     =>    rnfmsk     !: mixed adv scheme in runoffs vicinity (hori.)  
    223239   USE sbcrnf  , ONLY :   rnfmsk_z   =>    rnfmsk_z   !: mixed adv scheme in runoffs vicinity (vert.) 
     240   USE sbcrnf  , ONLY :   h_rnf      =>    h_rnf      !: river runoff   [Kg/m2/s] 
    224241 
    225242   USE trc_oce 
  • branches/2011/dev_NOC_UKMO_MERGE/NEMOGCM/NEMO/TOP_SRC/trc.F90

    r2715 r3094  
    5858   CHARACTER(len=50), PUBLIC ::  cn_trcrst_in    !: suffix of pass. tracer restart name (input) 
    5959   CHARACTER(len=50), PUBLIC ::  cn_trcrst_out   !: suffix of pass. tracer restart name (output) 
     60 
     61   INTEGER          , PUBLIC ::  nittrc000       !: first time step of passive tracers model 
    6062    
    6163   !! information for outputs 
     
    9799# if defined key_dtatrc 
    98100   INTEGER , PUBLIC, DIMENSION(jptra) ::   numtr   !: logical unit for passive tracers data 
     101# endif 
     102 
     103   !! variables to average over physics over passive tracer sub-steps. 
     104   !! ---------------------------------------------------------------- 
     105   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::  un_tm       !: i-horizontal velocity average     [m/s] 
     106   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::  vn_tm       !: j-horizontal velocity average     [m/s] 
     107   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) ::  tsn_tm      !: t/s average     [m/s] 
     108   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::  avt_tm      !: vertical diffusivity coeff. at  w-point   [m2/s] 
     109# if defined key_zdfddm 
     110   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::  avs_tm      !: vertical double diffusivity coeff. at w-point   [m/s] 
     111# endif 
     112#if defined key_ldfslp 
     113   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::  wslpi_tm    !: i-direction slope at u-, w-points 
     114   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::  wslpj_tm    !: j-direction slope at u-, w-points 
     115   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::  uslp_tm     !: j-direction slope at u-, w-points 
     116   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::  vslp_tm     !: j-direction slope at u-, w-points 
     117#endif 
     118#if defined key_trabbl 
     119   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  ahu_bbl_tm  !: u-, w-points 
     120   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  ahv_bbl_tm  !: j-direction slope at u-, w-points 
     121   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  utr_bbl_tm  !: j-direction slope at u-, w-points 
     122   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  vtr_bbl_tm  !: j-direction slope at u-, w-points 
     123#endif 
     124   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  sshn_tm     !: average ssh for the now step [m] 
     125   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  sshu_n_tm   !: average ssh for the now step [m] 
     126   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  sshv_n_tm   !: average ssh for the now step [m] 
     127   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  sshb_hold   !:hold sshb from the beginning of each sub-stepping[m]   
     128   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  sshu_b_hold !:hold sshb from the beginning of each sub-stepping[m]   
     129   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  sshv_b_hold !:hold sshb from the beginning of each sub-stepping[m]  
     130 
     131   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  rnf_tm     !: river runoff 
     132   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  h_rnf_tm   !: depth in metres to the bottom of the relevant grid box 
     133   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  hmld_tm    !: mixed layer depth average [m] 
     134   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  fr_i_tm    !: average ice fraction     [m/s] 
     135   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  emp_tm     !: freshwater budget: volume flux [Kg/m2/s] 
     136   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  emps_tm    !: freshwater budget:concentration/dilution [Kg/m2/s] 
     137   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  emp_b_hold !: hold emp from the beginning of each sub-stepping[m]   
     138   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  qsr_tm     !: solar radiation average [m] 
     139   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  wndm_tm    !: 10m wind average [m] 
     140   ! 
     141#if defined key_traldf_c3d 
     142   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::  ahtt_tm, ahtu_tm, ahtv_tm, ahtw_tm   !: ** 3D coefficients ** at T-,U-,V-,W-points 
     143#elif defined key_traldf_c2d 
     144   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  ahtt_tm, ahtu_tm, ahtv_tm, ahtw_tm   !: ** 2D coefficients ** at T-,U-,V-,W-points 
     145#elif defined key_traldf_c1d 
     146   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)       ::  ahtt_tm, ahtu_tm, ahtv_tm, ahtw_tm   !: ** 1D coefficients ** at T-,U-,V-,W-points 
     147#else 
     148   REAL(wp), PUBLIC                                        ::  ahtt_tm, ahtu_tm, ahtv_tm, ahtw_tm   !: ** 0D coefficients ** at T-,U-,V-,W-points 
     149#endif 
     150   ! 
     151#if defined key_traldf_eiv 
     152#  if defined key_traldf_c3d 
     153   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::  aeiu_tm , aeiv_tm , aeiw_tm   !: ** 3D coefficients ** 
     154#  elif defined key_traldf_c2d 
     155   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  aeiu_tm , aeiv_tm , aeiw_tm   !: ** 2D coefficients ** 
     156#  elif defined key_traldf_c1d 
     157   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)       ::  aeiu_tm , aeiv_tm, aeiw_tm   !: ** 1D coefficients ** 
     158#  else 
     159   REAL(wp), PUBLIC                                        ::  aeiu_tm , aeiv_tm , aeiw_tm   !: ** 0D coefficients ** 
     160#  endif 
     161#endif 
     162 
     163   ! Temporary physical arrays for sub_stepping 
     164   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) ::  tsn_temp 
     165   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::  un_temp,vn_temp,wn_temp     !: hold current values of avt, un, vn, wn 
     166   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::  avt_temp     !: hold current values of avt, un, vn, wn 
     167   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::  e3t_temp,e3u_temp,e3v_temp,e3w_temp     !: hold current values 
     168   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  sshn_temp, sshb_temp, ssha_temp, rnf_temp,h_rnf_temp 
     169   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  sshu_n_temp, sshu_b_temp, sshu_a_temp 
     170   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  sshf_n_temp 
     171   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  sshv_n_temp, sshv_b_temp, sshv_a_temp 
     172   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  hu_temp, hv_temp, hur_temp, hvr_temp 
     173   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::  hdivn_temp, rotn_temp 
     174   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::  hdivb_temp, rotb_temp 
     175   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  hmld_temp, qsr_temp, fr_i_temp,wndm_temp 
     176   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  emp_temp, emps_temp, emp_b_temp 
     177   ! 
     178#if defined key_trabbl 
     179   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  ahu_bbl_temp, ahv_bbl_temp, utr_bbl_temp, vtr_bbl_temp !: hold current values  
     180#endif 
     181   ! 
     182#if defined key_ldfslp 
     183   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::  wslpi_temp, wslpj_temp, uslp_temp, vslp_temp    !: hold current values  
     184#endif 
     185   !  
     186# if defined key_zdfddm 
     187   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::  avs_temp      !: salinity vertical diffusivity coeff. at w-point   [m/s] 
     188# endif 
     189   ! 
     190#if defined key_traldf_c3d 
     191   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::  ahtt_temp, ahtu_temp, ahtv_temp, ahtw_temp    
     192#elif defined key_traldf_c2d 
     193   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  ahtt_temp, ahtu_temp, ahtv_temp, ahtw_temp   
     194#elif defined key_traldf_c1d 
     195   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)       ::  ahtt_temp, ahtu_temp, ahtv_temp, ahtw_temp  
     196#else 
     197   REAL(wp), PUBLIC                                        ::  ahtt_temp, ahtu_temp, ahtv_temp, ahtw_temp 
     198#endif 
     199   ! 
     200#if defined key_traldf_eiv 
     201# if defined key_traldf_c3d 
     202   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::  aeiu_temp , aeiv_temp , aeiw_temp   !: ** 3D coefficients ** 
     203# elif defined key_traldf_c2d 
     204   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  aeiu_temp , aeiv_temp , aeiw_temp   !: ** 2D coefficients ** 
     205# elif defined key_traldf_c1d 
     206   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)       ::  aeiu_temp , aeiv_temp, aeiw_temp   !: ** 1D coefficients ** 
     207# else 
     208   REAL(wp), PUBLIC                                        ::  aeiu_temp , aeiv_temp , aeiw_temp   !: ** 0D coefficients ** 
     209# endif 
    99210# endif 
    100211 
  • branches/2011/dev_NOC_UKMO_MERGE/NEMOGCM/NEMO/TOP_SRC/trcdia.F90

    r2715 r3094  
    8585      !! ** Purpose :   Standard output of passive tracer : concentration fields 
    8686      !! 
    87       !! ** Method  :   At the beginning of the first time step (nit000), define all 
     87      !! ** Method  :   At the beginning of the first time step (nittrc000), define all 
    8888      !!             the NETCDF files and fields for concentration of passive tracer 
    8989      !! 
     
    135135 
    136136      ! define time axis 
    137       itmod = kt - nit000 + 1 
     137      itmod = kt - nittrc000 + 1 
    138138      it    = kt 
    139139      iiter = ( nit000 - 1 ) / nn_dttrc 
     
    144144      IF(ll_print)WRITE(numout,*)'trcdit_wr kt=',kt,' kindic ',kindic 
    145145       
    146       IF( kt == nit000 ) THEN 
     146      IF( kt == nittrc000 ) THEN 
    147147 
    148148         ! Compute julian date from starting date of the run 
     
    150150         zjulian = zjulian - adatrj   !   set calendar origin to the beginning of the experiment 
    151151         IF(lwp)WRITE(numout,*)' '   
    152          IF(lwp)WRITE(numout,*)' Date 0 used :', nit000                         & 
     152         IF(lwp)WRITE(numout,*)' Date 0 used :', nittrc000                         & 
    153153            &                 ,' YEAR ', nyear, ' MONTH ', nmonth, ' DAY ', nday   & 
    154154            &                 ,'Julian day : ', zjulian   
     
    226226      !! ** Purpose :   output of passive tracer : additional 2D and 3D arrays 
    227227      !! 
    228       !! ** Method  :   At the beginning of the first time step (nit000), define all 
     228      !! ** Method  :   At the beginning of the first time step (nittrc000), define all 
    229229      !!             the NETCDF files and fields for concentration of passive tracer 
    230230      !! 
     
    275275 
    276276      ! define time axis 
    277       itmod = kt - nit000 + 1 
     277      itmod = kt - nittrc000 + 1 
    278278      it    = kt 
    279279      iiter = ( nit000 - 1 ) / nn_dttrc 
     
    284284      IF( ll_print ) WRITE(numout,*) 'trcdii_wr kt=', kt, ' kindic ', kindic 
    285285 
    286       IF( kt == nit000 ) THEN 
     286      IF( kt == nittrc000 ) THEN 
    287287 
    288288         ! Define the NETCDF files for additional arrays : 2D or 3D 
     
    375375      !! ** Purpose :   output of passive tracer : biological fields 
    376376      !! 
    377       !! ** Method  :   At the beginning of the first time step (nit000), define all 
     377      !! ** Method  :   At the beginning of the first time step (nittrc000), define all 
    378378      !!             the NETCDF files and fields for concentration of passive tracer 
    379379      !! 
     
    424424 
    425425      ! define time axis 
    426       itmod = kt - nit000 + 1 
     426      itmod = kt - nittrc000 + 1 
    427427      it    = kt 
    428428      iiter = ( nit000 - 1 ) / nn_dttrc 
     
    433433      IF(ll_print) WRITE(numout,*)'trcdib_wr kt=',kt,' kindic ',kindic 
    434434 
    435       IF( kt == nit000 ) THEN 
     435      IF( kt == nittrc000 ) THEN 
    436436 
    437437         ! Define the NETCDF files for biological trends 
  • branches/2011/dev_NOC_UKMO_MERGE/NEMOGCM/NEMO/TOP_SRC/trcdta.F90

    r2715 r3094  
    7171         IF( lutini(jn) ) THEN  
    7272 
    73             IF ( kt == nit000 ) THEN 
     73            IF ( kt == nittrc000 ) THEN 
    7474               !! 3D tracer data 
    7575               IF(lwp)WRITE(numout,*) 
     
    8686 
    8787 
    88             ! First call kt=nit000 
     88            ! First call kt=nittrc000 
    8989            ! -------------------- 
    9090 
    91             IF ( kt == nit000 .AND. nlectr(jn) == 0 ) THEN 
     91            IF ( kt == nittrc000 .AND. nlectr(jn) == 0 ) THEN 
    9292               ntrc1(jn) = 0 
    9393               IF(lwp) WRITE(numout,*) ' trc_dta : Levitus tracer data monthly fields' 
     
    104104# if defined key_pisces 
    105105            ! Read montly file 
    106             IF( ( kt == nit000 .AND. nlectr(jn) == 0)  .OR. imois /= ntrc1(jn) ) THEN 
     106            IF( ( kt == nittrc000 .AND. nlectr(jn) == 0)  .OR. imois /= ntrc1(jn) ) THEN 
    107107               nlectr(jn) = 1 
    108108 
     
    186186# else 
    187187            ! Read init file only 
    188             IF( kt == nit000  ) THEN 
     188            IF( kt == nittrc000  ) THEN 
    189189               ntrc1(jn) = 1 
    190190               CALL iom_get ( numtr(jn), jpdom_data, ctrcnm(jn), trdta(:,:,:,jn), ntrc1(jn) ) 
  • branches/2011/dev_NOC_UKMO_MERGE/NEMOGCM/NEMO/TOP_SRC/trcini.F90

    r2715 r3094  
    2929   USE zpshde          ! partial step: hor. derivative   (zps_hde routine) 
    3030   USE prtctl_trc      ! Print control passive tracers (prt_ctl_trc_init routine) 
     31   USE trcsub       ! variables to substep passive tracers 
    3132    
    3233   IMPLICIT NONE 
     
    122123      IF( ln_rsttr ) THEN 
    123124        ! 
    124         IF( lk_offline )  neuler = 1   ! Set time-step indicator at nit000 (leap-frog) 
     125        IF( lk_offline )  neuler = 1   ! Set time-step indicator at nittrc000 (leap-frog) 
    125126        CALL trc_rst_read              ! restart from a file 
    126127        ! 
    127128      ELSE 
    128129        IF( lk_offline )  THEN 
    129            neuler = 0                  ! Set time-step indicator at nit000 (euler) 
     130           neuler = 0                  ! Set time-step indicator at nittrc000 (euler) 
    130131           CALL day_init               ! set calendar 
    131132        ENDIF 
    132133#if defined key_dtatrc 
    133         CALL trc_dta( nit000 )      ! Initialization of tracer from a file that may also be used for damping 
     134        CALL trc_dta( nittrc000 )      ! Initialization of tracer from a file that may also be used for damping 
    134135        DO jn = 1, jptra 
    135136           IF( lutini(jn) )   trn(:,:,:,jn) = trdta(:,:,:,jn) * tmask(:,:,:)   ! initialisation from file if required 
     
    143144       
    144145      IF( ln_zps .AND. .NOT. lk_c1d )   &              ! Partial steps: before horizontal gradient of passive 
    145         &    CALL zps_hde( nit000, jptra, trn, gtru, gtrv )       ! tracers at the bottom ocean level 
    146  
    147  
     146        &    CALL zps_hde( nittrc000, jptra, trn, gtru, gtrv )       ! tracers at the bottom ocean level 
     147      ! 
     148      IF( nn_dttrc /= 1 )        CALL trc_sub_ini      ! Initialize variables for substepping passive tracers 
    148149      !            
    149150      trai = 0._wp         ! Computation content of all tracers 
  • branches/2011/dev_NOC_UKMO_MERGE/NEMOGCM/NEMO/TOP_SRC/trcnam.F90

    r2715 r3094  
    109109      END DO 
    110110 
     111      !!KPE  computes the first time step of tracer model 
     112      nittrc000 = nit000 + nn_dttrc - 1 
     113  
    111114 
    112115      IF(lwp) THEN                   ! control print 
     
    114117         WRITE(numout,*) ' Namelist : namtrc' 
    115118         WRITE(numout,*) '    time step freq. for pass. trac. nn_dttrc             = ', nn_dttrc 
     119         WRITE(numout,*) '    first time step for pass. trac. nittrc000            = ', nittrc000 
    116120         WRITE(numout,*) '    frequency of outputs for passive tracers nn_writetrc = ', nn_writetrc   
    117121         WRITE(numout,*) '    restart LOGICAL for passive tr. ln_rsttr             = ', ln_rsttr 
  • branches/2011/dev_NOC_UKMO_MERGE/NEMOGCM/NEMO/TOP_SRC/trcrst.F90

    r2715 r3094  
    6060      ! 
    6161      IF( lk_offline ) THEN 
    62          IF( kt == nit000 ) THEN 
     62         IF( kt == nittrc000 ) THEN 
    6363            lrst_trc = .FALSE. 
    6464            nitrst = nitend 
     
    7171         ENDIF 
    7272      ELSE 
    73          IF( kt == nit000 ) lrst_trc = .FALSE. 
     73         IF( kt == nittrc000 ) lrst_trc = .FALSE. 
    7474      ENDIF 
    7575 
     
    7777      ! we open and define the tracer restart file one tracer time step before writing the data (-> at nitrst - 2*nn_dttrc + 1) 
    7878      ! except if we write tracer restart files every tracer time step or if a tracer restart file was writen at nitend - 2*nn_dttrc + 1 
    79       IF( kt == nitrst - 2*nn_dttrc + 1 .OR. nstock == nn_dttrc .OR. ( kt == nitend - nn_dttrc + 1 .AND. .NOT. lrst_trc ) ) THEN 
     79      IF( kt == nitrst - 2*nn_dttrc .OR. nstock == nn_dttrc .OR. ( kt == nitend - nn_dttrc .AND. .NOT. lrst_trc ) ) THEN 
    8080         ! beware of the format used to write kt (default is i8.8, that should be large enough) 
    8181         IF( nitrst > 1.0e9 ) THEN   ;   WRITE(clkt,*       ) nitrst 
     
    119119      ! Time domain : restart 
    120120      ! --------------------- 
    121       CALL trc_rst_cal( nit000, 'READ' )   ! calendar 
     121      CALL trc_rst_cal( nittrc000, 'READ' )   ! calendar 
    122122 
    123123      ! READ prognostic variables and computes diagnostic variable 
     
    151151      REAL(wp) :: zarak0 
    152152      !!---------------------------------------------------------------------- 
    153  
    154153 
    155154      CALL trc_rst_cal( kt, 'WRITE' )   ! calendar 
     
    196195      !! 
    197196      !!   According to namelist parameter nrstdt, 
    198       !!       nn_rsttr = 0  no control on the date (nit000 is  arbitrary). 
    199       !!       nn_rsttr = 1  we verify that nit000 is equal to the last 
     197      !!       nn_rsttr = 0  no control on the date (nittrc000 is  arbitrary). 
     198      !!       nn_rsttr = 1  we verify that nittrc000 is equal to the last 
    200199      !!                   time step of previous run + 1. 
    201200      !!       In both those options, the  exact duration of the experiment 
     
    223222            WRITE(numout,*) ' *** restart option' 
    224223            SELECT CASE ( nn_rsttr ) 
    225             CASE ( 0 )   ;   WRITE(numout,*) ' nn_rsttr = 0 : no control of nit000' 
    226             CASE ( 1 )   ;   WRITE(numout,*) ' nn_rsttr = 1 : no control the date at nit000 (use ndate0 read in the namelist)' 
     224            CASE ( 0 )   ;   WRITE(numout,*) ' nn_rsttr = 0 : no control of nittrc000' 
     225            CASE ( 1 )   ;   WRITE(numout,*) ' nn_rsttr = 1 : no control the date at nittrc000 (use ndate0 read in the namelist)' 
    227226            CASE ( 2 )   ;   WRITE(numout,*) ' nn_rsttr = 2 : calendar parameters read in restart' 
    228227            END SELECT 
     
    230229         ENDIF 
    231230         ! Control of date  
    232          IF( nit000  - NINT( zkt ) /= 1 .AND.  nn_rsttr /= 0 )                                  & 
    233             &   CALL ctl_stop( ' ===>>>> : problem with nit000 for the restart',                 & 
     231         IF( nittrc000  - NINT( zkt ) /= nn_dttrc .AND.  nn_rsttr /= 0 )                                  & 
     232            &   CALL ctl_stop( ' ===>>>> : problem with nittrc000 for the restart',                 & 
    234233            &                  ' verify the restart file or rerun with nn_rsttr = 0 (namelist)' ) 
    235234         IF( lk_offline ) THEN      ! set the date in offline mode 
     
    246245            ELSE 
    247246               ndastp = ndate0 - 1     ! ndate0 read in the namelist in dom_nam 
    248                adatrj = ( REAL( nit000-1, wp ) * rdttra(1) ) / rday 
     247               adatrj = ( REAL( nittrc000-1, wp ) * rdttra(1) ) / rday 
    249248               ! note this is wrong if time step has changed during run 
    250249            ENDIF 
  • branches/2011/dev_NOC_UKMO_MERGE/NEMOGCM/NEMO/TOP_SRC/trcstp.F90

    r2528 r3094  
    2222   USE iom 
    2323   USE in_out_manager 
     24   USE trcsub 
    2425 
    2526   IMPLICIT NONE 
     
    2728 
    2829   PUBLIC   trc_stp    ! called by step 
     30#  include "domzgr_substitute.h90" 
    2931    
    3032   !!---------------------------------------------------------------------- 
     
    4951      !!------------------------------------------------------------------- 
    5052 
    51       IF( MOD( kt - 1 , nn_dttrc ) == 0 ) THEN      ! only every nn_dttrc time step 
     53     IF( nn_dttrc /= 1 )   CALL trc_sub_stp( kt )  ! averaging physical variables for sub-stepping 
     54 
     55     IF( MOD( kt , nn_dttrc ) == 0 ) THEN      ! only every nn_dttrc time step 
    5256         ! 
    5357         IF(ln_ctl) THEN 
     
    5862         tra(:,:,:,:) = 0.e0 
    5963         ! 
    60          IF( kt == nit000 .AND. lk_trdmld_trc  )  & 
     64         IF( kt == nittrc000 .AND. lk_trdmld_trc  )  & 
    6165            &                      CALL trd_mld_trc_init        ! trends: Mixed-layer 
    6266                                   CALL trc_rst_opn( kt )       ! Open tracer restart file  
     
    6670                                   CALL trc_sms( kt )           ! tracers: sink and source 
    6771                                   CALL trc_trp( kt )           ! transport of passive tracers 
    68          IF( kt == nit000 )     CALL iom_close( numrtr )     ! close input  passive tracers restart file 
    69          IF( lrst_trc )            CALL trc_rst_wri( kt )       ! write tracer restart file 
    70          IF( lk_trdmld_trc  )      CALL trd_mld_trc( kt )       ! trends: Mixed-layer 
     72         IF( kt == nittrc000 )     CALL iom_close( numrtr )     ! close input  passive tracers restart file 
     73         IF( lrst_trc        )     CALL trc_rst_wri( kt )       ! write tracer restart file 
     74         IF( lk_trdmld_trc   )     CALL trd_mld_trc( kt )       ! trends: Mixed-layer 
     75         ! 
     76         IF( nn_dttrc /= 1   )     CALL trc_sub_reset( kt )  ! resetting physical variables when sub-stepping 
    7177         ! 
    7278      ENDIF 
  • branches/2011/dev_NOC_UKMO_MERGE/NEMOGCM/NEMO/TOP_SRC/trcwri.F90

    r2567 r3094  
    5757      !!--------------------------------------------------------------------- 
    5858  
    59       IF( lk_offline .AND. kt == nit000 .AND. lwp ) THEN    ! WRITE root name in date.file for use by postpro 
     59      IF( lk_offline .AND. kt == nittrc000 .AND. lwp ) THEN    ! WRITE root name in date.file for use by postpro 
    6060         CALL dia_nam( clhstnam, nn_writetrc,' ' ) 
    6161         CALL ctl_opn( inum, 'date.file', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp, narea ) 
  • branches/2011/dev_NOC_UKMO_MERGE/NEMOGCM/TOOLS/COMPILE/cfg.txt

    r2413 r3094  
    33GYRE_LOBSTER OPA_SRC TOP_SRC 
    44ORCA2_OFF_PISCES OPA_SRC OFF_SRC TOP_SRC 
    5 POMME OPA_SRC NST_SRC 
    65ORCA2_LIM3 OPA_SRC LIM_SRC_3 
    76ORCA2_LIM OPA_SRC LIM_SRC_2 NST_SRC 
     7POMME OPA_SRC NST_SRC 
     8AMM OPA_SRC TOP_SRC 
     9AMM-PISCES OPA_SRC TOP_SRC 
Note: See TracChangeset for help on using the changeset viewer.