Index: branches/2011/dev_r2787_PISCES_improvment/NEMOGCM/CONFIG/ORCA2_LIM_PISCES/EXP00/namelist_pisces
===================================================================
--- branches/2011/dev_r2787_PISCES_improvment/NEMOGCM/CONFIG/ORCA2_LIM_PISCES/EXP00/namelist_pisces	(revision 2822)
+++ branches/2011/dev_r2787_PISCES_improvment/NEMOGCM/CONFIG/ORCA2_LIM_PISCES/EXP00/namelist_pisces	(revision 2823)
@@ -15,14 +15,26 @@
 &nampisext     !   air-sea exchange
 !,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
-   atcco2     = 287.    ! atmospheric pCO2
+   ln_co2int  =  .false. ! read atm pco2 from a file (T) or constant (F)
+   atcco2     =  287.    ! Constant value atmospheric pCO2 - ln_co2int = F
+   clname     =  'atcco2.txt'  ! Name of atm pCO2 file - ln_co2int = T
+   nn_offset  =  0       ! Offset model-data start year - ln_co2int = T
+!                        ! If your model year is iyy, nn_offset=(years(1)-iyy) 
+!                        ! then the first atmospheric CO2 record read is at years(1)
+/
+!'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
+&nampisatm     !  Atmospheric prrssure 
+!,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
+!              !  file name   ! frequency (hours) ! variable   ! time interp. !  clim  ! 'yearly'/ ! weights  ! rotation !
+!              !              !  (if <0  months)  !   name     !   (logical)  !  (T/F) ! 'monthly' ! filename ! pairing  !
+   sn_patm     = 'presatm'    ,     -1            , 'patm'     ,  .true.      , .true. ,   'yearly'  , ''       , ''
+   cn_dir      = './'      !  root directory for the location of the dynamical files
 /
 !'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
 &nampisbio     !   biological parameters
 !,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
-   part       =  0.85    ! part of calcite not dissolved in guts
    nrdttrc    =  1       ! time step frequency for biology
    wsbio      =  2.      ! POC sinking speed
    xkmort     =  1.E-7   ! half saturation constant for mortality
-   ferat3     =  3.E-6   ! Fe/C in zooplankton 
+   ferat3     =  10.E-6  ! Fe/C in zooplankton 
    wsbio2     =  30.     ! Big particles sinking speed
 /
@@ -31,27 +43,32 @@
 !,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
    conc0      =  2.e-6    ! Phosphate half saturation
-   conc1      =  10E-6    ! Phosphate half saturation for diatoms
-   conc2      =  0.01E-9  ! Iron half saturation for phyto
-   conc2m     =  0.08E-9  ! Max iron half saturation for phyto
-   conc3      =  0.1E-9   ! Iron half saturation for diatoms
-   conc3m     =  0.4E-9   ! Maxi iron half saturation for diatoms
+   conc1      =  8E-6     ! Phosphate half saturation for diatoms
+   conc2      =  1E-9     ! Iron half saturation for phyto
+   conc2m     =  3E-9     ! Max iron half saturation for phyto
+   conc3      =  2E-9     ! Iron half saturation for diatoms
+   conc3m     =  8E-9     ! Maxi iron half saturation for diatoms
    concnnh4   =  1.E-7    ! NH4 half saturation for phyto
-   concdnh4   =  5.E-7    ! NH4 half saturation for diatoms
+   concdnh4   =  4.E-7    ! NH4 half saturation for diatoms
    xksi1      =  2.E-6    ! half saturation constant for Si uptake
    xksi2      =  3.33E-6  ! half saturation constant for Si/C
    xkdoc      =  417.E-6  ! half-saturation constant of DOC remineralization
-   caco3r     =  0.15     ! mean rain ratio
+   concfebac  =  3.E-11   ! Half-saturation for Fe limitation of Bacteria
+   qnfelim    =  7.E-6    ! Optimal quota of phyto
+   qdfelim    =  7.E-6    ! Optimal quota of diatoms
+   caco3r     =  0.16     ! mean rain ratio
 /
 !'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
 &nampisprod     !   parameters for phytoplankton growth
 !,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
-   pislope    =  3.       ! P-I slope  
-   pislope2   =  3.       ! P-I slope  for diatoms
+   pislope    =  2.       ! P-I slope
+   pislope2   =  2.       ! P-I slope  for diatoms
    excret     =  0.05     ! excretion ratio of phytoplankton
    excret2    =  0.05     ! excretion ratio of diatoms
+   bresp      =  0.00333  ! Basal respiration rate
    chlcnm     =  0.033    ! Minimum Chl/C in nanophytoplankton
-   chlcdm     =  0.05     ! Minimum Chl/C in diatoms
-   fecnm      =  10E-6    ! Maximum Fe/C in nanophytoplankton
-   fecdm      =  15E-6    ! Minimum Fe/C in diatoms
+   chlcdm     =  0.04     ! Minimum Chl/C in diatoms
+   chlcmin    =  0.0033   ! Maximum Chl/c in phytoplankton
+   fecnm      =  40E-6    ! Maximum Fe/C in nanophytoplankton
+   fecdm      =  40E-6    ! Minimum Fe/C in diatoms
    grosip     =  0.151    ! mean Si/C ratio
 /
@@ -68,28 +85,32 @@
 &nampismes     !   parameters for mesozooplankton
 !,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
-   grazrat2   =  0.7      ! maximal mesozoo grazing rate
+   part2      =  0.75    ! part of calcite not dissolved in mesozoo guts
+   grazrat2   =  0.9      ! maximal mesozoo grazing rate
    resrat2    =  0.005    ! exsudation rate of mesozooplankton
-   mzrat2     =  0.03     ! mesozooplankton mortality rate
+   mzrat2     =  0.04     ! mesozooplankton mortality rate
    xprefc     =  1.       ! zoo preference for phyto
-   xprefp     =  0.2      ! zoo preference for POC
+   xprefp     =  0.3      ! zoo preference for POC
    xprefz     =  1.       ! zoo preference for zoo
-   xprefpoc   =  0.2      ! zoo preference for poc
+   xprefpoc   =  0.3      ! zoo preference for poc
+   xthresh2   =  2E-7     ! Food threshold for grazing
    xkgraz2    =  20.E-6   ! half sturation constant for meso grazing
-   epsher2    =  0.33     ! Efficicency of Mesozoo growth 
+   epsher2    =  0.3      ! Efficicency of Mesozoo growth
    sigma2     =  0.6      ! Fraction of mesozoo excretion as DOM
    unass2     =  0.3      ! non assimilated fraction of P by mesozoo
-   grazflux   =  5.e3     ! flux-feeding rate
+   grazflux   =  3.e3     ! flux-feeding rate
 /
 !'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
 &nampiszoo     !   parameters for microzooplankton
 !,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
-   grazrat    =  4.0      ! maximal zoo grazing rate   
+   part       =  0.5     ! part of calcite not dissolved in microzoo gutsa
+   grazrat    =  3.0      ! maximal zoo grazing rate
    resrat     =  0.03     ! exsudation rate of zooplankton
    mzrat      =  0.0      ! zooplankton mortality rate
-   xpref2c    =  0.1      ! Microzoo preference for POM 
-   xpref2p    =  0.45     ! Microzoo preference for Nanophyto
-   xpref2d    =  0.45     ! Microzoo preference for Diatoms
-   xkgraz     =  20.E-6   ! half sturation constant for grazing 
-   epsher     =  0.33     ! Efficiency of microzoo growth
+   xpref2c    =  0.2      ! Microzoo preference for POM
+   xpref2p    =  1.       ! Microzoo preference for Nanophyto
+   xpref2d    =  0.6      ! Microzoo preference for Diatoms
+   xthresh    =  2E-7     ! Food threshold for feeding
+   xkgraz     =  20.E-6   ! half sturation constant for grazing
+   epsher     =  0.3      ! Efficiency of microzoo growth
    sigma1     =  0.6      ! Fraction of microzoo excretion as DOM
    unass      =  0.3      ! non assimilated fraction of phyto by zoo
@@ -98,15 +119,18 @@
 &nampisrem     !   parameters for remineralization
 !,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
-   xremik    =  0.3       ! remineralization rate of DOC
+   xremik    =  0.25      ! remineralization rate of DOC
    xremip    =  0.025     ! remineralisation rate of POC
    nitrif    =  0.05      ! NH4 nitrification rate
-   xsirem    =  0.015     ! remineralization rate of Si
+   xsirem    =  0.003     ! remineralization rate of Si
+   xsiremlab =  0.025     ! fast remineralization rate of Si
+   xsilab    =  0.31      ! Fraction of labile biogenic silica
    xlam1     =  0.005     ! scavenging rate of Iron
-   oxymin    =  1.E-6     ! Half-saturation constant for anoxia 
+   oxymin    =  1.E-6     ! Half-saturation constant for anoxia
+   ligand    =  0.6E-9    ! Ligands concentration
 /
 !'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
 &nampiscal     !   parameters for Calcite chemistry
 !,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
-   kdca       =  0.327e3  ! calcite dissolution rate constant (1/time)
+   kdca       =  6.       ! calcite dissolution rate constant (1/time)
    nca        =  1.       ! order of dissolution reaction (dimensionless)
 /
@@ -114,10 +138,23 @@
 &nampissed     !   parameters for inputs deposition
 !,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
-   ln_dustfer  =  .true.   ! boolean for dust input from the atmosphere
-   ln_river    =  .true.  ! boolean for river input of nutrients
+!              !  file name        ! frequency (hours) ! variable   ! time interp. !  clim  ! 'yearly'/ ! weights  ! rotation !
+!              !                   !  (if <0  months)  !   name     !   (logical)  !  (T/F) ! 'monthly' ! filename ! pairing  !
+   sn_dust     = 'dust.orca'       ,     -1            , 'dust'     ,  .true.      , .true. ,   'yearly'  , ''       , ''
+   sn_riverdic = 'river.orca'      ,    -12            , 'riverdic' ,  .false.     , .true. ,   'yearly'  , ''       , ''
+   sn_riverdoc = 'river.orca'      ,    -12            , 'riverdoc' ,  .false.     , .true. ,   'yearly'  , ''       , ''
+   sn_ndepo    = 'ndeposition.orca',    -12            , 'ndep'     ,  .false.     , .true. ,   'yearly'  , ''       , ''
+   sn_ironsed  = 'bathy.orca'      ,    -12            , 'bathy'    ,  .false.     , .true. ,   'yearly'  , ''       , ''
+!
+   cn_dir      = './'      !  root directory for the location of the dynamical files
+   ln_dust     =  .true.   ! boolean for dust input from the atmosphere
+   ln_river    =  .false.   ! boolean for river input of nutrients
    ln_ndepo    =  .true.   ! boolean for atmospheric deposition of N
-   ln_sedinput =  .true.   ! boolean for Fe input from sediments
+   ln_ironsed  =  .true.   ! boolean for Fe input from sediments
    sedfeinput  =  1E-9     ! Coastal release of Iron
-   dustsolub   =  0.014    ! Solubility of the dust
+   dustsolub   =  0.02     ! Solubility of the dust
+   wdust       =  2.0      ! Dust sinking speed
+   nitrfix     =  1E-7     ! Nitrogen fixation rate
+   diazolight  =  50.      ! Diazotrophs sensitivity to light (W/m2)
+   concfediaz  =  1.E-10   ! Diazotrophs half-saturation Cste for Iron
 /
 !'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
@@ -140,8 +177,7 @@
 /
 !'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
-&nampisdia     !   additional 2D/3D tracers diagnostics ("key_trc_diaadd")
+&nampisdia     !   additional 2D/3D tracers diagnostics 
 !,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
    nn_writedia  =  5475   !  time step frequency for tracers diagnostics
-!
 !              !    name   !           title of the field          !     units      !
 !              !           !                                       !                !  
Index: branches/2011/dev_r2787_PISCES_improvment/NEMOGCM/CONFIG/ORCA2_OFF_PISCES/EXP00/namelist_pisces
===================================================================
--- branches/2011/dev_r2787_PISCES_improvment/NEMOGCM/CONFIG/ORCA2_OFF_PISCES/EXP00/namelist_pisces	(revision 2822)
+++ branches/2011/dev_r2787_PISCES_improvment/NEMOGCM/CONFIG/ORCA2_OFF_PISCES/EXP00/namelist_pisces	(revision 2823)
@@ -15,14 +15,26 @@
 &nampisext     !   air-sea exchange
 !,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
-   atcco2     = 287.    ! atmospheric pCO2
+   ln_co2int  =  .false. ! read atm pco2 from a file (T) or constant (F)
+   atcco2     =  287.    ! Constant value atmospheric pCO2 - ln_co2int = F
+   clname     =  'atcco2.txt'  ! Name of atm pCO2 file - ln_co2int = T
+   nn_offset  =  0       ! Offset model-data start year - ln_co2int = T
+!                        ! If your model year is iyy, nn_offset=(years(1)-iyy) 
+!                        ! then the first atmospheric CO2 record read is at years(1)
+/
+!'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
+&nampisatm     !  Atmospheric prrssure 
+!,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
+!              !  file name   ! frequency (hours) ! variable   ! time interp. !  clim  ! 'yearly'/ ! weights  ! rotation !
+!              !              !  (if <0  months)  !   name     !   (logical)  !  (T/F) ! 'monthly' ! filename ! pairing  !
+   sn_patm     = 'presatm'    ,     -1            , 'patm'     ,  .true.      , .true. ,   'yearly'  , ''       , ''
+   cn_dir      = './'      !  root directory for the location of the dynamical files
 /
 !'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
 &nampisbio     !   biological parameters
 !,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
-   part       =  0.85    ! part of calcite not dissolved in guts
    nrdttrc    =  4       ! time step frequency for biology
    wsbio      =  2.      ! POC sinking speed
    xkmort     =  1.E-7   ! half saturation constant for mortality
-   ferat3     =  3.E-6   ! Fe/C in zooplankton 
+   ferat3     =  10.E-6  ! Fe/C in zooplankton 
    wsbio2     =  30.     ! Big particles sinking speed
 /
@@ -31,27 +43,32 @@
 !,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
    conc0      =  2.e-6    ! Phosphate half saturation
-   conc1      =  10E-6    ! Phosphate half saturation for diatoms
-   conc2      =  0.01E-9  ! Iron half saturation for phyto
-   conc2m     =  0.08E-9  ! Max iron half saturation for phyto
-   conc3      =  0.1E-9   ! Iron half saturation for diatoms
-   conc3m     =  0.4E-9   ! Maxi iron half saturation for diatoms
+   conc1      =  8E-6     ! Phosphate half saturation for diatoms
+   conc2      =  1E-9     ! Iron half saturation for phyto
+   conc2m     =  3E-9     ! Max iron half saturation for phyto
+   conc3      =  2E-9     ! Iron half saturation for diatoms
+   conc3m     =  8E-9     ! Maxi iron half saturation for diatoms
    concnnh4   =  1.E-7    ! NH4 half saturation for phyto
-   concdnh4   =  5.E-7    ! NH4 half saturation for diatoms
+   concdnh4   =  4.E-7    ! NH4 half saturation for diatoms
    xksi1      =  2.E-6    ! half saturation constant for Si uptake
    xksi2      =  3.33E-6  ! half saturation constant for Si/C
    xkdoc      =  417.E-6  ! half-saturation constant of DOC remineralization
-   caco3r     =  0.15     ! mean rain ratio
+   concfebac  =  3.E-11   ! Half-saturation for Fe limitation of Bacteria
+   qnfelim    =  7.E-6    ! Optimal quota of phyto
+   qdfelim    =  7.E-6    ! Optimal quota of diatoms
+   caco3r     =  0.16     ! mean rain ratio
 /
 !'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
 &nampisprod     !   parameters for phytoplankton growth
 !,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
-   pislope    =  3.       ! P-I slope  
-   pislope2   =  3.       ! P-I slope  for diatoms
+   pislope    =  2.       ! P-I slope
+   pislope2   =  2.       ! P-I slope  for diatoms
    excret     =  0.05     ! excretion ratio of phytoplankton
    excret2    =  0.05     ! excretion ratio of diatoms
+   bresp      =  0.00333  ! Basal respiration rate
    chlcnm     =  0.033    ! Minimum Chl/C in nanophytoplankton
-   chlcdm     =  0.05     ! Minimum Chl/C in diatoms
-   fecnm      =  10E-6    ! Maximum Fe/C in nanophytoplankton
-   fecdm      =  15E-6    ! Minimum Fe/C in diatoms
+   chlcdm     =  0.04     ! Minimum Chl/C in diatoms
+   chlcmin    =  0.0033   ! Maximum Chl/c in phytoplankton
+   fecnm      =  40E-6    ! Maximum Fe/C in nanophytoplankton
+   fecdm      =  40E-6    ! Minimum Fe/C in diatoms
    grosip     =  0.151    ! mean Si/C ratio
 /
@@ -68,28 +85,32 @@
 &nampismes     !   parameters for mesozooplankton
 !,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
-   grazrat2   =  0.7      ! maximal mesozoo grazing rate
+   part2      =  0.75    ! part of calcite not dissolved in mesozoo guts
+   grazrat2   =  0.9      ! maximal mesozoo grazing rate
    resrat2    =  0.005    ! exsudation rate of mesozooplankton
-   mzrat2     =  0.03     ! mesozooplankton mortality rate
+   mzrat2     =  0.04     ! mesozooplankton mortality rate
    xprefc     =  1.       ! zoo preference for phyto
-   xprefp     =  0.2      ! zoo preference for POC
+   xprefp     =  0.3      ! zoo preference for POC
    xprefz     =  1.       ! zoo preference for zoo
-   xprefpoc   =  0.2      ! zoo preference for poc
+   xprefpoc   =  0.3      ! zoo preference for poc
+   xthresh2   =  2E-7     ! Food threshold for grazing
    xkgraz2    =  20.E-6   ! half sturation constant for meso grazing
-   epsher2    =  0.33     ! Efficicency of Mesozoo growth 
+   epsher2    =  0.3      ! Efficicency of Mesozoo growth
    sigma2     =  0.6      ! Fraction of mesozoo excretion as DOM
    unass2     =  0.3      ! non assimilated fraction of P by mesozoo
-   grazflux   =  5.e3     ! flux-feeding rate
+   grazflux   =  3.e3     ! flux-feeding rate
 /
 !'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
 &nampiszoo     !   parameters for microzooplankton
 !,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
-   grazrat    =  4.0      ! maximal zoo grazing rate   
+   part       =  0.5     ! part of calcite not dissolved in microzoo gutsa
+   grazrat    =  3.0      ! maximal zoo grazing rate
    resrat     =  0.03     ! exsudation rate of zooplankton
    mzrat      =  0.0      ! zooplankton mortality rate
-   xpref2c    =  0.1      ! Microzoo preference for POM 
-   xpref2p    =  0.45     ! Microzoo preference for Nanophyto
-   xpref2d    =  0.45     ! Microzoo preference for Diatoms
-   xkgraz     =  20.E-6   ! half sturation constant for grazing 
-   epsher     =  0.33     ! Efficiency of microzoo growth
+   xpref2c    =  0.2      ! Microzoo preference for POM
+   xpref2p    =  1.       ! Microzoo preference for Nanophyto
+   xpref2d    =  0.6      ! Microzoo preference for Diatoms
+   xthresh    =  2E-7     ! Food threshold for feeding
+   xkgraz     =  20.E-6   ! half sturation constant for grazing
+   epsher     =  0.3      ! Efficiency of microzoo growth
    sigma1     =  0.6      ! Fraction of microzoo excretion as DOM
    unass      =  0.3      ! non assimilated fraction of phyto by zoo
@@ -98,15 +119,18 @@
 &nampisrem     !   parameters for remineralization
 !,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
-   xremik    =  0.3       ! remineralization rate of DOC
+   xremik    =  0.25      ! remineralization rate of DOC
    xremip    =  0.025     ! remineralisation rate of POC
    nitrif    =  0.05      ! NH4 nitrification rate
-   xsirem    =  0.015     ! remineralization rate of Si
+   xsirem    =  0.003     ! remineralization rate of Si
+   xsiremlab =  0.025     ! fast remineralization rate of Si
+   xsilab    =  0.31      ! Fraction of labile biogenic silica
    xlam1     =  0.005     ! scavenging rate of Iron
-   oxymin    =  1.E-6     ! Half-saturation constant for anoxia 
+   oxymin    =  1.E-6     ! Half-saturation constant for anoxia
+   ligand    =  0.6E-9    ! Ligands concentration
 /
 !'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
 &nampiscal     !   parameters for Calcite chemistry
 !,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
-   kdca       =  0.327e3  ! calcite dissolution rate constant (1/time)
+   kdca       =  6.       ! calcite dissolution rate constant (1/time)
    nca        =  1.       ! order of dissolution reaction (dimensionless)
 /
@@ -114,10 +138,23 @@
 &nampissed     !   parameters for inputs deposition
 !,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
-   ln_dustfer  =  .true.   ! boolean for dust input from the atmosphere
-   ln_river    =  .true.   ! boolean for river input of nutrients
+!              !  file name        ! frequency (hours) ! variable   ! time interp. !  clim  ! 'yearly'/ ! weights  ! rotation !
+!              !                   !  (if <0  months)  !   name     !   (logical)  !  (T/F) ! 'monthly' ! filename ! pairing  !
+   sn_dust     = 'dust.orca'       ,     -1            , 'dust'     ,  .true.      , .true. ,   'yearly'  , ''       , ''
+   sn_riverdic = 'river.orca'      ,    -12            , 'riverdic' ,  .false.     , .true. ,   'yearly'  , ''       , ''
+   sn_riverdoc = 'river.orca'      ,    -12            , 'riverdoc' ,  .false.     , .true. ,   'yearly'  , ''       , ''
+   sn_ndepo    = 'ndeposition.orca',    -12            , 'ndep'     ,  .false.     , .true. ,   'yearly'  , ''       , ''
+   sn_ironsed  = 'bathy.orca'      ,    -12            , 'bathy'    ,  .false.     , .true. ,   'yearly'  , ''       , ''
+!
+   cn_dir      = './'      !  root directory for the location of the dynamical files
+   ln_dust     =  .true.   ! boolean for dust input from the atmosphere
+   ln_river    =  .false.   ! boolean for river input of nutrients
    ln_ndepo    =  .true.   ! boolean for atmospheric deposition of N
-   ln_sedinput =  .true.   ! boolean for Fe input from sediments
+   ln_ironsed  =  .true.   ! boolean for Fe input from sediments
    sedfeinput  =  1E-9     ! Coastal release of Iron
-   dustsolub   =  0.014    ! Solubility of the dust
+   dustsolub   =  0.02     ! Solubility of the dust
+   wdust       =  2.0      ! Dust sinking speed
+   nitrfix     =  1E-7     ! Nitrogen fixation rate
+   diazolight  =  50.      ! Diazotrophs sensitivity to light (W/m2)
+   concfediaz  =  1.E-10   ! Diazotrophs half-saturation Cste for Iron
 /
 !'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
@@ -140,8 +177,7 @@
 /
 !'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
-&nampisdia     !   additional 2D/3D tracers diagnostics ("key_trc_diaadd")
+&nampisdia     !   additional 2D/3D tracers diagnostics 
 !,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
    nn_writedia  =  1460   !  time step frequency for tracers diagnostics
-!
 !              !    name   !           title of the field          !     units      !
 !              !           !                                       !                !  
@@ -175,4 +211,3 @@
 !,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
    ln_pisdmp    =  .true.     !  Relaxation fo some tracers to a mean value
-   ln_pisclo    =  .false.    !  Restoring of tracer to initial value on closed sea ("key_dtatrc")
-/
+/
Index: branches/2011/dev_r2787_PISCES_improvment/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zbio.F90
===================================================================
--- branches/2011/dev_r2787_PISCES_improvment/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zbio.F90	(revision 2822)
+++ branches/2011/dev_r2787_PISCES_improvment/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zbio.F90	(revision 2823)
@@ -14,17 +14,17 @@
    !!                      compartments of PISCES
    !!----------------------------------------------------------------------
-   USE oce_trc         !
-   USE trc         ! 
-   USE sms_pisces      ! 
-   USE p4zsink         ! 
-   USE p4zopt          ! 
-   USE p4zlim          ! 
-   USE p4zprod         !
-   USE p4zmort         !
-   USE p4zmicro        ! 
-   USE p4zmeso         ! 
-   USE p4zrem          ! 
-   USE prtctl_trc
-   USE iom
+   USE oce_trc         !  shared variables between ocean and passive tracers
+   USE trc             !  passive tracers common variables 
+   USE sms_pisces      !  PISCES Source Minus Sink variables
+   USE p4zsink         !  vertical flux of particulate matter due to sinking
+   USE p4zopt          !  optical model
+   USE p4zlim          !  Co-limitations of differents nutrients
+   USE p4zprod         !  Growth rate of the 2 phyto groups
+   USE p4zmort         !  Mortality terms for phytoplankton
+   USE p4zmicro        !  Sources and sinks of microzooplankton
+   USE p4zmeso         !  Sources and sinks of mesozooplankton
+   USE p4zrem          !  Remineralisation of organic matter
+   USE prtctl_trc      !  print control for debugging
+   USE iom             !  I/O manager
   
    IMPLICIT NONE
Index: branches/2011/dev_r2787_PISCES_improvment/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zche.F90
===================================================================
--- branches/2011/dev_r2787_PISCES_improvment/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zche.F90	(revision 2822)
+++ branches/2011/dev_r2787_PISCES_improvment/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zche.F90	(revision 2823)
@@ -10,4 +10,5 @@
    !!              -   !  2006     (R. Gangsto)  modification
    !!             2.0  !  2007-12  (C. Ethe, G. Madec)  F90
+   !!                  !  2011-02  (J. Simeon, J.Orr ) update O2 solubility constants
    !!----------------------------------------------------------------------
 #if defined key_pisces
@@ -17,8 +18,8 @@
    !!   p4z_che      :  Sea water chemistry computed following OCMIP protocol
    !!----------------------------------------------------------------------
-   USE oce_trc       !
-   USE trc           !
-   USE sms_pisces    ! 
-   USE lib_mpp       ! MPP library
+   USE oce_trc       !  shared variables between ocean and passive tracers
+   USE trc           !  passive tracers common variables
+   USE sms_pisces    !  PISCES Source Minus Sink variables
+   USE lib_mpp       !  MPP library
 
    IMPLICIT NONE
@@ -32,103 +33,104 @@
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   chemc    ! Solubilities of O2 and CO2
 
-   REAL(wp) ::   salchl = 1._wp / 1.80655_wp ! conversion factor for salinity --> chlorinity (Wooster et al. 1969)
-
-   REAL(wp) ::   akcc1 = -171.9065_wp      ! coeff. for apparent solubility equilibrium
-   REAL(wp) ::   akcc2 =   -0.077993_wp    ! Millero et al. 1995 from Mucci 1983
-   REAL(wp) ::   akcc3 = 2839.319_wp       !
-   REAL(wp) ::   akcc4 =   71.595_wp       !
-   REAL(wp) ::   akcc5 =   -0.77712_wp     !
-   REAL(wp) ::   akcc6 =    0.0028426_wp   !
-   REAL(wp) ::   akcc7 =  178.34_wp        !
-   REAL(wp) ::   akcc8 =   -0.07711_wp     !
-   REAL(wp) ::   akcc9 =    0.0041249_wp   !
-
-   REAL(wp) ::   rgas  = 83.143_wp         ! universal gas constants
-   REAL(wp) ::   oxyco = 1._wp / 22.4144_wp
-
-   REAL(wp) ::   bor1 = 0.00023_wp         ! borat constants
-   REAL(wp) ::   bor2 = 1._wp / 10.82_wp
-
-   REAL(wp) ::   ca0 = -162.8301_wp
-   REAL(wp) ::   ca1 =  218.2968_wp
-   REAL(wp) ::   ca2 =   90.9241_wp
-   REAL(wp) ::   ca3 =   -1.47696_wp
-   REAL(wp) ::   ca4 =    0.025695_wp
-   REAL(wp) ::   ca5 =   -0.025225_wp
-   REAL(wp) ::   ca6 =    0.0049867_wp
-
-   REAL(wp) ::   c10 = -3670.7_wp        ! coeff. for 1. dissoc. of carbonic acid (Edmond and Gieskes, 1970)   
-   REAL(wp) ::   c11 =    62.008_wp     
-   REAL(wp) ::   c12 =    -9.7944_wp    
-   REAL(wp) ::   c13 =     0.0118_wp     
-   REAL(wp) ::   c14 =    -0.000116_wp
-
-   REAL(wp) :: &              ! coeff. for 2. dissoc. of carbonic acid (Millero, 1995)   
-      c20 = -1394.7   , &
-      c21 = -4.777    , &
-      c22 = 0.0184    , &
-      c23 = -0.000118
-
-   REAL(wp) :: &             ! constants for calculate concentrations 
-      st1  = 0.14     , &    ! for sulfate (Morris & Riley 1966)
-      st2  = 1./96.062, &
-      ks0  = 141.328  , &
-      ks1  = -4276.1  , &
-      ks2  = -23.093  , &
-      ks3  = -13856.  , &
-      ks4  = 324.57   , &
-      ks5  = -47.986  , &
-      ks6  = 35474.   , &
-      ks7  = -771.54  , &
-      ks8  = 114.723  , &
-      ks9  = -2698.   , &
-      ks10 = 1776.    , &
-      ks11 = 1.       , &
-      ks12 = -0.001005 
-
-   REAL(wp) :: &             ! constants for calculate concentrations 
-      ft1  = 0.000067   , &  ! fluorides (Dickson & Riley 1979 )
-      ft2  = 1./18.9984 , &
-      kf0  = -12.641    , &
-      kf1  = 1590.2     , &
-      kf2  = 1.525      , &
-      kf3  = 1.0        , &
-      kf4  =-0.001005
-
-   REAL(wp) :: &              ! coeff. for 1. dissoc. of boric acid (Dickson and Goyet, 1994)
-      cb0  = -8966.90, &
-      cb1  = -2890.53, &
-      cb2  = -77.942 , &
-      cb3  = 1.728   , &
-      cb4  = -0.0996 , &
-      cb5  = 148.0248, &
-      cb6  = 137.1942, &
-      cb7  = 1.62142 , &
-      cb8  = -24.4344, &
-      cb9  = -25.085 , &
-      cb10 = -0.2474 , &
-      cb11 = 0.053105
-
-   REAL(wp) :: &             ! coeff. for dissoc. of water (Dickson and Riley, 1979 )
-      cw0 = -13847.26  , &
-      cw1 = 148.9652   , &
-      cw2 = -23.6521   , &
-      cw3 = 118.67     , &
-      cw4 = -5.977     , &
-      cw5 = 1.0495     , &
-      cw6 = -0.01615
- 
-   REAL(wp) :: &              ! volumetric solubility constants for o2 in ml/l (Weiss, 1974)
-      ox0 = -58.3877   , &
-      ox1 = 85.8079    , &
-      ox2 = 23.8439    , &
-      ox3 = -0.034892  , &
-      ox4 =  0.015568  , &
-      ox5 = -0.0019387 
-
-   REAL(wp), DIMENSION(5)  :: &  ! coeff. for seawater pressure correction 
-      devk1, devk2, devk3,    &  ! (millero 95)
-      devk4, devk5
-
+   REAL(wp), PUBLIC ::   atcox  = 0.20946         ! units atm
+
+   REAL(wp) ::   salchl = 1. / 1.80655    ! conversion factor for salinity --> chlorinity (Wooster et al. 1969)
+   REAL(wp) ::   o2atm  = 1. / ( 1000. * 0.20946 )  
+
+   REAL(wp) ::   akcc1  = -171.9065       ! coeff. for apparent solubility equilibrium
+   REAL(wp) ::   akcc2  =   -0.077993     ! Millero et al. 1995 from Mucci 1983
+   REAL(wp) ::   akcc3  = 2839.319        
+   REAL(wp) ::   akcc4  =   71.595        
+   REAL(wp) ::   akcc5  =   -0.77712      
+   REAL(wp) ::   akcc6  =    0.00284263   
+   REAL(wp) ::   akcc7  =  178.34        
+   REAL(wp) ::   akcc8  =   -0.07711     
+   REAL(wp) ::   akcc9  =    0.0041249   
+
+   REAL(wp) ::   rgas   = 83.143         ! universal gas constants
+   REAL(wp) ::   oxyco  = 1. / 22.4144   ! converts from liters of an ideal gas to moles
+
+   REAL(wp) ::   bor1   = 0.00023        ! borat constants
+   REAL(wp) ::   bor2   = 1. / 10.82
+
+   REAL(wp) ::   ca0    = -162.8301      ! WEISS & PRICE 1980, units mol/(kg atm)
+   REAL(wp) ::   ca1    =  218.2968
+   REAL(wp) ::   ca2    =   90.9241
+   REAL(wp) ::   ca3    =   -1.47696
+   REAL(wp) ::   ca4    =    0.025695
+   REAL(wp) ::   ca5    =   -0.025225
+   REAL(wp) ::   ca6    =    0.0049867
+
+   REAL(wp) ::   c10    = -3670.7        ! Coeff. for 1. dissoc. of carbonic acid (Edmond and Gieskes, 1970)   
+   REAL(wp) ::   c11    =    62.008     
+   REAL(wp) ::   c12    =    -9.7944    
+   REAL(wp) ::   c13    =     0.0118     
+   REAL(wp) ::   c14    =    -0.000116
+
+   REAL(wp) ::   c20    = -1394.7       ! coeff. for 2. dissoc. of carbonic acid (Millero, 1995)   
+   REAL(wp) ::   c21    =    -4.777   
+   REAL(wp) ::   c22    =     0.0184   
+   REAL(wp) ::   c23    =    -0.000118
+
+   REAL(wp) ::   st1    =      0.14     ! constants for calculate concentrations for sulfate
+   REAL(wp) ::   st2    =  1./96.062    !  (Morris & Riley 1966)
+   REAL(wp) ::   ks0    =    141.328 
+   REAL(wp) ::   ks1    =  -4276.1  
+   REAL(wp) ::   ks2    =    -23.093
+   REAL(wp) ::   ks3    = -13856.  
+   REAL(wp) ::   ks4    =   324.57 
+   REAL(wp) ::   ks5    =   -47.986
+   REAL(wp) ::   ks6    =  35474. 
+   REAL(wp) ::   ks7    =   -771.54
+   REAL(wp) ::   ks8    =    114.723
+   REAL(wp) ::   ks9    =  -2698.  
+   REAL(wp) ::   ks10   =   1776. 
+   REAL(wp) ::   ks11   =      1.
+   REAL(wp) ::   ks12   =     -0.001005 
+
+   REAL(wp) ::   ft1    =    0.000067   ! constants for calculate concentrations for fluorides
+   REAL(wp) ::   ft2    = 1./18.9984    ! (Dickson & Riley 1979 )
+   REAL(wp) ::   kf0    =  -12.641    
+   REAL(wp) ::   kf1    = 1590.2    
+   REAL(wp) ::   kf2    =    1.525    
+   REAL(wp) ::   kf3    =    1.0     
+   REAL(wp) ::   kf4    =   -0.001005
+
+   REAL(wp) ::   cb0    = -8966.90      ! Coeff. for 1. dissoc. of boric acid 
+   REAL(wp) ::   cb1    = -2890.53      ! (Dickson and Goyet, 1994)
+   REAL(wp) ::   cb2    =   -77.942
+   REAL(wp) ::   cb3    =     1.728
+   REAL(wp) ::   cb4    =    -0.0996
+   REAL(wp) ::   cb5    =   148.0248
+   REAL(wp) ::   cb6    =   137.1942
+   REAL(wp) ::   cb7    =     1.62142
+   REAL(wp) ::   cb8    =   -24.4344
+   REAL(wp) ::   cb9    =   -25.085
+   REAL(wp) ::   cb10   =    -0.2474 
+   REAL(wp) ::   cb11   =     0.053105
+
+   REAL(wp) ::   cw0    = -13847.26     ! Coeff. for dissoc. of water (Dickson and Riley, 1979 )
+   REAL(wp) ::   cw1    =    148.9652  
+   REAL(wp) ::   cw2    =    -23.6521
+   REAL(wp) ::   cw3    =    118.67 
+   REAL(wp) ::   cw4    =     -5.977 
+   REAL(wp) ::   cw5    =      1.0495  
+   REAL(wp) ::   cw6    =     -0.01615
+
+   !                                    ! volumetric solubility constants for o2 in ml/L  
+   REAL(wp) ::   ox0    =  2.00856      ! from Table 1 for Eq 8 of Garcia and Gordon, 1992.
+   REAL(wp) ::   ox1    =  3.22400      ! corrects for moisture and fugacity, but not total atmospheric pressure
+   REAL(wp) ::   ox2    =  3.99063      !      Original PISCES code noted this was a solubility, but 
+   REAL(wp) ::   ox3    =  4.80299      ! was in fact a bunsen coefficient with units L-O2/(Lsw atm-O2)
+   REAL(wp) ::   ox4    =  9.78188e-1   ! Hence, need to divide EXP( zoxy ) by 1000, ml-O2 => L-O2
+   REAL(wp) ::   ox5    =  1.71069      ! and atcox = 0.20946 to add the 1/atm dimension.
+   REAL(wp) ::   ox6    = -6.24097e-3   
+   REAL(wp) ::   ox7    = -6.93498e-3 
+   REAL(wp) ::   ox8    = -6.90358e-3
+   REAL(wp) ::   ox9    = -4.29155e-3 
+   REAL(wp) ::   ox10   = -3.11680e-7 
+
+   REAL(wp), DIMENSION(5)  :: devk1, devk2, devk3, devk4, devk5   ! coeff. for seawater pressure correction 
+   !                                                              ! (millero 95)
    DATA devk1 / -25.5    , -15.82    , -29.48  , -25.60     , -48.76    /   
    DATA devk2 / 0.1271   , -0.0219   , 0.1622  , 0.2324     , 0.5304    /   
