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 15017 – NEMO

Changeset 15017


Ignore:
Timestamp:
2021-06-18T12:12:53+02:00 (3 years ago)
Author:
smasson
Message:

trunk: introduce iom_put without halos, #2694

Location:
NEMO/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • NEMO/trunk/cfgs/SHARED/domain_def_nemo.xml

    r14072 r15017  
    44  <!--   T grid   --> 
    55  <domain id="grid_T" long_name="grid T"/> 
     6  <domain id="grid_T_inner" long_name="grid T inner"/> 
    67 
    78  <!--   My zoom: example of hand defined zoom   --> 
     
    167168  <!--   U grid   --> 
    168169  <domain id="grid_U" long_name="grid U"/> 
     170  <domain id="grid_U_inner" long_name="grid U inner"/> 
    169171  <!--   Eq section   --> 
    170172  <domain id="EqU" domain_ref="grid_U" > <zoom_domain id="EqU"/> </domain> 
     
    173175  <!--   V grid   --> 
    174176  <domain id="grid_V" long_name="grid V"/> 
     177  <domain id="grid_V_inner" long_name="grid V inner"/> 
    175178  <!--   Eq section : no V point on the Equator...   --> 
    176179 
     
    178181  <!--   W grid   --> 
    179182  <domain id="grid_W" long_name="grid W"/> 
     183  <domain id="grid_W_inner" long_name="grid W inner"/> 
    180184  <!--   Eq section   --> 
    181185  <domain id="EqW" domain_ref="grid_W" > <zoom_domain id="EqW"/> </domain> 
     
    183187  <!--   F grid   --> 
    184188  <domain id="grid_F" long_name="grid F"/> 
     189  <domain id="grid_F_inner" long_name="grid F inner"/> 
    185190 
    186191  <!--   zonal mean grid   --> 
  • NEMO/trunk/cfgs/SHARED/field_def_nemo-oce.xml

    r15004 r15017  
    131131 
    132132    <!-- additions to diawri.F90 --> 
    133     <field id="socegrad"    long_name="module of salinity gradient"              unit="psu/m"   grid_ref="grid_T_3D"/> 
    134     <field id="socegrad2"   long_name="square of module of salinity gradient"    unit="psu2/m2" grid_ref="grid_T_3D"/> 
     133    <field id="sssgrad"     long_name="module of surface salinity gradient"              unit="1e-3/m"   grid_ref="grid_T_2D_inner"/> 
     134    <field id="sssgrad2"    long_name="square of module of surface salinity gradient"    unit="1e-6/m2"  grid_ref="grid_T_2D_inner"/> 
    135135    <field id="ke"          long_name="kinetic energy"          standard_name="specific_kinetic_energy_of_sea_water"   unit="m2/s2"  grid_ref="grid_T_3D" /> 
    136     <field id="ke_int"      long_name="vertical integration of kinetic energy"   unit="m3/s2"   /> 
    137     <field id="relvor"      long_name="relative vorticity"                       unit="s-1"    grid_ref="grid_T_3D"/> 
    138     <field id="absvor"      long_name="absolute vorticity"                       unit="s-1"    grid_ref="grid_T_3D"/> 
    139     <field id="potvor"      long_name="potential vorticity"                      unit="s-1"    grid_ref="grid_T_3D"/> 
     136    <field id="ke_int"      long_name="vertical integration of kinetic energy"   unit="m3/s2"  grid_ref="grid_T_2D_inner" /> 
    140137    <field id="salt2c"      long_name="Salt content vertically integrated"       unit="1e-3*kg/m2" /> 
    141138 
     
    149146    <field id="sstmax"       long_name="max of sea surface temperature"   field_ref="sst"   operation="maximum"                                                 /> 
    150147    <field id="sstmin"       long_name="min of sea surface temperature"   field_ref="sst"   operation="minimum"                                                 /> 
    151     <field id="sstgrad"      long_name="module of sst gradient"                                                                                 unit="degC/m"   /> 
    152     <field id="sstgrad2"     long_name="square of module of sst gradient"                                                                       unit="degC2/m2" /> 
    153     <field id="sbt"          long_name="sea bottom temperature"                                                                                 unit="degC"     /> 
    154     <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" /> 
     148    <field id="sstgrad"      long_name="module of sst gradient"                                                                                 unit="degC/m"   grid_ref="grid_T_2D_inner" /> 
     149    <field id="sstgrad2"     long_name="square of module of sst gradient"                                                                       unit="degC2/m2" grid_ref="grid_T_2D_inner" /> 
     150    <field id="sbt"          long_name="sea bottom temperature"                                                                                 unit="degC"     grid_ref="grid_T_2D_inner" /> 
     151    <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" grid_ref="grid_T_2D_inner" /> 
    155152    <field id="sst_wl"       long_name="Delta SST of warm layer"                                                                                unit="degC"     /> 
    156153    <field id="sst_cs"       long_name="Delta SST of cool skin"                                                                                 unit="degC"     /> 
     
    161158    <field id="sssmax"       long_name="max of sea surface salinity"      field_ref="sss"   operation="maximum"                                                 /> 
    162159    <field id="sssmin"       long_name="min of sea surface salinity"      field_ref="sss"   operation="minimum"                                                 /> 
    163     <field id="sbs"          long_name="sea bottom salinity"                                                                                    unit="0.001"    /> 
    164     <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)" /> 
    165  
    166     <field id="taubot"       long_name="bottom stress module"                                                                                   unit="N/m2"    /> 
     160    <field id="sbs"          long_name="sea bottom salinity"                                                                                    unit="0.001"   grid_ref="grid_T_2D_inner" /> 
     161    <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)" grid_ref="grid_T_2D_inner" /> 
     162 
     163    <field id="taubot"       long_name="bottom stress module"   unit="N/m2"   grid_ref="grid_T_2D_inner" /> 
    167164 
    168165    <!-- Case EOS = TEOS-10 : output potential temperature --> 
     
    181178    <field id="mldr10_1max"  long_name="Max of Mixed Layer Depth (dsigma = 0.01 wrt 10m)"   field_ref="mldr10_1"   operation="maximum"                                                                          /> 
    182179    <field id="mldr10_1min"  long_name="Min of Mixed Layer Depth (dsigma = 0.01 wrt 10m)"   field_ref="mldr10_1"   operation="minimum"                                                                          /> 
    183     <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"      /> 
    184     <field id="saltc"        long_name="Salt content vertically integrated"                                                                                                                   unit="1e-3*kg/m2" /> 
    185     <field id="saltc2"       long_name="Salt content vertically integrated"                                                                                                                   unit="1e-3*kg/m2" > saltc * saltc </field > 
     180    <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"      grid_ref="grid_T_2D_inner" /> 
     181    <field id="saltc"        long_name="Salt content vertically integrated"                                                                                                                   unit="1e-3.m"    grid_ref="grid_T_2D_inner" /> 
     182    <field id="saltc2"       long_name="square of Salt content vertically integrated"                                                                                                         unit="1e-6.m2"   grid_ref="grid_T_2D_inner" /> 
    186183 
    187184    <!-- EOS --> 
     
    191188 
    192189    <!-- Energy - horizontal divergence --> 
    193     <field id="sKE"          long_name="surface kinetic energy"  standard_name="specific_kinetic_energy_of_sea_water"   unit="m2/s2"  grid_ref="grid_T_2D" /> 
     190    <field id="sKE"          long_name="surface kinetic energy"  standard_name="specific_kinetic_energy_of_sea_water"   unit="m2/s2"  grid_ref="grid_T_2D_inner" /> 
    194191    <field id="hdiv"         long_name="horizontal divergence"                                                          unit="s-1"    grid_ref="grid_T_3D" /> 
    195192 
     
    600597 
    601598    <field id="ssu"          long_name="ocean surface current along i-axis"                                                                 unit="m/s"                             /> 
    602     <field id="sbu"          long_name="ocean bottom current along i-axis"                                                                  unit="m/s"                            /> 
     599    <field id="sbu"          long_name="ocean bottom current along i-axis"                                                                  unit="m/s"  grid_ref="grid_U_2D_inner" /> 
    603600    <field id="ubar"         long_name="ocean barotropic current along i-axis"                                                              unit="m/s"                             /> 
    604601    <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" /> 
     
    639636 
    640637    <!-- variables available with diaar5 --> 
    641     <field id="u_masstr"      long_name="Ocean Mass X Transport"                                          standard_name="ocean_mass_x_transport"                         unit="kg/s"  grid_ref="grid_U_3D" /> 
    642     <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"                     /> 
    643     <field id="u_heattr"      long_name="ocean eulerian heat transport along i-axis"                      standard_name="ocean_heat_x_transport"                         unit="W"                        /> 
    644     <field id="u_salttr"      long_name="ocean eulerian salt transport along i-axis"                      standard_name="ocean_salt_x_transport"                         unit="1e-3*kg/s"                 /> 
     638    <field id="u_masstr"      long_name="Ocean Mass X Transport"                                          standard_name="ocean_mass_x_transport"                         unit="kg/s"   grid_ref="grid_U_3D" /> 
     639    <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"   grid_ref="grid_U_2D_inner" /> 
     640    <field id="u_heattr"      long_name="ocean eulerian heat transport along i-axis"                      standard_name="ocean_heat_x_transport"                         unit="W"      grid_ref="grid_U_2D_inner" /> 
     641    <field id="u_salttr"      long_name="ocean eulerian salt transport along i-axis"                      standard_name="ocean_salt_x_transport"                         unit="1e-3*kg/s" grid_ref="grid_U_2D_inner" /> 
    645642    <field id="uadv_heattr"   long_name="ocean advective heat transport along i-axis"                     standard_name="advectice_ocean_heat_x_transport"               unit="W"                         /> 
    646643    <field id="uadv_salttr"   long_name="ocean advective salt transport along i-axis"                     standard_name="advectice_ocean_salt_x_transport"               unit="1e-3*kg/s"                 /> 
     
    660657    <field id="voce_e3v"     long_name="ocean current along j-axis  (thickness weighted)"                                                   unit="m/s"        grid_ref="grid_V_3D"  > voce * e3v </field> 
    661658    <field id="ssv"          long_name="ocean surface current along j-axis"                                                                 unit="m/s"                             /> 
    662     <field id="sbv"          long_name="ocean bottom current along j-axis"                                                                  unit="m/s"                            /> 
     659    <field id="sbv"          long_name="ocean bottom current along j-axis"                                                                  unit="m/s"  grid_ref="grid_V_2D_inner" /> 
    663660    <field id="vbar"         long_name="ocean barotropic current along j-axis"                                                              unit="m/s"                             /> 
    664661    <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" /> 
     
    701698    <!-- variables available with diaar5 --> 
    702699    <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" /> 
    703     <field id="v_heattr"      long_name="ocean eulerian heat transport along j-axis"    standard_name="ocean_heat_y_transport"                          unit="W"                        /> 
    704     <field id="v_salttr"      long_name="ocean eulerian salt transport along i-axis"    standard_name="ocean_salt_y_transport"                          unit="1e-3*kg/s"                /> 
     700    <field id="v_heattr"      long_name="ocean eulerian heat transport along j-axis"    standard_name="ocean_heat_y_transport"                          unit="W"          grid_ref="grid_V_2D_inner" /> 
     701    <field id="v_salttr"      long_name="ocean eulerian salt transport along i-axis"    standard_name="ocean_salt_y_transport"                          unit="1e-3*kg/s"  grid_ref="grid_V_2D_inner" /> 
    705702    <field id="vadv_heattr"   long_name="ocean advective heat transport along j-axis"   standard_name="advectice_ocean_heat_y_transport"                unit="W"                         /> 
    706703    <field id="vadv_salttr"   long_name="ocean advective salt transport along j-axis"   standard_name="advectice_ocean_salt_y_transport"                unit="1e-3*kg/s"                 /> 
     
    775772    <field id="e3f_0"        long_name="F-cell thickness"                      standard_name="cell_thickness"         unit="m"   grid_ref="grid_F_3D" /> 
    776773    <field id="hf"           long_name="water column height at F point"        standard_name="water_column_height_F"  unit="m"                     /> 
    777     <field id="ssKEf"        long_name="surface kinetic energy at F point"     standard_name="specific_kinetic_energy_of_sea_water"   unit="m2/s2" /> 
    778     <field id="ssrelvor"     long_name="surface relative vorticity"            standard_name="relative_vorticity"     unit="1/s"                   /> 
    779     <field id="ssplavor"     long_name="surface planetary vorticity"           standard_name="planetary_vorticity"    unit="1/s"                   /> 
    780     <field id="ssrelpotvor"  long_name="surface relative potential vorticity"  standard_name="relpot_vorticity"       unit="1/m.s"                 /> 
    781     <field id="ssabspotvor"  long_name="surface absolute potential vorticity"  standard_name="abspot_vorticity"       unit="1/m.s"                 /> 
    782     <field id="ssEns"        long_name="surface enstrophy"                     standard_name="enstrophy"              unit="1/m2.s2"               /> 
     774    <field id="ssKEf"        long_name="surface kinetic energy at F point"     standard_name="specific_kinetic_energy_of_sea_water"   unit="m2/s2" grid_ref="grid_F_2D_inner" /> 
     775    <field id="ssrelvor"     long_name="surface relative vorticity"            standard_name="relative_vorticity"     unit="1/s"       grid_ref="grid_F_2D_inner" /> 
     776    <field id="ssplavor"     long_name="surface planetary vorticity"           standard_name="planetary_vorticity"    unit="1/s"       /> 
     777    <field id="ssrelpotvor"  long_name="surface relative potential vorticity"  standard_name="relpot_vorticity"       unit="1/m.s"     grid_ref="grid_F_2D_inner" /> 
     778    <field id="ssabspotvor"  long_name="surface absolute potential vorticity"  standard_name="abspot_vorticity"       unit="1/m.s"     grid_ref="grid_F_2D_inner" /> 
     779    <field id="ssEns"        long_name="surface enstrophy"                     standard_name="enstrophy"              unit="1/m2.s2"   grid_ref="grid_F_2D_inner" /> 
    783780  </field_group> 
    784781 
  • NEMO/trunk/cfgs/SHARED/grid_def_nemo.xml

    r14072 r15017  
    1212    <domain domain_ref="grid_T" /> 
    1313  </grid> 
     14  <grid id="grid_T_2D_inner" > 
     15    <domain domain_ref="grid_T_inner" /> 
     16  </grid> 
    1417  <!--  --> 
    1518  <grid id="grid_T_ncatice" > 
     
    1720    <axis axis_ref="ncatice" /> 
    1821  </grid> 
     22  <grid id="grid_T_ncatice_inner" > 
     23    <domain domain_ref="grid_T_inner" /> 
     24    <axis axis_ref="ncatice" /> 
     25  </grid> 
    1926  <!--  --> 
    2027  <grid id="grid_T_3D" > 
     
    2229    <axis axis_ref="deptht" /> 
    2330  </grid> 
     31  <grid id="grid_T_3D_inner" > 
     32    <domain domain_ref="grid_T_inner" /> 
     33    <axis axis_ref="deptht" /> 
     34  </grid> 
    2435  <!--  --> 
    2536  <grid id="grid_T_3DS" > 
     
    2738    <axis axis_ref="profsed" /> 
    2839  </grid> 
     40  <grid id="grid_T_3DS_inner" > 
     41    <domain domain_ref="grid_T_inner" /> 
     42    <axis axis_ref="profsed" /> 
     43  </grid> 
    2944  <!--  --> 
    3045  <grid id="grid_U_2D" > 
    3146    <domain domain_ref="grid_U" /> 
    3247  </grid> 
     48  <grid id="grid_U_2D_inner" > 
     49    <domain domain_ref="grid_U_inner" /> 
     50  </grid> 
    3351  <!--  --> 
    3452  <grid id="grid_U_3D" > 
     
    3654    <axis axis_ref="depthu" /> 
    3755  </grid> 
     56  <grid id="grid_U_3D_inner" > 
     57    <domain domain_ref="grid_U_inner" /> 
     58    <axis axis_ref="depthu" /> 
     59  </grid> 
    3860  <!--  --> 
    3961  <grid id="grid_V_2D" > 
    4062    <domain domain_ref="grid_V" /> 
    4163  </grid> 
     64  <grid id="grid_V_2D_inner" > 
     65    <domain domain_ref="grid_V_inner" /> 
     66  </grid> 
    4267  <!--  --> 
    4368  <grid id="grid_V_3D" > 
     
    4570    <axis axis_ref="depthv" /> 
    4671  </grid> 
     72  <grid id="grid_V_3D_inner" > 
     73    <domain domain_ref="grid_V_inner" /> 
     74    <axis axis_ref="depthv" /> 
     75  </grid> 
    4776  <!--  --> 
    4877  <grid id="grid_W_2D" > 
    4978    <domain domain_ref="grid_W" /> 
    5079  </grid> 
     80  <grid id="grid_W_2D_inner" > 
     81    <domain domain_ref="grid_W_inner" /> 
     82  </grid> 
    5183  <!--  --> 
    5284  <grid id="grid_W_3D" > 
    5385    <domain domain_ref="grid_W" /> 
    5486    <axis axis_ref="depthw" /> 
     87  </grid> 
     88  <grid id="grid_W_3D_inner" > 
     89    <domain domain_ref="grid_W" /> 
     90    <axis axis_ref="depthw_inner" /> 
    5591  </grid> 
    5692  <!--  --> 
    5793  <grid id="grid_F_2D" > 
    5894    <domain domain_ref="grid_F" /> 
     95  </grid> 
     96  <grid id="grid_F_2D_inner" > 
     97    <domain domain_ref="grid_F_inner" /> 
    5998  </grid> 
    6099  <!--  --> 
     
    63102    <axis axis_ref="depthf" /> 
    64103  </grid> 
     104  <grid id="grid_F_3D_inner" > 
     105    <domain domain_ref="grid_F_inner" /> 
     106    <axis axis_ref="depthf" /> 
     107  </grid> 
    65108  <!--  --> 
    66109  <grid id="grid_1point" > 
     
    77120  </grid> 
    78121  <!--  --> 
    79  
    80122 
    81123  <grid id="grid_znl_T_2D"> 
  • NEMO/trunk/src/OCE/DIA/diawri.F90

    r14476 r15017  
    123123      REAL(wp)::   zztmp2, zztmpy   !   -      - 
    124124      REAL(wp)::   ze3 
    125       REAL(wp), DIMENSION(jpi,jpj)     ::   z2d   ! 2D workspace 
    126       REAL(wp), DIMENSION(jpi,jpj,jpk) ::   z3d   ! 3D workspace 
     125      REAL(wp), DIMENSION(A2D(     0))     ::   z2d   ! 2D workspace 
     126      REAL(wp), DIMENSION(A2D(nn_hls),jpk) ::   z3d   ! 3D workspace 
    127127      !!---------------------------------------------------------------------- 
    128128      !  
     
    145145            z3d(:,:,jk) = gdept(:,:,jk,Kmm) 
    146146         END DO 
    147          CALL iom_put( "tpt_dep",     z3d(:,:,:) ) 
     147         CALL iom_put( "tpt_dep", z3d ) 
    148148      ENDIF 
    149149 
     
    152152            z3d(:,:,jk) =  e3t(:,:,jk,Kmm) 
    153153         END DO 
    154          CALL iom_put( "e3t"     ,     z3d(:,:,:) ) 
    155          CALL iom_put( "e3tdef"  , ( ( z3d(:,:,:) - e3t_0(:,:,:) ) / e3t_0(:,:,:) * 100 * tmask(:,:,:) ) ** 2 )  
     154         CALL iom_put( "e3t", z3d ) 
     155         IF ( iom_use("e3tdef") ) THEN 
     156            z3d(:,:,:) = ( ( z3d(:,:,:) - e3t_0(:,:,:) ) / e3t_0(:,:,:) * 100._wp * tmask(:,:,:) ) ** 2  
     157            CALL iom_put( "e3tdef", z3d )  
     158         ENDIF 
    156159      ENDIF  
    157160      IF ( iom_use("e3u") ) THEN                         ! time-varying e3u 
     
    159162            z3d(:,:,jk) =  e3u(:,:,jk,Kmm) 
    160163         END DO  
    161          CALL iom_put( "e3u" , z3d(:,:,:) ) 
     164         CALL iom_put( "e3u" , z3d ) 
    162165      ENDIF 
    163166      IF ( iom_use("e3v") ) THEN                         ! time-varying e3v 
     
    165168            z3d(:,:,jk) =  e3v(:,:,jk,Kmm) 
    166169         END DO  
    167          CALL iom_put( "e3v" , z3d(:,:,:) ) 
     170         CALL iom_put( "e3v" , z3d ) 
    168171      ENDIF 
    169172      IF ( iom_use("e3w") ) THEN                         ! time-varying e3w 
     
    171174            z3d(:,:,jk) =  e3w(:,:,jk,Kmm) 
    172175         END DO  
    173          CALL iom_put( "e3w" , z3d(:,:,:) ) 
     176         CALL iom_put( "e3w" , z3d ) 
    174177      ENDIF 
    175178      IF ( iom_use("e3f") ) THEN                         ! time-varying e3f caution here at Kaa 
     
    177180            z3d(:,:,jk) =  e3f(:,:,jk) 
    178181         END DO 
    179          CALL iom_put( "e3f" , z3d(:,:,:) ) 
    180       ENDIF 
    181  
    182       IF( ll_wd ) THEN                                   ! sea surface height (brought back to the reference used for wetting and drying) 
    183          CALL iom_put( "ssh" , (ssh(:,:,Kmm)+ssh_ref)*ssmask(:,:) ) 
    184       ELSE 
    185          CALL iom_put( "ssh" , ssh(:,:,Kmm) )              ! sea surface height 
     182         CALL iom_put( "e3f" , z3d ) 
     183      ENDIF 
     184 
     185      IF ( iom_use("ssh") ) THEN 
     186         IF( ll_wd ) THEN                                ! sea surface height (brought back to the reference used for wetting and drying) 
     187            CALL iom_put( "ssh" , (ssh(:,:,Kmm)+ssh_ref)*ssmask(:,:) ) 
     188         ELSE 
     189            CALL iom_put( "ssh" ,  ssh(:,:,Kmm) )        ! sea surface height 
     190         ENDIF 
    186191      ENDIF 
    187192 
     
    218223 
    219224      IF ( iom_use("taubot") ) THEN                ! bottom stress 
    220          zztmp = rho0 * 0.25 
     225         zztmp = rho0 * 0.25_wp 
    221226         z2d(:,:) = 0._wp 
    222227         DO_2D( 0, 0, 0, 0 ) 
     
    252257 
    253258      !                                            ! vertical velocity 
    254       IF( ln_zad_Aimp ) THEN   ;   CALL iom_put( "woce", ww + wi )   ! explicit plus implicit parts 
    255       ELSE                     ;   CALL iom_put( "woce", ww ) 
     259      IF( ln_zad_Aimp ) THEN   ;   IF( iom_use('woce') )   CALL iom_put( "woce", ww + wi )   ! explicit plus implicit parts 
     260      ELSE                     ;                           CALL iom_put( "woce", ww ) 
    256261      ENDIF 
    257262 
     
    276281      IF( iom_use('logavs') )   CALL iom_put( "logavs", LOG( MAX( 1.e-20_wp, avs(:,:,:) ) ) ) 
    277282 
    278       IF ( iom_use("socegrad") .OR. iom_use("socegrad2") ) THEN 
    279          z3d(:,:,jpk) = 0. 
    280          DO_3D( 0, 0, 0, 0, 1, jpkm1 ) 
    281             zztmp  = ts(ji,jj,jk,jp_sal,Kmm) 
    282             zztmpx = (ts(ji+1,jj,jk,jp_sal,Kmm) - zztmp) * r1_e1u(ji,jj) + (zztmp - ts(ji-1,jj  ,jk,jp_sal,Kmm)) * r1_e1u(ji-1,jj) 
    283             zztmpy = (ts(ji,jj+1,jk,jp_sal,Kmm) - zztmp) * r1_e2v(ji,jj) + (zztmp - ts(ji  ,jj-1,jk,jp_sal,Kmm)) * r1_e2v(ji,jj-1) 
    284             z3d(ji,jj,jk) = 0.25 * ( zztmpx * zztmpx + zztmpy * zztmpy )   & 
    285                &                 * umask(ji,jj,jk) * umask(ji-1,jj,jk) * vmask(ji,jj,jk) * umask(ji,jj-1,jk) 
    286          END_3D 
    287          CALL iom_put( "socegrad2",  z3d )          ! square of module of sal gradient 
    288          DO_3D( 0, 0, 0, 0, 1, jpkm1 ) 
    289             z3d(ji,jj,jk) = SQRT( z3d(ji,jj,jk) ) 
    290          END_3D 
    291          CALL iom_put( "socegrad" ,  z3d )          ! module of sal gradient 
     283      IF ( iom_use("sssgrad") .OR. iom_use("sssgrad2") ) THEN 
     284         DO_2D( 0, 0, 0, 0 )                       ! sss gradient 
     285            zztmp  = ts(ji,jj,1,jp_sal,Kmm) 
     286            zztmpx = (ts(ji+1,jj,1,jp_sal,Kmm) - zztmp) * r1_e1u(ji,jj) + (zztmp - ts(ji-1,jj  ,1,jp_sal,Kmm)) * r1_e1u(ji-1,jj) 
     287            zztmpy = (ts(ji,jj+1,1,jp_sal,Kmm) - zztmp) * r1_e2v(ji,jj) + (zztmp - ts(ji  ,jj-1,1,jp_sal,Kmm)) * r1_e2v(ji,jj-1) 
     288            z2d(ji,jj) = 0.25_wp * ( zztmpx * zztmpx + zztmpy * zztmpy )   & 
     289               &                 * umask(ji,jj,1) * umask(ji-1,jj,1) * vmask(ji,jj,1) * vmask(ji,jj-1,1) 
     290         END_2D 
     291         CALL iom_put( "sssgrad2",  z2d )          ! square of module of sss gradient 
     292         IF ( iom_use("sssgrad") ) THEN 
     293            DO_2D( 0, 0, 0, 0 ) 
     294               z2d(ji,jj) = SQRT( z2d(ji,jj) ) 
     295            END_2D 
     296            CALL iom_put( "sssgrad",  z2d )        ! module of sss gradient 
     297         ENDIF 
    292298      ENDIF 
    293299          
    294300      IF ( iom_use("sstgrad") .OR. iom_use("sstgrad2") ) THEN 
    295          DO_2D( 0, 0, 0, 0 )                                 ! sst gradient 
     301         DO_2D( 0, 0, 0, 0 )                       ! sst gradient 
    296302            zztmp  = ts(ji,jj,1,jp_tem,Kmm) 
    297303            zztmpx = ( ts(ji+1,jj,1,jp_tem,Kmm) - zztmp ) * r1_e1u(ji,jj) + ( zztmp - ts(ji-1,jj  ,1,jp_tem,Kmm) ) * r1_e1u(ji-1,jj) 
    298304            zztmpy = ( ts(ji,jj+1,1,jp_tem,Kmm) - zztmp ) * r1_e2v(ji,jj) + ( zztmp - ts(ji  ,jj-1,1,jp_tem,Kmm) ) * r1_e2v(ji,jj-1) 
    299             z2d(ji,jj) = 0.25 * ( zztmpx * zztmpx + zztmpy * zztmpy )   & 
    300                &              * umask(ji,jj,1) * umask(ji-1,jj,1) * vmask(ji,jj,1) * umask(ji,jj-1,1) 
     305            z2d(ji,jj) = 0.25_wp * ( zztmpx * zztmpx + zztmpy * zztmpy )   & 
     306               &                 * umask(ji,jj,1) * umask(ji-1,jj,1) * vmask(ji,jj,1) * vmask(ji,jj-1,1) 
    301307         END_2D 
    302308         CALL iom_put( "sstgrad2",  z2d )          ! square of module of sst gradient 
    303          DO_2D( 0, 0, 0, 0 ) 
    304             z2d(ji,jj) = SQRT( z2d(ji,jj) ) 
    305          END_2D 
    306          CALL iom_put( "sstgrad" ,  z2d )          ! module of sst gradient 
     309         IF ( iom_use("sstgrad") ) THEN 
     310            DO_2D( 0, 0, 0, 0 ) 
     311               z2d(ji,jj) = SQRT( z2d(ji,jj) ) 
     312            END_2D 
     313            CALL iom_put( "sstgrad",  z2d )        ! module of sst gradient 
     314         ENDIF 
    307315      ENDIF 
    308316          
     
    321329            z2d(ji,jj) = z2d(ji,jj) + e3t(ji,jj,jk,Kmm) * ts(ji,jj,jk,jp_sal,Kmm) * tmask(ji,jj,jk) 
    322330         END_3D 
    323          CALL iom_put( "saltc", rho0 * z2d )          ! vertically integrated salt content (PSU*kg/m2) 
     331         CALL iom_put( "saltc", rho0 * z2d )       ! vertically integrated salt content (PSU*kg/m2) 
    324332      ENDIF 
    325333      ! 
     
    329337            z2d(ji,jj) = z2d(ji,jj) + e3t(ji,jj,jk,Kmm) * ts(ji,jj,jk,jp_sal,Kmm) * ts(ji,jj,jk,jp_sal,Kmm) * tmask(ji,jj,jk) 
    330338         END_3D 
    331          CALL iom_put( "salt2c", rho0 * z2d )          ! vertically integrated salt content (PSU*kg/m2) 
     339         CALL iom_put( "salt2c", rho0 * z2d )      ! vertically integrated salt content (PSU*kg/m2) 
    332340      ENDIF 
    333341      ! 
     
    335343         z3d(:,:,jpk) = 0._wp  
    336344         DO_3D( 0, 0, 0, 0, 1, jpkm1 ) 
    337             zztmpx = 0.5 * ( uu(ji-1,jj  ,jk,Kmm) + uu(ji,jj,jk,Kmm) ) 
    338             zztmpy = 0.5 * ( vv(ji  ,jj-1,jk,Kmm) + vv(ji,jj,jk,Kmm) ) 
    339             z3d(ji,jj,jk) = 0.5 * ( zztmpx*zztmpx + zztmpy*zztmpy ) 
     345            zztmpx = uu(ji-1,jj  ,jk,Kmm) + uu(ji,jj,jk,Kmm) 
     346            zztmpy = vv(ji  ,jj-1,jk,Kmm) + vv(ji,jj,jk,Kmm) 
     347            z3d(ji,jj,jk) = 0.25_wp * ( zztmpx*zztmpx + zztmpy*zztmpy ) 
    340348         END_3D 
    341349         CALL iom_put( "ke", z3d )                 ! kinetic energy 
     
    345353            z2d(ji,jj) = z2d(ji,jj) + e3t(ji,jj,jk,Kmm) * z3d(ji,jj,jk) * e1e2t(ji,jj) * tmask(ji,jj,jk) 
    346354         END_3D 
    347          CALL iom_put( "ke_int", z2d )   ! vertically integrated kinetic energy 
    348       ENDIF 
    349       ! 
    350       IF ( iom_use("sKE") ) THEN                        ! surface kinetic energy at T point 
     355         CALL iom_put( "ke_int", z2d )             ! vertically integrated kinetic energy 
     356      ENDIF 
     357      ! 
     358      IF ( iom_use("sKE") ) THEN                   ! surface kinetic energy at T point 
    351359         z2d(:,:) = 0._wp 
    352360         DO_2D( 0, 0, 0, 0 ) 
     
    357365               &                 * r1_e1e2t(ji,jj) / e3t(ji,jj,1,Kmm) * ssmask(ji,jj) 
    358366         END_2D 
    359          CALL lbc_lnk( 'diawri', z2d, 'T', 1. ) 
    360367         IF ( iom_use("sKE" ) )  CALL iom_put( "sKE" , z2d )    
    361368      ENDIF 
    362369      !     
    363       IF ( iom_use("ssKEf") ) THEN                        ! surface kinetic energy at F point 
    364          z2d(:,:) = 0._wp                                ! CAUTION : only valid in SWE, not with bathymetry 
     370      IF ( iom_use("ssKEf") ) THEN                 ! surface kinetic energy at F point 
     371         z2d(:,:) = 0._wp                          ! CAUTION : only valid in SWE, not with bathymetry 
    365372         DO_2D( 0, 0, 0, 0 ) 
    366373            z2d(ji,jj) = 0.25_wp * ( uu(ji,jj  ,1,Kmm) * uu(ji,jj  ,1,Kmm) * e1e2u(ji,jj  ) * e3u(ji,jj  ,1,Kmm)  & 
     
    370377               &                 * r1_e1e2f(ji,jj) / e3f(ji,jj,1) * ssfmask(ji,jj) 
    371378         END_2D 
    372          CALL lbc_lnk( 'diawri', z2d, 'F', 1. ) 
    373379         CALL iom_put( "ssKEf", z2d )                      
    374380      ENDIF 
    375381      ! 
    376       CALL iom_put( "hdiv", hdiv )                  ! Horizontal divergence 
    377  
    378       IF ( iom_use("relvor") .OR. iom_use("absvor") .OR. iom_use("potvor") ) THEN 
     382      CALL iom_put( "hdiv", hdiv )                 ! Horizontal divergence 
     383      ! 
     384      IF( iom_use("u_masstr") .OR. iom_use("u_masstr_vint") .OR. iom_use("u_heattr") .OR. iom_use("u_salttr") ) THEN 
    379385          
    380          z3d(:,:,jpk) = 0._wp  
    381          DO_3D( 0, 0, 0, 0, 1, jpkm1 ) 
    382             z3d(ji,jj,jk) = (   e2v(ji+1,jj  ) * vv(ji+1,jj  ,jk,Kmm) - e2v(ji,jj) * vv(ji,jj,jk,Kmm)    & 
    383                &              - e1u(ji  ,jj+1) * uu(ji  ,jj+1,jk,Kmm) + e1u(ji,jj) * uu(ji,jj,jk,Kmm)  ) * r1_e1e2f(ji,jj) 
    384          END_3D 
    385          CALL iom_put( "relvor", z3d )                  ! relative vorticity 
    386  
    387          DO_3D( 0, 0, 0, 0, 1, jpkm1 ) 
    388             z3d(ji,jj,jk) = ff_f(ji,jj) + z3d(ji,jj,jk)  
    389          END_3D 
    390          CALL iom_put( "absvor", z3d )                  ! absolute vorticity 
    391  
    392          DO_3D( 0, 0, 0, 0, 1, jpkm1 ) 
    393             ze3  = (  e3t(ji,jj+1,jk,Kmm)*tmask(ji,jj+1,jk) + e3t(ji+1,jj+1,jk,Kmm)*tmask(ji+1,jj+1,jk)   & 
    394                &    + e3t(ji,jj  ,jk,Kmm)*tmask(ji,jj  ,jk) + e3t(ji+1,jj  ,jk,Kmm)*tmask(ji+1,jj  ,jk)  ) 
    395             IF( ze3 /= 0._wp ) THEN   ;   ze3 = 4._wp / ze3 
    396             ELSE                      ;   ze3 = 0._wp 
    397             ENDIF 
    398             z3d(ji,jj,jk) = ze3 * z3d(ji,jj,jk)  
    399          END_3D 
    400          CALL iom_put( "potvor", z3d )                  ! potential vorticity 
    401  
    402       ENDIF 
    403       ! 
    404       IF( iom_use("u_masstr") .OR. iom_use("u_masstr_vint") .OR. iom_use("u_heattr") .OR. iom_use("u_salttr") ) THEN 
    405          z3d(:,:,jpk) = 0.e0 
    406          z2d(:,:) = 0.e0 
     386         z3d(:,:,jpk) = 0._wp 
    407387         DO jk = 1, jpkm1 
    408388            z3d(:,:,jk) = rho0 * uu(:,:,jk,Kmm) * e2u(:,:) * e3u(:,:,jk,Kmm) * umask(:,:,jk) 
    409             z2d(:,:) = z2d(:,:) + z3d(:,:,jk) 
    410389         END DO 
    411          CALL iom_put( "u_masstr"     , z3d )         ! mass transport in i-direction 
    412          CALL iom_put( "u_masstr_vint", z2d )         ! mass transport in i-direction vertical sum 
    413       ENDIF 
    414        
    415       IF( iom_use("u_heattr") ) THEN 
    416          z2d(:,:) = 0._wp  
    417          DO_3D( 0, 0, 0, 0, 1, jpkm1 ) 
    418             z2d(ji,jj) = z2d(ji,jj) + z3d(ji,jj,jk) * ( ts(ji,jj,jk,jp_tem,Kmm) + ts(ji+1,jj,jk,jp_tem,Kmm) ) 
    419          END_3D 
    420          CALL iom_put( "u_heattr", 0.5*rcp * z2d )    ! heat transport in i-direction 
    421       ENDIF 
    422  
    423       IF( iom_use("u_salttr") ) THEN 
    424          z2d(:,:) = 0.e0  
    425          DO_3D( 0, 0, 0, 0, 1, jpkm1 ) 
    426             z2d(ji,jj) = z2d(ji,jj) + z3d(ji,jj,jk) * ( ts(ji,jj,jk,jp_sal,Kmm) + ts(ji+1,jj,jk,jp_sal,Kmm) ) 
    427          END_3D 
    428          CALL iom_put( "u_salttr", 0.5 * z2d )        ! heat transport in i-direction 
    429       ENDIF 
    430  
     390         CALL iom_put( "u_masstr"     , z3d )      ! mass transport in i-direction 
     391          
     392         IF( iom_use("u_masstr_vint") ) THEN 
     393            z2d(:,:) = 0._wp  
     394            DO_3D( 0, 0, 0, 0, 1, jpkm1 ) 
     395               z2d(:,:) = z2d(:,:) + z3d(:,:,jk) 
     396            END_3D 
     397            CALL iom_put( "u_masstr_vint", z2d )   ! mass transport in i-direction vertical sum 
     398         ENDIF 
     399         IF( iom_use("u_heattr") ) THEN 
     400            z2d(:,:) = 0._wp  
     401            zztmp = 0.5_wp * rcp 
     402            DO_3D( 0, 0, 0, 0, 1, jpkm1 ) 
     403               z2d(ji,jj) = z2d(ji,jj) + zztmp * z3d(ji,jj,jk) * ( ts(ji,jj,jk,jp_tem,Kmm) + ts(ji+1,jj,jk,jp_tem,Kmm) ) 
     404            END_3D 
     405            CALL iom_put( "u_heattr", z2d )        ! heat transport in i-direction 
     406         ENDIF 
     407         IF( iom_use("u_salttr") ) THEN 
     408            z2d(:,:) = 0._wp  
     409            DO_3D( 0, 0, 0, 0, 1, jpkm1 ) 
     410               z2d(ji,jj) = z2d(ji,jj) +   0.5 * z3d(ji,jj,jk) * ( ts(ji,jj,jk,jp_sal,Kmm) + ts(ji+1,jj,jk,jp_sal,Kmm) ) 
     411            END_3D 
     412            CALL iom_put( "u_salttr", z2d )        ! heat transport in i-direction 
     413         ENDIF 
     414          
     415      ENDIF 
    431416       
    432417      IF( iom_use("v_masstr") .OR. iom_use("v_heattr") .OR. iom_use("v_salttr") ) THEN 
    433          z3d(:,:,jpk) = 0.e0 
     418          
     419         z3d(:,:,jpk) = 0._wp 
    434420         DO jk = 1, jpkm1 
    435421            z3d(:,:,jk) = rho0 * vv(:,:,jk,Kmm) * e1v(:,:) * e3v(:,:,jk,Kmm) * vmask(:,:,jk) 
    436422         END DO 
    437          CALL iom_put( "v_masstr", z3d )              ! mass transport in j-direction 
    438       ENDIF 
    439        
    440       IF( iom_use("v_heattr") ) THEN 
    441          z2d(:,:) = 0.e0  
    442          DO_3D( 0, 0, 0, 0, 1, jpkm1 ) 
    443             z2d(ji,jj) = z2d(ji,jj) + z3d(ji,jj,jk) * ( ts(ji,jj,jk,jp_tem,Kmm) + ts(ji,jj+1,jk,jp_tem,Kmm) ) 
    444          END_3D 
    445          CALL iom_put( "v_heattr", 0.5*rcp * z2d )    !  heat transport in j-direction 
    446       ENDIF 
    447  
    448       IF( iom_use("v_salttr") ) THEN 
    449          z2d(:,:) = 0._wp  
    450          DO_3D( 0, 0, 0, 0, 1, jpkm1 ) 
    451             z2d(ji,jj) = z2d(ji,jj) + z3d(ji,jj,jk) * ( ts(ji,jj,jk,jp_sal,Kmm) + ts(ji,jj+1,jk,jp_sal,Kmm) ) 
    452          END_3D 
    453          CALL iom_put( "v_salttr", 0.5 * z2d )        !  heat transport in j-direction 
     423         CALL iom_put( "v_masstr", z3d )           ! mass transport in j-direction 
     424          
     425         IF( iom_use("v_heattr") ) THEN 
     426            z2d(:,:) = 0._wp 
     427            zztmp = 0.5_wp * rcp 
     428            DO_3D( 0, 0, 0, 0, 1, jpkm1 ) 
     429               z2d(ji,jj) = z2d(ji,jj) + zztmp * z3d(ji,jj,jk) * ( ts(ji,jj,jk,jp_tem,Kmm) + ts(ji,jj+1,jk,jp_tem,Kmm) ) 
     430            END_3D 
     431            CALL iom_put( "v_heattr", z2d )        !  heat transport in j-direction 
     432         ENDIF 
     433         IF( iom_use("v_salttr") ) THEN 
     434            z2d(:,:) = 0._wp  
     435            DO_3D( 0, 0, 0, 0, 1, jpkm1 ) 
     436               z2d(ji,jj) = z2d(ji,jj) +   0.5 * z3d(ji,jj,jk) * ( ts(ji,jj,jk,jp_sal,Kmm) + ts(ji,jj+1,jk,jp_sal,Kmm) ) 
     437            END_3D 
     438            CALL iom_put( "v_salttr", z2d )        !  heat transport in j-direction 
     439         ENDIF 
     440 
    454441      ENDIF 
    455442 
     
    457444         z2d(:,:) = 0._wp 
    458445         DO_3D( 0, 0, 0, 0, 1, jpkm1 ) 
    459             z2d(ji,jj) = z2d(ji,jj) + e3t(ji,jj,jk,Kmm) * ts(ji,jj,jk,jp_tem,Kmm) 
     446            z2d(ji,jj) = z2d(ji,jj) + rho0 * e3t(ji,jj,jk,Kmm) * ts(ji,jj,jk,jp_tem,Kmm) 
    460447         END_3D 
    461          CALL iom_put( "tosmint", rho0 * z2d )        ! Vertical integral of temperature 
     448         CALL iom_put( "tosmint", z2d )            ! Vertical integral of temperature 
    462449      ENDIF 
    463450      IF( iom_use("somint") ) THEN 
    464          z2d(:,:)=0._wp 
     451         z2d(:,:) = 0._wp 
    465452         DO_3D( 0, 0, 0, 0, 1, jpkm1 ) 
    466             z2d(ji,jj) = z2d(ji,jj) + e3t(ji,jj,jk,Kmm) * ts(ji,jj,jk,jp_sal,Kmm) 
     453            z2d(ji,jj) = z2d(ji,jj) + rho0 * e3t(ji,jj,jk,Kmm) * ts(ji,jj,jk,jp_sal,Kmm) 
    467454         END_3D 
    468          CALL iom_put( "somint", rho0 * z2d )         ! Vertical integral of salinity 
    469       ENDIF 
    470  
    471       CALL iom_put( "bn2", rn2 )                      ! Brunt-Vaisala buoyancy frequency (N^2) 
    472       ! 
     455         CALL iom_put( "somint", z2d )             ! Vertical integral of salinity 
     456      ENDIF 
     457 
     458      CALL iom_put( "bn2", rn2 )                   ! Brunt-Vaisala buoyancy frequency (N^2) 
    473459       
    474       IF (ln_dia25h)   CALL dia_25h( kt, Kmm )        ! 25h averaging 
     460      IF (ln_dia25h)   CALL dia_25h( kt, Kmm )     ! 25h averaging 
    475461       
    476462      ! Output of surface vorticity terms 
    477       IF ( iom_use("ssrelvor")    .OR. iom_use("ssplavor")    .OR.   & 
    478          & iom_use("ssrelpotvor") .OR. iom_use("ssabspotvor") .OR.   & 
    479          & iom_use("ssEns")                                        ) THEN 
     463      ! 
     464      CALL iom_put( "ssplavor", ff_f )             ! planetary vorticity ( f ) 
     465      ! 
     466      IF ( iom_use("ssrelvor")    .OR. iom_use("ssEns")    .OR.   & 
     467         & iom_use("ssrelpotvor") .OR. iom_use("ssabspotvor") ) THEN 
    480468         ! 
    481469         z2d(:,:) = 0._wp  
    482          ze3 = 0._wp  
    483          DO_2D( 1, 0, 1, 0 ) 
     470         DO_2D( 0, 0, 0, 0 ) 
    484471            z2d(ji,jj) = (   e2v(ji+1,jj  ) * vv(ji+1,jj  ,1,Kmm) - e2v(ji,jj) * vv(ji,jj,1,Kmm)    & 
    485472            &              - e1u(ji  ,jj+1) * uu(ji  ,jj+1,1,Kmm) + e1u(ji,jj) * uu(ji,jj,1,Kmm)  ) * r1_e1e2f(ji,jj) 
    486473         END_2D 
    487          CALL lbc_lnk( 'diawri', z2d, 'F', 1. ) 
    488          CALL iom_put( "ssrelvor", z2d )                  ! relative vorticity ( zeta )  
     474         CALL iom_put( "ssrelvor", z2d )           ! relative vorticity ( zeta )  
    489475         ! 
    490          CALL iom_put( "ssplavor", ff_f )                 ! planetary vorticity ( f ) 
    491          ! 
    492          DO_2D( 1, 0, 1, 0 )   
    493             ze3 = (  e3t(ji,jj+1,1,Kmm) * e1e2t(ji,jj+1) + e3t(ji+1,jj+1,1,Kmm) * e1e2t(ji+1,jj+1)    & 
    494               &    + e3t(ji,jj  ,1,Kmm) * e1e2t(ji,jj  ) + e3t(ji+1,jj  ,1,Kmm) * e1e2t(ji+1,jj  )  ) * r1_e1e2f(ji,jj) 
    495             IF( ze3 /= 0._wp ) THEN   ;   ze3 = 4._wp / ze3 
    496             ELSE                      ;   ze3 = 0._wp 
     476         IF ( iom_use("ssEns") .OR. iom_use("ssrelpotvor") .OR. iom_use("ssabspotvor") ) THEN 
     477            DO_2D( 0, 0, 0, 0 )   
     478               ze3 = (  e3t(ji,jj+1,1,Kmm) * e1e2t(ji,jj+1) + e3t(ji+1,jj+1,1,Kmm) * e1e2t(ji+1,jj+1)    & 
     479                  &    + e3t(ji,jj  ,1,Kmm) * e1e2t(ji,jj  ) + e3t(ji+1,jj  ,1,Kmm) * e1e2t(ji+1,jj  )  ) * r1_e1e2f(ji,jj) 
     480               IF( ze3 /= 0._wp ) THEN   ;   ze3 = 4._wp / ze3 
     481               ELSE                      ;   ze3 = 0._wp 
     482               ENDIF 
     483               z2d(ji,jj) = ze3 * z2d(ji,jj)  
     484            END_2D 
     485            CALL iom_put( "ssrelpotvor", z2d )     ! relative potential vorticity (zeta/h) 
     486            ! 
     487            IF ( iom_use("ssEns") .OR. iom_use("ssabspotvor") ) THEN 
     488               DO_2D( 0, 0, 0, 0 ) 
     489                  ze3 = (  e3t(ji,jj+1,1,Kmm) * e1e2t(ji,jj+1) + e3t(ji+1,jj+1,1,Kmm) * e1e2t(ji+1,jj+1)    & 
     490                     &    + e3t(ji,jj  ,1,Kmm) * e1e2t(ji,jj  ) + e3t(ji+1,jj  ,1,Kmm) * e1e2t(ji+1,jj  )  ) * r1_e1e2f(ji,jj) 
     491                  IF( ze3 /= 0._wp ) THEN   ;   ze3 = 4._wp / ze3 
     492                  ELSE                      ;   ze3 = 0._wp 
     493                  ENDIF 
     494                  z2d(ji,jj) = ze3 * ff_f(ji,jj) + z2d(ji,jj)  
     495               END_2D 
     496               CALL iom_put( "ssabspotvor", z2d )  ! absolute potential vorticity ( q ) 
     497               ! 
     498               IF ( iom_use("ssEns") ) THEN 
     499                  DO_2D( 0, 0, 0, 0 )   
     500                     z2d(ji,jj) = 0.5_wp * z2d(ji,jj) * z2d(ji,jj)  
     501                  END_2D 
     502                  CALL iom_put( "ssEns", z2d )     ! potential enstrophy ( 1/2*q2 ) 
     503               ENDIF 
    497504            ENDIF 
    498             z2d(ji,jj) = ze3 * z2d(ji,jj)  
    499          END_2D 
    500          CALL lbc_lnk( 'diawri', z2d, 'F', 1. ) 
    501          CALL iom_put( "ssrelpotvor", z2d )                  ! relative potential vorticity (zeta/h) 
    502          ! 
    503          DO_2D( 1, 0, 1, 0 ) 
    504             ze3 = (  e3t(ji,jj+1,1,Kmm) * e1e2t(ji,jj+1) + e3t(ji+1,jj+1,1,Kmm) * e1e2t(ji+1,jj+1)    & 
    505               &    + e3t(ji,jj  ,1,Kmm) * e1e2t(ji,jj  ) + e3t(ji+1,jj  ,1,Kmm) * e1e2t(ji+1,jj  )  ) * r1_e1e2f(ji,jj) 
    506             IF( ze3 /= 0._wp ) THEN   ;   ze3 = 4._wp / ze3 
    507             ELSE                      ;   ze3 = 0._wp 
    508             ENDIF 
    509             z2d(ji,jj) = ze3 * ff_f(ji,jj) + z2d(ji,jj)  
    510          END_2D 
    511          CALL lbc_lnk( 'diawri', z2d, 'F', 1. ) 
    512          CALL iom_put( "ssabspotvor", z2d )                  ! absolute potential vorticity ( q ) 
    513          ! 
    514          DO_2D( 1, 0, 1, 0 )   
    515             z2d(ji,jj) = 0.5_wp * z2d(ji,jj)  * z2d(ji,jj)  
    516          END_2D 
    517          CALL lbc_lnk( 'diawri', z2d, 'F', 1. ) 
    518          CALL iom_put( "ssEns", z2d )                        ! potential enstrophy ( 1/2*q2 ) 
    519          ! 
     505         ENDIF 
    520506      ENDIF 
    521507 
  • NEMO/trunk/src/OCE/IOM/iom.F90

    r14834 r15017  
    23302330      CALL iom_set_domain_attr("grid_"//cdgrd, data_dim=2, data_ibegin = -nn_hls, data_ni=jpi, data_jbegin = -nn_hls, data_nj=jpj) 
    23312331 
     2332      CALL iom_set_domain_attr("grid_"//cdgrd//"_inner", ni_glo = Ni0glo, nj_glo = Nj0glo,   & 
     2333         &                     ibegin = mig0(Nis0) - 1, jbegin = mjg0(Njs0) - 1, ni = Ni_0, nj = Nj_0) 
     2334      CALL iom_set_domain_attr("grid_"//cdgrd//"_inner", data_dim=2, data_ibegin = 0, data_ni=Ni_0, data_jbegin = 0, data_nj=Nj_0) 
     2335 
    23322336      IF( ln_tile ) THEN 
    23332337         DO jn = 1, nijtile 
     
    23392343         ! Tile_[ij]begin are defined with respect to the processor data domain, so data_[ij]begin is added 
    23402344         CALL iom_set_domain_attr("grid_"//cdgrd, ntiles=nijtile,                                     & 
     2345            & tile_ibegin=ntsi_a(1:nijtile) + idb(:) - 1, tile_jbegin=ntsj_a(1:nijtile) + idb(:) - 1, & 
     2346            & tile_ni=ini(:), tile_nj=inj(:),                                                         & 
     2347            & tile_data_ibegin=idb(:), tile_data_jbegin=idb(:),                                       & 
     2348            & tile_data_ni=ini(:) - 2 * idb(:), tile_data_nj=inj(:) - 2 * idb(:)) 
     2349         CALL iom_set_domain_attr("grid_"//cdgrd//"_inner", ntiles=nijtile,                           & 
    23412350            & tile_ibegin=ntsi_a(1:nijtile) + idb(:) - 1, tile_jbegin=ntsj_a(1:nijtile) + idb(:) - 1, & 
    23422351            & tile_ni=ini(:), tile_nj=inj(:),                                                         & 
     
    23612370         END SELECT 
    23622371         ! 
    2363          CALL iom_set_domain_attr( "grid_"//cdgrd       , mask = RESHAPE(zmask(Nis0:Nie0,Njs0:Nje0,1),(/Ni_0*Nj_0    /)) /= 0. ) 
    2364          CALL iom_set_grid_attr  ( "grid_"//cdgrd//"_3D", mask = RESHAPE(zmask(Nis0:Nie0,Njs0:Nje0,:),(/Ni_0,Nj_0,jpk/)) /= 0. ) 
     2372         CALL iom_set_domain_attr( "grid_"//cdgrd             , mask=RESHAPE(zmask(Nis0:Nie0,Njs0:Nje0,1),(/Ni_0*Nj_0    /)) /= 0. ) 
     2373         CALL iom_set_grid_attr  ( "grid_"//cdgrd//"_3D"      , mask=RESHAPE(zmask(Nis0:Nie0,Njs0:Nje0,:),(/Ni_0,Nj_0,jpk/)) /= 0. ) 
     2374         CALL iom_set_domain_attr( "grid_"//cdgrd//"_inner"   , mask=RESHAPE(zmask(Nis0:Nie0,Njs0:Nje0,1),(/Ni_0*Nj_0    /)) /= 0. ) 
     2375         CALL iom_set_grid_attr  ( "grid_"//cdgrd//"_3D_inner", mask=RESHAPE(zmask(Nis0:Nie0,Njs0:Nje0,:),(/Ni_0,Nj_0,jpk/)) /= 0. ) 
    23652376      ENDIF 
    23662377      ! 
  • NEMO/trunk/tests/CANAL/EXPREF/file_def_nemo-oce.xml

    r14959 r15017  
    1515     <field field_ref="soce" />  
    1616     <field field_ref="ssh"  /> 
    17      <field field_ref="socegrad"  /> 
     17     <field field_ref="sssgrad"  /> 
    1818     <field field_ref="ke_int"  /> 
    19      <field field_ref="relvor"  /> 
    20      <field field_ref="potvor"  /> 
     19     <field field_ref="ssrelvor"  /> 
     20     <field field_ref="ssrelpotvor"  /> 
    2121     <field field_ref="saltc"  /> 
    2222     <field field_ref="salt2c"  /> 
Note: See TracChangeset for help on using the changeset viewer.