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 10115 for NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM – NEMO

Ignore:
Timestamp:
2018-09-12T15:59:13+02:00 (6 years ago)
Author:
cbricaud
Message:

phase 3.6 coarsening branch with nemo_3.6_rev9192

Location:
NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM
Files:
1 added
1 deleted
154 edited
4 copied

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/ARCH/INGV/arch-IBM_EKMAN_INGV.fcm

    r7258 r10115  
    3434%USER_INC            -I%XIOS_ROOT/inc %NCDF_INC %MPI_INTEL -I/srv/lib/zlib-last/include 
    3535%USER_LIB            -L%XIOS_ROOT/lib -lxios %NCDF_LIB -L/srv/lib/zlib-last/lib -lz 
     36%CC                  icc 
     37%CFLAGS              -O0 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/CONFIG/AMM12/EXP00/namelist_cfg

    • Property svn:mime-type set to text/x-fortran
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/CONFIG/C1D_PAPA/EXP00/namelist_cfg

    • Property svn:mime-type set to text/x-fortran
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/CONFIG/GYRE/EXP00/namelist_cfg

    • Property svn:mime-type set to text/x-fortran
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/CONFIG/GYRE_BFM/EXP00/namelist_cfg

    • Property svn:mime-type set to text/x-fortran
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/CONFIG/GYRE_BFM/EXP00/namelist_top_cfg

    • Property svn:mime-type set to text/x-fortran
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/CONFIG/GYRE_PISCES/EXP00/namelist_cfg

    • Property svn:mime-type set to text/x-fortran
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/CONFIG/GYRE_PISCES/EXP00/namelist_pisces_cfg

    • Property svn:mime-type set to text/x-fortran
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/CONFIG/GYRE_PISCES/EXP00/namelist_top_cfg

    • Property svn:mime-type set to text/x-fortran
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/CONFIG/GYRE_XIOS/EXP00/namelist_cfg

    • Property svn:mime-type set to text/x-fortran
    r7257 r10115  
    192192!----------------------------------------------------------------------- 
    193193   nn_eos      =   0       !  type of equation of state and Brunt-Vaisala frequency 
     194   ln_useCT    = .false.   ! use of Conservative Temp. ==> surface CT converted in Pot. Temp. in sbcssm 
    194195/ 
    195196!----------------------------------------------------------------------- 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/CONFIG/ORCA2_LIM/EXP00/namelist_cfg

    • Property svn:mime-type set to text/x-fortran
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/CONFIG/ORCA2_LIM/EXP00/namelist_ice_cfg

    • Property svn:mime-type set to text/x-fortran
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/CONFIG/ORCA2_LIM3/EXP00/namelist_cfg

    • Property svn:mime-type set to text/x-fortran
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/CONFIG/ORCA2_LIM3/EXP00/namelist_ice_cfg

    • Property svn:mime-type set to text/x-fortran
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/CONFIG/ORCA2_LIM_CFC_C14b/EXP00/iodef.xml

    r5602 r10115  
    7474     <field field_ref="iceprod_cea"  name="sip" /> 
    7575     <field field_ref="ist_ipa"    /> 
    76      <field field_ref="ioceflxb"   /> 
    7776     <field field_ref="uice_ipa"   /> 
    7877     <field field_ref="vice_ipa"   /> 
     
    8685 
    8786   <file id="file6" name_suffix="_ptrc_T" description="sms variables" > 
    88           <field field_ref="CFC11" /> 
    89           <field field_ref="C14B"  /> 
     87          <field field_ref="CFC12" /> 
     88          <field field_ref="SF6" /> 
     89          <field field_ref="C14B" /> 
     90          <field field_ref="Age"  /> 
    9091   </file> 
    9192    
    9293   <file id="file7" name_suffix="_diad_T" description="additional diagnostics" > 
    93           <field field_ref="qtrCFC11"  /> 
    94           <field field_ref="qintCFC11" /> 
    95           <field field_ref="qtrC14b"   /> 
    96           <field field_ref="qintC14b"  /> 
     94          <field field_ref="qtr_CFC12"  /> 
     95          <field field_ref="qint_CFC12" /> 
     96          <field field_ref="qtr_SF6"  /> 
     97          <field field_ref="qint_SF6" /> 
     98          <field field_ref="qtr_C14b"   /> 
     99          <field field_ref="qint_C14b"  /> 
    97100          <field field_ref="fdecay"    /> 
    98101   </file> 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/CONFIG/ORCA2_LIM_CFC_C14b/EXP00/namelist_c14b_cfg

    • Property svn:mime-type set to text/x-fortran
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/CONFIG/ORCA2_LIM_CFC_C14b/EXP00/namelist_cfc_cfg

    • Property svn:mime-type set to text/x-fortran
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/CONFIG/ORCA2_LIM_CFC_C14b/EXP00/namelist_cfg

    • Property svn:mime-type set to text/x-fortran
    r7261 r10115  
    4747&namdom        !   space and time domain (bathymetry, mesh, timestep) 
    4848!----------------------------------------------------------------------- 
     49   nn_msh      =    0      !  create (=1) a mesh file or not (=0) 
    4950   jphgr_msh   =       0               !  type of horizontal mesh 
    5051   ppglam0     =  999999.0             !  longitude of first raw and column T-point (jphgr_msh = 1) 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/CONFIG/ORCA2_LIM_CFC_C14b/EXP00/namelist_ice_cfg

    • Property svn:mime-type set to text/x-fortran
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/CONFIG/ORCA2_LIM_CFC_C14b/EXP00/namelist_top_cfg

    • Property svn:mime-type set to text/x-fortran
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/CONFIG/ORCA2_LIM_CFC_C14b/cpp_ORCA2_LIM_CFC_C14b.fcm

    r4523 r10115  
    1 bld::tool::fppkeys key_trabbl key_lim2 key_dynspg_flt key_diaeiv key_ldfslp key_traldf_c2d key_traldf_eiv key_dynldf_c3d key_zdftke key_zdfddm key_zdftmx key_top key_cfc key_c14b key_iomput key_mpp_mpi 
     1bld::tool::fppkeys key_trabbl key_lim2 key_dynspg_flt key_diaeiv key_ldfslp key_traldf_c2d key_traldf_eiv key_dynldf_c3d key_zdftke key_zdfddm key_zdftmx key_top key_cfc key_c14b key_age key_iomput key_mpp_mpi 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/CONFIG/ORCA2_LIM_PISCES/EXP00/namelist_cfg

    • Property svn:mime-type set to text/x-fortran
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/CONFIG/ORCA2_LIM_PISCES/EXP00/namelist_ice_cfg

    • Property svn:mime-type set to text/x-fortran
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/CONFIG/ORCA2_LIM_PISCES/EXP00/namelist_pisces_cfg

    • Property svn:mime-type set to text/x-fortran
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/CONFIG/ORCA2_LIM_PISCES/EXP00/namelist_top_cfg

    • Property svn:mime-type set to text/x-fortran
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/CONFIG/ORCA2_OFF_PISCES/EXP00/namelist_cfg

    • Property svn:mime-type set to text/x-fortran
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/CONFIG/ORCA2_OFF_PISCES/EXP00/namelist_pisces_cfg

    • Property svn:mime-type set to text/x-fortran
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/CONFIG/ORCA2_OFF_PISCES/EXP00/namelist_top_cfg

    • Property svn:mime-type set to text/x-fortran
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/CONFIG/ORCA2_SAS_LIM/EXP00/namelist_cfg

    • Property svn:mime-type set to text/x-fortran
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/CONFIG/ORCA2_SAS_LIM/EXP00/namelist_ice_cfg

    • Property svn:mime-type set to text/x-fortran
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/CONFIG/SHARED/field_def.xml

    r7261 r10115  
    2323      <field_group id="grid_T" grid_ref="grid_T_2D" > 
    2424         <field id="e3t"          long_name="T-cell thickness"   standard_name="cell_thickness"   unit="m"   grid_ref="grid_T_3D"/> 
     25         <field id="e3t_surf"     long_name="T-cell thickness"   field_ref="e3t"  standard_name="cell_thickness"   unit="m"   grid_ref="grid_T_surface_extract"/> 
    2526         <field id="e3t_0"        long_name="Initial T-cell thickness"   standard_name="ref_cell_thickness"   unit="m"   grid_ref="grid_T_3D"/> 
    2627 
    27          <field id="toce"         long_name="temperature"         standard_name="sea_water_potential_temperature"   unit="degC"     grid_ref="grid_T_3D"/> 
    28          <field id="toce_e3t"     long_name="temperature * e3t"                                                     unit="degC*m"   grid_ref="grid_T_3D" > toce * e3t </field > 
    29          <field id="soce"         long_name="salinity"            standard_name="sea_water_practical_salinity"      unit="1e-3"     grid_ref="grid_T_3D"/> 
    30          <field id="soce_e3t"     long_name="salinity * e3t"                                                        unit="1e-3*m"   grid_ref="grid_T_3D" > soce * e3t </field > 
    31  
    32          <field id="ocean_volume_crs_t"          long_name="ocean_volume_crs_t"                                       unit="m^3"  grid_ref="grid_T_3D"/> 
    33          <field id="rabt"          long_name="rabt"                                       unit="degC"  grid_ref="grid_T_3D"/> 
    34          <field id="rabs"          long_name="rabs"                                       unit="degC"  grid_ref="grid_T_3D"/> 
    35          <field id="rhd"          long_name="rhd"                                       unit="degC"  grid_ref="grid_T_3D"/> 
    36          <field id="rhd_crs"      long_name="rhd_crs"                                   unit="degC"  grid_ref="grid_T_3D"/> 
    37          <field id="rn2"         long_name="rn2"                                      unit="degC"  grid_ref="grid_T_3D"/> 
    38          <field id="rn2b"         long_name="rn2b"                                      unit="degC"  grid_ref="grid_T_3D"/> 
    39          <field id="rb2_crs"      long_name="rb2_crs"                                   unit="degC"  grid_ref="grid_T_3D"/> 
    40          <field id="rhop_crs"         long_name="potential density (sigma0)"                unit="kg/m3"  grid_ref="grid_T_3D"/> 
    41  
    42          <field id="sst"          long_name="sea surface temperature"             standard_name="sea_surface_temperature"             unit="degC"     /> 
    43          <field id="sst2"         long_name="square of sea surface temperature"   standard_name="square_of_sea_surface_temperature"   unit="degC2"     > sst * sst </field > 
     28         <field id="toce"         long_name="Sea Water Potential Temperature"         standard_name="sea_water_potential_temperature"   unit="degree_C"     grid_ref="grid_T_3D"/> 
     29         <field id="toce_e3t"     long_name="temperature * e3t"                                                     unit="degree_C*m"   grid_ref="grid_T_3D" > toce * e3t </field > 
     30         <field id="soce"         long_name="Sea Water Salinity"            standard_name="sea_water_salinity"      unit="0.001"     grid_ref="grid_T_3D"/> 
     31         <field id="soce_e3t"     long_name="salinity * e3t"                                                        unit="0.001*m"   grid_ref="grid_T_3D" > soce * e3t </field > 
     32 
     33         <field id="sst"          long_name="Sea Surface Temperature"             standard_name="sea_surface_temperature"             unit="degree_C"     /> 
     34         <field id="sst2"         long_name="Square of Sea Surface Temperature"   standard_name="square_of_sea_surface_temperature"   unit="degree_C2"     > sst * sst </field > 
    4435         <field id="sstmax"       long_name="max of sea surface temperature"   field_ref="sst"   operation="maximum"                                  /> 
    4536         <field id="sstmin"       long_name="min of sea surface temperature"   field_ref="sst"   operation="minimum"                                  /> 
    46          <field id="sstgrad"      long_name="module of sst gradient"                                                                  unit="degC/m"   /> 
    47          <field id="sstgrad2"     long_name="square of module of sst gradient"                                                        unit="degC2/m2" /> 
    48          <field id="sbt"          long_name="sea bottom temperature"                                                                  unit="degC"     /> 
     37         <field id="sstgrad"      long_name="module of sst gradient"                                                                  unit="degree_C/m"   /> 
     38         <field id="sstgrad2"     long_name="square of module of sst gradient"                                                        unit="degree_C2/m2" /> 
     39         <field id="sbt"          long_name="sea bottom temperature"                                                                  unit="degree_C"     /> 
     40         <field id="tosmint"      long_name="vertical integral of temperature times density"   standard_name="integral_wrt_depth_of_product_of_density_and_potential_temperature"  unit="(kg m2) degree_C" /> 
    4941     
    50          <field id="sss"          long_name="sea surface salinity"             standard_name="sea_surface_salinity"   unit="1e-3" /> 
     42         <field id="sss"          long_name="Sea Surface Salinity"             standard_name="sea_surface_salinity"   unit="0.001" /> 
    5143         <field id="sss2"         long_name="square of sea surface salinity"                                          unit="1e-6"  > sss * sss </field > 
    5244         <field id="sssmax"       long_name="max of sea surface salinity"   field_ref="sss"   operation="maximum"                 /> 
    5345         <field id="sssmin"       long_name="min of sea surface salinity"   field_ref="sss"   operation="minimum"                 /> 
    54          <field id="sbs"          long_name="sea bottom salinity"                                                     unit="1e-3" /> 
     46         <field id="sbs"          long_name="sea bottom salinity"                                                     unit="0.001" /> 
     47         <field id="somint"       long_name="vertical integral of salinity times density"   standard_name="integral_wrt_depth_of_product_of_density_and_salinity"  unit="(kg m2) x (1e-3)" />  
    5548 
    5649         <field id="taubot"       long_name="bottom stress module"                                                    unit="N/m2" />  
     
    6558         <field id="mldr10_1min"  long_name="Min of Mixed Layer Depth (dsigma = 0.01 wrt 10m)"   field_ref="mldr10_1"   operation="minimum"                                                                          /> 
    6659         <field id="heatc"        long_name="Heat content vertically integrated"                 standard_name="integral_of_sea_water_potential_temperature_wrt_depth_expressed_as_heat_content"   unit="J/m2"       /> 
    67          <field id="saltc"        long_name="Salt content vertically integrated"                                                                                                                   unit="1e-3*kg/m2" /> 
     60         <field id="saltc"        long_name="Salt content vertically integrated"                                                                                                                   unit="0.001*kg/m2" /> 
    6861 
    6962         <!-- EOS --> 
    70          <field id="alpha"        long_name="thermal expansion"                                                         unit="degC-1" grid_ref="grid_T_3D" /> 
     63         <field id="alpha"        long_name="thermal expansion"                                                         unit="degree_C-1" grid_ref="grid_T_3D" /> 
    7164         <field id="beta"         long_name="haline contraction"                                                        unit="1e3"    grid_ref="grid_T_3D" /> 
    7265         <field id="rhop"         long_name="potential density (sigma0)"        standard_name="sea_water_sigma_theta"   unit="kg/m3"  grid_ref="grid_T_3D" /> 
     
    8578         <field id="mldr0_3"      long_name="Mixed Layer Depth (dsigma = 0.03 wrt sfc)"      standard_name="ocean_mixed_layer_thickness_defined_by_sigma_theta"                                unit="m"                         /> 
    8679         <field id="mld_dt02"     long_name="Mixed Layer Depth (|dT| = 0.2 wrt 10m)"         standard_name="ocean_mixed_layer_thickness_defined_by_temperature"                                unit="m"                         /> 
    87          <field id="hmlpt"     long_name="hmlpt"         standard_name="hmlpt"                                unit="m"                         /> 
    88          <field id="nmln"     long_name="nmln"         standard_name="hmlpt"                                unit="m"                         /> 
    8980         <field id="topthdep"     long_name="Top of Thermocline Depth (dT = -0.2 wrt 10m)"   standard_name="ocean_mixed_layer_thickness_defined_by_temperature"                                unit="m"                         /> 
    9081         <field id="pycndep"      long_name="Pycnocline Depth (dsigma[dT=-0.2] wrt 10m)"     standard_name="ocean_mixed_layer_thickness_defined_by_sigma_theta"                                unit="m"                         /> 
    9182         <field id="BLT"          long_name="Barrier Layer Thickness"                                                                                                                          unit="m"                          > topthdep - pycndep </field> 
    92          <field id="tinv"         long_name="Max of vertical invertion of temperature"                                                                                                         unit="degC"                      /> 
     83         <field id="tinv"         long_name="Max of vertical invertion of temperature"                                                                                                         unit="degree_C"                      /> 
    9384         <field id="depti"        long_name="Depth of max. vert. inv. of temperature"                                                                                                          unit="m"                         /> 
    94          <field id="20d"          long_name="Depth of 20C isotherm"                          standard_name="depth_of_isosurface_of_sea_water_potential_temperature"                            unit="m"      axis_ref="iax_20C" /> 
    95          <field id="28d"          long_name="Depth of 28C isotherm"                          standard_name="depth_of_isosurface_of_sea_water_potential_temperature"                            unit="m"      axis_ref="iax_28C" /> 
     85         <field id="20d"          long_name="Depth of 20C isotherm"                          standard_name="depth_of_isosurface_of_sea_water_potential_temperature"                            unit="m"   /> 
     86         <field id="28d"          long_name="Depth of 28C isotherm"                          standard_name="depth_of_isosurface_of_sea_water_potential_temperature"                            unit="m"   /> 
    9687         <field id="hc300"        long_name="Heat content 0-300m"                            standard_name="integral_of_sea_water_potential_temperature_wrt_depth_expressed_as_heat_content"   unit="J/m2"                      /> 
    9788 
    9889         <!-- variables available with key_diaar5 --> 
    99          <field id="botpres"      long_name="Pressure at sea floor"   standard_name="sea_water_pressure_at_sea_floor"   unit="dbar" /> 
     90         <field id="botpres"      long_name="Sea Water Pressure at Sea Floor"   standard_name="sea_water_pressure_at_sea_floor"   unit="dbar" /> 
     91         <field id="sshdyn"       long_name="dynamic sea surface height"     standard_name="dynamic_sea_surface_height_above_geoid"     unit="m" /> 
     92         <field id="sshdyn2"      long_name="square of dynamic sea surface height"     standard_name="dynamic_sea_surface_height_above_geoid_squared"     unit="m2" > sshdyn * sshdyn </field> 
     93         <field id="tnpeo"      long_name="Tendency of ocean potential energy content"          unit="W/m2"                           /> 
    10094 
    10195         <!-- variables available with key_vvl --> 
     
    189183         <field id="emp_oce"      long_name="Evap minus Precip over ocean"         standard_name="evap_minus_precip_over_sea_water"                                     unit="kg/m2/s"   /> 
    190184         <field id="emp_ice"      long_name="Evap minus Precip over ice"           standard_name="evap_minus_precip_over_sea_ice"                                       unit="kg/m2/s"   /> 
    191          <field id="saltflx"      long_name="Downward salt flux"                                                                                                        unit="1e-3/m2/s" /> 
     185         <field id="saltflx"      long_name="Downward salt flux"                                                                                                        unit="0.001/m2/s" /> 
    192186         <field id="fmmflx"       long_name="Water flux due to freezing/melting"                                                                                        unit="kg/m2/s"   /> 
    193187         <field id="snowpre"      long_name="Snow precipitation"                   standard_name="snowfall_flux"                                                        unit="kg/m2/s"   /> 
    194          <field id="runoffs"      long_name="River Runoffs"                        standard_name="water_flux_into_sea_water_from_rivers"                                unit="kg/m2/s"   /> 
     188         <field id="runoffs"      long_name="Water Flux into Sea Water From Rivers" standard_name="water_flux_into_sea_water_from_rivers"                                unit="kg/m2/s"   /> 
    195189         <field id="precip"       long_name="Total precipitation"                  standard_name="precipitation_flux"                                                   unit="kg/m2/s"   /> 
    196190  
    197          <field id="kpar"         long_name="kpar"                                  standard_name="kpar"                                                                 unit="kg/m2/s"   /> 
    198191         <field id="qt"           long_name="Net Downward Heat Flux"                standard_name="surface_downward_heat_flux_in_sea_water"                              unit="W/m2"                           /> 
    199192         <field id="qns"          long_name="non solar Downward Heat Flux"                                                                                               unit="W/m2"                           /> 
     
    210203         <!-- * variable related to ice shelf forcing * --> 
    211204         <field id="fwfisf"       long_name="Ice shelf melting"                             unit="kg/m2/s"  /> 
    212          <field id="qisf"         long_name="Ice Shelf Heat Flux"                           unit="W/m2"     /> 
     205         <field id="fwfisf3d"     long_name="Ice shelf melting"                             unit="kg/m2/s"  grid_ref="grid_T_3D" /> 
     206         <field id="qlatisf"      long_name="Ice shelf latent heat flux"                    unit="W/m2"     /> 
     207         <field id="qlatisf3d"    long_name="Ice shelf latent heat flux"                    unit="W/m2"     grid_ref="grid_T_3D" /> 
     208         <field id="qhcisf"       long_name="Ice shelf heat content flux"                   unit="W/m2"     /> 
     209         <field id="qhcisf3d"     long_name="Ice shelf heat content flux"                   unit="W/m2"     grid_ref="grid_T_3D" /> 
    213210         <field id="isfgammat"    long_name="transfert coefficient for isf (temperature)"   unit="m/s"      /> 
    214211         <field id="isfgammas"    long_name="transfert coefficient for isf (salinity)"      unit="m/s"      /> 
    215          <field id="stbl"         long_name="salinity in the Losh tbl"                      unit="1e-3"     /> 
    216          <field id="ttbl"         long_name="temperature in the Losh tbl"                   unit="degC"     /> 
     212         <field id="stbl"         long_name="salinity in the Losh tbl"                      unit="0.001"     /> 
     213         <field id="ttbl"         long_name="temperature in the Losh tbl"                   unit="degree_C"     /> 
    217214 
    218215         <!-- *_oce variables available with ln_blk_clio or ln_blk_core --> 
     
    229226         <field id="icealb_cea"   long_name="Ice albedo (cell average)"                 standard_name="sea_ice_albedo"                            unit="1"        /> 
    230227         <field id="calving_cea"  long_name="Calving"                                   standard_name="water_flux_into_sea_water_from_icebergs"   unit="kg/m2/s"  /> 
     228         <field id="iceberg_cea"  long_name="Iceberg"                                   standard_name="water_flux_into_sea_water_from_icebergs"   unit="kg/m2/s"  /> 
     229         <field id="iceshelf_cea" long_name="Iceshelf"                                  standard_name="water_flux_into_sea_water_from_iceshelf"   unit="kg/m2/s"  /> 
    231230 
    232231         <!-- available if key_oasis3 + conservative method --> 
    233232         <field id="rain"          long_name="Liquid precipitation"                                     standard_name="rainfall_flux"                                                                 unit="kg/m2/s"  /> 
     233         <field id="rain_ao_cea"   long_name="Liquid precipitation over ice-free ocean (cell average)"  standard_name="rainfall_flux"                                                                 unit="kg/m2/s"  /> 
    234234         <field id="evap_ao_cea"   long_name="Evaporation over ice-free ocean (cell average)"           standard_name="water_evaporation_flux"                                                        unit="kg/m2/s"  /> 
    235235         <field id="isnwmlt_cea"   long_name="Snow over Ice melting (cell average)"                     standard_name="surface_snow_melt_flux"                                                        unit="kg/m2/s"  /> 
     
    237237         <field id="fsal_real_cea" long_name="Real salt flux due to ice formation (cell average)"       standard_name="downward_sea_ice_basal_salt_flux"                                              unit="kg/m2/s"  /> 
    238238         <field id="hflx_rain_cea" long_name="heat flux due to rainfall"                                standard_name="temperature_flux_due_to_rainfall_expressed_as_heat_flux_into_sea_water"        unit="W/m2"     /> 
     239         <field id="hflx_prec_cea" long_name="heat flux due to precipitation"                           standard_name="temperature_flux_due_to_precipitation_expressed_as_heat_flux"                  unit="W/m2"     /> 
    239240         <field id="hflx_evap_cea" long_name="heat flux due to evaporation"                             standard_name="temperature_flux_due_to_evaporation_expressed_as_heat_flux_out_of_sea_water"   unit="W/m2"     /> 
    240241         <field id="hflx_snow_cea" long_name="heat flux due to snow falling"                            standard_name="heat_flux_onto_ocean_and_ice_due_to_snow_thermodynamics"                       unit="W/m2"     /> 
     
    243244         <field id="hflx_ice_cea"  long_name="heat flux due to ice thermodynamics"                      standard_name="heat_flux_into_sea_water_due_to_sea_ice_thermodynamics"                        unit="W/m2"     /> 
    244245         <field id="hflx_rnf_cea"  long_name="heat flux due to runoffs"                                 standard_name="temperature_flux_due_to_runoff_expressed_as_heat_flux_into_sea_water"          unit="W/m2"     /> 
    245          <field id="hflx_cal_cea"  long_name="heat flux due to calving"                                 standard_name="heat_flux_into_sea_water_due_to_iceberg_thermodynamics"                        unit="W/m2"     /> 
     246         <field id="hflx_cal_cea"  long_name="heat flux due to calving"                                 standard_name="heat_flux_into_sea_water_due_to_calving"                                       unit="W/m2"     /> 
     247         <field id="hflx_icb_cea"  long_name="heat flux due to iceberg"                                 standard_name="heat_flux_into_sea_water_due_to_icebergs"                                      unit="W/m2"     /> 
     248         <field id="hflx_isf_cea"  long_name="heat flux due to iceshelf"                                standard_name="heat_flux_into_sea_water_due_to_iceshelf"                                      unit="W/m2"     /> 
    246249         <field id="bicemel_cea"   long_name="Rate of Melt at Sea Ice Base (cell average)"              standard_name="tendency_of_sea_ice_amount_due_to_basal_melting"                               unit="kg/m2/s"  /> 
    247250         <field id="licepro_cea"   long_name="Lateral Sea Ice Growth Rate (cell average)"               standard_name="tendency_of_sea_ice_amount_due_to_lateral_growth_of_ice_floes"                 unit="kg/m2/s"  /> 
     
    266269          
    267270         <field id="ice_pres"     long_name="Ice presence"                                                                                                                    unit=""             /> 
    268          <field id="ist_cea"      long_name="Ice surface temperature (cell average)"                       standard_name="surface_temperature"                                unit="degC"         /> 
    269          <field id="ist_ipa"      long_name="Ice surface temperature (ice presence average)"               standard_name="surface_temperature"                                unit="degC"         />       
     271         <field id="ist_cea"      long_name="Ice surface temperature (cell average)"                       standard_name="surface_temperature"                                unit="degree_C"         /> 
     272         <field id="ist_ipa"      long_name="Ice surface temperature (ice presence average)"               standard_name="surface_temperature"                                unit="degree_C"         />       
    270273         <field id="uice_ipa"     long_name="Ice velocity along i-axis at I-point (ice presence average)"  standard_name="sea_ice_x_velocity"                                 unit="m/s"          />       
    271274         <field id="vice_ipa"     long_name="Ice velocity along j-axis at I-point (ice presence average)"  standard_name="sea_ice_y_velocity"                                 unit="m/s"          />       
     
    276279         <field id="u_imasstr"    long_name="Sea-ice mass transport along i-axis"                          standard_name="sea_ice_x_transport"                                unit="kg/s"         /> 
    277280         <field id="v_imasstr"    long_name="Sea-ice mass transport along j-axis"                          standard_name="sea_ice_y_transport"                                unit="kg/s"         /> 
    278          <field id="emp_x_sst"    long_name="Concentration/Dilution term on SST"                                                                                              unit="kg*degC/m2/s" /> 
    279          <field id="emp_x_sss"    long_name="Concentration/Dilution term on SSS"                                                                                              unit="kg*1e-3/m2/s" />         
     281         <field id="emp_x_sst"    long_name="Concentration/Dilution term on SST"                                                                                              unit="kg*degree_C/m2/s" /> 
     282         <field id="emp_x_sss"    long_name="Concentration/Dilution term on SSS"                                                                                              unit="kg*0.001/m2/s" />         
    280283         <field id="rnf_x_sst"    long_name="Runoff term on SST"                                                                                                              unit="kg*degC/m2/s" /> 
    281284         <field id="rnf_x_sss"    long_name="Runoff term on SSS"                                                                                                              unit="kg*1e-3/m2/s" /> 
    282285        
    283286         <field id="iceconc"      long_name="ice concentration"                                            standard_name="sea_ice_area_fraction"                              unit="%"            /> 
    284           <field id="isst"         long_name="sea surface temperature"                                      standard_name="sea_surface_temperature"                            unit="degC"         /> 
    285          <field id="isss"         long_name="sea surface salinity"                                         standard_name="sea_surface_salinity"                               unit="1e-3"         />  
     287          <field id="isst"         long_name="sea surface temperature"                                      standard_name="sea_surface_temperature"                            unit="degree_C"         /> 
     288         <field id="isss"         long_name="sea surface salinity"                                         standard_name="sea_surface_salinity"                               unit="0.001"         />  
    286289         <field id="qt_oce"       long_name="total flux at ocean surface"                                  standard_name="surface_downward_heat_flux_in_sea_water"            unit="W/m2"         /> 
    287290         <field id="qsr_oce"      long_name="solar heat flux at ocean surface"                             standard_name="net_downward_shortwave_flux_at_sea_water_surface"   unit="W/m2"         /> 
     
    292295         <field id="qtr_ice"      long_name="solar heat flux transmitted through ice: sum over categories"                                                                    unit="W/m2"         /> 
    293296         <field id="qemp_ice"     long_name="Downward Heat Flux from E-P over ice"                                                                                            unit="W/m2"         /> 
    294          <field id="micesalt"     long_name="Mean ice salinity"                                                                                                               unit="1e-3"         /> 
     297         <field id="micesalt"     long_name="Mean ice salinity"                                                                                                               unit="0.001"         /> 
    295298         <field id="miceage"      long_name="Mean ice age"                                                                                                                    unit="years"        /> 
    296299         <field id="alb_ice"      long_name="Mean albedo over sea ice"                                                                                                        unit=""             /> 
     
    303306         <field id="salinity_cat" long_name="Sea-Ice Bulk salinity for categories"                         unit="g/kg"   axis_ref="ncatice" /> 
    304307         <field id="brinevol_cat" long_name="Brine volume for categories"                                  unit="%"      axis_ref="ncatice" /> 
    305          <field id="icetemp_cat"  long_name="Ice temperature for categories"                               unit="degC"   axis_ref="ncatice" /> 
    306          <field id="snwtemp_cat"  long_name="Snow temperature for categories"                              unit="degC"   axis_ref="ncatice" /> 
    307  
    308          <field id="micet"        long_name="Mean ice temperature"                                         unit="degC"     /> 
     308         <field id="icetemp_cat"  long_name="Ice temperature for categories"                               unit="degree_C"   axis_ref="ncatice" /> 
     309         <field id="snwtemp_cat"  long_name="Snow temperature for categories"                              unit="degree_C"   axis_ref="ncatice" /> 
     310 
     311         <field id="micet"        long_name="Mean ice temperature"                                         unit="degree_C"     /> 
    309312         <field id="icehc"        long_name="ice total heat content"                                       unit="10^9J"    />  
    310313         <field id="isnowhc"      long_name="snow total heat content"                                      unit="10^9J"    /> 
    311          <field id="icest"        long_name="ice surface temperature"                                      unit="degC"     /> 
     314         <field id="icest"        long_name="ice surface temperature"                                      unit="degree_C"     /> 
    312315         <field id="ibrinv"       long_name="brine volume"                                                 unit="%"        /> 
    313316         <field id="icecolf"      long_name="frazil ice collection thickness"                              unit="m"        /> 
     
    321324         <field id="icetrp"       long_name="ice volume transport"                                         unit="m/day"          /> 
    322325         <field id="snwtrp"       long_name="snw volume transport"                                         unit="m/day"          /> 
    323          <field id="saltrp"       long_name="salt content transport"                                       unit="1e-3*kg/m2/day" /> 
     326         <field id="saltrp"       long_name="salt content transport"                                       unit="0.001*kg/m2/day" /> 
    324327         <field id="deitrp"       long_name="advected ice enthalpy"                                        unit="W/m2"           /> 
    325328         <field id="destrp"       long_name="advected snw enthalpy"                                        unit="W/m2"           /> 
    326329 
    327          <field id="sfxbri"       long_name="brine salt flux"                                              unit="1e-3*kg/m2/day" /> 
    328          <field id="sfxdyn"       long_name="salt flux from ridging rafting"                               unit="1e-3*kg/m2/day" /> 
    329          <field id="sfxres"       long_name="salt flux from lipupdate (resultant)"                         unit="1e-3*kg/m2/day" /> 
    330          <field id="sfxbog"       long_name="salt flux from bot growth"                                    unit="1e-3*kg/m2/day" /> 
    331          <field id="sfxbom"       long_name="salt flux from bot melt"                                      unit="1e-3*kg/m2/day" /> 
    332          <field id="sfxsum"       long_name="salt flux from surf melt"                                     unit="1e-3*kg/m2/day" /> 
    333          <field id="sfxsni"       long_name="salt flux from snow-ice formation"                            unit="1e-3*kg/m2/day" /> 
    334          <field id="sfxopw"       long_name="salt flux from open water ice formation"                      unit="1e-3*kg/m2/day" /> 
    335          <field id="sfxsub"       long_name="salt flux from sublimation"                                   unit="1e-3*kg/m2/day" /> 
    336          <field id="sfx"          long_name="salt flux total"                                              unit="1e-3*kg/m2/day" /> 
     330         <field id="sfxbri"       long_name="brine salt flux"                                              unit="0.001*kg/m2/day" /> 
     331         <field id="sfxdyn"       long_name="salt flux from ridging rafting"                               unit="0.001*kg/m2/day" /> 
     332         <field id="sfxres"       long_name="salt flux from lipupdate (resultant)"                         unit="0.001*kg/m2/day" /> 
     333         <field id="sfxbog"       long_name="salt flux from bot growth"                                    unit="0.001*kg/m2/day" /> 
     334         <field id="sfxbom"       long_name="salt flux from bot melt"                                      unit="0.001*kg/m2/day" /> 
     335         <field id="sfxsum"       long_name="salt flux from surf melt"                                     unit="0.001*kg/m2/day" /> 
     336         <field id="sfxsni"       long_name="salt flux from snow-ice formation"                            unit="0.001*kg/m2/day" /> 
     337         <field id="sfxopw"       long_name="salt flux from open water ice formation"                      unit="0.001*kg/m2/day" /> 
     338         <field id="sfxsub"       long_name="salt flux from sublimation"                                   unit="0.001*kg/m2/day" /> 
     339         <field id="sfx"          long_name="salt flux total"                                              unit="0.001*kg/m2/day" /> 
    337340 
    338341         <field id="vfxbog"       long_name="daily bottom thermo ice prod."                                unit="m/day"   /> 
     
    376379         <field id="hfxtur"       long_name="turbulent heat flux at the ice base"                          unit="W/m2" /> 
    377380    <!-- sbcssm variables --> 
    378          <field id="sst_m"    unit="degC" /> 
     381         <field id="sst_m"    unit="degree_C" /> 
    379382         <field id="sss_m"    unit="psu"  /> 
    380383         <field id="ssu_m"    unit="m/s"  /> 
     
    391394         <field id="e3u"          long_name="U-cell thickness"                                       standard_name="cell_thickness"              unit="m"          grid_ref="grid_U_3D" /> 
    392395         <field id="e3u_0"        long_name="Initial U-cell thickness"                               standard_name="ref_cell_thickness"          unit="m"          grid_ref="grid_U_3D"/> 
    393          <field id="utau"         long_name="Wind Stress along i-axis"                               standard_name="surface_downward_x_stress"   unit="N/m2"                            /> 
    394          <field id="uoce"         long_name="ocean current along i-axis"                             standard_name="sea_water_x_velocity"        unit="m/s"        grid_ref="grid_U_3D" /> 
     396         <field id="utau"         long_name="Surface Downward X Stress"                               standard_name="surface_downward_x_stress"   unit="N/m2"                            /> 
     397         <field id="uoce"         long_name="Sea Water X Velocity"                             standard_name="sea_water_x_velocity"        unit="m/s"        grid_ref="grid_U_3D" /> 
    395398         <field id="uoce_e3u"     long_name="ocean current along i-axis * e3u"                                                                   unit="m2/s"       grid_ref="grid_U_3D"  > uoce * e3u </field> 
    396399         <field id="ssu"          long_name="ocean surface current along i-axis"                                                                 unit="m/s"                             /> 
     
    398401         <field id="ubar"         long_name="ocean barotropic current along i-axis"                                                              unit="m/s"                             /> 
    399402         <field id="uocetr_eff"   long_name="Effective ocean transport along i-axis"                 standard_name="ocean_volume_x_transport"    unit="m3/s"       grid_ref="grid_U_3D" /> 
    400          <field id="uocet"        long_name="ocean transport along i-axis times temperature (CRS)"                                               unit="degC*m/s"   grid_ref="grid_U_3D" /> 
    401          <field id="uoces"        long_name="ocean transport along i-axis times salinity (CRS)"                                                  unit="1e-3*m/s"   grid_ref="grid_U_3D" /> 
    402          <field id="uslp_crs"     long_name="crs slope current along i-axis"              unit="m/s"  grid_ref="grid_U_3D" /> 
    403          <field id="uslp"         long_name="slope current along i-axis"                  unit="m/s"  grid_ref="grid_U_3D" /> 
    404          <field id="e2e3u_crs"    long_name="e2e3u_crs"                  unit="m/s"  grid_ref="grid_U_3D" /> 
    405          <field id="e2e3u_msk"    long_name="e2e3u_msk"                  unit="m/s"  grid_ref="grid_U_3D" /> 
     403         <field id="uocet"        long_name="ocean transport along i-axis times temperature (CRS)"                                               unit="degree_C*m/s"   grid_ref="grid_U_3D" /> 
     404         <field id="uoces"        long_name="ocean transport along i-axis times salinity (CRS)"                                                  unit="0.001*m/s"   grid_ref="grid_U_3D" /> 
    406405 
    407406         <!-- variables available with MLE --> 
     
    409408 
    410409         <!-- uoce_eiv: available with key_traldf_eiv and key_diaeiv --> 
    411          <field id="uoce_eiv"     long_name="EIV ocean current along i-axis"   standard_name="bolus_sea_water_x_velocity"   unit="m/s"   grid_ref="grid_U_3D" /> 
     410         <field id="uoce_eiv"      long_name="EIV ocean current along i-axis"   standard_name="bolus_sea_water_x_velocity"   unit="m/s"   grid_ref="grid_U_3D" /> 
     411         <field id="ueiv_masstr"   long_name="EIV Ocean Mass X Transport"    standard_name="bolus_ocean_mass_x_transport"                          unit="kg/s"        grid_ref="grid_U_3D" /> 
     412         <field id="ueiv_heattr3d" long_name="ocean bolus heat transport along i-axis"    standard_name="ocean_heat_x_transport_due_to_bolus_advection"   unit="W"    grid_ref="grid_U_3D" /> 
     413         <field id="ueiv_salttr3d" long_name="ocean bolus salt transport along i-axis"    standard_name="ocean_salt_x_transport_due_to_bolus_advection"   unit="kg"   grid_ref="grid_U_3D" /> 
    412414 
    413415         <!-- uoce_eiv: available with key_trabbl --> 
     
    419421 
    420422         <!-- variables available with key_diaar5 --> 
    421          <field id="u_masstr"     long_name="ocean eulerian mass transport along i-axis"    standard_name="ocean_mass_x_transport"                          unit="kg/s"        grid_ref="grid_U_3D" /> 
     423         <field id="u_masstr"     long_name="Ocean Mass X Transport"    standard_name="ocean_mass_x_transport"                          unit="kg/s"        grid_ref="grid_U_3D" /> 
     424         <field id="u_masstr_vint" long_name="vertical integral of ocean eulerian mass transport along i-axis"    standard_name="vertical_integral_of_ocean_mass_x_transport"  unit="kg/s" /> 
    422425         <field id="u_heattr"     long_name="ocean eulerian heat transport along i-axis"    standard_name="ocean_heat_x_transport"                          unit="W"                                /> 
    423          <field id="u_salttr"     long_name="ocean eulerian salt transport along i-axis"    standard_name="ocean_salt_x_transport"                          unit="1e-3*kg/s"                        /> 
     426         <field id="uadv_heattr"  long_name="ocean advective heat transport along i-axis"    standard_name="advectice_ocean_heat_x_transport"                          unit="W"                                /> 
     427         <field id="u_salttr"     long_name="ocean eulerian salt transport along i-axis"    standard_name="ocean_salt_x_transport"                          unit="0.001*kg/s"                        /> 
    424428         <field id="ueiv_heattr"  long_name="ocean bolus heat transport along i-axis"       standard_name="ocean_heat_x_transport_due_to_bolus_advection"   unit="W"                                /> 
     429         <field id="ueiv_salttr"  long_name="ocean bolus salt transport along i-axis"       standard_name="ocean_salt_x_transport_due_to_bolus_advection"   unit="W"                                /> 
    425430         <field id="udiff_heattr" long_name="ocean diffusion heat transport along i-axis"   standard_name="ocean_heat_x_transport_due_to_diffusion"         unit="W"                                /> 
    426431      </field_group> 
     
    431436         <field id="e3v"          long_name="V-cell thickness"                                       standard_name="cell_thickness"              unit="m"          grid_ref="grid_V_3D" /> 
    432437         <field id="e3v_0"        long_name="Initial V-cell thickness"                               standard_name="ref_cell_thickness"          unit="m"          grid_ref="grid_V_3D"/> 
    433          <field id="vtau"         long_name="Wind Stress along j-axis"                               standard_name="surface_downward_y_stress"   unit="N/m2"                            /> 
    434          <field id="voce"         long_name="ocean current along j-axis"                             standard_name="sea_water_y_velocity"        unit="m/s"        grid_ref="grid_V_3D" /> 
     438         <field id="vtau"         long_name="Surface Downward Y Stress"                               standard_name="surface_downward_y_stress"   unit="N/m2"                            /> 
     439         <field id="voce"         long_name="Sea Water Y Velocity"                             standard_name="sea_water_y_velocity"        unit="m/s"        grid_ref="grid_V_3D" /> 
    435440         <field id="voce_e3v"     long_name="ocean current along j-axis * e3v"                                                                   unit="m2/s"       grid_ref="grid_V_3D"  > voce * e3v </field> 
    436441         <field id="ssv"          long_name="ocean surface current along j-axis"                                                                 unit="m/s"                             /> 
     
    438443         <field id="vbar"         long_name="ocean barotropic current along j-axis"                                                              unit="m/s"                             /> 
    439444         <field id="vocetr_eff"   long_name="Effective ocean transport along j-axis"                 standard_name="ocean_volume_y_transport"    unit="m3/s"       grid_ref="grid_V_3D" /> 
    440          <field id="vocet"        long_name="ocean transport along j-axis times temperature (CRS)"                                               unit="degC*m/s"   grid_ref="grid_V_3D" /> 
    441          <field id="voces"        long_name="ocean transport along j-axis times salinity (CRS)"                                                  unit="1e-3*m/s"   grid_ref="grid_V_3D" /> 
    442          <field id="vslp_crs"     long_name="crs slope current along j-axis"              unit="m/s"  grid_ref="grid_V_3D" /> 
    443          <field id="vslp"         long_name="slope current along j-axis"                  unit="m/s"  grid_ref="grid_V_3D" /> 
    444          <field id="e1e3v_crs"    long_name="e1e3v_crs"                  unit="m/s"  grid_ref="grid_V_3D" /> 
    445          <field id="e1e3v_msk"    long_name="e1e3v_msk"                  unit="m/s"  grid_ref="grid_V_3D" /> 
     445         <field id="vocet"        long_name="ocean transport along j-axis times temperature (CRS)"                                               unit="degree_C*m/s"   grid_ref="grid_V_3D" /> 
     446         <field id="voces"        long_name="ocean transport along j-axis times salinity (CRS)"                                                  unit="0.001*m/s"   grid_ref="grid_V_3D" /> 
    446447 
    447448         <!-- variables available with MLE --> 
     
    450451         <!-- voce_eiv: available with key_traldf_eiv and key_diaeiv --> 
    451452         <field id="voce_eiv"     long_name="EIV ocean current along j-axis"   standard_name="bolus_sea_water_y_velocity"   unit="m/s"   grid_ref="grid_V_3D" /> 
     453         <field id="veiv_masstr"   long_name="EIV Ocean Mass Y Transport"    standard_name="bolus_ocean_mass_y_transport"                          unit="kg/s"        grid_ref="grid_V_3D" /> 
     454         <field id="veiv_heattr3d" long_name="ocean bolus heat transport along j-axis"    standard_name="ocean_heat_y_transport_due_to_bolus_advection"   unit="W"    grid_ref="grid_V_3D" /> 
     455         <field id="veiv_salttr3d" long_name="ocean bolus salt transport along j-axis"    standard_name="ocean_salt_y_transport_due_to_bolus_advection"   unit="kg"   grid_ref="grid_V_3D" /> 
    452456 
    453457         <!-- voce_eiv: available with key_trabbl --> 
     
    459463 
    460464         <!-- variables available with key_diaar5 --> 
    461          <field id="v_masstr"     long_name="ocean eulerian mass transport along j-axis"    standard_name="ocean_mass_y_transport"                          unit="kg/s"        grid_ref="grid_V_3D" /> 
    462          <field id="v_heattr"     long_name="ocean eulerian heat transport along j-axis"    standard_name="ocean_heat_y_transport"                          unit="W"                                /> 
    463          <field id="v_salttr"     long_name="ocean eulerian salt transport along i-axis"    standard_name="ocean_salt_y_transport"                          unit="1e-3*kg/s"                        /> 
     465         <field id="v_masstr"     long_name="Ocean Mass Y Transport"    standard_name="ocean_mass_y_transport"                          unit="kg/s"        grid_ref="grid_V_3D" /> 
     466         <field id="v_heattr"     long_name="Ocean Heat X Transport"    standard_name="ocean_heat_y_transport"                          unit="W"                                /> 
     467         <field id="vadv_heattr"  long_name="ocean advective heat transport along j-axis"    standard_name="advectice_ocean_heat_y_transport"                          unit="W"                                /> 
     468         <field id="v_salttr"     long_name="ocean eulerian salt transport along i-axis"    standard_name="ocean_salt_y_transport"                          unit="0.001*kg/s"                        /> 
    464469         <field id="veiv_heattr"  long_name="ocean bolus heat transport along j-axis"       standard_name="ocean_heat_y_transport_due_to_bolus_advection"   unit="W"                                /> 
     470         <field id="veiv_salttr"  long_name="ocean bolus salt transport along j-axis"       standard_name="ocean_salt_y_transport_due_to_bolus_advection"   unit="W"                                /> 
    465471         <field id="vdiff_heattr" long_name="ocean diffusion heat transport along j-axis"   standard_name="ocean_heat_y_transport_due_to_diffusion"         unit="W"                                /> 
    466472      </field_group> 
     
    475481        <!-- woce_eiv: available with key_traldf_eiv and key_diaeiv --> 
    476482        <field id="woce_eiv"     long_name="EIV ocean vertical velocity"   standard_name="bolus_upward_sea_water_velocity"   unit="m/s" /> 
     483        <field id="weiv_masstr"  long_name="EIV Upward Ocean Mass Transport"  standard_name="bolus_upward_ocean_mass_transport"             unit="kg/s"   /> 
     484        <field id="weiv_heattr3d" long_name="ocean bolus heat transport"    standard_name="ocean_heat_z_transport_due_to_bolus_advection"   unit="W"    grid_ref="grid_W_3D" /> 
     485        <field id="weiv_salttr3d" long_name="ocean bolus salt transport"    standard_name="ocean_salt_z_transport_due_to_bolus_advection"   unit="kg"   grid_ref="grid_W_3D" /> 
    477486 
    478487        <field id="avt"          long_name="vertical eddy diffusivity"   standard_name="ocean_vertical_heat_diffusivity"       unit="m2/s" /> 
     
    480489        <field id="avm"          long_name="vertical eddy viscosity"     standard_name="ocean_vertical_momentum_diffusivity"   unit="m2/s" /> 
    481490 
    482         <field id="avte_crs1"          long_name="vertical eddy diffusivity"                unit="m2/s"   /> 
    483         <field id="avte_crs2"          long_name="vertical eddy diffusivity"                unit="m2/s"   /> 
    484         <field id="avte_crs3"          long_name="vertical eddy diffusivity"                unit="m2/s"   /> 
    485         <field id="avte_crs4"          long_name="vertical eddy diffusivity"                unit="m2/s"   /> 
    486         <field id="zt_crs"       long_name="zt_crs"                  unit="m2/s"   /> 
    487         <field id="zs_crs"       long_name="zs_crs"                  unit="m2/s"   /> 
    488         <field id="zmax_crs"       long_name="zmax_crs"                  unit="m2/s"   /> 
    489         <field id="zerr_crs"       long_name="zerr_crs"                  unit="m2/s"   /> 
    490         <field id="e1e2w_msk"       long_name="e1e2w_msk"                  unit="m2/s"   /> 
    491  
    492491        <!-- avs: available with key_zdfddm --> 
    493492        <field id="avs"          long_name="salt vertical eddy diffusivity"   standard_name="ocean_vertical_salt_diffusivity"   unit="m2/s" /> 
     
    504503        <field id="av_ratio"     long_name="S over T diffusivity ratio"            standard_name="salinity_over_temperature_diffusivity_ratio"                     unit="1"    /> 
    505504        <field id="av_wave"      long_name="wave-induced vertical diffusivity"     standard_name="ocean_vertical_tracer_diffusivity_due_to_internal_waves"         unit="m2/s" /> 
    506         <field id="bn2"          long_name="squared Brunt-Vaisala frequency"       standard_name="squared_brunt_vaisala_frequency"                                 unit="s-1"  /> 
    507505        <field id="bflx_tmx"     long_name="wave-induced buoyancy flux"            standard_name="buoyancy_flux_due_to_internal_waves"                             unit="W/kg" /> 
    508506        <field id="pcmap_tmx"    long_name="power consumed by wave-driven mixing"  standard_name="vertically_integrated_power_consumption_by_wave_driven_mixing"   unit="W/m2"      grid_ref="grid_W_2D" /> 
     
    510508 
    511509        <!-- variables available with key_diaar5 -->    
    512         <field id="w_masstr"     long_name="vertical mass transport"             standard_name="upward_ocean_mass_transport"             unit="kg/s"   /> 
    513         <field id="w_masstr2"    long_name="square of vertical mass transport"   standard_name="square_of_upward_ocean_mass_transport"   unit="kg2/s2" /> 
     510        <field id="w_masstr"     long_name="Upward Ocean Mass Transport"           standard_name="upward_ocean_mass_transport"             unit="kg/s"   /> 
     511        <field id="w_masstr2"    long_name="square of vertical mass transport"     standard_name="square_of_upward_ocean_mass_transport"   unit="kg2/s2" /> 
    514512 
    515513        <!-- aht2d and  aht2d_eiv: available with key_traldf_eiv and key_traldf_c2d --> 
    516         <field id="aht2d"        long_name="lateral eddy diffusivity"       standard_name="ocean_tracer_xy_laplacian_diffusivity"      unit="m2/s"   grid_ref="grid_W_2D" /> 
    517         <field id="aht2d_eiv"    long_name="EIV lateral eddy diffusivity"   standard_name="ocean_tracer_bolus_laplacian_diffusivity"   unit="m2/s"   grid_ref="grid_W_2D" /> 
     514        <field id="aht2d"        long_name="lateral eddy diffusivity"              standard_name="ocean_tracer_xy_laplacian_diffusivity"      unit="m2/s"   grid_ref="grid_W_2D" /> 
     515        <field id="aht2d_eiv"    long_name="EIV lateral eddy diffusivity"          standard_name="ocean_tracer_bolus_laplacian_diffusivity"   unit="m2/s"   grid_ref="grid_W_2D" /> 
     516 
     517         <!-- Variable from eosbn2 --> 
     518         <field id="bn2"          long_name="Squared buoyancy frequency measuring ocean vertical stratification"        standard_name="square_of_brunt_vaisala_frequency_in_sea_water"   unit="1/s^2"  /> 
    518519      </field_group> 
    519520           
     521      <!-- product fields --> 
     522      <field_group id="diaprod"> 
     523   <field id="ut"           long_name="product_of_sea_water_x_velocity_and_potential_temperature"      unit="degree_C m/s"      grid_ref="grid_U_3D"   /> 
     524        <field id="ut_e3u"       long_name="product_of_sea_water_x_velocity_and_potential_temperature * e3u"  unit="degree_C m2/s"   grid_ref="grid_U_3D" > ut * e3u </field > 
     525   <field id="us"           long_name="product_of_sea_water_x_velocity_and_salinity"                   unit="PSU m/s"       grid_ref="grid_U_3D"   /> 
     526        <field id="us_e3u"       long_name="product_of_sea_water_x_velocity_and_salinity * e3u"             unit="PSU m2/s"      grid_ref="grid_U_3D" > us * e3u </field > 
     527   <field id="urhop"        long_name="product_of_sea_water_x_velocity_and_potential_density"          unit="(kg/m3).(m/s)" grid_ref="grid_U_3D"   /> 
     528        <field id="urhop_e3u"    long_name="product_of_sea_water_x_velocity_and_potential_density * e3u"    unit="(kg/m3).(m2/s)"   grid_ref="grid_U_3D" > urhop * e3u </field > 
     529   <field id="vt"           long_name="product_of_sea_water_y_velocity_and_potential_temperature"      unit="degree_C m/s"      grid_ref="grid_V_3D"   /> 
     530        <field id="vt_e3v"       long_name="product_of_sea_water_y_velocity_and_potential_temperature * e3v"  unit="degree_C m2/s"   grid_ref="grid_V_3D" > vt * e3v </field > 
     531   <field id="vs"           long_name="product_of_sea_water_y_velocity_and_salinity"                   unit="PSU m/s"       grid_ref="grid_V_3D"   /> 
     532        <field id="vs_e3v"       long_name="product_of_sea_water_y_velocity_and_salinity * e3t"             unit="PSU m2/s"      grid_ref="grid_V_3D" > vs * e3v </field > 
     533   <field id="vrhop"        long_name="product_of_sea_water_y_velocity_and_potential_density"          unit="(kg/m3).(m/s)" grid_ref="grid_V_3D"   /> 
     534        <field id="vrhop_e3v"    long_name="product_of_sea_water_y_velocity_and_potential_density * e3t"    unit="(kg/m3).(m2/s)"  grid_ref="grid_V_3D" > vrhop * e3v </field > 
     535   <field id="wt"           long_name="product_of_upward_sea_water_velocity_and_potential_temperature" unit="degree_C m/s"      grid_ref="grid_W_3D"   /> 
     536   <field id="ws"           long_name="product_of_upward_sea_water_velocity_and_salinity"              unit="PSU m/s"       grid_ref="grid_W_3D"   /> 
     537   <field id="wrhop"        long_name="product_of_upward_sea_water_velocity_and_potential_density"     unit="(kg/m3).(m/s)" grid_ref="grid_W_3D"   /> 
     538      </field_group> 
     539 
    520540      <!-- scalar variables available with key_diaar5 --> 
    521541 
    522542      <field_group id="scalar"  domain_ref="1point" > 
    523          <field id="voltot"     long_name="global total volume"                          standard_name="sea_water_volume"                               unit="m3"   /> 
    524          <field id="sshtot"     long_name="global mean ssh"                              standard_name="global_average_sea_level_change"                unit="m"    /> 
    525          <field id="sshsteric"  long_name="global mean ssh steric"                       standard_name="global_average_steric_sea_level_change"         unit="m"    /> 
    526          <field id="sshthster"  long_name="global mean ssh thermosteric"                 standard_name="global_average_thermosteric_sea_level_change"   unit="m"    /> 
    527          <field id="masstot"    long_name="global total mass"                            standard_name="sea_water_mass"                                 unit="kg"   /> 
    528          <field id="temptot"    long_name="global mean temperature"                      standard_name="sea_water_potential_temperature"                unit="degC" /> 
    529          <field id="saltot"     long_name="global mean salinity"                         standard_name="sea_water_salinity"                             unit="1e-3" /> 
    530          <field id="fram_trans" long_name="Sea Ice Mass Transport Through Fram Strait"   standard_name="sea_ice_transport_across_line"                  unit="kg/s" /> 
     543         <field id="voltot"     long_name="Sea Water Volume"                                standard_name="sea_water_volume"                               unit="m3"   /> 
     544         <field id="sshtot"     long_name="global mean ssh"                                 standard_name="global_average_sea_level_change"                unit="m"    /> 
     545         <field id="sshsteric"  long_name="global mean ssh steric"                          standard_name="global_average_steric_sea_level_change"         unit="m"    /> 
     546         <field id="sshthster"  long_name="Global Average Thermosteric Sea Level Change"    standard_name="global_average_thermosteric_sea_level_change"   unit="m"    /> 
     547         <field id="masstot"    long_name="global total mass"                               standard_name="sea_water_mass"                                 unit="kg"   /> 
     548         <field id="temptot"    long_name="Global Average Sea Water Potential Temperature"  standard_name="sea_water_potential_temperature"         unit="degree_C" /> 
     549         <field id="saltot"     long_name="Global Average Sea Water Salinity"               standard_name="sea_water_salinity"                      unit="0.001" /> 
     550         <field id="fram_trans" long_name="Sea Ice Mass Transport Through Fram Strait"      standard_name="sea_ice_transport_across_line"                  unit="kg/s" /> 
    531551 
    532552          <!-- available with ln_diahsb --> 
    533553       <field id="bgtemper"     long_name="drift in global mean temperature wrt timestep 1"                 standard_name="change_over_time_in_sea_water_potential_temperature"   unit="degC"     /> 
    534        <field id="bgsaline"     long_name="drift in global mean salinity wrt timestep 1"                    standard_name="change_over_time_in_sea_water_practical_salinity"      unit="1e-3"     /> 
     554       <field id="bgsaline"     long_name="drift in global mean salinity wrt timestep 1"                    standard_name="change_over_time_in_sea_water_practical_salinity"      unit="0.001"    /> 
    535555       <field id="bgheatco"     long_name="drift in global mean heat content wrt timestep 1"                                                                                      unit="1.e20J"   /> 
    536556       <field id="bgheatfx"     long_name="drift in global mean heat flux    wrt timestep 1"                                                                                      unit="W/m2"     /> 
     
    577597        <field id="traj_lat"      long_name="floats latitude"                                                            unit="degrees_north" /> 
    578598        <field id="traj_dep"      long_name="floats depth"                                                               unit="m"             /> 
    579         <field id="traj_temp"     long_name="floats temperature"       standard_name="sea_water_potential_temperature"   unit="degC"          /> 
    580         <field id="traj_salt"     long_name="floats salinity"          standard_name="sea_water_practical_salinity"      unit="1e-3"          /> 
     599        <field id="traj_temp"     long_name="floats temperature"       standard_name="sea_water_potential_temperature"   unit="degree_C"          /> 
     600        <field id="traj_salt"     long_name="floats salinity"          standard_name="sea_water_practical_salinity"      unit="0.001"          /> 
    581601        <field id="traj_dens"     long_name="floats in-situ density"   standard_name="sea_water_density"                 unit="kg/m3"         /> 
    582602        <field id="traj_group"    long_name="floats group"                                                               unit="1"             /> 
     
    602622 
    603623      <!-- Poleward transport : ptr -->      
    604       <field_group id="diaptr" domain_ref="ptr" >  
     624      <field_group id="diaptr">  
    605625        <field id="zomsfglo"          long_name="Meridional Stream-Function: Global"           unit="Sv"       grid_ref="gznl_W_3D" /> 
    606626        <field id="zomsfatl"          long_name="Meridional Stream-Function: Atlantic"         unit="Sv"       grid_ref="gznl_W_3D" /> 
     
    608628        <field id="zomsfind"          long_name="Meridional Stream-Function: Indian"           unit="Sv"       grid_ref="gznl_W_3D" /> 
    609629        <field id="zomsfipc"          long_name="Meridional Stream-Function: Pacific+Indian"   unit="Sv"       grid_ref="gznl_W_3D" /> 
    610         <field id="zotemglo"          long_name="Zonal Mean Temperature : Global"              unit="degC"     grid_ref="gznl_T_3D" /> 
    611         <field id="zotematl"          long_name="Zonal Mean Temperature : Atlantic"            unit="degC"     grid_ref="gznl_T_3D" /> 
    612         <field id="zotempac"          long_name="Zonal Mean Temperature : Pacific"             unit="degC"     grid_ref="gznl_T_3D" /> 
    613         <field id="zotemind"          long_name="Zonal Mean Temperature : Indian"              unit="degC"     grid_ref="gznl_T_3D" /> 
    614         <field id="zotemipc"          long_name="Zonal Mean Temperature : Pacific+Indian"      unit="degC"     grid_ref="gznl_T_3D" /> 
    615         <field id="zosalglo"          long_name="Zonal Mean Salinity : Global"                 unit="1e-3"     grid_ref="gznl_T_3D" /> 
    616         <field id="zosalatl"          long_name="Zonal Mean Salinity : Atlantic"               unit="1e-3"     grid_ref="gznl_T_3D" /> 
    617         <field id="zosalpac"          long_name="Zonal Mean Salinity : Pacific"                unit="1e-3"     grid_ref="gznl_T_3D" /> 
    618         <field id="zosalind"          long_name="Zonal Mean Salinity : Indian"                 unit="1e-3"     grid_ref="gznl_T_3D" /> 
    619         <field id="zosalipc"          long_name="Zonal Mean Salinity : Pacific+Indian"         unit="1e-3"     grid_ref="gznl_T_3D" /> 
     630        <field id="zotemglo"          long_name="Zonal Mean Temperature : Global"              unit="degree_C"     grid_ref="gznl_T_3D" /> 
     631        <field id="zotematl"          long_name="Zonal Mean Temperature : Atlantic"            unit="degree_C"     grid_ref="gznl_T_3D" /> 
     632        <field id="zotempac"          long_name="Zonal Mean Temperature : Pacific"             unit="degree_C"     grid_ref="gznl_T_3D" /> 
     633        <field id="zotemind"          long_name="Zonal Mean Temperature : Indian"              unit="degree_C"     grid_ref="gznl_T_3D" /> 
     634        <field id="zotemipc"          long_name="Zonal Mean Temperature : Pacific+Indian"      unit="degree_C"     grid_ref="gznl_T_3D" /> 
     635        <field id="zosalglo"          long_name="Zonal Mean Salinity : Global"                 unit="0.001"     grid_ref="gznl_T_3D" /> 
     636        <field id="zosalatl"          long_name="Zonal Mean Salinity : Atlantic"               unit="0.001"     grid_ref="gznl_T_3D" /> 
     637        <field id="zosalpac"          long_name="Zonal Mean Salinity : Pacific"                unit="0.001"     grid_ref="gznl_T_3D" /> 
     638        <field id="zosalind"          long_name="Zonal Mean Salinity : Indian"                 unit="0.001"     grid_ref="gznl_T_3D" /> 
     639        <field id="zosalipc"          long_name="Zonal Mean Salinity : Pacific+Indian"         unit="0.001"     grid_ref="gznl_T_3D" /> 
    620640        <field id="zosrfglo"          long_name="Zonal Mean Surface"                           unit="m2"       grid_ref="gznl_T_3D" /> 
    621641        <field id="zosrfatl"          long_name="Zonal Mean Surface : Atlantic"                unit="m2"       grid_ref="gznl_T_3D" /> 
     
    624644        <field id="zosrfipc"          long_name="Zonal Mean Surface : Pacific+Indian"          unit="m2"       grid_ref="gznl_T_3D" /> 
    625645        <field id="sophtadv"          long_name="Advective Heat Transport"                     unit="PW"       grid_ref="gznl_T_2D" /> 
     646        <field id="sophtadv_atl"      long_name="Advective Heat Transport: Atlantic"           unit="PW"       grid_ref="gznl_T_2D" /> 
     647        <field id="sophtadv_pac"      long_name="Advective Heat Transport: Pacific"            unit="PW"       grid_ref="gznl_T_2D" /> 
     648        <field id="sophtadv_ind"      long_name="Advective Heat Transport: Indian"             unit="PW"       grid_ref="gznl_T_2D" /> 
     649        <field id="sophtadv_ipc"      long_name="Advective Heat Transport: Pacific+Indian"     unit="PW"       grid_ref="gznl_T_2D" /> 
    626650        <field id="sophtldf"          long_name="Diffusive Heat Transport"                     unit="PW"       grid_ref="gznl_T_2D" /> 
     651        <field id="sophtldf_atl"      long_name="Diffusive Heat Transport: Atlantic"           unit="PW"       grid_ref="gznl_T_2D" /> 
     652        <field id="sophtldf_pac"      long_name="Diffusive Heat Transport: Pacific"            unit="PW"       grid_ref="gznl_T_2D" /> 
     653        <field id="sophtldf_ind"      long_name="Diffusive Heat Transport: Indian"             unit="PW"       grid_ref="gznl_T_2D" /> 
     654        <field id="sophtldf_ipc"      long_name="Diffusive Heat Transport: Pacific+Indian"     unit="PW"       grid_ref="gznl_T_2D" /> 
     655        <field id="sophtove"          long_name="Overturning Heat Transport"                     unit="PW"       grid_ref="gznl_T_2D" /> 
     656        <field id="sophtove_atl"      long_name="Overturning Heat Transport: Atlantic"           unit="PW"       grid_ref="gznl_T_2D" /> 
     657        <field id="sophtove_pac"      long_name="Overturning Heat Transport: Pacific"            unit="PW"       grid_ref="gznl_T_2D" /> 
     658        <field id="sophtove_ind"      long_name="Overturning Heat Transport: Indian"             unit="PW"       grid_ref="gznl_T_2D" /> 
     659        <field id="sophtove_ipc"      long_name="Overturning Heat Transport: Pacific+Indian"     unit="PW"       grid_ref="gznl_T_2D" /> 
     660        <field id="sophtbtr"          long_name="Barotropic Heat Transport"                     unit="PW"       grid_ref="gznl_T_2D" /> 
     661        <field id="sophtbtr_atl"      long_name="Barotropic Heat Transport: Atlantic"           unit="PW"       grid_ref="gznl_T_2D" /> 
     662        <field id="sophtbtr_pac"      long_name="Barotropic Heat Transport: Pacific"            unit="PW"       grid_ref="gznl_T_2D" /> 
     663        <field id="sophtbtr_ind"      long_name="Barotropic Heat Transport: Indian"             unit="PW"       grid_ref="gznl_T_2D" /> 
     664        <field id="sophtbtr_ipc"      long_name="Barotropic Heat Transport: Pacific+Indian"     unit="PW"       grid_ref="gznl_T_2D" /> 
     665        <field id="sophteiv"          long_name="Heat Transport from mesoscale eddy advection"                     unit="PW"       grid_ref="gznl_T_2D" /> 
     666        <field id="sophteiv_atl"      long_name="Heat Transport from mesoscale eddy advection: Atlantic"           unit="PW"       grid_ref="gznl_T_2D" /> 
     667        <field id="sophteiv_pac"      long_name="Heat Transport from mesoscale eddy advection: Pacific"            unit="PW"       grid_ref="gznl_T_2D" /> 
     668        <field id="sophteiv_ind"      long_name="Heat Transport from mesoscale eddy advection: Indian"             unit="PW"       grid_ref="gznl_T_2D" /> 
     669        <field id="sophteiv_ipc"      long_name="Heat Transport from mesoscale eddy advection: Pacific+Indian"     unit="PW"       grid_ref="gznl_T_2D" /> 
    627670        <field id="sopstadv"          long_name="Advective Salt Transport"                     unit="Giga g/s" grid_ref="gznl_T_2D" /> 
     671        <field id="sopstadv_atl"      long_name="Advective Salt Transport: Atlantic"           unit="Giga g/s" grid_ref="gznl_T_2D" /> 
     672        <field id="sopstadv_pac"      long_name="Advective Salt Transport: Pacific"            unit="Giga g/s" grid_ref="gznl_T_2D" /> 
     673        <field id="sopstadv_ind"      long_name="Advective Salt Transport: Indian"             unit="Giga g/s" grid_ref="gznl_T_2D" /> 
     674        <field id="sopstadv_ipc"      long_name="Advective Salt Transport: Pacific+Indian"     unit="Giga g/s" grid_ref="gznl_T_2D" /> 
     675        <field id="sopstove"          long_name="Overturning Salt Transport"                     unit="Giga g/s" grid_ref="gznl_T_2D" /> 
     676        <field id="sopstove_atl"      long_name="Overturning Salt Transport: Atlantic"           unit="Giga g/s" grid_ref="gznl_T_2D" /> 
     677        <field id="sopstove_pac"      long_name="Overturning Salt Transport: Pacific"            unit="Giga g/s" grid_ref="gznl_T_2D" /> 
     678        <field id="sopstove_ind"      long_name="Overturning Salt Transport: Indian"             unit="Giga g/s" grid_ref="gznl_T_2D" /> 
     679        <field id="sopstove_ipc"      long_name="Overturning Salt Transport: Pacific+Indian"     unit="Giga g/s" grid_ref="gznl_T_2D" /> 
     680        <field id="sopstbtr"          long_name="Barotropic Salt Transport"                     unit="Giga g/s" grid_ref="gznl_T_2D" /> 
     681        <field id="sopstbtr_atl"      long_name="Barotropic Salt Transport: Atlantic"           unit="Giga g/s" grid_ref="gznl_T_2D" /> 
     682        <field id="sopstbtr_pac"      long_name="Barotropic Salt Transport: Pacific"            unit="Giga g/s" grid_ref="gznl_T_2D" /> 
     683        <field id="sopstbtr_ind"      long_name="Barotropic Salt Transport: Indian"             unit="Giga g/s" grid_ref="gznl_T_2D" /> 
     684        <field id="sopstbtr_ipc"      long_name="Barotropic Salt Transport: Pacific+Indian"     unit="Giga g/s" grid_ref="gznl_T_2D" /> 
    628685        <field id="sopstldf"          long_name="Diffusive Salt Transport"                     unit="Giga g/s" grid_ref="gznl_T_2D" /> 
     686        <field id="sopstldf_atl"      long_name="Diffusive Salt Transport: Atlantic"           unit="Giga g/s" grid_ref="gznl_T_2D" /> 
     687        <field id="sopstldf_pac"      long_name="Diffusive Salt Transport: Pacific"            unit="Giga g/s" grid_ref="gznl_T_2D" /> 
     688        <field id="sopstldf_ind"      long_name="Diffusive Salt Transport: Indian"             unit="Giga g/s" grid_ref="gznl_T_2D" /> 
     689        <field id="sopstldf_ipc"      long_name="Diffusive Salt Transport: Pacific+Indian"     unit="Giga g/s" grid_ref="gznl_T_2D" /> 
     690        <field id="sopsteiv"          long_name="Salt Transport from mesoscale eddy advection"                     unit="Giga g/s"       grid_ref="gznl_T_2D" /> 
     691        <field id="sopsteiv_atl"      long_name="Salt Transport from mesoscale eddy advection: Atlantic"           unit="Giga g/s"       grid_ref="gznl_T_2D" /> 
     692        <field id="sopsteiv_pac"      long_name="Salt Transport from mesoscale eddy advection: Pacific"            unit="Giga g/s"       grid_ref="gznl_T_2D" /> 
     693        <field id="sopsteiv_ind"      long_name="Salt Transport from mesoscale eddy advection: Indian"             unit="Giga g/s"       grid_ref="gznl_T_2D" /> 
     694        <field id="sopsteiv_ipc"      long_name="Salt Transport from mesoscale eddy advection: Pacific+Indian"     unit="Giga g/s"       grid_ref="gznl_T_2D" />        
     695        <field id="sopht_vt"          long_name="Heat Transport"                     unit="PW"       grid_ref="gznl_T_2D" /> 
     696        <field id="sopht_vt_atl"      long_name="Heat Transport: Atlantic"           unit="PW"       grid_ref="gznl_T_2D" /> 
     697        <field id="sopht_vt_ind"      long_name="Heat Transport: Indian"             unit="PW"       grid_ref="gznl_T_2D" /> 
     698        <field id="sopht_vt_pac"      long_name="Heat Transport: Pacific"            unit="PW"       grid_ref="gznl_T_2D" /> 
     699        <field id="sopht_vt_ipc"      long_name="Heat Transport: Indo-Pacific"       unit="PW"       grid_ref="gznl_T_2D" /> 
     700        <field id="sopst_vs"          long_name="Salt Transport"                     unit="Giga g/s"       grid_ref="gznl_T_2D" /> 
     701        <field id="sopst_vs_atl"      long_name="Salt Transport: Atlantic"           unit="Giga g/s"       grid_ref="gznl_T_2D" /> 
     702        <field id="sopst_vs_ind"      long_name="Salt Transport: Indian"             unit="Giga g/s"       grid_ref="gznl_T_2D" /> 
     703        <field id="sopst_vs_pac"      long_name="Salt Transport: Pacific"            unit="Giga g/s"       grid_ref="gznl_T_2D" /> 
     704        <field id="sopst_vs_ipc"      long_name="Salt Transport: Indo-Pacific"       unit="Giga g/s"       grid_ref="gznl_T_2D" /> 
    629705      </field_group> 
    630706 
     
    635711    --> 
    636712 
    637     <field_group id="trendT" grid_ref="grid_T_3D"> 
    638713      <!-- variables available with ln_tra_trd --> 
    639       <field id="ttrd_xad"      long_name="temperature-trend: i-advection"                                                                                          unit="degC/s"                        /> 
     714  
     715     <!-- Asselin trends  calculated on odd time steps--> 
     716     <field_group id="trendT_odd"  grid_ref="grid_T_3D"> 
     717      <field id="ttrd_atf"      long_name="temperature-trend: asselin time filter"       unit="degree_C/s" /> 
     718      <field id="strd_atf"      long_name="salinity   -trend: asselin time filter"       unit="0.001/s" /> 
     719      <!-- Thickness weighted versions: --> 
     720      <field id="ttrd_atf_e3t"      unit="degC/s * m"  >  ttrd_atf * e3t </field> 
     721      <field id="strd_atf_e3t"      unit="1e-3/s * m"  >  strd_atf * e3t </field> 
     722      <!-- OMIP  layer-integrated trends --> 
     723      <field id="ttrd_atf_li"      long_name="layer integrated heat-trend: asselin time filter "       unit="W/m^2" > ttrd_atf_e3t * 1026.0 * 3991.86795711963  </field> 
     724      <field id="strd_atf_li"      long_name="layer integrated salt   -trend: asselin time filter "       unit="kg/(m^2 s)" > strd_atf_e3t * 1026.0 * 0.001 </field> 
     725      </field_group> 
     726 
     727    <!-- Other trends  calculated on even time steps--> 
     728  <field_group id="trendT_even" grid_ref="grid_T_3D"> 
     729       <field id="ttrd_xad"      long_name="temperature-trend: i-advection"                                                                                          unit="degC/s"                        /> 
    640730      <field id="strd_xad"      long_name="salinity   -trend: i-advection"                                                                                          unit="1e-3/s"                        /> 
    641731      <field id="ttrd_yad"      long_name="temperature-trend: j-advection"                                                                                          unit="degC/s"                        /> 
     
    645735      <field id="ttrd_ad"       long_name="temperature-trend: advection"               standard_name="tendency_of_sea_water_temperature_due_to_advection"           unit="degC/s"                         > sqrt( ttrd_xad^2 + ttrd_yad^2 + ttrd_zad^2 ) </field> 
    646736      <field id="strd_ad"       long_name="salinity   -trend: advection"               standard_name="tendency_of_sea_water_salinity_due_to_advection"              unit="1e-3/s"                         > sqrt( strd_xad^2 + strd_yad^2 + strd_zad^2 ) </field> 
     737      <field id="ttrd_totad"    long_name="temperature-trend: total advection"         standard_name="tendency_of_sea_water_salinity_due_to_advection"              unit="degC/s"                        /> 
     738      <field id="strd_totad"    long_name="salinity   -trend: total advection"         standard_name="tendency_of_sea_water_salinity_due_to_advection"              unit="1e-3/s"                        /> 
    647739      <field id="ttrd_sad"      long_name="temperature-trend: surface adv. (no-vvl)"                                                                                unit="degC/s"   grid_ref="grid_T_2D" /> 
    648740      <field id="strd_sad"      long_name="salinity   -trend: surface adv. (no-vvl)"                                                                                unit="1e-3/s"   grid_ref="grid_T_2D" /> 
     
    651743      <field id="ttrd_zdf"      long_name="temperature-trend: vertical diffusion"      standard_name="tendency_of_sea_water_temperature_due_to_vertical_mixing"     unit="degC/s"                        /> 
    652744      <field id="strd_zdf"      long_name="salinity   -trend: vertical diffusion"      standard_name="tendency_of_sea_water_salinity_due_to_vertical_mixing"        unit="1e-3/s"                        /> 
     745      <field id="ttrd_evd"      long_name="temperature-trend: EVD convection"                                                                                       unit="degC/s"                        /> 
     746      <field id="strd_evd"      long_name="salinity   -trend: EVD convection"                                                                                       unit="1e-3/s"                        /> 
    653747 
    654748      <!-- ln_traldf_iso=T only (iso-neutral diffusion) --> 
     749      <field id="ttrd_iso_x"    long_name="temperature-trend: isopycnal diffusion x-component"                                                                      unit="degC/s"                        /> 
     750      <field id="strd_iso_x"    long_name="salinity   -trend: isopycnal diffusion x-component"                                                                      unit="1e-3/s"                        /> 
     751      <field id="ttrd_iso_y"    long_name="temperature-trend: isopycnal diffusion y-component"                                                                      unit="degC/s"                        /> 
     752      <field id="strd_iso_y"    long_name="salinity   -trend: isopycnal diffusion y-component"                                                                      unit="1e-3/s"                        /> 
     753      <field id="ttrd_iso_z1"   long_name="temperature-trend: isopycnal diffusion z-component part 1"                                                               unit="degC/s"                        /> 
     754      <field id="strd_iso_z1"   long_name="salinity   -trend: isopycnal diffusion z-component part 1"                                                               unit="1e-3/s"                        /> 
     755      <field id="ttrd_iso_z"    long_name="temperature-trend: isopycnal diffusion z-component"                 unit="degC/s" > ttrd_iso_z1 + ttrd_zdf - ttrd_zdfp </field> 
     756      <field id="strd_iso_z"    long_name="salinity   -trend: isopycnal diffusion z-component"                 unit="1e-3/s" > strd_iso_z1 + strd_zdf - strd_zdfp </field> 
     757      <field id="ttrd_iso"      long_name="temperature-trend: isopycnal diffusion"                             unit="degC/s" > ttrd_ldf + ttrd_zdf - ttrd_zdfp </field> 
     758      <field id="strd_iso"      long_name="salinity   -trend: isopycnal diffusion"                             unit="1e-3/s" > strd_ldf + strd_zdf - strd_zdfp </field> 
    655759      <field id="ttrd_zdfp"     long_name="temperature-trend: pure vert. diffusion"   unit="degC/s" /> 
    656760      <field id="strd_zdfp"     long_name="salinity   -trend: pure vert. diffusion"   unit="1e-3/s" /> 
    657761 
    658762      <!-- --> 
    659       <field id="ttrd_dmp"      long_name="temperature-trend: interior restoring"        unit="degC/s" /> 
    660       <field id="strd_dmp"      long_name="salinity   -trend: interior restoring"        unit="1e-3/s" /> 
    661       <field id="ttrd_bbl"      long_name="temperature-trend: bottom boundary layer"     unit="degC/s" /> 
    662       <field id="strd_bbl"      long_name="salinity   -trend: bottom boundary layer"     unit="1e-3/s" /> 
    663       <field id="ttrd_npc"      long_name="temperature-trend: non-penetrative conv."     unit="degC/s" /> 
    664       <field id="strd_npc"      long_name="salinity   -trend: non-penetrative conv."     unit="1e-3/s" /> 
    665       <field id="ttrd_qns"      long_name="temperature-trend: non-solar flux + runoff"   unit="degC/s" /> 
    666       <field id="strd_cdt"      long_name="salinity   -trend: C/D term       + runoff"   unit="degC/s" /> 
    667       <field id="ttrd_qsr"      long_name="temperature-trend: solar penetr. heating"     unit="degC/s" /> 
    668       <field id="ttrd_bbc"      long_name="temperature-trend: geothermal heating"        unit="degC/s" /> 
    669       <field id="ttrd_atf"      long_name="temperature-trend: asselin time filter"       unit="degC/s" /> 
    670       <field id="strd_atf"      long_name="salinity   -trend: asselin time filter"       unit="1e-3/s" /> 
    671  
     763      <field id="ttrd_dmp"      long_name="temperature-trend: interior restoring"        unit="degree_C/s" /> 
     764      <field id="strd_dmp"      long_name="salinity   -trend: interior restoring"        unit="0.001/s" /> 
     765      <field id="ttrd_bbl"      long_name="temperature-trend: bottom boundary layer"     unit="degree_C/s" /> 
     766      <field id="strd_bbl"      long_name="salinity   -trend: bottom boundary layer"     unit="0.001/s" /> 
     767      <field id="ttrd_npc"      long_name="temperature-trend: non-penetrative conv."     unit="degree_C/s" /> 
     768      <field id="strd_npc"      long_name="salinity   -trend: non-penetrative conv."     unit="0.001/s" /> 
     769      <field id="ttrd_qns"      long_name="temperature-trend: non-solar flux + runoff"   unit="degC/s" grid_ref="grid_T_2D"/> 
     770      <field id="strd_cdt"      long_name="salinity   -trend: C/D term       + runoff"   unit="degC/s" grid_ref="grid_T_2D"/> 
     771      <field id="ttrd_qsr"      long_name="temperature-trend: solar penetr. heating"     unit="degree_C/s" /> 
     772      <field id="ttrd_bbc"      long_name="temperature-trend: geothermal heating"        unit="degree_C/s" /> 
     773  
     774      <!-- Thickness weighted versions: --> 
     775      <field id="ttrd_xad_e3t"      unit="degC/s * m" >  ttrd_xad * e3t </field> 
     776      <field id="strd_xad_e3t"      unit="1e-3/s * m" >  strd_xad * e3t </field> 
     777      <field id="ttrd_yad_e3t"      unit="degC/s * m" >  ttrd_yad * e3t </field> 
     778      <field id="strd_yad_e3t"      unit="1e-3/s * m" >  strd_yad * e3t </field> 
     779      <field id="ttrd_zad_e3t"      unit="degC/s * m" >  ttrd_zad * e3t </field> 
     780      <field id="strd_zad_e3t"      unit="1e-3/s * m" >  strd_zad * e3t </field> 
     781      <field id="ttrd_ad_e3t"       unit="degC/s * m" >  ttrd_ad  * e3t </field> 
     782      <field id="strd_ad_e3t"       unit="1e-3/s * m" >  strd_ad  * e3t </field> 
     783      <field id="ttrd_totad_e3t"    unit="degC/s * m" >  ttrd_totad  * e3t </field> 
     784      <field id="strd_totad_e3t"    unit="1e-3/s * m" >  strd_totad  * e3t </field> 
     785      <field id="ttrd_ldf_e3t"      unit="degC/s * m" >  ttrd_ldf * e3t </field> 
     786      <field id="strd_ldf_e3t"      unit="1e-3/s * m" >  strd_ldf * e3t </field> 
     787      <field id="ttrd_zdf_e3t"      unit="degC/s * m" >  ttrd_zdf * e3t </field> 
     788      <field id="strd_zdf_e3t"      unit="1e-3/s * m" >  strd_zdf * e3t </field> 
     789      <field id="ttrd_evd_e3t"      unit="degC/s * m" >  ttrd_evd * e3t </field> 
     790      <field id="strd_evd_e3t"      unit="1e-3/s * m" >  strd_evd * e3t </field> 
     791 
     792      <field id="strd_evd_e3t"      unit="1e-3/s * m" >  strd_evd * e3t </field> 
     793 
     794      <!-- ln_traldf_iso=T only (iso-neutral diffusion) --> 
     795      <field id="ttrd_iso_x_e3t"    unit="degC/s * m"  >  ttrd_iso_x * e3t </field> 
     796      <field id="strd_iso_x_e3t"    unit="1e-3/s * m"  >  strd_iso_x * e3t </field> 
     797      <field id="ttrd_iso_y_e3t"    unit="degC/s * m"  >  ttrd_iso_y * e3t </field> 
     798      <field id="strd_iso_y_e3t"    unit="1e-3/s * m"  >  strd_iso_y * e3t </field> 
     799      <field id="ttrd_iso_z_e3t"    unit="degC/s * m"  >  ttrd_iso_z * e3t </field> 
     800      <field id="strd_iso_z_e3t"    unit="1e-3/s * m"  >  strd_iso_z * e3t </field> 
     801      <field id="ttrd_iso_e3t"      unit="degC/s * m"  >  ttrd_iso * e3t </field> 
     802      <field id="strd_iso_e3t"      unit="1e-3/s * m"  >  strd_iso * e3t </field> 
     803      <field id="ttrd_zdfp_e3t"     unit="degC/s * m"  >  ttrd_zdfp * e3t </field> 
     804      <field id="strd_zdfp_e3t"     unit="1e-3/s * m"  >  strd_zdfp * e3t </field> 
     805 
     806      <!-- --> 
     807      <field id="ttrd_dmp_e3t"      unit="degC/s * m"  >  ttrd_dmp * e3t </field> 
     808      <field id="strd_dmp_e3t"      unit="1e-3/s * m"  >  strd_dmp * e3t </field> 
     809      <field id="ttrd_bbl_e3t"      unit="degC/s * m"  >  ttrd_bbl * e3t </field> 
     810      <field id="strd_bbl_e3t"      unit="1e-3/s * m"  >  strd_bbl * e3t </field> 
     811      <field id="ttrd_npc_e3t"      unit="degC/s * m"  >  ttrd_npc * e3t </field> 
     812      <field id="strd_npc_e3t"      unit="1e-3/s * m"  >  strd_npc * e3t </field> 
     813      <field id="ttrd_qns_e3t"      unit="degC/s * m"  >  ttrd_qns * e3t_surf </field> 
     814      <field id="strd_cdt_e3t"      unit="degC/s * m"  >  strd_cdt * e3t_surf </field> 
     815      <field id="ttrd_qsr_e3t"      unit="degC/s * m"  >  ttrd_qsr * e3t </field> 
     816      <field id="ttrd_bbc_e3t"      unit="degC/s * m"  >  ttrd_bbc * e3t </field> 
     817 
     818      <!-- OMIP  layer-integrated trends --> 
     819      <field id="ttrd_totad_li"    long_name="layer integrated heat-trend : total advection"       unit="W/m^2"     > ttrd_totad_e3t * 1026.0 * 3991.86795711963 </field> 
     820      <field id="strd_totad_li"    long_name="layer integrated salt   -trend : total advection"      unit="kg/(m^2 s)"    > strd_totad_e3t * 1026.0 * 0.001  </field> 
     821      <field id="ttrd_evd_li"      long_name="layer integrated heat-trend : EVD convection"         unit="W/m^2"    > ttrd_evd_e3t * 1026.0 * 3991.86795711963 </field> 
     822      <field id="strd_evd_li"      long_name="layer integrated salt   -trend : EVD convection"      unit="kg/(m^2 s)"  > strd_evd_e3t * 1026.0 * 0.001  </field> 
     823      <field id="ttrd_iso_li"      long_name="layer integrated heat-trend : isopycnal diffusion"    unit="W/m^2" > ttrd_iso_e3t * 1026.0 * 3991.86795711963 </field> 
     824      <field id="strd_iso_li"      long_name="layer integrated salt   -trend : isopycnal diffusion"   unit="kg/(m^2 s)" > strd_iso_e3t * 1026.0 * 0.001  </field> 
     825      <field id="ttrd_zdfp_li"     long_name="layer integrated heat-trend : pure vert. diffusion"   unit="W/m^2" > ttrd_zdfp_e3t * 1026.0 * 3991.86795711963 </field> 
     826      <field id="strd_zdfp_li"     long_name="layer integrated salt   -trend : pure vert. diffusion"   unit="kg/(m^2 s)" > strd_zdfp_e3t * 1026.0 * 0.001  </field> 
     827      <field id="ttrd_qns_li"      long_name="layer integrated heat-trend : non-solar flux + runoff"   unit="W/m^2" grid_ref="grid_T_2D"> ttrd_qns_e3t * 1026.0 * 3991.86795711963 </field> 
     828      <field id="ttrd_qsr_li"      long_name="layer integrated heat-trend : solar flux"   unit="W/m^2"  grid_ref="grid_T_3D"> ttrd_qsr_e3t * 1026.0 * 3991.86795711963 </field> 
     829      <field id="ttrd_bbl_li"      long_name="layer integrated heat-trend: bottom boundary layer "     unit="W/m^2" > ttrd_bbl_e3t * 1026.0 * 3991.86795711963 </field> 
     830      <field id="strd_bbl_li"      long_name="layer integrated salt   -trend: bottom boundary layer "     unit="kg/(m^2 s)" > strd_bbl_e3t * 1026.0 * 0.001  </field> 
     831      <field id="ttrd_evd_li"      long_name="layer integrated heat -trend: evd convection "       unit="W/m^2" >ttrd_evd_e3t * 1026.0 * 3991.86795711963  </field> 
     832      <field id="strd_evd_li"      long_name="layer integrated salt -trend: evd convection "       unit="kg/(m^2 s)" > strd_evd_e3t * 1026.0 * 0.001  </field> 
     833     </field_group> 
     834    
     835     <!--  Total trends calculated every time step--> 
     836     <field_group id="trendT" grid_ref="grid_T_3D"> 
     837      <field id="ttrd_tot"      long_name="temperature-trend: total model trend"         unit="degC/s" /> 
     838      <field id="strd_tot"      long_name="salinity   -trend: total model trend"         unit="1e-3/s" /> 
     839      <!-- Thickness weighted versions: --> 
     840      <field id="ttrd_tot_e3t"      unit="degC/s * m"  >  ttrd_tot * e3t </field> 
     841      <field id="strd_tot_e3t"      unit="1e-3/s * m"  >  strd_tot * e3t </field> 
     842      <!-- OMIP  layer-integrated total trends --> 
     843      <field id="ttrd_tot_li"      long_name="layer integrated heat-trend: total model trend :"         unit="W/m^2" > ttrd_tot_e3t * 1026.0 * 3991.86795711963 </field> 
     844      <field id="strd_tot_li"      long_name="layer integrated salt   -trend: total model trend :"         unit="kg/(m^2 s)" > strd_tot_e3t * 1026.0 * 0.001  </field> 
     845    
     846      <!-- **** these trends have not been apportioned to all/even/odd ts yet **** --> 
    672847      <!-- variables available with ln_KE_trd --> 
    673848      <field id="ketrd_hpg"     long_name="ke-trend: hydrostatic pressure gradient"          unit="W/s^3"                        /> 
     
    684859      <field id="ketrd_zad"     long_name="ke-trend: vertical  advection"                    unit="W/s^3"                        /> 
    685860      <field id="ketrd_udx"     long_name="ke-trend: U.dx[U]"                                unit="W/s^3"                        /> 
    686       <field id="ketrd_ldf"     long_name="ke-trend: lateral   diffusion"                    unit="W/s^3"                        /> 
     861      <field id="ketrd_ldf"     long_name="ke-trend: lateral   diffusion"                    unit="W/m^3"                        /> 
    687862      <field id="ketrd_zdf"     long_name="ke-trend: vertical  diffusion"                    unit="W/s^3"                        /> 
    688863      <field id="ketrd_tau"     long_name="ke-trend: wind stress "                           unit="W/s^3"   grid_ref="grid_T_2D" /> 
     
    692867      <field id="ketrd_convP2K" long_name="ke-trend: conversion (potential to kinetic)"      unit="W/s^3"                        /> 
    693868      <field id="KE"            long_name="kinetic energy: u(n)*u(n+1)/2"                    unit="W/s^2"                        />    
     869      <!-- variables available when explicit mixing is used --> 
     870      <field id="dispkexyfo"    long_name="KE-trend: lateral  mixing induced dissipation"   standard_name="ocean_kinetic_energy_dissipation_per_unit_area_due_to_xy_friction"                   unit="W/m^2" grid_ref="grid_T_2D" />    
     871      <field id="dispkevfo"     long_name="KE-trend: vertical mixing induced dissipation"   standard_name="ocean_kinetic_energy_dissipation_per_unit_area_due_to_vertical_friction"             unit="W/m^2" grid_ref="grid_T_2D" />    
     872      <!-- variables available with key_traadv_eiv and key_diaeiv --> 
     873      <field id="eketrd_eiv"    long_name="EKE-trend due to parameterized eddy advection"   standard_name="tendency_of_ocean_eddy_kinetic_energy_content_due_to_parameterized_eddy_advection"   unit="W/m^2" grid_ref="grid_T_2D" />    
    694874 
    695875      <!-- variables available with ln_PE_trd --> 
     
    709889      <field id="petrd_atf"     long_name="pe-trend: asselin time filter"        unit="W/m^3"                        /> 
    710890      <field id="PEanom"        long_name="potential energy anomaly"             unit="1"                            />    
    711       <field id="alphaPE"       long_name="partial deriv. of PEanom wrt T"       unit="degC-1"                       />    
     891      <field id="alphaPE"       long_name="partial deriv. of PEanom wrt T"       unit="degree_C-1"                       />    
    712892      <field id="betaPE"        long_name="partial deriv. of PEanom wrt S"       unit="1e3"                          />    
     893      <field id="petrd_zdfp_e3t"    unit="W/m^2" grid_ref="grid_T_3D"  > petrd_zdfp * e3t </field> 
    713894    </field_group> 
    714895 
     
    762943 
    763944     <field_group id="ptrc_T" grid_ref="grid_T_3D"> 
    764        <field id="Age"          long_name="Age tracer                       "        unit="year"    /> 
    765        <field id="Age_e3t"      long_name="Age * e3t"                                unit="year*m"  > Age * e3t </field > 
    766945       <field id="DIC"          long_name="Dissolved inorganic Concentration"        unit="mmol/m3" /> 
    767946       <field id="DIC_E3T"      long_name="DIC * E3T"                                unit="mmol/m2" > DIC * e3t </field > 
     
    8261005       <field id="CFC11"       long_name="CFC-11 Concentration"                     unit="umol/m3" /> 
    8271006       <field id="CFC11_E3T"   long_name="CFC11 * E3T"                              unit="umol/m2"  > CFC11 * e3t </field > 
     1007       <field id="CFC12"       long_name="CFC-12 Concentration"                     unit="umol/m3" /> 
     1008       <field id="CFC12_E3T"   long_name="CFC12 * E3T"                              unit="umol/m2"  > CFC12 * e3t </field > 
     1009       <field id="SF6"         long_name="SF6 Concentration"                        unit="umol/m3" /> 
     1010       <field id="SF6_E3T"     long_name="SF6 * E3T"                                unit="umol/m2"  > SF6 * e3t </field > 
     1011 
    8281012       <!-- Bomb C14 : variables available with key_c14b --> 
    829        <field id="C14B"     long_name="Bomb C14 Concentration"                      unit="1"         /> 
    830        <field id="C14B_E3T"    long_name="C14B * E3T"                               unit="m"  > C14B * e3t </field > 
     1013       <field id="C14B"       long_name="Bomb C14 Concentration"                    unit="1"         /> 
     1014       <field id="C14B_E3T"   long_name="C14B * E3T"                                unit="m"  > C14B * e3t </field > 
     1015 
     1016       <!-- AGE : variables available with key_age --> 
     1017       <field id="Age"        long_name="Sea Water Age Since Surface contact" standard_name="sea_water_age_since_surface_contact"  unit="yr"         /> 
     1018       <field id="Age_e3t"    long_name="Age * e3t"                                 unit="yr * m"  > Age * e3t </field > 
     1019 
    8311020     </field_group> 
    8321021 
     
    9441133 
    9451134       <!-- CFC11 : variables available with key_cfc --> 
    946        <field id="qtrCFC11"    long_name="Air-sea flux of CFC-11"                  unit="mol/m2/s"   /> 
    947        <field id="qintCFC11"   long_name="Cumulative air-sea flux of CFC-11"       unit="mol/m2"     /> 
     1135       <field id="qtr_CFC11"   long_name="Air-sea flux of CFC-11"                  unit="mol/m2/s"   /> 
     1136       <field id="qint_CFC11"  long_name="Cumulative air-sea flux of CFC-11"       unit="mol/m2"     /> 
     1137       <field id="qtr_CFC12"   long_name="Air-sea flux of CFC-12"                  unit="mol/m2/s"   /> 
     1138       <field id="qint_CFC12"  long_name="Cumulative air-sea flux of CFC-12"       unit="mol/m2"     /> 
     1139       <field id="qtr_SF6"     long_name="Air-sea flux of SF6"                     unit="mol/m2/s"   /> 
     1140       <field id="qint_SF6"    long_name="Cumulative air-sea flux of SF6"          unit="mol/m2"     /> 
    9481141 
    9491142       <!-- Bomb C14 : variables available with key_c14b --> 
    950        <field id="qtrC14b"     long_name="Air-sea flux of Bomb C14"                unit="mol/m2/s"   /> 
    951        <field id="qintC14b"    long_name="Cumulative air-sea flux of Bomb C14"     unit="mol/m2"     /> 
     1143       <field id="qtr_C14b"    long_name="Air-sea flux of Bomb C14"                unit="mol/m2/s"   /> 
     1144       <field id="qint_C14b"   long_name="Cumulative air-sea flux of Bomb C14"     unit="mol/m2"     /> 
    9521145       <field id="fdecay"      long_name="Radiactive decay of Bomb C14"            unit="mol/m3"  grid_ref="grid_T_3D"  /> 
    9531146     </field_group> 
     
    9731166    --> 
    9741167 
     1168     <field_group id="TRD" > 
     1169          <field field_ref="ttrd_totad_li"   name="opottempadvect"  /> 
     1170          <field field_ref="ttrd_iso_li"     name="opottemppmdiff"  /> 
     1171          <field field_ref="ttrd_zdfp_li"    name="opottempdiff"  /> 
     1172          <field field_ref="ttrd_evd_li"     name="opottempevd" /> 
     1173          <field field_ref="strd_evd_li"     name="osaltevd" /> 
     1174          <field field_ref="ttrd_qns_li"     name="opottempqns"  /> 
     1175          <field field_ref="ttrd_qsr_li"     name="rsdoabsorb" operation="accumulate" /> 
     1176          <field field_ref="strd_totad_li"   name="osaltadvect" /> 
     1177          <field field_ref="strd_iso_li"     name="osaltpmdiff"  /> 
     1178          <field field_ref="strd_zdfp_li"    name="osaltdiff" /> 
     1179    </field_group> 
     1180     
    9751181    <field_group id="mooring" > 
    9761182      <field field_ref="toce"         name="thetao"   long_name="sea_water_potential_temperature"      /> 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/CONFIG/SHARED/namelist_c14b_ref

    • Property svn:mime-type set to text/x-fortran
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/CONFIG/SHARED/namelist_cfc_ref

    • Property svn:mime-type set to text/x-fortran
    r4147 r10115  
    88   ndate_beg  = 300101    !  datedeb1 
    99   nyear_res  = 1932      !  iannee1 
     10   ! Formatted file of annual hemisperic CFCs concentration in the atmosphere (ppt) 
     11   clnamecfc   = 'CFCs_CMIP6.dat' 
    1012/ 
    1113!''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/CONFIG/SHARED/namelist_ice_lim2_ref

    • Property svn:mime-type set to text/x-fortran
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/CONFIG/SHARED/namelist_ice_lim3_ref

    • Property svn:mime-type set to text/x-fortran
    r7261 r10115  
    6969   rn_relast      =    0.333       !  ratio of elastic timescale to ice time step: Telast = dt_ice * rn_relast  
    7070                                   !     advised value: 1/3 (rn_nevp=120) or 1/9 (rn_nevp=300) 
    71    nn_ahi0        =    2           !  horizontal diffusivity computation 
    72                                    !     0: use rn_ahi0_ref 
    73                                    !     1: use rn_ahi0_ref x mean grid cell length / ( 2deg mean grid cell length ) 
    74                                    !     2: use rn_ahi0_ref x grid cell length      / ( 2deg mean grid cell length ) 
    75    rn_ahi0_ref    = 350.0          !  horizontal sea ice diffusivity (m2/s)  
    76                                    !     if nn_ahi0 > 0, rn_ahi0_ref is the reference value at a nominal 2 deg resolution 
    7771/ 
    7872!------------------------------------------------------------------------------ 
    7973&namicehdf     !   Ice horizontal diffusion 
    8074!------------------------------------------------------------------------------ 
     75   nn_ahi0        =    -1          !  horizontal diffusivity computation 
     76                                   !    -1: no diffusion (bypass limhdf) 
     77                                   !     0: use rn_ahi0_ref 
     78                                   !     1: use rn_ahi0_ref x mean grid cell length / ( 2deg mean grid cell length ) 
     79                                   !     2: use rn_ahi0_ref x grid cell length      / ( 2deg mean grid cell length ) 
     80   rn_ahi0_ref    = 350.0          !  horizontal sea ice diffusivity (m2/s) 
     81                                   !     if nn_ahi0 > 0, rn_ahi0_ref is the reference value at a nominal 2 deg resolution 
    8182   nn_convfrq     = 5              !  convergence check frequency of the Crant-Nicholson scheme (perf. optimization) 
    8283/ 
     
    9899                                   !     0: k = k0 + beta.S/T (Untersteiner, 1964) 
    99100                                   !     1: k = k0 + beta1.S/T - beta2.T (Pringle et al., 2007) 
     101   rn_cdsn     = 0.31              !  thermal conductivity of the snow (0.31 W/m/K, Maykut and Untersteiner, 1971) 
     102                                   !  Obs: 0.1-0.5 (Lecomte et al, JAMES 2013) 
    100103   nn_monocat  = 0                 !  virtual ITD mono-category parameterizations (1, jpl = 1 only) or not (0) 
    101104                                   !     2: simple piling instead of ridging --- temporary option 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/CONFIG/SHARED/namelist_pisces_ref

    • Property svn:mime-type set to text/x-fortran
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/CONFIG/SHARED/namelist_ref

    • Property svn:mime-type set to text/x-fortran
    r10110 r10115  
    500500                        !     1: "home made" based on Brandt et al. (J. Climate 2005) 
    501501                        !                         and Grenfell & Perovich (JGR 2004) 
    502    rn_albice   =  0.53  !  albedo of bare puddled ice (values from 0.49 to 0.58) 
    503                         !     0.53 (default) => if nn_ice_alb=0 
    504                         !     0.50 (default) => if nn_ice_alb=1 
    505502/ 
    506503!----------------------------------------------------------------------- 
     
    12271224   ln_ignmis  = .true.     ! Logical switch for ignoring missing files 
    12281225   endailyavtypes = 820    ! ENACT daily average types - array (use namelist_cfg to set more values) 
    1229    ln_grid_global = .true. 
    1230    ln_grid_search_lookup = .false. 
    12311226/ 
    12321227!----------------------------------------------------------------------- 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/CONFIG/SHARED/namelist_top_ref

    • Property svn:mime-type set to text/x-fortran
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/CONFIG/cfg.txt

    r7261 r10115  
    1111GYRE OPA_SRC 
    1212ORCA2_LIM OPA_SRC LIM_SRC_2 NST_SRC 
     13 
     14ORCA025_LIM-T37717 OPA_SRC LIM_SRC_3 NST_SRC TOP_SRC 
     15ORCA025_LIM-T377 OPA_SRC LIM_SRC_3 NST_SRC TOP_SRC 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/CONFIG/makenemo

    r5602 r10115  
    264264   . ${COMPIL_DIR}/Fread_dir.sh NST_SRC    YES 
    265265   . ${COMPIL_DIR}/Fread_dir.sh OFF_SRC    NO 
     266        . ${COMPIL_DIR}/Fread_dir.sh OOO_SRC     NO 
     267        . ${COMPIL_DIR}/Fread_dir.sh SAS_SRC     NO 
    266268   REF_CONF=ORCA2_LIM 
    267269    elif [ ${#NEM_SUBDIR} -gt 0 ] && [ ${#REF_CONF} -eq 0 ] && [ ${#USP_CONF} -eq 0 ] ; then 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/LIM_SRC_3/ice.F90

    r7806 r10115  
    419419   FUNCTION ice_alloc() 
    420420      !!----------------------------------------------------------------- 
    421       !!               *** Routine ice_alloc_2 *** 
     421      !!               *** Routine ice_alloc *** 
    422422      !!----------------------------------------------------------------- 
    423423      INTEGER :: ice_alloc 
     
    506506 
    507507      ice_alloc = MAXVAL( ierr(:) ) 
    508       IF( ice_alloc /= 0 )   CALL ctl_warn('ice_alloc_2: failed to allocate arrays.') 
     508      IF( ice_alloc /= 0 )   CALL ctl_warn('ice_alloc: failed to allocate arrays.') 
    509509      ! 
    510510   END FUNCTION ice_alloc 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/LIM_SRC_3/limitd_me.F90

    r7256 r10115  
    259259                  closing_net(ji,jj) = 0._wp 
    260260                  opning     (ji,jj) = 0._wp 
     261                  ato_i      (ji,jj) = MAX( 0._wp, 1._wp - SUM( a_i(ji,jj,:) ) ) 
    261262               ELSE 
    262263                  iterate_ridging    = 1 
     
    844845         END DO 
    845846    
    846          strength(:,:) = rn_pe_rdg * Cp * strength(:,:) / aksum(:,:) 
     847         strength(:,:) = rn_pe_rdg * Cp * strength(:,:) / aksum(:,:) * tmask(:,:,1) 
    847848                         ! where Cp = (g/2)*(rhow-rhoi)*(rhoi/rhow) and rn_pe_rdg accounts for frictional dissipation 
    848849         ksmooth = 1 
     
    853854      ELSE                      ! kstrngth ne 1:  Hibler (1979) form 
    854855         ! 
    855          strength(:,:) = rn_pstar * vt_i(:,:) * EXP( - rn_crhg * ( 1._wp - at_i(:,:) )  ) 
     856         strength(:,:) = rn_pstar * vt_i(:,:) * EXP( - rn_crhg * ( 1._wp - at_i(:,:) )  ) * tmask(:,:,1) 
    856857         ! 
    857858         ksmooth = 1 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/LIM_SRC_3/limrst.F90

    r7806 r10115  
    348348         &                   '   control of time parameter  nrstdt' ) 
    349349 
     350      ! Prognostic variables  
    350351      DO jl = 1, jpl  
    351352         WRITE(zchar,'(I2)') jl 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/LIM_SRC_3/limupdate1.F90

    r7256 r10115  
    6262 
    6363      IF( kt == nit000 .AND. lwp ) THEN 
    64          WRITE(numout,*) ' lim_update1 '  
    65          WRITE(numout,*) ' ~~~~~~~~~~~ ' 
     64         WRITE(numout,*)''  
     65         WRITE(numout,*)' lim_update1 '  
     66         WRITE(numout,*)' ~~~~~~~~~~~ ' 
    6667      ENDIF 
    6768 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/LIM_SRC_3/limupdate2.F90

    r7256 r10115  
    6262 
    6363      IF( kt == nit000 .AND. lwp ) THEN 
    64          WRITE(numout,*) ' lim_update2 ' 
    65          WRITE(numout,*) ' ~~~~~~~~~~~ ' 
     64         WRITE(numout,*)'' 
     65         WRITE(numout,*)' lim_update2 ' 
     66         WRITE(numout,*)' ~~~~~~~~~~~ ' 
    6667      ENDIF 
    6768 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/LIM_SRC_3/limvar.F90

    r7256 r10115  
    2727   !!                        - et_i(jpi,jpj)  !total ice thermal content  
    2828   !!                        - smt_i(jpi,jpj) !mean ice salinity 
    29    !!                        - ot_i(jpi,jpj)  !average ice age 
     29   !!                        - tm_i (jpi,jpj) !mean ice temperature 
    3030   !!====================================================================== 
    3131   !! History :   -   ! 2006-01 (M. Vancoppenolle) Original code 
     
    400400      ! 
    401401   END SUBROUTINE lim_var_salprof 
     402 
    402403 
    403404   SUBROUTINE lim_var_bv 
     
    654655      INTEGER  :: ji, jk, jl             ! dummy loop indices 
    655656      INTEGER  :: ijpij, i_fill, jl0   
    656       REAL(wp) :: zarg, zV, zconv, zdh 
     657      REAL(wp) :: zarg, zV, zconv, zdh, zdv 
    657658      REAL(wp), DIMENSION(:),   INTENT(in)    ::   zhti, zhts, zai    ! input ice/snow variables 
    658659      REAL(wp), DIMENSION(:,:), INTENT(inout) ::   zht_i, zht_s, za_i ! output ice/snow variables 
     
    675676         IF( zhti(ji) > 0._wp ) THEN 
    676677 
    677          ! initialisation of tests 
    678          itest(:)  = 0 
     678            ! find which category (jl0) the input ice thickness falls into 
     679            jl0 = jpl 
     680            DO jl = 1, jpl 
     681               IF ( ( zhti(ji) >= hi_max(jl-1) ) .AND. ( zhti(ji) < hi_max(jl) ) ) THEN 
     682                  jl0 = jl 
     683                  CYCLE 
     684               ENDIF 
     685            END DO 
     686 
     687            ! initialisation of tests 
     688            itest(:)  = 0 
    679689          
    680          i_fill = jpl + 1                                             !==================================== 
    681          DO WHILE ( ( SUM( itest(:) ) /= 4 ) .AND. ( i_fill >= 2 ) )  ! iterative loop on i_fill categories   
    682             ! iteration                                               !==================================== 
    683             i_fill = i_fill - 1 
     690            i_fill = jpl + 1                                             !==================================== 
     691            DO WHILE ( ( SUM( itest(:) ) /= 4 ) .AND. ( i_fill >= 2 ) )  ! iterative loop on i_fill categories 
     692               ! iteration                                               !==================================== 
     693               i_fill = i_fill - 1 
     694                
     695               ! initialisation of ice variables for each try 
     696               zht_i(ji,1:jpl) = 0._wp 
     697               za_i (ji,1:jpl) = 0._wp 
     698               itest(:)        = 0       
     699                
     700               ! *** case very thin ice: fill only category 1 
     701               IF ( i_fill == 1 ) THEN 
     702                  zht_i(ji,1) = zhti(ji) 
     703                  za_i (ji,1) = zai (ji) 
     704                   
     705               ! *** case ice is thicker: fill categories >1 
     706               ELSE 
     707 
     708                  ! Fill ice thicknesses in the (i_fill-1) cat by hmean  
     709                  DO jl = 1, i_fill - 1 
     710                     zht_i(ji,jl) = hi_mean(jl) 
     711                  END DO 
     712                   
     713                  ! Concentrations in the (i_fill-1) categories  
     714                  za_i(ji,jl0) = zai(ji) / SQRT(REAL(jpl)) 
     715                  DO jl = 1, i_fill - 1 
     716                     IF ( jl /= jl0 ) THEN 
     717                        zarg        = ( zht_i(ji,jl) - zhti(ji) ) / ( zhti(ji) * 0.5_wp ) 
     718                        za_i(ji,jl) =   za_i (ji,jl0) * EXP(-zarg**2) 
     719                     ENDIF 
     720                  END DO 
     721                   
     722                  ! Concentration in the last (i_fill) category 
     723                  za_i(ji,i_fill) = zai(ji) - SUM( za_i(ji,1:i_fill-1) ) 
     724                   
     725                  ! Ice thickness in the last (i_fill) category 
     726                  zV = SUM( za_i(ji,1:i_fill-1) * zht_i(ji,1:i_fill-1) ) 
     727                  zht_i(ji,i_fill) = ( zhti(ji) * zai(ji) - zV ) / MAX( za_i(ji,i_fill), epsi10 )  
     728                   
     729                  ! clem: correction if concentration of upper cat is greater than lower cat 
     730                  !       (it should be a gaussian around jl0 but sometimes it is not) 
     731                  IF ( jl0 /= jpl ) THEN 
     732                     DO jl = jpl, jl0+1, -1 
     733                        IF ( za_i(ji,jl) > za_i(ji,jl-1) ) THEN 
     734                           zdv = zht_i(ji,jl) * za_i(ji,jl) 
     735                           zht_i(ji,jl    ) = 0._wp 
     736                           za_i (ji,jl    ) = 0._wp 
     737                           za_i (ji,1:jl-1) = za_i(ji,1:jl-1) + zdv / MAX( REAL(jl-1) * zhti(ji), epsi10 ) 
     738                        END IF 
     739                     ENDDO 
     740                  ENDIF 
     741                
     742               ENDIF ! case ice is thick or thin 
    684743             
    685             ! initialisation of ice variables for each try 
    686             zht_i(ji,1:jpl) = 0._wp 
    687             za_i (ji,1:jpl) = 0._wp 
    688             itest(:)        = 0       
    689        
    690             ! *** case very thin ice: fill only category 1 
    691             IF ( i_fill == 1 ) THEN 
    692                zht_i(ji,1) = zhti(ji) 
    693                za_i (ji,1) = zai (ji) 
    694  
    695             ! *** case ice is thicker: fill categories >1 
    696             ELSE 
    697  
    698                ! Fill ice thicknesses except the last one (i_fill) by hmean  
    699                DO jl = 1, i_fill - 1 
    700                   zht_i(ji,jl) = hi_mean(jl) 
    701                END DO 
     744               !--------------------- 
     745               ! Compatibility tests 
     746               !---------------------  
     747               ! Test 1: area conservation 
     748               zconv = ABS( zai(ji) - SUM( za_i(ji,1:jpl) ) ) 
     749               IF ( zconv < epsi06 ) itest(1) = 1 
     750             
     751               ! Test 2: volume conservation 
     752               zconv = ABS( zhti(ji)*zai(ji) - SUM( za_i(ji,1:jpl)*zht_i(ji,1:jpl) ) ) 
     753               IF ( zconv < epsi06 ) itest(2) = 1 
    702754                
    703                ! find which category (jl0) the input ice thickness falls into 
    704                jl0 = i_fill 
     755               ! Test 3: thickness of the last category is in-bounds ? 
     756               IF ( zht_i(ji,i_fill) >= hi_max(i_fill-1) ) itest(3) = 1 
     757                
     758               ! Test 4: positivity of ice concentrations 
     759               itest(4) = 1 
    705760               DO jl = 1, i_fill 
    706                   IF ( ( zhti(ji) >= hi_max(jl-1) ) .AND. ( zhti(ji) < hi_max(jl) ) ) THEN 
    707                      jl0 = jl 
    708            CYCLE 
    709                   ENDIF 
    710                END DO 
    711                 
    712                ! Concentrations in the (i_fill-1) categories  
    713                za_i(ji,jl0) = zai(ji) / SQRT(REAL(jpl)) 
    714                DO jl = 1, i_fill - 1 
    715                   IF ( jl == jl0 ) CYCLE 
    716                   zarg        = ( zht_i(ji,jl) - zhti(ji) ) / ( zhti(ji) * 0.5_wp ) 
    717                   za_i(ji,jl) =   za_i (ji,jl0) * EXP(-zarg**2) 
    718                END DO 
    719                 
    720                ! Concentration in the last (i_fill) category 
    721                za_i(ji,i_fill) = zai(ji) - SUM( za_i(ji,1:i_fill-1) ) 
    722                 
    723                ! Ice thickness in the last (i_fill) category 
    724                zV = SUM( za_i(ji,1:i_fill-1) * zht_i(ji,1:i_fill-1) ) 
    725                zht_i(ji,i_fill) = ( zhti(ji) * zai(ji) - zV ) / za_i(ji,i_fill)  
    726                 
    727             ENDIF ! case ice is thick or thin 
    728              
    729             !--------------------- 
    730             ! Compatibility tests 
    731             !---------------------  
    732             ! Test 1: area conservation 
    733             zconv = ABS( zai(ji) - SUM( za_i(ji,1:jpl) ) ) 
    734             IF ( zconv < epsi06 ) itest(1) = 1 
    735              
    736             ! Test 2: volume conservation 
    737             zconv = ABS( zhti(ji)*zai(ji) - SUM( za_i(ji,1:jpl)*zht_i(ji,1:jpl) ) ) 
    738             IF ( zconv < epsi06 ) itest(2) = 1 
    739              
    740             ! Test 3: thickness of the last category is in-bounds ? 
    741             IF ( zht_i(ji,i_fill) >= hi_max(i_fill-1) ) itest(3) = 1 
    742              
    743             ! Test 4: positivity of ice concentrations 
    744             itest(4) = 1 
    745             DO jl = 1, i_fill 
    746                IF ( za_i(ji,jl) < 0._wp ) itest(4) = 0 
    747             END DO             
    748                                                            !============================ 
    749          END DO                                            ! end iteration on categories 
    750                                                            !============================ 
     761                  IF ( za_i(ji,jl) < 0._wp ) itest(4) = 0 
     762               END DO 
     763               !                                         !============================ 
     764            END DO                                       ! end iteration on categories 
     765               !                                         !============================ 
    751766         ENDIF ! if zhti > 0 
    752767      END DO ! i loop 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/NST_SRC/agrif_opa_interp.F90

    r7256 r10115  
    808808      ! 
    809809      IF (before) THEN  
    810          DO jk=1,jpk 
     810         DO jk=1,jpkm1 
    811811            DO jj=j1,j2 
    812812               DO ji=i1,i2 
     
    876876      IF (before) THEN           
    877877         !interpv entre 1 et k2 et interpv2d en jpkp1 
    878          DO jk=k1,jpk 
     878         DO jk=1,jpkm1 
    879879            DO jj=j1,j2 
    880880               DO ji=i1,i2 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/NST_SRC/agrif_user.F90

    r7256 r10115  
    241241         WRITE(cl_check2,*)  NINT(rdt) 
    242242         WRITE(cl_check3,*)  NINT(Agrif_Parent(rdt)/Agrif_Rhot()) 
    243          CALL ctl_warn( 'incompatible time step between grids',   & 
     243         CALL ctl_stop( 'incompatible time step between grids',   & 
    244244               &               'parent grid value : '//cl_check1    ,   &  
    245245               &               'child  grid value : '//cl_check2    ,   &  
    246                &               'value on child grid will be changed to : '//cl_check3 ) 
    247          rdt=Agrif_Parent(rdt)/Agrif_Rhot() 
     246               &               'value on child grid must be changed to : '//cl_check3 ) 
     247!         rdt=Agrif_Parent(rdt)/Agrif_Rhot() 
    248248      ENDIF 
    249249 
     
    254254         WRITE(cl_check2,*)   Agrif_Parent(nitend)   *Agrif_IRhot() 
    255255         CALL ctl_warn( 'incompatible run length between grids'               ,   & 
    256                &              ' nit000 on fine grid will be change to : '//cl_check1,   & 
    257                &              ' nitend on fine grid will be change to : '//cl_check2    ) 
     256               &              ' nit000 on fine grid will be changed to : '//cl_check1,   & 
     257               &              ' nitend on fine grid will be changed to : '//cl_check2    ) 
    258258         nit000 = (Agrif_Parent(nit000)-1)*Agrif_IRhot() + 1 
    259259         nitend =  Agrif_Parent(nitend)   *Agrif_IRhot() 
     
    610610         WRITE(cl_check2,*)  rdt 
    611611         WRITE(cl_check3,*)  rdt*Agrif_Rhot() 
    612          CALL ctl_warn( 'incompatible time step between grids',   & 
     612         CALL ctl_stop( 'incompatible time step between grids',   & 
    613613               &               'parent grid value : '//cl_check1    ,   &  
    614614               &               'child  grid value : '//cl_check2    ,   &  
    615                &               'value on child grid will be changed to  & 
     615               &               'value on child grid must be changed to  & 
    616616               &               :'//cl_check3  ) 
    617          rdt=rdt*Agrif_Rhot() 
     617!         rdt=rdt*Agrif_Rhot() 
    618618      ENDIF 
    619619 
     
    624624         WRITE(cl_check2,*)   Agrif_Parent(nitend)   *Agrif_IRhot() 
    625625         CALL ctl_warn( 'incompatible run length between grids'               ,   & 
    626                &              ' nit000 on fine grid will be change to : '//cl_check1,   & 
    627                &              ' nitend on fine grid will be change to : '//cl_check2    ) 
     626               &              ' nit000 on fine grid will be changed to : '//cl_check1,   & 
     627               &              ' nitend on fine grid will be changed to : '//cl_check2    ) 
    628628         nit000 = (Agrif_Parent(nit000)-1)*Agrif_IRhot() + 1 
    629629         nitend =  Agrif_Parent(nitend)   *Agrif_IRhot() 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/OFF_SRC/domrea.F90

    r7806 r10115  
    8282      e12u    (:,:) = e1u(:,:) * e2u(:,:) 
    8383      e12v    (:,:) = e1v(:,:) * e2v(:,:) 
    84       e12f    (:,:) = e1f(:,:) * e2f(:,:) 
    8584      r1_e12t (:,:) = 1._wp    / e12t(:,:) 
    8685      r1_e12u (:,:) = 1._wp    / e12u(:,:) 
    8786      r1_e12v (:,:) = 1._wp    / e12v(:,:) 
    88       r1_e12f (:,:) = 1._wp    / e12f(:,:) 
    8987      re2u_e1u(:,:) = e2u(:,:) / e1u(:,:) 
    9088      re1v_e2v(:,:) = e1v(:,:) / e2v(:,:) 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/OPA_SRC/ASM/asminc.F90

    r7256 r10115  
    8787   REAL(wp), DIMENSION(:,:), ALLOCATABLE ::   ssh_bkg, ssh_bkginc   ! Background sea surface height and its increment 
    8888   REAL(wp), DIMENSION(:,:), ALLOCATABLE ::   seaice_bkginc         ! Increment to the background sea ice conc 
     89#if defined key_cice && defined key_asminc 
     90   REAL(wp), DIMENSION(:,:), ALLOCATABLE ::   ndaice_da             ! ice increment tendency into CICE 
     91#endif 
    8992 
    9093   !! * Substitutions 
     
    336339      ALLOCATE( ssh_iau(jpi,jpj)      ) 
    337340#endif 
     341#if defined key_cice && defined key_asminc 
     342      ALLOCATE( ndaice_da(jpi,jpj)      ) 
     343#endif 
    338344      t_bkginc(:,:,:) = 0.0 
    339345      s_bkginc(:,:,:) = 0.0 
     
    344350#if defined key_asminc 
    345351      ssh_iau(:,:)    = 0.0 
     352#endif 
     353#if defined key_cice && defined key_asminc 
     354      ndaice_da(:,:) = 0.0 
    346355#endif 
    347356      IF ( ( ln_trainc ).OR.( ln_dyninc ).OR.( ln_sshinc ).OR.( ln_seaiceinc ) ) THEN 
     
    891900               DEALLOCATE( ssh_bkginc ) 
    892901            ENDIF 
    893  
     902#if defined key_asminc 
     903         ELSE IF( kt == nitiaufin_r+1 ) THEN 
     904            !   
     905            ssh_iau(:,:) = 0._wp 
     906            !  
     907#endif 
    894908         ENDIF 
    895909 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/OPA_SRC/BDY/bdydta.F90

    r7256 r10115  
    3636   USE limvar          ! redistribute ice input into categories 
    3737#endif 
     38   USE sbc_oce 
    3839   USE sbcapr 
    3940 
     
    395396      ! end jchanut tschanges 
    396397 
    397       IF ( ln_apr_obc ) THEN 
    398          DO ib_bdy = 1, nb_bdy 
    399             IF (cn_tra(ib_bdy) /= 'runoff')THEN 
    400                igrd = 1                      ! meridional velocity 
    401                DO ib = 1, idx_bdy(ib_bdy)%nblenrim(igrd) 
    402                   ii   = idx_bdy(ib_bdy)%nbi(ib,igrd) 
    403                   ij   = idx_bdy(ib_bdy)%nbj(ib,igrd) 
    404                   dta_bdy(ib_bdy)%ssh(ib) = dta_bdy(ib_bdy)%ssh(ib) + ssh_ib(ii,ij) 
    405                ENDDO 
    406             ENDIF 
    407          ENDDO 
     398      IF( ln_apr_dyn )THEN 
     399         IF( ln_apr_obc ) THEN 
     400            DO ib_bdy = 1, nb_bdy 
     401               IF (cn_tra(ib_bdy) /= 'runoff')THEN 
     402                  igrd = 1                      ! meridional velocity 
     403                  DO ib = 1, idx_bdy(ib_bdy)%nblenrim(igrd) 
     404                     ii   = idx_bdy(ib_bdy)%nbi(ib,igrd) 
     405                     ij   = idx_bdy(ib_bdy)%nbj(ib,igrd) 
     406                     dta_bdy(ib_bdy)%ssh(ib) = dta_bdy(ib_bdy)%ssh(ib) + ssh_ib(ii,ij) 
     407                  ENDDO 
     408               ENDIF 
     409            ENDDO 
     410         ENDIF 
    408411      ENDIF 
    409412 
     
    440443      TYPE(OBC_DATA), POINTER                ::   dta           ! short cut 
    441444#if defined key_lim3 
    442       INTEGER, DIMENSION(3) ::   zdimsz   ! number of elements in each of the 4 dimensions (i.e. i,j,t,ice-cat) for an array 
    443445      INTEGER               ::   zndims   ! number of dimensions in an array (i.e. 3 = wo ice cat; 4 = w ice cat) 
    444446      INTEGER               ::   inum,id1 ! local integer 
     
    672674               ! Test for types of ice input (lim2 or lim3) 
    673675               ! Build file name to find dimensions  
    674                clname=TRIM(bn_a_i%clname) 
     676               clname=TRIM( cn_dir )//TRIM(bn_a_i%clname) 
    675677               IF( .NOT. bn_a_i%ln_clim ) THEN    
    676                                                   WRITE(clname, '(a,"_y",i4.4)' ) TRIM( bn_a_i%clname ), nyear    ! add year 
    677                   IF( bn_a_i%cltype /= 'yearly' ) WRITE(clname, '(a,"m" ,i2.2)' ) TRIM( clname        ), nmonth   ! add month 
     678                                                  WRITE(clname, '(a,"_y",i4.4)' ) TRIM( clname ), nyear    ! add year 
     679                  IF( bn_a_i%cltype /= 'yearly' ) WRITE(clname, '(a,"m" ,i2.2)' ) TRIM( clname ), nmonth   ! add month 
    678680               ELSE 
    679                   IF( bn_a_i%cltype /= 'yearly' ) WRITE(clname, '(a,"_m",i2.2)' ) TRIM( bn_a_i%clname ), nmonth   ! add month 
     681                  IF( bn_a_i%cltype /= 'yearly' ) WRITE(clname, '(a,"_m",i2.2)' ) TRIM( clname ), nmonth   ! add month 
    680682               ENDIF 
    681683               IF( bn_a_i%cltype == 'daily' .OR. bn_a_i%cltype(1:4) == 'week' ) & 
    682                &                                  WRITE(clname, '(a,"d" ,i2.2)' ) TRIM( clname        ), nday     ! add day 
     684               &                                  WRITE(clname, '(a,"d" ,i2.2)' ) TRIM( clname ), nday     ! add day 
    683685               ! 
    684686               CALL iom_open  ( clname, inum ) 
    685                id1 = iom_varid( inum, bn_a_i%clvar, kdimsz=zdimsz, kndims=zndims, ldstop = .FALSE. ) 
     687               id1 = iom_varid( inum, bn_a_i%clvar, kndims=zndims, ldstop = .FALSE. ) 
    686688               CALL iom_close ( inum ) 
    687689 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/OPA_SRC/DIA/diaar5.F90

    r7806 r10115  
    8181      ! 
    8282      REAL(wp), POINTER, DIMENSION(:,:)     :: zarea_ssh , zbotpres       ! 2D workspace  
    83       REAL(wp), POINTER, DIMENSION(:,:)     :: pe                         ! 2D workspace  
     83      REAL(wp), POINTER, DIMENSION(:,:)     :: zpe                        ! 2D workspace  
    8484      REAL(wp), POINTER, DIMENSION(:,:,:)   :: zrhd , zrhop               ! 3D workspace 
    8585      REAL(wp), POINTER, DIMENSION(:,:,:,:) :: ztsn                       ! 4D workspace 
     
    9191      IF( kt == nit000 )     CALL dia_ar5_init 
    9292  
    93       CALL wrk_alloc( jpi , jpj              , zarea_ssh , zbotpres, pe ) 
    94       CALL wrk_alloc( jpi , jpj , jpk        , zrhd      , zrhop    ) 
    95       CALL wrk_alloc( jpi , jpj , jpk , jpts , ztsn                 ) 
     93      CALL wrk_alloc( jpi , jpj              , zarea_ssh , zbotpres, zpe ) 
     94      CALL wrk_alloc( jpi , jpj , jpk        , zrhd      , zrhop         ) 
     95      CALL wrk_alloc( jpi , jpj , jpk , jpts , ztsn                      ) 
    9696 
    9797      zarea_ssh(:,:) = area(:,:) * sshn(:,:) 
     
    206206      ! Exclude points where rn2 is negative as convection kicks in here and 
    207207      ! work is not being done against stratification 
    208           pe(:,:) = 0._wp 
    209           IF( lk_zdfddm ) THEN 
    210              DO ji=1,jpi 
    211                 DO jj=1,jpj 
    212                    DO jk=1,jpk 
    213                       zrw =   ( fsdepw(ji,jj,jk  ) - fsdept(ji,jj,jk) )   & 
    214                          &  / ( fsdept(ji,jj,jk-1) - fsdept(ji,jj,jk) ) 
    215                       ! 
    216                       zaw = rab_n(ji,jj,jk,jp_tem) * (1. - zrw) + rab_n(ji,jj,jk-1,jp_tem)* zrw 
    217                       zbw = rab_n(ji,jj,jk,jp_sal) * (1. - zrw) + rab_n(ji,jj,jk-1,jp_sal)* zrw 
    218                       ! 
    219                       pe(ji, jj) = pe(ji, jj) - MIN(0._wp, rn2(ji,jj,jk)) * & 
    220                            &       grav * (avt(ji,jj,jk) * zaw * (tsn(ji,jj,jk-1,jp_tem) - tsn(ji,jj,jk,jp_tem) )  & 
    221                            &       - fsavs(ji,jj,jk) * zbw * (tsn(ji,jj,jk-1,jp_sal) - tsn(ji,jj,jk,jp_sal) ) ) 
    222  
    223                    ENDDO 
    224                 ENDDO 
    225              ENDDO 
     208         zpe(:,:) = 0._wp 
     209         IF( lk_zdfddm ) THEN 
     210            DO jk = 2, jpk 
     211               DO jj = 1, jpj 
     212                  DO ji = 1, jpi 
     213                     IF( rn2(ji,jj,jk) > 0._wp ) THEN 
     214                        zrw =   ( fsdepw(ji,jj,jk  ) - fsdept(ji,jj,jk) )   & 
     215                           &  / ( fsdept(ji,jj,jk-1) - fsdept(ji,jj,jk) ) 
     216                        ! 
     217                        zaw = rab_n(ji,jj,jk,jp_tem) * (1. - zrw) + rab_n(ji,jj,jk-1,jp_tem)* zrw 
     218                        zbw = rab_n(ji,jj,jk,jp_sal) * (1. - zrw) + rab_n(ji,jj,jk-1,jp_sal)* zrw 
     219                        ! 
     220                        zpe(ji, jj) = zpe(ji, jj)            & 
     221                           &        -  grav * (    avt(ji,jj,jk) * zaw * (tsn(ji,jj,jk-1,jp_tem) - tsn(ji,jj,jk,jp_tem) )  & 
     222                           &                   - fsavs(ji,jj,jk) * zbw * (tsn(ji,jj,jk-1,jp_sal) - tsn(ji,jj,jk,jp_sal) ) ) 
     223                     ENDIF 
     224                  END DO 
     225               END DO 
     226             END DO 
    226227          ELSE 
    227              DO ji=1,jpi 
    228                 DO jj=1,jpj 
    229                    DO jk=1,jpk 
    230                        pe(ji,jj) = pe(ji,jj) + avt(ji, jj, jk) * MIN(0._wp,rn2(ji, jj, jk)) * rau0 * fse3w(ji, jj, jk) 
    231                    ENDDO 
    232                 ENDDO 
    233              ENDDO 
    234           ENDIF 
    235           CALL lbc_lnk(pe, 'T', 1._wp)          
    236           CALL iom_put( 'tnpeo', pe ) 
     228            DO jk = 1, jpk 
     229               DO ji = 1, jpi 
     230                  DO jj = 1, jpj 
     231                     zpe(ji,jj) = zpe(ji,jj) + avt(ji, jj, jk) * MIN(0._wp,rn2(ji, jj, jk)) * rau0 * fse3w(ji, jj, jk) 
     232                  END DO 
     233               END DO 
     234            END DO 
     235         ENDIF 
     236         CALL lbc_lnk(zpe, 'T', 1._wp)          
     237         CALL iom_put( 'tnpeo', zpe ) 
    237238      ENDIF 
    238239      ! 
    239       CALL wrk_dealloc( jpi , jpj              , zarea_ssh , zbotpres, pe ) 
    240       CALL wrk_dealloc( jpi , jpj , jpk        , zrhd      , zrhop    ) 
    241       CALL wrk_dealloc( jpi , jpj , jpk , jpts , ztsn                 ) 
     240      CALL wrk_dealloc( jpi , jpj              , zarea_ssh , zbotpres, zpe ) 
     241      CALL wrk_dealloc( jpi , jpj , jpk        , zrhd      , zrhop         ) 
     242      CALL wrk_dealloc( jpi , jpj , jpk , jpts , ztsn                      ) 
    242243      ! 
    243244      IF( nn_timing == 1 )   CALL timing_stop('dia_ar5') 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/OPA_SRC/DIA/diadct.F90

    r5602 r10115  
    249249           !debug this section computing ? 
    250250           lldebug=.FALSE. 
    251            IF( (jsec==nn_secdebug .OR. nn_secdebug==-1) .AND.  kt==nit000+nn_dct-1 .AND. lwp ) lldebug=.TRUE.  
     251           IF( (jsec==nn_secdebug .OR. nn_secdebug==-1) .AND.  kt==nit000+nn_dct-1 ) lldebug=.TRUE.  
    252252 
    253253           !Compute transport through section   
     
    258258        IF( MOD(kt,nn_dctwri)==0 )THEN 
    259259 
    260            IF( lwp .AND. kt==nit000+nn_dctwri-1 )WRITE(numout,*)"      diadct: average transports and write at kt = ",kt          
     260           IF( kt==nit000+nn_dctwri-1 )WRITE(numout,*)"      diadct: average transports and write at kt = ",kt          
    261261   
    262262           !! divide arrays by nn_dctwri/nn_dct to obtain average  
     
    344344     DO jsec=1,nb_sec_max      !loop on the nb_sec sections 
    345345 
    346         IF ( lwp .AND. ( jsec==nn_secdebug .OR. nn_secdebug==-1 ) ) & 
     346        IF ( jsec==nn_secdebug .OR. nn_secdebug==-1 ) & 
    347347           & WRITE(numout,*)'debuging for section number: ',jsec  
    348348 
     
    364364        IF( jsec .NE. isec )  CALL ctl_stop( cltmp ) 
    365365 
    366         IF( lwp .AND. ( jsec==nn_secdebug .OR. nn_secdebug==-1 ) )WRITE(numout,*)"isec ",isec  
     366        IF( jsec==nn_secdebug .OR. nn_secdebug==-1 )WRITE(numout,*)"isec ",isec  
    367367 
    368368        READ(numdct_in)secs(jsec)%name 
     
    383383        !----- 
    384384 
    385         IF( lwp .AND. ( jsec==nn_secdebug .OR. nn_secdebug==-1 ) )THEN 
     385        IF( jsec==nn_secdebug .OR. nn_secdebug==-1 )THEN 
    386386           
    387387            WRITE(clformat,'(a,i2,a)') '(A40,', nb_class_max,'(f8.3,1X))'  
     
    416416           !debug 
    417417           !----- 
    418            IF( lwp .AND. ( jsec==nn_secdebug .OR. nn_secdebug==-1 ) )THEN 
     418           IF( jsec==nn_secdebug .OR. nn_secdebug==-1 )THEN 
    419419              WRITE(numout,*)"      List of points in global domain:" 
    420420              DO jpt=1,iptglo 
     
    450450           !debug 
    451451           !----- 
    452            IF(   lwp .AND. ( jsec==nn_secdebug .OR. nn_secdebug==-1 ) )THEN 
     452           IF( jsec==nn_secdebug .OR. nn_secdebug==-1 )THEN 
    453453              WRITE(numout,*)"      List of points selected by the proc:" 
    454454              DO jpt = 1,iptloc 
     
    468468           !remove redundant points between processors 
    469469           !------------------------------------------ 
    470            lldebug = .FALSE. ; IF ( (jsec==nn_secdebug .OR. nn_secdebug==-1) .AND. lwp ) lldebug = .TRUE. 
     470           lldebug = .FALSE. ; IF ( jsec==nn_secdebug .OR. nn_secdebug==-1 ) lldebug = .TRUE. 
    471471           IF( iptloc .NE. 0 )THEN 
    472472              CALL removepoints(secs(jsec),'I','top_list',lldebug) 
     
    484484           !debug 
    485485           !----- 
    486            IF( lwp .AND. ( jsec==nn_secdebug .OR. nn_secdebug==-1 ) )THEN 
     486           IF( jsec==nn_secdebug .OR. nn_secdebug==-1 )THEN 
    487487              WRITE(numout,*)"      List of points after removepoints:" 
    488488              iptloc = secs(jsec)%nb_point 
     
    496496 
    497497        ELSE  ! iptglo = 0 
    498            IF( lwp .AND. ( jsec==nn_secdebug .OR. nn_secdebug==-1 ) )& 
     498           IF( jsec==nn_secdebug .OR. nn_secdebug==-1 )& 
    499499              WRITE(numout,*)'   No points for this section.' 
    500500        ENDIF 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/OPA_SRC/DIA/diaprod.F90

    r7806 r10115  
    238238   !!   Default option :                                         NO diaprod 
    239239   !!---------------------------------------------------------------------- 
     240   USE in_out_manager  ! I/O manager 
    240241   LOGICAL, PUBLIC, PARAMETER :: lk_diaprod = .FALSE.   ! coupled flag 
    241242CONTAINS 
    242243   SUBROUTINE dia_prod( kt )   ! Empty routine 
    243244      INTEGER ::   kt 
    244       WRITE(*,*) 'dia_prod: You should not have seen this print! error?', kt 
     245      IF( kt == nit000 .AND. lwp ) & 
     246         WRITE(*,*) 'dia_prod: You should not have seen this print! error?', kt 
    245247   END SUBROUTINE dia_prod 
    246248#endif 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/OPA_SRC/DIA/diawri.F90

    r7806 r10115  
    296296      ! 
    297297      IF ( iom_use("eken") ) THEN 
    298          rke(:,:,jk) = 0._wp                               !      kinetic energy  
     298         rke(:,:,jpk) = 0._wp                               !      kinetic energy  
    299299         DO jk = 1, jpkm1 
    300300            DO jj = 2, jpjm1 
    301301               DO ji = fs_2, fs_jpim1   ! vector opt. 
    302                   zztmp   = 1._wp / ( e1e2t(ji,jj) * fse3t(ji,jj,jk) ) 
    303                   zztmpx  = 0.5 * (  un(ji-1,jj,jk) * un(ji-1,jj,jk) * e2u(ji-1,jj) * fse3u(ji-1,jj,jk)    & 
    304                      &             + un(ji  ,jj,jk) * un(ji  ,jj,jk) * e2u(ji  ,jj) * fse3u(ji  ,jj,jk) )  & 
     302                  zztmp   =  1 / (e1e2t(ji,jj) * fse3t(ji,jj,jk)) 
     303                  zztmpx  = 0.5 * (  un(ji-1,jj,jk) * un(ji-1,jj,jk) * e1u(ji-1,jj) * e2u(ji-1,jj) * fse3u(ji-1,jj,jk)    & 
     304                     &             + un(ji  ,jj,jk) * un(ji  ,jj,jk) * e1u(ji,  jj) * e2u(ji  ,jj) * fse3u(ji  ,jj,jk) )  & 
    305305                     &          *  zztmp  
    306306                  ! 
    307                   zztmpy  = 0.5 * (  vn(ji,jj-1,jk) * vn(ji,jj-1,jk) * e1v(ji,jj-1) * fse3v(ji,jj-1,jk)    & 
    308                      &             + vn(ji,jj  ,jk) * vn(ji,jj  ,jk) * e1v(ji,jj  ) * fse3v(ji,jj  ,jk) )  & 
     307                  zztmpy  = 0.5 * (  vn(ji,jj-1,jk) * vn(ji,jj-1,jk) * e1v(ji,jj-1) * e2v(ji,jj-1) * fse3v(ji,jj-1,jk)    & 
     308                     &             + vn(ji,jj  ,jk) * vn(ji,jj  ,jk) * e1v(ji,jj  ) * e2v(ji,jj  ) * fse3v(ji,jj  ,jk) )  & 
    309309                     &          *  zztmp  
    310310                  ! 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/OPA_SRC/DOM/dommsk.F90

    r7256 r10115  
    373373            ENDIF 
    374374         END DO 
     375#if defined key_agrif 
     376         IF( .NOT. AGRIF_Root() ) THEN 
     377            IF ((nbondi ==  1).OR.(nbondi == 2)) fmask(nlci-1 , :     ,jk) = 0.e0      ! east 
     378            IF ((nbondi == -1).OR.(nbondi == 2)) fmask(1      , :     ,jk) = 0.e0      ! west 
     379            IF ((nbondj ==  1).OR.(nbondj == 2)) fmask(:      ,nlcj-1 ,jk) = 0.e0      ! north 
     380            IF ((nbondj == -1).OR.(nbondj == 2)) fmask(:      ,1      ,jk) = 0.e0      ! south 
     381         ENDIF 
     382#endif 
    375383      END DO 
    376384      ! 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/OPA_SRC/DOM/domzgr.F90

    r7806 r10115  
    19701970      hbatt(:,:) = zenv(:,:)  
    19711971      IF( MINVAL( gphit(:,:) ) * MAXVAL( gphit(:,:) ) <= 0._wp ) THEN 
     1972      IF ( jphgr_msh == 2 .OR. jphgr_msh == 3) CALL ctl_stop( 'dom:zgr_sco:  if jphgr_msh = 2 or 3 and  &   
     1973                                & s-coordinates stop, if not correction at Equator is applied, but it is wrong') 
    19721974         CALL ctl_warn( ' s-coordinates are tapered in vicinity of the Equator' ) 
    19731975         DO jj = 1, jpj 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/OPA_SRC/DOM/phycst.F90

    r7806 r10115  
    4040   REAL(wp), PUBLIC ::   rtt      = 273.16_wp        !: triple point of temperature   [Kelvin] 
    4141   REAL(wp), PUBLIC ::   rt0      = 273.15_wp        !: freezing point of fresh water [Kelvin] 
     42   REAL(wp), PUBLIC ::   rt0_snow = 273.15_wp        !: melting point of snow         [Kelvin] 
    4243#if defined key_lim3 
    43    REAL(wp), PUBLIC ::   rt0_snow = 273.15_wp        !: melting point of snow         [Kelvin] 
    4444   REAL(wp), PUBLIC ::   rt0_ice  = 273.15_wp        !: melting point of ice          [Kelvin] 
    4545#else 
    46    REAL(wp), PUBLIC ::   rt0_snow = 273.15_wp        !: melting point of snow         [Kelvin] 
    4746   REAL(wp), PUBLIC ::   rt0_ice  = 273.05_wp        !: melting point of ice          [Kelvin] 
    4847#endif 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/OPA_SRC/DYN/dynldf_bilap.F90

    r4990 r10115  
    1818   USE oce             ! ocean dynamics and tracers 
    1919   USE dom_oce         ! ocean space and time domain 
     20   USE phycst          ! physical constants 
    2021   USE ldfdyn_oce      ! ocean dynamics: lateral physics 
    2122   ! 
    2223   USE in_out_manager  ! I/O manager 
     24   USE iom             ! I/O library 
    2325   USE lbclnk          ! ocean lateral boundary conditions (or mpp link) 
    2426   USE wrk_nemo        ! Memory Allocation 
     
    7577      INTEGER, INTENT(in) ::   kt   ! ocean time-step index 
    7678      ! 
    77       INTEGER  ::   ji, jj, jk                  ! dummy loop indices 
    78       REAL(wp) ::   zua, zva, zbt, ze2u, ze2v   ! temporary scalar 
    79       REAL(wp), POINTER, DIMENSION(:,:  ) :: zcu, zcv 
    80       REAL(wp), POINTER, DIMENSION(:,:,:) :: zuf, zut, zlu, zlv 
     79      INTEGER  ::   ji, jj, jk                       ! dummy loop indices 
     80      REAL(wp) ::   zua, zva, zbt, ze2u, ze2v, zzz   ! local scalar 
     81      REAL(wp), POINTER, DIMENSION(:,:  ) ::   zcu, zcv 
     82      REAL(wp), POINTER, DIMENSION(:,:,:) ::   zuf, zut, zlu, zlv 
     83      REAL(wp), ALLOCATABLE, DIMENSION(:,:) ::   z2d   ! 2D workspace  
    8184      !!---------------------------------------------------------------------- 
    8285      ! 
     
    112115            DO jj = 2, jpjm1 
    113116               DO ji = fs_2, fs_jpim1   ! vector opt. 
    114                   zlu(ji,jj,jk) = - ( zuf(ji,jj,jk) - zuf(ji,jj-1,jk) ) / ( e2u(ji,jj) * fse3u(ji,jj,jk) )   & 
    115                      &         + ( hdivb(ji+1,jj,jk) - hdivb(ji,jj,jk) ) / e1u(ji,jj) 
     117                  zlu(ji,jj,jk) = - (   zuf(ji  ,jj,jk) -  zuf(ji,jj-1,jk) ) / ( e2u(ji,jj) * fse3u(ji,jj,jk) )   & 
     118                     &            + ( hdivb(ji+1,jj,jk) - hdivb(ji,jj  ,jk) ) /  e1u(ji,jj) 
    116119    
    117                   zlv(ji,jj,jk) = + ( zuf(ji,jj,jk) - zuf(ji-1,jj,jk) ) / ( e1v(ji,jj) * fse3v(ji,jj,jk) )   & 
    118                      &         + ( hdivb(ji,jj+1,jk) - hdivb(ji,jj,jk) ) / e2v(ji,jj) 
     120                  zlv(ji,jj,jk) = + (   zuf(ji,jj  ,jk) -  zuf(ji-1,jj,jk) ) / ( e1v(ji,jj) * fse3v(ji,jj,jk) )   & 
     121                     &            + ( hdivb(ji,jj+1,jk) - hdivb(ji  ,jj,jk) ) /  e2v(ji,jj) 
    119122               END DO 
    120123            END DO 
     
    123126               DO ji = fs_2, fs_jpim1   ! vector opt. 
    124127                  zlu(ji,jj,jk) = - ( rotb (ji  ,jj,jk) - rotb (ji,jj-1,jk) ) / e2u(ji,jj)   & 
    125                      &         + ( hdivb(ji+1,jj,jk) - hdivb(ji,jj  ,jk) ) / e1u(ji,jj) 
     128                     &            + ( hdivb(ji+1,jj,jk) - hdivb(ji,jj  ,jk) ) / e1u(ji,jj) 
    126129    
    127130                  zlv(ji,jj,jk) = + ( rotb (ji,jj  ,jk) - rotb (ji-1,jj,jk) ) / e1v(ji,jj)   & 
    128                      &         + ( hdivb(ji,jj+1,jk) - hdivb(ji  ,jj,jk) ) / e2v(ji,jj) 
     131                     &            + ( hdivb(ji,jj+1,jk) - hdivb(ji  ,jj,jk) ) / e2v(ji,jj) 
    129132               END DO   
    130133            END DO   
     
    133136      CALL lbc_lnk( zlu, 'U', -1. )   ;   CALL lbc_lnk( zlv, 'V', -1. )   ! Boundary conditions 
    134137 
    135           
     138      IF( iom_use('dispkexyfo') ) THEN   ! ocean kinetic energy dissipation per unit area 
     139         !                               ! due to xy friction (xy=lateral)  
     140         !   see NEMO_book appendix C, §C.7.2 (N.B. here averaged at t-points) 
     141         !   local dissipation of KE at t-point due to bilaplacian operator is given by : 
     142         !      + ahmu mi( zlu**2 ) + mj( ahmv zlv**2 ) 
     143         !   Note that a sign + is used as in v3.6 ahm is negative for bilaplacian viscosity 
     144         ! 
     145         ! NB: ahm is negative when bilaplacian is used 
     146         ALLOCATE( z2d(jpi,jpj) ) 
     147         z2d(:,:) = 0._wp 
     148         DO jk = 1, jpkm1 
     149            DO jj = 2, jpjm1 
     150               DO ji = 2, jpim1 
     151                  z2d(ji,jj) = z2d(ji,jj)                                                                  & 
     152                     &  +  (  fsahmu(ji,jj,jk)*zlu(ji,jj,jk)**2 + fsahmu(ji-1,jj,jk)*zlu(ji-1,jj,jk)**2    & 
     153                     &      + fsahmv(ji,jj,jk)*zlv(ji,jj,jk)**2 + fsahmv(ji,jj-1,jk)*zlv(ji,jj-1,jk)**2  ) * tmask(ji,jj,jk) 
     154               END DO 
     155            END DO 
     156         END DO 
     157         zzz = 0.5_wp * rau0 
     158         z2d(:,:) = zzz * z2d(:,:)  
     159         CALL lbc_lnk( z2d,'T', 1. ) 
     160         CALL iom_put( 'dispkexyfo', z2d ) 
     161         DEALLOCATE( z2d ) 
     162      ENDIF 
     163       
     164    
     165      ! Third derivative 
     166      ! ---------------- 
     167      ! 
    136168      DO jk = 1, jpkm1 
    137     
    138          ! Third derivative 
    139          ! ---------------- 
    140           
     169         ! 
    141170         ! Multiply by the eddy viscosity coef. (at u- and v-points) 
    142          zlu(:,:,jk) = zlu(:,:,jk) * ( fsahmu(:,:,jk) * (1-nkahm_smag) + nkahm_smag) 
    143  
    144          zlv(:,:,jk) = zlv(:,:,jk) * ( fsahmv(:,:,jk) * (1-nkahm_smag) + nkahm_smag) 
    145           
     171         zlu(:,:,jk) = zlu(:,:,jk) * fsahmu(:,:,jk)  
     172         zlv(:,:,jk) = zlv(:,:,jk) * fsahmv(:,:,jk) 
     173         !          
    146174         ! Contravariant "laplacian" 
    147175         zcu(:,:) = e1u(:,:) * zlu(:,:,jk) 
     
    152180            DO ji = 1, fs_jpim1   ! vector opt. 
    153181               zuf(ji,jj,jk) = fmask(ji,jj,jk) * (  zcv(ji+1,jj  ) - zcv(ji,jj)      & 
    154                   &                            - zcu(ji  ,jj+1) + zcu(ji,jj)  )   & 
    155                   &       * fse3f(ji,jj,jk) / ( e1f(ji,jj)*e2f(ji,jj) ) 
     182                  &                               - zcu(ji  ,jj+1) + zcu(ji,jj)  )   & 
     183                  &       * fse3f(ji,jj,jk) * r1_e12f(ji,jj) 
    156184            END DO   
    157185         END DO   
     
    175203      END DO 
    176204 
    177  
    178205      ! boundary conditions on the laplacian curl and div (zuf,zut) 
    179206!!bug gm no need to do this 2 following lbc... 
     
    181208      CALL lbc_lnk( zut, 'T', 1. ) 
    182209 
    183       DO jk = 1, jpkm1       
    184     
    185          ! Bilaplacian 
    186          ! ----------- 
    187  
     210      DO jk = 1, jpkm1               ! Bilaplacian 
    188211         DO jj = 2, jpjm1 
    189212            DO ji = fs_2, fs_jpim1   ! vector opt. 
     
    197220                  &  + ( zut(ji,jj+1,jk) - zut(ji  ,jj,jk) ) / e2v(ji,jj) 
    198221               ! add it to the general momentum trends 
    199                ua(ji,jj,jk) = ua(ji,jj,jk) + zua * ( fsahmu(ji,jj,jk)*nkahm_smag +(1 -nkahm_smag )) 
    200                va(ji,jj,jk) = va(ji,jj,jk) + zva * ( fsahmv(ji,jj,jk)*nkahm_smag +(1 -nkahm_smag )) 
    201             END DO 
    202          END DO 
    203  
     222               ua(ji,jj,jk) = ua(ji,jj,jk) + zua 
     223               va(ji,jj,jk) = va(ji,jj,jk) + zva 
     224            END DO 
     225         END DO 
    204226         !                                             ! =============== 
    205227      END DO                                           !   End of slab 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/OPA_SRC/DYN/dynldf_lap.F90

    r4990 r10115  
    1717   USE oce             ! ocean dynamics and tracers 
    1818   USE dom_oce         ! ocean space and time domain 
     19   USE phycst          ! physical constants 
    1920   USE ldfdyn_oce      ! ocean dynamics: lateral physics 
    2021   USE zdf_oce         ! ocean vertical physics 
    2122   ! 
    2223   USE in_out_manager  ! I/O manager 
     24   USE iom             ! I/O library 
    2325   USE timing          ! Timing 
    2426 
     
    6264      INTEGER  ::   ji, jj, jk             ! dummy loop indices 
    6365      REAL(wp) ::   zua, zva, ze2u, ze1v   ! local scalars 
     66      REAL(wp), ALLOCATABLE, DIMENSION(:,:) ::   z2d   ! 2D workspace  
    6467      !!---------------------------------------------------------------------- 
    6568      ! 
     
    9396      END DO                                           !   End of slab 
    9497      !                                                ! =============== 
     98       
     99      IF( iom_use('dispkexyfo') ) THEN   ! ocean Kinetic Energy dissipation per unit area 
     100         !                               ! due to lateral friction (xy=lateral)  
     101         !   see NEMO_book appendix C, §C.7.2 (N.B. here averaged at t-points) 
     102         !   local dissipation of KE at t-point due to laplacian operator is given by : 
     103         !      - ahmt hdivb**2 - mi( mj(ahmf rotb**2 e1f*e2f*e3t) ) / (e1e2t*e3t) 
     104         ! 
     105         ALLOCATE( z2d(jpi,jpj) ) 
     106         z2d(:,:) = 0._wp 
     107         DO jk = 1, jpkm1 
     108            DO jj = 2, jpjm1 
     109               DO ji = 2, jpim1 
     110                  z2d(ji,jj) = z2d(ji,jj)          -   (                                                         & 
     111                     &   hdivb(ji,jj,jk)**2 * fsahmt(ji,jj,jk) * fse3t_n(ji,jj,jk)                               & 
     112                     & + 0.25_wp * (                                                                             & 
     113                     &   rotb (ji  ,jj  ,jk)**2 * fsahmf(ji  ,jj  ,jk) * e12f(ji  ,jj  ) * fse3f(ji  ,jj  ,jk)   & 
     114                     & + rotb (ji-1,jj  ,jk)**2 * fsahmf(ji-1,jj  ,jk) * e12f(ji-1,jj  ) * fse3f(ji-1,jj  ,jk)   & 
     115                     & + rotb (ji  ,jj-1,jk)**2 * fsahmf(ji  ,jj-1,jk) * e12f(ji  ,jj-1) * fse3f(ji  ,jj-1,jk)   & 
     116                     & + rotb (ji-1,jj-1,jk)**2 * fsahmf(ji-1,jj-1,jk) * e12f(ji-1,jj-1) * fse3f(ji-1,jj-1,jk)   & 
     117                     &             ) * r1_e12t(ji,jj)  ) * tmask(ji,jj,jk) 
     118               END DO 
     119            END DO 
     120         END DO 
     121         z2d(:,:) = rau0 * z2d(:,:)  
     122         CALL lbc_lnk( z2d,'T', 1. ) 
     123         CALL iom_put( 'dispkexyfo', z2d ) 
     124         DEALLOCATE( z2d ) 
     125      ENDIF 
     126 
    95127      IF( nn_timing == 1 )  CALL timing_stop('dyn_ldf_lap') 
    96128      ! 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/OPA_SRC/DYN/dynzdf_imp.F90

    r7256 r10115  
    2020   USE zdf_oce         ! ocean vertical physics 
    2121   USE phycst          ! physical constants 
     22   USE dynadv          ! dynamics: vector invariant versus flux form 
     23   USE dynspg_oce, ONLY: lk_dynspg_ts 
     24   USE zdfbfr          ! Bottom friction setup 
     25   ! 
    2226   USE in_out_manager  ! I/O manager 
     27   USE iom             ! I/O library 
    2328   USE lib_mpp         ! MPP library 
    24    USE zdfbfr          ! Bottom friction setup 
    2529   USE wrk_nemo        ! Memory Allocation 
    2630   USE timing          ! Timing 
    27    USE dynadv          ! dynamics: vector invariant versus flux form 
    28    USE dynspg_oce, ONLY: lk_dynspg_ts 
    2931 
    3032   IMPLICIT NONE 
     
    6971      INTEGER  ::   ikbu, ikbv   ! local integers 
    7072      REAL(wp) ::   z1_p2dt, zcoef, zzwi, zzws, zrhs   ! local scalars 
    71       REAL(wp) ::   ze3ua, ze3va 
     73      REAL(wp) ::   ze3ua, ze3va, zzz 
     74      REAL(wp), POINTER, DIMENSION(:,:)   ::  z2d 
    7275      REAL(wp), POINTER, DIMENSION(:,:,:) ::  zwi, zwd, zws 
    7376      !!---------------------------------------------------------------------- 
     
    257260      END DO 
    258261 
    259 #if ! defined key_dynspg_ts 
    260       ! Normalization to obtain the general momentum trend ua 
    261       DO jk = 1, jpkm1 
    262          DO jj = 2, jpjm1    
    263             DO ji = fs_2, fs_jpim1   ! vector opt. 
    264                ua(ji,jj,jk) = ( ua(ji,jj,jk) - ub(ji,jj,jk) ) * z1_p2dt 
    265             END DO 
    266          END DO 
    267       END DO 
    268 #endif 
    269  
    270262      ! 3. Vertical diffusion on v 
    271263      ! --------------------------- 
     
    357349      END DO 
    358350 
    359       ! Normalization to obtain the general momentum trend va 
     351      IF( iom_use( 'dispkevfo' ) ) THEN   ! ocean kinetic energy dissipation per unit area 
     352         !                                ! due to v friction (v=vertical)  
     353         !                                ! see NEMO_book appendix C, §C.8 (N.B. here averaged at t-points) 
     354         !                                ! Note that formally, in a Leap-Frog environment, the shear**2 should be the product of  
     355         !                                ! now by before shears, i.e. the source term of TKE (local positivity is not ensured). 
     356         CALL wrk_alloc(jpi,jpj,   z2d ) 
     357         z2d(:,:) = 0._wp 
     358         DO jk = 1, jpkm1 
     359            DO jj = 2, jpjm1 
     360               DO ji = 2, jpim1 
     361                  z2d(ji,jj) = z2d(ji,jj)  +  (                                                                                  & 
     362                     &   avmu(ji  ,jj,jk) * ( ua(ji  ,jj,jk-1) - ua(ji  ,jj,jk) )**2 / fse3uw(ji  ,jj,jk) * wumask(ji  ,jj,jk)   & 
     363                     & + avmu(ji-1,jj,jk) * ( ua(ji-1,jj,jk-1) - ua(ji-1,jj,jk) )**2 / fse3uw(ji-1,jj,jk) * wumask(ji-1,jj,jk)   & 
     364                     & + avmv(ji,jj  ,jk) * ( va(ji,jj  ,jk-1) - va(ji,jj  ,jk) )**2 / fse3vw(ji,jj  ,jk) * wvmask(ji,jj  ,jk)   & 
     365                     & + avmv(ji,jj-1,jk) * ( va(ji,jj-1,jk-1) - va(ji,jj-1,jk) )**2 / fse3vw(ji,jj-1,jk) * wvmask(ji,jj-1,jk)   & 
     366                     &                        ) 
     367               END DO 
     368            END DO 
     369         END DO 
     370         zzz= - 0.5_wp* rau0           ! caution sign minus here 
     371         z2d(:,:) = zzz * z2d(:,:)  
     372         CALL lbc_lnk( z2d,'T', 1. ) 
     373         CALL iom_put( 'dispkevfo', z2d ) 
     374         CALL wrk_dealloc(jpi,jpj,   z2d ) 
     375      ENDIF 
     376 
    360377#if ! defined key_dynspg_ts 
     378!!gm this can be removed if tranxt is changed like in the trunk so that implicit outcome with  
     379!!gm the after velocity, not a trend 
     380      ! Normalization to obtain the general momentum trend ua 
    361381      DO jk = 1, jpkm1 
    362382         DO jj = 2, jpjm1    
    363383            DO ji = fs_2, fs_jpim1   ! vector opt. 
     384               ua(ji,jj,jk) = ( ua(ji,jj,jk) - ub(ji,jj,jk) ) * z1_p2dt 
    364385               va(ji,jj,jk) = ( va(ji,jj,jk) - vb(ji,jj,jk) ) * z1_p2dt 
    365386            END DO 
     
    393414      CALL wrk_dealloc( jpi,jpj,jpk, zwi, zwd, zws)  
    394415      ! 
     416      ! 
    395417      IF( nn_timing == 1 )  CALL timing_stop('dyn_zdf_imp') 
    396418      ! 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/OPA_SRC/ICB/icbtrj.F90

    r5602 r10115  
    1818   USE lib_mpp        ! NEMO MPI library, lk_mpp in particular 
    1919   USE in_out_manager ! NEMO IO, numout in particular 
     20   USE ioipsl, ONLY : ju2ymds    ! for calendar 
    2021   USE netcdf 
    2122   ! 
     
    6061      ! 
    6162      INTEGER                               :: iret 
     63      INTEGER                               :: iyear, imonth, iday 
     64      REAL(wp)                              :: zfjulday, zsec 
    6265      CHARACTER(len=80)                     :: cl_filename 
    6366      TYPE(iceberg), POINTER                :: this 
    6467      TYPE(point)  , POINTER                :: pt 
    65       !!---------------------------------------------------------------------- 
    66  
    67       IF( lk_mpp ) THEN   ;   WRITE(cl_filename,'("trajectory_icebergs_",I6.6,"_",I4.4,".nc")') ktend, narea-1 
    68       ELSE                ;   WRITE(cl_filename,'("trajectory_icebergs_",I6.6         ,".nc")') ktend 
     68      CHARACTER(LEN=20)                     :: cldate_ini, cldate_end 
     69      !!---------------------------------------------------------------------- 
     70 
     71      ! compute initial time step date 
     72      CALL ju2ymds( fjulday, iyear, imonth, iday, zsec ) 
     73      WRITE(cldate_ini, '(i4.4,2i2.2)') iyear, imonth, iday 
     74 
     75      ! compute end time step date 
     76      zfjulday = fjulday + rdttra(1) / rday * REAL( nitend - nit000 + 1 , wp) 
     77      IF( ABS(zfjulday - REAL(NINT(zfjulday),wp)) < 0.1 / rday )   zfjulday = REAL(NINT(zfjulday),wp)   ! avoid truncation error 
     78      CALL ju2ymds( zfjulday, iyear, imonth, iday, zsec ) 
     79      WRITE(cldate_end, '(i4.4,2i2.2)') iyear, imonth, iday 
     80 
     81      ! define trajectory output name 
     82      IF( lk_mpp ) THEN   ;   WRITE(cl_filename,'("trajectory_icebergs_",A,"-",A,"_",I4.4,".nc")') TRIM(ADJUSTL(cldate_ini)), TRIM(ADJUSTL(cldate_end)), narea-1 
     83      ELSE                ;   WRITE(cl_filename,'("trajectory_icebergs_",A,"-",A         ,".nc")') TRIM(ADJUSTL(cldate_ini)), TRIM(ADJUSTL(cldate_end)) 
    6984      ENDIF 
    7085      IF ( lwp .AND. nn_verbose_level >= 0) WRITE(numout,'(2a)') 'icebergs, icb_trj_init: creating ',TRIM(cl_filename) 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/OPA_SRC/IOM/iom.F90

    r8090 r10115  
    15641564      ALLOCATE( zlon(ni*nj) )       ;       zlon(:) = 0. 
    15651565 
    1566       CALL dom_ngb( 180., 90., ix, iy, 'T' ) !  i-line that passes near the North Pole : Reference latitude (used in plots) 
     1566      CALL dom_ngb( -168.53, 65.03, ix, iy, 'T' ) !  i-line that passes through Bering Strait: Reference latitude (used in plots) 
    15671567#if ! defined key_xios2 
    15681568      CALL iom_set_domain_attr("gznl", ni_glo=jpiglo, nj_glo=jpjglo, ibegin=nimpp+nldi-1, jbegin=njmpp+nldj-1, ni=ni, nj=nj) 
     
    16511651#if ! defined key_xios2 
    16521652      WRITE(cl1,'(i1)')        1   ;   CALL iom_set_field_attr('field_definition', freq_op=cl1//'ts', freq_offset='0ts') 
     1653      WRITE(cl1,'(i1)')        2   ;   CALL iom_set_field_attr('trendT_even'      , freq_op=cl1//'ts', freq_offset='0ts') 
     1654      WRITE(cl1,'(i1)')        2   ;   CALL iom_set_field_attr('trendT_odd'       , freq_op=cl1//'ts', freq_offset='-1ts') 
    16531655      WRITE(cl1,'(i1)')  nn_fsbc   ;   CALL iom_set_field_attr('SBC'             , freq_op=cl1//'ts', freq_offset='0ts') 
    16541656      WRITE(cl1,'(i1)')  nn_fsbc   ;   CALL iom_set_field_attr('SBC_scalar'      , freq_op=cl1//'ts', freq_offset='0ts') 
     
    16571659#else 
    16581660      f_op%timestep = 1        ;  f_of%timestep = 0  ; CALL iom_set_field_attr('field_definition', freq_op=f_op, freq_offset=f_of) 
     1661      f_op%timestep = 2        ;  f_of%timestep = 0  ; CALL iom_set_field_attr('trendT_even'      , freq_op=f_op, freq_offset=f_of) 
     1662      f_op%timestep = 2        ;  f_of%timestep = -1 ; CALL iom_set_field_attr('trendT_odd'       , freq_op=f_op, freq_offset=f_of) 
    16591663      f_op%timestep = nn_fsbc  ;  f_of%timestep = 0  ; CALL iom_set_field_attr('SBC'             , freq_op=f_op, freq_offset=f_of) 
    16601664      f_op%timestep = nn_fsbc  ;  f_of%timestep = 0  ; CALL iom_set_field_attr('SBC_scalar'      , freq_op=f_op, freq_offset=f_of) 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/OPA_SRC/LBC/cla.F90

    r4147 r10115  
    7878      IF( kt == nit000 ) THEN 
    7979         ! 
    80          CALL cla_init                                        ! control check  
    81          ! 
    8280         IF(lwp) WRITE(numout,*) 
    8381         IF(lwp) WRITE(numout,*) 'div_cla : cross land advection on hdiv ' 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/OPA_SRC/LBC/lbclnk.F90

    r7256 r10115  
    225225 
    226226      !! Look if more arrays to process 
    227       IF(PRESENT (psgnB) )CALL lbc_lnk( pt2dA, cd_typeA, psgnA )  
     227      IF(PRESENT (psgnB) )CALL lbc_lnk( pt2dB, cd_typeB, psgnB ) 
    228228      IF(PRESENT (psgnC) )CALL lbc_lnk( pt2dC, cd_typeC, psgnC )  
    229229      IF(PRESENT (psgnD) )CALL lbc_lnk( pt2dD, cd_typeD, psgnD )  
     
    483483 
    484484      !! Look if more arrays to process 
    485       IF(PRESENT (psgnB) )CALL lbc_lnk( pt2dA, cd_typeA, psgnA )  
     485      IF(PRESENT (psgnB) )CALL lbc_lnk( pt2dB, cd_typeB, psgnB ) 
    486486      IF(PRESENT (psgnC) )CALL lbc_lnk( pt2dC, cd_typeC, psgnC )  
    487487      IF(PRESENT (psgnD) )CALL lbc_lnk( pt2dD, cd_typeD, psgnD )  
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/OPA_SRC/LBC/lib_mpp.F90

    r7806 r10115  
    2323   !!                          the mppobc routine to optimize the BDY and OBC communications 
    2424   !!            3.5  !  2013  ( C. Ethe, G. Madec ) message passing arrays as local variables  
    25    !!            3.5  !  2013 (S.Mocavero, I.Epicoco - CMCC) north fold optimizations 
    26    !!            3.6  !  2015 (O. Tintó and M. Castrillo - BSC) Added 'mpp_lnk_2d_multiple', 'mpp_lbc_north_2d_multiple', 'mpp_max_multiple'  
     25   !!            3.5  !  2013  (S.Mocavero, I.Epicoco - CMCC) north fold optimizations 
     26   !!            3.6  !  2015  (O. Tintó and M. Castrillo - BSC) Added 'mpp_lnk_2d_multiple', 'mpp_lbc_north_2d_multiple', 'mpp_max_multiple'  
    2727   !!---------------------------------------------------------------------- 
    2828 
     
    4444   !!   mpp_lnk_e     : interface (defined in lbclnk) for message passing of 2d array with extra halo (mpp_lnk_2d_e) 
    4545   !!   mpp_lnk_icb   : interface for message passing of 2d arrays with extra halo for icebergs (mpp_lnk_2d_icb) 
    46    !!   mpprecv         : 
     46   !!   mpprecv       : 
    4747   !!   mppsend       :   SUBROUTINE mpp_ini_znl 
    4848   !!   mppscatter    : 
     
    29022902      !! 
    29032903      !!---------------------------------------------------------------------- 
    2904  
    2905       USE lbcnfd          ! north fold 
    2906  
    2907       INCLUDE 'mpif.h' 
    2908  
    29092904      REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(inout) ::   ptab     ! 3D array on which the boundary condition is applied 
    29102905      CHARACTER(len=1)                , INTENT(in   ) ::   cd_type  ! define the nature of ptab array grid-points 
     
    29132908      !                                                             ! =  1. , the sign is kept 
    29142909      INTEGER                         , INTENT(in   ) ::   ib_bdy   ! BDY boundary set 
     2910      ! 
    29152911      INTEGER  ::   ji, jj, jk, jl             ! dummy loop indices 
    2916       INTEGER  ::   imigr, iihom, ijhom        ! temporary integers 
     2912      INTEGER  ::   imigr, iihom, ijhom        ! local integers 
    29172913      INTEGER  ::   ml_req1, ml_req2, ml_err   ! for key_mpi_isend 
    2918       REAL(wp) ::   zland 
     2914      REAL(wp) ::   zland                      ! local scalar 
    29192915      INTEGER, DIMENSION(MPI_STATUS_SIZE) ::   ml_stat   ! for key_mpi_isend 
    29202916      ! 
    29212917      REAL(wp), DIMENSION(:,:,:,:), ALLOCATABLE ::   zt3ns, zt3sn   ! 3d for north-south & south-north 
    29222918      REAL(wp), DIMENSION(:,:,:,:), ALLOCATABLE ::   zt3ew, zt3we   ! 3d for east-west & west-east 
    2923  
    29242919      !!---------------------------------------------------------------------- 
    29252920       
     
    31043099   END SUBROUTINE mpp_lnk_bdy_3d 
    31053100 
    3106       SUBROUTINE mpp_lnk_bdy_2d( ptab, cd_type, psgn, ib_bdy ) 
     3101 
     3102   SUBROUTINE mpp_lnk_bdy_2d( ptab, cd_type, psgn, ib_bdy ) 
    31073103      !!---------------------------------------------------------------------- 
    31083104      !!                  ***  routine mpp_lnk_bdy_2d  *** 
     
    31253121      !! 
    31263122      !!---------------------------------------------------------------------- 
    3127  
    3128       USE lbcnfd          ! north fold 
    3129  
    3130       INCLUDE 'mpif.h' 
    3131  
    3132       REAL(wp), DIMENSION(jpi,jpj)    , INTENT(inout) ::   ptab     ! 3D array on which the boundary condition is applied 
    3133       CHARACTER(len=1)                , INTENT(in   ) ::   cd_type  ! define the nature of ptab array grid-points 
    3134       !                                                             ! = T , U , V , F , W points 
    3135       REAL(wp)                        , INTENT(in   ) ::   psgn     ! =-1 the sign change across the north fold boundary 
    3136       !                                                             ! =  1. , the sign is kept 
    3137       INTEGER                         , INTENT(in   ) ::   ib_bdy   ! BDY boundary set 
     3123      REAL(wp), DIMENSION(jpi,jpj), INTENT(inout) ::   ptab     ! 3D array on which the boundary condition is applied 
     3124      CHARACTER(len=1)            , INTENT(in   ) ::   cd_type  ! define the nature of ptab array grid-points 
     3125      !                                                         ! = T , U , V , F , W points 
     3126      REAL(wp)                    , INTENT(in   ) ::   psgn     ! =-1 the sign change across the north fold boundary 
     3127      !                                                         ! =  1. , the sign is kept 
     3128      INTEGER                     , INTENT(in   ) ::   ib_bdy   ! BDY boundary set 
     3129      ! 
    31383130      INTEGER  ::   ji, jj, jl             ! dummy loop indices 
    3139       INTEGER  ::   imigr, iihom, ijhom        ! temporary integers 
     3131      INTEGER  ::   imigr, iihom, ijhom        ! local integers 
    31403132      INTEGER  ::   ml_req1, ml_req2, ml_err   ! for key_mpi_isend 
    31413133      REAL(wp) ::   zland 
     
    31443136      REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::  zt2ns, zt2sn   ! 2d for north-south & south-north 
    31453137      REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::  zt2ew, zt2we   ! 2d for east-west & west-east 
    3146  
    31473138      !!---------------------------------------------------------------------- 
    31483139 
     
    31503141         &      zt2ew(jpj,jpreci,2), zt2we(jpj,jpreci,2)   ) 
    31513142 
    3152       zland = 0.e0 
     3143      zland = 0._wp 
    31533144 
    31543145      ! 1. standard boundary treatment 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/OPA_SRC/SBC/albedo.F90

    r7806 r10115  
    113113      CASE( 0 ) 
    114114        
    115          !ralb_sf = 0.80       ! dry snow 
    116          !ralb_sm = 0.65       ! melting snow 
    117          !ralb_if = 0.72       ! bare frozen ice 
    118          !ralb_im = ...        ! bare puddled ice  
    119  
    120115         !  Computation of ice albedo (free of snow) 
    121116         WHERE     ( ph_snw == 0._wp .AND. pt_ice >= rt0_ice )   ;   zalb(:,:,:) = ralb_im 
     
    167162      CASE( 1 )  
    168163 
    169 !        ralb_im = ...        ! bare puddled ice 
    170164! compilation of values from literature 
    171165!        ralb_sf = 0.85      ! dry snow 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/OPA_SRC/SBC/cpl_oasis3.F90

    r5602 r10115  
     1 
    12MODULE cpl_oasis3 
    23   !!====================================================================== 
     
    196197      ENDIF 
    197198       
    198       CALL oasis_def_partition ( id_part, paral, nerror ) 
     199      CALL oasis_def_partition ( id_part, paral, nerror, jpiglo*jpjglo ) 
    199200      ! 
    200201      ! ... Announce send variables.  
     
    514515   END SUBROUTINE oasis_get_localcomm 
    515516 
    516    SUBROUTINE oasis_def_partition(k1,k2,k3) 
     517   SUBROUTINE oasis_def_partition(k1,k2,k3,k4) 
    517518      INTEGER     , INTENT(  out) ::  k1,k3 
    518519      INTEGER     , INTENT(in   ) ::  k2(5) 
    519       k1 = k2(1) ; k3 = k2(5) 
     520      INTEGER     , INTENT(in   ) ::  k4 
     521      k1 = k2(1) ; k3 = k2(5)+k4 
    520522      WRITE(numout,*) 'oasis_def_partition: Error you sould not be there...' 
    521523   END SUBROUTINE oasis_def_partition 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/OPA_SRC/SBC/sbc_oce.F90

    r7806 r10115  
    122122   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   sprecip           !: solid precipitation                          [Kg/m2/s] 
    123123   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   fr_i              !: ice fraction = 1 - lead fraction      (between 0 to 1) 
    124 #if defined key_cpl_carbon_cycle 
    125124   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   atm_co2           !: atmospheric pCO2                             [ppm] 
    126 #endif 
    127125   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: xcplmask          !: coupling mask for ln_mixcpl (warning: allocated in sbccpl) 
    128126 
     
    169167         ! 
    170168      ALLOCATE( tprecip(jpi,jpj) , sprecip(jpi,jpj) , fr_i(jpi,jpj) ,     & 
    171 #if defined key_cpl_carbon_cycle 
    172169         &      atm_co2(jpi,jpj) ,                                        & 
    173 #endif 
    174170         &      ssu_m  (jpi,jpj) , sst_m(jpi,jpj) , frq_m(jpi,jpj) ,      & 
    175171         &      ssv_m  (jpi,jpj) , sss_m(jpi,jpj) , ssh_m(jpi,jpj) , STAT=ierr(4) ) 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/OPA_SRC/SBC/sbcblk_clio.F90

    r7256 r10115  
    164164            ALLOCATE( sf(ifpr)%fnow(jpi,jpj,1) , STAT=ierr1) 
    165165            IF( slf_i(ifpr)%ln_tint ) ALLOCATE( sf(ifpr)%fdta(jpi,jpj,1,2) , STAT=ierr2 ) 
     166 
     167            IF( slf_i(ifpr)%nfreqh .GT. 0._wp .AND. MOD( 3600._wp * slf_i(ifpr)%nfreqh , REAL(nn_fsbc, wp) * rdt) .NE. 0._wp  )   & 
     168            &  CALL ctl_warn( 'sbcmod time step rdt * nn_fsbc is NOT a submultiple of atmospheric forcing frequency' ) 
     169 
    166170         END DO 
    167171         IF( ierr1+ierr2 > 0 )   CALL ctl_stop( 'STOP', 'sbc_blk_clio: unable to allocate sf array structure' ) 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/OPA_SRC/SBC/sbcblk_core.F90

    r7256 r10115  
    190190            ALLOCATE( sf(ifpr)%fnow(jpi,jpj,1) ) 
    191191            IF( slf_i(ifpr)%ln_tint )   ALLOCATE( sf(ifpr)%fdta(jpi,jpj,1,2) ) 
     192 
     193            IF( slf_i(ifpr)%nfreqh .GT. 0._wp .AND. MOD( 3600._wp * slf_i(ifpr)%nfreqh , REAL(nn_fsbc, wp) * rdt) .NE. 0._wp  )   & 
     194            &  CALL ctl_warn( 'sbcmod time step rdt * nn_fsbc is NOT a submultiple of atmospheric forcing frequency' ) 
     195 
    192196         END DO 
    193197         !                                         ! fill sf with slf_i and control print 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/OPA_SRC/SBC/sbcblk_mfs.F90

    r5602 r10115  
    167167         sh_now(:,:) = 0.0    ! initializze specifif humidity variable 
    168168 
    169          DO jj = 2, jpjm1 
    170             DO ji = fs_2, fs_jpim1   ! vector opt. 
     169         DO jj = 1, jpj 
     170            DO ji = 1, jpi   
    171171 
    172172         ! Calculate Specific Humidity  
     
    345345          END DO 
    346346       END DO 
     347      
     348       CALL lbc_lnk( rel_windu(:,:), 'U', -1. ) 
     349       CALL lbc_lnk( rel_windv(:,:), 'V', -1. ) 
    347350 
    348351       rspeed(:,:)= SQRT(rel_windu(:,:)*rel_windu(:,:)   & 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/OPA_SRC/SBC/sbccpl.F90

    r7806 r10115  
    13931393      !!             qsr_tot = pfrld * qsr_oce + ( 1 - pfrld ) * qsr_ice   => provided 
    13941394      !! 
    1395       !!             emp_tot = emp_oce + emp_ice                           => calving is provided and added to emp_tot (and emp_oce) 
    1396       !!                                                                      river runoff (rnf) is provided but not included here 
    1397       !! 
     1395      !!             emp_tot = emp_oce + emp_ice                           => calving is provided and added to emp_tot (and emp_oce). 
     1396      !!                                                                      runoff (which includes rivers+icebergs) and iceshelf 
     1397      !!                                                                      are provided but not included in emp here. Only runoff will 
     1398      !!                                                                      be included in emp in other parts of NEMO code 
    13981399      !! ** Action  :   update at each nf_ice time step: 
    13991400      !!                   qns_tot, qsr_tot  non-solar and solar total heat fluxes 
     
    14111412      ! 
    14121413      INTEGER ::   jl         ! dummy loop index 
    1413       REAL(wp), POINTER, DIMENSION(:,:  ) ::   zcptn, ztmp, zcptrain, zcptsnw, zicefr, zmsk, zsnw 
     1414      REAL(wp), POINTER, DIMENSION(:,:  ) ::   zcptn, zcptrain, zcptsnw, zicefr, zmsk, zsnw 
    14141415      REAL(wp), POINTER, DIMENSION(:,:  ) ::   zemp_tot, zemp_ice, zemp_oce, ztprecip, zsprecip, zevap_oce, zevap_ice, zdevap_ice 
    14151416      REAL(wp), POINTER, DIMENSION(:,:  ) ::   zqns_tot, zqns_oce, zqsr_tot, zqsr_oce, zqprec_ice, zqemp_oce, zqemp_ice 
     
    14191420      IF( nn_timing == 1 )  CALL timing_start('sbc_cpl_ice_flx') 
    14201421      ! 
    1421       CALL wrk_alloc( jpi,jpj,     zcptn, ztmp, zcptrain, zcptsnw, zicefr, zmsk, zsnw ) 
     1422      CALL wrk_alloc( jpi,jpj,     zcptn, zcptrain, zcptsnw, zicefr, zmsk, zsnw ) 
    14221423      CALL wrk_alloc( jpi,jpj,     zemp_tot, zemp_ice, zemp_oce, ztprecip, zsprecip, zevap_oce, zevap_ice, zdevap_ice ) 
    14231424      CALL wrk_alloc( jpi,jpj,     zqns_tot, zqns_oce, zqsr_tot, zqsr_oce, zqprec_ice, zqemp_oce, zqemp_ice ) 
     
    14421443         zemp_tot(:,:) =   frcv(jpr_tevp)%z3(:,:,1) - ztprecip(:,:) 
    14431444         zemp_ice(:,:) = ( frcv(jpr_ievp)%z3(:,:,1) - frcv(jpr_snow)%z3(:,:,1) ) * zicefr(:,:) 
    1444          IF( iom_use('precip') )          & 
    1445             &  CALL iom_put( 'precip'       ,   frcv(jpr_rain)%z3(:,:,1) + frcv(jpr_snow)%z3(:,:,1)                              )  ! total  precipitation 
    1446          IF( iom_use('rain') )            & 
    1447             &  CALL iom_put( 'rain'         ,   frcv(jpr_rain)%z3(:,:,1)                                                         )  ! liquid precipitation  
    1448          IF( iom_use('rain_ao_cea') )   & 
    1449             &  CALL iom_put( 'rain_ao_cea'  , frcv(jpr_rain)%z3(:,:,1)* p_frld(:,:) * tmask(:,:,1)      )   ! liquid precipitation  
    1450          IF( iom_use('hflx_rain_cea') )   & 
    1451             CALL iom_put( 'hflx_rain_cea', frcv(jpr_rain)%z3(:,:,1) * zcptn(:,:) * tmask(:,:,1))   ! heat flux from liq. precip.  
    1452          IF( iom_use('hflx_prec_cea') )   & 
    1453             CALL iom_put( 'hflx_prec_cea', ztprecip * zcptn(:,:) * tmask(:,:,1) * p_frld(:,:) )   ! heat content flux from all precip  (cell avg) 
    1454          IF( iom_use('evap_ao_cea') .OR. iom_use('hflx_evap_cea') )   & 
    1455             ztmp(:,:) = frcv(jpr_tevp)%z3(:,:,1) - frcv(jpr_ievp)%z3(:,:,1) * zicefr(:,:) 
    1456          IF( iom_use('evap_ao_cea'  ) )   & 
    1457             CALL iom_put( 'evap_ao_cea'  , ztmp * tmask(:,:,1)                  )   ! ice-free oce evap (cell average) 
    1458          IF( iom_use('hflx_evap_cea') )   & 
    1459             CALL iom_put( 'hflx_evap_cea', ztmp(:,:) * zcptn(:,:) * tmask(:,:,1) )   ! heat flux from from evap (cell average) 
    14601445      CASE( 'oce and ice'   )   ! received fields: jpr_sbpr, jpr_semp, jpr_oemp, jpr_ievp 
    14611446         zemp_tot(:,:) = p_frld(:,:) * frcv(jpr_oemp)%z3(:,:,1) + zicefr(:,:) * frcv(jpr_sbpr)%z3(:,:,1) 
     
    14661451 
    14671452#if defined key_lim3 
    1468       ! zsnw = snow fraction over ice after wind blowing 
     1453      ! zsnw = snow fraction over ice after wind blowing (=zicefr if no blowing) 
    14691454      zsnw(:,:) = 0._wp  ;  CALL lim_thd_snwblow( p_frld, zsnw ) 
    14701455       
     
    14791464      zevap_ice(:,:) = frcv(jpr_ievp)%z3(:,:,1) 
    14801465      ! since the sensitivity of evap to temperature (devap/dT) is not prescribed by the atmosphere, we set it to 0 
    1481       ! therefore, sublimation is not redistributed over the ice categories in case no subgrid scale fluxes are provided by atm. 
     1466      ! therefore, sublimation is not redistributed over the ice categories when no subgrid scale fluxes are provided by atm. 
    14821467      zdevap_ice(:,:) = 0._wp 
    14831468       
    1484       ! --- runoffs (included in emp later on) --- ! 
    1485       IF( srcv(jpr_rnf)%laction )   rnf(:,:) = frcv(jpr_rnf)%z3(:,:,1) 
    1486  
    1487       ! --- calving (put in emp_tot and emp_oce) --- ! 
    1488       IF( srcv(jpr_cal)%laction ) THEN  
     1469      ! --- Continental fluxes --- ! 
     1470      IF( srcv(jpr_rnf)%laction ) THEN   ! runoffs (included in emp later on) 
     1471         rnf(:,:) = frcv(jpr_rnf)%z3(:,:,1) 
     1472      ENDIF 
     1473      IF( srcv(jpr_cal)%laction ) THEN   ! calving (put in emp_tot and emp_oce) 
    14891474         zemp_tot(:,:) = zemp_tot(:,:) - frcv(jpr_cal)%z3(:,:,1) 
    14901475         zemp_oce(:,:) = zemp_oce(:,:) - frcv(jpr_cal)%z3(:,:,1) 
    1491          CALL iom_put( 'calving_cea', frcv(jpr_cal)%z3(:,:,1) ) 
    1492       ENDIF 
    1493  
    1494       IF( srcv(jpr_icb)%laction )  THEN  
     1476      ENDIF 
     1477      IF( srcv(jpr_icb)%laction ) THEN   ! iceberg added to runoffs 
    14951478         fwficb(:,:) = frcv(jpr_icb)%z3(:,:,1) 
    1496          rnf(:,:)    = rnf(:,:) + fwficb(:,:)   ! iceberg added to runoffs 
    1497          CALL iom_put( 'iceberg_cea', frcv(jpr_icb)%z3(:,:,1) ) 
    1498       ENDIF 
    1499       IF( srcv(jpr_isf)%laction )  THEN 
    1500         fwfisf(:,:) = - frcv(jpr_isf)%z3(:,:,1)  ! fresh water flux from the isf (fwfisf <0 mean melting)   
    1501         CALL iom_put( 'iceshelf_cea', frcv(jpr_isf)%z3(:,:,1) ) 
    1502       ENDIF 
    1503  
     1479         rnf(:,:)    = rnf(:,:) + fwficb(:,:) 
     1480      ENDIF 
     1481      IF( srcv(jpr_isf)%laction ) THEN   ! iceshelf (fwfisf <0 mean melting) 
     1482        fwfisf(:,:) = - frcv(jpr_isf)%z3(:,:,1)   
     1483      ENDIF 
    15041484 
    15051485      IF( ln_mixcpl ) THEN 
     
    15251505      ENDIF 
    15261506 
    1527       IF( iom_use('subl_ai_cea') )   CALL iom_put( 'subl_ai_cea', zevap_ice(:,:) * zicefr(:,:)         )  ! Sublimation over sea-ice (cell average) 
    1528                                      CALL iom_put( 'snowpre'    , sprecip(:,:)                         )  ! Snow 
    1529       IF( iom_use('snow_ao_cea') )   CALL iom_put( 'snow_ao_cea', sprecip(:,:) * ( 1._wp - zsnw(:,:) ) )  ! Snow over ice-free ocean  (cell average) 
    1530       IF( iom_use('snow_ai_cea') )   CALL iom_put( 'snow_ai_cea', sprecip(:,:) *           zsnw(:,:)   )  ! Snow over sea-ice         (cell average) 
    15311507#else 
    1532       ! runoffs and calving (put in emp_tot) 
    1533       IF( srcv(jpr_rnf)%laction )   rnf(:,:) = frcv(jpr_rnf)%z3(:,:,1) 
    1534       IF( iom_use('hflx_rnf_cea') )   & 
    1535          CALL iom_put( 'hflx_rnf_cea' , rnf(:,:) * zcptn(:,:) ) 
    1536       IF( srcv(jpr_cal)%laction ) THEN  
     1508      zsnw(:,:) = zicefr(:,:) 
     1509      ! --- Continental fluxes --- ! 
     1510      IF( srcv(jpr_rnf)%laction ) THEN   ! runoffs (included in emp later on) 
     1511         rnf(:,:) = frcv(jpr_rnf)%z3(:,:,1) 
     1512      ENDIF 
     1513      IF( srcv(jpr_cal)%laction ) THEN   ! calving (put in emp_tot) 
    15371514         zemp_tot(:,:) = zemp_tot(:,:) - frcv(jpr_cal)%z3(:,:,1) 
    1538          CALL iom_put( 'calving_cea', frcv(jpr_cal)%z3(:,:,1) ) 
    1539       ENDIF 
    1540  
    1541  
    1542       IF( srcv(jpr_icb)%laction )  THEN  
     1515      ENDIF 
     1516      IF( srcv(jpr_icb)%laction ) THEN   ! iceberg added to runoffs 
    15431517         fwficb(:,:) = frcv(jpr_icb)%z3(:,:,1) 
    1544          rnf(:,:)    = rnf(:,:) + fwficb(:,:)   ! iceberg added to runoffs 
    1545          CALL iom_put( 'iceberg_cea', frcv(jpr_icb)%z3(:,:,1) ) 
    1546       ENDIF 
    1547       IF( srcv(jpr_isf)%laction )  THEN 
    1548         fwfisf(:,:) = - frcv(jpr_isf)%z3(:,:,1)  ! fresh water flux from the isf (fwfisf <0 mean melting)   
    1549         CALL iom_put( 'iceshelf_cea', frcv(jpr_isf)%z3(:,:,1) ) 
    1550       ENDIF 
    1551  
     1518         rnf(:,:)    = rnf(:,:) + fwficb(:,:) 
     1519      ENDIF 
     1520      IF( srcv(jpr_isf)%laction ) THEN   ! iceshelf (fwfisf <0 mean melting) 
     1521        fwfisf(:,:) = - frcv(jpr_isf)%z3(:,:,1) 
     1522      ENDIF 
    15521523 
    15531524      IF( ln_mixcpl ) THEN 
     
    15631534      ENDIF 
    15641535 
    1565       IF( iom_use('subl_ai_cea') )  CALL iom_put( 'subl_ai_cea', frcv(jpr_ievp)%z3(:,:,1) * zicefr(:,:) )  ! Sublimation over sea-ice (cell average) 
    1566                                     CALL iom_put( 'snowpre'    , sprecip(:,:)               )   ! Snow 
    1567       IF( iom_use('snow_ao_cea') )  CALL iom_put( 'snow_ao_cea', sprecip(:,:) * p_frld(:,:) )   ! Snow over ice-free ocean  (cell average) 
    1568       IF( iom_use('snow_ai_cea') )  CALL iom_put( 'snow_ai_cea', sprecip(:,:) * zicefr(:,:) )   ! Snow over sea-ice         (cell average) 
    15691536#endif 
    1570  
     1537      ! outputs 
     1538!!      IF( srcv(jpr_rnf)%laction )   CALL iom_put( 'runoffs' , rnf(:,:) * tmask(:,:,1)                                 )  ! runoff 
     1539!!      IF( srcv(jpr_isf)%laction )   CALL iom_put( 'iceshelf_cea', -fwfisf(:,:) * tmask(:,:,1)                         )  ! iceshelf 
     1540      IF( srcv(jpr_cal)%laction )   CALL iom_put( 'calving_cea' , frcv(jpr_cal)%z3(:,:,1) * tmask(:,:,1)                )  ! calving 
     1541      IF( srcv(jpr_icb)%laction )   CALL iom_put( 'iceberg_cea' , frcv(jpr_icb)%z3(:,:,1) * tmask(:,:,1)                )  ! icebergs 
     1542      IF( iom_use('snowpre') )      CALL iom_put( 'snowpre'     , sprecip(:,:)                                          )  ! Snow 
     1543      IF( iom_use('precip') )       CALL iom_put( 'precip'      , tprecip(:,:)                                          )  ! total  precipitation 
     1544      IF( iom_use('rain') )         CALL iom_put( 'rain'        , tprecip(:,:) - sprecip(:,:)                           )  ! liquid precipitation  
     1545      IF( iom_use('snow_ao_cea') )  CALL iom_put( 'snow_ao_cea' , sprecip(:,:) * ( 1._wp - zsnw(:,:) )                  )  ! Snow over ice-free ocean  (cell average) 
     1546      IF( iom_use('snow_ai_cea') )  CALL iom_put( 'snow_ai_cea' , sprecip(:,:) *           zsnw(:,:)                    )  ! Snow over sea-ice         (cell average) 
     1547      IF( iom_use('rain_ao_cea') )  CALL iom_put( 'rain_ao_cea' , ( tprecip(:,:) - sprecip(:,:) ) * p_frld(:,:)         )  ! liquid precipitation over ocean (cell average) 
     1548      IF( iom_use('subl_ai_cea') )  CALL iom_put( 'subl_ai_cea' , frcv(jpr_ievp)%z3(:,:,1) * zicefr(:,:) * tmask(:,:,1) )  ! Sublimation over sea-ice (cell average) 
     1549      IF( iom_use('evap_ao_cea') )  CALL iom_put( 'evap_ao_cea' , ( frcv(jpr_tevp)%z3(:,:,1)  & 
     1550         &                                                        - frcv(jpr_ievp)%z3(:,:,1) * zicefr(:,:) ) * tmask(:,:,1) )  ! ice-free oce evap (cell average) 
     1551      ! note: runoff output is done in sbcrnf (which includes icebergs too) and iceshelf output is done in sbcisf 
     1552      ! 
    15711553      !                                                      ! ========================= ! 
    15721554      SELECT CASE( TRIM( sn_rcv_qns%cldes ) )                !   non solar heat fluxes   !   (qns) 
     
    16041586            &                                           + pist(:,:,1) * zicefr(:,:) ) ) 
    16051587      END SELECT 
    1606 !!gm 
    1607 !!    currently it is taken into account in leads budget but not in the zqns_tot, and thus not in  
    1608 !!    the flux that enter the ocean.... 
    1609 !!    moreover 1 - it is not diagnose anywhere....  
    1610 !!             2 - it is unclear for me whether this heat lost is taken into account in the atmosphere or not... 
    1611 !! 
    1612 !! similar job should be done for snow and precipitation temperature 
    16131588      !                                      
    1614       IF( srcv(jpr_cal)%laction ) THEN   ! Iceberg melting  
    1615          zqns_tot(:,:) = zqns_tot(:,:) - frcv(jpr_cal)%z3(:,:,1) * lfus  ! add the latent heat of iceberg melting 
    1616                                                                          ! we suppose it melts at 0deg, though it should be temp. of surrounding ocean 
    1617          IF( iom_use('hflx_cal_cea') )   CALL iom_put( 'hflx_cal_cea', - frcv(jpr_cal)%z3(:,:,1) * lfus )   ! heat flux from calving 
    1618       ENDIF 
    1619  
    1620 !!chris      
    1621 !!    The heat content associated to the ice shelf in removed in the routine sbcisf.F90 
    1622       ! 
    1623       IF( srcv(jpr_icb)%laction )  zqns_tot(:,:) = zqns_tot(:,:) - frcv(jpr_icb)%z3(:,:,1) * lfus ! remove heat content associated to iceberg melting 
    1624       ! 
    1625 !!      ! 
     1589      ! --- calving (removed from qns_tot) --- ! 
     1590      IF( srcv(jpr_cal)%laction )   zqns_tot(:,:) = zqns_tot(:,:) - frcv(jpr_cal)%z3(:,:,1) * lfus  ! remove latent heat of calving 
     1591                                                                                                    ! we suppose it melts at 0deg, though it should be temp. of surrounding ocean 
     1592      ! --- iceberg (removed from qns_tot) --- ! 
     1593      IF( srcv(jpr_icb)%laction )   zqns_tot(:,:) = zqns_tot(:,:) - frcv(jpr_icb)%z3(:,:,1) * lfus  ! remove latent heat of iceberg melting 
    16261594 
    16271595#if defined key_lim3       
     
    16321600 
    16331601      ! Heat content per unit mass of snow (J/kg) 
    1634       WHERE( SUM( a_i, dim=3 ) > 1.e-10 )   ;   zcptsnw(:,:) = cpic * SUM( (tn_ice -rt0) * a_i, dim=3 ) / SUM( a_i, dim=3 ) 
     1602      WHERE( SUM( a_i, dim=3 ) > 1.e-10 )   ;   zcptsnw(:,:) = cpic * SUM( (tn_ice - rt0) * a_i, dim=3 ) / SUM( a_i, dim=3 ) 
    16351603      ELSEWHERE                             ;   zcptsnw(:,:) = zcptn(:,:) 
    16361604      ENDWHERE 
    16371605      ! Heat content per unit mass of rain (J/kg) 
    1638       zcptrain(:,:) = rcp * ( SUM( (tn_ice(:,:,:) -rt0) * a_i(:,:,:), dim=3 ) + sst_m(:,:) * p_frld(:,:) )  
    1639  
    1640       ! --- heat flux associated with emp (W/m2) --- ! 
    1641       zqemp_oce(:,:) = -  zevap_oce(:,:)                                      *   zcptn(:,:)   &       ! evap 
    1642          &             + ( ztprecip(:,:) - zsprecip(:,:) )                    *   zcptrain(:,:)   &       ! liquid precip 
    1643          &             +   zsprecip(:,:)                   * ( 1._wp - zsnw ) * ( zcptsnw(:,:) - lfus )  ! solid precip over ocean + snow melting 
    1644 !      zqemp_ice(:,:) = -   frcv(jpr_ievp)%z3(:,:,1)        * zicefr(:,:)      *   zcptn(:,:)   &      ! ice evap 
    1645 !         &             +   zsprecip(:,:)                   * zsnw             * ( zcptn(:,:) - lfus ) ! solid precip over ice 
    1646       zqemp_ice(:,:) =      zsprecip(:,:)                   * zsnw             * ( zcptsnw(:,:) - lfus ) ! solid precip over ice (only) 
    1647                                                                                                        ! qevap_ice=0 since we consider Tice=0degC 
    1648        
     1606      zcptrain(:,:) = rcp * ( SUM( (tn_ice(:,:,:) - rt0) * a_i(:,:,:), dim=3 ) + sst_m(:,:) * p_frld(:,:) )  
     1607 
    16491608      ! --- enthalpy of snow precip over ice in J/m3 (to be used in 1D-thermo) --- ! 
    16501609      zqprec_ice(:,:) = rhosn * ( zcptsnw(:,:) - lfus ) 
    1651       !zqprec_ice(:,:) = rhosn * ( zcptn(:,:) - lfus ) 
    1652        
    16531610 
    16541611      ! --- heat content of evap over ice in W/m2 (to be used in 1D-thermo) --- ! 
    16551612      DO jl = 1, jpl 
    1656          zqevap_ice(:,:,jl) = 0._wp ! should be -evap * ( ( Tice - rt0 ) * cpic ) but we do not have Tice, so we consider Tice=0degC 
     1613         zqevap_ice(:,:,jl) = 0._wp ! should be -evap * ( ( Tice - rt0 ) * cpic ) but atm. does not take it into account 
    16571614      END DO 
    16581615 
     1616      ! --- heat flux associated with emp (W/m2) --- ! 
     1617      zqemp_oce(:,:) = -  zevap_oce(:,:)                                      *   zcptn   (:,:)   &        ! evap 
     1618         &             + ( ztprecip(:,:) - zsprecip(:,:) )                    *   zcptrain(:,:)   &        ! liquid precip 
     1619         &             +   zsprecip(:,:)                   * ( 1._wp - zsnw ) * ( zcptsnw (:,:) - lfus )   ! solid precip over ocean + snow melting 
     1620      zqemp_ice(:,:) =     zsprecip(:,:)                   * zsnw             * ( zcptsnw (:,:) - lfus )   ! solid precip over ice (qevap_ice=0 since atm. does not take it into account) 
     1621!!    zqemp_ice(:,:) = -   frcv(jpr_ievp)%z3(:,:,1)        * zicefr(:,:)      *   zcptsnw (:,:)   &        ! ice evap 
     1622!!       &             +   zsprecip(:,:)                   * zsnw             * zqprec_ice(:,:) * r1_rhosn ! solid precip over ice 
     1623       
    16591624      ! --- total non solar flux (including evap/precip) --- ! 
    16601625      zqns_tot(:,:) = zqns_tot(:,:) + zqemp_ice(:,:) + zqemp_oce(:,:) 
     
    16811646      ENDIF 
    16821647 
    1683       ! some more outputs 
    1684       IF( iom_use('hflx_snow_cea') )    CALL iom_put('hflx_snow_cea',   sprecip(:,:) * ( zcptn(:,:) - Lfus ) )                       ! heat flux from snow (cell average) 
    1685       IF( iom_use('hflx_rain_cea') )    CALL iom_put('hflx_rain_cea', ( tprecip(:,:) - sprecip(:,:) ) * zcptn(:,:) )                 ! heat flux from rain (cell average) 
    1686       IF( iom_use('hflx_snow_ao_cea') ) CALL iom_put('hflx_snow_ao_cea',sprecip(:,:) * ( zcptn(:,:) - Lfus ) * (1._wp - zsnw(:,:)) ) ! heat flux from snow (cell average) 
    1687       IF( iom_use('hflx_snow_ai_cea') ) CALL iom_put('hflx_snow_ai_cea',sprecip(:,:) * ( zcptn(:,:) - Lfus ) * zsnw(:,:) )           ! heat flux from snow (cell average) 
    1688  
    16891648#else 
     1649      zcptsnw (:,:) = zcptn(:,:) 
     1650      zcptrain(:,:) = zcptn(:,:) 
     1651       
    16901652      ! clem: this formulation is certainly wrong... but better than it was... 
    1691       zqns_tot(:,:) = zqns_tot(:,:)                                 ! zqns_tot update over free ocean with: 
    1692          &          - ztmp(:,:)                           &            ! remove the latent heat flux of solid precip. melting 
    1693          &          - (  zemp_tot(:,:)                              ! remove the heat content of mass flux (assumed to be at SST) 
     1653      zqns_tot(:,:) = zqns_tot(:,:)                            &          ! zqns_tot update over free ocean with: 
     1654         &          - (  p_frld(:,:) * zsprecip(:,:) * lfus )  &          ! remove the latent heat flux of solid precip. melting 
     1655         &          - (  zemp_tot(:,:)                         &          ! remove the heat content of mass flux (assumed to be at SST) 
    16941656         &             - zemp_ice(:,:) ) * zcptn(:,:)  
    16951657 
     
    17041666         qns_ice(:,:,:) = zqns_ice(:,:,:) 
    17051667      ENDIF 
     1668 
    17061669#endif 
    1707  
     1670      ! outputs 
     1671      IF( srcv(jpr_cal)%laction )    CALL iom_put('hflx_cal_cea' , - frcv(jpr_cal)%z3(:,:,1) * lfus                                  ) ! latent heat from calving 
     1672      IF( srcv(jpr_icb)%laction )    CALL iom_put('hflx_icb_cea' , - frcv(jpr_icb)%z3(:,:,1) * lfus                                  ) ! latent heat from icebergs melting 
     1673      IF( iom_use('hflx_snow_cea') ) CALL iom_put('hflx_snow_cea',  sprecip(:,:) * ( zcptsnw(:,:) - Lfus )                           ) ! heat flux from snow (cell average) 
     1674      IF( iom_use('hflx_rain_cea') ) CALL iom_put('hflx_rain_cea',( tprecip(:,:) - sprecip(:,:) ) * zcptrain(:,:)                    ) ! heat flux from rain (cell average) 
     1675      IF( iom_use('hflx_evap_cea') ) CALL iom_put('hflx_evap_cea',(frcv(jpr_tevp)%z3(:,:,1) - frcv(jpr_ievp)%z3(:,:,1) * zicefr(:,:) & ! heat flux from from evap (cell average) 
     1676         &                                                        ) * zcptn(:,:) * tmask(:,:,1) ) 
     1677      IF( iom_use('hflx_prec_cea') ) CALL iom_put('hflx_prec_cea',   sprecip(:,:) * ( zcptsnw(:,:) - Lfus ) +  &                       ! heat flux from all precip (cell avg) 
     1678         &                                                         ( tprecip(:,:) - sprecip(:,:) ) * zcptrain(:,:)                   ) 
     1679      IF( iom_use('hflx_snow_ao_cea') ) CALL iom_put('hflx_snow_ao_cea',sprecip(:,:) * (zcptsnw(:,:) - Lfus) * (1._wp - zsnw(:,:))   ) ! heat flux from snow (over ocean) 
     1680      IF( iom_use('hflx_snow_ai_cea') ) CALL iom_put('hflx_snow_ai_cea',sprecip(:,:) * (zcptsnw(:,:) - Lfus) *          zsnw(:,:)    ) ! heat flux from snow (over ice) 
     1681      ! note: hflx for runoff and iceshelf are done in sbcrnf and sbcisf resp. 
     1682      ! 
    17081683      !                                                      ! ========================= ! 
    17091684      SELECT CASE( TRIM( sn_rcv_qsr%cldes ) )                !      solar heat fluxes    !   (qsr) 
     
    18111786      fr2_i0(:,:) = ( 0.82 * ( 1.0 - cldf_ice ) + 0.65 * cldf_ice ) 
    18121787 
    1813       CALL wrk_dealloc( jpi,jpj,     zcptn, ztmp, zcptrain, zcptsnw, zicefr, zmsk, zsnw ) 
     1788      CALL wrk_dealloc( jpi,jpj,     zcptn, zcptrain, zcptsnw, zicefr, zmsk, zsnw ) 
    18141789      CALL wrk_dealloc( jpi,jpj,     zemp_tot, zemp_ice, zemp_oce, ztprecip, zsprecip, zevap_oce, zevap_ice, zdevap_ice ) 
    18151790      CALL wrk_dealloc( jpi,jpj,     zqns_tot, zqns_oce, zqsr_tot, zqsr_oce, zqprec_ice, zqemp_oce, zqemp_ice ) 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/OPA_SRC/SBC/sbcisf.F90

    r7806 r10115  
    168168          
    169169         ! salt effect already take into account in vertical advection 
    170          risf_tsc(:,:,jp_sal) = (1.0_wp-rdivisf) * fwfisf(:,:) * stbl(:,:) * r1_rau0 
    171  
    172          ! output 
    173          IF( iom_use('qlatisf' ) )   CALL iom_put('qlatisf', qisf) 
    174          IF( iom_use('fwfisf'  ) )   CALL iom_put('fwfisf' , fwfisf * stbl(:,:) / soce ) 
    175  
    176          ! if apply only on the trend and not as a volume flux (rdivisf = 0), fwfisf have to be set to 0 now 
    177          fwfisf(:,:) = rdivisf * fwfisf(:,:)          
    178   
     170         risf_tsc(:,:,jp_sal) = (1.0_wp-rdivisf) * fwfisf(:,:) * soce * r1_rau0 
     171 
    179172         ! lbclnk 
    180173         CALL lbc_lnk(risf_tsc(:,:,jp_tem),'T',1.) 
     
    182175         CALL lbc_lnk(fwfisf(:,:)   ,'T',1.) 
    183176         CALL lbc_lnk(qisf(:,:)     ,'T',1.) 
     177 
     178         ! output 
     179         IF( iom_use('iceshelf_cea') )   CALL iom_put( 'iceshelf_cea', -fwfisf(:,:)                      )   ! isf mass flux 
     180         IF( iom_use('hflx_isf_cea') )   CALL iom_put( 'hflx_isf_cea', risf_tsc(:,:,jp_tem) * rau0 * rcp )   ! isf sensible+latent heat (W/m2) 
     181         IF( iom_use('qlatisf' ) )       CALL iom_put( 'qlatisf'     , qisf(:,:)                         )   ! isf latent heat 
     182         IF( iom_use('fwfisf'  ) )       CALL iom_put( 'fwfisf'      , fwfisf(:,:)                       )   ! isf mass flux (opposite sign) 
    184183 
    185184         ! Diagnostics 
     
    192191            zqhcisf3d(:,:,:) = 0.0_wp                         ! 3d heat content flux (W/m2) 
    193192            zqlatisf3d(:,:,:)= 0.0_wp                         ! 3d ice shelf melting latent heat flux (W/m2) 
    194             zqhcisf2d(:,:)   = fwfisf(:,:) * zt_frz * rcp     ! 2d heat content flux (W/m2) 
     193            zqhcisf2d(:,:)   = rdivisf * fwfisf(:,:) * zt_frz * rcp     ! 2d heat content flux (W/m2) 
    195194            ! 
    196195            DO jj = 1,jpj 
     
    221220            ! 
    222221         END IF 
     222 
     223         ! if apply only on the trend and not as a volume flux (rdivisf = 0), fwfisf have to be set to 0 now 
     224         fwfisf(:,:) = rdivisf * fwfisf(:,:)          
     225  
    223226         !  
    224227      END IF 
     
    444447              
    445448             fwfisf(ji,jj) = qisf(ji,jj) / lfusisf          !fresh water flux kg/(m2s)                   
    446              fwfisf(ji,jj) = fwfisf(ji,jj) * ( soce / stbl(ji,jj) ) 
    447              !add to salinity trend 
     449 
    448450          ELSE 
    449451             qisf(ji,jj) = 0._wp ; fwfisf(ji,jj) = 0._wp 
     
    544546                  qisf(ji,jj) = - zhtflx 
    545547! For genuine ISOMIP protocol this should probably be something like 
    546                   fwfisf(ji,jj) = zfwflx  * ( soce / MAX(stbl(ji,jj),zeps)) 
     548                  fwfisf(ji,jj) = zfwflx 
    547549               ELSE 
    548550                  fwfisf(ji,jj) = 0._wp 
     
    582584! zfwflx is upward water flux 
    583585                     zfwflx= rau0 * zgammas * ( (zsfrz-stbl(ji,jj)) / zsfrz ) 
     586                     IF ( rdivisf==0 ) THEN  
    584587! zhtflx is upward heat flux (out of ocean) 
    585588! If non conservative we have zcfac=0.0 so zhtflx is as ISOMIP but with different zfrz value 
    586                      zhtflx = ( zgammat*rau0 - zcfac*zfwflx ) * rcp * (zti(ji,jj) - zfrz(ji,jj) )  
     589                        zhtflx = ( zgammat*rau0 - zcfac*zfwflx ) * rcp * (zti(ji,jj) - zfrz(ji,jj) )  
    587590! zwflx is upward water flux 
    588591! If non conservative we have zcfac=0.0 so what follows is then zfwflx*sss_m/zsfrz 
    589                      zfwflx = ( zgammas*rau0 - zcfac*zfwflx ) * (zsfrz - stbl(ji,jj)) / stbl(ji,jj) 
     592                        zfwflx = ( zgammas*rau0 - zcfac*zfwflx ) * (zsfrz - stbl(ji,jj)) / stbl(ji,jj) 
     593                     ELSE 
     594                        zhtflx = zgammat*rau0 * rcp * (zti(ji,jj) - zfrz(ji,jj) )                      
     595                        ! nothing to do for fwf 
     596                     END IF 
    590597! test convergence and compute gammat 
    591598                     IF (( zhtflx - zhtflx_b) .LE. 0.01 ) lit = .FALSE. 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/OPA_SRC/SBC/sbcrnf.F90

    r7256 r10115  
    138138         IF( ln_rnf_sal )   rnf_tsc(:,:,jp_sal) = ( sf_s_rnf(1)%fnow(:,:,1) ) * rnf(:,:) * r1_rau0 
    139139         !                                                           ! else use S=0 for runoffs (done one for all in the init) 
    140          CALL iom_put( "runoffs", rnf )         ! output runoffs arrays 
     140         IF( iom_use('runoffs') )        CALL iom_put( 'runoffs'     , rnf(:,:)                         )   ! output runoff mass flux 
     141         IF( iom_use('hflx_rnf_cea') )   CALL iom_put( 'hflx_rnf_cea', rnf_tsc(:,:,jp_tem) * rau0 * rcp )   ! output runoff sensible heat (W/m2) 
    141142      ENDIF 
    142143      ! 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/OPA_SRC/TRA/eosbn2.F90

    r7256 r10115  
    697697      CASE( -1, 0 )                !==  polynomial TEOS-10 / EOS-80 ==! 
    698698         ! 
    699          DO jj = 1, jpjm1 
    700             DO ji = 1, fs_jpim1   ! vector opt. 
     699         DO jj = 1, jpj 
     700            DO ji = 1, jpi 
    701701               ! 
    702702               zh  = pdep(ji,jj) * r1_Z0                                  ! depth 
     
    750750         END DO 
    751751         ! 
    752          CALL lbc_lnk( pab(:,:,jp_tem), 'T', 1. )                    ! Lateral boundary conditions 
    753          CALL lbc_lnk( pab(:,:,jp_sal), 'T', 1. )                     
    754          ! 
    755752      CASE( 1 )                  !==  simplified EOS  ==! 
    756753         ! 
    757          DO jj = 1, jpjm1 
    758             DO ji = 1, fs_jpim1   ! vector opt. 
     754         DO jj = 1, jpj 
     755            DO ji = 1, jpi 
    759756               ! 
    760757               zt    = pts  (ji,jj,jp_tem) - 10._wp   ! pot. temperature anomaly (t-T0) 
     
    770767            END DO 
    771768         END DO 
    772          ! 
    773          CALL lbc_lnk( pab(:,:,jp_tem), 'T', 1. )                    ! Lateral boundary conditions 
    774          CALL lbc_lnk( pab(:,:,jp_sal), 'T', 1. )                     
    775769         ! 
    776770      CASE DEFAULT 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_eiv.F90

    r7806 r10115  
    165165         CALL iom_put( "voce_eiv", v_eiv )    ! j-eiv current 
    166166         CALL iom_put( "woce_eiv", w_eiv )    ! vert. eiv current 
     167         ! 
    167168         IF( iom_use('weiv_masstr') ) THEN   ! vertical mass transport & its square value 
    168            z2d(:,:) = rau0 * e12t(:,:) 
    169            DO jk = 1, jpk 
    170               z3d(:,:,jk) = w_eiv(:,:,jk) * z2d(:,:) 
    171            END DO 
    172            CALL iom_put( "weiv_masstr" , z3d )   
    173          ENDIF 
     169            z2d(:,:) = rau0 * e12t(:,:) 
     170            DO jk = 1, jpk 
     171               z3d(:,:,jk) = w_eiv(:,:,jk) * z2d(:,:) 
     172            END DO 
     173            CALL iom_put( "weiv_masstr" , z3d )   
     174         ENDIF 
     175         ! 
    174176         IF( iom_use("ueiv_masstr") .OR. iom_use("ueiv_heattr") .OR. iom_use('ueiv_heattr3d')        & 
    175                                     .OR. iom_use("ueiv_salttr") .OR. iom_use('ueiv_salttr3d') ) THEN 
     177            &                       .OR. iom_use("ueiv_salttr") .OR. iom_use('ueiv_salttr3d') ) THEN 
    176178            z3d(:,:,jpk) = 0.e0 
    177179            z2d(:,:) = 0.e0 
     
    182184            CALL iom_put( "ueiv_masstr", z3d )                  ! mass transport in i-direction 
    183185         ENDIF 
    184  
     186         ! 
    185187         IF( iom_use('ueiv_heattr') .OR. iom_use('ueiv_heattr3d') ) THEN 
    186188            zztmp = 0.5 * rcp  
     
    204206            ENDIF 
    205207         ENDIF 
    206  
     208         ! 
    207209         IF( iom_use('ueiv_salttr') .OR. iom_use('ueiv_salttr3d') ) THEN 
    208210            zztmp = 0.5 * 0.001 
     
    226228            ENDIF 
    227229         ENDIF 
    228  
     230         ! 
    229231         IF( iom_use("veiv_masstr") .OR. iom_use("veiv_heattr") .OR. iom_use('veiv_heattr3d')       & 
    230232                                    .OR. iom_use("veiv_salttr") .OR. iom_use('veiv_salttr3d') ) THEN 
     
    235237            CALL iom_put( "veiv_masstr", z3d )                  ! mass transport in j-direction 
    236238         ENDIF 
    237              
     239         !    
    238240         IF( iom_use('veiv_heattr') .OR. iom_use('veiv_heattr3d') ) THEN 
    239241            zztmp = 0.5 * rcp  
     
    257259            ENDIF 
    258260         ENDIF 
    259  
     261         ! 
    260262         IF( iom_use('veiv_salttr') .OR. iom_use('veiv_salttr3d') ) THEN 
    261263            zztmp = 0.5 * 0.001 
     
    279281            ENDIF 
    280282         ENDIF 
    281  
     283         ! 
    282284         IF( iom_use('weiv_masstr') .OR. iom_use('weiv_heattr3d') .OR. iom_use('weiv_salttr3d')) THEN   ! vertical mass transport & its square value 
    283285           z2d(:,:) = rau0 * e12t(:,:) 
     
    287289           CALL iom_put( "weiv_masstr" , z3d )                  ! mass transport in k-direction 
    288290         ENDIF 
    289  
     291         ! 
    290292         IF( iom_use('weiv_heattr3d') ) THEN 
    291293            zztmp = 0.5 * rcp  
     
    300302            CALL iom_put( "weiv_heattr3d", zztmp * z3d_T )                 ! 3D heat transport in k-direction 
    301303         ENDIF 
    302  
     304         ! 
    303305         IF( iom_use('weiv_salttr3d') ) THEN 
    304306            zztmp = 0.5 * 0.001  
     
    313315            CALL iom_put( "weiv_salttr3d", zztmp * z3d_T )                 ! 3D salt transport in k-direction 
    314316         ENDIF 
    315  
    316     END IF 
    317 ! 
    318     IF( ln_diaptr .AND. cdtype == 'TRA' ) THEN 
    319        z3d(:,:,:) = 0._wp 
    320        DO jk = 1, jpkm1 
    321           DO jj = 2, jpjm1 
    322              DO ji = fs_2, fs_jpim1   ! vector opt. 
    323                 z3d(ji,jj,jk) = v_eiv(ji,jj,jk) * 0.5 * (tsn(ji,jj,jk,jp_tem)+tsn(ji,jj+1,jk,jp_tem)) & 
    324                 &             * e1v(ji,jj) * fse3v(ji,jj,jk) 
    325              END DO 
    326           END DO 
    327        END DO 
    328        CALL dia_ptr_ohst_components( jp_tem, 'eiv', z3d ) 
    329        z3d(:,:,:) = 0._wp 
    330        DO jk = 1, jpkm1 
    331           DO jj = 2, jpjm1 
    332              DO ji = fs_2, fs_jpim1   ! vector opt. 
    333                 z3d(ji,jj,jk) = v_eiv(ji,jj,jk) * 0.5 * (tsn(ji,jj,jk,jp_sal)+tsn(ji,jj+1,jk,jp_sal)) & 
    334                 &             * e1v(ji,jj) * fse3v(ji,jj,jk) 
    335              END DO 
    336           END DO 
    337        END DO 
    338        CALL dia_ptr_ohst_components( jp_sal, 'eiv', z3d ) 
    339     ENDIF 
    340  
    341     IF( ln_KE_trd ) CALL trd_dyn(u_eiv, v_eiv, jpdyn_eivke, kt ) 
     317         ! 
     318         IF( ln_diaptr ) THEN 
     319            z3d(:,:,:) = 0._wp 
     320            DO jk = 1, jpkm1 
     321               DO jj = 2, jpjm1 
     322                  DO ji = fs_2, fs_jpim1   ! vector opt. 
     323                     z3d(ji,jj,jk) = v_eiv(ji,jj,jk) * 0.5 * (tsn(ji,jj,jk,jp_tem)+tsn(ji,jj+1,jk,jp_tem)) & 
     324                        &             * e1v(ji,jj) * fse3v(ji,jj,jk) 
     325                  END DO 
     326               END DO 
     327            END DO 
     328            CALL dia_ptr_ohst_components( jp_tem, 'eiv', z3d ) 
     329            z3d(:,:,:) = 0._wp 
     330            DO jk = 1, jpkm1 
     331               DO jj = 2, jpjm1 
     332                  DO ji = fs_2, fs_jpim1   ! vector opt. 
     333                     z3d(ji,jj,jk) = v_eiv(ji,jj,jk) * 0.5 * (tsn(ji,jj,jk,jp_sal)+tsn(ji,jj+1,jk,jp_sal)) & 
     334                     &             * e1v(ji,jj) * fse3v(ji,jj,jk) 
     335                  END DO 
     336               END DO 
     337            END DO 
     338            CALL dia_ptr_ohst_components( jp_sal, 'eiv', z3d ) 
     339         ENDIF 
     340         ! 
     341!!gm add CMIP6 diag here instead of been done in trdken.F90 
     342         ! 
     343         IF( iom_use('eketrd_eiv') ) THEN     ! tendency of EKE from parameterized eddy advection 
     344            ! CMIP6 diagnostic tknebto = tendency of EKE from parameterized mesoscale eddy advection 
     345            ! = vertical_integral( k (N S)^2 ) rho dz   where rho = rau0 and S = isoneutral slope. 
     346            z2d(:,:) = 0._wp 
     347            DO jk = 1, jpkm1 
     348               DO ji = 1, jpi 
     349                  DO jj = 1,jpj 
     350                     z2d(ji,jj) = z2d(ji,jj) + rau0 * fsaeiw(ji,jj,jk)                 & 
     351                        &                    * rn2b(ji,jj,jk) * fse3w(ji,jj,jk)        & 
     352                        &                    * (  wslpi(ji,jj,jk) * wslpi(ji,jj,jk)    & 
     353                        &                       + wslpj(ji,jj,jk) * wslpj(ji,jj,jk)  ) * wmask(ji,jj,jk) 
     354                  END DO 
     355               END DO 
     356            END DO 
     357            CALL iom_put( "eketrd_eiv", z2d ) 
     358         ENDIF 
     359         ! 
     360!!gm  removed from trdken.F90    IF( ln_KE_trd )   CALL trd_dyn(u_eiv, v_eiv, jpdyn_eivke, kt ) 
     361         ! 
     362      ENDIF 
    342363# endif   
    343364 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/OPA_SRC/TRA/trabbl.F90

    r4990 r10115  
    548548      zmbk(:,:) = REAL( mbkv_d(:,:), wp )   ;   CALL lbc_lnk(zmbk,'V',1.)   ;   mbkv_d(:,:) = MAX( INT( zmbk(:,:) ), 1 ) 
    549549 
    550                                         !* sign of grad(H) at u- and v-points 
    551       mgrhu(jpi,:) = 0   ;   mgrhu(:,jpj) = 0   ;   mgrhv(jpi,:) = 0   ;   mgrhv(:,jpj) = 0 
     550                                        !* sign of grad(H) at u- and v-points; zero if grad(H) = 0 
     551      mgrhu(:,:) = 0   ;   mgrhv(:,:) = 0 
    552552      DO jj = 1, jpjm1 
    553553         DO ji = 1, jpim1 
    554             mgrhu(ji,jj) = INT(  SIGN( 1.e0, gdept_0(ji+1,jj,mbkt(ji+1,jj)) - gdept_0(ji,jj,mbkt(ji,jj)) )  ) 
    555             mgrhv(ji,jj) = INT(  SIGN( 1.e0, gdept_0(ji,jj+1,mbkt(ji,jj+1)) - gdept_0(ji,jj,mbkt(ji,jj)) )  ) 
     554            IF( gdept_0(ji+1,jj,mbkt(ji+1,jj)) - gdept_0(ji,jj,mbkt(ji,jj)) /= 0._wp ) THEN 
     555               mgrhu(ji,jj) = INT(  SIGN( 1.e0, gdept_0(ji+1,jj,mbkt(ji+1,jj)) - gdept_0(ji,jj,mbkt(ji,jj)) )  ) 
     556            ENDIF 
     557            ! 
     558            IF( gdept_0(ji,jj+1,mbkt(ji,jj+1)) - gdept_0(ji,jj,mbkt(ji,jj)) /= 0._wp ) THEN 
     559               mgrhv(ji,jj) = INT(  SIGN( 1.e0, gdept_0(ji,jj+1,mbkt(ji,jj+1)) - gdept_0(ji,jj,mbkt(ji,jj)) )  ) 
     560            ENDIF 
    556561         END DO 
    557562      END DO 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/OPA_SRC/TRA/traldf.F90

    r7256 r10115  
    215215      IF( ierr == 1 )   CALL ctl_stop( ' iso-level in z-coordinate - partial step, not allowed' ) 
    216216      IF( ierr == 2 )   CALL ctl_stop( ' isoneutral bilaplacian operator does not exist' ) 
     217      IF( ln_traldf_hor .AND. ln_traldf_grif )    & 
     218            &   CALL ctl_stop( ' horizontal operator and Griffies triads not available; sitch to isoneutral operator' ) 
    217219      IF( ln_traldf_grif .AND. ln_isfcav         )   & 
    218220           CALL ctl_stop( ' ice shelf and traldf_grif not tested') 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/OPA_SRC/TRA/tranxt.F90

    r10106 r10115  
    131131      IF( l_trdtra )   THEN                     
    132132         CALL wrk_alloc( jpi, jpj, jpk, ztrdt, ztrds ) 
    133          ztrdt(:,:,jk) = 0._wp 
    134          ztrds(:,:,jk) = 0._wp 
     133         ztrdt(:,:,jpk) = 0._wp 
     134         ztrds(:,:,jpk) = 0._wp 
    135135         IF( ln_traldf_iso ) THEN              ! diagnose the "pure" Kz diffusive trend  
    136136            CALL trd_tra( kt, 'TRA', jp_tem, jptra_zdfp, ztrdt ) 
    137137            CALL trd_tra( kt, 'TRA', jp_sal, jptra_zdfp, ztrds ) 
    138138         ENDIF 
    139          ! total trend for the non-time-filtered variables.  
    140          DO jk = 1, jpkm1 
    141             zfact = 1.0 / rdttra(jk) 
    142             ztrdt(:,:,jk) = ( tsa(:,:,jk,jp_tem) - tsn(:,:,jk,jp_tem) ) * zfact  
    143             ztrds(:,:,jk) = ( tsa(:,:,jk,jp_sal) - tsn(:,:,jk,jp_sal) ) * zfact  
    144          END DO 
     139         ! total trend for the non-time-filtered variables. 
     140         ! G Nurser 23 Mar 2017. Recalculate trend as Delta(e3t*T)/e3tn; e3tn cancel from tsn terms 
     141         IF( lk_vvl ) THEN 
     142            DO jk = 1, jpkm1 
     143               zfact = 1.0 / rdttra(jk) 
     144               ztrdt(:,:,jk) = ( tsa(:,:,jk,jp_tem)*fse3t_a(:,:,jk) / fse3t_n(:,:,jk) - tsn(:,:,jk,jp_tem)) * zfact 
     145               ztrds(:,:,jk) = ( tsa(:,:,jk,jp_sal)*fse3t_a(:,:,jk) / fse3t_n(:,:,jk) - tsn(:,:,jk,jp_sal)) * zfact 
     146            END DO 
     147         ELSE 
     148            DO jk = 1, jpkm1 
     149               zfact = 1.0 / rdttra(jk) 
     150               ztrdt(:,:,jk) = ( tsa(:,:,jk,jp_tem) - tsn(:,:,jk,jp_tem) ) * zfact  
     151               ztrds(:,:,jk) = ( tsa(:,:,jk,jp_sal) - tsn(:,:,jk,jp_sal) ) * zfact  
     152            END DO 
     153         END IF 
    145154         CALL trd_tra( kt, 'TRA', jp_tem, jptra_tot, ztrdt ) 
    146155         CALL trd_tra( kt, 'TRA', jp_sal, jptra_tot, ztrds ) 
    147          ! Store now fields before applying the Asselin filter  
    148          ! in order to calculate Asselin filter trend later. 
    149          ztrdt(:,:,:) = tsn(:,:,:,jp_tem)  
    150          ztrds(:,:,:) = tsn(:,:,:,jp_sal) 
     156         IF( .NOT.lk_vvl )  THEN 
     157            ! Store now fields before applying the Asselin filter  
     158            ! in order to calculate Asselin filter trend later. 
     159            ztrdt(:,:,:) = tsn(:,:,:,jp_tem)  
     160            ztrds(:,:,:) = tsn(:,:,:,jp_sal) 
     161         END IF 
    151162      ENDIF 
    152163 
     
    157168            END DO 
    158169         END DO 
     170         IF (l_trdtra.AND.lk_vvl) THEN      ! Zero Asselin filter contribution must be explicitly written out since for vvl 
     171                                            ! Asselin filter is output by tra_nxt_vvl that is not called on this time step 
     172            ztrdt(:,:,:) = 0._wp 
     173            ztrds(:,:,:) = 0._wp 
     174            CALL trd_tra( kt, 'TRA', jp_tem, jptra_atf, ztrdt ) 
     175            CALL trd_tra( kt, 'TRA', jp_sal, jptra_atf, ztrds ) 
     176         END IF 
    159177      ELSE                                            ! Leap-Frog + Asselin filter time stepping 
    160178         ! 
     
    166184      ! 
    167185     ! trends computation 
    168       IF( l_trdtra ) THEN      ! trend of the Asselin filter (tb filtered - tb)/dt      
     186      IF( l_trdtra.AND..NOT.lk_vvl) THEN      ! trend of the Asselin filter (tb filtered - tb)/dt      
    169187         DO jk = 1, jpkm1 
    170188            zfact = 1._wp / r2dtra(jk)              
     
    174192         CALL trd_tra( kt, 'TRA', jp_tem, jptra_atf, ztrdt ) 
    175193         CALL trd_tra( kt, 'TRA', jp_sal, jptra_atf, ztrds ) 
    176          CALL wrk_dealloc( jpi, jpj, jpk, ztrdt, ztrds ) 
    177194      END IF 
     195      IF( l_trdtra) CALL wrk_dealloc( jpi, jpj, jpk, ztrdt, ztrds ) 
    178196      ! 
    179197      !                        ! control print 
     
    291309      LOGICAL  ::   ll_tra_hpg, ll_traqsr, ll_rnf, ll_isf   ! local logical 
    292310      INTEGER  ::   ji, jj, jk, jn              ! dummy loop indices 
    293       REAL(wp) ::   zfact1, ztc_a , ztc_n , ztc_b , ztc_f , ztc_d    ! local scalar 
     311      REAL(wp) ::   zfact, zfact1, ztc_a , ztc_n , ztc_b , ztc_f , ztc_d    ! local scalar 
    294312      REAL(wp) ::   zfact2, ze3t_b, ze3t_n, ze3t_a, ze3t_f, ze3t_d   !   -      - 
     313      REAL(wp), POINTER, DIMENSION(:,:,:,:) :: ztrd_atf 
    295314      !!---------------------------------------------------------------------- 
    296315      ! 
     
    317336      ENDIF 
    318337      ! 
     338      IF( ( l_trdtra .and. cdtype == 'TRA' ) .OR. ( l_trdtrc .and. cdtype == 'TRC' ) )   THEN 
     339         CALL wrk_alloc( jpi, jpj, jpk, kjpt, ztrd_atf ) 
     340         ztrd_atf(:,:,:,:) = 0.0_wp 
     341      ENDIF 
    319342      DO jn = 1, kjpt       
    320343         DO jk = 1, jpkm1 
     344            zfact = 1._wp / r2dtra(jk) 
    321345            zfact1 = atfp * p2dt(jk) 
    322346            zfact2 = zfact1 / rau0 
     
    373397                     pta(ji,jj,jk,jn) = ze3t_d * ( ztc_n  + rbcp * ztc_d  )   ! ta <-- Brown & Campana average 
    374398                  ENDIF 
     399                  IF( ( l_trdtra .and. cdtype == 'TRA' ) .OR. ( l_trdtrc .and. cdtype == 'TRC' ) ) THEN 
     400                     ztrd_atf(ji,jj,jk,jn) = (ztc_f - ztc_n) * zfact/ze3t_n 
     401                  ENDIF 
    375402               END DO 
    376403            END DO 
     
    379406      END DO 
    380407      ! 
     408      IF( l_trdtra .and. cdtype == 'TRA' ) THEN  
     409         CALL trd_tra( kt, cdtype, jp_tem, jptra_atf, ztrd_atf(:,:,:,jp_tem) ) 
     410         CALL trd_tra( kt, cdtype, jp_sal, jptra_atf, ztrd_atf(:,:,:,jp_sal) ) 
     411         CALL wrk_dealloc( jpi, jpj, jpk, kjpt, ztrd_atf ) 
     412      ENDIF 
     413      IF( l_trdtrc .and. cdtype == 'TRC' ) THEN 
     414         DO jn = 1, kjpt 
     415            CALL trd_tra( kt, cdtype, jn, jptra_atf, ztrd_atf(:,:,:,jn) ) 
     416         END DO 
     417         CALL wrk_dealloc( jpi, jpj, jpk, kjpt, ztrd_atf ) 
     418      ENDIF 
     419 
    381420   END SUBROUTINE tra_nxt_vvl 
    382421 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/OPA_SRC/TRA/trazdf.F90

    r5602 r10115  
    9494 
    9595      IF( l_trdtra )   THEN                      ! save the vertical diffusive trends for further diagnostics 
    96          DO jk = 1, jpkm1 
    97             ztrdt(:,:,jk) = ( ( tsa(:,:,jk,jp_tem) - tsb(:,:,jk,jp_tem) ) / r2dtra(jk) ) - ztrdt(:,:,jk) 
    98             ztrds(:,:,jk) = ( ( tsa(:,:,jk,jp_sal) - tsb(:,:,jk,jp_sal) ) / r2dtra(jk) ) - ztrds(:,:,jk) 
    99          END DO 
     96         ! G Nurser 23 Mar 2017. Recalculate trend as Delta(e3t*T)/e3tn. 
     97         IF( lk_vvl ) THEN 
     98            DO jk = 1, jpkm1 
     99               ztrdt(:,:,jk) = ( ( tsa(:,:,jk,jp_tem)*fse3t_a(:,:,jk) - tsb(:,:,jk,jp_tem)*fse3t_b(:,:,jk) ) & 
     100                    & / (fse3t_n(:,:,jk)*r2dtra(jk)) ) - ztrdt(:,:,jk) 
     101               ztrds(:,:,jk) = ( ( tsa(:,:,jk,jp_sal)*fse3t_a(:,:,jk) - tsb(:,:,jk,jp_sal)*fse3t_b(:,:,jk) ) & 
     102                    & / (fse3t_n(:,:,jk)*r2dtra(jk)) ) - ztrds(:,:,jk) 
     103            END DO 
     104         ELSE 
     105            DO jk = 1, jpkm1 
     106               ztrdt(:,:,jk) = ( ( tsa(:,:,jk,jp_tem) - tsb(:,:,jk,jp_tem) ) / r2dtra(jk) ) - ztrdt(:,:,jk) 
     107               ztrds(:,:,jk) = ( ( tsa(:,:,jk,jp_sal) - tsb(:,:,jk,jp_sal) ) / r2dtra(jk) ) - ztrds(:,:,jk) 
     108            END DO 
     109         END IF 
    100110         CALL lbc_lnk( ztrdt, 'T', 1. ) 
    101111         CALL lbc_lnk( ztrds, 'T', 1. ) 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/OPA_SRC/TRD/trd_oce.F90

    r7806 r10115  
    7676   INTEGER, PUBLIC, PARAMETER ::   jpdyn_spgflt  = 14  !: filter contribution to surface pressure gradient (spg_flt) 
    7777   INTEGER, PUBLIC, PARAMETER ::   jpdyn_spgexp  = 15  !: explicit contribution to surface pressure gradient (spg_flt) 
    78    INTEGER, PUBLIC, PARAMETER ::   jpdyn_eivke   = 16  !: K.E trend from Gent McWilliams scheme 
    7978   ! 
    8079   !!---------------------------------------------------------------------- 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/OPA_SRC/TRD/trdken.F90

    r7806 r10115  
    195195                    CALL ken_p2k( kt , zke ) 
    196196                      CALL iom_put( "ketrd_convP2K", zke )     ! conversion -rau*g*w 
    197         CASE( jpdyn_eivke ) 
    198             ! CMIP6 diagnostic tknebto = tendency of KE from 
    199             ! parameterized mesoscale eddy advection 
    200             ! = vertical_integral( k (N S)^2 ) rho dz 
    201             ! rho = reference density 
    202             ! S = isoneutral slope. 
    203             ! Most terms are on W grid so work on this grid 
    204 #ifdef key_traldf_eiv 
    205             CALL wrk_alloc( jpi, jpj, zke2d ) 
    206             zke2d(:,:) = 0._wp 
    207             DO jk = 1,jpk 
    208                DO ji = 1,jpi 
    209                   DO jj = 1,jpj 
    210                      zke2d(ji,jj) = zke2d(ji,jj) +  rau0 * fsaeiw(ji, jj, jk)               & 
    211                           &                      * ( wslpi(ji, jj, jk) * wslpi(ji,jj,jk)    & 
    212                           &                      +   wslpj(ji, jj, jk) * wslpj(ji,jj,jk) )  & 
    213                           &                      *   rn2(ji,jj,jk) * fse3w(ji, jj, jk) 
    214                   ENDDO 
    215                ENDDO 
    216             ENDDO 
    217             CALL iom_put("ketrd_eiv", zke2d) 
    218             CALL wrk_dealloc( jpi, jpj, zke2d ) 
    219 #endif 
     197!!gm moved in traadv_eiv ===>>> diag becomes accessible without ln_trdtra=T 
     198!        CASE( jpdyn_eivke ) 
     199!            ! CMIP6 diagnostic tknebto = tendency of EKE from 
     200!            ! parameterized mesoscale eddy advection 
     201!            ! = vertical_integral( k (N S)^2 ) rho dz 
     202!            ! rho = reference density 
     203!            ! S = isoneutral slope. 
     204!            ! Most terms are on W grid so work on this grid 
     205!#ifdef key_traldf_eiv 
     206!            CALL wrk_alloc( jpi, jpj, zke2d ) 
     207!            zke2d(:,:) = 0._wp 
     208!            DO jk = 1,jpk 
     209!               DO ji = 1,jpi 
     210!                  DO jj = 1,jpj 
     211!                     zke2d(ji,jj) = zke2d(ji,jj) +  rau0 * fsaeiw(ji, jj, jk)               & 
     212!                          &                      * ( wslpi(ji, jj, jk) * wslpi(ji,jj,jk)    & 
     213!                          &                      +   wslpj(ji, jj, jk) * wslpj(ji,jj,jk) )  & 
     214!                          &                      *   rn2(ji,jj,jk) * fse3w(ji, jj, jk) 
     215!                  ENDDO 
     216!               ENDDO 
     217!            ENDDO 
     218!            CALL iom_put("ketrd_eiv", zke2d) 
     219!            CALL wrk_dealloc( jpi, jpj, zke2d ) 
     220!#endif 
     221!!gm end 
    220222         ! 
    221223      END SELECT 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/OPA_SRC/TRD/trdtra.F90

    r7806 r10115  
    301301      !! ** Purpose :   output 3D tracer trends using IOM 
    302302      !!---------------------------------------------------------------------- 
    303       REAL(wp), DIMENSION(:,:,:), INTENT(inout) ::   ptrdx   ! Temperature or U trend  
    304       REAL(wp), DIMENSION(:,:,:), INTENT(inout) ::   ptrdy   ! Salinity    or V trend 
    305       INTEGER                   , INTENT(in   ) ::   ktrd    ! tracer trend index 
    306       INTEGER                   , INTENT(in   ) ::   kt      ! time step 
    307       !! 
    308       INTEGER ::   ji, jj, jk   ! dummy loop indices 
    309       INTEGER ::   ikbu, ikbv   ! local integers 
    310       REAL(wp), POINTER, DIMENSION(:,:)   ::   z2dx, z2dy   ! 2D workspace  
    311       !!---------------------------------------------------------------------- 
    312       ! 
    313 !!gm Rq: mask the trends already masked in trd_tra, but lbc_lnk should probably be added 
    314       ! 
    315       SELECT CASE( ktrd ) 
    316       CASE( jptra_xad  )   ;   CALL iom_put( "ttrd_xad" , ptrdx )        ! x- horizontal advection 
    317                                CALL iom_put( "strd_xad" , ptrdy ) 
    318       CASE( jptra_yad  )   ;   CALL iom_put( "ttrd_yad" , ptrdx )        ! y- horizontal advection 
    319                                CALL iom_put( "strd_yad" , ptrdy ) 
    320       CASE( jptra_zad  )   ;   CALL iom_put( "ttrd_zad" , ptrdx )        ! z- vertical   advection 
    321                                CALL iom_put( "strd_zad" , ptrdy ) 
    322                                IF( .NOT. lk_vvl ) THEN                   ! cst volume : adv flux through z=0 surface 
    323                                   CALL wrk_alloc( jpi, jpj, z2dx, z2dy ) 
    324                                   z2dx(:,:) = wn(:,:,1) * tsn(:,:,1,jp_tem) / fse3t(:,:,1) 
    325                                   z2dy(:,:) = wn(:,:,1) * tsn(:,:,1,jp_sal) / fse3t(:,:,1) 
    326                                   CALL iom_put( "ttrd_sad", z2dx ) 
    327                                   CALL iom_put( "strd_sad", z2dy ) 
    328                                   CALL wrk_dealloc( jpi, jpj, z2dx, z2dy ) 
    329                                ENDIF 
    330       CASE( jptra_totad  ) ;   CALL iom_put( "ttrd_totad" , ptrdx )        ! total   advection 
    331                                CALL iom_put( "strd_totad" , ptrdy ) 
    332       CASE( jptra_ldf  )   ;   CALL iom_put( "ttrd_ldf" , ptrdx )        ! lateral diffusion 
    333                                CALL iom_put( "strd_ldf" , ptrdy ) 
    334       CASE( jptra_zdf  )   ;   CALL iom_put( "ttrd_zdf" , ptrdx )        ! vertical diffusion (including Kz contribution) 
    335                                CALL iom_put( "strd_zdf" , ptrdy ) 
    336       CASE( jptra_zdfp )   ;   CALL iom_put( "ttrd_zdfp", ptrdx )        ! PURE vertical diffusion (no isoneutral contribution) 
    337                                CALL iom_put( "strd_zdfp", ptrdy ) 
    338       CASE( jptra_evd )    ;   CALL iom_put( "ttrd_evd", ptrdx )         ! EVD trend (convection) 
    339                                CALL iom_put( "strd_evd", ptrdy ) 
    340       CASE( jptra_dmp  )   ;   CALL iom_put( "ttrd_dmp" , ptrdx )        ! internal restoring (damping) 
    341                                CALL iom_put( "strd_dmp" , ptrdy ) 
    342       CASE( jptra_bbl  )   ;   CALL iom_put( "ttrd_bbl" , ptrdx )        ! bottom boundary layer 
    343                                CALL iom_put( "strd_bbl" , ptrdy ) 
    344       CASE( jptra_npc  )   ;   CALL iom_put( "ttrd_npc" , ptrdx )        ! static instability mixing 
    345                                CALL iom_put( "strd_npc" , ptrdy ) 
    346       CASE( jptra_nsr  )   ;   CALL iom_put( "ttrd_qns" , ptrdx(:,:,1) )        ! surface forcing + runoff (ln_rnf=T) 
    347                                CALL iom_put( "strd_cdt" , ptrdy(:,:,1) )        ! output as 2D surface fields 
    348       CASE( jptra_qsr  )   ;   CALL iom_put( "ttrd_qsr" , ptrdx )        ! penetrative solar radiat. (only on temperature) 
    349       CASE( jptra_bbc  )   ;   CALL iom_put( "ttrd_bbc" , ptrdx )        ! geothermal heating   (only on temperature) 
    350       CASE( jptra_atf  )   ;   CALL iom_put( "ttrd_atf" , ptrdx )        ! asselin time Filter 
    351                                CALL iom_put( "strd_atf" , ptrdy ) 
    352       CASE( jptra_tot  )   ;   CALL iom_put( "ttrd_tot" , ptrdx )        ! model total trend 
    353                                CALL iom_put( "strd_tot" , ptrdy ) 
    354       END SELECT 
    355       ! 
     303     REAL(wp), DIMENSION(:,:,:), INTENT(inout) ::   ptrdx   ! Temperature or U trend  
     304     REAL(wp), DIMENSION(:,:,:), INTENT(inout) ::   ptrdy   ! Salinity    or V trend 
     305     INTEGER                   , INTENT(in   ) ::   ktrd    ! tracer trend index 
     306     INTEGER                   , INTENT(in   ) ::   kt      ! time step 
     307     !! 
     308     INTEGER ::   ji, jj, jk   ! dummy loop indices 
     309     INTEGER ::   ikbu, ikbv   ! local integers 
     310     REAL(wp), POINTER, DIMENSION(:,:)   ::   z2dx, z2dy   ! 2D workspace  
     311     !!---------------------------------------------------------------------- 
     312     ! 
     313     !!gm Rq: mask the trends already masked in trd_tra, but lbc_lnk should probably be added 
     314     ! 
     315     ! Trends evaluated every time step that could go to the standard T file and can be output every ts into a 1ts file if 1ts output is selected 
     316     SELECT CASE( ktrd ) 
     317     ! This total trend is done every time step 
     318     CASE( jptra_tot  )   ;   CALL iom_put( "ttrd_tot" , ptrdx )           ! model total trend 
     319        CALL iom_put( "strd_tot" , ptrdy ) 
     320     END SELECT 
     321 
     322     ! These trends are done every second time step. When 1ts output is selected must go different (2ts) file from standard T-file 
     323     IF( MOD( kt, 2 ) == 0 ) THEN 
     324        SELECT CASE( ktrd ) 
     325        CASE( jptra_xad  )   ;   CALL iom_put( "ttrd_xad" , ptrdx )        ! x- horizontal advection 
     326           CALL iom_put( "strd_xad" , ptrdy ) 
     327        CASE( jptra_yad  )   ;   CALL iom_put( "ttrd_yad" , ptrdx )        ! y- horizontal advection 
     328           CALL iom_put( "strd_yad" , ptrdy ) 
     329        CASE( jptra_zad  )   ;   CALL iom_put( "ttrd_zad" , ptrdx )        ! z- vertical   advection 
     330           CALL iom_put( "strd_zad" , ptrdy ) 
     331           IF( .NOT. lk_vvl ) THEN                   ! cst volume : adv flux through z=0 surface 
     332              CALL wrk_alloc( jpi, jpj, z2dx, z2dy ) 
     333              z2dx(:,:) = wn(:,:,1) * tsn(:,:,1,jp_tem) / fse3t(:,:,1) 
     334              z2dy(:,:) = wn(:,:,1) * tsn(:,:,1,jp_sal) / fse3t(:,:,1) 
     335              CALL iom_put( "ttrd_sad", z2dx ) 
     336              CALL iom_put( "strd_sad", z2dy ) 
     337              CALL wrk_dealloc( jpi, jpj, z2dx, z2dy ) 
     338           ENDIF 
     339        CASE( jptra_totad  ) ;   CALL iom_put( "ttrd_totad" , ptrdx )      ! total   advection 
     340           CALL iom_put( "strd_totad" , ptrdy ) 
     341        CASE( jptra_ldf  )   ;   CALL iom_put( "ttrd_ldf" , ptrdx )        ! lateral diffusion 
     342           CALL iom_put( "strd_ldf" , ptrdy ) 
     343        CASE( jptra_zdf  )   ;   CALL iom_put( "ttrd_zdf" , ptrdx )        ! vertical diffusion (including Kz contribution) 
     344           CALL iom_put( "strd_zdf" , ptrdy ) 
     345        CASE( jptra_zdfp )   ;   CALL iom_put( "ttrd_zdfp", ptrdx )        ! PURE vertical diffusion (no isoneutral contribution) 
     346           CALL iom_put( "strd_zdfp", ptrdy ) 
     347        CASE( jptra_evd )    ;   CALL iom_put( "ttrd_evd", ptrdx )         ! EVD trend (convection) 
     348           CALL iom_put( "strd_evd", ptrdy ) 
     349        CASE( jptra_dmp  )   ;   CALL iom_put( "ttrd_dmp" , ptrdx )        ! internal restoring (damping) 
     350           CALL iom_put( "strd_dmp" , ptrdy ) 
     351        CASE( jptra_bbl  )   ;   CALL iom_put( "ttrd_bbl" , ptrdx )        ! bottom boundary layer 
     352           CALL iom_put( "strd_bbl" , ptrdy ) 
     353        CASE( jptra_npc  )   ;   CALL iom_put( "ttrd_npc" , ptrdx )        ! static instability mixing 
     354           CALL iom_put( "strd_npc" , ptrdy ) 
     355        CASE( jptra_bbc  )   ;   CALL iom_put( "ttrd_bbc" , ptrdx )        ! geothermal heating   (only on temperature) 
     356        CASE( jptra_nsr  )   ;   CALL iom_put( "ttrd_qns" , ptrdx(:,:,1) ) ! surface forcing + runoff (ln_rnf=T) 
     357           CALL iom_put( "strd_cdt" , ptrdy(:,:,1) )        ! output as 2D surface fields 
     358        CASE( jptra_qsr  )   ;   CALL iom_put( "ttrd_qsr" , ptrdx )        ! penetrative solar radiat. (only on temperature) 
     359        END SELECT 
     360        ! the Asselin filter trend  is also every other time step but needs to be lagged one time step 
     361        ! Even when 1ts output is selected can go to the same (2ts) file as the trends plotted every even time step. 
     362     ELSE IF( MOD( kt, 2 ) == 1 ) THEN 
     363        SELECT CASE( ktrd ) 
     364        CASE( jptra_atf  )   ;   CALL iom_put( "ttrd_atf" , ptrdx )        ! asselin time Filter 
     365           CALL iom_put( "strd_atf" , ptrdy ) 
     366        END SELECT 
     367     END IF 
     368     ! 
    356369   END SUBROUTINE trd_tra_iom 
    357370 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfddm_substitute.h90

    r4152 r10115  
    55   !!      with a constant or 1D or 2D or 3D array, using CPP macro. 
    66   !!---------------------------------------------------------------------- 
    7 #if defined key_zdfddm 
     7#if defined key_zdfddm && ! defined key_offline 
    88!   'key_zdfddm' :                      avs: 3D array defined in zdfddm module 
    99#   define   fsavs(i,j,k)       avs(i,j,k) 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfric.F90

    r7256 r10115  
    178178      !  Compute Ekman depth from wind stress forcing. 
    179179      ! ------------------------------------------------------- 
    180       zflageos = ( 0.5 + SIGN( 0.5, nn_eos - 1. ) ) * rau0 
     180      !SF  zflageos = ( 0.5 + SIGN( 0.5, nn_eos - 1. ) ) * rau0 
     181      !SF  DO jj = 1, jpj 
     182      !SF     DO ji = 1, jpi 
     183      !SF        zrhos          = rhop(ji,jj,1) + zflageos * ( 1. - tmask(ji,jj,1) ) 
     184      !SF        zustar         = SQRT( taum(ji,jj) / ( zrhos +  rsmall ) ) 
     185      !SF        ekm_dep(ji,jj) = rn_ekmfc * zustar / ( ABS( ff(ji,jj) ) + rsmall ) 
     186      !SF        ekm_dep(ji,jj) = MAX(ekm_dep(ji,jj),rn_mldmin) ! Minimun allowed 
     187      !SF        ekm_dep(ji,jj) = MIN(ekm_dep(ji,jj),rn_mldmax) ! Maximum allowed 
     188      !SF     END DO 
     189      !SF  END DO 
     190 
    181191      DO jj = 1, jpj 
    182192         DO ji = 1, jpi 
    183             zrhos          = rhop(ji,jj,1) + zflageos * ( 1. - tmask(ji,jj,1) ) 
    184             zustar         = SQRT( taum(ji,jj) / ( zrhos +  rsmall ) ) 
     193            zustar         = SQRT( taum(ji,jj) * r1_rau0 ) 
    185194            ekm_dep(ji,jj) = rn_ekmfc * zustar / ( ABS( ff(ji,jj) ) + rsmall ) 
    186195            ekm_dep(ji,jj) = MAX(ekm_dep(ji,jj),rn_mldmin) ! Minimun allowed 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/OPA_SRC/ZDF/zdftke.F90

    r7806 r10115  
    865865              CALL tke_avn                               ! recompute avt, avm, avmu, avmv and dissl (approximation) 
    866866              ! 
    867               avt_k (:,:,:) = avt (:,:,:) 
    868               avm_k (:,:,:) = avm (:,:,:) 
    869               avmu_k(:,:,:) = avmu(:,:,:) 
    870               avmv_k(:,:,:) = avmv(:,:,:) 
    871               ! 
    872867              DO jit = nit000 + 1, nit000 + 10   ;   CALL zdf_tke( jit )   ;   END DO 
    873868           ENDIF 
    874869        ELSE                                   !* Start from rest 
    875870           en(:,:,:) = rn_emin * tmask(:,:,:) 
    876            DO jk = 1, jpk                           ! set the Kz to the background value 
    877               avt (:,:,jk) = avtb(jk) * wmask (:,:,jk) 
    878               avm (:,:,jk) = avmb(jk) * wmask (:,:,jk) 
    879               avmu(:,:,jk) = avmb(jk) * wumask(:,:,jk) 
    880               avmv(:,:,jk) = avmb(jk) * wvmask(:,:,jk) 
    881            END DO 
    882871        ENDIF 
    883         ! 
     872           !                                   ! Initialize av*_k 
     873           avt_k (:,:,:) = avt (:,:,:) 
     874           avm_k (:,:,:) = avm (:,:,:) 
     875           avmu_k(:,:,:) = avmu(:,:,:) 
     876           avmv_k(:,:,:) = avmv(:,:,:) 
     877           ! 
    884878     ELSEIF( TRIM(cdrw) == 'WRITE' ) THEN   ! Create restart file 
    885879        !                                   ! ------------------- 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/OPA_SRC/ZDF/zdftmx.F90

    r7256 r10115  
    235235 
    236236      !                             ! compute the form function using N2 at each time step 
     237      zdn2dz     (:,:,jpk) = 0.e0 
    237238      zempba_3d_1(:,:,jpk) = 0.e0 
    238239      zempba_3d_2(:,:,jpk) = 0.e0 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/OPA_SRC/nemogcm.F90

    r7806 r10115  
    199199      ! 
    200200#if defined key_agrif 
    201       IF( .NOT. Agrif_Root() ) THEN 
    202          CALL Agrif_ParentGrid_To_ChildGrid() 
    203          IF( lk_diaobs ) CALL dia_obs_wri 
    204          IF( nn_timing == 1 )   CALL timing_finalize 
    205          CALL Agrif_ChildGrid_To_ParentGrid() 
    206       ENDIF 
     201      CALL Agrif_ParentGrid_To_ChildGrid() 
     202      IF( lk_diaobs ) CALL dia_obs_wri 
     203      IF( nn_timing == 1 )   CALL timing_finalize 
     204      CALL Agrif_ChildGrid_To_ParentGrid() 
    207205#endif 
    208206      IF( nn_timing == 1 )   CALL timing_finalize 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/OPA_SRC/stpctl.F90

    r7806 r10115  
    2121   USE lbclnk          ! ocean lateral boundary conditions (or mpp link) 
    2222   USE lib_mpp         ! distributed memory computing 
     23   USE lib_fortran     ! Fortran routines library  
    2324   USE dynspg_oce      ! pressure gradient schemes  
    2425   USE c1d             ! 1D vertical configuration 
     
    5758      INTEGER  ::   ji, jj, jk              ! dummy loop indices 
    5859      INTEGER  ::   ii, ij, ik              ! temporary integers 
    59       REAL(wp) ::   zumax, zsmin, zssh2     ! temporary scalars 
     60      REAL(wp) ::   zumax, zsmin, zssh2, zsshmax     ! temporary scalars 
    6061      INTEGER, DIMENSION(3) ::   ilocu      !  
    6162      INTEGER, DIMENSION(2) ::   ilocs      !  
     
    173174         ENDIF 
    174175         ! 
    175          zssh2 = SUM( sshn(:,:) * sshn(:,:) * tmask_i(:,:) ) 
    176          IF( lk_mpp )   CALL mpp_sum( zssh2 )      ! sum over the global domain 
     176         zsshmax = 0.e0 
     177         DO jj = 1, jpj 
     178            DO ji = 1, jpi 
     179               IF( tmask(ji,jj,1) == 1) zsshmax = MAX( zsshmax, ABS(sshn(ji,jj)) ) 
     180            END DO 
     181         END DO 
     182         IF( lk_mpp )   CALL mpp_max( zsshmax )                ! min over the global domain 
     183         ! 
     184         IF( MOD( kt, nwrite ) == 1 .AND. lwp )   WRITE(numout,*) ' ==>> time-step= ',kt,' ssh max:', zsshmax 
     185           ! 
     186           IF( zsshmax > 10.e0 ) THEN  
     187              IF (lk_mpp) THEN 
     188                CALL mpp_maxloc( ABS(sshn(:,:)),tmask(:,:,1),zsshmax,ii,ij) 
     189              ELSE 
     190                ilocs = MAXLOC( ABS(sshn(:,:)) ) 
     191                ii = ilocs(1) + nimpp - 1 
     192                ij = ilocs(2) + njmpp - 1 
     193              ENDIF 
     194              ! 
     195              IF(lwp) THEN 
     196                 WRITE(numout,cform_err) 
     197                 WRITE(numout,*) 'stp_ctl : the ssh is larger than 10m' 
     198                 WRITE(numout,*) '======= ' 
     199                 WRITE(numout,9600) kt, zsshmax, ii, ij 
     200                 WRITE(numout,*) 
     201                 WRITE(numout,*) '          output of last fields in numwso' 
     202              ENDIF 
     203             kindic = -3 
     204         ENDIF 
     2059600     FORMAT (' kt=',i6,' max ssh: ',1pg11.4,', i j: ',2i5) 
     206 
     207         zssh2 = glob_sum( sshn(:,:) * sshn(:,:) ) 
    177208         ! 
    178209         IF(lwp) WRITE(numsol,9300) kt, zssh2, zumax, zsmin      ! ssh statistics 
    179210         ! 
    180211      ENDIF 
    181  
    1822129200  FORMAT('it:', i8, ' iter:', i4, ' r: ',d23.16, ' b: ',d23.16 ) 
    1832139300  FORMAT(' it :', i8, ' ssh2: ', d23.16, ' Umax: ',d23.16,' Smin: ',d23.16) 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/OPA_SRC/trc_oce.F90

    r8894 r10115  
    2828#endif 
    2929 
    30    INTEGER , PUBLIC                                      ::   nn_dttrc      !: frequency of step on passive tracers 
     30   INTEGER , PUBLIC                                      ::   nn_dttrc = 1  !: frequency of step on passive tracers 
    3131   REAL(wp), PUBLIC                                      ::   r_si2         !: largest depth of extinction (blue & 0.01 mg.m-3)  (RGB) 
    3232   REAL(wp), PUBLIC, SAVE, ALLOCATABLE, DIMENSION(:,:,:) ::   etot3         !: light absortion coefficient 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/SAS_SRC/daymod.F90

    r7256 r10115  
    22   !!====================================================================== 
    33   !!                       ***  MODULE  daymod  *** 
    4    !! Ocean        :  calendar  
     4   !! Ocean        :  calendar 
    55   !!===================================================================== 
    66   !! History :  OPA  ! 1994-09  (M. Pontaud M. Imbard)  Original code 
    77   !!                 ! 1997-03  (O. Marti) 
    8    !!                 ! 1997-05  (G. Madec)  
     8   !!                 ! 1997-05  (G. Madec) 
    99   !!                 ! 1997-08  (M. Imbard) 
    1010   !!   NEMO     1.0  ! 2003-09  (G. Madec)  F90 + nyear, nmonth, nday 
    1111   !!                 ! 2004-01  (A.M. Treguier) new calculation based on adatrj 
    1212   !!                 ! 2006-08  (G. Madec)  surface module major update 
    13    !!----------------------------------------------------------------------       
     13   !!---------------------------------------------------------------------- 
    1414 
    1515   !!---------------------------------------------------------------------- 
    1616   !!   day        : calendar 
    17    !!   
     17   !! 
    1818   !!           ------------------------------- 
    1919   !!           ----------- WARNING ----------- 
     
    2424   !!           ----------- WARNING ----------- 
    2525   !!           ------------------------------- 
    26    !!   
     26   !! 
    2727   !!---------------------------------------------------------------------- 
    2828   USE dom_oce         ! ocean space and time domain 
    2929   USE phycst          ! physical constants 
    3030   USE in_out_manager  ! I/O manager 
    31    USE iom             !  
     31   USE iom             ! 
    3232   USE ioipsl, ONLY :   ymds2ju   ! for calendar 
    3333   USE prtctl          ! Print control 
    34    USE restart         !  
     34   USE trc_oce, ONLY : lk_offline ! offline flag 
    3535   USE timing          ! Timing 
     36   USE restart         ! restart 
    3637 
    3738   IMPLICIT NONE 
     
    4041   PUBLIC   day        ! called by step.F90 
    4142   PUBLIC   day_init   ! called by istate.F90 
    42  
    43    INTEGER ::   nsecd, nsecd05, ndt, ndt05 
     43   PUBLIC   day_mth    ! Needed by TAM 
     44 
     45   INTEGER, PUBLIC ::   nsecd, nsecd05, ndt, ndt05 ! (PUBLIC for TAM) 
    4446 
    4547   !!---------------------------------------------------------------------- 
     
    5355      !!---------------------------------------------------------------------- 
    5456      !!                   ***  ROUTINE day_init  *** 
    55       !!  
    56       !! ** Purpose :   Initialization of the calendar values to their values 1 time step before nit000  
     57      !! 
     58      !! ** Purpose :   Initialization of the calendar values to their values 1 time step before nit000 
    5759      !!                because day will be called at the beginning of step 
    5860      !! 
     
    8587      ndt05   = NINT(0.5 * rdttra(1)) 
    8688 
    87       ! ==> clem: here we read the ocean restart for the date (only if it exists) 
    88       !           It is not clean and another solution should be found 
    89       CALL day_rst( nit000, 'READ' ) 
    90       ! ==> 
    91  
    92       ! set the calendar from ndastp (read in restart file and namelist) 
     89      IF( .NOT. lk_offline ) CALL day_rst( nit000, 'READ' ) 
     90 
     91      ! set the calandar from ndastp (read in restart file and namelist) 
    9392 
    9493      nyear   =   ndastp / 10000 
    9594      nmonth  = ( ndastp - (nyear * 10000) ) / 100 
    96       nday    =   ndastp - (nyear * 10000) - ( nmonth * 100 )  
     95      nday    =   ndastp - (nyear * 10000) - ( nmonth * 100 ) 
    9796 
    9897      CALL ymds2ju( nyear, nmonth, nday, 0.0, fjulday )  ! we assume that we start run at 00:00 
     
    102101      nsec1jan000 = 0 
    103102      CALL day_mth 
    104        
     103 
    105104      IF ( nday == 0 ) THEN     !   for ex if ndastp = ndate0 - 1 
    106          nmonth = nmonth - 1   
     105         nmonth = nmonth - 1 
    107106         nday = nmonth_len(nmonth) 
    108107      ENDIF 
     
    113112         IF( nleapy == 1 )   CALL day_mth 
    114113      ENDIF 
    115        
     114 
    116115      ! day since january 1st 
    117116      nday_year = nday + SUM( nmonth_len(1:nmonth - 1) ) 
    118117 
    119       !compute number of days between last monday and today       
     118      !compute number of days between last monday and today 
    120119      CALL ymds2ju( 1900, 01, 01, 0.0, zjul )  ! compute julian day value of 01.01.1900 (our reference that was a Monday) 
    121       inbday = NINT(fjulday - zjul)            ! compute nb day between  01.01.1900 and current day   
    122       idweek = MOD(inbday, 7)                  ! compute nb day between last monday and current day   
     120      inbday = NINT(fjulday - zjul)            ! compute nb day between  01.01.1900 and current day 
     121      idweek = MOD(inbday, 7)                  ! compute nb day between last monday and current day 
    123122 
    124123      ! number of seconds since the beginning of current year/month/week/day at the middle of the time-step 
     
    142141      !!---------------------------------------------------------------------- 
    143142      !!                   ***  ROUTINE day_init  *** 
    144       !!  
     143      !! 
    145144      !! ** Purpose :   calendar values related to the months 
    146145      !! 
     
    154153 
    155154      ! length of the month of the current year (from nleapy, read in namelist) 
    156       IF ( nleapy < 2 ) THEN  
     155      IF ( nleapy < 2 ) THEN 
    157156         nmonth_len(:) = (/ 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31 /) 
    158157         nyear_len(:) = 365 
     
    177176      ! time since Jan 1st   0     1     2    ...    11    12    13 
    178177      !          ---------*--|--*--|--*--| ... |--*--|--*--|--*--|-------------------------------------- 
    179       !                 <---> <---> <--->  ...  <---> <---> <--->         
     178      !                 <---> <---> <--->  ...  <---> <---> <---> 
    180179      ! month number      0     1     2    ...    11    12    13 
    181180      ! 
     
    190189         nmonth_end(jm) = nmonth_end(jm-1) + nsecd * nmonth_len(jm) 
    191190      END DO 
    192       !            
    193    END SUBROUTINE  
     191      ! 
     192   END SUBROUTINE 
    194193 
    195194 
     
    197196      !!---------------------------------------------------------------------- 
    198197      !!                      ***  ROUTINE day  *** 
    199       !!  
     198      !! 
    200199      !! ** Purpose :   Compute the date with a day iteration IF necessary. 
    201200      !! 
     
    209208      !!              - adatrj    : date in days since the beginning of the run 
    210209      !!              - nsec_year : current time of the year (in second since 00h, jan 1st) 
    211       !!----------------------------------------------------------------------       
     210      !!---------------------------------------------------------------------- 
    212211      INTEGER, INTENT(in) ::   kt        ! ocean time-step indices 
    213212      ! 
     
    220219      zprec = 0.1 / rday 
    221220      !                                                 ! New time-step 
    222       nsec_year  = nsec_year  + ndt  
    223       nsec_month = nsec_month + ndt                  
     221      nsec_year  = nsec_year  + ndt 
     222      nsec_month = nsec_month + ndt 
    224223      nsec_week  = nsec_week  + ndt 
    225       nsec_day   = nsec_day   + ndt                 
     224      nsec_day   = nsec_day   + ndt 
    226225      adatrj  = adatrj  + rdttra(1) / rday 
    227226      fjulday = fjulday + rdttra(1) / rday 
    228227      IF( ABS(fjulday - REAL(NINT(fjulday),wp)) < zprec )   fjulday = REAL(NINT(fjulday),wp)   ! avoid truncation error 
    229228      IF( ABS(adatrj  - REAL(NINT(adatrj ),wp)) < zprec )   adatrj  = REAL(NINT(adatrj ),wp)   ! avoid truncation error 
    230        
     229 
    231230      IF( nsec_day > nsecd ) THEN                       ! New day 
    232231         ! 
     
    261260 
    262261      IF( nsec_week > 7*nsecd )   nsec_week = ndt05     ! New week 
    263        
     262 
    264263      IF(ln_ctl) THEN 
    265264         WRITE(charout,FMT="('kt =', I4,'  d/m/y =',I2,I2,I4)") kt, nday, nmonth, nyear 
     
    267266      ENDIF 
    268267 
    269       ! since we no longer call rst_opn, need to define nitrst here, used by ice restart routine 
    270       IF( kt == nit000 ) nitrst = nitend 
    271       IF( MOD( kt - 1, nstock ) == 0 ) THEN 
    272          ! we use kt - 1 and not kt - nit000 to keep the same periodicity from the beginning of the experiment 
    273          nitrst = kt + nstock - 1                  ! define the next value of nitrst for restart writing 
    274          IF( nitrst > nitend )   nitrst = nitend   ! make sure we write a restart at the end of the run 
    275       ENDIF 
    276  
     268      IF( .NOT. lk_offline ) CALL rst_opn( kt )               ! Open the restart file if needed and control lrst_oce 
     269      IF( lrst_oce         ) CALL day_rst( kt, 'WRITE' )      ! write day restart information 
     270      ! 
    277271      IF( nn_timing == 1 )  CALL timing_stop('day') 
    278272      ! 
     
    372366      ! 
    373367   END SUBROUTINE day_rst 
     368 
    374369   !!====================================================================== 
    375370END MODULE daymod 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/SAS_SRC/nemogcm.F90

    r7806 r10115  
    6464#endif 
    6565   USE bdy_par 
    66  
     66   USE restart 
     67 
     68    
    6769   IMPLICIT NONE 
    6870   PRIVATE 
     
    357359      IF( ln_ctl        )   CALL prt_ctl_init   ! Print control 
    358360                            CALL day_init   ! model calendar (using both namelist and restart infos) 
     361      IF( ln_rstart )       CALL rst_read_open 
    359362 
    360363                            CALL sbc_init   ! Forcings : surface module  
     
    363366      !           the environment of ocean BDY. Therefore bdy is called in both OPA and SAS modules.  
    364367      !           This is not clean and should be changed in the future.  
     368#if defined key_bdy 
    365369      IF( lk_bdy        )   CALL     bdy_init 
    366370      IF( lk_bdy        )   CALL bdy_dta_init 
    367371      ! ==> 
     372#endif 
    368373       
    369374      IF(lwp) WRITE(numout,*) 'Euler time step switch is ', neuler 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/AGE/par_age.F90

    r7491 r10115  
    2525   USE par_c14b   , ONLY : jp_c14b_trd     !: number of tracers in C14 
    2626 
     27   USE par_my_trc , ONLY : jp_my_trc       !: number of tracers in MY_TRC 
     28   USE par_my_trc , ONLY : jp_my_trc_2d    !: number of 2D diag in MY_TRC 
     29   USE par_my_trc , ONLY : jp_my_trc_3d    !: number of 3D diag in MY_TRC 
     30   USE par_my_trc , ONLY : jp_my_trc_trd   !: number of biological diag in MY_TRC 
     31 
    2732   IMPLICIT NONE 
    2833 
    29    INTEGER, PARAMETER ::   jp_lm      =  jp_pisces     + jp_cfc     + jp_c14b     !:  
    30    INTEGER, PARAMETER ::   jp_lm_2d   =  jp_pisces_2d  + jp_cfc_2d  + jp_c14b_2d  !: 
    31    INTEGER, PARAMETER ::   jp_lm_3d   =  jp_pisces_3d  + jp_cfc_3d  + jp_c14b_3d  !: 
    32    INTEGER, PARAMETER ::   jp_lm_trd  =  jp_pisces_trd + jp_cfc_trd + jp_c14b_trd !: 
     34   INTEGER, PARAMETER ::   jp_lm      =  jp_pisces     + jp_my_trc     + jp_cfc     + jp_c14b     !:  
     35   INTEGER, PARAMETER ::   jp_lm_2d   =  jp_pisces_2d  + jp_my_trc_2d  + jp_cfc_2d  + jp_c14b_2d  !: 
     36   INTEGER, PARAMETER ::   jp_lm_3d   =  jp_pisces_3d  + jp_my_trc_3d  + jp_cfc_3d  + jp_c14b_3d  !: 
     37   INTEGER, PARAMETER ::   jp_lm_trd  =  jp_pisces_trd + jp_my_trc_trd + jp_cfc_trd + jp_c14b_trd !: 
    3338 
    3439#if defined key_age 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/AGE/trcnam_age.F90

    r7491 r10115  
    1414   USE oce_trc         ! Ocean variables 
    1515   USE trcsms_age      ! AGE specific variable 
     16   USE trc 
    1617 
    1718   IMPLICIT NONE 
     
    4445      NAMELIST/namage/ rn_age_depth, rn_age_kill_rate  
    4546      !!---------------------------------------------------------------------- 
     47      ! Variable setting 
     48      ctrcnm    (jp_age0) = 'Age' 
     49      ctrcln    (jp_age0) = 'Sea water age since surface contact' 
     50      ctrcun    (jp_age0) = 'year' 
     51      ln_trc_ini(jp_age0) = .false. 
    4652      !                             ! Open namelist files 
    4753      CALL ctl_opn( numnatg_ref, 'namelist_age_ref'   ,     'OLD', 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE. ) 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/AGE/trcwri_age.F90

    r7491 r10115  
    3333      INTEGER              :: jn 
    3434      !!--------------------------------------------------------------------- 
    35  
     35      IF( ln_crs_top ) CALL iom_swap( "nemo_crs" ) 
    3636  
    3737      ! write the tracer concentrations in the file 
     
    3939      DO jn = jp_age0, jp_age1 
    4040         cltra = TRIM( ctrcnm(jn) )                  ! short title for tracer 
     41         IF(lwp)WRITE(numout,*)"WRITE ",TRIM(cltra) 
    4142         CALL iom_put( TRIM(cltra), trn(:,:,:,jn) ) 
    4243      END DO 
    4344      ! 
     45      IF( ln_crs_top ) CALL iom_swap( "nemo" ) 
    4446      ! 
    4547   END SUBROUTINE trc_wri_age 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/C14b/par_c14b.F90

    r3680 r10115  
    1111   USE par_pisces , ONLY : jp_pisces_trd   !: number of biological diag in PISCES 
    1212 
     13   USE par_my_trc , ONLY : jp_my_trc       !: number of tracers in MY_TRC 
     14   USE par_my_trc , ONLY : jp_my_trc_2d    !: number of 2D diag in MY_TRC 
     15   USE par_my_trc , ONLY : jp_my_trc_3d    !: number of 3D diag in MY_TRC 
     16   USE par_my_trc , ONLY : jp_my_trc_trd   !: number of biological diag in MY_TRC 
     17 
    1318   USE par_cfc    , ONLY : jp_cfc          !: number of tracers in CFC 
    1419   USE par_cfc    , ONLY : jp_cfc_2d       !: number of 2D diag in CFC 
     
    1924   IMPLICIT NONE 
    2025 
    21    INTEGER, PARAMETER ::   jp_lb      =  jp_pisces     + jp_cfc     !: cum. number of pass. tracers 
    22    INTEGER, PARAMETER ::   jp_lb_2d   =  jp_pisces_2d  + jp_cfc_2d  !: 
    23    INTEGER, PARAMETER ::   jp_lb_3d   =  jp_pisces_3d  + jp_cfc_3d  !: 
    24    INTEGER, PARAMETER ::   jp_lb_trd  =  jp_pisces_trd + jp_cfc_trd !: 
     26   INTEGER, PARAMETER ::   jp_lb      =  jp_pisces     + jp_my_trc     + jp_cfc     !: cum. number of pass. tracers 
     27   INTEGER, PARAMETER ::   jp_lb_2d   =  jp_pisces_2d  + jp_my_trc_2d  + jp_cfc_2d  !: 
     28   INTEGER, PARAMETER ::   jp_lb_3d   =  jp_pisces_3d  + jp_my_trc_3d  + jp_cfc_3d  !: 
     29   INTEGER, PARAMETER ::   jp_lb_trd  =  jp_pisces_trd + jp_my_trc_trd + jp_cfc_trd !: 
    2530    
    2631#if defined key_c14b 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/C14b/trcnam_c14b.F90

    r4624 r10115  
    5555      NAMELIST/namc14dia/  c14dia2d, c14dia3d     ! additional diagnostics 
    5656      !!------------------------------------------------------------------- 
     57      ctrcnm    (jp_c14b0) = 'C14B' 
     58      ctrcln    (jp_c14b0) = 'Bomb C14 Concentration' 
     59      ctrcun    (jp_c14b0) = 'ration' 
     60      ln_trc_ini(jp_c14b0) = .false. 
     61      ln_trc_wri(jp_c14b0) = .true. 
    5762      !                             ! Open namelist file 
    5863      CALL ctl_opn( numnatb_ref, 'namelist_c14b_ref'  ,     'OLD', 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE. ) 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/C14b/trcsms_c14b.F90

    r5602 r10115  
    291291      !     
    292292      IF( lk_iomput ) THEN 
    293         CALL iom_put( "qtrC14b"  , qtr_c14  ) 
    294         CALL iom_put( "qintC14b" , qint_c14 ) 
     293        CALL iom_put( "qtr_C14b"  , qtr_c14  ) 
     294        CALL iom_put( "qint_C14b" , qint_c14 ) 
    295295        CALL iom_put( "fdecay"   , zdecay   ) 
    296296      ELSE 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/CFC/par_cfc.F90

    r3680 r10115  
    1414   USE par_pisces , ONLY : jp_pisces_3d    !: number of 3D diag in PISCES 
    1515   USE par_pisces , ONLY : jp_pisces_trd   !: number of biological diag in PISCES 
     16    
     17   USE par_my_trc , ONLY : jp_my_trc       !: number of tracers in MY_TRC 
     18   USE par_my_trc , ONLY : jp_my_trc_2d    !: number of 2D diag in MY_TRC 
     19   USE par_my_trc , ONLY : jp_my_trc_3d    !: number of 3D diag in MY_TRC 
     20   USE par_my_trc , ONLY : jp_my_trc_trd   !: number of biological diag in MY_TRC 
    1621 
    1722   IMPLICIT NONE 
    1823 
    19    INTEGER, PARAMETER ::   jp_lc      =  jp_pisces     !: cumulative number of passive tracers 
    20    INTEGER, PARAMETER ::   jp_lc_2d   =  jp_pisces_2d  !: 
    21    INTEGER, PARAMETER ::   jp_lc_3d   =  jp_pisces_3d  !: 
    22    INTEGER, PARAMETER ::   jp_lc_trd  =  jp_pisces_trd !: 
     24   INTEGER, PARAMETER ::   jp_lc      =  jp_pisces     + jp_my_trc     !: cumulative number of passive tracers 
     25   INTEGER, PARAMETER ::   jp_lc_2d   =  jp_pisces_2d  + jp_my_trc_2d  !: 
     26   INTEGER, PARAMETER ::   jp_lc_3d   =  jp_pisces_3d  + jp_my_trc_3d  !: 
     27   INTEGER, PARAMETER ::   jp_lc_trd  =  jp_pisces_trd + jp_my_trc_trd !: 
    2328    
    2429#if defined key_cfc 
     
    2732   !!--------------------------------------------------------------------- 
    2833   LOGICAL, PUBLIC, PARAMETER ::   lk_cfc     = .TRUE.      !: CFC flag  
    29    INTEGER, PUBLIC, PARAMETER ::   jp_cfc     =  1          !: number of passive tracers 
    30    INTEGER, PUBLIC, PARAMETER ::   jp_cfc_2d  =  2         !: additional 2d output arrays ('key_trc_diaadd') 
     34   INTEGER, PUBLIC, PARAMETER ::   jp_cfc     =  2          !: number of passive tracers 
     35   INTEGER, PUBLIC, PARAMETER ::   jp_cfc_2d  =  2 * jp_cfc !: additional 2d output arrays ('key_trc_diaadd') 
    3136   INTEGER, PUBLIC, PARAMETER ::   jp_cfc_3d  =  0          !: additional 3d output arrays ('key_trc_diaadd') 
    3237   INTEGER, PUBLIC, PARAMETER ::   jp_cfc_trd =  0          !: number of sms trends for CFC 
    33     
    34    ! assign an index in trc arrays for each CFC prognostic variables 
    35    INTEGER, PUBLIC, PARAMETER ::   jpc11       = jp_lc + 1   !: CFC-11  
    36    INTEGER, PUBLIC, PARAMETER ::   jpc12       = jp_lc + 2   !: CFC-12    
     38   ! Enable trace gases according to total number jp_cfc 
     39   LOGICAL, PUBLIC, PARAMETER ::   lp_cfc11   = .false.     !: use CFC11 
     40   LOGICAL, PUBLIC, PARAMETER ::   lp_cfc12   = .true.      !: use CFC12 
     41   LOGICAL, PUBLIC, PARAMETER ::   lp_sf6     = .true.      !: use SF6 
    3742#else 
    3843   !!--------------------------------------------------------------------- 
     
    4449   INTEGER, PUBLIC, PARAMETER ::   jp_cfc_3d  =  0          !: No CFC additional 3d output arrays  
    4550   INTEGER, PUBLIC, PARAMETER ::   jp_cfc_trd =  0          !: number of sms trends for CFC 
     51   LOGICAL, PUBLIC, PARAMETER ::   lp_cfc11   = .false.     !: use CFC11 
     52   LOGICAL, PUBLIC, PARAMETER ::   lp_cfc12   = .false.     !: use CFC12 
     53   LOGICAL, PUBLIC, PARAMETER ::   lp_sf6     = .false.     !: use SF6 
    4654#endif 
    4755 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/CFC/trcini_cfc.F90

    r3294 r10115  
    2222   PUBLIC   trc_ini_cfc   ! called by trcini.F90 module 
    2323 
    24    CHARACTER (len=34) ::   clname = 'cfc1112.atm'   ! ??? 
    25  
    2624   INTEGER  ::   inum                   ! unit number 
    2725   REAL(wp) ::   ylats = -10.           ! 10 degrees south 
     
    4644      INTEGER  ::  iskip = 6   ! number of 1st descriptor lines 
    4745      REAL(wp) ::  zyy, zyd 
     46      CHARACTER(len = 20)  ::  cltra 
    4847      !!---------------------------------------------------------------------- 
    4948 
     
    5150      IF(lwp) WRITE(numout,*) ' trc_ini_cfc: initialisation of CFC chemical model' 
    5251      IF(lwp) WRITE(numout,*) ' ~~~~~~~~~~~' 
    53  
    54  
    55       IF(lwp) WRITE(numout,*) 'read of formatted file cfc1112atm' 
     52      ! 
     53      IF(lwp) WRITE(numout,*) 'Read annual atmospheric concentrations from formatted file : ' // TRIM(clnamecfc) 
    5654       
    57       CALL ctl_opn( inum, clname, 'OLD', 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE. ) 
     55      CALL ctl_opn( inum, clnamecfc, 'OLD', 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE. ) 
    5856      REWIND(inum) 
    5957       
     
    6664      END DO 
    6765 100  jpyear = jn - 1 - iskip 
    68       IF ( lwp) WRITE(numout,*) '    ', jpyear ,' years read' 
     66      IF ( lwp) WRITE(numout,*) '   ---> ', jpyear ,' years read' 
    6967      !                                ! Allocate CFC arrays 
    7068 
    71       ALLOCATE( p_cfc(jpyear,jphem,2), STAT=ierr ) 
     69      ALLOCATE( p_cfc(jpyear,jphem,3), STAT=ierr ) 
    7270      IF( ierr > 0 ) THEN 
    7371         CALL ctl_stop( 'trc_ini_cfc: unable to allocate p_cfc array' )   ;   RETURN 
     
    8785         IF(lwp) THEN 
    8886            WRITE(numout,*) 
    89             WRITE(numout,*) 'Initialization de qint ; No restart : qint equal zero ' 
     87            WRITE(numout,*) 'Initialisation of qint ; No restart : qint equal zero ' 
    9088         ENDIF 
    9189         qint_cfc(:,:,:) = 0._wp 
     
    105103      jn = 31 
    106104      DO  
    107         READ(inum,*, IOSTAT=io) zyy, p_cfc(jn,1,1), p_cfc(jn,1,2), p_cfc(jn,2,1), p_cfc(jn,2,2) 
     105        READ(inum,*, IOSTAT=io) zyy, p_cfc(jn,1:2,1), p_cfc(jn,1:2,2), p_cfc(jn,1:2,3) 
    108106        IF( io < 0 ) exit 
    109107        jn = jn + 1 
    110108      END DO 
    111109 
    112       p_cfc(32,1:2,1) = 5.e-4      ! modify the values of the first years 
    113       p_cfc(33,1:2,1) = 8.e-4 
    114       p_cfc(34,1:2,1) = 1.e-6 
    115       p_cfc(35,1:2,1) = 2.e-3 
    116       p_cfc(36,1:2,1) = 4.e-3 
    117       p_cfc(37,1:2,1) = 6.e-3 
    118       p_cfc(38,1:2,1) = 8.e-3 
    119       p_cfc(39,1:2,1) = 1.e-2 
    120        
    121110      IF(lwp) THEN        ! Control print 
    122111         WRITE(numout,*) 
    123          WRITE(numout,*) ' Year   p11HN    p11HS    p12HN    p12HS ' 
     112         WRITE(numout,*) ' Year   c11NH     c11SH     c12NH     c12SH     SF6NH     SF6SH' 
    124113         DO jn = 30, jpyear 
    125             WRITE(numout, '( 1I4, 4F9.2)') jn, p_cfc(jn,1,1), p_cfc(jn,2,1), p_cfc(jn,1,2), p_cfc(jn,2,2) 
     114            WRITE(numout, '( 1I4, 6F10.4)') jn, p_cfc(jn,1:2,1), p_cfc(jn,1:2,2), p_cfc(jn,1:2,3) 
    126115         END DO 
    127116      ENDIF 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/CFC/trcnam_cfc.F90

    r4624 r10115  
    4646      INTEGER ::  numonc      = -1   ! Logical unit for output namelist 
    4747      INTEGER :: ios                 ! Local integer output status for namelist read 
    48       INTEGER :: jl, jn 
     48      INTEGER :: jl, jn, cnt 
    4949      TYPE(DIAG), DIMENSION(jp_cfc_2d) :: cfcdia2d 
    5050      !! 
    51       NAMELIST/namcfcdate/ ndate_beg, nyear_res 
     51      NAMELIST/namcfcdate/ ndate_beg, nyear_res, clnamecfc 
    5252      NAMELIST/namcfcdia/  cfcdia2d     ! additional diagnostics 
    5353      !!---------------------------------------------------------------------- 
     
    6666      IF(lwm) WRITE ( numonc, namcfcdate ) 
    6767 
     68      jn = jp_cfc0 - 1 
     69      ! Variables setting 
     70      IF( lp_cfc11 ) THEN 
     71         jn = jn + 1 
     72         ctrcnm    (jn) = 'CFC11' 
     73         ctrcln    (jn) = 'Chlorofluoro carbon 11 Concentration' 
     74         ctrcun    (jn) = 'umolC/L' 
     75         ln_trc_ini(jn) = .false. 
     76         ln_trc_wri(jn) = .true. 
     77      ENDIF 
     78      ! 
     79      IF( lp_cfc12 ) THEN 
     80         jn = jn + 1 
     81         ctrcnm    (jn) = 'CFC12' 
     82         ctrcln    (jn) = 'Chlorofluoro carbon 12 Concentration' 
     83         ctrcun    (jn) = 'umolC/L' 
     84         ln_trc_ini(jn) = .false. 
     85         ln_trc_wri(jn) = .true. 
     86      ENDIF 
     87      ! 
     88      IF( lp_sf6 ) THEN 
     89         jn = jn + 1 
     90         ctrcnm    (jn) = 'SF6' 
     91         ctrcln    (jn) = 'Sulfur hexafluoride Concentration' 
     92         ctrcun    (jn) = 'umol/L' 
     93         ln_trc_ini(jn) = .false. 
     94         ln_trc_wri(jn) = .true. 
     95      ENDIF 
     96 
    6897      IF(lwp) THEN                  ! control print 
    69          WRITE(numout,*) 
     98         WRITE(numout,*) ' ' 
     99         WRITE(numout,*) ' CFCs' 
     100         WRITE(numout,*) ' ' 
    70101         WRITE(numout,*) ' trc_nam: Read namdates, namelist for CFC chemical model' 
    71102         WRITE(numout,*) ' ~~~~~~~' 
    72103         WRITE(numout,*) '    initial calendar date (aammjj) for CFC  ndate_beg = ', ndate_beg 
    73104         WRITE(numout,*) '    restoring time constant (year)          nyear_res = ', nyear_res 
     105         WRITE(numout,*) '    Atmospheric CFC concentrations file     clnamecfc = ', TRIM(clnamecfc) 
     106         WRITE(numout,*) '    Compute dynamics for CFC-11             lp_cfc11  = ', lp_cfc11 
     107         WRITE(numout,*) '    Compute dynamics for CFC-12             lp_cfc12  = ', lp_cfc12 
     108         WRITE(numout,*) '    Compute dynamics for SF6                lp_sf6    = ', lp_sf6 
    74109      ENDIF 
    75110      nyear_beg = ndate_beg / 10000 
    76111      IF(lwp) WRITE(numout,*) '    initial year (aa)                       nyear_beg = ', nyear_beg 
     112      ! 
     113      ! check consistency between CFC namelist and par_cfc setting 
     114      if ( jn - jp_cfc0 + 1 .ne. jp_cfc )  & 
     115      CALL ctl_stop( 'trc_nam_cfc: Number of selected CFCs is different from total CFC number (jp_cfc) specified in par_cfc.F90' ) 
    77116      ! 
    78117 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/CFC/trcsms_cfc.F90

    r4996 r10115  
    2929 
    3030   INTEGER , PUBLIC, PARAMETER ::   jphem  =   2   ! parameter for the 2 hemispheres 
    31    INTEGER , PUBLIC            ::   jpyear         ! Number of years read in CFC1112 file 
     31   INTEGER , PUBLIC            ::   jpyear         ! Number of years read in input data file (in trcini_cfc) 
    3232   INTEGER , PUBLIC            ::   ndate_beg      ! initial calendar date (aammjj) for CFC 
    3333   INTEGER , PUBLIC            ::   nyear_res      ! restoring time constant (year) 
    3434   INTEGER , PUBLIC            ::   nyear_beg      ! initial year (aa)  
     35   CHARACTER(len=200), PUBLIC  ::   clnamecfc      ! Input filename of CFCs atm. concentrations 
    3536    
    3637   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   p_cfc    ! partial hemispheric pressure for CFC 
     
    3839   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   qtr_cfc  ! flux at surface 
    3940   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   qint_cfc ! cumulative flux  
     41   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   atm_cfc  ! partial hemispheric pressure for used CFC 
    4042   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   patm     ! atmospheric function 
    4143 
    42    REAL(wp), DIMENSION(4,2) ::   soa   ! coefficient for solubility of CFC [mol/l/atm] 
    43    REAL(wp), DIMENSION(3,2) ::   sob   !    "               " 
    44    REAL(wp), DIMENSION(4,2) ::   sca   ! coefficients for schmidt number in degre Celcius 
    45        
     44   REAL(wp),         ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   soa      ! coefficient for solubility of CFC [mol/l/atm] 
     45   REAL(wp),         ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   sob      !    "               " 
     46   REAL(wp),         ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   sca      ! coefficients for schmidt number in degrees Celsius 
    4647   !                          ! coefficients for conversion 
    4748   REAL(wp) ::   xconv1 = 1.0          ! conversion from to  
     
    8283      INTEGER  ::   im1, im2, ierr 
    8384      REAL(wp) ::   ztap, zdtap         
    84       REAL(wp) ::   zt1, zt2, zt3, zv2 
     85      REAL(wp) ::   zt1, zt2, zt3, zt4, zv2 
    8586      REAL(wp) ::   zsol      ! solubility 
    8687      REAL(wp) ::   zsch      ! schmidt number  
     
    9394      ! 
    9495      IF( nn_timing == 1 )  CALL timing_start('trc_sms_cfc') 
     96 
     97      IF(lwp) WRITE(numout,*) 
     98      IF(lwp) WRITE(numout,*) ' trc_sms_cfc:  CFC model' 
     99      IF(lwp) WRITE(numout,*) ' ~~~~~~~~~~~~~~' 
    95100      ! 
    96101      ALLOCATE( zpatm(jphem,jp_cfc), STAT=ierr ) 
     
    112117         im2       =      nmonth - 7 
    113118      ENDIF 
     119      ! Avoid bad interpolation if starting date is =< 1900 
     120      if( iyear_beg .LE. 0 ) iyear_beg = 1 
     121      ! 
    114122      iyear_end = iyear_beg + 1 
    115  
    116123      !                                                  !------------! 
    117124      DO jl = 1, jp_cfc                                  !  CFC loop  ! 
     
    120127         ! time interpolation at time kt 
    121128         DO jm = 1, jphem 
    122             zpatm(jm,jl) = (  p_cfc(iyear_beg, jm, jl) * FLOAT (im1)  & 
    123                &           +  p_cfc(iyear_end, jm, jl) * FLOAT (im2) ) / 12. 
     129            zpatm(jm,jl) = (  atm_cfc(iyear_beg, jm, jl) * REAL(im1, wp)  & 
     130               &           +  atm_cfc(iyear_end, jm, jl) * REAL(im2, wp) ) / 12. 
    124131         END DO 
    125132          
     
    148155   
    149156               ! Computation of speed transfert 
    150                !    Schmidt number 
     157               !    Schmidt number revised in Wanninkhof (2014) 
    151158               zt1  = tsn(ji,jj,1,jp_tem) 
    152159               zt2  = zt1 * zt1  
    153160               zt3  = zt1 * zt2 
    154                zsch = sca(1,jl) + sca(2,jl) * zt1 + sca(3,jl) * zt2 + sca(4,jl) * zt3 
    155  
    156                !    speed transfert : formulae of wanninkhof 1992 
     161               zt4  = zt2 * zt2 
     162               zsch = sca(1,jl) + sca(2,jl) * zt1 + sca(3,jl) * zt2 + sca(4,jl) * zt3 + sca(5,jl) * zt4 
     163 
     164               !    speed transfert : formulae revised in Wanninkhof (2014) 
    157165               zv2     = wndm(ji,jj) * wndm(ji,jj) 
    158166               zsch    = zsch / 660. 
    159                zak_cfc = ( 0.39 * xconv2 * zv2 / SQRT(zsch) ) * tmask(ji,jj,1) 
     167               zak_cfc = ( 0.31 * xconv2 * zv2 / SQRT(zsch) ) * tmask(ji,jj,1) 
    160168 
    161169               ! Input function  : speed *( conc. at equil - concen at surface ) 
     
    188196      ! 
    189197      IF( lk_iomput ) THEN 
    190          CALL iom_put( "qtrCFC11"  , qtr_cfc (:,:,1) ) 
    191          CALL iom_put( "qintCFC11" , qint_cfc(:,:,1) ) 
     198         jl = 0 
     199         DO jn = jp_cfc0, jp_cfc1 
     200            jl = jl + 1 
     201            CALL iom_put( 'qtr_'//TRIM(ctrcnm(jn)) , qtr_cfc (:,:,jl) ) 
     202            CALL iom_put( 'qint_'//TRIM(ctrcnm(jn)), qint_cfc(:,:,jl) ) 
     203         ENDDO 
    192204      ELSE 
    193205         IF( ln_diatrc ) THEN 
    194             trc2d(:,:,jp_cfc0_2d    ) = qtr_cfc (:,:,1) 
    195             trc2d(:,:,jp_cfc0_2d + 1) = qint_cfc(:,:,1) 
     206            jl = 0 
     207            DO jn = jp_cfc0_2d, jp_cfc1_2d, 2 
     208               jl = jl + 1 
     209               trc2d(:,:,jn    ) = qtr_cfc (:,:,jl) 
     210               trc2d(:,:,jn + 1) = qint_cfc(:,:,jl) 
     211            ENDDO 
    196212         END IF 
    197213      END IF 
     
    215231      !!--------------------------------------------------------------------- 
    216232      INTEGER :: jn 
    217  
     233      !!---------------------------------------------------------------------- 
     234      ! 
     235      jn = 0  
    218236      ! coefficient for CFC11  
    219237      !---------------------- 
    220  
    221       ! Solubility 
    222       soa(1,1) = -229.9261  
    223       soa(2,1) =  319.6552 
    224       soa(3,1) =  119.4471 
    225       soa(4,1) =  -1.39165 
    226  
    227       sob(1,1) =  -0.142382 
    228       sob(2,1) =   0.091459 
    229       sob(3,1) =  -0.0157274 
    230  
    231       ! Schmidt number  
    232       sca(1,1) = 3501.8 
    233       sca(2,1) = -210.31 
    234       sca(3,1) =  6.1851 
    235       sca(4,1) = -0.07513 
     238      if ( lp_cfc11 ) then 
     239         jn = jn + 1 
     240         ! Solubility 
     241         soa(1,jn) = -229.9261  
     242         soa(2,jn) =  319.6552 
     243         soa(3,jn) =  119.4471 
     244         soa(4,jn) =  -1.39165 
     245 
     246         sob(1,jn) =  -0.142382 
     247         sob(2,jn) =   0.091459 
     248         sob(3,jn) =  -0.0157274 
     249 
     250         ! Schmidt number  
     251         sca(1,jn) = 3579.2 
     252         sca(2,jn) = -222.63 
     253         sca(3,jn) = 7.5749 
     254         sca(4,jn) = -0.14595 
     255         sca(5,jn) = 0.0011874 
     256 
     257         ! atm. concentration 
     258         atm_cfc(:,:,jn) = p_cfc(:,:,1) 
     259      endif 
    236260 
    237261      ! coefficient for CFC12  
    238262      !---------------------- 
    239  
    240       ! Solubility 
    241       soa(1,2) = -218.0971 
    242       soa(2,2) =  298.9702 
    243       soa(3,2) =  113.8049 
    244       soa(4,2) =  -1.39165 
    245  
    246       sob(1,2) =  -0.143566 
    247       sob(2,2) =   0.091015 
    248       sob(3,2) =  -0.0153924 
    249  
    250       ! schmidt number  
    251       sca(1,2) =  3845.4  
    252       sca(2,2) =  -228.95 
    253       sca(3,2) =  6.1908  
    254       sca(4,2) =  -0.067430 
     263      if ( lp_cfc12 ) then 
     264         jn = jn + 1 
     265         ! Solubility 
     266         soa(1,jn) = -218.0971 
     267         soa(2,jn) =  298.9702 
     268         soa(3,jn) =  113.8049 
     269         soa(4,jn) =  -1.39165 
     270 
     271         sob(1,jn) =  -0.143566 
     272         sob(2,jn) =   0.091015 
     273         sob(3,jn) =  -0.0153924 
     274 
     275         ! schmidt number  
     276         sca(1,jn) = 3828.1 
     277         sca(2,jn) = -249.86 
     278         sca(3,jn) = 8.7603 
     279         sca(4,jn) = -0.1716 
     280         sca(5,jn) = 0.001408 
     281 
     282         ! atm. concentration 
     283         atm_cfc(:,:,jn) = p_cfc(:,:,2) 
     284      endif 
     285 
     286      ! coefficient for SF6 
     287      !---------------------- 
     288      if ( lp_sf6 ) then 
     289         jn = jn + 1 
     290         ! Solubility 
     291         soa(1,jn) = -80.0343 
     292         soa(2,jn) = 117.232 
     293         soa(3,jn) =  29.5817 
     294         soa(4,jn) =   0.0 
     295 
     296         sob(1,jn) =  0.0335183  
     297         sob(2,jn) = -0.0373942  
     298         sob(3,jn) =  0.00774862 
     299 
     300         ! schmidt number 
     301         sca(1,jn) = 3177.5 
     302         sca(2,jn) = -200.57 
     303         sca(3,jn) = 6.8865 
     304         sca(4,jn) = -0.13335 
     305         sca(5,jn) = 0.0010877 
     306   
     307         ! atm. concentration 
     308         atm_cfc(:,:,jn) = p_cfc(:,:,3) 
     309       endif 
    255310 
    256311      IF( ln_rsttr ) THEN 
     
    272327      !!                     ***  ROUTINE trc_sms_cfc_alloc  *** 
    273328      !!---------------------------------------------------------------------- 
    274       ALLOCATE( xphem   (jpi,jpj)        ,     & 
    275          &      qtr_cfc (jpi,jpj,jp_cfc) ,     & 
    276          &      qint_cfc(jpi,jpj,jp_cfc) , STAT=trc_sms_cfc_alloc ) 
     329      ALLOCATE( xphem   (jpi,jpj)        , atm_cfc(jpyear,jphem,jp_cfc)  ,    & 
     330         &      qtr_cfc (jpi,jpj,jp_cfc) , qint_cfc(jpi,jpj,jp_cfc)      ,    & 
     331         &      soa(4,jp_cfc)    ,  sob(3,jp_cfc)   ,  sca(5,jp_cfc)     ,    & 
     332         &      STAT=trc_sms_cfc_alloc ) 
    277333         ! 
    278334      IF( trc_sms_cfc_alloc /= 0 ) CALL ctl_warn('trc_sms_cfc_alloc : failed to allocate arrays.') 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/MY_TRC/par_my_trc.F90

    r7806 r10115  
    1515   USE par_pisces , ONLY : jp_pisces_trd   !: number of biological diag in PISCES 
    1616 
    17    USE par_cfc    , ONLY : jp_cfc          !: number of tracers in CFC 
    18    USE par_cfc    , ONLY : jp_cfc_2d       !: number of tracers in CFC 
    19    USE par_cfc    , ONLY : jp_cfc_3d       !: number of tracers in CFC 
    20    USE par_cfc    , ONLY : jp_cfc_trd      !: number of tracers in CFC 
    21  
    22    USE par_c14b   , ONLY : jp_c14b         !: number of tracers in C14 
    23    USE par_c14b   , ONLY : jp_c14b_2d      !: number of tracers in C14 
    24    USE par_c14b   , ONLY : jp_c14b_3d      !: number of tracers in C14 
    25    USE par_c14b   , ONLY : jp_c14b_trd     !: number of tracers in C14 
    26  
    27    USE par_age   , ONLY : jp_age         !: number of tracers in AGE 
    28    USE par_age   , ONLY : jp_age_2d      !: number of tracers in AGE 
    29    USE par_age   , ONLY : jp_age_3d      !: number of tracers in AGE 
    30    USE par_age   , ONLY : jp_age_trd     !: number of tracers in AGE 
    31  
    3217   IMPLICIT NONE 
    3318 
    34    INTEGER, PARAMETER ::   jp_lm      =  jp_pisces     + jp_cfc     + jp_c14b     + jp_age      !:  
    35    INTEGER, PARAMETER ::   jp_lm_2d   =  jp_pisces_2d  + jp_cfc_2d  + jp_c14b_2d  + jp_age_2d   !: 
    36    INTEGER, PARAMETER ::   jp_lm_3d   =  jp_pisces_3d  + jp_cfc_3d  + jp_c14b_3d  + jp_age_3d   !: 
    37    INTEGER, PARAMETER ::   jp_lm_trd  =  jp_pisces_trd + jp_cfc_trd + jp_c14b_trd + jp_age_trd  !: 
     19   INTEGER, PARAMETER ::   jp_lm      =  jp_pisces     !:  
     20   INTEGER, PARAMETER ::   jp_lm_2d   =  jp_pisces_2d  !: 
     21   INTEGER, PARAMETER ::   jp_lm_3d   =  jp_pisces_3d  !: 
     22   INTEGER, PARAMETER ::   jp_lm_trd  =  jp_pisces_trd !: 
    3823 
    3924#if defined key_my_trc 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/MY_TRC/trcnam_my_trc.F90

    r3680 r10115  
    3636      !! 
    3737      !!---------------------------------------------------------------------- 
     38      INTEGER :: jn 
    3839      ! 
    3940      IF(lwp) WRITE(numout,*) 
    4041      IF(lwp) WRITE(numout,*) ' trc_nam_my_trc : read MY_TRC namelists' 
    4142      IF(lwp) WRITE(numout,*) ' ~~~~~~~~~~~~~~~' 
     43      !  
     44      do jn = jp_myt0 , jp_myt1 
     45         ctrcnm    (jn) = 'NONAME' 
     46         ctrcln    (jn) = 'NO Long Name' 
     47         ctrcun    (jn) = 'NOUNIT' 
     48         ln_trc_ini(jn) = .false. 
     49         ln_trc_wri(jn) = .true. 
     50      enddo 
    4251      ! 
    43    END SUBROUTINE trc_nam_my_trc 
     52      END SUBROUTINE trc_nam_my_trc 
    4453    
    4554#else 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zlim.F90

    r7398 r10115  
    190190            DO ji = 1, jpi 
    191191               ! denitrification factor computed from O2 levels 
    192                nitrfac(ji,jj,jk) = MAX(  0.e0, 0.4 * ( 6.e-6  - trb(ji,jj,jk,jpoxy) )    & 
     192               nitrfac(ji,jj,jk)  = MAX(  0.e0, 0.4 * ( 6.e-6  - trb(ji,jj,jk,jpoxy) )    & 
    193193                  &                                / ( oxymin + trb(ji,jj,jk,jpoxy) )  ) 
    194                nitrfac(ji,jj,jk) = MIN( 1., nitrfac(ji,jj,jk) ) 
     194               nitrfac(ji,jj,jk)  = MIN( 1., nitrfac(ji,jj,jk) ) 
     195               ! 
     196               ! denitrification factor computed from NO3 levels 
     197               nitrfac2(ji,jj,jk) = MAX( 0.e0, ( 1.E-6 - trb(ji,jj,jk,jpno3) )  & 
     198                  &                               / ( 1.E-6 + trb(ji,jj,jk,jpno3) ) ) 
     199               nitrfac2(ji,jj,jk) = MIN( 1., nitrfac2(ji,jj,jk) ) 
    195200            END DO 
    196201         END DO 
     
    264269      ! 
    265270      nitrfac (:,:,:) = 0._wp 
     271      nitrfac2(:,:,:) = 0._wp 
    266272      ! 
    267273   END SUBROUTINE p4z_lim_init 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zlys.F90

    r7806 r10115  
    131131 
    132132      IF( lk_iomput .AND. knt == nrdttrc ) THEN 
    133          IF( iom_use( "PH"     ) ) CALL iom_put( "PH"    , -1. * LOG10( hi(:,:,:) )          * tmask(:,:,:) ) 
     133         IF( iom_use( "PH"     ) ) CALL iom_put( "PH"    , -1. * LOG10( MAX( rtrn, hi(:,:,:) ) )  * tmask(:,:,:) ) 
    134134         IF( iom_use( "CO3"    ) ) CALL iom_put( "CO3"   , zco3(:,:,:)    * 1.e+3            * tmask(:,:,:) ) 
    135135         IF( iom_use( "CO3sat" ) ) CALL iom_put( "CO3sat", zco3sat(:,:,:) * 1.e+3            * tmask(:,:,:) ) 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zmeso.F90

    r7398 r10115  
    111111               !  no real reason except that it seems to be more stable and may mimic predation 
    112112               !  --------------------------------------------------------------- 
    113                ztortz2   = mzrat2 * 1.e6 * zfact * trb(ji,jj,jk,jpmes) 
     113               ztortz2   = mzrat2 * 1.e6 * zfact * trb(ji,jj,jk,jpmes) * (1. - nitrfac(ji,jj,jk) ) 
    114114               ! 
    115115               zcompadi  = MAX( ( trb(ji,jj,jk,jpdia) - xthresh2dia ), 0.e0 ) 
     
    126126               zdenom    = zfoodlim / ( xkgraz2 + zfoodlim ) 
    127127               zdenom2   = zdenom / ( zfood + rtrn ) 
    128                zgraze2   = grazrat2 * zstep * tgfunc2(ji,jj,jk) * trb(ji,jj,jk,jpmes)  
     128               zgraze2   = grazrat2 * zstep * tgfunc2(ji,jj,jk) * trb(ji,jj,jk,jpmes) * (1. - nitrfac(ji,jj,jk) )   
     129  
    129130 
    130131               zgrazd    = zgraze2  * xprefc   * zcompadi  * zdenom2  
     
    142143# if ! defined key_kriest 
    143144               zgrazffeg = grazflux  * zstep * wsbio4(ji,jj,jk)      & 
    144                &           * tgfunc2(ji,jj,jk) * trb(ji,jj,jk,jpgoc) * trb(ji,jj,jk,jpmes) 
     145               &           * tgfunc2(ji,jj,jk) * trb(ji,jj,jk,jpgoc) * trb(ji,jj,jk,jpmes) & 
     146               &           * (1. - nitrfac(ji,jj,jk)) 
    145147               zgrazfffg = zgrazffeg * trb(ji,jj,jk,jpbfe) / (trb(ji,jj,jk,jpgoc) + rtrn) 
    146148# endif 
    147149               zgrazffep = grazflux  * zstep *  wsbio3(ji,jj,jk)     & 
    148                &           * tgfunc2(ji,jj,jk) * trb(ji,jj,jk,jppoc) * trb(ji,jj,jk,jpmes) 
     150               &           * tgfunc2(ji,jj,jk) * trb(ji,jj,jk,jppoc) * trb(ji,jj,jk,jpmes) & 
     151               &           * (1. - nitrfac(ji,jj,jk)) 
    149152               zgrazfffp = zgrazffep * trb(ji,jj,jk,jpsfe) / (trb(ji,jj,jk,jppoc) + rtrn) 
    150153              ! 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zmicro.F90

    r7398 r10115  
    103103               !  no real reason except that it seems to be more stable and may mimic predation. 
    104104               !  --------------------------------------------------------------- 
    105                ztortz = mzrat * 1.e6 * zfact * trb(ji,jj,jk,jpzoo) 
     105               ztortz = mzrat * 1.e6 * zfact * trb(ji,jj,jk,jpzoo) * (1. - nitrfac(ji,jj,jk)) 
    106106 
    107107               zcompadi  = MIN( MAX( ( trb(ji,jj,jk,jpdia) - xthreshdia ), 0.e0 ), xsizedia ) 
     
    115115               zdenom    = zfoodlim / ( xkgraz + zfoodlim ) 
    116116               zdenom2   = zdenom / ( zfood + rtrn ) 
    117                zgraze    = grazrat * zstep * tgfunc2(ji,jj,jk) * trb(ji,jj,jk,jpzoo)  
     117               zgraze    = grazrat * zstep * tgfunc2(ji,jj,jk) * trb(ji,jj,jk,jpzoo) * (1. - nitrfac(ji,jj,jk))  
    118118 
    119119               zgrazp    = zgraze  * xpref2p * zcompaph  * zdenom2  
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zopt.F90

    r7520 r10115  
    3636 
    3737   TYPE(FLD), ALLOCATABLE, DIMENSION(:) ::   sf_par      ! structure of input par 
    38    INTEGER , PARAMETER :: nbtimes = 365  !: maximum number of times record in a file 
     38   INTEGER , PARAMETER :: nbtimes = 366  !: maximum number of times record in a file 
    3939   INTEGER  :: ntimes_par                ! number of time steps in a file 
    4040   REAL(wp), ALLOCATABLE, SAVE,   DIMENSION(:,:) :: par_varsw    !: PAR fraction of shortwave 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zrem.F90

    r7398 r10115  
    6767      ! 
    6868      INTEGER  ::   ji, jj, jk 
    69       REAL(wp) ::   zremip, zremik, zsiremin  
     69      REAL(wp) ::   zremip, zremik, zsiremin, zammonic  
    7070      REAL(wp) ::   zsatur, zsatur2, znusil, znusil2, zdep, zdepmin, zfactdep 
    7171      REAL(wp) ::   zbactfer, zorem, zorem2, zofer, zolimit 
     
    7878      REAL(wp), POINTER, DIMENSION(:,:  ) :: ztempbac 
    7979      REAL(wp), POINTER, DIMENSION(:,:,:) :: zdepbac, zolimi, zdepprod, zw3d 
     80      REAL(wp), POINTER, DIMENSION(:,:,:) :: zoxyrem 
    8081      !!--------------------------------------------------------------------- 
    8182      ! 
     
    8485      ! Allocate temporary workspace 
    8586      CALL wrk_alloc( jpi, jpj,      ztempbac                  ) 
    86       CALL wrk_alloc( jpi, jpj, jpk, zdepbac, zdepprod, zolimi ) 
     87      CALL wrk_alloc( jpi, jpj, jpk, zdepbac, zdepprod, zolimi, zoxyrem ) 
    8788 
    8889      ! Initialisation of temprary arrys 
     
    129130               ! Ammonification in suboxic waters with denitrification 
    130131               ! ------------------------------------------------------- 
    131                denitr(ji,jj,jk)  = MIN(  ( trb(ji,jj,jk,jpno3) - rtrn ) / rdenit,   & 
    132                   &                     zremik * nitrfac(ji,jj,jk) * trb(ji,jj,jk,jpdoc)  ) 
     132               zammonic = zremik * nitrfac(ji,jj,jk) * trb(ji,jj,jk,jpdoc) 
     133               denitr(ji,jj,jk)  = zammonic * ( 1. - nitrfac2(ji,jj,jk) ) 
     134               zoxyrem(ji,jj,jk) = zammonic *        nitrfac2(ji,jj,jk) 
    133135               ! 
    134136               zolimi (ji,jj,jk) = MAX( 0.e0, zolimi (ji,jj,jk) ) 
    135137               denitr (ji,jj,jk) = MAX( 0.e0, denitr (ji,jj,jk) ) 
     138               zoxyrem(ji,jj,jk) = MAX( 0.e0, zoxyrem(ji,jj,jk) ) 
    136139               ! 
    137140            END DO 
     
    157160               tra(ji,jj,jk,jpno3) = tra(ji,jj,jk,jpno3) + zonitr - rdenita * denitnh4(ji,jj,jk) 
    158161               tra(ji,jj,jk,jpoxy) = tra(ji,jj,jk,jpoxy) - o2nit * zonitr 
    159                tra(ji,jj,jk,jptal) = tra(ji,jj,jk,jptal) - 2 * rno3 * zonitr + rno3 * ( rdenita - 1. ) * denitnh4(ji,jj,jk) 
     162               tra(ji,jj,jk,jptal) = tra(ji,jj,jk,jptal) - 2 * rno3 * zonitr & 
     163                  &                + rno3 * ( rdenita - 1. ) * denitnh4(ji,jj,jk) 
    160164            END DO 
    161165         END DO 
     
    291295 
    292296      DO jk = 1, jpkm1 
    293          tra(:,:,jk,jppo4) = tra(:,:,jk,jppo4) + zolimi (:,:,jk) + denitr(:,:,jk) 
    294          tra(:,:,jk,jpnh4) = tra(:,:,jk,jpnh4) + zolimi (:,:,jk) + denitr(:,:,jk) 
     297         tra(:,:,jk,jppo4) = tra(:,:,jk,jppo4) + zolimi (:,:,jk) + denitr(:,:,jk) + zoxyrem(:,:,jk) 
     298         tra(:,:,jk,jpnh4) = tra(:,:,jk,jpnh4) + zolimi (:,:,jk) + denitr(:,:,jk) + zoxyrem(:,:,jk) 
    295299         tra(:,:,jk,jpno3) = tra(:,:,jk,jpno3) - denitr (:,:,jk) * rdenit 
    296          tra(:,:,jk,jpdoc) = tra(:,:,jk,jpdoc) - zolimi (:,:,jk) - denitr(:,:,jk) 
     300         tra(:,:,jk,jpdoc) = tra(:,:,jk,jpdoc) - zolimi (:,:,jk) - denitr(:,:,jk) - zoxyrem(:,:,jk) 
    297301         tra(:,:,jk,jpoxy) = tra(:,:,jk,jpoxy) - zolimi (:,:,jk) * o2ut 
    298          tra(:,:,jk,jpdic) = tra(:,:,jk,jpdic) + zolimi (:,:,jk) + denitr(:,:,jk) 
    299          tra(:,:,jk,jptal) = tra(:,:,jk,jptal) + rno3 * ( zolimi(:,:,jk) + ( rdenit + 1.) * denitr(:,:,jk) ) 
     302         tra(:,:,jk,jpdic) = tra(:,:,jk,jpdic) + zolimi (:,:,jk) + denitr(:,:,jk) + zoxyrem(:,:,jk) 
     303         tra(:,:,jk,jptal) = tra(:,:,jk,jptal) + rno3 * ( zolimi(:,:,jk) + zoxyrem(:,:,jk) & 
     304              &                                        + ( rdenit + 1.) * denitr(:,:,jk) ) 
    300305      END DO 
    301306 
     
    323328      ! 
    324329      CALL wrk_dealloc( jpi, jpj,      ztempbac                  ) 
    325       CALL wrk_dealloc( jpi, jpj, jpk, zdepbac, zdepprod, zolimi ) 
     330      CALL wrk_dealloc( jpi, jpj, jpk, zdepbac, zdepprod, zolimi, zoxyrem ) 
    326331      ! 
    327332      IF( nn_timing == 1 )  CALL timing_stop('p4z_rem') 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zsed.F90

    r7520 r10115  
    6464      REAL(wp) ::  zwflux, zfminus, zfplus 
    6565      REAL(wp) ::  zlim, zfact, zfactcal 
    66       REAL(wp) ::  zo2, zno3, zflx, zpdenit, z1pdenit, zdenitt, zolimit 
     66      REAL(wp) ::  zo2, zno3, zflx, zpdenit, z1pdenit, zolimit 
    6767      REAL(wp) ::  zsiloss, zcaloss, zws3, zws4, zwsc, zdep, zwstpoc 
    6868      REAL(wp) ::  ztrfer, ztrpo4, zwdust, zlight 
     
    323323            tra(ji,jj,ikt,jptal) =  tra(ji,jj,ikt,jptal) + zcaloss * zrivalk * 2.0 
    324324            tra(ji,jj,ikt,jpdic) =  tra(ji,jj,ikt,jpdic) + zcaloss * zrivalk 
    325             zsedcal(ji,jj) = (1.0 - zrivalk) * zcaloss / zdep 
    326             zsedsi (ji,jj) = (1.0 - zrivsil) * zsiloss / zdep 
     325            zsedcal(ji,jj) = (1.0 - zrivalk) * zcaloss * fse3t(ji,jj,ikt)  
     326            zsedsi (ji,jj) = (1.0 - zrivsil) * zsiloss * fse3t(ji,jj,ikt)  
    327327#endif 
    328328         END DO 
     
    354354 
    355355#if ! defined key_sed 
    356             ! The 0.5 factor in zpdenit and zdenitt is to avoid negative NO3 concentration after both denitrification 
    357             ! in the sediments and just above the sediments. Not very clever, but simpliest option. 
    358             zpdenit  = MIN( 0.5 * ( trb(ji,jj,ikt,jpno3) - rtrn ) / rdenit, zdenit2d(ji,jj) * zwstpoc * zrivno3 ) 
     356            ! The 0.5 factor in zpdenit is to avoid negative NO3 concentration after 
     357            ! denitrification in the sediments. Not very clever, but simpliest option. 
     358            zpdenit  = MIN( 0.5 * ( trb(ji,jj,ikt,jpno3) - rtrn ) / rdenit, & 
     359                            zdenit2d(ji,jj) * zwstpoc * zrivno3 * (1. - nitrfac2(ji,jj,ikt) ) ) 
    359360            z1pdenit = zwstpoc * zrivno3 - zpdenit 
    360361            zolimit = MIN( ( trb(ji,jj,ikt,jpoxy) - rtrn ) / o2ut, z1pdenit * ( 1.- nitrfac(ji,jj,ikt) ) ) 
    361             zdenitt = MIN(  0.5 * ( trb(ji,jj,ikt,jpno3) - rtrn ) / rdenit, z1pdenit * nitrfac(ji,jj,ikt) ) 
    362             tra(ji,jj,ikt,jpdoc) = tra(ji,jj,ikt,jpdoc) + z1pdenit - zolimit - zdenitt 
    363             tra(ji,jj,ikt,jppo4) = tra(ji,jj,ikt,jppo4) + zpdenit + zolimit + zdenitt 
    364             tra(ji,jj,ikt,jpnh4) = tra(ji,jj,ikt,jpnh4) + zpdenit + zolimit + zdenitt 
    365             tra(ji,jj,ikt,jpno3) = tra(ji,jj,ikt,jpno3) - rdenit * (zpdenit + zdenitt) 
     362            tra(ji,jj,ikt,jpdoc) = tra(ji,jj,ikt,jpdoc) + z1pdenit - zolimit 
     363            tra(ji,jj,ikt,jppo4) = tra(ji,jj,ikt,jppo4) + zpdenit + zolimit 
     364            tra(ji,jj,ikt,jpnh4) = tra(ji,jj,ikt,jpnh4) + zpdenit + zolimit 
     365            tra(ji,jj,ikt,jpno3) = tra(ji,jj,ikt,jpno3) - rdenit * zpdenit 
    366366            tra(ji,jj,ikt,jpoxy) = tra(ji,jj,ikt,jpoxy) - zolimit * o2ut 
    367             tra(ji,jj,ikt,jptal) = tra(ji,jj,ikt,jptal) + rno3 * (zolimit + (1.+rdenit) * (zpdenit + zdenitt) ) 
    368             tra(ji,jj,ikt,jpdic) = tra(ji,jj,ikt,jpdic) + zpdenit + zolimit + zdenitt 
    369             sdenit(ji,jj) = rdenit * zpdenit / zdep 
    370             zsedc(ji,jj)   = (1. - zrivno3) * zwstpoc / zdep 
     367            tra(ji,jj,ikt,jptal) = tra(ji,jj,ikt,jptal) + rno3 * (zolimit + (1.+rdenit) * zpdenit ) 
     368            tra(ji,jj,ikt,jpdic) = tra(ji,jj,ikt,jpdic) + zpdenit + zolimit 
     369            sdenit(ji,jj) = rdenit * zpdenit * fse3t(ji,jj,ikt)  
     370            zsedc(ji,jj)   = (1. - zrivno3) * zwstpoc * fse3t(ji,jj,ikt)  
    371371#endif 
    372372         END DO 
     
    415415      IF( lk_iomput ) THEN 
    416416         IF( knt == nrdttrc ) THEN 
    417             zfact = 1.e+3 * rfact2r * rno3  !  conversion from molC/l/kt  to molN/m3/s 
    418             IF( iom_use("Nfix"   ) ) CALL iom_put( "Nfix", nitrpot(:,:,:) * nitrfix * zfact * tmask(:,:,:) )  ! nitrogen fixation  
     417            zfact = 1.e+3 * rfact2r  !  conversion from molC/l/kt  to molC/m3/s 
     418            IF( iom_use("Nfix"   ) ) CALL iom_put( "Nfix", nitrpot(:,:,:) * nitrfix * rno3 * zfact * tmask(:,:,:) )  ! nitrogen fixation  
    419419            IF( iom_use("INTNFIX") ) THEN   ! nitrogen fixation rate in ocean ( vertically integrated ) 
    420420               zwork1(:,:) = 0. 
    421421               DO jk = 1, jpkm1 
    422                  zwork1(:,:) = zwork1(:,:) + nitrpot(:,:,jk) * nitrfix * zfact * fse3t(:,:,jk) * tmask(:,:,jk) 
     422                 zwork1(:,:) = zwork1(:,:) + nitrpot(:,:,jk) * nitrfix * rno3 * zfact * fse3t(:,:,jk) * tmask(:,:,jk) 
    423423               ENDDO 
    424424               CALL iom_put( "INTNFIX" , zwork1 )  
    425425            ENDIF 
    426             IF( iom_use("SedCal" ) ) CALL iom_put( "SedCal", zsedcal(:,:) * 1.e+3 ) 
    427             IF( iom_use("SedSi" ) )  CALL iom_put( "SedSi",  zsedsi (:,:) * 1.e+3 ) 
    428             IF( iom_use("SedC" ) )   CALL iom_put( "SedC",   zsedc  (:,:) * 1.e+3 ) 
    429             IF( iom_use("Sdenit" ) ) CALL iom_put( "Sdenit", sdenit (:,:) * 1.e+3 * rno3 ) 
     426            IF( iom_use("SedCal" ) ) CALL iom_put( "SedCal", zsedcal(:,:) * zfact ) 
     427            IF( iom_use("SedSi" ) )  CALL iom_put( "SedSi",  zsedsi (:,:) * zfact ) 
     428            IF( iom_use("SedC" ) )   CALL iom_put( "SedC",   zsedc  (:,:) * zfact ) 
     429            IF( iom_use("Sdenit" ) ) CALL iom_put( "Sdenit", sdenit (:,:) * rno3 * zfact ) 
    430430         ENDIF 
    431431      ELSE 
    432          IF( ln_diatrc )  & 
    433             &  trc2d(:,:,jp_pcs0_2d + 12) = nitrpot(:,:,1) * nitrfix * rno3 * 1.e+3 * rfact2r * fse3t(:,:,1) * tmask(:,:,1) 
     432         IF( ln_diatrc ) THEN  
     433            zfact = 1.e+3 * rfact2r  !  conversion from molC/l/kt  to molC/m3/s 
     434            trc2d(:,:,jp_pcs0_2d + 12) = nitrpot(:,:,1) * nitrfix * rno3 * zfact * fse3t(:,:,1) * tmask(:,:,1) 
     435         ENDIF 
    434436      ENDIF 
    435437      ! 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zsms.F90

    r7806 r10115  
    450450 
    451451      IF( kt == nittrc000 ) THEN  
     452         xfact1 = rfact2r * 12. / 1.e15 * ryyss    ! conversion molC/kt --> PgC/yr 
     453         xfact2 = 1.e+3 * rno3 * 14. / 1.e12 * ryyss   ! conversion molC/l/s ----> TgN/m3/yr 
     454         xfact3 = 1.e+3 * rfact2r * rno3   ! conversion molC/l/kt ----> molN/m3/s 
    452455         IF( ln_check_mass .AND. lwp) THEN      !   Open budget file of NO3, ALK, Si, Fer 
    453456            CALL ctl_opn( numco2, 'carbon.budget'  , 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, 6, .FALSE., narea ) 
    454457            CALL ctl_opn( numnut, 'nutrient.budget', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, 6, .FALSE., narea ) 
    455458            CALL ctl_opn( numnit, 'nitrogen.budget', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, 6, .FALSE., narea ) 
    456             xfact1 = rfact2r * 12. / 1.e15 * ryyss    ! conversion molC/kt --> PgC/yr 
    457             xfact2 = 1.e+3 * rno3 * 14. / 1.e12 * ryyss   ! conversion molC/l/s ----> TgN/m3/yr 
    458             xfact3 = 1.e+3 * rfact2r * rno3   ! conversion molC/l/kt ----> molN/m3/s 
    459459            cltxt='time-step   Alkalinity        Nitrate        Phosphorus         Silicate           Iron' 
    460460            IF( lwp ) WRITE(numnut,*)  TRIM(cltxt) 
     
    529529      IF( iom_use( "tnfix" ) .OR.  ( ln_check_mass .AND. kt == nitend )  ) THEN 
    530530         znitrpottot  = glob_sum ( nitrpot(:,:,:) * nitrfix * cvol(:,:,:) ) 
    531          CALL iom_put( "tnfix"  , znitrpottot * 1.e+3 * rno3 )  ! Global  nitrogen fixation molC/l  to molN/m3  
     531         CALL iom_put( "tnfix"  , znitrpottot * xfact3 )  ! Global  nitrogen fixation molC/l  to molN/m3  
    532532      ENDIF 
    533533      ! 
    534534      IF( iom_use( "tdenit" ) .OR.  ( ln_check_mass .AND. kt == nitend )  ) THEN 
    535          zrdenittot   = glob_sum ( denitr(:,:,:) * rdenit * xnegtr(:,:,:) * cvol(:,:,:) ) 
    536          CALL iom_put( "tdenit"  , zrdenittot * 1.e+3 * rno3 )  ! Total denitrification molC/l to molN/m3  
    537       ENDIF 
    538       ! 
    539       IF( iom_use( "Sdenit" ) .OR.  ( ln_check_mass .AND. kt == nitend )  ) THEN 
    540          zsdenittot   = glob_sum ( sdenit(:,:) * e1e2t(:,:) ) 
    541          CALL iom_put( "Sdenit", sdenit(:,:) * xfact3 * tmask(:,:,1) )  ! Nitrate reduction in the sediments 
     535         zrdenittot = glob_sum ( denitr(:,:,:) * rdenit * xnegtr(:,:,:) * cvol(:,:,:) ) ! denitrification in the water column 
     536         zsdenittot = glob_sum ( sdenit(:,:) * e1e2t(:,:) * tmask(:,:,1) )              ! denitrification in the sediments 
     537         CALL iom_put( "tdenit"  , ( zrdenittot + zsdenittot ) * xfact3 )               ! Total denitrification in molN/m3  
    542538      ENDIF 
    543539 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/PISCES/sms_pisces.F90

    r7806 r10115  
    8787   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   xfracal    !: ?? 
    8888   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   nitrfac    !: ?? 
     89   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   nitrfac2   !: ?? 
    8990   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   xlimbac    !: ?? 
    9091   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   xlimbacl   !: ?? 
     
    147148      ALLOCATE( xfracal (jpi,jpj,jpk), nitrfac(jpi,jpj,jpk),       & 
    148149         &      xlimbac (jpi,jpj,jpk), xdiss  (jpi,jpj,jpk),       &  
    149          &      xlimbacl(jpi,jpj,jpk), prodcal(jpi,jpj,jpk),     STAT=ierr(3) ) 
     150         &      xlimbacl(jpi,jpj,jpk), prodcal(jpi,jpj,jpk),       & 
     151         &      nitrfac2(jpi,jpj,jpk),                           STAT=ierr(3) ) 
    150152 
    151153      !* Variable for chemistry of the CO2 cycle 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/TRP/trcnxt.F90

    r8754 r10115  
    4949 
    5050   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:) ::   r2dt 
    51  
     51   REAL(wp)  ::  rfact1, rfact2 
     52 
     53   !! * Substitutions 
     54#  include "domzgr_substitute.h90" 
     55#  include "vectopt_loop_substitute.h90" 
    5256   !!---------------------------------------------------------------------- 
    5357   !! NEMO/TOP 3.3 , NEMO Consortium (2010) 
     
    145149         !                                               
    146150      ELSE 
    147          ! Leap-Frog + Asselin filter time stepping 
    148          IF( lk_vvl ) THEN    
    149  
    150             IF( ln_crs_top )THEN  
    151                CALL tra_nxt_vvl_crs( kt, nittrc000, rdttrc, 'TRC', trb, trn, tra,      & 
    152               &                                              sbc_trc, sbc_trc_b, jptra )      ! variable volume level (vvl)  
    153             ELSE 
    154                CALL tra_nxt_vvl( kt, nittrc000, rdttrc, 'TRC', trb, trn, tra,      & 
    155               &                                          sbc_trc, sbc_trc_b, jptra )      ! variable volume level (vvl)  
     151         IF( .NOT. lk_offline ) THEN ! Leap-Frog + Asselin filter time stepping 
     152 
     153            IF( lk_vvl ) THEN    
     154               IF( ln_crs_top )THEN  
     155                  CALL tra_nxt_vvl_crs( kt, nittrc000, rdttrc, 'TRC', trb, trn, tra,      & 
     156                 &                                              sbc_trc, sbc_trc_b, jptra )      ! variable volume level (vvl)  
     157               ELSE 
     158                  CALL tra_nxt_vvl( kt, nittrc000, rdttrc, 'TRC', trb, trn, tra,      & 
     159                 &                                          sbc_trc, sbc_trc_b, jptra )      ! variable volume level (vvl)  
     160               ENDIF 
     161            ELSE                    
     162               CALL tra_nxt_fix( kt, nittrc000,         'TRC', trb, trn, tra, jptra )      ! fixed    volume level  
    156163            ENDIF 
    157          ELSE                   ;   CALL tra_nxt_fix( kt, nittrc000,         'TRC', trb, trn, tra, jptra )      ! fixed    volume level  
     164 
     165         ELSE 
     166                                    CALL trc_nxt_off( kt )       ! offline 
    158167         ENDIF 
     168 
     169 
    159170      ENDIF 
    160171 
     
    181192   END SUBROUTINE trc_nxt 
    182193 
     194   SUBROUTINE trc_nxt_off( kt ) 
     195      !!---------------------------------------------------------------------- 
     196      !!                   ***  ROUTINE tra_nxt_vvl  *** 
     197      !! 
     198      !! ** Purpose :   Time varying volume: apply the Asselin time filter   
     199      !!                and swap the tracer fields. 
     200      !!  
     201      !! ** Method  : - Apply a thickness weighted Asselin time filter on now fields. 
     202      !!              - save in (ta,sa) a thickness weighted average over the three  
     203      !!             time levels which will be used to compute rdn and thus the semi- 
     204      !!             implicit hydrostatic pressure gradient (ln_dynhpg_imp = T) 
     205      !!              - swap tracer fields to prepare the next time_step. 
     206      !!                This can be summurized for tempearture as: 
     207      !!             ztm = ( e3t_n*tn + rbcp*[ e3t_b*tb - 2 e3t_n*tn + e3t_a*ta ] )   ln_dynhpg_imp = T 
     208      !!                  /( e3t_n    + rbcp*[ e3t_b    - 2 e3t_n    + e3t_a    ] )    
     209      !!             ztm = 0                                                       otherwise 
     210      !!             tb  = ( e3t_n*tn + atfp*[ e3t_b*tb - 2 e3t_n*tn + e3t_a*ta ] ) 
     211      !!                  /( e3t_n    + atfp*[ e3t_b    - 2 e3t_n    + e3t_a    ] ) 
     212      !!             tn  = ta  
     213      !!             ta  = zt        (NB: reset to 0 after eos_bn2 call) 
     214      !! 
     215      !! ** Action  : - (tb,sb) and (tn,sn) ready for the next time step 
     216      !!              - (ta,sa) time averaged (t,s)   (ln_dynhpg_imp = T) 
     217      !!---------------------------------------------------------------------- 
     218      INTEGER         , INTENT(in   )                               ::  kt       ! ocean time-step index 
     219      !!      
     220      INTEGER  ::   ji, jj, jk, jn              ! dummy loop indices 
     221      REAL(wp) ::   ztc_a , ztc_n , ztc_b , ztc_f , ztc_d    ! local scalar 
     222      REAL(wp) ::   ze3t_b, ze3t_n, ze3t_a, ze3t_f, ze3t_d   !   -      - 
     223      !!---------------------------------------------------------------------- 
     224      ! 
     225      IF( kt == nittrc000 )  THEN 
     226         IF(lwp) WRITE(numout,*) 
     227         IF(lwp) WRITE(numout,*) 'trc_nxt_off : time stepping' 
     228         IF(lwp) WRITE(numout,*) '~~~~~~~~~~~' 
     229         IF( lk_vvl ) THEN 
     230           rfact1 = atfp * rdttrc(1) 
     231           rfact2 = rfact1 / rau0 
     232         ENDIF 
     233      ENDIF 
     234      ! 
     235      DO jn = 1, jptra 
     236         DO jk = 1, jpkm1 
     237            DO jj = 1, jpj 
     238               DO ji = 1, jpi 
     239                  ze3t_b = fse3t_b(ji,jj,jk) 
     240                  ze3t_n = fse3t_n(ji,jj,jk) 
     241                  ze3t_a = fse3t_a(ji,jj,jk) 
     242                  !                                         ! tracer content at Before, now and after 
     243                  ztc_b  = trb(ji,jj,jk,jn) * ze3t_b 
     244                  ztc_n  = trn(ji,jj,jk,jn) * ze3t_n 
     245                  ztc_a  = tra(ji,jj,jk,jn) * ze3t_a 
     246                  ! 
     247                  ze3t_d = ze3t_a - 2. * ze3t_n + ze3t_b 
     248                  ztc_d  = ztc_a  - 2. * ztc_n  + ztc_b 
     249                  ! 
     250                  ze3t_f = ze3t_n + atfp * ze3t_d 
     251                  ztc_f  = ztc_n  + atfp * ztc_d 
     252                  ! 
     253                  IF( lk_vvl .AND. jk == mikt(ji,jj) ) THEN           ! first level  
     254                     ze3t_f = ze3t_f - rfact2 * ( emp_b(ji,jj)      - emp(ji,jj)   ) 
     255                     ztc_f  = ztc_f  - rfact1 * ( sbc_trc(ji,jj,jn) - sbc_trc_b(ji,jj,jn) ) 
     256                  ENDIF 
     257 
     258                  ze3t_f = 1.e0 / ze3t_f 
     259                  trb(ji,jj,jk,jn) = ztc_f * ze3t_f       ! ptb <-- ptn filtered 
     260                  trn(ji,jj,jk,jn) = tra(ji,jj,jk,jn)     ! ptn <-- pta 
     261                  ! 
     262               END DO 
     263            END DO 
     264         END DO 
     265         !  
     266      END DO 
     267      ! 
     268   END SUBROUTINE trc_nxt_off 
     269 
    183270#else 
    184271   !!---------------------------------------------------------------------- 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/TRP/trcrad.F90

    r7806 r10115  
    2222   PRIVATE 
    2323 
    24    PUBLIC trc_rad         ! routine called by trcstp.F90 
     24   PUBLIC trc_rad, trc_rad_sms        ! routine called by trcstp.F90 
    2525 
    2626   !! * Substitutions 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/oce_trc.F90

    r10106 r10115  
    1212   USE dom_oce    , ONLY : gdepw_1d 
    1313   USE dom_oce    , ONLY : rdttra 
     14   USE dom_oce    , ONLY : atfp 
    1415   USE dom_oce    , ONLY : Agrif_Root      => Agrif_Root 
    1516   USE sbc_oce    , ONLY : nn_ice_embd 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/trcbc.F90

    r5602 r10115  
    277277      ! OPEN boundary conditions: DOES NOT WORK. Waiting for stable BDY 
    278278      IF( nb_trcobc > 0 ) THEN 
    279         if (lwp) write(numout,'(a,i5,a,i5)') '   reading OBC data for ', nb_trcobc ,' variables at step ', kt 
     279        if (lwp) write(numout,'(a,i5,a,i12)') '   reading OBC data for ', nb_trcobc ,' variables at step ', kt 
    280280        CALL fld_read(kt,1,sf_trcobc) 
    281281        ! vertical interpolation on s-grid and partial step to be added 
     
    284284      ! SURFACE boundary conditions        
    285285      IF( nb_trcsbc > 0 ) THEN 
    286         if (lwp) write(numout,'(a,i5,a,i5)') '   reading SBC data for ', nb_trcsbc ,' variables at step ', kt 
     286        if (lwp) write(numout,'(a,i5,a,i12)') '   reading SBC data for ', nb_trcsbc ,' variables at step ', kt 
    287287        CALL fld_read(kt,1,sf_trcsbc) 
    288288      ENDIF 
     
    290290      ! COASTAL boundary conditions        
    291291      IF( nb_trccbc > 0 ) THEN 
    292         if (lwp) write(numout,'(a,i5,a,i5)') '   reading CBC data for ', nb_trccbc ,' variables at step ', kt 
     292        if (lwp) write(numout,'(a,i5,a,i12)') '   reading CBC data for ', nb_trccbc ,' variables at step ', kt 
    293293        CALL fld_read(kt,1,sf_trccbc) 
    294294      ENDIF    
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/trcdta.F90

    r7398 r10115  
    200200               DO ji = 1, jpi 
    201201                  DO jk = 1, jpk                        ! determines the intepolated T-S profiles at each (i,j) points 
    202                      zl = fsdept_n(ji,jj,jk) 
     202                     zl = gdept_0(ji,jj,jk) 
    203203                     IF(     zl < gdept_1d(1  ) ) THEN         ! above the first level of data 
    204204                        ztp(jk) = ztrcdta(ji,jj,1) 
     
    229229                     ik = mbkt(ji,jj)  
    230230                     IF( ik > 1 ) THEN 
    231                         zl = ( gdept_1d(ik) - fsdept_n(ji,jj,ik) ) / ( gdept_1d(ik) - gdept_1d(ik-1) ) 
     231                        zl = ( gdept_1d(ik) - gdept_0(ji,jj,ik) ) / ( gdept_1d(ik) - gdept_1d(ik-1) ) 
    232232                        ztrcdta(ji,jj,ik) = (1.-zl) * ztrcdta(ji,jj,ik) + zl * ztrcdta(ji,jj,ik-1) 
    233233                     ENDIF 
    234234                     ik = mikt(ji,jj) 
    235235                     IF( ik > 1 ) THEN 
    236                         zl = ( fsdept_n(ji,jj,ik) - gdept_1d(ik) ) / ( gdept_1d(ik+1) - gdept_1d(ik) ) 
     236                        zl = ( gdept_0(ji,jj,ik) - gdept_1d(ik) ) / ( gdept_1d(ik+1) - gdept_1d(ik) ) 
    237237                        ztrcdta(ji,jj,ik) = (1.-zl) * ztrcdta(ji,jj,ik) + zl * ztrcdta(ji,jj,ik+1) 
    238238                     ENDIF 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/trcice.F90

    r6772 r10115  
    5252      IF ( nn_ice_tr == 1 ) THEN 
    5353         IF( lk_pisces  )    CALL trc_ice_ini_pisces       ! PISCES  bio-model 
     54         IF( lk_my_trc  )    CALL trc_ice_ini_my_trc       ! MY_TRC  tracers 
    5455         IF( lk_cfc     )    CALL trc_ice_ini_cfc          ! CFC     tracers 
    5556         IF( lk_c14b    )    CALL trc_ice_ini_c14b         ! C14 bomb  tracer 
    56          IF( lk_my_trc  )    CALL trc_ice_ini_my_trc       ! MY_TRC  tracers 
    5757      ENDIF 
    5858 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/trcini.F90

    r7806 r10115  
    9999 
    100100      IF( lk_pisces  )       CALL trc_ini_pisces       ! PISCES  bio-model 
     101      IF( lk_my_trc  )       CALL trc_ini_my_trc       ! MY_TRC    tracers 
    101102      IF( lk_cfc     )       CALL trc_ini_cfc          ! CFC       tracers 
    102103      IF( lk_c14b    )       CALL trc_ini_c14b         ! C14 bomb  tracer 
    103104      IF( lk_age     )       CALL trc_ini_age          ! AGE       tracer 
    104       IF( lk_my_trc  )       CALL trc_ini_my_trc       ! MY_TRC    tracers 
    105105 
    106106      CALL trc_ice_ini                                 ! Tracers in sea ice 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/trcnam.F90

    r7806 r10115  
    7979      ENDIF 
    8080 
     81      ! Call the ice module for tracers 
     82      ! ------------------------------- 
     83      CALL trc_nam_ice 
     84 
     85      ! namelist of SMS 
     86      ! --------------- 
     87      IF( lk_pisces  ) THEN   ;   CALL trc_nam_pisces      ! PISCES  bio-model 
     88      ELSE                    ;   IF(lwp) WRITE(numout,*) '          PISCES not used' 
     89      ENDIF 
     90 
     91      IF( lk_my_trc  ) THEN  ;   CALL trc_nam_my_trc       ! MY_TRC  tracers 
     92      ELSE                   ;   IF(lwp) WRITE(numout,*)  '          MY_TRC not used' 
     93      ENDIF 
     94 
     95      IF( lk_cfc     ) THEN   ;   CALL trc_nam_cfc         ! CFC     tracers 
     96      ELSE                    ;   IF(lwp) WRITE(numout,*) '          CFC not used' 
     97      ENDIF 
     98 
     99      IF( lk_c14b    ) THEN  ;   CALL trc_nam_c14b         ! C14 bomb     tracers 
     100      ELSE                   ;   IF(lwp) WRITE(numout,*)  '          C14 not used' 
     101      ENDIF 
     102 
     103      IF( lk_age     ) THEN  ;   CALL trc_nam_age         ! AGE     tracer 
     104      ELSE                   ;   IF(lwp) WRITE(numout,*)  '          AGE not used' 
     105      ENDIF 
     106 
    81107     IF(lwp) THEN                   ! control print 
    82108         WRITE(numout,*) 
     
    119145      ENDIF 
    120146 
     147      ! 
     148   END SUBROUTINE trc_nam 
     149 
     150   SUBROUTINE trc_nam_run 
     151      !!--------------------------------------------------------------------- 
     152      !!                     ***  ROUTINE trc_nam  *** 
     153      !! 
     154      !! ** Purpose :   read options for the passive tracer run (namelist)  
     155      !! 
     156      !!--------------------------------------------------------------------- 
     157      NAMELIST/namtrc_run/ nn_dttrc, nn_writetrc, ln_rsttr, nn_rsttr, ln_top_euler, & 
     158        &                  cn_trcrst_indir, cn_trcrst_outdir, cn_trcrst_in, cn_trcrst_out 
     159 
     160 
     161      INTEGER  ::   ios                 ! Local integer output status for namelist read 
     162 
     163      !!--------------------------------------------------------------------- 
     164 
     165 
     166      IF(lwp) WRITE(numout,*) 'trc_nam : read the passive tracer namelists' 
     167      IF(lwp) WRITE(numout,*) '~~~~~~~' 
     168 
     169      CALL ctl_opn( numnat_ref, 'namelist_top_ref'   , 'OLD'    , 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE. ) 
     170      CALL ctl_opn( numnat_cfg, 'namelist_top_cfg'   , 'OLD'    , 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE. ) 
     171      IF(lwm) CALL ctl_opn( numont, 'output.namelist.top', 'UNKNOWN', 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE., 1 ) 
     172 
     173      REWIND( numnat_ref )              ! Namelist namtrc in reference namelist : Passive tracer variables 
     174      READ  ( numnat_ref, namtrc_run, IOSTAT = ios, ERR = 901) 
     175901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc in reference namelist', lwp ) 
     176 
     177      REWIND( numnat_cfg )              ! Namelist namtrc in configuration namelist : Passive tracer variables 
     178      READ  ( numnat_cfg, namtrc_run, IOSTAT = ios, ERR = 902 ) 
     179902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc in configuration namelist', lwp ) 
     180      IF(lwm) WRITE ( numont, namtrc_run ) 
     181 
     182      !  computes the first time step of tracer model 
     183      nittrc000 = nit000 + nn_dttrc - 1 
     184 
     185      IF(lwp) THEN                   ! control print 
     186         WRITE(numout,*) 
     187         WRITE(numout,*) ' Namelist : namtrc_run' 
     188         WRITE(numout,*) '   time step freq. for passive tracer           nn_dttrc      = ', nn_dttrc 
     189         WRITE(numout,*) '   restart  for passive tracer                  ln_rsttr      = ', ln_rsttr 
     190         WRITE(numout,*) '   control of time step for passive tracer      nn_rsttr      = ', nn_rsttr 
     191         WRITE(numout,*) '   first time step for pass. trac.              nittrc000     = ', nittrc000 
     192         WRITE(numout,*) '   frequency of outputs for passive tracers     nn_writetrc   = ', nn_writetrc  
     193         WRITE(numout,*) '   Use euler integration for TRC (y/n)          ln_top_euler  = ', ln_top_euler 
     194         WRITE(numout,*) ' ' 
     195      ENDIF 
     196      ! 
     197    END SUBROUTINE trc_nam_run 
     198 
     199   SUBROUTINE trc_nam_ice 
     200      !!--------------------------------------------------------------------- 
     201      !!                     ***  ROUTINE trc_nam_ice *** 
     202      !! 
     203      !! ** Purpose :   Read the namelist for the ice effect on tracers 
     204      !! 
     205      !! ** Method  : - 
     206      !! 
     207      !!--------------------------------------------------------------------- 
     208      ! --- Variable declarations --- ! 
     209      INTEGER :: jn      ! dummy loop indices 
     210      INTEGER :: ios     ! Local integer output status for namelist read 
     211 
     212      ! --- Namelist declarations --- ! 
     213      TYPE(TRC_I_NML), DIMENSION(jptra) :: sn_tri_tracer 
     214      NAMELIST/namtrc_ice/ nn_ice_tr, sn_tri_tracer 
     215 
     216      IF(lwp) THEN 
     217         WRITE(numout,*) 
     218         WRITE(numout,*) 'trc_nam_ice : Read the namelist for trc_ice' 
     219         WRITE(numout,*) '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~' 
     220      ENDIF 
     221 
     222      IF( nn_timing == 1 )  CALL timing_start('trc_nam_ice') 
     223 
     224      ! 
     225      REWIND( numnat_ref )              ! Namelist namtrc_ice in reference namelist : Passive tracer input data 
     226      READ  ( numnat_ref, namtrc_ice, IOSTAT = ios, ERR = 901) 
     227 901  IF( ios /= 0 ) CALL ctl_nam ( ios , ' namtrc_ice in reference namelist ', lwp ) 
     228 
     229      REWIND( numnat_cfg )              ! Namelist namtrc_ice in configuration namelist : Pisces external sources of nutrients 
     230      READ  ( numnat_cfg, namtrc_ice, IOSTAT = ios, ERR = 902 ) 
     231 902  IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc_ice in configuration namelist', lwp ) 
     232 
     233      IF( lwp ) THEN 
     234         WRITE(numout,*) ' ' 
     235         WRITE(numout,*) ' Sea ice tracers option (nn_ice_tr) : ', nn_ice_tr 
     236         WRITE(numout,*) ' ' 
     237      ENDIF 
     238 
     239      ! Assign namelist stuff 
     240      DO jn = 1, jptra 
     241         trc_ice_ratio(jn)  = sn_tri_tracer(jn)%trc_ratio 
     242         trc_ice_prescr(jn) = sn_tri_tracer(jn)%trc_prescr 
     243         cn_trc_o      (jn) = sn_tri_tracer(jn)%ctrc_o 
     244      END DO 
     245 
     246      IF( nn_timing == 1 )   CALL timing_stop('trc_nam_ice') 
     247      ! 
     248   END SUBROUTINE trc_nam_ice 
     249 
     250   SUBROUTINE trc_nam_trc 
     251      !!--------------------------------------------------------------------- 
     252      !!                     ***  ROUTINE trc_nam  *** 
     253      !! 
     254      !! ** Purpose :   read options for the passive tracer run (namelist)  
     255      !! 
     256      !!--------------------------------------------------------------------- 
     257      TYPE(PTRACER), DIMENSION(jptra) :: sn_tracer  ! type of tracer for saving if not key_iomput 
     258      !! 
     259      NAMELIST/namtrc/ sn_tracer, ln_trcdta,ln_trcdmp, ln_trcdmp_clo 
     260   
     261      INTEGER  ::   ios                 ! Local integer output status for namelist read 
     262      INTEGER  ::   jn                  ! dummy loop indice 
     263      !!--------------------------------------------------------------------- 
     264      IF(lwp) WRITE(numout,*) 
     265      IF(lwp) WRITE(numout,*) 'trc_nam : read the passive tracer namelists' 
     266      IF(lwp) WRITE(numout,*) '~~~~~~~' 
     267 
     268 
     269      REWIND( numnat_ref )              ! Namelist namtrc in reference namelist : Passive tracer variables 
     270      READ  ( numnat_ref, namtrc, IOSTAT = ios, ERR = 901) 
     271901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc in reference namelist', lwp ) 
     272 
     273      REWIND( numnat_cfg )              ! Namelist namtrc in configuration namelist : Passive tracer variables 
     274      READ  ( numnat_cfg, namtrc, IOSTAT = ios, ERR = 902 ) 
     275902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc in configuration namelist', lwp ) 
     276      IF(lwm) WRITE ( numont, namtrc ) 
     277 
     278      DO jn = 1, jptra 
     279         ctrcnm    (jn) = TRIM( sn_tracer(jn)%clsname ) 
     280         ctrcln    (jn) = TRIM( sn_tracer(jn)%cllname ) 
     281         ctrcun    (jn) = TRIM( sn_tracer(jn)%clunit  ) 
     282         ln_trc_ini(jn) =       sn_tracer(jn)%llinit 
     283         ln_trc_wri(jn) =       sn_tracer(jn)%llsave 
     284      END DO 
     285       
     286    END SUBROUTINE trc_nam_trc 
     287 
     288 
     289   SUBROUTINE trc_nam_dia 
     290      !!--------------------------------------------------------------------- 
     291      !!                     ***  ROUTINE trc_nam_dia  *** 
     292      !! 
     293      !! ** Purpose :   read options for the passive tracer diagnostics 
     294      !! 
     295      !! ** Method  : - read passive tracer namelist  
     296      !!              - read namelist of each defined SMS model 
     297      !!                ( (PISCES, CFC, MY_TRC ) 
     298      !!--------------------------------------------------------------------- 
     299      INTEGER ::  ierr 
     300#if defined key_trdmxl_trc  || defined key_trdtrc 
     301      NAMELIST/namtrc_trd/ nn_trd_trc, nn_ctls_trc, rn_ucf_trc, & 
     302         &                ln_trdmxl_trc_restart, ln_trdmxl_trc_instant, & 
     303         &                cn_trdrst_trc_in, cn_trdrst_trc_out, ln_trdtrc 
     304#endif 
     305      NAMELIST/namtrc_dia/ ln_diatrc, ln_diabio, nn_writedia, nn_writebio 
     306 
     307      INTEGER  ::   jn         
     308      INTEGER  ::   ios                 ! Local integer output status for namelist read 
     309      !!--------------------------------------------------------------------- 
     310 
     311      IF(lwp) WRITE(numout,*)  
     312      IF(lwp) WRITE(numout,*) 'trc_nam_dia : read the passive tracer diagnostics options' 
     313      IF(lwp) WRITE(numout,*) '~~~~~~~' 
     314 
     315      IF(lwp) WRITE(numout,*) 
     316      IF(lwp) WRITE(numout,*) 'trc_nam_dia : read the passive tracer diagnostics options' 
     317      IF(lwp) WRITE(numout,*) '~~~~~~~' 
     318 
     319      REWIND( numnat_ref )              ! Namelist namtrc_dia in reference namelist : Passive tracer diagnostics 
     320      READ  ( numnat_ref, namtrc_dia, IOSTAT = ios, ERR = 903) 
     321903   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc_dia in reference namelist', lwp ) 
     322 
     323      REWIND( numnat_cfg )              ! Namelist namtrc_dia in configuration namelist : Passive tracer diagnostics 
     324      READ  ( numnat_cfg, namtrc_dia, IOSTAT = ios, ERR = 904 ) 
     325904   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc_dia in configuration namelist', lwp ) 
     326      IF(lwm) WRITE ( numont, namtrc_dia ) 
     327 
     328      IF(lwp) THEN 
     329         WRITE(numout,*) 
     330         WRITE(numout,*) 
     331         WRITE(numout,*) ' Namelist : namtrc_dia' 
     332         WRITE(numout,*) '    save additionnal diagnostics arrays         ln_diatrc   = ', ln_diatrc 
     333         WRITE(numout,*) '    save additionnal biology diagnostics arrays ln_diabio   = ', ln_diabio 
     334         WRITE(numout,*) '    frequency of outputs for additional arrays  nn_writedia = ', nn_writedia 
     335         WRITE(numout,*) '    frequency of outputs for biological trends  nn_writebio = ', nn_writebio 
     336         WRITE(numout,*) ' ' 
     337      ENDIF 
     338 
     339      IF( ln_diatrc ) THEN  
     340         ALLOCATE( trc2d(jpi,jpj,jpdia2d), trc3d(jpi,jpj,jpk,jpdia3d),  & 
     341           &       ctrc2d(jpdia2d), ctrc2l(jpdia2d), ctrc2u(jpdia2d) ,  &  
     342           &       ctrc3d(jpdia3d), ctrc3l(jpdia3d), ctrc3u(jpdia3d) ,  STAT = ierr )  
     343         IF( ierr > 0 )   CALL ctl_stop( 'STOP', 'trcnam: unable to allocate add. diag. array' ) 
     344         ! 
     345         trc2d(:,:,:  ) = 0._wp  ;   ctrc2d(:) = ' '   ;   ctrc2l(:) = ' '    ;    ctrc2u(:) = ' '  
     346         trc3d(:,:,:,:) = 0._wp  ;   ctrc3d(:) = ' '   ;   ctrc3l(:) = ' '    ;    ctrc3u(:) = ' '  
     347         ! 
     348      ENDIF 
     349 
     350      IF( ln_diabio .OR. l_trdtrc ) THEN 
     351         ALLOCATE( trbio (jpi,jpj,jpk,jpdiabio) , & 
     352           &       ctrbio(jpdiabio), ctrbil(jpdiabio), ctrbiu(jpdiabio), STAT = ierr )  
     353         IF( ierr > 0 )   CALL ctl_stop( 'STOP', 'trcnam: unable to allocate bio. diag. array' ) 
     354         ! 
     355         trbio(:,:,:,:) = 0._wp  ;   ctrbio(:) = ' '   ;   ctrbil(:) = ' '    ;    ctrbiu(:) = ' '  
     356         ! 
     357      ENDIF 
    121358 
    122359#if defined key_trdmxl_trc || defined key_trdtrc 
     
    146383         ENDIF 
    147384#endif 
    148  
    149  
    150       ! Call the ice module for tracers 
    151       ! ------------------------------- 
    152       CALL trc_nam_ice 
    153  
    154       ! namelist of SMS 
    155       ! ---------------       
    156       IF( lk_pisces  ) THEN   ;   CALL trc_nam_pisces      ! PISCES  bio-model 
    157       ELSE                    ;   IF(lwp) WRITE(numout,*) '          PISCES not used' 
    158       ENDIF 
    159  
    160       IF( lk_cfc     ) THEN   ;   CALL trc_nam_cfc         ! CFC     tracers 
    161       ELSE                    ;   IF(lwp) WRITE(numout,*) '          CFC not used' 
    162       ENDIF 
    163  
    164       IF( lk_c14b    ) THEN  ;   CALL trc_nam_c14b         ! C14 bomb     tracers 
    165       ELSE                   ;   IF(lwp) WRITE(numout,*) '          C14 not used' 
    166       ENDIF 
    167  
    168       IF( lk_age     ) THEN  ;   CALL trc_nam_age         ! AGE     tracer 
    169       ELSE                   ;   IF(lwp) WRITE(numout,*) '          AGE not used' 
    170       ENDIF 
    171  
    172       IF( lk_my_trc  ) THEN  ;   CALL trc_nam_my_trc      ! MY_TRC  tracers 
    173       ELSE                   ;   IF(lwp) WRITE(numout,*) '          MY_TRC not used' 
    174       ENDIF 
    175       ! 
    176    END SUBROUTINE trc_nam 
    177  
    178    SUBROUTINE trc_nam_run 
    179       !!--------------------------------------------------------------------- 
    180       !!                     ***  ROUTINE trc_nam  *** 
    181       !! 
    182       !! ** Purpose :   read options for the passive tracer run (namelist)  
    183       !! 
    184       !!--------------------------------------------------------------------- 
    185       NAMELIST/namtrc_run/ nn_dttrc, nn_writetrc, ln_rsttr, nn_rsttr, ln_top_euler, & 
    186         &                  cn_trcrst_indir, cn_trcrst_outdir, cn_trcrst_in, cn_trcrst_out 
    187  
    188  
    189       INTEGER  ::   ios                 ! Local integer output status for namelist read 
    190  
    191       !!--------------------------------------------------------------------- 
    192  
    193  
    194       IF(lwp) WRITE(numout,*) 'trc_nam : read the passive tracer namelists' 
    195       IF(lwp) WRITE(numout,*) '~~~~~~~' 
    196  
    197       CALL ctl_opn( numnat_ref, 'namelist_top_ref'   , 'OLD'    , 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE. ) 
    198       CALL ctl_opn( numnat_cfg, 'namelist_top_cfg'   , 'OLD'    , 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE. ) 
    199       IF(lwm) CALL ctl_opn( numont, 'output.namelist.top', 'UNKNOWN', 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE., 1 ) 
    200  
    201       REWIND( numnat_ref )              ! Namelist namtrc in reference namelist : Passive tracer variables 
    202       READ  ( numnat_ref, namtrc_run, IOSTAT = ios, ERR = 901) 
    203 901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc in reference namelist', lwp ) 
    204  
    205       REWIND( numnat_cfg )              ! Namelist namtrc in configuration namelist : Passive tracer variables 
    206       READ  ( numnat_cfg, namtrc_run, IOSTAT = ios, ERR = 902 ) 
    207 902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc in configuration namelist', lwp ) 
    208       IF(lwm) WRITE ( numont, namtrc_run ) 
    209  
    210       !  computes the first time step of tracer model 
    211       nittrc000 = nit000 + nn_dttrc - 1 
    212  
    213       IF(lwp) THEN                   ! control print 
    214          WRITE(numout,*) 
    215          WRITE(numout,*) ' Namelist : namtrc_run' 
    216          WRITE(numout,*) '   time step freq. for passive tracer           nn_dttrc      = ', nn_dttrc 
    217          WRITE(numout,*) '   restart  for passive tracer                  ln_rsttr      = ', ln_rsttr 
    218          WRITE(numout,*) '   control of time step for passive tracer      nn_rsttr      = ', nn_rsttr 
    219          WRITE(numout,*) '   first time step for pass. trac.              nittrc000     = ', nittrc000 
    220          WRITE(numout,*) '   frequency of outputs for passive tracers     nn_writetrc   = ', nn_writetrc  
    221          WRITE(numout,*) '   Use euler integration for TRC (y/n)          ln_top_euler  = ', ln_top_euler 
    222          WRITE(numout,*) ' ' 
    223       ENDIF 
    224       ! 
    225     END SUBROUTINE trc_nam_run 
    226  
    227    SUBROUTINE trc_nam_ice 
    228       !!--------------------------------------------------------------------- 
    229       !!                     ***  ROUTINE trc_nam_ice *** 
    230       !! 
    231       !! ** Purpose :   Read the namelist for the ice effect on tracers 
    232       !! 
    233       !! ** Method  : - 
    234       !! 
    235       !!--------------------------------------------------------------------- 
    236       ! --- Variable declarations --- ! 
    237       INTEGER :: jn      ! dummy loop indices 
    238       INTEGER :: ios     ! Local integer output status for namelist read 
    239  
    240       ! --- Namelist declarations --- ! 
    241       TYPE(TRC_I_NML), DIMENSION(jptra) :: sn_tri_tracer 
    242       NAMELIST/namtrc_ice/ nn_ice_tr, sn_tri_tracer 
    243  
    244       IF(lwp) THEN 
    245          WRITE(numout,*) 
    246          WRITE(numout,*) 'trc_nam_ice : Read the namelist for trc_ice' 
    247          WRITE(numout,*) '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~' 
    248       ENDIF 
    249  
    250       IF( nn_timing == 1 )  CALL timing_start('trc_nam_ice') 
    251  
    252       ! 
    253       REWIND( numnat_ref )              ! Namelist namtrc_ice in reference namelist : Passive tracer input data 
    254       READ  ( numnat_ref, namtrc_ice, IOSTAT = ios, ERR = 901) 
    255  901  IF( ios /= 0 ) CALL ctl_nam ( ios , ' namtrc_ice in reference namelist ', lwp ) 
    256  
    257       REWIND( numnat_cfg )              ! Namelist namtrc_ice in configuration namelist : Pisces external sources of nutrients 
    258       READ  ( numnat_cfg, namtrc_ice, IOSTAT = ios, ERR = 902 ) 
    259  902  IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc_ice in configuration namelist', lwp ) 
    260  
    261       IF( lwp ) THEN 
    262          WRITE(numout,*) ' ' 
    263          WRITE(numout,*) ' Sea ice tracers option (nn_ice_tr) : ', nn_ice_tr 
    264          WRITE(numout,*) ' ' 
    265       ENDIF 
    266  
    267       ! Assign namelist stuff 
    268       DO jn = 1, jptra 
    269          trc_ice_ratio(jn)  = sn_tri_tracer(jn)%trc_ratio 
    270          trc_ice_prescr(jn) = sn_tri_tracer(jn)%trc_prescr 
    271          cn_trc_o      (jn) = sn_tri_tracer(jn)%ctrc_o 
    272       END DO 
    273  
    274       IF( nn_timing == 1 )   CALL timing_stop('trc_nam_ice') 
    275       ! 
    276    END SUBROUTINE trc_nam_ice 
    277  
    278    SUBROUTINE trc_nam_trc 
    279       !!--------------------------------------------------------------------- 
    280       !!                     ***  ROUTINE trc_nam  *** 
    281       !! 
    282       !! ** Purpose :   read options for the passive tracer run (namelist)  
    283       !! 
    284       !!--------------------------------------------------------------------- 
    285       TYPE(PTRACER), DIMENSION(jptra) :: sn_tracer  ! type of tracer for saving if not key_iomput 
    286       !! 
    287       NAMELIST/namtrc/ sn_tracer, ln_trcdta,ln_trcdmp, ln_trcdmp_clo 
    288    
    289       INTEGER  ::   ios                 ! Local integer output status for namelist read 
    290       INTEGER  ::   jn                  ! dummy loop indice 
    291       !!--------------------------------------------------------------------- 
    292       IF(lwp) WRITE(numout,*) 
    293       IF(lwp) WRITE(numout,*) 'trc_nam : read the passive tracer namelists' 
    294       IF(lwp) WRITE(numout,*) '~~~~~~~' 
    295  
    296  
    297       REWIND( numnat_ref )              ! Namelist namtrc in reference namelist : Passive tracer variables 
    298       READ  ( numnat_ref, namtrc, IOSTAT = ios, ERR = 901) 
    299 901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc in reference namelist', lwp ) 
    300  
    301       REWIND( numnat_cfg )              ! Namelist namtrc in configuration namelist : Passive tracer variables 
    302       READ  ( numnat_cfg, namtrc, IOSTAT = ios, ERR = 902 ) 
    303 902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc in configuration namelist', lwp ) 
    304       IF(lwm) WRITE ( numont, namtrc ) 
    305  
    306       DO jn = 1, jptra 
    307          ctrcnm    (jn) = TRIM( sn_tracer(jn)%clsname ) 
    308          ctrcln    (jn) = TRIM( sn_tracer(jn)%cllname ) 
    309          ctrcun    (jn) = TRIM( sn_tracer(jn)%clunit  ) 
    310          ln_trc_ini(jn) =       sn_tracer(jn)%llinit 
    311          ln_trc_wri(jn) =       sn_tracer(jn)%llsave 
    312       END DO 
    313        
    314     END SUBROUTINE trc_nam_trc 
    315  
    316  
    317    SUBROUTINE trc_nam_dia 
    318       !!--------------------------------------------------------------------- 
    319       !!                     ***  ROUTINE trc_nam_dia  *** 
    320       !! 
    321       !! ** Purpose :   read options for the passive tracer diagnostics 
    322       !! 
    323       !! ** Method  : - read passive tracer namelist  
    324       !!              - read namelist of each defined SMS model 
    325       !!                ( (PISCES, CFC, MY_TRC ) 
    326       !!--------------------------------------------------------------------- 
    327       INTEGER ::  ierr 
    328 #if defined key_trdmxl_trc  || defined key_trdtrc 
    329       NAMELIST/namtrc_trd/ nn_trd_trc, nn_ctls_trc, rn_ucf_trc, & 
    330          &                ln_trdmxl_trc_restart, ln_trdmxl_trc_instant, & 
    331          &                cn_trdrst_trc_in, cn_trdrst_trc_out, ln_trdtrc 
    332 #endif 
    333       NAMELIST/namtrc_dia/ ln_diatrc, ln_diabio, nn_writedia, nn_writebio 
    334  
    335       INTEGER  ::   ios                 ! Local integer output status for namelist read 
    336       !!--------------------------------------------------------------------- 
    337  
    338       IF(lwp) WRITE(numout,*)  
    339       IF(lwp) WRITE(numout,*) 'trc_nam_dia : read the passive tracer diagnostics options' 
    340       IF(lwp) WRITE(numout,*) '~~~~~~~' 
    341  
    342       IF(lwp) WRITE(numout,*) 
    343       IF(lwp) WRITE(numout,*) 'trc_nam_dia : read the passive tracer diagnostics options' 
    344       IF(lwp) WRITE(numout,*) '~~~~~~~' 
    345  
    346       REWIND( numnat_ref )              ! Namelist namtrc_dia in reference namelist : Passive tracer diagnostics 
    347       READ  ( numnat_ref, namtrc_dia, IOSTAT = ios, ERR = 903) 
    348 903   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc_dia in reference namelist', lwp ) 
    349  
    350       REWIND( numnat_cfg )              ! Namelist namtrc_dia in configuration namelist : Passive tracer diagnostics 
    351       READ  ( numnat_cfg, namtrc_dia, IOSTAT = ios, ERR = 904 ) 
    352 904   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc_dia in configuration namelist', lwp ) 
    353       IF(lwm) WRITE ( numont, namtrc_dia ) 
    354  
    355       IF(lwp) THEN 
    356          WRITE(numout,*) 
    357          WRITE(numout,*) 
    358          WRITE(numout,*) ' Namelist : namtrc_dia' 
    359          WRITE(numout,*) '    save additionnal diagnostics arrays         ln_diatrc   = ', ln_diatrc 
    360          WRITE(numout,*) '    save additionnal biology diagnostics arrays ln_diabio   = ', ln_diabio 
    361          WRITE(numout,*) '    frequency of outputs for additional arrays  nn_writedia = ', nn_writedia 
    362          WRITE(numout,*) '    frequency of outputs for biological trends  nn_writebio = ', nn_writebio 
    363          WRITE(numout,*) ' ' 
    364       ENDIF 
    365  
    366       IF( ln_diatrc ) THEN  
    367          ALLOCATE( trc2d(jpi,jpj,jpdia2d), trc3d(jpi,jpj,jpk,jpdia3d),  & 
    368            &       ctrc2d(jpdia2d), ctrc2l(jpdia2d), ctrc2u(jpdia2d) ,  &  
    369            &       ctrc3d(jpdia3d), ctrc3l(jpdia3d), ctrc3u(jpdia3d) ,  STAT = ierr )  
    370          IF( ierr > 0 )   CALL ctl_stop( 'STOP', 'trcnam: unable to allocate add. diag. array' ) 
    371          ! 
    372          trc2d(:,:,:  ) = 0._wp  ;   ctrc2d(:) = ' '   ;   ctrc2l(:) = ' '    ;    ctrc2u(:) = ' '  
    373          trc3d(:,:,:,:) = 0._wp  ;   ctrc3d(:) = ' '   ;   ctrc3l(:) = ' '    ;    ctrc3u(:) = ' '  
    374          ! 
    375       ENDIF 
    376  
    377       IF( ln_diabio .OR. l_trdtrc ) THEN 
    378          ALLOCATE( trbio (jpi,jpj,jpk,jpdiabio) , & 
    379            &       ctrbio(jpdiabio), ctrbil(jpdiabio), ctrbiu(jpdiabio), STAT = ierr )  
    380          IF( ierr > 0 )   CALL ctl_stop( 'STOP', 'trcnam: unable to allocate bio. diag. array' ) 
    381          ! 
    382          trbio(:,:,:,:) = 0._wp  ;   ctrbio(:) = ' '   ;   ctrbil(:) = ' '    ;    ctrbiu(:) = ' '  
    383          ! 
    384       ENDIF 
    385385      ! 
    386386   END SUBROUTINE trc_nam_dia 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/trcsms.F90

    r7806 r10115  
    5050      ! 
    5151      IF( lk_pisces  )   CALL trc_sms_pisces ( kt )    ! main program of PISCES  
     52      IF( lk_my_trc  )   CALL trc_sms_my_trc ( kt )    ! MY_TRC  tracers 
    5253      IF( lk_cfc     )   CALL trc_sms_cfc    ( kt )    ! surface fluxes of CFC 
    5354      IF( lk_c14b    )   CALL trc_sms_c14b   ( kt )    ! surface fluxes of C14 
    5455      IF( lk_age     )   CALL trc_sms_age    ( kt )    ! AGE tracer 
    55       IF( lk_my_trc  )   CALL trc_sms_my_trc ( kt )    ! MY_TRC  tracers 
    5656 
    5757      IF(ln_ctl) THEN      ! print mean trends (used for debugging) 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/trcwri.F90

    r7806 r10115  
    5858      ! --------------------------------------- 
    5959      IF( lk_pisces  )   CALL trc_wri_pisces     ! PISCES  
     60      IF( lk_my_trc  )   CALL trc_wri_my_trc     ! MY_TRC  tracers 
    6061      IF( lk_cfc     )   CALL trc_wri_cfc        ! surface fluxes of CFC 
    6162      IF( lk_c14b    )   CALL trc_wri_c14b       ! surface fluxes of C14 
    6263      IF( lk_age     )   CALL trc_wri_age        ! AGE tracer 
    63       IF( lk_my_trc  )   CALL trc_wri_my_trc     ! MY_TRC  tracers 
    6464      ! 
    6565      IF( nn_timing == 1 )  CALL timing_stop('trc_wri') 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/SETTE/BATCH_TEMPLATE/batch-ifort_athena

    r7261 r10115  
    44#BSUB -n NPROCS 
    55#BSUB -a poe 
    6 #BSUB -J MPI_config 
     6#BSUB -J NEMO_SETTE 
    77#BSUB -o poe.stdout.%J 
    88#BSUB -e poe.stderr.%J 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/SETTE/BATCH_TEMPLATE/batch-ifort_athena_xios

    r7261 r10115  
    44#BSUB -n TOTAL_NPROCS 
    55#BSUB -a poe 
    6 #BSUB -J MPI_config 
     6#BSUB -J NEMO_SETTE 
    77#BSUB -o poe.stdout.%J 
    88#BSUB -e poe.stderr.%J 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/SETTE/sette.sh

    r7261 r10115  
    8888# 
    8989# Compiler among those in NEMOGCM/ARCH 
    90 COMPILER=X64_ADA 
    91 export BATCH_COMMAND_PAR="llsubmit" 
     90COMPILER=openmpi_NAVITI_MERCATOR 
     91export BATCH_COMMAND_PAR="qsub" 
    9292export BATCH_COMMAND_SEQ=$BATCH_COMMAND_PAR 
    9393export INTERACT_FLAG="no" 
     
    143143# ORCA2_AGRIF_LIM :16 & 17  
    144144#                  18 & 19  
    145 for config in  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 
     145for config in  11 
    146146 
    147147do 
     
    897897    set_namelist namelist_cfg cn_exp \"SAS\" 
    898898    set_namelist namelist_cfg nn_it000 1 
    899     set_namelist namelist_cfg nn_itend 100 
    900     set_namelist namelist_cfg nn_stock 50 
     899    set_namelist namelist_cfg nn_itend 240 
     900    set_namelist namelist_cfg nn_stock 120 
    901901    set_namelist namelist_cfg ln_ctl .false. 
    902902    set_namelist namelist_cfg ln_clobber .true. 
     
    918918    cd ${EXE_DIR} 
    919919    set_namelist namelist_cfg cn_exp \"SAS\" 
    920     set_namelist namelist_cfg nn_it000 51 
    921     set_namelist namelist_cfg nn_itend 100 
     920    set_namelist namelist_cfg nn_it000 121 
     921    set_namelist namelist_cfg nn_itend 240 
    922922    set_namelist namelist_cfg ln_ctl .false. 
    923923    set_namelist namelist_cfg ln_clobber .true. 
     
    926926    set_namelist namelist_cfg jpnj 4 
    927927    set_namelist namelist_cfg jpnij 32 
     928    set_namelist namelist_cfg ln_rstart .true. 
    928929    set_namelist namelist_cfg nn_rstctl 2 
    929     set_namelist namelist_cfg cn_ocerst_in \"SAS_00000050_restart\" 
     930    set_namelist namelist_cfg nn_date0 010109 
     931    set_namelist namelist_cfg cn_ocerst_in \"SAS_00000120_restart\" 
     932    set_namelist namelist_ice_cfg cn_icerst_in \"SAS_00000120_restart_ice\" 
    930933    for (( i=1; i<=$NPROC; i++)) ; do 
    931934        L_NPROC=$(( $i - 1 )) 
    932935        L_NPROC=`printf "%04d\n" ${L_NPROC}` 
    933         ln -sf ../LONG/SAS_00000050_restart_${L_NPROC}.nc . 
     936        ln -sf ../LONG/SAS_00000120_restart_${L_NPROC}.nc . 
     937        ln -sf ../LONG/SAS_00000120_restart_ice_${L_NPROC}.nc . 
    934938    done 
    935939    if [ ${USING_MPMD} == "yes" ] ; then 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/TOOLS/COMPILE/Fdel_keys.sh

    r4990 r10115  
    6060# 
    6161#- 
    62  echo "Removing keys in : ${NEW_CONF}" 
    63  for i in ${list_del_key} ; do 
    64         if [ "$(echo ${i} | grep -c key_nproc )" -ne 0 ] ; then 
    65            sed -e "s/key_nproc[ij]=.* //"  ${CONFIG_DIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm >  ${CONFIG_DIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm.tmp 
    66                 mv ${CONFIG_DIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm.tmp   ${CONFIG_DIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm 
    67                 echo " " 
    68         elif [ "$(cat ${CONFIG_DIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm | grep -c "$i" )" -ne 0 ] ; then 
    69          sed -e "s/${i}//"  ${CONFIG_DIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm >  ${CONFIG_DIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm.tmp 
    70          mv ${CONFIG_DIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm.tmp   ${CONFIG_DIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm 
    71          echo "deleted key $i in ${NEW_CONF}" 
    72         fi 
    73  done 
    7462 
    75  unset -v list_del_key 
     63echo "Removing keys in : ${NEW_CONF}" 
     64 
     65for i in ${list_del_key} ; do 
     66 
     67     if [ "$(echo ${i} | grep -c key_nproc )" -ne 0 ]                                     ; then 
     68        sed -e "s/key_nproc[ij]=.* //" ${CONFIG_DIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm \ 
     69       >  ${CONFIG_DIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm.tmp 
     70        mv ${CONFIG_DIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm.tmp ${CONFIG_DIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm 
     71        echo " " 
     72     elif [ "$(cat ${CONFIG_DIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm | grep -c "$i" )" -ne 0 ]; then 
     73         sed -e "s/\b${i}\b//" ${CONFIG_DIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm \ 
     74        >  ${CONFIG_DIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm.tmp 
     75         mv ${CONFIG_DIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm.tmp ${CONFIG_DIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm 
     76         echo "deleted key $i in ${NEW_CONF}" 
     77     fi 
     78 
     79done 
     80 
     81unset -v list_del_key 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/TOOLS/NESTING/src/agrif_create_bathy.f90

    r2455 r10115  
    5454  REAL*8, DIMENSION(:,:),POINTER :: save_gdepw,rx,ry,maskedtopo 
    5555  REAL*8  :: Cell_lonmin,Cell_lonmax,Cell_latmin,Cell_latmax,wghts 
    56   LOGICAL :: Pacifique 
     56  LOGICAL :: Pacifique=.FALSE. 
    5757  INTEGER :: boundary,xpos,ypos,iimin,iimax,jjmax,jjmin 
    5858  INTEGER :: nbloops,nxhr,nyhr,ji,jj,nbiter,nbloopmax 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/TOOLS/NESTING/src/agrif_readwrite.f90

    r2455 r10115  
    232232    CHARACTER(len=1),DIMENSION(2) :: dimnames 
    233233    ! 
    234     status = nf90_create(name,NF90_WRITE,ncid) 
     234    status = nf90_create(name,NF90_NOCLOBBER,ncid) 
    235235    status = nf90_close(ncid)           
    236236    ! 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/TOOLS/SECTIONS_DIADCT/src/compute_sections.f90

    r3632 r10115  
    681681     IF( sec%nb_point .ne. 0 )THEN 
    682682        IF (  sec%listPoint(sec%nb_point)%I .NE.  sec%listPoint(1)%I ) THEN 
    683            sec%slopeSection = ( sec%listPoint(sec%nb_point)%J - sec%listPoint(1)%J ) /  & 
    684                               ( sec%listPoint(sec%nb_point)%I - sec%listPoint(1)%I )       
     683           sec%slopeSection = REAL( ( sec%listPoint(sec%nb_point)%J - sec%listPoint(1)%J ) , wp )/  & 
     684                              REAL( ( sec%listPoint(sec%nb_point)%I - sec%listPoint(1)%I ) , wp ) 
     685 
    685686        ELSE 
    686687           sec%slopeSection = 10000._wp 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/TOOLS/SIREN/README

    r7261 r10115  
    33(http://www.stack.nl/~dimitri/doxygen/index.html version 1.8.3.1 or upper) 
    44then 
    5    open ./TOOLS/SIREN/doc/html/index.html in your web browser  
     5   open ./TOOLS/SIREN/doc/html/index.html in your web browser 
    66or  
    7    run ./TOOLS/SIREN/doc/latex/gmake and open ./TOOLS/SIREN/doc/latex/refman.pdf  
     7   run gmake in ./TOOLS/SIREN/doc/latex directory and open ./TOOLS/SIREN/doc/latex/refman.pdf  
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/TOOLS/SIREN/cfg/dummy.cfg

    r7261 r10115  
    11&namdum 
    2    cn_dumvar="" 
     2   cn_dumvar="orca_lon", "orca_lat", "time_instant", "time_centered" 
    33   cn_dumdim="" 
    44   cn_dumatt="history" 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/TOOLS/SIREN/cfg/variable.cfg

    r7261 r10115  
    88nav_lev      | model_levels   | Z    | T | cubic           | Model levels                          |                                   
    99deptht       | m              | Z    | T |                 | Vertical T levels                     | depth                             
     10ncatice      | 1              | Z    | T |                 | Ice category                          | num_icecat_coordinate 
    1011time_counter |                | T    |   |                 | Time axis                             | time                              
    1112Bathymetry   | m              | XY   | T | cubic           | Bathymetry                            | bathymetry                        
     
    108109kz           |                | XYZT | T |                 |                                       |                                   
    109110irondep      |                | XYZT | T |                 |                                       |                                   
     111sivelu       | m/s            | XYT  | T |                 | Ice velocity along i-axis at I-point  | sea_ice_x_velocity 
     112sivelv       | m/s            | XYT  | T |                 | Ice velocity along j-axis at I-point  | sea_ice_y_velocity 
     113siconcat     | %              | XYZT | T |                 | Ice concentration for categories      | sea_ice_cat_concentration 
     114sithicat     | m              | XYZT | T |                 | Ice thickness for categories          | sea_ice_cat_icethickness 
     115snthicat     | m              | XYZT | T |                 | Snow thickness for categories         | sea_ice_cat_snowthickness 
    110116kt_ice       |                |      |   |                 |                                       |                                   
    111117hicif        |                |      |   |                 |                                       |                                   
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/TOOLS/SIREN/src/attribute.f90

    r7261 r10115  
    141141   END TYPE TATT 
    142142 
    143    CHARACTER(LEN=lc), DIMENSION(ip_maxdum), SAVE :: cm_dumatt !< dummy attribute 
     143   CHARACTER(LEN=lc), DIMENSION(ip_maxdumcfg), SAVE :: cm_dumatt !< dummy attribute 
    144144 
    145145   INTERFACE att_init 
     
    12821282      ! loop indices 
    12831283      ! namelist 
    1284       CHARACTER(LEN=lc), DIMENSION(ip_maxdum) :: cn_dumvar 
    1285       CHARACTER(LEN=lc), DIMENSION(ip_maxdum) :: cn_dumdim 
    1286       CHARACTER(LEN=lc), DIMENSION(ip_maxdum) :: cn_dumatt 
     1284      CHARACTER(LEN=lc), DIMENSION(ip_maxdumcfg) :: cn_dumvar 
     1285      CHARACTER(LEN=lc), DIMENSION(ip_maxdumcfg) :: cn_dumdim 
     1286      CHARACTER(LEN=lc), DIMENSION(ip_maxdumcfg) :: cn_dumatt 
    12871287 
    12881288      !---------------------------------------------------------------- 
     
    13451345 
    13461346      att_is_dummy=.FALSE. 
    1347       DO ji=1,ip_maxdum 
     1347      DO ji=1,ip_maxdumcfg 
    13481348         IF( fct_lower(td_att%c_name) == fct_lower(cm_dumatt(ji)) )THEN 
    13491349            att_is_dummy=.TRUE. 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/TOOLS/SIREN/src/create_bathy.f90

    r7261 r10115  
    2222!> <br/>     
    2323!> \image html  bathy_40.png  
    24 !> \image latex bathy_30.png 
     24!> <center>\image latex bathy_30.png 
     25!> </center> 
    2526!> 
    2627!> @note  
     
    4546!>       - cn_varcfg : variable configuration file  
    4647!> (see ./SIREN/cfg/variable.cfg) 
     48!>       - cn_dimcfg : dimension configuration file. defines dimension allowed 
     49!> (see ./SIREN/cfg/dimension.cfg). 
    4750!>       - cn_dumcfg : useless (dummy) configuration file, for useless  
    4851!> dimension or variable (see ./SIREN/cfg/dummy.cfg). 
     
    133136!> @date February, 2016 
    134137!> - do not closed sea for east-west cyclic domain 
     138!> @date October, 2016 
     139!> - dimension to be used select from configuration file 
    135140! 
    136141!> @todo 
     
    218223   ! namcfg 
    219224   CHARACTER(LEN=lc)                       :: cn_varcfg = './cfg/variable.cfg'  
     225   CHARACTER(LEN=lc)                       :: cn_dimcfg = './cfg/dimension.cfg'  
    220226   CHARACTER(LEN=lc)                       :: cn_dumcfg = './cfg/dummy.cfg'  
    221227 
     
    248254   NAMELIST /namcfg/ &   !< configuration namelist 
    249255   &  cn_varcfg, &       !< variable configuration file 
     256   &  cn_dimcfg, &       !< dimension configuration file 
    250257   &  cn_dumcfg          !< dummy configuration file 
    251258 
     
    307314      ! get variable extra information 
    308315      CALL var_def_extra(TRIM(cn_varcfg)) 
     316 
     317      ! get dimension allowed 
     318      CALL dim_def_extra(TRIM(cn_dimcfg)) 
    309319 
    310320      ! get dummy variable 
     
    614624   CALL mpp_clean(tl_coord1) 
    615625   CALL mpp_clean(tl_coord0) 
     626   CALL var_clean_extra() 
    616627 
    617628   ! close log file 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/TOOLS/SIREN/src/create_boundary.F90

    r7261 r10115  
    2626!>  <br/>  
    2727!> \image html  boundary_NEATL36_70.png  
    28 !> \image latex boundary_NEATL36_70.png 
     28!> <center>\image latex boundary_NEATL36_70.png 
     29!> </center> 
    2930!> 
    3031!> @note  
     
    5152!>       - cn_varcfg : variable configuration file 
    5253!> (see ./SIREN/cfg/variable.cfg) 
     54!>       - cn_dimcfg : dimension configuration file. define dimensions allowed 
     55!> (see ./SIREN/cfg/dimension.cfg). 
    5356!>       - cn_dumcfg : useless (dummy) configuration file, for useless  
    5457!> dimension or variable (see ./SIREN/cfg/dummy.cfg). 
     
    161164!>             - cn_north='index1(width),first1:last1|index2,first2:last2' 
    162165!>             \image html  boundary_50.png  
    163 !>             \image latex boundary_50.png 
     166!>             <center>\image latex boundary_50.png 
     167!>             </center> 
    164168!>       - cn_south  : south boundary indices on fine grid 
    165169!>       - cn_east   : east  boundary indices on fine grid 
     
    198202!> @date January, 2016 
    199203!> - same process use for variable extracted or interpolated from input file. 
     204!> @date October, 2016 
     205!> - dimension to be used select from configuration file 
     206!> 
     207!> @todo 
     208!> - rewitre using meshmask instead of bathymetry and coordinates files. 
    200209!> 
    201210!> @note Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt) 
     
    383392 
    384393   ! namcfg 
    385    CHARACTER(LEN=lc)                       :: cn_varcfg = 'variable.cfg'  
    386    CHARACTER(LEN=lc)                       :: cn_dumcfg = 'dummy.cfg' 
     394   CHARACTER(LEN=lc)                       :: cn_varcfg = './cfg/variable.cfg'  
     395   CHARACTER(LEN=lc)                       :: cn_dimcfg = './cfg/dimension.cfg' 
     396   CHARACTER(LEN=lc)                       :: cn_dumcfg = './cfg/dummy.cfg' 
    387397 
    388398   ! namcrs 
     
    445455   NAMELIST /namcfg/ &  !< config namelist 
    446456   &  cn_varcfg, &       !< variable configuration file 
     457   &  cn_dimcfg, &       !< dimension configuration file 
    447458   &  cn_dumcfg          !< dummy configuration file 
    448459 
     
    527538      CALL var_def_extra(TRIM(cn_varcfg)) 
    528539 
     540      ! get dimension allowed 
     541      CALL dim_def_extra(TRIM(cn_dimcfg)) 
     542 
    529543      ! get dummy variable 
    530544      CALL var_get_dummy(TRIM(cn_dumcfg)) 
     
    761775                  ENDIF 
    762776               ENDDO 
    763                 
     777 
    764778               ! clean 
    765779               CALL var_clean(tl_var1) 
     
    879893                        CALL dom_del_extra( tl_segvar1(jvar+jj,jk,jl), & 
    880894                        &                   tl_dom1 ) 
     895 
    881896                        ! clean extra point information on coarse grid domain 
    882897                        CALL dom_clean_extra( tl_dom0 ) 
     
    11511166   CALL mpp_clean(tl_coord1) 
    11521167   CALL mpp_clean(tl_coord0) 
     1168   CALL var_clean_extra() 
    11531169 
    11541170   CALL multi_clean(tl_multi) 
     
    13821398      CALL extrap_fill_value( td_var ) 
    13831399 
    1384       ! interpolate Bathymetry 
     1400      ! interpolate variable 
    13851401      CALL interp_fill_value( td_var, id_rho(:), & 
    13861402      &                       id_offset=id_offset(:,:) ) 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/TOOLS/SIREN/src/create_coord.f90

    r7261 r10115  
    4444!>       - cn_varcfg : variable configuration file  
    4545!> (see ./SIREN/cfg/variable.cfg) 
     46!>       - cn_dimcfg : dimension configuration file. define dimensions allowed  
     47!> (see ./SIREN/cfg/dimension.cfg). 
    4648!>       - cn_dumcfg : useless (dummy) configuration file, for useless  
    4749!> dimension or variable (see ./SIREN/cfg/dummy.cfg). 
     
    7678!> 
    7779!>    * _nesting namelist (namnst)_:<br/> 
     80!>       you could define sub domain with coarse grid indices or with coordinates. 
     81!>       @note if coordinates defined, SIREN does not take into account indices. 
     82!> 
    7883!>       - in_imin0 : i-direction lower left  point indice  
    7984!> of coarse grid subdomain to be used 
     
    8489!>       - in_jmax0 : j-direction upper right point indice 
    8590!> of coarse grid subdomain to be used 
     91!>       - rn_lonmin0 : lower left  longitude of coarse grid subdomain to be used 
     92!>       - rn_lonmax0 : upper right longitude of coarse grid subdomain to be used 
     93!>       - rn_latmin0 : lower left  latitude  of coarse grid subdomain to be used 
     94!>       - rn_latmax0 : upper right latitude  of coarse grid subdomain to be used 
    8695!>       - in_rhoi  : refinement factor in i-direction 
    8796!>       - in_rhoj  : refinement factor in j-direction<br/> 
    8897!> 
    8998!>       \image html  grid_zoom_40.png  
    90 !>       \image latex grid_zoom_40.png 
     99!>       <center> \image latex grid_zoom_40.png  
     100!>       </center> 
    91101!> 
    92102!>    * _output namelist (namout)_: 
     
    102112!> @date September, 2015 
    103113!> - manage useless (dummy) variable, attributes, and dimension 
     114!> @date September, 2016 
     115!> - allow to use coordinate to define subdomain 
     116!> @date October, 2016 
     117!> - dimension to be used select from configuration file 
    104118!> 
    105119!> @note Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt) 
     
    139153   INTEGER(i4)                                          :: il_nvar 
    140154   INTEGER(i4)                                          :: il_ew 
     155   INTEGER(i4)                                          :: il_imin0 
     156   INTEGER(i4)                                          :: il_imax0 
     157   INTEGER(i4)                                          :: il_jmin0 
     158   INTEGER(i4)                                          :: il_jmax0 
     159 
    141160   INTEGER(i4)      , DIMENSION(ip_maxdim)              :: il_rho 
     161   INTEGER(i4)      , DIMENSION(2)                      :: il_index 
    142162   INTEGER(i4)      , DIMENSION(2,2,ip_npoint)          :: il_offset 
    143163 
     
    167187   ! namcfg 
    168188   CHARACTER(LEN=lc) :: cn_varcfg = './cfg/variable.cfg'  
     189   CHARACTER(LEN=lc) :: cn_dimcfg = './cfg/dimension.cfg'  
    169190   CHARACTER(LEN=lc) :: cn_dumcfg = './cfg/dummy.cfg' 
    170191 
     
    177198 
    178199   !namnst 
     200   REAL(sp)          :: rn_lonmin0 = -360. 
     201   REAL(sp)          :: rn_lonmax0 = -360. 
     202   REAL(sp)          :: rn_latmin0 = -360. 
     203   REAL(sp)          :: rn_latmax0 = -360. 
    179204   INTEGER(i4)       :: in_imin0 = 0 
    180205   INTEGER(i4)       :: in_imax0 = 0 
     
    195220   NAMELIST /namcfg/ &  !  config namelist 
    196221   &  cn_varcfg, &       !< variable configuration file 
     222   &  cn_dimcfg, &       !< dimension configuration file 
    197223   &  cn_dumcfg          !< dummy configuration file 
    198224 
     
    207233    
    208234   NAMELIST /namnst/ &  !  nesting namelist 
     235   &  rn_lonmin0, &     !< lower left  coarse grid longitude 
     236   &  rn_lonmax0, &     !< upper right coarse grid longitude 
     237   &  rn_latmin0, &     !< lower left  coarse grid latitude 
     238   &  rn_latmax0, &     !< upper right coarse grid latitude 
    209239   &  in_imin0,   &     !< i-direction lower left  point indice  
    210240   &  in_imax0,   &     !< i-direction upper right point indice 
     
    255285      CALL var_def_extra(TRIM(cn_varcfg)) 
    256286 
     287      ! get dimension allowed 
     288      CALL dim_def_extra(TRIM(cn_dimcfg)) 
     289 
    257290      ! get dummy variable 
    258291      CALL var_get_dummy(TRIM(cn_dumcfg)) 
     
    301334 
    302335   ! check nesting parameters 
    303    IF( in_imin0 < 0 .OR. in_imax0 < 0 .OR. in_jmin0 < 0 .OR. in_jmax0 < 0)THEN 
     336   il_index(:)=0 
     337   IF( rn_lonmin0 >= -180. .AND. rn_lonmin0 <= 360 .AND. & 
     338     & rn_latmin0 >= -90.  .AND. rn_latmin0 <= 90. )THEN 
     339 
     340      il_index(:)=grid_get_closest(tl_coord0, & 
     341         &                         REAL(rn_lonmin0,dp), REAL(rn_latmin0,dp), & 
     342         &                         cd_pos='ll')  
     343      il_imin0=il_index(1) 
     344      il_jmin0=il_index(2) 
     345   ELSE 
     346      il_imin0=in_imin0 
     347      il_jmin0=in_jmin0 
     348   ENDIF 
     349 
     350   il_index(:)=0 
     351   IF( rn_lonmax0 >= -180. .AND. rn_lonmax0 <= 360 .AND. & 
     352     & rn_latmax0 >= -90.  .AND. rn_latmax0 <= 90. )THEN 
     353 
     354      il_index(:)=grid_get_closest(tl_coord0, & 
     355         &                         REAL(rn_lonmax0,dp), REAL(rn_latmax0,dp), & 
     356         &                         cd_pos='ur')  
     357      il_imax0=il_index(1) 
     358      il_jmax0=il_index(2) 
     359   ELSE 
     360      il_imax0=in_imax0 
     361      il_jmax0=in_jmax0 
     362   ENDIF 
     363 
     364   ! forced indices for east west cyclic domain 
     365   IF( rn_lonmin0 == rn_lonmax0 .AND. & 
     366     & rn_lonmin0 /= -360. )THEN 
     367      il_imin0=0 
     368      il_imax0=0 
     369   ENDIF 
     370 
     371   IF( il_imin0 < 0 .OR. il_imax0 < 0 .OR. il_jmin0 < 0 .OR. il_jmax0 < 0)THEN 
    304372      CALL logger_fatal("CREATE COORD: invalid points indices."//& 
    305373      &  " check namelist "//TRIM(cl_namelist)) 
     
    318386 
    319387   ! check domain validity 
    320    CALL grid_check_dom(tl_coord0, in_imin0, in_imax0, in_jmin0, in_jmax0 ) 
     388   CALL grid_check_dom(tl_coord0, il_imin0, il_imax0, il_jmin0, il_jmax0 ) 
    321389 
    322390   ! compute domain 
    323391   tl_dom=dom_init( tl_coord0,         & 
    324    &                in_imin0, in_imax0,& 
    325    &                in_jmin0, in_jmax0 ) 
     392   &                il_imin0, il_imax0,& 
     393   &                il_jmin0, il_jmax0 ) 
    326394 
    327395   ! add extra band (if need be) to compute interpolation 
     
    425493   IF( il_attid == 0 )THEN 
    426494      il_ind=var_get_index(tl_fileout%t_var(:),'longitude') 
     495      IF( il_ind == 0 )THEN 
     496         il_ind=var_get_index(tl_fileout%t_var(:),'longitude_T') 
     497      ENDIF 
    427498      il_ew=grid_get_ew_overlap(tl_fileout%t_var(il_ind)) 
    428499      IF( il_ew >= 0 )THEN 
     
    447518 
    448519   CALL file_clean(tl_fileout) 
     520   CALL var_clean_extra() 
    449521 
    450522   ! close log file 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/TOOLS/SIREN/src/create_restart.f90

    r7261 r10115  
    4848!>       - cn_varcfg : variable configuration file 
    4949!> (see ./SIREN/cfg/variable.cfg) 
     50!>       - cn_dimcfg : dimension configuration file. define dimensions allowed 
     51!> (see ./SIREN/cfg/dimension.cfg). 
    5052!>       - cn_dumcfg : useless (dummy) configuration file, for useless  
    5153!> dimension or variable (see ./SIREN/cfg/dummy.cfg). 
     
    6365!>    * _vertical grid namelist (namzgr)_:<br/> 
    6466!>       - dn_pp_to_be_computed  : 
    65 !>       - dn_ppsur              : 
    66 !>       - dn_ppa0               : 
    67 !>       - dn_ppa1               : 
    68 !>       - dn_ppa2               :  
    69 !>       - dn_ppkth              : 
    70 !>       - dn_ppkth2             : 
    71 !>       - dn_ppacr              : 
    72 !>       - dn_ppacr2             : 
    73 !>       - dn_ppdzmin            : 
    74 !>       - dn_pphmax             : 
     67!>       - dn_ppsur              : coefficient to compute vertical grid 
     68!>       - dn_ppa0               : coefficient to compute vertical grid 
     69!>       - dn_ppa1               : coefficient to compute vertical grid 
     70!>       - dn_ppa2               : double tanh function parameter 
     71!>       - dn_ppkth              : coefficient to compute vertical grid 
     72!>       - dn_ppkth2             : double tanh function parameter 
     73!>       - dn_ppacr              : coefficient to compute vertical grid 
     74!>       - dn_ppacr2             : double tanh function parameter 
     75!>       - dn_ppdzmin            : minimum vertical spacing 
     76!>       - dn_pphmax             : maximum depth 
    7577!>       - in_nlevel             : number of vertical level 
    7678!> 
    7779!>    * _partial step namelist (namzps)_:<br/> 
    78 !>       - dn_e3zps_min          : 
    79 !>       - dn_e3zps_rat          :  
     80!>       - dn_e3zps_min          : minimum thickness of partial step level (meters) 
     81!>       - dn_e3zps_rat          : minimum thickness ratio of partial step level 
    8082!> 
    8183!>    * _variable namelist (namvar)_:<br/> 
     
    158160!> @date September, 2015 
    159161!> - manage useless (dummy) variable, attributes, and dimension 
     162!> @date October, 2016 
     163!> - dimension to be used select from configuration file 
    160164!> 
    161165!> @note Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt) 
     
    196200   INTEGER(i4)                                        :: il_status 
    197201   INTEGER(i4)                                        :: il_fileid 
     202   INTEGER(i4)                                        :: il_attid 
    198203   INTEGER(i4)                                        :: il_nvar 
    199    INTEGER(i4)                                        :: il_attid 
    200204   INTEGER(i4)                                        :: il_imin1 
    201205   INTEGER(i4)                                        :: il_imax1 
     
    249253 
    250254   ! namcfg 
    251    CHARACTER(LEN=lc)                       :: cn_varcfg = 'variable.cfg'  
    252    CHARACTER(LEN=lc)                       :: cn_dumcfg = 'dummy.cfg' 
     255   CHARACTER(LEN=lc)                       :: cn_varcfg = './cfg/variable.cfg'  
     256   CHARACTER(LEN=lc)                       :: cn_dimcfg = './cfg/dimension.cfg' 
     257   CHARACTER(LEN=lc)                       :: cn_dumcfg = './cfg/dummy.cfg' 
    253258 
    254259   ! namcrs 
     
    304309   NAMELIST /namcfg/ &  !< configuration namelist 
    305310   &  cn_varcfg, &      !< variable configuration file 
     311   &  cn_dimcfg, &      !< dimension configuration file 
    306312   &  cn_dumcfg         !< dummy configuration file 
    307313 
     
    309315   &  cn_coord0,  &     !< coordinate file 
    310316   &  in_perio0         !< periodicity index 
    311     
     317 
    312318   NAMELIST /namfin/ &  !< fine grid namelist 
    313319   &  cn_coord1,   &    !< coordinate file 
     
    336342   &  cn_varfile, &     !< list of variable file 
    337343   &  cn_varinfo        !< list of variable and interpolation method to be used. 
    338     
     344 
    339345   NAMELIST /namnst/ &  !< nesting namelist 
    340346   &  in_rhoi,    &     !< refinement factor in i-direction 
     
    387393      CALL var_def_extra(TRIM(cn_varcfg)) 
    388394 
     395      ! get dimension allowed 
     396      CALL dim_def_extra(TRIM(cn_dimcfg)) 
     397 
    389398      ! get dummy variable 
    390399      CALL var_get_dummy(TRIM(cn_dumcfg)) 
     
    402411      ! match variable with file 
    403412      tl_multi=multi_init(cn_varfile) 
    404        
     413  
    405414      READ( il_fileid, NML = namnst ) 
    406415      READ( il_fileid, NML = namout ) 
     
    592601               !- check grid coincidence 
    593602               IF( ll_sameGrid )THEN 
     603                  il_rho(:)=1 
    594604                  CALL grid_check_coincidence( tl_mpp, tl_coord1, & 
    595605                  &                            il_imin1, il_imax1, & 
     
    896906   CALL mpp_clean(tl_mppout) 
    897907   CALL mpp_clean(tl_coord1) 
     908   CALL var_clean_extra() 
    898909 
    899910   ! close log file 
     
    12001211            &        tl_depth%d_value(:,:,:,:) ) )THEN 
    12011212 
    1202                CALL logger_warn("CREATE BOUNDARY: depth value from "//& 
     1213               CALL logger_warn("CREATE RESTART: depth value from "//& 
    12031214               &  TRIM(td_mpp%c_name)//" not conform "//& 
    12041215               &  " to those from former file(s).") 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/TOOLS/SIREN/src/dimension.f90

    r7261 r10115  
    156156!> @date Spetember, 2015 
    157157!> - manage useless (dummy) dimension 
     158!> @date October, 2016 
     159!> - dimension allowed read in configuration file 
    158160!> 
    159161!> @note Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt) 
     
    171173 
    172174   PRIVATE :: cm_dumdim        !< dummy dimension array 
     175   PRIVATE :: cm_dimX          !< x dimension array 
     176   PRIVATE :: cm_dimY          !< y dimension array 
     177   PRIVATE :: cm_dimZ          !< z dimension array 
     178   PRIVATE :: cm_dimT          !< t dimension array 
    173179 
    174180   ! function and subroutine 
     
    188194   PUBLIC :: dim_get_dummy     !< fill dummy dimension array 
    189195   PUBLIC :: dim_is_dummy      !< check if dimension is defined as dummy dimension 
     196   PUBLIC :: dim_def_extra     !< read dimension configuration file, and save dimension allowed. 
    190197 
    191198   PRIVATE :: dim__reshape_2xyzt_dp ! reshape real(8) 4D array to ('x','y','z','t') 
     
    203210   PRIVATE :: dim__copy_unit        ! copy dimension structure 
    204211   PRIVATE :: dim__copy_arr         ! copy array of dimension structure 
     212   PRIVATE :: dim__is_allowed 
    205213 
    206214   TYPE TDIM !< dimension structure 
     
    215223   END TYPE 
    216224 
    217    CHARACTER(LEN=lc), DIMENSION(ip_maxdum), SAVE :: cm_dumdim !< dummy dimension 
     225   CHARACTER(LEN=lc), DIMENSION(ip_maxdumcfg), SAVE :: cm_dumdim !< dummy dimension 
     226   CHARACTER(LEN=lc), DIMENSION(ip_maxdimcfg), SAVE :: cm_dimX   !< x dimension 
     227   CHARACTER(LEN=lc), DIMENSION(ip_maxdimcfg), SAVE :: cm_dimY   !< y dimension 
     228   CHARACTER(LEN=lc), DIMENSION(ip_maxdimcfg), SAVE :: cm_dimZ   !< z dimension 
     229   CHARACTER(LEN=lc), DIMENSION(ip_maxdimcfg), SAVE :: cm_dimT   !< t dimension 
    218230 
    219231   INTERFACE dim_print 
     
    587599         cl_name=fct_lower(cd_name) 
    588600 
    589          IF( TRIM(cl_name) == 'x' )THEN 
     601         IF(     dim__is_allowed(TRIM(cl_name), cm_dimX(:)) )THEN 
    590602            dim_init%c_sname='x' 
    591          ELSEIF( TRIM(cl_name) == 'y' )THEN 
     603         ELSEIF( dim__is_allowed(TRIM(cl_name), cm_dimY(:)) )THEN 
    592604            dim_init%c_sname='y' 
    593          ELSEIF( TRIM(cl_name)== 'z' .OR. & 
    594          &       INDEX(cl_name,'depth')/=0 )THEN 
     605         ELSEIF( dim__is_allowed(TRIM(cl_name), cm_dimZ(:)) )THEN 
    595606            dim_init%c_sname='z' 
    596          ELSEIF( TRIM(cl_name)== 't' .OR. & 
    597          &       INDEX(cl_name,'time')/=0 )THEN 
     607         ELSEIF( dim__is_allowed(TRIM(cl_name), cm_dimT(:)) )THEN 
    598608            dim_init%c_sname='t' 
    599          ENDIF       
     609         ELSE 
     610            CALL logger_warn("DIM INIT: "//TRIM(cd_name)//& 
     611            " not allowed.") 
     612         ENDIF 
    600613 
    601614      ENDIF 
     
    14301443      ! loop indices 
    14311444      ! namelist 
    1432       CHARACTER(LEN=lc), DIMENSION(ip_maxdum) :: cn_dumvar 
    1433       CHARACTER(LEN=lc), DIMENSION(ip_maxdum) :: cn_dumdim 
    1434       CHARACTER(LEN=lc), DIMENSION(ip_maxdum) :: cn_dumatt 
     1445      CHARACTER(LEN=lc), DIMENSION(ip_maxdumcfg) :: cn_dumvar 
     1446      CHARACTER(LEN=lc), DIMENSION(ip_maxdumcfg) :: cn_dumdim 
     1447      CHARACTER(LEN=lc), DIMENSION(ip_maxdumcfg) :: cn_dumatt 
    14351448 
    14361449      !---------------------------------------------------------------- 
     
    14931506 
    14941507      dim_is_dummy=.FALSE. 
    1495       DO ji=1,ip_maxdum 
     1508      DO ji=1,ip_maxdumcfg 
    14961509         IF( fct_lower(td_dim%c_name) == fct_lower(cm_dumdim(ji)) )THEN 
    14971510            dim_is_dummy=.TRUE. 
     
    15011514 
    15021515   END FUNCTION dim_is_dummy 
     1516   !------------------------------------------------------------------- 
     1517   !> @brief This subroutine read dimension configuration file,  
     1518   !> and fill array of dimension allowed. 
     1519   !> 
     1520   !> @author J.Paul 
     1521   !> @date Ocotber, 2016 - Initial Version 
     1522   ! 
     1523   !> @param[in] cd_file input file (dimension configuration file) 
     1524   !------------------------------------------------------------------- 
     1525   SUBROUTINE dim_def_extra( cd_file ) 
     1526      IMPLICIT NONE 
     1527 
     1528      ! Argument       
     1529      CHARACTER(LEN=*), INTENT(IN) :: cd_file 
     1530 
     1531      ! local variable 
     1532      INTEGER(i4)   :: il_fileid 
     1533      INTEGER(i4)   :: il_status 
     1534 
     1535      LOGICAL       :: ll_exist 
     1536       
     1537      ! loop indices 
     1538      ! namelist 
     1539      CHARACTER(LEN=lc), DIMENSION(ip_maxdimcfg) :: cn_dimX = ''  
     1540      CHARACTER(LEN=lc), DIMENSION(ip_maxdimcfg) :: cn_dimY = '' 
     1541      CHARACTER(LEN=lc), DIMENSION(ip_maxdimcfg) :: cn_dimZ = '' 
     1542      CHARACTER(LEN=lc), DIMENSION(ip_maxdimcfg) :: cn_dimT = '' 
     1543 
     1544      !---------------------------------------------------------------- 
     1545      NAMELIST /namdim/ &   !< dimension namelist 
     1546      &  cn_dimX, &       !< x dimension name allowed 
     1547      &  cn_dimY, &       !< y dimension name allowed 
     1548      &  cn_dimZ, &       !< z dimension name allowed 
     1549      &  cn_dimT          !< t dimension name allowed 
     1550 
     1551      !---------------------------------------------------------------- 
     1552 
     1553      ! init 
     1554      cm_dimX(:)='' 
     1555      cm_dimY(:)='' 
     1556      cm_dimZ(:)='' 
     1557      cm_dimT(:)='' 
     1558 
     1559      ! read config variable file 
     1560      INQUIRE(FILE=TRIM(cd_file), EXIST=ll_exist) 
     1561      IF( ll_exist )THEN 
     1562 
     1563         il_fileid=fct_getunit() 
     1564    
     1565         OPEN( il_fileid, FILE=TRIM(cd_file), & 
     1566         &                FORM='FORMATTED',       & 
     1567         &                ACCESS='SEQUENTIAL',    & 
     1568         &                STATUS='OLD',           & 
     1569         &                ACTION='READ',          & 
     1570         &                IOSTAT=il_status) 
     1571         CALL fct_err(il_status) 
     1572         IF( il_status /= 0 )THEN 
     1573            CALL logger_fatal("DIM GET DUMMY: opening "//TRIM(cd_file)) 
     1574         ENDIF 
     1575    
     1576         READ( il_fileid, NML = namdim ) 
     1577         cm_dimX(:)=cn_dimX(:) 
     1578         cm_dimY(:)=cn_dimY(:) 
     1579         cm_dimZ(:)=cn_dimZ(:) 
     1580         cm_dimT(:)=cn_dimT(:) 
     1581 
     1582         CLOSE( il_fileid ) 
     1583 
     1584      ELSE 
     1585 
     1586         CALL logger_fatal("DIM DEF EXTRA: can't find configuration"//& 
     1587            &              " file "//TRIM(cd_file)) 
     1588 
     1589      ENDIF          
     1590 
     1591   END SUBROUTINE dim_def_extra 
     1592   !------------------------------------------------------------------- 
     1593   !> @brief This function check if dimension is allowed, i.e defined  
     1594   !> in dimension configuraton file 
     1595   !> 
     1596   !> @author J.Paul 
     1597   !> @date OCTOber, 2016 - Initial Version 
     1598   ! 
     1599   !> @param[in] cd_name dimension name 
     1600   !> @param[in] cd_dim  array dimension name allowed 
     1601   !> @return true if dimension is allowed  
     1602   !------------------------------------------------------------------- 
     1603   FUNCTION dim__is_allowed(cd_name, cd_dim) 
     1604      IMPLICIT NONE 
     1605 
     1606      ! Argument 
     1607      CHARACTER(LEN=*),               INTENT(IN) :: cd_name 
     1608      CHARACTER(LEN=*), DIMENSION(:), INTENT(IN) :: cd_dim 
     1609       
     1610      ! function 
     1611      LOGICAL :: dim__is_allowed 
     1612       
     1613      ! loop indices 
     1614      INTEGER(i4) :: ji 
     1615      !---------------------------------------------------------------- 
     1616 
     1617      dim__is_allowed=.FALSE. 
     1618      ji=1 
     1619      DO WHILE( TRIM(cd_dim(ji)) /= '' ) 
     1620         IF( TRIM(fct_lower(cd_name)) == TRIM(fct_lower(cd_dim(ji))) )THEN 
     1621            dim__is_allowed=.TRUE. 
     1622            EXIT 
     1623         ENDIF 
     1624         ji=ji+1 
     1625      ENDDO 
     1626 
     1627   END FUNCTION dim__is_allowed 
     1628 
    15031629END MODULE dim 
    15041630 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/TOOLS/SIREN/src/docsrc/2_quickstart.md

    r7261 r10115  
    5959&namcfg 
    6060   cn_varcfg = "PATH/NEMOGCM/TOOLS/SIREN/cfg/variable.cfg" 
     61   cn_dimcfg = "PATH/NEMOGCM/TOOLS/SIREN/cfg/dimension.cfg" 
    6162/ 
    6263 
     
    8384/ 
    8485~~~~~~~~~~~ 
     86 
     87@note you could define sub domain with coarse grid indices or with coordinates. 
    8588 
    8689Let's get describe this namelist.<br/> 
     
    9093empty, as done here.<br/> This will create a log file named *create_coord.log* 
    9194 
    92 The **namcfg** sub-namelist defines where found SIREN configuration file.<br/> 
    93 This configuration file defines standard name, default interpolation method, 
     95The **namcfg** sub-namelist defines where found SIREN configuration files.<br/> 
     96- The variable configuration file defines standard name, default interpolation method, 
    9497axis,... to be used for some known variables.<br/> 
    9598Obviously, you could add other variables to those already list, in this file. 
    96  
    97 @note You could find the generic version of *variable.cfg* in the directory *NEMOGCM/TOOLS/SIREN/cfg*. 
     99- The dimension configuration file defines dimensions allowed. 
     100 
     101@note You could find the generic version of those configuration files in the directory *NEMOGCM/TOOLS/SIREN/cfg*. 
    98102 
    99103The **namcrs** sub-namelist set parameters of the wide 
    100 coordinates file,<br/> as path to find it, and NEMO periodicity of the wide grid.<br/> 
     104coordinates file, as path to find it, and NEMO periodicity of the wide grid.<br/> 
    101105 
    102106@note the NEMO periodicity could be choose between 0 to 6: 
     
    130134 
    131135The **namnst** sub-namelist defines the subdomain to be used as well as refinment factor.<br/> 
    132 @note Subdomain is defined by indices of the coarse/wide grid.<br/> 
    133136 
    134137<ul> 
    135 <li>you can select area quite every where (excepted too close from the North 
    136 pole), and use the refinment factor you want.</li> 
    137  
    138 ~~~~~~~~~~~ 
    139 &namvar 
     138<li> you could define sub domain with coarse grid indices</li>  
     139 
     140~~~~~~~~~~~ 
     141&namnst 
    140142   in_imin0 = 1070 
    141143   in_imax0 = 1072 
    142144   in_jmin0 = 607 
    143145   in_jmax0 = 609 
     146/ 
     147~~~~~~~~~~~ 
     148 
     149<li>or with coordinates</li> 
     150 
     151~~~~~~~~~~~ 
     152&namnst 
     153   rn_lonmin0 = -97.9  
     154   rn_lonmax0 = -62.3  
     155   rn_latmin0 =   7.7 
     156   rn_latmax0 =  30.8 
     157/ 
     158~~~~~~~~~~~ 
     159 
     160<li>you can select area quite every where (excepted too close from the North 
     161pole), and use the refinment factor you want.</li> 
     162 
     163~~~~~~~~~~~ 
     164&namnst 
     165   in_imin0 = 1070 
     166   in_imax0 = 1072 
     167   in_jmin0 = 607 
     168   in_jmax0 = 609 
    144169 
    145170   in_rhoi = 2 
     
    148173~~~~~~~~~~~ 
    149174@image html grid_zoom_60.png 
    150 @image latex grid_zoom_40.png 
     175<center>@image latex grid_zoom_40.png 
     176</center> 
    151177<!-- @note ghost cells all around the grid are not shown here. --> 
    152178 
     179 
     180 
    153181<li>you can select area crossing the east-west overlap of the global ORCA grid.</li> 
    154182 
    155183~~~~~~~~~~~ 
    156 &namvar           
     184&namnst           
    157185   in_imin0 = 1402  
    158186   in_imax0 = 62 
     
    165193~~~~~~~~~~~ 
    166194@image html grid_glob_over_30.png 
    167 @image latex grid_glob_over_20.png 
     195<center>@image latex grid_glob_over_20.png 
     196</center> 
    168197<!-- @note in blue, the east-west overlap band of ORCA grid. --> 
    169198 
     
    171200 
    172201~~~~~~~~~~~ 
    173 &namvar 
     202&namnst 
    174203   in_imin0 = 0 
    175204   in_imax0 = 0 
     
    182211~~~~~~~~~~~ 
    183212@image html grid_glob_band_30.png 
    184 @image latex grid_glob_band_20.png 
     213<center>@image latex grid_glob_band_20.png 
     214</center> 
    185215 
    186216</ul> 
     
    215245&namcfg 
    216246   cn_varcfg = "PATH/NEMOGCM/TOOLS/SIREN/cfg/variable.cfg" 
     247   cn_dimcfg = "PATH/NEMOGCM/TOOLS/SIREN/cfg/dimension.cfg" 
    217248/ 
    218249 
     
    249280coordinates file.<br/> 
    250281@note in all SIREN namelist: <br/> 
    251 0 referred to the coarse/wide grid.<br/> 
    252 1 referred to the fine grid. 
     282**0** referred to the coarse/wide grid.<br/> 
     283**1** referred to the fine grid. 
    253284 
    254285In the same way, the **namfin** sub-namelist  set parameters of the fine 
    255286coordinates file.<br/> 
    256287@note in this namelist example, there is no need to set the variable *in_perio1* to define the NEMO 
    257 periodicity of the fine grid.<br/> Indeed, if this variable is not inform, SIREN tries to read it in the attributes of the file.<br/>  
    258 So if you created the fine coordinates with SIREN, you do not have to 
     288periodicity of the fine grid. Indeed, if this variable is not inform, SIREN tries to read it  
     289in the global attributes of the file. So if you created the fine coordinates with SIREN, you do not have to 
    259290fill it. In other case, you should add it to the namelist. 
    260291 
     
    296327# Merge bathymetry file # {#merge} 
    297328 
    298 The Bathymetry you build differs from the wider one.<br/> 
     329The Bathymetry you build, may differ from the wider one.<br/> 
    299330To avoid issue with boundaries forcing fields, you should merge fine and coarse Bathymetry on boundaries.<br/> 
    300331SIREN allows you to do this.<br/> 
     
    312343&namcfg 
    313344   cn_varcfg = "PATH/NEMOGCM/TOOLS/SIREN/cfg/variable.cfg" 
     345   cn_dimcfg = "PATH/NEMOGCM/TOOLS/SIREN/cfg/dimension.cfg" 
    314346/ 
    315347 
     
    348380 
    349381The **nambdy** sub-namelist defines the subdomain boundaries.<br/> 
    350 By default SIREN tries to create boundaries for each side. Boundary exist if there is at least one sea point on the second row of each side.<br/> 
    351 So you could let this namelist empty. 
    352  
     382By default SIREN tries to create boundaries for each side. Boundary exist if there is at least one sea point on the second row of each side. So you could let this namelist empty. 
    353383@sa For more information about boundaries, see @ref boundary 
    354384 
     
    365395time step). Or you could start from "partial" information about ocean state (Temperature and Salinity for example). 
    366396 
    367 Siren allows you to create both of those initial state.<br/> 
     397SIREN allows you to create both of those initial state.<br/> 
    368398To create the initial state, you have to run:<br/> 
    369399~~~~~~~~~~~~~~~~~~ 
     
    372402 
    373403Here after is an example of namelist for *create_restart.exe*.<br/> 
    374 In this example, you create an initial state split on 81 "processors", and named restar_out.nc.<br/> 
     404In this example, you create an initial state split on 81 "processors", and named restart_out.nc.<br/> 
    375405The initial state is composed of temperature and salinity refined from an extraction of GLORYS fields. 
    376406~~~~~~~~~~~~~~~~~~ 
     
    380410&namcfg 
    381411   cn_varcfg = "PATH/NEMOGCM/TOOLS/SIREN/cfg/variable.cfg" 
     412   cn_dimcfg = "PATH/NEMOGCM/TOOLS/SIREN/cfg/dimension.cfg" 
    382413/ 
    383414 
     
    479510&namcfg 
    480511   cn_varcfg = "PATH/NEMOGCM/TOOLS/SIREN/cfg/variable.cfg" 
     512   cn_dimcfg = "PATH/NEMOGCM/TOOLS/SIREN/cfg/dimension.cfg" 
    481513/ 
    482514 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/TOOLS/SIREN/src/docsrc/5_changeLog.md

    r7261 r10115  
    33@tableofcontents 
    44 
    5 # Release 
    6 Initial release (2016-04-11) 
     5# Release $Date:: 2016-11-16 #$ ($Revision: 7235 $) 
     6 
     7## New Features 
     8- merge_bathy.f90: allow to choose the number of boundary point with coarse grid value. 
     9- dimension.f90: dimension allowed read in configuration file. 
     10- variable.f90: allow to add scalar value. 
     11## Changes 
     12- create_coord.f90: allow to define sub domain with coarse grid indices or coordinates. 
     13- grid.f90:grid__get_closest_str: add function to get closest grid point using coarse grid coordinates strucutre. 
     14- iom_cdf.f90:iom_cdf__get_info: define cdf4 as cdf. 
     15- variable.f90: add subroutine to clean global array of extra information, and define logical for variable to be used. 
     16- create_coord.f90: dimension to be used select from configuration file. 
     17- create_bathy.f90: dimension to be used select from configuration file. 
     18- merge_bathy.f90: dimension to be used select from configuration file. 
     19- create_boundary.f90: dimension to be used select from configuration file. 
     20- create_restart.f90: dimension to be used select from configuration file. 
     21## Bug fixes 
     22- boundary.f90:boundary_check: take into account that boundaries are compute on T point, but expressed on U,V point. 
     23- grid.f90:grid__get_closest_str: use max of zero and east-west overlap instead of east-west overlap. 
     24- mpp.f90: compare index to td_lay number of proc instead of td_mpp (bug fix) . 
     25- iom_cdf.f90 : check if attribute cl_value is not bug (in read file) 
     26 
     27# Release 2016-07-01 
    728 
    829## Changes 
    930## New Features 
    1031## Bug fixes 
     32 - correct check of boundary indices 
     33 
     34# Initial Release 2016-04-11 
    1135 
    1236 <HR> 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/TOOLS/SIREN/src/docsrc/6_perio.md

    r7261 r10115  
    66<dd>ghost cells (solid walls) are imposed at all model boundaries.</dd>  
    77@image html perio0_20.png  
    8 @latexonly 
    9 \begin{center} 
    10 \includegraphics{perio0_20.png} 
    11 \end{center} 
    12 @endlatexonly 
     8<center>@image latex perio0_20.png  
     9</center> 
    1310<dt>cyclic east-west boundary (in_perio=1)</dt> 
    1411<dd>first and last rows are closed, whilst the first column is set to the value of the last-but-one column and the last column to the value of the second one.</dd>   
    1512@image html perio1_20.png  
    16 @latexonly 
    17 \begin{center} 
    18 \includegraphics{perio1_20.png} 
    19 \end{center} 
    20 @endlatexonly 
     13<center>@image latex perio1_20.png  
     14</center> 
    2115<dt>symmetric boundary condition across the equator. (in_perio=2)</dt> 
    2216<dd>last row, and first and last columns are closed. </dd>  
    2317@image html perio2_20.png  
    24 @latexonly 
    25 \begin{center} 
    26 \includegraphics{perio2_20.png} 
    27 \end{center} 
    28 @endlatexonly 
     18<center>@image latex perio2_20.png  
     19</center> 
    2920<dt>North fold boundary with a T -point pivot (in_perio=3)</dt> 
    3021<dd>first row, and first and last columns are closed. </dd>  
    3122@image html perio3_20.png  
    32 @latexonly 
    33 \begin{center} 
    34 \includegraphics{perio3_20.png} 
    35 \end{center} 
    36 @endlatexonly 
     23<center>@image latex perio3_20.png  
     24</center> 
    3725<dt>North fold boundary with a T -point pivot and cyclic east-west boundary (in_perio=4)</dt> 
    3826<dd>first row is closed. The first column is set to the value of the last-but-one column and the last column to the value of the second one. </dd>  
    3927@image html perio4_20.png  
    40 @latexonly 
    41 \begin{center} 
    42 \includegraphics{perio4_20.png} 
    43 \end{center} 
    44 @endlatexonly 
     28<center>@image latex perio4_20.png  
     29</center> 
    4530<dt>North fold boundary with a F -point pivot (in_perio=5)</dt> 
    4631<dd>first row, and first and last columns are closed. </dd>  
    4732@image html perio5_20.png  
    48 @latexonly 
    49 \begin{center} 
    50 \includegraphics{perio5_20.png} 
    51 \end{center} 
    52 @endlatexonly 
     33<center>@image latex perio5_20.png  
     34</center> 
    5335<dt>North fold boundary with a F -point pivot and cyclic east-west boundary (in_perio=6)</dt> 
    5436<dd>first row is closed. The first column is set to the value of the last-but-one column and the last column to the value of the second one.</dd>  
    5537@image html perio6_20.png  
    56 @image html perio5_20.png  
    57 @latexonly 
    58 \begin{center} 
    59 \includegraphics{perio6_20.png} 
    60 \end{center} 
    61 @endlatexonly 
     38<center>@image latex perio6_20.png  
     39</center> 
    6240</dl> 
    6341@sa For more information about NEMO periodicity, see _Model Boundary Condition_ chapter in [NEMO documentation](http://www.nemo-ocean.eu/About-NEMO/Reference-manuals)) 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/TOOLS/SIREN/src/global.f90

    r7261 r10115  
    6767 
    6868   INTEGER(i4)                             , PARAMETER :: ip_maxvar =200   !< maximum number of variable 
    69    INTEGER(i4)                             , PARAMETER :: ip_maxmtx =100   !< matrix variable maximum dimension (cf create_bathy) 
    70    INTEGER(i4)                             , PARAMETER :: ip_maxseg =50    !< maximum number of segment for each boundary 
     69   INTEGER(i4)                             , PARAMETER :: ip_maxmtx =50    !< matrix variable maximum dimension (cf create_bathy) 
     70   INTEGER(i4)                             , PARAMETER :: ip_maxseg =10    !< maximum number of segment for each boundary 
    7171 
    7272   INTEGER(i4)                             , PARAMETER :: ip_nsep=2        !< number of separator listed 
     
    101101   REAL(dp)                                , PARAMETER :: dp_fill_i4=NF90_FILL_INT    !< INT fill value 
    102102   REAL(dp)                                , PARAMETER :: dp_fill_sp=NF90_FILL_FLOAT  !< real fill value 
    103    REAL(dp)                                , PARAMETER :: dp_fill=NF90_FILL_DOUBLE !< double fill value 
     103   REAL(dp)                                , PARAMETER :: dp_fill=NF90_FILL_DOUBLE    !< double fill value 
    104104 
    105105   INTEGER(i4)                             , PARAMETER :: ip_npoint=4 
     
    112112 
    113113 
     114   INTEGER(i4)                             , PARAMETER :: ip_maxdimcfg=10 !< maximum allowed dimension in configuration file 
    114115   INTEGER(i4)                             , PARAMETER :: ip_maxdim=4 
    115116   INTEGER(i4)                             , PARAMETER :: jp_I=1 
     
    131132   INTEGER(i4), PARAMETER :: jp_west =4 
    132133 
    133    INTEGER(i4)                             , PARAMETER :: ip_maxdum = 10 !< maximum dummy variable, dimension, attribute 
     134   INTEGER(i4)                             , PARAMETER :: ip_maxdumcfg = 10 !< maximum dummy variable, dimension, or attribute  
     135                                                                            !< in configuration file 
    134136 
    135137END MODULE global 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/TOOLS/SIREN/src/grid.f90

    r7261 r10115  
    218218!> @date February, 2015 
    219219!> - add function grid_fill_small_msk to fill small domain inside bigger one 
    220 !> @February, 2016 
     220!> @date February, 2016 
    221221!> - improve way to check coincidence (bug fix) 
    222222!> - manage grid cases for T,U,V or F point, with even or odd refinment (bug fix) 
     223!> @date April, 2016 
     224!> - add function to get closest grid point using coarse grid coordinates strucutre  
    223225! 
    224226!> @note Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt) 
     
    271273   PRIVATE :: grid__get_coarse_index_cc ! - using coarse and fine grid array of lon,lat 
    272274 
     275                                     ! return closest coarse grid point from another point 
     276   PRIVATE :: grid__get_closest_str    ! - using coarse grid coordinates strucutre 
     277   PRIVATE :: grid__get_closest_arr    ! - using coarse grid array of lon,lat 
     278 
    273279                                     ! get offset between fine and coarse grid 
    274280   PRIVATE :: grid__get_fine_offset_ff ! - using coarse and fine grid coordinates files 
     
    333339      MODULE PROCEDURE grid__get_ghost_mpp 
    334340   END INTERFACE  grid_get_ghost 
     341 
     342   INTERFACE  grid_get_closest 
     343      MODULE PROCEDURE grid__get_closest_str 
     344      MODULE PROCEDURE grid__get_closest_arr 
     345   END INTERFACE  grid_get_closest 
    335346 
    336347   INTERFACE  grid_get_coarse_index 
     
    467478   !------------------------------------------------------------------- 
    468479   !> @brief This subroutine get information about global domain, given mpp 
    469    !> strucutre. 
     480   !> structure. 
    470481   !> 
    471482   !> @details 
     
    536547 
    537548      SELECT CASE(il_perio) 
    538       CASE(3,4) 
    539          il_pivot=1 
    540       CASE(5,6) 
    541          il_pivot=0 
    542       CASE(0,1,2) 
    543          il_pivot=1 
     549         CASE(3,4) 
     550            il_pivot=1 
     551         CASE(5,6) 
     552            il_pivot=0 
     553         CASE(0,1,2) 
     554            il_pivot=1 
    544555      END SELECT 
    545556 
     
    13651376            END SELECT 
    13661377         ELSE 
     1378            il_perio=-1 
    13671379            ! check periodicity 
    13681380            IF(ANY(td_var%d_value(   1     ,:,1,1)/=td_var%d_fill).OR.& 
     
    16561668   !> else return the size of the ovarlap band. 
    16571669   !> East-West overlap is computed comparing longitude value of the   
    1658    !> South" part of the domain, to avoid  north fold boundary. 
     1670   !> South part of the domain, to avoid  north fold boundary. 
    16591671   !> 
    16601672   ! 
     
    16631675   !> @date October, 2014 
    16641676   !> - work on mpp file structure instead of file structure 
     1677   !> @date October, 2016 
     1678   !> - check longitude as longname 
    16651679   !> 
    16661680   !> @param[in] td_lon longitude variable structure  
     
    17121726            ALLOCATE( dl_vare(il_jmax-il_jmin+1) ) 
    17131727            ALLOCATE( dl_varw(il_jmax-il_jmin+1) ) 
    1714              
     1728 
    17151729            dl_vare(:)=dl_value(il_east,il_jmin:il_jmax) 
    17161730            dl_varw(:)=dl_value(il_west,il_jmin:il_jmax) 
    1717              
    1718             IF( .NOT.(  ALL(dl_vare(:)==td_var%d_fill) .AND. & 
    1719             &           ALL(dl_varw(:)==td_var%d_fill) ) )THEN 
    1720           
    1721                IF( TRIM(td_var%c_stdname) == 'longitude' )THEN 
     1731 
     1732            IF( .NOT.( ALL(dl_vare(:)==td_var%d_fill) .AND. & 
     1733            &          ALL(dl_varw(:)==td_var%d_fill) ) )THEN 
     1734 
     1735               IF( TRIM(td_var%c_stdname) == 'longitude' .OR. & 
     1736                 & SCAN( TRIM(td_var%c_longname), 'longitude') == 0 )THEN 
    17221737                  WHERE( dl_value(:,:) > 180._dp .AND. & 
    17231738                  &      dl_value(:,:) /= td_var%d_fill )  
     
    17431758                     ELSE 
    17441759                        dl_vare(:)=dl_value(il_east-ji,il_jmin:il_jmax) 
    1745                          
     1760 
    17461761                        IF( ALL( dl_varw(:) == dl_vare(:) ) )THEN 
    17471762                           grid__get_ew_overlap_var=ji+1 
     
    17691784   !> else return the size of the ovarlap band. 
    17701785   !> East-West overlap is computed comparing longitude value of the   
    1771    !> South" part of the domain, to avoid  north fold boundary. 
     1786   !> South part of the domain, to avoid  north fold boundary. 
    17721787   !> 
    17731788   !> @author J.Paul 
    17741789   !> @date October, 2014 - Initial Version 
     1790   !> @date October, 2016 
     1791   !> - check varid for longitude_T 
    17751792   !> 
    17761793   !> @param[in] td_file file structure  
     
    17931810      !---------------------------------------------------------------- 
    17941811 
    1795       il_varid=var_get_index(td_file%t_var(:), 'longitude') 
     1812      il_varid=var_get_id(td_file%t_var(:), 'longitude', 'longitude_T') 
    17961813      IF( il_varid /= 0 )THEN 
    17971814         ! read longitude on boundary 
    1798          tl_var=iom_read_var(td_file, 'longitude') 
     1815         tl_var=iom_read_var(td_file, il_varid) 
    17991816      ELSE 
    18001817         DO ji=1,td_file%i_nvar 
     
    18191836   !> else return the size of the ovarlap band. 
    18201837   !> East-West overlap is computed comparing longitude value of the   
    1821    !> South" part of the domain, to avoid  north fold boundary. 
     1838   !> South part of the domain, to avoid  north fold boundary. 
    18221839   !> 
    18231840   ! 
     
    18261843   !> @date October, 2014 
    18271844   !> - work on mpp file structure instead of file structure 
     1845   !> @date October, 2016 
     1846   !> - check varid for longitude_T 
    18281847   !> 
    18291848   !> @param[in] td_mpp mpp structure  
     
    18501869 
    18511870      ! read longitude on boundary 
    1852       il_varid=var_get_index(td_mpp%t_proc(1)%t_var(:),'longitude') 
     1871      il_varid=var_get_id(td_mpp%t_proc(1)%t_var(:),'longitude', 'longitude_T') 
    18531872      IF( il_varid /= 0 )THEN 
    1854          tl_var=iom_mpp_read_var(td_mpp, 'longitude') 
     1873         tl_var=iom_mpp_read_var(td_mpp, il_varid) 
    18551874      ELSE 
    18561875         DO ji=1,td_mpp%t_proc(1)%i_nvar 
     
    18661885         grid__get_ew_overlap_mpp=il_ew 
    18671886      ENDIF 
    1868  
    18691887 
    18701888      ! clean 
     
    30203038   !> 
    30213039   !> @author J.Paul 
     3040   !> @date April, 2016 - Initial Version 
     3041   !> @date October, 2016 
     3042   !> - use max of zero and east-west overlap instead of east-west overlap 
     3043   !> 
     3044   !> @param[in] td_coord0 coarse grid coordinate mpp structure 
     3045   !> @param[in] dd_lon1   fine   grid longitude 
     3046   !> @param[in] dd_lat1   fine   grid latitude 
     3047   !> @param[in] cd_pos    relative position of grid point from point  
     3048   !> @param[in] dd_fill   fill value 
     3049   !> @return coarse grid indices of closest point of fine grid point 
     3050   !------------------------------------------------------------------- 
     3051   FUNCTION grid__get_closest_str( td_coord0, dd_lon1, dd_lat1, cd_pos, dd_fill ) & 
     3052   &  RESULT(id_res) 
     3053 
     3054      IMPLICIT NONE 
     3055      ! Argument 
     3056      TYPE(TMPP )     , INTENT(IN) :: td_coord0 
     3057      REAL(dp),         INTENT(IN) :: dd_lon1 
     3058      REAL(dp),         INTENT(IN) :: dd_lat1 
     3059      CHARACTER(LEN=*), INTENT(IN), OPTIONAL :: cd_pos 
     3060      REAL(dp),         INTENT(IN), OPTIONAL :: dd_fill 
     3061 
     3062      ! function 
     3063      INTEGER(i4), DIMENSION(2) :: id_res 
     3064 
     3065      ! local variable 
     3066      CHARACTER(LEN=lc)                        :: cl_point 
     3067      CHARACTER(LEN=lc)                        :: cl_name 
     3068 
     3069      INTEGER(i4)                              :: il_ind 
     3070      INTEGER(i4)                              :: il_ew 
     3071 
     3072      REAL(dp)   , DIMENSION(:,:), ALLOCATABLE :: dl_lon0 
     3073      REAL(dp)   , DIMENSION(:,:), ALLOCATABLE :: dl_lat0 
     3074 
     3075      TYPE(TVAR)                               :: tl_lon0 
     3076      TYPE(TVAR)                               :: tl_lat0 
     3077      TYPE(TMPP)                               :: tl_coord0 
     3078      !---------------------------------------------------------------- 
     3079 
     3080      id_res(:)=-1 
     3081      cl_point='T' 
     3082 
     3083      ! copy structure 
     3084      tl_coord0=mpp_copy(td_coord0) 
     3085 
     3086      IF( .NOT. ASSOCIATED(tl_coord0%t_proc) )THEN 
     3087 
     3088         CALL logger_error("GRID GET CLOSEST: decompsition of mpp "//& 
     3089         &  "file "//TRIM(tl_coord0%c_name)//" not defined." ) 
     3090 
     3091      ELSE 
     3092 
     3093         ! open mpp files 
     3094         CALL iom_mpp_open(tl_coord0) 
     3095  
     3096         ! read coarse longitue and latitude 
     3097         WRITE(cl_name,*) 'longitude_'//TRIM(cl_point) 
     3098         il_ind=var_get_id(tl_coord0%t_proc(1)%t_var(:), cl_name) 
     3099         IF( il_ind == 0 )THEN 
     3100            CALL logger_warn("GRID GET CLOSEST: no variable "//& 
     3101            &  TRIM(cl_name)//"in file "//TRIM(tl_coord0%c_name)//". & 
     3102            &  try to use longitude.") 
     3103            WRITE(cl_name,*) 'longitude' 
     3104         ENDIF 
     3105         tl_lon0=iom_mpp_read_var(tl_coord0, TRIM(cl_name)) 
     3106  
     3107         WRITE(cl_name,*) 'latitude_'//TRIM(cl_point) 
     3108         il_ind=var_get_id(tl_coord0%t_proc(1)%t_var(:), cl_name) 
     3109         IF( il_ind == 0 )THEN 
     3110            CALL logger_warn("GRID GET CLOSEST: no variable "//& 
     3111            &  TRIM(cl_name)//"in file "//TRIM(tl_coord0%c_name)//". & 
     3112            &  try to use latitude.") 
     3113            WRITE(cl_name,*) 'latitude' 
     3114         ENDIF 
     3115         tl_lat0=iom_mpp_read_var(tl_coord0, TRIM(cl_name)) 
     3116 
     3117         ! close mpp files 
     3118         CALL iom_mpp_close(tl_coord0) 
     3119 
     3120         il_ew=MAX(0,tl_coord0%i_ew) 
     3121         ALLOCATE(dl_lon0(tl_coord0%t_dim(jp_I)%i_len-il_ew, & 
     3122            &             tl_coord0%t_dim(jp_J)%i_len) )              
     3123         ALLOCATE(dl_lat0(tl_coord0%t_dim(jp_I)%i_len-il_ew, & 
     3124            &             tl_coord0%t_dim(jp_J)%i_len) ) 
     3125 
     3126         dl_lon0(:,:)=tl_lon0%d_value(il_ew+1:,:,1,1) 
     3127         dl_lat0(:,:)=tl_lat0%d_value(il_ew+1:,:,1,1) 
     3128 
     3129         id_res(:)=grid_get_closest( dl_lon0, dl_lat0, dd_lon1, dd_lat1, cd_pos, dd_fill ) 
     3130 
     3131         DEALLOCATE(dl_lon0, dl_lat0) 
     3132         CALL var_clean(tl_lon0) 
     3133         CALL var_clean(tl_lat0) 
     3134         CALL mpp_clean(tl_coord0) 
     3135 
     3136      ENDIF 
     3137 
     3138   END FUNCTION  grid__get_closest_str 
     3139   !------------------------------------------------------------------- 
     3140   !> @brief This function return grid indices of the closest point 
     3141   !> from point (lon1,lat1)  
     3142   !>  
     3143   !> @details 
     3144   !> 
     3145   !> @note overlap band should have been already removed from coarse grid array  
     3146   !> of longitude and latitude, before running this function 
     3147   !> 
     3148   !> if you add cd_pos argument, you could choice to return closest point at 
     3149   !> - lower left  (ll) of the point 
     3150   !> - lower right (lr) of the point 
     3151   !> - upper left  (ul) of the point 
     3152   !> - upper right (ur) of the point 
     3153   !> - lower       (lo) of the point 
     3154   !> - upper       (up) of the point 
     3155   !> -       left  (le) of the point 
     3156   !> -       right (ri) of the point 
     3157   !> 
     3158   !> @author J.Paul 
    30223159   !> @date November, 2013 - Initial Version 
    30233160   !> @date February, 2015 
     
    30343171   !> @return coarse grid indices of closest point of fine grid point 
    30353172   !------------------------------------------------------------------- 
    3036    FUNCTION grid_get_closest( dd_lon0, dd_lat0, dd_lon1, dd_lat1, cd_pos, dd_fill ) 
     3173   FUNCTION grid__get_closest_arr( dd_lon0, dd_lat0, dd_lon1, dd_lat1, cd_pos, dd_fill ) 
    30373174      IMPLICIT NONE 
    30383175      ! Argument 
     
    30453182 
    30463183      ! function 
    3047       INTEGER(i4), DIMENSION(2) :: grid_get_closest 
     3184      INTEGER(i4), DIMENSION(2) :: grid__get_closest_arr 
    30483185 
    30493186      ! local variable 
     
    32613398         END SELECT 
    32623399      ENDIF 
    3263       grid_get_closest(:)=MINLOC(dl_dist(:,:),dl_dist(:,:)/=NF90_FILL_DOUBLE) 
    3264  
    3265       grid_get_closest(1)=grid_get_closest(1)+il_iinf-1 
    3266       grid_get_closest(2)=grid_get_closest(2)+il_jinf-1 
     3400      grid__get_closest_arr(:)=MINLOC(dl_dist(:,:),dl_dist(:,:)/=NF90_FILL_DOUBLE) 
     3401 
     3402      grid__get_closest_arr(1)=grid__get_closest_arr(1)+il_iinf-1 
     3403      grid__get_closest_arr(2)=grid__get_closest_arr(2)+il_jinf-1 
    32673404 
    32683405      DEALLOCATE( dl_dist ) 
    32693406      DEALLOCATE( dl_lon0 ) 
    32703407 
    3271    END FUNCTION grid_get_closest 
     3408   END FUNCTION grid__get_closest_arr 
    32723409   !------------------------------------------------------------------- 
    32733410   !> @brief This function compute the distance between a point A and grid points.   
     
    34753612         ENDIF 
    34763613         tl_lat0=iom_mpp_read_var(tl_coord0, TRIM(cl_name)) 
    3477           
     3614 
    34783615         ! close mpp files 
    34793616         CALL iom_mpp_close(tl_coord0) 
     
    46474784 
    46484785      IF( ll_even )THEN 
     4786 
    46494787         ! look for variable value on domain for F point 
    46504788         il_ind=var_get_index(tl_coord0%t_proc(1)%t_var(:), 'longitude_F') 
     
    51125250      dl_lon1 = dd_lon1(il_imin1, il_jmax1) 
    51135251      dl_lat1 = dd_lat1(il_imin1, il_jmax1) 
    5114  
    51155252 
    51165253      IF( (ABS(dl_lon1-dl_lon0)>dp_delta) .AND. (dl_lon1 < dl_lon0) .OR. & 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/TOOLS/SIREN/src/iom.f90

    r7261 r10115  
    157157   !> @author J.Paul 
    158158   !> @date November, 2013 - Initial Version 
    159    ! 
     159   !> 
    160160   !> @param[inout] td_file file structure 
    161161   !------------------------------------------------------------------- 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/TOOLS/SIREN/src/iom_cdf.f90

    r7261 r10115  
    316316   !> @author J.Paul 
    317317   !> @date November, 2013 - Initial Version 
     318   !> @date October, 2016 
     319   !> - define cdf4 as cdf. 
    318320   ! 
    319321   !> @param[inout] td_file   file structure 
     
    340342            td_file%c_type='cdf' 
    341343         CASE(nf90_format_netcdf4, nf90_format_netcdf4_classic) 
    342             td_file%c_type='cdf4' 
     344            !td_file%c_type='cdf4' 
     345            td_file%c_type='cdf' 
    343346      END SELECT 
     347      CALL logger_debug("IOM CDF GET INFO: type "//TRIM(td_file%c_type))  
    344348 
    345349      ! record header infos 
     
    351355   !> reorder dimension to ('x', 'y', 'z', 't'). 
    352356   !> The dimension structure inside file structure is then completed. 
    353    ! 
    354    !> @author J.Paul 
    355    !> @date November, 2013 - Initial Version 
    356    ! 
     357   !> 
     358   !> @author J.Paul 
     359   !> @date November, 2013 - Initial Version 
     360   !> @date October, 2016 
     361   !> - check unknown dimension 
     362   !> 
    357363   !> @param[inout] td_file   file structure 
    358364   !------------------------------------------------------------------- 
     
    375381 
    376382      IF( td_file%i_ndim > 0 )THEN 
     383 
    377384         ii=1 
    378385         DO ji = 1, td_file%i_ndim 
    379386            ! read dimension information 
    380387            tl_dim=iom_cdf_read_dim( td_file, ji) 
    381             IF( .NOT. dim_is_dummy(tl_dim) )THEN 
     388            ! sname == 'u' if dimension is unknown (not to be used) 
     389            IF( TRIM(tl_dim%c_sname) /= 'u' )THEN 
    382390               IF( ii > ip_maxdim )THEN 
    383391                  CALL logger_fatal("IOM CDF OPEN: too much dimension "//& 
    384                   & "to be read. you should remove dummy dimension using "//& 
     392                  & "to be read. you could choose dimension to be used. see "//& 
    385393                  & " configuration file") 
    386394               ENDIF 
     
    395403            &  " IOM CDF GET FILE DIM: there is no unlimited dimension in file "//& 
    396404            &  TRIM(td_file%c_name)) 
    397          ELSE 
    398             td_file%t_dim( td_file%i_uldid )%l_uld=.TRUE. 
     405         !ELSE 
     406         !   td_file%t_dim( td_file%i_uldid )%l_uld=.TRUE. 
    399407         ENDIF 
    400408 
     
    466474   !> The variable structure inside file structure is then completed. 
    467475   !> @note variable value are not read ! 
    468    ! 
     476   !> 
    469477   !> @author J.Paul 
    470478   !> @date November, 2013 - Initial Version 
     
    473481   !> @date January, 2016 
    474482   !> - increment n3d for 4D variable 
    475    ! 
     483   !> @date October, 2016 
     484   !> - check variable to be used (variable's dimension allowed and variable 
     485   !> not "dummy") 
     486   !> 
    476487   !> @param[inout] td_file   file structure 
    477488   !------------------------------------------------------------------- 
     
    501512         il_nvar=td_file%i_nvar 
    502513         ALLOCATE(tl_var(il_nvar)) 
    503          ii=0 
    504514         DO ji = 1, il_nvar 
    505515           ! read variable information 
    506516           tl_var(ji)=iom_cdf__read_var_meta( td_file, ji)  
    507            IF( .NOT. var_is_dummy(tl_var(ji)) )THEN 
    508               ii=ii+1 
    509            ENDIF 
    510517         ENDDO 
    511518 
    512519         ! update number of variable used 
    513          td_file%i_nvar=ii 
     520         td_file%i_nvar=COUNT(tl_var(:)%l_use) 
    514521 
    515522         ALLOCATE(td_file%t_var(td_file%i_nvar)) 
     
    517524         ii=0 
    518525         DO ji = 1, il_nvar 
    519             IF( .NOT. var_is_dummy(tl_var(ji)) )THEN 
     526            IF( tl_var(ji)%l_use )THEN 
    520527               ii=ii+1 
    521528               td_file%t_var(ii)=var_copy(tl_var(ji)) 
     
    552559                     td_file%i_timeid=ji 
    553560                  ELSE 
     561                     IF( td_file%i_timeid /= ji )THEN 
     562                        CALL logger_warn("IOM CDF GET FILE VAR: find more "//& 
     563                        &                 "than one time variable in file "//& 
     564                        &                 TRIM(td_file%c_name)//". see "//& 
     565                        &                 "dummy.cfg configuration file to"//& 
     566                        &                 " not used dummy variables.") 
     567                     ENDIF 
    554568                     il_attid=0 
    555569                     IF( ASSOCIATED(td_file%t_var(ii)%t_att) )THEN 
     
    558572                     IF( il_attid /= 0 )THEN 
    559573                        td_file%i_timeid=ji 
    560                      !ELSE 
    561                      !   CALL logger_error("IOM CDF GET FILE VAR: find more "//& 
    562                      !   &                 "than one time variable in file "//& 
    563                      !   &                 TRIM(td_file%c_name) ) 
    564574                     ENDIF 
    565575                  ENDIF 
     
    652662         &  " IOM CDF READ DIM: no id associated to file "//TRIM(td_file%c_name)) 
    653663 
    654       ELSE       
     664      ELSE 
    655665 
    656666         CALL logger_trace( & 
     
    723733   !> @author J.Paul 
    724734   !> @date November, 2013 - Initial Version 
     735   !> @date November 2017 
     736   !> - check if cl_value is not bug  
    725737   ! 
    726738   !> @param[in] td_file   file structure 
     
    793805 
    794806            CASE(NF90_CHAR) 
     807               CALL logger_debug( " IOM CDF READ ATT: get NF90_CHAR ") 
    795808 
    796809               ! check string lengths 
     
    809822                  CALL iom_cdf__check(il_status,"IOM CDF READ ATT: ") 
    810823 
     824                  ! check cl_value 
     825                  IF( LLT(cl_value,'') ) cl_value = '' 
    811826                  iom_cdf__read_att_name=att_init(cl_name, cl_value) 
    812827 
     
    814829          
    815830            CASE(NF90_BYTE) 
     831               CALL logger_debug( " IOM CDF READ ATT: get NF90_BYTE ") 
    816832 
    817833               ALLOCATE( bl_value( il_len), & 
     
    837853 
    838854            CASE(NF90_SHORT) 
     855               CALL logger_debug( " IOM CDF READ ATT: get NF90_SHORT ") 
    839856 
    840857               ALLOCATE( sl_value( il_len), & 
     
    861878 
    862879            CASE(NF90_INT) 
     880               CALL logger_debug( " IOM CDF READ ATT: get NF90_INT ") 
    863881 
    864882               ALLOCATE( il_value( il_len), & 
     
    884902 
    885903            CASE(NF90_FLOAT) 
     904               CALL logger_debug( " IOM CDF READ ATT: get NF90_FLOAT ") 
    886905 
    887906               ALLOCATE( fl_value( il_len), & 
     
    908927 
    909928            CASE(NF90_DOUBLE) 
     929               CALL logger_debug( " IOM CDF READ ATT: get NF90_DOUBLE ") 
    910930 
    911931               ALLOCATE( dl_value( il_len), & 
     
    14131433         ENDDO 
    14141434 
     1435         !! check if variable is dummy 
     1436         IF( var_is_dummy(iom_cdf__read_var_meta) )THEN 
     1437            iom_cdf__read_var_meta%l_use=.FALSE. 
     1438         ENDIF 
     1439 
     1440         !! check if all dimensions are allowed 
     1441         DO ji=1,il_ndim 
     1442            IF( ALL(td_file%t_dim(:)%i_id /= il_dimid(ji)) )THEN 
     1443               iom_cdf__read_var_meta%l_use=.FALSE. 
     1444            ENDIF 
     1445         ENDDO 
     1446 
    14151447         ! clean 
    14161448         CALL dim_clean(tl_dim(:)) 
     
    14841516      ELSE IF( id_ndim > 0 )THEN 
    14851517 
    1486  
    14871518         ii=1 
    14881519         DO ji = 1, id_ndim 
    14891520 
    1490             !!! check no dummy dimension to be used 
     1521            ! check if dimension to be used, is allowed 
    14911522            IF( ANY(td_file%t_dim(:)%i_id == id_dimid(ji)) )THEN 
    14921523               IF( ii > ip_maxdim )THEN 
     
    15041535               tl_dim(ii) = dim_init( td_file%t_dim(il_xyzt2(ii))%c_name, & 
    15051536               &                      td_file%t_dim(il_xyzt2(ii))%i_len ) 
    1506              
     1537 
    15071538               ii=ii+1 
    15081539            ELSE 
     
    20802111                  & 'gcost','gcosu','gcosv','gcosf', & 
    20812112                  & 'gsint','gsinu','gsinv','gsinf', & 
    2082                   & 'mbathy','misf','isf_draft',     & 
     2113                  & 'mbathy','misf','isf_draft','isfdraft',     & 
    20832114                  & 'hbatt','hbatu','hbatv','hbatf', & 
    20842115                  & 'gsigt','gsigu','gsigv','gsigf', & 
     
    21892220         CALL iom_cdf__check(il_status,"IOM CDF WRITE VAR DEF: ") 
    21902221      ENDIF 
     2222      CALL logger_debug("IOM CDF WRITE VAR DEF: type = "//TRIM(fct_str(tl_var%i_type))) 
    21912223 
    21922224      ! remove unuseful attribute 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/TOOLS/SIREN/src/iom_mpp.f90

    r7261 r10115  
    385385      CHARACTER(LEN=*),          INTENT(IN) :: cd_name 
    386386      INTEGER(i4), DIMENSION(:), INTENT(IN), OPTIONAL :: id_start 
    387       INTEGER(i4), DIMENSION(:), INTENT(IN), OPTIONAL :: id_count       
     387      INTEGER(i4), DIMENSION(:), INTENT(IN), OPTIONAL :: id_count   
    388388 
    389389      ! local variable 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/TOOLS/SIREN/src/merge_bathy.f90

    r7261 r10115  
    5151!>       - cn_varcfg : variable configuration file  
    5252!> (see ./SIREN/cfg/variable.cfg) 
     53!>       - cn_dimcfg : dimension configuration file. define dimensions allowed 
     54!> (see ./SIREN/cfg/dimension.cfg). 
    5355!>       - cn_dumcfg : useless (dummy) configuration file, for useless  
    5456!> dimension or variable (see ./SIREN/cfg/dummy.cfg). 
     
    115117!>       - cn_east  : east  boundary indices on fine grid<br/> 
    116118!>       - cn_west  : west  boundary indices on fine grid<br/> 
     119!>       - in_ncrs  : number of point(s) with coarse value save at boundaries<br/> 
    117120!>       - ln_oneseg: use only one segment for each boundary or not 
    118121!> 
     
    130133!> @date September, 2015 
    131134!> - manage useless (dummy) variable, attributes, and dimension 
     135!> @date October, 2016 
     136!> - allow to choose the number of boundary point with coarse grid value. 
     137!> - dimension to be used select from configuration file 
    132138!> 
    133139!> @note Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt) 
     
    208214 
    209215   ! namcfg 
    210    CHARACTER(LEN=lc)                       :: cn_varcfg = 'variable.cfg'  
    211    CHARACTER(LEN=lc)                       :: cn_dumcfg = 'dummy.cfg' 
     216   CHARACTER(LEN=lc)                       :: cn_varcfg = './cfg/variable.cfg'  
     217   CHARACTER(LEN=lc)                       :: cn_dimcfg = './cfg/dimension.cfg' 
     218   CHARACTER(LEN=lc)                       :: cn_dumcfg = './cfg/dummy.cfg' 
    212219 
    213220   ! namcrs 
     
    231238   LOGICAL                                 :: ln_east  = .TRUE. 
    232239   LOGICAL                                 :: ln_west  = .TRUE. 
    233    LOGICAL                                 :: ln_oneseg= .TRUE. 
    234240   CHARACTER(LEN=lc)                       :: cn_north = '' 
    235241   CHARACTER(LEN=lc)                       :: cn_south = '' 
    236242   CHARACTER(LEN=lc)                       :: cn_east  = '' 
    237243   CHARACTER(LEN=lc)                       :: cn_west  = '' 
     244   INTEGER(i4)                             :: in_ncrs  = 2 
     245   LOGICAL                                 :: ln_oneseg= .TRUE. 
    238246 
    239247   ! namout 
     
    248256   NAMELIST /namcfg/ &  !< config namelist 
    249257   &  cn_varcfg, &       !< variable configuration file 
     258   &  cn_dimcfg, &       !< dimension configuration file 
    250259   &  cn_dumcfg          !< dummy configuration file 
    251260 
     
    276285   &  cn_east ,   &     !< east  boundary indices on fine grid 
    277286   &  cn_west ,   &     !< west  boundary indices on fine grid 
     287   &  in_ncrs,    &     !< number of point with coarse value save at boundaries  
    278288   &  ln_oneseg         !< use only one segment for each boundary or not 
    279289 
     
    319329      CALL var_def_extra(TRIM(cn_varcfg)) 
    320330 
     331      ! get dimension allowed 
     332      CALL dim_def_extra(TRIM(cn_dimcfg)) 
     333 
    321334      ! get dummy variable 
    322335      CALL var_get_dummy(TRIM(cn_dumcfg)) 
     
    435448   DO jk=1,ip_ncard 
    436449      CALL merge_bathy_get_boundary(tl_bathy0, tl_bathy1, tl_bdy(jk), & 
    437       &                             il_rho(:),                        & 
     450      &                             il_rho(:), in_ncrs,                      & 
    438451      &                             dl_refined(:,:,:,:), dl_weight(:,:,:,:), & 
    439452      &                             dl_fill) 
     
    621634   DEALLOCATE(dl_weight) 
    622635   CALL boundary_clean(tl_bdy(:)) 
     636   CALL var_clean_extra() 
    623637 
    624638   ! close log file 
     
    638652   !> @param[in] td_bdy          boundary structure 
    639653   !> @param[in] id_rho          array of refinement factor 
     654   !> @param[in] id_ncrs         number of point with coarse value save at boundaries 
    640655   !> @param[inout] dd_refined   array of refined bathymetry  
    641656   !> @param[inout] dd_weight    array of weight 
    642657   !> @param[in] dd_fill         fillValue 
    643658   !> 
    644    !> @todo improve boundary weight function 
    645659   !------------------------------------------------------------------- 
    646660   SUBROUTINE merge_bathy_get_boundary( td_bathy0, td_bathy1, td_bdy, & 
    647    &                                    id_rho,                       & 
     661   &                                    id_rho, id_ncrs,              & 
    648662   &                                    dd_refined, dd_weight, dd_fill ) 
    649663 
     
    655669      TYPE(TBDY)                     , INTENT(IN   ) :: td_bdy 
    656670      INTEGER(i4), DIMENSION(:)      , INTENT(IN   ) :: id_rho 
     671      INTEGER(i4)                    , INTENT(IN   ) :: id_ncrs 
    657672      REAL(dp)   , DIMENSION(:,:,:,:), INTENT(INOUT) :: dd_refined 
    658673      REAL(dp)   , DIMENSION(:,:,:,:), INTENT(INOUT) :: dd_weight 
     
    670685      INTEGER(i4) :: il_jmax0 
    671686 
     687      INTEGER(i4) :: il_width 
     688 
    672689      INTEGER(i4), DIMENSION(2,2)         :: il_offset 
    673690      INTEGER(i4), DIMENSION(2,2)         :: il_ind 
     
    838855            CASE('north') 
    839856 
    840 !               ! npoint coarse 
    841 !               il_width=td_bdy%t_seg(jl)%i_width-id_npoint 
    842 !               ! compute "distance" 
    843 !               dl_tmp1d(:)=(/(ji,ji=il_width-1,1,-1),(0,ji=1,id_npoint)/) 
    844 !               ! compute weight on segment 
    845 !               dl_tmp1d(:)= 0.5 + 0.5*COS( (dp_pi*dl_tmp1d(:)) / & 
    846 !               &                           (il_width) ) 
    847  
     857 
     858               ! save n coarse point 
     859               il_width=td_bdy%t_seg(jl)%i_width-id_ncrs 
    848860               ! compute "distance" 
    849                dl_tmp1d(:)=(/(ji-1,ji=td_bdy%t_seg(jl)%i_width-1,1,-1),0/) 
     861               dl_tmp1d(:)=(/(ji,ji=il_width,1,-1),(0,ji=1,id_ncrs)/) 
    850862 
    851863               ! compute weight on segment 
    852864               dl_tmp1d(:)= 0.5 + 0.5*COS( (dp_pi*dl_tmp1d(:)) / & 
    853                &                           (td_bdy%t_seg(jl)%i_width) ) 
     865               &                           (il_width) ) 
     866 
    854867 
    855868               ALLOCATE( dl_wseg(tl_dom1%t_dim(1)%i_len, & 
     
    862875            CASE('south') 
    863876 
     877               ! save n coarse point 
     878               il_width=td_bdy%t_seg(jl)%i_width-id_ncrs 
    864879               ! compute "distance" 
    865                dl_tmp1d(:)=(/0,(ji-1,ji=1,td_bdy%t_seg(jl)%i_width-1)/)                
     880               dl_tmp1d(:)=(/(0,ji=1,id_ncrs),(ji,ji=1,il_width)/) 
    866881 
    867882               ! compute weight on segment 
    868883               dl_tmp1d(:)= 0.5 + 0.5*COS( (dp_pi*dl_tmp1d(:)) / & 
    869                &                           (td_bdy%t_seg(jl)%i_width) ) 
     884               &                           (il_width) ) 
     885 
    870886 
    871887               ALLOCATE( dl_wseg(tl_dom1%t_dim(1)%i_len, & 
     
    878894            CASE('east') 
    879895 
     896               ! save n coarse point 
     897               il_width=td_bdy%t_seg(jl)%i_width-id_ncrs 
    880898               ! compute "distance" 
    881                dl_tmp1d(:)=(/(ji-1,ji=td_bdy%t_seg(jl)%i_width-1,1,-1),0/) 
     899               dl_tmp1d(:)=(/(ji,ji=il_width,1,-1),(0,ji=1,id_ncrs)/) 
    882900 
    883901               ! compute weight on segment 
    884902               dl_tmp1d(:)= 0.5 + 0.5*COS( (dp_pi*dl_tmp1d(:)) / & 
    885                &                           (td_bdy%t_seg(jl)%i_width) ) 
     903               &                           (il_width) ) 
     904 
    886905 
    887906               ALLOCATE( dl_wseg(tl_dom1%t_dim(1)%i_len, & 
     
    894913            CASE('west') 
    895914 
     915               ! save n coarse point 
     916               il_width=td_bdy%t_seg(jl)%i_width-id_ncrs 
    896917               ! compute "distance" 
    897                dl_tmp1d(:)=(/0,(ji-1,ji=1,td_bdy%t_seg(jl)%i_width-1)/)                
     918               dl_tmp1d(:)=(/(0,ji=1,id_ncrs),(ji,ji=1,il_width)/) 
    898919 
    899920               ! compute weight on segment 
    900921               dl_tmp1d(:)= 0.5 + 0.5*COS( (dp_pi*dl_tmp1d(:)) / & 
    901                &                           (td_bdy%t_seg(jl)%i_width) ) 
     922               &                           (il_width) ) 
     923 
    902924 
    903925               ALLOCATE( dl_wseg(tl_dom1%t_dim(1)%i_len, & 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/TOOLS/SIREN/src/mpp.f90

    r7261 r10115  
    266266   PRIVATE :: mpp__copy_arr            ! copy array of mpp structure 
    267267   PRIVATE :: mpp__get_use_unit        ! get sub domains to be used (which cover "zoom domain") 
    268    PRIVATE :: mpp__init_mask           ! initialise mpp structure, given file name 
     268   PRIVATE :: mpp__init_mask           ! initialise mpp structure, given mask array 
    269269   PRIVATE :: mpp__init_var            ! initialise mpp structure, given variable strcuture 
    270270   PRIVATE :: mpp__init_file           ! initialise a mpp structure, given file structure  
     
    586586               WRITE(*,'(/a)') " Variable(s) used : " 
    587587               DO ji=1,td_mpp%t_proc(1)%i_nvar 
    588                   WRITE(*,'(3x,a)') TRIM(td_mpp%t_proc(1)%t_var(ji)%c_name)  
     588                  WRITE(*,'(3x,a)') TRIM(td_mpp%t_proc(1)%t_var(ji)%c_name) 
    589589               ENDDO 
    590590            ENDIF 
     
    25502550   !> and the number of processors following I and J. 
    25512551   !> Then the number of sea/land processors is compute with mask 
    2552    ! 
     2552   !> 
    25532553   !> @author J.Paul 
    25542554   !> @date October, 2015 - Initial version 
    2555    ! 
     2555   !> @date October, 2016 
     2556   !> - compare index to td_lay number of proc instead of td_mpp (bug fix) 
     2557   !> 
    25562558   !> @param[in] td_mpp mpp strcuture 
    25572559   !> @param[in] id_mask   sub domain mask (sea=1, land=0) 
     
    26702672 
    26712673            ! east boundary 
    2672             IF( ji == td_mpp%i_niproc )THEN 
     2674            IF( ji == td_lay%i_niproc )THEN 
    26732675               il_lei = td_lay%i_lci(ji,jj) 
    26742676            ELSE 
     
    26772679 
    26782680            ! north boundary 
    2679             IF( jj == td_mpp%i_njproc )THEN 
     2681            IF( jj == td_lay%i_njproc )THEN 
    26802682               il_lej = td_lay%i_lcj(ji,jj) 
    26812683            ELSE 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/TOOLS/SIREN/src/phycst.f90

    r7261 r10115  
    3434   PUBLIC :: dp_siday   !< sideral day                        [s] 
    3535 
    36    REAL(wp), PUBLIC ::   rday = 24.*60.*60.     !: day                                [s] 
    37    REAL(wp), PUBLIC ::   rsiyea                 !: sideral year                       [s] 
    38    REAL(wp), PUBLIC ::   rsiday                 !: sideral day                        [s] 
     36   REAL(dp), PUBLIC ::   rday = 24.*60.*60.     !: day                                [s] 
     37   REAL(dp), PUBLIC ::   rsiyea                 !: sideral year                       [s] 
     38   REAL(dp), PUBLIC ::   rsiday                 !: sideral day                        [s] 
    3939 
    4040   REAL(dp), PARAMETER :: dp_pi = 3.14159274101257_dp 
    41    REAL(dp), PARAMETER :: dp_eps = EPSILON(1._dp) 
     41   REAL(dp), PARAMETER :: dp_eps = 0.5 * EPSILON(1._dp) 
    4242   REAL(dp), PARAMETER :: dp_rearth = 6371229._dp 
    4343   REAL(dp), PARAMETER :: dp_deg2rad = dp_pi/180.0 
     
    4545 
    4646   REAL(dp), PARAMETER :: dp_day = 24.*60.*60.      
    47    REAL(dp), PARAMETER :: dp_siyea = 365.25_wp * dp_day * & 
    48       &  2._wp * dp_pi / 6.283076_dp 
    49    REAL(dp), PARAMETER :: dp_siday = dp_day / ( 1._wp + dp_day / dp_siyea ) 
     47   REAL(dp), PARAMETER :: dp_siyea = 365.25_dp * dp_day * & 
     48      &  2._dp * dp_pi / 6.283076_dp 
     49   REAL(dp), PARAMETER :: dp_siday = dp_day / ( 1._dp + dp_day / dp_siyea ) 
    5050 
    51    REAL(dp), PARAMETER :: dp_delta=1.e-6 
     51   REAL(dp), PARAMETER :: dp_delta=1.e-5 
    5252   REAL(dp), PARAMETER :: dp_omega= 2._dp * dp_pi / dp_siday 
    5353END MODULE phycst 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/TOOLS/SIREN/src/variable.f90

    r7261 r10115  
    3434!>    Note:<br/> 
    3535!>       - others optionals arguments could be added, see var_init. 
    36 !>       - to put variable 0D, use td_dim with all dimension unused 
     36!>       - to put scalar variable (OD), use td_dim with all dimension unused 
    3737!> (td_dim(:)%l_use=.FALSE.) 
    3838!>     
     
    267267!>    - cd_varinfo is variable information from namelist 
    268268!> 
     269!>    to clean global array of variable structure:<br/> 
     270!>@code 
     271!>    CALL var_clean_extra( ) 
     272!>@endcode 
     273!> 
    269274!>    to check variable dimension expected, as defined in file 'variable.cfg':<br/> 
    270275!>@code 
     
    287292!> @date Spetember, 2015 
    288293!> - manage useless (dummy) variable 
    289 ! 
     294!> @date October, 2016 
     295!> - add subroutine to clean global array of extra information. 
     296!> - define logical for variable to be used 
     297!> 
    290298!> @note Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt) 
    291299!---------------------------------------------------------------------- 
     
    337345   PUBLIC :: var_def_extra     !< read variable configuration file, and save extra information. 
    338346   PUBLIC :: var_chg_extra     !< read variable namelist information, and modify extra information. 
     347   PUBLIC :: var_clean_extra   !< clean gloabl array of extra information. 
    339348   PUBLIC :: var_check_dim     !< check variable dimension expected 
    340349   PUBLIC :: var_get_dummy     !< fill dummy variable array 
     
    416425      TYPE(TDIM), DIMENSION(ip_maxdim)  :: t_dim           !< variable dimension 
    417426  
    418       LOGICAL           :: l_file = .FALSE.  !< variable read in a file 
     427      LOGICAL           :: l_file = .FALSE. !< variable read in a file 
     428      LOGICAL           :: l_use  = .TRUE.  !< variable to be used 
    419429 
    420430      ! highlight some attributes 
     
    451461                                                        !< fill when running var_def_extra()  
    452462 
    453    CHARACTER(LEN=lc), DIMENSION(ip_maxdum), SAVE :: cm_dumvar !< dummy variable 
     463   CHARACTER(LEN=lc), DIMENSION(ip_maxdumcfg), SAVE :: cm_dumvar !< dummy variable 
    454464 
    455465   INTERFACE var_init 
     
    593603         CALL att_clean(tl_att) 
    594604      ENDIF 
     605 
     606      var__copy_unit%l_file     = td_var%l_file 
     607      var__copy_unit%l_use      = td_var%l_use 
    595608 
    596609      ! copy highlight attribute 
     
    11261139   !> @date July, 2015 
    11271140   !> - add unit factor (to change unit) 
     1141   !> @date November, 2016 
     1142   !> - allow to add scalar value 
    11281143   !> 
    11291144   !> @param[in] cd_name         variable name 
     
    12791294         dl_value(1,1,1,:) = dd_value(:) 
    12801295      ELSE 
    1281          CALL logger_fatal("VAR INIT: can not add value from variable "//& 
    1282          &  TRIM(cd_name)//". invalid dimension to be used") 
     1296         IF( SIZE(dd_value(:)) > 1 )THEN 
     1297            CALL logger_fatal("VAR INIT: can not add value from variable "//& 
     1298            &  TRIM(cd_name)//". invalid dimension to be used") 
     1299         ELSE 
     1300            dl_value(1,1,1,1) = dd_value(1) 
     1301            CALL logger_warn("VAR INIT: add scalar value for variable "//& 
     1302            &  TRIM(cd_name)) 
     1303 
     1304         ENDIF 
    12831305      ENDIF 
    12841306 
     
    66696691      ! check if variable is in array of variable structure 
    66706692      DO ji=1,il_size 
     6693 
    66716694         ! look for variable name 
    66726695         IF( fct_lower(td_var(ji)%c_name) == fct_lower(cd_name) )THEN 
     
    66836706 
    66846707         ELSE IF( PRESENT(cd_stdname) )THEN  
     6708 
    66856709            IF( fct_lower(td_var(ji)%c_stdname) == fct_lower(cd_stdname) .AND.& 
    66866710            &    TRIM(fct_lower(td_var(ji)%c_stdname)) /= '' )THEN 
     
    66906714            ENDIF 
    66916715 
     6716         ENDIF 
     6717 
    66926718         ! look for variable longname 
    6693          ELSE IF( fct_lower(td_var(ji)%c_longname) == fct_lower(cd_name) .AND.& 
    6694          &    TRIM(fct_lower(td_var(ji)%c_longname)) /= '' )THEN 
     6719         IF( fct_lower(td_var(ji)%c_longname) == fct_lower(cd_name) .AND.& 
     6720         &   TRIM(fct_lower(td_var(ji)%c_longname)) /= '' )THEN 
    66956721             
    66966722            var_get_index=ji 
    66976723            EXIT 
     6724 
     6725         ELSE IF( PRESENT(cd_stdname) )THEN 
     6726 
     6727            IF( fct_lower(td_var(ji)%c_longname) == fct_lower(cd_stdname) .AND.& 
     6728            &    TRIM(fct_lower(td_var(ji)%c_longname)) /= '' )THEN 
     6729             
     6730               var_get_index=ji 
     6731               EXIT 
     6732            ENDIF 
    66986733 
    66996734         ENDIF 
     
    67346769      ! check if variable is in array of variable structure 
    67356770      DO ji=1,il_size 
     6771       
    67366772         ! look for variable name 
    67376773         IF( fct_lower(td_var(ji)%c_name) == fct_lower(cd_name) )THEN 
     
    67476783            EXIT 
    67486784 
    6749          ! look for variable long name 
    6750          ELSE IF( fct_lower(td_var(ji)%c_longname) == fct_lower(cd_name) .AND.& 
    6751          &    TRIM(fct_lower(td_var(ji)%c_longname)) /= '' )THEN 
    6752              
    6753             var_get_id=td_var(ji)%i_id 
    6754             EXIT 
    6755  
    6756          ELSE IF( PRESENT(cd_stdname) )THEN  
     6785         ELSE IF( PRESENT(cd_stdname) )THEN 
     6786 
    67576787            IF( fct_lower(td_var(ji)%c_stdname) == fct_lower(cd_stdname) .AND.& 
    67586788            &    TRIM(fct_lower(td_var(ji)%c_stdname)) /= '' )THEN 
     
    67616791               EXIT 
    67626792            ENDIF 
     6793 
     6794         ENDIF 
     6795 
     6796         ! look for variable long name 
     6797         IF( fct_lower(td_var(ji)%c_longname) == fct_lower(cd_name) .AND.& 
     6798         &    TRIM(fct_lower(td_var(ji)%c_longname)) /= '' )THEN 
     6799             
     6800            var_get_id=td_var(ji)%i_id 
     6801            EXIT 
     6802 
     6803         ELSE IF( PRESENT(cd_stdname) )THEN  
     6804 
     6805            IF( fct_lower(td_var(ji)%c_longname) == fct_lower(cd_stdname) .AND.& 
     6806            &    TRIM(fct_lower(td_var(ji)%c_longname)) /= '' )THEN 
     6807             
     6808               var_get_id=td_var(ji)%i_id 
     6809               EXIT 
     6810            ENDIF 
     6811 
    67636812         ENDIF 
    67646813 
     
    71767225   !------------------------------------------------------------------- 
    71777226   !> @brief 
     7227   !> This subroutine clean global array of variable structure  
     7228   !> with extra information: tg_varextra. 
     7229   !>  
     7230   !> @author J.Paul 
     7231   !> @date October, 2016 - Initial Version 
     7232   !------------------------------------------------------------------- 
     7233   SUBROUTINE var_clean_extra( ) 
     7234      IMPLICIT NONE 
     7235      ! Argument 
     7236      !---------------------------------------------------------------- 
     7237 
     7238      CALL var_clean(tg_varextra(:)) 
     7239      DEALLOCATE(tg_varextra) 
     7240 
     7241   END SUBROUTINE var_clean_extra 
     7242   !------------------------------------------------------------------- 
     7243   !> @brief 
    71787244   !> This subroutine read matrix value from character string in namelist 
    7179    !> and fill variable strucutre value. 
     7245   !> and fill variable structure value. 
    71807246   !> 
    71817247   !> @details 
     
    84638529      ! loop indices 
    84648530      ! namelist 
    8465       CHARACTER(LEN=lc), DIMENSION(ip_maxdum) :: cn_dumvar 
    8466       CHARACTER(LEN=lc), DIMENSION(ip_maxdum) :: cn_dumdim 
    8467       CHARACTER(LEN=lc), DIMENSION(ip_maxdum) :: cn_dumatt 
     8531      CHARACTER(LEN=lc), DIMENSION(ip_maxdumcfg) :: cn_dumvar 
     8532      CHARACTER(LEN=lc), DIMENSION(ip_maxdumcfg) :: cn_dumdim 
     8533      CHARACTER(LEN=lc), DIMENSION(ip_maxdumcfg) :: cn_dumatt 
    84688534 
    84698535      !---------------------------------------------------------------- 
     
    85268592 
    85278593      var_is_dummy=.FALSE. 
    8528       DO ji=1,ip_maxdum 
     8594      DO ji=1,ip_maxdumcfg 
    85298595         IF( fct_lower(td_var%c_name) == fct_lower(cm_dumvar(ji)) )THEN 
    85308596            var_is_dummy=.TRUE. 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/TOOLS/SIREN/src/vgrid.f90

    r7261 r10115  
    751751      ENDIF 
    752752 
    753       ! get ghoste cell 
     753      ! get ghost cell 
    754754      il_xghost(:,:)=grid_get_ghost(tl_bathy) 
    755755 
  • NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/TOOLS/SIREN/templates/merge_bathy.nam

    r7261 r10115  
    3434   cn_east= 
    3535   cn_west= 
     36   in_ncrs= 
    3637   ln_oneseg= 
    3738/ 
Note: See TracChangeset for help on using the changeset viewer.