@@ -155,8 +157,9 @@
       !!---------------------------------------------------------------------
       INTEGER  ::   ji, jj, jk
-      REAL(wp) ::   ztkel, zsal , zqtt  , zbuf1 , zbuf2
+      REAL(wp) ::   ztkel, zt   , zt2   , zsal  , zsal2 , zbuf1 , zbuf2
+      REAL(wp) ::   ztgg , ztgg2, ztgg3 , ztgg4 , ztgg5
       REAL(wp) ::   zpres, ztc  , zcl   , zcpexp, zoxy  , zcpexp2
       REAL(wp) ::   zsqrt, ztr  , zlogt , zcek1
-      REAL(wp) ::   zlqtt, zqtt2, zsal15, zis   , zis2 , zisqrt
+      REAL(wp) ::   zis  , zis2 , zsal15, zisqrt
       REAL(wp) ::   zckb , zck1 , zck2  , zckw  , zak1 , zak2  , zakb , zaksp0, zakw
       REAL(wp) ::   zst  , zft  , zcks  , zckf  , zaksp1
@@ -171,20 +174,25 @@
             !                             ! SET ABSOLUTE TEMPERATURE
             ztkel = tsn(ji,jj,1,jp_tem) + 273.16
-            zqtt  = ztkel * 0.01
-            zqtt2 = zqtt * zqtt
-            zsal  = tsn(ji,jj,1,jp_sal) + (1.- tmask(ji,jj,1) ) * 35.
-            zlqtt = LOG( zqtt )
-
+            zt    = ztkel * 0.01
+            zt2   = zt * zt
+            zsal  = tsn(ji,jj,1,jp_sal) + ( 1.- tmask(ji,jj,1) ) * 35.
+            zsal2 = zsal * zsal
+            zlogt = LOG( zt )
             !                             ! LN(K0) OF SOLUBILITY OF CO2 (EQ. 12, WEISS, 1980)
             !                             !     AND FOR THE ATMOSPHERE FOR NON IDEAL GAS
-            zcek1 = ca0 + ca1 / zqtt + ca2 * zlqtt + ca3 * zqtt2 + zsal*( ca4 + ca5 * zqtt + ca6 * zqtt2 )
-
-            !                             ! LN(K0) OF SOLUBILITY OF O2 and N2 (EQ. 4, WEISS, 1970)
-            zoxy  = ox0 + ox1 / zqtt + ox2 * zlqtt + zsal * ( ox3 + ox4 * zqtt + ox5 * zqtt2 )
-
-            !                             ! SET SOLUBILITIES OF O2 AND CO2
-            chemc(ji,jj,1) = EXP( zcek1 ) * 1.e-6 * rhop(ji,jj,1) / 1000.
-            chemc(ji,jj,2) = EXP( zoxy  ) * oxyco
-
+            zcek1 = ca0 + ca1 / zt + ca2 * zlogt + ca3 * zt2 + zsal * ( ca4 + ca5 * zt + ca6 * zt2 )
+            !                             ! LN(K0) OF SOLUBILITY OF O2 and N2 in ml/L (EQ. 8, GARCIA AND GORDON, 1992)
+            ztgg  = LOG( ( 298.15 - tsn(ji,jj,1,jp_tem) ) / ztkel )  ! Set the GORDON & GARCIA scaled temperature
+            ztgg2 = ztgg  * ztgg
+            ztgg3 = ztgg2 * ztgg
+            ztgg4 = ztgg3 * ztgg
+            ztgg5 = ztgg4 * ztgg
+            zoxy  = ox0 + ox1 * ztgg + ox2 * ztgg2 + ox3 * ztgg3 + ox4 * ztgg4 + ox5 * ztgg5   &
+                   + zsal * ( ox6 + ox7 * ztgg + ox8 * ztgg2 + ox9 * ztgg3 ) +  ox10 * zsal2
+
+            !                             ! SET SOLUBILITIES OF O2 AND CO2 
+            chemc(ji,jj,1) = EXP( zcek1 ) * 1.e-6 * rhop(ji,jj,1) / 1000.  ! mol/(L uatm)
+            chemc(ji,jj,2) = ( EXP( zoxy  ) * o2atm ) * oxyco              ! mol/(L atm)
+            !
          END DO
       END DO
@@ -204,5 +212,4 @@
                ! SET ABSOLUTE TEMPERATURE
                ztkel   = tsn(ji,jj,jk,jp_tem) + 273.16
-               zqtt    = ztkel * 0.01
                zsal    = tsn(ji,jj,jk,jp_sal) + ( 1.-tmask(ji,jj,jk) ) * 35.
                zsqrt  = SQRT( zsal )
Index: branches/2011/dev_r2787_PISCES_improvment/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zflx.F90
===================================================================
--- branches/2011/dev_r2787_PISCES_improvment/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zflx.F90	(revision 2822)
+++ branches/2011/dev_r2787_PISCES_improvment/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zflx.F90	(revision 2823)
@@ -9,4 +9,5 @@
    !!             1.0  !  2004     (O. Aumont) modifications
    !!             2.0  !  2007-12  (C. Ethe, G. Madec)  F90
+   !!                  !  2011-02  (J. Simeon, J. Orr) Include total atm P correction 
    !!----------------------------------------------------------------------
 #if defined key_pisces
@@ -16,14 +17,15 @@
    !!   p4z_flx       :   CALCULATES GAS EXCHANGE AND CHEMISTRY AT SEA SURFACE
    !!   p4z_flx_init  :   Read the namelist
-   !!----------------------------------------------------------------------
-   USE trc
-   USE oce_trc         !
-   USE trc
-   USE sms_pisces
-   USE prtctl_trc
-   USE p4zche
-   USE iom
+   !!   p4z_patm      :   Read sfc atm pressure [atm] for each grid cell
+   !!----------------------------------------------------------------------
+   USE oce_trc                      !  shared variables between ocean and passive tracers 
+   USE trc                          !  passive tracers common variables
+   USE sms_pisces                   !  PISCES Source Minus Sink variables
+   USE p4zche                       !  Chemical model
+   USE prtctl_trc                   !  print control for debugging
+   USE iom                          !  I/O manager
+   USE fldread                      !  read input fields
 #if defined key_cpl_carbon_cycle
-   USE sbc_oce , ONLY :  atm_co2
+   USE sbc_oce, ONLY :  atm_co2     !  atmospheric pCO2               
 #endif
 
@@ -35,4 +37,18 @@
    PUBLIC   p4z_flx_alloc  
 
+   !                                      !!** Namelist  nampisext  **
+   REAL(wp)          ::  atcco2    = 278._wp       !: pre-industrial atmospheric [co2] (ppm) 	
+   LOGICAL           ::  ln_co2int = .FALSE.       !: flag to read in a file and interpolate atmospheric pco2 or not
+   CHARACTER(len=34) ::  clname    = 'atcco2.txt'  !: filename of pco2 values
+   INTEGER           ::  nn_offset = 0             !: Offset model-data start year (default = 0) 
+
+   !!  Variables related to reading atmospheric CO2 time history    
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:) :: atcco2h, years
+   INTEGER  :: nmaxrec, numco2
+
+   REAL(wp) , ALLOCATABLE, SAVE, DIMENSION(:,:)  ::  patm      ! atmospheric pressure at kt                 [N/m2]
+   TYPE(FLD), ALLOCATABLE,       DIMENSION(:)    ::  sf_patm   ! structure of input fields (file informations, fields read)
+
+
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: oce_co2   !: ocean carbon flux 
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: satmco2   !: atmospheric pco2 
@@ -41,6 +57,4 @@
    REAL(wp) ::  t_atm_co2_flx               !: global mean of atmospheric pco2
    REAL(wp) ::  area                        !: ocean surface
-   REAL(wp) ::  atcco2 = 278._wp            !: pre-industrial atmospheric [co2] (ppm) 	
-   REAL(wp) ::  atcox  = 0.20946_wp         !:
    REAL(wp) ::  xconv  = 0.01_wp / 3600._wp !: coefficients for conversion 
 
@@ -60,21 +74,26 @@
       !! ** Purpose :   CALCULATES GAS EXCHANGE AND CHEMISTRY AT SEA SURFACE
       !!
-      !! ** Method  : - ???
+      !! ** Method  : 
+      !!              - Include total atm P correction via Esbensen & Kushnir (1981) 
+      !!              - Pressure correction NOT done for key_cpl_carbon_cycle
+      !!              - Remove Wanninkhof chemical enhancement;
+      !!              - Add option for time-interpolation of atcco2.txt  
       !!---------------------------------------------------------------------
       USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
-      USE wrk_nemo, ONLY:   zkgco2 => wrk_2d_1 , zkgo2 => wrk_2d_2 , zh2co3 => wrk_2d_3 
-      USE wrk_nemo, ONLY:   zoflx  => wrk_2d_4 , zkg   => wrk_2d_5
-      USE wrk_nemo, ONLY:   zdpco2 => wrk_2d_6 , zdpo2 => wrk_2d_7
+      USE wrk_nemo, ONLY:   zkgco2 => wrk_2d_11 , zkgo2 => wrk_2d_12 , zh2co3 => wrk_2d_13 
+      USE wrk_nemo, ONLY:   zoflx  => wrk_2d_14 , zkg   => wrk_2d_15
+      USE wrk_nemo, ONLY:   zdpco2 => wrk_2d_16 , zdpo2 => wrk_2d_17
       !
       INTEGER, INTENT(in) ::   kt   !
       !
-      INTEGER  ::   ji, jj, jrorr
+      INTEGER  ::   ji, jj, jm, iind, iindm1
       REAL(wp) ::   ztc, ztc2, ztc3, zws, zkgwan
       REAL(wp) ::   zfld, zflu, zfld16, zflu16, zfact
       REAL(wp) ::   zph, zah2, zbot, zdic, zalk, zsch_o2, zalka, zsch_co2
+      REAL(wp) ::   zyr_dec, zdco2dt
       CHARACTER (len=25) :: charout
       !!---------------------------------------------------------------------
 
-      IF( wrk_in_use(2, 1,2,3,4,5,6,7) ) THEN
+      IF( wrk_in_use(2, 11,12,13,14,15,16,17) ) THEN
          CALL ctl_stop('p4z_flx: requested workspace arrays unavailable')   ;   RETURN
       ENDIF
@@ -84,10 +103,25 @@
       !     IS USED TO COMPUTE AIR-SEA FLUX OF CO2
 
+      CALL p4z_patm( kt )    ! Get sea-level pressure (E&K [1981] climatology) for use in flux calcs
+
+      IF( ln_co2int ) THEN 
+         ! Linear temporal interpolation  of atmospheric pco2.  atcco2.txt has annual values.
+         ! Caveats: First column of .txt must be in years, decimal  years preferably. 
+         ! For nn_offset, if your model year is iyy, nn_offset=(years(1)-iyy) 
+         ! then the first atmospheric CO2 record read is at years(1)
+         zyr_dec = REAL( nyear + nn_offset, wp ) + REAL( nday_year, wp ) / REAL( nyear_len(1), wp )
+         jm = 2
+         DO WHILE( jm <= nmaxrec .AND. years(jm-1) < zyr_dec .AND. years(jm) >= zyr_dec ) ;  jm = jm + 1 ;  END DO
+         iind = jm  ;   iindm1 = jm - 1
+         zdco2dt = ( atcco2h(iind) - atcco2h(iindm1) ) / ( years(iind) - years(iindm1) + rtrn )
+         atcco2  = zdco2dt * ( zyr_dec - years(iindm1) ) + atcco2h(iindm1)
+         satmco2(:,:) = atcco2 
+      ENDIF
+
 #if defined key_cpl_carbon_cycle
       satmco2(:,:) = atm_co2(:,:)
 #endif
 
-      DO jrorr = 1, 10
-
+      DO jm = 1, 10
 !CDIR NOVERRCHK
          DO jj = 1, jpj
@@ -151,6 +185,6 @@
          DO ji = 1, jpi
             ! Compute CO2 flux for the sea and air
-            zfld = satmco2(ji,jj) * tmask(ji,jj,1) * chemc(ji,jj,1) * zkgco2(ji,jj)
-            zflu = zh2co3(ji,jj) * tmask(ji,jj,1) * zkgco2(ji,jj)
+            zfld = satmco2(ji,jj) * patm(ji,jj) * tmask(ji,jj,1) * chemc(ji,jj,1) * zkgco2(ji,jj)   ! (mol/L) * (m/s)
+            zflu = zh2co3(ji,jj) * tmask(ji,jj,1) * zkgco2(ji,jj)                                   ! (mol/L) (m/s) ?
             oce_co2(ji,jj) = ( zfld - zflu ) * rfact * e1e2t(ji,jj) * tmask(ji,jj,1) * 1000.
             ! compute the trend
@@ -158,23 +192,22 @@
 
             ! Compute O2 flux 
-            zfld16 = atcox * chemc(ji,jj,2) * tmask(ji,jj,1) * zkgo2(ji,jj)
+            zfld16 = atcox * patm(ji,jj) * chemc(ji,jj,2) * tmask(ji,jj,1) * zkgo2(ji,jj)          ! (mol/L) * (m/s)
             zflu16 = trn(ji,jj,1,jpoxy) * tmask(ji,jj,1) * zkgo2(ji,jj)
             tra(ji,jj,1,jpoxy) = tra(ji,jj,1,jpoxy) + ( zfld16 - zflu16 ) / fse3t(ji,jj,1)
 
-#if defined key_diatrc 
-            ! Save diagnostics
-#  if ! defined key_iomput
+#if defined key_diatrc
+#  if defined key_iomput
+            zoflx(ji,jj) = ( zfld16 - zflu16 ) * 1000. * tmask(ji,jj,1)
+            zkg  (ji,jj) = zkgco2(ji,jj) * tmask(ji,jj,1)
+            zdpco2(ji,jj) = ( satmco2(ji,jj) * patm(ji,jj) - zh2co3(ji,jj) / ( chemc(ji,jj,1) + rtrn ) ) * tmask(ji,jj,1)
+            zdpo2 (ji,jj) = ( atcox * patm(ji,jj) - trn(ji,jj,1,jpoxy)    / ( chemc(ji,jj,2) + rtrn ) ) * tmask(ji,jj,1)
+#else
             zfact = 1. / e1e2t(ji,jj) / rfact
             trc2d(ji,jj,jp_pcs0_2d    ) = oce_co2(ji,jj) * zfact
             trc2d(ji,jj,jp_pcs0_2d + 1) = ( zfld16 - zflu16 ) * 1000. * tmask(ji,jj,1)
             trc2d(ji,jj,jp_pcs0_2d + 2) = zkgco2(ji,jj) * tmask(ji,jj,1)
-            trc2d(ji,jj,jp_pcs0_2d + 3) = ( satmco2(ji,jj) - zh2co3(ji,jj) / ( chemc(ji,jj,1) + rtrn ) ) &
+            trc2d(ji,jj,jp_pcs0_2d + 3) = ( satmco2(ji,jj)  * patm(ji,jj) - zh2co3(ji,jj) / ( chemc(ji,jj,1) + rtrn ) ) &
                &                            * tmask(ji,jj,1)
-#  else
-            zoflx(ji,jj) = ( zfld16 - zflu16 ) * 1000. * tmask(ji,jj,1)
-            zkg  (ji,jj) = zkgco2(ji,jj) * tmask(ji,jj,1)
-            zdpco2(ji,jj) = ( satmco2(ji,jj) - zh2co3(ji,jj) / ( chemc(ji,jj,1) + rtrn ) ) * tmask(ji,jj,1)
-            zdpo2 (ji,jj) = ( atcox  - trn(ji,jj,1,jpoxy) / ( chemc(ji,jj,2) + rtrn ) ) * tmask(ji,jj,1)
-#  endif
+#endif
 #endif
          END DO
@@ -183,5 +216,5 @@
       t_oce_co2_flx = t_oce_co2_flx + glob_sum( oce_co2(:,:) )                     ! Cumulative Total Flux of Carbon
       IF( kt == nitend ) THEN
-         t_atm_co2_flx = glob_sum( satmco2(:,:) * e1e2t(:,:) )            ! Total atmospheric pCO2
+         t_atm_co2_flx = glob_sum( satmco2(:,:) * patm(:,:) * e1e2t(:,:) )            ! Total atmospheric pCO2
          !
          t_oce_co2_flx = (-1.) * t_oce_co2_flx  * 12. / 1.e15                      ! Conversion in PgC ; negative for out of the ocean
@@ -213,5 +246,6 @@
 #endif
       !
-      IF( wrk_not_released(2, 1,2,3,4,5,6,7) )   CALL ctl_stop('p4z_flx: failed to release workspace arrays')
+      IF( wrk_not_released(2, 11,12,13,14,15,16,17) )  &
+        &             CALL ctl_stop('p4z_flx: failed to release workspace arrays')
       !
    END SUBROUTINE p4z_flx
@@ -228,9 +262,10 @@
       !! ** input   :   Namelist nampisext
       !!----------------------------------------------------------------------
-      NAMELIST/nampisext/ atcco2
-      !!----------------------------------------------------------------------
-      !
-      REWIND( numnat )                     ! read numnat
-      READ  ( numnat, nampisext )
+      NAMELIST/nampisext/ln_co2int, atcco2, clname, nn_offset
+      INTEGER :: jm
+      !!----------------------------------------------------------------------
+      !
+      REWIND( numnatp )                     ! read numnatp
+      READ  ( numnatp, nampisext )
       !
       IF(lwp) THEN                         ! control print
@@ -238,5 +273,35 @@
          WRITE(numout,*) ' Namelist parameters for air-sea exchange, nampisext'
          WRITE(numout,*) ' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'
-         WRITE(numout,*) '    Atmospheric pCO2      atcco2      =', atcco2
+         WRITE(numout,*) '    Choice for reading in the atm pCO2 file or constant value, ln_co2int =', ln_co2int
+         WRITE(numout,*) ' '
+      ENDIF
+      IF( .NOT.ln_co2int ) THEN
+         IF(lwp) THEN                         ! control print
+            WRITE(numout,*) '    Constant Atmospheric pCO2 value  atcco2    =', atcco2
+            WRITE(numout,*) ' '
+         ENDIF
+         satmco2(:,:)  = atcco2      ! Initialisation of atmospheric pco2
+      ELSE
+         IF(lwp)  THEN
+            WRITE(numout,*) '    Atmospheric pCO2 value  from file clname      =', TRIM( clname )
+            WRITE(numout,*) '    Offset model-data start year      nn_offset   =', nn_offset
+            WRITE(numout,*) ' '
+         ENDIF
+         CALL ctl_opn( numco2, TRIM( clname) , 'OLD', 'FORMATTED', 'SEQUENTIAL', -1 , numout, lwp )
+         jm = 0                      ! Count the number of record in co2 file
+         DO
+           READ(numco2,*,END=100) 
+           jm = jm + 1
+         END DO
+ 100     nmaxrec = jm - 1 
+         ALLOCATE( years  (nmaxrec) )     ;      years  (:) = 0._wp
+         ALLOCATE( atcco2h(nmaxrec) )     ;      atcco2h(:) = 0._wp
+
+         REWIND(numco2)
+         DO jm = 1, nmaxrec          ! get  xCO2 data
+            READ(numco2, *)  years(jm), atcco2h(jm)
+            IF(lwp) WRITE(numout, '(f6.0,f7.2)')  years(jm), atcco2h(jm)
+         END DO
+         CLOSE(numco2)
       ENDIF
       !
@@ -245,10 +310,52 @@
       oce_co2(:,:)  = 0._wp                ! Initialization of Flux of Carbon
       t_atm_co2_flx = 0._wp
-      !
-      satmco2(:,:)  = atcco2      ! Initialisation of atmospheric pco2
       t_oce_co2_flx = 0._wp
       !
    END SUBROUTINE p4z_flx_init
 
+   SUBROUTINE p4z_patm( kt )
+
+      !!----------------------------------------------------------------------
+      !!                  ***  ROUTINE p4z_atm  ***
+      !!
+      !! ** Purpose :   Read and interpolate the external atmospheric sea-levl pressure
+      !! ** Method  :   Read the files and interpolate the appropriate variables
+      !!
+      !!----------------------------------------------------------------------
+      !! * arguments
+      INTEGER, INTENT( in  ) ::   kt   ! ocean time step
+      !
+      INTEGER            ::  ierr
+      CHARACTER(len=100) ::  cn_dir   ! Root directory for location of ssr files
+      TYPE(FLD_N)        ::  sn_patm  ! informations about the fields to be read
+      !!
+      NAMELIST/nampisatm/ sn_patm, cn_dir
+
+      !                                         ! -------------------- !
+      IF( kt == nit000 ) THEN                   ! First call kt=nit000 !
+         !                                      ! -------------------- !
+         !                                            !* set file information (default values)
+         ! ... default values (NB: frequency positive => hours, negative => months)
+         !            !   file   ! frequency !  variable  ! time intep !  clim   ! 'yearly' or ! weights  ! rotation !
+         !            !   name   !  (hours)  !   name     !   (T/F)    !  (T/F)  !  'monthly'  ! filename ! pairs    !
+         sn_patm = FLD_N( 'pres'  ,    24     ,  'patm'    ,  .false.   , .true.  ,   'yearly'  , ''       , ''       )
+         cn_dir  = './'          ! directory in which the Patm data are 
+
+         REWIND( numnatp )                             !* read in namlist nampisatm
+         READ  ( numnatp, nampisatm ) 
+         !
+         ALLOCATE( sf_patm(1), STAT=ierr )           !* allocate and fill sf_patm (forcing structure) with sn_patm
+         IF( ierr > 0 )   CALL ctl_stop( 'STOP', 'p4z_flx: unable to allocate sf_patm structure' )
+         !
+         CALL fld_fill( sf_patm, (/ sn_patm /), cn_dir, 'p4z_flx', 'Atmospheric pressure ', 'nampisatm' )
+                                ALLOCATE( sf_patm(1)%fnow(jpi,jpj,1)   )
+         IF( sn_patm%ln_tint )  ALLOCATE( sf_patm(1)%fdta(jpi,jpj,1,2) )
+         !
+      ENDIF
+      !
+      CALL fld_read( kt, 1, sf_patm )               !* input Patm provided at kt + 1/2
+      patm(:,:) = sf_patm(1)%fnow(:,:,1)                        ! atmospheric pressure
+
+   END SUBROUTINE p4z_patm
 
    INTEGER FUNCTION p4z_flx_alloc()
@@ -256,5 +363,5 @@
       !!                     ***  ROUTINE p4z_flx_alloc  ***
       !!----------------------------------------------------------------------
-      ALLOCATE( oce_co2(jpi,jpj), satmco2(jpi,jpj), STAT=p4z_flx_alloc )
+      ALLOCATE( oce_co2(jpi,jpj), satmco2(jpi,jpj), patm(jpi,jpj), STAT=p4z_flx_alloc )
       !
       IF( p4z_flx_alloc /= 0 )   CALL ctl_warn('p4z_flx_alloc : failed to allocate arrays')
Index: branches/2011/dev_r2787_PISCES_improvment/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zint.F90
===================================================================
--- branches/2011/dev_r2787_PISCES_improvment/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zint.F90	(revision 2822)
+++ branches/2011/dev_r2787_PISCES_improvment/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zint.F90	(revision 2823)
@@ -13,7 +13,7 @@
    !!   p4z_int        :  interpolation and computation of various accessory fields
    !!----------------------------------------------------------------------
-   USE oce_trc         !
-   USE trc
-   USE sms_pisces
+   USE oce_trc         !  shared variables between ocean and passive tracers
+   USE trc             !  passive tracers common variables 
+   USE sms_pisces      !  PISCES Source Minus Sink variables
 
    IMPLICIT NONE
@@ -21,8 +21,4 @@
 
    PUBLIC   p4z_int  
-   PUBLIC   p4z_int_alloc
-
-   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   tgfunc    !: Temp. dependancy of various biological rates
-   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   tgfunc2   !: Temp. dependancy of mesozooplankton rates
 
    REAL(wp) ::   xksilim = 16.5e-6_wp   ! Half-saturation constant for the Si half-saturation constant computation
@@ -44,5 +40,5 @@
       !!---------------------------------------------------------------------
       INTEGER  ::   ji, jj
-      REAL(wp) ::   zdum
+      REAL(wp) ::   zvar
       !!---------------------------------------------------------------------
 
@@ -57,6 +53,6 @@
       DO ji = 1, jpi
          DO jj = 1, jpj
-            zdum = trn(ji,jj,1,jpsil) * trn(ji,jj,1,jpsil)
-            xksimax(ji,jj) = MAX( xksimax(ji,jj), ( 1.+ 7.* zdum / ( xksilim * xksilim + zdum ) ) * 1e-6 )
+            zvar = trn(ji,jj,1,jpsil) * trn(ji,jj,1,jpsil)
+            xksimax(ji,jj) = MAX( xksimax(ji,jj), ( 1.+ 7.* zvar / ( xksilim * xksilim + zvar ) ) * 1e-6 )
          END DO
       END DO
@@ -68,15 +64,4 @@
       !
    END SUBROUTINE p4z_int
-
-
-   INTEGER FUNCTION p4z_int_alloc()
-      !!----------------------------------------------------------------------
-      !!                     ***  ROUTINE p4z_int_alloc  ***
-      !!----------------------------------------------------------------------
-      ALLOCATE( tgfunc(jpi,jpj,jpk), tgfunc2(jpi,jpj,jpk), STAT=p4z_int_alloc )
-      !
-      IF( p4z_int_alloc /= 0 )   CALL ctl_warn('p4z_int_alloc : failed to allocate arrays.')
-      !
-   END FUNCTION p4z_int_alloc
 
 #else
Index: branches/2011/dev_r2787_PISCES_improvment/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zlim.F90
===================================================================
--- branches/2011/dev_r2787_PISCES_improvment/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zlim.F90	(revision 2822)
+++ branches/2011/dev_r2787_PISCES_improvment/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zlim.F90	(revision 2823)
@@ -6,4 +6,5 @@
    !! History :   1.0  !  2004     (O. Aumont) Original code
    !!             2.0  !  2007-12  (C. Ethe, G. Madec)  F90
+   !!             3.4  !  2011-04  (O. Aumont, C. Ethe) Limitation for iron modelled in quota 
    !!----------------------------------------------------------------------
 #if defined key_pisces
@@ -14,8 +15,8 @@
    !!   p4z_lim_init   :   Read the namelist 
    !!----------------------------------------------------------------------
-   USE trc
-   USE oce_trc         !
-   USE trc         ! 
-   USE sms_pisces      ! 
+   USE oce_trc         ! Shared ocean-passive tracers variables
+   USE trc             ! Tracers defined
+   USE sms_pisces      ! PISCES variables
+   USE p4zopt          ! Optical
 
    IMPLICIT NONE
@@ -26,19 +27,27 @@
 
    !! * Shared module variables
-   REAL(wp), PUBLIC ::   &
-     conc0     = 2.e-6_wp      ,  &  !:
-     conc1     = 10.e-6_wp     ,  &  !:
-     conc2     = 2.e-11_wp     ,  &  !:
-     conc2m    = 8.E-11_wp     ,  &  !:
-     conc3     = 1.e-10_wp     ,  &  !:
-     conc3m    = 4.e-10_wp     ,  &  !:
-     concnnh4  = 1.e-7_wp      ,  &  !:
-     concdnh4  = 5.e-7_wp      ,  &  !:
-     xksi1     = 2.E-6_wp      ,  &  !:
-     xksi2     = 3.33E-6_wp    ,  &  !:
-     xkdoc     = 417.E-6_wp    ,  &  !:
-     caco3r    = 0.3_wp              !:
-
-
+   REAL(wp), PUBLIC ::  conc0     = 2.e-6_wp      !:  NO3, PO4 half saturation   
+   REAL(wp), PUBLIC ::  conc1     = 8.e-6_wp      !:  Phosphate half saturation for diatoms  
+   REAL(wp), PUBLIC ::  conc2     = 1.e-9_wp      !:  Iron half saturation for nanophyto 
+   REAL(wp), PUBLIC ::  conc2m    = 3.e-9_wp      !:  Max iron half saturation for nanophyto 
+   REAL(wp), PUBLIC ::  conc3     = 2.e-9_wp      !:  Iron half saturation for diatoms  
+   REAL(wp), PUBLIC ::  conc3m    = 8.e-9_wp      !:  Max iron half saturation for diatoms 
+   REAL(wp), PUBLIC ::  concnnh4  = 1.e-7_wp      !:  NH4 half saturation for phyto  
+   REAL(wp), PUBLIC ::  concdnh4  = 4.e-7_wp      !:  NH4 half saturation for diatoms
+   REAL(wp), PUBLIC ::  xksi1     = 2.E-6_wp      !:  half saturation constant for Si uptake 
+   REAL(wp), PUBLIC ::  xksi2     = 3.33e-6_wp    !:  half saturation constant for Si/C 
+   REAL(wp), PUBLIC ::  xkdoc     = 417.e-6_wp    !:  2nd half-sat. of DOC remineralization  
+   REAL(wp), PUBLIC ::  concfebac = 1.E-11_wp     !:  Fe half saturation for bacteria 
+   REAL(wp), PUBLIC ::  qnfelim   = 7.E-6_wp      !:  optimal Fe quota for nanophyto
+   REAL(wp), PUBLIC ::  qdfelim   = 7.E-6_wp      !:  optimal Fe quota for diatoms
+   REAL(wp), PUBLIC ::  caco3r    = 0.16_wp       !:  mean rainratio 
+
+   ! Coefficient for iron limitation
+!   REAL(wp) ::  xcoef1   = 0.0016 
+!   REAL(wp) ::  xcoef2   = 1.21E-5 * 1.5 
+!   REAL(wp) ::  xcoef3   = 1.15E-4 / 7.625 /  55.85
+   REAL(wp) ::  xcoef1   = 0.0016  / 55.85  
+   REAL(wp) ::  xcoef2   = 1.21E-5 * 14. / 55.85 / 7.625 * 0.5 * 1.5
+   REAL(wp) ::  xcoef3   = 1.15E-4 * 14. / 55.85 / 7.625 * 0.5 
    !!* Substitution
 #  include "top_substitute.h90"
@@ -60,105 +69,104 @@
       !! ** Method  : - ???
       !!---------------------------------------------------------------------
+      !
       INTEGER, INTENT(in)  :: kt
+      !
       INTEGER  ::   ji, jj, jk
       REAL(wp) ::   zlim1, zlim2, zlim3, zlim4, zno3, zferlim
-      REAL(wp) ::   zconctemp, zconctemp2, zconctempn, zconctempn2
-      REAL(wp) ::   ztemp, zdenom
+      REAL(wp) ::   zconcd, zconcd2, zconcn, zconcn2
+      REAL(wp) ::   z1_trndia, z1_trnphy, ztem1, ztem2, zetot1, zetot2
+      REAL(wp) ::   zdenom, zratio, zironmin
+      REAL(wp) ::   zconc1d, zconc1dnh4, zconc0n, zconc0nnh4   
       !!---------------------------------------------------------------------
-
-
-      !  Tuning of the iron concentration to a minimum
-      !  level that is set to the detection limit
-      !  -------------------------------------
 
       DO jk = 1, jpkm1
          DO jj = 1, jpj
             DO ji = 1, jpi
-               zno3=trn(ji,jj,jk,jpno3)
-               zferlim = MAX( 1.5e-11*(zno3/40E-6)**2, 3e-12 )
-               zferlim = MIN( zferlim, 1.5e-11 )
+               
+               ! Tuning of the iron concentration to a minimum level that is set to the detection limit
+               !-------------------------------------
+               zno3    = trn(ji,jj,jk,jpno3) / 40.e-6
+               zferlim = MAX( 2e-11 * zno3 * zno3, 5e-12 )
+               zferlim = MIN( zferlim, 3e-11 )
                trn(ji,jj,jk,jpfer) = MAX( trn(ji,jj,jk,jpfer), zferlim )
-            END DO
+
+               ! Computation of a variable Ks for iron on diatoms taking into account
+               ! that increasing biomass is made of generally bigger cells
+               !------------------------------------------------
+               zconcd   = MAX( 0.e0 , trn(ji,jj,jk,jpdia) - 5.e-7 )
+               zconcd2  = trn(ji,jj,jk,jpdia) - zconcd
+               zconcn   = MAX( 0.e0 , trn(ji,jj,jk,jpphy) - 1.e-6 )
+               zconcn2  = trn(ji,jj,jk,jpphy) - zconcn
+               z1_trnphy   = 1. / ( trn(ji,jj,jk,jpphy) + rtrn )
+               z1_trndia   = 1. / ( trn(ji,jj,jk,jpdia) + rtrn )
+
+               concdfe(ji,jj,jk) = MAX( conc3       , ( zconcd2 *      conc3    + conc3m        * zconcd ) * z1_trndia )
+               zconc1d           = MAX( 2.* conc0   , ( zconcd2 * 2. * conc0    + conc1         * zconcd ) * z1_trndia )
+               zconc1dnh4        = MAX( 2.* concnnh4, ( zconcd2 * 2. * concnnh4 + concdnh4      * zconcd ) * z1_trndia )
+
+               concnfe(ji,jj,jk) = MAX( conc2       , ( zconcn2 * conc2         + conc2m        * zconcn ) * z1_trnphy )
+               zconc0n           = MAX( conc0       , ( zconcn2 * conc0         + 2. * conc0    * zconcn ) * z1_trnphy )
+               zconc0nnh4        = MAX( concnnh4    , ( zconcn2 * concnnh4      + 2. * concnnh4 * zconcn ) * z1_trnphy )
+
+               ! Michaelis-Menten Limitation term for nutrients Small flagellates
+               ! -----------------------------------------------
+               zdenom = 1. /  ( zconc0n * zconc0nnh4 + zconc0nnh4 * trn(ji,jj,jk,jpno3) + zconc0n * trn(ji,jj,jk,jpnh4) )
+               xnanono3(ji,jj,jk) = trn(ji,jj,jk,jpno3) * zconc0nnh4 * zdenom
+               xnanonh4(ji,jj,jk) = trn(ji,jj,jk,jpnh4) * zconc0n    * zdenom
+               !
+               zlim1    = xnanono3(ji,jj,jk) + xnanonh4(ji,jj,jk)
+               zlim2    = trn(ji,jj,jk,jppo4) / ( trn(ji,jj,jk,jppo4) + zconc0nnh4 )
+               zratio   = trn(ji,jj,jk,jpnfe) * z1_trnphy 
+               zironmin = xcoef1 * trn(ji,jj,jk,jpnch) * z1_trnphy + xcoef2 * zlim1 + xcoef3 * xnanono3(ji,jj,jk)
+               zlim3    = MAX( 0.,( zratio - zironmin ) / qnfelim )
+               xlimnfe(ji,jj,jk) = MIN( 1., zlim3 )
+               xlimphy(ji,jj,jk) = MIN( zlim1, zlim2, zlim3 )
+               !
+               zlim1    = trn(ji,jj,jk,jpnh4) / ( concnnh4 + trn(ji,jj,jk,jpnh4) )
+               zlim3    = trn(ji,jj,jk,jpfer) / ( concfebac+ trn(ji,jj,jk,jpfer) )
+               zlim4    = trn(ji,jj,jk,jpdoc) / ( xkdoc   + trn(ji,jj,jk,jpdoc) )
+               xlimbac(ji,jj,jk) = MIN( zlim1, zlim2, zlim3 ) * zlim4
+
+               !   Michaelis-Menten Limitation term for nutrients Diatoms
+               !   ----------------------------------------------
+               zdenom   = 1. / ( zconc1d * zconc1dnh4 + zconc1dnh4 * trn(ji,jj,jk,jpno3) + zconc1d * trn(ji,jj,jk,jpnh4) )
+               xdiatno3(ji,jj,jk) = trn(ji,jj,jk,jpno3) * zconc1dnh4 * zdenom
+               xdiatnh4(ji,jj,jk) = trn(ji,jj,jk,jpnh4) * zconc1d    * zdenom
+               !
+               zlim1    = xdiatno3(ji,jj,jk) + xdiatnh4(ji,jj,jk)
+               zlim2    = trn(ji,jj,jk,jppo4) / ( trn(ji,jj,jk,jppo4) + zconc1dnh4  )
+               zlim3    = trn(ji,jj,jk,jpsil) / ( trn(ji,jj,jk,jpsil) + xksi(ji,jj) )
+               zratio   = trn(ji,jj,jk,jpdfe)/(trn(ji,jj,jk,jpdia)+rtrn)
+               zironmin = xcoef1 * trn(ji,jj,jk,jpdch) * z1_trndia + xcoef2 * zlim1 + xcoef3 * xdiatno3(ji,jj,jk)
+               zlim4    = MAX( 0., ( zratio - zironmin ) / qdfelim )
+               xlimdfe(ji,jj,jk) = MIN( 1., zlim4 )
+               xlimdia(ji,jj,jk) = MIN( zlim1, zlim2, zlim3, zlim4 )
+               xlimsi(ji,jj,jk)  = MIN( zlim1, zlim2, zlim4 )
+           END DO
          END DO
       END DO
 
