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 4276 for branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM – NEMO

Ignore:
Timestamp:
2013-11-20T10:35:28+01:00 (10 years ago)
Author:
cbricaud
Message:

merge changes from 3856 to 4119 from trunk in dev_r3856_MERCATOR3_QSRMEAN24

Location:
branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM
Files:
19 deleted
84 edited
11 copied

Legend:

Unmodified
Added
Removed
  • branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/arch-PW7_METO.fcm

    r3834 r4276  
    1515 
    1616 
    17 %NCDF_INC            -I/home/nwp/ofrd/share/netcdf-3.6.0-p1_ec/include 
    18 %NCDF_LIB            -L /home/nwp/ofrd/share/netcdf-3.6.0-p1_ec/lib -lnetcdf 
     17%NCDF_INC            -I/home/nwp/nm/frrj/lib/MTOOLS/include 
     18%NCDF_LIB            -L/home/nwp/nm/frrj/lib/MTOOLS/lib -lnetcdf -lhdf5 -lhdf5_hl -lhdf5_fortran -lz 
     19%XIOS_ROOT           /home/cr/ocean/hadcv/xios_r445 
    1920%FC                  mpxlf90_r 
    20 %FCFLAGS             -qrealsize=8 -qextname -qsuffix=f=f90 -qarch=pwr7 -qtune=pwr7 -NS32768 -I/home/nwp/ofrd/share/netcdf-3.6.0-p1_ex/include -g -O3 -qnostrict  
    21 %FFLAGS              -qrealsize=8 -qextname -qsuffix=f=f90 -qarch=pwr7 -qtune=pwr7 -NS32768 -I/home/nwp/ofrd/share/netcdf-3.6.0-p1_ex/include -g -O3 -qnostrict  
    22 %LD                  mpxlf90_r 
    23 %LDFLAGS             -L /home/nwp/ofrd/share/netcdf-3.6.0-p1_ec/lib -lnetcdf -L/projects/um1/lib -lsig -O3 -L MASS 
     21%FCFLAGS             -qrealsize=8 -qextname -qsuffix=f=f90 -qarch=pwr7 -qtune=pwr7 -NS32768 -I/home/nwp/nm/frrj/lib/MTOOLS/include -g -O3 -qnostrict 
     22%FFLAGS              -qrealsize=8 -qextname -qsuffix=f=f90 -qarch=pwr7 -qtune=pwr7 -NS32768 -I/home/nwp/nm/frrj/lib/MTOOLS/include -g -O3 -qnostrict 
     23%LD                  mpCC_r 
     24%LDFLAGS             -lxlf90 -L/home/nwp/nm/frrj/lib/MTOOLS/lib -lnetcdf -L/projects/um1/lib -lsig -O3 -L MASS 
    2425%FPPFLAGS            -E -P -traditional -I/opt/ibmhpc/pecurrent/ppe.poe/include -I/usr/lpp/ppe.poe/include/thread64 
    2526%AR                  ar 
    2627%ARFLAGS             rs 
    2728%MK                  gmake 
    28 %USER_INC            %NCDF_INC 
    29 %USER_LIB            %NCDF_LIB 
     29%USER_INC            %NCDF_INC -I%XIOS_ROOT/inc 
     30%USER_LIB            %NCDF_LIB -L%XIOS_ROOT/lib -lxios 
  • branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/CONFIG/AMM12/EXP00/iodef.xml

    r3771 r4276  
    2121    --> 
    2222     
    23     <file_definition type="multiple_file" sync_freq="1d" min_digits="4"> 
     23    <file_definition type="multiple_file" name="@expname@_@freq@_@startdate@_@enddate@" sync_freq="10d" min_digits="4"> 
    2424     
     25      <file_group id="1ts" output_freq="1ts"  output_level="10" enabled=".TRUE."/> <!-- 1 time step files --> 
     26 
    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 --> 
     
    6062      <axis id="depthw" long_name="Vertical W levels" unit="m" positive="down" /> 
    6163      <axis id="nfloat" long_name="Float number"      unit="-"  /> 
     64      <axis id="icbcla" long_name="Iceberg class"     unit="-"  /> 
    6265   </axis_definition>  
    6366     
  • branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/CONFIG/AMM12/EXP00/namelist

    r3795 r4276  
    3535                           !    = 1 nn_date0 read in namelist ; nn_it000 : check consistancy between namelist and restart 
    3636                           !    = 2 nn_date0 read in restart  ; nn_it000 : check consistancy between namelist and restart 
    37    cn_ocerst_in  = "restart"   !  suffix of ocean restart name (input) 
     37   cn_ocerst_in  = "amm12_restart_oce"   !  suffix of ocean restart name (input) 
    3838   cn_ocerst_out = "restart"   !  suffix of ocean restart name (output) 
    3939   nn_istate   =       1   !  output the initial state (1) or not (0) 
  • branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/CONFIG/GYRE/EXP00/iodef.xml

    r3771 r4276  
    2121    --> 
    2222     
    23     <file_definition type="one_file" sync_freq="1d" min_digits="4"> 
     23    <file_definition type="multiple_file" name="@expname@_@freq@_@startdate@_@enddate@" sync_freq="1d" min_digits="4"> 
    2424     
     25      <file_group id="1ts" output_freq="1ts"  output_level="10" enabled=".TRUE."/> <!-- 1 time step files --> 
     26 
    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 --> 
     
    3335      <file_group id="5d" output_freq="5d"  output_level="10" enabled=".TRUE.">  <!-- 5d files -->   
    3436  
    35         <file id="5d_grid_T" name="auto" description="ocean T grid variables" > 
     37   <file id="file1" name_suffix="_grid_T" description="ocean T grid variables" > 
    3638     <field field_ref="toce"         name="votemper"  /> 
    3739     <field field_ref="soce"         name="vosaline"  /> 
     
    4749        </file> 
    4850    
    49         <file id="5d_grid_U" name="auto" description="ocean U grid variables" > 
     51   <file id="file2" name_suffix="_grid_U" description="ocean U grid variables" > 
    5052          <field field_ref="uoce"         name="vozocrtx"  /> 
    5153          <field field_ref="utau"         name="sozotaux"  /> 
    5254        </file> 
    5355    
    54         <file id="5d_grid_V" name="auto" description="ocean V grid variables" > 
     56   <file id="file3" name_suffix="_grid_V" description="ocean V grid variables" > 
    5557          <field field_ref="voce"         name="vomecrty"  />  
    5658          <field field_ref="vtau"         name="sometauy"  />  
    5759        </file> 
    5860    
    59         <file id="5d_grid_W" name="auto" description="ocean W grid variables" > 
     61   <file id="file4" name_suffix="_grid_W" description="ocean W grid variables" > 
    6062          <field field_ref="woce"         name="vovecrtz" /> 
    6163          <field field_ref="avt"          name="votkeavt" /> 
     
    9092      <axis id="depthw" long_name="Vertical W levels" unit="m" positive="down" /> 
    9193      <axis id="nfloat" long_name="Float number"      unit="-"  /> 
     94      <axis id="icbcla" long_name="Iceberg class"     unit="-"  /> 
    9295   </axis_definition>  
    9396     
     
    118121     <variable id="buffer_server_factor_size" type="integer">2</variable> 
    119122     <variable id="info_level"                type="integer">0</variable> 
    120      <variable id="using_server"              type="boolean">true</variable> 
     123     <variable id="using_server"              type="boolean">false</variable> 
    121124     <variable id="using_oasis"               type="boolean">false</variable> 
    122125     <variable id="oasis_codes_id"            type="string" >oceanx</variable> 
  • branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/CONFIG/GYRE_BFM/EXP00/iodef.xml

    r3771 r4276  
    2121    --> 
    2222     
    23     <file_definition type="multiple_file" sync_freq="1d" min_digits="4"> 
     23    <file_definition type="multiple_file" name="@expname@_@freq@_@startdate@_@enddate@" sync_freq="10d" min_digits="4"> 
    2424     
     25      <file_group id="1ts" output_freq="1ts"  output_level="10" enabled=".TRUE."/> <!-- 1 time step files --> 
     26 
    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 --> 
     
    6062      <axis id="depthw" long_name="Vertical W levels" unit="m" positive="down" /> 
    6163      <axis id="nfloat" long_name="Float number"      unit="-"  /> 
     64      <axis id="icbcla" long_name="Iceberg class"     unit="-"  /> 
    6265   </axis_definition>  
    6366     
  • branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/CONFIG/GYRE_PISCES/EXP00/iodef.xml

    r3771 r4276  
    2121    --> 
    2222     
    23     <file_definition type="multiple_file" sync_freq="1d" min_digits="4"> 
     23    <file_definition type="multiple_file" name="@expname@_@freq@_@startdate@_@enddate@" sync_freq="10d" min_digits="4"> 
    2424     
     25      <file_group id="1ts" output_freq="1ts"  output_level="10" enabled=".TRUE."/> <!-- 1 time step files --> 
     26 
    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 --> 
     
    3335      <file_group id="5d" output_freq="5d"  output_level="10" enabled=".TRUE.">  <!-- 5d files -->    
    3436  
    35         <file id="5d_grid_T" name="auto" description="ocean T grid variables" > 
     37        <file id="file1" name_suffix="_grid_T" description="ocean T grid variables" > 
    3638     <field field_ref="toce"         name="votemper"  /> 
    3739     <field field_ref="soce"         name="vosaline"  /> 
     
    4749        </file> 
    4850    
    49         <file id="5d_grid_U" name="auto" description="ocean U grid variables" > 
     51        <file id="file2" name_suffix="_grid_U" description="ocean U grid variables" > 
    5052          <field field_ref="uoce"         name="vozocrtx"  /> 
    5153          <field field_ref="utau"         name="sozotaux"  /> 
    5254        </file> 
    5355    
    54         <file id="5d_grid_V" name="auto" description="ocean V grid variables" > 
     56        <file id="file3" name_suffix="_grid_V" description="ocean V grid variables" > 
    5557          <field field_ref="voce"         name="vomecrty"  />  
    5658          <field field_ref="vtau"         name="sometauy"  />  
    5759        </file> 
    5860    
    59         <file id="5d_grid_W" name="auto" description="ocean W grid variables" > 
     61        <file id="file4" name_suffix="_grid_W" description="ocean W grid variables" > 
    6062          <field field_ref="woce"         name="vovecrtz" /> 
    6163          <field field_ref="avt"          name="votkeavt" /> 
     
    6365        </file> 
    6466 
    65    <file id="5d_ptrc_T" name="auto" description="lobster sms variables" > 
     67   <file id="file5" name="_ptrc_T" description="lobster sms variables" > 
    6668          <field field_ref="DET"      /> 
    6769          <field field_ref="ZOO"      /> 
     
    8284      <file_group id="1y"  output_freq="1y" output_level="10" enabled=".TRUE."> <!-- real yearly files --> 
    8385 
    84    <file id="1y_diad_T" name="auto" description="additional lobster diagnostics" >   
     86   <file id="file6" name_suffix="_diad_T" description="additional lobster diagnostics" >   
    8587          <field field_ref="FNO3PHY"   />  
    8688          <field field_ref="FNH4PHY"   />  
     
    126128      <axis id="depthw" long_name="Vertical W levels" unit="m" positive="down" /> 
    127129      <axis id="nfloat" long_name="Float number"      unit="-"  /> 
     130      <axis id="icbcla" long_name="Iceberg class"     unit="-"  /> 
    128131   </axis_definition>  
    129132     
  • branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/CONFIG/ORCA2_LIM/EXP00/1_namelist

    r3795 r4276  
    2727   cn_exp      = "Agulhas" !  experience name  
    2828   nn_it000    =       1   !  first time step 
    29    nn_itend    =   10950   !  last  time step 
     29   nn_itend    =     480   !  last  time step 
    3030   nn_date0    =  010101   !  date at nit_0000 (format yyyymmdd) used if ln_rstart=F or (ln_rstart=T and nn_rstctl=0 or 1) 
    3131   nn_leapy    =       0   !  Leap year calendar (1) or not (0) 
     
    114114   sn_tem  = 'data_1m_potential_temperature_nomask', -1,'votemper',  .true.  , .true., 'yearly'   , ' '      , ' ' 
    115115   sn_sal  = 'data_1m_salinity_nomask'             , -1,'vosaline',  .true.  , .true., 'yearly'   , ''       , ' ' 
     116   cn_dir        = './'      !  root directory for the location of the runoff files 
     117   ln_tsd_init   = .true.    !  Initialisation of ocean T & S with T &S input data (T) or not (F) 
     118   ln_tsd_tradmp = .false.   !  damping of ocean T & S toward T &S input data (T) or not (F) 
    116119/ 
    117120!!====================================================================== 
  • branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/CONFIG/ORCA2_LIM/EXP00/iodef_ar5.xml

    r3771 r4276  
    2626    --> 
    2727     
    28     <file_definition type="multiple_file" output_level="10" sync_freq="1d" min_digits="4"> 
     28    <file_definition type="multiple_file" name="@expname@_@freq@_@startdate@_@enddate@" output_level="10" sync_freq="2mo" min_digits="4"> 
    2929      <!-- 
    3030+++++++++++++++++++++++++++++++++++++++++++++++   daily   ++++++++++++++++++++++++++++++++++++++++++++++++++ 
    3131        --> 
    3232      <file_group id="1d" output_freq="1d"  enabled=".TRUE.">                      <!-- 1d files --> 
    33    <file id="1d_grid_T" name="auto" name_suffix="_table2.2" >         <!-- grid T  --> 
     33   <file id="file1" name_suffix="_grid_T_table2.2" >         <!-- grid T  --> 
    3434     <field field_ref="sst"          name='tos'      long_name="sea_surface_temperature"                              level="2"                      /> 
    3535     <field field_ref="sst2"         name='tossq'    long_name="square_of_sea_surface_temperature"                    level="2"                      /> 
     
    4343   <!-- 
    4444..............................................    grid T   ................................................. 
    45      --> 
    46    <file_group id="1m_grid_T" name="auto" >                                                        <!-- grid T --> 
    47       
    48      <file id="1m grid_T table 2.2" name_suffix="_table2.2" > 
    49        <field field_ref="botpres"      name="pbo"      long_name="sea_water_pressure_at_sea_floor"                               /> 
    50        <!-- pso : sea_water_pressure_at_sea_water_surface = 0 --> 
    51        <field field_ref="ssh"          name="zos"      long_name="sea_surface_height_above_geoid"                                 /> 
    52        <field field_ref="ssh2"         name="zossq"    long_name="square_of_sea_surface_height_above_geoid"             level="2" /> 
    53        <!-- masscello : sea_water_mass_per_unit_area = cellthc*rau0                                          no time changes --> 
    54        <field field_ref="cellthc"      name="thkcello" long_name="cell_thickness"                                                 /> <!-- no time changes --> 
    55        <field field_ref="toce"         name="thetao"   long_name="sea_water_potential_temperature"                                /> 
    56        <field field_ref="sst"          name="tos"      long_name="sea_surface_temperature"                              level="1" /> 
    57        <field field_ref="sst2"         name="tossq"    long_name="square_of_sea_surface_temperature"                    level="2" /> 
    58        <field field_ref="soce"         name="so"       long_name="sea_water_salinity"                                             /> 
    59        <field field_ref="sss"          name="sos"      long_name="sea_surface_salinity"                                 level="1" /> 
    60        <field field_ref="rhop"         name="rhopoto"  long_name="sea_water_potential_density"                          level="2" /> 
    61        <!-- no agessc : sea_water_age_since_surface_contact --> 
    62        <!-- no cfc11  : moles_per_unit_mass_of_cfc11_in_sea_water --> 
    63        <!-- msftbarot : ocean_barotropic_mass_streamfunction : offline --> 
    64        <!-- mlotst    :           ocean_mixed_layer_thickness_defined_by_sigma_t : must be done offline --> 
    65        <!-- mlotstsq  : square_of_ocean_mixed_layer_thickness_defined_by_sigma_t : must be done offline --> 
    66        <field field_ref="mldkz5"       name='omlmax'   long_name="ocean_mixed_layer_thickness_defined_by_mixing_scheme" level="2" operation="maximum" /> 
    67      </file>    
    68       
    69      <file id="1m grid_T table 2.5" name_suffix="_table2.5" > 
    70        <field field_ref="rain"         name="pr"       long_name="rainfall_flux"                                           level="1" /> 
    71        <field field_ref="snow_ao_cea"  name="prsn"     long_name="snowfall_flux"                                           level="1" /> 
    72        <field field_ref="evap_ao_cea"  name="evs"      long_name="water_evaporation_flux"                                  level="1" /> 
    73        <field field_ref="runoffs"      name="friver"   long_name="water_flux_into_sea_water_from_rivers"                   level="1" /> 
    74        <field field_ref="calving"      name="ficeberg" long_name="water_flux_into_sea_water_from_icebergs"                 level="1" /> 
    75        <field field_ref="isnwmlt_cea"  name="fsitherm" long_name="water_flux_into_sea_water_due_to_sea_ice_thermodynamics" level="1" /> 
    76        <field field_ref="empmr"        name="wfo"      long_name="water_flux_into_sea_water"                               level="1" /> 
    77        <!-- wfonocorr : water_flux_into_sea_water_without_flux_correction : emp - erp -->   
    78        <field field_ref="erp"          name="wfcorr"   long_name="water_flux_correction"                                   level="1" /> <!-- usually = 0 --> 
    79      </file>    
    80       
    81      <file id="1m grid_T table 2.6" name_suffix="_table2.6" > 
    82        <!-- vsfpr    : virtual_salt_flux_into_sea_water_due_to_rainfall    = 0 -->  
    83        <!-- vsfevap  : virtual_salt_flux_into_sea_water_due_to_evaporation = 0 -->  
    84        <!-- vsfriver : virtual_salt_flux_into_sea_water_from_rivers        = 0 -->     
    85        <field field_ref="fsal_virt_cea" name="vsfsit" long_name="virtual_salt_flux_into_sea_water_due_to_sea_ice_thermodynamics" level="1" /> 
    86        <!-- vsf      : virtual_salt_flux_into_sea_water = fsal_virtual + fsal_real --> 
    87        <!-- wfcorr   : virtual_salt_flux_correction                        = 0 -->  
    88        <field field_ref="fsal_virt_cea" name="sfdsi"  long_name="downward_sea_ice_basal_salt_flux"                               level="1" /> 
    89        <!-- sfriver  : salt_flux_into_sea_water_from_rivers                = 0 -->  
    90      </file>    
    91       
    92      <file id="1m grid_T table 2.7" name_suffix="_table2.7" > 
    93        <!-- hfgeou : upward_geothermal_heat_flux_at_sea_floor : cte, see nambbc and trabbc.F90 --> 
    94        <field field_ref="hflx_rain_cea" name="hfrainds"    long_name="temperature_flux_due_to_rainfall_expressed_as_heat_flux_into_sea_water"      level="1" /> 
    95        <field field_ref="hflx_evap_cea" name="hfevapds"    long_name="temperature_flux_due_to_evaporation_expressed_as_heat_flux_out_of_sea_water" level="1" /> 
    96        <field field_ref="hflx_rnf_cea"  name="hfrunoffds"  long_name="temperature_flux_due_to_runoff_expressed_as_heat_flux_into_sea_water"        level="1" /> 
    97        <field field_ref="hflx_snow_cea" name="hfsnthermds" long_name="heat_flux_into_sea_water_due_to_snow_thermodynamics"                         level="1" /> 
    98        <field field_ref="hflx_ice_cea"  name="hfsithermds" long_name="heat_flux_into_sea_water_due_to_sea_ice_thermodynamics"                      level="1" /> 
    99        <field field_ref="hflx_cal_cea"  name="hfibthermds" long_name="heat_flux_into_sea_water_due_to_iceberg_thermodynamics"                      level="1" /> 
    100        <!-- rlds   : surface_net_downward_longwave_flux : not available --> 
    101        <!-- hfls   : surface_downward_latent_heat_flux  : not available --> 
    102        <!-- hfss   : surface_downward_sensible_heat_flux: not available --> 
    103        <field field_ref="qns"           name="nshfls"      long_name="surface_net_downward_non_solar_flux"                                         level="1" /> 
    104        <field field_ref="qsr"           name="rsntds"      long_name="surface_net_downward_shortwave_flux"                                         level="1" /> 
    105        <field field_ref="qsr3d"         name="rsds"        long_name="downwelling_shortwave_flux_in_sea_water"                                     level="1" /> 
    106        <field field_ref="qrp"           name="hfcorr"      long_name="heat_flux_correction"                                                        level="1" /> 
    107      </file>    
    108    </file_group> 
     45     -->    
     46   <file id="file2" name_suffix="_grid_T_table2.2" > 
     47     <field field_ref="botpres"      name="pbo"      long_name="sea_water_pressure_at_sea_floor"                               /> 
     48     <!-- pso : sea_water_pressure_at_sea_water_surface = 0 --> 
     49     <field field_ref="ssh"          name="zos"      long_name="sea_surface_height_above_geoid"                                 /> 
     50     <field field_ref="ssh2"         name="zossq"    long_name="square_of_sea_surface_height_above_geoid"             level="2" /> 
     51     <!-- masscello : sea_water_mass_per_unit_area = cellthc*rau0                                          no time changes --> 
     52     <field field_ref="cellthc"      name="thkcello" long_name="cell_thickness"                                                 /> <!-- no time changes --> 
     53     <field field_ref="toce"         name="thetao"   long_name="sea_water_potential_temperature"                                /> 
     54     <field field_ref="sst"          name="tos"      long_name="sea_surface_temperature"                              level="1" /> 
     55     <field field_ref="sst2"         name="tossq"    long_name="square_of_sea_surface_temperature"                    level="2" /> 
     56     <field field_ref="soce"         name="so"       long_name="sea_water_salinity"                                             /> 
     57     <field field_ref="sss"          name="sos"      long_name="sea_surface_salinity"                                 level="1" /> 
     58     <field field_ref="rhop"         name="rhopoto"  long_name="sea_water_potential_density"                          level="2" /> 
     59     <!-- no agessc : sea_water_age_since_surface_contact --> 
     60     <!-- no cfc11  : moles_per_unit_mass_of_cfc11_in_sea_water --> 
     61     <!-- msftbarot : ocean_barotropic_mass_streamfunction : offline --> 
     62     <!-- mlotst    :           ocean_mixed_layer_thickness_defined_by_sigma_t : must be done offline --> 
     63     <!-- mlotstsq  : square_of_ocean_mixed_layer_thickness_defined_by_sigma_t : must be done offline --> 
     64     <field field_ref="mldkz5"       name='omlmax'   long_name="ocean_mixed_layer_thickness_defined_by_mixing_scheme" level="2" operation="maximum" /> 
     65   </file>    
     66    
     67   <file id="file3" name_suffix="_grid_T_table2.5" > 
     68     <field field_ref="rain"         name="pr"       long_name="rainfall_flux"                                           level="1" /> 
     69     <field field_ref="snow_ao_cea"  name="prsn"     long_name="snowfall_flux"                                           level="1" /> 
     70     <field field_ref="evap_ao_cea"  name="evs"      long_name="water_evaporation_flux"                                  level="1" /> 
     71     <field field_ref="runoffs"      name="friver"   long_name="water_flux_into_sea_water_from_rivers"                   level="1" /> 
     72     <field field_ref="calving"      name="ficeberg" long_name="water_flux_into_sea_water_from_icebergs"                 level="1" /> 
     73     <field field_ref="isnwmlt_cea"  name="fsitherm" long_name="water_flux_into_sea_water_due_to_sea_ice_thermodynamics" level="1" /> 
     74     <field field_ref="empmr"        name="wfo"      long_name="water_flux_into_sea_water"                               level="1" /> 
     75     <!-- wfonocorr : water_flux_into_sea_water_without_flux_correction : emp - erp -->   
     76     <field field_ref="erp"          name="wfcorr"   long_name="water_flux_correction"                                   level="1" /> <!-- usually = 0 --> 
     77   </file>    
     78    
     79   <file id="file4" name_suffix="_grid_T_table2.6" > 
     80     <!-- vsfpr    : virtual_salt_flux_into_sea_water_due_to_rainfall    = 0 -->  
     81     <!-- vsfevap  : virtual_salt_flux_into_sea_water_due_to_evaporation = 0 -->  
     82     <!-- vsfriver : virtual_salt_flux_into_sea_water_from_rivers        = 0 -->       
     83     <field field_ref="fsal_virt_cea" name="vsfsit" long_name="virtual_salt_flux_into_sea_water_due_to_sea_ice_thermodynamics" level="1" /> 
     84     <!-- vsf      : virtual_salt_flux_into_sea_water = fsal_virtual + fsal_real --> 
     85     <!-- wfcorr   : virtual_salt_flux_correction                        = 0 -->  
     86     <field field_ref="fsal_virt_cea" name="sfdsi"  long_name="downward_sea_ice_basal_salt_flux"                               level="1" /> 
     87     <!-- sfriver  : salt_flux_into_sea_water_from_rivers                = 0 -->  
     88   </file>    
     89    
     90   <file id="file5" name_suffix="_grid_T_table2.7" > 
     91     <!-- hfgeou : upward_geothermal_heat_flux_at_sea_floor : cte, see nambbc and trabbc.F90 --> 
     92     <field field_ref="hflx_rain_cea" name="hfrainds"    long_name="temperature_flux_due_to_rainfall_expressed_as_heat_flux_into_sea_water"      level="1" /> 
     93     <field field_ref="hflx_evap_cea" name="hfevapds"    long_name="temperature_flux_due_to_evaporation_expressed_as_heat_flux_out_of_sea_water" level="1" /> 
     94     <field field_ref="hflx_rnf_cea"  name="hfrunoffds"  long_name="temperature_flux_due_to_runoff_expressed_as_heat_flux_into_sea_water"        level="1" /> 
     95     <field field_ref="hflx_snow_cea" name="hfsnthermds" long_name="heat_flux_into_sea_water_due_to_snow_thermodynamics"                         level="1" /> 
     96     <field field_ref="hflx_ice_cea"  name="hfsithermds" long_name="heat_flux_into_sea_water_due_to_sea_ice_thermodynamics"                      level="1" /> 
     97     <field field_ref="hflx_cal_cea"  name="hfibthermds" long_name="heat_flux_into_sea_water_due_to_iceberg_thermodynamics"                      level="1" /> 
     98     <!-- rlds   : surface_net_downward_longwave_flux : not available --> 
     99     <!-- hfls   : surface_downward_latent_heat_flux  : not available --> 
     100     <!-- hfss   : surface_downward_sensible_heat_flux: not available --> 
     101     <field field_ref="qns"           name="nshfls"      long_name="surface_net_downward_non_solar_flux"                                         level="1" /> 
     102     <field field_ref="qsr"           name="rsntds"      long_name="surface_net_downward_shortwave_flux"                                         level="1" /> 
     103     <field field_ref="qsr3d"         name="rsds"        long_name="downwelling_shortwave_flux_in_sea_water"                                     level="1" /> 
     104     <field field_ref="qrp"           name="hfcorr"      long_name="heat_flux_correction"                                                        level="1" /> 
     105   </file>    
    109106   <!-- 
    110107..............................................    grid U   ................................................. 
    111      --> 
    112    <file_group id="1m_grid_U" name="auto" >                                                        <!-- grid U --> 
    113  
    114      <file id="1m grid_U table 2.3" name_suffix="_table2.3" > 
    115        <field field_ref="uoce"         name="uo"      long_name="sea_water_x_velocity"                                       /> 
    116        <field field_ref="u_masstr"     name="umo"     long_name="ocean_mass_x_transport"                           level="1" /> 
    117        <field field_ref="u_heattr"     name="hfx"     long_name="ocean_heat_x_transport"                           level="1" /> 
    118        <field field_ref="ueiv_heattr"  name="hfxba"   long_name="ocean_heat_x_transport_due_to_bolus_advection"    level="2" /> 
    119        <field field_ref="udiff_heattr" name="hfxdiff" long_name="ocean_heat_x_transport_due_to_diffusion"          level="2" /> 
    120      </file>    
    121  
    122      <file id="1m grid_U table 2.8" name_suffix="_table2.8" > 
    123        <field field_ref="utau"         name="tauuo" long_name="surface_downward_x_stress"                          level="1" /> 
    124        <!-- tauucorr : surface_downward_x_stress_correction = 0 --> 
    125      </file>    
    126  
    127    </file_group> 
     108   --> 
     109   <file id="file6" name_suffix="_grid_U_table2.3" > 
     110     <field field_ref="uoce"         name="uo"      long_name="sea_water_x_velocity"                                       /> 
     111     <field field_ref="u_masstr"     name="umo"     long_name="ocean_mass_x_transport"                           level="1" /> 
     112     <field field_ref="u_heattr"     name="hfx"     long_name="ocean_heat_x_transport"                           level="1" /> 
     113     <field field_ref="ueiv_heattr"  name="hfxba"   long_name="ocean_heat_x_transport_due_to_bolus_advection"    level="2" /> 
     114     <field field_ref="udiff_heattr" name="hfxdiff" long_name="ocean_heat_x_transport_due_to_diffusion"          level="2" /> 
     115   </file>    
     116    
     117   <file id="file7" name_suffix="_grid_U_table2.8" > 
     118     <field field_ref="utau"         name="tauuo" long_name="surface_downward_x_stress"                          level="1" /> 
     119     <!-- tauucorr : surface_downward_x_stress_correction = 0 --> 
     120   </file>    
    128121   <!-- 
    129122..............................................    grid V   ................................................. 
    130      --> 
    131    <file_group id="1m_grid_V" name="auto" >                                                        <!-- grid V --> 
    132  
    133      <file id="1m grid_V table 2.3" name_suffix="_table2.3" > 
    134        <field field_ref="voce"         name="vo"      long_name="sea_water_y_velocity"                                       /> 
    135        <field field_ref="v_masstr"     name="vmo"     long_name="ocean_mass_y_transport"                           level="1" /> 
    136        <field field_ref="v_heattr"     name="hfy"     long_name="ocean_heat_y_transport"                           level="1" /> 
    137        <field field_ref="veiv_heattr"  name="hfyba"   long_name="ocean_heat_y_transport_due_to_bolus_advection"    level="2" /> 
    138        <field field_ref="vdiff_heattr" name="hfydiff" long_name="ocean_heat_y_transport_due_to_diffusion"          level="2" /> 
    139      </file>    
    140  
    141      <file id="1m grid_V table 2.8" name_suffix="_table2.8" > 
    142        <field field_ref="vtau"         name="tauvo" long_name="surface_downward_y_stress"                          level="1" /> 
    143        <!-- tauvcorr : surface_downward_y_stress_correction = 0 --> 
    144      </file>    
    145  
    146    </file_group> 
     123   --> 
     124   <file id="file8" name_suffix="_grid_V_table2.3" > 
     125     <field field_ref="voce"         name="vo"      long_name="sea_water_y_velocity"                                       /> 
     126     <field field_ref="v_masstr"     name="vmo"     long_name="ocean_mass_y_transport"                           level="1" /> 
     127     <field field_ref="v_heattr"     name="hfy"     long_name="ocean_heat_y_transport"                           level="1" /> 
     128     <field field_ref="veiv_heattr"  name="hfyba"   long_name="ocean_heat_y_transport_due_to_bolus_advection"    level="2" /> 
     129     <field field_ref="vdiff_heattr" name="hfydiff" long_name="ocean_heat_y_transport_due_to_diffusion"          level="2" /> 
     130   </file>    
     131    
     132   <file id="file9" name_suffix="_grid_V_table2.8" > 
     133     <field field_ref="vtau"         name="tauvo" long_name="surface_downward_y_stress"                          level="1" /> 
     134     <!-- tauvcorr : surface_downward_y_stress_correction = 0 --> 
     135   </file>    
    147136   <!-- 
    148137..............................................    grid W   ................................................. 
    149      --> 
    150    <file_group id="1m_grid_W" name="auto" >                                                        <!-- grid W --> 
    151       
    152      <file id="1m grid_W table 2.3" name_suffix="_table2.3" > 
    153        <field field_ref="w_masstr"   name="wmo"   long_name="upward_ocean_mass_transport"                                    /> 
    154        <field field_ref="w_masstr2"  name="wmosq" long_name="square_pf_upward_ocean_mass_transport"                          /> 
    155      </file>    
    156       
    157      <file id="1m grid_W table 2.9" name_suffix="_table2.9" > 
    158        <field field_ref="avt"     name="difvho"   long_name="ocean_vertical_heat_diffusivity"                  level="2" /> 
    159        <field field_ref="avs"     name="difvso"   long_name="ocean_vertical_salt_diffusivity"                  level="2" /> 
    160        <!-- difvtrbo : ocean_vertical_tracer_diffusivity_due_to_background : cte with time, see namelist parameters nn_avb and  nn_havtb --> 
    161        <field field_ref="av_tide" name="difvtrto" long_name="ocean_vertical_tracer_diffusivity_due_to_tides"   level="2" /> 
    162        <!-- tnpeo     : tendency_of_ocean_potential_energy_content                   : not available --> 
    163        <!-- tnpeot    : tendency_of_ocean_potential_energy_content_due_to_tides      : not available --> 
    164        <!-- tnpeotb   : tendency_of_ocean_potential_energy_content_due_to_background : not available --> 
    165        <field field_ref="avm"     name="difvmo"   long_name="ocean_vertical_momentum_diffusivity"              level="2" /> 
    166        <!-- difvmbo : ocean_vertical_momentum_diffusivity_due_to_background : cte with time, see namelist parameters nn_avb --> 
    167        <field field_ref="av_tide" name="difvmto"  long_name="ocean_vertical_momentum_diffusivity_due_to_tides" level="2" /> <!-- same as tracer --> 
    168        <!-- difvmfdo : ocean_vertical_momentum_diffusivity_due_to_form_drag : ??? --> 
    169        <!-- dispkevfo : ocean_kinetic_energy_dissipation_per_unit_area_due_to_vertical_friction : not available --> 
    170      </file> 
    171  
    172      <file id="1m grid_W table 2.10" name_suffix="_table2.10" > 
    173        <!-- if ln_traldf_lap    =  .true. --> 
    174        <field field_ref="aht2d_eiv" name="diftrblo" long_name="ocean_tracer_bolus_laplacian_diffusivity"                     level="2" /> 
    175        <!-- diftrelo : ocean_tracer_epineutral_laplacian_diffusivity : cte with time, see ln_traldf_iso --> 
    176        <!-- diftrxylo : ocean_tracer_xy_laplacian_diffusivity : cte with time --> 
    177        <!-- if ln_traldf_bilap  =  .true. --> 
    178        <!-- field field_ref="diftrbbo" name="aht2d_eiv" long_name="ocean_tracer_bolus_biharmonic_diffusivity"                    level="2" /--> 
    179        <!-- diftrebo : ocean_tracer_epineutral_biharmonic_diffusivity : cte with time, see ln_traldf_iso --> 
    180        <!-- diftrxybo : ocean_tracer_xy_biharmonic_diffusivity : cte with time --> 
    181        <!-- tnkebto : tendency_of_ocean_eddy_kinetic_energy_content_due_to_bolus_transport : not available --> 
    182        <!-- difmxylo : ocean_momentum_xy_laplacian_diffusivity : cte with time, see ln_dynldf_lap --> 
    183        <!-- difmxybo : ocean_momentum_xy_biharmonic_diffusivity : cte with time, see ln_dynldf_bilap --> 
    184        <!-- dispkexyfo : ocean_kinetic_energy_dissipation_per_unit_area_due_to_xy_friction : not available --> 
    185      </file>    
    186  
    187    </file_group> 
     138   --> 
     139   <file id="file10" name_suffix="_grid_W_table2.3" > 
     140     <field field_ref="w_masstr"   name="wmo"   long_name="upward_ocean_mass_transport"                                    /> 
     141     <field field_ref="w_masstr2"  name="wmosq" long_name="square_pf_upward_ocean_mass_transport"                          /> 
     142   </file>    
     143    
     144   <file id="file11" name_suffix="_grid_W_table2.9" > 
     145     <field field_ref="avt"     name="difvho"   long_name="ocean_vertical_heat_diffusivity"                  level="2" /> 
     146     <field field_ref="avs"     name="difvso"   long_name="ocean_vertical_salt_diffusivity"                  level="2" /> 
     147     <!-- difvtrbo : ocean_vertical_tracer_diffusivity_due_to_background : cte with time, see namelist parameters nn_avb and  nn_havtb --> 
     148     <field field_ref="av_tide" name="difvtrto" long_name="ocean_vertical_tracer_diffusivity_due_to_tides"   level="2" /> 
     149     <!-- tnpeo     : tendency_of_ocean_potential_energy_content                   : not available --> 
     150     <!-- tnpeot    : tendency_of_ocean_potential_energy_content_due_to_tides      : not available --> 
     151     <!-- tnpeotb   : tendency_of_ocean_potential_energy_content_due_to_background : not available --> 
     152     <field field_ref="avm"     name="difvmo"   long_name="ocean_vertical_momentum_diffusivity"              level="2" /> 
     153     <!-- difvmbo : ocean_vertical_momentum_diffusivity_due_to_background : cte with time, see namelist parameters nn_avb --> 
     154     <field field_ref="av_tide" name="difvmto"  long_name="ocean_vertical_momentum_diffusivity_due_to_tides" level="2" /> <!-- same as tracer --> 
     155     <!-- difvmfdo : ocean_vertical_momentum_diffusivity_due_to_form_drag : ??? --> 
     156     <!-- dispkevfo : ocean_kinetic_energy_dissipation_per_unit_area_due_to_vertical_friction : not available --> 
     157   </file> 
     158    
     159   <file id="file12" name_suffix="_grid_W_table2.10" > 
     160     <!-- if ln_traldf_lap    =  .true. --> 
     161     <field field_ref="aht2d_eiv" name="diftrblo" long_name="ocean_tracer_bolus_laplacian_diffusivity"                     level="2" /> 
     162     <!-- diftrelo : ocean_tracer_epineutral_laplacian_diffusivity : cte with time, see ln_traldf_iso --> 
     163     <!-- diftrxylo : ocean_tracer_xy_laplacian_diffusivity : cte with time --> 
     164     <!-- if ln_traldf_bilap  =  .true. --> 
     165     <!-- field field_ref="diftrbbo" name="aht2d_eiv" long_name="ocean_tracer_bolus_biharmonic_diffusivity"                    level="2" /--> 
     166     <!-- diftrebo : ocean_tracer_epineutral_biharmonic_diffusivity : cte with time, see ln_traldf_iso --> 
     167     <!-- diftrxybo : ocean_tracer_xy_biharmonic_diffusivity : cte with time --> 
     168     <!-- tnkebto : tendency_of_ocean_eddy_kinetic_energy_content_due_to_bolus_transport : not available --> 
     169     <!-- difmxylo : ocean_momentum_xy_laplacian_diffusivity : cte with time, see ln_dynldf_lap --> 
     170     <!-- difmxybo : ocean_momentum_xy_biharmonic_diffusivity : cte with time, see ln_dynldf_bilap --> 
     171     <!-- dispkexyfo : ocean_kinetic_energy_dissipation_per_unit_area_due_to_xy_friction : not available --> 
     172   </file>    
    188173   <!-- 
    189174..............................................    scalar   ................................................. 
    190      --> 
    191    <file id="1m_scalar" name="auto" name_suffix="_table2.2" >         <!-- scalar --> 
     175   --> 
     176   <file id="file13" name_suffix="_scalar_table2.2" >         <!-- scalar --> 
    192177     <field field_ref="masstot"    name="masso"    long_name="sea_water_mass"                                /> 
    193178     <field field_ref="voltot"     name="volo"     long_name="sea_water_volume"                              /> 
     
    200185   <!-- 
    201186..............................................    icemod   ................................................. 
    202      --> 
    203    <file id="1m_icemod" name="auto" name_suffix="_table2.2" >         <!-- scalar --> 
     187   --> 
     188   <file id="file14" name_suffix="_icemod_table2.2" >         <!-- scalar --> 
    204189     <field field_ref="ice_pres"                     /> 
    205190     <field field_ref="ice_cover"    name="sic"        long_name="sea_ice_area_fraction"                            /> 
     
    263248      <axis id="depthw" long_name="Vertical W levels" unit="m" positive="down" /> 
    264249      <axis id="nfloat" long_name="Float number"      unit="-"  /> 
     250      <axis id="icbcla" long_name="Iceberg class"     unit="-"  /> 
    265251   </axis_definition>  
    266252     
  • branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/CONFIG/ORCA2_LIM/EXP00/iodef_default.xml

    • Property svn:mime-type deleted
    • Property svn:keywords set to Id
    r3771 r4276  
    2121    --> 
    2222     
    23     <file_definition type="multiple_file" sync_freq="1d" min_digits="4"> 
     23    <file_definition type="multiple_file" name="@expname@_@freq@_@startdate@_@enddate@" sync_freq="10d" min_digits="4"> 
    2424     
     25      <file_group id="1ts" output_freq="1ts"  output_level="10" enabled=".TRUE."/> <!-- 1 time step files --> 
     26 
    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" > 
     35   <file id="file1" name_suffix="_grid_T" description="ocean T grid variables" > 
    3436     <field field_ref="sst"          name="tos"      long_name="sea_surface_temperature"                       /> 
    3537     <field field_ref="sss"          name="sos"      long_name="sea_surface_salinity"                          /> 
     
    3739   </file> 
    3840 
    39    <file id="1d_grid_U" name="auto" description="ocean U grid variables" > 
     41   <file id="file2" name_suffix="_grid_U" description="ocean U grid variables" > 
    4042     <field field_ref="suoce"        name="uos"     long_name="sea_surface_x_velocity"    /> 
    4143   </file> 
    4244    
    43    <file id="1d_grid_V" name="auto" description="ocean V grid variables" > 
     45   <file id="file3" name_suffix="_grid_V" description="ocean V grid variables" > 
    4446     <field field_ref="svoce"        name="vos"     long_name="sea_surface_y_velocity"    /> 
    4547   </file> 
    4648    
    4749      </file_group> 
     50 
    4851      <file_group id="3d" output_freq="3d"  output_level="10" enabled=".TRUE."/> <!-- 3d files -->     
    4952 
    5053      <file_group id="5d" output_freq="5d"  output_level="10" enabled=".TRUE.">  <!-- 5d files -->    
    5154 
    52    <file id="5d_grid_T" name="auto" description="ocean T grid variables" > 
     55   <file id="file4" name_suffix="_grid_T" description="ocean T grid variables" > 
    5356     <field field_ref="toce"         name="thetao"   long_name="sea_water_potential_temperature"               /> 
    5457     <field field_ref="soce"         name="so"       long_name="sea_water_salinity"                            /> 
     
    6669   </file> 
    6770    
    68    <file id="5d_grid_U" name="auto" description="ocean U grid variables" > 
     71   <file id="file5" name_suffix="_grid_U" description="ocean U grid variables" > 
    6972     <field field_ref="uoce"         name="uo"      long_name="sea_water_x_velocity"      /> 
    7073     <field field_ref="suoce"        name="uos"     long_name="sea_surface_x_velocity"    /> 
     
    7275   </file> 
    7376    
    74    <file id="5d_grid_V" name="auto" description="ocean V grid variables" > 
     77   <file id="file6" name_suffix="_grid_V" description="ocean V grid variables" > 
    7578     <field field_ref="voce"         name="vo"      long_name="sea_water_y_velocity"      /> 
    7679     <field field_ref="svoce"        name="vos"     long_name="sea_surface_y_velocity"    /> 
     
    7881   </file> 
    7982    
    80    <file id="5d_grid_W" name="auto" description="ocean W grid variables" > 
     83   <file id="file7" name_suffix="_grid_W" description="ocean W grid variables" > 
    8184     <field field_ref="woce"         name="wo"      long_name="ocean vertical velocity"         /> 
    8285     <field field_ref="avt"          name="difvho"  long_name="ocean_vertical_heat_diffusivity" /> 
    8386   </file> 
    8487    
    85    <file id="5d_icemod" name="auto" description="ice variables" > 
     88   <file id="file8" name_suffix="_icemod" description="ice variables" > 
    8689     <field field_ref="ice_pres"                     /> 
    8790     <field field_ref="snowthic_cea" name="snd"     long_name="surface_snow_thickness"   /> 
     
    126129      <axis id="depthw" long_name="Vertical W levels" unit="m" positive="down" /> 
    127130      <axis id="nfloat" long_name="Float number"      unit="-"  /> 
     131      <axis id="icbcla" long_name="Iceberg class"     unit="-"  /> 
    128132   </axis_definition>  
    129133     
  • branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/CONFIG/ORCA2_LIM/EXP00/iodef_demo.xml

    • Property svn:mime-type deleted
    • Property svn:keywords set to Id
    r3771 r4276  
    2121    --> 
    2222     
    23     <file_definition type="multiple_file" sync_freq="1d" min_digits="4"> 
     23    <file_definition type="multiple_file" name="@expname@_@freq@_@startdate@_@enddate@" sync_freq="1d" min_digits="4"> 
    2424     
    2525      <file_group id="1h" output_freq="1h"  output_level="10" enabled=".TRUE."> <!-- 1h files --> 
    26    <file id="1h_grid_T" name="auto" description="ocean T grid variables" > 
     26   <file id="file1" name_suffix="_grid_T" description="ocean T grid variables" > 
    2727     <field field_ref="sst"  /> 
    2828     <field field_ref="qsr"  /> 
     
    3232      
    3333      <file_group id="1d" output_freq="1d"  output_level="10" enabled=".TRUE."> <!-- 1d files --> 
    34  
    35    <file_group id="1d_grid_T" name="auto" description="ocean T grid variables" > 
    36  
    37      <!-- example of "hand made" zoom  --> 
    38      <file id="blabla_1" name_suffix="_myzoom" > 
    39        <!-- group of variables sharing the same zoom. see zoom definition in domain_def.xml --> 
    40        <field_group id="blabla" domain_ref="myzoom" >     
    41          <field field_ref="toce" /> 
    42          <field field_ref="soce" /> 
    43        </field_group> 
    44      </file> 
    45  
    46      <!-- mooring: automatic definition of the file name suffix based on id="0n180wT"  --> 
    47      <!-- include a group of variables. see field_def.xml for mooring variables definition  --> 
    48      <file id="0n180wT" name_suffix="auto" > 
    49          <field_group group_ref="mooring"/>   
    50      </file> 
    51  
    52      <!-- Equatorial section: automatic definition of the file name suffix based on id="EqT" --> 
    53      <!-- Zoom over vertical axis. def of axis_ref in the axis_definition bellow --> 
    54      <file id="EqT" name_suffix="auto" > 
    55        <field_group id="EqT" domain_ref="EqT" > 
    56          <field field_ref="toce" name="votemper" axis_ref="deptht_zoom"  /> 
    57        </field_group> 
    58      </file> 
    59  
    60      <!-- global file with different operations on data   --> 
    61      <file id="blabla_2" > 
    62        <field field_ref="toce"   default_value="-10" />    <!-- redefine the missing value --> 
    63        <field field_ref="sst"    name="sstmooring1" domain_ref="0n180wT"  />   <!-- include a mooring --> 
    64        <field field_ref="sst"    name="sst_1d_ave"  />                         <!-- mean --> 
    65        <field field_ref="sst"    name="sst_1d_inst" operation="instant" />     <!-- instant value --> 
    66        <field field_ref="sst"    name="sst_1d_max"  operation="maximum" />     <!-- max --> 
    67        <field field_ref="suoce"  />   <!-- include a U-grid variable in the list --> 
    68      </file> 
    69  
    70    </file_group> 
     34    
     35   <!-- example of "hand made" zoom  --> 
     36   <file id="file2" name_suffix="_grid_T_myzoom" > 
     37     <!-- group of variables sharing the same zoom. see zoom definition in domain_def.xml --> 
     38     <field_group id="blabla" domain_ref="myzoom" >     
     39       <field field_ref="toce" /> 
     40       <field field_ref="soce" /> 
     41     </field_group> 
     42   </file> 
     43    
     44   <!-- mooring: automatic definition of the file name suffix based on id="0n180wT"  --> 
     45   <!-- include a group of variables. see field_def.xml for mooring variables definition  --> 
     46   <file id="0n180wT"> 
     47     <field_group group_ref="mooring" domain_ref="0n180wT" />   
     48   </file> 
     49    
     50   <!-- Equatorial section: automatic definition of the file name suffix based on id="EqT" --> 
     51   <!-- Zoom over vertical axis. def of axis_ref in the axis_definition bellow --> 
     52   <file id="EqT" > 
     53     <field_group id="EqT" domain_ref="EqT" > 
     54       <field field_ref="toce" name="votemper" axis_ref="deptht_myzoom"  /> 
     55       <field field_ref="sss" /> 
     56     </field_group> 
     57   </file> 
     58    
     59   <!-- global file with different operations on data   --> 
     60   <file id="file3" > 
     61     <field field_ref="toce"   default_value="-10" />    <!-- redefine the missing value --> 
     62     <field field_ref="sst"    name="sstmooring1" domain_ref="0n180wT"  />   <!-- include a mooring --> 
     63     <field field_ref="sst"    name="sst_1d_ave"  />                         <!-- mean --> 
     64     <field field_ref="sst"    name="sst_1d_inst" operation="instant" />     <!-- instant value --> 
     65     <field field_ref="sst"    name="sst_1d_max"  operation="maximum" />     <!-- max --> 
     66     <field field_ref="suoce"  />   <!-- include a U-grid variable in the list --> 
     67   </file> 
     68    
    7169      </file_group> 
    72  
    73    </file_definition> 
     70       
     71    </file_definition> 
    7472     
    7573    <!--  
     
    8280     <axis_group id="deptht" long_name="Vertical T levels" unit="m" positive="down" > 
    8381       <axis id="deptht" /> 
    84        <axis id="deptht_zoom" zoom_begin="1" zoom_end="10" /> 
     82       <axis id="deptht_myzoom" zoom_begin="1" zoom_end="10" /> 
    8583     </axis_group> 
    8684      <axis id="depthu" long_name="Vertical U levels" unit="m" positive="down" /> 
     
    8886      <axis id="depthw" long_name="Vertical W levels" unit="m" positive="down" /> 
    8987      <axis id="nfloat" long_name="Float number"      unit="-"  /> 
     88      <axis id="icbcla" long_name="Iceberg class"     unit="-"  /> 
    9089   </axis_definition>  
    9190     
  • branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/CONFIG/ORCA2_LIM/EXP00/iodef_oldstyle.xml

    • Property svn:mime-type deleted
    • Property svn:keywords set to Id
    r3771 r4276  
    2121    --> 
    2222     
    23     <file_definition type="multiple_file" sync_freq="1d" min_digits="4"> 
     23    <file_definition type="multiple_file" name="@expname@_@freq@_@startdate@_@enddate@" sync_freq="1mo" min_digits="4"> 
    2424     
     25      <file_group id="1ts" output_freq="1ts"  output_level="10" enabled=".TRUE."/> <!-- 1 time step files --> 
     26 
    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 --> 
     
    3335      <file_group id="5d" output_freq="5d"  output_level="10" enabled=".TRUE.">  <!-- 5d files -->    
    3436 
    35    <file id="5d_grid_T" name="auto" description="ocean T grid variables" > 
     37   <file id="file1" name_suffix="_grid_T" description="ocean T grid variables" > 
    3638     <field field_ref="toce"         name="votemper"  /> 
    3739     <field field_ref="soce"         name="vosaline"  /> 
     
    5254   </file> 
    5355    
    54    <file id="5d_grid_U" name="auto" description="ocean U grid variables" > 
     56   <file id="file2" name_suffix="_grid_U" description="ocean U grid variables" > 
    5557     <field field_ref="uoce"         name="vozocrtx"  /> 
    5658     <field field_ref="uoce_eiv"     name="vozoeivu"  /> 
     
    5860   </file> 
    5961    
    60    <file id="5d_grid_V" name="auto" description="ocean V grid variables" > 
     62   <file id="file3" name_suffix="_grid_V" description="ocean V grid variables" > 
    6163     <field field_ref="voce"         name="vomecrty"  /> 
    6264     <field field_ref="voce_eiv"     name="vomeeivv"  /> 
     
    6466   </file> 
    6567    
    66    <file id="5d_grid_W" name="auto" description="ocean W grid variables" > 
     68   <file id="file4" name_suffix="_grid_W" description="ocean V grid variables" > 
    6769     <field field_ref="woce"         name="vovecrtz" /> 
    6870     <field field_ref="avt"          name="votkeavt" /> 
     
    7173   </file> 
    7274    
    73    <file id="5d_icemod" name="auto" description="ice variables" > 
     75   <file id="file5" name_suffix="_icemod" description="ocean V grid variables" > 
    7476     <field field_ref="ice_pres"                     /> 
    7577     <field field_ref="snowthic_cea" name="isnowthi" /> 
     
    114116      <axis id="depthw" long_name="Vertical W levels" unit="m" positive="down" /> 
    115117      <axis id="nfloat" long_name="Float number"      unit="-"  /> 
     118      <axis id="icbcla" long_name="Iceberg class"     unit="-"  /> 
    116119   </axis_definition>  
    117120     
  • branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/CONFIG/ORCA2_LIM/EXP00/namelist_ice_lim2

    r2580 r4276  
    8989!              !              !  (if <0  months)  !   name   !  (logical)   !  (T/F) ! 'monthly' ! filename ! pairing  ! 
    9090   sn_hicif    = 'ice_damping',  -1.              , 'hicif'  ,   .true.     , .true. , 'yearly'  , ''       , '' 
    91    sn_cnf      = 'ice_damping',  -1.              , 'frld'   ,   .true.     , .true. , 'yearly'  , ''       , '' 
     91   sn_frld     = 'ice_damping',  -1.              , 'frld'   ,   .true.     , .true. , 'yearly'  , ''       , '' 
    9292! 
    9393   cn_dir      = './'      !  root directory for the location of the runoff files 
  • branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/CONFIG/ORCA2_LIM_CFC_C14b/EXP00/iodef.xml

    r3771 r4276  
    2121    --> 
    2222     
    23     <file_definition type="multiple_file" sync_freq="1d" min_digits="4"> 
     23    <file_definition type="multiple_file" name="@expname@_@freq@_@startdate@_@enddate@" sync_freq="1d" min_digits="4"> 
    2424     
    2525      <file_group id="1h" output_freq="1h"  output_level="10" enabled=".TRUE."/> <!-- 1h files --> 
     
    6060      <axis id="depthw" long_name="Vertical W levels" unit="m" positive="down" /> 
    6161      <axis id="nfloat" long_name="Float number"      unit="-"  /> 
     62      <axis id="icbcla" long_name="Iceberg class"     unit="-"  /> 
    6263   </axis_definition>  
    6364     
  • branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/CONFIG/ORCA2_LIM_CFC_C14b/EXP00/namelist

    r3795 r4276  
    318318   rn_alphdi   =    0.72   !  (Pyane, 1972) 
    319319/ 
    320  
     320!----------------------------------------------------------------------- 
     321&namberg       !   iceberg parameters 
     322!----------------------------------------------------------------------- 
     323      ln_icebergs              = .false. 
     324      ln_bergdia               = .true.               ! Calculate budgets 
     325      nn_verbose_level         = 1                    ! Turn on more verbose output if level > 0 
     326      nn_verbose_write         = 15                   ! Timesteps between verbose messages 
     327      nn_sample_rate           = 1                    ! Timesteps between sampling for trajectory storage 
     328                                                      ! Initial mass required for an iceberg of each class 
     329      rn_initial_mass          = 8.8e7, 4.1e8, 3.3e9, 1.8e10, 3.8e10, 7.5e10, 1.2e11, 2.2e11, 3.9e11, 7.4e11 
     330                                                      ! Proportion of calving mass to apportion to each class   
     331      rn_distribution          = 0.24, 0.12, 0.15, 0.18, 0.12, 0.07, 0.03, 0.03, 0.03, 0.02 
     332                                                      ! Ratio between effective and real iceberg mass (non-dim) 
     333                                                      ! i.e. number of icebergs represented at a point          
     334      rn_mass_scaling          = 2000, 200, 50, 20, 10, 5, 2, 1, 1, 1 
     335                                                      ! thickness of newly calved bergs (m) 
     336      rn_initial_thickness     = 40., 67., 133., 175., 250., 250., 250., 250., 250., 250. 
     337      rn_rho_bergs             = 850.                 ! Density of icebergs 
     338      rn_LoW_ratio             = 1.5                  ! Initial ratio L/W for newly calved icebergs 
     339      ln_operator_splitting    = .true.               ! Use first order operator splitting for thermodynamics 
     340      rn_bits_erosion_fraction = 0.                   ! Fraction of erosion melt flux to divert to bergy bits 
     341      rn_sicn_shift            = 0.                   ! Shift of sea-ice concn in erosion flux (0<sicn_shift<1) 
     342      ln_passive_mode          = .false.              ! iceberg - ocean decoupling    
     343      nn_test_icebergs         =  10                  ! Create test icebergs of this class (-1 = no) 
     344                                                      ! Put a test iceberg at each gridpoint in box (lon1,lon2,lat1,lat2) 
     345      rn_test_box              = 108.0,  116.0, -66.0, -58.0 
     346      rn_speed_limit           = 0.                   ! CFL speed limit for a berg    
     347 
     348               ! filename ! freq (hours) ! variable ! time interp. ! clim  !'yearly' or ! weights  ! rotation ! 
     349               !          ! (<0  months) !   name   !  (logical)   ! (T/F) ! 'monthly'  ! filename ! pairing  ! 
     350      sn_icb =  'calving' ,     -1       , 'calvingmask',  .true.      , .true., 'yearly'   , ' '      , ' ' 
     351    
     352      cn_dir = './'  
     353/ 
    321354!!====================================================================== 
    322355!!               ***  Lateral boundary condition  *** 
  • branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/CONFIG/ORCA2_LIM_PISCES/EXP00/iodef.xml

    r3771 r4276  
    2121    --> 
    2222     
    23     <file_definition type="multiple_file" sync_freq="1d" min_digits="4"> 
     23    <file_definition type="multiple_file" name="@expname@_@freq@_@startdate@_@enddate@" sync_freq="10d" min_digits="4"> 
    2424     
    2525      <file_group id="1h" output_freq="1h"  output_level="10" enabled=".TRUE."/> <!-- 1h files --> 
     
    3131      <file_group id="1d" output_freq="1d"  output_level="10" enabled=".TRUE."> <!-- 1d files --> 
    3232 
    33    <file id="1d_grid_T" name="auto" description="ocean T grid variables" > 
     33   <file id="file1" name_suffix="_grid_T" description="ocean T grid variables" > 
    3434     <field field_ref="sst"          name="sosstsst"  /> 
    3535     <field field_ref="sss"          name="sosaline"  /> 
     
    3737   </file> 
    3838 
    39    <file id="1d_grid_U" name="auto" description="ocean U grid variables" > 
     39   <file id="file2" name_suffix="_grid_U" description="ocean U grid variables" > 
    4040     <field field_ref="suoce"         name="vozocrtx"  /> 
    4141   </file> 
    4242    
    43    <file id="1d_grid_V" name="auto" description="ocean V grid variables" > 
     43   <file id="file3" name_suffix="_grid_V" description="ocean V grid variables" > 
    4444     <field field_ref="svoce"         name="vomecrty"  /> 
    4545   </file> 
     
    4949      <file_group id="5d" output_freq="5d"  output_level="10" enabled=".TRUE.">  <!-- 5d files -->    
    5050 
    51    <file id="5d_grid_T" name="auto" description="ocean T grid variables" > 
     51   <file id="file4" name_suffix="_grid_T" description="ocean T grid variables" > 
    5252     <field field_ref="toce"         name="votemper"  /> 
    5353     <field field_ref="soce"         name="vosaline"  /> 
     
    5858     <field field_ref="qsr"          name="soshfldo"  /> 
    5959          <field field_ref="saltflx"      name="sosfldow"  /> 
     60          <field field_ref="fmmflx"       name="sofmflup"  /> 
    6061     <field field_ref="qt"           name="sohefldo"  /> 
    6162     <field field_ref="mldr10_1"     name="somxl010"  /> 
     
    6869   </file> 
    6970    
    70    <file id="5d_grid_U" name="auto" description="ocean U grid variables" > 
     71   <file id="file5" name_suffix="_grid_U" description="ocean U grid variables" > 
    7172     <field field_ref="uoce"         name="vozocrtx"  /> 
    7273     <field field_ref="uoce_eiv"     name="vozoeivu"  /> 
     
    7475   </file> 
    7576    
    76    <file id="5d_grid_V" name="auto" description="ocean V grid variables" > 
     77   <file id="file6" name_suffix="_grid_V" description="ocean V grid variables" > 
    7778     <field field_ref="voce"         name="vomecrty"  /> 
    7879     <field field_ref="voce_eiv"     name="vomeeivv"  /> 
     
    8081   </file> 
    8182    
    82    <file id="5d_grid_W" name="auto" description="ocean W grid variables" > 
     83   <file id="file7" name_suffix="_grid_W" description="ocean W grid variables" > 
    8384     <field field_ref="woce"         name="vovecrtz" /> 
    8485     <field field_ref="avt"          name="votkeavt" /> 
     
    8788   </file> 
    8889    
    89    <file id="5d_icemod" name="auto" description="ice variables" > 
     90   <file id="file8" name_suffix="_icemod" description="ice variables" > 
    9091     <field field_ref="ice_pres"                     /> 
    9192     <field field_ref="snowthic_cea" name="isnowthi" /> 
     
    107108      <file_group id="1m" output_freq="1mo" output_level="10" enabled=".TRUE."> <!-- real monthly files --> 
    108109 
    109    <file id="1m_ptrc_T" name="auto" description="pisces sms variables" > 
     110   <file id="file9" name_suffix="_ptrc_T" description="pisces sms variables" > 
    110111          <field field_ref="DIC"      /> 
    111112          <field field_ref="Alkalini" /> 
     
    119120   </file> 
    120121    
    121    <file id="1m_diad_T" name="auto" description="additional pisces diagnostics" > 
     122   <file id="file10" name_suffix="_diad_T" description="additional pisces diagnostics" > 
    122123          <field field_ref="Cflx"     /> 
    123124          <field field_ref="Dpco2"    /> 
     
    132133      <file_group id="1y"  output_freq="1y" output_level="10" enabled=".TRUE."> <!-- real yearly files --> 
    133134 
    134    <file id="1y_ptrc_T" name="auto" description="pisces sms variables" > 
     135   <file id="file11" name_suffix="_ptrc_T" description="pisces sms variables" > 
    135136          <field field_ref="DIC"      /> 
    136137          <field field_ref="Alkalini" /> 
     
    159160   </file> 
    160161 
    161    <file id="1y_diad_T" name="auto" description="additional pisces diagnostics" > 
     162   <file id="file12" name_suffix="_diad_T" description="additional pisces diagnostics" > 
    162163          <field field_ref="PH"       /> 
    163164          <field field_ref="CO3"      /> 
     
    229230      <axis id="depthw" long_name="Vertical W levels" unit="m" positive="down" /> 
    230231      <axis id="nfloat" long_name="Float number"      unit="-"  /> 
     232      <axis id="icbcla" long_name="Iceberg class"     unit="-"  /> 
    231233   </axis_definition>  
    232234     
  • branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/CONFIG/ORCA2_LIM_PISCES/EXP00/namelist_pisces

    r3824 r4276  
    3030   cn_dir      = './'     !  root directory for the location of the dynamical files 
    3131! 
    32    ln_presatm  = .true.   ! constant atmopsheric pressure (F) or from a file (T) 
     32   ln_presatm  = .false.   ! constant atmopsheric pressure (F) or from a file (T) 
    3333/ 
    3434!''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 
     
    3939   xkmort     =  2.E-7    ! half saturation constant for mortality 
    4040   ferat3     =  10.E-6   ! Fe/C in zooplankton  
    41    wsbio2     =  30.      ! Big particles sinking speed 
     41   wsbio2     =  50.      ! Big particles sinking speed 
    4242   niter1max  =  1        ! Maximum number of iterations for POC 
    4343   niter2max  =  1        ! Maximum number of iterations for GOC 
     
    4747!,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, 
    4848   concnno3   =  1.e-6    ! Nitrate half saturation of nanophytoplankton 
    49    concdno3   =  3.E-6   ! Phosphate half saturation for diatoms 
     49   concdno3   =  3.E-6    ! Phosphate half saturation for diatoms 
    5050   concnnh4   =  1.E-7    ! NH4 half saturation for phyto 
    51    concdnh4   =  3.E-7   ! NH4 half saturation for diatoms 
    52    concnfer   =  1.E-9     ! Iron half saturation for phyto 
    53    concdfer   =  3.E-9   ! Iron half saturation for diatoms 
     51   concdnh4   =  3.E-7    ! NH4 half saturation for diatoms 
     52   concnfer   =  1.E-9    ! Iron half saturation for phyto 
     53   concdfer   =  3.E-9    ! Iron half saturation for diatoms 
    5454   concbfe    =  1.E-11   ! Half-saturation for Fe limitation of Bacteria 
    5555   concbnh4   =  2.5E-8   ! NH4 half saturation for phyto 
     
    6060   xsizerd    =  3.0      ! Size ratio for diatoms 
    6161   xksi1      =  2.E-6    ! half saturation constant for Si uptake 
    62    xksi2      =  20E-6  ! half saturation constant for Si/C 
     62   xksi2      =  20E-6    ! half saturation constant for Si/C 
    6363   xkdoc      =  417.E-6  ! half-saturation constant of DOC remineralization 
    6464   qnfelim    =  7.E-6    ! Optimal quota of phyto 
     
    8484   excret2    =  0.05     ! excretion ratio of diatoms 
    8585   ln_newprod =  .true.   ! Enable new parame. of production (T/F)  
    86    bresp      =  0.00333  ! Basal respiration rate 
     86   bresp      =  0.0333   ! Basal respiration rate 
    8787   chlcnm     =  0.033    ! Minimum Chl/C in nanophytoplankton 
    8888   chlcdm     =  0.05     ! Minimum Chl/C in diatoms 
     
    106106   part2      =  0.75     ! part of calcite not dissolved in mesozoo guts 
    107107   grazrat2   =  0.75     ! maximal mesozoo grazing rate 
    108    resrat2    =  0.005    ! exsudation rate of mesozooplankton 
     108   resrat2    =  0.01     ! exsudation rate of mesozooplankton 
    109109   mzrat2     =  0.03     ! mesozooplankton mortality rate 
    110110   xprefc     =  1.       ! zoo preference for phyto 
     
    118118   xthresh2   =  3E-7     ! Food threshold for grazing 
    119119   xkgraz2    =  20.E-6   ! half sturation constant for meso grazing 
    120    epsher2    =  0.3      ! Efficicency of Mesozoo growth 
     120   epsher2    =  0.4      ! Efficicency of Mesozoo growth 
    121121   sigma2     =  0.6      ! Fraction of mesozoo excretion as DOM 
    122122   unass2     =  0.3      ! non assimilated fraction of P by mesozoo 
     
    128128   part       =  0.5      ! part of calcite not dissolved in microzoo gutsa 
    129129   grazrat    =  3.0      ! maximal zoo grazing rate 
    130    resrat     =  0.03     ! exsudation rate of zooplankton 
     130   resrat     =  0.05     ! exsudation rate of zooplankton 
    131131   mzrat      =  0.004    ! zooplankton mortality rate 
    132132   xpref2c    =  0.1      ! Microzoo preference for POM 
     
    138138   xthresh    =  3.E-7    ! Food threshold for feeding 
    139139   xkgraz     =  20.E-6   ! half sturation constant for grazing 
    140    epsher     =  0.3      ! Efficiency of microzoo growth 
     140   epsher     =  0.4      ! Efficiency of microzoo growth 
    141141   sigma1     =  0.6      ! Fraction of microzoo excretion as DOM 
    142142   unass      =  0.3      ! non assimilated fraction of phyto by zoo 
     
    146146!,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, 
    147147   ln_fechem =  .false.   ! complex iron chemistry ( T/F ) 
    148    ln_ligvar =  .true.   ! variable ligand concentration 
     148   ln_ligvar =  .false.   ! variable ligand concentration 
    149149   xlam1     =  0.005     ! scavenging rate of Iron 
    150150   xlamdust  =  150.0     ! Scavenging rate of dust 
     
    154154&nampisrem     !   parameters for remineralization 
    155155!,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, 
    156    xremik    =  0.35      ! remineralization rate of DOC 
     156   xremik    =  0.3       ! remineralization rate of DOC 
    157157   xremip    =  0.025     ! remineralisation rate of POC 
    158158   nitrif    =  0.05      ! NH4 nitrification rate 
     
    261261&nampismass     !  Mass conservation 
    262262!,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, 
    263    ln_check_mass =  .false.    !  Check mass conservation 
    264 / 
     263   ln_check_mass =  .true.    !  Check mass conservation 
     264/ 
  • branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/CONFIG/ORCA2_OFF_PISCES/EXP00/iodef.xml

    r3771 r4276  
    2121    --> 
    2222     
    23     <file_definition type="multiple_file" sync_freq="1d" min_digits="4"> 
     23    <file_definition type="multiple_file" name="@expname@_@freq@_@startdate@_@enddate@" sync_freq="1d" min_digits="4"> 
    2424     
    2525      <file_group id="1h" output_freq="1h"  output_level="10" enabled=".TRUE."/> <!-- 1h files --> 
     
    3535      <file_group id="1m" output_freq="1mo" output_level="10" enabled=".TRUE."> <!-- real monthly files --> 
    3636 
    37    <file id="1m_ptrc_T" name="auto" description="pisces sms variables" > 
     37   <file id="file1" name_suffix="_ptrc_T" description="pisces sms variables" > 
    3838          <field field_ref="DIC"      /> 
    3939          <field field_ref="Alkalini" /> 
     
    4747   </file> 
    4848    
    49    <file id="1m_diad_T" name="auto" description="additional pisces diagnostics" > 
     49   <file id="file2" name_suffix="_diad_T" description="additional pisces diagnostics" > 
    5050          <field field_ref="Cflx"     /> 
    5151          <field field_ref="Dpco2"    /> 
     
    6060      <file_group id="1y"  output_freq="1y" output_level="10" enabled=".TRUE."> <!-- real yearly files --> 
    6161 
    62    <file id="1y_ptrc_T" name="auto" description="pisces sms variables" > 
     62   <file id="file3" name_suffix="_ptrc_T" description="pisces sms variables" > 
    6363          <field field_ref="DIC"      /> 
    6464          <field field_ref="Alkalini" /> 
     
    8787   </file> 
    8888 
    89    <file id="1y_diad_T" name="auto" description="additional pisces diagnostics" > 
     89   <file id="file4" name_suffix="_diad_T" description="additional pisces diagnostics" > 
    9090          <field field_ref="PH"       /> 
    9191          <field field_ref="CO3"      /> 
     
    157157      <axis id="depthw" long_name="Vertical W levels" unit="m" positive="down" /> 
    158158      <axis id="nfloat" long_name="Float number"      unit="-"  /> 
     159      <axis id="icbcla" long_name="Iceberg class"     unit="-"  /> 
    159160   </axis_definition>  
    160161     
  • branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/CONFIG/ORCA2_OFF_PISCES/EXP00/namelist

    r3795 r4276  
    665665   sn_mld  = 'dyna_grid_T' ,    120            , 'somixhgt' ,  .true.    , .true. ,   'yearly'  , ''       , '' 
    666666   sn_emp  = 'dyna_grid_T' ,    120            , 'sowaflup' ,  .true.    , .true. ,   'yearly'  , ''       , '' 
    667    sn_sfx  = 'dyna_grid_T' ,    120            , 'sowaflcd' ,  .true.    , .true. ,   'yearly'  , ''       , '' 
     667   sn_fmf  = 'dyna_grid_T' ,    120            , 'iowaflup' ,  .true.    , .true. ,   'yearly'  , ''       , '' 
    668668   sn_ice  = 'dyna_grid_T' ,    120            , 'soicecov' ,  .true.    , .true. ,   'yearly'  , ''       , '' 
    669669   sn_qsr  = 'dyna_grid_T' ,    120            , 'soshfldo' ,  .true.    , .true. ,   'yearly'  , ''       , '' 
  • branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/CONFIG/ORCA2_OFF_PISCES/EXP00/namelist_pisces

    r3824 r4276  
    3030   cn_dir      = './'     !  root directory for the location of the dynamical files 
    3131! 
    32    ln_presatm  = .true.   ! constant atmopsheric pressure (F) or from a file (T) 
     32   ln_presatm  = .false.   ! constant atmopsheric pressure (F) or from a file (T) 
    3333/ 
    3434!''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 
     
    3939   xkmort     =  2.E-7    ! half saturation constant for mortality 
    4040   ferat3     =  10.E-6   ! Fe/C in zooplankton  
    41    wsbio2     =  30.      ! Big particles sinking speed 
     41   wsbio2     =  50.      ! Big particles sinking speed 
    4242   niter1max  =  1        ! Maximum number of iterations for POC 
    4343   niter2max  =  1        ! Maximum number of iterations for GOC 
     
    4747!,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, 
    4848   concnno3   =  1.e-6    ! Nitrate half saturation of nanophytoplankton 
    49    concdno3   =  3.E-6   ! Phosphate half saturation for diatoms 
     49   concdno3   =  3.E-6    ! Phosphate half saturation for diatoms 
    5050   concnnh4   =  1.E-7    ! NH4 half saturation for phyto 
    51    concdnh4   =  3.E-7   ! NH4 half saturation for diatoms 
    52    concnfer   =  1.E-9     ! Iron half saturation for phyto 
    53    concdfer   =  3.E-9   ! Iron half saturation for diatoms 
     51   concdnh4   =  3.E-7    ! NH4 half saturation for diatoms 
     52   concnfer   =  1.E-9    ! Iron half saturation for phyto 
     53   concdfer   =  3.E-9    ! Iron half saturation for diatoms 
    5454   concbfe    =  1.E-11   ! Half-saturation for Fe limitation of Bacteria 
    5555   concbnh4   =  2.5E-8   ! NH4 half saturation for phyto 
     
    6060   xsizerd    =  3.0      ! Size ratio for diatoms 
    6161   xksi1      =  2.E-6    ! half saturation constant for Si uptake 
    62    xksi2      =  20E-6  ! half saturation constant for Si/C 
     62   xksi2      =  20E-6    ! half saturation constant for Si/C 
    6363   xkdoc      =  417.E-6  ! half-saturation constant of DOC remineralization 
    6464   qnfelim    =  7.E-6    ! Optimal quota of phyto 
     
    8484   excret2    =  0.05     ! excretion ratio of diatoms 
    8585   ln_newprod =  .true.   ! Enable new parame. of production (T/F)  
    86    bresp      =  0.00333  ! Basal respiration rate 
     86   bresp      =  0.0333   ! Basal respiration rate 
    8787   chlcnm     =  0.033    ! Minimum Chl/C in nanophytoplankton 
    8888   chlcdm     =  0.05     ! Minimum Chl/C in diatoms 
     
    106106   part2      =  0.75     ! part of calcite not dissolved in mesozoo guts 
    107107   grazrat2   =  0.75     ! maximal mesozoo grazing rate 
    108    resrat2    =  0.005    ! exsudation rate of mesozooplankton 
     108   resrat2    =  0.01     ! exsudation rate of mesozooplankton 
    109109   mzrat2     =  0.03     ! mesozooplankton mortality rate 
    110110   xprefc     =  1.       ! zoo preference for phyto 
     
    118118   xthresh2   =  3E-7     ! Food threshold for grazing 
    119119   xkgraz2    =  20.E-6   ! half sturation constant for meso grazing 
    120    epsher2    =  0.3      ! Efficicency of Mesozoo growth 
     120   epsher2    =  0.4      ! Efficicency of Mesozoo growth 
    121121   sigma2     =  0.6      ! Fraction of mesozoo excretion as DOM 
    122122   unass2     =  0.3      ! non assimilated fraction of P by mesozoo 
     
    128128   part       =  0.5      ! part of calcite not dissolved in microzoo gutsa 
    129129   grazrat    =  3.0      ! maximal zoo grazing rate 
    130    resrat     =  0.03     ! exsudation rate of zooplankton 
     130   resrat     =  0.05     ! exsudation rate of zooplankton 
    131131   mzrat      =  0.004    ! zooplankton mortality rate 
    132132   xpref2c    =  0.1      ! Microzoo preference for POM 
     
    138138   xthresh    =  3.E-7    ! Food threshold for feeding 
    139139   xkgraz     =  20.E-6   ! half sturation constant for grazing 
    140    epsher     =  0.3      ! Efficiency of microzoo growth 
     140   epsher     =  0.4      ! Efficiency of microzoo growth 
    141141   sigma1     =  0.6      ! Fraction of microzoo excretion as DOM 
    142142   unass      =  0.3      ! non assimilated fraction of phyto by zoo 
     
    146146!,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, 
    147147   ln_fechem =  .false.   ! complex iron chemistry ( T/F ) 
    148    ln_ligvar =  .true.   ! variable ligand concentration 
     148   ln_ligvar =  .false.   ! variable ligand concentration 
    149149   xlam1     =  0.005     ! scavenging rate of Iron 
    150150   xlamdust  =  150.0     ! Scavenging rate of dust 
     
    154154&nampisrem     !   parameters for remineralization 
    155155!,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, 
    156    xremik    =  0.35      ! remineralization rate of DOC 
     156   xremik    =  0.3       ! remineralization rate of DOC 
    157157   xremip    =  0.025     ! remineralisation rate of POC 
    158158   nitrif    =  0.05      ! NH4 nitrification rate 
     
    261261&nampismass     !  Mass conservation 
    262262!,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, 
    263    ln_check_mass =  .false.    !  Check mass conservation 
    264 / 
     263   ln_check_mass =  .true.    !  Check mass conservation 
     264/ 
  • branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/CONFIG/ORCA2_SAS_LIM/EXP00/iodef.xml

    r3771 r4276  
    2121    --> 
    2222     
    23     <file_definition type="multiple_file" sync_freq="1d" min_digits="4"> 
     23    <file_definition type="multiple_file" name="@expname@_@freq@_@startdate@_@enddate@" sync_freq="1d" min_digits="4"> 
    2424     
    2525      <file_group id="1h" output_freq="1h"  output_level="10" enabled=".TRUE."/> <!-- 1h files --> 
     
    6060      <axis id="depthw" long_name="Vertical W levels" unit="m" positive="down" /> 
    6161      <axis id="nfloat" long_name="Float number"      unit="-"  /> 
     62      <axis id="icbcla" long_name="Iceberg class"     unit="-"  /> 
    6263   </axis_definition>  
    6364     
  • branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/CONFIG/ORCA2_SAS_LIM/EXP00/namelist_ice_lim2

    r3331 r4276  
    8989!              !              !  (if <0  months)  !   name   !  (logical)   !  (T/F) ! 'monthly' ! filename ! pairing  ! 
    9090   sn_hicif    = 'ice_damping',  -1.              , 'hicif'  ,   .true.     , .true. , 'yearly'  , ''       , '' 
    91    sn_cnf      = 'ice_damping',  -1.              , 'frld'   ,   .true.     , .true. , 'yearly'  , ''       , '' 
     91   sn_frld     = 'ice_damping',  -1.              , 'frld'   ,   .true.     , .true. , 'yearly'  , ''       , '' 
    9292! 
    9393   cn_dir      = './'      !  root directory for the location of the runoff files 
  • branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/CONFIG/SHARED/field_def.xml

    r3824 r4276  
    5353 
    5454         <field id="empmr"        long_name="Net Upward Water Flux"                                        unit="kg/m2/s"  /> 
    55          <field id="saltflx"      long_name="Downward salt flux"                                          unit="PSU/m2/s"  /> 
     55         <field id="saltflx"      long_name="Downward salt flux"                                           unit="PSU/m2/s"  /> 
     56         <field id="fmmflx"       long_name="Water flux due to freezing/melting"                           unit="kg/m2/s"  /> 
    5657         <field id="snowpre"      long_name="Snow precipitation"                                           unit="kg/m2/s"  /> 
    5758         <field id="runoffs"      long_name="River Runoffs"                                                unit="Kg/m2/s"  /> 
     
    218219        <field id="traj_dens"  long_name="floats density"     unit="kg/m3" /> 
    219220        <field id="traj_group" long_name="floats group"       unit="none"  /> 
     221      </field_group> 
     222 
     223      <!-- variables available with iceberg trajectories --> 
     224      <field_group id="icbvar" domain_ref="grid_T"  >  
     225        <field id="berg_melt"          long_name="icb melt rate of icebergs"                     unit="kg/m2/s"   /> 
     226        <field id="berg_buoy_melt"     long_name="icb buoyancy component of iceberg melt rate"   unit="kg/m2/s"   /> 
     227        <field id="berg_eros_melt"     long_name="icb erosion component of iceberg melt rate"    unit="kg/m2/s"   /> 
     228        <field id="berg_conv_melt"     long_name="icb convective component of iceberg melt rate" unit="kg/m2/s"   /> 
     229        <field id="berg_virtual_area"  long_name="icb virtual coverage by icebergs"              unit="m2"        /> 
     230        <field id="bits_src"           long_name="icb mass source of bergy bits"                 unit="kg/m2/s"   /> 
     231        <field id="bits_melt"          long_name="icb melt rate of bergy bits"                   unit="kg/m2/s"   /> 
     232        <field id="bits_mass"          long_name="icb bergy bit density field"                   unit="kg/m2"     /> 
     233        <field id="berg_mass"          long_name="icb iceberg density field"                     unit="kg/m2"     /> 
     234        <field id="calving"            long_name="icb calving mass input"                        unit="kg/s"      /> 
     235        <field id="berg_floating_melt" long_name="icb melt rate of icebergs + bits"              unit="kg/m2/s"   /> 
     236        <field id="berg_real_calving"  long_name="icb calving into iceberg class"                unit="kg/s"     axis_ref="icbcla" /> 
     237        <field id="berg_stored_ice"    long_name="icb accumulated ice mass by class"             unit="kg"       axis_ref="icbcla" /> 
    220238      </field_group> 
    221239 
     
    248266       <field id="NH4"      long_name="Ammonium Concentration"                   unit="mmol/m3" /> 
    249267 
     268       <!-- PISCES with Kriest parametisation : variables available with key_kriest --> 
     269       <field id="Num"      long_name="Number of organic particles"              unit="nbr" /> 
     270 
     271       <!-- PISCES light : variables available with key_pisces_reduced --> 
    250272       <field id="DET"      long_name="Detritus"                                 unit="mmol-N/m3" /> 
    251273       <field id="DOM"      long_name="Dissolved Organic Matter"                 unit="mmol-N/m3" /> 
    252274 
     275       <!-- CFC11 : variables available with key_cfc --> 
    253276       <field id="CFC11"    long_name="CFC-11 Concentration"                     unit="umol/L" /> 
     277       <!-- Bomb C14 : variables available with key_c14b --> 
    254278       <field id="C14B"     long_name="Bomb C14 Concentration"                   unit="ration" /> 
    255279     </field_group> 
    256280 
    257       <!-- diad on T grid : variables available with key_diatrc --> 
    258  
     281      <!-- PISCES additional diagnostics on T grid  --> 
    259282     <field_group id="diad_T" grid_ref="grid_T_2D"> 
    260283       <field id="PH"          long_name="PH"                                      unit="-"          grid_ref="grid_T_3D" /> 
     
    310333       <field id="Heup"        long_name="Euphotic layer depth"                    unit="m"                            /> 
    311334       <field id="Irondep"     long_name="Iron deposition from dust"               unit="mol/m2/s"                     /> 
    312        <field id="Ironsed"     long_name="Iron deposition from sediment"           unit="mol/m2/s"  grid_ref="grid_T_3D"  /> 
    313  
    314        <field id="FNO3PHY"  long_name="FNO3PHY"                             unit="-"  grid_ref="grid_T_3D" />  
    315        <field id="FNH4PHY"  long_name="FNH4PHY"                             unit="-"  grid_ref="grid_T_3D" />  
    316        <field id="FNH4NO3"  long_name="FNH4NO3"                             unit="-"  grid_ref="grid_T_3D" />  
    317        <field id="TNO3PHY"  long_name="TNO3PHY"                             unit="-"  />  
    318        <field id="TNH4PHY"  long_name="TNH4PHY"                             unit="-"  />  
    319        <field id="TPHYDOM"  long_name="TPHYDOM"                             unit="-"  />  
    320        <field id="TPHYNH4"  long_name="TPHYNH4"                             unit="-"  />  
    321        <field id="TPHYZOO"  long_name="TPHYZOO"                             unit="-"  />  
    322        <field id="TPHYDET"  long_name="TPHYDET"                             unit="-"  />  
    323        <field id="TDETZOO"  long_name="TDETZOO"                             unit="-"  />  
    324        <field id="TZOODET"  long_name="TZOODET"                             unit="-"  />  
    325        <field id="TZOOBOD"  long_name="TZOOBOD"                             unit="-"  />  
    326        <field id="TZOONH4"  long_name="TZOONH4"                             unit="-"  />  
    327        <field id="TZOODOM"  long_name="TZOODOM"                             unit="-"  />  
    328        <field id="TNH4NO3"  long_name="TNH4NO3"                             unit="-"  />  
    329        <field id="TDOMNH4"  long_name="TDOMNH4"                             unit="-"  />  
    330        <field id="TDETNH4"  long_name="TDETNH4"                             unit="-"  />  
    331        <field id="TPHYTOT"  long_name="TPHYTOT"                             unit="-"  />  
    332        <field id="TZOOTOT"  long_name="TZOOTOT"                             unit="-"  />  
    333        <field id="SEDPOC"   long_name="SEDPOC"                              unit="-"  />  
    334        <field id="TDETSED"  long_name="TDETSED"                             unit="-"  />  
    335  
    336        <field id="qtrCFC11"     long_name="Air-sea flux of CFC-11"                   unit="mol/m2/s"   /> 
    337        <field id="qintCFC11"    long_name="Cumulative air-sea flux of CFC-11"        unit="mol/m2"     /> 
    338        <field id="qtrC14b"      long_name="Air-sea flux of Bomb C14"                 unit="mol/m2/s"   /> 
    339        <field id="qintC14b"     long_name="Cumulative air-sea flux of Bomb C14"      unit="mol/m2"     /> 
    340        <field id="fdecay"       long_name="Radiactive decay of Bomb C14"             unit="mol/m3"  grid_ref="grid_T_3D"  /> 
     335       <field id="Ironsed"     long_name="Iron deposition from sediment"           unit="mol/m2/s"  grid_ref="grid_T_3D "/> 
     336 
     337       <!-- PISCES with Kriest parametisation : variables available with key_kriest --> 
     338       <field id="POCFlx"      long_name="Particulate organic C flux"              unit="mol/m2/s"   grid_ref="grid_T_3D" /> 
     339       <field id="NumFlx"      long_name="Particle number flux"                    unit="nbr/m2/s"   grid_ref="grid_T_3D" /> 
     340       <field id="SiFlx"       long_name="Biogenic Si flux"                        unit="mol/m2/s"   grid_ref="grid_T_3D" /> 
     341       <field id="CaCO3Flx"    long_name="CaCO3 flux"                              unit="mol/m2/s"   grid_ref="grid_T_3D" /> 
     342       <field id="xnum"        long_name="Number of particles in aggregats"        unit="-"          grid_ref="grid_T_3D" /> 
     343       <field id="W1"          long_name="sinking speed of mass flux"              unit="m2/s"       grid_ref="grid_T_3D" /> 
     344       <field id="W2"          long_name="sinking speed of number flux"            unit="m2/s"       grid_ref="grid_T_3D" /> 
     345 
     346       <!-- PISCES light : variables available with key_pisces_reduced --> 
     347       <field id="FNO3PHY"     long_name="FNO3PHY"                                 unit="-"          grid_ref="grid_T_3D" />  
     348       <field id="FNH4PHY"     long_name="FNH4PHY"                                 unit="-"          grid_ref="grid_T_3D" />  
     349       <field id="FNH4NO3"     long_name="FNH4NO3"                                 unit="-"          grid_ref="grid_T_3D" />  
     350       <field id="TNO3PHY"     long_name="TNO3PHY"                                 unit="-"  />  
     351       <field id="TNH4PHY"     long_name="TNH4PHY"                                 unit="-"  />  
     352       <field id="TPHYDOM"     long_name="TPHYDOM"                                 unit="-"  />  
     353       <field id="TPHYNH4"     long_name="TPHYNH4"                                 unit="-"  />  
     354       <field id="TPHYZOO"     long_name="TPHYZOO"                                 unit="-"  />  
     355       <field id="TPHYDET"     long_name="TPHYDET"                                 unit="-"  />  
     356       <field id="TDETZOO"     long_name="TDETZOO"                                 unit="-"  />  
     357       <field id="TZOODET"     long_name="TZOODET"                                 unit="-"  />  
     358       <field id="TZOOBOD"     long_name="TZOOBOD"                                 unit="-"  />  
     359       <field id="TZOONH4"     long_name="TZOONH4"                                 unit="-"  />  
     360       <field id="TZOODOM"     long_name="TZOODOM"                                 unit="-"  />  
     361       <field id="TNH4NO3"     long_name="TNH4NO3"                                 unit="-"  />  
     362       <field id="TDOMNH4"     long_name="TDOMNH4"                                 unit="-"  />  
     363       <field id="TDETNH4"     long_name="TDETNH4"                                 unit="-"  />  
     364       <field id="TPHYTOT"     long_name="TPHYTOT"                                 unit="-"  />  
     365       <field id="TZOOTOT"     long_name="TZOOTOT"                                 unit="-"  />  
     366       <field id="SEDPOC"      long_name="SEDPOC"                                  unit="-"  />  
     367       <field id="TDETSED"     long_name="TDETSED"                                 unit="-"  />  
     368 
     369       <!-- CFC11 : variables available with key_cfc --> 
     370       <field id="qtrCFC11"    long_name="Air-sea flux of CFC-11"                   unit="mol/m2/s"   /> 
     371       <field id="qintCFC11"   long_name="Cumulative air-sea flux of CFC-11"        unit="mol/m2"     /> 
     372       <!-- Bomb C14 : variables available with key_c14b --> 
     373       <field id="qtrC14b"     long_name="Air-sea flux of Bomb C14"                 unit="mol/m2/s"   /> 
     374       <field id="qintC14b"    long_name="Cumulative air-sea flux of Bomb C14"      unit="mol/m2"     /> 
     375       <field id="fdecay"      long_name="Radiactive decay of Bomb C14"             unit="mol/m3"  grid_ref="grid_T_3D"  /> 
    341376     </field_group> 
    342377 
  • branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/CONFIG/cfg.txt

    r3769 r4276  
    44GYRE_PISCES OPA_SRC TOP_SRC 
    55ORCA2_LIM3 OPA_SRC LIM_SRC_3 
    6 ORCA2_LIM_PISCES OPA_SRC LIM_SRC_2 NST_SRC TOP_SRC 
    7 ORCA2_OFF_PISCES OPA_SRC OFF_SRC TOP_SRC 
    86ORCA2_SAS_LIM OPA_SRC SAS_SRC LIM_SRC_2 NST_SRC 
    97ORCA2_LIM_CFC_C14b OPA_SRC LIM_SRC_2 NST_SRC TOP_SRC 
    108ORCA2_LIM OPA_SRC LIM_SRC_2 NST_SRC 
     9ORCA2_OFF_PISCES OPA_SRC OFF_SRC TOP_SRC 
     10ORCA2_LIM_PISCES OPA_SRC LIM_SRC_2 NST_SRC TOP_SRC 
  • branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/CONFIG/makenemo

    r3764 r4276  
    106106export AGRIFUSE=10 
    107107declare -a TAB 
     108list_key=0 
     109chk_key=1 
    108110#- 
    109111#- FCM and functions location --- 
     
    112114#- 
    113115#- Choice of the options --- 
    114 while getopts :hd:n:r:m:j:e:s:v:t: V 
     116while getopts :hd:n:r:m:j:e:s:v:t:k: V 
    115117do 
    116118    case $V in 
    117119   (h) x_h=${OPTARG}; 
    118120        echo "Usage   : "${b_n} \ 
    119        " [-h] [-n name] [-m arch] [-d "dir1 dir2"] [-r conf] [-s Path] [-e Path] [-j No] [-v No]"; 
     121       " [-h] [-n name] [-m arch] [-d "dir1 dir2"] [-r conf] [-s Path] [-e Path] [-j No] [-v No] [-k 0/1]"; 
    120122   echo " -h           : help"; 
    121123   echo " -h institute : specific help for consortium members"; 
     
    128130        echo " -j No        : number of processes used to compile (0=nocompilation)"; 
    129131        echo " -v No        : set verbosity level for compilation [0-3]"; 
     132        echo " -k 0/1       : used cpp keys check (default = 1 -> check activated)"; 
    130133   echo " -t dir       : temporary directory for compilation" 
    131134   echo ""; 
     
    141144   echo "Example to clean "; 
    142145   echo "./makenemo clean"; 
     146   echo ""; 
     147   echo "Example to list the available keys of a CONFIG "; 
     148   echo "./makenemo list_key"; 
    143149   echo ""; 
    144150   echo "Example to add and remove keys"; 
     
    158164   (j)  x_j=${OPTARG};; 
    159165   (t)  x_t=${OPTARG};; 
    160     (e)  x_e=${OPTARG};; 
    161     (s)  x_s=${OPTARG};; 
    162     (v)  x_v=${OPTARG};; 
     166   (e)  x_e=${OPTARG};; 
     167   (s)  x_s=${OPTARG};; 
     168   (v)  x_v=${OPTARG};; 
     169   (k)  chk_key=${OPTARG};; 
    163170   (:)  echo ${b_n}" : -"${OPTARG}" option : missing value" 1>&2; 
    164171   exit 2;; 
     
    188195       export ${list_del_key} 
    189196       shift 
     197       ;; 
     198   list_key) 
     199       list_key=1 
    190200       ;; 
    191201   *) 
     
    222232[ "${CMP_NAM}" ==  help ] && . ${COMPIL_DIR}/Flist_archfile.sh all && exit 
    223233 
    224 #- When used for the first time, choose a compiler --- 
    225 . ${COMPIL_DIR}/Fcheck_archfile.sh arch_nemo.fcm ${CMP_NAM} || exit 
    226  
    227234#- 
    228235#- Choose a default configuration if needed --- 
    229236#- ORCA2_LIM or last one used --- 
    230237. ${COMPIL_DIR}/Fcheck_config.sh cfg.txt ${NEW_CONF} || exit 
    231  
    232238 
    233239if [ ${#NEW_CONF} -eq 0 ] ; then 
     
    269275. ${COMPIL_DIR}/Fmake_bld.sh ${CONFIG_DIR} ${NEW_CONF}  ${NEMO_TDIR} || exit 
    270276 
     277# build the complete list of the cpp keys of this configuration 
     278if [ $chk_key -eq 1 ] ; then 
     279    for i in $( grep "^ *#.* key_" ${NEW_CONF}/WORK/* )  
     280    do 
     281   echo $i | grep key_ | sed -e "s/=.*//" 
     282    done | sort -d | uniq > ${COMPIL_DIR}/full_key_list.txt 
     283    if [ $list_key -eq 1 ]; then 
     284   cat ${COMPIL_DIR}/full_key_list.txt 
     285   exit 0 
     286    fi 
     287fi 
     288 
    271289#- At this stage new configuration has been added, 
    272290#- We add or remove keys 
     
    278296    . ${COMPIL_DIR}/Fdel_keys.sh ${NEW_CONF} del_key ${list_del_key} 
    279297fi 
     298 
     299#- check that all keys are really existing... 
     300if [ $chk_key -eq 1 ] ; then 
     301    for kk in $( cat ${NEW_CONF}/cpp_${NEW_CONF}.fcm ) 
     302    do 
     303   if [ "$( echo $kk | cut -c 1-4 )" == "key_" ]; then 
     304       kk=${kk/=*/} 
     305       nb=$( grep -c $kk ${COMPIL_DIR}/full_key_list.txt ) 
     306       if [ $nb -eq 0 ]; then 
     307      echo 
     308      echo "E R R O R : key "$kk" is not found in ${NEW_CONF}/WORK routines..." 
     309      echo "we stop..." 
     310      echo 
     311      exit 1 
     312       fi 
     313   fi 
     314    done 
     315fi 
     316 
     317#- At this stage cpp keys have been updated. we can check the arch file 
     318#- When used for the first time, choose a compiler --- 
     319. ${COMPIL_DIR}/Fcheck_archfile.sh arch_nemo.fcm cpp.fcm ${CMP_NAM} || exit 
    280320 
    281321#- At this stage the configuration has beeen chosen 
     
    317357        rm -rf ${NEMO_TDIR}/${NEW_CONF}/BLD 
    318358        rm -rf ${NEMO_TDIR}/${NEW_CONF}/EXP00/opa 
     359        rm -f ${COMPIL_DIR}/*history ${COMPIL_DIR}/*fcm ${COMPIL_DIR}/*txt 
    319360        echo "cleaning ${NEW_CONF} WORK, BLD" 
    320361    fi 
  • branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/EXTERNAL/AGRIF/LIB/SubLoopCreation.c

    r2715 r4276  
    102102      if ( mark == 1 ) fprintf(fortranout,"!!! aaaaaaaaaaaaaaa \n"); 
    103103      WriteLocalParamDeclaration(); 
    104       if ( mark == 1 ) fprintf(fortranout,"!!! bbbbbbbbbbbbbbb \n"); 
     104      if ( mark == 1 ) fprintf(fortranout,"!!! bbbbbbbbbbbbbbb \n");    
     105      WriteArgumentDeclaration_beforecall(); 
     106      if ( mark == 1 ) fprintf(fortranout,"!!! bbbbbbccccccccc \n"); 
    105107      if ( functiondeclarationisdone == 0 ) WriteFunctionDeclaration(1); 
    106       if ( mark == 1 ) fprintf(fortranout,"!!! bbbbbbccccccccc \n");       
    107       WriteArgumentDeclaration_beforecall(); 
    108108/*      writesub_loopdeclaration_scalar(List_SubroutineArgument_Var,fortranout); 
    109109      writesub_loopdeclaration_tab(List_SubroutineArgument_Var,fortranout);*/ 
     
    405405 
    406406      AddUseAgrifUtilBeforeCall_0(fortranout); 
     407      WriteArgumentDeclaration_beforecall(); 
    407408      if ( functiondeclarationisdone == 0 ) WriteFunctionDeclaration(0); 
    408       WriteArgumentDeclaration_beforecall(); 
    409409      if ( !strcasecmp(subofagrifinitgrids,subroutinename) ) 
    410410                     fprintf(oldfortranout,"      Call Agrif_Init_Grids () \n"); 
     
    462462                                                       "      IMPLICIT NONE\n"); 
    463463      WriteLocalParamDeclaration(); 
     464      WriteArgumentDeclaration_beforecall(); 
    464465      if ( functiondeclarationisdone == 0 ) WriteFunctionDeclaration(0); 
    465       WriteArgumentDeclaration_beforecall(); 
    466466      WriteSubroutineDeclaration(0); 
    467467      if ( !strcasecmp(subofagrifinitgrids,subroutinename) ) 
  • branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/LIM_SRC_2/limsbc_2.F90

    r4024 r4276  
    218218            zemp_snw = rdm_snw(ji,jj) * r1_rdtice                    ! snow melting = pure water that enters the ocean 
    219219            zfmm     = rdm_ice(ji,jj) * r1_rdtice                    ! Freezing minus Melting (F-M) 
     220 
     221            fmmflx(ji,jj) = zfmm                                     ! F/M mass flux save at least for biogeochemical model 
    220222 
    221223            ! salt flux at the ice/ocean interface (sea ice fraction) [PSU*kg/m2/s] 
  • branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/LIM_SRC_3/limsbc.F90

    r3625 r4276  
    226226            zemp_snw = rdm_snw(ji,jj) * r1_rdtice                         ! snow melting = pure water that enters the ocean 
    227227            zfmm     = rdm_ice(ji,jj) * r1_rdtice                         ! Freezing minus mesting   
     228 
     229            fmmflx(ji,jj) = zfmm                                     ! F/M mass flux save at least for biogeochemical model 
    228230 
    229231            emp(ji,jj) = zemp + zemp_snw + zfmm  ! mass flux + F/M mass flux (always ice/ocean mass exchange) 
  • branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/NST_SRC/agrif_opa_sponge.F90

    r3698 r4276  
    185185      INTEGER  :: ji,jj,jk 
    186186      INTEGER  :: ispongearea, ilci, ilcj 
    187       REAL(wp) :: z1spongearea 
    188       REAL(wp), POINTER, DIMENSION(:,:) :: zlocalviscsponge 
     187      LOGICAL  :: ll_spdone 
     188      REAL(wp) :: z1spongearea, zramp 
     189      REAL(wp), POINTER, DIMENSION(:,:) :: ztabramp 
    189190 
    190191#if defined SPONGE || defined SPONGE_TOP 
    191  
    192       CALL wrk_alloc( jpi, jpj, zlocalviscsponge ) 
    193  
    194       ispongearea  = 2 + 2 * Agrif_irhox() 
    195       ilci = nlci - ispongearea 
    196       ilcj = nlcj - ispongearea  
    197       z1spongearea = 1._wp / REAL( ispongearea - 2 ) 
    198       spbtr2(:,:) = 1. / ( e1t(:,:) * e2t(:,:) ) 
     192      ll_spdone=.TRUE. 
     193      IF (( .NOT. spongedoneT ).OR.( .NOT. spongedoneU )) THEN 
     194         ! Define ramp from boundaries towards domain interior 
     195         ! at T-points 
     196         ! Store it in ztabramp 
     197         ll_spdone=.FALSE. 
     198 
     199         CALL wrk_alloc( jpi, jpj, ztabramp ) 
     200 
     201         ispongearea  = 2 + 2 * Agrif_irhox() 
     202         ilci = nlci - ispongearea 
     203         ilcj = nlcj - ispongearea  
     204         z1spongearea = 1._wp / REAL( ispongearea - 2 ) 
     205         spbtr2(:,:) = 1. / ( e1t(:,:) * e2t(:,:) ) 
     206 
     207         ztabramp(:,:) = 0. 
     208 
     209         IF( (nbondi == -1) .OR. (nbondi == 2) ) THEN 
     210            DO jj = 1, jpj 
     211               IF ( umask(2,jj,1) == 1._wp ) THEN 
     212                 DO ji = 2, ispongearea                   
     213                    ztabramp(ji,jj) = ( ispongearea-ji ) * z1spongearea 
     214                 END DO 
     215               ENDIF 
     216            ENDDO 
     217         ENDIF 
     218 
     219         IF( (nbondi == 1) .OR. (nbondi == 2) ) THEN 
     220            DO jj = 1, jpj 
     221               IF ( umask(nlci-2,jj,1) == 1._wp ) THEN 
     222                  DO ji = ilci+1,nlci-1 
     223                     zramp = (ji - (ilci+1) ) * z1spongearea 
     224                     ztabramp(ji,jj) = MAX( ztabramp(ji,jj), zramp ) 
     225                  ENDDO 
     226               ENDIF 
     227            ENDDO 
     228         ENDIF 
     229 
     230         IF( (nbondj == -1) .OR. (nbondj == 2) ) THEN 
     231            DO ji = 1, jpi 
     232               IF ( vmask(ji,2,1) == 1._wp ) THEN 
     233                  DO jj = 2, ispongearea 
     234                     zramp = ( ispongearea-jj ) * z1spongearea 
     235                     ztabramp(ji,jj) = MAX( ztabramp(ji,jj), zramp ) 
     236                  END DO 
     237               ENDIF 
     238            ENDDO 
     239         ENDIF 
     240 
     241         IF( (nbondj == 1) .OR. (nbondj == 2) ) THEN 
     242            DO ji = 1, jpi 
     243               IF ( vmask(ji,nlcj-2,1) == 1._wp ) THEN 
     244                  DO jj = ilcj+1,nlcj-1 
     245                     zramp = (jj - (ilcj+1) ) * z1spongearea 
     246                     ztabramp(ji,jj) = MAX( ztabramp(ji,jj), zramp ) 
     247                  END DO 
     248               ENDIF 
     249            ENDDO 
     250         ENDIF 
     251 
     252      ENDIF 
    199253 
    200254      ! Tracers 
    201255      IF( .NOT. spongedoneT ) THEN 
    202          zlocalviscsponge(:,:) = 0. 
    203256         spe1ur(:,:) = 0. 
    204257         spe2vr(:,:) = 0. 
    205258 
    206259         IF( (nbondi == -1) .OR. (nbondi == 2) ) THEN 
    207             DO ji = 2, ispongearea 
    208                zlocalviscsponge(ji,:) = visc_tra * ( ispongearea-ji ) * z1spongearea 
    209             ENDDO 
    210             spe1ur(2:ispongearea-1,:      ) = 0.5 * ( zlocalviscsponge(2:ispongearea-1,:      )   & 
    211                &                         +            zlocalviscsponge(3:ispongearea  ,:      ) ) & 
    212                &                         * e2u(2:ispongearea-1,:      ) / e1u(2:ispongearea-1,:      ) 
    213             spe2vr(2:ispongearea  ,1:jpjm1) = 0.5 * ( zlocalviscsponge(2:ispongearea  ,1:jpjm1)   & 
    214                &                         +            zlocalviscsponge(2:ispongearea,2  :jpj  ) ) & 
    215                &                         * e1v(2:ispongearea  ,1:jpjm1) / e2v(2:ispongearea  ,1:jpjm1) 
     260            spe1ur(2:ispongearea-1,:       ) = visc_tra                                        & 
     261               &                             *    0.5 * (  ztabramp(2:ispongearea-1,:      )   & 
     262               &                                         + ztabramp(3:ispongearea  ,:      ) ) & 
     263               &                             * e2u(2:ispongearea-1,:) / e1u(2:ispongearea-1,:) 
     264 
     265            spe2vr(2:ispongearea  ,1:jpjm1 ) = visc_tra                                        & 
     266               &                             *    0.5 * (  ztabramp(2:ispongearea  ,1:jpjm1)   & 
     267               &                                         + ztabramp(2:ispongearea,2  :jpj  ) ) & 
     268               &                             * e1v(2:ispongearea,1:jpjm1) / e2v(2:ispongearea,1:jpjm1) 
    216269         ENDIF 
    217270 
    218271         IF( (nbondi == 1) .OR. (nbondi == 2) ) THEN 
    219             DO ji = ilci+1,nlci-1 
    220                zlocalviscsponge(ji,:) = visc_tra * (ji - (ilci+1) ) * z1spongearea 
    221             ENDDO 
    222    
    223             spe1ur(ilci+1:nlci-2,:      ) = 0.5 * (  zlocalviscsponge(ilci+1:nlci-2,:)    &  
    224                &                          +          zlocalviscsponge(ilci+2:nlci-1,:) )  & 
    225                &                          * e2u(ilci+1:nlci-2,:) / e1u(ilci+1:nlci-2,:) 
    226  
    227             spe2vr(ilci+1:nlci-1,1:jpjm1) = 0.5 * (  zlocalviscsponge(ilci+1:nlci-1,1:jpjm1)    &  
    228                &                            +        zlocalviscsponge(ilci+1:nlci-1,2:jpj  )  ) &  
    229                &                                   * e1v(ilci+1:nlci-1,1:jpjm1) / e2v(ilci+1:nlci-1,1:jpjm1) 
     272            spe1ur(ilci+1:nlci-2,:        ) = visc_tra                                   & 
     273               &                            * 0.5 * (  ztabramp(ilci+1:nlci-2,:      )   &  
     274               &                                     + ztabramp(ilci+2:nlci-1,:      ) ) & 
     275               &                            * e2u(ilci+1:nlci-2,:) / e1u(ilci+1:nlci-2,:) 
     276 
     277            spe2vr(ilci+1:nlci-1,1:jpjm1  )  = visc_tra                                  & 
     278               &                            * 0.5 * (  ztabramp(ilci+1:nlci-1,1:jpjm1)   &  
     279               &                                     + ztabramp(ilci+1:nlci-1,2:jpj  ) ) &  
     280               &                            * e1v(ilci+1:nlci-1,1:jpjm1) / e2v(ilci+1:nlci-1,1:jpjm1) 
    230281         ENDIF 
    231282 
    232283         IF( (nbondj == -1) .OR. (nbondj == 2) ) THEN 
    233             DO jj = 2, ispongearea 
    234                zlocalviscsponge(:,jj) = visc_tra * ( ispongearea-jj ) * z1spongearea 
    235             ENDDO 
    236             spe1ur(1:jpim1,2:ispongearea  ) = 0.5 * ( zlocalviscsponge(1:jpim1,2:ispongearea  ) &  
    237                &                            +         zlocalviscsponge(2:jpi  ,2:ispongearea) ) & 
     284            spe1ur(1:jpim1,2:ispongearea  ) = visc_tra                                     & 
     285               &                            * 0.5 * (  ztabramp(1:jpim1,2:ispongearea  )   &  
     286               &                                     + ztabramp(2:jpi  ,2:ispongearea  ) ) & 
    238287               &                            * e2u(1:jpim1,2:ispongearea) / e1u(1:jpim1,2:ispongearea) 
    239288    
    240             spe2vr(:      ,2:ispongearea-1) = 0.5 * ( zlocalviscsponge(:,2:ispongearea-1)       & 
    241                &                            +         zlocalviscsponge(:,3:ispongearea  )     ) & 
     289            spe2vr(:      ,2:ispongearea-1) = visc_tra                                     & 
     290               &                            * 0.5 * (  ztabramp(:      ,2:ispongearea-1)   & 
     291               &                                     + ztabramp(:      ,3:ispongearea  ) ) & 
    242292               &                            * e1v(:,2:ispongearea-1) / e2v(:,2:ispongearea-1) 
    243293         ENDIF 
    244294 
    245295         IF( (nbondj == 1) .OR. (nbondj == 2) ) THEN 
    246             DO jj = ilcj+1,nlcj-1 
    247                zlocalviscsponge(:,jj) = visc_tra * (jj - (ilcj+1) ) * z1spongearea 
    248             ENDDO 
    249             spe1ur(1:jpim1,ilcj+1:nlcj-1) = 0.5 * ( zlocalviscsponge(1:jpim1,ilcj+1:nlcj-1)   & 
    250                &                          +         zlocalviscsponge(2:jpi  ,ilcj+1:nlcj-1) ) & 
     296            spe1ur(1:jpim1,ilcj+1:nlcj-1) = visc_tra                                   & 
     297               &                          * 0.5 * (  ztabramp(1:jpim1,ilcj+1:nlcj-1)   & 
     298               &                                   + ztabramp(2:jpi  ,ilcj+1:nlcj-1) ) & 
    251299               &                                * e2u(1:jpim1,ilcj+1:nlcj-1) / e1u(1:jpim1,ilcj+1:nlcj-1) 
    252             spe2vr(:      ,ilcj+1:nlcj-2) = 0.5 * ( zlocalviscsponge(:,ilcj+1:nlcj-2      )   & 
    253                &                          +         zlocalviscsponge(:,ilcj+2:nlcj-1)     )   & 
     300 
     301            spe2vr(:      ,ilcj+1:nlcj-2) = visc_tra                                   & 
     302               &                          * 0.5 * (  ztabramp(:      ,ilcj+1:nlcj-2)   & 
     303               &                                   + ztabramp(:      ,ilcj+2:nlcj-1) ) & 
    254304               &                                * e1v(:,ilcj+1:nlcj-2) / e2v(:,ilcj+1:nlcj-2) 
    255305         ENDIF 
     
    259309      ! Dynamics 
    260310      IF( .NOT. spongedoneU ) THEN 
    261          zlocalviscsponge(:,:) = 0. 
    262311         spe1ur2(:,:) = 0. 
    263312         spe2vr2(:,:) = 0. 
    264313 
    265314         IF( (nbondi == -1) .OR. (nbondi == 2) ) THEN 
    266             DO ji = 2, ispongearea 
    267                zlocalviscsponge(ji,:) = visc_dyn * ( ispongearea-ji ) * z1spongearea 
    268             ENDDO 
    269             spe1ur2(2:ispongearea-1,:      ) = 0.5 * ( zlocalviscsponge(2:ispongearea-1,:      ) & 
    270                                              &     +   zlocalviscsponge(3:ispongearea,:    ) ) 
    271             spe2vr2(2:ispongearea  ,1:jpjm1) = 0.5 * ( zlocalviscsponge(2:ispongearea  ,1:jpjm1) & 
    272                                              &     +   zlocalviscsponge(2:ispongearea,2:jpj) )  
     315            spe1ur2(2:ispongearea-1,:      ) = visc_dyn                                   & 
     316               &                             * 0.5 * (  ztabramp(2:ispongearea-1,:      ) & 
     317               &                                      + ztabramp(3:ispongearea  ,:      ) ) 
     318            spe2vr2(2:ispongearea  ,1:jpjm1) = visc_dyn                                   & 
     319               &                             * 0.5 * (  ztabramp(2:ispongearea  ,1:jpjm1) & 
     320               &                                      + ztabramp(2:ispongearea  ,2:jpj  ) )  
    273321         ENDIF 
    274322 
    275323         IF( (nbondi == 1) .OR. (nbondi == 2) ) THEN 
    276             DO ji = ilci+1,nlci-1 
    277                zlocalviscsponge(ji,:) = visc_dyn * (ji - (ilci+1) ) * z1spongearea 
    278             ENDDO 
    279             spe1ur2(ilci+1:nlci-2,:      ) = 0.5 * (  zlocalviscsponge(ilci+1:nlci-2,:) & 
    280                                            &        + zlocalviscsponge(ilci+2:nlci-1,:) )   
    281             spe2vr2(ilci+1:nlci-1,1:jpjm1) = 0.5 * (  zlocalviscsponge(ilci+1:nlci-1,1:jpjm1) & 
    282                                            &        + zlocalviscsponge(ilci+1:nlci-1,2:jpj  )  )  
     324            spe1ur2(ilci+1:nlci-2  ,:      ) = visc_dyn                                   & 
     325               &                             * 0.5 * (  ztabramp(ilci+1:nlci-2, :       ) & 
     326               &                                      + ztabramp(ilci+2:nlci-1, :       ) )                       
     327            spe2vr2(ilci+1:nlci-1  ,1:jpjm1) = visc_dyn                                   & 
     328               &                             * 0.5 * (  ztabramp(ilci+1:nlci-1,1:jpjm1  ) & 
     329               &                                      + ztabramp(ilci+1:nlci-1,2:jpj    ) )  
    283330         ENDIF 
    284331 
    285332         IF( (nbondj == -1) .OR. (nbondj == 2) ) THEN 
    286             DO jj = 2, ispongearea 
    287                zlocalviscsponge(:,jj) = visc_dyn * ( ispongearea-jj ) * z1spongearea 
    288             ENDDO 
    289             spe1ur2(1:jpim1,2:ispongearea  ) = 0.5 * ( zlocalviscsponge(1:jpim1,2:ispongearea) & 
    290                                              &      + zlocalviscsponge(2:jpi,2:ispongearea) )  
    291             spe2vr2(:      ,2:ispongearea-1) = 0.5 * ( zlocalviscsponge(:,2:ispongearea-1)     & 
    292                                              &      + zlocalviscsponge(:,3:ispongearea)     ) 
     333            spe1ur2(1:jpim1,2:ispongearea  ) = visc_dyn                                   &   
     334               &                             * 0.5 * (  ztabramp(1:jpim1,2:ispongearea  ) & 
     335               &                                      + ztabramp(2:jpi  ,2:ispongearea  ) )  
     336            spe2vr2(:      ,2:ispongearea-1) = visc_dyn                                   & 
     337               &                             * 0.5 * (  ztabramp(:      ,2:ispongearea-1) & 
     338               &                                      + ztabramp(:      ,3:ispongearea  ) ) 
    293339         ENDIF 
    294340 
    295341         IF( (nbondj == 1) .OR. (nbondj == 2) ) THEN 
    296             DO jj = ilcj+1,nlcj-1 
    297                zlocalviscsponge(:,jj) = visc_dyn * (jj - (ilcj+1) ) * z1spongearea 
    298             ENDDO 
    299             spe1ur2(1:jpim1,ilcj+1:nlcj-1) = 0.5 * ( zlocalviscsponge(1:jpim1,ilcj+1:nlcj-1) & 
    300                                            &         + zlocalviscsponge(2:jpi,ilcj+1:nlcj-1) )  
    301             spe2vr2(:      ,ilcj+1:nlcj-2) = 0.5 * ( zlocalviscsponge(:,ilcj+1:nlcj-2      ) & 
    302                                            &         + zlocalviscsponge(:,ilcj+2:nlcj-1)     ) 
     342            spe1ur2(1:jpim1,ilcj+1:nlcj-1  ) = visc_dyn                                   & 
     343               &                             * 0.5 * (  ztabramp(1:jpim1,ilcj+1:nlcj-1  ) & 
     344               &                                      + ztabramp(2:jpi  ,ilcj+1:nlcj-1  ) )  
     345            spe2vr2(:      ,ilcj+1:nlcj-2  ) = visc_dyn                                   & 
     346               &                             * 0.5 * (  ztabramp(:      ,ilcj+1:nlcj-2  ) & 
     347               &                                      + ztabramp(:      ,ilcj+2:nlcj-1  ) ) 
    303348         ENDIF 
    304349         spongedoneU = .TRUE. 
     
    306351      ENDIF 
    307352      ! 
    308       CALL wrk_dealloc( jpi, jpj, zlocalviscsponge ) 
     353      IF (.NOT.ll_spdone) CALL wrk_dealloc( jpi, jpj, ztabramp ) 
    309354      ! 
    310355#endif 
  • branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OFF_SRC/dtadyn.F90

    r3827 r4276  
    7272   INTEGER  , SAVE      ::   jf_eiv         ! index of v-eiv 
    7373   INTEGER  , SAVE      ::   jf_eiw         ! index of w-eiv 
    74    INTEGER  , SAVE      ::   jf_sfx         ! index of downward salt flux 
     74   INTEGER  , SAVE      ::   jf_fmf         ! index of downward salt flux 
    7575 
    7676   TYPE(FLD), ALLOCATABLE, DIMENSION(:) :: sf_dyn  ! structure of input fields (file informations, fields read) 
     
    254254      wndm(:,:)        = sf_dyn(jf_wnd)%fnow(:,:,1) * tmask(:,:,1)    ! wind speed - needed for gas exchange 
    255255      emp (:,:)        = sf_dyn(jf_emp)%fnow(:,:,1) * tmask(:,:,1)    ! E-P 
    256       sfx (:,:)        = 0.0_wp      ! enable testing with old inputs ! downward salt flux  
    257 !     sfx (:,:)        = sf_dyn(jf_sfx)%fnow(:,:,1) * tmask(:,:,1)    ! downward salt flux (v3.5+) 
     256      fmmflx(:,:)      = sf_dyn(jf_fmf)%fnow(:,:,1) * tmask(:,:,1)    ! downward salt flux (v3.5+) 
    258257      fr_i(:,:)        = sf_dyn(jf_ice)%fnow(:,:,1) * tmask(:,:,1)    ! Sea-ice fraction 
    259258      qsr (:,:)        = sf_dyn(jf_qsr)%fnow(:,:,1) * tmask(:,:,1)    ! solar radiation 
     
    302301         CALL prt_ctl(tab2d_1=fr_i             , clinfo1=' fr_i    - : ', mask1=tmask, ovlap=1 ) 
    303302         CALL prt_ctl(tab2d_1=hmld             , clinfo1=' hmld    - : ', mask1=tmask, ovlap=1 ) 
    304          CALL prt_ctl(tab2d_1=sfx              , clinfo1=' sfx     - : ', mask1=tmask, ovlap=1 ) 
     303         CALL prt_ctl(tab2d_1=fmmflx           , clinfo1=' fmmflx  - : ', mask1=tmask, ovlap=1 ) 
    305304         CALL prt_ctl(tab2d_1=emp              , clinfo1=' emp     - : ', mask1=tmask, ovlap=1 ) 
    306305         CALL prt_ctl(tab2d_1=wndm             , clinfo1=' wspd    - : ', mask1=tmask, ovlap=1 ) 
     
    331330      TYPE(FLD_N) :: sn_tem, sn_sal, sn_mld, sn_emp, sn_ice, sn_qsr, sn_wnd  ! informations about the fields to be read 
    332331      TYPE(FLD_N) :: sn_uwd, sn_vwd, sn_wwd, sn_avt, sn_ubl, sn_vbl          !   "                                 " 
    333       TYPE(FLD_N) :: sn_ahu, sn_ahv, sn_ahw, sn_eiu, sn_eiv, sn_eiw, sn_sfx  !   "                                 " 
     332      TYPE(FLD_N) :: sn_ahu, sn_ahv, sn_ahw, sn_eiu, sn_eiv, sn_eiw, sn_fmf  !   "                                 " 
    334333      ! 
    335334      NAMELIST/namdta_dyn/cn_dir, ln_dynwzv, ln_dynbbl, ln_degrad,    & 
    336335         &                sn_tem, sn_sal, sn_mld, sn_emp, sn_ice, sn_qsr, sn_wnd,  & 
    337336         &                sn_uwd, sn_vwd, sn_wwd, sn_avt, sn_ubl, sn_vbl,          & 
    338          &                sn_ahu, sn_ahv, sn_ahw, sn_eiu, sn_eiv, sn_eiw, sn_sfx 
     337         &                sn_ahu, sn_ahv, sn_ahw, sn_eiu, sn_eiv, sn_eiw, sn_fmf 
    339338 
    340339      !!---------------------------------------------------------------------- 
     
    349348      sn_mld  = FLD_N( 'dyna_grid_T' ,    120    , 'somixght' ,  .true.    , .true. ,   'yearly'  , ''       , ''         ) 
    350349      sn_emp  = FLD_N( 'dyna_grid_T' ,    120    , 'sowaflup' ,  .true.    , .true. ,   'yearly'  , ''       , ''         ) 
    351       sn_sfx  = FLD_N( 'dyna_grid_T' ,    120    , 'sowaflcd' ,  .true.    , .true. ,   'yearly'  , ''       , ''         ) 
    352 !!    sn_sfx  = FLD_N( 'dyna_grid_T' ,    120    , 'sosfldow' ,  .true.    , .true. ,   'yearly'  , ''       , ''         ) ! v3.5+ 
     350      sn_fmf  = FLD_N( 'dyna_grid_T' ,    120    , 'sofmflup' ,  .true.    , .true. ,   'yearly'  , ''       , ''         ) 
    353351      sn_ice  = FLD_N( 'dyna_grid_T' ,    120    , 'soicecov' ,  .true.    , .true. ,   'yearly'  , ''       , ''         ) 
    354352      sn_qsr  = FLD_N( 'dyna_grid_T' ,    120    , 'soshfldo' ,  .true.    , .true. ,   'yearly'  , ''       , ''         ) 
     
    391389      ENDIF 
    392390 
    393       jf_tem = 1   ;   jf_sal = 2   ;  jf_mld = 3   ;  jf_emp = 4   ;   jf_sfx  = 5   ;  jf_ice = 6   ;   jf_qsr = 7 
     391      jf_tem = 1   ;   jf_sal = 2   ;  jf_mld = 3   ;  jf_emp = 4   ;   jf_fmf  = 5   ;  jf_ice = 6   ;   jf_qsr = 7 
    394392      jf_wnd = 8   ;   jf_uwd = 9   ;  jf_vwd = 10  ;  jf_wwd = 11  ;   jf_avt  = 12  ;  jfld  = 12 
    395393      ! 
    396394      slf_d(jf_tem) = sn_tem   ;   slf_d(jf_sal)  = sn_sal   ;   slf_d(jf_mld) = sn_mld 
    397       slf_d(jf_emp) = sn_emp   ;   slf_d(jf_sfx ) = sn_sfx   ;   slf_d(jf_ice) = sn_ice  
     395      slf_d(jf_emp) = sn_emp   ;   slf_d(jf_fmf ) = sn_fmf   ;   slf_d(jf_ice) = sn_ice  
    398396      slf_d(jf_qsr) = sn_qsr   ;   slf_d(jf_wnd)  = sn_wnd   ;   slf_d(jf_avt) = sn_avt  
    399397      slf_d(jf_uwd) = sn_uwd   ;   slf_d(jf_vwd)  = sn_vwd   ;   slf_d(jf_wwd) = sn_wwd 
     
    429427        ENDIF 
    430428      ENDIF 
    431       ! Salt flux and concntration/dilution terms (new from v3.5) !! disabled to allow testing with old input files 
    432 !!    jf_sfx = jfld + 1    ;    jfld = jfld + 1 
    433 !!    slf_d(jf_sfx) = sn_sfx 
    434429   
    435430      ALLOCATE( sf_dyn(jfld), STAT=ierr )         ! set sf structure 
  • branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/ASM/asminc.F90

    r3785 r4276  
    682682      ! used to prevent the applied increments taking the temperature below the local freezing point  
    683683 
    684 #if defined key_cice  
    685         fzptnz(:,:,:) = -1.8_wp 
    686 #else  
    687         DO jk = 1, jpk 
    688            DO jj = 1, jpj 
    689               DO ji = 1, jpk 
    690                  fzptnz (ji,jj,jk) = ( -0.0575_wp + 1.710523e-3_wp * SQRT( tsn(ji,jj,jk,jp_sal) )                   &  
    691                                                   - 2.154996e-4_wp *       tsn(ji,jj,jk,jp_sal)   ) * tsn(ji,jj,jk,jp_sal)  &  
    692                                                   - 7.53e-4_wp * fsdepw(ji,jj,jk)       ! (pressure in dbar)  
    693               END DO 
    694            END DO 
    695         END DO 
    696 #endif  
     684      DO jk=1, jpkm1 
     685         fzptnz (:,:,jk) = tfreez( tsn(:,:,jk,jp_sal), fsdept(:,:,jk) ) 
     686      ENDDO 
    697687 
    698688      IF ( ln_asmiau ) THEN 
  • branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/BDY/bdydta.F90

    r3851 r4276  
    476476            IF( nn_dyn2d(ib_bdy) .gt. 0 .and. ( nn_dyn2d_dta(ib_bdy) .eq. 1 .or. nn_dyn2d_dta(ib_bdy) .eq. 3 ) ) THEN  
    477477 
    478                IF( nn_tra(ib_bdy) .ne. 4 ) THEN ! runoff condition : no ssh reading 
     478               IF( nn_dyn2d(ib_bdy) .ne. jp_frs .and. nn_tra(ib_bdy) .ne. 4 ) THEN ! runoff condition : no ssh reading 
    479479                  jfld = jfld + 1 
    480480                  blf_i(jfld) = bn_ssh 
     
    572572            ! Recalculate field counts 
    573573            !------------------------- 
    574             nb_bdy_fld_sum = 0 
    575574            IF( ib_bdy .eq. 1 ) THEN  
     575               nb_bdy_fld_sum = 0 
    576576               nb_bdy_fld(ib_bdy) = jfld 
    577577               nb_bdy_fld_sum     = jfld               
     
    616616               ALLOCATE( dta_bdy(ib_bdy)%u2d(ilen0(2)) ) 
    617617               ALLOCATE( dta_bdy(ib_bdy)%v2d(ilen0(3)) ) 
    618                IF (nn_dyn2d_dta(ib_bdy).eq.1.or.nn_dyn2d_dta(ib_bdy).eq.3) THEN 
     618               IF ( nn_dyn2d(ib_bdy) .ne. jp_frs .and. (nn_dyn2d_dta(ib_bdy).eq.1.or.nn_dyn2d_dta(ib_bdy).eq.3) ) THEN 
    619619                  jfld = jfld + 1 
    620620                  dta_bdy(ib_bdy)%ssh => bf(jfld)%fnow(:,1,1) 
  • branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/BDY/bdydyn.F90

    r3294 r4276  
    3030   USE lbclnk          ! ocean lateral boundary conditions (or mpp link) 
    3131   USE in_out_manager  ! 
     32   USE domvvl          ! variable volume 
    3233 
    3334   IMPLICIT NONE 
     
    8485      pu2d(:,:) = 0.e0 
    8586      pv2d(:,:) = 0.e0 
    86       DO jk = 1, jpkm1   !! Vertically integrated momentum trends 
    87           pu2d(:,:) = pu2d(:,:) + fse3u(:,:,jk) * umask(:,:,jk) * ua(:,:,jk) 
    88           pv2d(:,:) = pv2d(:,:) + fse3v(:,:,jk) * vmask(:,:,jk) * va(:,:,jk) 
    89       END DO 
    90       pu2d(:,:) = pu2d(:,:) * phur(:,:) 
    91       pv2d(:,:) = pv2d(:,:) * phvr(:,:) 
     87      IF (lk_vvl) THEN 
     88         DO jk = 1, jpkm1   !! Vertically integrated momentum trends 
     89            pu2d(:,:) = pu2d(:,:) + fse3u_a(:,:,jk) * umask(:,:,jk) * ua(:,:,jk) 
     90            pv2d(:,:) = pv2d(:,:) + fse3v_a(:,:,jk) * vmask(:,:,jk) * va(:,:,jk) 
     91         END DO 
     92         pu2d(:,:) = pu2d(:,:) / ( hu_0(:,:) + sshu_a(:,:) + 1._wp - umask(:,:,1) ) 
     93         pv2d(:,:) = pv2d(:,:) / ( hv_0(:,:) + sshv_a(:,:) + 1._wp - vmask(:,:,1) ) 
     94      ELSE 
     95         DO jk = 1, jpkm1   !! Vertically integrated momentum trends 
     96            pu2d(:,:) = pu2d(:,:) + fse3u(:,:,jk) * umask(:,:,jk) * ua(:,:,jk) 
     97            pv2d(:,:) = pv2d(:,:) + fse3v(:,:,jk) * vmask(:,:,jk) * va(:,:,jk) 
     98         END DO 
     99         pu2d(:,:) = pu2d(:,:) * phur(:,:) 
     100         pv2d(:,:) = pv2d(:,:) * phvr(:,:) 
     101      ENDIF 
    92102      DO jk = 1 , jpkm1 
    93          ua(:,:,jk) = ua(:,:,jk) - pu2d(:,:) 
    94          va(:,:,jk) = va(:,:,jk) - pv2d(:,:) 
     103         ua(:,:,jk) = ua(:,:,jk) - pu2d(:,:) * umask(:,:,jk) 
     104         va(:,:,jk) = va(:,:,jk) - pv2d(:,:) * vmask(:,:,jk) 
    95105      END DO 
    96106 
  • branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/BDY/bdyice_lim2.F90

    • Property svn:keywords set to Id
    r3680 r4276  
    3232   !!---------------------------------------------------------------------- 
    3333   !! NEMO/OPA 3.3 , NEMO Consortium (2010) 
    34    !! $Id: bdyice.F90 2715 2011-03-30 15:58:35Z rblod $ 
     34   !! $Id$ 
    3535   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 
    3636   !!---------------------------------------------------------------------- 
     
    7676      INTEGER,         INTENT(in) ::   ib_bdy  ! BDY set index 
    7777      !! 
    78       INTEGER  ::   jb, jk, jgrd   ! dummy loop indices 
     78      INTEGER  ::   jb, jgrd   ! dummy loop indices 
    7979      INTEGER  ::   ii, ij         ! local scalar 
    8080      REAL(wp) ::   zwgt, zwgt1    ! local scalar 
     
    8686      ! 
    8787      DO jb = 1, idx%nblen(jgrd) 
    88          DO jk = 1, jpkm1 
    8988            ii    = idx%nbi(jb,jgrd) 
    9089            ij    = idx%nbj(jb,jgrd) 
     
    9493            hicif(ii,ij) = ( hicif(ii,ij) * zwgt1 + dta%hicif(jb) * zwgt ) * tmask(ii,ij,1)     ! Ice depth  
    9594            hsnif(ii,ij) = ( hsnif(ii,ij) * zwgt1 + dta%hsnif(jb) * zwgt ) * tmask(ii,ij,1)     ! Snow depth 
    96          END DO 
    9795      END DO  
    9896      CALL lbc_bdy_lnk( frld, 'T', 1., ib_bdy )                                         ! lateral boundary conditions 
  • branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/BDY/bdyini.F90

    r3703 r4276  
    10531053       
    10541054      bdytmask(:,:) = tmask(:,:,1) 
     1055      IF( .not. ln_mask_file ) THEN 
     1056         ! If .not. ln_mask_file then we need to derive mask on U and V grid  
     1057         ! from mask on T grid here. 
     1058         bdyumask(:,:) = 0.e0 
     1059         bdyvmask(:,:) = 0.e0 
     1060         DO ij=1, jpjm1 
     1061            DO ii=1, jpim1 
     1062               bdyumask(ii,ij)=bdytmask(ii,ij)*bdytmask(ii+1, ij ) 
     1063               bdyvmask(ii,ij)=bdytmask(ii,ij)*bdytmask(ii  ,ij+1)   
     1064            END DO 
     1065         END DO 
     1066         CALL lbc_lnk( bdyumask(:,:), 'U', 1. )   ;   CALL lbc_lnk( bdyvmask(:,:), 'V', 1. )      ! Lateral boundary cond. 
     1067      ENDIF 
    10551068 
    10561069      ! bdy masks and bmask are now set to zero on boundary points: 
  • branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/C1D/step_c1d.F90

    r3680 r4276  
    5959 
    6060                             indic = 0                ! reset to no error condition 
     61      IF( kstp == nit000 )   CALL iom_init            ! iom_put initialization (must be done after nemo_init for AGRIF+XIOS+OASIS) 
    6162      IF( kstp /= nit000 )   CALL day( kstp )         ! Calendar (day was already called at nit000 in day_init) 
    62                              CALL iom_setkt( kstp )   ! say to iom that we are at time step kstp 
     63                             CALL iom_setkt( kstp - nit000 + 1 )   ! say to iom that we are at time step kstp 
    6364 
    6465      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     
    106107      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
    107108                         CALL dia_wri( kstp )       ! ocean model: outputs 
     109      IF( lk_diahth  )   CALL dia_hth( kstp )       ! Thermocline depth (20°C) 
     110 
    108111 
    109112#if defined key_top 
  • branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/DIA/diadct.F90

    r3680 r4276  
    4242#endif 
    4343#if defined key_lim3 
    44   USE ice_3 
     44  USE par_ice 
     45  USE ice 
    4546#endif 
    4647  USE domvvl 
     
    484485                 ijglo = secs(jsec)%listPoint(jpt)%J + jpjzoom - 1 + njmpp - 1 
    485486                 WRITE(numout,*)'         # I J : ',iiglo,ijglo 
     487                 CALL FLUSH(numout) 
    486488              ENDDO 
    487489           ENDIF 
     
    606608     
    607609     !! * Local variables 
    608      INTEGER             :: jk, jseg, jclass,                    &!loop on level/segment/classes   
     610     INTEGER             :: jk, jseg, jclass,jl,                 &!loop on level/segment/classes/ice categories 
    609611                            isgnu, isgnv                          !  
    610612     REAL(wp)            :: zumid, zvmid,                        &!U/V velocity on a cell segment  
     
    771773    
    772774              zTnorm=zumid_ice*e2u(k%I,k%J)+zvmid_ice*e1v(k%I,k%J) 
    773     
     775 
     776#if defined key_lim2    
    774777              transports_2d(1,jsec,jseg) = transports_2d(1,jsec,jseg) + (zTnorm)*   &  
    775778                                   (1.0 - frld(sec%listPoint(jseg)%I,sec%listPoint(jseg)%J))  &  
     
    778781              transports_2d(2,jsec,jseg) = transports_2d(2,jsec,jseg) + (zTnorm)*   &  
    779782                                    (1.0 -  frld(sec%listPoint(jseg)%I,sec%listPoint(jseg)%J)) 
     783#endif 
     784#if defined key_lim3 
     785              DO jl=1,jpl 
     786                 transports_2d(1,jsec,jseg) = transports_2d(1,jsec,jseg) + (zTnorm)*     & 
     787                                   a_i(sec%listPoint(jseg)%I,sec%listPoint(jseg)%J,jl) * & 
     788                                  ( ht_i(sec%listPoint(jseg)%I,sec%listPoint(jseg)%J,jl) +  & 
     789                                    ht_s(sec%listPoint(jseg)%I,sec%listPoint(jseg)%J,jl) ) 
     790                                    
     791                 transports_2d(2,jsec,jseg) = transports_2d(2,jsec,jseg) + (zTnorm)*   & 
     792                                   a_i(sec%listPoint(jseg)%I,sec%listPoint(jseg)%J,jl) 
     793              ENDDO 
     794#endif 
    780795    
    781796           ENDIF !end of ice case 
  • branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/DIA/diahsb.F90

    r3625 r4276  
    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 
     75      REAL(dp)   ::   zerr_hc1    , zerr_sc1      ! Non conservation due to free surface 
    7076      REAL(dp)   ::   z1_rau0                     ! local scalars 
    7177      REAL(dp)   ::   zdeltat                     !    -     - 
    7278      REAL(dp)   ::   z_frc_trd_t , z_frc_trd_s   !    -     - 
    7379      REAL(dp)   ::   z_frc_trd_v                 !    -     - 
     80      REAL(dp)   ::   z_wn_trd_t , z_wn_trd_s   !    -     - 
     81      REAL(dp)   ::   z_ssh_hc , z_ssh_sc   !    -     - 
    7482      !!--------------------------------------------------------------------------- 
    7583      IF( nn_timing == 1 )   CALL timing_start('dia_hsb') 
     
    7987      ! ------------------------- ! 
    8088      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 
     89      z_frc_trd_v = z1_rau0 * glob_sum( - ( emp(:,:) - rnf(:,:) ) * surf(:,:) )     ! volume fluxes 
     90      z_frc_trd_t =           glob_sum( sbc_tsc(:,:,jp_tem) * surf(:,:) )     ! heat fluxes 
     91      z_frc_trd_s =           glob_sum( sbc_tsc(:,:,jp_sal) * surf(:,:) )     ! salt fluxes 
     92      ! Add runoff heat & salt input 
     93      IF( ln_rnf    )   z_frc_trd_t = z_frc_trd_t + glob_sum( rnf_tsc(:,:,jp_tem) * surf(:,:) ) 
     94      IF( ln_rnf_sal)   z_frc_trd_s = z_frc_trd_s + glob_sum( rnf_tsc(:,:,jp_sal) * surf(:,:) ) 
    8495      ! Add penetrative solar radiation 
    85       IF( ln_traqsr )   z_frc_trd_t = z_frc_trd_t + r1_rau0_rcp * SUM( qsr     (:,:) * surf(:,:) ) 
     96      IF( ln_traqsr )   z_frc_trd_t = z_frc_trd_t + r1_rau0_rcp * glob_sum( qsr     (:,:) * surf(:,:) ) 
    8697      ! 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 
     98      IF( ln_trabbc )   z_frc_trd_t = z_frc_trd_t +  glob_sum( qgh_trd0(:,:) * surf(:,:) ) 
     99      IF( .NOT. lk_vvl ) THEN 
     100         z_wn_trd_t = - glob_sum( surf(:,:) * wn(:,:,1) * tsb(:,:,1,jp_tem) ) 
     101         z_wn_trd_s = - glob_sum( surf(:,:) * wn(:,:,1) * tsb(:,:,1,jp_sal) ) 
     102      ENDIF 
     103 
    92104      frc_v = frc_v + z_frc_trd_v * rdt 
    93105      frc_t = frc_t + z_frc_trd_t * rdt 
    94106      frc_s = frc_s + z_frc_trd_s * rdt 
     107      !                                          ! Advection flux through fixed surface (z=0) 
     108      IF( .NOT. lk_vvl ) THEN 
     109         frc_wn_t = frc_wn_t + z_wn_trd_t * rdt 
     110         frc_wn_s = frc_wn_s + z_wn_trd_s * rdt 
     111      ENDIF 
    95112 
    96113      ! ----------------------- ! 
     
    100117      zdiff_hc = 0.d0 
    101118      zdiff_sc = 0.d0 
     119 
    102120      ! volume variation (calculated with ssh) 
    103       zdiff_v1 = SUM( surf(:,:) * tmask(:,:,1) * ( sshn(:,:) - ssh_ini(:,:) ) ) 
     121      zdiff_v1 = glob_sum( surf(:,:) * ( sshn(:,:) - ssh_ini(:,:) ) ) 
     122 
     123      ! heat & salt content variation (associated with ssh) 
     124      IF( .NOT. lk_vvl ) THEN 
     125         z_ssh_hc = glob_sum( surf(:,:) * ( tsn(:,:,1,jp_tem) * sshn(:,:) - ssh_hc_loc_ini(:,:) ) ) 
     126         z_ssh_sc = glob_sum( surf(:,:) * ( tsn(:,:,1,jp_sal) * sshn(:,:) - ssh_sc_loc_ini(:,:) ) ) 
     127      ENDIF 
     128 
    104129      DO jk = 1, jpkm1 
    105          ! volume variation (calculated with scale factors) 
    106          zdiff_v2 = zdiff_v2 + SUM( surf(:,:) * tmask(:,:,jk)   & 
     130        ! volume variation (calculated with scale factors) 
     131         zdiff_v2 = zdiff_v2 + glob_sum( surf(:,:) * tmask(:,:,jk)   & 
    107132            &                       * ( fse3t_n(:,:,jk)         & 
    108133            &                           - e3t_ini(:,:,jk) ) ) 
    109134         ! heat content variation 
    110          zdiff_hc = zdiff_hc + SUM( surf(:,:) * tmask(:,:,jk)          & 
     135         zdiff_hc = zdiff_hc + glob_sum( surf(:,:) * tmask(:,:,jk)          & 
    111136            &                       * ( fse3t_n(:,:,jk) * tsn(:,:,jk,jp_tem)   & 
    112137            &                           - hc_loc_ini(:,:,jk) ) ) 
    113138         ! salt content variation 
    114          zdiff_sc = zdiff_sc + SUM( surf(:,:) * tmask(:,:,jk)          & 
     139         zdiff_sc = zdiff_sc + glob_sum( surf(:,:) * tmask(:,:,jk)          & 
    115140            &                       * ( fse3t_n(:,:,jk) * tsn(:,:,jk,jp_sal)   & 
    116141            &                           - sc_loc_ini(:,:,jk) ) ) 
    117142      ENDDO 
    118143 
    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  
    126144      ! Substract forcing from heat content, salt content and volume variations 
    127145      zdiff_v1 = zdiff_v1 - frc_v 
    128       zdiff_v2 = zdiff_v2 - frc_v 
     146      IF( lk_vvl )   zdiff_v2 = zdiff_v2 - frc_v 
    129147      zdiff_hc = zdiff_hc - frc_t 
    130148      zdiff_sc = zdiff_sc - frc_s 
     149      IF( .NOT. lk_vvl ) THEN 
     150         zdiff_hc1 = zdiff_hc + z_ssh_hc  
     151         zdiff_sc1 = zdiff_sc + z_ssh_sc 
     152         zerr_hc1  = z_ssh_hc - frc_wn_t 
     153         zerr_sc1  = z_ssh_sc - frc_wn_s 
     154      ENDIF 
    131155       
    132156      ! ----------------------- ! 
     
    134158      ! ----------------------- ! 
    135159      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 
     160      IF( lk_vvl ) THEN 
     161         WRITE(numhsb , 9020) kt , zdiff_hc / vol_tot , zdiff_hc * fact1  * zdeltat,                                & 
     162            &                      zdiff_sc / vol_tot , zdiff_sc * fact21 * zdeltat, zdiff_sc * fact22 * zdeltat,   & 
     163            &                      zdiff_v1           , zdiff_v1 * fact31 * zdeltat, zdiff_v1 * fact32 * zdeltat,   & 
     164            &                      zdiff_v2           , zdiff_v2 * fact31 * zdeltat, zdiff_v2 * fact32 * zdeltat 
     165      ELSE 
     166         WRITE(numhsb , 9030) kt , zdiff_hc1 / vol_tot , zdiff_hc1 * fact1  * zdeltat,                                & 
     167            &                      zdiff_sc1 / vol_tot , zdiff_sc1 * fact21 * zdeltat, zdiff_sc1 * fact22 * zdeltat,   & 
     168            &                      zdiff_v1            , zdiff_v1  * fact31 * zdeltat, zdiff_v1  * fact32 * zdeltat,   & 
     169            &                      zerr_hc1 / vol_tot  , zerr_sc1 / vol_tot 
     170      ENDIF 
    140171 
    141172      IF ( kt == nitend ) CLOSE( numhsb ) 
     
    144175 
    1451769020  FORMAT(I5,11D15.7) 
     1779030  FORMAT(I5,10D15.7) 
    146178      ! 
    147179   END SUBROUTINE dia_hsb 
     
    179211 
    180212      IF( .NOT. ln_diahsb )   RETURN 
     213      IF( .NOT. lk_mpp_rep ) & 
     214        CALL ctl_stop (' Your global mpp_sum if performed in single precision - 64 bits -', & 
     215             &         ' whereas the global sum to be precise must be done in double precision ',& 
     216             &         ' please add key_mpp_rep') 
    181217 
    182218      ! ------------------- ! 
    183219      ! 1 - Allocate memory ! 
    184220      ! ------------------- ! 
    185       ALLOCATE( hc_loc_ini(jpi,jpj,jpk), STAT=ierror ) 
     221      ALLOCATE( hc_loc_ini(jpi,jpj,jpk), sc_loc_ini(jpi,jpj,jpk), & 
     222         &      ssh_hc_loc_ini(jpi,jpj), ssh_sc_loc_ini(jpi,jpj), & 
     223         &      e3t_ini(jpi,jpj,jpk)                            , & 
     224         &      surf(jpi,jpj),  ssh_ini(jpi,jpj), STAT=ierror ) 
    186225      IF( ierror > 0 ) THEN 
    187226         CALL ctl_stop( 'dia_hsb: unable to allocate hc_loc_ini' )   ;   RETURN 
    188       ENDIF 
    189       ALLOCATE( sc_loc_ini(jpi,jpj,jpk), STAT=ierror ) 
    190       IF( ierror > 0 ) THEN 
    191          CALL ctl_stop( 'dia_hsb: unable to allocate sc_loc_ini' )   ;   RETURN 
    192       ENDIF 
    193       ALLOCATE( e3t_ini(jpi,jpj,jpk)   , STAT=ierror ) 
    194       IF( ierror > 0 ) THEN 
    195          CALL ctl_stop( 'dia_hsb: unable to allocate e3t_ini' )      ;   RETURN 
    196       ENDIF 
    197       ALLOCATE( surf(jpi,jpj)          , STAT=ierror ) 
    198       IF( ierror > 0 ) THEN 
    199          CALL ctl_stop( 'dia_hsb: unable to allocate surf' )         ;   RETURN 
    200       ENDIF 
    201       ALLOCATE( ssh_ini(jpi,jpj)       , STAT=ierror ) 
    202       IF( ierror > 0 ) THEN 
    203          CALL ctl_stop( 'dia_hsb: unable to allocate ssh_ini' )      ;   RETURN 
    204227      ENDIF 
    205228 
     
    214237      cl_name    = 'heat_salt_volume_budgets.txt'                         ! name of output file 
    215238      surf(:,:) = e1t(:,:) * e2t(:,:) * tmask(:,:,1) * tmask_i(:,:)      ! masked surface grid cell area 
    216       surf_tot  = SUM( surf(:,:) )                                       ! total ocean surface area 
     239      surf_tot  = glob_sum( surf(:,:) )                                       ! total ocean surface area 
    217240      vol_tot   = 0.d0                                                   ! total ocean volume 
    218241      DO jk = 1, jpkm1 
    219          vol_tot  = vol_tot + SUM( surf(:,:) * tmask(:,:,jk)     & 
    220             &                      * fse3t_n(:,:,jk)         ) 
     242         vol_tot  = vol_tot + glob_sum( surf(:,:) * tmask(:,:,jk)     & 
     243            &                         * fse3t_n(:,:,jk)         ) 
    221244      END DO 
    222       IF( lk_mpp ) THEN  
    223          CALL mpp_sum( vol_tot ) 
    224          CALL mpp_sum( surf_tot ) 
    225       ENDIF 
    226245 
    227246      CALL ctl_opn( numhsb , cl_name , 'UNKNOWN' , 'FORMATTED' , 'SEQUENTIAL' , 1 , numout , lwp , 1 ) 
    228       !                   12345678901234567890123456789012345678901234567890123456789012345678901234567890 -> 80 
    229       WRITE( numhsb, 9010 ) "kt   |     heat content budget     |            salt content budget             ",   & 
    230          !                                                   123456789012345678901234567890123456789012345 -> 45 
    231          &                                                  "|            volume budget (ssh)             ",   & 
    232          !                                                   678901234567890123456789012345678901234567890 -> 45 
    233          &                                                  "|            volume budget (e3t)             " 
    234       WRITE( numhsb, 9010 ) "     |      [C]         [W/m2]     |     [psu]        [mmm/s]          [SV]     ",   & 
    235          &                                                  "|     [m3]         [mmm/s]          [SV]     ",   & 
    236          &                                                  "|     [m3]         [mmm/s]          [SV]     " 
    237  
     247      IF( lk_vvl ) THEN 
     248         !                   12345678901234567890123456789012345678901234567890123456789012345678901234567890 -> 80 
     249         WRITE( numhsb, 9010 ) "kt   |     heat content budget     |            salt content budget             ",   & 
     250            !                                                   123456789012345678901234567890123456789012345 -> 45 
     251            &                                                  "|            volume budget (ssh)             ",   & 
     252            !                                                   678901234567890123456789012345678901234567890 -> 45 
     253            &                                                  "|            volume budget (e3t)             " 
     254         WRITE( numhsb, 9010 ) "     |      [C]         [W/m2]     |     [psu]        [mmm/s]          [SV]     ",   & 
     255            &                                                  "|     [m3]         [mmm/s]          [SV]     ",   & 
     256            &                                                  "|     [m3]         [mmm/s]          [SV]     " 
     257      ELSE 
     258         !                   12345678901234567890123456789012345678901234567890123456789012345678901234567890 -> 80 
     259         WRITE( numhsb, 9011 ) "kt   |     heat content budget     |            salt content budget             ",   & 
     260            !                                                   123456789012345678901234567890123456789012345 -> 45 
     261            &                                                  "|            volume budget (ssh)             ",   & 
     262            !                                                   678901234567890123456789012345678901234567890 -> 45 
     263            &                                                  "|  Non conservation due to free surface      " 
     264         WRITE( numhsb, 9011 ) "     |      [C]         [W/m2]     |     [psu]        [mmm/s]          [SV]     ",   & 
     265            &                                                  "|     [m3]         [mmm/s]          [SV]     ",   & 
     266            &                                                  "|  [heat - C]     [salt - psu]                " 
     267      ENDIF 
    238268      ! --------------- ! 
    239269      ! 3 - Conversions ! (factors will be multiplied by duration afterwards) 
     
    261291      frc_t = 0.d0                                           ! heat content   -    -   -    -    
    262292      frc_s = 0.d0                                           ! salt content   -    -   -    -          
     293      IF( .NOT. lk_vvl ) THEN 
     294         ssh_hc_loc_ini(:,:) = tsn(:,:,1,jp_tem) * ssh_ini(:,:)   ! initial heat content associated with ssh 
     295         ssh_sc_loc_ini(:,:) = tsn(:,:,1,jp_sal) * ssh_ini(:,:)   ! initial salt content associated with ssh 
     296         frc_wn_t = 0.d0 
     297         frc_wn_s = 0.d0 
     298      ENDIF 
    263299      ! 
    2643009010  FORMAT(A80,A45,A45) 
     3019011  FORMAT(A80,A45,A45) 
    265302      ! 
    266303   END SUBROUTINE dia_hsb_init 
  • branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/DIA/diaptr.F90

    r3764 r4276  
    350350               DO jn = 1, nptr 
    351351                  tn_jk(:,:,jn) = ptr_tjk( tsn(:,:,:,jp_tem), btmsk(:,:,jn) ) * r1_sjk(:,:,jn) 
     352                  sn_jk(:,:,jn) = ptr_tjk( tsn(:,:,:,jp_sal), btmsk(:,:,jn) ) * r1_sjk(:,:,jn) 
    352353               END DO 
    353354            ENDIF 
     
    563564      !!--------------------------------------------------------------------  
    564565      ! 
    565       CALL wrk_alloc( jpi      , zphi , zfoo ) 
    566       CALL wrk_alloc( jpi , jpk, z_1 ) 
     566      CALL wrk_alloc( jpj      , zphi , zfoo ) 
     567      CALL wrk_alloc( jpj , jpk, z_1 ) 
    567568 
    568569      ! define time axis 
     
    878879      ENDIF 
    879880      ! 
    880       CALL wrk_dealloc( jpi      , zphi , zfoo ) 
    881       CALL wrk_dealloc( jpi , jpk, z_1 ) 
     881      CALL wrk_dealloc( jpj      , zphi , zfoo ) 
     882      CALL wrk_dealloc( jpj , jpk, z_1 ) 
    882883      ! 
    883884  END SUBROUTINE dia_ptr_wri 
  • branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/DOM/closea.F90

    r3632 r4276  
    108108            ncsi1(2)   =  97  ;  ncsj1(2)   = 107 
    109109            ncsi2(2)   = 103  ;  ncsj2(2)   = 111 
    110             ncsir(2,1) = 110  ;  ncsjr(2,1) = 111 
    111             !                                            ! Black Sea 1 : west part of the Black Sea  
    112             ncsnr(3)   = 1    ; ncstt(3)   =   2            !            (ie west of the cyclic b.c.) 
    113             ncsi1(3)   = 174  ; ncsj1(3)   = 107            ! put in Med Sea 
    114             ncsi2(3)   = 181  ; ncsj2(3)   = 112 
    115             ncsir(3,1) = 171  ; ncsjr(3,1) = 106  
    116             !                                            ! Black Sea 2 : est part of the Black Sea  
    117             ncsnr(4)   =   1  ;  ncstt(4)   =   2           !               (ie est of the cyclic b.c.) 
    118             ncsi1(4)   =   2  ;  ncsj1(4)   = 107           ! put in Med Sea 
    119             ncsi2(4)   =   6  ;  ncsj2(4)   = 112 
    120             ncsir(4,1) = 171  ;  ncsjr(4,1) = 106  
     110            ncsir(2,1) = 110  ;  ncsjr(2,1) = 111            
     111            !                                            ! Black Sea (crossed by the cyclic boundary condition) 
     112            ncsnr(3:4) =   4  ;  ncstt(3:4) =   2           ! put in Med Sea (north of Aegean Sea) 
     113            ncsir(3:4,1) = 171;  ncsjr(3:4,1) = 106         ! 
     114            ncsir(3:4,2) = 170;  ncsjr(3:4,2) = 106  
     115            ncsir(3:4,3) = 171;  ncsjr(3:4,3) = 105  
     116            ncsir(3:4,4) = 170;  ncsjr(3:4,4) = 105  
     117            ncsi1(3)   = 174  ;  ncsj1(3)   = 107           ! 1 : west part of the Black Sea       
     118            ncsi2(3)   = 181  ;  ncsj2(3)   = 112           !            (ie west of the cyclic b.c.) 
     119            ncsi1(4)   =   2  ;  ncsj1(4)   = 107           ! 2 : east part of the Black Sea  
     120            ncsi2(4)   =   6  ;  ncsj2(4)   = 112           !           (ie east of the cyclic b.c.) 
     121              
     122           
     123 
    121124            !                                        ! ======================= 
    122125         CASE ( 4 )                                  !  ORCA_R4 configuration 
     
    372375      REAL(wp), DIMENSION(jpi,jpj), INTENT(inout) ::   p_rnfmsk   ! river runoff mask (rnfmsk array) 
    373376      ! 
    374       INTEGER  ::   jc, jn      ! dummy loop indices 
    375       INTEGER  ::   ii, ij      ! temporary integer 
     377      INTEGER  ::   jc, jn, ji, jj      ! dummy loop indices 
    376378      !!---------------------------------------------------------------------- 
    377379      ! 
     
    379381         IF( ncstt(jc) >= 1 ) THEN            ! runoff mask set to 1 at closed sea outflows 
    380382             DO jn = 1, 4 
    381                ii = mi0( ncsir(jc,jn) ) 
    382                ij = mj0( ncsjr(jc,jn) ) 
    383                p_rnfmsk(ii,ij) = MAX( p_rnfmsk(ii,ij), 1.0_wp ) 
     383                DO jj =    mj0( ncsjr(jc,jn) ), mj1( ncsjr(jc,jn) ) 
     384                   DO ji = mi0( ncsir(jc,jn) ), mi1( ncsir(jc,jn) ) 
     385                      p_rnfmsk(ji,jj) = MAX( p_rnfmsk(ji,jj), 1.0_wp ) 
     386                   END DO 
     387                END DO 
    384388            END DO  
    385389         ENDIF  
  • branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/DOM/daymod.F90

    r3851 r4276  
    238238               nday_year = 1 
    239239               nsec_year = ndt05 
     240               IF( nsec1jan000 >= 2 * (2**30 - nsecd * nyear_len(1) / 2 ) ) THEN   ! test integer 4 max value 
     241                  CALL ctl_stop( 'The number of seconds between Jan. 1st 00h of nit000 year and Jan. 1st 00h ',   & 
     242                     &           'of the current year is exceeding the INTEGER 4 max VALUE: 2^31-1 -> 68.09 years in seconds', & 
     243                     & 'You must do a restart at higher frequency (or remove this STOP and recompile everything in I8)' ) 
     244               ENDIF 
    240245               nsec1jan000 = nsec1jan000 + nsecd * nyear_len(1) 
    241246               IF( nleapy == 1 )   CALL day_mth 
  • branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/DOM/domvvl.F90

    r3294 r4276  
    192192      INTEGER  ::   iku, ikv     ! local integers     
    193193      INTEGER  ::   ii0, ii1, ij0, ij1   ! temporary integers 
    194       REAL(wp) ::   zvt          ! local scalars 
     194      REAL(wp) ::   zvt, zvtip1, zvtjp1  ! local scalars 
    195195      !!---------------------------------------------------------------------- 
    196196      ! 
     
    202202         WRITE(numout,*) '~~~~~~~~~ ' 
    203203         pe3u_b(:,:,jpk) = fse3u_0(:,:,jpk) 
    204          pe3v_b(:,:,jpk) = fse3u_0(:,:,jpk) 
     204         pe3v_b(:,:,jpk) = fse3v_0(:,:,jpk) 
    205205      ENDIF 
    206206       
     
    208208         DO jj = 2, jpjm1 
    209209            DO ji = fs_2, fs_jpim1 
    210                zvt = fse3t_b(ji,jj,jk) * e1e2t(ji,jj) 
    211                pe3u_b(ji,jj,jk) = 0.5_wp * ( zvt + fse3t_b(ji+1,jj,jk) * e1e2t(ji+1,jj) ) / ( e1u(ji,jj) * e2u(ji,jj) ) 
    212                pe3v_b(ji,jj,jk) = 0.5_wp * ( zvt + fse3t_b(ji,jj+1,jk) * e1e2t(ji,jj+1) ) / ( e1v(ji,jj) * e2v(ji,jj) ) 
     210               zvt    = ( fse3t_b(ji  ,jj  ,jk) - fse3t_0(ji  ,jj  ,jk) ) * e1e2t(ji  ,jj  ) 
     211               zvtip1 = ( fse3t_b(ji+1,jj  ,jk) - fse3t_0(ji+1,jj  ,jk) ) * e1e2t(ji+1,jj  ) 
     212               zvtjp1 = ( fse3t_b(ji  ,jj+1,jk) - fse3t_0(ji  ,jj+1,jk) ) * e1e2t(ji  ,jj+1) 
     213               pe3u_b(ji,jj,jk) = fse3u_0(ji,jj,jk) + 0.5_wp * ( zvt + zvtip1 ) / ( e1u(ji,jj) * e2u(ji,jj) ) 
     214               pe3v_b(ji,jj,jk) = fse3v_0(ji,jj,jk) + 0.5_wp * ( zvt + zvtjp1 ) / ( e1v(ji,jj) * e2v(ji,jj) ) 
    213215            END DO 
    214216         END DO 
  • branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/DOM/domzgr.F90

    r3764 r4276  
    169169      !!---------------------------------------------------------------------- 
    170170      !!                   ***  ROUTINE zgr_z  *** 
    171       !!                    
     171      !!                     
    172172      !! ** Purpose :   set the depth of model levels and the resulting  
    173173      !!      vertical scale factors. 
     
    639639         END DO 
    640640      END DO 
     641      IF( lk_mpp )   CALL mpp_sum( icompt ) 
    641642      IF( icompt == 0 ) THEN 
    642643         IF(lwp) WRITE(numout,*)'     no isolated ocean grid points' 
     
    12521253         DO jj = 1, jpj 
    12531254            DO ji = 1, jpi 
    1254                ztaper = EXP( -(gphit(ji,jj)/8._wp)**2 ) 
     1255               ztaper = EXP( -(gphit(ji,jj)/8._wp)**2._wp ) 
    12551256               hbatt(ji,jj) = rn_sbot_max * ztaper + hbatt(ji,jj) * ( 1._wp - ztaper ) 
    12561257            END DO 
     
    13671368      fsde3w(:,:,:) = gdep3w(:,:,:) 
    13681369      ! 
    1369       where (e3t   (:,:,:).eq.0.0)  e3t(:,:,:) = 1.0 
    1370       where (e3u   (:,:,:).eq.0.0)  e3u(:,:,:) = 1.0 
    1371       where (e3v   (:,:,:).eq.0.0)  e3v(:,:,:) = 1.0 
    1372       where (e3f   (:,:,:).eq.0.0)  e3f(:,:,:) = 1.0 
    1373       where (e3w   (:,:,:).eq.0.0)  e3w(:,:,:) = 1.0 
    1374       where (e3uw  (:,:,:).eq.0.0)  e3uw(:,:,:) = 1.0 
    1375       where (e3vw  (:,:,:).eq.0.0)  e3vw(:,:,:) = 1.0 
    1376  
     1370      where (e3t   (:,:,:).eq.0.0)  e3t(:,:,:) = 1._wp 
     1371      where (e3u   (:,:,:).eq.0.0)  e3u(:,:,:) = 1._wp 
     1372      where (e3v   (:,:,:).eq.0.0)  e3v(:,:,:) = 1._wp 
     1373      where (e3f   (:,:,:).eq.0.0)  e3f(:,:,:) = 1._wp 
     1374      where (e3w   (:,:,:).eq.0.0)  e3w(:,:,:) = 1._wp 
     1375      where (e3uw  (:,:,:).eq.0.0)  e3uw(:,:,:) = 1._wp 
     1376      where (e3vw  (:,:,:).eq.0.0)  e3vw(:,:,:) = 1._wp 
     1377 
     1378#if defined key_agrif 
     1379      ! Ensure meaningful vertical scale factors in ghost lines/columns 
     1380      IF( .NOT. Agrif_Root() ) THEN 
     1381         !   
     1382         IF((nbondi == -1).OR.(nbondi == 2)) THEN 
     1383            e3u(1,:,:) = e3u(2,:,:) 
     1384         ENDIF 
     1385         ! 
     1386         IF((nbondi ==  1).OR.(nbondi == 2)) THEN 
     1387            e3u(nlci-1,:,:) = e3u(nlci-2,:,:) 
     1388         ENDIF 
     1389         ! 
     1390         IF((nbondj == -1).OR.(nbondj == 2)) THEN 
     1391            e3v(:,1,:) = e3v(:,2,:) 
     1392         ENDIF 
     1393         ! 
     1394         IF((nbondj ==  1).OR.(nbondj == 2)) THEN 
     1395            e3v(:,nlcj-1,:) = e3v(:,nlcj-2,:) 
     1396         ENDIF 
     1397         ! 
     1398      ENDIF 
     1399#endif 
    13771400 
    13781401      fsdept(:,:,:) = gdept (:,:,:) 
     
    14231446         WRITE(numout,"(10x,i4,4f9.2)") ( jk, fsdept(1,1,jk), fsdepw(1,1,jk),     & 
    14241447            &                                 fse3t (1,1,jk), fse3w (1,1,jk), jk=1,jpk ) 
    1425          DO jj = mj0(20), mj1(20) 
    1426             DO ji = mi0(20), mi1(20) 
     1448         iip1 = MIN(20, jpiglo-1)  ! for config with i smaller than 20 points 
     1449         ijp1 = MIN(20, jpjglo-1)  ! for config with j smaller than 20 points 
     1450         DO jj = mj0(ijp1), mj1(ijp1) 
     1451            DO ji = mi0(iip1), mi1(iip1) 
    14271452               WRITE(numout,*) 
    1428                WRITE(numout,*) ' domzgr: vertical coordinates : point (20,20,k)   bathy = ', bathy(ji,jj), hbatt(ji,jj) 
     1453               WRITE(numout,*) ' domzgr: vertical coordinates : point (',iip1,',',ijp1,',k)   bathy = ',  & 
     1454                  &                                              bathy(ji,jj), hbatt(ji,jj) 
    14291455               WRITE(numout,*) ' ~~~~~~  --------------------' 
    14301456               WRITE(numout,"(9x,' level   gdept    gdepw    gde3w     e3t      e3w  ')") 
     
    14331459            END DO 
    14341460         END DO 
    1435          DO jj = mj0(74), mj1(74) 
    1436             DO ji = mi0(100), mi1(100) 
     1461         iip1 = MIN(  74, jpiglo-1) 
     1462         ijp1 = MIN( 100, jpjglo-1) 
     1463         DO jj = mj0(ijp1), mj1(ijp1) 
     1464            DO ji = mi0(iip1), mi1(iip1) 
    14371465               WRITE(numout,*) 
    1438                WRITE(numout,*) ' domzgr: vertical coordinates : point (100,74,k)   bathy = ', bathy(ji,jj), hbatt(ji,jj) 
     1466               WRITE(numout,*) ' domzgr: vertical coordinates : point (',iip1,',',ijp1,',k)   bathy = ',  & 
     1467                  &                                              bathy(ji,jj), hbatt(ji,jj) 
    14391468               WRITE(numout,*) ' ~~~~~~  --------------------' 
    14401469               WRITE(numout,"(9x,' level   gdept    gdepw    gde3w     e3t      e3w  ')") 
     
    17231752      ENDDO 
    17241753      ! 
    1725       CALL lbc_lnk(e3t ,'T',1.) ; CALL lbc_lnk(e3u ,'T',1.) 
    1726       CALL lbc_lnk(e3v ,'T',1.) ; CALL lbc_lnk(e3f ,'T',1.) 
    1727       CALL lbc_lnk(e3w ,'T',1.) 
    1728       CALL lbc_lnk(e3uw,'T',1.) ; CALL lbc_lnk(e3vw,'T',1.) 
    1729       ! 
    17301754      !                                               ! ============= 
    17311755 
     
    18241848      !!---------------------------------------------------------------------- 
    18251849      ! 
    1826       pf =   (   TANH( rn_theta * ( -(pk-0.5_wp) / REAL(jpkm1) + rn_thetb )  )   & 
     1850      pf =   (   TANH( rn_theta * ( -(pk-0.5_wp) / REAL(jpkm1,wp) + rn_thetb )  )   & 
    18271851         &     - TANH( rn_thetb * rn_theta                                )  )   & 
    18281852         & * (   COSH( rn_theta                           )                      & 
     
    18501874      ! 
    18511875      IF ( rn_theta == 0 ) then      ! uniform sigma 
    1852          pf1 = - ( pk1 - 0.5_wp ) / REAL( jpkm1 ) 
     1876         pf1 = - ( pk1 - 0.5_wp ) / REAL( jpkm1,wp ) 
    18531877      ELSE                        ! stretched sigma 
    1854          pf1 =   ( 1._wp - pbb ) * ( SINH( rn_theta*(-(pk1-0.5_wp)/REAL(jpkm1)) ) ) / SINH( rn_theta )              & 
    1855             &  + pbb * (  (TANH( rn_theta*( (-(pk1-0.5_wp)/REAL(jpkm1)) + 0.5_wp) ) - TANH( 0.5_wp * rn_theta )  )  & 
     1878         pf1 =   ( 1._wp - pbb ) * ( SINH( rn_theta*(-(pk1-0.5_wp)/REAL(jpkm1,wp)) ) ) / SINH( rn_theta )              & 
     1879            &  + pbb * (  (TANH( rn_theta*( (-(pk1-0.5_wp)/REAL(jpkm1,wp)) + 0.5_wp) ) - TANH( 0.5_wp * rn_theta )  )  & 
    18561880            &        / ( 2._wp * TANH( 0.5_wp * rn_theta ) )  ) 
    18571881      ENDIF 
  • branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/DYN/dynadv_ubs.F90

    r3294 r4276  
    2929 
    3030   REAL(wp), PARAMETER :: gamma1 = 1._wp/3._wp  ! =1/4 quick      ; =1/3  3rd order UBS 
    31    REAL(wp), PARAMETER :: gamma2 = 1._wp/8._wp  ! =0   2nd order  ; =1/8 4th order centred 
     31   REAL(wp), PARAMETER :: gamma2 = 1._wp/32._wp ! =0   2nd order  ; =1/32 4th order centred 
    3232 
    3333   PUBLIC   dyn_adv_ubs   ! routine called by step.F90 
     
    5757      !!                       = 1/3  3rd order Upstream biased scheme 
    5858      !!                gamma2 = 0    2nd order finite differencing  
    59       !!                       = 1/8 4th order finite differencing 
     59      !!                       = 1/32 4th order finite differencing 
    6060      !!      For stability reasons, the first term of the fluxes which cor- 
    6161      !!      responds to a second order centered scheme is evaluated using   
     
    6464      !!      before velocity (forward in time).  
    6565      !!      Default value (hard coded in the begining of the module) are  
    66       !!      gamma1=1/3 and gamma2=1/8. 
     66      !!      gamma1=1/3 and gamma2=1/32. 
    6767      !! 
    6868      !! ** Action : - (ua,va) updated with the 3D advective momentum trends 
  • branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/DYN/dynspg_flt.F90

    r3765 r4276  
    109109      INTEGER  ::   ji, jj, jk   ! dummy loop indices 
    110110      REAL(wp) ::   z2dt, z2dtg, zgcb, zbtd, ztdgu, ztdgv   ! local scalars 
    111       REAL(wp), POINTER, DIMENSION(:,:,:) ::  zub, zvb 
    112111      !!---------------------------------------------------------------------- 
    113112      ! 
    114113      IF( nn_timing == 1 )  CALL timing_start('dyn_spg_flt') 
    115114      ! 
    116       CALL wrk_alloc( jpi,jpj,jpk, zub, zvb ) 
    117115      ! 
    118116      IF( kt == nit000 ) THEN 
     
    213211         DO jk = 1, jpkm1 
    214212            DO ji = 1, jpij 
    215                spgu(ji,1) = spgu(ji,1) + fse3u(ji,1,jk) * ua(ji,1,jk) 
    216                spgv(ji,1) = spgv(ji,1) + fse3v(ji,1,jk) * va(ji,1,jk) 
     213               spgu(ji,1) = spgu(ji,1) + fse3u_a(ji,1,jk) * ua(ji,1,jk) 
     214               spgv(ji,1) = spgv(ji,1) + fse3v_a(ji,1,jk) * va(ji,1,jk) 
    217215            END DO 
    218216         END DO 
     
    221219            DO jj = 2, jpjm1 
    222220               DO ji = 2, jpim1 
    223                   spgu(ji,jj) = spgu(ji,jj) + fse3u(ji,jj,jk) * ua(ji,jj,jk) 
    224                   spgv(ji,jj) = spgv(ji,jj) + fse3v(ji,jj,jk) * va(ji,jj,jk) 
     221                  spgu(ji,jj) = spgu(ji,jj) + fse3u_a(ji,jj,jk) * ua(ji,jj,jk) 
     222                  spgv(ji,jj) = spgv(ji,jj) + fse3v_a(ji,jj,jk) * va(ji,jj,jk) 
    225223               END DO 
    226224            END DO 
     
    360358      IF( lrst_oce ) CALL flt_rst( kt, 'WRITE' ) 
    361359      ! 
    362       CALL wrk_dealloc( jpi,jpj,jpk, zub, zvb ) 
    363360      ! 
    364361      IF( nn_timing == 1 )  CALL timing_stop('dyn_spg_flt') 
  • branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/ICB/icb_oce.F90

    r4236 r4276  
    3737   USE par_oce   ! ocean parameters 
    3838   USE lib_mpp   ! MPP library 
    39    USE fldread   ! read input fields (FLD type) 
    4039 
    4140   IMPLICIT NONE 
     
    151150   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   :: griddata                           !: work array for icbrst 
    152151 
    153    TYPE(FLD), PUBLIC, ALLOCATABLE     , DIMENSION(:)       ::   sf_icb   !: structure: file information, fields read 
    154  
    155152   !!---------------------------------------------------------------------- 
    156153   !! NEMO/OPA 3.3 , NEMO Consortium (2011) 
     
    168165      ! 
    169166      icb_alloc = 0 
    170       ALLOCATE( & !cbr berg_grid                      ,                                               & 
    171          &      berg_grid%calving    (jpi,jpj) , berg_grid%calving_hflx (jpi,jpj)          ,   & 
     167      ALLOCATE( berg_grid%calving    (jpi,jpj) , berg_grid%calving_hflx (jpi,jpj)          ,   & 
    172168         &      berg_grid%stored_heat(jpi,jpj) , berg_grid%floating_melt(jpi,jpj)          ,   & 
    173169         &      berg_grid%maxclass   (jpi,jpj) , berg_grid%stored_ice   (jpi,jpj,nclasses) ,   & 
  • branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/ICB/icbini.F90

    r3785 r4276  
    3535   PUBLIC   icb_init  ! routine called in nemogcm.F90 module 
    3636 
    37    CHARACTER(len=100) ::   cn_dir = './'   ! Root directory for location of icb files 
    38    TYPE(FLD_N)        ::   sn_icb          ! information about the calving file to be read 
     37   CHARACTER(len=100)                                 ::   cn_dir = './'   !: Root directory for location of icb files 
     38   TYPE(FLD_N)                                        ::   sn_icb          !: information about the calving file to be read 
     39   TYPE(FLD), PUBLIC, ALLOCATABLE     , DIMENSION(:)  ::   sf_icb          !: structure: file information, fields read 
     40                                                                           !: used in icbini and icbstp 
    3941 
    4042   !!---------------------------------------------------------------------- 
  • branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/ICB/icbstp.F90

    r3614 r4276  
    2424   USE lib_mpp 
    2525   USE iom 
     26   USE fldread 
    2627   USE timing         ! timing 
    2728 
  • branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/IOM/iom.F90

    r3771 r4276  
    3131   USE sbc_oce, ONLY :   nn_fsbc         ! ocean space and time domain 
    3232   USE trc_oce, ONLY :   nn_dttrc        !  !: frequency of step on passive tracers 
     33   USE icb_oce, ONLY :   class_num       !  !: iceberg classes 
    3334   USE domngb          ! ocean space and time domain 
    3435   USE phycst          ! physical constants 
     
    3637   USE xios 
    3738# endif 
     39   USE ioipsl, ONLY :  ju2ymds    ! for calendar 
    3840 
    3941   IMPLICIT NONE 
     
    5254   PRIVATE iom_p1d, iom_p2d, iom_p3d 
    5355#if defined key_iomput 
    54    PRIVATE iom_set_domain_attr, iom_set_axis_attr, iom_set_field_attr, iom_set_file_attr, iom_set_grid_attr 
    55    PRIVATE set_grid, set_scalar, set_xmlatt, set_mooring 
     56   PRIVATE iom_set_domain_attr, iom_set_axis_attr, iom_set_field_attr, iom_set_file_attr, iom_get_file_attr, iom_set_grid_attr 
     57   PRIVATE set_grid, set_scalar, set_xmlatt, set_mooring, iom_update_file_name, iom_sdate 
    5658# endif 
    5759 
     
    98100      clname = "nemo" 
    99101      IF( TRIM(Agrif_CFixed()) /= '0' )   clname = TRIM(Agrif_CFixed())//"_"//TRIM(clname) 
     102# if defined key_mpp_mpi 
    100103      CALL xios_context_initialize(TRIM(clname), mpi_comm_opa) 
     104# else 
     105      CALL xios_context_initialize(TRIM(clname), 0) 
     106# endif 
    101107      CALL iom_swap 
    102108 
     
    123129      CALL iom_set_axis_attr( "depthw", gdepw_0 ) 
    124130# if defined key_floats 
    125       CALL iom_set_axis_attr( "nfloat", (ji, ji=1,nfloat) ) 
     131      CALL iom_set_axis_attr( "nfloat", (/ (REAL(ji,wp), ji=1,nfloat) /) ) 
    126132# endif 
     133      CALL iom_set_axis_attr( "icbcla", class_num ) 
    127134       
    128135      ! automatic definitions of some of the xml attributs 
     
    130137 
    131138      ! end file definition 
    132        dtime%second=rdt 
    133        CALL xios_set_timestep(dtime) 
    134        CALL xios_close_context_definition() 
    135  
    136        CALL xios_update_calendar(0) 
     139      dtime%second = rdt 
     140      CALL xios_set_timestep(dtime) 
     141      CALL xios_close_context_definition() 
     142       
     143      CALL xios_update_calendar(0) 
    137144#endif 
    138  
     145       
    139146   END SUBROUTINE iom_init 
    140147 
     
    174181      LOGICAL         , INTENT(in   ), OPTIONAL ::   ldiof    ! Interp On the Fly, needed for AGRIF (default = .FALSE.) 
    175182 
    176       CHARACTER(LEN=100)    ::   clname    ! the name of the file based on cdname [[+clcpu]+clcpu] 
    177       CHARACTER(LEN=100)    ::   cltmpn    ! tempory name to store clname (in writting mode) 
     183      CHARACTER(LEN=256)    ::   clname    ! the name of the file based on cdname [[+clcpu]+clcpu] 
     184      CHARACTER(LEN=256)    ::   cltmpn    ! tempory name to store clname (in writting mode) 
    178185      CHARACTER(LEN=10)     ::   clsuffix  ! ".nc" or ".dimg" 
    179186      CHARACTER(LEN=15)     ::   clcpu     ! the cpu number (max jpmax_digits digits) 
    180       CHARACTER(LEN=100)    ::   clinfo    ! info character 
     187      CHARACTER(LEN=256)    ::   clinfo    ! info character 
    181188      LOGICAL               ::   llok      ! check the existence  
    182189      LOGICAL               ::   llwrt     ! local definition of ldwrt 
     
    561568      REAL(wp)                       ::   zscf, zofs  ! sacle_factor and add_offset 
    562569      INTEGER                        ::   itmp        ! temporary integer 
    563       CHARACTER(LEN=100)             ::   clinfo      ! info character 
    564       CHARACTER(LEN=100)             ::   clname      ! file name 
     570      CHARACTER(LEN=256)             ::   clinfo      ! info character 
     571      CHARACTER(LEN=256)             ::   clname      ! file name 
    565572      CHARACTER(LEN=1)               ::   clrankpv, cldmspc      !  
    566573      !--------------------------------------------------------------------- 
     
    10101017   !!---------------------------------------------------------------------- 
    10111018 
    1012  
    10131019#if defined key_iomput 
    10141020 
    1015    SUBROUTINE iom_set_domain_attr( cdname, ni_glo, nj_glo, ibegin, jbegin, ni, nj, zoom_ibegin, zoom_jbegin, zoom_ni, zoom_nj,   & 
     1021   SUBROUTINE iom_set_domain_attr( cdid, ni_glo, nj_glo, ibegin, jbegin, ni, nj, zoom_ibegin, zoom_jbegin, zoom_ni, zoom_nj,   & 
    10161022      &                                    data_dim, data_ibegin, data_ni, data_jbegin, data_nj, lonvalue, latvalue, mask ) 
    1017       CHARACTER(LEN=*)                 , INTENT(in) ::   cdname 
     1023      CHARACTER(LEN=*)                 , INTENT(in) ::   cdid 
    10181024      INTEGER                , OPTIONAL, INTENT(in) ::   ni_glo, nj_glo, ibegin, jbegin, ni, nj 
    10191025      INTEGER                , OPTIONAL, INTENT(in) ::   data_dim, data_ibegin, data_ni, data_jbegin, data_nj 
     
    10221028      LOGICAL, DIMENSION(:,:), OPTIONAL, INTENT(in) ::   mask 
    10231029 
    1024       IF ( xios_is_valid_domain     (cdname) ) THEN 
    1025          CALL xios_set_domain_attr     ( cdname, ni_glo=ni_glo, nj_glo=nj_glo, ibegin=ibegin, jbegin=jbegin, ni=ni, nj=nj,   & 
    1026             &    data_dim=data_dim, data_ibegin=data_ibegin, data_ni=data_ni, data_jbegin=data_jbegin, data_nj=data_nj   ,   & 
    1027             &    zoom_ibegin=zoom_ibegin, zoom_jbegin=zoom_jbegin, zoom_ni=zoom_ni, zoom_nj=zoom_nj,                         & 
     1030      IF ( xios_is_valid_domain     (cdid) ) THEN 
     1031         CALL xios_set_domain_attr     ( cdid, ni_glo=ni_glo, nj_glo=nj_glo, ibegin=ibegin, jbegin=jbegin, ni=ni, nj=nj,   & 
     1032            &    data_dim=data_dim, data_ibegin=data_ibegin, data_ni=data_ni, data_jbegin=data_jbegin, data_nj=data_nj ,   & 
     1033            &    zoom_ibegin=zoom_ibegin, zoom_jbegin=zoom_jbegin, zoom_ni=zoom_ni, zoom_nj=zoom_nj,                       & 
    10281034            &    lonvalue=lonvalue, latvalue=latvalue,mask=mask ) 
    10291035      ENDIF 
    10301036 
    1031       IF ( xios_is_valid_domaingroup(cdname) ) THEN 
    1032          CALL xios_set_domaingroup_attr( cdname, ni_glo=ni_glo, nj_glo=nj_glo, ibegin=ibegin, jbegin=jbegin, ni=ni, nj=nj,   & 
    1033             &    data_dim=data_dim, data_ibegin=data_ibegin, data_ni=data_ni, data_jbegin=data_jbegin, data_nj=data_nj   ,   & 
    1034             &    zoom_ibegin=zoom_ibegin, zoom_jbegin=zoom_jbegin, zoom_ni=zoom_ni, zoom_nj=zoom_nj,                         & 
     1037      IF ( xios_is_valid_domaingroup(cdid) ) THEN 
     1038         CALL xios_set_domaingroup_attr( cdid, ni_glo=ni_glo, nj_glo=nj_glo, ibegin=ibegin, jbegin=jbegin, ni=ni, nj=nj,   & 
     1039            &    data_dim=data_dim, data_ibegin=data_ibegin, data_ni=data_ni, data_jbegin=data_jbegin, data_nj=data_nj ,   & 
     1040            &    zoom_ibegin=zoom_ibegin, zoom_jbegin=zoom_jbegin, zoom_ni=zoom_ni, zoom_nj=zoom_nj,                       & 
    10351041            &    lonvalue=lonvalue, latvalue=latvalue,mask=mask ) 
    10361042      ENDIF 
     1043      CALL xios_solve_inheritance() 
    10371044 
    10381045   END SUBROUTINE iom_set_domain_attr 
    10391046 
    10401047 
    1041    SUBROUTINE iom_set_axis_attr( cdname, paxis ) 
    1042       CHARACTER(LEN=*)      , INTENT(in) ::   cdname 
     1048   SUBROUTINE iom_set_axis_attr( cdid, paxis ) 
     1049      CHARACTER(LEN=*)      , INTENT(in) ::   cdid 
    10431050      REAL(wp), DIMENSION(:), INTENT(in) ::   paxis 
    1044       IF ( xios_is_valid_axis     (cdname) )   CALL xios_set_axis_attr     ( cdname, size=size(paxis),value=paxis ) 
    1045       IF ( xios_is_valid_axisgroup(cdname) )   CALL xios_set_axisgroup_attr( cdname, size=size(paxis),value=paxis ) 
     1051      IF ( xios_is_valid_axis     (cdid) )   CALL xios_set_axis_attr     ( cdid, size=size(paxis),value=paxis ) 
     1052      IF ( xios_is_valid_axisgroup(cdid) )   CALL xios_set_axisgroup_attr( cdid, size=size(paxis),value=paxis ) 
     1053      CALL xios_solve_inheritance() 
    10461054   END SUBROUTINE iom_set_axis_attr 
    10471055 
    10481056 
    1049    SUBROUTINE iom_set_field_attr( cdname, freq_op) 
    1050       CHARACTER(LEN=*)          , INTENT(in) ::   cdname 
     1057   SUBROUTINE iom_set_field_attr( cdid, freq_op, freq_offset ) 
     1058      CHARACTER(LEN=*)          , INTENT(in) ::   cdid 
    10511059      CHARACTER(LEN=*),OPTIONAL , INTENT(in) ::   freq_op 
    1052       IF ( xios_is_valid_field     (cdname) )   CALL xios_set_field_attr     ( cdname, freq_op=freq_op ) 
    1053       IF ( xios_is_valid_fieldgroup(cdname) )   CALL xios_set_fieldgroup_attr( cdname, freq_op=freq_op ) 
     1060      CHARACTER(LEN=*),OPTIONAL , INTENT(in) ::   freq_offset 
     1061      IF ( xios_is_valid_field     (cdid) )   CALL xios_set_field_attr     ( cdid, freq_op=freq_op, freq_offset=freq_offset ) 
     1062      IF ( xios_is_valid_fieldgroup(cdid) )   CALL xios_set_fieldgroup_attr( cdid, freq_op=freq_op, freq_offset=freq_offset ) 
     1063      CALL xios_solve_inheritance() 
    10541064   END SUBROUTINE iom_set_field_attr 
    10551065 
    10561066 
    1057    SUBROUTINE iom_set_file_attr( cdname, name, name_suffix ) 
    1058       CHARACTER(LEN=*)          , INTENT(in) ::   cdname 
     1067   SUBROUTINE iom_set_file_attr( cdid, name, name_suffix ) 
     1068      CHARACTER(LEN=*)          , INTENT(in) ::   cdid 
    10591069      CHARACTER(LEN=*),OPTIONAL , INTENT(in) ::   name, name_suffix 
    1060       IF ( xios_is_valid_file     (cdname) )   CALL xios_set_file_attr     ( cdname, name=name, name_suffix=name_suffix ) 
    1061       IF ( xios_is_valid_filegroup(cdname) )   CALL xios_set_filegroup_attr( cdname, name=name, name_suffix=name_suffix ) 
     1070      IF ( xios_is_valid_file     (cdid) )   CALL xios_set_file_attr     ( cdid, name=name, name_suffix=name_suffix ) 
     1071      IF ( xios_is_valid_filegroup(cdid) )   CALL xios_set_filegroup_attr( cdid, name=name, name_suffix=name_suffix ) 
     1072      CALL xios_solve_inheritance() 
    10621073   END SUBROUTINE iom_set_file_attr 
    10631074 
    10641075 
    1065    SUBROUTINE iom_set_grid_attr( cdname, mask ) 
    1066       CHARACTER(LEN=*)                   , INTENT(in) ::   cdname 
     1076   SUBROUTINE iom_get_file_attr( cdid, name, name_suffix, output_freq ) 
     1077      CHARACTER(LEN=*)          , INTENT(in ) ::   cdid 
     1078      CHARACTER(LEN=*),OPTIONAL , INTENT(out) ::   name, name_suffix, output_freq 
     1079      LOGICAL                                 ::   llexist1,llexist2,llexist3 
     1080      !--------------------------------------------------------------------- 
     1081      IF( PRESENT( name        ) )   name = ''          ! default values 
     1082      IF( PRESENT( name_suffix ) )   name_suffix = '' 
     1083      IF( PRESENT( output_freq ) )   output_freq = '' 
     1084      IF ( xios_is_valid_file     (cdid) ) THEN 
     1085         CALL xios_solve_inheritance() 
     1086         CALL xios_is_defined_file_attr     ( cdid, name = llexist1, name_suffix = llexist2, output_freq = llexist3) 
     1087         IF(llexist1)   CALL xios_get_file_attr     ( cdid, name = name ) 
     1088         IF(llexist2)   CALL xios_get_file_attr     ( cdid, name_suffix = name_suffix ) 
     1089         IF(llexist3)   CALL xios_get_file_attr     ( cdid, output_freq = output_freq ) 
     1090      ENDIF 
     1091      IF ( xios_is_valid_filegroup(cdid) ) THEN 
     1092         CALL xios_solve_inheritance() 
     1093         CALL xios_is_defined_filegroup_attr( cdid, name = llexist1, name_suffix = llexist2, output_freq = llexist3) 
     1094         IF(llexist1)   CALL xios_get_filegroup_attr( cdid, name = name ) 
     1095         IF(llexist2)   CALL xios_get_filegroup_attr( cdid, name_suffix = name_suffix ) 
     1096         IF(llexist3)   CALL xios_get_filegroup_attr( cdid, output_freq = output_freq ) 
     1097      ENDIF 
     1098   END SUBROUTINE iom_get_file_attr 
     1099 
     1100 
     1101   SUBROUTINE iom_set_grid_attr( cdid, mask ) 
     1102      CHARACTER(LEN=*)                   , INTENT(in) ::   cdid 
    10671103      LOGICAL, DIMENSION(:,:,:), OPTIONAL, INTENT(in) ::   mask 
    1068       IF ( xios_is_valid_grid     (cdname) )   CALL xios_set_grid_attr     ( cdname, mask=mask ) 
    1069       IF ( xios_is_valid_gridgroup(cdname) )   CALL xios_set_gridgroup_attr( cdname, mask=mask ) 
     1104      IF ( xios_is_valid_grid     (cdid) )   CALL xios_set_grid_attr     ( cdid, mask=mask ) 
     1105      IF ( xios_is_valid_gridgroup(cdid) )   CALL xios_set_gridgroup_attr( cdid, mask=mask ) 
     1106      CALL xios_solve_inheritance() 
    10701107   END SUBROUTINE iom_set_grid_attr 
    10711108 
     
    10731110   SUBROUTINE set_grid( cdgrd, plon, plat ) 
    10741111      !!---------------------------------------------------------------------- 
    1075       !!                     ***  ROUTINE   *** 
     1112      !!                     ***  ROUTINE set_grid  *** 
    10761113      !! 
    10771114      !! ** Purpose :   define horizontal grids 
     
    11011138         END SELECT 
    11021139         ! 
    1103          CALL iom_set_domain_attr( "grid_"//cdgrd       , mask = zmask(:,:,1) /= 0. ) 
    1104          CALL iom_set_grid_attr  ( "grid_"//cdgrd//"_3D", mask = zmask(:,:,:) /= 0. ) 
     1140         CALL iom_set_domain_attr( "grid_"//cdgrd       , mask = RESHAPE(zmask(nldi:nlei,nldj:nlej,1),(/ni,nj    /)) /= 0. ) 
     1141         CALL iom_set_grid_attr  ( "grid_"//cdgrd//"_3D", mask = RESHAPE(zmask(nldi:nlei,nldj:nlej,:),(/ni,nj,jpk/)) /= 0. ) 
    11051142      ENDIF 
    11061143       
     
    11101147   SUBROUTINE set_scalar 
    11111148      !!---------------------------------------------------------------------- 
    1112       !!                     ***  ROUTINE   *** 
     1149      !!                     ***  ROUTINE set_scalar  *** 
    11131150      !! 
    11141151      !! ** Purpose :   define fake grids for scalar point 
     
    11261163   SUBROUTINE set_xmlatt 
    11271164      !!---------------------------------------------------------------------- 
    1128       !!                     ***  ROUTINE   *** 
     1165      !!                     ***  ROUTINE set_xmlatt  *** 
    11291166      !! 
    11301167      !! ** Purpose :   automatic definitions of some of the xml attributs... 
    11311168      !! 
    11321169      !!---------------------------------------------------------------------- 
    1133       CHARACTER(len=6),DIMENSION( 8) ::   clsuff                   ! suffix name 
    11341170      CHARACTER(len=1),DIMENSION( 3) ::   clgrd                    ! suffix name 
    1135       CHARACTER(len=50)              ::   clname                   ! file name 
     1171      CHARACTER(len=256)             ::   clsuff                   ! suffix name 
    11361172      CHARACTER(len=1)               ::   cl1                      ! 1 character 
    11371173      CHARACTER(len=2)               ::   cl2                      ! 1 character 
    1138       CHARACTER(len=255)             ::   tfo 
    1139       INTEGER                        ::   idt                      ! time-step in seconds 
    1140       INTEGER                        ::   iddss, ihhss             ! number of seconds in 1 day, 1 hour and 1 year 
    1141       INTEGER                        ::   iyymo                    ! number of months in 1 year 
    1142       INTEGER                        ::   jg, jh, jd, jm, jy       ! loop counters 
     1174      INTEGER                        ::   ji, jg                   ! loop counters 
    11431175      INTEGER                        ::   ix, iy                   ! i-,j- index 
    11441176      REAL(wp)        ,DIMENSION(11) ::   zlontao                  ! longitudes of tao    moorings 
     
    11501182      !!---------------------------------------------------------------------- 
    11511183      !  
    1152       idt   = NINT( rdttra(1)     ) 
    1153       iddss = NINT( rday          )                                         ! number of seconds in 1 day 
    1154       ihhss = NINT( rmmss * rhhmm )                                         ! number of seconds in 1 hour 
    1155       iyymo = NINT( raamo         )                                         ! number of months in 1 year 
    1156  
    11571184      ! frequency of the call of iom_put (attribut: freq_op) 
    1158       tfo = TRIM(i2str(idt))//'s' 
    1159       CALL iom_set_field_attr('field_definition', freq_op=tfo) 
    1160       CALL iom_set_field_attr('SBC'   , freq_op=TRIM(i2str(idt* nn_fsbc ))//'s') 
    1161       CALL iom_set_field_attr('ptrc_T', freq_op=TRIM(i2str(idt* nn_dttrc))//'s') 
    1162       CALL iom_set_field_attr('diad_T', freq_op=TRIM(i2str(idt* nn_dttrc))//'s') 
     1185      WRITE(cl1,'(i1)')        1   ;   CALL iom_set_field_attr('field_definition', freq_op = cl1//'ts', freq_offset='0ts') 
     1186      WRITE(cl1,'(i1)')  nn_fsbc   ;   CALL iom_set_field_attr('SBC'             , freq_op = cl1//'ts', freq_offset='0ts') 
     1187      WRITE(cl1,'(i1)') nn_dttrc   ;   CALL iom_set_field_attr('ptrc_T'          , freq_op = cl1//'ts', freq_offset='0ts') 
     1188      WRITE(cl1,'(i1)') nn_dttrc   ;   CALL iom_set_field_attr('diad_T'          , freq_op = cl1//'ts', freq_offset='0ts') 
    11631189        
    11641190      ! output file names (attribut: name) 
    1165       clsuff(:) = (/ 'grid_T', 'grid_U', 'grid_V', 'grid_W', 'icemod', 'ptrc_T', 'diad_T', 'scalar' /)       
    1166       DO jg = 1, SIZE(clsuff)                                                                  ! grid type 
    1167          DO jh = 1, 24                                                                         ! 1-24 hours 
    1168             WRITE(cl2,'(i2)') jh  
    1169             CALL dia_nam( clname, jh * ihhss, clsuff(jg), ldfsec = .TRUE. ) 
    1170             CALL iom_set_file_attr(TRIM(ADJUSTL(cl2))//'h_'//clsuff(jg), name=TRIM(clname)) 
    1171          END DO 
    1172          DO jd = 1, 30                                                                         ! 1-30 days 
    1173             WRITE(cl1,'(i1)') jd  
    1174             CALL dia_nam( clname, jd * iddss, clsuff(jg), ldfsec = .TRUE. ) 
    1175             CALL iom_set_file_attr(cl1//'d_'//clsuff(jg), name=TRIM(clname)) 
    1176          END DO 
    1177          DO jm = 1, 11                                                                         ! 1-11 months 
    1178             WRITE(cl1,'(i1)') jm  
    1179             CALL dia_nam( clname, -jm, clsuff(jg) ) 
    1180             CALL iom_set_file_attr(cl1//'m_'//clsuff(jg), name=TRIM(clname)) 
    1181          END DO 
    1182          DO jy = 1, 50                                                                         ! 1-50 years   
    1183             WRITE(cl2,'(i2)') jy  
    1184             CALL dia_nam( clname, -jy * iyymo, clsuff(jg) ) 
    1185             CALL iom_set_file_attr(TRIM(ADJUSTL(cl2))//'y_'//clsuff(jg), name=TRIM(clname)) 
    1186          END DO 
     1191      DO ji = 1, 9 
     1192         WRITE(cl1,'(i1)') ji  
     1193         CALL iom_update_file_name('file'//cl1) 
     1194      END DO 
     1195      DO ji = 1, 99 
     1196         WRITE(cl2,'(i2.2)') ji  
     1197         CALL iom_update_file_name('file'//cl2) 
    11871198      END DO 
    11881199 
     
    11931204         ! Equatorial section (attributs: jbegin, ni, name_suffix) 
    11941205         CALL dom_ngb( 0., 0., ix, iy, cl1 ) 
    1195          CALL iom_set_domain_attr('Eq'//cl1, zoom_jbegin=iy, zoom_ni=jpiglo) 
    1196          CALL iom_set_file_attr('Eq'//cl1, name_suffix= '_Eq') 
     1206         CALL iom_set_domain_attr ('Eq'//cl1, zoom_jbegin=iy, zoom_ni=jpiglo) 
     1207         CALL iom_get_file_attr   ('Eq'//cl1, name_suffix = clsuff             ) 
     1208         CALL iom_set_file_attr   ('Eq'//cl1, name_suffix = TRIM(clsuff)//'_Eq') 
     1209         CALL iom_update_file_name('Eq'//cl1) 
    11971210      END DO 
    11981211      ! TAO moorings (attributs: ibegin, jbegin, name_suffix) 
     
    12141227   SUBROUTINE set_mooring( plon, plat) 
    12151228      !!---------------------------------------------------------------------- 
    1216       !!                     ***  ROUTINE   *** 
     1229      !!                     ***  ROUTINE set_mooring  *** 
    12171230      !! 
    12181231      !! ** Purpose :   automatic definitions of moorings xml attributs... 
     
    12231236!!$      CHARACTER(len=1),DIMENSION(4) ::   clgrd = (/ 'T', 'U', 'V', 'W' /)   ! suffix name 
    12241237      CHARACTER(len=1),DIMENSION(1) ::   clgrd = (/ 'T' /)        ! suffix name 
    1225       CHARACTER(len=50)             ::   clname                   ! file name 
     1238      CHARACTER(len=256)            ::   clname                   ! file name 
     1239      CHARACTER(len=256)            ::   clsuff                   ! suffix name 
    12261240      CHARACTER(len=1)              ::   cl1                      ! 1 character 
    12271241      CHARACTER(len=6)              ::   clon,clat                ! name of longitude, latitude 
     
    12691283               ENDIF 
    12701284               clname = TRIM(ADJUSTL(clat))//TRIM(ADJUSTL(clon)) 
    1271                CALL iom_set_domain_attr(TRIM(clname)//cl1, zoom_ibegin= ix, zoom_jbegin= iy) 
    1272                CALL iom_set_file_attr(TRIM(clname)//cl1, name_suffix= '_'//TRIM(clname)) 
     1285               CALL iom_set_domain_attr (TRIM(clname)//cl1, zoom_ibegin= ix, zoom_jbegin= iy) 
     1286               CALL iom_get_file_attr   (TRIM(clname)//cl1, name_suffix = clsuff                         ) 
     1287               CALL iom_set_file_attr   (TRIM(clname)//cl1, name_suffix = TRIM(clsuff)//'_'//TRIM(clname)) 
     1288               CALL iom_update_file_name(TRIM(clname)//cl1) 
    12731289            END DO 
    12741290         END DO 
     
    12771293   END SUBROUTINE set_mooring 
    12781294 
     1295    
     1296   SUBROUTINE iom_update_file_name( cdid ) 
     1297      !!---------------------------------------------------------------------- 
     1298      !!                     ***  ROUTINE iom_update_file_name  *** 
     1299      !! 
     1300      !! ** Purpose :    
     1301      !! 
     1302      !!---------------------------------------------------------------------- 
     1303      CHARACTER(LEN=*)          , INTENT(in) ::   cdid 
     1304      ! 
     1305      CHARACTER(LEN=256) ::   clname 
     1306      CHARACTER(LEN=20)  ::   clfreq 
     1307      CHARACTER(LEN=20)  ::   cldate 
     1308      INTEGER            ::   idx 
     1309      INTEGER            ::   jn 
     1310      INTEGER            ::   itrlen 
     1311      INTEGER            ::   iyear, imonth, iday, isec 
     1312      REAL(wp)           ::   zsec 
     1313      LOGICAL            ::   llexist 
     1314      !!---------------------------------------------------------------------- 
     1315 
     1316      DO jn = 1,2 
     1317 
     1318         IF( jn == 1 )   CALL iom_get_file_attr( cdid, name        = clname, output_freq = clfreq ) 
     1319         IF( jn == 2 )   CALL iom_get_file_attr( cdid, name_suffix = clname ) 
     1320 
     1321         IF ( TRIM(clname) /= '' ) THEN  
     1322 
     1323            idx = INDEX(clname,'@expname@') + INDEX(clname,'@EXPNAME@') 
     1324            DO WHILE ( idx /= 0 )  
     1325               clname = clname(1:idx-1)//TRIM(cexper)//clname(idx+9:LEN_TRIM(clname)) 
     1326               idx = INDEX(clname,'@expname@') + INDEX(clname,'@EXPNAME@') 
     1327            END DO 
     1328 
     1329            idx = INDEX(clname,'@freq@') + INDEX(clname,'@FREQ@') 
     1330            DO WHILE ( idx /= 0 )  
     1331               IF ( TRIM(clfreq) /= '' ) THEN 
     1332                  itrlen = LEN_TRIM(clfreq) 
     1333                  IF ( clfreq(itrlen-1:itrlen) == 'mo' ) clfreq = clfreq(1:itrlen-1) 
     1334                  clname = clname(1:idx-1)//TRIM(clfreq)//clname(idx+6:LEN_TRIM(clname)) 
     1335               ELSE 
     1336                  CALL ctl_stop('error in the name of file id '//TRIM(cdid),   & 
     1337                     & ' attribute output_freq is undefined -> cannot replace @freq@ in '//TRIM(clname) ) 
     1338               ENDIF 
     1339               idx = INDEX(clname,'@freq@') + INDEX(clname,'@FREQ@') 
     1340            END DO 
     1341 
     1342            idx = INDEX(clname,'@startdate@') + INDEX(clname,'@STARTDATE@') 
     1343            DO WHILE ( idx /= 0 )  
     1344               cldate = iom_sdate( fjulday - rdttra(1) / rday ) 
     1345               clname = clname(1:idx-1)//TRIM(cldate)//clname(idx+11:LEN_TRIM(clname)) 
     1346               idx = INDEX(clname,'@startdate@') + INDEX(clname,'@STARTDATE@') 
     1347            END DO 
     1348 
     1349            idx = INDEX(clname,'@startdatefull@') + INDEX(clname,'@STARTDATEFULL@') 
     1350            DO WHILE ( idx /= 0 )  
     1351               cldate = iom_sdate( fjulday - rdttra(1) / rday, ldfull = .TRUE. ) 
     1352               clname = clname(1:idx-1)//TRIM(cldate)//clname(idx+15:LEN_TRIM(clname)) 
     1353               idx = INDEX(clname,'@startdatefull@') + INDEX(clname,'@STARTDATEFULL@') 
     1354            END DO 
     1355 
     1356            idx = INDEX(clname,'@enddate@') + INDEX(clname,'@ENDDATE@') 
     1357            DO WHILE ( idx /= 0 )  
     1358               cldate = iom_sdate( fjulday + rdttra(1) / rday * REAL( nitend - nit000, wp ), ld24 = .TRUE. ) 
     1359               clname = clname(1:idx-1)//TRIM(cldate)//clname(idx+9:LEN_TRIM(clname)) 
     1360               idx = INDEX(clname,'@enddate@') + INDEX(clname,'@ENDDATE@') 
     1361            END DO 
     1362 
     1363            idx = INDEX(clname,'@enddatefull@') + INDEX(clname,'@ENDDATEFULL@') 
     1364            DO WHILE ( idx /= 0 )  
     1365               cldate = iom_sdate( fjulday + rdttra(1) / rday * REAL( nitend - nit000, wp ), ld24 = .TRUE., ldfull = .TRUE. ) 
     1366               clname = clname(1:idx-1)//TRIM(cldate)//clname(idx+13:LEN_TRIM(clname)) 
     1367               idx = INDEX(clname,'@enddatefull@') + INDEX(clname,'@ENDDATEFULL@') 
     1368            END DO 
     1369 
     1370            IF( jn == 1 )   CALL iom_set_file_attr( cdid, name        = clname ) 
     1371            IF( jn == 2 )   CALL iom_set_file_attr( cdid, name_suffix = clname ) 
     1372 
     1373         ENDIF 
     1374 
     1375      END DO 
     1376 
     1377   END SUBROUTINE iom_update_file_name 
     1378 
     1379 
     1380   FUNCTION iom_sdate( pjday, ld24, ldfull ) 
     1381      !!---------------------------------------------------------------------- 
     1382      !!                     ***  ROUTINE iom_sdate  *** 
     1383      !! 
     1384      !! ** Purpose :   send back the date corresponding to the given julian day 
     1385      !! 
     1386      !!---------------------------------------------------------------------- 
     1387      REAL(wp), INTENT(in   )           ::   pjday         ! julian day 
     1388      LOGICAL , INTENT(in   ), OPTIONAL ::   ld24          ! true to force 24:00 instead of 00:00 
     1389      LOGICAL , INTENT(in   ), OPTIONAL ::   ldfull        ! true to get the compleate date: yyyymmdd_hh:mm:ss 
     1390      ! 
     1391      CHARACTER(LEN=20) ::   iom_sdate 
     1392      CHARACTER(LEN=50) ::   clfmt                         !  format used to write the date  
     1393      INTEGER           ::   iyear, imonth, iday, ihour, iminute, isec 
     1394      REAL(wp)          ::   zsec 
     1395      LOGICAL           ::   ll24, llfull 
     1396      ! 
     1397      IF( PRESENT(ld24) ) THEN   ;   ll24 = ld24 
     1398      ELSE                       ;   ll24 = .FALSE. 
     1399      ENDIF 
     1400 
     1401      IF( PRESENT(ldfull) ) THEN   ;   llfull = ldfull 
     1402      ELSE                         ;   llfull = .FALSE. 
     1403      ENDIF 
     1404 
     1405      CALL ju2ymds( pjday, iyear, imonth, iday, zsec ) 
     1406      isec = NINT(zsec) 
     1407 
     1408      IF ( ll24 .AND. isec == 0 ) THEN   ! 00:00 of the next day -> move to 24:00 of the current day 
     1409         CALL ju2ymds( pjday - 1., iyear, imonth, iday, zsec ) 
     1410         isec = 86400 
     1411      ENDIF 
     1412 
     1413      IF( iyear < 10000 ) THEN   ;   clfmt = "i4.4,2i2.2"                ! format used to write the date  
     1414      ELSE                       ;   WRITE(clfmt, "('i',i1,',2i2.2')") INT(LOG10(REAL(iyear,wp))) + 1 
     1415      ENDIF 
     1416       
     1417      IF( llfull ) THEN  
     1418         clfmt = TRIM(clfmt)//",'_',i2.2,':',i2.2,':',i2.2" 
     1419         ihour   = isec / 3600 
     1420         isec    = MOD(isec, 3600) 
     1421         iminute = isec / 60 
     1422         isec    = MOD(isec, 60) 
     1423         WRITE(iom_sdate, '('//TRIM(clfmt)//')') iyear, imonth, iday, ihour, iminute, isec    ! date of the end of run 
     1424      ELSE 
     1425         WRITE(iom_sdate, '('//TRIM(clfmt)//')') iyear, imonth, iday                          ! date of the end of run 
     1426      ENDIF 
     1427 
     1428   END FUNCTION iom_sdate 
     1429 
    12791430#else 
    12801431 
     
    12851436 
    12861437#endif 
    1287  
    1288    FUNCTION i2str(int) 
    1289    IMPLICIT NONE 
    1290       INTEGER, INTENT(IN) :: int 
    1291       CHARACTER(LEN=255) :: i2str 
    1292  
    1293       WRITE(i2str,*) int 
    1294        
    1295    END FUNCTION i2str   
    12961438    
    12971439   !!====================================================================== 
  • branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/LBC/lbclnk.F90

    r3768 r4276  
    283283   END SUBROUTINE lbc_lnk_3d 
    284284 
    285    SUBROUTINE lbc_bdy_lnk_3d( pt3d, cd_type, psgn, ib_bdy ) 
    286       !!--------------------------------------------------------------------- 
    287       !!                  ***  ROUTINE lbc_bdy_lnk  *** 
    288       !! 
    289       !! ** Purpose :   wrapper rountine to 'lbc_lnk_3d'. This wrapper is used 
    290       !!                to maintain the same interface with regards to the mpp case 
    291       !! 
    292       !!---------------------------------------------------------------------- 
    293       CHARACTER(len=1)                , INTENT(in   )           ::   cd_type   ! nature of pt3d grid-points 
    294       REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(inout)           ::   pt3d      ! 3D array on which the lbc is applied 
    295       REAL(wp)                        , INTENT(in   )           ::   psgn      ! control of the sign  
    296       INTEGER                                                   ::   ib_bdy    ! BDY boundary set 
    297       !! 
    298       CALL lbc_lnk_3d( pt3d, cd_type, psgn) 
    299  
    300    END SUBROUTINE lbc_bdy_lnk_3d 
    301  
    302    SUBROUTINE lbc_bdy_lnk_2d( pt2d, cd_type, psgn, ib_bdy ) 
    303       !!--------------------------------------------------------------------- 
    304       !!                  ***  ROUTINE lbc_bdy_lnk  *** 
    305       !! 
    306       !! ** Purpose :   wrapper rountine to 'lbc_lnk_3d'. This wrapper is used 
    307       !!                to maintain the same interface with regards to the mpp case 
    308       !! 
    309       !!---------------------------------------------------------------------- 
    310       CHARACTER(len=1)                , INTENT(in   )           ::   cd_type   ! nature of pt3d grid-points 
    311       REAL(wp), DIMENSION(jpi,jpj),     INTENT(inout)           ::   pt2d      ! 3D array on which the lbc is applied 
    312       REAL(wp)                        , INTENT(in   )           ::   psgn      ! control of the sign  
    313       INTEGER                                                   ::   ib_bdy    ! BDY boundary set 
    314       !! 
    315       CALL lbc_lnk_2d( pt2d, cd_type, psgn) 
    316  
    317    END SUBROUTINE lbc_bdy_lnk_2d 
    318  
    319285   SUBROUTINE lbc_lnk_2d( pt2d, cd_type, psgn, cd_mpp, pval ) 
    320286      !!--------------------------------------------------------------------- 
     
    406372   END SUBROUTINE lbc_lnk_2d 
    407373 
     374#endif 
     375 
     376 
     377   SUBROUTINE lbc_bdy_lnk_3d( pt3d, cd_type, psgn, ib_bdy ) 
     378      !!--------------------------------------------------------------------- 
     379      !!                  ***  ROUTINE lbc_bdy_lnk  *** 
     380      !! 
     381      !! ** Purpose :   wrapper rountine to 'lbc_lnk_3d'. This wrapper is used 
     382      !!                to maintain the same interface with regards to the mpp 
     383      !case 
     384      !! 
     385      !!---------------------------------------------------------------------- 
     386      CHARACTER(len=1)                , INTENT(in   )           ::   cd_type   ! nature of pt3d grid-points 
     387      REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(inout)           ::   pt3d      ! 3D array on which the lbc is applied 
     388      REAL(wp)                        , INTENT(in   )           ::   psgn      ! control of the sign  
     389      INTEGER                                                   ::   ib_bdy    ! BDY boundary set 
     390      !! 
     391      CALL lbc_lnk_3d( pt3d, cd_type, psgn) 
     392 
     393   END SUBROUTINE lbc_bdy_lnk_3d 
     394 
     395   SUBROUTINE lbc_bdy_lnk_2d( pt2d, cd_type, psgn, ib_bdy ) 
     396      !!--------------------------------------------------------------------- 
     397      !!                  ***  ROUTINE lbc_bdy_lnk  *** 
     398      !! 
     399      !! ** Purpose :   wrapper rountine to 'lbc_lnk_3d'. This wrapper is used 
     400      !!                to maintain the same interface with regards to the mpp 
     401      !case 
     402      !! 
     403      !!---------------------------------------------------------------------- 
     404      CHARACTER(len=1)                , INTENT(in   )           ::   cd_type   ! nature of pt3d grid-points 
     405      REAL(wp), DIMENSION(jpi,jpj),     INTENT(inout)           ::   pt2d      ! 3D array on which the lbc is applied 
     406      REAL(wp)                        , INTENT(in   )           ::   psgn      ! control of the sign  
     407      INTEGER                                                   ::   ib_bdy    ! BDY boundary set 
     408      !! 
     409      CALL lbc_lnk_2d( pt2d, cd_type, psgn) 
     410 
     411   END SUBROUTINE lbc_bdy_lnk_2d 
     412 
     413 
    408414   SUBROUTINE lbc_lnk_2d_e( pt2d, cd_type, psgn, jpri, jprj ) 
    409415      !!--------------------------------------------------------------------- 
     
    430436   END SUBROUTINE lbc_lnk_2d_e 
    431437 
    432 # endif 
    433438#endif 
    434439 
  • branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/LBC/lib_mpp.F90

    r3799 r4276  
    162162 
    163163   ! Arrays used in mpp_lbc_north_3d() 
    164    REAL(wp), DIMENSION(:,:,:)  , ALLOCATABLE, SAVE   ::   ztab, znorthloc 
    165    REAL(wp), DIMENSION(:,:,:,:), ALLOCATABLE, SAVE   ::   znorthgloio 
    166    REAL(wp), DIMENSION(:,:,:)  , ALLOCATABLE, SAVE   ::   zfoldwk      ! Workspace for message transfers avoiding mpi_allgather 
     164   REAL(wp), DIMENSION(:,:,:)  , ALLOCATABLE, SAVE   ::   tab_3d, xnorthloc 
     165   REAL(wp), DIMENSION(:,:,:,:), ALLOCATABLE, SAVE   ::   xnorthgloio 
     166   REAL(wp), DIMENSION(:,:,:)  , ALLOCATABLE, SAVE   ::   foldwk      ! Workspace for message transfers avoiding mpi_allgather 
    167167 
    168168   ! Arrays used in mpp_lbc_north_2d() 
    169    REAL(wp), DIMENSION(:,:)  , ALLOCATABLE, SAVE    ::   ztab_2d, znorthloc_2d 
    170    REAL(wp), DIMENSION(:,:,:), ALLOCATABLE, SAVE    ::   znorthgloio_2d 
    171    REAL(wp), DIMENSION(:,:)  , ALLOCATABLE, SAVE    ::   zfoldwk_2d    ! Workspace for message transfers avoiding mpi_allgather 
     169   REAL(wp), DIMENSION(:,:)  , ALLOCATABLE, SAVE    ::   tab_2d, xnorthloc_2d 
     170   REAL(wp), DIMENSION(:,:,:), ALLOCATABLE, SAVE    ::   xnorthgloio_2d 
     171   REAL(wp), DIMENSION(:,:)  , ALLOCATABLE, SAVE    ::   foldwk_2d    ! Workspace for message transfers avoiding mpi_allgather 
    172172 
    173173   ! Arrays used in mpp_lbc_north_e() 
    174    REAL(wp), DIMENSION(:,:)  , ALLOCATABLE, SAVE    ::   ztab_e, znorthloc_e 
    175    REAL(wp), DIMENSION(:,:,:), ALLOCATABLE, SAVE    ::   znorthgloio_e 
     174   REAL(wp), DIMENSION(:,:)  , ALLOCATABLE, SAVE    ::   tab_e, xnorthloc_e 
     175   REAL(wp), DIMENSION(:,:,:), ALLOCATABLE, SAVE    ::   xnorthgloio_e 
    176176 
    177177   ! North fold arrays used to minimise the use of allgather operations. Set in nemo_northcomms (nemogcm) so need to be public 
     
    207207         &      t2p1(jpi,jprecj    ,2)   , t2p2(jpi,jprecj    ,2)   ,                                            & 
    208208         ! 
    209          &      ztab(jpiglo,4,jpk) , znorthloc(jpi,4,jpk) , znorthgloio(jpi,4,jpk,jpni) ,                        & 
    210          &      zfoldwk(jpi,4,jpk) ,                                                                             & 
    211          ! 
    212          &      ztab_2d(jpiglo,4)  , znorthloc_2d(jpi,4)  , znorthgloio_2d(jpi,4,jpni)  ,                        & 
    213          &      zfoldwk_2d(jpi,4)  ,                                                                             & 
    214          ! 
    215          &      ztab_e(jpiglo,4+2*jpr2dj) , znorthloc_e(jpi,4+2*jpr2dj) , znorthgloio_e(jpi,4+2*jpr2dj,jpni) ,   & 
     209         &      tab_3d(jpiglo,4,jpk) , xnorthloc(jpi,4,jpk) , xnorthgloio(jpi,4,jpk,jpni) ,                        & 
     210         &      foldwk(jpi,4,jpk) ,                                                                             & 
     211         ! 
     212         &      tab_2d(jpiglo,4)  , xnorthloc_2d(jpi,4)  , xnorthgloio_2d(jpi,4,jpni)  ,                        & 
     213         &      foldwk_2d(jpi,4)  ,                                                                             & 
     214         ! 
     215         &      tab_e(jpiglo,4+2*jpr2dj) , xnorthloc_e(jpi,4+2*jpr2dj) , xnorthgloio_e(jpi,4+2*jpr2dj,jpni) ,   & 
    216216         ! 
    217217         &      STAT=lib_mpp_alloc ) 
     
    21792179!!gm Remark : this is very time consumming!!! 
    21802180      !                                         ! ------------------------ ! 
    2181             IF( ijpt0 > ijpt1 .OR. iipt0 > iipt1 ) THEN 
     2181        IF(((nbondi .ne. 0) .AND. (ktype .eq. 2)) .OR. ((nbondj .ne. 0) .AND. (ktype .eq. 1))) THEN 
    21822182            ! there is nothing to be migrated 
    2183                lmigr = .FALSE. 
     2183              lmigr = .TRUE. 
    21842184            ELSE 
    2185               lmigr = .TRUE. 
     2185              lmigr = .FALSE. 
    21862186            ENDIF 
    21872187 
     
    25982598      ityp = -1 
    25992599      ijpjm1 = 3 
    2600       ztab(:,:,:) = 0.e0 
    2601       ! 
    2602       DO jj = nlcj - ijpj +1, nlcj          ! put in znorthloc the last 4 jlines of pt3d 
     2600      tab_3d(:,:,:) = 0.e0 
     2601      ! 
     2602      DO jj = nlcj - ijpj +1, nlcj          ! put in xnorthloc the last 4 jlines of pt3d 
    26032603         ij = jj - nlcj + ijpj 
    2604          znorthloc(:,ij,:) = pt3d(:,jj,:) 
     2604         xnorthloc(:,ij,:) = pt3d(:,jj,:) 
    26052605      END DO 
    26062606      ! 
    2607       !                                     ! Build in procs of ncomm_north the znorthgloio 
     2607      !                                     ! Build in procs of ncomm_north the xnorthgloio 
    26082608      itaille = jpi * jpk * ijpj 
    26092609      IF ( l_north_nogather ) THEN 
     
    26152615            ij = jj - nlcj + ijpj 
    26162616            DO ji = 1, nlci 
    2617                ztab(ji+nimpp-1,ij,:) = pt3d(ji,jj,:) 
     2617               tab_3d(ji+nimpp-1,ij,:) = pt3d(ji,jj,:) 
    26182618            END DO 
    26192619         END DO 
     
    26402640 
    26412641            DO jr = 1,nsndto(ityp) 
    2642                CALL mppsend(5, znorthloc, itaille, isendto(jr,ityp), ml_req_nf(jr) ) 
     2642               CALL mppsend(5, xnorthloc, itaille, isendto(jr,ityp), ml_req_nf(jr) ) 
    26432643            END DO 
    26442644            DO jr = 1,nsndto(ityp) 
    2645                CALL mpprecv(5, zfoldwk, itaille, isendto(jr,ityp)) 
     2645               CALL mpprecv(5, foldwk, itaille, isendto(jr,ityp)) 
    26462646               iproc = isendto(jr,ityp) + 1 
    26472647               ildi = nldit (iproc) 
     
    26502650               DO jj = 1, ijpj 
    26512651                  DO ji = ildi, ilei 
    2652                      ztab(ji+iilb-1,jj,:) = zfoldwk(ji,jj,:) 
     2652                     tab_3d(ji+iilb-1,jj,:) = foldwk(ji,jj,:) 
    26532653                  END DO 
    26542654               END DO 
     
    26652665 
    26662666      IF ( ityp .lt. 0 ) THEN 
    2667          CALL MPI_ALLGATHER( znorthloc  , itaille, MPI_DOUBLE_PRECISION,                & 
    2668             &                znorthgloio, itaille, MPI_DOUBLE_PRECISION, ncomm_north, ierr ) 
     2667         CALL MPI_ALLGATHER( xnorthloc  , itaille, MPI_DOUBLE_PRECISION,                & 
     2668            &                xnorthgloio, itaille, MPI_DOUBLE_PRECISION, ncomm_north, ierr ) 
    26692669         ! 
    26702670         DO jr = 1, ndim_rank_north         ! recover the global north array 
     
    26752675            DO jj = 1, ijpj 
    26762676               DO ji = ildi, ilei 
    2677                   ztab(ji+iilb-1,jj,:) = znorthgloio(ji,jj,:,jr) 
     2677                  tab_3d(ji+iilb-1,jj,:) = xnorthgloio(ji,jj,:,jr) 
    26782678               END DO 
    26792679            END DO 
     
    26812681      ENDIF 
    26822682      ! 
    2683       ! The ztab array has been either: 
     2683      ! The tab_3d array has been either: 
    26842684      !  a. Fully populated by the mpi_allgather operation or 
    26852685      !  b. Had the active points for this domain and northern neighbours populated 
     
    26882688      ! this domain will be identical. 
    26892689      ! 
    2690       CALL lbc_nfd( ztab, cd_type, psgn )   ! North fold boundary condition 
     2690      CALL lbc_nfd( tab_3d, cd_type, psgn )   ! North fold boundary condition 
    26912691      ! 
    26922692      DO jj = nlcj-ijpj+1, nlcj             ! Scatter back to pt3d 
    26932693         ij = jj - nlcj + ijpj 
    26942694         DO ji= 1, nlci 
    2695             pt3d(ji,jj,:) = ztab(ji+nimpp-1,ij,:) 
     2695            pt3d(ji,jj,:) = tab_3d(ji+nimpp-1,ij,:) 
    26962696         END DO 
    26972697      END DO 
     
    27302730      ityp = -1 
    27312731      ijpjm1 = 3 
    2732       ztab_2d(:,:) = 0.e0 
    2733       ! 
    2734       DO jj = nlcj-ijpj+1, nlcj             ! put in znorthloc_2d the last 4 jlines of pt2d 
     2732      tab_2d(:,:) = 0.e0 
     2733      ! 
     2734      DO jj = nlcj-ijpj+1, nlcj             ! put in xnorthloc_2d the last 4 jlines of pt2d 
    27352735         ij = jj - nlcj + ijpj 
    2736          znorthloc_2d(:,ij) = pt2d(:,jj) 
     2736         xnorthloc_2d(:,ij) = pt2d(:,jj) 
    27372737      END DO 
    27382738 
    2739       !                                     ! Build in procs of ncomm_north the znorthgloio_2d 
     2739      !                                     ! Build in procs of ncomm_north the xnorthgloio_2d 
    27402740      itaille = jpi * ijpj 
    27412741      IF ( l_north_nogather ) THEN 
     
    27472747            ij = jj - nlcj + ijpj 
    27482748            DO ji = 1, nlci 
    2749                ztab_2d(ji+nimpp-1,ij) = pt2d(ji,jj) 
     2749               tab_2d(ji+nimpp-1,ij) = pt2d(ji,jj) 
    27502750            END DO 
    27512751         END DO 
     
    27732773 
    27742774            DO jr = 1,nsndto(ityp) 
    2775                CALL mppsend(5, znorthloc_2d, itaille, isendto(jr,ityp), ml_req_nf(jr) ) 
     2775               CALL mppsend(5, xnorthloc_2d, itaille, isendto(jr,ityp), ml_req_nf(jr) ) 
    27762776            END DO 
    27772777            DO jr = 1,nsndto(ityp) 
    2778                CALL mpprecv(5, zfoldwk_2d, itaille, isendto(jr,ityp)) 
     2778               CALL mpprecv(5, foldwk_2d, itaille, isendto(jr,ityp)) 
    27792779               iproc = isendto(jr,ityp) + 1 
    27802780               ildi = nldit (iproc) 
     
    27832783               DO jj = 1, ijpj 
    27842784                  DO ji = ildi, ilei 
    2785                      ztab_2d(ji+iilb-1,jj) = zfoldwk_2d(ji,jj) 
     2785                     tab_2d(ji+iilb-1,jj) = foldwk_2d(ji,jj) 
    27862786                  END DO 
    27872787               END DO 
     
    27982798 
    27992799      IF ( ityp .lt. 0 ) THEN 
    2800          CALL MPI_ALLGATHER( znorthloc_2d  , itaille, MPI_DOUBLE_PRECISION,        & 
    2801             &                znorthgloio_2d, itaille, MPI_DOUBLE_PRECISION, ncomm_north, ierr ) 
     2800         CALL MPI_ALLGATHER( xnorthloc_2d  , itaille, MPI_DOUBLE_PRECISION,        & 
     2801            &                xnorthgloio_2d, itaille, MPI_DOUBLE_PRECISION, ncomm_north, ierr ) 
    28022802         ! 
    28032803         DO jr = 1, ndim_rank_north            ! recover the global north array 
     
    28082808            DO jj = 1, ijpj 
    28092809               DO ji = ildi, ilei 
    2810                   ztab_2d(ji+iilb-1,jj) = znorthgloio_2d(ji,jj,jr) 
     2810                  tab_2d(ji+iilb-1,jj) = xnorthgloio_2d(ji,jj,jr) 
    28112811               END DO 
    28122812            END DO 
     
    28142814      ENDIF 
    28152815      ! 
    2816       ! The ztab array has been either: 
     2816      ! The tab array has been either: 
    28172817      !  a. Fully populated by the mpi_allgather operation or 
    28182818      !  b. Had the active points for this domain and northern neighbours populated 
     
    28212821      ! this domain will be identical. 
    28222822      ! 
    2823       CALL lbc_nfd( ztab_2d, cd_type, psgn )   ! North fold boundary condition 
     2823      CALL lbc_nfd( tab_2d, cd_type, psgn )   ! North fold boundary condition 
    28242824      ! 
    28252825      ! 
     
    28272827         ij = jj - nlcj + ijpj 
    28282828         DO ji = 1, nlci 
    2829             pt2d(ji,jj) = ztab_2d(ji+nimpp-1,ij) 
     2829            pt2d(ji,jj) = tab_2d(ji+nimpp-1,ij) 
    28302830         END DO 
    28312831      END DO 
     
    28602860      ! 
    28612861      ijpj=4 
    2862       ztab_e(:,:) = 0.e0 
     2862      tab_e(:,:) = 0.e0 
    28632863 
    28642864      ij=0 
    2865       ! put in znorthloc_e the last 4 jlines of pt2d 
     2865      ! put in xnorthloc_e the last 4 jlines of pt2d 
    28662866      DO jj = nlcj - ijpj + 1 - jpr2dj, nlcj +jpr2dj 
    28672867         ij = ij + 1 
    28682868         DO ji = 1, jpi 
    2869             znorthloc_e(ji,ij)=pt2d(ji,jj) 
     2869            xnorthloc_e(ji,ij)=pt2d(ji,jj) 
    28702870         END DO 
    28712871      END DO 
    28722872      ! 
    28732873      itaille = jpi * ( ijpj + 2 * jpr2dj ) 
    2874       CALL MPI_ALLGATHER( znorthloc_e(1,1)  , itaille, MPI_DOUBLE_PRECISION,    & 
    2875          &                znorthgloio_e(1,1,1), itaille, MPI_DOUBLE_PRECISION, ncomm_north, ierr ) 
     2874      CALL MPI_ALLGATHER( xnorthloc_e(1,1)  , itaille, MPI_DOUBLE_PRECISION,    & 
     2875         &                xnorthgloio_e(1,1,1), itaille, MPI_DOUBLE_PRECISION, ncomm_north, ierr ) 
    28762876      ! 
    28772877      DO jr = 1, ndim_rank_north            ! recover the global north array 
     
    28822882         DO jj = 1, ijpj+2*jpr2dj 
    28832883            DO ji = ildi, ilei 
    2884                ztab_e(ji+iilb-1,jj) = znorthgloio_e(ji,jj,jr) 
     2884               tab_e(ji+iilb-1,jj) = xnorthgloio_e(ji,jj,jr) 
    28852885            END DO 
    28862886         END DO 
     
    28902890      ! 2. North-Fold boundary conditions 
    28912891      ! ---------------------------------- 
    2892       CALL lbc_nfd( ztab_e(:,:), cd_type, psgn, pr2dj = jpr2dj ) 
     2892      CALL lbc_nfd( tab_e(:,:), cd_type, psgn, pr2dj = jpr2dj ) 
    28932893 
    28942894      ij = jpr2dj 
     
    28972897      ij  = ij +1 
    28982898         DO ji= 1, nlci 
    2899             pt2d(ji,jj) = ztab_e(ji+nimpp-1,ij) 
     2899            pt2d(ji,jj) = tab_e(ji+nimpp-1,ij) 
    29002900         END DO 
    29012901      END DO 
  • branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/LBC/mppini_2.h90

    r3818 r4276  
    122122      irestj = 1 + MOD( jpjglo - nrecj -1 , jpnj ) 
    123123 
     124#if defined key_nemocice_decomp 
     125      ! Change padding to be consistent with CICE 
     126      ilci(1:jpni-1      ,:) = jpi 
     127      ilci(jpni          ,:) = jpiglo - (jpni - 1) * (jpi - nreci) 
     128 
     129      ilcj(:,      1:jpnj-1) = jpj 
     130      ilcj(:,          jpnj) = jpjglo - (jpnj - 1) * (jpj - nrecj) 
     131#else 
    124132      ilci(1:iresti      ,:) = jpi 
    125133      ilci(iresti+1:jpni ,:) = jpi-1 
     
    127135      ilcj(:,      1:irestj) = jpj 
    128136      ilcj(:, irestj+1:jpnj) = jpj-1 
     137#endif 
    129138 
    130139      IF(lwp) WRITE(numout,*) 
  • branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/SBC/geo2ocean.F90

    r2715 r4276  
    187187         &      gsinf(jpi,jpj), gcosf(jpi,jpj), STAT=ierr ) 
    188188      IF(lk_mpp)   CALL mpp_sum( ierr ) 
    189       IF( ierr /= 0 )   CALL ctl_stop('STOP', 'angle_msh_geo: unable to allocate arrays' ) 
     189      IF( ierr /= 0 )   CALL ctl_stop('angle: unable to allocate arrays' ) 
    190190 
    191191      ! ============================= ! 
     
    361361            &      gsinlat(jpi,jpj,4) , gcoslat(jpi,jpj,4) , STAT=ierr ) 
    362362         IF( lk_mpp    )   CALL mpp_sum( ierr ) 
    363          IF( ierr /= 0 )   CALL ctl_stop('STOP', 'angle_msh_geo: unable to allocate arrays' ) 
     363         IF( ierr /= 0 )   CALL ctl_stop('geo2oce: unable to allocate arrays' ) 
    364364      ENDIF 
    365365 
     
    438438      !!---------------------------------------------------------------------- 
    439439 
    440       IF( ALLOCATED( gsinlon ) ) THEN 
     440      IF( .NOT. ALLOCATED( gsinlon ) ) THEN 
    441441         ALLOCATE( gsinlon(jpi,jpj,4) , gcoslon(jpi,jpj,4) ,   & 
    442442            &      gsinlat(jpi,jpj,4) , gcoslat(jpi,jpj,4) , STAT=ierr ) 
    443443         IF( lk_mpp    )   CALL mpp_sum( ierr ) 
    444          IF( ierr /= 0 )   CALL ctl_stop('STOP', 'angle_msh_geo: unable to allocate arrays' ) 
     444         IF( ierr /= 0 )   CALL ctl_stop('oce2geo: unable to allocate arrays' ) 
    445445      ENDIF 
    446446 
  • branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/SBC/sbc_oce.F90

    r4275 r4276  
    7272   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   sfx    , sfx_b    !: salt flux                                    [PSU/m2/s] 
    7373   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   emp_tot           !: total E-P over ocean and ice                 [Kg/m2/s] 
     74   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   fmmflx            !: freshwater budget: freezing/melting          [Kg/m2/s] 
    7475   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   rnf    , rnf_b    !: river runoff   [Kg/m2/s]   
    7576   !! 
     
    117118         &      qsr_tot(jpi,jpj) , qsr  (jpi,jpj) ,                        & 
    118119         &      emp    (jpi,jpj) , emp_b(jpi,jpj) ,                        & 
    119          &      sfx    (jpi,jpj) , sfx_b(jpi,jpj) , emp_tot(jpi,jpj) , STAT=ierr(2) ) 
     120         &      sfx    (jpi,jpj) , sfx_b(jpi,jpj) , emp_tot(jpi,jpj), fmmflx(jpi,jpj), STAT=ierr(2) ) 
    120121         ! 
    121122      ALLOCATE( rnf  (jpi,jpj) , sbc_tsc  (jpi,jpj,jpts) , qsr_hc  (jpi,jpj,jpk) ,     & 
  • branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/SBC/sbccpl.F90

    r3680 r4276  
    407407      SELECT CASE( TRIM( sn_rcv_emp%cldes ) ) 
    408408      CASE( 'oce only'      )   ;   srcv(                                 jpr_oemp   )%laction = .TRUE.  
    409       CASE( 'conservative'  )   ;   srcv( (/jpr_rain, jpr_snow, jpr_ievp, jpr_tevp/) )%laction = .TRUE. 
     409      CASE( 'conservative'  ) 
     410         srcv( (/jpr_rain, jpr_snow, jpr_ievp, jpr_tevp/) )%laction = .TRUE. 
     411         IF ( k_ice <= 1 )  srcv(jpr_ivep)%laction = .FALSE. 
    410412      CASE( 'oce and ice'   )   ;   srcv( (/jpr_ievp, jpr_sbpr, jpr_semp, jpr_oemp/) )%laction = .TRUE. 
    411413      CASE default              ;   CALL ctl_stop( 'sbc_cpl_init: wrong definition of sn_rcv_emp%cldes' ) 
     
    465467         CALL ctl_stop( 'sbc_cpl_init: namsbc_cpl namelist mismatch between sn_rcv_qns%cldes and sn_rcv_dqnsdt%cldes' ) 
    466468      !                                                      ! ------------------------- ! 
    467       !                                                      !    Ice Qsr penetration    !    
    468       !                                                      ! ------------------------- ! 
    469       ! fraction of net shortwave radiation which is not absorbed in the thin surface layer  
    470       ! and penetrates inside the ice cover ( Maykut and Untersteiner, 1971 ; Elbert anbd Curry, 1993 ) 
    471       ! Coupled case: since cloud cover is not received from atmosphere  
    472       !               ===> defined as constant value -> definition done in sbc_cpl_init 
    473       fr1_i0(:,:) = 0.18 
    474       fr2_i0(:,:) = 0.82 
    475       !                                                      ! ------------------------- ! 
    476469      !                                                      !      10m wind module      !    
    477470      !                                                      ! ------------------------- ! 
     
    508501      ! Allocate taum part of frcv which is used even when not received as coupling field 
    509502      IF ( .NOT. srcv(jpr_taum)%laction ) ALLOCATE( frcv(jpr_taum)%z3(jpi,jpj,srcv(jn)%nct) ) 
     503      ! Allocate itx1 and ity1 as they are used in sbc_cpl_ice_tau even if srcv(jpr_itx1)%laction = .FALSE. 
     504      IF( k_ice /= 0 ) THEN 
     505         IF ( .NOT. srcv(jpr_itx1)%laction ) ALLOCATE( frcv(jpr_itx1)%z3(jpi,jpj,srcv(jn)%nct) ) 
     506         IF ( .NOT. srcv(jpr_ity1)%laction ) ALLOCATE( frcv(jpr_ity1)%z3(jpi,jpj,srcv(jn)%nct) ) 
     507      END IF 
    510508 
    511509      ! ================================ ! 
     
    911909      !!                 third  as  2 components on the cp_ice_msh point  
    912910      !! 
    913       !!                In 'oce and ice' case, only one vector stress field  
     911      !!                Except in 'oce and ice' case, only one vector stress field  
    914912      !!             is received. It has already been processed in sbc_cpl_rcv 
    915913      !!             so that it is now defined as (i,j) components given at U- 
    916       !!             and V-points, respectively. Therefore, here only the third 
     914      !!             and V-points, respectively. Therefore, only the third 
    917915      !!             transformation is done and only if the ice-grid is a 'I'-grid.  
    918916      !! 
     
    13291327      END SELECT 
    13301328 
     1329      !    Ice Qsr penetration used (only?)in lim2 or lim3  
     1330      ! fraction of net shortwave radiation which is not absorbed in the thin surface layer  
     1331      ! and penetrates inside the ice cover ( Maykut and Untersteiner, 1971 ; Elbert anbd Curry, 1993 ) 
     1332      ! Coupled case: since cloud cover is not received from atmosphere  
     1333      !               ===> defined as constant value -> definition done in sbc_cpl_init 
     1334      fr1_i0(:,:) = 0.18 
     1335      fr2_i0(:,:) = 0.82 
     1336 
     1337 
    13311338      CALL wrk_dealloc( jpi,jpj, zcptn, ztmp, zicefr ) 
    13321339      ! 
  • branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/SBC/sbcmod.F90

    r3764 r4276  
    146146      sfx(:,:) = 0.0_wp                            ! the salt flux due to freezing/melting will be computed (i.e. will be non-zero)  
    147147                                                   ! only if sea-ice is present 
     148  
     149      fmmflx(:,:) = 0.0_wp                        ! freezing-melting array initialisation 
    148150 
    149151      !                                            ! restartability    
     
    218220         IF( nsbc ==  6 )   WRITE(numout,*) '              MFS Bulk formulation' 
    219221      ENDIF 
     222      ! 
     223                          CALL sbc_ssm_init               ! Sea-surface mean fields initialisation 
    220224      ! 
    221225      IF( ln_ssr      )   CALL sbc_ssr_init               ! Sea-Surface Restoring initialisation 
     
    362366                                                                ! (includes virtual salt flux beneath ice  
    363367                                                                ! in linear free surface case) 
     368         CALL iom_put( "fmmflx", fmmflx  )                      ! Freezing-melting water flux 
    364369         CALL iom_put( "qt"    , qns  + qsr )                   ! total heat flux  
    365370         CALL iom_put( "qns"   , qns        )                   ! solar heat flux 
  • branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/SOL/solmat.F90

    r3609 r4276  
    3030   USE lbclnk          ! lateral boudary conditions 
    3131   USE lib_mpp         ! distributed memory computing 
     32   USE c1d               ! 1D vertical configuration 
    3233   USE in_out_manager  ! I/O manager 
    3334   USE timing          ! timing 
     
    271272       
    272273      ! SOR and PCG solvers 
     274      IF( lk_c1d ) CALL lbc_lnk( gcdmat, 'T', 1._wp ) ! 1D case bmask =/0  but gcdmat not define everywhere  
    273275      DO jj = 1, jpj 
    274276         DO ji = 1, jpi 
  • branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/TRA/eosbn2.F90

    r3625 r4276  
    675675 
    676676 
    677    FUNCTION tfreez( psal ) RESULT( ptf ) 
     677   FUNCTION tfreez( psal, pdep ) RESULT( ptf ) 
    678678      !!---------------------------------------------------------------------- 
    679679      !!                 ***  ROUTINE eos_init  *** 
     
    688688      !!---------------------------------------------------------------------- 
    689689      REAL(wp), DIMENSION(jpi,jpj), INTENT(in   ) ::   psal   ! salinity             [psu] 
     690      REAL(wp), DIMENSION(jpi,jpj), INTENT(in   ), OPTIONAL ::   pdep   ! depth      [decibars] 
    690691      ! Leave result array automatic rather than making explicitly allocated 
    691692      REAL(wp), DIMENSION(jpi,jpj)                ::   ptf    ! freezing temperature [Celcius] 
     
    694695      ptf(:,:) = ( - 0.0575_wp + 1.710523e-3_wp * SQRT( psal(:,:) )   & 
    695696         &                     - 2.154996e-4_wp *       psal(:,:)   ) * psal(:,:) 
     697      IF ( PRESENT( pdep ) ) THEN    
     698         ptf(:,:) = ptf(:,:) - 7.53e-4_wp * pdep(:,:) 
     699      ENDIF 
    696700      ! 
    697701   END FUNCTION tfreez 
  • branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/step.F90

    r3769 r4276  
    271271      ! 
    272272#if defined key_iomput 
    273       IF( kstp == nitend   )   CALL xios_context_finalize() ! needed for XIOS+AGRIF 
     273      IF( kstp == nitend .OR. indic < 0 )   CALL xios_context_finalize() ! needed for XIOS+AGRIF 
    274274#endif 
    275275      ! 
  • branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/SAS_SRC/daymod.F90

    r3851 r4276  
    246246               nday_year = 1 
    247247               nsec_year = ndt05 
     248               IF( nsec1jan000 >= 2 * (2**30 - nsecd * nyear_len(1) / 2 ) ) THEN   ! test integer 4 max value 
     249                  CALL ctl_stop( 'The number of seconds between Jan. 1st 00h of nit000 year and Jan. 1st 00h ',   & 
     250                     &           'of the current year is exceeding the INTEGER 4 max VALUE: 2^31-1 -> 68.09 years in seconds', & 
     251                     & 'You must do a restart at higher frequency (or remove this STOP and recompile everything in I8)' ) 
     252               ENDIF 
    248253               nsec1jan000 = nsec1jan000 + nsecd * nyear_len(1) 
    249254               IF( nleapy == 1 )   CALL day_mth 
  • branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/SAS_SRC/diawri.F90

    r3331 r4276  
    259259         CALL histdef( nid_T, "sowaflup", "Net Upward Water Flux"              , "Kg/m2/s",   &  ! (emp-rnf) 
    260260            &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout ) 
    261          CALL histdef( nid_T, "sowaflcd", "concentration/dilution water flux"  , "kg/m2/s",   &  ! (emps-rnf) 
    262             &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout ) 
     261         CALL histdef( nid_T, "sosfldow", "downward salt flux"                 , "PSU/m2/s",  &  ! (sfx) 
     262             &         jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout ) 
    263263         CALL histdef( nid_T, "sohefldo", "Net Downward Heat Flux"             , "W/m2"   ,   &  ! qns + qsr 
    264264            &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout ) 
     
    309309      CALL histwrite( nid_T, "sst_m", it, sst_m, ndim_hT, ndex_hT )   ! sea surface temperature 
    310310      CALL histwrite( nid_T, "sss_m", it, sss_m, ndim_hT, ndex_hT )   ! sea surface salinity 
    311       CALL histwrite( nid_T, "sowaflup", it, emp   , ndim_hT, ndex_hT )   ! upward water flux 
    312       CALL histwrite( nid_T, "sowaflcd", it, emps  , ndim_hT, ndex_hT )   ! c/d water flux 
     311      CALL histwrite( nid_T, "sowaflup", it, (emp - rnf )  , ndim_hT, ndex_hT )   ! upward water flux 
     312      CALL histwrite( nid_T, "sosfldow", it, sfx           , ndim_hT, ndex_hT )   ! downward salt flux  
     313                                                                                  ! (includes virtual salt flux beneath ice  
     314                                                                                  ! in linear free surface case) 
     315 
    313316      CALL histwrite( nid_T, "sohefldo", it, qns + qsr     , ndim_hT, ndex_hT )   ! total heat flux 
    314317      CALL histwrite( nid_T, "soshfldo", it, qsr           , ndim_hT, ndex_hT )   ! solar heat flux 
  • branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/SAS_SRC/nemogcm.F90

    r3769 r4276  
    382382      USE diawri    , ONLY: dia_wri_alloc 
    383383      USE dom_oce   , ONLY: dom_oce_alloc 
    384       ! 
    385       INTEGER :: ierr 
     384      USE oce       , ONLY : sshn, sshb, snwice_mass, snwice_mass_b, snwice_fmass  
     385      ! 
     386      INTEGER :: ierr,ierr4 
    386387      !!---------------------------------------------------------------------- 
    387388      ! 
     
    389390      ierr = ierr + dom_oce_alloc   ()          ! ocean domain 
    390391      ierr = ierr + lib_mpp_alloc   (numout)    ! mpp exchanges 
     392      ALLOCATE( snwice_mass(jpi,jpj)  , snwice_mass_b(jpi,jpj),             & 
     393         &      snwice_fmass(jpi,jpj), STAT= ierr4 ) 
     394      ierr = ierr + ierr4 
    391395      ! 
    392396      IF( lk_mpp    )   CALL mpp_sum( ierr ) 
  • branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/SAS_SRC/sbcssm.F90

    r3364 r4276  
    8181       
    8282      ! 
     83      IF (kt == nn_it000 ) CALL sbc_ssm_init() 
     84 
    8385      IF( nn_timing == 1 )  CALL timing_start( 'sbc_ssm') 
    8486 
     
    100102      tsn(:,:,1,jp_tem) = sst_m(:,:) 
    101103      tsn(:,:,1,jp_sal) = sss_m(:,:) 
     104      IF ( nn_ice == 1 ) THEN 
     105         tsb(:,:,1,jp_tem) = sst_m(:,:) 
     106         tsb(:,:,1,jp_sal) = sss_m(:,:) 
     107      ENDIF 
    102108      ub (:,:,1       ) = ssu_m(:,:) 
    103109      vb (:,:,1       ) = ssv_m(:,:) 
     
    135141      TYPE(FLD_N) :: sn_usp, sn_vsp, sn_ssh 
    136142      ! 
    137       NAMELIST/namsbc_ssm/cn_dir, ln_3d_uv, sn_tem, sn_sal, sn_usp, sn_vsp, sn_ssh 
     143      NAMELIST/namsbc_sas/cn_dir, ln_3d_uv, sn_tem, sn_sal, sn_usp, sn_vsp, sn_ssh 
    138144 
    139145      !!---------------------------------------------------------------------- 
     
    151157      ! 
    152158      REWIND( numnam )                          ! read in namlist namsbc_ssm 
    153       READ  ( numnam, namsbc_ssm ) 
     159      READ  ( numnam, namsbc_sas ) 
    154160      !                                         ! store namelist information in an array 
    155161      !                                         ! Control print 
    156162      IF(lwp) THEN 
    157163         WRITE(numout,*) 
    158          WRITE(numout,*) 'sbc_ssm : standalone surface scheme ' 
     164         WRITE(numout,*) 'sbc_sas : standalone surface scheme ' 
    159165         WRITE(numout,*) '~~~~~~~~~~~ ' 
    160          WRITE(numout,*) '   Namelist namsbc_ssm' 
     166         WRITE(numout,*) '   Namelist namsbc_sas' 
    161167         WRITE(numout,*) 
    162168      ENDIF 
     
    273279      ! so allocate enough of arrays to use 
    274280      ! 
     281      ierr3 = 0 
    275282      jpm = MAX(jp_tem, jp_sal) 
    276283      ALLOCATE( tsn(jpi,jpj,1,jpm), STAT=ierr0 ) 
    277284      ALLOCATE( ub(jpi,jpj,1)     , STAT=ierr1 ) 
    278285      ALLOCATE( vb(jpi,jpj,1)     , STAT=ierr2 ) 
    279       ierr = ierr0 + ierr1 + ierr2 
     286      IF ( nn_ice == 1 ) ALLOCATE( tsb(jpi,jpj,1,jpm), STAT=ierr3 ) 
     287      ierr = ierr0 + ierr1 + ierr2 + ierr3 
    280288      IF( ierr > 0 ) THEN 
    281289         CALL ctl_stop('sbc_ssm_init: unable to allocate surface arrays') 
  • branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zfechem.F90

    r3780 r4276  
    129129                  zoxy   = trn(ji,jj,jk,jpoxy) * ( rhop(ji,jj,jk) / 1.e3 ) 
    130130                  ! Fe2+ oxydation rate from Santana-Casiano et al. (2005) 
    131                   zkox   = 35.407 - 6.7109 * zph + 0.5342 * zph * zph - 5362.6 / ( tsn(ji,jj,1,jp_tem) + 273.15 )  & 
     131                  zkox   = 35.407 - 6.7109 * zph + 0.5342 * zph * zph - 5362.6 / ( tsn(ji,jj,jk,jp_tem) + 273.15 )  & 
    132132                    &    - 0.04406 * SQRT( tsn(ji,jj,jk,jp_sal) ) - 0.002847 * tsn(ji,jj,jk,jp_sal) 
    133133                  zkox   = ( 10.** zkox ) * spd 
     
    263263               zdep    = MIN( 1., 1000. / fsdept(ji,jj,jk) ) 
    264264               zlam1b  = xlam1 * MAX( 0.e0, ( trn(ji,jj,jk,jpfer) * 1.e9 - ztotlig(ji,jj,jk) ) ) 
    265                zcoag   = zfeequi * zlam1b * zstep + 1E-4 * ( 1. - zlamfac ) * zdep * zstep *zfecoll 
     265               zcoag   = zfeequi * zlam1b * zstep + 1E-4 * ( 1. - zlamfac ) * zdep * zstep * trn(ji,jj,jk,jpfer) 
    266266 
    267267               !  Compute the coagulation of colloidal iron. This parameterization  
     
    278278               tra(ji,jj,jk,jpsfe) = tra(ji,jj,jk,jpsfe) + zscave * zdenom1 + zaggdfea + zaggdfeb 
    279279#else 
    280                zlam1b = 3.53E3 *   trn(ji,jj,jk,jpgoc) * xdiss(ji,jj,jk) + 1E-4 * ( 1. - zlamfac ) * zdep  
     280               zlam1b = 3.53E3 *   trn(ji,jj,jk,jpgoc) * xdiss(ji,jj,jk) 
    281281               zaggdfeb = zlam1b * zstep * zfecoll 
    282282               ! 
  • branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zflx.F90

    r3481 r4276  
    109109         ! then the first atmospheric CO2 record read is at years(1) 
    110110         zyr_dec = REAL( nyear + nn_offset, wp ) + REAL( nday_year, wp ) / REAL( nyear_len(1), wp ) 
    111          jm = 2 
    112          DO WHILE( jm <= nmaxrec .AND. years(jm-1) < zyr_dec .AND. years(jm) >= zyr_dec ) ;  jm = jm + 1 ;  END DO 
     111         jm = 1 
     112         DO WHILE( jm <= nmaxrec .AND. years(jm) < zyr_dec ) ;  jm = jm + 1 ;  END DO 
    113113         iind = jm  ;   iindm1 = jm - 1 
    114114         zdco2dt = ( atcco2h(iind) - atcco2h(iindm1) ) / ( years(iind) - years(iindm1) + rtrn ) 
     
    196196      END DO 
    197197 
    198       t_oce_co2_flx = t_oce_co2_flx + glob_sum( oce_co2(:,:) )            ! Cumulative Total Flux of Carbon 
    199       t_atm_co2_flx = glob_sum( satmco2(:,:) * patm(:,:) * e1e2t(:,:) )   ! Total atmospheric pCO2 
     198      t_oce_co2_flx = t_oce_co2_flx + glob_sum( oce_co2(:,:) )      ! Cumulative Total Flux of Carbon 
     199      t_atm_co2_flx = glob_sum( satmco2(:,:) * e1e2t(:,:) )         ! Total atmospheric pCO2 
    200200 
    201201      IF(ln_ctl)   THEN  ! print mean trends (used for debugging) 
  • branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zmeso.F90

    r3856 r4276  
    140140               !  ---------------------------------- 
    141141# if ! defined key_kriest 
    142                zgrazffeg = grazflux  * zstep * wsbio4(ji,jj,jk)      & 
    143 !                 &                   * tgfunc2(ji,jj,jk) * trn(ji,jj,jk,jpgoc) * trn(ji,jj,jk,jpmes) 
    144                &                     * 2. *  trn(ji,jj,jk,jpgoc) * trn(ji,jj,jk,jpmes) 
     142               zgrazffeg = grazflux  * zstep * wsbio4(ji,jj,jk) * trn(ji,jj,jk,jpgoc) * trn(ji,jj,jk,jpmes) 
    145143               zgrazfffg = zgrazffeg * trn(ji,jj,jk,jpbfe) / (trn(ji,jj,jk,jpgoc) + rtrn) 
    146144# endif 
    147                zgrazffep = grazflux  * zstep *  wsbio3(ji,jj,jk)     & 
    148 !                 &                   * tgfunc2(ji,jj,jk) * trn(ji,jj,jk,jppoc) * trn(ji,jj,jk,jpmes) 
    149                &                     * 2. * trn(ji,jj,jk,jppoc) * trn(ji,jj,jk,jpmes) 
     145               zgrazffep = grazflux  * zstep *  wsbio3(ji,jj,jk) * trn(ji,jj,jk,jppoc) * trn(ji,jj,jk,jpmes) 
    150146               zgrazfffp = zgrazffep * trn(ji,jj,jk,jpsfe) / (trn(ji,jj,jk,jppoc) + rtrn) 
    151147              ! 
     
    154150              ! Compute the proportion of filter feeders 
    155151              zproport  = (zgrazffep + zgrazffeg)/(rtrn + zgraztot) 
     152              ! Compute fractionation of aggregates. It is assumed that diatoms based aggregates are more prone to fractionation 
     153              ! since they are more porous (marine snow instead of fecal pellets) 
    156154              zratio    = trn(ji,jj,jk,jpgsi) / ( trn(ji,jj,jk,jpgoc) + rtrn ) 
    157155              zratio2   = zratio * zratio 
    158 !              zfrac =  zproport * 0.15 * zstep *                     & 
    159 !                       ( 0.2 + 0.8 * zratio2 / ( 1.5**2 + zratio2 ) )   & 
    160 !                      *trn(ji,jj,jk,jpmes)/3E-7 *trn(ji,jj,jk,jpgoc) 
    161               zfrac     = zproport * grazflux  * zstep * wsbio4(ji,jj,jk)      & 
    162                  &       * ( 0.1 + 3.9 * zratio2 / ( 1.**2 + zratio2 ) )       & 
    163                  &       * 2. * trn(ji,jj,jk,jpmes) * trn(ji,jj,jk,jpgoc)  
     156              zfrac     = zproport * zgrazffeg * ( 0.1 + 3.9 * zratio2 / ( 1.**2 + zratio2 ) ) 
    164157 
    165158              zfracfe   = zfrac * trn(ji,jj,jk,jpbfe) / (trn(ji,jj,jk,jpgoc) + rtrn) 
     
    193186               zepshert  = epsher2 * MIN( 1., zncratio ) 
    194187               zepsherv  = zepshert * MIN( 1., zgrasrat / ferat3 ) 
    195                zgrarem2  = zgraztot * ( 1. - zepsherv - unass2 ) + zrespz2  & 
    196                &    + ( 1. - zepsherv - unass2 ) /( 1. - zepsherv + rtrn) * ztortz2 
    197                zgrafer2  = zgraztot * MAX( 0. , ( 1. - unass2 ) * zgrasrat - ferat3 * zepsherv )    & 
    198                &    + ferat3 * ( zrespz2 + ( 1. - zepsherv - unass2 ) /( 1. - zepsherv + rtrn) * ztortz2 ) 
     188               zgrarem2  =  zgraztot * ( 1. - zepsherv - unass2 ) + zrespz2  & 
     189                  &       + ( 1. - zepsherv - unass2 ) /( 1. - zepsherv ) * ztortz2 
     190               zgrafer2  =  zgraztot * MAX( 0. , ( 1. - unass2 ) * zgrasrat - ferat3 * zepsherv )    & 
     191                  &       + ferat3 * ( zrespz2 + ( 1. - zepsherv - unass2 ) /( 1. - zepsherv ) * ztortz2 ) 
    199192               zgrapoc2  = zgraztot * unass2 
    200193 
     
    208201               tra(ji,jj,jk,jpdic) = tra(ji,jj,jk,jpdic) + zgrarsig 
    209202               tra(ji,jj,jk,jptal) = tra(ji,jj,jk,jptal) + rno3 * zgrarsig               
    210 #if defined key_kriest 
    211                tra(ji,jj,jk,jppoc) = tra(ji,jj,jk,jppoc) + zgrapoc2 
    212                tra(ji,jj,jk,jpnum) = tra(ji,jj,jk,jpnum) + zgrapoc2 * xkr_dmeso 
    213                tra(ji,jj,jk,jpsfe) = tra(ji,jj,jk,jpsfe) + zgraztotf * unass2 
    214 #else 
    215                tra(ji,jj,jk,jpgoc) = tra(ji,jj,jk,jpgoc) + zgrapoc2 - zfrac  
    216                tra(ji,jj,jk,jppoc) = tra(ji,jj,jk,jppoc) + zfrac 
    217                tra(ji,jj,jk,jpbfe) = tra(ji,jj,jk,jpbfe) + zgraztotf * unass2 - zfracfe 
    218                tra(ji,jj,jk,jpsfe) = tra(ji,jj,jk,jpsfe) + zfracfe 
    219  
    220 #endif 
     203 
    221204               zmortz2 = ztortz2 + zrespz2 
    222                zmortzgoc = unass2 / ( 1. - zepsherv + rtrn ) * ztortz2 
     205               zmortzgoc = unass2 / ( 1. - zepsherv ) * ztortz2 
    223206               tra(ji,jj,jk,jpmes) = tra(ji,jj,jk,jpmes) - zmortz2 + zepsherv * zgraztot  
    224207               tra(ji,jj,jk,jpdia) = tra(ji,jj,jk,jpdia) - zgrazd 
     
    242225#if defined key_kriest 
    243226               znumpoc = trn(ji,jj,jk,jpnum) / ( trn(ji,jj,jk,jppoc) + rtrn ) 
    244                tra(ji,jj,jk,jppoc) = tra(ji,jj,jk,jppoc) + zmortzgoc - zgrazpoc - zgrazffep 
    245                tra(ji,jj,jk,jpnum) = tra(ji,jj,jk,jpnum) - zgrazpoc * znumpoc & 
    246                &   + zmortzgoc * xkr_dmeso - zgrazffep * znumpoc * wsbio4(ji,jj,jk) / ( wsbio3(ji,jj,jk) + rtrn ) 
    247                tra(ji,jj,jk,jpsfe) = tra(ji,jj,jk,jpsfe) + ferat3 * zmortz2 - zgrazfffp - zgrazpof 
     227               tra(ji,jj,jk,jppoc) = tra(ji,jj,jk,jppoc) + zmortzgoc - zgrazpoc - zgrazffep + zgrapoc2 
     228               tra(ji,jj,jk,jpnum) = tra(ji,jj,jk,jpnum) - zgrazpoc * znumpoc + zgrapoc2 * xkr_dmeso      & 
     229               &                   + zmortzgoc * xkr_dmeso - zgrazffep * znumpoc * wsbio4(ji,jj,jk) / ( wsbio3(ji,jj,jk) + rtrn ) 
     230               tra(ji,jj,jk,jpsfe) = tra(ji,jj,jk,jpsfe) + ferat3 * zmortz2 - zgrazfffp - zgrazpof + zgraztotf * unass2 
    248231#else 
    249                tra(ji,jj,jk,jppoc) = tra(ji,jj,jk,jppoc) - zgrazpoc - zgrazffep 
    250                tra(ji,jj,jk,jpgoc) = tra(ji,jj,jk,jpgoc) + zmortzgoc - zgrazffeg 
    251                tra(ji,jj,jk,jpsfe) = tra(ji,jj,jk,jpsfe) - zgrazpof - zgrazfffp 
    252                tra(ji,jj,jk,jpbfe) = tra(ji,jj,jk,jpbfe) + ferat3 * zmortzgoc - zgrazfffg 
     232               tra(ji,jj,jk,jppoc) = tra(ji,jj,jk,jppoc) - zgrazpoc - zgrazffep + zfrac 
     233               tra(ji,jj,jk,jpgoc) = tra(ji,jj,jk,jpgoc) + zmortzgoc - zgrazffeg + zgrapoc2 - zfrac 
     234               tra(ji,jj,jk,jpsfe) = tra(ji,jj,jk,jpsfe) - zgrazpof - zgrazfffp + zfracfe 
     235               tra(ji,jj,jk,jpbfe) = tra(ji,jj,jk,jpbfe) + ferat3 * zmortzgoc - zgrazfffg + zgraztotf * unass2 - zfracfe 
    253236#endif 
    254  
    255237            END DO 
    256238         END DO 
  • branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zprod.F90

    r3686 r4276  
    201201                      zconctemp2  = trn(ji,jj,jk,jpdia) - zconctemp 
    202202                      ! 
    203                       zpislopead (ji,jj,jk) = pislope  * ( 1.+ zadap  * EXP( enano(ji,jj,jk) ) ) 
     203                      zpislopead (ji,jj,jk) = pislope  * ( 1.+ zadap  * EXP( -0.21 * enano(ji,jj,jk) ) ) 
    204204                      zpislopead2(ji,jj,jk) = (pislope * zconctemp2 + pislope2 * zconctemp)  / ( trn(ji,jj,jk,jpdia) + rtrn ) 
    205205 
  • branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zsed.F90

    r3751 r4276  
    6969      REAL(wp) ::  zwflux, zfminus, zfplus 
    7070      REAL(wp) ::  zlim, zfact, zfactcal 
    71       REAL(wp) ::  zo2, zno3, zflx, zpdenit, z1pdenit 
     71      REAL(wp) ::  zo2, zno3, zflx, zpdenit, z1pdenit, zdenitt, zolimit 
    7272      REAL(wp) ::  zsiloss, zcaloss, zwsbio3, zwsbio4, zwscal, zdep, zwstpoc 
    7373      REAL(wp) ::  ztrfer, ztrpo4, zwdust 
     
    8282      IF( nn_timing == 1 )  CALL timing_start('p4z_sed') 
    8383      ! 
    84       IF( kt == nit000 .AND. jnt == 1 )  THEN 
     84      IF( kt == nittrc000 .AND. jnt == 1 )  THEN 
    8585         ryyss    = nyear_len(1) * rday    ! number of seconds per year and per month 
    8686         rmtss    = ryyss / raamo 
     
    105105            DO ji = 1, jpi 
    106106               zdep    = rfact2 / fse3t(ji,jj,1) 
    107     !           zwflux  = ( emps(ji,jj) - emp(ji,jj) ) & 
    108     !           &        * tsn(ji,jj,1,jp_sal) / ( tsn(ji,jj,1,jp_sal) - 6.0 ) / 1000. 
    109                zwflux = 0. 
    110                zfminus = MIN( 0., -zwflux ) * trn(ji,jj,1,jpfer) * zdep 
    111                zfplus  = MAX( 0., -zwflux ) * 10E-9 * zdep 
     107               zwflux  = fmmflx(ji,jj) / 1000._wp 
     108               zfminus = MIN( 0._wp, -zwflux ) * trn(ji,jj,1,jpfer) * zdep 
     109               zfplus  = MAX( 0._wp, -zwflux ) * icefeinput * zdep 
    112110               zironice(ji,jj) =  zfplus + zfminus 
    113111            END DO 
     
    135133         ENDIF 
    136134         zsidep(:,:) = 8.8 * 0.075 * dust(:,:) * rfact2 / fse3t(:,:,1) / ( 28.1  * rmtss ) 
    137          zpdep (:,:) = 0.1 * 0.021 * dust(:,:) * rfact2 / fse3t(:,:,1) / ( 31.   * rmtss ) 
     135         zpdep (:,:) = 0.1 * 0.021 * dust(:,:) * rfact2 / fse3t(:,:,1) / ( 31.   * rmtss ) / po4r  
    138136         !                                              ! Iron solubilization of particles in the water column 
    139137         zwdust = 0.005 / ( wdust * 55.85 * 30.42 ) / ( 45. * rday )  
     
    246244#endif 
    247245 
    248       ! THEN this loss is scaled at each bottom grid cell for 
    249       ! equilibrating the total budget of silica in the ocean. 
    250       ! Thus, the amount of silica lost in the sediments equal 
    251       ! the supply at the surface (dust+rivers) 
     246      ! This loss is scaled at each bottom grid cell for equilibrating the total budget of silica in the ocean. 
     247      ! Thus, the amount of silica lost in the sediments equal the supply at the surface (dust+rivers) 
    252248      ! ------------------------------------------------------ 
    253249#if ! defined key_sed 
     
    302298 
    303299#if ! defined key_sed 
    304             zpdenit  = MIN( ( trn(ji,jj,ikt,jpno3) - rtrn ) / rdenit, zdenit2d(ji,jj) * zwstpoc * zrivno3 ) 
     300            ! The 0.5 factor in zpdenit and zdenitt is to avoid negative NO3 concentration after both denitrification 
     301            ! in the sediments and just above the sediments. Not very clever, but simpliest option. 
     302            zpdenit  = MIN( 0.5 * ( trn(ji,jj,ikt,jpno3) - rtrn ) / rdenit, zdenit2d(ji,jj) * zwstpoc * zrivno3 ) 
    305303            z1pdenit = zwstpoc * zrivno3 - zpdenit 
    306             trn(ji,jj,ikt,jpdoc) = trn(ji,jj,ikt,jpdoc) + z1pdenit 
    307             trn(ji,jj,ikt,jppo4) = trn(ji,jj,ikt,jppo4) + zpdenit 
    308             trn(ji,jj,ikt,jpnh4) = trn(ji,jj,ikt,jpnh4) + zpdenit 
    309             trn(ji,jj,ikt,jpno3) = trn(ji,jj,ikt,jpno3) - rdenit * zpdenit 
    310             trn(ji,jj,ikt,jptal) = trn(ji,jj,ikt,jptal) + rno3 * ( 1. + rdenit ) * zpdenit 
    311             trn(ji,jj,ikt,jpdic) = trn(ji,jj,ikt,jpdic) + zpdenit 
     304            zolimit = MIN( ( trn(ji,jj,ikt,jpoxy) - rtrn ) / o2ut, z1pdenit * ( 1.- nitrfac(ji,jj,ikt) ) ) 
     305            zdenitt = MIN(  0.5 * ( trn(ji,jj,ikt,jpno3) - rtrn ) / rdenit, z1pdenit * nitrfac(ji,jj,ikt) ) 
     306            trn(ji,jj,ikt,jpdoc) = trn(ji,jj,ikt,jpdoc) + z1pdenit - zolimit - zdenitt 
     307            trn(ji,jj,ikt,jppo4) = trn(ji,jj,ikt,jppo4) + zpdenit + zolimit + zdenitt 
     308            trn(ji,jj,ikt,jpnh4) = trn(ji,jj,ikt,jpnh4) + zpdenit + zolimit + zdenitt 
     309            trn(ji,jj,ikt,jpno3) = trn(ji,jj,ikt,jpno3) - rdenit * (zpdenit + zdenitt) 
     310            trn(ji,jj,ikt,jpoxy) = trn(ji,jj,ikt,jpoxy) - zolimit * o2ut 
     311            trn(ji,jj,ikt,jptal) = trn(ji,jj,ikt,jptal) + rno3 * (zolimit + (1.+rdenit) * (zpdenit + zdenitt) ) 
     312            trn(ji,jj,ikt,jpdic) = trn(ji,jj,ikt,jpdic) + zpdenit + zolimit + zdenitt 
    312313            zwork4(ji,jj) = rdenit * zpdenit * fse3t(ji,jj,ikt) 
    313314#endif 
  • branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zsink.F90

    r3829 r4276  
    156156            DO ji = 1, jpi 
    157157               IF( tmask(ji,jj,jk) == 1 ) THEN 
    158                  zwsmax = 0.8 * fse3t(ji,jj,jk) / xstep 
     158                 zwsmax = 0.5 * fse3t(ji,jj,jk) / xstep 
    159159                 wsbio3(ji,jj,jk) = MIN( wsbio3(ji,jj,jk), zwsmax * FLOAT( iiter1 ) ) 
    160160                 wsbio4(ji,jj,jk) = MIN( wsbio4(ji,jj,jk), zwsmax * FLOAT( iiter2 ) ) 
     
    217217               zaggdoc  = ( ( 0.369 * 0.3 * trn(ji,jj,jk,jpdoc) + 102.4 * trn(ji,jj,jk,jppoc) ) * zfact       & 
    218218               &            + 2.4 * zstep * trn(ji,jj,jk,jppoc) ) * 0.3 * trn(ji,jj,jk,jpdoc) 
    219 !               zaggdoc  = ( 0.83 * trn(ji,jj,jk,jpdoc) + 271. * trn(ji,jj,jk,jppoc) ) * zfact * trn(ji,jj,jk,jpdoc) 
    220219               ! transfer of DOC to GOC :  
    221220               ! 1st term is shear aggregation 
    222221               ! 2nd term is differential settling  
    223222               zaggdoc2 = ( 3.53E3 * zfact + 0.1 * zstep ) * trn(ji,jj,jk,jpgoc) * 0.3 * trn(ji,jj,jk,jpdoc) 
    224 !               zaggdoc2 = 1.07e4 * zfact * trn(ji,jj,jk,jpgoc) * trn(ji,jj,jk,jpdoc) 
    225223               ! tranfer of DOC to POC due to brownian motion 
    226 !               zaggdoc3 =   0.02 * ( 16706. * trn(ji,jj,jk,jppoc) + 231. * trn(ji,jj,jk,jpdoc) ) * zstep * trn(ji,jj,jk,jpdoc) 
    227224               zaggdoc3 =  ( 5095. * trn(ji,jj,jk,jppoc) + 114. * 0.3 * trn(ji,jj,jk,jpdoc) ) *zstep * 0.3 * trn(ji,jj,jk,jpdoc) 
    228225 
  • branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zsms.F90

    r3780 r4276  
    7676      ENDIF 
    7777      ! 
    78       IF( ln_rsttr .AND. kt == nittrc000 )                         CALL p4z_rst( nittrc000, 'READ' )  !* read or initialize all required fields  
    79       IF( ln_rsttr  .AND. ln_pisclo )                              CALL p4z_clo            ! damping on closed seas 
     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 
    8088      IF( ln_pisdmp .AND. MOD( kt - nn_dttrc, nn_pisdmp ) == 0 )   CALL p4z_dmp( kt )      ! Relaxation of some tracers 
    8189      ! 
     
    164172      NAMELIST/nampiskrp/ xkr_eta, xkr_zeta, xkr_ncontent, xkr_mass_min, xkr_mass_max 
    165173#endif 
    166       NAMELIST/nampisdmp/ ln_pisdmp, nn_pisdmp, ln_pisclo 
     174      NAMELIST/nampisdmp/ ln_pisdmp, nn_pisdmp 
    167175      NAMELIST/nampismass/ ln_check_mass 
    168176      !!---------------------------------------------------------------------- 
     
    215223      ln_pisdmp = .true. 
    216224      nn_pisdmp = 1 
    217       ln_pisclo = .false. 
    218225 
    219226      REWIND( numnatp ) 
     
    225232         WRITE(numout,*) '    Relaxation of tracer to glodap mean value             ln_pisdmp      =', ln_pisdmp 
    226233         WRITE(numout,*) '    Frequency of Relaxation                               nn_pisdmp      =', nn_pisdmp 
    227          WRITE(numout,*) '    Restoring of tracer to initial value  on closed seas  ln_pisclo      =', ln_pisclo 
    228234         WRITE(numout,*) ' ' 
    229235      ENDIF 
     
    241247   END SUBROUTINE p4z_sms_init 
    242248 
     249   SUBROUTINE p4z_ph_ini 
     250      !!--------------------------------------------------------------------- 
     251      !!                   ***  ROUTINE p4z_ini_ph  *** 
     252      !! 
     253      !!  ** Purpose : Initialization of chemical variables of the carbon cycle 
     254      !!--------------------------------------------------------------------- 
     255      INTEGER  ::  ji, jj, jk 
     256      REAL(wp) ::  zcaralk, zbicarb, zco3 
     257      REAL(wp) ::  ztmas, ztmas1 
     258      !!--------------------------------------------------------------------- 
     259 
     260      ! Set PH from  total alkalinity, borat (???), akb3 (???) and ak23 (???) 
     261      ! -------------------------------------------------------- 
     262      DO jk = 1, jpk 
     263         DO jj = 1, jpj 
     264            DO ji = 1, jpi 
     265               ztmas   = tmask(ji,jj,jk) 
     266               ztmas1  = 1. - tmask(ji,jj,jk) 
     267               zcaralk = trn(ji,jj,jk,jptal) - borat(ji,jj,jk) / (  1. + 1.E-8 / ( rtrn + akb3(ji,jj,jk) )  ) 
     268               zco3    = ( zcaralk - trn(ji,jj,jk,jpdic) ) * ztmas + 0.5e-3 * ztmas1 
     269               zbicarb = ( 2. * trn(ji,jj,jk,jpdic) - zcaralk ) 
     270               hi(ji,jj,jk) = ( ak23(ji,jj,jk) * zbicarb / zco3 ) * ztmas + 1.e-9 * ztmas1 
     271            END DO 
     272         END DO 
     273     END DO 
     274     ! 
     275   END SUBROUTINE p4z_ph_ini 
     276 
    243277   SUBROUTINE p4z_rst( kt, cdrw ) 
    244278      !!--------------------------------------------------------------------- 
     
    269303         ELSE 
    270304!            hi(:,:,:) = 1.e-9  
    271             ! Set PH from  total alkalinity, borat (???), akb3 (???) and ak23 (???) 
    272             ! -------------------------------------------------------- 
    273             DO jk = 1, jpk 
    274                DO jj = 1, jpj 
    275                   DO ji = 1, jpi 
    276                      ztmas   = tmask(ji,jj,jk) 
    277                      ztmas1  = 1. - tmask(ji,jj,jk) 
    278                      zcaralk = trn(ji,jj,jk,jptal) - borat(ji,jj,jk) / (  1. + 1.E-8 / ( rtrn + akb3(ji,jj,jk) )  ) 
    279                      zco3    = ( zcaralk - trn(ji,jj,jk,jpdic) ) * ztmas + 0.5e-3 * ztmas1 
    280                      zbicarb = ( 2. * trn(ji,jj,jk,jpdic) - zcaralk ) 
    281                      hi(ji,jj,jk) = ( ak23(ji,jj,jk) * zbicarb / zco3 ) * ztmas + 1.e-9 * ztmas1 
    282                   END DO 
    283                END DO 
    284             END DO 
     305            CALL p4z_ph_ini 
    285306         ENDIF 
    286307         CALL iom_get( numrtr, jpdom_autoglo, 'Silicalim', xksi(:,:) ) 
     
    395416#endif 
    396417            &                    + trn(:,:,:,jpsfe)                     & 
    397             &                    + trn(:,:,:,jpzoo)                     & 
     418            &                    + trn(:,:,:,jpzoo) * ferat3            & 
    398419            &                    + trn(:,:,:,jpmes) * ferat3            ) * cvol(:,:,:)  ) 
    399420 
     
    421442   END SUBROUTINE p4z_chk_mass 
    422443 
    423    SUBROUTINE p4z_clo    
    424       !!--------------------------------------------------------------------- 
    425       !!                  ***  ROUTINE p4z_clo  *** 
    426       !! 
    427       !! ** Purpose :   Closed sea domain initialization 
    428       !! 
    429       !! ** Method  :   if a closed sea is located only in a model grid point 
    430       !!                we restore to initial data 
    431       !! 
    432       !! ** Action  :   ictsi1(), ictsj1() : south-west closed sea limits (i,j) 
    433       !!                ictsi2(), ictsj2() : north-east Closed sea limits (i,j) 
    434       !!---------------------------------------------------------------------- 
    435       INTEGER, PARAMETER           ::   npicts   = 4        ! number of closed sea 
    436       INTEGER, DIMENSION(npicts)   ::   ictsi1, ictsj1      ! south-west closed sea limits (i,j) 
    437       INTEGER, DIMENSION(npicts)   ::   ictsi2, ictsj2      ! north-east closed sea limits (i,j) 
    438       INTEGER :: ji, jj, jk, jn, jl, jc                     ! dummy loop indices 
    439       INTEGER :: ierr                                       ! local integer 
    440       REAL(wp), POINTER, DIMENSION(:,:,:,:) ::  ztrcdta     ! 4D  workspace 
    441       !!---------------------------------------------------------------------- 
    442  
    443       IF(lwp) WRITE(numout,*) 
    444       IF(lwp) WRITE(numout,*)' p4z_clo : closed seas ' 
    445       IF(lwp) WRITE(numout,*)'~~~~~~~' 
    446  
    447       ! initial values 
    448       ictsi1(:) = 1  ;  ictsi2(:) = 1  
    449       ictsj1(:) = 1  ;  ictsj2(:) = 1  
    450  
    451       ! set the closed seas (in data domain indices) 
    452       ! ------------------- 
    453  
    454       IF( cp_cfg == "orca" ) THEN 
    455          ! 
    456          SELECT CASE ( jp_cfg ) 
    457          !                                           ! ======================= 
    458          CASE ( 2 )                                  !  ORCA_R2 configuration 
    459             !                                        ! ======================= 
    460             !                                            ! Caspian Sea 
    461             ictsi1(1)   =  11  ;  ictsj1(1)   = 103 
    462             ictsi2(1)   =  17  ;  ictsj2(1)   = 112 
    463             !                                            ! Great North American Lakes 
    464             ictsi1(2)   =  97  ;  ictsj1(2)   = 107 
    465             ictsi2(2)   = 103  ;  ictsj2(2)   = 111 
    466             !                                            ! Black Sea 1 : west part of the Black Sea 
    467             ictsi1(3)   = 174  ; ictsj1(3)   = 107 
    468             ictsi2(3)   = 181  ; ictsj2(3)   = 112 
    469             !                                            ! Black Sea 2 : est part of the Black Sea 
    470             ictsi1(4)   =   2  ;  ictsj1(4)   = 107 
    471             ictsi2(4)   =   6  ;  ictsj2(4)   = 112 
    472             !                                        ! ======================= 
    473          CASE ( 4 )                                  !  ORCA_R4 configuration 
    474             !                                        ! ======================= 
    475             !                                            ! Caspian Sea 
    476             ictsi1(1)   =  4  ;  ictsj1(1)   = 53 
    477             ictsi2(1)   =  4  ;  ictsj2(1)   = 56 
    478             !                                            ! Great North American Lakes 
    479             ictsi1(2)   = 49  ;  ictsj1(2)   = 55 
    480             ictsi2(2)   = 51  ;  ictsj2(2)   = 56 
    481             !                                            ! Black Sea 
    482             ictsi1(3)   = 88  ;  ictsj1(3)   = 55 
    483             ictsi2(3)   = 91  ;  ictsj2(3)   = 56 
    484             !                                            ! Baltic Sea 
    485             ictsi1(4)   = 75  ;  ictsj1(4)   = 59 
    486             ictsi2(4)   = 76  ;  ictsj2(4)   = 61 
    487             !                                        ! ======================= 
    488             !                                        ! ======================= 
    489          CASE ( 025 )                                ! ORCA_R025 configuration 
    490             !                                        ! ======================= 
    491                                                      ! Caspian + Aral sea 
    492             ictsi1(1)   = 1330 ; ictsj1(1)   = 645 
    493             ictsi2(1)   = 1400 ; ictsj2(1)   = 795 
    494             !                                        ! Azov Sea 
    495             ictsi1(2)   = 1284 ; ictsj1(2)   = 722 
    496             ictsi2(2)   = 1304 ; ictsj2(2)   = 747 
    497             ! 
    498          END SELECT 
    499          ! 
    500       ENDIF 
    501  
    502       ! convert the position in local domain indices 
    503       ! -------------------------------------------- 
    504       DO jc = 1, npicts  
    505          ictsi1(jc)   = mi0( ictsi1(jc) ) 
    506          ictsj1(jc)   = mj0( ictsj1(jc) ) 
    507  
    508          ictsi2(jc)   = mi1( ictsi2(jc) ) 
    509          ictsj2(jc)   = mj1( ictsj2(jc) ) 
    510       END DO 
    511  
    512       ! Restore close seas values to initial data 
    513       IF( ln_trcdta .AND. nb_trcdta > 0 )  THEN   ! Initialisation of tracer from a file that may also be used for damping 
    514          ! 
    515          CALL wrk_alloc( jpi, jpj, jpk, nb_trcdta, ztrcdta )   ! Memory allocation 
    516          ! 
    517          CALL trc_dta( nittrc000, ztrcdta )   ! read tracer data at nittrc000 
    518          ! 
    519          DO jn = 1, jptra 
    520             IF( ln_trc_ini(jn) ) THEN      ! update passive tracers arrays with input data read from file 
    521                 jl = n_trc_index(jn) 
    522                 DO jc = 1, npicts 
    523                    DO jk = 1, jpkm1 
    524                       DO jj = ictsj1(jc), ictsj2(jc) 
    525                          DO ji = ictsi1(jc), ictsi2(jc) 
    526                             trn(ji,jj,jk,jn) = ztrcdta(ji,jj,jk,jl) * tmask(ji,jj,jk) 
    527                             trb(ji,jj,jk,jn) = trn(ji,jj,jk,jn) 
    528                          ENDDO 
    529                       ENDDO 
    530                    ENDDO 
    531                 ENDDO 
    532              ENDIF 
    533           ENDDO 
    534           CALL wrk_dealloc( jpi, jpj, jpk, nb_trcdta, ztrcdta ) 
    535       ENDIF 
    536       ! 
    537    END SUBROUTINE p4z_clo 
    538444#else 
    539445   !!====================================================================== 
  • branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/TOP_SRC/PISCES/sms_pisces.F90

    r3780 r4276  
    5656   LOGICAL  ::  ln_pisdmp          !: restoring or not of nutrients to a mean value 
    5757   INTEGER  ::  nn_pisdmp          !: frequency of relaxation or not of nutrients to a mean value 
    58    LOGICAL  ::  ln_pisclo          !: Restoring or not of nutrients to initial value on closed seas 
    5958 
    6059   !!* Mass conservation 
  • branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/TOP_SRC/PISCES/trcini_pisces.F90

    r3757 r4276  
    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 
    179          ! 
     162        ! 
    180163      END IF 
    181164 
  • branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/TOP_SRC/TRP/trcdmp.F90

    r3294 r4276  
    1111   !!            3.3  !  2010-06  (C. Ethe, G. Madec) merge TRA-TRC  
    1212   !!---------------------------------------------------------------------- 
    13 #if  defined key_top && defined key_trcdmp  
    14    !!---------------------------------------------------------------------- 
    15    !!   key_trcdmp                                         internal damping 
     13#if  defined key_top  
    1614   !!---------------------------------------------------------------------- 
    1715   !!   trc_dmp      : update the tracer trend with the internal damping 
     
    2523   USE prtctl_trc      ! Print control for debbuging 
    2624   USE trdtra 
     25   USE trdmod_oce 
    2726 
    2827   IMPLICIT NONE 
     
    3029 
    3130   PUBLIC trc_dmp            ! routine called by step.F90 
     31   PUBLIC trc_dmp_clo        ! routine called by step.F90 
    3232   PUBLIC trc_dmp_alloc      ! routine called by nemogcm.F90 
    3333 
    34    LOGICAL , PUBLIC, PARAMETER ::   lk_trcdmp = .TRUE.   !: internal damping flag 
    35  
    3634   !                                !!* Namelist namtrc_dmp : passive tracer newtonian damping * 
    37    INTEGER  ::   nn_hdmp_tr =   -1   ! = 0/-1/'latitude' for damping over passive tracer 
    38    INTEGER  ::   nn_zdmp_tr =    0   ! = 0/1/2 flag for damping in the mixed layer 
    39    REAL(wp) ::   rn_surf_tr =   50.  ! surface time scale for internal damping        [days] 
    40    REAL(wp) ::   rn_bot_tr  =  360.  ! bottom time scale for internal damping         [days] 
    41    REAL(wp) ::   rn_dep_tr  =  800.  ! depth of transition between rn_surf and rn_bot [meters] 
    42    INTEGER  ::   nn_file_tr =    2   ! = 1 create a damping.coeff NetCDF file  
    43  
    4435   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   restotr   ! restoring coeff. on tracers (s-1) 
     36 
     37   INTEGER, PARAMETER           ::   npncts   = 5        ! number of closed sea 
     38   INTEGER, DIMENSION(npncts)   ::   nctsi1, nctsj1      ! south-west closed sea limits (i,j) 
     39   INTEGER, DIMENSION(npncts)   ::   nctsi2, nctsj2      ! north-east closed sea limits (i,j) 
    4540 
    4641   !! * Substitutions 
     
    8681      INTEGER, INTENT( in ) ::   kt      ! ocean time-step index 
    8782      !! 
    88       INTEGER  ::   ji, jj, jk, jn       ! dummy loop indices 
     83      INTEGER  ::   ji, jj, jk, jn, jl       ! dummy loop indices 
    8984      REAL(wp) ::   ztra                 ! temporary scalars 
    9085      CHARACTER (len=22) :: charout 
    9186      REAL(wp), POINTER, DIMENSION(:,:,:) ::   ztrtrd 
     87      REAL(wp), POINTER, DIMENSION(:,:,:,:) ::  ztrcdta   ! 4D  workspace 
    9288      !!---------------------------------------------------------------------- 
    9389      ! 
     
    9995 
    10096      IF( l_trdtrc )   CALL wrk_alloc( jpi, jpj, jpk, ztrtrd )   ! temporary save of trends 
    101  
    102       ! 1. Newtonian damping trends on tracer fields 
    103       ! -------------------------------------------- 
    104       ! Initialize the input fields for newtonian damping 
    105       CALL trc_dta( kt ) 
    106       !                                                          ! =========== 
    107       DO jn = 1, jptra                                           ! tracer loop 
    108          !                                                       ! =========== 
    109          IF( l_trdtrc ) ztrtrd(:,:,:) = tra(:,:,:,jn)    ! save trends  
    110  
    111          IF( lutini(jn) ) THEN 
     97      ! 
     98      IF( nb_trcdta > 0 ) THEN  ! Initialisation of tracer from a file that may also be used for damping 
     99         ! 
     100         CALL wrk_alloc( jpi, jpj, jpk, nb_trcdta, ztrcdta )    ! Memory allocation 
     101         CALL trc_dta( kt, ztrcdta )   ! read tracer data at nit000 
     102         !                                                          ! =========== 
     103         DO jn = 1, jptra                                           ! tracer loop 
     104            !                                                       ! =========== 
     105            IF( l_trdtrc ) ztrtrd(:,:,:) = tra(:,:,:,jn)    ! save trends  
    112106            ! 
    113             SELECT CASE ( nn_zdmp_trc ) 
    114             ! 
    115             CASE( 0 )                !==  newtonian damping throughout the water column  ==! 
    116                DO jk = 1, jpkm1 
    117                   DO jj = 2, jpjm1 
    118                      DO ji = fs_2, fs_jpim1   ! vector opt. 
    119                         ztra = restotr(ji,jj,jk) * ( trdta(ji,jj,jk,jn) - trb(ji,jj,jk,jn) ) 
    120                         tra(ji,jj,jk,jn) = tra(ji,jj,jk,jn) + ztra 
     107            IF( ln_trc_ini(jn) ) THEN      ! update passive tracers arrays with input data read from file 
     108                
     109               jl = n_trc_index(jn)  
     110 
     111               SELECT CASE ( nn_zdmp_tr ) 
     112               ! 
     113               CASE( 0 )                !==  newtonian damping throughout the water column  ==! 
     114                  DO jk = 1, jpkm1 
     115                     DO jj = 2, jpjm1 
     116                        DO ji = fs_2, fs_jpim1   ! vector opt. 
     117                           ztra = restotr(ji,jj,jk) * ( ztrcdta(ji,jj,jk,jl) - trb(ji,jj,jk,jn) ) 
     118                           tra(ji,jj,jk,jn) = tra(ji,jj,jk,jn) + ztra 
     119                        END DO 
    121120                     END DO 
    122121                  END DO 
    123                END DO 
    124             ! 
    125             CASE ( 1 )                !==  no damping in the turbocline (avt > 5 cm2/s)  ==! 
    126                DO jk = 1, jpkm1 
    127                   DO jj = 2, jpjm1 
    128                      DO ji = fs_2, fs_jpim1   ! vector opt. 
    129                         IF( avt(ji,jj,jk) <= 5.e-4 )  THEN  
    130                            ztra = restotr(ji,jj,jk) * ( trdta(ji,jj,jk,jn) - trb(ji,jj,jk,jn) ) 
    131                            tra(ji,jj,jk,jn) = tra(ji,jj,jk,jn) + ztra 
    132                         ENDIF 
     122               ! 
     123               CASE ( 1 )                !==  no damping in the turbocline (avt > 5 cm2/s)  ==! 
     124                  DO jk = 1, jpkm1 
     125                     DO jj = 2, jpjm1 
     126                        DO ji = fs_2, fs_jpim1   ! vector opt. 
     127                           IF( avt(ji,jj,jk) <= 5.e-4 )  THEN  
     128                              ztra = restotr(ji,jj,jk) * ( ztrcdta(ji,jj,jk,jl) - trb(ji,jj,jk,jn) ) 
     129                              tra(ji,jj,jk,jn) = tra(ji,jj,jk,jn) + ztra 
     130                           ENDIF 
     131                        END DO 
    133132                     END DO 
    134133                  END DO 
    135                END DO 
    136             ! 
    137             CASE ( 2 )               !==  no damping in the mixed layer   ==!  
    138                DO jk = 1, jpkm1 
    139                   DO jj = 2, jpjm1 
    140                      DO ji = fs_2, fs_jpim1   ! vector opt. 
    141                         IF( fsdept(ji,jj,jk) >= hmlp (ji,jj) ) THEN 
    142                            ztra = restotr(ji,jj,jk,jn) * ( trdta(ji,jj,jk,jn) - trb(ji,jj,jk,jn) ) 
    143                            tra(ji,jj,jk,jn) = tra(ji,jj,jk,jn) + ztra 
    144                         END IF 
     134               ! 
     135               CASE ( 2 )               !==  no damping in the mixed layer   ==!  
     136                  DO jk = 1, jpkm1 
     137                     DO jj = 2, jpjm1 
     138                        DO ji = fs_2, fs_jpim1   ! vector opt. 
     139                           IF( fsdept(ji,jj,jk) >= hmlp (ji,jj) ) THEN 
     140                              ztra = restotr(ji,jj,jk) * ( ztrcdta(ji,jj,jk,jl) - trb(ji,jj,jk,jn) ) 
     141                              tra(ji,jj,jk,jn) = tra(ji,jj,jk,jn) + ztra 
     142                           END IF 
     143                        END DO 
    145144                     END DO 
    146145                  END DO 
    147                END DO 
    148             !   
    149             END SELECT 
    150             !  
    151          ENDIF 
    152          ! 
    153          IF( l_trdtrc ) THEN 
    154             ztrtrd(:,:,:) = tra(:,:,:,jn) -  ztrtrd(:,:,:) 
    155             CALL trd_tra( kt, 'TRC', jn, jptra_trd_dmp, ztrtrd ) 
    156          END IF 
    157          !                                                       ! =========== 
    158       END DO                                                     ! tracer loop 
    159       !                                                          ! =========== 
     146               !   
     147               END SELECT 
     148               !  
     149            ENDIF 
     150            ! 
     151            IF( l_trdtrc ) THEN 
     152               ztrtrd(:,:,:) = tra(:,:,:,jn) -  ztrtrd(:,:,:) 
     153               CALL trd_tra( kt, 'TRC', jn, jptra_trd_dmp, ztrtrd ) 
     154            END IF 
     155            !                                                       ! =========== 
     156         END DO                                                     ! tracer loop 
     157         !                                                          ! =========== 
     158         CALL wrk_dealloc( jpi, jpj, jpk, nb_trcdta, ztrcdta ) 
     159      ENDIF 
     160      ! 
    160161      IF( l_trdtrc )  CALL wrk_dealloc( jpi, jpj, jpk, ztrtrd ) 
    161162      !                                          ! print mean trends (used for debugging) 
     
    168169      ! 
    169170   END SUBROUTINE trc_dmp 
     171 
     172   SUBROUTINE trc_dmp_clo( kt ) 
     173      !!--------------------------------------------------------------------- 
     174      !!                  ***  ROUTINE trc_dmp_clo  *** 
     175      !! 
     176      !! ** Purpose :   Closed sea domain initialization 
     177      !! 
     178      !! ** Method  :   if a closed sea is located only in a model grid point 
     179      !!                we restore to initial data 
     180      !! 
     181      !! ** Action  :   nctsi1(), nctsj1() : south-west closed sea limits (i,j) 
     182      !!                nctsi2(), nctsj2() : north-east Closed sea limits (i,j) 
     183      !!---------------------------------------------------------------------- 
     184      INTEGER, INTENT( in ) ::   kt      ! ocean time-step index 
     185      ! 
     186      INTEGER :: ji, jj, jk, jn, jl, jc                     ! dummy loop indicesa 
     187      REAL(wp), POINTER, DIMENSION(:,:,:,:) ::  ztrcdta     ! 4D  workspace 
     188 
     189      !!---------------------------------------------------------------------- 
     190 
     191      IF( kt == nit000 ) THEN 
     192         ! initial values 
     193         nctsi1(:) = 1  ;  nctsi2(:) = 1 
     194         nctsj1(:) = 1  ;  nctsj2(:) = 1 
     195 
     196         ! set the closed seas (in data domain indices) 
     197         ! ------------------- 
     198 
     199         IF( cp_cfg == "orca" ) THEN 
     200            ! 
     201            SELECT CASE ( jp_cfg ) 
     202            !                                           ! ======================= 
     203            CASE ( 2 )                                  !  ORCA_R2 configuration 
     204               !                                        ! ======================= 
     205               !                                            ! Caspian Sea 
     206               nctsi1(1)   =  11  ;  nctsj1(1)   = 103 
     207               nctsi2(1)   =  17  ;  nctsj2(1)   = 112 
     208               !                                            ! Great North American Lakes 
     209               nctsi1(2)   =  97  ;  nctsj1(2)   = 107 
     210               nctsi2(2)   = 103  ;  nctsj2(2)   = 111 
     211               !                                            ! Black Sea 1 : west part of the Black Sea 
     212               nctsi1(3)   = 174  ;  nctsj1(3)   = 107 
     213               nctsi2(3)   = 181  ;  nctsj2(3)   = 112 
     214              !                                            ! Black Sea 2 : est part of the Black Sea 
     215               nctsi1(4)   =   2  ;  nctsj1(4)   = 107 
     216               nctsi2(4)   =   6  ;  nctsj2(4)   = 112 
     217               !                                            ! Baltic Sea 
     218               nctsi1(5)   =  145 ;  nctsj1(5)   = 116 
     219               nctsi2(5)   =  150 ;  nctsj2(5)   = 126 
     220               !                                        ! ======================= 
     221            CASE ( 4 )                                  !  ORCA_R4 configuration 
     222               !                                        ! ======================= 
     223               !                                            ! Caspian Sea 
     224               nctsi1(1)   =  4  ;  nctsj1(1)   = 53 
     225               nctsi2(1)   =  4  ;  nctsj2(1)   = 56 
     226               !                                            ! Great North American Lakes 
     227               nctsi1(2)   = 49  ;  nctsj1(2)   = 55 
     228               nctsi2(2)   = 51  ;  nctsj2(2)   = 56 
     229               !                                            ! Black Sea 
     230               nctsi1(3)   = 88  ;  nctsj1(3)   = 55 
     231               nctsi2(3)   = 91  ;  nctsj2(3)   = 56 
     232               !                                            ! Baltic Sea 
     233               nctsi1(4)   = 75  ;  nctsj1(4)   = 59 
     234               nctsi2(4)   = 76  ;  nctsj2(4)   = 61 
     235               !                                        ! ======================= 
     236            CASE ( 025 )                                ! ORCA_R025 configuration 
     237               !                                        ! ======================= 
     238                                                     ! Caspian + Aral sea 
     239               nctsi1(1)   = 1330 ; nctsj1(1)   = 645 
     240               nctsi2(1)   = 1400 ; nctsj2(1)   = 795 
     241               !                                        ! Azov Sea 
     242               nctsi1(2)   = 1284 ; nctsj1(2)   = 722 
     243               nctsi2(2)   = 1304 ; nctsj2(2)   = 747 
     244               ! 
     245            END SELECT 
     246            ! 
     247         ENDIF 
     248         ! 
     249 
     250         ! convert the position in local domain indices 
     251         ! -------------------------------------------- 
     252         DO jc = 1, npncts 
     253            nctsi1(jc)   = mi0( nctsi1(jc) ) 
     254            nctsj1(jc)   = mj0( nctsj1(jc) ) 
     255 
     256            nctsi2(jc)   = mi1( nctsi2(jc) ) 
     257            nctsj2(jc)   = mj1( nctsj2(jc) ) 
     258         END DO 
     259         ! 
     260      ENDIF 
     261 
     262      ! Restore close seas values to initial data 
     263      IF( ln_trcdta .AND. nb_trcdta > 0 )  THEN   ! Initialisation of tracer from a file that may also be used for damping 
     264         ! 
     265         IF(lwp)  WRITE(numout,*) 
     266         IF(lwp)  WRITE(numout,*) ' trc_dmp_clo : Restoring of nutrients on close seas at time-step kt = ', kt 
     267         IF(lwp)  WRITE(numout,*) 
     268         ! 
     269         CALL wrk_alloc( jpi, jpj, jpk, nb_trcdta, ztrcdta )   ! Memory allocation 
     270         ! 
     271         CALL trc_dta( kt , ztrcdta )   ! read tracer data at nittrc000 
     272         ! 
     273         DO jn = 1, jptra 
     274            IF( ln_trc_ini(jn) ) THEN      ! update passive tracers arrays with input data read from file 
     275                jl = n_trc_index(jn) 
     276                DO jc = 1, npncts 
     277                   DO jk = 1, jpkm1 
     278                      DO jj = nctsj1(jc), nctsj2(jc) 
     279                         DO ji = nctsi1(jc), nctsi2(jc) 
     280                            trn(ji,jj,jk,jn) = ztrcdta(ji,jj,jk,jl) * tmask(ji,jj,jk) 
     281                            trb(ji,jj,jk,jn) = trn(ji,jj,jk,jn) 
     282                         ENDDO 
     283                      ENDDO 
     284                   ENDDO 
     285                ENDDO 
     286             ENDIF 
     287          ENDDO 
     288          CALL wrk_dealloc( jpi, jpj, jpk, nb_trcdta, ztrcdta ) 
     289      ENDIF 
     290      ! 
     291   END SUBROUTINE trc_dmp_clo 
    170292 
    171293 
     
    199321      END SELECT 
    200322 
    201       IF( .NOT. lk_dtatrc )   & 
    202          &   CALL ctl_stop( 'no passive tracer data define key_dtatrc' ) 
    203  
    204       IF( .NOT. lk_tradmp )   & 
     323      IF( .NOT. ln_tradmp )   & 
    205324         &   CALL ctl_stop( 'passive trace damping need key_tradmp to compute damping coef.' ) 
    206325      ! 
     
    214333      ! 
    215334   END SUBROUTINE trc_dmp_init 
     335 
    216336#else 
    217337   !!---------------------------------------------------------------------- 
    218    !!   Default key                                     NO internal damping 
    219    !!---------------------------------------------------------------------- 
    220    LOGICAL , PUBLIC, PARAMETER ::   lk_trcdmp = .FALSE.    !: internal damping flag 
     338   !!  Dummy module :                                     No passive tracer 
     339   !!---------------------------------------------------------------------- 
    221340CONTAINS 
    222341   SUBROUTINE trc_dmp( kt )        ! Empty routine 
     
    225344   END SUBROUTINE trc_dmp 
    226345#endif 
     346 
     347 
    227348   !!====================================================================== 
    228349END MODULE trcdmp 
  • branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/TOP_SRC/TRP/trcnam_trp.F90

    r3718 r4276  
    1313   !!   trc_nam_trp  : read the passive tracer namelist for transport 
    1414   !!---------------------------------------------------------------------- 
    15    USE trc                 ! ocean passive tracers variables 
     15   USE oce_trc              ! shared ocean passive tracers variables 
     16   USE trc                 ! passive tracers variables 
    1617   USE in_out_manager      ! ocean dynamics and active tracers variables 
    1718 
     
    4849   INTEGER , PUBLIC ::   nn_trczdf_exp = 3             !: number of sub-time step (explicit time stepping) 
    4950 
    50  
    51 #if defined key_trcdmp 
    5251   !                                                 !!: ** newtonian damping namelist (nam_trcdmp) ** 
    5352   INTEGER , PUBLIC ::   nn_hdmp_tr      =   -1       ! = 0/-1/'latitude' for damping over passive tracer 
     
    5756   REAL(wp), PUBLIC ::   rn_dep_tr       =  800.      ! depth of transition between rn_surf and rn_bot [meters] 
    5857   INTEGER , PUBLIC ::   nn_file_tr      =    2       ! = 1 create a damping.coeff NetCDF file  
    59 #endif 
    6058 
    6159   !!---------------------------------------------------------------------- 
     
    8280      NAMELIST/namtrc_zdf/ ln_trczdf_exp  , nn_trczdf_exp 
    8381      NAMELIST/namtrc_rad/ ln_trcrad 
    84 #if defined key_trcdmp 
    85       NAMELIST/namtrc_dmp/ ln_trcdmp, nn_hdmp_tr, nn_zdmp_tr, rn_surf_tr, & 
     82      NAMELIST/namtrc_dmp/ nn_hdmp_tr, nn_zdmp_tr, rn_surf_tr, & 
    8683        &                  rn_bot_tr , rn_dep_tr , nn_file_tr 
    87 #endif 
    8884      !!---------------------------------------------------------------------- 
    8985 
     
    148144 
    149145 
    150 # if defined key_trcdmp 
    151146      REWIND ( numnat )                  ! Read Namelist namtra_dmp : temperature and salinity damping term 
    152147      READ   ( numnat, namtrc_dmp ) 
    153       IF( lzoom )   nn_zdmp_trc = 0           ! restoring to climatology at closed north or south boundaries 
     148      IF( lzoom )   nn_zdmp_tr = 0           ! restoring to climatology at closed north or south boundaries 
    154149 
    155150      IF(lwp) THEN                       ! Namelist print 
     
    158153         WRITE(numout,*) '~~~~~~~' 
    159154         WRITE(numout,*) '   Namelist namtrc_dmp : set damping parameter' 
    160          WRITE(numout,*) '      add a damping term or not      ln_trcdmp = ', ln_trcdmp 
    161155         WRITE(numout,*) '      tracer damping option          nn_hdmp_tr = ', nn_hdmp_tr 
    162156         WRITE(numout,*) '      mixed layer damping option     nn_zdmp_tr = ', nn_zdmp_tr, '(zoom: forced to 0)' 
     
    166160         WRITE(numout,*) '      create a damping.coeff file    nn_file_tr = ', nn_file_tr 
    167161      ENDIF 
    168 #endif 
    169162      ! 
    170163   END SUBROUTINE trc_nam_trp 
  • branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/TOP_SRC/TRP/trctrp.F90

    r3680 r4276  
    6666                                CALL trc_sbc( kstp )            ! surface boundary condition 
    6767         IF( lk_trabbl )        CALL trc_bbl( kstp )            ! advective (and/or diffusive) bottom boundary layer scheme 
    68          IF( lk_trcdmp )        CALL trc_dmp( kstp )            ! internal damping trends 
     68         IF( ln_trcdmp )        CALL trc_dmp( kstp )            ! internal damping trends 
     69         IF( ln_trcdmp_clo )    CALL trc_dmp_clo( kstp )        ! internal damping trends on closed seas only 
    6970                                CALL trc_adv( kstp )            ! horizontal & vertical advection  
    7071                                CALL trc_ldf( kstp )            ! lateral mixing 
  • branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/TOP_SRC/oce_trc.F90

    r4275 r4276  
    9999   USE sbc_oce , ONLY :   emp        =>    emp        !: freshwater budget: volume flux               [Kg/m2/s] 
    100100   USE sbc_oce , ONLY :   emp_b      =>    emp_b      !: freshwater budget: volume flux               [Kg/m2/s] 
    101    USE sbc_oce , ONLY :   sfx        =>    sfx        !: downward salt flux                          [PSU/m2/s] 
     101   USE sbc_oce , ONLY :   fmmflx     =>    fmmflx     !: freshwater budget: volume flux               [Kg/m2/s] 
    102102   USE sbc_oce , ONLY :   rnf        =>    rnf        !: river runoff   [Kg/m2/s] 
    103103   USE sbc_oce , ONLY :   ln_dm2dc   =>    ln_dm2dc   !: Daily mean to Diurnal Cycle short wave (qsr)  
  • branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/TOP_SRC/trc.F90

    r3770 r4276  
    2626   INTEGER, PUBLIC                                                 ::   numrtr        !: logical unit for trc restart (read ) 
    2727   INTEGER, PUBLIC                                                 ::   numrtw        !: logical unit for trc restart ( write ) 
    28    LOGICAL, PUBLIC                                                 ::   ln_top_euler  !: boolean term for euler integration in the first timestep 
    2928 
    3029   !! passive tracers fields (before,now,after) 
     
    5352   CHARACTER(len = 80) , PUBLIC                                    ::  cn_trcrst_out  !: suffix of pass. tracer restart name (output) 
    5453   REAL(wp)            , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)   ::  rdttrc         !: vertical profile of passive tracer time step 
     54   LOGICAL             , PUBLIC                                    ::  ln_top_euler  !: boolean term for euler integration  
    5555   LOGICAL             , PUBLIC                                    ::  ln_trcdta      !: Read inputs data from files 
    5656   LOGICAL             , PUBLIC                                    ::  ln_trcdmp      !: internal damping flag 
     57   LOGICAL             , PUBLIC                                    ::  ln_trcdmp_clo  !: internal damping flag on closed seas 
    5758   INTEGER             , PUBLIC                                    ::  nittrc000       !: first time step of passive tracers model 
    5859 
     
    140141   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  fr_i_tm    !: average ice fraction     [m/s] 
    141142   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  emp_tm     !: freshwater budget: volume flux [Kg/m2/s] 
    142    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  sfx_tm     !: downward salt flux [PSU/m2/s] 
     143   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  fmmflx_tm  !: freshwater budget: freezing/melting [Kg/m2/s] 
    143144   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  emp_b_hold !: hold emp from the beginning of each sub-stepping[m]   
    144145   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  qsr_tm     !: solar radiation average [m] 
     
    180181   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::  hdivb_temp, rotb_temp 
    181182   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  hmld_temp, qsr_temp, fr_i_temp,wndm_temp 
    182    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  emp_temp, sfx_temp, emp_b_temp 
     183   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  emp_temp, fmmflx_temp, emp_b_temp 
    183184   ! 
    184185#if defined key_trabbl 
  • branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/TOP_SRC/trcdta.F90

    r3827 r4276  
    254254            ENDDO 
    255255         ENDIF 
    256          ! 
    257          IF( .NOT.ln_trcdmp ) THEN                   !==   deallocate data structure   ==!  
     256          
     257         IF( .NOT.ln_trcdmp .AND. .NOT.ln_trcdmp_clo ) THEN      !==   deallocate data structure   ==!  
    258258            !                                              (data used only for initialisation) 
    259259            IF(lwp) WRITE(numout,*) 'trc_dta: deallocate data arrays as they are only use to initialize the run' 
  • branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/TOP_SRC/trcnam.F90

    r3749 r4276  
    5959      !! 
    6060      NAMELIST/namtrc/ nn_dttrc, nn_writetrc, ln_rsttr, nn_rsttr, & 
    61          &             cn_trcrst_in, cn_trcrst_out, sn_tracer, ln_trcdta, ln_trcdmp, & 
    62          &             ln_top_euler 
     61         &             cn_trcrst_in, cn_trcrst_out, sn_tracer, ln_trcdta, & 
     62         &             ln_trcdmp, ln_trcdmp_clo, ln_top_euler 
    6363#if defined key_trdmld_trc  || defined key_trdtrc 
    6464      NAMELIST/namtrc_trd/ nn_trd_trc, nn_ctls_trc, rn_ucf_trc, & 
     
    9292         sn_tracer(jn)%llsave  = .TRUE. 
    9393      END DO 
    94       ln_trcdta = .FALSE. 
    95       ln_trcdmp = .FALSE. 
     94      ln_trcdta     = .FALSE. 
     95      ln_trcdmp     = .FALSE. 
     96      ln_trcdmp_clo = .FALSE. 
    9697 
    9798 
     
    121122         WRITE(numout,*) '   Read inputs data from file (y/n)             ln_trcdta     = ', ln_trcdta 
    122123         WRITE(numout,*) '   Damping of passive tracer (y/n)              ln_trcdmp     = ', ln_trcdmp 
     124         WRITE(numout,*) '   Restoring of tracer on closed seas           ln_trcdmp_clo = ', ln_trcdmp_clo 
    123125         WRITE(numout,*) '   Use euler integration for TRC (y/n)          ln_top_euler  = ', ln_top_euler 
    124126         WRITE(numout,*) ' ' 
     
    181183 
    182184 
    183       IF( ln_trcdmp .AND. .NOT.ln_trcdta ) THEN 
    184          CALL ctl_warn( 'trc_nam: passive tracer damping requires data from files we set ln_trcdta to TRUE' ) 
    185          ln_trcdta = .TRUE. 
    186       ENDIF 
    187       ! 
    188       IF( ln_rsttr .AND. .NOT.ln_trcdmp .AND. ln_trcdta ) THEN 
    189           CALL ctl_warn( 'trc_nam: passive tracer restart and  data intialisation, ',   & 
    190              &           'we keep the restart values and set ln_trcdta to FALSE' ) 
    191          ln_trcdta = .FALSE. 
    192       ENDIF 
     185      IF( ln_rsttr )                      ln_trcdta = .FALSE.   ! restart : no need of clim data 
     186      ! 
     187      IF( ln_trcdmp .OR. ln_trcdmp_clo )  ln_trcdta = .TRUE.   ! damping : need to have clim data 
    193188      ! 
    194189      IF( .NOT.ln_trcdta ) THEN 
     
    199194         IF( ln_rsttr ) THEN 
    200195            WRITE(numout,*) 
    201             WRITE(numout,*) '    read a restart file for passive tracer : ', TRIM( cn_trcrst_in ) 
    202             WRITE(numout,*) 
    203          ELSE 
    204             IF( .NOT.ln_trcdta ) THEN 
    205                 WRITE(numout,*) 
    206                 WRITE(numout,*) '  All the passive tracers are initialised with constant values ' 
    207                 WRITE(numout,*) 
    208             ENDIF 
     196            WRITE(numout,*) '  Read a restart file for passive tracer : ', TRIM( cn_trcrst_in ) 
     197            WRITE(numout,*) 
     198         ENDIF 
     199         IF( ln_trcdta .AND. .NOT.ln_rsttr ) THEN 
     200            WRITE(numout,*) 
     201            WRITE(numout,*) '  Some of the passive tracers are initialised from climatologies ' 
     202            WRITE(numout,*) 
     203         ENDIF 
     204         IF( .NOT.ln_trcdta ) THEN 
     205            WRITE(numout,*) 
     206            WRITE(numout,*) '  All the passive tracers are initialised with constant values ' 
     207            WRITE(numout,*) 
    209208         ENDIF 
    210209      ENDIF 
  • branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/TOP_SRC/trcsub.F90

    r4236 r4276  
    123123          fr_i_tm  (:,:)         = fr_i_tm  (:,:)         + fr_i  (:,:) 
    124124          emp_tm   (:,:)         = emp_tm   (:,:)         + emp   (:,:)  
    125           sfx_tm   (:,:)         = sfx_tm   (:,:)         + sfx   (:,:) 
     125          fmmflx_tm(:,:)         = fmmflx_tm(:,:)         + fmmflx(:,:) 
    126126          qsr_tm   (:,:)         = qsr_tm   (:,:)         + qsr   (:,:) 
    127127          wndm_tm  (:,:)         = wndm_tm  (:,:)         + wndm  (:,:) 
     
    211211         emp_temp   (:,:)        = emp   (:,:) 
    212212         emp_b_temp (:,:)        = emp_b (:,:) 
    213          sfx_temp   (:,:)        = sfx   (:,:) 
     213         fmmflx_temp(:,:)        = fmmflx(:,:) 
    214214         qsr_temp   (:,:)        = qsr   (:,:) 
    215215         wndm_temp  (:,:)        = wndm  (:,:) 
     
    315315         fr_i_tm  (:,:)          = fr_i_tm    (:,:)       + fr_i  (:,:) 
    316316         emp_tm   (:,:)          = emp_tm     (:,:)       + emp   (:,:)  
    317          sfx_tm   (:,:)          = sfx_tm     (:,:)       + sfx   (:,:) 
     317         fmmflx_tm(:,:)          = fmmflx_tm  (:,:)       + fmmflx(:,:) 
    318318         qsr_tm   (:,:)          = qsr_tm     (:,:)       + qsr   (:,:) 
    319319         wndm_tm  (:,:)          = wndm_tm    (:,:)       + wndm  (:,:) 
     
    334334            qsr   (:,:)          = qsr_tm     (:,:) * r1_ndttrc  
    335335            emp   (:,:)          = emp_tm     (:,:) * r1_ndttrc  
    336             sfx   (:,:)          = sfx_tm     (:,:) * r1_ndttrc  
     336            fmmflx(:,:)          = fmmflx_tm  (:,:) * r1_ndttrc  
    337337            fr_i  (:,:)          = fr_i_tm    (:,:) * r1_ndttrc 
    338338# if defined key_trabbl 
     
    350350            qsr   (:,:)          = qsr_tm     (:,:) * r1_ndttrcp1  
    351351            emp   (:,:)          = emp_tm     (:,:) * r1_ndttrcp1  
    352             sfx   (:,:)          = sfx_tm     (:,:) * r1_ndttrcp1  
     352            fmmflx(:,:)          = fmmflx_tm  (:,:) * r1_ndttrcp1  
    353353            fr_i  (:,:)          = fr_i_tm    (:,:) * r1_ndttrcp1  
    354354# if defined key_trabbl 
     
    500500         CALL lbc_lnk( emp   (:,:)         , 'T', 1. )  
    501501         CALL lbc_lnk( emp_b (:,:)         , 'T', 1. )  
    502          CALL lbc_lnk( sfx   (:,:)         , 'T', 1. )  
     502         CALL lbc_lnk( fmmflx(:,:)         , 'T', 1. )  
    503503         CALL lbc_lnk( qsr   (:,:)         , 'T', 1. )  
    504504         CALL lbc_lnk( wndm  (:,:)         , 'T', 1. )  
     
    600600      fr_i_tm(:,:) = 0._wp 
    601601      emp_tm (:,:) = 0._wp 
    602       sfx_tm(:,:)  = 0._wp 
     602      fmmflx_tm(:,:)  = 0._wp 
    603603      qsr_tm (:,:) = 0._wp 
    604604      wndm_tm(:,:) = 0._wp 
     
    707707      fr_i  (:,:)     =  fr_i_temp  (:,:) 
    708708      emp   (:,:)     =  emp_temp   (:,:) 
    709       sfx   (:,:)     =  sfx_temp   (:,:) 
     709      fmmflx(:,:)     =  fmmflx_temp(:,:) 
    710710      emp_b (:,:)     =  emp_b_temp (:,:) 
    711711      qsr   (:,:)     =  qsr_temp   (:,:) 
     
    826826      fr_i_tm    (:,:) = fr_i  (:,:) 
    827827      emp_tm     (:,:) = emp   (:,:) 
    828       sfx_tm     (:,:) = sfx   (:,:) 
     828      fmmflx_tm  (:,:) = fmmflx(:,:) 
    829829      qsr_tm     (:,:) = qsr   (:,:) 
    830830      wndm_tm    (:,:) = wndm  (:,:) 
     
    10551055         &      rnf_temp(jpi,jpj)           ,  h_rnf_temp(jpi,jpj) ,     & 
    10561056         &      tsn_temp(jpi,jpj,jpk,2)     ,  emp_b_temp(jpi,jpj),      & 
    1057          &      emp_temp(jpi,jpj)           ,  sfx_temp(jpi,jpj)  ,      & 
     1057         &      emp_temp(jpi,jpj)           ,  fmmflx_temp(jpi,jpj),     & 
    10581058         &      hmld_temp(jpi,jpj)          ,  qsr_temp(jpi,jpj) ,       & 
    10591059         &      fr_i_temp(jpi,jpj)          ,  fr_i_tm(jpi,jpj) ,        & 
     
    11031103         &      sshv_n_tm(jpi,jpj)          ,  sshv_b_hold(jpi,jpj),     & 
    11041104         &      tsn_tm(jpi,jpj,jpk,2)       ,                            & 
    1105          &      emp_tm(jpi,jpj)             ,  sfx_tm(jpi,jpj)  ,        & 
     1105         &      emp_tm(jpi,jpj)             ,  fmmflx_tm(jpi,jpj)  ,     & 
    11061106         &      emp_b_hold(jpi,jpj)         ,                            & 
    11071107         &      hmld_tm(jpi,jpj)            ,  qsr_tm(jpi,jpj) ,         & 
  • branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/SETTE/iodef_sette.xml

    r3764 r4276  
    2121    --> 
    2222     
    23     <file_definition type="multiple_file" sync_freq="1d" min_digits="4"> 
     23    <file_definition type="multiple_file" name="@expname@_@freq@_@startdate@_@enddate@" sync_freq="1d" min_digits="4"> 
    2424     
    2525      <file_group id="1h" output_freq="1h"  output_level="10" enabled=".FALSE."/> <!-- 1h files --> 
     
    5454     
    5555   <axis_definition>   
    56       <axis id="deptht" long_name="Vertical T levels" unit="m"  /><!-- positive=".FALSE." --> 
    57       <axis id="depthu" long_name="Vertical U levels" unit="m"  /><!-- positive=".FALSE." --> 
    58       <axis id="depthv" long_name="Vertical V levels" unit="m"  /><!-- positive=".FALSE." --> 
    59       <axis id="depthw" long_name="Vertical W levels" unit="m"  /><!-- positive=".FALSE." --> 
     56      <axis id="deptht" long_name="Vertical T levels" unit="m" positive="down" /> 
     57      <axis id="depthu" long_name="Vertical U levels" unit="m" positive="down" /> 
     58      <axis id="depthv" long_name="Vertical V levels" unit="m" positive="down" /> 
     59      <axis id="depthw" long_name="Vertical W levels" unit="m" positive="down" /> 
    6060      <axis id="nfloat" long_name="Float number"      unit="-"  /> 
     61      <axis id="icbcla" long_name="Iceberg class"     unit="-"  /> 
    6162   </axis_definition>  
    6263     
  • branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/TOOLS/COMPILE/Fcheck_archfile.sh

    r3294 r4276  
    4040# :: 
    4141# 
    42 #  $ ./Fcheck_archfile.sh ARCHFILE COMPILER 
     42#  $ ./Fcheck_archfile.sh ARCHFILE CPPFILE COMPILER 
    4343# 
    4444# 
     
    5959# 
    6060#- 
     61cpeval ()  
     62{ 
     63    cat > $2 << EOF 
    6164 
    62 if [ ${#2} -eq 0 ]; then 
    63    if [ ! -f ${COMPIL_DIR}/$1 ]; then 
    64    echo "Warning !!!" 
    65    echo "NO compiler chosen" 
    66    echo "Try makenemo -h for help" 
    67    echo "EXITING..." 
    68    exit 1  
    69    fi 
     65#========================================================== 
     66#    Automatically generated by Fcheck_archfile.sh from 
     67#    $1 
     68#========================================================== 
     69 
     70EOF 
     71    while read line   
     72    do   
     73   eval "echo \"$line\" >> $2" 
     74    done < $1 
     75} 
     76# cleaning related to the old version 
     77rm -f $( find ${COMPIL_DIR} -type l -name $1 -print ) 
     78# 
     79if [ ${#3} -eq 0 ]; then # arch not specified 
     80    if [ ! -f ${COMPIL_DIR}/arch.history ]; then 
     81   echo "Warning !!!" 
     82   echo "NO compiler chosen" 
     83   echo "Try makenemo -h for help" 
     84   echo "EXITING..." 
     85   exit 1  
     86    else # use the arch file defined in arch.history 
     87   myarch=$( cat ${COMPIL_DIR}/arch.history )    
     88   if [ ! -f $myarch ]; then 
     89       echo "Warning !!!" 
     90       echo "previously used arch file no more found:" 
     91       echo $myarch 
     92       echo "EXITING..." 
     93       exit 1  
     94   else 
     95       if [ -f ${COMPIL_DIR}/$1 ]; then 
     96      if [ "$2" != "nocpp" ]  
     97      then 
     98          # has the cpp keys file been changed since we copied the arch file in ${COMPIL_DIR}? 
     99          mycpp=$( ls -l ${COMPIL_DIR}/$2 | sed -e "s/.* -> //" ) 
     100          if [ "$mycpp" != "$( cat ${COMPIL_DIR}/cpp.history )" ]; then 
     101         echo $mycpp > ${COMPIL_DIR}/cpp.history 
     102         cpeval ${myarch} ${COMPIL_DIR}/$1 
     103          fi 
     104          # has the cpp keys file been updated since we copied the arch file in ${COMPIL_DIR}? 
     105          mycpp=$( find -L ${COMPIL_DIR} -cnewer ${COMPIL_DIR}/$1 -name $2 -print ) 
     106          [ ${#mycpp} -ne 0 ] && cpeval ${myarch} ${COMPIL_DIR}/$1 
     107      fi 
     108      # has myarch file been updated since we copied it in ${COMPIL_DIR}? 
     109      myarchdir=$( dirname ${myarch} ) 
     110      myarchname=$( basename ${myarch} ) 
     111      myarch=$( find -L $myarchdir -cnewer ${COMPIL_DIR}/$1 -name $myarchname -print ) 
     112      [ ${#myarch} -ne 0 ] && cpeval ${myarch} ${COMPIL_DIR}/$1 
     113       else 
     114      cpeval ${myarch} ${COMPIL_DIR}/$1 
     115       fi 
     116   fi 
     117    fi 
     118else  
     119    nb=$( find ${MAIN_DIR}/ARCH -name arch-${3}.fcm -print | wc -l ) 
     120    if [ $nb -eq 0 ]; then # no arch file found 
     121   echo "Warning !!!" 
     122   echo "Compiler not existing" 
     123   echo "Try makenemo -h for help" 
     124   echo "EXITING..." 
     125   exit 1        
     126    fi 
     127    if [ $nb -gt 1 ]; then # more than 1 arch file found 
     128   echo "Warning !!!" 
     129   echo "more than 1 arch file for the same compiler have been found" 
     130   find ${MAIN_DIR}/ARCH -name arch-${3}.fcm -print 
     131   echo "keep only 1" 
     132   echo "EXITING..." 
     133   exit 1        
     134    fi 
     135    myarch=$( find ${MAIN_DIR}/ARCH -name arch-${3}.fcm -print ) 
     136    # we were already using this arch file ? 
     137    if [ "$myarch" == "$( cat ${COMPIL_DIR}/arch.history )" ]; then  
     138   if [ -f ${COMPIL_DIR}/$1 ]; then 
     139       if [ "$2" != "nocpp" ]  
     140       then 
     141      # has the cpp keys file been changed since we copied the arch file in ${COMPIL_DIR}? 
     142      mycpp=$( ls -l ${COMPIL_DIR}/$2 | sed -e "s/.* -> //" ) 
     143      if [ "$mycpp" != "$( cat ${COMPIL_DIR}/cpp.history )" ]; then 
     144          echo $mycpp > ${COMPIL_DIR}/cpp.history 
     145          cpeval ${myarch} ${COMPIL_DIR}/$1 
     146      fi 
     147      # has the cpp keys file been updated since we copied the arch file in ${COMPIL_DIR}? 
     148      mycpp=$( find -L ${COMPIL_DIR} -cnewer ${COMPIL_DIR}/$1 -name $2 -print ) 
     149      [ ${#mycpp} -ne 0 ] && cpeval ${myarch} ${COMPIL_DIR}/$1 
     150       fi 
     151       # has myarch file been updated since we copied it in ${COMPIL_DIR}? 
     152       myarch=$( find -L ${MAIN_DIR}/ARCH -cnewer ${COMPIL_DIR}/$1 -name arch-${3}.fcm -print ) 
     153       [ ${#myarch} -ne 0 ] && cpeval ${myarch} ${COMPIL_DIR}/$1 
     154   else 
     155       cpeval ${myarch} ${COMPIL_DIR}/$1 
     156   fi 
     157    else 
     158   if [ "$2" != "nocpp" ]  
     159   then 
     160       ls -l ${COMPIL_DIR}/$2 | sed -e "s/.* -> //" > ${COMPIL_DIR}/cpp.history 
     161   fi 
     162   echo ${myarch} > ${COMPIL_DIR}/arch.history 
     163   cpeval ${myarch} ${COMPIL_DIR}/$1 
     164    fi 
     165fi 
     166 
     167#- do we need xios library? 
     168if [ "$2" != "nocpp" ]  
     169then 
     170    use_iom=$( sed -e "s/#.*$//" ${COMPIL_DIR}/$2 | grep -c key_iomput ) 
    70171else 
    71    myfile=$( find ${MAIN_DIR}/ARCH -name arch-${2}.fcm -print ) 
    72    if [ ${#myfile} -gt 0 ]; then 
    73       ln -sf  ${myfile} ${COMPIL_DIR}/$1 
    74    else 
    75       echo "Warning !!!" 
    76       echo "Compiler not existing" 
    77       echo "Try makenemo -h for help" 
    78       echo "EXITING..." 
    79       exit 1        
    80    fi    
     172    use_iom=0 
    81173fi 
     174have_lxios=$( sed -e "s/#.*$//" ${COMPIL_DIR}/$1 | grep -c "\-lxios" ) 
     175if [[ ( $use_iom -eq 0 ) && ( $have_lxios -ge 1 ) ]] 
     176then  
     177    sed -e "s/-lxios//g" ${COMPIL_DIR}/$1 > ${COMPIL_DIR}/tmp$$ 
     178    mv -f ${COMPIL_DIR}/tmp$$ ${COMPIL_DIR}/$1 
     179fi 
     180 
     181#- do we need oasis libraries? 
     182if [ "$2" != "nocpp" ]  
     183then 
     184    use_oasis=$( sed -e "s/#.*$//" ${COMPIL_DIR}/$2 | grep -c key_oasis3 ) 
     185else 
     186    use_oasis=0 
     187fi 
     188for liboa in psmile.MPI1 mct mpeu scrip mpp_io 
     189do 
     190    have_liboa=$( sed -e "s/#.*$//" ${COMPIL_DIR}/$1 | grep -c "\-l${liboa}" ) 
     191    if [[ ( $use_oasis -eq 0 ) && ( $have_liboa -ge 1 ) ]] 
     192    then  
     193   sed -e "s/-l${liboa}//g" ${COMPIL_DIR}/$1 > ${COMPIL_DIR}/tmp$$ 
     194   mv -f ${COMPIL_DIR}/tmp$$ ${COMPIL_DIR}/$1 
     195    fi 
     196done 
     197 
  • branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/TOOLS/COMPILE/Flist_archfile.sh

    r3294 r4276  
    6161 
    6262echo "Available compilers for -m option :" 
    63 for file in  $(ls ${MAIN_DIR}/ARCH | grep fcm ) 
     63for file in  $(ls ${MAIN_DIR}/ARCH | grep "fcm$" ) 
    6464do 
    6565zvar1=${file#arch-} 
     
    7171 
    7272if [ "$1" == "all" ]; then 
    73    for dir  in  $(ls ${MAIN_DIR}/ARCH | grep -v fcm ) 
     73   for dir  in  $(ls ${MAIN_DIR}/ARCH | grep -v "fcm$" ) 
    7474   do  
    7575      echo "Available compilers at ${dir} :" 
    76       for file in  $(ls ${MAIN_DIR}/ARCH/${dir} | grep  fcm ) 
     76      for file in  $(ls ${MAIN_DIR}/ARCH/${dir} | grep "fcm$" ) 
    7777      do 
    7878      zvar1=${file#arch-} 
     
    8484elif [ -d ${MAIN_DIR}/ARCH/${1} ]; then 
    8585      echo "Available compilers at $1 :" 
    86       for file in  $(ls ${MAIN_DIR}/ARCH/$1 | grep fcm ) 
     86      for file in  $(ls ${MAIN_DIR}/ARCH/$1 | grep "fcm$" ) 
    8787      do 
    8888      zvar1=${file#arch-} 
     
    9393else 
    9494      echo "Available consortium member sub-directories :" 
    95       for dir  in  $(ls ${MAIN_DIR}/ARCH | grep -v fcm ) 
     95      for dir  in  $(ls ${MAIN_DIR}/ARCH | grep -v "fcm$" ) 
    9696      do 
    9797         echo ${dir} 
  • branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/TOOLS/MISCELLANEOUS/chk_iomput.sh

    r2404 r4276  
    3535       echo ' --insrc              only print all variable definitions found in the source code' 
    3636       echo 'Examples' 
    37        echo '      chk_iomput.sh' 
    38        echo '      chk_iomput.sh --help' 
    39        echo '      chk_iomput.sh ../../CONFIG/ORCA2_LIM/EXP00/iodef.xml "../../NEMO/OPA_SRC/ ../../NEMO/LIM_SRC_2/"' 
     37       echo '      ./chk_iomput.sh' 
     38       echo '      ./chk_iomput.sh --help' 
     39       echo '      ./chk_iomput.sh ../../CONFIG/ORCA2_LIM/EXP00/iodef.xml "../../NEMO/OPA_SRC/ ../../NEMO/LIM_SRC_2/"' 
    4040       echo 
    4141       exit ;; 
     
    5959#------------------------------------------------ 
    6060# 
    61 [ $inxml -eq 1 ] && grep "< *field * id *=" $xmlfile 
     61external=$( grep -c "<field_definition  *\([^ ].* \)*src=" $xmlfile ) 
     62if [ $external -eq 1 ] 
     63then 
     64    xmlfield_def=$( grep "<field_definition  *\([^ ].* \)*src=" $xmlfile | sed -e 's/.*src="\([^"]*\)".*/\1/' ) 
     65    xmlfield_def=$( dirname $xmlfile )/$xmlfield_def    
     66else 
     67    xmlfield_def=$xmlfile 
     68fi 
     69[ $inxml -eq 1 ] && grep "< *field  *\([^ ].* \)*id *=" $xmlfield_def 
    6270[ $insrc -eq 1 ] && find $srcdir -name "*.[Ffh]90" -exec grep -iH "^[^\!]*call  *iom_put *(" {} \; 
    6371[ $(( $insrc + $inxml )) -ge 1 ] && exit 
     
    7179# list of variables used in "CALL iom_put" 
    7280# 
    73 varlistsrc=$( find $srcdir -name "*.[Ffh]90" -exec grep -i  "^[^\!]*call  *iom_put *(" {} \; | sed -e "s/.*iom_put *( *[\"\']\([^\"\']*\)[\"\'] *,.*/\1/" | sort -d ) 
     81badvarsrc=$( find $srcdir -name "*.[Ffh]90" -exec grep -i  "^[^\!]*call  *iom_put *(" {} \; | sed -e "s/.*iom_put *( *[\"\']\([^\"\']*\)[\"\'] *,.*/\1/" | grep -ic iom_put ) 
     82if [ $badvarsrc -ne 0 ] 
     83then 
     84    echo "The following call to iom_put cannot be checked" 
     85    echo 
     86    find $srcdir -name "*.[Ffh]90" -exec grep -i  "^[^\!]*call  *iom_put *(" {} \; | sed -e "s/.*iom_put *( *[\"\']\([^\"\']*\)[\"\'] *,.*/\1/" | grep -i iom_put | sort -d  
     87    echo 
     88fi 
     89varlistsrc=$( find $srcdir -name "*.[Ffh]90" -exec grep -i  "^[^\!]*call  *iom_put *(" {} \; | sed -e "s/.*iom_put *( *[\"\']\([^\"\']*\)[\"\'] *,.*/\1/" | grep -vi iom_put | sort -d ) 
    7490# 
    7591# list of variables defined in the xml file 
    7692# 
    77 varlistxml=$( grep "< *field * id *=" $xmlfile  | sed -e "s/^.*< *field * id *= *[\"\']\([^\"\']*\)[\"\'].*/\1/" | sort -d ) 
     93varlistxml=$( grep "< *field  *\([^ ].* \)*id *=" $xmlfield_def  | sed -e "s/^.*< *field .*id *= *[\"\']\([^\"\']*\)[\"\'].*/\1/" | sort -d ) 
    7894# 
    7995# list of variables to be outputed in the xml file 
    8096# 
    81 varlistout=$( grep "< *field * ref *=" $xmlfile  | sed -e "s/^.*< *field * ref *= *[\"\']\([^\"\']*\)[\"\'].*/\1/" | sort -d ) 
     97varlistout=$( grep "< *field  *\([^ ].* \)*field_ref *=" $xmlfile  | sed -e "s/^.*< *field .*field_ref *= *[\"\']\([^\"\']*\)[\"\'].*/\1/" | sort -d ) 
    8298# 
    8399echo "--------------------------------------------------" 
    84100echo  check if all iom_put found in $srcdir 
    85 echo  have a corresponding variable definition in $xmlfile 
     101echo  have a corresponding variable definition in $xmlfield_def 
    86102echo "--------------------------------------------------" 
    87103for var in $varlistsrc 
     
    90106    if [ $tst -ne 1 ]  
    91107    then 
    92    echo "problem with $var: $tst lines corresponding to its definition in $xmlfile, but defined in the code in" 
     108   echo "problem with $var: $tst lines corresponding to its definition in $xmlfield_def, but defined in the code in" 
    93109   for f in $srclist 
    94110   do 
  • branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/TOOLS/maketools

    r3294 r4276  
    146146 
    147147#- When used for the first time, choose a compiler --- 
    148 . ${COMPIL_DIR}/Fcheck_archfile.sh arch_tools.fcm ${CMP_NAM} || exit 
     148. ${COMPIL_DIR}/Fcheck_archfile.sh arch_tools.fcm nocpp ${CMP_NAM} || exit 
    149149 
    150150#- Choose a default tool if needed --- 
Note: See TracChangeset for help on using the changeset viewer.