Changeset 7953
- Timestamp:
- 2017-04-23T09:30:41+02:00 (7 years ago)
- Location:
- branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM
- Files:
-
- 1 deleted
- 46 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/AMM12/EXP00/namelist_cfg
r7646 r7953 29 29 !----------------------------------------------------------------------- 30 30 rn_rdt = 600. ! time step for the dynamics (and tracer if nn_acc=0) 31 /32 !-----------------------------------------------------------------------33 &namcrs ! Grid coarsening for dynamics output and/or34 ! ! passive tracer coarsened online simulations35 !-----------------------------------------------------------------------36 31 / 37 32 !----------------------------------------------------------------------- -
branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/GYRE_PISCES/EXP00/namelist_cfg
r7931 r7953 12 12 !! *** Run management namelists *** 13 13 !!====================================================================== 14 !! namrun parameters of the run15 !!======================================================================16 !17 14 !----------------------------------------------------------------------- 18 15 &namrun ! parameters of the run … … 25 22 nn_write = 60 ! frequency of write in the output file (modulo referenced to nn_it000) 26 23 / 24 !!====================================================================== 25 !! *** Domain namelists *** 26 !!====================================================================== 27 27 !----------------------------------------------------------------------- 28 28 &namcfg ! parameters of the configuration … … 37 37 !----------------------------------------------------------------------- 38 38 ln_linssh = .true. ! =T linear free surface ==>> model level are fixed in time 39 !40 39 nn_msh = 0 ! create (>0) a mesh file or not (=0) 41 !42 40 rn_rdt = 7200. ! time step for the dynamics (and tracer if nn_acc=0) 43 /44 !-----------------------------------------------------------------------45 &namcrs ! Grid coarsening for dynamics output and/or46 ! ! passive tracer coarsened online simulations47 !-----------------------------------------------------------------------48 41 / 49 42 !----------------------------------------------------------------------- … … 56 49 ln_tsd_tradmp = .false. ! damping of ocean T & S toward T &S input data (T) or not (F) 57 50 / 51 52 !!====================================================================== 53 !! *** Surface Boundary Condition namelists *** 54 !!====================================================================== 58 55 !----------------------------------------------------------------------- 59 56 &namsbc ! Surface Boundary Condition (surface module) … … 76 73 / 77 74 !----------------------------------------------------------------------- 78 &namsbc_rnf ! runoffs namelist surface boundary condition79 !-----------------------------------------------------------------------80 ln_rnf_mouth = .false. ! specific treatment at rivers mouths81 /82 !-----------------------------------------------------------------------83 &namsbc_apr ! Atmospheric pressure used as ocean forcing or in bulk84 !-----------------------------------------------------------------------85 /86 !-----------------------------------------------------------------------87 &namsbc_ssr ! surface boundary condition : sea surface restoring88 !-----------------------------------------------------------------------89 /90 !-----------------------------------------------------------------------91 &namsbc_alb ! albedo parameters92 !-----------------------------------------------------------------------93 /94 !-----------------------------------------------------------------------95 &namberg ! iceberg parameters96 !-----------------------------------------------------------------------97 /98 !-----------------------------------------------------------------------99 75 &namlbc ! lateral momentum boundary condition 100 76 !----------------------------------------------------------------------- … … 102 78 / 103 79 !----------------------------------------------------------------------- 104 &namagrif ! AGRIF zoom ("key_agrif")105 !-----------------------------------------------------------------------106 /107 !-----------------------------------------------------------------------108 &nam_tide ! tide parameters109 !-----------------------------------------------------------------------110 /111 !-----------------------------------------------------------------------112 &nambdy ! unstructured open boundaries113 !-----------------------------------------------------------------------114 /115 !-----------------------------------------------------------------------116 &nambdy_dta ! open boundaries - external data117 !-----------------------------------------------------------------------118 /119 !-----------------------------------------------------------------------120 &nambdy_tide ! tidal forcing at open boundaries121 !-----------------------------------------------------------------------122 /123 !-----------------------------------------------------------------------124 80 &nambfr ! bottom friction 125 81 !----------------------------------------------------------------------- 126 82 nn_bfr = 2 ! type of bottom friction : = 0 : free slip, = 1 : linear friction 127 /128 !-----------------------------------------------------------------------129 &nambbc ! bottom temperature boundary condition (default: NO)130 !-----------------------------------------------------------------------131 83 / 132 84 !----------------------------------------------------------------------- … … 282 234 / 283 235 !----------------------------------------------------------------------- 284 &namzdf_ric ! richardson number dependent vertical diffusion ( "key_zdfric")285 !----------------------------------------------------------------------- 286 / 287 !----------------------------------------------------------------------- 288 &namzdf_tke ! turbulent eddy kinetic dependent vertical diffusion ( "key_zdftke")236 &namzdf_ric ! richardson number dependent vertical diffusion (ln_zdfric=T) 237 !----------------------------------------------------------------------- 238 / 239 !----------------------------------------------------------------------- 240 &namzdf_tke ! turbulent eddy kinetic dependent vertical diffusion (ln_zdftke=T) 289 241 !----------------------------------------------------------------------- 290 242 nn_etau = 0 ! penetration of tke below the mixed layer (ML) due to internal & intertial waves 291 243 / 292 244 !----------------------------------------------------------------------- 293 &namzdf_gls ! GLS vertical diffusion ( "key_zdfgls")294 !----------------------------------------------------------------------- 295 / 296 !----------------------------------------------------------------------- 297 &namzdf_ddm ! double diffusive mixing parameterization ( "key_zdfddm")298 !----------------------------------------------------------------------- 299 / 300 !----------------------------------------------------------------------- 301 &namzdf_tmx ! tidal mixing parameterization ( "key_zdftmx")245 &namzdf_gls ! GLS vertical diffusion (ln_zdfgls=T) 246 !----------------------------------------------------------------------- 247 / 248 !----------------------------------------------------------------------- 249 &namzdf_ddm ! double diffusive mixing parameterization (ln_zdfddm=T) 250 !----------------------------------------------------------------------- 251 / 252 !----------------------------------------------------------------------- 253 &namzdf_tmx ! tidal mixing parameterization (ln_zdftmx=T) 302 254 !----------------------------------------------------------------------- 303 255 ln_tmx_itf = .false. ! ITF specific parameterisation -
branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/GYRE_PISCES/EXP00/namelist_top_cfg
r7715 r7953 43 43 / 44 44 !----------------------------------------------------------------------- 45 &namtrc_zdf ! vertical physics46 !-----------------------------------------------------------------------47 /48 !-----------------------------------------------------------------------49 45 &namtrc_rad ! treatment of negative concentrations 50 46 !----------------------------------------------------------------------- -
branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/GYRE_PISCES/cpp_GYRE_PISCES.fcm
r7646 r7953 1 bld::tool::fppkeys key_zdftke key_top key_mpp_mpi 1 bld::tool::fppkeys key_zdftke key_top key_mpp_mpi key_nosignedzero -
branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/ORCA2_LIM3_PISCES/EXP00/namelist_cfg
r7828 r7953 235 235 / 236 236 !----------------------------------------------------------------------- 237 &namzdf ! vertical physics 238 !----------------------------------------------------------------------- 239 / 240 !----------------------------------------------------------------------- 241 &namzdf_tke ! turbulent eddy kinetic dependent vertical diffusion ("key_zdftke") 242 !----------------------------------------------------------------------- 243 / 244 !----------------------------------------------------------------------- 245 &namzdf_ddm ! double diffusive mixing parameterization ("key_zdfddm") 237 &namzdf ! vertical physics (default: NO selection) 238 !----------------------------------------------------------------------- 239 ! ! type of vertical closure 240 ln_zdfcst = .false. ! constant mixing 241 ln_zdfric = .false. ! local Richardson dependent formulation (T => fill namzdf_ric) 242 ln_zdftke = .true. ! Turbulent Kinetic Energy closure (T => fill namzdf_tke) 243 ln_zdfgls = .false. ! Generic Length Scale closure (T => fill namzdf_gls) 244 ! 245 ! ! convection 246 ln_zdfevd = .true. ! Enhanced Vertical Diffusion scheme 247 nn_evdm = 0 ! evd apply on tracer (=0) or on tracer and momentum (=1) 248 rn_evd = 100. ! evd mixing coefficient [m2/s] 249 ! 250 ln_zdfddm = .true. ! double diffusive mixing 251 rn_avts = 1.e-4 ! maximum avs (vertical mixing on salinity) 252 rn_hsbfr = 1.6 ! heat/salt buoyancy flux ratio 253 ! 254 ln_zdftmx = .true. ! tidal mixing parameterization (T => fill namzdf_tmx) 255 ! 256 ln_zdfqiao = .false. ! enhanced wave vertical mixing Qiao (2010) (T => ln_wave=T & ln_sdw=T & fill namsbc_wave) 257 ! 258 ! ! time-stepping 259 ln_zdfexp = .false. ! split-explicit (T) or implicit (F) time stepping scheme 260 nn_zdfexp= 3 ! number of sub-timestep for ln_zdfexp=T 261 ! 262 ! ! Coefficients 263 rn_avm0 = 1.2e-4 ! vertical eddy viscosity [m2/s] (background Kz if ln_zdfcst=F) 264 rn_avt0 = 1.2e-5 ! vertical eddy diffusivity [m2/s] (background Kz if ln_zdfcst=F) 265 nn_avb = 0 ! profile for background avt & avm (=1) or not (=0) 266 nn_havtb = 1 ! horizontal shape for avtb (=1) or not (=0) 267 / 268 !----------------------------------------------------------------------- 269 &namzdf_tke ! turbulent eddy kinetic dependent vertical diffusion 246 270 !----------------------------------------------------------------------- 247 271 / -
branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/ORCA2_LIM3_PISCES/EXP00/namelist_top_cfg
r7445 r7953 81 81 / 82 82 !----------------------------------------------------------------------- 83 &namtrc_zdf ! vertical physics84 !-----------------------------------------------------------------------85 /86 !-----------------------------------------------------------------------87 83 &namtrc_rad ! treatment of negative concentrations 88 84 !----------------------------------------------------------------------- -
branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/ORCA2_LIM3_PISCES/cpp_ORCA2_LIM3_PISCES.fcm
r7828 r7953 1 bld::tool::fppkeys key_trabbl key_lim3 key_zdftke key_zdf ddm key_zdftmx_new key_iomput key_mpp_mpi key_top key_nosignedzero1 bld::tool::fppkeys key_trabbl key_lim3 key_zdftke key_zdftmx_new key_iomput key_mpp_mpi key_top key_nosignedzero -
branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/SHARED/field_def_nemo-opa.xml
r7828 r7953 390 390 <field id="avm" long_name="vertical eddy viscosity" standard_name="ocean_vertical_momentum_diffusivity" unit="m2/s" /> 391 391 392 <!-- avs: available with key_zdfddm-->392 <!-- avs: if ln_zdfddm=F avs=avt --> 393 393 <field id="avs" long_name="salt vertical eddy diffusivity" standard_name="ocean_vertical_salt_diffusivity" unit="m2/s" /> 394 394 <field id="logavs" long_name="logarithm of salt vertical eddy diffusivity" standard_name="ocean_vertical_heat_diffusivity" unit="m2/s" /> … … 398 398 <field id="avm_evd" long_name="convective enhancement of vertical viscosity" standard_name="ocean_vertical_momentum_diffusivity_due_to_convection" unit="m2/s" /> 399 399 400 <!-- avt_tide: available with key_zdftmx --> 401 <field id="av_tide" long_name="tidal vertical diffusivity" standard_name="ocean_vertical_tracer_diffusivity_due_to_tides" unit="m2/s" /> 402 403 <!-- variables available with key_zdftmx_new --> 400 <!-- variables available with ln_zdftmx =T --> 404 401 <field id="av_ratio" long_name="S over T diffusivity ratio" standard_name="salinity_over_temperature_diffusivity_ratio" unit="1" /> 405 402 <field id="av_wave" long_name="wave-induced vertical diffusivity" standard_name="ocean_vertical_tracer_diffusivity_due_to_internal_waves" unit="m2/s" /> -
branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/SHARED/namelist_ref
r7931 r7953 236 236 / 237 237 !----------------------------------------------------------------------- 238 &namsbc_blk ! namsbc_blk generic Bulk formula (ln_blk = 238 &namsbc_blk ! namsbc_blk generic Bulk formula (ln_blk =T) 239 239 !----------------------------------------------------------------------- 240 240 ! ! file name ! frequency (hours) ! variable ! time interp. ! clim ! 'yearly'/ ! weights ! rotation ! land/sea mask ! … … 326 326 / 327 327 !----------------------------------------------------------------------- 328 &namtra_qsr ! penetrative solar radiation (ln_traqsr =T)328 &namtra_qsr ! penetrative solar radiation (ln_traqsr =T) 329 329 !----------------------------------------------------------------------- 330 330 ! ! file name ! frequency (hours) ! variable ! time interp. ! clim ! 'yearly'/ ! weights ! rotation ! land/sea mask ! … … 343 343 / 344 344 !----------------------------------------------------------------------- 345 &namsbc_rnf ! runoffs namelist surface boundary condition (ln_rnf =T)345 &namsbc_rnf ! runoffs namelist surface boundary condition (ln_rnf =T) 346 346 !----------------------------------------------------------------------- 347 347 ! ! file name ! frequency (hours) ! variable ! time interp. ! clim ! 'yearly'/ ! weights ! rotation ! land/sea mask ! … … 419 419 / 420 420 !----------------------------------------------------------------------- 421 &namsbc_ssr ! surface boundary condition : sea surface restoring (ln_ssr =T)421 &namsbc_ssr ! surface boundary condition : sea surface restoring (ln_ssr =T) 422 422 !----------------------------------------------------------------------- 423 423 ! ! file name ! frequency (hours) ! variable ! time interp.! clim ! 'yearly'/ ! weights ! rotation ! land/sea mask ! … … 448 448 / 449 449 !----------------------------------------------------------------------- 450 &namsbc_wave ! External fields from wave model (ln_wave =T)450 &namsbc_wave ! External fields from wave model (ln_wave =T) 451 451 !----------------------------------------------------------------------- 452 452 ! ! file name ! frequency (hours) ! variable ! time interp. ! clim ! 'yearly'/ ! weights ! rotation ! land/sea mask ! … … 667 667 ! 668 668 !----------------------------------------------------------------------- 669 &nameos ! ocean Equation Of S tate(default: NO)669 &nameos ! ocean Equation Of Seawater (default: NO) 670 670 !----------------------------------------------------------------------- 671 671 ln_teos10 = .false. ! = Use TEOS-10 equation of state … … 894 894 nn_npc = 1 ! frequency of application of npc 895 895 nn_npcp = 365 ! npc control print frequency 896 !!gm new897 896 ! 898 897 ln_zdfddm = .false. ! double diffusive mixing … … 902 901 ln_zdftmx = .false. ! tidal mixing parameterization (T => fill namzdf_tmx) 903 902 ! 904 !!gm905 !906 903 ln_zdfqiao = .false. ! surface wave-induced mixing (Qiao et al. 2010) (T => ln_wave=ln_sdw=T. & fill namsbc_wave) 907 904 ! … … 909 906 ln_zdfexp = .false. ! split-explicit (T) or implicit (F) scheme 910 907 nn_zdfexp= 3 ! number of sub-timestep for ln_zdfexp=T 908 ! 911 909 ! ! coefficients 912 910 rn_avm0 = 1.2e-4 ! vertical eddy viscosity [m2/s] (background Kz if ln_zdfcst=F) … … 977 975 / 978 976 !----------------------------------------------------------------------- 979 &namzdf_tmx ! tidal mixing parameterization ("key_zdftmx") 980 !----------------------------------------------------------------------- 981 rn_htmx = 500. ! vertical decay scale for turbulence (meters) 982 rn_n2min = 1.e-8 ! threshold of the Brunt-Vaisala frequency (s-1) 983 rn_tfe = 0.333 ! tidal dissipation efficiency 984 rn_me = 0.2 ! mixing efficiency 985 ln_tmx_itf = .true. ! ITF specific parameterisation 986 rn_tfe_itf = 1. ! ITF tidal dissipation efficiency 987 / 988 !----------------------------------------------------------------------- 989 &namzdf_tmx_new ! internal wave-driven mixing parameterization ("key_zdftmx_new" & "key_zdfddm") 977 &namzdf_tmx ! internal wave-driven mixing parameterization (ln_zdftmx =T) 990 978 !----------------------------------------------------------------------- 991 979 nn_zpyc = 1 ! pycnocline-intensified dissipation scales as N (=1) or N^2 (=2) … … 996 984 !! *** Miscellaneous namelists *** 997 985 !!====================================================================== 998 !! nammpp Massively Parallel Processing ("key_mpp_mpi )986 !! nammpp Massively Parallel Processing ("key_mpp_mpi") 999 987 !! namctl Control prints 1000 988 !! namsto Stochastic parametrization of EOS … … 1002 990 ! 1003 991 !----------------------------------------------------------------------- 1004 &nammpp ! Massively Parallel Processing ("key_mpp_mpi )992 &nammpp ! Massively Parallel Processing ("key_mpp_mpi") 1005 993 !----------------------------------------------------------------------- 1006 994 cn_mpi_send = 'I' ! mpi send/recieve type ='S', 'B', or 'I' for standard send, -
branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/SHARED/namelist_top_ref
r7646 r7953 95 95 / 96 96 !----------------------------------------------------------------------- 97 &namtrc_zdf ! vertical physics98 !-----------------------------------------------------------------------99 ln_trczdf_exp = .false. ! split explicit (T) or implicit (F) time stepping100 nn_trczdf_exp = 3 ! number of sub-timestep for ln_trczdfexp=T101 /102 !-----------------------------------------------------------------------103 97 &namtrc_rad ! treatment of negative concentrations 104 98 !----------------------------------------------------------------------- -
branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/cfg.txt
r7715 r7953 1 1 AMM12 OPA_SRC 2 2 C1D_PAPA OPA_SRC 3 GYRE_PISCES OPA_SRC TOP_SRC4 3 GYRE_BFM OPA_SRC TOP_SRC 5 4 ORCA2_SAS_LIM3 OPA_SRC SAS_SRC LIM_SRC_3 NST_SRC 6 5 ORCA2_OFF_PISCES OPA_SRC OFF_SRC TOP_SRC 7 6 ORCA2_OFF_TRC OPA_SRC OFF_SRC TOP_SRC 7 GYRE_PISCES OPA_SRC TOP_SRC 8 8 ORCA2_LIM3_PISCES OPA_SRC LIM_SRC_3 TOP_SRC NST_SRC 9 GYRE_PISCES_XIOS OPA_SRC TOP_SRC -
branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/NST_SRC/agrif_ice.F90
r7646 r7953 18 18 PUBLIC agrif_ice_alloc ! routine called by nemo_init in nemogcm.F90 19 19 20 INTEGER , PUBLIC ::u_ice_id, v_ice_id, adv_ice_id21 REAL(wp), PUBLIC :: lim_nbstep = 0. ! child time position in sea-ice model20 INTEGER , PUBLIC :: u_ice_id, v_ice_id, adv_ice_id 21 REAL(wp), PUBLIC :: lim_nbstep = 0. ! child time position in sea-ice model 22 22 #if defined key_lim2_vp 23 23 REAL(wp), PUBLIC, ALLOCATABLE, DIMENSION(:,:) :: u_ice_nst, v_ice_nst 24 24 #else 25 25 REAL(wp), PUBLIC, ALLOCATABLE, DIMENSION(:,:,:) :: u_ice_oe, u_ice_sn !: boundaries arrays 26 REAL(wp), PUBLIC, ALLOCATABLE, DIMENSION(:,:,:) :: v_ice_oe, v_ice_sn !: " "26 REAL(wp), PUBLIC, ALLOCATABLE, DIMENSION(:,:,:) :: v_ice_oe, v_ice_sn !: - - 27 27 #endif 28 REAL(wp), PUBLIC, ALLOCATABLE, DIMENSION(:,:,:,:) :: adv_ice_oe, adv_ice_sn !: " "28 REAL(wp), PUBLIC, ALLOCATABLE, DIMENSION(:,:,:,:) :: adv_ice_oe, adv_ice_sn !: - - 29 29 30 30 !!---------------------------------------------------------------------- 31 !! NEMO/NST 3.3.4 , NEMO Consortium (2012)31 !! NEMO/NST 4.0 , NEMO Consortium (2017) 32 32 !! $Id$ 33 33 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 34 34 !!---------------------------------------------------------------------- 35 36 35 CONTAINS 37 36 … … 50 49 51 50 #if ! defined key_lim2_vp 52 u_ice_oe(:,:,:) = 0. e053 v_ice_oe(:,:,:) = 0. e054 u_ice_sn(:,:,:) = 0. e055 v_ice_sn(:,:,:) = 0. e051 u_ice_oe(:,:,:) = 0._wp 52 v_ice_oe(:,:,:) = 0._wp 53 u_ice_sn(:,:,:) = 0._wp 54 v_ice_sn(:,:,:) = 0._wp 56 55 #endif 57 adv_ice_oe (:,:,:,:) = 0. e058 adv_ice_sn (:,:,:,:) = 0. e056 adv_ice_oe (:,:,:,:) = 0._wp 57 adv_ice_sn (:,:,:,:) = 0._wp 59 58 ! 60 59 END FUNCTION agrif_ice_alloc … … 71 70 72 71 !!---------------------------------------------------------------------- 73 !! NEMO/NST 3.6 , NEMO Consortium (2016)72 !! NEMO/NST 4.0 , NEMO Consortium (2017) 74 73 !! $Id$ 75 74 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) -
branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/NST_SRC/agrif_lim3_interp.F90
r7761 r7953 28 28 PRIVATE 29 29 30 PUBLIC agrif_interp_lim330 PUBLIC agrif_interp_lim3 ! called by ??? 31 31 32 32 !!---------------------------------------------------------------------- … … 46 46 !! computing factor for time interpolation 47 47 !!----------------------------------------------------------------------- 48 CHARACTER(len=1), INTENT( in ) ::cd_type49 INTEGER , INTENT( in ), OPTIONAL ::kiter, kitermax50 !! 51 REAL(wp) :: zbeta48 CHARACTER(len=1), INTENT(in ) :: cd_type 49 INTEGER , INTENT(in ), OPTIONAL :: kiter, kitermax 50 !! 51 REAL(wp) :: zbeta ! local scalar 52 52 !!----------------------------------------------------------------------- 53 53 ! 54 54 IF( Agrif_Root() ) RETURN 55 55 ! 56 SELECT CASE( cd_type)56 SELECT CASE( cd_type ) 57 57 CASE('U','V') 58 58 IF( PRESENT( kiter ) ) THEN ! interpolation at the child sub-time step (only for ice rheology) … … 66 66 END SELECT 67 67 ! 68 Agrif_SpecialValue =-9999.68 Agrif_SpecialValue = -9999. 69 69 Agrif_UseSpecialValue = .TRUE. 70 SELECT CASE(cd_type) 71 CASE('U') 72 CALL Agrif_Bc_variable( u_ice_id , procname=interp_u_ice , calledweight=zbeta ) 73 CASE('V') 74 CALL Agrif_Bc_variable( v_ice_id , procname=interp_v_ice , calledweight=zbeta ) 75 CASE('T') 76 CALL Agrif_Bc_variable( tra_ice_id, procname=interp_tra_ice, calledweight=zbeta ) 70 SELECT CASE( cd_type ) 71 CASE('U') ; CALL Agrif_Bc_variable( u_ice_id , procname=interp_u_ice , calledweight=zbeta ) 72 CASE('V') ; CALL Agrif_Bc_variable( v_ice_id , procname=interp_v_ice , calledweight=zbeta ) 73 CASE('T') ; CALL Agrif_Bc_variable( tra_ice_id, procname=interp_tra_ice, calledweight=zbeta ) 77 74 END SELECT 78 Agrif_SpecialValue =0.75 Agrif_SpecialValue = 0._wp 79 76 Agrif_UseSpecialValue = .FALSE. 80 77 ! 81 78 END SUBROUTINE agrif_interp_lim3 82 79 83 !!------------------ 84 !! Local subroutines 85 !!------------------ 80 86 81 SUBROUTINE interp_u_ice( ptab, i1, i2, j1, j2, before ) 87 82 !!----------------------------------------------------------------------- … … 92 87 !! put -9999 WHERE the parent grid is masked. The child solution will be found in the 9(?) points around 93 88 !!----------------------------------------------------------------------- 94 INTEGER , INTENT(in) ::i1, i2, j1, j295 REAL(wp), DIMENSION(i1:i2,j1:j2), INTENT(inout) :: ptab96 LOGICAL , INTENT(in) ::before97 !! 98 REAL(wp) :: zrhoy89 INTEGER , INTENT(in ) :: i1, i2, j1, j2 90 REAL(wp), DIMENSION(i1:i2,j1:j2), INTENT(inout) :: ptab 91 LOGICAL , INTENT(in ) :: before 92 !! 93 REAL(wp) :: zrhoy ! local scalar 99 94 !!----------------------------------------------------------------------- 100 95 ! … … 118 113 !! put -9999 WHERE the parent grid is masked. The child solution will be found in the 9(?) points around 119 114 !!----------------------------------------------------------------------- 120 INTEGER , INTENT(in) ::i1, i2, j1, j2121 REAL(wp), DIMENSION(i1:i2,j1:j2), INTENT(inout) :: ptab122 LOGICAL , INTENT(in) ::before123 !! 124 REAL(wp) :: zrhox115 INTEGER , INTENT(in ) :: i1, i2, j1, j2 116 REAL(wp), DIMENSION(i1:i2,j1:j2), INTENT(inout) :: ptab 117 LOGICAL , INTENT(in ) :: before 118 !! 119 REAL(wp) :: zrhox ! local scalar 125 120 !!----------------------------------------------------------------------- 126 121 ! … … 144 139 !! put -9999 WHERE the parent grid is masked. The child solution will be found in the 9(?) points around 145 140 !!----------------------------------------------------------------------- 146 REAL(wp), DIMENSION(i1:i2,j1:j2,k1:k2), INTENT(inout) :: ptab 147 INTEGER , INTENT(in) :: i1, i2, j1, j2, k1, k2 148 LOGICAL , INTENT(in) :: before 149 INTEGER , INTENT(in) :: nb, ndir 150 !! 151 REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: ztab 141 REAL(wp), DIMENSION(i1:i2,j1:j2,k1:k2), INTENT(inout) :: ptab 142 INTEGER , INTENT(in ) :: i1, i2, j1, j2, k1, k2 143 LOGICAL , INTENT(in ) :: before 144 INTEGER , INTENT(in ) :: nb, ndir 145 !! 152 146 INTEGER :: ji, jj, jk, jl, jm 153 147 INTEGER :: imin, imax, jmin, jmax 148 LOGICAL :: western_side, eastern_side, northern_side, southern_side 154 149 REAL(wp) :: zrhox, z1, z2, z3, z4, z5, z6, z7 155 LOGICAL :: western_side, eastern_side, northern_side, southern_side 156 157 !!----------------------------------------------------------------------- 158 ! tracers are not multiplied by grid cell here => before: * e12t ; after: * r1_e12t / rhox / rhoy 150 REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: ztab 151 !!----------------------------------------------------------------------- 152 ! tracers are not multiplied by grid cell here => before: * e1e2t ; after: * r1_e1e2t / rhox / rhoy 159 153 ! and it is ok since we conserve tracers (same as in the ocean). 160 154 ALLOCATE( ztab(SIZE(a_i_b,1),SIZE(a_i_b,2),SIZE(ptab,3)) ) … … 163 157 jm = 1 164 158 DO jl = 1, jpl 165 ptab(i1:i2,j1:j2,jm) = a_i_b (i1:i2,j1:j2,jl) ;jm = jm + 1166 ptab(i1:i2,j1:j2,jm) = v_i_b (i1:i2,j1:j2,jl) ;jm = jm + 1167 ptab(i1:i2,j1:j2,jm) = v_s_b (i1:i2,j1:j2,jl) ;jm = jm + 1168 ptab(i1:i2,j1:j2,jm) = smv_i_b(i1:i2,j1:j2,jl) ;jm = jm + 1169 ptab(i1:i2,j1:j2,jm) = oa_i_b (i1:i2,j1:j2,jl) ;jm = jm + 1159 ptab(i1:i2,j1:j2,jm) = a_i_b (i1:i2,j1:j2,jl) ; jm = jm + 1 160 ptab(i1:i2,j1:j2,jm) = v_i_b (i1:i2,j1:j2,jl) ; jm = jm + 1 161 ptab(i1:i2,j1:j2,jm) = v_s_b (i1:i2,j1:j2,jl) ; jm = jm + 1 162 ptab(i1:i2,j1:j2,jm) = smv_i_b(i1:i2,j1:j2,jl) ; jm = jm + 1 163 ptab(i1:i2,j1:j2,jm) = oa_i_b (i1:i2,j1:j2,jl) ; jm = jm + 1 170 164 DO jk = 1, nlay_s 171 ptab(i1:i2,j1:j2,jm) = e_s_b(i1:i2,j1:j2,jk,jl) ;jm = jm + 1172 END DO165 ptab(i1:i2,j1:j2,jm) = e_s_b(i1:i2,j1:j2,jk,jl) ; jm = jm + 1 166 END DO 173 167 DO jk = 1, nlay_i 174 ptab(i1:i2,j1:j2,jm) = e_i_b(i1:i2,j1:j2,jk,jl) ;jm = jm + 1175 END DO176 END DO168 ptab(i1:i2,j1:j2,jm) = e_i_b(i1:i2,j1:j2,jk,jl) ; jm = jm + 1 169 END DO 170 END DO 177 171 178 172 DO jk = k1, k2 179 WHERE( tmask(i1:i2,j1:j2,1) == 0. )ptab(i1:i2,j1:j2,jk) = -9999.180 END DO173 WHERE( tmask(i1:i2,j1:j2,1) == 0._wp ) ptab(i1:i2,j1:j2,jk) = -9999. 174 END DO 181 175 182 176 ELSE ! child grid … … 184 178 jm = 1 185 179 DO jl = 1, jpl 186 a_i (i1:i2,j1:j2,jl) = ptab(i1:i2,j1:j2,jm) * tmask(i1:i2,j1:j2,1) ;jm = jm + 1187 v_i (i1:i2,j1:j2,jl) = ptab(i1:i2,j1:j2,jm) * tmask(i1:i2,j1:j2,1) ;jm = jm + 1188 v_s (i1:i2,j1:j2,jl) = ptab(i1:i2,j1:j2,jm) * tmask(i1:i2,j1:j2,1) ;jm = jm + 1189 smv_i(i1:i2,j1:j2,jl) = ptab(i1:i2,j1:j2,jm) * tmask(i1:i2,j1:j2,1) ;jm = jm + 1190 oa_i (i1:i2,j1:j2,jl) = ptab(i1:i2,j1:j2,jm) * tmask(i1:i2,j1:j2,1) ;jm = jm + 1180 a_i (i1:i2,j1:j2,jl) = ptab(i1:i2,j1:j2,jm) * tmask(i1:i2,j1:j2,1) ; jm = jm + 1 181 v_i (i1:i2,j1:j2,jl) = ptab(i1:i2,j1:j2,jm) * tmask(i1:i2,j1:j2,1) ; jm = jm + 1 182 v_s (i1:i2,j1:j2,jl) = ptab(i1:i2,j1:j2,jm) * tmask(i1:i2,j1:j2,1) ; jm = jm + 1 183 smv_i(i1:i2,j1:j2,jl) = ptab(i1:i2,j1:j2,jm) * tmask(i1:i2,j1:j2,1) ; jm = jm + 1 184 oa_i (i1:i2,j1:j2,jl) = ptab(i1:i2,j1:j2,jm) * tmask(i1:i2,j1:j2,1) ; jm = jm + 1 191 185 DO jk = 1, nlay_s 192 e_s(i1:i2,j1:j2,jk,jl) = ptab(i1:i2,j1:j2,jm) * tmask(i1:i2,j1:j2,1) ;jm = jm + 1193 END DO186 e_s(i1:i2,j1:j2,jk,jl) = ptab(i1:i2,j1:j2,jm) * tmask(i1:i2,j1:j2,1) ; jm = jm + 1 187 END DO 194 188 DO jk = 1, nlay_i 195 e_i(i1:i2,j1:j2,jk,jl) = ptab(i1:i2,j1:j2,jm) * tmask(i1:i2,j1:j2,1) ;jm = jm + 1196 END DO197 END DO189 e_i(i1:i2,j1:j2,jk,jl) = ptab(i1:i2,j1:j2,jm) * tmask(i1:i2,j1:j2,1) ; jm = jm + 1 190 END DO 191 END DO 198 192 199 193 !! ==> this is a more complex interpolation since we mix solutions over a couple of grid points … … 319 313 et_s(i1:i2,j1:j2) = SUM( SUM( e_s(i1:i2,j1:j2,:,:), dim=4 ), dim=3 ) 320 314 et_i(i1:i2,j1:j2) = SUM( SUM( e_i(i1:i2,j1:j2,:,:), dim=4 ), dim=3 ) 321 315 ! 322 316 ENDIF 323 317 … … 327 321 328 322 #else 323 !!---------------------------------------------------------------------- 324 !! Empty module no sea-ice 325 !!---------------------------------------------------------------------- 329 326 CONTAINS 330 327 SUBROUTINE agrif_lim3_interp_empty 331 !!---------------------------------------------332 !! *** ROUTINE agrif_lim3_interp_empty ***333 !!---------------------------------------------334 328 WRITE(*,*) 'agrif_lim3_interp : You should not have seen this print! error?' 335 329 END SUBROUTINE agrif_lim3_interp_empty 336 330 #endif 331 332 !!====================================================================== 337 333 END MODULE agrif_lim3_interp -
branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/NST_SRC/agrif_lim3_update.F90
r7761 r7953 31 31 PRIVATE 32 32 33 PUBLIC agrif_update_lim333 PUBLIC agrif_update_lim3 ! called by ???? 34 34 35 35 !!---------------------------------------------------------------------- 36 !! NEMO/NST 3.6 , LOCEAN-IPSL (2016)36 !! NEMO/NST 4.0 , LOCEAN-IPSL (2017) 37 37 !! $Id: agrif_lim3_update.F90 6204 2016-01-04 13:47:06Z cetlod $ 38 38 !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 39 39 !!---------------------------------------------------------------------- 40 41 40 CONTAINS 42 41 … … 49 48 !!---------------------------------------------------------------------- 50 49 INTEGER, INTENT(in) :: kt 51 !!52 50 !!---------------------------------------------------------------------- 53 51 ! … … 57 55 ! i.e. update only at the parent time step 58 56 Agrif_UseSpecialValueInUpdate = .TRUE. 59 Agrif_SpecialValueFineGrid = -9999.57 Agrif_SpecialValueFineGrid = -9999. 60 58 # if defined TWO_WAY 61 59 IF( MOD(nbcline,nbclineupdate) == 0) THEN ! update the whole basin at each nbclineupdate (=nn_cln_update) baroclinic parent time steps … … 75 73 76 74 77 !!------------------78 !! Local subroutines79 !!------------------80 75 SUBROUTINE update_tra_ice( ptab, i1, i2, j1, j2, k1, k2, before ) 81 76 !!----------------------------------------------------------------------- … … 84 79 !! the properties per mass on the coarse grid 85 80 !!----------------------------------------------------------------------- 86 INTEGER , INTENT(in) ::i1, i2, j1, j2, k1, k287 REAL(wp), DIMENSION(i1:i2,j1:j2,k1:k2), INTENT(inout) :: ptab88 LOGICAL , INTENT(in) ::before81 INTEGER , INTENT(in ) :: i1, i2, j1, j2, k1, k2 82 REAL(wp), DIMENSION(i1:i2,j1:j2,k1:k2), INTENT(inout) :: ptab 83 LOGICAL , INTENT(in ) :: before 89 84 !! 90 85 INTEGER :: jk, jl, jm … … 94 89 jm = 1 95 90 DO jl = 1, jpl 96 ptab(:,:,jm) = a_i (i1:i2,j1:j2,jl) ;jm = jm + 197 ptab(:,:,jm) = v_i (i1:i2,j1:j2,jl) ;jm = jm + 198 ptab(:,:,jm) = v_s (i1:i2,j1:j2,jl) ;jm = jm + 199 ptab(:,:,jm) = smv_i(i1:i2,j1:j2,jl) ;jm = jm + 1100 ptab(:,:,jm) = oa_i (i1:i2,j1:j2,jl) ;jm = jm + 191 ptab(:,:,jm) = a_i (i1:i2,j1:j2,jl) ; jm = jm + 1 92 ptab(:,:,jm) = v_i (i1:i2,j1:j2,jl) ; jm = jm + 1 93 ptab(:,:,jm) = v_s (i1:i2,j1:j2,jl) ; jm = jm + 1 94 ptab(:,:,jm) = smv_i(i1:i2,j1:j2,jl) ; jm = jm + 1 95 ptab(:,:,jm) = oa_i (i1:i2,j1:j2,jl) ; jm = jm + 1 101 96 DO jk = 1, nlay_s 102 ptab(:,:,jm) = e_s(i1:i2,j1:j2,jk,jl) ;jm = jm + 1103 END DO97 ptab(:,:,jm) = e_s(i1:i2,j1:j2,jk,jl) ; jm = jm + 1 98 END DO 104 99 DO jk = 1, nlay_i 105 ptab(:,:,jm) = e_i(i1:i2,j1:j2,jk,jl) ;jm = jm + 1106 END DO107 END DO100 ptab(:,:,jm) = e_i(i1:i2,j1:j2,jk,jl) ; jm = jm + 1 101 END DO 102 END DO 108 103 109 104 DO jk = k1, k2 110 105 WHERE( tmask(i1:i2,j1:j2,1) == 0. ) ptab(:,:,jk) = -9999. 111 END DO112 106 END DO 107 ! 113 108 ELSE 114 109 jm = 1 115 110 DO jl = 1, jpl 116 a_i (i1:i2,j1:j2,jl) = ptab(:,:,jm) * tmask(i1:i2,j1:j2,1) ;jm = jm + 1117 v_i (i1:i2,j1:j2,jl) = ptab(:,:,jm) * tmask(i1:i2,j1:j2,1) ;jm = jm + 1118 v_s (i1:i2,j1:j2,jl) = ptab(:,:,jm) * tmask(i1:i2,j1:j2,1) ;jm = jm + 1119 smv_i(i1:i2,j1:j2,jl) = ptab(:,:,jm) * tmask(i1:i2,j1:j2,1) ;jm = jm + 1120 oa_i (i1:i2,j1:j2,jl) = ptab(:,:,jm) * tmask(i1:i2,j1:j2,1) ;jm = jm + 1111 a_i (i1:i2,j1:j2,jl) = ptab(:,:,jm) * tmask(i1:i2,j1:j2,1) ; jm = jm + 1 112 v_i (i1:i2,j1:j2,jl) = ptab(:,:,jm) * tmask(i1:i2,j1:j2,1) ; jm = jm + 1 113 v_s (i1:i2,j1:j2,jl) = ptab(:,:,jm) * tmask(i1:i2,j1:j2,1) ; jm = jm + 1 114 smv_i(i1:i2,j1:j2,jl) = ptab(:,:,jm) * tmask(i1:i2,j1:j2,1) ; jm = jm + 1 115 oa_i (i1:i2,j1:j2,jl) = ptab(:,:,jm) * tmask(i1:i2,j1:j2,1) ; jm = jm + 1 121 116 DO jk = 1, nlay_s 122 e_s(i1:i2,j1:j2,jk,jl) = ptab(:,:,jm) * tmask(i1:i2,j1:j2,1) ;jm = jm + 1117 e_s(i1:i2,j1:j2,jk,jl) = ptab(:,:,jm) * tmask(i1:i2,j1:j2,1) ; jm = jm + 1 123 118 ENDDO 124 119 DO jk = 1, nlay_i 125 e_i(i1:i2,j1:j2,jk,jl) = ptab(:,:,jm) * tmask(i1:i2,j1:j2,1) ;jm = jm + 1126 END DO127 END DO120 e_i(i1:i2,j1:j2,jk,jl) = ptab(:,:,jm) * tmask(i1:i2,j1:j2,1) ; jm = jm + 1 121 END DO 122 END DO 128 123 129 124 ! integrated values … … 144 139 !! ** Method : Update the fluxes and recover the properties (C-grid) 145 140 !!----------------------------------------------------------------------- 146 INTEGER , INTENT(in) ::i1, i2, j1, j2147 REAL(wp), DIMENSION(i1:i2,j1:j2), INTENT(inout) :: ptab148 LOGICAL , INTENT(in) ::before141 INTEGER , INTENT(in ) :: i1, i2, j1, j2 142 REAL(wp), DIMENSION(i1:i2,j1:j2), INTENT(inout) :: ptab 143 LOGICAL , INTENT(in ) :: before 149 144 !! 150 REAL(wp) :: zrhoy145 REAL(wp) :: zrhoy ! local scalar 151 146 !!----------------------------------------------------------------------- 152 147 ! … … 154 149 zrhoy = Agrif_Rhoy() 155 150 ptab(:,:) = e2u(i1:i2,j1:j2) * u_ice(i1:i2,j1:j2) * zrhoy 156 WHERE( umask(i1:i2,j1:j2,1) == 0. ) ptab(:,:) = -9999.151 WHERE( umask(i1:i2,j1:j2,1) == 0. ) ptab(:,:) = -9999. 157 152 ELSE 158 153 u_ice(i1:i2,j1:j2) = ptab(:,:) / e2u(i1:i2,j1:j2) * umask(i1:i2,j1:j2,1) … … 167 162 !! ** Method : Update the fluxes and recover the properties (C-grid) 168 163 !!----------------------------------------------------------------------- 169 INTEGER , INTENT(in) :: i1,i2,j1,j2170 REAL(wp), DIMENSION(i1:i2,j1:j2), INTENT(inout) ::ptab171 LOGICAL , INTENT(in) ::before164 INTEGER , INTENT(in ) :: i1, i2, j1, j2 165 REAL(wp), DIMENSION(i1:i2,j1:j2), INTENT(inout) :: ptab 166 LOGICAL , INTENT(in ) :: before 172 167 !! 173 REAL(wp) :: zrhox168 REAL(wp) :: zrhox ! local scalar 174 169 !!----------------------------------------------------------------------- 175 170 ! … … 177 172 zrhox = Agrif_Rhox() 178 173 ptab(:,:) = e1v(i1:i2,j1:j2) * v_ice(i1:i2,j1:j2) * zrhox 179 WHERE( vmask(i1:i2,j1:j2,1) == 0. ) ptab(:,:) = -9999.174 WHERE( vmask(i1:i2,j1:j2,1) == 0. ) ptab(:,:) = -9999. 180 175 ELSE 181 176 v_ice(i1:i2,j1:j2) = ptab(:,:) / e1v(i1:i2,j1:j2) * vmask(i1:i2,j1:j2,1) … … 185 180 186 181 #else 182 !!---------------------------------------------------------------------- 183 !! Empty module no sea-ice 184 !!---------------------------------------------------------------------- 187 185 CONTAINS 188 186 SUBROUTINE agrif_lim3_update_empty 189 !!---------------------------------------------190 !! *** ROUTINE agrif_lim3_update_empty ***191 !!---------------------------------------------192 187 WRITE(*,*) 'agrif_lim3_update : You should not have seen this print! error?' 193 188 END SUBROUTINE agrif_lim3_update_empty 194 189 #endif 190 191 !!====================================================================== 195 192 END MODULE agrif_lim3_update -
branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/NST_SRC/agrif_oce.F90
r5656 r7953 47 47 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: fsahm_spt, fsahm_spf !: sponge viscosities 48 48 49 ! Barotropic arrays used to store open boundary data during 50 ! time-splitting loop: 49 ! Barotropic arrays used to store open boundary data during time-splitting loop: 51 50 REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:) :: ubdy_w, vbdy_w, hbdy_w 52 51 REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:) :: ubdy_e, vbdy_e, hbdy_e … … 54 53 REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:) :: ubdy_s, vbdy_s, hbdy_s 55 54 56 INTEGER :: tsn_id ! AGRIF profile for tracers interpolation and update 57 INTEGER :: un_interp_id, vn_interp_id ! AGRIF profiles for interpolations 58 INTEGER :: un_update_id, vn_update_id ! AGRIF profiles for udpates 59 INTEGER :: tsn_sponge_id, un_sponge_id, vn_sponge_id ! AGRIF profiles for sponge layers 55 !!gm add PUBLIC in all variable below: 56 57 INTEGER, PUBLIC :: tsn_id ! AGRIF profile for tracers interpolation and update 58 INTEGER, PUBLIC :: un_interp_id, vn_interp_id ! AGRIF profiles for interpolations 59 INTEGER, PUBLIC :: un_update_id, vn_update_id ! AGRIF profiles for udpates 60 INTEGER, PUBLIC :: tsn_sponge_id, un_sponge_id, vn_sponge_id ! AGRIF profiles for sponge layers 60 61 # if defined key_top 61 INTEGER :: trn_id, trn_sponge_id62 INTEGER, PUBLIC :: trn_id, trn_sponge_id 62 63 # endif 63 INTEGER :: unb_id, vnb_id, ub2b_interp_id, vb2b_interp_id64 INTEGER :: ub2b_update_id, vb2b_update_id65 INTEGER :: e3t_id, e1u_id, e2v_id, sshn_id66 INTEGER :: scales_t_id67 # if defined key_zdftke 68 INTEGER :: avt_id, avm_id, en_id69 # endif 70 INTEGER :: umsk_id, vmsk_id71 INTEGER :: kindic_agr 64 INTEGER, PUBLIC :: unb_id, vnb_id, ub2b_interp_id, vb2b_interp_id 65 INTEGER, PUBLIC :: ub2b_update_id, vb2b_update_id 66 INTEGER, PUBLIC :: e3t_id, e1u_id, e2v_id, sshn_id 67 INTEGER, PUBLIC :: scales_t_id 68 INTEGER, PUBLIC :: avt_id, avm_id, en_id ! TKE related identificators 69 INTEGER, PUBLIC :: umsk_id, vmsk_id 70 INTEGER, PUBLIC :: kindic_agr 71 72 !!gm end public addition 72 73 73 74 !!---------------------------------------------------------------------- -
branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/NST_SRC/agrif_opa_interp.F90
r7646 r7953 21 21 USE oce 22 22 USE dom_oce 23 USE zdf_oce 23 USE zdf_oce ! vertical physics 24 24 USE agrif_oce 25 25 USE phycst … … 34 34 35 35 PUBLIC Agrif_tra, Agrif_dyn, Agrif_ssh, Agrif_dyn_ts, Agrif_ssh_ts, Agrif_dta_ts 36 PUBLIC interpun , interpvn37 PUBLIC interptsn, 38 PUBLIC interpunb, interpvnb , interpub2b, interpvb2b36 PUBLIC interpun , interpvn 37 PUBLIC interptsn, interpsshn 38 PUBLIC interpunb, interpvnb , interpub2b, interpvb2b 39 39 PUBLIC interpe3t, interpumsk, interpvmsk 40 # if defined key_zdftke41 40 PUBLIC Agrif_tke, interpavm 42 # endif43 41 44 42 INTEGER :: bdy_tinterp = 0 … … 46 44 # include "vectopt_loop_substitute.h90" 47 45 !!---------------------------------------------------------------------- 48 !! NEMO/NST 3.7 , NEMO Consortium (2015)46 !! NEMO/NST 4.0 , NEMO Consortium (2017) 49 47 !! $Id$ 50 48 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) … … 385 383 !! *** ROUTINE Agrif_dyn_ts *** 386 384 !!---------------------------------------------------------------------- 387 !!388 385 INTEGER, INTENT(in) :: jn 389 386 !! … … 444 441 !! *** ROUTINE Agrif_dta_ts *** 445 442 !!---------------------------------------------------------------------- 446 !!447 443 INTEGER, INTENT(in) :: kt 448 444 !! … … 504 500 !!---------------------------------------------------------------------- 505 501 INTEGER, INTENT(in) :: kt 506 !!507 502 !!---------------------------------------------------------------------- 508 503 ! … … 541 536 !!---------------------------------------------------------------------- 542 537 ! 543 IF( (nbondi == -1).OR.(nbondi == 2)) THEN538 IF( nbondi == -1 .OR. nbondi == 2 ) THEN 544 539 DO jj = 1, jpj 545 540 ssha_e(2,jj) = hbdy_w(jj) … … 547 542 ENDIF 548 543 ! 549 IF( (nbondi == 1).OR.(nbondi == 2)) THEN544 IF( nbondi == 1 .OR. nbondi == 2 ) THEN 550 545 DO jj = 1, jpj 551 546 ssha_e(nlci-1,jj) = hbdy_e(jj) … … 553 548 ENDIF 554 549 ! 555 IF( (nbondj == -1).OR.(nbondj == 2)) THEN550 IF( nbondj == -1 .OR.(nbondj == 2 ) THEN 556 551 DO ji = 1, jpi 557 552 ssha_e(ji,2) = hbdy_s(ji) … … 559 554 ENDIF 560 555 ! 561 IF( (nbondj == 1).OR.(nbondj == 2)) THEN556 IF( nbondj == 1 .OR. nbondj == 2 ) THEN 562 557 DO ji = 1, jpi 563 558 ssha_e(ji,nlcj-1) = hbdy_n(ji) … … 567 562 END SUBROUTINE Agrif_ssh_ts 568 563 569 # if defined key_zdftke570 564 571 565 SUBROUTINE Agrif_tke … … 579 573 IF( zalpha > 1. ) zalpha = 1. 580 574 ! 581 Agrif_SpecialValue = 0. e0575 Agrif_SpecialValue = 0._wp 582 576 Agrif_UseSpecialValue = .TRUE. 583 577 ! 584 CALL Agrif_Bc_variable( avm_id ,calledweight=zalpha, procname=interpavm)578 CALL Agrif_Bc_variable( avm_id , calledweight=zalpha, procname=interpavm ) 585 579 ! 586 580 Agrif_UseSpecialValue = .FALSE. 587 581 ! 588 582 END SUBROUTINE Agrif_tke 589 590 # endif 583 591 584 592 585 SUBROUTINE interptsn( ptab, i1, i2, j1, j2, k1, k2, n1, n2, before, nb, ndir ) 593 586 !!---------------------------------------------------------------------- 594 !! *** ROUTINE interptsn ***587 !! *** ROUTINE interptsn *** 595 588 !!---------------------------------------------------------------------- 596 589 REAL(wp), DIMENSION(i1:i2,j1:j2,k1:k2,n1:n2), INTENT(inout) :: ptab … … 599 592 INTEGER , INTENT(in ) :: nb , ndir 600 593 ! 601 INTEGER 602 INTEGER 603 REAL(wp) 604 REAL(wp) 605 LOGICAL 594 INTEGER :: ji, jj, jk, jn ! dummy loop indices 595 INTEGER :: imin, imax, jmin, jmax 596 REAL(wp):: zrhox , zalpha1, zalpha2, zalpha3 597 REAL(wp):: zalpha4, zalpha5, zalpha6, zalpha7 598 LOGICAL :: western_side, eastern_side,northern_side,southern_side 606 599 !!---------------------------------------------------------------------- 607 600 ! … … 770 763 SUBROUTINE interpun( ptab, i1, i2, j1, j2, k1, k2, before ) 771 764 !!---------------------------------------------------------------------- 772 !! *** ROUTINE interpun ***765 !! *** ROUTINE interpun *** 773 766 !!---------------------------------------------------------------------- 774 767 INTEGER , INTENT(in ) :: i1, i2, j1, j2, k1, k2 … … 776 769 LOGICAL , INTENT(in ) :: before 777 770 ! 778 INTEGER 779 REAL(wp) 771 INTEGER :: ji, jj, jk 772 REAL(wp):: zrhoy 780 773 !!---------------------------------------------------------------------- 781 774 ! … … 798 791 SUBROUTINE interpvn( ptab, i1, i2, j1, j2, k1, k2, before ) 799 792 !!---------------------------------------------------------------------- 800 !! *** ROUTINE interpvn ***793 !! *** ROUTINE interpvn *** 801 794 !!---------------------------------------------------------------------- 802 795 INTEGER , INTENT(in ) :: i1, i2, j1, j2, k1, k2 … … 804 797 LOGICAL , INTENT(in ) :: before 805 798 ! 806 INTEGER 807 REAL(wp) 799 INTEGER :: ji, jj, jk 800 REAL(wp):: zrhox 808 801 !!---------------------------------------------------------------------- 809 802 ! … … 831 824 INTEGER , INTENT(in ) :: nb , ndir 832 825 ! 833 INTEGER 834 REAL(wp) 835 LOGICAL 826 INTEGER :: ji, jj 827 REAL(wp):: zrhoy, zrhot, zt0, zt1, ztcoeff 828 LOGICAL :: western_side, eastern_side,northern_side,southern_side 836 829 !!---------------------------------------------------------------------- 837 830 ! … … 901 894 INTEGER , INTENT(in ) :: nb , ndir 902 895 ! 903 INTEGER 904 REAL(wp) 905 LOGICAL 896 INTEGER :: ji,jj 897 REAL(wp):: zrhox, zrhot, zt0, zt1, ztcoeff 898 LOGICAL :: western_side, eastern_side,northern_side,southern_side 906 899 !!---------------------------------------------------------------------- 907 900 ! … … 919 912 zt1 = REAL(Agrif_NbStepint()+1, wp) / zrhot 920 913 IF( bdy_tinterp == 1 ) THEN 921 ztcoeff = zrhot * ( zt1**2._wp * ( 922 & - zt0**2._wp * ( 914 ztcoeff = zrhot * ( zt1**2._wp * ( zt1 - 1._wp) & 915 & - zt0**2._wp * ( zt0 - 1._wp) ) 923 916 ELSEIF( bdy_tinterp == 2 ) THEN 924 ztcoeff = zrhot * ( zt1 * ( 925 & - zt0 * ( 917 ztcoeff = zrhot * ( zt1 * ( zt1 - 1._wp)**2._wp & 918 & - zt0 * ( zt0 - 1._wp)**2._wp ) 926 919 ELSE 927 920 ztcoeff = 1 … … 942 935 ! 943 936 IF( bdy_tinterp == 0 .OR. bdy_tinterp == 2) THEN 944 IF(western_side) THEN 945 vbdy_w(j1:j2) = vbdy_w(j1:j2) / (zrhox*e1v(i1,j1:j2)) & 946 & * vmask(i1,j1:j2,1) 947 ENDIF 948 IF(eastern_side) THEN 949 vbdy_e(j1:j2) = vbdy_e(j1:j2) / (zrhox*e1v(i1,j1:j2)) & 950 & * vmask(i1,j1:j2,1) 951 ENDIF 952 IF(southern_side) THEN 953 vbdy_s(i1:i2) = vbdy_s(i1:i2) / (zrhox*e1v(i1:i2,j1)) & 954 & * vmask(i1:i2,j1,1) 955 ENDIF 956 IF(northern_side) THEN 957 vbdy_n(i1:i2) = vbdy_n(i1:i2) / (zrhox*e1v(i1:i2,j1)) & 958 & * vmask(i1:i2,j1,1) 937 IF( western_side ) vbdy_w(j1:j2) = vbdy_w(j1:j2) / (zrhox*e1v(i1,j1:j2)) * vmask(i1,j1:j2,1) 938 IF( eastern_side ) vbdy_e(j1:j2) = vbdy_e(j1:j2) / (zrhox*e1v(i1,j1:j2)) * vmask(i1,j1:j2,1) 939 IF( southern_side ) vbdy_s(i1:i2) = vbdy_s(i1:i2) / (zrhox*e1v(i1:i2,j1)) * vmask(i1:i2,j1,1) 940 IF( northern_side ) vbdy_n(i1:i2) = vbdy_n(i1:i2) / (zrhox*e1v(i1:i2,j1)) * vmask(i1:i2,j1,1) 959 941 ENDIF 960 942 ENDIF … … 973 955 INTEGER , INTENT(in ) :: nb , ndir 974 956 ! 975 INTEGER 976 REAL(wp) 977 LOGICAL 957 INTEGER :: ji,jj 958 REAL(wp):: zrhot, zt0, zt1,zat 959 LOGICAL :: western_side, eastern_side,northern_side,southern_side 978 960 !!---------------------------------------------------------------------- 979 961 IF( before ) THEN … … 1030 1012 & - zt0**2._wp * (-2._wp*zt0 + 3._wp) ) 1031 1013 ! 1032 IF( western_side) vbdy_w(j1:j2) = zat * ptab(i1,j1:j2)1033 IF( eastern_side) vbdy_e(j1:j2) = zat * ptab(i1,j1:j2)1034 IF( southern_side) vbdy_s(i1:i2) = zat * ptab(i1:i2,j1)1035 IF( northern_side) vbdy_n(i1:i2) = zat * ptab(i1:i2,j1)1014 IF( western_side ) vbdy_w(j1:j2) = zat * ptab(i1,j1:j2) 1015 IF( eastern_side ) vbdy_e(j1:j2) = zat * ptab(i1,j1:j2) 1016 IF( southern_side ) vbdy_s(i1:i2) = zat * ptab(i1:i2,j1) 1017 IF( northern_side ) vbdy_n(i1:i2) = zat * ptab(i1:i2,j1) 1036 1018 ENDIF 1037 1019 ! … … 1048 1030 INTEGER , INTENT(in ) :: nb , ndir 1049 1031 ! 1050 INTEGER :: ji, jj, jk1051 LOGICAL :: western_side, eastern_side, northern_side, southern_side1052 REAL(wp) ::ztmpmsk1032 INTEGER :: ji, jj, jk 1033 LOGICAL :: western_side, eastern_side, northern_side, southern_side 1034 REAL(wp):: ztmpmsk 1053 1035 !!---------------------------------------------------------------------- 1054 1036 ! … … 1065 1047 DO ji = i1, i2 1066 1048 ! Get velocity mask at boundary edge points: 1067 IF( western_side ) ztmpmsk = umask(ji ,jj ,1)1068 IF( eastern_side ) ztmpmsk = umask(nlci-2,jj ,1)1069 IF( northern_side ) ztmpmsk = vmask(ji ,nlcj-2,1)1070 IF( southern_side ) ztmpmsk = vmask(ji ,2 ,1)1049 IF( western_side ) ztmpmsk = umask(ji ,jj ,1) 1050 IF( eastern_side ) ztmpmsk = umask(nlci-2,jj ,1) 1051 IF( northern_side ) ztmpmsk = vmask(ji ,nlcj-2,1) 1052 IF( southern_side ) ztmpmsk = vmask(ji ,2 ,1) 1071 1053 ! 1072 1054 IF( ABS( ptab(ji,jj,jk) - tmask(ji,jj,jk) * e3t_0(ji,jj,jk) )*ztmpmsk > 1.D-2) THEN … … 1141 1123 REAL(wp),DIMENSION(i1:i2,j1:j2,k1:k2), INTENT(inout) :: ptab 1142 1124 LOGICAL , INTENT(in ) :: before 1143 INTEGER , INTENT(in ) :: nb , ndir1125 INTEGER , INTENT(in ) :: nb , ndir 1144 1126 ! 1145 1127 INTEGER :: ji, jj, jk … … 1175 1157 END SUBROUTINE interpvmsk 1176 1158 1177 # if defined key_zdftke1178 1159 1179 1160 SUBROUTINE interpavm( ptab, i1, i2, j1, j2, k1, k2, before ) … … 1186 1167 !!---------------------------------------------------------------------- 1187 1168 ! 1188 IF( before ) THEN 1189 ptab (i1:i2,j1:j2,k1:k2) = avm_k(i1:i2,j1:j2,k1:k2) 1190 ELSE 1191 avm_k(i1:i2,j1:j2,k1:k2) = ptab (i1:i2,j1:j2,k1:k2) 1169 IF( before ) THEN ; ptab (i1:i2,j1:j2,k1:k2) = avm_k(i1:i2,j1:j2,k1:k2) 1170 ELSE ; avm_k(i1:i2,j1:j2,k1:k2) = ptab (i1:i2,j1:j2,k1:k2) 1192 1171 ENDIF 1193 1172 ! 1194 1173 END SUBROUTINE interpavm 1195 1196 # endif /* key_zdftke */1197 1174 1198 1175 #else -
branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/NST_SRC/agrif_opa_sponge.F90
r7646 r7953 3 3 MODULE agrif_opa_sponge 4 4 !!====================================================================== 5 !! *** MODULE agrif_opa_update***6 !! AGRIF :5 !! *** MODULE agrif_opa_interp *** 6 !! AGRIF: interpolation package 7 7 !!====================================================================== 8 !! History : 8 !! History : 2.0 ! 2002-06 (XXX) Original cade 9 !! - ! 2005-11 (XXX) 10 !! 3.2 ! 2009-04 (R. Benshila) 11 !! 3.6 ! 2014-09 (R. Benshila) 9 12 !!---------------------------------------------------------------------- 10 13 #if defined key_agrif 14 !!---------------------------------------------------------------------- 15 !! 'key_agrif' AGRIF zoom 16 !!---------------------------------------------------------------------- 11 17 USE par_oce 12 18 USE oce 13 19 USE dom_oce 20 ! 14 21 USE in_out_manager 15 22 USE agrif_oce … … 24 31 25 32 !!---------------------------------------------------------------------- 26 !! NEMO/NST 3.7 , NEMO Consortium (2015)33 !! NEMO/NST 4.0 , NEMO Consortium (2017) 27 34 !! $Id$ 28 35 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) … … 31 38 32 39 SUBROUTINE Agrif_Sponge_Tra 33 !!--------------------------------------------- 34 !! *** ROUTINE Agrif_Sponge_Tra ***35 !!--------------------------------------------- 36 REAL(wp) :: timecoeff37 !!--------------------------------------------- 40 !!---------------------------------------------------------------------- 41 !! *** ROUTINE Agrif_Sponge_Tra *** 42 !!---------------------------------------------------------------------- 43 REAL(wp) :: timecoeff ! local scalar 44 !!---------------------------------------------------------------------- 38 45 ! 39 46 #if defined SPONGE 40 47 timecoeff = REAL(Agrif_NbStepint(),wp)/Agrif_rhot() 41 48 ! 42 49 CALL Agrif_Sponge 43 Agrif_SpecialValue =0.50 Agrif_SpecialValue = 0._wp 44 51 Agrif_UseSpecialValue = .TRUE. 45 tabspongedone_tsn = .FALSE.46 52 tabspongedone_tsn = .FALSE. 53 ! 47 54 CALL Agrif_Bc_Variable(tsn_sponge_id,calledweight=timecoeff,procname=interptsn_sponge) 48 55 ! 49 56 Agrif_UseSpecialValue = .FALSE. 50 57 #endif … … 54 61 55 62 SUBROUTINE Agrif_Sponge_dyn 56 !!--------------------------------------------- 57 !! *** ROUTINE Agrif_Sponge_dyn ***58 !!--------------------------------------------- 59 REAL(wp) :: timecoeff60 !!--------------------------------------------- 61 63 !!---------------------------------------------------------------------- 64 !! *** ROUTINE Agrif_Sponge_dyn *** 65 !!---------------------------------------------------------------------- 66 REAL(wp) :: timecoeff ! local scalar 67 !!---------------------------------------------------------------------- 68 ! 62 69 #if defined SPONGE 63 70 timecoeff = REAL(Agrif_NbStepint(),wp)/Agrif_rhot() 64 65 Agrif_SpecialValue =0.71 ! 72 Agrif_SpecialValue = 0._wp 66 73 Agrif_UseSpecialValue = ln_spc_dyn 67 74 ! 68 75 tabspongedone_u = .FALSE. 69 76 tabspongedone_v = .FALSE. 70 77 CALL Agrif_Bc_Variable(un_sponge_id,calledweight=timecoeff,procname=interpun_sponge) 71 78 ! 72 79 tabspongedone_u = .FALSE. 73 80 tabspongedone_v = .FALSE. 74 81 CALL Agrif_Bc_Variable(vn_sponge_id,calledweight=timecoeff,procname=interpvn_sponge) 75 82 ! 76 83 Agrif_UseSpecialValue = .FALSE. 77 84 #endif … … 81 88 82 89 SUBROUTINE Agrif_Sponge 83 !!--------------------------------------------- 84 !! *** ROUTINE Agrif_Sponge ***85 !!--------------------------------------------- 90 !!---------------------------------------------------------------------- 91 !! *** ROUTINE Agrif_Sponge *** 92 !!---------------------------------------------------------------------- 86 93 INTEGER :: ji,jj,jk 87 94 INTEGER :: ispongearea, ilci, ilcj … … 89 96 REAL(wp) :: z1spongearea, zramp 90 97 REAL(wp), POINTER, DIMENSION(:,:) :: ztabramp 91 98 !!---------------------------------------------------------------------- 99 ! 92 100 #if defined SPONGE || defined SPONGE_TOP 93 101 ll_spdone=.TRUE. … … 176 184 fsahm_spt(ji,jj) = visc_dyn * ztabramp(ji,jj) 177 185 fsahm_spf(ji,jj) = 0.25_wp * visc_dyn * ( ztabramp(ji,jj) + ztabramp(ji ,jj+1) & 178 &+ztabramp(ji,jj) + ztabramp(ji+1,jj ) )179 END DO 180 END DO 181 186 & +ztabramp(ji,jj) + ztabramp(ji+1,jj ) ) 187 END DO 188 END DO 189 ! 182 190 CALL lbc_lnk( fsahm_spt, 'T', 1. ) ! Lateral boundary conditions 183 191 CALL lbc_lnk( fsahm_spf, 'F', 1. ) … … 192 200 193 201 194 SUBROUTINE interptsn_sponge( tabres,i1,i2,j1,j2,k1,k2,n1,n2,before)195 !!--------------------------------------------- 196 !! *** ROUTINE interptsn_sponge ***197 !!--------------------------------------------- 198 INTEGER , INTENT(in) :: i1,i2,j1,j2,k1,k2,n1,n2199 REAL(wp), DIMENSION(i1:i2,j1:j2,k1:k2,n1:n2), INTENT(inout) :: tabres200 LOGICAL , INTENT(in) ::before202 SUBROUTINE interptsn_sponge( tabres, i1, i2, j1, j2, k1, k2, n1, n2, before ) 203 !!---------------------------------------------------------------------- 204 !! *** ROUTINE interptsn_sponge *** 205 !!---------------------------------------------------------------------- 206 INTEGER , INTENT(in ) :: i1, i2, j1, j2, k1, k2, n1, n2 207 REAL(wp), DIMENSION(i1:i2,j1:j2,k1:k2,n1:n2), INTENT(inout) :: tabres 208 LOGICAL , INTENT(in ) :: before 201 209 ! 202 210 INTEGER :: ji, jj, jk, jn ! dummy loop indices … … 205 213 REAL(wp), DIMENSION(i1:i2,j1:j2,k1:k2) :: ztu, ztv 206 214 REAL(wp), DIMENSION(i1:i2,j1:j2,k1:k2,n1:n2) ::tsbdiff 215 !!---------------------------------------------------------------------- 207 216 ! 208 217 IF( before ) THEN … … 258 267 259 268 260 SUBROUTINE interpun_sponge( tabres,i1,i2,j1,j2,k1,k2, before)261 !!--------------------------------------------- 262 !! *** ROUTINE interpun_sponge ***263 !!--------------------------------------------- 264 INTEGER , INTENT(in) :: i1,i2,j1,j2,k1,k2265 REAL(wp), DIMENSION(i1:i2,j1:j2,k1:k2), INTENT(inout) :: tabres266 LOGICAL , INTENT(in) ::before267 269 SUBROUTINE interpun_sponge( tabres, i1, i2, j1, j2, k1, k2, before ) 270 !!---------------------------------------------------------------------- 271 !! *** ROUTINE interpun_sponge *** 272 !!---------------------------------------------------------------------- 273 INTEGER , INTENT(in ) :: i1, i2, j1, j2, k1, k2 274 REAL(wp), DIMENSION(i1:i2,j1:j2,k1:k2), INTENT(inout) :: tabres 275 LOGICAL , INTENT(in ) :: before 276 !! 268 277 INTEGER :: ji,jj,jk 269 270 ! sponge parameters 278 INTEGER :: jmax 271 279 REAL(wp) :: ze2u, ze1v, zua, zva, zbtr 272 280 REAL(wp), DIMENSION(i1:i2,j1:j2,k1:k2) :: ubdiff 273 281 REAL(wp), DIMENSION(i1:i2,j1:j2,k1:k2) :: rotdiff, hdivdiff 274 INTEGER :: jmax 275 !!--------------------------------------------- 282 !!---------------------------------------------------------------------- 276 283 ! 277 284 IF( before ) THEN … … 356 363 357 364 358 SUBROUTINE interpvn_sponge(tabres,i1,i2,j1,j2,k1,k2, before,nb,ndir) 359 !!--------------------------------------------- 360 !! *** ROUTINE interpvn_sponge *** 361 !!--------------------------------------------- 362 INTEGER, INTENT(in) :: i1,i2,j1,j2,k1,k2 363 REAL(wp), DIMENSION(i1:i2,j1:j2,k1:k2), INTENT(inout) :: tabres 364 LOGICAL, INTENT(in) :: before 365 INTEGER, INTENT(in) :: nb , ndir 366 ! 367 INTEGER :: ji, jj, jk 368 REAL(wp) :: ze2u, ze1v, zua, zva, zbtr 369 REAL(wp), DIMENSION(i1:i2,j1:j2,k1:k2) :: vbdiff 370 REAL(wp), DIMENSION(i1:i2,j1:j2,k1:k2) :: rotdiff, hdivdiff 371 INTEGER :: imax 372 !!--------------------------------------------- 365 SUBROUTINE interpvn_sponge( tabres, i1, i2, j1, j2, k1, k2, before, nb, ndir ) 366 !!---------------------------------------------------------------------- 367 !! *** ROUTINE interpvn_sponge *** 368 !!---------------------------------------------------------------------- 369 INTEGER , INTENT(in ) :: i1, i2, j1, j2, k1, k2 370 REAL(wp), DIMENSION(i1:i2,j1:j2,k1:k2), INTENT(inout) :: tabres 371 LOGICAL , INTENT(in ) :: before 372 INTEGER , INTENT(in ) :: nb , ndir 373 ! 374 INTEGER :: ji, jj, jk 375 INTEGER :: imax 376 REAL(wp):: ze2u, ze1v, zua, zva, zbtr 377 REAL(wp), DIMENSION(i1:i2,j1:j2,k1:k2) :: vbdiff, rotdiff, hdivdiff 378 !!---------------------------------------------------------------------- 373 379 374 380 IF( before ) THEN … … 403 409 ! 404 410 405 imax = i2 -1411 imax = i2 - 1 406 412 IF ((nbondi == 1).OR.(nbondi == 2)) imax = MIN(imax,nlci-3) 407 413 … … 437 443 438 444 #else 445 !!---------------------------------------------------------------------- 446 !! Empty module no AGRIF zoom 447 !!---------------------------------------------------------------------- 439 448 CONTAINS 440 449 SUBROUTINE agrif_opa_sponge_empty 441 !!--------------------------------------------- 442 !! *** ROUTINE agrif_OPA_sponge_empty ***443 !!--------------------------------------------- 450 !!---------------------------------------------------------------------- 451 !! *** ROUTINE agrif_OPA_sponge_empty *** 452 !!---------------------------------------------------------------------- 444 453 WRITE(*,*) 'agrif_opa_sponge : You should not have seen this print! error?' 445 454 END SUBROUTINE agrif_opa_sponge_empty -
branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/NST_SRC/agrif_opa_update.F90
r7646 r7953 3 3 4 4 MODULE agrif_opa_update 5 !!====================================================================== 6 !! *** MODULE agrif_opa_interp *** 7 !! AGRIF: interpolation package 8 !!====================================================================== 9 !! History : 2.0 ! 2002-06 (XXX) Original cade 10 !! - ! 2005-11 (XXX) 11 !! 3.2 ! 2009-04 (R. Benshila) 12 !! 3.6 ! 2014-09 (R. Benshila) 13 !!---------------------------------------------------------------------- 5 14 #if defined key_agrif 15 !!---------------------------------------------------------------------- 16 !! 'key_agrif' AGRIF zoom 17 !!---------------------------------------------------------------------- 6 18 USE par_oce 7 19 USE oce 8 20 USE dom_oce 21 USE zdf_oce ! vertical physics: ocean variables 9 22 USE agrif_oce 10 USE in_out_manager ! I/O manager 23 ! 24 USE in_out_manager ! I/O manager 11 25 USE lib_mpp 12 26 USE wrk_nemo 13 USE zdf_oce ! vertical physics: ocean variables14 27 15 28 IMPLICIT NONE 16 29 PRIVATE 17 30 18 PUBLIC Agrif_Update_Tra, Agrif_Update_Dyn,Update_Scales 19 # if defined key_zdftke 20 PUBLIC Agrif_Update_Tke 21 # endif 31 PUBLIC Agrif_Update_Tra, Agrif_Update_Dyn, Update_Scales 32 PUBLIC Agrif_Update_Tke 33 22 34 !!---------------------------------------------------------------------- 23 !! NEMO/NST 3.6 , NEMO Consortium (2010)35 !! NEMO/NST 4.0 , NEMO Consortium (2017) 24 36 !! $Id$ 25 37 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) … … 28 40 29 41 RECURSIVE SUBROUTINE Agrif_Update_Tra( ) 30 !!--------------------------------------------- 31 !! *** ROUTINE Agrif_Update_Tra ***32 !!--------------------------------------------- 42 !!---------------------------------------------------------------------- 43 !! *** ROUTINE Agrif_Update_Tra *** 44 !!---------------------------------------------------------------------- 33 45 ! 34 46 IF (Agrif_Root()) RETURN … … 38 50 39 51 Agrif_UseSpecialValueInUpdate = .TRUE. 40 Agrif_SpecialValueFineGrid = 0.52 Agrif_SpecialValueFineGrid = 0._wp 41 53 ! 42 54 IF (MOD(nbcline,nbclineupdate) == 0) THEN … … 68 80 69 81 RECURSIVE SUBROUTINE Agrif_Update_Dyn( ) 70 !!--------------------------------------------- 71 !! *** ROUTINE Agrif_Update_Dyn ***72 !!--------------------------------------------- 82 !!---------------------------------------------------------------------- 83 !! *** ROUTINE Agrif_Update_Dyn *** 84 !!---------------------------------------------------------------------- 73 85 ! 74 86 IF (Agrif_Root()) RETURN … … 106 118 # endif 107 119 108 IF ( ln_dynspg_ts .AND.ln_bt_fw ) THEN120 IF ( ln_dynspg_ts .AND. ln_bt_fw ) THEN 109 121 ! Update time integrated transports 110 122 IF (mod(nbcline,nbclineupdate) == 0) THEN … … 149 161 END SUBROUTINE Agrif_Update_Dyn 150 162 151 # if defined key_zdftke 163 !!gm Missing GLS case !!!!! 152 164 153 165 SUBROUTINE Agrif_Update_Tke( kt ) 154 !!--------------------------------------------- 155 !! *** ROUTINE Agrif_Update_Tke *** 156 !!--------------------------------------------- 157 !! 166 !!---------------------------------------------------------------------- 167 !! *** ROUTINE Agrif_Update_Tke *** 168 !!---------------------------------------------------------------------- 158 169 INTEGER, INTENT(in) :: kt 159 ! 160 IF( ( Agrif_NbStepint() .NE. 0 ) .AND. (kt /= 0) ) RETURN 170 !!---------------------------------------------------------------------- 171 ! 172 !!gm test on kt/=0 ???? why not nit000-1 ? doesn't seem logic 173 IF( ( Agrif_NbStepint() /= 0 ) .AND. kt /= 0 ) RETURN 161 174 # if defined TWO_WAY 162 175 ! 163 176 Agrif_UseSpecialValueInUpdate = .TRUE. 164 Agrif_SpecialValueFineGrid = 0.165 166 CALL Agrif_Update_Variable( en_id, locupdate=(/0,0/), procname=updateEN )167 CALL Agrif_Update_Variable( avt_id, locupdate=(/0,0/), procname=updateAVT )168 CALL Agrif_Update_Variable( avm_id, locupdate=(/0,0/), procname=updateAVM )169 177 Agrif_SpecialValueFineGrid = 0._wp 178 ! 179 CALL Agrif_Update_Variable( en_id, locupdate=(/0,0/), procname=updateEN ) 180 CALL Agrif_Update_Variable( avt_id, locupdate=(/0,0/), procname=updateAVT ) 181 CALL Agrif_Update_Variable( avm_id, locupdate=(/0,0/), procname=updateAVM ) 182 ! 170 183 Agrif_UseSpecialValueInUpdate = .FALSE. 171 184 ! 172 185 # endif 173 186 ! 174 187 END SUBROUTINE Agrif_Update_Tke 175 188 176 # endif /* key_zdftke */177 189 178 190 SUBROUTINE updateTS( tabres, i1, i2, j1, j2, k1, k2, n1, n2, before ) 179 !!--------------------------------------------- 191 !!---------------------------------------------------------------------- 180 192 !! *** ROUTINE updateT *** 181 !!--------------------------------------------- 182 INTEGER , INTENT(in) :: i1,i2,j1,j2,k1,k2,n1,n2183 REAL(wp),DIMENSION(i1:i2,j1:j2,k1:k2,n1:n2), INTENT(inout) :: tabres184 LOGICAL , INTENT(in) ::before185 ! !186 INTEGER :: ji, jj,jk,jn187 !!--------------------------------------------- 188 ! 189 IF (before) THEN190 DO jn = n1, n2191 DO jk =k1,k2192 DO jj =j1,j2193 DO ji =i1,i2193 !!---------------------------------------------------------------------- 194 INTEGER , INTENT(in ) :: i1, i2, j1, j2, k1, k2, n1, n2 195 REAL(wp),DIMENSION(i1:i2,j1:j2,k1:k2,n1:n2), INTENT(inout) :: tabres 196 LOGICAL , INTENT(in ) :: before 197 ! 198 INTEGER :: ji, jj, jk, jn 199 !!---------------------------------------------------------------------- 200 ! 201 IF( before ) THEN 202 DO jn = n1, n2 203 DO jk = k1, k2 204 DO jj = j1, j2 205 DO ji = i1, i2 194 206 tabres(ji,jj,jk,jn) = tsn(ji,jj,jk,jn) 195 207 END DO … … 209 221 & - tsn(ji,jj,jk,jn) ) * tmask(ji,jj,jk) 210 222 ENDIF 211 END DO212 END DO213 END DO214 END DO223 END DO 224 END DO 225 END DO 226 END DO 215 227 ENDIF 216 228 DO jn = n1,n2 … … 238 250 LOGICAL , INTENT(in ) :: before 239 251 ! 240 INTEGER 241 REAL(wp) 252 INTEGER :: ji, jj, jk 253 REAL(wp):: zrhoy 242 254 !!--------------------------------------------- 243 255 ! … … 268 280 269 281 SUBROUTINE updatev( tabres, i1, i2, j1, j2, k1, k2, before ) 270 !!--------------------------------------------- 271 !! *** ROUTINE updatev *** 272 !!--------------------------------------------- 273 INTEGER :: i1,i2,j1,j2,k1,k2 274 INTEGER :: ji,jj,jk 275 REAL(wp), DIMENSION(i1:i2,j1:j2,k1:k2) :: tabres 276 LOGICAL :: before 282 !!---------------------------------------------------------------------- 283 !! *** ROUTINE updatev *** 284 !!---------------------------------------------------------------------- 285 INTEGER , INTENT(in ) :: i1, i2, j1, j2, k1, k2 286 REAL(wp), DIMENSION(i1:i2,j1:j2,k1:k2), INTENT(inout) :: tabres 287 LOGICAL , INTENT(in ) :: before 277 288 !! 278 REAL(wp) :: zrhox 279 !!--------------------------------------------- 280 ! 281 IF (before) THEN 289 INTEGER :: ji, jj, jk 290 REAL(wp) :: zrhox 291 !!---------------------------------------------------------------------- 292 ! 293 IF( before ) THEN 282 294 zrhox = Agrif_Rhox() 283 295 DO jk=k1,k2 … … 309 321 310 322 SUBROUTINE updateu2d( tabres, i1, i2, j1, j2, before ) 323 !!---------------------------------------------------------------------- 324 !! *** ROUTINE updateu2d *** 325 !!---------------------------------------------------------------------- 326 INTEGER , INTENT(in ) :: i1, i2, j1, j2 327 REAL(wp), DIMENSION(i1:i2,j1:j2), INTENT(inout) :: tabres 328 LOGICAL , INTENT(in ) :: before 329 !! 330 INTEGER :: ji, jj, jk 331 REAL(wp):: zrhoy, zcorr 311 332 !!--------------------------------------------- 312 !! *** ROUTINE updateu2d *** 313 !!--------------------------------------------- 314 INTEGER, INTENT(in) :: i1, i2, j1, j2 315 REAL(wp), DIMENSION(i1:i2,j1:j2), INTENT(inout) :: tabres 316 LOGICAL, INTENT(in) :: before 317 !! 318 INTEGER :: ji, jj, jk 319 REAL(wp) :: zrhoy 320 REAL(wp) :: zcorr 321 !!--------------------------------------------- 322 ! 323 IF (before) THEN 333 ! 334 IF( before ) THEN 324 335 zrhoy = Agrif_Rhoy() 325 336 DO jj=j1,j2 … … 374 385 375 386 SUBROUTINE updatev2d( tabres, i1, i2, j1, j2, before ) 376 !!--------------------------------------------- 377 !! *** ROUTINE updatev2d ***378 !!--------------------------------------------- 379 INTEGER , INTENT(in) ::i1, i2, j1, j2380 REAL(wp), DIMENSION(i1:i2,j1:j2), INTENT(inout) :: tabres381 LOGICAL , INTENT(in) ::before382 ! !387 !!---------------------------------------------------------------------- 388 !! *** ROUTINE updatev2d *** 389 !!---------------------------------------------------------------------- 390 INTEGER , INTENT(in ) :: i1, i2, j1, j2 391 REAL(wp), DIMENSION(i1:i2,j1:j2), INTENT(inout) :: tabres 392 LOGICAL , INTENT(in ) :: before 393 ! 383 394 INTEGER :: ji, jj, jk 384 REAL(wp) :: zrhox 385 REAL(wp) :: zcorr 386 !!--------------------------------------------- 387 ! 388 IF (before) THEN 395 REAL(wp) :: zrhox, zcorr 396 !!---------------------------------------------------------------------- 397 ! 398 IF( before ) THEN 389 399 zrhox = Agrif_Rhox() 390 400 DO jj=j1,j2 … … 439 449 440 450 SUBROUTINE updateSSH( tabres, i1, i2, j1, j2, before ) 441 !!--------------------------------------------- 442 !! *** ROUTINE updateSSH ***443 !!--------------------------------------------- 444 INTEGER , INTENT(in) ::i1, i2, j1, j2445 REAL(wp), DIMENSION(i1:i2,j1:j2), INTENT(inout) :: tabres446 LOGICAL , INTENT(in) ::before451 !!---------------------------------------------------------------------- 452 !! *** ROUTINE updateSSH *** 453 !!---------------------------------------------------------------------- 454 INTEGER , INTENT(in ) :: i1, i2, j1, j2 455 REAL(wp), DIMENSION(i1:i2,j1:j2), INTENT(inout) :: tabres 456 LOGICAL , INTENT(in ) :: before 447 457 !! 448 458 INTEGER :: ji, jj 449 !!--------------------------------------------- 450 ! 451 IF (before) THEN459 !!---------------------------------------------------------------------- 460 ! 461 IF( before ) THEN 452 462 DO jj=j1,j2 453 463 DO ji=i1,i2 … … 478 488 479 489 SUBROUTINE updateub2b( tabres, i1, i2, j1, j2, before ) 480 !!--------------------------------------------- 481 !! *** ROUTINE updateub2b ***482 !!--------------------------------------------- 483 INTEGER , INTENT(in) ::i1, i2, j1, j2484 REAL(wp), DIMENSION(i1:i2,j1:j2), INTENT(inout) :: tabres485 LOGICAL , INTENT(in) ::before490 !!---------------------------------------------------------------------- 491 !! *** ROUTINE updateub2b *** 492 !!---------------------------------------------------------------------- 493 INTEGER , INTENT(in) :: i1, i2, j1, j2 494 REAL(wp), DIMENSION(i1:i2,j1:j2), INTENT(inout) :: tabres 495 LOGICAL , INTENT(in) :: before 486 496 !! 487 INTEGER :: ji, jj488 REAL(wp) ::zrhoy489 !!--------------------------------------------- 497 INTEGER :: ji, jj 498 REAL(wp):: zrhoy 499 !!---------------------------------------------------------------------- 490 500 ! 491 501 IF (before) THEN … … 509 519 510 520 SUBROUTINE updatevb2b( tabres, i1, i2, j1, j2, before ) 511 !!--------------------------------------------- 512 !! *** ROUTINE updatevb2b ***513 !!--------------------------------------------- 514 INTEGER , INTENT(in) ::i1, i2, j1, j2515 REAL(wp), DIMENSION(i1:i2,j1:j2), INTENT(inout) :: tabres516 LOGICAL , INTENT(in) ::before521 !!---------------------------------------------------------------------- 522 !! *** ROUTINE updatevb2b *** 523 !!---------------------------------------------------------------------- 524 INTEGER , INTENT(in ) :: i1, i2, j1, j2 525 REAL(wp), DIMENSION(i1:i2,j1:j2), INTENT(inout) :: tabres 526 LOGICAL , INTENT(in ) :: before 517 527 !! 518 INTEGER :: ji, jj519 REAL(wp) ::zrhox520 !!--------------------------------------------- 521 ! 522 IF (before) THEN528 INTEGER :: ji, jj 529 REAL(wp):: zrhox 530 !!---------------------------------------------------------------------- 531 ! 532 IF( before ) THEN 523 533 zrhox = Agrif_Rhox() 524 534 DO jj=j1,j2 … … 540 550 541 551 SUBROUTINE update_scales( tabres, i1, i2, j1, j2, k1, k2, n1,n2, before ) 542 ! currently not used 543 !!--------------------------------------------- 544 !! *** ROUTINE updateT *** 545 !!--------------------------------------------- 546 INTEGER, INTENT(in) :: i1,i2,j1,j2,k1,k2,n1,n2 547 REAL(wp),DIMENSION(i1:i2,j1:j2,k1:k2,n1:n2), INTENT(inout) :: tabres 548 LOGICAL, iNTENT(in) :: before 549 ! 552 ! 553 ! ====>>>>>>>>>> currently not used 554 ! 555 !!---------------------------------------------------------------------- 556 !! *** ROUTINE updateT *** 557 !!---------------------------------------------------------------------- 558 INTEGER , INTENT(in ) :: i1, i2, j1, j2, k1, k2, n1, n2 559 REAL(wp),DIMENSION(i1:i2,j1:j2,k1:k2,n1:n2), INTENT(inout) :: tabres 560 LOGICAL , INTENT(in ) :: before 561 !! 550 562 INTEGER :: ji,jj,jk 551 563 REAL(wp) :: ztemp 552 !!--------------------------------------------- 564 !!---------------------------------------------------------------------- 553 565 554 566 IF (before) THEN … … 587 599 END SUBROUTINE update_scales 588 600 589 # if defined key_zdftke590 601 591 602 SUBROUTINE updateEN( ptab, i1, i2, j1, j2, k1, k2, before ) 592 !!--------------------------------------------- 593 !! *** ROUTINE updateen ***594 !!--------------------------------------------- 595 INTEGER , INTENT(in) ::i1, i2, j1, j2, k1, k2596 REAL(wp), DIMENSION(i1:i2,j1:j2,k1:k2), INTENT(inout) :: ptab597 LOGICAL , INTENT(in) ::before598 !!--------------------------------------------- 599 ! 600 IF (before) THEN603 !!---------------------------------------------------------------------- 604 !! *** ROUTINE updateen *** 605 !!---------------------------------------------------------------------- 606 INTEGER , INTENT(in ) :: i1, i2, j1, j2, k1, k2 607 REAL(wp), DIMENSION(i1:i2,j1:j2,k1:k2), INTENT(inout) :: ptab 608 LOGICAL , INTENT(in ) :: before 609 !!---------------------------------------------------------------------- 610 ! 611 IF( before ) THEN 601 612 ptab (i1:i2,j1:j2,k1:k2) = en(i1:i2,j1:j2,k1:k2) 602 613 ELSE … … 608 619 609 620 SUBROUTINE updateAVT( ptab, i1, i2, j1, j2, k1, k2, before ) 610 !!--------------------------------------------- 611 !! *** ROUTINE updateavt *** 612 !!--------------------------------------------- 613 INTEGER, INTENT(in) :: i1, i2, j1, j2, k1, k2 614 REAL(wp), DIMENSION(i1:i2,j1:j2,k1:k2), INTENT(inout) :: ptab 615 LOGICAL, INTENT(in) :: before 616 !!--------------------------------------------- 617 ! 618 IF (before) THEN 619 ptab (i1:i2,j1:j2,k1:k2) = avt_k(i1:i2,j1:j2,k1:k2) 620 ELSE 621 avt_k(i1:i2,j1:j2,k1:k2) = ptab (i1:i2,j1:j2,k1:k2) 621 !!---------------------------------------------------------------------- 622 !! *** ROUTINE updateavt *** 623 !!---------------------------------------------------------------------- 624 INTEGER , INTENT(in ) :: i1, i2, j1, j2, k1, k2 625 REAL(wp), DIMENSION(i1:i2,j1:j2,k1:k2), INTENT(inout) :: ptab 626 LOGICAL , INTENT(in ) :: before 627 !!---------------------------------------------------------------------- 628 ! 629 IF( before ) THEN ; ptab (i1:i2,j1:j2,k1:k2) = avt_k(i1:i2,j1:j2,k1:k2) 630 ELSE ; avt_k(i1:i2,j1:j2,k1:k2) = ptab (i1:i2,j1:j2,k1:k2) 622 631 ENDIF 623 632 ! … … 628 637 !!--------------------------------------------- 629 638 !! *** ROUTINE updateavm *** 630 !!--------------------------------------------- 631 INTEGER, INTENT(in) :: i1, i2, j1, j2, k1, k2 632 REAL(wp), DIMENSION(i1:i2,j1:j2,k1:k2), INTENT(inout) :: ptab 633 LOGICAL, INTENT(in) :: before 634 !!--------------------------------------------- 635 ! 636 IF (before) THEN 637 ptab (i1:i2,j1:j2,k1:k2) = avm_k(i1:i2,j1:j2,k1:k2) 638 ELSE 639 avm_k(i1:i2,j1:j2,k1:k2) = ptab (i1:i2,j1:j2,k1:k2) 639 !!---------------------------------------------------------------------- 640 INTEGER , INTENT(in ) :: i1, i2, j1, j2, k1, k2 641 REAL(wp), DIMENSION(i1:i2,j1:j2,k1:k2), INTENT(inout) :: ptab 642 LOGICAL , INTENT(in ) :: before 643 !!---------------------------------------------------------------------- 644 ! 645 IF( before ) THEN ; ptab (i1:i2,j1:j2,k1:k2) = avm_k(i1:i2,j1:j2,k1:k2) 646 ELSE ; avm_k(i1:i2,j1:j2,k1:k2) = ptab (i1:i2,j1:j2,k1:k2) 640 647 ENDIF 641 648 ! 642 649 END SUBROUTINE updateAVM 643 650 644 # endif /* key_zdftke */645 646 651 #else 652 !!---------------------------------------------------------------------- 653 !! Empty module no AGRIF zoom 654 !!---------------------------------------------------------------------- 647 655 CONTAINS 648 656 SUBROUTINE agrif_opa_update_empty 649 !!---------------------------------------------650 !! *** ROUTINE agrif_opa_update_empty ***651 !!---------------------------------------------652 657 WRITE(*,*) 'agrif_opa_update : You should not have seen this print! error?' 653 658 END SUBROUTINE agrif_opa_update_empty 654 659 #endif 660 661 !!====================================================================== 655 662 END MODULE agrif_opa_update 656 663 -
branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/NST_SRC/agrif_top_interp.F90
r6140 r7953 1 1 MODULE agrif_top_interp 2 !!====================================================================== 3 !! *** MODULE agrif_top_interp *** 4 !! AGRIF: interpolation package 5 !!====================================================================== 6 !! History : 2.0 ! ??? 7 !!---------------------------------------------------------------------- 2 8 #if defined key_agrif && defined key_top 9 !!---------------------------------------------------------------------- 10 !! 'key_agrif' AGRIF zoom 11 !! 'key_top' on-line tracers 12 !!---------------------------------------------------------------------- 3 13 USE par_oce 4 14 USE oce … … 8 18 USE par_trc 9 19 USE trc 20 ! 10 21 USE lib_mpp 11 22 USE wrk_nemo … … 16 27 PUBLIC Agrif_trc, interptrn 17 28 18 # include "vectopt_loop_substitute.h90"19 29 !!---------------------------------------------------------------------- 20 !! NEMO/NST 3.6 , NEMO Consortium (2010)30 !! NEMO/NST 4.0 , NEMO Consortium (2017) 21 31 !! $Id$ 22 32 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) … … 26 36 SUBROUTINE Agrif_trc 27 37 !!---------------------------------------------------------------------- 28 !! *** ROUTINE Agrif_trc ***38 !! *** ROUTINE Agrif_trc *** 29 39 !!---------------------------------------------------------------------- 30 40 ! 31 41 IF( Agrif_Root() ) RETURN 32 33 Agrif_SpecialValue = 0. e042 ! 43 Agrif_SpecialValue = 0._wp 34 44 Agrif_UseSpecialValue = .TRUE. 35 45 ! 36 46 CALL Agrif_Bc_variable( trn_id, procname=interptrn ) 37 47 Agrif_UseSpecialValue = .FALSE. … … 40 50 41 51 42 SUBROUTINE interptrn(ptab,i1,i2,j1,j2,k1,k2,n1,n2,before,nb,ndir) 43 !!--------------------------------------------- 44 !! *** ROUTINE interptrn *** 45 !!--------------------------------------------- 46 REAL(wp), DIMENSION(i1:i2,j1:j2,k1:k2,n1:n2), INTENT(inout) :: ptab 47 INTEGER, INTENT(in) :: i1,i2,j1,j2,k1,k2,n1,n2 48 LOGICAL, INTENT(in) :: before 49 INTEGER, INTENT(in) :: nb , ndir 50 ! 51 INTEGER :: ji, jj, jk, jn ! dummy loop indices 52 INTEGER :: imin, imax, jmin, jmax 53 REAL(wp) :: zrhox , zalpha1, zalpha2, zalpha3 54 REAL(wp) :: zalpha4, zalpha5, zalpha6, zalpha7 55 LOGICAL :: western_side, eastern_side,northern_side,southern_side 56 57 IF (before) THEN 52 SUBROUTINE interptrn( ptab, i1, i2, j1, j2, k1, k2, n1, n2, before, nb, ndir ) 53 !!---------------------------------------------------------------------- 54 !! *** ROUTINE interptrn *** 55 !!---------------------------------------------------------------------- 56 REAL(wp), DIMENSION(i1:i2,j1:j2,k1:k2,n1:n2), INTENT(inout) :: ptab 57 INTEGER , INTENT(in ) :: i1, i2, j1, j2, k1, k2, n1, n2 58 LOGICAL , INTENT(in ) :: before 59 INTEGER , INTENT(in ) :: nb , ndir 60 !! 61 INTEGER :: ji, jj, jk, jn ! dummy loop indices 62 INTEGER :: imin, imax, jmin, jmax 63 LOGICAL :: western_side, eastern_side,northern_side,southern_side 64 REAL(wp):: zrhox , zalpha1, zalpha2, zalpha3 65 REAL(wp):: zalpha4, zalpha5, zalpha6, zalpha7 66 !!---------------------------------------------------------------------- 67 ! 68 IF( before ) THEN 58 69 ptab(i1:i2,j1:j2,k1:k2,n1:n2) = trn(i1:i2,j1:j2,k1:k2,n1:n2) 59 70 ELSE … … 185 196 186 197 #else 198 !!---------------------------------------------------------------------- 199 !! Empty module no TOP AGRIF 200 !!---------------------------------------------------------------------- 187 201 CONTAINS 188 202 SUBROUTINE Agrif_TOP_Interp_empty … … 193 207 END SUBROUTINE Agrif_TOP_Interp_empty 194 208 #endif 209 210 !!====================================================================== 195 211 END MODULE agrif_top_interp -
branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/NST_SRC/agrif_top_sponge.F90
r6140 r7953 4 4 !!====================================================================== 5 5 !! *** MODULE agrif_top_sponge *** 6 !! AGRIF : define in memory AGRIF variables for sea-ice6 !! AGRIF : TOP sponge layer 7 7 !!====================================================================== 8 8 !! History : 2.0 ! 2006-08 (R. Benshila, L. Debreu) Original code 9 9 !!---------------------------------------------------------------------- 10 10 #if defined key_agrif && defined key_top 11 11 !!---------------------------------------------------------------------- 12 12 !! Agrif_Sponge_trc : 13 13 !! interptrn_sponge : 14 14 !!---------------------------------------------------------------------- 15 #if defined key_agrif && defined key_top16 15 USE par_oce 17 16 USE par_trc … … 32 31 33 32 !!---------------------------------------------------------------------- 34 !! NEMO/NST 3.7 , NEMO Consortium (2015)33 !! NEMO/NST 4.0 , NEMO Consortium (2017) 35 34 !! $Id$ 36 35 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) … … 42 41 !! *** ROUTINE Agrif_Sponge_Trc *** 43 42 !!---------------------------------------------------------------------- 44 REAL(wp) :: timecoeff 43 REAL(wp) :: timecoeff ! local scalar 45 44 !!---------------------------------------------------------------------- 46 45 ! … … 107 106 108 107 #else 109 108 !!---------------------------------------------------------------------- 109 !! Empty module no TOP AGRIF 110 !!---------------------------------------------------------------------- 110 111 CONTAINS 111 112 SUBROUTINE agrif_top_sponge_empty -
branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/NST_SRC/agrif_top_update.F90
r6140 r7953 6 6 !! *** MODULE agrif_top_update *** 7 7 !! AGRIF : 8 !! ----------------------------------------------------------------------8 !!====================================================================== 9 9 !! History : 10 10 !!---------------------------------------------------------------------- 11 12 11 #if defined key_agrif && defined key_top 12 !!---------------------------------------------------------------------- 13 !! 'key_agrif' AGRIF zoom 14 !! 'key_TOP' on-line tracers 15 !!---------------------------------------------------------------------- 13 16 USE par_oce 14 17 USE oce 18 USE dom_oce 19 USE agrif_oce 15 20 USE par_trc 16 21 USE trc 17 USE dom_oce 18 USE agrif_oce 22 ! 19 23 USE wrk_nemo 20 24 … … 27 31 28 32 !!---------------------------------------------------------------------- 29 !! NEMO/NST 3.7 , NEMO Consortium (2015)33 !! NEMO/NST 4.0 , NEMO Consortium (2017) 30 34 !! $Id$ 31 35 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) … … 112 116 113 117 #else 118 !!---------------------------------------------------------------------- 119 !! Empty module no TOP AGRIF 120 !!---------------------------------------------------------------------- 114 121 CONTAINS 115 122 SUBROUTINE agrif_top_update_empty 116 !!---------------------------------------------117 !! *** ROUTINE agrif_Top_update_empty ***118 !!---------------------------------------------119 123 WRITE(*,*) 'agrif_top_update : You should not have seen this print! error?' 120 124 END SUBROUTINE agrif_top_update_empty -
branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/NST_SRC/agrif_user.F90
r7761 r7953 1 1 #if defined key_agrif 2 2 !!---------------------------------------------------------------------- 3 !! NEMO/NST 3.7 , NEMO Consortium (2016)3 !! NEMO/NST 4.0 , NEMO Consortium (2017) 4 4 !! $Id$ 5 5 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) … … 107 107 !! 108 108 IMPLICIT NONE 109 ! 109 110 !!---------------------------------------------------------------------- 110 111 ! … … 125 126 USE par_oce 126 127 USE oce 127 ! !128 ! 128 129 IMPLICIT NONE 129 130 !!---------------------------------------------------------------------- … … 136 137 ! 2. Type of interpolation 137 138 !------------------------- 138 CALL Agrif_Set_bcinterp( e1u_id,interp1=Agrif_linear,interp2=AGRIF_ppm)139 CALL Agrif_Set_bcinterp( e2v_id,interp1=AGRIF_ppm,interp2=Agrif_linear)139 CALL Agrif_Set_bcinterp( e1u_id, interp1=Agrif_linear, interp2=AGRIF_ppm ) 140 CALL Agrif_Set_bcinterp( e2v_id, interp1=AGRIF_ppm , interp2=Agrif_linear ) 140 141 141 142 ! 3. Location of interpolation 142 143 !----------------------------- 143 CALL Agrif_Set_bc( e1u_id,(/0,0/))144 CALL Agrif_Set_bc( e2v_id,(/0,0/))144 CALL Agrif_Set_bc( e1u_id, (/0,0/) ) 145 CALL Agrif_Set_bc( e2v_id, (/0,0/) ) 145 146 146 147 ! 5. Update type 147 148 !--------------- 148 CALL Agrif_Set_Updatetype( e1u_id,update1 = Agrif_Update_Copy, update2=Agrif_Update_Average)149 CALL Agrif_Set_Updatetype( e2v_id,update1 = Agrif_Update_Average, update2=Agrif_Update_Copy)149 CALL Agrif_Set_Updatetype( e1u_id, update1=Agrif_Update_Copy , update2=Agrif_Update_Average ) 150 CALL Agrif_Set_Updatetype( e2v_id, update1=Agrif_Update_Average, update2=Agrif_Update_Copy ) 150 151 151 152 ! High order updates 152 ! CALL Agrif_Set_Updatetype( e1u_id,update1 = Agrif_Update_Average, update2=Agrif_Update_Full_Weighting)153 ! CALL Agrif_Set_Updatetype( e2v_id,update1 = Agrif_Update_Full_Weighting, update2=Agrif_Update_Average)153 ! CALL Agrif_Set_Updatetype( e1u_id, update1=Agrif_Update_Average , update2=Agrif_Update_Full_Weighting ) 154 ! CALL Agrif_Set_Updatetype( e2v_id, update1=Agrif_Update_Full_Weighting, update2=Agrif_Update_Average ) 154 155 ! 155 156 END SUBROUTINE agrif_declare_var_dom … … 165 166 USE oce 166 167 USE dom_oce 168 USE zdf_oce 167 169 USE nemogcm 170 ! 168 171 USE lib_mpp 169 172 USE in_out_manager … … 171 174 USE agrif_opa_interp 172 175 USE agrif_opa_sponge 173 ! !176 ! 174 177 IMPLICIT NONE 175 178 ! … … 184 187 ! 2. First interpolations of potentially non zero fields 185 188 !------------------------------------------------------- 186 Agrif_SpecialValue =0.189 Agrif_SpecialValue = 0._wp 187 190 Agrif_UseSpecialValue = .TRUE. 188 191 CALL Agrif_Bc_variable(tsn_id,calledweight=1.,procname=interptsn) … … 319 322 ENDIF 320 323 ! 321 # if defined key_zdftke 322 CALL Agrif_Update_tke(0) 323 # endif 324 IF( ln_zdftke ) CALL Agrif_Update_tke( 0 ) 324 325 ! 325 326 Agrif_UseSpecialValueInUpdate = .FALSE. … … 337 338 !!---------------------------------------------------------------------- 338 339 USE agrif_util 339 USE par_oce ! ONLY : jpts 340 USE agrif_oce 341 USE par_oce ! ocean parameters 342 USE zdf_oce ! vertical physics 340 343 USE oce 341 USE agrif_oce342 344 !! 343 345 IMPLICIT NONE … … 371 373 CALL agrif_declare_variable((/2,2/),(/3,3/),(/'x','y'/),(/1,1/),(/nlci,nlcj/),sshn_id) 372 374 373 # if defined key_zdftke 374 CALL agrif_declare_variable((/2,2,0/),(/3,3,0/),(/'x','y','N'/),(/1,1,1/),(/jpi,jpj,jpk/), en_id)375 CALL agrif_declare_variable((/2,2,0/),(/3,3,0/),(/'x','y','N'/),(/1,1,1/),(/jpi,jpj,jpk/),avt_id)376 CALL agrif_declare_variable((/2,2,0/),(/3,3,0/),(/'x','y','N'/),(/1,1,1/),(/jpi,jpj,jpk/),avm_id)377 # endif 375 IF( ln_zdftke ) THEN 376 CALL agrif_declare_variable((/2,2,0/),(/3,3,0/),(/'x','y','N'/),(/1,1,1/),(/jpi,jpj,jpk/), en_id) 377 CALL agrif_declare_variable((/2,2,0/),(/3,3,0/),(/'x','y','N'/),(/1,1,1/),(/jpi,jpj,jpk/),avt_id) 378 CALL agrif_declare_variable((/2,2,0/),(/3,3,0/),(/'x','y','N'/),(/1,1,1/),(/jpi,jpj,jpk/),avm_id) 379 ENDIF 378 380 379 381 ! 2. Type of interpolation … … 400 402 CALL Agrif_Set_bcinterp(vmsk_id,interp=AGRIF_constant) 401 403 402 # if defined key_zdftke 403 CALL Agrif_Set_bcinterp(avm_id ,interp=AGRIF_linear) 404 # endif 405 404 IF( ln_zdftke ) CALL Agrif_Set_bcinterp( avm_id, interp=AGRIF_linear ) 406 405 407 406 ! 3. Location of interpolation … … 418 417 CALL Agrif_Set_bc(vn_sponge_id ,(/-nn_sponge_len*Agrif_irhox()-1,0/)) 419 418 420 CALL Agrif_Set_bc( sshn_id,(/0,0/))421 CALL Agrif_Set_bc( unb_id ,(/0,0/))422 CALL Agrif_Set_bc( vnb_id ,(/0,0/))423 CALL Agrif_Set_bc( ub2b_interp_id,(/0,0/))424 CALL Agrif_Set_bc( vb2b_interp_id,(/0,0/))419 CALL Agrif_Set_bc( sshn_id , (/0,0/) ) 420 CALL Agrif_Set_bc( unb_id , (/0,0/) ) 421 CALL Agrif_Set_bc( vnb_id , (/0,0/) ) 422 CALL Agrif_Set_bc( ub2b_interp_id, (/0,0/) ) 423 CALL Agrif_Set_bc( vb2b_interp_id, (/0,0/) ) 425 424 426 425 CALL Agrif_Set_bc(e3t_id,(/-2*Agrif_irhox()-1,0/)) ! if west and rhox=3: column 2 to 9 … … 428 427 CALL Agrif_Set_bc(vmsk_id,(/0,0/)) 429 428 430 # if defined key_zdftke 431 CALL Agrif_Set_bc(avm_id ,(/0,1/)) 432 # endif 429 IF( ln_zdftke ) CALL Agrif_Set_bc( avm_id, (/0,1/) ) 433 430 434 431 ! 5. Update type … … 446 443 CALL Agrif_Set_Updatetype(vb2b_update_id,update1 = Agrif_Update_Average, update2 = Agrif_Update_Copy) 447 444 448 # if defined key_zdftke 449 CALL Agrif_Set_Updatetype( en_id, update = AGRIF_Update_Average)450 CALL Agrif_Set_Updatetype(avt_id, update = AGRIF_Update_Average)451 CALL Agrif_Set_Updatetype(avm_id, update = AGRIF_Update_Average)452 # endif 445 IF( ln_zdftke) THEN 446 CALL Agrif_Set_Updatetype( en_id, update = AGRIF_Update_Average) 447 CALL Agrif_Set_Updatetype(avt_id, update = AGRIF_Update_Average) 448 CALL Agrif_Set_Updatetype(avm_id, update = AGRIF_Update_Average) 449 ENDIF 453 450 454 451 ! High order updates -
branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/OFF_SRC/nemogcm.F90
r7761 r7953 28 28 USE trabbl ! bottom boundary layer (tra_bbl_init routine) 29 29 USE traldf ! lateral physics (tra_ldf_init routine) 30 USE zdfini ! vertical physics: initialization 31 USE sbcmod ! surface boundary condition (sbc_init routine) 32 USE phycst ! physical constant (par_cst routine) 30 USE sbcmod ! surface boundary condition (sbc_init routine) 31 USE phycst ! physical constant (par_cst routine) 33 32 USE dtadyn ! Lecture and Interpolation of the dynamical fields 34 33 USE trcini ! Initilization of the passive tracers 35 USE daymod ! calendar (day routine)36 USE trcstp ! passive tracer time-stepping (trc_stp routine)34 USE daymod ! calendar (day routine) 35 USE trcstp ! passive tracer time-stepping (trc_stp routine) 37 36 USE dtadyn ! Lecture and interpolation of the dynamical fields 38 37 ! ! Passive tracers needs -
branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/OPA_SRC/ASM/asmbkg.F90
r6140 r7953 28 28 USE ldfslp ! Lateral diffusion: slopes of neutral surfaces 29 29 USE tradmp ! Tracer damping 30 #if defined key_zdftke31 30 USE zdftke ! TKE vertical physics 32 #endif33 31 USE eosbn2 ! Equation of state (eos_bn2 routine) 34 32 USE zdfmxl ! Mixed layer depth … … 94 92 IF( nitbkg_r == nit000 - 1 ) THEN ! Treat special case when nitbkg = 0 95 93 zdate = REAL( ndastp ) 96 #if defined key_zdftke 97 ! lk_zdftke=T : Read turbulent kinetic energy ( en ) 98 IF(lwp) WRITE(numout,*) ' Reading TKE (en) from restart...' 99 CALL tke_rst( nit000, 'READ' ) ! lk_zdftke=T : Read turbulent kinetic energy ( en ) 100 101 #endif 94 IF( ln_zdftke ) THEN ! read turbulent kinetic energy ( en ) 95 IF(lwp) WRITE(numout,*) ' Reading TKE (en) from restart...' 96 CALL tke_rst( nit000, 'READ' ) 97 ENDIF 102 98 ELSE 103 99 zdate = REAL( ndastp ) … … 111 107 CALL iom_rstput( kt, nitbkg_r, inum, 'sn' , tsn(:,:,:,jp_sal) ) 112 108 CALL iom_rstput( kt, nitbkg_r, inum, 'sshn' , sshn ) 113 #if defined key_zdftke 114 CALL iom_rstput( kt, nitbkg_r, inum, 'en' , en ) 115 #endif 109 IF( ln_zdftke ) CALL iom_rstput( kt, nitbkg_r, inum, 'en' , en ) 116 110 ! 117 111 CALL iom_close( inum ) -
branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/OPA_SRC/C1D/step_c1d.F90
r7931 r7953 74 74 CALL bn2( tsb, rab_b, rn2b ) ! before Brunt-Vaisala frequency 75 75 CALL bn2( tsn, rab_n, rn2 ) ! now Brunt-Vaisala frequency 76 ! VERTICAL PHYSICS 77 CALL zdf_bfr( kstp ) ! bottom friction 78 ! ! Vertical eddy viscosity and diffusivity coefficients 79 IF( lk_zdfric ) CALL zdf_ric( kstp ) ! Richardson number dependent Kz 80 IF( lk_zdftke ) CALL zdf_tke( kstp ) ! TKE closure scheme for Kz 81 IF( lk_zdfgls ) CALL zdf_gls( kstp ) ! GLS closure scheme for Kz 82 IF( lk_zdfcst ) THEN ! Constant Kz (reset avt, avm[uv] to the background value) 83 avt (:,:,:) = rn_avt0 * tmask(:,:,:) 84 avmu(:,:,:) = rn_avm0 * umask(:,:,:) 85 avmv(:,:,:) = rn_avm0 * vmask(:,:,:) 86 ENDIF 87 88 IF( ln_rnf_mouth ) THEN ! increase diffusivity at rivers mouths 89 DO jk = 2, nkrnf ; avt(:,:,jk) = avt(:,:,jk) + 2.e0 * rn_avt_rnf * rnfmsk(:,:) ; END DO 90 ENDIF 91 IF( ln_zdfevd ) CALL zdf_evd( kstp ) ! enhanced vertical eddy diffusivity 92 IF( lk_zdftmx ) CALL zdf_tmx( kstp ) ! tidal vertical mixing 93 IF( ln_zdfddm ) CALL zdf_ddm( kstp ) ! double diffusive mixing 94 CALL zdf_mxl( kstp ) ! mixed layer depth 95 96 ! write tke information in the restart file 97 IF( lrst_oce .AND. lk_zdftke ) CALL tke_rst( kstp, 'WRITE' ) 98 ! write gls information in the restart file 99 IF( lrst_oce .AND. lk_zdfgls ) CALL gls_rst( kstp, 'WRITE' ) 76 77 ! VERTICAL PHYSICS 78 CALL zdf_phy( kstp ) ! vertical physics update (bfr, avt, avs, avm + MLD) 100 79 101 80 !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> -
branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/OPA_SRC/CRS/crs.F90
r6140 r7953 151 151 152 152 ! Vertical diffusion 153 REAL(wp), PUBLIC, ALLOCATABLE, DIMENSION(:,:,:) :: avt_crs !: vert. diffusivity coef. [m2/s] at w-point for temp154 # if defined key_zdfddm155 153 REAL(wp), PUBLIC, ALLOCATABLE, DIMENSION(:,:,:) :: avs_crs !: salinity vertical diffusivity coeff. [m2/s] at w-point 156 # endif157 154 158 155 ! Mixing and Mixed Layer Depth … … 239 236 & fr_i_crs(jpi_crs,jpj_crs), sfx_crs(jpi_crs ,jpj_crs), STAT=ierr(12) ) 240 237 241 ALLOCATE( tsn_crs(jpi_crs,jpj_crs,jpk,jpts), avt_crs(jpi_crs,jpj_crs,jpk), & 242 # if defined key_zdfddm 243 & avs_crs(jpi_crs,jpj_crs,jpk), & 244 # endif 245 & STAT=ierr(13) ) 238 ALLOCATE( tsn_crs(jpi_crs,jpj_crs,jpk,jpts), avs_crs(jpi_crs,jpj_crs,jpk), STAT=ierr(13) ) 246 239 247 240 ALLOCATE( nmln_crs(jpi_crs,jpj_crs) , hmld_crs(jpi_crs,jpj_crs) , & 248 241 & hmlp_crs(jpi_crs,jpj_crs) , hmlpt_crs(jpi_crs,jpj_crs) , STAT=ierr(14) ) 249 242 250 ALLOCATE( nimppt_crs(jpnij) , nlcit_crs(jpnij) , nldit_crs(jpnij) , nleit_crs(jpnij), & 251 & nimppt_full(jpnij) , nlcit_full(jpnij) , nldit_full(jpnij) , nleit_full(jpnij), & 252 njmppt_crs(jpnij) , nlcjt_crs(jpnij) , nldjt_crs(jpnij) , nlejt_crs(jpnij), & 253 & njmppt_full(jpnij) , nlcjt_full(jpnij) , nldjt_full(jpnij) , nlejt_full(jpnij) , STAT=ierr(15) ) 254 255 243 ALLOCATE( nimppt_crs (jpnij) , nlcit_crs (jpnij) , nldit_crs (jpnij) , nleit_crs (jpnij), & 244 & nimppt_full(jpnij) , nlcit_full(jpnij) , nldit_full(jpnij) , nleit_full(jpnij), & 245 njmppt_crs (jpnij) , nlcjt_crs (jpnij) , nldjt_crs (jpnij) , nlejt_crs (jpnij), & 246 & njmppt_full(jpnij) , nlcjt_full(jpnij) , nldjt_full(jpnij) , nlejt_full(jpnij) , STAT=ierr(15) ) 247 256 248 crs_dom_alloc = MAXVAL(ierr) 257 249 ! 258 250 END FUNCTION crs_dom_alloc 259 251 -
branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/OPA_SRC/CRS/crsfld.F90
r6140 r7953 84 84 vn_crs (:,:,: ) = 0._wp ! v-velocity 85 85 wn_crs (:,:,: ) = 0._wp ! w 86 av t_crs (:,:,: ) = 0._wp ! avt86 avs_crs (:,:,: ) = 0._wp ! avt 87 87 hdivn_crs(:,:,: ) = 0._wp ! hdiv 88 88 rke_crs (:,:,: ) = 0._wp ! rke … … 200 200 SELECT CASE ( nn_crs_kz ) 201 201 CASE ( 0 ) 202 CALL crs_dom_ope( avt, 'VOL', 'W', tmask, av t_crs, p_e12=e1e2t, p_e3=ze3w, psgn=1.0 )202 CALL crs_dom_ope( avt, 'VOL', 'W', tmask, avs_crs, p_e12=e1e2t, p_e3=ze3w, psgn=1.0 ) 203 203 CASE ( 1 ) 204 CALL crs_dom_ope( avt, 'MAX', 'W', tmask, av t_crs, p_e12=e1e2t, p_e3=ze3w, psgn=1.0 )204 CALL crs_dom_ope( avt, 'MAX', 'W', tmask, avs_crs, p_e12=e1e2t, p_e3=ze3w, psgn=1.0 ) 205 205 CASE ( 2 ) 206 CALL crs_dom_ope( avt, 'MIN', 'W', tmask, av t_crs, p_e12=e1e2t, p_e3=ze3w, psgn=1.0 )206 CALL crs_dom_ope( avt, 'MIN', 'W', tmask, avs_crs, p_e12=e1e2t, p_e3=ze3w, psgn=1.0 ) 207 207 END SELECT 208 208 ! 209 CALL iom_put( "avt", av t_crs ) ! Kz209 CALL iom_put( "avt", avs_crs ) ! Kz 210 210 211 211 ! sbc fields -
branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/OPA_SRC/DIA/dia25h.F90
r7753 r7953 8 8 USE oce ! ocean dynamics and tracers variables 9 9 USE dom_oce ! ocean space and time domain 10 USE zdf_oce ! ocean vertical physics 11 USE zdfgls, ONLY: mxln 10 12 USE in_out_manager ! I/O units 11 13 USE iom ! I/0 library 12 USE wrk_nemo ! working arrays 13 #if defined key_zdftke 14 USE zdf_oce, ONLY: en 15 #endif 16 USE zdf_oce, ONLY: avt, avm 17 #if defined key_zdfgls 18 USE zdf_oce, ONLY: en 19 USE zdfgls, ONLY: mxln 20 #endif 14 USE wrk_nemo ! work arrays 21 15 22 16 IMPLICIT NONE 23 17 PRIVATE 24 18 25 LOGICAL , PUBLIC :: ln_dia25h !: 25h mean output26 19 PUBLIC dia_25h_init ! routine called by nemogcm.F90 27 20 PUBLIC dia_25h ! routine called by diawri.F90 28 21 29 !! * variables for calculating 25-hourly means 30 REAL(wp),SAVE, ALLOCATABLE, DIMENSION(:,:,:) :: tn_25h , sn_25h 31 REAL(wp),SAVE, ALLOCATABLE, DIMENSION(:,:) :: sshn_25h 32 REAL(wp),SAVE, ALLOCATABLE, DIMENSION(:,:,:) :: un_25h , vn_25h , wn_25h 33 REAL(wp),SAVE, ALLOCATABLE, DIMENSION(:,:,:) :: avt_25h , avm_25h 34 #if defined key_zdfgls || key_zdftke 35 REAL(wp),SAVE, ALLOCATABLE, DIMENSION(:,:,:) :: en_25h 36 #endif 37 #if defined key_zdfgls 38 REAL(wp),SAVE, ALLOCATABLE, DIMENSION(:,:,:) :: rmxln_25h 39 #endif 40 INTEGER, SAVE :: cnt_25h ! Counter for 25 hour means 41 42 22 LOGICAL, PUBLIC :: ln_dia25h !: 25h mean output 23 24 ! variables for calculating 25-hourly means 25 INTEGER , SAVE :: cnt_25h ! Counter for 25 hour means 26 REAL(wp), SAVE, ALLOCATABLE, DIMENSION(:,:,:) :: tn_25h , sn_25h 27 REAL(wp), SAVE, ALLOCATABLE, DIMENSION(:,:) :: sshn_25h 28 REAL(wp), SAVE, ALLOCATABLE, DIMENSION(:,:,:) :: un_25h , vn_25h , wn_25h 29 REAL(wp), SAVE, ALLOCATABLE, DIMENSION(:,:,:) :: avt_25h , avm_25h 30 REAL(wp), SAVE, ALLOCATABLE, DIMENSION(:,:,:) :: en_25h , rmxln_25h 43 31 44 32 !!---------------------------------------------------------------------- … … 56 44 !! 57 45 !! ** Method : Read namelist 58 !! History59 !! 3.6 ! 08-14 (E. O'Dea) Routine to initialize dia_25h60 46 !!--------------------------------------------------------------------------- 61 !!62 47 INTEGER :: ios ! Local integer output status for namelist read 63 48 INTEGER :: ierror ! Local integer for memory allocation … … 79 64 WRITE(numout,*) 'dia_25h_init : Output 25 hour mean diagnostics' 80 65 WRITE(numout,*) '~~~~~~~~~~~~' 81 WRITE(numout,*) ' Namelist nam_dia25h : set 25h outputs '82 WRITE(numout,*) ' Switch for 25h diagnostics (T) or not (F) ln_dia25h = ', ln_dia25h66 WRITE(numout,*) ' Namelist nam_dia25h : set 25h outputs ' 67 WRITE(numout,*) ' Switch for 25h diagnostics (T) or not (F) ln_dia25h = ', ln_dia25h 83 68 ENDIF 84 69 IF( .NOT. ln_dia25h ) RETURN … … 86 71 ! 1 - Allocate memory ! 87 72 ! ------------------- ! 88 ALLOCATE( tn_25h(jpi,jpj,jpk), STAT=ierror ) 73 ! ! ocean arrays 74 ALLOCATE( tn_25h (jpi,jpj,jpk), sn_25h (jpi,jpj,jpk), sshn_25h(jpi,jpj) , & 75 & un_25h (jpi,jpj,jpk), vn_25h (jpi,jpj,jpk), wn_25h(jpi,jpj,jpk), & 76 & avt_25h(jpi,jpj,jpk), avm_25h(jpi,jpj,jpk), STAT=ierror ) 89 77 IF( ierror > 0 ) THEN 90 CALL ctl_stop( 'dia_25h: unable to allocate tn_25h' ) ; RETURN 91 ENDIF 92 ALLOCATE( sn_25h(jpi,jpj,jpk), STAT=ierror ) 93 IF( ierror > 0 ) THEN 94 CALL ctl_stop( 'dia_25h: unable to allocate sn_25h' ) ; RETURN 95 ENDIF 96 ALLOCATE( un_25h(jpi,jpj,jpk), STAT=ierror ) 97 IF( ierror > 0 ) THEN 98 CALL ctl_stop( 'dia_25h: unable to allocate un_25h' ) ; RETURN 99 ENDIF 100 ALLOCATE( vn_25h(jpi,jpj,jpk), STAT=ierror ) 101 IF( ierror > 0 ) THEN 102 CALL ctl_stop( 'dia_25h: unable to allocate vn_25h' ) ; RETURN 103 ENDIF 104 ALLOCATE( wn_25h(jpi,jpj,jpk), STAT=ierror ) 105 IF( ierror > 0 ) THEN 106 CALL ctl_stop( 'dia_25h: unable to allocate wn_25h' ) ; RETURN 107 ENDIF 108 ALLOCATE( avt_25h(jpi,jpj,jpk), STAT=ierror ) 109 IF( ierror > 0 ) THEN 110 CALL ctl_stop( 'dia_25h: unable to allocate avt_25h' ) ; RETURN 111 ENDIF 112 ALLOCATE( avm_25h(jpi,jpj,jpk), STAT=ierror ) 113 IF( ierror > 0 ) THEN 114 CALL ctl_stop( 'dia_25h: unable to allocate avm_25h' ) ; RETURN 115 ENDIF 116 # if defined key_zdfgls || defined key_zdftke 117 ALLOCATE( en_25h(jpi,jpj,jpk), STAT=ierror ) 118 IF( ierror > 0 ) THEN 119 CALL ctl_stop( 'dia_25h: unable to allocate en_25h' ) ; RETURN 120 ENDIF 121 #endif 122 # if defined key_zdfgls 123 ALLOCATE( rmxln_25h(jpi,jpj,jpk), STAT=ierror ) 124 IF( ierror > 0 ) THEN 125 CALL ctl_stop( 'dia_25h: unable to allocate rmxln_25h' ) ; RETURN 126 ENDIF 127 #endif 128 ALLOCATE( sshn_25h(jpi,jpj), STAT=ierror ) 129 IF( ierror > 0 ) THEN 130 CALL ctl_stop( 'dia_25h: unable to allocate sshn_25h' ) ; RETURN 78 CALL ctl_stop( 'dia_25h: unable to allocate ocean arrays' ) ; RETURN 79 ENDIF 80 IF( ln_zdftke ) THEN ! TKE physics 81 ALLOCATE( en_25h(jpi,jpj,jpk), STAT=ierror ) 82 IF( ierror > 0 ) THEN 83 CALL ctl_stop( 'dia_25h: unable to allocate en_25h' ) ; RETURN 84 ENDIF 85 ENDIF 86 IF( ln_zdfgls ) THEN ! GLS physics 87 ALLOCATE( en_25h(jpi,jpj,jpk), rmxln_25h(jpi,jpj,jpk), STAT=ierror ) 88 IF( ierror > 0 ) THEN 89 CALL ctl_stop( 'dia_25h: unable to allocate en_25h and rmxln_25h' ) ; RETURN 90 ENDIF 131 91 ENDIF 132 92 ! ------------------------- ! … … 142 102 avt_25h(:,:,:) = avt(:,:,:) 143 103 avm_25h(:,:,:) = avm(:,:,:) 144 # if defined key_zdfgls || defined key_zdftke 104 IF( ln_zdftke ) THEN 145 105 en_25h(:,:,:) = en(:,:,:) 146 #endif 147 # if defined key_zdfgls 106 ENDIF 107 IF( ln_zdfgls ) THEN 108 en_25h(:,:,:) = en(:,:,:) 148 109 rmxln_25h(:,:,:) = mxln(:,:,:) 149 #endif 110 ENDIF 150 111 #if defined key_lim3 || defined key_lim2 151 112 CALL ctl_stop('STOP', 'dia_25h not setup yet to do tidemean ice') 152 113 #endif 153 154 ! -------------------------- ! 155 ! 3 - Return to dia_wri ! 156 ! -------------------------- ! 157 158 114 ! 159 115 END SUBROUTINE dia_25h_init 160 116 … … 164 120 !! *** ROUTINE dia_25h *** 165 121 !! 166 !!167 !!--------------------------------------------------------------------168 !!169 122 !! ** Purpose : Write diagnostics with M2/S2 tide removed 170 123 !! 171 !! ** Method : 172 !! 25hr mean outputs for shelf seas 124 !! ** Method : 25hr mean outputs for shelf seas 125 !!---------------------------------------------------------------------- 126 INTEGER, INTENT(in) :: kt ! ocean time-step index 173 127 !! 174 !! History :175 !! ?.0 ! 07-04 (A. Hines) New routine, developed from dia_wri_foam176 !! 3.4 ! 02-13 (J. Siddorn) Routine taken from old dia_wri_foam177 !! 3.6 ! 08-14 (E. O'Dea) adapted for VN3.6178 !!----------------------------------------------------------------------179 !! * Modules used180 181 IMPLICIT NONE182 183 !! * Arguments184 INTEGER, INTENT( in ) :: kt ! ocean time-step index185 186 187 !! * Local declarations188 128 INTEGER :: ji, jj, jk 189 129 INTEGER :: iyear0, nimonth0,iday0 ! start year,imonth,day 190 130 LOGICAL :: ll_print = .FALSE. ! =T print and flush numout 191 REAL(wp) :: zsto, zout, zmax, zjulian, zmdi ! temporary reals 192 INTEGER :: i_steps ! no of timesteps per hour 193 REAL(wp), DIMENSION(jpi,jpj ) :: zw2d, un_dm, vn_dm ! temporary workspace 194 REAL(wp), DIMENSION(jpi,jpj,jpk) :: zw3d ! temporary workspace 195 REAL(wp), DIMENSION(jpi,jpj,3) :: zwtmb ! temporary workspace 196 INTEGER :: iyear0, nimonth0,iday0 ! start year,imonth,day 197 131 REAL(wp) :: zsto, zout, zmax, zjulian, zmdi ! local scalars 132 INTEGER :: i_steps ! no of timesteps per hour 133 REAL(wp), DIMENSION(jpi,jpj ) :: zw2d, un_dm, vn_dm ! workspace 134 REAL(wp), DIMENSION(jpi,jpj,jpk) :: zw3d ! workspace 135 REAL(wp), DIMENSION(jpi,jpj,3) :: zwtmb ! workspace 198 136 !!---------------------------------------------------------------------- 199 137 … … 207 145 ENDIF 208 146 209 #if defined key_lim3 || defined key_lim2210 CALL ctl_stop('STOP', 'dia_wri_tide not setup yet to do tidemean ice')211 #endif212 213 147 ! local variable for debugging 214 148 ll_print = ll_print .AND. lwp 215 149 216 ! Sum of 25 hourly instantaneous values to give a 25h mean from 24hours 217 ! every day 218 IF( MOD( kt, i_steps ) == 0 .and. kt .ne. nn_it000 ) THEN 150 ! Sum of 25 hourly instantaneous values to give a 25h mean from 24hours every day 151 IF( MOD( kt, i_steps ) == 0 .AND. kt /= nn_it000 ) THEN 219 152 220 153 IF (lwp) THEN … … 231 164 avt_25h(:,:,:) = avt_25h(:,:,:) + avt(:,:,:) 232 165 avm_25h(:,:,:) = avm_25h(:,:,:) + avm(:,:,:) 233 # if defined key_zdfgls || defined key_zdftke 234 en_25h(:,:,:) = en_25h(:,:,:) + en(:,:,:) 235 #endif 236 # if defined key_zdfgls 237 rmxln_25h(:,:,:) = rmxln_25h(:,:,:) + mxln(:,:,:) 238 #endif 166 IF( ln_zdftke ) THEN 167 en_25h(:,:,:) = en_25h(:,:,:) + en(:,:,:) 168 ENDIF 169 IF( ln_zdfgls ) THEN 170 en_25h(:,:,:) = en_25h(:,:,:) + en(:,:,:) 171 rmxln_25h(:,:,:) = rmxln_25h(:,:,:) + mxln(:,:,:) 172 ENDIF 239 173 cnt_25h = cnt_25h + 1 240 174 ! 241 175 IF (lwp) THEN 242 176 WRITE(numout,*) 'dia_tide : Summed the following number of hourly values so far',cnt_25h 243 177 ENDIF 244 178 ! 245 179 ENDIF ! MOD( kt, i_steps ) == 0 246 180 247 248 IF( cnt_25h .EQ. 25 .AND. MOD( kt, i_steps*24) == 0 .AND. kt .NE.nn_it000 ) THEN249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 # if defined key_zdfgls || defined key_zdftke 181 ! Write data for 25 hour mean output streams 182 IF( cnt_25h == 25 .AND. MOD( kt, i_steps*24) == 0 .AND. kt /= nn_it000 ) THEN 183 ! 184 IF(lwp) THEN 185 WRITE(numout,*) 'dia_wri_tide : Writing 25 hour mean tide diagnostics at timestep', kt 186 WRITE(numout,*) '~~~~~~~~~~~~ ' 187 ENDIF 188 ! 189 tn_25h(:,:,:) = tn_25h(:,:,:) / 25.0_wp 190 sn_25h(:,:,:) = sn_25h(:,:,:) / 25.0_wp 191 sshn_25h(:,:) = sshn_25h(:,:) / 25.0_wp 192 un_25h(:,:,:) = un_25h(:,:,:) / 25.0_wp 193 vn_25h(:,:,:) = vn_25h(:,:,:) / 25.0_wp 194 wn_25h(:,:,:) = wn_25h(:,:,:) / 25.0_wp 195 avt_25h(:,:,:) = avt_25h(:,:,:) / 25.0_wp 196 avm_25h(:,:,:) = avm_25h(:,:,:) / 25.0_wp 197 IF( ln_zdftke ) THEN 264 198 en_25h(:,:,:) = en_25h(:,:,:) / 25.0_wp 265 #endif 266 # if defined key_zdfgls 199 ENDIF 200 IF( ln_zdfgls ) THEN 201 en_25h(:,:,:) = en_25h(:,:,:) / 25.0_wp 267 202 rmxln_25h(:,:,:) = rmxln_25h(:,:,:) / 25.0_wp 268 #endif 269 270 IF (lwp) WRITE(numout,*) 'dia_wri_tide : Mean calculated by dividing 25 hour sums and writing output' 271 zmdi=1.e+20 !missing data indicator for masking 272 ! write tracers (instantaneous) 273 zw3d(:,:,:) = tn_25h(:,:,:)*tmask(:,:,:) + zmdi*(1.0-tmask(:,:,:)) 274 CALL iom_put("temper25h", zw3d) ! potential temperature 275 zw3d(:,:,:) = sn_25h(:,:,:)*tmask(:,:,:) + zmdi*(1.0-tmask(:,:,:)) 276 CALL iom_put( "salin25h", zw3d ) ! salinity 277 zw2d(:,:) = sshn_25h(:,:)*tmask(:,:,1) + zmdi*(1.0-tmask(:,:,1)) 278 CALL iom_put( "ssh25h", zw2d ) ! sea surface 279 280 281 ! Write velocities (instantaneous) 282 zw3d(:,:,:) = un_25h(:,:,:)*umask(:,:,:) + zmdi*(1.0-umask(:,:,:)) 283 CALL iom_put("vozocrtx25h", zw3d) ! i-current 284 zw3d(:,:,:) = vn_25h(:,:,:)*vmask(:,:,:) + zmdi*(1.0-vmask(:,:,:)) 285 CALL iom_put("vomecrty25h", zw3d ) ! j-current 286 287 zw3d(:,:,:) = wn_25h(:,:,:)*tmask(:,:,:) + zmdi*(1.0-tmask(:,:,:)) 288 CALL iom_put("vomecrtz25h", zw3d ) ! k-current 289 zw3d(:,:,:) = avt_25h(:,:,:)*tmask(:,:,:) + zmdi*(1.0-tmask(:,:,:)) 290 CALL iom_put("avt25h", zw3d ) ! diffusivity 291 zw3d(:,:,:) = avm_25h(:,:,:)*tmask(:,:,:) + zmdi*(1.0-tmask(:,:,:)) 292 CALL iom_put("avm25h", zw3d) ! viscosity 293 #if defined key_zdftke || defined key_zdfgls 203 ENDIF 204 ! 205 IF(lwp) WRITE(numout,*) 'dia_wri_tide : Mean calculated by dividing 25 hour sums and writing output' 206 zmdi=1.e+20 !missing data indicator for masking 207 ! write tracers (instantaneous) 208 zw3d(:,:,:) = tn_25h(:,:,:)*tmask(:,:,:) + zmdi*(1.0-tmask(:,:,:)) 209 CALL iom_put("temper25h", zw3d) ! potential temperature 210 zw3d(:,:,:) = sn_25h(:,:,:)*tmask(:,:,:) + zmdi*(1.0-tmask(:,:,:)) 211 CALL iom_put( "salin25h", zw3d ) ! salinity 212 zw2d(:,:) = sshn_25h(:,:)*tmask(:,:,1) + zmdi*(1.0-tmask(:,:,1)) 213 CALL iom_put( "ssh25h", zw2d ) ! sea surface 214 ! Write velocities (instantaneous) 215 zw3d(:,:,:) = un_25h(:,:,:)*umask(:,:,:) + zmdi*(1.0-umask(:,:,:)) 216 CALL iom_put("vozocrtx25h", zw3d) ! i-current 217 zw3d(:,:,:) = vn_25h(:,:,:)*vmask(:,:,:) + zmdi*(1.0-vmask(:,:,:)) 218 CALL iom_put("vomecrty25h", zw3d ) ! j-current 219 zw3d(:,:,:) = wn_25h(:,:,:)*tmask(:,:,:) + zmdi*(1.0-tmask(:,:,:)) 220 CALL iom_put("vomecrtz25h", zw3d ) ! k-current 221 ! Write vertical physics 222 zw3d(:,:,:) = avt_25h(:,:,:)*tmask(:,:,:) + zmdi*(1.0-tmask(:,:,:)) 223 CALL iom_put("avt25h", zw3d ) ! diffusivity 224 zw3d(:,:,:) = avm_25h(:,:,:)*tmask(:,:,:) + zmdi*(1.0-tmask(:,:,:)) 225 CALL iom_put("avm25h", zw3d) ! viscosity 226 IF( ln_zdftke ) THEN 294 227 zw3d(:,:,:) = en_25h(:,:,:)*tmask(:,:,:) + zmdi*(1.0-tmask(:,:,:)) 295 228 CALL iom_put("tke25h", zw3d) ! tke 296 #endif 297 #if defined key_zdfgls 229 ENDIF 230 IF( ln_zdfgls ) THEN 231 zw3d(:,:,:) = en_25h(:,:,:)*tmask(:,:,:) + zmdi*(1.0-tmask(:,:,:)) 232 CALL iom_put("tke25h", zw3d) ! tke 298 233 zw3d(:,:,:) = rmxln_25h(:,:,:)*tmask(:,:,:) + zmdi*(1.0-tmask(:,:,:)) 299 234 CALL iom_put( "mxln25h",zw3d) 300 #endif 301 302 303 304 305 306 307 308 309 310 311 # if defined key_zdfgls || defined key_zdftke 235 ENDIF 236 ! 237 ! After the write reset the values to cnt=1 and sum values equal current value 238 tn_25h(:,:,:) = tsn(:,:,:,jp_tem) 239 sn_25h(:,:,:) = tsn(:,:,:,jp_sal) 240 sshn_25h(:,:) = sshn (:,:) 241 un_25h(:,:,:) = un(:,:,:) 242 vn_25h(:,:,:) = vn(:,:,:) 243 wn_25h(:,:,:) = wn(:,:,:) 244 avt_25h(:,:,:) = avt(:,:,:) 245 avm_25h(:,:,:) = avm(:,:,:) 246 IF( ln_zdftke ) THEN 312 247 en_25h(:,:,:) = en(:,:,:) 313 #endif 314 # if defined key_zdfgls 248 ENDIF 249 IF( ln_zdfgls ) THEN 250 en_25h(:,:,:) = en(:,:,:) 315 251 rmxln_25h(:,:,:) = mxln(:,:,:) 316 #endif 317 318 319 252 ENDIF 253 cnt_25h = 1 254 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 255 ! 320 256 ENDIF ! cnt_25h .EQ. 25 .AND. MOD( kt, i_steps * 24) == 0 .AND. kt .NE. nn_it000 321 322 257 ! 323 258 END SUBROUTINE dia_25h 324 259 -
branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/OPA_SRC/DIA/diawri.F90
r7931 r7953 39 39 USE zdfmxl ! mixed layer 40 40 USE dianam ! build name of file (routine) 41 USE zdfddm ! vertical physics: double diffusion41 ! USE zdfddm ! vertical physics: double diffusion 42 42 USE diahth ! thermocline diagnostics 43 43 USE wet_dry ! wetting and drying … … 233 233 234 234 CALL iom_put( "avt" , avt ) ! T vert. eddy diff. coef. 235 CALL iom_put( "avs" , avs ) ! S vert. eddy diff. coef. (useful only with key_zdfddm)235 CALL iom_put( "avs" , avs ) ! S vert. eddy diff. coef. 236 236 CALL iom_put( "avm" , avmu ) ! T vert. eddy visc. coef. 237 237 -
branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/OPA_SRC/DYN/dynzdf.F90
r7753 r7953 96 96 !! *** ROUTINE dyn_zdf_init *** 97 97 !! 98 !! ** Purpose : initialization sof the vertical diffusion scheme98 !! ** Purpose : initialization of the vertical diffusion scheme 99 99 !! 100 100 !! ** Method : implicit (euler backward) scheme (default) … … 105 105 !!---------------------------------------------------------------------- 106 106 ! 107 ! Choice from ln_zdfexp read in namelist in zdfini107 ! Choice from ln_zdfexp (namzdf namelist variable read in zdfphy module) 108 108 IF( ln_zdfexp ) THEN ; nzdf = 0 ! use explicit scheme 109 109 ELSE ; nzdf = 1 ! use implicit scheme … … 111 111 ! 112 112 ! Force implicit schemes 113 IF( l k_zdftke .OR. lk_zdfgls ) nzdf = 1 ! TKE or GLS physics113 IF( ln_zdftke .OR. ln_zdfgls ) nzdf = 1 ! TKE or GLS physics 114 114 IF( ln_dynldf_iso ) nzdf = 1 ! iso-neutral lateral physics 115 115 IF( ln_dynldf_hor .AND. ln_sco ) nzdf = 1 ! horizontal lateral physics in s-coordinate -
branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/OPA_SRC/TRA/trazdf.F90
r7931 r7953 124 124 !!---------------------------------------------------------------------- 125 125 ! 126 ! Choice from ln_zdfexp already read in namelist in zdfini module126 ! Choice from ln_zdfexp (namzdf namelist variable read in zdfphy module) 127 127 IF( ln_zdfexp ) THEN ; nzdf = 0 ! use explicit scheme 128 128 ELSE ; nzdf = 1 ! use implicit scheme … … 130 130 ! 131 131 ! Force implicit schemes 132 IF( l k_zdftke .OR. lk_zdfgls ) nzdf = 1 ! TKE, or GLS physics132 IF( ln_zdftke .OR. ln_zdfgls ) nzdf = 1 ! TKE, or GLS physics 133 133 IF( ln_traldf_iso ) nzdf = 1 ! iso-neutral lateral physics 134 134 IF( ln_traldf_hor .AND. ln_sco ) nzdf = 1 ! horizontal lateral physics in s-coordinate -
branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/OPA_SRC/ZDF/zdf_oce.F90
r7931 r7953 15 15 16 16 PUBLIC zdf_oce_alloc ! Called in nemogcm.F90 17 18 #if defined key_zdfcst19 LOGICAL, PARAMETER, PUBLIC :: lk_zdfcst = .TRUE. !: constant vertical mixing flag20 #else21 LOGICAL, PARAMETER, PUBLIC :: lk_zdfcst = .FALSE. !: constant vertical mixing flag22 #endif23 17 24 18 ! !!* namelist namzdf: vertical diffusion * -
branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfgls.F90
r7646 r7953 8 8 !! 3.3 ! 2010-10 (C. Bricaud) Add in the reference 9 9 !!---------------------------------------------------------------------- 10 #if defined key_zdfgls 11 !!---------------------------------------------------------------------- 12 !! 'key_zdfgls' Generic Length Scale vertical physics 10 13 11 !!---------------------------------------------------------------------- 14 12 !! zdf_gls : update momentum and tracer Kz from a gls scheme … … 39 37 40 38 PUBLIC zdf_gls ! routine called in step module 41 PUBLIC zdf_gls_init ! routine called in opa module 42 PUBLIC gls_rst ! routine called in step module 43 44 LOGICAL , PUBLIC, PARAMETER :: lk_zdfgls = .TRUE. !: TKE vertical mixing flag 39 PUBLIC zdf_gls_init ! routine called in zdfphy module 40 PUBLIC gls_rst ! routine called in zdfphy module 41 45 42 ! 46 43 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: mxln !: now mixing length … … 1211 1208 END SUBROUTINE gls_rst 1212 1209 1213 #else1214 !!----------------------------------------------------------------------1215 !! Dummy module : NO TKE scheme1216 !!----------------------------------------------------------------------1217 LOGICAL, PUBLIC, PARAMETER :: lk_zdfgls = .FALSE. !: TKE flag1218 CONTAINS1219 SUBROUTINE zdf_gls_init ! Empty routine1220 WRITE(*,*) 'zdf_gls_init: You should not have seen this print! error?'1221 END SUBROUTINE zdf_gls_init1222 SUBROUTINE zdf_gls( kt ) ! Empty routine1223 WRITE(*,*) 'zdf_gls: You should not have seen this print! error?', kt1224 END SUBROUTINE zdf_gls1225 SUBROUTINE gls_rst( kt, cdrw ) ! Empty routine1226 INTEGER , INTENT(in) :: kt ! ocean time-step1227 CHARACTER(len=*), INTENT(in) :: cdrw ! "READ"/"WRITE" flag1228 WRITE(*,*) 'gls_rst: You should not have seen this print! error?', kt, cdrw1229 END SUBROUTINE gls_rst1230 #endif1231 1232 1210 !!====================================================================== 1233 1211 END MODULE zdfgls -
branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfphy.F90
r7931 r7953 1 MODULE zdf ini1 MODULE zdfphy 2 2 !!====================================================================== 3 !! *** MODULE zdf ini***4 !! Ocean physics : read vertical mixing namelist and check consistancy3 !! *** MODULE zdfphy *** 4 !! Ocean physics : manager of vertical mixing parametrizations 5 5 !!====================================================================== 6 !! History : 8.0 ! 1997-06 (G. Madec) Original code from inimix 7 !! 1.0 ! 2002-08 (G. Madec) F90 : free form 8 !! - ! 2005-06 (C. Ethe) KPP scheme 9 !! - ! 2009-07 (G. Madec) add avmb, avtb in restart for cen2 advection 10 !! 3.7 ! 2014-12 (G. Madec) remove KPP scheme 11 !!---------------------------------------------------------------------- 12 13 !!---------------------------------------------------------------------- 14 !! zdf_init : initialization, namelist read, and parameters control 15 !!---------------------------------------------------------------------- 16 USE par_oce ! mesh and scale factors 17 USE zdf_oce ! TKE vertical mixing 18 USE sbc_oce ! surface module (only for nn_isf in the option compatibility test) 19 USE zdftke ! TKE vertical mixing 20 USE zdfgls ! GLS vertical mixing 21 USE zdfric ! Richardson vertical mixing 22 USE zdfddm ! double diffusion mixing 23 USE zdfevd ! enhanced vertical diffusion 24 USE tranpc ! convection: non penetrative adjustment 25 USE ldfslp ! iso-neutral slopes 6 !! History : 4.0 ! 2017-04 (G. Madec) original code 7 !!---------------------------------------------------------------------- 8 9 !!---------------------------------------------------------------------- 10 !! zdf_phy_init : initialization of all vertical physics pakages 11 !! zdf_phy : upadate at each time-step the vertical mixing coeff. 12 !!---------------------------------------------------------------------- 13 USE par_oce ! mesh and scale factors 14 USE zdf_oce ! TKE vertical mixing 15 USE sbc_oce ! surface module (only for nn_isf in the option compatibility test) 16 USE zdfbfr ! bottom friction 17 USE zdftke ! TKE vertical mixing 18 USE zdfgls ! GLS vertical mixing 19 USE zdfric ! Richardson vertical mixing 20 USE zdfddm ! double diffusion mixing 21 USE zdfevd ! enhanced vertical diffusion 22 USE zdftmx ! internal tide-induced mixing 23 USE zdfqiao !Qiao module wave induced mixing (zdf_qiao routine) 24 USE zdfmxl ! Mixed-layer depth (zdf_mxl routine) 25 USE tranpc ! convection: non penetrative adjustment 26 USE sbcrnf ! surface boundary condition: runoff variables 26 27 ! 27 USE in_out_manager 28 USE iom 29 USE lib_mpp 28 USE in_out_manager ! I/O manager 29 USE iom ! IOM library 30 USE lib_mpp ! distribued memory computing 30 31 31 32 IMPLICIT NONE 32 33 PRIVATE 33 34 34 PUBLIC zdf_init ! routine called by opa.F90 35 PUBLIC zdf_phy_init ! routine called by nemogcm.F90 36 PUBLIC zdf_phy ! routine called by step.F90 37 35 38 36 39 !!---------------------------------------------------------------------- … … 41 44 CONTAINS 42 45 43 SUBROUTINE zdf_ init44 !!---------------------------------------------------------------------- 45 !! *** ROUTINE zdf_ init ***46 SUBROUTINE zdf_phy_init 47 !!---------------------------------------------------------------------- 48 !! *** ROUTINE zdf_phy_init *** 46 49 !! 47 50 !! ** Purpose : initializations of the vertical ocean physics … … 49 52 !! ** Method : Read namelist namzdf, control logicals 50 53 !!---------------------------------------------------------------------- 51 INTEGER :: ioptio, ios 54 INTEGER :: ioptio, ios ! local integers 52 55 !! 53 56 NAMELIST/namzdf/ ln_zdfcst, ln_zdfric, ln_zdftke, ln_zdfgls, & ! type of closure scheme … … 77 80 IF(lwp) THEN !* Parameter print 78 81 WRITE(numout,*) 79 WRITE(numout,*) 'zdf_ init : vertical physics'82 WRITE(numout,*) 'zdf_phy_init : vertical physics' 80 83 WRITE(numout,*) '~~~~~~~~' 81 84 WRITE(numout,*) ' Namelist namzdf : set vertical mixing mixing parameters' … … 106 109 ENDIF 107 110 108 IF(ln_zdfddm) THEN ! double diffusive mixing' 109 ALLOCATE( avs(jpi,jpj,jpk) ) 110 avs(:,:,:) = rn_avt0 * wmask(:,:,:) 111 ENDIF 112 111 !!gm IF(ln_zdfddm) THEN ! double diffusive mixing' 112 ! avs(:,:,:) = rn_avt0 * wmask(:,:,:) 113 !!gm ENDIF 113 114 114 115 ! !* Parameter & logical controls … … 122 123 IF(lwp) WRITE(numout,*) ' vertical mixing option :' 123 124 ioptio = 0 124 IF( l k_zdfcst ) THEN125 IF( ln_zdfcst ) THEN 125 126 IF(lwp) WRITE(numout,*) ' constant eddy diffusion coefficients' 126 127 ioptio = ioptio+1 127 128 ENDIF 128 IF( l k_zdfric ) THEN129 IF( ln_zdfric ) THEN 129 130 IF(lwp) WRITE(numout,*) ' Richardson dependent eddy coefficients' 130 131 ioptio = ioptio+1 131 132 ENDIF 132 IF( l k_zdftke ) THEN133 IF( ln_zdftke ) THEN 133 134 IF(lwp) WRITE(numout,*) ' TKE dependent eddy coefficients' 134 135 ioptio = ioptio+1 135 136 ENDIF 136 IF( l k_zdfgls ) THEN137 IF( ln_zdfgls ) THEN 137 138 IF(lwp) WRITE(numout,*) ' GLS dependent eddy coefficients' 138 139 ioptio = ioptio+1 … … 140 141 IF( ioptio == 0 .OR. ioptio > 1 ) & 141 142 & CALL ctl_stop( ' one and only one vertical diffusion option has to be defined ' ) 142 IF( ( l k_zdfric .OR. lk_zdfgls ) .AND. ln_isfcav ) &143 IF( ( ln_zdfric .OR. ln_zdfgls ) .AND. ln_isfcav ) & 143 144 & CALL ctl_stop( ' only zdfcst and zdftke were tested with ice shelves cavities ' ) 144 145 ! … … 148 149 ! 149 150 #if defined key_top 150 IF( ln_zdfnpc ) CALL ctl_stop( ' zdf_ init: npc scheme is not working with key_top' )151 IF( ln_zdfnpc ) CALL ctl_stop( ' zdf_phy_init: npc scheme is not working with key_top' ) 151 152 #endif 152 153 ! … … 160 161 ioptio = ioptio+1 161 162 ENDIF 162 IF( l k_zdftke ) THEN163 IF( ln_zdftke ) THEN 163 164 IF(lwp) WRITE(numout,*) ' use the 1.5 turbulent closure' 164 165 ENDIF 165 IF( l k_zdfgls ) THEN166 IF( ln_zdfgls ) THEN 166 167 IF(lwp) WRITE(numout,*) ' use the GLS closure scheme' 167 168 ENDIF 168 169 IF ( ioptio > 1 ) CALL ctl_stop( ' chose between ln_zdfnpc and ln_zdfevd' ) 169 IF( ioptio == 0 .AND. .NOT.( l k_zdftke .OR. lk_zdfgls ) ) &170 IF( ioptio == 0 .AND. .NOT.( ln_zdftke .OR. ln_zdfgls ) ) & 170 171 CALL ctl_stop( ' except for TKE or GLS physics, a convection scheme is', & 171 172 & ' required: ln_zdfevd or ln_zdfnpc logicals' ) … … 202 203 ENDIF 203 204 ! 204 END SUBROUTINE zdf_init 205 206 !!gm moved into zdf_phy_init 207 ! 208 CALL zdf_bfr_init ! bottom friction 209 210 ioptio = 0 !== type of vertical turbulent closure ==! (set nzdfphy) 211 ! 212 ! IF( ln_zdfcst ) THEN ; ioptio = ioptio + 1 ; nzdf_phy = np_CST ; ENDIF 213 ! IF( ln_zdfric ) THEN ; ioptio = ioptio + 1 ; nzdf_phy = np_RIC ; CALL zdf_ric_init ; ENDIF 214 ! IF( ln_zdftke ) THEN ; ioptio = ioptio + 1 ; nzdf_phy = np_TKE ; CALL zdf_tke_init ; ENDIF 215 ! IF( ln_zdfgls ) THEN ; ioptio = ioptio + 1 ; nzdf_phy = np_GLS ; CALL zdf_gls_init ; ENDIF 216 217 218 ! 219 IF( ln_zdfric ) CALL zdf_ric_init ! Richardson number dependent Kz 220 IF( ln_zdftke ) CALL zdf_tke_init ! TKE closure scheme 221 IF( ln_zdfgls ) CALL zdf_gls_init ! GLS closure scheme 222 IF( ln_zdftmx ) CALL zdf_tmx_init ! tidal vertical mixing 223 !!gm 224 ! 225 END SUBROUTINE zdf_phy_init 226 227 228 SUBROUTINE zdf_phy( kstp ) 229 !!---------------------------------------------------------------------- 230 !! *** ROUTINE zdf_phy *** 231 !! 232 !! ** Purpose : Update ocean physics at each time-step 233 !! 234 !! ** Method : 235 !! 236 !! ** Action : avm, avt vertical eddy viscosity and diffusivity at w-points 237 !! nmld ??? mixed layer depth in level and meters <<<<====verifier ! 238 !! bottom stress..... <<<<====verifier ! 239 !!---------------------------------------------------------------------- 240 INTEGER, INTENT(in) :: kstp ! ocean time-step index 241 ! 242 INTEGER :: ji, jj, jk ! dummy loop indice 243 !!---------------------------------------------------------------------- 244 ! 245 CALL zdf_bfr( kstp ) ! bottom friction (if quadratic) 246 ! ! Vertical eddy viscosity and diffusivity coefficients 247 IF( ln_zdfric ) CALL zdf_ric ( kstp ) ! Richardson number dependent Kz 248 IF( ln_zdftke ) CALL zdf_tke ( kstp ) ! TKE closure scheme for Kz 249 IF( ln_zdfgls ) CALL zdf_gls ( kstp ) ! GLS closure scheme for Kz 250 IF( ln_zdfqiao ) CALL zdf_qiao( kstp ) ! Qiao vertical mixing 251 ! 252 IF( ln_zdfcst ) THEN ! Constant Kz (reset avt, avm[uv] to the background value) 253 avt (:,:,:) = rn_avt0 * wmask (:,:,:) 254 avm (:,:,:) = rn_avm0 * wmask (:,:,:) 255 avmu(:,:,:) = rn_avm0 * wumask(:,:,:) 256 avmv(:,:,:) = rn_avm0 * wvmask(:,:,:) 257 ENDIF 258 ! 259 IF( ln_rnf_mouth ) THEN ! increase diffusivity at rivers mouths 260 DO jk = 2, nkrnf ; avt(:,:,jk) = avt(:,:,jk) + 2._wp * rn_avt_rnf * rnfmsk(:,:) * tmask(:,:,jk) ; END DO 261 ENDIF 262 ! 263 IF( ln_zdfevd ) CALL zdf_evd( kstp ) ! enhanced vertical eddy diffusivity 264 ! 265 IF( ln_zdfddm ) THEN ! double diffusive mixing 266 CALL zdf_ddm( kstp ) 267 ELSE ! avs=avt 268 DO jk = 2, jpkm1 ; avs(:,:,jk) = avt(:,:,jk) ; END DO 269 ENDIF 270 ! 271 IF( ln_zdftmx ) CALL zdf_tmx( kstp ) ! tidal vertical mixing 272 273 CALL zdf_mxl( kstp ) ! mixed layer depth 274 275 ! write TKE or GLS information in the restart file 276 IF( lrst_oce .AND. ln_zdftke ) CALL tke_rst( kstp, 'WRITE' ) 277 IF( lrst_oce .AND. ln_zdfgls ) CALL gls_rst( kstp, 'WRITE' ) 278 ! 279 END SUBROUTINE zdf_phy 205 280 206 281 !!====================================================================== 207 END MODULE zdf ini282 END MODULE zdfphy -
branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfqiao.F90
r7646 r7953 67 67 !--------------------------------------------------------------------------------- 68 68 ! 69 !!gm Comment: I don't understand the use of min of 4 gdepw_n to define a quantity at w-point 70 !!gm ==>> this is an error.... 69 71 DO jk = 1, jpk 70 72 DO jj = 1, jpjm1 … … 101 103 !------------------------------- 102 104 ! 105 !!gm with double diffusion activated, avs is not updated... 106 !!gm =====>>> BUG 103 107 DO jk = 1, jpkm1 104 108 DO jj = 1, jpj … … 112 116 ! 113 117 END SUBROUTINE zdf_qiao 118 114 119 115 120 INTEGER FUNCTION zdf_qiao_alloc() -
branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfric.F90
r7646 r7953 13 13 !! 3.3.1! 2011-09 (P. Oddo) Mixed layer depth parameterization 14 14 !!---------------------------------------------------------------------- 15 #if defined key_zdfric 16 !!---------------------------------------------------------------------- 17 !! 'key_zdfric' Kz = f(Ri) 18 !!---------------------------------------------------------------------- 19 !! zdf_ric : update momentum and tracer Kz from the Richardson 20 !! number computation 15 16 !!---------------------------------------------------------------------- 17 !! zdf_ric : update momentum and tracer Kz from the Richardson number 21 18 !! zdf_ric_init : initialization, namelist read, & parameters control 22 19 !!---------------------------------------------------------------------- … … 38 35 PUBLIC zdf_ric ! called by step.F90 39 36 PUBLIC zdf_ric_init ! called by opa.F90 40 41 LOGICAL, PUBLIC, PARAMETER :: lk_zdfric = .TRUE. !: Richardson vertical mixing flag42 37 43 38 ! !!* Namelist namzdf_ric : Richardson number dependent Kz * … … 108 103 !! namelist 109 104 !! N.B. the mask are required for implicit scheme, and surface 110 !! and bottom value already set in zdf ini.F90105 !! and bottom value already set in zdfphy.F90 111 106 !! 112 107 !! References : Pacanowski & Philander 1981, JPO, 1441-1451. … … 183 178 zrhos = rhop(ji,jj,1) + zflageos * ( 1. - tmask(ji,jj,1) ) 184 179 zustar = SQRT( taum(ji,jj) / ( zrhos + rsmall ) ) 185 ekm_dep(ji,jj) = rn_ekmfc * zustar / ( ABS( ff (ji,jj) ) + rsmall )180 ekm_dep(ji,jj) = rn_ekmfc * zustar / ( ABS( ff_t(ji,jj) ) + rsmall ) 186 181 ekm_dep(ji,jj) = MAX(ekm_dep(ji,jj),rn_mldmin) ! Minimun allowed 187 182 ekm_dep(ji,jj) = MIN(ekm_dep(ji,jj),rn_mldmax) ! Maximum allowed … … 303 298 END SUBROUTINE zdf_ric_init 304 299 305 #else306 !!----------------------------------------------------------------------307 !! Dummy module : NO Richardson dependent vertical mixing308 !!----------------------------------------------------------------------309 LOGICAL, PUBLIC, PARAMETER :: lk_zdfric = .FALSE. !: Richardson mixing flag310 CONTAINS311 SUBROUTINE zdf_ric_init ! Dummy routine312 END SUBROUTINE zdf_ric_init313 SUBROUTINE zdf_ric( kt ) ! Dummy routine314 WRITE(*,*) 'zdf_ric: You should not have seen this print! error?', kt315 END SUBROUTINE zdf_ric316 #endif317 318 300 !!====================================================================== 319 301 END MODULE zdfric -
branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/OPA_SRC/ZDF/zdftke.F90
r7813 r7953 27 27 !! 3.3 ! 2010-10 (C. Ethe, G. Madec) reorganisation of initialisation phase 28 28 !! 3.6 ! 2014-11 (P. Mathiot) add ice shelf capability 29 !! 4.0 ! 2017-04 (G. Madec) Remove CPP keys 29 30 !!---------------------------------------------------------------------- 30 #if defined key_zdftke 31 !!---------------------------------------------------------------------- 32 !! 'key_zdftke' TKE vertical physics 31 33 32 !!---------------------------------------------------------------------- 34 33 !! zdf_tke : update momentum and tracer Kz from a tke scheme … … 65 64 PUBLIC tke_rst ! routine called in step module 66 65 67 LOGICAL , PUBLIC, PARAMETER :: lk_zdftke = .TRUE. !: TKE vertical mixing flag68 69 66 ! !!** Namelist namzdf_tke ** 70 67 LOGICAL :: ln_mxl0 ! mixing length scale surface value as function of wind stress or not … … 376 373 DO ji = fs_2, fs_jpim1 ! vector opt. 377 374 zcof = zfact1 * tmask(ji,jj,jk) 378 # if defined key_zdftmx_new 379 ! key_zdftmx_new: New internal wave-driven param: set a minimum value for Kz on TKE (ensure numerical stability) 380 zzd_up = zcof * MAX( avm(ji,jj,jk+1) + avm(ji,jj,jk), 2.e-5_wp ) & ! upper diagonal 381 & / ( e3t_n(ji,jj,jk ) * e3w_n(ji,jj,jk ) ) 382 zzd_lw = zcof * MAX( avm(ji,jj,jk) + avm(ji,jj,jk-1), 2.e-5_wp ) & ! lower diagonal 383 & / ( e3t_n(ji,jj,jk-1) * e3w_n(ji,jj,jk ) ) 384 # else 385 zzd_up = zcof * ( avm (ji,jj,jk+1) + avm (ji,jj,jk ) ) & ! upper diagonal 386 & / ( e3t_n(ji,jj,jk ) * e3w_n(ji,jj,jk ) ) 387 zzd_lw = zcof * ( avm (ji,jj,jk ) + avm (ji,jj,jk-1) ) & ! lower diagonal 388 & / ( e3t_n(ji,jj,jk-1) * e3w_n(ji,jj,jk ) ) 389 # endif 375 ! ! A minimum of 2.e-5 m2/s is imposed on TKE vertical 376 ! ! eddy coefficient (ensure numerical stability) 377 zzd_up = zcof * MAX( avm(ji,jj,jk+1) + avm(ji,jj,jk ) , 2.e-5_wp ) & ! upper diagonal 378 & / ( e3t_n(ji,jj,jk ) * e3w_n(ji,jj,jk ) ) 379 zzd_lw = zcof * MAX( avm(ji,jj,jk ) + avm(ji,jj,jk-1) , 2.e-5_wp ) & ! lower diagonal 380 & / ( e3t_n(ji,jj,jk-1) * e3w_n(ji,jj,jk ) ) 381 ! 390 382 ! ! shear prod. at w-point weightened by mask 391 383 zesh2 = ( z3du(ji-1,jj,jk) + z3du(ji,jj,jk) ) / MAX( 1._wp , umask(ji-1,jj,jk) + umask(ji,jj,jk) ) & … … 741 733 ! 742 734 ri_cri = 2._wp / ( 2._wp + rn_ediss / rn_ediff ) ! resulting critical Richardson number 743 # if defined key_zdftmx_new744 ! key_zdftmx_new: New internal wave-driven param: specified value of rn_emin & rmxl_min are used745 rn_emin = 1.e-10_wp746 rmxl_min = 1.e-03_wp747 IF(lwp) THEN ! Control print748 WRITE(numout,*)749 WRITE(numout,*) 'zdf_tke_init : New tidal mixing case: force rn_emin = 1.e-10 and rmxl_min = 1.e-3 '750 WRITE(numout,*) '~~~~~~~~~~~~'751 ENDIF752 # else753 rmxl_min = 1.e-6_wp / ( rn_ediff * SQRT( rn_emin ) ) ! resulting minimum length to recover molecular viscosity754 # endif755 735 ! 756 736 IF(lwp) THEN !* Control print … … 776 756 WRITE(numout,*) 777 757 WRITE(numout,*) ' critical Richardson nb with your parameters ri_cri = ', ri_cri 758 WRITE(numout,*) 759 ENDIF 760 ! 761 IF( ln_zdftmx ) THEN ! Internal wave driven mixing 762 ! ! specific values of rn_emin & rmxl_min are used 763 rn_emin = 1.e-10_wp 764 rmxl_min = 1.e-03_wp 765 IF(lwp) WRITE(numout,*) ' Internal wave-driven mixing case: force rn_emin = 1.e-10 and rmxl_min = 1.e-3 ' 766 ELSE 767 rmxl_min = 1.e-6_wp / ( rn_ediff * SQRT( rn_emin ) ) ! resulting minimum length to recover molecular viscosity 768 IF(lwp) WRITE(numout,*) ' minimum mixing length with your parameters rmxl_min = ', rmxl_min 778 769 ENDIF 779 770 ! … … 891 882 END SUBROUTINE tke_rst 892 883 893 #else894 !!----------------------------------------------------------------------895 !! Dummy module : NO TKE scheme896 !!----------------------------------------------------------------------897 LOGICAL, PUBLIC, PARAMETER :: lk_zdftke = .FALSE. !: TKE flag898 CONTAINS899 SUBROUTINE zdf_tke_init ! Dummy routine900 END SUBROUTINE zdf_tke_init901 SUBROUTINE zdf_tke( kt ) ! Dummy routine902 WRITE(*,*) 'zdf_tke: You should not have seen this print! error?', kt903 END SUBROUTINE zdf_tke904 SUBROUTINE tke_rst( kt, cdrw )905 CHARACTER(len=*) :: cdrw906 WRITE(*,*) 'tke_rst: You should not have seen this print! error?', kt, cdwr907 END SUBROUTINE tke_rst908 #endif909 910 884 !!====================================================================== 911 885 END MODULE zdftke -
branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/OPA_SRC/ZDF/zdftmx.F90
r7931 r7953 2 2 !!======================================================================== 3 3 !! *** MODULE zdftmx *** 4 !! Ocean physics: vertical tidal mixing coefficient4 !! Ocean physics: Internal gravity wave-driven vertical mixing 5 5 !!======================================================================== 6 6 !! History : 1.0 ! 2004-04 (L. Bessieres, G. Madec) Original code 7 !! - ! 2006-08 (A. Koch-Larrouy) Indonesian strait 8 !! 3.3 ! 2010-10 (C. Ethe, G. Madec) reorganisation of initialisation phase 7 !! - ! 2006-08 (A. Koch-Larrouy) Indonesian strait 8 !! 3.3 ! 2010-10 (C. Ethe, G. Madec) reorganisation of initialisation phase 9 !! 3.6 ! 2016-03 (C. de Lavergne) New param: internal wave-driven mixing 10 !! 4.0 ! 2017-04 (G. Madec) Remove the old tidal mixing param. and key zdftmx(_new) 9 11 !!---------------------------------------------------------------------- 10 #if defined key_zdftmx 11 !!---------------------------------------------------------------------- 12 !! 'key_zdftmx' Tidal vertical mixing 13 !!---------------------------------------------------------------------- 14 !! zdf_tmx : global momentum & tracer Kz with tidal induced Kz 15 !! tmx_itf : Indonesian momentum & tracer Kz with tidal induced Kz 16 !!---------------------------------------------------------------------- 17 USE oce ! ocean dynamics and tracers variables 18 USE dom_oce ! ocean space and time domain variables 19 USE zdf_oce ! ocean vertical physics variables 20 USE lbclnk ! ocean lateral boundary conditions (or mpp link) 21 USE eosbn2 ! ocean equation of state 22 USE phycst ! physical constants 23 USE prtctl ! Print control 24 USE in_out_manager ! I/O manager 25 USE iom ! I/O Manager 26 USE lib_mpp ! MPP library 27 USE wrk_nemo ! work arrays 28 USE timing ! Timing 29 USE lib_fortran ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined) 30 31 IMPLICIT NONE 32 PRIVATE 33 34 PUBLIC zdf_tmx ! called in step module 35 PUBLIC zdf_tmx_init ! called in opa module 36 PUBLIC zdf_tmx_alloc ! called in nemogcm module 37 38 LOGICAL, PUBLIC, PARAMETER :: lk_zdftmx = .TRUE. !: tidal mixing flag 39 40 ! !!* Namelist namzdf_tmx : tidal mixing * 41 REAL(wp) :: rn_htmx ! vertical decay scale for turbulence (meters) 42 REAL(wp) :: rn_n2min ! threshold of the Brunt-Vaisala frequency (s-1) 43 REAL(wp) :: rn_tfe ! tidal dissipation efficiency (St Laurent et al. 2002) 44 REAL(wp) :: rn_me ! mixing efficiency (Osborn 1980) 45 LOGICAL :: ln_tmx_itf ! Indonesian Through Flow (ITF): Koch-Larrouy et al. (2007) parameterization 46 REAL(wp) :: rn_tfe_itf ! ITF tidal dissipation efficiency (St Laurent et al. 2002) 47 48 REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) :: en_tmx ! energy available for tidal mixing (W/m2) 49 REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) :: mask_itf ! mask to use over Indonesian area 50 REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: az_tmx ! coefficient used to evaluate the tidal induced Kz 51 52 !! * Substitutions 53 # include "vectopt_loop_substitute.h90" 54 !!---------------------------------------------------------------------- 55 !! NEMO/OPA 3.7 , NEMO Consortium (2014) 56 !! $Id$ 57 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 58 !!---------------------------------------------------------------------- 59 CONTAINS 60 61 INTEGER FUNCTION zdf_tmx_alloc() 62 !!---------------------------------------------------------------------- 63 !! *** FUNCTION zdf_tmx_alloc *** 64 !!---------------------------------------------------------------------- 65 ALLOCATE(en_tmx(jpi,jpj), mask_itf(jpi,jpj), az_tmx(jpi,jpj,jpk), STAT=zdf_tmx_alloc ) 66 ! 67 IF( lk_mpp ) CALL mpp_sum ( zdf_tmx_alloc ) 68 IF( zdf_tmx_alloc /= 0 ) CALL ctl_warn('zdf_tmx_alloc: failed to allocate arrays') 69 END FUNCTION zdf_tmx_alloc 70 71 72 SUBROUTINE zdf_tmx( kt ) 73 !!---------------------------------------------------------------------- 74 !! *** ROUTINE zdf_tmx *** 75 !! 76 !! ** Purpose : add to the vertical mixing coefficients the effect of 77 !! tidal mixing (Simmons et al 2004). 78 !! 79 !! ** Method : - tidal-induced vertical mixing is given by: 80 !! Kz_tides = az_tmx / max( rn_n2min, N^2 ) 81 !! where az_tmx is a coefficient that specified the 3D space 82 !! distribution of the faction of tidal energy taht is used 83 !! for mixing. Its expression is set in zdf_tmx_init routine, 84 !! following Simmons et al. 2004. 85 !! NB: a specific bounding procedure is performed on av_tide 86 !! so that the input tidal energy is actually almost used. The 87 !! basic maximum value is 60 cm2/s, but values of 300 cm2/s 88 !! can be reached in area where bottom stratification is too 89 !! weak. 90 !! 91 !! - update av_tide in the Indonesian Through Flow area 92 !! following Koch-Larrouy et al. (2007) parameterisation 93 !! (see tmx_itf routine). 94 !! 95 !! - update the model vertical eddy viscosity and diffusivity: 96 !! avt = avt + av_tides 97 !! avm = avm + av_tides 98 !! avmu = avmu + mi(av_tides) 99 !! avmv = avmv + mj(av_tides) 100 !! 101 !! ** Action : avt, avm, avmu, avmv increased by tidal mixing 102 !! 103 !! References : Simmons et al. 2004, Ocean Modelling, 6, 3-4, 245-263. 104 !! Koch-Larrouy et al. 2007, GRL. 105 !!---------------------------------------------------------------------- 106 INTEGER, INTENT(in) :: kt ! ocean time-step 107 ! 108 INTEGER :: ji, jj, jk ! dummy loop indices 109 REAL(wp) :: ztpc ! scalar workspace 110 REAL(wp), POINTER, DIMENSION(:,:) :: zkz 111 REAL(wp), POINTER, DIMENSION(:,:,:) :: zav_tide 112 !!---------------------------------------------------------------------- 113 ! 114 IF( nn_timing == 1 ) CALL timing_start('zdf_tmx') 115 ! 116 CALL wrk_alloc( jpi,jpj, zkz ) 117 CALL wrk_alloc( jpi,jpj,jpk, zav_tide ) 118 ! 119 ! ! ----------------------- ! 120 ! ! Standard tidal mixing ! (compute zav_tide) 121 ! ! ----------------------- ! 122 ! !* First estimation (with n2 bound by rn_n2min) bounded by 60 cm2/s 123 zav_tide(:,:,:) = MIN( 60.e-4, az_tmx(:,:,:) / MAX( rn_n2min, rn2(:,:,:) ) ) 124 125 zkz(:,:) = 0.e0 !* Associated potential energy consummed over the whole water column 126 DO jk = 2, jpkm1 127 zkz(:,:) = zkz(:,:) + e3w_n(:,:,jk) * MAX( 0.e0, rn2(:,:,jk) ) * rau0 * zav_tide(:,:,jk) * wmask(:,:,jk) 128 END DO 129 130 DO jj = 1, jpj !* Here zkz should be equal to en_tmx ==> multiply by en_tmx/zkz to recover en_tmx 131 DO ji = 1, jpi 132 IF( zkz(ji,jj) /= 0.e0 ) zkz(ji,jj) = en_tmx(ji,jj) / zkz(ji,jj) 133 END DO 134 END DO 135 136 DO jk = 2, jpkm1 !* Mutiply by zkz to recover en_tmx, BUT bound by 30/6 ==> zav_tide bound by 300 cm2/s 137 zav_tide(:,:,jk) = zav_tide(:,:,jk) * MIN( zkz(:,:), 30./6. ) * wmask(:,:,jk) !kz max = 300 cm2/s 138 END DO 139 140 IF( kt == nit000 ) THEN !* check at first time-step: diagnose the energy consumed by zav_tide 141 ztpc = 0._wp 142 DO jk= 1, jpk 143 DO jj= 1, jpj 144 DO ji= 1, jpi 145 ztpc = ztpc + e3w_n(ji,jj,jk) * e1e2t(ji,jj) & 146 & * MAX( 0.e0, rn2(ji,jj,jk) ) * zav_tide(ji,jj,jk) * tmask(ji,jj,jk) * tmask_i(ji,jj) 147 END DO 148 END DO 149 END DO 150 ztpc= rau0 / ( rn_tfe * rn_me ) * ztpc 151 IF( lk_mpp ) CALL mpp_sum( ztpc ) 152 IF(lwp) WRITE(numout,*) 153 IF(lwp) WRITE(numout,*) ' N Total power consumption by av_tide : ztpc = ', ztpc * 1.e-12 ,'TW' 154 ENDIF 155 156 ! ! ----------------------- ! 157 ! ! ITF tidal mixing ! (update zav_tide) 158 ! ! ----------------------- ! 159 IF( ln_tmx_itf ) CALL tmx_itf( kt, zav_tide ) 160 161 ! ! ----------------------- ! 162 ! ! Update mixing coefs ! 163 ! ! ----------------------- ! 164 DO jk = 2, jpkm1 !* update momentum & tracer diffusivity with tidal mixing 165 avt(:,:,jk) = avs(:,:,jk) + zav_tide(:,:,jk) * wmask(:,:,jk) 166 avm(:,:,jk) = avm(:,:,jk) + zav_tide(:,:,jk) * wmask(:,:,jk) 167 DO jj = 2, jpjm1 168 DO ji = fs_2, fs_jpim1 ! vector opt. 169 avmu(ji,jj,jk) = avmu(ji,jj,jk) + 0.5 * ( zav_tide(ji,jj,jk) + zav_tide(ji+1,jj ,jk) ) * wumask(ji,jj,jk) 170 avmv(ji,jj,jk) = avmv(ji,jj,jk) + 0.5 * ( zav_tide(ji,jj,jk) + zav_tide(ji ,jj+1,jk) ) * wvmask(ji,jj,jk) 171 END DO 172 END DO 173 END DO 174 CALL lbc_lnk( avmu, 'U', 1. ) ; CALL lbc_lnk( avmv, 'V', 1. ) ! lateral boundary condition 175 176 ! !* output tidal mixing coefficient 177 CALL iom_put( "av_tide", zav_tide ) 178 179 IF(ln_ctl) CALL prt_ctl(tab3d_1=zav_tide , clinfo1=' tmx - av_tide: ', tab3d_2=avt, clinfo2=' avt: ', ovlap=1, kdim=jpk) 180 ! 181 CALL wrk_dealloc( jpi,jpj, zkz ) 182 CALL wrk_dealloc( jpi,jpj,jpk, zav_tide ) 183 ! 184 IF( nn_timing == 1 ) CALL timing_stop('zdf_tmx') 185 ! 186 END SUBROUTINE zdf_tmx 187 188 189 SUBROUTINE tmx_itf( kt, pav ) 190 !!---------------------------------------------------------------------- 191 !! *** ROUTINE tmx_itf *** 192 !! 193 !! ** Purpose : modify the vertical eddy diffusivity coefficients 194 !! (pav) in the Indonesian Through Flow area (ITF). 195 !! 196 !! ** Method : - Following Koch-Larrouy et al. (2007), in the ITF defined 197 !! by msk_itf (read in a file, see tmx_init), the tidal 198 !! mixing coefficient is computed with : 199 !! * q=1 (i.e. all the tidal energy remains trapped in 200 !! the area and thus is used for mixing) 201 !! * the vertical distribution of the tifal energy is a 202 !! proportional to N above the thermocline (d(N^2)/dz > 0) 203 !! and to N^2 below the thermocline (d(N^2)/dz < 0) 204 !! 205 !! ** Action : av_tide updated in the ITF area (msk_itf) 206 !! 207 !! References : Koch-Larrouy et al. 2007, GRL 208 !!---------------------------------------------------------------------- 209 INTEGER , INTENT(in ) :: kt ! ocean time-step 210 REAL(wp), INTENT(inout), DIMENSION(jpi,jpj,jpk) :: pav ! Tidal mixing coef. 211 !! 212 INTEGER :: ji, jj, jk ! dummy loop indices 213 REAL(wp) :: zcoef, ztpc ! temporary scalar 214 REAL(wp), DIMENSION(:,:) , POINTER :: zkz ! 2D workspace 215 REAL(wp), DIMENSION(:,:) , POINTER :: zsum1 , zsum2 , zsum ! - - 216 REAL(wp), DIMENSION(:,:,:), POINTER :: zempba_3d_1, zempba_3d_2 ! 3D workspace 217 REAL(wp), DIMENSION(:,:,:), POINTER :: zempba_3d , zdn2dz ! - - 218 REAL(wp), DIMENSION(:,:,:), POINTER :: zavt_itf ! - - 219 !!---------------------------------------------------------------------- 220 ! 221 IF( nn_timing == 1 ) CALL timing_start('tmx_itf') 222 ! 223 CALL wrk_alloc( jpi,jpj, zkz, zsum1 , zsum2 , zsum ) 224 CALL wrk_alloc( jpi,jpj,jpk, zempba_3d_1, zempba_3d_2, zempba_3d, zdn2dz, zavt_itf ) 225 226 ! ! compute the form function using N2 at each time step 227 zempba_3d_1(:,:,jpk) = 0.e0 228 zempba_3d_2(:,:,jpk) = 0.e0 229 DO jk = 1, jpkm1 230 zdn2dz (:,:,jk) = rn2(:,:,jk) - rn2(:,:,jk+1) ! Vertical profile of dN2/dz 231 zempba_3d_1(:,:,jk) = SQRT( MAX( 0.e0, rn2(:,:,jk) ) ) ! - - of N 232 zempba_3d_2(:,:,jk) = MAX( 0.e0, rn2(:,:,jk) ) ! - - of N^2 233 END DO 234 ! 235 zsum (:,:) = 0.e0 236 zsum1(:,:) = 0.e0 237 zsum2(:,:) = 0.e0 238 DO jk= 2, jpk 239 zsum1(:,:) = zsum1(:,:) + zempba_3d_1(:,:,jk) * e3w_n(:,:,jk) * wmask(:,:,jk) 240 zsum2(:,:) = zsum2(:,:) + zempba_3d_2(:,:,jk) * e3w_n(:,:,jk) * wmask(:,:,jk) 241 END DO 242 DO jj = 1, jpj 243 DO ji = 1, jpi 244 IF( zsum1(ji,jj) /= 0.e0 ) zsum1(ji,jj) = 1.e0 / zsum1(ji,jj) 245 IF( zsum2(ji,jj) /= 0.e0 ) zsum2(ji,jj) = 1.e0 / zsum2(ji,jj) 246 END DO 247 END DO 248 249 DO jk= 1, jpk 250 DO jj = 1, jpj 251 DO ji = 1, jpi 252 zcoef = 0.5 - SIGN( 0.5, zdn2dz(ji,jj,jk) ) ! =0 if dN2/dz > 0, =1 otherwise 253 ztpc = zempba_3d_1(ji,jj,jk) * zsum1(ji,jj) * zcoef & 254 & + zempba_3d_2(ji,jj,jk) * zsum2(ji,jj) * ( 1. - zcoef ) 255 ! 256 zempba_3d(ji,jj,jk) = ztpc 257 zsum (ji,jj) = zsum(ji,jj) + ztpc * e3w_n(ji,jj,jk) 258 END DO 259 END DO 260 END DO 261 DO jj = 1, jpj 262 DO ji = 1, jpi 263 IF( zsum(ji,jj) > 0.e0 ) zsum(ji,jj) = 1.e0 / zsum(ji,jj) 264 END DO 265 END DO 266 267 ! ! first estimation bounded by 10 cm2/s (with n2 bounded by rn_n2min) 268 zcoef = rn_tfe_itf / ( rn_tfe * rau0 ) 269 DO jk = 1, jpk 270 zavt_itf(:,:,jk) = MIN( 10.e-4, zcoef * en_tmx(:,:) * zsum(:,:) * zempba_3d(:,:,jk) & 271 & / MAX( rn_n2min, rn2(:,:,jk) ) * tmask(:,:,jk) ) 272 END DO 273 274 zkz(:,:) = 0.e0 ! Associated potential energy consummed over the whole water column 275 DO jk = 2, jpkm1 276 zkz(:,:) = zkz(:,:) + e3w_n(:,:,jk) * MAX( 0.e0, rn2(:,:,jk) ) * rau0 * zavt_itf(:,:,jk) * wmask(:,:,jk) 277 END DO 278 279 DO jj = 1, jpj ! Here zkz should be equal to en_tmx ==> multiply by en_tmx/zkz to recover en_tmx 280 DO ji = 1, jpi 281 IF( zkz(ji,jj) /= 0.e0 ) zkz(ji,jj) = en_tmx(ji,jj) * rn_tfe_itf / rn_tfe / zkz(ji,jj) 282 END DO 283 END DO 284 285 DO jk = 2, jpkm1 ! Mutiply by zkz to recover en_tmx, BUT bound by 30/6 ==> zavt_itf bound by 300 cm2/s 286 zavt_itf(:,:,jk) = zavt_itf(:,:,jk) * MIN( zkz(:,:), 120./10. ) * wmask(:,:,jk) ! kz max = 120 cm2/s 287 END DO 288 289 IF( kt == nit000 ) THEN ! diagnose the nergy consumed by zavt_itf 290 ztpc = 0.e0 291 DO jk= 1, jpk 292 DO jj= 1, jpj 293 DO ji= 1, jpi 294 ztpc = ztpc + e1e2t(ji,jj) * e3w_n(ji,jj,jk) * MAX( 0.e0, rn2(ji,jj,jk) ) & 295 & * zavt_itf(ji,jj,jk) * tmask(ji,jj,jk) * tmask_i(ji,jj) 296 END DO 297 END DO 298 END DO 299 IF( lk_mpp ) CALL mpp_sum( ztpc ) 300 ztpc= rau0 * ztpc / ( rn_me * rn_tfe_itf ) 301 IF(lwp) WRITE(numout,*) ' N Total power consumption by zavt_itf: ztpc = ', ztpc * 1.e-12 ,'TW' 302 ENDIF 303 304 ! ! Update pav with the ITF mixing coefficient 305 DO jk = 2, jpkm1 306 pav(:,:,jk) = pav (:,:,jk) * ( 1.e0 - mask_itf(:,:) ) & 307 & + zavt_itf(:,:,jk) * mask_itf(:,:) 308 END DO 309 ! 310 CALL wrk_dealloc( jpi,jpj, zkz, zsum1 , zsum2 , zsum ) 311 CALL wrk_dealloc( jpi,jpj,jpk, zempba_3d_1, zempba_3d_2, zempba_3d, zdn2dz, zavt_itf ) 312 ! 313 IF( nn_timing == 1 ) CALL timing_stop('tmx_itf') 314 ! 315 END SUBROUTINE tmx_itf 316 317 318 SUBROUTINE zdf_tmx_init 319 !!---------------------------------------------------------------------- 320 !! *** ROUTINE zdf_tmx_init *** 321 !! 322 !! ** Purpose : Initialization of the vertical tidal mixing, Reading 323 !! of M2 and K1 tidal energy in nc files 324 !! 325 !! ** Method : - Read the namtmx namelist and check the parameters 326 !! 327 !! - Read the input data in NetCDF files : 328 !! M2 and K1 tidal energy. The total tidal energy, en_tmx, 329 !! is the sum of M2, K1 and S2 energy where S2 is assumed 330 !! to be: S2=(1/2)^2 * M2 331 !! mask_itf, a mask array that determine where substituing 332 !! the standard Simmons et al. (2005) formulation with the 333 !! one of Koch_Larrouy et al. (2007). 334 !! 335 !! - Compute az_tmx, a 3D coefficient that allows to compute 336 !! the standard tidal-induced vertical mixing as follows: 337 !! Kz_tides = az_tmx / max( rn_n2min, N^2 ) 338 !! with az_tmx a bottom intensified coefficient is given by: 339 !! az_tmx(z) = en_tmx / ( rau0 * rn_htmx ) * EXP( -(H-z)/rn_htmx ) 340 !! / ( 1. - EXP( - H /rn_htmx ) ) 341 !! where rn_htmx the characteristic length scale of the bottom 342 !! intensification, en_tmx the tidal energy, and H the ocean depth 343 !! 344 !! ** input : - Namlist namtmx 345 !! - NetCDF file : M2_ORCA2.nc, K1_ORCA2.nc, and mask_itf.nc 346 !! 347 !! ** Action : - Increase by 1 the nstop flag is setting problem encounter 348 !! - defined az_tmx used to compute tidal-induced mixing 349 !! 350 !! References : Simmons et al. 2004, Ocean Modelling, 6, 3-4, 245-263. 351 !! Koch-Larrouy et al. 2007, GRL. 352 !!---------------------------------------------------------------------- 353 INTEGER :: ji, jj, jk ! dummy loop indices 354 INTEGER :: inum ! local integer 355 INTEGER :: ios 356 REAL(wp) :: ztpc, ze_z ! local scalars 357 REAL(wp), DIMENSION(:,:) , POINTER :: zem2, zek1 ! read M2 and K1 tidal energy 358 REAL(wp), DIMENSION(:,:) , POINTER :: zkz ! total M2, K1 and S2 tidal energy 359 REAL(wp), DIMENSION(:,:) , POINTER :: zfact ! used for vertical structure function 360 REAL(wp), DIMENSION(:,:) , POINTER :: zhdep ! Ocean depth 361 REAL(wp), DIMENSION(:,:,:), POINTER :: zpc, zav_tide ! power consumption 362 !! 363 NAMELIST/namzdf_tmx/ rn_htmx, rn_n2min, rn_tfe, rn_me, ln_tmx_itf, rn_tfe_itf 364 !!---------------------------------------------------------------------- 365 ! 366 IF( nn_timing == 1 ) CALL timing_start('zdf_tmx_init') 367 ! 368 CALL wrk_alloc( jpi,jpj, zem2, zek1, zkz, zfact, zhdep ) 369 CALL wrk_alloc( jpi,jpj,jpk, zpc, zav_tide ) 370 ! 371 REWIND( numnam_ref ) ! Namelist namzdf_tmx in reference namelist : Tidal Mixing 372 READ ( numnam_ref, namzdf_tmx, IOSTAT = ios, ERR = 901) 373 901 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namzdf_tmx in reference namelist', lwp ) 374 ! 375 REWIND( numnam_cfg ) ! Namelist namzdf_tmx in configuration namelist : Tidal Mixing 376 READ ( numnam_cfg, namzdf_tmx, IOSTAT = ios, ERR = 902 ) 377 902 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namzdf_tmx in configuration namelist', lwp ) 378 IF(lwm) WRITE ( numond, namzdf_tmx ) 379 ! 380 IF(lwp) THEN ! Control print 381 WRITE(numout,*) 382 WRITE(numout,*) 'zdf_tmx_init : tidal mixing' 383 WRITE(numout,*) '~~~~~~~~~~~~' 384 WRITE(numout,*) ' Namelist namzdf_tmx : set tidal mixing parameters' 385 WRITE(numout,*) ' Vertical decay scale for turbulence = ', rn_htmx 386 WRITE(numout,*) ' Brunt-Vaisala frequency threshold = ', rn_n2min 387 WRITE(numout,*) ' Tidal dissipation efficiency = ', rn_tfe 388 WRITE(numout,*) ' Mixing efficiency = ', rn_me 389 WRITE(numout,*) ' ITF specific parameterisation = ', ln_tmx_itf 390 WRITE(numout,*) ' ITF tidal dissipation efficiency = ', rn_tfe_itf 391 ENDIF 392 ! ! allocate tmx arrays 393 IF( zdf_tmx_alloc() /= 0 ) CALL ctl_stop( 'STOP', 'zdf_tmx_init : unable to allocate tmx arrays' ) 394 395 IF( ln_tmx_itf ) THEN ! read the Indonesian Through Flow mask 396 CALL iom_open('mask_itf',inum) 397 CALL iom_get (inum, jpdom_data, 'tmaskitf',mask_itf,1) ! 398 CALL iom_close(inum) 399 ENDIF 400 ! ! read M2 tidal energy flux : W/m2 ( zem2 < 0 ) 401 CALL iom_open('M2rowdrg',inum) 402 CALL iom_get (inum, jpdom_data, 'field',zem2,1) ! 403 CALL iom_close(inum) 404 ! ! read K1 tidal energy flux : W/m2 ( zek1 < 0 ) 405 CALL iom_open('K1rowdrg',inum) 406 CALL iom_get (inum, jpdom_data, 'field',zek1,1) ! 407 CALL iom_close(inum) 408 ! ! Total tidal energy ( M2, S2 and K1 with S2=(1/2)^2 * M2 ) 409 ! ! only the energy available for mixing is taken into account, 410 ! ! (mixing efficiency tidal dissipation efficiency) 411 en_tmx(:,:) = - rn_tfe * rn_me * ( zem2(:,:) * 1.25 + zek1(:,:) ) * ssmask(:,:) 412 413 !============ 414 !TG: Bug for VVL? Should this section be moved out of _init and be updated at every timestep? 415 !!gm : you are right, but tidal mixing acts in deep ocean (H>500m) where e3 is O(100m) 416 !! the error is thus ~1% which I feel comfortable with, compared to uncertainties in tidal energy dissipation. 417 ! ! Vertical structure (az_tmx) 418 DO jj = 1, jpj ! part independent of the level 419 DO ji = 1, jpi 420 zhdep(ji,jj) = gdepw_0(ji,jj,mbkt(ji,jj)+1) ! depth of the ocean 421 zfact(ji,jj) = rau0 * rn_htmx * ( 1. - EXP( -zhdep(ji,jj) / rn_htmx ) ) 422 IF( zfact(ji,jj) /= 0 ) zfact(ji,jj) = en_tmx(ji,jj) / zfact(ji,jj) 423 END DO 424 END DO 425 DO jk= 1, jpk ! complete with the level-dependent part 426 DO jj = 1, jpj 427 DO ji = 1, jpi 428 az_tmx(ji,jj,jk) = zfact(ji,jj) * EXP( -( zhdep(ji,jj)-gdepw_0(ji,jj,jk) ) / rn_htmx ) * tmask(ji,jj,jk) 429 END DO 430 END DO 431 END DO 432 !=========== 433 ! 434 IF( nprint == 1 .AND. lwp ) THEN 435 ! Control print 436 ! Total power consumption due to vertical mixing 437 ! zpc = rau0 * 1/rn_me * rn2 * zav_tide 438 zav_tide(:,:,:) = 0.e0 439 DO jk = 2, jpkm1 440 zav_tide(:,:,jk) = az_tmx(:,:,jk) / MAX( rn_n2min, rn2(:,:,jk) ) 441 END DO 442 ! 443 ztpc = 0._wp 444 zpc(:,:,:) = MAX(rn_n2min,rn2(:,:,:)) * zav_tide(:,:,:) 445 DO jk= 2, jpkm1 446 DO jj = 1, jpj 447 DO ji = 1, jpi 448 ztpc = ztpc + e3w_n(ji,jj,jk) * e1e2t(ji,jj) * zpc(ji,jj,jk) * wmask(ji,jj,jk) * tmask_i(ji,jj) 449 END DO 450 END DO 451 END DO 452 IF( lk_mpp ) CALL mpp_sum( ztpc ) 453 ztpc= rau0 * 1/(rn_tfe * rn_me) * ztpc 454 ! 455 WRITE(numout,*) 456 WRITE(numout,*) ' Total power consumption of the tidally driven part of Kz : ztpc = ', ztpc * 1.e-12 ,'TW' 457 ! 458 ! control print 2 459 zav_tide(:,:,:) = MIN( zav_tide(:,:,:), 60.e-4 ) 460 zkz(:,:) = 0._wp 461 DO jk = 2, jpkm1 462 zkz(:,:) = zkz(:,:) + e3w_n(:,:,jk) * MAX(0.e0, rn2(:,:,jk)) * rau0 * zav_tide(:,:,jk) * wmask(:,:,jk) 463 END DO 464 ! Here zkz should be equal to en_tmx ==> multiply by en_tmx/zkz 465 DO jj = 1, jpj 466 DO ji = 1, jpi 467 IF( zkz(ji,jj) /= 0.e0 ) THEN 468 zkz(ji,jj) = en_tmx(ji,jj) / zkz(ji,jj) 469 ENDIF 470 END DO 471 END DO 472 ztpc = 1.e50 473 DO jj = 1, jpj 474 DO ji = 1, jpi 475 IF( zkz(ji,jj) /= 0.e0 ) THEN 476 ztpc = Min( zkz(ji,jj), ztpc) 477 ENDIF 478 END DO 479 END DO 480 WRITE(numout,*) ' Min de zkz ', ztpc, ' Max = ', maxval(zkz(:,:) ) 481 ! 482 DO jk = 2, jpkm1 483 zav_tide(:,:,jk) = zav_tide(:,:,jk) * MIN( zkz(:,:), 30./6. ) * wmask(:,:,jk) !kz max = 300 cm2/s 484 END DO 485 ztpc = 0._wp 486 zpc(:,:,:) = Max(0.e0,rn2(:,:,:)) * zav_tide(:,:,:) 487 DO jk= 1, jpk 488 DO jj = 1, jpj 489 DO ji = 1, jpi 490 ztpc = ztpc + e3w_n(ji,jj,jk) * e1e2t(ji,jj) * zpc(ji,jj,jk) * wmask(ji,jj,jk) * tmask_i(ji,jj) 491 END DO 492 END DO 493 END DO 494 IF( lk_mpp ) CALL mpp_sum( ztpc ) 495 ztpc= rau0 * 1/(rn_tfe * rn_me) * ztpc 496 WRITE(numout,*) ' 2 Total power consumption of the tidally driven part of Kz : ztpc = ', ztpc * 1.e-12 ,'TW' 497 !!gm bug mpp in these diagnostics 498 DO jk = 1, jpk 499 ze_z = SUM( e1e2t(:,:) * zav_tide(:,:,jk) * tmask_i(:,:) ) & 500 & / MAX( 1.e-20, SUM( e1e2t(:,:) * wmask (:,:,jk) * tmask_i(:,:) ) ) 501 ztpc = 1.e50 502 DO jj = 1, jpj 503 DO ji = 1, jpi 504 IF( zav_tide(ji,jj,jk) /= 0.e0 ) ztpc = MIN( ztpc, zav_tide(ji,jj,jk) ) 505 END DO 506 END DO 507 WRITE(numout,*) ' N2 min - jk= ', jk,' ', ze_z * 1.e4,' cm2/s min= ',ztpc*1.e4, & 508 & 'max= ', MAXVAL(zav_tide(:,:,jk) )*1.e4, ' cm2/s' 509 END DO 510 511 WRITE(numout,*) ' e_tide : ', SUM( e1e2t*en_tmx ) / ( rn_tfe * rn_me ) * 1.e-12, 'TW' 512 WRITE(numout,*) 513 WRITE(numout,*) ' Initial profile of tidal vertical mixing' 514 DO jk = 1, jpk 515 DO jj = 1,jpj 516 DO ji = 1,jpi 517 zkz(ji,jj) = az_tmx(ji,jj,jk) /MAX( rn_n2min, rn2(ji,jj,jk) ) 518 END DO 519 END DO 520 ze_z = SUM( e1e2t(:,:) * zkz (:,:) * tmask_i(:,:) ) & 521 & / MAX( 1.e-20, SUM( e1e2t(:,:) * wmask(:,:,jk) * tmask_i(:,:) ) ) 522 WRITE(numout,*) ' jk= ', jk,' ', ze_z * 1.e4,' cm2/s' 523 END DO 524 DO jk = 1, jpk 525 zkz(:,:) = az_tmx(:,:,jk) /rn_n2min 526 ze_z = SUM( e1e2t(:,:) * zkz (:,:) * tmask_i(:,:) ) & 527 & / MAX( 1.e-20, SUM( e1e2t(:,:) * wmask(:,:,jk) * tmask_i(:,:) ) ) 528 WRITE(numout,*) 529 WRITE(numout,*) ' N2 min - jk= ', jk,' ', ze_z * 1.e4,' cm2/s min= ',MINVAL(zkz)*1.e4, & 530 & 'max= ', MAXVAL(zkz)*1.e4, ' cm2/s' 531 END DO 532 !!gm end bug mpp 533 ! 534 ENDIF 535 ! 536 CALL wrk_dealloc( jpi,jpj, zem2, zek1, zkz, zfact, zhdep ) 537 CALL wrk_dealloc( jpi,jpj,jpk, zpc, zav_tide ) 538 ! 539 IF( nn_timing == 1 ) CALL timing_stop('zdf_tmx_init') 540 ! 541 END SUBROUTINE zdf_tmx_init 542 543 #elif defined key_zdftmx_new 544 !!---------------------------------------------------------------------- 545 !! 'key_zdftmx_new' Internal wave-driven vertical mixing 12 546 13 !!---------------------------------------------------------------------- 547 14 !! zdf_tmx : global momentum & tracer Kz with wave induced Kz … … 569 36 PUBLIC zdf_tmx_init ! called in nemogcm module 570 37 PUBLIC zdf_tmx_alloc ! called in nemogcm module 571 572 LOGICAL, PUBLIC, PARAMETER :: lk_zdftmx = .TRUE. !: wave-driven mixing flag573 38 574 39 ! !!* Namelist namzdf_tmx : internal wave-driven mixing * … … 1027 492 END SUBROUTINE zdf_tmx_init 1028 493 1029 #else1030 !!----------------------------------------------------------------------1031 !! Default option Dummy module NO Tidal MiXing1032 !!----------------------------------------------------------------------1033 LOGICAL, PUBLIC, PARAMETER :: lk_zdftmx = .FALSE. !: tidal mixing flag1034 CONTAINS1035 SUBROUTINE zdf_tmx_init ! Dummy routine1036 WRITE(*,*) 'zdf_tmx: You should not have seen this print! error?'1037 END SUBROUTINE zdf_tmx_init1038 SUBROUTINE zdf_tmx( kt ) ! Dummy routine1039 WRITE(*,*) 'zdf_tmx: You should not have seen this print! error?', kt1040 END SUBROUTINE zdf_tmx1041 #endif1042 1043 494 !!====================================================================== 1044 495 END MODULE zdftmx -
branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/OPA_SRC/nemogcm.F90
r7931 r7953 55 55 USE ldfdyn ! lateral viscosity setting (ldfdyn_init routine) 56 56 USE ldftra ! lateral diffusivity setting (ldftra_init routine) 57 USE zdfini ! vertical physics setting (zdf_init routine)57 !!gm USE zdfphy ! vertical physics manager (zdf_phy_init routine) 58 58 USE trdini ! dyn/tra trends initialization (trd_init routine) 59 59 USE asminc ! assimilation increments … … 429 429 IF( ln_ctl ) CALL prt_ctl_init ! Print control 430 430 431 CALL diurnal_sst_bulk_init ! diurnal sst431 CALL diurnal_sst_bulk_init ! diurnal sst 432 432 IF ( ln_diurnal ) CALL diurnal_sst_coolskin_init ! cool skin 433 433 … … 455 455 CALL sbc_init ! surface boundary conditions (including sea-ice) 456 456 CALL bdy_init ! Open boundaries initialisation 457 457 458 ! ! Ocean physics 458 ! ! Vertical physics 459 CALL zdf_init ! namelist read 460 CALL zdf_bfr_init ! bottom friction 461 IF( lk_zdfric ) CALL zdf_ric_init ! Richardson number dependent Kz 462 IF( lk_zdftke ) CALL zdf_tke_init ! TKE closure scheme 463 IF( lk_zdfgls ) CALL zdf_gls_init ! GLS closure scheme 464 IF( lk_zdftmx ) CALL zdf_tmx_init ! tidal vertical mixing 465 !!gm IF( ln_zdfddm ) CALL zdf_ddm_init ! double diffusive mixing 466 459 CALL zdf_phy_init ! Vertical physics 460 467 461 ! ! Lateral physics 468 462 CALL ldf_tra_init ! Lateral ocean tracer physics … … 470 464 CALL ldf_dyn_init ! Lateral ocean momentum physics 471 465 472 ! 466 ! ! Active tracers 473 467 CALL tra_qsr_init ! penetrative solar radiation qsr 474 468 CALL tra_bbc_init ! bottom heat flux … … 479 473 CALL tra_zdf_init ! vertical mixing and after tracer fields 480 474 481 ! 475 ! ! Dynamics 482 476 IF( lk_c1d ) CALL dyn_dmp_init ! internal momentum damping 483 477 CALL dyn_adv_init ! advection (vector or flux form) … … 511 505 IF( ln_diaobs ) CALL dia_obs( nit000 - 1 ) ! Observation operator for restart 512 506 513 ! 507 ! ! Assimilation increments 514 508 IF( lk_asminc ) CALL asm_inc_init ! Initialize assimilation increments 515 509 IF(lwp) WRITE(numout,*) 'Euler time step switch is ', neuler -
branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/OPA_SRC/step.F90
r7931 r7953 74 74 !! -8- Outputs and diagnostics 75 75 !!---------------------------------------------------------------------- 76 INTEGER :: ji, jj,jk! dummy loop indice77 INTEGER :: indic ! error indicator if < 078 INTEGER :: kcall ! optional integer argument (dom_vvl_sf_nxt)76 INTEGER :: ji, jj, jk ! dummy loop indice 77 INTEGER :: indic ! error indicator if < 0 78 INTEGER :: kcall ! optional integer argument (dom_vvl_sf_nxt) 79 79 !! --------------------------------------------------------------------- 80 80 #if defined key_agrif … … 125 125 CALL bn2 ( tsn, rab_n, rn2 ) ! now Brunt-Vaisala frequency 126 126 127 !128 127 ! VERTICAL PHYSICS 129 CALL zdf_bfr( kstp ) ! bottom friction (if quadratic) 130 ! ! Vertical eddy viscosity and diffusivity coefficients 131 IF( lk_zdfric ) CALL zdf_ric ( kstp ) ! Richardson number dependent Kz 132 IF( lk_zdftke ) CALL zdf_tke ( kstp ) ! TKE closure scheme for Kz 133 IF( lk_zdfgls ) CALL zdf_gls ( kstp ) ! GLS closure scheme for Kz 134 IF( ln_zdfqiao ) CALL zdf_qiao( kstp ) ! Qiao vertical mixing 135 ! 136 IF( lk_zdfcst ) THEN ! Constant Kz (reset avt, avm[uv] to the background value) 137 avt (:,:,:) = rn_avt0 * wmask (:,:,:) 138 avm (:,:,:) = rn_avm0 * wmask (:,:,:) 139 avmu(:,:,:) = rn_avm0 * wumask(:,:,:) 140 avmv(:,:,:) = rn_avm0 * wvmask(:,:,:) 141 ENDIF 142 ! 143 IF( ln_rnf_mouth ) THEN ! increase diffusivity at rivers mouths 144 DO jk = 2, nkrnf ; avt(:,:,jk) = avt(:,:,jk) + 2._wp * rn_avt_rnf * rnfmsk(:,:) * tmask(:,:,jk) ; END DO 145 ENDIF 146 ! 147 IF( ln_zdfevd ) CALL zdf_evd( kstp ) ! enhanced vertical eddy diffusivity 148 ! 149 IF( ln_zdfddm ) THEN ! double diffusive mixing 150 CALL zdf_ddm( kstp ) 151 ELSE ! avs=avt 152 DO jk = 2, jpkm1 ; avs(:,:,jk) = avt(:,:,jk) ; END DO 153 ENDIF 154 ! 155 IF( lk_zdftmx ) CALL zdf_tmx( kstp ) ! tidal vertical mixing 156 157 CALL zdf_mxl( kstp ) ! mixed layer depth 158 159 ! write TKE or GLS information in the restart file 160 IF( lrst_oce .AND. lk_zdftke ) CALL tke_rst( kstp, 'WRITE' ) 161 IF( lrst_oce .AND. lk_zdfgls ) CALL gls_rst( kstp, 'WRITE' ) 162 ! 128 CALL zdf_phy( kstp ) ! vertical physics update (bfr, avt, avs, avm + MLD) 129 163 130 ! LATERAL PHYSICS 164 131 ! -
branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/OPA_SRC/step_oce.F90
r7646 r7953 63 63 USE ldftra ! lateral eddy diffusive coef. (ldf_tra routine) 64 64 65 USE zdfphy ! vertical physics manager (zdf_phy_init routine) 66 !!gm to be suppressed 65 67 USE zdftmx ! tide-induced vertical mixing (zdf_tmx routine) 66 68 USE zdfbfr ! bottom friction (zdf_bfr routine) … … 72 74 USE zdfmxl ! Mixed-layer depth (zdf_mxl routine) 73 75 USE zdfqiao !Qiao module wave induced mixing (zdf_qiao routine) 76 !!gm end 74 77 75 78 USE step_diu ! Time stepping for diurnal sst -
branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/TOP_SRC/TRP/trcdmp.F90
r7646 r7953 121 121 DO jj = 2, jpjm1 122 122 DO ji = fs_2, fs_jpim1 ! vector opt. 123 IF( av t(ji,jj,jk) <= 5.e-4_wp ) THEN123 IF( avs(ji,jj,jk) <= 5.e-4_wp ) THEN 124 124 tra(ji,jj,jk,jn) = tra(ji,jj,jk,jn) + restotr(ji,jj,jk) * ( ztrcdta(ji,jj,jk) - trb(ji,jj,jk,jn) ) 125 125 ENDIF -
branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/TOP_SRC/TRP/trczdf.F90
r7931 r7953 4 4 !! Ocean Passive tracers : vertical diffusive trends 5 5 !!===================================================================== 6 !! History : 9.0 ! 2005-11 (G. Madec) Original code6 !! History : 9.0 ! 2005-11 (G. Madec) Original code 7 7 !! NEMO 3.0 ! 2008-01 (C. Ethe, G. Madec) merge TRC-TRA 8 !! 4.0 ! 2017-04 (G. Madec) remove the explicit case 8 9 !!---------------------------------------------------------------------- 9 10 #if defined key_top … … 11 12 !! 'key_top' TOP models 12 13 !!---------------------------------------------------------------------- 13 !! trc_zdf : update the tracer trend with the lateral diffusion 14 !! trc_zdf_ini : initialization, namelist read, and parameters control 14 !! trc_zdf : update the tracer trend with the vertical diffusion 15 15 !!---------------------------------------------------------------------- 16 16 USE trc ! ocean passive tracers variables … … 27 27 28 28 PUBLIC trc_zdf ! called by step.F90 29 PUBLIC trc_zdf_ini ! called by nemogcm.F9030 29 31 ! !!** Vertical diffusion (nam_trczdf) **32 LOGICAL , PUBLIC :: ln_trczdf_exp !: explicit vertical diffusion scheme flag33 INTEGER , PUBLIC :: nn_trczdf_exp !: number of sub-time step (explicit time stepping)34 35 INTEGER :: nzdf = 0 ! type vertical diffusion algorithm used36 ! ! defined from ln_zdf... namlist logicals)37 !! * Substitutions38 # include "vectopt_loop_substitute.h90"39 30 !!---------------------------------------------------------------------- 40 31 !! NEMO/TOP 3.7 , NEMO Consortium (2015) … … 48 39 !! *** ROUTINE trc_zdf *** 49 40 !! 50 !! ** Purpose : compute the vertical ocean tracer physics. 41 !! ** Purpose : compute the vertical ocean tracer physics using 42 !! an implicit time-stepping scheme. 51 43 !!--------------------------------------------------------------------- 52 44 INTEGER, INTENT( in ) :: kt ! ocean time-step index … … 54 46 INTEGER :: jk, jn 55 47 CHARACTER (len=22) :: charout 56 REAL(wp), POINTER, DIMENSION(:,:,:,:) :: ztrtrd ! 4D workspace48 REAL(wp), DIMENSION(jpi,jpj,jpk,jptra) :: ztrtrd ! 4D workspace 57 49 !!--------------------------------------------------------------------- 58 50 ! 59 51 IF( nn_timing == 1 ) CALL timing_start('trc_zdf') 60 52 ! 61 IF( l_trdtrc ) THEN 62 CALL wrk_alloc( jpi, jpj, jpk, jptra, ztrtrd ) 63 ztrtrd(:,:,:,:) = tra(:,:,:,:) 64 ENDIF 65 66 SELECT CASE ( nzdf ) ! compute lateral mixing trend and add it to the general trend 67 CASE ( 0 ) ; CALL tra_zdf_exp( kt, nittrc000, 'TRC', r2dttrc, nn_trczdf_exp, trb, tra, jptra ) ! explicit scheme 68 CASE ( 1 ) ; CALL tra_zdf_imp( kt, nittrc000, 'TRC', r2dttrc, trb, tra, jptra ) ! implicit scheme 69 END SELECT 70 53 IF( l_trdtrc ) ztrtrd(:,:,:,:) = tra(:,:,:,:) 54 ! 55 CALL tra_zdf_imp( kt, nittrc000, 'TRC', r2dttrc, trb, tra, jptra ) ! implicit scheme 56 ! 71 57 IF( l_trdtrc ) THEN ! save the vertical diffusive trends for further diagnostics 72 58 DO jn = 1, jptra … … 76 62 CALL trd_tra( kt, 'TRC', jn, jptra_zdf, ztrtrd(:,:,:,jn) ) 77 63 END DO 78 CALL wrk_dealloc( jpi, jpj, jpk, jptra, ztrtrd )79 64 ENDIF 80 65 ! ! print mean trends (used for debugging) 81 66 IF( ln_ctl ) THEN 82 WRITE(charout, FMT="('zdf ')") ; CALL prt_ctl_trc_info(charout) 83 CALL prt_ctl_trc( tab4d=tra, mask=tmask, clinfo=ctrcnm, clinfo2='trd' ) 67 WRITE(charout, FMT="('zdf ')") 68 CALL prt_ctl_trc_info(charout) 69 CALL prt_ctl_trc( tab4d=tra, mask=tmask, clinfo=ctrcnm, clinfo2='trd' ) 84 70 END IF 85 71 ! … … 87 73 ! 88 74 END SUBROUTINE trc_zdf 89 90 91 SUBROUTINE trc_zdf_ini92 !!----------------------------------------------------------------------93 !! *** ROUTINE trc_zdf_ini ***94 !!95 !! ** Purpose : Choose the vertical mixing scheme96 !!97 !! ** Method : Set nzdf from ln_zdfexp98 !! nzdf = 0 explicit (time-splitting) scheme (ln_trczdf_exp=T)99 !! = 1 implicit (euler backward) scheme (ln_trczdf_exp=F)100 !! NB: The implicit scheme is required when using :101 !! - rotated lateral mixing operator102 !! - TKE, GLS vertical mixing scheme103 !!----------------------------------------------------------------------104 INTEGER :: ios ! Local integer output status for namelist read105 !!106 NAMELIST/namtrc_zdf/ ln_trczdf_exp , nn_trczdf_exp107 !!----------------------------------------------------------------------108 !109 REWIND( numnat_ref ) ! namtrc_zdf in reference namelist110 READ ( numnat_ref, namtrc_zdf, IOSTAT = ios, ERR = 905)111 905 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc_zdf in reference namelist', lwp )112 !113 REWIND( numnat_cfg ) ! namtrc_zdf in configuration namelist114 READ ( numnat_cfg, namtrc_zdf, IOSTAT = ios, ERR = 906 )115 906 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc_zdf in configuration namelist', lwp )116 IF(lwm) WRITE ( numont, namtrc_zdf )117 !118 IF(lwp) THEN ! Control print119 WRITE(numout,*)120 WRITE(numout,*) ' Namelist namtrc_zdf : set vertical diffusion parameters'121 WRITE(numout,*) ' time splitting / backward scheme ln_trczdf_exp = ', ln_trczdf_exp122 WRITE(numout,*) ' number of time step nn_trczdf_exp = ', nn_trczdf_exp123 ENDIF124 125 ! ! Define the vertical tracer physics scheme126 IF( ln_trczdf_exp ) THEN ; nzdf = 0 ! explicit scheme127 ELSE ; nzdf = 1 ! implicit scheme128 ENDIF129 130 ! ! Force implicit schemes131 IF( ln_trcldf_iso ) nzdf = 1 ! iso-neutral lateral physics132 IF( ln_trcldf_hor .AND. ln_sco ) nzdf = 1 ! horizontal lateral physics in s-coordinate133 #if defined key_zdftke || defined key_zdfgls134 nzdf = 1 ! TKE or GLS physics135 #endif136 IF( ln_trczdf_exp .AND. nzdf == 1 ) &137 CALL ctl_stop( 'trc_zdf : If using the rotated lateral mixing operator or TKE, GLS vertical scheme ', &138 & ' the implicit scheme is required, set ln_trczdf_exp = .false.' )139 140 IF(lwp) THEN141 WRITE(numout,*)142 WRITE(numout,*) 'trc:zdf_ctl : vertical passive tracer physics scheme'143 WRITE(numout,*) '~~~~~~~~~~~'144 IF( nzdf == 0 ) WRITE(numout,*) ' Explicit time-splitting scheme'145 IF( nzdf == 1 ) WRITE(numout,*) ' Implicit (euler backward) scheme'146 ENDIF147 !148 END SUBROUTINE trc_zdf_ini149 75 150 76 #else -
branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/TOP_SRC/oce_trc.F90
r7881 r7953 101 101 102 102 !* vertical diffusion * 103 USE zdf_oce , ONLY : avt => avt !: vert. diffusivity coef. at w-point for temp 104 # if defined key_zdfddm 105 USE zdfddm , ONLY : avs => avs !: salinity vertical diffusivity coeff. at w-point 106 # endif 103 USE zdf_oce , ONLY : avs => avs !: vert. diffusivity coef. for salinity (w-point) 107 104 108 105 !* mixing & mixed layer depth * -
branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/TOP_SRC/trc.F90
r7881 r7953 126 126 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: vn_tm !: j-horizontal velocity average [m/s] 127 127 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) :: tsn_tm !: t/s average [m/s] 128 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: av t_tm !: vertical diffusivity coeff. at w-point [m2/s]128 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: avs_tm !: vertical diffusivity coeff. at w-point [m2/s] 129 129 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: rhop_tm !: 130 # if defined key_zdfddm131 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: avs_tm !: vertical double diffusivity coeff. at w-point [m/s]132 # endif133 130 #if defined key_trabbl 134 131 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: ahu_bbl_tm !: u-, w-points … … 154 151 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) :: tsn_temp 155 152 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: un_temp,vn_temp,wn_temp !: hold current values of avt, un, vn, wn 156 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: av t_temp, rhop_temp !: hold current values of avt, un, vn, wn153 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: avs_temp, rhop_temp !: hold current values of avt, un, vn, wn 157 154 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: sshn_temp, sshb_temp, ssha_temp, rnf_temp,h_rnf_temp 158 155 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: hdivn_temp, rotn_temp … … 165 162 #endif 166 163 ! 167 # if defined key_zdfddm168 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: avs_temp !: salinity vertical diffusivity coeff. at w-point [m/s]169 # endif170 164 ! 171 165 CHARACTER(len=20), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: cn_trc_dflt ! Default OBC condition for all tracers -
branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/TOP_SRC/trcini.F90
r7753 r7953 196 196 USE trcadv , ONLY: trc_adv_ini 197 197 USE trcldf , ONLY: trc_ldf_ini 198 USE trczdf , ONLY: trc_zdf_ini199 198 USE trcrad , ONLY: trc_rad_ini 200 199 ! … … 205 204 CALL trc_adv_ini ! advection 206 205 CALL trc_ldf_ini ! lateral diffusion 207 CALL trc_zdf_ini ! vertical diffusion206 ! ! vertical diffusion: always implicit time stepping scheme 208 207 CALL trc_rad_ini ! positivity of passive tracers 209 208 ! … … 223 222 !!---------------------------------------------------------------------- 224 223 ! 225 ! Initialisation of tracers Initial Conditions 226 IF( ln_trcdta ) CALL trc_dta_ini(jptra)227 228 ! Initialisation oftracers Boundary Conditions229 IF( ln_my_trc ) CALL trc_bc_ini(jptra) 230 231 IF( ln_rsttr ) THEN 224 225 IF( ln_trcdta ) CALL trc_dta_ini( jptra ) ! set initial tracers values 226 227 IF( ln_my_trc ) CALL trc_bc_ini ( jptra ) ! set tracers Boundary Conditions 228 229 230 IF( ln_rsttr ) THEN ! restart from a file 232 231 ! 233 CALL trc_rst_read ! restart from a file232 CALL trc_rst_read 234 233 ! 235 ELSE 236 ! Initialisation of tracer from a file that may also be used for damping 234 ELSE ! Initialisation of tracer from a file that may also be used for damping 235 !!gm BUG ? if damping and restart, what's happening ? 237 236 IF( ln_trcdta .AND. nb_trcdta > 0 ) THEN 238 237 ! update passive tracers arrays with input data read from file … … 250 249 ENDIF 251 250 ENDIF 252 END DO251 END DO 253 252 ! 254 253 ENDIF … … 262 261 END SUBROUTINE trc_ini_state 263 262 263 264 264 SUBROUTINE top_alloc 265 265 !!---------------------------------------------------------------------- -
branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/TOP_SRC/trcsub.F90
r7646 r7953 84 84 tsn_tm (:,:,:,jp_sal) = tsn_tm (:,:,:,jp_sal) + tsn (:,:,:,jp_sal) * e3t_n(:,:,:) 85 85 rhop_tm (:,:,:) = rhop_tm (:,:,:) + rhop (:,:,:) * e3t_n(:,:,:) 86 avt_tm (:,:,:) = avt_tm (:,:,:) + avt (:,:,:) * e3w_n(:,:,:)87 # if defined key_zdfddm88 86 avs_tm (:,:,:) = avs_tm (:,:,:) + avs (:,:,:) * e3w_n(:,:,:) 89 # endif90 87 IF( l_ldfslp ) THEN 91 88 uslp_tm (:,:,:) = uslp_tm (:,:,:) + uslp (:,:,:) … … 122 119 tsn_temp (:,:,:,:) = tsn (:,:,:,:) 123 120 rhop_temp (:,:,:) = rhop (:,:,:) 124 avt_temp (:,:,:) = avt (:,:,:)125 # if defined key_zdfddm126 121 avs_temp (:,:,:) = avs (:,:,:) 127 # endif128 122 IF( l_ldfslp ) THEN 129 123 uslp_temp (:,:,:) = uslp (:,:,:) ; wslpi_temp (:,:,:) = wslpi (:,:,:) … … 161 155 tsn_tm (:,:,:,jp_sal) = tsn_tm (:,:,:,jp_sal) + tsn (:,:,:,jp_sal) * e3t_n(:,:,:) 162 156 rhop_tm (:,:,:) = rhop_tm (:,:,:) + rhop (:,:,:) * e3t_n(:,:,:) 163 avt_tm (:,:,:) = avt_tm (:,:,:) + avt (:,:,:) * e3w_n(:,:,:)164 # if defined key_zdfddm165 157 avs_tm (:,:,:) = avs_tm (:,:,:) + avs (:,:,:) * e3w_n(:,:,:) 166 # endif167 158 IF( l_ldfslp ) THEN 168 159 uslp_tm (:,:,:) = uslp_tm (:,:,:) + uslp (:,:,:) … … 245 236 tsn (ji,jj,jk,jp_sal) = tsn_tm (ji,jj,jk,jp_sal) * z1_ne3t 246 237 rhop (ji,jj,jk) = rhop_tm (ji,jj,jk) * z1_ne3t 247 !!gm : BUG? ==>> for avt & avs I don't understand the division by e3w 248 avt (ji,jj,jk) = avt_tm (ji,jj,jk) * z1_ne3w 249 # if defined key_zdfddm 238 !!gm : BUG ==>> for avs I don't understand the division by e3w 250 239 avs (ji,jj,jk) = avs_tm (ji,jj,jk) * z1_ne3w 251 # endif252 240 END DO 253 241 END DO … … 297 285 rhop_tm (:,:,:) = rhop (:,:,:) * e3t_n(:,:,:) 298 286 !!gm : BUG? ==>> for avt & avs I don't understand the division by e3w 299 avt_tm (:,:,:) = avt (:,:,:) * e3w_n(:,:,:)300 # if defined key_zdfddm301 287 avs_tm (:,:,:) = avs (:,:,:) * e3w_n(:,:,:) 302 # endif303 288 IF( l_ldfslp ) THEN 304 289 wslpi_tm(:,:,:) = wslpi(:,:,:) … … 354 339 tsn (:,:,:,:) = tsn_temp (:,:,:,:) 355 340 rhop (:,:,:) = rhop_temp (:,:,:) 356 avt (:,:,:) = avt_temp (:,:,:)357 # if defined key_zdfddm358 341 avs (:,:,:) = avs_temp (:,:,:) 359 # endif360 342 IF( l_ldfslp ) THEN 361 343 wslpi (:,:,:)= wslpi_temp (:,:,:) … … 396 378 tsn_tm (:,:,:,jp_sal) = tsn (:,:,:,jp_sal) * e3t_n(:,:,:) 397 379 rhop_tm (:,:,:) = rhop (:,:,:) * e3t_n(:,:,:) 398 avt_tm (:,:,:) = avt (:,:,:) * e3w_n(:,:,:)399 # if defined key_zdfddm400 380 avs_tm (:,:,:) = avs (:,:,:) * e3w_n(:,:,:) 401 # endif402 381 IF( l_ldfslp ) THEN 403 382 uslp_tm (:,:,:) = uslp (:,:,:) … … 534 513 ! 535 514 ALLOCATE( un_temp(jpi,jpj,jpk) , vn_temp(jpi,jpj,jpk) , & 536 & wn_temp(jpi,jpj,jpk) , avt_temp(jpi,jpj,jpk) ,&515 & wn_temp(jpi,jpj,jpk) , & 537 516 & rhop_temp(jpi,jpj,jpk) , rhop_tm(jpi,jpj,jpk) , & 538 517 & sshn_temp(jpi,jpj) , sshb_temp(jpi,jpj) , & … … 548 527 & fr_i_temp(jpi,jpj) , fr_i_tm(jpi,jpj) , & 549 528 & wndm_temp(jpi,jpj) , wndm_tm(jpi,jpj) , & 550 # if defined key_zdfddm551 529 & avs_tm(jpi,jpj,jpk) , avs_temp(jpi,jpj,jpk) , & 552 # endif553 530 & hdivn_temp(jpi,jpj,jpk) , hdivb_temp(jpi,jpj,jpk), & 554 531 & un_tm(jpi,jpj,jpk) , vn_tm(jpi,jpj,jpk) , & 555 & avt_tm(jpi,jpj,jpk) , &556 532 & sshn_tm(jpi,jpj) , sshb_hold(jpi,jpj) , & 557 533 & tsn_tm(jpi,jpj,jpk,2) , &
Note: See TracChangeset
for help on using the changeset viewer.