-      !  Computation of a variable Ks for iron on diatoms taking into account
-      !  that increasing biomass is made of generally bigger cells
-      !  ------------------------------------------------
-
+      ! Compute the fraction of nanophytoplankton that is made of calcifiers
+      ! --------------------------------------------------------------------
       DO jk = 1, jpkm1
          DO jj = 1, jpj
             DO ji = 1, jpi
-               zconctemp   = MAX( 0.e0 , trn(ji,jj,jk,jpdia)-5e-7 )
-               zconctemp2  = trn(ji,jj,jk,jpdia) - zconctemp
-               zconctempn  = MAX( 0.e0 , trn(ji,jj,jk,jpphy)-1e-6 )
-               zconctempn2 = trn(ji,jj,jk,jpphy) - zconctempn
-               concdfe(ji,jj,jk) = ( zconctemp2 * conc3 + conc3m * zconctemp)   &
-                  &              / ( trn(ji,jj,jk,jpdia) + rtrn )
-               concdfe(ji,jj,jk) = MAX( conc3, concdfe(ji,jj,jk) )
-               concnfe(ji,jj,jk) = ( zconctempn2 * conc2 + conc2m * zconctempn)   &
-                  &              / ( trn(ji,jj,jk,jpphy) + rtrn )
-               concnfe(ji,jj,jk) = MAX( conc2, concnfe(ji,jj,jk) )
-            END DO
-         END DO
-      END DO
-
-     !  Michaelis-Menten Limitation term for nutrients Small flagellates
-     !      -----------------------------------------------
-      DO jk = 1, jpkm1
-         DO jj = 1, jpj
-            DO ji = 1, jpi
-              zdenom = 1. / &
-                  & ( conc0 * concnnh4 + concnnh4 * trn(ji,jj,jk,jpno3) + conc0 * trn(ji,jj,jk,jpnh4) )
-               xnanono3(ji,jj,jk) = trn(ji,jj,jk,jpno3) * concnnh4 * zdenom
-               xnanonh4(ji,jj,jk) = trn(ji,jj,jk,jpnh4) * conc0    * zdenom
-
-               zlim1 = xnanono3(ji,jj,jk) + xnanonh4(ji,jj,jk)
-               zlim2 = trn(ji,jj,jk,jppo4) / ( trn(ji,jj,jk,jppo4) + concnnh4          ) 
-               zlim3 = trn(ji,jj,jk,jpfer) / ( trn(ji,jj,jk,jpfer) + concnfe(ji,jj,jk) )
-               xlimphy(ji,jj,jk) = MIN( zlim1, zlim2, zlim3 )
-               zlim1 = trn(ji,jj,jk,jpnh4) / ( concnnh4 + trn(ji,jj,jk,jpnh4) )
-               zlim3 = trn(ji,jj,jk,jpfer) / ( conc2    + trn(ji,jj,jk,jpfer) )
-               zlim4 = trn(ji,jj,jk,jpdoc) / ( xkdoc   + trn(ji,jj,jk,jpdoc) )
-               xlimbac(ji,jj,jk) = MIN( zlim1, zlim2, zlim3 ) * zlim4
-
-            END DO
-         END DO
-      END DO
-
-      !   Michaelis-Menten Limitation term for nutrients Diatoms
-      !   ----------------------------------------------
-      DO jk = 1, jpkm1
-         DO jj = 1, jpj
-            DO ji = 1, jpi
-              zdenom = 1. / &
-                  & ( conc1 * concdnh4 + concdnh4 * trn(ji,jj,jk,jpno3) + conc1 * trn(ji,jj,jk,jpnh4) )
-
-               xdiatno3(ji,jj,jk) = trn(ji,jj,jk,jpno3) * concdnh4 * zdenom
-               xdiatnh4(ji,jj,jk) = trn(ji,jj,jk,jpnh4) * conc1    * zdenom 
-
-               zlim1 = xdiatno3(ji,jj,jk) + xdiatnh4(ji,jj,jk)
-               zlim2 = trn(ji,jj,jk,jppo4) / ( trn(ji,jj,jk,jppo4) + concdnh4          )
-               zlim3 = trn(ji,jj,jk,jpsil) / ( trn(ji,jj,jk,jpsil) + xksi   (ji,jj)    )
-               zlim4 = trn(ji,jj,jk,jpfer) / ( trn(ji,jj,jk,jpfer) + concdfe(ji,jj,jk) )
-               xlimdia(ji,jj,jk) = MIN( zlim1, zlim2, zlim3, zlim4 )
-
-            END DO
-         END DO
-      END DO
-
-
-      ! Compute the fraction of nanophytoplankton that is made of calcifiers
-      ! --------------------------------------------------------------------
-
-      DO jk = 1, jpkm1
-         DO jj = 1, jpj
-            DO ji = 1, jpi
-               ztemp = MAX( 0., tsn(ji,jj,jk,jp_tem) )
-               xfracal(ji,jj,jk) = caco3r * xlimphy(ji,jj,jk)   &
-                  &                       * MAX( 0.0001, ztemp / ( 2.+ ztemp ) )   &
-                  &                       * MAX( 1., trn(ji,jj,jk,jpphy) * 1.e6 / 2. )
+               zlim1 =  ( trn(ji,jj,jk,jpno3) * concnnh4 + trn(ji,jj,jk,jpnh4) * conc0 )    &
+                  &   / ( conc0 * concnnh4 + concnnh4 * trn(ji,jj,jk,jpno3)  + conc0 * trn(ji,jj,jk,jpnh4) ) 
+               zlim2  = trn(ji,jj,jk,jppo4) / ( trn(ji,jj,jk,jppo4) + concnnh4 )
+               zlim3  = trn(ji,jj,jk,jpfer) / ( trn(ji,jj,jk,jpfer) + concfebac )
+               ztem1  = MAX( 0., tsn(ji,jj,jk,jp_tem) )
+               ztem2  = tsn(ji,jj,jk,jp_tem) - 10.
+               zetot1 = MAX( 0., etot(ji,jj,jk) - 1.) / ( 4. + etot(ji,jj,jk) ) 
+               zetot2 = 1. / ( 30. + etot(ji,jj,jk) ) 
+
+               xfracal(ji,jj,jk) = caco3r * MIN( zlim1, zlim2, zlim3 )                  &
+                  &                       * ztem1 / ( 0.1 + ztem1 )                     &
+                  &                       * MAX( 1., trn(ji,jj,jk,jpphy) * 1.e6 / 2. )  &
+                  &                       * 2.325 * zetot1 * 30. * zetot2               &
+                  &                       * ( 1. + EXP(-ztem2 * ztem2 / 25. ) )         &
+                  &                       * MIN( 1., 50. / ( hmld(ji,jj) + rtrn ) )
                xfracal(ji,jj,jk) = MIN( 0.8 , xfracal(ji,jj,jk) )
-               xfracal(ji,jj,jk) = MAX( 0.01, xfracal(ji,jj,jk) )
+               xfracal(ji,jj,jk) = MAX( 0.02, xfracal(ji,jj,jk) )
             END DO
          END DO
@@ -182,8 +190,9 @@
 
       NAMELIST/nampislim/ conc0, conc1, conc2, conc2m, conc3, conc3m,   &
-         &             concnnh4, concdnh4, xksi1, xksi2, xkdoc, caco3r
-
-      REWIND( numnat )                     ! read numnat
-      READ  ( numnat, nampislim )
+         &                concnnh4, concdnh4, xksi1, xksi2, xkdoc,      &
+         &                concfebac, qnfelim, qdfelim, caco3r
+
+      REWIND( numnatp )                     ! read numnat
+      READ  ( numnatp, nampislim )
 
       IF(lwp) THEN                         ! control print
@@ -192,8 +201,8 @@
          WRITE(numout,*) ' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'
          WRITE(numout,*) '    mean rainratio                            caco3r    =', caco3r
-         WRITE(numout,*) '    NO3, PO4 half saturation                  conc0      =', conc0
+         WRITE(numout,*) '    NO3, PO4 half saturation                  conc0     =', conc0
          WRITE(numout,*) '    half saturation constant for Si uptake    xksi1     =', xksi1
          WRITE(numout,*) '    half saturation constant for Si/C         xksi2     =', xksi2
-         WRITE(numout,*) '    2nd half-sat. of DOC remineralization     xkdoc    =', xkdoc
+         WRITE(numout,*) '    2nd half-sat. of DOC remineralization     xkdoc     =', xkdoc
          WRITE(numout,*) '    Phosphate half saturation for diatoms     conc1     =', conc1
          WRITE(numout,*) '    Iron half saturation for phyto            conc2     =', conc2
@@ -203,4 +212,7 @@
          WRITE(numout,*) '    NH4 half saturation for phyto             concnnh4  =', concnnh4
          WRITE(numout,*) '    NH4 half saturation for diatoms           concdnh4  =', concdnh4
+         WRITE(numout,*) '    Fe half saturation for bacteria           concfebac =', concfebac
+         WRITE(numout,*) '    optimal Fe quota for nano.                qnfelim   =', qnfelim
+         WRITE(numout,*) '    Optimal Fe quota for diatoms              qdfelim   =', qdfelim
       ENDIF
 
Index: branches/2011/dev_r2787_PISCES_improvment/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zlys.F90
===================================================================
--- branches/2011/dev_r2787_PISCES_improvment/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zlys.F90	(revision 2822)
+++ branches/2011/dev_r2787_PISCES_improvment/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zlys.F90	(revision 2823)
@@ -9,4 +9,6 @@
    !!             1.0  !  2004     (O. Aumont) modifications
    !!             2.0  !  2007-12  (C. Ethe, G. Madec)  F90
+   !!                  !  2011-02  (J. Simeon, J. Orr)  Calcon salinity dependence
+   !!             3.4  !  2011-06  (O. Aumont, C. Ethe) Improvment of calcite dissolution
    !!----------------------------------------------------------------------
 #if defined key_pisces
@@ -17,10 +19,9 @@
    !!   p4z_lys_init   :   Read the namelist parameters
    !!----------------------------------------------------------------------
-   USE trc
-   USE oce_trc         !
-   USE trc
-   USE sms_pisces
-   USE prtctl_trc
-   USE iom
+   USE oce_trc         !  shared variables between ocean and passive tracers
+   USE trc             !  passive tracers common variables 
+   USE sms_pisces      !  PISCES Source Minus Sink variables
+   USE prtctl_trc      !  print control for debugging
+   USE iom             !  I/O manager
 
    IMPLICIT NONE
@@ -62,10 +63,8 @@
       INTEGER, INTENT(in) ::   kt ! ocean time step
       INTEGER  ::   ji, jj, jk, jn
-      REAL(wp) ::   zbot, zalk, zdic, zph, zremco3, zah2
-      REAL(wp) ::   zdispot, zfact, zalka
+      REAL(wp) ::   zalk, zdic, zph, zremco3, zah2
+      REAL(wp) ::   zdispot, zfact, zcalcon, zalka, zaldi
       REAL(wp) ::   zomegaca, zexcess, zexcess0
-#if defined key_diatrc && defined key_iomput
       REAL(wp) ::   zrfact2
-#endif
       CHARACTER (len=25) :: charout
       !!---------------------------------------------------------------------
@@ -91,33 +90,19 @@
 !CDIR NOVERRCHK
                DO ji = 1, jpi
-
-                  ! SET DUMMY VARIABLE FOR TOTAL BORATE
-                  zbot  = borat(ji,jj,jk)
-
-                  ! SET DUMMY VARIABLE FOR TOTAL BORATE
-                  zbot  = borat(ji,jj,jk)
-                  zfact = rhop (ji,jj,jk) / 1000. + rtrn
-
-                  ! SET DUMMY VARIABLE FOR [H+]
-                  zph   = hi(ji,jj,jk) * tmask(ji,jj,jk) / zfact + ( 1.-tmask(ji,jj,jk) ) * 1.e-9
-
-                  ! SET DUMMY VARIABLE FOR [SUM(CO2)]GIVEN 
+                  zfact = rhop(ji,jj,jk) / 1000. + rtrn
+                  zph  = hi(ji,jj,jk) * tmask(ji,jj,jk) / zfact + ( 1.-tmask(ji,jj,jk) ) * 1.e-9 ! [H+]
                   zdic  = trn(ji,jj,jk,jpdic) / zfact
                   zalka = trn(ji,jj,jk,jptal) / zfact
 
                   ! CALCULATE [ALK]([CO3--], [HCO3-])
-                  zalk  = zalka - (  akw3(ji,jj,jk) / zph - zph   &
-                     &             + zbot / (1.+ zph / akb3(ji,jj,jk) )  )
+                  zalk  = zalka - ( akw3(ji,jj,jk) / zph - zph + borat(ji,jj,jk) / ( 1. + zph / akb3(ji,jj,jk) ) )
 
                   ! CALCULATE [H+] and [CO3--]
-                  zah2 = SQRT( (zdic-zalk)*(zdic-zalk)+   &
-                     &     4.*(zalk*ak23(ji,jj,jk)/ak13(ji,jj,jk))   &
-                     &     *(2*zdic-zalk))
-
-                  zah2=0.5*ak13(ji,jj,jk)/zalk*((zdic-zalk)+zah2)
-                  zco3(ji,jj,jk) = zalk/(2.+zah2/ak23(ji,jj,jk))*zfact
-
-                  hi(ji,jj,jk)  = zah2*zfact
-
+                  zaldi = zdic - zalk
+                  zah2  = SQRT( zaldi * zaldi + 4.* ( zalk * ak23(ji,jj,jk) / ak13(ji,jj,jk) ) * ( zdic + zaldi ) )
+                  zah2  = 0.5 * ak13(ji,jj,jk) / zalk * ( zaldi + zah2 )
+                  !
+                  zco3(ji,jj,jk) = zalk / ( 2. + zah2 / ak23(ji,jj,jk) ) * zfact
+                  hi(ji,jj,jk)   = zah2 * zfact
                END DO
             END DO
@@ -137,8 +122,12 @@
 
                ! DEVIATION OF [CO3--] FROM SATURATION VALUE
-               zomegaca = ( calcon * zco3(ji,jj,jk) ) / aksp(ji,jj,jk)
+               ! Salinity dependance in zomegaca and divide by rhop/1000 to have good units
+               zcalcon  = calcon * ( tsn(ji,jj,jk,jp_sal) / 35._wp )
+               zfact    = rhop(ji,jj,jk) / 1000._wp
+               zomegaca = ( zcalcon * zco3(ji,jj,jk) * zfact ) / aksp(ji,jj,jk) 
 
                ! SET DEGREE OF UNDER-/SUPERSATURATION
-               zexcess0 = MAX( 0., ( 1.- zomegaca ) )
+               excess(ji,jj,jk) = 1._wp - zomegaca
+               zexcess0 = MAX( 0., excess(ji,jj,jk) )
                zexcess  = zexcess0**nca
 
@@ -166,18 +155,18 @@
          END DO
       END DO
-
+      !
 # if defined key_diatrc
-#  if ! defined key_iomput
-      trc3d(:,:,:,jp_pcs0_3d    ) = hi  (:,:,:)          * tmask(:,:,:)
-      trc3d(:,:,:,jp_pcs0_3d + 1) = zco3(:,:,:)          * tmask(:,:,:)
-      trc3d(:,:,:,jp_pcs0_3d + 2) = aksp(:,:,:) / calcon * tmask(:,:,:)
-#  else
-      zrfact2 = 1.e3 * rfact2r
-      CALL iom_put( "PH"    , hi      (:,:,:)           * tmask(:,:,:) )
-      CALL iom_put( "CO3"   , zco3    (:,:,:)           * tmask(:,:,:) )
-      CALL iom_put( "CO3sat", aksp    (:,:,:) / calcon  * tmask(:,:,:) )
-      CALL iom_put( "DCAL"  , zcaldiss(:,:,:) * zrfact2 * tmask(:,:,:) )
-#  endif
-# endif
+#  if defined key_iomput
+       zrfact2 = 1.e3 * rfact2r
+       CALL iom_put( "PH"    , hi      (:,:,:)           * tmask(:,:,:) )
+       CALL iom_put( "CO3"   , zco3    (:,:,:)           * tmask(:,:,:) )
+       CALL iom_put( "CO3sat", aksp    (:,:,:) / calcon  * tmask(:,:,:) )
+       CALL iom_put( "DCAL"  , zcaldiss(:,:,:) * zrfact2 * tmask(:,:,:) )
+#else
+       trc3d(:,:,:,jp_pcs0_3d    ) = hi  (:,:,:)          * tmask(:,:,:)
+       trc3d(:,:,:,jp_pcs0_3d + 1) = zco3(:,:,:)          * tmask(:,:,:)
+       trc3d(:,:,:,jp_pcs0_3d + 2) = aksp(:,:,:) / calcon * tmask(:,:,:)
+#endif
+#endif
       !
        IF(ln_ctl)   THEN  ! print mean trends (used for debugging)
@@ -207,6 +196,6 @@
       NAMELIST/nampiscal/ kdca, nca
 
-      REWIND( numnat )                     ! read numnat
-      READ  ( numnat, nampiscal )
+      REWIND( numnatp )                     ! read numnatp
+      READ  ( numnatp, nampiscal )
 
       IF(lwp) THEN                         ! control print
Index: branches/2011/dev_r2787_PISCES_improvment/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zmeso.F90
===================================================================
--- branches/2011/dev_r2787_PISCES_improvment/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zmeso.F90	(revision 2822)
+++ branches/2011/dev_r2787_PISCES_improvment/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zmeso.F90	(revision 2823)
@@ -6,4 +6,5 @@
    !! History :   1.0  !  2002     (O. Aumont) Original code
    !!             2.0  !  2007-12  (C. Ethe, G. Madec)  F90
+   !!             3.4  !  2011-06  (O. Aumont, C. Ethe) Quota model for iron
    !!----------------------------------------------------------------------
 #if defined key_pisces
@@ -14,12 +15,12 @@
    !!   p4z_meso_init  :   Initialization of the parameters for mesozooplankton
    !!----------------------------------------------------------------------
-   USE trc
-   USE oce_trc         !
-   USE trc         ! 
-   USE sms_pisces      ! 
-   USE prtctl_trc
-   USE p4zint
-   USE p4zsink
-   USE iom
+   USE oce_trc         !  shared variables between ocean and passive tracers
+   USE trc             !  passive tracers common variables 
+   USE sms_pisces      !  PISCES Source Minus Sink variables
+   USE p4zsink         !  vertical flux of particulate matter due to sinking
+   USE p4zint          !  interpolation and computation of various fields
+   USE p4zprod         !  production
+   USE prtctl_trc      !  print control for debugging
+   USE iom             !  I/O manager
 
    IMPLICIT NONE
@@ -30,18 +31,18 @@
 
    !! * Shared module variables
-   REAL(wp), PUBLIC ::   &
-      xprefc   = 1.0_wp     ,  &  !: 
-      xprefp   = 0.2_wp     ,  &  !:
-      xprefz   = 1.0_wp     ,  &  !:
-      xprefpoc = 0.0_wp     ,  &  !:
-      resrat2  = 0.005_wp   ,  &  !:
-      mzrat2   = 0.03_wp    ,  &  !:
-      grazrat2 = 0.7_wp     ,  &  !:
-      xkgraz2  = 20E-6_wp   ,  &  !:
-      unass2   = 0.3_wp     ,  &  !:
-      sigma2   = 0.6_wp     ,  &  !:
-      epsher2  = 0.33_wp    ,  &  !:   
-      grazflux = 5.E3_wp 
-
+   REAL(wp), PUBLIC ::  part2    = 0.5_wp     !: part of calcite not dissolved in mesozoo guts
+   REAL(wp), PUBLIC ::  xprefc   = 1.0_wp     !: mesozoo preference for POC 
+   REAL(wp), PUBLIC ::  xprefp   = 0.3_wp     !: mesozoo preference for nanophyto
+   REAL(wp), PUBLIC ::  xprefz   = 1.0_wp     !: mesozoo preference for diatoms
+   REAL(wp), PUBLIC ::  xprefpoc = 0.3_wp     !: mesozoo preference for POC 
+   REAL(wp), PUBLIC ::  xthresh2 = 2E-7_wp    !: feeding threshold for mesozooplankton 
+   REAL(wp), PUBLIC ::  resrat2  = 0.005_wp   !: exsudation rate of mesozooplankton
+   REAL(wp), PUBLIC ::  mzrat2   = 0.04_wp    !: microzooplankton mortality rate 
+   REAL(wp), PUBLIC ::  grazrat2 = 0.9_wp     !: maximal mesozoo grazing rate
+   REAL(wp), PUBLIC ::  xkgraz2  = 20E-6_wp   !: non assimilated fraction of P by mesozoo 
+   REAL(wp), PUBLIC ::  unass2   = 0.3_wp     !: Efficicency of mesozoo growth 
+   REAL(wp), PUBLIC ::  sigma2   = 0.6_wp     !: Fraction of mesozoo excretion as DOM 
+   REAL(wp), PUBLIC ::  epsher2  = 0.3_wp     !: half sturation constant for grazing 2
+   REAL(wp), PUBLIC ::  grazflux = 3.E3_wp    !: mesozoo flux feeding rate
 
    !!* Substitution
@@ -65,17 +66,17 @@
       INTEGER, INTENT(in) ::   kt, jnt ! ocean time step
       INTEGER  :: ji, jj, jk
-      REAL(wp) :: zcompadi, zcompaph, zcompapoc, zcompaz
-      REAL(wp) :: zfact, zcompam, zdenom, zgraze2, zstep
-      REAL(wp) :: zgrarem2, zgrafer2, zgrapoc2, zprcaca, zmortz2
+      REAL(wp) :: zcompadi, zcompaph, zcompapoc, zcompaz, zcompam
+      REAL(wp) :: zgraze2 , zdenom, zncratio
+      REAL(wp) :: zfact   , zstep, zfood, zfoodlim
+      REAL(wp) :: zepshert, zepsherv, zgrarsig, zgraztot, zgraztotf
+      REAL(wp) :: zgrarem2, zgrafer2, zgrapoc2, zprcaca, zmortz2, zgrasrat
 #if defined key_kriest
       REAL znumpoc
 #endif
-      REAL(wp) :: zrespz2,ztortz2,zgrazd,zgrazz,zgrazpof
-      REAL(wp) :: zgrazn,zgrazpoc,zgraznf,zgrazf
-      REAL(wp) :: zgrazfff,zgrazffe
+      REAL(wp) :: zrespz2, ztortz2, zgrazd, zgrazz, zgrazpof
+      REAL(wp) :: zgrazn, zgrazpoc, zgraznf, zgrazf
+      REAL(wp) :: zgrazfff, zgrazffe
       CHARACTER (len=25) :: charout
-#if defined key_diatrc && defined key_iomput
       REAL(wp) :: zrfact2
-#endif
 
       !!---------------------------------------------------------------------
@@ -84,53 +85,48 @@
          DO jj = 1, jpj
             DO ji = 1, jpi
-
-               zcompam = MAX( ( trn(ji,jj,jk,jpmes) - 1.e-9 ), 0.e0 )
+               zcompam   = MAX( ( trn(ji,jj,jk,jpmes) - 1.e-8 ), 0.e0 )
 # if defined key_degrad
-               zstep   = xstep * facvol(ji,jj,jk)
+               zstep     = xstep * facvol(ji,jj,jk)
 # else
-               zstep   = xstep
+               zstep     = xstep
 # endif
-               zfact   = zstep * tgfunc(ji,jj,jk) * zcompam
+               zfact     = zstep * tgfunc(ji,jj,jk) * zcompam
 
                !  Respiration rates of both zooplankton
                !  -------------------------------------
-               zrespz2  = resrat2 * zfact * ( 1. + 3. * nitrfac(ji,jj,jk) )        &
-                  &     * trn(ji,jj,jk,jpmes) / ( xkmort + trn(ji,jj,jk,jpmes) )
+               zrespz2   = resrat2 * zfact * trn(ji,jj,jk,jpmes) / ( xkmort + trn(ji,jj,jk,jpmes) )  &
+                  &      + resrat2 * zfact * 3. * nitrfac(ji,jj,jk)
 
                !  Zooplankton mortality. A square function has been selected with
                !  no real reason except that it seems to be more stable and may mimic predation
                !  ---------------------------------------------------------------
-               ztortz2 = mzrat2 * 1.e6 * zfact * trn(ji,jj,jk,jpmes)
+               ztortz2   = mzrat2 * 1.e6 * zfact * trn(ji,jj,jk,jpmes)
                !
 
                zcompadi  = MAX( ( trn(ji,jj,jk,jpdia) - 1.e-8 ), 0.e0 )
                zcompaz   = MAX( ( trn(ji,jj,jk,jpzoo) - 1.e-8 ), 0.e0 )
-               zcompaph  = MAX( ( trn(ji,jj,jk,jpphy) - 2.e-7 ), 0.e0 )
+               zcompaph  = MAX( ( trn(ji,jj,jk,jpphy) - 1.e-8 ), 0.e0 )
                zcompapoc = MAX( ( trn(ji,jj,jk,jppoc) - 1.e-8 ), 0.e0 )
 
-               !  Microzooplankton grazing
-               !     ------------------------
-               zdenom = 1. / (  xkgraz2 + xprefc   * trn(ji,jj,jk,jpdia)   &
-                  &                     + xprefz   * trn(ji,jj,jk,jpzoo)   &
-                  &                     + xprefp   * trn(ji,jj,jk,jpphy)   &
-                  &                     + xprefpoc * trn(ji,jj,jk,jppoc)  )
-
-               zgraze2 = grazrat2 * zstep * Tgfunc2(ji,jj,jk) * zdenom * trn(ji,jj,jk,jpmes) 
-
-               zgrazd   = zgraze2  * xprefc   * zcompadi
-               zgrazz   = zgraze2  * xprefz   * zcompaz
-               zgrazn   = zgraze2  * xprefp   * zcompaph
-               zgrazpoc = zgraze2  * xprefpoc * zcompapoc
-
-               zgraznf  = zgrazn   * trn(ji,jj,jk,jpnfe) / (trn(ji,jj,jk,jpphy) + rtrn)
-               zgrazf   = zgrazd   * trn(ji,jj,jk,jpdfe) / (trn(ji,jj,jk,jpdia) + rtrn)
-               zgrazpof = zgrazpoc * trn(ji,jj,jk,jpsfe) / (trn(ji,jj,jk,jppoc) + rtrn)
-               
+               zfood     = xprefc * zcompadi + xprefz * zcompaz + xprefp * zcompaph + xprefpoc * zcompapoc + rtrn
+               zfoodlim  = MAX( 0., zfood - xthresh2 )
+               zdenom    = zfoodlim / zfood / (xkgraz2 + zfoodlim)
+
+               zgraze2   = grazrat2 * zstep * tgfunc2(ji,jj,jk) * trn(ji,jj,jk,jpmes) * zdenom
+               zgrazd    = zgraze2  * xprefc   * zcompadi
+               zgrazz    = zgraze2  * xprefz   * zcompaz
+               zgrazn    = zgraze2  * xprefp   * zcompaph
+               zgrazpoc  = zgraze2  * xprefpoc * zcompapoc
+
+               zgraznf   = zgrazn   * trn(ji,jj,jk,jpnfe) / (trn(ji,jj,jk,jpphy) + rtrn)
+               zgrazf    = zgrazd   * trn(ji,jj,jk,jpdfe) / (trn(ji,jj,jk,jpdia) + rtrn)
+               zgrazpof  = zgrazpoc * trn(ji,jj,jk,jpsfe) / (trn(ji,jj,jk,jppoc) + rtrn)
+
                !  Mesozooplankton flux feeding on GOC
                !  ----------------------------------
 # if ! defined key_kriest
-               zgrazffe = grazflux * zstep * wsbio4(ji,jj,jk)          &
-                  &                 * tgfunc2(ji,jj,jk) * trn(ji,jj,jk,jpgoc) * trn(ji,jj,jk,jpmes)
-               zgrazfff = zgrazffe * trn(ji,jj,jk,jpbfe) / (trn(ji,jj,jk,jpgoc) + rtrn)
+               zgrazffe  = grazflux * zstep * wsbio4(ji,jj,jk)          &
+                 &                 * tgfunc2(ji,jj,jk) * trn(ji,jj,jk,jpgoc) * trn(ji,jj,jk,jpmes)
+               zgrazfff  = zgrazffe * trn(ji,jj,jk,jpbfe) / (trn(ji,jj,jk,jpgoc) + rtrn)
 # else
                !!--------------------------- KRIEST3 -------------------------------------------
@@ -143,50 +139,47 @@
                !!--------------------------- KRIEST3 -------------------------------------------
 
-              zgrazffe = grazflux * zstep * wsbio3(ji,jj,jk)     &
+              zgrazffe   = grazflux * zstep * wsbio3(ji,jj,jk)     &
                   &                * tgfunc2(ji,jj,jk) * trn(ji,jj,jk,jppoc) * trn(ji,jj,jk,jpmes)
-              zgrazfff = zgrazffe * trn(ji,jj,jk,jpsfe) / (trn(ji,jj,jk,jppoc) + rtrn)
+              zgrazfff   = zgrazffe * trn(ji,jj,jk,jpsfe) / (trn(ji,jj,jk,jppoc) + rtrn)
 # endif
-      
+              !
+              zgraztot   = zgrazd + zgrazz + zgrazn + zgrazpoc + zgrazffe
+              zgraztotf  = zgrazf + zgraznf + zgrazz * ferat3 + zgrazpof + zgrazfff 
 #if defined key_diatrc
               ! Total grazing ( grazing by microzoo is already computed in p4zmicro ) 
-              grazing(ji,jj,jk) = grazing(ji,jj,jk) + (  zgrazd + zgrazz + zgrazn + zgrazpoc + zgrazffe )
-#endif
-
+              grazing(ji,jj,jk) = grazing(ji,jj,jk) + zgraztot
+#endif
               !    Mesozooplankton efficiency
               !    --------------------------
-              zgrarem2 = ( zgrazd + zgrazz + zgrazn + zgrazpoc + zgrazffe ) * ( 1. - epsher2 - unass2 )
-#if ! defined key_kriest
-              zgrafer2 = ( zgrazf + zgraznf + zgrazz * ferat3 + zgrazpof + zgrazfff ) * ( 1.- epsher2 - unass2 ) & 
-                  &     + epsher2 * ( zgrazd   * MAX((trn(ji,jj,jk,jpdfe) / (trn(ji,jj,jk,jpdia) + rtrn)-ferat3),0.) &
-                  &                 + zgrazn   * MAX((trn(ji,jj,jk,jpnfe) / (trn(ji,jj,jk,jpphy) + rtrn)-ferat3),0.) &
-                  &                 + zgrazpoc * MAX((trn(ji,jj,jk,jpsfe) / (trn(ji,jj,jk,jppoc) + rtrn)-ferat3),0.) &
-                  &                 + zgrazffe * MAX((trn(ji,jj,jk,jpbfe) / (trn(ji,jj,jk,jpgoc) + rtrn)-ferat3),0.)  )
+              zgrasrat   =  zgraztotf / ( zgraztot + rtrn )
+              zncratio   = (  xprefc   * zcompadi * quotad(ji,jj,jk)  &
+                  &         + xprefp   * zcompaph * quotan(ji,jj,jk)  &
+                  &         + xprefz   * zcompaz                      &
+                  &         + xprefpoc * zcompapoc   ) / zfood 
+               zepshert  = epsher2 * MIN( 1., zncratio )
+               zepsherv  = zepshert * MIN( 1., zgrasrat / ferat3 )
+               zgrarem2  = zgraztot * ( 1. - zepsherv - unass2 )
+               zgrafer2  = zgraztot * MAX( 0. , ( 1. - unass2 ) * zgrasrat - ferat3 * zepshert ) 
+               zgrapoc2  = zgraztot * unass2
+
+               !   Update the arrays TRA which contain the biological sources and sinks
+               zgrarsig  = zgrarem2 * sigma2
+               tra(ji,jj,jk,jppo4) = tra(ji,jj,jk,jppo4) + zgrarsig
+               tra(ji,jj,jk,jpnh4) = tra(ji,jj,jk,jpnh4) + zgrarsig
+               tra(ji,jj,jk,jpdoc) = tra(ji,jj,jk,jpdoc) + zgrarem2 - zgrarsig
+               tra(ji,jj,jk,jpoxy) = tra(ji,jj,jk,jpoxy) - o2ut * zgrarsig
+               tra(ji,jj,jk,jpfer) = tra(ji,jj,jk,jpfer) + zgrafer2
+               tra(ji,jj,jk,jpdic) = tra(ji,jj,jk,jpdic) + zgrarsig
+               tra(ji,jj,jk,jptal) = tra(ji,jj,jk,jptal) + rno3 * zgrarsig              
+#if defined key_kriest
+               tra(ji,jj,jk,jppoc) = tra(ji,jj,jk,jppoc) + zgrapoc2
+               tra(ji,jj,jk,jpnum) = tra(ji,jj,jk,jpnum) + zgrapoc2 * xkr_dmeso
+               tra(ji,jj,jk,jpsfe) = tra(ji,jj,jk,jpsfe) + zgraztotf * unass2
 #else
-              zgrafer2 = ( zgrazf + zgraznf + zgrazz * ferat3 + zgrazpof + zgrazfff ) * ( 1. - epsher2 - unass2 ) &
-                  &    + epsher2 * ( zgrazd   * MAX((trn(ji,jj,jk,jpdfe) / (trn(ji,jj,jk,jpdia) + rtrn)-ferat3),0.) &
-                  &                + zgrazn   * MAX((trn(ji,jj,jk,jpnfe) / (trn(ji,jj,jk,jpphy) + rtrn)-ferat3),0.) &
-                  &                + zgrazpoc * MAX((trn(ji,jj,jk,jpsfe) / (trn(ji,jj,jk,jppoc) + rtrn)-ferat3),0.) &
-                  &                + zgrazffe * MAX((trn(ji,jj,jk,jpsfe) / (trn(ji,jj,jk,jppoc) + rtrn)-ferat3),0.)  )
-
-#endif
-               !   Update the arrays TRA which contain the biological sources and sinks
-
-               zgrapoc2 =  zgrazd + zgrazz  + zgrazn + zgrazpoc + zgrazffe
-
-               tra(ji,jj,jk,jppo4) = tra(ji,jj,jk,jppo4) + zgrarem2 * sigma2
-               tra(ji,jj,jk,jpnh4) = tra(ji,jj,jk,jpnh4) + zgrarem2 * sigma2
-               tra(ji,jj,jk,jpdoc) = tra(ji,jj,jk,jpdoc) + zgrarem2 * ( 1. - sigma2 )
-               tra(ji,jj,jk,jpoxy) = tra(ji,jj,jk,jpoxy) - o2ut * zgrarem2 * sigma2
-               tra(ji,jj,jk,jpfer) = tra(ji,jj,jk,jpfer) + zgrafer2
-               tra(ji,jj,jk,jpdic) = tra(ji,jj,jk,jpdic) + zgrarem2 * sigma2
-               
-#if defined key_kriest
-               tra(ji,jj,jk,jppoc) = tra(ji,jj,jk,jppoc) + zgrapoc2 * unass2
-               tra(ji,jj,jk,jpnum) = tra(ji,jj,jk,jpnum) + zgrapoc2 * unass2 * xkr_dmeso
-#else
-               tra(ji,jj,jk,jpgoc) = tra(ji,jj,jk,jpgoc) + zgrapoc2 * unass2
+               tra(ji,jj,jk,jpgoc) = tra(ji,jj,jk,jpgoc) + zgrapoc2
+               tra(ji,jj,jk,jpbfe) = tra(ji,jj,jk,jpbfe) + zgraztotf * unass2
 #endif
                zmortz2 = ztortz2 + zrespz2
