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 3116 for branches/2011/dev_NEMO_MERGE_2011/NEMOGCM – NEMO

Ignore:
Timestamp:
2011-11-15T21:55:40+01:00 (12 years ago)
Author:
cetlod
Message:

dev_NEMO_MERGE_2011: add in changes dev_NOC_UKMO_MERGE developments

Location:
branches/2011/dev_NEMO_MERGE_2011/NEMOGCM
Files:
113 edited
20 copied

Legend:

Unmodified
Added
Removed
  • branches/2011/dev_NEMO_MERGE_2011/NEMOGCM/ARCH/arch-ALTIX_NAUTILUS4.fcm

    r2364 r3116  
    2222# Note use of -Bstatic because the library root directories are not accessible to the back-end compute nodes 
    2323%NCDF_LIB            -L%HDF5_HOME/lib -L%NCDF_HOME/lib -Bstatic -lnetcdf -lhdf5_fortran -lhdf5_hl -lhdf5 -Bdynamic -lz 
    24 %FC                  mpif90 
     24%FC                  ifort 
    2525%FCFLAGS             -r8 -O3 -xT -ip -vec-report0 
    2626%FFLAGS              -r8 -O3 -xT -ip -vec-report0 
    27 %LD                  mpif90 
     27%LD                  ifort 
    2828%FPPFLAGS            -P -C -traditional 
    29 %LDFLAGS 
     29%LDFLAGS             -lmpi 
    3030%AR                  ar  
    3131%ARFLAGS             -r 
  • branches/2011/dev_NEMO_MERGE_2011/NEMOGCM/CONFIG/AMM12_PISCES/EXP00/namelist

    r3113 r3116  
    9494/ 
    9595!----------------------------------------------------------------------- 
    96 &namdta_tem    !   data : temperature                                   ("key_dtatem") 
    97 !----------------------------------------------------------------------- 
    98 !              ! file name ! frequency (hours)    ! variable ! time interp. ! clim  !'yearly' or ! weights  ! rotation ! 
    99 !              !           !  (if <0  months)     !   name   !  (logical)   ! (T/F) ! 'monthly'  ! filename ! pairing  ! 
    100    sn_tem = 'data_1m_potential_temperature_nomask', -1,'votemper',  .true.  , .true., 'yearly'   , ' '      , ' ' 
     96&namtsd    !   data : Temperature  & Salinity 
     97!----------------------------------------------------------------------- 
     98!          ! file name ! frequency (hours)    ! variable ! time interp. ! clim  !'yearly' or ! weights  ! rotation ! 
     99!          !           !  (if <0  months)     !   name   !  (logical)   ! (T/F) ! 'monthly'  ! filename ! pairing  ! 
     100   sn_tem  = 'data_1m_potential_temperature_nomask', -1,'votemper',  .true.  , .true., 'yearly'   , ' '      , ' ' 
     101   sn_sal  = 'data_1m_salinity_nomask'             , -1,'vosaline',  .true.  , .true., 'yearly'   , ''       , ' ' 
    101102   ! 
    102    cn_dir       = './'     !  root directory for the location of the runoff files 
    103 / 
    104 !----------------------------------------------------------------------- 
    105 &namdta_sal    !   data : salinity                                      ("key_dtasal") 
    106 !----------------------------------------------------------------------- 
    107 !              ! file name ! frequency (hours)    ! variable ! time interp. ! clim  !'yearly' or ! weights  ! rotation ! 
    108 !              !           !  (if <0  months)     !   name   !   (logical)  ! (T/F) ! 'monthly'  ! filename ! pairing  ! 
    109    sn_sal      =  'data_1m_salinity_nomask',  -1  ,'vosaline',    .true.    , .true., 'yearly'   , ''       , ' ' 
    110    ! 
    111    cn_dir      = './'      !  root directory for the location of the runoff files 
    112 / 
    113  
     103   cn_dir        = './'     !  root directory for the location of the runoff files 
     104   ln_tsd_init   = .false.   !  Initialisation of ocean T & S with T &S input data (T) or not (F) 
     105   ln_tsd_tradmp = .false.   !  damping of ocean T & S toward T &S input data (T) or not (F) 
     106/ 
    114107!!====================================================================== 
    115108!!            ***  Surface Boundary Condition namelists  *** 
  • branches/2011/dev_NEMO_MERGE_2011/NEMOGCM/CONFIG/AMM12_PISCES/EXP00/namelist_pisces

    r3034 r3116  
    1515&nampisext     !   air-sea exchange 
    1616!,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, 
    17    atcco2     = 287.    ! atmospheric pCO2 
     17   ln_co2int  =  .false. ! read atm pco2 from a file (T) or constant (F) 
     18   atcco2     =  287.    ! Constant value atmospheric pCO2 - ln_co2int = F 
     19   clname     =  'atcco2.txt'  ! Name of atm pCO2 file - ln_co2int = T 
     20   nn_offset  =  0       ! Offset model-data start year - ln_co2int = T 
     21!                        ! If your model year is iyy, nn_offset=(years(1)-iyy)  
     22!                        ! then the first atmospheric CO2 record read is at years(1) 
     23/ 
     24!''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 
     25&nampisatm     !  Atmospheric prrssure  
     26!,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, 
     27!              !  file name   ! frequency (hours) ! variable   ! time interp. !  clim  ! 'yearly'/ ! weights  ! rotation ! 
     28!              !              !  (if <0  months)  !   name     !   (logical)  !  (T/F) ! 'monthly' ! filename ! pairing  ! 
     29   sn_patm     = 'presatm'    ,     -1            , 'patm'     ,  .true.      , .true. ,   'yearly'  , ''       , '' 
     30   cn_dir      = './'     !  root directory for the location of the dynamical files 
     31! 
     32   ln_presatm  = .true.   ! constant atmopsheric pressure (F) or from a file (T) 
    1833/ 
    1934!''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 
    2035&nampisbio     !   biological parameters 
    2136!,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, 
    22    part       =  0.85    ! part of calcite not dissolved in guts 
    23    nrdttrc    =  1       ! time step frequency for biology 
    24    wsbio      =  2.      ! POC sinking speed 
    25    xkmort     =  1.E-7   ! half saturation constant for mortality 
    26    ferat3     =  3.E-6   ! Fe/C in zooplankton  
    27    wsbio2     =  30.     ! Big particles sinking speed 
     37   nrdttrc    =  1        ! time step frequency for biology 
     38   wsbio      =  2.       ! POC sinking speed 
     39   xkmort     =  1.E-7    ! half saturation constant for mortality 
     40   ferat3     =  10.E-6   ! Fe/C in zooplankton  
     41   wsbio2     =  30.      ! Big particles sinking speed 
    2842/ 
    2943!''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 
     
    3145!,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, 
    3246   conc0      =  2.e-6    ! Phosphate half saturation 
    33    conc1      =  10E-6    ! Phosphate half saturation for diatoms 
    34    conc2      =  0.01E-9  ! Iron half saturation for phyto 
    35    conc2m     =  0.08E-9  ! Max iron half saturation for phyto 
    36    conc3      =  0.1E-9   ! Iron half saturation for diatoms 
    37    conc3m     =  0.4E-9   ! Maxi iron half saturation for diatoms 
     47   conc1      =  8E-6     ! Phosphate half saturation for diatoms 
     48   conc2      =  2E-9     ! Iron half saturation for phyto 
     49   conc2m     =  4E-9     ! Max iron half saturation for phyto 
     50   conc3      =  3E-9     ! Iron half saturation for diatoms 
     51   conc3m     =  9E-9     ! Maxi iron half saturation for diatoms 
     52   xsizedia   =  5.E-7    ! Minimum size criteria for diatoms 
     53   xsizephy   =  1.E-6    ! Minimum size criteria for phyto 
    3854   concnnh4   =  1.E-7    ! NH4 half saturation for phyto 
    39    concdnh4   =  5.E-7    ! NH4 half saturation for diatoms 
     55   concdnh4   =  4.E-7    ! NH4 half saturation for diatoms 
    4056   xksi1      =  2.E-6    ! half saturation constant for Si uptake 
    4157   xksi2      =  3.33E-6  ! half saturation constant for Si/C 
    4258   xkdoc      =  417.E-6  ! half-saturation constant of DOC remineralization 
    43    caco3r     =  0.15     ! mean rain ratio 
     59   concfebac  =  3.E-11   ! Half-saturation for Fe limitation of Bacteria 
     60   qnfelim    =  7.E-6    ! Optimal quota of phyto 
     61   qdfelim    =  7.E-6    ! Optimal quota of diatoms 
     62   caco3r     =  0.16     ! mean rain ratio 
    4463/ 
    4564!''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 
    4665&nampisprod     !   parameters for phytoplankton growth 
    4766!,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, 
    48    pislope    =  3.       ! P-I slope   
    49    pislope2   =  3.       ! P-I slope  for diatoms 
     67   pislope    =  3.       ! P-I slope 
     68   pislope2   =  2.       ! P-I slope  for diatoms 
    5069   excret     =  0.05     ! excretion ratio of phytoplankton 
    5170   excret2    =  0.05     ! excretion ratio of diatoms 
     71   ln_newprod =  .false.  ! Enable new parame. of production (T/F)  
     72   bresp      =  0.00333  ! Basal respiration rate 
    5273   chlcnm     =  0.033    ! Minimum Chl/C in nanophytoplankton 
    53    chlcdm     =  0.05     ! Minimum Chl/C in diatoms 
    54    fecnm      =  10E-6    ! Maximum Fe/C in nanophytoplankton 
    55    fecdm      =  15E-6    ! Minimum Fe/C in diatoms 
     74   chlcdm     =  0.04     ! Minimum Chl/C in diatoms 
     75   chlcmin    =  0.0033   ! Maximum Chl/c in phytoplankton 
     76   fecnm      =  40E-6    ! Maximum Fe/C in nanophytoplankton 
     77   fecdm      =  40E-6    ! Minimum Fe/C in diatoms 
    5678   grosip     =  0.151    ! mean Si/C ratio 
    5779/ 
     
    6890&nampismes     !   parameters for mesozooplankton 
    6991!,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, 
     92   part2      =  0.75    ! part of calcite not dissolved in mesozoo guts 
    7093   grazrat2   =  0.7      ! maximal mesozoo grazing rate 
    7194   resrat2    =  0.005    ! exsudation rate of mesozooplankton 
    7295   mzrat2     =  0.03     ! mesozooplankton mortality rate 
    7396   xprefc     =  1.       ! zoo preference for phyto 
    74    xprefp     =  0.2      ! zoo preference for POC 
     97   xprefp     =  0.3      ! zoo preference for POC 
    7598   xprefz     =  1.       ! zoo preference for zoo 
    76    xprefpoc   =  0.2      ! zoo preference for poc 
     99   xprefpoc   =  0.3      ! zoo preference for poc 
     100   xthresh2zoo = 1E-8     ! zoo feeding threshold for mesozooplankton  
     101   xthresh2dia = 1E-8     ! diatoms feeding threshold for mesozooplankton  
     102   xthresh2phy = 2E-7     ! nanophyto feeding threshold for mesozooplankton  
     103   xthresh2poc = 1E-8     ! poc feeding threshold for mesozooplankton  
     104   xthresh2   =  0.       ! Food threshold for grazing 
    77105   xkgraz2    =  20.E-6   ! half sturation constant for meso grazing 
    78    epsher2    =  0.33     ! Efficicency of Mesozoo growth  
     106   epsher2    =  0.33     ! Efficicency of Mesozoo growth 
    79107   sigma2     =  0.6      ! Fraction of mesozoo excretion as DOM 
    80108   unass2     =  0.3      ! non assimilated fraction of P by mesozoo 
    81    grazflux   =  5.e3     ! flux-feeding rate 
     109   grazflux   =  3.e3     ! flux-feeding rate 
    82110/ 
    83111!''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 
    84112&nampiszoo     !   parameters for microzooplankton 
    85113!,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, 
    86    grazrat    =  4.0      ! maximal zoo grazing rate    
     114   part       =  0.5      ! part of calcite not dissolved in microzoo gutsa 
     115   grazrat    =  3.0      ! maximal zoo grazing rate 
    87116   resrat     =  0.03     ! exsudation rate of zooplankton 
    88117   mzrat      =  0.0      ! zooplankton mortality rate 
    89    xpref2c    =  0.1      ! Microzoo preference for POM  
    90    xpref2p    =  0.45     ! Microzoo preference for Nanophyto 
    91    xpref2d    =  0.45     ! Microzoo preference for Diatoms 
    92    xkgraz     =  20.E-6   ! half sturation constant for grazing  
     118   xpref2c    =  0.1      ! Microzoo preference for POM 
     119   xpref2p    =  1.       ! Microzoo preference for Nanophyto 
     120   xpref2d    =  0.6      ! Microzoo preference for Diatoms 
     121   xthreshdia =  1.E-8    ! Diatoms feeding threshold for microzooplankton  
     122   xthreshphy =  2.E-7    ! Nanophyto feeding threshold for microzooplankton  
     123   xthreshpoc =  1.E-8    ! POC feeding threshold for microzooplankton  
     124   xthresh    =  0.       ! Food threshold for feeding 
     125   xkgraz     =  20.E-6   ! half sturation constant for grazing 
    93126   epsher     =  0.33     ! Efficiency of microzoo growth 
    94127   sigma1     =  0.6      ! Fraction of microzoo excretion as DOM 
     
    98131&nampisrem     !   parameters for remineralization 
    99132!,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, 
    100    xremik    =  0.3       ! remineralization rate of DOC 
     133   xremik    =  0.25      ! remineralization rate of DOC 
    101134   xremip    =  0.025     ! remineralisation rate of POC 
    102135   nitrif    =  0.05      ! NH4 nitrification rate 
    103    xsirem    =  0.015     ! remineralization rate of Si 
     136   xsirem    =  0.003     ! remineralization rate of Si 
     137   xsiremlab =  0.025     ! fast remineralization rate of Si 
     138   xsilab    =  0.31      ! Fraction of labile biogenic silica 
    104139   xlam1     =  0.005     ! scavenging rate of Iron 
    105    oxymin    =  1.E-6     ! Half-saturation constant for anoxia  
     140   oxymin    =  1.E-6     ! Half-saturation constant for anoxia 
     141   ligand    =  0.6E-9    ! Ligands concentration 
    106142/ 
    107143!''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 
    108144&nampiscal     !   parameters for Calcite chemistry 
    109145!,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, 
    110    kdca       =  0.327e3  ! calcite dissolution rate constant (1/time) 
     146   kdca       =  6.       ! calcite dissolution rate constant (1/time) 
    111147   nca        =  1.       ! order of dissolution reaction (dimensionless) 
    112148/ 
     
    114150&nampissed     !   parameters for inputs deposition 
    115151!,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, 
    116    ln_dustfer  =  .false.   ! boolean for dust input from the atmosphere 
    117    ln_river    =  .false.  ! boolean for river input of nutrients 
     152!              !  file name        ! frequency (hours) ! variable   ! time interp. !  clim  ! 'yearly'/ ! weights  ! rotation ! 
     153!              !                   !  (if <0  months)  !   name     !   (logical)  !  (T/F) ! 'monthly' ! filename ! pairing  ! 
     154   sn_dust     = 'dust.orca'       ,     -1            , 'dust'     ,  .true.      , .true. ,   'yearly'  , ''       , '' 
     155   sn_riverdic = 'river.orca'      ,    -12            , 'riverdic' ,  .false.     , .true. ,   'yearly'  , ''       , '' 
     156   sn_riverdoc = 'river.orca'      ,    -12            , 'riverdoc' ,  .false.     , .true. ,   'yearly'  , ''       , '' 
     157   sn_ndepo    = 'ndeposition.orca',    -12            , 'ndep'     ,  .false.     , .true. ,   'yearly'  , ''       , '' 
     158   sn_ironsed  = 'bathy.orca'      ,    -12            , 'bathy'    ,  .false.     , .true. ,   'yearly'  , ''       , '' 
     159! 
     160   cn_dir      = './'      !  root directory for the location of the dynamical files 
     161   ln_dust     =  .false.   ! boolean for dust input from the atmosphere 
     162   ln_river    =  .false.   ! boolean for river input of nutrients 
    118163   ln_ndepo    =  .false.   ! boolean for atmospheric deposition of N 
    119    ln_sedinput =  .false.   ! boolean for Fe input from sediments 
     164   ln_ironsed =  .false.   ! boolean for Fe input from sediments 
    120165   sedfeinput  =  1E-9     ! Coastal release of Iron 
    121    dustsolub   =  0.014    ! Solubility of the dust 
     166   dustsolub   =  0.02     ! Solubility of the dust 
     167   wdust       =  2.0      ! Dust sinking speed 
     168   nitrfix     =  1E-7     ! Nitrogen fixation rate 
     169   diazolight  =  50.      ! Diazotrophs sensitivity to light (W/m2) 
     170   concfediaz  =  1.E-10   ! Diazotrophs half-saturation Cste for Iron 
    122171/ 
    123172!''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 
     
    140189/ 
    141190!''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 
    142 &nampisdia     !   additional 2D/3D tracers diagnostics ("key_trc_diaadd") 
    143 !,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, 
    144    nn_writedia  =  5475   !  time step frequency for tracers diagnostics 
    145 ! 
     191&nampisdia     !   additional 2D/3D tracers diagnostics  
     192!,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, 
    146193!              !    name   !           title of the field          !     units      ! 
    147194!              !           !                                       !                !   
     
    175222!,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, 
    176223   ln_pisdmp    =  .true.     !  Relaxation fo some tracers to a mean value 
    177 / 
     224   nn_pisdmp    =  5475       !  Frequency of Relaxation  
     225/ 
  • branches/2011/dev_NEMO_MERGE_2011/NEMOGCM/CONFIG/AMM12_PISCES/EXP00/namelist_top

    r3034 r3116  
    11!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    22!! NEMO/TOP1 :  1 - tracer definition                     (namtrc    ) 
    3 !! namelists    2 - dynamical tracer trends               (namtrc_trd) 
     3!!              2 - tracer data initialisation            (namtrc_dta) 
    44!!              3 - tracer advection                      (namtrc_adv) 
    55!!              4 - tracer lateral diffusion              (namtrc_ldf) 
    66!!              5 - tracer vertical physics               (namtrc_zdf) 
    77!!              6 - tracer newtonian damping              (namtrc_dmp) 
     8!!              7 - dynamical tracer trends               (namtrc_trd) 
     9!!              8 - tracer output diagonstics             (namtrc_dia) 
    810!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    911!''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 
    1012&namtrc     !   tracers definition 
    1113!,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, 
    12    nn_dttrc      =  1       !  time step frequency for passive sn_tracers       
     14   nn_dttrc      =  1        !  time step frequency for passive sn_tracers       
    1315   nn_writetrc   =  10     !  time step frequency for sn_tracer outputs 
    1416   ln_rsttr      = .false.   !  start from a restart file (T) or not (F) 
     
    1820   cn_trcrst_in  = "restart_trc"   !  suffix of pass. sn_tracer restart name (input) 
    1921   cn_trcrst_out = "restart_trc"   !  suffix of pass. sn_tracer restart name (output) 
     22   ln_trcdta     =   .false. !  Initialisation from data input file (T) or not (F) 
    2023! 
    2124!              !    name   !           title of the field              !   units    ! initial data ! save   ! 
    2225!              !           !                                           !            ! from file    ! or not !  
    2326!              !           !                                           !            ! or not       !        ! 
    24    sn_tracer(1)   = 'DIC     ' , 'Dissolved inorganic Concentration      ',  'mol-C/L' ,  .false.     ,  .true. 
    25    sn_tracer(2)   = 'Alkalini' , 'Total Alkalinity Concentration         ',  'eq/L '   ,  .false.     ,  .true. 
    26    sn_tracer(3)   = 'O2      ' , 'Dissolved Oxygen Concentration         ',  'mol-C/L' ,  .false.     ,  .true. 
     27   sn_tracer(1)   = 'DIC     ' , 'Dissolved inorganic Concentration      ',  'mol-C/L' ,  .true.     ,  .true. 
     28   sn_tracer(2)   = 'Alkalini' , 'Total Alkalinity Concentration         ',  'eq/L '   ,  .true.     ,  .true. 
     29   sn_tracer(3)   = 'O2      ' , 'Dissolved Oxygen Concentration         ',  'mol-C/L' ,  .true.     ,  .true. 
    2730   sn_tracer(4)   = 'CaCO3   ' , 'Calcite Concentration                  ',  'mol-C/L' ,  .false.    ,  .true. 
    28    sn_tracer(5)   = 'PO4     ' , 'Phosphate Concentration                ',  'mol-C/L' ,  .false.     ,  .true. 
     31   sn_tracer(5)   = 'PO4     ' , 'Phosphate Concentration                ',  'mol-C/L' ,  .true.     ,  .true. 
    2932   sn_tracer(6)   = 'POC     ' , 'Small organic carbon Concentration     ',  'mol-C/L' ,  .false.    ,  .true. 
    30    sn_tracer(7)   = 'Si      ' , 'Silicate Concentration                 ',  'mol-C/L' ,  .false.     ,  .true. 
     33   sn_tracer(7)   = 'Si      ' , 'Silicate Concentration                 ',  'mol-C/L' ,  .true.     ,  .true. 
    3134   sn_tracer(8)   = 'PHY     ' , 'Nanophytoplankton Concentration        ',  'mol-C/L' ,  .false.    ,  .true. 
    3235   sn_tracer(9)   = 'ZOO     ' , 'Microzooplankton Concentration         ',  'mol-C/L' ,  .false.    ,  .true. 
     
    3538   sn_tracer(12)  = 'ZOO2    ' , 'Mesozooplankton Concentration          ',  'mol-C/L' ,  .false.    ,  .true. 
    3639   sn_tracer(13)  = 'BSi     ' , 'Diatoms Silicate Concentration         ',  'mol-C/L' ,  .false.    ,  .true. 
    37    sn_tracer(14)  = 'Fer     ' , 'Dissolved Iron Concentration           ',  'mol-C/L' ,  .false.     ,  .true. 
     40   sn_tracer(14)  = 'Fer     ' , 'Dissolved Iron Concentration           ',  'mol-C/L' ,  .true.     ,  .true. 
    3841   sn_tracer(15)  = 'BFe     ' , 'Big iron particles Concentration       ',  'mol-C/L' ,  .false.    ,  .true. 
    3942   sn_tracer(16)  = 'GOC     ' , 'Big organic carbon Concentration       ',  'mol-C/L' ,  .false.    ,  .true. 
     
    4447   sn_tracer(21)  = 'NCHL    ' , 'Nano chlorophyl Concentration          ',  'mol-C/L' ,  .false.    ,  .true. 
    4548   sn_tracer(22)  = 'DCHL    ' , 'Diatoms chlorophyl Concentration       ',  'mol-C/L' ,  .false.    ,  .true. 
    46    sn_tracer(23)  = 'NO3     ' , 'Nitrates Concentration                 ',  'mol-C/L' ,  .false.     ,  .true. 
     49   sn_tracer(23)  = 'NO3     ' , 'Nitrates Concentration                 ',  'mol-C/L' ,  .true.     ,  .true. 
    4750   sn_tracer(24)  = 'NH4     ' , 'Ammonium Concentration                 ',  'mol-C/L' ,  .false.    ,  .true. 
     51/ 
     52!----------------------------------------------------------------------- 
     53&namtrc_dta      !    Initialisation from data input file 
     54!----------------------------------------------------------------------- 
     55! 
     56!                !  file name               ! frequency (hours) ! variable   ! time interp. !  clim  ! 'yearly'/ ! weights  ! rotation ! 
     57!                !                          !  (if <0  months)  !   name     !   (logical)  !  (T/F) ! 'monthly' ! filename ! pairing  ! 
     58   sn_trcdta(1)  = 'data_DIC_nomask'        ,        -12        ,  'DIC'     ,    .false.   , .true. , 'yearly'  , ''       , '' 
     59   sn_trcdta(2)  = 'data_Alkalini_nomask'   ,        -12        ,  'Alkalini',    .false.   , .true. , 'yearly'  , ''       , '' 
     60   sn_trcdta(3)  = 'data_O2_nomask'         ,        -1         ,  'O2'      ,    .true.    , .true. , 'yearly'  , ''       , '' 
     61   sn_trcdta(5)  = 'data_PO4_nomask'        ,        -1         ,  'PO4'     ,    .true.    , .true. , 'yearly'  , ''       , '' 
     62   sn_trcdta(7)  = 'data_Si_nomask'         ,        -1         ,  'Si'      ,    .true.    , .true. , 'yearly'  , ''       , '' 
     63   sn_trcdta(10) = 'data_DOC_nomask'        ,        -12        ,  'DOC'     ,    .false.   , .true. , 'yearly'  , ''       , '' 
     64   sn_trcdta(14) = 'data_Fer_nomask'        ,        -12        ,  'Fer'     ,    .false.   , .true. , 'yearly'  , ''       , '' 
     65   sn_trcdta(23) = 'data_NO3_nomask'        ,        -1         ,  'NO3'     ,    .true.    , .true. , 'yearly'  , ''       , '' 
     66! 
     67   cn_dir        =  './'      !  root directory for the location of the data files 
     68   rn_trfac(1)   =   1.0e-06  !  multiplicative factor 
     69   rn_trfac(2)   =   1.0e-06  !  -      -      -     - 
     70   rn_trfac(3)   =  44.6e-06  !  -      -      -     - 
     71   rn_trfac(5)   = 122.0e-06  !  -      -      -     - 
     72   rn_trfac(7)   =   1.0e-06  !  -      -      -     - 
     73   rn_trfac(10)  =   1.0      !  -      -      -     - 
     74   rn_trfac(14)  =   1.0      !  -      -      -     - 
     75   rn_trfac(23)  =   7.6e-06  !  -      -      -     - 
    4876/ 
    4977!----------------------------------------------------------------------- 
     
    6997   ln_trcldf_iso    =  .true.   !     iso-neutral                       (require "key_ldfslp") 
    7098!                               !  Coefficient 
     99   rn_ahtrc_0       =  2000.    !  horizontal eddy diffusivity for tracers [m2/s] 
    71100   rn_ahtrb_0       =     0.    !     background eddy diffusivity for ldf_iso [m2/s] 
    72101/ 
     
    83112/ 
    84113!----------------------------------------------------------------------- 
    85 &namtrc_dmp    !   passive tracer newtonian damping    ('key_tradmp && key_trcdmp') 
     114&namtrc_dmp    !   passive tracer newtonian damping    
    86115!----------------------------------------------------------------------- 
     116   ln_trcdmp   =  .false.  !  add a damping termn (T) or not (F) 
    87117   nn_hdmp_tr  =   -1      !  horizontal shape =-1, damping in Med and Red Seas only 
    88118                           !                   =XX, damping poleward of XX degrees (XX>0) 
     
    107137   ln_trdtrc(1)  =   .true. 
    108138   ln_trdtrc(2)  =   .true. 
    109    ln_trdtrc(3)  =   .false. 
    110    ln_trdtrc(4)  =   .false. 
    111    ln_trdtrc(5)  =   .false. 
    112    ln_trdtrc(6)  =   .false. 
    113    ln_trdtrc(7)  =   .false. 
    114    ln_trdtrc(8)  =   .false. 
    115    ln_trdtrc(9)  =   .false. 
    116    ln_trdtrc(10) =   .false. 
    117    ln_trdtrc(11) =   .false. 
    118    ln_trdtrc(12) =   .false. 
    119    ln_trdtrc(13) =   .false. 
    120    ln_trdtrc(14) =   .false. 
    121    ln_trdtrc(15) =   .false. 
    122    ln_trdtrc(16) =   .false. 
    123    ln_trdtrc(17) =   .false. 
    124    ln_trdtrc(18) =   .false. 
    125    ln_trdtrc(19) =   .false. 
    126    ln_trdtrc(20) =   .false. 
    127    ln_trdtrc(21) =   .false. 
    128    ln_trdtrc(22) =   .false. 
    129139   ln_trdtrc(23) =   .true. 
    130    ln_trdtrc(24) =   .false. 
    131140/ 
     141!----------------------------------------------------------------------- 
     142&namtrc_dia       !   parameters for passive tracer additional diagnostics 
     143!---------------------------------------------------------------------- 
     144   ln_diatrc     =  .false.  !  save additional diag. (T) or not (F) 
     145   nn_writedia   =  5475     !  time step frequency for diagnostics 
     146/ 
  • branches/2011/dev_NEMO_MERGE_2011/NEMOGCM/CONFIG/AMM12_PISCES/cpp_AMM12_PISCES.fcm

    r3110 r3116  
    1  bld::tool::fppkeys key_top key_pisces key_diatrc key_bdy key_vectopt_loop key_amm_12km  key_dynspg_ts key_ldfslp  key_zdfgls  key_vvl key_diainstant key_mpp_mpi 
     1 bld::tool::fppkeys key_top key_pisces key_bdy key_vectopt_loop key_amm_12km  key_dynspg_ts key_ldfslp  key_zdfgls  key_vvl key_diainstant key_mpp_mpi 
  • branches/2011/dev_NEMO_MERGE_2011/NEMOGCM/CONFIG/GYRE/EXP00/namelist

    r3105 r3116  
    33!! namelists    2 - Domain           (namzgr, namzgr_sco, namdom, namtsd) 
    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) 
     
    114114!!   namsbc_mfs      MFS  bulk formulae formulation 
    115115!!   namsbc_cpl      CouPLed            formulation                     ("key_coupled") 
    116 !!   namsbc_cpl_co2  coupled ocean/biogeo/atmosphere model              ("key_cpl_carbon_cycle") 
    117116!!   namtra_qsr      penetrative solar radiation 
    118117!!   namsbc_rnf      river runoffs 
     
    222221&namsbc_cpl    !   coupled ocean/atmosphere model                       ("key_coupled") 
    223222!----------------------------------------------------------------------- 
    224 !                                      ! send 
    225 cn_snd_temperature= 'weighted oce and ice'  !  'oce only' 'weighted oce and ice' 'mixed oce-ice' 
    226 cn_snd_albedo     = 'weighted ice'          !  'none' 'weighted ice' 'mixed oce-ice' 
    227 cn_snd_thickness  = 'none'                  !  'none' 'weighted ice and snow' 
    228 cn_snd_crt_nature = 'none'                  !  'none' 'oce only' 'weighted oce and ice' 'mixed oce-ice' 
    229 cn_snd_crt_refere = 'spherical'             !  'spherical' 'cartesian' 
    230 cn_snd_crt_orient = 'eastward-northward'    !  'eastward-northward' or 'local grid' 
    231 cn_snd_crt_grid   = 'T'                     !  'T' 
    232 !                                      ! receive 
    233 cn_rcv_w10m       = 'none'                  !  'none' 'coupled' 
    234 cn_rcv_taumod     = 'coupled'               !  'none' 'coupled' 
    235 cn_rcv_tau_nature = 'oce only'              !  'oce only' 'oce and ice' 'mixed oce-ice' 
    236 cn_rcv_tau_refere = 'cartesian'             !  'spherical' 'cartesian' 
    237 cn_rcv_tau_orient = 'eastward-northward'    !  'eastward-northward' or 'local grid' 
    238 cn_rcv_tau_grid   = 'U,V'                   !  'T' 'U,V' 'U,V,F' 'U,V,I' 'T,F' 'T,I' 'T,U,V' 
    239 cn_rcv_dqnsdt     = 'coupled'               !  'none' 'coupled' 
    240 cn_rcv_qsr        = 'oce and ice'           !  'conservative' 'oce and ice' 'mixed oce-ice' 
    241 cn_rcv_qns        = 'oce and ice'           !  'conservative' 'oce and ice' 'mixed oce-ice' 
    242 cn_rcv_emp        = 'conservative'          !  'conservative' 'oce and ice' 'mixed oce-ice' 
    243 cn_rcv_rnf        = 'coupled'               !  'coupled' 'climato' 'mixed' 
    244 cn_rcv_cal        = 'coupled'               !  'none' 'coupled' 
    245 / 
    246 !----------------------------------------------------------------------- 
    247 &namsbc_cpl_co2   !   coupled ocean/biogeo/atmosphere model             ("key_cpl_carbon_cycle") 
    248 !----------------------------------------------------------------------- 
    249    cn_snd_co2     = 'coupled'         ! send    : 'none' 'coupled' 
    250    cn_rcv_co2     = 'coupled'         ! receive : 'none' 'coupled' 
     223!                    !     description       !  multiple  !    vector   !      vector          ! vector ! 
     224!                    !                       ! categories !  reference  !    orientation       ! grids  ! 
     225! send 
     226sn_snd_temp   =       'weighted oce and ice' ,    'no'    ,     ''      ,         ''           ,   ''     
     227sn_snd_alb    =       'weighted ice'         ,    'no'    ,     ''      ,         ''           ,   ''     
     228sn_snd_thick  =       'none'                 ,    'no'   ,     ''      ,         ''           ,   ''     
     229sn_snd_crt    =       'none'                 ,    'no'    , 'spherical' , 'eastward-northward' ,  'T'        
     230sn_snd_co2    =       'coupled'              ,    'no'    ,     ''      ,         ''           ,   ''         
     231! receive 
     232sn_rcv_w10m   =       'none'                 ,    'no'    ,     ''      ,         ''          ,   ''     
     233sn_rcv_taumod =       'coupled'              ,    'no'    ,     ''      ,         ''          ,   ''     
     234sn_rcv_tau    =       'oce only'             ,    'no'    , 'cartesian' , 'eastward-northward',  'U,V'    
     235sn_rcv_dqnsdt =       'coupled'              ,    'no'    ,     ''      ,         ''          ,   ''     
     236sn_rcv_qsr    =       'oce and ice'          ,    'no'    ,     ''      ,         ''          ,   ''     
     237sn_rcv_qns    =       'oce and ice'          ,    'no'    ,     ''      ,         ''          ,   ''     
     238sn_rcv_emp    =       'conservative'         ,    'no'    ,     ''      ,         ''          ,   ''     
     239sn_rcv_rnf    =       'coupled'              ,    'no'    ,     ''      ,         ''          ,   ''     
     240sn_rcv_cal    =       'coupled'              ,    'no'    ,     ''      ,         ''          ,   ''     
     241sn_rcv_co2    =       'coupled'              ,    'no'    ,     ''      ,         ''          ,   ''     
    251242/ 
    252243!----------------------------------------------------------------------- 
     
    402393&nambdy        !  unstructured open boundaries                          ("key_bdy") 
    403394!----------------------------------------------------------------------- 
    404    cn_mask     =  ''                     !  name of mask file (ln_mask=T) 
    405    cn_dta_frs_T= 'bdydata_grid_T.nc'     !  name of data file (T-points) 
    406    cn_dta_frs_U= 'bdydata_grid_U.nc'     !  name of data file (U-points) 
    407    cn_dta_frs_V= 'bdydata_grid_V.nc'     !  name of data file (V-points) 
    408    cn_dta_fla_T= 'bdydata_bt_grid_T.nc'  !  name of data file for Flather condition (T-points) 
    409    cn_dta_fla_U= 'bdydata_bt_grid_U.nc'  !  name of data file for Flather condition (U-points) 
    410    cn_dta_fla_V= 'bdydata_bt_grid_V.nc'  !  name of data file for Flather condition (V-points) 
    411  
    412    ln_clim     = .false.   !  contain 1 (T) or 12 (F) time dumps and be cyclic 
    413    ln_vol      = .false.   !  total volume correction (see volbdy parameter) 
    414    ln_mask     = .false.   !  boundary mask from filbdy_mask (T), boundaries are on edges of domain (F) 
    415    ln_tides    = .false.   !  Apply tidal harmonic forcing with Flather condition 
    416    ln_dyn_fla  = .false.   !  Apply Flather condition to velocities 
    417    ln_tra_frs  = .false.   !  Apply FRS condition to temperature and salinity  
    418    ln_dyn_frs  = .false.   !  Apply FRS condition to velocities 
    419    nn_rimwidth =  9        !  width of the relaxation zone 
    420    nn_dtactl   =  1        !  = 0, bdy data are equal to the initial state 
     395    nb_bdy = 1                            !  number of open boundary sets        
     396    ln_coords_file = .true.               !  =T : read bdy coordinates from file 
     397    cn_coords_file = 'coordinates.bdy.nc' !  bdy coordinates files 
     398    ln_mask_file = .false.                !  =T : read mask from file 
     399    cn_mask_file = ''                     !  name of mask file (if ln_mask_file=.TRUE.) 
     400    nn_dyn2d      =  2                    !  boundary conditions for barotropic fields 
     401    nn_dyn2d_dta  =  3                    !  = 0, bdy data are equal to the initial state 
     402                                          !  = 1, bdy data are read in 'bdydata   .nc' files 
     403                                          !  = 2, use tidal harmonic forcing data from files 
     404                                          !  = 3, use external data AND tidal harmonic forcing 
     405    nn_dyn3d      =  0                    !  boundary conditions for baroclinic velocities 
     406    nn_dyn3d_dta  =  0                    !  = 0, bdy data are equal to the initial state 
    421407                           !  = 1, bdy data are read in 'bdydata   .nc' files 
    422    nn_volctl   =  0        !  = 0, the total water flux across open boundaries is zero 
    423                            !  = 1, the total volume of the system is conserved 
    424 / 
    425 !----------------------------------------------------------------------- 
    426 &nambdy_tide   !  tidal forcing at unstructured boundaries               
    427 !----------------------------------------------------------------------- 
    428    filtide     = 'bdytide_'           !  file name root of tidal forcing files 
    429    tide_cpt    = 'M2','S1'            !  names of tidal components used 
    430    tide_speed  = 28.984106, 15.000001 !  phase speeds of tidal components (deg/hour) 
    431    ln_tide_date= .false.              !  adjust tidal harmonics for start date of run 
    432 / 
    433  
     408    nn_tra        =  1                    !  boundary conditions for T and S 
     409    nn_tra_dta    =  1                    !  = 0, bdy data are equal to the initial state 
     410                           !  = 1, bdy data are read in 'bdydata   .nc' files 
     411    nn_rimwidth  = 10                      !  width of the relaxation zone 
     412    nn_dmp2d_in  = 0                      ! 
     413    nn_dmp2d_out = 0                      ! 
     414    nn_dmp2d_in  = 0                      ! 
     415    nn_dmp2d_out = 0                      ! 
     416    ln_vol     = .false.                  !  total volume correction (see nn_volctl parameter) 
     417    nn_volctl  = 1                        !  = 0, the total water flux across open boundaries is zero 
     418/ 
     419!----------------------------------------------------------------------- 
     420&nambdy_dta      !  open boundaries - external data           ("key_bdy") 
     421!----------------------------------------------------------------------- 
     422!              !   file name    ! frequency (hours) !  variable  ! time interpol. !  clim   ! 'yearly'/ ! weights  ! rotation ! 
     423!              !                !  (if <0  months)  !    name    !    (logical)   !  (T/F)  ! 'monthly' ! filename ! pairing  ! 
     424   bn_ssh =     'amm12_bdyT_u2d' ,         24        , 'sossheig' ,     .true.     , .false. ,  'daily'  ,    ''    ,   '' 
     425   bn_u2d =     'amm12_bdyU_u2d' ,         24        , 'vobtcrtx' ,     .true.     , .false. ,  'daily'  ,    ''    ,   '' 
     426   bn_v2d =     'amm12_bdyV_u2d' ,         24        , 'vobtcrty' ,     .true.     , .false. ,  'daily'  ,    ''    ,   '' 
     427   bn_u3d  =    'amm12_bdyU_u3d' ,         24        , 'vozocrtx' ,     .true.     , .false. ,  'daily'  ,    ''    ,   '' 
     428   bn_v3d  =    'amm12_bdyV_u3d' ,         24        , 'vomecrty' ,     .true.     , .false. ,  'daily'  ,    ''    ,   '' 
     429   bn_tem  =    'amm12_bdyT_tra' ,         24        , 'votemper' ,     .true.     , .false. ,  'daily'  ,    ''    ,   '' 
     430   bn_sal  =    'amm12_bdyT_tra' ,         24        , 'vosaline' ,     .true.     , .false. ,  'daily'  ,    ''    ,   '' 
     431   cn_dir  =    'bdydta/' 
     432   ln_full_vel = .false. 
     433/ 
     434!----------------------------------------------------------------------- 
     435&nambdy_tide     ! tidal forcing at open boundaries               
     436!----------------------------------------------------------------------- 
     437   filtide      = 'bdydta/amm12_bdytide_'         !  file name root of tidal forcing files 
     438    tide_cpt(1)   ='Q1'  !  names of tidal components used 
     439    tide_cpt(2)   ='O1'  !  names of tidal components used 
     440    tide_cpt(3)   ='P1'  !  names of tidal components used 
     441    tide_cpt(4)   ='S1'  !  names of tidal components used 
     442    tide_cpt(5)   ='K1'  !  names of tidal components used 
     443    tide_cpt(6)   ='2N2' !  names of tidal components used 
     444    tide_cpt(7)   ='MU2' !  names of tidal components used 
     445    tide_cpt(8)   ='N2'  !  names of tidal components used 
     446    tide_cpt(9)   ='NU2' !  names of tidal components used 
     447    tide_cpt(10)   ='M2'  !  names of tidal components used 
     448    tide_cpt(11)   ='L2'  !  names of tidal components used 
     449    tide_cpt(12)   ='T2'  !  names of tidal components used 
     450    tide_cpt(13)   ='S2'  !  names of tidal components used 
     451    tide_cpt(14)   ='K2'  !  names of tidal components used 
     452    tide_cpt(15)   ='M4'  !  names of tidal components used 
     453    tide_speed(1)   = 13.398661 !  phase speeds of tidal components (deg/hour) 
     454    tide_speed(2)   = 13.943036 !  phase speeds of tidal components (deg/hour) 
     455    tide_speed(3)   = 14.958932 !  phase speeds of tidal components (deg/hour) 
     456    tide_speed(4)   = 15.000001 !  phase speeds of tidal components (deg/hour) 
     457    tide_speed(5)   = 15.041069 !  phase speeds of tidal components (deg/hour) 
     458    tide_speed(6)   = 27.895355 !  phase speeds of tidal components (deg/hour) 
     459    tide_speed(7)   = 27.968210 !  phase speeds of tidal components (deg/hour) 
     460    tide_speed(8)   = 28.439730 !  phase speeds of tidal components (deg/hour) 
     461    tide_speed(9)   = 28.512585 !  phase speeds of tidal components (deg/hour) 
     462    tide_speed(10)   = 28.984106 !  phase speeds of tidal components (deg/hour) 
     463    tide_speed(11)   = 29.528479 !  phase speeds of tidal components (deg/hour) 
     464    tide_speed(12)   = 29.958935 !  phase speeds of tidal components (deg/hour) 
     465    tide_speed(13)   = 30.000002 !  phase speeds of tidal components (deg/hour) 
     466    tide_speed(14)   = 30.082138 !  phase speeds of tidal components (deg/hour) 
     467    tide_speed(15)   = 57.968212 !  phase speeds of tidal components (deg/hour) 
     468    ln_tide_date = .true.               !  adjust tidal harmonics for start date of run 
     469/ 
    434470!!====================================================================== 
    435471!!                 ***  Bottom boundary condition  *** 
     
    450486   ln_bfr2d    = .false.   !  horizontal variation of the bottom friction coef (read a 2D mask file ) 
    451487   rn_bfrien   =    50.    !  local multiplying factor of bfr (ln_bfr2d = .true.) 
     488   ln_bfrimp   = .true.    !  implicit bottom friction (requires ln_zdfexp = .false. if true) 
    452489/ 
    453490!----------------------------------------------------------------------- 
     
    496533   ln_traadv_muscl2 =  .false.  !  MUSCL2 scheme + cen2 at boundaries   
    497534   ln_traadv_ubs    =  .false.  !  UBS scheme                  
    498    ln_traadv_qck    =  .false.  !  QUCIKEST scheme                  
     535   ln_traadv_qck    =  .false.  !  QUICKEST scheme                  
    499536/ 
    500537!----------------------------------------------------------------------- 
     
    508545   ln_traldf_hor    =  .false.  !  horizontal (geopotential)            (require "key_ldfslp" when ln_sco=T) 
    509546   ln_traldf_iso    =  .true.   !  iso-neutral                          (require "key_ldfslp") 
    510    ln_traldf_grif   =  .false.  !  griffies skew flux formulation       (require "key_ldfslp")  ! UNDER TEST, DO NOT USE 
    511    ln_traldf_gdia   =  .false.  !  griffies operator strfn diagnostics  (require "key_ldfslp")  ! UNDER TEST, DO NOT USE 
     547   ln_traldf_grif   =  .false.  !  griffies skew flux formulation       (require "key_ldfslp") 
     548   ln_traldf_gdia   =  .false.  !  griffies operator strfn diagnostics  (require "key_ldfslp") 
     549   ln_triad_iso     =  .false.  !  griffies operator calculates triads twice => pure lateral mixing in ML (require "key_ldfslp") 
     550   ln_botmix_grif   =  .false.  !  griffies operator with lateral mixing on bottom (require "key_ldfslp") 
    512551   !                       !  Coefficient 
    513552   rn_aht_0         =  1000.    !  horizontal eddy diffusivity for tracers [m2/s] 
     
    562601   ln_hpg_zps  = .false.   !  z-coordinate - partial steps (interpolation) 
    563602   ln_hpg_sco  = .false.   !  s-coordinate (standard jacobian formulation) 
    564    ln_hpg_hel  = .false.   !  s-coordinate (helsinki modification) 
    565    ln_hpg_wdj  = .false.   !  s-coordinate (weighted density jacobian) 
    566603   ln_hpg_djc  = .false.   !  s-coordinate (Density Jacobian with Cubic polynomial) 
    567    ln_hpg_rot  = .false.   !  s-coordinate (ROTated axes scheme) 
    568    rn_gamma    = 0.e0      !  weighting coefficient (wdj scheme) 
     604   ln_hpg_prj  = .false.   !  s-coordinate (Pressure Jacobian scheme) 
    569605   ln_dynhpg_imp = .false. !  time stepping: semi-implicit time scheme  (T) 
    570606                                 !           centered      time scheme  (F) 
     
    735771                           !  buffer blocking send or immediate non-blocking sends, resp. 
    736772   nn_buffer   =   0       !  size in bytes of exported buffer ('B' case), 0 no exportation 
     773   ln_nnogather=  .false.  !  activate code to avoid mpi_allgather use at the northfold 
    737774   jpni        =   0       !  jpni   number of processors following i (set automatically if < 1)      
    738775   jpnj        =   0       !  jpnj   number of processors following j (set automatically if < 1)      
     
    926963   cn_dir_cdg  = './'  !  root directory for the location of drag coefficient files 
    927964/ 
     965!----------------------------------------------------------------------- 
     966&namdyn_nept  !   Neptune effect (simplified: lateral and vertical diffusions removed) 
     967!----------------------------------------------------------------------- 
     968   ! Suggested lengthscale values are those of Eby & Holloway (1994) for a coarse model 
     969   ln_neptsimp       = .false.  ! yes/no use simplified neptune 
     970 
     971   ln_smooth_neptvel = .false.  ! yes/no smooth zunep, zvnep 
     972   rn_tslse          =  1.2e4   ! value of lengthscale L at the equator 
     973   rn_tslsp          =  3.0e3   ! value of lengthscale L at the pole 
     974   ! Specify whether to ramp down the Neptune velocity in shallow 
     975   ! water, and if so the depth range controlling such ramping down 
     976   ln_neptramp       = .false.  ! ramp down Neptune velocity in shallow water 
     977   rn_htrmin         =  100.0   ! min. depth of transition range 
     978   rn_htrmax         =  200.0   ! max. depth of transition range 
     979/ 
  • branches/2011/dev_NEMO_MERGE_2011/NEMOGCM/CONFIG/ORCA2_LIM/EXP00/1_namelist

    r3104 r3116  
    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!----------------------------------------------------------------------- 
     
    369360&nambdy        !  unstructured open boundaries                          ("key_bdy") 
    370361!----------------------------------------------------------------------- 
    371    cn_mask     =  ''                     !  name of mask file (ln_mask=T) 
    372    cn_dta_frs_T= 'bdydata_grid_T.nc'     !  name of data file (T-points) 
    373    cn_dta_frs_U= 'bdydata_grid_U.nc'     !  name of data file (U-points) 
    374    cn_dta_frs_V= 'bdydata_grid_V.nc'     !  name of data file (V-points) 
    375    cn_dta_fla_T= 'bdydata_bt_grid_T.nc'  !  name of data file for Flather condition (T-points) 
    376    cn_dta_fla_U= 'bdydata_bt_grid_U.nc'  !  name of data file for Flather condition (U-points) 
    377    cn_dta_fla_V= 'bdydata_bt_grid_V.nc'  !  name of data file for Flather condition (V-points) 
    378  
    379    ln_clim     = .false.   !  contain 1 (T) or 12 (F) time dumps and be cyclic 
    380    ln_vol      = .false.   !  total volume correction (see volbdy parameter) 
    381    ln_mask     = .false.   !  boundary mask from filbdy_mask (T), boundaries are on edges of domain (F) 
    382    ln_tides    = .false.   !  Apply tidal harmonic forcing with Flather condition 
    383    ln_dyn_fla  = .false.   !  Apply Flather condition to velocities 
    384    ln_tra_frs  = .false.   !  Apply FRS condition to temperature and salinity  
    385    ln_dyn_frs  = .false.   !  Apply FRS condition to velocities 
    386    nn_rimwidth =  9        !  width of the relaxation zone 
    387    nn_dtactl   =  1        !  = 0, bdy data are equal to the initial state 
     362    nb_bdy = 1                            !  number of open boundary sets        
     363    ln_coords_file = .true.               !  =T : read bdy coordinates from file 
     364    cn_coords_file = 'coordinates.bdy.nc' !  bdy coordinates files 
     365    ln_mask_file = .false.                !  =T : read mask from file 
     366    cn_mask_file = ''                     !  name of mask file (if ln_mask_file=.TRUE.) 
     367    nn_dyn2d      =  2                    !  boundary conditions for barotropic fields 
     368    nn_dyn2d_dta  =  3                    !  = 0, bdy data are equal to the initial state 
     369                                          !  = 1, bdy data are read in 'bdydata   .nc' files 
     370                                          !  = 2, use tidal harmonic forcing data from files 
     371                                          !  = 3, use external data AND tidal harmonic forcing 
     372    nn_dyn3d      =  0                    !  boundary conditions for baroclinic velocities 
     373    nn_dyn3d_dta  =  0                    !  = 0, bdy data are equal to the initial state 
    388374                           !  = 1, bdy data are read in 'bdydata   .nc' files 
    389    nn_volctl   =  0        !  = 0, the total water flux across open boundaries is zero 
    390                            !  = 1, the total volume of the system is conserved 
    391 / 
    392 !----------------------------------------------------------------------- 
    393 &nambdy_tide   !  tidal forcing at unstructured boundaries               
    394 !----------------------------------------------------------------------- 
    395    filtide     = 'bdytide_'           !  file name root of tidal forcing files 
    396    tide_cpt    = 'M2','S1'            !  names of tidal components used 
    397    tide_speed  = 28.984106, 15.000001 !  phase speeds of tidal components (deg/hour) 
    398    ln_tide_date= .false.              !  adjust tidal harmonics for start date of run 
    399 / 
    400  
     375    nn_tra        =  1                    !  boundary conditions for T and S 
     376    nn_tra_dta    =  1                    !  = 0, bdy data are equal to the initial state 
     377                           !  = 1, bdy data are read in 'bdydata   .nc' files 
     378    nn_rimwidth  = 10                      !  width of the relaxation zone 
     379    nn_dmp2d_in  = 0                      ! 
     380    nn_dmp2d_out = 0                      ! 
     381    nn_dmp2d_in  = 0                      ! 
     382    nn_dmp2d_out = 0                      ! 
     383    ln_vol     = .false.                  !  total volume correction (see nn_volctl parameter) 
     384    nn_volctl  = 1                        !  = 0, the total water flux across open boundaries is zero 
     385/ 
     386!----------------------------------------------------------------------- 
     387&nambdy_dta      !  open boundaries - external data           ("key_bdy") 
     388!----------------------------------------------------------------------- 
     389!              !   file name    ! frequency (hours) !  variable  ! time interpol. !  clim   ! 'yearly'/ ! weights  ! rotation ! 
     390!              !                !  (if <0  months)  !    name    !    (logical)   !  (T/F)  ! 'monthly' ! filename ! pairing  ! 
     391   bn_ssh =     'amm12_bdyT_u2d' ,         24        , 'sossheig' ,     .true.     , .false. ,  'daily'  ,    ''    ,   '' 
     392   bn_u2d =     'amm12_bdyU_u2d' ,         24        , 'vobtcrtx' ,     .true.     , .false. ,  'daily'  ,    ''    ,   '' 
     393   bn_v2d =     'amm12_bdyV_u2d' ,         24        , 'vobtcrty' ,     .true.     , .false. ,  'daily'  ,    ''    ,   '' 
     394   bn_u3d  =    'amm12_bdyU_u3d' ,         24        , 'vozocrtx' ,     .true.     , .false. ,  'daily'  ,    ''    ,   '' 
     395   bn_v3d  =    'amm12_bdyV_u3d' ,         24        , 'vomecrty' ,     .true.     , .false. ,  'daily'  ,    ''    ,   '' 
     396   bn_tem  =    'amm12_bdyT_tra' ,         24        , 'votemper' ,     .true.     , .false. ,  'daily'  ,    ''    ,   '' 
     397   bn_sal  =    'amm12_bdyT_tra' ,         24        , 'vosaline' ,     .true.     , .false. ,  'daily'  ,    ''    ,   '' 
     398   cn_dir  =    'bdydta/' 
     399   ln_full_vel = .false. 
     400/ 
     401!----------------------------------------------------------------------- 
     402&nambdy_tide     ! tidal forcing at open boundaries               
     403!----------------------------------------------------------------------- 
     404   filtide      = 'bdydta/amm12_bdytide_'         !  file name root of tidal forcing files 
     405    tide_cpt(1)   ='Q1'  !  names of tidal components used 
     406    tide_cpt(2)   ='O1'  !  names of tidal components used 
     407    tide_cpt(3)   ='P1'  !  names of tidal components used 
     408    tide_cpt(4)   ='S1'  !  names of tidal components used 
     409    tide_cpt(5)   ='K1'  !  names of tidal components used 
     410    tide_cpt(6)   ='2N2' !  names of tidal components used 
     411    tide_cpt(7)   ='MU2' !  names of tidal components used 
     412    tide_cpt(8)   ='N2'  !  names of tidal components used 
     413    tide_cpt(9)   ='NU2' !  names of tidal components used 
     414    tide_cpt(10)   ='M2'  !  names of tidal components used 
     415    tide_cpt(11)   ='L2'  !  names of tidal components used 
     416    tide_cpt(12)   ='T2'  !  names of tidal components used 
     417    tide_cpt(13)   ='S2'  !  names of tidal components used 
     418    tide_cpt(14)   ='K2'  !  names of tidal components used 
     419    tide_cpt(15)   ='M4'  !  names of tidal components used 
     420    tide_speed(1)   = 13.398661 !  phase speeds of tidal components (deg/hour) 
     421    tide_speed(2)   = 13.943036 !  phase speeds of tidal components (deg/hour) 
     422    tide_speed(3)   = 14.958932 !  phase speeds of tidal components (deg/hour) 
     423    tide_speed(4)   = 15.000001 !  phase speeds of tidal components (deg/hour) 
     424    tide_speed(5)   = 15.041069 !  phase speeds of tidal components (deg/hour) 
     425    tide_speed(6)   = 27.895355 !  phase speeds of tidal components (deg/hour) 
     426    tide_speed(7)   = 27.968210 !  phase speeds of tidal components (deg/hour) 
     427    tide_speed(8)   = 28.439730 !  phase speeds of tidal components (deg/hour) 
     428    tide_speed(9)   = 28.512585 !  phase speeds of tidal components (deg/hour) 
     429    tide_speed(10)   = 28.984106 !  phase speeds of tidal components (deg/hour) 
     430    tide_speed(11)   = 29.528479 !  phase speeds of tidal components (deg/hour) 
     431    tide_speed(12)   = 29.958935 !  phase speeds of tidal components (deg/hour) 
     432    tide_speed(13)   = 30.000002 !  phase speeds of tidal components (deg/hour) 
     433    tide_speed(14)   = 30.082138 !  phase speeds of tidal components (deg/hour) 
     434    tide_speed(15)   = 57.968212 !  phase speeds of tidal components (deg/hour) 
     435    ln_tide_date = .true.               !  adjust tidal harmonics for start date of run 
     436/ 
    401437!!====================================================================== 
    402438!!                 ***  Bottom boundary condition  *** 
     
    417453   ln_bfr2d    = .false.   !  horizontal variation of the bottom friction coef (read a 2D mask file ) 
    418454   rn_bfrien   =    50.    !  local multiplying factor of bfr (ln_bfr2d=T) 
     455   ln_bfrimp   = .true.    !  implicit bottom friction (requires ln_zdfexp = .false. if true) 
    419456/ 
    420457!----------------------------------------------------------------------- 
     
    528565   ln_hpg_zps  = .true.    !  z-coordinate - partial steps (interpolation) 
    529566   ln_hpg_sco  = .false.   !  s-coordinate (standard jacobian formulation) 
    530    ln_hpg_hel  = .false.   !  s-coordinate (helsinki modification) 
    531    ln_hpg_wdj  = .false.   !  s-coordinate (weighted density jacobian) 
    532567   ln_hpg_djc  = .false.   !  s-coordinate (Density Jacobian with Cubic polynomial) 
    533    ln_hpg_rot  = .false.   !  s-coordinate (ROTated axes scheme) 
    534    rn_gamma    = 0.e0      !  weighting coefficient (wdj scheme) 
     568   ln_hpg_prj  = .false.   !  s-coordinate (Pressure Jacobian scheme) 
    535569   ln_dynhpg_imp = .false. !  time stepping: semi-implicit time scheme  (T) 
    536570                                 !           centered      time scheme  (F) 
  • branches/2011/dev_NEMO_MERGE_2011/NEMOGCM/CONFIG/ORCA2_LIM/EXP00/namelist

    r3105 r3116  
    33!! namelists    2 - Domain           (namzgr, namzgr_sco, namdom, namtsd) 
    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) 
     
    114114!!   namsbc_mfs      MFS  bulk formulae formulation 
    115115!!   namsbc_cpl      CouPLed            formulation                     ("key_coupled") 
    116 !!   namsbc_cpl_co2  coupled ocean/biogeo/atmosphere model              ("key_cpl_carbon_cycle") 
    117116!!   namtra_qsr      penetrative solar radiation 
    118117!!   namsbc_rnf      river runoffs 
     
    222221&namsbc_cpl    !   coupled ocean/atmosphere model                       ("key_coupled") 
    223222!----------------------------------------------------------------------- 
    224 !                                      ! send 
    225 cn_snd_temperature= 'weighted oce and ice'  !  'oce only' 'weighted oce and ice' 'mixed oce-ice' 
    226 cn_snd_albedo     = 'weighted ice'          !  'none' 'weighted ice' 'mixed oce-ice' 
    227 cn_snd_thickness  = 'none'                  !  'none' 'weighted ice and snow' 
    228 cn_snd_crt_nature = 'none'                  !  'none' 'oce only' 'weighted oce and ice' 'mixed oce-ice' 
    229 cn_snd_crt_refere = 'spherical'             !  'spherical' 'cartesian' 
    230 cn_snd_crt_orient = 'eastward-northward'    !  'eastward-northward' or 'local grid' 
    231 cn_snd_crt_grid   = 'T'                     !  'T' 
    232 !                                      ! receive 
    233 cn_rcv_w10m       = 'none'                  !  'none' 'coupled' 
    234 cn_rcv_taumod     = 'coupled'               !  'none' 'coupled' 
    235 cn_rcv_tau_nature = 'oce only'              !  'oce only' 'oce and ice' 'mixed oce-ice' 
    236 cn_rcv_tau_refere = 'cartesian'             !  'spherical' 'cartesian' 
    237 cn_rcv_tau_orient = 'eastward-northward'    !  'eastward-northward' or 'local grid' 
    238 cn_rcv_tau_grid   = 'U,V'                   !  'T' 'U,V' 'U,V,F' 'U,V,I' 'T,F' 'T,I' 'T,U,V' 
    239 cn_rcv_dqnsdt     = 'coupled'               !  'none' 'coupled' 
    240 cn_rcv_qsr        = 'oce and ice'           !  'conservative' 'oce and ice' 'mixed oce-ice' 
    241 cn_rcv_qns        = 'oce and ice'           !  'conservative' 'oce and ice' 'mixed oce-ice' 
    242 cn_rcv_emp        = 'conservative'          !  'conservative' 'oce and ice' 'mixed oce-ice' 
    243 cn_rcv_rnf        = 'coupled'               !  'coupled' 'climato' 'mixed' 
    244 cn_rcv_cal        = 'coupled'               !  'none' 'coupled' 
    245 / 
    246 !----------------------------------------------------------------------- 
    247 &namsbc_cpl_co2   !   coupled ocean/biogeo/atmosphere model             ("key_cpl_carbon_cycle") 
    248 !----------------------------------------------------------------------- 
    249    cn_snd_co2     = 'coupled'         ! send    : 'none' 'coupled' 
    250    cn_rcv_co2     = 'coupled'         ! receive : 'none' 'coupled' 
     223!                    !     description       !  multiple  !    vector   !      vector          ! vector ! 
     224!                    !                       ! categories !  reference  !    orientation       ! grids  ! 
     225! send 
     226sn_snd_temp   =       'weighted oce and ice' ,    'no'    ,     ''      ,         ''           ,   ''     
     227sn_snd_alb    =       'weighted ice'         ,    'no'    ,     ''      ,         ''           ,   ''     
     228sn_snd_thick  =       'none'                 ,    'no'   ,     ''      ,         ''           ,   ''     
     229sn_snd_crt    =       'none'                 ,    'no'    , 'spherical' , 'eastward-northward' ,  'T'        
     230sn_snd_co2    =       'coupled'              ,    'no'    ,     ''      ,         ''           ,   ''         
     231! receive 
     232sn_rcv_w10m   =       'none'                 ,    'no'    ,     ''      ,         ''          ,   ''     
     233sn_rcv_taumod =       'coupled'              ,    'no'    ,     ''      ,         ''          ,   ''     
     234sn_rcv_tau    =       'oce only'             ,    'no'    , 'cartesian' , 'eastward-northward',  'U,V'    
     235sn_rcv_dqnsdt =       'coupled'              ,    'no'    ,     ''      ,         ''          ,   ''     
     236sn_rcv_qsr    =       'oce and ice'          ,    'no'    ,     ''      ,         ''          ,   ''     
     237sn_rcv_qns    =       'oce and ice'          ,    'no'    ,     ''      ,         ''          ,   ''     
     238sn_rcv_emp    =       'conservative'         ,    'no'    ,     ''      ,         ''          ,   ''     
     239sn_rcv_rnf    =       'coupled'              ,    'no'    ,     ''      ,         ''          ,   ''     
     240sn_rcv_cal    =       'coupled'              ,    'no'    ,     ''      ,         ''          ,   ''     
     241sn_rcv_co2    =       'coupled'              ,    'no'    ,     ''      ,         ''          ,   ''     
    251242/ 
    252243!----------------------------------------------------------------------- 
     
    397388&nambdy        !  unstructured open boundaries                          ("key_bdy") 
    398389!----------------------------------------------------------------------- 
    399    cn_mask     =  ''                     !  name of mask file (ln_mask=T) 
    400    cn_dta_frs_T= 'bdydata_grid_T.nc'     !  name of data file (T-points) 
    401    cn_dta_frs_U= 'bdydata_grid_U.nc'     !  name of data file (U-points) 
    402    cn_dta_frs_V= 'bdydata_grid_V.nc'     !  name of data file (V-points) 
    403    cn_dta_fla_T= 'bdydata_bt_grid_T.nc'  !  name of data file for Flather condition (T-points) 
    404    cn_dta_fla_U= 'bdydata_bt_grid_U.nc'  !  name of data file for Flather condition (U-points) 
    405    cn_dta_fla_V= 'bdydata_bt_grid_V.nc'  !  name of data file for Flather condition (V-points) 
    406  
    407    ln_clim     = .false.   !  contain 1 (T) or 12 (F) time dumps and be cyclic 
    408    ln_vol      = .false.   !  total volume correction (see volbdy parameter) 
    409    ln_mask     = .false.   !  boundary mask from filbdy_mask (T), boundaries are on edges of domain (F) 
    410    ln_tides    = .false.   !  Apply tidal harmonic forcing with Flather condition 
    411    ln_dyn_fla  = .false.   !  Apply Flather condition to velocities 
    412    ln_tra_frs  = .false.   !  Apply FRS condition to temperature and salinity  
    413    ln_dyn_frs  = .false.   !  Apply FRS condition to velocities 
    414    nn_rimwidth =  9        !  width of the relaxation zone 
    415    nn_dtactl   =  1        !  = 0, bdy data are equal to the initial state 
     390    nb_bdy = 1                            !  number of open boundary sets        
     391    ln_coords_file = .true.               !  =T : read bdy coordinates from file 
     392    cn_coords_file = 'coordinates.bdy.nc' !  bdy coordinates files 
     393    ln_mask_file = .false.                !  =T : read mask from file 
     394    cn_mask_file = ''                     !  name of mask file (if ln_mask_file=.TRUE.) 
     395    nn_dyn2d      =  2                    !  boundary conditions for barotropic fields 
     396    nn_dyn2d_dta  =  3                    !  = 0, bdy data are equal to the initial state 
     397                                          !  = 1, bdy data are read in 'bdydata   .nc' files 
     398                                          !  = 2, use tidal harmonic forcing data from files 
     399                                          !  = 3, use external data AND tidal harmonic forcing 
     400    nn_dyn3d      =  0                    !  boundary conditions for baroclinic velocities 
     401    nn_dyn3d_dta  =  0                    !  = 0, bdy data are equal to the initial state 
    416402                           !  = 1, bdy data are read in 'bdydata   .nc' files 
    417    nn_volctl   =  0        !  = 0, the total water flux across open boundaries is zero 
    418                            !  = 1, the total volume of the system is conserved 
    419 / 
    420 !----------------------------------------------------------------------- 
    421 &nambdy_tide   !  tidal forcing at unstructured boundaries               
    422 !----------------------------------------------------------------------- 
    423    filtide     = 'bdytide_'           !  file name root of tidal forcing files 
    424    tide_cpt    = 'M2','S1'            !  names of tidal components used 
    425    tide_speed  = 28.984106, 15.000001 !  phase speeds of tidal components (deg/hour) 
    426    ln_tide_date= .false.              !  adjust tidal harmonics for start date of run 
    427 / 
    428  
     403    nn_tra        =  1                    !  boundary conditions for T and S 
     404    nn_tra_dta    =  1                    !  = 0, bdy data are equal to the initial state 
     405                           !  = 1, bdy data are read in 'bdydata   .nc' files 
     406    nn_rimwidth  = 10                      !  width of the relaxation zone 
     407    nn_dmp2d_in  = 0                      ! 
     408    nn_dmp2d_out = 0                      ! 
     409    nn_dmp2d_in  = 0                      ! 
     410    nn_dmp2d_out = 0                      ! 
     411    ln_vol     = .false.                  !  total volume correction (see nn_volctl parameter) 
     412    nn_volctl  = 1                        !  = 0, the total water flux across open boundaries is zero 
     413/ 
     414!----------------------------------------------------------------------- 
     415&nambdy_dta      !  open boundaries - external data           ("key_bdy") 
     416!----------------------------------------------------------------------- 
     417!              !   file name    ! frequency (hours) !  variable  ! time interpol. !  clim   ! 'yearly'/ ! weights  ! rotation ! 
     418!              !                !  (if <0  months)  !    name    !    (logical)   !  (T/F)  ! 'monthly' ! filename ! pairing  ! 
     419   bn_ssh =     'amm12_bdyT_u2d' ,         24        , 'sossheig' ,     .true.     , .false. ,  'daily'  ,    ''    ,   '' 
     420   bn_u2d =     'amm12_bdyU_u2d' ,         24        , 'vobtcrtx' ,     .true.     , .false. ,  'daily'  ,    ''    ,   '' 
     421   bn_v2d =     'amm12_bdyV_u2d' ,         24        , 'vobtcrty' ,     .true.     , .false. ,  'daily'  ,    ''    ,   '' 
     422   bn_u3d  =    'amm12_bdyU_u3d' ,         24        , 'vozocrtx' ,     .true.     , .false. ,  'daily'  ,    ''    ,   '' 
     423   bn_v3d  =    'amm12_bdyV_u3d' ,         24        , 'vomecrty' ,     .true.     , .false. ,  'daily'  ,    ''    ,   '' 
     424   bn_tem  =    'amm12_bdyT_tra' ,         24        , 'votemper' ,     .true.     , .false. ,  'daily'  ,    ''    ,   '' 
     425   bn_sal  =    'amm12_bdyT_tra' ,         24        , 'vosaline' ,     .true.     , .false. ,  'daily'  ,    ''    ,   '' 
     426   cn_dir  =    'bdydta/' 
     427   ln_full_vel = .false. 
     428/ 
     429!----------------------------------------------------------------------- 
     430&nambdy_tide     ! tidal forcing at open boundaries               
     431!----------------------------------------------------------------------- 
     432   filtide      = 'bdydta/amm12_bdytide_'         !  file name root of tidal forcing files 
     433    tide_cpt(1)   ='Q1'  !  names of tidal components used 
     434    tide_cpt(2)   ='O1'  !  names of tidal components used 
     435    tide_cpt(3)   ='P1'  !  names of tidal components used 
     436    tide_cpt(4)   ='S1'  !  names of tidal components used 
     437    tide_cpt(5)   ='K1'  !  names of tidal components used 
     438    tide_cpt(6)   ='2N2' !  names of tidal components used 
     439    tide_cpt(7)   ='MU2' !  names of tidal components used 
     440    tide_cpt(8)   ='N2'  !  names of tidal components used 
     441    tide_cpt(9)   ='NU2' !  names of tidal components used 
     442    tide_cpt(10)   ='M2'  !  names of tidal components used 
     443    tide_cpt(11)   ='L2'  !  names of tidal components used 
     444    tide_cpt(12)   ='T2'  !  names of tidal components used 
     445    tide_cpt(13)   ='S2'  !  names of tidal components used 
     446    tide_cpt(14)   ='K2'  !  names of tidal components used 
     447    tide_cpt(15)   ='M4'  !  names of tidal components used 
     448    tide_speed(1)   = 13.398661 !  phase speeds of tidal components (deg/hour) 
     449    tide_speed(2)   = 13.943036 !  phase speeds of tidal components (deg/hour) 
     450    tide_speed(3)   = 14.958932 !  phase speeds of tidal components (deg/hour) 
     451    tide_speed(4)   = 15.000001 !  phase speeds of tidal components (deg/hour) 
     452    tide_speed(5)   = 15.041069 !  phase speeds of tidal components (deg/hour) 
     453    tide_speed(6)   = 27.895355 !  phase speeds of tidal components (deg/hour) 
     454    tide_speed(7)   = 27.968210 !  phase speeds of tidal components (deg/hour) 
     455    tide_speed(8)   = 28.439730 !  phase speeds of tidal components (deg/hour) 
     456    tide_speed(9)   = 28.512585 !  phase speeds of tidal components (deg/hour) 
     457    tide_speed(10)   = 28.984106 !  phase speeds of tidal components (deg/hour) 
     458    tide_speed(11)   = 29.528479 !  phase speeds of tidal components (deg/hour) 
     459    tide_speed(12)   = 29.958935 !  phase speeds of tidal components (deg/hour) 
     460    tide_speed(13)   = 30.000002 !  phase speeds of tidal components (deg/hour) 
     461    tide_speed(14)   = 30.082138 !  phase speeds of tidal components (deg/hour) 
     462    tide_speed(15)   = 57.968212 !  phase speeds of tidal components (deg/hour) 
     463    ln_tide_date = .true.               !  adjust tidal harmonics for start date of run 
     464/ 
    429465!!====================================================================== 
    430466!!                 ***  Bottom boundary condition  *** 
     
    445481   ln_bfr2d    = .false.   !  horizontal variation of the bottom friction coef (read a 2D mask file ) 
    446482   rn_bfrien   =    50.    !  local multiplying factor of bfr (ln_bfr2d=T) 
     483   ln_bfrimp   = .true.    !  implicit bottom friction (requires ln_zdfexp = .false. if true) 
    447484/ 
    448485!----------------------------------------------------------------------- 
     
    491528   ln_traadv_muscl2 =  .false.  !  MUSCL2 scheme + cen2 at boundaries   
    492529   ln_traadv_ubs    =  .false.  !  UBS scheme                  
    493    ln_traadv_qck    =  .false.  !  QUCIKEST scheme                  
     530   ln_traadv_qck    =  .false.  !  QUICKEST scheme                  
    494531/ 
    495532!----------------------------------------------------------------------- 
     
    503540   ln_traldf_hor    =  .false.  !  horizontal (geopotential)            (require "key_ldfslp" when ln_sco=T) 
    504541   ln_traldf_iso    =  .true.   !  iso-neutral                          (require "key_ldfslp") 
    505    ln_traldf_grif   =  .false.  !  griffies skew flux formulation       (require "key_ldfslp")  ! UNDER TEST, DO NOT USE 
    506    ln_traldf_gdia   =  .false.  !  griffies operator strfn diagnostics  (require "key_ldfslp")  ! UNDER TEST, DO NOT USE 
    507    !                       !  Coefficient 
     542   ln_traldf_grif   =  .false.  !  griffies skew flux formulation       (require "key_ldfslp") 
     543   ln_traldf_gdia   =  .false.  !  griffies operator strfn diagnostics  (require "key_ldfslp") 
     544   ln_triad_iso     =  .false.  !  griffies operator calculates triads twice => pure lateral mixing in ML (require "key_ldfslp") 
     545   ln_botmix_grif   =  .false.  !  griffies operator with lateral mixing on bottom (require "key_ldfslp") 
     546                         !  Coefficient 
    508547   rn_aht_0         =  2000.    !  horizontal eddy diffusivity for tracers [m2/s] 
    509548   rn_ahtb_0        =     0.    !  background eddy diffusivity for ldf_iso [m2/s] 
     
    557596   ln_hpg_zps  = .true.    !  z-coordinate - partial steps (interpolation) 
    558597   ln_hpg_sco  = .false.   !  s-coordinate (standard jacobian formulation) 
    559    ln_hpg_hel  = .false.   !  s-coordinate (helsinki modification) 
    560    ln_hpg_wdj  = .false.   !  s-coordinate (weighted density jacobian) 
    561598   ln_hpg_djc  = .false.   !  s-coordinate (Density Jacobian with Cubic polynomial) 
    562    ln_hpg_rot  = .false.   !  s-coordinate (ROTated axes scheme) 
    563    rn_gamma    = 0.e0      !  weighting coefficient (wdj scheme) 
     599   ln_hpg_prj  = .false.   !  s-coordinate (Pressure Jacobian scheme) 
    564600   ln_dynhpg_imp = .false. !  time stepping: semi-implicit time scheme  (T) 
    565601                                 !           centered      time scheme  (F) 
     
    730766                           !  buffer blocking send or immediate non-blocking sends, resp. 
    731767   nn_buffer   =   0       !  size in bytes of exported buffer ('B' case), 0 no exportation 
     768   ln_nnogather=  .false.  !  activate code to avoid mpi_allgather use at the northfold 
    732769   jpni        =   0       !  jpni   number of processors following i (set automatically if < 1) 
    733770   jpnj        =   0       !  jpnj   number of processors following j (set automatically if < 1) 
     
    931968   cn_dir_cdg  = './'  !  root directory for the location of drag coefficient files 
    932969/ 
     970!----------------------------------------------------------------------- 
     971&namdyn_nept  !   Neptune effect (simplified: lateral and vertical diffusions removed) 
     972!----------------------------------------------------------------------- 
     973   ! Suggested lengthscale values are those of Eby & Holloway (1994) for a coarse model 
     974   ln_neptsimp       = .false.  ! yes/no use simplified neptune 
     975 
     976   ln_smooth_neptvel = .false.  ! yes/no smooth zunep, zvnep 
     977   rn_tslse          =  1.2e4   ! value of lengthscale L at the equator 
     978   rn_tslsp          =  3.0e3   ! value of lengthscale L at the pole 
     979   ! Specify whether to ramp down the Neptune velocity in shallow 
     980   ! water, and if so the depth range controlling such ramping down 
     981   ln_neptramp       = .true.   ! ramp down Neptune velocity in shallow water 
     982   rn_htrmin         =  100.0   ! min. depth of transition range 
     983   rn_htrmax         =  200.0   ! max. depth of transition range 
     984/ 
     985>>>>>>> .merge-right.r3114 
  • branches/2011/dev_NEMO_MERGE_2011/NEMOGCM/CONFIG/ORCA2_OFF_PISCES/EXP00/namelist

    r3105 r3116  
    33!! namelists    2 - Domain           (namzgr, namzgr_sco, namdom, namtsd) 
    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) 
     
    114114!!   namsbc_mfs      MFS  bulk formulae formulation 
    115115!!   namsbc_cpl      CouPLed            formulation                     ("key_coupled") 
    116 !!   namsbc_cpl_co2  coupled ocean/biogeo/atmosphere model              ("key_cpl_carbon_cycle") 
    117116!!   namtra_qsr      penetrative solar radiation 
    118117!!   namsbc_rnf      river runoffs 
     
    222221&namsbc_cpl    !   coupled ocean/atmosphere model                       ("key_coupled") 
    223222!----------------------------------------------------------------------- 
    224 !                                      ! send 
    225 cn_snd_temperature= 'weighted oce and ice'  !  'oce only' 'weighted oce and ice' 'mixed oce-ice' 
    226 cn_snd_albedo     = 'weighted ice'          !  'none' 'weighted ice' 'mixed oce-ice' 
    227 cn_snd_thickness  = 'none'                  !  'none' 'weighted ice and snow' 
    228 cn_snd_crt_nature = 'none'                  !  'none' 'oce only' 'weighted oce and ice' 'mixed oce-ice' 
    229 cn_snd_crt_refere = 'spherical'             !  'spherical' 'cartesian' 
    230 cn_snd_crt_orient = 'eastward-northward'    !  'eastward-northward' or 'local grid' 
    231 cn_snd_crt_grid   = 'T'                     !  'T' 
    232 !                                      ! receive 
    233 cn_rcv_w10m       = 'none'                  !  'none' 'coupled' 
    234 cn_rcv_taumod     = 'coupled'               !  'none' 'coupled' 
    235 cn_rcv_tau_nature = 'oce only'              !  'oce only' 'oce and ice' 'mixed oce-ice' 
    236 cn_rcv_tau_refere = 'cartesian'             !  'spherical' 'cartesian' 
    237 cn_rcv_tau_orient = 'eastward-northward'    !  'eastward-northward' or 'local grid' 
    238 cn_rcv_tau_grid   = 'U,V'                   !  'T' 'U,V' 'U,V,F' 'U,V,I' 'T,F' 'T,I' 'T,U,V' 
    239 cn_rcv_dqnsdt     = 'coupled'               !  'none' 'coupled' 
    240 cn_rcv_qsr        = 'oce and ice'           !  'conservative' 'oce and ice' 'mixed oce-ice' 
    241 cn_rcv_qns        = 'oce and ice'           !  'conservative' 'oce and ice' 'mixed oce-ice' 
    242 cn_rcv_emp        = 'conservative'          !  'conservative' 'oce and ice' 'mixed oce-ice' 
    243 cn_rcv_rnf        = 'coupled'               !  'coupled' 'climato' 'mixed' 
    244 cn_rcv_cal        = 'coupled'               !  'none' 'coupled' 
    245 / 
    246 !----------------------------------------------------------------------- 
    247 &namsbc_cpl_co2   !   coupled ocean/biogeo/atmosphere model             ("key_cpl_carbon_cycle") 
    248 !----------------------------------------------------------------------- 
    249    cn_snd_co2     = 'coupled'         ! send    : 'none' 'coupled' 
    250    cn_rcv_co2     = 'coupled'         ! receive : 'none' 'coupled' 
    251 / 
    252 !----------------------------------------------------------------------- 
     223!                    !     description       !  multiple  !    vector   !      vector          ! vector ! 
     224!                    !                       ! categories !  reference  !    orientation       ! grids  ! 
     225! send 
     226sn_snd_temp   =       'weighted oce and ice' ,    'no'    ,     ''      ,         ''           ,   ''     
     227sn_snd_alb    =       'weighted ice'         ,    'no'    ,     ''      ,         ''           ,   ''     
     228sn_snd_thick  =       'none'                 ,    'no'   ,     ''      ,         ''           ,   ''     
     229sn_snd_crt    =       'none'                 ,    'no'    , 'spherical' , 'eastward-northward' ,  'T'        
     230sn_snd_co2    =       'coupled'              ,    'no'    ,     ''      ,         ''           ,   ''         
     231! receive 
     232sn_rcv_w10m   =       'none'                 ,    'no'    ,     ''      ,         ''          ,   ''     
     233sn_rcv_taumod =       'coupled'              ,    'no'    ,     ''      ,         ''          ,   ''     
     234sn_rcv_tau    =       'oce only'             ,    'no'    , 'cartesian' , 'eastward-northward',  'U,V'    
     235sn_rcv_dqnsdt =       'coupled'              ,    'no'    ,     ''      ,         ''          ,   ''     
     236sn_rcv_qsr    =       'oce and ice'          ,    'no'    ,     ''      ,         ''          ,   ''     
     237sn_rcv_qns    =       'oce and ice'          ,    'no'    ,     ''      ,         ''          ,   ''     
     238sn_rcv_emp    =       'conservative'         ,    'no'    ,     ''      ,         ''          ,   ''     
     239sn_rcv_rnf    =       'coupled'              ,    'no'    ,     ''      ,         ''          ,   ''     
     240sn_rcv_cal    =       'coupled'              ,    'no'    ,     ''      ,         ''          ,   ''     
     241sn_rcv_co2    =       'coupled'              ,    'no'    ,     ''      ,         ''          ,   ''     
     242/ 
    253243&namtra_qsr    !   penetrative solar radiation 
    254244!----------------------------------------------------------------------- 
     
    380370&nambdy        !  unstructured open boundaries                          ("key_bdy") 
    381371!----------------------------------------------------------------------- 
    382    cn_mask     =  ''                     !  name of mask file (ln_mask=T) 
    383    cn_dta_frs_T= 'bdydata_grid_T.nc'     !  name of data file (T-points) 
    384    cn_dta_frs_U= 'bdydata_grid_U.nc'     !  name of data file (U-points) 
    385    cn_dta_frs_V= 'bdydata_grid_V.nc'     !  name of data file (V-points) 
    386    cn_dta_fla_T= 'bdydata_bt_grid_T.nc'  !  name of data file for Flather condition (T-points) 
    387    cn_dta_fla_U= 'bdydata_bt_grid_U.nc'  !  name of data file for Flather condition (U-points) 
    388    cn_dta_fla_V= 'bdydata_bt_grid_V.nc'  !  name of data file for Flather condition (V-points) 
    389  
    390    ln_clim     = .false.   !  contain 1 (T) or 12 (F) time dumps and be cyclic 
    391    ln_vol      = .false.   !  total volume correction (see volbdy parameter) 
    392    ln_mask     = .false.   !  boundary mask from filbdy_mask (T), boundaries are on edges of domain (F) 
    393    ln_tides    = .false.   !  Apply tidal harmonic forcing with Flather condition 
    394    ln_dyn_fla  = .false.   !  Apply Flather condition to velocities 
    395    ln_tra_frs  = .false.   !  Apply FRS condition to temperature and salinity  
    396    ln_dyn_frs  = .false.   !  Apply FRS condition to velocities 
    397    nn_rimwidth =  9        !  width of the relaxation zone 
    398    nn_dtactl   =  1        !  = 0, bdy data are equal to the initial state 
     372    nb_bdy = 1                            !  number of open boundary sets        
     373    ln_coords_file = .true.               !  =T : read bdy coordinates from file 
     374    cn_coords_file = 'coordinates.bdy.nc' !  bdy coordinates files 
     375    ln_mask_file = .false.                !  =T : read mask from file 
     376    cn_mask_file = ''                     !  name of mask file (if ln_mask_file=.TRUE.) 
     377    nn_dyn2d      =  2                    !  boundary conditions for barotropic fields 
     378    nn_dyn2d_dta  =  3                    !  = 0, bdy data are equal to the initial state 
     379                                          !  = 1, bdy data are read in 'bdydata   .nc' files 
     380                                          !  = 2, use tidal harmonic forcing data from files 
     381                                          !  = 3, use external data AND tidal harmonic forcing 
     382    nn_dyn3d      =  0                    !  boundary conditions for baroclinic velocities 
     383    nn_dyn3d_dta  =  0                    !  = 0, bdy data are equal to the initial state 
    399384                           !  = 1, bdy data are read in 'bdydata   .nc' files 
    400    nn_volctl   =  0        !  = 0, the total water flux across open boundaries is zero 
    401                            !  = 1, the total volume of the system is conserved 
    402 / 
    403 !----------------------------------------------------------------------- 
    404 &nambdy_tide   !  tidal forcing at unstructured boundaries               
    405 !----------------------------------------------------------------------- 
    406    filtide     = 'bdytide_'           !  file name root of tidal forcing files 
    407    tide_cpt    = 'M2','S1'            !  names of tidal components used 
    408    tide_speed  = 28.984106, 15.000001 !  phase speeds of tidal components (deg/hour) 
    409    ln_tide_date= .false.              !  adjust tidal harmonics for start date of run 
    410 / 
    411  
     385    nn_tra        =  1                    !  boundary conditions for T and S 
     386    nn_tra_dta    =  1                    !  = 0, bdy data are equal to the initial state 
     387                           !  = 1, bdy data are read in 'bdydata   .nc' files 
     388    nn_rimwidth  = 10                      !  width of the relaxation zone 
     389    nn_dmp2d_in  = 0                      ! 
     390    nn_dmp2d_out = 0                      ! 
     391    nn_dmp2d_in  = 0                      ! 
     392    nn_dmp2d_out = 0                      ! 
     393    ln_vol     = .false.                  !  total volume correction (see nn_volctl parameter) 
     394    nn_volctl  = 1                        !  = 0, the total water flux across open boundaries is zero 
     395/ 
     396!----------------------------------------------------------------------- 
     397&nambdy_dta      !  open boundaries - external data           ("key_bdy") 
     398!----------------------------------------------------------------------- 
     399!              !   file name    ! frequency (hours) !  variable  ! time interpol. !  clim   ! 'yearly'/ ! weights  ! rotation ! 
     400!              !                !  (if <0  months)  !    name    !    (logical)   !  (T/F)  ! 'monthly' ! filename ! pairing  ! 
     401   bn_ssh =     'amm12_bdyT_u2d' ,         24        , 'sossheig' ,     .true.     , .false. ,  'daily'  ,    ''    ,   '' 
     402   bn_u2d =     'amm12_bdyU_u2d' ,         24        , 'vobtcrtx' ,     .true.     , .false. ,  'daily'  ,    ''    ,   '' 
     403   bn_v2d =     'amm12_bdyV_u2d' ,         24        , 'vobtcrty' ,     .true.     , .false. ,  'daily'  ,    ''    ,   '' 
     404   bn_u3d  =    'amm12_bdyU_u3d' ,         24        , 'vozocrtx' ,     .true.     , .false. ,  'daily'  ,    ''    ,   '' 
     405   bn_v3d  =    'amm12_bdyV_u3d' ,         24        , 'vomecrty' ,     .true.     , .false. ,  'daily'  ,    ''    ,   '' 
     406   bn_tem  =    'amm12_bdyT_tra' ,         24        , 'votemper' ,     .true.     , .false. ,  'daily'  ,    ''    ,   '' 
     407   bn_sal  =    'amm12_bdyT_tra' ,         24        , 'vosaline' ,     .true.     , .false. ,  'daily'  ,    ''    ,   '' 
     408   cn_dir  =    'bdydta/' 
     409   ln_full_vel = .false. 
     410/ 
     411!----------------------------------------------------------------------- 
     412&nambdy_tide     ! tidal forcing at open boundaries               
     413!----------------------------------------------------------------------- 
     414   filtide      = 'bdydta/amm12_bdytide_'         !  file name root of tidal forcing files 
     415    tide_cpt(1)   ='Q1'  !  names of tidal components used 
     416    tide_cpt(2)   ='O1'  !  names of tidal components used 
     417    tide_cpt(3)   ='P1'  !  names of tidal components used 
     418    tide_cpt(4)   ='S1'  !  names of tidal components used 
     419    tide_cpt(5)   ='K1'  !  names of tidal components used 
     420    tide_cpt(6)   ='2N2' !  names of tidal components used 
     421    tide_cpt(7)   ='MU2' !  names of tidal components used 
     422    tide_cpt(8)   ='N2'  !  names of tidal components used 
     423    tide_cpt(9)   ='NU2' !  names of tidal components used 
     424    tide_cpt(10)   ='M2'  !  names of tidal components used 
     425    tide_cpt(11)   ='L2'  !  names of tidal components used 
     426    tide_cpt(12)   ='T2'  !  names of tidal components used 
     427    tide_cpt(13)   ='S2'  !  names of tidal components used 
     428    tide_cpt(14)   ='K2'  !  names of tidal components used 
     429    tide_cpt(15)   ='M4'  !  names of tidal components used 
     430    tide_speed(1)   = 13.398661 !  phase speeds of tidal components (deg/hour) 
     431    tide_speed(2)   = 13.943036 !  phase speeds of tidal components (deg/hour) 
     432    tide_speed(3)   = 14.958932 !  phase speeds of tidal components (deg/hour) 
     433    tide_speed(4)   = 15.000001 !  phase speeds of tidal components (deg/hour) 
     434    tide_speed(5)   = 15.041069 !  phase speeds of tidal components (deg/hour) 
     435    tide_speed(6)   = 27.895355 !  phase speeds of tidal components (deg/hour) 
     436    tide_speed(7)   = 27.968210 !  phase speeds of tidal components (deg/hour) 
     437    tide_speed(8)   = 28.439730 !  phase speeds of tidal components (deg/hour) 
     438    tide_speed(9)   = 28.512585 !  phase speeds of tidal components (deg/hour) 
     439    tide_speed(10)   = 28.984106 !  phase speeds of tidal components (deg/hour) 
     440    tide_speed(11)   = 29.528479 !  phase speeds of tidal components (deg/hour) 
     441    tide_speed(12)   = 29.958935 !  phase speeds of tidal components (deg/hour) 
     442    tide_speed(13)   = 30.000002 !  phase speeds of tidal components (deg/hour) 
     443    tide_speed(14)   = 30.082138 !  phase speeds of tidal components (deg/hour) 
     444    tide_speed(15)   = 57.968212 !  phase speeds of tidal components (deg/hour) 
     445    ln_tide_date = .true.               !  adjust tidal harmonics for start date of run 
     446/ 
    412447!!====================================================================== 
    413448!!                 ***  Bottom boundary condition  *** 
     
    428463   ln_bfr2d    = .false.   !  horizontal variation of the bottom friction coef (read a 2D mask file ) 
    429464   rn_bfrien   =    50.    !  local multiplying factor of bfr (ln_bfr2d=T) 
     465   ln_bfrimp   = .true.    !  implicit bottom friction (requires ln_zdfexp = .false. if true) 
    430466/ 
    431467!----------------------------------------------------------------------- 
     
    474510   ln_traadv_muscl2 =  .false.  !  MUSCL2 scheme + cen2 at boundaries   
    475511   ln_traadv_ubs    =  .false.  !  UBS scheme                  
    476    ln_traadv_qck    =  .false.  !  QUCIKEST scheme                  
     512   ln_traadv_qck    =  .false.  !  QUICKEST scheme 
    477513/ 
    478514!----------------------------------------------------------------------- 
     
    486522   ln_traldf_hor    =  .false.  !  horizontal (geopotential)            (require "key_ldfslp" when ln_sco=T) 
    487523   ln_traldf_iso    =  .true.   !  iso-neutral                          (require "key_ldfslp") 
    488    ln_traldf_grif   =  .false.  !  griffies skew flux formulation       (require "key_ldfslp")  ! UNDER TEST, DO NOT USE 
    489    ln_traldf_gdia   =  .false.  !  griffies operator strfn diagnostics  (require "key_ldfslp")  ! UNDER TEST, DO NOT USE 
    490    !                       !  Coefficient 
     524   ln_traldf_grif   =  .false.  !  griffies skew flux formulation       (require "key_ldfslp") 
     525   ln_traldf_gdia   =  .false.  !  griffies operator strfn diagnostics  (require "key_ldfslp") 
     526   ln_triad_iso     =  .false.  !  griffies operator calculates triads twice => pure lateral mixing in ML (require "key_ldfslp") 
     527   ln_botmix_grif   =  .false.  !  griffies operator with lateral mixing on bottom (require "key_ldfslp") 
     528                         !  Coefficient 
    491529   rn_aht_0         =  2000.    !  horizontal eddy diffusivity for tracers [m2/s] 
    492530   rn_ahtb_0        =     0.    !  background eddy diffusivity for ldf_iso [m2/s] 
     
    540578   ln_hpg_zps  = .true.    !  z-coordinate - partial steps (interpolation) 
    541579   ln_hpg_sco  = .false.   !  s-coordinate (standard jacobian formulation) 
    542    ln_hpg_hel  = .false.   !  s-coordinate (helsinki modification) 
    543    ln_hpg_wdj  = .false.   !  s-coordinate (weighted density jacobian) 
    544580   ln_hpg_djc  = .false.   !  s-coordinate (Density Jacobian with Cubic polynomial) 
    545    ln_hpg_rot  = .false.   !  s-coordinate (ROTated axes scheme) 
    546    rn_gamma    = 0.e0      !  weighting coefficient (wdj scheme) 
     581   ln_hpg_prj  = .false.   !  s-coordinate (Pressure Jacobian scheme) 
    547582   ln_dynhpg_imp = .false. !  time stepping: semi-implicit time scheme  (T) 
    548583                                 !           centered      time scheme  (F) 
     
    737772                           !  buffer blocking send or immediate non-blocking sends, resp. 
    738773   nn_buffer   =   0       !  size in bytes of exported buffer ('B' case), 0 no exportation 
     774   ln_nnogather=  .false.  !  activate code to avoid mpi_allgather use at the northfold 
    739775   jpni        =   0       !  jpni   number of processors following i (set automatically if < 1) 
    740776   jpnj        =   0       !  jpnj   number of processors following j (set automatically if < 1) 
     
    928964   cn_dir_cdg  = './'  !  root directory for the location of drag coefficient files 
    929965/ 
     966!----------------------------------------------------------------------- 
     967&namdyn_nept  !   Neptune effect (simplified: lateral and vertical diffusions removed) 
     968!----------------------------------------------------------------------- 
     969   ! Suggested lengthscale values are those of Eby & Holloway (1994) for a coarse model 
     970   ln_neptsimp       = .false.  ! yes/no use simplified neptune 
     971 
     972   ln_smooth_neptvel = .false.  ! yes/no smooth zunep, zvnep 
     973   rn_tslse          =  1.2e4   ! value of lengthscale L at the equator 
     974   rn_tslsp          =  3.0e3   ! value of lengthscale L at the pole 
     975   ! Specify whether to ramp down the Neptune velocity in shallow 
     976   ! water, and if so the depth range controlling such ramping down 
     977   ln_neptramp       = .false.  ! ramp down Neptune velocity in shallow water 
     978   rn_htrmin         =  100.0   ! min. depth of transition range 
     979   rn_htrmax         =  200.0   ! max. depth of transition range 
     980/ 
     981>>>>>>> .merge-right.r3114 
  • branches/2011/dev_NEMO_MERGE_2011/NEMOGCM/CONFIG/POMME/EXP00/namelist

    r3105 r3116  
    33!! namelists    2 - Domain           (namzgr, namzgr_sco, namdom, namtsd) 
    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) 
     
    114114!!   namsbc_mfs      MFS  bulk formulae formulation 
    115115!!   namsbc_cpl      CouPLed            formulation                     ("key_coupled") 
    116 !!   namsbc_cpl_co2  coupled ocean/biogeo/atmosphere model              ("key_cpl_carbon_cycle") 
    117116!!   namtra_qsr      penetrative solar radiation 
    118117!!   namsbc_rnf      river runoffs 
     
    222221&namsbc_cpl    !   coupled ocean/atmosphere model                       ("key_coupled") 
    223222!----------------------------------------------------------------------- 
    224 !                                      ! send 
    225 cn_snd_temperature= 'weighted oce and ice'  !  'oce only' 'weighted oce and ice' 'mixed oce-ice' 
    226 cn_snd_albedo     = 'weighted ice'          !  'none' 'weighted ice' 'mixed oce-ice' 
    227 cn_snd_thickness  = 'none'                  !  'none' 'weighted ice and snow' 
    228 cn_snd_crt_nature = 'none'                  !  'none' 'oce only' 'weighted oce and ice' 'mixed oce-ice' 
    229 cn_snd_crt_refere = 'spherical'             !  'spherical' 'cartesian' 
    230 cn_snd_crt_orient = 'eastward-northward'    !  'eastward-northward' or 'local grid' 
    231 cn_snd_crt_grid   = 'T'                     !  'T' 
    232 !                                      ! receive 
    233 cn_rcv_w10m       = 'none'                  !  'none' 'coupled' 
    234 cn_rcv_taumod     = 'coupled'               !  'none' 'coupled' 
    235 cn_rcv_tau_nature = 'oce only'              !  'oce only' 'oce and ice' 'mixed oce-ice' 
    236 cn_rcv_tau_refere = 'cartesian'             !  'spherical' 'cartesian' 
    237 cn_rcv_tau_orient = 'eastward-northward'    !  'eastward-northward' or 'local grid' 
    238 cn_rcv_tau_grid   = 'U,V'                   !  'T' 'U,V' 'U,V,F' 'U,V,I' 'T,F' 'T,I' 'T,U,V' 
    239 cn_rcv_dqnsdt     = 'coupled'               !  'none' 'coupled' 
    240 cn_rcv_qsr        = 'oce and ice'           !  'conservative' 'oce and ice' 'mixed oce-ice' 
    241 cn_rcv_qns        = 'oce and ice'           !  'conservative' 'oce and ice' 'mixed oce-ice' 
    242 cn_rcv_emp        = 'conservative'          !  'conservative' 'oce and ice' 'mixed oce-ice' 
    243 cn_rcv_rnf        = 'coupled'               !  'coupled' 'climato' 'mixed' 
    244 cn_rcv_cal        = 'coupled'               !  'none' 'coupled' 
    245 / 
    246 !----------------------------------------------------------------------- 
    247 &namsbc_cpl_co2   !   coupled ocean/biogeo/atmosphere model             ("key_cpl_carbon_cycle") 
    248 !----------------------------------------------------------------------- 
    249    cn_snd_co2     = 'coupled'         ! send    : 'none' 'coupled' 
    250    cn_rcv_co2     = 'coupled'         ! receive : 'none' 'coupled' 
     223!                    !     description       !  multiple  !    vector   !      vector          ! vector ! 
     224!                    !                       ! categories !  reference  !    orientation       ! grids  ! 
     225! send 
     226sn_snd_temp   =       'weighted oce and ice' ,    'no'    ,     ''      ,         ''           ,   ''     
     227sn_snd_alb    =       'weighted ice'         ,    'no'    ,     ''      ,         ''           ,   ''     
     228sn_snd_thick  =       'none'                 ,    'no'   ,     ''      ,         ''           ,   ''     
     229sn_snd_crt    =       'none'                 ,    'no'    , 'spherical' , 'eastward-northward' ,  'T'        
     230sn_snd_co2    =       'coupled'              ,    'no'    ,     ''      ,         ''           ,   ''         
     231! receive 
     232sn_rcv_w10m   =       'none'                 ,    'no'    ,     ''      ,         ''          ,   ''     
     233sn_rcv_taumod =       'coupled'              ,    'no'    ,     ''      ,         ''          ,   ''     
     234sn_rcv_tau    =       'oce only'             ,    'no'    , 'cartesian' , 'eastward-northward',  'U,V'    
     235sn_rcv_dqnsdt =       'coupled'              ,    'no'    ,     ''      ,         ''          ,   ''     
     236sn_rcv_qsr    =       'oce and ice'          ,    'no'    ,     ''      ,         ''          ,   ''     
     237sn_rcv_qns    =       'oce and ice'          ,    'no'    ,     ''      ,         ''          ,   ''     
     238sn_rcv_emp    =       'conservative'         ,    'no'    ,     ''      ,         ''          ,   ''     
     239sn_rcv_rnf    =       'coupled'              ,    'no'    ,     ''      ,         ''          ,   ''     
     240sn_rcv_cal    =       'coupled'              ,    'no'    ,     ''      ,         ''          ,   ''     
     241sn_rcv_co2    =       'coupled'              ,    'no'    ,     ''      ,         ''          ,   ''     
    251242/ 
    252243!----------------------------------------------------------------------- 
     
    402393&nambdy        !  unstructured open boundaries                          ("key_bdy") 
    403394!----------------------------------------------------------------------- 
    404    cn_mask     =  ''                     !  name of mask file (ln_mask=T) 
    405    cn_dta_frs_T= 'bdydata_grid_T.nc'     !  name of data file (T-points) 
    406    cn_dta_frs_U= 'bdydata_grid_U.nc'     !  name of data file (U-points) 
    407    cn_dta_frs_V= 'bdydata_grid_V.nc'     !  name of data file (V-points) 
    408    cn_dta_fla_T= 'bdydata_bt_grid_T.nc'  !  name of data file for Flather condition (T-points) 
    409    cn_dta_fla_U= 'bdydata_bt_grid_U.nc'  !  name of data file for Flather condition (U-points) 
    410    cn_dta_fla_V= 'bdydata_bt_grid_V.nc'  !  name of data file for Flather condition (V-points) 
    411  
    412    ln_clim     = .false.   !  contain 1 (T) or 12 (F) time dumps and be cyclic 
    413    ln_vol      = .false.   !  total volume correction (see volbdy parameter) 
    414    ln_mask     = .false.   !  boundary mask from filbdy_mask (T), boundaries are on edges of domain (F) 
    415    ln_tides    = .false.   !  Apply tidal harmonic forcing with Flather condition 
    416    ln_dyn_fla  = .false.   !  Apply Flather condition to velocities 
    417    ln_tra_frs  = .false.   !  Apply FRS condition to temperature and salinity  
    418    ln_dyn_frs  = .false.   !  Apply FRS condition to velocities 
    419    nn_rimwidth =  9        !  width of the relaxation zone 
    420    nn_dtactl   =  1        !  = 0, bdy data are equal to the initial state 
     395    nb_bdy = 1                            !  number of open boundary sets        
     396    ln_coords_file = .true.               !  =T : read bdy coordinates from file 
     397    cn_coords_file = 'coordinates.bdy.nc' !  bdy coordinates files 
     398    ln_mask_file = .false.                !  =T : read mask from file 
     399    cn_mask_file = ''                     !  name of mask file (if ln_mask_file=.TRUE.) 
     400    nn_dyn2d      =  2                    !  boundary conditions for barotropic fields 
     401    nn_dyn2d_dta  =  3                    !  = 0, bdy data are equal to the initial state 
     402                                          !  = 1, bdy data are read in 'bdydata   .nc' files 
     403                                          !  = 2, use tidal harmonic forcing data from files 
     404                                          !  = 3, use external data AND tidal harmonic forcing 
     405    nn_dyn3d      =  0                    !  boundary conditions for baroclinic velocities 
     406    nn_dyn3d_dta  =  0                    !  = 0, bdy data are equal to the initial state 
    421407                           !  = 1, bdy data are read in 'bdydata   .nc' files 
    422    nn_volctl   =  0        !  = 0, the total water flux across open boundaries is zero 
    423                            !  = 1, the total volume of the system is conserved 
    424 / 
    425 !----------------------------------------------------------------------- 
    426 &nambdy_tide   !  tidal forcing at unstructured boundaries               
    427 !----------------------------------------------------------------------- 
    428    filtide     = 'bdytide_'           !  file name root of tidal forcing files 
    429    tide_cpt    = 'M2','S1'            !  names of tidal components used 
    430    tide_speed  = 28.984106, 15.000001 !  phase speeds of tidal components (deg/hour) 
    431    ln_tide_date= .false.              !  adjust tidal harmonics for start date of run 
    432 / 
    433  
     408    nn_tra        =  1                    !  boundary conditions for T and S 
     409    nn_tra_dta    =  1                    !  = 0, bdy data are equal to the initial state 
     410                           !  = 1, bdy data are read in 'bdydata   .nc' files 
     411    nn_rimwidth  = 10                      !  width of the relaxation zone 
     412    nn_dmp2d_in  = 0                      ! 
     413    nn_dmp2d_out = 0                      ! 
     414    nn_dmp2d_in  = 0                      ! 
     415    nn_dmp2d_out = 0                      ! 
     416    ln_vol     = .false.                  !  total volume correction (see nn_volctl parameter) 
     417    nn_volctl  = 1                        !  = 0, the total water flux across open boundaries is zero 
     418/ 
     419!----------------------------------------------------------------------- 
     420&nambdy_dta      !  open boundaries - external data           ("key_bdy") 
     421!----------------------------------------------------------------------- 
     422!              !   file name    ! frequency (hours) !  variable  ! time interpol. !  clim   ! 'yearly'/ ! weights  ! rotation ! 
     423!              !                !  (if <0  months)  !    name    !    (logical)   !  (T/F)  ! 'monthly' ! filename ! pairing  ! 
     424   bn_ssh =     'amm12_bdyT_u2d' ,         24        , 'sossheig' ,     .true.     , .false. ,  'daily'  ,    ''    ,   '' 
     425   bn_u2d =     'amm12_bdyU_u2d' ,         24        , 'vobtcrtx' ,     .true.     , .false. ,  'daily'  ,    ''    ,   '' 
     426   bn_v2d =     'amm12_bdyV_u2d' ,         24        , 'vobtcrty' ,     .true.     , .false. ,  'daily'  ,    ''    ,   '' 
     427   bn_u3d  =    'amm12_bdyU_u3d' ,         24        , 'vozocrtx' ,     .true.     , .false. ,  'daily'  ,    ''    ,   '' 
     428   bn_v3d  =    'amm12_bdyV_u3d' ,         24        , 'vomecrty' ,     .true.     , .false. ,  'daily'  ,    ''    ,   '' 
     429   bn_tem  =    'amm12_bdyT_tra' ,         24        , 'votemper' ,     .true.     , .false. ,  'daily'  ,    ''    ,   '' 
     430   bn_sal  =    'amm12_bdyT_tra' ,         24        , 'vosaline' ,     .true.     , .false. ,  'daily'  ,    ''    ,   '' 
     431   cn_dir  =    'bdydta/' 
     432   ln_full_vel = .false. 
     433/ 
     434!----------------------------------------------------------------------- 
     435&nambdy_tide     ! tidal forcing at open boundaries               
     436!----------------------------------------------------------------------- 
     437   filtide      = 'bdydta/amm12_bdytide_'         !  file name root of tidal forcing files 
     438    tide_cpt(1)   ='Q1'  !  names of tidal components used 
     439    tide_cpt(2)   ='O1'  !  names of tidal components used 
     440    tide_cpt(3)   ='P1'  !  names of tidal components used 
     441    tide_cpt(4)   ='S1'  !  names of tidal components used 
     442    tide_cpt(5)   ='K1'  !  names of tidal components used 
     443    tide_cpt(6)   ='2N2' !  names of tidal components used 
     444    tide_cpt(7)   ='MU2' !  names of tidal components used 
     445    tide_cpt(8)   ='N2'  !  names of tidal components used 
     446    tide_cpt(9)   ='NU2' !  names of tidal components used 
     447    tide_cpt(10)   ='M2'  !  names of tidal components used 
     448    tide_cpt(11)   ='L2'  !  names of tidal components used 
     449    tide_cpt(12)   ='T2'  !  names of tidal components used 
     450    tide_cpt(13)   ='S2'  !  names of tidal components used 
     451    tide_cpt(14)   ='K2'  !  names of tidal components used 
     452    tide_cpt(15)   ='M4'  !  names of tidal components used 
     453    tide_speed(1)   = 13.398661 !  phase speeds of tidal components (deg/hour) 
     454    tide_speed(2)   = 13.943036 !  phase speeds of tidal components (deg/hour) 
     455    tide_speed(3)   = 14.958932 !  phase speeds of tidal components (deg/hour) 
     456    tide_speed(4)   = 15.000001 !  phase speeds of tidal components (deg/hour) 
     457    tide_speed(5)   = 15.041069 !  phase speeds of tidal components (deg/hour) 
     458    tide_speed(6)   = 27.895355 !  phase speeds of tidal components (deg/hour) 
     459    tide_speed(7)   = 27.968210 !  phase speeds of tidal components (deg/hour) 
     460    tide_speed(8)   = 28.439730 !  phase speeds of tidal components (deg/hour) 
     461    tide_speed(9)   = 28.512585 !  phase speeds of tidal components (deg/hour) 
     462    tide_speed(10)   = 28.984106 !  phase speeds of tidal components (deg/hour) 
     463    tide_speed(11)   = 29.528479 !  phase speeds of tidal components (deg/hour) 
     464    tide_speed(12)   = 29.958935 !  phase speeds of tidal components (deg/hour) 
     465    tide_speed(13)   = 30.000002 !  phase speeds of tidal components (deg/hour) 
     466    tide_speed(14)   = 30.082138 !  phase speeds of tidal components (deg/hour) 
     467    tide_speed(15)   = 57.968212 !  phase speeds of tidal components (deg/hour) 
     468    ln_tide_date = .true.               !  adjust tidal harmonics for start date of run 
     469/ 
    434470!!====================================================================== 
    435471!!                 ***  Bottom boundary condition  *** 
     
    450486   ln_bfr2d    = .false.   !  horizontal variation of the bottom friction coef (read a 2D mask file ) 
    451487   rn_bfrien   =    50.    !  local multiplying factor of bfr (ln_bfr2d=T) 
     488   ln_bfrimp   = .true.    !  implicit bottom friction (requires ln_zdfexp = .false. if true) 
    452489/ 
    453490!----------------------------------------------------------------------- 
     
    496533   ln_traadv_muscl2 =  .false.  !  MUSCL2 scheme + cen2 at boundaries   
    497534   ln_traadv_ubs    =  .false.  !  UBS scheme                  
    498    ln_traadv_qck    =  .false.  !  QUCIKEST scheme                  
     535   ln_traadv_qck    =  .false.  !  QUICKEST scheme                  
    499536/ 
    500537!----------------------------------------------------------------------- 
     
    508545   ln_traldf_hor    =  .false.  !  horizontal (geopotential)            (require "key_ldfslp" when ln_sco=T) 
    509546   ln_traldf_iso    =  .true.   !  iso-neutral                          (require "key_ldfslp") 
    510    ln_traldf_grif   =  .false.  !  griffies skew flux formulation       (require "key_ldfslp")  ! UNDER TEST, DO NOT USE 
    511    ln_traldf_gdia   =  .false.  !  griffies operator strfn diagnostics  (require "key_ldfslp")  ! UNDER TEST, DO NOT USE 
     547   ln_traldf_grif   =  .false.  !  griffies skew flux formulation       (require "key_ldfslp") 
     548   ln_traldf_gdia   =  .false.  !  griffies operator strfn diagnostics  (require "key_ldfslp") 
     549   ln_triad_iso     =  .false.  !  griffies operator calculates triads twice => pure lateral mixing in ML (require "key_ldfslp") 
     550   ln_botmix_grif   =  .false.  !  griffies operator with lateral mixing on bottom (require "key_ldfslp") 
    512551   !                       !  Coefficient 
    513552   rn_aht_0         =   300.    !  horizontal eddy diffusivity for tracers [m2/s] 
     
    562601   ln_hpg_zps  = .true.    !  z-coordinate - partial steps (interpolation) 
    563602   ln_hpg_sco  = .false.   !  s-coordinate (standard jacobian formulation) 
    564    ln_hpg_hel  = .false.   !  s-coordinate (helsinki modification) 
    565    ln_hpg_wdj  = .false.   !  s-coordinate (weighted density jacobian) 
    566603   ln_hpg_djc  = .false.   !  s-coordinate (Density Jacobian with Cubic polynomial) 
    567    ln_hpg_rot  = .false.   !  s-coordinate (ROTated axes scheme) 
    568    rn_gamma    = 0.e0      !  weighting coefficient (wdj scheme) 
     604   ln_hpg_prj  = .false.   !  s-coordinate (Pressure Jacobian scheme) 
    569605   ln_dynhpg_imp = .true.  !  time stepping: semi-implicit time scheme  (T) 
    570606                                 !           centered      time scheme  (F) 
     
    931967   cn_dir_cdg  = './'  !  root directory for the location of drag coefficient files 
    932968/ 
     969!----------------------------------------------------------------------- 
     970&namdyn_nept  !   Neptune effect (simplified: lateral and vertical diffusions removed) 
     971!----------------------------------------------------------------------- 
     972   ! Suggested lengthscale values are those of Eby & Holloway (1994) for a coarse model 
     973   ln_neptsimp       = .false.  ! yes/no use simplified neptune 
     974 
     975   ln_smooth_neptvel = .false.  ! yes/no smooth zunep, zvnep 
     976   rn_tslse          =  1.2e4   ! value of lengthscale L at the equator 
     977   rn_tslsp          =  3.0e3   ! value of lengthscale L at the pole 
     978   ! Specify whether to ramp down the Neptune velocity in shallow 
     979   ! water, and if so the depth range controlling such ramping down 
     980   ln_neptramp       = .false.  ! ramp down Neptune velocity in shallow water 
     981   rn_htrmin         =  100.0   ! min. depth of transition range 
     982   rn_htrmax         =  200.0   ! max. depth of transition range 
     983/ 
     984>>>>>>> .merge-right.r3114 
  • branches/2011/dev_NEMO_MERGE_2011/NEMOGCM/NEMO/LIM_SRC_2/limsbc_2.F90

    r2715 r3116  
    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_NEMO_MERGE_2011/NEMOGCM/NEMO/LIM_SRC_2/limthd_zdf_2.F90

    r2715 r3116  
    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_NEMO_MERGE_2011/NEMOGCM/NEMO/OPA_SRC/BDY/bdy_oce.F90

    r2715 r3116  
    77   !!            3.0  !  2008-04  (NEMO team)  add in the reference version      
    88   !!            3.3  !  2010-09  (D. Storkey) add ice boundary conditions 
     9   !!            3.4  !  2011     (D. Storkey, J. Chanut) OBC-BDY merge 
    910   !!---------------------------------------------------------------------- 
    1011#if defined key_bdy  
     
    1920   PUBLIC 
    2021 
     22   TYPE, PUBLIC ::   OBC_INDEX    !: Indices and weights which define the open boundary 
     23      INTEGER,          DIMENSION(jpbgrd) ::  nblen 
     24      INTEGER,          DIMENSION(jpbgrd) ::  nblenrim 
     25      INTEGER, POINTER, DIMENSION(:,:)   ::  nbi 
     26      INTEGER, POINTER, DIMENSION(:,:)   ::  nbj 
     27      INTEGER, POINTER, DIMENSION(:,:)   ::  nbr 
     28      INTEGER, POINTER, DIMENSION(:,:)   ::  nbmap 
     29      REAL   , POINTER, DIMENSION(:,:)   ::  nbw 
     30      REAL   , POINTER, DIMENSION(:)     ::  flagu 
     31      REAL   , POINTER, DIMENSION(:)     ::  flagv 
     32   END TYPE OBC_INDEX 
     33 
     34   TYPE, PUBLIC ::   OBC_DATA     !: Storage for external data 
     35      REAL, POINTER, DIMENSION(:)     ::  ssh 
     36      REAL, POINTER, DIMENSION(:)     ::  u2d 
     37      REAL, POINTER, DIMENSION(:)     ::  v2d 
     38      REAL, POINTER, DIMENSION(:,:)   ::  u3d 
     39      REAL, POINTER, DIMENSION(:,:)   ::  v3d 
     40      REAL, POINTER, DIMENSION(:,:)   ::  tem 
     41      REAL, POINTER, DIMENSION(:,:)   ::  sal 
     42#if defined key_lim2 
     43      REAL, POINTER, DIMENSION(:)     ::  frld 
     44      REAL, POINTER, DIMENSION(:)     ::  hicif 
     45      REAL, POINTER, DIMENSION(:)     ::  hsnif 
     46#endif 
     47   END TYPE OBC_DATA 
     48 
    2149   !!---------------------------------------------------------------------- 
    2250   !! Namelist variables 
    2351   !!---------------------------------------------------------------------- 
    24    CHARACTER(len=80) ::   cn_mask        !: Name of unstruct. bdy mask file 
    25    CHARACTER(len=80) ::   cn_dta_frs_T   !: Name of unstruct. bdy data file at T points for FRS conditions 
    26    CHARACTER(len=80) ::   cn_dta_frs_U   !: Name of unstruct. bdy data file at U points for FRS conditions 
    27    CHARACTER(len=80) ::   cn_dta_frs_V   !: Name of unstruct. bdy data file at V points for FRS conditions 
    28    CHARACTER(len=80) ::   cn_dta_fla_T   !: Name of unstruct. bdy data file at T points for Flather scheme 
    29    CHARACTER(len=80) ::   cn_dta_fla_U   !: Name of unstruct. bdy data file at U points for Flather scheme 
    30    CHARACTER(len=80) ::   cn_dta_fla_V   !: Name of unstruct. bdy data file at V points for Flather scheme 
     52   CHARACTER(len=80), DIMENSION(jp_bdy) ::   cn_coords_file !: Name of bdy coordinates file 
     53   CHARACTER(len=80)                    ::   cn_mask_file   !: Name of bdy mask file 
    3154   ! 
    32    LOGICAL ::   ln_tides = .false.    !: =T apply tidal harmonic forcing along open boundaries 
    33    LOGICAL ::   ln_vol  = .false.     !: =T volume correction              
    34    LOGICAL ::   ln_mask = .false.     !: =T read bdymask from file 
    35    LOGICAL ::   ln_clim = .false.     !: =T bdy data files contain  1 time dump  (-->bdy forcing will be constant)  
    36    !                                  !                         or 12 months     (-->bdy forcing will be cyclic)  
    37    LOGICAL ::   ln_dyn_fla  = .false. !: =T Flather boundary conditions on barotropic velocities 
    38    LOGICAL ::   ln_dyn_frs  = .false. !: =T FRS boundary conditions on velocities 
    39    LOGICAL ::   ln_tra_frs  = .false. !: =T FRS boundary conditions on tracers (T and S) 
    40    LOGICAL ::   ln_ice_frs  = .false. !: =T FRS boundary conditions on seaice (leads fraction, ice depth, snow depth) 
     55   LOGICAL, DIMENSION(jp_bdy) ::   ln_coords_file           !: =T read bdy coordinates from file;  
     56   !                                                        !: =F read bdy coordinates from namelist 
     57   LOGICAL                    ::   ln_mask_file             !: =T read bdymask from file 
     58   LOGICAL                    ::   ln_vol                   !: =T volume correction              
    4159   ! 
    42    INTEGER ::   nn_rimwidth = 7       !: boundary rim width 
    43    INTEGER ::   nn_dtactl   = 1       !: = 0 use the initial state as bdy dta ; = 1 read it in a NetCDF file 
    44    INTEGER ::   nn_volctl   = 1       !: = 0 the total volume will have the variability of the surface Flux E-P  
    45    !                                  !  = 1 the volume will be constant during all the integration. 
     60   INTEGER                    ::   nb_bdy                   !: number of open boundary sets 
     61   INTEGER, DIMENSION(jp_bdy) ::   nn_rimwidth              !: boundary rim width for Flow Relaxation Scheme 
     62   INTEGER                    ::   nn_volctl                !: = 0 the total volume will have the variability of the surface Flux E-P  
     63   !                                                        !  = 1 the volume will be constant during all the integration. 
     64   INTEGER, DIMENSION(jp_bdy) ::   nn_dyn2d                 ! Choice of boundary condition for barotropic variables (U,V,SSH) 
     65   INTEGER, DIMENSION(jp_bdy) ::   nn_dyn2d_dta           !: = 0 use the initial state as bdy dta ;  
     66                                                            !: = 1 read it in a NetCDF file 
     67                                                            !: = 2 read tidal harmonic forcing from a NetCDF file 
     68                                                            !: = 3 read external data AND tidal harmonic forcing from NetCDF files 
     69   INTEGER, DIMENSION(jp_bdy) ::   nn_dyn3d                 ! Choice of boundary condition for baroclinic velocities  
     70   INTEGER, DIMENSION(jp_bdy) ::   nn_dyn3d_dta           !: = 0 use the initial state as bdy dta ;  
     71                                                            !: = 1 read it in a NetCDF file 
     72   INTEGER, DIMENSION(jp_bdy) ::   nn_tra                   ! Choice of boundary condition for active tracers (T and S) 
     73   INTEGER, DIMENSION(jp_bdy) ::   nn_tra_dta             !: = 0 use the initial state as bdy dta ;  
     74                                                            !: = 1 read it in a NetCDF file 
     75#if defined key_lim2 
     76   INTEGER, DIMENSION(jp_bdy) ::   nn_ice_lim2              ! Choice of boundary condition for sea ice variables  
     77   INTEGER, DIMENSION(jp_bdy) ::   nn_ice_lim2_dta          !: = 0 use the initial state as bdy dta ;  
     78                                                            !: = 1 read it in a NetCDF file 
     79#endif 
     80   ! 
     81   INTEGER, DIMENSION(jp_bdy) ::   nn_dmp2d_in              ! Damping timescale (days) for 2D solution for inward radiation or FRS  
     82   INTEGER, DIMENSION(jp_bdy) ::   nn_dmp2d_out             ! Damping timescale (days) for 2D solution for outward radiation  
     83   INTEGER, DIMENSION(jp_bdy) ::   nn_dmp3d_in              ! Damping timescale (days) for 3D solution for inward radiation or FRS  
     84   INTEGER, DIMENSION(jp_bdy) ::   nn_dmp3d_out             ! Damping timescale (days) for 3D solution for outward radiation 
    4685 
     86    
    4787   !!---------------------------------------------------------------------- 
    4888   !! Global variables 
     
    5292   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::   bdyvmask   !: Mask defining computational domain at V-points 
    5393 
     94   REAL(wp)                                    ::   bdysurftot !: Lateral surface of unstructured open boundary 
     95 
     96   REAL(wp), POINTER, DIMENSION(:,:)           ::   pssh       !:  
     97   REAL(wp), POINTER, DIMENSION(:,:)           ::   phur       !:  
     98   REAL(wp), POINTER, DIMENSION(:,:)           ::   phvr       !: Pointers for barotropic fields  
     99   REAL(wp), POINTER, DIMENSION(:,:)           ::   pu2d       !:  
     100   REAL(wp), POINTER, DIMENSION(:,:)           ::   pv2d       !:  
     101 
    54102   !!---------------------------------------------------------------------- 
    55    !! Unstructured open boundary data variables 
     103   !! open boundary data variables 
    56104   !!---------------------------------------------------------------------- 
    57    INTEGER, DIMENSION(jpbgrd) ::   nblen    = 0           !: Size of bdy data on a proc for each grid type 
    58    INTEGER, DIMENSION(jpbgrd) ::   nblenrim = 0           !: Size of bdy data on a proc for first rim ind 
    59    INTEGER, DIMENSION(jpbgrd) ::   nblendta = 0           !: Size of bdy data in file 
    60105 
    61    INTEGER, DIMENSION(jpbdim,jpbgrd) ::   nbi, nbj        !: i and j indices of bdy dta 
    62    INTEGER, DIMENSION(jpbdim,jpbgrd) ::   nbr             !: Discrete distance from rim points 
    63    INTEGER, DIMENSION(jpbdim,jpbgrd) ::   nbmap           !: Indices of data in file for data in memory  
    64      
    65    REAL(wp) ::   bdysurftot                               !: Lateral surface of unstructured open boundary 
    66  
    67    REAL(wp), DIMENSION(jpbdim)        ::   flagu, flagv   !: Flag for normal velocity compnt for velocity components 
    68    REAL(wp), DIMENSION(jpbdim,jpbgrd) ::   nbw            !: Rim weights of bdy data 
    69  
    70    REAL(wp), DIMENSION(jpbdim)     ::   sshbdy            !: Now clim of bdy sea surface height (Flather) 
    71    REAL(wp), DIMENSION(jpbdim)     ::   ubtbdy, vbtbdy    !: Now clim of bdy barotropic velocity components 
    72    REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::   tbdy  , sbdy      !: Now clim of bdy temperature and salinity   
    73    REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::   ubdy  , vbdy    !: Now clim of bdy velocity components 
    74    REAL(wp), DIMENSION(jpbdim) ::   sshtide               !: Tidal boundary array : SSH 
    75    REAL(wp), DIMENSION(jpbdim) ::   utide, vtide          !: Tidal boundary array : U and V 
    76 #if defined key_lim2 
    77    REAL(wp), DIMENSION(jpbdim) ::   frld_bdy    !: now ice leads fraction climatology    
    78    REAL(wp), DIMENSION(jpbdim) ::   hicif_bdy   !: Now ice  thickness climatology 
    79    REAL(wp), DIMENSION(jpbdim) ::   hsnif_bdy   !: now snow thickness 
    80 #endif 
     106   INTEGER,  DIMENSION(jp_bdy)                     ::   nn_dta            !: =0 => *all* data is set to initial conditions 
     107                                                                          !: =1 => some data to be read in from data files 
     108   REAL(wp), ALLOCATABLE, DIMENSION(:,:,:), TARGET ::   dta_global        !: workspace for reading in global data arrays 
     109   TYPE(OBC_INDEX), DIMENSION(jp_bdy), TARGET      ::   idx_bdy           !: bdy indices (local process) 
     110   TYPE(OBC_DATA) , DIMENSION(jp_bdy)              ::   dta_bdy           !: bdy external data (local process) 
    81111 
    82112   !!---------------------------------------------------------------------- 
     
    94124      !!---------------------------------------------------------------------- 
    95125      ! 
    96       ALLOCATE( bdytmask(jpi,jpj) , tbdy(jpbdim,jpk) , sbdy(jpbdim,jpk) ,     & 
    97          &      bdyumask(jpi,jpj) , ubdy(jpbdim,jpk) ,                        & 
    98          &      bdyvmask(jpi,jpj) , vbdy(jpbdim,jpk) ,                    STAT=bdy_oce_alloc ) 
     126      ALLOCATE( bdytmask(jpi,jpj) , bdyumask(jpi,jpj), bdyvmask(jpi,jpj),                    &   
     127         &      STAT=bdy_oce_alloc ) 
    99128         ! 
    100129      IF( lk_mpp             )   CALL mpp_sum ( bdy_oce_alloc ) 
     
    112141   !!====================================================================== 
    113142END MODULE bdy_oce 
     143 
  • branches/2011/dev_NEMO_MERGE_2011/NEMOGCM/NEMO/OPA_SRC/BDY/bdy_par.F90

    r2528 r3116  
    1717 
    1818   LOGICAL, PUBLIC, PARAMETER ::   lk_bdy  = .TRUE.   !: Unstructured Ocean Boundary Condition flag 
    19    INTEGER, PUBLIC, PARAMETER ::   jpbdta  = 20000    !: Max length of bdy field in file 
    20    INTEGER, PUBLIC, PARAMETER ::   jpbdim  = 20000    !: Max length of bdy field on a processor 
     19   INTEGER, PUBLIC, PARAMETER ::   jp_bdy  = 10       !: Maximum number of bdy sets 
    2120   INTEGER, PUBLIC, PARAMETER ::   jpbtime = 1000     !: Max number of time dumps per file 
    22    INTEGER, PUBLIC, PARAMETER ::   jpbgrd  = 6        !: Number of horizontal grid types used  (T, u, v, f) 
     21   INTEGER, PUBLIC, PARAMETER ::   jpbgrd  = 3        !: Number of horizontal grid types used  (T, U, V) 
     22 
     23   !! Flags for choice of schemes 
     24   INTEGER, PUBLIC, PARAMETER ::   jp_none         = 0        !: Flag for no open boundary condition 
     25   INTEGER, PUBLIC, PARAMETER ::   jp_frs          = 1        !: Flag for Flow Relaxation Scheme 
     26   INTEGER, PUBLIC, PARAMETER ::   jp_flather      = 2        !: Flag for Flather 
    2327#else 
    2428   !!---------------------------------------------------------------------- 
  • branches/2011/dev_NEMO_MERGE_2011/NEMOGCM/NEMO/OPA_SRC/BDY/bdydta.F90

    r2977 r3116  
    1010   !!            3.3  !  2010-09  (E.O'Dea) modifications for Shelf configurations  
    1111   !!            3.3  !  2010-09  (D.Storkey) add ice boundary conditions 
     12   !!            3.4  ???????????????? 
    1213   !!---------------------------------------------------------------------- 
    1314#if defined key_bdy 
    1415   !!---------------------------------------------------------------------- 
    15    !!   'key_bdy'                     Unstructured Open Boundary Conditions 
    16    !!---------------------------------------------------------------------- 
    17    !!   bdy_dta_frs    : read u, v, t, s data along open boundaries 
    18    !!   bdy_dta_fla : read depth-mean velocities and elevation along open boundaries         
     16   !!   'key_bdy'                     Open Boundary Conditions 
     17   !!---------------------------------------------------------------------- 
     18   !!    bdy_dta        : read external data along open boundaries from file 
     19   !!    bdy_dta_init   : initialise arrays etc for reading of external data 
    1920   !!---------------------------------------------------------------------- 
    2021   USE oce             ! ocean dynamics and tracers 
    2122   USE dom_oce         ! ocean space and time domain 
    2223   USE phycst          ! physical constants 
    23    USE bdy_oce         ! ocean open boundary conditions 
     24   USE bdy_oce         ! ocean open boundary conditions   
    2425   USE bdytides        ! tidal forcing at boundaries 
    25    USE iom 
    26    USE ioipsl 
     26   USE fldread         ! read input fields 
     27   USE iom             ! IOM library 
    2728   USE in_out_manager  ! I/O logical units 
    2829#if defined key_lim2 
     
    3334   PRIVATE 
    3435 
    35    PUBLIC   bdy_dta_frs      ! routines called by step.F90 
    36    PUBLIC   bdy_dta_fla  
    37    PUBLIC   bdy_dta_alloc    ! routine called by bdy_init.F90 
    38  
    39    INTEGER ::   numbdyt, numbdyu, numbdyv                      ! logical units for T-, U-, & V-points data file, resp. 
    40    INTEGER ::   ntimes_bdy                                     ! exact number of time dumps in data files 
    41    INTEGER ::   nbdy_b, nbdy_a                                 ! record of bdy data file for before and after time step 
    42    INTEGER ::   numbdyt_bt, numbdyu_bt, numbdyv_bt             ! logical unit for T-, U- & V-points data file, resp. 
    43    INTEGER ::   ntimes_bdy_bt                                  ! exact number of time dumps in data files 
    44    INTEGER ::   nbdy_b_bt, nbdy_a_bt                           ! record of bdy data file for before and after time step 
    45  
    46    INTEGER, DIMENSION (jpbtime) ::   istep, istep_bt           ! time array in seconds in each data file 
    47  
    48    REAL(wp) ::  zoffset                                        ! time offset between time origin in file & start time of model run 
    49  
    50    REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   tbdydta, sbdydta   ! time interpolated values of T and S bdy data    
    51    REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   ubdydta, vbdydta   ! time interpolated values of U and V bdy data  
    52    REAL(wp), DIMENSION(jpbdim,2)     ::   ubtbdydta, vbtbdydta ! Arrays used for time interpolation of bdy data    
    53    REAL(wp), DIMENSION(jpbdim,2)     ::   sshbdydta            ! bdy data of ssh 
    54  
    55 #if defined key_lim2 
    56    REAL(wp), DIMENSION(jpbdim,2)     ::   frld_bdydta          ! } 
    57    REAL(wp), DIMENSION(jpbdim,2)     ::   hicif_bdydta         ! } Arrays used for time interp. of ice bdy data  
    58    REAL(wp), DIMENSION(jpbdim,2)     ::   hsnif_bdydta         ! } 
    59 #endif 
    60  
     36   PUBLIC   bdy_dta          ! routine called by step.F90 and dynspg_ts.F90 
     37   PUBLIC   bdy_dta_init     ! routine called by nemogcm.F90 
     38 
     39   INTEGER, ALLOCATABLE, DIMENSION(:)   ::   nb_bdy_fld        ! Number of fields to update for each boundary set. 
     40   INTEGER                              ::   nb_bdy_fld_sum    ! Total number of fields to update for all boundary sets. 
     41 
     42   LOGICAL,           DIMENSION(jp_bdy) ::   ln_full_vel_array ! =T => full velocities in 3D boundary conditions 
     43                                                               ! =F => baroclinic velocities in 3D boundary conditions 
     44 
     45   TYPE(FLD), PUBLIC, ALLOCATABLE, DIMENSION(:), TARGET ::   bf        ! structure of input fields (file informations, fields read) 
     46 
     47   TYPE(MAP_POINTER), ALLOCATABLE, DIMENSION(:) :: nbmap_ptr   ! array of pointers to nbmap 
     48 
     49#  include "domzgr_substitute.h90" 
    6150   !!---------------------------------------------------------------------- 
    6251   !! NEMO/OPA 3.3 , NEMO Consortium (2010) 
     
    6655CONTAINS 
    6756 
    68   FUNCTION bdy_dta_alloc() 
    69      !!---------------------------------------------------------------------- 
    70      USE lib_mpp, ONLY: ctl_warn, mpp_sum 
    71      ! 
    72      INTEGER :: bdy_dta_alloc 
    73      !!---------------------------------------------------------------------- 
    74      ! 
    75      ALLOCATE(tbdydta(jpbdim,jpk,2), sbdydta(jpbdim,jpk,2), & 
    76               ubdydta(jpbdim,jpk,2), vbdydta(jpbdim,jpk,2), Stat=bdy_dta_alloc) 
    77  
    78      IF( lk_mpp           ) CALL mpp_sum ( bdy_dta_alloc ) 
    79      IF(bdy_dta_alloc /= 0) CALL ctl_warn('bdy_dta_alloc: failed to allocate arrays') 
    80  
    81    END FUNCTION bdy_dta_alloc 
    82  
    83  
    84    SUBROUTINE bdy_dta_frs( kt ) 
     57      SUBROUTINE bdy_dta( kt, jit, time_offset ) 
    8558      !!---------------------------------------------------------------------- 
    86       !!                   ***  SUBROUTINE bdy_dta_frs  *** 
     59      !!                   ***  SUBROUTINE bdy_dta  *** 
    8760      !!                     
    88       !! ** Purpose :   Read unstructured boundary data for FRS condition. 
     61      !! ** Purpose :   Update external data for open boundary conditions 
    8962      !! 
    90       !! ** Method  :   At the first timestep, read in boundary data for two 
    91       !!                times from the file and time-interpolate. At other  
    92       !!                timesteps, check to see if we need another time from  
    93       !!                the file. If so read it in. Time interpolate. 
     63      !! ** Method  :   Use fldread.F90 
     64      !!                 
    9465      !!---------------------------------------------------------------------- 
    95       INTEGER, INTENT( in ) ::   kt   ! ocean time-step index (for timesplitting option, otherwise zero) 
     66      USE wrk_nemo, ONLY: wrk_in_use, wrk_not_released 
     67      USE wrk_nemo, ONLY: wrk_2d_22, wrk_2d_23   ! 2D workspace 
    9668      !! 
    97       CHARACTER(LEN=80), DIMENSION(3) ::   clfile               ! names of input files 
    98       CHARACTER(LEN=70 )              ::   clunits              ! units attribute of time coordinate 
    99       LOGICAL ::   lect                                         ! flag for reading 
    100       INTEGER ::   it, ib, ik, igrd                             ! dummy loop indices 
    101       INTEGER ::   igrd_start, igrd_end                         ! start and end of loops on igrd 
    102       INTEGER ::   idvar                                        ! netcdf var ID 
    103       INTEGER ::   iman, i15, imois                             ! Time variables for monthly clim forcing 
    104       INTEGER ::   ntimes_bdyt, ntimes_bdyu, ntimes_bdyv 
    105       INTEGER ::   itimer, totime 
    106       INTEGER ::   ii, ij                                       ! array addresses 
    107       INTEGER ::   ipi, ipj, ipk, inum                          ! local integers (NetCDF read) 
    108       INTEGER ::   iyear0, imonth0, iday0 
    109       INTEGER ::   ihours0, iminutes0, isec0 
    110       INTEGER ::   iyear, imonth, iday, isecs 
    111       INTEGER, DIMENSION(jpbtime) ::   istept, istepu, istepv   ! time arrays from data files 
    112       REAL(wp) ::   dayfrac, zxy, zoffsett 
    113       REAL(wp) ::   zoffsetu, zoffsetv 
    114       REAL(wp) ::   dayjul0, zdayjulini 
    115       REAL(wp), DIMENSION(jpbtime)      ::   zstepr             ! REAL time array from data files 
    116       REAL(wp), DIMENSION(jpbdta,1,jpk) ::   zdta               ! temporary array for data fields 
     69      INTEGER, INTENT( in )           ::   kt    ! ocean time-step index  
     70      INTEGER, INTENT( in ), OPTIONAL ::   jit   ! subcycle time-step index (for timesplitting option) 
     71      INTEGER, INTENT( in ), OPTIONAL ::   time_offset  ! time offset in units of timesteps. NB. if jit 
     72                                                        ! is present then units = subcycle timesteps. 
     73                                                        ! time_offset = 0 => get data at "now" time level 
     74                                                        ! time_offset = -1 => get data at "before" time level 
     75                                                        ! time_offset = +1 => get data at "after" time level 
     76                                                        ! etc. 
     77      !! 
     78      INTEGER     ::  ib_bdy, jfld, jstart, jend, ib, ii, ij, ik, igrd  ! local indices 
     79      INTEGER,          DIMENSION(jpbgrd) ::   ilen1  
     80      INTEGER, POINTER, DIMENSION(:)      ::   nblen, nblenrim  ! short cuts 
     81      !! 
    11782      !!--------------------------------------------------------------------------- 
    11883 
    119  
    120       IF( ln_dyn_frs .OR. ln_tra_frs    & 
    121          &               .OR. ln_ice_frs ) THEN  ! If these are both false then this routine does nothing 
    122  
    123       ! -------------------- ! 
    124       !    Initialization    ! 
    125       ! -------------------- ! 
    126  
    127       lect   = .false.           ! If true, read a time record 
    128  
    129       ! Some time variables for monthly climatological forcing: 
    130       ! ******************************************************* 
    131  
    132 !!gm  here  use directely daymod calendar variables 
    133   
    134       iman = INT( raamo )      ! Number of months in a year 
    135  
    136       i15 = INT( 2*REAL( nday, wp ) / ( REAL( nmonth_len(nmonth), wp ) + 0.5 ) ) 
    137       ! i15=0 if the current day is in the first half of the month, else i15=1 
    138  
    139       imois = nmonth + i15 - 1            ! imois is the first month record 
    140       IF( imois == 0 )   imois = iman 
    141  
    142       ! Time variable for non-climatological forcing: 
    143       ! ********************************************* 
    144       itimer = (kt-nit000+1)*rdt      ! current time in seconds for interpolation  
    145  
    146  
    147       !                                                !-------------------! 
    148       IF( kt == nit000 ) THEN                          !  First call only  ! 
    149          !                                             !-------------------! 
    150          istep(:) = 0 
    151          nbdy_b   = 0 
    152          nbdy_a   = 0 
    153  
    154          ! Get time information from bdy data file 
    155          ! *************************************** 
    156  
    157          IF(lwp) WRITE(numout,*) 
    158          IF(lwp) WRITE(numout,*)    'bdy_dta_frs : Initialize unstructured boundary data' 
    159          IF(lwp) WRITE(numout,*)    '~~~~~~~'  
    160  
    161          IF     ( nn_dtactl == 0 ) THEN 
    162             ! 
    163             IF(lwp) WRITE(numout,*) '          Bdy data are taken from initial conditions' 
    164             ! 
    165          ELSEIF (nn_dtactl == 1) THEN 
    166             ! 
    167             IF(lwp) WRITE(numout,*) '          Bdy data are read in netcdf files' 
    168             ! 
    169             dayfrac = adatrj  - REAL( itimer, wp ) / 86400.   ! day fraction at time step kt-1 
    170             dayfrac = dayfrac - INT ( dayfrac )               ! 
    171             totime  = ( nitend - nit000 + 1 ) * rdt           ! Total time of the run to verify that all the 
    172             !                                                 ! necessary time dumps in file are included 
    173             ! 
    174             clfile(1) = cn_dta_frs_T 
    175             clfile(2) = cn_dta_frs_U 
    176             clfile(3) = cn_dta_frs_V 
    177             !                                                   
    178             ! how many files are we to read in? 
    179             igrd_start = 1 
    180             igrd_end   = 3 
    181             IF(.NOT. ln_tra_frs .AND. .NOT. ln_ice_frs) THEN       ! No T-grid file. 
    182                igrd_start = 2 
    183             ELSEIF ( .NOT. ln_dyn_frs ) THEN                           ! No U-grid or V-grid file. 
    184                igrd_end   = 1          
    185             ENDIF 
    186  
    187             DO igrd = igrd_start, igrd_end                     !  loop over T, U & V grid  ! 
    188                !                                               !---------------------------! 
    189                CALL iom_open( clfile(igrd), inum ) 
    190                CALL iom_gettime( inum, zstepr, kntime=ntimes_bdy, cdunits=clunits )  
    191  
    192                SELECT CASE( igrd ) 
    193                   CASE (1)   ;   numbdyt = inum 
    194                   CASE (2)   ;   numbdyu = inum 
    195                   CASE (3)   ;   numbdyv = inum 
    196                END SELECT 
    197  
    198                ! Calculate time offset  
    199                READ(clunits,7000) iyear0, imonth0, iday0, ihours0, iminutes0, isec0 
    200                ! Convert time origin in file to julian days  
    201                isec0 = isec0 + ihours0*60.*60. + iminutes0*60. 
    202                CALL ymds2ju(iyear0, imonth0, iday0, REAL(isec0, wp), dayjul0) 
    203                ! Compute model initialization time  
    204                iyear  = ndastp / 10000 
    205                imonth = ( ndastp - iyear * 10000 ) / 100 
    206                iday   = ndastp - iyear * 10000 - imonth * 100 
    207                isecs  = dayfrac * 86400 
    208                CALL ymds2ju(iyear, imonth, iday, REAL(isecs, wp) , zdayjulini) 
    209                ! offset from initialization date: 
    210                zoffset = (dayjul0-zdayjulini)*86400 
    211                ! 
    212 7000           FORMAT('seconds since ', I4.4,'-',I2.2,'-',I2.2,' ',I2.2,':',I2.2,':',I2.2) 
    213  
    214                !! TO BE DONE... Check consistency between calendar from file  
    215                !! (available optionally from iom_gettime) and calendar in model  
    216                !! when calendar in model available outside of IOIPSL. 
    217  
    218                IF(lwp) WRITE(numout,*) 'number of times: ',ntimes_bdy 
    219                IF(lwp) WRITE(numout,*) 'offset: ',zoffset 
    220                IF(lwp) WRITE(numout,*) 'totime: ',totime 
    221                IF(lwp) WRITE(numout,*) 'zstepr: ',zstepr(1:ntimes_bdy) 
    222  
    223                ! Check that there are not too many times in the file.  
    224                IF( ntimes_bdy > jpbtime ) THEN 
    225                   WRITE(ctmp1,*) 'Check file: ', clfile(igrd), 'jpbtime= ', jpbtime, ' ntimes_bdy= ', ntimes_bdy 
    226                   CALL ctl_stop( 'Number of time dumps in files exceed jpbtime parameter', ctmp1 ) 
    227                ENDIF 
    228  
    229                ! Check that time array increases: 
    230                it = 1 
    231                DO WHILE( zstepr(it+1) > zstepr(it) .AND. it /= ntimes_bdy - 1 )  
    232                   it = it + 1 
    233                END DO 
    234                ! 
    235                IF( it /= ntimes_bdy-1 .AND. ntimes_bdy > 1 ) THEN 
    236                      WRITE(ctmp1,*) 'Check file: ', clfile(igrd) 
    237                      CALL ctl_stop( 'Time array in unstructured boundary data files',   & 
    238                         &           'does not continuously increase.'               , ctmp1 ) 
    239                ENDIF 
    240                ! 
    241                ! Check that times in file span model run time: 
    242                IF( zstepr(1) + zoffset > 0 ) THEN 
    243                      WRITE(ctmp1,*) 'Check file: ', clfile(igrd) 
    244                      CALL ctl_stop( 'First time dump in bdy file is after model initial time', ctmp1 ) 
    245                END IF 
    246                IF( zstepr(ntimes_bdy) + zoffset < totime ) THEN 
    247                      WRITE(ctmp1,*) 'Check file: ', clfile(igrd) 
    248                      CALL ctl_stop( 'Last time dump in bdy file is before model final time', ctmp1 ) 
    249                END IF 
    250                ! 
    251                SELECT CASE( igrd ) 
    252                   CASE (1) 
    253                     ntimes_bdyt = ntimes_bdy 
    254                     zoffsett = zoffset 
    255                     istept(:) = INT( zstepr(:) + zoffset ) 
    256                     numbdyt = inum 
    257                   CASE (2) 
    258                     ntimes_bdyu = ntimes_bdy 
    259                     zoffsetu = zoffset 
    260                     istepu(:) = INT( zstepr(:) + zoffset ) 
    261                     numbdyu = inum 
    262                   CASE (3) 
    263                     ntimes_bdyv = ntimes_bdy 
    264                     zoffsetv = zoffset 
    265                     istepv(:) = INT( zstepr(:) + zoffset ) 
    266                     numbdyv = inum 
    267                END SELECT 
    268                ! 
    269             END DO                                         ! end loop over T, U & V grid  
    270  
    271             IF (igrd_start == 1 .and. igrd_end == 3) THEN 
    272                ! Only test differences if we are reading in 3 files 
    273                ! Verify time consistency between files   
    274                IF( ntimes_bdyu /= ntimes_bdyt .OR. ntimes_bdyv /= ntimes_bdyt ) THEN 
    275                   CALL ctl_stop( 'Bdy data files must have the same number of time dumps',   & 
    276                   &           'Multiple time frequencies not implemented yet'  ) 
    277                ENDIF 
    278                ntimes_bdy = ntimes_bdyt 
    279                ! 
    280                IF( zoffsetu /= zoffsett .OR. zoffsetv /= zoffsett ) THEN 
    281                   CALL ctl_stop( 'Bdy data files must have the same time origin',   & 
    282                   &           'Multiple time frequencies not implemented yet' ) 
    283                ENDIF 
    284                zoffset = zoffsett 
    285             ENDIF 
    286  
    287             IF( igrd_start == 1 ) THEN   ;   istep(:) = istept(:) 
    288             ELSE                         ;   istep(:) = istepu(:) 
    289             ENDIF 
    290  
    291             ! Check number of time dumps:               
    292             IF( ntimes_bdy == 1 .AND. .NOT. ln_clim ) THEN 
    293               CALL ctl_stop( 'There is only one time dump in data files',   & 
    294                  &           'Choose ln_clim=.true. in namelist for constant bdy forcing.' ) 
    295             ENDIF 
    296  
    297             IF( ln_clim ) THEN 
    298               IF( ntimes_bdy /= 1 .AND. ntimes_bdy /= 12 ) THEN 
    299                  CALL ctl_stop( 'For climatological boundary forcing (ln_clim=.true.),',   & 
    300                     &           'bdy data files must contain 1 or 12 time dumps.' ) 
    301               ELSEIF( ntimes_bdy ==  1 ) THEN 
    302                 IF(lwp) WRITE(numout,*) 
    303                 IF(lwp) WRITE(numout,*) 'We assume constant boundary forcing from bdy data files' 
    304               ELSEIF( ntimes_bdy == 12 ) THEN 
    305                 IF(lwp) WRITE(numout,*) 
    306                 IF(lwp) WRITE(numout,*) 'We assume monthly (and cyclic) boundary forcing from bdy data files' 
    307               ENDIF 
    308             ENDIF 
    309  
    310             ! Find index of first record to read (before first model time).  
    311             it = 1 
    312             DO WHILE( istep(it+1) <= 0 .AND. it <= ntimes_bdy - 1 ) 
    313                it = it + 1 
    314             END DO 
    315             nbdy_b = it 
    316             ! 
    317             IF(lwp) WRITE(numout,*) 'Time offset is ',zoffset 
    318             IF(lwp) WRITE(numout,*) 'First record to read is ',nbdy_b 
    319  
    320          ENDIF ! endif (nn_dtactl == 1) 
    321  
    322  
    323          ! 1.2  Read first record in file if necessary (ie if nn_dtactl == 1) 
    324          ! ***************************************************************** 
    325  
    326          IF( nn_dtactl == 0 ) THEN      ! boundary data arrays are filled with initial conditions 
    327             ! 
    328             IF (ln_tra_frs) THEN 
    329                igrd = 1            ! T-points data  
    330                DO ib = 1, nblen(igrd) 
    331                   ii = nbi(ib,igrd) 
    332                   ij = nbj(ib,igrd) 
     84      IF(wrk_in_use(2, 22,23) ) THEN 
     85         CALL ctl_stop('bdy_dta: ERROR: requested workspace arrays are unavailable.')   ;   RETURN 
     86      END IF 
     87 
     88      ! Initialise data arrays once for all from initial conditions where required 
     89      !--------------------------------------------------------------------------- 
     90      IF( kt .eq. nit000 .and. .not. PRESENT(jit) ) THEN 
     91 
     92         ! Calculate depth-mean currents 
     93         !----------------------------- 
     94         pu2d => wrk_2d_22 
     95         pu2d => wrk_2d_23 
     96 
     97         pu2d(:,:) = 0.e0 
     98         pv2d(:,:) = 0.e0 
     99 
     100         DO ik = 1, jpkm1   !! Vertically integrated momentum trends 
     101             pu2d(:,:) = pu2d(:,:) + fse3u(:,:,ik) * umask(:,:,ik) * un(:,:,ik) 
     102             pv2d(:,:) = pv2d(:,:) + fse3v(:,:,ik) * vmask(:,:,ik) * vn(:,:,ik) 
     103         END DO 
     104         pu2d(:,:) = pu2d(:,:) * hur(:,:) 
     105         pv2d(:,:) = pv2d(:,:) * hvr(:,:) 
     106          
     107         DO ib_bdy = 1, nb_bdy 
     108 
     109            nblen => idx_bdy(ib_bdy)%nblen 
     110            nblenrim => idx_bdy(ib_bdy)%nblenrim 
     111 
     112            IF( nn_dyn2d(ib_bdy) .gt. 0 .and. nn_dyn2d_dta(ib_bdy) .eq. 0 ) THEN  
     113               IF( nn_dyn2d(ib_bdy) .eq. jp_frs ) THEN 
     114                  ilen1(:) = nblen(:) 
     115               ELSE 
     116                  ilen1(:) = nblenrim(:) 
     117               ENDIF 
     118               igrd = 1 
     119               DO ib = 1, ilen1(igrd) 
     120                  ii = idx_bdy(ib_bdy)%nbi(ib,igrd) 
     121                  ij = idx_bdy(ib_bdy)%nbj(ib,igrd) 
     122                  dta_bdy(ib_bdy)%ssh(ib) = sshn(ii,ij) * tmask(ii,ij,1)          
     123               END DO  
     124               igrd = 2 
     125               DO ib = 1, ilen1(igrd) 
     126                  ii = idx_bdy(ib_bdy)%nbi(ib,igrd) 
     127                  ij = idx_bdy(ib_bdy)%nbj(ib,igrd) 
     128                  dta_bdy(ib_bdy)%u2d(ib) = pu2d(ii,ij) * umask(ii,ij,1)          
     129               END DO  
     130               igrd = 3 
     131               DO ib = 1, ilen1(igrd) 
     132                  ii = idx_bdy(ib_bdy)%nbi(ib,igrd) 
     133                  ij = idx_bdy(ib_bdy)%nbj(ib,igrd) 
     134                  dta_bdy(ib_bdy)%v2d(ib) = pv2d(ii,ij) * vmask(ii,ij,1)          
     135               END DO  
     136            ENDIF 
     137 
     138            IF( nn_dyn3d(ib_bdy) .gt. 0 .and. nn_dyn3d_dta(ib_bdy) .eq. 0 ) THEN  
     139               IF( nn_dyn3d(ib_bdy) .eq. jp_frs ) THEN 
     140                  ilen1(:) = nblen(:) 
     141               ELSE 
     142                  ilen1(:) = nblenrim(:) 
     143               ENDIF 
     144               igrd = 2  
     145               DO ib = 1, ilen1(igrd) 
    333146                  DO ik = 1, jpkm1 
    334                      tbdy(ib,ik) = tsn(ii,ij,ik,jp_tem) 
    335                      sbdy(ib,ik) = tsn(ii,ij,ik,jp_sal) 
     147                     ii = idx_bdy(ib_bdy)%nbi(ib,igrd) 
     148                     ij = idx_bdy(ib_bdy)%nbj(ib,igrd) 
     149                     dta_bdy(ib_bdy)%u3d(ib,ik) =  ( un(ii,ij,ik) - pu2d(ii,ij) ) * umask(ii,ij,ik)          
     150                  END DO 
     151               END DO  
     152               igrd = 3  
     153               DO ib = 1, ilen1(igrd) 
     154                  DO ik = 1, jpkm1 
     155                     ii = idx_bdy(ib_bdy)%nbi(ib,igrd) 
     156                     ij = idx_bdy(ib_bdy)%nbj(ib,igrd) 
     157                     dta_bdy(ib_bdy)%v3d(ib,ik) =  ( vn(ii,ij,ik) - pv2d(ii,ij) ) * vmask(ii,ij,ik)          
     158                     END DO 
     159               END DO  
     160            ENDIF 
     161 
     162            IF( nn_tra(ib_bdy) .gt. 0 .and. nn_tra_dta(ib_bdy) .eq. 0 ) THEN  
     163               IF( nn_tra(ib_bdy) .eq. jp_frs ) THEN 
     164                  ilen1(:) = nblen(:) 
     165               ELSE 
     166                  ilen1(:) = nblenrim(:) 
     167               ENDIF 
     168               igrd = 1                       ! Everything is at T-points here 
     169               DO ib = 1, ilen1(igrd) 
     170                  DO ik = 1, jpkm1 
     171                     ii = idx_bdy(ib_bdy)%nbi(ib,igrd) 
     172                     ij = idx_bdy(ib_bdy)%nbj(ib,igrd) 
     173                     dta_bdy(ib_bdy)%tem(ib,ik) = tsn(ii,ij,ik,jp_tem) * tmask(ii,ij,ik)          
     174                     dta_bdy(ib_bdy)%sal(ib,ik) = tsn(ii,ij,ik,jp_sal) * tmask(ii,ij,ik)          
     175                  END DO 
     176               END DO  
     177            ENDIF 
     178 
     179#if defined key_lim2 
     180            IF( nn_ice_lim2(ib_bdy) .gt. 0 .and. nn_ice_lim2_dta(ib_bdy) .eq. 0 ) THEN  
     181               IF( nn_ice_lim2(ib_bdy) .eq. jp_frs ) THEN 
     182                  ilen1(:) = nblen(:) 
     183               ELSE 
     184                  ilen1(:) = nblenrim(:) 
     185               ENDIF 
     186               igrd = 1                       ! Everything is at T-points here 
     187               DO ib = 1, ilen1(igrd) 
     188                  ii = idx_bdy(ib_bdy)%nbi(ib,igrd) 
     189                  ij = idx_bdy(ib_bdy)%nbj(ib,igrd) 
     190                  dta_bdy(ib_bdy)%frld(ib) = frld(ii,ij) * tmask(ii,ij,1)          
     191                  dta_bdy(ib_bdy)%hicif(ib) = hicif(ii,ij) * tmask(ii,ij,1)          
     192                  dta_bdy(ib_bdy)%hsnif(ib) = hsnif(ii,ij) * tmask(ii,ij,1)          
     193               END DO  
     194            ENDIF 
     195#endif 
     196 
     197         ENDDO ! ib_bdy 
     198 
     199      ENDIF ! kt .eq. nit000 
     200 
     201      ! update external data from files 
     202      !-------------------------------- 
     203      
     204      jstart = 1 
     205      DO ib_bdy = 1, nb_bdy    
     206         IF( nn_dta(ib_bdy) .eq. 1 ) THEN ! skip this bit if no external data required 
     207       
     208            IF( PRESENT(jit) ) THEN 
     209               ! Update barotropic boundary conditions only 
     210               ! jit is optional argument for fld_read and tide_update 
     211               IF( nn_dyn2d(ib_bdy) .gt. 0 ) THEN 
     212                  IF( nn_dyn2d_dta(ib_bdy) .eq. 2 ) THEN ! tidal harmonic forcing ONLY: initialise arrays 
     213                     dta_bdy(ib_bdy)%ssh(:) = 0.0 
     214                     dta_bdy(ib_bdy)%u2d(:) = 0.0 
     215                     dta_bdy(ib_bdy)%v2d(:) = 0.0 
     216                  ENDIF 
     217                  IF( nn_dyn2d_dta(ib_bdy) .eq. 1 .or. nn_dyn2d_dta(ib_bdy) .eq. 3 ) THEN ! update external data 
     218                     jend = jstart + 2 
     219                     CALL fld_read( kt=kt, kn_fsbc=1, sd=bf(jstart:jend), map=nbmap_ptr(jstart:jend), jit=jit, time_offset=time_offset ) 
     220                  ENDIF 
     221                  IF( nn_dyn2d_dta(ib_bdy) .ge. 2 ) THEN ! update tidal harmonic forcing 
     222                     CALL tide_update( kt=kt, idx=idx_bdy(ib_bdy), dta=dta_bdy(ib_bdy), td=tides(ib_bdy), jit=jit, time_offset=time_offset ) 
     223                  ENDIF 
     224               ENDIF 
     225            ELSE 
     226               IF( nn_dyn2d(ib_bdy) .gt. 0 .and. nn_dyn2d_dta(ib_bdy) .eq. 2 ) THEN ! tidal harmonic forcing ONLY: initialise arrays 
     227                  dta_bdy(ib_bdy)%ssh(:) = 0.0 
     228                  dta_bdy(ib_bdy)%u2d(:) = 0.0 
     229                  dta_bdy(ib_bdy)%v2d(:) = 0.0 
     230               ENDIF 
     231               IF( nb_bdy_fld(ib_bdy) .gt. 0 ) THEN ! update external data 
     232                  jend = jstart + nb_bdy_fld(ib_bdy) - 1 
     233                  CALL fld_read( kt=kt, kn_fsbc=1, sd=bf(jstart:jend), map=nbmap_ptr(jstart:jend), time_offset=time_offset ) 
     234               ENDIF 
     235               IF( nn_dyn2d(ib_bdy) .gt. 0 .and. nn_dyn2d_dta(ib_bdy) .ge. 2 ) THEN ! update tidal harmonic forcing 
     236                  CALL tide_update( kt=kt, idx=idx_bdy(ib_bdy), dta=dta_bdy(ib_bdy), td=tides(ib_bdy), time_offset=time_offset ) 
     237               ENDIF 
     238            ENDIF 
     239            jstart = jend+1 
     240 
     241            ! If full velocities in boundary data then split into barotropic and baroclinic data 
     242            ! (Note that we have already made sure that you can't use ln_full_vel = .true. at the same 
     243            ! time as the dynspg_ts option).  
     244 
     245            IF( ln_full_vel_array(ib_bdy) .and.                                             &  
     246           &    ( nn_dyn2d_dta(ib_bdy) .eq. 1 .or. nn_dyn2d_dta(ib_bdy) .eq. 3 .or. nn_dyn3d_dta(ib_bdy) .eq. 1 ) ) THEN  
     247 
     248               igrd = 2                      ! zonal velocity 
     249               dta_bdy(ib_bdy)%u2d(:) = 0.0 
     250               DO ib = 1, idx_bdy(ib_bdy)%nblen(igrd) 
     251                  ii   = idx_bdy(ib_bdy)%nbi(ib,igrd) 
     252                  ij   = idx_bdy(ib_bdy)%nbj(ib,igrd) 
     253                  DO ik = 1, jpkm1 
     254                     dta_bdy(ib_bdy)%u2d(ib) = dta_bdy(ib_bdy)%u2d(ib) & 
     255              &                                + fse3u(ii,ij,ik) * umask(ii,ij,ik) * dta_bdy(ib_bdy)%u3d(ib,ik) 
     256                  END DO 
     257                  dta_bdy(ib_bdy)%u2d(ib) =  dta_bdy(ib_bdy)%u2d(ib) * hur(ii,ij) 
     258                  DO ik = 1, jpkm1 
     259                     dta_bdy(ib_bdy)%u3d(ib,ik) = dta_bdy(ib_bdy)%u3d(ib,ik) - dta_bdy(ib_bdy)%u2d(ib)  
    336260                  END DO 
    337261               END DO 
    338             ENDIF 
    339  
    340             IF(ln_dyn_frs) THEN 
    341                igrd = 2            ! U-points data  
    342                DO ib = 1, nblen(igrd) 
    343                   ii = nbi(ib,igrd) 
    344                   ij = nbj(ib,igrd) 
     262 
     263               igrd = 3                      ! meridional velocity 
     264               dta_bdy(ib_bdy)%v2d(:) = 0.0 
     265               DO ib = 1, idx_bdy(ib_bdy)%nblen(igrd) 
     266                  ii   = idx_bdy(ib_bdy)%nbi(ib,igrd) 
     267                  ij   = idx_bdy(ib_bdy)%nbj(ib,igrd) 
    345268                  DO ik = 1, jpkm1 
    346                      ubdy(ib,ik) = un(ii, ij, ik) 
     269                     dta_bdy(ib_bdy)%v2d(ib) = dta_bdy(ib_bdy)%v2d(ib) & 
     270              &                                + fse3v(ii,ij,ik) * vmask(ii,ij,ik) * dta_bdy(ib_bdy)%v3d(ib,ik) 
     271                  END DO 
     272                  dta_bdy(ib_bdy)%v2d(ib) =  dta_bdy(ib_bdy)%v2d(ib) * hvr(ii,ij) 
     273                  DO ik = 1, jpkm1 
     274                     dta_bdy(ib_bdy)%v3d(ib,ik) = dta_bdy(ib_bdy)%v3d(ib,ik) - dta_bdy(ib_bdy)%v2d(ib)  
    347275                  END DO 
    348276               END DO 
    349                ! 
    350                igrd = 3            ! V-points data  
    351                DO ib = 1, nblen(igrd)             
    352                   ii = nbi(ib,igrd) 
    353                   ij = nbj(ib,igrd) 
    354                   DO ik = 1, jpkm1 
    355                      vbdy(ib,ik) = vn(ii, ij, ik) 
    356                   END DO 
    357                END DO 
    358             ENDIF 
    359             ! 
    360 #if defined key_lim2 
    361             IF( ln_ice_frs ) THEN 
    362                igrd = 1            ! T-points data 
    363                DO ib = 1, nblen(igrd) 
    364                   frld_bdy (ib) =  frld(nbi(ib,igrd), nbj(ib,igrd)) 
    365                   hicif_bdy(ib) = hicif(nbi(ib,igrd), nbj(ib,igrd)) 
    366                   hsnif_bdy(ib) = hsnif(nbi(ib,igrd), nbj(ib,igrd)) 
    367                END DO 
    368             ENDIF 
    369 #endif 
    370          ELSEIF( nn_dtactl == 1 ) THEN    ! Set first record in the climatological case:    
    371             ! 
    372             IF( ln_clim .AND. ntimes_bdy == 1 ) THEN 
    373                nbdy_a = 1 
    374             ELSEIF( ln_clim .AND. ntimes_bdy == iman ) THEN 
    375                nbdy_b = 0 
    376                nbdy_a = imois 
     277     
     278            ENDIF 
     279 
     280         END IF ! nn_dta(ib_bdy) = 1 
     281      END DO  ! ib_bdy 
     282 
     283      IF(wrk_not_released(2, 22,23) )    CALL ctl_stop('bdy_dta: ERROR: failed to release workspace arrays.') 
     284 
     285      END SUBROUTINE bdy_dta 
     286 
     287 
     288      SUBROUTINE bdy_dta_init 
     289      !!---------------------------------------------------------------------- 
     290      !!                   ***  SUBROUTINE bdy_dta_init  *** 
     291      !!                     
     292      !! ** Purpose :   Initialise arrays for reading of external data  
     293      !!                for open boundary conditions 
     294      !! 
     295      !! ** Method  :   Use fldread.F90 
     296      !!                 
     297      !!---------------------------------------------------------------------- 
     298      USE dynspg_oce, ONLY: lk_dynspg_ts 
     299      !! 
     300      INTEGER     ::  ib_bdy, jfld, jstart, jend, ierror  ! local indices 
     301      !! 
     302      CHARACTER(len=100)                     ::   cn_dir        ! Root directory for location of data files 
     303      CHARACTER(len=100), DIMENSION(nb_bdy)  ::   cn_dir_array  ! Root directory for location of data files 
     304      LOGICAL                                ::   ln_full_vel   ! =T => full velocities in 3D boundary data 
     305                                                                ! =F => baroclinic velocities in 3D boundary data 
     306      INTEGER                                ::   ilen_global   ! Max length required for global bdy dta arrays 
     307      INTEGER,              DIMENSION(jpbgrd) ::  ilen0         ! size of local arrays 
     308      INTEGER, ALLOCATABLE, DIMENSION(:)     ::   ilen1, ilen3  ! size of 1st and 3rd dimensions of local arrays 
     309      INTEGER, ALLOCATABLE, DIMENSION(:)     ::   ibdy           ! bdy set for a particular jfld 
     310      INTEGER, ALLOCATABLE, DIMENSION(:)     ::   igrid         ! index for grid type (1,2,3 = T,U,V) 
     311      INTEGER, POINTER, DIMENSION(:)         ::   nblen, nblenrim  ! short cuts 
     312      TYPE(FLD_N), ALLOCATABLE, DIMENSION(:) ::   blf_i         !  array of namelist information structures 
     313      TYPE(FLD_N) ::   bn_tem, bn_sal, bn_u3d, bn_v3d   !  
     314      TYPE(FLD_N) ::   bn_ssh, bn_u2d, bn_v2d           ! informations about the fields to be read 
     315#if defined key_lim2 
     316      TYPE(FLD_N) ::   bn_frld, bn_hicif, bn_hsnif      ! 
     317#endif 
     318      NAMELIST/nambdy_dta/ cn_dir, bn_tem, bn_sal, bn_u3d, bn_v3d, bn_ssh, bn_u2d, bn_v2d  
     319#if defined key_lim2 
     320      NAMELIST/nambdy_dta/ bn_frld, bn_hicif, bn_hsnif 
     321#endif 
     322      NAMELIST/nambdy_dta/ ln_full_vel 
     323      !!--------------------------------------------------------------------------- 
     324 
     325      ! Set nn_dta 
     326      DO ib_bdy = 1, nb_bdy 
     327         nn_dta(ib_bdy) = MAX(  nn_dyn2d_dta(ib_bdy)       & 
     328                               ,nn_dyn3d_dta(ib_bdy)       & 
     329                               ,nn_tra_dta(ib_bdy)         & 
     330#if defined key_ice_lim2 
     331                               ,nn_ice_lim2_dta(ib_bdy)    & 
     332#endif 
     333                              ) 
     334         IF(nn_dta(ib_bdy) .gt. 1) nn_dta(ib_bdy) = 1 
     335      END DO 
     336 
     337      ! Work out upper bound of how many fields there are to read in and allocate arrays 
     338      ! --------------------------------------------------------------------------- 
     339      ALLOCATE( nb_bdy_fld(nb_bdy) ) 
     340      nb_bdy_fld(:) = 0 
     341      DO ib_bdy = 1, nb_bdy          
     342         IF( nn_dyn2d(ib_bdy) .gt. 0 .and. ( nn_dyn2d_dta(ib_bdy) .eq. 1 .or. nn_dyn2d_dta(ib_bdy) .eq. 3 ) ) THEN 
     343            nb_bdy_fld(ib_bdy) = nb_bdy_fld(ib_bdy) + 3 
     344         ENDIF 
     345         IF( nn_dyn3d(ib_bdy) .gt. 0 .and. nn_dyn3d_dta(ib_bdy) .eq. 1 ) THEN 
     346            nb_bdy_fld(ib_bdy) = nb_bdy_fld(ib_bdy) + 2 
     347         ENDIF 
     348         IF( nn_tra(ib_bdy) .gt. 0 .and. nn_tra_dta(ib_bdy) .eq. 1  ) THEN 
     349            nb_bdy_fld(ib_bdy) = nb_bdy_fld(ib_bdy) + 2 
     350         ENDIF 
     351#if defined key_lim2 
     352         IF( nn_ice_lim2(ib_bdy) .gt. 0 .and. nn_ice_lim2_dta(ib_bdy) .eq. 1  ) THEN 
     353            nb_bdy_fld(ib_bdy) = nb_bdy_fld(ib_bdy) + 3 
     354         ENDIF 
     355#endif                
     356      ENDDO             
     357 
     358      nb_bdy_fld_sum = SUM( nb_bdy_fld ) 
     359 
     360      ALLOCATE( bf(nb_bdy_fld_sum), STAT=ierror ) 
     361      IF( ierror > 0 ) THEN    
     362         CALL ctl_stop( 'bdy_dta: unable to allocate bf structure' )   ;   RETURN   
     363      ENDIF 
     364      ALLOCATE( blf_i(nb_bdy_fld_sum), STAT=ierror ) 
     365      IF( ierror > 0 ) THEN    
     366         CALL ctl_stop( 'bdy_dta: unable to allocate blf_i structure' )   ;   RETURN   
     367      ENDIF 
     368      ALLOCATE( nbmap_ptr(nb_bdy_fld_sum), STAT=ierror ) 
     369      IF( ierror > 0 ) THEN    
     370         CALL ctl_stop( 'bdy_dta: unable to allocate nbmap_ptr structure' )   ;   RETURN   
     371      ENDIF 
     372      ALLOCATE( ilen1(nb_bdy_fld_sum), ilen3(nb_bdy_fld_sum) )  
     373      ALLOCATE( ibdy(nb_bdy_fld_sum) )  
     374      ALLOCATE( igrid(nb_bdy_fld_sum) )  
     375 
     376      ! Read namelists 
     377      ! -------------- 
     378      REWIND(numnam) 
     379      jfld = 0  
     380      DO ib_bdy = 1, nb_bdy          
     381         IF( nn_dta(ib_bdy) .eq. 1 ) THEN 
     382            ! set file information 
     383            cn_dir = './'        ! directory in which the model is executed 
     384            ln_full_vel = .false. 
     385            ! ... default values (NB: frequency positive => hours, negative => months) 
     386            !                    !  file       ! frequency !  variable        ! time intep !  clim   ! 'yearly' or ! weights  ! rotation  ! 
     387            !                    !  name       !  (hours)  !   name           !   (T/F)    !  (T/F)  !  'monthly'  ! filename ! pairs     ! 
     388            bn_ssh     = FLD_N(  'bdy_ssh'     ,    24     ,  'sossheig'    ,  .false.   , .false. ,   'yearly'  , ''       , ''        ) 
     389            bn_u2d     = FLD_N(  'bdy_vel2d_u' ,    24     ,  'vobtcrtx'    ,  .false.   , .false. ,   'yearly'  , ''       , ''        ) 
     390            bn_v2d     = FLD_N(  'bdy_vel2d_v' ,    24     ,  'vobtcrty'    ,  .false.   , .false. ,   'yearly'  , ''       , ''        ) 
     391            bn_u3d     = FLD_N(  'bdy_vel3d_u' ,    24     ,  'vozocrtx'    ,  .false.   , .false. ,   'yearly'  , ''       , ''        ) 
     392            bn_v3d     = FLD_N(  'bdy_vel3d_v' ,    24     ,  'vomecrty'    ,  .false.   , .false. ,   'yearly'  , ''       , ''        ) 
     393            bn_tem     = FLD_N(  'bdy_tem'     ,    24     ,  'votemper'    ,  .false.   , .false. ,   'yearly'  , ''       , ''        ) 
     394            bn_sal     = FLD_N(  'bdy_sal'     ,    24     ,  'vosaline'    ,  .false.   , .false. ,   'yearly'  , ''       , ''        ) 
     395#if defined key_lim2 
     396            bn_frld    = FLD_N(  'bdy_frld'    ,    24     ,  'ildsconc'    ,  .false.   , .false. ,   'yearly'  , ''       , ''        ) 
     397            bn_hicif   = FLD_N(  'bdy_hicif'   ,    24     ,  'iicethic'    ,  .false.   , .false. ,   'yearly'  , ''       , ''        ) 
     398            bn_hsnif   = FLD_N(  'bdy_hsnif'   ,    24     ,  'isnothic'    ,  .false.   , .false. ,   'yearly'  , ''       , ''        ) 
     399#endif 
     400 
     401            ! Important NOT to rewind here. 
     402            READ( numnam, nambdy_dta ) 
     403 
     404            cn_dir_array(ib_bdy) = cn_dir 
     405            ln_full_vel_array(ib_bdy) = ln_full_vel 
     406 
     407            IF( ln_full_vel_array(ib_bdy) .and. lk_dynspg_ts )  THEN 
     408               CALL ctl_stop( 'bdy_dta_init: ERROR, cannot specify full velocities in boundary data',& 
     409            &                  'with dynspg_ts option' )   ;   RETURN   
     410            ENDIF              
     411 
     412            nblen => idx_bdy(ib_bdy)%nblen 
     413            nblenrim => idx_bdy(ib_bdy)%nblenrim 
     414 
     415            ! Only read in necessary fields for this set. 
     416            ! Important that barotropic variables come first. 
     417            IF( nn_dyn2d(ib_bdy) .gt. 0 .and. ( nn_dyn2d_dta(ib_bdy) .eq. 1 .or. nn_dyn2d_dta(ib_bdy) .eq. 3 ) ) THEN  
     418 
     419               IF( nn_dyn2d(ib_bdy) .ne. jp_frs ) THEN 
     420                  jfld = jfld + 1 
     421                  blf_i(jfld) = bn_ssh 
     422                  ibdy(jfld) = ib_bdy 
     423                  igrid(jfld) = 1 
     424                  ilen1(jfld) = nblenrim(igrid(jfld)) 
     425                  ilen3(jfld) = 1 
     426               ENDIF 
     427 
     428               IF( .not. ln_full_vel_array(ib_bdy) ) THEN 
     429 
     430                  jfld = jfld + 1 
     431                  blf_i(jfld) = bn_u2d 
     432                  ibdy(jfld) = ib_bdy 
     433                  igrid(jfld) = 2 
     434                  IF( nn_dyn2d(ib_bdy) .eq. jp_frs ) THEN 
     435                     ilen1(jfld) = nblen(igrid(jfld)) 
     436                  ELSE 
     437                     ilen1(jfld) = nblenrim(igrid(jfld)) 
     438                  ENDIF 
     439                  ilen3(jfld) = 1 
     440 
     441                  jfld = jfld + 1 
     442                  blf_i(jfld) = bn_v2d 
     443                  ibdy(jfld) = ib_bdy 
     444                  igrid(jfld) = 3 
     445                  IF( nn_dyn2d(ib_bdy) .eq. jp_frs ) THEN 
     446                     ilen1(jfld) = nblen(igrid(jfld)) 
     447                  ELSE 
     448                     ilen1(jfld) = nblenrim(igrid(jfld)) 
     449                  ENDIF 
     450                  ilen3(jfld) = 1 
     451 
     452               ENDIF 
     453 
     454            ENDIF 
     455 
     456            ! baroclinic velocities 
     457            IF( ( nn_dyn3d(ib_bdy) .gt. 0 .and. nn_dyn3d_dta(ib_bdy) .eq. 1 ) .or. & 
     458           &      ( ln_full_vel_array(ib_bdy) .and. nn_dyn2d(ib_bdy) .gt. 0 .and.  & 
     459           &        ( nn_dyn2d_dta(ib_bdy) .eq. 1 .or. nn_dyn2d_dta(ib_bdy) .eq. 3 ) ) ) THEN 
     460 
     461               jfld = jfld + 1 
     462               blf_i(jfld) = bn_u3d 
     463               ibdy(jfld) = ib_bdy 
     464               igrid(jfld) = 2 
     465               IF( nn_dyn3d(ib_bdy) .eq. jp_frs ) THEN 
     466                  ilen1(jfld) = nblen(igrid(jfld)) 
     467               ELSE 
     468                  ilen1(jfld) = nblenrim(igrid(jfld)) 
     469               ENDIF 
     470               ilen3(jfld) = jpk 
     471 
     472               jfld = jfld + 1 
     473               blf_i(jfld) = bn_v3d 
     474               ibdy(jfld) = ib_bdy 
     475               igrid(jfld) = 3 
     476               IF( nn_dyn3d(ib_bdy) .eq. jp_frs ) THEN 
     477                  ilen1(jfld) = nblen(igrid(jfld)) 
     478               ELSE 
     479                  ilen1(jfld) = nblenrim(igrid(jfld)) 
     480               ENDIF 
     481               ilen3(jfld) = jpk 
     482 
     483            ENDIF 
     484 
     485            ! temperature and salinity 
     486            IF( nn_tra(ib_bdy) .gt. 0 .and. nn_tra_dta(ib_bdy) .eq. 1 ) THEN 
     487 
     488               jfld = jfld + 1 
     489               blf_i(jfld) = bn_tem 
     490               ibdy(jfld) = ib_bdy 
     491               igrid(jfld) = 1 
     492               IF( nn_tra(ib_bdy) .eq. jp_frs ) THEN 
     493                  ilen1(jfld) = nblen(igrid(jfld)) 
     494               ELSE 
     495                  ilen1(jfld) = nblenrim(igrid(jfld)) 
     496               ENDIF 
     497               ilen3(jfld) = jpk 
     498 
     499               jfld = jfld + 1 
     500               blf_i(jfld) = bn_sal 
     501               ibdy(jfld) = ib_bdy 
     502               igrid(jfld) = 1 
     503               IF( nn_tra(ib_bdy) .eq. jp_frs ) THEN 
     504                  ilen1(jfld) = nblen(igrid(jfld)) 
     505               ELSE 
     506                  ilen1(jfld) = nblenrim(igrid(jfld)) 
     507               ENDIF 
     508               ilen3(jfld) = jpk 
     509 
     510            ENDIF 
     511 
     512#if defined key_lim2 
     513            ! sea ice 
     514            IF( nn_ice_lim2(ib_bdy) .gt. 0 .and. nn_ice_lim2_dta(ib_bdy) .eq. 1 ) THEN 
     515 
     516               jfld = jfld + 1 
     517               blf_i(jfld) = bn_frld 
     518               ibdy(jfld) = ib_bdy 
     519               igrid(jfld) = 1 
     520               IF( nn_ice_lim2(ib_bdy) .eq. jp_frs ) THEN 
     521                  ilen1(jfld) = nblen(igrid(jfld)) 
     522               ELSE 
     523                  ilen1(jfld) = nblenrim(igrid(jfld)) 
     524               ENDIF 
     525               ilen3(jfld) = 1 
     526 
     527               jfld = jfld + 1 
     528               blf_i(jfld) = bn_hicif 
     529               ibdy(jfld) = ib_bdy 
     530               igrid(jfld) = 1 
     531               IF( nn_ice_lim2(ib_bdy) .eq. jp_frs ) THEN 
     532                  ilen1(jfld) = nblen(igrid(jfld)) 
     533               ELSE 
     534                  ilen1(jfld) = nblenrim(igrid(jfld)) 
     535               ENDIF 
     536               ilen3(jfld) = 1 
     537 
     538               jfld = jfld + 1 
     539               blf_i(jfld) = bn_hsnif 
     540               ibdy(jfld) = ib_bdy 
     541               igrid(jfld) = 1 
     542               IF( nn_ice_lim2(ib_bdy) .eq. jp_frs ) THEN 
     543                  ilen1(jfld) = nblen(igrid(jfld)) 
     544               ELSE 
     545                  ilen1(jfld) = nblenrim(igrid(jfld)) 
     546               ENDIF 
     547               ilen3(jfld) = 1 
     548 
     549            ENDIF 
     550#endif 
     551            ! Recalculate field counts 
     552            !------------------------- 
     553            nb_bdy_fld_sum = 0 
     554            IF( ib_bdy .eq. 1 ) THEN  
     555               nb_bdy_fld(ib_bdy) = jfld 
     556               nb_bdy_fld_sum     = jfld               
    377557            ELSE 
    378                nbdy_a = nbdy_b 
    379             ENDIF 
    380     
    381             ! Read first record: 
    382             ipj  = 1 
    383             ipk  = jpk 
    384             igrd = 1 
    385             ipi  = nblendta(igrd) 
    386  
    387             IF(ln_tra_frs) THEN 
    388                ! 
    389                igrd = 1                                           ! Temperature 
    390                IF( nblendta(igrd) <=  0 ) THEN  
    391                   idvar = iom_varid( numbdyt, 'votemper' ) 
    392                   nblendta(igrd) = iom_file(numbdyt)%dimsz(1,idvar) 
    393                ENDIF 
    394                IF(lwp) WRITE(numout,*) 'Dim size for votemper is ', nblendta(igrd) 
    395                ipi = nblendta(igrd) 
    396                CALL iom_get ( numbdyt, jpdom_unknown, 'votemper', zdta(1:ipi,1:ipj,1:ipk), nbdy_a ) 
    397                ! 
    398                DO ib = 1, nblen(igrd) 
    399                   DO ik = 1, jpkm1 
    400                      tbdydta(ib,ik,2) =  zdta(nbmap(ib,igrd),1,ik) 
    401                   END DO 
    402                END DO 
    403                ! 
    404                igrd = 1                                           ! salinity 
    405                IF( nblendta(igrd) .le. 0 ) THEN  
    406                   idvar = iom_varid( numbdyt, 'vosaline' ) 
    407                   nblendta(igrd) = iom_file(numbdyt)%dimsz(1,idvar) 
    408                ENDIF 
    409                IF(lwp) WRITE(numout,*) 'Dim size for vosaline is ', nblendta(igrd) 
    410                ipi = nblendta(igrd) 
    411                CALL iom_get ( numbdyt, jpdom_unknown, 'vosaline', zdta(1:ipi,1:ipj,1:ipk), nbdy_a ) 
    412                ! 
    413                DO ib = 1, nblen(igrd) 
    414                   DO ik = 1, jpkm1 
    415                      sbdydta(ib,ik,2) =  zdta(nbmap(ib,igrd),1,ik) 
    416                   END DO 
    417                END DO 
    418             ENDIF  ! ln_tra_frs 
    419   
    420             IF( ln_dyn_frs ) THEN 
    421                ! 
    422                igrd = 2                                           ! u-velocity 
    423                IF ( nblendta(igrd) .le. 0 ) THEN  
    424                  idvar = iom_varid( numbdyu,'vozocrtx' ) 
    425                  nblendta(igrd) = iom_file(numbdyu)%dimsz(1,idvar) 
    426                ENDIF 
    427                IF(lwp) WRITE(numout,*) 'Dim size for vozocrtx is ', nblendta(igrd) 
    428                ipi = nblendta(igrd) 
    429                CALL iom_get ( numbdyu, jpdom_unknown,'vozocrtx',zdta(1:ipi,1:ipj,1:ipk),nbdy_a ) 
    430                DO ib = 1, nblen(igrd) 
    431                   DO ik = 1, jpkm1 
    432                      ubdydta(ib,ik,2) =  zdta(nbmap(ib,igrd),1,ik) 
    433                   END DO 
    434                END DO 
    435                ! 
    436                igrd = 3                                           ! v-velocity 
    437                IF ( nblendta(igrd) .le. 0 ) THEN  
    438                  idvar = iom_varid( numbdyv,'vomecrty' ) 
    439                  nblendta(igrd) = iom_file(numbdyv)%dimsz(1,idvar) 
    440                ENDIF 
    441                IF(lwp) WRITE(numout,*) 'Dim size for vomecrty is ', nblendta(igrd) 
    442                ipi = nblendta(igrd) 
    443                CALL iom_get ( numbdyv, jpdom_unknown,'vomecrty',zdta(1:ipi,1:ipj,1:ipk),nbdy_a ) 
    444                DO ib = 1, nblen(igrd) 
    445                   DO ik = 1, jpkm1 
    446                      vbdydta(ib,ik,2) =  zdta(nbmap(ib,igrd),1,ik) 
    447                   END DO 
    448                END DO 
    449             ENDIF ! ln_dyn_frs 
    450  
    451 #if defined key_lim2 
    452             IF( ln_ice_frs ) THEN 
    453               ! 
    454               igrd=1                                              ! leads fraction 
    455               IF(lwp) WRITE(numout,*) 'Dim size for ildsconc is ',nblendta(igrd) 
    456               ipi=nblendta(igrd) 
    457               CALL iom_get ( numbdyt, jpdom_unknown,'ildsconc',zdta(1:ipi,:,1),nbdy_a ) 
    458               DO ib=1, nblen(igrd) 
    459                 frld_bdydta(ib,2) =  zdta(nbmap(ib,igrd),1,1) 
    460               END DO 
    461               ! 
    462               igrd=1                                              ! ice thickness 
    463               IF(lwp) WRITE(numout,*) 'Dim size for iicethic is ',nblendta(igrd) 
    464               ipi=nblendta(igrd) 
    465               CALL iom_get ( numbdyt, jpdom_unknown,'iicethic',zdta(1:ipi,:,1),nbdy_a ) 
    466               DO ib=1, nblen(igrd) 
    467                 hicif_bdydta(ib,2) =  zdta(nbmap(ib,igrd),1,1) 
    468               END DO 
    469               ! 
    470               igrd=1                                              ! snow thickness 
    471               IF(lwp) WRITE(numout,*) 'Dim size for isnowthi is ',nblendta(igrd) 
    472               ipi=nblendta(igrd) 
    473               CALL iom_get ( numbdyt, jpdom_unknown,'isnowthi',zdta(1:ipi,:,1),nbdy_a ) 
    474               DO ib=1, nblen(igrd) 
    475                 hsnif_bdydta(ib,2) =  zdta(nbmap(ib,igrd),1,1) 
    476               END DO 
    477             ENDIF ! just if ln_ice_frs is set 
    478 #endif 
    479  
    480             IF( .NOT.ln_clim .AND. istep(1) > 0 ) THEN     ! First data time is after start of run 
    481                nbdy_b = nbdy_a                                 ! Put first value in both time levels 
    482                IF( ln_tra_frs ) THEN 
    483                  tbdydta(:,:,1) = tbdydta(:,:,2) 
    484                  sbdydta(:,:,1) = sbdydta(:,:,2) 
    485                ENDIF 
    486                IF( ln_dyn_frs ) THEN 
    487                  ubdydta(:,:,1) = ubdydta(:,:,2) 
    488                  vbdydta(:,:,1) = vbdydta(:,:,2) 
    489                ENDIF 
    490 #if defined key_lim2 
    491                IF( ln_ice_frs ) THEN 
    492                   frld_bdydta (:,1) =  frld_bdydta(:,2) 
    493                   hicif_bdydta(:,1) = hicif_bdydta(:,2) 
    494                   hsnif_bdydta(:,1) = hsnif_bdydta(:,2) 
    495                ENDIF 
    496 #endif 
    497             END IF 
    498             ! 
    499          END IF   ! nn_dtactl == 0/1 
    500   
    501          ! In the case of constant boundary forcing fill bdy arrays once for all 
    502          IF( ln_clim .AND. ntimes_bdy == 1 ) THEN 
    503             IF( ln_tra_frs ) THEN 
    504                tbdy  (:,:) = tbdydta  (:,:,2) 
    505                sbdy  (:,:) = sbdydta  (:,:,2) 
    506             ENDIF 
    507             IF( ln_dyn_frs) THEN 
    508                ubdy  (:,:) = ubdydta  (:,:,2) 
    509                vbdy  (:,:) = vbdydta  (:,:,2) 
    510             ENDIF 
    511 #if defined key_lim2 
    512             IF( ln_ice_frs ) THEN 
    513                frld_bdy (:) = frld_bdydta (:,2) 
    514                hicif_bdy(:) = hicif_bdydta(:,2) 
    515                hsnif_bdy(:) = hsnif_bdydta(:,2) 
    516             ENDIF 
    517 #endif 
    518  
    519             IF( ln_tra_frs .OR. ln_ice_frs) CALL iom_close( numbdyt ) 
    520             IF( ln_dyn_frs                    ) CALL iom_close( numbdyu ) 
    521             IF( ln_dyn_frs                    ) CALL iom_close( numbdyv ) 
    522          END IF 
    523          ! 
    524       ENDIF                                            ! End if nit000 
    525  
    526  
    527       !                                                !---------------------! 
    528       IF( nn_dtactl == 1 .AND. ntimes_bdy > 1 ) THEN    !  at each time step  ! 
    529          !                                             !---------------------! 
    530          ! Read one more record if necessary 
    531          !********************************** 
    532  
    533          IF( ln_clim .AND. imois /= nbdy_b ) THEN      ! remember that nbdy_b=0 for kt=nit000 
    534             nbdy_b = imois 
    535             nbdy_a = imois + 1 
    536             nbdy_b = MOD( nbdy_b, iman )   ;   IF( nbdy_b == 0 ) nbdy_b = iman 
    537             nbdy_a = MOD( nbdy_a, iman )   ;   IF( nbdy_a == 0 ) nbdy_a = iman 
    538             lect=.true. 
    539          ELSEIF( .NOT.ln_clim .AND. itimer >= istep(nbdy_a) ) THEN 
    540  
    541             IF( nbdy_a < ntimes_bdy ) THEN 
    542                nbdy_b = nbdy_a 
    543                nbdy_a = nbdy_a + 1 
    544                lect  =.true. 
     558               nb_bdy_fld(ib_bdy) = jfld - nb_bdy_fld_sum 
     559               nb_bdy_fld_sum = nb_bdy_fld_sum + nb_bdy_fld(ib_bdy) 
     560            ENDIF 
     561 
     562         ENDIF ! nn_dta .eq. 1 
     563      ENDDO ! ib_bdy 
     564 
     565 
     566      DO jfld = 1, nb_bdy_fld_sum 
     567         ALLOCATE( bf(jfld)%fnow(ilen1(jfld),1,ilen3(jfld)) ) 
     568         IF( blf_i(jfld)%ln_tint ) ALLOCATE( bf(jfld)%fdta(ilen1(jfld),1,ilen3(jfld),2) ) 
     569         nbmap_ptr(jfld)%ptr => idx_bdy(ibdy(jfld))%nbmap(:,igrid(jfld)) 
     570      ENDDO 
     571 
     572      ! fill bf with blf_i and control print 
     573      !------------------------------------- 
     574      jstart = 1 
     575      DO ib_bdy = 1, nb_bdy 
     576         jend = jstart + nb_bdy_fld(ib_bdy) - 1 
     577         CALL fld_fill( bf(jstart:jend), blf_i(jstart:jend), cn_dir_array(ib_bdy), 'bdy_dta', 'open boundary conditions', 'nambdy_dta' ) 
     578         jstart = jend + 1 
     579      ENDDO 
     580 
     581      ! Initialise local boundary data arrays 
     582      ! nn_xxx_dta=0 : allocate space - will be filled from initial conditions later 
     583      ! nn_xxx_dta=1 : point to "fnow" arrays 
     584      !------------------------------------- 
     585 
     586      jfld = 0 
     587      DO ib_bdy=1, nb_bdy 
     588 
     589         nblen => idx_bdy(ib_bdy)%nblen 
     590         nblenrim => idx_bdy(ib_bdy)%nblenrim 
     591 
     592         IF (nn_dyn2d(ib_bdy) .gt. 0) THEN 
     593            IF( nn_dyn2d_dta(ib_bdy) .eq. 0 .or. nn_dyn2d_dta(ib_bdy) .eq. 2 .or. ln_full_vel_array(ib_bdy) ) THEN 
     594               IF( nn_dyn2d(ib_bdy) .eq. jp_frs ) THEN 
     595                  ilen0(1:3) = nblen(1:3) 
     596               ELSE 
     597                  ilen0(1:3) = nblenrim(1:3) 
     598               ENDIF 
     599               ALLOCATE( dta_bdy(ib_bdy)%ssh(ilen0(1)) ) 
     600               ALLOCATE( dta_bdy(ib_bdy)%u2d(ilen0(2)) ) 
     601               ALLOCATE( dta_bdy(ib_bdy)%v2d(ilen0(3)) ) 
    545602            ELSE 
    546                ! We have reached the end of the file 
    547                ! put the last data time into both time levels 
    548                nbdy_b = nbdy_a 
    549                IF(ln_tra_frs) THEN 
    550                   tbdydta(:,:,1) =  tbdydta(:,:,2) 
    551                   sbdydta(:,:,1) =  sbdydta(:,:,2) 
    552                ENDIF 
    553                IF(ln_dyn_frs) THEN 
    554                   ubdydta(:,:,1) =  ubdydta(:,:,2) 
    555                   vbdydta(:,:,1) =  vbdydta(:,:,2) 
    556                ENDIF 
    557 #if defined key_lim2 
    558                IF(ln_ice_frs) THEN 
    559                   frld_bdydta (:,1) =  frld_bdydta (:,2) 
    560                   hicif_bdydta(:,1) =  hicif_bdydta(:,2) 
    561                   hsnif_bdydta(:,1) =  hsnif_bdydta(:,2) 
    562                ENDIF 
    563 #endif 
    564             END IF ! nbdy_a < ntimes_bdy 
    565             ! 
    566         END IF 
    567           
    568         IF( lect ) THEN           ! Swap arrays 
    569            IF( ln_tra_frs ) THEN 
    570              tbdydta(:,:,1) =  tbdydta(:,:,2) 
    571              sbdydta(:,:,1) =  sbdydta(:,:,2) 
    572            ENDIF 
    573            IF( ln_dyn_frs ) THEN 
    574              ubdydta(:,:,1) =  ubdydta(:,:,2) 
    575              vbdydta(:,:,1) =  vbdydta(:,:,2) 
    576            ENDIF 
    577 #if defined key_lim2 
    578            IF( ln_ice_frs ) THEN 
    579              frld_bdydta (:,1) =  frld_bdydta (:,2) 
    580              hicif_bdydta(:,1) =  hicif_bdydta(:,2) 
    581              hsnif_bdydta(:,1) =  hsnif_bdydta(:,2) 
    582            ENDIF 
    583 #endif  
    584            ! read another set 
    585            ipj  = 1 
    586            ipk  = jpk 
    587  
    588            IF( ln_tra_frs ) THEN 
    589               !  
    590               igrd = 1                                   ! temperature 
    591               ipi  = nblendta(igrd) 
    592               CALL iom_get ( numbdyt, jpdom_unknown, 'votemper', zdta(1:ipi,1:ipj,1:ipk), nbdy_a ) 
    593               DO ib = 1, nblen(igrd) 
    594                  DO ik = 1, jpkm1 
    595                     tbdydta(ib,ik,2) = zdta(nbmap(ib,igrd),1,ik) 
    596                  END DO 
    597               END DO 
    598               ! 
    599               igrd = 1                                   ! salinity 
    600               ipi  = nblendta(igrd) 
    601               CALL iom_get ( numbdyt, jpdom_unknown, 'vosaline', zdta(1:ipi,1:ipj,1:ipk), nbdy_a ) 
    602               DO ib = 1, nblen(igrd) 
    603                  DO ik = 1, jpkm1 
    604                     sbdydta(ib,ik,2) = zdta(nbmap(ib,igrd),1,ik) 
    605                  END DO 
    606               END DO 
    607            ENDIF ! ln_tra_frs 
    608  
    609            IF(ln_dyn_frs) THEN 
    610               ! 
    611               igrd = 2                                   ! u-velocity 
    612               ipi  = nblendta(igrd) 
    613               CALL iom_get ( numbdyu, jpdom_unknown,'vozocrtx',zdta(1:ipi,1:ipj,1:ipk),nbdy_a ) 
    614               DO ib = 1, nblen(igrd) 
    615                 DO ik = 1, jpkm1 
    616                   ubdydta(ib,ik,2) =  zdta(nbmap(ib,igrd),1,ik) 
    617                 END DO 
    618               END DO 
    619               ! 
    620               igrd = 3                                   ! v-velocity 
    621               ipi  = nblendta(igrd) 
    622               CALL iom_get ( numbdyv, jpdom_unknown,'vomecrty',zdta(1:ipi,1:ipj,1:ipk),nbdy_a ) 
    623               DO ib = 1, nblen(igrd) 
    624                  DO ik = 1, jpkm1 
    625                     vbdydta(ib,ik,2) =  zdta(nbmap(ib,igrd),1,ik) 
    626                  END DO 
    627               END DO 
    628            ENDIF ! ln_dyn_frs 
    629            ! 
    630 #if defined key_lim2 
    631            IF(ln_ice_frs) THEN 
    632              ! 
    633              igrd = 1                                    ! ice concentration 
    634              ipi=nblendta(igrd) 
    635              CALL iom_get ( numbdyt, jpdom_unknown,'ildsconc',zdta(1:ipi,:,1),nbdy_a ) 
    636              DO ib=1, nblen(igrd) 
    637                frld_bdydta(ib,2) =  zdta( nbmap(ib,igrd), 1, 1 ) 
    638              END DO 
    639              ! 
    640              igrd=1                                      ! ice thickness 
    641              ipi=nblendta(igrd) 
    642              CALL iom_get ( numbdyt, jpdom_unknown,'iicethic',zdta(1:ipi,:,1),nbdy_a ) 
    643              DO ib=1, nblen(igrd) 
    644                hicif_bdydta(ib,2) =  zdta( nbmap(ib,igrd), 1, 1 ) 
    645              END DO 
    646              ! 
    647              igrd=1                                      ! snow thickness 
    648              ipi=nblendta(igrd) 
    649              CALL iom_get ( numbdyt, jpdom_unknown,'isnowthi',zdta(1:ipi,:,1),nbdy_a ) 
    650              DO ib=1, nblen(igrd) 
    651                hsnif_bdydta(ib,2) =  zdta( nbmap(ib,igrd), 1, 1 ) 
    652              END DO 
    653            ENDIF ! ln_ice_frs 
    654 #endif 
    655            ! 
    656            IF(lwp) WRITE(numout,*) 'bdy_dta_frs : first record file used nbdy_b ',nbdy_b 
    657            IF(lwp) WRITE(numout,*) '~~~~~~~~  last  record file used nbdy_a ',nbdy_a 
    658            IF (.NOT.ln_clim) THEN 
    659               IF(lwp) WRITE(numout,*) 'first  record time (s): ', istep(nbdy_b) 
    660               IF(lwp) WRITE(numout,*) 'model time (s)        : ', itimer 
    661               IF(lwp) WRITE(numout,*) 'second record time (s): ', istep(nbdy_a) 
    662            ENDIF 
    663            ! 
    664        ENDIF ! end lect=.true. 
    665  
    666  
    667        ! Interpolate linearly 
    668        ! ******************** 
    669        !  
    670        IF( ln_clim ) THEN   ;   zxy = REAL( nday                   ) / REAL( nmonth_len(nbdy_b) ) + 0.5 - i15 
    671        ELSEIF( istep(nbdy_b) == istep(nbdy_a) ) THEN  
    672                                     zxy = 0.0_wp 
    673        ELSE                     ;   zxy = REAL( istep(nbdy_b) - itimer ) / REAL( istep(nbdy_b) - istep(nbdy_a) ) 
    674        END IF 
    675  
    676           IF(ln_tra_frs) THEN 
    677              igrd = 1                                   ! temperature & salinity 
    678              DO ib = 1, nblen(igrd) 
    679                DO ik = 1, jpkm1 
    680                  tbdy(ib,ik) = zxy * tbdydta(ib,ik,2) + (1.-zxy) * tbdydta(ib,ik,1) 
    681                  sbdy(ib,ik) = zxy * sbdydta(ib,ik,2) + (1.-zxy) * sbdydta(ib,ik,1) 
    682                END DO 
    683              END DO 
    684           ENDIF 
    685  
    686           IF(ln_dyn_frs) THEN 
    687              igrd = 2                                   ! u-velocity 
    688              DO ib = 1, nblen(igrd) 
    689                DO ik = 1, jpkm1 
    690                  ubdy(ib,ik) = zxy * ubdydta(ib,ik,2) + (1.-zxy) * ubdydta(ib,ik,1)    
    691                END DO 
    692              END DO 
    693              ! 
    694              igrd = 3                                   ! v-velocity 
    695              DO ib = 1, nblen(igrd) 
    696                DO ik = 1, jpkm1 
    697                  vbdy(ib,ik) = zxy * vbdydta(ib,ik,2) + (1.-zxy) * vbdydta(ib,ik,1)    
    698                END DO 
    699              END DO 
    700           ENDIF 
    701  
    702 #if defined key_lim2 
    703           IF(ln_ice_frs) THEN 
    704             igrd=1 
    705             DO ib=1, nblen(igrd) 
    706                frld_bdy(ib) = zxy *  frld_bdydta(ib,2) + (1.-zxy) *  frld_bdydta(ib,1) 
    707               hicif_bdy(ib) = zxy * hicif_bdydta(ib,2) + (1.-zxy) * hicif_bdydta(ib,1) 
    708               hsnif_bdy(ib) = zxy * hsnif_bdydta(ib,2) + (1.-zxy) * hsnif_bdydta(ib,1) 
    709             END DO 
    710           ENDIF ! just if ln_ice_frs is true 
    711 #endif 
    712  
    713       END IF                       !end if ((nn_dtactl==1).AND.(ntimes_bdy>1)) 
    714      
    715  
    716       !                                                !---------------------! 
    717       !                                                !     last call       ! 
    718       !                                                !---------------------! 
    719       IF( kt == nitend ) THEN 
    720           IF(ln_tra_frs .or. ln_ice_frs) CALL iom_close( numbdyt )              ! Closing of the 3 files 
    721           IF(ln_dyn_frs) CALL iom_close( numbdyu ) 
    722           IF(ln_dyn_frs) CALL iom_close( numbdyv ) 
    723       ENDIF 
    724       ! 
    725       ENDIF ! ln_dyn_frs .OR. ln_tra_frs 
    726       ! 
    727    END SUBROUTINE bdy_dta_frs 
    728  
    729  
    730    SUBROUTINE bdy_dta_fla( kt, jit, icycl ) 
    731       !!--------------------------------------------------------------------------- 
    732       !!                      ***  SUBROUTINE bdy_dta_fla  *** 
    733       !!                     
    734       !! ** Purpose :   Read unstructured boundary data for Flather condition 
    735       !! 
    736       !! ** Method  :  At the first timestep, read in boundary data for two 
    737       !!               times from the file and time-interpolate. At other  
    738       !!               timesteps, check to see if we need another time from  
    739       !!               the file. If so read it in. Time interpolate. 
    740       !!--------------------------------------------------------------------------- 
    741 !!gm DOCTOR names :   argument integer :  start with "k" 
    742       INTEGER, INTENT( in ) ::   kt          ! ocean time-step index 
    743       INTEGER, INTENT( in ) ::   jit         ! barotropic time step index 
    744       INTEGER, INTENT( in ) ::   icycl       ! number of cycles need for final file close 
    745       !                                      ! (for timesplitting option, otherwise zero) 
    746       !! 
    747       LOGICAL ::   lect                      ! flag for reading 
    748       INTEGER ::   it, ib, igrd              ! dummy loop indices 
    749       INTEGER ::   idvar                     ! netcdf var ID 
    750       INTEGER ::   iman, i15, imois          ! Time variables for monthly clim forcing 
    751       INTEGER ::   ntimes_bdyt, ntimes_bdyu, ntimes_bdyv 
    752       INTEGER ::   itimer, totime 
    753       INTEGER ::   ipi, ipj, ipk, inum       ! temporary integers (NetCDF read) 
    754       INTEGER ::   iyear0, imonth0, iday0 
    755       INTEGER ::   ihours0, iminutes0, isec0 
    756       INTEGER ::   iyear, imonth, iday, isecs 
    757       INTEGER, DIMENSION(jpbtime) ::   istept, istepu, istepv   ! time arrays from data files 
    758       REAL(wp) ::   dayfrac, zxy, zoffsett 
    759       REAL(wp) ::   zoffsetu, zoffsetv 
    760       REAL(wp) ::   dayjul0, zdayjulini 
    761       REAL(wp) ::   zinterval_s, zinterval_e                    ! First and last interval in time axis 
    762       REAL(wp), DIMENSION(jpbtime)      ::   zstepr             ! REAL time array from data files 
    763       REAL(wp), DIMENSION(jpbdta,1)     ::   zdta               ! temporary array for data fields 
    764       CHARACTER(LEN=80), DIMENSION(6)   ::   clfile 
    765       CHARACTER(LEN=70 )                ::   clunits            ! units attribute of time coordinate 
    766       !!--------------------------------------------------------------------------- 
    767  
    768 !!gm   add here the same style as in bdy_dta_frs 
    769 !!gm      clearly bdy_dta_fla and bdy_dta_frs  can be combined...    
    770 !!gm      too many things duplicated in the read of data...   simplification can be done 
    771  
    772       ! -------------------- ! 
    773       !    Initialization    ! 
    774       ! -------------------- ! 
    775  
    776       lect   = .false.           ! If true, read a time record 
    777  
    778       ! Some time variables for monthly climatological forcing: 
    779       ! ******************************************************* 
    780  !!gm  here  use directely daymod variables 
    781   
    782       iman  = INT( raamo ) ! Number of months in a year 
    783  
    784       i15 = INT( 2*REAL( nday, wp ) / ( REAL( nmonth_len(nmonth), wp ) + 0.5 ) ) 
    785       ! i15=0 if the current day is in the first half of the month, else i15=1 
    786  
    787       imois = nmonth + i15 - 1            ! imois is the first month record 
    788       IF( imois == 0 ) imois = iman 
    789  
    790       ! Time variable for non-climatological forcing: 
    791       ! ********************************************* 
    792  
    793       itimer = ((kt-1)-nit000+1)*rdt                      ! current time in seconds for interpolation  
    794       itimer = itimer + jit*rdt/REAL(nn_baro,wp)      ! in non-climatological case 
    795  
    796       IF ( ln_tides ) THEN 
    797  
    798          ! -------------------------------------! 
    799          ! Update BDY fields with tidal forcing ! 
    800          ! -------------------------------------!   
    801  
    802          CALL tide_update( kt, jit )  
    803    
    804       ENDIF 
    805  
    806       IF ( ln_dyn_fla ) THEN 
    807  
    808          ! -------------------------------------! 
    809          ! Update BDY fields with model data    ! 
    810          ! -------------------------------------!   
    811  
    812       !                                                !-------------------! 
    813       IF( kt == nit000 .and. jit ==2 ) THEN            !  First call only  ! 
    814          !                                             !-------------------! 
    815          istep_bt(:) = 0 
    816          nbdy_b_bt    = 0 
    817          nbdy_a_bt    = 0 
    818  
    819          ! Get time information from bdy data file 
    820          ! *************************************** 
    821  
    822         IF(lwp) WRITE(numout,*) 
    823         IF(lwp) WRITE(numout,*)    'bdy_dta_fla :Initialize unstructured boundary data for barotropic variables.' 
    824         IF(lwp) WRITE(numout,*)    '~~~~~~~'  
    825  
    826         IF( nn_dtactl == 0 ) THEN 
    827           IF(lwp) WRITE(numout,*)  'Bdy data are taken from initial conditions' 
    828  
    829         ELSEIF (nn_dtactl == 1) THEN 
    830           IF(lwp) WRITE(numout,*)  'Bdy data are read in netcdf files' 
    831  
    832           dayfrac = adatrj  - REAL(itimer,wp)/86400. ! day fraction at time step kt-1 
    833           dayfrac = dayfrac - INT (dayfrac)          ! 
    834           totime = (nitend-nit000+1)*rdt             ! Total time of the run to verify that all the 
    835                                                      ! necessary time dumps in file are included 
    836  
    837           clfile(4) = cn_dta_fla_T 
    838           clfile(5) = cn_dta_fla_U 
    839           clfile(6) = cn_dta_fla_V 
    840  
    841           DO igrd = 4,6 
    842  
    843             CALL iom_open( clfile(igrd), inum ) 
    844             CALL iom_gettime( inum, zstepr, kntime=ntimes_bdy_bt, cdunits=clunits )  
    845  
    846             SELECT CASE( igrd ) 
    847                CASE (4)  
    848                   numbdyt_bt = inum 
    849                CASE (5)  
    850                   numbdyu_bt = inum 
    851                CASE (6)  
    852                   numbdyv_bt = inum 
    853             END SELECT 
    854  
    855             ! Calculate time offset  
    856             READ(clunits,7000) iyear0, imonth0, iday0, ihours0, iminutes0, isec0 
    857             ! Convert time origin in file to julian days  
    858             isec0 = isec0 + ihours0*60.*60. + iminutes0*60. 
    859             CALL ymds2ju(iyear0, imonth0, iday0, REAL(isec0, wp), dayjul0) 
    860             ! Compute model initialization time  
    861             iyear  = ndastp / 10000 
    862             imonth = ( ndastp - iyear * 10000 ) / 100 
    863             iday   = ndastp - iyear * 10000 - imonth * 100 
    864             isecs  = dayfrac * 86400 
    865             CALL ymds2ju(iyear, imonth, iday, REAL(isecs, wp) , zdayjulini) 
    866             ! zoffset from initialization date: 
    867             zoffset = (dayjul0-zdayjulini)*86400 
    868             ! 
    869  
    870 7000 FORMAT('seconds since ', I4.4,'-',I2.2,'-',I2.2,' ',I2.2,':',I2.2,':',I2.2) 
    871  
    872             !! TO BE DONE... Check consistency between calendar from file  
    873             !! (available optionally from iom_gettime) and calendar in model  
    874             !! when calendar in model available outside of IOIPSL. 
    875  
    876             ! Check that there are not too many times in the file.  
    877             IF (ntimes_bdy_bt > jpbtime) CALL ctl_stop( & 
    878                  'Number of time dumps in bdy file exceed jpbtime parameter', & 
    879                  'Check file:' // TRIM(clfile(igrd))  ) 
    880  
    881             ! Check that time array increases (or interp will fail): 
    882             DO it = 2, ntimes_bdy_bt 
    883                IF ( zstepr(it-1) >= zstepr(it) ) THEN 
    884                   CALL ctl_stop('Time array in unstructured boundary data file', & 
    885                        'does not continuously increase.',               & 
    886                        'Check file:' // TRIM(clfile(igrd))  ) 
    887                   EXIT 
    888                END IF 
    889             END DO 
    890  
    891             IF ( .NOT. ln_clim ) THEN 
    892                ! Check that times in file span model run time: 
    893  
    894                ! Note: the fields may be time means, so we allow nit000 to be before 
    895                ! first time in the file, provided that it falls inside the meaning 
    896                ! period of the first field.  Until we can get the meaning period 
    897                ! from the file, use the interval between fields as a proxy. 
    898                ! If nit000 is before the first time, use the value at first time 
    899                ! instead of extrapolating.  This is done by putting time 1 into 
    900                ! both time levels. 
    901                ! The same applies to the last time level: see setting of lect below. 
    902  
    903                IF ( ntimes_bdy_bt == 1 ) CALL ctl_stop( & 
    904                     'There is only one time dump in data files', & 
    905                     'Set ln_clim=.true. in namelist for constant bdy forcing.' ) 
    906  
    907                zinterval_s = zstepr(2) - zstepr(1) 
    908                zinterval_e = zstepr(ntimes_bdy_bt) - zstepr(ntimes_bdy_bt-1) 
    909  
    910                IF( zstepr(1) + zoffset > 0 ) THEN 
    911                      WRITE(ctmp1,*) 'Check file: ', clfile(igrd) 
    912                      CALL ctl_stop( 'First time dump in bdy file is after model initial time', ctmp1 ) 
    913                END IF 
    914                IF( zstepr(ntimes_bdy_bt) + zoffset < totime ) THEN 
    915                      WRITE(ctmp1,*) 'Check file: ', clfile(igrd) 
    916                      CALL ctl_stop( 'Last time dump in bdy file is before model final time', ctmp1 ) 
    917                END IF 
    918             END IF ! .NOT. ln_clim 
    919  
    920             IF ( igrd .EQ. 4) THEN 
    921               ntimes_bdyt = ntimes_bdy_bt 
    922               zoffsett = zoffset 
    923               istept(:) = INT( zstepr(:) + zoffset ) 
    924             ELSE IF (igrd .EQ. 5) THEN 
    925               ntimes_bdyu = ntimes_bdy_bt 
    926               zoffsetu = zoffset 
    927               istepu(:) = INT( zstepr(:) + zoffset ) 
    928             ELSE IF (igrd .EQ. 6) THEN 
    929               ntimes_bdyv = ntimes_bdy_bt 
    930               zoffsetv = zoffset 
    931               istepv(:) = INT( zstepr(:) + zoffset ) 
    932             ENDIF 
    933  
    934           ENDDO 
    935  
    936       ! Verify time consistency between files   
    937  
    938           IF ( ntimes_bdyu /= ntimes_bdyt .OR. ntimes_bdyv /= ntimes_bdyt ) THEN 
    939              CALL ctl_stop( & 
    940              'Time axis lengths differ between bdy data files', & 
    941              'Multiple time frequencies not implemented yet' ) 
    942           ELSE 
    943             ntimes_bdy_bt = ntimes_bdyt 
    944           ENDIF 
    945  
    946           IF (zoffsetu.NE.zoffsett .OR. zoffsetv.NE.zoffsett) THEN 
    947             CALL ctl_stop( &  
    948             'Bdy data files must have the same time origin', & 
    949             'Multiple time frequencies not implemented yet'  ) 
    950           ENDIF 
    951           zoffset = zoffsett 
    952  
    953       !! Check that times are the same in the three files... HERE. 
    954           istep_bt(:) = istept(:) 
    955  
    956       ! Check number of time dumps:               
    957           IF (ln_clim) THEN 
    958             SELECT CASE ( ntimes_bdy_bt ) 
    959             CASE( 1 ) 
    960               IF(lwp) WRITE(numout,*) 
    961               IF(lwp) WRITE(numout,*) 'We assume constant boundary forcing from bdy data files' 
    962               IF(lwp) WRITE(numout,*)              
    963             CASE( 12 ) 
    964               IF(lwp) WRITE(numout,*) 
    965               IF(lwp) WRITE(numout,*) 'We assume monthly (and cyclic) boundary forcing from bdy data files' 
    966               IF(lwp) WRITE(numout,*)  
    967             CASE DEFAULT 
    968               CALL ctl_stop( & 
    969                 'For climatological boundary forcing (ln_clim=.true.),',& 
    970                 'bdy data files must contain 1 or 12 time dumps.' ) 
    971             END SELECT 
    972           ENDIF 
    973  
    974       ! Find index of first record to read (before first model time).  
    975  
    976           it=1 
    977           DO WHILE ( ((istep_bt(it+1)) <= 0 ).AND.(it.LE.(ntimes_bdy_bt-1))) 
    978             it=it+1 
    979           END DO 
    980           nbdy_b_bt = it 
    981  
    982           IF(lwp) WRITE(numout,*) 'Time offset is ',zoffset 
    983           IF(lwp) WRITE(numout,*) 'First record to read is ',nbdy_b_bt 
    984  
    985         ENDIF ! endif (nn_dtactl == 1) 
    986  
    987       ! 1.2  Read first record in file if necessary (ie if nn_dtactl == 1) 
    988       ! ***************************************************************** 
    989  
    990         IF ( nn_dtactl == 0) THEN 
    991           ! boundary data arrays are filled with initial conditions 
    992           igrd = 5            ! U-points data  
    993           DO ib = 1, nblen(igrd)               
    994             ubtbdy(ib) = un(nbi(ib,igrd), nbj(ib,igrd), 1) 
    995           END DO 
    996  
    997           igrd = 6            ! V-points data  
    998           DO ib = 1, nblen(igrd)               
    999             vbtbdy(ib) = vn(nbi(ib,igrd), nbj(ib,igrd), 1) 
    1000           END DO 
    1001  
    1002           igrd = 4            ! T-points data  
    1003           DO ib = 1, nblen(igrd)               
    1004             sshbdy(ib) = sshn(nbi(ib,igrd), nbj(ib,igrd)) 
    1005           END DO 
    1006  
    1007         ELSEIF (nn_dtactl == 1) THEN 
    1008   
    1009         ! Set first record in the climatological case:    
    1010           IF ((ln_clim).AND.(ntimes_bdy_bt==1)) THEN 
    1011             nbdy_a_bt = 1 
    1012           ELSEIF ((ln_clim).AND.(ntimes_bdy_bt==iman)) THEN 
    1013             nbdy_b_bt = 0 
    1014             nbdy_a_bt = imois 
    1015           ELSE 
    1016             nbdy_a_bt = nbdy_b_bt 
    1017           END IF 
    1018   
    1019          ! Open Netcdf files: 
    1020  
    1021           CALL iom_open ( cn_dta_fla_T, numbdyt_bt ) 
    1022           CALL iom_open ( cn_dta_fla_U, numbdyu_bt ) 
    1023           CALL iom_open ( cn_dta_fla_V, numbdyv_bt ) 
    1024  
    1025          ! Read first record: 
    1026           ipj=1 
    1027           igrd=4 
    1028           ipi=nblendta(igrd) 
    1029  
    1030           ! ssh 
    1031           igrd=4 
    1032           IF ( nblendta(igrd) .le. 0 ) THEN  
    1033             idvar = iom_varid( numbdyt_bt,'sossheig' ) 
    1034             nblendta(igrd) = iom_file(numbdyt_bt)%dimsz(1,idvar) 
    1035           ENDIF 
    1036           WRITE(numout,*) 'Dim size for sossheig is ',nblendta(igrd) 
    1037           ipi=nblendta(igrd) 
    1038  
    1039           CALL iom_get ( numbdyt_bt, jpdom_unknown,'sossheig',zdta(1:ipi,1:ipj),nbdy_a_bt ) 
    1040  
    1041           DO ib=1, nblen(igrd) 
    1042             sshbdydta(ib,2) =  zdta(nbmap(ib,igrd),1) 
    1043           END DO 
    1044   
    1045           ! u-velocity 
    1046           igrd=5 
    1047           IF ( nblendta(igrd) .le. 0 ) THEN  
    1048             idvar = iom_varid( numbdyu_bt,'vobtcrtx' ) 
    1049             nblendta(igrd) = iom_file(numbdyu_bt)%dimsz(1,idvar) 
    1050           ENDIF 
    1051           WRITE(numout,*) 'Dim size for vobtcrtx is ',nblendta(igrd) 
    1052           ipi=nblendta(igrd) 
    1053  
    1054           CALL iom_get ( numbdyu_bt, jpdom_unknown,'vobtcrtx',zdta(1:ipi,1:ipj),nbdy_a_bt ) 
    1055  
    1056           DO ib=1, nblen(igrd) 
    1057             ubtbdydta(ib,2) =  zdta(nbmap(ib,igrd),1) 
    1058           END DO 
    1059  
    1060           ! v-velocity 
    1061           igrd=6 
    1062           IF ( nblendta(igrd) .le. 0 ) THEN  
    1063             idvar = iom_varid( numbdyv_bt,'vobtcrty' ) 
    1064             nblendta(igrd) = iom_file(numbdyv_bt)%dimsz(1,idvar) 
    1065           ENDIF 
    1066           WRITE(numout,*) 'Dim size for vobtcrty is ',nblendta(igrd) 
    1067           ipi=nblendta(igrd) 
    1068  
    1069           CALL iom_get ( numbdyv_bt, jpdom_unknown,'vobtcrty',zdta(1:ipi,1:ipj),nbdy_a_bt ) 
    1070  
    1071           DO ib=1, nblen(igrd) 
    1072             vbtbdydta(ib,2) =  zdta(nbmap(ib,igrd),1) 
    1073           END DO 
    1074  
    1075         END IF 
    1076   
    1077         ! In the case of constant boundary forcing fill bdy arrays once for all 
    1078         IF ((ln_clim).AND.(ntimes_bdy_bt==1)) THEN 
    1079  
    1080           ubtbdy  (:) = ubtbdydta  (:,2) 
    1081           vbtbdy  (:) = vbtbdydta  (:,2) 
    1082           sshbdy  (:) = sshbdydta  (:,2) 
    1083  
    1084           CALL iom_close( numbdyt_bt ) 
    1085           CALL iom_close( numbdyu_bt ) 
    1086           CALL iom_close( numbdyv_bt ) 
    1087  
    1088         END IF 
    1089  
    1090       ENDIF ! End if nit000 
    1091  
    1092       ! -------------------- ! 
    1093       ! 2. At each time step ! 
    1094       ! -------------------- ! 
    1095  
    1096       IF ((nn_dtactl==1).AND.(ntimes_bdy_bt>1)) THEN  
    1097  
    1098       ! 2.1 Read one more record if necessary 
    1099       !************************************** 
    1100  
    1101         IF ( (ln_clim).AND.(imois/=nbdy_b_bt) ) THEN ! remember that nbdy_b_bt=0 for kt=nit000 
    1102          nbdy_b_bt = imois 
    1103          nbdy_a_bt = imois+1 
    1104          nbdy_b_bt = MOD( nbdy_b_bt, iman ) 
    1105          IF( nbdy_b_bt == 0 ) nbdy_b_bt = iman 
    1106          nbdy_a_bt = MOD( nbdy_a_bt, iman ) 
    1107          IF( nbdy_a_bt == 0 ) nbdy_a_bt = iman 
    1108          lect=.true. 
    1109  
    1110         ELSEIF ((.NOT.ln_clim).AND.(itimer >= istep_bt(nbdy_a_bt))) THEN 
    1111           nbdy_b_bt=nbdy_a_bt 
    1112           nbdy_a_bt=nbdy_a_bt+1 
    1113           lect=.true. 
    1114         END IF 
    1115           
    1116         IF (lect) THEN 
    1117  
    1118         ! Swap arrays 
    1119           sshbdydta(:,1) =  sshbdydta(:,2) 
    1120           ubtbdydta(:,1) =  ubtbdydta(:,2) 
    1121           vbtbdydta(:,1) =  vbtbdydta(:,2) 
    1122   
    1123         ! read another set 
    1124  
    1125           ipj=1 
    1126           ipk=jpk 
    1127           igrd=4 
    1128           ipi=nblendta(igrd) 
    1129  
    1130            
    1131           ! ssh 
    1132           igrd=4 
    1133           ipi=nblendta(igrd) 
    1134  
    1135           CALL iom_get ( numbdyt_bt, jpdom_unknown,'sossheig',zdta(1:ipi,1:ipj),nbdy_a_bt ) 
    1136  
    1137           DO ib=1, nblen(igrd) 
    1138             sshbdydta(ib,2) =  zdta(nbmap(ib,igrd),1) 
    1139           END DO 
    1140  
    1141           ! u-velocity 
    1142           igrd=5 
    1143           ipi=nblendta(igrd) 
    1144  
    1145           CALL iom_get ( numbdyu_bt, jpdom_unknown,'vobtcrtx',zdta(1:ipi,1:ipj),nbdy_a_bt ) 
    1146  
    1147           DO ib=1, nblen(igrd) 
    1148             ubtbdydta(ib,2) =  zdta(nbmap(ib,igrd),1) 
    1149           END DO 
    1150  
    1151           ! v-velocity 
    1152           igrd=6 
    1153           ipi=nblendta(igrd) 
    1154  
    1155           CALL iom_get ( numbdyv_bt, jpdom_unknown,'vobtcrty',zdta(1:ipi,1:ipj),nbdy_a_bt ) 
    1156  
    1157           DO ib=1, nblen(igrd) 
    1158             vbtbdydta(ib,2) =  zdta(nbmap(ib,igrd),1) 
    1159           END DO 
    1160  
    1161  
    1162          IF(lwp) WRITE(numout,*) 'bdy_dta_fla : first record file used nbdy_b_bt ',nbdy_b_bt 
    1163          IF(lwp) WRITE(numout,*) '~~~~~~~~  last  record file used nbdy_a_bt ',nbdy_a_bt 
    1164          IF (.NOT.ln_clim) THEN 
    1165            IF(lwp) WRITE(numout,*) 'first  record time (s): ', istep_bt(nbdy_b_bt) 
    1166            IF(lwp) WRITE(numout,*) 'model time (s)        : ', itimer 
    1167            IF(lwp) WRITE(numout,*) 'second record time (s): ', istep_bt(nbdy_a_bt) 
    1168          ENDIF 
    1169         END IF ! end lect=.true. 
    1170  
    1171  
    1172       ! 2.2   Interpolate linearly: 
    1173       ! *************************** 
    1174      
    1175         IF (ln_clim) THEN 
    1176           zxy = REAL( nday, wp ) / REAL( nmonth_len(nbdy_b_bt), wp ) + 0.5 - i15 
    1177         ELSE           
    1178           zxy = REAL(istep_bt(nbdy_b_bt)-itimer, wp) / REAL(istep_bt(nbdy_b_bt)-istep_bt(nbdy_a_bt), wp) 
    1179         END IF 
    1180  
    1181           igrd=4 
    1182           DO ib=1, nblen(igrd) 
    1183             sshbdy(ib) = zxy      * sshbdydta(ib,2) + & 
    1184                        (1.-zxy) * sshbdydta(ib,1)    
    1185           END DO 
    1186  
    1187           igrd=5 
    1188           DO ib=1, nblen(igrd) 
    1189             ubtbdy(ib) = zxy      * ubtbdydta(ib,2) + & 
    1190                          (1.-zxy) * ubtbdydta(ib,1)    
    1191           END DO 
    1192  
    1193           igrd=6 
    1194           DO ib=1, nblen(igrd) 
    1195             vbtbdy(ib) = zxy      * vbtbdydta(ib,2) + & 
    1196                          (1.-zxy) * vbtbdydta(ib,1)    
    1197           END DO 
    1198  
    1199  
    1200       END IF !end if ((nn_dtactl==1).AND.(ntimes_bdy_bt>1)) 
    1201      
    1202       ! ------------------- ! 
    1203       ! Last call kt=nitend ! 
    1204       ! ------------------- ! 
    1205  
    1206       ! Closing of the 3 files 
    1207       IF( kt == nitend   .and. jit == icycl ) THEN 
    1208           CALL iom_close( numbdyt_bt ) 
    1209           CALL iom_close( numbdyu_bt ) 
    1210           CALL iom_close( numbdyv_bt ) 
    1211       ENDIF 
    1212  
    1213       ENDIF ! ln_dyn_frs 
    1214  
    1215       END SUBROUTINE bdy_dta_fla 
    1216  
     603               IF( nn_dyn2d(ib_bdy) .ne. jp_frs ) THEN 
     604                  jfld = jfld + 1 
     605                  dta_bdy(ib_bdy)%ssh => bf(jfld)%fnow(:,1,1) 
     606               ENDIF 
     607               jfld = jfld + 1 
     608               dta_bdy(ib_bdy)%u2d => bf(jfld)%fnow(:,1,1) 
     609               jfld = jfld + 1 
     610               dta_bdy(ib_bdy)%v2d => bf(jfld)%fnow(:,1,1) 
     611            ENDIF 
     612         ENDIF 
     613 
     614         IF ( nn_dyn3d(ib_bdy) .gt. 0 .and. nn_dyn3d_dta(ib_bdy) .eq. 0 ) THEN 
     615            IF( nn_dyn3d(ib_bdy) .eq. jp_frs ) THEN 
     616               ilen0(1:3) = nblen(1:3) 
     617            ELSE 
     618               ilen0(1:3) = nblenrim(1:3) 
     619            ENDIF 
     620            ALLOCATE( dta_bdy(ib_bdy)%u3d(ilen0(2),jpk) ) 
     621            ALLOCATE( dta_bdy(ib_bdy)%v3d(ilen0(3),jpk) ) 
     622         ENDIF 
     623         IF ( ( nn_dyn3d(ib_bdy) .gt. 0 .and. nn_dyn3d_dta(ib_bdy) .eq. 1 ).or. & 
     624           &  ( ln_full_vel_array(ib_bdy) .and. nn_dyn2d(ib_bdy) .gt. 0 .and.   & 
     625           &    ( nn_dyn2d_dta(ib_bdy) .eq. 1 .or. nn_dyn2d_dta(ib_bdy) .eq. 3 ) ) ) THEN 
     626            jfld = jfld + 1 
     627            dta_bdy(ib_bdy)%u3d => bf(jfld)%fnow(:,1,:) 
     628            jfld = jfld + 1 
     629            dta_bdy(ib_bdy)%v3d => bf(jfld)%fnow(:,1,:) 
     630         ENDIF 
     631 
     632         IF (nn_tra(ib_bdy) .gt. 0) THEN 
     633            IF( nn_tra_dta(ib_bdy) .eq. 0 ) THEN 
     634               IF( nn_tra(ib_bdy) .eq. jp_frs ) THEN 
     635                  ilen0(1:3) = nblen(1:3) 
     636               ELSE 
     637                  ilen0(1:3) = nblenrim(1:3) 
     638               ENDIF 
     639               ALLOCATE( dta_bdy(ib_bdy)%tem(ilen0(1),jpk) ) 
     640               ALLOCATE( dta_bdy(ib_bdy)%sal(ilen0(1),jpk) ) 
     641            ELSE 
     642               jfld = jfld + 1 
     643               dta_bdy(ib_bdy)%tem => bf(jfld)%fnow(:,1,:) 
     644               jfld = jfld + 1 
     645               dta_bdy(ib_bdy)%sal => bf(jfld)%fnow(:,1,:) 
     646            ENDIF 
     647         ENDIF 
     648 
     649#if defined key_lim2 
     650         IF (nn_ice_lim2(ib_bdy) .gt. 0) THEN 
     651            IF( nn_ice_lim2_dta(ib_bdy) .eq. 0 ) THEN 
     652               IF( nn_ice_lim2(ib_bdy) .eq. jp_frs ) THEN 
     653                  ilen0(1:3) = nblen(1:3) 
     654               ELSE 
     655                  ilen0(1:3) = nblenrim(1:3) 
     656               ENDIF 
     657               ALLOCATE( dta_bdy(ib_bdy)%frld(ilen0(1)) ) 
     658               ALLOCATE( dta_bdy(ib_bdy)%hicif(ilen0(1)) ) 
     659               ALLOCATE( dta_bdy(ib_bdy)%hsnif(ilen0(1)) ) 
     660            ELSE 
     661               jfld = jfld + 1 
     662               dta_bdy(ib_bdy)%frld  => bf(jfld)%fnow(:,1,1) 
     663               jfld = jfld + 1 
     664               dta_bdy(ib_bdy)%hicif => bf(jfld)%fnow(:,1,1) 
     665               jfld = jfld + 1 
     666               dta_bdy(ib_bdy)%hsnif => bf(jfld)%fnow(:,1,1) 
     667            ENDIF 
     668         ENDIF 
     669#endif 
     670 
     671      ENDDO ! ib_bdy  
     672 
     673      END SUBROUTINE bdy_dta_init 
    1217674 
    1218675#else 
    1219676   !!---------------------------------------------------------------------- 
    1220    !!   Dummy module                   NO Unstruct Open Boundary Conditions 
     677   !!   Dummy module                   NO Open Boundary Conditions 
    1221678   !!---------------------------------------------------------------------- 
    1222679CONTAINS 
    1223    SUBROUTINE bdy_dta_frs( kt )              ! Empty routine 
    1224       WRITE(*,*) 'bdy_dta_frs: You should not have seen this print! error?', kt 
    1225    END SUBROUTINE bdy_dta_frs 
    1226    SUBROUTINE bdy_dta_fla( kt, kit, icycle )      ! Empty routine 
    1227       WRITE(*,*) 'bdy_dta_frs: You should not have seen this print! error?', kt, kit 
    1228    END SUBROUTINE bdy_dta_fla 
     680   SUBROUTINE bdy_dta( kt, jit, time_offset ) ! Empty routine 
     681      INTEGER, INTENT( in )           ::   kt     
     682      INTEGER, INTENT( in ), OPTIONAL ::   jit    
     683      INTEGER, INTENT( in ), OPTIONAL ::   time_offset 
     684      WRITE(*,*) 'bdy_dta: You should not have seen this print! error?', kt 
     685   END SUBROUTINE bdy_dta 
     686   SUBROUTINE bdy_dta_init()                  ! Empty routine 
     687      WRITE(*,*) 'bdy_dta_init: You should not have seen this print! error?' 
     688   END SUBROUTINE bdy_dta_init 
    1229689#endif 
    1230690 
  • branches/2011/dev_NEMO_MERGE_2011/NEMOGCM/NEMO/OPA_SRC/BDY/bdydyn.F90

    r2528 r3116  
    1515   !!   'key_bdy' :                    Unstructured Open Boundary Condition 
    1616   !!---------------------------------------------------------------------- 
    17    !!   bdy_dyn_frs    : relaxation of velocities on unstructured open boundary 
    18    !!   bdy_dyn_fla    : Flather condition for barotropic solution 
     17   !!   bdy_dyn3d        : apply open boundary conditions to baroclinic velocities 
     18   !!   bdy_dyn3d_frs    : apply Flow Relaxation Scheme 
    1919   !!---------------------------------------------------------------------- 
    2020   USE oce             ! ocean dynamics and tracers  
    2121   USE dom_oce         ! ocean space and time domain 
     22   USE dynspg_oce       
    2223   USE bdy_oce         ! ocean open boundary conditions 
    23    USE dynspg_oce      ! for barotropic variables 
    24    USE phycst          ! physical constants 
     24   USE bdydyn2d        ! open boundary conditions for barotropic solution 
     25   USE bdydyn3d        ! open boundary conditions for baroclinic velocities 
    2526   USE lbclnk          ! ocean lateral boundary conditions (or mpp link) 
    26    USE bdytides        ! for tidal harmonic forcing at boundary 
    2727   USE in_out_manager  ! 
    2828 
     
    3030   PRIVATE 
    3131 
    32    PUBLIC   bdy_dyn_frs   ! routine called in dynspg_flt (free surface case ONLY) 
    33 # if defined key_dynspg_exp || defined key_dynspg_ts 
    34    PUBLIC   bdy_dyn_fla   ! routine called in dynspg_flt (free surface case ONLY) 
    35 # endif 
     32   PUBLIC   bdy_dyn     ! routine called in dynspg_flt (if lk_dynspg_flt) or  
     33                        ! dyn_nxt (if lk_dynspg_ts or lk_dynspg_exp) 
    3634 
     35#  include "domzgr_substitute.h90" 
    3736   !!---------------------------------------------------------------------- 
    3837   !! NEMO/OPA 3.3 , NEMO Consortium (2010) 
     
    4241CONTAINS 
    4342 
    44    SUBROUTINE bdy_dyn_frs( kt ) 
     43   SUBROUTINE bdy_dyn( kt, dyn3d_only ) 
    4544      !!---------------------------------------------------------------------- 
    46       !!                  ***  SUBROUTINE bdy_dyn_frs  *** 
     45      !!                  ***  SUBROUTINE bdy_dyn  *** 
    4746      !! 
    48       !! ** Purpose : - Apply the Flow Relaxation Scheme for dynamic in the   
    49       !!                case of unstructured open boundaries. 
     47      !! ** Purpose : - Wrapper routine for bdy_dyn2d and bdy_dyn3d. 
    5048      !! 
    51       !! References :- Engedahl H., 1995: Use of the flow relaxation scheme in  
    52       !!               a three-dimensional baroclinic ocean model with realistic 
    53       !!               topography. Tellus, 365-382. 
    5449      !!---------------------------------------------------------------------- 
    55       INTEGER, INTENT( in ) ::   kt   ! Main time step counter 
     50      USE wrk_nemo, ONLY: wrk_in_use, wrk_not_released 
     51      USE wrk_nemo, ONLY: wrk_2d_7, wrk_2d_8      ! 2D workspace 
    5652      !! 
    57       INTEGER  ::   jb, jk         ! dummy loop indices 
    58       INTEGER  ::   ii, ij, igrd   ! local integers 
    59       REAL(wp) ::   zwgt           ! boundary weight 
    60       !!---------------------------------------------------------------------- 
    61       ! 
    62       IF(ln_dyn_frs) THEN       ! If this is false, then this routine does nothing.  
    63          ! 
    64          IF( kt == nit000 ) THEN 
    65             IF(lwp) WRITE(numout,*) 
    66             IF(lwp) WRITE(numout,*) 'bdy_dyn_frs : Flow Relaxation Scheme on momentum' 
    67             IF(lwp) WRITE(numout,*) '~~~~~~~' 
    68          ENDIF 
    69          ! 
    70          igrd = 2                      ! Relaxation of zonal velocity 
    71          DO jb = 1, nblen(igrd) 
    72             DO jk = 1, jpkm1 
    73                ii   = nbi(jb,igrd) 
    74                ij   = nbj(jb,igrd) 
    75                zwgt = nbw(jb,igrd) 
    76                ua(ii,ij,jk) = ( ua(ii,ij,jk) * ( 1.- zwgt ) + ubdy(jb,jk) * zwgt ) * umask(ii,ij,jk) 
    77             END DO 
    78          END DO 
    79          ! 
    80          igrd = 3                      ! Relaxation of meridional velocity 
    81          DO jb = 1, nblen(igrd) 
    82             DO jk = 1, jpkm1 
    83                ii   = nbi(jb,igrd) 
    84                ij   = nbj(jb,igrd) 
    85                zwgt = nbw(jb,igrd) 
    86                va(ii,ij,jk) = ( va(ii,ij,jk) * ( 1.- zwgt ) + vbdy(jb,jk) * zwgt ) * vmask(ii,ij,jk) 
    87             END DO 
    88          END DO  
    89          CALL lbc_lnk( ua, 'U', -1. )   ;   CALL lbc_lnk( va, 'V', -1. )   ! Boundary points should be updated 
    90          ! 
    91       ENDIF ! ln_dyn_frs 
    92       ! 
    93    END SUBROUTINE bdy_dyn_frs 
     53      INTEGER, INTENT( in )           :: kt               ! Main time step counter 
     54      LOGICAL, INTENT( in ), OPTIONAL :: dyn3d_only       ! T => only update baroclinic velocities 
     55      !! 
     56      INTEGER               :: jk,ii,ij,ib,igrd     ! Loop counter 
     57      LOGICAL               :: ll_dyn2d, ll_dyn3d   
     58      !! 
    9459 
     60      IF(wrk_in_use(2, 7,8) ) THEN 
     61         CALL ctl_stop('bdy_dyn: ERROR: requested workspace arrays are unavailable.')   ;   RETURN 
     62      END IF 
    9563 
    96 # if defined   key_dynspg_exp   ||   defined key_dynspg_ts 
    97    !!---------------------------------------------------------------------- 
    98    !!   'key_dynspg_exp'        OR              explicit sea surface height 
    99    !!   'key_dynspg_ts '                  split-explicit sea surface height 
    100    !!---------------------------------------------------------------------- 
    101     
    102 !! Option to use Flather with dynspg_flt not coded yet... 
     64      ll_dyn2d = .true. 
     65      ll_dyn3d = .true. 
    10366 
    104    SUBROUTINE bdy_dyn_fla( pssh ) 
    105       !!---------------------------------------------------------------------- 
    106       !!                 ***  SUBROUTINE bdy_dyn_fla  *** 
    107       !!              
    108       !!              - Apply Flather boundary conditions on normal barotropic velocities  
    109       !!                (ln_dyn_fla=.true. or ln_tides=.true.) 
    110       !! 
    111       !! ** WARNINGS about FLATHER implementation: 
    112       !!1. According to Palma and Matano, 1998 "after ssh" is used.  
    113       !!   In ROMS and POM implementations, it is "now ssh". In the current  
    114       !!   implementation (tested only in the EEL-R5 conf.), both cases were unstable.  
    115       !!   So I use "before ssh" in the following. 
    116       !! 
    117       !!2. We assume that the normal ssh gradient at the bdy is zero. As a matter of  
    118       !!   fact, the model ssh just inside the dynamical boundary is used (the outside   
    119       !!   ssh in the code is not updated). 
    120       !! 
    121       !! References:  Flather, R. A., 1976: A tidal model of the northwest European 
    122       !!              continental shelf. Mem. Soc. R. Sci. Liege, Ser. 6,10, 141-164.      
    123       !!---------------------------------------------------------------------- 
    124       REAL(wp), DIMENSION(jpi,jpj), INTENT(in) ::   pssh 
     67      IF( PRESENT(dyn3d_only) ) THEN 
     68         IF( dyn3d_only ) ll_dyn2d = .false. 
     69      ENDIF 
    12570 
    126       INTEGER  ::   jb, igrd                         ! dummy loop indices 
    127       INTEGER  ::   ii, ij, iim1, iip1, ijm1, ijp1   ! 2D addresses 
    128       REAL(wp) ::   zcorr                            ! Flather correction 
    129       REAL(wp) ::   zforc                            ! temporary scalar 
    130       !!---------------------------------------------------------------------- 
     71      !------------------------------------------------------- 
     72      ! Set pointers 
     73      !------------------------------------------------------- 
    13174 
    132       ! ---------------------------------! 
    133       ! Flather boundary conditions     :! 
    134       ! ---------------------------------!  
    135       
    136       IF(ln_dyn_fla .OR. ln_tides) THEN ! If these are both false, then this routine does nothing.  
     75      pssh => sshn 
     76      phur => hur 
     77      phvr => hvr 
     78      pu2d => wrk_2d_7 
     79      pv2d => wrk_2d_8 
    13780 
    138          ! Fill temporary array with ssh data (here spgu): 
    139          igrd = 4 
    140          spgu(:,:) = 0.0 
    141          DO jb = 1, nblenrim(igrd) 
    142             ii = nbi(jb,igrd) 
    143             ij = nbj(jb,igrd) 
    144             IF( ln_dyn_fla ) spgu(ii, ij) = sshbdy(jb) 
    145             IF( ln_tides )   spgu(ii, ij) = spgu(ii, ij) + sshtide(jb) 
    146          END DO 
    147          ! 
    148          igrd = 5      ! Flather bc on u-velocity;  
    149          !             ! remember that flagu=-1 if normal velocity direction is outward 
    150          !             ! I think we should rather use after ssh ? 
    151          DO jb = 1, nblenrim(igrd) 
    152             ii  = nbi(jb,igrd) 
    153             ij  = nbj(jb,igrd)  
    154             iim1 = ii + MAX( 0, INT( flagu(jb) ) )   ! T pts i-indice inside the boundary 
    155             iip1 = ii - MIN( 0, INT( flagu(jb) ) )   ! T pts i-indice outside the boundary  
    156             ! 
    157             zcorr = - flagu(jb) * SQRT( grav * hur_e(ii, ij) ) * ( pssh(iim1, ij) - spgu(iip1,ij) ) 
    158             zforc = ubtbdy(jb) + utide(jb) 
    159             ua_e(ii,ij) = zforc + zcorr * umask(ii,ij,1)  
    160          END DO 
    161          ! 
    162          igrd = 6      ! Flather bc on v-velocity 
    163          !             ! remember that flagv=-1 if normal velocity direction is outward 
    164          DO jb = 1, nblenrim(igrd) 
    165             ii  = nbi(jb,igrd) 
    166             ij  = nbj(jb,igrd)  
    167             ijm1 = ij + MAX( 0, INT( flagv(jb) ) )   ! T pts j-indice inside the boundary 
    168             ijp1 = ij - MIN( 0, INT( flagv(jb) ) )   ! T pts j-indice outside the boundary  
    169             ! 
    170             zcorr = - flagv(jb) * SQRT( grav * hvr_e(ii, ij) ) * ( pssh(ii, ijm1) - spgu(ii,ijp1) ) 
    171             zforc = vbtbdy(jb) + vtide(jb) 
    172             va_e(ii,ij) = zforc + zcorr * vmask(ii,ij,1) 
    173          END DO 
    174          CALL lbc_lnk( ua_e, 'U', -1. )   ! Boundary points should be updated 
    175          CALL lbc_lnk( va_e, 'V', -1. )   ! 
    176          ! 
    177       ENDIF ! ln_dyn_fla .or. ln_tides 
    178       ! 
    179    END SUBROUTINE bdy_dyn_fla 
    180 #endif 
     81      !------------------------------------------------------- 
     82      ! Split velocities into barotropic and baroclinic parts 
     83      !------------------------------------------------------- 
     84 
     85      pu2d(:,:) = 0.e0 
     86      pv2d(:,:) = 0.e0 
     87      DO jk = 1, jpkm1   !! Vertically integrated momentum trends 
     88          pu2d(:,:) = pu2d(:,:) + fse3u(:,:,jk) * umask(:,:,jk) * ua(:,:,jk) 
     89          pv2d(:,:) = pv2d(:,:) + fse3v(:,:,jk) * vmask(:,:,jk) * va(:,:,jk) 
     90      END DO 
     91      pu2d(:,:) = pu2d(:,:) * phur(:,:) 
     92      pv2d(:,:) = pv2d(:,:) * phvr(:,:) 
     93      DO jk = 1 , jpkm1 
     94         ua(:,:,jk) = ua(:,:,jk) - pu2d(:,:) 
     95         va(:,:,jk) = va(:,:,jk) - pv2d(:,:) 
     96      END DO 
     97 
     98      !------------------------------------------------------- 
     99      ! Apply boundary conditions to barotropic and baroclinic 
     100      ! parts separately 
     101      !------------------------------------------------------- 
     102 
     103      IF( ll_dyn2d ) CALL bdy_dyn2d( kt ) 
     104 
     105      IF( ll_dyn3d ) CALL bdy_dyn3d( kt ) 
     106 
     107      !------------------------------------------------------- 
     108      ! Recombine velocities 
     109      !------------------------------------------------------- 
     110 
     111      DO jk = 1 , jpkm1 
     112         ua(:,:,jk) = ( ua(:,:,jk) + pu2d(:,:) ) * umask(:,:,jk) 
     113         va(:,:,jk) = ( va(:,:,jk) + pv2d(:,:) ) * vmask(:,:,jk) 
     114      END DO 
     115 
     116      IF(wrk_not_released(2, 7,8) )    CALL ctl_stop('bdy_dyn: ERROR: failed to release workspace arrays.') 
     117 
     118   END SUBROUTINE bdy_dyn 
    181119 
    182120#else 
     
    185123   !!---------------------------------------------------------------------- 
    186124CONTAINS 
    187    SUBROUTINE bdy_dyn_frs( kt )      ! Empty routine 
    188       WRITE(*,*) 'bdy_dyn_frs: You should not have seen this print! error?', kt 
    189    END SUBROUTINE bdy_dyn_frs 
    190    SUBROUTINE bdy_dyn_fla( pssh )    ! Empty routine 
    191       REAL :: pssh(:,:) 
    192       WRITE(*,*) 'bdy_dyn_fla: You should not have seen this print! error?', pssh(1,1) 
    193    END SUBROUTINE bdy_dyn_fla 
     125   SUBROUTINE bdy_dyn( kt )      ! Empty routine 
     126      WRITE(*,*) 'bdy_dyn: You should not have seen this print! error?', kt 
     127   END SUBROUTINE bdy_dyn 
    194128#endif 
    195129 
  • branches/2011/dev_NEMO_MERGE_2011/NEMOGCM/NEMO/OPA_SRC/BDY/bdyini.F90

    r2715 r3116  
    1010   !!            3.3  !  2010-09  (E.O'Dea) updates for Shelf configurations 
    1111   !!            3.3  !  2010-09  (D.Storkey) add ice boundary conditions 
     12   !!            3.4  !  2011     (D. Storkey, J. Chanut) OBC-BDY merge 
     13   !!                 !  --- Renamed bdyini.F90 -> bdyini.F90 --- 
    1214   !!---------------------------------------------------------------------- 
    1315#if defined key_bdy 
     
    1921   USE oce             ! ocean dynamics and tracers variables 
    2022   USE dom_oce         ! ocean space and time domain 
    21    USE obc_par         ! ocean open boundary conditions 
    2223   USE bdy_oce         ! unstructured open boundary conditions 
    23    USE bdydta, ONLY: bdy_dta_alloc ! open boundary data 
    24    USE bdytides        ! tides at open boundaries initialization (tide_init routine) 
    2524   USE in_out_manager  ! I/O units 
    2625   USE lbclnk          ! ocean lateral boundary conditions (or mpp link) 
     
    5251      !! ** Input   :  bdy_init.nc, input file for unstructured open boundaries 
    5352      !!----------------------------------------------------------------------       
    54       INTEGER  ::   ii, ij, ik, igrd, ib, ir   ! dummy loop indices 
    55       INTEGER  ::   icount, icountr, ib_len, ibr_max   ! local integers 
    56       INTEGER  ::   iw, ie, is, in, inum, id_dummy     !   -       - 
    57       INTEGER  ::   igrd_start, igrd_end               !   -       - 
    58       REAL(wp) ::   zefl, zwfl, znfl, zsfl              ! local scalars 
    59       INTEGER, DIMENSION (2)             ::   kdimsz 
    60       INTEGER, DIMENSION(jpbdta, jpbgrd) ::   nbidta, nbjdta   ! Index arrays: i and j indices of bdy dta 
    61       INTEGER, DIMENSION(jpbdta, jpbgrd) ::   nbrdta           ! Discrete distance from rim points 
    62       REAL(wp), DIMENSION(jpidta,jpjdta) ::   zmask            ! global domain mask 
    63       REAL(wp), DIMENSION(jpbdta,1)      ::   zdta             ! temporary array  
    64       CHARACTER(LEN=80),DIMENSION(6)     ::   clfile 
     53      ! namelist variables 
     54      !------------------- 
     55      INTEGER, PARAMETER          :: jp_nseg = 100 
     56      INTEGER                     :: nbdysege, nbdysegw, nbdysegn, nbdysegs  
     57      INTEGER, DIMENSION(jp_nseg) :: jpieob, jpjedt, jpjeft 
     58      INTEGER, DIMENSION(jp_nseg) :: jpiwob, jpjwdt, jpjwft 
     59      INTEGER, DIMENSION(jp_nseg) :: jpjnob, jpindt, jpinft 
     60      INTEGER, DIMENSION(jp_nseg) :: jpjsob, jpisdt, jpisft 
     61 
     62      ! local variables 
     63      !------------------- 
     64      INTEGER  ::   ib_bdy, ii, ij, ik, igrd, ib, ir, iseg ! dummy loop indices 
     65      INTEGER  ::   icount, icountr, ibr_max, ilen1, ibm1  ! local integers 
     66      INTEGER  ::   iw, ie, is, in, inum, id_dummy         !   -       - 
     67      INTEGER  ::   igrd_start, igrd_end, jpbdta           !   -       - 
     68      INTEGER, POINTER  ::  nbi, nbj, nbr                  ! short cuts 
     69      REAL   , POINTER  ::  flagu, flagv                   !    -   - 
     70      REAL(wp) ::   zefl, zwfl, znfl, zsfl                 ! local scalars 
     71      INTEGER, DIMENSION (2)                ::   kdimsz 
     72      INTEGER, DIMENSION(jpbgrd,jp_bdy)       ::   nblendta         ! Length of index arrays  
     73      INTEGER, ALLOCATABLE, DIMENSION(:,:,:)  ::   nbidta, nbjdta   ! Index arrays: i and j indices of bdy dta 
     74      INTEGER, ALLOCATABLE, DIMENSION(:,:,:)  ::   nbrdta           ! Discrete distance from rim points 
     75      REAL(wp), DIMENSION(jpidta,jpjdta)    ::   zmask            ! global domain mask 
     76      CHARACTER(LEN=80),DIMENSION(jpbgrd)  ::   clfile 
     77      CHARACTER(LEN=1),DIMENSION(jpbgrd)   ::   cgrid 
    6578      !! 
    66       NAMELIST/nambdy/cn_mask, cn_dta_frs_T, cn_dta_frs_U, cn_dta_frs_V,   & 
    67          &            cn_dta_fla_T, cn_dta_fla_U, cn_dta_fla_V,            & 
    68          &            ln_tides, ln_clim, ln_vol, ln_mask,                  & 
    69          &            ln_dyn_fla, ln_dyn_frs, ln_tra_frs,ln_ice_frs,       & 
    70          &            nn_dtactl, nn_rimwidth, nn_volctl 
     79      NAMELIST/nambdy/ nb_bdy, ln_coords_file, cn_coords_file,             & 
     80         &             ln_mask_file, cn_mask_file, nn_dyn2d, nn_dyn2d_dta, & 
     81         &             nn_dyn3d, nn_dyn3d_dta, nn_tra, nn_tra_dta,         &   
     82#if defined key_lim2 
     83         &             nn_ice_lim2, nn_ice_lim2_dta,                       & 
     84#endif 
     85         &             ln_vol, nn_volctl,                                  & 
     86         &             nn_rimwidth, nn_dmp2d_in, nn_dmp2d_out,             & 
     87         &             nn_dmp3d_in, nn_dmp3d_out 
     88      !! 
     89      NAMELIST/nambdy_index/ nbdysege, jpieob, jpjedt, jpjeft,             & 
     90                             nbdysegw, jpiwob, jpjwdt, jpjwft,             & 
     91                             nbdysegn, jpjnob, jpindt, jpinft,             & 
     92                             nbdysegs, jpjsob, jpisdt, jpisft 
     93 
    7194      !!---------------------------------------------------------------------- 
    7295 
     96      IF( bdy_oce_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'bdy_init : unable to allocate oce arrays' ) 
     97 
    7398      IF(lwp) WRITE(numout,*) 
    74       IF(lwp) WRITE(numout,*) 'bdy_init : initialization of unstructured open boundaries' 
     99      IF(lwp) WRITE(numout,*) 'bdy_init : initialization of open boundaries' 
    75100      IF(lwp) WRITE(numout,*) '~~~~~~~~' 
    76101      ! 
    77       !                                      ! allocate bdy_oce arrays 
    78       IF( bdy_oce_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'bdy_init : unable to allocate oce arrays' ) 
    79       IF( bdy_dta_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'bdy_init : unable to allocate dta arrays' ) 
    80102 
    81103      IF( jperio /= 0 )   CALL ctl_stop( 'Cyclic or symmetric,',   & 
    82          &                               ' and unstructured open boundary condition are not compatible' ) 
    83  
    84       IF( lk_obc      )   CALL ctl_stop( 'Straight open boundaries,',   & 
    85          &                               ' and unstructured open boundaries are not compatible' ) 
    86  
    87       ! --------------------------- 
    88       REWIND( numnam )                    ! Read namelist parameters 
     104         &                               ' and general open boundary condition are not compatible' ) 
     105 
     106      cgrid= (/'t','u','v'/) 
     107 
     108      ! ----------------------------------------- 
     109      ! Initialise and read namelist parameters 
     110      ! ----------------------------------------- 
     111 
     112      nb_bdy            = 0 
     113      ln_coords_file(:) = .false. 
     114      cn_coords_file(:) = '' 
     115      ln_mask_file      = .false. 
     116      cn_mask_file(:)   = '' 
     117      nn_dyn2d(:)       = 0 
     118      nn_dyn2d_dta(:)   = -1  ! uninitialised flag 
     119      nn_dyn3d(:)       = 0 
     120      nn_dyn3d_dta(:)   = -1  ! uninitialised flag 
     121      nn_tra(:)         = 0 
     122      nn_tra_dta(:)     = -1  ! uninitialised flag 
     123#if defined key_lim2 
     124      nn_ice_lim2(:)    = 0 
     125      nn_ice_lim2_dta(:)= -1  ! uninitialised flag 
     126#endif 
     127      ln_vol            = .false. 
     128      nn_volctl         = -1  ! uninitialised flag 
     129      nn_rimwidth(:)    = -1  ! uninitialised flag 
     130      nn_dmp2d_in(:)    = -1  ! uninitialised flag 
     131      nn_dmp2d_out(:)   = -1  ! uninitialised flag 
     132      nn_dmp3d_in(:)    = -1  ! uninitialised flag 
     133      nn_dmp3d_out(:)   = -1  ! uninitialised flag 
     134 
     135      REWIND( numnam )                     
    89136      READ  ( numnam, nambdy ) 
     137 
     138      ! ----------------------------------------- 
     139      ! Check and write out namelist parameters 
     140      ! ----------------------------------------- 
    90141 
    91142      !                                   ! control prints 
    92143      IF(lwp) WRITE(numout,*) '         nambdy' 
    93144 
    94       !                                         ! check type of data used (nn_dtactl value) 
    95       IF(lwp) WRITE(numout,*) 'nn_dtactl =', nn_dtactl       
    96       IF(lwp) WRITE(numout,*) 
    97       SELECT CASE( nn_dtactl )                   !  
    98       CASE( 0 )      ;   IF(lwp) WRITE(numout,*) '      initial state used for bdy data'         
    99       CASE( 1 )      ;   IF(lwp) WRITE(numout,*) '      boundary data taken from file' 
    100       CASE DEFAULT   ;   CALL ctl_stop( 'nn_dtactl must be 0 or 1' ) 
    101       END SELECT 
    102  
    103       IF(lwp) WRITE(numout,*) 
    104       IF(lwp) WRITE(numout,*) 'Boundary rim width for the FRS nn_rimwidth = ', nn_rimwidth 
    105  
    106       IF(lwp) WRITE(numout,*) 
    107       IF(lwp) WRITE(numout,*) '      nn_volctl = ', nn_volctl 
    108  
    109       IF( ln_vol ) THEN                     ! check volume conservation (nn_volctl value) 
    110          SELECT CASE ( nn_volctl ) 
     145      IF( nb_bdy .eq. 0 ) THEN  
     146        IF(lwp) WRITE(numout,*) 'nb_bdy = 0, NO OPEN BOUNDARIES APPLIED.' 
     147      ELSE 
     148        IF(lwp) WRITE(numout,*) 'Number of open boundary sets : ',nb_bdy 
     149      ENDIF 
     150 
     151      DO ib_bdy = 1,nb_bdy 
     152        IF(lwp) WRITE(numout,*) ' '  
     153        IF(lwp) WRITE(numout,*) '------ Open boundary data set ',ib_bdy,'------'  
     154 
     155        IF( ln_coords_file(ib_bdy) ) THEN 
     156           IF(lwp) WRITE(numout,*) 'Boundary definition read from file '//TRIM(cn_coords_file(ib_bdy)) 
     157        ELSE 
     158           IF(lwp) WRITE(numout,*) 'Boundary defined in namelist.' 
     159        ENDIF 
     160        IF(lwp) WRITE(numout,*) 
     161 
     162        IF(lwp) WRITE(numout,*) 'Boundary conditions for barotropic solution:  ' 
     163        SELECT CASE( nn_dyn2d(ib_bdy) )                   
     164          CASE( 0 )      ;   IF(lwp) WRITE(numout,*) '      no open boundary condition'         
     165          CASE( 1 )      ;   IF(lwp) WRITE(numout,*) '      Flow Relaxation Scheme' 
     166          CASE( 2 )      ;   IF(lwp) WRITE(numout,*) '      Flather radiation condition' 
     167          CASE DEFAULT   ;   CALL ctl_stop( 'unrecognised value for nn_dyn2d' ) 
     168        END SELECT 
     169        IF( nn_dyn2d(ib_bdy) .gt. 0 ) THEN 
     170           SELECT CASE( nn_dyn2d_dta(ib_bdy) )                   !  
     171              CASE( 0 )      ;   IF(lwp) WRITE(numout,*) '      initial state used for bdy data'         
     172              CASE( 1 )      ;   IF(lwp) WRITE(numout,*) '      boundary data taken from file' 
     173              CASE( 2 )      ;   IF(lwp) WRITE(numout,*) '      tidal harmonic forcing taken from file' 
     174              CASE( 3 )      ;   IF(lwp) WRITE(numout,*) '      boundary data AND tidal harmonic forcing taken from files' 
     175              CASE DEFAULT   ;   CALL ctl_stop( 'nn_dyn2d_dta must be between 0 and 3' ) 
     176           END SELECT 
     177        ENDIF 
     178        IF(lwp) WRITE(numout,*) 
     179 
     180        IF(lwp) WRITE(numout,*) 'Boundary conditions for baroclinic velocities:  ' 
     181        SELECT CASE( nn_dyn3d(ib_bdy) )                   
     182          CASE( 0 )      ;   IF(lwp) WRITE(numout,*) '      no open boundary condition'         
     183          CASE( 1 )      ;   IF(lwp) WRITE(numout,*) '      Flow Relaxation Scheme' 
     184          CASE DEFAULT   ;   CALL ctl_stop( 'unrecognised value for nn_dyn3d' ) 
     185        END SELECT 
     186        IF( nn_dyn3d(ib_bdy) .gt. 0 ) THEN 
     187           SELECT CASE( nn_dyn3d_dta(ib_bdy) )                   !  
     188              CASE( 0 )      ;   IF(lwp) WRITE(numout,*) '      initial state used for bdy data'         
     189              CASE( 1 )      ;   IF(lwp) WRITE(numout,*) '      boundary data taken from file' 
     190              CASE DEFAULT   ;   CALL ctl_stop( 'nn_dyn3d_dta must be 0 or 1' ) 
     191           END SELECT 
     192        ENDIF 
     193        IF(lwp) WRITE(numout,*) 
     194 
     195        IF(lwp) WRITE(numout,*) 'Boundary conditions for temperature and salinity:  ' 
     196        SELECT CASE( nn_tra(ib_bdy) )                   
     197          CASE( 0 )      ;   IF(lwp) WRITE(numout,*) '      no open boundary condition'         
     198          CASE( 1 )      ;   IF(lwp) WRITE(numout,*) '      Flow Relaxation Scheme' 
     199          CASE DEFAULT   ;   CALL ctl_stop( 'unrecognised value for nn_tra' ) 
     200        END SELECT 
     201        IF( nn_tra(ib_bdy) .gt. 0 ) THEN 
     202           SELECT CASE( nn_tra_dta(ib_bdy) )                   !  
     203              CASE( 0 )      ;   IF(lwp) WRITE(numout,*) '      initial state used for bdy data'         
     204              CASE( 1 )      ;   IF(lwp) WRITE(numout,*) '      boundary data taken from file' 
     205              CASE DEFAULT   ;   CALL ctl_stop( 'nn_tra_dta must be 0 or 1' ) 
     206           END SELECT 
     207        ENDIF 
     208        IF(lwp) WRITE(numout,*) 
     209 
     210#if defined key_lim2 
     211        IF(lwp) WRITE(numout,*) 'Boundary conditions for sea ice:  ' 
     212        SELECT CASE( nn_ice_lim2(ib_bdy) )                   
     213          CASE( 0 )      ;   IF(lwp) WRITE(numout,*) '      no open boundary condition'         
     214          CASE( 1 )      ;   IF(lwp) WRITE(numout,*) '      Flow Relaxation Scheme' 
     215          CASE DEFAULT   ;   CALL ctl_stop( 'unrecognised value for nn_tra' ) 
     216        END SELECT 
     217        IF( nn_ice_lim2(ib_bdy) .gt. 0 ) THEN  
     218           SELECT CASE( nn_ice_lim2_dta(ib_bdy) )                   !  
     219              CASE( 0 )      ;   IF(lwp) WRITE(numout,*) '      initial state used for bdy data'         
     220              CASE( 1 )      ;   IF(lwp) WRITE(numout,*) '      boundary data taken from file' 
     221              CASE DEFAULT   ;   CALL ctl_stop( 'nn_ice_lim2_dta must be 0 or 1' ) 
     222           END SELECT 
     223        ENDIF 
     224        IF(lwp) WRITE(numout,*) 
     225#endif 
     226 
     227        IF(lwp) WRITE(numout,*) 'Boundary rim width for the FRS scheme = ', nn_rimwidth(ib_bdy) 
     228        IF(lwp) WRITE(numout,*) 
     229 
     230      ENDDO 
     231 
     232     IF( ln_vol ) THEN                     ! check volume conservation (nn_volctl value) 
     233       IF(lwp) WRITE(numout,*) 'Volume correction applied at open boundaries' 
     234       IF(lwp) WRITE(numout,*) 
     235       SELECT CASE ( nn_volctl ) 
    111236         CASE( 1 )      ;   IF(lwp) WRITE(numout,*) '      The total volume will be constant' 
    112237         CASE( 0 )      ;   IF(lwp) WRITE(numout,*) '      The total volume will vary according to the surface E-P flux' 
    113238         CASE DEFAULT   ;   CALL ctl_stop( 'nn_volctl must be 0 or 1' ) 
    114          END SELECT 
    115          IF(lwp) WRITE(numout,*) 
    116       ELSE 
    117          IF(lwp) WRITE(numout,*) 'No volume correction with unstructured open boundaries' 
    118          IF(lwp) WRITE(numout,*) 
    119       ENDIF 
    120  
    121       IF( ln_tides ) THEN 
    122         IF(lwp) WRITE(numout,*) 'Tidal harmonic forcing at unstructured open boundaries' 
    123         IF(lwp) WRITE(numout,*) 
    124       ENDIF 
    125  
    126       IF( ln_dyn_fla ) THEN 
    127         IF(lwp) WRITE(numout,*) 'Flather condition on U, V at unstructured open boundaries' 
    128         IF(lwp) WRITE(numout,*) 
    129       ENDIF 
    130  
    131       IF( ln_dyn_frs ) THEN 
    132         IF(lwp) WRITE(numout,*) 'FRS condition on U and V at unstructured open boundaries' 
    133         IF(lwp) WRITE(numout,*) 
    134       ENDIF 
    135  
    136       IF( ln_tra_frs ) THEN 
    137         IF(lwp) WRITE(numout,*) 'FRS condition on T & S fields at unstructured open boundaries' 
    138         IF(lwp) WRITE(numout,*) 
    139       ENDIF 
    140  
    141       IF( ln_ice_frs ) THEN 
    142         IF(lwp) WRITE(numout,*) 'FRS condition on ice fields at unstructured open boundaries' 
    143         IF(lwp) WRITE(numout,*) 
    144       ENDIF 
    145  
    146       IF( ln_tides )   CALL tide_init      ! Read tides namelist  
    147  
    148  
    149       ! Read arrays defining unstructured open boundaries 
     239       END SELECT 
     240       IF(lwp) WRITE(numout,*) 
     241     ELSE 
     242       IF(lwp) WRITE(numout,*) 'No volume correction applied at open boundaries' 
     243       IF(lwp) WRITE(numout,*) 
     244     ENDIF 
     245 
    150246      ! ------------------------------------------------- 
     247      ! Initialise indices arrays for open boundaries 
     248      ! ------------------------------------------------- 
     249 
     250      ! Work out global dimensions of boundary data 
     251      ! --------------------------------------------- 
     252      REWIND( numnam )                     
     253      DO ib_bdy = 1, nb_bdy 
     254 
     255         jpbdta = 1 
     256         IF( .NOT. ln_coords_file(ib_bdy) ) THEN ! Work out size of global arrays from namelist parameters 
     257  
     258            ! No REWIND here because may need to read more than one nambdy_index namelist. 
     259            READ  ( numnam, nambdy_index ) 
     260 
     261            ! Automatic boundary definition: if nbdysegX = -1 
     262            ! set boundary to whole side of model domain. 
     263            IF( nbdysege == -1 ) THEN 
     264               nbdysege = 1 
     265               jpieob(1) = jpiglo - 1 
     266               jpjedt(1) = 2 
     267               jpjeft(1) = jpjglo - 1 
     268            ENDIF 
     269            IF( nbdysegw == -1 ) THEN 
     270               nbdysegw = 1 
     271               jpiwob(1) = 2 
     272               jpjwdt(1) = 2 
     273               jpjwft(1) = jpjglo - 1 
     274            ENDIF 
     275            IF( nbdysegn == -1 ) THEN 
     276               nbdysegn = 1 
     277               jpjnob(1) = jpjglo - 1 
     278               jpindt(1) = 2 
     279               jpinft(1) = jpiglo - 1 
     280            ENDIF 
     281            IF( nbdysegs == -1 ) THEN 
     282               nbdysegs = 1 
     283               jpjsob(1) = 2 
     284               jpisdt(1) = 2 
     285               jpisft(1) = jpiglo - 1 
     286            ENDIF 
     287 
     288            nblendta(:,ib_bdy) = 0 
     289            DO iseg = 1, nbdysege 
     290               igrd = 1 
     291               nblendta(igrd,ib_bdy) = nblendta(igrd,ib_bdy) + jpjeft(iseg) - jpjedt(iseg) + 1                
     292               igrd = 2 
     293               nblendta(igrd,ib_bdy) = nblendta(igrd,ib_bdy) + jpjeft(iseg) - jpjedt(iseg) + 1                
     294               igrd = 3 
     295               nblendta(igrd,ib_bdy) = nblendta(igrd,ib_bdy) + jpjeft(iseg) - jpjedt(iseg)                
     296            ENDDO 
     297            DO iseg = 1, nbdysegw 
     298               igrd = 1 
     299               nblendta(igrd,ib_bdy) = nblendta(igrd,ib_bdy) + jpjwft(iseg) - jpjwdt(iseg) + 1                
     300               igrd = 2 
     301               nblendta(igrd,ib_bdy) = nblendta(igrd,ib_bdy) + jpjwft(iseg) - jpjwdt(iseg) + 1                
     302               igrd = 3 
     303               nblendta(igrd,ib_bdy) = nblendta(igrd,ib_bdy) + jpjwft(iseg) - jpjwdt(iseg)                
     304            ENDDO 
     305            DO iseg = 1, nbdysegn 
     306               igrd = 1 
     307               nblendta(igrd,ib_bdy) = nblendta(igrd,ib_bdy) + jpinft(iseg) - jpindt(iseg) + 1                
     308               igrd = 2 
     309               nblendta(igrd,ib_bdy) = nblendta(igrd,ib_bdy) + jpinft(iseg) - jpindt(iseg)                
     310               igrd = 3 
     311               nblendta(igrd,ib_bdy) = nblendta(igrd,ib_bdy) + jpinft(iseg) - jpindt(iseg) + 1 
     312            ENDDO 
     313            DO iseg = 1, nbdysegs 
     314               igrd = 1 
     315               nblendta(igrd,ib_bdy) = nblendta(igrd,ib_bdy) + jpisft(iseg) - jpisdt(iseg) + 1                
     316               igrd = 2 
     317               nblendta(igrd,ib_bdy) = nblendta(igrd,ib_bdy) + jpisft(iseg) - jpisdt(iseg) 
     318               igrd = 3 
     319               nblendta(igrd,ib_bdy) = nblendta(igrd,ib_bdy) + jpisft(iseg) - jpisdt(iseg) + 1                
     320            ENDDO 
     321 
     322            nblendta(:,ib_bdy) = nblendta(:,ib_bdy) * nn_rimwidth(ib_bdy) 
     323            jpbdta = MAXVAL(nblendta(:,ib_bdy))                
     324 
     325 
     326         ELSE            ! Read size of arrays in boundary coordinates file. 
     327 
     328 
     329            CALL iom_open( cn_coords_file(ib_bdy), inum ) 
     330            jpbdta = 1 
     331            DO igrd = 1, jpbgrd 
     332               id_dummy = iom_varid( inum, 'nbi'//cgrid(igrd), kdimsz=kdimsz )   
     333               nblendta(igrd,ib_bdy) = kdimsz(1) 
     334               jpbdta = MAX(jpbdta, kdimsz(1)) 
     335            ENDDO 
     336 
     337         ENDIF  
     338 
     339      ENDDO ! ib_bdy 
     340 
     341      ! Allocate arrays 
     342      !--------------- 
     343      ALLOCATE( nbidta(jpbdta, jpbgrd, nb_bdy), nbjdta(jpbdta, jpbgrd, nb_bdy),    & 
     344         &      nbrdta(jpbdta, jpbgrd, nb_bdy) ) 
     345 
     346      ALLOCATE( dta_global(jpbdta, 1, jpk) ) 
     347 
     348      ! Calculate global boundary index arrays or read in from file 
     349      !------------------------------------------------------------ 
     350      REWIND( numnam )                     
     351      DO ib_bdy = 1, nb_bdy 
     352 
     353         IF( .NOT. ln_coords_file(ib_bdy) ) THEN ! Calculate global index arrays from namelist parameters 
     354 
     355            ! No REWIND here because may need to read more than one nambdy_index namelist. 
     356            READ  ( numnam, nambdy_index ) 
     357 
     358            ! Automatic boundary definition: if nbdysegX = -1 
     359            ! set boundary to whole side of model domain. 
     360            IF( nbdysege == -1 ) THEN 
     361               nbdysege = 1 
     362               jpieob(1) = jpiglo - 1 
     363               jpjedt(1) = 2 
     364               jpjeft(1) = jpjglo - 1 
     365            ENDIF 
     366            IF( nbdysegw == -1 ) THEN 
     367               nbdysegw = 1 
     368               jpiwob(1) = 2 
     369               jpjwdt(1) = 2 
     370               jpjwft(1) = jpjglo - 1 
     371            ENDIF 
     372            IF( nbdysegn == -1 ) THEN 
     373               nbdysegn = 1 
     374               jpjnob(1) = jpjglo - 1 
     375               jpindt(1) = 2 
     376               jpinft(1) = jpiglo - 1 
     377            ENDIF 
     378            IF( nbdysegs == -1 ) THEN 
     379               nbdysegs = 1 
     380               jpjsob(1) = 2 
     381               jpisdt(1) = 2 
     382               jpisft(1) = jpiglo - 1 
     383            ENDIF 
     384 
     385            ! ------------ T points ------------- 
     386            igrd = 1   
     387            icount = 0 
     388            DO ir = 1, nn_rimwidth(ib_bdy) 
     389               ! east 
     390               DO iseg = 1, nbdysege 
     391                  DO ij = jpjedt(iseg), jpjeft(iseg) 
     392                     icount = icount + 1 
     393                     nbidta(icount, igrd, ib_bdy) = jpieob(iseg) - ir + 1 
     394                     nbjdta(icount, igrd, ib_bdy) = ij 
     395                     nbrdta(icount, igrd, ib_bdy) = ir 
     396                  ENDDO 
     397               ENDDO 
     398               ! west 
     399               DO iseg = 1, nbdysegw 
     400                  DO ij = jpjwdt(iseg), jpjwft(iseg) 
     401                     icount = icount + 1 
     402                     nbidta(icount, igrd, ib_bdy) = jpiwob(iseg) + ir - 1 
     403                     nbjdta(icount, igrd, ib_bdy) = ij 
     404                     nbrdta(icount, igrd, ib_bdy) = ir 
     405                  ENDDO 
     406               ENDDO 
     407               ! north 
     408               DO iseg = 1, nbdysegn 
     409                  DO ii = jpindt(iseg), jpinft(iseg) 
     410                     icount = icount + 1 
     411                     nbidta(icount, igrd, ib_bdy) = ii 
     412                     nbjdta(icount, igrd, ib_bdy) = jpjnob(iseg) - ir + 1 
     413                     nbrdta(icount, igrd, ib_bdy) = ir 
     414                  ENDDO 
     415               ENDDO 
     416               ! south 
     417               DO iseg = 1, nbdysegs 
     418                  DO ii = jpisdt(iseg), jpisft(iseg) 
     419                     icount = icount + 1 
     420                     nbidta(icount, igrd, ib_bdy) = ii 
     421                     nbjdta(icount, igrd, ib_bdy) = jpjsob(iseg) + ir + 1 
     422                     nbrdta(icount, igrd, ib_bdy) = ir 
     423                  ENDDO 
     424               ENDDO 
     425            ENDDO 
     426 
     427            ! ------------ U points ------------- 
     428            igrd = 2   
     429            icount = 0 
     430            DO ir = 1, nn_rimwidth(ib_bdy) 
     431               ! east 
     432               DO iseg = 1, nbdysege 
     433                  DO ij = jpjedt(iseg), jpjeft(iseg) 
     434                     icount = icount + 1 
     435                     nbidta(icount, igrd, ib_bdy) = jpieob(iseg) - ir 
     436                     nbjdta(icount, igrd, ib_bdy) = ij 
     437                     nbrdta(icount, igrd, ib_bdy) = ir 
     438                  ENDDO 
     439               ENDDO 
     440               ! west 
     441               DO iseg = 1, nbdysegw 
     442                  DO ij = jpjwdt(iseg), jpjwft(iseg) 
     443                     icount = icount + 1 
     444                     nbidta(icount, igrd, ib_bdy) = jpiwob(iseg) + ir - 1 
     445                     nbjdta(icount, igrd, ib_bdy) = ij 
     446                     nbrdta(icount, igrd, ib_bdy) = ir 
     447                  ENDDO 
     448               ENDDO 
     449               ! north 
     450               DO iseg = 1, nbdysegn 
     451                  DO ii = jpindt(iseg), jpinft(iseg) - 1 
     452                     icount = icount + 1 
     453                     nbidta(icount, igrd, ib_bdy) = ii 
     454                     nbjdta(icount, igrd, ib_bdy) = jpjnob(iseg) - ir + 1 
     455                     nbrdta(icount, igrd, ib_bdy) = ir 
     456                  ENDDO 
     457               ENDDO 
     458               ! south 
     459               DO iseg = 1, nbdysegs 
     460                  DO ii = jpisdt(iseg), jpisft(iseg) - 1 
     461                     icount = icount + 1 
     462                     nbidta(icount, igrd, ib_bdy) = ii 
     463                     nbjdta(icount, igrd, ib_bdy) = jpjsob(iseg) + ir + 1 
     464                     nbrdta(icount, igrd, ib_bdy) = ir 
     465                  ENDDO 
     466               ENDDO 
     467            ENDDO 
     468 
     469            ! ------------ V points ------------- 
     470            igrd = 3   
     471            icount = 0 
     472            DO ir = 1, nn_rimwidth(ib_bdy) 
     473               ! east 
     474               DO iseg = 1, nbdysege 
     475                  DO ij = jpjedt(iseg), jpjeft(iseg) - 1 
     476                     icount = icount + 1 
     477                     nbidta(icount, igrd, ib_bdy) = jpieob(iseg) - ir + 1 
     478                     nbjdta(icount, igrd, ib_bdy) = ij 
     479                     nbrdta(icount, igrd, ib_bdy) = ir 
     480                  ENDDO 
     481               ENDDO 
     482               ! west 
     483               DO iseg = 1, nbdysegw 
     484                  DO ij = jpjwdt(iseg), jpjwft(iseg) - 1 
     485                     icount = icount + 1 
     486                     nbidta(icount, igrd, ib_bdy) = jpiwob(iseg) + ir - 1 
     487                     nbjdta(icount, igrd, ib_bdy) = ij 
     488                     nbrdta(icount, igrd, ib_bdy) = ir 
     489                  ENDDO 
     490               ENDDO 
     491               ! north 
     492               DO iseg = 1, nbdysegn 
     493                  DO ii = jpindt(iseg), jpinft(iseg) 
     494                     icount = icount + 1 
     495                     nbidta(icount, igrd, ib_bdy) = ii 
     496                     nbjdta(icount, igrd, ib_bdy) = jpjnob(iseg) - ir 
     497                     nbrdta(icount, igrd, ib_bdy) = ir 
     498                  ENDDO 
     499               ENDDO 
     500               ! south 
     501               DO iseg = 1, nbdysegs 
     502                  DO ii = jpisdt(iseg), jpisft(iseg) 
     503                     icount = icount + 1 
     504                     nbidta(icount, igrd, ib_bdy) = ii 
     505                     nbjdta(icount, igrd, ib_bdy) = jpjsob(iseg) + ir + 1 
     506                     nbrdta(icount, igrd, ib_bdy) = ir 
     507                  ENDDO 
     508               ENDDO 
     509            ENDDO 
     510 
     511         ELSE            ! Read global index arrays from boundary coordinates file. 
     512 
     513            DO igrd = 1, jpbgrd 
     514               CALL iom_get( inum, jpdom_unknown, 'nbi'//cgrid(igrd), dta_global(1:nblendta(igrd,ib_bdy),:,1) ) 
     515               DO ii = 1,nblendta(igrd,ib_bdy) 
     516                  nbidta(ii,igrd,ib_bdy) = INT( dta_global(ii,1,1) ) 
     517               END DO 
     518               CALL iom_get( inum, jpdom_unknown, 'nbj'//cgrid(igrd), dta_global(1:nblendta(igrd,ib_bdy),:,1) ) 
     519               DO ii = 1,nblendta(igrd,ib_bdy) 
     520                  nbjdta(ii,igrd,ib_bdy) = INT( dta_global(ii,1,1) ) 
     521               END DO 
     522               CALL iom_get( inum, jpdom_unknown, 'nbr'//cgrid(igrd), dta_global(1:nblendta(igrd,ib_bdy),:,1) ) 
     523               DO ii = 1,nblendta(igrd,ib_bdy) 
     524                  nbrdta(ii,igrd,ib_bdy) = INT( dta_global(ii,1,1) ) 
     525               END DO 
     526 
     527               ibr_max = MAXVAL( nbrdta(:,igrd,ib_bdy) ) 
     528               IF(lwp) WRITE(numout,*) 
     529               IF(lwp) WRITE(numout,*) ' Maximum rimwidth in file is ', ibr_max 
     530               IF(lwp) WRITE(numout,*) ' nn_rimwidth from namelist is ', nn_rimwidth(ib_bdy) 
     531               IF (ibr_max < nn_rimwidth(ib_bdy))   & 
     532                     CALL ctl_stop( 'nn_rimwidth is larger than maximum rimwidth in file',cn_coords_file(ib_bdy) ) 
     533 
     534            END DO 
     535            CALL iom_close( inum ) 
     536 
     537         ENDIF  
     538 
     539      ENDDO  
     540 
     541      ! Work out dimensions of boundary data on each processor 
     542      ! ------------------------------------------------------ 
     543      
     544      iw = mig(1) + 1            ! if monotasking and no zoom, iw=2 
     545      ie = mig(1) + nlci-1 - 1   ! if monotasking and no zoom, ie=jpim1 
     546      is = mjg(1) + 1            ! if monotasking and no zoom, is=2 
     547      in = mjg(1) + nlcj-1 - 1   ! if monotasking and no zoom, in=jpjm1 
     548 
     549      DO ib_bdy = 1, nb_bdy 
     550         DO igrd = 1, jpbgrd 
     551            icount  = 0