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

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

Changeset 4152


Ignore:
Timestamp:
2013-11-05T12:59:53+01:00 (10 years ago)
Author:
cetlod
Message:

merge in dev_LOCEAN_2013 the 2nd development branch dev_r3940_CNRS4_IOCRS, see ticket #1169

Location:
branches/2013/dev_LOCEAN_2013/NEMOGCM
Files:
43 edited
3 copied

Legend:

Unmodified
Added
Removed
  • branches/2013/dev_LOCEAN_2013/NEMOGCM/CONFIG/AMM12/EXP00/namelist_cfg

    r4147 r4152  
    7474/ 
    7575!----------------------------------------------------------------------- 
     76&namcrs        !   Grid coarsening for dynamics output and/or 
     77               !   passive tracer coarsened online simulations 
     78!----------------------------------------------------------------------- 
     79/ 
     80!----------------------------------------------------------------------- 
    7681&namtsd    !   data : Temperature  & Salinity 
    7782!----------------------------------------------------------------------- 
  • branches/2013/dev_LOCEAN_2013/NEMOGCM/CONFIG/GYRE/EXP00/namelist_cfg

    r4147 r4152  
    6464/ 
    6565!----------------------------------------------------------------------- 
     66&namcrs        !   Grid coarsening for dynamics output and/or 
     67               !   passive tracer coarsened online simulations 
     68!----------------------------------------------------------------------- 
     69/ 
     70!----------------------------------------------------------------------- 
    6671&namtsd    !   data : Temperature  & Salinity 
    6772!----------------------------------------------------------------------- 
  • branches/2013/dev_LOCEAN_2013/NEMOGCM/CONFIG/GYRE_BFM/EXP00/namelist_cfg

    r4147 r4152  
    7070/ 
    7171!----------------------------------------------------------------------- 
     72&namcrs        !   Grid coarsening for dynamics output and/or 
     73               !   passive tracer coarsened online simulations 
     74!----------------------------------------------------------------------- 
     75/ 
     76!----------------------------------------------------------------------- 
    7277&namtsd    !   data : Temperature  & Salinity 
    7378!----------------------------------------------------------------------- 
  • branches/2013/dev_LOCEAN_2013/NEMOGCM/CONFIG/GYRE_BFM/EXP00/namelist_top_cfg

    r4147 r4152  
    11!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    22!! NEMO-TOP : GYRE_BFM configuration namelist used to overwrite SHARED/namelist_top_ref 
     3!----------------------------------------------------------------------- 
     4&namtrc_run     !   run information 
     5!----------------------------------------------------------------------- 
     6   nn_writetrc   =  0        !  time step frequency for sn_tracer outputs 
     7   ln_top_euler  = .true.    !  use Euler time-stepping for TOP 
     8/ 
    39!''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 
    410&namtrc     !   tracers definition 
    511!,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, 
    6       
    7    nn_writetrc   =  0        !  time step frequency for sn_tracer outputs 
    8    ln_top_euler  = .true.    !  use Euler timestepping for TOP 
    912   ln_trcdta     =  .false.        !  Initialisation from data input file (T) or not (F) 
    1013! 
    1114!              !    name   !           title of the field              !   units    ! initial data ! save   ! 
    12 !              !           !                                           !            ! from file    ! or not !  
     15!              !           !                                           !            ! from file    ! or not ! 
    1316!              !           !                                           !            ! or not       !        ! 
    1417   sn_tracer(1)   = 'DUMMY   ' , 'Dummy tracer      '                 ,  'dummy-units' ,  .false.     ,  .true. 
  • branches/2013/dev_LOCEAN_2013/NEMOGCM/CONFIG/GYRE_PISCES/EXP00/namelist_cfg

    r4147 r4152  
    6060/ 
    6161!----------------------------------------------------------------------- 
     62&namcrs        !   Grid coarsening for dynamics output and/or 
     63               !   passive tracer coarsened online simulations 
     64!----------------------------------------------------------------------- 
     65/ 
     66!----------------------------------------------------------------------- 
    6267&namtsd    !   data : Temperature  & Salinity 
    6368!----------------------------------------------------------------------- 
  • branches/2013/dev_LOCEAN_2013/NEMOGCM/CONFIG/GYRE_PISCES/EXP00/namelist_top_cfg

    r4147 r4152  
    11!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    22!! NEMO-TOP Configuration namelist for GYRE_PISCES configuration used to overwrite SHARED/namelist_top_ref 
    3 !''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 
     3!----------------------------------------------------------------------- 
     4&namtrc_run     !   run information 
     5!----------------------------------------------------------------------- 
     6   nn_writetrc   =  60     !  time step frequency for sn_tracer outputs 
     7/ 
     8!----------------------------------------------------------------------- 
    49&namtrc     !   tracers definition 
    5 !,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, 
    6    nn_writetrc   =  60      !  time step frequency for sn_tracer outputs 
    7    nn_rsttr      =   1       !  restart control = 0 initial time step is not compared to the restart file value 
     10!----------------------------------------------------------------------- 
    811   ln_trcdta     =   .false.    !  Initialisation from data input file (T) or not (F) 
    912! 
    1013!                ! name  !     title of the field          !   units       ! initial data ! save   ! 
    11 !                !       !                                 !               ! from file    ! or not !  
     14!                !       !                                 !               ! from file    ! or not ! 
    1215!                !       !                                 !               ! or not       !        ! 
    1316   sn_tracer(1)   = 'DET'   , 'Detritus                   ',  'mmole-N/m3' ,  .false.     ,  .false. 
  • branches/2013/dev_LOCEAN_2013/NEMOGCM/CONFIG/ORCA2_LIM/EXP00/namelist_cfg

    r4147 r4152  
    4949   ppkth2      =  999999.              ! 
    5050   ppacr2      =  999999.              ! 
     51/ 
     52!----------------------------------------------------------------------- 
     53&namcrs        !   Grid coarsening for dynamics output and/or 
     54               !   passive tracer coarsened online simulations 
     55!----------------------------------------------------------------------- 
    5156/ 
    5257!----------------------------------------------------------------------- 
  • branches/2013/dev_LOCEAN_2013/NEMOGCM/CONFIG/ORCA2_LIM_CFC_C14b/EXP00/iodef.xml

    r3771 r4152  
    2121    --> 
    2222     
    23     <file_definition type="multiple_file" sync_freq="1d" min_digits="4"> 
    24      
     23   <file_definition type="multiple_file" name="@expname@_@freq@_@startdate@_@enddate@" sync_freq="10d" min_digits="4"> 
     24 
     25      <file_group id="1ts" output_freq="1ts"  output_level="10" enabled=".TRUE."/> <!-- 1 time step files --> 
    2526      <file_group id="1h" output_freq="1h"  output_level="10" enabled=".TRUE."/> <!-- 1h files --> 
    2627      <file_group id="2h" output_freq="2h"  output_level="10" enabled=".TRUE."/> <!-- 2h files --> 
     
    3334      <file_group id="3d" output_freq="3d"  output_level="10" enabled=".TRUE."/> <!-- 3d files -->     
    3435      <file_group id="5d" output_freq="5d"  output_level="10" enabled=".TRUE.">  <!-- 5d files -->    
     36 
     37   <file id="file1" name_suffix="_grid_T" description="ocean T grid variables" > 
     38     <field field_ref="toce"         name="thetao"   long_name="sea_water_potential_temperature"               /> 
     39     <field field_ref="soce"         name="so"       long_name="sea_water_salinity"                            /> 
     40     <field field_ref="sst"          name="tos"      long_name="sea_surface_temperature"                       /> 
     41     <field field_ref="sst2"         name="tossq"    long_name="square_of_sea_surface_temperature"             /> 
     42     <field field_ref="sss"          name="sos"      long_name="sea_surface_salinity"                          /> 
     43     <field field_ref="ssh"          name="zos"      long_name="sea_surface_height_above_geoid"                /> 
     44     <field field_ref="ssh2"         name="zossq"    long_name="square_of_sea_surface_height_above_geoid"      /> 
     45     <field field_ref="empmr"        name="wfo"      long_name="water_flux_into_sea_water"                     /> 
     46     <field field_ref="qsr"          name="rsntds"   long_name="surface_net_downward_shortwave_flux"           /> 
     47     <field field_ref="qt"           name="tohfls"   long_name="surface_net_downward_total_heat_flux"          /> 
     48     <field field_ref="taum"         /> 
     49     <field field_ref="mldkz5"       /> 
     50     <field field_ref="mldr10_1"     /> 
     51   </file> 
     52    
     53   <file id="file2" name_suffix="_grid_U" description="ocean U grid variables" > 
     54     <field field_ref="uoce"         name="uo"      long_name="sea_water_x_velocity"      /> 
     55     <field field_ref="suoce"        name="uos"     long_name="sea_surface_x_velocity"    /> 
     56     <field field_ref="utau"         name="tauuo"   long_name="surface_downward_x_stress" /> 
     57   </file> 
     58    
     59   <file id="file3" name_suffix="_grid_V" description="ocean V grid variables" > 
     60     <field field_ref="voce"         name="vo"      long_name="sea_water_y_velocity"      /> 
     61     <field field_ref="svoce"        name="vos"     long_name="sea_surface_y_velocity"    /> 
     62     <field field_ref="vtau"         name="tauvo"   long_name="surface_downward_y_stress" /> 
     63   </file> 
     64    
     65   <file id="file4" name_suffix="_grid_W" description="ocean W grid variables" > 
     66     <field field_ref="woce"         name="wo"      long_name="ocean vertical velocity"         /> 
     67     <field field_ref="avt"          name="difvho"  long_name="ocean_vertical_heat_diffusivity" /> 
     68   </file> 
     69    
     70   <file id="file5" name_suffix="_icemod" description="ice variables" > 
     71     <field field_ref="ice_pres"                     /> 
     72     <field field_ref="snowthic_cea" name="snd"     long_name="surface_snow_thickness"   /> 
     73     <field field_ref="icethic_cea"  name="sit"     long_name="sea_ice_thickness"        /> 
     74     <field field_ref="iceprod_cea"  name="sip"     long_name="sea_ice_thickness"        /> 
     75     <field field_ref="ist_ipa"      /> 
     76     <field field_ref="ioceflxb"     /> 
     77     <field field_ref="uice_ipa"     /> 
     78     <field field_ref="vice_ipa"     /> 
     79     <field field_ref="utau_ice"     /> 
     80     <field field_ref="vtau_ice"     /> 
     81     <field field_ref="qsr_io_cea"   /> 
     82     <field field_ref="qns_io_cea"   /> 
     83     <field field_ref="snowpre"      /> 
     84   </file> 
     85 
     86 
     87   <file id="file6" name_suffix="_ptrc_T" description="sms variables" > 
     88          <field field_ref="CFC11"      /> 
     89          <field field_ref="C14B" /> 
     90   </file> 
     91    
     92   <file id="file7" name_suffix="_diad_T" description="additional diagnostics" > 
     93          <field field_ref="qtrCFC11"     /> 
     94          <field field_ref="qintCFC11"     /> 
     95          <field field_ref="qtrC14b"     /> 
     96          <field field_ref="qintC14b"     /> 
     97          <field field_ref="fdecay"     /> 
     98   </file> 
     99 
    35100      </file_group> 
    36101 
  • branches/2013/dev_LOCEAN_2013/NEMOGCM/CONFIG/ORCA2_LIM_CFC_C14b/EXP00/namelist_cfg

    r4147 r4152  
    6969/ 
    7070!----------------------------------------------------------------------- 
     71&namcrs        !   Grid coarsening for dynamics output and/or 
     72               !   passive tracer coarsened online simulations 
     73!----------------------------------------------------------------------- 
     74/ 
     75!----------------------------------------------------------------------- 
    7176&namtsd    !   data : Temperature  & Salinity                            
    7277!----------------------------------------------------------------------- 
  • branches/2013/dev_LOCEAN_2013/NEMOGCM/CONFIG/ORCA2_LIM_CFC_C14b/EXP00/namelist_top_cfg

    r4147 r4152  
    22!! NEMO/TOP1 :  ORCA2_LIM_CFC_C14b configuration namelist used to overwrite SHARED/namelist_top 
    33!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     4!----------------------------------------------------------------------- 
     5&namtrc_run     !   run information 
     6!----------------------------------------------------------------------- 
     7/ 
    48!''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 
    59&namtrc     !   tracers definition 
     
    812! 
    913!              !    name   !           title of the field              !   units    ! initial data ! save   ! 
    10 !              !           !                                           !            ! from file    ! or not !  
     14!              !           !                                           !            ! from file    ! or not ! 
    1115!              !           !                                           !            ! or not       !        ! 
    1216   sn_tracer(1)  = 'CFC11   ' , 'CFC11 Concentration                    ',  'umolC/L',   .false.    ,  .true. 
  • branches/2013/dev_LOCEAN_2013/NEMOGCM/CONFIG/ORCA2_LIM_PISCES/EXP00/iodef.xml

    r4148 r4152  
    2020============================================================================================================ 
    2121    --> 
    22      
    23     <file_definition type="multiple_file" sync_freq="1d" min_digits="4"> 
    24      
     22  
     23     
     24    <file_definition type="multiple_file" name="@expname@_@freq@_@startdate@_@enddate@" sync_freq="10d" min_digits="4"> 
     25     
     26      <file_group id="1ts" output_freq="1ts"  output_level="10" enabled=".TRUE."/> <!-- 1 time step files --> 
    2527      <file_group id="1h" output_freq="1h"  output_level="10" enabled=".TRUE."/> <!-- 1h files --> 
    2628      <file_group id="2h" output_freq="2h"  output_level="10" enabled=".TRUE."/> <!-- 2h files --> 
     
    3133      <file_group id="1d" output_freq="1d"  output_level="10" enabled=".TRUE."> <!-- 1d files --> 
    3234 
    33    <file id="1d_grid_T" name="auto" description="ocean T grid variables" > 
    34      <field field_ref="sst"          name="sosstsst"  /> 
    35      <field field_ref="sss"          name="sosaline"  /> 
    36      <field field_ref="ssh"          name="sossheig"  /> 
    37    </file> 
    38  
    39    <file id="1d_grid_U" name="auto" description="ocean U grid variables" > 
    40      <field field_ref="suoce"         name="vozocrtx"  /> 
    41    </file> 
    42     
    43    <file id="1d_grid_V" name="auto" description="ocean V grid variables" > 
    44      <field field_ref="svoce"         name="vomecrty"  /> 
    45    </file> 
    46     
    47       </file_group> 
     35   <file id="file1" name_suffix="_grid_T" description="ocean T grid variables" > 
     36     <field field_ref="sst"          name="tos"      long_name="sea_surface_temperature"                       /> 
     37     <field field_ref="sss"          name="sos"      long_name="sea_surface_salinity"                          /> 
     38     <field field_ref="ssh"          name="zos"      long_name="sea_surface_height_above_geoid"                /> 
     39   </file> 
     40 
     41   <file id="file2" name_suffix="_grid_U" description="ocean U grid variables" > 
     42     <field field_ref="suoce"        name="uos"     long_name="sea_surface_x_velocity"    /> 
     43   </file> 
     44    
     45   <file id="file3" name_suffix="_grid_V" description="ocean V grid variables" > 
     46     <field field_ref="svoce"        name="vos"     long_name="sea_surface_y_velocity"    /> 
     47   </file> 
     48    
     49      </file_group> 
     50 
    4851      <file_group id="3d" output_freq="3d"  output_level="10" enabled=".TRUE."/> <!-- 3d files -->     
     52 
    4953      <file_group id="5d" output_freq="5d"  output_level="10" enabled=".TRUE.">  <!-- 5d files -->    
    5054 
    51    <file id="5d_grid_T" name="auto" description="ocean T grid variables" > 
    52      <field field_ref="toce"         name="votemper"  /> 
    53      <field field_ref="soce"         name="vosaline"  /> 
    54      <field field_ref="sst"          name="sosstsst"  /> 
    55      <field field_ref="sss"          name="sosaline"  /> 
    56      <field field_ref="ssh"          name="sossheig"  /> 
    57      <field field_ref="empmr"        name="sowaflup"  /> 
    58      <field field_ref="qsr"          name="soshfldo"  /> 
    59           <field field_ref="saltflx"      name="sosfldow"  /> 
    60           <field field_ref="fmmflx"       name="sofmflup"  /> 
    61      <field field_ref="qt"           name="sohefldo"  /> 
    62      <field field_ref="mldr10_1"     name="somxl010"  /> 
    63      <field field_ref="mldkz5"       name="somixhgt"  /> 
    64      <field field_ref="ice_cover"    name="soicecov"  /> 
    65      <field field_ref="wspd"         name="sowindsp"  /> 
    66      <field field_ref="erp"          name="sowafldp"  /> 
    67      <field field_ref="ist_ipa"      name="soicetem"  /> 
    68      <field field_ref="icealb_cea"   name="soicealb"  />    
    69    </file> 
    70     
    71    <file id="5d_grid_U" name="auto" description="ocean U grid variables" > 
    72      <field field_ref="uoce"         name="vozocrtx"  /> 
    73      <field field_ref="uoce_eiv"     name="vozoeivu"  /> 
    74      <field field_ref="utau"         name="sozotaux"  /> 
    75    </file> 
    76     
    77    <file id="5d_grid_V" name="auto" description="ocean V grid variables" > 
    78      <field field_ref="voce"         name="vomecrty"  /> 
    79      <field field_ref="voce_eiv"     name="vomeeivv"  /> 
    80      <field field_ref="vtau"         name="sometauy"  /> 
    81    </file> 
    82     
    83    <file id="5d_grid_W" name="auto" description="ocean W grid variables" > 
    84      <field field_ref="woce"         name="vovecrtz" /> 
    85      <field field_ref="avt"          name="votkeavt" /> 
    86      <field field_ref="avs"          name="voddmavs" /> 
    87      <field field_ref="aht2d_eiv"    name="soleaeiw" /> 
    88    </file> 
    89     
    90    <file id="5d_icemod" name="auto" description="ice variables" > 
     55   <file id="file4" name_suffix="_grid_T" description="ocean T grid variables" > 
     56     <field field_ref="toce"         name="thetao"   long_name="sea_water_potential_temperature"               /> 
     57     <field field_ref="soce"         name="so"       long_name="sea_water_salinity"                            /> 
     58     <field field_ref="sst"          name="tos"      long_name="sea_surface_temperature"                       /> 
     59     <field field_ref="sst2"         name="tossq"    long_name="square_of_sea_surface_temperature"             /> 
     60     <field field_ref="sss"          name="sos"      long_name="sea_surface_salinity"                          /> 
     61     <field field_ref="ssh"          name="zos"      long_name="sea_surface_height_above_geoid"                /> 
     62     <field field_ref="ssh2"         name="zossq"    long_name="square_of_sea_surface_height_above_geoid"      /> 
     63     <field field_ref="empmr"        name="wfo"      long_name="water_flux_into_sea_water"                     /> 
     64     <field field_ref="qsr"          name="rsntds"   long_name="surface_net_downward_shortwave_flux"           /> 
     65     <field field_ref="qt"           name="tohfls"   long_name="surface_net_downward_total_heat_flux"          /> 
     66     <field field_ref="taum"         /> 
     67     <field field_ref="mldkz5"       /> 
     68     <field field_ref="mldr10_1"     /> 
     69   </file> 
     70    
     71   <file id="file5" name_suffix="_grid_U" description="ocean U grid variables" > 
     72     <field field_ref="uoce"         name="uo"      long_name="sea_water_x_velocity"      /> 
     73     <field field_ref="suoce"        name="uos"     long_name="sea_surface_x_velocity"    /> 
     74     <field field_ref="utau"         name="tauuo"   long_name="surface_downward_x_stress" /> 
     75   </file> 
     76    
     77   <file id="file6" name_suffix="_grid_V" description="ocean V grid variables" > 
     78     <field field_ref="voce"         name="vo"      long_name="sea_water_y_velocity"      /> 
     79     <field field_ref="svoce"        name="vos"     long_name="sea_surface_y_velocity"    /> 
     80     <field field_ref="vtau"         name="tauvo"   long_name="surface_downward_y_stress" /> 
     81   </file> 
     82    
     83   <file id="file7" name_suffix="_grid_W" description="ocean W grid variables" > 
     84     <field field_ref="woce"         name="wo"      long_name="ocean vertical velocity"         /> 
     85     <field field_ref="avt"          name="difvho"  long_name="ocean_vertical_heat_diffusivity" /> 
     86   </file> 
     87    
     88   <file id="file8" name_suffix="_icemod" description="ice variables" > 
    9189     <field field_ref="ice_pres"                     /> 
    92      <field field_ref="snowthic_cea" name="isnowthi" /> 
    93      <field field_ref="icethic_cea"  name="iicethic" /> 
    94      <field field_ref="iceprod_cea"  name="iiceprod" /> 
    95      <field field_ref="ist_ipa"      name="iicetemp" /> 
    96      <field field_ref="ioceflxb"     name="ioceflxb" /> 
    97      <field field_ref="uice_ipa"     name="iicevelu" /> 
    98      <field field_ref="vice_ipa"     name="iicevelv" /> 
    99      <field field_ref="utau_ice"     name="iicestru" /> 
    100      <field field_ref="vtau_ice"     name="iicestrv" /> 
    101      <field field_ref="qsr_io_cea"   name="iicesflx" /> 
    102      <field field_ref="qns_io_cea"   name="iicenflx" /> 
    103      <field field_ref="snowpre"      name="isnowpre" /> 
     90     <field field_ref="snowthic_cea" name="snd"     long_name="surface_snow_thickness"  /> 
     91     <field field_ref="icethic_cea"  name="sit"     long_name="sea_ice_thickness"        /> 
     92     <field field_ref="iceprod_cea"  name="sip"     long_name="sea_ice_thickness"        /> 
     93     <field field_ref="ist_ipa"      /> 
     94     <field field_ref="ioceflxb"     /> 
     95     <field field_ref="uice_ipa"     /> 
     96     <field field_ref="vice_ipa"     /> 
     97     <field field_ref="utau_ice"     /> 
     98     <field field_ref="vtau_ice"     /> 
     99     <field field_ref="qsr_io_cea"   /> 
     100     <field field_ref="qns_io_cea"   /> 
     101     <field field_ref="snowpre"      /> 
    104102   </file> 
    105103    
     
    108106      <file_group id="1m" output_freq="1mo" output_level="10" enabled=".TRUE."> <!-- real monthly files --> 
    109107 
    110    <file id="1m_ptrc_T" name="auto" description="pisces sms variables" > 
     108   <file id="file9" name_suffix="_ptrc_T" description="pisces sms variables" > 
    111109          <field field_ref="DIC"      /> 
    112110          <field field_ref="Alkalini" /> 
     
    120118   </file> 
    121119    
    122    <file id="1m_diad_T" name="auto" description="additional pisces diagnostics" > 
     120   <file id="file10" name_suffix="_diad_T" description="additional pisces diagnostics" > 
    123121          <field field_ref="Cflx"     /> 
    124122          <field field_ref="Dpco2"    /> 
     
    126124 
    127125      </file_group> 
     126 
    128127      <file_group id="2m" output_freq="2mo" output_level="10" enabled=".TRUE."/> <!-- real 2m files --> 
    129128      <file_group id="3m" output_freq="3mo" output_level="10" enabled=".TRUE."/> <!-- real 3m files --> 
     
    133132      <file_group id="1y"  output_freq="1y" output_level="10" enabled=".TRUE."> <!-- real yearly files --> 
    134133 
    135    <file id="1y_ptrc_T" name="auto" description="pisces sms variables" > 
     134   <file id="file11" name_suffix="_ptrc_T" description="pisces sms variables" > 
    136135          <field field_ref="DIC"      /> 
    137136          <field field_ref="Alkalini" /> 
     
    160159   </file> 
    161160 
    162    <file id="1y_diad_T" name="auto" description="additional pisces diagnostics" > 
     161   <file id="file12" name_suffix="_diad_T" description="additional pisces diagnostics" > 
    163162          <field field_ref="PH"       /> 
    164163          <field field_ref="CO3"      /> 
     
    212211 
    213212      </file_group> 
     213 
    214214      <file_group id="2y"  output_freq="2y" output_level="10" enabled=".TRUE."/> <!-- real 2y files --> 
    215215      <file_group id="5y"  output_freq="5y" output_level="10" enabled=".TRUE."/> <!-- real 5y files --> 
     
    217217 
    218218   </file_definition> 
    219      
     219 
    220220    <!--  
    221221============================================================================================================ 
  • branches/2013/dev_LOCEAN_2013/NEMOGCM/CONFIG/ORCA2_LIM_PISCES/EXP00/namelist_cfg

    r4147 r4152  
    4949   ppkth2      =  999999.              ! 
    5050   ppacr2      =  999999.              ! 
     51/ 
     52!----------------------------------------------------------------------- 
     53&namcrs        !   Grid coarsening for dynamics output and/or 
     54               !   passive tracer coarsened online simulations 
     55!----------------------------------------------------------------------- 
    5156/ 
    5257!----------------------------------------------------------------------- 
  • branches/2013/dev_LOCEAN_2013/NEMOGCM/CONFIG/ORCA2_LIM_PISCES/EXP00/namelist_top_cfg

    r4148 r4152  
    22!! NEMO/TOP1 :  Configuration namelist : used to overwrite defaults values defined in SHARED/namelist_top_ref 
    33!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    4 !''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 
     4!----------------------------------------------------------------------- 
     5&namtrc_run     !   run information 
     6!----------------------------------------------------------------------- 
     7   ln_top_euler  = .true.    !  use Euler time-stepping for TOP 
     8/ 
     9!----------------------------------------------------------------------- 
    510&namtrc     !   tracers definition 
    6 !,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, 
     11!----------------------------------------------------------------------- 
    712   ln_top_euler  = .true.   !  use Euler time-stepping for TOP 
    813!                !    name   !           title of the field              ! initial data ! initial data ! save   ! 
  • branches/2013/dev_LOCEAN_2013/NEMOGCM/CONFIG/ORCA2_OFF_PISCES/EXP00/iodef.xml

    r3771 r4152  
    2020============================================================================================================ 
    2121    --> 
     22 
     23   <file_definition type="multiple_file" name="@expname@_@freq@_@startdate@_@enddate@" sync_freq="10d" min_digits="4"> 
    2224     
    23     <file_definition type="multiple_file" sync_freq="1d" min_digits="4"> 
    24      
     25      <file_group id="1ts" output_freq="1ts"  output_level="10" enabled=".TRUE."/> <!-- 1 time step files --> 
    2526      <file_group id="1h" output_freq="1h"  output_level="10" enabled=".TRUE."/> <!-- 1h files --> 
    2627      <file_group id="2h" output_freq="2h"  output_level="10" enabled=".TRUE."/> <!-- 2h files --> 
     
    3536      <file_group id="1m" output_freq="1mo" output_level="10" enabled=".TRUE."> <!-- real monthly files --> 
    3637 
    37    <file id="1m_ptrc_T" name="auto" description="pisces sms variables" > 
     38   <file id="file1" name_suffix="_ptrc_T" description="pisces sms variables" > 
    3839          <field field_ref="DIC"      /> 
    3940          <field field_ref="Alkalini" /> 
     
    4748   </file> 
    4849    
    49    <file id="1m_diad_T" name="auto" description="additional pisces diagnostics" > 
     50   <file id="file2" name_suffix="_diad_T" description="additional pisces diagnostics" > 
    5051          <field field_ref="Cflx"     /> 
    5152          <field field_ref="Dpco2"    /> 
     
    6061      <file_group id="1y"  output_freq="1y" output_level="10" enabled=".TRUE."> <!-- real yearly files --> 
    6162 
    62    <file id="1y_ptrc_T" name="auto" description="pisces sms variables" > 
     63   <file id="file3" name_suffix="_ptrc_T" description="pisces sms variables" > 
    6364          <field field_ref="DIC"      /> 
    6465          <field field_ref="Alkalini" /> 
     
    8788   </file> 
    8889 
    89    <file id="1y_diad_T" name="auto" description="additional pisces diagnostics" > 
     90   <file id="file4" name_suffix="_ptrc_T" description="additional pisces diagnostics" > 
    9091          <field field_ref="PH"       /> 
    9192          <field field_ref="CO3"      /> 
  • branches/2013/dev_LOCEAN_2013/NEMOGCM/CONFIG/ORCA2_OFF_PISCES/EXP00/namelist_cfg

    r4148 r4152  
    5555   ppacr2      =  999999.              ! 
    5656/ 
    57  
     57!----------------------------------------------------------------------- 
     58&namcrs        !   Grid coarsening for dynamics output and/or 
     59               !   passive tracer coarsened online simulations 
     60!----------------------------------------------------------------------- 
     61/ 
    5862!----------------------------------------------------------------------- 
    5963&namsbc        !   Surface Boundary Condition (surface module) 
  • branches/2013/dev_LOCEAN_2013/NEMOGCM/CONFIG/ORCA2_OFF_PISCES/EXP00/namelist_top_cfg

    r4148 r4152  
    22!! NEMO/TOP1 : ORCA2_OFF_PISCES configuration namelist used to overwrite SHARED/namelist_top 
    33!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    4 !''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 
     4!----------------------------------------------------------------------- 
     5&namtrc_run     !   run information 
     6!----------------------------------------------------------------------- 
     7   ln_top_euler  = .true.    !  use Euler time-stepping for TOP 
     8/ 
     9!----------------------------------------------------------------------- 
    510&namtrc     !   tracers definition 
    6 !,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,        
     11!----------------------------------------------------------------------- 
    712   ln_top_euler  = .true.   !  use Euler time-stepping for TOP 
    813   nn_writetrc   =  1460     !  time step frequency for sn_tracer outputs 
  • branches/2013/dev_LOCEAN_2013/NEMOGCM/CONFIG/ORCA2_SAS_LIM/EXP00/namelist_cfg

    r4147 r4152  
    5050/ 
    5151!----------------------------------------------------------------------- 
     52&namcrs        !   Grid coarsening for dynamics output and/or 
     53               !   passive tracer coarsened online simulations 
     54!----------------------------------------------------------------------- 
     55/ 
     56!----------------------------------------------------------------------- 
    5257&namctl        !   Control prints & Benchmark 
    5358!----------------------------------------------------------------------- 
  • branches/2013/dev_LOCEAN_2013/NEMOGCM/CONFIG/SHARED/field_def.xml

    r4148 r4152  
    2929         <field id="mldr10_1"     long_name="Mixed Layer Depth 0.01 ref.10m"            unit="m"                        /> 
    3030         <field id="rhop"         long_name="potential density (sigma0)"                unit="kg/m3" grid_ref="grid_T_3D"/> 
     31    <field id="eken"         long_name="kinetic energy"                            unit="m2/s2" grid_ref="grid_T_3D"/> 
     32    <field id="hdiv"         long_name="horizontal divergence"                     unit="s-1"   grid_ref="grid_T_3D"/> 
    3133         <!-- next variables available with key_diahth --> 
    3234         <field id="mlddzt"       long_name="Thermocline Depth (max dT/dz)"             unit="m"                        /> 
     
    140142         <field id="uoce"         long_name="ocean current along i-axis"                  unit="m/s"  grid_ref="grid_U_3D" /> 
    141143         <field id="uocetr_eff"   long_name="Effective ocean transport along i-axis"      unit="m3/s" grid_ref="grid_U_3D" /> 
     144         <field id="uocet"        long_name="ocean transport along i-axis times temperature" unit="degC.m/s" grid_ref="grid_U_3D" /> 
     145         <field id="uoces"        long_name="ocean transport along i-axis times salinity"    unit="psu.m/s"  grid_ref="grid_U_3D" /> 
    142146         <!-- uoce_eiv: available with key_traldf_eiv and key_diaeiv --> 
    143147         <field id="uoce_eiv"     long_name="EIV ocean current along i-axis"              unit="m/s"  grid_ref="grid_U_3D" /> 
     
    159163         <field id="voce"         long_name="ocean current along j-axis"                  unit="m/s"  grid_ref="grid_V_3D" /> 
    160164         <field id="vocetr_eff"   long_name="Effective ocean transport along j-axis"      unit="m3/s" grid_ref="grid_V_3D" /> 
     165         <field id="vocet"        long_name="ocean transport along j-axis times temperature" unit="degC.m/s" grid_ref="grid_V_3D" /> 
     166         <field id="voces"        long_name="ocean transport along j-axis times salinity"    unit="psu.m/s"  grid_ref="grid_V_3D" /> 
    161167         <!-- voce_eiv: available with key_traldf_eiv and key_diaeiv --> 
    162168         <field id="voce_eiv"     long_name="EIV ocean current along j-axis"              unit="m/s"  grid_ref="grid_V_3D" /> 
  • branches/2013/dev_LOCEAN_2013/NEMOGCM/CONFIG/SHARED/namelist_ref

    r4147 r4152  
    126126   rn_rdtmax   = 28800.          !  maximum time step on tracers (used if nn_acc=1) 
    127127   rn_rdth     =  800.           !  depth variation of tracer time step  (used if nn_acc=1) 
     128   ln_crs      = .false.      !  Logical switch for coarsening module 
    128129   jphgr_msh   =       0               !  type of horizontal mesh 
    129130                                       !  = 0 curvilinear coordinate on the sphere read in coordinate.nc 
     
    149150   ppkth2      =       48.029893720000 ! 
    150151   ppacr2      =       13.000000000000 ! 
     152/ 
     153!----------------------------------------------------------------------- 
     154&namcrs        !   Grid coarsening for dynamics output and/or 
     155               !   passive tracer coarsened online simulations 
     156!----------------------------------------------------------------------- 
     157   nn_factx    = 3         !  Reduction factor of x-direction 
     158   nn_facty    = 3         !  Reduction factor of y-direction 
     159   nn_binref   = 0         !  Bin centering preference: NORTH or EQUAT 
     160                           !  0, coarse grid is binned with preferential treatment of the north fold 
     161                           !  1, coarse grid is binned with centering at the equator 
     162                           !    Symmetry with nn_facty being odd-numbered. Asymmetry with even-numbered nn_facty. 
     163   nn_msh_crs  = 1         !  create (=1) a mesh file or not (=0) 
     164   nn_crs_kz   = 0         ! 0, MEAN of volume boxes 
     165                           ! 1, MAX of boxes 
     166                           ! 2, MIN of boxes 
     167   ln_crs_wn   = .true.    ! wn coarsened (T) or computed using horizontal divergence ( F ) 
    151168/ 
    152169!----------------------------------------------------------------------- 
  • branches/2013/dev_LOCEAN_2013/NEMOGCM/CONFIG/SHARED/namelist_top_ref

    r4148 r4152  
    11!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    2 !! NEMO/TOP1 :  1 - tracer definition                     (namtrc    ) 
    3 !!              2 - tracer data initialisation            (namtrc_dta) 
    4 !!              3 - tracer advection                      (namtrc_adv) 
    5 !!              4 - tracer lateral diffusion              (namtrc_ldf) 
    6 !!              5 - tracer vertical physics               (namtrc_zdf) 
    7 !!              6 - tracer newtonian damping              (namtrc_dmp) 
    8 !!              7 - dynamical tracer trends               (namtrc_trd) 
    9 !!              8 - tracer output diagonstics             (namtrc_dia) 
     2!! NEMO/TOP1 :   - tracer run information                (namtrc_run) 
     3!!               - tracer definition                     (namtrc    ) 
     4!!               - tracer data initialisation            (namtrc_dta) 
     5!!               - tracer advection                      (namtrc_adv) 
     6!!               - tracer lateral diffusion              (namtrc_ldf) 
     7!!               - tracer vertical physics               (namtrc_zdf) 
     8!!               - tracer newtonian damping              (namtrc_dmp) 
     9!!               - dynamical tracer trends               (namtrc_trd) 
     10!!               - tracer output diagonstics             (namtrc_dia) 
    1011!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    11 !''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 
    12 &namtrc     !   tracers definition 
    13 !,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, 
    14    nn_dttrc      =  1        !  time step frequency for passive sn_tracers       
     12!----------------------------------------------------------------------- 
     13&namtrc_run     !   run information 
     14!----------------------------------------------------------------------- 
     15   nn_dttrc      =  1        !  time step frequency for passive sn_tracers 
    1516   nn_writetrc   =  5475     !  time step frequency for sn_tracer outputs 
    16    ln_top_euler  = .false.   !  use Euler time-stepping for TOP 
     17   ln_top_euler  = .false.    !  use Euler time-stepping for TOP 
    1718   ln_rsttr      = .false.   !  start from a restart file (T) or not (F) 
    1819   nn_rsttr      =   0       !  restart control = 0 initial time step is not compared to the restart file value 
    19                              !                  = 1 do not use the value in the restart file 
    20                              !                  = 2 calendar parameters read in the restart file 
     20                           !                  = 1 do not use the value in the restart file 
     21                           !                  = 2 calendar parameters read in the restart file 
    2122   cn_trcrst_in  = "restart_trc"   !  suffix of pass. sn_tracer restart name (input) 
    2223   cn_trcrst_out = "restart_trc"   !  suffix of pass. sn_tracer restart name (output) 
     24/ 
     25!----------------------------------------------------------------------- 
     26&namtrc     !   tracers definition 
     27!----------------------------------------------------------------------- 
    2328   ln_trcdta     =   .true.  !  Initialisation from data input file (T) or not (F) 
    2429   ln_trcdmp     =  .false.  !  add a damping termn (T) or not (F) 
  • branches/2013/dev_LOCEAN_2013/NEMOGCM/CONFIG/cfg.txt

    r4148 r4152  
    44AMM12 OPA_SRC 
    55ORCA2_SAS_LIM OPA_SRC SAS_SRC LIM_SRC_2 NST_SRC 
     6ORCA2_LIM_CFC_C14b OPA_SRC LIM_SRC_2 NST_SRC TOP_SRC 
    67ORCA2_OFF_PISCES OPA_SRC OFF_SRC TOP_SRC 
    78ORCA2_LIM_PISCES OPA_SRC LIM_SRC_2 NST_SRC TOP_SRC 
    89GYRE_PISCES OPA_SRC TOP_SRC 
    9 ORCA2_LIM_CFC_C14b OPA_SRC LIM_SRC_2 NST_SRC TOP_SRC 
  • branches/2013/dev_LOCEAN_2013/NEMOGCM/NEMO/OFF_SRC/nemogcm.F90

    r4147 r4152  
    4747   USE lib_fortran     ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined) 
    4848 
     49   USE trc 
     50   USE trcnam 
     51   USE trcrst 
     52 
    4953   IMPLICIT NONE 
    5054   PRIVATE 
     
    8993      istp = nit000 
    9094      !  
    91       CALL iom_init            ! iom_put initialization (must be done after nemo_init for AGRIF+XIOS+OASIS) 
     95      CALL iom_init( "nemo" )            ! iom_put initialization (must be done after nemo_init for AGRIF+XIOS+OASIS) 
    9296      !  
    9397      DO WHILE ( istp <= nitend .AND. nstop == 0 )    ! time stepping 
    9498         ! 
    9599         IF( istp /= nit000 )   CALL day      ( istp )         ! Calendar (day was already called at nit000 in day_init) 
    96                                 CALL iom_setkt( istp - nit000 + 1 )         ! say to iom that we are at time step kstp 
     100                                CALL iom_setkt( istp - nit000 + 1, "nemo" )   ! say to iom that we are at time step kstp 
    97101                                CALL dta_dyn  ( istp )         ! Interpolation of the dynamical fields 
    98102                                CALL trc_stp  ( istp )         ! time-stepping 
     
    270274      IF( lk_trabbl     )   CALL tra_bbl_init   ! advective (and/or diffusive) bottom boundary layer scheme 
    271275 
     276                            CALL trc_nam_run  ! Needed to get restart parameters for passive tracers 
     277      IF( ln_rsttr ) THEN 
     278        neuler = 1   ! Set time-step indicator at nit000 (leap-frog) 
     279        CALL trc_rst_cal( nit000, 'READ' )   ! calendar 
     280      ELSE 
     281        neuler = 0                  ! Set time-step indicator at nit000 (euler) 
     282        CALL day_init               ! set calendar 
     283      ENDIF 
     284      !                                     ! Dynamics 
     285                            CALL dta_dyn_init   ! Initialization for the dynamics 
     286 
    272287      !                                     ! Passive tracers 
    273288                            CALL     trc_init   ! Passive tracers initialization 
    274       !                                     ! Dynamics 
    275                             CALL dta_dyn_init   ! Initialization for the dynamics 
    276289 
    277290      IF(lwp) WRITE(numout,cform_aaa)       ! Flag AAAAAAA 
     
    432445      ierr = ierr + zdf_oce_alloc   ()          ! ocean vertical physics 
    433446      ! 
    434       ierr = ierr + lib_mpp_alloc   (numout)    ! mpp exchanges 
    435447      ierr = ierr + trc_oce_alloc   ()          ! shared TRC / TRA arrays 
    436448      ! 
  • branches/2013/dev_LOCEAN_2013/NEMOGCM/NEMO/OPA_SRC/DIA/diahsb.F90

    r4147 r4152  
    2121   USE bdy_par         ! (for lk_bdy) 
    2222   USE timing          ! preformance summary 
     23   USE lib_fortran 
     24   USE sbcrnf 
    2325 
    2426   IMPLICIT NONE 
     
    3335   REAL(dp)                                ::   surf_tot   , vol_tot             ! 
    3436   REAL(dp)                                ::   frc_t      , frc_s     , frc_v   ! global forcing trends 
     37   REAL(dp)                                ::   frc_wn_t      , frc_wn_s ! global forcing trends 
    3538   REAL(dp)                                ::   fact1                            ! conversion factors 
    3639   REAL(dp)                                ::   fact21    , fact22               !     -         - 
     
    3841   REAL(dp), DIMENSION(:,:)  , ALLOCATABLE ::   surf      , ssh_ini              ! 
    3942   REAL(dp), DIMENSION(:,:,:), ALLOCATABLE ::   hc_loc_ini, sc_loc_ini, e3t_ini  ! 
     43   REAL(dp), DIMENSION(:,:)  , ALLOCATABLE ::   ssh_hc_loc_ini, ssh_sc_loc_ini 
    4044 
    4145   !! * Substitutions 
     
    6771      INTEGER    ::   jk                          ! dummy loop indice 
    6872      REAL(dp)   ::   zdiff_hc    , zdiff_sc      ! heat and salt content variations 
     73      REAL(dp)   ::   zdiff_hc1   , zdiff_sc1     ! heat and salt content variations of ssh 
    6974      REAL(dp)   ::   zdiff_v1    , zdiff_v2      ! volume variation 
    70       REAL(dp)   ::   z1_rau0                     ! local scalars 
     75      REAL(dp)   ::   zerr_hc1    , zerr_sc1      ! Non conservation due to free surface 
    7176      REAL(dp)   ::   zdeltat                     !    -     - 
    7277      REAL(dp)   ::   z_frc_trd_t , z_frc_trd_s   !    -     - 
    7378      REAL(dp)   ::   z_frc_trd_v                 !    -     - 
     79      REAL(dp)   ::   z_wn_trd_t , z_wn_trd_s   !    -     - 
     80      REAL(dp)   ::   z_ssh_hc , z_ssh_sc   !    -     - 
    7481      !!--------------------------------------------------------------------------- 
    7582      IF( nn_timing == 1 )   CALL timing_start('dia_hsb') 
     
    7885      ! 1 - Trends due to forcing ! 
    7986      ! ------------------------- ! 
    80       z1_rau0 = 1.e0 / rau0 
    81       z_frc_trd_v = z1_rau0 * SUM( - ( emp(:,:) - rnf(:,:) ) * surf(:,:) )     ! volume fluxes 
    82       z_frc_trd_t =           SUM( sbc_tsc(:,:,jp_tem) * surf(:,:) )     ! heat fluxes 
    83       z_frc_trd_s =           SUM( sbc_tsc(:,:,jp_sal) * surf(:,:) )     ! salt fluxes 
     87      z_frc_trd_v = r1_rau0 * glob_sum( - ( emp(:,:) - rnf(:,:) ) * surf(:,:) )     ! volume fluxes 
     88      z_frc_trd_t =           glob_sum( sbc_tsc(:,:,jp_tem) * surf(:,:) )     ! heat fluxes 
     89      z_frc_trd_s =           glob_sum( sbc_tsc(:,:,jp_sal) * surf(:,:) )     ! salt fluxes 
     90      ! Add runoff heat & salt input 
     91      IF( ln_rnf    )   z_frc_trd_t = z_frc_trd_t + glob_sum( rnf_tsc(:,:,jp_tem) * surf(:,:) ) 
     92      IF( ln_rnf_sal)   z_frc_trd_s = z_frc_trd_s + glob_sum( rnf_tsc(:,:,jp_sal) * surf(:,:) ) 
    8493      ! Add penetrative solar radiation 
    85       IF( ln_traqsr )   z_frc_trd_t = z_frc_trd_t + r1_rau0_rcp * SUM( qsr     (:,:) * surf(:,:) ) 
     94      IF( ln_traqsr )   z_frc_trd_t = z_frc_trd_t + r1_rau0_rcp * glob_sum( qsr     (:,:) * surf(:,:) ) 
    8695      ! Add geothermal heat flux 
    87       IF( ln_trabbc )   z_frc_trd_t = z_frc_trd_t + r1_rau0_rcp * SUM( qgh_trd0(:,:) * surf(:,:) ) 
    88       IF( lk_mpp ) THEN 
    89          CALL mpp_sum( z_frc_trd_v ) 
    90          CALL mpp_sum( z_frc_trd_t ) 
    91       ENDIF 
     96      IF( ln_trabbc )   z_frc_trd_t = z_frc_trd_t +  glob_sum( qgh_trd0(:,:) * surf(:,:) ) 
     97      IF( .NOT. lk_vvl ) THEN 
     98         z_wn_trd_t = - glob_sum( surf(:,:) * wn(:,:,1) * tsb(:,:,1,jp_tem) ) 
     99         z_wn_trd_s = - glob_sum( surf(:,:) * wn(:,:,1) * tsb(:,:,1,jp_sal) ) 
     100      ENDIF 
     101 
    92102      frc_v = frc_v + z_frc_trd_v * rdt 
    93103      frc_t = frc_t + z_frc_trd_t * rdt 
    94104      frc_s = frc_s + z_frc_trd_s * rdt 
     105      !                                          ! Advection flux through fixed surface (z=0) 
     106      IF( .NOT. lk_vvl ) THEN 
     107         frc_wn_t = frc_wn_t + z_wn_trd_t * rdt 
     108         frc_wn_s = frc_wn_s + z_wn_trd_s * rdt 
     109      ENDIF 
    95110 
    96111      ! ----------------------- ! 
     
    100115      zdiff_hc = 0.d0 
    101116      zdiff_sc = 0.d0 
     117 
    102118      ! volume variation (calculated with ssh) 
    103       zdiff_v1 = SUM( surf(:,:) * tmask(:,:,1) * ( sshn(:,:) - ssh_ini(:,:) ) ) 
     119      zdiff_v1 = glob_sum( surf(:,:) * ( sshn(:,:) - ssh_ini(:,:) ) ) 
     120 
     121      ! heat & salt content variation (associated with ssh) 
     122      IF( .NOT. lk_vvl ) THEN 
     123         z_ssh_hc = glob_sum( surf(:,:) * ( tsn(:,:,1,jp_tem) * sshn(:,:) - ssh_hc_loc_ini(:,:) ) ) 
     124         z_ssh_sc = glob_sum( surf(:,:) * ( tsn(:,:,1,jp_sal) * sshn(:,:) - ssh_sc_loc_ini(:,:) ) ) 
     125      ENDIF 
     126 
    104127      DO jk = 1, jpkm1 
    105          ! volume variation (calculated with scale factors) 
    106          zdiff_v2 = zdiff_v2 + SUM( surf(:,:) * tmask(:,:,jk)   & 
     128        ! volume variation (calculated with scale factors) 
     129         zdiff_v2 = zdiff_v2 + glob_sum( surf(:,:) * tmask(:,:,jk)   & 
    107130            &                       * ( fse3t_n(:,:,jk)         & 
    108131            &                           - e3t_ini(:,:,jk) ) ) 
    109132         ! heat content variation 
    110          zdiff_hc = zdiff_hc + SUM( surf(:,:) * tmask(:,:,jk)          & 
     133         zdiff_hc = zdiff_hc + glob_sum( surf(:,:) * tmask(:,:,jk)          & 
    111134            &                       * ( fse3t_n(:,:,jk) * tsn(:,:,jk,jp_tem)   & 
    112135            &                           - hc_loc_ini(:,:,jk) ) ) 
    113136         ! salt content variation 
    114          zdiff_sc = zdiff_sc + SUM( surf(:,:) * tmask(:,:,jk)          & 
     137         zdiff_sc = zdiff_sc + glob_sum( surf(:,:) * tmask(:,:,jk)          & 
    115138            &                       * ( fse3t_n(:,:,jk) * tsn(:,:,jk,jp_sal)   & 
    116139            &                           - sc_loc_ini(:,:,jk) ) ) 
    117140      ENDDO 
    118141 
    119       IF( lk_mpp ) THEN 
    120          CALL mpp_sum( zdiff_hc ) 
    121          CALL mpp_sum( zdiff_sc ) 
    122          CALL mpp_sum( zdiff_v1 ) 
    123          CALL mpp_sum( zdiff_v2 ) 
    124       ENDIF 
    125  
    126142      ! Substract forcing from heat content, salt content and volume variations 
    127143      zdiff_v1 = zdiff_v1 - frc_v 
    128       zdiff_v2 = zdiff_v2 - frc_v 
     144      IF( lk_vvl )   zdiff_v2 = zdiff_v2 - frc_v 
    129145      zdiff_hc = zdiff_hc - frc_t 
    130146      zdiff_sc = zdiff_sc - frc_s 
     147      IF( .NOT. lk_vvl ) THEN 
     148         zdiff_hc1 = zdiff_hc + z_ssh_hc  
     149         zdiff_sc1 = zdiff_sc + z_ssh_sc 
     150         zerr_hc1  = z_ssh_hc - frc_wn_t 
     151         zerr_sc1  = z_ssh_sc - frc_wn_s 
     152      ENDIF 
    131153       
    132154      ! ----------------------- ! 
     
    134156      ! ----------------------- ! 
    135157      zdeltat  = 1.e0 / ( ( kt - nit000 + 1 ) * rdt ) 
    136       WRITE(numhsb , 9020) kt , zdiff_hc / vol_tot , zdiff_hc * fact1  * zdeltat,                                & 
    137          &                      zdiff_sc / vol_tot , zdiff_sc * fact21 * zdeltat, zdiff_sc * fact22 * zdeltat,   & 
    138          &                      zdiff_v1           , zdiff_v1 * fact31 * zdeltat, zdiff_v1 * fact32 * zdeltat,   & 
    139          &                      zdiff_v2           , zdiff_v2 * fact31 * zdeltat, zdiff_v2 * fact32 * zdeltat 
     158      IF( lk_vvl ) THEN 
     159         WRITE(numhsb , 9020) kt , zdiff_hc / vol_tot , zdiff_hc * fact1  * zdeltat,                                & 
     160            &                      zdiff_sc / vol_tot , zdiff_sc * fact21 * zdeltat, zdiff_sc * fact22 * zdeltat,   & 
     161            &                      zdiff_v1           , zdiff_v1 * fact31 * zdeltat, zdiff_v1 * fact32 * zdeltat,   & 
     162            &                      zdiff_v2           , zdiff_v2 * fact31 * zdeltat, zdiff_v2 * fact32 * zdeltat 
     163      ELSE 
     164         WRITE(numhsb , 9030) kt , zdiff_hc1 / vol_tot , zdiff_hc1 * fact1  * zdeltat,                                & 
     165            &                      zdiff_sc1 / vol_tot , zdiff_sc1 * fact21 * zdeltat, zdiff_sc1 * fact22 * zdeltat,   & 
     166            &                      zdiff_v1            , zdiff_v1  * fact31 * zdeltat, zdiff_v1  * fact32 * zdeltat,   & 
     167            &                      zerr_hc1 / vol_tot  , zerr_sc1 / vol_tot 
     168      ENDIF 
    140169 
    141170      IF ( kt == nitend ) CLOSE( numhsb ) 
     
    144173 
    1451749020  FORMAT(I5,11D15.7) 
     1759030  FORMAT(I5,10D15.7) 
    146176      ! 
    147177   END SUBROUTINE dia_hsb 
     
    186216 
    187217      IF( .NOT. ln_diahsb )   RETURN 
     218      IF( .NOT. lk_mpp_rep ) & 
     219        CALL ctl_stop (' Your global mpp_sum if performed in single precision - 64 bits -', & 
     220             &         ' whereas the global sum to be precise must be done in double precision ',& 
     221             &         ' please add key_mpp_rep') 
    188222 
    189223      ! ------------------- ! 
    190224      ! 1 - Allocate memory ! 
    191225      ! ------------------- ! 
    192       ALLOCATE( hc_loc_ini(jpi,jpj,jpk), STAT=ierror ) 
     226      ALLOCATE( hc_loc_ini(jpi,jpj,jpk), sc_loc_ini(jpi,jpj,jpk), & 
     227         &      ssh_hc_loc_ini(jpi,jpj), ssh_sc_loc_ini(jpi,jpj), & 
     228         &      e3t_ini(jpi,jpj,jpk)                            , & 
     229         &      surf(jpi,jpj),  ssh_ini(jpi,jpj), STAT=ierror ) 
    193230      IF( ierror > 0 ) THEN 
    194231         CALL ctl_stop( 'dia_hsb: unable to allocate hc_loc_ini' )   ;   RETURN 
    195       ENDIF 
    196       ALLOCATE( sc_loc_ini(jpi,jpj,jpk), STAT=ierror ) 
    197       IF( ierror > 0 ) THEN 
    198          CALL ctl_stop( 'dia_hsb: unable to allocate sc_loc_ini' )   ;   RETURN 
    199       ENDIF 
    200       ALLOCATE( e3t_ini(jpi,jpj,jpk)   , STAT=ierror ) 
    201       IF( ierror > 0 ) THEN 
    202          CALL ctl_stop( 'dia_hsb: unable to allocate e3t_ini' )      ;   RETURN 
    203       ENDIF 
    204       ALLOCATE( surf(jpi,jpj)          , STAT=ierror ) 
    205       IF( ierror > 0 ) THEN 
    206          CALL ctl_stop( 'dia_hsb: unable to allocate surf' )         ;   RETURN 
    207       ENDIF 
    208       ALLOCATE( ssh_ini(jpi,jpj)       , STAT=ierror ) 
    209       IF( ierror > 0 ) THEN 
    210          CALL ctl_stop( 'dia_hsb: unable to allocate ssh_ini' )      ;   RETURN 
    211232      ENDIF 
    212233 
     
    221242      cl_name    = 'heat_salt_volume_budgets.txt'                         ! name of output file 
    222243      surf(:,:) = e1t(:,:) * e2t(:,:) * tmask(:,:,1) * tmask_i(:,:)      ! masked surface grid cell area 
    223       surf_tot  = SUM( surf(:,:) )                                       ! total ocean surface area 
     244      surf_tot  = glob_sum( surf(:,:) )                                       ! total ocean surface area 
    224245      vol_tot   = 0.d0                                                   ! total ocean volume 
    225246      DO jk = 1, jpkm1 
    226          vol_tot  = vol_tot + SUM( surf(:,:) * tmask(:,:,jk)     & 
    227             &                      * fse3t_n(:,:,jk)         ) 
     247         vol_tot  = vol_tot + glob_sum( surf(:,:) * tmask(:,:,jk)     & 
     248            &                         * fse3t_n(:,:,jk)         ) 
    228249      END DO 
    229       IF( lk_mpp ) THEN  
    230          CALL mpp_sum( vol_tot ) 
    231          CALL mpp_sum( surf_tot ) 
    232       ENDIF 
    233250 
    234251      CALL ctl_opn( numhsb , cl_name , 'UNKNOWN' , 'FORMATTED' , 'SEQUENTIAL' , 1 , numout , lwp , 1 ) 
    235       !                   12345678901234567890123456789012345678901234567890123456789012345678901234567890 -> 80 
    236       WRITE( numhsb, 9010 ) "kt   |     heat content budget     |            salt content budget             ",   & 
    237          !                                                   123456789012345678901234567890123456789012345 -> 45 
    238          &                                                  "|            volume budget (ssh)             ",   & 
    239          !                                                   678901234567890123456789012345678901234567890 -> 45 
    240          &                                                  "|            volume budget (e3t)             " 
    241       WRITE( numhsb, 9010 ) "     |      [C]         [W/m2]     |     [psu]        [mmm/s]          [SV]     ",   & 
    242          &                                                  "|     [m3]         [mmm/s]          [SV]     ",   & 
    243          &                                                  "|     [m3]         [mmm/s]          [SV]     " 
    244  
     252      IF( lk_vvl ) THEN 
     253         !                   12345678901234567890123456789012345678901234567890123456789012345678901234567890 -> 80 
     254         WRITE( numhsb, 9010 ) "kt   |     heat content budget     |            salt content budget             ",   & 
     255            !                                                   123456789012345678901234567890123456789012345 -> 45 
     256            &                                                  "|            volume budget (ssh)             ",   & 
     257            !                                                   678901234567890123456789012345678901234567890 -> 45 
     258            &                                                  "|            volume budget (e3t)             " 
     259         WRITE( numhsb, 9010 ) "     |      [C]         [W/m2]     |     [psu]        [mmm/s]          [SV]     ",   & 
     260            &                                                  "|     [m3]         [mmm/s]          [SV]     ",   & 
     261            &                                                  "|     [m3]         [mmm/s]          [SV]     " 
     262      ELSE 
     263         !                   12345678901234567890123456789012345678901234567890123456789012345678901234567890 -> 80 
     264         WRITE( numhsb, 9011 ) "kt   |     heat content budget     |            salt content budget             ",   & 
     265            !                                                   123456789012345678901234567890123456789012345 -> 45 
     266            &                                                  "|            volume budget (ssh)             ",   & 
     267            !                                                   678901234567890123456789012345678901234567890 -> 45 
     268            &                                                  "|  Non conservation due to free surface      " 
     269         WRITE( numhsb, 9011 ) "     |      [C]         [W/m2]     |     [psu]        [mmm/s]          [SV]     ",   & 
     270            &                                                  "|     [m3]         [mmm/s]          [SV]     ",   & 
     271            &                                                  "|  [heat - C]     [salt - psu]                " 
     272      ENDIF 
    245273      ! --------------- ! 
    246274      ! 3 - Conversions ! (factors will be multiplied by duration afterwards) 
     
    268296      frc_t = 0.d0                                           ! heat content   -    -   -    -    
    269297      frc_s = 0.d0                                           ! salt content   -    -   -    -          
     298      IF( .NOT. lk_vvl ) THEN 
     299         ssh_hc_loc_ini(:,:) = tsn(:,:,1,jp_tem) * ssh_ini(:,:)   ! initial heat content associated with ssh 
     300         ssh_sc_loc_ini(:,:) = tsn(:,:,1,jp_sal) * ssh_ini(:,:)   ! initial salt content associated with ssh 
     301         frc_wn_t = 0.d0 
     302         frc_wn_s = 0.d0 
     303      ENDIF 
    270304      ! 
    2713059010  FORMAT(A80,A45,A45) 
     3069011  FORMAT(A80,A45,A45) 
    272307      ! 
    273308   END SUBROUTINE dia_hsb_init 
  • branches/2013/dev_LOCEAN_2013/NEMOGCM/NEMO/OPA_SRC/DOM/domain.F90

    r4147 r4152  
    1212   !!            2.0  !  2005-11  (V. Garnier) Surface pressure gradient organization 
    1313   !!            3.3  !  2010-11  (G. Madec)  initialisation in C1D configuration 
     14   !!            3.6  !  2013     ( J. Simeon, C. Calone, G. Madec, C. Ethe ) Online coarsening of outputs 
    1415   !!---------------------------------------------------------------------- 
    1516    
     
    126127      NAMELIST/namdom/ nn_bathy , rn_e3zps_min, rn_e3zps_rat, nn_msh    , rn_hmin,   & 
    127128         &             nn_acc   , rn_atfp     , rn_rdt      , rn_rdtmin ,            & 
    128          &             rn_rdtmax, rn_rdth     , nn_baro     , nn_closea , & 
     129         &             rn_rdtmax, rn_rdth     , nn_baro     , nn_closea , ln_crs,    & 
    129130         &             jphgr_msh, & 
    130131         &             ppglam0, ppgphi0, ppe1_deg, ppe2_deg, ppe1_m, ppe2_m, & 
     
    216217      READ  ( numnam_ref, namdom, IOSTAT = ios, ERR = 903) 
    217218903   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namdom in reference namelist', lwp ) 
    218  
     219   
     220      ! 
    219221      REWIND( numnam_cfg )              ! Namelist namdom in configuration namelist : space & time domain (bathymetry, mesh, timestep) 
    220222      READ  ( numnam_cfg, namdom, IOSTAT = ios, ERR = 904 ) 
     
    235237         WRITE(numout,*) '           = 2   mesh and mask             ' 
    236238         WRITE(numout,*) '           = 3   mesh_hgr, msh_zgr and mask' 
    237          WRITE(numout,*) '      ocean time step                      rn_rdt    = ', rn_rdt 
    238          WRITE(numout,*) '      asselin time filter parameter        rn_atfp   = ', rn_atfp 
    239          WRITE(numout,*) '      time-splitting: nb of sub time-step  nn_baro   = ', nn_baro 
    240          WRITE(numout,*) '      acceleration of converge             nn_acc    = ', nn_acc 
    241          WRITE(numout,*) '        nn_acc=1: surface tracer rdt       rn_rdtmin = ', rn_rdtmin 
    242          WRITE(numout,*) '                  bottom  tracer rdt       rdtmax    = ', rn_rdtmax 
    243          WRITE(numout,*) '                  depth of transition      rn_rdth   = ', rn_rdth 
    244          WRITE(numout,*) '      suppression of closed seas (=0)      nn_closea = ', nn_closea 
     239         WRITE(numout,*) '      ocean time step                       rn_rdt    = ', rn_rdt 
     240         WRITE(numout,*) '      asselin time filter parameter         rn_atfp   = ', rn_atfp 
     241         WRITE(numout,*) '      time-splitting: nb of sub time-step   nn_baro   = ', nn_baro 
     242         WRITE(numout,*) '      acceleration of converge              nn_acc    = ', nn_acc 
     243         WRITE(numout,*) '        nn_acc=1: surface tracer rdt        rn_rdtmin = ', rn_rdtmin 
     244         WRITE(numout,*) '                  bottom  tracer rdt        rdtmax    = ', rn_rdtmax 
     245         WRITE(numout,*) '                  depth of transition       rn_rdth   = ', rn_rdth 
     246         WRITE(numout,*) '      suppression of closed seas (=0)       nn_closea = ', nn_closea 
     247         WRITE(numout,*) '      online coarsening of dynamical fields ln_crs    = ', ln_crs 
    245248         WRITE(numout,*) '      type of horizontal mesh jphgr_msh           = ', jphgr_msh 
    246249         WRITE(numout,*) '      longitude of first raw and column T-point ppglam0 = ', ppglam0 
  • branches/2013/dev_LOCEAN_2013/NEMOGCM/NEMO/OPA_SRC/IOM/iom.F90

    r4148 r4152  
    3737# endif 
    3838   USE ioipsl, ONLY :  ju2ymds    ! for calendar 
     39   USE crs             ! Grid coarsening 
    3940 
    4041   IMPLICIT NONE 
     
    4748#endif 
    4849   PUBLIC iom_init, iom_swap, iom_open, iom_close, iom_setkt, iom_varid, iom_get, iom_gettime, iom_rstput, iom_put 
    49    PUBLIC iom_getatt 
     50   PUBLIC iom_getatt, iom_context_finalize 
    5051 
    5152   PRIVATE iom_rp0d, iom_rp1d, iom_rp2d, iom_rp3d 
     
    6970     MODULE PROCEDURE iom_p0d, iom_p1d, iom_p2d, iom_p3d 
    7071  END INTERFACE 
    71 #if defined key_iomput 
    72    INTERFACE iom_setkt 
    73       MODULE PROCEDURE xios_update_calendar 
    74    END INTERFACE 
    75 # endif 
    7672 
    7773   !!---------------------------------------------------------------------- 
     
    8379CONTAINS 
    8480 
    85    SUBROUTINE iom_init 
     81   SUBROUTINE iom_init( cdname )  
    8682      !!---------------------------------------------------------------------- 
    8783      !!                     ***  ROUTINE   *** 
     
    9086      !! 
    9187      !!---------------------------------------------------------------------- 
     88      CHARACTER(len=*), INTENT(in)  :: cdname 
    9289#if defined key_iomput 
    9390      TYPE(xios_time)   :: dtime    = xios_time(0, 0, 0, 0, 0, 0) 
     
    9794      !!---------------------------------------------------------------------- 
    9895 
    99       clname = "nemo" 
    100       IF( TRIM(Agrif_CFixed()) /= '0' )   clname = TRIM(Agrif_CFixed())//"_"//TRIM(clname) 
     96      clname = cdname 
     97      IF( TRIM(Agrif_CFixed()) /= '0' )   clname = TRIM(Agrif_CFixed())//"_"//TRIM(cdname) 
    10198      CALL xios_context_initialize(TRIM(clname), mpi_comm_opa) 
    102       CALL iom_swap 
     99      CALL iom_swap( cdname ) 
    103100 
    104101      ! calendar parameters 
     
    113110      ! horizontal grid definition 
    114111      CALL set_scalar 
    115       CALL set_grid( "T", glamt, gphit )  
    116       CALL set_grid( "U", glamu, gphiu ) 
    117       CALL set_grid( "V", glamv, gphiv ) 
    118       CALL set_grid( "W", glamt, gphit ) 
     112 
     113      IF( TRIM(cdname) == "nemo" ) THEN   
     114         CALL set_grid( "T", glamt, gphit )  
     115         CALL set_grid( "U", glamu, gphiu ) 
     116         CALL set_grid( "V", glamv, gphiv ) 
     117         CALL set_grid( "W", glamt, gphit ) 
     118      ENDIF 
     119 
     120      IF( TRIM(cdname) == "nemo_crs" ) THEN   
     121         CALL dom_grid_crs   ! Save the parent grid information  & Switch to coarse grid domain 
     122         ! 
     123         CALL set_grid( "T", glamt_crs, gphit_crs )  
     124         CALL set_grid( "U", glamu_crs, gphiu_crs )  
     125         CALL set_grid( "V", glamv_crs, gphiv_crs )  
     126         CALL set_grid( "W", glamt_crs, gphit_crs )  
     127          ! 
     128         CALL dom_grid_glo   ! Return to parent grid domain 
     129      ENDIF 
     130 
    119131 
    120132      ! vertical grid definition 
     
    141153 
    142154 
    143    SUBROUTINE iom_swap 
     155   SUBROUTINE iom_swap( cdname ) 
    144156      !!--------------------------------------------------------------------- 
    145157      !!                   ***  SUBROUTINE  iom_swap  *** 
     
    147159      !! ** Purpose :  swap context between different agrif grid for xmlio_server 
    148160      !!--------------------------------------------------------------------- 
     161      CHARACTER(len=*), INTENT(in) :: cdname 
    149162#if defined key_iomput 
    150163      TYPE(xios_context) :: nemo_hdl 
    151164 
    152      IF( TRIM(Agrif_CFixed()) == '0' ) THEN 
    153         CALL xios_get_handle("nemo",nemo_hdl) 
    154      ELSE 
    155         CALL xios_get_handle(TRIM(Agrif_CFixed())//"_nemo",nemo_hdl) 
    156      ENDIF 
    157      CALL xios_set_current_context(nemo_hdl) 
    158  
     165      IF( TRIM(Agrif_CFixed()) == '0' ) THEN 
     166        CALL xios_get_handle(TRIM(cdname),nemo_hdl) 
     167      ELSE 
     168        CALL xios_get_handle(TRIM(Agrif_CFixed())//"_"//TRIM(cdname),nemo_hdl) 
     169      ENDIF 
     170      ! 
     171      CALL xios_set_current_context(nemo_hdl) 
    159172#endif 
     173      ! 
    160174   END SUBROUTINE iom_swap 
    161175 
     
    11001114      CALL xios_solve_inheritance() 
    11011115   END SUBROUTINE iom_set_grid_attr 
     1116 
     1117   SUBROUTINE iom_setkt( kt, cdname ) 
     1118      INTEGER         , INTENT(in) ::   kt  
     1119      CHARACTER(LEN=*), INTENT(in) ::   cdname 
     1120      !      
     1121      CALL iom_swap( cdname )   ! swap to cdname context 
     1122      CALL xios_update_calendar(kt) 
     1123      IF( cdname /= "nemo" ) CALL iom_swap( "nemo" )   ! return back to nemo context 
     1124      ! 
     1125   END SUBROUTINE iom_setkt 
     1126 
     1127   SUBROUTINE iom_context_finalize( cdname ) 
     1128      CHARACTER(LEN=*), INTENT(in) :: cdname 
     1129      !      
     1130      CALL iom_swap( cdname )   ! swap to cdname context 
     1131      CALL xios_context_finalize() ! finalize the context 
     1132      IF( cdname /= "nemo" ) CALL iom_swap( "nemo" )   ! return back to nemo context 
     1133      ! 
     1134   END SUBROUTINE iom_context_finalize 
    11021135 
    11031136 
     
    14241457#else 
    14251458 
    1426    SUBROUTINE iom_setkt( kt ) 
    1427       INTEGER, INTENT(in   )::   kt  
    1428       IF( .FALSE. )   WRITE(numout,*) kt   ! useless test to avoid compilation warnings 
     1459 
     1460   SUBROUTINE iom_setkt( kt, cdname ) 
     1461      INTEGER         , INTENT(in)::   kt  
     1462      CHARACTER(LEN=*), INTENT(in) ::   cdname 
     1463      IF( .FALSE. )   WRITE(numout,*) kt, cdname   ! useless test to avoid compilation warnings 
    14291464   END SUBROUTINE iom_setkt 
     1465 
     1466   SUBROUTINE iom_context_finalize( cdname ) 
     1467      CHARACTER(LEN=*), INTENT(in) ::   cdname 
     1468      IF( .FALSE. )   WRITE(numout,*)  cdname   ! useless test to avoid compilation warnings 
     1469   END SUBROUTINE iom_context_finalize 
    14301470 
    14311471#endif 
  • branches/2013/dev_LOCEAN_2013/NEMOGCM/NEMO/OPA_SRC/LBC/lbclnk.F90

    r3768 r4152  
    264264            END SELECT 
    265265            !                                          ! North fold 
    266             pt3d( 1 ,jpj,:) = zland 
    267             pt3d(jpi,jpj,:) = zland 
    268266            CALL lbc_nfd( pt3d(:,:,:), cd_type, psgn ) 
    269267            ! 
     
    386384            END SELECT 
    387385            !                                          ! North fold 
    388             pt2d( 1 ,1  ) = zland  
    389             pt2d( 1 ,jpj) = zland  
    390             pt2d(jpi,jpj) = zland 
    391386            CALL lbc_nfd( pt2d(:,:), cd_type, psgn ) 
    392387            ! 
  • branches/2013/dev_LOCEAN_2013/NEMOGCM/NEMO/OPA_SRC/LBC/lbcnfd.F90

    r3294 r4152  
    7171                  pt3d(ji,ijpj,jk) = psgn * pt3d(ijt,ijpj-2,jk) 
    7272               END DO 
     73               pt3d(1,ijpj,jk) = psgn * pt3d(3,ijpj-2,jk) 
    7374               DO ji = jpiglo/2+1, jpiglo 
    7475                  ijt = jpiglo-ji+2 
     
    8081                  pt3d(ji,ijpj,jk) = psgn * pt3d(iju,ijpj-2,jk) 
    8182               END DO 
     83               pt3d(   1  ,ijpj,jk) = psgn * pt3d(    2   ,ijpj-2,jk) 
     84               pt3d(jpiglo,ijpj,jk) = psgn * pt3d(jpiglo-1,ijpj-2,jk)  
    8285               DO ji = jpiglo/2, jpiglo-1 
    8386                  iju = jpiglo-ji+1 
     
    9093                  pt3d(ji,ijpj  ,jk) = psgn * pt3d(ijt,ijpj-3,jk) 
    9194               END DO 
     95               pt3d(1,ijpj,jk) = psgn * pt3d(3,ijpj-3,jk)  
    9296            CASE ( 'F' )                               ! F-point 
    9397               DO ji = 1, jpiglo-1 
     
    96100                  pt3d(ji,ijpj  ,jk) = psgn * pt3d(iju,ijpj-3,jk) 
    97101               END DO 
     102               pt3d(   1  ,ijpj,jk) = psgn * pt3d(    2   ,ijpj-3,jk) 
     103               pt3d(jpiglo,ijpj,jk) = psgn * pt3d(jpiglo-1,ijpj-3,jk)  
    98104            END SELECT 
    99105            ! 
     
    111117                  pt3d(ji,ijpj,jk) = psgn * pt3d(iju,ijpj-1,jk) 
    112118               END DO 
     119               pt3d(jpiglo,ijpj,jk) = psgn * pt3d(1,ijpj-1,jk) 
    113120            CASE ( 'V' )                               ! V-point 
    114121               DO ji = 1, jpiglo 
     
    125132                  pt3d(ji,ijpj  ,jk) = psgn * pt3d(iju,ijpj-2,jk) 
    126133               END DO 
     134               pt3d(jpiglo,ijpj,jk) = psgn * pt3d(1,ijpj-2,jk) 
    127135               DO ji = jpiglo/2+1, jpiglo-1 
    128136                  iju = jpiglo-ji 
     
    199207               END DO 
    200208            END DO 
     209            pt2d(1,ijpj)   = psgn * pt2d(3,ijpj-2) 
    201210            DO ji = jpiglo/2+1, jpiglo 
    202211               ijt=jpiglo-ji+2 
     
    210219               END DO 
    211220            END DO 
     221            pt2d(   1  ,ijpj  ) = psgn * pt2d(    2   ,ijpj-2) 
     222            pt2d(jpiglo,ijpj  ) = psgn * pt2d(jpiglo-1,ijpj-2) 
     223            pt2d(1     ,ijpj-1) = psgn * pt2d(jpiglo  ,ijpj-1)    
    212224            DO ji = jpiglo/2, jpiglo-1 
    213225               iju = jpiglo-ji+1 
     
    221233               END DO 
    222234            END DO 
     235            pt2d( 1 ,ijpj)   = psgn * pt2d( 3 ,ijpj-3)  
    223236         CASE ( 'F' )                                     ! F-point 
    224237            DO jl = -1, ipr2dj 
     
    228241               END DO 
    229242            END DO 
     243            pt2d(   1  ,ijpj)   = psgn * pt2d(    2   ,ijpj-3) 
     244            pt2d(jpiglo,ijpj)   = psgn * pt2d(jpiglo-1,ijpj-3) 
     245            pt2d(jpiglo,ijpj-1) = psgn * pt2d(jpiglo-1,ijpj-2)       
     246            pt2d(   1  ,ijpj-1) = psgn * pt2d(    2   ,ijpj-2)       
    230247         CASE ( 'I' )                                     ! ice U-V point (I-point) 
    231248            DO jl = 0, ipr2dj 
     
    271288               END DO 
    272289            END DO 
     290            pt2d(jpiglo,ijpj) = psgn * pt2d(1,ijpj-1) 
    273291         CASE ( 'V' )                                     ! V-point 
    274292            DO jl = 0, ipr2dj 
     
    289307               END DO 
    290308            END DO 
     309            pt2d(jpiglo,ijpj) = psgn * pt2d(1,ijpj-2) 
    291310            DO ji = jpiglo/2+1, jpiglo-1 
    292311               iju = jpiglo-ji 
  • branches/2013/dev_LOCEAN_2013/NEMOGCM/NEMO/OPA_SRC/LBC/lib_mpp.F90

    r4148 r4152  
    2222   !!                          'mpp_lnk_bdy_2d' and 'mpp_lnk_obc_2d' routines and update 
    2323   !!                          the mppobc routine to optimize the BDY and OBC communications 
     24   !!            3.6  !  2013  ( C. Ethe, G. Madec ) message passing arrays as local variables  
    2425   !!---------------------------------------------------------------------- 
    2526 
     
    7273   PUBLIC   mppsize 
    7374   PUBLIC   mppsend, mpprecv                          ! needed by TAM and ICB routines 
    74    PUBLIC   lib_mpp_alloc   ! Called in nemogcm.F90 
    7575   PUBLIC   mpp_lnk_bdy_2d, mpp_lnk_bdy_3d 
    7676   PUBLIC   mpp_lnk_obc_2d, mpp_lnk_obc_3d 
     
    151151   REAL(wp), DIMENSION(:), ALLOCATABLE, SAVE :: tampon  ! buffer in case of bsend 
    152152 
    153    ! message passing arrays 
    154    REAL(wp), DIMENSION(:,:,:,:,:), ALLOCATABLE, SAVE ::   t4ns, t4sn   ! 2 x 3d for north-south & south-north 
    155    REAL(wp), DIMENSION(:,:,:,:,:), ALLOCATABLE, SAVE ::   t4ew, t4we   ! 2 x 3d for east-west & west-east 
    156    REAL(wp), DIMENSION(:,:,:,:,:), ALLOCATABLE, SAVE ::   t4p1, t4p2   ! 2 x 3d for north fold 
    157    REAL(wp), DIMENSION(:,:,:,:)  , ALLOCATABLE, SAVE ::   t3ns, t3sn   ! 3d for north-south & south-north 
    158    REAL(wp), DIMENSION(:,:,:,:)  , ALLOCATABLE, SAVE ::   t3ew, t3we   ! 3d for east-west & west-east 
    159    REAL(wp), DIMENSION(:,:,:,:)  , ALLOCATABLE, SAVE ::   t3p1, t3p2   ! 3d for north fold 
    160    REAL(wp), DIMENSION(:,:,:)    , ALLOCATABLE, SAVE ::   t2ns, t2sn   ! 2d for north-south & south-north 
    161    REAL(wp), DIMENSION(:,:,:)    , ALLOCATABLE, SAVE ::   t2ew, t2we   ! 2d for east-west & west-east 
    162    REAL(wp), DIMENSION(:,:,:)    , ALLOCATABLE, SAVE ::   t2p1, t2p2   ! 2d for north fold 
    163  
    164    ! Arrays used in mpp_lbc_north_3d() 
    165    REAL(wp), DIMENSION(:,:,:)  , ALLOCATABLE, SAVE   ::   tab_3d, xnorthloc 
    166    REAL(wp), DIMENSION(:,:,:,:), ALLOCATABLE, SAVE   ::   xnorthgloio 
    167    REAL(wp), DIMENSION(:,:,:)  , ALLOCATABLE, SAVE   ::   foldwk      ! Workspace for message transfers avoiding mpi_allgather 
    168  
    169    ! Arrays used in mpp_lbc_north_2d() 
    170    REAL(wp), DIMENSION(:,:)  , ALLOCATABLE, SAVE    ::   tab_2d, xnorthloc_2d 
    171    REAL(wp), DIMENSION(:,:,:), ALLOCATABLE, SAVE    ::   xnorthgloio_2d 
    172    REAL(wp), DIMENSION(:,:)  , ALLOCATABLE, SAVE    ::   foldwk_2d    ! Workspace for message transfers avoiding mpi_allgather 
    173  
    174    ! Arrays used in mpp_lbc_north_e() 
    175    REAL(wp), DIMENSION(:,:)  , ALLOCATABLE, SAVE    ::   tab_e, xnorthloc_e 
    176    REAL(wp), DIMENSION(:,:,:), ALLOCATABLE, SAVE    ::   xnorthgloio_e 
    177  
    178153   ! North fold arrays used to minimise the use of allgather operations. Set in nemo_northcomms (nemogcm) so need to be public 
    179154   INTEGER, PUBLIC,  PARAMETER :: jpmaxngh = 8                 ! Assumed maximum number of active neighbours 
     
    190165   !!---------------------------------------------------------------------- 
    191166CONTAINS 
    192  
    193    INTEGER FUNCTION lib_mpp_alloc( kumout ) 
    194       !!---------------------------------------------------------------------- 
    195       !!              ***  routine lib_mpp_alloc  *** 
    196       !!---------------------------------------------------------------------- 
    197       INTEGER, INTENT(in) ::   kumout   ! ocean.output logical unit 
    198       !!---------------------------------------------------------------------- 
    199       ! 
    200       ALLOCATE( t4ns(jpi,jprecj,jpk,2,2) , t4sn(jpi,jprecj,jpk,2,2) ,                                            & 
    201          &      t4ew(jpj,jpreci,jpk,2,2) , t4we(jpj,jpreci,jpk,2,2) ,                                            & 
    202          &      t4p1(jpi,jprecj,jpk,2,2) , t4p2(jpi,jprecj,jpk,2,2) ,                                            & 
    203          &      t3ns(jpi,jprecj,jpk,2)   , t3sn(jpi,jprecj,jpk,2)   ,                                            & 
    204          &      t3ew(jpj,jpreci,jpk,2)   , t3we(jpj,jpreci,jpk,2)   ,                                            & 
    205          &      t3p1(jpi,jprecj,jpk,2)   , t3p2(jpi,jprecj,jpk,2)   ,                                            & 
    206          &      t2ns(jpi,jprecj    ,2)   , t2sn(jpi,jprecj    ,2)   ,                                            & 
    207          &      t2ew(jpj,jpreci    ,2)   , t2we(jpj,jpreci    ,2)   ,                                            & 
    208          &      t2p1(jpi,jprecj    ,2)   , t2p2(jpi,jprecj    ,2)   ,                                            & 
    209          ! 
    210          &      tab_3d(jpiglo,4,jpk) , xnorthloc(jpi,4,jpk) , xnorthgloio(jpi,4,jpk,jpni) ,                        & 
    211          &      foldwk(jpi,4,jpk) ,                                                                             & 
    212          ! 
    213          &      tab_2d(jpiglo,4)  , xnorthloc_2d(jpi,4)  , xnorthgloio_2d(jpi,4,jpni)  ,                        & 
    214          &      foldwk_2d(jpi,4)  ,                                                                             & 
    215          ! 
    216          &      tab_e(jpiglo,4+2*jpr2dj) , xnorthloc_e(jpi,4+2*jpr2dj) , xnorthgloio_e(jpi,4+2*jpr2dj,jpni) ,   & 
    217          ! 
    218          &      STAT=lib_mpp_alloc ) 
    219          ! 
    220       IF( lib_mpp_alloc /= 0 ) THEN 
    221          WRITE(kumout,cform_war) 
    222          WRITE(kumout,*) 'lib_mpp_alloc : failed to allocate arrays' 
    223       ENDIF 
    224       ! 
    225    END FUNCTION lib_mpp_alloc 
    226167 
    227168 
     
    395336      REAL(wp) ::   zland 
    396337      INTEGER, DIMENSION(MPI_STATUS_SIZE) ::   ml_stat   ! for key_mpi_isend 
    397       !!---------------------------------------------------------------------- 
     338      ! 
     339      REAL(wp), DIMENSION(:,:,:,:), ALLOCATABLE ::   zt3ns, zt3sn   ! 3d for north-south & south-north 
     340      REAL(wp), DIMENSION(:,:,:,:), ALLOCATABLE ::   zt3ew, zt3we   ! 3d for east-west & west-east 
     341 
     342      !!---------------------------------------------------------------------- 
     343 
     344      ALLOCATE( zt3ns(jpi,jprecj,jpk,2), zt3sn(jpi,jprecj,jpk,2),   & 
     345         &      zt3ew(jpj,jpreci,jpk,2), zt3we(jpj,jpreci,jpk,2)  ) 
    398346 
    399347      zland = 0.e0      ! zero by default 
     
    430378         iihom = nlci-nreci 
    431379         DO jl = 1, jpreci 
    432             t3ew(:,jl,:,1) = ptab(jpreci+jl,:,:) 
    433             t3we(:,jl,:,1) = ptab(iihom +jl,:,:) 
     380            zt3ew(:,jl,:,1) = ptab(jpreci+jl,:,:) 
     381            zt3we(:,jl,:,1) = ptab(iihom +jl,:,:) 
    434382         END DO 
    435383      END SELECT   
     
    440388      SELECT CASE ( nbondi )  
    441389      CASE ( -1 ) 
    442          CALL mppsend( 2, t3we(1,1,1,1), imigr, noea, ml_req1 ) 
    443          CALL mpprecv( 1, t3ew(1,1,1,2), imigr, noea ) 
     390         CALL mppsend( 2, zt3we(1,1,1,1), imigr, noea, ml_req1 ) 
     391         CALL mpprecv( 1, zt3ew(1,1,1,2), imigr, noea ) 
    444392         IF(l_isend) CALL mpi_wait(ml_req1, ml_stat, ml_err) 
    445393      CASE ( 0 ) 
    446          CALL mppsend( 1, t3ew(1,1,1,1), imigr, nowe, ml_req1 ) 
    447          CALL mppsend( 2, t3we(1,1,1,1), imigr, noea, ml_req2 ) 
    448          CALL mpprecv( 1, t3ew(1,1,1,2), imigr, noea ) 
    449          CALL mpprecv( 2, t3we(1,1,1,2), imigr, nowe ) 
     394         CALL mppsend( 1, zt3ew(1,1,1,1), imigr, nowe, ml_req1 ) 
     395         CALL mppsend( 2, zt3we(1,1,1,1), imigr, noea, ml_req2 ) 
     396         CALL mpprecv( 1, zt3ew(1,1,1,2), imigr, noea ) 
     397         CALL mpprecv( 2, zt3we(1,1,1,2), imigr, nowe ) 
    450398         IF(l_isend) CALL mpi_wait(ml_req1, ml_stat, ml_err) 
    451399         IF(l_isend) CALL mpi_wait(ml_req2, ml_stat, ml_err) 
    452400      CASE ( 1 ) 
    453          CALL mppsend( 1, t3ew(1,1,1,1), imigr, nowe, ml_req1 ) 
    454          CALL mpprecv( 2, t3we(1,1,1,2), imigr, nowe ) 
     401         CALL mppsend( 1, zt3ew(1,1,1,1), imigr, nowe, ml_req1 ) 
     402         CALL mpprecv( 2, zt3we(1,1,1,2), imigr, nowe ) 
    455403         IF(l_isend) CALL mpi_wait(ml_req1, ml_stat, ml_err) 
    456404      END SELECT 
     
    462410      CASE ( -1 ) 
    463411         DO jl = 1, jpreci 
    464             ptab(iihom+jl,:,:) = t3ew(:,jl,:,2) 
     412            ptab(iihom+jl,:,:) = zt3ew(:,jl,:,2) 
    465413         END DO 
    466414      CASE ( 0 ) 
    467415         DO jl = 1, jpreci 
    468             ptab(jl      ,:,:) = t3we(:,jl,:,2) 
    469             ptab(iihom+jl,:,:) = t3ew(:,jl,:,2) 
     416            ptab(jl      ,:,:) = zt3we(:,jl,:,2) 
     417            ptab(iihom+jl,:,:) = zt3ew(:,jl,:,2) 
    470418         END DO 
    471419      CASE ( 1 ) 
    472420         DO jl = 1, jpreci 
    473             ptab(jl      ,:,:) = t3we(:,jl,:,2) 
     421            ptab(jl      ,:,:) = zt3we(:,jl,:,2) 
    474422         END DO 
    475423      END SELECT 
     
    485433         ijhom = nlcj-nrecj 
    486434         DO jl = 1, jprecj 
    487             t3sn(:,jl,:,1) = ptab(:,ijhom +jl,:) 
    488             t3ns(:,jl,:,1) = ptab(:,jprecj+jl,:) 
     435            zt3sn(:,jl,:,1) = ptab(:,ijhom +jl,:) 
     436            zt3ns(:,jl,:,1) = ptab(:,jprecj+jl,:) 
    489437         END DO 
    490438      ENDIF 
     
    495443      SELECT CASE ( nbondj )      
    496444      CASE ( -1 ) 
    497          CALL mppsend( 4, t3sn(1,1,1,1), imigr, nono, ml_req1 ) 
    498          CALL mpprecv( 3, t3ns(1,1,1,2), imigr, nono ) 
     445         CALL mppsend( 4, zt3sn(1,1,1,1), imigr, nono, ml_req1 ) 
     446         CALL mpprecv( 3, zt3ns(1,1,1,2), imigr, nono ) 
    499447         IF(l_isend) CALL mpi_wait(ml_req1, ml_stat, ml_err) 
    500448      CASE ( 0 ) 
    501          CALL mppsend( 3, t3ns(1,1,1,1), imigr, noso, ml_req1 ) 
    502          CALL mppsend( 4, t3sn(1,1,1,1), imigr, nono, ml_req2 ) 
    503          CALL mpprecv( 3, t3ns(1,1,1,2), imigr, nono ) 
    504          CALL mpprecv( 4, t3sn(1,1,1,2), imigr, noso ) 
     449         CALL mppsend( 3, zt3ns(1,1,1,1), imigr, noso, ml_req1 ) 
     450         CALL mppsend( 4, zt3sn(1,1,1,1), imigr, nono, ml_req2 ) 
     451         CALL mpprecv( 3, zt3ns(1,1,1,2), imigr, nono ) 
     452         CALL mpprecv( 4, zt3sn(1,1,1,2), imigr, noso ) 
    505453         IF(l_isend) CALL mpi_wait(ml_req1, ml_stat, ml_err) 
    506454         IF(l_isend) CALL mpi_wait(ml_req2, ml_stat, ml_err) 
    507455      CASE ( 1 )  
    508          CALL mppsend( 3, t3ns(1,1,1,1), imigr, noso, ml_req1 ) 
    509          CALL mpprecv( 4, t3sn(1,1,1,2), imigr, noso ) 
     456         CALL mppsend( 3, zt3ns(1,1,1,1), imigr, noso, ml_req1 ) 
     457         CALL mpprecv( 4, zt3sn(1,1,1,2), imigr, noso ) 
    510458         IF(l_isend) CALL mpi_wait(ml_req1, ml_stat, ml_err) 
    511459      END SELECT 
     
    517465      CASE ( -1 ) 
    518466         DO jl = 1, jprecj 
    519             ptab(:,ijhom+jl,:) = t3ns(:,jl,:,2) 
     467            ptab(:,ijhom+jl,:) = zt3ns(:,jl,:,2) 
    520468         END DO 
    521469      CASE ( 0 ) 
    522470         DO jl = 1, jprecj 
    523             ptab(:,jl      ,:) = t3sn(:,jl,:,2) 
    524             ptab(:,ijhom+jl,:) = t3ns(:,jl,:,2) 
     471            ptab(:,jl      ,:) = zt3sn(:,jl,:,2) 
     472            ptab(:,ijhom+jl,:) = zt3ns(:,jl,:,2) 
    525473         END DO 
    526474      CASE ( 1 ) 
    527475         DO jl = 1, jprecj 
    528             ptab(:,jl,:) = t3sn(:,jl,:,2) 
     476            ptab(:,jl,:) = zt3sn(:,jl,:,2) 
    529477         END DO 
    530478      END SELECT 
     
    543491         ! 
    544492      ENDIF 
     493      ! 
     494      DEALLOCATE( zt3ns, zt3sn, zt3ew, zt3we ) 
    545495      ! 
    546496   END SUBROUTINE mpp_lnk_obc_3d 
     
    577527      REAL(wp) ::   zland 
    578528      INTEGER, DIMENSION(MPI_STATUS_SIZE) ::   ml_stat   ! for key_mpi_isend 
    579       !!---------------------------------------------------------------------- 
     529      ! 
     530      REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::  zt2ns, zt2sn   ! 2d for north-south & south-north 
     531      REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::  zt2ew, zt2we   ! 2d for east-west & west-east 
     532 
     533      !!---------------------------------------------------------------------- 
     534 
     535      ALLOCATE( zt2ns(jpi,jprecj,2), zt2sn(jpi,jprecj,2),  & 
     536         &      zt2ew(jpj,jpreci,2), zt2we(jpj,jpreci,2)   ) 
    580537 
    581538      zland = 0.e0      ! zero by default 
     
    612569         iihom = nlci-nreci 
    613570         DO jl = 1, jpreci 
    614             t2ew(:,jl,1) = pt2d(jpreci+jl,:) 
    615             t2we(:,jl,1) = pt2d(iihom +jl,:) 
     571            zt2ew(:,jl,1) = pt2d(jpreci+jl,:) 
     572            zt2we(:,jl,1) = pt2d(iihom +jl,:) 
    616573         END DO 
    617574      END SELECT 
     
    622579      SELECT CASE ( nbondi ) 
    623580      CASE ( -1 ) 
    624          CALL mppsend( 2, t2we(1,1,1), imigr, noea, ml_req1 ) 
    625          CALL mpprecv( 1, t2ew(1,1,2), imigr, noea ) 
     581         CALL mppsend( 2, zt2we(1,1,1), imigr, noea, ml_req1 ) 
     582         CALL mpprecv( 1, zt2ew(1,1,2), imigr, noea ) 
    626583         IF(l_isend) CALL mpi_wait(ml_req1,ml_stat,ml_err) 
    627584      CASE ( 0 ) 
    628          CALL mppsend( 1, t2ew(1,1,1), imigr, nowe, ml_req1 ) 
    629          CALL mppsend( 2, t2we(1,1,1), imigr, noea, ml_req2 ) 
    630          CALL mpprecv( 1, t2ew(1,1,2), imigr, noea ) 
    631          CALL mpprecv( 2, t2we(1,1,2), imigr, nowe ) 
     585         CALL mppsend( 1, zt2ew(1,1,1), imigr, nowe, ml_req1 ) 
     586         CALL mppsend( 2, zt2we(1,1,1), imigr, noea, ml_req2 ) 
     587         CALL mpprecv( 1, zt2ew(1,1,2), imigr, noea ) 
     588         CALL mpprecv( 2, zt2we(1,1,2), imigr, nowe ) 
    632589         IF(l_isend) CALL mpi_wait(ml_req1,ml_stat,ml_err) 
    633590         IF(l_isend) CALL mpi_wait(ml_req2,ml_stat,ml_err) 
    634591      CASE ( 1 ) 
    635          CALL mppsend( 1, t2ew(1,1,1), imigr, nowe, ml_req1 ) 
    636          CALL mpprecv( 2, t2we(1,1,2), imigr, nowe ) 
     592         CALL mppsend( 1, zt2ew(1,1,1), imigr, nowe, ml_req1 ) 
     593         CALL mpprecv( 2, zt2we(1,1,2), imigr, nowe ) 
    637594         IF(l_isend) CALL mpi_wait(ml_req1,ml_stat,ml_err) 
    638595      END SELECT 
     
    644601      CASE ( -1 ) 
    645602         DO jl = 1, jpreci 
    646             pt2d(iihom+jl,:) = t2ew(:,jl,2) 
     603            pt2d(iihom+jl,:) = zt2ew(:,jl,2) 
    647604         END DO 
    648605      CASE ( 0 ) 
    649606         DO jl = 1, jpreci 
    650             pt2d(jl      ,:) = t2we(:,jl,2) 
    651             pt2d(iihom+jl,:) = t2ew(:,jl,2) 
     607            pt2d(jl      ,:) = zt2we(:,jl,2) 
     608            pt2d(iihom+jl,:) = zt2ew(:,jl,2) 
    652609         END DO 
    653610      CASE ( 1 ) 
    654611         DO jl = 1, jpreci 
    655             pt2d(jl      ,:) = t2we(:,jl,2) 
     612            pt2d(jl      ,:) = zt2we(:,jl,2) 
    656613         END DO 
    657614      END SELECT 
     
    665622         ijhom = nlcj-nrecj 
    666623         DO jl = 1, jprecj 
    667             t2sn(:,jl,1) = pt2d(:,ijhom +jl) 
    668             t2ns(:,jl,1) = pt2d(:,jprecj+jl) 
     624            zt2sn(:,jl,1) = pt2d(:,ijhom +jl) 
     625            zt2ns(:,jl,1) = pt2d(:,jprecj+jl) 
    669626         END DO 
    670627      ENDIF 
     
    675632      SELECT CASE ( nbondj ) 
    676633      CASE ( -1 ) 
    677          CALL mppsend( 4, t2sn(1,1,1), imigr, nono, ml_req1 ) 
    678          CALL mpprecv( 3, t2ns(1,1,2), imigr, nono ) 
     634         CALL mppsend( 4, zt2sn(1,1,1), imigr, nono, ml_req1 ) 
     635         CALL mpprecv( 3, zt2ns(1,1,2), imigr, nono ) 
    679636         IF(l_isend) CALL mpi_wait(ml_req1,ml_stat,ml_err) 
    680637      CASE ( 0 ) 
    681          CALL mppsend( 3, t2ns(1,1,1), imigr, noso, ml_req1 ) 
    682          CALL mppsend( 4, t2sn(1,1,1), imigr, nono, ml_req2 ) 
    683          CALL mpprecv( 3, t2ns(1,1,2), imigr, nono ) 
    684          CALL mpprecv( 4, t2sn(1,1,2), imigr, noso ) 
     638         CALL mppsend( 3, zt2ns(1,1,1), imigr, noso, ml_req1 ) 
     639         CALL mppsend( 4, zt2sn(1,1,1), imigr, nono, ml_req2 ) 
     640         CALL mpprecv( 3, zt2ns(1,1,2), imigr, nono ) 
     641         CALL mpprecv( 4, zt2sn(1,1,2), imigr, noso ) 
    685642         IF(l_isend) CALL mpi_wait(ml_req1,ml_stat,ml_err) 
    686643         IF(l_isend) CALL mpi_wait(ml_req2,ml_stat,ml_err) 
    687644      CASE ( 1 ) 
    688          CALL mppsend( 3, t2ns(1,1,1), imigr, noso, ml_req1 ) 
    689          CALL mpprecv( 4, t2sn(1,1,2), imigr, noso ) 
     645         CALL mppsend( 3, zt2ns(1,1,1), imigr, noso, ml_req1 ) 
     646         CALL mpprecv( 4, zt2sn(1,1,2), imigr, noso ) 
    690647         IF(l_isend) CALL mpi_wait(ml_req1,ml_stat,ml_err) 
    691648      END SELECT 
     
    697654      CASE ( -1 ) 
    698655         DO jl = 1, jprecj 
    699             pt2d(:,ijhom+jl) = t2ns(:,jl,2) 
     656            pt2d(:,ijhom+jl) = zt2ns(:,jl,2) 
    700657         END DO 
    701658      CASE ( 0 ) 
    702659         DO jl = 1, jprecj 
    703             pt2d(:,jl      ) = t2sn(:,jl,2) 
    704             pt2d(:,ijhom+jl) = t2ns(:,jl,2) 
     660            pt2d(:,jl      ) = zt2sn(:,jl,2) 
     661            pt2d(:,ijhom+jl) = zt2ns(:,jl,2) 
    705662         END DO 
    706663      CASE ( 1 )  
    707664         DO jl = 1, jprecj 
    708             pt2d(:,jl      ) = t2sn(:,jl,2) 
     665            pt2d(:,jl      ) = zt2sn(:,jl,2) 
    709666         END DO 
    710667      END SELECT 
     
    722679         ! 
    723680      ENDIF 
     681      ! 
     682      DEALLOCATE( zt2ns, zt2sn, zt2ew, zt2we ) 
    724683      ! 
    725684   END SUBROUTINE mpp_lnk_obc_2d 
     
    759718      REAL(wp) ::   zland 
    760719      INTEGER, DIMENSION(MPI_STATUS_SIZE) ::   ml_stat   ! for key_mpi_isend 
    761       !!---------------------------------------------------------------------- 
    762  
     720      ! 
     721      REAL(wp), DIMENSION(:,:,:,:), ALLOCATABLE ::   zt3ns, zt3sn   ! 3d for north-south & south-north 
     722      REAL(wp), DIMENSION(:,:,:,:), ALLOCATABLE ::   zt3ew, zt3we   ! 3d for east-west & west-east 
     723 
     724      !!---------------------------------------------------------------------- 
     725       
     726      ALLOCATE( zt3ns(jpi,jprecj,jpk,2), zt3sn(jpi,jprecj,jpk,2),   & 
     727         &      zt3ew(jpj,jpreci,jpk,2), zt3we(jpj,jpreci,jpk,2)  ) 
     728 
     729      ! 
    763730      IF( PRESENT( pval ) ) THEN   ;   zland = pval      ! set land value 
    764731      ELSE                         ;   zland = 0.e0      ! zero by default 
     
    808775         iihom = nlci-nreci 
    809776         DO jl = 1, jpreci 
    810             t3ew(:,jl,:,1) = ptab(jpreci+jl,:,:) 
    811             t3we(:,jl,:,1) = ptab(iihom +jl,:,:) 
     777            zt3ew(:,jl,:,1) = ptab(jpreci+jl,:,:) 
     778            zt3we(:,jl,:,1) = ptab(iihom +jl,:,:) 
    812779         END DO 
    813780      END SELECT 
     
    818785      SELECT CASE ( nbondi ) 
    819786      CASE ( -1 ) 
    820          CALL mppsend( 2, t3we(1,1,1,1), imigr, noea, ml_req1 ) 
    821          CALL mpprecv( 1, t3ew(1,1,1,2), imigr, noea ) 
     787         CALL mppsend( 2, zt3we(1,1,1,1), imigr, noea, ml_req1 ) 
     788         CALL mpprecv( 1, zt3ew(1,1,1,2), imigr, noea ) 
    822789         IF(l_isend) CALL mpi_wait(ml_req1, ml_stat, ml_err) 
    823790      CASE ( 0 ) 
    824          CALL mppsend( 1, t3ew(1,1,1,1), imigr, nowe, ml_req1 ) 
    825          CALL mppsend( 2, t3we(1,1,1,1), imigr, noea, ml_req2 ) 
    826          CALL mpprecv( 1, t3ew(1,1,1,2), imigr, noea ) 
    827          CALL mpprecv( 2, t3we(1,1,1,2), imigr, nowe ) 
     791         CALL mppsend( 1, zt3ew(1,1,1,1), imigr, nowe, ml_req1 ) 
     792         CALL mppsend( 2, zt3we(1,1,1,1), imigr, noea, ml_req2 ) 
     793         CALL mpprecv( 1, zt3ew(1,1,1,2), imigr, noea ) 
     794         CALL mpprecv( 2, zt3we(1,1,1,2), imigr, nowe ) 
    828795         IF(l_isend) CALL mpi_wait(ml_req1, ml_stat, ml_err) 
    829796         IF(l_isend) CALL mpi_wait(ml_req2, ml_stat, ml_err) 
    830797      CASE ( 1 ) 
    831          CALL mppsend( 1, t3ew(1,1,1,1), imigr, nowe, ml_req1 ) 
    832          CALL mpprecv( 2, t3we(1,1,1,2), imigr, nowe ) 
     798         CALL mppsend( 1, zt3ew(1,1,1,1), imigr, nowe, ml_req1 ) 
     799         CALL mpprecv( 2, zt3we(1,1,1,2), imigr, nowe ) 
    833800         IF(l_isend) CALL mpi_wait(ml_req1, ml_stat, ml_err) 
    834801      END SELECT 
     
    840807      CASE ( -1 ) 
    841808         DO jl = 1, jpreci 
    842             ptab(iihom+jl,:,:) = t3ew(:,jl,:,2) 
     809            ptab(iihom+jl,:,:) = zt3ew(:,jl,:,2) 
    843810         END DO 
    844811      CASE ( 0 ) 
    845812         DO jl = 1, jpreci 
    846             ptab(jl      ,:,:) = t3we(:,jl,:,2) 
    847             ptab(iihom+jl,:,:) = t3ew(:,jl,:,2) 
     813            ptab(jl      ,:,:) = zt3we(:,jl,:,2) 
     814            ptab(iihom+jl,:,:) = zt3ew(:,jl,:,2) 
    848815         END DO 
    849816      CASE ( 1 ) 
    850817         DO jl = 1, jpreci 
    851             ptab(jl      ,:,:) = t3we(:,jl,:,2) 
     818            ptab(jl      ,:,:) = zt3we(:,jl,:,2) 
    852819         END DO 
    853820      END SELECT 
     
    861828         ijhom = nlcj-nrecj 
    862829         DO jl = 1, jprecj 
    863             t3sn(:,jl,:,1) = ptab(:,ijhom +jl,:) 
    864             t3ns(:,jl,:,1) = ptab(:,jprecj+jl,:) 
     830            zt3sn(:,jl,:,1) = ptab(:,ijhom +jl,:) 
     831            zt3ns(:,jl,:,1) = ptab(:,jprecj+jl,:) 
    865832         END DO 
    866833      ENDIF 
     
    871838      SELECT CASE ( nbondj ) 
    872839      CASE ( -1 ) 
    873          CALL mppsend( 4, t3sn(1,1,1,1), imigr, nono, ml_req1 ) 
    874          CALL mpprecv( 3, t3ns(1,1,1,2), imigr, nono ) 
     840         CALL mppsend( 4, zt3sn(1,1,1,1), imigr, nono, ml_req1 ) 
     841         CALL mpprecv( 3, zt3ns(1,1,1,2), imigr, nono ) 
    875842         IF(l_isend) CALL mpi_wait(ml_req1, ml_stat, ml_err) 
    876843      CASE ( 0 ) 
    877          CALL mppsend( 3, t3ns(1,1,1,1), imigr, noso, ml_req1 ) 
    878          CALL mppsend( 4, t3sn(1,1,1,1), imigr, nono, ml_req2 ) 
    879          CALL mpprecv( 3, t3ns(1,1,1,2), imigr, nono ) 
    880          CALL mpprecv( 4, t3sn(1,1,1,2), imigr, noso ) 
     844         CALL mppsend( 3, zt3ns(1,1,1,1), imigr, noso, ml_req1 ) 
     845         CALL mppsend( 4, zt3sn(1,1,1,1), imigr, nono, ml_req2 ) 
     846         CALL mpprecv( 3, zt3ns(1,1,1,2), imigr, nono ) 
     847         CALL mpprecv( 4, zt3sn(1,1,1,2), imigr, noso ) 
    881848         IF(l_isend) CALL mpi_wait(ml_req1, ml_stat, ml_err) 
    882849         IF(l_isend) CALL mpi_wait(ml_req2, ml_stat, ml_err) 
    883850      CASE ( 1 ) 
    884          CALL mppsend( 3, t3ns(1,1,1,1), imigr, noso, ml_req1 ) 
    885          CALL mpprecv( 4, t3sn(1,1,1,2), imigr, noso ) 
     851         CALL mppsend( 3, zt3ns(1,1,1,1), imigr, noso, ml_req1 ) 
     852         CALL mpprecv( 4, zt3sn(1,1,1,2), imigr, noso ) 
    886853         IF(l_isend) CALL mpi_wait(ml_req1, ml_stat, ml_err) 
    887854      END SELECT 
     
    893860      CASE ( -1 ) 
    894861         DO jl = 1, jprecj 
    895             ptab(:,ijhom+jl,:) = t3ns(:,jl,:,2) 
     862            ptab(:,ijhom+jl,:) = zt3ns(:,jl,:,2) 
    896863         END DO 
    897864      CASE ( 0 ) 
    898865         DO jl = 1, jprecj 
    899             ptab(:,jl      ,:) = t3sn(:,jl,:,2) 
    900             ptab(:,ijhom+jl,:) = t3ns(:,jl,:,2) 
     866            ptab(:,jl      ,:) = zt3sn(:,jl,:,2) 
     867            ptab(:,ijhom+jl,:) = zt3ns(:,jl,:,2) 
    901868         END DO 
    902869      CASE ( 1 ) 
    903870         DO jl = 1, jprecj 
    904             ptab(:,jl,:) = t3sn(:,jl,:,2) 
     871            ptab(:,jl,:) = zt3sn(:,jl,:,2) 
    905872         END DO 
    906873      END SELECT 
     
    918885         ! 
    919886      ENDIF 
     887      ! 
     888      DEALLOCATE( zt3ns, zt3sn, zt3ew, zt3we ) 
    920889      ! 
    921890   END SUBROUTINE mpp_lnk_3d 
     
    954923      REAL(wp) ::   zland 
    955924      INTEGER, DIMENSION(MPI_STATUS_SIZE) ::   ml_stat   ! for key_mpi_isend 
    956       !!---------------------------------------------------------------------- 
    957  
     925      ! 
     926      REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::  zt2ns, zt2sn   ! 2d for north-south & south-north 
     927      REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::  zt2ew, zt2we   ! 2d for east-west & west-east 
     928 
     929      !!---------------------------------------------------------------------- 
     930 
     931      ALLOCATE( zt2ns(jpi,jprecj,2), zt2sn(jpi,jprecj,2),  & 
     932         &      zt2ew(jpj,jpreci,2), zt2we(jpj,jpreci,2)   ) 
     933 
     934      ! 
    958935      IF( PRESENT( pval ) ) THEN   ;   zland = pval      ! set land value 
    959936      ELSE                         ;   zland = 0.e0      ! zero by default 
     
    1002979         iihom = nlci-nreci 
    1003980         DO jl = 1, jpreci 
    1004             t2ew(:,jl,1) = pt2d(jpreci+jl,:) 
    1005             t2we(:,jl,1) = pt2d(iihom +jl,:) 
     981            zt2ew(:,jl,1) = pt2d(jpreci+jl,:) 
     982            zt2we(:,jl,1) = pt2d(iihom +jl,:) 
    1006983         END DO 
    1007984      END SELECT 
     
    1012989      SELECT CASE ( nbondi ) 
    1013990      CASE ( -1 ) 
    1014          CALL mppsend( 2, t2we(1,1,1), imigr, noea, ml_req1 ) 
    1015          CALL mpprecv( 1, t2ew(1,1,2), imigr, noea ) 
     991         CALL mppsend( 2, zt2we(1,1,1), imigr, noea, ml_req1 ) 
     992         CALL mpprecv( 1, zt2ew(1,1,2), imigr, noea ) 
    1016993         IF(l_isend) CALL mpi_wait(ml_req1,ml_stat,ml_err) 
    1017994      CASE ( 0 ) 
    1018          CALL mppsend( 1, t2ew(1,1,1), imigr, nowe, ml_req1 ) 
    1019          CALL mppsend( 2, t2we(1,1,1), imigr, noea, ml_req2 ) 
    1020          CALL mpprecv( 1, t2ew(1,1,2), imigr, noea ) 
    1021          CALL mpprecv( 2, t2we(1,1,2), imigr, nowe ) 
     995         CALL mppsend( 1, zt2ew(1,1,1), imigr, nowe, ml_req1 ) 
     996         CALL mppsend( 2, zt2we(1,1,1), imigr, noea, ml_req2 ) 
     997         CALL mpprecv( 1, zt2ew(1,1,2), imigr, noea ) 
     998         CALL mpprecv( 2, zt2we(1,1,2), imigr, nowe ) 
    1022999         IF(l_isend) CALL mpi_wait(ml_req1,ml_stat,ml_err) 
    10231000         IF(l_isend) CALL mpi_wait(ml_req2,ml_stat,ml_err) 
    10241001      CASE ( 1 ) 
    1025          CALL mppsend( 1, t2ew(1,1,1), imigr, nowe, ml_req1 ) 
    1026          CALL mpprecv( 2, t2we(1,1,2), imigr, nowe ) 
     1002         CALL mppsend( 1, zt2ew(1,1,1), imigr, nowe, ml_req1 ) 
     1003         CALL mpprecv( 2, zt2we(1,1,2), imigr, nowe ) 
    10271004         IF(l_isend) CALL mpi_wait(ml_req1,ml_stat,ml_err) 
    10281005      END SELECT 
     
    10341011      CASE ( -1 ) 
    10351012         DO jl = 1, jpreci 
    1036             pt2d(iihom+jl,:) = t2ew(:,jl,2) 
     1013            pt2d(iihom+jl,:) = zt2ew(:,jl,2) 
    10371014         END DO 
    10381015      CASE ( 0 ) 
    10391016         DO jl = 1, jpreci 
    1040             pt2d(jl      ,:) = t2we(:,jl,2) 
    1041             pt2d(iihom+jl,:) = t2ew(:,jl,2) 
     1017            pt2d(jl      ,:) = zt2we(:,jl,2) 
     1018            pt2d(iihom+jl,:) = zt2ew(:,jl,2) 
    10421019         END DO 
    10431020      CASE ( 1 ) 
    10441021         DO jl = 1, jpreci 
    1045             pt2d(jl      ,:) = t2we(:,jl,2) 
     1022            pt2d(jl      ,:) = zt2we(:,jl,2) 
    10461023         END DO 
    10471024      END SELECT 
     
    10551032         ijhom = nlcj-nrecj 
    10561033         DO jl = 1, jprecj 
    1057             t2sn(:,jl,1) = pt2d(:,ijhom +jl) 
    1058             t2ns(:,jl,1) = pt2d(:,jprecj+jl) 
     1034            zt2sn(:,jl,1) = pt2d(:,ijhom +jl) 
     1035            zt2ns(:,jl,1) = pt2d(:,jprecj+jl) 
    10591036         END DO 
    10601037      ENDIF 
     
    10651042      SELECT CASE ( nbondj ) 
    10661043      CASE ( -1 ) 
    1067          CALL mppsend( 4, t2sn(1,1,1), imigr, nono, ml_req1 ) 
    1068          CALL mpprecv( 3, t2ns(1,1,2), imigr, nono ) 
     1044         CALL mppsend( 4, zt2sn(1,1,1), imigr, nono, ml_req1 ) 
     1045         CALL mpprecv( 3, zt2ns(1,1,2), imigr, nono ) 
    10691046         IF(l_isend) CALL mpi_wait(ml_req1,ml_stat,ml_err) 
    10701047      CASE ( 0 ) 
    1071          CALL mppsend( 3, t2ns(1,1,1), imigr, noso, ml_req1 ) 
    1072          CALL mppsend( 4, t2sn(1,1,1), imigr, nono, ml_req2 ) 
    1073          CALL mpprecv( 3, t2ns(1,1,2), imigr, nono ) 
    1074          CALL mpprecv( 4, t2sn(1,1,2), imigr, noso ) 
     1048         CALL mppsend( 3, zt2ns(1,1,1), imigr, noso, ml_req1 ) 
     1049         CALL mppsend( 4, zt2sn(1,1,1), imigr, nono, ml_req2 ) 
     1050         CALL mpprecv( 3, zt2ns(1,1,2), imigr, nono ) 
     1051         CALL mpprecv( 4, zt2sn(1,1,2), imigr, noso ) 
    10751052         IF(l_isend) CALL mpi_wait(ml_req1,ml_stat,ml_err) 
    10761053         IF(l_isend) CALL mpi_wait(ml_req2,ml_stat,ml_err) 
    10771054      CASE ( 1 ) 
    1078          CALL mppsend( 3, t2ns(1,1,1), imigr, noso, ml_req1 ) 
    1079          CALL mpprecv( 4, t2sn(1,1,2), imigr, noso ) 
     1055         CALL mppsend( 3, zt2ns(1,1,1), imigr, noso, ml_req1 ) 
     1056         CALL mpprecv( 4, zt2sn(1,1,2), imigr, noso ) 
    10801057         IF(l_isend) CALL mpi_wait(ml_req1,ml_stat,ml_err) 
    10811058      END SELECT 
     
    10871064      CASE ( -1 ) 
    10881065         DO jl = 1, jprecj 
    1089             pt2d(:,ijhom+jl) = t2ns(:,jl,2) 
     1066            pt2d(:,ijhom+jl) = zt2ns(:,jl,2) 
    10901067         END DO 
    10911068      CASE ( 0 ) 
    10921069         DO jl = 1, jprecj 
    1093             pt2d(:,jl      ) = t2sn(:,jl,2) 
    1094             pt2d(:,ijhom+jl) = t2ns(:,jl,2) 
     1070            pt2d(:,jl      ) = zt2sn(:,jl,2) 
     1071            pt2d(:,ijhom+jl) = zt2ns(:,jl,2) 
    10951072         END DO 
    10961073      CASE ( 1 ) 
    10971074         DO jl = 1, jprecj 
    1098             pt2d(:,jl      ) = t2sn(:,jl,2) 
     1075            pt2d(:,jl      ) = zt2sn(:,jl,2) 
    10991076         END DO 
    11001077      END SELECT 
     
    11121089         ! 
    11131090      ENDIF 
     1091      ! 
     1092      DEALLOCATE( zt2ns, zt2sn, zt2ew, zt2we ) 
    11141093      ! 
    11151094   END SUBROUTINE mpp_lnk_2d 
     
    11471126      INTEGER  ::   ml_req1, ml_req2, ml_err   ! for key_mpi_isend 
    11481127      INTEGER, DIMENSION(MPI_STATUS_SIZE) ::   ml_stat   ! for key_mpi_isend 
    1149       !!---------------------------------------------------------------------- 
     1128      ! 
     1129      REAL(wp), DIMENSION(:,:,:,:,:), ALLOCATABLE ::   zt4ns, zt4sn   ! 2 x 3d for north-south & south-north 
     1130      REAL(wp), DIMENSION(:,:,:,:,:), ALLOCATABLE ::   zt4ew, zt4we   ! 2 x 3d for east-west & west-east 
     1131 
     1132      !!---------------------------------------------------------------------- 
     1133      ALLOCATE( zt4ns(jpi,jprecj,jpk,2,2), zt4sn(jpi,jprecj,jpk,2,2) ,    & 
     1134         &      zt4ew(jpj,jpreci,jpk,2,2), zt4we(jpj,jpreci,jpk,2,2) ) 
     1135 
    11501136 
    11511137      ! 1. standard boundary treatment 
     
    11811167         iihom = nlci-nreci 
    11821168         DO jl = 1, jpreci 
    1183             t4ew(:,jl,:,1,1) = ptab1(jpreci+jl,:,:) 
    1184             t4we(:,jl,:,1,1) = ptab1(iihom +jl,:,:) 
    1185             t4ew(:,jl,:,2,1) = ptab2(jpreci+jl,:,:) 
    1186             t4we(:,jl,:,2,1) = ptab2(iihom +jl,:,:) 
     1169            zt4ew(:,jl,:,1,1) = ptab1(jpreci+jl,:,:) 
     1170            zt4we(:,jl,:,1,1) = ptab1(iihom +jl,:,:) 
     1171            zt4ew(:,jl,:,2,1) = ptab2(jpreci+jl,:,:) 
     1172            zt4we(:,jl,:,2,1) = ptab2(iihom +jl,:,:) 
    11871173         END DO 
    11881174      END SELECT 
     
    11931179      SELECT CASE ( nbondi ) 
    11941180      CASE ( -1 ) 
    1195          CALL mppsend( 2, t4we(1,1,1,1,1), imigr, noea, ml_req1 ) 
    1196          CALL mpprecv( 1, t4ew(1,1,1,1,2), imigr, noea ) 
     1181         CALL mppsend( 2, zt4we(1,1,1,1,1), imigr, noea, ml_req1 ) 
     1182         CALL mpprecv( 1, zt4ew(1,1,1,1,2), imigr, noea ) 
    11971183         IF(l_isend) CALL mpi_wait(ml_req1, ml_stat, ml_err) 
    11981184      CASE ( 0 ) 
    1199          CALL mppsend( 1, t4ew(1,1,1,1,1), imigr, nowe, ml_req1 ) 
    1200          CALL mppsend( 2, t4we(1,1,1,1,1), imigr, noea, ml_req2 ) 
    1201          CALL mpprecv( 1, t4ew(1,1,1,1,2), imigr, noea ) 
    1202          CALL mpprecv( 2, t4we(1,1,1,1,2), imigr, nowe ) 
     1185         CALL mppsend( 1, zt4ew(1,1,1,1,1), imigr, nowe, ml_req1 ) 
     1186         CALL mppsend( 2, zt4we(1,1,1,1,1), imigr, noea, ml_req2 ) 
     1187         CALL mpprecv( 1, zt4ew(1,1,1,1,2), imigr, noea ) 
     1188         CALL mpprecv( 2, zt4we(1,1,1,1,2), imigr, nowe ) 
    12031189         IF(l_isend) CALL mpi_wait(ml_req1, ml_stat, ml_err) 
    12041190         IF(l_isend) CALL mpi_wait(ml_req2, ml_stat, ml_err) 
    12051191      CASE ( 1 ) 
    1206          CALL mppsend( 1, t4ew(1,1,1,1,1), imigr, nowe, ml_req1 ) 
    1207          CALL mpprecv( 2, t4we(1,1,1,1,2), imigr, nowe ) 
     1192         CALL mppsend( 1, zt4ew(1,1,1,1,1), imigr, nowe, ml_req1 ) 
     1193         CALL mpprecv( 2, zt4we(1,1,1,1,2), imigr, nowe ) 
    12081194         IF(l_isend) CALL mpi_wait(ml_req1, ml_stat, ml_err) 
    12091195      END SELECT 
     
    12151201      CASE ( -1 ) 
    12161202         DO jl = 1, jpreci 
    1217             ptab1(iihom+jl,:,:) = t4ew(:,jl,:,1,2) 
    1218             ptab2(iihom+jl,:,:) = t4ew(:,jl,:,2,2) 
     1203            ptab1(iihom+jl,:,:) = zt4ew(:,jl,:,1,2) 
     1204            ptab2(iihom+jl,:,:) = zt4ew(:,jl,:,2,2) 
    12191205         END DO 
    12201206      CASE ( 0 ) 
    12211207         DO jl = 1, jpreci 
    1222             ptab1(jl      ,:,:) = t4we(:,jl,:,1,2) 
    1223             ptab1(iihom+jl,:,:) = t4ew(:,jl,:,1,2) 
    1224             ptab2(jl      ,:,:) = t4we(:,jl,:,2,2) 
    1225             ptab2(iihom+jl,:,:) = t4ew(:,jl,:,2,2) 
     1208            ptab1(jl      ,:,:) = zt4we(:,jl,:,1,2) 
     1209            ptab1(iihom+jl,:,:) = zt4ew(:,jl,:,1,2) 
     1210            ptab2(jl      ,:,:) = zt4we(:,jl,:,2,2) 
     1211            ptab2(iihom+jl,:,:) = zt4ew(:,jl,:,2,2) 
    12261212         END DO 
    12271213      CASE ( 1 ) 
    12281214         DO jl = 1, jpreci 
    1229             ptab1(jl      ,:,:) = t4we(:,jl,:,1,2) 
    1230             ptab2(jl      ,:,:) = t4we(:,jl,:,2,2) 
     1215            ptab1(jl      ,:,:) = zt4we(:,jl,:,1,2) 
     1216            ptab2(jl      ,:,:) = zt4we(:,jl,:,2,2) 
    12311217         END DO 
    12321218      END SELECT 
     
    12401226         ijhom = nlcj - nrecj 
    12411227         DO jl = 1, jprecj 
    1242             t4sn(:,jl,:,1,1) = ptab1(:,ijhom +jl,:) 
    1243             t4ns(:,jl,:,1,1) = ptab1(:,jprecj+jl,:) 
    1244             t4sn(:,jl,:,2,1) = ptab2(:,ijhom +jl,:) 
    1245             t4ns(:,jl,:,2,1) = ptab2(:,jprecj+jl,:) 
     1228            zt4sn(:,jl,:,1,1) = ptab1(:,ijhom +jl,:) 
     1229            zt4ns(:,jl,:,1,1) = ptab1(:,jprecj+jl,:) 
     1230            zt4sn(:,jl,:,2,1) = ptab2(:,ijhom +jl,:) 
     1231            zt4ns(:,jl,:,2,1) = ptab2(:,jprecj+jl,:) 
    12461232         END DO 
    12471233      ENDIF 
     
    12521238      SELECT CASE ( nbondj ) 
    12531239      CASE ( -1 ) 
    1254          CALL mppsend( 4, t4sn(1,1,1,1,1), imigr, nono, ml_req1 ) 
    1255          CALL mpprecv( 3, t4ns(1,1,1,1,2), imigr, nono ) 
     1240         CALL mppsend( 4, zt4sn(1,1,1,1,1), imigr, nono, ml_req1 ) 
     1241         CALL mpprecv( 3, zt4ns(1,1,1,1,2), imigr, nono ) 
    12561242         IF(l_isend) CALL mpi_wait(ml_req1, ml_stat, ml_err) 
    12571243      CASE ( 0 ) 
    1258          CALL mppsend( 3, t4ns(1,1,1,1,1), imigr, noso, ml_req1 ) 
    1259          CALL mppsend( 4, t4sn(1,1,1,1,1), imigr, nono, ml_req2 ) 
    1260          CALL mpprecv( 3, t4ns(1,1,1,1,2), imigr, nono ) 
    1261          CALL mpprecv( 4, t4sn(1,1,1,1,2), imigr, noso ) 
     1244         CALL mppsend( 3, zt4ns(1,1,1,1,1), imigr, noso, ml_req1 ) 
     1245         CALL mppsend( 4, zt4sn(1,1,1,1,1), imigr, nono, ml_req2 ) 
     1246         CALL mpprecv( 3, zt4ns(1,1,1,1,2), imigr, nono ) 
     1247         CALL mpprecv( 4, zt4sn(1,1,1,1,2), imigr, noso ) 
    12621248         IF(l_isend) CALL mpi_wait(ml_req1, ml_stat, ml_err) 
    12631249         IF(l_isend) CALL mpi_wait(ml_req2, ml_stat, ml_err) 
    12641250      CASE ( 1 ) 
    1265          CALL mppsend( 3, t4ns(1,1,1,1,1), imigr, noso, ml_req1 ) 
    1266          CALL mpprecv( 4, t4sn(1,1,1,1,2), imigr, noso ) 
     1251         CALL mppsend( 3, zt4ns(1,1,1,1,1), imigr, noso, ml_req1 ) 
     1252         CALL mpprecv( 4, zt4sn(1,1,1,1,2), imigr, noso ) 
    12671253         IF(l_isend) CALL mpi_wait(ml_req1, ml_stat, ml_err) 
    12681254      END SELECT 
     
    12741260      CASE ( -1 ) 
    12751261         DO jl = 1, jprecj 
    1276             ptab1(:,ijhom+jl,:) = t4ns(:,jl,:,1,2) 
    1277             ptab2(:,ijhom+jl,:) = t4ns(:,jl,:,2,2) 
     1262            ptab1(:,ijhom+jl,:) = zt4ns(:,jl,:,1,2) 
     1263            ptab2(:,ijhom+jl,:) = zt4ns(:,jl,:,2,2) 
    12781264         END DO 
    12791265      CASE ( 0 ) 
    12801266         DO jl = 1, jprecj 
    1281             ptab1(:,jl      ,:) = t4sn(:,jl,:,1,2) 
    1282             ptab1(:,ijhom+jl,:) = t4ns(:,jl,:,1,2) 
    1283             ptab2(:,jl      ,:) = t4sn(:,jl,:,2,2) 
    1284             ptab2(:,ijhom+jl,:) = t4ns(:,jl,:,2,2) 
     1267            ptab1(:,jl      ,:) = zt4sn(:,jl,:,1,2) 
     1268            ptab1(:,ijhom+jl,:) = zt4ns(:,jl,:,1,2) 
     1269            ptab2(:,jl      ,:) = zt4sn(:,jl,:,2,2) 
     1270            ptab2(:,ijhom+jl,:) = zt4ns(:,jl,:,2,2) 
    12851271         END DO 
    12861272      CASE ( 1 ) 
    12871273         DO jl = 1, jprecj 
    1288             ptab1(:,jl,:) = t4sn(:,jl,:,1,2) 
    1289             ptab2(:,jl,:) = t4sn(:,jl,:,2,2) 
     1274            ptab1(:,jl,:) = zt4sn(:,jl,:,1,2) 
     1275            ptab2(:,jl,:) = zt4sn(:,jl,:,2,2) 
    12901276         END DO 
    12911277      END SELECT 
     
    13061292         ! 
    13071293      ENDIF 
     1294      ! 
     1295      DEALLOCATE( zt4ns, zt4sn, zt4ew, zt4we ) 
    13081296      ! 
    13091297   END SUBROUTINE mpp_lnk_3d_gather 
     
    21582146      INTEGER ::   ml_stat(MPI_STATUS_SIZE)    ! for key_mpi_isend 
    21592147      REAL(wp), POINTER, DIMENSION(:,:) ::   ztab   ! temporary workspace 
     2148      ! 
     2149      REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::  zt2ns, zt2sn   ! 2d for north-south & south-north 
     2150      REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::  zt2ew, zt2we   ! 2d for east-west & west-east 
    21602151      LOGICAL :: lmigr ! is true for those processors that have to migrate the OB 
    2161       !!---------------------------------------------------------------------- 
     2152 
     2153      !!---------------------------------------------------------------------- 
     2154 
     2155      ALLOCATE( zt2ns(jpi,jprecj,2), zt2sn(jpi,jprecj,2),   & 
     2156         &      zt2ew(jpj,jpreci,2), zt2we(jpj,jpreci,2)   ) 
    21622157 
    21632158      CALL wrk_alloc( jpi,jpj, ztab ) 
     
    22232218         IF( nbondi /= 2 ) THEN         ! Read Dirichlet lateral conditions 
    22242219            iihom = nlci-nreci 
    2225             t2ew(1:jpreci,1,1) = ztab(jpreci+1:nreci, ijpt0) 
    2226             t2we(1:jpreci,1,1) = ztab(iihom+1:iihom+jpreci, ijpt0) 
     2220            zt2ew(1:jpreci,1,1) = ztab(jpreci+1:nreci, ijpt0) 
     2221            zt2we(1:jpreci,1,1) = ztab(iihom+1:iihom+jpreci, ijpt0) 
    22272222         ENDIF 
    22282223         ! 
     
    22312226         ! 
    22322227         IF( nbondi == -1 ) THEN 
    2233             CALL mppsend( 2, t2we(1,1,1), imigr, noea, ml_req1 ) 
    2234             CALL mpprecv( 1, t2ew(1,1,2), imigr, noea ) 
     2228            CALL mppsend( 2, zt2we(1,1,1), imigr, noea, ml_req1 ) 
     2229            CALL mpprecv( 1, zt2ew(1,1,2), imigr, noea ) 
    22352230            IF(l_isend)   CALL mpi_wait( ml_req1, ml_stat, ml_err ) 
    22362231         ELSEIF( nbondi == 0 ) THEN 
    2237             CALL mppsend( 1, t2ew(1,1,1), imigr, nowe, ml_req1 ) 
    2238             CALL mppsend( 2, t2we(1,1,1), imigr, noea, ml_req2 ) 
    2239             CALL mpprecv( 1, t2ew(1,1,2), imigr, noea ) 
    2240             CALL mpprecv( 2, t2we(1,1,2), imigr, nowe ) 
     2232            CALL mppsend( 1, zt2ew(1,1,1), imigr, nowe, ml_req1 ) 
     2233            CALL mppsend( 2, zt2we(1,1,1), imigr, noea, ml_req2 ) 
     2234            CALL mpprecv( 1, zt2ew(1,1,2), imigr, noea ) 
     2235            CALL mpprecv( 2, zt2we(1,1,2), imigr, nowe ) 
    22412236            IF(l_isend)   CALL mpi_wait( ml_req1, ml_stat, ml_err ) 
    22422237            IF(l_isend)   CALL mpi_wait( ml_req2, ml_stat, ml_err ) 
    22432238         ELSEIF( nbondi == 1 ) THEN 
    2244             CALL mppsend( 1, t2ew(1,1,1), imigr, nowe, ml_req1 ) 
    2245             CALL mpprecv( 2, t2we(1,1,2), imigr, nowe ) 
     2239            CALL mppsend( 1, zt2ew(1,1,1), imigr, nowe, ml_req1 ) 
     2240            CALL mpprecv( 2, zt2we(1,1,2), imigr, nowe ) 
    22462241            IF(l_isend) CALL mpi_wait( ml_req1, ml_stat, ml_err ) 
    22472242         ENDIF 
     
    22512246         ! 
    22522247         IF( nbondi == 0 .OR. nbondi == 1 ) THEN 
    2253             ztab(1:jpreci, ijpt0) = t2we(1:jpreci,1,2) 
     2248            ztab(1:jpreci, ijpt0) = zt2we(1:jpreci,1,2) 
    22542249         ENDIF 
    22552250         IF( nbondi == -1 .OR. nbondi == 0 ) THEN 
    2256             ztab(iihom+1:iihom+jpreci, ijpt0) = t2ew(1:jpreci,1,2) 
     2251            ztab(iihom+1:iihom+jpreci, ijpt0) = zt2ew(1:jpreci,1,2) 
    22572252         ENDIF 
    22582253       ENDIF  ! (ktype == 1) 
     
    22642259         IF( nbondj /= 2 ) THEN         ! Read Dirichlet lateral conditions 
    22652260            ijhom = nlcj-nrecj 
    2266             t2sn(1:jprecj,1,1) = ztab(iipt0, ijhom+1:ijhom+jprecj) 
    2267             t2ns(1:jprecj,1,1) = ztab(iipt0, jprecj+1:nrecj) 
     2261            zt2sn(1:jprecj,1,1) = ztab(iipt0, ijhom+1:ijhom+jprecj) 
     2262            zt2ns(1:jprecj,1,1) = ztab(iipt0, jprecj+1:nrecj) 
    22682263         ENDIF 
    22692264         ! 
     
    22722267         ! 
    22732268         IF( nbondj == -1 ) THEN 
    2274             CALL mppsend( 4, t2sn(1,1,1), imigr, nono, ml_req1 ) 
    2275             CALL mpprecv( 3, t2ns(1,1,2), imigr, nono ) 
     2269            CALL mppsend( 4, zt2sn(1,1,1), imigr, nono, ml_req1 ) 
     2270            CALL mpprecv( 3, zt2ns(1,1,2), imigr, nono ) 
    22762271            IF(l_isend) CALL mpi_wait( ml_req1, ml_stat, ml_err ) 
    22772272         ELSEIF( nbondj == 0 ) THEN 
    2278             CALL mppsend( 3, t2ns(1,1,1), imigr, noso, ml_req1 ) 
    2279             CALL mppsend( 4, t2sn(1,1,1), imigr, nono, ml_req2 ) 
    2280             CALL mpprecv( 3, t2ns(1,1,2), imigr, nono ) 
    2281             CALL mpprecv( 4, t2sn(1,1,2), imigr, noso ) 
     2273            CALL mppsend( 3, zt2ns(1,1,1), imigr, noso, ml_req1 ) 
     2274            CALL mppsend( 4, zt2sn(1,1,1), imigr, nono, ml_req2 ) 
     2275            CALL mpprecv( 3, zt2ns(1,1,2), imigr, nono ) 
     2276            CALL mpprecv( 4, zt2sn(1,1,2), imigr, noso ) 
    22822277            IF( l_isend )   CALL mpi_wait( ml_req1, ml_stat, ml_err ) 
    22832278            IF( l_isend )   CALL mpi_wait( ml_req2, ml_stat, ml_err ) 
    22842279         ELSEIF( nbondj == 1 ) THEN 
    2285             CALL mppsend( 3, t2ns(1,1,1), imigr, noso, ml_req1 ) 
    2286             CALL mpprecv( 4, t2sn(1,1,2), imigr, noso) 
     2280            CALL mppsend( 3, zt2ns(1,1,1), imigr, noso, ml_req1 ) 
     2281            CALL mpprecv( 4, zt2sn(1,1,2), imigr, noso) 
    22872282            IF( l_isend )   CALL mpi_wait( ml_req1, ml_stat, ml_err ) 
    22882283         ENDIF 
     
    22912286         ijhom = nlcj - jprecj 
    22922287         IF( nbondj == 0 .OR. nbondj == 1 ) THEN 
    2293             ztab(iipt0,1:jprecj) = t2sn(1:jprecj,1,2) 
     2288            ztab(iipt0,1:jprecj) = zt2sn(1:jprecj,1,2) 
    22942289         ENDIF 
    22952290         IF( nbondj == 0 .OR. nbondj == -1 ) THEN 
    2296             ztab(iipt0, ijhom+1:ijhom+jprecj) = t2ns(1:jprecj,1,2) 
     2291            ztab(iipt0, ijhom+1:ijhom+jprecj) = zt2ns(1:jprecj,1,2) 
    22972292         ENDIF 
    22982293         ENDIF    ! (ktype == 2) 
     
    23142309      ! 
    23152310      ENDIF ! ( lmigr ) 
     2311      ! 
     2312      DEALLOCATE( zt2ns, zt2sn, zt2ew, zt2we ) 
    23162313      CALL wrk_dealloc( jpi,jpj, ztab ) 
    23172314      ! 
     
    26032600      INTEGER                                ::   ml_err             ! for mpi_isend when avoiding mpi_allgather 
    26042601      INTEGER, DIMENSION(MPI_STATUS_SIZE)    ::   ml_stat            ! for mpi_isend when avoiding mpi_allgather 
    2605       !!---------------------------------------------------------------------- 
    2606       ! 
     2602      !                                                              ! Workspace for message transfers avoiding mpi_allgather 
     2603      REAL(wp), DIMENSION(:,:,:)  , ALLOCATABLE   :: ztab 
     2604      REAL(wp), DIMENSION(:,:,:)  , ALLOCATABLE   :: znorthloc, zfoldwk       
     2605      REAL(wp), DIMENSION(:,:,:,:), ALLOCATABLE   :: znorthgloio 
     2606 
     2607      !!---------------------------------------------------------------------- 
     2608      ! 
     2609      ALLOCATE( ztab(jpiglo,4,jpk), znorthloc(jpi,4,jpk), zfoldwk(jpi,4,jpk), znorthgloio(jpi,4,jpk,jpni) ) 
     2610 
    26072611      ijpj   = 4 
    26082612      ityp = -1 
    26092613      ijpjm1 = 3 
    2610       tab_3d(:,:,:) = 0.e0 
    2611       ! 
    2612       DO jj = nlcj - ijpj +1, nlcj          ! put in xnorthloc the last 4 jlines of pt3d 
     2614      ztab(:,:,:) = 0.e0 
     2615      ! 
     2616      DO jj = nlcj - ijpj +1, nlcj          ! put in znorthloc the last 4 jlines of pt3d 
    26132617         ij = jj - nlcj + ijpj 
    2614          xnorthloc(:,ij,:) = pt3d(:,jj,:) 
     2618         znorthloc(:,ij,:) = pt3d(:,jj,:) 
    26152619      END DO 
    26162620      ! 
    2617       !                                     ! Build in procs of ncomm_north the xnorthgloio 
     2621      !                                     ! Build in procs of ncomm_north the znorthgloio 
    26182622      itaille = jpi * jpk * ijpj 
    26192623      IF ( l_north_nogather ) THEN 
     
    26252629            ij = jj - nlcj + ijpj 
    26262630            DO ji = 1, nlci 
    2627                tab_3d(ji+nimpp-1,ij,:) = pt3d(ji,jj,:) 
     2631               ztab(ji+nimpp-1,ij,:) = pt3d(ji,jj,:) 
    26282632            END DO 
    26292633         END DO 
     
    26502654 
    26512655            DO jr = 1,nsndto(ityp) 
    2652                CALL mppsend(5, xnorthloc, itaille, isendto(jr,ityp), ml_req_nf(jr) ) 
     2656               CALL mppsend(5, znorthloc, itaille, isendto(jr,ityp), ml_req_nf(jr) ) 
    26532657            END DO 
    26542658            DO jr = 1,nsndto(ityp) 
    2655                CALL mpprecv(5, foldwk, itaille, isendto(jr,ityp)) 
     2659               CALL mpprecv(5, zfoldwk, itaille, isendto(jr,ityp)) 
    26562660               iproc = isendto(jr,ityp) + 1 
    26572661               ildi = nldit (iproc) 
     
    26602664               DO jj = 1, ijpj 
    26612665                  DO ji = ildi, ilei 
    2662                      tab_3d(ji+iilb-1,jj,:) = foldwk(ji,jj,:) 
     2666                     ztab(ji+iilb-1,jj,:) = zfoldwk(ji,jj,:) 
    26632667                  END DO 
    26642668               END DO 
     
    26752679 
    26762680      IF ( ityp .lt. 0 ) THEN 
    2677          CALL MPI_ALLGATHER( xnorthloc  , itaille, MPI_DOUBLE_PRECISION,                & 
    2678             &                xnorthgloio, itaille, MPI_DOUBLE_PRECISION, ncomm_north, ierr ) 
     2681         CALL MPI_ALLGATHER( znorthloc  , itaille, MPI_DOUBLE_PRECISION,                & 
     2682            &                znorthgloio, itaille, MPI_DOUBLE_PRECISION, ncomm_north, ierr ) 
    26792683         ! 
    26802684         DO jr = 1, ndim_rank_north         ! recover the global north array 
     
    26852689            DO jj = 1, ijpj 
    26862690               DO ji = ildi, ilei 
    2687                   tab_3d(ji+iilb-1,jj,:) = xnorthgloio(ji,jj,:,jr) 
     2691                  ztab(ji+iilb-1,jj,:) = znorthgloio(ji,jj,:,jr) 
    26882692               END DO 
    26892693            END DO 
     
    26912695      ENDIF 
    26922696      ! 
    2693       ! The tab_3d array has been either: 
     2697      ! The ztab array has been either: 
    26942698      !  a. Fully populated by the mpi_allgather operation or 
    26952699      !  b. Had the active points for this domain and northern neighbours populated 
     
    26982702      ! this domain will be identical. 
    26992703      ! 
    2700       CALL lbc_nfd( tab_3d, cd_type, psgn )   ! North fold boundary condition 
     2704      CALL lbc_nfd( ztab, cd_type, psgn )   ! North fold boundary condition 
    27012705      ! 
    27022706      DO jj = nlcj-ijpj+1, nlcj             ! Scatter back to pt3d 
    27032707         ij = jj - nlcj + ijpj 
    27042708         DO ji= 1, nlci 
    2705             pt3d(ji,jj,:) = tab_3d(ji+nimpp-1,ij,:) 
     2709            pt3d(ji,jj,:) = ztab(ji+nimpp-1,ij,:) 
    27062710         END DO 
    27072711      END DO 
     2712      ! 
     2713      DEALLOCATE( ztab, znorthloc, zfoldwk, znorthgloio ) 
    27082714      ! 
    27092715   END SUBROUTINE mpp_lbc_north_3d 
     
    27352741      INTEGER                            ::   ml_err             ! for mpi_isend when avoiding mpi_allgather 
    27362742      INTEGER, DIMENSION(MPI_STATUS_SIZE)::   ml_stat            ! for mpi_isend when avoiding mpi_allgather 
    2737       !!---------------------------------------------------------------------- 
     2743      !                                                              ! Workspace for message transfers avoiding mpi_allgather 
     2744      REAL(wp), DIMENSION(:,:)  , ALLOCATABLE   :: ztab 
     2745      REAL(wp), DIMENSION(:,:)  , ALLOCATABLE   :: znorthloc, zfoldwk       
     2746      REAL(wp), DIMENSION(:,:,:), ALLOCATABLE   :: znorthgloio 
     2747      !!---------------------------------------------------------------------- 
     2748      ! 
     2749      ALLOCATE( ztab(jpiglo,4), znorthloc(jpi,4), zfoldwk(jpi,4), znorthgloio(jpi,4,jpni) ) 
    27382750      ! 
    27392751      ijpj   = 4 
    27402752      ityp = -1 
    27412753      ijpjm1 = 3 
    2742       tab_2d(:,:) = 0.e0 
    2743       ! 
    2744       DO jj = nlcj-ijpj+1, nlcj             ! put in xnorthloc_2d the last 4 jlines of pt2d 
     2754      ztab(:,:) = 0.e0 
     2755      ! 
     2756      DO jj = nlcj-ijpj+1, nlcj             ! put in znorthloc the last 4 jlines of pt2d 
    27452757         ij = jj - nlcj + ijpj 
    2746          xnorthloc_2d(:,ij) = pt2d(:,jj) 
     2758         znorthloc(:,ij) = pt2d(:,jj) 
    27472759      END DO 
    27482760 
    2749       !                                     ! Build in procs of ncomm_north the xnorthgloio_2d 
     2761      !                                     ! Build in procs of ncomm_north the znorthgloio 
    27502762      itaille = jpi * ijpj 
    27512763      IF ( l_north_nogather ) THEN 
     
    27572769            ij = jj - nlcj + ijpj 
    27582770            DO ji = 1, nlci 
    2759                tab_2d(ji+nimpp-1,ij) = pt2d(ji,jj) 
     2771               ztab(ji+nimpp-1,ij) = pt2d(ji,jj) 
    27602772            END DO 
    27612773         END DO 
     
    27832795 
    27842796            DO jr = 1,nsndto(ityp) 
    2785                CALL mppsend(5, xnorthloc_2d, itaille, isendto(jr,ityp), ml_req_nf(jr) ) 
     2797               CALL mppsend(5, znorthloc, itaille, isendto(jr,ityp), ml_req_nf(jr) ) 
    27862798            END DO 
    27872799            DO jr = 1,nsndto(ityp) 
    2788                CALL mpprecv(5, foldwk_2d, itaille, isendto(jr,ityp)) 
     2800               CALL mpprecv(5, zfoldwk, itaille, isendto(jr,ityp)) 
    27892801               iproc = isendto(jr,ityp) + 1 
    27902802               ildi = nldit (iproc) 
     
    27932805               DO jj = 1, ijpj 
    27942806                  DO ji = ildi, ilei 
    2795                      tab_2d(ji+iilb-1,jj) = foldwk_2d(ji,jj) 
     2807                     ztab(ji+iilb-1,jj) = zfoldwk(ji,jj) 
    27962808                  END DO 
    27972809               END DO 
     
    28082820 
    28092821      IF ( ityp .lt. 0 ) THEN 
    2810          CALL MPI_ALLGATHER( xnorthloc_2d  , itaille, MPI_DOUBLE_PRECISION,        & 
    2811             &                xnorthgloio_2d, itaille, MPI_DOUBLE_PRECISION, ncomm_north, ierr ) 
     2822         CALL MPI_ALLGATHER( znorthloc  , itaille, MPI_DOUBLE_PRECISION,        & 
     2823            &                znorthgloio, itaille, MPI_DOUBLE_PRECISION, ncomm_north, ierr ) 
    28122824         ! 
    28132825         DO jr = 1, ndim_rank_north            ! recover the global north array 
     
    28182830            DO jj = 1, ijpj 
    28192831               DO ji = ildi, ilei 
    2820                   tab_2d(ji+iilb-1,jj) = xnorthgloio_2d(ji,jj,jr) 
     2832                  ztab(ji+iilb-1,jj) = znorthgloio(ji,jj,jr) 
    28212833               END DO 
    28222834            END DO 
     
    28242836      ENDIF 
    28252837      ! 
    2826       ! The tab array has been either: 
     2838      ! The ztab array has been either: 
    28272839      !  a. Fully populated by the mpi_allgather operation or 
    28282840      !  b. Had the active points for this domain and northern neighbours populated 
     
    28312843      ! this domain will be identical. 
    28322844      ! 
    2833       CALL lbc_nfd( tab_2d, cd_type, psgn )   ! North fold boundary condition 
     2845      CALL lbc_nfd( ztab, cd_type, psgn )   ! North fold boundary condition 
    28342846      ! 
    28352847      ! 
     
    28372849         ij = jj - nlcj + ijpj 
    28382850         DO ji = 1, nlci 
    2839             pt2d(ji,jj) = tab_2d(ji+nimpp-1,ij) 
     2851            pt2d(ji,jj) = ztab(ji+nimpp-1,ij) 
    28402852         END DO 
    28412853      END DO 
     2854      ! 
     2855      DEALLOCATE( ztab, znorthloc, zfoldwk, znorthgloio ) 
    28422856      ! 
    28432857   END SUBROUTINE mpp_lbc_north_2d 
     
    28672881      INTEGER ::   ierr, itaille, ildi, ilei, iilb 
    28682882      INTEGER ::   ijpj, ij, iproc 
    2869       !!---------------------------------------------------------------------- 
     2883      ! 
     2884      REAL(wp), DIMENSION(:,:)  , ALLOCATABLE  ::  ztab_e, znorthloc_e 
     2885      REAL(wp), DIMENSION(:,:,:), ALLOCATABLE  ::  znorthgloio_e 
     2886 
     2887      !!---------------------------------------------------------------------- 
     2888      ! 
     2889      ALLOCATE( ztab_e(jpiglo,4+2*jpr2dj), znorthloc_e(jpi,4+2*jpr2dj), znorthgloio_e(jpi,4+2*jpr2dj,jpni) ) 
     2890 
    28702891      ! 
    28712892      ijpj=4 
    2872       tab_e(:,:) = 0.e0 
     2893      ztab_e(:,:) = 0.e0 
    28732894 
    28742895      ij=0 
    2875       ! put in xnorthloc_e the last 4 jlines of pt2d 
     2896      ! put in znorthloc_e the last 4 jlines of pt2d 
    28762897      DO jj = nlcj - ijpj + 1 - jpr2dj, nlcj +jpr2dj 
    28772898         ij = ij + 1 
    28782899         DO ji = 1, jpi 
    2879             xnorthloc_e(ji,ij)=pt2d(ji,jj) 
     2900            znorthloc_e(ji,ij)=pt2d(ji,jj) 
    28802901         END DO 
    28812902      END DO 
    28822903      ! 
    28832904      itaille = jpi * ( ijpj + 2 * jpr2dj ) 
    2884       CALL MPI_ALLGATHER( xnorthloc_e(1,1)  , itaille, MPI_DOUBLE_PRECISION,    & 
    2885          &                xnorthgloio_e(1,1,1), itaille, MPI_DOUBLE_PRECISION, ncomm_north, ierr ) 
     2905      CALL MPI_ALLGATHER( znorthloc_e(1,1)  , itaille, MPI_DOUBLE_PRECISION,    & 
     2906         &                znorthgloio_e(1,1,1), itaille, MPI_DOUBLE_PRECISION, ncomm_north, ierr ) 
    28862907      ! 
    28872908      DO jr = 1, ndim_rank_north            ! recover the global north array 
     
    28922913         DO jj = 1, ijpj+2*jpr2dj 
    28932914            DO ji = ildi, ilei 
    2894                tab_e(ji+iilb-1,jj) = xnorthgloio_e(ji,jj,jr) 
     2915               ztab_e(ji+iilb-1,jj) = znorthgloio_e(ji,jj,jr) 
    28952916            END DO 
    28962917         END DO 
     
    29002921      ! 2. North-Fold boundary conditions 
    29012922      ! ---------------------------------- 
    2902       CALL lbc_nfd( tab_e(:,:), cd_type, psgn, pr2dj = jpr2dj ) 
     2923      CALL lbc_nfd( ztab_e(:,:), cd_type, psgn, pr2dj = jpr2dj ) 
    29032924 
    29042925      ij = jpr2dj 
     
    29072928      ij  = ij +1 
    29082929         DO ji= 1, nlci 
    2909             pt2d(ji,jj) = tab_e(ji+nimpp-1,ij) 
     2930            pt2d(ji,jj) = ztab_e(ji+nimpp-1,ij) 
    29102931         END DO 
    29112932      END DO 
     2933      ! 
     2934      DEALLOCATE( ztab_e, znorthloc_e, znorthgloio_e ) 
    29122935      ! 
    29132936   END SUBROUTINE mpp_lbc_north_e 
     
    29502973      REAL(wp) ::   zland 
    29512974      INTEGER, DIMENSION(MPI_STATUS_SIZE) ::   ml_stat   ! for key_mpi_isend 
    2952       !!---------------------------------------------------------------------- 
     2975      ! 
     2976      REAL(wp), DIMENSION(:,:,:,:), ALLOCATABLE ::   zt3ns, zt3sn   ! 3d for north-south & south-north 
     2977      REAL(wp), DIMENSION(:,:,:,:), ALLOCATABLE ::   zt3ew, zt3we   ! 3d for east-west & west-east 
     2978 
     2979      !!---------------------------------------------------------------------- 
     2980       
     2981      ALLOCATE( zt3ns(jpi,jprecj,jpk,2), zt3sn(jpi,jprecj,jpk,2),   & 
     2982         &      zt3ew(jpj,jpreci,jpk,2), zt3we(jpj,jpreci,jpk,2)  ) 
    29532983 
    29542984      zland = 0.e0 
     
    29903020         iihom = nlci-nreci 
    29913021         DO jl = 1, jpreci 
    2992             t3ew(:,jl,:,1) = ptab(jpreci+jl,:,:) 
    2993             t3we(:,jl,:,1) = ptab(iihom +jl,:,:) 
     3022            zt3ew(:,jl,:,1) = ptab(jpreci+jl,:,:) 
     3023            zt3we(:,jl,:,1) = ptab(iihom +jl,:,:) 
    29943024         END DO 
    29953025      END SELECT 
     
    30003030      SELECT CASE ( nbondi_bdy(ib_bdy) ) 
    30013031      CASE ( -1 ) 
    3002          CALL mppsend( 2, t3we(1,1,1,1), imigr, noea, ml_req1 ) 
    3003       CASE ( 0 ) 
    3004          CALL mppsend( 1, t3ew(1,1,1,1), imigr, nowe, ml_req1 ) 
    3005          CALL mppsend( 2, t3we(1,1,1,1), imigr, noea, ml_req2 ) 
     3032         CALL mppsend( 2, zt3we(1,1,1,1), imigr, noea, ml_req1 ) 
     3033      CASE ( 0 ) 
     3034         CALL mppsend( 1, zt3ew(1,1,1,1), imigr, nowe, ml_req1 ) 
     3035         CALL mppsend( 2, zt3we(1,1,1,1), imigr, noea, ml_req2 ) 
    30063036      CASE ( 1 ) 
    3007          CALL mppsend( 1, t3ew(1,1,1,1), imigr, nowe, ml_req1 ) 
     3037         CALL mppsend( 1, zt3ew(1,1,1,1), imigr, nowe, ml_req1 ) 
    30083038      END SELECT 
    30093039      ! 
    30103040      SELECT CASE ( nbondi_bdy_b(ib_bdy) ) 
    30113041      CASE ( -1 ) 
    3012          CALL mpprecv( 1, t3ew(1,1,1,2), imigr, noea ) 
    3013       CASE ( 0 ) 
    3014          CALL mpprecv( 1, t3ew(1,1,1,2), imigr, noea ) 
    3015          CALL mpprecv( 2, t3we(1,1,1,2), imigr, nowe ) 
     3042         CALL mpprecv( 1, zt3ew(1,1,1,2), imigr, noea ) 
     3043      CASE ( 0 ) 
     3044         CALL mpprecv( 1, zt3ew(1,1,1,2), imigr, noea ) 
     3045         CALL mpprecv( 2, zt3we(1,1,1,2), imigr, nowe ) 
    30163046      CASE ( 1 ) 
    3017          CALL mpprecv( 2, t3we(1,1,1,2), imigr, nowe ) 
     3047         CALL mpprecv( 2, zt3we(1,1,1,2), imigr, nowe ) 
    30183048      END SELECT 
    30193049      ! 
     
    30343064      CASE ( -1 ) 
    30353065         DO jl = 1, jpreci 
    3036             ptab(iihom+jl,:,:) = t3ew(:,jl,:,2) 
     3066            ptab(iihom+jl,:,:) = zt3ew(:,jl,:,2) 
    30373067         END DO 
    30383068      CASE ( 0 ) 
    30393069         DO jl = 1, jpreci 
    3040             ptab(jl      ,:,:) = t3we(:,jl,:,2) 
    3041             ptab(iihom+jl,:,:) = t3ew(:,jl,:,2) 
     3070            ptab(jl      ,:,:) = zt3we(:,jl,:,2) 
     3071            ptab(iihom+jl,:,:) = zt3ew(:,jl,:,2) 
    30423072         END DO 
    30433073      CASE ( 1 ) 
    30443074         DO jl = 1, jpreci 
    3045             ptab(jl      ,:,:) = t3we(:,jl,:,2) 
     3075            ptab(jl      ,:,:) = zt3we(:,jl,:,2) 
    30463076         END DO 
    30473077      END SELECT 
     
    30553085         ijhom = nlcj-nrecj 
    30563086         DO jl = 1, jprecj 
    3057             t3sn(:,jl,:,1) = ptab(:,ijhom +jl,:) 
    3058             t3ns(:,jl,:,1) = ptab(:,jprecj+jl,:) 
     3087            zt3sn(:,jl,:,1) = ptab(:,ijhom +jl,:) 
     3088            zt3ns(:,jl,:,1) = ptab(:,jprecj+jl,:) 
    30593089         END DO 
    30603090      ENDIF 
     
    30653095      SELECT CASE ( nbondj_bdy(ib_bdy) ) 
    30663096      CASE ( -1 ) 
    3067          CALL mppsend( 4, t3sn(1,1,1,1), imigr, nono, ml_req1 ) 
    3068       CASE ( 0 ) 
    3069          CALL mppsend( 3, t3ns(1,1,1,1), imigr, noso, ml_req1 ) 
    3070          CALL mppsend( 4, t3sn(1,1,1,1), imigr, nono, ml_req2 ) 
     3097         CALL mppsend( 4, zt3sn(1,1,1,1), imigr, nono, ml_req1 ) 
     3098      CASE ( 0 ) 
     3099         CALL mppsend( 3, zt3ns(1,1,1,1), imigr, noso, ml_req1 ) 
     3100         CALL mppsend( 4, zt3sn(1,1,1,1), imigr, nono, ml_req2 ) 
    30713101      CASE ( 1 ) 
    3072          CALL mppsend( 3, t3ns(1,1,1,1), imigr, noso, ml_req1 ) 
     3102         CALL mppsend( 3, zt3ns(1,1,1,1), imigr, noso, ml_req1 ) 
    30733103      END SELECT 
    30743104      ! 
    30753105      SELECT CASE ( nbondj_bdy_b(ib_bdy) ) 
    30763106      CASE ( -1 ) 
    3077          CALL mpprecv( 3, t3ns(1,1,1,2), imigr, nono ) 
    3078       CASE ( 0 ) 
    3079          CALL mpprecv( 3, t3ns(1,1,1,2), imigr, nono ) 
    3080          CALL mpprecv( 4, t3sn(1,1,1,2), imigr, noso ) 
     3107         CALL mpprecv( 3, zt3ns(1,1,1,2), imigr, nono ) 
     3108      CASE ( 0 ) 
     3109         CALL mpprecv( 3, zt3ns(1,1,1,2), imigr, nono ) 
     3110         CALL mpprecv( 4, zt3sn(1,1,1,2), imigr, noso ) 
    30813111      CASE ( 1 ) 
    3082          CALL mpprecv( 4, t3sn(1,1,1,2), imigr, noso ) 
     3112         CALL mpprecv( 4, zt3sn(1,1,1,2), imigr, noso ) 
    30833113      END SELECT 
    30843114      ! 
     
    30993129      CASE ( -1 ) 
    31003130         DO jl = 1, jprecj 
    3101             ptab(:,ijhom+jl,:) = t3ns(:,jl,:,2) 
     3131            ptab(:,ijhom+jl,:) = zt3ns(:,jl,:,2) 
    31023132         END DO 
    31033133      CASE ( 0 ) 
    31043134         DO jl = 1, jprecj 
    3105             ptab(:,jl      ,:) = t3sn(:,jl,:,2) 
    3106             ptab(:,ijhom+jl,:) = t3ns(:,jl,:,2) 
     3135            ptab(:,jl      ,:) = zt3sn(:,jl,:,2) 
     3136            ptab(:,ijhom+jl,:) = zt3ns(:,jl,:,2) 
    31073137         END DO 
    31083138      CASE ( 1 ) 
    31093139         DO jl = 1, jprecj 
    3110             ptab(:,jl,:) = t3sn(:,jl,:,2) 
     3140            ptab(:,jl,:) = zt3sn(:,jl,:,2) 
    31113141         END DO 
    31123142      END SELECT 
     
    31243154         ! 
    31253155      ENDIF 
     3156      ! 
     3157      DEALLOCATE( zt3ns, zt3sn, zt3ew, zt3we  ) 
    31263158      ! 
    31273159   END SUBROUTINE mpp_lnk_bdy_3d 
     
    31643196      REAL(wp) ::   zland 
    31653197      INTEGER, DIMENSION(MPI_STATUS_SIZE) ::   ml_stat   ! for key_mpi_isend 
    3166       !!---------------------------------------------------------------------- 
     3198      ! 
     3199      REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::  zt2ns, zt2sn   ! 2d for north-south & south-north 
     3200      REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::  zt2ew, zt2we   ! 2d for east-west & west-east 
     3201 
     3202      !!---------------------------------------------------------------------- 
     3203 
     3204      ALLOCATE( zt2ns(jpi,jprecj,2), zt2sn(jpi,jprecj,2),  & 
     3205         &      zt2ew(jpj,jpreci,2), zt2we(jpj,jpreci,2)   ) 
    31673206 
    31683207      zland = 0.e0 
     
    32043243         iihom = nlci-nreci 
    32053244         DO jl = 1, jpreci 
    3206             t2ew(:,jl,1) = ptab(jpreci+jl,:) 
    3207             t2we(:,jl,1) = ptab(iihom +jl,:) 
     3245            zt2ew(:,jl,1) = ptab(jpreci+jl,:) 
     3246            zt2we(:,jl,1) = ptab(iihom +jl,:) 
    32083247         END DO 
    32093248      END SELECT 
     
    32143253      SELECT CASE ( nbondi_bdy(ib_bdy) ) 
    32153254      CASE ( -1 ) 
    3216          CALL mppsend( 2, t2we(1,1,1), imigr, noea, ml_req1 ) 
    3217       CASE ( 0 ) 
    3218          CALL mppsend( 1, t2ew(1,1,1), imigr, nowe, ml_req1 ) 
    3219          CALL mppsend( 2, t2we(1,1,1), imigr, noea, ml_req2 ) 
     3255         CALL mppsend( 2, zt2we(1,1,1), imigr, noea, ml_req1 ) 
     3256      CASE ( 0 ) 
     3257         CALL mppsend( 1, zt2ew(1,1,1), imigr, nowe, ml_req1 ) 
     3258         CALL mppsend( 2, zt2we(1,1,1), imigr, noea, ml_req2 ) 
    32203259      CASE ( 1 ) 
    3221          CALL mppsend( 1, t2ew(1,1,1), imigr, nowe, ml_req1 ) 
     3260         CALL mppsend( 1, zt2ew(1,1,1), imigr, nowe, ml_req1 ) 
    32223261      END SELECT 
    32233262      ! 
    32243263      SELECT CASE ( nbondi_bdy_b(ib_bdy) ) 
    32253264      CASE ( -1 ) 
    3226          CALL mpprecv( 1, t2ew(1,1,2), imigr, noea ) 
    3227       CASE ( 0 ) 
    3228          CALL mpprecv( 1, t2ew(1,1,2), imigr, noea ) 
    3229          CALL mpprecv( 2, t2we(1,1,2), imigr, nowe ) 
     3265         CALL mpprecv( 1, zt2ew(1,1,2), imigr, noea ) 
     3266      CASE ( 0 ) 
     3267         CALL mpprecv( 1, zt2ew(1,1,2), imigr, noea ) 
     3268         CALL mpprecv( 2, zt2we(1,1,2), imigr, nowe ) 
    32303269      CASE ( 1 ) 
    3231          CALL mpprecv( 2, t2we(1,1,2), imigr, nowe ) 
     3270         CALL mpprecv( 2, zt2we(1,1,2), imigr, nowe ) 
    32323271      END SELECT 
    32333272      ! 
     
    32483287      CASE ( -1 ) 
    32493288         DO jl = 1, jpreci 
    3250             ptab(iihom+jl,:) = t2ew(:,jl,2) 
     3289            ptab(iihom+jl,:) = zt2ew(:,jl,2) 
    32513290         END DO 
    32523291      CASE ( 0 ) 
    32533292         DO jl = 1, jpreci 
    3254             ptab(jl      ,:) = t2we(:,jl,2) 
    3255             ptab(iihom+jl,:) = t2ew(:,jl,2) 
     3293            ptab(jl      ,:) = zt2we(:,jl,2) 
     3294            ptab(iihom+jl,:) = zt2ew(:,jl,2) 
    32563295         END DO 
    32573296      CASE ( 1 ) 
    32583297         DO jl = 1, jpreci 
    3259             ptab(jl      ,:) = t2we(:,jl,2) 
     3298            ptab(jl      ,:) = zt2we(:,jl,2) 
    32603299         END DO 
    32613300      END SELECT 
     
    32693308         ijhom = nlcj-nrecj 
    32703309         DO jl = 1, jprecj 
    3271             t2sn(:,jl,1) = ptab(:,ijhom +jl) 
    3272             t2ns(:,jl,1) = ptab(:,jprecj+jl) 
     3310            zt2sn(:,jl,1) = ptab(:,ijhom +jl) 
     3311            zt2ns(:,jl,1) = ptab(:,jprecj+jl) 
    32733312         END DO 
    32743313      ENDIF 
     
    32793318      SELECT CASE ( nbondj_bdy(ib_bdy) ) 
    32803319      CASE ( -1 ) 
    3281          CALL mppsend( 4, t2sn(1,1,1), imigr, nono, ml_req1 ) 
    3282       CASE ( 0 ) 
    3283          CALL mppsend( 3, t2ns(1,1,1), imigr, noso, ml_req1 ) 
    3284          CALL mppsend( 4, t2sn(1,1,1), imigr, nono, ml_req2 ) 
     3320         CALL mppsend( 4, zt2sn(1,1,1), imigr, nono, ml_req1 ) 
     3321      CASE ( 0 ) 
     3322         CALL mppsend( 3, zt2ns(1,1,1), imigr, noso, ml_req1 ) 
     3323         CALL mppsend( 4, zt2sn(1,1,1), imigr, nono, ml_req2 ) 
    32853324      CASE ( 1 ) 
    3286          CALL mppsend( 3, t2ns(1,1,1), imigr, noso, ml_req1 ) 
     3325         CALL mppsend( 3, zt2ns(1,1,1), imigr, noso, ml_req1 ) 
    32873326      END SELECT 
    32883327      ! 
    32893328      SELECT CASE ( nbondj_bdy_b(ib_bdy) ) 
    32903329      CASE ( -1 ) 
    3291          CALL mpprecv( 3, t2ns(1,1,2), imigr, nono ) 
    3292       CASE ( 0 ) 
    3293          CALL mpprecv( 3, t2ns(1,1,2), imigr, nono ) 
    3294          CALL mpprecv( 4, t2sn(1,1,2), imigr, noso ) 
     3330         CALL mpprecv( 3, zt2ns(1,1,2), imigr, nono ) 
     3331      CASE ( 0 ) 
     3332         CALL mpprecv( 3, zt2ns(1,1,2), imigr, nono ) 
     3333         CALL mpprecv( 4, zt2sn(1,1,2), imigr, noso ) 
    32953334      CASE ( 1 ) 
    3296          CALL mpprecv( 4, t2sn(1,1,2), imigr, noso ) 
     3335         CALL mpprecv( 4, zt2sn(1,1,2), imigr, noso ) 
    32973336      END SELECT 
    32983337      ! 
     
    33133352      CASE ( -1 ) 
    33143353         DO jl = 1, jprecj 
    3315             ptab(:,ijhom+jl) = t2ns(:,jl,2) 
     3354            ptab(:,ijhom+jl) = zt2ns(:,jl,2) 
    33163355         END DO 
    33173356      CASE ( 0 ) 
    33183357         DO jl = 1, jprecj 
    3319             ptab(:,jl      ) = t2sn(:,jl,2) 
    3320             ptab(:,ijhom+jl) = t2ns(:,jl,2) 
     3358            ptab(:,jl      ) = zt2sn(:,jl,2) 
     3359            ptab(:,ijhom+jl) = zt2ns(:,jl,2) 
    33213360         END DO 
    33223361      CASE ( 1 ) 
    33233362         DO jl = 1, jprecj 
    3324             ptab(:,jl) = t2sn(:,jl,2) 
     3363            ptab(:,jl) = zt2sn(:,jl,2) 
    33253364         END DO 
    33263365      END SELECT 
     
    33383377         ! 
    33393378      ENDIF 
     3379      ! 
     3380      DEALLOCATE( zt2ns, zt2sn, zt2ew, zt2we  ) 
    33403381      ! 
    33413382   END SUBROUTINE mpp_lnk_bdy_2d 
  • branches/2013/dev_LOCEAN_2013/NEMOGCM/NEMO/OPA_SRC/SBC/sbcmod.F90

    r4148 r4152  
    229229 
    230230      ! 
     231                          CALL sbc_ssm_init 
     232      ! 
    231233      IF( ln_ssr      )   CALL sbc_ssr_init               ! Sea-Surface Restoring initialisation 
    232234      ! 
  • branches/2013/dev_LOCEAN_2013/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfddm_substitute.h90

    r2715 r4152  
    77#if defined key_zdfddm 
    88!   'key_zdfddm' :                      avs: 3D array defined in zdfddm module 
    9 #   define   fsavs(i,j,k)   avs(i,j,k) 
     9#   define   fsavs(i,j,k)       avs(i,j,k) 
    1010#else 
    1111!   Defautl option :                     avs = avt 
    12 #   define   fsavs(i,j,k)   avt(i,j,k) 
     12#   define   fsavs(i,j,k)       avt(i,j,k) 
    1313#endif 
    1414   !!---------------------------------------------------------------------- 
  • branches/2013/dev_LOCEAN_2013/NEMOGCM/NEMO/OPA_SRC/nemogcm.F90

    r4147 r4152  
    2929   !!            3.3.1! 2011-01  (A. R. Porter, STFC Daresbury) dynamical allocation 
    3030   !!            3.4  ! 2011-11  (C. Harris) decomposition changes for running with CICE 
     31   !!                 ! 2012-05  (C. Calone, J. Simeon, G. Madec, C. Ethe) Add grid coarsening  
    3132   !!---------------------------------------------------------------------- 
    3233 
     
    8485#endif 
    8586   USE sbctide, ONLY: lk_tide 
     87   USE crsini          ! initialise grid coarsening utility 
    8688 
    8789   IMPLICIT NONE 
     
    388390                            CALL dyn_nept_init  ! simplified form of Neptune effect 
    389391 
    390       !                                     ! Ocean physics 
     392      !      
     393      IF( ln_crs        )   CALL     crs_init   ! Domain initialization of coarsened grid 
     394      ! 
     395                                ! Ocean physics 
    391396                            CALL     sbc_init   ! Forcings : surface module 
    392397      !                                         ! Vertical physics 
     
    621626      ierr = ierr + zdf_oce_alloc   ()          ! ocean vertical physics 
    622627      ! 
    623       ierr = ierr + lib_mpp_alloc   (numout)    ! mpp exchanges 
    624628      ierr = ierr + trc_oce_alloc   ()          ! shared TRC / TRA arrays 
    625629      ! 
  • branches/2013/dev_LOCEAN_2013/NEMOGCM/NEMO/OPA_SRC/oce.F90

    r3625 r4152  
    4747   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   gru , grv    !: horizontal gradient of rd at bottom u-point 
    4848 
     49   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   rke          !: kinetic energy 
     50 
    4951   !! arrays relating to embedding ice in the ocean. These arrays need to be declared  
    5052   !! even if no ice model is required. In the no ice model or traditional levitating  
     
    7981      ALLOCATE( rhd (jpi,jpj,jpk) ,                                         & 
    8082         &      rhop(jpi,jpj,jpk) ,                                         & 
     83         &      rke (jpi,jpj,jpk) ,                                         & 
    8184         &      sshb  (jpi,jpj)   , sshn  (jpi,jpj) , ssha  (jpi,jpj) ,     & 
    8285         &      sshu_b(jpi,jpj)   , sshu_n(jpi,jpj) , sshu_a(jpi,jpj) ,     & 
  • branches/2013/dev_LOCEAN_2013/NEMOGCM/NEMO/OPA_SRC/step.F90

    r4147 r4152  
    2424   !!             -   !  2010-10  (C. Ethe, G. Madec) reorganisation of initialisation phase + merge TRC-TRA 
    2525   !!            3.4  !  2011-04  (G. Madec, C. Ethe) Merge of dtatem and dtasal 
     26   !!                 !  2012-07  (J. Simeon, G. Madec. C. Ethe) Online coarsening of outputs 
    2627   !!---------------------------------------------------------------------- 
    2728 
     
    7879!      IF (lwp) Write(*,*) 'Grid Number',Agrif_Fixed(),' time step ',kstp 
    7980# if defined key_iomput 
    80       IF( Agrif_Nbstepint() == 0 )   CALL iom_swap 
     81      IF( Agrif_Nbstepint() == 0 )   CALL iom_swap( "nemo" ) 
    8182# endif 
    8283#endif 
    83  
    84                              indic = 0                ! reset to no error condition 
    85       IF( kstp == nit000 )   CALL iom_init            ! iom_put initialization (must be done after nemo_init for AGRIF+XIOS+OASIS) 
     84                             indic = 0           ! reset to no error condition 
     85      IF( kstp == nit000 ) THEN 
     86                      CALL iom_init( "nemo" )      ! iom_put initialization (must be done after nemo_init for AGRIF+XIOS+OASIS) 
     87         IF( ln_crs ) CALL iom_init( "nemo_crs" )  ! initialize context for coarse grid 
     88      ENDIF 
    8689 
    8790      IF( kstp /= nit000 )   CALL day( kstp )         ! Calendar (day was already called at nit000 in day_init) 
    88                              CALL iom_setkt( kstp - nit000 + 1 )   ! say to iom that we are at time step kstp 
     91                             CALL iom_setkt( kstp - nit000 + 1, "nemo"     )   ! say to iom that we are at time step kstp 
     92      IF( ln_crs     )       CALL iom_setkt( kstp - nit000 + 1, "nemo_crs" )   ! say to iom that we are at time step kstp 
    8993 
    9094      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     
    173177      IF( lk_diaharm )   CALL dia_harm( kstp )        ! Tidal harmonic analysis 
    174178                         CALL dia_wri( kstp )         ! ocean model: outputs 
     179      ! 
     180      IF( ln_crs     )   CALL crs_fld( kstp )         ! ocean model: online field coarsening & output 
     181 
    175182 
    176183#if defined key_top 
     
    277284      IF( lk_cpl           )   CALL sbc_cpl_snd( kstp )     ! coupled mode : field exchanges 
    278285      ! 
    279 #if defined key_iomput 
    280       IF( kstp == nitend   )   CALL xios_context_finalize() ! needed for XIOS+AGRIF 
    281 #endif 
     286      IF( kstp == nitend   )  THEN 
     287                      CALL iom_context_finalize( "nemo"     ) ! needed for XIOS+AGRIF 
     288         IF( ln_crs ) CALL iom_context_finalize( "nemo_crs" ) !  
     289      ENDIF 
    282290      ! 
    283291      IF( nn_timing == 1 .AND.  kstp == nit000  )   CALL timing_reset 
  • branches/2013/dev_LOCEAN_2013/NEMOGCM/NEMO/OPA_SRC/step_oce.F90

    r3769 r4152  
    100100   USE floats           ! floats computation               (flo_stp routine) 
    101101 
     102   USE crsfld           ! Standard output on coarse grid   (crs_fld routine) 
     103 
    102104   USE asminc           ! assimilation increments      (tra_asm_inc routine) 
    103105   !                                                   (dyn_asm_inc routine) 
  • branches/2013/dev_LOCEAN_2013/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zsms.F90

    r4148 r4152  
    7676      ENDIF 
    7777      ! 
    78       IF( ln_rsttr .AND. kt == nittrc000 )                         CALL p4z_rst( nittrc000, 'READ' )  !* read or initialize all required fields  
     78      IF( kt == nittrc000 ) THEN 
     79        ! 
     80        CALL p4z_che                              ! initialize the chemical constants 
     81        ! 
     82        IF( .NOT. ln_rsttr ) THEN  ;   CALL p4z_ph_ini   !  set PH at kt=nit000  
     83        ELSE                       ;   CALL p4z_rst( nittrc000, 'READ' )  !* read or initialize all required fields  
     84        ENDIF 
     85        ! 
     86      ENDIF 
     87      ! 
    7988      IF( ln_pisdmp .AND. MOD( kt - nn_dttrc, nn_pisdmp ) == 0 )   CALL p4z_dmp( kt )      ! Relaxation of some tracers 
    8089      ! 
     
    254263   END SUBROUTINE p4z_sms_init 
    255264 
     265   SUBROUTINE p4z_ph_ini 
     266      !!--------------------------------------------------------------------- 
     267      !!                   ***  ROUTINE p4z_ini_ph  *** 
     268      !! 
     269      !!  ** Purpose : Initialization of chemical variables of the carbon cycle 
     270      !!--------------------------------------------------------------------- 
     271      INTEGER  ::  ji, jj, jk 
     272      REAL(wp) ::  zcaralk, zbicarb, zco3 
     273      REAL(wp) ::  ztmas, ztmas1 
     274      !!--------------------------------------------------------------------- 
     275 
     276      ! Set PH from  total alkalinity, borat (???), akb3 (???) and ak23 (???) 
     277      ! -------------------------------------------------------- 
     278      DO jk = 1, jpk 
     279         DO jj = 1, jpj 
     280            DO ji = 1, jpi 
     281               ztmas   = tmask(ji,jj,jk) 
     282               ztmas1  = 1. - tmask(ji,jj,jk) 
     283               zcaralk = trn(ji,jj,jk,jptal) - borat(ji,jj,jk) / (  1. + 1.E-8 / ( rtrn + akb3(ji,jj,jk) )  ) 
     284               zco3    = ( zcaralk - trn(ji,jj,jk,jpdic) ) * ztmas + 0.5e-3 * ztmas1 
     285               zbicarb = ( 2. * trn(ji,jj,jk,jpdic) - zcaralk ) 
     286               hi(ji,jj,jk) = ( ak23(ji,jj,jk) * zbicarb / zco3 ) * ztmas + 1.e-9 * ztmas1 
     287            END DO 
     288         END DO 
     289     END DO 
     290     ! 
     291   END SUBROUTINE p4z_ph_ini 
     292 
     293 
    256294   SUBROUTINE p4z_rst( kt, cdrw ) 
    257295      !!--------------------------------------------------------------------- 
     
    282320         ELSE 
    283321!            hi(:,:,:) = 1.e-9  
    284             ! Set PH from  total alkalinity, borat (???), akb3 (???) and ak23 (???) 
    285             ! -------------------------------------------------------- 
    286             DO jk = 1, jpk 
    287                DO jj = 1, jpj 
    288                   DO ji = 1, jpi 
    289                      ztmas   = tmask(ji,jj,jk) 
    290                      ztmas1  = 1. - tmask(ji,jj,jk) 
    291                      zcaralk = trn(ji,jj,jk,jptal) - borat(ji,jj,jk) / (  1. + 1.E-8 / ( rtrn + akb3(ji,jj,jk) )  ) 
    292                      zco3    = ( zcaralk - trn(ji,jj,jk,jpdic) ) * ztmas + 0.5e-3 * ztmas1 
    293                      zbicarb = ( 2. * trn(ji,jj,jk,jpdic) - zcaralk ) 
    294                      hi(ji,jj,jk) = ( ak23(ji,jj,jk) * zbicarb / zco3 ) * ztmas + 1.e-9 * ztmas1 
    295                   END DO 
    296                END DO 
    297             END DO 
     322           CALL p4z_ph_ini 
    298323         ENDIF 
    299324         CALL iom_get( numrtr, jpdom_autoglo, 'Silicalim', xksi(:,:) ) 
  • branches/2013/dev_LOCEAN_2013/NEMOGCM/NEMO/TOP_SRC/PISCES/trcini_pisces.F90

    r3757 r4152  
    122122      rdenita =   3._wp /  5._wp 
    123123      o2ut    = 131._wp / 122._wp 
    124  
    125       CALL p4z_che        ! initialize the chemical constants 
    126124 
    127125      ! Initialization of tracer concentration in case of  no restart  
     
    162160         xksi(:,:)    = 2.e-6 
    163161         xksimax(:,:) = xksi(:,:) 
    164  
    165          ! Initialization of chemical variables of the carbon cycle 
    166          ! -------------------------------------------------------- 
    167          DO jk = 1, jpk 
    168             DO jj = 1, jpj 
    169                DO ji = 1, jpi 
    170                   ztmas   = tmask(ji,jj,jk) 
    171                   ztmas1  = 1. - tmask(ji,jj,jk) 
    172                   zcaralk = trn(ji,jj,jk,jptal) - borat(ji,jj,jk) / (  1. + 1.E-8 / ( rtrn + akb3(ji,jj,jk) )  ) 
    173                   zco3    = ( zcaralk - trn(ji,jj,jk,jpdic) ) * ztmas + 0.5e-3 * ztmas1 
    174                   zbicarb = ( 2. * trn(ji,jj,jk,jpdic) - zcaralk ) 
    175                   hi(ji,jj,jk) = ( ak23(ji,jj,jk) * zbicarb / zco3 ) * ztmas + 1.e-9 * ztmas1 
    176                END DO 
    177             END DO 
    178          END DO 
    179162         ! 
    180163      END IF 
  • branches/2013/dev_LOCEAN_2013/NEMOGCM/NEMO/TOP_SRC/trcini.F90

    r3680 r4152  
    7575         &  CALL ctl_stop( ' Cross Land Advection not yet implemented with passive tracer ; nn_cla must be 0' ) 
    7676 
    77       CALL trc_nam                  ! read passive tracers namelists 
    78       ! 
    79       IF(lwp) WRITE(numout,*) 
    80       IF( ln_rsttr ) THEN 
    81         ! 
    82         IF( lk_offline )  neuler = 1   ! Set time-step indicator at nit000 (leap-frog) 
    83         CALL trc_rst_cal( nittrc000, 'READ' )   ! calendar 
    84         ! 
    85       ELSE 
    86         IF( lk_offline )  THEN 
    87            neuler = 0                  ! Set time-step indicator at nit000 (euler) 
    88            CALL day_init               ! set calendar 
    89         ENDIF 
    90         ! 
    91       ENDIF 
     77      CALL trc_nam      ! read passive tracers namelists 
     78      ! 
     79      IF(lwp) WRITE(numout,*) 
     80      ! 
     81      IF( ln_rsttr .AND. .NOT. lk_offline ) CALL trc_rst_cal( nit000, 'READ' )   ! calendar 
     82      ! 
    9283      IF(lwp) WRITE(numout,*) 
    9384                                                              ! masked grid volume 
     
    10798      IF( lwp ) THEN 
    10899         ! 
    109          CALL ctl_opn( numstr, 'tracer.stat', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, 6, .FALSE., narea ) 
     100         CALL ctl_opn( numstr, 'tracer.stat', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp , narea ) 
    110101         ! 
    111102      ENDIF 
  • branches/2013/dev_LOCEAN_2013/NEMOGCM/NEMO/TOP_SRC/trcnam.F90

    r4148 r4152  
    3232   PRIVATE  
    3333 
     34   PUBLIC trc_nam_run  ! called in trcini 
    3435   PUBLIC trc_nam      ! called in trcini 
    3536 
     
    4445CONTAINS 
    4546 
     47 
    4648   SUBROUTINE trc_nam 
    4749      !!--------------------------------------------------------------------- 
     
    5456      !!                ( (PISCES, CFC, MY_TRC ) 
    5557      !!--------------------------------------------------------------------- 
    56       INTEGER ::  jn, ierr 
    57       INTEGER ::  ios                 ! Local integer output status for namelist read 
    58       ! Definition of a tracer as a structure 
    59       TYPE(PTRACER), DIMENSION(jptra) :: sn_tracer  ! type of tracer for saving if not key_iomput 
    60       !! 
    61       NAMELIST/namtrc/ nn_dttrc, nn_writetrc, ln_rsttr, nn_rsttr, & 
    62          &             cn_trcrst_in, cn_trcrst_out, sn_tracer, ln_trcdta, & 
    63          &             ln_trcdmp, ln_trcdmp_clo, ln_top_euler 
    64 #if defined key_trdmld_trc  || defined key_trdtrc 
    65       NAMELIST/namtrc_trd/ nn_trd_trc, nn_ctls_trc, rn_ucf_trc, & 
    66          &                ln_trdmld_trc_restart, ln_trdmld_trc_instant, & 
    67          &                cn_trdrst_trc_in, cn_trdrst_trc_out, ln_trdtrc 
    68 #endif 
    69       NAMELIST/namtrc_dia/ ln_diatrc, ln_diabio, nn_writedia, nn_writebio 
    70  
    71       !!--------------------------------------------------------------------- 
    72  
    73       IF(lwp) WRITE(numout,*) 'trc_nam : read the passive tracer namelists' 
    74       IF(lwp) WRITE(numout,*) '~~~~~~~' 
    75  
    76       CALL ctl_opn( numnat_ref, 'namelist_top_ref'   , 'OLD'    , 'FORMATTED', 'SEQUENTIAL', 1, numout, .FALSE. ) 
    77       CALL ctl_opn( numnat_cfg, 'namelist_top_cfg'   , 'OLD'    , 'FORMATTED', 'SEQUENTIAL', 1, numout, .FALSE. ) 
    78       CALL ctl_opn( numont    , 'output.namelist.top', 'REPLACE', 'FORMATTED', 'SEQUENTIAL',-1, numout, .FALSE. ) 
    79  
    80       REWIND( numnat_ref )              ! Namelist namtrc in reference namelist : Passive tracer variables 
    81       READ  ( numnat_ref, namtrc, IOSTAT = ios, ERR = 901) 
    82 901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc in reference namelist', lwp ) 
    83  
    84       REWIND( numnat_cfg )              ! Namelist namtrc in configuration namelist : Passive tracer variables 
    85       READ  ( numnat_cfg, namtrc, IOSTAT = ios, ERR = 902 ) 
    86 902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc in configuration namelist', lwp ) 
    87       WRITE ( numont, namtrc ) 
    88  
    89       DO jn = 1, jptra 
    90          ctrcnm    (jn) = TRIM( sn_tracer(jn)%clsname ) 
    91          ctrcln    (jn) = TRIM( sn_tracer(jn)%cllname ) 
    92          ctrcun    (jn) = TRIM( sn_tracer(jn)%clunit  ) 
    93          ln_trc_ini(jn) =       sn_tracer(jn)%llinit 
    94          ln_trc_wri(jn) =       sn_tracer(jn)%llsave 
    95       END DO 
    96  
    97       !!KPE  computes the first time step of tracer model 
    98       nittrc000 = nit000 + nn_dttrc - 1 
    99   
    100  
    101       IF(lwp) THEN                   ! control print 
     58      !                                        !   Parameters of the run  
     59      IF( .NOT. lk_offline ) CALL trc_nam_run 
     60       
     61      !                                        !  passive tracer informations 
     62      CALL trc_nam_trc 
     63       
     64      !                                        !   Parameters of additional diagnostics 
     65      CALL trc_nam_dia 
     66 
     67      !                                        !   namelist of transport 
     68      CALL trc_nam_trp 
     69 
     70 
     71      IF( ln_rsttr )                      ln_trcdta = .FALSE.   ! restart : no need of clim data 
     72      ! 
     73      IF( ln_trcdmp .OR. ln_trcdmp_clo )  ln_trcdta = .TRUE.   ! damping : need to have clim data 
     74      ! 
     75      IF( .NOT.ln_trcdta ) THEN 
     76         ln_trc_ini(:) = .FALSE. 
     77      ENDIF 
     78 
     79     IF(lwp) THEN                   ! control print 
    10280         WRITE(numout,*) 
    10381         WRITE(numout,*) ' Namelist : namtrc' 
    104          WRITE(numout,*) '   time step freq. for passive tracer           nn_dttrc      = ', nn_dttrc 
    105          WRITE(numout,*) '   restart  for passive tracer                  ln_rsttr      = ', ln_rsttr 
    106          WRITE(numout,*) '   control of time step for passive tracer      nn_rsttr      = ', nn_rsttr 
    107          WRITE(numout,*) '   first time step for pass. trac.              nittrc000     = ', nittrc000 
    108          WRITE(numout,*) '   frequency of outputs for passive tracers     nn_writetrc   = ', nn_writetrc   
    10982         WRITE(numout,*) '   Read inputs data from file (y/n)             ln_trcdta     = ', ln_trcdta 
    11083         WRITE(numout,*) '   Damping of passive tracer (y/n)              ln_trcdmp     = ', ln_trcdmp 
    11184         WRITE(numout,*) '   Restoring of tracer on closed seas           ln_trcdmp_clo = ', ln_trcdmp_clo 
    112          WRITE(numout,*) '   Use euler integration for TRC (y/n)          ln_top_euler  = ', ln_top_euler 
    11385         WRITE(numout,*) ' ' 
    11486         DO jn = 1, jptra 
     
    11890      ENDIF 
    11991 
     92      IF(lwp) THEN                   ! control print 
     93         IF( ln_rsttr ) THEN 
     94            WRITE(numout,*) 
     95            WRITE(numout,*) '  Read a restart file for passive tracer : ', TRIM( cn_trcrst_in ) 
     96            WRITE(numout,*) 
     97         ENDIF 
     98         IF( ln_trcdta .AND. .NOT.ln_rsttr ) THEN 
     99            WRITE(numout,*) 
     100            WRITE(numout,*) '  Some of the passive tracers are initialised from climatologies ' 
     101            WRITE(numout,*) 
     102         ENDIF 
     103         IF( .NOT.ln_trcdta ) THEN 
     104            WRITE(numout,*) 
     105            WRITE(numout,*) '  All the passive tracers are initialised with constant values ' 
     106            WRITE(numout,*) 
     107         ENDIF 
     108      ENDIF 
     109 
     110       
    120111      rdttrc(:) = rdttra(:) * FLOAT( nn_dttrc )   ! vertical profile of passive tracer time-step 
    121112   
     
    124115        WRITE(numout,*) '    Passive Tracer  time step    rdttrc  = ', rdttrc(1) 
    125116        WRITE(numout,*)  
    126       ENDIF 
    127  
    128       REWIND( numnat_ref )              ! Namelist namtrc_dia in reference namelist : Passive tracer diagnostics 
    129       READ  ( numnat_ref, namtrc_dia, IOSTAT = ios, ERR = 903) 
    130 903   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc_dia in reference namelist', lwp ) 
    131  
    132       REWIND( numnat_cfg )              ! Namelist namtrc_dia in configuration namelist : Passive tracer diagnostics 
    133       READ  ( numnat_cfg, namtrc_dia, IOSTAT = ios, ERR = 904 ) 
    134 904   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc_dia in configuration namelist', lwp ) 
    135       WRITE ( numont, namtrc_dia ) 
    136  
    137       IF(lwp) THEN 
    138          WRITE(numout,*) 
    139          WRITE(numout,*) 
    140          WRITE(numout,*) ' Namelist : namtrc_dia' 
    141          WRITE(numout,*) '    save additionnal diagnostics arrays         ln_diatrc   = ', ln_diatrc 
    142          WRITE(numout,*) '    save additionnal biology diagnostics arrays ln_diabio   = ', ln_diabio 
    143          WRITE(numout,*) '    frequency of outputs for additional arrays  nn_writedia = ', nn_writedia 
    144          WRITE(numout,*) '    frequency of outputs for biological trends  nn_writebio = ', nn_writebio 
    145          WRITE(numout,*) ' ' 
    146       ENDIF 
    147  
    148       IF( ln_diatrc .AND. .NOT. lk_iomput ) THEN  
    149          ALLOCATE( trc2d(jpi,jpj,jpdia2d), trc3d(jpi,jpj,jpk,jpdia3d),  & 
    150            &       ctrc2d(jpdia2d), ctrc2l(jpdia2d), ctrc2u(jpdia2d) ,  &  
    151            &       ctrc3d(jpdia3d), ctrc3l(jpdia3d), ctrc3u(jpdia3d) ,  STAT = ierr )  
    152          IF( ierr > 0 )   CALL ctl_stop( 'STOP', 'trcnam: unable to allocate add. diag. array' ) 
    153          ! 
    154          trc2d(:,:,:  ) = 0._wp  ;   ctrc2d(:) = ' '   ;   ctrc2l(:) = ' '    ;    ctrc2u(:) = ' '  
    155          trc3d(:,:,:,:) = 0._wp  ;   ctrc3d(:) = ' '   ;   ctrc3l(:) = ' '    ;    ctrc3u(:) = ' '  
    156          ! 
    157       ENDIF 
    158  
    159       IF( ( ln_diabio .AND. .NOT. lk_iomput ) .OR. l_trdtrc ) THEN 
    160          ALLOCATE( trbio (jpi,jpj,jpk,jpdiabio) , & 
    161            &       ctrbio(jpdiabio), ctrbil(jpdiabio), ctrbiu(jpdiabio), STAT = ierr )  
    162          IF( ierr > 0 )   CALL ctl_stop( 'STOP', 'trcnam: unable to allocate bio. diag. array' ) 
    163          ! 
    164          trbio(:,:,:,:) = 0._wp  ;   ctrbio(:) = ' '   ;   ctrbil(:) = ' '    ;    ctrbiu(:) = ' '  
    165          ! 
    166       ENDIF 
    167  
    168       ! namelist of transport 
    169       ! --------------------- 
    170       CALL trc_nam_trp 
    171  
    172  
    173       IF( ln_rsttr )                      ln_trcdta = .FALSE.   ! restart : no need of clim data 
    174       ! 
    175       IF( ln_trcdmp .OR. ln_trcdmp_clo )  ln_trcdta = .TRUE.   ! damping : need to have clim data 
    176       ! 
    177       IF( .NOT.ln_trcdta ) THEN 
    178          ln_trc_ini(:) = .FALSE. 
    179       ENDIF 
    180  
    181       IF(lwp) THEN                   ! control print 
    182          IF( ln_rsttr ) THEN 
    183             WRITE(numout,*) 
    184             WRITE(numout,*) '  Read a restart file for passive tracer : ', TRIM( cn_trcrst_in ) 
    185             WRITE(numout,*) 
    186          ENDIF 
    187          IF( ln_trcdta .AND. .NOT.ln_rsttr ) THEN 
    188             WRITE(numout,*) 
    189             WRITE(numout,*) '  Some of the passive tracers are initialised from climatologies ' 
    190             WRITE(numout,*) 
    191          ENDIF 
    192          IF( .NOT.ln_trcdta ) THEN 
    193             WRITE(numout,*) 
    194             WRITE(numout,*) '  All the passive tracers are initialised with constant values ' 
    195             WRITE(numout,*) 
    196          ENDIF 
    197117      ENDIF 
    198118 
     
    246166   END SUBROUTINE trc_nam 
    247167 
     168   SUBROUTINE trc_nam_run 
     169      !!--------------------------------------------------------------------- 
     170      !!                     ***  ROUTINE trc_nam  *** 
     171      !! 
     172      !! ** Purpose :   read options for the passive tracer run (namelist)  
     173      !! 
     174      !!--------------------------------------------------------------------- 
     175      NAMELIST/namtrc_run/ nn_dttrc, nn_writetrc, ln_rsttr, nn_rsttr, ln_top_euler, & 
     176        &                  cn_trcrst_in, cn_trcrst_out 
     177 
     178      !!--------------------------------------------------------------------- 
     179 
     180 
     181      IF(lwp) WRITE(numout,*) 'trc_nam : read the passive tracer namelists' 
     182      IF(lwp) WRITE(numout,*) '~~~~~~~' 
     183 
     184      CALL ctl_opn( numnat_ref, 'namelist_top_ref'   , 'OLD'    , 'FORMATTED', 'SEQUENTIAL', 1, numout, .FALSE. ) 
     185      CALL ctl_opn( numnat_cfg, 'namelist_top_cfg'   , 'OLD'    , 'FORMATTED', 'SEQUENTIAL', 1, numout, .FALSE. ) 
     186      CALL ctl_opn( numont    , 'output.namelist.top', 'REPLACE', 'FORMATTED', 'SEQUENTIAL',-1, numout, .FALSE. ) 
     187 
     188      REWIND( numnat_ref )              ! Namelist namtrc in reference namelist : Passive tracer variables 
     189      READ  ( numnat_ref, namtrc_run, IOSTAT = ios, ERR = 901) 
     190901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc in reference namelist', lwp ) 
     191 
     192      REWIND( numnat_cfg )              ! Namelist namtrc in configuration namelist : Passive tracer variables 
     193      READ  ( numnat_cfg, namtrc_run, IOSTAT = ios, ERR = 902 ) 
     194902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc in configuration namelist', lwp ) 
     195      WRITE ( numont, namtrc ) 
     196 
     197      !  computes the first time step of tracer model 
     198      nittrc000 = nit000 + nn_dttrc - 1 
     199 
     200      IF(lwp) THEN                   ! control print 
     201         WRITE(numout,*) 
     202         WRITE(numout,*) ' Namelist : namtrc' 
     203         WRITE(numout,*) '   time step freq. for passive tracer           nn_dttrc      = ', nn_dttrc 
     204         WRITE(numout,*) '   restart  for passive tracer                  ln_rsttr      = ', ln_rsttr 
     205         WRITE(numout,*) '   control of time step for passive tracer      nn_rsttr      = ', nn_rsttr 
     206         WRITE(numout,*) '   first time step for pass. trac.              nittrc000     = ', nittrc000 
     207         WRITE(numout,*) '   frequency of outputs for passive tracers     nn_writetrc   = ', nn_writetrc   
     208         WRITE(numout,*) ' ' 
     209      ENDIF 
     210      ! 
     211    END SUBROUTINE trc_nam_run 
     212 
     213 
     214   SUBROUTINE trc_nam_trc 
     215      !!--------------------------------------------------------------------- 
     216      !!                     ***  ROUTINE trc_nam  *** 
     217      !! 
     218      !! ** Purpose :   read options for the passive tracer run (namelist)  
     219      !! 
     220      !!--------------------------------------------------------------------- 
     221      INTEGER ::  jn 
     222      ! Definition of a tracer as a structure 
     223      TYPE(PTRACER), DIMENSION(jptra) :: sn_tracer  ! type of tracer for saving if not key_iomput 
     224      !! 
     225      NAMELIST/namtrc/ sn_tracer, ln_trcdta,ln_trcdmp, ln_trcdmp_clo 
     226 
     227      !!--------------------------------------------------------------------- 
     228      IF(lwp) WRITE(numout,*) 
     229      IF(lwp) WRITE(numout,*) 'trc_nam : read the passive tracer namelists' 
     230      IF(lwp) WRITE(numout,*) '~~~~~~~' 
     231 
     232 
     233      REWIND( numnat_ref )              ! Namelist namtrc in reference namelist : Passive tracer variables 
     234      READ  ( numnat_ref, namtrc, IOSTAT = ios, ERR = 901) 
     235901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc in reference namelist', lwp ) 
     236 
     237      REWIND( numnat_cfg )              ! Namelist namtrc in configuration namelist : Passive tracer variables 
     238      READ  ( numnat_cfg, namtrc, IOSTAT = ios, ERR = 902 ) 
     239902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc in configuration namelist', lwp ) 
     240      WRITE ( numont, namtrc ) 
     241 
     242      DO jn = 1, jptra 
     243         ctrcnm    (jn) = TRIM( sn_tracer(jn)%clsname ) 
     244         ctrcln    (jn) = TRIM( sn_tracer(jn)%cllname ) 
     245         ctrcun    (jn) = TRIM( sn_tracer(jn)%clunit  ) 
     246         ln_trc_ini(jn) =       sn_tracer(jn)%llinit 
     247         ln_trc_wri(jn) =       sn_tracer(jn)%llsave 
     248      END DO 
     249       
     250    END SUBROUTINE trc_nam_trc 
     251 
     252 
     253   SUBROUTINE trc_nam_dia 
     254      !!--------------------------------------------------------------------- 
     255      !!                     ***  ROUTINE trc_nam_dia  *** 
     256      !! 
     257      !! ** Purpose :   read options for the passive tracer diagnostics 
     258      !! 
     259      !! ** Method  : - read passive tracer namelist  
     260      !!              - read namelist of each defined SMS model 
     261      !!                ( (PISCES, CFC, MY_TRC ) 
     262      !!--------------------------------------------------------------------- 
     263      INTEGER ::  ierr 
     264#if defined key_trdmld_trc  || defined key_trdtrc 
     265      NAMELIST/namtrc_trd/ nn_trd_trc, nn_ctls_trc, rn_ucf_trc, & 
     266         &                ln_trdmld_trc_restart, ln_trdmld_trc_instant, & 
     267         &                cn_trdrst_trc_in, cn_trdrst_trc_out, ln_trdtrc 
     268#endif 
     269      NAMELIST/namtrc_dia/ ln_diatrc, ln_diabio, nn_writedia, nn_writebio 
     270 
     271      !!--------------------------------------------------------------------- 
     272 
     273      IF(lwp) WRITE(numout,*)  
     274      IF(lwp) WRITE(numout,*) 'trc_nam_dia : read the passive tracer diagnostics options' 
     275      IF(lwp) WRITE(numout,*) '~~~~~~~' 
     276 
     277      IF(lwp) WRITE(numout,*) 
     278      IF(lwp) WRITE(numout,*) 'trc_nam_dia : read the passive tracer diagnostics options' 
     279      IF(lwp) WRITE(numout,*) '~~~~~~~' 
     280 
     281      REWIND( numnat_ref )              ! Namelist namtrc_dia in reference namelist : Passive tracer diagnostics 
     282      READ  ( numnat_ref, namtrc_dia, IOSTAT = ios, ERR = 903) 
     283903   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc_dia in reference namelist', lwp ) 
     284 
     285      REWIND( numnat_cfg )              ! Namelist namtrc_dia in configuration namelist : Passive tracer diagnostics 
     286      READ  ( numnat_cfg, namtrc_dia, IOSTAT = ios, ERR = 904 ) 
     287904   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc_dia in configuration namelist', lwp ) 
     288      WRITE ( numont, namtrc_dia ) 
     289 
     290      IF(lwp) THEN 
     291         WRITE(numout,*) 
     292         WRITE(numout,*) 
     293         WRITE(numout,*) ' Namelist : namtrc_dia' 
     294         WRITE(numout,*) '    save additionnal diagnostics arrays         ln_diatrc   = ', ln_diatrc 
     295         WRITE(numout,*) '    save additionnal biology diagnostics arrays ln_diabio   = ', ln_diabio 
     296         WRITE(numout,*) '    frequency of outputs for additional arrays  nn_writedia = ', nn_writedia 
     297         WRITE(numout,*) '    frequency of outputs for biological trends  nn_writebio = ', nn_writebio 
     298         WRITE(numout,*) ' ' 
     299      ENDIF 
     300 
     301      IF( ln_diatrc .AND. .NOT. lk_iomput ) THEN  
     302         ALLOCATE( trc2d(jpi,jpj,jpdia2d), trc3d(jpi,jpj,jpk,jpdia3d),  & 
     303           &       ctrc2d(jpdia2d), ctrc2l(jpdia2d), ctrc2u(jpdia2d) ,  &  
     304           &       ctrc3d(jpdia3d), ctrc3l(jpdia3d), ctrc3u(jpdia3d) ,  STAT = ierr )  
     305         IF( ierr > 0 )   CALL ctl_stop( 'STOP', 'trcnam: unable to allocate add. diag. array' ) 
     306         ! 
     307         trc2d(:,:,:  ) = 0._wp  ;   ctrc2d(:) = ' '   ;   ctrc2l(:) = ' '    ;    ctrc2u(:) = ' '  
     308         trc3d(:,:,:,:) = 0._wp  ;   ctrc3d(:) = ' '   ;   ctrc3l(:) = ' '    ;    ctrc3u(:) = ' '  
     309         ! 
     310      ENDIF 
     311 
     312      IF( ( ln_diabio .AND. .NOT. lk_iomput ) .OR. l_trdtrc ) THEN 
     313         ALLOCATE( trbio (jpi,jpj,jpk,jpdiabio) , & 
     314           &       ctrbio(jpdiabio), ctrbil(jpdiabio), ctrbiu(jpdiabio), STAT = ierr )  
     315         IF( ierr > 0 )   CALL ctl_stop( 'STOP', 'trcnam: unable to allocate bio. diag. array' ) 
     316         ! 
     317         trbio(:,:,:,:) = 0._wp  ;   ctrbio(:) = ' '   ;   ctrbil(:) = ' '    ;    ctrbiu(:) = ' '  
     318         ! 
     319      ENDIF 
     320      ! 
     321   END SUBROUTINE trc_nam_dia 
     322 
    248323#else 
    249324   !!---------------------------------------------------------------------- 
     
    253328   SUBROUTINE trc_nam                      ! Empty routine    
    254329   END SUBROUTINE trc_nam 
     330   SUBROUTINE trc_nam_run                      ! Empty routine    
     331   END SUBROUTINE trc_nam_run 
    255332#endif 
    256333 
  • branches/2013/dev_LOCEAN_2013/NEMOGCM/NEMO/TOP_SRC/trcrst.F90

    r3680 r4152  
    197197 
    198198         CALL iom_get ( numrtr, 'kt', zkt )   ! last time-step of previous run 
     199 
    199200         IF(lwp) THEN 
    200201            WRITE(numout,*) ' *** Info read in restart : ' 
     
    216217            IF( iom_varid( numrtr, 'rdttrc1', ldstop = .FALSE. ) > 0 )   THEN 
    217218               CALL iom_get( numrtr, 'rdttrc1', zrdttrc1 ) 
    218                IF( zrdttrc1 /= rdttrc(1) )   neuler = 0 
     219               IF( zrdttrc1 /= rdt * nn_dttrc )   neuler = 0 
    219220            ENDIF 
    220221            !                          ! define ndastp and adatrj 
    221             IF ( nn_rsttr == 2 ) THEN 
     222            IF( nn_rsttr == 2 ) THEN 
    222223               CALL iom_get( numrtr, 'ndastp', zndastp )  
    223224               ndastp = NINT( zndastp ) 
  • branches/2013/dev_LOCEAN_2013/NEMOGCM/SETTE/input_ORCA2_LIM_PISCES.cfg

    r4147 r4152  
    1 ORCA2_LIM_nemo_v3.4.tar ORCA2_LIM_PISCES_v3.5 
    2 INPUTS_DYNA_v3.tar ORCA2_LIM_PISCES_v3.5  
    3 INPUTS_INIT_v3.tar ORCA2_LIM_PISCES_v3.5 
    4 INPUTS_PISCES_v3.5.tar ORCA2_LIM_PISCES_v3.5  
     1ORCA2_LIM_nemo_v3.4.tar  ORCA2_LIM_nemo_v3.4 
  • branches/2013/dev_LOCEAN_2013/NEMOGCM/SETTE/input_ORCA2_OFF_PISCES.cfg

    r4147 r4152  
    11INPUTS_DYNA_v3.tar ORCA2_OFF_PISCES 
    2 INPUTS_INIT_v3.tar ORCA2_OFF_PISCES  
    3 INPUTS_PISCES_v3.5.tar ORCA2_OFF_PISCES 
  • branches/2013/dev_LOCEAN_2013/NEMOGCM/SETTE/param.cfg

    r4147 r4152  
    11#- forcing files storing  
    2 FORCING_DIR=~/Documents/WORK/FORCING 
     2FORCING_DIR=${WORKDIR}/FORCING 
    33#- input files storing  
    44INPUT_DIR=${CONFIG_DIR}/${NEW_CONF}/EXP00 
     
    66#TMPDIR=${CONFIG_DIR}/${NEW_CONF}/EXP00 
    77#- VALIDATION files storing  
    8 NEMO_VALIDATION_DIR=~/Documents/WORK/NEMO_VALIDATION 
     8NEMO_VALIDATION_DIR=${WORKDIR}/NEMO_VALIDATION 
  • branches/2013/dev_LOCEAN_2013/NEMOGCM/SETTE/sette.sh

    r4147 r4152  
    131131#- 
    132132# Compiler among those in NEMOGCM/ARCH 
    133 COMPILER=macport_osx 
     133COMPILER=x3750_ADA 
    134134export BATCH_COMMAND_PAR="llsubmit" 
    135135export BATCH_COMMAND_SEQ=$BATCH_COMMAND_PAR 
Note: See TracChangeset for help on using the changeset viewer.