-               tra(ji,jj,jk,jpmes) = tra(ji,jj,jk,jpmes) - zmortz2 + epsher2 * zgrapoc2
+               tra(ji,jj,jk,jpmes) = tra(ji,jj,jk,jpmes) - zmortz2 + zepsherv * zgraztot 
                tra(ji,jj,jk,jpdia) = tra(ji,jj,jk,jpdia) - zgrazd
                tra(ji,jj,jk,jpzoo) = tra(ji,jj,jk,jpzoo) - zgrazz
@@ -199,9 +192,10 @@
                tra(ji,jj,jk,jpdfe) = tra(ji,jj,jk,jpdfe) - zgrazf
 
-               zprcaca = xfracal(ji,jj,jk) * unass2 * zgrazn
+               zprcaca = xfracal(ji,jj,jk) * zgrazn
+               ! calcite production
 #if defined key_diatrc
                prodcal(ji,jj,jk) = prodcal(ji,jj,jk) + zprcaca  ! prodcal=prodcal(nanophy)+prodcal(microzoo)+prodcal(mesozoo)
 #endif
-               zprcaca = part * zprcaca
+               zprcaca = part2 * zprcaca
                tra(ji,jj,jk,jpdic) = tra(ji,jj,jk,jpdic) - zprcaca
                tra(ji,jj,jk,jptal) = tra(ji,jj,jk,jptal) - 2. * zprcaca
@@ -212,12 +206,10 @@
                tra(ji,jj,jk,jpnum) = tra(ji,jj,jk,jpnum) - zgrazpoc * znumpoc &
                   &    + zmortz2  * xkr_dmeso - zgrazffe * znumpoc * wsbio4(ji,jj,jk) / ( wsbio3(ji,jj,jk) + rtrn )
-               tra(ji,jj,jk,jpsfe) = tra(ji,jj,jk,jpsfe) + ferat3 * zmortz2 &
-               &       + unass2 * ( ferat3 * zgrazz + zgraznf + zgrazf + zgrazpof + zgrazfff ) - zgrazfff - zgrazpof
+               tra(ji,jj,jk,jpsfe) = tra(ji,jj,jk,jpsfe) + ferat3 * zmortz2 - zgrazfff - zgrazpof
 #else
                tra(ji,jj,jk,jppoc) = tra(ji,jj,jk,jppoc) - zgrazpoc
                tra(ji,jj,jk,jpgoc) = tra(ji,jj,jk,jpgoc) + zmortz2 - zgrazffe
                tra(ji,jj,jk,jpsfe) = tra(ji,jj,jk,jpsfe) - zgrazpof
-               tra(ji,jj,jk,jpbfe) = tra(ji,jj,jk,jpbfe) + ferat3 * zmortz2 &
-               &       + unass2 * ( ferat3 * zgrazz + zgraznf + zgrazf + zgrazpof + zgrazfff ) - zgrazfff
+               tra(ji,jj,jk,jpbfe) = tra(ji,jj,jk,jpbfe) + ferat3 * zmortz2 - zgrazfff
 #endif
 
@@ -228,19 +220,16 @@
 #if defined key_diatrc && defined key_iomput
       zrfact2 = 1.e3 * rfact2r
-      ! Total grazing of phyto by zoo
-      grazing(:,:,:) = grazing(:,:,:) * zrfact2 * tmask(:,:,:)
-      ! Calcite production
-      prodcal(:,:,:) = prodcal(:,:,:) * zrfact2 * tmask(:,:,:)
-      IF( jnt == nrdttrc ) then 
+      grazing(:,:,:) = grazing(:,:,:) * zrfact2 * tmask(:,:,:)   ! Total grazing of phyto by zoo
+      prodcal(:,:,:) = prodcal(:,:,:) * zrfact2 * tmask(:,:,:)   ! Calcite production
+      IF( jnt == nrdttrc ) THEN
          CALL iom_put( "GRAZ" , grazing  )  ! Total grazing of phyto by zooplankton
          CALL iom_put( "PCAL" , prodcal  )  ! Calcite production
       ENDIF
 #endif
-
-       IF(ln_ctl)   THEN  ! print mean trends (used for debugging)
-         WRITE(charout, FMT="('meso')")
-         CALL prt_ctl_trc_info(charout)
-         CALL prt_ctl_trc(tab4d=tra, mask=tmask, clinfo=ctrcnm)
-       ENDIF
+      IF(ln_ctl)   THEN  ! print mean trends (used for debugging)
+        WRITE(charout, FMT="('meso')")
+        CALL prt_ctl_trc_info(charout)
+        CALL prt_ctl_trc(tab4d=tra, mask=tmask, clinfo=ctrcnm)
+      ENDIF
 
    END SUBROUTINE p4z_meso
@@ -260,9 +249,9 @@
       !!----------------------------------------------------------------------
 
-      NAMELIST/nampismes/ grazrat2,resrat2,mzrat2,xprefc, xprefp, &
-         &             xprefz, xprefpoc, xkgraz2, epsher2, sigma2, unass2, grazflux
-
-      REWIND( numnat )                     ! read numnat
-      READ  ( numnat, nampismes )
+      NAMELIST/nampismes/ part2, grazrat2, resrat2, mzrat2, xprefc, xprefp, xprefz,   &
+         &                xprefpoc, xthresh2, xkgraz2, epsher2, sigma2, unass2, grazflux
+
+      REWIND( numnatp )                     ! read numnat
+      READ  ( numnatp, nampismes )
 
 
@@ -271,16 +260,18 @@
          WRITE(numout,*) ' Namelist parameters for mesozooplankton, nampismes'
          WRITE(numout,*) ' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'
-         WRITE(numout,*) '    zoo preference for phyto                  xprefc    =', xprefc
-         WRITE(numout,*) '    zoo preference for POC                    xprefp    =', xprefp
-         WRITE(numout,*) '    zoo preference for zoo                    xprefz    =', xprefz
-         WRITE(numout,*) '    zoo preference for poc                    xprefpoc  =', xprefpoc
-         WRITE(numout,*) '    exsudation rate of mesozooplankton        resrat2   =', resrat2
-         WRITE(numout,*) '    mesozooplankton mortality rate            mzrat2    =', mzrat2
-         WRITE(numout,*) '    maximal mesozoo grazing rate              grazrat2  =', grazrat2
-         WRITE(numout,*) '    mesozoo flux feeding rate                 grazflux  =', grazflux
-         WRITE(numout,*) '    non assimilated fraction of P by mesozoo  unass2    =', unass2
-         WRITE(numout,*) '    Efficicency of Mesozoo growth             epsher2   =', epsher2
-         WRITE(numout,*) '    Fraction of mesozoo excretion as DOM      sigma2    =', sigma2
-         WRITE(numout,*) '    half sturation constant for grazing 2     xkgraz2   =', xkgraz2
+         WRITE(numout,*) '    part of calcite not dissolved in mesozoo guts  part2     =', part2
+         WRITE(numout,*) '    mesozoo preference for phyto                   xprefc    =', xprefc
+         WRITE(numout,*) '    mesozoo preference for POC                     xprefp    =', xprefp
+         WRITE(numout,*) '    mesozoo preference for zoo                     xprefz    =', xprefz
+         WRITE(numout,*) '    mesozoo preference for poc                     xprefpoc  =', xprefpoc
+         WRITE(numout,*) '    feeding threshold for mesozooplankton          xthresh2  =', xthresh2
+         WRITE(numout,*) '    exsudation rate of mesozooplankton             resrat2   =', resrat2
+         WRITE(numout,*) '    mesozooplankton mortality rate                 mzrat2    =', mzrat2
+         WRITE(numout,*) '    maximal mesozoo grazing rate                   grazrat2  =', grazrat2
+         WRITE(numout,*) '    mesozoo flux feeding rate                      grazflux  =', grazflux
+         WRITE(numout,*) '    non assimilated fraction of P by mesozoo       unass2    =', unass2
+         WRITE(numout,*) '    Efficicency of Mesozoo growth                  epsher2   =', epsher2
+         WRITE(numout,*) '    Fraction of mesozoo excretion as DOM           sigma2    =', sigma2
+         WRITE(numout,*) '    half sturation constant for grazing 2          xkgraz2   =', xkgraz2
       ENDIF
 
Index: branches/2011/dev_r2787_PISCES_improvment/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zmicro.F90
===================================================================
--- branches/2011/dev_r2787_PISCES_improvment/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zmicro.F90	(revision 2822)
+++ branches/2011/dev_r2787_PISCES_improvment/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zmicro.F90	(revision 2823)
@@ -6,4 +6,5 @@
    !! History :   1.0  !  2004     (O. Aumont) Original code
    !!             2.0  !  2007-12  (C. Ethe, G. Madec)  F90
+   !!             3.4  !  2011-06  (O. Aumont, C. Ethe) Quota model for iron
    !!----------------------------------------------------------------------
 #if defined key_pisces
@@ -14,12 +15,11 @@
    !!   p4z_micro_init  :   Initialize and read the appropriate namelist
    !!----------------------------------------------------------------------
-   USE trc
-   USE oce_trc         !
-   USE trc         ! 
-   USE sms_pisces      ! 
-   USE prtctl_trc
-   USE p4zint
-   USE p4zsink
-   USE iom
+   USE oce_trc         !  shared variables between ocean and passive tracers
+   USE trc             !  passive tracers common variables 
+   USE sms_pisces      !  PISCES Source Minus Sink variables
+   USE p4zsink         !  vertical flux of particulate matter due to sinking
+   USE p4zint          !  interpolation and computation of various fields
+   USE p4zprod         !  production
+   USE prtctl_trc      !  print control for debugging
 
    IMPLICIT NONE
@@ -30,15 +30,16 @@
 
    !! * Shared module variables
-   REAL(wp), PUBLIC ::   &
-      xpref2c = 0.0_wp       ,  &  !:
-      xpref2p = 0.5_wp       ,  &  !:
-      xpref2d = 0.5_wp       ,  &  !:
-      resrat  = 0.03_wp      ,  &  !:
-      mzrat   = 0.0_wp       ,  &  !:
-      grazrat = 4.0_wp       ,  &  !:
-      xkgraz  = 20E-6_wp     ,  &  !:
-      unass   = 0.3_wp       ,  &  !:
-      sigma1  = 0.6_wp       ,  &  !:
-      epsher  = 0.33_wp
+   REAL(wp), PUBLIC ::  part    = 0.5_wp     !: part of calcite not dissolved in microzoo guts
+   REAL(wp), PUBLIC ::  xpref2c = 0.2_wp     !: microzoo preference for POC 
+   REAL(wp), PUBLIC ::  xpref2p = 1.0_wp     !: microzoo preference for nanophyto
+   REAL(wp), PUBLIC ::  xpref2d = 0.6_wp     !: microzoo preference for diatoms
+   REAL(wp), PUBLIC ::  xthresh = 2E-7_wp    !: feeding threshold for microzooplankton 
+   REAL(wp), PUBLIC ::  resrat  = 0.03_wp    !: exsudation rate of microzooplankton
+   REAL(wp), PUBLIC ::  mzrat   = 0.0_wp     !: microzooplankton mortality rate 
+   REAL(wp), PUBLIC ::  grazrat = 3.0_wp     !: maximal microzoo grazing rate
+   REAL(wp), PUBLIC ::  xkgraz  = 20E-6_wp   !: non assimilated fraction of P by microzoo 
+   REAL(wp), PUBLIC ::  unass   = 0.3_wp     !: Efficicency of microzoo growth 
+   REAL(wp), PUBLIC ::  sigma1  = 0.6_wp     !: Fraction of microzoo excretion as DOM 
+   REAL(wp), PUBLIC ::  epsher  = 0.3_wp     !: half sturation constant for grazing 1 
 
 
@@ -63,9 +64,10 @@
       INTEGER, INTENT(in) ::   kt ! ocean time step
       INTEGER  :: ji, jj, jk
-      REAL(wp) :: zcompadi, zcompadi2, zcompaz , zcompaph, zcompapoc
-      REAL(wp) :: zgraze  , zdenom  , zdenom2, zstep
-      REAL(wp) :: zfact   , zinano , zidiat, zipoc
+      REAL(wp) :: zcompadi, zcompaz , zcompaph, zcompapoc
+      REAL(wp) :: zgraze  , zdenom, zncratio
+      REAL(wp) :: zfact   , zstep, zfood, zfoodlim
+      REAL(wp) :: zepshert, zepsherv, zgrarsig, zgraztot, zgraztotf
       REAL(wp) :: zgrarem, zgrafer, zgrapoc, zprcaca, zmortz
-      REAL(wp) :: zrespz, ztortz
+      REAL(wp) :: zrespz, ztortz, zgrasrat
       REAL(wp) :: zgrazp, zgrazm, zgrazsd
       REAL(wp) :: zgrazmf, zgrazsf, zgrazpf
@@ -74,15 +76,12 @@
       !!---------------------------------------------------------------------
 
-
 #if defined key_diatrc
       grazing(:,:,:) = 0.  !: Initialisation of  grazing
 #endif
-
-      zstep = rfact2 / rday      ! Time step duration for biology
 
       DO jk = 1, jpkm1
          DO jj = 1, jpj
             DO ji = 1, jpi
-               zcompaz = MAX( ( trn(ji,jj,jk,jpzoo) - 1.e-9 ), 0.e0 )
+               zcompaz = MAX( ( trn(ji,jj,jk,jpzoo) - 1.e-8 ), 0.e0 )
 # if defined key_degrad
                zstep   = xstep * facvol(ji,jj,jk)
@@ -90,10 +89,10 @@
                zstep   = xstep
 # endif
-               zfact   = zstep * tgfunc(ji,jj,jk) * zcompaz
+               zfact   = zstep * tgfunc2(ji,jj,jk) * zcompaz
 
                !  Respiration rates of both zooplankton
                !  -------------------------------------
-               zrespz = resrat * zfact  * ( 1.+ 3.* nitrfac(ji,jj,jk) )     &
-                  &            * trn(ji,jj,jk,jpzoo) / ( xkmort + trn(ji,jj,jk,jpzoo) )
+               zrespz = resrat * zfact * trn(ji,jj,jk,jpzoo) / ( 2. * xkmort + trn(ji,jj,jk,jpzoo) )  &
+                  &   + resrat * zfact * 3. * nitrfac(ji,jj,jk)
 
                !  Zooplankton mortality. A square function has been selected with
@@ -102,63 +101,59 @@
                ztortz = mzrat * 1.e6 * zfact * trn(ji,jj,jk,jpzoo)
 
-               zcompadi  = MAX( ( trn(ji,jj,jk,jpdia) - 1.e-8 ), 0.e0 )
-               zcompadi2 = MIN( zcompadi, 5.e-7 )
-               zcompaph  = MAX( ( trn(ji,jj,jk,jpphy) - 2.e-7 ), 0.e0 )
+               zcompadi  = MIN( MAX( ( trn(ji,jj,jk,jpdia) - 1.e-8 ), 0.e0 ), 5.e-7 )
+               zcompaph  = MAX( ( trn(ji,jj,jk,jpphy) - 1.e-8 ), 0.e0 )
                zcompapoc = MAX( ( trn(ji,jj,jk,jppoc) - 1.e-8 ), 0.e0 )
                
                !     Microzooplankton grazing
                !     ------------------------
-               zdenom2 = 1./ ( xpref2p * zcompaph + xpref2c * zcompapoc + xpref2d * zcompadi2 + rtrn )
-
-               zgraze = grazrat * zstep * tgfunc(ji,jj,jk) * trn(ji,jj,jk,jpzoo)
-
-               zinano = xpref2p * zcompaph  * zdenom2
-               zipoc  = xpref2c * zcompapoc * zdenom2
-               zidiat = xpref2d * zcompadi2 * zdenom2
-
-               zdenom = 1./ ( xkgraz + zinano * zcompaph + zipoc * zcompapoc + zidiat * zcompadi2 )
-
-               zgrazp  = zgraze * zinano * zcompaph * zdenom
-               zgrazm  = zgraze * zipoc  * zcompapoc * zdenom
-               zgrazsd = zgraze * zidiat * zcompadi2 * zdenom
-
-               zgrazpf = zgrazp  * trn(ji,jj,jk,jpnfe) / (trn(ji,jj,jk,jpphy) + rtrn)
-               zgrazmf = zgrazm  * trn(ji,jj,jk,jpsfe) / (trn(ji,jj,jk,jppoc) + rtrn)
-               zgrazsf = zgrazsd * trn(ji,jj,jk,jpdfe) / (trn(ji,jj,jk,jpdia) + rtrn)
+               zfood     = xpref2p * zcompaph + xpref2c * zcompapoc + xpref2d * zcompadi + rtrn
+               zfoodlim  = MAX( 0. , zfood - xthresh )
+               zdenom    = zfoodlim / zfood / ( xkgraz + zfoodlim )
+               zgraze    = grazrat * zstep * tgfunc2(ji,jj,jk) * trn(ji,jj,jk,jpzoo) * zdenom
+               zgrazp    = zgraze  * xpref2p * zcompaph 
+               zgrazm    = zgraze  * xpref2c * zcompapoc 
+               zgrazsd   = zgraze  * xpref2d * zcompadi 
+
+               zgrazpf   = zgrazp  * trn(ji,jj,jk,jpnfe) / (trn(ji,jj,jk,jpphy) + rtrn)
+               zgrazmf   = zgrazm  * trn(ji,jj,jk,jpsfe) / (trn(ji,jj,jk,jppoc) + rtrn)
+               zgrazsf   = zgrazsd * trn(ji,jj,jk,jpdfe) / (trn(ji,jj,jk,jpdia) + rtrn)
+               !
+               zgraztot  = zgrazp  + zgrazm  + zgrazsd 
+               zgraztotf = zgrazpf + zgrazsf + zgrazmf 
 #if defined key_diatrc
                ! Grazing by microzooplankton
-               grazing(ji,jj,jk) = grazing(ji,jj,jk) + zgrazp + zgrazm + zgrazsd 
+               grazing(ji,jj,jk) = grazing(ji,jj,jk) + zgraztot
 #endif
 
                !    Various remineralization and excretion terms
                !    --------------------------------------------
-               zgrarem = ( zgrazp + zgrazm + zgrazsd ) * ( 1.- epsher - unass )
-               zgrafer = ( zgrazpf + zgrazsf + zgrazmf ) * ( 1.- epsher - unass ) &
-                  &      + epsher * ( zgrazm  * MAX((trn(ji,jj,jk,jpsfe) / (trn(ji,jj,jk,jppoc)+ rtrn)-ferat3),0.e0) & 
-                  &                 + zgrazp  * MAX((trn(ji,jj,jk,jpnfe) / (trn(ji,jj,jk,jpphy)+ rtrn)-ferat3),0.e0) &
-                  &                 + zgrazsd * MAX((trn(ji,jj,jk,jpdfe) / (trn(ji,jj,jk,jpdia)+ rtrn)-ferat3),0.e0 )  )
-
-               zgrapoc = (  zgrazp + zgrazm + zgrazsd ) 
+               zgrasrat  = zgraztotf / ( zgraztot + rtrn )
+               zncratio  = ( xpref2p * zcompaph * quotan(ji,jj,jk) &
+                  &        + xpref2d * zcompadi * quotad(ji,jj,jk) + xpref2c * zcompapoc ) / zfood
+               zepshert  = epsher * MIN( 1., zncratio )
+               zepsherv  = zepshert * MIN( 1., zgrasrat / ferat3 )
+               zgrafer   = zgraztot * MAX( 0. , ( 1. - unass ) * zgrasrat - ferat3 * zepshert ) 
+               zgrarem   = zgraztot * ( 1. - zepsherv - unass )
+               zgrapoc   = zgraztot * unass
 
                !  Update of the TRA arrays
                !  ------------------------
-
-               tra(ji,jj,jk,jppo4) = tra(ji,jj,jk,jppo4) + zgrarem * sigma1
-               tra(ji,jj,jk,jpnh4) = tra(ji,jj,jk,jpnh4) + zgrarem * sigma1
-               tra(ji,jj,jk,jpdoc) = tra(ji,jj,jk,jpdoc) + zgrarem * (1.-sigma1)
-               tra(ji,jj,jk,jpoxy) = tra(ji,jj,jk,jpoxy) - o2ut * zgrarem * sigma1
+               zgrarsig  = zgrarem * sigma1
+               tra(ji,jj,jk,jppo4) = tra(ji,jj,jk,jppo4) + zgrarsig
+               tra(ji,jj,jk,jpnh4) = tra(ji,jj,jk,jpnh4) + zgrarsig
+               tra(ji,jj,jk,jpdoc) = tra(ji,jj,jk,jpdoc) + zgrarem - zgrarsig
+               tra(ji,jj,jk,jpoxy) = tra(ji,jj,jk,jpoxy) - o2ut * zgrarsig
                tra(ji,jj,jk,jpfer) = tra(ji,jj,jk,jpfer) + zgrafer
-               tra(ji,jj,jk,jppoc) = tra(ji,jj,jk,jppoc) + zgrapoc * unass
-               tra(ji,jj,jk,jpdic) = tra(ji,jj,jk,jpdic) + zgrarem * sigma1
+               tra(ji,jj,jk,jppoc) = tra(ji,jj,jk,jppoc) + zgrapoc
+               tra(ji,jj,jk,jpsfe) = tra(ji,jj,jk,jpsfe) + zgraztotf * unass
+               tra(ji,jj,jk,jpdic) = tra(ji,jj,jk,jpdic) + zgrarsig
+               tra(ji,jj,jk,jptal) = tra(ji,jj,jk,jptal) + rno3 * zgrarsig
 #if defined key_kriest
-               tra(ji,jj,jk,jpnum) = tra(ji,jj,jk,jpnum) + zgrapoc * unass * xkr_ddiat
-#endif
-
-               !
+               tra(ji,jj,jk,jpnum) = tra(ji,jj,jk,jpnum) + zgrapoc * xkr_ddiat
+#endif
                !   Update the arrays TRA which contain the biological sources and sinks
                !   --------------------------------------------------------------------
-
                zmortz = ztortz + zrespz
-               tra(ji,jj,jk,jpzoo) = tra(ji,jj,jk,jpzoo) - zmortz + epsher * zgrapoc 
+               tra(ji,jj,jk,jpzoo) = tra(ji,jj,jk,jpzoo) - zmortz + zepsherv * zgraztot 
                tra(ji,jj,jk,jpphy) = tra(ji,jj,jk,jpphy) - zgrazp
                tra(ji,jj,jk,jpdia) = tra(ji,jj,jk,jpdia) - zgrazsd
@@ -170,7 +165,8 @@
                tra(ji,jj,jk,jpdfe) = tra(ji,jj,jk,jpdfe) - zgrazsf
                tra(ji,jj,jk,jppoc) = tra(ji,jj,jk,jppoc) + zmortz - zgrazm
-               tra(ji,jj,jk,jpsfe) = tra(ji,jj,jk,jpsfe) + ferat3 * zmortz + unass * ( zgrazpf + zgrazsf ) - (1.-unass) * zgrazmf
-               zprcaca = xfracal(ji,jj,jk) * unass * zgrazp
+               tra(ji,jj,jk,jpsfe) = tra(ji,jj,jk,jpsfe) + ferat3 * zmortz - zgrazmf
+               zprcaca = xfracal(ji,jj,jk) * zgrazp
 #if defined key_diatrc
+               ! calcite production
                prodcal(ji,jj,jk) = prodcal(ji,jj,jk) + zprcaca  ! prodcal=prodcal(nanophy)+prodcal(microzoo)+prodcal(mesozoo)
 #endif
@@ -209,9 +205,9 @@
       !!----------------------------------------------------------------------
 
-      NAMELIST/nampiszoo/ grazrat,resrat,mzrat,xpref2c, xpref2p, &
-         &             xpref2d, xkgraz, epsher, sigma1, unass
-
-      REWIND( numnat )                     ! read numnat
-      READ  ( numnat, nampiszoo )
+      NAMELIST/nampiszoo/ part, grazrat, resrat, mzrat, xpref2c, xpref2p, &
+         &                xpref2d, xthresh, xkgraz, epsher, sigma1, unass
+
+      REWIND( numnatp )                     ! read numnat
+      READ  ( numnatp, nampiszoo )
 
       IF(lwp) THEN                         ! control print
@@ -219,14 +215,16 @@
          WRITE(numout,*) ' Namelist parameters for microzooplankton, nampiszoo'
          WRITE(numout,*) ' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'
-         WRITE(numout,*) '    zoo preference for POC                    xpref2c    =', xpref2c
-         WRITE(numout,*) '    zoo preference for nano                   xpref2p    =', xpref2p
-         WRITE(numout,*) '    zoo preference for diatoms                xpref2d    =', xpref2d
-         WRITE(numout,*) '    exsudation rate of microzooplankton       resrat    =', resrat
-         WRITE(numout,*) '    microzooplankton mortality rate           mzrat     =', mzrat
-         WRITE(numout,*) '    maximal microzoo grazing rate             grazrat   =', grazrat
-         WRITE(numout,*) '    non assimilated fraction of P by microzoo unass     =', unass
-         WRITE(numout,*) '    Efficicency of microzoo growth            epsher    =', epsher
-         WRITE(numout,*) '    Fraction of microzoo excretion as DOM     sigma1    =', sigma1
-         WRITE(numout,*) '    half sturation constant for grazing 1     xkgraz    =', xkgraz
+         WRITE(numout,*) '    part of calcite not dissolved in microzoo guts  part     =', part
+         WRITE(numout,*) '    microzoo preference for POC                     xpref2c  =', xpref2c
+         WRITE(numout,*) '    microzoo preference for nano                    xpref2p  =', xpref2p
+         WRITE(numout,*) '    microzoo preference for diatoms                 xpref2d  =', xpref2d
+         WRITE(numout,*) '    feeding threshold for microzooplankton          xthresh  =', xthresh
+         WRITE(numout,*) '    exsudation rate of microzooplankton             resrat   =', resrat
+         WRITE(numout,*) '    microzooplankton mortality rate                 mzrat    =', mzrat
+         WRITE(numout,*) '    maximal microzoo grazing rate                   grazrat  =', grazrat
+         WRITE(numout,*) '    non assimilated fraction of P by microzoo       unass    =', unass
+         WRITE(numout,*) '    Efficicency of microzoo growth                  epsher   =', epsher
+         WRITE(numout,*) '    Fraction of microzoo excretion as DOM           sigma1   =', sigma1
+         WRITE(numout,*) '    half sturation constant for grazing 1           xkgraz   =', xkgraz
       ENDIF
 
Index: branches/2011/dev_r2787_PISCES_improvment/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zmort.F90
===================================================================
--- branches/2011/dev_r2787_PISCES_improvment/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zmort.F90	(revision 2822)
+++ branches/2011/dev_r2787_PISCES_improvment/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zmort.F90	(revision 2823)
@@ -14,10 +14,9 @@
    !!   p4z_mort_init  :   Initialize the mortality params for phytoplankton
    !!----------------------------------------------------------------------
-   USE trc
-   USE oce_trc         !
-   USE trc         ! 
-   USE sms_pisces      ! 
-   USE p4zsink
-   USE prtctl_trc
+   USE oce_trc         !  shared variables between ocean and passive tracers
+   USE trc             !  passive tracers common variables 
+   USE sms_pisces      !  PISCES Source Minus Sink variables
+   USE p4zsink         !  vertical flux of particulate matter due to sinking
+   USE prtctl_trc      !  print control for debugging
 
    IMPLICIT NONE
@@ -29,10 +28,9 @@
 
    !! * Shared module variables
-   REAL(wp), PUBLIC ::   &
-     wchl   = 0.001_wp    ,  &  !:
-     wchld  = 0.02_wp     ,  &  !:
-     mprat  = 0.01_wp     ,  &  !:
-     mprat2 = 0.01_wp     ,  &  !:
-     mpratm = 0.01_wp           !:
+   REAL(wp), PUBLIC :: wchl   = 0.001_wp  !:
+   REAL(wp), PUBLIC :: wchld  = 0.02_wp   !:
+   REAL(wp), PUBLIC :: mprat  = 0.01_wp   !:
+   REAL(wp), PUBLIC :: mprat2 = 0.01_wp   !:
+   REAL(wp), PUBLIC :: mpratm = 0.01_wp   !:
 
 
@@ -81,5 +79,4 @@
       !!---------------------------------------------------------------------
 
-
 #if defined key_diatrc
      prodcal(:,:,:) = 0.  !: Initialisation of calcite production variable
@@ -91,5 +88,4 @@
 
                zcompaph = MAX( ( trn(ji,jj,jk,jpphy) - 1e-8 ), 0.e0 )
-
 # if defined key_degrad
                zstep =  xstep * facvol(ji,jj,jk)  
@@ -117,7 +113,9 @@
                tra(ji,jj,jk,jpnfe) = tra(ji,jj,jk,jpnfe) - zmortp * zfactfe
                zprcaca = xfracal(ji,jj,jk) * zmortp
+               !
 #if defined key_diatrc
                prodcal(ji,jj,jk) = prodcal(ji,jj,jk) + zprcaca  ! prodcal=prodcal(nanophy)+prodcal(microzoo)+prodcal(mesozoo)
 #endif
+               !
                zfracal = 0.5 * xfracal(ji,jj,jk)
                tra(ji,jj,jk,jpdic) = tra(ji,jj,jk,jpdic) - zprcaca
@@ -243,6 +241,6 @@
       NAMELIST/nampismort/ wchl, wchld, mprat, mprat2, mpratm
 
-      REWIND( numnat )                     ! read numnat
-      READ  ( numnat, nampismort )
+      REWIND( numnatp )                     ! read numnat
+      READ  ( numnatp, nampismort )
 
       IF(lwp) THEN                         ! control print
Index: branches/2011/dev_r2787_PISCES_improvment/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zopt.F90
===================================================================
--- branches/2011/dev_r2787_PISCES_improvment/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zopt.F90	(revision 2822)
+++ branches/2011/dev_r2787_PISCES_improvment/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zopt.F90	(revision 2823)
@@ -7,4 +7,5 @@
    !!             2.0  !  2007-12  (C. Ethe, G. Madec)  F90
    !!             3.2  !  2009-04  (C. Ethe, G. Madec)  optimisation
+   !!             3.4  !  2011-06  (O. Aumont, C. Ethe) Improve light availability of nano & diat
    !!----------------------------------------------------------------------
 #if defined  key_pisces
@@ -17,5 +18,5 @@
    USE oce_trc        ! tracer-ocean share variables
    USE sms_pisces     ! Source Minus Sink of PISCES
-   USE iom
+   USE iom            ! I/O manager
 
    IMPLICIT NONE
@@ -53,8 +54,9 @@
       !!---------------------------------------------------------------------
       USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
-      USE wrk_nemo, ONLY:   zdepmoy => wrk_2d_1 , zetmp => wrk_2d_2
-      USE wrk_nemo, ONLY:   zekg    => wrk_3d_2 , zekr  => wrk_3d_3 , zekb => wrk_3d_4
-      USE wrk_nemo, ONLY:   ze0     => wrk_3d_5 , ze1   => wrk_3d_6
-      USE wrk_nemo, ONLY:   ze2     => wrk_3d_7 , ze3   => wrk_3d_8
+      USE wrk_nemo, ONLY:   zdepmoy => wrk_2d_1 , zetmp  => wrk_2d_2
+      USE wrk_nemo, ONLY:   zetmp1  => wrk_2d_3 , zetmp2 => wrk_2d_4
+      USE wrk_nemo, ONLY:   zekg    => wrk_3d_2 , zekr   => wrk_3d_3 , zekb => wrk_3d_4
+      USE wrk_nemo, ONLY:   ze0     => wrk_3d_5 , ze1    => wrk_3d_6
+      USE wrk_nemo, ONLY:   ze2     => wrk_3d_7 , ze3    => wrk_3d_8
       !
       INTEGER, INTENT(in) ::   kt, jnt   ! ocean time step
@@ -63,8 +65,8 @@
       INTEGER  ::   irgb
       REAL(wp) ::   zchl, zxsi0r
-      REAL(wp) ::   zc0 , zc1 , zc2, zc3
+      REAL(wp) ::   zc0 , zc1 , zc2, zc3, z1_dep
       !!---------------------------------------------------------------------
 
-      IF(  wrk_in_use(2, 1,2)   .OR.   wrk_in_use(3, 2,3,4,5,6,7,8)   ) THEN
+      IF(  wrk_in_use(2, 1,2,3,4)   .OR.   wrk_in_use(3, 2,3,4,5,6,7,8)   ) THEN
          CALL ctl_stop('p4z_opt: requested workspace arrays unavailable')   ;   RETURN
       ENDIF
@@ -83,5 +85,5 @@
             DO ji = 1, jpi
                zchl = ( trn(ji,jj,jk,jpnch) + trn(ji,jj,jk,jpdch) + rtrn ) * 1.e6
-               zchl = MIN(  10. , MAX( 0.03, zchl )  )
+               zchl = MIN(  10. , MAX( 0.05, zchl )  )
                irgb = NINT( 41 + 20.* LOG10( zchl ) + rtrn )
                !                                                         
@@ -92,8 +94,4 @@
          END DO
       END DO
-
-!!gm  Potential BUG  must discuss with Olivier about this implementation....
-!!gm           the questions are : - PAR at T-point or mean PAR over T-level....
-!!gm                               - shallow water: no penetration of light through the bottom....
 
 
@@ -145,5 +143,5 @@
          etot3(:,:,1) =          qsr(:,:) * tmask(:,:,1)
          !
-         DO jk = 2, nksrp+1
+         DO jk = 2, nksrp + 1
 !CDIR NOVERRCHK
             DO jj = 1, jpj
@@ -188,5 +186,6 @@
       zdepmoy(:,:)   = 0.e0                    !  -------------------------------
       zetmp  (:,:)   = 0.e0
-      emoy   (:,:,:) = 0.e0
+      zetmp1 (:,:)   = 0.e0
+      zetmp2 (:,:)   = 0.e0
 
       DO jk = 1, nksrp
@@ -196,5 +195,7 @@
             DO ji = 1, jpi
                IF( fsdepw(ji,jj,jk+1) <= hmld(ji,jj) ) THEN
-                  zetmp  (ji,jj) = zetmp  (ji,jj) + etot(ji,jj,jk) * fse3t(ji,jj,jk)
+                  zetmp  (ji,jj) = zetmp  (ji,jj) + etot (ji,jj,jk) * fse3t(ji,jj,jk)
+                  zetmp1 (ji,jj) = zetmp1 (ji,jj) + enano(ji,jj,jk) * fse3t(ji,jj,jk)
+                  zetmp2 (ji,jj) = zetmp2 (ji,jj) + ediat(ji,jj,jk) * fse3t(ji,jj,jk)
                   zdepmoy(ji,jj) = zdepmoy(ji,jj) + fse3t(ji,jj,jk)
                ENDIF
@@ -210,5 +211,10 @@
 !CDIR NOVERRCHK
             DO ji = 1, jpi
-               IF( fsdepw(ji,jj,jk+1) <= hmld(ji,jj) )   emoy(ji,jj,jk) = zetmp(ji,jj) / ( zdepmoy(ji,jj) + rtrn )
+               IF( fsdepw(ji,jj,jk+1) <= hmld(ji,jj) ) THEN
+                  z1_dep = 1. / ( zdepmoy(ji,jj) + rtrn )
+                  emoy (ji,jj,jk) = zetmp (ji,jj) * z1_dep
+                  enano(ji,jj,jk) = zetmp1(ji,jj) * z1_dep
+                  ediat(ji,jj,jk) = zetmp2(ji,jj) * z1_dep
+               ENDIF
             END DO
          END DO
@@ -218,9 +224,9 @@
 # if ! defined key_iomput
       ! save for outputs
-      trc2d(:,:,  jp_pcs0_2d + 10) = heup(:,:  ) * tmask(:,:,1)  
+      trc2d(:,:,  jp_pcs0_2d + 10) = heup(:,:  ) * tmask(:,:,1)
       trc3d(:,:,:,jp_pcs0_3d + 3)  = etot(:,:,:) * tmask(:,:,:)
 # else
       ! write diagnostics 
