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 8841 for branches/UKMO/ROMS_WAD_7832/NEMOGCM – NEMO

Ignore:
Timestamp:
2017-11-29T05:08:05+01:00 (6 years ago)
Author:
deazer
Message:

Bring in Trunk Changes at version 8814
This revision wont run as is, requires next revision with merged changes
This revision serves as a reference point to what changes from the trunk at brought in by the merge
in the next revision

Location:
branches/UKMO/ROMS_WAD_7832/NEMOGCM
Files:
2 deleted
145 edited
2 copied

Legend:

Unmodified
Added
Removed
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/CONFIG/AMM12/EXP00/namelist_cfg

    • Property svn:mime-type set to text/x-fortran
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/CONFIG/C1D_PAPA/EXP00/namelist_cfg

    • Property svn:mime-type set to text/x-fortran
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/CONFIG/GYRE_BFM/EXP00/namelist_cfg

    • Property svn:mime-type set to text/x-fortran
    r7715 r8841  
    4444!----------------------------------------------------------------------- 
    4545&namcrs        !   Grid coarsening for dynamics output and/or 
    46                !   passive tracer coarsened online simulations 
     46!              !   passive tracer coarsened online simulations 
    4747!----------------------------------------------------------------------- 
    4848/ 
     
    5151!----------------------------------------------------------------------- 
    5252!          ! file name ! frequency (hours)    ! variable ! time interp. ! clim  !'yearly' or ! weights  ! rotation ! 
    53 !          !           !  (if <0  months)     !   name   !  (logical)   ! (T/F) ! 'monthly'  ! filename ! pairing   
     53!          !           !  (if <0  months)     !   name   !  (logical)   ! (T/F) ! 'monthly'  ! filename ! pairing 
    5454   cn_dir        = './'      !  root directory for the location of the runoff files 
    5555   ln_tsd_init   = .false.   !  Initialisation of ocean T & S with T &S input data (T) or not (F) 
     
    8787&namsbc_ssr    !   surface boundary condition : sea surface restoring 
    8888!----------------------------------------------------------------------- 
    89    nn_sssr     =     0     !  add a damping     term in the surface freshwater flux (=2) 
    90    rn_deds     =   -27.7   !  magnitude of the damping on salinity   [mm/day] 
    91    ln_sssr_bnd =   .false. !  flag to bound erp term (associated with nn_sssr=2) 
    9289/ 
    9390!----------------------------------------------------------------------- 
     
    204201!----------------------------------------------------------------------- 
    205202   ln_dynvor_ene = .true.  !  enstrophy conserving scheme 
     203   ln_dynvor_ens = .false. !  energy conserving scheme 
     204   ln_dynvor_mix = .false. !  mixed scheme 
     205   ln_dynvor_een = .false. !  energy & enstrophy scheme 
     206      nn_een_e3f = 1             !  e3f = masked averaging of e3t divided by 4 (=0) or by the sum of mask (=1) 
    206207/ 
    207208!----------------------------------------------------------------------- 
     
    239240   rn_ahm_b      =      0.     !  background eddy viscosity for ldf_iso [m2/s] 
    240241   rn_bhm_0      =      0.     !  horizontal bilaplacian eddy viscosity [m4/s] 
    241    ! 
    242    ! Caution in 20 and 30 cases the coefficient have to be given for a 1 degree grid (~111km) 
    243 / 
    244    rn_ahm_0_lap     = 100000.   !  horizontal laplacian eddy viscosity   [m2/s] 
    245242/ 
    246243!----------------------------------------------------------------------- 
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/CONFIG/GYRE_BFM/EXP00/namelist_top_cfg

    • Property svn:mime-type set to text/x-fortran
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/CONFIG/GYRE_PISCES/EXP00/namelist_cfg

    • Property svn:mime-type set to text/x-fortran
    r7715 r8841  
    3131      !                    !  (=F) user defined configuration  ==>>>  see usrdef(_...) modules 
    3232   ln_write_cfg= .false.   !  (=T) create the domain configuration file 
    33    ! 
     33! 
    3434/ 
    3535!----------------------------------------------------------------------- 
     
    6060!----------------------------------------------------------------------- 
    6161   nn_fsbc     = 1         !  frequency of surface boundary condition computation 
    62    !                       !     (also = the frequency of sea-ice model call) 
     62                           !     (also = the frequency of sea-ice model call) 
    6363   ln_usr      = .true.    !  user defined formulation                  (T => check usrdef_sbc) 
    6464   ln_blk      = .false.   !  Bulk formulation                          (T => fill namsbc_blk ) 
     
    240240   rn_ahm_b      =      0.     !  background eddy viscosity for ldf_iso [m2/s] 
    241241   rn_bhm_0      =      0.     !  horizontal bilaplacian eddy viscosity [m4/s] 
    242    ! 
    243    ! Caution in 20 and 30 cases the coefficient have to be given for a 1 degree grid (~111km) 
    244 / 
    245    rn_ahm_0_lap     = 100000.   !  horizontal laplacian eddy viscosity   [m2/s] 
    246242/ 
    247243!----------------------------------------------------------------------- 
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/CONFIG/GYRE_PISCES/EXP00/namelist_pisces_cfg

    • Property svn:mime-type set to text/x-fortran
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/CONFIG/GYRE_PISCES/EXP00/namelist_top_cfg

    • Property svn:mime-type set to text/x-fortran
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/CONFIG/GYRE_PISCES/cpp_GYRE_PISCES.fcm

    r7646 r8841  
    1 bld::tool::fppkeys key_zdftke key_top key_mpp_mpi 
     1bld::tool::fppkeys key_zdftke key_top key_mpp_mpi key_iomput 
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/CONFIG/ORCA2_LIM3_PISCES/EXP00/1_namelist_cfg

    r7715 r8841  
    2020/ 
    2121!----------------------------------------------------------------------- 
    22 &namzgr        !   vertical coordinate 
    23 !----------------------------------------------------------------------- 
    24    ln_zps      = .true.    !  z-coordinate - partial steps 
    25 / 
    26 !----------------------------------------------------------------------- 
    2722&namdom        !   space and time domain (bathymetry, mesh, timestep) 
    2823!-----------------------------------------------------------------------   
     
    4641!----------------------------------------------------------------------- 
    4742   ln_blk      = .true.    !  CORE bulk formulation                     (T => fill namsbc_core) 
    48    nn_ice      = 0         !  =0 no ice boundary condition   , 
     43   nn_ice      = 3         !  =0 no ice boundary condition   , 
    4944                           !  =1 use observed ice-cover      , 
    5045                           !  =2 ice-model used                         ("key_lim3" or "key_lim2) 
     
    9085&namagrif      !  AGRIF zoom                                            ("key_agrif") 
    9186!----------------------------------------------------------------------- 
     87   nn_cln_update =    1    !  baroclinic update frequency 
    9288/ 
    9389!----------------------------------------------------------------------- 
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/CONFIG/ORCA2_LIM3_PISCES/EXP00/file_def_nemo.xml

    r7828 r8841  
    9595     <field field_ref="avt"          name="difvho"   /> 
    9696     <field field_ref="w_masstr"     name="vovematr" /> 
    97           <!-- variables available with key_zdftmx_new --> 
    98           <field field_ref="av_wave"      name="av_wave"    /> 
    99           <field field_ref="bn2"          name="bn2"        /> 
    100           <field field_ref="bflx_tmx"     name="bflx_tmx"   /> 
    101           <field field_ref="pcmap_tmx"    name="pcmap_tmx"  /> 
    102           <field field_ref="emix_tmx"     name="emix_tmx"   /> 
    103           <field field_ref="av_ratio"     name="av_ratio"   /> 
     97     <!-- variables available with key_zdftmx_new --> 
     98     <field field_ref="av_wave"      name="av_wave"    /> 
     99     <field field_ref="bn2"          name="bn2"        /> 
     100     <field field_ref="bflx_tmx"     name="bflx_tmx"   /> 
     101     <field field_ref="pcmap_tmx"    name="pcmap_tmx"  /> 
     102     <field field_ref="emix_tmx"     name="emix_tmx"   /> 
     103     <field field_ref="av_ratio"     name="av_ratio"   /> 
    104104   </file> 
    105105 
     
    350350   </file_definition> 
    351351     
    352    
    353 </simulation> 
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/CONFIG/ORCA2_LIM3_PISCES/EXP00/namelist_cfg

    • Property svn:mime-type set to text/x-fortran
    r7828 r8841  
    1717      !                    !  (=F) user defined configuration  ==>>>  see usrdef(_...) modules 
    1818      cn_domcfg = "ORCA_R2_zps_domcfg"    ! domain configuration filename 
    19 / 
    20 !----------------------------------------------------------------------- 
    21 &namzgr        !   vertical coordinate 
    22 !----------------------------------------------------------------------- 
    23    ln_zps      = .true.    !  z-coordinate - partial steps 
    2419/ 
    2520!----------------------------------------------------------------------- 
     
    105100/ 
    106101!----------------------------------------------------------------------- 
     102&namagrif      !  AGRIF zoom                                            ("key_agrif") 
     103!----------------------------------------------------------------------- 
     104   nn_cln_update =    3    !  baroclinic update frequency 
     105/ 
     106!----------------------------------------------------------------------- 
    107107&nambfr        !   bottom friction 
    108108!----------------------------------------------------------------------- 
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/CONFIG/ORCA2_LIM3_PISCES/EXP00/namelist_ice_cfg

    • Property svn:mime-type set to text/x-fortran
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/CONFIG/ORCA2_LIM3_PISCES/EXP00/namelist_pisces_cfg

    • Property svn:mime-type set to text/x-fortran
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/CONFIG/ORCA2_LIM3_PISCES/EXP00/namelist_top_cfg

    • Property svn:mime-type set to text/x-fortran
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/CONFIG/ORCA2_OFF_PISCES/EXP00/namelist_cfg

    • Property svn:mime-type set to text/x-fortran
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/CONFIG/ORCA2_OFF_PISCES/EXP00/namelist_pisces_cfg

    • Property svn:mime-type set to text/x-fortran
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/CONFIG/ORCA2_OFF_PISCES/EXP00/namelist_top_cfg

    • Property svn:mime-type set to text/x-fortran
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/CONFIG/ORCA2_OFF_TRC/EXP00/namelist_cfg

    • Property svn:mime-type set to text/x-fortran
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/CONFIG/ORCA2_OFF_TRC/EXP00/namelist_top_cfg

    • Property svn:mime-type set to text/x-fortran
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/CONFIG/ORCA2_OFF_TRC/EXP00/namelist_trc_cfg

    • Property svn:mime-type set to text/x-fortran
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/CONFIG/ORCA2_SAS_LIM3/EXP00/namelist_cfg

    • Property svn:mime-type set to text/x-fortran
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/CONFIG/ORCA2_SAS_LIM3/EXP00/namelist_ice_cfg

    • Property svn:mime-type set to text/x-fortran
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/CONFIG/SHARED/field_def_nemo-opa.xml

    r7828 r8841  
    2020      <field_group id="grid_T" grid_ref="grid_T_2D" > 
    2121         <field id="e3t"          long_name="T-cell thickness"   standard_name="cell_thickness"   unit="m"   grid_ref="grid_T_3D"/> 
     22         <field id="e3t_surf"     long_name="T-cell thickness"   field_ref="e3t"  standard_name="cell_thickness"   unit="m"   grid_ref="grid_T_SFC"/> 
    2223         <field id="e3t_0"        long_name="Initial T-cell thickness"   standard_name="ref_cell_thickness"   unit="m"   grid_ref="grid_T_3D"/> 
    2324 
     
    207208 
    208209         <!-- * variable related to ice shelf forcing * --> 
    209          <field id="fwfisf"       long_name="Ice shelf melting"                                            unit="Kg/m2/s"  /> 
     210         <field id="fwfisf"       long_name="Ice shelf melting"                             unit="kg/m2/s"  /> 
    210211         <field id="fwfisf3d"     long_name="Ice shelf melting"                             unit="kg/m2/s"  grid_ref="grid_T_3D" /> 
    211212         <field id="qlatisf"      long_name="Ice shelf latent heat flux"                    unit="W/m2"     /> 
     
    215216         <field id="isfgammat"    long_name="transfert coefficient for isf (temperature) "  unit="m/s"      /> 
    216217         <field id="isfgammas"    long_name="transfert coefficient for isf (salinity)    "  unit="m/s"      /> 
    217    <field id="stbl"         long_name="salinity in the Losh tbl                    "  unit="PSU"      /> 
     218         <field id="stbl"         long_name="salinity in the Losh tbl                    "  unit="PSU"      /> 
    218219         <field id="ttbl"         long_name="temperature in the Losh tbl                 "  unit="C"        /> 
    219220         <field id="utbl"         long_name="zonal current in the Losh tbl at T point    "  unit="m/s"      /> 
     
    238239         <field id="calving_cea"  long_name="Calving"                                   standard_name="water_flux_into_sea_water_from_icebergs"   unit="kg/m2/s"  /> 
    239240         <field id="iceberg_cea"  long_name="Iceberg"                                   standard_name="water_flux_into_sea_water_from_icebergs"   unit="kg/m2/s"  /> 
    240          <field id="iceshelf_cea"  long_name="Iceshelf"                                   standard_name="water_flux_into_sea_water_from_iceshelf"   unit="kg/m2/s"  /> 
     241         <field id="iceshelf_cea" long_name="Iceshelf"                                  standard_name="water_flux_into_sea_water_from_iceshelf"   unit="kg/m2/s"  /> 
     242 
    241243 
    242244         <!-- available if key_oasis3 + conservative method --> 
     
    253255         <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"     /> 
    254256         <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"     /> 
    255          <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"     /> 
     257         <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"     /> 
     258         <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"     /> 
     259         <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"     /> 
    256260         <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"  /> 
    257261         <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"  /> 
     
    559563    --> 
    560564 
    561     <field_group id="trendT" grid_ref="grid_T_3D"> 
    562        <!-- variables available with ln_tra_trd --> 
     565   <!-- variables available with ln_tra_trd --> 
     566   <!-- Asselin trends  calculated on odd time steps--> 
     567   <field_group id="trendT_odd"  grid_ref="grid_T_3D"> 
     568      <field id="ttrd_atf"      long_name="temperature-trend: asselin time filter"       unit="degree_C/s" /> 
     569      <field id="strd_atf"      long_name="salinity   -trend: asselin time filter"       unit="0.001/s" /> 
     570      <!-- Thickness weighted versions: --> 
     571      <field id="ttrd_atf_e3t"      unit="degC/s * m"  >  ttrd_atf * e3t </field> 
     572      <field id="strd_atf_e3t"      unit="1e-3/s * m"  >  strd_atf * e3t </field> 
     573      <!-- OMIP  layer-integrated trends --> 
     574      <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> 
     575      <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> 
     576    </field_group> 
     577 
     578    <!-- Other trends  calculated on even time steps--> 
     579    <field_group id="trendT_even" grid_ref="grid_T_3D"> 
    563580       <field id="ttrd_xad"      long_name="temperature-trend: i-advection"                                                                                          unit="degC/s"                        /> 
    564581       <field id="strd_xad"      long_name="salinity   -trend: i-advection"                                                                                          unit="1e-3/s"                        /> 
     
    593610       <field id="ttrd_npc"      long_name="temperature-trend: non-penetrative conv."     unit="degC/s" /> 
    594611       <field id="strd_npc"      long_name="salinity   -trend: non-penetrative conv."     unit="1e-3/s" /> 
    595        <field id="ttrd_qns"      long_name="temperature-trend: non-solar flux + runoff"   unit="degC/s" /> 
    596        <field id="strd_cdt"      long_name="salinity   -trend: C/D term       + runoff"   unit="degC/s" /> 
     612       <field id="ttrd_qns"      long_name="temperature-trend: non-solar flux + runoff"   unit="degC/s" grid_ref="grid_T_2D" /> 
     613       <field id="strd_cdt"      long_name="salinity   -trend: C/D term       + runoff"   unit="degC/s" grid_ref="grid_T_2D" /> 
    597614       <field id="ttrd_qsr"      long_name="temperature-trend: solar penetr. heating"     unit="degC/s" /> 
    598615       <field id="ttrd_bbc"      long_name="temperature-trend: geothermal heating"        unit="degC/s" /> 
    599        <field id="ttrd_atf"      long_name="temperature-trend: asselin time filter"       unit="degC/s" /> 
    600        <field id="strd_atf"      long_name="salinity   -trend: asselin time filter"       unit="1e-3/s" /> 
    601        <field id="ttrd_tot"      long_name="temperature-trend: total model trend"         unit="degC/s" /> 
    602        <field id="strd_tot"      long_name="salinity   -trend: total model trend"         unit="1e-3/s" /> 
    603616 
    604617       <!-- Thickness weighted versions: --> 
     
    637650       <field id="ttrd_qsr_e3t"      unit="degC/s * m"  >  ttrd_qsr * e3t </field> 
    638651       <field id="ttrd_bbc_e3t"      unit="degC/s * m"  >  ttrd_bbc * e3t </field> 
    639        <field id="ttrd_atf_e3t"      unit="degC/s * m"  >  ttrd_atf * e3t </field> 
    640        <field id="strd_atf_e3t"      unit="1e-3/s * m"  >  strd_atf * e3t </field> 
     652 
     653       <!-- OMIP  layer-integrated trends --> 
     654       <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> 
     655       <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> 
     656       <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> 
     657       <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> 
     658       <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> 
     659       <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> 
     660       <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> 
     661       <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> 
     662       <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> 
     663       <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> 
     664       <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> 
     665       <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> 
     666       <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> 
     667       <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> 
     668 
     669    </field_group> 
     670 
     671    <!--  Total trends calculated every time step--> 
     672    <field_group id="trendT" grid_ref="grid_T_3D"> 
     673       <field id="ttrd_tot"      long_name="temperature-trend: total model trend"         unit="degC/s" /> 
     674       <field id="strd_tot"      long_name="salinity   -trend: total model trend"         unit="1e-3/s" /> 
     675       <!-- Thickness weighted versions: --> 
    641676       <field id="ttrd_tot_e3t"      unit="degC/s * m"  >  ttrd_tot * e3t </field> 
    642677       <field id="strd_tot_e3t"      unit="1e-3/s * m"  >  strd_tot * e3t </field> 
    643  
    644  
     678       <!-- OMIP  layer-integrated total trends --> 
     679       <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> 
     680       <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> 
     681 
     682       <!-- **** these trends have not been apportioned to all/even/odd ts yet **** --> 
    645683       <!-- variables available with ln_KE_trd --> 
    646684       <field id="ketrd_hpg"     long_name="ke-trend: hydrostatic pressure gradient"          unit="W/s^3"                        /> 
     
    733771    --> 
    734772 
     773     <field_group id="TRD" > 
     774          <field field_ref="ttrd_totad_li"   name="opottempadvect"  /> 
     775          <field field_ref="ttrd_iso_li"     name="opottemppmdiff"  /> 
     776          <field field_ref="ttrd_zdfp_li"    name="opottempdiff"  /> 
     777          <field field_ref="ttrd_evd_li"     name="opottempevd" /> 
     778          <field field_ref="strd_evd_li"     name="osaltevd" /> 
     779          <field field_ref="ttrd_qns_li"     name="opottempqns"  /> 
     780          <field field_ref="ttrd_qsr_li"     name="rsdoabsorb" operation="accumulate" /> 
     781          <field field_ref="strd_totad_li"   name="osaltadvect" /> 
     782          <field field_ref="strd_iso_li"     name="osaltpmdiff"  /> 
     783          <field field_ref="strd_zdfp_li"    name="osaltdiff" /> 
     784    </field_group> 
     785     
    735786    <field_group id="mooring" > 
    736787       <field field_ref="toce"         name="thetao"   long_name="sea_water_potential_temperature"      /> 
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/CONFIG/SHARED/namelist_ice_lim2_ref

    • Property svn:mime-type set to text/x-fortran
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/CONFIG/SHARED/namelist_ice_lim3_ref

    • Property svn:mime-type set to text/x-fortran
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/CONFIG/SHARED/namelist_pisces_ref

    • Property svn:mime-type set to text/x-fortran
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/CONFIG/SHARED/namelist_ref

    • Property svn:mime-type set to text/x-fortran
    r7813 r8841  
    5959!!====================================================================== 
    6060!!   namcfg       parameters of the configuration 
    61 !!   namzgr       vertical coordinate                                   (default: NO selection) 
    6261!!   namdom       space and time domain (bathymetry, mesh, timestep) 
    6362!!   namwad       Wetting and drying                                    (default F) 
     
    11251124/ 
    11261125!----------------------------------------------------------------------- 
    1127 &namnc4        !   netcdf4 chunking and compression settings            ("key_netcdf4") 
    1128 !----------------------------------------------------------------------- 
    1129    ln_diatmb   = .false.   !  Choose Top Middle and Bottom output or not 
    1130 / 
    1131 !----------------------------------------------------------------------- 
    1132 &nam_dia25h    !  25h Mean Output                                        (default F) 
    1133 !----------------------------------------------------------------------- 
    1134    ln_dia25h   = .false.   ! Choose 25h mean output or not 
    1135 / 
    1136 !----------------------------------------------------------------------- 
    11371126&namnc4        !   netcdf4 chunking and compression settings             ("key_netcdf4") 
    11381127!----------------------------------------------------------------------- 
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/CONFIG/SHARED/namelist_top_ref

    • Property svn:mime-type set to text/x-fortran
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/CONFIG/SHARED/namelist_trc_ref

    • Property svn:mime-type set to text/x-fortran
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/CONFIG/TEST_CASES/ISOMIP/EXP00/namelist_cfg

    • Property svn:mime-type set to text/x-fortran
    r7715 r8841  
    55&namusr_def    !   ISOMIP user defined namelist   
    66!----------------------------------------------------------------------- 
    7    ln_zco      = .false.      ! z-coordinate 
    87   ln_zps      = .true.       ! z-partial-step coordinate 
    9    ln_sco      = .false.      ! s-coordinate 
    108   rn_lam0     =   0.0        !  longitude of first raw and column T-point (jphgr_msh = 1) 
    119   rn_phi0     = -80.0        ! latitude  of first raw and column T-point (jphgr_msh = 1) 
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/CONFIG/TEST_CASES/ISOMIP/MY_SRC/usrdef_hgr.F90

    r7715 r8841  
    9494            pphiv(ji,jj) = rn_phi0 + rn_e2deg * zvj 
    9595            pphif(ji,jj) = rn_phi0 + rn_e2deg * zfj 
     96     !                       !==  Horizontal scale factors  ==!   (in meters) 
    9697     ! e1 
    9798            pe1t(ji,jj) = ra * rad * COS( rad * pphit(ji,jj) ) * rn_e1deg 
     
    106107         END DO 
    107108      END DO 
     109      !                             ! NO reduction of grid size in some straits  
     110      ke1e2u_v = 0                  !    ==>> u_ & v_surfaces will be computed in dom_ghr routine 
     111      pe1e2u(:,:) = 0._wp           !    CAUTION: set to zero to avoid error with some compilers that 
     112      pe1e2v(:,:) = 0._wp           !             require an initialization of INTENT(out) arguments 
    108113      ! 
    109       kff = 0 ! Coriolis parameter calculated on the sphere 
     114      ! 
     115      !                       !==  Coriolis parameter  ==! 
     116      kff = 0                       ! Coriolis parameter calculated on the sphere 
     117      ! 
     118      ! 
     119      pff_f(:,:) = 0._wp            ! CAUTION: set to zero to avoid error with some compilers that 
     120      pff_t(:,:) = 0._wp            !             require an initialization of INTENT(out) arguments 
    110121      ! 
    111122      IF( nn_timing == 1 )  CALL timing_stop('usr_def_hgr') 
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/CONFIG/TEST_CASES/ISOMIP/MY_SRC/usrdef_zgr.F90

    r7715 r8841  
    8080      ! type of vertical coordinate 
    8181      ! --------------------------- 
    82       ! already set in usrdef_nam.F90 by reading the namusr_def namelist except for ISF 
    83       ld_isfcav = .TRUE. 
     82      ! set in usrdef_nam.F90 by reading the namusr_def namelist except for ISF 
     83      ln_zco    = .FALSE.      ! z-partial-step coordinate 
     84      ln_zps    = .TRUE.       ! z-partial-step coordinate 
     85      ln_sco    = .FALSE.      ! s-coordinate 
     86      ld_isfcav = .TRUE.       ! ISF Ice Shelves Flag 
    8487      ! 
    8588      ! 
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/CONFIG/TEST_CASES/LOCK_EXCHANGE/EXP00/file_def_nemo-opa.xml

    r7635 r8841  
    88    --> 
    99     
    10     <file_definition type="multiple_file" name="@expname@_@freq@_@startdate@_@enddate@" sync_freq="10d" min_digits="4"> 
     10    <file_definition type="multiple_file" name="@expname@" sync_freq="10d" min_digits="4"> 
    1111      <file_group id="30mi" output_freq="30mi"  output_level="10" enabled=".TRUE." >  <!-- 5d files -->   
    1212  
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/CONFIG/TEST_CASES/LOCK_EXCHANGE/EXP00/namelist_FCT2_flux_cen2_cfg

    • Property svn:mime-type set to text/x-fortran
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/CONFIG/TEST_CASES/LOCK_EXCHANGE/EXP00/namelist_FCT2_flux_ubs_cfg

    • Property svn:mime-type set to text/x-fortran
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/CONFIG/TEST_CASES/LOCK_EXCHANGE/EXP00/namelist_FCT2_vect_eenH_cfg

    • Property svn:mime-type set to text/x-fortran
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/CONFIG/TEST_CASES/LOCK_EXCHANGE/EXP00/namelist_FCT2_vect_een_cfg

    • Property svn:mime-type set to text/x-fortran
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/CONFIG/TEST_CASES/LOCK_EXCHANGE/EXP00/namelist_FCT2_vect_ene_cfg

    • Property svn:mime-type set to text/x-fortran
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/CONFIG/TEST_CASES/LOCK_EXCHANGE/EXP00/namelist_FCT2_vect_ens_cfg

    • Property svn:mime-type set to text/x-fortran
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/CONFIG/TEST_CASES/LOCK_EXCHANGE/EXP00/namelist_FCT4_flux_cen2_cfg

    • Property svn:mime-type set to text/x-fortran
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/CONFIG/TEST_CASES/LOCK_EXCHANGE/EXP00/namelist_FCT4_flux_ubs_cfg

    • Property svn:mime-type set to text/x-fortran
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/CONFIG/TEST_CASES/LOCK_EXCHANGE/EXP00/namelist_FCT4_vect_eenH_cfg

    • Property svn:mime-type set to text/x-fortran
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/CONFIG/TEST_CASES/LOCK_EXCHANGE/EXP00/namelist_FCT4_vect_een_cfg

    • Property svn:mime-type set to text/x-fortran
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/CONFIG/TEST_CASES/LOCK_EXCHANGE/EXP00/namelist_FCT4_vect_ene_cfg

    • Property svn:mime-type set to text/x-fortran
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/CONFIG/TEST_CASES/LOCK_EXCHANGE/EXP00/namelist_FCT4_vect_ens_cfg

    • Property svn:mime-type set to text/x-fortran
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/CONFIG/TEST_CASES/LOCK_EXCHANGE/EXP00/namelist_cfg

    • Property svn:mime-type set to text/x-fortran
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/CONFIG/TEST_CASES/OVERFLOW/EXP00/file_def_nemo-opa.xml

    r7635 r8841  
    88    --> 
    99     
    10     <file_definition type="multiple_file" name="@expname@_@freq@_@startdate@_@enddate@" sync_freq="10d" min_digits="4"> 
     10    <file_definition type="multiple_file" name="@expname@" sync_freq="10d" min_digits="4"> 
    1111      <file_group id="30mi" output_freq="30mi"  output_level="10" enabled=".TRUE." >  <!-- 5d files -->   
    1212  
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/CONFIG/TEST_CASES/OVERFLOW/EXP00/namelist_cfg

    • Property svn:mime-type set to text/x-fortran
    r7624 r8841  
    7878&nameos        !   ocean physical parameters 
    7979!----------------------------------------------------------------------- 
    80    ln_teos10   = .false.         !  = Use TEOS-10 equation of state 
    81    ln_eos80    = .true.          !  = Use EOS80 equation of state 
     80   ln_seos     = .true.         !  = Use simplified equation of state (S-EOS) 
    8281   !                             !  rd(T,S,Z)*rau0 = -a0*(1+.5*lambda*dT+mu*Z+nu*dS)*dT+b0*dS 
    83    rn_a0       =  0.2         !  thermal expension coefficient (nn_eos= 1) 
    84    rn_b0       =  0.          !  saline  expension coefficient (nn_eos= 1) 
     82   rn_a0       =  0.2         !  thermal expension coefficient (for simplified equation of state) 
     83   rn_b0       =  0.          !  saline  expension coefficient (for simplified equation of state) 
    8584   rn_lambda1  =  0.          !  cabbeling coeff in T^2  (=0 for linear eos) 
    8685   rn_lambda2  =  0.          !  cabbeling coeff in S^2  (=0 for linear eos) 
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/CONFIG/TEST_CASES/OVERFLOW/EXP00/namelist_sco_FCT2_flux_ubs_cfg

    • Property svn:mime-type set to text/x-fortran
    r7640 r8841  
    7878&nameos        !   ocean physical parameters 
    7979!----------------------------------------------------------------------- 
    80    ln_teos10   = .false.         !  = Use TEOS-10 equation of state 
    81    ln_eos80    = .true.          !  = Use EOS80 equation of state 
     80   ln_seos     = .true.         !  = Use simplified equation of state (S-EOS) 
    8281   !                             !  rd(T,S,Z)*rau0 = -a0*(1+.5*lambda*dT+mu*Z+nu*dS)*dT+b0*dS 
    83    rn_a0       =  0.2         !  thermal expension coefficient (nn_eos= 1) 
    84    rn_b0       =  0.          !  saline  expension coefficient (nn_eos= 1) 
     82   rn_a0       =  0.2         !  thermal expension coefficient (for simplified equation of state) 
     83   rn_b0       =  0.          !  saline  expension coefficient (for simplified equation of state) 
    8584   rn_lambda1  =  0.          !  cabbeling coeff in T^2  (=0 for linear eos) 
    8685   rn_lambda2  =  0.          !  cabbeling coeff in S^2  (=0 for linear eos) 
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/CONFIG/TEST_CASES/OVERFLOW/EXP00/namelist_zps_FCT2_flux_ubs_cfg

    • Property svn:mime-type set to text/x-fortran
    r7640 r8841  
    7878&nameos        !   ocean physical parameters 
    7979!----------------------------------------------------------------------- 
    80    ln_teos10   = .false.         !  = Use TEOS-10 equation of state 
    81    ln_eos80    = .true.          !  = Use EOS80 equation of state 
     80   ln_seos     = .true.         !  = Use simplified equation of state (S-EOS) 
    8281   !                             !  rd(T,S,Z)*rau0 = -a0*(1+.5*lambda*dT+mu*Z+nu*dS)*dT+b0*dS 
    83    rn_a0       =  0.2         !  thermal expension coefficient (nn_eos= 1) 
    84    rn_b0       =  0.          !  saline  expension coefficient (nn_eos= 1) 
     82   rn_a0       =  0.2         !  thermal expension coefficient (for simplified equation of state) 
     83   rn_b0       =  0.          !  saline  expension coefficient (for simplified equation of state) 
    8584   rn_lambda1  =  0.          !  cabbeling coeff in T^2  (=0 for linear eos) 
    8685   rn_lambda2  =  0.          !  cabbeling coeff in S^2  (=0 for linear eos) 
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/CONFIG/TEST_CASES/OVERFLOW/EXP00/namelist_zps_FCT4_flux_ubs_cfg

    • Property svn:mime-type set to text/x-fortran
    r7640 r8841  
    7878&nameos        !   ocean physical parameters 
    7979!----------------------------------------------------------------------- 
    80    ln_teos10   = .false.         !  = Use TEOS-10 equation of state 
    81    ln_eos80    = .true.          !  = Use EOS80 equation of state 
     80   ln_seos     = .true.         !  = Use simplified equation of state (S-EOS) 
    8281   !                             !  rd(T,S,Z)*rau0 = -a0*(1+.5*lambda*dT+mu*Z+nu*dS)*dT+b0*dS 
    83    rn_a0       =  0.2         !  thermal expension coefficient (nn_eos= 1) 
    84    rn_b0       =  0.          !  saline  expension coefficient (nn_eos= 1) 
     82   rn_a0       =  0.2         !  thermal expension coefficient (for simplified equation of state) 
     83   rn_b0       =  0.          !  saline  expension coefficient (for simplified equation of state) 
    8584   rn_lambda1  =  0.          !  cabbeling coeff in T^2  (=0 for linear eos) 
    8685   rn_lambda2  =  0.          !  cabbeling coeff in S^2  (=0 for linear eos) 
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/CONFIG/TEST_CASES/OVERFLOW/EXP00/namelist_zps_FCT4_vect_een_cfg

    • Property svn:mime-type set to text/x-fortran
    r7640 r8841  
    7878&nameos        !   ocean physical parameters 
    7979!----------------------------------------------------------------------- 
    80    ln_teos10   = .false.         !  = Use TEOS-10 equation of state 
    81    ln_eos80    = .true.          !  = Use EOS80 equation of state 
     80   ln_seos     = .true.         !  = Use simplified equation of state (S-EOS) 
    8281   !                             !  rd(T,S,Z)*rau0 = -a0*(1+.5*lambda*dT+mu*Z+nu*dS)*dT+b0*dS 
    83    rn_a0       =  0.2         !  thermal expension coefficient (nn_eos= 1) 
    84    rn_b0       =  0.          !  saline  expension coefficient (nn_eos= 1) 
     82   rn_a0       =  0.2         !  thermal expension coefficient (for simplified equation of state) 
     83   rn_b0       =  0.          !  saline  expension coefficient (for simplified equation of state) 
    8584   rn_lambda1  =  0.          !  cabbeling coeff in T^2  (=0 for linear eos) 
    8685   rn_lambda2  =  0.          !  cabbeling coeff in S^2  (=0 for linear eos) 
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/CONFIG/TEST_CASES/SAS_BIPER/EXP00/namelist_cfg

    • Property svn:mime-type set to text/x-fortran
    r7822 r8841  
    2626&namdom        !   space and time domain (bathymetry, mesh, timestep) 
    2727!----------------------------------------------------------------------- 
    28    ln_linssh   = .false.   !  =T  linear free surface  ==>>  model level are fixed in time 
     28   ln_linssh   = .true.   !  =T  linear free surface  ==>>  model level are fixed in time 
    2929   ! 
    3030   nn_msh      =    1      !  create (>0) a mesh file or not (=0) 
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/CONFIG/TEST_CASES/SAS_BIPER/EXP00/namelist_ice_cfg

    • Property svn:mime-type set to text/x-fortran
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/CONFIG/TEST_CASES/WAD/EXP00/namelist_cfg

    • Property svn:mime-type set to text/x-fortran
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/CONFIG/makenemo

    r7756 r8841  
    6363# :: 
    6464# 
    65 #  $ ./makenemo -m ifort_osx - j3 -n ORCA2_LIM 
     65#  $ ./makenemo -m ifort_osx - j3 -n ORCA2_LIM3_PISCES 
    6666# 
    6767# 
     
    221221   *) 
    222222       echo " \"$1\" BAD OPTION" 
    223        exit 
     223       exit 2 
    224224       ;; 
    225225 
     
    267267#- 
    268268#- Choose a default configuration if needed --- 
    269 #- ORCA2_LIM or last one used --- 
     269#- ORCA2_LIM3_PISCES or last one used --- 
    270270. ${COMPIL_DIR}/Fcheck_config.sh cfg.txt ${NEW_CONF} || exit 
    271271 
    272272if [ ${#NEW_CONF} -eq 0 ] ; then 
    273273    if [ ${#NEM_SUBDIR} -eq 0 ] && [ ${#REF_CONF} -eq 0 ] && [ ${#USP_CONF} -eq 0 ] ; then 
    274    echo "You are installing a new default (ORCA2_LIM) configuration" 
     274   echo "You are installing a new default (ORCA2_LIM3_PISCES) configuration" 
    275275   ind=0 
    276276   . ${COMPIL_DIR}/Fread_dir.sh OPA_SRC    YES 
     
    280280   . ${COMPIL_DIR}/Fread_dir.sh NST_SRC    YES 
    281281   . ${COMPIL_DIR}/Fread_dir.sh OFF_SRC    NO 
    282    REF_CONF=ORCA2_LIM 
     282   . ${COMPIL_DIR}/Fread_dir.sh SAO_SRC    NO 
     283   . ${COMPIL_DIR}/Fread_dir.sh SAS_SRC    NO 
     284   REF_CONF=ORCA2_LIM3_PISCES 
    283285    elif [ ${#NEM_SUBDIR} -gt 0 ] && [ ${#REF_CONF} -eq 0 ] && [ ${#USP_CONF} -eq 0 ] ; then 
    284    echo "You are  installing a new configuration based on ORCA2_LIM" 
     286   echo "You are  installing a new configuration based on ORCA2_LIM3_PISCES" 
    285287   TAB=( ${NEM_SUBDIR} ) 
    286    REF_CONF=ORCA2_LIM 
     288   REF_CONF=ORCA2_LIM3_PISCES 
    287289    elif [ ${#NEM_SUBDIR} -eq 0 ] && [ ${#REF_CONF} -gt 0 ]; then 
    288290   echo "You are  installing a new configuration based on ${REF_CONF}" 
     
    320322#- Clean links and librairies --- 
    321323#- Creating the good links, at first on OPA_SRC --- 
    322 . ${COMPIL_DIR}/Fmake_WORK.sh ${x_e} ${NEW_CONF} ${TAB[*]} || exit 
    323  
    324 . ${COMPIL_DIR}/Fmake_bld.sh ${CONFIG_DIR} ${NEW_CONF}  ${NEMO_TDIR} || exit 
     324. ${COMPIL_DIR}/Fmake_WORK.sh ${x_e} ${NEW_CONF} ${TAB[*]} || exit 3 
     325 
     326. ${COMPIL_DIR}/Fmake_bld.sh ${CONFIG_DIR} ${NEW_CONF}  ${NEMO_TDIR} || exit 3 
    325327 
    326328# build the complete list of the cpp keys of this configuration 
     
    360362#- At this stage cpp keys have been updated. we can check the arch file 
    361363#- When used for the first time, choose a compiler --- 
    362 . ${COMPIL_DIR}/Fcheck_archfile.sh arch_nemo.fcm cpp.fcm ${CMP_NAM} || exit 
     364. ${COMPIL_DIR}/Fcheck_archfile.sh arch_nemo.fcm cpp.fcm ${CMP_NAM} || exit 3 
    363365 
    364366#- At this stage the configuration has beeen chosen 
     
    368370#- We look after agrif 
    369371grep key_agrif ${COMPIL_DIR}/cpp.fcm && export AGRIFUSE=1 && export USEBLD=${USEBLD/xag/} 
    370 . ${COMPIL_DIR}/Fprep_agrif.sh ${NEW_CONF} ${NEMO_TDIR} || exit 
     372. ${COMPIL_DIR}/Fprep_agrif.sh ${NEW_CONF} ${NEMO_TDIR} || exit 3 
    371373 
    372374#- 
     
    383385    if [ ${#x_c} -eq 0 ]; then 
    384386       if [ "$AGRIFUSE" == 1 ]; then  
    385           fcm build --ignore-lock  -j 1 ${COMPIL_DIR}/bld_preproagr.cfg ||{ cd - ; exit ;} 
     387          fcm build --ignore-lock  -j 1 ${COMPIL_DIR}/bld_preproagr.cfg ||{ cd - ; exit 1 ;} 
    386388          echo "" 
    387389          echo "---------------------------------" 
     
    391393       fi 
    392394    fi 
    393     fcm build ${x_c} --ignore-lock -v ${x_v} -j ${NBR_PRC} ${COMPIL_DIR}/$USEBLD || cd - 
     395    fcm build ${x_c} --ignore-lock -v ${x_v} -j ${NBR_PRC} ${COMPIL_DIR}/$USEBLD ||{ cd - ; exit 1 ;} 
    394396    [ -f ${NEMO_TDIR}/${NEW_CONF}/BLD/bin/nemo.exe ] && ln -sf ${NEMO_TDIR}/${NEW_CONF}/BLD/bin/nemo.exe  ${CONFIG_DIR}/${NEW_CONF}/EXP00/opa 
    395397 
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/NEMO/LIM_SRC_3/limthd.F90

    r7813 r8841  
    205205      IF( .NOT. ln_limdO )  qlead(:,:) = 0._wp 
    206206      ! In case we bypass growing/melting from top and bottom: we suppose ice is impermeable => ocean is isolated from atmosphere 
    207       IF( .NOT. ln_limdH )  hfx_in(:,:) = pfrld(:,:) * ( qns_oce(:,:) + qsr_oce(:,:) ) + qemp_oce(:,:) 
    208       IF( .NOT. ln_limdH )  fhtur (:,:) = 0._wp  ;  fhld  (:,:) = 0._wp 
     207      IF( .NOT. ln_limdH ) THEN 
     208         hfx_in(:,:) = pfrld(:,:) * ( qns_oce(:,:) + qsr_oce(:,:) ) + qemp_oce(:,:) 
     209         fhtur (:,:) = 0._wp 
     210         fhld  (:,:) = 0._wp 
     211      ENDIF 
    209212 
    210213      ! --------------------------------------------------------------------- 
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/NEMO/OFF_SRC/nemogcm.F90

    r7761 r8841  
    548548 
    549549      ! Find the factors of n. 
    550       IF( kn == 1 )   GOTO 20 
    551  
    552       ! nu holds the unfactorised part of the number. 
    553       ! knfax holds the number of factors found. 
    554       ! l points to the allowed factor list. 
    555       ! ifac holds the current factor. 
    556  
    557       inu   = kn 
    558       knfax = 0 
    559  
    560       DO jl = ntest, 1, -1 
    561          ! 
    562          ifac = ilfax(jl) 
    563          IF( ifac > inu )   CYCLE 
    564  
    565          ! Test whether the factor will divide. 
    566  
    567          IF( MOD(inu,ifac) == 0 ) THEN 
     550      IF( kn .NE. 1 ) THEN 
     551 
     552         ! nu holds the unfactorised part of the number. 
     553         ! knfax holds the number of factors found. 
     554         ! l points to the allowed factor list. 
     555         ! ifac holds the current factor. 
     556    
     557         inu   = kn 
     558         knfax = 0 
     559    
     560         DO jl = ntest, 1, -1 
    568561            ! 
    569             knfax = knfax + 1            ! Add the factor to the list 
    570             IF( knfax > kmaxfax ) THEN 
    571                kerr = 6 
    572                write (*,*) 'FACTOR: insufficient space in factor array ', knfax 
    573                return 
     562            ifac = ilfax(jl) 
     563            IF( ifac > inu )   CYCLE 
     564    
     565            ! Test whether the factor will divide. 
     566    
     567            IF( MOD(inu,ifac) == 0 ) THEN 
     568               ! 
     569               knfax = knfax + 1            ! Add the factor to the list 
     570               IF( knfax > kmaxfax ) THEN 
     571                  kerr = 6 
     572                  write (*,*) 'FACTOR: insufficient space in factor array ', knfax 
     573                  return 
     574               ENDIF 
     575               kfax(knfax) = ifac 
     576               ! Store the other factor that goes with this one 
     577               knfax = knfax + 1 
     578               kfax(knfax) = inu / ifac 
     579               !WRITE (*,*) 'ARPDBG, factors ',knfax-1,' & ',knfax,' are ', kfax(knfax-1),' and ',kfax(knfax) 
    574580            ENDIF 
    575             kfax(knfax) = ifac 
    576             ! Store the other factor that goes with this one 
    577             knfax = knfax + 1 
    578             kfax(knfax) = inu / ifac 
    579             !WRITE (*,*) 'ARPDBG, factors ',knfax-1,' & ',knfax,' are ', kfax(knfax-1),' and ',kfax(knfax) 
    580          ENDIF 
    581          ! 
    582       END DO 
    583  
    584    20 CONTINUE      ! Label 20 is the exit point from the factor search loop. 
     581            ! 
     582         END DO 
     583    
     584      ENDIF 
    585585      ! 
    586586   END SUBROUTINE factorise 
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/NEMO/OPA_SRC/ASM/asminc.F90

    r6140 r8841  
    8686   REAL(wp), DIMENSION(:,:), ALLOCATABLE ::   ssh_bkg, ssh_bkginc   ! Background sea surface height and its increment 
    8787   REAL(wp), DIMENSION(:,:), ALLOCATABLE ::   seaice_bkginc         ! Increment to the background sea ice conc 
     88#if defined key_cice && defined key_asminc 
     89   REAL(wp), DIMENSION(:,:), ALLOCATABLE ::   ndaice_da             ! ice increment tendency into CICE 
     90#endif 
    8891 
    8992   !! * Substitutions 
     
    339342      ALLOCATE( ssh_iau(jpi,jpj)      ) 
    340343#endif 
     344#if defined key_cice && defined key_asminc 
     345      ALLOCATE( ndaice_da(jpi,jpj)      ) 
     346#endif 
    341347      t_bkginc(:,:,:) = 0.0 
    342348      s_bkginc(:,:,:) = 0.0 
     
    347353#if defined key_asminc 
    348354      ssh_iau(:,:)    = 0.0 
     355#endif 
     356#if defined key_cice && defined key_asminc 
     357      ndaice_da(:,:) = 0.0 
    349358#endif 
    350359      IF ( ( ln_trainc ).OR.( ln_dyninc ).OR.( ln_sshinc ).OR.( ln_seaiceinc ) ) THEN 
     
    759768            ENDIF 
    760769            ! 
     770#if defined key_asminc 
     771         ELSE IF( kt == nitiaufin_r+1 ) THEN 
     772            ! 
     773            ssh_iau(:,:) = 0._wp 
     774            ! 
     775#endif 
    761776         ENDIF 
    762777         !                          !----------------------------------------- 
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/NEMO/OPA_SRC/BDY/bdydta.F90

    r7646 r8841  
    266266                        IF( ln_full_vel_array(ib_bdy) ) THEN 
    267267                           CALL fld_read( kt=kt, kn_fsbc=1, sd=bf(jstart:jend), map=nbmap_ptr(jstart:jend),  & 
    268                                      & kit=jit, kt_offset=time_offset , jpk_bdy=nb_jpk_bdy, fvl=ln_full_vel_array(ib_bdy)  ) 
     268                                     & kit=jit, kt_offset=time_offset , jpk_bdy=nb_jpk_bdy,   & 
     269                                     & fvl=ln_full_vel_array(ib_bdy)  ) 
    269270                        ELSE 
    270271                           CALL fld_read( kt=kt, kn_fsbc=1, sd=bf(jstart:jend), map=nbmap_ptr(jstart:jend),  & 
     
    335336                     jend = jstart + dta%nread(1) - 1 
    336337                     CALL fld_read( kt=kt, kn_fsbc=1, sd=bf(jstart:jend), & 
    337                                   & map=nbmap_ptr(jstart:jend), kt_offset=time_offset, jpk_bdy=nb_jpk_bdy, fvl=ln_full_vel_array(ib_bdy) ) 
     338                                  & map=nbmap_ptr(jstart:jend), kt_offset=time_offset, jpk_bdy=nb_jpk_bdy,   & 
     339                                  & fvl=ln_full_vel_array(ib_bdy) ) 
    338340                  ENDIF 
    339341                  ! If full velocities in boundary data then split into barotropic and baroclinic data 
     
    443445      TYPE(OBC_DATA), POINTER                ::   dta           ! short cut 
    444446#if defined key_lim3 
    445       INTEGER, DIMENSION(3) ::   zdimsz   ! number of elements in each of the 4 dimensions (i.e. i,j,t,ice-cat) for an array 
    446447      INTEGER               ::   zndims   ! number of dimensions in an array (i.e. 3 = wo ice cat; 4 = w ice cat) 
    447448      INTEGER               ::   inum,id1 ! local integer 
     
    675676               ! Test for types of ice input (lim2 or lim3)  
    676677               ! Build file name to find dimensions  
    677                clname=TRIM(bn_a_i%clname) 
     678               clname=TRIM( cn_dir )//TRIM(bn_a_i%clname) 
    678679               IF( .NOT. bn_a_i%ln_clim ) THEN    
    679                                                   WRITE(clname, '(a,"_y",i4.4)' ) TRIM( bn_a_i%clname ), nyear    ! add year 
    680                   IF( bn_a_i%cltype /= 'yearly' ) WRITE(clname, '(a,"m" ,i2.2)' ) TRIM( clname        ), nmonth   ! add month 
     680                                                  WRITE(clname, '(a,"_y",i4.4)' ) TRIM( clname ), nyear    ! add year 
     681                  IF( bn_a_i%cltype /= 'yearly' ) WRITE(clname, '(a,"m" ,i2.2)' ) TRIM( clname ), nmonth   ! add month 
    681682               ELSE 
    682                   IF( bn_a_i%cltype /= 'yearly' ) WRITE(clname, '(a,"_m",i2.2)' ) TRIM( bn_a_i%clname ), nmonth   ! add month 
     683                  IF( bn_a_i%cltype /= 'yearly' ) WRITE(clname, '(a,"_m",i2.2)' ) TRIM( clname ), nmonth   ! add month 
    683684               ENDIF 
    684685               IF( bn_a_i%cltype == 'daily' .OR. bn_a_i%cltype(1:4) == 'week' ) & 
    685                &                                  WRITE(clname, '(a,"d" ,i2.2)' ) TRIM( clname        ), nday     ! add day 
     686               &                                  WRITE(clname, '(a,"d" ,i2.2)' ) TRIM( clname ), nday     ! add day 
    686687               ! 
    687688               CALL iom_open  ( clname, inum ) 
    688                id1 = iom_varid( inum, bn_a_i%clvar, kdimsz=zdimsz, kndims=zndims, ldstop = .FALSE. ) 
     689               id1 = iom_varid( inum, bn_a_i%clvar, kndims=zndims, ldstop = .FALSE. ) 
    689690               CALL iom_close ( inum ) 
    690691 
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/NEMO/OPA_SRC/DIA/dia25h.F90

    r7753 r8841  
    316316#endif 
    317317            cnt_25h = 1 
    318             IF (lwp)  WRITE(numout,*) 'dia_wri_tide : After 25hr mean write, reset sum to current value and cnt_25h to one for overlapping average',cnt_25h 
     318            IF (lwp)  WRITE(numout,*) 'dia_wri_tide :   & 
     319        &    After 25hr mean write, reset sum to current value and cnt_25h to one for overlapping average',cnt_25h 
    319320 
    320321      ENDIF !  cnt_25h .EQ. 25 .AND.  MOD( kt, i_steps * 24) == 0 .AND. kt .NE. nn_it000 
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/NEMO/OPA_SRC/DIA/diaar5.F90

    r7753 r8841  
    212212      ! Exclude points where rn2 is negative as convection kicks in here and 
    213213      ! work is not being done against stratification 
    214           CALL wrk_alloc( jpi, jpj, zpe ) 
    215           zpe(:,:) = 0._wp 
    216           IF( lk_zdfddm ) THEN 
    217              DO ji=1,jpi 
    218                 DO jj=1,jpj 
    219                    DO jk=1,jpk 
    220                       zrw =   ( gdepw_n(ji,jj,jk  ) - gdept_n(ji,jj,jk) )   & 
    221                          &  / ( gdept_n(ji,jj,jk-1) - gdept_n(ji,jj,jk) ) 
    222                       ! 
    223                       zaw = rab_n(ji,jj,jk,jp_tem) * (1. - zrw) + rab_n(ji,jj,jk-1,jp_tem)* zrw 
    224                       zbw = rab_n(ji,jj,jk,jp_sal) * (1. - zrw) + rab_n(ji,jj,jk-1,jp_sal)* zrw 
    225                       ! 
    226                       zpe(ji, jj) = zpe(ji, jj) - MIN(0._wp, rn2(ji,jj,jk)) * & 
    227                            &       grav * (avt(ji,jj,jk) * zaw * (tsn(ji,jj,jk-1,jp_tem) - tsn(ji,jj,jk,jp_tem) )  & 
    228                            &       - fsavs(ji,jj,jk) * zbw * (tsn(ji,jj,jk-1,jp_sal) - tsn(ji,jj,jk,jp_sal) ) ) 
    229  
    230                    ENDDO 
    231                 ENDDO 
    232              ENDDO 
     214         CALL wrk_alloc( jpi, jpj, zpe ) 
     215         zpe(:,:) = 0._wp 
     216         IF( lk_zdfddm ) THEN 
     217            DO jk = 2, jpk 
     218               DO jj = 1, jpj 
     219                  DO ji = 1, jpi 
     220                     IF( rn2(ji,jj,jk) > 0._wp ) THEN 
     221                        zrw =   ( gdepw_n(ji,jj,jk  ) - gdept_n(ji,jj,jk) )   & 
     222                           &  / ( gdept_n(ji,jj,jk-1) - gdept_n(ji,jj,jk) ) 
     223                        ! 
     224                        zaw = rab_n(ji,jj,jk,jp_tem) * (1. - zrw) + rab_n(ji,jj,jk-1,jp_tem)* zrw 
     225                        zbw = rab_n(ji,jj,jk,jp_sal) * (1. - zrw) + rab_n(ji,jj,jk-1,jp_sal)* zrw 
     226                        ! 
     227                        zpe(ji, jj) = zpe(ji, jj)            & 
     228                           &        -  grav * (    avt(ji,jj,jk) * zaw * (tsn(ji,jj,jk-1,jp_tem) - tsn(ji,jj,jk,jp_tem) )  & 
     229                           &                   - fsavs(ji,jj,jk) * zbw * (tsn(ji,jj,jk-1,jp_sal) - tsn(ji,jj,jk,jp_sal) ) ) 
     230                     ENDIF 
     231                  END DO 
     232               END DO 
     233             END DO 
    233234          ELSE 
    234              DO ji = 1, jpi 
    235                 DO jj = 1, jpj 
    236                    DO jk = 1, jpk 
    237                        zpe(ji,jj) = zpe(ji,jj) + avt(ji, jj, jk) * MIN(0._wp,rn2(ji, jj, jk)) * rau0 * e3w_n(ji, jj, jk) 
    238                    ENDDO 
    239                 ENDDO 
    240              ENDDO 
    241           ENDIF 
    242           CALL lbc_lnk( zpe, 'T', 1._wp)          
    243           CALL iom_put( 'tnpeo', zpe ) 
    244           CALL wrk_dealloc( jpi, jpj, zpe ) 
     235            DO jk = 1, jpk 
     236               DO ji = 1, jpi 
     237                  DO jj = 1, jpj 
     238                     zpe(ji,jj) = zpe(ji,jj) + avt(ji, jj, jk) * MIN(0._wp,rn2(ji, jj, jk)) * rau0 * e3w_n(ji, jj, jk) 
     239                  END DO 
     240               END DO 
     241            END DO 
     242         ENDIF 
     243         CALL lbc_lnk( zpe, 'T', 1._wp)          
     244         CALL iom_put( 'tnpeo', zpe ) 
     245         CALL wrk_dealloc( jpi, jpj, zpe ) 
    245246      ENDIF 
    246247      ! 
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/NEMO/OPA_SRC/DIA/diacfl.F90

    r7753 r8841  
    151151            WRITE(numout,*) 'dia_cfl     : Maximum Courant number information for the run:' 
    152152            WRITE(numout,*) '~~~~~~~~~~~~' 
    153             WRITE(numout,FMT='(12x,a12,7x,f6.4,5x,a16,i4,1x,i4,1x,i4,a1)') 'Run Max Cu', cu_max, 'at (i, j, k) = (', cu_loc(1), cu_loc(2), cu_loc(3), ')' 
     153            WRITE(numout,FMT='(12x,a12,7x,f6.4,5x,a16,i4,1x,i4,1x,i4,a1)') 'Run Max Cu', cu_max, 'at (i, j, k) =   & 
     154                          &   (', cu_loc(1), cu_loc(2), cu_loc(3), ')' 
    154155            WRITE(numout,FMT='(12x,a8,11x,f7.1)') ' => dt/C', dt*(1.0/cu_max) 
    155             WRITE(numout,FMT='(12x,a12,7x,f6.4,5x,a16,i4,1x,i4,1x,i4,a1)') 'Run Max Cv', cv_max, 'at (i, j, k) = (', cv_loc(1), cv_loc(2), cv_loc(3), ')' 
     156            WRITE(numout,FMT='(12x,a12,7x,f6.4,5x,a16,i4,1x,i4,1x,i4,a1)') 'Run Max Cv', cv_max, 'at (i, j, k) =   & 
     157                          &   (', cv_loc(1), cv_loc(2), cv_loc(3), ')' 
    156158            WRITE(numout,FMT='(12x,a8,11x,f7.1)') ' => dt/C', dt*(1.0/cv_max) 
    157             WRITE(numout,FMT='(12x,a12,7x,f6.4,5x,a16,i4,1x,i4,1x,i4,a1)') 'Run Max Cw', cw_max, 'at (i, j, k) = (', cw_loc(1), cw_loc(2), cw_loc(3), ')' 
     159            WRITE(numout,FMT='(12x,a12,7x,f6.4,5x,a16,i4,1x,i4,1x,i4,a1)') 'Run Max Cw', cw_max, 'at (i, j, k) =   & 
     160                          &   (', cw_loc(1), cw_loc(2), cw_loc(3), ')' 
    158161            WRITE(numout,FMT='(12x,a8,11x,f7.1)') ' => dt/C', dt*(1.0/cw_max) 
    159162 
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/NEMO/OPA_SRC/DIA/diadct.F90

    r7646 r8841  
    240240           !debug this section computing ? 
    241241           lldebug=.FALSE. 
    242            IF( (jsec==nn_secdebug .OR. nn_secdebug==-1) .AND.  kt==nit000+nn_dct-1 .AND. lwp ) lldebug=.TRUE.  
     242           IF( (jsec==nn_secdebug .OR. nn_secdebug==-1) .AND.  kt==nit000+nn_dct-1 ) lldebug=.TRUE.  
    243243 
    244244           !Compute transport through section   
     
    249249        IF( MOD(kt,nn_dctwri)==0 )THEN 
    250250 
    251            IF( lwp .AND. kt==nit000+nn_dctwri-1 )WRITE(numout,*)"      diadct: average transports and write at kt = ",kt          
     251           IF( kt==nit000+nn_dctwri-1 )WRITE(numout,*)"      diadct: average transports and write at kt = ",kt          
    252252   
    253253           !! divide arrays by nn_dctwri/nn_dct to obtain average  
     
    335335     DO jsec=1,nb_sec_max      !loop on the nb_sec sections 
    336336 
    337         IF ( lwp .AND. ( jsec==nn_secdebug .OR. nn_secdebug==-1 ) ) & 
     337        IF (  jsec==nn_secdebug .OR. nn_secdebug==-1 ) & 
    338338           & WRITE(numout,*)'debuging for section number: ',jsec  
    339339 
     
    355355        IF( jsec .NE. isec )  CALL ctl_stop( cltmp ) 
    356356 
    357         IF( lwp .AND. ( jsec==nn_secdebug .OR. nn_secdebug==-1 ) )WRITE(numout,*)"isec ",isec  
     357        IF( jsec==nn_secdebug .OR. nn_secdebug==-1 )WRITE(numout,*)"isec ",isec  
    358358 
    359359        READ(numdct_in)secs(jsec)%name 
     
    374374        !----- 
    375375 
    376         IF( lwp .AND. ( jsec==nn_secdebug .OR. nn_secdebug==-1 ) )THEN 
     376        IF( jsec==nn_secdebug .OR. nn_secdebug==-1 )THEN 
    377377           
    378378            WRITE(clformat,'(a,i2,a)') '(A40,', nb_class_max,'(f8.3,1X))'  
     
    407407           !debug 
    408408           !----- 
    409            IF( lwp .AND. ( jsec==nn_secdebug .OR. nn_secdebug==-1 ) )THEN 
     409           IF( jsec==nn_secdebug .OR. nn_secdebug==-1 )THEN 
    410410              WRITE(numout,*)"      List of points in global domain:" 
    411411              DO jpt=1,iptglo 
     
    441441           !debug 
    442442           !----- 
    443            IF(   lwp .AND. ( jsec==nn_secdebug .OR. nn_secdebug==-1 ) )THEN 
     443           IF( jsec==nn_secdebug .OR. nn_secdebug==-1 )THEN 
    444444              WRITE(numout,*)"      List of points selected by the proc:" 
    445445              DO jpt = 1,iptloc 
     
    459459           !remove redundant points between processors 
    460460           !------------------------------------------ 
    461            lldebug = .FALSE. ; IF ( (jsec==nn_secdebug .OR. nn_secdebug==-1) .AND. lwp ) lldebug = .TRUE. 
     461           lldebug = .FALSE. ; IF ( jsec==nn_secdebug .OR. nn_secdebug==-1 ) lldebug = .TRUE. 
    462462           IF( iptloc .NE. 0 )THEN 
    463463              CALL removepoints(secs(jsec),'I','top_list',lldebug) 
     
    475475           !debug 
    476476           !----- 
    477            IF( lwp .AND. ( jsec==nn_secdebug .OR. nn_secdebug==-1 ) )THEN 
     477           IF( jsec==nn_secdebug .OR. nn_secdebug==-1 )THEN 
    478478              WRITE(numout,*)"      List of points after removepoints:" 
    479479              iptloc = secs(jsec)%nb_point 
     
    487487 
    488488        ELSE  ! iptglo = 0 
    489            IF( lwp .AND. ( jsec==nn_secdebug .OR. nn_secdebug==-1 ) )& 
     489           IF( jsec==nn_secdebug .OR. nn_secdebug==-1 )& 
    490490              WRITE(numout,*)'   No points for this section.' 
    491491        ENDIF 
     
    695695            !     LOOP ON THE LEVEL     |  
    696696            !---------------------------|  
    697             DO jk = 1, mbathy(k%I,k%J)            !Sum of the transport on the vertical 
     697            DO jk = 1, mbkt(k%I,k%J)            !Sum of the transport on the vertical 
    698698            !           ! compute temperature, salinity, insitu & potential density, ssh and depth at U/V point  
    699699            SELECT CASE( sec%direction(jseg) ) 
     
    874874           !---------------------------|  
    875875           !Sum of the transport on the vertical   
    876            DO jk=1,mbathy(k%I,k%J)  
     876           DO jk=1,mbkt(k%I,k%J)  
    877877  
    878878              ! compute temperature, salinity, insitu & potential density, ssh and depth at U/V point  
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/NEMO/OPA_SRC/DIA/diawri.F90

    r7753 r8841  
    282282      ! 
    283283      IF ( iom_use("eken") ) THEN 
    284          rke(:,:,jk) = 0._wp                               !      kinetic energy  
     284         rke(:,:,jpk) = 0._wp                               !      kinetic energy  
    285285         DO jk = 1, jpkm1 
    286286            DO jj = 2, jpjm1 
    287287               DO ji = fs_2, fs_jpim1   ! vector opt. 
    288                   zztmp   = 1._wp / ( e1e2t(ji,jj) * e3t_n(ji,jj,jk) ) 
    289                   zztmpx  = 0.5 * (  un(ji-1,jj,jk) * un(ji-1,jj,jk) * e2u(ji-1,jj) * e3u_n(ji-1,jj,jk)    & 
    290                      &             + un(ji  ,jj,jk) * un(ji  ,jj,jk) * e2u(ji  ,jj) * e3u_n(ji  ,jj,jk) )  & 
     288                  zztmp   = r1_e1e2t(ji,jj) / e3t_n(ji,jj,jk) 
     289                  zztmpx  = 0.5 * (  un(ji-1,jj,jk) * un(ji-1,jj,jk) * e1e2u(ji-1,jj) * e3u_n(ji-1,jj,jk)    & 
     290                     &             + un(ji  ,jj,jk) * un(ji  ,jj,jk) * e1e2u(ji  ,jj) * e3u_n(ji  ,jj,jk) )  & 
    291291                     &          *  zztmp  
    292292                  ! 
    293                   zztmpy  = 0.5 * (  vn(ji,jj-1,jk) * vn(ji,jj-1,jk) * e1v(ji,jj-1) * e3v_n(ji,jj-1,jk)    & 
    294                      &             + vn(ji,jj  ,jk) * vn(ji,jj  ,jk) * e1v(ji,jj  ) * e3v_n(ji,jj  ,jk) )  & 
     293                  zztmpy  = 0.5 * (  vn(ji,jj-1,jk) * vn(ji,jj-1,jk) * e1e2v(ji,jj-1) * e3v_n(ji,jj-1,jk)    & 
     294                     &             + vn(ji,jj  ,jk) * vn(ji,jj  ,jk) * e1e2v(ji,jj  ) * e3v_n(ji,jj  ,jk) )  & 
    295295                     &          *  zztmp  
    296296                  ! 
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/NEMO/OPA_SRC/DOM/daymod.F90

    r7646 r8841  
    134134 
    135135      ! control print 
    136       IF(lwp) WRITE(numout,'(a,i6,a,i2,a,i2,a,i8,a,i8,a,i8,a,i8)')' =======>> 1/2 time step before the start of the run DATE Y/M/D = ',   & 
     136      IF(lwp) WRITE(numout,'(a,i6,a,i2,a,i2,a,i8,a,i8,a,i8,a,i8)')   & 
     137           &                   ' =======>> 1/2 time step before the start of the run DATE Y/M/D = ',   & 
    137138           &                   nyear, '/', nmonth, '/', nday, '  nsec_day:', nsec_day, '  nsec_week:', nsec_week, '  & 
    138139           &                   nsec_month:', nsec_month , '  nsec_year:' , nsec_year 
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/NEMO/OPA_SRC/DOM/dom_oce.F90

    r7646 r8841  
    124124   REAL(wp), PUBLIC, ALLOCATABLE, SAVE        , DIMENSION(:,:) ::   e1e2f , r1_e1e2f                !: associated metrics at f-point 
    125125   ! 
    126    REAL(wp), PUBLIC, ALLOCATABLE, SAVE        , DIMENSION(:,:) ::   ff_f, ff_t                      !: coriolis factor at f- and t-point         [1/s] 
     126   REAL(wp), PUBLIC, ALLOCATABLE, SAVE        , DIMENSION(:,:) ::   ff_f, ff_t                      !: Coriolis factor at f- & t-points  [1/s] 
    127127   !!---------------------------------------------------------------------- 
    128128   !! vertical coordinate and scale factors 
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/NEMO/OPA_SRC/DOM/iscplrst.F90

    r7646 r8841  
    219219               DO ji=1,jpi 
    220220                  IF (tmask(ji,jj,1) == 0._wp .OR. ptmask_b(ji,jj,1) == 0._wp) THEN 
    221                      e3t_n(ji,jj,jk) = e3t_0(ji,jj,jk) * ( 1._wp + sshn(ji,jj) / ( ht_0(ji,jj) + 1._wp - ssmask(ji,jj) ) * tmask(ji,jj,jk) ) 
     221                     e3t_n(ji,jj,jk) = e3t_0(ji,jj,jk) * ( 1._wp + sshn(ji,jj) /   & 
     222                     &   ( ht_0(ji,jj) + 1._wp - ssmask(ji,jj) ) * tmask(ji,jj,jk) ) 
    222223                  ENDIF 
    223224               END DO 
     
    390391            DO jj = 1,jpj 
    391392               DO ji = 1,jpi 
    392                   IF (zwmaskn(ji,jj,jk) * zwmaskb(ji,jj,jk) == 1._wp .AND. (tmask(ji,jj,1)==0._wp .OR. ptmask_b(ji,jj,1)==0._wp) ) THEN 
     393                  IF (zwmaskn(ji,jj,jk) * zwmaskb(ji,jj,jk) == 1._wp .AND.   & 
     394                  &      (tmask(ji,jj,1)==0._wp .OR. ptmask_b(ji,jj,1)==0._wp) ) THEN 
    393395                     !compute weight 
    394396                     zdzp1 = MAX(0._wp,gdepw_n(ji,jj,jk+1) - pdepw_b(ji,jj,jk+1)) 
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/NEMO/OPA_SRC/DYN/dynvor.F90

    r7753 r8841  
    181181         ELSE                                               ! total vorticity trend 
    182182                             CALL vor_een( kt, ntot, un , vn , ua, va )   ! total vorticity trend 
    183             IF( ln_stcor )   CALL vor_ene( kt, ncor, usd, vsd, ua, va )   ! add the Stokes-Coriolis trend 
     183            IF( ln_stcor )   CALL vor_een( kt, ncor, usd, vsd, ua, va )   ! add the Stokes-Coriolis trend 
    184184         ENDIF 
    185185         ! 
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/NEMO/OPA_SRC/ICB/icbtrj.F90

    r5215 r8841  
    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 + rdt / 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")')   & 
     83                          &   TRIM(ADJUSTL(cldate_ini)), TRIM(ADJUSTL(cldate_end)), narea-1 
     84      ELSE                ;   WRITE(cl_filename,'("trajectory_icebergs_",A,"-",A         ,".nc")')   & 
     85                          &   TRIM(ADJUSTL(cldate_ini)), TRIM(ADJUSTL(cldate_end)) 
    6986      ENDIF 
    7087      IF ( lwp .AND. nn_verbose_level >= 0) WRITE(numout,'(2a)') 'icebergs, icb_trj_init: creating ',TRIM(cl_filename) 
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/NEMO/OPA_SRC/IOM/iom.F90

    r7768 r8841  
    774774         istart(idmspc+1) = itime 
    775775 
    776          IF( PRESENT(kstart) .AND. .NOT. ll_depth_spec ) THEN ; istart(1:idmspc) = kstart(1:idmspc) ; icnt(1:idmspc) = kcount(1:idmspc) 
     776         IF( PRESENT(kstart) .AND. .NOT. ll_depth_spec ) THEN  
     777            istart(1:idmspc) = kstart(1:idmspc) ; icnt(1:idmspc) = kcount(1:idmspc) 
    777778         ELSE 
    778             IF(           idom == jpdom_unknown ) THEN                                                ; icnt(1:idmspc) = idimsz(1:idmspc) 
     779            IF(idom == jpdom_unknown ) THEN 
     780               icnt(1:idmspc) = idimsz(1:idmspc) 
    779781            ELSE  
    780782               IF( .NOT. PRESENT(pv_r1d) ) THEN   !   not a 1D array 
     
    15401542      ALLOCATE( zlon(ni*nj) )       ;       zlon(:) = 0. 
    15411543 
    1542       CALL dom_ngb( 180., 90., ix, iy, 'T' ) !  i-line that passes near the North Pole : Reference latitude (used in plots) 
     1544      CALL dom_ngb( -168.53, 65.03, ix, iy, 'T' ) !  i-line that passes through Bering Strait: Reference latitude (used in plots) 
    15431545      CALL iom_set_domain_attr("gznl", ni_glo=jpiglo, nj_glo=jpjglo, ibegin=nimpp+nldi-2, jbegin=njmpp+nldj-2, ni=ni, nj=nj) 
    15441546      CALL iom_set_domain_attr("gznl", data_dim=2, data_ibegin = 1-nldi, data_ni = jpi, data_jbegin = 1-nldj, data_nj = jpj) 
     
    15951597      ! frequency of the call of iom_put (attribut: freq_op) 
    15961598      f_op%timestep = 1        ;  f_of%timestep = 0  ; CALL iom_set_field_attr('field_definition', freq_op=f_op, freq_offset=f_of) 
     1599      f_op%timestep = 2        ;  f_of%timestep = 0  ; CALL iom_set_field_attr('trendT_even'     , freq_op=f_op, freq_offset=f_of) 
     1600      f_op%timestep = 2        ;  f_of%timestep = -1 ; CALL iom_set_field_attr('trendT_odd'      , freq_op=f_op, freq_offset=f_of) 
    15971601      f_op%timestep = nn_fsbc  ;  f_of%timestep = 0  ; CALL iom_set_field_attr('SBC'             , freq_op=f_op, freq_offset=f_of) 
    15981602      f_op%timestep = nn_fsbc  ;  f_of%timestep = 0  ; CALL iom_set_field_attr('SBC_scalar'      , freq_op=f_op, freq_offset=f_of) 
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/NEMO/OPA_SRC/LBC/lbclnk.F90

    r6493 r8841  
    235235 
    236236      !! Look if more arrays to process 
    237       IF(PRESENT (psgnB) )CALL lbc_lnk( pt2dA, cd_typeA, psgnA )  
     237      IF(PRESENT (psgnB) )CALL lbc_lnk( pt2dB, cd_typeB, psgnB ) 
    238238      IF(PRESENT (psgnC) )CALL lbc_lnk( pt2dC, cd_typeC, psgnC )  
    239239      IF(PRESENT (psgnD) )CALL lbc_lnk( pt2dD, cd_typeD, psgnD )  
     
    490490 
    491491      !! Look if more arrays to process 
    492       IF(PRESENT (psgnB) )CALL lbc_lnk( pt2dA, cd_typeA, psgnA )  
     492      IF(PRESENT (psgnB) )CALL lbc_lnk( pt2dB, cd_typeB, psgnB ) 
    493493      IF(PRESENT (psgnC) )CALL lbc_lnk( pt2dC, cd_typeC, psgnC )  
    494494      IF(PRESENT (psgnD) )CALL lbc_lnk( pt2dD, cd_typeD, psgnD )  
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/NEMO/OPA_SRC/SBC/cpl_oasis3.F90

    r7646 r8841  
    195195         WRITE(numout,*) ' multiexchg: nldj, nlej, njmpp =', nldj, nlej, njmpp 
    196196      ENDIF 
    197        
    198       CALL oasis_def_partition ( id_part, paral, nerror ) 
     197    
     198      CALL oasis_def_partition ( id_part, paral, nerror, jpiglo*jpjglo ) 
    199199      ! 
    200200      ! ... Announce send variables.  
     
    514514   END SUBROUTINE oasis_get_localcomm 
    515515 
    516    SUBROUTINE oasis_def_partition(k1,k2,k3) 
     516   SUBROUTINE oasis_def_partition(k1,k2,k3,k4) 
    517517      INTEGER     , INTENT(  out) ::  k1,k3 
    518518      INTEGER     , INTENT(in   ) ::  k2(5) 
    519       k1 = k2(1) ; k3 = k2(5) 
     519      INTEGER     , INTENT(in   ) ::  k4 
     520      k1 = k2(1) ; k3 = k2(5)+k4 
    520521      WRITE(numout,*) 'oasis_def_partition: Error you sould not be there...' 
    521522   END SUBROUTINE oasis_def_partition 
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/NEMO/OPA_SRC/SBC/sbcapr.F90

    r6140 r8841  
    2323   PRIVATE 
    2424 
    25    PUBLIC   sbc_apr    ! routine called in sbcmod 
     25   PUBLIC   sbc_apr       ! routine called in sbcmod 
     26   PUBLIC   sbc_apr_init  ! routine called in sbcmod 
    2627    
    2728   !                                !!* namsbc_apr namelist (Atmospheric PRessure) * 
     
    4647CONTAINS 
    4748 
     49   SUBROUTINE sbc_apr_init 
     50      !!--------------------------------------------------------------------- 
     51      !!                     ***  ROUTINE sbc_apr  *** 
     52      !! 
     53      !! ** Purpose :   read atmospheric pressure fields in netcdf files. 
     54      !! 
     55      !! ** Method  : - Read namelist namsbc_apr 
     56      !!              - Read Patm fields in netcdf files  
     57      !!              - Compute reference atmospheric pressure 
     58      !!              - Compute inverse barometer ssh 
     59      !! ** action  :   apr      : atmospheric pressure at kt 
     60      !!                ssh_ib   : inverse barometer ssh at kt 
     61      !!--------------------------------------------------------------------- 
     62      INTEGER            ::   ierror  ! local integer  
     63      INTEGER            ::   ios     ! Local integer output status for namelist read 
     64      !! 
     65      CHARACTER(len=100) ::  cn_dir   ! Root directory for location of ssr files 
     66      TYPE(FLD_N)        ::  sn_apr   ! informations about the fields to be read 
     67      !! 
     68      NAMELIST/namsbc_apr/ cn_dir, sn_apr, ln_ref_apr, rn_pref, ln_apr_obc 
     69      !!---------------------------------------------------------------------- 
     70      REWIND( numnam_ref )              ! Namelist namsbc_apr in reference namelist : File for atmospheric pressure forcing 
     71      READ  ( numnam_ref, namsbc_apr, IOSTAT = ios, ERR = 901) 
     72901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namsbc_apr in reference namelist', lwp ) 
     73 
     74      REWIND( numnam_cfg )              ! Namelist namsbc_apr in configuration namelist : File for atmospheric pressure forcing 
     75      READ  ( numnam_cfg, namsbc_apr, IOSTAT = ios, ERR = 902 ) 
     76902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namsbc_apr in configuration namelist', lwp ) 
     77      IF(lwm) WRITE ( numond, namsbc_apr ) 
     78      ! 
     79      ALLOCATE( sf_apr(1), STAT=ierror )           !* allocate and fill sf_sst (forcing structure) with sn_sst 
     80      IF( ierror > 0 )   CALL ctl_stop( 'STOP', 'sbc_apr: unable to allocate sf_apr structure' ) 
     81      ! 
     82      CALL fld_fill( sf_apr, (/ sn_apr /), cn_dir, 'sbc_apr', 'Atmospheric pressure ', 'namsbc_apr' ) 
     83                                ALLOCATE( sf_apr(1)%fnow(jpi,jpj,1)   ) 
     84      IF( sn_apr%ln_tint )   ALLOCATE( sf_apr(1)%fdta(jpi,jpj,1,2) ) 
     85                             ALLOCATE( ssh_ib(jpi,jpj) , ssh_ibb(jpi,jpj) ) 
     86                             ALLOCATE( apr (jpi,jpj) ) 
     87      ! 
     88      IF( lwp )THEN                                 !* control print 
     89         WRITE(numout,*) 
     90         WRITE(numout,*) '   Namelist namsbc_apr : Atmospheric PRessure as extrenal forcing' 
     91         WRITE(numout,*) '      ref. pressure: global mean Patm (T) or a constant (F)  ln_ref_apr = ', ln_ref_apr 
     92      ENDIF 
     93      ! 
     94      IF( ln_ref_apr ) THEN                        !* Compute whole inner domain mean masked ocean surface 
     95         tarea = glob_sum( e1e2t(:,:) ) 
     96         IF(lwp) WRITE(numout,*) '         Variable ref. Patm computed over a ocean surface of ', tarea*1e-6, 'km2' 
     97      ELSE 
     98         IF(lwp) WRITE(numout,*) '         Reference Patm used : ', rn_pref, ' N/m2' 
     99      ENDIF 
     100      ! 
     101      r1_grau = 1.e0 / (grav * rau0)               !* constant for optimization 
     102      ! 
     103      !                                            !* control check 
     104      IF ( ln_apr_obc  ) THEN 
     105         IF(lwp) WRITE(numout,*) '         Inverse barometer added to OBC ssh data' 
     106      ENDIF 
     107!jc: stop below should rather be a warning  
     108      IF( ln_apr_obc .AND. .NOT.ln_apr_dyn   )   & 
     109            CALL ctl_warn( 'sbc_apr: use inverse barometer ssh at open boundary ONLY requires ln_apr_dyn=T' ) 
     110      ! 
     111   END SUBROUTINE sbc_apr_init 
     112 
    48113   SUBROUTINE sbc_apr( kt ) 
    49114      !!--------------------------------------------------------------------- 
     
    61126      INTEGER, INTENT(in)::   kt   ! ocean time step 
    62127      ! 
    63       INTEGER            ::   ierror  ! local integer  
    64       INTEGER            ::   ios     ! Local integer output status for namelist read 
    65       !! 
    66       CHARACTER(len=100) ::  cn_dir   ! Root directory for location of ssr files 
    67       TYPE(FLD_N)        ::  sn_apr   ! informations about the fields to be read 
    68       !! 
    69       NAMELIST/namsbc_apr/ cn_dir, sn_apr, ln_ref_apr, rn_pref, ln_apr_obc 
    70128      !!---------------------------------------------------------------------- 
    71       ! 
    72       !                                         ! -------------------- ! 
    73       IF( kt == nit000 ) THEN                   ! First call kt=nit000 ! 
    74          !                                      ! -------------------- ! 
    75          REWIND( numnam_ref )              ! Namelist namsbc_apr in reference namelist : File for atmospheric pressure forcing 
    76          READ  ( numnam_ref, namsbc_apr, IOSTAT = ios, ERR = 901) 
    77 901      IF( ios /= 0 ) CALL ctl_nam ( ios , 'namsbc_apr in reference namelist', lwp ) 
    78  
    79          REWIND( numnam_cfg )              ! Namelist namsbc_apr in configuration namelist : File for atmospheric pressure forcing 
    80          READ  ( numnam_cfg, namsbc_apr, IOSTAT = ios, ERR = 902 ) 
    81 902      IF( ios /= 0 ) CALL ctl_nam ( ios , 'namsbc_apr in configuration namelist', lwp ) 
    82          IF(lwm) WRITE ( numond, namsbc_apr ) 
    83          ! 
    84          ALLOCATE( sf_apr(1), STAT=ierror )           !* allocate and fill sf_sst (forcing structure) with sn_sst 
    85          IF( ierror > 0 )   CALL ctl_stop( 'STOP', 'sbc_apr: unable to allocate sf_apr structure' ) 
    86          ! 
    87          CALL fld_fill( sf_apr, (/ sn_apr /), cn_dir, 'sbc_apr', 'Atmospheric pressure ', 'namsbc_apr' ) 
    88                                 ALLOCATE( sf_apr(1)%fnow(jpi,jpj,1)   ) 
    89          IF( sn_apr%ln_tint )   ALLOCATE( sf_apr(1)%fdta(jpi,jpj,1,2) ) 
    90                                 ALLOCATE( ssh_ib(jpi,jpj) , ssh_ibb(jpi,jpj) ) 
    91                                 ALLOCATE( apr (jpi,jpj) ) 
    92          ! 
    93          IF(lwp) THEN                                 !* control print 
    94             WRITE(numout,*) 
    95             WRITE(numout,*) '   Namelist namsbc_apr : Atmospheric PRessure as extrenal forcing' 
    96             WRITE(numout,*) '      ref. pressure: global mean Patm (T) or a constant (F)  ln_ref_apr = ', ln_ref_apr 
    97          ENDIF 
    98          ! 
    99          IF( ln_ref_apr ) THEN                        !* Compute whole inner domain mean masked ocean surface 
    100             tarea = glob_sum( e1e2t(:,:) ) 
    101             IF(lwp) WRITE(numout,*) '         Variable ref. Patm computed over a ocean surface of ', tarea*1e-6, 'km2' 
    102          ELSE 
    103             IF(lwp) WRITE(numout,*) '         Reference Patm used : ', rn_pref, ' N/m2' 
    104          ENDIF 
    105          ! 
    106          r1_grau = 1.e0 / (grav * rau0)               !* constant for optimization 
    107          ! 
    108          !                                            !* control check 
    109          IF ( ln_apr_obc  ) THEN 
    110             IF(lwp) WRITE(numout,*) '         Inverse barometer added to OBC ssh data' 
    111          ENDIF 
    112 !jc: stop below should rather be a warning  
    113          IF( ln_apr_obc .AND. .NOT.ln_apr_dyn   )   & 
    114             CALL ctl_stop( 'sbc_apr: use inverse barometer ssh at open boundary ONLY requires ln_apr_dyn=T' ) 
    115       ENDIF 
    116129 
    117130      !                                         ! ========================== ! 
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/NEMO/OPA_SRC/SBC/sbcblk.F90

    r7753 r8841  
    186186      !                             !** initialization of the chosen bulk formulae (+ check) 
    187187      !                                   !* select the bulk chosen in the namelist and check the choice 
    188       ;                                                        ioptio = 0 
     188                                                               ioptio = 0 
    189189      IF( ln_NCAR      ) THEN   ;   nblk =  np_NCAR        ;   ioptio = ioptio + 1   ;   ENDIF 
    190190      IF( ln_COARE_3p0 ) THEN   ;   nblk =  np_COARE_3p0   ;   ioptio = ioptio + 1   ;   ENDIF 
     
    219219         ALLOCATE( sf(ifpr)%fnow(jpi,jpj,1) ) 
    220220         IF( slf_i(ifpr)%ln_tint )   ALLOCATE( sf(ifpr)%fdta(jpi,jpj,1,2) ) 
     221 
     222           IF( slf_i(ifpr)%nfreqh .GT. 0._wp .AND. MOD( 3600._wp * slf_i(ifpr)%nfreqh , REAL(nn_fsbc, wp) * rdt) .NE. 0._wp  )   & 
     223            &  CALL ctl_warn( 'sbcmod time step rdt * nn_fsbc is NOT a submultiple of atmospheric forcing frequency' ) 
     224 
    221225      END DO 
    222226      !                                      !- fill the bulk structure with namelist informations 
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/NEMO/OPA_SRC/SBC/sbccpl.F90

    r7815 r8841  
    15661566      !!             qsr_tot = pfrld * qsr_oce + ( 1 - pfrld ) * qsr_ice   => provided 
    15671567      !! 
    1568       !!             emp_tot = emp_oce + emp_ice                           => calving is provided and added to emp_tot (and emp_oce) 
    1569       !!                                                                      river runoff (rnf) is provided but not included here 
    1570       !! 
     1568      !!             emp_tot = emp_oce + emp_ice                           => calving is provided and added to emp_tot (and emp_oce). 
     1569      !!                                                                      runoff (which includes rivers+icebergs) and iceshelf 
     1570      !!                                                                      are provided but not included in emp here. Only runoff will 
     1571      !!                                                                      be included in emp in other parts of NEMO code 
    15711572      !! ** Action  :   update at each nf_ice time step: 
    15721573      !!                   qns_tot, qsr_tot  non-solar and solar total heat fluxes 
     
    15841585      ! 
    15851586      INTEGER ::   jl         ! dummy loop index 
    1586       REAL(wp), POINTER, DIMENSION(:,:  ) ::   zcptn, ztmp, zcptrain, zcptsnw, zicefr, zmsk, zsnw 
     1587      REAL(wp), POINTER, DIMENSION(:,:  ) ::   zcptn, zcptrain, zcptsnw, zicefr, zmsk, zsnw 
    15871588      REAL(wp), POINTER, DIMENSION(:,:  ) ::   zemp_tot, zemp_ice, zemp_oce, ztprecip, zsprecip, zevap_oce, zevap_ice, zdevap_ice 
    15881589      REAL(wp), POINTER, DIMENSION(:,:  ) ::   zqns_tot, zqns_oce, zqsr_tot, zqsr_oce, zqprec_ice, zqemp_oce, zqemp_ice 
     
    15921593      IF( nn_timing == 1 )  CALL timing_start('sbc_cpl_ice_flx') 
    15931594      ! 
    1594       CALL wrk_alloc( jpi,jpj,     zcptn, ztmp, zcptrain, zcptsnw, zicefr, zmsk, zsnw ) 
     1595      CALL wrk_alloc( jpi,jpj,     zcptn, zcptrain, zcptsnw, zicefr, zmsk, zsnw ) 
    15951596      CALL wrk_alloc( jpi,jpj,     zemp_tot, zemp_ice, zemp_oce, ztprecip, zsprecip, zevap_oce, zevap_ice, zdevap_ice ) 
    15961597      CALL wrk_alloc( jpi,jpj,     zqns_tot, zqns_oce, zqsr_tot, zqsr_oce, zqprec_ice, zqemp_oce, zqemp_ice ) 
     
    16151616         zemp_tot(:,:) =   frcv(jpr_tevp)%z3(:,:,1) - ztprecip(:,:) 
    16161617         zemp_ice(:,:) = ( frcv(jpr_ievp)%z3(:,:,1) - frcv(jpr_snow)%z3(:,:,1) ) * zicefr(:,:) 
    1617          IF( iom_use('precip') )          & 
    1618             &  CALL iom_put( 'precip'       ,   frcv(jpr_rain)%z3(:,:,1) + frcv(jpr_snow)%z3(:,:,1)                              )  ! total  precipitation 
    1619          IF( iom_use('rain') )            & 
    1620             &  CALL iom_put( 'rain'         ,   frcv(jpr_rain)%z3(:,:,1)                                                         )  ! liquid precipitation  
    1621          IF( iom_use('rain_ao_cea') )   & 
    1622             &  CALL iom_put( 'rain_ao_cea'  , frcv(jpr_rain)%z3(:,:,1)* p_frld(:,:) * tmask(:,:,1)      )   ! liquid precipitation  
    1623          IF( iom_use('hflx_rain_cea') )   & 
    1624             CALL iom_put( 'hflx_rain_cea', frcv(jpr_rain)%z3(:,:,1) * zcptn(:,:) * tmask(:,:,1))   ! heat flux from liq. precip.  
    1625          IF( iom_use('hflx_prec_cea') )   & 
    1626             CALL iom_put( 'hflx_prec_cea', ztprecip * zcptn(:,:) * tmask(:,:,1) * p_frld(:,:) )   ! heat content flux from all precip  (cell avg) 
    1627          IF( iom_use('evap_ao_cea') .OR. iom_use('hflx_evap_cea') )   & 
    1628             ztmp(:,:) = frcv(jpr_tevp)%z3(:,:,1) - frcv(jpr_ievp)%z3(:,:,1) * zicefr(:,:) 
    1629          IF( iom_use('evap_ao_cea'  ) )   & 
    1630             CALL iom_put( 'evap_ao_cea'  , ztmp * tmask(:,:,1)                  )   ! ice-free oce evap (cell average) 
    1631          IF( iom_use('hflx_evap_cea') )   & 
    1632             CALL iom_put( 'hflx_evap_cea', ztmp(:,:) * zcptn(:,:) * tmask(:,:,1) )   ! heat flux from from evap (cell average) 
    16331618      CASE( 'oce and ice'   )   ! received fields: jpr_sbpr, jpr_semp, jpr_oemp, jpr_ievp 
    16341619         zemp_tot(:,:) = p_frld(:,:) * frcv(jpr_oemp)%z3(:,:,1) + zicefr(:,:) * frcv(jpr_sbpr)%z3(:,:,1) 
     
    16391624 
    16401625#if defined key_lim3 
    1641       ! zsnw = snow fraction over ice after wind blowing 
     1626      ! zsnw = snow fraction over ice after wind blowing (=zicefr if no blowing) 
    16421627      zsnw(:,:) = 0._wp  ;  CALL lim_thd_snwblow( p_frld, zsnw ) 
    16431628       
     
    16521637      zevap_ice(:,:) = frcv(jpr_ievp)%z3(:,:,1) 
    16531638      ! since the sensitivity of evap to temperature (devap/dT) is not prescribed by the atmosphere, we set it to 0 
    1654       ! therefore, sublimation is not redistributed over the ice categories in case no subgrid scale fluxes are provided by atm. 
     1639      ! therefore, sublimation is not redistributed over the ice categories when no subgrid scale fluxes are provided by atm. 
    16551640      zdevap_ice(:,:) = 0._wp 
    16561641       
    1657       ! --- runoffs (included in emp later on) --- ! 
    1658       IF( srcv(jpr_rnf)%laction )   rnf(:,:) = frcv(jpr_rnf)%z3(:,:,1) 
    1659  
    1660       ! --- calving (put in emp_tot and emp_oce) --- ! 
    1661       IF( srcv(jpr_cal)%laction ) THEN  
     1642      ! --- Continental fluxes --- ! 
     1643      IF( srcv(jpr_rnf)%laction ) THEN   ! runoffs (included in emp later on) 
     1644         rnf(:,:) = frcv(jpr_rnf)%z3(:,:,1) 
     1645      ENDIF 
     1646      IF( srcv(jpr_cal)%laction ) THEN   ! calving (put in emp_tot and emp_oce) 
    16621647         zemp_tot(:,:) = zemp_tot(:,:) - frcv(jpr_cal)%z3(:,:,1) 
    16631648         zemp_oce(:,:) = zemp_oce(:,:) - frcv(jpr_cal)%z3(:,:,1) 
    1664          CALL iom_put( 'calving_cea', frcv(jpr_cal)%z3(:,:,1) ) 
    1665       ENDIF 
    1666  
    1667       IF( srcv(jpr_icb)%laction )  THEN  
     1649      ENDIF 
     1650      IF( srcv(jpr_icb)%laction ) THEN   ! iceberg added to runoffs 
    16681651         fwficb(:,:) = frcv(jpr_icb)%z3(:,:,1) 
    1669          rnf(:,:)    = rnf(:,:) + fwficb(:,:)   ! iceberg added to runoffs 
    1670          CALL iom_put( 'iceberg_cea', frcv(jpr_icb)%z3(:,:,1) ) 
    1671       ENDIF 
    1672       IF( srcv(jpr_isf)%laction )  THEN 
    1673         fwfisf(:,:) = - frcv(jpr_isf)%z3(:,:,1)  ! fresh water flux from the isf (fwfisf <0 mean melting)   
    1674         CALL iom_put( 'iceshelf_cea', frcv(jpr_isf)%z3(:,:,1) ) 
    1675       ENDIF 
    1676  
     1652         rnf(:,:)    = rnf(:,:) + fwficb(:,:) 
     1653      ENDIF 
     1654      IF( srcv(jpr_isf)%laction ) THEN   ! iceshelf (fwfisf <0 mean melting) 
     1655        fwfisf(:,:) = - frcv(jpr_isf)%z3(:,:,1)   
     1656      ENDIF 
    16771657 
    16781658      IF( ln_mixcpl ) THEN 
     
    16981678      ENDIF 
    16991679 
    1700       IF( iom_use('subl_ai_cea') )   CALL iom_put( 'subl_ai_cea', zevap_ice(:,:) * zicefr(:,:)         )  ! Sublimation over sea-ice (cell average) 
    1701                                      CALL iom_put( 'snowpre'    , sprecip(:,:)                         )  ! Snow 
    1702       IF( iom_use('snow_ao_cea') )   CALL iom_put( 'snow_ao_cea', sprecip(:,:) * ( 1._wp - zsnw(:,:) ) )  ! Snow over ice-free ocean  (cell average) 
    1703       IF( iom_use('snow_ai_cea') )   CALL iom_put( 'snow_ai_cea', sprecip(:,:) *           zsnw(:,:)   )  ! Snow over sea-ice         (cell average) 
    17041680#else 
    1705       ! runoffs and calving (put in emp_tot) 
    1706       IF( srcv(jpr_rnf)%laction )   rnf(:,:) = frcv(jpr_rnf)%z3(:,:,1) 
    1707       IF( iom_use('hflx_rnf_cea') )   & 
    1708          CALL iom_put( 'hflx_rnf_cea' , rnf(:,:) * zcptn(:,:) ) 
    1709       IF( srcv(jpr_cal)%laction ) THEN  
     1681      zsnw(:,:) = zicefr(:,:) 
     1682      ! --- Continental fluxes --- ! 
     1683      IF( srcv(jpr_rnf)%laction ) THEN   ! runoffs (included in emp later on) 
     1684         rnf(:,:) = frcv(jpr_rnf)%z3(:,:,1) 
     1685      ENDIF 
     1686      IF( srcv(jpr_cal)%laction ) THEN   ! calving (put in emp_tot) 
    17101687         zemp_tot(:,:) = zemp_tot(:,:) - frcv(jpr_cal)%z3(:,:,1) 
    1711          CALL iom_put( 'calving_cea', frcv(jpr_cal)%z3(:,:,1) ) 
    1712       ENDIF 
    1713  
    1714  
    1715       IF( srcv(jpr_icb)%laction )  THEN  
     1688      ENDIF 
     1689      IF( srcv(jpr_icb)%laction ) THEN   ! iceberg added to runoffs 
    17161690         fwficb(:,:) = frcv(jpr_icb)%z3(:,:,1) 
    1717          rnf(:,:)    = rnf(:,:) + fwficb(:,:)   ! iceberg added to runoffs 
    1718          CALL iom_put( 'iceberg_cea', frcv(jpr_icb)%z3(:,:,1) ) 
    1719       ENDIF 
    1720       IF( srcv(jpr_isf)%laction )  THEN 
    1721         fwfisf(:,:) = - frcv(jpr_isf)%z3(:,:,1)  ! fresh water flux from the isf (fwfisf <0 mean melting)   
    1722         CALL iom_put( 'iceshelf_cea', frcv(jpr_isf)%z3(:,:,1) ) 
    1723       ENDIF 
    1724  
     1691         rnf(:,:)    = rnf(:,:) + fwficb(:,:) 
     1692      ENDIF 
     1693      IF( srcv(jpr_isf)%laction ) THEN   ! iceshelf (fwfisf <0 mean melting) 
     1694        fwfisf(:,:) = - frcv(jpr_isf)%z3(:,:,1) 
     1695      ENDIF 
    17251696 
    17261697      IF( ln_mixcpl ) THEN 
     
    17361707      ENDIF 
    17371708 
    1738       IF( iom_use('subl_ai_cea') )  CALL iom_put( 'subl_ai_cea', frcv(jpr_ievp)%z3(:,:,1) * zicefr(:,:) )  ! Sublimation over sea-ice (cell average) 
    1739                                     CALL iom_put( 'snowpre'    , sprecip(:,:)               )   ! Snow 
    1740       IF( iom_use('snow_ao_cea') )  CALL iom_put( 'snow_ao_cea', sprecip(:,:) * p_frld(:,:) )   ! Snow over ice-free ocean  (cell average) 
    1741       IF( iom_use('snow_ai_cea') )  CALL iom_put( 'snow_ai_cea', sprecip(:,:) * zicefr(:,:) )   ! Snow over sea-ice         (cell average) 
    17421709#endif 
    1743  
     1710      ! outputs 
     1711!!      IF( srcv(jpr_rnf)%laction )   CALL iom_put( 'runoffs' , rnf(:,:) * tmask(:,:,1)                                 )  ! runoff 
     1712!!      IF( srcv(jpr_isf)%laction )   CALL iom_put( 'iceshelf_cea', -fwfisf(:,:) * tmask(:,:,1)                         )  ! iceshelf 
     1713      IF( srcv(jpr_cal)%laction )   CALL iom_put( 'calving_cea' , frcv(jpr_cal)%z3(:,:,1) * tmask(:,:,1)                )  ! calving 
     1714      IF( srcv(jpr_icb)%laction )   CALL iom_put( 'iceberg_cea' , frcv(jpr_icb)%z3(:,:,1) * tmask(:,:,1)                )  ! icebergs 
     1715      IF( iom_use('snowpre') )      CALL iom_put( 'snowpre'     , sprecip(:,:)                                          )  ! Snow 
     1716      IF( iom_use('precip') )       CALL iom_put( 'precip'      , tprecip(:,:)                                          )  ! total  precipitation 
     1717      IF( iom_use('rain') )         CALL iom_put( 'rain'        , tprecip(:,:) - sprecip(:,:)                           )  ! liquid precipitation  
     1718      IF( iom_use('snow_ao_cea') )  CALL iom_put( 'snow_ao_cea' , sprecip(:,:) * ( 1._wp - zsnw(:,:) )                  )  ! Snow over ice-free ocean  (cell average) 
     1719      IF( iom_use('snow_ai_cea') )  CALL iom_put( 'snow_ai_cea' , sprecip(:,:) *           zsnw(:,:)                    )  ! Snow over sea-ice         (cell average) 
     1720      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) 
     1721      IF( iom_use('evap_ao_cea') )  CALL iom_put( 'evap_ao_cea' , ( frcv(jpr_tevp)%z3(:,:,1)  & 
     1722         &                                                        - frcv(jpr_ievp)%z3(:,:,1) * zicefr(:,:) ) * tmask(:,:,1) )  ! ice-free oce evap (cell average) 
     1723      ! note: runoff output is done in sbcrnf (which includes icebergs too) and iceshelf output is done in sbcisf 
     1724      ! 
    17441725      !                                                      ! ========================= ! 
    17451726      SELECT CASE( TRIM( sn_rcv_qns%cldes ) )                !   non solar heat fluxes   !   (qns) 
     
    17771758            &                                           + pist(:,:,1) * zicefr(:,:) ) ) 
    17781759      END SELECT 
    1779 !!gm 
    1780 !!    currently it is taken into account in leads budget but not in the zqns_tot, and thus not in  
    1781 !!    the flux that enter the ocean.... 
    1782 !!    moreover 1 - it is not diagnose anywhere....  
    1783 !!             2 - it is unclear for me whether this heat lost is taken into account in the atmosphere or not... 
    1784 !! 
    1785 !! similar job should be done for snow and precipitation temperature 
    17861760      !                                      
    1787       IF( srcv(jpr_cal)%laction ) THEN   ! Iceberg melting  
    1788          zqns_tot(:,:) = zqns_tot(:,:) - frcv(jpr_cal)%z3(:,:,1) * lfus  ! add the latent heat of iceberg melting 
    1789                                                                          ! we suppose it melts at 0deg, though it should be temp. of surrounding ocean 
    1790          IF( iom_use('hflx_cal_cea') )   CALL iom_put( 'hflx_cal_cea', - frcv(jpr_cal)%z3(:,:,1) * lfus )   ! heat flux from calving 
    1791       ENDIF 
    1792  
    1793 !!chris      
    1794 !!    The heat content associated to the ice shelf in removed in the routine sbcisf.F90 
    1795       ! 
    1796       IF( srcv(jpr_icb)%laction )  zqns_tot(:,:) = zqns_tot(:,:) - frcv(jpr_icb)%z3(:,:,1) * lfus ! remove heat content associated to iceberg melting 
    1797  
     1761      ! --- calving (removed from qns_tot) --- ! 
     1762      IF( srcv(jpr_cal)%laction )   zqns_tot(:,:) = zqns_tot(:,:) - frcv(jpr_cal)%z3(:,:,1) * lfus  ! remove latent heat of calving 
     1763                                                                                                    ! we suppose it melts at 0deg, though it should be temp. of surrounding ocean 
     1764      ! --- iceberg (removed from qns_tot) --- ! 
     1765      IF( srcv(jpr_icb)%laction )   zqns_tot(:,:) = zqns_tot(:,:) - frcv(jpr_icb)%z3(:,:,1) * lfus  ! remove latent heat of iceberg melting 
    17981766 
    17991767#if defined key_lim3       
     
    18211789      zqemp_oce(:,:) = -  zevap_oce(:,:)                                      *   zcptn   (:,:)   &        ! evap 
    18221790         &             + ( ztprecip(:,:) - zsprecip(:,:) )                    *   zcptrain(:,:)   &        ! liquid precip 
    1823          &             +   zsprecip(:,:)                   * ( 1._wp - zsnw ) * zqprec_ice(:,:) * r1_rhosn ! solid precip over ocean + snow melting 
    1824       zqemp_ice(:,:) =     zsprecip(:,:)                   * zsnw             * zqprec_ice(:,:) * r1_rhosn ! solid precip over ice (qevap_ice=0 since atm. does not take it into account) 
     1791         &             +   zsprecip(:,:)                   * ( 1._wp - zsnw ) * ( zcptsnw (:,:) - lfus )  ! solid precip over ocean + snow melting 
     1792      zqemp_ice(:,:) =     zsprecip(:,:)                   * zsnw             * ( zcptsnw (:,:) - lfus )  ! solid precip over ice (qevap_ice=0 since atm. does not take it into account) 
    18251793!!    zqemp_ice(:,:) = -   frcv(jpr_ievp)%z3(:,:,1)        * zicefr(:,:)      *   zcptsnw (:,:)   &        ! ice evap 
    18261794!!       &             +   zsprecip(:,:)                   * zsnw             * zqprec_ice(:,:) * r1_rhosn ! solid precip over ice 
     
    18501818      ENDIF 
    18511819 
    1852       ! some more outputs 
    1853       IF( iom_use('hflx_snow_cea') )    CALL iom_put('hflx_snow_cea',   sprecip(:,:) * ( zcptn(:,:) - Lfus ) )                       ! heat flux from snow (cell average) 
    1854       IF( iom_use('hflx_rain_cea') )    CALL iom_put('hflx_rain_cea', ( tprecip(:,:) - sprecip(:,:) ) * zcptn(:,:) )                 ! heat flux from rain (cell average) 
    1855       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) 
    1856       IF( iom_use('hflx_snow_ai_cea') ) CALL iom_put('hflx_snow_ai_cea',sprecip(:,:) * ( zcptn(:,:) - Lfus ) * zsnw(:,:) )           ! heat flux from snow (cell average) 
    1857  
    18581820#else 
     1821      zcptsnw (:,:) = zcptn(:,:) 
     1822      zcptrain(:,:) = zcptn(:,:) 
     1823       
    18591824      ! clem: this formulation is certainly wrong... but better than it was... 
    1860       zqns_tot(:,:) = zqns_tot(:,:)                                 ! zqns_tot update over free ocean with: 
    1861          &          - ztmp(:,:)                           &            ! remove the latent heat flux of solid precip. melting 
    1862          &          - (  zemp_tot(:,:)                              ! remove the heat content of mass flux (assumed to be at SST) 
     1825      zqns_tot(:,:) = zqns_tot(:,:)                            &          ! zqns_tot update over free ocean with: 
     1826         &          - (  p_frld(:,:) * zsprecip(:,:) * lfus )  &          ! remove the latent heat flux of solid precip. melting 
     1827         &          - (  zemp_tot(:,:)                         &          ! remove the heat content of mass flux (assumed to be at SST) 
    18631828         &             - zemp_ice(:,:) ) * zcptn(:,:)  
    18641829 
     
    18731838         qns_ice(:,:,:) = zqns_ice(:,:,:) 
    18741839      ENDIF 
     1840 
    18751841#endif 
    1876  
     1842      ! outputs 
     1843      IF( srcv(jpr_cal)%laction )    CALL iom_put('hflx_cal_cea' ,   & 
     1844                                             &   - frcv(jpr_cal)%z3(:,:,1) * lfus) ! latent heat from calving 
     1845      IF( srcv(jpr_icb)%laction )    CALL iom_put('hflx_icb_cea' , - frcv(jpr_icb)%z3(:,:,1) * lfus) ! latent heat from icebergs melting 
     1846      IF( iom_use('hflx_snow_cea') ) CALL iom_put('hflx_snow_cea',  sprecip(:,:) * ( zcptsnw(:,:) - Lfus )) ! heat flux from snow (cell average) 
     1847      IF( iom_use('hflx_rain_cea') ) CALL iom_put('hflx_rain_cea',( tprecip(:,:) - sprecip(:,:) ) * zcptrain(:,:)) ! heat flux from rain (cell average) 
     1848      IF( iom_use('hflx_evap_cea') ) CALL iom_put('hflx_evap_cea',(frcv(jpr_tevp)%z3(:,:,1)   & 
     1849                                             &    - frcv(jpr_ievp)%z3(:,:,1) * zicefr(:,:) & ! heat flux from from evap (cell average) 
     1850         &                                                        ) * zcptn(:,:) * tmask(:,:,1) ) 
     1851      IF( iom_use('hflx_snow_ao_cea') ) CALL iom_put('hflx_snow_ao_cea',sprecip(:,:)   & 
     1852                                             & * (zcptsnw(:,:) - Lfus) * (1._wp - zsnw(:,:))   ) ! heat flux from snow (over ocean) 
     1853      IF( iom_use('hflx_snow_ai_cea') ) CALL iom_put('hflx_snow_ai_cea',sprecip(:,:) * (zcptsnw(:,:) - Lfus)   & 
     1854                                             & *          zsnw(:,:)    ) ! heat flux from snow (over ice) 
     1855      ! note: hflx for runoff and iceshelf are done in sbcrnf and sbcisf resp. 
     1856      ! 
    18771857      !                                                      ! ========================= ! 
    18781858      SELECT CASE( TRIM( sn_rcv_qsr%cldes ) )                !      solar heat fluxes    !   (qsr) 
     
    19801960      fr2_i0(:,:) = ( 0.82 * ( 1.0 - cldf_ice ) + 0.65 * cldf_ice ) 
    19811961 
    1982       CALL wrk_dealloc( jpi,jpj,     zcptn, ztmp, zcptrain, zcptsnw, zicefr, zmsk, zsnw ) 
     1962      CALL wrk_dealloc( jpi,jpj,     zcptn, zcptrain, zcptsnw, zicefr, zmsk, zsnw ) 
    19831963      CALL wrk_dealloc( jpi,jpj,     zemp_tot, zemp_ice, zemp_oce, ztprecip, zsprecip, zevap_oce, zevap_ice, zdevap_ice ) 
    19841964      CALL wrk_dealloc( jpi,jpj,     zqns_tot, zqns_oce, zqsr_tot, zqsr_oce, zqprec_ice, zqemp_oce, zqemp_ice ) 
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/NEMO/OPA_SRC/SBC/sbcisf.F90

    r7816 r8841  
    168168 
    169169         ! output 
    170          CALL iom_put('qlatisf' , qisf) 
    171          CALL iom_put('fwfisf'  , fwfisf) 
     170         IF( iom_use('iceshelf_cea') )   CALL iom_put( 'iceshelf_cea', -fwfisf(:,:)                      )   ! isf mass flux 
     171         IF( iom_use('hflx_isf_cea') )   CALL iom_put( 'hflx_isf_cea', risf_tsc(:,:,jp_tem) * rau0 * rcp )   ! isf sensible+latent heat (W/m2) 
     172         IF( iom_use('qlatisf' ) )       CALL iom_put( 'qlatisf'     , qisf(:,:)                         )   ! isf latent heat 
     173         IF( iom_use('fwfisf'  ) )       CALL iom_put( 'fwfisf'      , fwfisf(:,:)                       )   ! isf mass flux (opposite sign) 
    172174 
    173175        ! Diagnostics 
     
    190192                     zqlatisf3d(ji,jj,jk) = zqlatisf3d(ji,jj,jk) + qisf     (ji,jj) * r1_hisf_tbl(ji,jj) * e3t_n(ji,jj,jk) 
    191193                  END DO 
    192                   zfwfisf3d (ji,jj,jk) = zfwfisf3d (ji,jj,jk) + fwfisf   (ji,jj) * r1_hisf_tbl(ji,jj) * ralpha(ji,jj) * e3t_n(ji,jj,jk) 
    193                   zqhcisf3d (ji,jj,jk) = zqhcisf3d (ji,jj,jk) + zqhcisf2d(ji,jj) * r1_hisf_tbl(ji,jj) * ralpha(ji,jj) * e3t_n(ji,jj,jk) 
    194                   zqlatisf3d(ji,jj,jk) = zqlatisf3d(ji,jj,jk) + qisf     (ji,jj) * r1_hisf_tbl(ji,jj) * ralpha(ji,jj) * e3t_n(ji,jj,jk) 
     194                  zfwfisf3d (ji,jj,jk) = zfwfisf3d (ji,jj,jk) + fwfisf   (ji,jj) * r1_hisf_tbl(ji,jj)   &  
     195                     &                                                                   * ralpha(ji,jj) * e3t_n(ji,jj,jk) 
     196                  zqhcisf3d (ji,jj,jk) = zqhcisf3d (ji,jj,jk) + zqhcisf2d(ji,jj) * r1_hisf_tbl(ji,jj)   &  
     197                     &                                                                   * ralpha(ji,jj) * e3t_n(ji,jj,jk) 
     198                  zqlatisf3d(ji,jj,jk) = zqlatisf3d(ji,jj,jk) + qisf     (ji,jj) * r1_hisf_tbl(ji,jj)   &   
     199                     &                                                                   * ralpha(ji,jj) * e3t_n(ji,jj,jk) 
    195200               END DO 
    196201            END DO 
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/NEMO/OPA_SRC/SBC/sbcmod.F90

    r7822 r8841  
    4141   USE sbcssr         ! surface boundary condition: sea surface restoring 
    4242   USE sbcrnf         ! surface boundary condition: runoffs 
     43   USE sbcapr         ! surface boundary condition: atmo pressure  
    4344   USE sbcisf         ! surface boundary condition: ice shelf 
    4445   USE sbcfwb         ! surface boundary condition: freshwater budget 
     
    332333                          CALL sbc_rnf_init            ! Runof initialization 
    333334      ! 
     335      IF( ln_apr_dyn )    CALL sbc_apr_init            ! Atmo Pressure Forcing initialization 
     336      ! 
    334337      IF( nn_ice == 3 )   CALL sbc_lim_init            ! LIM3 initialization 
    335338      ! 
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/NEMO/OPA_SRC/SBC/sbcrnf.F90

    r7753 r8841  
    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      ! 
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/NEMO/OPA_SRC/SBC/sbcwave.F90

    r7646 r8841  
    132132               zda_v = EXP( -2.0_wp*zkh_v ) / ( 1.0_wp + 8.0_wp*zkh_v ) 
    133133               ! 
    134                usd(ji,jj,jk) = zda_u * zk_u(ji,jj) * umask(ji,jj,jk) 
    135                vsd(ji,jj,jk) = zda_v * zk_v(ji,jj) * vmask(ji,jj,jk) 
     134               usd(ji,jj,jk) = zda_u * zu0_sd(ji,jj) * umask(ji,jj,jk) 
     135               vsd(ji,jj,jk) = zda_v * zv0_sd(ji,jj) * vmask(ji,jj,jk) 
    136136            END DO 
    137137         END DO 
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/NEMO/OPA_SRC/TRA/trabbl.F90

    r7753 r8841  
    545545      CALL wrk_dealloc( jpi, jpj, zmbk ) 
    546546 
    547       !                                 !* sign of grad(H) at u- and v-points 
    548       mgrhu(jpi,:) = 0   ;   mgrhu(:,jpj) = 0   ;   mgrhv(jpi,:) = 0   ;   mgrhv(:,jpj) = 0 
     547                                        !* sign of grad(H) at u- and v-points; zero if grad(H) = 0 
     548      mgrhu(:,:) = 0   ;   mgrhv(:,:) = 0 
    549549      DO jj = 1, jpjm1 
    550550         DO ji = 1, jpim1 
    551             mgrhu(ji,jj) = INT(  SIGN( 1.e0, gdept_0(ji+1,jj,mbkt(ji+1,jj)) - gdept_0(ji,jj,mbkt(ji,jj)) )  ) 
    552             mgrhv(ji,jj) = INT(  SIGN( 1.e0, gdept_0(ji,jj+1,mbkt(ji,jj+1)) - gdept_0(ji,jj,mbkt(ji,jj)) )  ) 
     551            IF( gdept_0(ji+1,jj,mbkt(ji+1,jj)) - gdept_0(ji,jj,mbkt(ji,jj)) /= 0._wp ) THEN 
     552               mgrhu(ji,jj) = INT(  SIGN( 1.e0, gdept_0(ji+1,jj,mbkt(ji+1,jj)) - gdept_0(ji,jj,mbkt(ji,jj)) )  ) 
     553            ENDIF 
     554            ! 
     555            IF( gdept_0(ji,jj+1,mbkt(ji,jj+1)) - gdept_0(ji,jj,mbkt(ji,jj)) /= 0._wp ) THEN 
     556               mgrhv(ji,jj) = INT(  SIGN( 1.e0, gdept_0(ji,jj+1,mbkt(ji,jj+1)) - gdept_0(ji,jj,mbkt(ji,jj)) )  ) 
     557            ENDIF 
    553558         END DO 
    554559      END DO 
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/NEMO/OPA_SRC/TRA/tranxt.F90

    r7753 r8841  
    121121      IF( l_trdtra )   THEN                     
    122122         CALL wrk_alloc( jpi, jpj, jpk, ztrdt, ztrds ) 
    123          ztrdt(:,:,jk) = 0._wp 
    124          ztrds(:,:,jk) = 0._wp 
     123         ztrdt(:,:,jpk) = 0._wp 
     124         ztrds(:,:,jpk) = 0._wp 
    125125         IF( ln_traldf_iso ) THEN              ! diagnose the "pure" Kz diffusive trend  
    126126            CALL trd_tra( kt, 'TRA', jp_tem, jptra_zdfp, ztrdt ) 
     
    128128         ENDIF 
    129129         ! total trend for the non-time-filtered variables.  
    130             zfact = 1.0 / rdt 
     130         zfact = 1.0 / rdt 
     131         ! G Nurser 23 Mar 2017. Recalculate trend as Delta(e3t*T)/e3tn; e3tn cancel from tsn terms 
    131132         DO jk = 1, jpkm1 
    132             ztrdt(:,:,jk) = ( tsa(:,:,jk,jp_tem) - tsn(:,:,jk,jp_tem) ) * zfact  
    133             ztrds(:,:,jk) = ( tsa(:,:,jk,jp_sal) - tsn(:,:,jk,jp_sal) ) * zfact  
     133            ztrdt(:,:,jk) = ( tsa(:,:,jk,jp_tem)*e3t_a(:,:,jk) / e3t_n(:,:,jk) - tsn(:,:,jk,jp_tem)) * zfact 
     134            ztrds(:,:,jk) = ( tsa(:,:,jk,jp_sal)*e3t_a(:,:,jk) / e3t_n(:,:,jk) - tsn(:,:,jk,jp_sal)) * zfact 
    134135         END DO 
    135136         CALL trd_tra( kt, 'TRA', jp_tem, jptra_tot, ztrdt ) 
    136137         CALL trd_tra( kt, 'TRA', jp_sal, jptra_tot, ztrds ) 
    137          ! Store now fields before applying the Asselin filter  
    138          ! in order to calculate Asselin filter trend later. 
    139          ztrdt(:,:,:) = tsn(:,:,:,jp_tem)  
    140          ztrds(:,:,:) = tsn(:,:,:,jp_sal) 
     138         IF( ln_linssh ) THEN  
     139            ! Store now fields before applying the Asselin filter  
     140            ! in order to calculate Asselin filter trend later. 
     141            ztrdt(:,:,:) = tsn(:,:,:,jp_tem)  
     142            ztrds(:,:,:) = tsn(:,:,:,jp_sal) 
     143         ENDIF 
    141144      ENDIF 
    142145 
     
    147150            END DO 
    148151         END DO 
     152         IF (l_trdtra .AND. .NOT. ln_linssh) THEN  ! Zero Asselin filter contribution must be explicitly written out since for vvl 
     153                                                   ! Asselin filter is output by tra_nxt_vvl that is not called on this time step 
     154            ztrdt(:,:,:) = 0._wp 
     155            ztrds(:,:,:) = 0._wp 
     156            CALL trd_tra( kt, 'TRA', jp_tem, jptra_atf, ztrdt ) 
     157            CALL trd_tra( kt, 'TRA', jp_sal, jptra_atf, ztrds ) 
     158         END IF 
    149159         ! 
    150160      ELSE                                            ! Leap-Frog + Asselin filter time stepping 
     
    162172      ENDIF      
    163173      ! 
    164       IF( l_trdtra ) THEN      ! trend of the Asselin filter (tb filtered - tb)/dt      
     174      IF( l_trdtra .AND. ln_linssh ) THEN      ! trend of the Asselin filter (tb filtered - tb)/dt      
     175         zfact = 1._wp / r2dt              
    165176         DO jk = 1, jpkm1 
    166             zfact = 1._wp / r2dt              
    167177            ztrdt(:,:,jk) = ( tsb(:,:,jk,jp_tem) - ztrdt(:,:,jk) ) * zfact 
    168178            ztrds(:,:,jk) = ( tsb(:,:,jk,jp_sal) - ztrds(:,:,jk) ) * zfact 
     
    170180         CALL trd_tra( kt, 'TRA', jp_tem, jptra_atf, ztrdt ) 
    171181         CALL trd_tra( kt, 'TRA', jp_sal, jptra_atf, ztrds ) 
    172          CALL wrk_dealloc( jpi, jpj, jpk, ztrdt, ztrds ) 
    173182      END IF 
     183      IF( l_trdtra ) CALL wrk_dealloc( jpi, jpj, jpk, ztrdt, ztrds ) 
    174184      ! 
    175185      !                        ! control print 
     
    259269      LOGICAL  ::   ll_traqsr, ll_rnf, ll_isf   ! local logical 
    260270      INTEGER  ::   ji, jj, jk, jn              ! dummy loop indices 
    261       REAL(wp) ::   zfact1, ztc_a , ztc_n , ztc_b , ztc_f , ztc_d    ! local scalar 
     271      REAL(wp) ::   zfact, zfact1, ztc_a , ztc_n , ztc_b , ztc_f , ztc_d    ! local scalar 
    262272      REAL(wp) ::   zfact2, ze3t_b, ze3t_n, ze3t_a, ze3t_f, ze3t_d   !   -      - 
     273      REAL(wp), POINTER, DIMENSION(:,:,:,:) :: ztrd_atf 
    263274      !!---------------------------------------------------------------------- 
    264275      ! 
     
    279290      ENDIF 
    280291      ! 
     292      IF( ( l_trdtra .and. cdtype == 'TRA' ) .OR. ( l_trdtrc .and. cdtype == 'TRC' ) )   THEN 
     293         CALL wrk_alloc( jpi, jpj, jpk, kjpt, ztrd_atf ) 
     294         ztrd_atf(:,:,:,:) = 0.0_wp 
     295      ENDIF 
     296      zfact = 1._wp / r2dt 
    281297      DO jn = 1, kjpt       
    282298         DO jk = 1, jpkm1 
     
    331347                  ptn(ji,jj,jk,jn) = pta(ji,jj,jk,jn)     ! ptn <-- pta 
    332348                  ! 
     349                  IF( ( l_trdtra .and. cdtype == 'TRA' ) .OR. ( l_trdtrc .and. cdtype == 'TRC' ) ) THEN 
     350                     ztrd_atf(ji,jj,jk,jn) = (ztc_f - ztc_n) * zfact/ze3t_n 
     351                  ENDIF 
     352                  ! 
    333353               END DO 
    334354            END DO 
     
    337357      END DO 
    338358      ! 
     359      IF( l_trdtra .and. cdtype == 'TRA' ) THEN  
     360         CALL trd_tra( kt, cdtype, jp_tem, jptra_atf, ztrd_atf(:,:,:,jp_tem) ) 
     361         CALL trd_tra( kt, cdtype, jp_sal, jptra_atf, ztrd_atf(:,:,:,jp_sal) ) 
     362         CALL wrk_dealloc( jpi, jpj, jpk, kjpt, ztrd_atf ) 
     363      ENDIF 
     364      IF( l_trdtrc .and. cdtype == 'TRC' ) THEN 
     365         DO jn = 1, kjpt 
     366            CALL trd_tra( kt, cdtype, jn, jptra_atf, ztrd_atf(:,:,:,jn) ) 
     367         END DO 
     368         CALL wrk_dealloc( jpi, jpj, jpk, kjpt, ztrd_atf ) 
     369      ENDIF 
     370      ! 
    339371   END SUBROUTINE tra_nxt_vvl 
    340372 
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/NEMO/OPA_SRC/TRA/trazdf.F90

    r7753 r8841  
    8989      IF( l_trdtra )   THEN                      ! save the vertical diffusive trends for further diagnostics 
    9090         DO jk = 1, jpkm1 
    91             ztrdt(:,:,jk) = ( ( tsa(:,:,jk,jp_tem) - tsb(:,:,jk,jp_tem) ) / r2dt ) - ztrdt(:,:,jk) 
    92             ztrds(:,:,jk) = ( ( tsa(:,:,jk,jp_sal) - tsb(:,:,jk,jp_sal) ) / r2dt ) - ztrds(:,:,jk) 
     91            ztrdt(:,:,jk) = ( ( tsa(:,:,jk,jp_tem)*e3t_a(:,:,jk) - tsb(:,:,jk,jp_tem)*e3t_b(:,:,jk) ) & 
     92                 & / (e3t_n(:,:,jk)*r2dt) ) - ztrdt(:,:,jk) 
     93            ztrds(:,:,jk) = ( ( tsa(:,:,jk,jp_sal)*e3t_a(:,:,jk) - tsb(:,:,jk,jp_sal)*e3t_b(:,:,jk) ) & 
     94                 & / (e3t_n(:,:,jk)*r2dt) ) - ztrds(:,:,jk) 
    9395         END DO 
    9496!!gm this should be moved in trdtra.F90 and done on all trends 
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/NEMO/OPA_SRC/TRD/trdtra.F90

    r7646 r8841  
    104104                                 ztrds(:,:,:) = 0._wp 
    105105                                 CALL trd_tra_mng( trdt, ztrds, ktrd, kt ) 
     106         CASE( jptra_evd )   ;   avt_evd(:,:,:) = ptrd(:,:,:) * tmask(:,:,:) 
    106107         CASE DEFAULT                 ! other trends: masked trends 
    107108            trdt(:,:,:) = ptrd(:,:,:) * tmask(:,:,:)              ! mask & store 
     
    311312!!gm Rq: mask the trends already masked in trd_tra, but lbc_lnk should probably be added 
    312313      ! 
     314      ! 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 
    313315      SELECT CASE( ktrd ) 
    314       CASE( jptra_xad  )   ;   CALL iom_put( "ttrd_xad" , ptrdx )        ! x- horizontal advection 
    315                                CALL iom_put( "strd_xad" , ptrdy ) 
    316       CASE( jptra_yad  )   ;   CALL iom_put( "ttrd_yad" , ptrdx )        ! y- horizontal advection 
    317                                CALL iom_put( "strd_yad" , ptrdy ) 
    318       CASE( jptra_zad  )   ;   CALL iom_put( "ttrd_zad" , ptrdx )        ! z- vertical   advection 
    319                                CALL iom_put( "strd_zad" , ptrdy ) 
    320                                IF( ln_linssh ) THEN                   ! cst volume : adv flux through z=0 surface 
    321                                   CALL wrk_alloc( jpi, jpj, z2dx, z2dy ) 
    322                                   z2dx(:,:) = wn(:,:,1) * tsn(:,:,1,jp_tem) / e3t_n(:,:,1) 
    323                                   z2dy(:,:) = wn(:,:,1) * tsn(:,:,1,jp_sal) / e3t_n(:,:,1) 
    324                                   CALL iom_put( "ttrd_sad", z2dx ) 
    325                                   CALL iom_put( "strd_sad", z2dy ) 
    326                                   CALL wrk_dealloc( jpi, jpj, z2dx, z2dy ) 
    327                                ENDIF 
    328       CASE( jptra_totad  ) ;   CALL iom_put( "ttrd_totad" , ptrdx )      ! total   advection 
    329                                CALL iom_put( "strd_totad" , ptrdy ) 
    330       CASE( jptra_ldf  )   ;   CALL iom_put( "ttrd_ldf" , ptrdx )        ! lateral diffusion 
    331                                CALL iom_put( "strd_ldf" , ptrdy ) 
    332       CASE( jptra_zdf  )   ;   CALL iom_put( "ttrd_zdf" , ptrdx )        ! vertical diffusion (including Kz contribution) 
    333                                CALL iom_put( "strd_zdf" , ptrdy ) 
    334       CASE( jptra_zdfp )   ;   CALL iom_put( "ttrd_zdfp", ptrdx )        ! PURE vertical diffusion (no isoneutral contribution) 
    335                                CALL iom_put( "strd_zdfp", ptrdy ) 
    336       CASE( jptra_evd )    ;   CALL iom_put( "ttrd_evd", ptrdx )         ! EVD trend (convection) 
    337                                CALL iom_put( "strd_evd", ptrdy ) 
    338       CASE( jptra_dmp  )   ;   CALL iom_put( "ttrd_dmp" , ptrdx )        ! internal restoring (damping) 
    339                                CALL iom_put( "strd_dmp" , ptrdy ) 
    340       CASE( jptra_bbl  )   ;   CALL iom_put( "ttrd_bbl" , ptrdx )        ! bottom boundary layer 
    341                                CALL iom_put( "strd_bbl" , ptrdy ) 
    342       CASE( jptra_npc  )   ;   CALL iom_put( "ttrd_npc" , ptrdx )        ! static instability mixing 
    343                                CALL iom_put( "strd_npc" , ptrdy ) 
    344       CASE( jptra_nsr  )   ;   CALL iom_put( "ttrd_qns" , ptrdx(:,:,1) )        ! surface forcing + runoff (ln_rnf=T) 
    345                                CALL iom_put( "strd_cdt" , ptrdy(:,:,1) )        ! output as 2D surface fields 
    346       CASE( jptra_qsr  )   ;   CALL iom_put( "ttrd_qsr" , ptrdx )        ! penetrative solar radiat. (only on temperature) 
    347       CASE( jptra_bbc  )   ;   CALL iom_put( "ttrd_bbc" , ptrdx )        ! geothermal heating   (only on temperature) 
    348       CASE( jptra_atf  )   ;   CALL iom_put( "ttrd_atf" , ptrdx )        ! asselin time Filter 
    349                                CALL iom_put( "strd_atf" , ptrdy ) 
    350       CASE( jptra_tot  )   ;   CALL iom_put( "ttrd_tot" , ptrdx )        ! model total trend 
    351                                CALL iom_put( "strd_tot" , ptrdy ) 
     316      ! This total trend is done every time step 
     317      CASE( jptra_tot  )   ;   CALL iom_put( "ttrd_tot" , ptrdx )           ! model total trend 
     318         CALL iom_put( "strd_tot" , ptrdy ) 
    352319      END SELECT 
     320 
     321      ! These trends are done every second time step. When 1ts output is selected must go different (2ts) file from standard T-file 
     322      IF( MOD( kt, 2 ) == 0 ) THEN 
     323         SELECT CASE( ktrd ) 
     324         CASE( jptra_xad  )   ;   CALL iom_put( "ttrd_xad" , ptrdx )        ! x- horizontal advection 
     325            CALL iom_put( "strd_xad" , ptrdy ) 
     326         CASE( jptra_yad  )   ;   CALL iom_put( "ttrd_yad" , ptrdx )        ! y- horizontal advection 
     327            CALL iom_put( "strd_yad" , ptrdy ) 
     328         CASE( jptra_zad  )   ;   CALL iom_put( "ttrd_zad" , ptrdx )        ! z- vertical   advection 
     329            CALL iom_put( "strd_zad" , ptrdy ) 
     330            IF( ln_linssh ) THEN                   ! cst volume : adv flux through z=0 surface 
     331               CALL wrk_alloc( jpi, jpj, z2dx, z2dy ) 
     332               z2dx(:,:) = wn(:,:,1) * tsn(:,:,1,jp_tem) / e3t_n(:,:,1) 
     333               z2dy(:,:) = wn(:,:,1) * tsn(:,:,1,jp_sal) / e3t_n(:,:,1) 
     334               CALL iom_put( "ttrd_sad", z2dx ) 
     335               CALL iom_put( "strd_sad", z2dy ) 
     336               CALL wrk_dealloc( jpi, jpj, z2dx, z2dy ) 
     337            ENDIF 
     338         CASE( jptra_totad  ) ;   CALL iom_put( "ttrd_totad" , ptrdx )      ! total   advection 
     339            CALL iom_put( "strd_totad" , ptrdy ) 
     340         CASE( jptra_ldf  )   ;   CALL iom_put( "ttrd_ldf" , ptrdx )        ! lateral diffusion 
     341            CALL iom_put( "strd_ldf" , ptrdy ) 
     342         CASE( jptra_zdf  )   ;   CALL iom_put( "ttrd_zdf" , ptrdx )        ! vertical diffusion (including Kz contribution) 
     343            CALL iom_put( "strd_zdf" , ptrdy ) 
     344         CASE( jptra_zdfp )   ;   CALL iom_put( "ttrd_zdfp", ptrdx )        ! PURE vertical diffusion (no isoneutral contribution) 
     345            CALL iom_put( "strd_zdfp", ptrdy ) 
     346         CASE( jptra_evd )    ;   CALL iom_put( "ttrd_evd", ptrdx )         ! EVD trend (convection) 
     347            CALL iom_put( "strd_evd", ptrdy ) 
     348         CASE( jptra_dmp  )   ;   CALL iom_put( "ttrd_dmp" , ptrdx )        ! internal restoring (damping) 
     349            CALL iom_put( "strd_dmp" , ptrdy ) 
     350         CASE( jptra_bbl  )   ;   CALL iom_put( "ttrd_bbl" , ptrdx )        ! bottom boundary layer 
     351            CALL iom_put( "strd_bbl" , ptrdy ) 
     352         CASE( jptra_npc  )   ;   CALL iom_put( "ttrd_npc" , ptrdx )        ! static instability mixing 
     353            CALL iom_put( "strd_npc" , ptrdy ) 
     354         CASE( jptra_bbc  )   ;   CALL iom_put( "ttrd_bbc" , ptrdx )        ! geothermal heating   (only on temperature) 
     355         CASE( jptra_nsr  )   ;   CALL iom_put( "ttrd_qns" , ptrdx(:,:,1) ) ! surface forcing + runoff (ln_rnf=T) 
     356            CALL iom_put( "strd_cdt" , ptrdy(:,:,1) )        ! output as 2D surface fields 
     357         CASE( jptra_qsr  )   ;   CALL iom_put( "ttrd_qsr" , ptrdx )        ! penetrative solar radiat. (only on temperature) 
     358         END SELECT 
     359         ! the Asselin filter trend  is also every other time step but needs to be lagged one time step 
     360         ! Even when 1ts output is selected can go to the same (2ts) file as the trends plotted every even time step. 
     361      ELSE IF( MOD( kt, 2 ) == 1 ) THEN 
     362         SELECT CASE( ktrd ) 
     363         CASE( jptra_atf  )   ;   CALL iom_put( "ttrd_atf" , ptrdx )        ! asselin time Filter 
     364            CALL iom_put( "strd_atf" , ptrdy ) 
     365         END SELECT 
     366      END IF 
    353367      ! 
    354368   END SUBROUTINE trd_tra_iom 
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfbfr.F90

    r7753 r8841  
    384384            END IF 
    385385         ENDIF 
     386         ! 
     387         bfrua(:,:) = - bfrcoef2d(:,:) 
     388         bfrva(:,:) = - bfrcoef2d(:,:) 
     389         ! 
    386390         ! 
    387391      CASE DEFAULT 
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfddm_substitute.h90

    r4152 r8841  
    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) 
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfric.F90

    r7646 r8841  
    183183            zrhos          = rhop(ji,jj,1) + zflageos * ( 1. - tmask(ji,jj,1) ) 
    184184            zustar         = SQRT( taum(ji,jj) / ( zrhos +  rsmall ) ) 
    185             ekm_dep(ji,jj) = rn_ekmfc * zustar / ( ABS( ff(ji,jj) ) + rsmall ) 
     185            ekm_dep(ji,jj) = rn_ekmfc * zustar / ( ABS( ff_t(ji,jj) ) + rsmall ) 
    186186            ekm_dep(ji,jj) = MAX(ekm_dep(ji,jj),rn_mldmin) ! Minimun allowed 
    187187            ekm_dep(ji,jj) = MIN(ekm_dep(ji,jj),rn_mldmax) ! Maximum allowed 
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/NEMO/OPA_SRC/ZDF/zdftmx.F90

    r7779 r8841  
    225225 
    226226      !                             ! compute the form function using N2 at each time step 
     227      zdn2dz     (:,:,jpk) = 0.e0 
    227228      zempba_3d_1(:,:,jpk) = 0.e0 
    228229      zempba_3d_2(:,:,jpk) = 0.e0 
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/NEMO/OPA_SRC/nemogcm.F90

    r7761 r8841  
    206206      ! 
    207207#if defined key_agrif 
    208       IF( .NOT. Agrif_Root() ) THEN 
    209                          CALL Agrif_ParentGrid_To_ChildGrid() 
    210          IF( ln_diaobs ) CALL dia_obs_wri 
    211          IF( nn_timing == 1 )   CALL timing_finalize 
    212                                 CALL Agrif_ChildGrid_To_ParentGrid() 
    213       ENDIF 
     208      CALL Agrif_ParentGrid_To_ChildGrid() 
     209      IF( ln_diaobs ) CALL dia_obs_wri 
     210      IF( nn_timing == 1 )   CALL timing_finalize 
     211      CALL Agrif_ChildGrid_To_ParentGrid() 
    214212#endif 
    215213      IF( nn_timing == 1 )   CALL timing_finalize 
     
    452450      !                                      ! external forcing  
    453451!!gm to be added : creation and call of sbc_apr_init 
     452!==> cbr: sbc_apr_init in sbcmod as sbc_rnf_init 
    454453                            CALL    tide_init   ! tidal harmonics 
    455454                            CALL     sbc_init   ! surface boundary conditions (including sea-ice) 
     
    751750      ! 
    752751      ! Find the factors of n. 
    753       IF( kn == 1 )   GOTO 20 
    754  
    755       ! nu holds the unfactorised part of the number. 
    756       ! knfax holds the number of factors found. 
    757       ! l points to the allowed factor list. 
    758       ! ifac holds the current factor. 
    759       ! 
    760       inu   = kn 
    761       knfax = 0 
    762       ! 
    763       DO jl = ntest, 1, -1 
     752      IF( kn .NE. 1 ) THEN 
     753 
     754         ! nu holds the unfactorised part of the number. 
     755         ! knfax holds the number of factors found. 
     756         ! l points to the allowed factor list. 
     757         ! ifac holds the current factor. 
    764758         ! 
    765          ifac = ilfax(jl) 
    766          IF( ifac > inu )   CYCLE 
    767  
    768          ! Test whether the factor will divide. 
    769  
    770          IF( MOD(inu,ifac) == 0 ) THEN 
     759         inu   = kn 
     760         knfax = 0 
     761         ! 
     762         DO jl = ntest, 1, -1 
    771763            ! 
    772             knfax = knfax + 1            ! Add the factor to the list 
    773             IF( knfax > kmaxfax ) THEN 
    774                kerr = 6 
    775                write (*,*) 'FACTOR: insufficient space in factor array ', knfax 
    776                return 
     764            ifac = ilfax(jl) 
     765            IF( ifac > inu )   CYCLE 
     766    
     767            ! Test whether the factor will divide. 
     768    
     769            IF( MOD(inu,ifac) == 0 ) THEN 
     770               ! 
     771               knfax = knfax + 1            ! Add the factor to the list 
     772               IF( knfax > kmaxfax ) THEN 
     773                  kerr = 6 
     774                  write (*,*) 'FACTOR: insufficient space in factor array ', knfax 
     775                  return 
     776               ENDIF 
     777               kfax(knfax) = ifac 
     778               ! Store the other factor that goes with this one 
     779               knfax = knfax + 1 
     780               kfax(knfax) = inu / ifac 
     781               !WRITE (*,*) 'ARPDBG, factors ',knfax-1,' & ',knfax,' are ', kfax(knfax-1),' and ',kfax(knfax) 
    777782            ENDIF 
    778             kfax(knfax) = ifac 
    779             ! Store the other factor that goes with this one 
    780             knfax = knfax + 1 
    781             kfax(knfax) = inu / ifac 
    782             !WRITE (*,*) 'ARPDBG, factors ',knfax-1,' & ',knfax,' are ', kfax(knfax-1),' and ',kfax(knfax) 
    783          ENDIF 
     783            ! 
     784         END DO 
    784785         ! 
    785       END DO 
    786       ! 
    787    20 CONTINUE      ! Label 20 is the exit point from the factor search loop. 
     786      ENDIF 
    788787      ! 
    789788   END SUBROUTINE factorise 
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/NEMO/OPA_SRC/stpctl.F90

    r6140 r8841  
    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 
    2425   IMPLICIT NONE 
     
    5152      INTEGER  ::   ji, jj, jk             ! dummy loop indices 
    5253      INTEGER  ::   ii, ij, ik             ! local integers 
    53       REAL(wp) ::   zumax, zsmin, zssh2    ! local scalars 
     54      REAL(wp) ::   zumax, zsmin, zssh2, zsshmax    ! local scalars 
    5455      INTEGER, DIMENSION(3) ::   ilocu     !  
    5556      INTEGER, DIMENSION(2) ::   ilocs     !  
     
    146147      ENDIF 
    147148      ! 
    148       zssh2 = SUM( sshn(:,:) * sshn(:,:) * tmask_i(:,:) ) 
    149       IF( lk_mpp )   CALL mpp_sum( zssh2 )      ! sum over the global domain 
     149      zsshmax = 0.e0 
     150      DO jj = 1, jpj 
     151         DO ji = 1, jpi 
     152            IF( tmask(ji,jj,1) == 1) zsshmax = MAX( zsshmax, ABS(sshn(ji,jj)) ) 
     153         END DO 
     154      END DO 
     155      IF( lk_mpp )   CALL mpp_max( zsshmax )                ! min over the global domain 
    150156      ! 
    151       IF(lwp) WRITE(numsol,9300) kt, zssh2, zumax, zsmin      ! ssh statistics 
     157      IF( MOD( kt, nwrite ) == 1 .AND. lwp )   WRITE(numout,*) ' ==>> time-step= ',kt,' ssh max:', zsshmax 
    152158      ! 
    153 9200  FORMAT('it:', i8, ' iter:', i4, ' r: ',e16.10, ' b: ',e16.10 ) 
    154 9300  FORMAT(' it :', i8, ' ssh2: ', e16.10, ' Umax: ',e16.10,' Smin: ',e16.10) 
     159      IF( zsshmax > 10.e0 ) THEN  
     160         IF (lk_mpp) THEN 
     161            CALL mpp_maxloc( ABS(sshn(:,:)),tmask(:,:,1),zsshmax,ii,ij) 
     162         ELSE 
     163            ilocs = MAXLOC( ABS(sshn(:,:)) ) 
     164            ii = ilocs(1) + nimpp - 1 
     165            ij = ilocs(2) + njmpp - 1 
     166         ENDIF 
     167         ! 
     168         IF(lwp) THEN 
     169            WRITE(numout,cform_err) 
     170            WRITE(numout,*) 'stp_ctl : the ssh is larger than 10m' 
     171            WRITE(numout,*) '======= ' 
     172            WRITE(numout,9600) kt, zsshmax, ii, ij 
     173            WRITE(numout,*) 
     174            WRITE(numout,*) '          output of last fields in numwso' 
     175         ENDIF 
     176         kindic = -3 
     177      ENDIF 
     1789600  FORMAT (' kt=',i6,' max ssh: ',1pg11.4,', i j: ',2i5) 
     179      ! 
     180      zssh2 = glob_sum( sshn(:,:) * sshn(:,:) ) 
     181      ! 
     182      IF(lwp) WRITE(numsol,9700) kt, zssh2, zumax, zsmin      ! ssh statistics 
     183      ! 
     1849700  FORMAT(' it :', i8, ' ssh2: ', d23.16, ' Umax: ',d23.16,' Smin: ',d23.16) 
    155185      ! 
    156186   END SUBROUTINE stp_ctl 
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/NEMO/OPA_SRC/trc_oce.F90

    r7646 r8841  
    2525 
    2626   LOGICAL , PUBLIC                                      ::   l_co2cpl  = .false.   !: atmospheric pco2 recieved from oasis 
    27    LOGICAL , PUBLIC                                     ::   l_offline = .false.   !: offline passive tracers flag 
    28    INTEGER , PUBLIC                                      ::   nn_dttrc      !: frequency of step on passive tracers 
     27   LOGICAL , PUBLIC                                      ::   l_offline = .false.   !: offline passive tracers flag 
     28   INTEGER , PUBLIC                                      ::   nn_dttrc = 1     !: frequency of step on passive tracers 
    2929   REAL(wp), PUBLIC                                      ::   r_si2         !: largest depth of extinction (blue & 0.01 mg.m-3)  (RGB) 
    3030   REAL(wp), PUBLIC, SAVE, ALLOCATABLE, DIMENSION(:,:,:) ::   etot3         !: light absortion coefficient 
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/NEMO/SAO_SRC/nemogcm.F90

    r7646 r8841  
    499499      ! 
    500500      ! Find the factors of n. 
    501       IF( kn == 1 )   GOTO 20 
    502  
    503       ! nu holds the unfactorised part of the number. 
    504       ! knfax holds the number of factors found. 
    505       ! l points to the allowed factor list. 
    506       ! ifac holds the current factor. 
    507       ! 
    508       inu   = kn 
    509       knfax = 0 
    510       ! 
    511       DO jl = ntest, 1, -1 
    512          ! 
    513          ifac = ilfax(jl) 
    514          IF( ifac > inu )   CYCLE 
    515  
    516          ! Test whether the factor will divide. 
    517  
    518          IF( MOD(inu,ifac) == 0 ) THEN 
     501      IF( kn .NE. 1 ) THEN 
     502 
     503         ! nu holds the unfactorised part of the number. 
     504         ! knfax holds the number of factors found. 
     505         ! l points to the allowed factor list. 
     506         ! ifac holds the current factor. 
     507         ! 
     508         inu   = kn 
     509         knfax = 0 
     510         ! 
     511         DO jl = ntest, 1, -1 
    519512            ! 
    520             knfax = knfax + 1            ! Add the factor to the list 
    521             IF( knfax > kmaxfax ) THEN 
    522                kerr = 6 
    523                write (*,*) 'FACTOR: insufficient space in factor array ', knfax 
    524                return 
     513            ifac = ilfax(jl) 
     514            IF( ifac > inu )   CYCLE 
     515    
     516            ! Test whether the factor will divide. 
     517    
     518            IF( MOD(inu,ifac) == 0 ) THEN 
     519               ! 
     520               knfax = knfax + 1            ! Add the factor to the list 
     521               IF( knfax > kmaxfax ) THEN 
     522                  kerr = 6 
     523                  write (*,*) 'FACTOR: insufficient space in factor array ', knfax 
     524                  return 
     525               ENDIF 
     526               kfax(knfax) = ifac 
     527               ! Store the other factor that goes with this one 
     528               knfax = knfax + 1 
     529               kfax(knfax) = inu / ifac 
     530               !WRITE (*,*) 'ARPDBG, factors ',knfax-1,' & ',knfax,' are ', kfax(knfax-1),' and ',kfax(knfax) 
    525531            ENDIF 
    526             kfax(knfax) = ifac 
    527             ! Store the other factor that goes with this one 
    528             knfax = knfax + 1 
    529             kfax(knfax) = inu / ifac 
    530             !WRITE (*,*) 'ARPDBG, factors ',knfax-1,' & ',knfax,' are ', kfax(knfax-1),' and ',kfax(knfax) 
    531          ENDIF 
    532          ! 
    533       END DO 
    534       ! 
    535    20 CONTINUE      ! Label 20 is the exit point from the factor search loop. 
     532            ! 
     533         END DO 
     534         ! 
     535      ENDIF 
    536536      ! 
    537537   END SUBROUTINE factorise 
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/NEMO/SAS_SRC/daymod.F90

    r7761 r8841  
    22   !!====================================================================== 
    33   !!                       ***  MODULE  daymod  *** 
    4    !! Ocean        :  calendar  
     4   !! Ocean :   management of the model 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   !!                 ! 2015-11  (D. Lea) Allow non-zero initial time of day 
     14   !!---------------------------------------------------------------------- 
    1415 
    1516   !!---------------------------------------------------------------------- 
    1617   !!   day        : calendar 
    17    !!   
    18    !!           ------------------------------- 
    19    !!           ----------- WARNING ----------- 
    20    !! 
    21    !!   we suppose that the time step is deviding the number of second of in a day 
    22    !!             ---> MOD( rday, rdt ) == 0 
    23    !! 
    24    !!           ----------- WARNING ----------- 
    25    !!           ------------------------------- 
    26    !!   
    27    !!---------------------------------------------------------------------- 
    28    USE dom_oce         ! ocean space and time domain 
    29    USE phycst          ! physical constants 
    30    USE in_out_manager  ! I/O manager 
    31    USE iom             !  
    32    USE ioipsl, ONLY :   ymds2ju   ! for calendar 
    33    USE prtctl          ! Print control 
    34    USE restart         !  
    35    USE timing          ! Timing 
     18   !!---------------------------------------------------------------------- 
     19   !!                    ----------- WARNING ----------- 
     20   !!                    ------------------------------- 
     21   !!   sbcmod assume that the time step is dividing the number of second of  
     22   !!   in a day, i.e. ===> MOD( rday, rdt ) == 0  
     23   !!   except when user defined forcing is used (see sbcmod.F90) 
     24   !!---------------------------------------------------------------------- 
     25   USE dom_oce        ! ocean space and time domain 
     26   USE phycst         ! physical constants 
     27   USE ioipsl  , ONLY :   ymds2ju      ! for calendar 
     28   USE trc_oce , ONLY :   l_offline   ! offline flag 
     29   ! 
     30   USE in_out_manager ! I/O manager 
     31   USE prtctl         ! Print control 
     32   USE iom            ! 
     33   USE timing         ! Timing 
     34   USE restart        ! restart 
    3635 
    3736   IMPLICIT NONE 
     
    4039   PUBLIC   day        ! called by step.F90 
    4140   PUBLIC   day_init   ! called by istate.F90 
    42  
    43    INTEGER ::   nsecd, nsecd05, ndt, ndt05 
    44  
    45    !!---------------------------------------------------------------------- 
    46    !! NEMO/OPA 3.3 , NEMO Consortium (2010) 
     41   PUBLIC   day_mth    ! Needed by TAM 
     42 
     43   INTEGER, PUBLIC ::   nsecd, nsecd05, ndt, ndt05   !: (PUBLIC for TAM) 
     44 
     45   !!---------------------------------------------------------------------- 
     46   !! NEMO/OPA 4.0 , NEMO Consortium (2016) 
    4747   !! $Id$ 
    4848   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt) 
     
    5353      !!---------------------------------------------------------------------- 
    5454      !!                   ***  ROUTINE day_init  *** 
    55       !!  
    56       !! ** Purpose :   Initialization of the calendar values to their values 1 time step before nit000  
     55      !! 
     56      !! ** Purpose :   Initialization of the calendar values to their values 1 time step before nit000 
    5757      !!                because day will be called at the beginning of step 
    5858      !! 
     
    6767      !!              - nmonth_len, nyear_len, nmonth_half, nmonth_end through day_mth 
    6868      !!---------------------------------------------------------------------- 
    69       INTEGER  ::   inbday, idweek 
    70       REAL(wp) ::   zjul 
     69      INTEGER  ::   inbday, idweek   ! local integers 
     70      REAL(wp) ::   zjul             ! local scalar 
    7171      !!---------------------------------------------------------------------- 
    7272      ! 
     
    7676            &           'You must do a restart at higher frequency (or remove this stop and recompile the code in I8)' ) 
    7777      ENDIF 
    78       ! all calendar staff is based on the fact that MOD( rday, rdt ) == 0 
    79       IF( MOD( rday , rdt ) /= 0. )   CALL ctl_stop( 'the time step must devide the number of second of in a day' ) 
    80       IF( MOD( rday , 2.  ) /= 0. )   CALL ctl_stop( 'the number of second of in a day must be an even number'    ) 
    81       IF( MOD( rdt  , 2.  ) /= 0. )   CALL ctl_stop( 'the time step (in second) must be an even number'           ) 
    82       nsecd   = NINT(rday       ) 
    83       nsecd05 = NINT(0.5 * rday ) 
    84       ndt     = NINT(      rdt  ) 
    85       ndt05   = NINT(0.5 * rdt  ) 
    86  
    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) 
    93  
     78      nsecd   = NINT( rday       ) 
     79      nsecd05 = NINT( 0.5 * rday ) 
     80      ndt     = NINT(       rdt  ) 
     81      ndt05   = NINT( 0.5 * rdt  ) 
     82 
     83      IF( .NOT. l_offline )   CALL day_rst( nit000, 'READ' ) 
     84 
     85      ! set the calandar from ndastp (read in restart file and namelist) 
    9486      nyear   =   ndastp / 10000 
    9587      nmonth  = ( ndastp - (nyear * 10000) ) / 100 
    96       nday    =   ndastp - (nyear * 10000) - ( nmonth * 100 )  
    97  
    98       CALL ymds2ju( nyear, nmonth, nday, 0.0, fjulday )  ! we assume that we start run at 00:00 
     88      nday    =   ndastp - (nyear * 10000) - ( nmonth * 100 ) 
     89 
     90      nhour   =   nn_time0 / 100 
     91      nminute = ( nn_time0 - nhour * 100 ) 
     92 
     93      CALL ymds2ju( nyear, nmonth, nday, nhour*3600._wp+nminute*60._wp, fjulday )   
    9994      IF( ABS(fjulday - REAL(NINT(fjulday),wp)) < 0.1 / rday )   fjulday = REAL(NINT(fjulday),wp)   ! avoid truncation error 
    100       fjulday = fjulday + 1.                             ! move back to the day at nit000 (and not at nit000 - 1) 
     95      IF( nn_time0*3600 - ndt05 .lt. 0 ) fjulday = fjulday + 1.                    ! move back to the day at nit000 (and not at nit000 - 1) 
    10196 
    10297      nsec1jan000 = 0 
    10398      CALL day_mth 
    104        
     99 
    105100      IF ( nday == 0 ) THEN     !   for ex if ndastp = ndate0 - 1 
    106          nmonth = nmonth - 1   
     101         nmonth = nmonth - 1 
    107102         nday = nmonth_len(nmonth) 
    108103      ENDIF 
     
    113108         IF( nleapy == 1 )   CALL day_mth 
    114109      ENDIF 
    115        
     110 
    116111      ! day since january 1st 
    117112      nday_year = nday + SUM( nmonth_len(1:nmonth - 1) ) 
    118113 
    119       !compute number of days between last monday and today       
     114      !compute number of days between last monday and today 
    120115      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   
     116      inbday = FLOOR(fjulday - zjul)            ! compute nb day between  01.01.1900 and start of current day 
     117      idweek = MOD(inbday, 7)                  ! compute nb day between last monday and current day 
     118      IF (idweek .lt. 0) idweek=idweek+7       ! Avoid negative values for dates before 01.01.1900 
    123119 
    124120      ! number of seconds since the beginning of current year/month/week/day at the middle of the time-step 
    125       nsec_year  = nday_year * nsecd - ndt05   ! 1 time step before the middle of the first time step 
    126       nsec_month = nday      * nsecd - ndt05   ! because day will be called at the beginning of step 
    127       nsec_week  = idweek    * nsecd - ndt05 
    128       nsec_day   =             nsecd - ndt05 
     121      IF (nhour*3600+nminute*60-ndt05 .gt. 0) THEN 
     122         ! 1 timestep before current middle of first time step is still the same day 
     123         nsec_year  = (nday_year-1) * nsecd + nhour*3600+nminute*60 - ndt05  
     124         nsec_month = (nday-1)      * nsecd + nhour*3600+nminute*60 - ndt05     
     125      ELSE 
     126         ! 1 time step before the middle of the first time step is the previous day  
     127         nsec_year  = nday_year * nsecd + nhour*3600+nminute*60 - ndt05  
     128         nsec_month = nday      * nsecd + nhour*3600+nminute*60 - ndt05    
     129      ENDIF 
     130      nsec_week  = idweek    * nsecd + nhour*3600+nminute*60 - ndt05 
     131      nsec_day   =             nhour*3600+nminute*60 - ndt05  
     132      IF( nsec_day .lt. 0 ) nsec_day = nsec_day + nsecd 
     133      IF( nsec_week .lt. 0 ) nsec_week = nsec_week + nsecd*7 
    129134 
    130135      ! control print 
    131       IF(lwp) WRITE(numout,'(a,i6,a,i2,a,i2,a,i8,a,i8)')' =======>> 1/2 time step before the start of the run DATE Y/M/D = ',   & 
    132            &                   nyear, '/', nmonth, '/', nday, '  nsec_day:', nsec_day, '  nsec_week:', nsec_week 
     136      IF(lwp) WRITE(numout,'(a,i6,a,i2,a,i2,a,i8,a,i8,a,i8,a,i8)')   & 
     137           &                   ' =======>> 1/2 time step before the start of the run DATE Y/M/D = ',   & 
     138           &                   nyear, '/', nmonth, '/', nday, '  nsec_day:', nsec_day, '  nsec_week:', nsec_week, '  & 
     139           &                   nsec_month:', nsec_month , '  nsec_year:' , nsec_year 
    133140 
    134141      ! Up to now, calendar parameters are related to the end of previous run (nit000-1) 
     
    142149      !!---------------------------------------------------------------------- 
    143150      !!                   ***  ROUTINE day_init  *** 
    144       !!  
     151      !! 
    145152      !! ** Purpose :   calendar values related to the months 
    146153      !! 
     
    154161 
    155162      ! length of the month of the current year (from nleapy, read in namelist) 
    156       IF ( nleapy < 2 ) THEN  
     163      IF ( nleapy < 2 ) THEN 
    157164         nmonth_len(:) = (/ 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31 /) 
    158165         nyear_len(:) = 365 
     
    177184      ! time since Jan 1st   0     1     2    ...    11    12    13 
    178185      !          ---------*--|--*--|--*--| ... |--*--|--*--|--*--|-------------------------------------- 
    179       !                 <---> <---> <--->  ...  <---> <---> <--->         
     186      !                 <---> <---> <--->  ...  <---> <---> <---> 
    180187      ! month number      0     1     2    ...    11    12    13 
    181188      ! 
     
    190197         nmonth_end(jm) = nmonth_end(jm-1) + nsecd * nmonth_len(jm) 
    191198      END DO 
    192       !            
    193    END SUBROUTINE  
     199      ! 
     200   END SUBROUTINE 
    194201 
    195202 
     
    197204      !!---------------------------------------------------------------------- 
    198205      !!                      ***  ROUTINE day  *** 
    199       !!  
     206      !! 
    200207      !! ** Purpose :   Compute the date with a day iteration IF necessary. 
    201208      !! 
     
    209216      !!              - adatrj    : date in days since the beginning of the run 
    210217      !!              - nsec_year : current time of the year (in second since 00h, jan 1st) 
    211       !!----------------------------------------------------------------------       
     218      !!---------------------------------------------------------------------- 
    212219      INTEGER, INTENT(in) ::   kt        ! ocean time-step indices 
    213220      ! 
     
    220227      zprec = 0.1 / rday 
    221228      !                                                 ! New time-step 
    222       nsec_year  = nsec_year  + ndt  
    223       nsec_month = nsec_month + ndt                  
     229      nsec_year  = nsec_year  + ndt 
     230      nsec_month = nsec_month + ndt 
    224231      nsec_week  = nsec_week  + ndt 
    225       nsec_day   = nsec_day   + ndt                 
     232      nsec_day   = nsec_day   + ndt 
    226233      adatrj  = adatrj  + rdt / rday 
    227234      fjulday = fjulday + rdt / rday 
    228235      IF( ABS(fjulday - REAL(NINT(fjulday),wp)) < zprec )   fjulday = REAL(NINT(fjulday),wp)   ! avoid truncation error 
    229236      IF( ABS(adatrj  - REAL(NINT(adatrj ),wp)) < zprec )   adatrj  = REAL(NINT(adatrj ),wp)   ! avoid truncation error 
    230        
     237 
    231238      IF( nsec_day > nsecd ) THEN                       ! New day 
    232239         ! 
     
    261268 
    262269      IF( nsec_week > 7*nsecd )   nsec_week = ndt05     ! New week 
    263        
     270 
    264271      IF(ln_ctl) THEN 
    265272         WRITE(charout,FMT="('kt =', I4,'  d/m/y =',I2,I2,I4)") kt, nday, nmonth, nyear 
     
    267274      ENDIF 
    268275 
    269       ! since we no longer call rst_opn, need to define nitrst here, used by ice restart routine 
    270       IF( kt == nit000 )  THEN 
    271          nitrst = nitend 
    272          lrst_oce = .FALSE.  ! init restart ocean (done in rst_opn when not SAS) 
    273       ENDIF 
    274  
    275       IF( MOD( kt - 1, nstock ) == 0 ) THEN 
    276          ! we use kt - 1 and not kt - nit000 to keep the same periodicity from the beginning of the experiment 
    277          nitrst = kt + nstock - 1                  ! define the next value of nitrst for restart writing 
    278          IF( nitrst > nitend )   nitrst = nitend   ! make sure we write a restart at the end of the run 
    279       ENDIF 
    280  
     276      IF( .NOT. l_offline ) CALL rst_opn( kt )               ! Open the restart file if needed and control lrst_oce 
     277      IF( lrst_oce         ) CALL day_rst( kt, 'WRITE' )      ! write day restart information 
     278      ! 
    281279      IF( nn_timing == 1 )  CALL timing_stop('day') 
    282280      ! 
     
    312310      CHARACTER(len=*), INTENT(in) ::   cdrw       ! "READ"/"WRITE" flag 
    313311      ! 
    314       REAL(wp) ::   zkt, zndastp 
     312      REAL(wp) ::   zkt, zndastp, zdayfrac, ksecs, ktime 
     313      INTEGER  ::   ihour, iminute 
    315314      !!---------------------------------------------------------------------- 
    316315 
     
    337336            ! define ndastp and adatrj 
    338337            IF ( nrstdt == 2 ) THEN 
    339                ! read the parameters correspondting to nit000 - 1 (last time step of previous run) 
     338               ! read the parameters corresponding to nit000 - 1 (last time step of previous run) 
    340339               CALL iom_get( numror, 'ndastp', zndastp ) 
    341340               ndastp = NINT( zndastp ) 
    342341               CALL iom_get( numror, 'adatrj', adatrj  ) 
     342          CALL iom_get( numror, 'ntime', ktime ) 
     343          nn_time0=INT(ktime) 
     344               ! calculate start time in hours and minutes 
     345          zdayfrac=adatrj-INT(adatrj) 
     346          ksecs = NINT(zdayfrac*86400)        ! Nearest second to catch rounding errors in adatrj          
     347          ihour = INT(ksecs/3600) 
     348          iminute = ksecs/60-ihour*60 
     349            
     350               ! Add to nn_time0 
     351               nhour   =   nn_time0 / 100 
     352               nminute = ( nn_time0 - nhour * 100 ) 
     353          nminute=nminute+iminute 
     354           
     355          IF( nminute >= 60 ) THEN 
     356             nminute=nminute-60 
     357        nhour=nhour+1 
     358          ENDIF 
     359          nhour=nhour+ihour 
     360          IF( nhour >= 24 ) THEN 
     361        nhour=nhour-24 
     362             adatrj=adatrj+1 
     363          ENDIF           
     364          nn_time0 = nhour * 100 + nminute 
     365          adatrj = INT(adatrj)                    ! adatrj set to integer as nn_time0 updated           
    343366            ELSE 
    344                ! parameters correspondting to nit000 - 1 (as we start the step loop with a call to day) 
    345                ndastp = ndate0 - 1     ! ndate0 read in the namelist in dom_nam, we assume that we start run at 00:00 
     367               ! parameters corresponding to nit000 - 1 (as we start the step loop with a call to day) 
     368               ndastp = ndate0        ! ndate0 read in the namelist in dom_nam 
     369               nhour   =   nn_time0 / 100 
     370               nminute = ( nn_time0 - nhour * 100 ) 
     371               IF( nhour*3600+nminute*60-ndt05 .lt. 0 )  ndastp=ndastp-1      ! Start hour is specified in the namelist (default 0) 
    346372               adatrj = ( REAL( nit000-1, wp ) * rdt ) / rday 
    347373               ! note this is wrong if time step has changed during run 
    348374            ENDIF 
    349375         ELSE 
    350             ! parameters correspondting to nit000 - 1 (as we start the step loop with a call to day) 
    351             ndastp = ndate0 - 1        ! ndate0 read in the namelist in dom_nam, we assume that we start run at 00:00 
     376            ! parameters corresponding to nit000 - 1 (as we start the step loop with a call to day) 
     377            ndastp = ndate0           ! ndate0 read in the namelist in dom_nam 
     378            nhour   =   nn_time0 / 100 
     379       nminute = ( nn_time0 - nhour * 100 ) 
     380            IF( nhour*3600+nminute*60-ndt05 .lt. 0 )  ndastp=ndastp-1      ! Start hour is specified in the namelist (default 0) 
    352381            adatrj = ( REAL( nit000-1, wp ) * rdt ) / rday 
    353382         ENDIF 
     
    358387            WRITE(numout,*) '   date ndastp                                      : ', ndastp 
    359388            WRITE(numout,*) '   number of elapsed days since the begining of run : ', adatrj 
     389       WRITE(numout,*) '   nn_time0                                         : ',nn_time0 
    360390            WRITE(numout,*) 
    361391         ENDIF 
     
    373403         CALL iom_rstput( kt, nitrst, numrow, 'adatrj' , adatrj            )   ! number of elapsed days since 
    374404         !                                                                     ! the begining of the run [s] 
     405    CALL iom_rstput( kt, nitrst, numrow, 'ntime'  , REAL( nn_time0, wp) ) ! time 
    375406      ENDIF 
    376407      ! 
    377408   END SUBROUTINE day_rst 
     409 
    378410   !!====================================================================== 
    379411END MODULE daymod 
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/NEMO/SAS_SRC/nemogcm.F90

    r7761 r8841  
    2525   USE usrdef_nam     ! user defined configuration 
    2626   USE daymod         ! calendar 
     27   USE restart        ! open  restart file 
    2728   USE step           ! NEMO time-stepping                 (stp     routine) 
    2829   USE cpl_oasis3     ! 
     
    364365      IF( ln_ctl      )     CALL prt_ctl_init   ! Print control 
    365366                            CALL day_init   ! model calendar (using both namelist and restart infos) 
     367      IF( ln_rstart )       CALL rst_read_open 
    366368 
    367369                            CALL sbc_init   ! Forcings : surface module  
     
    596598      ! 
    597599      ! Find the factors of n. 
    598       IF( kn == 1 )   GOTO 20 
    599  
    600       ! nu holds the unfactorised part of the number. 
    601       ! knfax holds the number of factors found. 
    602       ! l points to the allowed factor list. 
    603       ! ifac holds the current factor. 
    604       ! 
    605       inu   = kn 
    606       knfax = 0 
    607       ! 
    608       DO jl = ntest, 1, -1 
    609          ! 
    610          ifac = ilfax(jl) 
    611          IF( ifac > inu )   CYCLE 
    612  
    613          ! Test whether the factor will divide. 
    614  
    615          IF( MOD(inu,ifac) == 0 ) THEN 
     600      IF( kn .NE. 1 ) THEN 
     601 
     602         ! nu holds the unfactorised part of the number. 
     603         ! knfax holds the number of factors found. 
     604         ! l points to the allowed factor list. 
     605         ! ifac holds the current factor. 
     606         ! 
     607         inu   = kn 
     608         knfax = 0 
     609         ! 
     610         DO jl = ntest, 1, -1 
    616611            ! 
    617             knfax = knfax + 1            ! Add the factor to the list 
    618             IF( knfax > kmaxfax ) THEN 
    619                kerr = 6 
    620                write (*,*) 'FACTOR: insufficient space in factor array ', knfax 
    621                return 
     612            ifac = ilfax(jl) 
     613            IF( ifac > inu )   CYCLE 
     614    
     615            ! Test whether the factor will divide. 
     616    
     617            IF( MOD(inu,ifac) == 0 ) THEN 
     618               ! 
     619               knfax = knfax + 1            ! Add the factor to the list 
     620               IF( knfax > kmaxfax ) THEN 
     621                  kerr = 6 
     622                  write (*,*) 'FACTOR: insufficient space in factor array ', knfax 
     623                  return 
     624               ENDIF 
     625               kfax(knfax) = ifac 
     626               ! Store the other factor that goes with this one 
     627               knfax = knfax + 1 
     628               kfax(knfax) = inu / ifac 
     629               !WRITE (*,*) 'ARPDBG, factors ',knfax-1,' & ',knfax,' are ', kfax(knfax-1),' and ',kfax(knfax) 
    622630            ENDIF 
    623             kfax(knfax) = ifac 
    624             ! Store the other factor that goes with this one 
    625             knfax = knfax + 1 
    626             kfax(knfax) = inu / ifac 
    627             !WRITE (*,*) 'ARPDBG, factors ',knfax-1,' & ',knfax,' are ', kfax(knfax-1),' and ',kfax(knfax) 
    628          ENDIF 
    629          ! 
    630       END DO 
    631       ! 
    632    20 CONTINUE      ! Label 20 is the exit point from the factor search loop. 
     631            ! 
     632         END DO 
     633         ! 
     634      ENDIF 
    633635      ! 
    634636   END SUBROUTINE factorise 
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/NEMO/TOP_SRC/CFC/trcsms_cfc.F90

    r7646 r8841  
    180180      ! 
    181181      IF( lk_iomput ) THEN 
     182         jl = 0 
    182183         DO jn = jp_cfc0, jp_cfc1 
    183             CALL iom_put( 'qtr_'//ctrcnm(jn) , qtr_cfc (:,:,jn) ) 
    184             CALL iom_put( 'qint_'//ctrcnm(jn), qint_cfc(:,:,jn) ) 
     184            jl = jl + 1 
     185            CALL iom_put( 'qtr_'//TRIM(ctrcnm(jn)) , qtr_cfc (:,:,jl) ) 
     186            CALL iom_put( 'qint_'//TRIM(ctrcnm(jn)), qint_cfc(:,:,jl) ) 
    185187         ENDDO 
    186188      END IF 
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/NEMO/TOP_SRC/PISCES/P2Z/p2zopt.F90

    r7681 r8841  
    119119      !                                          ! -------------- 
    120120      neln(:,:) = 1                                   ! euphotic layer level 
    121       DO jk = 1, jpk                                  ! (i.e. 1rst T-level strictly below EL bottom) 
     121      DO jk = 1, jpkm1                                  ! (i.e. 1rst T-level strictly below EL bottom) 
    122122         DO jj = 1, jpj 
    123123           DO ji = 1, jpi 
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zlim.F90

    r7753 r8841  
    207207                  &                                / ( oxymin + trb(ji,jj,jk,jpoxy) )  ) 
    208208               nitrfac(ji,jj,jk) = MIN( 1., nitrfac(ji,jj,jk) ) 
     209               ! 
     210               ! denitrification factor computed from NO3 levels 
     211               nitrfac2(ji,jj,jk) = MAX( 0.e0,       ( 1.E-6 - trb(ji,jj,jk,jpno3) )  & 
     212                  &                                / ( 1.E-6 + trb(ji,jj,jk,jpno3) ) ) 
     213               nitrfac2(ji,jj,jk) = MIN( 1., nitrfac2(ji,jj,jk) ) 
    209214            END DO 
    210215         END DO 
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zmeso.F90

    r7753 r8841  
    9595               !  no real reason except that it seems to be more stable and may mimic predation 
    9696               !  --------------------------------------------------------------- 
    97                ztortz2   = mzrat2 * 1.e6 * zfact * trb(ji,jj,jk,jpmes) 
     97               ztortz2   = mzrat2 * 1.e6 * zfact * trb(ji,jj,jk,jpmes)  * (1. - nitrfac(ji,jj,jk) ) 
    9898               ! 
    9999               zcompadi  = MAX( ( trb(ji,jj,jk,jpdia) - xthresh2dia ), 0.e0 ) 
     
    125125               !  ---------------------------------- 
    126126               zgrazffeg = grazflux  * xstep * wsbio4(ji,jj,jk)      & 
    127                &           * tgfunc2(ji,jj,jk) * trb(ji,jj,jk,jpgoc) * trb(ji,jj,jk,jpmes) 
     127               &           * tgfunc2(ji,jj,jk) * trb(ji,jj,jk,jpgoc) * trb(ji,jj,jk,jpmes) & 
     128               &           * (1. - nitrfac(ji,jj,jk)) 
    128129               zgrazfffg = zgrazffeg * trb(ji,jj,jk,jpbfe) / (trb(ji,jj,jk,jpgoc) + rtrn) 
    129130               zgrazffep = grazflux  * xstep *  wsbio3(ji,jj,jk)     & 
    130                &           * tgfunc2(ji,jj,jk) * trb(ji,jj,jk,jppoc) * trb(ji,jj,jk,jpmes) 
     131               &           * tgfunc2(ji,jj,jk) * trb(ji,jj,jk,jppoc) * trb(ji,jj,jk,jpmes) & 
     132               &           * (1. - nitrfac(ji,jj,jk)) 
    131133               zgrazfffp = zgrazffep * trb(ji,jj,jk,jpsfe) / (trb(ji,jj,jk,jppoc) + rtrn) 
    132134              ! 
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zmicro.F90

    r7753 r8841  
    9393               !  no real reason except that it seems to be more stable and may mimic predation. 
    9494               !  --------------------------------------------------------------- 
    95                ztortz = mzrat * 1.e6 * zfact * trb(ji,jj,jk,jpzoo) 
     95               ztortz = mzrat * 1.e6 * zfact * trb(ji,jj,jk,jpzoo) * (1. - nitrfac(ji,jj,jk)) 
    9696 
    9797               zcompadi  = MIN( MAX( ( trb(ji,jj,jk,jpdia) - xthreshdia ), 0.e0 ), xsizedia ) 
     
    105105               zdenom    = zfoodlim / ( xkgraz + zfoodlim ) 
    106106               zdenom2   = zdenom / ( zfood + rtrn ) 
    107                zgraze    = grazrat * xstep * tgfunc2(ji,jj,jk) * trb(ji,jj,jk,jpzoo)  
     107               zgraze    = grazrat * xstep * tgfunc2(ji,jj,jk) * trb(ji,jj,jk,jpzoo) * (1. - nitrfac(ji,jj,jk)) 
    108108 
    109109               zgrazp    = zgraze  * xpref2p * zcompaph  * zdenom2  
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zopt.F90

    r7753 r8841  
    3434 
    3535   TYPE(FLD), ALLOCATABLE, DIMENSION(:) ::   sf_par      ! structure of input par 
    36    INTEGER , PARAMETER :: nbtimes = 365  !: maximum number of times record in a file 
     36   INTEGER , PARAMETER :: nbtimes = 366  !: maximum number of times record in a file 
    3737   INTEGER  :: ntimes_par                ! number of time steps in a file 
    3838   REAL(wp), ALLOCATABLE, SAVE,   DIMENSION(:,:) :: par_varsw    !: PAR fraction of shortwave 
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zrem.F90

    r7753 r8841  
    6565      REAL(wp) ::   zsatur, zsatur2, znusil, znusil2, zdep, zdepmin, zfactdep 
    6666      REAL(wp) ::   zbactfer, zolimit, zonitr, zrfact2 
     67      REAL(wp) ::   zammonic, zoxyrem 
    6768      REAL(wp) ::   zosil, ztem, zdenitnh4, zolimic, zolimin, zolimip, zdenitrn, zdenitrp 
    6869      CHARACTER (len=25) :: charout 
     
    118119                  ! Ammonification in suboxic waters with denitrification 
    119120                  ! ------------------------------------------------------- 
    120                   denitr(ji,jj,jk)  = MIN(  ( trb(ji,jj,jk,jpno3) - rtrn ) / rdenit,   & 
    121                      &                     zremik * nitrfac(ji,jj,jk) * trb(ji,jj,jk,jpdoc)  ) 
     121                  zammonic = zremik * nitrfac(ji,jj,jk) * trb(ji,jj,jk,jpdoc) 
     122                  denitr(ji,jj,jk)  = zammonic * ( 1. - nitrfac2(ji,jj,jk) ) 
     123                  zoxyrem           = zammonic *        nitrfac2(ji,jj,jk) 
    122124                  ! 
    123125                  zolimi (ji,jj,jk) = MAX( 0.e0, zolimi (ji,jj,jk) ) 
    124126                  denitr (ji,jj,jk) = MAX( 0.e0, denitr (ji,jj,jk) ) 
     127                  zoxyrem           = MAX( 0.e0, zoxyrem  ) 
     128 
    125129                  ! 
    126                   tra(ji,jj,jk,jppo4) = tra(ji,jj,jk,jppo4) + zolimi (ji,jj,jk) + denitr(ji,jj,jk) 
    127                   tra(ji,jj,jk,jpnh4) = tra(ji,jj,jk,jpnh4) + zolimi (ji,jj,jk) + denitr(ji,jj,jk) 
     130                  tra(ji,jj,jk,jppo4) = tra(ji,jj,jk,jppo4) + zolimi (ji,jj,jk) + denitr(ji,jj,jk) + zoxyrem 
     131                  tra(ji,jj,jk,jpnh4) = tra(ji,jj,jk,jpnh4) + zolimi (ji,jj,jk) + denitr(ji,jj,jk) + zoxyrem 
    128132                  tra(ji,jj,jk,jpno3) = tra(ji,jj,jk,jpno3) - denitr (ji,jj,jk) * rdenit 
    129                   tra(ji,jj,jk,jpdoc) = tra(ji,jj,jk,jpdoc) - zolimi (ji,jj,jk) - denitr(ji,jj,jk) 
     133                  tra(ji,jj,jk,jpdoc) = tra(ji,jj,jk,jpdoc) - zolimi (ji,jj,jk) - denitr(ji,jj,jk) - zoxyrem 
    130134                  tra(ji,jj,jk,jpoxy) = tra(ji,jj,jk,jpoxy) - zolimi (ji,jj,jk) * o2ut 
    131                   tra(ji,jj,jk,jpdic) = tra(ji,jj,jk,jpdic) + zolimi (ji,jj,jk) + denitr(ji,jj,jk) 
    132                   tra(ji,jj,jk,jptal) = tra(ji,jj,jk,jptal) + rno3 * ( zolimi(ji,jj,jk)    & 
     135                  tra(ji,jj,jk,jpdic) = tra(ji,jj,jk,jpdic) + zolimi (ji,jj,jk) + denitr(ji,jj,jk) + zoxyrem 
     136                  tra(ji,jj,jk,jptal) = tra(ji,jj,jk,jptal) + rno3 * ( zolimi(ji,jj,jk) + zoxyrem    & 
    133137                  &                     + ( rdenit + 1.) * denitr(ji,jj,jk) ) 
    134138               END DO 
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zsed.F90

    r7753 r8841  
    5454      REAL(wp) ::  zwflux, zfminus, zfplus 
    5555      REAL(wp) ::  zlim, zfact, zfactcal 
    56       REAL(wp) ::  zo2, zno3, zflx, zpdenit, z1pdenit, zdenitt, zolimit 
     56      REAL(wp) ::  zo2, zno3, zflx, zpdenit, z1pdenit, zolimit 
    5757      REAL(wp) ::  zsiloss, zcaloss, zws3, zws4, zwsc, zdep 
    5858      REAL(wp) ::  zwstpoc, zwstpon, zwstpop 
     
    319319               tra(ji,jj,ikt,jptal) =  tra(ji,jj,ikt,jptal) + zcaloss * zrivalk * 2.0 
    320320               tra(ji,jj,ikt,jpdic) =  tra(ji,jj,ikt,jpdic) + zcaloss * zrivalk 
    321                zsedcal(ji,jj) = (1.0 - zrivalk) * zcaloss / zdep 
    322                zsedsi (ji,jj) = (1.0 - zrivsil) * zsiloss / zdep 
     321               zsedcal(ji,jj) = (1.0 - zrivalk) * zcaloss * e3t_n(ji,jj,ikt)  
     322               zsedsi (ji,jj) = (1.0 - zrivsil) * zsiloss * e3t_n(ji,jj,ikt)  
    323323            END DO 
    324324         END DO 
     
    365365 
    366366      IF( .NOT.lk_sed ) THEN 
    367          ! The 0.5 factor in zpdenit and zdenitt is to avoid negative NO3 concentration after both denitrification 
    368          ! in the sediments and just above the sediments. Not very clever, but simpliest option. 
     367         ! The 0.5 factor in zpdenit is to avoid negative NO3 concentration after 
     368         ! denitrification in the sediments. Not very clever, but simpliest option. 
    369369         DO jj = 1, jpj 
    370370            DO ji = 1, jpi 
     
    378378               z1pdenit = zwstpoc * zrivno3 - zpdenit 
    379379               zolimit = MIN( ( trb(ji,jj,ikt,jpoxy) - rtrn ) / o2ut, z1pdenit * ( 1.- nitrfac(ji,jj,ikt) ) ) 
    380                zdenitt = MIN(  0.5 * ( trb(ji,jj,ikt,jpno3) - rtrn ) / rdenit, z1pdenit * nitrfac(ji,jj,ikt) ) 
    381                tra(ji,jj,ikt,jpdoc) = tra(ji,jj,ikt,jpdoc) + z1pdenit - zolimit - zdenitt 
    382                tra(ji,jj,ikt,jppo4) = tra(ji,jj,ikt,jppo4) + zpdenit + zolimit + zdenitt 
    383                tra(ji,jj,ikt,jpnh4) = tra(ji,jj,ikt,jpnh4) + zpdenit + zolimit + zdenitt 
    384                tra(ji,jj,ikt,jpno3) = tra(ji,jj,ikt,jpno3) - rdenit * (zpdenit + zdenitt) 
     380               tra(ji,jj,ikt,jpdoc) = tra(ji,jj,ikt,jpdoc) + z1pdenit - zolimit 
     381               tra(ji,jj,ikt,jppo4) = tra(ji,jj,ikt,jppo4) + zpdenit + zolimit 
     382               tra(ji,jj,ikt,jpnh4) = tra(ji,jj,ikt,jpnh4) + zpdenit + zolimit 
     383               tra(ji,jj,ikt,jpno3) = tra(ji,jj,ikt,jpno3) - rdenit * zpdenit 
    385384               tra(ji,jj,ikt,jpoxy) = tra(ji,jj,ikt,jpoxy) - zolimit * o2ut 
    386                tra(ji,jj,ikt,jptal) = tra(ji,jj,ikt,jptal) + rno3 * (zolimit + (1.+rdenit) * (zpdenit + zdenitt) ) 
    387                tra(ji,jj,ikt,jpdic) = tra(ji,jj,ikt,jpdic) + zpdenit + zolimit + zdenitt 
     385               tra(ji,jj,ikt,jptal) = tra(ji,jj,ikt,jptal) + rno3 * (zolimit + (1.+rdenit) * zpdenit ) 
     386               tra(ji,jj,ikt,jpdic) = tra(ji,jj,ikt,jpdic) + zpdenit + zolimit  
    388387               sdenit(ji,jj) = rdenit * zpdenit * e3t_n(ji,jj,ikt) 
    389                zsedc(ji,jj)   = (1. - zrivno3) * zwstpoc / zdep 
     388               zsedc(ji,jj)   = (1. - zrivno3) * zwstpoc * e3t_n(ji,jj,ikt) 
    390389               IF( ln_p5z ) THEN 
    391390                  zwstpop              = trb(ji,jj,ikt,jpgop) * zws4 + trb(ji,jj,ikt,jppop) * zws3 
    392391                  zwstpon              = trb(ji,jj,ikt,jpgon) * zws4 + trb(ji,jj,ikt,jppon) * zws3 
    393                   tra(ji,jj,ikt,jpdon) = tra(ji,jj,ikt,jpdon) + (z1pdenit - zolimit - zdenitt) * zwstpon / (zwstpoc + rtrn) 
    394                   tra(ji,jj,ikt,jpdop) = tra(ji,jj,ikt,jpdop) + (z1pdenit - zolimit - zdenitt) * zwstpop / (zwstpoc + rtrn) 
     392                  tra(ji,jj,ikt,jpdon) = tra(ji,jj,ikt,jpdon) + ( z1pdenit - zolimit ) * zwstpon / (zwstpoc + rtrn) 
     393                  tra(ji,jj,ikt,jpdop) = tra(ji,jj,ikt,jpdop) + ( z1pdenit - zolimit ) * zwstpop / (zwstpoc + rtrn) 
    395394               ENDIF 
    396395            END DO 
     
    494493      IF( lk_iomput ) THEN 
    495494         IF( knt == nrdttrc ) THEN 
    496             zfact = 1.e+3 * rfact2r * rno3  !  conversion from molC/l/kt  to molN/m3/s 
    497             IF( iom_use("Nfix"   ) ) CALL iom_put( "Nfix", nitrpot(:,:,:) * nitrfix * zfact * tmask(:,:,:) )  ! nitrogen fixation  
     495            zfact = 1.e+3 * rfact2r !  conversion from molC/l/kt  to molN/m3/s 
     496            IF( iom_use("Nfix"   ) ) CALL iom_put( "Nfix", nitrpot(:,:,:) * nitrfix * rno3 * zfact * tmask(:,:,:) )  ! nitrogen fixation  
    498497            IF( iom_use("INTNFIX") ) THEN   ! nitrogen fixation rate in ocean ( vertically integrated ) 
    499498               zwork1(:,:) = 0. 
    500499               DO jk = 1, jpkm1 
    501                  zwork1(:,:) = zwork1(:,:) + nitrpot(:,:,jk) * nitrfix * zfact * e3t_n(:,:,jk) * tmask(:,:,jk) 
     500                 zwork1(:,:) = zwork1(:,:) + nitrpot(:,:,jk) * nitrfix * rno3 * zfact * e3t_n(:,:,jk) * tmask(:,:,jk) 
    502501               ENDDO 
    503502               CALL iom_put( "INTNFIX" , zwork1 )  
    504503            ENDIF 
    505             IF( iom_use("SedCal" ) ) CALL iom_put( "SedCal", zsedcal(:,:) * 1.e+3 ) 
    506             IF( iom_use("SedSi" ) )  CALL iom_put( "SedSi",  zsedsi (:,:) * 1.e+3 ) 
    507             IF( iom_use("SedC" ) )   CALL iom_put( "SedC",   zsedc  (:,:) * 1.e+3 ) 
    508             IF( iom_use("Sdenit" ) ) CALL iom_put( "Sdenit", sdenit (:,:) * 1.e+3 * rno3 ) 
     504            IF( iom_use("SedCal" ) ) CALL iom_put( "SedCal", zsedcal(:,:) * zfact ) 
     505            IF( iom_use("SedSi" ) )  CALL iom_put( "SedSi",  zsedsi (:,:) * zfact ) 
     506            IF( iom_use("SedC" ) )   CALL iom_put( "SedC",   zsedc  (:,:) * zfact ) 
     507            IF( iom_use("Sdenit" ) ) CALL iom_put( "Sdenit", sdenit (:,:) * zfact * rno3 ) 
    509508         ENDIF 
    510509      ENDIF 
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zsms.F90

    r7753 r8841  
    431431 
    432432      IF( kt == nittrc000 ) THEN  
     433         xfact1 = rfact2r * 12. / 1.e15 * ryyss    ! conversion molC/kt --> PgC/yr 
     434         xfact2 = 1.e+3 * rno3 * 14. / 1.e12 * ryyss   ! conversion molC/l/s ----> TgN/m3/yr 
     435         xfact3 = 1.e+3 * rfact2r * rno3   ! conversion molC/l/kt ----> molN/m3/s 
    433436         IF( ln_check_mass .AND. lwp) THEN      !   Open budget file of NO3, ALK, Si, Fer 
    434437            CALL ctl_opn( numco2, 'carbon.budget'  , 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, 6, .FALSE., narea ) 
    435438            CALL ctl_opn( numnut, 'nutrient.budget', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, 6, .FALSE., narea ) 
    436439            CALL ctl_opn( numnit, 'nitrogen.budget', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, 6, .FALSE., narea ) 
    437             xfact1 = rfact2r * 12. / 1.e15 * ryyss    ! conversion molC/kt --> PgC/yr 
    438             xfact2 = 1.e+3 * rno3 * 14. / 1.e12 * ryyss   ! conversion molC/l/s ----> TgN/m3/yr 
    439             xfact3 = 1.e+3 * rfact2r * rno3   ! conversion molC/l/kt ----> molN/m3/s 
    440440            cltxt='time-step   Alkalinity        Nitrate        Phosphorus         Silicate           Iron' 
    441441            IF( lwp ) WRITE(numnut,*)  TRIM(cltxt) 
     
    517517      IF( iom_use( "tnfix" ) .OR.  ( ln_check_mass .AND. kt == nitend )  ) THEN 
    518518         znitrpottot  = glob_sum ( nitrpot(:,:,:) * nitrfix * cvol(:,:,:) ) 
    519          CALL iom_put( "tnfix"  , znitrpottot * 1.e+3 * rno3 )  ! Global  nitrogen fixation molC/l  to molN/m3  
     519         CALL iom_put( "tnfix"  , znitrpottot * xfact3 )  ! Global  nitrogen fixation molC/l  to molN/m3  
    520520      ENDIF 
    521521      ! 
    522522      IF( iom_use( "tdenit" ) .OR.  ( ln_check_mass .AND. kt == nitend )  ) THEN 
    523          zrdenittot   = glob_sum ( denitr(:,:,:) * rdenit * xnegtr(:,:,:) * cvol(:,:,:) ) 
    524          CALL iom_put( "tdenit"  , zrdenittot * 1.e+3 * rno3 )  ! Total denitrification molC/l to molN/m3  
    525       ENDIF 
    526       ! 
    527       IF( iom_use( "Sdenit" ) .OR.  ( ln_check_mass .AND. kt == nitend )  ) THEN 
    528          zsdenittot   = glob_sum ( sdenit(:,:) * e1e2t(:,:) ) 
    529          CALL iom_put( "Sdenit", sdenit(:,:) * xfact3 * tmask(:,:,1) )  ! Nitrate reduction in the sediments 
    530       ENDIF 
    531  
     523         zrdenittot = glob_sum ( denitr(:,:,:) * rdenit * xnegtr(:,:,:) * cvol(:,:,:) ) 
     524         zsdenittot = glob_sum ( sdenit(:,:) * e1e2t(:,:) * tmask(:,:,1) ) 
     525         CALL iom_put( "tdenit" , ( zrdenittot + zsdenittot ) * xfact3 )  ! Total denitrification molC/l to molN/m3  
     526      ENDIF 
     527      ! 
    532528      IF( ln_check_mass .AND. kt == nitend ) THEN   ! Compute the budget of NO3, ALK, Si, Fer 
    533529         t_atm_co2_flx  = t_atm_co2_flx / glob_sum( e1e2t(:,:) ) 
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/NEMO/TOP_SRC/PISCES/SED/sedco3.F90

    r5215 r8841  
    7575 
    7676      DO jk = 1, jpksed 
    77 10001    CONTINUE 
    78          IF( itime <= 2 ) THEN 
     77         DO WHILE( itime <= 2 ) 
    7978            lconv  = .FALSE. 
    8079            IF( itime > 0 ) THEN   
     
    154153!                     WRITE(numsed,*) '    with re-initialization of initial PH field '        
    155154                     itime = 2 
    156                      GOTO 10001 
    157155                  ELSE 
    158156!                     WRITE(numsed,*) ' convergence after iter =', jiter, ' iterations ;  res =',zresm  
     
    165163!                     &               '  after iter =', jiter, ' iterations ;  res =',zresm   
    166164!                  WRITE(numsed,*) ' ' 
    167                   itime = 0 
     165                  itime = 3 
    168166               ENDIF 
    169167            ELSE 
     
    172170               IF ( itime == 1 ) THEN 
    173171                  WRITE(numsed,*) ' try one more time with more iterations and higher relax. value' 
    174                   GOTO 10001 
    175172               ELSE IF ( itime == 2 ) THEN 
    176173                  WRITE(numsed,*) ' try one more time for with more iterations, higher relax. value'                
     
    181178               ENDIF 
    182179            ENDIF 
    183          ENDIF 
     180         ENDDO ! End of WHILE LOOP 
    184181     ENDDO 
    185182 
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/NEMO/TOP_SRC/PISCES/sms_pisces.F90

    r7646 r8841  
    9797   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   xfracal    !: ?? 
    9898   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   nitrfac    !: ?? 
     99   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   nitrfac2   !: ?? 
    99100   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   orem       !: ?? 
    100101   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   xdiss      !: ?? 
     
    159160         ! 
    160161         !*  SMS for the organic matter 
    161          ALLOCATE( xfracal (jpi,jpj,jpk), nitrfac(jpi,jpj,jpk) ,    & 
    162             &      orem    (jpi,jpj,jpk),                           & 
    163             &      prodcal(jpi,jpj,jpk), xdiss   (jpi,jpj,jpk),    & 
     162         ALLOCATE( xfracal (jpi,jpj,jpk), orem(jpi,jpj,jpk)    ,    & 
     163            &      nitrfac(jpi,jpj,jpk), nitrfac2(jpi,jpj,jpk) ,    & 
     164            &      prodcal(jpi,jpj,jpk) , xdiss   (jpi,jpj,jpk),    & 
    164165            &      prodpoc(jpi,jpj,jpk) , conspoc(jpi,jpj,jpk) ,    & 
    165166            &      prodgoc(jpi,jpj,jpk) , consgoc(jpi,jpj,jpk) ,  STAT=ierr(4) ) 
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/NEMO/TOP_SRC/TRP/trcnxt.F90

    r7753 r8841  
    4444   PUBLIC   trc_nxt          ! routine called by step.F90 
    4545 
     46   REAL(wp) ::   rfact1, rfact2 
     47 
    4648   !!---------------------------------------------------------------------- 
    4749   !! NEMO/TOP 3.3 , NEMO Consortium (2010) 
     
    104106      ENDIF 
    105107      !                                ! Leap-Frog + Asselin filter time stepping 
    106       IF( neuler == 0 .AND. kt == nittrc000 ) THEN    ! Euler time-stepping at first time-step (only swap) 
     108      IF( (neuler == 0 .AND. kt == nittrc000) .OR. ln_top_euler ) THEN    ! Euler time-stepping (only swap) 
    107109         DO jn = 1, jptra 
    108110            DO jk = 1, jpkm1 
    109111               trn(:,:,jk,jn) = tra(:,:,jk,jn) 
     112               trb(:,:,jk,jn) = trn(:,:,jk,jn)   
    110113            END DO 
    111114         END DO 
    112       ELSE                                            ! Asselin filter + swap 
    113          IF( ln_linssh ) THEN   ;   CALL tra_nxt_fix( kt, nittrc000,         'TRC', trb, trn, tra, jptra )  !     linear ssh 
    114          ELSE                   ;   CALL tra_nxt_vvl( kt, nittrc000, rdttrc, 'TRC', trb, trn, tra,      & 
    115            &                                                                   sbc_trc, sbc_trc_b, jptra )  ! non-linear ssh 
     115      ELSE      
     116         IF( .NOT. l_offline ) THEN ! Leap-Frog + Asselin filter time stepping 
     117            IF( ln_linssh ) THEN   ;   CALL tra_nxt_fix( kt, nittrc000,         'TRC', trb, trn, tra, jptra )  !     linear ssh 
     118            ELSE                   ;   CALL tra_nxt_vvl( kt, nittrc000, rdttrc, 'TRC', trb, trn, tra,      & 
     119              &                                                                   sbc_trc, sbc_trc_b, jptra )  ! non-linear ssh 
     120            ENDIF 
     121         ELSE 
     122                                       CALL trc_nxt_off( kt )       ! offline  
    116123         ENDIF 
    117124         ! 
     
    143150      ! 
    144151   END SUBROUTINE trc_nxt 
     152 
     153 
     154   SUBROUTINE trc_nxt_off( kt ) 
     155      !!---------------------------------------------------------------------- 
     156      !!                   ***  ROUTINE tra_nxt_vvl  *** 
     157      !! 
     158      !! ** Purpose :   Time varying volume: apply the Asselin time filter   
     159      !!                and swap the tracer fields. 
     160      !!  
     161      !! ** Method  : - Apply a thickness weighted Asselin time filter on now fields. 
     162      !!              - save in (ta,sa) a thickness weighted average over the three  
     163      !!             time levels which will be used to compute rdn and thus the semi- 
     164      !!             implicit hydrostatic pressure gradient (ln_dynhpg_imp = T) 
     165      !!              - swap tracer fields to prepare the next time_step. 
     166      !!                This can be summurized for tempearture as: 
     167      !!             ztm = ( e3t_n*tn + rbcp*[ e3t_b*tb - 2 e3t_n*tn + e3t_a*ta ] )   ln_dynhpg_imp = T 
     168      !!                  /( e3t_n    + rbcp*[ e3t_b    - 2 e3t_n    + e3t_a    ] )    
     169      !!             ztm = 0                                                       otherwise 
     170      !!             tb  = ( e3t_n*tn + atfp*[ e3t_b*tb - 2 e3t_n*tn + e3t_a*ta ] ) 
     171      !!                  /( e3t_n    + atfp*[ e3t_b    - 2 e3t_n    + e3t_a    ] ) 
     172      !!             tn  = ta  
     173      !!             ta  = zt        (NB: reset to 0 after eos_bn2 call) 
     174      !! 
     175      !! ** Action  : - (tb,sb) and (tn,sn) ready for the next time step 
     176      !!              - (ta,sa) time averaged (t,s)   (ln_dynhpg_imp = T) 
     177      !!---------------------------------------------------------------------- 
     178      INTEGER , INTENT(in   )   ::  kt       ! ocean time-step index 
     179      !!      
     180      INTEGER  ::   ji, jj, jk, jn              ! dummy loop indices 
     181      REAL(wp) ::   ztc_a , ztc_n , ztc_b , ztc_f , ztc_d    ! local scalar 
     182      REAL(wp) ::   ze3t_b, ze3t_n, ze3t_a, ze3t_f, ze3t_d   !   -      - 
     183      !!---------------------------------------------------------------------- 
     184      ! 
     185      IF( kt == nittrc000 )  THEN 
     186         IF(lwp) WRITE(numout,*) 
     187         IF(lwp) WRITE(numout,*) 'trc_nxt_off : time stepping' 
     188         IF(lwp) WRITE(numout,*) '~~~~~~~~~~~' 
     189         IF( .NOT. ln_linssh ) THEN 
     190            rfact1 = atfp * rdttrc 
     191            rfact2 = rfact1 / rau0 
     192         ENDIF 
     193        !   
     194      ENDIF 
     195      ! 
     196      DO jn = 1, jptra       
     197         DO jk = 1, jpkm1 
     198            DO jj = 1, jpj 
     199               DO ji = 1, jpi 
     200                  ze3t_b = e3t_b(ji,jj,jk) 
     201                  ze3t_n = e3t_n(ji,jj,jk) 
     202                  ze3t_a = e3t_a(ji,jj,jk) 
     203                  !                                         ! tracer content at Before, now and after 
     204                  ztc_b  = trb(ji,jj,jk,jn) * ze3t_b 
     205                  ztc_n  = trn(ji,jj,jk,jn) * ze3t_n 
     206                  ztc_a  = tra(ji,jj,jk,jn) * ze3t_a 
     207                  ! 
     208                  ze3t_d = ze3t_a - 2. * ze3t_n + ze3t_b 
     209                  ztc_d  = ztc_a  - 2. * ztc_n  + ztc_b 
     210                  ! 
     211                  ze3t_f = ze3t_n + atfp * ze3t_d 
     212                  ztc_f  = ztc_n  + atfp * ztc_d 
     213                  ! 
     214                  IF( .NOT. ln_linssh .AND. jk == mikt(ji,jj) ) THEN           ! first level  
     215                     ze3t_f = ze3t_f - rfact2 * ( emp_b(ji,jj)      - emp(ji,jj)   )  
     216                     ztc_f  = ztc_f  - rfact1 * ( sbc_trc(ji,jj,jn) - sbc_trc_b(ji,jj,jn) ) 
     217                  ENDIF 
     218 
     219                  ze3t_f = 1.e0 / ze3t_f 
     220                  trb(ji,jj,jk,jn) = ztc_f * ze3t_f       ! ptb <-- ptn filtered 
     221                  trn(ji,jj,jk,jn) = tra(ji,jj,jk,jn)     ! ptn <-- pta 
     222                  ! 
     223               END DO 
     224            END DO 
     225         END DO 
     226         !  
     227      END DO 
     228      ! 
     229   END SUBROUTINE trc_nxt_off 
    145230 
    146231#else 
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/NEMO/TOP_SRC/oce_trc.F90

    r7646 r8841  
    77   !!             2.0  !  2007-12 (C. Ethe, G. Madec)  rewritting 
    88   !!---------------------------------------------------------------------- 
    9 #if defined key_top 
    10    !!---------------------------------------------------------------------- 
    11    !!   'key_top'                                                TOP models 
    12    !!---------------------------------------------------------------------- 
    13    ! 
    149   !                                            !* Domain size * 
    1510   USE par_oce , ONLY :   jpi      =>   jpi        !: first  dimension of grid --> i  
     
    117112   USE zdfmxl , ONLY :   hmlpt       =>   hmlpt       !: mixed layer depth at t-points (m) 
    118113 
    119 #else 
    120    !!---------------------------------------------------------------------- 
    121    !!  Empty module :                                     No passive tracer 
    122    !!---------------------------------------------------------------------- 
    123 #endif 
    124  
    125    !!---------------------------------------------------------------------- 
    126    !! NEMO/TOP 3.3 , NEMO Consortium (2010) 
    127    !! $Id$ 
    128    !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 
    129    !!====================================================================== 
    130114END MODULE oce_trc 
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/NEMO/TOP_SRC/prtctl_trc.F90

    r7646 r8841  
    66   !! History :    -   !  2005-07  (C. Talandier) original code for OPA 
    77   !!             1.0  !  2005-10  (C. Ethe     ) adapted to passive tracer 
    8    !!---------------------------------------------------------------------- 
    9 #if defined key_top 
    10    !!---------------------------------------------------------------------- 
    11    !!   'key_top'                                                TOP models 
    128   !!---------------------------------------------------------------------- 
    139   !!   prt_ctl_trc      :   control print in mpp for passive tracers 
     
    299295   END SUBROUTINE prt_ctl_trc_init 
    300296 
    301 #else 
    302    !!---------------------------------------------------------------------- 
    303    !!   Dummy module :                                    NO passive tracer 
    304    !!---------------------------------------------------------------------- 
    305 #endif 
    306   
    307    !!---------------------------------------------------------------------- 
    308    !! NEMO/TOP 3.3 , NEMO Consortium (2010) 
    309    !! $Id$  
    310    !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 
    311    !!======================================================================    
    312297END MODULE prtctl_trc 
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/NEMO/TOP_SRC/trc.F90

    r7646 r8841  
    88   !!   NEMO      1.0  !  2004-03  (C. Ethe)  Free form and module 
    99   !!---------------------------------------------------------------------- 
    10 #if defined key_top 
    11    !!---------------------------------------------------------------------- 
    12    !!   'key_top'                                                TOP models 
    13    !!---------------------------------------------------------------------- 
    1410   USE par_oce 
    1511   USE par_trc 
    16    USE bdy_oce, only: ln_bdy, nb_bdy, OBC_DATA 
     12   USE bdy_oce, only: jp_bdy, ln_bdy, nb_bdy, OBC_DATA 
    1713    
    1814   IMPLICIT NONE 
     
    173169# endif 
    174170   ! 
    175    CHARACTER(len=20), PUBLIC, ALLOCATABLE,  SAVE,  DIMENSION(:)   ::  cn_trc_dflt          ! Default OBC condition for all tracers 
    176    CHARACTER(len=20), PUBLIC, ALLOCATABLE,  SAVE,  DIMENSION(:)   ::  cn_trc               ! Choice of boundary condition for tracers 
    177    INTEGER,           PUBLIC, ALLOCATABLE,  SAVE,  DIMENSION(:)   ::  nn_trcdmp_bdy        !: =T Tracer damping 
     171   CHARACTER(len=20), PUBLIC, DIMENSION(jp_bdy) :: cn_trc_dflt   ! Default OBC condition for all tracers 
     172   CHARACTER(len=20), PUBLIC, DIMENSION(jp_bdy) :: cn_trc        ! Choice of boundary condition for tracers 
     173   INTEGER,           PUBLIC, DIMENSION(jp_bdy) :: nn_trcdmp_bdy !: =T Tracer damping 
     174!$AGRIF_DO_NOT_TREAT 
    178175   ! External data structure of BDY for TOP. Available elements: cn_obc, ll_trc, trcnow, dmp 
    179176   TYPE(OBC_DATA),    PUBLIC, ALLOCATABLE, DIMENSION(:,:), TARGET ::  trcdta_bdy           !: bdy external data (local process) 
    180    ! 
    181  
     177!$AGRIF_END_DO_NOT_TREAT 
    182178   !!---------------------------------------------------------------------- 
    183179   !! NEMO/TOP 3.3.1 , NEMO Consortium (2010) 
     
    210206      ! 
    211207      IF ( ln_bdy ) THEN 
    212          ALLOCATE( cn_trc_dflt(nb_bdy)   , cn_trc(nb_bdy)     , nn_trcdmp_bdy(nb_bdy) ,       & 
    213          &      trcdta_bdy(jptra,nb_bdy)                                              ,       & 
    214          &      STAT = ierr(2)  ) 
     208         ALLOCATE( trcdta_bdy(jptra, jp_bdy), STAT = ierr(2) ) 
    215209      ENDIF 
    216210      ! 
     
    224218   END FUNCTION trc_alloc 
    225219 
    226 #else 
    227    !!---------------------------------------------------------------------- 
    228    !!  Empty module :                                     No passive tracer 
    229    !!---------------------------------------------------------------------- 
    230 #endif 
    231  
    232220   !!====================================================================== 
    233221END MODULE trc 
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/NEMO/TOP_SRC/trcdta.F90

    r7646 r8841  
    227227                     ik = mbkt(ji,jj)  
    228228                     IF( ik > 1 ) THEN 
    229                         zl = ( gdept_1d(ik) - gdept_n(ji,jj,ik) ) / ( gdept_1d(ik) - gdept_1d(ik-1) ) 
     229                        zl = ( gdept_1d(ik) - gdept_0(ji,jj,ik) ) / ( gdept_1d(ik) - gdept_1d(ik-1) ) 
    230230                        ptrcdta(ji,jj,ik) = (1.-zl) * ptrcdta(ji,jj,ik) + zl * ptrcdta(ji,jj,ik-1) 
    231231                     ENDIF 
    232232                     ik = mikt(ji,jj) 
    233233                     IF( ik > 1 ) THEN 
    234                         zl = ( gdept_n(ji,jj,ik) - gdept_1d(ik) ) / ( gdept_1d(ik+1) - gdept_1d(ik) ) 
     234                        zl = ( gdept_0(ji,jj,ik) - gdept_1d(ik) ) / ( gdept_1d(ik+1) - gdept_1d(ik) ) 
    235235                        ptrcdta(ji,jj,ik) = (1.-zl) * ptrcdta(ji,jj,ik) + zl * ptrcdta(ji,jj,ik+1) 
    236236                     ENDIF 
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/NEMO/TOP_SRC/trcini.F90

    r7753 r8841  
    6969      ! 
    7070      CALL trc_ini_sms   ! SMS 
    71       CALL trc_ini_inv   ! Inventories 
    7271      CALL trc_ini_trp   ! passive tracers transport 
    7372      CALL trc_ice_ini   ! Tracers in sea ice 
     
    7877      IF( nn_dttrc /= 1 ) & 
    7978      CALL trc_sub_ini    ! Initialize variables for substepping passive tracers 
     79      ! 
     80      CALL trc_ini_inv   ! Inventories 
    8081      ! 
    8182      IF( nn_timing == 1 )   CALL timing_stop('trc_init') 
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/SETTE/BATCH_TEMPLATE/batch-ALTIX_NAUTILUS_MPT

    r3631 r8841  
    6565  export INPUT_DIR=DEF_INPUT_DIR 
    6666  export CONFIG_DIR=DEF_CONFIG_DIR 
     67  export TOOLS_DIR=DEF_TOOLS_DIR 
    6768  export NEMO_VALIDATION_DIR=DEF_NEMO_VALIDATION 
    6869  export NEW_CONF=DEF_NEW_CONF 
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/SETTE/BATCH_TEMPLATE/batch-IBM_EKMAN_INGV

    r5301 r8841  
    4747  export INPUT_DIR=DEF_INPUT_DIR 
    4848  export CONFIG_DIR=DEF_CONFIG_DIR 
     49  export TOOLS_DIR=DEF_TOOLS_DIR 
    4950  export NEMO_VALIDATION_DIR=DEF_NEMO_VALIDATION 
    5051  export NEW_CONF=DEF_NEW_CONF 
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/SETTE/BATCH_TEMPLATE/batch-PW6_CALYPSO

    r3294 r8841  
    4343  export INPUT_DIR=DEF_INPUT_DIR 
    4444  export CONFIG_DIR=DEF_CONFIG_DIR 
     45  export TOOLS_DIR=DEF_TOOLS_DIR 
    4546  export NEMO_VALIDATION_DIR=DEF_NEMO_VALIDATION 
    4647  export NEW_CONF=DEF_NEW_CONF 
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/SETTE/BATCH_TEMPLATE/batch-PW7_METO

    r4285 r8841  
    4848  export INPUT_DIR=DEF_INPUT_DIR 
    4949  export CONFIG_DIR=DEF_CONFIG_DIR 
     50  export TOOLS_DIR=DEF_TOOLS_DIR 
    5051  export NEMO_VALIDATION_DIR=DEF_NEMO_VALIDATION 
    5152  export NEW_CONF=DEF_NEW_CONF 
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/SETTE/BATCH_TEMPLATE/batch-PW7_MONSOON

    r5029 r8841  
    4747  export INPUT_DIR=DEF_INPUT_DIR 
    4848  export CONFIG_DIR=DEF_CONFIG_DIR 
     49  export TOOLS_DIR=DEF_TOOLS_DIR 
    4950  export NEMO_VALIDATION_DIR=DEF_NEMO_VALIDATION 
    5051  export NEW_CONF=DEF_NEW_CONF 
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/SETTE/BATCH_TEMPLATE/batch-X64_ADA

    r7715 r8841  
    1111# @ total_tasks = NPROCS 
    1212# time 
    13 # @ wall_clock_limit = 1:30:00 
     13# @ wall_clock_limit = 00:59:00 
    1414# @ queue 
    1515 
     
    4444  export INPUT_DIR=DEF_INPUT_DIR 
    4545  export CONFIG_DIR=DEF_CONFIG_DIR 
     46  export TOOLS_DIR=DEF_TOOLS_DIR 
    4647  export NEMO_VALIDATION_DIR=DEF_NEMO_VALIDATION 
    4748  export NEW_CONF=DEF_NEW_CONF 
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/SETTE/BATCH_TEMPLATE/batch-X64_ADA_DEBUG

    r7715 r8841  
    1111# @ total_tasks = NPROCS 
    1212# time 
    13 # @ wall_clock_limit = 1:30:00 
     13# @ wall_clock_limit = 00:59:00 
    1414# @ queue 
    1515 
     
    4444  export INPUT_DIR=DEF_INPUT_DIR 
    4545  export CONFIG_DIR=DEF_CONFIG_DIR 
     46  export TOOLS_DIR=DEF_TOOLS_DIR 
    4647  export NEMO_VALIDATION_DIR=DEF_NEMO_VALIDATION 
    4748  export NEW_CONF=DEF_NEW_CONF 
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/SETTE/BATCH_TEMPLATE/batch-X64_ADA_O0

    r7715 r8841  
    1111# @ total_tasks = NPROCS 
    1212# time 
    13 # @ wall_clock_limit = 1:30:00 
     13# @ wall_clock_limit = 00:59:00 
    1414# @ queue 
    1515 
     
    4545  export INPUT_DIR=DEF_INPUT_DIR 
    4646  export CONFIG_DIR=DEF_CONFIG_DIR 
     47  export TOOLS_DIR=DEF_TOOLS_DIR 
    4748  export NEMO_VALIDATION_DIR=DEF_NEMO_VALIDATION 
    4849  export NEW_CONF=DEF_NEW_CONF 
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/SETTE/BATCH_TEMPLATE/batch-X64_CURIE

    r5407 r8841  
    4545  export INPUT_DIR=DEF_INPUT_DIR 
    4646  export CONFIG_DIR=DEF_CONFIG_DIR 
     47  export TOOLS_DIR=DEF_TOOLS_DIR 
    4748  export NEMO_VALIDATION_DIR=DEF_NEMO_VALIDATION 
    4849  export NEW_CONF=DEF_NEW_CONF 
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/SETTE/BATCH_TEMPLATE/batch-X64_MOBILIS

    r7646 r8841  
    4242  export INPUT_DIR=DEF_INPUT_DIR 
    4343  export CONFIG_DIR=DEF_CONFIG_DIR 
     44  export TOOLS_DIR=DEF_TOOLS_DIR 
    4445  export NEMO_VALIDATION_DIR=DEF_NEMO_VALIDATION 
    4546  export NEW_CONF=DEF_NEW_CONF 
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/SETTE/BATCH_TEMPLATE/batch-XC40_METO

    r6140 r8841  
    4040  export INPUT_DIR=DEF_INPUT_DIR 
    4141  export CONFIG_DIR=DEF_CONFIG_DIR 
     42  export TOOLS_DIR=DEF_TOOLS_DIR 
    4243  export NEMO_VALIDATION_DIR=DEF_NEMO_VALIDATION 
    4344  export NEW_CONF=DEF_NEW_CONF 
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/SETTE/BATCH_TEMPLATE/batch-XC_ARCHER_INTEL

    r4814 r8841  
    5050  export INPUT_DIR=DEF_INPUT_DIR 
    5151  export CONFIG_DIR=DEF_CONFIG_DIR 
     52  export TOOLS_DIR=DEF_TOOLS_DIR 
    5253  export NEMO_VALIDATION_DIR=DEF_NEMO_VALIDATION 
    5354  export NEW_CONF=DEF_NEW_CONF 
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/SETTE/BATCH_TEMPLATE/batch-ifort_athena

    r7646 r8841  
    4343  export INPUT_DIR=DEF_INPUT_DIR 
    4444  export CONFIG_DIR=DEF_CONFIG_DIR 
     45  export TOOLS_DIR=DEF_TOOLS_DIR 
    4546  export NEMO_VALIDATION_DIR=DEF_NEMO_VALIDATION 
    4647  export NEW_CONF=DEF_NEW_CONF 
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/SETTE/BATCH_TEMPLATE/batch-ifort_athena_xios

    r7646 r8841  
    4949  export INPUT_DIR=DEF_INPUT_DIR 
    5050  export CONFIG_DIR=DEF_CONFIG_DIR 
     51  export TOOLS_DIR=DEF_TOOLS_DIR 
    5152  export NEMO_VALIDATION_DIR=DEF_NEMO_VALIDATION 
    5253  export NEW_CONF=DEF_NEW_CONF 
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/SETTE/BATCH_TEMPLATE/batch-macport_osx

    r4147 r8841  
    4444  export INPUT_DIR=DEF_INPUT_DIR 
    4545  export CONFIG_DIR=DEF_CONFIG_DIR 
     46  export TOOLS_DIR=DEF_TOOLS_DIR 
    4647  export NEMO_VALIDATION_DIR=DEF_NEMO_VALIDATION 
    4748  export NEW_CONF=DEF_NEW_CONF 
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/SETTE/BATCH_TEMPLATE/batch-macport_osx_debug

    r7646 r8841  
    4444  export INPUT_DIR=DEF_INPUT_DIR 
    4545  export CONFIG_DIR=DEF_CONFIG_DIR 
     46  export TOOLS_DIR=DEF_TOOLS_DIR 
    4647  export NEMO_VALIDATION_DIR=DEF_NEMO_VALIDATION 
    4748  export NEW_CONF=DEF_NEW_CONF 
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/SETTE/BATCH_TEMPLATE/batch-mpmd-ALTIX_NAUTILUS_MPT

    r3736 r8841  
    6868  export INPUT_DIR=DEF_INPUT_DIR 
    6969  export CONFIG_DIR=DEF_CONFIG_DIR 
     70  export TOOLS_DIR=DEF_TOOLS_DIR 
    7071  export NEMO_VALIDATION_DIR=DEF_NEMO_VALIDATION 
    7172  export NEW_CONF=DEF_NEW_CONF 
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/SETTE/BATCH_TEMPLATE/batch-openmpi_NAVITI_MERCATOR

    r5559 r8841  
    4040  export INPUT_DIR=DEF_INPUT_DIR 
    4141  export CONFIG_DIR=DEF_CONFIG_DIR 
     42  export TOOLS_DIR=DEF_TOOLS_DIR 
    4243  export NEMO_VALIDATION_DIR=DEF_NEMO_VALIDATION 
    4344  export NEW_CONF=DEF_NEW_CONF 
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/SETTE/BATCH_TEMPLATE/sette_batch_template

    r3608 r8841  
    4444  export INPUT_DIR=DEF_INPUT_DIR 
    4545  export CONFIG_DIR=DEF_CONFIG_DIR 
     46  export TOOLS_DIR=DEF_TOOLS_DIR 
    4647  export NEMO_VALIDATION_DIR=DEF_NEMO_VALIDATION 
    4748  export NEW_CONF=DEF_NEW_CONF 
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/SETTE/all_functions.sh

    r7715 r8841  
    172172echo "COMPILER is : ${CMP_NAM}" 
    173173echo "TEST is : ${TEST_NAME}" 
     174echo "TOOLS directory is : ${TOOLS_DIR}" 
    174175################################################################ 
    175176# SMALL DEBUG 
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/SETTE/prepare_job.sh

    r7753 r8841  
    151151fi 
    152152################################################################ 
    153  
    154 ########################################################################## 
    155 # COPY RESTART FILES (if needed; i.e. only for SHORT job in RESTART TESTS) 
    156 # get the input tarfile if needed 
    157 # SF : not ok for the moment because at this point is needed cn_exp variable, 
    158 # SF : here it it not known. 
    159 #\cd ${EXE_DIR} 
    160 #if [ "$(echo ${TEST_NAME} | grep -c "SHORT" )" -ne 0 ] ; then 
    161 #    for (( i=1; i<=${NB_PROC}; ${NB_PROC}++)) ; do 
    162 #        L_NPROC=`printf "%04d\n" $i` 
    163 #        ln -sf ../LONG/${NEW_CONF}_00000060_restart_${L_NPROC-1}.nc . 
    164 #    done 
    165 #fi 
    166 ## SF : other way 
    167 ##      for file in ../LONG/${NEW_CONF}_*restart_0*.nc ; do 
    168 ##              ncpu=`echo $file | awk -F '_' '{print $NF}' | cut -f 1 -d '.'` 
    169 ##              ln -sf ${file}  . 
    170 ##      done 
    171 ##fi 
    172 ########################################################################## 
    173153 
    174154################################################################ 
     
    309289             -e"s:DEF_EXE_DIR:${EXE_DIR}:" \ 
    310290             -e"s:DEF_CONFIG_DIR:${CONFIG_DIR}:" \ 
     291             -e"s:DEF_TOOLS_DIR:${TOOLS_DIR}:" \ 
    311292             -e"s:MPI_FLAG:${MPI_FLAG}:" \ 
    312293             -e"s:DEF_NEMO_VALIDATION:${NEMO_VALIDATION_DIR}:" -e"s:DEF_NEW_CONF:${NEW_CONF}:" \ 
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/SETTE/sette.sh

    r7756 r8841  
    144144 
    145145for config in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 
    146  
    147146do 
    148147 
     
    661660    export TEST_NAME="LONG" 
    662661    cd ${CONFIG_DIR0} 
    663     . ./makenemo -m ${CMP_NAM} -n AMM12_LONG -r AMM12 -j 8 add_key "key_tide" del_key ${DEL_KEYS} 
     662    . ./makenemo -m ${CMP_NAM} -n AMM12_LONG -r AMM12 -j 8 del_key ${DEL_KEYS} 
    664663    cd ${SETTE_DIR} 
    665664    . ./param.cfg 
     
    800799    set_namelist namelist_cfg cn_exp \"SAS\" 
    801800    set_namelist namelist_cfg nn_it000 1 
    802     set_namelist namelist_cfg nn_itend 100 
    803     set_namelist namelist_cfg nn_stock 50 
     801    set_namelist namelist_cfg nn_itend 240 
     802    set_namelist namelist_cfg nn_stock 120 
    804803    set_namelist namelist_cfg ln_ctl .false. 
    805804    set_namelist namelist_cfg ln_clobber .true. 
     
    823822    cd ${EXE_DIR} 
    824823    set_namelist namelist_cfg cn_exp \"SAS\" 
    825     set_namelist namelist_cfg nn_it000 51 
    826     set_namelist namelist_cfg nn_itend 100 
     824    set_namelist namelist_cfg nn_it000 121 
     825    set_namelist namelist_cfg nn_itend 240 
    827826    set_namelist namelist_cfg ln_ctl .false. 
    828827    set_namelist namelist_cfg ln_clobber .true. 
     
    835834    set_namelist namelist_cfg ln_rstart .true. 
    836835    set_namelist namelist_cfg nn_rstctl 2 
    837     set_namelist namelist_ice_cfg cn_icerst_in \"SAS_00000050_restart_ice\" 
     836    set_namelist namelist_cfg nn_date0 010106 
     837    set_namelist namelist_cfg cn_ocerst_in \"SAS_00000120_restart\" 
     838    set_namelist namelist_ice_cfg cn_icerst_in \"SAS_00000120_restart_ice\" 
    838839    if [ ${USING_MPMD} == "yes" ] ; then 
    839840       set_xio_using_server iodef.xml true 
     
    844845        L_NPROC=$(( $i - 1 )) 
    845846        L_NPROC=`printf "%04d\n" ${L_NPROC}` 
    846         ln -sf ../LONG/SAS_00000050_restart_ice_${L_NPROC}.nc . 
     847        ln -sf ../LONG/SAS_00000120_restart_${L_NPROC}.nc . 
     848        ln -sf ../LONG/SAS_00000120_restart_ice_${L_NPROC}.nc . 
    847849    done 
    848850    cd ${SETTE_DIR} 
     
    12191221    export TEST_NAME="LONG" 
    12201222    cd ${CONFIG_DIR0} 
    1221     . ./makenemo -m ${CMP_NAM} -n ORCA2AGUL_LONG -r ORCA2_LIM3_PISCES -d "OPA_SRC LIM_SRC_3 NST_SRC" -j 8 add_key "key_agrif" del_key "key_zdftmx key_top" 
     1223    . ./makenemo -m ${CMP_NAM} -n ORCA2AGUL_LONG -r ORCA2_LIM3_PISCES -d "OPA_SRC LIM_SRC_3 NST_SRC" -j 8 add_key "key_agrif key_zdftmx" del_key "key_zdftmx_new key_top" 
    12221224    cd ${SETTE_DIR} 
    12231225    . ./param.cfg 
     
    12451247    set_namelist 1_namelist_cfg nn_itend 300 
    12461248    set_namelist 1_namelist_cfg nn_stock 150 
     1249    set_namelist 1_namelist_cfg nn_fsbc 1 
    12471250    set_namelist 1_namelist_cfg ln_ctl .false. 
    12481251    set_namelist 1_namelist_cfg ln_clobber .true. 
     
    12831286    set_namelist 1_namelist_cfg nn_itend 300 
    12841287    set_namelist 1_namelist_cfg nn_stock 150 
     1288    set_namelist 1_namelist_cfg nn_fsbc 1 
    12851289    set_namelist 1_namelist_cfg ln_rstart .true. 
    12861290    set_namelist 1_namelist_cfg nn_rstctl 2 
     
    12931297    set_namelist namelist_ice_cfg cn_icerst_in \"O2LP_LONG_00000075_restart_ice\" 
    12941298    set_namelist 1_namelist_cfg cn_ocerst_in \"O2LP_LONG_00000150_restart\" 
     1299    set_namelist 1_namelist_ice_cfg cn_icerst_in \"O2LP_LONG_00000150_restart_ice\" 
    12951300 
    12961301    for (( i=1; i<=$NPROC; i++)) ; do 
     
    13001305        ln -sf ../LONG/O2LP_LONG_00000075_restart_ice_${L_NPROC}.nc . 
    13011306        ln -sf ../LONG/1_O2LP_LONG_00000150_restart_${L_NPROC}.nc . 
     1307        ln -sf ../LONG/1_O2LP_LONG_00000150_restart_ice_${L_NPROC}.nc . 
    13021308    done 
    13031309    if [ ${USING_MPMD} == "yes" ] ; then 
     
    13161322    export TEST_NAME="REPRO_4_4" 
    13171323    cd ${CONFIG_DIR0} 
    1318     . ./makenemo -m ${CMP_NAM} -n ORCA2AGUL_16 -r ORCA2_LIM3_PISCES -d "OPA_SRC LIM_SRC_3 NST_SRC" -j 8 add_key "key_agrif" del_key "key_zdftmx key_top" 
     1324    . ./makenemo -m ${CMP_NAM} -n ORCA2AGUL_16 -r ORCA2_LIM3_PISCES -d "OPA_SRC LIM_SRC_3 NST_SRC" -j 8 add_key "key_agrif key_zdftmx" del_key "key_zdftmx_new key_top" 
    13191325    cd ${SETTE_DIR} 
    13201326    . ./param.cfg 
     
    13391345    set_namelist 1_namelist_cfg nn_it000 1 
    13401346    set_namelist 1_namelist_cfg nn_itend 150 
     1347    set_namelist 1_namelist_cfg nn_fsbc 1 
    13411348    set_namelist 1_namelist_cfg ln_ctl .false. 
    13421349    set_namelist 1_namelist_cfg ln_clobber .true. 
     
    13771384    set_namelist 1_namelist_cfg nn_it000 1 
    13781385    set_namelist 1_namelist_cfg nn_itend 150 
     1386    set_namelist 1_namelist_cfg nn_fsbc 1 
    13791387    set_namelist 1_namelist_cfg ln_ctl .false. 
    13801388    set_namelist 1_namelist_cfg ln_clobber .true. 
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/SETTE/sette_rpt.sh

    r7715 r8841  
    11#!/bin/bash -f 
     2#set -vx 
    23# 
    34# simple SETTE report generator. 
     
    1011######################### Start of function definitions ################################# 
    1112## 
     13 
     14function restfile() { 
     15# Rebuild ice restart for SAS CONFIG, and restartability checks. Expects LONG and SHORT run directories. 
     16# For Stand Alone Surface configuration ocean is not running, just run ice model; so no outputs ocean files. 
     17# Compares LONG rebuild restart ice file with equivalent entry from the SHORT rebuild restart ice file. 
     18# 
     19  vdir=$1 
     20  nam=$2 
     21  pass=$3 
     22# 
     23  if [ -d $vdir/$nam ]; then 
     24    dorv=`ls -1rt $vdir/$nam/$mach/ | tail -1l ` 
     25    dorv=`echo $dorv | sed -e 's:.*/::'` 
     26    rep1=`ls -1rt $vdir/$nam/$mach/$dorv/ | tail -2l | head -1 ` 
     27    rep2=`ls -1rt $vdir/$nam/$mach/$dorv/ | tail -1l` 
     28    cd ${SAS_RESTART_DIR}/LONG 
     29    #SF add here compilation of rebuild_tools to rebuild restart files, and add comparison of restart files 
     30    cd ${TOOLS_DIR} 
     31    ./maketools -n REBUILD_NEMO -m ${mach} > /dev/null 2>&1 
     32    cd ${TOOLS_DIR}/REBUILD_NEMO 
     33    #SF echo "REBUILD LONG restart SAS files, without standard output" 
     34    ./rebuild_nemo -t 4 ../../CONFIG/SAS_LONG/LONG/SAS_00000100_restart_ice  $NPROC > /dev/null 2>&1 
     35    #SF echo "REBUILD SHORT restart SAS files, without standard output" 
     36    ./rebuild_nemo -t 4 ../../CONFIG/SAS_LONG/SHORT/SAS_00000100_restart_ice $NPROC >&- 
     37    cd ${SAS_RESTART_DIR}/LONG 
     38    #SF echo "COPY rebuild restart files" 
     39    cp SAS_00000100_restart_ice.nc $vdir/$nam/$mach/$dorv/LONG/. 
     40    cp ../SHORT/SAS_00000100_restart_ice.nc $vdir/$nam/$mach/$dorv/SHORT/. 
     41 
     42    f1o=$vdir/$nam/$mach/$dorv/LONG/SAS_00000100_restart_ice.nc 
     43    f2o=$vdir/$nam/$mach/$dorv/SHORT/SAS_00000100_restart_ice.nc 
     44    if  [ ! -f $f1o ] &&  [ ! -f $f2o ] ; then 
     45      printf "%-20s %s\n" $nam " REBUILD SAS restart ice DOES NOT exists; incomplete test"; 
     46      return; 
     47    fi 
     48    # 
     49    done_oce=0 
     50    # 
     51    if  [  -f $f1o ] && [  -f $f2o ]; then 
     52      cmp -s $f1o $f2o  
     53      #SF  cmp SAS_00000100_restart_ice.nc  ../SHORT/SAS_00000100_restart_ice.nc  > diff_restart.txt 
     54      if [ $? == 0 ]; then 
     55        if [ $pass == 0 ]; then 
     56          printf "%-20s %s %s\n" $nam  " SAS restart files are IDENTICAL :  passed : " $dorv 
     57        fi 
     58      else 
     59        printf "%-20s %s %s\n" $nam  " SAS restart files are DIFFERENT : FAILED : " $dorv  
     60        # 
     61   # Offer view of differences on the second pass 
     62   # 
     63        if [ $pass == 1 ]; then 
     64          echo "BE CAREFUL:  NEED cdo to see differences!!!!! " 
     65          echo "DO which cdo and replace cdo PATH to the cdo command in SETTE_rpt.sh " 
     66          echo "IF cdo is not available you need to do difference of netcdf file by hand" 
     67          echo "<return> to view restart_ice.nc differences" 
     68          read y 
     69          cdo -diffv $f1o $f2o 
     70          done_oce=1 
     71          #echo "<return> to continue" 
     72          #read y 
     73        fi 
     74      fi 
     75    fi 
     76# 
     77fi 
     78} 
     79 
    1280function resttest() {  
    1381# 
     
    199267  mach=`grep "COMPILER=" ./sette.sh | sed -e 's/COMPILER=//'` 
    200268  NEMO_VALID=`grep "NEMO_VALIDATION_DIR=" ./param.cfg | sed -e 's/NEMO_VALIDATION_DIR=//'` 
     269# Directory to run the tests 
     270 SETTE_DIR=$(cd $(dirname "$0"); pwd) 
     271 MAIN_DIR=$(dirname $SETTE_DIR) 
     272 CONFIG_DIR0=${MAIN_DIR}/CONFIG 
     273 TOOLS_DIR=${MAIN_DIR}/TOOLS 
     274 COMPIL_DIR=${TOOLS_DIR}/COMPILE 
     275 NPROC=32 
     276 
     277  SAS_RESTART_DIR=${CONFIG_DIR0}/SAS_LONG 
    201278# 
    202279  if [ ! -d $NEMO_VALID ]; then 
     
    205282  fi 
    206283# 
     284 
    207285# The script also needs the date or revision tag. Currently this is taken from the latest sub-directory found in each directory 
    208286 
     
    212290 if [ $pass == 1 ]; then echo "---------------2nd pass------------------";fi 
    213291# 
     292 
     293# Rebuild and restartability test for SAS 
     294# 
     295 for restart_file in WSAS_LONG 
     296 do 
     297 #  restfile $SAS_RESTART_DIR LONG $pass 
     298   restfile $NEMO_VALID $restart_file $pass 
     299 done 
     300# 
    214301# Restartability test 
    215302# 
    216  for restart_test in WGYREPIS_LONG WORCA2LIM3PIS_LONG WORCA2OFFPIS_LONG WAMM12_LONG WSAS_LONG WISOMIP_LONG WORCA2AGUL_LONG 
     303 for restart_test in WGYREPIS_LONG WORCA2LIM3PIS_LONG WORCA2OFFPIS_LONG WAMM12_LONG WISOMIP_LONG WORCA2AGUL_LONG 
    217304 do 
    218305   resttest $NEMO_VALID $restart_test $pass 
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/TOOLS/COMPILE/Fadd_keys.sh

    r7646 r8841  
    6565 echo "Adding keys in : ${NEW_CONF}"  
    6666 for i in ${list_add_key} ; do 
    67    if [ "$(cat ${CONFIG_DIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm | grep -c "$i" )" -ne 0 ] ; then 
     67   if [ "$(cat ${CONFIG_DIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm | grep -c "\<$i\>" )" -ne 0 ] ; then 
    6868      echo "key $i already present in cpp_${NEW_CONF}.fcm"  
    6969   else 
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/TOOLS/COMPILE/Fdel_keys.sh

    r4990 r8841  
    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 
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/TOOLS/COMPILE/Fmake_WORK.sh

    r4990 r8841  
    105105done 
    106106 
    107 for i in `(cd ${ZCONF}/MY_SRC ; ls *.[Ffh]90 2>/dev/null ) ` 
     107for i in `(cd ${ZCONF}/MY_SRC ; \ls *.[Ffh]90 2>/dev/null ) ` 
    108108   do 
    109109      [ -f ${ZCONF}/MY_SRC/$i ] &&  ln -sf $PWD/${ZCONF}/MY_SRC/${i} ${ZCONF}/WORK/. 
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/TOOLS/DOMAINcfg/src/domzgr.f90

    r7200 r8841  
    20782078      hbatt(:,:) = zenv(:,:)  
    20792079      IF( MINVAL( gphit(:,:) ) * MAXVAL( gphit(:,:) ) <= 0._wp ) THEN 
     2080          IF ( jphgr_msh == 2 .OR. jphgr_msh == 3) CALL ctl_stop( 'dom:zgr_sco:  if jphgr_msh = 2 or 3 and  &  
     2081                                      & s-coordinates stop, if not correction at Equator is applied, but it is wrong') 
    20802082         CALL ctl_warn( ' s-coordinates are tapered in vicinity of the Equator' ) 
    20812083         DO jj = 1, jpj 
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/TOOLS/MISCELLANEOUS/chk_iomput.sh

    r4162 r8841  
    3737       echo '      ./chk_iomput.sh' 
    3838       echo '      ./chk_iomput.sh --help' 
    39        echo '      ./chk_iomput.sh ../../CONFIG/ORCA2_LIM/EXP00/iodef.xml "../../NEMO/OPA_SRC/ ../../NEMO/LIM_SRC_2/"' 
     39       echo '      ./chk_iomput.sh ../../CONFIG/ORCA2_LIM/EXP00/context_nemo.xml "../../NEMO/OPA_SRC/ ../../NEMO/LIM_SRC_2/"' 
    4040       echo 
    4141       exit ;; 
     
    5151done  
    5252# 
    53 [ ! -f "$xmlfile" ] && echo "$xmlfile not found, we stop..." && exit 
     53echo $xmlfile 
     54echo $srcdir 
     55 
     56for i in $xmlfile 
     57do 
     58    [ ! -f "$xmlfile" ] && echo "$xmlfile not found, we stop..." && exit 
     59done 
    5460for i in $srcdir  
    5561do 
     
    6066# 
    6167external=$( grep -c "<field_definition  *\([^ ].* \)*src=" $xmlfile ) 
    62 if [ $external -eq 1 ] 
     68if [ $external -ge 1 ] 
    6369then 
    6470    xmlfield_def=$( grep "<field_definition  *\([^ ].* \)*src=" $xmlfile | sed -e 's/.*src="\([^"]*\)".*/\1/' ) 
    65     xmlfield_def=$( dirname $xmlfile )/$xmlfield_def    
     71    tmp_def="" 
     72    for fdef in $xmlfield_def ; do tmp_def="$tmp_def $( dirname $xmlfile )/$fdef" ; done 
     73    xmlfield_def=$tmp_def 
     74    echo $xmlfield_def 
    6675else 
    6776    xmlfield_def=$xmlfile 
    6877fi 
     78external=$( grep -c "<file_definition  *\([^ ].* \)*src=" $xmlfile ) 
     79if [ $external -ge 1 ] 
     80then 
     81    xmlfile_def=$( grep "<file_definition  *\([^ ].* \)*src=" $xmlfile | sed -e 's/.*src="\([^"]*\)".*/\1/' ) 
     82    tmp_def="" 
     83    for fdef in $xmlfile_def ; do tmp_def="$tmp_def $( dirname $xmlfile )/$fdef" ; done 
     84    xmlfile_def=$tmp_def 
     85    echo $xmlfile_def 
     86else 
     87    xmlfile_def=$xmlfile 
     88fi 
     89 
    6990[ $inxml -eq 1 ] && grep "< *field  *\([^ ].* \)*id *=" $xmlfield_def 
    7091[ $insrc -eq 1 ] && find $srcdir -name "*.[Ffh]90" -exec grep -iH "^[^\!]*call  *iom_put *(" {} \; 
     
    95116# list of variables to be outputed in the xml file 
    96117# 
    97 varlistout=$( grep "< *field  *\([^ ].* \)*field_ref *=" $xmlfile  | sed -e "s/^.*< *field .*field_ref *= *[\"\']\([^\"\']*\)[\"\'].*/\1/" | sort -d ) 
     118varlistout=$( grep "< *field  *\([^ ].* \)*field_ref *=" $xmlfile_def  | sed -e "s/^.*< *field .*field_ref *= *[\"\']\([^\"\']*\)[\"\'].*/\1/" | sort -d ) 
    98119# 
    99120echo "--------------------------------------------------" 
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/TOOLS/MISCELLANEOUS/icb_pp.py

    r6423 r8841  
    1212# cases the missing instances are filled with invalid (NaN) values. 
    1313# 
     14# Version 2.0 August 2017. Adapted to process all variables and retain original 
     15#                          datatypes. (acc@noc.ac.uk) 
    1416 
    15 parser = ArgumentParser(description='produce collated trajectory file from distributed output\ 
    16                                      files, e.g. \n python ./icb_pp.py \ 
    17                                      -t  trajectory_icebergs_004248_ -n 296 -o trajsout.nc' ) 
     17parser = ArgumentParser(description='produce collated trajectory file \ 
     18                                     from distributed output files, e.g. \ 
     19                                     \n python ./icb_pp.py \ 
     20                                     -t  trajectory_icebergs_004248_ \ 
     21                                     -n 296 -o trajsout.nc' ) 
    1822 
    19 parser.add_argument('-t',dest='froot',help='fileroot_of_distrbuted_data; root name of \ 
    20                      distributed trajectory output (usually completed with XXXX.nc, where \ 
    21                      XXXX is the 4 digit processor number)',  
    22                      default='trajectory_icebergs_004248_') 
     23parser.add_argument('-t',dest='froot', 
     24                         help='fileroot_of_distrbuted_data; root name \ 
     25                               of  distributed trajectory output (usually \ 
     26                               completed with XXXX.nc, where  XXXX is the \ 
     27                               4 digit processor number)',  
     28                      default='trajectory_icebergs_004248_') 
    2329 
    2430parser.add_argument('-n',dest='fnum',help='number of distributed files to process',  
    25                      type=int, default=None) 
     31                         type=int, default=None) 
    2632 
    27 parser.add_argument('-o',dest='fout',help='collated_output_file; file name to receive the \ 
    28                      collated trajectory data', default='trajsout.nc') 
     33parser.add_argument('-o',dest='fout', 
     34                         help='collated_output_file; file name to receive \ 
     35                              the collated trajectory data', default='trajsout.nc') 
    2936 
    3037args = parser.parse_args() 
     
    6471# 
    6572for n in range(procnum): 
    66  nn = '%4.4d' % n 
    67  fw = Dataset(pathstart+nn+'.nc') 
    68  if len(fw.dimensions['n']) > 0: 
    69    print pathstart+nn+'.nc' 
    70    ic = fw.variables['iceberg_number'][:,0] 
    71    ts = fw.variables['timestep'][:] 
    72    icv = np.unique(ic) 
    73    ts = np.unique(ts) 
    74    print('Min Max ts: ',ts.min(), ts.max()) 
    75    print('Number unique icebergs= ',icv.shape[0]) 
    76    icu.append(icv) 
    77    times.append(ts) 
    78  fw.close() 
     73    nn = '%4.4d' % n 
     74    fw = Dataset(pathstart+nn+'.nc') 
     75    # keep a list of the variables in the first dataset 
     76    if n == 0: 
     77        varlist = fw.variables 
     78    # 
     79    # skip any files with no icebergs 
     80    if len(fw.dimensions['n']) > 0: 
     81        print pathstart+nn+'.nc' 
     82        ic = fw.variables['iceberg_number'][:,0] 
     83        ts = fw.variables['timestep'][:] 
     84        icv = np.unique(ic) 
     85        ts = np.unique(ts) 
     86        print('Min Max ts: ',ts.min(), ts.max()) 
     87        print('Number unique icebergs= ',icv.shape[0]) 
     88        icu.append(icv) 
     89        times.append(ts) 
     90    fw.close() 
    7991# 
    8092# Now flatten the lists and reduce to the unique spanning set 
     
    89101print('times range from:        ',times.min(), 'to: ', times.max()) 
    90102# 
    91 # Declare 2-D arrays to receive the data from all files 
     103# Declare array to receive data from all files 
    92104# 
    93105nt = times.shape[0] 
    94 lons = np.zeros((ntraj, nt)) 
    95 lats = np.zeros((ntraj, nt)) 
    96 tims = np.zeros((ntraj, nt)) 
    97 xis  = np.zeros((ntraj, nt)) 
    98 yjs  = np.zeros((ntraj, nt)) 
     106# 
     107n=0 
     108for key, value in varlist.iteritems() : 
     109    if key != "iceberg_number" : 
     110        n = n + 1 
     111inarr = np.zeros((n, ntraj, nt)) 
    99112# 
    100113# initially fill with invalid data 
    101114# 
    102 lons.fill(np.nan) 
    103 lats.fill(np.nan) 
    104 xis.fill(np.nan) 
    105 yjs.fill(np.nan) 
    106 tims.fill(np.nan) 
     115inarr.fill(np.nan) 
     116# 
     117# Declare some lists to store variable names, types and long_name and units attributes 
     118# iceberg_number gets special treatment 
     119innam = [] 
     120intyp = [] 
     121inlngnam = [] 
     122inunits = [] 
     123for key, value in varlist.iteritems() : 
     124    if key != "iceberg_number" : 
     125        innam.append(key) 
     126# 
     127# reopen the first datset to collect variable attributes 
     128# (long_name and units only) 
     129# 
     130nn = '%4.4d' % 0 
     131fw = Dataset(pathstart+nn+'.nc') 
     132for key, value in varlist.iteritems() : 
     133    if key != "iceberg_number" : 
     134        intyp.append(fw.variables[key].dtype) 
     135        inlngnam.append(fw.variables[key].getncattr('long_name')) 
     136        inunits.append(fw.variables[key].getncattr('units')) 
     137fw.close() 
    107138# 
    108139# loop through distributed datasets again, this time 
    109140# checking indices against icu and times lists and 
    110141# inserting data into the correct locations in the  
    111 # 2-D collated sets. 
     142# collated sets. 
    112143# 
    113144for n in range(procnum): 
    114  nn = '%4.4d' % n 
    115  fw = Dataset(pathstart+nn+'.nc') 
     145    nn = '%4.4d' % n 
     146    fw = Dataset(pathstart+nn+'.nc') 
     147# 
    116148# Note many distributed datafiles will contain no iceberg data 
    117149# so skip quickly over these 
    118  m  = len(fw.dimensions['n']) 
    119  if m > 0: 
    120    inx = np.zeros(m, dtype=int) 
    121    tsx = np.zeros(m, dtype=int) 
    122    print pathstart+nn+'.nc' 
    123    ic = fw.variables['iceberg_number'][:,0] 
    124    ts = fw.variables['timestep'][:] 
    125    lns = fw.variables['lon'][:] 
    126    lts = fw.variables['lat'][:] 
    127    xxs = fw.variables['xi'][:] 
    128    yys = fw.variables['yj'][:] 
    129    for k in range(m): 
    130      inxx   = np.where(icu == ic[k]) 
    131      inx[k] = inxx[0] 
    132    for k in range(m): 
    133      inxx   = np.where(times == ts[k]) 
    134      tsx[k] = inxx[0] 
    135    lons[inx[:],tsx[:]] = lns[:] 
    136    lats[inx[:],tsx[:]] = lts[:] 
    137    tims[inx[:],tsx[:]] = ts[:] 
    138    xis[inx[:],tsx[:]] = xxs[:] 
    139    yjs[inx[:],tsx[:]] = yys[:] 
    140  fw.close() 
    141  
     150    m  = len(fw.dimensions['n']) 
     151    if m > 0: 
     152        inx = np.zeros(m, dtype=int) 
     153        tsx = np.zeros(m, dtype=int) 
     154        #print pathstart+nn+'.nc' 
     155        ic = fw.variables['iceberg_number'][:,0] 
     156        ts = fw.variables['timestep'][:] 
     157        for k in range(m): 
     158            inxx   = np.where(icu == ic[k]) 
     159            inx[k] = inxx[0] 
     160        for k in range(m): 
     161            inxx   = np.where(times == ts[k]) 
     162            tsx[k] = inxx[0] 
     163        n = 0 
     164        for key, value in varlist.iteritems() : 
     165            if key != "iceberg_number" : 
     166                insmall = fw.variables[innam[n]][:] 
     167                inarr[n,inx[:],tsx[:]] = insmall[:] 
     168                n = n + 1 
     169    fw.close() 
     170# 
    142171# Finally create the output file and write out the collated sets 
    143172# 
    144 fo = Dataset(pathout, 'w', format='NETCDF4') 
     173fo = Dataset(pathout, 'w', format='NETCDF4_CLASSIC') 
    145174ntrj = fo.createDimension('ntraj', ntraj) 
    146175nti  = fo.createDimension('ntime', None) 
    147 olon = fo.createVariable('lon', 'f4',('ntraj','ntime')) 
    148 olat = fo.createVariable('lat', 'f4',('ntraj','ntime')) 
    149 otim = fo.createVariable('ttim', 'f4',('ntraj','ntime')) 
    150 oxis = fo.createVariable('xis', 'f4',('ntraj','ntime')) 
    151 oyjs = fo.createVariable('yjs', 'f4',('ntraj','ntime')) 
    152 icbn = fo.createVariable('icbn', 'f4',('ntraj')) 
    153 olon[:,:] = lons 
    154 olat[:,:] = lats 
    155 otim[:,:] = tims 
    156 oxis[:,:] = xis 
    157 oyjs[:,:] = yjs 
     176icbn = fo.createVariable('iceberg_number', 'i4',('ntraj')) 
    158177icbn[:] = icu 
     178n = 0 
     179for key, value in varlist.iteritems() : 
     180    if key != "iceberg_number" : 
     181        oout = fo.createVariable(innam[n], intyp[n], ('ntraj','ntime'), 
     182                                 zlib=True, complevel=1, chunksizes=(1,nt)) 
     183        oout[:,:] = inarr[n,:,:] 
     184        oout.long_name = inlngnam[n] 
     185        oout.units = inunits[n] 
     186        n = n + 1 
    159187fo.close() 
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/TOOLS/NESTING/src/agrif_create_bathy.f90

    r2455 r8841  
    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 
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/TOOLS/NESTING/src/agrif_readwrite.f90

    r2455 r8841  
    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    ! 
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/TOOLS/SECTIONS_DIADCT/src/compute_sections.f90

    r3632 r8841  
    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 )      
    685685        ELSE 
    686686           sec%slopeSection = 10000._wp 
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/TRUST/inputs/AMM12/namelist_cfg

    r7646 r8841  
    201201/ 
    202202!----------------------------------------------------------------------- 
    203 &namobc        !   open boundaries parameters                           ("key_obc") 
    204 !----------------------------------------------------------------------- 
    205 / 
    206 !----------------------------------------------------------------------- 
    207203&namagrif      !  AGRIF zoom                                            ("key_agrif") 
    208204!----------------------------------------------------------------------- 
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/TRUST/inputs/GYRE/namelist_cfg

    r7646 r8841  
    155155/ 
    156156!----------------------------------------------------------------------- 
    157 &namobc        !   open boundaries parameters                           ("key_obc") 
    158 !----------------------------------------------------------------------- 
    159 / 
    160 !----------------------------------------------------------------------- 
    161157&namagrif      !  AGRIF zoom                                            ("key_agrif") 
    162158!----------------------------------------------------------------------- 
Note: See TracChangeset for help on using the changeset viewer.