-      IF( jnt == nrdttrc ) then 
+      IF( jnt == nrdttrc ) then
          CALL iom_put( "Heup", heup(:,:  ) * tmask(:,:,1) )  ! euphotic layer deptht
          CALL iom_put( "PAR" , etot(:,:,:) * tmask(:,:,:) )  ! Photosynthetically Available Radiation
@@ -229,6 +235,6 @@
 #endif
       !
-      IF(  wrk_not_released(2, 1,2)           .OR.   &
-           wrk_not_released(3, 2,3,4,5,6,7,8)   )   CALL ctl_stop('p4z_opt: failed to release workspace arrays')
+      IF( wrk_not_released(2, 1,2,3,4)           .OR.   &
+          wrk_not_released(3, 2,3,4,5,6,7,8)   )   CALL ctl_stop('p4z_opt: failed to release workspace arrays')
       !
    END SUBROUTINE p4z_opt
Index: branches/2011/dev_r2787_PISCES_improvment/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zprod.F90
===================================================================
--- branches/2011/dev_r2787_PISCES_improvment/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zprod.F90	(revision 2822)
+++ branches/2011/dev_r2787_PISCES_improvment/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zprod.F90	(revision 2823)
@@ -6,4 +6,5 @@
    !! History :   1.0  !  2004     (O. Aumont) Original code
    !!             2.0  !  2007-12  (C. Ethe, G. Madec)  F90
+   !!             3.4  !  2011-05  (O. Aumont, C. Ethe) New parameterization of light limitation
    !!----------------------------------------------------------------------
 #if defined key_pisces
@@ -11,14 +12,16 @@
    !!   'key_pisces'                                       PISCES bio-model
    !!----------------------------------------------------------------------
-   !!   p4z_prod       :  
-   !!----------------------------------------------------------------------
-   USE trc
-   USE oce_trc         !
-   USE sms_pisces      ! 
-   USE prtctl_trc
-   USE p4zopt
-   USE p4zint
-   USE p4zlim
-   USE iom
+   !!----------------------------------------------------------------------
+   !!   p4z_prod       :   Compute the growth Rate of the two phytoplanktons groups
+   !!   p4z_prod_init  :   Initialization of the parameters for growth
+   !!   p4z_prod_alloc :   Allocate variables for growth
+   !!----------------------------------------------------------------------
+   USE oce_trc         !  shared variables between ocean and passive tracers
+   USE trc             !  passive tracers common variables 
+   USE sms_pisces      !  PISCES Source Minus Sink variables
+   USE p4zopt          !  optical model
+   USE p4zlim          !  Co-limitations of differents nutrients
+   USE prtctl_trc      !  print control for debugging
+   USE iom             !  I/O manager
 
    IMPLICIT NONE
@@ -29,22 +32,27 @@
    PUBLIC   p4z_prod_alloc
 
-   REAL(wp), PUBLIC ::   &
-     pislope   = 3.0_wp          ,  &  !:
-     pislope2  = 3.0_wp          ,  &  !:
-     excret    = 10.e-5_wp       , &   !:
-     excret2   = 0.05_wp         , &   !:
-     chlcnm    = 0.033_wp        , &   !:
-     chlcdm    = 0.05_wp         , &   !:
-     fecnm     = 10.E-6_wp       , &   !:
-     fecdm     = 15.E-6_wp       , &   !:
-     grosip    = 0.151_wp
-
-   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   prmax   !:
+   !! * Shared module variables
+   REAL(wp), PUBLIC ::  pislope   = 3.0_wp            !:
+   REAL(wp), PUBLIC ::  pislope2  = 3.0_wp            !:
+   REAL(wp), PUBLIC ::  excret    = 10.e-5_wp         !:
+   REAL(wp), PUBLIC ::  excret2   = 0.05_wp           !:
+   REAL(wp), PUBLIC ::  bresp     = 0.00333_wp        !:
+   REAL(wp), PUBLIC ::  chlcnm    = 0.033_wp          !:
+   REAL(wp), PUBLIC ::  chlcdm    = 0.05_wp           !:
+   REAL(wp), PUBLIC ::  chlcmin   = 0.00333_wp        !:
+   REAL(wp), PUBLIC ::  fecnm     = 10.E-6_wp         !:
+   REAL(wp), PUBLIC ::  fecdm     = 15.E-6_wp         !:
+   REAL(wp), PUBLIC ::  grosip    = 0.151_wp          !:
+
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   prmax     !: optimal prduction = f(temperature)
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   quotan   !: proxy of N quota in Nanophyto
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   quotad   !: proxy of N quota in diatomee
    
-   REAL(wp) ::   &
-      rday1                      ,  &  !: 0.6 / rday
-      texcret                    ,  &  !: 1 - excret 
-      texcret2                   ,  &  !: 1 - excret2        
-      tpp                              !: Total primary production
+   REAL(wp) :: r1_rday                !: 1 / rday
+   REAL(wp) :: r1_bresp               !: 1 / bresp 
+   REAL(wp) :: texcret                !: 1 - excret 
+   REAL(wp) :: texcret2               !: 1 - excret2        
+   REAL(wp) :: tpp                    !: Total primary production
+
 
    !!* Substitution
@@ -67,31 +75,33 @@
       !!---------------------------------------------------------------------
       USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
-      USE wrk_nemo, ONLY:   zmixnano   => wrk_2d_1  , zmixdiat    => wrk_2d_2  , zstrn  => wrk_2d_3
-      USE wrk_nemo, ONLY:   zpislopead => wrk_3d_2  , zpislopead2 => wrk_3d_3
-      USE wrk_nemo, ONLY:   zprdia     => wrk_3d_4  , zprbio      => wrk_3d_5  , zysopt => wrk_3d_6
-      USE wrk_nemo, ONLY:   zprorca    => wrk_3d_7  , zprorcad    => wrk_3d_8
-      USE wrk_nemo, ONLY:   zprofed    => wrk_3d_9  , zprofen     => wrk_3d_10
-      USE wrk_nemo, ONLY:   zprochln   => wrk_3d_11 , zprochld    => wrk_3d_12
-      USE wrk_nemo, ONLY:   zpronew    => wrk_3d_13 , zpronewd    => wrk_3d_14
+      USE wrk_nemo, ONLY:   zmixnano   => wrk_2d_1 , zmixdiat    => wrk_2d_2, zstrn => wrk_2d_3
+      USE wrk_nemo, ONLY:   zpislopead => wrk_3d_2 , zpislopead2 => wrk_3d_3
+      USE wrk_nemo, ONLY:   zprdia     => wrk_3d_4 , zprbio      => wrk_3d_5 
+      USE wrk_nemo, ONLY:   zprdch     => wrk_3d_6 , zprnch      => wrk_3d_7
+      USE wrk_nemo, ONLY:   zprorca    => wrk_3d_8 , zprorcad    => wrk_3d_9
+      USE wrk_nemo, ONLY:   zprofed    => wrk_3d_10, zprofen     => wrk_3d_11
+      USE wrk_nemo, ONLY:   zprochln   => wrk_3d_12, zprochld    => wrk_3d_13
+      USE wrk_nemo, ONLY:   zpronew    => wrk_3d_14, zpronewd    => wrk_3d_15
       !
       INTEGER, INTENT(in) :: kt, jnt
       !
       INTEGER  ::   ji, jj, jk
-      REAL(wp) ::   zsilfac, zfact
-      REAL(wp) ::   zprdiachl, zprbiochl, zsilim, ztn, zadap, zadap2
-      REAL(wp) ::   zlim, zsilfac2, zsiborn, zprod, zetot2, zmax, zproreg, zproreg2
-      REAL(wp) ::   zmxltst, zmxlday, zlim1
+      REAL(wp) ::   zsilfac, zfact, znanotot, zdiattot, zconctemp, zconctemp2
+      REAL(wp) ::   zratio, zmax, zsilim, ztn, zadap
+      REAL(wp) ::   zlim, zsilfac2, zsiborn, zprod, zetot2, zproreg, zproreg2
+      REAL(wp) ::   zmxltst, zmxlday
       REAL(wp) ::   zpislopen  , zpislope2n
-      REAL(wp) ::   zrum, zcodel, zargu, zval, zvol
-#if defined key_diatrc
+      REAL(wp) ::   zrum, zcodel, zargu, zval
+      REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) :: zysopt 
       REAL(wp) ::   zrfact2
-#endif
       CHARACTER (len=25) :: charout
       !!---------------------------------------------------------------------
 
       IF( wrk_in_use(2, 1,2,3)                             .OR.  &
-          wrk_in_use(3, 2,3,4,5,6,7,8,9,10,11,12,13,14)  ) THEN
+          wrk_in_use(3, 2,3,4,5,6,7,8,9,10,11,12,13,14,15)  ) THEN
           CALL ctl_stop('p4z_prod: requested workspace arrays unavailable')   ;   RETURN
       ENDIF
+   
+      ALLOCATE( zysopt(jpi,jpj,jpk) )
 
       zprorca (:,:,:) = 0._wp
@@ -105,12 +115,13 @@
       zprdia  (:,:,:) = 0._wp
       zprbio  (:,:,:) = 0._wp
+      zprdch  (:,:,:) = 0._wp
+      zprnch  (:,:,:) = 0._wp
       zysopt  (:,:,:) = 0._wp
 
       ! Computation of the optimal production
-# if defined key_degrad
-      prmax(:,:,:) = rday1 * tgfunc(:,:,:) * facvol(:,:,:)
-# else
-      prmax(:,:,:) = rday1 * tgfunc(:,:,:)
-# endif
+      prmax(:,:,:) = 0.6_wp * r1_rday * tgfunc(:,:,:) 
+      IF( lk_degrad ) THEN
+        prmax(:,:,:) = prmax(:,:,:) * facvol(:,:,:)
+      ENDIF
 
       ! compute the day length depending on latitude and the day
@@ -119,15 +130,27 @@
 
       ! day length in hours
-      zstrn(:,:) = 0._wp
+      zstrn(:,:) = 0.
       DO jj = 1, jpj
          DO ji = 1, jpi
             zargu = TAN( zcodel ) * TAN( gphit(ji,jj) * rad )
             zargu = MAX( -1., MIN(  1., zargu ) )
-            zval  = MAX( 0.0, 24. - 2. * ACOS( zargu ) / rad / 15. )
-            IF( zval < 1.e0 )   zval = 24.
-            zstrn(ji,jj) = 24. / zval
-         END DO
-      END DO
-
+            zstrn(ji,jj) = MAX( 0.0, 24. - 2. * ACOS( zargu ) / rad / 15. )
+         END DO
+      END DO
+
+     ! Impact of the day duration on phytoplankton growth
+      DO jk = 1, jpkm1
+         DO jj = 1 ,jpj
+            DO ji = 1, jpi
+               zval = MAX( 1., zstrn(ji,jj) )
+               zval = 1.5 * zval / ( 12. + zval )
+               zprbio(ji,jj,jk) = prmax(ji,jj,jk) * zval
+               zprdia(ji,jj,jk) = zprbio(ji,jj,jk)
+            END DO
+         END DO
+      END DO
+
+      WHERE( zstrn(:,:) < 1.e0 ) zstrn(:,:) = 24.
+      zstrn(:,:) = 24. / zstrn(:,:)
 
 !CDIR NOVERRCHK
@@ -141,26 +164,50 @@
                IF( etot(ji,jj,jk) > 1.E-3 ) THEN
                    ztn    = MAX( 0., tsn(ji,jj,jk,jp_tem) - 15. )
-                   zadap  = 0.+ 1.* ztn / ( 2.+ ztn )
-                   zadap2 = 0.e0
-
-                   zfact  = EXP( -0.21 * emoy(ji,jj,jk) )
-
-                   zpislopead (ji,jj,jk) = pislope  * ( 1.+ zadap  * zfact )
-                   zpislopead2(ji,jj,jk) = pislope2 * ( 1.+ zadap2 * zfact )
-
-                   zpislopen = zpislopead(ji,jj,jk) * trn(ji,jj,jk,jpnch)                 &
-                     &         / ( trn(ji,jj,jk,jpphy) * 12.                   + rtrn )   &
-                     &         / ( prmax(ji,jj,jk) * rday * xlimphy(ji,jj,jk) + rtrn )
-
-                   zpislope2n = zpislopead2(ji,jj,jk) * trn(ji,jj,jk,jpdch)                &
-                     &          / ( trn(ji,jj,jk,jpdia) * 12.                   + rtrn )   &
-                     &          / ( prmax(ji,jj,jk) * rday * xlimdia(ji,jj,jk) + rtrn )
-
-                   ! Computation of production function
-                   zprbio(ji,jj,jk) = prmax(ji,jj,jk) * &
-                     &                (  1.- EXP( -zpislopen * enano(ji,jj,jk) )  )
-                   zprdia(ji,jj,jk) = prmax(ji,jj,jk) * &
-                     &                (  1.- EXP( -zpislope2n * ediat(ji,jj,jk) )  )
+                   zadap  = ztn / ( 2.+ ztn )
+
+                   zconctemp   = MAX( 0.e0 , trn(ji,jj,jk,jpdia) - 5e-7 )
+                   zconctemp2  = trn(ji,jj,jk,jpdia) - zconctemp
+
+                   znanotot = enano(ji,jj,jk) * zstrn(ji,jj)
+                   zdiattot = ediat(ji,jj,jk) * zstrn(ji,jj)
+                   zfact  = EXP( -0.21 * znanotot )
+
+                   zpislopead (ji,jj,jk) = pislope  * ( 1.+ zadap  * zfact )  &
+                   &                       * trn(ji,jj,jk,jpnch) /( trn(ji,jj,jk,jpphy) * 12. + rtrn)
+
+                   zpislopead2(ji,jj,jk) = (pislope * zconctemp2 + pislope2 * zconctemp)   &
+                     &                     / ( trn(ji,jj,jk,jpdia) + rtrn )   &
+                     &                     * trn(ji,jj,jk,jpdch) /( trn(ji,jj,jk,jpdia) * 12. + rtrn)
+
+                  !  Computation of production function for Chlorophyll
+                  !--------------------------------------------------
+                   zpislopen  = zpislopead (ji,jj,jk) / ( prmax(ji,jj,jk) * rday + rtrn )
+                   zpislope2n = zpislopead2(ji,jj,jk) / ( prmax(ji,jj,jk) * rday + rtrn )
+                   zprnch(ji,jj,jk) = prmax(ji,jj,jk) * ( 1.- EXP( -zpislopen * znanotot ) )
+                   zprdch(ji,jj,jk) = prmax(ji,jj,jk) * ( 1.- EXP( -zpislope2n * zdiattot ) )
+
+                   ! Computation of production function for Carbon
+                   !  ---------------------------------------------
+                   zpislopen  = zpislopead (ji,jj,jk) / ( ( r1_rday + r1_bresp / chlcnm ) * rday + rtrn)
+                   zpislope2n = zpislopead2(ji,jj,jk) / ( ( r1_rday + r1_bresp / chlcdm ) * rday + rtrn)
+                   zprbio(ji,jj,jk) = zprbio(ji,jj,jk) * ( 1.- EXP( -zpislopen  * znanotot )  )
+                   zprdia(ji,jj,jk) = zprdia(ji,jj,jk) * ( 1.- EXP( -zpislope2n * zdiattot )  )
                ENDIF
+            END DO
+         END DO
+      END DO
+
+      !  Computation of a proxy of the N/C ratio
+      !  ---------------------------------------
+!CDIR NOVERRCHK
+      DO jk = 1, jpkm1
+!CDIR NOVERRCHK
+         DO jj = 1, jpj
+!CDIR NOVERRCHK
+            DO ji = 1, jpi
+                zval = ( xnanonh4(ji,jj,jk) + xnanono3(ji,jj,jk) ) * prmax(ji,jj,jk) / ( zprbio(ji,jj,jk) + rtrn )
+                quotan(ji,jj,jk) = MIN( 1., 0.5 + 0.5 * zval )
+                zval = ( xdiatnh4(ji,jj,jk) + xdiatno3(ji,jj,jk) ) * prmax(ji,jj,jk) / ( zprdia(ji,jj,jk) + rtrn )
+                quotad(ji,jj,jk) = MIN( 1., 0.5 + 0.5 * zval )
             END DO
          END DO
@@ -178,17 +225,11 @@
                    !    Si/C is arbitrariliy increased for very high Si concentrations
                    !    to mimic the very high ratios observed in the Southern Ocean (silpot2)
-
-                  zlim1  = trn(ji,jj,jk,jpsil) / ( trn(ji,jj,jk,jpsil) + xksi1 )
-                  zlim   = xdiatno3(ji,jj,jk) + xdiatnh4(ji,jj,jk)
-
-                  zsilim = MIN( zprdia(ji,jj,jk)    / ( rtrn + prmax(ji,jj,jk) ),                 &
-                  &          trn(ji,jj,jk,jpfer) / ( concdfe(ji,jj,jk) + trn(ji,jj,jk,jpfer) ),   &
-                  &          trn(ji,jj,jk,jppo4) / ( concdnh4 + trn(ji,jj,jk,jppo4) ),            &
-                  &          zlim )
-                  zsilfac = 5.4 * EXP( -4.23 * zsilim ) * MAX( 0.e0, MIN( 1., 2.2 * ( zlim1 - 0.5 ) )  ) + 1.e0
+                  zlim  = trn(ji,jj,jk,jpsil) / ( trn(ji,jj,jk,jpsil) + xksi1 )
+                  zsilim = MIN( zprdia(ji,jj,jk) / ( prmax(ji,jj,jk) + rtrn ), xlimsi(ji,jj,jk) )
+                  zsilfac = 4.4 * EXP( -4.23 * zsilim ) * MAX( 0.e0, MIN( 1., 2.2 * ( zlim - 0.5 ) )  ) + 1.e0
                   zsiborn = MAX( 0.e0, ( trn(ji,jj,jk,jpsil) - 15.e-6 ) )
-                  zsilfac2 = 1.+ 3.* zsiborn / ( zsiborn + xksi2 )
-                  zsilfac = MIN( 6.4,zsilfac * zsilfac2)
-                  zysopt(ji,jj,jk) = grosip * zlim1 * zsilfac
+                  zsilfac2 = 1.+ 2.* zsiborn / ( zsiborn + xksi2 )
+                  zsilfac = MIN( 5.4, zsilfac * zsilfac2)
+                  zysopt(ji,jj,jk) = grosip * zlim * zsilfac
               ENDIF
             END DO
@@ -201,7 +242,7 @@
          DO ji = 1, jpi
             zmxltst = MAX( 0.e0, hmld(ji,jj) - heup(ji,jj) )
-            zmxlday = zmxltst**2 / rday
-            zmixnano(ji,jj) = 1.- zmxlday / ( 1.+ zmxlday )
-            zmixdiat(ji,jj) = 1.- zmxlday / ( 3.+ zmxlday )
+            zmxlday = zmxltst * zmxltst * r1_rday
+            zmixnano(ji,jj) = 1. - zmxlday / ( 3. + zmxlday )
+            zmixdiat(ji,jj) = 1. - zmxlday / ( 4. + zmxlday )
          END DO
       END DO
@@ -214,9 +255,10 @@
                   zprbio(ji,jj,jk) = zprbio(ji,jj,jk) * zmixnano(ji,jj)
                   zprdia(ji,jj,jk) = zprdia(ji,jj,jk) * zmixdiat(ji,jj)
+                  zprnch(ji,jj,jk) = zprnch(ji,jj,jk) * zmixnano(ji,jj)
+                  zprdch(ji,jj,jk) = zprdch(ji,jj,jk) * zmixdiat(ji,jj)
                ENDIF
             END DO
          END DO
       END DO
-
 
 !CDIR NOVERRCHK
@@ -230,22 +272,18 @@
                   !     Computation of the various production terms for nanophyto.
                   zetot2 = enano(ji,jj,jk) * zstrn(ji,jj)
-                  zmax = MAX( 0.1, xlimphy(ji,jj,jk) )
-                  zpislopen = zpislopead(ji,jj,jk)          &
-                  &         * trn(ji,jj,jk,jpnch) / ( rtrn + trn(ji,jj,jk,jpphy) * 12.)         &
-                  &         / ( prmax(ji,jj,jk) * rday * zmax + rtrn )
-
-                  zprbiochl = prmax(ji,jj,jk) * (  1.- EXP( -zpislopen * zetot2 )  )
-
                   zprorca(ji,jj,jk) = zprbio(ji,jj,jk)  * xlimphy(ji,jj,jk) * trn(ji,jj,jk,jpphy) * rfact2
-
-                  zpronew(ji,jj,jk) = zprorca(ji,jj,jk) * xnanono3(ji,jj,jk)    &
-                  &             / ( xnanono3(ji,jj,jk) + xnanonh4(ji,jj,jk) + rtrn )
-                  zprod = rday * zprorca(ji,jj,jk) * zprbiochl * trn(ji,jj,jk,jpphy) *zmax
-
-                  zprofen(ji,jj,jk) = (fecnm)**2 * zprod / chlcnm            &
-                  &              / (  zpislopead(ji,jj,jk) * zetot2 * trn(ji,jj,jk,jpnfe) + rtrn  )
-
-                  zprochln(ji,jj,jk) = chlcnm * 144. * zprod                  &
-                  &              / (  zpislopead(ji,jj,jk) * zetot2 * trn(ji,jj,jk,jpnch) + rtrn  )
+                  zpronew(ji,jj,jk) = zprorca(ji,jj,jk) * xnanono3(ji,jj,jk) / ( xnanono3(ji,jj,jk) + xnanonh4(ji,jj,jk) + rtrn )
+                  !
+                  zprod = rday * zprorca(ji,jj,jk) * zprnch(ji,jj,jk) * xlimphy(ji,jj,jk)
+                  zprochln(ji,jj,jk) = chlcmin * 12. * zprorca(ji,jj,jk)
+                  zprochln(ji,jj,jk) = zprochln(ji,jj,jk) + chlcnm * 12. * zprod / (  zpislopead(ji,jj,jk) * zetot2 +rtrn)
+                  !
+                  zratio = trn(ji,jj,jk,jpnfe) / ( trn(ji,jj,jk,jpphy) + rtrn )
+                  zratio = zratio / fecnm 
+                  zmax   = MAX( 0., ( 1. - zratio ) / ABS( 1.05 - zratio ) ) 
+                  zprofen(ji,jj,jk) = fecnm * prmax(ji,jj,jk)  &
+                  &             * ( 4. - 4.5 * xlimnfe(ji,jj,jk) / ( xlimnfe(ji,jj,jk) + 0.5 ) )    &
+                  &             * trn(ji,jj,jk,jpfer) / ( trn(ji,jj,jk,jpfer) + concnfe(ji,jj,jk) )  &
+                  &             * zmax * trn(ji,jj,jk,jpphy) * rfact2
                ENDIF
             END DO
@@ -262,29 +300,22 @@
                   !  Computation of the various production terms for diatoms
                   zetot2 = ediat(ji,jj,jk) * zstrn(ji,jj)
-                  zmax = MAX( 0.1, xlimdia(ji,jj,jk) )
-                  zpislope2n = zpislopead2(ji,jj,jk) * trn(ji,jj,jk,jpdch)        &
-                  &           / ( rtrn + trn(ji,jj,jk,jpdia) * 12.)        &
-                  &           / ( prmax(ji,jj,jk) * rday * zmax + rtrn )
-
-                  zprdiachl = prmax(ji,jj,jk) * (  1.- EXP( -zetot2 * zpislope2n )  )
-
                   zprorcad(ji,jj,jk) = zprdia(ji,jj,jk) * xlimdia(ji,jj,jk) * trn(ji,jj,jk,jpdia) * rfact2
-
-                  zpronewd(ji,jj,jk) = zprorcad(ji,jj,jk) * xdiatno3(ji,jj,jk)     &
-                  &              / ( xdiatno3(ji,jj,jk) + xdiatnh4(ji,jj,jk) + rtrn )
-
-                  zprod = rday * zprorcad(ji,jj,jk) * zprdiachl * trn(ji,jj,jk,jpdia) * zmax
-
-                  zprofed(ji,jj,jk) = (fecdm)**2 * zprod / chlcdm                   &
-                  &              / ( zpislopead2(ji,jj,jk) * zetot2 * trn(ji,jj,jk,jpdfe) + rtrn )
-
-                  zprochld(ji,jj,jk) = chlcdm * 144. * zprod       &
-                  &              / ( zpislopead2(ji,jj,jk) * zetot2 * trn(ji,jj,jk,jpdch) + rtrn )
-
+                  zpronewd(ji,jj,jk) = zprorcad(ji,jj,jk) * xdiatno3(ji,jj,jk) / ( xdiatno3(ji,jj,jk) + xdiatnh4(ji,jj,jk) + rtrn )
+                  !
+                  zprod = rday * zprorcad(ji,jj,jk) * zprdch(ji,jj,jk) * xlimdia(ji,jj,jk)
+                  zprochld(ji,jj,jk) = chlcmin * 12. * zprorcad(ji,jj,jk)
+                  zprochld(ji,jj,jk) = zprochld(ji,jj,jk) + chlcdm * 12. * zprod / ( zpislopead2(ji,jj,jk) * zetot2 +rtrn )
+                  !
+                  zratio = trn(ji,jj,jk,jpdfe) / ( trn(ji,jj,jk,jpdia) + rtrn )
+                  zratio = zratio / fecdm 
+                  zmax   = MAX( 0., ( 1. - zratio ) / ABS( 1.05 - zratio ) ) 
+                  zprofed(ji,jj,jk) = fecdm * prmax(ji,jj,jk)  &
+                  &             * ( 4. - 4.5 * xlimdfe(ji,jj,jk) / ( xlimdfe(ji,jj,jk) + 0.5 ) )    &
+                  &             * trn(ji,jj,jk,jpfer) / ( trn(ji,jj,jk,jpfer) + concdfe(ji,jj,jk) )  &
+                  &             * zmax * trn(ji,jj,jk,jpdia) * rfact2
                ENDIF
             END DO
          END DO
       END DO
-      !
 
       !   Update the arrays TRA which contain the biological sources and sinks
@@ -304,15 +335,12 @@
               tra(ji,jj,jk,jpdfe) = tra(ji,jj,jk,jpdfe) + zprofed(ji,jj,jk) * texcret2
               tra(ji,jj,jk,jpbsi) = tra(ji,jj,jk,jpbsi) + zprorcad(ji,jj,jk) * zysopt(ji,jj,jk) * texcret2
-              tra(ji,jj,jk,jpdoc) = tra(ji,jj,jk,jpdoc) + &
-              &                     excret2 * zprorcad(ji,jj,jk) + excret * zprorca(ji,jj,jk)
+              tra(ji,jj,jk,jpdoc) = tra(ji,jj,jk,jpdoc) + excret2 * zprorcad(ji,jj,jk) + excret * zprorca(ji,jj,jk)
               tra(ji,jj,jk,jpoxy) = tra(ji,jj,jk,jpoxy) + o2ut * ( zproreg + zproreg2) &
-              &                    + ( o2ut + o2nit ) * ( zpronew(ji,jj,jk) + zpronewd(ji,jj,jk) )
-              tra(ji,jj,jk,jpfer) = tra(ji,jj,jk,jpfer) &
-              &                     - texcret * zprofen(ji,jj,jk) - texcret2 * zprofed(ji,jj,jk)
-              tra(ji,jj,jk,jpsil) = tra(ji,jj,jk,jpsil) &
-              &                     - texcret2 * zprorcad(ji,jj,jk) * zysopt(ji,jj,jk)
+                 &                + ( o2ut + o2nit ) * ( zpronew(ji,jj,jk) + zpronewd(ji,jj,jk) )
+              tra(ji,jj,jk,jpfer) = tra(ji,jj,jk,jpfer) - texcret * zprofen(ji,jj,jk) - texcret2 * zprofed(ji,jj,jk)
+              tra(ji,jj,jk,jpsil) = tra(ji,jj,jk,jpsil) - texcret2 * zprorcad(ji,jj,jk) * zysopt(ji,jj,jk)
               tra(ji,jj,jk,jpdic) = tra(ji,jj,jk,jpdic) - zprorca(ji,jj,jk) - zprorcad(ji,jj,jk)
-              tra(ji,jj,jk,jptal) = tra(ji,jj,jk,jptal) &
-              &                    + rno3 * ( zpronew(ji,jj,jk) + zpronewd(ji,jj,jk) )
+              tra(ji,jj,jk,jptal) = tra(ji,jj,jk,jptal) + rno3 * ( zpronew(ji,jj,jk) + zpronewd(ji,jj,jk) ) &
+                 &                                      - rno3 * ( zproreg + zproreg2 )
           END DO
         END DO
@@ -320,10 +348,9 @@
 
      ! Total primary production per year
-
-#if defined key_degrad
-     tpp = tpp + glob_sum( ( zprorca(:,:,:) + zprorcad(:,:,:) ) * cvol(:,:,:) * facvol(:,:,:) )
-#else
-     tpp = tpp + glob_sum( ( zprorca(:,:,:) + zprorcad(:,:,:) ) * cvol(:,:,:) )
-#endif
+     IF( lk_degrad )  THEN
+        tpp = tpp + glob_sum( ( zprorca(:,:,:) + zprorcad(:,:,:) ) * cvol(:,:,:) * facvol(:,:,:) )
+     ELSE
+        tpp = tpp + glob_sum( ( zprorca(:,:,:) + zprorcad(:,:,:) ) * cvol(:,:,:) )
+     ENDIF
 
      IF( kt == nitend .AND. jnt == nrdttrc .AND. lwp ) THEN
@@ -333,21 +360,8 @@
       ENDIF
 
-#if defined key_diatrc && ! defined key_iomput
-      !   Supplementary diagnostics
+#if defined key_diatrc 
       zrfact2 = 1.e3 * rfact2r
-      trc3d(:,:,:,jp_pcs0_3d + 4)  = zprorca (:,:,:) * zrfact2 * tmask(:,:,:)
-      trc3d(:,:,:,jp_pcs0_3d + 5)  = zprorcad(:,:,:) * zrfact2 * tmask(:,:,:)
-      trc3d(:,:,:,jp_pcs0_3d + 6)  = zpronew (:,:,:) * zrfact2 * tmask(:,:,:)
-      trc3d(:,:,:,jp_pcs0_3d + 7)  = zpronewd(:,:,:) * zrfact2 * tmask(:,:,:)
-      trc3d(:,:,:,jp_pcs0_3d + 8)  = zprorcad(:,:,:) * zrfact2 * tmask(:,:,:) * zysopt(:,:,:)
-      trc3d(:,:,:,jp_pcs0_3d + 9)  = zprofed (:,:,:) * zrfact2 * tmask(:,:,:)
-#  if ! defined key_kriest
-      trc3d(:,:,:,jp_pcs0_3d + 10) = zprofen (:,:,:) * zrfact2 * tmask(:,:,:)
-#  endif
-#endif
-
-#if defined key_diatrc && defined key_iomput
-      zrfact2 = 1.e3 * rfact2r
-      IF ( jnt == nrdttrc ) then
+#if defined key_iomput
+      IF( jnt == nrdttrc ) THEN
          CALL iom_put( "PPPHY" , zprorca (:,:,:) * zrfact2 * tmask(:,:,:) )  ! primary production by nanophyto
          CALL iom_put( "PPPHY2", zprorcad(:,:,:) * zrfact2 * tmask(:,:,:) )  ! primary production by diatom
@@ -357,5 +371,15 @@
          CALL iom_put( "PFeD"  , zprofed (:,:,:) * zrfact2 * tmask(:,:,:) )  ! biogenic iron production by diatom
          CALL iom_put( "PFeN"  , zprofen (:,:,:) * zrfact2 * tmask(:,:,:) )  ! biogenic iron production by nanophyto
-      ENDIF
+#else
+         trc3d(:,:,:,jp_pcs0_3d + 4)  = zprorca (:,:,:) * zrfact2 * tmask(:,:,:)
+         trc3d(:,:,:,jp_pcs0_3d + 5)  = zprorcad(:,:,:) * zrfact2 * tmask(:,:,:)
+         trc3d(:,:,:,jp_pcs0_3d + 6)  = zpronew (:,:,:) * zrfact2 * tmask(:,:,:)
+         trc3d(:,:,:,jp_pcs0_3d + 7)  = zpronewd(:,:,:) * zrfact2 * tmask(:,:,:)
+         trc3d(:,:,:,jp_pcs0_3d + 8)  = zprorcad(:,:,:) * zrfact2 * tmask(:,:,:) * zysopt(:,:,:)
+         trc3d(:,:,:,jp_pcs0_3d + 9)  = zprofed (:,:,:) * zrfact2 * tmask(:,:,:)
+#  if ! defined key_kriest
+         trc3d(:,:,:,jp_pcs0_3d + 10) = zprofen (:,:,:) * zrfact2 * tmask(:,:,:)
+#  endif
+#endif
 #endif
 
@@ -367,6 +391,8 @@
 
       IF(  wrk_not_released(2, 1,2,3)                          .OR.  &
-           wrk_not_released(3, 2,3,4,5,6,7,8,9,10,11,12,13,14)   )   &
+           wrk_not_released(3, 2,3,4,5,6,7,8,9,10,11,12,13,14,15)   )   &
            CALL ctl_stop('p4z_prod: failed to release workspace arrays')
+      !
+      DEALLOCATE( zysopt )
       !
    END SUBROUTINE p4z_prod
@@ -384,10 +410,11 @@
       !! ** input   :   Namelist nampisprod
       !!----------------------------------------------------------------------
-      NAMELIST/nampisprod/ pislope, pislope2, excret, excret2, chlcnm, chlcdm,   &
-         &              fecnm, fecdm, grosip
+      !
+      NAMELIST/nampisprod/ pislope, pislope2, bresp, excret, excret2,  &
+         &                 chlcnm, chlcdm, chlcmin, fecnm, fecdm, grosip
       !!----------------------------------------------------------------------
 
-      REWIND( numnat )                     ! read numnat
-      READ  ( numnat, nampisprod )
+      REWIND( numnatp )                     ! read numnat
+      READ  ( numnatp, nampisprod )
 
       IF(lwp) THEN                         ! control print
@@ -399,15 +426,18 @@
          WRITE(numout,*) '    excretion ratio of nanophytoplankton      excret    =', excret
          WRITE(numout,*) '    excretion ratio of diatoms                excret2   =', excret2
+         WRITE(numout,*) '    basal respiration in phytoplankton        bresp     =', bresp
          WRITE(numout,*) '    P-I slope  for diatoms                    pislope2  =', pislope2
          WRITE(numout,*) '    Minimum Chl/C in nanophytoplankton        chlcnm    =', chlcnm
          WRITE(numout,*) '    Minimum Chl/C in diatoms                  chlcdm    =', chlcdm
+         WRITE(numout,*) '    Maximum Chl/C in phytoplankton            chlcmin   =', chlcmin
          WRITE(numout,*) '    Maximum Fe/C in nanophytoplankton         fecnm     =', fecnm
          WRITE(numout,*) '    Minimum Fe/C in diatoms                   fecdm     =', fecdm
       ENDIF
       !
-      rday1     = 0.6 / rday 
-      texcret   = 1.0 - excret
-      texcret2  = 1.0 - excret2
-      tpp       = 0.
+      r1_rday   = 1._wp / rday 
+      r1_bresp  = bresp * r1_rday
+      texcret   = 1._wp - excret
+      texcret2  = 1._wp - excret2
+      tpp       = 0._wp
       !
    END SUBROUTINE p4z_prod_init
@@ -418,5 +448,5 @@
       !!                     ***  ROUTINE p4z_prod_alloc  ***
       !!----------------------------------------------------------------------
-      ALLOCATE( prmax(jpi,jpj,jpk), STAT=p4z_prod_alloc )
+      ALLOCATE( prmax(jpi,jpj,jpk), quotan(jpi,jpj,jpk), quotad(jpi,jpj,jpk), STAT = p4z_prod_alloc )
       !
       IF( p4z_prod_alloc /= 0 ) CALL ctl_warn('p4z_prod_alloc : failed to allocate arrays.')
Index: branches/2011/dev_r2787_PISCES_improvment/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zrem.F90
===================================================================
--- branches/2011/dev_r2787_PISCES_improvment/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zrem.F90	(revision 2822)
+++ branches/2011/dev_r2787_PISCES_improvment/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zrem.F90	(revision 2823)
@@ -6,4 +6,5 @@
    !! History :   1.0  !  2004     (O. Aumont) Original code
    !!             2.0  !  2007-12  (C. Ethe, G. Madec)  F90
+   !!             3.4  !  2011-06  (O. Aumont, C. Ethe) Quota model for iron
    !!----------------------------------------------------------------------
 #if defined key_pisces
@@ -12,15 +13,17 @@
    !!   'key_pisces'                                       PISCES bio-model
    !!----------------------------------------------------------------------
-   !!   p4z_rem       :   Compute remineralization/scavenging of organic compounds
-   !!----------------------------------------------------------------------
-   USE trc
-   USE oce_trc         !
-   USE sms_pisces      ! 
-   USE prtctl_trc
-   USE p4zint
-   USE p4zopt
-   USE p4zmeso
-   USE p4zprod
-   USE p4zche
+   !!   p4z_rem       :  Compute remineralization/scavenging of organic compounds
+   !!   p4z_rem_init  :  Initialisation of parameters for remineralisation
+   !!   p4z_rem_alloc :  Allocate remineralisation variables
+   !!----------------------------------------------------------------------
+   USE oce_trc         !  shared variables between ocean and passive tracers
+   USE trc             !  passive tracers common variables 
+   USE sms_pisces      !  PISCES Source Minus Sink variables
+   USE p4zopt          !  optical model
+   USE p4zche          !  chemical model
+   USE p4zprod         !  Growth rate of the 2 phyto groups
+   USE p4zmeso         !  Sources and sinks of mesozooplankton
+   USE p4zint          !  interpolation and computation of various fields
+   USE prtctl_trc      !  print control for debugging
 
    IMPLICIT NONE
@@ -31,13 +34,18 @@
    PUBLIC   p4z_rem_alloc
 
-   REAL(wp), PUBLIC ::   &
-     xremik  = 0.3_wp      ,  & !:
-     xremip  = 0.025_wp    ,  & !:
-     nitrif  = 0.05_wp     ,  & !:
-     xsirem  = 0.015_wp    ,  & !:
-     xlam1   = 0.005_wp    ,  & !:
-     oxymin  = 1.e-6_wp         !:
-
-   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   denitr   !: denitrification array
+   !! * Shared module variables
+   REAL(wp), PUBLIC ::  xremik    = 0.3_wp     !: remineralisation rate of POC 
+   REAL(wp), PUBLIC ::  xremip    = 0.025_wp   !: remineralisation rate of DOC
+   REAL(wp), PUBLIC ::  nitrif    = 0.05_wp    !: NH4 nitrification rate 
+   REAL(wp), PUBLIC ::  xsirem    = 0.003_wp   !: remineralisation rate of POC 
+   REAL(wp), PUBLIC ::  xsiremlab = 0.025_wp   !: fast remineralisation rate of POC 
+   REAL(wp), PUBLIC ::  xsilab    = 0.31_wp    !: fraction of labile biogenic silica 
+   REAL(wp), PUBLIC ::  xlam1     = 0.005_wp   !: scavenging rate of Iron 
+   REAL(wp), PUBLIC ::  oxymin    = 1.e-6_wp   !: halk saturation constant for anoxia 
+   REAL(wp), PUBLIC ::  ligand    = 0.6E-9_wp  !: ligand concentration in the ocean 
+
+
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   denitr     !: denitrification array
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   denitnh4   !: -    -    -    -   -
 
 
@@ -61,14 +69,14 @@
       USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
       USE wrk_nemo, ONLY:   ztempbac => wrk_2d_1
-      USE wrk_nemo, ONLY:   zdepbac  => wrk_3d_2 , zolimi => wrk_3d_3
+      USE wrk_nemo, ONLY:   zdepbac  => wrk_3d_2, zolimi => wrk_3d_3, zolimi2 => wrk_3d_4
       !
       INTEGER, INTENT(in) ::   kt ! ocean time step
       !
       INTEGER  ::   ji, jj, jk
-      REAL(wp) ::   zremip, zremik , zlam1b
+      REAL(wp) ::   zremip, zremik , zlam1b, zdepbac2
       REAL(wp) ::   zkeq  , zfeequi, zsiremin, zfesatur
-      REAL(wp) ::   zsatur, zsatur2, znusil
+      REAL(wp) ::   zsatur, zsatur2, znusil, zdep, zfactdep
       REAL(wp) ::   zbactfer, zorem, zorem2, zofer
-      REAL(wp) ::   zosil, zdenom1, zscave, zaggdfe
+      REAL(wp) ::   zosil, zdenom1, zscave, zaggdfe, zcoag
 #if ! defined key_kriest
       REAL(wp) ::   zofer2, zdenom, zdenom2
@@ -78,5 +86,5 @@
       !!---------------------------------------------------------------------
 
-      IF(  wrk_in_use(2, 1)  .OR.  wrk_in_use(3, 2,3)  ) THEN
+      IF(  wrk_in_use(2, 1)  .OR.  wrk_in_use(3, 2,3,4)  ) THEN
          CALL ctl_stop('p4z_rem: requested workspace arrays unavailable')   ;   RETURN
       ENDIF
@@ -85,4 +93,5 @@
        zdepbac (:,:,:) = 0._wp
        zolimi  (:,:,:) = 0._wp
+       zolimi2 (:,:,:) = 0._wp
        ztempbac(:,:)   = 0._wp
 
@@ -93,9 +102,10 @@
          DO jj = 1, jpj
             DO ji = 1, jpi
-               IF( fsdept(ji,jj,jk) < 120. ) THEN
+               zdep = MAX( hmld(ji,jj), heup(ji,jj) )
+               IF( fsdept(ji,jj,jk) < zdep ) THEN
                   zdepbac(ji,jj,jk) = MIN( 0.7 * ( trn(ji,jj,jk,jpzoo) + 2.* trn(ji,jj,jk,jpmes) ), 4.e-6 )
                   ztempbac(ji,jj)   = zdepbac(ji,jj,jk)
                ELSE
-                  zdepbac(ji,jj,jk) = MIN( 1., 120./ fsdept(ji,jj,jk) ) * ztempbac(ji,jj)
+                  zdepbac(ji,jj,jk) = MIN( 1., zdep / fsdept(ji,jj,jk) ) * ztempbac(ji,jj)
                ENDIF
             END DO
@@ -126,27 +136,22 @@
                !     of the bacterial activity. 
                zremik = xremik * zstep / 1.e-6 * xlimbac(ji,jj,jk) * zdepbac(ji,jj,jk) 
-               zremik = MAX( zremik, 5.5e-4 * xstep )
-
+               zremik = MAX( zremik, 2.e-4 * xstep )
                !     Ammonification in oxic waters with oxygen consumption
                !     -----------------------------------------------------
-               zolimi(ji,jj,jk) = MIN(  ( trn(ji,jj,jk,jpoxy) - rtrn ) / o2ut,  &
-                  &                    zremik * ( 1.- nitrfac(ji,jj,jk) ) * trn(ji,jj,jk,jpdoc)  ) 
-
+               zolimi (ji,jj,jk) = zremik * ( 1.- nitrfac(ji,jj,jk) ) * trn(ji,jj,jk,jpdoc) 
+               zolimi2(ji,jj,jk) = MIN( ( trn(ji,jj,jk,jpoxy) - rtrn ) / o2ut, zolimi(ji,jj,jk) ) 
                !     Ammonification in suboxic waters with denitrification
                !     -------------------------------------------------------
-               denitr(ji,jj,jk) = MIN(  ( trn(ji,jj,jk,jpno3) - rtrn ) / rdenit,   &
+               denitr(ji,jj,jk)  = MIN(  ( trn(ji,jj,jk,jpno3) - rtrn ) / rdenit,   &
                   &                     zremik * nitrfac(ji,jj,jk) * trn(ji,jj,jk,jpdoc)  )
-            END DO
-         END DO
-      END DO
-
-      DO jk = 1, jpkm1
-         DO jj = 1, jpj
-            DO ji = 1, jpi
+               !
                zolimi (ji,jj,jk) = MAX( 0.e0, zolimi (ji,jj,jk) )
+               zolimi2(ji,jj,jk) = MAX( 0.e0, zolimi2(ji,jj,jk) )
                denitr (ji,jj,jk) = MAX( 0.e0, denitr (ji,jj,jk) )
-            END DO
-         END DO
-      END DO
+               !
+            END DO
+         END DO
+      END DO
+
 
       DO jk = 1, jpkm1
@@ -161,14 +166,12 @@
                !    below 2 umol/L. Inhibited at strong light 
                !    ----------------------------------------------------------
-               zonitr  = nitrif * zstep * trn(ji,jj,jk,jpnh4) / ( 1.+ emoy(ji,jj,jk) ) * ( 1.- nitrfac(ji,jj,jk) ) 
-
+               zonitr  =nitrif * zstep * trn(ji,jj,jk,jpnh4) / ( 1.+ emoy(ji,jj,jk) ) * ( 1.- nitrfac(ji,jj,jk) ) 
+               denitnh4(ji,jj,jk) = nitrif * zstep * trn(ji,jj,jk,jpnh4) * nitrfac(ji,jj,jk) 
                !   Update of the tracers trends
                !   ----------------------------
-
-               tra(ji,jj,jk,jpnh4) = tra(ji,jj,jk,jpnh4) - zonitr
-               tra(ji,jj,jk,jpno3) = tra(ji,jj,jk,jpno3) + zonitr
+               tra(ji,jj,jk,jpnh4) = tra(ji,jj,jk,jpnh4) - zonitr - denitnh4(ji,jj,jk)
+               tra(ji,jj,jk,jpno3) = tra(ji,jj,jk,jpno3) + zonitr - rdenita * denitnh4(ji,jj,jk)
                tra(ji,jj,jk,jpoxy) = tra(ji,jj,jk,jpoxy) - o2nit * zonitr
-               tra(ji,jj,jk,jptal) = tra(ji,jj,jk,jptal) - rno3  * zonitr
-
+               tra(ji,jj,jk,jptal) = tra(ji,jj,jk,jptal) - 2 * rno3 * zonitr + rno3 * ( rdenita - 1. ) * denitnh4(ji,jj,jk)
             END DO
          END DO
@@ -189,9 +192,9 @@
                !    studies (especially at Papa) have shown this uptake to be significant
                !    ----------------------------------------------------------
-               zbactfer = 15.e-6 * rfact2 * 4.* 0.4 * prmax(ji,jj,jk)           &
-                  &               * ( xlimphy(ji,jj,jk) * zdepbac(ji,jj,jk))           &
-                  &               * ( xlimphy(ji,jj,jk) * zdepbac(ji,jj,jk))           &
-                  &                  / ( xkgraz2 + zdepbac(ji,jj,jk) )                    &
-                  &                  * ( 0.5 + SIGN( 0.5, trn(ji,jj,jk,jpfer) -2.e-11 )  )
+               zdepbac2 = zdepbac(ji,jj,jk) * zdepbac(ji,jj,jk)
+               zbactfer = 20.e-6 * rfact2 * prmax(ji,jj,jk)                                 &
+                  &              * trn(ji,jj,jk,jpfer) / ( 5E-10 + trn(ji,jj,jk,jpfer) )    &
+                  &              * zdepbac2 / ( xkgraz2 + zdepbac(ji,jj,jk) )               &
+                  &              * ( 0.5 + SIGN( 0.5, trn(ji,jj,jk,jpfer) -2.e-11 )  )
 
                tra(ji,jj,jk,jpfer) = tra(ji,jj,jk,jpfer) - zbactfer
@@ -221,5 +224,5 @@
                !    POC disaggregation by turbulence and bacterial activity. 
                !    -------------------------------------------------------------
-               zremip = xremip * zstep * tgfunc(ji,jj,jk) * ( 1.- 0.5 * nitrfac(ji,jj,jk) ) 
+               zremip = xremip * zstep * tgfunc(ji,jj,jk) * ( 1.- 0.7 * nitrfac(ji,jj,jk) ) 
 
                !    POC disaggregation rate is reduced in anoxic zone as shown by
@@ -273,11 +276,14 @@
                !     Remineralization rate of BSi depedant on T and saturation
                !     ---------------------------------------------------------
-               zsatur  = ( sio3eq(ji,jj,jk) - trn(ji,jj,jk,jpsil) ) / ( sio3eq(ji,jj,jk) + rtrn )
-               zsatur  = MAX( rtrn, zsatur )
-               zsatur2 = zsatur * ( 1. + tsn(ji,jj,jk,jp_tem) / 400.)**4
-               znusil  = 0.225  * ( 1. + tsn(ji,jj,jk,jp_tem) / 15.) * zsatur + 0.775 * zsatur2**9
-               zsiremin = xsirem * zstep * znusil
-               zosil = zsiremin * trn(ji,jj,jk,jpdsi)
-
+               zsatur   = ( sio3eq(ji,jj,jk) - trn(ji,jj,jk,jpsil) ) / ( sio3eq(ji,jj,jk) + rtrn )
+               zsatur   = MAX( rtrn, zsatur )
+               zsatur2  = zsatur * ( 1. + tsn(ji,jj,jk,jp_tem) / 400.)**4
+               znusil   = 0.225  * ( 1. + tsn(ji,jj,jk,jp_tem) / 15.) * zsatur + 0.775 * zsatur2**9.25
+               zdep     = MAX( hmld(ji,jj), heup(ji,jj) ) 
+               zdep     = MAX( 0., fsdept(ji,jj,jk) - zdep )
+               zfactdep = xsilab * EXP(-( xsiremlab - xsirem ) * zdep / wsbio2 )
+               zsiremin = ( xsiremlab * zfactdep + xsirem * ( 1. - zfactdep ) ) * zstep * znusil
+               zosil    = zsiremin * trn(ji,jj,jk,jpdsi)
+               !
                tra(ji,jj,jk,jpdsi) = tra(ji,jj,jk,jpdsi) - zosil
                tra(ji,jj,jk,jpsil) = tra(ji,jj,jk,jpsil) + zosil
@@ -293,5 +299,5 @@
        ENDIF
 
-      zfesatur = 0.6e-9
+      zfesatur = ligand
 !CDIR NOVERRCHK
       DO jk = 1, jpkm1
@@ -312,7 +318,5 @@
            &           ( trn(ji,jj,jk,jppoc) + trn(ji,jj,jk,jpdsi) + trn(ji,jj,jk,jpcal) + rtrn )
 #else
-               zdenom = 1. / ( trn(ji,jj,jk,jppoc) + trn(ji,jj,jk,jpgoc)  &
-           &            + trn(ji,jj,jk,jpdsi) + trn(ji,jj,jk,jpcal) + rtrn )
-
+               zdenom = 1. / ( trn(ji,jj,jk,jppoc) + trn(ji,jj,jk,jpgoc) + trn(ji,jj,jk,jpdsi) + trn(ji,jj,jk,jpcal) + rtrn )
                zdenom1 = trn(ji,jj,jk,jppoc) * zdenom
                zdenom2 = trn(ji,jj,jk,jpgoc) * zdenom
@@ -337,24 +341,22 @@
                !  Increased scavenging for very high iron concentrations
                !  found near the coasts due to increased lithogenic particles
-               !  and let s say it unknown processes (precipitation, ...)
+               !  and let say it is unknown processes (precipitation, ...)
                !  -----------------------------------------------------------
+               zlam1b  = xlam1 * MAX( 0.e0, ( trn(ji,jj,jk,jpfer) * 1.e9 - 1. ) )
+               zcoag   = zfeequi * zlam1b * zstep
                zlamfac = MAX( 0.e0, ( gphit(ji,jj) + 55.) / 30. )
                zlamfac = MIN( 1.  , zlamfac )
+               zdep    =  MIN(1., 1000. / fsdept(ji,jj,jk) )
 #if ! defined key_kriest
                zlam1b = (  80.* ( trn(ji,jj,jk,jpdoc) + 35.e-6 )                           &
-                  &     + 698.*   trn(ji,jj,jk,jppoc) + 1.05e4 * trn(ji,jj,jk,jpgoc)  )                    &
-                  &   * xdiss(ji,jj,jk) + 1E-4 * (1.-zlamfac)                &
-                  &   + xlam1 * MAX( 0.e0, ( trn(ji,jj,jk,jpfer) * 1.e9 - 1.)  )
-#else
-               zlam1b = (  80.* (trn(ji,jj,jk,jpdoc) + 35E-6)           &
+                  &     + 698.*   trn(ji,jj,jk,jppoc) + 1.05e4 * trn(ji,jj,jk,jpgoc)  )    &
+                  &   * xdiss(ji,jj,jk) + 1E-4 * ( 1. - zlamfac ) * zdep
+#else
+               zlam1b = (  80.* (trn(ji,jj,jk,jpdoc) + 35E-6)              &
                   &     + 698.*  trn(ji,jj,jk,jppoc)  )                    &
-                  &   * xdiss(ji,jj,jk) + 1E-4 * (1.-zlamfac)           &
-                  &   + xlam1 * MAX( 0.e0, ( trn(ji,jj,jk,jpfer) * 1.e9 - 1.)  )
-#endif
-
+                  &   * xdiss(ji,jj,jk) + 1E-4 * ( 1. - zlamfac ) * zdep
+#endif
                zaggdfe = zlam1b * zstep * 0.5 * ( trn(ji,jj,jk,jpfer) - zfeequi )
-
-               tra(ji,jj,jk,jpfer) = tra(ji,jj,jk,jpfer) - zscave - zaggdfe
-
+               tra(ji,jj,jk,jpfer) = tra(ji,jj,jk,jpfer) - zscave - zaggdfe - zcoag
 #if defined key_kriest
                tra(ji,jj,jk,jpsfe) = tra(ji,jj,jk,jpsfe) + zscave * zdenom1
@@ -378,11 +380,11 @@
 
       DO jk = 1, jpkm1
-         tra(:,:,jk,jppo4) = tra(:,:,jk,jppo4) + zolimi(:,:,jk) + denitr(:,:,jk)
-         tra(:,:,jk,jpnh4) = tra(:,:,jk,jpnh4) + zolimi(:,:,jk) + denitr(:,:,jk)
-         tra(:,:,jk,jpno3) = tra(:,:,jk,jpno3) - denitr(:,:,jk) * rdenit
-         tra(:,:,jk,jpdoc) = tra(:,:,jk,jpdoc) - zolimi(:,:,jk) - denitr(:,:,jk)
-         tra(:,:,jk,jpoxy) = tra(:,:,jk,jpoxy) - zolimi(:,:,jk) * o2ut
-         tra(:,:,jk,jpdic) = tra(:,:,jk,jpdic) + zolimi(:,:,jk) + denitr(:,:,jk)
-         tra(:,:,jk,jptal) = tra(:,:,jk,jptal) + denitr(:,:,jk) * rno3 * rdenit
+         tra(:,:,jk,jppo4) = tra(:,:,jk,jppo4) + zolimi (:,:,jk) + denitr(:,:,jk)
+         tra(:,:,jk,jpnh4) = tra(:,:,jk,jpnh4) + zolimi (:,:,jk) + denitr(:,:,jk)
+         tra(:,:,jk,jpno3) = tra(:,:,jk,jpno3) - denitr (:,:,jk) * rdenit
+         tra(:,:,jk,jpdoc) = tra(:,:,jk,jpdoc) - zolimi (:,:,jk) - denitr(:,:,jk)
+         tra(:,:,jk,jpoxy) = tra(:,:,jk,jpoxy) - zolimi2(:,:,jk) * o2ut
+         tra(:,:,jk,jpdic) = tra(:,:,jk,jpdic) + zolimi (:,:,jk) + denitr(:,:,jk)
+         tra(:,:,jk,jptal) = tra(:,:,jk,jptal) + rno3 * ( zolimi(:,:,jk) + ( rdenit + 1.) * denitr(:,:,jk) )
       END DO
 
@@ -394,5 +396,5 @@
       !
       IF(  wrk_not_released(2, 1)     .OR.   &
-           wrk_not_released(3, 2,3)  )   CALL ctl_stop('p4z_rem: failed to release workspace arrays')
+           wrk_not_released(3, 2,3,4)  )   CALL ctl_stop('p4z_rem: failed to release workspace arrays')
       !
    END SUBROUTINE p4z_rem
@@ -411,9 +413,9 @@
       !!
       !!----------------------------------------------------------------------
-      NAMELIST/nampisrem/ xremik, xremip, nitrif, xsirem, xlam1, oxymin
-      !!----------------------------------------------------------------------
-
-      REWIND( numnat )                     ! read numnat
-      READ  ( numnat, nampisrem )
+      NAMELIST/nampisrem/ xremik, xremip, nitrif, xsirem, xsiremlab, xsilab,   &
+      &                   xlam1, oxymin, ligand 
+
+      REWIND( numnatp )                     ! read numnat
+      READ  ( numnatp, nampisrem )
 
       IF(lwp) THEN                         ! control print
@@ -424,11 +426,15 @@
          WRITE(numout,*) '    remineralization rate of DOC              xremik    =', xremik
          WRITE(numout,*) '    remineralization rate of Si               xsirem    =', xsirem
+         WRITE(numout,*) '    fast remineralization rate of Si          xsiremlab =', xsiremlab
+         WRITE(numout,*) '    fraction of labile biogenic silica        xsilab    =', xsilab
          WRITE(numout,*) '    scavenging rate of Iron                   xlam1     =', xlam1
          WRITE(numout,*) '    NH4 nitrification rate                    nitrif    =', nitrif
          WRITE(numout,*) '    halk saturation constant for anoxia       oxymin    =', oxymin
+         WRITE(numout,*) '    ligand concentration in the ocean         ligand    =', ligand
       ENDIF
       !
-      nitrfac(:,:,:) = 0._wp
-      denitr (:,:,:) = 0._wp
+      nitrfac (:,:,:) = 0._wp
+      denitr  (:,:,:) = 0._wp
+      denitnh4(:,:,:) = 0._wp
       !
    END SUBROUTINE p4z_rem_init
@@ -439,5 +445,5 @@
       !!                     ***  ROUTINE p4z_rem_alloc  ***
       !!----------------------------------------------------------------------
-      ALLOCATE( denitr(jpi,jpj,jpk), STAT=p4z_rem_alloc )
+      ALLOCATE( denitr(jpi,jpj,jpk), denitnh4(jpi,jpj,jpk), STAT=p4z_rem_alloc )
       !
       IF( p4z_rem_alloc /= 0 )   CALL ctl_warn('p4z_rem_alloc: failed to allocate arrays')
Index: branches/2011/dev_r2787_PISCES_improvment/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zsed.F90
===================================================================
--- branches/2011/dev_r2787_PISCES_improvment/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zsed.F90	(revision 2822)
+++ branches/2011/dev_r2787_PISCES_improvment/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zsed.F90	(revision 2823)
@@ -6,4 +6,5 @@
    !! History :   1.0  !  2004-03 (O. Aumont) Original code
    !!             2.0  !  2007-12  (C. Ethe, G. Madec)  F90
+   !!             3.4  !  2011-06  (O. Aumont, C. Ethe) USE of fldread
    !!----------------------------------------------------------------------
 #if defined key_pisces
@@ -15,15 +16,16 @@
    !!   p4z_sed_init   :  Initialization of p4z_sed
    !!----------------------------------------------------------------------
-   USE trc
-   USE oce_trc         !
-   USE sms_pisces
-   USE prtctl_trc
-   USE p4zbio
-   USE p4zint
-   USE p4zopt
-   USE p4zsink
-   USE p4zrem
-   USE p4zlim
-   USE iom
+   USE oce_trc         !  shared variables between ocean and passive tracers
+   USE trc             !  passive tracers common variables 
+   USE sms_pisces      !  PISCES Source Minus Sink variables
+   USE p4zsink         !  vertical flux of particulate matter due to sinking
+   USE p4zopt          !  optical model
+   USE p4zlim          !  Co-limitations of differents nutrients
+   USE p4zrem          !  Remineralisation of organic matter
+   USE p4zint          !  interpolation and computation of various fields
+   USE iom             !  I/O manager
+   USE fldread         !  time interpolation
+   USE prtctl_trc      !  print control for debugging
+
 
 
@@ -36,26 +38,33 @@
 
    !! * Shared module variables
-   LOGICAL, PUBLIC :: ln_dustfer  = .FALSE.    !: boolean for dust input from the atmosphere
-   LOGICAL, PUBLIC :: ln_river    = .FALSE.    !: boolean for river input of nutrients
-   LOGICAL, PUBLIC :: ln_ndepo    = .FALSE.    !: boolean for atmospheric deposition of N
-   LOGICAL, PUBLIC :: ln_sedinput = .FALSE.    !: boolean for Fe input from sediments
-
-   REAL(wp), PUBLIC :: sedfeinput = 1.E-9_wp   !: Coastal release of Iron
-   REAL(wp), PUBLIC :: dustsolub  = 0.014_wp   !: Solubility of the dust
+   LOGICAL  :: ln_dust     = .FALSE.    !: boolean for dust input from the atmosphere
+   LOGICAL  :: ln_river    = .FALSE.    !: boolean for river input of nutrients
+   LOGICAL  :: ln_ndepo    = .FALSE.    !: boolean for atmospheric deposition of N
+   LOGICAL  :: ln_ironsed  = .FALSE.    !: boolean for Fe input from sediments
+
+   REAL(wp) :: sedfeinput  = 1.E-9_wp   !: Coastal release of Iron
+   REAL(wp) :: dustsolub   = 0.014_wp   !: Solubility of the dust
+   REAL(wp) :: wdust       = 2.0_wp     !: Sinking speed of the dust 
+   REAL(wp) :: nitrfix     = 1E-7_wp    !: Nitrogen fixation rate   
+   REAL(wp) :: diazolight  = 50._wp     !: Nitrogen fixation sensitivty to light 
+   REAL(wp) :: concfediaz  = 1.E-10_wp  !: Fe half-saturation Cste for diazotrophs 
+
 
    !! * Module variables
    REAL(wp) :: ryyss                  !: number of seconds per year 
-   REAL(wp) :: ryyss1                 !: inverse of ryyss
+   REAL(wp) :: r1_ryyss                 !: inverse of ryyss
    REAL(wp) :: rmtss                  !: number of seconds per month
-   REAL(wp) :: rday1                  !: inverse of rday
-
-   INTEGER , PARAMETER :: jpmth = 12  !: number of months per year
-   INTEGER , PARAMETER :: jpyr  = 1   !: one year
-
-   INTEGER ::  numdust                !: logical unit for surface fluxes data
-   INTEGER ::  nflx1 , nflx2          !: first and second record used
-   INTEGER ::  nflx11, nflx12
-
-   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: dustmo    !: set of dust fields
+   REAL(wp) :: r1_rday                  !: inverse of rday
+   LOGICAL  :: ll_sbc
+
+   TYPE(FLD), ALLOCATABLE, DIMENSION(:) ::   sf_dust      ! structure of input dust
+   TYPE(FLD), ALLOCATABLE, DIMENSION(:) ::   sf_riverdic  ! structure of input riverdic
+   TYPE(FLD), ALLOCATABLE, DIMENSION(:) ::   sf_riverdoc  ! structure of input riverdoc
+   TYPE(FLD), ALLOCATABLE, DIMENSION(:) ::   sf_ndepo     ! structure of input nitrogen deposition
+   TYPE(FLD), ALLOCATABLE, DIMENSION(:) ::   sf_ironsed   ! structure of input iron from sediment
+
+   INTEGER , PARAMETER :: nbtimes = 365  !: maximum number of times record in a file
+   INTEGER  :: ntimes_dust, ntimes_riv, ntimes_ndep       ! number of time steps in a file
+
    REAL(wp), ALLOCATABLE, SAVE,   DIMENSION(:,:) :: dust      !: dust fields
    REAL(wp), ALLOCATABLE, SAVE,   DIMENSION(:,:) :: rivinp, cotdep    !: river input fields
@@ -86,6 +95,7 @@
       !! ** Method  : - ???
       !!---------------------------------------------------------------------
-      USE wrk_nemo, ONLY: wrk_in_use, wrk_not_released
-      USE wrk_nemo, ONLY: zsidep => wrk_2d_1, zwork => wrk_2d_2, zwork1 => wrk_2d_3
+      USE wrk_nemo, ONLY: wrk_in_USE, wrk_not_released
+      USE wrk_nemo, ONLY: zsidep   => wrk_2d_11
+      USE wrk_nemo, ONLY: zwork1   => wrk_2d_12, zwork2 => wrk_2d_13, zwork3 => wrk_2d_14
       USE wrk_nemo, ONLY: znitrpot => wrk_3d_2, zirondep => wrk_3d_3
       !
@@ -96,23 +106,25 @@
       REAL(wp) ::   zrivalk, zrivsil, zrivpo4
 #endif
-      REAL(wp) ::   zdenitot, znitrpottot, zlim, zfact
-      REAL(wp) ::   zwsbio3, zwsbio4, zwscal
+      REAL(wp) ::   zdenitot, znitrpottot, zlim, zfact, zfactcal
+      REAL(wp) ::   zsiloss, zcaloss, zwsbio3, zwsbio4, zwscal, zdep
       CHARACTER (len=25) :: charout
       !!---------------------------------------------------------------------
 
-      IF( ( wrk_in_use(2, 1,2,3) ) .OR. ( wrk_in_use(3, 2,3) ) ) THEN
+      IF( ( wrk_in_USE(2, 11,12,13,14) ) .OR. ( wrk_in_USE(3, 2,3) ) ) THEN
          CALL ctl_stop('p4z_sed: requested workspace arrays unavailable')  ;  RETURN
       END IF
 
-      IF( jnt == 1  .AND.  ln_dustfer  )  CALL p4z_sbc( kt )
+      IF( jnt == 1 .AND. ll_sbc ) CALL p4z_sbc( kt )
+
+      zirondep(:,:,:) = 0.e0          ! Initialisation of variables USEd to compute deposition
+      zsidep  (:,:)   = 0.e0
 
       ! Iron and Si deposition at the surface
       ! -------------------------------------
-
       DO jj = 1, jpj
          DO ji = 1, jpi
-            zirondep(ji,jj,1) = ( dustsolub * dust(ji,jj) / ( 55.85 * rmtss ) + 3.e-10 * ryyss1 )   &
-               &             * rfact2 / fse3t(ji,jj,1)
-            zsidep  (ji,jj)   = 8.8 * 0.075 * dust(ji,jj) * rfact2 / ( fse3t(ji,jj,1) * 28.1 * rmtss )
+            zdep  = rfact2 / fse3t(ji,jj,1)
+            zirondep(ji,jj,1) = ( dustsolub * dust(ji,jj) / ( 55.85 * rmtss ) + 3.e-10 * r1_ryyss ) * zdep
+            zsidep  (ji,jj)   = 8.8 * 0.075 * dust(ji,jj) * zdep / ( 28.1 * rmtss )
          END DO
       END DO
@@ -120,12 +132,10 @@
       ! Iron solubilization of particles in the water column
       ! ----------------------------------------------------
-
       DO jk = 2, jpkm1
-         zirondep(:,:,jk) = dust(:,:) / ( 10. * 55.85 * rmtss ) * rfact2 * 1.e-4
+         zirondep(:,:,jk) = dust(:,:) / ( wdust * 55.85 * rmtss ) * rfact2 * 1.e-4 * EXP( -fsdept(:,:,jk) / 1000. )
       END DO
 
       ! Add the external input of nutrients, carbon and alkalinity
       ! ----------------------------------------------------------
-
       trn(:,:,1,jppo4) = trn(:,:,1,jppo4) + rivinp(:,:) * rfact2 
       trn(:,:,1,jpno3) = trn(:,:,1,jpno3) + (rivinp(:,:) + nitdep(:,:)) * rfact2
@@ -139,9 +149,7 @@
       ! (dust, river and sediment mobilization)
       ! ------------------------------------------------------
-
       DO jk = 1, jpkm1
          trn(:,:,jk,jpfer) = trn(:,:,jk,jpfer) + zirondep(:,:,jk) + ironsed(:,:,jk) * rfact2
       END DO
-
 
 #if ! defined key_sed
@@ -154,77 +162,86 @@
             ikt = mbkt(ji,jj) 
 # if defined key_kriest
-            zwork (ji,jj) = trn(ji,jj,ikt,jpdsi) * wscal (ji,jj,ikt)
-            zwork1(ji,jj) = trn(ji,jj,ikt,jppoc) * wsbio3(ji,jj,ikt)
+            zwork1(ji,jj) = trn(ji,jj,ikt,jpdsi) * wscal (ji,jj,ikt)
+            zwork2(ji,jj) = trn(ji,jj,ikt,jppoc) * wsbio3(ji,jj,ikt)
 # else
-            zwork (ji,jj) = trn(ji,jj,ikt,jpdsi) * wsbio4(ji,jj,ikt)
-            zwork1(ji,jj) = trn(ji,jj,ikt,jpgoc) * wsbio4(ji,jj,ikt) + trn(ji,jj,ikt,jppoc) * wsbio3(ji,jj,ikt) 
+            zwork1(ji,jj) = trn(ji,jj,ikt,jpdsi) * wsbio4(ji,jj,ikt)
+            zwork2(ji,jj) = trn(ji,jj,ikt,jpgoc) * wsbio4(ji,jj,ikt) + trn(ji,jj,ikt,jppoc) * wsbio3(ji,jj,ikt) 
 # endif
-         END DO
-      END DO
-      zsumsedsi  = glob_sum( zwork (:,:) * e1e2t(:,:) ) * rday1
-      zsumsedpo4 = glob_sum( zwork1(:,:) * e1e2t(:,:) ) * rday1
-      DO jj = 1, jpj
-         DO ji = 1, jpi
-            ikt = mbkt(ji,jj) 
-            zwork (ji,jj) = trn(ji,jj,ikt,jpcal) * wscal (ji,jj,ikt)
-         END DO
-      END DO
-      zsumsedcal = glob_sum( zwork (:,:) * e1e2t(:,:) ) * 2.0 * rday1
-#endif
-
-      ! Then this loss is scaled at each bottom grid cell for
+            ! For calcite, burial efficiency is made a function of saturation
+            zfactcal      = MIN( excess(ji,jj,ikt), 0.2 )
+            zfactcal      = MIN( 1., 1.3 * ( 0.2 - zfactcal ) / ( 0.4 - zfactcal ) )
+            zwork3(ji,jj) = trn(ji,jj,ikt,jpcal) * wscal (ji,jj,ikt) * 2.e0 * zfactcal
+         END DO
+      END DO
+      zsumsedsi  = glob_sum( zwork1(:,:) * e1e2t(:,:) ) * r1_rday
+      zsumsedpo4 = glob_sum( zwork2(:,:) * e1e2t(:,:) ) * r1_rday
+      zsumsedcal = glob_sum( zwork3(:,:) * e1e2t(:,:) ) * r1_rday
+#endif
+
+      ! THEN this loss is scaled at each bottom grid cell for
       ! equilibrating the total budget of silica in the ocean.
       ! Thus, the amount of silica lost in the sediments equal
       ! the supply at the surface (dust+rivers)
       ! ------------------------------------------------------
+#if ! defined key_sed
+      zrivsil =  1._wp - ( sumdepsi + rivalkinput * r1_ryyss / 6. ) / zsumsedsi 
+      zrivpo4 =  1._wp - ( rivpo4input * r1_ryyss ) / zsumsedpo4 
+#endif
 
       DO jj = 1, jpj
          DO ji = 1, jpi
-            ikt = mbkt(ji,jj)
-            zfact = xstep / fse3t(ji,jj,ikt)
-            zwsbio3 = 1._wp - zfact * wsbio3(ji,jj,ikt)
-            zwsbio4 = 1._wp - zfact * wsbio4(ji,jj,ikt)
-            zwscal  = 1._wp - zfact * wscal (ji,jj,ikt)
+            ikt  = mbkt(ji,jj)
+            zdep = xstep / fse3t(ji,jj,ikt)
+            zwsbio4 = wsbio4(ji,jj,ikt) * zdep
+            zwscal  = wscal (ji,jj,ikt) * zdep
+# if defined key_kriest
+            zsiloss = trn(ji,jj,ikt,jpdsi) * zwsbio4
+# else
+            zsiloss = trn(ji,jj,ikt,jpdsi) * zwscal
+# endif
+            zcaloss = trn(ji,jj,ikt,jpcal) * zwscal
             !
-# if defined key_kriest
-            trn(ji,jj,ikt,jpdsi) = trn(ji,jj,ikt,jpdsi) * zwsbio4
-            trn(ji,jj,ikt,jpnum) = trn(ji,jj,ikt,jpnum) * zwsbio4
-            trn(ji,jj,ikt,jppoc) = trn(ji,jj,ikt,jppoc) * zwsbio3
-            trn(ji,jj,ikt,jpsfe) = trn(ji,jj,ikt,jpsfe) * zwsbio3
-# else
-            trn(ji,jj,ikt,jpdsi) = trn(ji,jj,ikt,jpdsi) * zwscal 
-            trn(ji,jj,ikt,jpgoc) = trn(ji,jj,ikt,jpgoc) * zwsbio4
-            trn(ji,jj,ikt,jppoc) = trn(ji,jj,ikt,jppoc) * zwsbio3
-            trn(ji,jj,ikt,jpbfe) = trn(ji,jj,ikt,jpbfe) * zwsbio4
-            trn(ji,jj,ikt,jpsfe) = trn(ji,jj,ikt,jpsfe) * zwsbio3
-# endif
-            trn(ji,jj,ikt,jpcal) = trn(ji,jj,ikt,jpcal) * zwscal
-         END DO
-      END DO
-
+            trn(ji,jj,ikt,jpdsi) = trn(ji,jj,ikt,jpdsi) - zsiloss
+            trn(ji,jj,ikt,jpcal) = trn(ji,jj,ikt,jpcal) - zcaloss
 #if ! defined key_sed
-      zrivsil =  1._wp - ( sumdepsi + rivalkinput * ryyss1 / 6. ) / zsumsedsi 
-      zrivalk =  1._wp - ( rivalkinput * ryyss1 ) / zsumsedcal 
-      zrivpo4 =  1._wp - ( rivpo4input * ryyss1 ) / zsumsedpo4 
+            trn(ji,jj,ikt,jpsil) = trn(ji,jj,ikt,jpsil) + zsiloss * zrivsil 
+            zfactcal = MIN( excess(ji,jj,ikt), 0.2 )
+            zfactcal = MIN( 1., 1.3 * ( 0.2 - zfactcal ) / ( 0.4 - zfactcal ) )
+            zrivalk  =  1._wp - ( rivalkinput * r1_ryyss ) * zfactcal / zsumsedcal 
+            trn(ji,jj,ikt,jptal) =  trn(ji,jj,ikt,jptal) + zcaloss * zrivalk * 2.0
+            trn(ji,jj,ikt,jpdic) =  trn(ji,jj,ikt,jpdic) + zcaloss * zrivalk
+#endif
+         END DO
+      END DO
+
       DO jj = 1, jpj
          DO ji = 1, jpi
-            ikt = mbkt(ji,jj)
-            zfact = xstep / fse3t(ji,jj,ikt)
-            zwsbio3 = zfact * wsbio3(ji,jj,ikt)
-            zwsbio4 = zfact * wsbio4(ji,jj,ikt)
-            zwscal  = zfact * wscal (ji,jj,ikt)
-            trn(ji,jj,ikt,jptal) =  trn(ji,jj,ikt,jptal) + trn(ji,jj,ikt,jpcal) * zwscal  * zrivalk * 2.0
-            trn(ji,jj,ikt,jpdic) =  trn(ji,jj,ikt,jpdic) + trn(ji,jj,ikt,jpcal) * zwscal  * zrivalk
-# if defined key_kriest
-            trn(ji,jj,ikt,jpsil) =  trn(ji,jj,ikt,jpsil) + trn(ji,jj,ikt,jpdsi) * zwsbio4 * zrivsil 
-            trn(ji,jj,ikt,jpdoc) =  trn(ji,jj,ikt,jpdoc) + trn(ji,jj,ikt,jppoc) * zwsbio3 * zrivpo4 
+            ikt  = mbkt(ji,jj)
+            zdep = xstep / fse3t(ji,jj,ikt)
+            zwsbio4 = wsbio4(ji,jj,ikt) * zdep
+            zwsbio3 = wsbio3(ji,jj,ikt) * zdep
+# if ! defined key_kriest
+            trn(ji,jj,ikt,jpgoc) = trn(ji,jj,ikt,jpgoc) - trn(ji,jj,ikt,jpgoc) * zwsbio4
+            trn(ji,jj,ikt,jppoc) = trn(ji,jj,ikt,jppoc) - trn(ji,jj,ikt,jppoc) * zwsbio3
+            trn(ji,jj,ikt,jpbfe) = trn(ji,jj,ikt,jpbfe) - trn(ji,jj,ikt,jpbfe) * zwsbio4
+            trn(ji,jj,ikt,jpsfe) = trn(ji,jj,ikt,jpsfe) - trn(ji,jj,ikt,jpsfe) * zwsbio3
+#if ! defined key_sed
+            trn(ji,jj,ikt,jpdoc) = trn(ji,jj,ikt,jpdoc) &
+               &               + ( trn(ji,jj,ikt,jpgoc) * zwsbio4 + trn(ji,jj,ikt,jppoc) * zwsbio3 ) * zrivpo4
+#endif
+
 # else
-            trn(ji,jj,ikt,jpsil) =  trn(ji,jj,ikt,jpsil) + trn(ji,jj,ikt,jpdsi) * zwscal  * zrivsil 
-            trn(ji,jj,ikt,jpdoc) =  trn(ji,jj,ikt,jpdoc)   &
-            &                     + ( trn(ji,jj,ikt,jppoc) * zwsbio3 + trn(ji,jj,ikt,jpgoc) * zwsbio4 ) * zrivpo4
+            trn(ji,jj,ikt,jpnum) = trn(ji,jj,ikt,jpnum) - trn(ji,jj,ikt,jpnum) * zwsbio4
+            trn(ji,jj,ikt,jppoc) = trn(ji,jj,ikt,jppoc) - trn(ji,jj,ikt,jppoc) * zwsbio3
+            trn(ji,jj,ikt,jpsfe) = trn(ji,jj,ikt,jpsfe) - trn(ji,jj,ikt,jpsfe) * zwsbio3
+#if ! defined key_sed
+            trn(ji,jj,ikt,jpdoc) = trn(ji,jj,ikt,jpdoc) &
+               &               + ( trn(ji,jj,ikt,jpnum) * zwsbio4 + trn(ji,jj,ikt,jppoc) * zwsbio3 ) * zrivpo4
+#endif
+
 # endif
          END DO
       END DO
-# endif
+
 
       ! Nitrogen fixation (simple parameterization). The total gain
@@ -233,5 +250,5 @@
       ! -------------------------------------------------------------
 
-      zdenitot = glob_sum( denitr(:,:,:)  * cvol(:,:,:) * xnegtr(:,:,:) ) * rdenit
+      zdenitot = glob_sum(  ( denitr(:,:,:) * rdenit + denitnh4(:,:,:) * rdenita ) * cvol(:,:,:) * xnegtr(:,:,:) )
 
       ! Potential nitrogen fixation dependant on temperature and iron
@@ -246,10 +263,12 @@
                zlim = ( 1.- xnanono3(ji,jj,jk) - xnanonh4(ji,jj,jk) )
                IF( zlim <= 0.2 )   zlim = 0.01
-               znitrpot(ji,jj,jk) = MAX( 0.e0, ( 0.6 * tgfunc(ji,jj,jk) - 2.15 ) * rday1 )   &
-# if defined key_degrad
-               &                  * facvol(ji,jj,jk)   &
-# endif
-               &                  * zlim * rfact2 * trn(ji,jj,jk,jpfer)   &
-               &                  / ( conc3 + trn(ji,jj,jk,jpfer) ) * ( 1.- EXP( -etot(ji,jj,jk) / 50.) )
+#if defined key_degrad
+               zfact = zlim * rfact2 * facvol(ji,jj,jk)
+#else
+               zfact = zlim * rfact2 
+#endif
+               znitrpot(ji,jj,jk) =  MAX( 0.e0, ( 0.6 * tgfunc(ji,jj,jk) - 2.15 ) * r1_rday )   &
+                 &                 *  zfact * trn(ji,jj,jk,jpfer) / ( concfediaz + trn(ji,jj,jk,jpfer) ) &
+                 &                 * ( 1.- EXP( -etot(ji,jj,jk) / diazolight ) )
             END DO
          END DO 
@@ -260,38 +279,38 @@
       ! Nitrogen change due to nitrogen fixation
       ! ----------------------------------------
-
       DO jk = 1, jpk
          DO jj = 1, jpj
             DO ji = 1, jpi
-               zfact = znitrpot(ji,jj,jk) * 1.e-7
+               zfact = znitrpot(ji,jj,jk) * nitrfix
                trn(ji,jj,jk,jpnh4) = trn(ji,jj,jk,jpnh4) + zfact
+               trn(ji,jj,jk,jptal) = trn(ji,jj,jk,jptal) + rno3 * zfact
                trn(ji,jj,jk,jpoxy) = trn(ji,jj,jk,jpoxy) + zfact   * o2nit
-               trn(ji,jj,jk,jppo4) = trn(ji,jj,jk,jppo4) + 30./ 46.* zfact
-            END DO
-         END DO
+               trn(ji,jj,jk,jppo4) = trn(ji,jj,jk,jppo4) + 30. / 46. * zfact
+           !    trn(ji,jj,jk,jppo4) = trn(ji,jj,jk,jppo4) + zfact
+           END DO
+         END DO 
       END DO
 
 #if defined key_diatrc
       zfact = 1.e+3 * rfact2r
-#  if  ! defined key_iomput
-      trc2d(:,:,jp_pcs0_2d + 11) = zirondep(:,:,1)         * zfact * fse3t(:,:,1) * tmask(:,:,1)
-      trc2d(:,:,jp_pcs0_2d + 12) = znitrpot(:,:,1) * 1.e-7 * zfact * fse3t(:,:,1) * tmask(:,:,1)
-#  else
-      zwork (:,:)  =  ( zirondep(:,:,1) + ironsed(:,:,1) * rfact2 ) * zfact * fse3t(:,:,1) * tmask(:,:,1) 
-      zwork1(:,:)  =  znitrpot(:,:,1) * 1.e-7                       * zfact * fse3t(:,:,1) * tmask(:,:,1)
+#if defined key_iomput
+      zwork1(:,:)  =  ( zirondep(:,:,1) + ironsed(:,:,1) * rfact2 ) * zfact * fse3t(:,:,1) * tmask(:,:,1) 
+      zwork2(:,:)  =    znitrpot(:,:,1) * nitrif                    * zfact * fse3t(:,:,1) * tmask(:,:,1)
       IF( jnt == nrdttrc ) THEN
-         CALL iom_put( "Irondep", zwork  )  ! surface downward net flux of iron
-         CALL iom_put( "Nfix"   , zwork1 )  ! nitrogen fixation at surface
-      ENDIF
-#  endif
+          CALL iom_put( "Irondep", zwork1  )  ! surface downward net flux of iron
+          CALL iom_put( "Nfix"   , zwork2 )  ! nitrogen fixation at surface
+      ENDIF
+#else
+      trc2d(:,:,jp_pcs0_2d + 11) = zirondep(:,:,1)          * zfact * fse3t(:,:,1) * tmask(:,:,1)
+      trc2d(:,:,jp_pcs0_2d + 12) = znitrpot(:,:,1) * nitrif * zfact * fse3t(:,:,1) * tmask(:,:,1)
 #endif
       !
-       IF(ln_ctl)   THEN  ! print mean trends (used for debugging)
-         WRITE(charout, FMT="('sed ')")
+      IF(ln_ctl) THEN  ! print mean trends (USEd for debugging)
+         WRITE(charout, fmt="('sed ')")
          CALL prt_ctl_trc_info(charout)
          CALL prt_ctl_trc(tab4d=trn, mask=tmask, clinfo=ctrcnm)
-       ENDIF
-
-      IF( ( wrk_not_released(2, 1,2,3) ) .OR. ( wrk_not_released(3, 2,3) ) )   &
+      ENDIF
+
+      IF( ( wrk_not_released(2, 11,12,13,14) ) .OR. ( wrk_not_released(3, 2,3) ) )   &
         &         CALL ctl_stop('p4z_sed: failed to release workspace arrays')
 
@@ -299,12 +318,11 @@
 
    SUBROUTINE p4z_sbc( kt )
-
       !!----------------------------------------------------------------------
-      !!                  ***  ROUTINE p4z_sbc  ***
-      !!
-      !! ** Purpose :   Read and interpolate the external sources of 
+      !!                  ***  routine p4z_sbc  ***
+      !!
+      !! ** purpose :   read and interpolate the external sources of 
       !!                nutrients
       !!
-      !! ** Method  :   Read the files and interpolate the appropriate variables
+      !! ** method  :   read the files and interpolate the appropriate variables
       !!
       !! ** input   :   external netcdf files
@@ -314,44 +332,47 @@
       INTEGER, INTENT( in  ) ::   kt   ! ocean time step
 
-      !! * Local declarations
-      INTEGER :: imois, i15, iman 
-      REAL(wp) :: zxy
+      !! * local declarations
+      INTEGER  :: ji,jj 
+      REAL(wp) :: zcoef
 
       !!---------------------------------------------------------------------
 
-      ! Initialization
-      ! --------------
-
-      i15 = nday / 16
-      iman  = INT( raamo )
-      imois = nmonth + i15 - 1
-      IF( imois == 0 ) imois = iman
-
-      ! Calendar computation
-      IF( kt == nit000 .OR. imois /= nflx1 ) THEN
-
-         IF( kt == nit000 )  nflx1  = 0
-
-         ! nflx1 number of the first file record used in the simulation
-         ! nflx2 number of the last  file record
-
-         nflx1 = imois
-         nflx2 = nflx1 + 1
-         nflx1 = MOD( nflx1, iman )
-         nflx2 = MOD( nflx2, iman )
-         IF( nflx1 == 0 )   nflx1 = iman
-         IF( nflx2 == 0 )   nflx2 = iman
-         IF(lwp) WRITE(numout,*) 
-         IF(lwp) WRITE(numout,*) ' p4z_sbc : first record file used nflx1 ',nflx1
-         IF(lwp) WRITE(numout,*) ' p4z_sbc : last  record file used nflx2 ',nflx2
-
-      ENDIF
-
-      ! 3. at every time step interpolation of fluxes
-      ! ---------------------------------------------
-
-      zxy = FLOAT( nday + 15 - 30 * i15 ) / 30
-      dust(:,:) = ( (1.-zxy) * dustmo(:,:,nflx1) + zxy * dustmo(:,:,nflx2) )
-
+      ! Compute dust at nit000 or only if there is more than 1 time record in dust file
+      IF( ln_dust ) THEN
+         IF( kt == nit000 .OR. ( kt /= nit000 .AND. ntimes_dust > 1 ) ) THEN
+            CALL fld_read( kt, 1, sf_dust )
+            dust(:,:) = sf_dust(1)%fnow(:,:,1)
+         ENDIF
+      ENDIF
+
+      ! N/P and Si releases due to coastal rivers
+      ! Compute river at nit000 or only if there is more than 1 time record in river file
+      ! -----------------------------------------
+      IF( ln_river ) THEN
+         IF( kt == nit000 .OR. ( kt /= nit000 .AND. ntimes_riv > 1 ) ) THEN
+            CALL fld_read( kt, 1, sf_riverdic )
+            CALL fld_read( kt, 1, sf_riverdoc )
+            DO jj = 1, jpj
+               DO ji = 1, jpi
+                  zcoef = ryyss * cvol(ji,jj,1) 
+                  cotdep(ji,jj) =   sf_riverdic(1)%fnow(ji,jj,1)                                  * 1E9 / ( 12. * zcoef + rtrn )
+                  rivinp(ji,jj) = ( sf_riverdic(1)%fnow(ji,jj,1) + sf_riverdoc(1)%fnow(ji,jj,1) ) * 1E9 / ( 31.6* zcoef + rtrn )
+               END DO
+            END DO
+         ENDIF
+      ENDIF
+
+      ! Compute N deposition at nit000 or only if there is more than 1 time record in N deposition file
+      IF( ln_ndepo ) THEN
+         IF( kt == nit000 .OR. ( kt /= nit000 .AND. ntimes_ndep > 1 ) ) THEN
+            CALL fld_read( kt, 1, sf_ndepo )
+            DO jj = 1, jpj
+               DO ji = 1, jpi
+                  nitdep(ji,jj) = 7.6 * sf_ndepo(1)%fnow(ji,jj,1) / ( 14E6 * ryyss * fse3t(ji,jj,1) + rtrn )
+               END DO
+            END DO
+         ENDIF
+      ENDIF
+      !
    END SUBROUTINE p4z_sbc
 
@@ -360,95 +381,182 @@
 
       !!----------------------------------------------------------------------
-      !!                  ***  ROUTINE p4z_sed_init  ***
-      !!
-      !! ** Purpose :   Initialization of the external sources of nutrients
-      !!
-      !! ** Method  :   Read the files and compute the budget
-      !!      called at the first timestep (nit000)
+      !!                  ***  routine p4z_sed_init  ***
+      !!
+      !! ** purpose :   initialization of the external sources of nutrients
+      !!
+      !! ** method  :   read the files and compute the budget
+      !!                called at the first timestep (nit000)
       !!
       !! ** input   :   external netcdf files
       !!
       !!----------------------------------------------------------------------
-      USE wrk_nemo, ONLY: wrk_in_use, wrk_not_released
-      USE wrk_nemo, ONLY: zriverdoc => wrk_2d_1, zriver => wrk_2d_2, zndepo => wrk_2d_3
-      USE wrk_nemo, ONLY: zcmask => wrk_3d_2
       !
-      INTEGER :: ji, jj, jk, jm
-      INTEGER :: numriv, numbath, numdep
-      REAL(wp) ::   zcoef
-      REAL(wp) ::   expide, denitide,zmaskt
+      INTEGER  :: ji, jj, jk, jm
+      INTEGER  :: numdust, numriv, numiron, numdepo
+      INTEGER  :: ierr, ierr1, ierr2, ierr3
+      REAL(wp) :: zexpide, zdenitide, zmaskt
+      REAL(wp), DIMENSION(nbtimes) :: zsteps                 ! times records
+      REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: zdust, zndepo, zriverdic, zriverdoc, zcmask
       !
-      NAMELIST/nampissed/ ln_dustfer, ln_river, ln_ndepo, ln_sedinput, sedfeinput, dustsolub
+      CHARACTER(len=100) ::  cn_dir          ! Root directory for location of ssr files
+      TYPE(FLD_N) ::   sn_dust, sn_riverdoc, sn_riverdic, sn_ndepo, sn_ironsed        ! informations about the fields to be read
+      NAMELIST/nampissed/cn_dir, sn_dust, sn_riverdic, sn_riverdoc, sn_ndepo, sn_ironsed, &
+        &                ln_dust, ln_river, ln_ndepo, ln_ironsed,         &
+        &                sedfeinput, dustsolub, wdust, nitrfix, diazolight, concfediaz 
       !!----------------------------------------------------------------------
-
-      IF( ( wrk_in_use(2, 1,2,3) ) .OR. ( wrk_in_use(3, 2) ) ) THEN
-         CALL ctl_stop('p4z_sed_init: requested workspace arrays unavailable')  ;  RETURN
-      END IF
-      !
-      REWIND( numnat )                     ! read numnat
-      READ  ( numnat, nampissed )
+      !                                    ! number of seconds per year and per month
+      ryyss    = nyear_len(1) * rday
+      rmtss    = ryyss / raamo
+      r1_rday  = 1. / rday
+      r1_ryyss = 1. / ryyss
+      !                            !* set file information
+      cn_dir  = './'            ! directory in which the model is executed
+      ! ... default values (NB: frequency positive => hours, negative => months)
+      !                  !   file       ! frequency !  variable   ! time intep !  clim   ! 'yearly' or ! weights  ! rotation   !
+      !                  !   name       !  (hours)  !   name      !   (T/F)    !  (T/F)  !  'monthly'  ! filename ! pairs      !
+      sn_dust     = FLD_N( 'dust'       ,    -1     ,  'dust'     ,  .true.    , .true.  ,   'yearly'  , ''       , ''         )
+      sn_riverdic = FLD_N( 'river'      ,   -12     ,  'riverdic' ,  .false.   , .true.  ,   'yearly'  , ''       , ''         )
+      sn_riverdoc = FLD_N( 'river'      ,   -12     ,  'riverdoc' ,  .false.   , .true.  ,   'yearly'  , ''       , ''         )
+      sn_ndepo    = FLD_N( 'ndeposition',   -12     ,  'ndep'     ,  .false.   , .true.  ,   'yearly'  , ''       , ''         )
+      sn_ironsed  = FLD_N( 'ironsed'    ,   -12     ,  'bathy'    ,  .false.   , .true.  ,   'yearly'  , ''       , ''         )
+
+
+      REWIND( numnatp )                     ! read numnat
+      READ  ( numnatp, nampissed )
 
       IF(lwp) THEN
          WRITE(numout,*) ' '
-         WRITE(numout,*) ' Namelist : nampissed '
+         WRITE(numout,*) ' namelist : nampissed '
          WRITE(numout,*) ' ~~~~~~~~~~~~~~~~~ '
-         WRITE(numout,*) '    Dust input from the atmosphere           ln_dustfer  = ', ln_dustfer
-         WRITE(numout,*) '    River input of nutrients                 ln_river    = ', ln_river
-         WRITE(numout,*) '    Atmospheric deposition of N              ln_ndepo    = ', ln_ndepo
-         WRITE(numout,*) '    Fe input from sediments                  ln_sedinput = ', ln_sedinput
-         WRITE(numout,*) '    Coastal release of Iron                  sedfeinput  =', sedfeinput
-         WRITE(numout,*) '    Solubility of the dust                   dustsolub   =', dustsolub
-      ENDIF
-
-      ! Dust input from the atmosphere
+         WRITE(numout,*) '    dust input from the atmosphere           ln_dust     = ', ln_dust
+         WRITE(numout,*) '    river input of nutrients                 ln_river    = ', ln_river
+         WRITE(numout,*) '    atmospheric deposition of n              ln_ndepo    = ', ln_ndepo
+         WRITE(numout,*) '    fe input from sediments                  ln_sedinput = ', ln_ironsed
+         WRITE(numout,*) '    coastal release of iron                  sedfeinput  = ', sedfeinput
+         WRITE(numout,*) '    solubility of the dust                   dustsolub   = ', dustsolub
+         WRITE(numout,*) '    sinking speed of the dust                wdust       = ', wdust
+         WRITE(numout,*) '    nitrogen fixation rate                   nitrfix     = ', nitrfix
+         WRITE(numout,*) '    nitrogen fixation sensitivty to light    diazolight  = ', diazolight
+         WRITE(numout,*) '    fe half-saturation cste for diazotrophs  concfediaz  = ', concfediaz
+       END IF
+
+      IF( ln_dust .OR. ln_river .OR. ln_ndepo ) THEN
+          ll_sbc = .TRUE.
+      ELSE
+          ll_sbc = .FALSE.
+      ENDIF
+
+      ! dust input from the atmosphere
       ! ------------------------------
-      IF( ln_dustfer ) THEN 
-         IF(lwp) WRITE(numout,*) '    Initialize dust input from atmosphere '
+      IF( ln_dust ) THEN 
+         IF(lwp) WRITE(numout,*) '    initialize dust input from atmosphere '
          IF(lwp) WRITE(numout,*) '    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ '
-         CALL iom_open ( 'dust.orca.nc', numdust )
-         DO jm = 1, jpmth
-            CALL iom_get( numdust, jpdom_data, 'dust', dustmo(:,:,jm), jm )
+         !
+         ALLOCATE( sf_dust(1), STAT=ierr )           !* allocate and fill sf_sst (forcing structure) with sn_sst
+         IF( ierr > 0 )   CALL ctl_stop( 'STOP', 'p4z_sed_init: unable to allocate sf_apr structure' )
+         !
+         CALL fld_fill( sf_dust, (/ sn_dust /), cn_dir, 'p4z_sed_init', 'Iron from sediment ', 'nampissed' )
+                                   ALLOCATE( sf_dust(1)%fnow(jpi,jpj,1)   )
+         IF( sn_dust%ln_tint )     ALLOCATE( sf_dust(1)%fdta(jpi,jpj,1,2) )
+         !
+         ! Get total input dust ; need to compute total atmospheric supply of Si in a year
+         CALL iom_open (  TRIM( sn_dust%clname ) , numdust )
+         CALL iom_gettime( numdust, zsteps, kntime=ntimes_dust)  ! get number of record in file
+         ALLOCATE( zdust(jpi,jpj,ntimes_dust) )
+         DO jm = 1, ntimes_dust
+            CALL iom_get( numdust, jpdom_data, TRIM( sn_dust%clvar ), zdust(:,:,jm), jm )
          END DO
          CALL iom_close( numdust )
+         sumdepsi = 0.e0
+         DO jm = 1, ntimes_dust
+            sumdepsi = sumdepsi + glob_sum( zdust(:,:,jm) * e1e2t(:,:) * tmask(:,:,1) ) 
+         ENDDO
+         sumdepsi = sumdepsi * r1_ryyss * 8.8 * 0.075 / 28.1 
+         DEALLOCATE( zdust)
       ELSE
-         dustmo(:,:,:) = 0.e0
-         dust(:,:) = 0.0
-      ENDIF
-
-      ! Nutrient input from rivers
+         dust(:,:) = 0._wp
+         sumdepsi  = 0._wp
+      END IF
+
+      ! nutrient input from rivers
       ! --------------------------
       IF( ln_river ) THEN
-         IF(lwp) WRITE(numout,*) '    Initialize the nutrient input by rivers from river.orca.nc file'
-         IF(lwp) WRITE(numout,*) '    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'
-         CALL iom_open ( 'river.orca.nc', numriv )
-         CALL iom_get  ( numriv, jpdom_data, 'riverdic', zriver   (:,:), jpyr )
-         CALL iom_get  ( numriv, jpdom_data, 'riverdoc', zriverdoc(:,:), jpyr )
+         ALLOCATE( sf_riverdic(1), STAT=ierr1 )           !* allocate and fill sf_sst (forcing structure) with sn_sst
+         ALLOCATE( sf_riverdoc(1), STAT=ierr2 )           !* allocate and fill sf_sst (forcing structure) with sn_sst
+         IF( ierr1 + ierr2 > 0 )   CALL ctl_stop( 'STOP', 'p4z_sed_init: unable to allocate sf_apr structure' )
+         !
+         CALL fld_fill( sf_riverdic, (/ sn_riverdic /), cn_dir, 'p4z_sed_init', 'Input DOC from river ', 'nampissed' )
+         CALL fld_fill( sf_riverdoc, (/ sn_riverdoc /), cn_dir, 'p4z_sed_init', 'Input DOC from river ', 'nampissed' )
+                                   ALLOCATE( sf_riverdic(1)%fnow(jpi,jpj,1)   )
+                                   ALLOCATE( sf_riverdoc(1)%fnow(jpi,jpj,1)   )
+         IF( sn_riverdic%ln_tint ) ALLOCATE( sf_riverdic(1)%fdta(jpi,jpj,1,2) )
+         IF( sn_riverdoc%ln_tint ) ALLOCATE( sf_riverdoc(1)%fdta(jpi,jpj,1,2) )
+         ! Get total input rivers ; need to compute total river supply in a year
+         CALL iom_open ( TRIM( sn_riverdic%clname ), numriv )
+         CALL iom_gettime( numriv, zsteps, kntime=ntimes_riv)
+         ALLOCATE( zriverdic(jpi,jpj,ntimes_riv) )   ;     ALLOCATE( zriverdoc(jpi,jpj,ntimes_riv) )
+         DO jm = 1, ntimes_riv
+            CALL iom_get( numriv, jpdom_data, TRIM( sn_riverdic%clvar ), zriverdic(:,:,jm), jm )
+            CALL iom_get( numriv, jpdom_data, TRIM( sn_riverdoc%clvar ), zriverdoc(:,:,jm), jm )
+         END DO
          CALL iom_close( numriv )
+         ! N/P and Si releases due to coastal rivers
+         ! -----------------------------------------
+         rivpo4input = 0._wp 
+         rivalkinput = 0._wp 
+         DO jm = 1, ntimes_riv
+            rivpo4input = rivpo4input + glob_sum( ( zriverdic(:,:,jm) + zriverdoc(:,:,jm) ) * tmask(:,:,1) ) 
+            rivalkinput = rivalkinput + glob_sum(   zriverdic(:,:,jm)                       * tmask(:,:,1) ) 
+         END DO
+         rivpo4input = rivpo4input * 1E9 / 31.6_wp
+         rivalkinput = rivalkinput * 1E9 / 12._wp 
+         DEALLOCATE( zriverdic)   ;    DEALLOCATE( zriverdoc) 
       ELSE
-         zriver   (:,:) = 0.e0
-         zriverdoc(:,:) = 0.e0
-      endif
-
-      ! Nutrient input from dust
+         rivinp(:,:) = 0._wp
+         cotdep(:,:) = 0._wp
+         rivpo4input = 0._wp
+         rivalkinput = 0._wp
+      END IF 
+
+      ! nutrient input from dust
       ! ------------------------
       IF( ln_ndepo ) THEN
-         IF(lwp) WRITE(numout,*) '    Initialize the nutrient input by dust from ndeposition.orca.nc'
+         IF(lwp) WRITE(numout,*) '    initialize the nutrient input by dust from ndeposition.orca.nc'
          IF(lwp) WRITE(numout,*) '    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'
-         CALL iom_open ( 'ndeposition.orca.nc', numdep )
-         CALL iom_get  ( numdep, jpdom_data, 'ndep', zndepo(:,:), jpyr )
-         CALL iom_close( numdep )
+         ALLOCATE( sf_ndepo(1), STAT=ierr3 )           !* allocate and fill sf_sst (forcing structure) with sn_sst
+         IF( ierr3 > 0 )   CALL ctl_stop( 'STOP', 'p4z_sed_init: unable to allocate sf_apr structure' )
+         !
+         CALL fld_fill( sf_ndepo, (/ sn_ndepo /), cn_dir, 'p4z_sed_init', 'Iron from sediment ', 'nampissed' )
+                                   ALLOCATE( sf_ndepo(1)%fnow(jpi,jpj,1)   )
+         IF( sn_ndepo%ln_tint )    ALLOCATE( sf_ndepo(1)%fdta(jpi,jpj,1,2) )
+         !
+         ! Get total input dust ; need to compute total atmospheric supply of N in a year
+         CALL iom_open ( TRIM( sn_ndepo%clname ), numdepo )
+         CALL iom_gettime( numdepo, zsteps, kntime=ntimes_ndep)
+         ALLOCATE( zndepo(jpi,jpj,ntimes_ndep) )
+         DO jm = 1, ntimes_ndep
+            CALL iom_get( numdepo, jpdom_data, TRIM( sn_ndepo%clvar ), zndepo(:,:,jm), jm )
+         END DO
+         CALL iom_close( numdepo )
+         nitdepinput = 0._wp
+         DO jm = 1, ntimes_ndep
+           nitdepinput = nitdepinput + glob_sum( zndepo(:,:,jm) * e1e2t(:,:) * tmask(:,:,1) ) 
+         ENDDO
+         nitdepinput = nitdepinput * 7.6 / 14E6 
+         DEALLOCATE( zndepo)
       ELSE
-         zndepo(:,:) = 0.e0
-      ENDIF
-
-      ! Coastal and island masks
+         nitdep(:,:) = 0._wp
+         nitdepinput = 0._wp
+      ENDIF
+
+      ! coastal and island masks
       ! ------------------------
-      IF( ln_sedinput ) THEN     
-         IF(lwp) WRITE(numout,*) '    Computation of an island mask to enhance coastal supply of iron'
+      IF( ln_ironsed ) THEN     
+         IF(lwp) WRITE(numout,*) '    computation of an island mask to enhance coastal supply of iron'
          IF(lwp) WRITE(numout,*) '    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'
-         IF(lwp) WRITE(numout,*) '       from bathy.orca.nc file '
-         CALL iom_open ( 'bathy.orca.nc', numbath )
-         CALL iom_get  ( numbath, jpdom_data, 'bathy', zcmask(:,:,:), jpyr )
-         CALL iom_close( numbath )
+         CALL iom_open ( TRIM( sn_ironsed%clname ), numiron )
+         ALLOCATE( zcmask(jpi,jpj,jpk) )
+         CALL iom_get  ( numiron, jpdom_data, TRIM( sn_ironsed%clvar ), zcmask(:,:,:), 1 )
+         CALL iom_close( numiron )
          !
          DO jk = 1, 5
@@ -459,67 +567,44 @@
                         &                       * tmask(ji,jj-1,jk) * tmask(ji,jj,jk+1)
                      IF( zmaskt == 0. )   zcmask(ji,jj,jk ) = MAX( 0.1, zcmask(ji,jj,jk) ) 
-                  ENDIF
+                  END IF
                END DO
             END DO
          END DO
+         CALL lbc_lnk( zcmask , 'T', 1. )      ! lateral boundary conditions on cmask   (sign unchanged)
          DO jk = 1, jpk
             DO jj = 1, jpj
                DO ji = 1, jpi
-                  expide   = MIN( 8.,( fsdept(ji,jj,jk) / 500. )**(-1.5) )
-                  denitide = -0.9543 + 0.7662 * LOG( expide ) - 0.235 * LOG( expide )**2
-                  zcmask(ji,jj,jk) = zcmask(ji,jj,jk) * MIN( 1., EXP( denitide ) / 0.5 )
+                  zexpide   = MIN( 8.,( fsdept(ji,jj,jk) / 500. )**(-1.5) )
+                  zdenitide = -0.9543 + 0.7662 * LOG( zexpide ) - 0.235 * LOG( zexpide )**2
+                  zcmask(ji,jj,jk) = zcmask(ji,jj,jk) * MIN( 1., EXP( zdenitide ) / 0.5 )
                END DO
             END DO
          END DO
+         ! Coastal supply of iron
+         ! -------------------------
+         ironsed(:,:,jpk) = 0._wp
+         DO jk = 1, jpkm1
+            ironsed(:,:,jk) = sedfeinput * zcmask(:,:,jk) / ( fse3t(:,:,jk) * rday )
+         END DO
+         DEALLOCATE( zcmask)
       ELSE
-         zcmask(:,:,:) = 0.e0
-      ENDIF
-
-      CALL lbc_lnk( zcmask , 'T', 1. )      ! Lateral boundary conditions on zcmask   (sign unchanged)
-
-
-      !                                    ! Number of seconds per year and per month
-      ryyss  = nyear_len(1) * rday
-      rmtss  = ryyss / raamo
-      rday1  = 1. / rday
-      ryyss1 = 1. / ryyss
-      !                                    ! ocean surface cell
-
-      ! total atmospheric supply of Si
-      ! ------------------------------
-      sumdepsi = 0.e0
-      DO jm = 1, jpmth
-         zcoef = 1. / ( 12. * rmtss ) * 8.8 * 0.075 / 28.1        
-         sumdepsi = sumdepsi + glob_sum( dustmo(:,:,jm) * e1e2t(:,:) ) * zcoef
-      ENDDO
-
-      ! N/P and Si releases due to coastal rivers
-      ! -----------------------------------------
-      DO jj = 1, jpj
-         DO ji = 1, jpi
-            zcoef = ryyss * e1e2t(ji,jj)  * fse3t(ji,jj,1) * tmask(ji,jj,1) 
-            cotdep(ji,jj) =  zriver(ji,jj)                  *1E9 / ( 12. * zcoef + rtrn )
-            rivinp(ji,jj) = (zriver(ji,jj)+zriverdoc(ji,jj)) *1E9 / ( 31.6* zcoef + rtrn )
-            nitdep(ji,jj) = 7.6 * zndepo(ji,jj)                  / ( 14E6*ryyss*fse3t(ji,jj,1) + rtrn )
-         END DO
-      END DO
-      ! Lateral boundary conditions on ( cotdep, rivinp, nitdep )   (sign unchanged)
-      CALL lbc_lnk( cotdep , 'T', 1. )  ;  CALL lbc_lnk( rivinp , 'T', 1. )  ;  CALL lbc_lnk( nitdep , 'T', 1. )
-
-      rivpo4input = glob_sum( rivinp(:,:) * cvol(:,:,1) ) * ryyss
-      rivalkinput = glob_sum( cotdep(:,:) * cvol(:,:,1) ) * ryyss
-      nitdepinput = glob_sum( nitdep(:,:) * cvol(:,:,1) ) * ryyss
-
-
-      ! Coastal supply of iron
-      ! -------------------------
-      DO jk = 1, jpkm1
-         ironsed(:,:,jk) = sedfeinput * zcmask(:,:,jk) / ( fse3t(:,:,jk) * rday )
-      END DO
-      CALL lbc_lnk( ironsed , 'T', 1. )      ! Lateral boundary conditions on ( ironsed )   (sign unchanged)
-
-      IF( ( wrk_not_released(2, 1,2,3) ) .OR. ( wrk_not_released(3, 2) ) )   &
-        &         CALL ctl_stop('p4z_sed_init: failed to release workspace arrays')
-
+         ironsed(:,:,:) = 0._wp
+      ENDIF
+      !
+      IF(lwp) THEN 
+         WRITE(numout,*)
+         WRITE(numout,*) '    Total input of elements from river supply'
+         WRITE(numout,*) '    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'
+         WRITE(numout,*) '    N Supply   : ', rivpo4input/7.6*1E3/1E12*14.,' TgN/yr'
+         WRITE(numout,*) '    Si Supply  : ', rivalkinput/6.*1E3/1E12*32.,' TgSi/yr'
+         WRITE(numout,*) '    Alk Supply : ', rivalkinput*1E3/1E12,' Teq/yr'
+         WRITE(numout,*) '    DIC Supply : ', rivpo4input*2.631*1E3*12./1E12,'TgC/yr'
+         WRITE(numout,*) 
+         WRITE(numout,*) '    Total input of elements from atmospheric supply'
+         WRITE(numout,*) '    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'
+         WRITE(numout,*) '    N Supply   : ', nitdepinput/7.6*1E3/1E12*14.,' TgN/yr'
+         WRITE(numout,*) 
+      ENDIF
+       !
    END SUBROUTINE p4z_sed_init
 
@@ -529,7 +614,6 @@
       !!----------------------------------------------------------------------
 
-      ALLOCATE( dustmo(jpi,jpj,jpmth), dust(jpi,jpj)       ,     &
-        &       rivinp(jpi,jpj)      , cotdep(jpi,jpj)     ,     &
-        &       nitdep(jpi,jpj)      , ironsed(jpi,jpj,jpk), STAT=p4z_sed_alloc )  
+      ALLOCATE( dust  (jpi,jpj), rivinp(jpi,jpj)     , cotdep(jpi,jpj),      &
+        &       nitdep(jpi,jpj), ironsed(jpi,jpj,jpk), STAT=p4z_sed_alloc )  
 
       IF( p4z_sed_alloc /= 0 ) CALL ctl_warn('p4z_sed_alloc : failed to allocate arrays.')
Index: branches/2011/dev_r2787_PISCES_improvment/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zsink.F90
===================================================================
--- branches/2011/dev_r2787_PISCES_improvment/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zsink.F90	(revision 2822)
+++ branches/2011/dev_r2787_PISCES_improvment/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zsink.F90	(revision 2823)
@@ -6,13 +6,15 @@
    !! History :   1.0  !  2004     (O. Aumont) Original code
    !!             2.0  !  2007-12  (C. Ethe, G. Madec)  F90
+   !!             3.4  !  2011-06  (O. Aumont, C. Ethe) Change aggregation formula
+   !!----------------------------------------------------------------------
 #if defined key_pisces
    !!----------------------------------------------------------------------
    !!   p4z_sink       :  Compute vertical flux of particulate matter due to gravitational sinking
    !!----------------------------------------------------------------------
-   USE trc
-   USE oce_trc         !
-   USE sms_pisces
-   USE prtctl_trc
-   USE iom
+   USE oce_trc         !  shared variables between ocean and passive tracers
+   USE trc             !  passive tracers common variables 
+   USE sms_pisces      !  PISCES Source Minus Sink variables
+   USE prtctl_trc      !  print control for debugging
+   USE iom             !  I/O manager
 
    IMPLICIT NONE
@@ -91,8 +93,6 @@
       REAL(wp) :: zdiv , zdiv1, zdiv2, zdiv3, zdiv4, zdiv5
       REAL(wp) :: zval1, zval2, zval3, zval4
-#if defined key_diatrc
       REAL(wp) :: zrfact2
       INTEGER  :: ik1
-#endif
       CHARACTER (len=25) :: charout
       !!---------------------------------------------------------------------
@@ -193,11 +193,7 @@
                      &            * (zeps-1)/zdiv1 + 3.*(zfm*xkr_mass_max-xkr_mass_min)    &
                      &            * (zfm*xkr_mass_max**2-xkr_mass_min**2)                  &
-                     &            * (zeps-1.)**2/(zdiv2*zdiv3))            &
-# if defined key_degrad
-                     &                 *facvol(ji,jj,jk)       &
-# endif
-                     &    )
-
-                  zagg2 = (  2*0.163*trn(ji,jj,jk,jpnum)**2*zfm*                       &
+                     &            * (zeps-1.)**2/(zdiv2*zdiv3))       
+
+                  zagg2 =  2*0.163*trn(ji,jj,jk,jpnum)**2*zfm*                       &
                      &                   ((xkr_mass_max**3+3.*(xkr_mass_max**2          &
                      &                    *xkr_mass_min*(zeps-1.)/zdiv2                 &
@@ -205,17 +201,7 @@
                      &                    +xkr_mass_min**3*(zeps-1)/zdiv1)                  &
                      &                    -zfm*xkr_mass_max**3*(1.+3.*((zeps-1.)/           &
-                     &                    (zeps-2.)+(zeps-1.)/zdiv3)+(zeps-1.)/zdiv1))      &
-#    if defined key_degrad
-                     &                 *facvol(ji,jj,jk)             &
-#    endif
-                     &    )
-
-                  zagg3 = (  0.163*trn(ji,jj,jk,jpnum)**2*zfm**2*8. * xkr_mass_max**3   &
-#    if defined key_degrad
-                     &                 *facvol(ji,jj,jk)             &
-#    endif
-                     &    )
-
-                  zaggsh = ( zagg1 + zagg2 + zagg3 ) * rfact2 * xdiss(ji,jj,jk) / 1000.
+                     &                    (zeps-2.)+(zeps-1.)/zdiv3)+(zeps-1.)/zdiv1))    
+
+                  zagg3 =  0.163*trn(ji,jj,jk,jpnum)**2*zfm**2*8. * xkr_mass_max**3  
 
                  !    Aggregation of small into large particles
@@ -223,24 +209,16 @@
                  !    ----------------------------------------------
 
-                  zagg4 = (  2.*3.141*0.125*trn(ji,jj,jk,jpnum)**2*                       &
+                  zagg4 =  2.*3.141*0.125*trn(ji,jj,jk,jpnum)**2*                       &
                      &                 xkr_wsbio_min*(zeps-1.)**2                         &
                      &                 *(xkr_mass_min**2*((1.-zsm*zfm)/(zdiv3*zdiv4)      &
                      &                 -(1.-zfm)/(zdiv*(zeps-1.)))-                       &
                      &                 ((zfm*zfm*xkr_mass_max**2*zsm-xkr_mass_min**2)     &
-                     &                 *xkr_eta)/(zdiv*zdiv3*zdiv5) )                     &
-# if defined key_degrad
-                     &                 *facvol(ji,jj,jk)        &
-# endif
-                     &    )
-
-                  zagg5 = (  2.*3.141*0.125*trn(ji,jj,jk,jpnum)**2                         &
+                     &                 *xkr_eta)/(zdiv*zdiv3*zdiv5) )   
+
+                  zagg5 =   2.*3.141*0.125*trn(ji,jj,jk,jpnum)**2                         &
                      &                 *(zeps-1.)*zfm*xkr_wsbio_min                        &
                      &                 *(zsm*(xkr_mass_min**2-zfm*xkr_mass_max**2)         &
                      &                 /zdiv3-(xkr_mass_min**2-zfm*zsm*xkr_mass_max**2)    &
-                     &                 /zdiv)                   &
-# if defined key_degrad
-                     &                 *facvol(ji,jj,jk)        &
-# endif
-                     &    )
+                     &                 /zdiv)  
 
                   zaggsi = ( zagg4 + zagg5 ) * xstep / 10.
@@ -253,9 +231,18 @@
                   zaggdoc = ( 0.4 * trn(ji,jj,jk,jpdoc)               &
                      &        + 1018.  * trn(ji,jj,jk,jppoc)  ) * xstep    &
+                     &        * xdiss(ji,jj,jk) * trn(ji,jj,jk,jpdoc)
+
 # if defined key_degrad
-                     &        * facvol(ji,jj,jk)                              &
+                   zagg1   = zagg1   * facvol(ji,jj,jk)                 
+                   zagg2   = zagg2   * facvol(ji,jj,jk)                 
+                   zagg3   = zagg3   * facvol(ji,jj,jk)                 
+                   zagg4   = zagg4   * facvol(ji,jj,jk)                 
+                   zagg5   = zagg5   * facvol(ji,jj,jk)                 
+                   zaggdoc = zaggdoc * facvol(ji,jj,jk)                 
 # endif
-                     &        * xdiss(ji,jj,jk) * trn(ji,jj,jk,jpdoc)
-
+                  zaggsh = ( zagg1 + zagg2 + zagg3 ) * rfact2 * xdiss(ji,jj,jk) / 1000.
+                  zaggsi = ( zagg4 + zagg5 ) * xstep / 10.
+                  zagg = 0.5 * xkr_stick * ( zaggsh + zaggsi )
+                  !
                   znumdoc = trn(ji,jj,jk,jpnum) / ( trn(ji,jj,jk,jppoc) + rtrn )
                   tra(ji,jj,jk,jppoc) = tra(ji,jj,jk,jppoc) + zaggdoc
@@ -335,6 +322,6 @@
       !!----------------------------------------------------------------------
       !
-      REWIND( numnat )                     ! read nampiskrs
-      READ  ( numnat, nampiskrs )
+      REWIND( numnatp )                     ! read nampiskrs
+      READ  ( numnat,( nampiskrs )
 
       IF(lwp) THEN
@@ -457,10 +444,8 @@
       INTEGER  ::   ji, jj, jk
       REAL(wp) ::   zagg1, zagg2, zagg3, zagg4
-      REAL(wp) ::   zagg , zaggfe, zaggdoc, zaggdoc2
-      REAL(wp) ::   zfact, zwsmax, zstep
-#if defined key_diatrc
+      REAL(wp) ::   zagg , zaggfe, zaggdoc, zaggdoc2, zaggdoc3
+      REAL(wp) ::   zfact, zwsmax, zmax, zstep
       REAL(wp) ::   zrfact2
       INTEGER  ::   ik1
-#endif
       CHARACTER (len=25) :: charout
       !!---------------------------------------------------------------------
@@ -471,6 +456,7 @@
       DO jk = 1, jpkm1
          DO jj = 1, jpj
-            DO ji=1,jpi
-               zfact = MAX( 0., fsdepw(ji,jj,jk+1) - hmld(ji,jj) ) / 4000._wp
+            DO ji = 1,jpi
+               zmax  = MAX( heup(ji,jj), hmld(ji,jj) )
+               zfact = MAX( 0., fsdepw(ji,jj,jk+1) - zmax ) / 5000._wp
                wsbio4(ji,jj,jk) = wsbio2 + ( 200.- wsbio2 ) * zfact
             END DO
@@ -533,12 +519,12 @@
                zfact = zstep * xdiss(ji,jj,jk)
                !  Part I : Coagulation dependent on turbulence
-               zagg1 = 940.* zfact * trn(ji,jj,jk,jppoc) * trn(ji,jj,jk,jppoc)
-               zagg2 = 1.054e4 * zfact * trn(ji,jj,jk,jppoc) * trn(ji,jj,jk,jpgoc)
+               zagg1 = 354.  * zfact * trn(ji,jj,jk,jppoc) * trn(ji,jj,jk,jppoc)
+               zagg2 = 4452. * zfact * trn(ji,jj,jk,jppoc) * trn(ji,jj,jk,jpgoc)
 
                ! Part II : Differential settling
 
                !  Aggregation of small into large particles
-               zagg3 = 0.66 * zstep * trn(ji,jj,jk,jppoc) * trn(ji,jj,jk,jpgoc)
-               zagg4 = 0.e0 * zstep * trn(ji,jj,jk,jppoc) * trn(ji,jj,jk,jppoc)
+               zagg3 =  4.7 * zstep * trn(ji,jj,jk,jppoc) * trn(ji,jj,jk,jpgoc)
+               zagg4 =  0.4 * zstep * trn(ji,jj,jk,jppoc) * trn(ji,jj,jk,jppoc)
 
                zagg   = zagg1 + zagg2 + zagg3 + zagg4
@@ -546,13 +532,14 @@
 
                ! Aggregation of DOC to small particles
-               zaggdoc = ( 80.* trn(ji,jj,jk,jpdoc) + 698. * trn(ji,jj,jk,jppoc) ) *  zfact * trn(ji,jj,jk,jpdoc) 
-               zaggdoc2 = 1.05e4 * zfact * trn(ji,jj,jk,jpgoc) * trn(ji,jj,jk,jpdoc)
+               zaggdoc  = ( 0.83 * trn(ji,jj,jk,jpdoc) + 271. * trn(ji,jj,jk,jppoc) ) * zfact * trn(ji,jj,jk,jpdoc)
+               zaggdoc2 = 1.07e4 * zfact * trn(ji,jj,jk,jpgoc) * trn(ji,jj,jk,jpdoc)
+               zaggdoc3 =   0.02 * ( 16706. * trn(ji,jj,jk,jppoc) + 231. * trn(ji,jj,jk,jpdoc) ) * zstep * trn(ji,jj,jk,jpdoc)
 
                !  Update the trends
-               tra(ji,jj,jk,jppoc) = tra(ji,jj,jk,jppoc) - zagg + zaggdoc
+               tra(ji,jj,jk,jppoc) = tra(ji,jj,jk,jppoc) - zagg + zaggdoc + zaggdoc3
                tra(ji,jj,jk,jpgoc) = tra(ji,jj,jk,jpgoc) + zagg + zaggdoc2
                tra(ji,jj,jk,jpsfe) = tra(ji,jj,jk,jpsfe) - zaggfe
                tra(ji,jj,jk,jpbfe) = tra(ji,jj,jk,jpbfe) + zaggfe
-               tra(ji,jj,jk,jpdoc) = tra(ji,jj,jk,jpdoc) - zaggdoc - zaggdoc2
+               tra(ji,jj,jk,jpdoc) = tra(ji,jj,jk,jpdoc) - zaggdoc - zaggdoc2 - zaggdoc3
                !
             END DO
Index: branches/2011/dev_r2787_PISCES_improvment/NEMOGCM/NEMO/TOP_SRC/PISCES/sms_pisces.F90
===================================================================
--- branches/2011/dev_r2787_PISCES_improvment/NEMOGCM/NEMO/TOP_SRC/PISCES/sms_pisces.F90	(revision 2822)
+++ branches/2011/dev_r2787_PISCES_improvment/NEMOGCM/NEMO/TOP_SRC/PISCES/sms_pisces.F90	(revision 2823)
@@ -17,4 +17,6 @@
    PUBLIC
 
+   INTEGER ::   numnatp
+
    !!*  Time variables
    INTEGER  ::   nrdttrc           !: ???
@@ -25,9 +27,9 @@
 
    !!*  Biological parameters 
-   REAL(wp) ::   part              !: ???
    REAL(wp) ::   rno3              !: ???
    REAL(wp) ::   o2ut              !: ???
    REAL(wp) ::   po4r              !: ???
    REAL(wp) ::   rdenit            !: ???
+   REAL(wp) ::   rdenita           !: ???
    REAL(wp) ::   o2nit             !: ???
    REAL(wp) ::   wsbio, wsbio2     !: ???
@@ -55,4 +57,8 @@
    REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:)  ::   concdfe    !: ???
    REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:)  ::   concnfe    !: ???
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:)  ::   xlimnfe    !: ???
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:)  ::   xlimdfe    !: ???
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:)  ::   xlimsi     !: ???
+
 
    !!*  SMS for the organic matter
@@ -62,6 +68,6 @@
    REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   xdiss      !: ??
 #if defined key_diatrc
-   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   prodcal    !: Calcite production
-   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   grazing    !: Total zooplankton grazing
+    REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   prodcal    !: Calcite production
+    REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   grazing    !: Total zooplankton grazing
 #endif
 
@@ -74,4 +80,9 @@
    REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   borat      !: ???
    REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   hi         !: ???
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   excess     !: ???
+
+   !!* Temperature dependancy of SMS terms
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   tgfunc    !: Temp. dependancy of various biological rates
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   tgfunc2   !: Temp. dependancy of mesozooplankton rates
 
    !!* Array used to indicate negative tracer values
@@ -98,32 +109,37 @@
       !!----------------------------------------------------------------------
       USE lib_mpp , ONLY: ctl_warn
-      INTEGER ::   ierr(5)        ! Local variables
+      INTEGER ::   ierr(6)        ! Local variables
       !!----------------------------------------------------------------------
       ierr(:) = 0
-      !
       !*  Biological fluxes for light
-      ALLOCATE( neln(jpi,jpj), heup(jpi,jpj),                           STAT=ierr(1) )
+      ALLOCATE( neln(jpi,jpj), heup(jpi,jpj),                   STAT=ierr(1) )
       !
       !*  Biological fluxes for primary production
-      ALLOCATE( xksimax(jpi,jpj)     , xksi(jpi,jpj)        ,               &
-         &      xnanono3(jpi,jpj,jpk), xdiatno3(jpi,jpj,jpk),               &
-         &      xnanonh4(jpi,jpj,jpk), xdiatnh4(jpi,jpj,jpk),               &
-         &      xlimphy (jpi,jpj,jpk), xlimdia (jpi,jpj,jpk),               &
-         &      concdfe (jpi,jpj,jpk), concnfe (jpi,jpj,jpk),           STAT=ierr(2) ) 
+      ALLOCATE( xksimax(jpi,jpj)     , xksi(jpi,jpj)        ,       &
+         &      xnanono3(jpi,jpj,jpk), xdiatno3(jpi,jpj,jpk),       &
+         &      xnanonh4(jpi,jpj,jpk), xdiatnh4(jpi,jpj,jpk),       &
+         &      xlimphy (jpi,jpj,jpk), xlimdia (jpi,jpj,jpk),       &
+         &      xlimnfe (jpi,jpj,jpk), xlimdfe (jpi,jpj,jpk),       &
+         &      xlimsi  (jpi,jpj,jpk), concdfe (jpi,jpj,jpk),       &
+         &      concnfe (jpi,jpj,jpk),                          STAT=ierr(2) ) 
          !
-      !*  SMS for the organic matter
+       !*  SMS for the organic matter
       ALLOCATE( xfracal (jpi,jpj,jpk), nitrfac (jpi,jpj,jpk),               &
 #if defined key_diatrc
          &      prodcal(jpi,jpj,jpk) , grazing(jpi,jpj,jpk) ,               &
 #endif 
-         &      xlimbac (jpi,jpj,jpk), xdiss(jpi,jpj,jpk)   ,           STAT=ierr(3) )  
+         &      xlimbac (jpi,jpj,jpk), xdiss(jpi,jpj,jpk)   ,   STAT=ierr(3) )  
+
+      !* Variable for chemistry of the CO2 cycle
+      ALLOCATE( akb3(jpi,jpj,jpk)    , ak13  (jpi,jpj,jpk) ,       &
+         &      ak23(jpi,jpj,jpk)    , aksp  (jpi,jpj,jpk) ,       &
+         &      akw3(jpi,jpj,jpk)    , borat (jpi,jpj,jpk) ,       &
+         &      hi  (jpi,jpj,jpk)    , excess(jpi,jpj,jpk) ,   STAT=ierr(4) )
          !
-      !* Variable for chemistry of the CO2 cycle
-      ALLOCATE( akb3(jpi,jpj,jpk), ak13(jpi,jpj,jpk) ,                      &
-         &      ak23(jpi,jpj,jpk), aksp(jpi,jpj,jpk) ,                      &
-         &      akw3(jpi,jpj,jpk), borat(jpi,jpj,jpk), hi(jpi,jpj,jpk), STAT=ierr(4) )
+      !* Temperature dependancy of SMS terms
+      ALLOCATE( tgfunc(jpi,jpj,jpk)  , tgfunc2(jpi,jpj,jpk) ,   STAT=ierr(5) )
          !
       !* Array used to indicate negative tracer values  
-      ALLOCATE( xnegtr(jpi,jpj,jpk),                                    STAT=ierr(5) )
+      ALLOCATE( xnegtr(jpi,jpj,jpk)  ,                          STAT=ierr(6) )
       !
       sms_pisces_alloc = MAXVAL( ierr )
Index: branches/2011/dev_r2787_PISCES_improvment/NEMOGCM/NEMO/TOP_SRC/PISCES/trcini_pisces.F90
===================================================================
--- branches/2011/dev_r2787_PISCES_improvment/NEMOGCM/NEMO/TOP_SRC/PISCES/trcini_pisces.F90	(revision 2822)
+++ branches/2011/dev_r2787_PISCES_improvment/NEMOGCM/NEMO/TOP_SRC/PISCES/trcini_pisces.F90	(revision 2823)
@@ -17,15 +17,13 @@
    !!----------------------------------------------------------------------
    USE par_trc         ! TOP parameters
-   USE sms_pisces      ! Source Minus Sink variables
-   USE trc
-   USE oce_trc         ! ocean variables
-   USE p4zche 
-   USE p4zche          ! 
-   USE p4zsink         ! 
-   USE p4zopt          ! 
-   USE p4zprod         !
-   USE p4zrem          ! 
-   USE p4zsed          ! 
-   USE p4zflx          ! 
+   USE oce_trc         !  shared variables between ocean and passive tracers
+   USE trc             !  passive tracers common variables 
+   USE sms_pisces      !  PISCES Source Minus Sink variables
+   USE p4zche          !  Chemical model
+   USE p4zsink         !  vertical flux of particulate matter due to sinking
+   USE p4zopt          !  optical model
+   USE p4zrem          !  Remineralisation of organic matter
+   USE p4zflx          !  Gas exchange
+   USE p4zsed          !  Sedimentation
 
    IMPLICIT NONE
@@ -40,5 +38,5 @@
    REAL(wp) :: bioma0 =  1.000e-8_wp  
    REAL(wp) :: silic1 =  91.65e-6_wp  
-   REAL(wp) :: no3    =  31.04e-6_wp * 7.6_wp
+   REAL(wp) :: no3    =  31.04e-6_wp * 7.625_wp
 
 #  include "top_substitute.h90"
@@ -76,9 +74,10 @@
       ! Set biological ratios
       ! ---------------------
-      rno3   = (16.+2.) / 122.
-      po4r   =   1.e0   / 122.
-      o2nit  =  32.     / 122.
-      rdenit =  97.6    /  16.
-      o2ut   = 140.     / 122.
+      rno3    =  16._wp / 122._wp
+      po4r    =   1._wp / 122._wp
+      o2nit   =  32._wp / 122._wp
+      rdenit  = 105._wp /  16._wp
+      rdenita =   3._wp /  5._wp
+      o2ut    = 131._wp / 122._wp
 
       CALL p4z_che        ! initialize the chemical constants
@@ -136,11 +135,10 @@
       !! ** Purpose :   Allocate all the dynamic arrays of PISCES 
       !!----------------------------------------------------------------------
-      USE p4zint , ONLY : p4z_int_alloc      
-      USE p4zsink, ONLY : p4z_sink_alloc      
-      USE p4zopt , ONLY : p4z_opt_alloc           
-      USE p4zprod, ONLY : p4z_prod_alloc         
-      USE p4zrem , ONLY : p4z_rem_alloc           
-      USE p4zsed , ONLY : p4z_sed_alloc          
-      USE p4zflx , ONLY : p4z_flx_alloc
+      USE p4zsink , ONLY : p4z_sink_alloc      
+      USE p4zopt  , ONLY : p4z_opt_alloc           
+      USE p4zprod , ONLY : p4z_prod_alloc         
+      USE p4zrem  , ONLY : p4z_rem_alloc           
+      USE p4zsed  , ONLY : p4z_sed_alloc          
+      USE p4zflx  , ONLY : p4z_flx_alloc
       !
       INTEGER :: ierr
@@ -148,12 +146,11 @@
       !
       ierr =         sms_pisces_alloc()          ! Start of PISCES-related alloc routines...
-      ierr = ierr +     p4z_che_alloc()
-      ierr = ierr +     p4z_int_alloc()
-      ierr = ierr +    p4z_sink_alloc()
-      ierr = ierr +     p4z_opt_alloc()
-      ierr = ierr +    p4z_prod_alloc()
-      ierr = ierr +     p4z_rem_alloc()
-      ierr = ierr +     p4z_sed_alloc()
-      ierr = ierr +     p4z_flx_alloc()
+      ierr = ierr +  p4z_che_alloc()
+      ierr = ierr +  p4z_sink_alloc()
+      ierr = ierr +  p4z_opt_alloc()
+      ierr = ierr +  p4z_prod_alloc()
+      ierr = ierr +  p4z_rem_alloc()
+      ierr = ierr +  p4z_sed_alloc()
+      ierr = ierr +  p4z_flx_alloc()
       !
       IF( lk_mpp    )   CALL mpp_sum( ierr )
Index: branches/2011/dev_r2787_PISCES_improvment/NEMOGCM/NEMO/TOP_SRC/PISCES/trcnam_pisces.F90
===================================================================
--- branches/2011/dev_r2787_PISCES_improvment/NEMOGCM/NEMO/TOP_SRC/PISCES/trcnam_pisces.F90	(revision 2822)
+++ branches/2011/dev_r2787_PISCES_improvment/NEMOGCM/NEMO/TOP_SRC/PISCES/trcnam_pisces.F90	(revision 2823)
@@ -19,4 +19,5 @@
    USE trc             ! TOP variables
    USE sms_pisces      ! sms trends
+   USE in_out_manager  ! I/O manager
 
 
Index: branches/2011/dev_r2787_PISCES_improvment/NEMOGCM/NEMO/TOP_SRC/PISCES/trcrst_pisces.F90
===================================================================
--- branches/2011/dev_r2787_PISCES_improvment/NEMOGCM/NEMO/TOP_SRC/PISCES/trcrst_pisces.F90	(revision 2822)
+++ branches/2011/dev_r2787_PISCES_improvment/NEMOGCM/NEMO/TOP_SRC/PISCES/trcrst_pisces.F90	(revision 2823)
@@ -43,5 +43,5 @@
 
       !
-      IF( lk_dtatrc .AND. ln_pisclo ) CALL pis_dmp_clo  ! restoring of nutrients on close seas
+      IF( ln_trcdta .AND. ln_pisclo ) CALL pis_dmp_clo  ! restoring of nutrients on close seas
       IF( ln_pisdmp )                 CALL pis_dmp_ini  ! relaxation of some tracers
       !
@@ -120,15 +120,15 @@
 
          zarea   = 1. / areatot * 1.e6
-# if defined key_degrad
-         zalksum = glob_sum( trn(:,:,:,jptal) * cvol(:,:,:) * facvol(:,:,:) ) * zarea
-         zpo4sum = glob_sum( trn(:,:,:,jppo4) * cvol(:,:,:) * facvol(:,:,:) ) * zarea / 122.
-         zno3sum = glob_sum( trn(:,:,:,jpno3) * cvol(:,:,:) * facvol(:,:,:) ) * zarea / 7.6
-         zsilsum = glob_sum( trn(:,:,:,jpsil) * cvol(:,:,:) * facvol(:,:,:) ) * zarea
-# else
-         zalksum = glob_sum( trn(:,:,:,jptal) * cvol(:,:,:)  ) * zarea
-         zpo4sum = glob_sum( trn(:,:,:,jppo4) * cvol(:,:,:)  ) * zarea / 122.
-         zno3sum = glob_sum( trn(:,:,:,jpno3) * cvol(:,:,:)  ) * zarea / 7.6
-         zsilsum = glob_sum( trn(:,:,:,jpsil) * cvol(:,:,:)  ) * zarea
-# endif
+         IF( lk_degrad ) THEN
+            zalksum = glob_sum( trn(:,:,:,jptal) * cvol(:,:,:) * facvol(:,:,:) ) * zarea
+            zpo4sum = glob_sum( trn(:,:,:,jppo4) * cvol(:,:,:) * facvol(:,:,:) ) * zarea / 122.
+            zno3sum = glob_sum( trn(:,:,:,jpno3) * cvol(:,:,:) * facvol(:,:,:) ) * zarea / 7.6
+            zsilsum = glob_sum( trn(:,:,:,jpsil) * cvol(:,:,:) * facvol(:,:,:) ) * zarea
+         ELSE
+            zalksum = glob_sum( trn(:,:,:,jptal) * cvol(:,:,:)  ) * zarea
+            zpo4sum = glob_sum( trn(:,:,:,jppo4) * cvol(:,:,:)  ) * zarea / 122.
+            zno3sum = glob_sum( trn(:,:,:,jpno3) * cvol(:,:,:)  ) * zarea / 7.6
+            zsilsum = glob_sum( trn(:,:,:,jpsil) * cvol(:,:,:)  ) * zarea
+         ENDIF
 
          IF(lwp) WRITE(numout,*) '       TALK mean : ', zalksum
@@ -168,8 +168,10 @@
       !!                ictsi2(), ictsj2() : north-east Closed sea limits (i,j)
       !!----------------------------------------------------------------------
-      INTEGER, PARAMETER           ::   npicts   = 4       !: number of closed sea
-      INTEGER, DIMENSION(npicts)   ::   ictsi1, ictsj1     !: south-west closed sea limits (i,j)
-      INTEGER, DIMENSION(npicts)   ::   ictsi2, ictsj2     !: north-east closed sea limits (i,j)
-      INTEGER :: ji, jj, jk, jn, jc            ! dummy loop indices
+      INTEGER, PARAMETER           ::   npicts   = 4        ! number of closed sea
+      INTEGER, DIMENSION(npicts)   ::   ictsi1, ictsj1      ! south-west closed sea limits (i,j)
+      INTEGER, DIMENSION(npicts)   ::   ictsi2, ictsj2      ! north-east closed sea limits (i,j)
+      INTEGER :: ji, jj, jk, jn, jl, jc                     ! dummy loop indices
+      INTEGER :: ierr                                       ! local integer
+      REAL(wp), ALLOCATABLE, DIMENSION(:,:,:,:) ::  ztrcdta ! 4D  workspace
       !!----------------------------------------------------------------------
 
@@ -243,23 +245,31 @@
       END DO
 
-#if defined key_dtatrc
       ! Restore close seas values to initial data
-      CALL trc_dta( nit000 ) 
-      DO jn = 1, jptra
-         IF( lutini(jn) ) THEN
-            DO jc = 1, npicts
-               DO jk = 1, jpkm1
-                  DO jj = ictsj1(jc), ictsj2(jc)
-                     DO ji = ictsi1(jc), ictsi2(jc)
-                        trn(ji,jj,jk,jn) = trdta(ji,jj,jk,jn) * tmask(ji,jj,jk) 
-                        trb(ji,jj,jk,jn) = trn(ji,jj,jk,jn)
-                     ENDDO
-                  ENDDO
-               ENDDO
-            ENDDO
-         ENDIF
-      ENDDO
-#endif
-   !
+      IF( nb_trcdta > 0 ) THEN  ! Initialisation of tracer from a file that may also be used for damping
+        ALLOCATE( ztrcdta(jpi,jpj,jpk,nb_trcdta), STAT=ierr )
+        IF( ierr > 0 ) THEN
+           CALL ctl_stop( 'trc_ini: unable to allocate ztrcdta array' )   ;   RETURN
+        ENDIF
+        !
+        CALL trc_dta( nit000, ztrcdta )   ! read tracer data at nit000
+        !
+        DO jn = 1, jptra
+           IF( ln_trc_ini(jn) ) THEN      ! update passive tracers arrays with input data read from file
+              jl = n_trc_index(jn)
+              DO jc = 1, npicts
+                 DO jk = 1, jpkm1
+                    DO jj = ictsj1(jc), ictsj2(jc)
+                       DO ji = ictsi1(jc), ictsi2(jc)
+                          trn(ji,jj,jk,jn) = ztrcdta(ji,jj,jk,jl) * tmask(ji,jj,jk) 
+                          trb(ji,jj,jk,jn) = trn(ji,jj,jk,jn)
+                       ENDDO
+                    ENDDO
+                 ENDDO
+              ENDDO
+           ENDIF
+        ENDDO
+        DEALLOCATE( ztrcdta )
+      ENDIF
+      !
    END SUBROUTINE pis_dmp_clo
 
Index: branches/2011/dev_r2787_PISCES_improvment/NEMOGCM/NEMO/TOP_SRC/PISCES/trcsms_pisces.F90
===================================================================
--- branches/2011/dev_r2787_PISCES_improvment/NEMOGCM/NEMO/TOP_SRC/PISCES/trcsms_pisces.F90	(revision 2822)
+++ branches/2011/dev_r2787_PISCES_improvment/NEMOGCM/NEMO/TOP_SRC/PISCES/trcsms_pisces.F90	(revision 2823)
@@ -13,29 +13,25 @@
    !!   trcsms_pisces        :  Time loop of passive tracers sms
    !!----------------------------------------------------------------------
-   USE oce_trc         !
-   USE trc
-   USE sms_pisces
-   
-   USE p4zint          ! 
-   USE p4zche          ! 
-   USE p4zbio          ! 
-   USE p4zsink         ! 
-   USE p4zopt          ! 
-   USE p4zlim          ! 
-   USE p4zprod         !
-   USE p4zmort         !
-   USE p4zmicro        ! 
-   USE p4zmeso         ! 
-   USE p4zrem          ! 
-   USE p4zsed          ! 
-   USE p4zlys          ! 
-   USE p4zflx          ! 
-
-   USE prtctl_trc
-
-   USE trdmod_oce
-   USE trdmod_trc
-
-   USE sedmodel
+   USE oce_trc         !  shared variables between ocean and passive tracers
+   USE trc             !  passive tracers common variables 
+   USE sms_pisces      !  PISCES Source Minus Sink variables
+   USE p4zbio          !  Biological model
+   USE p4zche          !  Chemical model
+   USE p4zsink         !  vertical flux of particulate matter due to sinking
+   USE p4zopt          !  optical model
+   USE p4zlim          !  Co-limitations of differents nutrients
+   USE p4zprod         !  Growth rate of the 2 phyto groups
+   USE p4zmort         !  Mortality terms for phytoplankton
+   USE p4zmicro        !  Sources and sinks of microzooplankton
+   USE p4zmeso         !  Sources and sinks of mesozooplankton
+   USE p4zrem          !  Remineralisation of organic matter
+   USE p4zlys          !  Calcite saturation
+   USE p4zflx          !  Gas exchange
+   USE p4zsed          !  Sedimentation
+   USE p4zint          !  time interpolation
+   USE trdmod_oce      !  Ocean trends variables
+   USE trdmod_trc      !  TOP trends variables
+   USE sedmodel        !  Sediment model
+   USE prtctl_trc      !  print control for debugging
 
    IMPLICIT NONE
@@ -86,6 +82,6 @@
          IF(lwp) write(numout,*) '~~~~~~'
 
-         CALL p4z_che          ! computation of chemical constants
-         CALL p4z_int          ! computation of various rates for biogeochemistry
+         CALL p4z_che              ! computation of chemical constants
+         CALL p4z_int              ! computation of various rates for biogeochemistry
          !
       ENDIF
@@ -128,5 +124,5 @@
       ENDIF
 
-      IF( wrk_not_released(3,1) ) CALL ctl_stop('trc_sms_pisces : failed to release workspace array.') 
+      IF( wrk_not_released(3, 1) ) CALL ctl_stop('trc_sms_pisces : failed to release workspace array.') 
 
    END SUBROUTINE trc_sms_pisces
@@ -164,15 +160,15 @@
       xstep = rfact2 / rday
 
-      CALL p4z_sink_init      ! vertical flux of particulate organic matter
-      CALL p4z_opt_init       ! Optic: PAR in the water column
-      CALL p4z_lim_init       ! co-limitations by the various nutrients
-      CALL p4z_prod_init      ! phytoplankton growth rate over the global ocean. 
-      CALL p4z_rem_init       ! remineralisation
-      CALL p4z_mort_init      ! phytoplankton mortality
-      CALL p4z_micro_init     ! microzooplankton
-      CALL p4z_meso_init      ! mesozooplankton
-      CALL p4z_sed_init       ! sedimentation
-      CALL p4z_lys_init       ! calcite saturation
-      CALL p4z_flx_init       ! gas exchange
+      CALL p4z_sink_init      !  vertical flux of particulate organic matter
+      CALL p4z_opt_init       !  Optic: PAR in the water column
+      CALL p4z_lim_init       !  co-limitations by the various nutrients
+      CALL p4z_prod_init      !  phytoplankton growth rate over the global ocean. 
+      CALL p4z_rem_init       !  remineralisation
+      CALL p4z_mort_init      !  phytoplankton mortality
+      CALL p4z_micro_init     !  microzooplankton
+      CALL p4z_meso_init      !  mesozooplankton
+      CALL p4z_sed_init       !  sedimentation
+      CALL p4z_lys_init       !  calcite saturation
+      CALL p4z_flx_init       !  gas exchange
 
       ndayflxtr = 0
