Changeset 7277 for branches/2016/dev_CNRS_2016
- Timestamp:
- 2016-11-21T09:55:07+01:00 (7 years ago)
- Location:
- branches/2016/dev_CNRS_2016/NEMOGCM
- Files:
-
- 8 deleted
- 127 edited
- 6 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/2016/dev_CNRS_2016/NEMOGCM/CONFIG/AMM12/EXP00/namelist_cfg
r6140 r7277 20 20 &namcfg ! parameters of the configuration 21 21 !----------------------------------------------------------------------- 22 cp_cfg = "amm" ! name of the configuration 23 jp_cfg = 011 ! resolution of the configuration 24 jpidta = 198 ! 1st lateral dimension ( >= jpi ) 25 jpjdta = 224 ! 2nd " " ( >= jpj ) 26 jpkdta = 51 ! number of levels ( >= jpk ) 27 jpiglo = 198 ! 1st dimension of global domain --> i =jpidta 28 jpjglo = 224 ! 2nd - - --> j =jpjdta 29 jpizoom = 1 ! left bottom (i,j) indices of the zoom 30 jpjzoom = 1 ! in data domain indices 31 jperio = 0 ! lateral cond. type (between 0 and 6) 32 / 33 !----------------------------------------------------------------------- 34 &namzgr ! vertical coordinate 35 !----------------------------------------------------------------------- 36 ln_sco = .true. ! s- or hybrid z-s-coordinate 37 / 38 !----------------------------------------------------------------------- 39 &namzgr_sco ! s-coordinate or hybrid z-s-coordinate 40 !----------------------------------------------------------------------- 41 ln_s_sh94 = .false. ! Song & Haidvogel 1994 hybrid S-sigma (T)| 42 ln_s_sf12 = .true. ! Siddorn & Furner 2012 hybrid S-z-sigma (T)| if both are false the NEMO tanh stretching is applied 43 ln_sigcrit = .true. ! use sigma coordinates below critical depth (T) or Z coordinates (F) for Siddorn & Furner stretch 44 ! stretching coefficients for all functions 45 rn_hc = 50.0 ! critical depth for transition to stretched coordinates 46 / 22 ln_read_cfg = .true. ! (=T) read the domain configuration file 23 ! ! (=F) user defined configuration ==>>> see usrdef(_...) modules 24 cn_domcfg = "AMM_R12_sco_domcfg" ! domain configuration filename 25 / 26 47 27 !----------------------------------------------------------------------- 48 28 &namdom ! space and time domain (bathymetry, mesh, timestep) 49 29 !----------------------------------------------------------------------- 50 30 rn_rdt = 600. ! time step for the dynamics (and tracer if nn_acc=0) 51 ppglam0 = 999999.0 ! longitude of first raw and column T-point (jphgr_msh = 1)52 ppgphi0 = 999999.0 ! latitude of first raw and column T-point (jphgr_msh = 1)53 ppe1_deg = 999999.0 ! zonal grid-spacing (degrees)54 ppe2_deg = 999999.0 ! meridional grid-spacing (degrees)55 ppe1_m = 999999.0 ! zonal grid-spacing (degrees)56 ppe2_m = 999999.0 ! meridional grid-spacing (degrees)57 ppsur = 999999.0 ! ORCA r4, r2 and r05 coefficients58 ppa0 = 999999.0 ! (default coefficients)59 ppa1 = 999999.0 !60 ppkth = 23.563 !61 ppacr = 9.0 !62 ppdzmin = 6.0 ! Minimum vertical spacing63 pphmax = 5720. ! Maximum depth64 ldbletanh = .FALSE. ! Use/do not use double tanf function for vertical coordinates65 ppa2 = 999999. ! Double tanh function parameters66 ppkth2 = 999999. !67 ppacr2 = 999999.68 31 / 69 32 !----------------------------------------------------------------------- 70 33 &namcrs ! Grid coarsening for dynamics output and/or 71 34 ! ! passive tracer coarsened online simulations 72 35 !----------------------------------------------------------------------- 73 36 / … … 83 46 nn_fsbc = 1 ! frequency of surface boundary condition computation 84 47 ! (also = the frequency of sea-ice model call) 85 ln_flx = .true. ! flux formulation (T => fill namsbc_flx )48 ln_flx = .true. ! flux formulation (T => fill namsbc_flx ) 86 49 ln_blk_core = .false. ! CORE bulk formulation (T => fill namsbc_core) 87 50 nn_ice = 0 ! =0 no ice boundary condition , … … 91 54 ln_traqsr = .false. ! Light penetration (T) or not (F) 92 55 93 /94 !-----------------------------------------------------------------------95 &namsbc_ana ! analytical surface boundary condition96 !-----------------------------------------------------------------------97 56 / 98 57 !----------------------------------------------------------------------- -
branches/2016/dev_CNRS_2016/NEMOGCM/CONFIG/AMM12/cpp_AMM12.fcm
r6140 r7277 1 bld::tool::fppkeys key_bdy key_tide key_zdfgls key_diainstant key_mpp_mpi key_iomput 1 bld::tool::fppkeys key_bdy key_tide key_zdfgls key_diainstant key_mpp_mpi key_iomput key_mpp_rep -
branches/2016/dev_CNRS_2016/NEMOGCM/CONFIG/C1D_PAPA/EXP00/namelist_cfg
r6140 r7277 18 18 cp_cfg = "papa" ! name of the configuration 19 19 jp_cfg = 1 ! resolution of the configuration 20 jpidta = 3 ! 1st lateral dimension ( >= jpi ) = 30*jp_cfg+2 21 jpjdta = 3 ! 2nd " " ( >= jpj ) = 20*jp_cfg+2 22 jpkdta = 75 ! number of levels ( >= jpk ) 23 jpiglo = 3 ! 1st dimension of global domain --> i = jpidta 24 jpjglo = 3 ! 2nd - - --> j = jpjdta 25 jpizoom = 1 ! left bottom (i,j) indices of the zoom 26 jpjzoom = 1 ! in data domain indices 20 ! jpidta = 3 ! 1st lateral dimension ( >= jpi ) = 30*jp_cfg+2 21 ! jpjdta = 3 ! 2nd " " ( >= jpj ) = 20*jp_cfg+2 22 ! jpkdta = 75 ! number of levels ( >= jpk ) 23 ! jpiglo = 3 ! 1st dimension of global domain --> i = jpidta 24 ! jpjglo = 3 ! 2nd - - --> j = jpjdta 27 25 jperio = 0 ! lateral cond. type (between 0 and 6) 28 26 / … … 43 41 nn_msh = 0 ! create (=1) a mesh file or not (=0) 44 42 rn_rdt = 360. ! time step for the dynamics 45 jphgr_msh = 1 ! type of horizontal mesh46 43 ppglam0 = -150.0 ! longitude of first raw and column T-point (jphgr_msh = 1) 47 44 ppgphi0 = 50.0 ! latitude of first raw and column T-point (jphgr_msh = 1) … … 95 92 / 96 93 !----------------------------------------------------------------------- 97 &namsbc_ana ! analytical surface boundary condition98 !-----------------------------------------------------------------------99 /100 !-----------------------------------------------------------------------101 94 &namsbc_flx ! surface boundary condition : flux formulation 102 95 !----------------------------------------------------------------------- -
branches/2016/dev_CNRS_2016/NEMOGCM/CONFIG/GYRE/EXP00/namelist_cfg
r6140 r7277 3 3 !!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 4 4 !----------------------------------------------------------------------- 5 &namusr_def ! GYRE user defined namelist 6 !----------------------------------------------------------------------- 7 nn_GYRE = 1 ! GYRE resolution [1/degrees] 8 ln_bench = .false. ! ! =T benchmark with gyre: the gridsize is kept constant 9 jpkglo = 31 ! number of model levels 10 / 11 12 !----------------------------------------------------------------------- 5 13 &namrun ! parameters of the run 6 14 !----------------------------------------------------------------------- 7 15 cn_exp = "GYRE" ! experience name 8 16 nn_it000 = 1 ! first time step 9 nn_itend = 4320 ! last time step17 nn_itend = 4320 !!gm 4320 ! last time step 10 18 nn_leapy = 30 ! Leap year calendar (1) or not (0) 11 19 nn_stock = 4320 ! frequency of creation of a restart file (modulo referenced to 1) … … 13 21 14 22 ln_clobber = .true. ! clobber (overwrite) an existing file 15 16 23 / 17 24 !----------------------------------------------------------------------- 18 25 &namcfg ! parameters of the configuration 19 26 !----------------------------------------------------------------------- 20 cp_cfg = "gyre" ! name of the configuration 21 jp_cfg = 1 ! resolution of the configuration 22 jpidta = 32 ! 1st lateral dimension ( >= jpi ) = 30*jp_cfg+2 23 jpjdta = 22 ! 2nd " " ( >= jpj ) = 20*jp_cfg+2 24 jpkdta = 31 ! number of levels ( >= jpk ) 25 jpiglo = 32 ! 1st dimension of global domain --> i = jpidta 26 jpjglo = 22 ! 2nd - - --> j = jpjdta 27 jpizoom = 1 ! left bottom (i,j) indices of the zoom 28 jpjzoom = 1 ! in data domain indices 29 jperio = 0 ! lateral cond. type (between 0 and 6) 30 / 31 !----------------------------------------------------------------------- 32 &namzgr ! vertical coordinate 33 !----------------------------------------------------------------------- 34 ln_zco = .true. ! z-coordinate - full steps 35 ln_linssh = .true. ! linear free surface 36 / 37 !----------------------------------------------------------------------- 38 &namzgr_sco ! s-coordinate or hybrid z-s-coordinate 39 !----------------------------------------------------------------------- 27 ln_read_cfg = .false. ! (=T) read the domain configuration file 28 ! ! (=F) user defined configuration ==>>> see usrdef(_...) modules 29 ln_write_cfg= .false. ! (=T) create the domain configuration file 30 ! 40 31 / 41 32 !----------------------------------------------------------------------- 42 33 &namdom ! space and time domain (bathymetry, mesh, timestep) 43 34 !----------------------------------------------------------------------- 44 nn_bathy = 0 ! compute (=0) or read (=1) the bathymetry file 45 rn_rdt = 7200. ! time step for the dynamics 46 jphgr_msh = 5 ! type of horizontal mesh 47 ppglam0 = 0.0 ! longitude of first raw and column T-point (jphgr_msh = 1) 48 ppgphi0 = 29.0 ! latitude of first raw and column T-point (jphgr_msh = 1) 49 ppe1_deg = 999999.0 ! zonal grid-spacing (degrees) 50 ppe2_deg = 999999.0 ! meridional grid-spacing (degrees) 51 ppe1_m = 999999.0 ! zonal grid-spacing (degrees) 52 ppe2_m = 999999.0 ! meridional grid-spacing (degrees) 53 ppsur = -2033.194295283385 ! ORCA r4, r2 and r05 coefficients 54 ppa0 = 155.8325369664153 ! (default coefficients) 55 ppa1 = 146.3615918601890 ! 56 ppkth = 17.28520372419791 ! 57 ppacr = 5.0 ! 58 ppdzmin = 999999.0 ! Minimum vertical spacing 59 pphmax = 999999.0 ! Maximum depth 60 ldbletanh = .FALSE. ! Use/do not use double tanf function for vertical coordinates 61 ppa2 = 999999.0 ! Double tanh function parameters 62 ppkth2 = 999999.0 ! 63 ppacr2 = 999999.0 ! 35 ln_linssh = .true. ! =T linear free surface ==>> model level are fixed in time 36 ! 37 nn_msh = 0 ! create (>0) a mesh file or not (=0) 38 ! 39 rn_rdt = 7200. ! time step for the dynamics (and tracer if nn_acc=0) 64 40 / 65 41 !----------------------------------------------------------------------- 66 42 &namcrs ! Grid coarsening for dynamics output and/or 67 43 ! ! passive tracer coarsened online simulations 68 44 !----------------------------------------------------------------------- 69 45 / … … 80 56 nn_fsbc = 1 ! frequency of surface boundary condition computation 81 57 ! ! (also = the frequency of sea-ice model call) 82 ln_ana = .true. ! analytical formulation (T => fill namsbc_ana ) 83 ln_blk_core = .false. ! CORE bulk formulation (T => fill namsbc_core) 58 ln_usr = .true. ! user defined formulation (T => check usrdef_sbc) 84 59 nn_ice = 0 ! =0 no ice boundary condition , 85 60 ln_rnf = .false. ! runoffs (T => fill namsbc_rnf) -
branches/2016/dev_CNRS_2016/NEMOGCM/CONFIG/GYRE/cpp_GYRE.fcm
r5930 r7277 1 bld::tool::fppkeys key_zdftke key_iomput key_mpp_mpi 1 bld::tool::fppkeys key_zdftke key_iomput key_mpp_mpi key_nosignedzero key_mpp_rep -
branches/2016/dev_CNRS_2016/NEMOGCM/CONFIG/GYRE_BFM/EXP00/namelist_cfg
r6140 r7277 22 22 &namcfg ! parameters of the configuration 23 23 !----------------------------------------------------------------------- 24 cp_cfg = "gyre" ! name of the configuration 25 jp_cfg = 1 ! resolution of the configuration 26 jpidta = 32 ! 1st lateral dimension ( >= jpi ) = 30*jp_cfg+2 27 jpjdta = 22 ! 2nd " " ( >= jpj ) = 20*jp_cfg+2 28 jpkdta = 31 ! number of levels ( >= jpk ) 29 jpiglo = 32 ! 1st dimension of global domain --> i = jpidta 30 jpjglo = 22 ! 2nd - - --> j = jpjdta 31 jpizoom = 1 ! left bottom (i,j) indices of the zoom 32 jpjzoom = 1 ! in data domain indices 33 jperio = 0 ! lateral cond. type (between 0 and 6) 34 / 35 &namzgr ! vertical coordinate 36 !----------------------------------------------------------------------- 37 ln_zco = .true. ! z-coordinate - full steps 38 ln_linssh = .true. ! linear free surface 39 / 40 !----------------------------------------------------------------------- 41 &namzgr_sco ! s-coordinate or hybrid z-s-coordinate 42 !----------------------------------------------------------------------- 24 ln_read_cfg = .false. ! (=T) read the domain configuration file 25 ! ! (=F) user defined configuration ==>>> see usrdef(_...) modules 26 ln_write_cfg= .false. ! (=T) create the domain configuration file 43 27 / 44 28 !----------------------------------------------------------------------- 45 29 &namdom ! space and time domain (bathymetry, mesh, timestep) 46 30 !----------------------------------------------------------------------- 47 nn_bathy = 0 ! compute (=0) or read (=1) the bathymetry file 48 rn_rdt = 7200. ! time step for the dynamics 49 jphgr_msh = 5 ! type of horizontal mesh 50 ppglam0 = 0.0 ! longitude of first raw and column T-point (jphgr_msh = 1) 51 ppgphi0 = 29.0 ! latitude of first raw and column T-point (jphgr_msh = 1) 52 ppe1_deg = 999999.0 ! zonal grid-spacing (degrees) 53 ppe2_deg = 999999.0 ! meridional grid-spacing (degrees) 54 ppe1_m = 999999.0 ! zonal grid-spacing (degrees) 55 ppe2_m = 999999.0 ! meridional grid-spacing (degrees) 56 ppsur = -2033.194295283385 ! ORCA r4, r2 and r05 coefficients 57 ppa0 = 155.8325369664153 ! (default coefficients) 58 ppa1 = 146.3615918601890 ! 59 ppkth = 17.28520372419791 ! 60 ppacr = 5.0 ! 61 ppdzmin = 999999.0 ! Minimum vertical spacing 62 pphmax = 999999.0 ! Maximum depth 63 ldbletanh = .FALSE. ! Use/do not use double tanf function for vertical coordinates 64 ppa2 = 999999.0 ! Double tanh function parameters 65 ppkth2 = 999999.0 ! 66 ppacr2 = 999999.0 ! 31 ln_linssh = .true. ! =T linear free surface ==>> model level are fixed in time 32 ! 33 nn_msh = 0 ! create (>0) a mesh file or not (=0) 34 ! 35 rn_rdt = 7200. ! time step for the dynamics (and tracer if nn_acc=0) 67 36 / 68 37 !----------------------------------------------------------------------- … … 85 54 nn_fsbc = 1 ! frequency of surface boundary condition computation 86 55 ! (also = the frequency of sea-ice model call) 87 ln_ana = .true. ! analytical formulation (T => fill namsbc_ana ) 88 ln_blk_core = .false. ! CORE bulk formulation (T => fill namsbc_core) 56 ln_usr = .true. ! user defined formulation (T => check usrdef_sbc) 89 57 nn_ice = 0 ! =0 no ice boundary condition , 90 58 ln_rnf = .false. ! runoffs (T => fill namsbc_rnf) 91 59 ln_ssr = .false. ! Sea Surface Restoring on T and/or S (T => fill namsbc_ssr) 92 60 nn_fwb = 0 ! FreshWater Budget: =0 unchecked 93 /94 !-----------------------------------------------------------------------95 &namsbc_ana ! analytical surface boundary condition96 !-----------------------------------------------------------------------97 nn_tau000 = 100 ! gently increase the stress over the first ntau_rst time-steps98 rn_utau0 = 0.1e0 ! uniform value for the i-stress99 61 / 100 62 !----------------------------------------------------------------------- -
branches/2016/dev_CNRS_2016/NEMOGCM/CONFIG/GYRE_BFM/cpp_GYRE_BFM.fcm
r5930 r7277 1 bld::tool::fppkeys key_zdftke key_top key_my_trc key_mpp_mpi key_iomput 1 bld::tool::fppkeys key_zdftke key_top key_my_trc key_mpp_mpi key_iomput key_mpp_rep 2 2 inc $BFMDIR/src/nemo/bfm.fcm -
branches/2016/dev_CNRS_2016/NEMOGCM/CONFIG/GYRE_PISCES/EXP00/namelist_cfg
r6140 r7277 15 15 &namcfg ! parameters of the configuration 16 16 !----------------------------------------------------------------------- 17 cp_cfg = "gyre" ! name of the configuration 18 jp_cfg = 1 ! resolution of the configuration 19 jpidta = 32 ! 1st lateral dimension ( >= jpi ) = 30*jp_cfg+2 20 jpjdta = 22 ! 2nd " " ( >= jpj ) = 20*jp_cfg+2 21 jpkdta = 31 ! number of levels ( >= jpk ) 22 jpiglo = 32 ! 1st dimension of global domain --> i = jpidta 23 jpjglo = 22 ! 2nd - - --> j = jpjdta 24 jpizoom = 1 ! left bottom (i,j) indices of the zoom 25 jpjzoom = 1 ! in data domain indices 26 jperio = 0 ! lateral cond. type (between 0 and 6) 27 / 28 !----------------------------------------------------------------------- 29 &namzgr ! vertical coordinate 30 !----------------------------------------------------------------------- 31 ln_zco = .true. ! z-coordinate - full steps 32 ln_linssh = .true. ! linear free surface 17 ln_read_cfg = .false. ! (=T) read the domain configuration file 18 ! ! (=F) user defined configuration ==>>> see usrdef(_...) modules 19 ln_write_cfg= .false. ! (=T) create the domain configuration file 33 20 / 34 21 !----------------------------------------------------------------------- 35 22 &namdom ! space and time domain (bathymetry, mesh, timestep) 36 23 !----------------------------------------------------------------------- 37 nn_bathy = 0 ! compute (=0) or read (=1) the bathymetry file 38 rn_rdt = 7200. ! time step for the dynamics 39 jphgr_msh = 5 ! type of horizontal mesh 40 ppglam0 = 0.0 ! longitude of first raw and column T-point (jphgr_msh = 1) 41 ppgphi0 = 29.0 ! latitude of first raw and column T-point (jphgr_msh = 1) 42 ppe1_deg = 999999.0 ! zonal grid-spacing (degrees) 43 ppe2_deg = 999999.0 ! meridional grid-spacing (degrees) 44 ppe1_m = 999999.0 ! zonal grid-spacing (degrees) 45 ppe2_m = 999999.0 ! meridional grid-spacing (degrees) 46 ppsur = -2033.194295283385 ! ORCA r4, r2 and r05 coefficients 47 ppa0 = 155.8325369664153 ! (default coefficients) 48 ppa1 = 146.3615918601890 ! 49 ppkth = 17.28520372419791 ! 50 ppacr = 5.0 ! 51 ppdzmin = 999999.0 ! Minimum vertical spacing 52 pphmax = 999999.0 ! Maximum depth 53 ldbletanh = .FALSE. ! Use/do not use double tanf function for vertical coordinates 54 ppa2 = 999999.0 ! Double tanh function parameters 55 ppkth2 = 999999.0 ! 56 ppacr2 = 999999.0 ! 24 ln_linssh = .true. ! =T linear free surface ==>> model level are fixed in time 25 ! 26 nn_msh = 0 ! create (>0) a mesh file or not (=0) 27 ! 28 rn_rdt = 7200. ! time step for the dynamics (and tracer if nn_acc=0) 57 29 / 58 30 !----------------------------------------------------------------------- … … 73 45 nn_fsbc = 1 ! frequency of surface boundary condition computation 74 46 ! (also = the frequency of sea-ice model call) 75 ln_ana = .true. ! analytical formulation (T => fill namsbc_ana ) 76 ln_blk_core = .false. ! CORE bulk formulation (T => fill namsbc_core) 47 ln_usr = .true. ! user defined formulation (T => check usrdef_sbc) 77 48 nn_ice = 0 ! =0 no ice boundary condition , 78 49 ln_rnf = .false. ! runoffs (T => fill namsbc_rnf) -
branches/2016/dev_CNRS_2016/NEMOGCM/CONFIG/GYRE_XIOS/EXP00/namelist_cfg
r6140 r7277 15 15 &namcfg ! parameters of the configuration 16 16 !----------------------------------------------------------------------- 17 cp_cfg = "gyre" ! name of the configuration 18 jp_cfg = 1 ! resolution of the configuration 19 jpidta = 32 ! 1st lateral dimension ( >= jpi ) = 30*jp_cfg+2 20 jpjdta = 22 ! 2nd " " ( >= jpj ) = 20*jp_cfg+2 21 jpkdta = 31 ! number of levels ( >= jpk ) 22 jpiglo = 32 ! 1st dimension of global domain --> i = jpidta 23 jpjglo = 22 ! 2nd - - --> j = jpjdta 24 jpizoom = 1 ! left bottom (i,j) indices of the zoom 25 jpjzoom = 1 ! in data domain indices 26 jperio = 0 ! lateral cond. type (between 0 and 6) 27 / 28 !----------------------------------------------------------------------- 29 &namzgr ! vertical coordinate 30 !----------------------------------------------------------------------- 31 ln_zco = .true. ! z-coordinate - full steps 32 ln_linssh = .true. ! linear free surface 33 / 34 !----------------------------------------------------------------------- 35 &namzgr_sco ! s-coordinate or hybrid z-s-coordinate 36 !----------------------------------------------------------------------- 17 ln_read_cfg = .false. ! (=T) read the domain configuration file 18 ! ! (=F) user defined configuration ==>>> see usrdef(_...) modules 19 ln_write_cfg= .false. ! (=T) create the domain configuration file 37 20 / 38 21 !----------------------------------------------------------------------- 39 22 &namdom ! space and time domain (bathymetry, mesh, timestep) 40 23 !----------------------------------------------------------------------- 41 nn_bathy = 0 ! compute (=0) or read (=1) the bathymetry file 42 rn_rdt = 7200. ! time step for the dynamics 43 ! nn_baro = 60 ! number of barotropic time step ("key_dynspg_ts") 44 jphgr_msh = 5 ! type of horizontal mesh 45 ppglam0 = 0.0 ! longitude of first raw and column T-point (jphgr_msh = 1) 46 ppgphi0 = 29.0 ! latitude of first raw and column T-point (jphgr_msh = 1) 47 ppe1_deg = 999999.0 ! zonal grid-spacing (degrees) 48 ppe2_deg = 999999.0 ! meridional grid-spacing (degrees) 49 ppe1_m = 999999.0 ! zonal grid-spacing (degrees) 50 ppe2_m = 999999.0 ! meridional grid-spacing (degrees) 51 ppsur = -2033.194295283385 ! ORCA r4, r2 and r05 coefficients 52 ppa0 = 155.8325369664153 ! (default coefficients) 53 ppa1 = 146.3615918601890 ! 54 ppkth = 17.28520372419791 ! 55 ppacr = 5.0 ! 56 ppdzmin = 999999.0 ! Minimum vertical spacing 57 pphmax = 999999.0 ! Maximum depth 58 ldbletanh = .FALSE. ! Use/do not use double tanf function for vertical coordinates 59 ppa2 = 999999.0 ! Double tanh function parameters 60 ppkth2 = 999999.0 ! 61 ppacr2 = 999999.0 ! 24 ln_linssh = .true. ! =T linear free surface ==>> model level are fixed in time 25 ! 26 nn_msh = 0 ! create (>0) a mesh file or not (=0) 27 ! 28 rn_rdt = 7200. ! time step for the dynamics (and tracer if nn_acc=0) 62 29 / 63 30 !----------------------------------------------------------------------- … … 69 36 &namtsd ! data : Temperature & Salinity 70 37 !----------------------------------------------------------------------- 71 cn_dir = './' 72 ln_tsd_init = .false. 73 ln_tsd_tradmp = .false. 38 cn_dir = './' ! root directory for the location of the runoff files 39 ln_tsd_init = .false. ! Initialisation of ocean T & S with T &S input data (T) or not (F) 40 ln_tsd_tradmp = .false. ! damping of ocean T & S toward T &S input data (T) or not (F) 74 41 / 75 42 !----------------------------------------------------------------------- … … 78 45 nn_fsbc = 1 ! frequency of surface boundary condition computation 79 46 ! (also = the frequency of sea-ice model call) 80 ln_ana = .true. ! analytical formulation (T => fill namsbc_ana ) 81 ln_blk_core = .false. ! CORE bulk formulation (T => fill namsbc_core) 47 ln_usr = .true. ! user defined formulation (T => check usrdef_sbc) 82 48 nn_ice = 0 ! =0 no ice boundary condition , 83 49 ln_rnf = .false. ! runoffs (T => fill namsbc_rnf) -
branches/2016/dev_CNRS_2016/NEMOGCM/CONFIG/ORCA2_LIM/EXP00/1_namelist_cfg
r6140 r7277 4 4 !----------------------------------------------------------------------- 5 5 &namrun ! parameters of the run 6 nn_it000=17 6 !----------------------------------------------------------------------- 8 7 cn_exp = "Agulhas" ! experience name 9 nn_itend = 10950 8 nn_it000 = 1 ! first time step 9 nn_itend = 10950 ! last time step 10 10 nn_stock = 10950 ! frequency of creation of a restart file (modulo referenced to 1) 11 11 nn_write = 10950 ! frequency of write in the output file (modulo referenced to nn_it000) 12 ln_clobber = .true.12 ln_clobber = .true. ! clobber (overwrite) an existing file 13 13 / 14 14 !----------------------------------------------------------------------- 15 15 &namcfg ! parameters of the configuration 16 16 !----------------------------------------------------------------------- 17 cp_cfg = "default" ! name of the configuration 18 jp_cfg = -1 ! resolution of the configuration 19 jpidta = 182 ! 1st lateral dimension ( >= jpi ) 20 jpjdta = 149 ! 2nd " " ( >= jpj ) 21 jpkdta = 31 ! number of levels ( >= jpk ) 22 jpiglo = 182 ! 1st dimension of global domain --> i =jpidta 23 jpjglo = 149 ! 2nd - - --> j =jpjdta 24 jpizoom = 1 ! left bottom (i,j) indices of the zoom 25 jpjzoom = 1 ! in data domain indices 26 jperio = 0 ! lateral cond. type (between 0 and 6) 17 ln_read_cfg = .true. ! (=T) read the domain configuration file 18 ! ! (=F) user defined configuration ==>>> see usrdef(_...) modules 19 cn_domcfg = "AGRIF_AGULHAS_domain_cfg" ! domain configuration filename 27 20 / 28 21 !----------------------------------------------------------------------- … … 30 23 !----------------------------------------------------------------------- 31 24 ln_zps = .true. ! z-coordinate - partial steps 32 ln_linssh = .true. ! linear free surface33 25 / 34 26 !----------------------------------------------------------------------- 35 27 &namdom ! space and time domain (bathymetry, mesh, timestep) 36 28 !----------------------------------------------------------------------- 37 jphgr_msh = 0 ! type of horizontal mesh 38 ppglam0 = 999999.0 ! longitude of first raw and column T-point (jphgr_msh = 1) 39 ppgphi0 = 999999.0 ! latitude of first raw and column T-point (jphgr_msh = 1) 40 ppe1_deg = 999999.0 ! zonal grid-spacing (degrees) 41 ppe2_deg = 999999.0 ! meridional grid-spacing (degrees) 42 ppe1_m = 999999.0 ! zonal grid-spacing (degrees) 43 ppe2_m = 999999.0 ! meridional grid-spacing (degrees) 44 ppsur = -4762.96143546300 ! ORCA r4, r2 and r05 coefficients 45 ppa0 = 255.58049070440 ! (default coefficients) 46 ppa1 = 245.58132232490 ! 47 ppkth = 21.43336197938 ! 48 ppacr = 3.0 ! 49 ppdzmin = 999999. ! Minimum vertical spacing 50 pphmax = 999999. ! Maximum depth 51 ldbletanh = .FALSE. ! Use/do not use double tanf function for vertical coordinates 52 ppa2 = 999999. ! Double tanh function parameters 53 ppkth2 = 999999. ! 54 ppacr2 = 999999. ! 29 ln_linssh = .true. ! =T linear free surface ==>> model level are fixed in time 30 nn_closea = 0 ! remove (=0) or keep (=1) closed seas and lakes (ORCA) 31 ! 55 32 rn_rdt = 2880. ! time step for the dynamics (and tracer if nn_acc=0) 56 33 / … … 67 44 &namsbc ! Surface Boundary Condition (surface module) 68 45 !----------------------------------------------------------------------- 46 ln_blk_core = .true. ! CORE bulk formulation (T => fill namsbc_core) 69 47 nn_ice = 0 ! =0 no ice boundary condition , 70 48 ! =1 use observed ice-cover , … … 194 172 ln_dynvor_mix = .false. ! mixed scheme 195 173 ln_dynvor_een = .true. ! energy & enstrophy scheme 196 nn_een_e3f = 1! e3f = masked averaging of e3t divided by 4 (=0) or by the sum of mask (=1)174 nn_een_e3f = 0 ! e3f = masked averaging of e3t divided by 4 (=0) or by the sum of mask (=1) 197 175 / 198 176 !----------------------------------------------------------------------- -
branches/2016/dev_CNRS_2016/NEMOGCM/CONFIG/ORCA2_LIM/EXP00/namelist_cfg
r6140 r7277 9 9 cn_exp = "ORCA2" ! experience name 10 10 nn_it000 = 1 ! first time step 11 nn_itend = 300 ! last time step (std 5475) 12 / 13 !----------------------------------------------------------------------- 14 &namcfg ! parameters of the configuration 15 !----------------------------------------------------------------------- 16 cp_cfg = "orca" ! name of the configuration 17 jp_cfg = 2 ! resolution of the configuration 18 jpidta = 182 ! 1st lateral dimension ( >= jpi ) 19 jpjdta = 149 ! 2nd " " ( >= jpj ) 20 jpkdta = 31 ! number of levels ( >= jpk ) 21 jpiglo = 182 ! 1st dimension of global domain --> i =jpidta 22 jpjglo = 149 ! 2nd - - --> j =jpjdta 23 jpizoom = 1 ! left bottom (i,j) indices of the zoom 24 jpjzoom = 1 ! in data domain indices 25 jperio = 4 ! lateral cond. type (between 0 and 6) 11 nn_itend = 5475 ! last time step (std 5475) 12 / 13 !----------------------------------------------------------------------- 14 &namcfg ! parameters of the configuration 15 !----------------------------------------------------------------------- 16 ln_read_cfg = .true. ! (=T) read the domain configuration file 17 ! ! (=F) user defined configuration ==>>> see usrdef(_...) modules 18 cn_domcfg = "ORCA_R2_zps_domcfg" ! domain configuration filename 26 19 / 27 20 !----------------------------------------------------------------------- … … 29 22 !----------------------------------------------------------------------- 30 23 ln_zps = .true. ! z-coordinate - partial steps 31 ln_linssh = .true. ! linear free surface32 24 / 33 25 !----------------------------------------------------------------------- 34 26 &namdom ! space and time domain (bathymetry, mesh, timestep) 35 27 !----------------------------------------------------------------------- 36 jphgr_msh = 0 ! type of horizontal mesh 37 ppglam0 = 999999.0 ! longitude of first raw and column T-point (jphgr_msh = 1) 38 ppgphi0 = 999999.0 ! latitude of first raw and column T-point (jphgr_msh = 1) 39 ppe1_deg = 999999.0 ! zonal grid-spacing (degrees) 40 ppe2_deg = 999999.0 ! meridional grid-spacing (degrees) 41 ppe1_m = 999999.0 ! zonal grid-spacing (degrees) 42 ppe2_m = 999999.0 ! meridional grid-spacing (degrees) 43 ppsur = -4762.96143546300 ! ORCA r4, r2 and r05 coefficients 44 ppa0 = 255.58049070440 ! (default coefficients) 45 ppa1 = 245.58132232490 ! 46 ppkth = 21.43336197938 ! 47 ppacr = 3.0 ! 48 ppdzmin = 999999. ! Minimum vertical spacing 49 pphmax = 999999. ! Maximum depth 50 ldbletanh = .FALSE. ! Use/do not use double tanf function for vertical coordinates 51 ppa2 = 999999. ! Double tanh function parameters 52 ppkth2 = 999999. ! 53 ppacr2 = 999999. ! 28 ln_linssh = .false. ! =T linear free surface ==>> model level are fixed in time 29 ! 30 nn_msh = 0 ! create (>0) a mesh file or not (=0) 31 ! 54 32 / 55 33 !----------------------------------------------------------------------- … … 65 43 &namsbc ! Surface Boundary Condition (surface module) 66 44 !----------------------------------------------------------------------- 45 ln_blk_core = .true. ! CORE bulk formulation (T => fill namsbc_core) 67 46 / 68 47 !----------------------------------------------------------------------- … … 133 112 ln_traldf_lev = .false. ! iso-level 134 113 ln_traldf_hor = .false. ! horizontal (geopotential) 135 ln_traldf_iso = .true. ! iso-neutral ( standard operator)136 ln_traldf_triad = .false. ! iso-neutral ( triadoperator)114 ln_traldf_iso = .true. ! iso-neutral (Standard operator) 115 ln_traldf_triad = .false. ! iso-neutral (Triads operator) 137 116 ! 138 117 ! ! iso-neutral options: … … 146 125 nn_aht_ijk_t = 20 ! space/time variation of eddy coef 147 126 ! ! =-20 (=-30) read in eddy_diffusivity_2D.nc (..._3D.nc) file 148 ! ! = 0 constant 149 ! ! = 10 F(k) =ldf_c1d 150 ! ! = 20 F(i,j) =ldf_c2d 127 ! ! = 0 constant 128 ! ! = 10 F(k) =ldf_c1d 129 ! ! = 20 F(i,j) =ldf_c2d 151 130 ! ! = 21 F(i,j,t) =Treguier et al. JPO 1997 formulation 152 131 ! ! = 30 F(i,j,k) =ldf_c2d + ldf_c1d … … 163 142 nn_aei_ijk_t = 21 ! space/time variation of the eiv coeficient 164 143 ! ! =-20 (=-30) read in eddy_induced_velocity_2D.nc (..._3D.nc) file 165 ! ! = 0 constant 166 ! ! = 10 F(k) =ldf_c1d 167 ! ! = 20 F(i,j) =ldf_c2d 144 ! ! = 0 constant 145 ! ! = 10 F(k) =ldf_c1d 146 ! ! = 20 F(i,j) =ldf_c2d 168 147 ! ! = 21 F(i,j,t) =Treguier et al. JPO 1997 formulation 169 148 ! ! = 30 F(i,j,k) =ldf_c2d + ldf_c1d 170 149 / 171 150 !----------------------------------------------------------------------- 172 &namtra_dmp ! tracer: T & S newtonian damping 173 !----------------------------------------------------------------------- 174 / 151 &namtra_dmp ! tracer: T & S newtonian damping (default: NO) 152 !----------------------------------------------------------------------- 175 153 !----------------------------------------------------------------------- 176 154 &namdyn_adv ! formulation of the momentum advection … … 189 167 &namdyn_hpg ! Hydrostatic pressure gradient option 190 168 !----------------------------------------------------------------------- 191 / 192 !----------------------------------------------------------------------- 193 &namdyn_spg ! Surface pressure gradient 194 !----------------------------------------------------------------------- 195 ln_dynspg_ts = .true. ! Split-explicit free surface 169 ln_hpg_sco = .true. ! s-coordinate (standard jacobian formulation) 170 / 171 !----------------------------------------------------------------------- 172 &namdyn_spg ! surface pressure gradient 173 !----------------------------------------------------------------------- 174 ln_dynspg_ts = .true. ! split-explicit free surface 196 175 / 197 176 !----------------------------------------------------------------------- … … 218 197 rn_ahm_b = 0. ! background eddy viscosity for ldf_iso [m2/s] 219 198 rn_bhm_0 = 1.e+12 ! horizontal bilaplacian eddy viscosity [m4/s] 199 ! 200 ! Caution in 20 and 30 cases the coefficient have to be given for a 1 degree grid (~111km) 220 201 / 221 202 !----------------------------------------------------------------------- … … 248 229 / 249 230 !----------------------------------------------------------------------- 250 &namhsb ! Heat and salt budgets 251 !----------------------------------------------------------------------- 252 / 253 !----------------------------------------------------------------------- 254 &namobs ! observation usage 231 &namhsb ! Heat and salt budgets (default F) 232 !----------------------------------------------------------------------- 233 / 234 !----------------------------------------------------------------------- 235 &namobs ! observation usage ('key_diaobs') 255 236 !----------------------------------------------------------------------- 256 237 / -
branches/2016/dev_CNRS_2016/NEMOGCM/CONFIG/ORCA2_LIM3/EXP00/1_namelist_cfg
r6140 r7277 6 6 !----------------------------------------------------------------------- 7 7 cn_exp = "Agulhas" ! experience name 8 nn_itend = 480 ! last time step 8 nn_it000 = 1 ! first time step 9 nn_itend = 10950 ! last time step 9 10 nn_stock = 10950 ! frequency of creation of a restart file (modulo referenced to 1) 10 11 nn_write = 10950 ! frequency of write in the output file (modulo referenced to nn_it000) … … 14 15 &namcfg ! parameters of the configuration 15 16 !----------------------------------------------------------------------- 16 cp_cfg = "default" ! name of the configuration 17 jp_cfg = -1 ! resolution of the configuration 18 jpidta = 182 ! 1st lateral dimension ( >= jpi ) 19 jpjdta = 149 ! 2nd " " ( >= jpj ) 20 jpkdta = 31 ! number of levels ( >= jpk ) 21 jpiglo = 182 ! 1st dimension of global domain --> i =jpidta 22 jpjglo = 149 ! 2nd - - --> j =jpjdta 23 jpizoom = 1 ! left bottom (i,j) indices of the zoom 24 jpjzoom = 1 ! in data domain indices 25 jperio = 0 ! lateral cond. type (between 0 and 6) 17 ln_read_cfg = .true. ! (=T) read the domain configuration file 18 ! ! (=F) user defined configuration ==>>> see usrdef(_...) modules 19 cn_domcfg = "AGRIF_AGULHAS_domain_cfg" ! domain configuration filename 26 20 / 27 21 !----------------------------------------------------------------------- … … 33 27 &namdom ! space and time domain (bathymetry, mesh, timestep) 34 28 !----------------------------------------------------------------------- 35 jphgr_msh = 0 ! type of horizontal mesh 36 ppglam0 = 999999.0 ! longitude of first raw and column T-point (jphgr_msh = 1) 37 ppgphi0 = 999999.0 ! latitude of first raw and column T-point (jphgr_msh = 1) 38 ppe1_deg = 999999.0 ! zonal grid-spacing (degrees) 39 ppe2_deg = 999999.0 ! meridional grid-spacing (degrees) 40 ppe1_m = 999999.0 ! zonal grid-spacing (degrees) 41 ppe2_m = 999999.0 ! meridional grid-spacing (degrees) 42 ppsur = -4762.96143546300 ! ORCA r4, r2 and r05 coefficients 43 ppa0 = 255.58049070440 ! (default coefficients) 44 ppa1 = 245.58132232490 ! 45 ppkth = 21.43336197938 ! 46 ppacr = 3.0 ! 47 ppdzmin = 999999. ! Minimum vertical spacing 48 pphmax = 999999. ! Maximum depth 49 ldbletanh = .FALSE. ! Use/do not use double tanf function for vertical coordinates 50 ppa2 = 999999. ! Double tanh function parameters 51 ppkth2 = 999999. ! 52 ppacr2 = 999999. ! 29 ln_linssh = .true. ! =T linear free surface ==>> model level are fixed in time 30 nn_closea = 0 ! remove (=0) or keep (=1) closed seas and lakes (ORCA) 31 ! 53 32 rn_rdt = 2880. ! time step for the dynamics (and tracer if nn_acc=0) 33 ! 54 34 / 55 35 !----------------------------------------------------------------------- … … 65 45 &namsbc ! Surface Boundary Condition (surface module) 66 46 !----------------------------------------------------------------------- 47 ln_blk_core = .true. ! CORE bulk formulation (T => fill namsbc_core) 67 48 nn_ice = 0 ! =0 no ice boundary condition , 68 49 ! =1 use observed ice-cover , … … 193 174 ln_dynvor_een = .true. ! energy & enstrophy scheme 194 175 nn_een_e3f = 0 ! e3f = masked averaging of e3t divided by 4 (=0) or by the sum of mask (=1) 195 ln_dynvor_msk = .false. ! vorticity multiplied by fmask (=T) or not (=F) (all vorticity schemes)196 176 / 197 177 !----------------------------------------------------------------------- … … 216 196 ln_dynldf_iso = .false. ! iso-neutral 217 197 ! ! Coefficient 218 nn_ahm_ijk_t = 20 ! space/time variation of eddy coef198 nn_ahm_ijk_t = 0 ! space/time variation of eddy coef 219 199 ! ! =-30 read in eddy_viscosity_3D.nc file 220 200 ! ! =-20 read in eddy_viscosity_2D.nc file -
branches/2016/dev_CNRS_2016/NEMOGCM/CONFIG/ORCA2_LIM3/EXP00/namelist_cfg
r6140 r7277 9 9 cn_exp = "ORCA2" ! experience name 10 10 nn_it000 = 1 ! first time step 11 nn_itend = 300 ! last time step (std 5475) 12 / 13 !----------------------------------------------------------------------- 14 &namcfg ! parameters of the configuration 15 !----------------------------------------------------------------------- 16 cp_cfg = "orca" ! name of the configuration 17 jp_cfg = 2 ! resolution of the configuration 18 jpidta = 182 ! 1st lateral dimension ( >= jpi ) 19 jpjdta = 149 ! 2nd " " ( >= jpj ) 20 jpkdta = 31 ! number of levels ( >= jpk ) 21 jpiglo = 182 ! 1st dimension of global domain --> i =jpidta 22 jpjglo = 149 ! 2nd - - --> j =jpjdta 23 jpizoom = 1 ! left bottom (i,j) indices of the zoom 24 jpjzoom = 1 ! in data domain indices 25 jperio = 4 ! lateral cond. type (between 0 and 6) 11 nn_itend = 5475 ! last time step (std 5475) 12 / 13 !----------------------------------------------------------------------- 14 &namcfg ! parameters of the configuration 15 !----------------------------------------------------------------------- 16 ln_read_cfg = .true. ! (=T) read the domain configuration file 17 ! ! (=F) user defined configuration ==>>> see usrdef(_...) modules 18 cn_domcfg = "ORCA_R2_zps_domcfg" ! domain configuration filename 26 19 / 27 20 !----------------------------------------------------------------------- … … 33 26 &namdom ! space and time domain (bathymetry, mesh, timestep) 34 27 !----------------------------------------------------------------------- 35 jphgr_msh = 0 ! type of horizontal mesh 36 ppglam0 = 999999.0 ! longitude of first raw and column T-point (jphgr_msh = 1) 37 ppgphi0 = 999999.0 ! latitude of first raw and column T-point (jphgr_msh = 1) 38 ppe1_deg = 999999.0 ! zonal grid-spacing (degrees) 39 ppe2_deg = 999999.0 ! meridional grid-spacing (degrees) 40 ppe1_m = 999999.0 ! zonal grid-spacing (degrees) 41 ppe2_m = 999999.0 ! meridional grid-spacing (degrees) 42 ppsur = -4762.96143546300 ! ORCA r4, r2 and r05 coefficients 43 ppa0 = 255.58049070440 ! (default coefficients) 44 ppa1 = 245.58132232490 ! 45 ppkth = 21.43336197938 ! 46 ppacr = 3.0 ! 47 ppdzmin = 999999. ! Minimum vertical spacing 48 pphmax = 999999. ! Maximum depth 49 ldbletanh = .FALSE. ! Use/do not use double tanf function for vertical coordinates 50 ppa2 = 999999. ! Double tanh function parameters 51 ppkth2 = 999999. ! 52 ppacr2 = 999999. ! 28 ln_linssh = .false. ! =T linear free surface ==>> model level are fixed in time 29 ! 30 nn_msh = 0 ! create (>0) a mesh file or not (=0) 31 ! 53 32 / 54 33 !----------------------------------------------------------------------- … … 64 43 &namsbc ! Surface Boundary Condition (surface module) 65 44 !----------------------------------------------------------------------- 45 ln_blk_core = .true. ! CORE bulk formulation (T => fill namsbc_core) 66 46 / 67 47 !----------------------------------------------------------------------- … … 88 68 &namberg ! iceberg parameters 89 69 !----------------------------------------------------------------------- 70 ln_icebergs = .true. ! iceberg floats or not 71 ln_bergdia = .true. ! Calculate budgets 72 nn_verbose_level = 1 ! Turn on more verbose output if level > 0 73 nn_verbose_write = 15 ! Timesteps between verbose messages 74 nn_sample_rate = 1 ! Timesteps between sampling for trajectory storage 75 ! Initial mass required for an iceberg of each class 76 rn_initial_mass = 8.8e7, 4.1e8, 3.3e9, 1.8e10, 3.8e10, 7.5e10, 1.2e11, 2.2e11, 3.9e11, 7.4e11 77 ! Proportion of calving mass to apportion to each class 78 rn_distribution = 0.24, 0.12, 0.15, 0.18, 0.12, 0.07, 0.03, 0.03, 0.03, 0.02 79 ! Ratio between effective and real iceberg mass (non-dim) 80 ! i.e. number of icebergs represented at a point 81 rn_mass_scaling = 2000, 200, 50, 20, 10, 5, 2, 1, 1, 1 82 ! thickness of newly calved bergs (m) 83 rn_initial_thickness = 40., 67., 133., 175., 250., 250., 250., 250., 250., 250. 84 rn_rho_bergs = 850. ! Density of icebergs 85 rn_LoW_ratio = 1.5 ! Initial ratio L/W for newly calved icebergs 86 ln_operator_splitting = .true. ! Use first order operator splitting for thermodynamics 87 rn_bits_erosion_fraction = 0. ! Fraction of erosion melt flux to divert to bergy bits 88 rn_sicn_shift = 0. ! Shift of sea-ice concn in erosion flux (0<sicn_shift<1) 89 ln_passive_mode = .false. ! iceberg - ocean decoupling 90 nn_test_icebergs = -1 ! Create test icebergs of this class (-1 = no) 91 ! Put a test iceberg at each gridpoint in box (lon1,lon2,lat1,lat2) 92 rn_test_box = 108.0, 116.0, -66.0, -58.0 93 rn_speed_limit = 0. ! CFL speed limit for a berg 94 95 ! ! file name ! frequency (hours) ! variable ! time interp.! clim ! 'yearly'/ ! weights ! rotation ! land/sea mask ! 96 ! ! ! (if <0 months) ! name ! (logical) ! (T/F ) ! 'monthly' ! filename ! pairing ! filename ! 97 sn_icb = 'calving', -1 , 'calving' , .true. , .true. , 'yearly' , '' , '' , '' 98 99 cn_dir = './' 90 100 / 91 101 !----------------------------------------------------------------------- … … 169 179 / 170 180 !----------------------------------------------------------------------- 171 &namtra_dmp ! tracer: T & S newtonian damping 181 &namtra_dmp ! tracer: T & S newtonian damping (default: NO) 172 182 !----------------------------------------------------------------------- 173 183 / … … 188 198 &namdyn_hpg ! Hydrostatic pressure gradient option 189 199 !----------------------------------------------------------------------- 190 ln_hpg_sco = .true. ! s-coordinate (standard jacobian formulation) 191 ln_hpg_zps = .false. ! z-coordinate - partial steps (interpolation) 200 ln_hpg_sco = .true. ! s-coordinate (standard jacobian formulation) 192 201 / 193 202 !----------------------------------------------------------------------- -
branches/2016/dev_CNRS_2016/NEMOGCM/CONFIG/ORCA2_LIM_CFC_C14b/EXP00/1_namelist_cfg
r6140 r7277 116 116 nn_fsbc = 5 ! frequency of surface boundary condition computation 117 117 ! (also = the frequency of sea-ice model call) 118 ln_ana = .false. ! analytical formulation (T => fill namsbc_ana )119 ln_flx = .false. ! flux formulation (T => fill namsbc_flx )120 ln_blk_clio = .false. ! CLIO bulk formulation (T => fill namsbc_clio)121 118 ln_blk_core = .true. ! CORE bulk formulation (T => fill namsbc_core) 122 ln_cpl = .false. ! Coupled formulation (T => fill namsbc_cpl )123 ln_apr_dyn = .false. ! Patm gradient added in ocean & ice Eqs. (T => fill namsbc_apr )124 119 nn_ice = 0 ! =0 no ice boundary condition , 125 120 ! =1 use observed ice-cover , -
branches/2016/dev_CNRS_2016/NEMOGCM/CONFIG/ORCA2_LIM_CFC_C14b/EXP00/namelist_cfg
r6140 r7277 17 17 &namcfg ! parameters of the configuration 18 18 !----------------------------------------------------------------------- 19 cp_cfg = "orca" ! name of the configuration 20 jp_cfg = 2 ! resolution of the configuration 21 jpidta = 182 ! 1st lateral dimension ( >= jpi ) 22 jpjdta = 149 ! 2nd " " ( >= jpj ) 23 jpkdta = 31 ! number of levels ( >= jpk ) 24 jpiglo = 182 ! 1st dimension of global domain --> i =jpidta 25 jpjglo = 149 ! 2nd - - --> j =jpjdta 26 jpizoom = 1 ! left bottom (i,j) indices of the zoom 27 jpjzoom = 1 ! in data domain indices 28 jperio = 4 ! lateral cond. type (between 0 and 6) 19 ln_read_cfg = .true. ! (=T) read the domain configuration file 20 ! ! (=F) user defined configuration ==>>> see usrdef(_...) modules 21 cn_domcfg = "ORCA_R2_zps_domcfg" ! domain configuration filename 29 22 / 30 23 !----------------------------------------------------------------------- … … 49 42 &namdom ! space and time domain (bathymetry, mesh, timestep) 50 43 !----------------------------------------------------------------------- 51 jphgr_msh = 0 ! type of horizontal mesh52 ppglam0 = 999999.0 ! longitude of first raw and column T-point (jphgr_msh = 1)53 ppgphi0 = 999999.0 ! latitude of first raw and column T-point (jphgr_msh = 1)54 ppe1_deg = 999999.0 ! zonal grid-spacing (degrees)55 ppe2_deg = 999999.0 ! meridional grid-spacing (degrees)56 ppe1_m = 999999.0 ! zonal grid-spacing (degrees)57 ppe2_m = 999999.0 ! meridional grid-spacing (degrees)58 44 ppsur = -4762.96143546300 ! ORCA r4, r2 and r05 coefficients 59 45 ppa0 = 255.58049070440 ! (default coefficients) … … 84 70 &namsbc ! Surface Boundary Condition (surface module) 85 71 !----------------------------------------------------------------------- 86 / 87 !----------------------------------------------------------------------- 88 &namsbc_ana ! analytical surface boundary condition 89 !----------------------------------------------------------------------- 72 ln_blk_core = .true. ! CORE bulk formulation (T => fill namsbc_core) 90 73 / 91 74 !----------------------------------------------------------------------- -
branches/2016/dev_CNRS_2016/NEMOGCM/CONFIG/ORCA2_LIM_PISCES/EXP00/namelist_cfg
r6140 r7277 6 6 &namrun ! parameters of the run 7 7 !----------------------------------------------------------------------- 8 / 9 !----------------------------------------------------------------------- 10 &namcfg ! parameters of the configuration 11 !----------------------------------------------------------------------- 12 cp_cfg = "orca" ! name of the configuration 13 jp_cfg = 2 ! resolution of the configuration 14 jpidta = 182 ! 1st lateral dimension ( >= jpi ) 15 jpjdta = 149 ! 2nd " " ( >= jpj ) 16 jpkdta = 31 ! number of levels ( >= jpk ) 17 jpiglo = 182 ! 1st dimension of global domain --> i =jpidta 18 jpjglo = 149 ! 2nd - - --> j =jpjdta 19 jpizoom = 1 ! left bottom (i,j) indices of the zoom 20 jpjzoom = 1 ! in data domain indices 21 jperio = 4 ! lateral cond. type (between 0 and 6) 8 nn_no = 0 ! job number (no more used...) 9 cn_exp = "ORCA2_PIS" ! experience name 10 nn_it000 = 1 ! first time step 11 nn_itend = 5475 ! last time step (std 5475) 12 / 13 !----------------------------------------------------------------------- 14 &namcfg ! parameters of the configuration 15 !----------------------------------------------------------------------- 16 ln_read_cfg = .true. ! (=T) read the domain configuration file 17 ! ! (=F) user defined configuration ==>>> see usrdef(_...) modules 18 cn_domcfg = "ORCA_R2_zps_domcfg" ! domain configuration filename 22 19 / 23 20 !----------------------------------------------------------------------- … … 25 22 !----------------------------------------------------------------------- 26 23 ln_zps = .true. ! z-coordinate - partial steps 27 ln_linssh = .true. ! linear free surface28 24 / 29 25 !----------------------------------------------------------------------- 30 26 &namdom ! space and time domain (bathymetry, mesh, timestep) 31 27 !----------------------------------------------------------------------- 32 jphgr_msh = 0 ! type of horizontal mesh 33 ppglam0 = 999999.0 ! longitude of first raw and column T-point (jphgr_msh = 1) 34 ppgphi0 = 999999.0 ! latitude of first raw and column T-point (jphgr_msh = 1) 35 ppe1_deg = 999999.0 ! zonal grid-spacing (degrees) 36 ppe2_deg = 999999.0 ! meridional grid-spacing (degrees) 37 ppe1_m = 999999.0 ! zonal grid-spacing (degrees) 38 ppe2_m = 999999.0 ! meridional grid-spacing (degrees) 39 ppsur = -4762.96143546300 ! ORCA r4, r2 and r05 coefficients 40 ppa0 = 255.58049070440 ! (default coefficients) 41 ppa1 = 245.58132232490 ! 42 ppkth = 21.43336197938 ! 43 ppacr = 3.0 ! 44 ppdzmin = 999999. ! Minimum vertical spacing 45 pphmax = 999999. ! Maximum depth 46 ldbletanh = .FALSE. ! Use/do not use double tanf function for vertical coordinates 47 ppa2 = 999999. ! Double tanh function parameters 48 ppkth2 = 999999. ! 49 ppacr2 = 999999. ! 28 ln_linssh = .false. ! =T linear free surface ==>> model level are fixed in time 29 ! 30 nn_msh = 0 ! create (>0) a mesh file or not (=0) 31 ! 50 32 / 51 33 !----------------------------------------------------------------------- … … 61 43 &namsbc ! Surface Boundary Condition (surface module) 62 44 !----------------------------------------------------------------------- 45 ln_blk_core = .true. ! CORE bulk formulation (T => fill namsbc_core) 63 46 / 64 47 !----------------------------------------------------------------------- … … 129 112 ln_traldf_lev = .false. ! iso-level 130 113 ln_traldf_hor = .false. ! horizontal (geopotential) 131 ln_traldf_iso = .true. ! iso-neutral ( standard operator)132 ln_traldf_triad = .false. ! iso-neutral ( triadoperator)114 ln_traldf_iso = .true. ! iso-neutral (Standard operator) 115 ln_traldf_triad = .false. ! iso-neutral (Triads operator) 133 116 ! 134 117 ! ! iso-neutral options: … … 166 149 / 167 150 !----------------------------------------------------------------------- 168 &namtra_dmp ! tracer: T & S newtonian damping 151 &namtra_dmp ! tracer: T & S newtonian damping (default: NO) 169 152 !----------------------------------------------------------------------- 170 153 / … … 185 168 &namdyn_hpg ! Hydrostatic pressure gradient option 186 169 !----------------------------------------------------------------------- 170 ln_hpg_sco = .true. ! s-coordinate (standard jacobian formulation) 187 171 / 188 172 !----------------------------------------------------------------------- … … 214 198 rn_ahm_b = 0. ! background eddy viscosity for ldf_iso [m2/s] 215 199 rn_bhm_0 = 1.e+12 ! horizontal bilaplacian eddy viscosity [m4/s] 200 ! 201 ! Caution in 20 and 30 cases the coefficient have to be given for a 1 degree grid (~111km) 216 202 / 217 203 !----------------------------------------------------------------------- -
branches/2016/dev_CNRS_2016/NEMOGCM/CONFIG/ORCA2_OFF_PISCES/EXP00/namelist_cfg
r6140 r7277 13 13 &namcfg ! parameters of the configuration 14 14 !----------------------------------------------------------------------- 15 cp_cfg = "orca" ! name of the configuration 16 jp_cfg = 2 ! resolution of the configuration 17 jpidta = 182 ! 1st lateral dimension ( >= jpi ) 18 jpjdta = 149 ! 2nd " " ( >= jpj ) 19 jpkdta = 31 ! number of levels ( >= jpk ) 20 jpiglo = 182 ! 1st dimension of global domain --> i =jpidta 21 jpjglo = 149 ! 2nd - - --> j =jpjdta 22 jpizoom = 1 ! left bottom (i,j) indices of the zoom 23 jpjzoom = 1 ! in data domain indices 24 jperio = 4 ! lateral cond. type (between 0 and 6) 15 ln_read_cfg = .true. ! (=T) read the domain configuration file 16 ! ! (=F) user defined configuration ==>>> see usrdef(_...) modules 17 cn_domcfg = "ORCA_R2_zps_domcfg" ! domain configuration filename 25 18 / 26 19 !----------------------------------------------------------------------- … … 28 21 !----------------------------------------------------------------------- 29 22 ln_zps = .true. ! z-coordinate - partial steps 30 ln_linssh = .true. ! linear free surface31 23 / 32 24 !----------------------------------------------------------------------- 33 25 &namdom ! space and time domain (bathymetry, mesh, timestep) 34 26 !----------------------------------------------------------------------- 35 nn_msh = 1 ! create (=1) a mesh file or not (=0) 36 rn_rdt = 21600. ! time step for the dynamics 37 jphgr_msh = 0 ! type of horizontal mesh 38 ppglam0 = 999999.0 ! longitude of first raw and column T-point (jphgr_msh = 1) 39 ppgphi0 = 999999.0 ! latitude of first raw and column T-point (jphgr_msh = 1) 40 ppe1_deg = 999999.0 ! zonal grid-spacing (degrees) 41 ppe2_deg = 999999.0 ! meridional grid-spacing (degrees) 42 ppe1_m = 999999.0 ! zonal grid-spacing (degrees) 43 ppe2_m = 999999.0 ! meridional grid-spacing (degrees) 44 ppsur = -4762.96143546300 ! ORCA r4, r2 and r05 coefficients 45 ppa0 = 255.58049070440 ! (default coefficients) 46 ppa1 = 245.58132232490 ! 47 ppkth = 21.43336197938 ! 48 ppacr = 3.0 ! 49 ppdzmin = 999999. ! Minimum vertical spacing 50 pphmax = 999999. ! Maximum depth 51 ldbletanh = .FALSE. ! Use/do not use double tanf function for vertical coordinates 52 ppa2 = 999999. ! Double tanh function parameters 53 ppkth2 = 999999. ! 54 ppacr2 = 999999. ! 27 ln_linssh = .true. ! =T linear free surface ==>> model level are fixed in time 28 ! 29 rn_rdt = 21600. ! time step for the dynamics (and tracer if nn_acc=0) 30 / 31 !----------------------------------------------------------------------- 32 &namlbc ! lateral momentum boundary condition 33 !----------------------------------------------------------------------- 34 ! ! free slip ! partial slip ! no slip ! strong slip 35 rn_shlat = 2. ! shlat = 0 ! 0 < shlat < 2 ! shlat = 2 ! 2 < shlat 36 ln_vorlat = .false. ! consistency of vorticity boundary condition with analytical Eqs. 55 37 / 56 38 !----------------------------------------------------------------------- … … 67 49 !----------------------------------------------------------------------- 68 50 nn_fsbc = 1 ! frequency of surface boundary condition computation 51 ln_blk_core = .true. ! CORE bulk formulation (T => fill namsbc_core) 69 52 ln_rnf = .false. ! runoffs 70 53 ln_traqsr = .false. ! Light penetration (T) or not (F) … … 136 119 ! ! file name ! frequency (hours) ! variable ! time interp. ! clim ! 'yearly'/ ! weights ! rotation ! land/sea mask ! 137 120 ! ! ! (if <0 months) ! name ! (logical) ! (T/F) ! 'monthly' ! filename ! pairing ! filename ! 121 ! ! file name ! frequency (hours) ! variable ! time interp. ! clim ! 'yearly'/ ! weights ! rotation ! land/sea mask ! 122 ! ! ! (if <0 months) ! name ! (logical) ! (T/F) ! 'monthly' ! filename ! pairing ! filename ! 138 123 sn_tem = 'dyna_grid_T' , 120 , 'votemper' , .true. , .true. , 'yearly' , '' , '' , '' 139 124 sn_sal = 'dyna_grid_T' , 120 , 'vosaline' , .true. , .true. , 'yearly' , '' , '' , '' … … 144 129 sn_qsr = 'dyna_grid_T' , 120 , 'soshfldo' , .true. , .true. , 'yearly' , '' , '' , '' 145 130 sn_wnd = 'dyna_grid_T' , 120 , 'sowindsp' , .true. , .true. , 'yearly' , '' , '' , '' 146 sn_uwd = 'dyna_grid_U' , 120 , ' vozocrtx' , .true. , .true. , 'yearly' , '' , '' , ''147 sn_vwd = 'dyna_grid_V' , 120 , 'vo mecrty' , .true. , .true. , 'yearly' , '' , '' , ''148 sn_wwd = 'dyna_grid_W' , 120 , ' vovecrtz' , .true. , .true. , 'yearly' , '' , '' , ''131 sn_uwd = 'dyna_grid_U' , 120 , 'uocetr_eff' , .true. , .true. , 'yearly' , '' , '' , '' 132 sn_vwd = 'dyna_grid_V' , 120 , 'vocetr_eff' , .true. , .true. , 'yearly' , '' , '' , '' 133 sn_wwd = 'dyna_grid_W' , 120 , 'wocetr_eff' , .true. , .true. , 'yearly' , '' , '' , '' 149 134 sn_avt = 'dyna_grid_W' , 120 , 'voddmavs' , .true. , .true. , 'yearly' , '' , '' , '' 150 135 sn_ubl = 'dyna_grid_U' , 120 , 'sobblcox' , .true. , .true. , 'yearly' , '' , '' , '' 151 136 sn_vbl = 'dyna_grid_V' , 120 , 'sobblcoy' , .true. , .true. , 'yearly' , '' , '' , '' 152 137 ! 153 cn_dir = './' ! root directory for the location of the dynamical files 154 ln_dynwzv = .true. ! computation of vertical velocity instead of using the one read in file 155 ln_dynbbl = .true. ! bbl coef are in files, so read them - requires ("key_trabbl") 138 cn_dir = './' ! root directory for the location of the dynamical files 139 ln_dynrnf = .false. ! runoffs option enabled (T) or not (F) 140 ln_dynrnf_depth = .false. ! runoffs is spread in vertical (T) or not (F) 141 ! fwbcorr = 3.786e-06 ! annual global mean of empmr for ssh correction 156 142 / 157 143 !----------------------------------------------------------------------- -
branches/2016/dev_CNRS_2016/NEMOGCM/CONFIG/ORCA2_OFF_PISCES/EXP00/namelist_top_cfg
r6140 r7277 5 5 &namtrc_run ! run information 6 6 !----------------------------------------------------------------------- 7 nn_writetrc = 1460 ! time step frequency for sn_tracer outputs8 7 / 9 8 !----------------------------------------------------------------------- -
branches/2016/dev_CNRS_2016/NEMOGCM/CONFIG/ORCA2_SAS_LIM/EXP00/namelist_cfg
r6140 r7277 1 1 !!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 2 !! NEMO/OPA : Configuration namelist used to overwritenamelist_ref2 !! NEMO/OPA Configuration namelist : used to overwrite defaults values defined in SHARED/namelist_ref 3 3 !!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 4 ! 4 5 !----------------------------------------------------------------------- 5 6 &namrun ! parameters of the run 6 7 !----------------------------------------------------------------------- 7 cn_exp = "ORCA2_SAS" ! experience name 8 nn_it000 = 1 ! first time step 9 nn_itend = 100 ! last time step (std 5475) 10 / 11 !----------------------------------------------------------------------- 12 &namcfg ! parameters of the configuration 13 !----------------------------------------------------------------------- 14 cp_cfg = "orca" ! name of the configuration 15 jp_cfg = 2 ! resolution of the configuration 16 jpidta = 182 ! 1st lateral dimension ( >= jpi ) 17 jpjdta = 149 ! 2nd " " ( >= jpj ) 18 jpkdta = 31 ! number of levels ( >= jpk ) 19 jpiglo = 182 ! 1st dimension of global domain --> i =jpidta 20 jpjglo = 149 ! 2nd - - --> j =jpjdta 21 jpizoom = 1 ! left bottom (i,j) indices of the zoom 22 jpjzoom = 1 ! in data domain indices 23 jperio = 4 ! lateral cond. type (between 0 and 6) 8 nn_no = 0 ! job number (no more used...) 9 cn_exp = "ORCA2_SAS" ! experience name 10 nn_it000 = 1 ! first time step 11 nn_itend = 100 ! last time step (std 5475) 12 / 13 !----------------------------------------------------------------------- 14 &namcfg ! parameters of the configuration 15 !----------------------------------------------------------------------- 16 ln_read_cfg = .true. ! (=T) read the domain configuration file 17 ! ! (=F) user defined configuration ==>>> see usrdef(_...) modules 18 cn_domcfg = "ORCA_R2_zps_domcfg" ! domain configuration filename 24 19 / 25 20 !----------------------------------------------------------------------- 26 21 &namzgr ! vertical coordinate 27 22 !----------------------------------------------------------------------- 28 ln_zco = .true. ! z-coordinate - full steps 29 ln_linssh = .true. ! linear free surface 23 ln_zps = .true. ! z-coordinate - partial steps 30 24 / 31 25 !----------------------------------------------------------------------- 32 26 &namdom ! space and time domain (bathymetry, mesh, timestep) 33 27 !----------------------------------------------------------------------- 34 jphgr_msh = 0 ! type of horizontal mesh 35 ppglam0 = 999999.0 ! longitude of first raw and column T-point (jphgr_msh = 1) 36 ppgphi0 = 999999.0 ! latitude of first raw and column T-point (jphgr_msh = 1) 37 ppe1_deg = 999999.0 ! zonal grid-spacing (degrees) 38 ppe2_deg = 999999.0 ! meridional grid-spacing (degrees) 39 ppe1_m = 999999.0 ! zonal grid-spacing (degrees) 40 ppe2_m = 999999.0 ! meridional grid-spacing (degrees) 41 ppsur = -4762.96143546300 ! ORCA r4, r2 and r05 coefficients 42 ppa0 = 255.58049070440 ! (default coefficients) 43 ppa1 = 245.58132232490 ! 44 ppkth = 21.43336197938 ! 45 ppacr = 3.0 ! 46 ppdzmin = 999999. ! Minimum vertical spacing 47 pphmax = 999999. ! Maximum depth 48 ldbletanh = .FALSE. ! Use/do not use double tanf function for vertical coordinates 49 ppa2 = 999999. ! Double tanh function parameters 50 ppkth2 = 999999. ! 51 ppacr2 = 999999. ! 28 ln_linssh = .true. ! =T linear free surface ==>> model level are fixed in time 29 ! 30 nn_msh = 0 ! create (>0) a mesh file or not (=0) 31 ! 52 32 / 53 33 !----------------------------------------------------------------------- … … 57 37 / 58 38 !----------------------------------------------------------------------- 39 &namtsd ! data : Temperature & Salinity 40 !----------------------------------------------------------------------- 41 / 42 !----------------------------------------------------------------------- 43 &namsbc ! Surface Boundary Condition (surface module) 44 !----------------------------------------------------------------------- 45 ln_blk_core = .true. ! CORE bulk formulation (T => fill namsbc_core) 46 / 47 !----------------------------------------------------------------------- 48 &namsbc_core ! namsbc_core CORE bulk formulae 49 !----------------------------------------------------------------------- 50 / 51 !----------------------------------------------------------------------- 52 &namtra_qsr ! penetrative solar radiation 53 !----------------------------------------------------------------------- 54 / 55 !----------------------------------------------------------------------- 56 &namsbc_rnf ! runoffs namelist surface boundary condition 57 !----------------------------------------------------------------------- 58 / 59 !----------------------------------------------------------------------- 60 &namsbc_ssr ! surface boundary condition : sea surface restoring 61 !----------------------------------------------------------------------- 62 / 63 !----------------------------------------------------------------------- 64 &namsbc_alb ! albedo parameters 65 !----------------------------------------------------------------------- 66 / 67 !----------------------------------------------------------------------- 68 &namberg ! iceberg parameters 69 !----------------------------------------------------------------------- 70 / 71 !----------------------------------------------------------------------- 72 &namlbc ! lateral momentum boundary condition 73 !----------------------------------------------------------------------- 74 / 75 !----------------------------------------------------------------------- 76 &nambfr ! bottom friction 77 !----------------------------------------------------------------------- 78 / 79 !----------------------------------------------------------------------- 80 &nambbc ! bottom temperature boundary condition (default: NO) 81 !----------------------------------------------------------------------- 82 ln_trabbc = .true. ! Apply a geothermal heating at the ocean bottom 83 / 84 !----------------------------------------------------------------------- 85 &nambbl ! bottom boundary layer scheme 86 !----------------------------------------------------------------------- 87 / 88 !----------------------------------------------------------------------- 89 &nameos ! ocean physical parameters 90 !----------------------------------------------------------------------- 91 / 92 !----------------------------------------------------------------------- 93 &namtra_adv ! advection scheme for tracer 94 !----------------------------------------------------------------------- 95 ln_traadv_fct = .true. ! FCT scheme 96 nn_fct_h = 2 ! =2/4, horizontal 2nd / 4th order 97 nn_fct_v = 2 ! =2/4, vertical 2nd / COMPACT 4th order 98 nn_fct_zts = 0 ! > 1 , 2nd order FCT scheme with vertical sub-timestepping 99 ! ! (number of sub-timestep = nn_fct_zts) 100 / 101 !----------------------------------------------------------------------- 102 &namtra_adv_mle ! mixed layer eddy parametrisation (Fox-Kemper param) 103 !----------------------------------------------------------------------- 104 / 105 !---------------------------------------------------------------------------------- 106 &namtra_ldf ! lateral diffusion scheme for tracers 107 !---------------------------------------------------------------------------------- 108 ! ! Operator type: 109 ln_traldf_lap = .true. ! laplacian operator 110 ln_traldf_blp = .false. ! bilaplacian operator 111 ! ! Direction of action: 112 ln_traldf_lev = .false. ! iso-level 113 ln_traldf_hor = .false. ! horizontal (geopotential) 114 ln_traldf_iso = .true. ! iso-neutral (Standard operator) 115 ln_traldf_triad = .false. ! iso-neutral (Triads operator) 116 ! 117 ! ! iso-neutral options: 118 ln_traldf_msc = .true. ! Method of Stabilizing Correction (both operators) 119 rn_slpmax = 0.01 ! slope limit (both operators) 120 ln_triad_iso = .false. ! pure horizontal mixing in ML (triad only) 121 rn_sw_triad = 1 ! =1 switching triad ; =0 all 4 triads used (triad only) 122 ln_botmix_triad = .false. ! lateral mixing on bottom (triad only) 123 ! 124 ! ! Coefficients: 125 nn_aht_ijk_t = 20 ! space/time variation of eddy coef 126 ! ! =-20 (=-30) read in eddy_diffusivity_2D.nc (..._3D.nc) file 127 ! ! = 0 constant 128 ! ! = 10 F(k) =ldf_c1d 129 ! ! = 20 F(i,j) =ldf_c2d 130 ! ! = 21 F(i,j,t) =Treguier et al. JPO 1997 formulation 131 ! ! = 30 F(i,j,k) =ldf_c2d + ldf_c1d 132 ! ! = 31 F(i,j,k,t)=F(local velocity) 133 rn_aht_0 = 2000. ! lateral eddy diffusivity (lap. operator) [m2/s] 134 rn_bht_0 = 1.e+12 ! lateral eddy diffusivity (bilap. operator) [m4/s] 135 / 136 !---------------------------------------------------------------------------------- 137 &namtra_ldfeiv ! eddy induced velocity param. 138 !---------------------------------------------------------------------------------- 139 ln_ldfeiv =.true. ! use eddy induced velocity parameterization 140 ln_ldfeiv_dia =.true. ! diagnose eiv stream function and velocities 141 rn_aeiv_0 = 2000. ! eddy induced velocity coefficient [m2/s] 142 nn_aei_ijk_t = 21 ! space/time variation of the eiv coeficient 143 ! ! =-20 (=-30) read in eddy_induced_velocity_2D.nc (..._3D.nc) file 144 ! ! = 0 constant 145 ! ! = 10 F(k) =ldf_c1d 146 ! ! = 20 F(i,j) =ldf_c2d 147 ! ! = 21 F(i,j,t) =Treguier et al. JPO 1997 formulation 148 ! ! = 30 F(i,j,k) =ldf_c2d + ldf_c1d 149 / 150 !----------------------------------------------------------------------- 151 &namtra_dmp ! tracer: T & S newtonian damping (default: NO) 152 !----------------------------------------------------------------------- 153 !----------------------------------------------------------------------- 154 &namdyn_adv ! formulation of the momentum advection 155 !----------------------------------------------------------------------- 156 / 157 !----------------------------------------------------------------------- 158 &namdyn_vor ! option of physics/algorithm (not control by CPP keys) 159 !----------------------------------------------------------------------- 160 ln_dynvor_ene = .false. ! enstrophy conserving scheme 161 ln_dynvor_ens = .false. ! energy conserving scheme 162 ln_dynvor_mix = .false. ! mixed scheme 163 ln_dynvor_een = .true. ! energy & enstrophy scheme 164 nn_een_e3f = 0 ! e3f = masked averaging of e3t divided by 4 (=0) or by the sum of mask (=1) 165 / 166 !----------------------------------------------------------------------- 167 &namdyn_hpg ! Hydrostatic pressure gradient option 168 !----------------------------------------------------------------------- 169 / 170 !----------------------------------------------------------------------- 171 &namdyn_spg ! surface pressure gradient 172 !----------------------------------------------------------------------- 173 ln_dynspg_ts = .true. ! split-explicit free surface 174 / 175 !----------------------------------------------------------------------- 176 &namdyn_ldf ! lateral diffusion on momentum 177 !----------------------------------------------------------------------- 178 ! ! Type of the operator : 179 ! ! no diffusion: set ln_dynldf_lap=..._blp=F 180 ln_dynldf_lap = .true. ! laplacian operator 181 ln_dynldf_blp = .false. ! bilaplacian operator 182 ! ! Direction of action : 183 ln_dynldf_lev = .true. ! iso-level 184 ln_dynldf_hor = .false. ! horizontal (geopotential) 185 ln_dynldf_iso = .false. ! iso-neutral 186 ! ! Coefficient 187 nn_ahm_ijk_t = -30 ! space/time variation of eddy coef 188 ! ! =-30 read in eddy_viscosity_3D.nc file 189 ! ! =-20 read in eddy_viscosity_2D.nc file 190 ! ! = 0 constant 191 ! ! = 10 F(k)=c1d 192 ! ! = 20 F(i,j)=F(grid spacing)=c2d 193 ! ! = 30 F(i,j,k)=c2d*c1d 194 ! ! = 31 F(i,j,k)=F(grid spacing and local velocity) 195 rn_ahm_0 = 40000. ! horizontal laplacian eddy viscosity [m2/s] 196 rn_ahm_b = 0. ! background eddy viscosity for ldf_iso [m2/s] 197 rn_bhm_0 = 1.e+12 ! horizontal bilaplacian eddy viscosity [m4/s] 198 ! 199 ! Caution in 20 and 30 cases the coefficient have to be given for a 1 degree grid (~111km) 200 / 201 !----------------------------------------------------------------------- 202 &namzdf ! vertical physics 203 !----------------------------------------------------------------------- 204 / 205 !----------------------------------------------------------------------- 206 &namzdf_tke ! turbulent eddy kinetic dependent vertical diffusion ("key_zdftke") 207 !----------------------------------------------------------------------- 208 / 209 !----------------------------------------------------------------------- 210 &namzdf_ddm ! double diffusive mixing parameterization ("key_zdfddm") 211 !----------------------------------------------------------------------- 212 / 213 !----------------------------------------------------------------------- 214 &namzdf_tmx ! tidal mixing parameterization ("key_zdftmx") 215 !----------------------------------------------------------------------- 216 / 217 !----------------------------------------------------------------------- 218 &nammpp ! Massively Parallel Processing ("key_mpp_mpi) 219 !----------------------------------------------------------------------- 220 / 221 !----------------------------------------------------------------------- 59 222 &namctl ! Control prints & Benchmark 60 223 !----------------------------------------------------------------------- 61 224 / 62 225 !----------------------------------------------------------------------- 63 &namsbc ! Surface Boundary Condition (surface module) 64 !----------------------------------------------------------------------- 65 / 66 !----------------------------------------------------------------------- 67 &namsbc_sas ! analytical surface boundary condition 68 !----------------------------------------------------------------------- 69 / 70 !----------------------------------------------------------------------- 71 &namsbc_core ! namsbc_core CORE bulk formulae 72 !----------------------------------------------------------------------- 73 / 74 !----------------------------------------------------------------------- 75 &namsbc_ssr ! surface boundary condition : sea surface restoring 76 !----------------------------------------------------------------------- 77 / 78 !----------------------------------------------------------------------- 79 &namsbc_alb ! albedo parameters 80 !----------------------------------------------------------------------- 81 / 82 !----------------------------------------------------------------------- 83 &namlbc ! lateral momentum boundary condition 84 !----------------------------------------------------------------------- 85 / 86 !----------------------------------------------------------------------- 87 &nameos ! ocean physical parameters 88 !----------------------------------------------------------------------- 89 / 90 !----------------------------------------------------------------------- 91 &nammpp ! Massively Parallel Processing ("key_mpp_mpi) 92 !----------------------------------------------------------------------- 93 / 226 &namptr ! Poleward Transport Diagnostic 227 !----------------------------------------------------------------------- 228 / 229 !----------------------------------------------------------------------- 230 &namhsb ! Heat and salt budgets (default F) 231 !----------------------------------------------------------------------- 232 / 233 !----------------------------------------------------------------------- 234 &namobs ! observation usage ('key_diaobs') 235 !----------------------------------------------------------------------- 236 / 237 !----------------------------------------------------------------------- 238 &nam_asminc ! assimilation increments ('key_asminc') 239 !----------------------------------------------------------------------- 240 / -
branches/2016/dev_CNRS_2016/NEMOGCM/CONFIG/ORCA2_SAS_LIM/cpp_ORCA2_SAS_LIM.fcm
r6140 r7277 1 bld::tool::fppkeys key_trabbl key_lim2 key_zdftke key_zdfddm key_zdftmx key_iomput key_mpp_mpi 1 bld::tool::fppkeys key_trabbl key_lim2 key_zdftke key_zdfddm key_zdftmx key_iomput key_mpp_mpi key_mpp_rep -
branches/2016/dev_CNRS_2016/NEMOGCM/CONFIG/SHARED/namelist_ref
r6152 r7277 3 3 !!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 4 4 !! NEMO/OPA : 1 - run manager (namrun) 5 !! namelists 2 - Domain (namcfg, namzgr, nam zgr_sco, namdom, namtsd)6 !! 3 - Surface boundary (namsbc, namsbc_ ana, namsbc_flx, namsbc_clio, namsbc_core, namsbc_sas5 !! namelists 2 - Domain (namcfg, namzgr, namdom, namtsd) 6 !! 3 - Surface boundary (namsbc, namsbc_flx, namsbc_clio, namsbc_core, namsbc_sas 7 7 !! namsbc_cpl, namtra_qsr, namsbc_rnf, 8 8 !! namsbc_apr, namsbc_ssr, namsbc_alb, namsbc_wave) … … 60 60 !! namcfg parameters of the configuration 61 61 !! namzgr vertical coordinate 62 !! namzgr_sco s-coordinate or hybrid z-s-coordinate63 62 !! namdom space and time domain (bathymetry, mesh, timestep) 64 63 !! namcrs coarsened grid (for outputs and/or TOP) ("key_crs") … … 72 71 &namcfg ! parameters of the configuration 73 72 !----------------------------------------------------------------------- 74 cp_cfg = "default" ! name of the configuration 75 cp_cfz = "no zoom" ! name of the zoom of configuration 76 jp_cfg = 0 ! resolution of the configuration 77 jpidta = 10 ! 1st lateral dimension ( >= jpi ) 78 jpjdta = 12 ! 2nd " " ( >= jpj ) 79 jpkdta = 31 ! number of levels ( >= jpk ) 80 jpiglo = 10 ! 1st dimension of global domain --> i =jpidta 81 jpjglo = 12 ! 2nd - - --> j =jpjdta 82 jpizoom = 1 ! left bottom (i,j) indices of the zoom 83 jpjzoom = 1 ! in data domain indices 84 jperio = 0 ! lateral cond. type (between 0 and 6) 85 ! = 0 closed ; = 1 cyclic East-West 86 ! = 2 equatorial symmetric ; = 3 North fold T-point pivot 87 ! = 4 cyclic East-West AND North fold T-point pivot 88 ! = 5 North fold F-point pivot 89 ! = 6 cyclic East-West AND North fold F-point pivot 73 ln_read_cfg = .false. ! (=T) read the domain configuration file 74 ! ! (=F) user defined configuration ==>>> see usrdef(_...) modules 75 cn_domcfg = "domain_cfg" ! domain configuration filename 76 ! 77 ln_write_cfg= .false. ! (=T) create the domain configuration file 78 cn_domcfg_out = "domain_cfg_out" ! newly created domain configuration filename 79 ! 90 80 ln_use_jattr = .false. ! use (T) the file attribute: open_ocean_jstart, if present 91 ! in netcdf input files, as the start j-row for reading 92 / 93 !----------------------------------------------------------------------- 94 &namzgr ! vertical coordinate (default: NO selection) 95 !----------------------------------------------------------------------- 96 ln_zco = .false. ! z-coordinate - full steps 97 ln_zps = .false. ! z-coordinate - partial steps 98 ln_sco = .false. ! s- or hybrid z-s-coordinate 99 ln_isfcav = .false. ! ice shelf cavity 100 ln_linssh = .false. ! linear free surface 101 / 102 !----------------------------------------------------------------------- 103 &namzgr_sco ! s-coordinate or hybrid z-s-coordinate 104 !----------------------------------------------------------------------- 105 ln_s_sh94 = .false. ! Song & Haidvogel 1994 hybrid S-sigma (T)| 106 ln_s_sf12 = .false. ! Siddorn & Furner 2012 hybrid S-z-sigma (T)| if both are false the NEMO tanh stretching is applied 107 ln_sigcrit = .false. ! use sigma coordinates below critical depth (T) or Z coordinates (F) for Siddorn & Furner stretch 108 ! stretching coefficients for all functions 109 rn_sbot_min = 10.0 ! minimum depth of s-bottom surface (>0) (m) 110 rn_sbot_max = 7000.0 ! maximum depth of s-bottom surface (= ocean depth) (>0) (m) 111 rn_hc = 150.0 ! critical depth for transition to stretched coordinates 112 !!!!!!! Envelop bathymetry 113 rn_rmax = 0.3 ! maximum cut-off r-value allowed (0<r_max<1) 114 !!!!!!! SH94 stretching coefficients (ln_s_sh94 = .true.) 115 rn_theta = 6.0 ! surface control parameter (0<=theta<=20) 116 rn_bb = 0.8 ! stretching with SH94 s-sigma 117 !!!!!!! SF12 stretching coefficient (ln_s_sf12 = .true.) 118 rn_alpha = 4.4 ! stretching with SF12 s-sigma 119 rn_efold = 0.0 ! efold length scale for transition to stretched coord 120 rn_zs = 1.0 ! depth of surface grid box 121 ! bottom cell depth (Zb) is a linear function of water depth Zb = H*a + b 122 rn_zb_a = 0.024 ! bathymetry scaling factor for calculating Zb 123 rn_zb_b = -0.2 ! offset for calculating Zb 124 !!!!!!!! Other stretching (not SH94 or SF12) [also uses rn_theta above] 125 rn_thetb = 1.0 ! bottom control parameter (0<=thetb<= 1) 81 ! ! in netcdf input files, as the start j-row for reading 126 82 / 127 83 !----------------------------------------------------------------------- 128 84 &namdom ! space and time domain (bathymetry, mesh, timestep) 129 85 !----------------------------------------------------------------------- 130 nn_bathy = 1 ! compute (=0) or read (=1) the bathymetry file 131 rn_bathy = 0. ! value of the bathymetry. if (=0) bottom flat at jpkm1 86 ln_linssh = .false. ! =T linear free surface ==>> model level are fixed in time 132 87 nn_closea = 0 ! remove (=0) or keep (=1) closed seas and lakes (ORCA) 133 nn_msh = 1 ! create (=1) a mesh file or not (=0)134 rn_hmin = -3. ! min depth of the ocean (>0) or min number of ocean level (<0)88 ! 89 nn_msh = 0 ! create (>0) a mesh file or not (=0) 135 90 rn_isfhmin = 1.00 ! treshold (m) to discriminate grounding ice to floating ice 136 rn_e3zps_min= 20. ! partial step thickness is set larger than the minimum of 137 rn_e3zps_rat= 0.1 ! rn_e3zps_min and rn_e3zps_rat*e3t, with 0<rn_e3zps_rat<1 138 ! 91 ! 139 92 rn_rdt = 5760. ! time step for the dynamics (and tracer if nn_acc=0) 140 93 rn_atfp = 0.1 ! asselin time filter parameter 141 ln_crs = .false. ! Logical switch for coarsening module 142 jphgr_msh = 0 ! type of horizontal mesh 143 ! = 0 curvilinear coordinate on the sphere read in coordinate.nc 144 ! = 1 geographical mesh on the sphere with regular grid-spacing 145 ! = 2 f-plane with regular grid-spacing 146 ! = 3 beta-plane with regular grid-spacing 147 ! = 4 Mercator grid with T/U point at the equator 148 ppglam0 = 0.0 ! longitude of first raw and column T-point (jphgr_msh = 1) 149 ppgphi0 = -35.0 ! latitude of first raw and column T-point (jphgr_msh = 1) 150 ppe1_deg = 1.0 ! zonal grid-spacing (degrees) 151 ppe2_deg = 0.5 ! meridional grid-spacing (degrees) 152 ppe1_m = 5000.0 ! zonal grid-spacing (degrees) 153 ppe2_m = 5000.0 ! meridional grid-spacing (degrees) 154 ppsur = -4762.96143546300 ! ORCA r4, r2 and r05 coefficients 155 ppa0 = 255.58049070440 ! (default coefficients) 156 ppa1 = 245.58132232490 ! 157 ppkth = 21.43336197938 ! 158 ppacr = 3.0 ! 159 ppdzmin = 10. ! Minimum vertical spacing 160 pphmax = 5000. ! Maximum depth 161 ldbletanh = .TRUE. ! Use/do not use double tanf function for vertical coordinates 162 ppa2 = 100.760928500000 ! Double tanh function parameters 163 ppkth2 = 48.029893720000 ! 164 ppacr2 = 13.000000000000 ! 94 ! 95 ln_crs = .false. ! Logical switch for coarsening module 165 96 / 166 97 !----------------------------------------------------------------------- … … 220 151 !!====================================================================== 221 152 !! namsbc surface boundary condition 222 !! namsbc_ana analytical formulation (ln_ana =T)223 153 !! namsbc_flx flux formulation (ln_flx =T) 224 154 !! namsbc_clio CLIO bulk formulae formulation (ln_blk_clio=T) … … 244 174 ! (also = the frequency of sea-ice & iceberg model call) 245 175 ! Type of air-sea fluxes 246 ln_ ana = .false. ! analytical formulation (T => fill namsbc_ana)176 ln_usr = .false. ! user defined formulation (T => check usrdef_sbc) 247 177 ln_flx = .false. ! flux formulation (T => fill namsbc_flx ) 248 178 ln_blk_clio = .false. ! CLIO bulk formulation (T => fill namsbc_clio) 249 ln_blk_core = . true. ! CORE bulk formulation (T => fill namsbc_core)179 ln_blk_core = .false. ! CORE bulk formulation (T => fill namsbc_core) 250 180 ln_blk_mfs = .false. ! MFS bulk formulation (T => fill namsbc_mfs ) 251 181 ! Type of coupling (Ocean/Ice/Atmosphere) : … … 278 208 ln_apr_dyn = .false. ! Patm gradient added in ocean & ice Eqs. (T => fill namsbc_apr ) 279 209 ln_isf = .false. ! ice shelf (T => fill namsbc_isf) 280 ln_wave = .false.! coupling with surface wave (T => fill namsbc_wave)281 nn_lsm = 0! =0 land/sea mask for input fields is not applied (keep empty land/sea mask filename field) ,210 ln_wave = .false. ! coupling with surface wave (T => fill namsbc_wave) 211 nn_lsm = 0 ! =0 land/sea mask for input fields is not applied (keep empty land/sea mask filename field) , 282 212 ! =1:n number of iterations of land/sea mask application for input fields (fill land/sea mask filename field) 283 /284 !-----------------------------------------------------------------------285 &namsbc_ana ! analytical surface boundary condition286 !-----------------------------------------------------------------------287 nn_tau000 = 0 ! gently increase the stress over the first ntau_rst time-steps288 rn_utau0 = 0.5 ! uniform value for the i-stress289 rn_vtau0 = 0.e0 ! uniform value for the j-stress290 rn_qns0 = 0.e0 ! uniform value for the total heat flux291 rn_qsr0 = 0.e0 ! uniform value for the solar radiation292 rn_emp0 = 0.e0 ! uniform value for the freswater budget (E-P)293 213 / 294 214 !----------------------------------------------------------------------- … … 387 307 / 388 308 !----------------------------------------------------------------------- 389 &namsbc_sas ! analytical surface boundary condition309 &namsbc_sas ! Stand Alone Surface boundary condition 390 310 !----------------------------------------------------------------------- 391 311 ! ! file name ! frequency (hours) ! variable ! time interp. ! clim ! 'yearly'/ ! weights ! rotation ! land/sea mask ! … … 539 459 &namberg ! iceberg parameters (default: No iceberg) 540 460 !----------------------------------------------------------------------- 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 ! 567 ! 568 569 570 461 ln_icebergs = .false. ! iceberg floats or not 462 ln_bergdia = .true. ! Calculate budgets 463 nn_verbose_level = 1 ! Turn on more verbose output if level > 0 464 nn_verbose_write = 15 ! Timesteps between verbose messages 465 nn_sample_rate = 1 ! Timesteps between sampling for trajectory storage 466 ! Initial mass required for an iceberg of each class 467 rn_initial_mass = 8.8e7, 4.1e8, 3.3e9, 1.8e10, 3.8e10, 7.5e10, 1.2e11, 2.2e11, 3.9e11, 7.4e11 468 ! Proportion of calving mass to apportion to each class 469 rn_distribution = 0.24, 0.12, 0.15, 0.18, 0.12, 0.07, 0.03, 0.03, 0.03, 0.02 470 ! Ratio between effective and real iceberg mass (non-dim) 471 ! i.e. number of icebergs represented at a point 472 rn_mass_scaling = 2000, 200, 50, 20, 10, 5, 2, 1, 1, 1 473 ! thickness of newly calved bergs (m) 474 rn_initial_thickness = 40., 67., 133., 175., 250., 250., 250., 250., 250., 250. 475 rn_rho_bergs = 850. ! Density of icebergs 476 rn_LoW_ratio = 1.5 ! Initial ratio L/W for newly calved icebergs 477 ln_operator_splitting = .true. ! Use first order operator splitting for thermodynamics 478 rn_bits_erosion_fraction = 0. ! Fraction of erosion melt flux to divert to bergy bits 479 rn_sicn_shift = 0. ! Shift of sea-ice concn in erosion flux (0<sicn_shift<1) 480 ln_passive_mode = .false. ! iceberg - ocean decoupling 481 nn_test_icebergs = 10 ! Create test icebergs of this class (-1 = no) 482 ! Put a test iceberg at each gridpoint in box (lon1,lon2,lat1,lat2) 483 rn_test_box = 108.0, 116.0, -66.0, -58.0 484 rn_speed_limit = 0. ! CFL speed limit for a berg 485 486 ! ! file name ! frequency (hours) ! variable ! time interp. ! clim ! 'yearly'/ ! weights ! rotation ! land/sea mask ! 487 ! ! ! (if <0 months) ! name ! (logical) ! (T/F ) ! 'monthly' ! filename ! pairing ! filename ! 488 sn_icb = 'calving', -1 , 'calvingmask', .true. , .true. , 'yearly' , '' , '' , '' 489 490 cn_dir = './' 571 491 / 572 492 … … 600 520 &nam_tide ! tide parameters ("key_tide") 601 521 !----------------------------------------------------------------------- 602 ln_tide_pot = .true. ! use tidal potential forcing 603 ln_tide_ramp = .false. ! 604 rdttideramp = 0. ! 605 clname(1) = 'DUMMY' ! name of constituent - all tidal components must be set in namelist_cfg 522 ln_tide_pot = .true. ! use tidal potential forcing 523 ln_tide_ramp= .false. ! 524 rdttideramp = 0. ! 525 clname(1) = 'DUMMY' ! name of constituent 526 ! ! all tidal components must be set in namelist_cfg 606 527 / 607 528 !----------------------------------------------------------------------- 608 529 &nambdy ! unstructured open boundaries ("key_bdy") 609 530 !----------------------------------------------------------------------- 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 531 nb_bdy = 0 ! number of open boundary sets 532 ln_coords_file = .true. ! =T : read bdy coordinates from file 533 cn_coords_file = 'coordinates.bdy.nc' ! bdy coordinates files 534 ln_mask_file = .false. ! =T : read mask from file 535 cn_mask_file = '' ! name of mask file (if ln_mask_file=.TRUE.) 536 cn_dyn2d = 'none' ! 537 nn_dyn2d_dta = 0 ! = 0, bdy data are equal to the initial state 538 ! ! = 1, bdy data are read in 'bdydata .nc' files 539 ! ! = 2, use tidal harmonic forcing data from files 540 ! ! = 3, use external data AND tidal harmonic forcing 541 cn_dyn3d = 'none' ! 542 nn_dyn3d_dta = 0 ! = 0, bdy data are equal to the initial state 543 ! ! = 1, bdy data are read in 'bdydata .nc' files 544 cn_tra = 'none' ! 545 nn_tra_dta = 0 ! = 0, bdy data are equal to the initial state 546 ! ! = 1, bdy data are read in 'bdydata .nc' files 547 cn_ice_lim = 'none' ! 548 nn_ice_lim_dta = 0 ! = 0, bdy data are equal to the initial state 549 ! ! = 1, bdy data are read in 'bdydata .nc' files 550 rn_ice_tem = 270. ! lim3 only: arbitrary temperature of incoming sea ice 551 rn_ice_sal = 10. ! lim3 only: -- salinity -- 552 rn_ice_age = 30. ! lim3 only: -- age -- 553 ! 554 ln_tra_dmp =.false. ! open boudaries conditions for tracers 555 ln_dyn3d_dmp =.false. ! open boundary condition for baroclinic velocities 556 rn_time_dmp = 1. ! Damping time scale in days 557 rn_time_dmp_out = 1. ! Outflow damping time scale 558 nn_rimwidth = 10 ! width of the relaxation zone 559 ln_vol = .false. ! total volume correction (see nn_volctl parameter) 560 nn_volctl = 1 ! = 0, the total water flux across open boundaries is zero 640 561 / 641 562 !----------------------------------------------------------------------- … … 887 808 !----------------------------------------------------------------------- 888 809 ln_hpg_zco = .false. ! z-coordinate - full steps 889 ln_hpg_zps = . true.! z-coordinate - partial steps (interpolation)810 ln_hpg_zps = .false. ! z-coordinate - partial steps (interpolation) 890 811 ln_hpg_sco = .false. ! s-coordinate (standard jacobian formulation) 891 812 ln_hpg_isf = .false. ! s-coordinate (sco ) adapted to isf … … 1041 962 !!====================================================================== 1042 963 !! nammpp Massively Parallel Processing ("key_mpp_mpi) 1043 !! namctl Control prints & Benchmark964 !! namctl Control prints 1044 965 !! namsto Stochastic parametrization of EOS 1045 966 !!====================================================================== … … 1057 978 / 1058 979 !----------------------------------------------------------------------- 1059 &namctl ! Control prints & Benchmark980 &namctl ! Control prints 1060 981 !----------------------------------------------------------------------- 1061 982 ln_ctl = .false. ! trends control print (expensive!) … … 1067 988 nn_isplt = 1 ! number of processors in i-direction 1068 989 nn_jsplt = 1 ! number of processors in j-direction 1069 nn_bench = 0 ! Bench mode (1/0): CAUTION use zero except for bench1070 ! (no physical validity of the results)1071 990 nn_timing = 0 ! timing by routine activated (=1) creates timing.output file, or not (=0) 1072 991 nn_diacfl = 0 ! Write out CFL diagnostics (=1) in cfl_diagnostics.ascii, or not (=0) -
branches/2016/dev_CNRS_2016/NEMOGCM/CONFIG/cfg.txt
r6403 r7277 9 9 ORCA2_LIM OPA_SRC LIM_SRC_2 NST_SRC 10 10 ORCA2_OFF_PISCES OPA_SRC OFF_SRC TOP_SRC 11 ORCA2_LIM_PISCES OPA_SRC LIM_SRC_2 NST_SRC TOP_SRC 12 OVERFLOW OPA_SRC 13 LOCK_EXCHANGE OPA_SRC 11 14 GYRE OPA_SRC 12 ORCA2_LIM_PISCES OPA_SRC LIM_SRC_2 NST_SRC TOP_SRC15 ISOMIP OPA_SRC -
branches/2016/dev_CNRS_2016/NEMOGCM/CONFIG/makenemo
r5144 r7277 150 150 echo ""; 151 151 echo "Available unsupported (external) configurations :"; cat ${CONFIG_DIR}/uspcfg.txt; 152 echo ""; 153 echo "Example to install an unsupoorted configuration MY_USP"; 154 echo "makenemo -n MY_USP -u MY_USP" ; 152 155 echo ""; 153 156 echo "Example to remove bad configuration "; -
branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/LIM_SRC_2/dom_ice_2.F90
r3764 r7277 27 27 ! ! (otherwise = jpj+10 (SH) or -10 (SH) ) 28 28 29 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: fs2cor , fcor !: coriolis factor and coeficient30 29 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: covrai !: sine of geographic latitude 31 30 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: area !: surface of grid cell … … 48 47 ierr(:) = 0 49 48 ! 50 ALLOCATE( fs2cor(jpi,jpj) , fcor(jpi,jpj) , & 51 & covrai(jpi,jpj) , area(jpi,jpj) , tms(jpi,jpj) , tmu(jpi,jpj) , & 49 ALLOCATE( covrai(jpi,jpj) , area(jpi,jpj) , tms(jpi,jpj) , tmu(jpi,jpj) , & 52 50 & wght (jpi,jpj,2,2) , STAT=ierr(1) ) 53 51 ! -
branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/LIM_SRC_2/limdmp_2.F90
r5836 r7277 144 144 145 145 resto_ice(:,:,:) = 0._wp 146 ! Re-calculate the North and South boundary restoring term147 ! because those boundaries may change with the prescribed zoom area.148 146 ! 149 147 irelax = 16 ! width of buffer zone with respect to close boundary … … 156 154 ! REM: if there is no ice in the model and in the data, 157 155 ! no restoring even with non zero resto_ice 158 DO jj = mj0( jpjzoom - 1 + 1), mj1(jpjzoom -1 +irelax)159 zreltim = zdmpmin + zfactor * ( mjg(jj) - jpjzoom + 1)156 DO jj = mj0(1), mj1( irelax) 157 zreltim = zdmpmin + zfactor * mjg(jj) 160 158 resto_ice(:,jj,:) = 1._wp / ( zreltim * 86400._wp ) 161 159 END DO 162 160 163 161 ! North boundary restoring term 164 DO jj = mj0(jpj zoom -1 + jpjglo - irelax), mj1(jpjzoom - 1 +jpjglo)165 zreltim = zdmpmin + zfactor * (jpjglo - ( mjg(jj) - jpjzoom + 1))162 DO jj = mj0(jpjglo - irelax), mj1(jpjglo) 163 zreltim = zdmpmin + zfactor * (jpjglo - mjg(jj)) 166 164 resto_ice(:,jj,:) = 1.e0 / ( zreltim * 86400 ) 167 165 END DO -
branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/LIM_SRC_2/limistate_2.F90
r5541 r7277 69 69 IF( .NOT. ln_limini ) THEN 70 70 71 CALL eos_fzp( tsn(:,:,1,jp_sal), tfu(:,:) ) ! freezing/melting point of sea water [Cel cius]71 CALL eos_fzp( tsn(:,:,1,jp_sal), tfu(:,:) ) ! freezing/melting point of sea water [Celsius] 72 72 tfu(:,:) = tfu(:,:) * tmask(:,:,1) 73 73 … … 79 79 ENDIF 80 80 ! 81 IF( f cor(ji,jj) >= 0.e0) THEN !-- Northern hemisphere.81 IF( ff_t(ji,jj) >= 0._wp ) THEN !-- Northern hemisphere. 82 82 hicif(ji,jj) = zidto * hginn 83 83 frld(ji,jj) = zidto * alinn + ( 1.0 - zidto ) * 1.0 -
branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/LIM_SRC_2/limmsh_2.F90
r3625 r7277 70 70 ENDIF 71 71 72 IF( jphgr_msh == 2 .OR. jphgr_msh == 3 .OR. jphgr_msh == 5 ) &73 & CALL ctl_stop(' Coriolis parameter in LIM not set for f- or beta-plane' )74 75 72 !---------------------------------------------------------- 76 73 ! Initialization of local and some global (common) variables … … 79 76 njeq = INT( jpj / 2 ) !i bug mpp potentiel 80 77 njeqm1 = njeq - 1 81 82 fcor(:,:) = 2. * omega * SIN( gphit(:,:) * rad ) ! coriolis factor at T-point83 78 84 79 !i DO jj = 1, jpj … … 87 82 !i END DO 88 83 89 IF( f cor(1,1) * fcor(1,nlcj) < 0.e0 ) THEN ! local domain include both hemisphere84 IF( ff_t(1,1) * ff_t(1,nlcj) < 0.e0 ) THEN ! local domain include both hemisphere 90 85 l_jeq = .TRUE. 91 86 njeq = 1 92 DO WHILE ( njeq <= jpj .AND. f cor(1,njeq) < 0.e0 )87 DO WHILE ( njeq <= jpj .AND. ff_t(1,njeq) < 0.e0 ) 93 88 njeq = njeq + 1 94 89 END DO 95 90 IF(lwp ) WRITE(numout,*) ' the equator is inside the domain at about njeq = ', njeq 96 ELSEIF( f cor(1,1) < 0.e0 ) THEN91 ELSEIF( ff_t(1,1) < 0.e0 ) THEN 97 92 l_jeq = .FALSE. 98 93 njeq = jpj -
branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/LIM_SRC_2/limrhg_2.F90
r5836 r7277 163 163 DO ji = 1 , jpi 164 164 ! only the sinus changes its sign with the hemisphere 165 zsang(ji,jj) = SIGN( 1._wp, f cor(ji,jj) ) * sangvg ! only the sinus changes its sign with the hemisphere165 zsang(ji,jj) = SIGN( 1._wp, ff_t(ji,jj) ) * sangvg ! only the sinus changes its sign with the hemisphere 166 166 ! 167 167 zmasst(ji,jj) = tms(ji,jj) * ( rhosn * hsnm(ji,jj) + rhoic * hicm(ji,jj) ) … … 198 198 & + zmasst(ji,jj-1) * wght(ji,jj,2,1) + zmasst(ji-1,jj-1) * wght(ji,jj,1,1) ) * zusw 199 199 zcorl(ji,jj) = zmass(ji,jj) & 200 & *( f cor(ji,jj ) * wght(ji,jj,2,2) + fcor(ji-1,jj )*wght(ji,jj,1,2) &201 & + f cor(ji,jj-1) * wght(ji,jj,2,1) + fcor(ji-1,jj-1)*wght(ji,jj,1,1) ) * zusw200 & *( ff_t(ji,jj ) * wght(ji,jj,2,2) + ff_t(ji-1,jj )*wght(ji,jj,1,2) & 201 & + ff_t(ji,jj-1) * wght(ji,jj,2,1) + ff_t(ji-1,jj-1)*wght(ji,jj,1,1) ) * zusw 202 202 203 203 ! Wind stress. -
branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/LIM_SRC_2/limsbc_2.F90
r6140 r7277 449 449 soce_0(:,:) = soce ! constant SSS and ice salinity used in levitating sea-ice case 450 450 sice_0(:,:) = sice 451 ! 452 IF( cp_cfg == "orca" ) THEN ! decrease ocean & ice reference salinities in the Baltic sea 453 WHERE( 14._wp <= glamt(:,:) .AND. glamt(:,:) <= 32._wp .AND. & 454 & 54._wp <= gphit(:,:) .AND. gphit(:,:) <= 66._wp ) 455 soce_0(:,:) = 4._wp 456 sice_0(:,:) = 2._wp 457 END WHERE 458 ENDIF 451 ! ! decrease ocean & ice reference salinities in the Baltic sea 452 WHERE( 14._wp <= glamt(:,:) .AND. glamt(:,:) <= 32._wp .AND. & 453 & 54._wp <= gphit(:,:) .AND. gphit(:,:) <= 66._wp ) 454 soce_0(:,:) = 4._wp 455 sice_0(:,:) = 2._wp 456 END WHERE 459 457 ! ! embedded sea ice 460 458 IF( nn_ice_embd /= 0 ) THEN ! mass exchanges between ice and ocean (case 1 or 2) set the snow+ice mass … … 473 471 !!gm 474 472 IF( .NOT.ln_linssh ) THEN 475 476 do jk = 1,jpkm1 ! adjust initial vertical scale factors 473 DO jk = 1,jpkm1 ! adjust initial vertical scale factors 477 474 e3t_n(:,:,jk) = e3t_0(:,:,jk)*( 1._wp + sshn(:,:)*tmask(:,:,1)/(ht_0(:,:) + 1.0 - tmask(:,:,1)) ) 478 475 e3t_b(:,:,jk) = e3t_0(:,:,jk)*( 1._wp + sshb(:,:)*tmask(:,:,1)/(ht_0(:,:) + 1.0 - tmask(:,:,1)) ) 479 end do476 END DO 480 477 e3t_a(:,:,:) = e3t_b(:,:,:) 481 478 ! Reconstruction of all vertical scale factors at now and before time steps -
branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/LIM_SRC_2/limthd_2.F90
r6140 r7277 347 347 ! Tricky trick : add 2 to frld in the Southern Hemisphere 348 348 !-------------------------------------------------------- 349 IF( f cor(1,1) < 0.e0) THEN349 IF( ff_t(1,1) < 0._wp ) THEN 350 350 DO jj = 1, njeqm1 351 351 DO ji = 1, jpi … … 479 479 480 480 !! Fram Strait sea-ice transport (sea-ice + snow) (in ORCA2 = 5 points) 481 IF( iom_use('fram_trans') .and. c p_cfg == "orca" .AND. jp_cfg == 2 ) THEN ! ORCA R2 configuration481 IF( iom_use('fram_trans') .and. cn_cfg == "orca" .AND. nn_cfg == 2 ) THEN ! ORCA R2 configuration 482 482 DO jj = mj0(137), mj1(137) ! B grid 483 483 IF( mj0(jj-1) >= nldj ) THEN -
branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/LIM_SRC_2/limtrp_2.F90
r4624 r7277 234 234 !-------------------------------------------------------------------! 235 235 DO jj = 1, jpj 236 zindhe = MAX( 0. e0, SIGN( 1.e0, fcor(1,jj) ) ) ! = 0 for SH, =1 for NH236 zindhe = MAX( 0._wp, SIGN( 1._wp, ff_t(1,jj) ) ) ! = 0 for SH, =1 for NH 237 237 DO ji = 1, jpi 238 238 ! -
branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/LIM_SRC_3/dom_ice.F90
r5123 r7277 20 20 INTEGER, PUBLIC :: njeq , njeqm1 !: j-index of the equator if it is inside the domain 21 21 22 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: fcor !: coriolis coefficient23 22 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) :: wght !: weight of the 4 neighbours to compute averages 24 23 … … 37 36 !!------------------------------------------------------------------- 38 37 ! 39 ALLOCATE( fcor(jpi,jpj),wght(jpi,jpj,2,2), STAT = dom_ice_alloc )38 ALLOCATE( wght(jpi,jpj,2,2), STAT = dom_ice_alloc ) 40 39 ! 41 40 IF( dom_ice_alloc /= 0 ) CALL ctl_warn( 'dom_ice_alloc: failed to allocate arrays.' ) -
branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/LIM_SRC_3/limistate.F90
r6140 r7277 168 168 DO jj = 1, jpj 169 169 DO ji = 1, jpi 170 IF( f cor(ji,jj) >= 0._wp ) THEN170 IF( ff_t(ji,jj) >= 0._wp ) THEN 171 171 zht_i_ini(ji,jj) = rn_hti_ini_n 172 172 zht_s_ini(ji,jj) = rn_hts_ini_n -
branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/LIM_SRC_3/limmsh.F90
r5123 r7277 54 54 ENDIF 55 55 56 IF( jphgr_msh == 2 .OR. jphgr_msh == 3 .OR. jphgr_msh == 5 ) & 57 & CALL ctl_stop(' Coriolis parameter in LIM not set for f- or beta-plane') 58 59 ! !== coriolis factor & Equator position ==! 56 ! !== Equator position ==! 60 57 njeq = INT( jpj / 2 ) 61 58 njeqm1 = njeq - 1 62 59 ! 63 fcor(:,:) = 2. * omega * SIN( gphit(:,:) * rad ) ! coriolis factor 64 ! 65 IF( fcor(1,1) * fcor(1,nlcj) < 0.e0 ) THEN ! local domain include both hemisphere 60 IF( ff_t(1,1) * ff_t(1,nlcj) < 0._wp ) THEN ! local domain include both hemisphere 66 61 l_jeq = .TRUE. 67 62 njeq = 1 68 DO WHILE ( njeq <= jpj .AND. f cor(1,njeq) < 0.e0)63 DO WHILE ( njeq <= jpj .AND. ff_t(1,njeq) < 0._wp ) 69 64 njeq = njeq + 1 70 65 END DO 71 66 IF(lwp ) WRITE(numout,*) ' the equator is inside the domain at about njeq = ', njeq 72 ELSEIF( f cor(1,1) < 0.e0) THEN67 ELSEIF( ff_t(1,1) < 0._wp ) THEN 73 68 l_jeq = .FALSE. 74 69 njeq = jpj … … 84 79 85 80 ! !== metric coefficients for sea ice dynamic ==! 86 wght(:,:,:,:) = 0. e081 wght(:,:,:,:) = 0._wp 87 82 !!gm Optimisation : wght to be defined at F-point, not I-point and change in limrhg 88 83 DO jj = 2, jpj 89 84 DO ji = 2, jpi 90 zusden = 1. e0/ ( ( e1t(ji,jj) + e1t(ji-1,jj ) ) &91 & * ( e2t(ji,jj) + e2t(ji ,jj-1) ) )85 zusden = 1._wp / ( ( e1t(ji,jj) + e1t(ji-1,jj ) ) & 86 & * ( e2t(ji,jj) + e2t(ji ,jj-1) ) ) 92 87 wght(ji,jj,1,1) = zusden * e1t(ji ,jj) * e2t(ji,jj ) 93 88 wght(ji,jj,1,2) = zusden * e1t(ji ,jj) * e2t(ji,jj-1) -
branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/LIM_SRC_3/limrhg.F90
r5836 r7277 267 267 zmass1(ji,jj) = ( zt12 * zc1 + zt11 * zc2 ) / ( zt11 + zt12 + zepsi ) 268 268 zmass2(ji,jj) = ( zt22 * zc1 + zt21 * zc3 ) / ( zt21 + zt22 + zepsi ) 269 zcorl1(ji,jj) = zmass1(ji,jj) * ( e1t(ji+1,jj) * f cor(ji,jj) + e1t(ji,jj) * fcor(ji+1,jj) ) &269 zcorl1(ji,jj) = zmass1(ji,jj) * ( e1t(ji+1,jj) * ff_t(ji,jj) + e1t(ji,jj) * ff_t(ji+1,jj) ) & 270 270 & / ( e1t(ji,jj) + e1t(ji+1,jj) + zepsi ) 271 zcorl2(ji,jj) = zmass2(ji,jj) * ( e2t(ji,jj+1) * f cor(ji,jj) + e2t(ji,jj) * fcor(ji,jj+1) ) &271 zcorl2(ji,jj) = zmass2(ji,jj) * ( e2t(ji,jj+1) * ff_t(ji,jj) + e2t(ji,jj) * ff_t(ji,jj+1) ) & 272 272 & / ( e2t(ji,jj+1) + e2t(ji,jj) + zepsi ) 273 273 ! -
branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/LIM_SRC_3/limsbc.F90
r6140 r7277 316 316 soce_0(:,:) = soce ! constant SSS and ice salinity used in levitating sea-ice case 317 317 sice_0(:,:) = sice 318 ! 319 IF( cp_cfg == "orca" ) THEN ! decrease ocean & ice reference salinities in the Baltic sea 320 WHERE( 14._wp <= glamt(:,:) .AND. glamt(:,:) <= 32._wp .AND. & 321 & 54._wp <= gphit(:,:) .AND. gphit(:,:) <= 66._wp ) 322 soce_0(:,:) = 4._wp 323 sice_0(:,:) = 2._wp 324 END WHERE 325 ENDIF 318 ! ! decrease ocean & ice reference salinities in the Baltic Sea area 319 WHERE( 14._wp <= glamt(:,:) .AND. glamt(:,:) <= 32._wp .AND. & 320 & 54._wp <= gphit(:,:) .AND. gphit(:,:) <= 66._wp ) 321 soce_0(:,:) = 4._wp 322 sice_0(:,:) = 2._wp 323 END WHERE 326 324 ! 327 325 IF( .NOT. ln_rstart ) THEN … … 331 329 snwice_mass_b(:,:) = snwice_mass(:,:) 332 330 ELSE 333 snwice_mass (:,:) = 0. 0_wp! no mass exchanges334 snwice_mass_b(:,:) = 0. 0_wp! no mass exchanges331 snwice_mass (:,:) = 0._wp ! no mass exchanges 332 snwice_mass_b(:,:) = 0._wp ! no mass exchanges 335 333 ENDIF 336 334 IF( nn_ice_embd == 2 ) THEN ! full embedment (case 2) deplete the initial ssh below sea-ice area -
branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/LIM_SRC_3/thd_ice.F90
r6403 r7277 5 5 !!===================================================================== 6 6 !! History : 3.0 ! 2002-11 (C. Ethe) F90: Free form and module 7 !!---------------------------------------------------------------------- 8 #if defined key_lim3 9 !!---------------------------------------------------------------------- 10 !! 'key_lim3' LIM3 sea-ice model 7 11 !!---------------------------------------------------------------------- 8 12 USE in_out_manager ! I/O manager … … 175 179 END FUNCTION thd_ice_alloc 176 180 181 #else 182 !!---------------------------------------------------------------------- 183 !! Default option : Empty module NO LIM sea-ice model 184 !!---------------------------------------------------------------------- 185 CONTAINS 186 SUBROUTINE thd_ice_alloc ! Empty routine 187 END SUBROUTINE thd_ice_alloc 188 #endif 189 177 190 !!====================================================================== 178 191 END MODULE thd_ice -
branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/NST_SRC/agrif_user.F90
r6140 r7277 1 1 #if defined key_agrif 2 2 !!---------------------------------------------------------------------- 3 !! NEMO/NST 3.7 , NEMO Consortium (201 5)3 !! NEMO/NST 3.7 , NEMO Consortium (2016) 4 4 !! $Id$ 5 5 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) … … 18 18 USE dom_oce 19 19 USE nemogcm 20 ! 20 !! 21 21 IMPLICIT NONE 22 22 !!---------------------------------------------------------------------- … … 32 32 ! JC: change to allow for different vertical levels 33 33 ! jpk is already set 34 ! keep it jpk possibly different from jpk dtawhich34 ! keep it jpk possibly different from jpkglo which 35 35 ! hold parent grid vertical levels number (set earlier) 36 ! jpk = jpk dta36 ! jpk = jpkglo 37 37 jpim1 = jpi-1 38 38 jpjm1 = jpj-1 39 39 jpkm1 = jpk-1 40 40 jpij = jpi*jpj 41 jpidta = jpiglo 42 jpjdta = jpjglo 43 jpizoom = 1 44 jpjzoom = 1 41 !SF jpidta = jpiglo 42 !SF jpjdta = jpjglo 45 43 nperio = 0 46 44 jperio = 0 … … 62 60 USE tradmp 63 61 USE bdy_par 64 65 IMPLICIT NONE 66 !!---------------------------------------------------------------------- 67 ! 0. Initializations68 !------------------- 69 IF( cp_cfg == 'orca' ) THEN 70 IF ( jp_cfg == 2 .OR. jp_cfg == 025 .OR. jp_cfg == 05 &71 & .OR. jp_cfg == 4 ) THEN72 jp_cfg = -1 ! set special value for jp_cfg on fine grids73 c p_cfg = "default"62 !! 63 IMPLICIT NONE 64 !!---------------------------------------------------------------------- 65 ! 66 !!gm I think this is now useless ... nn_cfg & cn_cfg are set to -999999 and "UNKNOWN" 67 !!gm when reading the AGRIF domain configuration file 68 IF( cn_cfg == 'orca' ) THEN 69 IF ( nn_cfg == 2 .OR. nn_cfg == 025 .OR. nn_cfg == 05 .OR. nn_cfg == 4 ) THEN 70 nn_cfg = -1 ! set special value for nn_cfg on fine grids 71 cn_cfg = "default" 74 72 ENDIF 75 73 ENDIF 76 ! Specific fine grid Initializations 77 ! no tracer damping on fine grids 78 ln_tradmp = .FALSE. 79 ! no open boundary on fine grids 80 lk_bdy = .FALSE. 81 82 83 CALL nemo_init ! Initializations of each fine grid 84 74 !!gm end 75 76 ! !* Specific fine grid Initializations 77 ln_tradmp = .FALSE. ! no tracer damping on fine grids 78 ! 79 lk_bdy = .FALSE. ! no open boundary on fine grids 80 81 CALL nemo_init !* Initializations of each fine grid 82 83 ! !* Agrif initialization 85 84 CALL agrif_nemo_init 86 85 CALL Agrif_InitValues_cont_dom … … 90 89 # if defined key_top 91 90 CALL Agrif_InitValues_cont_top 92 # endif 91 # endif 92 ! 93 93 END SUBROUTINE Agrif_initvalues 94 94 … … 108 108 USE agrif_opa_interp 109 109 USE agrif_opa_sponge 110 ! 111 IMPLICIT NONE 112 ! 113 !!---------------------------------------------------------------------- 114 110 !! 111 IMPLICIT NONE 112 !!---------------------------------------------------------------------- 113 ! 115 114 ! Declaration of the type of variable which have to be interpolated 116 ! ---------------------------------------------------------------------115 ! 117 116 CALL agrif_declare_var_dom 118 117 ! … … 129 128 USE par_oce 130 129 USE oce 130 !! 131 131 IMPLICIT NONE 132 132 !!---------------------------------------------------------------------- … … 176 176 USE agrif_opa_interp 177 177 USE agrif_opa_sponge 178 ! 178 !! 179 179 IMPLICIT NONE 180 180 ! … … 259 259 260 260 ! Check coordinates 261 IF( ln_zps ) THEN262 ! check parameters for partial steps263 IF( Agrif_Parent(e3zps_min) .NE. e3zps_min ) THEN264 WRITE(*,*) 'incompatible e3zps_min between grids'265 WRITE(*,*) 'parent grid :',Agrif_Parent(e3zps_min)266 WRITE(*,*) 'child grid :',e3zps_min267 WRITE(*,*) 'those values should be identical'268 STOP269 ENDIF270 IF( Agrif_Parent(e3zps_rat) /= e3zps_rat ) THEN271 WRITE(*,*) 'incompatible e3zps_rat between grids'272 WRITE(*,*) 'parent grid :',Agrif_Parent(e3zps_rat)273 WRITE(*,*) 'child grid :',e3zps_rat274 WRITE(*,*) 'those values should be identical'275 STOP276 ENDIF277 ENDIF261 !SF IF( ln_zps ) THEN 262 !SF ! check parameters for partial steps 263 !SF IF( Agrif_Parent(e3zps_min) .NE. e3zps_min ) THEN 264 !SF WRITE(*,*) 'incompatible e3zps_min between grids' 265 !SF WRITE(*,*) 'parent grid :',Agrif_Parent(e3zps_min) 266 !SF WRITE(*,*) 'child grid :',e3zps_min 267 !SF WRITE(*,*) 'those values should be identical' 268 !SF STOP 269 !SF ENDIF 270 !SF IF( Agrif_Parent(e3zps_rat) /= e3zps_rat ) THEN 271 !SF WRITE(*,*) 'incompatible e3zps_rat between grids' 272 !SF WRITE(*,*) 'parent grid :',Agrif_Parent(e3zps_rat) 273 !SF WRITE(*,*) 'child grid :',e3zps_rat 274 !SF WRITE(*,*) 'those values should be identical' 275 !SF STOP 276 !SF ENDIF 277 !SF ENDIF 278 278 279 279 ! Check free surface scheme … … 346 346 USE oce 347 347 USE agrif_oce 348 !! 348 349 IMPLICIT NONE 349 350 !!---------------------------------------------------------------------- … … 484 485 USE agrif_lim2_interp 485 486 USE lib_mpp 486 ! 487 IMPLICIT NONE 488 ! 487 !! 488 IMPLICIT NONE 489 489 !!---------------------------------------------------------------------- 490 490 … … 521 521 END SUBROUTINE Agrif_InitValues_cont_lim2 522 522 523 523 524 SUBROUTINE agrif_declare_var_lim2 524 525 !!---------------------------------------------------------------------- … … 529 530 USE agrif_util 530 531 USE ice_2 531 532 !! 532 533 IMPLICIT NONE 533 534 !!---------------------------------------------------------------------- … … 585 586 USE agrif_top_interp 586 587 USE agrif_top_sponge 587 ! 588 !! 588 589 IMPLICIT NONE 589 590 ! … … 684 685 USE dom_oce 685 686 USE trc 686 687 IMPLICIT NONE 687 !! 688 IMPLICIT NONE 689 !!---------------------------------------------------------------------- 688 690 689 691 ! 1. Declaration of the type of variable which have to be interpolated … … 716 718 SUBROUTINE Agrif_detect( kg, ksizex ) 717 719 !!---------------------------------------------------------------------- 718 !! *** ROUTINE Agrif_detect *** 719 !!---------------------------------------------------------------------- 720 ! 720 !! *** ROUTINE Agrif_detect *** 721 !!---------------------------------------------------------------------- 721 722 INTEGER, DIMENSION(2) :: ksizex 722 723 INTEGER, DIMENSION(ksizex(1),ksizex(2)) :: kg … … 736 737 USE in_out_manager 737 738 USE lib_mpp 739 !! 738 740 IMPLICIT NONE 739 741 ! … … 789 791 !!---------------------------------------------------------------------- 790 792 USE dom_oce 793 !! 791 794 IMPLICIT NONE 792 795 ! … … 803 806 END SUBROUTINE Agrif_InvLoc 804 807 808 805 809 SUBROUTINE Agrif_get_proc_info( imin, imax, jmin, jmax ) 806 810 !!---------------------------------------------------------------------- … … 808 812 !!---------------------------------------------------------------------- 809 813 USE par_oce 814 !! 810 815 IMPLICIT NONE 811 816 ! … … 821 826 END SUBROUTINE Agrif_get_proc_info 822 827 828 823 829 SUBROUTINE Agrif_estimate_parallel_cost(imin, imax,jmin, jmax, nbprocs, grid_cost) 824 830 !!---------------------------------------------------------------------- … … 826 832 !!---------------------------------------------------------------------- 827 833 USE par_oce 834 !! 828 835 IMPLICIT NONE 829 836 ! -
branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OFF_SRC/dtadyn.F90
r6140 r7277 22 22 USE c1d ! 1D configuration: lk_c1d 23 23 USE dom_oce ! ocean domain: variables 24 USE domvvl ! variable volume 24 25 USE zdf_oce ! ocean vertical physics: variables 25 26 USE sbc_oce ! surface module: variables 26 27 USE trc_oce ! share ocean/biogeo variables 27 28 USE phycst ! physical constants 28 USE ldftra ! lateral diffusivity coefficients29 29 USE trabbl ! active tracer: bottom boundary layer 30 30 USE ldfslp ! lateral diffusion: iso-neutral slopes 31 USE sbcrnf ! river runoffs 32 USE ldftra ! ocean tracer lateral physics 31 33 USE zdfmxl ! vertical physics: mixed layer depth 32 34 USE eosbn2 ! equation of state - Brunt Vaisala frequency … … 38 40 USE prtctl ! print control 39 41 USE fldread ! read input fields 42 USE wrk_nemo ! Memory allocation 40 43 USE timing ! Timing 41 USE wrk_nemo44 USE trc, ONLY : ln_rsttr, numrtr, numrtw, lrst_trc 42 45 43 46 IMPLICIT NONE … … 46 49 PUBLIC dta_dyn_init ! called by opa.F90 47 50 PUBLIC dta_dyn ! called by step.F90 48 49 CHARACTER(len=100) :: cn_dir !: Root directory for location of ssr files 50 LOGICAL :: ln_dynwzv !: vertical velocity read in a file (T) or computed from u/v (F) 51 LOGICAL :: ln_dynbbl !: bbl coef read in a file (T) or computed (F) 52 LOGICAL :: ln_dynrnf !: read runoff data in file (T) or set to zero (F) 53 54 INTEGER , PARAMETER :: jpfld = 15 ! maximum number of fields to read 51 PUBLIC dta_dyn_swp ! called by step.F90 52 53 CHARACTER(len=100) :: cn_dir !: Root directory for location of ssr files 54 LOGICAL :: ln_dynrnf !: read runoff data in file (T) or set to zero (F) 55 LOGICAL :: ln_dynrnf_depth !: read runoff data in file (T) or set to zero (F) 56 REAL(wp) :: fwbcorr 57 58 59 INTEGER , PARAMETER :: jpfld = 20 ! maximum number of fields to read 55 60 INTEGER , SAVE :: jf_tem ! index of temperature 56 61 INTEGER , SAVE :: jf_sal ! index of salinity 57 INTEGER , SAVE :: jf_uwd ! index of u- wind58 INTEGER , SAVE :: jf_vwd ! index of v- wind59 INTEGER , SAVE :: jf_wwd ! index of w-wind62 INTEGER , SAVE :: jf_uwd ! index of u-transport 63 INTEGER , SAVE :: jf_vwd ! index of v-transport 64 INTEGER , SAVE :: jf_wwd ! index of v-transport 60 65 INTEGER , SAVE :: jf_avt ! index of Kz 61 66 INTEGER , SAVE :: jf_mld ! index of mixed layer deptht 62 67 INTEGER , SAVE :: jf_emp ! index of water flux 68 INTEGER , SAVE :: jf_empb ! index of water flux 63 69 INTEGER , SAVE :: jf_qsr ! index of solar radiation 64 70 INTEGER , SAVE :: jf_wnd ! index of wind speed 65 71 INTEGER , SAVE :: jf_ice ! index of sea ice cover 66 72 INTEGER , SAVE :: jf_rnf ! index of river runoff 73 INTEGER , SAVE :: jf_fmf ! index of downward salt flux 67 74 INTEGER , SAVE :: jf_ubl ! index of u-bbl coef 68 75 INTEGER , SAVE :: jf_vbl ! index of v-bbl coef 69 INTEGER , SAVE :: jf_fmf ! index of downward salt flux 70 71 TYPE(FLD), ALLOCATABLE, DIMENSION(:) :: sf_dyn ! structure of input fields (file informations, fields read) 76 INTEGER , SAVE :: jf_div ! index of e3t 77 78 79 TYPE(FLD), ALLOCATABLE, SAVE, DIMENSION(:) :: sf_dyn ! structure of input fields (file informations, fields read) 72 80 ! ! 73 REAL(wp) , ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) :: wdta ! vertical velocity at 2 time step74 REAL(wp) , ALLOCATABLE, SAVE, DIMENSION(:,:,: ) :: wnow ! vertical velocity at 2 time step75 81 REAL(wp) , ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) :: uslpdta ! zonal isopycnal slopes 76 82 REAL(wp) , ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) :: vslpdta ! meridional isopycnal slopes 77 83 REAL(wp) , ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) :: wslpidta ! zonal diapycnal slopes 78 84 REAL(wp) , ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) :: wslpjdta ! meridional diapycnal slopes 79 REAL(wp) , ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: uslpnow ! zonal isopycnal slopes 80 REAL(wp) , ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: vslpnow ! meridional isopycnal slopes 81 REAL(wp) , ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: wslpinow ! zonal diapycnal slopes 82 REAL(wp) , ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: wslpjnow ! meridional diapycnal slopes 83 84 INTEGER :: nrecprev_tem , nrecprev_uwd 85 86 !! * Substitutions 87 # include "vectopt_loop_substitute.h90" 85 86 INTEGER, SAVE :: nprevrec, nsecdyn 87 88 88 89 !!---------------------------------------------------------------------- 89 90 !! NEMO/OFF 3.3 , NEMO Consortium (2010) … … 104 105 !! - interpolates data if needed 105 106 !!---------------------------------------------------------------------- 106 USE oce, ONLY: zts => tsa 107 USE oce, ONLY: zuslp => ua , zvslp => va 108 USE oce, ONLY: zu => ub , zv => vb, zw => rke 109 ! 107 ! 108 USE oce, ONLY: zhdivtr => ua 110 109 INTEGER, INTENT(in) :: kt ! ocean time-step index 111 ! 112 REAL(wp), DIMENSION(jpi,jpj,jpk ) :: zwslpi, zwslpj 113 ! REAL(wp), DIMENSION(jpi,jpj,jpk,jpts) :: zts 114 ! REAL(wp), DIMENSION(jpi,jpj,jpk ) :: zuslp, zvslp, zwslpi, zwslpj 115 ! REAL(wp), DIMENSION(jpi,jpj,jpk ) :: zu, zv, zw 116 ! 117 ! 118 INTEGER :: ji, jj ! dummy loop indices 119 INTEGER :: isecsbc ! number of seconds between Jan. 1st 00h of nit000 year and the middle of time step 120 REAL(wp) :: ztinta ! ratio applied to after records when doing time interpolation 121 REAL(wp) :: ztintb ! ratio applied to before records when doing time interpolation 122 INTEGER :: iswap_tem, iswap_uwd ! 110 INTEGER :: ji, jj, jk 111 REAL(wp), POINTER, DIMENSION(:,:) :: zemp 112 ! 123 113 !!---------------------------------------------------------------------- 124 114 … … 126 116 IF( nn_timing == 1 ) CALL timing_start( 'dta_dyn') 127 117 ! 128 isecsbc = nsec_year + nsec1jan000 129 ! 130 IF( kt == nit000 ) THEN 131 nrecprev_tem = 0 132 nrecprev_uwd = 0 133 ! 134 CALL fld_read( kt, 1, sf_dyn ) !== read data at kt time step ==! 135 ! 136 IF( l_ldfslp .AND. .NOT.lk_c1d .AND. sf_dyn(jf_tem)%ln_tint ) THEN ! Computes slopes (here avt is used as workspace) 137 zts(:,:,:,jp_tem) = sf_dyn(jf_tem)%fdta(:,:,:,1) * tmask(:,:,:) ! temperature 138 zts(:,:,:,jp_sal) = sf_dyn(jf_sal)%fdta(:,:,:,1) * tmask(:,:,:) ! salinity 139 avt(:,:,:) = sf_dyn(jf_avt)%fdta(:,:,:,1) * tmask(:,:,:) ! vertical diffusive coef. 140 CALL dta_dyn_slp( kt, zts, zuslp, zvslp, zwslpi, zwslpj ) 141 uslpdta (:,:,:,1) = zuslp (:,:,:) 142 vslpdta (:,:,:,1) = zvslp (:,:,:) 143 wslpidta(:,:,:,1) = zwslpi(:,:,:) 144 wslpjdta(:,:,:,1) = zwslpj(:,:,:) 145 ENDIF 146 IF( ln_dynwzv .AND. sf_dyn(jf_uwd)%ln_tint ) THEN ! compute vertical velocity from u/v 147 zu(:,:,:) = sf_dyn(jf_uwd)%fdta(:,:,:,1) 148 zv(:,:,:) = sf_dyn(jf_vwd)%fdta(:,:,:,1) 149 CALL dta_dyn_wzv( zu, zv, zw ) 150 wdta(:,:,:,1) = zw(:,:,:) * tmask(:,:,:) 151 ENDIF 152 ELSE 153 nrecprev_tem = sf_dyn(jf_tem)%nrec_a(2) 154 nrecprev_uwd = sf_dyn(jf_uwd)%nrec_a(2) 155 ! 156 CALL fld_read( kt, 1, sf_dyn ) !== read data at kt time step ==! 157 ! 158 ENDIF 159 ! 160 IF( l_ldfslp .AND. .NOT.lk_c1d ) THEN ! Computes slopes (here avt is used as workspace) 161 iswap_tem = 0 162 IF( kt /= nit000 .AND. ( sf_dyn(jf_tem)%nrec_a(2) - nrecprev_tem ) /= 0 ) iswap_tem = 1 163 IF( ( isecsbc > sf_dyn(jf_tem)%nrec_b(2) .AND. iswap_tem == 1 ) .OR. kt == nit000 ) THEN ! read/update the after data 164 IF(lwp) WRITE(numout,*) ' Compute new slopes at kt = ', kt 165 IF( sf_dyn(jf_tem)%ln_tint ) THEN ! time interpolation of data 166 IF( kt /= nit000 ) THEN 167 uslpdta (:,:,:,1) = uslpdta (:,:,:,2) ! swap the data 168 vslpdta (:,:,:,1) = vslpdta (:,:,:,2) 169 wslpidta(:,:,:,1) = wslpidta(:,:,:,2) 170 wslpjdta(:,:,:,1) = wslpjdta(:,:,:,2) 171 ENDIF 172 ! 173 zts(:,:,:,jp_tem) = sf_dyn(jf_tem)%fdta(:,:,:,2) * tmask(:,:,:) ! temperature 174 zts(:,:,:,jp_sal) = sf_dyn(jf_sal)%fdta(:,:,:,2) * tmask(:,:,:) ! salinity 175 avt(:,:,:) = sf_dyn(jf_avt)%fdta(:,:,:,2) * tmask(:,:,:) ! vertical diffusive coef. 176 CALL dta_dyn_slp( kt, zts, zuslp, zvslp, zwslpi, zwslpj ) 177 ! 178 uslpdta (:,:,:,2) = zuslp (:,:,:) 179 vslpdta (:,:,:,2) = zvslp (:,:,:) 180 wslpidta(:,:,:,2) = zwslpi(:,:,:) 181 wslpjdta(:,:,:,2) = zwslpj(:,:,:) 182 ELSE 183 zts(:,:,:,jp_tem) = sf_dyn(jf_tem)%fnow(:,:,:) * tmask(:,:,:) 184 zts(:,:,:,jp_sal) = sf_dyn(jf_sal)%fnow(:,:,:) * tmask(:,:,:) 185 avt(:,:,:) = sf_dyn(jf_avt)%fnow(:,:,:) * tmask(:,:,:) 186 CALL dta_dyn_slp( kt, zts, zuslp, zvslp, zwslpi, zwslpj ) 187 uslpnow (:,:,:) = zuslp (:,:,:) 188 vslpnow (:,:,:) = zvslp (:,:,:) 189 wslpinow(:,:,:) = zwslpi(:,:,:) 190 wslpjnow(:,:,:) = zwslpj(:,:,:) 191 ENDIF 192 ENDIF 193 IF( sf_dyn(jf_tem)%ln_tint ) THEN 194 ztinta = REAL( isecsbc - sf_dyn(jf_tem)%nrec_b(2), wp ) & 195 & / REAL( sf_dyn(jf_tem)%nrec_a(2) - sf_dyn(jf_tem)%nrec_b(2), wp ) 196 ztintb = 1. - ztinta 197 uslp (:,:,:) = ztintb * uslpdta (:,:,:,1) + ztinta * uslpdta (:,:,:,2) 198 vslp (:,:,:) = ztintb * vslpdta (:,:,:,1) + ztinta * vslpdta (:,:,:,2) 199 wslpi(:,:,:) = ztintb * wslpidta(:,:,:,1) + ztinta * wslpidta(:,:,:,2) 200 wslpj(:,:,:) = ztintb * wslpjdta(:,:,:,1) + ztinta * wslpjdta(:,:,:,2) 201 ELSE 202 uslp (:,:,:) = uslpnow (:,:,:) 203 vslp (:,:,:) = vslpnow (:,:,:) 204 wslpi(:,:,:) = wslpinow(:,:,:) 205 wslpj(:,:,:) = wslpjnow(:,:,:) 206 ENDIF 207 ENDIF 208 ! 209 IF( ln_dynwzv ) THEN ! compute vertical velocity from u/v 210 iswap_uwd = 0 211 IF( kt /= nit000 .AND. ( sf_dyn(jf_uwd)%nrec_a(2) - nrecprev_uwd ) /= 0 ) iswap_uwd = 1 212 IF( ( isecsbc > sf_dyn(jf_uwd)%nrec_b(2) .AND. iswap_uwd == 1 ) .OR. kt == nit000 ) THEN ! read/update the after data 213 IF(lwp) WRITE(numout,*) ' Compute new vertical velocity at kt = ', kt 214 IF(lwp) WRITE(numout,*) 215 IF( sf_dyn(jf_uwd)%ln_tint ) THEN ! time interpolation of data 216 IF( kt /= nit000 ) THEN 217 wdta(:,:,:,1) = wdta(:,:,:,2) ! swap the data for initialisation 218 ENDIF 219 zu(:,:,:) = sf_dyn(jf_uwd)%fdta(:,:,:,2) 220 zv(:,:,:) = sf_dyn(jf_vwd)%fdta(:,:,:,2) 221 CALL dta_dyn_wzv( zu, zv, zw ) 222 wdta(:,:,:,2) = zw(:,:,:) * tmask(:,:,:) 223 ELSE 224 zu(:,:,:) = sf_dyn(jf_uwd)%fnow(:,:,:) 225 zv(:,:,:) = sf_dyn(jf_vwd)%fnow(:,:,:) 226 CALL dta_dyn_wzv( zu, zv, zw ) 227 wnow(:,:,:) = zw(:,:,:) * tmask(:,:,:) 228 ENDIF 229 ENDIF 230 IF( sf_dyn(jf_uwd)%ln_tint ) THEN 231 ztinta = REAL( isecsbc - sf_dyn(jf_uwd)%nrec_b(2), wp ) & 232 & / REAL( sf_dyn(jf_uwd)%nrec_a(2) - sf_dyn(jf_uwd)%nrec_b(2), wp ) 233 ztintb = 1. - ztinta 234 wn(:,:,:) = ztintb * wdta(:,:,:,1) + ztinta * wdta(:,:,:,2) 235 ELSE 236 wn(:,:,:) = wnow(:,:,:) 237 ENDIF 238 ENDIF 118 nsecdyn = nsec_year + nsec1jan000 ! number of seconds between Jan. 1st 00h of nit000 year and the middle of time step 119 ! 120 IF( kt == nit000 ) THEN ; nprevrec = 0 121 ELSE ; nprevrec = sf_dyn(jf_tem)%nrec_a(2) 122 ENDIF 123 CALL fld_read( kt, 1, sf_dyn ) != read data at kt time step ==! 124 ! 125 IF( l_ldfslp .AND. .NOT.lk_c1d ) CALL dta_dyn_slp( kt ) ! Computation of slopes 239 126 ! 240 127 tsn(:,:,:,jp_tem) = sf_dyn(jf_tem)%fnow(:,:,:) * tmask(:,:,:) ! temperature 241 128 tsn(:,:,:,jp_sal) = sf_dyn(jf_sal)%fnow(:,:,:) * tmask(:,:,:) ! salinity 242 ! 129 wndm(:,:) = sf_dyn(jf_wnd)%fnow(:,:,1) * tmask(:,:,1) ! wind speed - needed for gas exchange 130 fmmflx(:,:) = sf_dyn(jf_fmf)%fnow(:,:,1) * tmask(:,:,1) ! downward salt flux (v3.5+) 131 fr_i(:,:) = sf_dyn(jf_ice)%fnow(:,:,1) * tmask(:,:,1) ! Sea-ice fraction 132 qsr (:,:) = sf_dyn(jf_qsr)%fnow(:,:,1) * tmask(:,:,1) ! solar radiation 133 emp (:,:) = sf_dyn(jf_emp)%fnow(:,:,1) * tmask(:,:,1) ! E-P 134 IF( ln_dynrnf ) THEN 135 rnf (:,:) = sf_dyn(jf_rnf)%fnow(:,:,1) * tmask(:,:,1) ! E-P 136 IF( ln_dynrnf_depth .AND. .NOT. ln_linssh ) CALL dta_dyn_hrnf 137 ENDIF 138 ! 139 un(:,:,:) = sf_dyn(jf_uwd)%fnow(:,:,:) * umask(:,:,:) ! effective u-transport 140 vn(:,:,:) = sf_dyn(jf_vwd)%fnow(:,:,:) * vmask(:,:,:) ! effective v-transport 141 wn(:,:,:) = sf_dyn(jf_wwd)%fnow(:,:,:) * tmask(:,:,:) ! effective v-transport 142 ! 143 IF( .NOT.ln_linssh ) THEN 144 CALL wrk_alloc(jpi, jpj, zemp ) 145 zhdivtr(:,:,:) = sf_dyn(jf_div)%fnow(:,:,:) * tmask(:,:,:) ! effective u-transport 146 emp_b (:,:) = sf_dyn(jf_empb)%fnow(:,:,1) * tmask(:,:,1) ! E-P 147 zemp (:,:) = 0.5_wp * ( emp(:,:) + emp_b(:,:) ) + rnf(:,:) + fwbcorr * tmask(:,:,1) 148 CALL dta_dyn_ssh( kt, zhdivtr, sshb, zemp, ssha, e3t_a(:,:,:) ) != ssh, vertical scale factor & vertical transport 149 CALL wrk_dealloc(jpi, jpj, zemp ) 150 ! Write in the tracer restart file 151 ! ******************************* 152 IF( lrst_trc ) THEN 153 IF(lwp) WRITE(numout,*) 154 IF(lwp) WRITE(numout,*) 'dta_dyn_ssh : ssh field written in tracer restart file ', & 155 & 'at it= ', kt,' date= ', ndastp 156 IF(lwp) WRITE(numout,*) '~~~~' 157 CALL iom_rstput( kt, nitrst, numrtw, 'sshn', ssha ) 158 CALL iom_rstput( kt, nitrst, numrtw, 'sshb', sshn ) 159 ENDIF 160 ENDIF 243 161 ! 244 162 CALL eos ( tsn, rhd, rhop, gdept_0(:,:,:) ) ! In any case, we need rhop … … 247 165 248 166 rn2b(:,:,:) = rn2(:,:,:) ! need for zdfmxl 249 CALL zdf_mxl( kt ) ! In any case, we need mxl 250 ! 251 avt(:,:,:) = sf_dyn(jf_avt)%fnow(:,:,:) * tmask(:,:,:) ! vertical diffusive coefficient 252 un (:,:,:) = sf_dyn(jf_uwd)%fnow(:,:,:) * umask(:,:,:) ! u-velocity 253 vn (:,:,:) = sf_dyn(jf_vwd)%fnow(:,:,:) * vmask(:,:,:) ! v-velocity 254 IF( .NOT.ln_dynwzv ) & ! w-velocity read in file 255 wn (:,:,:) = sf_dyn(jf_wwd)%fnow(:,:,:) * tmask(:,:,:) 256 hmld(:,:) = sf_dyn(jf_mld)%fnow(:,:,1) * tmask(:,:,1) ! mixed layer depht 257 wndm(:,:) = sf_dyn(jf_wnd)%fnow(:,:,1) * tmask(:,:,1) ! wind speed - needed for gas exchange 258 emp (:,:) = sf_dyn(jf_emp)%fnow(:,:,1) * tmask(:,:,1) ! E-P 259 fmmflx(:,:) = sf_dyn(jf_fmf)%fnow(:,:,1) * tmask(:,:,1) ! downward salt flux (v3.5+) 260 fr_i(:,:) = sf_dyn(jf_ice)%fnow(:,:,1) * tmask(:,:,1) ! Sea-ice fraction 261 qsr (:,:) = sf_dyn(jf_qsr)%fnow(:,:,1) * tmask(:,:,1) ! solar radiation 262 IF( ln_dynrnf ) & 263 rnf (:,:) = sf_dyn(jf_rnf)%fnow(:,:,1) * tmask(:,:,1) ! river runoffs 264 265 ! ! update eddy diffusivity coeff. and/or eiv coeff. at kt 266 IF( l_ldftra_time .OR. l_ldfeiv_time ) CALL ldf_tra( kt ) 267 ! ! bbl diffusive coef 167 CALL zdf_mxl( kt ) ! In any case, we need mxl 168 ! 169 hmld(:,:) = sf_dyn(jf_mld)%fnow(:,:,1) * tmask(:,:,1) ! mixed layer depht 170 avt(:,:,:) = sf_dyn(jf_avt)%fnow(:,:,:) * tmask(:,:,:) ! vertical diffusive coefficient 171 ! 268 172 #if defined key_trabbl && ! defined key_c1d 269 IF( ln_dynbbl ) THEN ! read in a file 270 ahu_bbl(:,:) = sf_dyn(jf_ubl)%fnow(:,:,1) * umask(:,:,1) 271 ahv_bbl(:,:) = sf_dyn(jf_vbl)%fnow(:,:,1) * vmask(:,:,1) 272 ELSE ! Compute bbl coefficients if needed 273 tsb(:,:,:,:) = tsn(:,:,:,:) 274 CALL bbl( kt, nit000, 'TRC') 275 END IF 173 ahu_bbl(:,:) = sf_dyn(jf_ubl)%fnow(:,:,1) * umask(:,:,1) ! bbl diffusive coef 174 ahv_bbl(:,:) = sf_dyn(jf_vbl)%fnow(:,:,1) * vmask(:,:,1) 276 175 #endif 176 ! 177 ! 178 CALL eos( tsn, rhd, rhop, gdept_0(:,:,:) ) ! In any case, we need rhop 277 179 ! 278 180 IF(ln_ctl) THEN ! print control … … 283 185 CALL prt_ctl(tab3d_1=wn , clinfo1=' wn - : ', mask1=tmask, ovlap=1, kdim=jpk ) 284 186 CALL prt_ctl(tab3d_1=avt , clinfo1=' kz - : ', mask1=tmask, ovlap=1, kdim=jpk ) 285 CALL prt_ctl(tab2d_1=fr_i , clinfo1=' fr_i - : ', mask1=tmask, ovlap=1 ) 286 CALL prt_ctl(tab2d_1=hmld , clinfo1=' hmld - : ', mask1=tmask, ovlap=1 ) 287 CALL prt_ctl(tab2d_1=fmmflx , clinfo1=' fmmflx - : ', mask1=tmask, ovlap=1 ) 288 CALL prt_ctl(tab2d_1=emp , clinfo1=' emp - : ', mask1=tmask, ovlap=1 ) 289 CALL prt_ctl(tab2d_1=wndm , clinfo1=' wspd - : ', mask1=tmask, ovlap=1 ) 290 CALL prt_ctl(tab2d_1=qsr , clinfo1=' qsr - : ', mask1=tmask, ovlap=1 ) 187 CALL prt_ctl(tab3d_1=uslp , clinfo1=' slp - u : ', tab3d_2=vslp, clinfo2=' v : ', kdim=jpk) 188 CALL prt_ctl(tab3d_1=wslpi , clinfo1=' slp - wi: ', tab3d_2=wslpj, clinfo2=' wj: ', kdim=jpk) 189 ! CALL prt_ctl(tab2d_1=fr_i , clinfo1=' fr_i - : ', mask1=tmask, ovlap=1 ) 190 ! CALL prt_ctl(tab2d_1=hmld , clinfo1=' hmld - : ', mask1=tmask, ovlap=1 ) 191 ! CALL prt_ctl(tab2d_1=fmmflx , clinfo1=' fmmflx - : ', mask1=tmask, ovlap=1 ) 192 ! CALL prt_ctl(tab2d_1=emp , clinfo1=' emp - : ', mask1=tmask, ovlap=1 ) 193 ! CALL prt_ctl(tab2d_1=wndm , clinfo1=' wspd - : ', mask1=tmask, ovlap=1 ) 194 ! CALL prt_ctl(tab2d_1=qsr , clinfo1=' qsr - : ', mask1=tmask, ovlap=1 ) 291 195 ENDIF 292 196 ! … … 310 214 INTEGER :: inum, idv, idimv ! local integer 311 215 INTEGER :: ios ! Local integer output status for namelist read 312 !! 313 CHARACTER(len=100) :: cn_dir ! Root directory for location of core files 314 TYPE(FLD_N), DIMENSION(jpfld) :: slf_d ! array of namelist informations on the fields to read 315 TYPE(FLD_N) :: sn_tem, sn_sal, sn_mld, sn_emp, sn_ice, sn_qsr, sn_wnd, sn_rnf ! informations about the fields to be read 316 TYPE(FLD_N) :: sn_uwd, sn_vwd, sn_wwd, sn_avt, sn_ubl, sn_vbl, sn_fmf ! " " 317 NAMELIST/namdta_dyn/cn_dir, ln_dynwzv, ln_dynbbl, ln_dynrnf, & 318 & sn_tem, sn_sal, sn_mld, sn_emp, sn_ice, sn_qsr, sn_wnd, sn_rnf, & 319 & sn_uwd, sn_vwd, sn_wwd, sn_avt, sn_ubl, sn_vbl, sn_fmf 320 !!---------------------------------------------------------------------- 216 INTEGER :: ji, jj, jk 217 REAL(wp) :: zcoef 218 INTEGER :: nkrnf_max 219 REAL(wp) :: hrnf_max 220 !! 221 CHARACTER(len=100) :: cn_dir ! Root directory for location of core files 222 TYPE(FLD_N), DIMENSION(jpfld) :: slf_d ! array of namelist informations on the fields to read 223 TYPE(FLD_N) :: sn_uwd, sn_vwd, sn_wwd, sn_empb, sn_emp ! informations about the fields to be read 224 TYPE(FLD_N) :: sn_tem , sn_sal , sn_avt ! " " 225 TYPE(FLD_N) :: sn_mld, sn_qsr, sn_wnd , sn_ice , sn_fmf ! " " 226 TYPE(FLD_N) :: sn_ubl, sn_vbl, sn_rnf ! " " 227 TYPE(FLD_N) :: sn_div ! informations about the fields to be read 228 229 !!---------------------------------------------------------------------- 230 ! 231 NAMELIST/namdta_dyn/cn_dir, ln_dynrnf, ln_dynrnf_depth, fwbcorr, & 232 & sn_uwd, sn_vwd, sn_wwd, sn_emp, & 233 & sn_avt, sn_tem, sn_sal, sn_mld , sn_qsr , & 234 & sn_wnd, sn_ice, sn_fmf, & 235 & sn_ubl, sn_vbl, sn_rnf, & 236 & sn_empb, sn_div 321 237 ! 322 238 REWIND( numnam_ref ) ! Namelist namdta_dyn in reference namelist : Offline: init. of dynamical data … … 335 251 WRITE(numout,*) '~~~~~~~ ' 336 252 WRITE(numout,*) ' Namelist namdta_dyn' 337 WRITE(numout,*) ' vertical velocity read from file (T) or computed (F) ln_dynwzv = ', ln_dynwzv338 WRITE(numout,*) ' bbl coef read from file (T) or computed (F) ln_dynbbl = ', ln_dynbbl339 WRITE(numout,*) ' river runoff option enabled (T) or not (F) ln_dynrnf = ', ln_dynrnf253 WRITE(numout,*) ' runoffs option enabled (T) or not (F) ln_dynrnf = ', ln_dynrnf 254 WRITE(numout,*) ' runoffs is spread in vertical ln_dynrnf_depth = ', ln_dynrnf_depth 255 WRITE(numout,*) ' annual global mean of empmr for ssh correction fwbcorr = ', fwbcorr 340 256 WRITE(numout,*) 341 257 ENDIF 342 258 ! 343 IF( ln_dynbbl .AND. ( .NOT.lk_trabbl .OR. lk_c1d ) ) THEN 344 CALL ctl_warn( 'dta_dyn_init: bbl option requires key_trabbl activated ; force ln_dynbbl to false' ) 345 ln_dynbbl = .FALSE. 346 ENDIF 347 348 jf_tem = 1 ; jf_sal = 2 ; jf_mld = 3 ; jf_emp = 4 ; jf_fmf = 5 ; jf_ice = 6 ; jf_qsr = 7 349 jf_wnd = 8 ; jf_uwd = 9 ; jf_vwd = 10 ; jf_wwd = 11 ; jf_avt = 12 ; jfld = jf_avt 350 ! 351 slf_d(jf_tem) = sn_tem ; slf_d(jf_sal) = sn_sal ; slf_d(jf_mld) = sn_mld 352 slf_d(jf_emp) = sn_emp ; slf_d(jf_fmf ) = sn_fmf ; slf_d(jf_ice) = sn_ice 353 slf_d(jf_qsr) = sn_qsr ; slf_d(jf_wnd) = sn_wnd ; slf_d(jf_avt) = sn_avt 354 slf_d(jf_uwd) = sn_uwd ; slf_d(jf_vwd) = sn_vwd ; slf_d(jf_wwd) = sn_wwd 355 259 260 jf_uwd = 1 ; jf_vwd = 2 ; jf_wwd = 3 ; jf_emp = 4 ; jf_avt = 5 261 jf_tem = 6 ; jf_sal = 7 ; jf_mld = 8 ; jf_qsr = 9 262 jf_wnd = 10 ; jf_ice = 11 ; jf_fmf = 12 ; jfld = jf_fmf 263 264 ! 265 slf_d(jf_uwd) = sn_uwd ; slf_d(jf_vwd) = sn_vwd ; slf_d(jf_wwd) = sn_wwd 266 slf_d(jf_emp) = sn_emp ; slf_d(jf_avt) = sn_avt 267 slf_d(jf_tem) = sn_tem ; slf_d(jf_sal) = sn_sal ; slf_d(jf_mld) = sn_mld 268 slf_d(jf_qsr) = sn_qsr ; slf_d(jf_wnd) = sn_wnd ; slf_d(jf_ice) = sn_ice 269 slf_d(jf_fmf) = sn_fmf 270 271 ! 272 IF( .NOT.ln_linssh ) THEN 273 jf_div = jfld + 1 ; jf_empb = jfld + 2 ; jfld = jf_empb 274 slf_d(jf_div) = sn_div ; slf_d(jf_empb) = sn_empb 275 ENDIF 276 ! 277 IF( lk_trabbl ) THEN 278 jf_ubl = jfld + 1 ; jf_vbl = jfld + 2 ; jfld = jf_vbl 279 slf_d(jf_ubl) = sn_ubl ; slf_d(jf_vbl) = sn_vbl 280 ENDIF 356 281 ! 357 282 IF( ln_dynrnf ) THEN 358 jf_rnf = jfld + 1 ; jfld = jf_rnf 359 slf_d(jf_rnf) = sn_rnf 360 ! Activate runoff key of sbc_oce 361 ln_rnf = .true. 362 WRITE(numout,*) 'dta_dyn : Activate the runoff data structure from ocean core ( force ln_rnf = .true.) ' 363 WRITE(numout,*) 283 jf_rnf = jfld + 1 ; jfld = jf_rnf 284 slf_d(jf_rnf) = sn_rnf 364 285 ELSE 365 rnf (:,:) = 0._wp 366 ENDIF 367 368 IF( ln_dynbbl ) THEN ! eiv & bbl 369 jf_ubl = jfld + 1 ; jf_vbl = jfld + 2 ; jfld = jf_vbl 370 slf_d(jf_ubl) = sn_ubl ; slf_d(jf_vbl) = sn_vbl 371 ENDIF 372 373 286 rnf(:,:) = 0._wp 287 ENDIF 288 289 374 290 ALLOCATE( sf_dyn(jfld), STAT=ierr ) ! set sf structure 375 IF( ierr > 0 ) THEN291 IF( ierr > 0 ) THEN 376 292 CALL ctl_stop( 'dta_dyn: unable to allocate sf structure' ) ; RETURN 377 293 ENDIF 378 294 ! ! fill sf with slf_i and control print 379 295 CALL fld_fill( sf_dyn, slf_d, cn_dir, 'dta_dyn_init', 'Data in file', 'namdta_dyn' ) 296 ! 380 297 ! Open file for each variable to get his number of dimension 381 298 DO ifpr = 1, jfld … … 401 318 ALLOCATE( uslpdta (jpi,jpj,jpk,2), vslpdta (jpi,jpj,jpk,2), & 402 319 & wslpidta(jpi,jpj,jpk,2), wslpjdta(jpi,jpj,jpk,2), STAT=ierr2 ) 403 ELSE 404 ALLOCATE( uslpnow (jpi,jpj,jpk) , vslpnow (jpi,jpj,jpk) , & 405 & wslpinow(jpi,jpj,jpk) , wslpjnow(jpi,jpj,jpk) , STAT=ierr2 ) 406 ENDIF 407 IF( ierr2 > 0 ) THEN 408 CALL ctl_stop( 'dta_dyn_init : unable to allocate slope arrays' ) ; RETURN 320 ! 321 IF( ierr2 > 0 ) THEN 322 CALL ctl_stop( 'dta_dyn_init : unable to allocate slope arrays' ) ; RETURN 323 ENDIF 409 324 ENDIF 410 325 ENDIF 411 IF( ln_dynwzv ) THEN ! slopes 412 IF( sf_dyn(jf_uwd)%ln_tint ) THEN ! time interpolation 413 ALLOCATE( wdta(jpi,jpj,jpk,2), STAT=ierr3 ) 414 ELSE 415 ALLOCATE( wnow(jpi,jpj,jpk) , STAT=ierr3 ) 416 ENDIF 417 IF( ierr3 > 0 ) THEN 418 CALL ctl_stop( 'dta_dyn_init : unable to allocate wdta arrays' ) ; RETURN 419 ENDIF 420 ENDIF 421 ! 422 CALL dta_dyn( nit000 ) 423 ! 424 END SUBROUTINE dta_dyn_init 425 426 427 SUBROUTINE dta_dyn_wzv( pu, pv, pw ) 428 !!---------------------------------------------------------------------- 429 !! *** ROUTINE wzv *** 430 !! 431 !! ** Purpose : Compute the now vertical velocity after the array swap 432 !! 433 !! ** Method : - compute the now divergence given by : 434 !! * z-coordinate ONLY !!!! 435 !! hdiv = 1/(e1t*e2t) [ di(e2u u) + dj(e1v v) ] 436 !! - Using the incompressibility hypothesis, the vertical 437 !! velocity is computed by integrating the horizontal divergence 438 !! from the bottom to the surface. 439 !! The boundary conditions are w=0 at the bottom (no flux). 440 !!---------------------------------------------------------------------- 441 USE oce, ONLY: zhdiv => hdivn 442 ! 443 REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(in ) :: pu, pv !: horizontal velocities 444 REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT( out) :: pw !: vertical velocity 445 !! 446 INTEGER :: ji, jj, jk 447 REAL(wp) :: zu, zu1, zv, zv1, zet 448 !!---------------------------------------------------------------------- 449 ! 450 ! Computation of vertical velocity using horizontal divergence 451 zhdiv(:,:,:) = 0._wp 452 DO jk = 1, jpkm1 453 DO jj = 2, jpjm1 454 DO ji = fs_2, fs_jpim1 ! vector opt. 455 zu = pu(ji ,jj ,jk) * umask(ji ,jj ,jk) * e2u(ji ,jj ) * e3u_n(ji ,jj ,jk) 456 zu1 = pu(ji-1,jj ,jk) * umask(ji-1,jj ,jk) * e2u(ji-1,jj ) * e3u_n(ji-1,jj ,jk) 457 zv = pv(ji ,jj ,jk) * vmask(ji ,jj ,jk) * e1v(ji ,jj ) * e3v_n(ji ,jj ,jk) 458 zv1 = pv(ji ,jj-1,jk) * vmask(ji ,jj-1,jk) * e1v(ji ,jj-1) * e3v_n(ji ,jj-1,jk) 459 zhdiv(ji,jj,jk) = ( zu - zu1 + zv - zv1 ) * r1_e1e2t(ji,jj) / e3t_n(ji,jj,jk) 326 ! 327 IF( .NOT.ln_linssh ) THEN 328 IF( .NOT. sf_dyn(jf_uwd)%ln_clim .AND. ln_rsttr .AND. & ! Restart: read in restart file 329 iom_varid( numrtr, 'sshn', ldstop = .FALSE. ) > 0 ) THEN 330 IF(lwp) WRITE(numout,*) ' sshn forcing fields read in the restart file for initialisation' 331 CALL iom_get( numrtr, jpdom_autoglo, 'sshn', sshn(:,:) ) 332 CALL iom_get( numrtr, jpdom_autoglo, 'sshb', sshb(:,:) ) 333 ELSE 334 IF(lwp) WRITE(numout,*) ' sshn forcing fields read in the restart file for initialisation' 335 CALL iom_open( 'restart', inum ) 336 CALL iom_get( inum, jpdom_autoglo, 'sshn', sshn(:,:) ) 337 CALL iom_get( inum, jpdom_autoglo, 'sshb', sshb(:,:) ) 338 CALL iom_close( inum ) ! close file 339 ENDIF 340 ! 341 DO jk = 1, jpkm1 342 e3t_n(:,:,jk) = e3t_0(:,:,jk) * ( 1._wp + sshn(:,:) * tmask(:,:,1) / ( ht_0(:,:) + 1.0 - tmask(:,:,1) ) ) 343 ENDDO 344 e3t_a(:,:,jpk) = e3t_0(:,:,jpk) 345 346 ! Horizontal scale factor interpolations 347 ! -------------------------------------- 348 CALL dom_vvl_interpol( e3t_n(:,:,:), e3u_n(:,:,:), 'U' ) 349 CALL dom_vvl_interpol( e3t_n(:,:,:), e3v_n(:,:,:), 'V' ) 350 351 ! Vertical scale factor interpolations 352 ! ------------------------------------ 353 CALL dom_vvl_interpol( e3t_n(:,:,:), e3w_n(:,:,:), 'W' ) 354 355 e3t_b(:,:,:) = e3t_n(:,:,:) 356 e3u_b(:,:,:) = e3u_n(:,:,:) 357 e3v_b(:,:,:) = e3v_n(:,:,:) 358 359 ! t- and w- points depth 360 ! ---------------------- 361 gdept_n(:,:,1) = 0.5_wp * e3w_n(:,:,1) 362 gdepw_n(:,:,1) = 0.0_wp 363 364 DO jk = 2, jpk 365 DO jj = 1,jpj 366 DO ji = 1,jpi 367 ! zcoef = (tmask(ji,jj,jk) - wmask(ji,jj,jk)) ! 0 everywhere 368 ! tmask = wmask, ie everywhere expect at jk = mikt 369 ! 1 for jk = 370 ! mikt 371 zcoef = (tmask(ji,jj,jk) - wmask(ji,jj,jk)) 372 gdepw_n(ji,jj,jk) = gdepw_n(ji,jj,jk-1) + e3t_n(ji,jj,jk-1) 373 gdept_n(ji,jj,jk) = zcoef * ( gdepw_n(ji,jj,jk ) + 0.5 * e3w_n(ji,jj,jk)) & 374 & + (1-zcoef) * ( gdept_n(ji,jj,jk-1) + e3w_n(ji,jj,jk)) 375 END DO 376 END DO 377 END DO 378 379 gdept_b(:,:,:) = gdept_n(:,:,:) 380 gdepw_b(:,:,:) = gdepw_n(:,:,:) 381 ! 382 ENDIF 383 ! 384 IF( ln_dynrnf .AND. ln_dynrnf_depth ) THEN ! read depht over which runoffs are distributed 385 IF(lwp) WRITE(numout,*) 386 IF(lwp) WRITE(numout,*) ' read in the file depht over which runoffs are distributed' 387 CALL iom_open ( "runoffs", inum ) ! open file 388 CALL iom_get ( inum, jpdom_data, 'rodepth', h_rnf ) ! read the river mouth array 389 CALL iom_close( inum ) ! close file 390 ! 391 nk_rnf(:,:) = 0 ! set the number of level over which river runoffs are applied 392 DO jj = 1, jpj 393 DO ji = 1, jpi 394 IF( h_rnf(ji,jj) > 0._wp ) THEN 395 jk = 2 396 DO WHILE ( jk /= mbkt(ji,jj) .AND. gdept_0(ji,jj,jk) < h_rnf(ji,jj) ) ; jk = jk + 1 397 END DO 398 nk_rnf(ji,jj) = jk 399 ELSEIF( h_rnf(ji,jj) == -1._wp ) THEN ; nk_rnf(ji,jj) = 1 400 ELSEIF( h_rnf(ji,jj) == -999._wp ) THEN ; nk_rnf(ji,jj) = mbkt(ji,jj) 401 ELSE 402 CALL ctl_stop( 'sbc_rnf_init: runoff depth not positive, and not -999 or -1, rnf value in file fort.999' ) 403 WRITE(999,*) 'ji, jj, h_rnf(ji,jj) :', ji, jj, h_rnf(ji,jj) 404 ENDIF 460 405 END DO 461 406 END DO 407 DO jj = 1, jpj ! set the associated depth 408 DO ji = 1, jpi 409 h_rnf(ji,jj) = 0._wp 410 DO jk = 1, nk_rnf(ji,jj) 411 h_rnf(ji,jj) = h_rnf(ji,jj) + e3t_n(ji,jj,jk) 412 END DO 413 END DO 414 END DO 415 ELSE ! runoffs applied at the surface 416 nk_rnf(:,:) = 1 417 h_rnf (:,:) = e3t_n(:,:,1) 418 ENDIF 419 nkrnf_max = MAXVAL( nk_rnf(:,:) ) 420 hrnf_max = MAXVAL( h_rnf(:,:) ) 421 IF( lk_mpp ) THEN 422 CALL mpp_max( nkrnf_max ) ! max over the global domain 423 CALL mpp_max( hrnf_max ) ! max over the global domain 424 ENDIF 425 IF(lwp) WRITE(numout,*) ' ' 426 IF(lwp) WRITE(numout,*) ' max depht of runoff : ', hrnf_max,' max level : ', nkrnf_max 427 IF(lwp) WRITE(numout,*) ' ' 428 ! 429 CALL dta_dyn( nit000 ) 430 ! 431 END SUBROUTINE dta_dyn_init 432 433 SUBROUTINE dta_dyn_swp( kt ) 434 !!--------------------------------------------------------------------- 435 !! *** ROUTINE dta_dyn_swp *** 436 !! 437 !! ** Purpose : Swap and the data and compute the vertical scale factor at U/V/W point 438 !! and the depht 439 !! 440 !!--------------------------------------------------------------------- 441 INTEGER, INTENT(in) :: kt ! time step 442 INTEGER :: ji, jj, jk 443 REAL(wp) :: zcoef 444 ! 445 !!--------------------------------------------------------------------- 446 447 IF( kt == nit000 ) THEN 448 IF(lwp) WRITE(numout,*) 449 IF(lwp) WRITE(numout,*) 'ssh_swp : Asselin time filter and swap of sea surface height' 450 IF(lwp) WRITE(numout,*) '~~~~~~~ ' 451 ENDIF 452 453 sshb(:,:) = sshn(:,:) + atfp * ( sshb(:,:) - 2 * sshn(:,:) + ssha(:,:)) ! before <-- now filtered 454 sshn(:,:) = ssha(:,:) 455 456 e3t_n(:,:,:) = e3t_a(:,:,:) 457 458 ! Reconstruction of all vertical scale factors at now and before time steps 459 ! ============================================================================= 460 461 ! Horizontal scale factor interpolations 462 ! -------------------------------------- 463 CALL dom_vvl_interpol( e3t_n(:,:,:), e3u_n(:,:,:), 'U' ) 464 CALL dom_vvl_interpol( e3t_n(:,:,:), e3v_n(:,:,:), 'V' ) 465 466 ! Vertical scale factor interpolations 467 ! ------------------------------------ 468 CALL dom_vvl_interpol( e3t_n(:,:,:), e3w_n (:,:,:), 'W' ) 469 470 e3t_b(:,:,:) = e3t_n(:,:,:) 471 e3u_b(:,:,:) = e3u_n(:,:,:) 472 e3v_b(:,:,:) = e3v_n(:,:,:) 473 474 ! t- and w- points depth 475 ! ---------------------- 476 gdept_n(:,:,1) = 0.5_wp * e3w_n(:,:,1) 477 gdepw_n(:,:,1) = 0.0_wp 478 479 DO jk = 2, jpk 480 DO jj = 1,jpj 481 DO ji = 1,jpi 482 zcoef = (tmask(ji,jj,jk) - wmask(ji,jj,jk)) 483 gdepw_n(ji,jj,jk) = gdepw_n(ji,jj,jk-1) + e3t_n(ji,jj,jk-1) 484 gdept_n(ji,jj,jk) = zcoef * ( gdepw_n(ji,jj,jk ) + 0.5 * e3w_n(ji,jj,jk)) & 485 & + (1-zcoef) * ( gdept_n(ji,jj,jk-1) + e3w_n(ji,jj,jk)) 486 END DO 487 END DO 488 END DO 489 490 gdept_b(:,:,:) = gdept_n(:,:,:) 491 gdepw_b(:,:,:) = gdepw_n(:,:,:) 492 493 ! 494 END SUBROUTINE dta_dyn_swp 495 496 SUBROUTINE dta_dyn_ssh( kt, phdivtr, psshb, pemp, pssha, pe3ta ) 497 !!---------------------------------------------------------------------- 498 !! *** ROUTINE dta_dyn_wzv *** 499 !! 500 !! ** Purpose : compute the after ssh (ssha) and the now vertical velocity 501 !! 502 !! ** Method : Using the incompressibility hypothesis, 503 !! - the ssh increment is computed by integrating the horizontal divergence 504 !! and multiply by the time step. 505 !! 506 !! - compute the after scale factor : repartition of ssh INCREMENT proportionnaly 507 !! to the level thickness ( z-star case ) 508 !! 509 !! - the vertical velocity is computed by integrating the horizontal divergence 510 !! from the bottom to the surface minus the scale factor evolution. 511 !! The boundary conditions are w=0 at the bottom (no flux) 512 !! 513 !! ** action : ssha / e3t_a / wn 514 !! 515 !! Reference : Leclair, M., and G. Madec, 2009, Ocean Modelling. 516 !!---------------------------------------------------------------------- 517 !! * Arguments 518 INTEGER, INTENT(in ) :: kt ! time-step 519 REAL(wp), DIMENSION(jpi,jpj,jpk) , INTENT(in ) :: phdivtr ! horizontal divergence transport 520 REAL(wp), DIMENSION(jpi,jpj) , OPTIONAL, INTENT(in ) :: psshb ! now ssh 521 REAL(wp), DIMENSION(jpi,jpj) , OPTIONAL, INTENT(in ) :: pemp ! evaporation minus precipitation 522 REAL(wp), DIMENSION(jpi,jpj) , OPTIONAL, INTENT(inout) :: pssha ! after ssh 523 REAL(wp), DIMENSION(jpi,jpj,jpk), OPTIONAL, INTENT(out) :: pe3ta ! after vertical scale factor 524 !! * Local declarations 525 INTEGER :: jk 526 REAL(wp), DIMENSION(jpi,jpj) :: zhdiv 527 REAL(wp) :: z2dt 528 !!---------------------------------------------------------------------- 529 530 ! 531 z2dt = 2._wp * rdt 532 ! 533 zhdiv(:,:) = 0._wp 534 DO jk = 1, jpkm1 535 zhdiv(:,:) = zhdiv(:,:) + phdivtr(:,:,jk) * tmask(:,:,jk) 462 536 END DO 463 ! ! update the horizontal divergence with the runoff inflow 464 IF( ln_dynrnf ) zhdiv(:,:,1) = zhdiv(:,:,1) - rnf(:,:) * r1_rau0 / e3t_n(:,:,1) 465 ! 466 CALL lbc_lnk( zhdiv, 'T', 1. ) ! Lateral boundary conditions on zhdiv 467 ! computation of vertical velocity from the bottom 468 pw(:,:,jpk) = 0._wp 469 DO jk = jpkm1, 1, -1 470 pw(:,:,jk) = pw(:,:,jk+1) - e3t_n(:,:,jk) * zhdiv(:,:,jk) 537 ! ! Sea surface elevation time-stepping 538 pssha(:,:) = ( psshb(:,:) - z2dt * ( r1_rau0 * pemp(:,:) + zhdiv(:,:) ) ) * ssmask(:,:) 539 ! ! 540 ! ! After acale factors at t-points ( z_star coordinate ) 541 DO jk = 1, jpkm1 542 pe3ta(:,:,jk) = e3t_0(:,:,jk) * ( 1._wp + pssha(:,:) * tmask(:,:,1) / ( ht_0(:,:) + 1.0 - tmask(:,:,1) ) ) 471 543 END DO 472 544 ! 473 END SUBROUTINE dta_dyn_wzv 474 475 SUBROUTINE dta_dyn_slp( kt, pts, puslp, pvslp, pwslpi, pwslpj ) 545 END SUBROUTINE dta_dyn_ssh 546 547 548 SUBROUTINE dta_dyn_hrnf 549 !!---------------------------------------------------------------------- 550 !! *** ROUTINE sbc_rnf *** 551 !! 552 !! ** Purpose : update the horizontal divergence with the runoff inflow 553 !! 554 !! ** Method : 555 !! CAUTION : rnf is positive (inflow) decreasing the 556 !! divergence and expressed in m/s 557 !! 558 !! ** Action : phdivn decreased by the runoff inflow 559 !!---------------------------------------------------------------------- 560 !! 561 INTEGER :: ji, jj, jk ! dummy loop indices 562 !!---------------------------------------------------------------------- 563 ! 564 DO jj = 1, jpj ! update the depth over which runoffs are distributed 565 DO ji = 1, jpi 566 h_rnf(ji,jj) = 0._wp 567 DO jk = 1, nk_rnf(ji,jj) ! recalculates h_rnf to be the depth in metres 568 h_rnf(ji,jj) = h_rnf(ji,jj) + e3t_n(ji,jj,jk) ! to the bottom of the relevant grid box 569 END DO 570 END DO 571 END DO 572 ! 573 END SUBROUTINE dta_dyn_hrnf 574 575 576 577 SUBROUTINE dta_dyn_slp( kt ) 578 !!--------------------------------------------------------------------- 579 !! *** ROUTINE dta_dyn_slp *** 580 !! 581 !! ** Purpose : Computation of slope 582 !! 583 !!--------------------------------------------------------------------- 584 USE oce, ONLY: zts => tsa 585 ! 586 INTEGER, INTENT(in) :: kt ! time step 587 ! 588 INTEGER :: ji, jj ! dummy loop indices 589 REAL(wp) :: ztinta ! ratio applied to after records when doing time interpolation 590 REAL(wp) :: ztintb ! ratio applied to before records when doing time interpolation 591 INTEGER :: iswap 592 REAL(wp), POINTER, DIMENSION(:,:,:) :: zuslp, zvslp, zwslpi, zwslpj 593 !!--------------------------------------------------------------------- 594 ! 595 CALL wrk_alloc(jpi, jpj, jpk, zuslp, zvslp, zwslpi, zwslpj ) 596 ! 597 IF( sf_dyn(jf_tem)%ln_tint ) THEN ! Computes slopes (here avt is used as workspace) 598 IF( kt == nit000 ) THEN 599 IF(lwp) WRITE(numout,*) ' Compute new slopes at kt = ', kt 600 zts(:,:,:,jp_tem) = sf_dyn(jf_tem)%fdta(:,:,:,1) * tmask(:,:,:) ! temperature 601 zts(:,:,:,jp_sal) = sf_dyn(jf_sal)%fdta(:,:,:,1) * tmask(:,:,:) ! salinity 602 avt(:,:,:) = sf_dyn(jf_avt)%fdta(:,:,:,1) * tmask(:,:,:) ! vertical diffusive coef. 603 CALL compute_slopes( kt, zts, zuslp, zvslp, zwslpi, zwslpj ) 604 uslpdta (:,:,:,1) = zuslp (:,:,:) 605 vslpdta (:,:,:,1) = zvslp (:,:,:) 606 wslpidta(:,:,:,1) = zwslpi(:,:,:) 607 wslpjdta(:,:,:,1) = zwslpj(:,:,:) 608 ! 609 zts(:,:,:,jp_tem) = sf_dyn(jf_tem)%fdta(:,:,:,2) * tmask(:,:,:) ! temperature 610 zts(:,:,:,jp_sal) = sf_dyn(jf_sal)%fdta(:,:,:,2) * tmask(:,:,:) ! salinity 611 avt(:,:,:) = sf_dyn(jf_avt)%fdta(:,:,:,2) * tmask(:,:,:) ! vertical diffusive coef. 612 CALL compute_slopes( kt, zts, zuslp, zvslp, zwslpi, zwslpj ) 613 uslpdta (:,:,:,2) = zuslp (:,:,:) 614 vslpdta (:,:,:,2) = zvslp (:,:,:) 615 wslpidta(:,:,:,2) = zwslpi(:,:,:) 616 wslpjdta(:,:,:,2) = zwslpj(:,:,:) 617 ELSE 618 ! 619 iswap = 0 620 IF( sf_dyn(jf_tem)%nrec_a(2) - nprevrec /= 0 ) iswap = 1 621 IF( nsecdyn > sf_dyn(jf_tem)%nrec_b(2) .AND. iswap == 1 ) THEN ! read/update the after data 622 IF(lwp) WRITE(numout,*) ' Compute new slopes at kt = ', kt 623 uslpdta (:,:,:,1) = uslpdta (:,:,:,2) ! swap the data 624 vslpdta (:,:,:,1) = vslpdta (:,:,:,2) 625 wslpidta(:,:,:,1) = wslpidta(:,:,:,2) 626 wslpjdta(:,:,:,1) = wslpjdta(:,:,:,2) 627 ! 628 zts(:,:,:,jp_tem) = sf_dyn(jf_tem)%fdta(:,:,:,2) * tmask(:,:,:) ! temperature 629 zts(:,:,:,jp_sal) = sf_dyn(jf_sal)%fdta(:,:,:,2) * tmask(:,:,:) ! salinity 630 avt(:,:,:) = sf_dyn(jf_avt)%fdta(:,:,:,2) * tmask(:,:,:) ! vertical diffusive coef. 631 CALL compute_slopes( kt, zts, zuslp, zvslp, zwslpi, zwslpj ) 632 ! 633 uslpdta (:,:,:,2) = zuslp (:,:,:) 634 vslpdta (:,:,:,2) = zvslp (:,:,:) 635 wslpidta(:,:,:,2) = zwslpi(:,:,:) 636 wslpjdta(:,:,:,2) = zwslpj(:,:,:) 637 ENDIF 638 ENDIF 639 ENDIF 640 ! 641 IF( sf_dyn(jf_tem)%ln_tint ) THEN 642 ztinta = REAL( nsecdyn - sf_dyn(jf_tem)%nrec_b(2), wp ) & 643 & / REAL( sf_dyn(jf_tem)%nrec_a(2) - sf_dyn(jf_tem)%nrec_b(2), wp ) 644 ztintb = 1. - ztinta 645 IF( l_ldfslp .AND. .NOT.lk_c1d ) THEN ! Computes slopes (here avt is used as workspace) 646 uslp (:,:,:) = ztintb * uslpdta (:,:,:,1) + ztinta * uslpdta (:,:,:,2) 647 vslp (:,:,:) = ztintb * vslpdta (:,:,:,1) + ztinta * vslpdta (:,:,:,2) 648 wslpi(:,:,:) = ztintb * wslpidta(:,:,:,1) + ztinta * wslpidta(:,:,:,2) 649 wslpj(:,:,:) = ztintb * wslpjdta(:,:,:,1) + ztinta * wslpjdta(:,:,:,2) 650 ENDIF 651 ELSE 652 zts(:,:,:,jp_tem) = sf_dyn(jf_tem)%fnow(:,:,:) * tmask(:,:,:) ! temperature 653 zts(:,:,:,jp_sal) = sf_dyn(jf_sal)%fnow(:,:,:) * tmask(:,:,:) ! salinity 654 avt(:,:,:) = sf_dyn(jf_avt)%fnow(:,:,:) * tmask(:,:,:) ! vertical diffusive coef. 655 CALL compute_slopes( kt, zts, zuslp, zvslp, zwslpi, zwslpj ) 656 ! 657 IF( l_ldfslp .AND. .NOT.lk_c1d ) THEN ! Computes slopes (here avt is used as workspace) 658 uslp (:,:,:) = zuslp (:,:,:) 659 vslp (:,:,:) = zvslp (:,:,:) 660 wslpi(:,:,:) = zwslpi(:,:,:) 661 wslpj(:,:,:) = zwslpj(:,:,:) 662 ENDIF 663 ENDIF 664 ! 665 CALL wrk_dealloc(jpi, jpj, jpk, zuslp, zvslp, zwslpi, zwslpj ) 666 ! 667 END SUBROUTINE dta_dyn_slp 668 669 SUBROUTINE compute_slopes( kt, pts, puslp, pvslp, pwslpi, pwslpj ) 476 670 !!--------------------------------------------------------------------- 477 671 !! *** ROUTINE dta_dyn_slp *** … … 487 681 REAL(wp), DIMENSION(jpi,jpj,jpk) , INTENT(out) :: pwslpj ! meridional diapycnal slopes 488 682 !!--------------------------------------------------------------------- 489 IF( l_ldfslp .AND. .NOT.lk_c1d ) THEN ! Computes slopes (here avt is used as workspace) 683 IF( l_ldfslp .AND. .NOT.lk_c1d ) THEN ! Computes slopes (here avt is used as workspace) 490 684 CALL eos ( pts, rhd, rhop, gdept_0(:,:,:) ) 491 685 CALL eos_rab( pts, rab_n ) ! now local thermal/haline expension ratio at T-points … … 497 691 & rhd, gru , grv ) ! of t, s, rd at the last ocean level 498 692 IF( ln_zps .AND. ln_isfcav) & 499 & CALL zps_hde_isf( kt, jpts, pts, gtsu, gtsv, gtui, gtvi, 500 & rhd, gru , grv , grui, grvi 693 & CALL zps_hde_isf( kt, jpts, pts, gtsu, gtsv, gtui, gtvi, & ! Partial steps for top cell (ISF) 694 & rhd, gru , grv , grui, grvi ) ! of t, s, rd at the first ocean level 501 695 502 696 rn2b(:,:,:) = rn2(:,:,:) ! need for zdfmxl 503 697 CALL zdf_mxl( kt ) ! mixed layer depth 504 698 CALL ldf_slp( kt, rhd, rn2 ) ! slopes 505 puslp (:,:,:) = uslp (:,:,:) 506 pvslp (:,:,:) = vslp (:,:,:) 507 pwslpi(:,:,:) = wslpi(:,:,:) 508 pwslpj(:,:,:) = wslpj(:,:,:) 699 puslp (:,:,:) = uslp (:,:,:) 700 pvslp (:,:,:) = vslp (:,:,:) 701 pwslpi(:,:,:) = wslpi(:,:,:) 702 pwslpj(:,:,:) = wslpj(:,:,:) 509 703 ELSE 510 704 puslp (:,:,:) = 0. ! to avoid warning when compiling … … 514 708 ENDIF 515 709 ! 516 END SUBROUTINE dta_dyn_slp710 END SUBROUTINE compute_slopes 517 711 !!====================================================================== 518 712 END MODULE dtadyn -
branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OFF_SRC/nemogcm.F90
r6140 r7277 5 5 !!====================================================================== 6 6 !! History : 3.3 ! 2010-05 (C. Ethe) Full reorganization of the off-line: phasing with the on-line 7 !! 4.0 ! 2011-01 (C. Ethe, A. R. Porter, STFC Daresbury) dynamical allocation 7 !! 3.4 ! 2011-01 (C. Ethe, A. R. Porter, STFC Daresbury) dynamical allocation 8 !! 4.0 ! 2016-10 (C. Ethe, G. Madec, S. Flavoni) domain configuration / user defined interface 8 9 !!---------------------------------------------------------------------- 9 10 … … 17 18 USE oce ! dynamics and tracers variables 18 19 USE c1d ! 1D configuration 19 USE domcfg ! domain configuration (dom_cfg routine)20 20 USE domain ! domain initialization from coordinate & bathymetry (dom_init routine) 21 USE domrea ! domain initialization from mesh_mask (dom_init routine)21 USE usrdef_nam ! user defined configuration 22 22 USE eosbn2 ! equation of state (eos bn2 routine) 23 23 ! ! ocean physics … … 35 35 USE trcstp ! passive tracer time-stepping (trc_stp routine) 36 36 USE dtadyn ! Lecture and interpolation of the dynamical fields 37 ! ! Passive tracers needs 38 USE trc ! passive tracer : variables 39 USE trcnam ! passive tracer : namelist 40 USE trcrst ! passive tracer restart 41 USE diaptr ! Need to initialise this as some variables are used in if statements later 42 USE sbc_oce , ONLY : ln_rnf 43 USE sbcrnf ! surface boundary condition : runoffs 37 44 ! ! I/O & MPP 38 45 USE iom ! I/O library … … 48 55 USE lbcnfd, ONLY: isendto, nsndto, nfsloop, nfeloop ! Setup of north fold exchanges 49 56 50 USE trc 51 USE trcnam 52 USE trcrst 53 USE diaptr ! Need to initialise this as some variables are used in if statements later 54 USE sbc_oce, ONLY: ln_rnf 55 USE sbcrnf 57 56 58 57 59 IMPLICIT NONE … … 104 106 DO WHILE ( istp <= nitend .AND. nstop == 0 ) ! time stepping 105 107 ! 106 IF( istp /= nit000 ) CALL day ( istp ) ! Calendar (day was already called at nit000 in day_init) 107 CALL iom_setkt( istp - nit000 + 1, "nemo" ) ! say to iom that we are at time step kstp 108 CALL dta_dyn ( istp ) ! Interpolation of the dynamical fields 109 CALL trc_stp ( istp ) ! time-stepping 110 CALL stp_ctl ( istp, indic ) ! Time loop: control and print 108 IF( istp /= nit000 ) CALL day ( istp ) ! Calendar (day was already called at nit000 in day_init) 109 CALL iom_setkt ( istp - nit000 + 1, "nemo" ) ! say to iom that we are at time step kstp 110 CALL dta_dyn ( istp ) ! Interpolation of the dynamical fields 111 IF( .NOT.ln_linssh ) CALL dta_dyn_swp( istp ) ! swap of sea surface height and vertical scale factors 112 113 CALL trc_stp ( istp ) ! time-stepping 114 CALL stp_ctl ( istp, indic ) ! Time loop: control and print 111 115 istp = istp + 1 112 116 IF( lk_mpp ) CALL mpp_max( nstop ) … … 147 151 INTEGER :: ji ! dummy loop indices 148 152 INTEGER :: ilocal_comm ! local integer 149 INTEGER :: ios 150 LOGICAL :: llexist151 CHARACTER(len= 80), DIMENSION(16) :: cltxt153 INTEGER :: ios, inum 154 REAL(wp) :: ziglo, zjglo, zkglo, zperio ! local scalars 155 CHARACTER(len=120), DIMENSION(30) :: cltxt, cltxt2, clnam 152 156 !! 153 157 NAMELIST/namctl/ ln_ctl , nn_print, nn_ictls, nn_ictle, & 154 158 & nn_isplt, nn_jsplt, nn_jctls, nn_jctle, & 155 & nn_bench, nn_timing, nn_diacfl 156 NAMELIST/namcfg/ cp_cfg, cp_cfz, jp_cfg, jpidta, jpjdta, jpkdta, jpiglo, jpjglo, & 157 & jpizoom, jpjzoom, jperio, ln_use_jattr 158 !!---------------------------------------------------------------------- 159 cltxt = '' 159 & nn_timing, nn_diacfl 160 161 NAMELIST/namcfg/ ln_read_cfg, cn_domcfg, ln_write_cfg, cn_domcfg_out, ln_use_jattr 162 !!---------------------------------------------------------------------- 163 cltxt = '' 164 cltxt2 = '' 165 clnam = '' 160 166 cxios_context = 'nemo' 161 167 ! … … 181 187 904 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namcfg in configuration namelist', .TRUE. ) 182 188 189 190 ! !--------------------------! 191 ! ! Set global domain size ! (control print return in cltxt2) 192 ! 193 IF( ln_read_cfg ) THEN ! Read sizes in domain configuration file 194 CALL domain_cfg ( cltxt2, cn_cfg, nn_cfg, jpiglo, jpjglo, jpkglo, jperio ) 195 ! 196 ELSE ! user-defined namelist 197 CALL usr_def_nam( cltxt2, clnam, cn_cfg, nn_cfg, jpiglo, jpjglo, jpkglo, jperio ) 198 ENDIF 199 jpk = jpkglo 183 200 ! 184 201 ! !--------------------------------------------! … … 206 223 WRITE( numond, namctl ) 207 224 WRITE( numond, namcfg ) 225 IF( .NOT.ln_read_cfg ) THEN 226 DO ji = 1, SIZE(clnam) 227 IF( TRIM(clnam (ji)) /= '' ) WRITE(numond, * ) clnam(ji) ! namusr_def print 228 END DO 229 ENDIF 208 230 ENDIF 209 231 … … 225 247 jpi = ( jpiglo-2*jpreci + (jpni-1) ) / jpni + 2*jpreci ! first dim. 226 248 jpj = ( jpjglo-2*jprecj + (jpnj-1) ) / jpnj + 2*jprecj ! second dim. 227 jpk = jpkdta ! third dim228 249 jpim1 = jpi-1 ! inner domain indices 229 250 jpjm1 = jpj-1 ! " " … … 274 295 CALL eos_init ! Equation of state 275 296 IF( lk_c1d ) CALL c1d_init ! 1D column configuration 276 CALL dom_cfg ! Domain configuration 277 ! 278 INQUIRE( FILE='coordinates.nc', EXIST = llexist ) ! Check if coordinate file exist 279 ! 280 IF( llexist ) THEN ; CALL dom_init ! compute the grid from coordinates and bathymetry 281 ELSE ; CALL dom_rea ! read grid from the meskmask 282 ENDIF 297 298 CALL dom_init ! Domain 299 283 300 CALL istate_init ! ocean initial state (Dynamics and tracers) 284 301 … … 315 332 !! *** ROUTINE nemo_ctl *** 316 333 !! 317 !! ** Purpose : control print setting 334 !! ** Purpose : control print setting 318 335 !! 319 336 !! ** Method : - print namctl information and check some consistencies 320 337 !!---------------------------------------------------------------------- 321 338 ! 322 IF(lwp) THEN ! Parameterprint339 IF(lwp) THEN ! control print 323 340 WRITE(numout,*) 324 WRITE(numout,*) 'nemo_ flg: Control prints & Benchmark'341 WRITE(numout,*) 'nemo_ctl: Control prints' 325 342 WRITE(numout,*) '~~~~~~~ ' 326 343 WRITE(numout,*) ' Namelist namctl' … … 333 350 WRITE(numout,*) ' number of proc. following i nn_isplt = ', nn_isplt 334 351 WRITE(numout,*) ' number of proc. following j nn_jsplt = ', nn_jsplt 335 WRITE(numout,*) ' benchmark parameter (0/1) nn_bench = ', nn_bench352 WRITE(numout,*) ' timing activated (0/1) nn_timing = ', nn_timing 336 353 ENDIF 337 354 ! … … 343 360 isplt = nn_isplt 344 361 jsplt = nn_jsplt 345 nbench = nn_bench 346 IF(lwp) THEN ! control print 362 363 364 IF(lwp) THEN ! control print 347 365 WRITE(numout,*) 348 366 WRITE(numout,*) 'namcfg : configuration initialization through namelist read' 349 367 WRITE(numout,*) '~~~~~~~ ' 350 368 WRITE(numout,*) ' Namelist namcfg' 351 WRITE(numout,*) ' configuration name cp_cfg = ', TRIM(cp_cfg) 352 WRITE(numout,*) ' configuration resolution jp_cfg = ', jp_cfg 353 WRITE(numout,*) ' 1st lateral dimension ( >= jpi ) jpidta = ', jpidta 354 WRITE(numout,*) ' 2nd " " ( >= jpj ) jpjdta = ', jpjdta 355 WRITE(numout,*) ' 3nd " " jpkdta = ', jpkdta 356 WRITE(numout,*) ' 1st dimension of global domain in i jpiglo = ', jpiglo 357 WRITE(numout,*) ' 2nd - - in j jpjglo = ', jpjglo 358 WRITE(numout,*) ' left bottom i index of the zoom (in data domain) jpizoom = ', jpizoom 359 WRITE(numout,*) ' left bottom j index of the zoom (in data domain) jpizoom = ', jpjzoom 360 WRITE(numout,*) ' lateral cond. type (between 0 and 6) jperio = ', jperio 361 WRITE(numout,*) ' use file attribute if exists as i/p j-start ln_use_jattr = ', ln_use_jattr 362 ENDIF 369 WRITE(numout,*) ' read domain configuration files ln_read_cfg = ', ln_read_cfg 370 WRITE(numout,*) ' filename to be read cn_domcfg = ', TRIM(cn_domcfg) 371 WRITE(numout,*) ' write configuration definition files ln_write_cfg = ', ln_write_cfg 372 WRITE(numout,*) ' filename to be written cn_domcfg_out = ', TRIM(cn_domcfg_out) 373 WRITE(numout,*) ' use file attribute if exists as i/p j-start ln_use_jattr = ', ln_use_jattr 374 ENDIF 375 363 376 ! ! Parameter control 364 377 ! 365 378 IF( ln_ctl ) THEN ! sub-domain area indices for the control prints 366 IF( lk_mpp ) THEN367 isplt = jpni ; jsplt = jpnj ; ijsplt = jpni*jpnj ! the domain is forced to the real split teddomain379 IF( lk_mpp .AND. jpnij > 1 ) THEN 380 isplt = jpni ; jsplt = jpnj ; ijsplt = jpni*jpnj ! the domain is forced to the real split domain 368 381 ELSE 369 382 IF( isplt == 1 .AND. jsplt == 1 ) THEN … … 400 413 ENDIF 401 414 ! 402 IF( nbench == 1 ) THEN ! Benchmark403 SELECT CASE ( cp_cfg )404 CASE ( 'gyre' ) ; CALL ctl_warn( ' The Benchmark is activated ' )405 CASE DEFAULT ; CALL ctl_stop( ' The Benchmark is based on the GYRE configuration:', &406 & ' cp_cfg="gyre" in namelsit &namcfg or set nbench = 0' )407 END SELECT408 ENDIF409 !410 IF( lk_c1d .AND. .NOT.lk_iomput ) CALL ctl_stop( 'nemo_ctl: The 1D configuration must be used ', &411 & 'with the IOM Input/Output manager. ' , &412 & 'Compile with key_iomput enabled' )413 !414 415 IF( 1_wp /= SIGN(1._wp,-0._wp) ) CALL ctl_stop( 'nemo_ctl: The intrinsec SIGN function follows ', & 415 416 & 'f2003 standard. ' , & … … 434 435 IF( numnam_cfg /= -1 ) CLOSE( numnam_cfg ) ! oce configuration namelist 435 436 IF( numout /= 6 ) CLOSE( numout ) ! standard model output file 437 IF( lwm.AND.numond /= -1 ) CLOSE( numond ) ! oce output namelist 438 436 439 numout = 6 ! redefine numout in case it is used after this point... 437 440 ! -
branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/BDY/bdyini.F90
r6140 r7277 769 769 ! is = mjg(1) + 1 ! if monotasking and no zoom, is=2 770 770 ! in = mjg(1) + nlcj-1 - 1 ! if monotasking and no zoom, in=jpjm1 771 iwe = mig(1) - jpizoom+ 2 ! if monotasking and no zoom, iw=2772 ies = mig(1) + nlci - jpizoom- 1 ! if monotasking and no zoom, ie=jpim1773 iso = mjg(1) - jpjzoom+ 2 ! if monotasking and no zoom, is=2774 ino = mjg(1) + nlcj - jpjzoom- 1 ! if monotasking and no zoom, in=jpjm1771 iwe = mig(1) - 1 + 2 ! if monotasking and no zoom, iw=2 772 ies = mig(1) + nlci-1 - 1 ! if monotasking and no zoom, ie=jpim1 773 iso = mjg(1) - 1 + 2 ! if monotasking and no zoom, is=2 774 ino = mjg(1) + nlcj-1 - 1 ! if monotasking and no zoom, in=jpjm1 775 775 776 776 ALLOCATE( nbondi_bdy(nb_bdy)) … … 785 785 ! Work out dimensions of boundary data on each neighbour process 786 786 IF(nbondi == 0) THEN 787 iw_b(1) = jpizoom+ nimppt(nowe+1)788 ie_b(1) = jpizoom+ nimppt(nowe+1)+nlcit(nowe+1)-3789 is_b(1) = jpjzoom+ njmppt(nowe+1)790 in_b(1) = jpjzoom+ njmppt(nowe+1)+nlcjt(nowe+1)-3791 792 iw_b(2) = jpizoom+ nimppt(noea+1)793 ie_b(2) = jpizoom+ nimppt(noea+1)+nlcit(noea+1)-3794 is_b(2) = jpjzoom+ njmppt(noea+1)795 in_b(2) = jpjzoom+ njmppt(noea+1)+nlcjt(noea+1)-3787 iw_b(1) = 1 + nimppt(nowe+1) 788 ie_b(1) = 1 + nimppt(nowe+1)+nlcit(nowe+1)-3 789 is_b(1) = 1 + njmppt(nowe+1) 790 in_b(1) = 1 + njmppt(nowe+1)+nlcjt(nowe+1)-3 791 792 iw_b(2) = 1 + nimppt(noea+1) 793 ie_b(2) = 1 + nimppt(noea+1)+nlcit(noea+1)-3 794 is_b(2) = 1 + njmppt(noea+1) 795 in_b(2) = 1 + njmppt(noea+1)+nlcjt(noea+1)-3 796 796 ELSEIF(nbondi == 1) THEN 797 iw_b(1) = jpizoom+ nimppt(nowe+1)798 ie_b(1) = jpizoom+ nimppt(nowe+1)+nlcit(nowe+1)-3799 is_b(1) = jpjzoom+ njmppt(nowe+1)800 in_b(1) = jpjzoom+ njmppt(nowe+1)+nlcjt(nowe+1)-3797 iw_b(1) = 1 + nimppt(nowe+1) 798 ie_b(1) = 1 + nimppt(nowe+1)+nlcit(nowe+1)-3 799 is_b(1) = 1 + njmppt(nowe+1) 800 in_b(1) = 1 + njmppt(nowe+1)+nlcjt(nowe+1)-3 801 801 ELSEIF(nbondi == -1) THEN 802 iw_b(2) = jpizoom+ nimppt(noea+1)803 ie_b(2) = jpizoom+ nimppt(noea+1)+nlcit(noea+1)-3804 is_b(2) = jpjzoom+ njmppt(noea+1)805 in_b(2) = jpjzoom+ njmppt(noea+1)+nlcjt(noea+1)-3802 iw_b(2) = 1 + nimppt(noea+1) 803 ie_b(2) = 1 + nimppt(noea+1)+nlcit(noea+1)-3 804 is_b(2) = 1 + njmppt(noea+1) 805 in_b(2) = 1 + njmppt(noea+1)+nlcjt(noea+1)-3 806 806 ENDIF 807 807 808 808 IF(nbondj == 0) THEN 809 iw_b(3) = jpizoom+ nimppt(noso+1)810 ie_b(3) = jpizoom+ nimppt(noso+1)+nlcit(noso+1)-3811 is_b(3) = jpjzoom+ njmppt(noso+1)812 in_b(3) = jpjzoom+ njmppt(noso+1)+nlcjt(noso+1)-3813 814 iw_b(4) = jpizoom+ nimppt(nono+1)815 ie_b(4) = jpizoom+ nimppt(nono+1)+nlcit(nono+1)-3816 is_b(4) = jpjzoom+ njmppt(nono+1)817 in_b(4) = jpjzoom+ njmppt(nono+1)+nlcjt(nono+1)-3809 iw_b(3) = 1 + nimppt(noso+1) 810 ie_b(3) = 1 + nimppt(noso+1)+nlcit(noso+1)-3 811 is_b(3) = 1 + njmppt(noso+1) 812 in_b(3) = 1 + njmppt(noso+1)+nlcjt(noso+1)-3 813 814 iw_b(4) = 1 + nimppt(nono+1) 815 ie_b(4) = 1 + nimppt(nono+1)+nlcit(nono+1)-3 816 is_b(4) = 1 + njmppt(nono+1) 817 in_b(4) = 1 + njmppt(nono+1)+nlcjt(nono+1)-3 818 818 ELSEIF(nbondj == 1) THEN 819 iw_b(3) = jpizoom+ nimppt(noso+1)820 ie_b(3) = jpizoom+ nimppt(noso+1)+nlcit(noso+1)-3821 is_b(3) = jpjzoom+ njmppt(noso+1)822 in_b(3) = jpjzoom+ njmppt(noso+1)+nlcjt(noso+1)-3819 iw_b(3) = 1 + nimppt(noso+1) 820 ie_b(3) = 1 + nimppt(noso+1)+nlcit(noso+1)-3 821 is_b(3) = 1 + njmppt(noso+1) 822 in_b(3) = 1 + njmppt(noso+1)+nlcjt(noso+1)-3 823 823 ELSEIF(nbondj == -1) THEN 824 iw_b(4) = jpizoom+ nimppt(nono+1)825 ie_b(4) = jpizoom+ nimppt(nono+1)+nlcit(nono+1)-3826 is_b(4) = jpjzoom+ njmppt(nono+1)827 in_b(4) = jpjzoom+ njmppt(nono+1)+nlcjt(nono+1)-3824 iw_b(4) = 1 + nimppt(nono+1) 825 ie_b(4) = 1 + nimppt(nono+1)+nlcit(nono+1)-3 826 is_b(4) = 1 + njmppt(nono+1) 827 in_b(4) = 1 + njmppt(nono+1)+nlcjt(nono+1)-3 828 828 ENDIF 829 829 … … 899 899 ! idx_bdy(ib_bdy)%nbi(icount,igrd) = nbidta(ib,igrd,ib_bdy)- mig(1)+1 900 900 ! idx_bdy(ib_bdy)%nbj(icount,igrd) = nbjdta(ib,igrd,ib_bdy)- mjg(1)+1 901 idx_bdy(ib_bdy)%nbi(icount,igrd) = nbidta(ib,igrd,ib_bdy)- mig(1)+ jpizoom902 idx_bdy(ib_bdy)%nbj(icount,igrd) = nbjdta(ib,igrd,ib_bdy)- mjg(1)+ jpjzoom901 idx_bdy(ib_bdy)%nbi(icount,igrd) = nbidta(ib,igrd,ib_bdy)- mig(1)+1 902 idx_bdy(ib_bdy)%nbj(icount,igrd) = nbjdta(ib,igrd,ib_bdy)- mjg(1)+1 903 903 ! check if point has to be sent 904 904 ii = idx_bdy(ib_bdy)%nbi(icount,igrd) -
branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/BDY/bdytides.F90
r6140 r7277 100 100 101 101 DO ib_bdy = 1, nb_bdy 102 IF( nn_dyn2d_dta(ib_bdy) .ge.2 ) THEN103 102 IF( nn_dyn2d_dta(ib_bdy) >= 2 ) THEN 103 ! 104 104 td => tides(ib_bdy) 105 105 nblen => idx_bdy(ib_bdy)%nblen … … 134 134 ! JC: If FRS scheme is used, we assume that tidal is needed over the whole 135 135 ! relaxation area 136 IF( cn_dyn2d(ib_bdy) == 'frs' ) THEN 137 ilen0(:)=nblen(:) 138 ELSE 139 ilen0(:)=nblenrim(:) 136 IF( cn_dyn2d(ib_bdy) == 'frs' ) THEN ; ilen0(:) = nblen (:) 137 ELSE ; ilen0(:) = nblenrim(:) 140 138 ENDIF 141 139 … … 156 154 td%v (:,:,:) = 0._wp 157 155 158 IF (ln_bdytide_2ddta) THEN156 IF( ln_bdytide_2ddta ) THEN 159 157 ! It is assumed that each data file contains all complex harmonic amplitudes 160 ! given on the data domain (ie global, jpidta x jpjdta)161 ! 162 CALL wrk_alloc( jpi, jpj,zti, ztr )158 ! given on the global domain (ie global, jpiglo x jpjglo) 159 ! 160 CALL wrk_alloc( jpi,jpj, zti, ztr ) 163 161 ! 164 162 ! SSH fields 165 163 clfile = TRIM(filtide)//'_grid_T.nc' 166 CALL iom_open (clfile , inum )164 CALL iom_open( clfile , inum ) 167 165 igrd = 1 ! Everything is at T-points here 168 166 DO itide = 1, nb_harmo 169 CALL iom_get ( inum, jpdom_data, TRIM(Wave(ntide(itide))%cname_tide)//'_z1', ztr(:,:) )170 CALL iom_get ( inum, jpdom_data, TRIM(Wave(ntide(itide))%cname_tide)//'_z2', zti(:,:) )167 CALL iom_get( inum, jpdom_autoglo, TRIM(Wave(ntide(itide))%cname_tide)//'_z1', ztr(:,:) ) 168 CALL iom_get( inum, jpdom_autoglo, TRIM(Wave(ntide(itide))%cname_tide)//'_z2', zti(:,:) ) 171 169 DO ib = 1, ilen0(igrd) 172 170 ii = idx_bdy(ib_bdy)%nbi(ib,igrd) … … 180 178 ! U fields 181 179 clfile = TRIM(filtide)//'_grid_U.nc' 182 CALL iom_open (clfile , inum )180 CALL iom_open( clfile , inum ) 183 181 igrd = 2 ! Everything is at U-points here 184 182 DO itide = 1, nb_harmo 185 CALL iom_get ( inum, jpdom_ data, TRIM(Wave(ntide(itide))%cname_tide)//'_u1', ztr(:,:) )186 CALL iom_get ( inum, jpdom_ data, TRIM(Wave(ntide(itide))%cname_tide)//'_u2', zti(:,:) )183 CALL iom_get ( inum, jpdom_autoglo, TRIM(Wave(ntide(itide))%cname_tide)//'_u1', ztr(:,:) ) 184 CALL iom_get ( inum, jpdom_autoglo, TRIM(Wave(ntide(itide))%cname_tide)//'_u2', zti(:,:) ) 187 185 DO ib = 1, ilen0(igrd) 188 186 ii = idx_bdy(ib_bdy)%nbi(ib,igrd) … … 196 194 ! V fields 197 195 clfile = TRIM(filtide)//'_grid_V.nc' 198 CALL iom_open (clfile , inum )196 CALL iom_open( clfile , inum ) 199 197 igrd = 3 ! Everything is at V-points here 200 198 DO itide = 1, nb_harmo 201 CALL iom_get ( inum, jpdom_ data, TRIM(Wave(ntide(itide))%cname_tide)//'_v1', ztr(:,:) )202 CALL iom_get ( inum, jpdom_ data, TRIM(Wave(ntide(itide))%cname_tide)//'_v2', zti(:,:) )199 CALL iom_get ( inum, jpdom_autoglo, TRIM(Wave(ntide(itide))%cname_tide)//'_v1', ztr(:,:) ) 200 CALL iom_get ( inum, jpdom_autoglo, TRIM(Wave(ntide(itide))%cname_tide)//'_v2', zti(:,:) ) 203 201 DO ib = 1, ilen0(igrd) 204 202 ii = idx_bdy(ib_bdy)%nbi(ib,igrd) … … 210 208 CALL iom_close( inum ) 211 209 ! 212 CALL wrk_dealloc( jpi, jpj,ztr, zti )210 CALL wrk_dealloc( jpi,jpj, ztr, zti ) 213 211 ! 214 212 ELSE … … 219 217 ! 220 218 ! Set map structure 221 ibmap_ptr(1)%ptr => idx_bdy(ib_bdy)%nbmap(:,1) 222 ibmap_ptr(1)%ll_unstruc = ln_coords_file(ib_bdy) 223 ibmap_ptr(2)%ptr => idx_bdy(ib_bdy)%nbmap(:,2) 224 ibmap_ptr(2)%ll_unstruc = ln_coords_file(ib_bdy) 225 ibmap_ptr(3)%ptr => idx_bdy(ib_bdy)%nbmap(:,3) 226 ibmap_ptr(3)%ll_unstruc = ln_coords_file(ib_bdy) 219 ibmap_ptr(1)%ptr => idx_bdy(ib_bdy)%nbmap(:,1) ; ibmap_ptr(1)%ll_unstruc = ln_coords_file(ib_bdy) 220 ibmap_ptr(2)%ptr => idx_bdy(ib_bdy)%nbmap(:,2) ; ibmap_ptr(2)%ll_unstruc = ln_coords_file(ib_bdy) 221 ibmap_ptr(3)%ptr => idx_bdy(ib_bdy)%nbmap(:,3) ; ibmap_ptr(3)%ll_unstruc = ln_coords_file(ib_bdy) 227 222 228 223 ! Open files and read in tidal forcing data … … 258 253 ! 259 254 DEALLOCATE( dta_read ) 255 ! 260 256 ENDIF ! ln_bdytide_2ddta=.true. 261 257 ! … … 275 271 dta_bdy_s(ib_bdy)%v2d(:) = 0._wp 276 272 ! 277 ENDIF ! nn_dyn2d_dta(ib_bdy) .ge.2273 ENDIF ! nn_dyn2d_dta(ib_bdy) >= 2 278 274 ! 279 275 END DO ! loop on ib_bdy … … 376 372 END SUBROUTINE bdytide_update 377 373 374 378 375 SUBROUTINE bdy_dta_tides( kt, kit, time_offset ) 379 376 !!---------------------------------------------------------------------- … … 422 419 423 420 DO ib_bdy = 1,nb_bdy 424 425 IF ( nn_dyn2d_dta(ib_bdy) .ge.2 ) THEN426 421 ! 422 IF( nn_dyn2d_dta(ib_bdy) >= 2 ) THEN 423 ! 427 424 nblen(1:jpbgrd) = idx_bdy(ib_bdy)%nblen(1:jpbgrd) 428 425 nblenrim(1:jpbgrd) = idx_bdy(ib_bdy)%nblenrim(1:jpbgrd) 429 430 IF( cn_dyn2d(ib_bdy) == 'frs' ) THEN 431 ilen0(:)=nblen(:) 432 ELSE 433 ilen0(:)=nblenrim(:) 426 ! 427 IF( cn_dyn2d(ib_bdy) == 'frs' ) THEN ; ilen0(:) = nblen (:) 428 ELSE ; ilen0(:) = nblenrim(:) 434 429 ENDIF 435 430 ! 436 431 ! We refresh nodal factors every day below 437 432 ! This should be done somewhere else -
branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/C1D/domc1d.F90
r6140 r7277 24 24 25 25 PUBLIC dom_c1d ! called in domcfg.F90 26 27 INTEGER :: jpizoom = 1 !: left bottom (i,j) indices of the zoom 28 INTEGER :: jpjzoom = 1 !: in data domain indices 26 29 27 30 !!---------------------------------------------------------------------- … … 82 85 ! mesh, only glamt and gphit ! 83 86 ! ============================= ! 84 87 ! 85 88 SELECT CASE( jphgr_msh ) ! type of horizontal mesh 86 89 ! 87 90 CASE ( 0 ) ! curvilinear coordinate on the sphere read in coordinate.nc file 88 91 ! 89 92 CALL iom_open( 'coordinates', inum ) 90 93 CALL iom_get( inum, jpdom_unknown, 'glamt', glamdta ) ! mig, mjg undefined at this point 91 94 CALL iom_get( inum, jpdom_unknown, 'gphit', gphidta ) ! so use jpdom_unknown not jpdom_data 92 95 CALL iom_close ( inum ) 93 96 ! 94 97 CASE ( 1 ) ! geographical mesh on the sphere with regular grid-spacing 95 98 ! 96 99 DO jj = 1, jpjdta 97 100 DO ji = 1, jpidta 98 101 zti = FLOAT( ji - 1 + nimpp - 1 ) 99 102 ztj = FLOAT( jj - 1 + njmpp - 1 ) 100 103 ! 101 104 glamdta(ji,jj) = ppglam0 + ppe1_deg * zti 102 105 gphidta(ji,jj) = ppgphi0 + ppe2_deg * ztj 103 106 END DO 104 107 END DO 105 108 ! 106 109 CASE ( 2:3 ) ! f- or beta-plane with regular grid-spacing 107 110 ! 108 111 glam0 = 0.e0 109 112 gphi0 = - ppe2_m * 1.e-3 110 113 ! 111 114 DO jj = 1, jpjdta 112 115 DO ji = 1, jpidta … … 115 118 END DO 116 119 END DO 117 120 ! 118 121 CASE ( 4 ) ! geographical mesh on the sphere, isotropic MERCATOR type 119 122 ! 120 123 IF( ppgphi0 == -90 ) CALL ctl_stop( ' Mercator grid cannot start at south pole !!!! ' ) 121 124 ! 122 125 zarg = rpi / 4. - rpi / 180. * ppgphi0 / 2. 123 126 ijeq = ABS( 180. / rpi * LOG( COS( zarg ) / SIN( zarg ) ) / ppe1_deg ) 124 127 IF( ppgphi0 > 0 ) ijeq = -ijeq 125 128 ! 126 129 DO jj = 1, jpjdta 127 130 DO ji = 1, jpidta 128 131 zti = FLOAT( ji - 1 + nimpp - 1 ) 129 132 ztj = FLOAT( jj - ijeq + njmpp - 1 ) 130 133 ! 131 134 glamdta(ji,jj) = ppglam0 + ppe1_deg * zti 132 135 gphidta(ji,jj) = 1. / rad * ASIN ( TANH( ppe1_deg * rad * ztj ) ) 133 136 END DO 134 137 END DO 135 138 ! 136 139 CASE ( 5 ) ! beta-plane with regular grid-spacing and rotated domain (GYRE configuration) 137 140 ! 138 141 zlam1 = -85 139 142 zphi1 = 29 140 ze1 = 106000. / FLOAT(jp_cfg)141 143 ze1 = 106000. / REAL( nn_cfg , wp ) 144 ! 142 145 zsin_alpha = - SQRT( 2. ) / 2. 143 146 zcos_alpha = SQRT( 2. ) / 2. 144 147 ze1deg = ze1 / (ra * rad) 145 148 ! 146 149 glam0 = zlam1 + zcos_alpha * ze1deg * FLOAT( jpjdta-2 ) ! Force global 147 150 gphi0 = zphi1 + zsin_alpha * ze1deg * FLOAT( jpjdta-2 ) 148 151 ! 149 152 DO jj = 1, jpjdta 150 153 DO ji = 1, jpidta … … 156 159 END DO 157 160 END DO 158 161 ! 159 162 CASE DEFAULT 160 163 ! 161 164 WRITE(ctmp1,*) ' bad flag value for jphgr_msh = ', jphgr_msh 162 165 CALL ctl_stop( ctmp1 ) 163 166 ! 164 167 END SELECT 165 168 -
branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/C1D/dyncor_c1d.F90
r6140 r7277 49 49 IF(lwp) WRITE(numout,*) '~~~~~~~' 50 50 51 SELECT CASE( jphgr_msh ) ! type of horizontal mesh52 !53 CASE ( 0, 1, 4 ) ! mesh on the sphere54 ff(:,:) = 2. * omega * SIN( rad * gphit(:,:) )55 !56 CASE ( 2 ) ! f-plane at ppgphi057 ff(:,:) = 2. * omega * SIN( rad * ppgphi0 )58 IF(lwp) WRITE(numout,*) ' f-plane: Coriolis parameter = constant = ', ff(1,1)59 !60 CASE ( 3 ) ! beta-plane61 zbeta = 2. * omega * COS( rad * ppgphi0 ) / ra ! beta at latitude ppgphi062 zphi0 = ppgphi0 - FLOAT( jpjglo/2) * ppe2_m *1.e-3 / ( ra * rad ) ! latitude of the first row F-points63 zf0 = 2. * omega * SIN( rad * zphi0 ) ! compute f0 1st point south64 ff(:,:) = ( zf0 + zbeta * gphit(:,:) * 1.e+3 ) ! f = f0 +beta* y ( y=0 at south)65 IF(lwp) WRITE(numout,*) ' Beta-plane: Beta parameter = constant = ', ff(1,1)66 IF(lwp) WRITE(numout,*) ' Coriolis parameter varies from ', ff(1,1),' to ', ff(1,jpj)67 !68 CASE ( 5 ) ! beta-plane and rotated domain69 zbeta = 2. * omega * COS( rad * ppgphi0 ) / ra ! beta at latitude ppgphi070 zphi0 = 15.e0 ! latitude of the first row F-points71 zf0 = 2. * omega * SIN( rad * zphi0 ) ! compute f0 1st point south72 ff(:,:) = ( zf0 + zbeta * ABS( gphit(:,:) - zphi0 ) * rad * ra ) ! f = f0 +beta* y ( y=0 at south)73 IF(lwp) WRITE(numout,*) ' Beta-plane: Beta parameter = constant = ', ff(1,1)74 IF(lwp) WRITE(numout,*) ' Coriolis parameter varies from ', ff(1,1),' to ', ff(1,jpj)75 !76 END SELECT77 51 ! 78 52 END SUBROUTINE cor_c1d … … 100 74 DO jj = 2, jpjm1 101 75 DO ji = fs_2, fs_jpim1 ! vector opt. 102 ua(ji,jj,jk) = ua(ji,jj,jk) + ff (ji,jj) * vn(ji,jj,jk)103 va(ji,jj,jk) = va(ji,jj,jk) - ff (ji,jj) * un(ji,jj,jk)76 ua(ji,jj,jk) = ua(ji,jj,jk) + ff_t(ji,jj) * vn(ji,jj,jk) 77 va(ji,jj,jk) = va(ji,jj,jk) - ff_t(ji,jj) * un(ji,jj,jk) 104 78 END DO 105 79 END DO -
branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/CRS/crsdom.F90
r6140 r7277 2023 2023 nimpp_crs = nimppt_crs(nproc + 1) 2024 2024 2025 ! No coarsening with zoom2026 IF( jpizoom /= 1 .OR. jpjzoom /= 1) STOP2027 2028 2025 DO ji = 1, jpi_crs 2029 2026 mig_crs(ji) = ji + nimpp_crs - 1 -
branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/CRS/crsini.F90
r6140 r7277 11 11 !!---------------------------------------------------------------------- 12 12 USE par_kind, ONLY: wp 13 USE par_oce ! For parameter jpi,jpj ,jphgr_msh13 USE par_oce ! For parameter jpi,jpj 14 14 USE dom_oce ! For parameters in par_oce 15 15 USE crs ! Coarse grid domain … … 170 170 ! 3.c.2 Coriolis factor 171 171 172 SELECT CASE( jphgr_msh ) ! type of horizontal mesh 173 174 CASE ( 0, 1, 4 ) ! mesh on the sphere 175 176 ff_crs(:,:) = 2. * omega * SIN( rad * gphif_crs(:,:) ) 177 178 CASE DEFAULT 179 180 IF(lwp) WRITE(numout,*) 'crsini.F90. crs_init. Only jphgr_msh = 0, 1 or 4 supported' 172 !!gm Not sure CRS needs Coriolis parameter.... 173 !!gm If needed, then update this to have Coriolis at both f- and t-points 174 175 ff_crs(:,:) = 2. * omega * SIN( rad * gphif_crs(:,:) ) 176 177 CALL ctl_warn( 'crsini: CAUTION, CRS only designed for Coriolis defined on the sphere' ) 181 178 182 END SELECT183 179 184 180 ! 3.d.1 mbathy ( vertical k-levels of bathymetry ) -
branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/DIA/diadct.F90
r6140 r7277 392 392 ENDIF 393 393 394 IF( iptglo .NE.0 )THEN394 IF( iptglo /= 0 )THEN 395 395 396 396 !read points'coordinates and directions … … 399 399 directemp(:) = 0 !value of directions of each points 400 400 DO jpt=1,iptglo 401 READ(numdct_in) i1,i2401 READ(numdct_in) i1, i2 402 402 coordtemp(jpt)%I = i1 403 403 coordtemp(jpt)%J = i2 404 404 ENDDO 405 READ(numdct_in) directemp(1:iptglo)405 READ(numdct_in) directemp(1:iptglo) 406 406 407 407 !debug … … 416 416 !Now each proc selects only points that are in its domain: 417 417 !-------------------------------------------------------- 418 iptloc = 0 ! initialize number of points selected419 DO jpt =1,iptglo !loop on listpoint read in the file420 418 iptloc = 0 ! initialize number of points selected 419 DO jpt = 1, iptglo ! loop on listpoint read in the file 420 ! 421 421 iiglo=coordtemp(jpt)%I ! global coordinates of the point 422 422 ijglo=coordtemp(jpt)%J ! " 423 423 424 IF( iiglo==jpi dta .AND. nimpp==1 ) iiglo = 2425 426 iiloc=iiglo- jpizoom+1-nimpp+1 ! local coordinates of the point427 ijloc=ijglo- jpjzoom+1-njmpp+1 ! "424 IF( iiglo==jpiglo .AND. nimpp==1 ) iiglo = 2 !!gm BUG: Hard coded periodicity ! 425 426 iiloc=iiglo-nimpp+1 ! local coordinates of the point 427 ijloc=ijglo-njmpp+1 ! " 428 428 429 429 !verify if the point is on the local domain:(1,nlei)*(1,nlej) 430 IF( iiloc .GE. 1 .AND. iiloc .LE.nlei .AND. &431 ijloc .GE. 1 .AND. ijloc .LE.nlej )THEN430 IF( iiloc >= 1 .AND. iiloc <= nlei .AND. & 431 ijloc >= 1 .AND. ijloc <= nlej )THEN 432 432 iptloc = iptloc + 1 ! count local points 433 433 secs(jsec)%listPoint(iptloc) = POINT_SECTION(mi0(iiglo),mj0(ijglo)) ! store local coordinates 434 434 secs(jsec)%direction(iptloc) = directemp(jpt) ! store local direction 435 435 ENDIF 436 437 END DO436 ! 437 END DO 438 438 439 439 secs(jsec)%nb_point=iptloc !store number of section's points … … 444 444 WRITE(numout,*)" List of points selected by the proc:" 445 445 DO jpt = 1,iptloc 446 iiglo = secs(jsec)%listPoint(jpt)%I + jpizoom - 1 +nimpp - 1447 ijglo = secs(jsec)%listPoint(jpt)%J + jpjzoom - 1 +njmpp - 1446 iiglo = secs(jsec)%listPoint(jpt)%I + nimpp - 1 447 ijglo = secs(jsec)%listPoint(jpt)%J + njmpp - 1 448 448 WRITE(numout,*)' # I J : ',iiglo,ijglo 449 449 ENDDO … … 452 452 IF(jsec==nn_secdebug .AND. secs(jsec)%nb_point .NE. 0)THEN 453 453 DO jpt = 1,iptloc 454 iiglo = secs(jsec)%listPoint(jpt)%I + jpizoom - 1 +nimpp - 1455 ijglo = secs(jsec)%listPoint(jpt)%J + jpjzoom - 1 +njmpp - 1454 iiglo = secs(jsec)%listPoint(jpt)%I + nimpp - 1 455 ijglo = secs(jsec)%listPoint(jpt)%J + njmpp - 1 456 456 ENDDO 457 457 ENDIF … … 468 468 IF(jsec==nn_secdebug .AND. secs(jsec)%nb_point .NE. 0)THEN 469 469 DO jpt = 1,secs(jsec)%nb_point 470 iiglo = secs(jsec)%listPoint(jpt)%I + jpizoom - 1 +nimpp - 1471 ijglo = secs(jsec)%listPoint(jpt)%J + jpjzoom - 1 +njmpp - 1470 iiglo = secs(jsec)%listPoint(jpt)%I + nimpp - 1 471 ijglo = secs(jsec)%listPoint(jpt)%J + njmpp - 1 472 472 ENDDO 473 473 ENDIF … … 479 479 iptloc = secs(jsec)%nb_point 480 480 DO jpt = 1,iptloc 481 iiglo = secs(jsec)%listPoint(jpt)%I + jpizoom - 1 +nimpp - 1482 ijglo = secs(jsec)%listPoint(jpt)%J + jpjzoom - 1 +njmpp - 1481 iiglo = secs(jsec)%listPoint(jpt)%I + nimpp - 1 482 ijglo = secs(jsec)%listPoint(jpt)%J + njmpp - 1 483 483 WRITE(numout,*)' # I J : ',iiglo,ijglo 484 484 CALL FLUSH(numout) -
branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/DIA/diatmb.F90
r6140 r7277 4 4 !! Harmonic analysis of tidal constituents 5 5 !!====================================================================== 6 !! History : 3.6 ! 2014 (E O'Dea) Original code 6 !! History : 3.6 ! 08-2014 (E O'Dea) Original code 7 !! 3.7 ! 05-2016 (G. Madec) use mbkt, mikt to account for ocean cavities 7 8 !!---------------------------------------------------------------------- 8 9 USE oce ! ocean dynamics and tracers variables 9 10 USE dom_oce ! ocean space and time domain 11 ! 10 12 USE in_out_manager ! I/O units 11 13 USE iom ! I/0 library … … 31 33 !! *** ROUTINE dia_tmb_init *** 32 34 !! 33 !! ** Purpose :Initialization of tmb namelist35 !! ** Purpose : Initialization of tmb namelist 34 36 !! 35 !! ** Method : Read namelist 36 !! History 37 !! 3.6 ! 08-14 (E. O'Dea) Routine to initialize dia_tmb 37 !! ** Method : Read namelist 38 38 !!--------------------------------------------------------------------------- 39 !!40 39 INTEGER :: ios ! Local integer output status for namelist read 41 40 ! … … 59 58 WRITE(numout,*) 'Switch for TMB diagnostics (T) or not (F) ln_diatmb = ', ln_diatmb 60 59 ENDIF 61 60 ! 62 61 END SUBROUTINE dia_tmb_init 63 62 64 SUBROUTINE dia_calctmb( pinfield,pouttmb ) 63 64 SUBROUTINE dia_calctmb( pfield, ptmb ) 65 65 !!--------------------------------------------------------------------- 66 66 !! *** ROUTINE dia_tmb *** … … 68 68 !! ** Purpose : Find the Top, Mid and Bottom fields of water Column 69 69 !! 70 !! ** Method : 71 !! use mbathy to find surface, mid and bottom of model levels70 !! ** Method : use mbkt, mikt to find surface, mid and bottom of 71 !! model levels due to potential existence of ocean cavities 72 72 !! 73 !! History :74 !! 3.6 ! 08-14 (E. O'Dea) Routine based on dia_wri_foam75 73 !!---------------------------------------------------------------------- 76 !! * Modules used 77 78 ! Routine to map 3d field to top, middle, bottom 79 IMPLICIT NONE 80 81 82 ! Routine arguments 83 REAL(wp), DIMENSION(jpi, jpj, jpk), INTENT(IN ) :: pinfield ! Input 3d field and mask 84 REAL(wp), DIMENSION(jpi, jpj, 3 ), INTENT( OUT) :: pouttmb ! Output top, middle, bottom 85 86 87 88 ! Local variables 89 INTEGER :: ji,jj,jk ! Dummy loop indices 90 91 ! Local Real 92 REAL(wp) :: zmdi ! set masked values 93 94 zmdi=1.e+20 !missing data indicator for masking 95 96 ! Calculate top 97 pouttmb(:,:,1) = pinfield(:,:,1)*tmask(:,:,1) + zmdi*(1.0-tmask(:,:,1)) 98 99 ! Calculate middle 100 DO jj = 1,jpj 101 DO ji = 1,jpi 102 jk = max(1,mbathy(ji,jj)/2) 103 pouttmb(ji,jj,2) = pinfield(ji,jj,jk)*tmask(ji,jj,jk) + zmdi*(1.0-tmask(ji,jj,jk)) 74 REAL(wp), DIMENSION(jpi, jpj, jpk), INTENT(in ) :: pfield ! Input 3d field and mask 75 REAL(wp), DIMENSION(jpi, jpj, 3 ), INTENT( out) :: ptmb ! top, middle, bottom extracted from pfield 76 ! 77 INTEGER :: ji, jj ! Dummy loop indices 78 INTEGER :: itop, imid, ibot ! local integers 79 REAL(wp) :: zmdi = 1.e+20_wp ! land value 80 !!--------------------------------------------------------------------- 81 ! 82 DO jj = 1, jpj 83 DO ji = 1, jpi 84 itop = mikt(ji,jj) ! top ocean 85 ibot = mbkt(ji,jj) ! bottom ocean 86 imid = itop + ( ibot - itop + 1 ) / 2 ! middle ocean 87 ! 88 ptmb(ji,jj,1) = pfield(ji,jj,itop)*tmask(ji,jj,itop) + zmdi*( 1._wp-tmask(ji,jj,itop) ) 89 ptmb(ji,jj,2) = pfield(ji,jj,imid)*tmask(ji,jj,imid) + zmdi*( 1._wp-tmask(ji,jj,imid) ) 90 ptmb(ji,jj,3) = pfield(ji,jj,ibot)*tmask(ji,jj,ibot) + zmdi*( 1._wp-tmask(ji,jj,ibot) ) 104 91 END DO 105 92 END DO 106 107 ! Calculate bottom 108 DO jj = 1,jpj 109 DO ji = 1,jpi 110 jk = max(1,mbathy(ji,jj) - 1) 111 pouttmb(ji,jj,3) = pinfield(ji,jj,jk)*tmask(ji,jj,jk) + zmdi*(1.0-tmask(ji,jj,jk)) 112 END DO 113 END DO 114 93 ! 115 94 END SUBROUTINE dia_calctmb 116 117 95 118 96 … … 122 100 !! ** Purpose : Write diagnostics for Top, Mid and Bottom of water Column 123 101 !! 124 !! ** Method : 125 !! use mbathy to find surface, mid and bottom of model levels 102 !! ** Method : use mikt,mbkt to find surface, mid and bottom of model levels 126 103 !! calls calctmb to retrieve TMB values before sending to iom_put 127 104 !! 128 !! History :129 !! 3.6 ! 08-14 (E. O'Dea)130 !!131 105 !!-------------------------------------------------------------------- 132 REAL(wp), POINTER, DIMENSION(:,:,:) :: zwtmb ! temporary workspace 133 REAL(wp) :: zmdi ! set masked values 134 135 zmdi=1.e+20 !missing data indicator for maskin 136 106 REAL(wp) :: zmdi =1.e+20 ! land value 107 REAL(wp), POINTER, DIMENSION(:,:,:) :: zwtmb ! workspace 108 !!-------------------------------------------------------------------- 109 ! 137 110 IF (ln_diatmb) THEN 138 CALL wrk_alloc( jpi , jpj, 3, zwtmb )111 CALL wrk_alloc( jpi,jpj,3 , zwtmb ) 139 112 CALL dia_calctmb( tsn(:,:,:,jp_tem),zwtmb ) 140 113 !ssh already output but here we output it masked 141 CALL iom_put( "sshnmasked" , sshn(:,:)*tmask(:,:,1) + zmdi*(1.0 - tmask(:,:,1)) ) ! tmb Temperature114 CALL iom_put( "sshnmasked" , sshn(:,:)*tmask(:,:,1) + zmdi*(1.0 - tmask(:,:,1)) ) 142 115 CALL iom_put( "top_temp" , zwtmb(:,:,1) ) ! tmb Temperature 143 116 CALL iom_put( "mid_temp" , zwtmb(:,:,2) ) ! tmb Temperature … … 161 134 CALL iom_put( "bot_v" , zwtmb(:,:,3) ) ! tmb V Velocity 162 135 !Called in dynspg_ts.F90 CALL iom_put( "baro_v" , vn_b ) ! Barotropic V Velocity 136 CALL wrk_dealloc( jpi,jpj,3 , zwtmb ) 163 137 ELSE 164 138 CALL ctl_warn('dia_tmb: tmb diagnostic is set to false you should not have seen this') 165 139 ENDIF 166 140 ! 167 141 END SUBROUTINE dia_tmb 168 142 !!====================================================================== -
branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/DIA/diawri.F90
r6387 r7277 666 666 CALL histdef( nid_T, "so28chgt", "Depth of 28C isotherm" , "m" , & ! hd28 667 667 & jpi, jpj, nh_T, 1 , 1, 1 , -99 , 32, clop, zsto, zout ) 668 CALL histdef( nid_T, "sohtc300", "Heat content 300 m" , " W", & ! htc3668 CALL histdef( nid_T, "sohtc300", "Heat content 300 m" , "J/m2" , & ! htc3 669 669 & jpi, jpj, nh_T, 1 , 1, 1 , -99 , 32, clop, zsto, zout ) 670 670 #endif -
branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/DOM/daymod.F90
r6140 r7277 2 2 !!====================================================================== 3 3 !! *** MODULE daymod *** 4 !! Ocean :calendar4 !! Ocean : management of the model calendar 5 5 !!===================================================================== 6 6 !! History : OPA ! 1994-09 (M. Pontaud M. Imbard) Original code … … 16 16 !!---------------------------------------------------------------------- 17 17 !! day : calendar 18 !! 19 !! ------------------------------- 20 !! ----------- WARNING ----------- 21 !! 22 !! we suppose that the time step is deviding the number of second of in a day 23 !! ---> MOD( rday, rdt ) == 0 24 !! 25 !! ----------- WARNING ----------- 26 !! ------------------------------- 27 !! 18 !!---------------------------------------------------------------------- 19 !! ----------- WARNING ----------- 20 !! ------------------------------- 21 !! sbcmod assume that the time step is dividing the number of second of 22 !! in a day, i.e. ===> MOD( rday, rdt ) == 0 23 !! except when user defined forcing is used (see sbcmod.F90) 28 24 !!---------------------------------------------------------------------- 29 25 USE dom_oce ! ocean space and time domain 30 26 USE phycst ! physical constants 27 USE ioipsl , ONLY : ymds2ju ! for calendar 28 USE trc_oce , ONLY : lk_offline ! offline flag 29 ! 31 30 USE in_out_manager ! I/O manager 31 USE prtctl ! Print control 32 32 USE iom ! 33 USE ioipsl , ONLY : ymds2ju ! for calendar34 USE prtctl ! Print control35 USE trc_oce , ONLY : lk_offline ! offline flag36 33 USE timing ! Timing 37 34 USE restart ! restart … … 47 44 48 45 !!---------------------------------------------------------------------- 49 !! NEMO/OPA 3.3 , NEMO Consortium (2010)46 !! NEMO/OPA 4.0 , NEMO Consortium (2016) 50 47 !! $Id$ 51 48 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) … … 70 67 !! - nmonth_len, nyear_len, nmonth_half, nmonth_end through day_mth 71 68 !!---------------------------------------------------------------------- 72 INTEGER :: inbday, idweek 73 REAL(wp) :: zjul 69 INTEGER :: inbday, idweek ! local integers 70 REAL(wp) :: zjul ! local scalar 74 71 !!---------------------------------------------------------------------- 75 72 ! … … 79 76 & 'You must do a restart at higher frequency (or remove this stop and recompile the code in I8)' ) 80 77 ENDIF 81 ! all calendar staff is based on the fact that MOD( rday, rdt ) == 0 82 IF( MOD( rday , rdt ) /= 0. ) CALL ctl_stop( 'the time step must devide the number of second of in a day' ) 83 IF( MOD( rday , 2. ) /= 0. ) CALL ctl_stop( 'the number of second of in a day must be an even number' ) 84 IF( MOD( rdt , 2. ) /= 0. ) CALL ctl_stop( 'the time step (in second) must be an even number' ) 85 nsecd = NINT(rday ) 86 nsecd05 = NINT(0.5 * rday ) 87 ndt = NINT( rdt ) 88 ndt05 = NINT(0.5 * rdt ) 89 90 IF( .NOT. lk_offline ) CALL day_rst( nit000, 'READ' ) 78 nsecd = NINT( rday ) 79 nsecd05 = NINT( 0.5 * rday ) 80 ndt = NINT( rdt ) 81 ndt05 = NINT( 0.5 * rdt ) 82 83 IF( .NOT. lk_offline ) CALL day_rst( nit000, 'READ' ) 91 84 92 85 ! set the calandar from ndastp (read in restart file and namelist) 93 94 86 nyear = ndastp / 10000 95 87 nmonth = ( ndastp - (nyear * 10000) ) / 100 -
branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/DOM/dom_oce.F90
r6140 r7277 29 29 !! time & space domain namelist 30 30 !! ---------------------------- 31 ! !!* Namelist namdom : time & space domain * 32 INTEGER , PUBLIC :: nn_bathy !: = 0/1 ,compute/read the bathymetry file 33 REAL(wp), PUBLIC :: rn_bathy !: depth of flat bottom (active if nn_bathy=0; if =0 depth=jpkm1) 34 REAL(wp), PUBLIC :: rn_hmin !: minimum ocean depth (>0) or minimum number of ocean levels (<0) 35 REAL(wp), PUBLIC :: rn_isfhmin !: threshold to discriminate grounded ice to floating ice 36 REAL(wp), PUBLIC :: rn_e3zps_min !: miminum thickness for partial steps (meters) 37 REAL(wp), PUBLIC :: rn_e3zps_rat !: minimum thickness ration for partial steps 38 INTEGER , PUBLIC :: nn_msh !: = 1 create a mesh-mask file 39 REAL(wp), PUBLIC :: rn_atfp !: asselin time filter parameter 40 REAL(wp), PUBLIC :: rn_rdt !: time step for the dynamics and tracer 41 INTEGER , PUBLIC :: nn_closea !: =0 suppress closed sea/lake from the ORCA domain or not (=1) 42 INTEGER , PUBLIC :: nn_euler !: =0 start with forward time step or not (=1) 31 ! !!* Namelist namdom : time & space domain * 32 LOGICAL , PUBLIC :: ln_linssh !: =T linear free surface ==>> model level are fixed in time 33 INTEGER , PUBLIC :: nn_closea !: =0 suppress closed sea/lake from the ORCA domain or not (=1) 34 INTEGER , PUBLIC :: nn_msh !: >0 create a mesh-mask file (mesh_mask.nc) 35 REAL(wp), PUBLIC :: rn_isfhmin !: threshold to discriminate grounded ice to floating ice 36 REAL(wp), PUBLIC :: rn_rdt !: time step for the dynamics and tracer 37 REAL(wp), PUBLIC :: rn_atfp !: asselin time filter parameter 38 INTEGER , PUBLIC :: nn_euler !: =0 start with forward time step or not (=1) 43 39 LOGICAL , PUBLIC :: ln_iscpl !: coupling with ice sheet 44 LOGICAL , PUBLIC :: ln_crs 40 LOGICAL , PUBLIC :: ln_crs !: Apply grid coarsening to dynamical model output or online passive tracers 45 41 46 42 !! Free surface parameters 47 43 !! ======================= 48 LOGICAL , PUBLIC :: ln_dynspg_exp 49 LOGICAL , PUBLIC :: ln_dynspg_ts 44 LOGICAL , PUBLIC :: ln_dynspg_exp !: Explicit free surface flag 45 LOGICAL , PUBLIC :: ln_dynspg_ts !: Split-Explicit free surface flag 50 46 51 47 !! Time splitting parameters 52 48 !! ========================= 53 LOGICAL, PUBLIC :: ln_bt_fw !: Forward integration of barotropic sub-stepping 54 LOGICAL, PUBLIC :: ln_bt_av !: Time averaging of barotropic variables 55 LOGICAL, PUBLIC :: ln_bt_auto !: Set number of barotropic iterations automatically 56 INTEGER, PUBLIC :: nn_bt_flt !: Filter choice 57 INTEGER, PUBLIC :: nn_baro !: Number of barotropic iterations during one baroclinic step (rdt) 58 REAL(wp), PUBLIC :: rn_bt_cmax !: Maximum allowed courant number (used if ln_bt_auto=T) 59 60 !! Horizontal grid parameters for domhgr 61 !! ===================================== 62 INTEGER :: jphgr_msh !: type of horizontal mesh 63 ! ! = 0 curvilinear coordinate on the sphere read in coordinate.nc 64 ! ! = 1 geographical mesh on the sphere with regular grid-spacing 65 ! ! = 2 f-plane with regular grid-spacing 66 ! ! = 3 beta-plane with regular grid-spacing 67 ! ! = 4 Mercator grid with T/U point at the equator 68 69 REAL(wp) :: ppglam0 !: longitude of first raw and column T-point (jphgr_msh = 1) 70 REAL(wp) :: ppgphi0 !: latitude of first raw and column T-point (jphgr_msh = 1) 71 ! ! used for Coriolis & Beta parameters (jphgr_msh = 2 or 3) 72 REAL(wp) :: ppe1_deg !: zonal grid-spacing (degrees) 73 REAL(wp) :: ppe2_deg !: meridional grid-spacing (degrees) 74 REAL(wp) :: ppe1_m !: zonal grid-spacing (degrees) 75 REAL(wp) :: ppe2_m !: meridional grid-spacing (degrees) 76 77 !! Vertical grid parameter for domzgr 78 !! ================================== 79 REAL(wp) :: ppsur !: ORCA r4, r2 and r05 coefficients 80 REAL(wp) :: ppa0 !: (default coefficients) 81 REAL(wp) :: ppa1 !: 82 REAL(wp) :: ppkth !: 83 REAL(wp) :: ppacr !: 84 ! 85 ! If both ppa0 ppa1 and ppsur are specified to 0, then 86 ! they are computed from ppdzmin, pphmax , ppkth, ppacr in dom_zgr 87 REAL(wp) :: ppdzmin !: Minimum vertical spacing 88 REAL(wp) :: pphmax !: Maximum depth 89 ! 90 LOGICAL :: ldbletanh !: Use/do not use double tanf function for vertical coordinates 91 REAL(wp) :: ppa2 !: Double tanh function parameters 92 REAL(wp) :: ppkth2 !: 93 REAL(wp) :: ppacr2 !: 94 95 ! !! old non-DOCTOR names still used in the model 96 INTEGER , PUBLIC :: ntopo !: = 0/1 ,compute/read the bathymetry file 97 REAL(wp), PUBLIC :: e3zps_min !: miminum thickness for partial steps (meters) 98 REAL(wp), PUBLIC :: e3zps_rat !: minimum thickness ration for partial steps 99 INTEGER , PUBLIC :: nmsh !: = 1 create a mesh-mask file 100 REAL(wp), PUBLIC :: atfp !: asselin time filter parameter 101 REAL(wp), PUBLIC :: rdt !: time step for the dynamics and tracer 102 103 ! !!! associated variables 104 INTEGER , PUBLIC :: neuler !: restart euler forward option (0=Euler) 105 REAL(wp), PUBLIC :: atfp1 !: asselin time filter coeff. (atfp1= 1-2*atfp) 106 REAL(wp), PUBLIC :: r2dt !: = 2*rdt except at nit000 (=rdt) if neuler=0 49 LOGICAL, PUBLIC :: ln_bt_fw !: Forward integration of barotropic sub-stepping 50 LOGICAL, PUBLIC :: ln_bt_av !: Time averaging of barotropic variables 51 LOGICAL, PUBLIC :: ln_bt_auto !: Set number of barotropic iterations automatically 52 INTEGER, PUBLIC :: nn_bt_flt !: Filter choice 53 INTEGER, PUBLIC :: nn_baro !: Number of barotropic iterations during one baroclinic step (rdt) 54 REAL(wp), PUBLIC :: rn_bt_cmax !: Maximum allowed courant number (used if ln_bt_auto=T) 55 56 57 ! !! old non-DOCTOR names still used in the model 58 REAL(wp), PUBLIC :: atfp !: asselin time filter parameter 59 REAL(wp), PUBLIC :: rdt !: time step for the dynamics and tracer 60 61 ! !!! associated variables 62 INTEGER , PUBLIC :: neuler !: restart euler forward option (0=Euler) 63 REAL(wp), PUBLIC :: r2dt !: = 2*rdt except at nit000 (=rdt) if neuler=0 107 64 108 65 !!---------------------------------------------------------------------- 109 66 !! space domain parameters 110 67 !!---------------------------------------------------------------------- 111 LOGICAL, PUBLIC :: lzoom = .FALSE. !: zoom flag 112 LOGICAL, PUBLIC :: lzoom_e = .FALSE. !: East zoom type flag 113 LOGICAL, PUBLIC :: lzoom_w = .FALSE. !: West zoom type flag 114 LOGICAL, PUBLIC :: lzoom_s = .FALSE. !: South zoom type flag 115 LOGICAL, PUBLIC :: lzoom_n = .FALSE. !: North zoom type flag 116 117 ! !!! domain parameters linked to mpp 118 INTEGER, PUBLIC :: nperio !: type of lateral boundary condition 119 INTEGER, PUBLIC :: nimpp, njmpp !: i- & j-indexes for mpp-subdomain left bottom 120 INTEGER, PUBLIC :: nreci, nrecj !: overlap region in i and j 121 INTEGER, PUBLIC :: nproc !: number for local processor 122 INTEGER, PUBLIC :: narea !: number for local area 123 INTEGER, PUBLIC :: nbondi, nbondj !: mark of i- and j-direction local boundaries 68 INTEGER, PUBLIC :: jperio !: Global domain lateral boundary type (between 0 and 6) 69 ! ! = 0 closed ; = 1 cyclic East-West 70 ! ! = 2 equatorial symmetric ; = 3 North fold T-point pivot 71 ! ! = 4 cyclic East-West AND North fold T-point pivot 72 ! ! = 5 North fold F-point pivot 73 ! ! = 6 cyclic East-West AND North fold F-point pivot 74 INTEGER, PUBLIC :: nperio !: Local domain lateral boundary type (deduced from jperio and MPP decomposition) 75 76 ! ! domain MPP decomposition parameters 77 INTEGER , PUBLIC :: nimpp, njmpp !: i- & j-indexes for mpp-subdomain left bottom 78 INTEGER , PUBLIC :: nreci, nrecj !: overlap region in i and j 79 INTEGER , PUBLIC :: nproc !: number for local processor 80 INTEGER , PUBLIC :: narea !: number for local area 81 INTEGER , PUBLIC :: nbondi, nbondj !: mark of i- and j-direction local boundaries 124 82 INTEGER, ALLOCATABLE, PUBLIC :: nbondi_bdy(:) !: mark i-direction local boundaries for BDY open boundaries 125 83 INTEGER, ALLOCATABLE, PUBLIC :: nbondj_bdy(:) !: mark j-direction local boundaries for BDY open boundaries … … 140 98 INTEGER, PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: mig !: local ==> global domain i-index 141 99 INTEGER, PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: mjg !: local ==> global domain j-index 142 INTEGER, PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: mi0, mi1 !: global ==> local domain i-index !!bug ==> other solution?143 ! ! (mi0=1 and mi1=0 if the global indexis not in the local domain)144 INTEGER, PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: mj0, mj1 !: global ==> local domain j-index !!bug ==> other solution?145 ! ! (mi0=1 and mi1=0 if the global indexis not in the local domain)100 INTEGER, PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: mi0, mi1 !: global ==> local domain i-index (mi0=1 and mi1=0 if the global index 101 ! ! is not in the local domain) 102 INTEGER, PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: mj0, mj1 !: global ==> local domain j-index (mj0=1 and mj1=0 if the global index 103 ! ! is not in the local domain) 146 104 INTEGER, PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: nimppt, njmppt !: i-, j-indexes for each processor 147 105 INTEGER, PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: ibonit, ibonjt !: i-, j- processor neighbour existence … … 154 112 !! horizontal curvilinear coordinate and scale factors 155 113 !! --------------------------------------------------------------------- 156 REAL(wp), PUBLIC, ALLOCATABLE, SAVE , DIMENSION(:,:) :: glamt , glamu, glamv , glamf !: longitude at t, u, v, f-points [degree]157 REAL(wp), PUBLIC, ALLOCATABLE, SAVE , DIMENSION(:,:) :: gphit , gphiu, gphiv , gphif !: latitude at t, u, v, f-points [degree]114 REAL(wp), PUBLIC, ALLOCATABLE, SAVE , DIMENSION(:,:) :: glamt , glamu, glamv , glamf !: longitude at t, u, v, f-points [degree] 115 REAL(wp), PUBLIC, ALLOCATABLE, SAVE , DIMENSION(:,:) :: gphit , gphiu, gphiv , gphif !: latitude at t, u, v, f-points [degree] 158 116 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, TARGET, DIMENSION(:,:) :: e1t , e2t , r1_e1t, r1_e2t !: t-point horizontal scale factors [m] 159 117 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, TARGET, DIMENSION(:,:) :: e1u , e2u , r1_e1u, r1_e2u !: horizontal scale factors at u-point [m] … … 161 119 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, TARGET, DIMENSION(:,:) :: e1f , e2f , r1_e1f, r1_e2f !: horizontal scale factors at f-point [m] 162 120 ! 163 REAL(wp), PUBLIC, ALLOCATABLE, SAVE , DIMENSION(:,:) :: e1e2t , r1_e1e2t !: associated metrics at t-point164 REAL(wp), PUBLIC, ALLOCATABLE, SAVE , DIMENSION(:,:) :: e1e2u , r1_e1e2u , e2_e1u !: associated metrics at u-point165 REAL(wp), PUBLIC, ALLOCATABLE, SAVE , DIMENSION(:,:) :: e1e2v , r1_e1e2v , e1_e2v !: associated metrics at v-point166 REAL(wp), PUBLIC, ALLOCATABLE, SAVE , DIMENSION(:,:) :: e1e2f , r1_e1e2f !: associated metrics at f-point121 REAL(wp), PUBLIC, ALLOCATABLE, SAVE , DIMENSION(:,:) :: e1e2t , r1_e1e2t !: associated metrics at t-point 122 REAL(wp), PUBLIC, ALLOCATABLE, SAVE , DIMENSION(:,:) :: e1e2u , r1_e1e2u , e2_e1u !: associated metrics at u-point 123 REAL(wp), PUBLIC, ALLOCATABLE, SAVE , DIMENSION(:,:) :: e1e2v , r1_e1e2v , e1_e2v !: associated metrics at v-point 124 REAL(wp), PUBLIC, ALLOCATABLE, SAVE , DIMENSION(:,:) :: e1e2f , r1_e1e2f !: associated metrics at f-point 167 125 ! 168 REAL(wp), PUBLIC, ALLOCATABLE, SAVE , DIMENSION(:,:) :: ff !: coriolis factor[1/s]126 REAL(wp), PUBLIC, ALLOCATABLE, SAVE , DIMENSION(:,:) :: ff_f, ff_t !: coriolis factor at f- and t-point [1/s] 169 127 170 128 !!---------------------------------------------------------------------- 171 129 !! vertical coordinate and scale factors 172 130 !! --------------------------------------------------------------------- 173 ! !!* Namelist namzgr : vertical coordinate *174 131 LOGICAL, PUBLIC :: ln_zco !: z-coordinate - full step 175 132 LOGICAL, PUBLIC :: ln_zps !: z-coordinate - partial step 176 133 LOGICAL, PUBLIC :: ln_sco !: s-coordinate or hybrid z-s coordinate 177 134 LOGICAL, PUBLIC :: ln_isfcav !: presence of ISF 178 LOGICAL, PUBLIC :: ln_linssh !: variable grid flag179 180 135 ! ! ref. ! before ! now ! after ! 181 136 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: e3t_0 , e3t_b , e3t_n , e3t_a !: t- vert. scale factor [m] … … 207 162 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: gdept_1d, gdepw_1d !: reference depth of t- and w-points (m) 208 163 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: e3t_1d , e3w_1d !: reference vertical scale factors at T- and W-pts (m) 209 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: e3tp , e3wp !: ocean bottom level thickness at T and W points 210 211 !!gm This should be removed from here.... ==>>> only used in domzgr at initialization phase 212 !! s-coordinate and hybrid z-s-coordinate 213 !! =----------------======--------------- 214 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: gsigt, gsigw !: model level depth coefficient at t-, w-levels (analytic) 215 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: gsi3w !: model level depth coefficient at w-level (sum of gsigw) 216 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: esigt, esigw !: vertical scale factor coef. at t-, w-levels 217 218 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: hbatv , hbatf !: ocean depth at the vertical of v--f 219 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: hbatt , hbatu !: t--u points (m) 220 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: scosrf, scobot !: ocean surface and bottom topographies 221 ! ! (if deviating from coordinate surfaces in HYBRID) 222 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: hifv , hiff !: interface depth between stretching at v--f 223 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: hift , hifu !: and quasi-uniform spacing t--u points (m) 224 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: rx1 !: Maximum grid stiffness ratio 225 !!gm end 226 227 !!---------------------------------------------------------------------- 228 !! masks, bathymetry 164 165 166 !!---------------------------------------------------------------------- 167 !! masks, top and bottom ocean point position 229 168 !! --------------------------------------------------------------------- 230 INTEGER , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: mbathy !: number of ocean level (=0, 1, ... , jpk-1) 231 INTEGER , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: mbkt !: vertical index of the bottom last T- ocean level 232 INTEGER , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: mbku, mbkv !: vertical index of the bottom last U- and W- ocean level 233 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: bathy !: ocean depth (meters) 169 !!gm Proposition of new name for top/bottom vertical indices 170 ! INTEGER , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: mtk_t, mtk_u, mtk_v !: top first wet T-, U-, V-, F-level (ISF) 171 ! INTEGER , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: mbk_t, mbk_u, mbk_v !: bottom last wet T-, U- and V-level 172 !!gm 173 INTEGER , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: mbkt, mbku, mbkv !: bottom last wet T-, U- and V-level 234 174 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: tmask_i !: interior domain T-point mask 235 175 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: tmask_h !: internal domain T-point mask (Figure 8.5 NEMO book) 236 176 237 INTEGER , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: misfdep !: top first ocean level 238 INTEGER , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: mikt, miku, mikv, mikf !: first wet T-, U-, V-, F- oceanlevel (ISF)239 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: risfdep !: Iceshelf draft 240 241 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: ssmask, ssumask, ssvmask , ssfmask!: surface mask at T-,U-, V- and F-pts177 INTEGER , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: misfdep !: top first ocean level (ISF) 178 INTEGER , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: mikt, miku, mikv, mikf !: top first wet T-, U-, V-, F-level (ISF) 179 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: risfdep !: Iceshelf draft (ISF) 180 181 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: ssmask, ssumask, ssvmask !: surface mask at T-,U-, V- and F-pts 242 182 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:), TARGET :: tmask, umask, vmask, fmask !: land/ocean mask at T-, U-, V- and F-pts 243 183 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:), TARGET :: wmask, wumask, wvmask !: land/ocean mask at WT-, WU- and WV-pts … … 319 259 & njmppt(jpnij) , ibonjt(jpnij) , nldit(jpnij) , nldjt(jpnij) , & 320 260 & nleit(jpnij) , nlejt(jpnij) , & 321 & mi0(jpi dta) , mi1 (jpidta), mj0(jpjdta) , mj1 (jpjdta),&322 & tpol(jpiglo) , fpol(jpiglo) , STAT=ierr(2) )261 & mi0(jpiglo) , mi1 (jpiglo), mj0(jpjglo) , mj1 (jpjglo) , & 262 & tpol(jpiglo) , fpol(jpiglo) , STAT=ierr(2) ) 323 263 ! 324 264 ALLOCATE( glamt(jpi,jpj) , glamu(jpi,jpj) , glamv(jpi,jpj) , glamf(jpi,jpj) , & … … 332 272 & e1e2v(jpi,jpj) , r1_e1e2v(jpi,jpj) , e1_e2v(jpi,jpj) , & 333 273 & e1e2f(jpi,jpj) , r1_e1e2f(jpi,jpj) , & 334 & ff (jpi,jpj), STAT=ierr(3) )335 ! 336 ALLOCATE( gdept_0(jpi,jpj,jpk) , gdepw_0(jpi,jpj,jpk) , gde3w_0(jpi,jpj,jpk) , &274 & ff_f (jpi,jpj) , ff_t (jpi,jpj) , STAT=ierr(3) ) 275 ! 276 ALLOCATE( gdept_0(jpi,jpj,jpk) , gdepw_0(jpi,jpj,jpk) , gde3w_0(jpi,jpj,jpk) , & 337 277 & gdept_b(jpi,jpj,jpk) , gdepw_b(jpi,jpj,jpk) , & 338 278 & gdept_n(jpi,jpj,jpk) , gdepw_n(jpi,jpj,jpk) , gde3w_n(jpi,jpj,jpk) , STAT=ierr(4) ) … … 353 293 ! 354 294 ! 355 ALLOCATE( gdept_1d(jpk) , gdepw_1d(jpk) , & 356 & e3t_1d (jpk) , e3w_1d (jpk) , e3tp (jpi,jpj), e3wp(jpi,jpj) , & 357 & gsigt (jpk) , gsigw (jpk) , gsi3w(jpk) , & 358 & esigt (jpk) , esigw (jpk) , STAT=ierr(7) ) 359 ! 360 ALLOCATE( hbatv (jpi,jpj) , hbatf (jpi,jpj) , & 361 & hbatt (jpi,jpj) , hbatu (jpi,jpj) , & 362 & scosrf(jpi,jpj) , scobot(jpi,jpj) , & 363 & hifv (jpi,jpj) , hiff (jpi,jpj) , & 364 & hift (jpi,jpj) , hifu (jpi,jpj) , rx1(jpi,jpj) , STAT=ierr(8) ) 365 366 ALLOCATE( mbathy(jpi,jpj) , bathy (jpi,jpj) , & 367 & tmask_i(jpi,jpj) , tmask_h(jpi,jpj) , & 368 & ssmask (jpi,jpj) , ssumask(jpi,jpj) , ssvmask(jpi,jpj) , ssfmask(jpi,jpj) , & 369 & mbkt (jpi,jpj) , mbku (jpi,jpj) , mbkv (jpi,jpj) , STAT=ierr(9) ) 370 371 ! (ISF) Allocation of basic array 372 ALLOCATE( misfdep(jpi,jpj) , risfdep(jpi,jpj), & 373 & mikt(jpi,jpj), miku(jpi,jpj), mikv(jpi,jpj) , & 374 & mikf(jpi,jpj), STAT=ierr(10) ) 375 376 ALLOCATE( tmask(jpi,jpj,jpk) , umask(jpi,jpj,jpk), & 377 & vmask(jpi,jpj,jpk) , fmask(jpi,jpj,jpk), STAT=ierr(11) ) 378 295 ALLOCATE( gdept_1d(jpk) , gdepw_1d(jpk) , e3t_1d(jpk) , e3w_1d(jpk) , STAT=ierr(7) ) 296 ! 297 ALLOCATE( tmask_i(jpi,jpj) , tmask_h(jpi,jpj) , & 298 & ssmask (jpi,jpj) , ssumask(jpi,jpj) , ssvmask(jpi,jpj) , & 299 & mbkt (jpi,jpj) , mbku (jpi,jpj) , mbkv (jpi,jpj) , STAT=ierr(9) ) 300 ! 301 ALLOCATE( misfdep(jpi,jpj) , mikt(jpi,jpj) , miku(jpi,jpj) , & 302 & risfdep(jpi,jpj) , mikv(jpi,jpj) , mikf(jpi,jpj) , STAT=ierr(10) ) 303 ! 304 ALLOCATE( tmask(jpi,jpj,jpk) , umask(jpi,jpj,jpk) , & 305 & vmask(jpi,jpj,jpk) , fmask(jpi,jpj,jpk) , STAT=ierr(11) ) 306 ! 379 307 ALLOCATE( wmask(jpi,jpj,jpk) , wumask(jpi,jpj,jpk), wvmask(jpi,jpj,jpk) , STAT=ierr(12) ) 380 308 ! -
branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/DOM/domain.F90
r6140 r7277 14 14 !! 3.6 ! 2013 ( J. Simeon, C. Calone, G. Madec, C. Ethe ) Online coarsening of outputs 15 15 !! 3.7 ! 2015-11 (G. Madec, A. Coward) time varying zgr by default 16 !! 4.0 ! 2016-10 (G. Madec, S. Flavoni) domain configuration / user defined interface 16 17 !!---------------------------------------------------------------------- 17 18 18 19 !!---------------------------------------------------------------------- 19 !! dom_init : initialize the space and time domain 20 !! dom_nam : read and contral domain namelists 21 !! dom_ctl : control print for the ocean domain 22 !! dom_stiff : diagnose maximum grid stiffness/hydrostatic consistency (s-coordinate) 20 !! dom_init : initialize the space and time domain 21 !! dom_glo : initialize global domain <--> local domain indices 22 !! dom_nam : read and contral domain namelists 23 !! dom_ctl : control print for the ocean domain 24 !! domain_cfg : read the global domain size in domain configuration file 25 !! cfg_write : create the domain configuration file 23 26 !!---------------------------------------------------------------------- 24 USE oce ! ocean variables 25 USE dom_oce ! domain: ocean 26 USE sbc_oce ! surface boundary condition: ocean 27 USE phycst ! physical constants 28 USE closea ! closed seas 29 USE domhgr ! domain: set the horizontal mesh 30 USE domzgr ! domain: set the vertical mesh 31 USE domstp ! domain: set the time-step 32 USE dommsk ! domain: set the mask system 33 USE domwri ! domain: write the meshmask file 34 USE domvvl ! variable volume 35 USE c1d ! 1D vertical configuration 36 USE dyncor_c1d ! Coriolis term (c1d case) (cor_c1d routine) 27 USE oce ! ocean variables 28 USE dom_oce ! domain: ocean 29 USE sbc_oce ! surface boundary condition: ocean 30 USE trc_oce ! shared ocean & passive tracers variab 31 USE phycst ! physical constants 32 USE usrdef_closea ! closed seas 33 USE domhgr ! domain: set the horizontal mesh 34 USE domzgr ! domain: set the vertical mesh 35 USE dommsk ! domain: set the mask system 36 USE domwri ! domain: write the meshmask file 37 USE domvvl ! variable volume 38 USE c1d ! 1D configuration 39 USE domc1d ! 1D configuration: column location 40 USE dyncor_c1d ! 1D configuration: Coriolis term (cor_c1d routine) 37 41 ! 38 USE in_out_manager ! I/O manager 39 USE wrk_nemo ! Memory Allocation 40 USE lib_mpp ! distributed memory computing library 41 USE lbclnk ! ocean lateral boundary condition (or mpp link) 42 USE timing ! Timing 42 USE in_out_manager ! I/O manager 43 USE iom ! I/O library 44 USE lbclnk ! ocean lateral boundary condition (or mpp link) 45 USE lib_mpp ! distributed memory computing library 46 USE wrk_nemo ! Memory Allocation 47 USE timing ! Timing 43 48 44 49 IMPLICIT NONE 45 50 PRIVATE 46 51 47 PUBLIC dom_init ! called by opa.F90 52 PUBLIC dom_init ! called by nemogcm.F90 53 PUBLIC domain_cfg ! called by nemogcm.F90 48 54 49 55 !!------------------------------------------------------------------------- … … 66 72 !! and scale factors, and the coriolis factor 67 73 !! - dom_zgr: define the vertical coordinate and the bathymetry 68 !! - dom_stp: defined the model time step 69 !! - dom_wri: create the meshmask file if nmsh=1 74 !! - dom_wri: create the meshmask file if nn_msh=1 70 75 !! - 1D configuration, move Coriolis, u and v at T-point 71 76 !!---------------------------------------------------------------------- 72 INTEGER :: jk ! dummy loop indices 73 INTEGER :: iconf = 0 ! local integers 74 REAL(wp), POINTER, DIMENSION(:,:) :: z1_hu_0, z1_hv_0 77 INTEGER :: ji, jj, jk, ik ! dummy loop indices 78 INTEGER :: iconf = 0 ! local integers 79 CHARACTER (len=64) :: cform = "(A12, 3(A13, I7))" 80 INTEGER , DIMENSION(jpi,jpj) :: ik_top , ik_bot ! top and bottom ocean level 81 REAL(wp), DIMENSION(jpi,jpj) :: z1_hu_0, z1_hv_0 75 82 !!---------------------------------------------------------------------- 76 83 ! 77 84 IF( nn_timing == 1 ) CALL timing_start('dom_init') 78 85 ! 79 IF(lwp) THEN 86 IF(lwp) THEN ! Ocean domain Parameters (control print) 80 87 WRITE(numout,*) 81 88 WRITE(numout,*) 'dom_init : domain initialization' 82 89 WRITE(numout,*) '~~~~~~~~' 83 ENDIF 84 ! 85 ! !== Reference coordinate system ==! 86 ! 87 CALL dom_nam ! read namelist ( namrun, namdom ) 88 CALL dom_clo ! Closed seas and lake 89 CALL dom_hgr ! Horizontal mesh 90 CALL dom_zgr ! Vertical mesh and bathymetry 91 CALL dom_msk ! Masks 92 IF( ln_sco ) CALL dom_stiff ! Maximum stiffness ratio/hydrostatic consistency 90 ! 91 WRITE(numout,*) ' Domain info' 92 WRITE(numout,*) ' dimension of model:' 93 WRITE(numout,*) ' Local domain Global domain Data domain ' 94 WRITE(numout,cform) ' ',' jpi : ', jpi, ' jpiglo : ', jpiglo 95 WRITE(numout,cform) ' ',' jpj : ', jpj, ' jpjglo : ', jpjglo 96 WRITE(numout,cform) ' ',' jpk : ', jpk, ' jpkglo : ', jpkglo 97 WRITE(numout,cform) ' ' ,' jpij : ', jpij 98 WRITE(numout,*) ' mpp local domain info (mpp):' 99 WRITE(numout,*) ' jpni : ', jpni, ' jpreci : ', jpreci 100 WRITE(numout,*) ' jpnj : ', jpnj, ' jprecj : ', jprecj 101 WRITE(numout,*) ' jpnij : ', jpnij 102 WRITE(numout,*) ' lateral boundary of the Global domain : jperio = ', jperio 103 SELECT CASE ( jperio ) 104 CASE( 0 ) ; WRITE(numout,*) ' (i.e. closed)' 105 CASE( 1 ) ; WRITE(numout,*) ' (i.e. cyclic east-west)' 106 CASE( 2 ) ; WRITE(numout,*) ' (i.e. equatorial symmetric)' 107 CASE( 3 ) ; WRITE(numout,*) ' (i.e. north fold with T-point pivot)' 108 CASE( 4 ) ; WRITE(numout,*) ' (i.e. cyclic east-west and north fold with T-point pivot)' 109 CASE( 5 ) ; WRITE(numout,*) ' (i.e. north fold with F-point pivot)' 110 CASE( 6 ) ; WRITE(numout,*) ' (i.e. cyclic east-west and north fold with F-point pivot)' 111 CASE DEFAULT 112 CALL ctl_stop( 'jperio is out of range' ) 113 END SELECT 114 WRITE(numout,*) ' Ocean model configuration used:' 115 WRITE(numout,*) ' cn_cfg = ', cn_cfg 116 WRITE(numout,*) ' nn_cfg = ', nn_cfg 117 ENDIF 118 ! 119 ! 120 !!gm This should be removed with the new configuration interface 121 IF( lk_c1d .AND. ln_c1d_locpt ) CALL dom_c1d( rn_lat1d, rn_lon1d ) 122 !!gm end 123 ! 124 ! !== Reference coordinate system ==! 125 ! 126 CALL dom_glo ! global domain versus local domain 127 CALL dom_nam ! read namelist ( namrun, namdom ) 128 CALL dom_clo( cn_cfg, nn_cfg ) ! Closed seas and lake 129 CALL dom_hgr ! Horizontal mesh 130 CALL dom_zgr( ik_top, ik_bot ) ! Vertical mesh and bathymetry 131 IF( nn_closea == 0 ) CALL clo_bat( ik_top, ik_bot ) !== remove closed seas or lakes ==! 132 CALL dom_msk( ik_top, ik_bot ) ! Masks 133 ! 134 DO jj = 1, jpj ! depth of the iceshelves 135 DO ji = 1, jpi 136 ik = mikt(ji,jj) 137 risfdep(ji,jj) = gdepw_0(ji,jj,ik) 138 END DO 139 END DO 93 140 ! 94 141 ht_0(:,:) = e3t_0(:,:,1) * tmask(:,:,1) ! Reference ocean thickness … … 101 148 END DO 102 149 ! 103 ! !== time varying part of coordinate system ==! 104 ! 105 IF( ln_linssh ) THEN ! Fix in time : set to the reference one for all 150 ! !== time varying part of coordinate system ==! 151 ! 152 IF( ln_linssh ) THEN != Fix in time : set to the reference one for all 153 ! 106 154 ! before ! now ! after ! 107 155 ; gdept_b = gdept_0 ; gdept_n = gdept_0 ! --- ! depth of grid-points … … 117 165 ; e3vw_b = e3vw_0 ; e3vw_n = e3vw_0 ! --- ! 118 166 ! 119 CALL wrk_alloc( jpi,jpj, z1_hu_0, z1_hv_0 )120 !121 167 z1_hu_0(:,:) = ssumask(:,:) / ( hu_0(:,:) + 1._wp - ssumask(:,:) ) ! _i mask due to ISF 122 168 z1_hv_0(:,:) = ssvmask(:,:) / ( hv_0(:,:) + 1._wp - ssvmask(:,:) ) … … 129 175 ; r1_hv_b = z1_hv_0 ; r1_hv_n = z1_hv_0 ; r1_hv_a = z1_hv_0 ! 130 176 ! 131 CALL wrk_dealloc( jpi,jpj, z1_hu_0, z1_hv_0 ) 132 ! 133 ELSE ! time varying : initialize before/now/after variables 134 ! 135 CALL dom_vvl_init 177 ! 178 ELSE != time varying : initialize before/now/after variables 179 ! 180 IF( .NOT.lk_offline ) CALL dom_vvl_init 136 181 ! 137 182 ENDIF … … 139 184 IF( lk_c1d ) CALL cor_c1d ! 1D configuration: Coriolis set at T-point 140 185 ! 141 CALL dom_stp ! time step 142 IF( nmsh /= 0 .AND. .NOT. ln_iscpl ) CALL dom_wri ! Create a domain file 143 IF( nmsh /= 0 .AND. ln_iscpl .AND. .NOT. ln_rstart ) CALL dom_wri ! Create a domain file 186 IF( nn_msh > 0 .AND. .NOT. ln_iscpl ) CALL dom_wri ! Create a domain file 187 IF( nn_msh > 0 .AND. ln_iscpl .AND. .NOT. ln_rstart ) CALL dom_wri ! Create a domain file 144 188 IF( .NOT.ln_rstart ) CALL dom_ctl ! Domain control 145 189 ! 190 191 IF(lwp) THEN 192 WRITE(numout,*) 193 WRITE(numout,*) 'dom_init : end of domain initialization nn_msh=', nn_msh 194 WRITE(numout,*) 195 ENDIF 196 ! 197 IF( ln_write_cfg ) CALL cfg_write ! create the configuration file 198 ! 146 199 IF( nn_timing == 1 ) CALL timing_stop('dom_init') 147 200 ! 148 201 END SUBROUTINE dom_init 202 203 204 SUBROUTINE dom_glo 205 !!---------------------------------------------------------------------- 206 !! *** ROUTINE dom_glo *** 207 !! 208 !! ** Purpose : initialization of global domain <--> local domain indices 209 !! 210 !! ** Method : 211 !! 212 !! ** Action : - mig , mjg : local domain indices ==> global domain indices 213 !! - mi0 , mi1 : global domain indices ==> local domain indices 214 !! - mj0,, mj1 (global point not in the local domain ==> mi0>mi1 and/or mj0>mj1) 215 !!---------------------------------------------------------------------- 216 INTEGER :: ji, jj ! dummy loop argument 217 !!---------------------------------------------------------------------- 218 ! 219 DO ji = 1, jpi ! local domain indices ==> global domain indices 220 mig(ji) = ji + nimpp - 1 221 END DO 222 DO jj = 1, jpj 223 mjg(jj) = jj + njmpp - 1 224 END DO 225 ! ! global domain indices ==> local domain indices 226 ! ! (return (m.0,m.1)=(1,0) if data domain gridpoint is to the west/south of the 227 ! ! local domain, or (m.0,m.1)=(jp.+1,jp.) to the east/north of local domain. 228 DO ji = 1, jpiglo 229 mi0(ji) = MAX( 1 , MIN( ji - nimpp + 1, jpi+1 ) ) 230 mi1(ji) = MAX( 0 , MIN( ji - nimpp + 1, jpi ) ) 231 END DO 232 DO jj = 1, jpjglo 233 mj0(jj) = MAX( 1 , MIN( jj - njmpp + 1, jpj+1 ) ) 234 mj1(jj) = MAX( 0 , MIN( jj - njmpp + 1, jpj ) ) 235 END DO 236 IF(lwp) THEN ! control print 237 WRITE(numout,*) 238 WRITE(numout,*) 'dom_glo : domain: global <<==>> local ' 239 WRITE(numout,*) '~~~~~~~ ' 240 WRITE(numout,*) ' global domain: jpiglo = ', jpiglo, ' jpjglo = ', jpjglo, ' jpkglo = ', jpkglo 241 WRITE(numout,*) ' local domain: jpi = ', jpi , ' jpj = ', jpj , ' jpk = ', jpk 242 WRITE(numout,*) 243 WRITE(numout,*) ' conversion from local to global domain indices (and vise versa) done' 244 IF( nn_print >= 1 ) THEN 245 WRITE(numout,*) 246 WRITE(numout,*) ' conversion local ==> global i-index domain' 247 WRITE(numout,25) (mig(ji),ji = 1,jpi) 248 WRITE(numout,*) 249 WRITE(numout,*) ' conversion global ==> local i-index domain' 250 WRITE(numout,*) ' starting index' 251 WRITE(numout,25) (mi0(ji),ji = 1,jpiglo) 252 WRITE(numout,*) ' ending index' 253 WRITE(numout,25) (mi1(ji),ji = 1,jpiglo) 254 WRITE(numout,*) 255 WRITE(numout,*) ' conversion local ==> global j-index domain' 256 WRITE(numout,25) (mjg(jj),jj = 1,jpj) 257 WRITE(numout,*) 258 WRITE(numout,*) ' conversion global ==> local j-index domain' 259 WRITE(numout,*) ' starting index' 260 WRITE(numout,25) (mj0(jj),jj = 1,jpjglo) 261 WRITE(numout,*) ' ending index' 262 WRITE(numout,25) (mj1(jj),jj = 1,jpjglo) 263 ENDIF 264 ENDIF 265 25 FORMAT( 100(10x,19i4,/) ) 266 ! 267 END SUBROUTINE dom_glo 149 268 150 269 … … 161 280 USE ioipsl 162 281 NAMELIST/namrun/ cn_ocerst_indir, cn_ocerst_outdir, nn_stocklist, ln_rst_list, & 163 282 & nn_no , cn_exp , cn_ocerst_in, cn_ocerst_out, ln_rstart , nn_rstctl , & 164 283 & nn_it000, nn_itend , nn_date0 , nn_time0 , nn_leapy , nn_istate , & 165 284 & nn_stock, nn_write , ln_mskland , ln_clobber , nn_chunksz, nn_euler , & 166 285 & ln_cfmeta, ln_iscpl 167 NAMELIST/namdom/ nn_bathy, rn_bathy , rn_e3zps_min, rn_e3zps_rat, nn_msh, rn_hmin, rn_isfhmin, & 168 & rn_atfp , rn_rdt , nn_closea , ln_crs , jphgr_msh , & 169 & ppglam0, ppgphi0, ppe1_deg, ppe2_deg, ppe1_m, ppe2_m, & 170 & ppsur, ppa0, ppa1, ppkth, ppacr, ppdzmin, pphmax, ldbletanh, & 171 & ppa2, ppkth2, ppacr2 286 NAMELIST/namdom/ ln_linssh, nn_closea, nn_msh, rn_isfhmin, rn_rdt, rn_atfp, ln_crs 172 287 #if defined key_netcdf4 173 288 NAMELIST/namnc4/ nn_nchunks_i, nn_nchunks_j, nn_nchunks_k, ln_nc4zip … … 175 290 INTEGER :: ios ! Local integer output status for namelist read 176 291 !!---------------------------------------------------------------------- 177 292 ! 178 293 REWIND( numnam_ref ) ! Namelist namrun in reference namelist : Parameters of the run 179 294 READ ( numnam_ref, namrun, IOSTAT = ios, ERR = 901) 180 295 901 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namrun in reference namelist', lwp ) 181 296 ! 182 297 REWIND( numnam_cfg ) ! Namelist namrun in configuration namelist : Parameters of the run 183 298 READ ( numnam_cfg, namrun, IOSTAT = ios, ERR = 902 ) … … 235 350 neuler = 0 236 351 ENDIF 237 238 352 ! ! control of output frequency 239 353 IF ( nstock == 0 .OR. nstock > nitend ) THEN … … 269 383 READ ( numnam_ref, namdom, IOSTAT = ios, ERR = 903) 270 384 903 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namdom in reference namelist', lwp ) 271 272 385 ! 273 386 REWIND( numnam_cfg ) ! Namelist namdom in configuration namelist : space & time domain (bathymetry, mesh, timestep) … … 279 392 WRITE(numout,*) 280 393 WRITE(numout,*) ' Namelist namdom : space & time domain' 281 WRITE(numout,*) ' flag read/compute bathymetry nn_bathy = ', nn_bathy 282 WRITE(numout,*) ' Depth (if =0 bathy=jpkm1) rn_bathy = ', rn_bathy 283 WRITE(numout,*) ' min depth of the ocean (>0) or rn_hmin = ', rn_hmin 284 WRITE(numout,*) ' min number of ocean level (<0) ' 285 WRITE(numout,*) ' treshold to open the isf cavity rn_isfhmin = ', rn_isfhmin, ' (m)' 286 WRITE(numout,*) ' minimum thickness of partial rn_e3zps_min = ', rn_e3zps_min, ' (m)' 287 WRITE(numout,*) ' step level rn_e3zps_rat = ', rn_e3zps_rat 288 WRITE(numout,*) ' create mesh/mask file(s) nn_msh = ', nn_msh 394 WRITE(numout,*) ' linear free surface (=T) ln_linssh = ', ln_linssh 395 WRITE(numout,*) ' suppression of closed seas (=0) nn_closea = ', nn_closea 396 WRITE(numout,*) ' create mesh/mask file(s) nn_msh = ', nn_msh 289 397 WRITE(numout,*) ' = 0 no file created ' 290 398 WRITE(numout,*) ' = 1 mesh_mask ' 291 399 WRITE(numout,*) ' = 2 mesh and mask ' 292 400 WRITE(numout,*) ' = 3 mesh_hgr, msh_zgr and mask' 293 WRITE(numout,*) ' ocean time step rn_rdt = ', rn_rdt 294 WRITE(numout,*) ' asselin time filter parameter rn_atfp = ', rn_atfp 295 WRITE(numout,*) ' suppression of closed seas (=0) nn_closea = ', nn_closea 296 WRITE(numout,*) ' online coarsening of dynamical fields ln_crs = ', ln_crs 297 WRITE(numout,*) ' type of horizontal mesh jphgr_msh = ', jphgr_msh 298 WRITE(numout,*) ' longitude of first raw and column T-point ppglam0 = ', ppglam0 299 WRITE(numout,*) ' latitude of first raw and column T-point ppgphi0 = ', ppgphi0 300 WRITE(numout,*) ' zonal grid-spacing (degrees) ppe1_deg = ', ppe1_deg 301 WRITE(numout,*) ' meridional grid-spacing (degrees) ppe2_deg = ', ppe2_deg 302 WRITE(numout,*) ' zonal grid-spacing (degrees) ppe1_m = ', ppe1_m 303 WRITE(numout,*) ' meridional grid-spacing (degrees) ppe2_m = ', ppe2_m 304 WRITE(numout,*) ' ORCA r4, r2 and r05 coefficients ppsur = ', ppsur 305 WRITE(numout,*) ' ppa0 = ', ppa0 306 WRITE(numout,*) ' ppa1 = ', ppa1 307 WRITE(numout,*) ' ppkth = ', ppkth 308 WRITE(numout,*) ' ppacr = ', ppacr 309 WRITE(numout,*) ' Minimum vertical spacing ppdzmin = ', ppdzmin 310 WRITE(numout,*) ' Maximum depth pphmax = ', pphmax 311 WRITE(numout,*) ' Use double tanf function for vertical coordinates ldbletanh = ', ldbletanh 312 WRITE(numout,*) ' Double tanh function parameters ppa2 = ', ppa2 313 WRITE(numout,*) ' ppkth2 = ', ppkth2 314 WRITE(numout,*) ' ppacr2 = ', ppacr2 315 ENDIF 316 ! 317 ntopo = nn_bathy ! conversion DOCTOR names into model names (this should disappear soon) 318 e3zps_min = rn_e3zps_min 319 e3zps_rat = rn_e3zps_rat 320 nmsh = nn_msh 401 WRITE(numout,*) ' treshold to open the isf cavity rn_isfhmin = ', rn_isfhmin, ' (m)' 402 WRITE(numout,*) ' ocean time step rn_rdt = ', rn_rdt 403 WRITE(numout,*) ' asselin time filter parameter rn_atfp = ', rn_atfp 404 WRITE(numout,*) ' online coarsening of dynamical fields ln_crs = ', ln_crs 405 ENDIF 406 407 call flush( numout ) 408 ! 409 ! ! ! conversion DOCTOR names into model names (this should disappear soon) 321 410 atfp = rn_atfp 322 411 rdt = rn_rdt … … 327 416 READ ( numnam_ref, namnc4, IOSTAT = ios, ERR = 907) 328 417 907 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namnc4 in reference namelist', lwp ) 329 418 ! 330 419 REWIND( numnam_cfg ) ! Namelist namnc4 in configuration namelist : NETCDF 331 420 READ ( numnam_cfg, namnc4, IOSTAT = ios, ERR = 908 ) … … 378 467 ze1max = MAXVAL( e1t(:,:), mask = tmask_i(:,:) == 1._wp ) 379 468 ze2max = MAXVAL( e2t(:,:), mask = tmask_i(:,:) == 1._wp ) 380 469 ! 381 470 iloc = MINLOC( e1t(:,:), mask = tmask_i(:,:) == 1._wp ) 382 471 iimi1 = iloc(1) + nimpp - 1 … … 405 494 406 495 407 SUBROUTINE dom_stiff 408 !!---------------------------------------------------------------------- 409 !! *** ROUTINE dom_stiff *** 410 !! 411 !! ** Purpose : Diagnose maximum grid stiffness/hydrostatic consistency 412 !! 413 !! ** Method : Compute Haney (1991) hydrostatic condition ratio 414 !! Save the maximum in the vertical direction 415 !! (this number is only relevant in s-coordinates) 416 !! 417 !! Haney, R. L., 1991: On the pressure gradient force 418 !! over steep topography in sigma coordinate ocean models. 419 !! J. Phys. Oceanogr., 21, 610???619. 420 !!---------------------------------------------------------------------- 421 INTEGER :: ji, jj, jk 422 REAL(wp) :: zrxmax 423 REAL(wp), DIMENSION(4) :: zr1 424 !!---------------------------------------------------------------------- 425 rx1(:,:) = 0._wp 426 zrxmax = 0._wp 427 zr1(:) = 0._wp 428 ! 429 DO ji = 2, jpim1 430 DO jj = 2, jpjm1 431 DO jk = 1, jpkm1 432 zr1(1) = ABS( ( gdepw_0(ji ,jj,jk )-gdepw_0(ji-1,jj,jk ) & 433 & +gdepw_0(ji ,jj,jk+1)-gdepw_0(ji-1,jj,jk+1) ) & 434 & / ( gdepw_0(ji ,jj,jk )+gdepw_0(ji-1,jj,jk ) & 435 & -gdepw_0(ji ,jj,jk+1)-gdepw_0(ji-1,jj,jk+1) + rsmall ) ) * umask(ji-1,jj,jk) 436 zr1(2) = ABS( ( gdepw_0(ji+1,jj,jk )-gdepw_0(ji ,jj,jk ) & 437 & +gdepw_0(ji+1,jj,jk+1)-gdepw_0(ji ,jj,jk+1) ) & 438 & / ( gdepw_0(ji+1,jj,jk )+gdepw_0(ji ,jj,jk ) & 439 & -gdepw_0(ji+1,jj,jk+1)-gdepw_0(ji ,jj,jk+1) + rsmall ) ) * umask(ji ,jj,jk) 440 zr1(3) = ABS( ( gdepw_0(ji,jj+1,jk )-gdepw_0(ji,jj ,jk ) & 441 & +gdepw_0(ji,jj+1,jk+1)-gdepw_0(ji,jj ,jk+1) ) & 442 & / ( gdepw_0(ji,jj+1,jk )+gdepw_0(ji,jj ,jk ) & 443 & -gdepw_0(ji,jj+1,jk+1)-gdepw_0(ji,jj ,jk+1) + rsmall ) ) * vmask(ji,jj ,jk) 444 zr1(4) = ABS( ( gdepw_0(ji,jj ,jk )-gdepw_0(ji,jj-1,jk ) & 445 & +gdepw_0(ji,jj ,jk+1)-gdepw_0(ji,jj-1,jk+1) ) & 446 & / ( gdepw_0(ji,jj ,jk )+gdepw_0(ji,jj-1,jk ) & 447 & -gdepw_0(ji,jj ,jk+1)-gdepw_0(ji,jj-1,jk+1) + rsmall ) ) * vmask(ji,jj-1,jk) 448 zrxmax = MAXVAL( zr1(1:4) ) 449 rx1(ji,jj) = MAX( rx1(ji,jj) , zrxmax ) 450 END DO 451 END DO 452 END DO 453 CALL lbc_lnk( rx1, 'T', 1. ) 454 ! 455 zrxmax = MAXVAL( rx1 ) 456 ! 457 IF( lk_mpp ) CALL mpp_max( zrxmax ) ! max over the global domain 458 ! 459 IF(lwp) THEN 460 WRITE(numout,*) 461 WRITE(numout,*) 'dom_stiff : maximum grid stiffness ratio: ', zrxmax 462 WRITE(numout,*) '~~~~~~~~~' 463 ENDIF 464 ! 465 END SUBROUTINE dom_stiff 496 SUBROUTINE domain_cfg( ldtxt, cd_cfg, kk_cfg, kpi, kpj, kpk, kperio ) 497 !!---------------------------------------------------------------------- 498 !! *** ROUTINE dom_nam *** 499 !! 500 !! ** Purpose : read the domain size in domain configuration file 501 !! 502 !! ** Method : 503 !! 504 !!---------------------------------------------------------------------- 505 CHARACTER(len=*), DIMENSION(:), INTENT(out) :: ldtxt ! stored print information 506 CHARACTER(len=*) , INTENT(out) :: cd_cfg ! configuration name 507 INTEGER , INTENT(out) :: kk_cfg ! configuration resolution 508 INTEGER , INTENT(out) :: kpi, kpj, kpk ! global domain sizes 509 INTEGER , INTENT(out) :: kperio ! lateral global domain b.c. 510 ! 511 INTEGER :: inum, ii ! local integer 512 REAL(wp) :: zorca_res ! local scalars 513 REAL(wp) :: ziglo, zjglo, zkglo, zperio ! - - 514 !!---------------------------------------------------------------------- 515 ! 516 ii = 1 517 WRITE(ldtxt(ii),*) ' ' ; ii = ii+1 518 WRITE(ldtxt(ii),*) 'domain_cfg : domain size read in', TRIM( cn_domcfg ), ' file' ; ii = ii+1 519 WRITE(ldtxt(ii),*) '~~~~~~~~~~ ' ; ii = ii+1 520 ! 521 CALL iom_open( cn_domcfg, inum ) 522 ! 523 ! !- ORCA family specificity 524 IF( iom_varid( inum, 'ORCA' , ldstop = .FALSE. ) > 0 .AND. & 525 & iom_varid( inum, 'ORCA_resolution', ldstop = .FALSE. ) > 0 ) THEN 526 ! 527 cd_cfg = 'ORCA' 528 CALL iom_get( inum, 'ORCA_resolution', zorca_res ) ; kk_cfg = INT( zorca_res ) 529 ! 530 WRITE(ldtxt(ii),*) ' ' ; ii = ii+1 531 WRITE(ldtxt(ii),*) ' ==>>> ORCA configuration ' ; ii = ii+1 532 WRITE(ldtxt(ii),*) ' ' ; ii = ii+1 533 ! 534 ELSE !- cd_cfg & k_cfg are not used 535 cd_cfg = 'UNKNOWN' 536 kk_cfg = -9999999 537 ENDIF 538 ! 539 CALL iom_get( inum, 'jpiglo', ziglo ) ; kpi = INT( ziglo ) 540 CALL iom_get( inum, 'jpjglo', zjglo ) ; kpj = INT( zjglo ) 541 CALL iom_get( inum, 'jpkglo', zkglo ) ; kpk = INT( zkglo ) 542 CALL iom_get( inum, 'jperio', zperio ) ; kperio = INT( zperio ) 543 CALL iom_close( inum ) 544 ! 545 WRITE(ldtxt(ii),*) ' cn_cfg = ', TRIM(cd_cfg), ' nn_cfg = ', kk_cfg ; ii = ii+1 546 WRITE(ldtxt(ii),*) ' jpiglo = ', kpi ; ii = ii+1 547 WRITE(ldtxt(ii),*) ' jpjglo = ', kpj ; ii = ii+1 548 WRITE(ldtxt(ii),*) ' jpkglo = ', kpk ; ii = ii+1 549 WRITE(ldtxt(ii),*) ' type of global domain lateral boundary jperio = ', kperio ; ii = ii+1 550 ! 551 END SUBROUTINE domain_cfg 552 553 554 SUBROUTINE cfg_write 555 !!---------------------------------------------------------------------- 556 !! *** ROUTINE cfg_write *** 557 !! 558 !! ** Purpose : Create the "cn_domcfg_out" file, a NetCDF file which 559 !! contains all the ocean domain informations required to 560 !! define an ocean configuration. 561 !! 562 !! ** Method : Write in a file all the arrays required to set up an 563 !! ocean configuration. 564 !! 565 !! ** output file : domcfg_out.nc : domain size, characteristics, horizontal 566 !! mesh, Coriolis parameter, and vertical scale factors 567 !! NB: also contain ORCA family information 568 !!---------------------------------------------------------------------- 569 INTEGER :: ji, jj, jk ! dummy loop indices 570 INTEGER :: izco, izps, isco, icav 571 INTEGER :: inum ! local units 572 CHARACTER(len=21) :: clnam ! filename (mesh and mask informations) 573 REAL(wp), DIMENSION(jpi,jpj) :: z2d ! workspace 574 !!---------------------------------------------------------------------- 575 ! 576 IF(lwp) WRITE(numout,*) 577 IF(lwp) WRITE(numout,*) 'cfg_write : create the domain configuration file (', TRIM(cn_domcfg_out),'.nc)' 578 IF(lwp) WRITE(numout,*) '~~~~~~~~~' 579 ! 580 ! ! ============================= ! 581 ! ! create 'domcfg_out.nc' file ! 582 ! ! ============================= ! 583 ! 584 clnam = 'domcfg_out' ! filename (configuration information) 585 CALL iom_open( TRIM(clnam), inum, ldwrt = .TRUE., kiolib = jprstlib ) 586 587 ! 588 ! !== ORCA family specificities ==! 589 IF( cn_cfg == "ORCA" ) THEN 590 CALL iom_rstput( 0, 0, inum, 'ORCA' , 1._wp , ktype = jp_i4 ) 591 CALL iom_rstput( 0, 0, inum, 'ORCA_index', REAL( nn_cfg, wp), ktype = jp_i4 ) 592 ENDIF 593 ! 594 ! !== global domain size ==! 595 ! 596 CALL iom_rstput( 0, 0, inum, 'jpiglo', REAL( jpiglo, wp), ktype = jp_i4 ) 597 CALL iom_rstput( 0, 0, inum, 'jpjglo', REAL( jpjglo, wp), ktype = jp_i4 ) 598 CALL iom_rstput( 0, 0, inum, 'jpkglo', REAL( jpk , wp), ktype = jp_i4 ) 599 ! 600 ! !== domain characteristics ==! 601 ! 602 ! ! lateral boundary of the global domain 603 CALL iom_rstput( 0, 0, inum, 'jperio', REAL( jperio, wp), ktype = jp_i4 ) 604 ! 605 ! ! type of vertical coordinate 606 IF( ln_zco ) THEN ; izco = 1 ; ELSE ; izco = 0 ; ENDIF 607 IF( ln_zps ) THEN ; izps = 1 ; ELSE ; izps = 0 ; ENDIF 608 IF( ln_sco ) THEN ; isco = 1 ; ELSE ; isco = 0 ; ENDIF 609 CALL iom_rstput( 0, 0, inum, 'ln_zco' , REAL( izco, wp), ktype = jp_i4 ) 610 CALL iom_rstput( 0, 0, inum, 'ln_zps' , REAL( izps, wp), ktype = jp_i4 ) 611 CALL iom_rstput( 0, 0, inum, 'ln_sco' , REAL( isco, wp), ktype = jp_i4 ) 612 ! 613 ! ! ocean cavities under iceshelves 614 IF( ln_isfcav ) THEN ; icav = 1 ; ELSE ; icav = 0 ; ENDIF 615 CALL iom_rstput( 0, 0, inum, 'ln_isfcav', REAL( icav, wp), ktype = jp_i4 ) 616 ! 617 ! !== horizontal mesh ! 618 ! 619 CALL iom_rstput( 0, 0, inum, 'glamt', glamt, ktype = jp_r8 ) ! latitude 620 CALL iom_rstput( 0, 0, inum, 'glamu', glamu, ktype = jp_r8 ) 621 CALL iom_rstput( 0, 0, inum, 'glamv', glamv, ktype = jp_r8 ) 622 CALL iom_rstput( 0, 0, inum, 'glamf', glamf, ktype = jp_r8 ) 623 ! 624 CALL iom_rstput( 0, 0, inum, 'gphit', gphit, ktype = jp_r8 ) ! longitude 625 CALL iom_rstput( 0, 0, inum, 'gphiu', gphiu, ktype = jp_r8 ) 626 CALL iom_rstput( 0, 0, inum, 'gphiv', gphiv, ktype = jp_r8 ) 627 CALL iom_rstput( 0, 0, inum, 'gphif', gphif, ktype = jp_r8 ) 628 ! 629 CALL iom_rstput( 0, 0, inum, 'e1t' , e1t , ktype = jp_r8 ) ! i-scale factors (e1.) 630 CALL iom_rstput( 0, 0, inum, 'e1u' , e1u , ktype = jp_r8 ) 631 CALL iom_rstput( 0, 0, inum, 'e1v' , e1v , ktype = jp_r8 ) 632 CALL iom_rstput( 0, 0, inum, 'e1f' , e1f , ktype = jp_r8 ) 633 ! 634 CALL iom_rstput( 0, 0, inum, 'e2t' , e2t , ktype = jp_r8 ) ! j-scale factors (e2.) 635 CALL iom_rstput( 0, 0, inum, 'e2u' , e2u , ktype = jp_r8 ) 636 CALL iom_rstput( 0, 0, inum, 'e2v' , e2v , ktype = jp_r8 ) 637 CALL iom_rstput( 0, 0, inum, 'e2f' , e2f , ktype = jp_r8 ) 638 ! 639 CALL iom_rstput( 0, 0, inum, 'ff_f' , ff_f , ktype = jp_r8 ) ! coriolis factor 640 CALL iom_rstput( 0, 0, inum, 'ff_t' , ff_t , ktype = jp_r8 ) 641 ! 642 ! !== vertical mesh ==! 643 ! 644 CALL iom_rstput( 0, 0, inum, 'e3t_1d' , e3t_1d , ktype = jp_r8 ) ! reference 1D-coordinate 645 CALL iom_rstput( 0, 0, inum, 'e3w_1d' , e3w_1d , ktype = jp_r8 ) 646 ! 647 CALL iom_rstput( 0, 0, inum, 'e3t_0' , e3t_0 , ktype = jp_r8 ) ! vertical scale factors 648 CALL iom_rstput( 0, 0, inum, 'e3u_0' , e3u_0 , ktype = jp_r8 ) 649 CALL iom_rstput( 0, 0, inum, 'e3v_0' , e3v_0 , ktype = jp_r8 ) 650 CALL iom_rstput( 0, 0, inum, 'e3f_0' , e3f_0 , ktype = jp_r8 ) 651 CALL iom_rstput( 0, 0, inum, 'e3w_0' , e3w_0 , ktype = jp_r8 ) 652 CALL iom_rstput( 0, 0, inum, 'e3uw_0' , e3uw_0 , ktype = jp_r8 ) 653 CALL iom_rstput( 0, 0, inum, 'e3vw_0' , e3vw_0 , ktype = jp_r8 ) 654 ! 655 ! !== wet top and bottom level ==! (caution: multiplied by ssmask) 656 ! 657 CALL iom_rstput( 0, 0, inum, 'top_level' , REAL( mikt, wp )*ssmask , ktype = jp_i4 ) ! nb of ocean T-points (ISF) 658 CALL iom_rstput( 0, 0, inum, 'bottom_level' , REAL( mbkt, wp )*ssmask , ktype = jp_i4 ) ! nb of ocean T-points 659 ! 660 IF( ln_sco ) THEN ! s-coordinate: store grid stiffness ratio (Not required anyway) 661 CALL dom_stiff( z2d ) 662 CALL iom_rstput( 0, 0, inum, 'stiffness', z2d ) ! ! Max. grid stiffness ratio 663 ENDIF 664 ! 665 ! ! ============================ 666 ! ! close the files 667 ! ! ============================ 668 CALL iom_close( inum ) 669 ! 670 END SUBROUTINE cfg_write 466 671 467 672 !!====================================================================== -
branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/DOM/domhgr.F90
r6140 r7277 16 16 !! 3.7 ! 2015-09 (G. Madec, S. Flavoni) add cell surface and their inverse 17 17 !! add optional read of e1e2u & e1e2v 18 !! - ! 2016-04 (S. Flavoni, G. Madec) new configuration interface: read or usrdef.F90 18 19 !!---------------------------------------------------------------------- 19 20 20 21 !!---------------------------------------------------------------------- 21 22 !! dom_hgr : initialize the horizontal mesh 22 !! hgr_read : read "coordinate" NetCDFfile23 !! hgr_read : read horizontal information in the domain configuration file 23 24 !!---------------------------------------------------------------------- 24 25 USE dom_oce ! ocean space and time domain 26 USE par_oce ! ocean space and time domain 25 27 USE phycst ! physical constants 26 USE domwri ! write 'meshmask.nc' & 'coordinate_e1e2u_v.nc' files28 USE usrdef_hgr ! User defined routine 27 29 ! 28 30 USE in_out_manager ! I/O manager 31 USE iom ! I/O library 29 32 USE lib_mpp ! MPP library 30 33 USE timing ! Timing … … 33 36 PRIVATE 34 37 35 REAL(wp) :: glam0, gphi0 ! variables corresponding to parameters ppglam0 ppgphi0 set in par_oce36 37 38 PUBLIC dom_hgr ! called by domain.F90 38 39 39 40 !!---------------------------------------------------------------------- 40 !! NEMO/OPA 3.7 , NEMO Consortium (201 4)41 !! NEMO/OPA 3.7 , NEMO Consortium (2016) 41 42 !! $Id$ 42 43 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) … … 48 49 !! *** ROUTINE dom_hgr *** 49 50 !! 50 !! ** Purpose : Compute the geographical position (in degre) of the 51 !! model grid-points, the horizontal scale factors (in meters) and 52 !! the Coriolis factor (in s-1). 53 !! 54 !! ** Method : The geographical position of the model grid-points is 55 !! defined from analytical functions, fslam and fsphi, the deriva- 56 !! tives of which gives the horizontal scale factors e1,e2. 57 !! Defining two function fslam and fsphi and their derivatives in 58 !! the two horizontal directions (fse1 and fse2), the model grid- 59 !! point position and scale factors are given by: 60 !! t-point: 61 !! glamt(i,j) = fslam(i ,j ) e1t(i,j) = fse1(i ,j ) 62 !! gphit(i,j) = fsphi(i ,j ) e2t(i,j) = fse2(i ,j ) 63 !! u-point: 64 !! glamu(i,j) = fslam(i+1/2,j ) e1u(i,j) = fse1(i+1/2,j ) 65 !! gphiu(i,j) = fsphi(i+1/2,j ) e2u(i,j) = fse2(i+1/2,j ) 66 !! v-point: 67 !! glamv(i,j) = fslam(i ,j+1/2) e1v(i,j) = fse1(i ,j+1/2) 68 !! gphiv(i,j) = fsphi(i ,j+1/2) e2v(i,j) = fse2(i ,j+1/2) 69 !! f-point: 70 !! glamf(i,j) = fslam(i+1/2,j+1/2) e1f(i,j) = fse1(i+1/2,j+1/2) 71 !! gphif(i,j) = fsphi(i+1/2,j+1/2) e2f(i,j) = fse2(i+1/2,j+1/2) 72 !! Where fse1 and fse2 are defined by: 73 !! fse1(i,j) = ra * rad * SQRT( (cos(phi) di(fslam))**2 74 !! + di(fsphi) **2 )(i,j) 75 !! fse2(i,j) = ra * rad * SQRT( (cos(phi) dj(fslam))**2 76 !! + dj(fsphi) **2 )(i,j) 77 !! 78 !! The coriolis factor is given at z-point by: 79 !! ff = 2.*omega*sin(gphif) (in s-1) 80 !! 81 !! This routine is given as an example, it must be modified 82 !! following the user s desiderata. nevertheless, the output as 83 !! well as the way to compute the model grid-point position and 84 !! horizontal scale factors must be respected in order to insure 85 !! second order accuracy schemes. 86 !! 87 !! N.B. If the domain is periodic, verify that scale factors are also 88 !! periodic, and the coriolis term again. 89 !! 90 !! ** Action : - define glamt, glamu, glamv, glamf: longitude of t-, 91 !! u-, v- and f-points (in degre) 92 !! - define gphit, gphiu, gphiv, gphit: latitude of t-, 93 !! u-, v- and f-points (in degre) 94 !! define e1t, e2t, e1u, e2u, e1v, e2v, e1f, e2f: horizontal 95 !! scale factors (in meters) at t-, u-, v-, and f-points. 96 !! define ff: coriolis factor at f-point 97 !! 98 !! References : Marti, Madec and Delecluse, 1992, JGR 99 !! Madec, Imbard, 1996, Clim. Dyn. 100 !!---------------------------------------------------------------------- 101 INTEGER :: ji, jj ! dummy loop indices 102 INTEGER :: ii0, ii1, ij0, ij1 ! temporary integers 103 INTEGER :: ijeq ! index of equator T point (used in case 4) 104 REAL(wp) :: zti, zui, zvi, zfi ! local scalars 105 REAL(wp) :: ztj, zuj, zvj, zfj ! - - 106 REAL(wp) :: zphi0, zbeta, znorme ! 107 REAL(wp) :: zarg, zf0, zminff, zmaxff 108 REAL(wp) :: zlam1, zcos_alpha, zim1 , zjm1 , ze1, ze1deg 109 REAL(wp) :: zphi1, zsin_alpha, zim05, zjm05 110 INTEGER :: isrow ! index for ORCA1 starting row 111 INTEGER :: ie1e2u_v ! fag for u- & v-surface read in coordinate file or not 51 !! ** Purpose : Read or compute the geographical position (in degrees) 52 !! of the model grid-points, the horizontal scale factors (in meters), 53 !! the associated horizontal metrics, and the Coriolis factor (in s-1). 54 !! 55 !! ** Method : Controlled by ln_read_cfg logical 56 !! =T : all needed arrays are read in mesh_mask.nc file 57 !! =F : user-defined configuration, all needed arrays 58 !! are computed in usr-def_hgr subroutine 59 !! 60 !! If Coriolis factor is neither read nor computed (iff=0) 61 !! it is computed from gphit assuming that the mesh is 62 !! defined on the sphere : 63 !! ff = 2.*omega*sin(gphif) (in s-1) 64 !! 65 !! If u- & v-surfaces are neither read nor computed (ie1e2u_v=0) 66 !! (i.e. no use of reduced scale factors in some straits) 67 !! they are computed from e1u, e2u, e1v and e2v as: 68 !! e1e2u = e1u*e2u and e1e2v = e1v*e2v 69 !! 70 !! ** Action : - define longitude & latitude of t-, u-, v- and f-points (in degrees) 71 !! - define Coriolis parameter at f-point (in 1/s) 72 !! - define i- & j-scale factors at t-, u-, v- and f-points (in meters) 73 !! - define associated horizontal metrics at t-, u-, v- and f-points 74 !! (inverse of scale factors 1/e1 & 1/e2, surface e1*e2, ratios e1/e2 & e2/e1) 75 !!---------------------------------------------------------------------- 76 INTEGER :: ji, jj ! dummy loop indices 77 INTEGER :: ie1e2u_v ! flag for u- & v-surfaces 78 INTEGER :: iff ! flag for Coriolis parameter 112 79 !!---------------------------------------------------------------------- 113 80 ! … … 117 84 WRITE(numout,*) 118 85 WRITE(numout,*) 'dom_hgr : define the horizontal mesh from ithe following par_oce parameters ' 119 WRITE(numout,*) '~~~~~~~ type of horizontal mesh jphgr_msh = ', jphgr_msh 120 WRITE(numout,*) ' position of the first row and ppglam0 = ', ppglam0 121 WRITE(numout,*) ' column grid-point (degrees) ppgphi0 = ', ppgphi0 122 WRITE(numout,*) ' zonal grid-spacing (degrees) ppe1_deg = ', ppe1_deg 123 WRITE(numout,*) ' meridional grid-spacing (degrees) ppe2_deg = ', ppe2_deg 124 WRITE(numout,*) ' zonal grid-spacing (meters) ppe1_m = ', ppe1_m 125 WRITE(numout,*) ' meridional grid-spacing (meters) ppe2_m = ', ppe2_m 126 ENDIF 127 ! 128 ! 129 SELECT CASE( jphgr_msh ) ! type of horizontal mesh 130 ! 131 CASE ( 0 ) !== read in coordinate.nc file ==! 132 ! 86 WRITE(numout,*) '~~~~~~~ ' 87 WRITE(numout,*) ' namcfg : read (=T) or user defined (=F) configuration ln_read_cfg = ', ln_read_cfg 88 ENDIF 89 ! 90 ! 91 IF( ln_read_cfg ) THEN !== read in mesh_mask.nc file ==! 133 92 IF(lwp) WRITE(numout,*) 134 IF(lwp) WRITE(numout,*) ' curvilinear coordinate on the sphere read in "coordinate" file' 135 ! 136 ie1e2u_v = 0 ! set to unread e1e2u and e1e2v 137 ! 138 CALL hgr_read( ie1e2u_v ) ! read the coordinate.nc file 139 ! 140 IF( ie1e2u_v == 0 ) THEN ! e1e2u and e1e2v have not been read: compute them 141 ! ! e2u and e1v does not include a reduction in some strait: apply reduction 142 e1e2u (:,:) = e1u(:,:) * e2u(:,:) 143 e1e2v (:,:) = e1v(:,:) * e2v(:,:) 93 IF(lwp) WRITE(numout,*) ' read horizontal mesh in ', TRIM( cn_domcfg ), ' file' 94 ! 95 CALL hgr_read ( glamt , glamu , glamv , glamf , & ! geographic position (required) 96 & gphit , gphiu , gphiv , gphif , & ! - - 97 & iff , ff_f , ff_t , & ! Coriolis parameter (if not on the sphere) 98 & e1t , e1u , e1v , e1f , & ! scale factors (required) 99 & e2t , e2u , e2v , e2f , & ! - - - 100 & ie1e2u_v , e1e2u , e1e2v ) ! u- & v-surfaces (if gridsize reduction in some straits) 101 ! 102 ELSE !== User defined configuration ==! 103 IF(lwp) WRITE(numout,*) 104 IF(lwp) WRITE(numout,*) ' User defined horizontal mesh (usr_def_hgr)' 105 ! 106 CALL usr_def_hgr( glamt , glamu , glamv , glamf , & ! geographic position (required) 107 & gphit , gphiu , gphiv , gphif , & ! 108 & iff , ff_f , ff_t , & ! Coriolis parameter (if domain not on the sphere) 109 & e1t , e1u , e1v , e1f , & ! scale factors (required) 110 & e2t , e2u , e2v , e2f , & ! 111 & ie1e2u_v , e1e2u , e1e2v ) ! u- & v-surfaces (if gridsize reduction is used in strait(s)) 112 ! 113 ENDIF 114 ! 115 ! !== Coriolis parameter ==! (if necessary) 116 ! 117 IF( iff == 0 ) THEN ! Coriolis parameter has not been defined 118 IF(lwp) WRITE(numout,*) ' Coriolis parameter calculated on the sphere from gphif & gphit' 119 ff_f(:,:) = 2. * omega * SIN( rad * gphif(:,:) ) ! compute it on the sphere at f-point 120 ff_t(:,:) = 2. * omega * SIN( rad * gphit(:,:) ) ! - - - at t-point 121 ELSE 122 IF( ln_read_cfg ) THEN 123 IF(lwp) WRITE(numout,*) ' Coriolis parameter have been read in ', TRIM( cn_domcfg ), ' file' 124 ELSE 125 IF(lwp) WRITE(numout,*) ' Coriolis parameter have been set in usr_def_hgr routine' 144 126 ENDIF 145 ! 146 CASE ( 1 ) !== geographical mesh on the sphere with regular (in degree) grid-spacing ==! 147 ! 148 IF(lwp) WRITE(numout,*) 149 IF(lwp) WRITE(numout,*) ' geographical mesh on the sphere with regular grid-spacing' 150 IF(lwp) WRITE(numout,*) ' given by ppe1_deg and ppe2_deg' 151 ! 152 DO jj = 1, jpj 153 DO ji = 1, jpi 154 zti = REAL( ji - 1 + nimpp - 1 ) ; ztj = REAL( jj - 1 + njmpp - 1 ) 155 zui = REAL( ji - 1 + nimpp - 1 ) + 0.5 ; zuj = REAL( jj - 1 + njmpp - 1 ) 156 zvi = REAL( ji - 1 + nimpp - 1 ) ; zvj = REAL( jj - 1 + njmpp - 1 ) + 0.5 157 zfi = REAL( ji - 1 + nimpp - 1 ) + 0.5 ; zfj = REAL( jj - 1 + njmpp - 1 ) + 0.5 158 ! Longitude 159 glamt(ji,jj) = ppglam0 + ppe1_deg * zti 160 glamu(ji,jj) = ppglam0 + ppe1_deg * zui 161 glamv(ji,jj) = ppglam0 + ppe1_deg * zvi 162 glamf(ji,jj) = ppglam0 + ppe1_deg * zfi 163 ! Latitude 164 gphit(ji,jj) = ppgphi0 + ppe2_deg * ztj 165 gphiu(ji,jj) = ppgphi0 + ppe2_deg * zuj 166 gphiv(ji,jj) = ppgphi0 + ppe2_deg * zvj 167 gphif(ji,jj) = ppgphi0 + ppe2_deg * zfj 168 ! e1 169 e1t(ji,jj) = ra * rad * COS( rad * gphit(ji,jj) ) * ppe1_deg 170 e1u(ji,jj) = ra * rad * COS( rad * gphiu(ji,jj) ) * ppe1_deg 171 e1v(ji,jj) = ra * rad * COS( rad * gphiv(ji,jj) ) * ppe1_deg 172 e1f(ji,jj) = ra * rad * COS( rad * gphif(ji,jj) ) * ppe1_deg 173 ! e2 174 e2t(ji,jj) = ra * rad * ppe2_deg 175 e2u(ji,jj) = ra * rad * ppe2_deg 176 e2v(ji,jj) = ra * rad * ppe2_deg 177 e2f(ji,jj) = ra * rad * ppe2_deg 178 END DO 179 END DO 180 ! 181 CASE ( 2:3 ) !== f- or beta-plane with regular grid-spacing ==! 182 ! 183 IF(lwp) WRITE(numout,*) 184 IF(lwp) WRITE(numout,*) ' f- or beta-plane with regular grid-spacing' 185 IF(lwp) WRITE(numout,*) ' given by ppe1_m and ppe2_m' 186 ! 187 ! Position coordinates (in kilometers) 188 ! ========== 189 glam0 = 0._wp 190 gphi0 = - ppe2_m * 1.e-3 191 ! 192 #if defined key_agrif 193 IF ( cp_cfg == 'eel' .AND. jp_cfg == 6 ) THEN ! for EEL6 configuration only 194 IF( .NOT. Agrif_Root() ) THEN 195 glam0 = Agrif_Parent(glam0) + (Agrif_ix())*Agrif_Parent(ppe1_m) * 1.e-3 196 gphi0 = Agrif_Parent(gphi0) + (Agrif_iy())*Agrif_Parent(ppe2_m) * 1.e-3 197 ppe1_m = Agrif_Parent(ppe1_m)/Agrif_Rhox() 198 ppe2_m = Agrif_Parent(ppe2_m)/Agrif_Rhoy() 199 ENDIF 200 ENDIF 201 #endif 202 DO jj = 1, jpj 203 DO ji = 1, jpi 204 glamt(ji,jj) = glam0 + ppe1_m * 1.e-3 * ( REAL( ji - 1 + nimpp - 1 ) ) 205 glamu(ji,jj) = glam0 + ppe1_m * 1.e-3 * ( REAL( ji - 1 + nimpp - 1 ) + 0.5 ) 206 glamv(ji,jj) = glamt(ji,jj) 207 glamf(ji,jj) = glamu(ji,jj) 208 ! 209 gphit(ji,jj) = gphi0 + ppe2_m * 1.e-3 * ( REAL( jj - 1 + njmpp - 1 ) ) 210 gphiu(ji,jj) = gphit(ji,jj) 211 gphiv(ji,jj) = gphi0 + ppe2_m * 1.e-3 * ( REAL( jj - 1 + njmpp - 1 ) + 0.5 ) 212 gphif(ji,jj) = gphiv(ji,jj) 213 END DO 214 END DO 215 ! 216 ! Horizontal scale factors (in meters) 217 ! ====== 218 e1t(:,:) = ppe1_m ; e2t(:,:) = ppe2_m 219 e1u(:,:) = ppe1_m ; e2u(:,:) = ppe2_m 220 e1v(:,:) = ppe1_m ; e2v(:,:) = ppe2_m 221 e1f(:,:) = ppe1_m ; e2f(:,:) = ppe2_m 222 ! 223 CASE ( 4 ) !== geographical mesh on the sphere, isotropic MERCATOR type ==! 224 ! 225 IF(lwp) WRITE(numout,*) 226 IF(lwp) WRITE(numout,*) ' geographical mesh on the sphere, MERCATOR type' 227 IF(lwp) WRITE(numout,*) ' longitudinal/latitudinal spacing given by ppe1_deg' 228 IF ( ppgphi0 == -90 ) CALL ctl_stop( ' Mercator grid cannot start at south pole !!!! ' ) 229 ! 230 ! Find index corresponding to the equator, given the grid spacing e1_deg 231 ! and the (approximate) southern latitude ppgphi0. 232 ! This way we ensure that the equator is at a "T / U" point, when in the domain. 233 ! The formula should work even if the equator is outside the domain. 234 zarg = rpi / 4. - rpi / 180. * ppgphi0 / 2. 235 ijeq = ABS( 180./rpi * LOG( COS( zarg ) / SIN( zarg ) ) / ppe1_deg ) 236 IF( ppgphi0 > 0 ) ijeq = -ijeq 237 ! 238 IF(lwp) WRITE(numout,*) ' Index of the equator on the MERCATOR grid:', ijeq 239 ! 240 DO jj = 1, jpj 241 DO ji = 1, jpi 242 zti = REAL( ji - 1 + nimpp - 1 ) ; ztj = REAL( jj - ijeq + njmpp - 1 ) 243 zui = REAL( ji - 1 + nimpp - 1 ) + 0.5 ; zuj = REAL( jj - ijeq + njmpp - 1 ) 244 zvi = REAL( ji - 1 + nimpp - 1 ) ; zvj = REAL( jj - ijeq + njmpp - 1 ) + 0.5 245 zfi = REAL( ji - 1 + nimpp - 1 ) + 0.5 ; zfj = REAL( jj - ijeq + njmpp - 1 ) + 0.5 246 ! Longitude 247 glamt(ji,jj) = ppglam0 + ppe1_deg * zti 248 glamu(ji,jj) = ppglam0 + ppe1_deg * zui 249 glamv(ji,jj) = ppglam0 + ppe1_deg * zvi 250 glamf(ji,jj) = ppglam0 + ppe1_deg * zfi 251 ! Latitude 252 gphit(ji,jj) = 1./rad * ASIN ( TANH( ppe1_deg *rad* ztj ) ) 253 gphiu(ji,jj) = 1./rad * ASIN ( TANH( ppe1_deg *rad* zuj ) ) 254 gphiv(ji,jj) = 1./rad * ASIN ( TANH( ppe1_deg *rad* zvj ) ) 255 gphif(ji,jj) = 1./rad * ASIN ( TANH( ppe1_deg *rad* zfj ) ) 256 ! e1 257 e1t(ji,jj) = ra * rad * COS( rad * gphit(ji,jj) ) * ppe1_deg 258 e1u(ji,jj) = ra * rad * COS( rad * gphiu(ji,jj) ) * ppe1_deg 259 e1v(ji,jj) = ra * rad * COS( rad * gphiv(ji,jj) ) * ppe1_deg 260 e1f(ji,jj) = ra * rad * COS( rad * gphif(ji,jj) ) * ppe1_deg 261 ! e2 262 e2t(ji,jj) = ra * rad * COS( rad * gphit(ji,jj) ) * ppe1_deg 263 e2u(ji,jj) = ra * rad * COS( rad * gphiu(ji,jj) ) * ppe1_deg 264 e2v(ji,jj) = ra * rad * COS( rad * gphiv(ji,jj) ) * ppe1_deg 265 e2f(ji,jj) = ra * rad * COS( rad * gphif(ji,jj) ) * ppe1_deg 266 END DO 267 END DO 268 ! 269 CASE ( 5 ) !== beta-plane with regular grid-spacing and rotated domain ==! (GYRE configuration) 270 ! 271 IF(lwp) WRITE(numout,*) 272 IF(lwp) WRITE(numout,*) ' beta-plane with regular grid-spacing and rotated domain (GYRE configuration)' 273 IF(lwp) WRITE(numout,*) ' given by ppe1_m and ppe2_m' 274 ! 275 ! Position coordinates (in kilometers) 276 ! ========== 277 ! 278 ! angle 45deg and ze1=106.e+3 / jp_cfg forced -> zlam1 = -85deg, zphi1 = 29degN 279 zlam1 = -85._wp 280 zphi1 = 29._wp 281 ! resolution in meters 282 ze1 = 106000. / REAL( jp_cfg , wp ) 283 ! benchmark: forced the resolution to be about 100 km 284 IF( nbench /= 0 ) ze1 = 106000._wp 285 zsin_alpha = - SQRT( 2._wp ) * 0.5_wp 286 zcos_alpha = SQRT( 2._wp ) * 0.5_wp 287 ze1deg = ze1 / (ra * rad) 288 IF( nbench /= 0 ) ze1deg = ze1deg / REAL( jp_cfg , wp ) ! benchmark: keep the lat/+lon 289 ! ! at the right jp_cfg resolution 290 glam0 = zlam1 + zcos_alpha * ze1deg * REAL( jpjglo-2 , wp ) 291 gphi0 = zphi1 + zsin_alpha * ze1deg * REAL( jpjglo-2 , wp ) 292 ! 293 IF( nprint==1 .AND. lwp ) THEN 294 WRITE(numout,*) ' ze1', ze1, 'cosalpha', zcos_alpha, 'sinalpha', zsin_alpha 295 WRITE(numout,*) ' ze1deg', ze1deg, 'glam0', glam0, 'gphi0', gphi0 296 ENDIF 297 ! 298 DO jj = 1, jpj 299 DO ji = 1, jpi 300 zim1 = REAL( ji + nimpp - 1 ) - 1. ; zim05 = REAL( ji + nimpp - 1 ) - 1.5 301 zjm1 = REAL( jj + njmpp - 1 ) - 1. ; zjm05 = REAL( jj + njmpp - 1 ) - 1.5 302 ! 303 glamf(ji,jj) = glam0 + zim1 * ze1deg * zcos_alpha + zjm1 * ze1deg * zsin_alpha 304 gphif(ji,jj) = gphi0 - zim1 * ze1deg * zsin_alpha + zjm1 * ze1deg * zcos_alpha 305 ! 306 glamt(ji,jj) = glam0 + zim05 * ze1deg * zcos_alpha + zjm05 * ze1deg * zsin_alpha 307 gphit(ji,jj) = gphi0 - zim05 * ze1deg * zsin_alpha + zjm05 * ze1deg * zcos_alpha 308 ! 309 glamu(ji,jj) = glam0 + zim1 * ze1deg * zcos_alpha + zjm05 * ze1deg * zsin_alpha 310 gphiu(ji,jj) = gphi0 - zim1 * ze1deg * zsin_alpha + zjm05 * ze1deg * zcos_alpha 311 ! 312 glamv(ji,jj) = glam0 + zim05 * ze1deg * zcos_alpha + zjm1 * ze1deg * zsin_alpha 313 gphiv(ji,jj) = gphi0 - zim05 * ze1deg * zsin_alpha + zjm1 * ze1deg * zcos_alpha 314 END DO 315 END DO 316 ! 317 ! Horizontal scale factors (in meters) 318 ! ====== 319 e1t(:,:) = ze1 ; e2t(:,:) = ze1 320 e1u(:,:) = ze1 ; e2u(:,:) = ze1 321 e1v(:,:) = ze1 ; e2v(:,:) = ze1 322 e1f(:,:) = ze1 ; e2f(:,:) = ze1 323 ! 324 CASE DEFAULT 325 WRITE(ctmp1,*) ' bad flag value for jphgr_msh = ', jphgr_msh 326 CALL ctl_stop( ctmp1 ) 327 ! 328 END SELECT 329 330 ! associated horizontal metrics 331 ! ----------------------------- 127 ENDIF 128 ! 129 ! !== associated horizontal metrics ==! 332 130 ! 333 131 r1_e1t(:,:) = 1._wp / e1t(:,:) ; r1_e2t (:,:) = 1._wp / e2t(:,:) … … 338 136 e1e2t (:,:) = e1t(:,:) * e2t(:,:) ; r1_e1e2t(:,:) = 1._wp / e1e2t(:,:) 339 137 e1e2f (:,:) = e1f(:,:) * e2f(:,:) ; r1_e1e2f(:,:) = 1._wp / e1e2f(:,:) 340 IF( jphgr_msh /= 0 ) THEN ! e1e2u and e1e2v have not been set: compute them 341 e1e2u (:,:) = e1u(:,:) * e2u(:,:) 138 IF( ie1e2u_v == 0 ) THEN ! u- & v-surfaces have not been defined 139 IF(lwp) WRITE(numout,*) ' u- & v-surfaces calculated as e1 e2 product' 140 e1e2u (:,:) = e1u(:,:) * e2u(:,:) ! compute them 342 141 e1e2v (:,:) = e1v(:,:) * e2v(:,:) 343 ENDIF 344 r1_e1e2u(:,:) = 1._wp / e1e2u(:,:) ! compute their invert in both cases 142 ELSE 143 IF(lwp) WRITE(numout,*) ' u- & v-surfaces have been read in "mesh_mask" file:' 144 IF(lwp) WRITE(numout,*) ' grid size reduction in strait(s) is used' 145 ENDIF 146 r1_e1e2u(:,:) = 1._wp / e1e2u(:,:) ! compute their invert in any cases 345 147 r1_e1e2v(:,:) = 1._wp / e1e2v(:,:) 346 148 ! 347 149 e2_e1u(:,:) = e2u(:,:) / e1u(:,:) 348 150 e1_e2v(:,:) = e1v(:,:) / e2v(:,:) 349 350 IF( lwp .AND. nn_print >=1 .AND. .NOT.ln_rstart ) THEN ! Control print : Grid informations (if not restart) 351 WRITE(numout,*) 352 WRITE(numout,*) ' longitude and e1 scale factors' 353 WRITE(numout,*) ' ------------------------------' 354 WRITE(numout,9300) ( ji, glamt(ji,1), glamu(ji,1), & 355 glamv(ji,1), glamf(ji,1), & 356 e1t(ji,1), e1u(ji,1), & 357 e1v(ji,1), e1f(ji,1), ji = 1, jpi,10) 358 9300 FORMAT( 1x, i4, f8.2,1x, f8.2,1x, f8.2,1x, f8.2, 1x, & 359 f19.10, 1x, f19.10, 1x, f19.10, 1x, f19.10 ) 360 ! 361 WRITE(numout,*) 362 WRITE(numout,*) ' latitude and e2 scale factors' 363 WRITE(numout,*) ' -----------------------------' 364 WRITE(numout,9300) ( jj, gphit(1,jj), gphiu(1,jj), & 365 & gphiv(1,jj), gphif(1,jj), & 366 & e2t (1,jj), e2u (1,jj), & 367 & e2v (1,jj), e2f (1,jj), jj = 1, jpj, 10 ) 368 ENDIF 369 370 371 ! ================= ! 372 ! Coriolis factor ! 373 ! ================= ! 374 375 SELECT CASE( jphgr_msh ) ! type of horizontal mesh 376 ! 377 CASE ( 0, 1, 4 ) ! mesh on the sphere 378 ! 379 ff(:,:) = 2. * omega * SIN( rad * gphif(:,:) ) 380 ! 381 CASE ( 2 ) ! f-plane at ppgphi0 382 ! 383 ff(:,:) = 2. * omega * SIN( rad * ppgphi0 ) 384 ! 385 IF(lwp) WRITE(numout,*) ' f-plane: Coriolis parameter = constant = ', ff(1,1) 386 ! 387 CASE ( 3 ) ! beta-plane 388 ! 389 zbeta = 2. * omega * COS( rad * ppgphi0 ) / ra ! beta at latitude ppgphi0 390 zphi0 = ppgphi0 - REAL( jpjglo/2) * ppe2_m / ( ra * rad ) ! latitude of the first row F-points 391 ! 392 #if defined key_agrif 393 IF( cp_cfg == 'eel' .AND. jp_cfg == 6 ) THEN ! for EEL6 configuration only 394 IF( .NOT.Agrif_Root() ) THEN 395 zphi0 = ppgphi0 - REAL( Agrif_Parent(jpjglo)/2)*Agrif_Parent(ppe2_m) / (ra * rad) 396 ENDIF 397 ENDIF 398 #endif 399 zf0 = 2. * omega * SIN( rad * zphi0 ) ! compute f0 1st point south 400 ! 401 ff(:,:) = ( zf0 + zbeta * gphif(:,:) * 1.e+3 ) ! f = f0 +beta* y ( y=0 at south) 402 ! 403 IF(lwp) THEN 404 WRITE(numout,*) 405 WRITE(numout,*) ' Beta-plane: Beta parameter = constant = ', ff(nldi,nldj) 406 WRITE(numout,*) ' Coriolis parameter varies from ', ff(nldi,nldj),' to ', ff(nldi,nlej) 407 ENDIF 408 IF( lk_mpp ) THEN 409 zminff=ff(nldi,nldj) 410 zmaxff=ff(nldi,nlej) 411 CALL mpp_min( zminff ) ! min over the global domain 412 CALL mpp_max( zmaxff ) ! max over the global domain 413 IF(lwp) WRITE(numout,*) ' Coriolis parameter varies globally from ', zminff,' to ', zmaxff 414 END IF 415 ! 416 CASE ( 5 ) ! beta-plane and rotated domain (gyre configuration) 417 ! 418 zbeta = 2. * omega * COS( rad * ppgphi0 ) / ra ! beta at latitude ppgphi0 419 zphi0 = 15._wp ! latitude of the first row F-points 420 zf0 = 2. * omega * SIN( rad * zphi0 ) ! compute f0 1st point south 421 ! 422 ff(:,:) = ( zf0 + zbeta * ABS( gphif(:,:) - zphi0 ) * rad * ra ) ! f = f0 +beta* y ( y=0 at south) 423 ! 424 IF(lwp) THEN 425 WRITE(numout,*) 426 WRITE(numout,*) ' Beta-plane and rotated domain : ' 427 WRITE(numout,*) ' Coriolis parameter varies in this processor from ', ff(nldi,nldj),' to ', ff(nldi,nlej) 428 ENDIF 429 ! 430 IF( lk_mpp ) THEN 431 zminff=ff(nldi,nldj) 432 zmaxff=ff(nldi,nlej) 433 CALL mpp_min( zminff ) ! min over the global domain 434 CALL mpp_max( zmaxff ) ! max over the global domain 435 IF(lwp) WRITE(numout,*) ' Coriolis parameter varies globally from ', zminff,' to ', zmaxff 436 END IF 437 ! 438 END SELECT 439 440 441 ! Control of domain for symetrical condition 442 ! ------------------------------------------ 443 ! The equator line must be the latitude coordinate axe 444 445 IF( nperio == 2 ) THEN 446 znorme = SQRT( SUM( gphiu(:,2) * gphiu(:,2) ) ) / REAL( jpi ) 447 IF( znorme > 1.e-13 ) CALL ctl_stop( ' ===>>>> : symmetrical condition: rerun with good equator line' ) 448 ENDIF 151 ! 449 152 ! 450 153 IF( nn_timing == 1 ) CALL timing_stop('dom_hgr') … … 453 156 454 157 455 SUBROUTINE hgr_read( ke1e2u_v ) 158 SUBROUTINE hgr_read( plamt , plamu , plamv , plamf , & ! gridpoints position (required) 159 & pphit , pphiu , pphiv , pphif , & 160 & kff , pff_f , pff_t , & ! Coriolis parameter (if not on the sphere) 161 & pe1t , pe1u , pe1v , pe1f , & ! scale factors (required) 162 & pe2t , pe2u , pe2v , pe2f , & 163 & ke1e2u_v , pe1e2u , pe1e2v ) ! u- & v-surfaces (if gridsize reduction in some straits) 456 164 !!--------------------------------------------------------------------- 457 165 !! *** ROUTINE hgr_read *** 458 166 !! 459 !! ** Purpose : Read a coordinate file in NetCDF format using IOM 460 !! 461 !!---------------------------------------------------------------------- 462 USE iom 463 !! 464 INTEGER, INTENT( inout ) :: ke1e2u_v ! fag: e1e2u & e1e2v read in coordinate file (=1) or not (=0) 465 ! 466 INTEGER :: inum ! temporary logical unit 167 !! ** Purpose : Read a mesh_mask file in NetCDF format using IOM 168 !! 169 !!---------------------------------------------------------------------- 170 REAL(wp), DIMENSION(:,:), INTENT(out) :: plamt, plamu, plamv, plamf ! longitude outputs 171 REAL(wp), DIMENSION(:,:), INTENT(out) :: pphit, pphiu, pphiv, pphif ! latitude outputs 172 INTEGER , INTENT(out) :: kff ! =1 Coriolis parameter read here, =0 otherwise 173 REAL(wp), DIMENSION(:,:), INTENT(out) :: pff_f, pff_t ! Coriolis factor at f-point (if found in file) 174 REAL(wp), DIMENSION(:,:), INTENT(out) :: pe1t, pe1u, pe1v, pe1f ! i-scale factors 175 REAL(wp), DIMENSION(:,:), INTENT(out) :: pe2t, pe2u, pe2v, pe2f ! j-scale factors 176 INTEGER , INTENT(out) :: ke1e2u_v ! =1 u- & v-surfaces read here, =0 otherwise 177 REAL(wp), DIMENSION(:,:), INTENT(out) :: pe1e2u, pe1e2v ! u- & v-surfaces (if found in file) 178 ! 179 INTEGER :: inum ! logical unit 467 180 !!---------------------------------------------------------------------- 468 181 ! 469 182 IF(lwp) THEN 470 183 WRITE(numout,*) 471 WRITE(numout,*) 'hgr_read : read the horizontal coordinates '184 WRITE(numout,*) 'hgr_read : read the horizontal coordinates in mesh_mask' 472 185 WRITE(numout,*) '~~~~~~~~ jpiglo = ', jpiglo, ' jpjglo = ', jpjglo, ' jpk = ', jpk 473 186 ENDIF 474 187 ! 475 CALL iom_open( 'coordinates', inum ) 476 ! 477 CALL iom_get( inum, jpdom_data, 'glamt', glamt, lrowattr=ln_use_jattr ) 478 CALL iom_get( inum, jpdom_data, 'glamu', glamu, lrowattr=ln_use_jattr ) 479 CALL iom_get( inum, jpdom_data, 'glamv', glamv, lrowattr=ln_use_jattr ) 480 CALL iom_get( inum, jpdom_data, 'glamf', glamf, lrowattr=ln_use_jattr ) 481 ! 482 CALL iom_get( inum, jpdom_data, 'gphit', gphit, lrowattr=ln_use_jattr ) 483 CALL iom_get( inum, jpdom_data, 'gphiu', gphiu, lrowattr=ln_use_jattr ) 484 CALL iom_get( inum, jpdom_data, 'gphiv', gphiv, lrowattr=ln_use_jattr ) 485 CALL iom_get( inum, jpdom_data, 'gphif', gphif, lrowattr=ln_use_jattr ) 486 ! 487 CALL iom_get( inum, jpdom_data, 'e1t' , e1t , lrowattr=ln_use_jattr ) 488 CALL iom_get( inum, jpdom_data, 'e1u' , e1u , lrowattr=ln_use_jattr ) 489 CALL iom_get( inum, jpdom_data, 'e1v' , e1v , lrowattr=ln_use_jattr ) 490 CALL iom_get( inum, jpdom_data, 'e1f' , e1f , lrowattr=ln_use_jattr ) 491 ! 492 CALL iom_get( inum, jpdom_data, 'e2t' , e2t , lrowattr=ln_use_jattr ) 493 CALL iom_get( inum, jpdom_data, 'e2u' , e2u , lrowattr=ln_use_jattr ) 494 CALL iom_get( inum, jpdom_data, 'e2v' , e2v , lrowattr=ln_use_jattr ) 495 CALL iom_get( inum, jpdom_data, 'e2f' , e2f , lrowattr=ln_use_jattr ) 188 CALL iom_open( cn_domcfg, inum ) 189 ! 190 CALL iom_get( inum, jpdom_data, 'glamt', plamt, lrowattr=ln_use_jattr ) 191 CALL iom_get( inum, jpdom_data, 'glamu', plamu, lrowattr=ln_use_jattr ) 192 CALL iom_get( inum, jpdom_data, 'glamv', plamv, lrowattr=ln_use_jattr ) 193 CALL iom_get( inum, jpdom_data, 'glamf', plamf, lrowattr=ln_use_jattr ) 194 ! 195 CALL iom_get( inum, jpdom_data, 'gphit', pphit, lrowattr=ln_use_jattr ) 196 CALL iom_get( inum, jpdom_data, 'gphiu', pphiu, lrowattr=ln_use_jattr ) 197 CALL iom_get( inum, jpdom_data, 'gphiv', pphiv, lrowattr=ln_use_jattr ) 198 CALL iom_get( inum, jpdom_data, 'gphif', pphif, lrowattr=ln_use_jattr ) 199 ! 200 CALL iom_get( inum, jpdom_data, 'e1t' , pe1t , lrowattr=ln_use_jattr ) 201 CALL iom_get( inum, jpdom_data, 'e1u' , pe1u , lrowattr=ln_use_jattr ) 202 CALL iom_get( inum, jpdom_data, 'e1v' , pe1v , lrowattr=ln_use_jattr ) 203 CALL iom_get( inum, jpdom_data, 'e1f' , pe1f , lrowattr=ln_use_jattr ) 204 ! 205 CALL iom_get( inum, jpdom_data, 'e2t' , pe2t , lrowattr=ln_use_jattr ) 206 CALL iom_get( inum, jpdom_data, 'e2u' , pe2u , lrowattr=ln_use_jattr ) 207 CALL iom_get( inum, jpdom_data, 'e2v' , pe2v , lrowattr=ln_use_jattr ) 208 CALL iom_get( inum, jpdom_data, 'e2f' , pe2f , lrowattr=ln_use_jattr ) 209 ! 210 IF( iom_varid( inum, 'ff_f', ldstop = .FALSE. ) > 0 .AND. & 211 & iom_varid( inum, 'ff_t', ldstop = .FALSE. ) > 0 ) THEN 212 IF(lwp) WRITE(numout,*) ' Coriolis factor at f- and t-points read in ', TRIM( cn_domcfg ), ' file' 213 CALL iom_get( inum, jpdom_data, 'ff_f' , pff_f , lrowattr=ln_use_jattr ) 214 CALL iom_get( inum, jpdom_data, 'ff_t' , pff_t , lrowattr=ln_use_jattr ) 215 kff = 1 216 ELSE 217 kff = 0 218 ENDIF 496 219 ! 497 220 IF( iom_varid( inum, 'e1e2u', ldstop = .FALSE. ) > 0 ) THEN 498 IF(lwp) WRITE(numout,*) ' hgr_read : e1e2u & e1e2v read in coordinatesfile'499 CALL iom_get( inum, jpdom_data, 'e1e2u' , e1e2u , lrowattr=ln_use_jattr )500 CALL iom_get( inum, jpdom_data, 'e1e2v' , e1e2v , lrowattr=ln_use_jattr )221 IF(lwp) WRITE(numout,*) ' e1e2u & e1e2v read in ', TRIM( cn_domcfg ), ' file' 222 CALL iom_get( inum, jpdom_data, 'e1e2u' , pe1e2u , lrowattr=ln_use_jattr ) 223 CALL iom_get( inum, jpdom_data, 'e1e2v' , pe1e2v , lrowattr=ln_use_jattr ) 501 224 ke1e2u_v = 1 502 225 ELSE … … 505 228 ! 506 229 CALL iom_close( inum ) 507 508 230 ! 231 END SUBROUTINE hgr_read 509 232 510 233 !!====================================================================== -
branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/DOM/dommsk.F90
r6140 r7277 9 9 !! - ! 1996-05 (G. Madec) mask computed from tmask 10 10 !! 8.0 ! 1997-02 (G. Madec) mesh information put in domhgr.F 11 !! 8.1 ! 1997-07 (G. Madec) modification of mbathyand fmask11 !! 8.1 ! 1997-07 (G. Madec) modification of kbat and fmask 12 12 !! - ! 1998-05 (G. Roullet) free surface 13 13 !! 8.2 ! 2000-03 (G. Madec) no slip accurate … … 17 17 !! 3.2 ! 2009-07 (R. Benshila) Suppression of rigid-lid option 18 18 !! 3.6 ! 2015-05 (P. Mathiot) ISF: add wmask,wumask and wvmask 19 !!---------------------------------------------------------------------- 20 21 !!---------------------------------------------------------------------- 22 !! dom_msk : compute land/ocean mask 23 !!---------------------------------------------------------------------- 24 USE oce ! ocean dynamics and tracers 25 USE dom_oce ! ocean space and time domain 19 !! 4.0 ! 2016-06 (G. Madec, S. Flavoni) domain configuration / user defined interface 20 !!---------------------------------------------------------------------- 21 22 !!---------------------------------------------------------------------- 23 !! dom_msk : compute land/ocean mask 24 !!---------------------------------------------------------------------- 25 USE oce ! ocean dynamics and tracers 26 USE dom_oce ! ocean space and time domain 27 USE usrdef_fmask ! user defined fmask 26 28 ! 27 USE in_out_manager 28 USE lbclnk 29 USE lib_mpp !30 USE wrk_nemo 31 USE timing 29 USE in_out_manager ! I/O manager 30 USE lbclnk ! ocean lateral boundary conditions (or mpp link) 31 USE lib_mpp ! Massively Parallel Processing library 32 USE wrk_nemo ! Memory allocation 33 USE timing ! Timing 32 34 33 35 IMPLICIT NONE … … 50 52 CONTAINS 51 53 52 SUBROUTINE dom_msk 54 SUBROUTINE dom_msk( k_top, k_bot ) 53 55 !!--------------------------------------------------------------------- 54 56 !! *** ROUTINE dom_msk *** … … 57 59 !! zontal velocity points (u & v), vorticity points (f) points. 58 60 !! 59 !! ** Method : The ocean/land mask is computed from the basin bathy- 60 !! metry in level (mbathy) which is defined or read in dommba. 61 !! mbathy equals 0 over continental T-point 62 !! and the number of ocean level over the ocean. 63 !! 64 !! At a given position (ji,jj,jk) the ocean/land mask is given by: 65 !! t-point : 0. IF mbathy( ji ,jj) =< 0 66 !! 1. IF mbathy( ji ,jj) >= jk 67 !! u-point : 0. IF mbathy( ji ,jj) or mbathy(ji+1, jj ) =< 0 68 !! 1. IF mbathy( ji ,jj) and mbathy(ji+1, jj ) >= jk. 69 !! v-point : 0. IF mbathy( ji ,jj) or mbathy( ji ,jj+1) =< 0 70 !! 1. IF mbathy( ji ,jj) and mbathy( ji ,jj+1) >= jk. 71 !! f-point : 0. IF mbathy( ji ,jj) or mbathy( ji ,jj+1) 72 !! or mbathy(ji+1,jj) or mbathy(ji+1,jj+1) =< 0 73 !! 1. IF mbathy( ji ,jj) and mbathy( ji ,jj+1) 74 !! and mbathy(ji+1,jj) and mbathy(ji+1,jj+1) >= jk. 75 !! tmask_i : interior ocean mask at t-point, i.e. excluding duplicated 76 !! rows/lines due to cyclic or North Fold boundaries as well 77 !! as MPP halos. 78 !! 79 !! The lateral friction is set through the value of fmask along 80 !! the coast and topography. This value is defined by rn_shlat, a 81 !! namelist parameter: 61 !! ** Method : The ocean/land mask at t-point is deduced from ko_top 62 !! and ko_bot, the indices of the fist and last ocean t-levels which 63 !! are either defined in usrdef_zgr or read in zgr_read. 64 !! The velocity masks (umask, vmask, wmask, wumask, wvmask) 65 !! are deduced from a product of the two neighboring tmask. 66 !! The vorticity mask (fmask) is deduced from tmask taking 67 !! into account the choice of lateral boundary condition (rn_shlat) : 82 68 !! rn_shlat = 0, free slip (no shear along the coast) 83 69 !! rn_shlat = 2, no slip (specified zero velocity at the coast) … … 85 71 !! 2 < rn_shlat, strong slip | in the lateral boundary layer 86 72 !! 87 !! N.B. If nperio not equal to 0, the land/ocean mask arrays88 !! are defined with the proper value at lateral domain boundaries.89 !! 90 !! In case of open boundaries (lk_bdy=T):91 !! - tmask is set to 1 on the points to be computed bay the open92 !! boundaries routines.93 !! 94 !! ** Action : tmask : land/ocean mask at t-point(=0. or 1.)95 !! umask : land/ocean mask at u-point (=0. or 1.)96 !! vmask : land/ocean mask at v-point (=0. or 1.)97 !! fmask : land/ocean mask at f-point (=0. or 1.)98 !! =rn_shlat along lateral boundaries99 !! tmask_i : interiorocean mask73 !! tmask_i : interior ocean mask at t-point, i.e. excluding duplicated 74 !! rows/lines due to cyclic or North Fold boundaries as well 75 !! as MPP halos. 76 !! tmask_h : halo mask at t-point, i.e. excluding duplicated rows/lines 77 !! due to cyclic or North Fold boundaries as well as MPP halos. 78 !! 79 !! ** Action : tmask, umask, vmask, wmask, wumask, wvmask : land/ocean mask 80 !! at t-, u-, v- w, wu-, and wv-points (=0. or 1.) 81 !! fmask : land/ocean mask at f-point (=0., or =1., or 82 !! =rn_shlat along lateral boundaries) 83 !! tmask_i : interior ocean mask 84 !! tmask_h : halo mask 85 !! ssmask , ssumask, ssvmask, ssfmask : 2D ocean mask 100 86 !!---------------------------------------------------------------------- 101 INTEGER :: ji, jj, jk ! dummy loop indices 102 INTEGER :: iif, iil, ii0, ii1, ii ! local integers 103 INTEGER :: ijf, ijl, ij0, ij1 ! - - 87 INTEGER, DIMENSION(:,:), INTENT(in) :: k_top, k_bot ! first and last ocean level 88 ! 89 INTEGER :: ji, jj, jk ! dummy loop indices 90 INTEGER :: iif, iil ! local integers 91 INTEGER :: ijf, ijl ! - - 92 INTEGER :: iktop, ikbot ! - - 104 93 INTEGER :: ios 105 INTEGER :: isrow ! index for ORCA1 starting row 106 INTEGER , POINTER, DIMENSION(:,:) :: imsk 107 REAL(wp), POINTER, DIMENSION(:,:) :: zwf 94 REAL(wp), POINTER, DIMENSION(:,:) :: zwf ! 2D workspace 108 95 !! 109 96 NAMELIST/namlbc/ rn_shlat, ln_vorlat … … 111 98 ! 112 99 IF( nn_timing == 1 ) CALL timing_start('dom_msk') 113 !114 CALL wrk_alloc( jpi, jpj, imsk )115 CALL wrk_alloc( jpi, jpj, zwf )116 100 ! 117 101 REWIND( numnam_ref ) ! Namelist namlbc in reference namelist : Lateral momentum boundary condition … … 142 126 ENDIF 143 127 144 ! 1. Ocean/land mask at t-point (computed from mbathy) 145 ! -----------------------------146 ! N.B. tmask has already the right boundary conditions since mbathy is ok128 129 ! Ocean/land mask at t-point (computed from ko_top and ko_bot) 130 ! ---------------------------- 147 131 ! 148 132 tmask(:,:,:) = 0._wp 149 DO jk = 1, jpk 150 DO jj = 1, jpj 151 DO ji = 1, jpi 152 IF( REAL( mbathy(ji,jj) - jk, wp ) + 0.1_wp >= 0._wp ) tmask(ji,jj,jk) = 1._wp 153 END DO 133 DO jj = 1, jpj 134 DO ji = 1, jpi 135 iktop = k_top(ji,jj) 136 ikbot = k_bot(ji,jj) 137 IF( iktop /= 0 ) THEN ! water in the column 138 tmask(ji,jj,iktop:ikbot ) = 1._wp 139 ENDIF 154 140 END DO 155 141 END DO 142 !SF add here lbc_lnk: bug not still understood : cause now domain configuration is read ! 143 !!gm I don't understand why... 144 CALL lbc_lnk( tmask , 'T', 1._wp ) ! Lateral boundary conditions 145 156 146 157 ! (ISF) define barotropic mask and mask the ice shelf point 158 ssmask(:,:)=tmask(:,:,1) ! at this stage ice shelf is not masked 159 160 DO jk = 1, jpk 161 DO jj = 1, jpj 162 DO ji = 1, jpi 163 IF( REAL( misfdep(ji,jj) - jk, wp ) - 0.1_wp >= 0._wp ) THEN 164 tmask(ji,jj,jk) = 0._wp 165 END IF 166 END DO 167 END DO 168 END DO 169 170 ! Interior domain mask (used for global sum) 171 ! -------------------- 172 tmask_i(:,:) = ssmask(:,:) ! (ISH) tmask_i = 1 even on the ice shelf 173 174 tmask_h(:,:) = 1._wp ! 0 on the halo and 1 elsewhere 175 iif = jpreci ! ??? 176 iil = nlci - jpreci + 1 177 ijf = jprecj ! ??? 178 ijl = nlcj - jprecj + 1 179 180 tmask_h( 1 :iif, : ) = 0._wp ! first columns 181 tmask_h(iil:jpi, : ) = 0._wp ! last columns (including mpp extra columns) 182 tmask_h( : , 1 :ijf) = 0._wp ! first rows 183 tmask_h( : ,ijl:jpj) = 0._wp ! last rows (including mpp extra rows) 184 185 ! north fold mask 186 ! --------------- 187 tpol(1:jpiglo) = 1._wp 188 fpol(1:jpiglo) = 1._wp 189 IF( jperio == 3 .OR. jperio == 4 ) THEN ! T-point pivot 190 tpol(jpiglo/2+1:jpiglo) = 0._wp 191 fpol( 1 :jpiglo) = 0._wp 192 IF( mjg(nlej) == jpjglo ) THEN ! only half of the nlcj-1 row 193 DO ji = iif+1, iil-1 194 tmask_h(ji,nlej-1) = tmask_h(ji,nlej-1) * tpol(mig(ji)) 195 END DO 196 ENDIF 197 ENDIF 198 199 tmask_i(:,:) = tmask_i(:,:) * tmask_h(:,:) 200 201 IF( jperio == 5 .OR. jperio == 6 ) THEN ! F-point pivot 202 tpol( 1 :jpiglo) = 0._wp 203 fpol(jpiglo/2+1:jpiglo) = 0._wp 204 ENDIF 205 206 ! 2. Ocean/land mask at u-, v-, and z-points (computed from tmask) 207 ! ------------------------------------------- 147 ! Ocean/land mask at u-, v-, and f-points (computed from tmask) 148 ! ---------------------------------------- 149 ! NB: at this point, fmask is designed for free slip lateral boundary condition 208 150 DO jk = 1, jpk 209 151 DO jj = 1, jpjm1 … … 218 160 END DO 219 161 END DO 220 ! (ISF) MIN(1,SUM(umask)) is here to check if you have effectively at least 1 wet cell at u point221 DO jj = 1, jpjm1222 DO ji = 1, fs_jpim1 ! vector loop223 ssumask(ji,jj) = ssmask(ji,jj) * ssmask(ji+1,jj ) * MIN(1._wp,SUM(umask(ji,jj,:)))224 ssvmask(ji,jj) = ssmask(ji,jj) * ssmask(ji ,jj+1) * MIN(1._wp,SUM(vmask(ji,jj,:)))225 END DO226 DO ji = 1, jpim1 ! NO vector opt.227 ssfmask(ji,jj) = ssmask(ji,jj ) * ssmask(ji+1,jj ) &228 & * ssmask(ji,jj+1) * ssmask(ji+1,jj+1) * MIN(1._wp,SUM(fmask(ji,jj,:)))229 END DO230 END DO231 162 CALL lbc_lnk( umask , 'U', 1._wp ) ! Lateral boundary conditions 232 163 CALL lbc_lnk( vmask , 'V', 1._wp ) 233 164 CALL lbc_lnk( fmask , 'F', 1._wp ) 234 CALL lbc_lnk( ssumask, 'U', 1._wp ) ! Lateral boundary conditions 235 CALL lbc_lnk( ssvmask, 'V', 1._wp ) 236 CALL lbc_lnk( ssfmask, 'F', 1._wp ) 237 238 ! 3. Ocean/land mask at wu-, wv- and w points 239 !---------------------------------------------- 165 166 167 ! Ocean/land mask at wu-, wv- and w points (computed from tmask) 168 !----------------------------------------- 240 169 wmask (:,:,1) = tmask(:,:,1) ! surface 241 170 wumask(:,:,1) = umask(:,:,1) … … 247 176 END DO 248 177 178 179 ! Ocean/land column mask at t-, u-, and v-points (i.e. at least 1 wet cell in the vertical) 180 ! ---------------------------------------------- 181 ssmask (:,:) = MAXVAL( tmask(:,:,:), DIM=3 ) 182 ssumask(:,:) = MAXVAL( umask(:,:,:), DIM=3 ) 183 ssvmask(:,:) = MAXVAL( vmask(:,:,:), DIM=3 ) 184 185 186 ! Interior domain mask (used for global sum) 187 ! -------------------- 188 ! 189 iif = jpreci ; iil = nlci - jpreci + 1 190 ijf = jprecj ; ijl = nlcj - jprecj + 1 191 ! 192 ! ! halo mask : 0 on the halo and 1 elsewhere 193 tmask_h(:,:) = 1._wp 194 tmask_h( 1 :iif, : ) = 0._wp ! first columns 195 tmask_h(iil:jpi, : ) = 0._wp ! last columns (including mpp extra columns) 196 tmask_h( : , 1 :ijf) = 0._wp ! first rows 197 tmask_h( : ,ijl:jpj) = 0._wp ! last rows (including mpp extra rows) 198 ! 199 ! ! north fold mask 200 tpol(1:jpiglo) = 1._wp 201 fpol(1:jpiglo) = 1._wp 202 IF( jperio == 3 .OR. jperio == 4 ) THEN ! T-point pivot 203 tpol(jpiglo/2+1:jpiglo) = 0._wp 204 fpol( 1 :jpiglo) = 0._wp 205 IF( mjg(nlej) == jpjglo ) THEN ! only half of the nlcj-1 row for tmask_h 206 DO ji = iif+1, iil-1 207 tmask_h(ji,nlej-1) = tmask_h(ji,nlej-1) * tpol(mig(ji)) 208 END DO 209 ENDIF 210 ENDIF 211 ! 212 IF( jperio == 5 .OR. jperio == 6 ) THEN ! F-point pivot 213 tpol( 1 :jpiglo) = 0._wp 214 fpol(jpiglo/2+1:jpiglo) = 0._wp 215 ENDIF 216 ! 217 ! ! interior mask : 2D ocean mask x halo mask 218 tmask_i(:,:) = ssmask(:,:) * tmask_h(:,:) 219 220 249 221 ! Lateral boundary conditions on velocity (modify fmask) 250 ! --------------------------------------- 251 DO jk = 1, jpk 252 zwf(:,:) = fmask(:,:,jk) 253 DO jj = 2, jpjm1 254 DO ji = fs_2, fs_jpim1 ! vector opt. 255 IF( fmask(ji,jj,jk) == 0._wp ) THEN 256 fmask(ji,jj,jk) = rn_shlat * MIN( 1._wp , MAX( zwf(ji+1,jj), zwf(ji,jj+1), & 257 & zwf(ji-1,jj), zwf(ji,jj-1) ) ) 222 ! --------------------------------------- 223 IF( rn_shlat /= 0 ) THEN ! Not free-slip lateral boundary condition 224 ! 225 CALL wrk_alloc( jpi,jpj, zwf ) 226 ! 227 DO jk = 1, jpk 228 zwf(:,:) = fmask(:,:,jk) 229 DO jj = 2, jpjm1 230 DO ji = fs_2, fs_jpim1 ! vector opt. 231 IF( fmask(ji,jj,jk) == 0._wp ) THEN 232 fmask(ji,jj,jk) = rn_shlat * MIN( 1._wp , MAX( zwf(ji+1,jj), zwf(ji,jj+1), & 233 & zwf(ji-1,jj), zwf(ji,jj-1) ) ) 234 ENDIF 235 END DO 236 END DO 237 DO jj = 2, jpjm1 238 IF( fmask(1,jj,jk) == 0._wp ) THEN 239 fmask(1 ,jj,jk) = rn_shlat * MIN( 1._wp , MAX( zwf(2,jj), zwf(1,jj+1), zwf(1,jj-1) ) ) 240 ENDIF 241 IF( fmask(jpi,jj,jk) == 0._wp ) THEN 242 fmask(jpi,jj,jk) = rn_shlat * MIN( 1._wp , MAX( zwf(jpi,jj+1), zwf(jpim1,jj), zwf(jpi,jj-1) ) ) 243 ENDIF 244 END DO 245 DO ji = 2, jpim1 246 IF( fmask(ji,1,jk) == 0._wp ) THEN 247 fmask(ji, 1 ,jk) = rn_shlat * MIN( 1._wp , MAX( zwf(ji+1,1), zwf(ji,2), zwf(ji-1,1) ) ) 248 ENDIF 249 IF( fmask(ji,jpj,jk) == 0._wp ) THEN 250 fmask(ji,jpj,jk) = rn_shlat * MIN( 1._wp , MAX( zwf(ji+1,jpj), zwf(ji-1,jpj), zwf(ji,jpjm1) ) ) 258 251 ENDIF 259 252 END DO 260 253 END DO 261 DO jj = 2, jpjm1 262 IF( fmask(1,jj,jk) == 0._wp ) THEN 263 fmask(1 ,jj,jk) = rn_shlat * MIN( 1._wp , MAX( zwf(2,jj), zwf(1,jj+1), zwf(1,jj-1) ) ) 264 ENDIF 265 IF( fmask(jpi,jj,jk) == 0._wp ) THEN 266 fmask(jpi,jj,jk) = rn_shlat * MIN( 1._wp , MAX( zwf(jpi,jj+1), zwf(jpim1,jj), zwf(jpi,jj-1) ) ) 267 ENDIF 268 END DO 269 DO ji = 2, jpim1 270 IF( fmask(ji,1,jk) == 0._wp ) THEN 271 fmask(ji, 1 ,jk) = rn_shlat * MIN( 1._wp , MAX( zwf(ji+1,1), zwf(ji,2), zwf(ji-1,1) ) ) 272 ENDIF 273 IF( fmask(ji,jpj,jk) == 0._wp ) THEN 274 fmask(ji,jpj,jk) = rn_shlat * MIN( 1._wp , MAX( zwf(ji+1,jpj), zwf(ji-1,jpj), zwf(ji,jpjm1) ) ) 275 ENDIF 276 END DO 277 END DO 278 ! 279 IF( cp_cfg == "orca" .AND. jp_cfg == 2 ) THEN ! ORCA_R2 configuration 280 ! ! Increased lateral friction near of some straits 281 ! ! Gibraltar strait : partial slip (fmask=0.5) 282 ij0 = 101 ; ij1 = 101 283 ii0 = 139 ; ii1 = 140 ; fmask( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) , 1:jpk ) = 0.5_wp 284 ij0 = 102 ; ij1 = 102 285 ii0 = 139 ; ii1 = 140 ; fmask( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) , 1:jpk ) = 0.5_wp 286 ! 287 ! ! Bab el Mandeb : partial slip (fmask=1) 288 ij0 = 87 ; ij1 = 88 289 ii0 = 160 ; ii1 = 160 ; fmask( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) , 1:jpk ) = 1._wp 290 ij0 = 88 ; ij1 = 88 291 ii0 = 159 ; ii1 = 159 ; fmask( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) , 1:jpk ) = 1._wp 292 ! 293 ! ! Danish straits : strong slip (fmask > 2) 294 ! We keep this as an example but it is instable in this case 295 ! ij0 = 115 ; ij1 = 115 296 ! ii0 = 145 ; ii1 = 146 ; fmask( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) , 1:jpk ) = 4._wp 297 ! ij0 = 116 ; ij1 = 116 298 ! ii0 = 145 ; ii1 = 146 ; fmask( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) , 1:jpk ) = 4._wp 299 ! 300 ENDIF 301 ! 302 IF( cp_cfg == "orca" .AND. jp_cfg == 1 ) THEN ! ORCA R1 configuration 303 ! ! Increased lateral friction near of some straits 304 ! This dirty section will be suppressed by simplification process: 305 ! all this will come back in input files 306 ! Currently these hard-wired indices relate to configuration with 307 ! extend grid (jpjglo=332) 308 ! 309 isrow = 332 - jpjglo 310 ! 311 IF(lwp) WRITE(numout,*) 312 IF(lwp) WRITE(numout,*) ' orca_r1: increase friction near the following straits : ' 313 IF(lwp) WRITE(numout,*) ' Gibraltar ' 314 ii0 = 282 ; ii1 = 283 ! Gibraltar Strait 315 ij0 = 241 - isrow ; ij1 = 241 - isrow ; fmask( mi0(ii0):mi1(ii1),mj0(ij0):mj1(ij1),1:jpk ) = 2._wp 316 317 IF(lwp) WRITE(numout,*) ' Bhosporus ' 318 ii0 = 314 ; ii1 = 315 ! Bhosporus Strait 319 ij0 = 248 - isrow ; ij1 = 248 - isrow ; fmask( mi0(ii0):mi1(ii1),mj0(ij0):mj1(ij1),1:jpk ) = 2._wp 320 321 IF(lwp) WRITE(numout,*) ' Makassar (Top) ' 322 ii0 = 48 ; ii1 = 48 ! Makassar Strait (Top) 323 ij0 = 189 - isrow ; ij1 = 190 - isrow ; fmask( mi0(ii0):mi1(ii1),mj0(ij0):mj1(ij1),1:jpk ) = 3._wp 324 325 IF(lwp) WRITE(numout,*) ' Lombok ' 326 ii0 = 44 ; ii1 = 44 ! Lombok Strait 327 ij0 = 164 - isrow ; ij1 = 165 - isrow ; fmask( mi0(ii0):mi1(ii1),mj0(ij0):mj1(ij1),1:jpk ) = 2._wp 328 329 IF(lwp) WRITE(numout,*) ' Ombai ' 330 ii0 = 53 ; ii1 = 53 ! Ombai Strait 331 ij0 = 164 - isrow ; ij1 = 165 - isrow ; fmask( mi0(ii0):mi1(ii1),mj0(ij0):mj1(ij1),1:jpk ) = 2._wp 332 333 IF(lwp) WRITE(numout,*) ' Timor Passage ' 334 ii0 = 56 ; ii1 = 56 ! Timor Passage 335 ij0 = 164 - isrow ; ij1 = 165 - isrow ; fmask( mi0(ii0):mi1(ii1),mj0(ij0):mj1(ij1),1:jpk ) = 2._wp 336 337 IF(lwp) WRITE(numout,*) ' West Halmahera ' 338 ii0 = 58 ; ii1 = 58 ! West Halmahera Strait 339 ij0 = 181 - isrow ; ij1 = 182 - isrow ; fmask( mi0(ii0):mi1(ii1),mj0(ij0):mj1(ij1),1:jpk ) = 3._wp 340 341 IF(lwp) WRITE(numout,*) ' East Halmahera ' 342 ii0 = 55 ; ii1 = 55 ! East Halmahera Strait 343 ij0 = 181 - isrow ; ij1 = 182 - isrow ; fmask( mi0(ii0):mi1(ii1),mj0(ij0):mj1(ij1),1:jpk ) = 3._wp 344 ! 345 ENDIF 346 ! 347 CALL lbc_lnk( fmask, 'F', 1._wp ) ! Lateral boundary conditions on fmask 348 ! 349 ! CAUTION : The fmask may be further modified in dyn_vor_init ( dynvor.F90 ) 350 ! 351 CALL wrk_dealloc( jpi, jpj, imsk ) 352 CALL wrk_dealloc( jpi, jpj, zwf ) 254 ! 255 CALL wrk_dealloc( jpi,jpj, zwf ) 256 ! 257 CALL lbc_lnk( fmask, 'F', 1._wp ) ! Lateral boundary conditions on fmask 258 ! 259 ! CAUTION : The fmask may be further modified in dyn_vor_init ( dynvor.F90 ) depending on ln_vorlat 260 ! 261 ENDIF 262 263 ! User defined alteration of fmask (use to reduce ocean transport in specified straits) 264 ! -------------------------------- 265 ! 266 CALL usr_def_fmask( cn_cfg, nn_cfg, fmask ) 267 ! 353 268 ! 354 269 IF( nn_timing == 1 ) CALL timing_stop('dom_msk') -
branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/DOM/domngb.F90
r6140 r7277 62 62 END SELECT 63 63 64 IF (jphgr_msh /= 2 .AND. jphgr_msh /= 3) THEN 65 zlon = MOD( plon + 720., 360. ) ! plon between 0 and 360 66 zglam(:,:) = MOD( zglam(:,:) + 720., 360. ) ! glam between 0 and 360 67 IF( zlon > 270. ) zlon = zlon - 360. ! zlon between -90 and 270 68 IF( zlon < 90. ) WHERE( zglam(:,:) > 180. ) zglam(:,:) = zglam(:,:) - 360. ! glam between -180 and 180 69 zglam(:,:) = zglam(:,:) - zlon 70 ELSE 71 zglam(:,:) = zglam(:,:) - plon 72 END IF 64 zlon = MOD( plon + 720., 360. ) ! plon between 0 and 360 65 zglam(:,:) = MOD( zglam(:,:) + 720., 360. ) ! glam between 0 and 360 66 IF( zlon > 270. ) zlon = zlon - 360. ! zlon between -90 and 270 67 IF( zlon < 90. ) WHERE( zglam(:,:) > 180. ) zglam(:,:) = zglam(:,:) - 360. ! glam between -180 and 180 68 zglam(:,:) = zglam(:,:) - zlon 73 69 74 70 zgphi(:,:) = zgphi(:,:) - plat -
branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/DOM/domvvl.F90
r6351 r7277 232 232 END DO 233 233 END DO 234 IF( c p_cfg == "orca" .AND. jp_cfg == 3 ) THEN ! ORCA2: Suppress ztilde in the Foxe Basin for ORCA2234 IF( cn_cfg == "orca" .AND. nn_cfg == 3 ) THEN ! ORCA2: Suppress ztilde in the Foxe Basin for ORCA2 235 235 ii0 = 103 ; ii1 = 111 236 236 ij0 = 128 ; ij1 = 135 ; … … 885 885 e3t_n(ji,jj,:) = 0.5_wp * rn_wdmin1 886 886 e3t_a(ji,jj,:) = 0.5_wp * rn_wdmin1 887 sshb(ji,jj) = rn_wdmin1 - bathy(ji,jj)888 sshn(ji,jj) = rn_wdmin1 - bathy(ji,jj)889 ssha(ji,jj) = rn_wdmin1 - bathy(ji,jj)887 sshb(ji,jj) = rn_wdmin1 - ht_0(ji,jj) !!gm I don't understand that ! 888 sshn(ji,jj) = rn_wdmin1 - ht_0(ji,jj) 889 ssha(ji,jj) = rn_wdmin1 - ht_0(ji,jj) 890 890 ENDIF 891 891 ENDDO … … 894 894 895 895 IF( ln_vvl_ztilde .OR. ln_vvl_layer) THEN 896 tilde_e3t_b(:,:,:) = 0. 0_wp897 tilde_e3t_n(:,:,:) = 0. 0_wp898 IF( ln_vvl_ztilde ) hdiv_lf(:,:,:) = 0. 0_wp896 tilde_e3t_b(:,:,:) = 0._wp 897 tilde_e3t_n(:,:,:) = 0._wp 898 IF( ln_vvl_ztilde ) hdiv_lf(:,:,:) = 0._wp 899 899 END IF 900 900 ENDIF -
branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/DOM/domwri.F90
r5836 r7277 8 8 !! NEMO 1.0 ! 2002-08 (G. Madec) F90 and several file 9 9 !! 3.0 ! 2008-01 (S. Masson) add dom_uniq 10 !! 4.0 ! 2016-01 (G. Madec) simplified mesh_mask.nc file 10 11 !!---------------------------------------------------------------------- 11 12 … … 13 14 !! dom_wri : create and write mesh and mask file(s) 14 15 !! dom_uniq : identify unique point of a grid (TUVF) 16 !! dom_stiff : diagnose maximum grid stiffness/hydrostatic consistency (s-coordinate) 15 17 !!---------------------------------------------------------------------- 16 18 USE dom_oce ! ocean space and time domain 19 USE phycst , ONLY : rsmall 20 ! 17 21 USE in_out_manager ! I/O manager 18 22 USE iom ! I/O library … … 26 30 27 31 PUBLIC dom_wri ! routine called by inidom.F90 28 PUBLIC dom_wri_coordinate ! routine called by domhgr.F90 32 PUBLIC dom_stiff ! routine called by inidom.F90 33 29 34 !! * Substitutions 30 35 # include "vectopt_loop_substitute.h90" 31 36 !!---------------------------------------------------------------------- 32 !! NEMO/OPA 3.3 , NEMO Consortium (2010)37 !! NEMO/OPA 4.0 , NEMO Consortium (2016) 33 38 !! $Id$ 34 39 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 35 40 !!---------------------------------------------------------------------- 36 41 CONTAINS 37 38 SUBROUTINE dom_wri_coordinate39 !!----------------------------------------------------------------------40 !! *** ROUTINE dom_wri_coordinate ***41 !!42 !! ** Purpose : Create the NetCDF file which contains all the43 !! standard coordinate information plus the surface,44 !! e1e2u and e1e2v. By doing so, those surface will45 !! not be changed by the reduction of e1u or e2v scale46 !! factors in some straits.47 !! NB: call just after the read of standard coordinate48 !! and the reduction of scale factors in some straits49 !!50 !! ** output file : coordinate_e1e2u_v.nc51 !!----------------------------------------------------------------------52 INTEGER :: inum0 ! temprary units for 'coordinate_e1e2u_v.nc' file53 CHARACTER(len=21) :: clnam0 ! filename (mesh and mask informations)54 ! ! workspaces55 REAL(wp), POINTER, DIMENSION(:,: ) :: zprt, zprw56 REAL(wp), POINTER, DIMENSION(:,:,:) :: zdepu, zdepv57 !!----------------------------------------------------------------------58 !59 IF( nn_timing == 1 ) CALL timing_start('dom_wri_coordinate')60 !61 IF(lwp) WRITE(numout,*)62 IF(lwp) WRITE(numout,*) 'dom_wri_coordinate : create NetCDF coordinate file'63 IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~~~~~~~'64 65 clnam0 = 'coordinate_e1e2u_v' ! filename (mesh and mask informations)66 67 ! create 'coordinate_e1e2u_v.nc' file68 ! ============================69 !70 CALL iom_open( TRIM(clnam0), inum0, ldwrt = .TRUE., kiolib = jprstlib )71 !72 ! ! horizontal mesh (inum3)73 CALL iom_rstput( 0, 0, inum0, 'glamt', glamt, ktype = jp_r4 ) ! ! latitude74 CALL iom_rstput( 0, 0, inum0, 'glamu', glamu, ktype = jp_r4 )75 CALL iom_rstput( 0, 0, inum0, 'glamv', glamv, ktype = jp_r4 )76 CALL iom_rstput( 0, 0, inum0, 'glamf', glamf, ktype = jp_r4 )77 78 CALL iom_rstput( 0, 0, inum0, 'gphit', gphit, ktype = jp_r4 ) ! ! longitude79 CALL iom_rstput( 0, 0, inum0, 'gphiu', gphiu, ktype = jp_r4 )80 CALL iom_rstput( 0, 0, inum0, 'gphiv', gphiv, ktype = jp_r4 )81 CALL iom_rstput( 0, 0, inum0, 'gphif', gphif, ktype = jp_r4 )82 83 CALL iom_rstput( 0, 0, inum0, 'e1t', e1t, ktype = jp_r8 ) ! ! e1 scale factors84 CALL iom_rstput( 0, 0, inum0, 'e1u', e1u, ktype = jp_r8 )85 CALL iom_rstput( 0, 0, inum0, 'e1v', e1v, ktype = jp_r8 )86 CALL iom_rstput( 0, 0, inum0, 'e1f', e1f, ktype = jp_r8 )87 88 CALL iom_rstput( 0, 0, inum0, 'e2t', e2t, ktype = jp_r8 ) ! ! e2 scale factors89 CALL iom_rstput( 0, 0, inum0, 'e2u', e2u, ktype = jp_r8 )90 CALL iom_rstput( 0, 0, inum0, 'e2v', e2v, ktype = jp_r8 )91 CALL iom_rstput( 0, 0, inum0, 'e2f', e2f, ktype = jp_r8 )92 93 CALL iom_rstput( 0, 0, inum0, 'e1e2u', e1e2u, ktype = jp_r8 )94 CALL iom_rstput( 0, 0, inum0, 'e1e2v', e1e2v, ktype = jp_r8 )95 96 CALL iom_close( inum0 )97 !98 IF( nn_timing == 1 ) CALL timing_stop('dom_wri_coordinate')99 !100 END SUBROUTINE dom_wri_coordinate101 102 42 103 43 SUBROUTINE dom_wri … … 113 53 !! domhgr, domzgr, and dommsk. Note: the file contain depends on 114 54 !! the vertical coord. used (z-coord, partial steps, s-coord) 115 !! MOD(n msh, 3) = 1 : 'mesh_mask.nc' file55 !! MOD(nn_msh, 3) = 1 : 'mesh_mask.nc' file 116 56 !! = 2 : 'mesh.nc' and mask.nc' files 117 57 !! = 0 : 'mesh_hgr.nc', 'mesh_zgr.nc' and … … 120 60 !! vertical coordinate. 121 61 !! 122 !! if n msh <= 3: write full 3D arrays for e3[tuvw] and gdep[tuvw]123 !! if 3 < n msh <= 6: write full 3D arrays for e3[tuvw] and 2D arrays62 !! if nn_msh <= 3: write full 3D arrays for e3[tuvw] and gdep[tuvw] 63 !! if 3 < nn_msh <= 6: write full 3D arrays for e3[tuvw] and 2D arrays 124 64 !! corresponding to the depth of the bottom t- and w-points 125 !! if 6 < n msh <= 9: write 2D arrays corresponding to the depth and the65 !! if 6 < nn_msh <= 9: write 2D arrays corresponding to the depth and the 126 66 !! thickness (e3[tw]_ps) of the bottom points 127 67 !! … … 129 69 !! masks, depth and vertical scale factors 130 70 !!---------------------------------------------------------------------- 131 !! 132 INTEGER :: inum0 ! temprary units for 'mesh_mask.nc' file 133 INTEGER :: inum1 ! temprary units for 'mesh.nc' file 134 INTEGER :: inum2 ! temprary units for 'mask.nc' file 135 INTEGER :: inum3 ! temprary units for 'mesh_hgr.nc' file 136 INTEGER :: inum4 ! temprary units for 'mesh_zgr.nc' file 137 CHARACTER(len=21) :: clnam0 ! filename (mesh and mask informations) 138 CHARACTER(len=21) :: clnam1 ! filename (mesh informations) 139 CHARACTER(len=21) :: clnam2 ! filename (mask informations) 140 CHARACTER(len=21) :: clnam3 ! filename (horizontal mesh informations) 141 CHARACTER(len=21) :: clnam4 ! filename (vertical mesh informations) 71 INTEGER :: inum ! temprary units for 'mesh_mask.nc' file 72 CHARACTER(len=21) :: clnam ! filename (mesh and mask informations) 142 73 INTEGER :: ji, jj, jk ! dummy loop indices 143 ! ! workspaces 144 REAL(wp), POINTER, DIMENSION(:,: ) :: zprt, zprw 145 REAL(wp), POINTER, DIMENSION(:,:,:) :: zdepu, zdepv 74 INTEGER :: izco, izps, isco, icav 75 ! 76 REAL(wp), POINTER, DIMENSION(:,:) :: zprt, zprw ! 2D workspace 77 REAL(wp), POINTER, DIMENSION(:,:,:) :: zdepu, zdepv ! 3D workspace 146 78 !!---------------------------------------------------------------------- 147 79 ! 148 80 IF( nn_timing == 1 ) CALL timing_start('dom_wri') 149 81 ! 150 CALL wrk_alloc( jpi, jpj, zprt, zprw)151 CALL wrk_alloc( jpi, jpj, jpk,zdepu, zdepv )82 CALL wrk_alloc( jpi,jpj, zprt , zprw ) 83 CALL wrk_alloc( jpi,jpj,jpk, zdepu, zdepv ) 152 84 ! 153 85 IF(lwp) WRITE(numout,*) … … 155 87 IF(lwp) WRITE(numout,*) '~~~~~~~' 156 88 157 clnam0 = 'mesh_mask' ! filename (mesh and mask informations) 158 clnam1 = 'mesh' ! filename (mesh informations) 159 clnam2 = 'mask' ! filename (mask informations) 160 clnam3 = 'mesh_hgr' ! filename (horizontal mesh informations) 161 clnam4 = 'mesh_zgr' ! filename (vertical mesh informations) 162 163 SELECT CASE ( MOD(nmsh, 3) ) 164 ! ! ============================ 165 CASE ( 1 ) ! create 'mesh_mask.nc' file 166 ! ! ============================ 167 CALL iom_open( TRIM(clnam0), inum0, ldwrt = .TRUE., kiolib = jprstlib ) 168 inum2 = inum0 ! put all the informations 169 inum3 = inum0 ! in unit inum0 170 inum4 = inum0 171 172 ! ! ============================ 173 CASE ( 2 ) ! create 'mesh.nc' and 174 ! ! 'mask.nc' files 175 ! ! ============================ 176 CALL iom_open( TRIM(clnam1), inum1, ldwrt = .TRUE., kiolib = jprstlib ) 177 CALL iom_open( TRIM(clnam2), inum2, ldwrt = .TRUE., kiolib = jprstlib ) 178 inum3 = inum1 ! put mesh informations 179 inum4 = inum1 ! in unit inum1 180 ! ! ============================ 181 CASE ( 0 ) ! create 'mesh_hgr.nc' 182 ! ! 'mesh_zgr.nc' and 183 ! ! 'mask.nc' files 184 ! ! ============================ 185 CALL iom_open( TRIM(clnam2), inum2, ldwrt = .TRUE., kiolib = jprstlib ) 186 CALL iom_open( TRIM(clnam3), inum3, ldwrt = .TRUE., kiolib = jprstlib ) 187 CALL iom_open( TRIM(clnam4), inum4, ldwrt = .TRUE., kiolib = jprstlib ) 188 ! 189 END SELECT 190 191 ! ! masks (inum2) 192 CALL iom_rstput( 0, 0, inum2, 'tmask', tmask, ktype = jp_i1 ) ! ! land-sea mask 193 CALL iom_rstput( 0, 0, inum2, 'umask', umask, ktype = jp_i1 ) 194 CALL iom_rstput( 0, 0, inum2, 'vmask', vmask, ktype = jp_i1 ) 195 CALL iom_rstput( 0, 0, inum2, 'fmask', fmask, ktype = jp_i1 ) 89 clnam = 'mesh_mask' ! filename (mesh and mask informations) 90 91 ! ! ============================ 92 ! ! create 'mesh_mask.nc' file 93 ! ! ============================ 94 CALL iom_open( TRIM(clnam), inum, ldwrt = .TRUE., kiolib = jprstlib ) 95 ! 96 ! ! global domain size 97 CALL iom_rstput( 0, 0, inum, 'jpiglo', REAL( jpiglo, wp), ktype = jp_i4 ) 98 CALL iom_rstput( 0, 0, inum, 'jpjglo', REAL( jpjglo, wp), ktype = jp_i4 ) 99 CALL iom_rstput( 0, 0, inum, 'jpkglo', REAL( jpkglo, wp), ktype = jp_i4 ) 100 101 ! ! domain characteristics 102 CALL iom_rstput( 0, 0, inum, 'jperio', REAL( jperio, wp), ktype = jp_i4 ) 103 ! ! type of vertical coordinate 104 IF( ln_zco ) THEN ; izco = 1 ; ELSE ; izco = 0 ; ENDIF 105 IF( ln_zps ) THEN ; izps = 1 ; ELSE ; izps = 0 ; ENDIF 106 IF( ln_sco ) THEN ; isco = 1 ; ELSE ; isco = 0 ; ENDIF 107 CALL iom_rstput( 0, 0, inum, 'ln_zco' , REAL( izco, wp), ktype = jp_i4 ) 108 CALL iom_rstput( 0, 0, inum, 'ln_zps' , REAL( izps, wp), ktype = jp_i4 ) 109 CALL iom_rstput( 0, 0, inum, 'ln_sco' , REAL( isco, wp), ktype = jp_i4 ) 110 ! ! ocean cavities under iceshelves 111 IF( ln_isfcav ) THEN ; icav = 1 ; ELSE ; icav = 0 ; ENDIF 112 CALL iom_rstput( 0, 0, inum, 'ln_isfcav', REAL( icav, wp), ktype = jp_i4 ) 113 114 ! ! masks 115 CALL iom_rstput( 0, 0, inum, 'tmask', tmask, ktype = jp_i1 ) ! ! land-sea mask 116 CALL iom_rstput( 0, 0, inum, 'umask', umask, ktype = jp_i1 ) 117 CALL iom_rstput( 0, 0, inum, 'vmask', vmask, ktype = jp_i1 ) 118 CALL iom_rstput( 0, 0, inum, 'fmask', fmask, ktype = jp_i1 ) 196 119 197 120 CALL dom_uniq( zprw, 'T' ) 198 121 DO jj = 1, jpj 199 122 DO ji = 1, jpi 200 jk=mikt(ji,jj) 201 zprt(ji,jj) = tmask(ji,jj,jk) * zprw(ji,jj) ! ! unique point mask 123 zprt(ji,jj) = ssmask(ji,jj) * zprw(ji,jj) ! ! unique point mask 202 124 END DO 203 125 END DO ! ! unique point mask 204 CALL iom_rstput( 0, 0, inum 2, 'tmaskutil', zprt, ktype = jp_i1 )126 CALL iom_rstput( 0, 0, inum, 'tmaskutil', zprt, ktype = jp_i1 ) 205 127 CALL dom_uniq( zprw, 'U' ) 206 128 DO jj = 1, jpj 207 129 DO ji = 1, jpi 208 jk=miku(ji,jj) 209 zprt(ji,jj) = umask(ji,jj,jk) * zprw(ji,jj) ! ! unique point mask 130 zprt(ji,jj) = ssumask(ji,jj) * zprw(ji,jj) ! ! unique point mask 210 131 END DO 211 132 END DO 212 CALL iom_rstput( 0, 0, inum 2, 'umaskutil', zprt, ktype = jp_i1 )133 CALL iom_rstput( 0, 0, inum, 'umaskutil', zprt, ktype = jp_i1 ) 213 134 CALL dom_uniq( zprw, 'V' ) 214 135 DO jj = 1, jpj 215 136 DO ji = 1, jpi 216 jk=mikv(ji,jj) 217 zprt(ji,jj) = vmask(ji,jj,jk) * zprw(ji,jj) ! ! unique point mask 137 zprt(ji,jj) = ssvmask(ji,jj) * zprw(ji,jj) ! ! unique point mask 218 138 END DO 219 139 END DO 220 CALL iom_rstput( 0, 0, inum2, 'vmaskutil', zprt, ktype = jp_i1 ) 221 CALL dom_uniq( zprw, 'F' ) 222 DO jj = 1, jpj 223 DO ji = 1, jpi 224 jk=mikf(ji,jj) 225 zprt(ji,jj) = fmask(ji,jj,jk) * zprw(ji,jj) ! ! unique point mask 226 END DO 227 END DO 228 CALL iom_rstput( 0, 0, inum2, 'fmaskutil', zprt, ktype = jp_i1 ) 140 CALL iom_rstput( 0, 0, inum, 'vmaskutil', zprt, ktype = jp_i1 ) 141 !!gm ssfmask has been removed ==>> find another solution to defined fmaskutil 142 !! Here we just remove the output of fmaskutil. 143 ! CALL dom_uniq( zprw, 'F' ) 144 ! DO jj = 1, jpj 145 ! DO ji = 1, jpi 146 ! zprt(ji,jj) = ssfmask(ji,jj) * zprw(ji,jj) ! ! unique point mask 147 ! END DO 148 ! END DO 149 ! CALL iom_rstput( 0, 0, inum, 'fmaskutil', zprt, ktype = jp_i1 ) 150 !!gm 229 151 230 152 ! ! horizontal mesh (inum3) 231 CALL iom_rstput( 0, 0, inum3, 'glamt', glamt, ktype = jp_r4 ) ! ! latitude 232 CALL iom_rstput( 0, 0, inum3, 'glamu', glamu, ktype = jp_r4 ) 233 CALL iom_rstput( 0, 0, inum3, 'glamv', glamv, ktype = jp_r4 ) 234 CALL iom_rstput( 0, 0, inum3, 'glamf', glamf, ktype = jp_r4 ) 235 236 CALL iom_rstput( 0, 0, inum3, 'gphit', gphit, ktype = jp_r4 ) ! ! longitude 237 CALL iom_rstput( 0, 0, inum3, 'gphiu', gphiu, ktype = jp_r4 ) 238 CALL iom_rstput( 0, 0, inum3, 'gphiv', gphiv, ktype = jp_r4 ) 239 CALL iom_rstput( 0, 0, inum3, 'gphif', gphif, ktype = jp_r4 ) 240 241 CALL iom_rstput( 0, 0, inum3, 'e1t', e1t, ktype = jp_r8 ) ! ! e1 scale factors 242 CALL iom_rstput( 0, 0, inum3, 'e1u', e1u, ktype = jp_r8 ) 243 CALL iom_rstput( 0, 0, inum3, 'e1v', e1v, ktype = jp_r8 ) 244 CALL iom_rstput( 0, 0, inum3, 'e1f', e1f, ktype = jp_r8 ) 245 246 CALL iom_rstput( 0, 0, inum3, 'e2t', e2t, ktype = jp_r8 ) ! ! e2 scale factors 247 CALL iom_rstput( 0, 0, inum3, 'e2u', e2u, ktype = jp_r8 ) 248 CALL iom_rstput( 0, 0, inum3, 'e2v', e2v, ktype = jp_r8 ) 249 CALL iom_rstput( 0, 0, inum3, 'e2f', e2f, ktype = jp_r8 ) 250 251 CALL iom_rstput( 0, 0, inum3, 'ff', ff, ktype = jp_r8 ) ! ! coriolis factor 153 CALL iom_rstput( 0, 0, inum, 'glamt', glamt, ktype = jp_r8 ) ! ! latitude 154 CALL iom_rstput( 0, 0, inum, 'glamu', glamu, ktype = jp_r8 ) 155 CALL iom_rstput( 0, 0, inum, 'glamv', glamv, ktype = jp_r8 ) 156 CALL iom_rstput( 0, 0, inum, 'glamf', glamf, ktype = jp_r8 ) 157 158 CALL iom_rstput( 0, 0, inum, 'gphit', gphit, ktype = jp_r8 ) ! ! longitude 159 CALL iom_rstput( 0, 0, inum, 'gphiu', gphiu, ktype = jp_r8 ) 160 CALL iom_rstput( 0, 0, inum, 'gphiv', gphiv, ktype = jp_r8 ) 161 CALL iom_rstput( 0, 0, inum, 'gphif', gphif, ktype = jp_r8 ) 162 163 CALL iom_rstput( 0, 0, inum, 'e1t', e1t, ktype = jp_r8 ) ! ! e1 scale factors 164 CALL iom_rstput( 0, 0, inum, 'e1u', e1u, ktype = jp_r8 ) 165 CALL iom_rstput( 0, 0, inum, 'e1v', e1v, ktype = jp_r8 ) 166 CALL iom_rstput( 0, 0, inum, 'e1f', e1f, ktype = jp_r8 ) 167 168 CALL iom_rstput( 0, 0, inum, 'e2t', e2t, ktype = jp_r8 ) ! ! e2 scale factors 169 CALL iom_rstput( 0, 0, inum, 'e2u', e2u, ktype = jp_r8 ) 170 CALL iom_rstput( 0, 0, inum, 'e2v', e2v, ktype = jp_r8 ) 171 CALL iom_rstput( 0, 0, inum, 'e2f', e2f, ktype = jp_r8 ) 172 173 CALL iom_rstput( 0, 0, inum, 'ff_f', ff_f, ktype = jp_r8 ) ! ! coriolis factor 174 CALL iom_rstput( 0, 0, inum, 'ff_t', ff_t, ktype = jp_r8 ) 252 175 253 176 ! note that mbkt is set to 1 over land ==> use surface tmask 254 177 zprt(:,:) = ssmask(:,:) * REAL( mbkt(:,:) , wp ) 255 CALL iom_rstput( 0, 0, inum 4, 'mbathy', zprt, ktype = jp_i2) ! ! nb of ocean T-points178 CALL iom_rstput( 0, 0, inum, 'mbathy', zprt, ktype = jp_i4 ) ! ! nb of ocean T-points 256 179 zprt(:,:) = ssmask(:,:) * REAL( mikt(:,:) , wp ) 257 CALL iom_rstput( 0, 0, inum 4, 'misf', zprt, ktype = jp_i2) ! ! nb of ocean T-points180 CALL iom_rstput( 0, 0, inum, 'misf', zprt, ktype = jp_i4 ) ! ! nb of ocean T-points 258 181 zprt(:,:) = ssmask(:,:) * REAL( risfdep(:,:) , wp ) 259 CALL iom_rstput( 0, 0, inum 4, 'isfdraft', zprt, ktype = jp_r4 )! ! nb of ocean T-points182 CALL iom_rstput( 0, 0, inum, 'isfdraft', zprt, ktype = jp_r8 ) ! ! nb of ocean T-points 260 183 261 IF( ln_sco ) THEN ! s-coordinate 262 CALL iom_rstput( 0, 0, inum4, 'hbatt', hbatt ) 263 CALL iom_rstput( 0, 0, inum4, 'hbatu', hbatu ) 264 CALL iom_rstput( 0, 0, inum4, 'hbatv', hbatv ) 265 CALL iom_rstput( 0, 0, inum4, 'hbatf', hbatf ) 266 ! 267 CALL iom_rstput( 0, 0, inum4, 'gsigt', gsigt ) ! ! scaling coef. 268 CALL iom_rstput( 0, 0, inum4, 'gsigw', gsigw ) 269 CALL iom_rstput( 0, 0, inum4, 'gsi3w', gsi3w ) 270 CALL iom_rstput( 0, 0, inum4, 'esigt', esigt ) 271 CALL iom_rstput( 0, 0, inum4, 'esigw', esigw ) 272 ! 273 CALL iom_rstput( 0, 0, inum4, 'e3t_0', e3t_0 ) ! ! scale factors 274 CALL iom_rstput( 0, 0, inum4, 'e3u_0', e3u_0 ) 275 CALL iom_rstput( 0, 0, inum4, 'e3v_0', e3v_0 ) 276 CALL iom_rstput( 0, 0, inum4, 'e3w_0', e3w_0 ) 277 CALL iom_rstput( 0, 0, inum4, 'rx1', rx1 ) ! ! Max. grid stiffness ratio 278 ! 279 CALL iom_rstput( 0, 0, inum4, 'gdept_1d' , gdept_1d ) ! ! stretched system 280 CALL iom_rstput( 0, 0, inum4, 'gdepw_1d' , gdepw_1d ) 281 CALL iom_rstput( 0, 0, inum4, 'gdept_0', gdept_0, ktype = jp_r4 ) 282 CALL iom_rstput( 0, 0, inum4, 'gdepw_0', gdepw_0, ktype = jp_r4 ) 283 ENDIF 284 285 IF( ln_zps ) THEN ! z-coordinate - partial steps 286 ! 287 IF( nmsh <= 6 ) THEN ! ! 3D vertical scale factors 288 CALL iom_rstput( 0, 0, inum4, 'e3t_0', e3t_0 ) 289 CALL iom_rstput( 0, 0, inum4, 'e3u_0', e3u_0 ) 290 CALL iom_rstput( 0, 0, inum4, 'e3v_0', e3v_0 ) 291 CALL iom_rstput( 0, 0, inum4, 'e3w_0', e3w_0 ) 292 ELSE ! ! 2D masked bottom ocean scale factors 293 DO jj = 1,jpj 294 DO ji = 1,jpi 295 e3tp(ji,jj) = e3t_0(ji,jj,mbkt(ji,jj)) * ssmask(ji,jj) 296 e3wp(ji,jj) = e3w_0(ji,jj,mbkt(ji,jj)) * ssmask(ji,jj) 297 END DO 298 END DO 299 CALL iom_rstput( 0, 0, inum4, 'e3t_ps', e3tp ) 300 CALL iom_rstput( 0, 0, inum4, 'e3w_ps', e3wp ) 301 END IF 302 ! 303 IF( nmsh <= 3 ) THEN ! ! 3D depth 304 CALL iom_rstput( 0, 0, inum4, 'gdept_0', gdept_0, ktype = jp_r4 ) 305 DO jk = 1,jpk 306 DO jj = 1, jpjm1 307 DO ji = 1, fs_jpim1 ! vector opt. 308 zdepu(ji,jj,jk) = MIN( gdept_0(ji,jj,jk) , gdept_0(ji+1,jj ,jk) ) 309 zdepv(ji,jj,jk) = MIN( gdept_0(ji,jj,jk) , gdept_0(ji ,jj+1,jk) ) 310 END DO 311 END DO 312 END DO 313 CALL lbc_lnk( zdepu, 'U', 1. ) ; CALL lbc_lnk( zdepv, 'V', 1. ) 314 CALL iom_rstput( 0, 0, inum4, 'gdepu', zdepu, ktype = jp_r4 ) 315 CALL iom_rstput( 0, 0, inum4, 'gdepv', zdepv, ktype = jp_r4 ) 316 CALL iom_rstput( 0, 0, inum4, 'gdepw_0', gdepw_0, ktype = jp_r4 ) 317 ELSE ! ! 2D bottom depth 318 DO jj = 1,jpj 319 DO ji = 1,jpi 320 zprt(ji,jj) = gdept_0(ji,jj,mbkt(ji,jj) ) * ssmask(ji,jj) 321 zprw(ji,jj) = gdepw_0(ji,jj,mbkt(ji,jj)+1) * ssmask(ji,jj) 322 END DO 323 END DO 324 CALL iom_rstput( 0, 0, inum4, 'hdept', zprt, ktype = jp_r4 ) 325 CALL iom_rstput( 0, 0, inum4, 'hdepw', zprw, ktype = jp_r4 ) 326 ENDIF 327 ! 328 CALL iom_rstput( 0, 0, inum4, 'gdept_1d', gdept_1d ) ! ! reference z-coord. 329 CALL iom_rstput( 0, 0, inum4, 'gdepw_1d', gdepw_1d ) 330 CALL iom_rstput( 0, 0, inum4, 'e3t_1d' , e3t_1d ) 331 CALL iom_rstput( 0, 0, inum4, 'e3w_1d' , e3w_1d ) 332 ENDIF 333 334 IF( ln_zco ) THEN 335 ! ! z-coordinate - full steps 336 CALL iom_rstput( 0, 0, inum4, 'gdept_1d', gdept_1d ) ! ! depth 337 CALL iom_rstput( 0, 0, inum4, 'gdepw_1d', gdepw_1d ) 338 CALL iom_rstput( 0, 0, inum4, 'e3t_1d' , e3t_1d ) ! ! scale factors 339 CALL iom_rstput( 0, 0, inum4, 'e3w_1d' , e3w_1d ) 340 ENDIF 184 ! ! vertical mesh 185 CALL iom_rstput( 0, 0, inum, 'e3t_0', e3t_0, ktype = jp_r8 ) ! ! scale factors 186 CALL iom_rstput( 0, 0, inum, 'e3u_0', e3u_0, ktype = jp_r8 ) 187 CALL iom_rstput( 0, 0, inum, 'e3v_0', e3v_0, ktype = jp_r8 ) 188 CALL iom_rstput( 0, 0, inum, 'e3w_0', e3w_0, ktype = jp_r8 ) 189 ! 190 CALL iom_rstput( 0, 0, inum, 'gdept_1d' , gdept_1d , ktype = jp_r8 ) ! stretched system 191 CALL iom_rstput( 0, 0, inum, 'gdepw_1d' , gdepw_1d , ktype = jp_r8 ) 192 CALL iom_rstput( 0, 0, inum, 'gdept_0' , gdept_0 , ktype = jp_r8 ) 193 CALL iom_rstput( 0, 0, inum, 'gdepw_0' , gdepw_0 , ktype = jp_r8 ) 194 ! 195 IF( ln_sco ) THEN ! s-coordinate stiffness 196 CALL dom_stiff( zprt ) 197 CALL iom_rstput( 0, 0, inum, 'stiffness', zprt ) ! ! Max. grid stiffness ratio 198 ENDIF 199 ! 341 200 ! ! ============================ 342 !! close the files201 CALL iom_close( inum ) ! close the files 343 202 ! ! ============================ 344 SELECT CASE ( MOD(nmsh, 3) )345 CASE ( 1 )346 CALL iom_close( inum0 )347 CASE ( 2 )348 CALL iom_close( inum1 )349 CALL iom_close( inum2 )350 CASE ( 0 )351 CALL iom_close( inum2 )352 CALL iom_close( inum3 )353 CALL iom_close( inum4 )354 END SELECT355 203 ! 356 204 CALL wrk_dealloc( jpi, jpj, zprt, zprw ) … … 371 219 !! 2) check which elements have been changed 372 220 !!---------------------------------------------------------------------- 373 !374 221 CHARACTER(len=1) , INTENT(in ) :: cdgrd ! 375 222 REAL(wp), DIMENSION(:,:), INTENT(inout) :: puniq ! … … 405 252 END SUBROUTINE dom_uniq 406 253 254 255 SUBROUTINE dom_stiff( px1 ) 256 !!---------------------------------------------------------------------- 257 !! *** ROUTINE dom_stiff *** 258 !! 259 !! ** Purpose : Diagnose maximum grid stiffness/hydrostatic consistency 260 !! 261 !! ** Method : Compute Haney (1991) hydrostatic condition ratio 262 !! Save the maximum in the vertical direction 263 !! (this number is only relevant in s-coordinates) 264 !! 265 !! Haney, 1991, J. Phys. Oceanogr., 21, 610-619. 266 !!---------------------------------------------------------------------- 267 REAL(wp), DIMENSION(:,:), INTENT(out), OPTIONAL :: px1 ! stiffness 268 ! 269 INTEGER :: ji, jj, jk 270 REAL(wp) :: zrxmax 271 REAL(wp), DIMENSION(4) :: zr1 272 REAL(wp), DIMENSION(jpi,jpj) :: zx1 273 !!---------------------------------------------------------------------- 274 zx1(:,:) = 0._wp 275 zrxmax = 0._wp 276 zr1(:) = 0._wp 277 ! 278 DO ji = 2, jpim1 279 DO jj = 2, jpjm1 280 DO jk = 1, jpkm1 281 !!gm remark: dk(gdepw) = e3t ===>>> possible simplification of the following calculation.... 282 !! especially since it is gde3w which is used to compute the pressure gradient 283 !! furthermore, I think gdept_0 should be used below instead of w point in the numerator 284 !! so that the ratio is computed at the same point (i.e. uw and vw) .... 285 zr1(1) = ABS( ( gdepw_0(ji ,jj,jk )-gdepw_0(ji-1,jj,jk ) & 286 & +gdepw_0(ji ,jj,jk+1)-gdepw_0(ji-1,jj,jk+1) ) & 287 & / ( gdepw_0(ji ,jj,jk )+gdepw_0(ji-1,jj,jk ) & 288 & -gdepw_0(ji ,jj,jk+1)-gdepw_0(ji-1,jj,jk+1) + rsmall ) ) * umask(ji-1,jj,jk) 289 zr1(2) = ABS( ( gdepw_0(ji+1,jj,jk )-gdepw_0(ji ,jj,jk ) & 290 & +gdepw_0(ji+1,jj,jk+1)-gdepw_0(ji ,jj,jk+1) ) & 291 & / ( gdepw_0(ji+1,jj,jk )+gdepw_0(ji ,jj,jk ) & 292 & -gdepw_0(ji+1,jj,jk+1)-gdepw_0(ji ,jj,jk+1) + rsmall ) ) * umask(ji ,jj,jk) 293 zr1(3) = ABS( ( gdepw_0(ji,jj+1,jk )-gdepw_0(ji,jj ,jk ) & 294 & +gdepw_0(ji,jj+1,jk+1)-gdepw_0(ji,jj ,jk+1) ) & 295 & / ( gdepw_0(ji,jj+1,jk )+gdepw_0(ji,jj ,jk ) & 296 & -gdepw_0(ji,jj+1,jk+1)-gdepw_0(ji,jj ,jk+1) + rsmall ) ) * vmask(ji,jj ,jk) 297 zr1(4) = ABS( ( gdepw_0(ji,jj ,jk )-gdepw_0(ji,jj-1,jk ) & 298 & +gdepw_0(ji,jj ,jk+1)-gdepw_0(ji,jj-1,jk+1) ) & 299 & / ( gdepw_0(ji,jj ,jk )+gdepw_0(ji,jj-1,jk ) & 300 & -gdepw_0(ji,jj ,jk+1)-gdepw_0(ji,jj-1,jk+1) + rsmall ) ) * vmask(ji,jj-1,jk) 301 zrxmax = MAXVAL( zr1(1:4) ) 302 zx1(ji,jj) = MAX( zx1(ji,jj) , zrxmax ) 303 END DO 304 END DO 305 END DO 306 CALL lbc_lnk( zx1, 'T', 1. ) 307 ! 308 IF( PRESENT( px1 ) ) px1 = zx1 309 ! 310 zrxmax = MAXVAL( zx1 ) 311 ! 312 IF( lk_mpp ) CALL mpp_max( zrxmax ) ! max over the global domain 313 ! 314 IF(lwp) THEN 315 WRITE(numout,*) 316 WRITE(numout,*) 'dom_stiff : maximum grid stiffness ratio: ', zrxmax 317 WRITE(numout,*) '~~~~~~~~~' 318 ENDIF 319 ! 320 END SUBROUTINE dom_stiff 321 407 322 !!====================================================================== 408 323 END MODULE domwri -
branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/DOM/domzgr.F90
r6152 r7277 22 22 23 23 !!---------------------------------------------------------------------- 24 !! dom_zgr : defined the ocean vertical coordinate system 25 !! zgr_bat : bathymetry fields (levels and meters) 26 !! zgr_bat_zoom : modify the bathymetry field if zoom domain 27 !! zgr_bat_ctl : check the bathymetry files 28 !! zgr_bot_level: deepest ocean level for t-, u, and v-points 29 !! zgr_z : reference z-coordinate 30 !! zgr_zco : z-coordinate 31 !! zgr_zps : z-coordinate with partial steps 32 !! zgr_sco : s-coordinate 33 !! fssig : tanh stretch function 34 !! fssig1 : Song and Haidvogel 1994 stretch function 35 !! fgamma : Siddorn and Furner 2012 stretching function 24 !! dom_zgr : read or set the ocean vertical coordinate system 25 !! zgr_read : read the vertical information in the domain configuration file 26 !! zgr_top_bot : ocean top and bottom level for t-, u, and v-points with 1 as minimum value 36 27 !!--------------------------------------------------------------------- 37 USE oce ! ocean variables 38 USE dom_oce ! ocean domain 39 USE wet_dry ! wetting and drying 40 USE closea ! closed seas 41 USE c1d ! 1D vertical configuration 28 USE oce ! ocean variables 29 USE dom_oce ! ocean domain 30 USE usrdef_zgr ! user defined vertical coordinate system 31 USE depth_e3 ! depth <=> e3 42 32 ! 43 USE in_out_manager 44 USE iom 45 USE lbclnk 46 USE lib_mpp 47 USE wrk_nemo 48 USE timing 33 USE in_out_manager ! I/O manager 34 USE iom ! I/O library 35 USE lbclnk ! ocean lateral boundary conditions (or mpp link) 36 USE lib_mpp ! distributed memory computing library 37 USE wrk_nemo ! Memory allocation 38 USE timing ! Timing 49 39 50 40 IMPLICIT NONE … … 52 42 53 43 PUBLIC dom_zgr ! called by dom_init.F90 54 55 ! !!* Namelist namzgr_sco *56 LOGICAL :: ln_s_sh94 ! use hybrid s-sig Song and Haidvogel 1994 stretching function fssig1 (ln_sco=T)57 LOGICAL :: ln_s_sf12 ! use hybrid s-z-sig Siddorn and Furner 2012 stretching function fgamma (ln_sco=T)58 !59 REAL(wp) :: rn_sbot_min ! minimum depth of s-bottom surface (>0) (m)60 REAL(wp) :: rn_sbot_max ! maximum depth of s-bottom surface (= ocean depth) (>0) (m)61 REAL(wp) :: rn_rmax ! maximum cut-off r-value allowed (0<rn_rmax<1)62 REAL(wp) :: rn_hc ! Critical depth for transition from sigma to stretched coordinates63 ! Song and Haidvogel 1994 stretching parameters64 REAL(wp) :: rn_theta ! surface control parameter (0<=rn_theta<=20)65 REAL(wp) :: rn_thetb ! bottom control parameter (0<=rn_thetb<= 1)66 REAL(wp) :: rn_bb ! stretching parameter67 ! ! ( rn_bb=0; top only, rn_bb =1; top and bottom)68 ! Siddorn and Furner stretching parameters69 LOGICAL :: ln_sigcrit ! use sigma coordinates below critical depth (T) or Z coordinates (F) for Siddorn & Furner stretch70 REAL(wp) :: rn_alpha ! control parameter ( > 1 stretch towards surface, < 1 towards seabed)71 REAL(wp) :: rn_efold ! efold length scale for transition to stretched coord72 REAL(wp) :: rn_zs ! depth of surface grid box73 ! bottom cell depth (Zb) is a linear function of water depth Zb = H*a + b74 REAL(wp) :: rn_zb_a ! bathymetry scaling factor for calculating Zb75 REAL(wp) :: rn_zb_b ! offset for calculating Zb76 44 77 45 !! * Substitutions … … 84 52 CONTAINS 85 53 86 SUBROUTINE dom_zgr 54 SUBROUTINE dom_zgr( k_top, k_bot ) 87 55 !!---------------------------------------------------------------------- 88 56 !! *** ROUTINE dom_zgr *** … … 101 69 !! ** Action : define gdep., e3., mbathy and bathy 102 70 !!---------------------------------------------------------------------- 103 INTEGER :: ioptio, ibat ! local integer 104 INTEGER :: ios 105 ! 106 NAMELIST/namzgr/ ln_zco, ln_zps, ln_sco, ln_isfcav, ln_linssh 71 INTEGER, DIMENSION(:,:), INTENT(out) :: k_top, k_bot ! ocean first and last level indices 72 ! 73 INTEGER :: jk ! dummy loop index 74 INTEGER :: ioptio, ibat, ios ! local integer 75 REAL(wp) :: zrefdep ! depth of the reference level (~10m) 107 76 !!---------------------------------------------------------------------- 108 77 ! 109 78 IF( nn_timing == 1 ) CALL timing_start('dom_zgr') 110 79 ! 111 REWIND( numnam_ref ) ! Namelist namzgr in reference namelist : Vertical coordinate112 READ ( numnam_ref, namzgr, IOSTAT = ios, ERR = 901 )113 901 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namzgr in reference namelist', lwp )114 115 REWIND( numnam_cfg ) ! Namelist namzgr in configuration namelist : Vertical coordinate116 READ ( numnam_cfg, namzgr, IOSTAT = ios, ERR = 902 )117 902 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namzgr in configuration namelist', lwp )118 IF(lwm) WRITE ( numond, namzgr )119 120 80 IF(lwp) THEN ! Control print 121 81 WRITE(numout,*) 122 82 WRITE(numout,*) 'dom_zgr : vertical coordinate' 123 83 WRITE(numout,*) '~~~~~~~' 124 WRITE(numout,*) ' Namelist namzgr : set vertical coordinate' 84 ENDIF 85 86 IF( ln_linssh .AND. lwp) WRITE(numout,*) ' linear free surface: the vertical mesh does not change in time' 87 88 89 IF( ln_read_cfg ) THEN !== read in mesh_mask.nc file ==! 90 IF(lwp) WRITE(numout,*) 91 IF(lwp) WRITE(numout,*) ' Read vertical mesh in ', TRIM( cn_domcfg ), ' file' 92 ! 93 CALL zgr_read ( ln_zco , ln_zps , ln_sco, ln_isfcav, & 94 & gdept_1d, gdepw_1d, e3t_1d, e3w_1d , & ! 1D gridpoints depth 95 & gdept_0 , gdepw_0 , & ! gridpoints depth 96 & e3t_0 , e3u_0 , e3v_0 , e3f_0 , & ! vertical scale factors 97 & e3w_0 , e3uw_0 , e3vw_0 , & ! vertical scale factors 98 & k_top , k_bot ) ! 1st & last ocean level 99 ! 100 ELSE !== User defined configuration ==! 101 IF(lwp) WRITE(numout,*) 102 IF(lwp) WRITE(numout,*) ' User defined vertical mesh (usr_def_zgr)' 103 ! 104 CALL usr_def_zgr( ln_zco , ln_zps , ln_sco, ln_isfcav, & 105 & gdept_1d, gdepw_1d, e3t_1d, e3w_1d , & ! 1D gridpoints depth 106 & gdept_0 , gdepw_0 , & ! gridpoints depth 107 & e3t_0 , e3u_0 , e3v_0 , e3f_0 , & ! vertical scale factors 108 & e3w_0 , e3uw_0 , e3vw_0 , & ! vertical scale factors 109 & k_top , k_bot ) ! 1st & last ocean level 110 ! 111 ENDIF 112 ! 113 !!gm to be remove when removing the OLD definition of e3 scale factors so that gde3w disappears 114 ! Compute gde3w_0 (vertical sum of e3w) 115 gde3w_0(:,:,1) = 0.5_wp * e3w_0(:,:,1) 116 DO jk = 2, jpk 117 gde3w_0(:,:,jk) = gde3w_0(:,:,jk-1) + e3w_0(:,:,jk) 118 END DO 119 ! 120 IF(lwp) THEN ! Control print 121 WRITE(numout,*) 122 WRITE(numout,*) ' Type of vertical coordinate (read in ', TRIM( cn_domcfg ), ' file or set in userdef_nam) :' 125 123 WRITE(numout,*) ' z-coordinate - full steps ln_zco = ', ln_zco 126 124 WRITE(numout,*) ' z-coordinate - partial steps ln_zps = ', ln_zps 127 125 WRITE(numout,*) ' s- or hybrid z-s-coordinate ln_sco = ', ln_sco 128 126 WRITE(numout,*) ' ice shelf cavities ln_isfcav = ', ln_isfcav 129 WRITE(numout,*) ' linear free surface ln_linssh = ', ln_linssh 130 ENDIF 131 132 IF( ln_linssh .AND. lwp) WRITE(numout,*) ' linear free surface: the vertical mesh does not change in time' 127 ENDIF 133 128 134 129 ioptio = 0 ! Check Vertical coordinate options … … 137 132 IF( ln_sco ) ioptio = ioptio + 1 138 133 IF( ioptio /= 1 ) CALL ctl_stop( ' none or several vertical coordinate options used' ) 139 ! 140 ! Build the vertical coordinate system 141 ! ------------------------------------ 142 CALL zgr_z ! Reference z-coordinate system (always called) 143 CALL zgr_bat ! Bathymetry fields (levels and meters) 144 IF( lk_c1d ) CALL lbc_lnk( bathy , 'T', 1._wp ) ! 1D config.: same bathy value over the 3x3 domain 145 IF( ln_zco ) CALL zgr_zco ! z-coordinate 146 IF( ln_zps ) CALL zgr_zps ! Partial step z-coordinate 147 IF( ln_sco ) CALL zgr_sco ! s-coordinate or hybrid z-s coordinate 148 ! 149 ! final adjustment of mbathy & check 150 ! ----------------------------------- 151 IF( lzoom ) CALL zgr_bat_zoom ! correct mbathy in case of zoom subdomain 152 IF( .NOT.lk_c1d ) CALL zgr_bat_ctl ! check bathymetry (mbathy) and suppress isolated ocean points 153 CALL zgr_bot_level ! deepest ocean level for t-, u- and v-points 154 CALL zgr_top_level ! shallowest ocean level for T-, U-, V- points 155 ! 156 IF( lk_c1d ) THEN ! 1D config.: same mbathy value over the 3x3 domain 157 ibat = mbathy(2,2) 158 mbathy(:,:) = ibat 159 END IF 134 135 136 ! ! top/bottom ocean level indices for t-, u- and v-points (f-point also for top) 137 CALL zgr_top_bot( k_top, k_bot ) ! with a minimum value set to 1 138 139 140 ! ! deepest/shallowest W level Above/Below ~10m 141 !!gm BUG in s-coordinate this does not work! 142 zrefdep = 10._wp - 0.1_wp * MINVAL( e3w_1d ) ! ref. depth with tolerance (10% of minimum layer thickness) 143 nlb10 = MINLOC( gdepw_1d, mask = gdepw_1d > zrefdep, dim = 1 ) ! shallowest W level Below ~10m 144 nla10 = nlb10 - 1 ! deepest W level Above ~10m 145 !!gm end bug 146 ! 160 147 ! 161 148 IF( nprint == 1 .AND. lwp ) THEN 162 WRITE(numout,*) ' MIN val mbathy ', MINVAL( mbathy(:,:) ), ' MAX ', MAXVAL( mbathy(:,:) ) 149 WRITE(numout,*) ' MIN val k_top ', MINVAL( k_top(:,:) ), ' MAX ', MAXVAL( k_top(:,:) ) 150 WRITE(numout,*) ' MIN val k_bot ', MINVAL( k_bot(:,:) ), ' MAX ', MAXVAL( k_bot(:,:) ) 163 151 WRITE(numout,*) ' MIN val depth t ', MINVAL( gdept_0(:,:,:) ), & 164 152 & ' w ', MINVAL( gdepw_0(:,:,:) ), '3w ', MINVAL( gde3w_0(:,:,:) ) … … 181 169 182 170 183 SUBROUTINE zgr_z 184 !!---------------------------------------------------------------------- 185 !! *** ROUTINE zgr_z *** 186 !! 187 !! ** Purpose : set the depth of model levels and the resulting 188 !! vertical scale factors. 189 !! 190 !! ** Method : z-coordinate system (use in all type of coordinate) 191 !! The depth of model levels is defined from an analytical 192 !! function the derivative of which gives the scale factors. 193 !! both depth and scale factors only depend on k (1d arrays). 194 !! w-level: gdepw_1d = gdep(k) 195 !! e3w_1d(k) = dk(gdep)(k) = e3(k) 196 !! t-level: gdept_1d = gdep(k+0.5) 197 !! e3t_1d(k) = dk(gdep)(k+0.5) = e3(k+0.5) 198 !! 199 !! ** Action : - gdept_1d, gdepw_1d : depth of T- and W-point (m) 200 !! - e3t_1d , e3w_1d : scale factors at T- and W-levels (m) 201 !! 202 !! Reference : Marti, Madec & Delecluse, 1992, JGR, 97, No8, 12,763-12,766. 203 !!---------------------------------------------------------------------- 204 INTEGER :: jk ! dummy loop indices 205 REAL(wp) :: zt, zw ! temporary scalars 206 REAL(wp) :: zsur, za0, za1, zkth ! Values set from parameters in 207 REAL(wp) :: zacr, zdzmin, zhmax ! par_CONFIG_Rxx.h90 208 REAL(wp) :: zrefdep ! depth of the reference level (~10m) 209 REAL(wp) :: za2, zkth2, zacr2 ! Values for optional double tanh function set from parameters 210 !!---------------------------------------------------------------------- 211 ! 212 IF( nn_timing == 1 ) CALL timing_start('zgr_z') 213 ! 214 ! Set variables from parameters 215 ! ------------------------------ 216 zkth = ppkth ; zacr = ppacr 217 zdzmin = ppdzmin ; zhmax = pphmax 218 zkth2 = ppkth2 ; zacr2 = ppacr2 ! optional (ldbletanh=T) double tanh parameters 219 220 ! If ppa1 and ppa0 and ppsur are et to pp_to_be_computed 221 ! za0, za1, zsur are computed from ppdzmin , pphmax, ppkth, ppacr 222 IF( ppa1 == pp_to_be_computed .AND. & 223 & ppa0 == pp_to_be_computed .AND. & 224 & ppsur == pp_to_be_computed ) THEN 225 ! 226 #if defined key_agrif 227 za1 = ( ppdzmin - pphmax / FLOAT(jpkdta-1) ) & 228 & / ( TANH((1-ppkth)/ppacr) - ppacr/FLOAT(jpkdta-1) * ( LOG( COSH( (jpkdta - ppkth) / ppacr) )& 229 & - LOG( COSH( ( 1 - ppkth) / ppacr) ) ) ) 230 #else 231 za1 = ( ppdzmin - pphmax / FLOAT(jpkm1) ) & 232 & / ( TANH((1-ppkth)/ppacr) - ppacr/FLOAT(jpk-1) * ( LOG( COSH( (jpk - ppkth) / ppacr) ) & 233 & - LOG( COSH( ( 1 - ppkth) / ppacr) ) ) ) 234 #endif 235 za0 = ppdzmin - za1 * TANH( (1-ppkth) / ppacr ) 236 zsur = - za0 - za1 * ppacr * LOG( COSH( (1-ppkth) / ppacr ) ) 237 ELSE 238 za1 = ppa1 ; za0 = ppa0 ; zsur = ppsur 239 za2 = ppa2 ! optional (ldbletanh=T) double tanh parameter 240 ENDIF 241 242 IF(lwp) THEN ! Parameter print 171 SUBROUTINE zgr_read( ld_zco , ld_zps , ld_sco , ld_isfcav, & ! type of vertical coordinate 172 & pdept_1d, pdepw_1d, pe3t_1d , pe3w_1d , & ! 1D reference vertical coordinate 173 & pdept , pdepw , & ! 3D t & w-points depth 174 & pe3t , pe3u , pe3v , pe3f , & ! vertical scale factors 175 & pe3w , pe3uw , pe3vw , & ! - - - 176 & k_top , k_bot ) ! top & bottom ocean level 177 !!--------------------------------------------------------------------- 178 !! *** ROUTINE zgr_read *** 179 !! 180 !! ** Purpose : Read the vertical information in the domain configuration file 181 !! 182 !!---------------------------------------------------------------------- 183 LOGICAL , INTENT(out) :: ld_zco, ld_zps, ld_sco ! vertical coordinate flags 184 LOGICAL , INTENT(out) :: ld_isfcav ! under iceshelf cavity flag 185 REAL(wp), DIMENSION(:) , INTENT(out) :: pdept_1d, pdepw_1d ! 1D grid-point depth [m] 186 REAL(wp), DIMENSION(:) , INTENT(out) :: pe3t_1d , pe3w_1d ! 1D vertical scale factors [m] 187 REAL(wp), DIMENSION(:,:,:), INTENT(out) :: pdept, pdepw ! grid-point depth [m] 188 REAL(wp), DIMENSION(:,:,:), INTENT(out) :: pe3t , pe3u , pe3v , pe3f ! vertical scale factors [m] 189 REAL(wp), DIMENSION(:,:,:), INTENT(out) :: pe3w , pe3uw, pe3vw ! - - - 190 INTEGER , DIMENSION(:,:) , INTENT(out) :: k_top , k_bot ! first & last ocean level 191 ! 192 INTEGER :: jk ! dummy loop index 193 INTEGER :: inum ! local logical unit 194 REAL(WP) :: z_zco, z_zps, z_sco, z_cav 195 REAL(wp), DIMENSION(jpi,jpj) :: z2d ! 2D workspace 196 !!---------------------------------------------------------------------- 197 ! 198 IF(lwp) THEN 243 199 WRITE(numout,*) 244 WRITE(numout,*) ' zgr_z : Reference vertical z-coordinates' 245 WRITE(numout,*) ' ~~~~~~~' 246 IF( ppkth == 0._wp ) THEN 247 WRITE(numout,*) ' Uniform grid with ',jpk-1,' layers' 248 WRITE(numout,*) ' Total depth :', zhmax 249 #if defined key_agrif 250 WRITE(numout,*) ' Layer thickness:', zhmax/(jpkdta-1) 251 #else 252 WRITE(numout,*) ' Layer thickness:', zhmax/(jpk-1) 253 #endif 254 ELSE 255 IF( ppa1 == 0._wp .AND. ppa0 == 0._wp .AND. ppsur == 0._wp ) THEN 256 WRITE(numout,*) ' zsur, za0, za1 computed from ' 257 WRITE(numout,*) ' zdzmin = ', zdzmin 258 WRITE(numout,*) ' zhmax = ', zhmax 259 ENDIF 260 WRITE(numout,*) ' Value of coefficients for vertical mesh:' 261 WRITE(numout,*) ' zsur = ', zsur 262 WRITE(numout,*) ' za0 = ', za0 263 WRITE(numout,*) ' za1 = ', za1 264 WRITE(numout,*) ' zkth = ', zkth 265 WRITE(numout,*) ' zacr = ', zacr 266 IF( ldbletanh ) THEN 267 WRITE(numout,*) ' (Double tanh za2 = ', za2 268 WRITE(numout,*) ' parameters) zkth2= ', zkth2 269 WRITE(numout,*) ' zacr2= ', zacr2 270 ENDIF 200 WRITE(numout,*) ' zgr_read : read the vertical coordinates in ', TRIM( cn_domcfg ), ' file' 201 WRITE(numout,*) ' ~~~~~~~~' 202 ENDIF 203 ! 204 CALL iom_open( cn_domcfg, inum ) 205 ! 206 ! !* type of vertical coordinate 207 CALL iom_get( inum, 'ln_zco' , z_zco ) 208 CALL iom_get( inum, 'ln_zps' , z_zps ) 209 CALL iom_get( inum, 'ln_sco' , z_sco ) 210 IF( z_zco == 0._wp ) THEN ; ld_zco = .false. ; ELSE ; ld_zco = .true. ; ENDIF 211 IF( z_zps == 0._wp ) THEN ; ld_zps = .false. ; ELSE ; ld_zps = .true. ; ENDIF 212 IF( z_sco == 0._wp ) THEN ; ld_sco = .false. ; ELSE ; ld_sco = .true. ; ENDIF 213 ! 214 ! !* ocean cavities under iceshelves 215 CALL iom_get( inum, 'ln_isfcav', z_cav ) 216 IF( z_cav == 0._wp ) THEN ; ld_isfcav = .false. ; ELSE ; ld_isfcav = .true. ; ENDIF 217 ! 218 ! !* vertical scale factors 219 CALL iom_get( inum, jpdom_unknown, 'e3t_1d' , pe3t_1d ) ! 1D reference coordinate 220 CALL iom_get( inum, jpdom_unknown, 'e3w_1d' , pe3w_1d ) 221 ! 222 CALL iom_get( inum, jpdom_data, 'e3t_0' , pe3t , lrowattr=ln_use_jattr ) ! 3D coordinate 223 CALL iom_get( inum, jpdom_data, 'e3u_0' , pe3u , lrowattr=ln_use_jattr ) 224 CALL iom_get( inum, jpdom_data, 'e3v_0' , pe3v , lrowattr=ln_use_jattr ) 225 CALL iom_get( inum, jpdom_data, 'e3f_0' , pe3f , lrowattr=ln_use_jattr ) 226 CALL iom_get( inum, jpdom_data, 'e3w_0' , pe3w , lrowattr=ln_use_jattr ) 227 CALL iom_get( inum, jpdom_data, 'e3uw_0' , pe3uw , lrowattr=ln_use_jattr ) 228 CALL iom_get( inum, jpdom_data, 'e3vw_0' , pe3vw , lrowattr=ln_use_jattr ) 229 ! 230 ! !* depths 231 ! !- old depth definition (obsolescent feature) 232 IF( iom_varid( inum, 'gdept_1d', ldstop = .FALSE. ) > 0 .AND. & 233 & iom_varid( inum, 'gdepw_1d', ldstop = .FALSE. ) > 0 .AND. & 234 & iom_varid( inum, 'gdept_0' , ldstop = .FALSE. ) > 0 .AND. & 235 & iom_varid( inum, 'gdepw_0' , ldstop = .FALSE. ) > 0 ) THEN 236 CALL ctl_warn( 'zgr_read : old definition of depths and scale factors used ', & 237 & ' depths at t- and w-points read in the domain configuration file') 238 CALL iom_get( inum, jpdom_unknown, 'gdept_1d', pdept_1d ) 239 CALL iom_get( inum, jpdom_unknown, 'gdepw_1d', pdepw_1d ) 240 CALL iom_get( inum, jpdom_data , 'gdept_0' , pdept , lrowattr=ln_use_jattr ) 241 CALL iom_get( inum, jpdom_data , 'gdepw_0' , pdepw , lrowattr=ln_use_jattr ) 242 ! 243 ELSE !- depths computed from e3. scale factors 244 CALL e3_to_depth( pe3t_1d, pe3w_1d, pdept_1d, pdepw_1d ) ! 1D reference depth 245 CALL e3_to_depth( pe3t , pe3w , pdept , pdepw ) ! 3D depths 246 IF(lwp) THEN 247 WRITE(numout,*) 248 WRITE(numout,*) ' Reference 1D z-coordinate depth and scale factors:' 249 WRITE(numout, "(9x,' level gdept_1d gdepw_1d e3t_1d e3w_1d ')" ) 250 WRITE(numout, "(10x, i4, 4f9.2)" ) ( jk, pdept_1d(jk), pdepw_1d(jk), pe3t_1d(jk), pe3w_1d(jk), jk = 1, jpk ) 271 251 ENDIF 272 252 ENDIF 273 274 275 ! Reference z-coordinate (depth - scale factor at T- and W-points) 276 ! ====================== 277 IF( ppkth == 0._wp ) THEN ! uniform vertical grid 278 #if defined key_agrif 279 za1 = zhmax / FLOAT(jpkdta-1) 280 #else 281 za1 = zhmax / FLOAT(jpk-1) 282 #endif 283 DO jk = 1, jpk 284 zw = FLOAT( jk ) 285 zt = FLOAT( jk ) + 0.5_wp 286 gdepw_1d(jk) = ( zw - 1 ) * za1 287 gdept_1d(jk) = ( zt - 1 ) * za1 288 e3w_1d (jk) = za1 289 e3t_1d (jk) = za1 290 END DO 291 ELSE ! Madec & Imbard 1996 function 292 IF( .NOT. ldbletanh ) THEN 293 DO jk = 1, jpk 294 zw = REAL( jk , wp ) 295 zt = REAL( jk , wp ) + 0.5_wp 296 gdepw_1d(jk) = ( zsur + za0 * zw + za1 * zacr * LOG ( COSH( (zw-zkth) / zacr ) ) ) 297 gdept_1d(jk) = ( zsur + za0 * zt + za1 * zacr * LOG ( COSH( (zt-zkth) / zacr ) ) ) 298 e3w_1d (jk) = za0 + za1 * TANH( (zw-zkth) / zacr ) 299 e3t_1d (jk) = za0 + za1 * TANH( (zt-zkth) / zacr ) 300 END DO 301 ELSE 302 DO jk = 1, jpk 303 zw = FLOAT( jk ) 304 zt = FLOAT( jk ) + 0.5_wp 305 ! Double tanh function 306 gdepw_1d(jk) = ( zsur + za0 * zw + za1 * zacr * LOG ( COSH( (zw-zkth ) / zacr ) ) & 307 & + za2 * zacr2* LOG ( COSH( (zw-zkth2) / zacr2 ) ) ) 308 gdept_1d(jk) = ( zsur + za0 * zt + za1 * zacr * LOG ( COSH( (zt-zkth ) / zacr ) ) & 309 & + za2 * zacr2* LOG ( COSH( (zt-zkth2) / zacr2 ) ) ) 310 e3w_1d (jk) = za0 + za1 * TANH( (zw-zkth ) / zacr ) & 311 & + za2 * TANH( (zw-zkth2) / zacr2 ) 312 e3t_1d (jk) = za0 + za1 * TANH( (zt-zkth ) / zacr ) & 313 & + za2 * TANH( (zt-zkth2) / zacr2 ) 314 END DO 315 ENDIF 316 gdepw_1d(1) = 0._wp ! force first w-level to be exactly at zero 317 ENDIF 318 319 IF ( ln_isfcav ) THEN 320 ! need to be like this to compute the pressure gradient with ISF. If not, level beneath the ISF are not aligned (sum(e3t) /= depth) 321 ! define e3t_0 and e3w_0 as the differences between gdept and gdepw respectively 322 DO jk = 1, jpkm1 323 e3t_1d(jk) = gdepw_1d(jk+1)-gdepw_1d(jk) 324 END DO 325 e3t_1d(jpk) = e3t_1d(jpk-1) ! we don't care because this level is masked in NEMO 326 327 DO jk = 2, jpk 328 e3w_1d(jk) = gdept_1d(jk) - gdept_1d(jk-1) 329 END DO 330 e3w_1d(1 ) = 2._wp * (gdept_1d(1) - gdepw_1d(1)) 331 END IF 332 333 !!gm BUG in s-coordinate this does not work! 334 ! deepest/shallowest W level Above/Below ~10m 335 zrefdep = 10._wp - 0.1_wp * MINVAL( e3w_1d ) ! ref. depth with tolerance (10% of minimum layer thickness) 336 nlb10 = MINLOC( gdepw_1d, mask = gdepw_1d > zrefdep, dim = 1 ) ! shallowest W level Below ~10m 337 nla10 = nlb10 - 1 ! deepest W level Above ~10m 338 !!gm end bug 339 340 IF(lwp) THEN ! control print 341 WRITE(numout,*) 342 WRITE(numout,*) ' Reference z-coordinate depth and scale factors:' 343 WRITE(numout, "(9x,' level gdept_1d gdepw_1d e3t_1d e3w_1d ')" ) 344 WRITE(numout, "(10x, i4, 4f9.2)" ) ( jk, gdept_1d(jk), gdepw_1d(jk), e3t_1d(jk), e3w_1d(jk), jk = 1, jpk ) 345 ENDIF 346 DO jk = 1, jpk ! control positivity 347 IF( e3w_1d (jk) <= 0._wp .OR. e3t_1d (jk) <= 0._wp ) CALL ctl_stop( 'dom:zgr_z: e3w_1d or e3t_1d =< 0 ' ) 348 IF( gdepw_1d(jk) < 0._wp .OR. gdept_1d(jk) < 0._wp ) CALL ctl_stop( 'dom:zgr_z: gdepw_1d or gdept_1d < 0 ' ) 349 END DO 350 ! 351 IF( nn_timing == 1 ) CALL timing_stop('zgr_z') 352 ! 353 END SUBROUTINE zgr_z 354 355 356 SUBROUTINE zgr_bat 357 !!---------------------------------------------------------------------- 358 !! *** ROUTINE zgr_bat *** 359 !! 360 !! ** Purpose : set bathymetry both in levels and meters 361 !! 362 !! ** Method : read or define mbathy and bathy arrays 363 !! * level bathymetry: 364 !! The ocean basin geometry is given by a two-dimensional array, 365 !! mbathy, which is defined as follow : 366 !! mbathy(ji,jj) = 1, ..., jpk-1, the number of ocean level 367 !! at t-point (ji,jj). 368 !! = 0 over the continental t-point. 369 !! The array mbathy is checked to verified its consistency with 370 !! model option. in particular: 371 !! mbathy must have at least 1 land grid-points (mbathy<=0) 372 !! along closed boundary. 373 !! mbathy must be cyclic IF jperio=1. 374 !! mbathy must be lower or equal to jpk-1. 375 !! isolated ocean grid points are suppressed from mbathy 376 !! since they are only connected to remaining 377 !! ocean through vertical diffusion. 378 !! ntopo=-1 : rectangular channel or bassin with a bump 379 !! ntopo= 0 : flat rectangular channel or basin 380 !! ntopo= 1 : mbathy is read in 'bathy_level.nc' NetCDF file 381 !! bathy is read in 'bathy_meter.nc' NetCDF file 382 !! 383 !! ** Action : - mbathy: level bathymetry (in level index) 384 !! - bathy : meter bathymetry (in meters) 385 !!---------------------------------------------------------------------- 386 INTEGER :: ji, jj, jk ! dummy loop indices 387 INTEGER :: inum ! temporary logical unit 388 INTEGER :: ierror ! error flag 389 INTEGER :: ii_bump, ij_bump, ih ! bump center position 390 INTEGER :: ii0, ii1, ij0, ij1, ik ! local indices 391 REAL(wp) :: r_bump , h_bump , h_oce ! bump characteristics 392 REAL(wp) :: zi, zj, zh, zhmin ! local scalars 393 INTEGER , ALLOCATABLE, DIMENSION(:,:) :: idta ! global domain integer data 394 REAL(wp), ALLOCATABLE, DIMENSION(:,:) :: zdta ! global domain scalar data 395 !!---------------------------------------------------------------------- 396 ! 397 IF( nn_timing == 1 ) CALL timing_start('zgr_bat') 398 ! 399 IF(lwp) WRITE(numout,*) 400 IF(lwp) WRITE(numout,*) ' zgr_bat : defines level and meter bathymetry' 401 IF(lwp) WRITE(numout,*) ' ~~~~~~~' 402 ! ! ================== ! 403 IF( ntopo == 0 .OR. ntopo == -1 ) THEN ! defined by hand ! 404 ! ! ================== ! 405 ! ! global domain level and meter bathymetry (idta,zdta) 406 ! 407 ALLOCATE( idta(jpidta,jpjdta), STAT=ierror ) 408 IF( ierror > 0 ) CALL ctl_stop( 'STOP', 'zgr_bat: unable to allocate idta array' ) 409 ALLOCATE( zdta(jpidta,jpjdta), STAT=ierror ) 410 IF( ierror > 0 ) CALL ctl_stop( 'STOP', 'zgr_bat: unable to allocate zdta array' ) 411 ! 412 IF( ntopo == 0 ) THEN ! flat basin 413 IF(lwp) WRITE(numout,*) 414 IF(lwp) WRITE(numout,*) ' bathymetry field: flat basin' 415 IF( rn_bathy > 0.01 ) THEN 416 IF(lwp) WRITE(numout,*) ' Depth = rn_bathy read in namelist' 417 zdta(:,:) = rn_bathy 418 IF( ln_sco ) THEN ! s-coordinate (zsc ): idta()=jpk 419 idta(:,:) = jpkm1 420 ELSE ! z-coordinate (zco or zps): step-like topography 421 idta(:,:) = jpkm1 422 DO jk = 1, jpkm1 423 WHERE( gdept_1d(jk) < zdta(:,:) .AND. zdta(:,:) <= gdept_1d(jk+1) ) idta(:,:) = jk 424 END DO 425 ENDIF 426 ELSE 427 IF(lwp) WRITE(numout,*) ' Depth = depthw(jpkm1)' 428 idta(:,:) = jpkm1 ! before last level 429 zdta(:,:) = gdepw_1d(jpk) ! last w-point depth 430 h_oce = gdepw_1d(jpk) 431 ENDIF 432 ELSE ! bump centered in the basin 433 IF(lwp) WRITE(numout,*) 434 IF(lwp) WRITE(numout,*) ' bathymetry field: flat basin with a bump' 435 ii_bump = jpidta / 2 ! i-index of the bump center 436 ij_bump = jpjdta / 2 ! j-index of the bump center 437 r_bump = 50000._wp ! bump radius (meters) 438 h_bump = 2700._wp ! bump height (meters) 439 h_oce = gdepw_1d(jpk) ! background ocean depth (meters) 440 IF(lwp) WRITE(numout,*) ' bump characteristics: ' 441 IF(lwp) WRITE(numout,*) ' bump center (i,j) = ', ii_bump, ii_bump 442 IF(lwp) WRITE(numout,*) ' bump height = ', h_bump , ' meters' 443 IF(lwp) WRITE(numout,*) ' bump radius = ', r_bump , ' index' 444 IF(lwp) WRITE(numout,*) ' background ocean depth = ', h_oce , ' meters' 445 ! 446 DO jj = 1, jpjdta ! zdta : 447 DO ji = 1, jpidta 448 zi = FLOAT( ji - ii_bump ) * ppe1_m / r_bump 449 zj = FLOAT( jj - ij_bump ) * ppe2_m / r_bump 450 zdta(ji,jj) = h_oce - h_bump * EXP( -( zi*zi + zj*zj ) ) 451 END DO 452 END DO 453 ! ! idta : 454 IF( ln_sco ) THEN ! s-coordinate (zsc ): idta()=jpk 455 idta(:,:) = jpkm1 456 ELSE ! z-coordinate (zco or zps): step-like topography 457 idta(:,:) = jpkm1 458 DO jk = 1, jpkm1 459 WHERE( gdept_1d(jk) < zdta(:,:) .AND. zdta(:,:) <= gdept_1d(jk+1) ) idta(:,:) = jk 460 END DO 461 ENDIF 462 ENDIF 463 ! ! set GLOBAL boundary conditions 464 ! ! Caution : idta on the global domain: use of jperio, not nperio 465 IF( jperio == 1 .OR. jperio == 4 .OR. jperio == 6 ) THEN 466 idta( : , 1 ) = -1 ; zdta( : , 1 ) = -1._wp 467 idta( : ,jpjdta) = 0 ; zdta( : ,jpjdta) = 0._wp 468 ELSEIF( jperio == 2 ) THEN 469 idta( : , 1 ) = idta( : , 3 ) ; zdta( : , 1 ) = zdta( : , 3 ) 470 idta( : ,jpjdta) = 0 ; zdta( : ,jpjdta) = 0._wp 471 idta( 1 , : ) = 0 ; zdta( 1 , : ) = 0._wp 472 idta(jpidta, : ) = 0 ; zdta(jpidta, : ) = 0._wp 473 ELSE 474 ih = 0 ; zh = 0._wp 475 IF( ln_sco ) ih = jpkm1 ; IF( ln_sco ) zh = h_oce 476 idta( : , 1 ) = ih ; zdta( : , 1 ) = zh 477 idta( : ,jpjdta) = ih ; zdta( : ,jpjdta) = zh 478 idta( 1 , : ) = ih ; zdta( 1 , : ) = zh 479 idta(jpidta, : ) = ih ; zdta(jpidta, : ) = zh 480 ENDIF 481 482 ! ! local domain level and meter bathymetries (mbathy,bathy) 483 mbathy(:,:) = 0 ! set to zero extra halo points 484 bathy (:,:) = 0._wp ! (require for mpp case) 485 DO jj = 1, nlcj ! interior values 486 DO ji = 1, nlci 487 mbathy(ji,jj) = idta( mig(ji), mjg(jj) ) 488 bathy (ji,jj) = zdta( mig(ji), mjg(jj) ) 489 END DO 490 END DO 491 risfdep(:,:)=0.e0 492 misfdep(:,:)=1 493 ! 494 DEALLOCATE( idta, zdta ) 495 ! 496 ! ! ================ ! 497 ELSEIF( ntopo == 1 ) THEN ! read in file ! (over the local domain) 498 ! ! ================ ! 499 ! 500 IF( ln_zco ) THEN ! zco : read level bathymetry 501 CALL iom_open ( 'bathy_level.nc', inum ) 502 CALL iom_get ( inum, jpdom_data, 'Bathy_level', bathy ) 503 CALL iom_close( inum ) 504 mbathy(:,:) = INT( bathy(:,:) ) 505 ! ! ===================== 506 IF( cp_cfg == "orca" .AND. jp_cfg == 2 ) THEN ! ORCA R2 configuration 507 ! ! ===================== 508 ! 509 ii0 = 140 ; ii1 = 140 ! Gibraltar Strait open 510 ij0 = 102 ; ij1 = 102 ! (Thomson, Ocean Modelling, 1995) 511 DO ji = mi0(ii0), mi1(ii1) 512 DO jj = mj0(ij0), mj1(ij1) 513 mbathy(ji,jj) = 15 514 END DO 515 END DO 516 IF(lwp) WRITE(numout,*) 517 IF(lwp) WRITE(numout,*) ' orca_r2: Gibraltar strait open at i=',ii0,' j=',ij0 518 ! 519 ii0 = 160 ; ii1 = 160 ! Bab el mandeb Strait open 520 ij0 = 88 ; ij1 = 88 ! (Thomson, Ocean Modelling, 1995) 521 DO ji = mi0(ii0), mi1(ii1) 522 DO jj = mj0(ij0), mj1(ij1) 523 mbathy(ji,jj) = 12 524 END DO 525 END DO 526 IF(lwp) WRITE(numout,*) 527 IF(lwp) WRITE(numout,*) ' orca_r2: Bab el Mandeb strait open at i=',ii0,' j=',ij0 528 ! 529 ENDIF 530 ! 531 ENDIF 532 IF( ln_zps .OR. ln_sco ) THEN ! zps or sco : read meter bathymetry 533 CALL iom_open ( 'bathy_meter.nc', inum ) 534 IF ( ln_isfcav ) THEN 535 CALL iom_get ( inum, jpdom_data, 'Bathymetry_isf', bathy, lrowattr=.false. ) 536 ELSE 537 CALL iom_get ( inum, jpdom_data, 'Bathymetry' , bathy, lrowattr=ln_use_jattr ) 538 END IF 539 CALL iom_close( inum ) 540 ! 541 risfdep(:,:)=0._wp 542 misfdep(:,:)=1 543 IF ( ln_isfcav ) THEN 544 CALL iom_open ( 'isf_draft_meter.nc', inum ) 545 CALL iom_get ( inum, jpdom_data, 'isf_draft', risfdep ) 546 CALL iom_close( inum ) 547 WHERE( bathy(:,:) <= 0._wp ) risfdep(:,:) = 0._wp 548 549 ! set grounded point to 0 550 ! (a treshold could be set here if needed, or set it offline based on the grounded fraction) 551 WHERE ( bathy(:,:) <= risfdep(:,:) + rn_isfhmin ) 552 misfdep(:,:) = 0 ; risfdep(:,:) = 0._wp 553 mbathy (:,:) = 0 ; bathy (:,:) = 0._wp 554 END WHERE 555 END IF 556 ! 557 IF( cp_cfg == "orca" .AND. jp_cfg == 2 ) THEN ! ORCA R2 configuration 558 ! 559 ii0 = 140 ; ii1 = 140 ! Gibraltar Strait open 560 ij0 = 102 ; ij1 = 102 ! (Thomson, Ocean Modelling, 1995) 561 DO ji = mi0(ii0), mi1(ii1) 562 DO jj = mj0(ij0), mj1(ij1) 563 bathy(ji,jj) = 284._wp 564 END DO 565 END DO 566 IF(lwp) WRITE(numout,*) 567 IF(lwp) WRITE(numout,*) ' orca_r2: Gibraltar strait open at i=',ii0,' j=',ij0 568 ! 569 ii0 = 160 ; ii1 = 160 ! Bab el mandeb Strait open 570 ij0 = 88 ; ij1 = 88 ! (Thomson, Ocean Modelling, 1995) 571 DO ji = mi0(ii0), mi1(ii1) 572 DO jj = mj0(ij0), mj1(ij1) 573 bathy(ji,jj) = 137._wp 574 END DO 575 END DO 576 IF(lwp) WRITE(numout,*) 577 IF(lwp) WRITE(numout,*) ' orca_r2: Bab el Mandeb strait open at i=',ii0,' j=',ij0 578 ! 579 ENDIF 580 ! 581 ENDIF 582 ! ! =============== ! 583 ELSE ! error ! 584 ! ! =============== ! 585 WRITE(ctmp1,*) 'parameter , ntopo = ', ntopo 586 CALL ctl_stop( ' zgr_bat : '//trim(ctmp1) ) 587 ENDIF 588 ! 589 IF( nn_closea == 0 ) CALL clo_bat( bathy, mbathy ) !== NO closed seas or lakes ==! 590 ! 591 IF ( .not. ln_sco ) THEN !== set a minimum depth ==! 592 IF( rn_hmin < 0._wp ) THEN ; ik = - INT( rn_hmin ) ! from a nb of level 593 ELSE ; ik = MINLOC( gdepw_1d, mask = gdepw_1d > rn_hmin, dim = 1 ) ! from a depth 594 ENDIF 595 zhmin = gdepw_1d(ik+1) ! minimum depth = ik+1 w-levels 596 WHERE( bathy(:,:) <= 0._wp ) ; bathy(:,:) = 0._wp ! min=0 over the lands 597 ELSE WHERE ; bathy(:,:) = MAX( zhmin , bathy(:,:) ) ! min=zhmin over the oceans 598 END WHERE 599 IF(lwp) write(numout,*) 'Minimum ocean depth: ', zhmin, ' minimum number of ocean levels : ', ik 600 ENDIF 601 ! 602 IF( nn_timing == 1 ) CALL timing_stop('zgr_bat') 603 ! 604 END SUBROUTINE zgr_bat 605 606 607 SUBROUTINE zgr_bat_zoom 608 !!---------------------------------------------------------------------- 609 !! *** ROUTINE zgr_bat_zoom *** 610 !! 611 !! ** Purpose : - Close zoom domain boundary if necessary 612 !! - Suppress Med Sea from ORCA R2 and R05 arctic zoom 613 !! 614 !! ** Method : 615 !! 616 !! ** Action : - update mbathy: level bathymetry (in level index) 617 !!---------------------------------------------------------------------- 618 INTEGER :: ii0, ii1, ij0, ij1 ! temporary integers 619 !!---------------------------------------------------------------------- 620 ! 621 IF(lwp) WRITE(numout,*) 622 IF(lwp) WRITE(numout,*) ' zgr_bat_zoom : modify the level bathymetry for zoom domain' 623 IF(lwp) WRITE(numout,*) ' ~~~~~~~~~~~~' 624 ! 625 ! Zoom domain 626 ! =========== 627 ! 628 ! Forced closed boundary if required 629 IF( lzoom_s ) mbathy( : , mj0(jpjzoom):mj1(jpjzoom) ) = 0 630 IF( lzoom_w ) mbathy( mi0(jpizoom):mi1(jpizoom) , : ) = 0 631 IF( lzoom_e ) mbathy( mi0(jpiglo+jpizoom-1):mi1(jpiglo+jpizoom-1) , : ) = 0 632 IF( lzoom_n ) mbathy( : , mj0(jpjglo+jpjzoom-1):mj1(jpjglo+jpjzoom-1) ) = 0 633 ! 634 ! Configuration specific domain modifications 635 ! (here, ORCA arctic configuration: suppress Med Sea) 636 IF( cp_cfg == "orca" .AND. cp_cfz == "arctic" ) THEN 637 SELECT CASE ( jp_cfg ) 638 ! ! ======================= 639 CASE ( 2 ) ! ORCA_R2 configuration 640 ! ! ======================= 641 IF(lwp) WRITE(numout,*) ' ORCA R2 arctic zoom: suppress the Med Sea' 642 ii0 = 141 ; ii1 = 162 ! Sea box i,j indices 643 ij0 = 98 ; ij1 = 110 644 ! ! ======================= 645 CASE ( 05 ) ! ORCA_R05 configuration 646 ! ! ======================= 647 IF(lwp) WRITE(numout,*) ' ORCA R05 arctic zoom: suppress the Med Sea' 648 ii0 = 563 ; ii1 = 642 ! zero over the Med Sea boxe 649 ij0 = 314 ; ij1 = 370 650 END SELECT 651 ! 652 mbathy( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) ) = 0 ! zero over the Med Sea boxe 653 ! 654 ENDIF 655 ! 656 END SUBROUTINE zgr_bat_zoom 657 658 659 SUBROUTINE zgr_bat_ctl 660 !!---------------------------------------------------------------------- 661 !! *** ROUTINE zgr_bat_ctl *** 662 !! 663 !! ** Purpose : check the bathymetry in levels 664 !! 665 !! ** Method : The array mbathy is checked to verified its consistency 666 !! with the model options. in particular: 667 !! mbathy must have at least 1 land grid-points (mbathy<=0) 668 !! along closed boundary. 669 !! mbathy must be cyclic IF jperio=1. 670 !! mbathy must be lower or equal to jpk-1. 671 !! isolated ocean grid points are suppressed from mbathy 672 !! since they are only connected to remaining 673 !! ocean through vertical diffusion. 674 !! C A U T I O N : mbathy will be modified during the initializa- 675 !! tion phase to become the number of non-zero w-levels of a water 676 !! column, with a minimum value of 1. 677 !! 678 !! ** Action : - update mbathy: level bathymetry (in level index) 679 !! - update bathy : meter bathymetry (in meters) 680 !!---------------------------------------------------------------------- 681 INTEGER :: ji, jj, jl ! dummy loop indices 682 INTEGER :: icompt, ibtest, ikmax ! temporary integers 683 REAL(wp), POINTER, DIMENSION(:,:) :: zbathy 684 !!---------------------------------------------------------------------- 685 ! 686 IF( nn_timing == 1 ) CALL timing_start('zgr_bat_ctl') 687 ! 688 CALL wrk_alloc( jpi, jpj, zbathy ) 689 ! 690 IF(lwp) WRITE(numout,*) 691 IF(lwp) WRITE(numout,*) ' zgr_bat_ctl : check the bathymetry' 692 IF(lwp) WRITE(numout,*) ' ~~~~~~~~~~~' 693 ! ! Suppress isolated ocean grid points 694 IF(lwp) WRITE(numout,*) 695 IF(lwp) WRITE(numout,*)' suppress isolated ocean grid points' 696 IF(lwp) WRITE(numout,*)' -----------------------------------' 697 icompt = 0 698 DO jl = 1, 2 699 IF( nperio == 1 .OR. nperio == 4 .OR. nperio == 6 ) THEN 700 mbathy( 1 ,:) = mbathy(jpim1,:) ! local domain is cyclic east-west 701 mbathy(jpi,:) = mbathy( 2 ,:) 702 ENDIF 703 DO jj = 2, jpjm1 704 DO ji = 2, jpim1 705 ibtest = MAX( mbathy(ji-1,jj), mbathy(ji+1,jj), & 706 & mbathy(ji,jj-1), mbathy(ji,jj+1) ) 707 IF( ibtest < mbathy(ji,jj) ) THEN 708 IF(lwp) WRITE(numout,*) ' the number of ocean level at ', & 709 & 'grid-point (i,j) = ',ji,jj,' is changed from ', mbathy(ji,jj),' to ', ibtest 710 mbathy(ji,jj) = ibtest 711 icompt = icompt + 1 712 ENDIF 713 END DO 714 END DO 715 END DO 716 IF( lk_mpp ) CALL mpp_sum( icompt ) 717 IF( icompt == 0 ) THEN 718 IF(lwp) WRITE(numout,*)' no isolated ocean grid points' 719 ELSE 720 IF(lwp) WRITE(numout,*)' ',icompt,' ocean grid points suppressed' 721 ENDIF 722 IF( lk_mpp ) THEN 723 zbathy(:,:) = FLOAT( mbathy(:,:) ) 724 CALL lbc_lnk( zbathy, 'T', 1._wp ) 725 mbathy(:,:) = INT( zbathy(:,:) ) 726 ENDIF 727 ! ! East-west cyclic boundary conditions 728 IF( nperio == 0 ) THEN 729 IF(lwp) WRITE(numout,*) ' mbathy set to 0 along east and west boundary: nperio = ', nperio 730 IF( lk_mpp ) THEN 731 IF( nbondi == -1 .OR. nbondi == 2 ) THEN 732 IF( jperio /= 1 ) mbathy(1,:) = 0 733 ENDIF 734 IF( nbondi == 1 .OR. nbondi == 2 ) THEN 735 IF( jperio /= 1 ) mbathy(nlci,:) = 0 736 ENDIF 737 ELSE 738 IF( ln_zco .OR. ln_zps ) THEN 739 mbathy( 1 ,:) = 0 740 mbathy(jpi,:) = 0 741 ELSE 742 mbathy( 1 ,:) = jpkm1 743 mbathy(jpi,:) = jpkm1 744 ENDIF 745 ENDIF 746 ELSEIF( nperio == 1 .OR. nperio == 4 .OR. nperio == 6 ) THEN 747 IF(lwp) WRITE(numout,*)' east-west cyclic boundary conditions on mbathy: nperio = ', nperio 748 mbathy( 1 ,:) = mbathy(jpim1,:) 749 mbathy(jpi,:) = mbathy( 2 ,:) 750 ELSEIF( nperio == 2 ) THEN 751 IF(lwp) WRITE(numout,*) ' equatorial boundary conditions on mbathy: nperio = ', nperio 752 ELSE 753 IF(lwp) WRITE(numout,*) ' e r r o r' 754 IF(lwp) WRITE(numout,*) ' parameter , nperio = ', nperio 755 ! STOP 'dom_mba' 756 ENDIF 757 ! Boundary condition on mbathy 758 IF( .NOT.lk_mpp ) THEN 759 !!gm !!bug ??? think about it ! 760 ! ... mono- or macro-tasking: T-point, >0, 2D array, no slab 761 zbathy(:,:) = FLOAT( mbathy(:,:) ) 762 CALL lbc_lnk( zbathy, 'T', 1._wp ) 763 mbathy(:,:) = INT( zbathy(:,:) ) 764 ENDIF 765 ! Number of ocean level inferior or equal to jpkm1 766 ikmax = 0 767 DO jj = 1, jpj 768 DO ji = 1, jpi 769 ikmax = MAX( ikmax, mbathy(ji,jj) ) 770 END DO 771 END DO 772 !!gm !!! test to do: ikmax = MAX( mbathy(:,:) ) ??? 773 IF( ikmax > jpkm1 ) THEN 774 IF(lwp) WRITE(numout,*) ' maximum number of ocean level = ', ikmax,' > jpk-1' 775 IF(lwp) WRITE(numout,*) ' change jpk to ',ikmax+1,' to use the exact ead bathymetry' 776 ELSE IF( ikmax < jpkm1 ) THEN 777 IF(lwp) WRITE(numout,*) ' maximum number of ocean level = ', ikmax,' < jpk-1' 778 IF(lwp) WRITE(numout,*) ' you can decrease jpk to ', ikmax+1 779 ENDIF 780 ! 781 CALL wrk_dealloc( jpi, jpj, zbathy ) 782 ! 783 IF( nn_timing == 1 ) CALL timing_stop('zgr_bat_ctl') 784 ! 785 END SUBROUTINE zgr_bat_ctl 786 787 788 SUBROUTINE zgr_bot_level 789 !!---------------------------------------------------------------------- 790 !! *** ROUTINE zgr_bot_level *** 253 ! 254 ! !* ocean top and bottom level 255 CALL iom_get( inum, jpdom_data, 'top_level' , z2d , lrowattr=ln_use_jattr ) ! 1st wet T-points (ISF) 256 k_top(:,:) = INT( z2d(:,:) ) 257 CALL iom_get( inum, jpdom_data, 'bottom_level' , z2d , lrowattr=ln_use_jattr ) ! last wet T-points 258 k_bot(:,:) = INT( z2d(:,:) ) 259 ! 260 CALL iom_close( inum ) 261 ! 262 END SUBROUTINE zgr_read 263 264 265 SUBROUTINE zgr_top_bot( k_top, k_bot ) 266 !!---------------------------------------------------------------------- 267 !! *** ROUTINE zgr_top_bot *** 791 268 !! 792 269 !! ** Purpose : defines the vertical index of ocean bottom (mbk. arrays) 793 270 !! 794 !! ** Method : computes from mbathy with a minimum value of 1 over land 795 !! 271 !! ** Method : computes from k_top and k_bot with a minimum value of 1 over land 272 !! 273 !! ** Action : mikt, miku, mikv : vertical indices of the shallowest 274 !! ocean level at t-, u- & v-points 275 !! (min value = 1) 796 276 !! ** Action : mbkt, mbku, mbkv : vertical indices of the deeptest 797 277 !! ocean level at t-, u- & v-points 798 278 !! (min value = 1 over land) 799 279 !!---------------------------------------------------------------------- 280 INTEGER , DIMENSION(:,:), INTENT(in) :: k_top, k_bot ! top & bottom ocean level indices 281 ! 800 282 INTEGER :: ji, jj ! dummy loop indices 801 REAL(wp), POINTER, DIMENSION(:,:) :: z mbk283 REAL(wp), POINTER, DIMENSION(:,:) :: zk 802 284 !!---------------------------------------------------------------------- 803 285 ! 804 286 IF( nn_timing == 1 ) CALL timing_start('zgr_bot_level') 805 287 ! 806 CALL wrk_alloc( jpi, jpj, zmbk )288 CALL wrk_alloc( jpi,jpj, zk ) 807 289 ! 808 290 IF(lwp) WRITE(numout,*) 809 IF(lwp) WRITE(numout,*) ' zgr_bot_level : ocean bottom k-index of T-, U-, V- and W-levels ' 810 IF(lwp) WRITE(numout,*) ' ~~~~~~~~~~~~~' 811 ! 812 mbkt(:,:) = MAX( mbathy(:,:) , 1 ) ! bottom k-index of T-level (=1 over land) 291 IF(lwp) WRITE(numout,*) ' zgr_top_bot : ocean top and bottom k-index of T-, U-, V- and W-levels ' 292 IF(lwp) WRITE(numout,*) ' ~~~~~~~~~~~' 293 ! 294 mikt(:,:) = MAX( k_top(:,:) , 1 ) ! top ocean k-index of T-level (=1 over land) 295 ! 296 mbkt(:,:) = MAX( k_bot(:,:) , 1 ) ! bottom ocean k-index of T-level (=1 over land) 813 297 814 ! ! bottom k-index of W-level = mbkt+1 815 DO jj = 1, jpjm1 ! bottom k-index of u- (v-) level 298 ! ! N.B. top k-index of W-level = mikt 299 ! ! bottom k-index of W-level = mbkt+1 300 DO jj = 1, jpjm1 816 301 DO ji = 1, jpim1 302 miku(ji,jj) = MAX( mikt(ji+1,jj ) , mikt(ji,jj) ) 303 mikv(ji,jj) = MAX( mikt(ji ,jj+1) , mikt(ji,jj) ) 304 mikf(ji,jj) = MAX( mikt(ji ,jj+1) , mikt(ji,jj), mikt(ji+1,jj ), mikt(ji+1,jj+1) ) 305 ! 817 306 mbku(ji,jj) = MIN( mbkt(ji+1,jj ) , mbkt(ji,jj) ) 818 307 mbkv(ji,jj) = MIN( mbkt(ji ,jj+1) , mbkt(ji,jj) ) … … 820 309 END DO 821 310 ! converte into REAL to use lbc_lnk ; impose a min value of 1 as a zero can be set in lbclnk 822 zmbk(:,:) = REAL( mbku(:,:), wp ) ; CALL lbc_lnk(zmbk,'U',1.) ; mbku (:,:) = MAX( INT( zmbk(:,:) ), 1 ) 823 zmbk(:,:) = REAL( mbkv(:,:), wp ) ; CALL lbc_lnk(zmbk,'V',1.) ; mbkv (:,:) = MAX( INT( zmbk(:,:) ), 1 ) 824 ! 825 CALL wrk_dealloc( jpi, jpj, zmbk ) 826 ! 827 IF( nn_timing == 1 ) CALL timing_stop('zgr_bot_level') 828 ! 829 END SUBROUTINE zgr_bot_level 830 831 832 SUBROUTINE zgr_top_level 833 !!---------------------------------------------------------------------- 834 !! *** ROUTINE zgr_top_level *** 835 !! 836 !! ** Purpose : defines the vertical index of ocean top (mik. arrays) 837 !! 838 !! ** Method : computes from misfdep with a minimum value of 1 839 !! 840 !! ** Action : mikt, miku, mikv : vertical indices of the shallowest 841 !! ocean level at t-, u- & v-points 842 !! (min value = 1) 843 !!---------------------------------------------------------------------- 844 INTEGER :: ji, jj ! dummy loop indices 845 REAL(wp), POINTER, DIMENSION(:,:) :: zmik 846 !!---------------------------------------------------------------------- 847 ! 848 IF( nn_timing == 1 ) CALL timing_start('zgr_top_level') 849 ! 850 CALL wrk_alloc( jpi, jpj, zmik ) 851 ! 852 IF(lwp) WRITE(numout,*) 853 IF(lwp) WRITE(numout,*) ' zgr_top_level : ocean top k-index of T-, U-, V- and W-levels ' 854 IF(lwp) WRITE(numout,*) ' ~~~~~~~~~~~~~' 855 ! 856 mikt(:,:) = MAX( misfdep(:,:) , 1 ) ! top k-index of T-level (=1) 857 ! ! top k-index of W-level (=mikt) 858 DO jj = 1, jpjm1 ! top k-index of U- (U-) level 859 DO ji = 1, jpim1 860 miku(ji,jj) = MAX( mikt(ji+1,jj ) , mikt(ji,jj) ) 861 mikv(ji,jj) = MAX( mikt(ji ,jj+1) , mikt(ji,jj) ) 862 mikf(ji,jj) = MAX( mikt(ji ,jj+1) , mikt(ji,jj), mikt(ji+1,jj ), mikt(ji+1,jj+1) ) 863 END DO 864 END DO 865 866 ! converte into REAL to use lbc_lnk ; impose a min value of 1 as a zero can be set in lbclnk 867 zmik(:,:) = REAL( miku(:,:), wp ) ; CALL lbc_lnk(zmik,'U',1.) ; miku (:,:) = MAX( INT( zmik(:,:) ), 1 ) 868 zmik(:,:) = REAL( mikv(:,:), wp ) ; CALL lbc_lnk(zmik,'V',1.) ; mikv (:,:) = MAX( INT( zmik(:,:) ), 1 ) 869 zmik(:,:) = REAL( mikf(:,:), wp ) ; CALL lbc_lnk(zmik,'F',1.) ; mikf (:,:) = MAX( INT( zmik(:,:) ), 1 ) 870 ! 871 CALL wrk_dealloc( jpi, jpj, zmik ) 311 zk(:,:) = REAL( miku(:,:), wp ) ; CALL lbc_lnk( zk, 'U', 1. ) ; miku(:,:) = MAX( INT( zk(:,:) ), 1 ) 312 zk(:,:) = REAL( mikv(:,:), wp ) ; CALL lbc_lnk( zk, 'V', 1. ) ; mikv(:,:) = MAX( INT( zk(:,:) ), 1 ) 313 zk(:,:) = REAL( mikf(:,:), wp ) ; CALL lbc_lnk( zk, 'F', 1. ) ; mikf(:,:) = MAX( INT( zk(:,:) ), 1 ) 314 ! 315 zk(:,:) = REAL( mbku(:,:), wp ) ; CALL lbc_lnk( zk, 'U', 1. ) ; mbku(:,:) = MAX( INT( zk(:,:) ), 1 ) 316 zk(:,:) = REAL( mbkv(:,:), wp ) ; CALL lbc_lnk( zk, 'V', 1. ) ; mbkv(:,:) = MAX( INT( zk(:,:) ), 1 ) 317 ! 318 CALL wrk_dealloc( jpi,jpj, zk ) 872 319 ! 873 320 IF( nn_timing == 1 ) CALL timing_stop('zgr_top_level') 874 321 ! 875 END SUBROUTINE zgr_top_level 876 877 878 SUBROUTINE zgr_zco 879 !!---------------------------------------------------------------------- 880 !! *** ROUTINE zgr_zco *** 881 !! 882 !! ** Purpose : define the reference z-coordinate system 883 !! 884 !! ** Method : set 3D coord. arrays to reference 1D array 885 !!---------------------------------------------------------------------- 886 INTEGER :: jk 887 !!---------------------------------------------------------------------- 888 ! 889 IF( nn_timing == 1 ) CALL timing_start('zgr_zco') 890 ! 891 DO jk = 1, jpk 892 gdept_0(:,:,jk) = gdept_1d(jk) 893 gdepw_0(:,:,jk) = gdepw_1d(jk) 894 gde3w_0(:,:,jk) = gdepw_1d(jk) 895 e3t_0 (:,:,jk) = e3t_1d (jk) 896 e3u_0 (:,:,jk) = e3t_1d (jk) 897 e3v_0 (:,:,jk) = e3t_1d (jk) 898 e3f_0 (:,:,jk) = e3t_1d (jk) 899 e3w_0 (:,:,jk) = e3w_1d (jk) 900 e3uw_0 (:,:,jk) = e3w_1d (jk) 901 e3vw_0 (:,:,jk) = e3w_1d (jk) 902 END DO 903 ! 904 IF( nn_timing == 1 ) CALL timing_stop('zgr_zco') 905 ! 906 END SUBROUTINE zgr_zco 907 908 909 SUBROUTINE zgr_zps 910 !!---------------------------------------------------------------------- 911 !! *** ROUTINE zgr_zps *** 912 !! 913 !! ** Purpose : the depth and vertical scale factor in partial step 914 !! reference z-coordinate case 915 !! 916 !! ** Method : Partial steps : computes the 3D vertical scale factors 917 !! of T-, U-, V-, W-, UW-, VW and F-points that are associated with 918 !! a partial step representation of bottom topography. 919 !! 920 !! The reference depth of model levels is defined from an analytical 921 !! function the derivative of which gives the reference vertical 922 !! scale factors. 923 !! From depth and scale factors reference, we compute there new value 924 !! with partial steps on 3d arrays ( i, j, k ). 925 !! 926 !! w-level: gdepw_0(i,j,k) = gdep(k) 927 !! e3w_0(i,j,k) = dk(gdep)(k) = e3(i,j,k) 928 !! t-level: gdept_0(i,j,k) = gdep(k+0.5) 929 !! e3t_0(i,j,k) = dk(gdep)(k+0.5) = e3(i,j,k+0.5) 930 !! 931 !! With the help of the bathymetric file ( bathymetry_depth_ORCA_R2.nc), 932 !! we find the mbathy index of the depth at each grid point. 933 !! This leads us to three cases: 934 !! 935 !! - bathy = 0 => mbathy = 0 936 !! - 1 < mbathy < jpkm1 937 !! - bathy > gdepw_0(jpk) => mbathy = jpkm1 938 !! 939 !! Then, for each case, we find the new depth at t- and w- levels 940 !! and the new vertical scale factors at t-, u-, v-, w-, uw-, vw- 941 !! and f-points. 942 !! 943 !! This routine is given as an example, it must be modified 944 !! following the user s desiderata. nevertheless, the output as 945 !! well as the way to compute the model levels and scale factors 946 !! must be respected in order to insure second order accuracy 947 !! schemes. 948 !! 949 !! c a u t i o n : gdept_1d, gdepw_1d and e3._1d are positives 950 !! - - - - - - - gdept_0, gdepw_0 and e3. are positives 951 !! 952 !! Reference : Pacanowsky & Gnanadesikan 1997, Mon. Wea. Rev., 126, 3248-3270. 953 !!---------------------------------------------------------------------- 954 INTEGER :: ji, jj, jk ! dummy loop indices 955 INTEGER :: ik, it, ikb, ikt ! temporary integers 956 REAL(wp) :: ze3tp , ze3wp ! Last ocean level thickness at T- and W-points 957 REAL(wp) :: zdepwp, zdepth ! Ajusted ocean depth to avoid too small e3t 958 REAL(wp) :: zdiff ! temporary scalar 959 REAL(wp) :: zmax ! temporary scalar 960 REAL(wp), POINTER, DIMENSION(:,:,:) :: zprt 961 !!--------------------------------------------------------------------- 962 ! 963 IF( nn_timing == 1 ) CALL timing_start('zgr_zps') 964 ! 965 CALL wrk_alloc( jpi,jpj,jpk, zprt ) 966 ! 967 IF(lwp) WRITE(numout,*) 968 IF(lwp) WRITE(numout,*) ' zgr_zps : z-coordinate with partial steps' 969 IF(lwp) WRITE(numout,*) ' ~~~~~~~ ' 970 IF(lwp) WRITE(numout,*) ' mbathy is recomputed : bathy_level file is NOT used' 971 972 ! bathymetry in level (from bathy_meter) 973 ! =================== 974 zmax = gdepw_1d(jpk) + e3t_1d(jpk) ! maximum depth (i.e. the last ocean level thickness <= 2*e3t_1d(jpkm1) ) 975 bathy(:,:) = MIN( zmax , bathy(:,:) ) ! bounded value of bathy (min already set at the end of zgr_bat) 976 WHERE( bathy(:,:) == 0._wp ) ; mbathy(:,:) = 0 ! land : set mbathy to 0 977 ELSE WHERE ; mbathy(:,:) = jpkm1 ! ocean : initialize mbathy to the max ocean level 978 END WHERE 979 980 ! Compute mbathy for ocean points (i.e. the number of ocean levels) 981 ! find the number of ocean levels such that the last level thickness 982 ! is larger than the minimum of e3zps_min and e3zps_rat * e3t_1d (where 983 ! e3t_1d is the reference level thickness 984 DO jk = jpkm1, 1, -1 985 zdepth = gdepw_1d(jk) + MIN( e3zps_min, e3t_1d(jk)*e3zps_rat ) 986 WHERE( 0._wp < bathy(:,:) .AND. bathy(:,:) <= zdepth ) mbathy(:,:) = jk-1 987 END DO 988 989 ! Scale factors and depth at T- and W-points 990 DO jk = 1, jpk ! intitialization to the reference z-coordinate 991 gdept_0(:,:,jk) = gdept_1d(jk) 992 gdepw_0(:,:,jk) = gdepw_1d(jk) 993 e3t_0 (:,:,jk) = e3t_1d (jk) 994 e3w_0 (:,:,jk) = e3w_1d (jk) 995 END DO 996 997 ! Bathy, iceshelf draft, scale factor and depth at T- and W- points in case of isf 998 IF ( ln_isfcav ) CALL zgr_isf 999 1000 ! Scale factors and depth at T- and W-points 1001 IF ( .NOT. ln_isfcav ) THEN 1002 DO jj = 1, jpj 1003 DO ji = 1, jpi 1004 ik = mbathy(ji,jj) 1005 IF( ik > 0 ) THEN ! ocean point only 1006 ! max ocean level case 1007 IF( ik == jpkm1 ) THEN 1008 zdepwp = bathy(ji,jj) 1009 ze3tp = bathy(ji,jj) - gdepw_1d(ik) 1010 ze3wp = 0.5_wp * e3w_1d(ik) * ( 1._wp + ( ze3tp/e3t_1d(ik) ) ) 1011 e3t_0(ji,jj,ik ) = ze3tp 1012 e3t_0(ji,jj,ik+1) = ze3tp 1013 e3w_0(ji,jj,ik ) = ze3wp 1014 e3w_0(ji,jj,ik+1) = ze3tp 1015 gdepw_0(ji,jj,ik+1) = zdepwp 1016 gdept_0(ji,jj,ik ) = gdept_1d(ik-1) + ze3wp 1017 gdept_0(ji,jj,ik+1) = gdept_0(ji,jj,ik) + ze3tp 1018 ! 1019 ELSE ! standard case 1020 IF( bathy(ji,jj) <= gdepw_1d(ik+1) ) THEN ; gdepw_0(ji,jj,ik+1) = bathy(ji,jj) 1021 ELSE ; gdepw_0(ji,jj,ik+1) = gdepw_1d(ik+1) 1022 ENDIF 1023 !gm Bug? check the gdepw_1d 1024 ! ... on ik 1025 gdept_0(ji,jj,ik) = gdepw_1d(ik) + ( gdepw_0(ji,jj,ik+1) - gdepw_1d(ik) ) & 1026 & * ((gdept_1d( ik ) - gdepw_1d(ik) ) & 1027 & / ( gdepw_1d( ik+1) - gdepw_1d(ik) )) 1028 e3t_0 (ji,jj,ik) = e3t_1d (ik) * ( gdepw_0 (ji,jj,ik+1) - gdepw_1d(ik) ) & 1029 & / ( gdepw_1d( ik+1) - gdepw_1d(ik) ) 1030 e3w_0(ji,jj,ik) = 0.5_wp * ( gdepw_0(ji,jj,ik+1) + gdepw_1d(ik+1) - 2._wp * gdepw_1d(ik) ) & 1031 & * ( e3w_1d(ik) / ( gdepw_1d(ik+1) - gdepw_1d(ik) ) ) 1032 ! ... on ik+1 1033 e3w_0 (ji,jj,ik+1) = e3t_0 (ji,jj,ik) 1034 e3t_0 (ji,jj,ik+1) = e3t_0 (ji,jj,ik) 1035 gdept_0(ji,jj,ik+1) = gdept_0(ji,jj,ik) + e3t_0(ji,jj,ik) 1036 ENDIF 1037 ENDIF 1038 END DO 1039 END DO 1040 ! 1041 it = 0 1042 DO jj = 1, jpj 1043 DO ji = 1, jpi 1044 ik = mbathy(ji,jj) 1045 IF( ik > 0 ) THEN ! ocean point only 1046 e3tp (ji,jj) = e3t_0(ji,jj,ik) 1047 e3wp (ji,jj) = e3w_0(ji,jj,ik) 1048 ! test 1049 zdiff= gdepw_0(ji,jj,ik+1) - gdept_0(ji,jj,ik ) 1050 IF( zdiff <= 0._wp .AND. lwp ) THEN 1051 it = it + 1 1052 WRITE(numout,*) ' it = ', it, ' ik = ', ik, ' (i,j) = ', ji, jj 1053 WRITE(numout,*) ' bathy = ', bathy(ji,jj) 1054 WRITE(numout,*) ' gdept_0 = ', gdept_0(ji,jj,ik), ' gdepw_0 = ', gdepw_0(ji,jj,ik+1), ' zdiff = ', zdiff 1055 WRITE(numout,*) ' e3tp = ', e3t_0 (ji,jj,ik), ' e3wp = ', e3w_0 (ji,jj,ik ) 1056 ENDIF 1057 ENDIF 1058 END DO 1059 END DO 1060 END IF 1061 ! 1062 ! Scale factors and depth at U-, V-, UW and VW-points 1063 DO jk = 1, jpk ! initialisation to z-scale factors 1064 e3u_0 (:,:,jk) = e3t_1d(jk) 1065 e3v_0 (:,:,jk) = e3t_1d(jk) 1066 e3uw_0(:,:,jk) = e3w_1d(jk) 1067 e3vw_0(:,:,jk) = e3w_1d(jk) 1068 END DO 1069 1070 DO jk = 1,jpk ! Computed as the minimum of neighbooring scale factors 1071 DO jj = 1, jpjm1 1072 DO ji = 1, fs_jpim1 ! vector opt. 1073 e3u_0 (ji,jj,jk) = MIN( e3t_0(ji,jj,jk), e3t_0(ji+1,jj,jk) ) 1074 e3v_0 (ji,jj,jk) = MIN( e3t_0(ji,jj,jk), e3t_0(ji,jj+1,jk) ) 1075 e3uw_0(ji,jj,jk) = MIN( e3w_0(ji,jj,jk), e3w_0(ji+1,jj,jk) ) 1076 e3vw_0(ji,jj,jk) = MIN( e3w_0(ji,jj,jk), e3w_0(ji,jj+1,jk) ) 1077 END DO 1078 END DO 1079 END DO 1080 IF ( ln_isfcav ) THEN 1081 ! (ISF) define e3uw (adapted for 2 cells in the water column) 1082 DO jj = 2, jpjm1 1083 DO ji = 2, fs_jpim1 ! vector opt. 1084 ikb = MAX(mbathy (ji,jj),mbathy (ji+1,jj)) 1085 ikt = MAX(misfdep(ji,jj),misfdep(ji+1,jj)) 1086 IF (ikb == ikt+1) e3uw_0(ji,jj,ikb) = MIN( gdept_0(ji,jj,ikb ), gdept_0(ji+1,jj ,ikb ) ) & 1087 & - MAX( gdept_0(ji,jj,ikb-1), gdept_0(ji+1,jj ,ikb-1) ) 1088 ikb = MAX(mbathy (ji,jj),mbathy (ji,jj+1)) 1089 ikt = MAX(misfdep(ji,jj),misfdep(ji,jj+1)) 1090 IF (ikb == ikt+1) e3vw_0(ji,jj,ikb) = MIN( gdept_0(ji,jj,ikb ), gdept_0(ji ,jj+1,ikb ) ) & 1091 & - MAX( gdept_0(ji,jj,ikb-1), gdept_0(ji ,jj+1,ikb-1) ) 1092 END DO 1093 END DO 1094 END IF 1095 1096 CALL lbc_lnk( e3u_0 , 'U', 1._wp ) ; CALL lbc_lnk( e3uw_0, 'U', 1._wp ) ! lateral boundary conditions 1097 CALL lbc_lnk( e3v_0 , 'V', 1._wp ) ; CALL lbc_lnk( e3vw_0, 'V', 1._wp ) 1098 ! 1099 1100 DO jk = 1, jpk ! set to z-scale factor if zero (i.e. along closed boundaries) 1101 WHERE( e3u_0 (:,:,jk) == 0._wp ) e3u_0 (:,:,jk) = e3t_1d(jk) 1102 WHERE( e3v_0 (:,:,jk) == 0._wp ) e3v_0 (:,:,jk) = e3t_1d(jk) 1103 WHERE( e3uw_0(:,:,jk) == 0._wp ) e3uw_0(:,:,jk) = e3w_1d(jk) 1104 WHERE( e3vw_0(:,:,jk) == 0._wp ) e3vw_0(:,:,jk) = e3w_1d(jk) 1105 END DO 1106 1107 ! Scale factor at F-point 1108 DO jk = 1, jpk ! initialisation to z-scale factors 1109 e3f_0(:,:,jk) = e3t_1d(jk) 1110 END DO 1111 DO jk = 1, jpk ! Computed as the minimum of neighbooring V-scale factors 1112 DO jj = 1, jpjm1 1113 DO ji = 1, fs_jpim1 ! vector opt. 1114 e3f_0(ji,jj,jk) = MIN( e3v_0(ji,jj,jk), e3v_0(ji+1,jj,jk) ) 1115 END DO 1116 END DO 1117 END DO 1118 CALL lbc_lnk( e3f_0, 'F', 1._wp ) ! Lateral boundary conditions 1119 ! 1120 DO jk = 1, jpk ! set to z-scale factor if zero (i.e. along closed boundaries) 1121 WHERE( e3f_0(:,:,jk) == 0._wp ) e3f_0(:,:,jk) = e3t_1d(jk) 1122 END DO 1123 !!gm bug ? : must be a do loop with mj0,mj1 1124 ! 1125 e3t_0(:,mj0(1),:) = e3t_0(:,mj0(2),:) ! we duplicate factor scales for jj = 1 and jj = 2 1126 e3w_0(:,mj0(1),:) = e3w_0(:,mj0(2),:) 1127 e3u_0(:,mj0(1),:) = e3u_0(:,mj0(2),:) 1128 e3v_0(:,mj0(1),:) = e3v_0(:,mj0(2),:) 1129 e3f_0(:,mj0(1),:) = e3f_0(:,mj0(2),:) 1130 1131 ! Control of the sign 1132 IF( MINVAL( e3t_0 (:,:,:) ) <= 0._wp ) CALL ctl_stop( ' zgr_zps : e r r o r e3t_0 <= 0' ) 1133 IF( MINVAL( e3w_0 (:,:,:) ) <= 0._wp ) CALL ctl_stop( ' zgr_zps : e r r o r e3w_0 <= 0' ) 1134 IF( MINVAL( gdept_0(:,:,:) ) < 0._wp ) CALL ctl_stop( ' zgr_zps : e r r o r gdept_0 < 0' ) 1135 IF( MINVAL( gdepw_0(:,:,:) ) < 0._wp ) CALL ctl_stop( ' zgr_zps : e r r o r gdepw_0 < 0' ) 1136 1137 ! Compute gde3w_0 (vertical sum of e3w) 1138 IF ( ln_isfcav ) THEN ! if cavity 1139 WHERE( misfdep == 0 ) misfdep = 1 1140 DO jj = 1,jpj 1141 DO ji = 1,jpi 1142 gde3w_0(ji,jj,1) = 0.5_wp * e3w_0(ji,jj,1) 1143 DO jk = 2, misfdep(ji,jj) 1144 gde3w_0(ji,jj,jk) = gde3w_0(ji,jj,jk-1) + e3w_0(ji,jj,jk) 1145 END DO 1146 IF( misfdep(ji,jj) >= 2 ) gde3w_0(ji,jj,misfdep(ji,jj)) = risfdep(ji,jj) + 0.5_wp * e3w_0(ji,jj,misfdep(ji,jj)) 1147 DO jk = misfdep(ji,jj) + 1, jpk 1148 gde3w_0(ji,jj,jk) = gde3w_0(ji,jj,jk-1) + e3w_0(ji,jj,jk) 1149 END DO 1150 END DO 1151 END DO 1152 ELSE ! no cavity 1153 gde3w_0(:,:,1) = 0.5_wp * e3w_0(:,:,1) 1154 DO jk = 2, jpk 1155 gde3w_0(:,:,jk) = gde3w_0(:,:,jk-1) + e3w_0(:,:,jk) 1156 END DO 1157 END IF 1158 ! 1159 CALL wrk_dealloc( jpi,jpj,jpk, zprt ) 1160 ! 1161 IF( nn_timing == 1 ) CALL timing_stop('zgr_zps') 1162 ! 1163 END SUBROUTINE zgr_zps 1164 1165 1166 SUBROUTINE zgr_isf 1167 !!---------------------------------------------------------------------- 1168 !! *** ROUTINE zgr_isf *** 1169 !! 1170 !! ** Purpose : check the bathymetry in levels 1171 !! 1172 !! ** Method : THe water column have to contained at least 2 cells 1173 !! Bathymetry and isfdraft are modified (dig/close) to respect 1174 !! this criterion. 1175 !! 1176 !! ** Action : - test compatibility between isfdraft and bathy 1177 !! - bathy and isfdraft are modified 1178 !!---------------------------------------------------------------------- 1179 INTEGER :: ji, jj, jl, jk ! dummy loop indices 1180 INTEGER :: ik, it ! temporary integers 1181 INTEGER :: icompt, ibtest ! (ISF) 1182 INTEGER :: ibtestim1, ibtestip1 ! (ISF) 1183 INTEGER :: ibtestjm1, ibtestjp1 ! (ISF) 1184 REAL(wp) :: zdepth ! Ajusted ocean depth to avoid too small e3t 1185 REAL(wp) :: zmax ! Maximum and minimum depth 1186 REAL(wp) :: zbathydiff ! isf temporary scalar 1187 REAL(wp) :: zrisfdepdiff ! isf temporary scalar 1188 REAL(wp) :: ze3tp , ze3wp ! Last ocean level thickness at T- and W-points 1189 REAL(wp) :: zdepwp ! Ajusted ocean depth to avoid too small e3t 1190 REAL(wp) :: zdiff ! temporary scalar 1191 REAL(wp), POINTER, DIMENSION(:,:) :: zrisfdep, zbathy, zmask ! 2D workspace (ISH) 1192 INTEGER , POINTER, DIMENSION(:,:) :: zmbathy, zmisfdep ! 2D workspace (ISH) 1193 !!--------------------------------------------------------------------- 1194 ! 1195 IF( nn_timing == 1 ) CALL timing_start('zgr_isf') 1196 ! 1197 CALL wrk_alloc( jpi,jpj, zbathy, zmask, zrisfdep) 1198 CALL wrk_alloc( jpi,jpj, zmisfdep, zmbathy ) 1199 1200 ! (ISF) compute misfdep 1201 WHERE( risfdep(:,:) == 0._wp .AND. bathy(:,:) /= 0 ) ; misfdep(:,:) = 1 ! open water : set misfdep to 1 1202 ELSEWHERE ; misfdep(:,:) = 2 ! iceshelf : initialize misfdep to second level 1203 END WHERE 1204 1205 ! Compute misfdep for ocean points (i.e. first wet level) 1206 ! find the first ocean level such that the first level thickness 1207 ! is larger than the bot_level of e3zps_min and e3zps_rat * e3t_0 (where 1208 ! e3t_0 is the reference level thickness 1209 DO jk = 2, jpkm1 1210 zdepth = gdepw_1d(jk+1) - MIN( e3zps_min, e3t_1d(jk)*e3zps_rat ) 1211 WHERE( 0._wp < risfdep(:,:) .AND. risfdep(:,:) >= zdepth ) misfdep(:,:) = jk+1 1212 END DO 1213 WHERE ( 0._wp < risfdep(:,:) .AND. risfdep(:,:) <= e3t_1d(1) ) 1214 risfdep(:,:) = 0. ; misfdep(:,:) = 1 1215 END WHERE 1216 1217 ! remove very shallow ice shelf (less than ~ 10m if 75L) 1218 WHERE (risfdep(:,:) <= 10._wp .AND. misfdep(:,:) > 1) 1219 misfdep = 0; risfdep = 0.0_wp; 1220 mbathy = 0; bathy = 0.0_wp; 1221 END WHERE 1222 WHERE (bathy(:,:) <= 30.0_wp .AND. gphit < -60._wp) 1223 misfdep = 0; risfdep = 0.0_wp; 1224 mbathy = 0; bathy = 0.0_wp; 1225 END WHERE 1226 1227 ! basic check for the compatibility of bathy and risfdep. I think it should be offline because it is not perfect and cannot solved all the situation 1228 icompt = 0 1229 ! run the bathy check 10 times to be sure all the modif in the bathy or iceshelf draft are compatible together 1230 DO jl = 1, 10 1231 ! check at each iteration if isf is grounded or not (1cm treshold have to be update after first coupling experiments) 1232 WHERE (bathy(:,:) <= risfdep(:,:) + rn_isfhmin) 1233 misfdep(:,:) = 0 ; risfdep(:,:) = 0._wp 1234 mbathy (:,:) = 0 ; bathy (:,:) = 0._wp 1235 END WHERE 1236 WHERE (mbathy(:,:) <= 0) 1237 misfdep(:,:) = 0; risfdep(:,:) = 0._wp 1238 mbathy (:,:) = 0; bathy (:,:) = 0._wp 1239 END WHERE 1240 IF( lk_mpp ) THEN 1241 zbathy(:,:) = FLOAT( misfdep(:,:) ) 1242 CALL lbc_lnk( zbathy, 'T', 1. ) 1243 misfdep(:,:) = INT( zbathy(:,:) ) 1244 1245 CALL lbc_lnk( risfdep,'T', 1. ) 1246 CALL lbc_lnk( bathy, 'T', 1. ) 1247 1248 zbathy(:,:) = FLOAT( mbathy(:,:) ) 1249 CALL lbc_lnk( zbathy, 'T', 1. ) 1250 mbathy(:,:) = INT( zbathy(:,:) ) 1251 ENDIF 1252 IF( nperio == 1 .OR. nperio == 4 .OR. nperio == 6 ) THEN 1253 misfdep( 1 ,:) = misfdep(jpim1,:) ! local domain is cyclic east-west 1254 misfdep(jpi,:) = misfdep( 2 ,:) 1255 mbathy( 1 ,:) = mbathy(jpim1,:) ! local domain is cyclic east-west 1256 mbathy(jpi,:) = mbathy( 2 ,:) 1257 ENDIF 1258 1259 ! split last cell if possible (only where water column is 2 cell or less) 1260 ! if coupled to ice sheet, we do not modify the bathymetry (can be discuss). 1261 IF ( .NOT. ln_iscpl) THEN 1262 DO jk = jpkm1, 1, -1 1263 zmax = gdepw_1d(jk) + MIN( e3zps_min, e3t_1d(jk)*e3zps_rat ) 1264 WHERE( gdepw_1d(jk) < bathy(:,:) .AND. bathy(:,:) <= zmax .AND. misfdep + 1 >= mbathy) 1265 mbathy(:,:) = jk 1266 bathy(:,:) = zmax 1267 END WHERE 1268 END DO 1269 END IF 1270 1271 ! split top cell if possible (only where water column is 2 cell or less) 1272 DO jk = 2, jpkm1 1273 zmax = gdepw_1d(jk+1) - MIN( e3zps_min, e3t_1d(jk)*e3zps_rat ) 1274 WHERE( gdepw_1d(jk+1) > risfdep(:,:) .AND. risfdep(:,:) >= zmax .AND. misfdep + 1 >= mbathy) 1275 misfdep(:,:) = jk 1276 risfdep(:,:) = zmax 1277 END WHERE 1278 END DO 1279 1280 1281 ! Case where bathy and risfdep compatible but not the level variable mbathy/misfdep because of partial cell condition 1282 DO jj = 1, jpj 1283 DO ji = 1, jpi 1284 ! find the minimum change option: 1285 ! test bathy 1286 IF (risfdep(ji,jj) > 1) THEN 1287 IF ( .NOT. ln_iscpl ) THEN 1288 zbathydiff =ABS(bathy(ji,jj) - (gdepw_1d(mbathy (ji,jj)+1) & 1289 & + MIN( e3zps_min, e3t_1d(mbathy (ji,jj)+1)*e3zps_rat ))) 1290 zrisfdepdiff=ABS(risfdep(ji,jj) - (gdepw_1d(misfdep(ji,jj) ) & 1291 & - MIN( e3zps_min, e3t_1d(misfdep(ji,jj)-1)*e3zps_rat ))) 1292 IF (bathy(ji,jj) > risfdep(ji,jj) .AND. mbathy(ji,jj) < misfdep(ji,jj)) THEN 1293 IF (zbathydiff <= zrisfdepdiff) THEN 1294 bathy(ji,jj) = gdepw_1d(mbathy(ji,jj)) + MIN( e3zps_min, e3t_1d(mbathy(ji,jj)+1)*e3zps_rat ) 1295 mbathy(ji,jj)= mbathy(ji,jj) + 1 1296 ELSE 1297 risfdep(ji,jj) = gdepw_1d(misfdep(ji,jj)) - MIN( e3zps_min, e3t_1d(misfdep(ji,jj)-1)*e3zps_rat ) 1298 misfdep(ji,jj) = misfdep(ji,jj) - 1 1299 END IF 1300 ENDIF 1301 ELSE 1302 IF (bathy(ji,jj) > risfdep(ji,jj) .AND. mbathy(ji,jj) < misfdep(ji,jj)) THEN 1303 risfdep(ji,jj) = gdepw_1d(misfdep(ji,jj)) - MIN( e3zps_min, e3t_1d(misfdep(ji,jj)-1)*e3zps_rat ) 1304 misfdep(ji,jj) = misfdep(ji,jj) - 1 1305 END IF 1306 END IF 1307 END IF 1308 END DO 1309 END DO 1310 1311 ! At least 2 levels for water thickness at T, U, and V point. 1312 DO jj = 1, jpj 1313 DO ji = 1, jpi 1314 ! find the minimum change option: 1315 ! test bathy 1316 IF( misfdep(ji,jj) == mbathy(ji,jj) .AND. mbathy(ji,jj) > 1) THEN 1317 IF ( .NOT. ln_iscpl ) THEN 1318 zbathydiff =ABS(bathy(ji,jj) - ( gdepw_1d(mbathy (ji,jj)+1) & 1319 & + MIN( e3zps_min,e3t_1d(mbathy (ji,jj)+1)*e3zps_rat ))) 1320 zrisfdepdiff=ABS(risfdep(ji,jj) - ( gdepw_1d(misfdep(ji,jj) ) & 1321 & - MIN( e3zps_min,e3t_1d(misfdep(ji,jj)-1)*e3zps_rat ))) 1322 IF (zbathydiff <= zrisfdepdiff) THEN 1323 mbathy(ji,jj) = mbathy(ji,jj) + 1 1324 bathy(ji,jj) = gdepw_1d(mbathy (ji,jj)) + MIN( e3zps_min, e3t_1d(mbathy(ji,jj) +1)*e3zps_rat ) 1325 ELSE 1326 misfdep(ji,jj)= misfdep(ji,jj) - 1 1327 risfdep(ji,jj) = gdepw_1d(misfdep(ji,jj)+1) - MIN( e3zps_min, e3t_1d(misfdep(ji,jj))*e3zps_rat ) 1328 END IF 1329 ELSE 1330 misfdep(ji,jj)= misfdep(ji,jj) - 1 1331 risfdep(ji,jj)= gdepw_1d(misfdep(ji,jj)+1) - MIN( e3zps_min, e3t_1d(misfdep(ji,jj))*e3zps_rat ) 1332 END IF 1333 ENDIF 1334 END DO 1335 END DO 1336 1337 ! point V mbathy(ji,jj) == misfdep(ji,jj+1) 1338 DO jj = 1, jpjm1 1339 DO ji = 1, jpim1 1340 IF( misfdep(ji,jj+1) == mbathy(ji,jj) .AND. mbathy(ji,jj) > 1) THEN 1341 IF ( .NOT. ln_iscpl ) THEN 1342 zbathydiff =ABS(bathy(ji,jj ) - ( gdepw_1d(mbathy (ji,jj)+1) & 1343 & + MIN( e3zps_min, e3t_1d(mbathy (ji,jj )+1)*e3zps_rat ))) 1344 zrisfdepdiff=ABS(risfdep(ji,jj+1) - ( gdepw_1d(misfdep(ji,jj+1)) & 1345 & - MIN( e3zps_min, e3t_1d(misfdep(ji,jj+1)-1)*e3zps_rat ))) 1346 IF (zbathydiff <= zrisfdepdiff) THEN 1347 mbathy(ji,jj) = mbathy(ji,jj) + 1 1348 bathy(ji,jj) = gdepw_1d(mbathy (ji,jj )) + MIN( e3zps_min, e3t_1d(mbathy(ji,jj )+1)*e3zps_rat ) 1349 ELSE 1350 misfdep(ji,jj+1) = misfdep(ji,jj+1) - 1 1351 risfdep (ji,jj+1) = gdepw_1d(misfdep(ji,jj+1)+1) - MIN( e3zps_min, e3t_1d(misfdep(ji,jj+1))*e3zps_rat ) 1352 END IF 1353 ELSE 1354 misfdep(ji,jj+1) = misfdep(ji,jj+1) - 1 1355 risfdep (ji,jj+1) = gdepw_1d(misfdep(ji,jj+1)+1) - MIN( e3zps_min, e3t_1d(misfdep(ji,jj+1))*e3zps_rat ) 1356 END IF 1357 ENDIF 1358 END DO 1359 END DO 1360 1361 IF( lk_mpp ) THEN 1362 zbathy(:,:) = FLOAT( misfdep(:,:) ) 1363 CALL lbc_lnk( zbathy, 'T', 1. ) 1364 misfdep(:,:) = INT( zbathy(:,:) ) 1365 1366 CALL lbc_lnk( risfdep,'T', 1. ) 1367 CALL lbc_lnk( bathy, 'T', 1. ) 1368 1369 zbathy(:,:) = FLOAT( mbathy(:,:) ) 1370 CALL lbc_lnk( zbathy, 'T', 1. ) 1371 mbathy(:,:) = INT( zbathy(:,:) ) 1372 ENDIF 1373 ! point V misdep(ji,jj) == mbathy(ji,jj+1) 1374 DO jj = 1, jpjm1 1375 DO ji = 1, jpim1 1376 IF( misfdep(ji,jj) == mbathy(ji,jj+1) .AND. mbathy(ji,jj) > 1) THEN 1377 IF ( .NOT. ln_iscpl ) THEN 1378 zbathydiff =ABS( bathy(ji,jj+1) - ( gdepw_1d(mbathy (ji,jj+1)+1) & 1379 & + MIN( e3zps_min, e3t_1d(mbathy (ji,jj+1)+1)*e3zps_rat ))) 1380 zrisfdepdiff=ABS(risfdep(ji,jj ) - ( gdepw_1d(misfdep(ji,jj ) ) & 1381 & - MIN( e3zps_min, e3t_1d(misfdep(ji,jj )-1)*e3zps_rat ))) 1382 IF (zbathydiff <= zrisfdepdiff) THEN 1383 mbathy (ji,jj+1) = mbathy(ji,jj+1) + 1 1384 bathy (ji,jj+1) = gdepw_1d(mbathy (ji,jj+1) ) + MIN( e3zps_min, e3t_1d(mbathy (ji,jj+1)+1)*e3zps_rat ) 1385 ELSE 1386 misfdep(ji,jj) = misfdep(ji,jj) - 1 1387 risfdep(ji,jj) = gdepw_1d(misfdep(ji,jj )+1) - MIN( e3zps_min, e3t_1d(misfdep(ji,jj ) )*e3zps_rat ) 1388 END IF 1389 ELSE 1390 misfdep(ji,jj) = misfdep(ji,jj) - 1 1391 risfdep(ji,jj) = gdepw_1d(misfdep(ji,jj )+1) - MIN( e3zps_min, e3t_1d(misfdep(ji,jj ) )*e3zps_rat ) 1392 END IF 1393 ENDIF 1394 END DO 1395 END DO 1396 1397 1398 IF( lk_mpp ) THEN 1399 zbathy(:,:) = FLOAT( misfdep(:,:) ) 1400 CALL lbc_lnk( zbathy, 'T', 1. ) 1401 misfdep(:,:) = INT( zbathy(:,:) ) 1402 1403 CALL lbc_lnk( risfdep,'T', 1. ) 1404 CALL lbc_lnk( bathy, 'T', 1. ) 1405 1406 zbathy(:,:) = FLOAT( mbathy(:,:) ) 1407 CALL lbc_lnk( zbathy, 'T', 1. ) 1408 mbathy(:,:) = INT( zbathy(:,:) ) 1409 ENDIF 1410 1411 ! point U mbathy(ji,jj) == misfdep(ji,jj+1) 1412 DO jj = 1, jpjm1 1413 DO ji = 1, jpim1 1414 IF( misfdep(ji+1,jj) == mbathy(ji,jj) .AND. mbathy(ji,jj) > 1) THEN 1415 IF ( .NOT. ln_iscpl ) THEN 1416 zbathydiff =ABS( bathy(ji ,jj) - ( gdepw_1d(mbathy (ji,jj)+1) & 1417 & + MIN( e3zps_min, e3t_1d(mbathy (ji ,jj)+1)*e3zps_rat ))) 1418 zrisfdepdiff=ABS(risfdep(ji+1,jj) - ( gdepw_1d(misfdep(ji+1,jj)) & 1419 & - MIN( e3zps_min, e3t_1d(misfdep(ji+1,jj)-1)*e3zps_rat ))) 1420 IF (zbathydiff <= zrisfdepdiff) THEN 1421 mbathy(ji,jj) = mbathy(ji,jj) + 1 1422 bathy(ji,jj) = gdepw_1d(mbathy (ji,jj)) + MIN( e3zps_min, e3t_1d(mbathy(ji,jj) +1)*e3zps_rat ) 1423 ELSE 1424 misfdep(ji+1,jj)= misfdep(ji+1,jj) - 1 1425 risfdep(ji+1,jj) = gdepw_1d(misfdep(ji+1,jj)+1) - MIN( e3zps_min, e3t_1d(misfdep(ji+1,jj))*e3zps_rat ) 1426 END IF 1427 ELSE 1428 misfdep(ji+1,jj)= misfdep(ji+1,jj) - 1 1429 risfdep(ji+1,jj) = gdepw_1d(misfdep(ji+1,jj)+1) - MIN( e3zps_min, e3t_1d(misfdep(ji+1,jj))*e3zps_rat ) 1430 ENDIF 1431 ENDIF 1432 ENDDO 1433 ENDDO 1434 1435 IF( lk_mpp ) THEN 1436 zbathy(:,:) = FLOAT( misfdep(:,:) ) 1437 CALL lbc_lnk( zbathy, 'T', 1. ) 1438 misfdep(:,:) = INT( zbathy(:,:) ) 1439 1440 CALL lbc_lnk( risfdep,'T', 1. ) 1441 CALL lbc_lnk( bathy, 'T', 1. ) 1442 1443 zbathy(:,:) = FLOAT( mbathy(:,:) ) 1444 CALL lbc_lnk( zbathy, 'T', 1. ) 1445 mbathy(:,:) = INT( zbathy(:,:) ) 1446 ENDIF 1447 1448 ! point U misfdep(ji,jj) == bathy(ji,jj+1) 1449 DO jj = 1, jpjm1 1450 DO ji = 1, jpim1 1451 IF( misfdep(ji,jj) == mbathy(ji+1,jj) .AND. mbathy(ji,jj) > 1) THEN 1452 IF ( .NOT. ln_iscpl ) THEN 1453 zbathydiff =ABS( bathy(ji+1,jj) - ( gdepw_1d(mbathy (ji+1,jj)+1) & 1454 & + MIN( e3zps_min, e3t_1d(mbathy (ji+1,jj)+1)*e3zps_rat ))) 1455 zrisfdepdiff=ABS(risfdep(ji ,jj) - ( gdepw_1d(misfdep(ji ,jj) ) & 1456 & - MIN( e3zps_min, e3t_1d(misfdep(ji ,jj)-1)*e3zps_rat ))) 1457 IF (zbathydiff <= zrisfdepdiff) THEN 1458 mbathy(ji+1,jj) = mbathy (ji+1,jj) + 1 1459 bathy (ji+1,jj) = gdepw_1d(mbathy (ji+1,jj) ) + MIN( e3zps_min, e3t_1d(mbathy (ji+1,jj) +1)*e3zps_rat ) 1460 ELSE 1461 misfdep(ji,jj) = misfdep(ji ,jj) - 1 1462 risfdep(ji,jj) = gdepw_1d(misfdep(ji ,jj)+1) - MIN( e3zps_min, e3t_1d(misfdep(ji ,jj) )*e3zps_rat ) 1463 END IF 1464 ELSE 1465 misfdep(ji,jj) = misfdep(ji ,jj) - 1 1466 risfdep(ji,jj) = gdepw_1d(misfdep(ji ,jj)+1) - MIN( e3zps_min, e3t_1d(misfdep(ji ,jj) )*e3zps_rat ) 1467 ENDIF 1468 ENDIF 1469 ENDDO 1470 ENDDO 1471 1472 IF( lk_mpp ) THEN 1473 zbathy(:,:) = FLOAT( misfdep(:,:) ) 1474 CALL lbc_lnk( zbathy, 'T', 1. ) 1475 misfdep(:,:) = INT( zbathy(:,:) ) 1476 1477 CALL lbc_lnk( risfdep,'T', 1. ) 1478 CALL lbc_lnk( bathy, 'T', 1. ) 1479 1480 zbathy(:,:) = FLOAT( mbathy(:,:) ) 1481 CALL lbc_lnk( zbathy, 'T', 1. ) 1482 mbathy(:,:) = INT( zbathy(:,:) ) 1483 ENDIF 1484 END DO 1485 ! end dig bathy/ice shelf to be compatible 1486 ! now fill single point in "coastline" of ice shelf, bathy, hole, and test again one cell tickness 1487 DO jl = 1,20 1488 1489 ! remove single point "bay" on isf coast line in the ice shelf draft' 1490 DO jk = 2, jpk 1491 WHERE (misfdep==0) misfdep=jpk 1492 zmask=0._wp 1493 WHERE (misfdep <= jk) zmask=1 1494 DO jj = 2, jpjm1 1495 DO ji = 2, jpim1 1496 IF (misfdep(ji,jj) == jk) THEN 1497 ibtest = zmask(ji-1,jj) + zmask(ji+1,jj) + zmask(ji,jj-1) + zmask(ji,jj+1) 1498 IF (ibtest <= 1) THEN 1499 risfdep(ji,jj)=gdepw_1d(jk+1) ; misfdep(ji,jj)=jk+1 1500 IF (misfdep(ji,jj) > mbathy(ji,jj)) misfdep(ji,jj) = jpk 1501 END IF 1502 END IF 1503 END DO 1504 END DO 1505 END DO 1506 WHERE (misfdep==jpk) 1507 misfdep=0 ; risfdep=0._wp ; mbathy=0 ; bathy=0._wp 1508 END WHERE 1509 IF( lk_mpp ) THEN 1510 zbathy(:,:) = FLOAT( misfdep(:,:) ) 1511 CALL lbc_lnk( zbathy, 'T', 1. ) 1512 misfdep(:,:) = INT( zbathy(:,:) ) 1513 1514 CALL lbc_lnk( risfdep,'T', 1. ) 1515 CALL lbc_lnk( bathy, 'T', 1. ) 1516 1517 zbathy(:,:) = FLOAT( mbathy(:,:) ) 1518 CALL lbc_lnk( zbathy, 'T', 1. ) 1519 mbathy(:,:) = INT( zbathy(:,:) ) 1520 ENDIF 1521 1522 ! remove single point "bay" on bathy coast line beneath an ice shelf' 1523 DO jk = jpk,1,-1 1524 zmask=0._wp 1525 WHERE (mbathy >= jk ) zmask=1 1526 DO jj = 2, jpjm1 1527 DO ji = 2, jpim1 1528 IF (mbathy(ji,jj) == jk .AND. misfdep(ji,jj) >= 2) THEN 1529 ibtest = zmask(ji-1,jj) + zmask(ji+1,jj) + zmask(ji,jj-1) + zmask(ji,jj+1) 1530 IF (ibtest <= 1) THEN 1531 bathy(ji,jj)=gdepw_1d(jk) ; mbathy(ji,jj)=jk-1 1532 IF (misfdep(ji,jj) > mbathy(ji,jj)) mbathy(ji,jj) = 0 1533 END IF 1534 END IF 1535 END DO 1536 END DO 1537 END DO 1538 WHERE (mbathy==0) 1539 misfdep=0 ; risfdep=0._wp ; mbathy=0 ; bathy=0._wp 1540 END WHERE 1541 IF( lk_mpp ) THEN 1542 zbathy(:,:) = FLOAT( misfdep(:,:) ) 1543 CALL lbc_lnk( zbathy, 'T', 1. ) 1544 misfdep(:,:) = INT( zbathy(:,:) ) 1545 1546 CALL lbc_lnk( risfdep,'T', 1. ) 1547 CALL lbc_lnk( bathy, 'T', 1. ) 1548 1549 zbathy(:,:) = FLOAT( mbathy(:,:) ) 1550 CALL lbc_lnk( zbathy, 'T', 1. ) 1551 mbathy(:,:) = INT( zbathy(:,:) ) 1552 ENDIF 1553 1554 ! fill hole in ice shelf 1555 zmisfdep = misfdep 1556 zrisfdep = risfdep 1557 WHERE (zmisfdep <= 1._wp) zmisfdep=jpk 1558 DO jj = 2, jpjm1 1559 DO ji = 2, jpim1 1560 ibtestim1 = zmisfdep(ji-1,jj ) ; ibtestip1 = zmisfdep(ji+1,jj ) 1561 ibtestjm1 = zmisfdep(ji ,jj-1) ; ibtestjp1 = zmisfdep(ji ,jj+1) 1562 IF( zmisfdep(ji,jj) >= mbathy(ji-1,jj ) ) ibtestim1 = jpk 1563 IF( zmisfdep(ji,jj) >= mbathy(ji+1,jj ) ) ibtestip1 = jpk 1564 IF( zmisfdep(ji,jj) >= mbathy(ji ,jj-1) ) ibtestjm1 = jpk 1565 IF( zmisfdep(ji,jj) >= mbathy(ji ,jj+1) ) ibtestjp1 = jpk 1566 ibtest=MIN(ibtestim1, ibtestip1, ibtestjm1, ibtestjp1) 1567 IF( ibtest == jpk .AND. misfdep(ji,jj) >= 2) THEN 1568 mbathy(ji,jj) = 0 ; bathy(ji,jj) = 0.0_wp ; misfdep(ji,jj) = 0 ; risfdep(ji,jj) = 0.0_wp 1569 END IF 1570 IF( zmisfdep(ji,jj) < ibtest .AND. misfdep(ji,jj) >= 2) THEN 1571 misfdep(ji,jj) = ibtest 1572 risfdep(ji,jj) = gdepw_1d(ibtest) 1573 ENDIF 1574 ENDDO 1575 ENDDO 1576 1577 IF( lk_mpp ) THEN 1578 zbathy(:,:) = FLOAT( misfdep(:,:) ) 1579 CALL lbc_lnk( zbathy, 'T', 1. ) 1580 misfdep(:,:) = INT( zbathy(:,:) ) 1581 1582 CALL lbc_lnk( risfdep, 'T', 1. ) 1583 CALL lbc_lnk( bathy, 'T', 1. ) 1584 1585 zbathy(:,:) = FLOAT( mbathy(:,:) ) 1586 CALL lbc_lnk( zbathy, 'T', 1. ) 1587 mbathy(:,:) = INT( zbathy(:,:) ) 1588 ENDIF 1589 ! 1590 !! fill hole in bathymetry 1591 zmbathy (:,:)=mbathy (:,:) 1592 DO jj = 2, jpjm1 1593 DO ji = 2, jpim1 1594 ibtestim1 = zmbathy(ji-1,jj ) ; ibtestip1 = zmbathy(ji+1,jj ) 1595 ibtestjm1 = zmbathy(ji ,jj-1) ; ibtestjp1 = zmbathy(ji ,jj+1) 1596 IF( zmbathy(ji,jj) < misfdep(ji-1,jj ) ) ibtestim1 = 0 1597 IF( zmbathy(ji,jj) < misfdep(ji+1,jj ) ) ibtestip1 = 0 1598 IF( zmbathy(ji,jj) < misfdep(ji ,jj-1) ) ibtestjm1 = 0 1599 IF( zmbathy(ji,jj) < misfdep(ji ,jj+1) ) ibtestjp1 = 0 1600 ibtest=MAX(ibtestim1, ibtestip1, ibtestjm1, ibtestjp1) 1601 IF( ibtest == 0 .AND. misfdep(ji,jj) >= 2) THEN 1602 mbathy(ji,jj) = 0 ; bathy(ji,jj) = 0.0_wp ; misfdep(ji,jj) = 0 ; risfdep(ji,jj) = 0.0_wp ; 1603 END IF 1604 IF( ibtest < zmbathy(ji,jj) .AND. misfdep(ji,jj) >= 2) THEN 1605 mbathy(ji,jj) = ibtest 1606 bathy(ji,jj) = gdepw_1d(ibtest+1) 1607 ENDIF 1608 END DO 1609 END DO 1610 IF( lk_mpp ) THEN 1611 zbathy(:,:) = FLOAT( misfdep(:,:) ) 1612 CALL lbc_lnk( zbathy, 'T', 1. ) 1613 misfdep(:,:) = INT( zbathy(:,:) ) 1614 1615 CALL lbc_lnk( risfdep, 'T', 1. ) 1616 CALL lbc_lnk( bathy, 'T', 1. ) 1617 1618 zbathy(:,:) = FLOAT( mbathy(:,:) ) 1619 CALL lbc_lnk( zbathy, 'T', 1. ) 1620 mbathy(:,:) = INT( zbathy(:,:) ) 1621 ENDIF 1622 ! if not compatible after all check (ie U point water column less than 2 cells), mask U 1623 DO jj = 1, jpjm1 1624 DO ji = 1, jpim1 1625 IF (mbathy(ji,jj) == misfdep(ji+1,jj) .AND. mbathy(ji,jj) >= 1 .AND. mbathy(ji+1,jj) >= 1) THEN 1626 mbathy(ji,jj) = mbathy(ji,jj) - 1 ; bathy(ji,jj) = gdepw_1d(mbathy(ji,jj)+1) ; 1627 END IF 1628 END DO 1629 END DO 1630 IF( lk_mpp ) THEN 1631 zbathy(:,:) = FLOAT( misfdep(:,:) ) 1632 CALL lbc_lnk( zbathy, 'T', 1. ) 1633 misfdep(:,:) = INT( zbathy(:,:) ) 1634 1635 CALL lbc_lnk( risfdep, 'T', 1. ) 1636 CALL lbc_lnk( bathy, 'T', 1. ) 1637 1638 zbathy(:,:) = FLOAT( mbathy(:,:) ) 1639 CALL lbc_lnk( zbathy, 'T', 1. ) 1640 mbathy(:,:) = INT( zbathy(:,:) ) 1641 ENDIF 1642 ! if not compatible after all check (ie U point water column less than 2 cells), mask U 1643 DO jj = 1, jpjm1 1644 DO ji = 1, jpim1 1645 IF (misfdep(ji,jj) == mbathy(ji+1,jj) .AND. mbathy(ji,jj) >= 1 .AND. mbathy(ji+1,jj) >= 1) THEN 1646 mbathy(ji+1,jj) = mbathy(ji+1,jj) - 1; bathy(ji+1,jj) = gdepw_1d(mbathy(ji+1,jj)+1) ; 1647 END IF 1648 END DO 1649 END DO 1650 IF( lk_mpp ) THEN 1651 zbathy(:,:) = FLOAT( misfdep(:,:) ) 1652 CALL lbc_lnk( zbathy, 'T', 1. ) 1653 misfdep(:,:) = INT( zbathy(:,:) ) 1654 1655 CALL lbc_lnk( risfdep,'T', 1. ) 1656 CALL lbc_lnk( bathy, 'T', 1. ) 1657 1658 zbathy(:,:) = FLOAT( mbathy(:,:) ) 1659 CALL lbc_lnk( zbathy, 'T', 1. ) 1660 mbathy(:,:) = INT( zbathy(:,:) ) 1661 ENDIF 1662 ! if not compatible after all check (ie V point water column less than 2 cells), mask V 1663 DO jj = 1, jpjm1 1664 DO ji = 1, jpi 1665 IF (mbathy(ji,jj) == misfdep(ji,jj+1) .AND. mbathy(ji,jj) >= 1 .AND. mbathy(ji,jj+1) >= 1) THEN 1666 mbathy(ji,jj) = mbathy(ji,jj) - 1 ; bathy(ji,jj) = gdepw_1d(mbathy(ji,jj)+1) ; 1667 END IF 1668 END DO 1669 END DO 1670 IF( lk_mpp ) THEN 1671 zbathy(:,:) = FLOAT( misfdep(:,:) ) 1672 CALL lbc_lnk( zbathy, 'T', 1. ) 1673 misfdep(:,:) = INT( zbathy(:,:) ) 1674 1675 CALL lbc_lnk( risfdep,'T', 1. ) 1676 CALL lbc_lnk( bathy, 'T', 1. ) 1677 1678 zbathy(:,:) = FLOAT( mbathy(:,:) ) 1679 CALL lbc_lnk( zbathy, 'T', 1. ) 1680 mbathy(:,:) = INT( zbathy(:,:) ) 1681 ENDIF 1682 ! if not compatible after all check (ie V point water column less than 2 cells), mask V 1683 DO jj = 1, jpjm1 1684 DO ji = 1, jpi 1685 IF (misfdep(ji,jj) == mbathy(ji,jj+1) .AND. mbathy(ji,jj) >= 1 .AND. mbathy(ji,jj+1) >= 1) THEN 1686 mbathy(ji,jj+1) = mbathy(ji,jj+1) - 1 ; bathy(ji,jj+1) = gdepw_1d(mbathy(ji,jj+1)+1) ; 1687 END IF 1688 END DO 1689 END DO 1690 IF( lk_mpp ) THEN 1691 zbathy(:,:) = FLOAT( misfdep(:,:) ) 1692 CALL lbc_lnk( zbathy, 'T', 1. ) 1693 misfdep(:,:) = INT( zbathy(:,:) ) 1694 1695 CALL lbc_lnk( risfdep,'T', 1. ) 1696 CALL lbc_lnk( bathy, 'T', 1. ) 1697 1698 zbathy(:,:) = FLOAT( mbathy(:,:) ) 1699 CALL lbc_lnk( zbathy, 'T', 1. ) 1700 mbathy(:,:) = INT( zbathy(:,:) ) 1701 ENDIF 1702 ! if not compatible after all check, mask T 1703 DO jj = 1, jpj 1704 DO ji = 1, jpi 1705 IF (mbathy(ji,jj) <= misfdep(ji,jj)) THEN 1706 misfdep(ji,jj) = 0 ; risfdep(ji,jj) = 0._wp ; mbathy(ji,jj) = 0 ; bathy(ji,jj) = 0._wp ; 1707 END IF 1708 END DO 1709 END DO 1710 1711 WHERE (mbathy(:,:) == 1) 1712 mbathy = 0; bathy = 0.0_wp ; misfdep = 0 ; risfdep = 0.0_wp 1713 END WHERE 1714 END DO 1715 ! end check compatibility ice shelf/bathy 1716 ! remove very shallow ice shelf (less than ~ 10m if 75L) 1717 WHERE (risfdep(:,:) <= 10._wp) 1718 misfdep = 1; risfdep = 0.0_wp; 1719 END WHERE 1720 1721 IF( icompt == 0 ) THEN 1722 IF(lwp) WRITE(numout,*)' no points with ice shelf too close to bathymetry' 1723 ELSE 1724 IF(lwp) WRITE(numout,*)' ',icompt,' ocean grid points with ice shelf thickness reduced to avoid bathymetry' 1725 ENDIF 1726 1727 ! compute scale factor and depth at T- and W- points 1728 DO jj = 1, jpj 1729 DO ji = 1, jpi 1730 ik = mbathy(ji,jj) 1731 IF( ik > 0 ) THEN ! ocean point only 1732 ! max ocean level case 1733 IF( ik == jpkm1 ) THEN 1734 zdepwp = bathy(ji,jj) 1735 ze3tp = bathy(ji,jj) - gdepw_1d(ik) 1736 ze3wp = 0.5_wp * e3w_1d(ik) * ( 1._wp + ( ze3tp/e3t_1d(ik) ) ) 1737 e3t_0(ji,jj,ik ) = ze3tp 1738 e3t_0(ji,jj,ik+1) = ze3tp 1739 e3w_0(ji,jj,ik ) = ze3wp 1740 e3w_0(ji,jj,ik+1) = ze3tp 1741 gdepw_0(ji,jj,ik+1) = zdepwp 1742 gdept_0(ji,jj,ik ) = gdept_1d(ik-1) + ze3wp 1743 gdept_0(ji,jj,ik+1) = gdept_0(ji,jj,ik) + ze3tp 1744 ! 1745 ELSE ! standard case 1746 IF( bathy(ji,jj) <= gdepw_1d(ik+1) ) THEN ; gdepw_0(ji,jj,ik+1) = bathy(ji,jj) 1747 ELSE ; gdepw_0(ji,jj,ik+1) = gdepw_1d(ik+1) 1748 ENDIF 1749 ! gdepw_0(ji,jj,ik+1) = gdepw_1d(ik+1) 1750 !gm Bug? check the gdepw_1d 1751 ! ... on ik 1752 gdept_0(ji,jj,ik) = gdepw_1d(ik) + ( gdepw_0(ji,jj,ik+1) - gdepw_1d(ik) ) & 1753 & * ((gdept_1d( ik ) - gdepw_1d(ik) ) & 1754 & / ( gdepw_1d( ik+1) - gdepw_1d(ik) )) 1755 e3t_0 (ji,jj,ik ) = gdepw_0(ji,jj,ik+1) - gdepw_1d(ik ) 1756 e3w_0 (ji,jj,ik ) = gdept_0(ji,jj,ik ) - gdept_1d(ik-1) 1757 ! ... on ik+1 1758 e3w_0 (ji,jj,ik+1) = e3t_0 (ji,jj,ik) 1759 e3t_0 (ji,jj,ik+1) = e3t_0 (ji,jj,ik) 1760 ENDIF 1761 ENDIF 1762 END DO 1763 END DO 1764 ! 1765 it = 0 1766 DO jj = 1, jpj 1767 DO ji = 1, jpi 1768 ik = mbathy(ji,jj) 1769 IF( ik > 0 ) THEN ! ocean point only 1770 e3tp (ji,jj) = e3t_0(ji,jj,ik) 1771 e3wp (ji,jj) = e3w_0(ji,jj,ik) 1772 ! test 1773 zdiff= gdepw_0(ji,jj,ik+1) - gdept_0(ji,jj,ik ) 1774 IF( zdiff <= 0._wp .AND. lwp ) THEN 1775 it = it + 1 1776 WRITE(numout,*) ' it = ', it, ' ik = ', ik, ' (i,j) = ', ji, jj 1777 WRITE(numout,*) ' bathy = ', bathy(ji,jj) 1778 WRITE(numout,*) ' gdept_0 = ', gdept_0(ji,jj,ik), ' gdepw_0 = ', gdepw_0(ji,jj,ik+1), ' zdiff = ', zdiff 1779 WRITE(numout,*) ' e3tp = ', e3t_0 (ji,jj,ik), ' e3wp = ', e3w_0 (ji,jj,ik ) 1780 ENDIF 1781 ENDIF 1782 END DO 1783 END DO 1784 ! 1785 ! (ISF) Definition of e3t, u, v, w for ISF case 1786 DO jj = 1, jpj 1787 DO ji = 1, jpi 1788 ik = misfdep(ji,jj) 1789 IF( ik > 1 ) THEN ! ice shelf point only 1790 IF( risfdep(ji,jj) < gdepw_1d(ik) ) risfdep(ji,jj)= gdepw_1d(ik) 1791 gdepw_0(ji,jj,ik) = risfdep(ji,jj) 1792 !gm Bug? check the gdepw_0 1793 ! ... on ik 1794 gdept_0(ji,jj,ik) = gdepw_1d(ik+1) - ( gdepw_1d(ik+1) - gdepw_0(ji,jj,ik) ) & 1795 & * ( gdepw_1d(ik+1) - gdept_1d(ik) ) & 1796 & / ( gdepw_1d(ik+1) - gdepw_1d(ik) ) 1797 e3t_0 (ji,jj,ik ) = gdepw_1d(ik+1) - gdepw_0(ji,jj,ik) 1798 e3w_0 (ji,jj,ik+1) = gdept_1d(ik+1) - gdept_0(ji,jj,ik) 1799 1800 IF( ik + 1 == mbathy(ji,jj) ) THEN ! ice shelf point only (2 cell water column) 1801 e3w_0 (ji,jj,ik+1) = gdept_0(ji,jj,ik+1) - gdept_0(ji,jj,ik) 1802 ENDIF 1803 ! ... on ik / ik-1 1804 e3w_0 (ji,jj,ik ) = e3t_0 (ji,jj,ik) !2._wp * (gdept_0(ji,jj,ik) - gdepw_0(ji,jj,ik)) 1805 e3t_0 (ji,jj,ik-1) = gdepw_0(ji,jj,ik) - gdepw_1d(ik-1) 1806 ! The next line isn't required and doesn't affect results - included for consistency with bathymetry code 1807 gdept_0(ji,jj,ik-1) = gdept_1d(ik-1) 1808 ENDIF 1809 END DO 1810 END DO 1811 1812 it = 0 1813 DO jj = 1, jpj 1814 DO ji = 1, jpi 1815 ik = misfdep(ji,jj) 1816 IF( ik > 1 ) THEN ! ice shelf point only 1817 e3tp (ji,jj) = e3t_0(ji,jj,ik ) 1818 e3wp (ji,jj) = e3w_0(ji,jj,ik+1 ) 1819 ! test 1820 zdiff= gdept_0(ji,jj,ik) - gdepw_0(ji,jj,ik ) 1821 IF( zdiff <= 0. .AND. lwp ) THEN 1822 it = it + 1 1823 WRITE(numout,*) ' it = ', it, ' ik = ', ik, ' (i,j) = ', ji, jj 1824 WRITE(numout,*) ' risfdep = ', risfdep(ji,jj) 1825 WRITE(numout,*) ' gdept = ', gdept_0(ji,jj,ik), ' gdepw = ', gdepw_0(ji,jj,ik+1), ' zdiff = ', zdiff 1826 WRITE(numout,*) ' e3tp = ', e3tp(ji,jj), ' e3wp = ', e3wp(ji,jj) 1827 ENDIF 1828 ENDIF 1829 END DO 1830 END DO 1831 1832 CALL wrk_dealloc( jpi, jpj, zmask, zbathy, zrisfdep ) 1833 CALL wrk_dealloc( jpi, jpj, zmisfdep, zmbathy ) 1834 ! 1835 IF( nn_timing == 1 ) CALL timing_stop('zgr_isf') 1836 ! 1837 END SUBROUTINE zgr_isf 1838 1839 1840 SUBROUTINE zgr_sco 1841 !!---------------------------------------------------------------------- 1842 !! *** ROUTINE zgr_sco *** 1843 !! 1844 !! ** Purpose : define the s-coordinate system 1845 !! 1846 !! ** Method : s-coordinate 1847 !! The depth of model levels is defined as the product of an 1848 !! analytical function by the local bathymetry, while the vertical 1849 !! scale factors are defined as the product of the first derivative 1850 !! of the analytical function by the bathymetry. 1851 !! (this solution save memory as depth and scale factors are not 1852 !! 3d fields) 1853 !! - Read bathymetry (in meters) at t-point and compute the 1854 !! bathymetry at u-, v-, and f-points. 1855 !! hbatu = mi( hbatt ) 1856 !! hbatv = mj( hbatt ) 1857 !! hbatf = mi( mj( hbatt ) ) 1858 !! - Compute z_gsigt, z_gsigw, z_esigt, z_esigw from an analytical 1859 !! function and its derivative given as function. 1860 !! z_gsigt(k) = fssig (k ) 1861 !! z_gsigw(k) = fssig (k-0.5) 1862 !! z_esigt(k) = fsdsig(k ) 1863 !! z_esigw(k) = fsdsig(k-0.5) 1864 !! Three options for stretching are give, and they can be modified 1865 !! following the users requirements. Nevertheless, the output as 1866 !! well as the way to compute the model levels and scale factors 1867 !! must be respected in order to insure second order accuracy 1868 !! schemes. 1869 !! 1870 !! The three methods for stretching available are: 1871 !! 1872 !! s_sh94 (Song and Haidvogel 1994) 1873 !! a sinh/tanh function that allows sigma and stretched sigma 1874 !! 1875 !! s_sf12 (Siddorn and Furner 2012?) 1876 !! allows the maintenance of fixed surface and or 1877 !! bottom cell resolutions (cf. geopotential coordinates) 1878 !! within an analytically derived stretched S-coordinate framework. 1879 !! 1880 !! s_tanh (Madec et al 1996) 1881 !! a cosh/tanh function that gives stretched coordinates 1882 !! 1883 !!---------------------------------------------------------------------- 1884 INTEGER :: ji, jj, jk, jl ! dummy loop argument 1885 INTEGER :: iip1, ijp1, iim1, ijm1 ! temporary integers 1886 INTEGER :: ios ! Local integer output status for namelist read 1887 REAL(wp) :: zrmax, ztaper ! temporary scalars 1888 REAL(wp) :: zrfact 1889 ! 1890 REAL(wp), POINTER, DIMENSION(:,: ) :: ztmpi1, ztmpi2, ztmpj1, ztmpj2 1891 REAL(wp), POINTER, DIMENSION(:,: ) :: zenv, ztmp, zmsk, zri, zrj, zhbat 1892 !! 1893 NAMELIST/namzgr_sco/ln_s_sh94, ln_s_sf12, ln_sigcrit, rn_sbot_min, rn_sbot_max, rn_hc, rn_rmax,rn_theta, & 1894 & rn_thetb, rn_bb, rn_alpha, rn_efold, rn_zs, rn_zb_a, rn_zb_b 1895 !!---------------------------------------------------------------------- 1896 ! 1897 IF( nn_timing == 1 ) CALL timing_start('zgr_sco') 1898 ! 1899 CALL wrk_alloc( jpi,jpj, zenv, ztmp, zmsk, zri, zrj, zhbat , ztmpi1, ztmpi2, ztmpj1, ztmpj2 ) 1900 ! 1901 REWIND( numnam_ref ) ! Namelist namzgr_sco in reference namelist : Sigma-stretching parameters 1902 READ ( numnam_ref, namzgr_sco, IOSTAT = ios, ERR = 901) 1903 901 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namzgr_sco in reference namelist', lwp ) 1904 1905 REWIND( numnam_cfg ) ! Namelist namzgr_sco in configuration namelist : Sigma-stretching parameters 1906 READ ( numnam_cfg, namzgr_sco, IOSTAT = ios, ERR = 902 ) 1907 902 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namzgr_sco in configuration namelist', lwp ) 1908 IF(lwm) WRITE ( numond, namzgr_sco ) 1909 1910 IF(lwp) THEN ! control print 1911 WRITE(numout,*) 1912 WRITE(numout,*) 'domzgr_sco : s-coordinate or hybrid z-s-coordinate' 1913 WRITE(numout,*) '~~~~~~~~~~~' 1914 WRITE(numout,*) ' Namelist namzgr_sco' 1915 WRITE(numout,*) ' stretching coeffs ' 1916 WRITE(numout,*) ' maximum depth of s-bottom surface (>0) rn_sbot_max = ',rn_sbot_max 1917 WRITE(numout,*) ' minimum depth of s-bottom surface (>0) rn_sbot_min = ',rn_sbot_min 1918 WRITE(numout,*) ' Critical depth rn_hc = ',rn_hc 1919 WRITE(numout,*) ' maximum cut-off r-value allowed rn_rmax = ',rn_rmax 1920 WRITE(numout,*) ' Song and Haidvogel 1994 stretching ln_s_sh94 = ',ln_s_sh94 1921 WRITE(numout,*) ' Song and Haidvogel 1994 stretching coefficients' 1922 WRITE(numout,*) ' surface control parameter (0<=rn_theta<=20) rn_theta = ',rn_theta 1923 WRITE(numout,*) ' bottom control parameter (0<=rn_thetb<= 1) rn_thetb = ',rn_thetb 1924 WRITE(numout,*) ' stretching parameter (song and haidvogel) rn_bb = ',rn_bb 1925 WRITE(numout,*) ' Siddorn and Furner 2012 stretching ln_s_sf12 = ',ln_s_sf12 1926 WRITE(numout,*) ' switching to sigma (T) or Z (F) at H<Hc ln_sigcrit = ',ln_sigcrit 1927 WRITE(numout,*) ' Siddorn and Furner 2012 stretching coefficients' 1928 WRITE(numout,*) ' stretchin parameter ( >1 surface; <1 bottom) rn_alpha = ',rn_alpha 1929 WRITE(numout,*) ' e-fold length scale for transition region rn_efold = ',rn_efold 1930 WRITE(numout,*) ' Surface cell depth (Zs) (m) rn_zs = ',rn_zs 1931 WRITE(numout,*) ' Bathymetry multiplier for Zb rn_zb_a = ',rn_zb_a 1932 WRITE(numout,*) ' Offset for Zb rn_zb_b = ',rn_zb_b 1933 WRITE(numout,*) ' Bottom cell (Zb) (m) = H*rn_zb_a + rn_zb_b' 1934 ENDIF 1935 1936 hift(:,:) = rn_sbot_min ! set the minimum depth for the s-coordinate 1937 hifu(:,:) = rn_sbot_min 1938 hifv(:,:) = rn_sbot_min 1939 hiff(:,:) = rn_sbot_min 1940 1941 ! ! set maximum ocean depth 1942 bathy(:,:) = MIN( rn_sbot_max, bathy(:,:) ) 1943 1944 IF( .NOT.ln_wd ) THEN 1945 DO jj = 1, jpj 1946 DO ji = 1, jpi 1947 IF( bathy(ji,jj) > 0._wp ) bathy(ji,jj) = MAX( rn_sbot_min, bathy(ji,jj) ) 1948 END DO 1949 END DO 1950 END IF 1951 ! ! ============================= 1952 ! ! Define the envelop bathymetry (hbatt) 1953 ! ! ============================= 1954 ! use r-value to create hybrid coordinates 1955 zenv(:,:) = bathy(:,:) 1956 ! 1957 IF( .NOT.ln_wd ) THEN 1958 ! set first land point adjacent to a wet cell to sbot_min as this needs to be included in smoothing 1959 DO jj = 1, jpj 1960 DO ji = 1, jpi 1961 IF( bathy(ji,jj) == 0._wp ) THEN 1962 iip1 = MIN( ji+1, jpi ) 1963 ijp1 = MIN( jj+1, jpj ) 1964 iim1 = MAX( ji-1, 1 ) 1965 ijm1 = MAX( jj-1, 1 ) 1966 !!gm BUG fix see ticket #1617 1967 IF( ( + bathy(iim1,ijm1) + bathy(ji,ijp1) + bathy(iip1,ijp1) & 1968 & + bathy(iim1,jj ) + bathy(iip1,jj ) & 1969 & + bathy(iim1,ijm1) + bathy(ji,ijm1) + bathy(iip1,ijp1) ) > 0._wp ) & 1970 & zenv(ji,jj) = rn_sbot_min 1971 !!gm 1972 !!gm IF( ( bathy(iip1,jj ) + bathy(iim1,jj ) + bathy(ji,ijp1 ) + bathy(ji,ijm1) + & 1973 !!gm & bathy(iip1,ijp1) + bathy(iim1,ijm1) + bathy(iip1,ijp1) + bathy(iim1,ijm1)) > 0._wp ) THEN 1974 !!gm zenv(ji,jj) = rn_sbot_min 1975 !!gm ENDIF 1976 !!gm end 1977 ENDIF 1978 END DO 1979 END DO 1980 END IF 1981 1982 ! apply lateral boundary condition CAUTION: keep the value when the lbc field is zero 1983 CALL lbc_lnk( zenv, 'T', 1._wp, 'no0' ) 1984 ! 1985 ! smooth the bathymetry (if required) 1986 scosrf(:,:) = 0._wp ! ocean surface depth (here zero: no under ice-shelf sea) 1987 scobot(:,:) = bathy(:,:) ! ocean bottom depth 1988 ! 1989 jl = 0 1990 zrmax = 1._wp 1991 ! 1992 ! 1993 ! set scaling factor used in reducing vertical gradients 1994 zrfact = ( 1._wp - rn_rmax ) / ( 1._wp + rn_rmax ) 1995 ! 1996 ! initialise temporary evelope depth arrays 1997 ztmpi1(:,:) = zenv(:,:) 1998 ztmpi2(:,:) = zenv(:,:) 1999 ztmpj1(:,:) = zenv(:,:) 2000 ztmpj2(:,:) = zenv(:,:) 2001 ! 2002 ! initialise temporary r-value arrays 2003 zri(:,:) = 1._wp 2004 zrj(:,:) = 1._wp 2005 ! ! ================ ! 2006 DO WHILE( jl <= 10000 .AND. ( zrmax - rn_rmax ) > 1.e-8_wp ) ! Iterative loop ! 2007 ! ! ================ ! 2008 jl = jl + 1 2009 zrmax = 0._wp 2010 ! we set zrmax from previous r-values (zri and zrj) first 2011 ! if set after current r-value calculation (as previously) 2012 ! we could exit DO WHILE prematurely before checking r-value 2013 ! of current zenv 2014 DO jj = 1, nlcj 2015 DO ji = 1, nlci 2016 zrmax = MAX( zrmax, ABS(zri(ji,jj)), ABS(zrj(ji,jj)) ) 2017 END DO 2018 END DO 2019 zri(:,:) = 0._wp 2020 zrj(:,:) = 0._wp 2021 DO jj = 1, nlcj 2022 DO ji = 1, nlci 2023 iip1 = MIN( ji+1, nlci ) ! force zri = 0 on last line (ji=ncli+1 to jpi) 2024 ijp1 = MIN( jj+1, nlcj ) ! force zrj = 0 on last raw (jj=nclj+1 to jpj) 2025 IF( (zenv(ji,jj) > 0._wp) .AND. (zenv(iip1,jj) > 0._wp)) THEN 2026 zri(ji,jj) = ( zenv(iip1,jj ) - zenv(ji,jj) ) / ( zenv(iip1,jj ) + zenv(ji,jj) ) 2027 END IF 2028 IF( (zenv(ji,jj) > 0._wp) .AND. (zenv(ji,ijp1) > 0._wp)) THEN 2029 zrj(ji,jj) = ( zenv(ji ,ijp1) - zenv(ji,jj) ) / ( zenv(ji ,ijp1) + zenv(ji,jj) ) 2030 END IF 2031 IF( zri(ji,jj) > rn_rmax ) ztmpi1(ji ,jj ) = zenv(iip1,jj ) * zrfact 2032 IF( zri(ji,jj) < -rn_rmax ) ztmpi2(iip1,jj ) = zenv(ji ,jj ) * zrfact 2033 IF( zrj(ji,jj) > rn_rmax ) ztmpj1(ji ,jj ) = zenv(ji ,ijp1) * zrfact 2034 IF( zrj(ji,jj) < -rn_rmax ) ztmpj2(ji ,ijp1) = zenv(ji ,jj ) * zrfact 2035 END DO 2036 END DO 2037 IF( lk_mpp ) CALL mpp_max( zrmax ) ! max over the global domain 2038 ! 2039 IF(lwp)WRITE(numout,*) 'zgr_sco : iter= ',jl, ' rmax= ', zrmax 2040 ! 2041 DO jj = 1, nlcj 2042 DO ji = 1, nlci 2043 zenv(ji,jj) = MAX(zenv(ji,jj), ztmpi1(ji,jj), ztmpi2(ji,jj), ztmpj1(ji,jj), ztmpj2(ji,jj) ) 2044 END DO 2045 END DO 2046 ! apply lateral boundary condition CAUTION: keep the value when the lbc field is zero 2047 CALL lbc_lnk( zenv, 'T', 1._wp, 'no0' ) 2048 ! ! ================ ! 2049 END DO ! End loop ! 2050 ! ! ================ ! 2051 DO jj = 1, jpj 2052 DO ji = 1, jpi 2053 zenv(ji,jj) = MAX( zenv(ji,jj), rn_sbot_min ) ! set all points to avoid undefined scale value warnings 2054 END DO 2055 END DO 2056 ! 2057 ! Envelope bathymetry saved in hbatt 2058 hbatt(:,:) = zenv(:,:) 2059 IF( MINVAL( gphit(:,:) ) * MAXVAL( gphit(:,:) ) <= 0._wp ) THEN 2060 CALL ctl_warn( ' s-coordinates are tapered in vicinity of the Equator' ) 2061 DO jj = 1, jpj 2062 DO ji = 1, jpi 2063 ztaper = EXP( -(gphit(ji,jj)/8._wp)**2._wp ) 2064 hbatt(ji,jj) = rn_sbot_max * ztaper + hbatt(ji,jj) * ( 1._wp - ztaper ) 2065 END DO 2066 END DO 2067 ENDIF 2068 ! 2069 ! ! ============================== 2070 ! ! hbatu, hbatv, hbatf fields 2071 ! ! ============================== 2072 IF(lwp) THEN 2073 WRITE(numout,*) 2074 IF( .NOT.ln_wd ) THEN 2075 WRITE(numout,*) ' zgr_sco: minimum depth of the envelop topography set to : ', rn_sbot_min 2076 ELSE 2077 WRITE(numout,*) ' zgr_sco: minimum positive depth of the envelop topography set to : ', rn_sbot_min 2078 WRITE(numout,*) ' zgr_sco: minimum negative depth of the envelop topography set to : ', -rn_wdld 2079 ENDIF 2080 ENDIF 2081 hbatu(:,:) = rn_sbot_min 2082 hbatv(:,:) = rn_sbot_min 2083 hbatf(:,:) = rn_sbot_min 2084 DO jj = 1, jpjm1 2085 DO ji = 1, jpim1 ! NO vector opt. 2086 hbatu(ji,jj) = 0.50_wp * ( hbatt(ji ,jj) + hbatt(ji+1,jj ) ) 2087 hbatv(ji,jj) = 0.50_wp * ( hbatt(ji ,jj) + hbatt(ji ,jj+1) ) 2088 hbatf(ji,jj) = 0.25_wp * ( hbatt(ji ,jj) + hbatt(ji ,jj+1) & 2089 & + hbatt(ji+1,jj) + hbatt(ji+1,jj+1) ) 2090 END DO 2091 END DO 2092 2093 IF( ln_wd ) THEN !avoid the zero depth on T- (U-,V-,F-) points 2094 DO jj = 1, jpj 2095 DO ji = 1, jpi 2096 IF(ABS(hbatt(ji,jj)) < rn_wdmin1) & 2097 & hbatt(ji,jj) = SIGN(1._wp, hbatt(ji,jj)) * rn_wdmin1 2098 IF(ABS(hbatu(ji,jj)) < rn_wdmin1) & 2099 & hbatu(ji,jj) = SIGN(1._wp, hbatu(ji,jj)) * rn_wdmin1 2100 IF(ABS(hbatv(ji,jj)) < rn_wdmin1) & 2101 & hbatv(ji,jj) = SIGN(1._wp, hbatv(ji,jj)) * rn_wdmin1 2102 IF(ABS(hbatf(ji,jj)) < rn_wdmin1) & 2103 & hbatf(ji,jj) = SIGN(1._wp, hbatf(ji,jj)) * rn_wdmin1 2104 END DO 2105 END DO 2106 END IF 2107 ! 2108 ! Apply lateral boundary condition 2109 !!gm ! CAUTION: retain non zero value in the initial file this should be OK for orca cfg, not for EEL 2110 zhbat(:,:) = hbatu(:,:) ; CALL lbc_lnk( hbatu, 'U', 1._wp ) 2111 DO jj = 1, jpj 2112 DO ji = 1, jpi 2113 IF( hbatu(ji,jj) == 0._wp ) THEN 2114 !No worries about the following line when ln_wd == .true. 2115 IF( zhbat(ji,jj) == 0._wp ) hbatu(ji,jj) = rn_sbot_min 2116 IF( zhbat(ji,jj) /= 0._wp ) hbatu(ji,jj) = zhbat(ji,jj) 2117 ENDIF 2118 END DO 2119 END DO 2120 zhbat(:,:) = hbatv(:,:) ; CALL lbc_lnk( hbatv, 'V', 1._wp ) 2121 DO jj = 1, jpj 2122 DO ji = 1, jpi 2123 IF( hbatv(ji,jj) == 0._wp ) THEN 2124 IF( zhbat(ji,jj) == 0._wp ) hbatv(ji,jj) = rn_sbot_min 2125 IF( zhbat(ji,jj) /= 0._wp ) hbatv(ji,jj) = zhbat(ji,jj) 2126 ENDIF 2127 END DO 2128 END DO 2129 zhbat(:,:) = hbatf(:,:) ; CALL lbc_lnk( hbatf, 'F', 1._wp ) 2130 DO jj = 1, jpj 2131 DO ji = 1, jpi 2132 IF( hbatf(ji,jj) == 0._wp ) THEN 2133 IF( zhbat(ji,jj) == 0._wp ) hbatf(ji,jj) = rn_sbot_min 2134 IF( zhbat(ji,jj) /= 0._wp ) hbatf(ji,jj) = zhbat(ji,jj) 2135 ENDIF 2136 END DO 2137 END DO 2138 2139 !!bug: key_helsinki a verifer 2140 IF( .NOT.ln_wd ) THEN 2141 hift(:,:) = MIN( hift(:,:), hbatt(:,:) ) 2142 hifu(:,:) = MIN( hifu(:,:), hbatu(:,:) ) 2143 hifv(:,:) = MIN( hifv(:,:), hbatv(:,:) ) 2144 hiff(:,:) = MIN( hiff(:,:), hbatf(:,:) ) 2145 END IF 2146 2147 IF( nprint == 1 .AND. lwp ) THEN 2148 WRITE(numout,*) ' MAX val hif t ', MAXVAL( hift (:,:) ), ' f ', MAXVAL( hiff (:,:) ), & 2149 & ' u ', MAXVAL( hifu (:,:) ), ' v ', MAXVAL( hifv (:,:) ) 2150 WRITE(numout,*) ' MIN val hif t ', MINVAL( hift (:,:) ), ' f ', MINVAL( hiff (:,:) ), & 2151 & ' u ', MINVAL( hifu (:,:) ), ' v ', MINVAL( hifv (:,:) ) 2152 WRITE(numout,*) ' MAX val hbat t ', MAXVAL( hbatt(:,:) ), ' f ', MAXVAL( hbatf(:,:) ), & 2153 & ' u ', MAXVAL( hbatu(:,:) ), ' v ', MAXVAL( hbatv(:,:) ) 2154 WRITE(numout,*) ' MIN val hbat t ', MINVAL( hbatt(:,:) ), ' f ', MINVAL( hbatf(:,:) ), & 2155 & ' u ', MINVAL( hbatu(:,:) ), ' v ', MINVAL( hbatv(:,:) ) 2156 ENDIF 2157 !! helsinki 2158 2159 ! ! ======================= 2160 ! ! s-ccordinate fields (gdep., e3.) 2161 ! ! ======================= 2162 ! 2163 ! non-dimensional "sigma" for model level depth at w- and t-levels 2164 2165 2166 !======================================================================== 2167 ! Song and Haidvogel 1994 (ln_s_sh94=T) 2168 ! Siddorn and Furner 2012 (ln_sf12=T) 2169 ! or tanh function (both false) 2170 !======================================================================== 2171 IF ( ln_s_sh94 ) THEN 2172 CALL s_sh94() 2173 ELSE IF ( ln_s_sf12 ) THEN 2174 CALL s_sf12() 2175 ELSE 2176 CALL s_tanh() 2177 ENDIF 2178 2179 CALL lbc_lnk( e3t_0 , 'T', 1._wp ) 2180 CALL lbc_lnk( e3u_0 , 'U', 1._wp ) 2181 CALL lbc_lnk( e3v_0 , 'V', 1._wp ) 2182 CALL lbc_lnk( e3f_0 , 'F', 1._wp ) 2183 CALL lbc_lnk( e3w_0 , 'W', 1._wp ) 2184 CALL lbc_lnk( e3uw_0, 'U', 1._wp ) 2185 CALL lbc_lnk( e3vw_0, 'V', 1._wp ) 2186 ! 2187 IF( .NOT.ln_wd ) THEN 2188 WHERE( e3t_0 (:,:,:) == 0._wp ) e3t_0 (:,:,:) = 1._wp 2189 WHERE( e3u_0 (:,:,:) == 0._wp ) e3u_0 (:,:,:) = 1._wp 2190 WHERE( e3v_0 (:,:,:) == 0._wp ) e3v_0 (:,:,:) = 1._wp 2191 WHERE( e3f_0 (:,:,:) == 0._wp ) e3f_0 (:,:,:) = 1._wp 2192 WHERE( e3w_0 (:,:,:) == 0._wp ) e3w_0 (:,:,:) = 1._wp 2193 WHERE( e3uw_0(:,:,:) == 0._wp ) e3uw_0(:,:,:) = 1._wp 2194 WHERE( e3vw_0(:,:,:) == 0._wp ) e3vw_0(:,:,:) = 1._wp 2195 END IF 2196 2197 #if defined key_agrif 2198 IF( .NOT. Agrif_Root() ) THEN ! Ensure meaningful vertical scale factors in ghost lines/columns 2199 IF( nbondi == -1 .OR. nbondi == 2 ) e3u_0( 1 , : ,:) = e3u_0( 2 , : ,:) 2200 IF( nbondi == 1 .OR. nbondi == 2 ) e3u_0(nlci-1, : ,:) = e3u_0(nlci-2, : ,:) 2201 IF( nbondj == -1 .OR. nbondj == 2 ) e3v_0( : , 1 ,:) = e3v_0( : , 2 ,:) 2202 IF( nbondj == 1 .OR. nbondj == 2 ) e3v_0( : ,nlcj-1,:) = e3v_0( : ,nlcj-2,:) 2203 ENDIF 2204 #endif 2205 2206 !!gm I don't like that HERE we are supposed to set the reference coordinate (i.e. _0 arrays) 2207 !!gm and only that !!!!! 2208 !!gm THIS should be removed from here ! 2209 gdept_n(:,:,:) = gdept_0(:,:,:) 2210 gdepw_n(:,:,:) = gdepw_0(:,:,:) 2211 gde3w_n(:,:,:) = gde3w_0(:,:,:) 2212 e3t_n (:,:,:) = e3t_0 (:,:,:) 2213 e3u_n (:,:,:) = e3u_0 (:,:,:) 2214 e3v_n (:,:,:) = e3v_0 (:,:,:) 2215 e3f_n (:,:,:) = e3f_0 (:,:,:) 2216 e3w_n (:,:,:) = e3w_0 (:,:,:) 2217 e3uw_n (:,:,:) = e3uw_0 (:,:,:) 2218 e3vw_n (:,:,:) = e3vw_0 (:,:,:) 2219 !!gm and obviously in the following, use the _0 arrays until the end of this subroutine 2220 !! gm end 2221 !! 2222 ! HYBRID : 2223 DO jj = 1, jpj 2224 DO ji = 1, jpi 2225 DO jk = 1, jpkm1 2226 IF( scobot(ji,jj) >= gdept_n(ji,jj,jk) ) mbathy(ji,jj) = MAX( 2, jk ) 2227 END DO 2228 IF( ln_wd ) THEN 2229 IF( scobot(ji,jj) <= -(rn_wdld - rn_wdmin2)) THEN 2230 mbathy(ji,jj) = 0 2231 ELSEIF(scobot(ji,jj) <= rn_wdmin1) THEN 2232 mbathy(ji,jj) = 2 2233 ENDIF 2234 ELSE 2235 IF( scobot(ji,jj) == 0._wp ) mbathy(ji,jj) = 0 2236 ENDIF 2237 END DO 2238 END DO 2239 IF( nprint == 1 .AND. lwp ) WRITE(numout,*) ' MIN val mbathy h90 ', MINVAL( mbathy(:,:) ), & 2240 & ' MAX ', MAXVAL( mbathy(:,:) ) 2241 2242 IF( nprint == 1 .AND. lwp ) THEN ! min max values over the local domain 2243 WRITE(numout,*) ' MIN val mbathy ', MINVAL( mbathy(:,:) ), ' MAX ', MAXVAL( mbathy(:,:) ) 2244 WRITE(numout,*) ' MIN val depth t ', MINVAL( gdept_0(:,:,:) ), & 2245 & ' w ', MINVAL( gdepw_0(:,:,:) ), '3w ' , MINVAL( gde3w_0(:,:,:) ) 2246 WRITE(numout,*) ' MIN val e3 t ', MINVAL( e3t_0 (:,:,:) ), ' f ' , MINVAL( e3f_0 (:,:,:) ), & 2247 & ' u ', MINVAL( e3u_0 (:,:,:) ), ' u ' , MINVAL( e3v_0 (:,:,:) ), & 2248 & ' uw', MINVAL( e3uw_0 (:,:,:) ), ' vw' , MINVAL( e3vw_0 (:,:,:) ), & 2249 & ' w ', MINVAL( e3w_0 (:,:,:) ) 2250 2251 WRITE(numout,*) ' MAX val depth t ', MAXVAL( gdept_0(:,:,:) ), & 2252 & ' w ', MAXVAL( gdepw_0(:,:,:) ), '3w ' , MAXVAL( gde3w_0(:,:,:) ) 2253 WRITE(numout,*) ' MAX val e3 t ', MAXVAL( e3t_0 (:,:,:) ), ' f ' , MAXVAL( e3f_0 (:,:,:) ), & 2254 & ' u ', MAXVAL( e3u_0 (:,:,:) ), ' u ' , MAXVAL( e3v_0 (:,:,:) ), & 2255 & ' uw', MAXVAL( e3uw_0 (:,:,:) ), ' vw' , MAXVAL( e3vw_0 (:,:,:) ), & 2256 & ' w ', MAXVAL( e3w_0 (:,:,:) ) 2257 ENDIF 2258 ! END DO 2259 IF(lwp) THEN ! selected vertical profiles 2260 WRITE(numout,*) 2261 WRITE(numout,*) ' domzgr: vertical coordinates : point (1,1,k) bathy = ', bathy(1,1), hbatt(1,1) 2262 WRITE(numout,*) ' ~~~~~~ --------------------' 2263 WRITE(numout,"(9x,' level gdept_0 gdepw_0 e3t_0 e3w_0')") 2264 WRITE(numout,"(10x,i4,4f9.2)") ( jk, gdept_0(1,1,jk), gdepw_0(1,1,jk), & 2265 & e3t_0 (1,1,jk) , e3w_0 (1,1,jk) , jk=1,jpk ) 2266 DO jj = mj0(20), mj1(20) 2267 DO ji = mi0(20), mi1(20) 2268 WRITE(numout,*) 2269 WRITE(numout,*) ' domzgr: vertical coordinates : point (20,20,k) bathy = ', bathy(ji,jj), hbatt(ji,jj) 2270 WRITE(numout,*) ' ~~~~~~ --------------------' 2271 WRITE(numout,"(9x,' level gdept_0 gdepw_0 e3t_0 e3w_0')") 2272 WRITE(numout,"(10x,i4,4f9.2)") ( jk, gdept_0(ji,jj,jk), gdepw_0(ji,jj,jk), & 2273 & e3t_0 (ji,jj,jk) , e3w_0 (ji,jj,jk) , jk=1,jpk ) 2274 END DO 2275 END DO 2276 DO jj = mj0(74), mj1(74) 2277 DO ji = mi0(100), mi1(100) 2278 WRITE(numout,*) 2279 WRITE(numout,*) ' domzgr: vertical coordinates : point (100,74,k) bathy = ', bathy(ji,jj), hbatt(ji,jj) 2280 WRITE(numout,*) ' ~~~~~~ --------------------' 2281 WRITE(numout,"(9x,' level gdept_0 gdepw_0 e3t_0 e3w_0')") 2282 WRITE(numout,"(10x,i4,4f9.2)") ( jk, gdept_0(ji,jj,jk), gdepw_0(ji,jj,jk), & 2283 & e3t_0 (ji,jj,jk) , e3w_0 (ji,jj,jk) , jk=1,jpk ) 2284 END DO 2285 END DO 2286 ENDIF 2287 ! 2288 !================================================================================ 2289 ! check the coordinate makes sense 2290 !================================================================================ 2291 DO ji = 1, jpi 2292 DO jj = 1, jpj 2293 ! 2294 IF( hbatt(ji,jj) > 0._wp) THEN 2295 DO jk = 1, mbathy(ji,jj) 2296 ! check coordinate is monotonically increasing 2297 IF (e3w_n(ji,jj,jk) <= 0._wp .OR. e3t_n(ji,jj,jk) <= 0._wp ) THEN 2298 WRITE(ctmp1,*) 'ERROR zgr_sco : e3w or e3t =< 0 at point (i,j,k)= ', ji, jj, jk 2299 WRITE(numout,*) 'ERROR zgr_sco : e3w or e3t =< 0 at point (i,j,k)= ', ji, jj, jk 2300 WRITE(numout,*) 'e3w',e3w_n(ji,jj,:) 2301 WRITE(numout,*) 'e3t',e3t_n(ji,jj,:) 2302 CALL ctl_stop( ctmp1 ) 2303 ENDIF 2304 ! and check it has never gone negative 2305 IF( gdepw_n(ji,jj,jk) < 0._wp .OR. gdept_n(ji,jj,jk) < 0._wp ) THEN 2306 WRITE(ctmp1,*) 'ERROR zgr_sco : gdepw or gdept =< 0 at point (i,j,k)= ', ji, jj, jk 2307 WRITE(numout,*) 'ERROR zgr_sco : gdepw or gdept =< 0 at point (i,j,k)= ', ji, jj, jk 2308 WRITE(numout,*) 'gdepw',gdepw_n(ji,jj,:) 2309 WRITE(numout,*) 'gdept',gdept_n(ji,jj,:) 2310 CALL ctl_stop( ctmp1 ) 2311 ENDIF 2312 ! and check it never exceeds the total depth 2313 IF( gdepw_n(ji,jj,jk) > hbatt(ji,jj) ) THEN 2314 WRITE(ctmp1,*) 'ERROR zgr_sco : gdepw > hbatt at point (i,j,k)= ', ji, jj, jk 2315 WRITE(numout,*) 'ERROR zgr_sco : gdepw > hbatt at point (i,j,k)= ', ji, jj, jk 2316 WRITE(numout,*) 'gdepw',gdepw_n(ji,jj,:) 2317 CALL ctl_stop( ctmp1 ) 2318 ENDIF 2319 END DO 2320 ! 2321 DO jk = 1, mbathy(ji,jj)-1 2322 ! and check it never exceeds the total depth 2323 IF( gdept_n(ji,jj,jk) > hbatt(ji,jj) ) THEN 2324 WRITE(ctmp1,*) 'ERROR zgr_sco : gdept > hbatt at point (i,j,k)= ', ji, jj, jk 2325 WRITE(numout,*) 'ERROR zgr_sco : gdept > hbatt at point (i,j,k)= ', ji, jj, jk 2326 WRITE(numout,*) 'gdept',gdept_n(ji,jj,:) 2327 CALL ctl_stop( ctmp1 ) 2328 ENDIF 2329 END DO 2330 ENDIF 2331 END DO 2332 END DO 2333 ! 2334 CALL wrk_dealloc( jpi, jpj, zenv, ztmp, zmsk, zri, zrj, zhbat , ztmpi1, ztmpi2, ztmpj1, ztmpj2 ) 2335 ! 2336 IF( nn_timing == 1 ) CALL timing_stop('zgr_sco') 2337 ! 2338 END SUBROUTINE zgr_sco 2339 2340 2341 SUBROUTINE s_sh94() 2342 !!---------------------------------------------------------------------- 2343 !! *** ROUTINE s_sh94 *** 2344 !! 2345 !! ** Purpose : stretch the s-coordinate system 2346 !! 2347 !! ** Method : s-coordinate stretch using the Song and Haidvogel 1994 2348 !! mixed S/sigma coordinate 2349 !! 2350 !! Reference : Song and Haidvogel 1994. 2351 !!---------------------------------------------------------------------- 2352 INTEGER :: ji, jj, jk ! dummy loop argument 2353 REAL(wp) :: zcoeft, zcoefw ! temporary scalars 2354 REAL(wp) :: ztmpu, ztmpv, ztmpf 2355 REAL(wp) :: ztmpu1, ztmpv1, ztmpf1 2356 ! 2357 REAL(wp), POINTER, DIMENSION(:,:,:) :: z_gsigw3, z_gsigt3, z_gsi3w3 2358 REAL(wp), POINTER, DIMENSION(:,:,:) :: z_esigt3, z_esigw3, z_esigtu3, z_esigtv3, z_esigtf3, z_esigwu3, z_esigwv3 2359 !!---------------------------------------------------------------------- 2360 2361 CALL wrk_alloc( jpi,jpj,jpk, z_gsigw3, z_gsigt3, z_gsi3w3 ) 2362 CALL wrk_alloc( jpi,jpj,jpk, z_esigt3, z_esigw3, z_esigtu3, z_esigtv3, z_esigtf3, z_esigwu3, z_esigwv3 ) 2363 2364 z_gsigw3 = 0._wp ; z_gsigt3 = 0._wp ; z_gsi3w3 = 0._wp 2365 z_esigt3 = 0._wp ; z_esigw3 = 0._wp 2366 z_esigtu3 = 0._wp ; z_esigtv3 = 0._wp ; z_esigtf3 = 0._wp 2367 z_esigwu3 = 0._wp ; z_esigwv3 = 0._wp 2368 ! 2369 DO ji = 1, jpi 2370 DO jj = 1, jpj 2371 ! 2372 IF( hbatt(ji,jj) > rn_hc ) THEN !deep water, stretched sigma 2373 DO jk = 1, jpk 2374 z_gsigw3(ji,jj,jk) = -fssig1( REAL(jk,wp)-0.5_wp, rn_bb ) 2375 z_gsigt3(ji,jj,jk) = -fssig1( REAL(jk,wp) , rn_bb ) 2376 END DO 2377 ELSE ! shallow water, uniform sigma 2378 DO jk = 1, jpk 2379 z_gsigw3(ji,jj,jk) = REAL(jk-1,wp) / REAL(jpk-1,wp) 2380 z_gsigt3(ji,jj,jk) = ( REAL(jk-1,wp) + 0.5_wp ) / REAL(jpk-1,wp) 2381 END DO 2382 ENDIF 2383 ! 2384 DO jk = 1, jpkm1 2385 z_esigt3(ji,jj,jk ) = z_gsigw3(ji,jj,jk+1) - z_gsigw3(ji,jj,jk) 2386 z_esigw3(ji,jj,jk+1) = z_gsigt3(ji,jj,jk+1) - z_gsigt3(ji,jj,jk) 2387 END DO 2388 z_esigw3(ji,jj,1 ) = 2._wp * ( z_gsigt3(ji,jj,1 ) - z_gsigw3(ji,jj,1 ) ) 2389 z_esigt3(ji,jj,jpk) = 2._wp * ( z_gsigt3(ji,jj,jpk) - z_gsigw3(ji,jj,jpk) ) 2390 ! 2391 ! Coefficients for vertical depth as the sum of e3w scale factors 2392 z_gsi3w3(ji,jj,1) = 0.5_wp * z_esigw3(ji,jj,1) 2393 DO jk = 2, jpk 2394 z_gsi3w3(ji,jj,jk) = z_gsi3w3(ji,jj,jk-1) + z_esigw3(ji,jj,jk) 2395 END DO 2396 ! 2397 DO jk = 1, jpk 2398 zcoeft = ( REAL(jk,wp) - 0.5_wp ) / REAL(jpkm1,wp) 2399 zcoefw = ( REAL(jk,wp) - 1.0_wp ) / REAL(jpkm1,wp) 2400 gdept_0(ji,jj,jk) = ( scosrf(ji,jj) + (hbatt(ji,jj)-rn_hc)*z_gsigt3(ji,jj,jk)+rn_hc*zcoeft ) 2401 gdepw_0(ji,jj,jk) = ( scosrf(ji,jj) + (hbatt(ji,jj)-rn_hc)*z_gsigw3(ji,jj,jk)+rn_hc*zcoefw ) 2402 gde3w_0(ji,jj,jk) = ( scosrf(ji,jj) + (hbatt(ji,jj)-rn_hc)*z_gsi3w3(ji,jj,jk)+rn_hc*zcoeft ) 2403 END DO 2404 ! 2405 END DO ! for all jj's 2406 END DO ! for all ji's 2407 2408 DO ji = 1, jpim1 2409 DO jj = 1, jpjm1 2410 ! extended for Wetting/Drying case 2411 ztmpu = hbatt(ji,jj)+hbatt(ji+1,jj) 2412 ztmpv = hbatt(ji,jj)+hbatt(ji,jj+1) 2413 ztmpf = hbatt(ji,jj)+hbatt(ji+1,jj)+hbatt(ji,jj+1)+hbatt(ji+1,jj+1) 2414 ztmpu1 = hbatt(ji,jj)*hbatt(ji+1,jj) 2415 ztmpv1 = hbatt(ji,jj)*hbatt(ji,jj+1) 2416 ztmpf1 = MIN(hbatt(ji,jj), hbatt(ji+1,jj), hbatt(ji,jj+1), hbatt(ji+1,jj+1)) * & 2417 & MAX(hbatt(ji,jj), hbatt(ji+1,jj), hbatt(ji,jj+1), hbatt(ji+1,jj+1)) 2418 DO jk = 1, jpk 2419 IF( ln_wd .AND. (ztmpu1 < 0._wp.OR.ABS(ztmpu) < rn_wdmin1) ) THEN 2420 z_esigtu3(ji,jj,jk) = 0.5_wp * ( z_esigt3(ji,jj,jk) + z_esigt3(ji+1,jj,jk) ) 2421 z_esigwu3(ji,jj,jk) = 0.5_wp * ( z_esigw3(ji,jj,jk) + z_esigw3(ji+1,jj,jk) ) 2422 ELSE 2423 z_esigtu3(ji,jj,jk) = ( hbatt(ji,jj)*z_esigt3(ji,jj,jk)+hbatt(ji+1,jj)*z_esigt3(ji+1,jj,jk) ) & 2424 & / ztmpu 2425 z_esigwu3(ji,jj,jk) = ( hbatt(ji,jj)*z_esigw3(ji,jj,jk)+hbatt(ji+1,jj)*z_esigw3(ji+1,jj,jk) ) & 2426 & / ztmpu 2427 END IF 2428 2429 IF( ln_wd .AND. (ztmpv1 < 0._wp.OR.ABS(ztmpv) < rn_wdmin1) ) THEN 2430 z_esigtv3(ji,jj,jk) = 0.5_wp * ( z_esigt3(ji,jj,jk) + z_esigt3(ji,jj+1,jk) ) 2431 z_esigwv3(ji,jj,jk) = 0.5_wp * ( z_esigw3(ji,jj,jk) + z_esigw3(ji,jj+1,jk) ) 2432 ELSE 2433 z_esigtv3(ji,jj,jk) = ( hbatt(ji,jj)*z_esigt3(ji,jj,jk)+hbatt(ji,jj+1)*z_esigt3(ji,jj+1,jk) ) & 2434 & / ztmpv 2435 z_esigwv3(ji,jj,jk) = ( hbatt(ji,jj)*z_esigw3(ji,jj,jk)+hbatt(ji,jj+1)*z_esigw3(ji,jj+1,jk) ) & 2436 & / ztmpv 2437 END IF 2438 2439 IF( ln_wd .AND. (ztmpf1 < 0._wp.OR.ABS(ztmpf) < rn_wdmin1) ) THEN 2440 z_esigtf3(ji,jj,jk) = 0.25_wp * ( z_esigt3(ji,jj ,jk) + z_esigt3(ji+1,jj ,jk) & 2441 & + z_esigt3(ji,jj+1,jk) + z_esigt3(ji+1,jj+1,jk) ) 2442 ELSE 2443 z_esigtf3(ji,jj,jk) = ( hbatt(ji ,jj )*z_esigt3(ji ,jj ,jk) & 2444 & + hbatt(ji+1,jj )*z_esigt3(ji+1,jj ,jk) & 2445 & + hbatt(ji ,jj+1)*z_esigt3(ji ,jj+1,jk) & 2446 & + hbatt(ji+1,jj+1)*z_esigt3(ji+1,jj+1,jk) ) / ztmpf 2447 END IF 2448 2449 ! 2450 e3t_0(ji,jj,jk) = ( (hbatt(ji,jj)-rn_hc)*z_esigt3 (ji,jj,jk) + rn_hc/REAL(jpkm1,wp) ) 2451 e3u_0(ji,jj,jk) = ( (hbatu(ji,jj)-rn_hc)*z_esigtu3(ji,jj,jk) + rn_hc/REAL(jpkm1,wp) ) 2452 e3v_0(ji,jj,jk) = ( (hbatv(ji,jj)-rn_hc)*z_esigtv3(ji,jj,jk) + rn_hc/REAL(jpkm1,wp) ) 2453 e3f_0(ji,jj,jk) = ( (hbatf(ji,jj)-rn_hc)*z_esigtf3(ji,jj,jk) + rn_hc/REAL(jpkm1,wp) ) 2454 ! 2455 e3w_0 (ji,jj,jk) = ( (hbatt(ji,jj)-rn_hc)*z_esigw3 (ji,jj,jk) + rn_hc/REAL(jpkm1,wp) ) 2456 e3uw_0(ji,jj,jk) = ( (hbatu(ji,jj)-rn_hc)*z_esigwu3(ji,jj,jk) + rn_hc/REAL(jpkm1,wp) ) 2457 e3vw_0(ji,jj,jk) = ( (hbatv(ji,jj)-rn_hc)*z_esigwv3(ji,jj,jk) + rn_hc/REAL(jpkm1,wp) ) 2458 END DO 2459 END DO 2460 END DO 2461 ! 2462 CALL wrk_dealloc( jpi,jpj,jpk, z_gsigw3, z_gsigt3, z_gsi3w3 ) 2463 CALL wrk_dealloc( jpi,jpj,jpk, z_esigt3, z_esigw3, z_esigtu3, z_esigtv3, z_esigtf3, z_esigwu3, z_esigwv3 ) 2464 ! 2465 END SUBROUTINE s_sh94 2466 2467 2468 SUBROUTINE s_sf12 2469 !!---------------------------------------------------------------------- 2470 !! *** ROUTINE s_sf12 *** 2471 !! 2472 !! ** Purpose : stretch the s-coordinate system 2473 !! 2474 !! ** Method : s-coordinate stretch using the Siddorn and Furner 2012? 2475 !! mixed S/sigma/Z coordinate 2476 !! 2477 !! This method allows the maintenance of fixed surface and or 2478 !! bottom cell resolutions (cf. geopotential coordinates) 2479 !! within an analytically derived stretched S-coordinate framework. 2480 !! 2481 !! 2482 !! Reference : Siddorn and Furner 2012 (submitted Ocean modelling). 2483 !!---------------------------------------------------------------------- 2484 INTEGER :: ji, jj, jk ! dummy loop argument 2485 REAL(wp) :: zsmth ! smoothing around critical depth 2486 REAL(wp) :: zzs, zzb ! Surface and bottom cell thickness in sigma space 2487 REAL(wp) :: ztmpu, ztmpv, ztmpf 2488 REAL(wp) :: ztmpu1, ztmpv1, ztmpf1 2489 ! 2490 REAL(wp), POINTER, DIMENSION(:,:,:) :: z_gsigw3, z_gsigt3, z_gsi3w3 2491 REAL(wp), POINTER, DIMENSION(:,:,:) :: z_esigt3, z_esigw3, z_esigtu3, z_esigtv3, z_esigtf3, z_esigwu3, z_esigwv3 2492 !!---------------------------------------------------------------------- 2493 ! 2494 CALL wrk_alloc( jpi, jpj, jpk, z_gsigw3, z_gsigt3, z_gsi3w3 ) 2495 CALL wrk_alloc( jpi, jpj, jpk, z_esigt3, z_esigw3, z_esigtu3, z_esigtv3, z_esigtf3, z_esigwu3, z_esigwv3 ) 2496 2497 z_gsigw3 = 0._wp ; z_gsigt3 = 0._wp ; z_gsi3w3 = 0._wp 2498 z_esigt3 = 0._wp ; z_esigw3 = 0._wp 2499 z_esigtu3 = 0._wp ; z_esigtv3 = 0._wp ; z_esigtf3 = 0._wp 2500 z_esigwu3 = 0._wp ; z_esigwv3 = 0._wp 2501 2502 DO ji = 1, jpi 2503 DO jj = 1, jpj 2504 2505 IF (hbatt(ji,jj)>rn_hc) THEN !deep water, stretched sigma 2506 2507 zzb = hbatt(ji,jj)*rn_zb_a + rn_zb_b ! this forces a linear bottom cell depth relationship with H,. 2508 ! could be changed by users but care must be taken to do so carefully 2509 zzb = 1.0_wp-(zzb/hbatt(ji,jj)) 2510 2511 zzs = rn_zs / hbatt(ji,jj) 2512 2513 IF (rn_efold /= 0.0_wp) THEN 2514 zsmth = tanh( (hbatt(ji,jj)- rn_hc ) / rn_efold ) 2515 ELSE 2516 zsmth = 1.0_wp 2517 ENDIF 2518 2519 DO jk = 1, jpk 2520 z_gsigw3(ji,jj,jk) = REAL(jk-1,wp) /REAL(jpk-1,wp) 2521 z_gsigt3(ji,jj,jk) = (REAL(jk-1,wp)+0.5_wp)/REAL(jpk-1,wp) 2522 ENDDO 2523 z_gsigw3(ji,jj,:) = fgamma( z_gsigw3(ji,jj,:), zzb, zzs, zsmth ) 2524 z_gsigt3(ji,jj,:) = fgamma( z_gsigt3(ji,jj,:), zzb, zzs, zsmth ) 2525 2526 ELSE IF (ln_sigcrit) THEN ! shallow water, uniform sigma 2527 2528 DO jk = 1, jpk 2529 z_gsigw3(ji,jj,jk) = REAL(jk-1,wp) /REAL(jpk-1,wp) 2530 z_gsigt3(ji,jj,jk) = (REAL(jk-1,wp)+0.5)/REAL(jpk-1,wp) 2531 END DO 2532 2533 ELSE ! shallow water, z coordinates 2534 2535 DO jk = 1, jpk 2536 z_gsigw3(ji,jj,jk) = REAL(jk-1,wp) /REAL(jpk-1,wp)*(rn_hc/hbatt(ji,jj)) 2537 z_gsigt3(ji,jj,jk) = (REAL(jk-1,wp)+0.5_wp)/REAL(jpk-1,wp)*(rn_hc/hbatt(ji,jj)) 2538 END DO 2539 2540 ENDIF 2541 2542 DO jk = 1, jpkm1 2543 z_esigt3(ji,jj,jk) = z_gsigw3(ji,jj,jk+1) - z_gsigw3(ji,jj,jk) 2544 z_esigw3(ji,jj,jk+1) = z_gsigt3(ji,jj,jk+1) - z_gsigt3(ji,jj,jk) 2545 END DO 2546 z_esigw3(ji,jj,1 ) = 2.0_wp * (z_gsigt3(ji,jj,1 ) - z_gsigw3(ji,jj,1 )) 2547 z_esigt3(ji,jj,jpk) = 2.0_wp * (z_gsigt3(ji,jj,jpk) - z_gsigw3(ji,jj,jpk)) 2548 2549 ! Coefficients for vertical depth as the sum of e3w scale factors 2550 z_gsi3w3(ji,jj,1) = 0.5 * z_esigw3(ji,jj,1) 2551 DO jk = 2, jpk 2552 z_gsi3w3(ji,jj,jk) = z_gsi3w3(ji,jj,jk-1) + z_esigw3(ji,jj,jk) 2553 END DO 2554 2555 DO jk = 1, jpk 2556 gdept_0(ji,jj,jk) = (scosrf(ji,jj)+hbatt(ji,jj))*z_gsigt3(ji,jj,jk) 2557 gdepw_0(ji,jj,jk) = (scosrf(ji,jj)+hbatt(ji,jj))*z_gsigw3(ji,jj,jk) 2558 gde3w_0(ji,jj,jk) = (scosrf(ji,jj)+hbatt(ji,jj))*z_gsi3w3(ji,jj,jk) 2559 END DO 2560 2561 ENDDO ! for all jj's 2562 ENDDO ! for all ji's 2563 2564 DO ji=1,jpi-1 2565 DO jj=1,jpj-1 2566 2567 ! extend to suit for Wetting/Drying case 2568 ztmpu = hbatt(ji,jj)+hbatt(ji+1,jj) 2569 ztmpv = hbatt(ji,jj)+hbatt(ji,jj+1) 2570 ztmpf = hbatt(ji,jj)+hbatt(ji+1,jj)+hbatt(ji,jj+1)+hbatt(ji+1,jj+1) 2571 ztmpu1 = hbatt(ji,jj)*hbatt(ji+1,jj) 2572 ztmpv1 = hbatt(ji,jj)*hbatt(ji,jj+1) 2573 ztmpf1 = MIN(hbatt(ji,jj), hbatt(ji+1,jj), hbatt(ji,jj+1), hbatt(ji+1,jj+1)) * & 2574 & MAX(hbatt(ji,jj), hbatt(ji+1,jj), hbatt(ji,jj+1), hbatt(ji+1,jj+1)) 2575 DO jk = 1, jpk 2576 IF( ln_wd .AND. (ztmpu1 < 0._wp.OR.ABS(ztmpu) < rn_wdmin1) ) THEN 2577 z_esigtu3(ji,jj,jk) = 0.5_wp * ( z_esigt3(ji,jj,jk) + z_esigt3(ji+1,jj,jk) ) 2578 z_esigwu3(ji,jj,jk) = 0.5_wp * ( z_esigw3(ji,jj,jk) + z_esigw3(ji+1,jj,jk) ) 2579 ELSE 2580 z_esigtu3(ji,jj,jk) = ( hbatt(ji,jj)*z_esigt3(ji,jj,jk)+hbatt(ji+1,jj)*z_esigt3(ji+1,jj,jk) ) & 2581 & / ztmpu 2582 z_esigwu3(ji,jj,jk) = ( hbatt(ji,jj)*z_esigw3(ji,jj,jk)+hbatt(ji+1,jj)*z_esigw3(ji+1,jj,jk) ) & 2583 & / ztmpu 2584 END IF 2585 2586 IF( ln_wd .AND. (ztmpv1 < 0._wp.OR.ABS(ztmpv) < rn_wdmin1) ) THEN 2587 z_esigtv3(ji,jj,jk) = 0.5_wp * ( z_esigt3(ji,jj,jk) + z_esigt3(ji,jj+1,jk) ) 2588 z_esigwv3(ji,jj,jk) = 0.5_wp * ( z_esigw3(ji,jj,jk) + z_esigw3(ji,jj+1,jk) ) 2589 ELSE 2590 z_esigtv3(ji,jj,jk) = ( hbatt(ji,jj)*z_esigt3(ji,jj,jk)+hbatt(ji,jj+1)*z_esigt3(ji,jj+1,jk) ) & 2591 & / ztmpv 2592 z_esigwv3(ji,jj,jk) = ( hbatt(ji,jj)*z_esigw3(ji,jj,jk)+hbatt(ji,jj+1)*z_esigw3(ji,jj+1,jk) ) & 2593 & / ztmpv 2594 END IF 2595 2596 IF( ln_wd .AND. (ztmpf1 < 0._wp.OR.ABS(ztmpf) < rn_wdmin1) ) THEN 2597 z_esigtf3(ji,jj,jk) = 0.25_wp * ( z_esigt3(ji,jj,jk) + z_esigt3(ji+1,jj,jk) & 2598 & + z_esigt3(ji,jj+1,jk) + z_esigt3(ji+1,jj+1,jk) ) 2599 ELSE 2600 z_esigtf3(ji,jj,jk) = ( hbatt(ji ,jj )*z_esigt3(ji ,jj ,jk) & 2601 & + hbatt(ji+1,jj )*z_esigt3(ji+1,jj ,jk) & 2602 & + hbatt(ji ,jj+1)*z_esigt3(ji ,jj+1,jk) & 2603 & + hbatt(ji+1,jj+1)*z_esigt3(ji+1,jj+1,jk) ) / ztmpf 2604 END IF 2605 2606 ! Code prior to wetting and drying option (for reference) 2607 !z_esigtu3(ji,jj,jk) = ( hbatt(ji,jj)*z_esigt3(ji,jj,jk)+hbatt(ji+1,jj)*z_esigt3(ji+1,jj,jk) ) & 2608 ! /( hbatt(ji,jj)+hbatt(ji+1,jj) ) 2609 ! 2610 !z_esigwu3(ji,jj,jk) = ( hbatt(ji,jj)*z_esigw3(ji,jj,jk)+hbatt(ji+1,jj)*z_esigw3(ji+1,jj,jk) ) & 2611 ! /( hbatt(ji,jj)+hbatt(ji+1,jj) ) 2612 ! 2613 !z_esigtv3(ji,jj,jk) = ( hbatt(ji,jj)*z_esigt3(ji,jj,jk)+hbatt(ji,jj+1)*z_esigt3(ji,jj+1,jk) ) & 2614 ! /( hbatt(ji,jj)+hbatt(ji,jj+1) ) 2615 ! 2616 !z_esigwv3(ji,jj,jk) = ( hbatt(ji,jj)*z_esigw3(ji,jj,jk)+hbatt(ji,jj+1)*z_esigw3(ji,jj+1,jk) ) & 2617 ! /( hbatt(ji,jj)+hbatt(ji,jj+1) ) 2618 ! 2619 !z_esigtf3(ji,jj,jk) = ( hbatt(ji ,jj )*z_esigt3(ji ,jj ,jk) & 2620 ! & +hbatt(ji+1,jj )*z_esigt3(ji+1,jj ,jk) & 2621 ! +hbatt(ji ,jj+1)*z_esigt3(ji ,jj+1,jk) & 2622 ! & +hbatt(ji+1,jj+1)*z_esigt3(ji+1,jj+1,jk) ) & 2623 ! /( hbatt(ji ,jj )+hbatt(ji+1,jj)+hbatt(ji,jj+1)+hbatt(ji+1,jj+1) ) 2624 2625 e3t_0(ji,jj,jk)=(scosrf(ji,jj)+hbatt(ji,jj))*z_esigt3(ji,jj,jk) 2626 e3u_0(ji,jj,jk)=(scosrf(ji,jj)+hbatu(ji,jj))*z_esigtu3(ji,jj,jk) 2627 e3v_0(ji,jj,jk)=(scosrf(ji,jj)+hbatv(ji,jj))*z_esigtv3(ji,jj,jk) 2628 e3f_0(ji,jj,jk)=(scosrf(ji,jj)+hbatf(ji,jj))*z_esigtf3(ji,jj,jk) 2629 ! 2630 e3w_0 (ji,jj,jk)=hbatt(ji,jj)*z_esigw3(ji,jj,jk) 2631 e3uw_0(ji,jj,jk)=hbatu(ji,jj)*z_esigwu3(ji,jj,jk) 2632 e3vw_0(ji,jj,jk)=hbatv(ji,jj)*z_esigwv3(ji,jj,jk) 2633 END DO 2634 2635 ENDDO 2636 ENDDO 2637 ! 2638 CALL lbc_lnk(e3t_0 ,'T',1.) ; CALL lbc_lnk(e3u_0 ,'T',1.) 2639 CALL lbc_lnk(e3v_0 ,'T',1.) ; CALL lbc_lnk(e3f_0 ,'T',1.) 2640 CALL lbc_lnk(e3w_0 ,'T',1.) 2641 CALL lbc_lnk(e3uw_0,'T',1.) ; CALL lbc_lnk(e3vw_0,'T',1.) 2642 ! 2643 CALL wrk_dealloc( jpi,jpj,jpk, z_gsigw3, z_gsigt3, z_gsi3w3 ) 2644 CALL wrk_dealloc( jpi,jpj,jpk, z_esigt3, z_esigw3, z_esigtu3, z_esigtv3, z_esigtf3, z_esigwu3, z_esigwv3 ) 2645 ! 2646 END SUBROUTINE s_sf12 2647 2648 2649 SUBROUTINE s_tanh() 2650 !!---------------------------------------------------------------------- 2651 !! *** ROUTINE s_tanh*** 2652 !! 2653 !! ** Purpose : stretch the s-coordinate system 2654 !! 2655 !! ** Method : s-coordinate stretch 2656 !! 2657 !! Reference : Madec, Lott, Delecluse and Crepon, 1996. JPO, 26, 1393-1408. 2658 !!---------------------------------------------------------------------- 2659 INTEGER :: ji, jj, jk ! dummy loop argument 2660 REAL(wp) :: zcoeft, zcoefw ! temporary scalars 2661 REAL(wp), POINTER, DIMENSION(:) :: z_gsigw, z_gsigt, z_gsi3w 2662 REAL(wp), POINTER, DIMENSION(:) :: z_esigt, z_esigw 2663 !!---------------------------------------------------------------------- 2664 2665 CALL wrk_alloc( jpk, z_gsigw, z_gsigt, z_gsi3w ) 2666 CALL wrk_alloc( jpk, z_esigt, z_esigw ) 2667 2668 z_gsigw = 0._wp ; z_gsigt = 0._wp ; z_gsi3w = 0._wp 2669 z_esigt = 0._wp ; z_esigw = 0._wp 2670 2671 DO jk = 1, jpk 2672 z_gsigw(jk) = -fssig( REAL(jk,wp)-0.5_wp ) 2673 z_gsigt(jk) = -fssig( REAL(jk,wp) ) 2674 END DO 2675 IF( nprint == 1 .AND. lwp ) WRITE(numout,*) 'z_gsigw 1 jpk ', z_gsigw(1), z_gsigw(jpk) 2676 ! 2677 ! Coefficients for vertical scale factors at w-, t- levels 2678 !!gm bug : define it from analytical function, not like juste bellow.... 2679 !!gm or betteroffer the 2 possibilities.... 2680 DO jk = 1, jpkm1 2681 z_esigt(jk ) = z_gsigw(jk+1) - z_gsigw(jk) 2682 z_esigw(jk+1) = z_gsigt(jk+1) - z_gsigt(jk) 2683 END DO 2684 z_esigw( 1 ) = 2._wp * ( z_gsigt(1 ) - z_gsigw(1 ) ) 2685 z_esigt(jpk) = 2._wp * ( z_gsigt(jpk) - z_gsigw(jpk) ) 2686 ! 2687 ! Coefficients for vertical depth as the sum of e3w scale factors 2688 z_gsi3w(1) = 0.5_wp * z_esigw(1) 2689 DO jk = 2, jpk 2690 z_gsi3w(jk) = z_gsi3w(jk-1) + z_esigw(jk) 2691 END DO 2692 !!gm: depuw, depvw can be suppressed (modif in ldfslp) and depw=dep3w can be set (save 3 3D arrays) 2693 DO jk = 1, jpk 2694 zcoeft = ( REAL(jk,wp) - 0.5_wp ) / REAL(jpkm1,wp) 2695 zcoefw = ( REAL(jk,wp) - 1.0_wp ) / REAL(jpkm1,wp) 2696 gdept_0(:,:,jk) = ( scosrf(:,:) + (hbatt(:,:)-hift(:,:))*z_gsigt(jk) + hift(:,:)*zcoeft ) 2697 gdepw_0(:,:,jk) = ( scosrf(:,:) + (hbatt(:,:)-hift(:,:))*z_gsigw(jk) + hift(:,:)*zcoefw ) 2698 gde3w_0(:,:,jk) = ( scosrf(:,:) + (hbatt(:,:)-hift(:,:))*z_gsi3w(jk) + hift(:,:)*zcoeft ) 2699 END DO 2700 !!gm: e3uw, e3vw can be suppressed (modif in dynzdf, dynzdf_iso, zdfbfr) (save 2 3D arrays) 2701 DO jj = 1, jpj 2702 DO ji = 1, jpi 2703 DO jk = 1, jpk 2704 e3t_0(ji,jj,jk) = ( (hbatt(ji,jj)-hift(ji,jj))*z_esigt(jk) + hift(ji,jj)/REAL(jpkm1,wp) ) 2705 e3u_0(ji,jj,jk) = ( (hbatu(ji,jj)-hifu(ji,jj))*z_esigt(jk) + hifu(ji,jj)/REAL(jpkm1,wp) ) 2706 e3v_0(ji,jj,jk) = ( (hbatv(ji,jj)-hifv(ji,jj))*z_esigt(jk) + hifv(ji,jj)/REAL(jpkm1,wp) ) 2707 e3f_0(ji,jj,jk) = ( (hbatf(ji,jj)-hiff(ji,jj))*z_esigt(jk) + hiff(ji,jj)/REAL(jpkm1,wp) ) 2708 ! 2709 e3w_0 (ji,jj,jk) = ( (hbatt(ji,jj)-hift(ji,jj))*z_esigw(jk) + hift(ji,jj)/REAL(jpkm1,wp) ) 2710 e3uw_0(ji,jj,jk) = ( (hbatu(ji,jj)-hifu(ji,jj))*z_esigw(jk) + hifu(ji,jj)/REAL(jpkm1,wp) ) 2711 e3vw_0(ji,jj,jk) = ( (hbatv(ji,jj)-hifv(ji,jj))*z_esigw(jk) + hifv(ji,jj)/REAL(jpkm1,wp) ) 2712 END DO 2713 END DO 2714 END DO 2715 ! 2716 CALL wrk_dealloc( jpk, z_gsigw, z_gsigt, z_gsi3w ) 2717 CALL wrk_dealloc( jpk, z_esigt, z_esigw ) 2718 ! 2719 END SUBROUTINE s_tanh 2720 2721 2722 FUNCTION fssig( pk ) RESULT( pf ) 2723 !!---------------------------------------------------------------------- 2724 !! *** ROUTINE fssig *** 2725 !! 2726 !! ** Purpose : provide the analytical function in s-coordinate 2727 !! 2728 !! ** Method : the function provide the non-dimensional position of 2729 !! T and W (i.e. between 0 and 1) 2730 !! T-points at integer values (between 1 and jpk) 2731 !! W-points at integer values - 1/2 (between 0.5 and jpk-0.5) 2732 !!---------------------------------------------------------------------- 2733 REAL(wp), INTENT(in) :: pk ! continuous "k" coordinate 2734 REAL(wp) :: pf ! sigma value 2735 !!---------------------------------------------------------------------- 2736 ! 2737 pf = ( TANH( rn_theta * ( -(pk-0.5_wp) / REAL(jpkm1) + rn_thetb ) ) & 2738 & - TANH( rn_thetb * rn_theta ) ) & 2739 & * ( COSH( rn_theta ) & 2740 & + COSH( rn_theta * ( 2._wp * rn_thetb - 1._wp ) ) ) & 2741 & / ( 2._wp * SINH( rn_theta ) ) 2742 ! 2743 END FUNCTION fssig 2744 2745 2746 FUNCTION fssig1( pk1, pbb ) RESULT( pf1 ) 2747 !!---------------------------------------------------------------------- 2748 !! *** ROUTINE fssig1 *** 2749 !! 2750 !! ** Purpose : provide the Song and Haidvogel version of the analytical function in s-coordinate 2751 !! 2752 !! ** Method : the function provides the non-dimensional position of 2753 !! T and W (i.e. between 0 and 1) 2754 !! T-points at integer values (between 1 and jpk) 2755 !! W-points at integer values - 1/2 (between 0.5 and jpk-0.5) 2756 !!---------------------------------------------------------------------- 2757 REAL(wp), INTENT(in) :: pk1 ! continuous "k" coordinate 2758 REAL(wp), INTENT(in) :: pbb ! Stretching coefficient 2759 REAL(wp) :: pf1 ! sigma value 2760 !!---------------------------------------------------------------------- 2761 ! 2762 IF ( rn_theta == 0 ) then ! uniform sigma 2763 pf1 = - ( pk1 - 0.5_wp ) / REAL( jpkm1 ) 2764 ELSE ! stretched sigma 2765 pf1 = ( 1._wp - pbb ) * ( SINH( rn_theta*(-(pk1-0.5_wp)/REAL(jpkm1)) ) ) / SINH( rn_theta ) & 2766 & + pbb * ( (TANH( rn_theta*( (-(pk1-0.5_wp)/REAL(jpkm1)) + 0.5_wp) ) - TANH( 0.5_wp * rn_theta ) ) & 2767 & / ( 2._wp * TANH( 0.5_wp * rn_theta ) ) ) 2768 ENDIF 2769 ! 2770 END FUNCTION fssig1 2771 2772 2773 FUNCTION fgamma( pk1, pzb, pzs, psmth) RESULT( p_gamma ) 2774 !!---------------------------------------------------------------------- 2775 !! *** ROUTINE fgamma *** 2776 !! 2777 !! ** Purpose : provide analytical function for the s-coordinate 2778 !! 2779 !! ** Method : the function provides the non-dimensional position of 2780 !! T and W (i.e. between 0 and 1) 2781 !! T-points at integer values (between 1 and jpk) 2782 !! W-points at integer values - 1/2 (between 0.5 and jpk-0.5) 2783 !! 2784 !! This method allows the maintenance of fixed surface and or 2785 !! bottom cell resolutions (cf. geopotential coordinates) 2786 !! within an analytically derived stretched S-coordinate framework. 2787 !! 2788 !! Reference : Siddorn and Furner, in prep 2789 !!---------------------------------------------------------------------- 2790 REAL(wp), INTENT(in ) :: pk1(jpk) ! continuous "k" coordinate 2791 REAL(wp) :: p_gamma(jpk) ! stretched coordinate 2792 REAL(wp), INTENT(in ) :: pzb ! Bottom box depth 2793 REAL(wp), INTENT(in ) :: pzs ! surface box depth 2794 REAL(wp), INTENT(in ) :: psmth ! Smoothing parameter 2795 ! 2796 INTEGER :: jk ! dummy loop index 2797 REAL(wp) :: za1,za2,za3 ! local scalar 2798 REAL(wp) :: zn1,zn2 ! - - 2799 REAL(wp) :: za,zb,zx ! - - 2800 !!---------------------------------------------------------------------- 2801 ! 2802 zn1 = 1._wp / REAL( jpkm1, wp ) 2803 zn2 = 1._wp - zn1 2804 ! 2805 za1 = (rn_alpha+2.0_wp)*zn1**(rn_alpha+1.0_wp)-(rn_alpha+1.0_wp)*zn1**(rn_alpha+2.0_wp) 2806 za2 = (rn_alpha+2.0_wp)*zn2**(rn_alpha+1.0_wp)-(rn_alpha+1.0_wp)*zn2**(rn_alpha+2.0_wp) 2807 za3 = (zn2**3.0_wp - za2)/( zn1**3.0_wp - za1) 2808 ! 2809 za = pzb - za3*(pzs-za1)-za2 2810 za = za/( zn2-0.5_wp*(za2+zn2**2.0_wp) - za3*(zn1-0.5_wp*(za1+zn1**2.0_wp) ) ) 2811 zb = (pzs - za1 - za*( zn1-0.5_wp*(za1+zn1**2.0_wp ) ) ) / (zn1**3.0_wp - za1) 2812 zx = 1.0_wp-za/2.0_wp-zb 2813 ! 2814 DO jk = 1, jpk 2815 p_gamma(jk) = za*(pk1(jk)*(1.0_wp-pk1(jk)/2.0_wp))+zb*pk1(jk)**3.0_wp + & 2816 & zx*( (rn_alpha+2.0_wp)*pk1(jk)**(rn_alpha+1.0_wp)- & 2817 & (rn_alpha+1.0_wp)*pk1(jk)**(rn_alpha+2.0_wp) ) 2818 p_gamma(jk) = p_gamma(jk)*psmth+pk1(jk)*(1.0_wp-psmth) 2819 END DO 2820 ! 2821 END FUNCTION fgamma 322 END SUBROUTINE zgr_top_bot 2822 323 2823 324 !!====================================================================== -
branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/DOM/dtatsd.F90
r6140 r7277 155 155 ! 156 156 ! 157 !!gm This should be removed from the code ===>>>> T & S files has to be changed 158 ! 157 159 ! !== ORCA_R2 configuration and T & S damping ==! 158 IF( c p_cfg == "orca" .AND. jp_cfg == 2 .AND. ln_tsd_tradmp ) THEN ! some hand made alterations160 IF( cn_cfg == "orca" .AND. nn_cfg == 2 .AND. ln_tsd_tradmp ) THEN ! some hand made alterations 159 161 ! 160 162 ij0 = 101 ; ij1 = 109 ! Reduced T & S in the Alboran Sea … … 178 180 sf_tsd(jp_tem)%fnow( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) , 14:20 ) = 6.0_wp 179 181 ENDIF 182 !!gm end 180 183 ! 181 184 ptsd(:,:,:,jp_tem) = sf_tsd(jp_tem)%fnow(:,:,:) ! NO mask -
branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/DOM/iscplhsb.F90
r6140 r7277 1 1 MODULE iscplhsb 2 2 !!====================================================================== 3 !! *** MODULE iscplhsb ***3 !! *** MODULE iscplhsb *** 4 4 !! Ocean forcing: ice sheet/ocean coupling (conservation) 5 5 !!===================================================================== -
branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/DOM/iscplini.F90
r6140 r7277 1 1 MODULE iscplini 2 2 !!====================================================================== 3 !! *** MODULE sbciscpl ***3 !! *** MODULE sbciscpl *** 4 4 !! Ocean forcing: river runoff 5 5 !!===================================================================== -
branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/DOM/iscplrst.F90
r6140 r7277 1 1 MODULE iscplrst 2 2 !!====================================================================== 3 !! *** MODULE iscplrst ***3 !! *** MODULE iscplrst *** 4 4 !! Ocean forcing: update the restart file in case of ice sheet/ocean coupling 5 5 !!===================================================================== … … 50 50 !!---------------------------------------------------------------------- 51 51 INTEGER :: inum0 52 REAL(wp), DIMENSION(:,: ), POINTER :: zsmask_b53 REAL(wp), DIMENSION(:,:,:), POINTER :: ztmask_b, zumask_b, zvmask_b54 REAL(wp), DIMENSION(:,:,:), POINTER :: ze3t_b , ze3u_b , ze3v_b55 REAL(wp), DIMENSION(:,:,:), POINTER :: zdepw_b52 REAL(wp), DIMENSION(:,: ), POINTER :: zsmask_b 53 REAL(wp), DIMENSION(:,:,:), POINTER :: ztmask_b, zumask_b, zvmask_b 54 REAL(wp), DIMENSION(:,:,:), POINTER :: ze3t_b , ze3u_b , ze3v_b 55 REAL(wp), DIMENSION(:,:,:), POINTER :: zdepw_b 56 56 CHARACTER(20) :: cfile 57 57 !!---------------------------------------------------------------------- 58 58 59 CALL wrk_alloc(jpi,jpj,jpk, ztmask_b, zumask_b, zvmask_b) ! mask before60 CALL wrk_alloc(jpi,jpj,jpk, ze3t_b , ze3u_b , ze3v_b ) ! e3 before61 CALL wrk_alloc(jpi,jpj,jpk, zdepw_b )62 CALL wrk_alloc(jpi,jpj, zsmask_b )59 CALL wrk_alloc(jpi,jpj,jpk, ztmask_b, zumask_b, zvmask_b) ! mask before 60 CALL wrk_alloc(jpi,jpj,jpk, ze3t_b , ze3u_b , ze3v_b ) ! e3 before 61 CALL wrk_alloc(jpi,jpj,jpk, zdepw_b ) 62 CALL wrk_alloc(jpi,jpj, zsmask_b ) 63 63 64 64 … … 86 86 87 87 !! print mesh/mask 88 IF( n msh /= 0 .AND. ln_iscpl ) CALL dom_wri ! Create a domain file88 IF( nn_msh /= 0 .AND. ln_iscpl ) CALL dom_wri ! Create a domain file 89 89 90 90 IF ( ln_hsb ) THEN … … 98 98 END IF 99 99 100 CALL wrk_dealloc(jpi,jpj,jpk, ztmask_b,zumask_b,zvmask_b )101 CALL wrk_dealloc(jpi,jpj,jpk, ze3t_b ,ze3u_b ,ze3v_b )102 CALL wrk_dealloc(jpi,jpj,jpk, zdepw_b )103 CALL wrk_dealloc(jpi,jpj, zsmask_b )100 CALL wrk_dealloc(jpi,jpj,jpk, ztmask_b,zumask_b,zvmask_b ) 101 CALL wrk_dealloc(jpi,jpj,jpk, ze3t_b ,ze3u_b ,ze3v_b ) 102 CALL wrk_dealloc(jpi,jpj,jpk, zdepw_b ) 103 CALL wrk_dealloc(jpi,jpj, zsmask_b ) 104 104 105 105 !! next step is an euler time step … … 108 108 !! set _b and _n variables equal 109 109 tsb (:,:,:,:) = tsn (:,:,:,:) 110 ub (:,:,: ) = un (:,:,:)111 vb (:,:,: ) = vn (:,:,:)112 sshb(:,: )= sshn(:,:)110 ub (:,:,:) = un (:,:,:) 111 vb (:,:,:) = vn (:,:,:) 112 sshb(:,:) = sshn(:,:) 113 113 114 114 !! set _b and _n vertical scale factor equal … … 117 117 e3v_b (:,:,:) = e3v_n (:,:,:) 118 118 119 e3uw_b (:,:,:) = e3uw_n(:,:,:)120 e3vw_b (:,:,:) = e3vw_n(:,:,:)121 gdept_b(:,:,:) 119 e3uw_b (:,:,:) = e3uw_n (:,:,:) 120 e3vw_b (:,:,:) = e3vw_n (:,:,:) 121 gdept_b(:,:,:) = gdept_n(:,:,:) 122 122 gdepw_b(:,:,:) = gdepw_n(:,:,:) 123 hu_b (:,:) = hu_n(:,:)124 hv_b (:,:) = hv_n(:,:)125 r1_hu_b(:,:) = r1_hu_n(:,:)126 r1_hv_b(:,:) = r1_hv_n(:,:)123 hu_b (:,:) = hu_n (:,:) 124 hv_b (:,:) = hv_n (:,:) 125 r1_hu_b(:,:) = r1_hu_n(:,:) 126 r1_hv_b(:,:) = r1_hv_n(:,:) 127 127 ! 128 128 END SUBROUTINE iscpl_stp 129 129 130 130 131 SUBROUTINE iscpl_rst_interpol (ptmask_b, pumask_b, pvmask_b, psmask_b, pe3t_b, pe3u_b, pe3v_b, pdepw_b) 131 132 !!---------------------------------------------------------------------- … … 436 437 CALL wrk_dealloc(jpi,jpj, zbub , zbvb , zbun , zbvn ) 437 438 CALL wrk_dealloc(jpi,jpj, zssh0 , zssh1 , zhu1 , zhv1 ) 438 439 ! 439 440 END SUBROUTINE iscpl_rst_interpol 440 441 442 !!====================================================================== 441 443 END MODULE iscplrst -
branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/DOM/istate.F90
r6140 r7277 14 14 !! 3.3 ! 2010-10 (C. Ethe) merge TRC-TRA 15 15 !! 3.4 ! 2011-04 (G. Madec) Merge of dtatem and dtasal & suppression of tb,tn/sb,sn 16 !! 3.7 ! 2016-04 (S. Flavoni) introduce user defined initial state 16 17 !!---------------------------------------------------------------------- 17 18 18 19 !!---------------------------------------------------------------------- 19 20 !! istate_init : initial state setting 20 !! istate_tem : analytical profile for initial Temperature21 !! istate_sal : analytical profile for initial Salinity22 !! istate_eel : initial state setting of EEL R5 configuration23 !! istate_gyre : initial state setting of GYRE configuration24 21 !! istate_uvg : initial velocity in geostropic balance 25 22 !!---------------------------------------------------------------------- 26 USE oce ! ocean dynamics and active tracers 27 USE dom_oce ! ocean space and time domain 28 USE c1d ! 1D vertical configuration 29 USE daymod ! calendar 30 USE eosbn2 ! eq. of state, Brunt Vaisala frequency (eos routine) 31 USE ldftra ! lateral physics: ocean active tracers 32 USE zdf_oce ! ocean vertical physics 33 USE phycst ! physical constants 34 USE dtatsd ! data temperature and salinity (dta_tsd routine) 35 USE dtauvd ! data: U & V current (dta_uvd routine) 23 USE oce ! ocean dynamics and active tracers 24 USE dom_oce ! ocean space and time domain 25 USE daymod ! calendar 26 USE divhor ! horizontal divergence (div_hor routine) 27 USE dtatsd ! data temperature and salinity (dta_tsd routine) 28 USE dtauvd ! data: U & V current (dta_uvd routine) 36 29 USE domvvl ! varying vertical mesh 37 30 USE iscplrst ! ice sheet coupling 31 USE usrdef_istate ! User defined initial state 38 32 ! 39 33 USE in_out_manager ! I/O manager … … 70 64 IF( nn_timing == 1 ) CALL timing_start('istate_init') 71 65 ! 66 IF(lwp) WRITE(numout,*) 67 IF(lwp) WRITE(numout,*) 'istate_init : Initialization of the dynamics and tracers' 68 IF(lwp) WRITE(numout,*) '~~~~~~~~~~~' 72 69 73 IF(lwp) WRITE(numout,*) 74 IF(lwp) WRITE(numout,*) 'istate_ini : Initialization of the dynamics and tracers' 75 IF(lwp) WRITE(numout,*) '~~~~~~~~~~' 76 70 !!gm Why not include in the first call of dta_tsd ? 71 !!gm probably associated with the use of internal damping... 77 72 CALL dta_tsd_init ! Initialisation of T & S input data 78 IF( lk_c1d ) CALL dta_uvd_init ! Initialization of U & V input data 73 !!gm to be moved in usrdef of C1D case 74 ! IF( lk_c1d ) CALL dta_uvd_init ! Initialization of U & V input data 75 !!gm 79 76 80 77 rhd (:,:,: ) = 0._wp ; rhop (:,:,: ) = 0._wp ! set one for all to 0 at level jpk … … 86 83 ! ! ------------------- 87 84 CALL rst_read ! Read the restart file 88 IF (ln_iscpl) CALL iscpl_stp ! extra loate restart to wet and dry85 IF (ln_iscpl) CALL iscpl_stp ! extrapolate restart to wet and dry 89 86 CALL day_init ! model calendar (using both namelist and restart infos) 90 ELSE91 !! Start from rest87 ! 88 ELSE ! Start from rest 92 89 ! ! --------------- 93 numror = 0 ! define numror = 0 -> no restart file to read 94 neuler = 0 ! Set time-step indicator at nit000 (euler forward) 95 CALL day_init ! model calendar (using both namelist and restart infos) 96 ! ! Initialization of ocean to zero 97 ! before fields ! now fields 98 sshb (:,:) = 0._wp ; sshn (:,:) = 0._wp 99 ub (:,:,:) = 0._wp ; un (:,:,:) = 0._wp 100 vb (:,:,:) = 0._wp ; vn (:,:,:) = 0._wp 101 hdivn(:,:,:) = 0._wp 90 numror = 0 ! define numror = 0 -> no restart file to read 91 neuler = 0 ! Set time-step indicator at nit000 (euler forward) 92 CALL day_init ! model calendar (using both namelist and restart infos) 93 ! ! Initialization of ocean to zero 102 94 ! 103 IF( cp_cfg == 'eel' ) THEN 104 CALL istate_eel ! EEL configuration : start from pre-defined U,V T-S fields 105 ELSEIF( cp_cfg == 'gyre' ) THEN 106 CALL istate_gyre ! GYRE configuration : start from pre-defined T-S fields 107 ELSE ! Initial T-S, U-V fields read in files 108 IF ( ln_tsd_init ) THEN ! read 3D T and S data at nit000 109 CALL dta_tsd( nit000, tsb ) 110 tsn(:,:,:,:) = tsb(:,:,:,:) 111 ! 112 ELSE ! Initial T-S fields defined analytically 113 CALL istate_t_s 114 ENDIF 115 IF ( ln_uvd_init .AND. lk_c1d ) THEN ! read 3D U and V data at nit000 116 CALL wrk_alloc( jpi,jpj,jpk,2, zuvd ) 117 CALL dta_uvd( nit000, zuvd ) 118 ub(:,:,:) = zuvd(:,:,:,1) ; un(:,:,:) = ub(:,:,:) 119 vb(:,:,:) = zuvd(:,:,:,2) ; vn(:,:,:) = vb(:,:,:) 120 CALL wrk_dealloc( jpi,jpj,jpk,2, zuvd ) 121 ENDIF 95 IF( ln_tsd_init ) THEN 96 CALL dta_tsd( nit000, tsb ) ! read 3D T and S data at nit000 97 ! 98 sshb(:,:) = 0._wp ! set the ocean at rest 99 ub (:,:,:) = 0._wp 100 vb (:,:,:) = 0._wp 101 ! 102 ELSE ! user defined initial T and S 103 CALL usr_def_istate( gdept_b, tmask, tsb, ub, vb, sshb ) 122 104 ENDIF 105 tsn (:,:,:,:) = tsb (:,:,:,:) ! set now values from to before ones 106 sshn (:,:) = sshb(:,:) 107 un (:,:,:) = ub (:,:,:) 108 vn (:,:,:) = vb (:,:,:) 109 hdivn(:,:,jpk) = 0._wp ! bottom divergence set one for 0 to zero at jpk level 110 CALL div_hor( 0 ) ! compute interior hdivn value 111 !!gm hdivn(:,:,:) = 0._wp 112 113 !!gm POTENTIAL BUG : 114 !!gm ISSUE : if sshb /= 0 then, in non linear free surface, the e3._n, e3._b should be recomputed 115 !! as well as gdept and gdepw.... !!!!! 116 !! ===>>>> probably a call to domvvl initialisation here.... 117 118 119 ! 120 !!gm to be moved in usrdef of C1D case 121 ! IF ( ln_uvd_init .AND. lk_c1d ) THEN ! read 3D U and V data at nit000 122 ! CALL wrk_alloc( jpi,jpj,jpk,2, zuvd ) 123 ! CALL dta_uvd( nit000, zuvd ) 124 ! ub(:,:,:) = zuvd(:,:,:,1) ; un(:,:,:) = ub(:,:,:) 125 ! vb(:,:,:) = zuvd(:,:,:,2) ; vn(:,:,:) = vb(:,:,:) 126 ! CALL wrk_dealloc( jpi,jpj,jpk,2, zuvd ) 127 ! ENDIF 123 128 ! 124 129 !!gm This is to be changed !!!! 125 ! - ML - sshn could be modified by istate_eel, so that initialization of e3t_b is done here126 IF( .NOT.ln_linssh ) THEN127 DO jk = 1, jpk128 e3t_b(:,:,jk) = e3t_n(:,:,jk)129 END DO130 ENDIF130 ! ! - ML - sshn could be modified by istate_eel, so that initialization of e3t_b is done here 131 ! IF( .NOT.ln_linssh ) THEN 132 ! DO jk = 1, jpk 133 ! e3t_b(:,:,jk) = e3t_n(:,:,jk) 134 ! END DO 135 ! ENDIF 131 136 !!gm 132 137 ! 133 ENDIF 138 ENDIF 134 139 ! 135 140 ! Initialize "now" and "before" barotropic velocities: … … 139 144 ub_b(:,:) = 0._wp ; vb_b(:,:) = 0._wp 140 145 ! 141 !!gm the use of umsak & vmask is not necessary belo xas un, vn, ub, vb are always masked146 !!gm the use of umsak & vmask is not necessary below as un, vn, ub, vb are always masked 142 147 DO jk = 1, jpkm1 143 148 DO jj = 1, jpj … … 162 167 END SUBROUTINE istate_init 163 168 164 165 SUBROUTINE istate_t_s 166 !!--------------------------------------------------------------------- 167 !! *** ROUTINE istate_t_s *** 168 !! 169 !! ** Purpose : Intialization of the temperature field with an 170 !! analytical profile or a file (i.e. in EEL configuration) 171 !! 172 !! ** Method : - temperature: use Philander analytic profile 173 !! - salinity : use to a constant value 35.5 174 !! 175 !! References : Philander ??? 176 !!---------------------------------------------------------------------- 177 INTEGER :: ji, jj, jk 178 REAL(wp) :: zsal = 35.50_wp 179 !!---------------------------------------------------------------------- 180 ! 181 IF(lwp) WRITE(numout,*) 182 IF(lwp) WRITE(numout,*) 'istate_t_s : Philander s initial temperature profile' 183 IF(lwp) WRITE(numout,*) '~~~~~~~~~~ and constant salinity (',zsal,' psu)' 184 ! 185 DO jk = 1, jpk 186 tsn(:,:,jk,jp_tem) = ( ( ( 7.5 - 0. * ABS( gphit(:,:) )/30. ) * ( 1.-TANH((gdept_n(:,:,jk)-80.)/30.) ) & 187 & + 10. * ( 5000. - gdept_n(:,:,jk) ) /5000.) ) * tmask(:,:,jk) 188 tsb(:,:,jk,jp_tem) = tsn(:,:,jk,jp_tem) 189 END DO 190 tsn(:,:,:,jp_sal) = zsal * tmask(:,:,:) 191 tsb(:,:,:,jp_sal) = tsn(:,:,:,jp_sal) 192 ! 193 END SUBROUTINE istate_t_s 194 195 196 SUBROUTINE istate_eel 197 !!---------------------------------------------------------------------- 198 !! *** ROUTINE istate_eel *** 199 !! 200 !! ** Purpose : Initialization of the dynamics and tracers for EEL R5 201 !! configuration (channel with or without a topographic bump) 202 !! 203 !! ** Method : - set temprature field 204 !! - set salinity field 205 !! - set velocity field including horizontal divergence 206 !! and relative vorticity fields 207 !!---------------------------------------------------------------------- 208 USE divhor ! hor. divergence (div_hor routine) 209 USE iom 210 ! 211 INTEGER :: inum ! temporary logical unit 212 INTEGER :: ji, jj, jk ! dummy loop indices 213 INTEGER :: ijloc 214 REAL(wp) :: zh1, zh2, zslope, zcst, zfcor ! temporary scalars 215 REAL(wp) :: zt1 = 15._wp ! surface temperature value (EEL R5) 216 REAL(wp) :: zt2 = 5._wp ! bottom temperature value (EEL R5) 217 REAL(wp) :: zsal = 35.0_wp ! constant salinity (EEL R2, R5 and R6) 218 REAL(wp) :: zueel = 0.1_wp ! constant uniform zonal velocity (EEL R5) 219 REAL(wp), DIMENSION(jpiglo,jpjglo) :: zssh ! initial ssh over the global domain 220 !!---------------------------------------------------------------------- 221 ! 222 SELECT CASE ( jp_cfg ) 223 ! ! ==================== 224 CASE ( 5 ) ! EEL R5 configuration 225 ! ! ==================== 226 ! 227 ! set temperature field with a linear profile 228 ! ------------------------------------------- 229 IF(lwp) WRITE(numout,*) 230 IF(lwp) WRITE(numout,*) 'istate_eel : EEL R5: linear temperature profile' 231 IF(lwp) WRITE(numout,*) '~~~~~~~~~~' 232 ! 233 zh1 = gdept_1d( 1 ) 234 zh2 = gdept_1d(jpkm1) 235 ! 236 zslope = ( zt1 - zt2 ) / ( zh1 - zh2 ) 237 zcst = ( zt1 * ( zh1 - zh2) - ( zt1 - zt2 ) * zh1 ) / ( zh1 - zh2 ) 238 ! 239 DO jk = 1, jpk 240 tsn(:,:,jk,jp_tem) = ( zt2 + zt1 * exp( - gdept_n(:,:,jk) / 1000 ) ) * tmask(:,:,jk) 241 tsb(:,:,jk,jp_tem) = tsn(:,:,jk,jp_tem) 242 END DO 243 ! 244 ! set salinity field to a constant value 245 ! -------------------------------------- 246 IF(lwp) WRITE(numout,*) 247 IF(lwp) WRITE(numout,*) 'istate_eel : EEL R5: constant salinity field, S = ', zsal 248 IF(lwp) WRITE(numout,*) '~~~~~~~~~~' 249 ! 250 tsn(:,:,:,jp_sal) = zsal * tmask(:,:,:) 251 tsb(:,:,:,jp_sal) = tsn(:,:,:,jp_sal) 252 ! 253 ! set the dynamics: U,V, hdiv (and ssh if necessary) 254 ! ---------------- 255 ! Start EEL5 configuration with barotropic geostrophic velocities 256 ! according the sshb and sshn SSH imposed. 257 ! we assume a uniform grid (hence the use of e1t(1,1) for delta_y) 258 ! we use the Coriolis frequency at mid-channel. 259 ub(:,:,:) = zueel * umask(:,:,:) 260 un(:,:,:) = ub(:,:,:) 261 ijloc = mj0(INT(jpjglo-1)/2) 262 zfcor = ff(1,ijloc) 263 ! 264 DO jj = 1, jpjglo 265 zssh(:,jj) = - (FLOAT(jj)- FLOAT(jpjglo-1)/2.)*zueel*e1t(1,1)*zfcor/grav 266 END DO 267 ! 268 IF(lwp) THEN 269 WRITE(numout,*) ' Uniform zonal velocity for EEL R5:',zueel 270 WRITE(numout,*) ' Geostrophic SSH profile as a function of y:' 271 WRITE(numout,'(12(1x,f6.2))') zssh(1,:) 272 ENDIF 273 ! 274 DO jj = 1, nlcj 275 DO ji = 1, nlci 276 sshb(ji,jj) = zssh( mig(ji) , mjg(jj) ) * tmask(ji,jj,1) 277 END DO 278 END DO 279 sshb(nlci+1:jpi, : ) = 0.e0 ! set to zero extra mpp columns 280 sshb( : ,nlcj+1:jpj) = 0.e0 ! set to zero extra mpp rows 281 ! 282 sshn(:,:) = sshb(:,:) ! set now ssh to the before value 283 ! 284 IF( nn_rstssh /= 0 ) THEN 285 nn_rstssh = 0 ! hand-made initilization of ssh 286 CALL ctl_warn( 'istate_eel: force nn_rstssh = 0' ) 287 ENDIF 288 ! 289 !!gm Check here call to div_hor should not be necessary 290 !!gm div_hor call runoffs not sure they are defined at that level 291 CALL div_hor( nit000 ) ! horizontal divergence and relative vorticity (curl) 292 ! N.B. the vertical velocity will be computed from the horizontal divergence field 293 ! in istate by a call to wzv routine 294 295 296 ! ! ========================== 297 CASE ( 2 , 6 ) ! EEL R2 or R6 configuration 298 ! ! ========================== 299 ! 300 ! set temperature field with a NetCDF file 301 ! ---------------------------------------- 302 IF(lwp) WRITE(numout,*) 303 IF(lwp) WRITE(numout,*) 'istate_eel : EEL R2 or R6: read initial temperature in a NetCDF file' 304 IF(lwp) WRITE(numout,*) '~~~~~~~~~~' 305 ! 306 CALL iom_open ( 'eel.initemp', inum ) 307 CALL iom_get ( inum, jpdom_data, 'initemp', tsb(:,:,:,jp_tem) ) ! read before temprature (tb) 308 CALL iom_close( inum ) 309 ! 310 tsn(:,:,:,jp_tem) = tsb(:,:,:,jp_tem) ! set nox temperature to tb 311 ! 312 ! set salinity field to a constant value 313 ! -------------------------------------- 314 IF(lwp) WRITE(numout,*) 315 IF(lwp) WRITE(numout,*) 'istate_eel : EEL R5: constant salinity field, S = ', zsal 316 IF(lwp) WRITE(numout,*) '~~~~~~~~~~' 317 ! 318 tsn(:,:,:,jp_sal) = zsal * tmask(:,:,:) 319 tsb(:,:,:,jp_sal) = tsn(:,:,:,jp_sal) 320 ! 321 ! ! =========================== 322 CASE DEFAULT ! NONE existing configuration 323 ! ! =========================== 324 WRITE(ctmp1,*) 'EEL with a ', jp_cfg,' km resolution is not coded' 325 CALL ctl_stop( ctmp1 ) 326 ! 327 END SELECT 328 ! 329 END SUBROUTINE istate_eel 330 331 332 SUBROUTINE istate_gyre 333 !!---------------------------------------------------------------------- 334 !! *** ROUTINE istate_gyre *** 335 !! 336 !! ** Purpose : Initialization of the dynamics and tracers for GYRE 337 !! configuration (double gyre with rotated domain) 338 !! 339 !! ** Method : - set temprature field 340 !! - set salinity field 341 !!---------------------------------------------------------------------- 342 INTEGER :: ji, jj, jk ! dummy loop indices 343 INTEGER :: inum ! temporary logical unit 344 INTEGER, PARAMETER :: ntsinit = 0 ! (0/1) (analytical/input data files) T&S initialization 345 !!---------------------------------------------------------------------- 346 ! 347 SELECT CASE ( ntsinit) 348 ! 349 CASE ( 0 ) ! analytical T/S profil deduced from LEVITUS 350 IF(lwp) WRITE(numout,*) 351 IF(lwp) WRITE(numout,*) 'istate_gyre : initial analytical T and S profil deduced from LEVITUS ' 352 IF(lwp) WRITE(numout,*) '~~~~~~~~~~~' 353 ! 354 DO jk = 1, jpk 355 DO jj = 1, jpj 356 DO ji = 1, jpi 357 tsn(ji,jj,jk,jp_tem) = ( 16. - 12. * TANH( (gdept_n(ji,jj,jk) - 400) / 700 ) ) & 358 & * (-TANH( (500-gdept_n(ji,jj,jk)) / 150 ) + 1) / 2 & 359 & + ( 15. * ( 1. - TANH( (gdept_n(ji,jj,jk)-50.) / 1500.) ) & 360 & - 1.4 * TANH((gdept_n(ji,jj,jk)-100.) / 100.) & 361 & + 7. * (1500. - gdept_n(ji,jj,jk)) / 1500. ) & 362 & * (-TANH( (gdept_n(ji,jj,jk) - 500) / 150) + 1) / 2 363 tsn(ji,jj,jk,jp_tem) = tsn(ji,jj,jk,jp_tem) * tmask(ji,jj,jk) 364 tsb(ji,jj,jk,jp_tem) = tsn(ji,jj,jk,jp_tem) 365 366 tsn(ji,jj,jk,jp_sal) = ( 36.25 - 1.13 * TANH( (gdept_n(ji,jj,jk) - 305) / 460 ) ) & 367 & * (-TANH((500 - gdept_n(ji,jj,jk)) / 150) + 1) / 2 & 368 & + ( 35.55 + 1.25 * (5000. - gdept_n(ji,jj,jk)) / 5000. & 369 & - 1.62 * TANH( (gdept_n(ji,jj,jk) - 60. ) / 650. ) & 370 & + 0.2 * TANH( (gdept_n(ji,jj,jk) - 35. ) / 100. ) & 371 & + 0.2 * TANH( (gdept_n(ji,jj,jk) - 1000.) / 5000.) ) & 372 & * (-TANH((gdept_n(ji,jj,jk) - 500) / 150) + 1) / 2 373 tsn(ji,jj,jk,jp_sal) = tsn(ji,jj,jk,jp_sal) * tmask(ji,jj,jk) 374 tsb(ji,jj,jk,jp_sal) = tsn(ji,jj,jk,jp_sal) 375 END DO 376 END DO 377 END DO 378 ! 379 CASE ( 1 ) ! T/S data fields read in dta_tem.nc/data_sal.nc files 380 IF(lwp) WRITE(numout,*) 381 IF(lwp) WRITE(numout,*) 'istate_gyre : initial T and S read from dta_tem.nc/data_sal.nc files' 382 IF(lwp) WRITE(numout,*) '~~~~~~~~~~~' 383 IF(lwp) WRITE(numout,*) ' NetCDF FORMAT' 384 385 ! Read temperature field 386 ! ---------------------- 387 CALL iom_open ( 'data_tem', inum ) 388 CALL iom_get ( inum, jpdom_data, 'votemper', tsn(:,:,:,jp_tem) ) 389 CALL iom_close( inum ) 390 391 tsn(:,:,:,jp_tem) = tsn(:,:,:,jp_tem) * tmask(:,:,:) 392 tsb(:,:,:,jp_tem) = tsn(:,:,:,jp_tem) 393 394 ! Read salinity field 395 ! ------------------- 396 CALL iom_open ( 'data_sal', inum ) 397 CALL iom_get ( inum, jpdom_data, 'vosaline', tsn(:,:,:,jp_sal) ) 398 CALL iom_close( inum ) 399 400 tsn(:,:,:,jp_sal) = tsn(:,:,:,jp_sal) * tmask(:,:,:) 401 tsb(:,:,:,jp_sal) = tsn(:,:,:,jp_sal) 402 ! 403 END SELECT 404 ! 405 IF(lwp) THEN 406 WRITE(numout,*) 407 WRITE(numout,*) ' Initial temperature and salinity profiles:' 408 WRITE(numout, "(9x,' level gdept_1d temperature salinity ')" ) 409 WRITE(numout, "(10x, i4, 3f10.2)" ) ( jk, gdept_1d(jk), tsn(2,2,jk,jp_tem), tsn(2,2,jk,jp_sal), jk = 1, jpk ) 410 ENDIF 411 ! 412 END SUBROUTINE istate_gyre 413 414 415 SUBROUTINE istate_uvg 416 !!---------------------------------------------------------------------- 417 !! *** ROUTINE istate_uvg *** 418 !! 419 !! ** Purpose : Compute the geostrophic velocities from (tn,sn) fields 420 !! 421 !! ** Method : Using the hydrostatic hypothesis the now hydrostatic 422 !! pressure is computed by integrating the in-situ density from the 423 !! surface to the bottom. 424 !! p=integral [ rau*g dz ] 425 !!---------------------------------------------------------------------- 426 USE divhor ! hor. divergence (div_hor routine) 427 USE lbclnk ! ocean lateral boundary condition (or mpp link) 428 ! 429 INTEGER :: ji, jj, jk ! dummy loop indices 430 REAL(wp) :: zmsv, zphv, zmsu, zphu, zalfg ! temporary scalars 431 REAL(wp), POINTER, DIMENSION(:,:,:) :: zprn 432 !!---------------------------------------------------------------------- 433 ! 434 CALL wrk_alloc( jpi,jpj,jpk, zprn) 435 ! 436 IF(lwp) WRITE(numout,*) 437 IF(lwp) WRITE(numout,*) 'istate_uvg : Start from Geostrophy' 438 IF(lwp) WRITE(numout,*) '~~~~~~~~~~' 439 440 ! Compute the now hydrostatic pressure 441 ! ------------------------------------ 442 443 zalfg = 0.5 * grav * rau0 444 445 zprn(:,:,1) = zalfg * e3w_n(:,:,1) * ( 1 + rhd(:,:,1) ) ! Surface value 446 447 DO jk = 2, jpkm1 ! Vertical integration from the surface 448 zprn(:,:,jk) = zprn(:,:,jk-1) & 449 & + zalfg * e3w_n(:,:,jk) * ( 2. + rhd(:,:,jk) + rhd(:,:,jk-1) ) 450 END DO 451 452 ! Compute geostrophic balance 453 ! --------------------------- 454 DO jk = 1, jpkm1 455 DO jj = 2, jpjm1 456 DO ji = fs_2, fs_jpim1 ! vertor opt. 457 zmsv = 1. / MAX( umask(ji-1,jj+1,jk) + umask(ji ,jj+1,jk) & 458 + umask(ji-1,jj ,jk) + umask(ji ,jj ,jk) , 1. ) 459 zphv = ( zprn(ji ,jj+1,jk) - zprn(ji-1,jj+1,jk) ) * umask(ji-1,jj+1,jk) / e1u(ji-1,jj+1) & 460 + ( zprn(ji+1,jj+1,jk) - zprn(ji ,jj+1,jk) ) * umask(ji ,jj+1,jk) / e1u(ji ,jj+1) & 461 + ( zprn(ji ,jj ,jk) - zprn(ji-1,jj ,jk) ) * umask(ji-1,jj ,jk) / e1u(ji-1,jj ) & 462 + ( zprn(ji+1,jj ,jk) - zprn(ji ,jj ,jk) ) * umask(ji ,jj ,jk) / e1u(ji ,jj ) 463 zphv = 1. / rau0 * zphv * zmsv * vmask(ji,jj,jk) 464 465 zmsu = 1. / MAX( vmask(ji+1,jj ,jk) + vmask(ji ,jj ,jk) & 466 + vmask(ji+1,jj-1,jk) + vmask(ji ,jj-1,jk) , 1. ) 467 zphu = ( zprn(ji+1,jj+1,jk) - zprn(ji+1,jj ,jk) ) * vmask(ji+1,jj ,jk) / e2v(ji+1,jj ) & 468 + ( zprn(ji ,jj+1,jk) - zprn(ji ,jj ,jk) ) * vmask(ji ,jj ,jk) / e2v(ji ,jj ) & 469 + ( zprn(ji+1,jj ,jk) - zprn(ji+1,jj-1,jk) ) * vmask(ji+1,jj-1,jk) / e2v(ji+1,jj-1) & 470 + ( zprn(ji ,jj ,jk) - zprn(ji ,jj-1,jk) ) * vmask(ji ,jj-1,jk) / e2v(ji ,jj-1) 471 zphu = 1. / rau0 * zphu * zmsu * umask(ji,jj,jk) 472 473 ! Compute the geostrophic velocities 474 un(ji,jj,jk) = -2. * zphu / ( ff(ji,jj) + ff(ji ,jj-1) ) 475 vn(ji,jj,jk) = 2. * zphv / ( ff(ji,jj) + ff(ji-1,jj ) ) 476 END DO 477 END DO 478 END DO 479 480 IF(lwp) WRITE(numout,*) ' we force to zero bottom velocity' 481 482 ! Susbtract the bottom velocity (level jpk-1 for flat bottom case) 483 ! to have a zero bottom velocity 484 485 DO jk = 1, jpkm1 486 un(:,:,jk) = ( un(:,:,jk) - un(:,:,jpkm1) ) * umask(:,:,jk) 487 vn(:,:,jk) = ( vn(:,:,jk) - vn(:,:,jpkm1) ) * vmask(:,:,jk) 488 END DO 489 490 CALL lbc_lnk( un, 'U', -1. ) 491 CALL lbc_lnk( vn, 'V', -1. ) 492 493 ub(:,:,:) = un(:,:,:) 494 vb(:,:,:) = vn(:,:,:) 495 496 ! 497 !!gm Check here call to div_hor should not be necessary 498 !!gm div_hor call runoffs not sure they are defined at that level 499 CALL div_hor( nit000 ) ! now horizontal divergence 500 ! 501 CALL wrk_dealloc( jpi,jpj,jpk, zprn) 502 ! 503 END SUBROUTINE istate_uvg 504 505 !!===================================================================== 169 !!====================================================================== 506 170 END MODULE istate -
branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/DOM/phycst.F90
r5147 r7277 100 100 !! *** ROUTINE phy_cst *** 101 101 !! 102 !! ** Purpose : Print model parameters and set and print the constants 103 !!---------------------------------------------------------------------- 104 CHARACTER (len=64) :: cform = "(A12, 3(A13, I7) )" 102 !! ** Purpose : set and print the constants 105 103 !!---------------------------------------------------------------------- 106 104 107 105 IF(lwp) WRITE(numout,*) 108 IF(lwp) WRITE(numout,*) ' phy_cst : initialization of ocean parameters andconstants'106 IF(lwp) WRITE(numout,*) ' phy_cst : initialization of physical constants' 109 107 IF(lwp) WRITE(numout,*) ' ~~~~~~~' 110 108 111 ! Ocean Parameters 112 ! ---------------- 113 IF(lwp) THEN 114 WRITE(numout,*) ' Domain info' 115 WRITE(numout,*) ' dimension of model' 116 WRITE(numout,*) ' Local domain Global domain Data domain ' 117 WRITE(numout,cform) ' ',' jpi : ', jpi, ' jpiglo : ', jpiglo, ' jpidta : ', jpidta 118 WRITE(numout,cform) ' ',' jpj : ', jpj, ' jpjglo : ', jpjglo, ' jpjdta : ', jpjdta 119 WRITE(numout,cform) ' ',' jpk : ', jpk, ' jpk : ', jpk , ' jpkdta : ', jpkdta 120 WRITE(numout,*) ' ',' jpij : ', jpij 121 WRITE(numout,*) ' mpp local domain info (mpp)' 122 WRITE(numout,*) ' jpni : ', jpni, ' jpreci : ', jpreci 123 WRITE(numout,*) ' jpnj : ', jpnj, ' jprecj : ', jprecj 124 WRITE(numout,*) ' jpnij : ', jpnij 125 WRITE(numout,*) ' lateral domain boundary condition type : jperio = ', jperio 126 ENDIF 127 128 ! Define constants 129 ! ---------------- 109 ! Define & print constants 110 ! ------------------------ 130 111 IF(lwp) WRITE(numout,*) 131 112 IF(lwp) WRITE(numout,*) ' Constants' -
branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/DYN/dynhpg.F90
r6152 r7277 454 454 DO jj = 2, jpjm1 455 455 DO ji = 2, jpim1 456 ll_tmp1 = MIN(sshn(ji,jj), sshn(ji+1,jj)) > MAX(- bathy(ji,jj), -bathy(ji+1,jj))457 ll_tmp2 = MAX(sshn(ji,jj) + bathy(ji,jj), sshn(ji+1,jj) + bathy(ji+1,jj)) > rn_wdmin1 + rn_wdmin2458 ll_tmp3 = MAX(sshn(ji,jj), sshn(ji+1,jj)) > MAX(- bathy(ji,jj), -bathy(ji+1,jj)) + &456 ll_tmp1 = MIN(sshn(ji,jj), sshn(ji+1,jj)) > MAX(-ht_0(ji,jj), -ht_0(ji+1,jj)) 457 ll_tmp2 = MAX(sshn(ji,jj) + ht_0(ji,jj), sshn(ji+1,jj) + ht_0(ji+1,jj)) > rn_wdmin1 + rn_wdmin2 458 ll_tmp3 = MAX(sshn(ji,jj), sshn(ji+1,jj)) > MAX(-ht_0(ji,jj), -ht_0(ji+1,jj)) + & 459 459 & rn_wdmin1 + rn_wdmin2 460 460 … … 464 464 ELSE IF(ll_tmp3) THEN 465 465 ! no worries about sshn(ji+1,jj)-sshn(ji,jj) = 0, it won't happen ! here 466 zcpx(ji,jj) = ABS((sshn(ji+1,jj) + bathy(ji+1,jj) - sshn(ji,jj) - bathy(ji,jj)) / &466 zcpx(ji,jj) = ABS((sshn(ji+1,jj) + ht_0(ji+1,jj) - sshn(ji,jj) - ht_0(ji,jj)) / & 467 467 & (sshn(ji+1,jj) - sshn(ji,jj))) 468 468 wduflt(ji,jj) = 1.0_wp … … 472 472 END IF 473 473 474 ll_tmp1 = MIN(sshn(ji,jj), sshn(ji,jj+1)) > MAX(- bathy(ji,jj), -bathy(ji,jj+1))475 ll_tmp2 = MAX(sshn(ji,jj) + bathy(ji,jj), sshn(ji,jj+1) + bathy(ji,jj+1)) > rn_wdmin1 + rn_wdmin2476 ll_tmp3 = MAX(sshn(ji,jj), sshn(ji,jj+1)) > MAX(- bathy(ji,jj), -bathy(ji,jj+1)) + &474 ll_tmp1 = MIN(sshn(ji,jj), sshn(ji,jj+1)) > MAX(-ht_0(ji,jj), -ht_0(ji,jj+1)) 475 ll_tmp2 = MAX(sshn(ji,jj) + ht_0(ji,jj), sshn(ji,jj+1) + ht_0(ji,jj+1)) > rn_wdmin1 + rn_wdmin2 476 ll_tmp3 = MAX(sshn(ji,jj), sshn(ji,jj+1)) > MAX(-ht_0(ji,jj), -ht_0(ji,jj+1)) + & 477 477 & rn_wdmin1 + rn_wdmin2 478 478 … … 482 482 ELSE IF(ll_tmp3) THEN 483 483 ! no worries about sshn(ji,jj+1)-sshn(ji,jj) = 0, it won't happen ! here 484 zcpy(ji,jj) = ABS((sshn(ji,jj+1) + bathy(ji,jj+1) - sshn(ji,jj) - bathy(ji,jj)) / &484 zcpy(ji,jj) = ABS((sshn(ji,jj+1) + ht_0(ji,jj+1) - sshn(ji,jj) - ht_0(ji,jj)) / & 485 485 & (sshn(ji,jj+1) - sshn(ji,jj))) 486 486 wdvflt(ji,jj) = 1.0_wp … … 707 707 DO jj = 2, jpjm1 708 708 DO ji = 2, jpim1 709 ll_tmp1 = MIN(sshn(ji,jj), sshn(ji+1,jj)) > MAX(- bathy(ji,jj), -bathy(ji+1,jj)) &710 & .and. MAX(sshn(ji,jj) + bathy(ji,jj), sshn(ji+1,jj) + bathy(ji+1,jj)) &709 ll_tmp1 = MIN(sshn(ji,jj), sshn(ji+1,jj)) > MAX(-ht_0(ji,jj), -ht_0(ji+1,jj)) & 710 & .and. MAX(sshn(ji,jj) + ht_0(ji,jj), sshn(ji+1,jj) + ht_0(ji+1,jj)) & 711 711 & > rn_wdmin1 + rn_wdmin2 712 ll_tmp2 = MAX(sshn(ji,jj), sshn(ji+1,jj)) > MAX(- bathy(ji,jj), -bathy(ji+1,jj)) +&712 ll_tmp2 = MAX(sshn(ji,jj), sshn(ji+1,jj)) > MAX(-ht_0(ji,jj), -ht_0(ji+1,jj)) +& 713 713 & rn_wdmin1 + rn_wdmin2 714 714 … … 717 717 ELSE IF(ll_tmp2) THEN 718 718 ! no worries about sshn(ji+1,jj)-sshn(ji,jj) = 0, it won't happen ! here 719 zcpx(ji,jj) = ABS((sshn(ji+1,jj) + bathy(ji+1,jj) - sshn(ji,jj) - bathy(ji,jj)) /&719 zcpx(ji,jj) = ABS((sshn(ji+1,jj) + ht_0(ji+1,jj) - sshn(ji,jj) - ht_0(ji,jj)) /& 720 720 & (sshn(ji+1,jj) - sshn(ji,jj))) 721 721 ELSE … … 723 723 END IF 724 724 725 ll_tmp1 = MIN(sshn(ji,jj), sshn(ji,jj+1)) > MAX(- bathy(ji,jj), -bathy(ji,jj+1)) &726 & .and. MAX(sshn(ji,jj) + bathy(ji,jj), sshn(ji,jj+1) + bathy(ji,jj+1)) &725 ll_tmp1 = MIN(sshn(ji,jj), sshn(ji,jj+1)) > MAX(-ht_0(ji,jj), -ht_0(ji,jj+1)) & 726 & .and. MAX(sshn(ji,jj) + ht_0(ji,jj), sshn(ji,jj+1) + ht_0(ji,jj+1)) & 727 727 & > rn_wdmin1 + rn_wdmin2 728 ll_tmp2 = MAX(sshn(ji,jj), sshn(ji,jj+1)) > MAX(- bathy(ji,jj), -bathy(ji,jj+1)) +&728 ll_tmp2 = MAX(sshn(ji,jj), sshn(ji,jj+1)) > MAX(-ht_0(ji,jj), -ht_0(ji,jj+1)) +& 729 729 & rn_wdmin1 + rn_wdmin2 730 730 … … 733 733 ELSE IF(ll_tmp2) THEN 734 734 ! no worries about sshn(ji,jj+1)-sshn(ji,jj) = 0, it won't happen ! here 735 zcpy(ji,jj) = ABS((sshn(ji,jj+1) + bathy(ji,jj+1) - sshn(ji,jj) - bathy(ji,jj)) /&735 zcpy(ji,jj) = ABS((sshn(ji,jj+1) + ht_0(ji,jj+1) - sshn(ji,jj) - ht_0(ji,jj)) /& 736 736 & (sshn(ji,jj+1) - sshn(ji,jj))) 737 737 ELSE … … 1003 1003 DO jj = 2, jpjm1 1004 1004 DO ji = 2, jpim1 1005 ll_tmp1 = MIN(sshn(ji,jj), sshn(ji+1,jj)) > MAX(- bathy(ji,jj), -bathy(ji+1,jj)) &1006 & .and. MAX(sshn(ji,jj) + bathy(ji,jj), sshn(ji+1,jj) + bathy(ji+1,jj)) &1005 ll_tmp1 = MIN(sshn(ji,jj), sshn(ji+1,jj)) > MAX(-ht_0(ji,jj), -ht_0(ji+1,jj)) & 1006 & .and. MAX(sshn(ji,jj) + ht_0(ji,jj), sshn(ji+1,jj) + ht_0(ji+1,jj)) & 1007 1007 & > rn_wdmin1 + rn_wdmin2 1008 ll_tmp2 = MAX(sshn(ji,jj), sshn(ji+1,jj)) > MAX(- bathy(ji,jj), -bathy(ji+1,jj)) +&1008 ll_tmp2 = MAX(sshn(ji,jj), sshn(ji+1,jj)) > MAX(-ht_0(ji,jj), -ht_0(ji+1,jj)) +& 1009 1009 & rn_wdmin1 + rn_wdmin2 1010 1010 … … 1013 1013 ELSE IF(ll_tmp2) THEN 1014 1014 ! no worries about sshn(ji+1,jj)-sshn(ji,jj) = 0, it won't happen ! here 1015 zcpx(ji,jj) = ABS((sshn(ji+1,jj) + bathy(ji+1,jj) - sshn(ji,jj) - bathy(ji,jj)) /&1015 zcpx(ji,jj) = ABS((sshn(ji+1,jj) + ht_0(ji+1,jj) - sshn(ji,jj) - ht_0(ji,jj)) /& 1016 1016 & (sshn(ji+1,jj) - sshn(ji,jj))) 1017 1017 ELSE … … 1019 1019 END IF 1020 1020 1021 ll_tmp1 = MIN(sshn(ji,jj), sshn(ji,jj+1)) > MAX(- bathy(ji,jj), -bathy(ji,jj+1)) &1022 & .and. MAX(sshn(ji,jj) + bathy(ji,jj), sshn(ji,jj+1) + bathy(ji,jj+1)) &1021 ll_tmp1 = MIN(sshn(ji,jj), sshn(ji,jj+1)) > MAX(-ht_0(ji,jj), -ht_0(ji,jj+1)) & 1022 & .and. MAX(sshn(ji,jj) + ht_0(ji,jj), sshn(ji,jj+1) + ht_0(ji,jj+1)) & 1023 1023 & > rn_wdmin1 + rn_wdmin2 1024 ll_tmp2 = MAX(sshn(ji,jj), sshn(ji,jj+1)) > MAX(- bathy(ji,jj), -bathy(ji,jj+1)) +&1024 ll_tmp2 = MAX(sshn(ji,jj), sshn(ji,jj+1)) > MAX(-ht_0(ji,jj), -ht_0(ji,jj+1)) +& 1025 1025 & rn_wdmin1 + rn_wdmin2 1026 1026 … … 1029 1029 ELSE IF(ll_tmp2) THEN 1030 1030 ! no worries about sshn(ji,jj+1)-sshn(ji,jj) = 0, it won't happen ! here 1031 zcpy(ji,jj) = ABS((sshn(ji,jj+1) + bathy(ji,jj+1) - sshn(ji,jj) - bathy(ji,jj)) /&1031 zcpy(ji,jj) = ABS((sshn(ji,jj+1) + ht_0(ji,jj+1) - sshn(ji,jj) - ht_0(ji,jj)) /& 1032 1032 & (sshn(ji,jj+1) - sshn(ji,jj))) 1033 1033 ELSE … … 1046 1046 DO jj = 1, jpj 1047 1047 DO ji = 1, jpi 1048 jk = mb athy(ji,jj)1048 jk = mbkt(ji,jj)+1 1049 1049 IF( jk <= 0 ) THEN ; zrhh(ji,jj, : ) = 0._wp 1050 1050 ELSEIF( jk == 1 ) THEN ; zrhh(ji,jj,jk+1:jpk) = rhd(ji,jj,jk) -
branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/DYN/dynspg_ts.F90
r6152 r7277 69 69 REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:) :: wgtbtp1, wgtbtp2 !: 1st & 2nd weights used in time filtering of barotropic fields 70 70 71 REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) :: zwz !: ff /h at F points71 REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) :: zwz !: ff_f/h at F points 72 72 REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) :: ftnw, ftne !: triad of coriolis parameter 73 73 REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) :: ftsw, ftse !: (only used with een vorticity scheme) … … 220 220 IF( kt == nit000 .OR. .NOT.ln_linssh ) THEN 221 221 IF( ln_dynvor_een ) THEN !== EEN scheme ==! 222 SELECT CASE( nn_een_e3f ) !* ff /e3 at F-point222 SELECT CASE( nn_een_e3f ) !* ff_f/e3 at F-point 223 223 CASE ( 0 ) ! original formulation (masked averaging of e3t divided by 4) 224 224 DO jj = 1, jpjm1 … … 226 226 zwz(ji,jj) = ( ht_n(ji ,jj+1) + ht_n(ji+1,jj+1) + & 227 227 & ht_n(ji ,jj ) + ht_n(ji+1,jj ) ) * 0.25_wp 228 IF( zwz(ji,jj) /= 0._wp ) zwz(ji,jj) = ff (ji,jj) / zwz(ji,jj)228 IF( zwz(ji,jj) /= 0._wp ) zwz(ji,jj) = ff_f(ji,jj) / zwz(ji,jj) 229 229 END DO 230 230 END DO … … 236 236 & / ( MAX( 1._wp, tmask(ji ,jj+1, 1) + tmask(ji+1,jj+1, 1) + & 237 237 & tmask(ji ,jj , 1) + tmask(ji+1,jj , 1) ) ) 238 IF( zwz(ji,jj) /= 0._wp ) zwz(ji,jj) = ff (ji,jj) / zwz(ji,jj)238 IF( zwz(ji,jj) /= 0._wp ) zwz(ji,jj) = ff_f(ji,jj) / zwz(ji,jj) 239 239 END DO 240 240 END DO … … 255 255 zwz(:,:) = 0._wp 256 256 zhf(:,:) = 0._wp 257 IF ( .not. ln_sco ) THEN 258 259 !!gm agree the JC comment : this should be done in a much clear way 260 261 ! JC: It not clear yet what should be the depth at f-points over land in z-coordinate case 262 ! Set it to zero for the time being 263 ! IF( rn_hmin < 0._wp ) THEN ; jk = - INT( rn_hmin ) ! from a nb of level 264 ! ELSE ; jk = MINLOC( gdepw_0, mask = gdepw_0 > rn_hmin, dim = 1 ) ! from a depth 265 ! ENDIF 266 ! zhf(:,:) = gdepw_0(:,:,jk+1) 267 ELSE 268 zhf(:,:) = hbatf(:,:) 269 END IF 270 271 DO jj = 1, jpjm1 272 zhf(:,jj) = zhf(:,jj) * (1._wp- umask(:,jj,1) * umask(:,jj+1,1)) 273 END DO 257 258 !!gm assume 0 in both cases (xhich is almost surely WRONG ! ) as hvatf has been removed 259 !!gm A priori a better value should be something like : 260 !!gm zhf(i,j) = masked sum of ht(i,j) , ht(i+1,j) , ht(i,j+1) , (i+1,j+1) 261 !!gm divided by the sum of the corresponding mask 262 !!gm 263 !! 264 !! IF ( .not. ln_sco ) THEN 265 !! 266 !! !!gm agree the JC comment : this should be done in a much clear way 267 !! 268 !! ! JC: It not clear yet what should be the depth at f-points over land in z-coordinate case 269 !! ! Set it to zero for the time being 270 !! ! IF( rn_hmin < 0._wp ) THEN ; jk = - INT( rn_hmin ) ! from a nb of level 271 !! ! ELSE ; jk = MINLOC( gdepw_0, mask = gdepw_0 > rn_hmin, dim = 1 ) ! from a depth 272 !! ! ENDIF 273 !! ! zhf(:,:) = gdepw_0(:,:,jk+1) 274 !! ELSE 275 !! zhf(:,:) = hbatf(:,:) 276 !! END IF 277 !! 278 !! DO jj = 1, jpjm1 279 !! zhf(:,jj) = zhf(:,jj) * (1._wp- umask(:,jj,1) * umask(:,jj+1,1)) 280 !! END DO 281 !!gm end 274 282 275 283 DO jk = 1, jpkm1 … … 285 293 END DO 286 294 END DO 287 zwz(:,:) = ff (:,:) * zwz(:,:)295 zwz(:,:) = ff_f(:,:) * zwz(:,:) 288 296 ENDIF 289 297 ENDIF … … 378 386 DO jj = 2, jpjm1 379 387 DO ji = 2, jpim1 380 ll_tmp1 = MIN(sshn(ji,jj), sshn(ji+1,jj)) > MAX(- bathy(ji,jj), -bathy(ji+1,jj)) &381 & .and. MAX(sshn(ji,jj) + bathy(ji,jj), sshn(ji+1,jj) + bathy(ji+1,jj)) &388 ll_tmp1 = MIN(sshn(ji,jj), sshn(ji+1,jj)) > MAX(-ht_0(ji,jj), -ht_0(ji+1,jj)) & 389 & .and. MAX(sshn(ji,jj) + ht_0(ji,jj), sshn(ji+1,jj) + ht_0(ji+1,jj)) & 382 390 & > rn_wdmin1 + rn_wdmin2 383 ll_tmp2 = MAX(sshn(ji,jj), sshn(ji+1,jj)) > MAX(- bathy(ji,jj), -bathy(ji+1,jj)) &391 ll_tmp2 = MAX(sshn(ji,jj), sshn(ji+1,jj)) > MAX(-ht_0(ji,jj), -ht_0(ji+1,jj)) & 384 392 & + rn_wdmin1 + rn_wdmin2 385 393 IF(ll_tmp1) THEN … … 387 395 ELSEIF(ll_tmp2) THEN 388 396 ! no worries about sshn(ji+1,jj)-sshn(ji,jj) = 0, it won't happen here 389 zcpx(ji,jj) = ABS((sshn(ji+1,jj) + bathy(ji+1,jj) - sshn(ji,jj) - bathy(ji,jj)) &397 zcpx(ji,jj) = ABS((sshn(ji+1,jj) + ht_0(ji+1,jj) - sshn(ji,jj) - ht_0(ji,jj)) & 390 398 & /(sshn(ji+1,jj) - sshn(ji,jj))) 391 399 ELSE … … 394 402 END IF 395 403 396 ll_tmp1 = MIN(sshn(ji,jj), sshn(ji,jj+1)) > MAX(- bathy(ji,jj), -bathy(ji,jj+1)) &397 & .and. MAX(sshn(ji,jj) + bathy(ji,jj), sshn(ji,jj+1) + bathy(ji,jj+1)) &404 ll_tmp1 = MIN(sshn(ji,jj), sshn(ji,jj+1)) > MAX(-ht_0(ji,jj), -ht_0(ji,jj+1)) & 405 & .and. MAX(sshn(ji,jj) + ht_0(ji,jj), sshn(ji,jj+1) + ht_0(ji,jj+1)) & 398 406 & > rn_wdmin1 + rn_wdmin2 399 ll_tmp2 = MAX(sshn(ji,jj), sshn(ji,jj+1)) > MAX(- bathy(ji,jj), -bathy(ji,jj+1)) &407 ll_tmp2 = MAX(sshn(ji,jj), sshn(ji,jj+1)) > MAX(-ht_0(ji,jj), -ht_0(ji,jj+1)) & 400 408 & + rn_wdmin1 + rn_wdmin2 401 409 IF(ll_tmp1) THEN … … 403 411 ELSEIF(ll_tmp2) THEN 404 412 ! no worries about sshn(ji,jj+1)-sshn(ji,jj) = 0, it won't happen here 405 zcpy(ji,jj) = ABS((sshn(ji,jj+1) + bathy(ji,jj+1) - sshn(ji,jj) - bathy(ji,jj)) &413 zcpy(ji,jj) = ABS((sshn(ji,jj+1) + ht_0(ji,jj+1) - sshn(ji,jj) - ht_0(ji,jj)) & 406 414 & /(sshn(ji,jj+1) - sshn(ji,jj))) 407 415 ELSE … … 569 577 IF( ln_wd ) THEN !preserve the positivity of water depth 570 578 !ssh[b,n,a] should have already been processed for this 571 sshbb_e(:,:) = MAX(sshbb_e(:,:), rn_wdmin1 - bathy(:,:))572 sshb_e(:,:) = MAX(sshb_e(:,:) , rn_wdmin1 - bathy(:,:))579 sshbb_e(:,:) = MAX(sshbb_e(:,:), rn_wdmin1 - ht_0(:,:)) 580 sshb_e(:,:) = MAX(sshb_e(:,:) , rn_wdmin1 - ht_0(:,:)) 573 581 ENDIF 574 582 ! … … 702 710 END DO 703 711 ssha_e(:,:) = ( sshn_e(:,:) - rdtbt * ( zssh_frc(:,:) + zhdiv(:,:) ) ) * ssmask(:,:) 704 IF( ln_wd ) ssha_e(:,:) = MAX(ssha_e(:,:), rn_wdmin1 - bathy(:,:))712 IF( ln_wd ) ssha_e(:,:) = MAX(ssha_e(:,:), rn_wdmin1 - ht_0(:,:)) 705 713 CALL lbc_lnk( ssha_e, 'T', 1._wp ) 706 714 … … 754 762 DO jj = 2, jpjm1 755 763 DO ji = 2, jpim1 756 ll_tmp1 = MIN( zsshp2_e(ji,jj), zsshp2_e(ji+1,jj) ) > MAX( - bathy(ji,jj), -bathy(ji+1,jj) ) &757 & .AND. MAX( zsshp2_e(ji,jj) + bathy(ji,jj), zsshp2_e(ji+1,jj) + bathy(ji+1,jj) ) &764 ll_tmp1 = MIN( zsshp2_e(ji,jj), zsshp2_e(ji+1,jj) ) > MAX( -ht_0(ji,jj), -ht_0(ji+1,jj) ) & 765 & .AND. MAX( zsshp2_e(ji,jj) + ht_0(ji,jj), zsshp2_e(ji+1,jj) + ht_0(ji+1,jj) ) & 758 766 & > rn_wdmin1 + rn_wdmin2 759 ll_tmp2 = MAX( zsshp2_e(ji,jj), zsshp2_e(ji+1,jj) ) > MAX( - bathy(ji,jj), -bathy(ji+1,jj) ) &767 ll_tmp2 = MAX( zsshp2_e(ji,jj), zsshp2_e(ji+1,jj) ) > MAX( -ht_0(ji,jj), -ht_0(ji+1,jj) ) & 760 768 & + rn_wdmin1 + rn_wdmin2 761 769 IF(ll_tmp1) THEN … … 763 771 ELSE IF(ll_tmp2) THEN 764 772 ! no worries about zsshp2_e(ji+1,jj)-zsshp2_e(ji,jj) = 0, it won't happen here 765 zcpx(ji,jj) = ABS( (zsshp2_e(ji+1,jj) + bathy(ji+1,jj) - zsshp2_e(ji,jj) - bathy(ji,jj)) &773 zcpx(ji,jj) = ABS( (zsshp2_e(ji+1,jj) + ht_0(ji+1,jj) - zsshp2_e(ji,jj) - ht_0(ji,jj)) & 766 774 & / (zsshp2_e(ji+1,jj) - zsshp2_e(ji,jj)) ) 767 775 ELSE … … 770 778 END IF 771 779 772 ll_tmp1 = MIN( zsshp2_e(ji,jj), zsshp2_e(ji,jj+1) ) > MAX( - bathy(ji,jj), -bathy(ji,jj+1) ) &773 & .AND. MAX( zsshp2_e(ji,jj) + bathy(ji,jj), zsshp2_e(ji,jj+1) + bathy(ji,jj+1) ) &780 ll_tmp1 = MIN( zsshp2_e(ji,jj), zsshp2_e(ji,jj+1) ) > MAX( -ht_0(ji,jj), -ht_0(ji,jj+1) ) & 781 & .AND. MAX( zsshp2_e(ji,jj) + ht_0(ji,jj), zsshp2_e(ji,jj+1) + ht_0(ji,jj+1) ) & 774 782 & > rn_wdmin1 + rn_wdmin2 775 ll_tmp2 = MAX( zsshp2_e(ji,jj), zsshp2_e(ji,jj+1) ) > MAX( - bathy(ji,jj), -bathy(ji,jj+1) ) &783 ll_tmp2 = MAX( zsshp2_e(ji,jj), zsshp2_e(ji,jj+1) ) > MAX( -ht_0(ji,jj), -ht_0(ji,jj+1) ) & 776 784 & + rn_wdmin1 + rn_wdmin2 777 785 IF(ll_tmp1) THEN … … 779 787 ELSE IF(ll_tmp2) THEN 780 788 ! no worries about zsshp2_e(ji,jj+1)-zsshp2_e(ji,jj) = 0, it won't happen here 781 zcpy(ji,jj) = ABS( (zsshp2_e(ji,jj+1) + bathy(ji,jj+1) - zsshp2_e(ji,jj) - bathy(ji,jj)) &789 zcpy(ji,jj) = ABS( (zsshp2_e(ji,jj+1) + ht_0(ji,jj+1) - zsshp2_e(ji,jj) - ht_0(ji,jj)) & 782 790 & / (zsshp2_e(ji,jj+1) - zsshp2_e(ji,jj)) ) 783 791 ELSE -
branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/DYN/dynvor.F90
r6140 r7277 237 237 SELECT CASE( kvor ) !== vorticity considered ==! 238 238 CASE ( np_COR ) !* Coriolis (planetary vorticity) 239 zwz(:,:) = ff (:,:)239 zwz(:,:) = ff_f(:,:) 240 240 CASE ( np_RVO ) !* relative vorticity 241 241 DO jj = 1, jpjm1 … … 256 256 DO jj = 1, jpjm1 257 257 DO ji = 1, fs_jpim1 ! vector opt. 258 zwz(ji,jj) = ff (ji,jj) + ( e2v(ji+1,jj ) * vn(ji+1,jj ,jk) - e2v(ji,jj) * vn(ji,jj,jk) &259 & - e1u(ji ,jj+1) * un(ji ,jj+1,jk) + e1u(ji,jj) * un(ji,jj,jk) ) &260 & * r1_e1e2f(ji,jj)258 zwz(ji,jj) = ff_f(ji,jj) + ( e2v(ji+1,jj ) * vn(ji+1,jj ,jk) - e2v(ji,jj) * vn(ji,jj,jk) & 259 & - e1u(ji ,jj+1) * un(ji ,jj+1,jk) + e1u(ji,jj) * un(ji,jj,jk) ) & 260 & * r1_e1e2f(ji,jj) 261 261 END DO 262 262 END DO … … 264 264 DO jj = 1, jpjm1 265 265 DO ji = 1, fs_jpim1 ! vector opt. 266 zwz(ji,jj) = ff (ji,jj)&266 zwz(ji,jj) = ff_f(ji,jj) & 267 267 & + ( ( vn(ji+1,jj ,jk) + vn (ji,jj,jk) ) * ( e2v(ji+1,jj ) - e2v(ji,jj) ) & 268 268 & - ( un(ji ,jj+1,jk) + un (ji,jj,jk) ) * ( e1u(ji ,jj+1) - e1u(ji,jj) ) ) & … … 357 357 SELECT CASE( kvor ) !== vorticity considered ==! 358 358 CASE ( np_COR ) !* Coriolis (planetary vorticity) 359 zwz(:,:) = ff (:,:)359 zwz(:,:) = ff_f(:,:) 360 360 CASE ( np_RVO ) !* relative vorticity 361 361 DO jj = 1, jpjm1 … … 376 376 DO jj = 1, jpjm1 377 377 DO ji = 1, fs_jpim1 ! vector opt. 378 zwz(ji,jj) = ff (ji,jj) + ( e2v(ji+1,jj ) * vn(ji+1,jj ,jk) - e2v(ji,jj) * vn(ji,jj,jk) &379 & - e1u(ji ,jj+1) * un(ji ,jj+1,jk) + e1u(ji,jj) * un(ji,jj,jk) ) &380 & * r1_e1e2f(ji,jj)378 zwz(ji,jj) = ff_f(ji,jj) + ( e2v(ji+1,jj ) * vn(ji+1,jj ,jk) - e2v(ji,jj) * vn(ji,jj,jk) & 379 & - e1u(ji ,jj+1) * un(ji ,jj+1,jk) + e1u(ji,jj) * un(ji,jj,jk) ) & 380 & * r1_e1e2f(ji,jj) 381 381 END DO 382 382 END DO … … 384 384 DO jj = 1, jpjm1 385 385 DO ji = 1, fs_jpim1 ! vector opt. 386 zwz(ji,jj) = ff (ji,jj)&386 zwz(ji,jj) = ff_f(ji,jj) & 387 387 & + ( ( vn(ji+1,jj ,jk) + vn (ji,jj,jk) ) * ( e2v(ji+1,jj ) - e2v(ji,jj) ) & 388 388 & - ( un(ji ,jj+1,jk) + un (ji,jj,jk) ) * ( e1u(ji ,jj+1) - e1u(ji,jj) ) ) & … … 506 506 DO jj = 1, jpjm1 507 507 DO ji = 1, fs_jpim1 ! vector opt. 508 zwz(ji,jj) = ff (ji,jj) * z1_e3f(ji,jj)508 zwz(ji,jj) = ff_f(ji,jj) * z1_e3f(ji,jj) 509 509 END DO 510 510 END DO … … 528 528 DO jj = 1, jpjm1 529 529 DO ji = 1, fs_jpim1 ! vector opt. 530 zwz(ji,jj) = ( ff (ji,jj) + ( e2v(ji+1,jj ) * vn(ji+1,jj ,jk) - e2v(ji,jj) * vn(ji,jj,jk) &531 & - e1u(ji ,jj+1) * un(ji ,jj+1,jk) + e1u(ji,jj) * un(ji,jj,jk) ) &532 & * r1_e1e2f(ji,jj) ) * z1_e3f(ji,jj)530 zwz(ji,jj) = ( ff_f(ji,jj) + ( e2v(ji+1,jj ) * vn(ji+1,jj ,jk) - e2v(ji,jj) * vn(ji,jj,jk) & 531 & - e1u(ji ,jj+1) * un(ji ,jj+1,jk) + e1u(ji,jj) * un(ji,jj,jk) ) & 532 & * r1_e1e2f(ji,jj) ) * z1_e3f(ji,jj) 533 533 END DO 534 534 END DO … … 536 536 DO jj = 1, jpjm1 537 537 DO ji = 1, fs_jpim1 ! vector opt. 538 zwz(ji,jj) = ( ff (ji,jj)&538 zwz(ji,jj) = ( ff_f(ji,jj) & 539 539 & + ( ( vn(ji+1,jj ,jk) + vn (ji,jj,jk) ) * ( e2v(ji+1,jj ) - e2v(ji,jj) ) & 540 540 & - ( un(ji ,jj+1,jk) + un (ji,jj,jk) ) * ( e1u(ji ,jj+1) - e1u(ji,jj) ) ) & -
branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/DYN/wet_dry.F90
r6152 r7277 1 2 1 MODULE wet_dry 3 2 !!============================================================================== … … 7 6 !! only effects if wetting/drying is on (ln_wd == .true.) 8 7 !!============================================================================== 9 !! History : 10 !! NEMO 3.6 ! 2014-09 ((H.Liu) Original code 8 !! History : 3.6 ! 2014-09 ((H.Liu) Original code 11 9 !! ! will add the runoff and periodic BC case later 12 10 !!---------------------------------------------------------------------- … … 84 82 WRITE(numout,*) ' land elevation threshold rn_wdld = ', rn_wdld 85 83 WRITE(numout,*) ' Max iteration for W/D limiter nn_wdit = ', nn_wdit 86 87 84 ENDIF 85 ! 88 86 IF(ln_wd) THEN 89 87 ALLOCATE( wduflt(jpi,jpj), wdvflt(jpi,jpj), wdmask(jpi,jpj), STAT=ierr ) 90 88 IF( ierr /= 0 ) CALL ctl_stop('STOP', 'wad_init : Array allocation error') 91 89 ENDIF 90 ! 92 91 END SUBROUTINE wad_init 92 93 93 94 94 SUBROUTINE wad_lmt( sshb1, sshemp, z2dt ) … … 116 116 REAL(wp), POINTER, DIMENSION(:,:) :: zflxu, zflxv ! local 2D workspace 117 117 REAL(wp), POINTER, DIMENSION(:,:) :: zflxu1, zflxv1 ! local 2D workspace 118 119 118 !!---------------------------------------------------------------------- 120 119 ! … … 124 123 IF(ln_wd) THEN 125 124 126 CALL wrk_alloc( jpi, jpj,zflxp, zflxn, zflxu, zflxv, zflxu1, zflxv1 )127 CALL wrk_alloc( jpi, jpj,zwdlmtu, zwdlmtv)125 CALL wrk_alloc( jpi,jpj, zflxp, zflxn, zflxu, zflxv, zflxu1, zflxv1 ) 126 CALL wrk_alloc( jpi,jpj, zwdlmtu, zwdlmtv) 128 127 ! 129 128 … … 156 155 zflxv(:,:) = zflxv(:,:) * e1v(:,:) 157 156 158 DO jj = 2, jpjm1157 DO jj = 2, jpjm1 159 158 DO ji = 2, jpim1 160 159 161 IF( tmask(ji, jj, 1) < 0.5_wp)CYCLE ! we don't care about land cells162 IF( bathy(ji,jj) > zdepwd) CYCLE! and cells which will unlikely go dried out160 IF( tmask(ji,jj,1) == 0._wp ) CYCLE ! we don't care about land cells 161 IF( ht_0 (ji,jj) > zdepwd ) CYCLE ! and cells which will unlikely go dried out 163 162 164 163 zflxp(ji,jj) = max(zflxu(ji,jj), 0._wp) - min(zflxu(ji-1,jj), 0._wp) + & … … 167 166 & min(zflxv(ji,jj), 0._wp) - max(zflxv(ji, jj-1), 0._wp) 168 167 169 zdep2 = bathy(ji,jj) + sshb1(ji,jj) - rn_wdmin1168 zdep2 = ht_0(ji,jj) + sshb1(ji,jj) - rn_wdmin1 170 169 IF(zdep2 < 0._wp) THEN !add more safty, but not necessary 171 170 !zdep2 = 0._wp 172 sshb1(ji,jj) = rn_wdmin1 - bathy(ji,jj)171 sshb1(ji,jj) = rn_wdmin1 - ht_0(ji,jj) 173 172 END IF 174 173 ENDDO … … 187 186 188 187 wdmask(ji,jj) = 0 189 IF( tmask(ji, jj,1) < 0.5_wp) CYCLE190 IF( bathy(ji,jj) > zdepwd) CYCLE188 IF( tmask(ji,jj,1) < 0.5_wp) CYCLE 189 IF( ht_0(ji,jj) > zdepwd) CYCLE 191 190 192 191 ztmp = e1e2t(ji,jj) … … 198 197 199 198 zdep1 = (zzflxp + zzflxn) * z2dt / ztmp 200 zdep2 = bathy(ji,jj) + sshb1(ji,jj) - rn_wdmin1 - z2dt * sshemp(ji,jj) ! this one can be moved out of the loop199 zdep2 = ht_0(ji,jj) + sshb1(ji,jj) - rn_wdmin1 - z2dt * sshemp(ji,jj) ! this one can be moved out of the loop 201 200 202 201 IF(zdep1 > zdep2) THEN … … 240 239 CALL wrk_dealloc( jpi, jpj, zflxp, zflxn, zflxu, zflxv, zflxu1, zflxv1 ) 241 240 CALL wrk_dealloc( jpi, jpj, zwdlmtu, zwdlmtv) 242 !243 END 244 241 ! 242 ENDIF 243 ! 245 244 IF( nn_timing == 1 ) CALL timing_stop('wad_lmt') 245 ! 246 246 END SUBROUTINE wad_lmt 247 247 248 248 249 SUBROUTINE wad_lmt_bt( zflxu, zflxv, sshn_e, zssh_frc, rdtbt ) … … 267 268 REAL(wp) :: ztmp ! local scalars 268 269 REAL(wp), POINTER, DIMENSION(:,:) :: zwdlmtu, zwdlmtv !: W/D flux limiters 269 REAL(wp), POINTER, DIMENSION(:,:) :: zflxp, zflxn ! local 2D workspace 270 REAL(wp), POINTER, DIMENSION(:,:) :: zflxu1, zflxv1 ! local 2D workspace 271 272 !!---------------------------------------------------------------------- 273 ! 274 270 REAL(wp), POINTER, DIMENSION(:,:) :: zflxp, zflxn ! 2D workspace 271 REAL(wp), POINTER, DIMENSION(:,:) :: zflxu1, zflxv1 ! 2D workspace 272 !!---------------------------------------------------------------------- 273 ! 275 274 IF( nn_timing == 1 ) CALL timing_start('wad_lmt_bt') 276 275 … … 305 304 DO ji = 2, jpim1 306 305 307 IF(tmask(ji, jj,1) < 0.5_wp) CYCLE ! we don't care about land cells308 IF( bathy(ji,jj)> zdepwd) CYCLE ! and cells which will unlikely go dried out306 IF(tmask(ji,jj,1) < 0.5_wp) CYCLE ! we don't care about land cells 307 IF(ht_0 (ji,jj) > zdepwd) CYCLE ! and cells which will unlikely go dried out 309 308 310 309 zflxp(ji,jj) = max(zflxu(ji,jj), 0._wp) - min(zflxu(ji-1,jj), 0._wp) + & … … 313 312 & min(zflxv(ji,jj), 0._wp) - max(zflxv(ji, jj-1), 0._wp) 314 313 315 zdep2 = bathy(ji,jj) + sshn_e(ji,jj) - rn_wdmin1314 zdep2 = ht_0(ji,jj) + sshn_e(ji,jj) - rn_wdmin1 316 315 IF(zdep2 < 0._wp) THEN !add more safty, but not necessary 317 316 !zdep2 = 0._wp 318 sshn_e(ji,jj) = rn_wdmin1 - bathy(ji,jj)317 sshn_e(ji,jj) = rn_wdmin1 - ht_0(ji,jj) 319 318 END IF 320 319 ENDDO … … 333 332 334 333 wdmask(ji,jj) = 0 335 IF(tmask(ji, jj,1) < 0.5_wp) CYCLE336 IF( bathy(ji,jj)> zdepwd) CYCLE334 IF(tmask(ji,jj,1) < 0.5_wp) CYCLE 335 IF(ht_0 (ji,jj) > zdepwd) CYCLE 337 336 338 337 ztmp = e1e2t(ji,jj) … … 344 343 345 344 zdep1 = (zzflxp + zzflxn) * z2dt / ztmp 346 zdep2 = bathy(ji,jj) + sshn_e(ji,jj) - rn_wdmin1 ! this one can be moved out of the loop345 zdep2 = ht_0(ji,jj) + sshn_e(ji,jj) - rn_wdmin1 ! this one can be moved out of the loop 347 346 zdep2 = zdep2 - z2dt * zssh_frc(ji,jj) 348 347 … … 385 384 CALL wrk_dealloc( jpi, jpj, zflxp, zflxn, zflxu1, zflxv1 ) 386 385 CALL wrk_dealloc( jpi, jpj, zwdlmtu, zwdlmtv) 387 !386 ! 388 387 END IF 389 388 ! 390 389 IF( nn_timing == 1 ) CALL timing_stop('wad_lmt') 390 ! 391 391 END SUBROUTINE wad_lmt_bt 392 393 !!============================================================================== 392 394 END MODULE wet_dry -
branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/FLO/floblk.F90
r6140 r7277 106 106 222 DO jfl = 1, jpnfl 107 107 # if defined key_mpp_mpi 108 IF( (iil(jfl) >= (mig(nldi)-jpizoom+1)) .AND. (iil(jfl) <= (mig(nlei)-jpizoom+1)) .AND. &109 (ijl(jfl) >= (mjg(nldj)-jpjzoom+1)) .AND. (ijl(jfl) <= (mjg(nlej)-jpjzoom+1))) THEN110 iiloc(jfl) = iil(jfl) - (mig(1)-jpizoom+1) + 1111 ijloc(jfl) = ijl(jfl) - (mjg(1)-jpjzoom+1) + 1108 IF( iil(jfl) >= mig(nldi) .AND. iil(jfl) <= mig(nlei) .AND. & 109 ijl(jfl) >= mjg(nldj) .AND. ijl(jfl) <= mjg(nlej) ) THEN 110 iiloc(jfl) = iil(jfl) - mig(1) + 1 111 ijloc(jfl) = ijl(jfl) - mjg(1) + 1 112 112 # else 113 113 iiloc(jfl) = iil(jfl) -
branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/FLO/flodom.F90
r6140 r7277 234 234 235 235 ! Translation of this distances (in meter) in indexes 236 zgifl(jfl)= (iimfl(jfl)-0.5) + zdxab/e1u(iimfl(jfl)-1,ijmfl(jfl)) + (mig(1)- jpizoom)237 zgjfl(jfl)= (ijmfl(jfl)-0.5) + zdyad/e2v(iimfl(jfl),ijmfl(jfl)-1) + (mjg(1)- jpjzoom)236 zgifl(jfl)= (iimfl(jfl)-0.5) + zdxab/e1u(iimfl(jfl)-1,ijmfl(jfl)) + (mig(1)-1) 237 zgjfl(jfl)= (ijmfl(jfl)-0.5) + zdyad/e2v(iimfl(jfl),ijmfl(jfl)-1) + (mjg(1)-1) 238 238 zgkfl(jfl) = (( gdepw_n(iimfl(jfl),ijmfl(jfl),ikmfl(jfl)+1) - flzz(jfl) )* ikmfl(jfl)) & 239 239 & / ( gdepw_n(iimfl(jfl),ijmfl(jfl),ikmfl(jfl)+1) & -
branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/FLO/florst.F90
r6140 r7277 102 102 IF( lk_mpp ) THEN 103 103 DO jfl = 1, jpnfl 104 IF( (INT(tpifl(jfl)) >= (mig(nldi)-jpizoom+1)) .AND. &105 &(INT(tpifl(jfl)) <= (mig(nlei)-jpizoom+1)) .AND. &106 &(INT(tpjfl(jfl)) >= (mjg(nldj)-jpjzoom+1)) .AND. &107 &(INT(tpjfl(jfl)) <= (mjg(nlej)-jpjzoom+1)) ) THEN104 IF( (INT(tpifl(jfl)) >= mig(nldi)) .AND. & 105 &(INT(tpifl(jfl)) <= mig(nlei)) .AND. & 106 &(INT(tpjfl(jfl)) >= mjg(nldj)) .AND. & 107 &(INT(tpjfl(jfl)) <= mjg(nlej)) ) THEN 108 108 iperproc(narea) = iperproc(narea)+1 109 109 ENDIF -
branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/ICB/icbutl.F90
r5215 r7277 72 72 uo_e(:,:) = 0._wp ; uo_e(1:jpi, 1:jpj) = ssu_m(:,:) * umask(:,:,1) 73 73 vo_e(:,:) = 0._wp ; vo_e(1:jpi, 1:jpj) = ssv_m(:,:) * vmask(:,:,1) 74 ff_e(:,:) = 0._wp ; ff_e(1:jpi, 1:jpj) = ff 74 ff_e(:,:) = 0._wp ; ff_e(1:jpi, 1:jpj) = ff_f (:,:) 75 75 tt_e(:,:) = 0._wp ; tt_e(1:jpi, 1:jpj) = sst_m(:,:) 76 76 fr_e(:,:) = 0._wp ; fr_e(1:jpi, 1:jpj) = fr_i (:,:) -
branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/IOM/in_out_manager.F90
r6140 r7277 17 17 IMPLICIT NONE 18 18 PUBLIC 19 20 19 21 !22 20 !!---------------------------------------------------------------------- 23 21 !! namrun namelist parameters … … 46 44 LOGICAL :: ln_clobber !: clobber (overwrite) an existing file 47 45 INTEGER :: nn_chunksz !: chunksize (bytes) for NetCDF file (works only with iom_nf90 routines) 46 48 47 #if defined key_netcdf4 49 48 !!---------------------------------------------------------------------- … … 63 62 ! ! to produce netcdf3-compatible files 64 63 #endif 64 65 65 !$AGRIF_DO_NOT_TREAT 66 66 TYPE(snc4_ctl) :: snc4set !: netcdf4 chunking control structure (always needed for decision making) … … 105 105 INTEGER :: nn_isplt !: number of processors following i 106 106 INTEGER :: nn_jsplt !: number of processors following j 107 INTEGER :: nn_bench !: benchmark parameter (0/1)108 107 INTEGER :: nn_bit_cmp = 0 !: bit reproducibility (0/1) 109 108 110 109 ! 111 INTEGER :: nprint, nictls, nictle, njctls, njctle, isplt, jsplt , nbench!: OLD namelist names110 INTEGER :: nprint, nictls, nictle, njctls, njctle, isplt, jsplt !: OLD namelist names 112 111 113 112 INTEGER :: ijsplt = 1 !: nb of local domain = nb of processors -
branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/IOM/iom.F90
r6140 r7277 789 789 ENDIF 790 790 IF( PRESENT(pv_r3d) ) THEN 791 IF( idom == jpdom_data ) THEN ; icnt(3) = jpk dta791 IF( idom == jpdom_data ) THEN ; icnt(3) = jpkglo 792 792 ELSE IF( ll_depth_spec .AND. PRESENT(kstart) ) THEN ; istart(3) = kstart(3); icnt(3) = kcount(3) 793 793 ELSE ; icnt(3) = jpk -
branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/IOM/iom_def.F90
r6140 r7277 18 18 PRIVATE 19 19 20 INTEGER, PARAMETER, PUBLIC :: jpdom_data = 1 !: ( 1 :jpi dta, 1 :jpjdta)20 INTEGER, PARAMETER, PUBLIC :: jpdom_data = 1 !: ( 1 :jpiglo, 1 :jpjglo) !!gm to be suppressed 21 21 INTEGER, PARAMETER, PUBLIC :: jpdom_global = 2 !: ( 1 :jpiglo, 1 :jpjglo) 22 22 INTEGER, PARAMETER, PUBLIC :: jpdom_local = 3 !: One of the 3 following cases -
branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/LBC/mppini_2.h90
r6140 r7277 6 6 !! FOR USING THIS VERSION, A PREPROCESSING TRAITMENT IS RECOMMENDED 7 7 !! FOR DEFINING BETTER CUTTING OUT. 8 !! This routine is used with a the bathymetryfile.8 !! This routine requires the presence of the domain configuration file. 9 9 !! In this version, the land processors are avoided and the adress 10 10 !! processor (nproc, narea,noea, ...) are calculated again. … … 32 32 !! nono : number for local neighboring processor 33 33 !! 34 !! History : 35 !! ! 94-11 (M. Guyon) Original code36 !! ! 95-04 (J. Escobar, M. Imbard)37 !! ! 98-02 (M. Guyon) FETI method38 !! ! 98-05 (M. Imbard, J. Escobar, L. Colombet ) SHMEM and MPI versions39 !! 9.0 ! 04-01 (G. Madec, J.M Molines) F90 : free form , north fold jpni > 134 !! History : ! 1994-11 (M. Guyon) Original code 35 !! OPA ! 1995-04 (J. Escobar, M. Imbard) 36 !! ! 1998-02 (M. Guyon) FETI method 37 !! ! 1998-05 (M. Imbard, J. Escobar, L. Colombet ) SHMEM and MPI versions 38 !! NEMO 1.0 ! 2004-01 (G. Madec, J.M Molines) F90 : free form , north fold jpni > 1 39 !! 4.0 ! 2016-06 (G. Madec) use domain configuration file instead of bathymetry file 40 40 !!---------------------------------------------------------------------- 41 41 USE in_out_manager ! I/O Manager … … 65 65 ione , ionw , iose , iosw , & ! " " 66 66 ibne , ibnw , ibse , ibsw ! " " 67 INTEGER, DIMENSION(jpiglo,jpjglo) :: & 68 imask ! temporary global workspace 69 REAL(wp), DIMENSION(jpiglo,jpjglo) :: & 70 zdta, zdtaisf ! temporary data workspace 71 REAL(wp) :: zidom , zjdom ! temporary scalars 72 73 ! read namelist for ln_zco 74 NAMELIST/namzgr/ ln_zco, ln_zps, ln_sco, ln_isfcav 75 67 INTEGER, DIMENSION(jpiglo,jpjglo) :: imask ! global workspace 68 REAL(wp), DIMENSION(jpiglo,jpjglo) :: zbot, ztop ! global workspace 69 REAL(wp) :: zidom , zjdom ! local scalars 76 70 !!---------------------------------------------------------------------- 77 !! OPA 9.0 , LOCEAN-IPSL (2005)71 !! NEMO/OPA 4.0 , NEMO Consortium (2016) 78 72 !! $Id$ 79 !! This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt73 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 80 74 !!---------------------------------------------------------------------- 81 75 82 REWIND( numnam_ref ) ! Namelist namzgr in reference namelist : Vertical coordinate83 READ ( numnam_ref, namzgr, IOSTAT = ios, ERR = 901)84 901 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namzgr in reference namelist', lwp )85 86 REWIND( numnam_cfg ) ! Namelist namzgr in configuration namelist : Vertical coordinate87 READ ( numnam_cfg, namzgr, IOSTAT = ios, ERR = 902 )88 902 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namzgr in configuration namelist', lwp )89 IF(lwm) WRITE ( numond, namzgr )90 91 76 IF(lwp)WRITE(numout,*) 92 IF(lwp)WRITE(numout,*) 'mpp_init : Message Passing MPI'93 IF(lwp)WRITE(numout,*) '~~~~~~~~ '77 IF(lwp)WRITE(numout,*) 'mpp_init_2 : Message Passing MPI' 78 IF(lwp)WRITE(numout,*) '~~~~~~~~~~' 94 79 IF(lwp)WRITE(numout,*) ' ' 95 80 96 IF( jpni*jpnj < jpnij ) CALL ctl_stop( ' jpnij > jpni x jpnj impossible' )81 IF( jpni*jpnj < jpnij ) CALL ctl_stop( ' jpnij > jpni x jpnj impossible' ) 97 82 98 83 ! 0. initialisation 99 84 ! ----------------- 100 101 ! open the file 102 ! Remember that at this level in the code, mpp is not yet initialized, so 103 ! the file must be open with jpdom_unknown, and kstart and kcount forced 104 jstartrow = 1 105 IF ( ln_zco ) THEN 106 CALL iom_open ( 'bathy_level.nc', inum ) ! Level bathymetry 107 ! Optionally use a file attribute (open_ocean_jstart) to set a start row for reading from the global file 108 ! This allows the unextended grid bathymetry to be stored in the same file as the under ice-shelf extended bathymetry 109 CALL iom_getatt(inum, 'open_ocean_jstart', jstartrow ) ! -999 is returned if the attribute is not found 110 jstartrow = MAX(1,jstartrow) 111 CALL iom_get ( inum, jpdom_unknown, 'Bathy_level', zdta, kstart=(/jpizoom,jpjzoom+jstartrow-1/), kcount=(/jpiglo,jpjglo/) ) 112 ELSE 113 CALL iom_open ( 'bathy_meter.nc', inum ) ! Meter bathy in case of partial steps 114 IF ( ln_isfcav ) THEN 115 CALL iom_get ( inum, jpdom_unknown, 'Bathymetry_isf' , zdta, kstart=(/jpizoom,jpjzoom/), kcount=(/jpiglo,jpjglo/) ) 116 ELSE 117 ! Optionally use a file attribute (open_ocean_jstart) to set a start row for reading from the global file 118 ! This allows the unextended grid bathymetry to be stored in the same file as the under ice-shelf extended bathymetry 119 CALL iom_getatt(inum, 'open_ocean_jstart', jstartrow ) ! -999 is returned if the attribute is not found 120 jstartrow = MAX(1,jstartrow) 121 CALL iom_get ( inum, jpdom_unknown, 'Bathymetry' , zdta, kstart=(/jpizoom,jpjzoom+jstartrow-1/) & 122 & , kcount=(/jpiglo,jpjglo/) ) 123 ENDIF 124 ENDIF 125 CALL iom_close (inum) 126 127 ! used to compute the land processor in case of not masked bathy file. 128 zdtaisf(:,:) = 0.0_wp 129 IF ( ln_isfcav ) THEN 130 CALL iom_open ( 'bathy_meter.nc', inum ) ! Meter bathy in case of partial steps 131 CALL iom_get ( inum, jpdom_unknown, 'isf_draft' , zdtaisf, kstart=(/jpizoom,jpjzoom/), kcount=(/jpiglo,jpjglo/) ) 132 END IF 133 CALL iom_close (inum) 134 135 ! land/sea mask over the global/zoom domain 136 137 imask(:,:)=1 138 WHERE ( zdta(:,:) - zdtaisf(:,:) <= rn_isfhmin ) imask = 0 85 CALL iom_open( cn_domcfg, inum ) 86 ! 87 ! ! ocean top and bottom level 88 CALL iom_get( inum, jpdom_data, 'bottom_level' , zbot ) ! nb of ocean T-points 89 CALL iom_get( inum, jpdom_data, 'top_level' , ztop ) ! nb of ocean T-points (ISF) 90 ! 91 CALL iom_close( inum ) 92 ! 93 ! 2D ocean mask (=1 if at least one level of the water column is ocean, =0 otherwise) 94 WHERE( zbot(:,:) - ztop(:,:) + 1 > 0 ) ; imask(:,:) = 1 95 ELSEWHERE ; imask(:,:) = 0 96 END WHERE 139 97 140 98 ! 1. Dimension arrays for subdomains … … 321 279 DO jj = 1+jprecj, ilj-jprecj 322 280 DO ji = 1+jpreci, ili-jpreci 323 IF( imask(ji+iimppt(ii,ij)-1, jj+ijmppt(ii,ij)-1) == 1) isurf = isurf+1281 IF( imask(ji+iimppt(ii,ij)-1, jj+ijmppt(ii,ij)-1) == 1) isurf = isurf+1 324 282 END DO 325 283 END DO -
branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/LDF/ldftra.F90
r6140 r7277 298 298 ! 299 299 INTEGER :: ji, jj, jk ! dummy loop indices 300 REAL(wp) :: zaht, zah t_min, z1_f20 ! local scalar300 REAL(wp) :: zaht, zahf, zaht_min, z1_f20 ! local scalar 301 301 !!---------------------------------------------------------------------- 302 302 ! … … 327 327 DO jj = 1, jpj 328 328 DO ji = 1, jpi 329 zaht = ( 1._wp - MIN( 1._wp , ABS( ff(ji,jj) * z1_f20 ) ) ) * ( rn_aht_0 - zaht_min ) 329 !!gm CAUTION : here we assume lat/lon grid in 20deg N/S band (like all ORCA cfg) 330 !! ==>>> The Coriolis value is identical for t- & u_points, and for v- and f-points 331 zaht = ( 1._wp - MIN( 1._wp , ABS( ff_t(ji,jj) * z1_f20 ) ) ) * ( rn_aht_0 - zaht_min ) 332 zahf = ( 1._wp - MIN( 1._wp , ABS( ff_f(ji,jj) * z1_f20 ) ) ) * ( rn_aht_0 - zaht_min ) 330 333 ahtu(ji,jj,1) = ( MAX( zaht_min, ahtu(ji,jj,1) ) + zaht ) * umask(ji,jj,1) ! min value zaht_min 331 ahtv(ji,jj,1) = ( MAX( zaht_min, ahtv(ji,jj,1) ) + zah t) * vmask(ji,jj,1) ! increase within 20S-20N334 ahtv(ji,jj,1) = ( MAX( zaht_min, ahtv(ji,jj,1) ) + zahf ) * vmask(ji,jj,1) ! increase within 20S-20N 332 335 END DO 333 336 END DO … … 555 558 END DO 556 559 557 !!gm IF( cp_cfg == "orca" .AND. jp_cfg == 2 ) THEN ! ORCA R2558 !!gm DO jj = 2, jpjm1559 !!gm DO ji = fs_2, fs_jpim1 ! vector opt.560 !!gm ! Take the minimum between aeiw and 1000 m2/s over shelves (depth shallower than 650 m)561 !!gm IF( mbkt(ji,jj) <= 20 ) zaeiw(ji,jj) = MIN( zaeiw(ji,jj), 1000. )562 !!gm END DO563 !!gm END DO564 !!gm ENDIF565 566 560 ! !== Bound on eiv coeff. ==! 567 561 z1_f20 = 1._wp / ( 2._wp * omega * sin( rad * 20._wp ) ) 568 562 DO jj = 2, jpjm1 569 563 DO ji = fs_2, fs_jpim1 ! vector opt. 570 zzaei = MIN( 1._wp, ABS( ff (ji,jj) * z1_f20 ) ) * zaeiw(ji,jj) ! tropical decrease564 zzaei = MIN( 1._wp, ABS( ff_t(ji,jj) * z1_f20 ) ) * zaeiw(ji,jj) ! tropical decrease 571 565 zaeiw(ji,jj) = MIN( zzaei , paei0 ) ! Max value = paei0 572 566 END DO -
branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/OBS/obs_conv_functions.h90
r2287 r7277 71 71 72 72 !! * Arguments 73 REAL(KIND=wp) :: pft ! in situ temperature in degrees celcius73 REAL(KIND=wp) :: pft ! in situ temperature in degrees Celsius 74 74 REAL(KIND=wp) :: pfs ! salinity in psu 75 75 REAL(KIND=wp) :: pfp ! pressure in bars -
branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/OBS/obs_prep.F90
r6140 r7277 13 13 !! obs_sor : Sort the observation arrays 14 14 !!--------------------------------------------------------------------- 15 !! * Modules used 16 USE par_kind, ONLY : & ! Precision variables 17 & wp 15 USE par_kind, ONLY : wp ! Precision variables 18 16 USE in_out_manager ! I/O manager 19 17 USE obs_profiles_def ! Definitions for storage arrays for profiles … … 24 22 USE obs_inter_sup ! Interpolation support 25 23 USE obs_oper ! Observation operators 26 USE lib_mpp, ONLY : & 27 & ctl_warn, ctl_stop 24 USE lib_mpp, ONLY : ctl_warn, ctl_stop 28 25 29 26 IMPLICIT NONE 30 31 !! * Routine accessibility32 27 PRIVATE 33 28 34 PUBLIC & 35 & obs_pre_prof, & ! First level check and screening of profile obs 36 & obs_pre_surf, & ! First level check and screening of surface obs 37 & calc_month_len ! Calculate the number of days in the months of a year 29 PUBLIC obs_pre_prof ! First level check and screening of profile obs 30 PUBLIC obs_pre_surf ! First level check and screening of surface obs 31 PUBLIC calc_month_len ! Calculate the number of days in the months of a year 38 32 39 33 !!---------------------------------------------------------------------- … … 63 57 !! ! 2015-02 (M. Martin) Combined routine for surface types. 64 58 !!---------------------------------------------------------------------- 65 !! * Modules used66 USE domstp ! Domain: set the time-step67 59 USE par_oce ! Ocean parameters 68 USE dom_oce, ONLY : & ! Geographical information 69 & glamt, & 70 & gphit, & 71 & tmask, & 72 & nproc 60 USE dom_oce, ONLY : glamt, gphit, tmask, nproc ! Geographical information 73 61 !! * Arguments 74 62 TYPE(obs_surf), INTENT(INOUT) :: surfdata ! Full set of surface data 75 63 TYPE(obs_surf), INTENT(INOUT) :: surfdataqc ! Subset of surface data not failing screening 76 64 LOGICAL, INTENT(IN) :: ld_nea ! Switch for rejecting observation near land 77 ! ! * Local declarations65 ! 78 66 INTEGER :: iyea0 ! Initial date 79 67 INTEGER :: imon0 ! - (year, month, day, hour, minute) … … 94 82 INTEGER :: inlasobsmpp ! - close to land 95 83 INTEGER :: igrdobsmpp ! - fail the grid search 96 LOGICAL, DIMENSION(:), ALLOCATABLE :: & 97 & llvalid ! SLA data selection 84 LOGICAL, DIMENSION(:), ALLOCATABLE :: llvalid ! SLA data selection 98 85 INTEGER :: jobs ! Obs. loop variable 99 86 INTEGER :: jstp ! Time loop variable 100 87 INTEGER :: inrc ! Time index variable 101 102 IF(lwp) WRITE(numout,*)'obs_pre_surf : Preparing the surface observations...' 103 IF(lwp) WRITE(numout,*) '~~~~~~~~~~~' 88 !!---------------------------------------------------------------------- 89 90 IF(lwp) WRITE(numout,*) 'obs_pre_surf : Preparing the surface observations...' 91 IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~' 104 92 105 93 ! Initial date initialization (year, month, day, hour, minute) … … 253 241 !! 254 242 !!---------------------------------------------------------------------- 255 !! * Modules used 256 USE domstp ! Domain: set the time-step 257 USE par_oce ! Ocean parameters 258 USE dom_oce, ONLY : & ! Geographical information 259 & gdept_1d, & 260 & nproc 243 USE par_oce ! Ocean parameters 244 USE dom_oce, ONLY : gdept_1d, nproc ! Geographical information 261 245 262 246 !! * Arguments … … 314 298 INTEGER :: jstp ! Time loop variable 315 299 INTEGER :: inrc ! Time index variable 300 !!---------------------------------------------------------------------- 316 301 317 302 IF(lwp) WRITE(numout,*)'obs_pre_prof: Preparing the profile data...' -
branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/SBC/sbc_oce.F90
r6140 r7277 30 30 !!---------------------------------------------------------------------- 31 31 ! !!* namsbc namelist * 32 LOGICAL , PUBLIC :: ln_ ana !: analytical boundary condition flag33 LOGICAL , PUBLIC :: ln_flx !: flux formulation34 LOGICAL , PUBLIC :: ln_blk_clio !: CLIO bulk formulation35 LOGICAL , PUBLIC :: ln_blk_core !: CORE bulk formulation36 LOGICAL , PUBLIC :: ln_blk_mfs !: MFS bulk formulation32 LOGICAL , PUBLIC :: ln_usr !: user defined formulation 33 LOGICAL , PUBLIC :: ln_flx !: flux formulation 34 LOGICAL , PUBLIC :: ln_blk_clio !: CLIO bulk formulation 35 LOGICAL , PUBLIC :: ln_blk_core !: CORE bulk formulation 36 LOGICAL , PUBLIC :: ln_blk_mfs !: MFS bulk formulation 37 37 #if defined key_oasis3 38 38 LOGICAL , PUBLIC :: lk_oasis = .TRUE. !: OASIS used … … 72 72 !! switch definition (improve readability) 73 73 !!---------------------------------------------------------------------- 74 INTEGER , PUBLIC, PARAMETER :: jp_gyre = 0 !: GYRE analytical formulation 75 INTEGER , PUBLIC, PARAMETER :: jp_ana = 1 !: analytical formulation 74 INTEGER , PUBLIC, PARAMETER :: jp_usr = 1 !: user defined formulation 76 75 INTEGER , PUBLIC, PARAMETER :: jp_flx = 2 !: flux formulation 77 76 INTEGER , PUBLIC, PARAMETER :: jp_clio = 3 !: CLIO bulk formulation -
branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/SBC/sbcblk_clio.F90
r5836 r7277 215 215 !!---------------------------------------------------------------------- 216 216 TYPE(fld), INTENT(in), DIMENSION(:) :: sf ! input data 217 REAL(wp) , INTENT(in), DIMENSION(jpi,jpj) :: pst ! surface temperature [Cel cius]217 REAL(wp) , INTENT(in), DIMENSION(jpi,jpj) :: pst ! surface temperature [Celsius] 218 218 !! 219 219 INTEGER :: ji, jj ! dummy loop indices … … 279 279 DO ji = 1, jpi 280 280 ! 281 zsst = pst(ji,jj) + rt0 ! converte Cel cius to Kelvin the SST281 zsst = pst(ji,jj) + rt0 ! converte Celsius to Kelvin the SST 282 282 ztatm = sf(jp_tair)%fnow(ji,jj,1) ! and set minimum value far above 0 K (=rt0 over land) 283 283 zcco1 = 1.0 - sf(jp_ccov)%fnow(ji,jj,1) ! fraction of clear sky ( 1 - cloud cover) … … 371 371 ! 372 372 qns(:,:) = zqlw(:,:) - zqsb(:,:) - zqla(:,:) & ! Downward Non Solar flux 373 & - zqla(:,:) * pst(:,:) * zcevap & ! remove evap. heat content at SST in Cel cius374 & + sf(jp_prec)%fnow(:,:,1) * sf(jp_tair)%fnow(:,:,1) * zcprec ! add precip. heat content at Tair in Cel cius373 & - zqla(:,:) * pst(:,:) * zcevap & ! remove evap. heat content at SST in Celsius 374 & + sf(jp_prec)%fnow(:,:,1) * sf(jp_tair)%fnow(:,:,1) * zcprec ! add precip. heat content at Tair in Celsius 375 375 qns(:,:) = qns(:,:) * tmask(:,:,1) 376 376 #if defined key_lim3 -
branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/SBC/sbcblk_core.F90
r6140 r7277 241 241 INTEGER , INTENT(in ) :: kt ! time step index 242 242 TYPE(fld), INTENT(inout), DIMENSION(:) :: sf ! input data 243 REAL(wp) , INTENT(in) , DIMENSION(:,:) :: pst ! surface temperature [Cel cius]243 REAL(wp) , INTENT(in) , DIMENSION(:,:) :: pst ! surface temperature [Celsius] 244 244 REAL(wp) , INTENT(in) , DIMENSION(:,:) :: pu ! surface current at U-point (i-component) [m/s] 245 245 REAL(wp) , INTENT(in) , DIMENSION(:,:) :: pv ! surface current at V-point (j-component) [m/s] … … 267 267 zcoef_qsatw = 0.98 * 640380. / rhoa 268 268 269 zst(:,:) = pst(:,:) + rt0 ! convert SST from Cel cius to Kelvin (and set minimum value far above 0 K)269 zst(:,:) = pst(:,:) + rt0 ! convert SST from Celsius to Kelvin (and set minimum value far above 0 K) 270 270 271 271 ! ----------------------------------------------------------------------------- ! -
branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/SBC/sbccpl.F90
r6165 r7277 555 555 WRITE(numout,*)' Additional received fields from OPA component : ' 556 556 ENDIF 557 WRITE(numout,*)' sea surface temperature (Cel cius) '557 WRITE(numout,*)' sea surface temperature (Celsius) ' 558 558 WRITE(numout,*)' sea surface salinity ' 559 559 WRITE(numout,*)' surface currents ' … … 710 710 WRITE(numout,*) 711 711 WRITE(numout,*)' sent fields to SAS component ' 712 WRITE(numout,*)' sea surface temperature (T before, Cel cius) '712 WRITE(numout,*)' sea surface temperature (T before, Celsius) ' 713 713 WRITE(numout,*)' sea surface salinity ' 714 714 WRITE(numout,*)' surface currents U,V on local grid and spherical coordinates' -
branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/SBC/sbcice_if.F90
r6140 r7277 101 101 ! ( d rho / dt ) / ( d rho / ds ) ( s = 34, t = -1.8 ) 102 102 103 CALL eos_fzp( sss_m(:,:), fr_i(:,:) ) ! sea surface freezing temperature [Cel cius]103 CALL eos_fzp( sss_m(:,:), fr_i(:,:) ) ! sea surface freezing temperature [Celsius] 104 104 fr_i(:,:) = fr_i(:,:) * tmask(:,:,1) 105 105 … … 134 134 ! # qns = zqrp -2(-4) watt/m2 if climatological ice and opa ice (zfr_obs=1, fr_i=1) 135 135 ! (-2=arctic, -4=antarctic) 136 zqi = -3. + SIGN( 1. e0, ff(ji,jj) )136 zqi = -3. + SIGN( 1._wp, ff_f(ji,jj) ) 137 137 qns(ji,jj) = ( ( 1.- zfr_obs ) * qns(ji,jj) & 138 138 & + zfr_obs * fr_i(ji,jj) * zqi ) * tmask(ji,jj,1) & -
branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/SBC/sbcisf.F90
r6140 r7277 536 536 END SUBROUTINE sbc_isf_cav 537 537 538 538 539 SUBROUTINE sbc_isf_gammats(pgt, pgs, pqhisf, pqwisf ) 539 540 !!---------------------------------------------------------------------- … … 635 636 636 637 !! compute eta* (stability parameter) 637 zetastar = 1._wp / ( SQRT(1._wp + MAX(zxsiN * zustar(ji,jj) / ( ABS(ff (ji,jj)) * zmols * zRc ), 0.0_wp)))638 zetastar = 1._wp / ( SQRT(1._wp + MAX(zxsiN * zustar(ji,jj) / ( ABS(ff_f(ji,jj)) * zmols * zRc ), 0._wp))) 638 639 639 640 !! compute the sublayer thickness … … 641 642 642 643 !! compute gamma turb 643 zgturb = 1._wp / vkarmn * LOG(zustar(ji,jj) * zxsiN * zetastar * zetastar / ( ABS(ff (ji,jj)) * zhnu )) &644 zgturb = 1._wp / vkarmn * LOG(zustar(ji,jj) * zxsiN * zetastar * zetastar / ( ABS(ff_f(ji,jj)) * zhnu )) & 644 645 & + 1._wp / ( 2 * zxsiN * zetastar ) - 1._wp / vkarmn 645 646 -
branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/SBC/sbcmod.F90
r6351 r7277 19 19 !! sbc_init : read namsbc namelist 20 20 !! sbc : surface ocean momentum, heat and freshwater boundary conditions 21 !! sbc_final : Finalize CICE ice model (if used) 21 22 !!---------------------------------------------------------------------- 22 23 USE oce ! ocean dynamics and tracers … … 28 29 USE sbcdcy ! surface boundary condition: diurnal cycle 29 30 USE sbcssm ! surface boundary condition: sea-surface mean variables 30 USE sbcana ! surface boundary condition: analytical formulation31 31 USE sbcflx ! surface boundary condition: flux formulation 32 32 USE sbcblk_clio ! surface boundary condition: bulk formulation : CLIO … … 43 43 USE sbcisf ! surface boundary condition: ice shelf 44 44 USE sbcfwb ! surface boundary condition: freshwater budget 45 USE closea ! closed sea46 45 USE icbstp ! Icebergs 47 46 USE traqsr ! active tracers: light penetration 48 47 USE sbcwave ! Wave module 49 48 USE bdy_par ! Require lk_bdy 49 USE usrdef_sbc ! user defined: surface boundary condition 50 USE usrdef_closea ! user defined: closed sea 50 51 ! 51 52 USE prtctl ! Print control (prt_ctl routine) … … 55 56 USE timing ! Timing 56 57 57 USE diurnal_bulk, ONLY: & 58 & ln_diurnal_only 58 USE diurnal_bulk, ONLY: ln_diurnal_only ! diurnal SST diagnostic 59 59 60 60 IMPLICIT NONE … … 67 67 68 68 !!---------------------------------------------------------------------- 69 !! NEMO/OPA 4.0 , NEMO-consortium (201 1)69 !! NEMO/OPA 4.0 , NEMO-consortium (2016) 70 70 !! $Id$ 71 71 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) … … 87 87 INTEGER :: icpt ! local integer 88 88 !! 89 NAMELIST/namsbc/ nn_fsbc , ln_ ana, ln_flx, ln_blk_clio, ln_blk_core, ln_blk_mfs, &89 NAMELIST/namsbc/ nn_fsbc , ln_usr , ln_flx, ln_blk_clio, ln_blk_core, ln_blk_mfs, & 90 90 & ln_cpl , ln_mixcpl, nn_components , nn_limflx , & 91 91 & ln_traqsr, ln_dm2dc , & … … 105 105 ENDIF 106 106 ! 107 REWIND( numnam_ref ) 107 REWIND( numnam_ref ) ! Namelist namsbc in reference namelist : Surface boundary 108 108 READ ( numnam_ref, namsbc, IOSTAT = ios, ERR = 901) 109 109 901 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namsbc in reference namelist', lwp ) 110 110 ! 111 REWIND( numnam_cfg ) 111 REWIND( numnam_cfg ) ! Namelist namsbc in configuration namelist : Parameters of the run 112 112 READ ( numnam_cfg, namsbc, IOSTAT = ios, ERR = 902 ) 113 113 902 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namsbc in configuration namelist', lwp ) … … 120 120 IF( lk_cice ) nn_ice = 4 121 121 ENDIF 122 IF( cp_cfg == 'gyre' ) THEN ! GYRE configuration123 ln_ana = .TRUE.124 nn_ice = 0125 ENDIF126 122 ! 127 123 IF(lwp) THEN ! Control print 128 WRITE(numout,*) ' Namelist namsbc (partly overwritten with CPP key setting)' 129 WRITE(numout,*) ' frequency update of sbc (and ice) nn_fsbc = ', nn_fsbc 130 WRITE(numout,*) ' Type of air-sea fluxes : ' 131 WRITE(numout,*) ' analytical formulation ln_ana = ', ln_ana 132 WRITE(numout,*) ' flux formulation ln_flx = ', ln_flx 133 WRITE(numout,*) ' CLIO bulk formulation ln_blk_clio = ', ln_blk_clio 134 WRITE(numout,*) ' CORE bulk formulation ln_blk_core = ', ln_blk_core 135 WRITE(numout,*) ' MFS bulk formulation ln_blk_mfs = ', ln_blk_mfs 136 WRITE(numout,*) ' Type of coupling (Ocean/Ice/Atmosphere) : ' 137 WRITE(numout,*) ' ocean-atmosphere coupled formulation ln_cpl = ', ln_cpl 138 WRITE(numout,*) ' forced-coupled mixed formulation ln_mixcpl = ', ln_mixcpl 139 WRITE(numout,*) ' OASIS coupling (with atm or sas) lk_oasis = ', lk_oasis 140 WRITE(numout,*) ' components of your executable nn_components = ', nn_components 141 WRITE(numout,*) ' Multicategory heat flux formulation (LIM3) nn_limflx = ', nn_limflx 142 WRITE(numout,*) ' Sea-ice : ' 143 WRITE(numout,*) ' ice management in the sbc (=0/1/2/3) nn_ice = ', nn_ice 144 WRITE(numout,*) ' ice-ocean embedded/levitating (=0/1/2) nn_ice_embd = ', nn_ice_embd 145 WRITE(numout,*) ' Misc. options of sbc : ' 146 WRITE(numout,*) ' Light penetration in temperature Eq. ln_traqsr = ', ln_traqsr 147 WRITE(numout,*) ' daily mean to diurnal cycle qsr ln_dm2dc = ', ln_dm2dc 148 WRITE(numout,*) ' Sea Surface Restoring on SST and/or SSS ln_ssr = ', ln_ssr 149 WRITE(numout,*) ' FreshWater Budget control (=0/1/2) nn_fwb = ', nn_fwb 150 WRITE(numout,*) ' Patm gradient added in ocean & ice Eqs. ln_apr_dyn = ', ln_apr_dyn 151 WRITE(numout,*) ' runoff / runoff mouths ln_rnf = ', ln_rnf 152 WRITE(numout,*) ' iceshelf formulation ln_isf = ', ln_isf 153 WRITE(numout,*) ' closed sea (=0/1) (set in namdom) nn_closea = ', nn_closea 154 WRITE(numout,*) ' nb of iterations if land-sea-mask applied nn_lsm = ', nn_lsm 155 WRITE(numout,*) ' surface wave ln_wave = ', ln_wave 124 WRITE(numout,*) ' Namelist namsbc (partly overwritten with CPP key setting)' 125 WRITE(numout,*) ' Frequency update of sbc (and ice) nn_fsbc = ', nn_fsbc 126 WRITE(numout,*) ' Type of air-sea fluxes : ' 127 WRITE(numout,*) ' user defined formulation ln_usr = ', ln_usr 128 WRITE(numout,*) ' flux formulation ln_flx = ', ln_flx 129 WRITE(numout,*) ' CLIO bulk formulation ln_blk_clio = ', ln_blk_clio 130 WRITE(numout,*) ' CORE bulk formulation ln_blk_core = ', ln_blk_core 131 WRITE(numout,*) ' MFS bulk formulation ln_blk_mfs = ', ln_blk_mfs 132 WRITE(numout,*) ' Type of coupling (Ocean/Ice/Atmosphere) : ' 133 WRITE(numout,*) ' ocean-atmosphere coupled formulation ln_cpl = ', ln_cpl 134 WRITE(numout,*) ' forced-coupled mixed formulation ln_mixcpl = ', ln_mixcpl 135 WRITE(numout,*) ' OASIS coupling (with atm or sas) lk_oasis = ', lk_oasis 136 WRITE(numout,*) ' components of your executable nn_components = ', nn_components 137 WRITE(numout,*) ' Multicategory heat flux formulation (LIM3) nn_limflx = ', nn_limflx 138 WRITE(numout,*) ' Sea-ice : ' 139 WRITE(numout,*) ' ice management in the sbc (=0/1/2/3) nn_ice = ', nn_ice 140 WRITE(numout,*) ' ice-ocean embedded/levitating (=0/1/2) nn_ice_embd = ', nn_ice_embd 141 WRITE(numout,*) ' Misc. options of sbc : ' 142 WRITE(numout,*) ' Light penetration in temperature Eq. ln_traqsr = ', ln_traqsr 143 WRITE(numout,*) ' daily mean to diurnal cycle qsr ln_dm2dc = ', ln_dm2dc 144 WRITE(numout,*) ' Sea Surface Restoring on SST and/or SSS ln_ssr = ', ln_ssr 145 WRITE(numout,*) ' FreshWater Budget control (=0/1/2) nn_fwb = ', nn_fwb 146 WRITE(numout,*) ' Patm gradient added in ocean & ice Eqs. ln_apr_dyn = ', ln_apr_dyn 147 WRITE(numout,*) ' runoff / runoff mouths ln_rnf = ', ln_rnf 148 WRITE(numout,*) ' iceshelf formulation ln_isf = ', ln_isf 149 WRITE(numout,*) ' closed sea (=0/1) (set in namdom) nn_closea = ', nn_closea 150 WRITE(numout,*) ' nb of iterations if land-sea-mask applied nn_lsm = ', nn_lsm 151 WRITE(numout,*) ' surface wave ln_wave = ', ln_wave 152 ENDIF 153 ! 154 IF( .NOT.ln_usr ) THEN ! the model calendar needs some specificities (except in user defined case) 155 IF( MOD( rday , rdt ) /= 0. ) CALL ctl_stop( 'the time step must devide the number of second of in a day' ) 156 IF( MOD( rday , 2. ) /= 0. ) CALL ctl_stop( 'the number of second of in a day must be an even number' ) 157 IF( MOD( rdt , 2. ) /= 0. ) CALL ctl_stop( 'the time step (in second) must be an even number' ) 156 158 ENDIF 157 159 ! … … 160 162 SELECT CASE ( nn_limflx ) ! LIM3 Multi-category heat flux formulation 161 163 CASE ( -1 ) ; WRITE(numout,*) ' LIM3: use per-category fluxes (nn_limflx = -1) ' 162 CASE ( 0) ; WRITE(numout,*) ' LIM3: use average per-category fluxes (nn_limflx = 0) '163 CASE ( 1) ; WRITE(numout,*) ' LIM3: use average then redistribute per-category fluxes (nn_limflx = 1) '164 CASE ( 2) ; WRITE(numout,*) ' LIM3: Redistribute a single flux over categories (nn_limflx = 2) '164 CASE ( 0 ) ; WRITE(numout,*) ' LIM3: use average per-category fluxes (nn_limflx = 0) ' 165 CASE ( 1 ) ; WRITE(numout,*) ' LIM3: use average then redistribute per-category fluxes (nn_limflx = 1) ' 166 CASE ( 2 ) ; WRITE(numout,*) ' LIM3: Redistribute a single flux over categories (nn_limflx = 2) ' 165 167 END SELECT 166 168 ENDIF … … 224 226 ! 225 227 icpt = 0 226 IF( ln_ ana ) THEN ; nsbc = jp_ana ; icpt = icpt + 1 ; ENDIF ! analyticalformulation228 IF( ln_usr ) THEN ; nsbc = jp_usr ; icpt = icpt + 1 ; ENDIF ! user defined formulation 227 229 IF( ln_flx ) THEN ; nsbc = jp_flx ; icpt = icpt + 1 ; ENDIF ! flux formulation 228 230 IF( ln_blk_clio ) THEN ; nsbc = jp_clio ; icpt = icpt + 1 ; ENDIF ! CLIO bulk formulation … … 230 232 IF( ln_blk_mfs ) THEN ; nsbc = jp_mfs ; icpt = icpt + 1 ; ENDIF ! MFS bulk formulation 231 233 IF( ll_purecpl ) THEN ; nsbc = jp_purecpl ; icpt = icpt + 1 ; ENDIF ! Pure Coupled formulation 232 IF( cp_cfg == 'gyre') THEN ; nsbc = jp_gyre ; ENDIF ! GYRE analytical formulation233 234 IF( nn_components == jp_iam_opa ) & 234 235 & THEN ; nsbc = jp_none ; icpt = icpt + 1 ; ENDIF ! opa coupling via SAS module … … 239 240 WRITE(numout,*) 240 241 SELECT CASE( nsbc ) 241 CASE( jp_gyre ) ; WRITE(numout,*) ' GYRE analytical formulation' 242 CASE( jp_ana ) ; WRITE(numout,*) ' analytical formulation' 242 CASE( jp_usr ) ; WRITE(numout,*) ' user defined formulation' 243 243 CASE( jp_flx ) ; WRITE(numout,*) ' flux formulation' 244 244 CASE( jp_clio ) ; WRITE(numout,*) ' CLIO bulk formulation' … … 337 337 SELECT CASE( nsbc ) ! Compute ocean surface boundary condition 338 338 ! ! (i.e. utau,vtau, qns, qsr, emp, sfx) 339 CASE( jp_gyre ) ; CALL sbc_gyre ( kt ) ! analytical formulation : GYRE configuration 340 CASE( jp_ana ) ; CALL sbc_ana ( kt ) ! analytical formulation : uniform sbc 339 CASE( jp_usr ) ; CALL usr_def_sbc ( kt ) ! user defined formulation 341 340 CASE( jp_flx ) ; CALL sbc_flx ( kt ) ! flux formulation 342 341 CASE( jp_clio ) ; CALL sbc_blk_clio( kt ) ! bulk formulation : CLIO for the ocean … … 379 378 ! (update freshwater fluxes) 380 379 ! Should not be ran if ln_diurnal_only 381 IF( .NOT. (ln_diurnal_only) .AND. (nn_closea == 1) ) CALL sbc_clo( kt)380 IF( .NOT.ln_diurnal_only .AND. nn_closea == 1 ) CALL sbc_clo( kt, cn_cfg, nn_cfg ) 382 381 383 382 !RBbug do not understand why see ticket 667 -
branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/SBC/sbcrnf.F90
r6140 r7277 20 20 USE sbc_oce ! surface boundary condition variables 21 21 USE sbcisf ! PM we could remove it I think 22 USE closea ! closed seas23 22 USE eosbn2 ! Equation Of State 23 USE usrdef_closea ! closed seas 24 24 ! 25 25 USE in_out_manager ! I/O manager -
branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/SBC/sbcssm.F90
r6140 r7277 46 46 !! 47 47 !! ** Method : compute mean surface velocity (2 components at U and 48 !! V-points) [m/s], temperature [Cel cius] and salinity [psu] over48 !! V-points) [m/s], temperature [Celsius] and salinity [psu] over 49 49 !! the periode (kt - nn_fsbc) to kt 50 50 !! Note that the inverse barometer ssh (i.e. ssh associated with Patm) … … 137 137 ! ! ---------------------------------------- ! 138 138 zcoef = 1. / REAL( nn_fsbc, wp ) 139 sst_m(:,:) = sst_m(:,:) * zcoef ! mean SST [Cel cius]139 sst_m(:,:) = sst_m(:,:) * zcoef ! mean SST [Celsius] 140 140 sss_m(:,:) = sss_m(:,:) * zcoef ! mean SSS [psu] 141 141 ssu_m(:,:) = ssu_m(:,:) * zcoef ! mean suface current [m/s] -
branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/TRA/eosbn2.F90
r6140 r7277 195 195 !! 196 196 !! nn_eos = -1 : polynomial TEOS-10 equation of state is used for rho(t,s,z). 197 !! Check value: rho = 1028.21993233072 kg/m^3 for z=3000 dbar, ct=3 Cel cius, sa=35.5 g/kg197 !! Check value: rho = 1028.21993233072 kg/m^3 for z=3000 dbar, ct=3 Celsius, sa=35.5 g/kg 198 198 !! 199 199 !! nn_eos = 0 : polynomial EOS-80 equation of state is used for rho(t,s,z). 200 !! Check value: rho = 1028.35011066567 kg/m^3 for z=3000 dbar, pt=3 Cel cius, sp=35.5 psu200 !! Check value: rho = 1028.35011066567 kg/m^3 for z=3000 dbar, pt=3 Celsius, sp=35.5 psu 201 201 !! 202 202 !! nn_eos = 1 : simplified equation of state … … 212 212 !! TEOS-10 Manual, 2010 213 213 !!---------------------------------------------------------------------- 214 REAL(wp), DIMENSION(jpi,jpj,jpk,jpts), INTENT(in ) :: pts ! 1 : potential temperature [Cel cius]214 REAL(wp), DIMENSION(jpi,jpj,jpk,jpts), INTENT(in ) :: pts ! 1 : potential temperature [Celsius] 215 215 ! ! 2 : salinity [psu] 216 216 REAL(wp), DIMENSION(jpi,jpj,jpk ), INTENT( out) :: prd ! in situ density [-] … … 307 307 !! 308 308 !!---------------------------------------------------------------------- 309 REAL(wp), DIMENSION(jpi,jpj,jpk,jpts), INTENT(in ) :: pts ! 1 : potential temperature [Cel cius]309 REAL(wp), DIMENSION(jpi,jpj,jpk,jpts), INTENT(in ) :: pts ! 1 : potential temperature [Celsius] 310 310 ! ! 2 : salinity [psu] 311 311 REAL(wp), DIMENSION(jpi,jpj,jpk ), INTENT( out) :: prd ! in situ density [-] … … 472 472 !! 473 473 !!---------------------------------------------------------------------- 474 REAL(wp), DIMENSION(jpi,jpj,jpts), INTENT(in ) :: pts ! 1 : potential temperature [Cel cius]474 REAL(wp), DIMENSION(jpi,jpj,jpts), INTENT(in ) :: pts ! 1 : potential temperature [Celsius] 475 475 ! ! 2 : salinity [psu] 476 476 REAL(wp), DIMENSION(jpi,jpj) , INTENT(in ) :: pdep ! depth [m] … … 897 897 !! 898 898 !!---------------------------------------------------------------------- 899 REAL(wp), DIMENSION(jpi,jpj,jpk,jpts), INTENT(in ) :: pts ! pot. temperature and salinity [Cel cius,psu]900 REAL(wp), DIMENSION(jpi,jpj,jpk,jpts), INTENT(in ) :: pab ! thermal/haline expansion coef. [Cel cius-1,psu-1]899 REAL(wp), DIMENSION(jpi,jpj,jpk,jpts), INTENT(in ) :: pts ! pot. temperature and salinity [Celsius,psu] 900 REAL(wp), DIMENSION(jpi,jpj,jpk,jpts), INTENT(in ) :: pab ! thermal/haline expansion coef. [Celsius-1,psu-1] 901 901 REAL(wp), DIMENSION(jpi,jpj,jpk ), INTENT( out) :: pn2 ! Brunt-Vaisala frequency squared [1/s^2] 902 902 ! … … 934 934 !! *** ROUTINE eos_pt_from_ct *** 935 935 !! 936 !! ** Purpose : Compute pot.temp. from cons. temp. [Cel cius]936 !! ** Purpose : Compute pot.temp. from cons. temp. [Celsius] 937 937 !! 938 938 !! ** Method : rational approximation (5/3th order) of TEOS-10 algorithm … … 942 942 !! Rational approximation to TEOS10 algorithm (rms error on WOA13 values: 4.0e-5 degC) 943 943 !!---------------------------------------------------------------------- 944 REAL(wp), DIMENSION(jpi,jpj), INTENT(in ) :: ctmp ! Cons. Temp [Celcius]945 REAL(wp), DIMENSION(jpi,jpj), INTENT(in ) :: psal ! salinity [psu]944 REAL(wp), DIMENSION(jpi,jpj), INTENT(in ) :: ctmp ! Cons. Temp [Celsius] 945 REAL(wp), DIMENSION(jpi,jpj), INTENT(in ) :: psal ! salinity [psu] 946 946 ! Leave result array automatic rather than making explicitly allocated 947 REAL(wp), DIMENSION(jpi,jpj) :: ptmp ! potential temperature [Cel cius]947 REAL(wp), DIMENSION(jpi,jpj) :: ptmp ! potential temperature [Celsius] 948 948 ! 949 949 INTEGER :: ji, jj ! dummy loop indices … … 993 993 !! *** ROUTINE eos_fzp *** 994 994 !! 995 !! ** Purpose : Compute the freezing point temperature [Cel cius]996 !! 997 !! ** Method : UNESCO freezing point (ptf) in Cel cius is given by995 !! ** Purpose : Compute the freezing point temperature [Celsius] 996 !! 997 !! ** Method : UNESCO freezing point (ptf) in Celsius is given by 998 998 !! ptf(t,z) = (-.0575+1.710523e-3*sqrt(abs(s))-2.154996e-4*s)*s - 7.53e-4*z 999 999 !! checkvalue: tf=-2.588567 Celsius for s=40psu, z=500m … … 1003 1003 REAL(wp), DIMENSION(jpi,jpj), INTENT(in ) :: psal ! salinity [psu] 1004 1004 REAL(wp), DIMENSION(jpi,jpj), INTENT(in ), OPTIONAL :: pdep ! depth [m] 1005 REAL(wp), DIMENSION(jpi,jpj), INTENT(out ) :: ptf ! freezing temperature [Cel cius]1005 REAL(wp), DIMENSION(jpi,jpj), INTENT(out ) :: ptf ! freezing temperature [Celsius] 1006 1006 ! 1007 1007 INTEGER :: ji, jj ! dummy loop indices … … 1044 1044 !! *** ROUTINE eos_fzp *** 1045 1045 !! 1046 !! ** Purpose : Compute the freezing point temperature [Cel cius]1047 !! 1048 !! ** Method : UNESCO freezing point (ptf) in Cel cius is given by1046 !! ** Purpose : Compute the freezing point temperature [Celsius] 1047 !! 1048 !! ** Method : UNESCO freezing point (ptf) in Celsius is given by 1049 1049 !! ptf(t,z) = (-.0575+1.710523e-3*sqrt(abs(s))-2.154996e-4*s)*s - 7.53e-4*z 1050 1050 !! checkvalue: tf=-2.588567 Celsius for s=40psu, z=500m … … 1054 1054 REAL(wp), INTENT(in ) :: psal ! salinity [psu] 1055 1055 REAL(wp), INTENT(in ), OPTIONAL :: pdep ! depth [m] 1056 REAL(wp), INTENT(out) :: ptf ! freezing temperature [Cel cius]1056 REAL(wp), INTENT(out) :: ptf ! freezing temperature [Celsius] 1057 1057 ! 1058 1058 REAL(wp) :: zs ! local scalars -
branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_cen.F90
r6140 r7277 37 37 !!---------------------------------------------------------------------- 38 38 !! NEMO/OPA 3.7 , NEMO Consortium (2014) 39 !! $Id : traadv_cen2.F90 5737 2015-09-13 07:42:41Z gm$39 !! $Id$ 40 40 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 41 41 !!---------------------------------------------------------------------- -
branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_fct.F90
r6140 r7277 38 38 REAL(wp) :: r1_6 = 1._wp / 6._wp ! =1/6 39 39 40 ! ! tridiag solver associated indices: 41 INTEGER, PARAMETER :: np_NH = 0 ! Neumann homogeneous boundary condition 42 INTEGER, PARAMETER :: np_CEN2 = 1 ! 2nd order centered boundary condition 43 40 44 !! * Substitutions 41 45 # include "vectopt_loop_substitute.h90" … … 149 153 DO jj = 2, jpjm1 150 154 DO ji = fs_2, fs_jpim1 ! vector opt. 151 ! total intermediate advective trends155 ! ! total intermediate advective trends 152 156 ztra = - ( zwx(ji,jj,jk) - zwx(ji-1,jj ,jk ) & 153 157 & + zwy(ji,jj,jk) - zwy(ji ,jj-1,jk ) & 154 & + zwz(ji,jj,jk) - zwz(ji ,jj ,jk+1) ) * r1_e1e2t(ji,jj) / e3t_n(ji,jj,jk) 155 ! update and guess with monotonic sheme 156 !!gm why tmask added in the two following lines ??? the mask is done in tranxt ! 157 pta(ji,jj,jk,jn) = pta(ji,jj,jk,jn) + ztra * tmask(ji,jj,jk) 158 zwi(ji,jj,jk) = ( ptb(ji,jj,jk,jn) + p2dt * ztra ) * tmask(ji,jj,jk) 158 & + zwz(ji,jj,jk) - zwz(ji ,jj ,jk+1) ) * r1_e1e2t(ji,jj) 159 ! ! update and guess with monotonic sheme 160 pta(ji,jj,jk,jn) = pta(ji,jj,jk,jn) + ztra / e3t_n(ji,jj,jk) * tmask(ji,jj,jk) 161 zwi(ji,jj,jk) = ( e3t_b(ji,jj,jk) * ptb(ji,jj,jk,jn) + p2dt * ztra ) / e3t_a(ji,jj,jk) * tmask(ji,jj,jk) 159 162 END DO 160 163 END DO … … 163 166 ! 164 167 IF( l_trd ) THEN ! trend diagnostics (contribution of upstream fluxes) 165 ztrdx(:,:,:) = zwx(:,:,:) ; ztrdy(:,:,:) = zwy(:,:,:); ztrdz(:,:,:) = zwz(:,:,:)168 ztrdx(:,:,:) = zwx(:,:,:) ; ztrdy(:,:,:) = zwy(:,:,:) ; ztrdz(:,:,:) = zwz(:,:,:) 166 169 END IF 167 170 ! ! "Poleward" heat and salt transports (contribution of upstream fluxes) … … 364 367 ! 365 368 CALL wrk_alloc( jpi,jpj, zwx_sav, zwy_sav ) 366 CALL wrk_alloc( jpi,jpj, jpk,zwx, zwy, zwz, zwi, zhdiv, zwzts, zwz_sav )369 CALL wrk_alloc( jpi,jpj,jpk, zwx, zwy, zwz, zwi, zhdiv, zwzts, zwz_sav ) 367 370 CALL wrk_alloc( jpi,jpj,jpk,kjpt+1, ztrs ) 368 371 ! … … 436 439 ztra = - ( zwx(ji,jj,jk) - zwx(ji-1,jj ,jk ) & 437 440 & + zwy(ji,jj,jk) - zwy(ji ,jj-1,jk ) & 438 & + zwz(ji,jj,jk) - zwz(ji ,jj ,jk+1) ) * r1_e1e2t(ji,jj) / e3t_n(ji,jj,jk)441 & + zwz(ji,jj,jk) - zwz(ji ,jj ,jk+1) ) * r1_e1e2t(ji,jj) 439 442 ! ! update and guess with monotonic sheme 440 pta(ji,jj,jk,jn) = pta(ji,jj,jk,jn) + ztra441 zwi(ji,jj,jk) = ( ptb(ji,jj,jk,jn) + p2dt * ztra) * tmask(ji,jj,jk)443 pta(ji,jj,jk,jn) = pta(ji,jj,jk,jn) + ztra / e3t_n(ji,jj,jk) * tmask(ji,jj,jk) 444 zwi(ji,jj,jk) = ( e3t_b(ji,jj,jk) * ptb(ji,jj,jk,jn) + p2dt * ztra ) / e3t_a(ji,jj,jk) * tmask(ji,jj,jk) 442 445 END DO 443 446 END DO … … 488 491 zwz_sav(:,:,:) = zwz(:,:,:) 489 492 ztrs (:,:,:,1) = ptb(:,:,:,jn) 493 ztrs (:,:,1,2) = ptb(:,:,1,jn) 494 ztrs (:,:,1,3) = ptb(:,:,1,jn) 490 495 zwzts (:,:,:) = 0._wp 491 496 ! … … 705 710 706 711 707 SUBROUTINE interp_4th_cpt ( pt_in, pt_out )708 !!---------------------------------------------------------------------- 709 !! *** ROUTINE interp_4th_cpt ***712 SUBROUTINE interp_4th_cpt_org( pt_in, pt_out ) 713 !!---------------------------------------------------------------------- 714 !! *** ROUTINE interp_4th_cpt_org *** 710 715 !! 711 716 !! ** Purpose : Compute the interpolation of tracer at w-point … … 738 743 END DO 739 744 ! 740 jk =2! Switch to second order centered at top741 DO jj =1,jpj742 DO ji =1,jpi745 jk = 2 ! Switch to second order centered at top 746 DO jj = 1, jpj 747 DO ji = 1, jpi 743 748 zwd (ji,jj,jk) = 1._wp 744 749 zwi (ji,jj,jk) = 0._wp … … 788 793 END DO 789 794 ! 795 END SUBROUTINE interp_4th_cpt_org 796 797 798 SUBROUTINE interp_4th_cpt( pt_in, pt_out ) 799 !!---------------------------------------------------------------------- 800 !! *** ROUTINE interp_4th_cpt *** 801 !! 802 !! ** Purpose : Compute the interpolation of tracer at w-point 803 !! 804 !! ** Method : 4th order compact interpolation 805 !!---------------------------------------------------------------------- 806 REAL(wp),DIMENSION(jpi,jpj,jpk), INTENT(in ) :: pt_in ! field at t-point 807 REAL(wp),DIMENSION(jpi,jpj,jpk), INTENT( out) :: pt_out ! field interpolated at w-point 808 ! 809 INTEGER :: ji, jj, jk ! dummy loop integers 810 INTEGER :: ikt, ikb ! local integers 811 REAL(wp),DIMENSION(jpi,jpj,jpk) :: zwd, zwi, zws, zwrm, zwt 812 !!---------------------------------------------------------------------- 813 ! 814 ! !== build the three diagonal matrix & the RHS ==! 815 ! 816 DO jk = 3, jpkm1 ! interior (from jk=3 to jpk-1) 817 DO jj = 2, jpjm1 818 DO ji = fs_2, fs_jpim1 819 zwd (ji,jj,jk) = 3._wp * wmask(ji,jj,jk) + 1._wp ! diagonal 820 zwi (ji,jj,jk) = wmask(ji,jj,jk) ! lower diagonal 821 zws (ji,jj,jk) = wmask(ji,jj,jk) ! upper diagonal 822 zwrm(ji,jj,jk) = 3._wp * wmask(ji,jj,jk) & ! RHS 823 & * ( pt_in(ji,jj,jk) + pt_in(ji,jj,jk-1) ) 824 END DO 825 END DO 826 END DO 827 ! 828 !!gm 829 ! SELECT CASE( kbc ) !* boundary condition 830 ! CASE( np_NH ) ! Neumann homogeneous at top & bottom 831 ! CASE( np_CEN2 ) ! 2nd order centered at top & bottom 832 ! END SELECT 833 !!gm 834 ! 835 DO jj = 2, jpjm1 ! 2nd order centered at top & bottom 836 DO ji = fs_2, fs_jpim1 837 ikt = mikt(ji,jj) + 1 ! w-point below the 1st wet point 838 ikb = mbkt(ji,jj) ! - above the last wet point 839 ! 840 zwd (ji,jj,ikt) = 1._wp ! top 841 zwi (ji,jj,ikt) = 0._wp 842 zws (ji,jj,ikt) = 0._wp 843 zwrm(ji,jj,ikt) = 0.5_wp * ( pt_in(ji,jj,jk-1) + pt_in(ji,jj,jk) ) 844 ! 845 zwd (ji,jj,ikb) = 1._wp ! bottom 846 zwi (ji,jj,ikb) = 0._wp 847 zws (ji,jj,ikb) = 0._wp 848 zwrm(ji,jj,ikb) = 0.5_wp * ( pt_in(ji,jj,jk-1) + pt_in(ji,jj,jk) ) 849 END DO 850 END DO 851 ! 852 ! !== tridiagonal solver ==! 853 ! 854 DO jj = 2, jpjm1 !* 1st recurrence: Tk = Dk - Ik Sk-1 / Tk-1 855 DO ji = fs_2, fs_jpim1 856 zwt(ji,jj,2) = zwd(ji,jj,2) 857 END DO 858 END DO 859 DO jk = 3, jpkm1 860 DO jj = 2, jpjm1 861 DO ji = fs_2, fs_jpim1 862 zwt(ji,jj,jk) = zwd(ji,jj,jk) - zwi(ji,jj,jk) * zws(ji,jj,jk-1) /zwt(ji,jj,jk-1) 863 END DO 864 END DO 865 END DO 866 ! 867 DO jj = 2, jpjm1 !* 2nd recurrence: Zk = Yk - Ik / Tk-1 Zk-1 868 DO ji = fs_2, fs_jpim1 869 pt_out(ji,jj,2) = zwrm(ji,jj,2) 870 END DO 871 END DO 872 DO jk = 3, jpkm1 873 DO jj = 2, jpjm1 874 DO ji = fs_2, fs_jpim1 875 pt_out(ji,jj,jk) = zwrm(ji,jj,jk) - zwi(ji,jj,jk) / zwt(ji,jj,jk-1) *pt_out(ji,jj,jk-1) 876 END DO 877 END DO 878 END DO 879 880 DO jj = 2, jpjm1 !* 3d recurrence: Xk = (Zk - Sk Xk+1 ) / Tk 881 DO ji = fs_2, fs_jpim1 882 pt_out(ji,jj,jpkm1) = pt_out(ji,jj,jpkm1) / zwt(ji,jj,jpkm1) 883 END DO 884 END DO 885 DO jk = jpk-2, 2, -1 886 DO jj = 2, jpjm1 887 DO ji = fs_2, fs_jpim1 888 pt_out(ji,jj,jk) = ( pt_out(ji,jj,jk) - zws(ji,jj,jk) * pt_out(ji,jj,jk+1) ) / zwt(ji,jj,jk) 889 END DO 890 END DO 891 END DO 892 ! 790 893 END SUBROUTINE interp_4th_cpt 791 894 895 896 SUBROUTINE tridia_solver( pD, pU, pL, pRHS, pt_out , klev ) 897 !!---------------------------------------------------------------------- 898 !! *** ROUTINE tridia_solver *** 899 !! 900 !! ** Purpose : solve a symmetric 3diagonal system 901 !! 902 !! ** Method : solve M.t_out = RHS(t) where M is a tri diagonal matrix ( jpk*jpk ) 903 !! 904 !! ( D_1 U_1 0 0 0 )( t_1 ) ( RHS_1 ) 905 !! ( L_2 D_2 U_2 0 0 )( t_2 ) ( RHS_2 ) 906 !! ( 0 L_3 D_3 U_3 0 )( t_3 ) = ( RHS_3 ) 907 !! ( ... )( ... ) ( ... ) 908 !! ( 0 0 0 L_k D_k )( t_k ) ( RHS_k ) 909 !! 910 !! M is decomposed in the product of an upper and lower triangular matrix. 911 !! The tri-diagonals matrix is given as input 3D arrays: pD, pU, pL 912 !! (i.e. the Diagonal, the Upper diagonal, and the Lower diagonal). 913 !! The solution is pta. 914 !! The 3d array zwt is used as a work space array. 915 !!---------------------------------------------------------------------- 916 REAL(wp),DIMENSION(:,:,:), INTENT(in ) :: pD, pU, PL ! 3-diagonal matrix 917 REAL(wp),DIMENSION(:,:,:), INTENT(in ) :: pRHS ! Right-Hand-Side 918 REAL(wp),DIMENSION(:,:,:), INTENT( out) :: pt_out !!gm field at level=F(klev) 919 INTEGER , INTENT(in ) :: klev ! =1 pt_out at w-level 920 ! ! =0 pt at t-level 921 INTEGER :: ji, jj, jk ! dummy loop integers 922 INTEGER :: kstart ! local indices 923 REAL(wp),DIMENSION(jpi,jpj,jpk) :: zwt ! 3D work array 924 !!---------------------------------------------------------------------- 925 ! 926 kstart = 1 + klev 927 ! 928 DO jj = 2, jpjm1 !* 1st recurrence: Tk = Dk - Ik Sk-1 / Tk-1 929 DO ji = fs_2, fs_jpim1 930 zwt(ji,jj,kstart) = pD(ji,jj,kstart) 931 END DO 932 END DO 933 DO jk = kstart+1, jpkm1 934 DO jj = 2, jpjm1 935 DO ji = fs_2, fs_jpim1 936 zwt(ji,jj,jk) = pD(ji,jj,jk) - pL(ji,jj,jk) * pU(ji,jj,jk-1) /zwt(ji,jj,jk-1) 937 END DO 938 END DO 939 END DO 940 ! 941 DO jj = 2, jpjm1 !* 2nd recurrence: Zk = Yk - Ik / Tk-1 Zk-1 942 DO ji = fs_2, fs_jpim1 943 pt_out(ji,jj,kstart) = pRHS(ji,jj,kstart) 944 END DO 945 END DO 946 DO jk = kstart+1, jpkm1 947 DO jj = 2, jpjm1 948 DO ji = fs_2, fs_jpim1 949 pt_out(ji,jj,jk) = pRHS(ji,jj,jk) - pL(ji,jj,jk) / zwt(ji,jj,jk-1) *pt_out(ji,jj,jk-1) 950 END DO 951 END DO 952 END DO 953 954 DO jj = 2, jpjm1 !* 3d recurrence: Xk = (Zk - Sk Xk+1 ) / Tk 955 DO ji = fs_2, fs_jpim1 956 pt_out(ji,jj,jpkm1) = pt_out(ji,jj,jpkm1) / zwt(ji,jj,jpkm1) 957 END DO 958 END DO 959 DO jk = jpk-2, kstart, -1 960 DO jj = 2, jpjm1 961 DO ji = fs_2, fs_jpim1 962 pt_out(ji,jj,jk) = ( pt_out(ji,jj,jk) - pU(ji,jj,jk) * pt_out(ji,jj,jk+1) ) / zwt(ji,jj,jk) 963 END DO 964 END DO 965 END DO 966 ! 967 END SUBROUTINE tridia_solver 968 792 969 !!====================================================================== 793 970 END MODULE traadv_fct -
branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_mle.F90
r6140 r7277 329 329 DO jj = 2, jpj ! "coriolis+ time^-1" at u- & v-points 330 330 DO ji = fs_2, jpi ! vector opt. 331 zfu = ( ff (ji,jj) + ff(ji,jj-1) ) * 0.5_wp332 zfv = ( ff (ji,jj) + ff(ji-1,jj) ) * 0.5_wp331 zfu = ( ff_f(ji,jj) + ff_f(ji,jj-1) ) * 0.5_wp 332 zfv = ( ff_f(ji,jj) + ff_f(ji-1,jj) ) * 0.5_wp 333 333 rfu(ji,jj) = SQRT( zfu * zfu + z1_t2 ) 334 334 rfv(ji,jj) = SQRT( zfv * zfv + z1_t2 ) … … 347 347 ! 348 348 z1_t2 = 1._wp / ( rn_time * rn_time ) 349 r1_ft(:,:) = 2._wp * omega * SIN( rad * gphit(:,:) ) 350 r1_ft(:,:) = 1._wp / SQRT( r1_ft(:,:) * r1_ft(:,:) + z1_t2 ) 349 r1_ft(:,:) = 1._wp / SQRT( ff_t(:,:) * ff_t(:,:) + z1_t2 ) 351 350 ! 352 351 ENDIF -
branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_mus.F90
r6140 r7277 37 37 38 38 REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) :: upsmsk !: mixed upstream/centered scheme near some straits 39 ! ! and in closed seas (orca 2 and 4configurations)39 ! ! and in closed seas (orca 2 and 1 configurations) 40 40 REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: xind !: mixed upstream/centered index 41 41 -
branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/TRA/trabbl.F90
r6140 r7277 545 545 CALL wrk_dealloc( jpi, jpj, zmbk ) 546 546 547 547 ! !* sign of grad(H) at u- and v-points 548 548 mgrhu(jpi,:) = 0 ; mgrhu(:,jpj) = 0 ; mgrhv(jpi,:) = 0 ; mgrhv(:,jpj) = 0 549 549 DO jj = 1, jpjm1 … … 553 553 END DO 554 554 END DO 555 555 ! 556 556 DO jj = 1, jpjm1 !* bbl thickness at u- (v-) point 557 557 DO ji = 1, jpim1 ! minimum of top & bottom e3u_0 (e3v_0) … … 561 561 END DO 562 562 CALL lbc_lnk( e3u_bbl_0, 'U', 1. ) ; CALL lbc_lnk( e3v_bbl_0, 'V', 1. ) ! lateral boundary conditions 563 563 ! 564 564 ! !* masked diffusive flux coefficients 565 565 ahu_bbl_0(:,:) = rn_ahtbbl * e2_e1u(:,:) * e3u_bbl_0(:,:) * umask(:,:,1) 566 566 ahv_bbl_0(:,:) = rn_ahtbbl * e1_e2v(:,:) * e3v_bbl_0(:,:) * vmask(:,:,1) 567 567 568 569 IF( cp_cfg == "orca" ) THEN !* ORCA configuration : regional enhancement of ah_bbl570 !571 SELECT CASE ( jp_cfg )572 CASE ( 2 ) ! ORCA_R2573 ij0 = 102 ; ij1 = 102 ! Gibraltar enhancement of BBL574 ii0 = 139 ; ii1 = 140575 ahu_bbl_0(mi0(ii0):mi1(ii1),mj0(ij0):mj1(ij1)) = 4.e0*ahu_bbl_0(mi0(ii0):mi1(ii1),mj0(ij0):mj1(ij1))576 ahv_bbl_0(mi0(ii0):mi1(ii1),mj0(ij0):mj1(ij1)) = 4.e0*ahv_bbl_0(mi0(ii0):mi1(ii1),mj0(ij0):mj1(ij1))577 !578 ij0 = 88 ; ij1 = 88 ! Red Sea enhancement of BBL579 ii0 = 161 ; ii1 = 162580 ahu_bbl_0(mi0(ii0):mi1(ii1),mj0(ij0):mj1(ij1)) = 10.e0*ahu_bbl_0(mi0(ii0):mi1(ii1),mj0(ij0):mj1(ij1))581 ahv_bbl_0(mi0(ii0):mi1(ii1),mj0(ij0):mj1(ij1)) = 10.e0*ahv_bbl_0(mi0(ii0):mi1(ii1),mj0(ij0):mj1(ij1))582 !583 CASE ( 4 ) ! ORCA_R4584 ij0 = 52 ; ij1 = 52 ! Gibraltar enhancement of BBL585 ii0 = 70 ; ii1 = 71586 ahu_bbl_0(mi0(ii0):mi1(ii1),mj0(ij0):mj1(ij1)) = 4.e0*ahu_bbl_0(mi0(ii0):mi1(ii1),mj0(ij0):mj1(ij1))587 ahv_bbl_0(mi0(ii0):mi1(ii1),mj0(ij0):mj1(ij1)) = 4.e0*ahv_bbl_0(mi0(ii0):mi1(ii1),mj0(ij0):mj1(ij1))588 END SELECT589 !590 ENDIF591 568 ! 592 569 IF( nn_timing == 1 ) CALL timing_stop( 'tra_bbl_init') -
branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/nemogcm.F90
r6152 r7277 33 33 !! - ! 2013-06 (I. Epicoco, S. Mocavero, CMCC) nemo_northcomms: setup avoiding MPI communication 34 34 !! - ! 2014-12 (G. Madec) remove KPP scheme and cross-land advection (cla) 35 !! 4.0 ! 2016-10 (G. Madec, S. Flavoni) domain configuration / user defined interface 35 36 !!---------------------------------------------------------------------- 36 37 … … 45 46 !!---------------------------------------------------------------------- 46 47 USE step_oce ! module used in the ocean time stepping module (step.F90) 47 USE domcfg ! domain configuration (dom_cfg routine) 48 USE mppini ! shared/distributed memory setting (mpp_init routine) 49 USE domain ! domain initialization (dom_init routine) 50 #if defined key_nemocice_decomp 51 USE ice_domain_size, only: nx_global, ny_global 52 #endif 48 USE phycst ! physical constant (par_cst routine) 49 USE domain ! domain initialization (dom_init & dom_cfg routines) 50 USE usrdef_nam ! user defined configuration 53 51 USE tideini ! tidal components initialization (tide_ini routine) 54 52 USE bdyini ! open boundary cond. setting (bdy_init routine) … … 60 58 USE ldftra ! lateral diffusivity setting (ldftra_init routine) 61 59 USE zdfini ! vertical physics setting (zdf_init routine) 62 USE phycst ! physical constant (par_cst routine)63 60 USE trdini ! dyn/tra trends initialization (trd_init routine) 64 61 USE asminc ! assimilation increments … … 68 65 USE diaobs ! Observation diagnostics (dia_obs_init routine) 69 66 USE diacfl ! CFL diagnostics (dia_cfl_init routine) 70 USE lib_fortran ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined)71 67 USE step ! NEMO time-stepping (stp routine) 72 68 USE icbini ! handle bergs, initialisation … … 78 74 USE stopar ! Stochastic param.: ??? 79 75 USE stopts ! Stochastic param.: ??? 76 USE diurnal_bulk ! diurnal bulk SST 77 USE step_diu ! diurnal bulk SST timestepping (called from here if run offline) 78 USE crsini ! initialise grid coarsening utility 79 USE diatmb ! Top,middle,bottom output 80 USE dia25h ! 25h mean output 81 USE sbc_oce , ONLY : lk_oasis 82 USE wet_dry ! Wetting and drying setting (wad_init routine) 80 83 #if defined key_top 81 84 USE trcini ! passive tracer initialisation 82 85 #endif 86 #if defined key_nemocice_decomp 87 USE ice_domain_size, only: nx_global, ny_global 88 #endif 89 ! 83 90 USE lib_mpp ! distributed memory computing 84 USE diurnal_bulk ! diurnal bulk SST 85 USE step_diu ! diurnal bulk SST timestepping (called from here if run offline) 91 USE mppini ! shared/distributed memory setting (mpp_init routine) 92 USE lbcnfd , ONLY : isendto, nsndto, nfsloop, nfeloop ! Setup of north fold exchanges 93 USE lib_fortran ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined) 86 94 #if defined key_iomput 87 95 USE xios ! xIOserver 88 96 #endif 89 USE crsini ! initialise grid coarsening utility90 USE lbcnfd , ONLY : isendto, nsndto, nfsloop, nfeloop ! Setup of north fold exchanges91 USE sbc_oce, ONLY : lk_oasis92 USE diatmb ! Top,middle,bottom output93 USE dia25h ! 25h mean output94 USE wet_dry ! Wetting and drying setting (wad_init routine)95 97 96 98 IMPLICIT NONE … … 104 106 105 107 !!---------------------------------------------------------------------- 106 !! NEMO/OPA 3.7 , NEMO Consortium (2015)108 !! NEMO/OPA 4.0 , NEMO Consortium (2016) 107 109 !! $Id$ 108 110 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) … … 124 126 !! Madec, 2008, internal report, IPSL. 125 127 !!---------------------------------------------------------------------- 126 INTEGER :: istp 128 INTEGER :: istp ! time step index 127 129 !!---------------------------------------------------------------------- 128 130 ! … … 130 132 CALL Agrif_Init_Grids() ! AGRIF: set the meshes 131 133 #endif 132 134 ! 133 135 ! !-----------------------! 134 136 CALL nemo_init !== Initialisations ==! … … 195 197 ! !== finalize the run ==! 196 198 ! !------------------------! 197 IF(lwp) WRITE(numout,cform_aaa) ! Flag AAAAAAA198 ! 199 IF( nstop /= 0 .AND. lwp ) THEN ! error print199 IF(lwp) WRITE(numout,cform_aaa) ! Flag AAAAAAA 200 ! 201 IF( nstop /= 0 .AND. lwp ) THEN ! error print 200 202 WRITE(numout,cform_err) 201 203 WRITE(numout,*) nstop, ' error have been found' … … 215 217 ! 216 218 #if defined key_iomput 217 CALL xios_finalize ! end mpp communications with xios218 IF( lk_oasis ) CALL cpl_finalize ! end coupling and mpp communications with OASIS219 CALL xios_finalize ! end mpp communications with xios 220 IF( lk_oasis ) CALL cpl_finalize ! end coupling and mpp communications with OASIS 219 221 #else 220 222 IF( lk_oasis ) THEN 221 CALL cpl_finalize ! end coupling and mpp communications with OASIS223 CALL cpl_finalize ! end coupling and mpp communications with OASIS 222 224 ELSE 223 IF( lk_mpp ) CALL mppstop ! end mpp communications225 IF( lk_mpp ) CALL mppstop ! end mpp communications 224 226 ENDIF 225 227 #endif … … 234 236 !! ** Purpose : initialization of the NEMO GCM 235 237 !!---------------------------------------------------------------------- 236 INTEGER :: ji! dummy loop indices237 INTEGER ::ilocal_comm ! local integer238 INTEGER :: ios239 CHARACTER(len=80), DIMENSION(16) :: cltxt240 !241 NAMELIST/namctl/ ln_ctl , nn_print, nn_ictls, nn_ictle, &242 & nn_ isplt, nn_jsplt, nn_jctls, nn_jctle, &243 & nn_bench, nn_timing, nn_diacfl244 NAMELIST/namcfg/ cp_cfg, cp_cfz, jp_cfg, jpidta, jpjdta, jpkdta, jpiglo, jpjglo, &245 & jpizoom, jpjzoom, jperio, ln_use_jattr246 !!----------------------------------------------------------------------247 !248 cl txt = ''238 INTEGER :: ji ! dummy loop indices 239 INTEGER :: ios, ilocal_comm ! local integer 240 CHARACTER(len=120), DIMENSION(30) :: cltxt, cltxt2, clnam 241 ! 242 NAMELIST/namctl/ ln_ctl , nn_print, nn_ictls, nn_ictle, & 243 & nn_isplt , nn_jsplt, nn_jctls, nn_jctle, & 244 & nn_timing, nn_diacfl 245 NAMELIST/namcfg/ ln_read_cfg, cn_domcfg, ln_write_cfg, cn_domcfg_out, ln_use_jattr 246 !!---------------------------------------------------------------------- 247 ! 248 cltxt = '' 249 cltxt2 = '' 250 clnam = '' 249 251 cxios_context = 'nemo' 250 252 ! … … 253 255 CALL ctl_opn( numnam_cfg, 'namelist_cfg', 'OLD', 'FORMATTED', 'SEQUENTIAL', -1, 6, .FALSE. ) 254 256 ! 255 REWIND( numnam_ref ) ! Namelist namctl in reference namelist : Control prints & Benchmark257 REWIND( numnam_ref ) ! Namelist namctl in reference namelist : Control prints 256 258 READ ( numnam_ref, namctl, IOSTAT = ios, ERR = 901 ) 257 259 901 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namctl in reference namelist', .TRUE. ) 258 259 REWIND( numnam_cfg ) ! Namelist namctl in confguration namelist : Control prints & Benchmark260 ! 261 REWIND( numnam_cfg ) ! Namelist namctl in confguration namelist 260 262 READ ( numnam_cfg, namctl, IOSTAT = ios, ERR = 902 ) 261 263 902 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namctl in configuration namelist', .TRUE. ) 262 263 ! 264 REWIND( numnam_ref ) ! Namelist namcfg in reference namelist : Control prints & Benchmark 264 ! 265 REWIND( numnam_ref ) ! Namelist namcfg in reference namelist : Control prints 265 266 READ ( numnam_ref, namcfg, IOSTAT = ios, ERR = 903 ) 266 267 903 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namcfg in reference namelist', .TRUE. ) … … 270 271 904 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namcfg in configuration namelist', .TRUE. ) 271 272 272 ! Force values for AGRIF zoom (cf. agrif_user.F90) 273 ! !--------------------------! 274 ! ! Set global domain size ! (control print return in cltxt2) 275 ! !--------------------------! 276 IF( ln_read_cfg ) THEN ! Read sizes in domain configuration file 277 CALL domain_cfg ( cltxt2, cn_cfg, nn_cfg, jpiglo, jpjglo, jpkglo, jperio ) 278 ! 279 ELSE ! user-defined namelist 280 CALL usr_def_nam( cltxt2, clnam, cn_cfg, nn_cfg, jpiglo, jpjglo, jpkglo, jperio ) 281 ENDIF 282 ! 283 jpk = jpkglo 284 ! 273 285 #if defined key_agrif 274 IF( .NOT. Agrif_Root() ) THEN 275 jpiglo = nbcellsx + 2 + 2*nbghostcells 276 jpjglo = nbcellsy + 2 + 2*nbghostcells 277 jpi = ( jpiglo-2*jpreci + (jpni-1+0) ) / jpni + 2*jpreci 278 jpj = ( jpjglo-2*jprecj + (jpnj-1+0) ) / jpnj + 2*jprecj 279 jpidta = jpiglo 280 jpjdta = jpjglo 281 jpizoom = 1 282 jpjzoom = 1 283 nperio = 0 284 jperio = 0 285 ln_use_jattr = .false. 286 ENDIF 286 IF( .NOT. Agrif_Root() ) THEN ! AGRIF children: specific setting (cf. agrif_user.F90) 287 jpiglo = nbcellsx + 2 + 2*nbghostcells 288 jpjglo = nbcellsy + 2 + 2*nbghostcells 289 jpi = ( jpiglo-2*jpreci + (jpni-1+0) ) / jpni + 2*jpreci 290 jpj = ( jpjglo-2*jprecj + (jpnj-1+0) ) / jpnj + 2*jprecj 291 nperio = 0 292 jperio = 0 293 ln_use_jattr = .false. 294 ENDIF 287 295 #endif 288 296 ! … … 295 303 IF( Agrif_Root() ) THEN 296 304 IF( lk_oasis ) THEN 297 CALL cpl_init( "oceanx", ilocal_comm ) ! nemo local communicator given by oasis298 CALL xios_initialize( "not used" ,local_comm=ilocal_comm ) ! send nemo communicator to xios305 CALL cpl_init( "oceanx", ilocal_comm ) ! nemo local communicator given by oasis 306 CALL xios_initialize( "not used" ,local_comm= ilocal_comm ) ! send nemo communicator to xios 299 307 ELSE 300 CALL 308 CALL xios_initialize( "for_xios_mpi_id",return_comm=ilocal_comm ) ! nemo local communicator given by xios 301 309 ENDIF 302 310 ENDIF … … 306 314 IF( lk_oasis ) THEN 307 315 IF( Agrif_Root() ) THEN 308 CALL cpl_init( "oceanx", ilocal_comm ) 316 CALL cpl_init( "oceanx", ilocal_comm ) ! nemo local communicator given by oasis 309 317 ENDIF 310 318 ! Nodes selection (control print return in cltxt) 311 319 narea = mynode( cltxt, 'output.namelist.dyn', numnam_ref, numnam_cfg, numond , nstop, ilocal_comm ) 312 320 ELSE 313 ilocal_comm = 0 314 ! Nodes selection (control print return in cltxt) 321 ilocal_comm = 0 ! Nodes selection (control print return in cltxt) 315 322 narea = mynode( cltxt, 'output.namelist.dyn', numnam_ref, numnam_cfg, numond , nstop ) 316 323 ENDIF 317 324 #endif 325 318 326 narea = narea + 1 ! mynode return the rank of proc (0 --> jpnij -1 ) 319 327 … … 321 329 lwp = (narea == 1) .OR. ln_ctl ! control of all listing output print 322 330 323 IF(lwm) THEN 324 ! write merged namelists from earlier to output namelist now that the 325 ! file has been opened in call to mynode. nammpp has already been 326 ! written in mynode (if lk_mpp_mpi) 331 IF(lwm) THEN ! write merged namelists from earlier to output namelist 332 ! ! now that the file has been opened in call to mynode. 333 ! ! NB: nammpp has already been written in mynode (if lk_mpp_mpi) 327 334 WRITE( numond, namctl ) 328 335 WRITE( numond, namcfg ) 336 IF( .NOT.ln_read_cfg ) THEN 337 DO ji = 1, SIZE(clnam) 338 IF( TRIM(clnam(ji)) /= '' ) WRITE(numond, * ) clnam(ji) ! namusr_def print 339 END DO 340 ENDIF 329 341 ENDIF 330 342 … … 341 353 ENDIF 342 354 343 ! Calculate domain dimensions given calculated jpni and jpnj 344 ! This used to be done in par_oce.F90 when they were parameters rather than variables 345 IF( Agrif_Root() ) THEN 355 IF( Agrif_Root() ) THEN ! AGRIF mother: specific setting from jpni and jpnj 346 356 #if defined key_nemocice_decomp 347 357 jpi = ( nx_global+2-2*jpreci + (jpni-1) ) / jpni + 2*jpreci ! first dim. … … 351 361 jpj = ( jpjglo -2*jprecj + (jpnj-1) ) / jpnj + 2*jprecj ! second dim. 352 362 #endif 353 ENDIF 354 jpk = jpkdta ! third dim 363 ENDIF 364 365 !!gm ??? why here it has already been done in line 301 ! 366 jpk = jpkglo ! third dim 367 !!gm end 368 355 369 #if defined key_agrif 356 357 ! Save maximum number of levels in jpkdta, then define all vertical grids with this number.358 359 IF(.NOT.Agrif_Root()) jpkdta = Agrif_Parent( jpkdta)360 #endif 361 362 363 364 370 ! simple trick to use same vertical grid as parent but different number of levels: 371 ! Save maximum number of levels in jpkglo, then define all vertical grids with this number. 372 ! Suppress once vertical online interpolation is ok 373 IF(.NOT.Agrif_Root()) jpkglo = Agrif_Parent( jpkglo ) 374 #endif 375 jpim1 = jpi-1 ! inner domain indices 376 jpjm1 = jpj-1 ! " " 377 jpkm1 = jpk-1 ! " " 378 jpij = jpi*jpj ! jpi x j 365 379 366 380 IF(lwp) THEN ! open listing units … … 372 386 WRITE(numout,*) ' NEMO team' 373 387 WRITE(numout,*) ' Ocean General Circulation Model' 374 WRITE(numout,*) ' version 3.7 (2015) '388 WRITE(numout,*) ' NEMO version 3.7 (2016) ' 375 389 WRITE(numout,*) 376 390 WRITE(numout,*) 377 391 DO ji = 1, SIZE(cltxt) 378 IF( TRIM(cltxt (ji)) /= '' ) WRITE(numout,*) cltxt(ji)! control print of mynode392 IF( TRIM(cltxt (ji)) /= '' ) WRITE(numout,*) cltxt(ji) ! control print of mynode 379 393 END DO 380 WRITE(numout,cform_aaa) ! Flag AAAAAAA 394 WRITE(numout,*) 395 WRITE(numout,*) 396 DO ji = 1, SIZE(cltxt2) 397 IF( TRIM(cltxt2(ji)) /= '' ) WRITE(numout,*) cltxt2(ji) ! control print of domain size 398 END DO 381 399 ! 382 ENDIF 383 384 ! Now we know the dimensions of the grid and numout has been set we can 385 ! allocate arrays 400 WRITE(numout,cform_aaa) ! Flag AAAAAAA 401 ! 402 ENDIF 403 404 ! Now we know the dimensions of the grid and numout has been set: we can allocate arrays 386 405 CALL nemo_alloc() 387 406 … … 390 409 ! !-------------------------------! 391 410 392 CALL nemo_ctl ! Control prints & Benchmark411 CALL nemo_ctl ! Control prints 393 412 394 413 ! ! Domain decomposition … … 404 423 IF( lk_c1d ) CALL c1d_init ! 1D column configuration 405 424 CALL wad_init ! Wetting and drying options 406 CALL dom_cfg ! Domain configuration407 425 CALL dom_init ! Domain 408 426 IF( ln_crs ) CALL crs_init ! coarsened grid: domain initialization … … 503 521 CALL dia_tmb_init ! TMB outputs 504 522 CALL dia_25h_init ! 25h mean outputs 505 506 523 ! 507 524 END SUBROUTINE nemo_init … … 519 536 IF(lwp) THEN ! control print 520 537 WRITE(numout,*) 521 WRITE(numout,*) 'nemo_ctl: Control prints & Benchmark'538 WRITE(numout,*) 'nemo_ctl: Control prints' 522 539 WRITE(numout,*) '~~~~~~~ ' 523 540 WRITE(numout,*) ' Namelist namctl' … … 530 547 WRITE(numout,*) ' number of proc. following i nn_isplt = ', nn_isplt 531 548 WRITE(numout,*) ' number of proc. following j nn_jsplt = ', nn_jsplt 532 WRITE(numout,*) ' benchmark parameter (0/1) nn_bench = ', nn_bench533 549 WRITE(numout,*) ' timing activated (0/1) nn_timing = ', nn_timing 534 550 ENDIF … … 541 557 isplt = nn_isplt 542 558 jsplt = nn_jsplt 543 nbench = nn_bench544 559 545 560 IF(lwp) THEN ! control print … … 548 563 WRITE(numout,*) '~~~~~~~ ' 549 564 WRITE(numout,*) ' Namelist namcfg' 550 WRITE(numout,*) ' configuration name cp_cfg = ', TRIM(cp_cfg) 551 WRITE(numout,*) ' configuration zoom name cp_cfz = ', TRIM(cp_cfz) 552 WRITE(numout,*) ' configuration resolution jp_cfg = ', jp_cfg 553 WRITE(numout,*) ' 1st lateral dimension ( >= jpiglo ) jpidta = ', jpidta 554 WRITE(numout,*) ' 2nd " " ( >= jpjglo ) jpjdta = ', jpjdta 555 WRITE(numout,*) ' 3nd " " jpkdta = ', jpkdta 556 WRITE(numout,*) ' 1st dimension of global domain in i jpiglo = ', jpiglo 557 WRITE(numout,*) ' 2nd - - in j jpjglo = ', jpjglo 558 WRITE(numout,*) ' left bottom i index of the zoom (in data domain) jpizoom = ', jpizoom 559 WRITE(numout,*) ' left bottom j index of the zoom (in data domain) jpizoom = ', jpjzoom 560 WRITE(numout,*) ' lateral cond. type (between 0 and 6) jperio = ', jperio 561 WRITE(numout,*) ' use file attribute if exists as i/p j-start ln_use_jattr = ', ln_use_jattr 565 WRITE(numout,*) ' read domain configuration file ln_read_cfg = ', ln_read_cfg 566 WRITE(numout,*) ' filename to be read cn_domcfg = ', TRIM(cn_domcfg) 567 WRITE(numout,*) ' write configuration definition file ln_write_cfg = ', ln_write_cfg 568 WRITE(numout,*) ' filename to be written cn_domcfg_out = ', TRIM(cn_domcfg_out) 569 WRITE(numout,*) ' use file attribute if exists as i/p j-start ln_use_jattr = ', ln_use_jattr 562 570 ENDIF 563 571 ! ! Parameter control … … 600 608 ENDIF 601 609 ! 602 IF( nbench == 1 ) THEN ! Benchmark603 SELECT CASE ( cp_cfg )604 CASE ( 'gyre' ) ; CALL ctl_warn( ' The Benchmark is activated ' )605 CASE DEFAULT ; CALL ctl_stop( ' The Benchmark is based on the GYRE configuration:', &606 & ' cp_cfg = "gyre" in namelist &namcfg or set nbench = 0' )607 END SELECT608 ENDIF609 !610 610 IF( 1_wp /= SIGN(1._wp,-0._wp) ) CALL ctl_stop( 'nemo_ctl: The intrinsec SIGN function follows ', & 611 611 & 'f2003 standard. ' , & … … 666 666 !!---------------------------------------------------------------------- 667 667 ! 668 ierr = oce_alloc () ! ocean 668 ierr = oce_alloc () ! ocean 669 669 ierr = ierr + dia_wri_alloc () 670 670 ierr = ierr + dom_oce_alloc () ! ocean domain … … 842 842 IF ((sxM .gt. sxT) .AND. (sxM .lt. dxT)) THEN 843 843 nsndto = nsndto + 1 844 844 isendto(nsndto) = jn 845 845 ELSEIF ((sxM .le. sxT) .AND. (dxM .ge. dxT)) THEN 846 846 nsndto = nsndto + 1 847 847 isendto(nsndto) = jn 848 848 ELSEIF ((dxM .lt. dxT) .AND. (sxT .lt. dxM)) THEN 849 849 nsndto = nsndto + 1 850 851 END 850 isendto(nsndto) = jn 851 ENDIF 852 852 END DO 853 853 nfsloop = 1 -
branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/oce.F90
r6140 r7277 23 23 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: wn !: vertical velocity [m/s] 24 24 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: hdivn !: horizontal divergence [s-1] 25 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) :: tsb , tsn , tsa !: 4D T-S fields [Cel cius,psu]26 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) :: rab_b, rab_n !: thermal/haline expansion coef. [Cel cius-1,psu-1]25 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) :: tsb , tsn , tsa !: 4D T-S fields [Celsius,psu] 26 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) :: rab_b, rab_n !: thermal/haline expansion coef. [Celsius-1,psu-1] 27 27 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: rn2b , rn2 !: brunt-vaisala frequency**2 [s-2] 28 28 ! -
branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/par_oce.F90
r5836 r7277 14 14 15 15 !!---------------------------------------------------------------------- 16 !! namcfg namelist parameters 17 !!---------------------------------------------------------------------- 18 LOGICAL :: ln_read_cfg !: (=T) read the domain configuration file or (=F) not 19 CHARACTER(lc) :: cn_domcfg !: filename the configuration file to be read 20 LOGICAL :: ln_write_cfg !: (=T) create the domain configuration file 21 CHARACTER(lc) :: cn_domcfg_out !: filename the configuration file to be read 22 ! 23 LOGICAL :: ln_use_jattr !: input file read offset 24 ! ! Use file global attribute: open_ocean_jstart to determine start j-row 25 ! ! when reading input from those netcdf files that have the 26 ! ! attribute defined. This is designed to enable input files associated 27 ! ! with the extended grids used in the under ice shelf configurations to 28 ! ! be used without redundant rows when the ice shelves are not in use. 29 ! 30 31 !!--------------------------------------------------------------------- 32 !! Domain Matrix size 33 !!--------------------------------------------------------------------- 34 ! configuration name & resolution (required only in ORCA family case) 35 CHARACTER(lc) :: cn_cfg !: name of the configuration 36 INTEGER :: nn_cfg !: resolution of the configuration 37 38 ! global domain size !!! * total computational domain * 39 INTEGER :: jpiglo !: 1st dimension of global domain --> i-direction 40 INTEGER :: jpjglo !: 2nd - - --> j-direction 41 INTEGER :: jpkglo !: 3nd - - --> k levels 42 43 #if defined key_agrif 44 45 !!gm BUG ? I'm surprised by the calculation below of nbcellsx and nbcellsy before jpiglo,jpjglo 46 !!gm has been assigned to a value.... 47 !!gm 48 49 ! global domain size for AGRIF !!! * total AGRIF computational domain * 50 INTEGER, PUBLIC, PARAMETER :: nbghostcells = 1 !: number of ghost cells 51 INTEGER, PUBLIC :: nbcellsx = jpiglo - 2 - 2*nbghostcells !: number of cells in i-direction 52 INTEGER, PUBLIC :: nbcellsy = jpjglo - 2 - 2*nbghostcells !: number of cells in j-direction 53 #endif 54 55 ! local domain size !!! * local computational domain * 56 INTEGER, PUBLIC :: jpi ! = ( jpiglo-2*jpreci + (jpni-1) ) / jpni + 2*jpreci !: first dimension 57 INTEGER, PUBLIC :: jpj ! = ( jpjglo-2*jprecj + (jpnj-1) ) / jpnj + 2*jprecj !: second dimension 58 INTEGER, PUBLIC :: jpk ! = jpkglo 59 INTEGER, PUBLIC :: jpim1 ! = jpi-1 !: inner domain indices 60 INTEGER, PUBLIC :: jpjm1 ! = jpj-1 !: - - - 61 INTEGER, PUBLIC :: jpkm1 ! = jpk-1 !: - - - 62 INTEGER, PUBLIC :: jpij ! = jpi*jpj !: jpi x jpj 63 64 !!--------------------------------------------------------------------- 65 !! Active tracer parameters 66 !!--------------------------------------------------------------------- 67 INTEGER, PUBLIC, PARAMETER :: jpts = 2 !: Number of active tracers (=2, i.e. T & S ) 68 INTEGER, PUBLIC, PARAMETER :: jp_tem = 1 !: indice for temperature 69 INTEGER, PUBLIC, PARAMETER :: jp_sal = 2 !: indice for salinity 70 71 !!---------------------------------------------------------------------- 16 72 !! Domain decomposition 17 73 !!---------------------------------------------------------------------- … … 26 82 27 83 !!---------------------------------------------------------------------- 28 !! namcfg namelist parameters 29 !!---------------------------------------------------------------------- 30 CHARACTER(lc) :: cp_cfg !: name of the configuration 31 CHARACTER(lc) :: cp_cfz !: name of the zoom of configuration 32 INTEGER :: jp_cfg !: resolution of the configuration 33 34 ! data size !!! * size of all input files * 35 INTEGER :: jpidta !: 1st lateral dimension ( >= jpi ) 36 INTEGER :: jpjdta !: 2nd " " ( >= jpj ) 37 INTEGER :: jpkdta !: number of levels ( >= jpk ) 38 39 ! global or zoom domain size !!! * computational domain * 40 INTEGER :: jpiglo !: 1st dimension of global domain --> i 41 INTEGER :: jpjglo !: 2nd - - --> j 42 43 ! zoom starting position 44 INTEGER :: jpizoom !: left bottom (i,j) indices of the zoom 45 INTEGER :: jpjzoom !: in data domain indices 46 47 ! Domain characteristics 48 INTEGER :: jperio !: lateral cond. type (between 0 and 6) 49 ! ! = 0 closed ; = 1 cyclic East-West 50 ! ! = 2 equatorial symmetric ; = 3 North fold T-point pivot 51 ! ! = 4 cyclic East-West AND North fold T-point pivot 52 ! ! = 5 North fold F-point pivot 53 ! ! = 6 cyclic East-West AND North fold F-point pivot 54 55 ! Input file read offset 56 LOGICAL :: ln_use_jattr !: Use file global attribute: open_ocean_jstart to determine start j-row 57 ! when reading input from those netcdf files that have the 58 ! attribute defined. This is designed to enable input files associated 59 ! with the extended grids used in the under ice shelf configurations to 60 ! be used without redundant rows when the ice shelves are not in use. 61 62 !! Values set to pp_not_used indicates that this parameter is not used in THIS config. 63 !! Values set to pp_to_be_computed indicates that variables will be computed in domzgr 64 REAL(wp) :: pp_not_used = 999999._wp !: vertical grid parameter 65 REAL(wp) :: pp_to_be_computed = 999999._wp !: - - - 66 67 68 69 70 !!--------------------------------------------------------------------- 71 !! Active tracer parameters 72 !!--------------------------------------------------------------------- 73 INTEGER, PUBLIC, PARAMETER :: jpts = 2 !: Number of active tracers (=2, i.e. T & S ) 74 INTEGER, PUBLIC, PARAMETER :: jp_tem = 1 !: indice for temperature 75 INTEGER, PUBLIC, PARAMETER :: jp_sal = 2 !: indice for salinity 76 77 !!--------------------------------------------------------------------- 78 !! Domain Matrix size (if AGRIF, they are not all parameters) 79 !!--------------------------------------------------------------------- 80 #if defined key_agrif 81 INTEGER, PUBLIC, PARAMETER :: nbghostcells = 1 !: number of ghost cells 82 INTEGER, PUBLIC :: nbcellsx = jpiglo - 2 - 2*nbghostcells !: number of cells in i-direction 83 INTEGER, PUBLIC :: nbcellsy = jpjglo - 2 - 2*nbghostcells !: number of cells in j-direction 84 ! 85 #endif 86 INTEGER, PUBLIC :: jpi ! = ( jpiglo-2*jpreci + (jpni-1) ) / jpni + 2*jpreci !: first dimension 87 INTEGER, PUBLIC :: jpj ! = ( jpjglo-2*jprecj + (jpnj-1) ) / jpnj + 2*jprecj !: second dimension 88 INTEGER, PUBLIC :: jpk ! = jpkdta 89 INTEGER, PUBLIC :: jpim1 ! = jpi-1 !: inner domain indices 90 INTEGER, PUBLIC :: jpjm1 ! = jpj-1 !: - - - 91 INTEGER, PUBLIC :: jpkm1 ! = jpk-1 !: - - - 92 INTEGER, PUBLIC :: jpij ! = jpi*jpj !: jpi x jpj 93 94 !!---------------------------------------------------------------------- 95 !! NEMO/OPA 3.3 , NEMO Consortium (2010) 84 !! NEMO/OPA 4.0 , NEMO Consortium (2016) 96 85 !! $Id$ 97 86 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) -
branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/step.F90
r6381 r7277 237 237 IF( nn_diacfl == 1 ) CALL dia_cfl( kstp ) ! Courant number diagnostics 238 238 IF( lk_diahth ) CALL dia_hth( kstp ) ! Thermocline depth (20 degres isotherm depth) 239 IF(.NOT.ln_cpl ) CALL dia_fwb( kstp ) ! Fresh water budget diagnostics240 239 IF( lk_diadct ) CALL dia_dct( kstp ) ! Transports 241 240 IF( lk_diaar5 ) CALL dia_ar5( kstp ) ! ar5 diag -
branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/step_oce.F90
r6140 r7277 84 84 USE diaar5 ! AR5 diagnosics (dia_ar5 routine) 85 85 USE diahth ! thermocline depth (dia_hth routine) 86 USE diafwb ! freshwater budget (dia_fwb routine)87 86 USE diahsb ! heat, salt and volume budgets (dia_hsb routine) 88 87 USE diaharm -
branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/SAO_SRC/nemogcm.F90
r5600 r7277 4 4 !! Ocean system : NEMO GCM (ocean dynamics, on-line tracers, biochemistry and sea-ice) 5 5 !!====================================================================== 6 !! History : OPA ! 1990-10 (C. Levy, G. Madec) Original code 7 !! 7.0 ! 1991-11 (M. Imbard, C. Levy, G. Madec) 8 !! 7.1 ! 1993-03 (M. Imbard, C. Levy, G. Madec, O. Marti, M. Guyon, A. Lazar, 9 !! P. Delecluse, C. Perigaud, G. Caniaux, B. Colot, C. Maes) release 7.1 10 !! - ! 1992-06 (L.Terray) coupling implementation 11 !! - ! 1993-11 (M.A. Filiberti) IGLOO sea-ice 12 !! 8.0 ! 1996-03 (M. Imbard, C. Levy, G. Madec, O. Marti, M. Guyon, A. Lazar, 13 !! P. Delecluse, L.Terray, M.A. Filiberti, J. Vialar, A.M. Treguier, M. Levy) release 8.0 14 !! 8.1 ! 1997-06 (M. Imbard, G. Madec) 15 !! 8.2 ! 1999-11 (M. Imbard, H. Goosse) LIM sea-ice model 16 !! ! 1999-12 (V. Thierry, A-M. Treguier, M. Imbard, M-A. Foujols) OPEN-MP 17 !! ! 2000-07 (J-M Molines, M. Imbard) Open Boundary Conditions (CLIPPER) 18 !! NEMO 1.0 ! 2002-08 (G. Madec) F90: Free form and modules 19 !! - ! 2004-06 (R. Redler, NEC CCRLE, Germany) add OASIS[3/4] coupled interfaces 20 !! - ! 2004-08 (C. Talandier) New trends organization 21 !! - ! 2005-06 (C. Ethe) Add the 1D configuration possibility 22 !! - ! 2005-11 (V. Garnier) Surface pressure gradient organization 23 !! - ! 2006-03 (L. Debreu, C. Mazauric) Agrif implementation 24 !! - ! 2006-04 (G. Madec, R. Benshila) Step reorganization 25 !! - ! 2007-07 (J. Chanut, A. Sellar) Unstructured open boundaries (BDY) 26 !! 3.2 ! 2009-08 (S. Masson) open/write in the listing file in mpp 27 !! 3.3 ! 2010-05 (K. Mogensen, A. Weaver, M. Martin, D. Lea) Assimilation interface 28 !! - ! 2010-10 (C. Ethe, G. Madec) reorganisation of initialisation phase 29 !! 3.3.1! 2011-01 (A. R. Porter, STFC Daresbury) dynamical allocation 30 !! 3.4 ! 2011-11 (C. Harris) decomposition changes for running with CICE 31 !! ! 2012-05 (C. Calone, J. Simeon, G. Madec, C. Ethe) Add grid coarsening 6 !! History : 3.6 ! 2015-12 (A. Ryan) Original code (from OPA_SRC/) 7 !! 4.0 ! 2016-11 (G. Madec, S. Flavoni) domain configuration / user defined interface 32 8 !!---------------------------------------------------------------------- 33 9 34 10 !!---------------------------------------------------------------------- 35 !! nemo_gcm 36 !! nemo_init 37 !! nemo_ctl 38 !! nemo_closefile 39 !! nemo_alloc 40 !! nemo_partition 41 !! factorise 11 !! nemo_gcm : solve ocean dynamics, tracer, biogeochemistry and/or sea-ice 12 !! nemo_init : initialization of the NEMO system 13 !! nemo_ctl : initialisation of the contol print 14 !! nemo_closefile: close remaining open files 15 !! nemo_alloc : dynamical allocation 16 !! nemo_partition: calculate MPP domain decomposition 17 !! factorise : calculate the factors of the no. of MPI processes 42 18 !!---------------------------------------------------------------------- 43 USE step_oce ! module used in the ocean time stepping module 44 USE domcfg ! domain configuration (dom_cfg routine) 45 USE mppini ! shared/distributed memory setting (mpp_init routine) 46 USE domain ! domain initialization (dom_init routine) 19 USE step_oce ! module used in the ocean time stepping module (step.F90) 20 USE domain ! domain initialization (dom_init & dom_cfg routines) 21 USE istate ! initial state setting (istate_init routine) 22 USE phycst ! physical constant (par_cst routine) 23 USE step ! NEMO time-stepping (stp routine) 24 USE cpl_oasis3 ! OASIS3 coupling 25 USE diaobs ! Observation diagnostics (dia_obs_init routine) 47 26 #if defined key_nemocice_decomp 48 27 USE ice_domain_size, only: nx_global, ny_global 49 28 #endif 50 USE istate ! initial state setting (istate_init routine) 51 USE phycst ! physical constant (par_cst routine) 52 USE diaobs ! Observation diagnostics (dia_obs_init routine) 53 USE lib_fortran ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined) 54 USE step ! NEMO time-stepping (stp routine) 55 USE cpl_oasis3 ! OASIS3 coupling 56 USE lib_mpp ! distributed memory computing 57 #if defined key_iomput 58 USE xios 59 #endif 60 USE lbcnfd, ONLY: isendto, nsndto, nfsloop, nfeloop ! Setup of north fold exchanges 61 62 ! Stand Alone Observation operator modules 29 ! ! Stand Alone Observation operator modules 63 30 USE sao_data 64 31 USE sao_intp 32 ! 33 USE lib_mpp ! distributed memory computing 34 USE mppini ! shared/distributed memory setting (mpp_init routine) 35 USE lbcnfd , ONLY : isendto, nsndto, nfsloop, nfeloop ! Setup of north fold exchanges 36 USE lib_fortran ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined) 37 #if defined key_iomput 38 USE xios ! xIOserver 39 #endif 65 40 66 41 IMPLICIT NONE … … 74 49 75 50 !!---------------------------------------------------------------------- 76 !! NEMO/OPA 4.0 , NEMO Consortium (201 1)51 !! NEMO/OPA 4.0 , NEMO Consortium (2016) 77 52 !! $Id$ 78 53 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) … … 91 66 !! 3. Cycle through match ups 92 67 !! 4. Write results to file 93 !!94 68 !!---------------------------------------------------------------------- 95 !! Initialise NEMO 96 CALL nemo_init 97 !! Initialise Stand Alone Observation operator data 98 CALL sao_data_init 99 !! Initialise obs_oper 100 CALL dia_obs_init 101 !! Interpolate to observation space 102 CALL sao_interp 103 !! Pipe to output files 104 CALL dia_obs_wri 105 !! Reset the obs_oper between 106 CALL dia_obs_dealloc 107 !! Safely stop MPI 108 IF(lk_mpp) CALL mppstop ! end mpp communications 69 ! 70 CALL nemo_init ! Initialise NEMO 71 ! 72 CALL sao_data_init ! Initialise Stand Alone Observation operator data 73 ! 74 CALL dia_obs_init ! Initialise obs_operator 75 ! 76 CALL sao_interp ! Interpolate to observation space 77 ! 78 CALL dia_obs_wri ! Pipe to output files 79 ! 80 CALL dia_obs_dealloc ! Reset the obs_oper between 81 ! 82 IF(lk_mpp) CALL mppstop ! Safely stop MPI (end mpp communications) 83 ! 109 84 END SUBROUTINE nemo_gcm 110 85 … … 116 91 !! ** Purpose : initialization of the NEMO GCM 117 92 !!---------------------------------------------------------------------- 118 INTEGER :: ji ! dummy loop indices119 INTEGER :: i local_comm ! local integer120 INTEGER :: ios121 CHARACTER(len=80), DIMENSION(16) :: cltxt122 !123 NAMELIST/namctl/ ln_ctl, nn_print, nn_ictls, nn_ictle, &124 & nn_ isplt, nn_jsplt, nn_jctls, nn_jctle, &125 & nn_bench, nn_timing126 NAMELIST/namcfg/ cp_cfg, cp_cfz, jp_cfg, jpidta, jpjdta, jpkdta, jpiglo, jpjglo, &127 & jpizoom, jpjzoom, jperio, ln_use_jattr128 !!----------------------------------------------------------------------129 !130 cl txt = ''93 INTEGER :: ji ! dummy loop indices 94 INTEGER :: ios, ilocal_comm ! local integer 95 CHARACTER(len=120), DIMENSION(30) :: cltxt, cltxt2, clnam 96 ! 97 NAMELIST/namctl/ ln_ctl , nn_print, nn_ictls, nn_ictle, & 98 & nn_isplt , nn_jsplt, nn_jctls, nn_jctle, & 99 & nn_timing, nn_diacfl 100 NAMELIST/namcfg/ ln_read_cfg, cn_domcfg, ln_write_cfg, cn_domcfg_out, ln_use_jattr 101 !!---------------------------------------------------------------------- 102 ! 103 cltxt = '' 104 cltxt2 = '' 105 clnam = '' 131 106 cxios_context = 'nemo' 132 107 ! … … 135 110 CALL ctl_opn( numnam_cfg, 'namelist_cfg', 'OLD', 'FORMATTED', 'SEQUENTIAL', -1, 6, .FALSE. ) 136 111 ! 137 REWIND( numnam_ref ) ! Namelist namctl in reference namelist : Control prints & Benchmark112 REWIND( numnam_ref ) ! Namelist namctl in reference namelist : Control prints 138 113 READ ( numnam_ref, namctl, IOSTAT = ios, ERR = 901 ) 139 114 901 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namctl in reference namelist', .TRUE. ) 140 141 REWIND( numnam_cfg ) ! Namelist namctl in confguration namelist : Control prints & Benchmark115 ! 116 REWIND( numnam_cfg ) ! Namelist namctl in confguration namelist 142 117 READ ( numnam_cfg, namctl, IOSTAT = ios, ERR = 902 ) 143 118 902 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namctl in configuration namelist', .TRUE. ) 144 145 ! 146 REWIND( numnam_ref ) ! Namelist namcfg in reference namelist : Control prints & Benchmark 119 ! 120 REWIND( numnam_ref ) ! Namelist namcfg in reference namelist : Control prints 147 121 READ ( numnam_ref, namcfg, IOSTAT = ios, ERR = 903 ) 148 122 903 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namcfg in reference namelist', .TRUE. ) … … 152 126 904 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namcfg in configuration namelist', .TRUE. ) 153 127 154 ! Force values for AGRIF zoom (cf. agrif_user.F90) 128 ! !--------------------------! 129 ! ! Set global domain size ! (control print return in cltxt2) 130 ! !--------------------------! 131 IF( ln_read_cfg ) THEN ! Read sizes in domain configuration file 132 CALL domain_cfg ( cltxt2, cn_cfg, nn_cfg, jpiglo, jpjglo, jpkglo, jperio ) 133 ! 134 ELSE ! user-defined namelist 135 CALL usr_def_nam( cltxt2, clnam, cn_cfg, nn_cfg, jpiglo, jpjglo, jpkglo, jperio ) 136 ENDIF 137 ! 138 jpk = jpkglo 139 ! 155 140 #if defined key_agrif 156 IF( .NOT. Agrif_Root() ) THEN 157 jpiglo = nbcellsx + 2 + 2*nbghostcells 158 jpjglo = nbcellsy + 2 + 2*nbghostcells 159 jpi = ( jpiglo-2*jpreci + (jpni-1+0) ) / jpni + 2*jpreci 160 jpj = ( jpjglo-2*jprecj + (jpnj-1+0) ) / jpnj + 2*jprecj 161 jpidta = jpiglo 162 jpjdta = jpjglo 163 jpizoom = 1 164 jpjzoom = 1 165 nperio = 0 166 jperio = 0 167 ln_use_jattr = .false. 168 ENDIF 141 IF( .NOT. Agrif_Root() ) THEN ! AGRIF children: specific setting (cf. agrif_user.F90) 142 jpiglo = nbcellsx + 2 + 2*nbghostcells 143 jpjglo = nbcellsy + 2 + 2*nbghostcells 144 jpi = ( jpiglo-2*jpreci + (jpni-1+0) ) / jpni + 2*jpreci 145 jpj = ( jpjglo-2*jprecj + (jpnj-1+0) ) / jpnj + 2*jprecj 146 nperio = 0 147 jperio = 0 148 ln_use_jattr = .false. 149 ENDIF 169 150 #endif 170 151 ! … … 198 179 ENDIF 199 180 #endif 181 200 182 narea = narea + 1 ! mynode return the rank of proc (0 --> jpnij -1 ) 201 183 … … 209 191 WRITE( numond, namctl ) 210 192 WRITE( numond, namcfg ) 193 IF( .NOT.ln_read_cfg ) THEN 194 DO ji = 1, SIZE(clnam) 195 IF( TRIM(clnam(ji)) /= '' ) WRITE(numond, * ) clnam(ji) ! namusr_def print 196 END DO 197 ENDIF 211 198 ENDIF 212 199 213 200 ! If dimensions of processor grid weren't specified in the namelist file 214 201 ! then we calculate them here now that we have our communicator size 215 IF( (jpni < 1) .OR. (jpnj < 1) )THEN202 IF( jpni < 1 .OR. jpnj < 1 ) THEN 216 203 #if defined key_mpp_mpi 217 IF( Agrif_Root() ) CALL nemo_partition(mppsize)204 IF( Agrif_Root() ) CALL nemo_partition( mppsize ) 218 205 #else 219 206 jpni = 1 … … 221 208 jpnij = jpni*jpnj 222 209 #endif 223 END IF 224 225 ! Calculate domain dimensions given calculated jpni and jpnj 226 ! This used to be done in par_oce.F90 when they were parameters rather 227 ! than variables 228 IF( Agrif_Root() ) THEN 210 ENDIF 211 212 IF( Agrif_Root() ) THEN ! AGRIF mother: specific setting from jpni and jpnj 229 213 #if defined key_nemocice_decomp 230 jpi = ( nx_global+2-2*jpreci + (jpni-1) ) / jpni + 2*jpreci ! first dim.231 jpj = ( ny_global+2-2*jprecj + (jpnj-1) ) / jpnj + 2*jprecj ! second dim.214 jpi = ( nx_global+2-2*jpreci + (jpni-1) ) / jpni + 2*jpreci ! first dim. 215 jpj = ( ny_global+2-2*jprecj + (jpnj-1) ) / jpnj + 2*jprecj ! second dim. 232 216 #else 233 jpi = ( jpiglo -2*jpreci + (jpni-1) ) / jpni + 2*jpreci! first dim.234 jpj = ( jpjglo -2*jprecj + (jpnj-1) ) / jpnj + 2*jprecj! second dim.217 jpi = ( jpiglo -2*jpreci + (jpni-1) ) / jpni + 2*jpreci ! first dim. 218 jpj = ( jpjglo -2*jprecj + (jpnj-1) ) / jpnj + 2*jprecj ! second dim. 235 219 #endif 236 220 ENDIF 237 jpk = jpkdta ! third dim 238 jpim1 = jpi-1 ! inner domain indices 239 jpjm1 = jpj-1 ! " " 240 jpkm1 = jpk-1 ! " " 241 jpij = jpi*jpj ! jpi x j 221 222 !!gm ??? why here it has already been done in line 301 ! 223 jpk = jpkglo ! third dim 224 !!gm end 225 jpim1 = jpi-1 ! inner domain indices 226 jpjm1 = jpj-1 ! " " 227 jpkm1 = jpk-1 ! " " 228 jpij = jpi*jpj ! jpi x j 242 229 243 230 IF(lwp) THEN ! open listing units … … 249 236 WRITE(numout,*) ' NEMO team' 250 237 WRITE(numout,*) ' Stand Alone Observation operator' 251 WRITE(numout,*) ' version 1.0(2015) '238 WRITE(numout,*) ' NEMO version 3.7 (2015) ' 252 239 WRITE(numout,*) 253 240 WRITE(numout,*) 254 241 DO ji = 1, SIZE(cltxt) 255 IF( TRIM(cltxt (ji)) /= '' ) WRITE(numout,*) cltxt(ji)! control print of mynode242 IF( TRIM(cltxt (ji)) /= '' ) WRITE(numout,*) cltxt(ji) ! control print of mynode 256 243 END DO 257 WRITE(numout,cform_aaa) ! Flag AAAAAAA 258 ! 259 ENDIF 260 261 ! Now we know the dimensions of the grid and numout has been set we can 262 ! allocate arrays 244 WRITE(numout,*) 245 WRITE(numout,*) 246 DO ji = 1, SIZE(cltxt2) 247 IF( TRIM(cltxt2(ji)) /= '' ) WRITE(numout,*) cltxt2(ji) ! control print of domain size 248 END DO 249 ! 250 WRITE(numout,cform_aaa) ! Flag AAAAAAA 251 ! 252 ENDIF 253 254 ! Now we know the dimensions of the grid and numout has been set: we can allocate arrays 263 255 CALL nemo_alloc() 264 256 … … 279 271 CALL phy_cst ! Physical constants 280 272 CALL eos_init ! Equation of state 281 CALL dom_cfg ! Domain configuration282 273 CALL dom_init ! Domain 283 274 … … 301 292 IF(lwp) THEN ! control print 302 293 WRITE(numout,*) 303 WRITE(numout,*) 'nemo_ctl: Control prints & Benchmark'294 WRITE(numout,*) 'nemo_ctl: Control prints' 304 295 WRITE(numout,*) '~~~~~~~ ' 305 296 WRITE(numout,*) ' Namelist namctl' … … 312 303 WRITE(numout,*) ' number of proc. following i nn_isplt = ', nn_isplt 313 304 WRITE(numout,*) ' number of proc. following j nn_jsplt = ', nn_jsplt 314 WRITE(numout,*) ' benchmark parameter (0/1) nn_bench = ', nn_bench315 305 WRITE(numout,*) ' timing activated (0/1) nn_timing = ', nn_timing 316 306 ENDIF … … 323 313 isplt = nn_isplt 324 314 jsplt = nn_jsplt 325 nbench = nn_bench326 315 327 316 IF(lwp) THEN ! control print … … 330 319 WRITE(numout,*) '~~~~~~~ ' 331 320 WRITE(numout,*) ' Namelist namcfg' 332 WRITE(numout,*) ' configuration name cp_cfg = ', TRIM(cp_cfg) 333 WRITE(numout,*) ' configuration zoom name cp_cfz = ', TRIM(cp_cfz) 334 WRITE(numout,*) ' configuration resolution jp_cfg = ', jp_cfg 335 WRITE(numout,*) ' 1st lateral dimension ( >= jpi ) jpidta = ', jpidta 336 WRITE(numout,*) ' 2nd " " ( >= jpj ) jpjdta = ', jpjdta 337 WRITE(numout,*) ' 3nd " " jpkdta = ', jpkdta 338 WRITE(numout,*) ' 1st dimension of global domain in i jpiglo = ', jpiglo 339 WRITE(numout,*) ' 2nd - - in j jpjglo = ', jpjglo 340 WRITE(numout,*) ' left bottom i index of the zoom (in data domain) jpizoom = ', jpizoom 341 WRITE(numout,*) ' left bottom j index of the zoom (in data domain) jpizoom = ', jpjzoom 342 WRITE(numout,*) ' lateral cond. type (between 0 and 6) jperio = ', jperio 343 WRITE(numout,*) ' use file attribute if exists as i/p j-start ln_use_jattr = ', ln_use_jattr 321 WRITE(numout,*) ' read domain configuration file ln_read_cfg = ', ln_read_cfg 322 WRITE(numout,*) ' filename to be read cn_domcfg = ', TRIM(cn_domcfg) 323 WRITE(numout,*) ' write configuration definition file ln_write_cfg = ', ln_write_cfg 324 WRITE(numout,*) ' filename to be written cn_domcfg_out = ', TRIM(cn_domcfg_out) 325 WRITE(numout,*) ' use file attribute if exists as i/p j-start ln_use_jattr = ', ln_use_jattr 344 326 ENDIF 345 327 ! ! Parameter control … … 382 364 ENDIF 383 365 ! 384 IF( nbench == 1 ) THEN ! Benchmark385 SELECT CASE ( cp_cfg )386 CASE ( 'gyre' ) ; CALL ctl_warn( ' The Benchmark is activated ' )387 CASE DEFAULT ; CALL ctl_stop( ' The Benchmark is based on the GYRE configuration:', &388 & ' cp_cfg = "gyre" in namelist &namcfg or set nbench = 0' )389 END SELECT390 ENDIF391 !392 366 IF( 1_wp /= SIGN(1._wp,-0._wp) ) CALL ctl_stop( 'nemo_ctl: The intrinsec SIGN function follows ', & 393 367 & 'f2003 standard. ' , & … … 421 395 IF( numdct_heat /= -1 ) CLOSE( numdct_heat ) ! heat transports 422 396 IF( numdct_salt /= -1 ) CLOSE( numdct_salt ) ! salt transports 423 424 397 ! 425 398 numout = 6 ! redefine numout in case it is used after this point... … … 460 433 !! ** Method : 461 434 !!---------------------------------------------------------------------- 462 INTEGER, INTENT(in) :: num_pes! The number of MPI processes we have435 INTEGER, INTENT(in) :: num_pes ! The number of MPI processes we have 463 436 ! 464 437 INTEGER, PARAMETER :: nfactmax = 20 … … 514 487 INTEGER :: ifac, jl, inu 515 488 INTEGER, PARAMETER :: ntest = 14 516 INTEGER :: ilfax(ntest) 489 INTEGER, DIMENSION(ntest) :: ilfax 490 !!---------------------------------------------------------------------- 517 491 ! 518 492 ! lfax contains the set of allowed factors. 519 data (ilfax(jl),jl=1,ntest) / 16384, 8192, 4096, 2048, 1024, 512, 256, & 520 & 128, 64, 32, 16, 8, 4, 2 / 521 !!---------------------------------------------------------------------- 522 493 ilfax(:) = (/(2**jl,jl=ntest,1,-1)/) 494 ! 523 495 ! Clear the error flag and initialise output vars 524 kerr = 0525 kfax = 1496 kerr = 0 497 kfax = 1 526 498 knfax = 0 527 499 ! 528 500 ! Find the factors of n. 529 501 IF( kn == 1 ) GOTO 20 … … 533 505 ! l points to the allowed factor list. 534 506 ! ifac holds the current factor. 535 507 ! 536 508 inu = kn 537 509 knfax = 0 538 510 ! 539 511 DO jl = ntest, 1, -1 540 512 ! … … 560 532 ! 561 533 END DO 562 534 ! 563 535 20 CONTINUE ! Label 20 is the exit point from the factor search loop. 564 536 ! … … 568 540 569 541 SUBROUTINE nemo_northcomms 570 !! ======================================================================542 !!---------------------------------------------------------------------- 571 543 !! *** ROUTINE nemo_northcomms *** 572 !! nemo_northcomms : Setup for north fold exchanges with explicit 573 !! point-to-point messaging 574 !!===================================================================== 575 !!---------------------------------------------------------------------- 576 !! 577 !! ** Purpose : Initialization of the northern neighbours lists. 544 !! ** Purpose : Setup for north fold exchanges with explicit 545 !! point-to-point messaging 546 !! 547 !! ** Method : Initialization of the northern neighbours lists. 578 548 !!---------------------------------------------------------------------- 579 549 !! 1.0 ! 2011-10 (A. C. Coward, NOCS & J. Donners, PRACE) 580 550 !! 2.0 ! 2013-06 Setup avoiding MPI communication (I. Epicoco, S. Mocavero, CMCC) 581 551 !!---------------------------------------------------------------------- 582 583 552 INTEGER :: sxM, dxM, sxT, dxT, jn 584 553 INTEGER :: njmppmax 585 554 !!---------------------------------------------------------------------- 555 ! 586 556 njmppmax = MAXVAL( njmppt ) 587 557 ! 588 558 !initializes the north-fold communication variables 589 559 isendto(:) = 0 590 nsndto = 0591 560 nsndto = 0 561 ! 592 562 !if I am a process in the north 593 563 IF ( njmpp == njmppmax ) THEN … … 611 581 IF ((sxM .gt. sxT) .AND. (sxM .lt. dxT)) THEN 612 582 nsndto = nsndto + 1 613 583 isendto(nsndto) = jn 614 584 ELSEIF ((sxM .le. sxT) .AND. (dxM .ge. dxT)) THEN 615 585 nsndto = nsndto + 1 616 586 isendto(nsndto) = jn 617 587 ELSEIF ((dxM .lt. dxT) .AND. (sxT .lt. dxM)) THEN 618 588 nsndto = nsndto + 1 619 620 END 589 isendto(nsndto) = jn 590 ENDIF 621 591 END DO 622 592 nfsloop = 1 … … 636 606 l_north_nogather = .TRUE. 637 607 END SUBROUTINE nemo_northcomms 608 638 609 #else 639 610 SUBROUTINE nemo_northcomms ! Dummy routine … … 645 616 END MODULE nemogcm 646 617 647 -
branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/SAO_SRC/sao_data.F90
r5063 r7277 1 1 MODULE sao_data 2 !! ================================================================= 3 !! *** MODULE sao_data *** 4 !! ================================================================= 2 !!====================================================================== 3 !! *** MODULE sao_data *** 4 !!====================================================================== 5 !! History : 3.6 ! 2015-12 (A. Ryan) Original code 6 !!---------------------------------------------------------------------- 5 7 USE par_kind, ONLY: lc 6 8 USE lib_mpp ! distributed memory computing 9 USE in_out_manager 7 10 8 11 IMPLICIT NONE 9 10 !! Public data11 12 12 13 INTEGER, PARAMETER :: MaxNumFiles = 1000 13 14 14 15 !! Stand Alone Observation operator settings 15 CHARACTER(len=lc) :: & 16 & sao_files(MaxNumFiles) !: model files 17 INTEGER :: & 18 & n_files, & !: number of files 19 & nn_sao_idx(MaxNumFiles), & !: time_counter indices 20 & nn_sao_freq !: read frequency in time steps 16 CHARACTER(len=lc) :: sao_files(MaxNumFiles) !: model files 17 INTEGER :: n_files !: number of files 18 INTEGER :: nn_sao_idx(MaxNumFiles) !: time_counter indices 19 INTEGER :: nn_sao_freq !: read frequency in time steps 20 21 !!---------------------------------------------------------------------- 22 !! NEMO/OPA 3.7 , NEMO Consortium (2015) 23 !! $Id: trazdf_imp.F90 6140 2015-12-21 11:35:23Z timgraham $ 24 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 25 !!---------------------------------------------------------------------- 21 26 CONTAINS 27 22 28 SUBROUTINE sao_data_init() 23 29 !!---------------------------------------------------------------------- … … 27 33 !! 28 34 !!---------------------------------------------------------------------- 29 USE in_out_manager 30 INTEGER :: & 31 & jf !: file dummy loop index 32 LOGICAL :: lmask(MaxNumFiles) !: Logical mask used for counting 33 INTEGER :: ios 34 35 ! Standard offline obs_oper information 35 INTEGER :: jf ! file dummy loop index 36 LOGICAL :: lmask(MaxNumFiles) ! Logical mask used for counting 37 INTEGER :: ios 38 !! 36 39 NAMELIST/namsao/sao_files, nn_sao_idx, nn_sao_freq 40 !!---------------------------------------------------------------------- 37 41 38 42 ! Standard offline obs_oper initialisation 39 n_files = 0 ! :number of files to cycle through40 sao_files(:) = '' ! :list of files to read in41 nn_sao_idx(:) = 0 ! :list of indices inside each file42 nn_sao_freq = -1 ! :input frequency in time steps43 n_files = 0 ! number of files to cycle through 44 sao_files(:) = '' ! list of files to read in 45 nn_sao_idx(:) = 0 ! list of indices inside each file 46 nn_sao_freq = -1 ! input frequency in time steps 43 47 44 48 ! Standard offline obs_oper settings … … 46 50 READ ( numnam_ref, namsao, IOSTAT = ios, ERR = 901 ) 47 51 901 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namsao in reference namelist', .TRUE. ) 48 52 ! 49 53 REWIND( numnam_cfg ) ! Namelist namctl in confguration namelist : Control prints & Benchmark 50 54 READ ( numnam_cfg, namsao, IOSTAT = ios, ERR = 902 ) 51 55 902 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namsao in configuration namelist', .TRUE. ) 52 53 54 ! count input files 55 lmask(:) = .FALSE. 56 57 lmask(:) = .FALSE. ! count input files 56 58 WHERE (sao_files(:) /= '') lmask(:) = .TRUE. 57 59 n_files = COUNT(lmask) 58 59 !! Initialise sub obs window frequency 60 IF (nn_sao_freq == -1) THEN 61 !! Run length 62 nn_sao_freq = nitend - nit000 + 1 60 ! 61 IF(nn_sao_freq == -1) THEN ! Initialise sub obs window frequency 62 nn_sao_freq = nitend - nit000 + 1 ! Run length 63 63 ENDIF 64 65 !! Print summary of settings 66 IF(lwp) THEN 64 ! 65 IF(lwp) THEN ! Print summary of settings 67 66 WRITE(numout,*) 68 67 WRITE(numout,*) 'offline obs_oper : Initialization' … … 70 69 WRITE(numout,*) ' Namelist namsao : set stand alone obs_oper parameters' 71 70 DO jf = 1, n_files 72 WRITE(numout,'(1X,2A)') ' Input forecast file name forecastfile = ', & 73 TRIM(sao_files(jf)) 74 WRITE(numout,*) ' Input forecast file index forecastindex = ', & 75 nn_sao_idx(jf) 71 WRITE(numout,'(1X,2A)') ' Input forecast file name forecastfile = ', TRIM(sao_files(jf)) 72 WRITE(numout,*) ' Input forecast file index forecastindex = ', nn_sao_idx(jf) 76 73 END DO 77 74 END IF 78 75 ! 79 76 END SUBROUTINE sao_data_init 80 77 78 !!====================================================================== 81 79 END MODULE sao_data 82 80 -
branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/SAO_SRC/sao_intp.F90
r5063 r7277 4 4 !! ** Purpose : Run NEMO observation operator in offline mode 5 5 !!====================================================================== 6 !! NEMO modules 6 !! History : 3.6 ! 2015-12 (A. Ryan) Original code 7 !!---------------------------------------------------------------------- 8 ! ! NEMO modules 7 9 USE in_out_manager 8 10 USE diaobs 9 ! ! Stand Alone Observation operator modules11 ! ! Stand Alone Observation operator modules 10 12 USE sao_read 11 13 USE sao_data … … 16 18 PUBLIC sao_interp 17 19 18 CONTAINS 20 !!---------------------------------------------------------------------- 21 !! NEMO/OPA 3.7 , NEMO Consortium (2015) 22 !! $Id: trazdf_imp.F90 6140 2015-12-21 11:35:23Z timgraham $ 23 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 24 !!---------------------------------------------------------------------- 25 CONTAINS 19 26 20 SUBROUTINE sao_interp 21 !!---------------------------------------------------------------------- 22 !! *** SUBROUTINE sao_interp *** 23 !! 24 !! ** Purpose : To interpolate the model as if it were running online. 25 !! 26 !! ** Method : 1. Populate model counterparts 27 !! 2. Call dia_obs at appropriate time steps 28 !!---------------------------------------------------------------------- 29 INTEGER :: & 30 & istp, & ! time step index 31 & ifile ! file index 32 istp = nit000 - 1 33 nstop = 0 34 ifile = 1 35 CALL sao_rea_dri(ifile) 36 DO WHILE ( istp <= nitend .AND. nstop == 0 ) 37 IF (ifile <= n_files + 1) THEN 38 IF ( MOD(istp, nn_sao_freq) == nit000 ) THEN 39 CALL sao_rea_dri(ifile) 40 ifile = ifile + 1 41 ENDIF 42 CALL dia_obs(istp) 27 SUBROUTINE sao_interp 28 !!---------------------------------------------------------------------- 29 !! *** SUBROUTINE sao_interp *** 30 !! 31 !! ** Purpose : To interpolate the model as if it were running online. 32 !! 33 !! ** Method : 1. Populate model counterparts 34 !! 2. Call dia_obs at appropriate time steps 35 !!---------------------------------------------------------------------- 36 INTEGER :: istp ! time step index 37 INTEGER :: ifile ! file index 38 !!---------------------------------------------------------------------- 39 istp = nit000 - 1 40 nstop = 0 41 ifile = 1 42 CALL sao_rea_dri(ifile) 43 ! 44 DO WHILE ( istp <= nitend .AND. nstop == 0 ) 45 IF (ifile <= n_files + 1) THEN 46 IF ( MOD(istp, nn_sao_freq) == nit000 ) THEN 47 CALL sao_rea_dri(ifile) 48 ifile = ifile + 1 43 49 ENDIF 44 istp = istp + 1 45 END DO 46 END SUBROUTINE sao_interp 50 CALL dia_obs(istp) 51 ENDIF 52 istp = istp + 1 53 END DO 54 ! 55 END SUBROUTINE sao_interp 47 56 57 !!====================================================================== 48 58 END MODULE sao_intp -
branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/SAO_SRC/sao_read.F90
r5063 r7277 1 1 MODULE sao_read 2 !!================================================================== 3 !! *** MODULE sao_read***2 !!====================================================================== 3 !! *** MODULE sao_read *** 4 4 !! Read routines : I/O for Stand Alone Observation operator 5 !!================================================================== 5 !!====================================================================== 6 6 USE mppini 7 7 USE lib_mpp … … 12 12 USE dom_oce, ONLY: nlci, nlcj, nimpp, njmpp, tmask 13 13 USE par_oce, ONLY: jpi, jpj, jpk 14 ! 14 15 USE obs_fbm, ONLY: fbimdi, fbrmdi, fbsp, fbdp 15 16 USE sao_data … … 20 21 PUBLIC sao_rea_dri 21 22 23 !!---------------------------------------------------------------------- 24 !! NEMO/OPA 3.7 , NEMO Consortium (2015) 25 !! $Id: trazdf_imp.F90 6140 2015-12-21 11:35:23Z timgraham $ 26 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 27 !!---------------------------------------------------------------------- 22 28 CONTAINS 23 SUBROUTINE sao_rea_dri(kfile) 29 30 SUBROUTINE sao_rea_dri( kfile ) 24 31 !!------------------------------------------------------------------------ 25 32 !! *** sao_rea_dri *** … … 31 38 !! 32 39 !!------------------------------------------------------------------------ 33 INTEGER, INTENT(IN) :: & 34 & kfile !: File number 35 CHARACTER(len=lc) :: & 36 & cdfilename !: File name 37 INTEGER :: & 38 & kindex !: File index to read 39 40 cdfilename = TRIM(sao_files(kfile)) 40 INTEGER, INTENT(in) :: kfile ! File number 41 ! 42 CHARACTER(len=lc) :: cdfilename ! File name 43 INTEGER :: kindex ! File index to read 44 !!------------------------------------------------------------------------ 45 ! 46 cdfilename = TRIM( sao_files(kfile) ) 41 47 kindex = nn_sao_idx(kfile) 42 CALL sao_read_file( TRIM(cdfilename), kindex)43 48 CALL sao_read_file( TRIM( cdfilename ), kindex ) 49 ! 44 50 END SUBROUTINE sao_rea_dri 45 51 46 SUBROUTINE sao_read_file(filename, ifcst) 52 53 SUBROUTINE sao_read_file( filename, ifcst ) 47 54 !!------------------------------------------------------------------------ 48 !! *** sao_read_file***55 !! *** sao_read_file *** 49 56 !! 50 57 !! Purpose : To fill tn and sn with dailymean field from netcdf files … … 54 61 !! Author : A. Ryan Oct 2010 55 62 !!------------------------------------------------------------------------ 56 57 INTEGER, INTENT(IN) :: ifcst 58 CHARACTER(len=*), INTENT(IN) :: filename 59 INTEGER :: ncid, & 60 & varid,& 61 & istat,& 62 & ntimes,& 63 & tdim, & 64 & xdim, & 65 & ydim, & 66 & zdim 67 INTEGER :: ii, ij, ik 68 INTEGER, DIMENSION(4) :: start_n, & 69 & count_n 70 INTEGER, DIMENSION(3) :: start_s, & 71 & count_s 72 REAL(fbdp), DIMENSION(:,:,:),ALLOCATABLE :: temp_tn, & 73 & temp_sn 74 REAL(fbdp), DIMENSION(:,:), ALLOCATABLE :: temp_sshn 75 REAL(fbdp) :: fill_val 63 INTEGER, INTENT(in) :: ifcst 64 CHARACTER(len=*), INTENT(in) :: filename 65 INTEGER :: ncid, varid, istat, ntimes 66 INTEGER :: tdim, xdim, ydim, zdim 67 INTEGER :: ii, ij, ik 68 INTEGER, DIMENSION(4) :: start_n, count_n 69 INTEGER, DIMENSION(3) :: start_s, count_s 70 REAL(fbdp) :: fill_val 71 REAL(fbdp), DIMENSION(:,:,:), ALLOCATABLE :: temp_tn, temp_sn 72 REAL(fbdp), DIMENSION(:,:) , ALLOCATABLE :: temp_sshn 76 73 77 74 ! DEBUG 78 INTEGER :: istage 75 INTEGER :: istage 76 !!------------------------------------------------------------------------ 79 77 80 78 IF (TRIM(filename) == 'nofile') THEN 81 tsn (:,:,:,:) = fbrmdi82 sshn(:,:) = fbrmdi79 tsn (:,:,:,:) = fbrmdi 80 sshn(:,:) = fbrmdi 83 81 ELSE 84 82 WRITE(numout,*) "Opening :", TRIM(filename) … … 169 167 istat = nf90_close(ncid) 170 168 END IF 169 ! 171 170 END SUBROUTINE sao_read_file 171 172 !!------------------------------------------------------------------------ 172 173 END MODULE sao_read -
branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/SAS_SRC/nemogcm.F90
r6165 r7277 2 2 !!====================================================================== 3 3 !! *** MODULE nemogcm *** 4 !! Ocean system : NEMO GCM (ocean dynamics, on-line tracers, biochemistry and sea-ice)4 !! StandAlone Surface module : surface fluxes + sea-ice + iceberg floats 5 5 !!====================================================================== 6 !! History : OPA ! 1990-10 (C. Levy, G. Madec) Original code 7 !! 7.0 ! 1991-11 (M. Imbard, C. Levy, G. Madec) 8 !! 7.1 ! 1993-03 (M. Imbard, C. Levy, G. Madec, O. Marti, M. Guyon, A. Lazar, 9 !! P. Delecluse, C. Perigaud, G. Caniaux, B. Colot, C. Maes) release 7.1 10 !! - ! 1992-06 (L.Terray) coupling implementation 11 !! - ! 1993-11 (M.A. Filiberti) IGLOO sea-ice 12 !! 8.0 ! 1996-03 (M. Imbard, C. Levy, G. Madec, O. Marti, M. Guyon, A. Lazar, 13 !! P. Delecluse, L.Terray, M.A. Filiberti, J. Vialar, A.M. Treguier, M. Levy) release 8.0 14 !! 8.1 ! 1997-06 (M. Imbard, G. Madec) 15 !! 8.2 ! 1999-11 (M. Imbard, H. Goosse) LIM sea-ice model 16 !! ! 1999-12 (V. Thierry, A-M. Treguier, M. Imbard, M-A. Foujols) OPEN-MP 17 !! ! 2000-07 (J-M Molines, M. Imbard) Open Boundary Conditions (CLIPPER) 18 !! NEMO 1.0 ! 2002-08 (G. Madec) F90: Free form and modules 19 !! - ! 2004-06 (R. Redler, NEC CCRLE, Germany) add OASIS[3/4] coupled interfaces 20 !! - ! 2004-08 (C. Talandier) New trends organization 21 !! - ! 2005-06 (C. Ethe) Add the 1D configuration possibility 22 !! - ! 2005-11 (V. Garnier) Surface pressure gradient organization 23 !! - ! 2006-03 (L. Debreu, C. Mazauric) Agrif implementation 24 !! - ! 2006-04 (G. Madec, R. Benshila) Step reorganization 25 !! - ! 2007-07 (J. Chanut, A. Sellar) Unstructured open boundaries (BDY) 26 !! 3.2 ! 2009-08 (S. Masson) open/write in the listing file in mpp 27 !! 3.3 ! 2010-05 (K. Mogensen, A. Weaver, M. Martin, D. Lea) Assimilation interface 28 !! - ! 2010-10 (C. Ethe, G. Madec) reorganisation of initialisation phase 29 !! 3.3.1! 2011-01 (A. R. Porter, STFC Daresbury) dynamical allocation 30 !! 3.4 ! 2011-11 (C. Harris) decomposition changes for running with CICE 6 !! History : 3.6 ! 2011-11 (S. Alderson, G. Madec) original code 7 !! - ! 2013-06 (I. Epicoco, S. Mocavero, CMCC) nemo_northcomms: setup avoiding MPI communication 8 !! - ! 2014-12 (G. Madec) remove KPP scheme and cross-land advection (cla) 9 !! 4.0 ! 2016-10 (G. Madec, S. Flavoni) domain configuration / user defined interface 31 10 !!---------------------------------------------------------------------- 32 11 33 12 !!---------------------------------------------------------------------- 34 !! nemo_gcm 35 !! nemo_init 36 !! nemo_ctl : initialisation of the contol print37 !! nemo_closefile 38 !! nemo_alloc 39 !! nemo_partition 40 !! factorise 13 !! nemo_gcm : solve ocean dynamics, tracer, biogeochemistry and/or sea-ice 14 !! nemo_init : initialization of the NEMO system 15 !! nemo_ctl : initialisation of the contol print 16 !! nemo_closefile: close remaining open files 17 !! nemo_alloc : dynamical allocation 18 !! nemo_partition: calculate MPP domain decomposition 19 !! factorise : calculate the factors of the no. of MPI processes 41 20 !!---------------------------------------------------------------------- 42 USE step_oce ! module used in the ocean time stepping module 43 USE sbc_oce ! surface boundary condition: ocean 44 USE domcfg ! domain configuration (dom_cfg routine) 45 USE daymod ! calendar 46 USE mppini ! shared/distributed memory setting (mpp_init routine) 47 USE domain ! domain initialization (dom_init routine) 48 USE phycst ! physical constant (par_cst routine) 49 USE step ! NEMO time-stepping (stp routine) 50 USE lib_mpp ! distributed memory computing 51 #if defined key_nosignedzero 52 USE lib_fortran ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined) 53 #endif 21 USE step_oce ! module used in the ocean time stepping module 22 USE sbc_oce ! surface boundary condition: ocean 23 USE phycst ! physical constant (par_cst routine) 24 USE domain ! domain initialization (dom_init & dom_cfg routines) 25 USE usrdef_nam ! user defined configuration 26 USE daymod ! calendar 27 USE step ! NEMO time-stepping (stp routine) 28 USE cpl_oasis3 ! 29 USE sbcssm ! 30 USE icbstp ! handle bergs, calving, themodynamics and transport 31 #if defined key_bdy 32 USE bdyini ! open boundary cond. setting (bdy_init routine). clem: mandatory for LIM3 33 USE bdydta ! open boundary cond. setting (bdy_dta_init routine). clem: mandatory for LIM3 34 #endif 35 USE bdy_par 36 ! 37 USE lib_mpp ! distributed memory computing 38 USE mppini ! shared/distributed memory setting (mpp_init routine) 39 USE lbcnfd , ONLY: isendto, nsndto, nfsloop, nfeloop ! Setup of north fold exchanges 40 USE lib_fortran ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined) 54 41 #if defined key_iomput 55 USE xios 56 #endif 57 USE cpl_oasis3 58 USE sbcssm 59 USE lbcnfd, ONLY: isendto, nsndto, nfsloop, nfeloop ! Setup of north fold exchanges 60 USE icbstp ! handle bergs, calving, themodynamics and transport 61 #if defined key_bdy 62 USE bdyini ! open boundary cond. setting (bdy_init routine). clem: mandatory for LIM3 63 USE bdydta ! open boundary cond. setting (bdy_dta_init routine). clem: mandatory for LIM3 64 #endif 65 USE bdy_par 42 USE xios ! xIOserver 43 #endif 66 44 67 45 IMPLICIT NONE … … 74 52 75 53 !!---------------------------------------------------------------------- 76 !! NEMO/OPA 4.0 , NEMO Consortium (201 1)54 !! NEMO/OPA 4.0 , NEMO Consortium (2016) 77 55 !! $Id$ 78 56 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) … … 84 62 !! *** ROUTINE nemo_gcm *** 85 63 !! 86 !! ** Purpose : NEMO solves the primitive equations on an orthogonal 64 !! ** Purpose : NEMO solves the primitive equations on an orthogonal 87 65 !! curvilinear mesh on the sphere. 88 66 !! … … 94 72 !! Madec, 2008, internal report, IPSL. 95 73 !!---------------------------------------------------------------------- 96 INTEGER :: istp 74 INTEGER :: istp ! time step index 97 75 !!---------------------------------------------------------------------- 98 76 ! … … 100 78 CALL Agrif_Init_Grids() ! AGRIF: set the meshes 101 79 #endif 102 80 ! 103 81 ! !-----------------------! 104 82 CALL nemo_init !== Initialisations ==! … … 124 102 ! !-----------------------! 125 103 istp = nit000 126 104 #if defined key_agrif 105 CALL Agrif_Regrid() 106 #endif 107 127 108 DO WHILE ( istp <= nitend .AND. nstop == 0 ) 128 109 #if defined key_agrif 129 CALL Agrif_Step( stp )! AGRIF: time stepping110 CALL stp ! AGRIF: time stepping 130 111 #else 131 CALL stp( istp ) ! standard time stepping 112 IF ( .NOT. ln_diurnal_only ) THEN 113 CALL stp( istp ) ! standard time stepping 114 ELSE 115 CALL stp_diurnal( istp ) ! time step only the diurnal SST 116 ENDIF 132 117 #endif 133 118 istp = istp + 1 134 119 IF( lk_mpp ) CALL mpp_max( nstop ) 135 END DO120 END DO 136 121 ! 137 122 IF( ln_icebergs ) CALL icb_end( nitend ) … … 140 125 ! !== finalize the run ==! 141 126 ! !------------------------! 142 IF(lwp) WRITE(numout,cform_aaa) ! Flag AAAAAAA143 ! 144 IF( nstop /= 0 .AND. lwp ) THEN ! error print127 IF(lwp) WRITE(numout,cform_aaa) ! Flag AAAAAAA 128 ! 129 IF( nstop /= 0 .AND. lwp ) THEN ! error print 145 130 WRITE(numout,cform_err) 146 WRITE(numout,*) nstop, ' error have been found' 131 WRITE(numout,*) nstop, ' error have been found' 147 132 ENDIF 148 133 ! … … 157 142 ! 158 143 #if defined key_iomput 159 CALL xios_finalize ! end mpp communications with xios160 IF( lk_oasis ) CALL cpl_finalize! end coupling and mpp communications with OASIS144 CALL xios_finalize ! end mpp communications with xios 145 IF( lk_oasis ) CALL cpl_finalize ! end coupling and mpp communications with OASIS 161 146 #else 162 147 IF( lk_oasis ) THEN 163 CALL cpl_finalize ! end coupling and mpp communications with OASIS148 CALL cpl_finalize ! end coupling and mpp communications with OASIS 164 149 ELSE 165 IF( lk_mpp ) CALL mppstop ! end mpp communications150 IF( lk_mpp ) CALL mppstop ! end mpp communications 166 151 ENDIF 167 152 #endif … … 176 161 !! ** Purpose : initialization of the NEMO GCM 177 162 !!---------------------------------------------------------------------- 178 INTEGER :: ji ! dummy loop indices 179 INTEGER :: ilocal_comm ! local integer 180 INTEGER :: ios 181 CHARACTER(len=80), DIMENSION(16) :: cltxt 182 CHARACTER(len=80) :: clname 183 ! 184 NAMELIST/namctl/ ln_ctl , nn_print, nn_ictls, nn_ictle, & 185 & nn_isplt, nn_jsplt, nn_jctls, nn_jctle, & 186 & nn_bench, nn_timing, nn_diacfl 187 NAMELIST/namcfg/ cp_cfg, cp_cfz, jp_cfg, jpidta, jpjdta, jpkdta, jpiglo, jpjglo, & 188 & jpizoom, jpjzoom, jperio, ln_use_jattr 189 !!---------------------------------------------------------------------- 190 ! 191 cltxt = '' 163 INTEGER :: ji ! dummy loop indices 164 INTEGER :: ilocal_comm ! local integer 165 INTEGER :: ios, inum ! - - 166 CHARACTER(len=120), DIMENSION(30) :: cltxt, cltxt2, clnam 167 CHARACTER(len=80) :: clname 168 ! 169 NAMELIST/namctl/ ln_ctl , nn_print, nn_ictls, nn_ictle, & 170 & nn_isplt , nn_jsplt, nn_jctls, nn_jctle, & 171 & nn_timing, nn_diacfl 172 NAMELIST/namcfg/ ln_read_cfg, cn_domcfg, ln_write_cfg, cn_domcfg_out, ln_use_jattr 173 !!---------------------------------------------------------------------- 174 ! 175 cltxt = '' 176 cltxt2 = '' 177 clnam = '' 178 cxios_context = 'nemo' 192 179 ! 193 180 ! ! Open reference namelist and configuration namelist files … … 204 191 ENDIF 205 192 ! 206 REWIND( numnam_ref ) ! Namelist namctl in reference namelist : Control prints & Benchmark193 REWIND( numnam_ref ) ! Namelist namctl in reference namelist : Control prints 207 194 READ ( numnam_ref, namctl, IOSTAT = ios, ERR = 901 ) 208 195 901 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namctl in reference namelist', .TRUE. ) 209 210 REWIND( numnam_cfg ) ! Namelist namctl in confguration namelist : Control prints & Benchmark196 ! 197 REWIND( numnam_cfg ) ! Namelist namctl in confguration namelist 211 198 READ ( numnam_cfg, namctl, IOSTAT = ios, ERR = 902 ) 212 199 902 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namctl in configuration namelist', .TRUE. ) 213 214 ! 215 REWIND( numnam_ref ) ! Namelist namcfg in reference namelist : Control prints & Benchmark 200 ! 201 REWIND( numnam_ref ) ! Namelist namcfg in reference namelist : Control prints 216 202 READ ( numnam_ref, namcfg, IOSTAT = ios, ERR = 903 ) 217 203 903 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namcfg in reference namelist', .TRUE. ) … … 221 207 904 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namcfg in configuration namelist', .TRUE. ) 222 208 223 ! Force values for AGRIF zoom (cf. agrif_user.F90) 209 ! !--------------------------! 210 ! ! Set global domain size ! (control print return in cltxt2) 211 ! !--------------------------! 212 IF( ln_read_cfg ) THEN ! Read sizes in domain configuration file 213 CALL domain_cfg ( cltxt2, cn_cfg, nn_cfg, jpiglo, jpjglo, jpkglo, jperio ) 214 ! 215 ELSE ! user-defined namelist 216 CALL usr_def_nam( cltxt2, clnam, cn_cfg, nn_cfg, jpiglo, jpjglo, jpkglo, jperio ) 217 ENDIF 218 ! 219 jpk = jpkglo 220 ! 224 221 #if defined key_agrif 225 IF( .NOT. Agrif_Root() ) THEN 226 jpiglo = nbcellsx + 2 + 2*nbghostcells 227 jpjglo = nbcellsy + 2 + 2*nbghostcells 228 jpi = ( jpiglo-2*jpreci + (jpni-1+0) ) / jpni + 2*jpreci 229 jpj = ( jpjglo-2*jprecj + (jpnj-1+0) ) / jpnj + 2*jprecj 230 jpidta = jpiglo 231 jpjdta = jpjglo 232 jpizoom = 1 233 jpjzoom = 1 234 nperio = 0 235 jperio = 0 236 ln_use_jattr = .false. 237 ENDIF 222 IF( .NOT. Agrif_Root() ) THEN ! AGRIF children: specific setting (cf. agrif_user.F90) 223 jpiglo = nbcellsx + 2 + 2*nbghostcells 224 jpjglo = nbcellsy + 2 + 2*nbghostcells 225 jpi = ( jpiglo-2*jpreci + (jpni-1+0) ) / jpni + 2*jpreci 226 jpj = ( jpjglo-2*jprecj + (jpnj-1+0) ) / jpnj + 2*jprecj 227 nperio = 0 228 jperio = 0 229 ln_use_jattr = .false. 230 ENDIF 238 231 #endif 239 232 ! … … 249 242 CALL xios_initialize( "not used",local_comm=ilocal_comm ) ! send nemo communicator to xios 250 243 ELSE 251 CALL xios_initialize( "for_xios_mpi_id",return_comm=ilocal_comm ) 244 CALL xios_initialize( "for_xios_mpi_id",return_comm=ilocal_comm ) ! nemo local communicator given by xios 252 245 ENDIF 253 246 ENDIF … … 264 257 ENDIF 265 258 #endif 259 266 260 narea = narea + 1 ! mynode return the rank of proc (0 --> jpnij -1 ) 267 261 … … 269 263 lwp = (narea == 1) .OR. ln_ctl ! control of all listing output print 270 264 271 IF(lwm) THEN 272 ! write merged namelists from earlier to output namelist now that the 273 ! file has been opened in call to mynode. nammpp has already been 274 ! written in mynode (if lk_mpp_mpi) 265 IF(lwm) THEN ! write merged namelists from earlier to output namelist 266 ! ! now that the file has been opened in call to mynode. 267 ! ! NB: nammpp has already been written in mynode (if lk_mpp_mpi) 275 268 WRITE( numond, namctl ) 276 269 WRITE( numond, namcfg ) 277 ENDIF 278 279 ! If dimensions of processor grid weren't specified in the namelist file 270 IF( .NOT.ln_read_cfg ) THEN 271 DO ji = 1, SIZE(clnam) 272 IF( TRIM(clnam(ji)) /= '' ) WRITE(numond, * ) clnam(ji) ! namusr_def print 273 END DO 274 ENDIF 275 ENDIF 276 277 ! If dimensions of processor grid weren't specified in the namelist file 280 278 ! then we calculate them here now that we have our communicator size 281 IF( (jpni < 1) .OR. (jpnj < 1) )THEN279 IF( jpni < 1 .OR. jpnj < 1 ) THEN 282 280 #if defined key_mpp_mpi 283 IF( Agrif_Root() ) CALL nemo_partition(mppsize)281 IF( Agrif_Root() ) CALL nemo_partition( mppsize ) 284 282 #else 285 283 jpni = 1 … … 287 285 jpnij = jpni*jpnj 288 286 #endif 289 END IF 290 291 ! Calculate domain dimensions given calculated jpni and jpnj 292 ! This used to be done in par_oce.F90 when they were parameters rather 293 ! than variables 294 IF( Agrif_Root() ) THEN 287 ENDIF 288 289 IF( Agrif_Root() ) THEN ! AGRIF mother: specific setting from jpni and jpnj 295 290 #if defined key_nemocice_decomp 296 jpi = ( nx_global+2-2*jpreci + (jpni-1) ) / jpni + 2*jpreci ! first dim.297 jpj = ( ny_global+2-2*jprecj + (jpnj-1) ) / jpnj + 2*jprecj ! second dim.291 jpi = ( nx_global+2-2*jpreci + (jpni-1) ) / jpni + 2*jpreci ! first dim. 292 jpj = ( ny_global+2-2*jprecj + (jpnj-1) ) / jpnj + 2*jprecj ! second dim. 298 293 #else 299 jpi = ( jpiglo-2*jpreci + (jpni-1) ) / jpni + 2*jpreci ! first dim. 300 jpj = ( jpjglo-2*jprecj + (jpnj-1) ) / jpnj + 2*jprecj ! second dim. 301 #endif 302 ENDIF 303 jpk = jpkdta ! third dim 304 jpim1 = jpi-1 ! inner domain indices 305 jpjm1 = jpj-1 ! " " 306 jpkm1 = jpk-1 ! " " 307 jpij = jpi*jpj ! jpi x j 294 jpi = ( jpiglo -2*jpreci + (jpni-1) ) / jpni + 2*jpreci ! first dim. 295 jpj = ( jpjglo -2*jprecj + (jpnj-1) ) / jpnj + 2*jprecj ! second dim. 296 #endif 297 ENDIF 298 299 !!gm ??? why here it has already been done in line 301 ! 300 jpk = jpkglo ! third dim 301 !!gm end 302 303 #if defined key_agrif 304 ! simple trick to use same vertical grid as parent but different number of levels: 305 ! Save maximum number of levels in jpkglo, then define all vertical grids with this number. 306 ! Suppress once vertical online interpolation is ok 307 IF(.NOT.Agrif_Root()) jpkglo = Agrif_Parent( jpkglo ) 308 #endif 309 jpim1 = jpi-1 ! inner domain indices 310 jpjm1 = jpj-1 ! " " 311 jpkm1 = jpk-1 ! " " 312 jpij = jpi*jpj ! jpi x j 308 313 309 314 IF(lwp) THEN ! open listing units … … 319 324 WRITE(numout,*) ' NEMO team' 320 325 WRITE(numout,*) ' Ocean General Circulation Model' 321 WRITE(numout,*) ' version 3. 6 (2015) '326 WRITE(numout,*) ' version 3.7 (2016) ' 322 327 WRITE(numout,*) ' StandAlone Surface version (SAS) ' 323 328 WRITE(numout,*) 324 329 WRITE(numout,*) 325 DO ji = 1, SIZE(cltxt) 326 IF( TRIM(cltxt (ji)) /= '' ) WRITE(numout,*) cltxt(ji)! control print of mynode330 DO ji = 1, SIZE(cltxt) 331 IF( TRIM(cltxt (ji)) /= '' ) WRITE(numout,*) cltxt(ji) ! control print of mynode 327 332 END DO 328 WRITE(numout,cform_aaa) ! Flag AAAAAAA 333 WRITE(numout,*) 334 WRITE(numout,*) 335 DO ji = 1, SIZE(cltxt2) 336 IF( TRIM(cltxt2(ji)) /= '' ) WRITE(numout,*) cltxt2(ji) ! control print of domain size 337 END DO 329 338 ! 330 ENDIF 331 332 ! Now we know the dimensions of the grid and numout has been set we can 333 ! allocate arrays 339 WRITE(numout,cform_aaa) ! Flag AAAAAAA 340 ! 341 ENDIF 342 343 ! Now we know the dimensions of the grid and numout has been set: we can allocate arrays 334 344 CALL nemo_alloc() 335 336 345 ! !-------------------------------! 337 346 ! ! NEMO general initialization ! 338 347 ! !-------------------------------! 339 348 340 CALL nemo_ctl ! Control prints & Benchmark349 CALL nemo_ctl ! Control prints 341 350 342 351 ! ! Domain decomposition … … 350 359 CALL phy_cst ! Physical constants 351 360 CALL eos_init ! Equation of state 352 CALL dom_cfg ! Domain configuration353 361 CALL dom_init ! Domain 354 362 … … 383 391 IF(lwp) THEN ! control print 384 392 WRITE(numout,*) 385 WRITE(numout,*) 'nemo_ctl: Control prints & Benchmark'393 WRITE(numout,*) 'nemo_ctl: Control prints' 386 394 WRITE(numout,*) '~~~~~~~ ' 387 395 WRITE(numout,*) ' Namelist namctl' … … 394 402 WRITE(numout,*) ' number of proc. following i nn_isplt = ', nn_isplt 395 403 WRITE(numout,*) ' number of proc. following j nn_jsplt = ', nn_jsplt 396 WRITE(numout,*) ' benchmark parameter (0/1) nn_bench = ', nn_bench404 WRITE(numout,*) ' timing activated (0/1) nn_timing = ', nn_timing 397 405 ENDIF 398 406 ! … … 404 412 isplt = nn_isplt 405 413 jsplt = nn_jsplt 406 nbench = nn_bench407 414 408 415 IF(lwp) THEN ! control print … … 411 418 WRITE(numout,*) '~~~~~~~ ' 412 419 WRITE(numout,*) ' Namelist namcfg' 413 WRITE(numout,*) ' configuration name cp_cfg = ', TRIM(cp_cfg) 414 WRITE(numout,*) ' configuration zoom name cp_cfz = ', TRIM(cp_cfz) 415 WRITE(numout,*) ' configuration resolution jp_cfg = ', jp_cfg 416 WRITE(numout,*) ' 1st lateral dimension ( >= jpi ) jpidta = ', jpidta 417 WRITE(numout,*) ' 2nd " " ( >= jpj ) jpjdta = ', jpjdta 418 WRITE(numout,*) ' 3nd " " jpkdta = ', jpkdta 419 WRITE(numout,*) ' 1st dimension of global domain in i jpiglo = ', jpiglo 420 WRITE(numout,*) ' 2nd - - in j jpjglo = ', jpjglo 421 WRITE(numout,*) ' left bottom i index of the zoom (in data domain) jpizoom = ', jpizoom 422 WRITE(numout,*) ' left bottom j index of the zoom (in data domain) jpizoom = ', jpjzoom 423 WRITE(numout,*) ' lateral cond. type (between 0 and 6) jperio = ', jperio 424 WRITE(numout,*) ' use file attribute if exists as i/p j-start ln_use_jattr = ', ln_use_jattr 420 WRITE(numout,*) ' read domain configuration files ln_read_cfg = ', ln_read_cfg 421 WRITE(numout,*) ' filename to be read cn_domcfg = ', TRIM(cn_domcfg) 422 WRITE(numout,*) ' write configuration definition files ln_write_cfg = ', ln_write_cfg 423 WRITE(numout,*) ' filename to be written cn_domcfg_out = ', TRIM(cn_domcfg_out) 424 WRITE(numout,*) ' use file attribute if exists as i/p j-start ln_use_jattr = ', ln_use_jattr 425 425 ENDIF 426 426 ! ! Parameter control … … 441 441 ! ! indices used for the SUM control 442 442 IF( nictls+nictle+njctls+njctle == 0 ) THEN ! print control done over the default area 443 lsp_area = .FALSE. 443 lsp_area = .FALSE. 444 444 ELSE ! print control done over a specific area 445 445 lsp_area = .TRUE. … … 463 463 ENDIF 464 464 ! 465 IF( nbench == 1 ) THEN ! Benchmark466 SELECT CASE ( cp_cfg )467 CASE ( 'gyre' ) ; CALL ctl_warn( ' The Benchmark is activated ' )468 CASE DEFAULT ; CALL ctl_stop( ' The Benchmark is based on the GYRE configuration:', &469 & ' cp_cfg="gyre" in namelist &namcfg or set nbench = 0' )470 END SELECT471 ENDIF472 !473 465 IF( 1_wp /= SIGN(1._wp,-0._wp) ) CALL ctl_stop( 'nemo_ctl: The intrinsec SIGN function follows ', & 474 466 & 'f2003 standard. ' , & … … 521 513 #endif 522 514 ! 523 INTEGER :: ierr, ierr1,ierr2,ierr3,ierr4,ierr5,ierr6,ierr7,ierr8515 INTEGER :: ierr, ierr1, ierr2, ierr3, ierr4, ierr5, ierr6, ierr7, ierr8 524 516 INTEGER :: jpm 525 517 !!---------------------------------------------------------------------- … … 540 532 ! clem: should not be needed. To be checked out 541 533 jpm = MAX(jp_tem, jp_sal) 542 ALLOCATE( tsn (jpi,jpj,1,jpm), STAT=ierr2 )543 ALLOCATE( ub (jpi,jpj,1), STAT=ierr3 )544 ALLOCATE( vb (jpi,jpj,1), STAT=ierr4 )545 ALLOCATE( tsb (jpi,jpj,1,jpm), STAT=ierr5 )534 ALLOCATE( tsn (jpi,jpj,1,jpm) , STAT=ierr2 ) 535 ALLOCATE( ub (jpi,jpj,1) , STAT=ierr3 ) 536 ALLOCATE( vb (jpi,jpj,1) , STAT=ierr4 ) 537 ALLOCATE( tsb (jpi,jpj,1,jpm) , STAT=ierr5 ) 546 538 ALLOCATE( sshn(jpi,jpj) , STAT=ierr6 ) 547 ALLOCATE( un (jpi,jpj,1), STAT=ierr7 )548 ALLOCATE( vn (jpi,jpj,1), STAT=ierr8 )539 ALLOCATE( un (jpi,jpj,1) , STAT=ierr7 ) 540 ALLOCATE( vn (jpi,jpj,1) , STAT=ierr8 ) 549 541 ierr = ierr + ierr1 + ierr2 + ierr3 + ierr4 + ierr5 + ierr6 + ierr7 + ierr8 550 542 #endif … … 564 556 !! ** Method : 565 557 !!---------------------------------------------------------------------- 566 INTEGER, INTENT(in) :: num_pes! The number of MPI processes we have558 INTEGER, INTENT(in) :: num_pes ! The number of MPI processes we have 567 559 ! 568 560 INTEGER, PARAMETER :: nfactmax = 20 … … 608 600 !! 609 601 !! ** Purpose : return the prime factors of n. 610 !! knfax factors are returned in array kfax which is of 602 !! knfax factors are returned in array kfax which is of 611 603 !! maximum dimension kmaxfax. 612 604 !! ** Method : … … 618 610 INTEGER :: ifac, jl, inu 619 611 INTEGER, PARAMETER :: ntest = 14 620 INTEGER :: ilfax(ntest) 612 INTEGER, DIMENSION(ntest) :: ilfax 613 !!---------------------------------------------------------------------- 621 614 ! 622 615 ! lfax contains the set of allowed factors. 623 data (ilfax(jl),jl=1,ntest) / 16384, 8192, 4096, 2048, 1024, 512, 256, & 624 & 128, 64, 32, 16, 8, 4, 2 / 625 !!---------------------------------------------------------------------- 626 616 ilfax(:) = (/(2**jl,jl=ntest,1,-1)/) 617 ! 627 618 ! Clear the error flag and initialise output vars 628 kerr = 0629 kfax = 1619 kerr = 0 620 kfax = 1 630 621 knfax = 0 631 622 ! 632 623 ! Find the factors of n. 633 624 IF( kn == 1 ) GOTO 20 … … 637 628 ! l points to the allowed factor list. 638 629 ! ifac holds the current factor. 639 630 ! 640 631 inu = kn 641 632 knfax = 0 642 633 ! 643 634 DO jl = ntest, 1, -1 644 635 ! … … 664 655 ! 665 656 END DO 666 657 ! 667 658 20 CONTINUE ! Label 20 is the exit point from the factor search loop. 668 659 ! … … 670 661 671 662 #if defined key_mpp_mpi 663 672 664 SUBROUTINE nemo_northcomms 673 !! ======================================================================665 !!---------------------------------------------------------------------- 674 666 !! *** ROUTINE nemo_northcomms *** 675 !! nemo_northcomms : Setup for north fold exchanges with explicit 676 !! point-to-point messaging 677 !!===================================================================== 678 !!---------------------------------------------------------------------- 679 !! 680 !! ** Purpose : Initialization of the northern neighbours lists. 667 !! ** Purpose : Setup for north fold exchanges with explicit 668 !! point-to-point messaging 669 !! 670 !! ** Method : Initialization of the northern neighbours lists. 681 671 !!---------------------------------------------------------------------- 682 672 !! 1.0 ! 2011-10 (A. C. Coward, NOCS & J. Donners, PRACE) 683 673 !! 2.0 ! 2013-06 Setup avoiding MPI communication (I. Epicoco, S. Mocavero, CMCC) 684 674 !!---------------------------------------------------------------------- 685 686 675 INTEGER :: sxM, dxM, sxT, dxT, jn 687 676 INTEGER :: njmppmax 688 677 !!---------------------------------------------------------------------- 678 ! 689 679 njmppmax = MAXVAL( njmppt ) 690 680 ! 691 681 !initializes the north-fold communication variables 692 682 isendto(:) = 0 693 nsndto = 0694 683 nsndto = 0 684 ! 695 685 !if I am a process in the north 696 686 IF ( njmpp == njmppmax ) THEN … … 745 735 END SUBROUTINE nemo_northcomms 746 736 #endif 737 747 738 !!====================================================================== 748 739 END MODULE nemogcm -
branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/TOP_SRC/CFC/trcsms_cfc.F90
r6140 r7277 42 42 REAL(wp), DIMENSION(4,2) :: soa ! coefficient for solubility of CFC [mol/l/atm] 43 43 REAL(wp), DIMENSION(3,2) :: sob ! " " 44 REAL(wp), DIMENSION(4,2) :: sca ! coefficients for schmidt number in degre Cel cius44 REAL(wp), DIMENSION(4,2) :: sca ! coefficients for schmidt number in degre Celsius 45 45 46 46 ! ! coefficients for conversion -
branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zsms.F90
r6140 r7277 416 416 IF(lwp) WRITE(numout,*) 417 417 418 IF( c p_cfg == "orca" .AND. .NOT. lk_c1d ) THEN ! ORCA configuration (not 1D) !419 ! 418 IF( cn_cfg == "orca" .AND. .NOT. lk_c1d ) THEN ! ORCA configuration (not 1D) ! 419 ! ! --------------------------- ! 420 420 ! set total alkalinity, phosphate, nitrate & silicate 421 421 zarea = 1._wp / glob_sum( cvol(:,:,:) ) * 1e6 -
branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/TOP_SRC/PISCES/trcice_pisces.F90
r5725 r7277 225 225 WHERE( gphit(:,:) < 0._wp ) ; trc_o(:,:,jn) = zpisc(jn,3) ; END WHERE ! Antarctic 226 226 ENDIF 227 IF( c p_cfg == "orca" ) THEN ! Baltic Sea particular case for ORCA configurations227 IF( cn_cfg == "orca" ) THEN ! Baltic Sea particular case for ORCA configurations 228 228 WHERE( 14._wp <= glamt(:,:) .AND. glamt(:,:) <= 32._wp .AND. & 229 229 54._wp <= gphit(:,:) .AND. gphit(:,:) <= 66._wp ) … … 264 264 265 265 !-- Baltic 266 IF( c p_cfg == "orca" ) THEN ! Baltic treated seperately for ORCA configs266 IF( cn_cfg == "orca" ) THEN ! Baltic treated seperately for ORCA configs 267 267 IF ( trc_ice_ratio(jn) >= - 1._wp ) THEN ! no prescribed conc. ; typically everything but iron) 268 268 WHERE( 14._wp <= glamt(:,:) .AND. glamt(:,:) <= 32._wp .AND. & -
branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/TOP_SRC/TRP/trcadv.F90
r6140 r7277 94 94 ENDIF 95 95 ! !== effective transport ==! 96 DO jk = 1, jpkm1 97 zun(:,:,jk) = e2u (:,:) * e3u_n(:,:,jk) * un(:,:,jk) ! eulerian transport 98 zvn(:,:,jk) = e1v (:,:) * e3v_n(:,:,jk) * vn(:,:,jk) 99 zwn(:,:,jk) = e1e2t(:,:) * wn(:,:,jk) 100 END DO 101 ! 102 IF( ln_vvl_ztilde .OR. ln_vvl_layer ) THEN ! add z-tilde and/or vvl corrections 103 zun(:,:,:) = zun(:,:,:) + un_td(:,:,:) 104 zvn(:,:,:) = zvn(:,:,:) + vn_td(:,:,:) 105 ENDIF 106 ! 107 IF( ln_ldfeiv .AND. .NOT. ln_traldf_triad ) & 108 & CALL ldf_eiv_trp( kt, nittrc000, zun, zvn, zwn, 'TRC' ) ! add the eiv transport 109 ! 110 IF( ln_mle ) CALL tra_adv_mle( kt, nittrc000, zun, zvn, zwn, 'TRC' ) ! add the mle transport 111 ! 112 zun(:,:,jpk) = 0._wp ! no transport trough the bottom 113 zvn(:,:,jpk) = 0._wp 114 zwn(:,:,jpk) = 0._wp 115 ! 96 IF( lk_offline ) THEN 97 zun(:,:,:) = un(:,:,:) ! effective transport already in un/vn/wn 98 zvn(:,:,:) = vn(:,:,:) 99 zwn(:,:,:) = wn(:,:,:) 100 ELSE 101 ! 102 DO jk = 1, jpkm1 103 zun(:,:,jk) = e2u (:,:) * e3u_n(:,:,jk) * un(:,:,jk) ! eulerian transport 104 zvn(:,:,jk) = e1v (:,:) * e3v_n(:,:,jk) * vn(:,:,jk) 105 zwn(:,:,jk) = e1e2t(:,:) * wn(:,:,jk) 106 END DO 107 ! 108 IF( ln_vvl_ztilde .OR. ln_vvl_layer ) THEN ! add z-tilde and/or vvl corrections 109 zun(:,:,:) = zun(:,:,:) + un_td(:,:,:) 110 zvn(:,:,:) = zvn(:,:,:) + vn_td(:,:,:) 111 ENDIF 112 ! 113 IF( ln_ldfeiv .AND. .NOT. ln_traldf_triad ) & 114 & CALL ldf_eiv_trp( kt, nittrc000, zun, zvn, zwn, 'TRC' ) ! add the eiv transport 115 ! 116 IF( ln_mle ) CALL tra_adv_mle( kt, nittrc000, zun, zvn, zwn, 'TRC' ) ! add the mle transport 117 ! 118 zun(:,:,jpk) = 0._wp ! no transport trough the bottom 119 zvn(:,:,jpk) = 0._wp 120 zwn(:,:,jpk) = 0._wp 121 ! 122 ENDIF 116 123 ! 117 124 SELECT CASE ( nadv ) !== compute advection trend and add it to general trend ==! -
branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/TOP_SRC/TRP/trcdmp.F90
r6309 r7277 201 201 ENDIF 202 202 ! 203 IF( lzoom .AND. .NOT.lk_c1d ) nn_zdmp_tr = 0 ! restoring to climatology at closed north or south boundaries204 203 SELECT CASE ( nn_zdmp_tr ) 205 204 CASE ( 0 ) ; IF(lwp) WRITE(numout,*) ' tracer damping throughout the water column' … … 253 252 ! ------------------- 254 253 255 IF( c p_cfg == "orca" ) THEN256 ! 257 SELECT CASE ( jp_cfg )254 IF( cn_cfg == "orca" ) THEN 255 ! 256 SELECT CASE ( nn_cfg ) 258 257 ! ! ======================= 259 258 CASE ( 1 ) ! eORCA_R1 configuration -
branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/TOP_SRC/TRP/trcsbc.F90
r6309 r7277 100 100 IF(lwp) WRITE(numout,*) '~~~~~~~ ' 101 101 102 IF( ln_rsttr .AND. & ! Restart: read in restart file102 IF( ln_rsttr .AND. .NOT.ln_top_euler .AND. & ! Restart: read in restart file 103 103 iom_varid( numrtr, 'sbc_'//TRIM(ctrcnm(1))//'_b', ldstop = .FALSE. ) > 0 ) THEN 104 104 IF(lwp) WRITE(numout,*) ' nittrc000-nn_dttrc surface tracer content forcing fields red in the restart file' … … 126 126 ! Coupling offline : runoff are in emp which contains E-P-R 127 127 ! 128 IF( .NOT. lk_offline .AND. .NOT.ln_linssh ) THEN ! online coupling with vvl128 IF( .NOT.ln_linssh ) THEN ! online coupling with vvl 129 129 zsfx(:,:) = 0._wp 130 130 ELSE ! online coupling free surface or offline with free surface … … 187 187 ! Write in the tracer restar file 188 188 ! ******************************* 189 IF( lrst_trc ) THEN189 IF( lrst_trc .AND. .NOT.ln_top_euler ) THEN 190 190 IF(lwp) WRITE(numout,*) 191 191 IF(lwp) WRITE(numout,*) 'sbc : ocean surface tracer content forcing fields written in tracer restart file ', & -
branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/TOP_SRC/TRP/trdmxl_trc.F90
r6140 r7277 428 428 ENDIF 429 429 430 IF ( cp_cfg .NE. 'gyre' ) THEN ! other than GYRE configuration 431 ! GYRE : for diagnostic fields, are needed if cyclic B.C. are present, but not for purely MPI comm. 432 ! therefore we do not call lbc_lnk in GYRE config. (closed basin, no cyclic B.C.) 430 !!gm Test removed, nothing specific to a configuration should survive out of usrdef modules 431 !!gm IF ( cn_cfg .NE. 'gyre' ) THEN ! other than GYRE configuration 432 !!gm ! GYRE : for diagnostic fields, are needed if cyclic B.C. are present, but not for purely MPI comm. 433 !!gm ! therefore we do not call lbc_lnk in GYRE config. (closed basin, no cyclic B.C.) 433 434 DO jn = 1, jptra 434 435 IF( ln_trdtrc(jn) ) THEN … … 438 439 ENDIF 439 440 END DO 440 ENDIF 441 !!gm ENDIF 442 441 443 ! ====================================================================== 442 444 ! II. Cumulate the trends over the analysis window … … 567 569 568 570 !-- Lateral boundary conditions 569 IF ( c p_cfg .NE. 'gyre' ) THEN571 IF ( cn_cfg .NE. 'gyre' ) THEN 570 572 CALL lbc_lnk( ztmltot(:,:,jn) , 'T', 1. ) ; CALL lbc_lnk( ztmlres(:,:,jn) , 'T', 1. ) 571 573 CALL lbc_lnk( ztmlatf(:,:,jn) , 'T', 1. ) ; CALL lbc_lnk( ztmlrad(:,:,jn) , 'T', 1. ) … … 618 620 619 621 !-- Lateral boundary conditions 620 IF ( c p_cfg .NE. 'gyre' ) THEN ! other than GYRE configuration622 IF ( cn_cfg .NE. 'gyre' ) THEN ! other than GYRE configuration 621 623 CALL lbc_lnk( ztmltot2(:,:,jn), 'T', 1. ) 622 624 CALL lbc_lnk( ztmlres2(:,:,jn), 'T', 1. ) … … 990 992 991 993 !-- Lateral boundary conditions 992 IF ( c p_cfg .NE. 'gyre' ) THEN ! other than GYRE configuration994 IF ( cn_cfg .NE. 'gyre' ) THEN ! other than GYRE configuration 993 995 ! ES_B27_CD_WARN : lbc inutile GYRE, cf. + haut 994 996 DO jn = 1, jpdiabio 995 997 CALL lbc_lnk( ztmltrdbio2(:,:,jn), 'T', 1. ) 996 END DO998 END DO 997 999 ENDIF 998 1000 -
branches/2016/dev_CNRS_2016/NEMOGCM/SETTE/all_functions.sh
r4316 r7277 197 197 cd ${CONFIG_DIR} 198 198 cd ../ 199 REVISION_NB=`svn info | grep -i " Revision:" | sed -e "s/ //" | cut -d ":" -f 2`199 REVISION_NB=`svn info | grep -i "Last Changed Rev:" | sed -e "s/ //g" | cut -d ":" -f 2` 200 200 if [ ${#REVISION_NB} -eq 0 ] 201 201 then -
branches/2016/dev_CNRS_2016/NEMOGCM/SETTE/input_AMM12.cfg
r4261 r7277 1 AMM12_v3. 6.tar AMM12_v3.61 AMM12_v3.7.tar AMM12_v3.7 -
branches/2016/dev_CNRS_2016/NEMOGCM/SETTE/input_ISOMIP.cfg
r4990 r7277 1 1 ISOMIP_v3.7.tar ISOMIP_v3.7 -
branches/2016/dev_CNRS_2016/NEMOGCM/SETTE/input_ORCA2_LIM3.cfg
r5398 r7277 1 ORCA2_LIM_nemo_v3. 6.tar ORCA2_LIM_nemo_v3.61 ORCA2_LIM_nemo_v3.7.tar ORCA2_LIM_nemo_v3.7 -
branches/2016/dev_CNRS_2016/NEMOGCM/SETTE/input_ORCA2_LIM_AGRIF.cfg
r4324 r7277 1 ORCA2_LIM_nemo_v3. 6.tar ORCA2_LIM_nemo_v3.61 ORCA2_LIM_nemo_v3.7.tar ORCA2_LIM_nemo_v3.7 -
branches/2016/dev_CNRS_2016/NEMOGCM/SETTE/input_ORCA2_LIM_OBS.cfg
r4990 r7277 1 ORCA2_LIM_nemo_v3. 6.tar ORCA2_LIM_nemo_v3.61 ORCA2_LIM_nemo_v3.7.tar ORCA2_LIM_nemo_v3.7 -
branches/2016/dev_CNRS_2016/NEMOGCM/SETTE/input_ORCA2_LIM_PISCES.cfg
r5398 r7277 1 ORCA2_LIM_nemo_v3. 6.tar ORCA2_LIM_PISCES_v3.61 ORCA2_LIM_nemo_v3.7.tar ORCA2_LIM_PISCES_v3.7 -
branches/2016/dev_CNRS_2016/NEMOGCM/SETTE/input_ORCA2_OFF_PISCES.cfg
r4318 r7277 1 INPUTS_DYNA_v3.6.tar ORCA2_OFF_PISCES 1 ORCA2_OFF_v3.7.tar ORCA2_OFF_PISCES_3.7 -
branches/2016/dev_CNRS_2016/NEMOGCM/SETTE/input_SAS.cfg
r4324 r7277 1 ORCA2_LIM_nemo_v3. 6.tar ORCA2_LIM_nemo_v3.61 ORCA2_LIM_nemo_v3.7.tar ORCA2_LIM_nemo_v3.7 2 2 INPUTS_SAS_v3.5.tar SAS -
branches/2016/dev_CNRS_2016/NEMOGCM/SETTE/prepare_exe_dir.sh
r5656 r7277 70 70 export EXE_DIR=${CONFIG_DIR}/${NEW_CONF}/${TEST_NAME} 71 71 72 cp - rL ${CONFIG_DIR}/${NEW_CONF}/EXP00/* ${EXE_DIR}/.73 cp - r${SETTE_DIR}/iodef_sette.xml ${EXE_DIR}/iodef.xml72 cp -RL ${CONFIG_DIR}/${NEW_CONF}/EXP00/* ${EXE_DIR}/. 73 cp -R ${SETTE_DIR}/iodef_sette.xml ${EXE_DIR}/iodef.xml 74 74 cd ${EXE_DIR} -
branches/2016/dev_CNRS_2016/NEMOGCM/SETTE/sette.sh
r6140 r7277 133 133 cp BATCH_TEMPLATE/${JOB_PREFIX}-${COMPILER} job_batch_template || exit 134 134 # Description of configuration tested: 135 # GYRE :1 & 2136 # ORCA2_LIM_PISCES :3 & 4137 # ORCA2_OFF_PISCES :5 & 6138 # ORCA2_LIM3 :7 & 8139 # AMM12 :9 & 10140 # SAS :11 & 12141 # ISOMIP :13 & 14142 # ORCA2_LIM_OBS :15143 # ORCA2_AGRIF_LIM :16 & 17144 # 18 & 19145 146 for config in 1 2 3 4 5 6 7 8 9 10 11 12 15 16135 # GYRE : 1 & 2 136 # ORCA2_LIM_PISCES : 3 & 4 137 # ORCA2_OFF_PISCES : 5 & 6 138 # ORCA2_LIM3 : 7 & 8 139 # AMM12 : 9 & 10 140 # SAS : 11 fos SAS there is no solver so is useless to test REPRO 141 # ISOMIP : 13 & 14 142 # ORCA2_LIM_OBS : 15 143 # ORCA2_AGRIF_LIM : 16 & 17 144 # 18 & 19 145 146 for config in 1 2 3 4 5 6 7 8 9 10 11 13 14 15 16 147 147 148 148 do … … 167 167 set_namelist namelist_cfg nn_stock 60 168 168 set_namelist namelist_cfg ln_clobber .true. 169 set_namelist namelist_cfg nn_fwb 0 170 # set_namelist namelist_cfg nn_solv 2 169 set_namelist namelist_cfg ln_linssh .true. 170 set_namelist namelist_cfg ln_read_cfg .false. 171 set_namelist namelist_cfg nn_fwb 0 171 172 set_namelist namelist_cfg jpni 2 172 173 set_namelist namelist_cfg jpnj 2 … … 191 192 set_namelist namelist_cfg nn_rstctl 2 192 193 set_namelist namelist_cfg ln_clobber .true. 193 set_namelist namelist_cfg nn_fwb 0 194 # set_namelist namelist_cfg nn_solv 2 194 set_namelist namelist_cfg ln_linssh .true. 195 set_namelist namelist_cfg ln_read_cfg .false. 196 set_namelist namelist_cfg nn_fwb 0 195 197 set_namelist namelist_cfg jpni 2 196 198 set_namelist namelist_cfg jpnj 2 … … 235 237 set_namelist namelist_cfg nn_itend 60 236 238 set_namelist namelist_cfg nn_fwb 0 237 set_namelist namelist_cfg nn_bench 0238 set_namelist namelist_cfg ln_c tl .false.239 set_namelist namelist_cfg ln_ clobber.true.240 # set_namelist namelist_cfg nn_solv 2 239 set_namelist namelist_cfg ln_ctl .false. 240 set_namelist namelist_cfg ln_clobber .true. 241 set_namelist namelist_cfg ln_linssh .true. 242 set_namelist namelist_cfg ln_read_cfg .false. 241 243 set_namelist namelist_cfg jpni 1 242 244 set_namelist namelist_cfg jpnj 4 … … 265 267 set_namelist namelist_cfg ln_ctl .false. 266 268 set_namelist namelist_cfg ln_clobber .true. 267 # set_namelist namelist_cfg nn_solv 2 269 set_namelist namelist_cfg ln_linssh .true. 270 set_namelist namelist_cfg ln_read_cfg .false. 268 271 set_namelist namelist_cfg jpni 2 269 272 set_namelist namelist_cfg jpnj 2 … … 300 303 set_namelist namelist_cfg nn_stock 75 301 304 set_namelist namelist_cfg ln_clobber .true. 305 set_namelist namelist_cfg ln_read_cfg .true. 306 set_namelist namelist_cfg ln_linssh .false. 302 307 set_namelist namelist_cfg nn_fwb 0 303 308 set_namelist namelist_cfg jpni 2 304 309 set_namelist namelist_cfg jpnj 4 305 310 set_namelist namelist_cfg jpnij 8 306 # set_namelist namelist_cfg nn_solv 2307 311 set_namelist namelist_top_cfg ln_trcdta .false. 308 312 set_namelist namelist_top_cfg ln_diatrc .false. … … 336 340 set_namelist namelist_cfg nn_rstctl 2 337 341 set_namelist namelist_cfg ln_clobber .true. 342 set_namelist namelist_cfg ln_read_cfg .true. 343 set_namelist namelist_cfg ln_linssh .false. 338 344 set_namelist namelist_cfg nn_fwb 0 339 345 set_namelist namelist_cfg jpni 2 340 346 set_namelist namelist_cfg jpnj 4 341 347 set_namelist namelist_cfg jpnij 8 342 # set_namelist namelist_cfg nn_solv 2343 348 set_namelist namelist_top_cfg ln_diatrc .false. 344 349 set_namelist namelist_top_cfg ln_rsttr .true. … … 395 400 set_namelist namelist_cfg ln_ctl .false. 396 401 set_namelist namelist_cfg ln_clobber .true. 402 set_namelist namelist_cfg ln_read_cfg .true. 403 set_namelist namelist_cfg ln_linssh .false. 397 404 set_namelist namelist_cfg jpni 4 398 405 set_namelist namelist_cfg jpnj 4 399 406 set_namelist namelist_cfg jpnij 16 400 # set_namelist namelist_cfg nn_solv 2401 407 set_namelist namelist_top_cfg ln_trcdta .false. 402 408 set_namelist namelist_top_cfg ln_diatrc .false. … … 482 488 set_namelist namelist_cfg nn_stock 20 483 489 set_namelist namelist_cfg ln_clobber .true. 490 set_namelist namelist_cfg ln_read_cfg .true. 491 set_namelist namelist_cfg ln_linssh .true. 484 492 set_namelist namelist_cfg jpni 2 485 493 set_namelist namelist_cfg jpnj 4 … … 516 524 set_namelist namelist_cfg nn_stock 20 517 525 set_namelist namelist_cfg ln_clobber .true. 526 set_namelist namelist_cfg ln_read_cfg .true. 527 set_namelist namelist_cfg ln_linssh .true. 518 528 set_namelist namelist_cfg jpni 2 519 529 set_namelist namelist_cfg jpnj 4 … … 568 578 set_namelist namelist_cfg ln_ctl .false. 569 579 set_namelist namelist_cfg ln_clobber .true. 580 set_namelist namelist_cfg ln_read_cfg .true. 581 set_namelist namelist_cfg ln_linssh .true. 570 582 set_namelist namelist_cfg jpni 4 571 583 set_namelist namelist_cfg jpnj 4 … … 606 618 set_namelist namelist_cfg ln_ctl .false. 607 619 set_namelist namelist_cfg ln_clobber .true. 620 set_namelist namelist_cfg ln_read_cfg .true. 621 set_namelist namelist_cfg ln_linssh .true. 608 622 set_namelist namelist_cfg jpni 2 609 623 set_namelist namelist_cfg jpnj 8 … … 654 668 set_namelist namelist_cfg nn_stock 75 655 669 set_namelist namelist_cfg ln_clobber .true. 656 set_namelist namelist_cfg nn_fwb 0 670 set_namelist namelist_cfg ln_read_cfg .true. 671 set_namelist namelist_cfg ln_linssh .false. 672 set_namelist namelist_cfg ln_hpg_sco .true. 673 set_namelist namelist_cfg nn_msh 1 674 set_namelist namelist_cfg nn_fwb 0 675 set_namelist namelist_cfg ln_hpg_sco .true. 657 676 set_namelist namelist_cfg jpni 2 658 677 set_namelist namelist_cfg jpnj 2 659 678 set_namelist namelist_cfg jpnij 4 660 # set_namelist namelist_cfg nn_solv 2661 679 if [ ${USING_MPMD} == "yes" ] ; then 662 680 set_xio_using_server iodef.xml true … … 678 696 set_namelist namelist_cfg nn_rstctl 2 679 697 set_namelist namelist_cfg ln_clobber .true. 680 set_namelist namelist_cfg nn_fwb 0 698 set_namelist namelist_cfg ln_read_cfg .true. 699 set_namelist namelist_cfg ln_linssh .false. 700 set_namelist namelist_cfg ln_hpg_sco .true. 701 set_namelist namelist_cfg nn_msh 1 702 set_namelist namelist_cfg nn_fwb 0 703 set_namelist namelist_cfg ln_hpg_sco .true. 681 704 set_namelist namelist_cfg jpni 2 682 705 set_namelist namelist_cfg jpnj 2 683 706 set_namelist namelist_cfg jpnij 4 684 # set_namelist namelist_cfg nn_solv 2685 707 set_namelist namelist_cfg cn_ocerst_in \"O2L3_LONG_00000075_restart\" 686 708 set_namelist namelist_ice_cfg cn_icerst_in \"O2L3_LONG_00000075_restart_ice\" … … 690 712 ln -sf ../LONG/O2L3_LONG_00000075_restart_${L_NPROC}.nc . 691 713 ln -sf ../LONG/O2L3_LONG_00000075_restart_ice_${L_NPROC}.nc . 714 ln -sf ../LONG/O2L3_LONG_icebergs_00000075_restart_${L_NPROC}.nc O2L3_LONG_00000075_restart_icebergs_${L_NPROC}.nc 692 715 done 693 716 if [ ${USING_MPMD} == "yes" ] ; then … … 704 727 if [ ${config} -eq 8 ] ; then 705 728 ## Reproducibility tests for ORCA2_LIM3 706 export TEST_NAME="REPRO_ 4_4"707 cd ${CONFIG_DIR} 708 . ./makenemo -m ${CMP_NAM} -n ORCA2LIM3_ 16-r ORCA2_LIM3 -j 8 add_key "key_mpp_rep" del_key ${DEL_KEYS}709 cd ${SETTE_DIR} 710 . ./param.cfg 711 . ./all_functions.sh 712 . ./prepare_exe_dir.sh 713 JOB_FILE=${EXE_DIR}/run_job.sh 714 NPROC= 16729 export TEST_NAME="REPRO_8_4" 730 cd ${CONFIG_DIR} 731 . ./makenemo -m ${CMP_NAM} -n ORCA2LIM3_32 -r ORCA2_LIM3 -j 8 add_key "key_mpp_rep" del_key ${DEL_KEYS} 732 cd ${SETTE_DIR} 733 . ./param.cfg 734 . ./all_functions.sh 735 . ./prepare_exe_dir.sh 736 JOB_FILE=${EXE_DIR}/run_job.sh 737 NPROC=32 715 738 if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi 716 739 cd ${EXE_DIR} … … 720 743 set_namelist namelist_cfg ln_ctl .false. 721 744 set_namelist namelist_cfg ln_clobber .true. 745 set_namelist namelist_cfg ln_read_cfg .true. 746 set_namelist namelist_cfg ln_linssh .false. 747 set_namelist namelist_cfg ln_hpg_sco .true. 748 set_namelist namelist_cfg jpni 8 749 set_namelist namelist_cfg jpnj 4 750 set_namelist namelist_cfg jpnij 32 751 if [ ${USING_MPMD} == "yes" ] ; then 752 set_xio_using_server iodef.xml true 753 else 754 set_xio_using_server iodef.xml false 755 fi 756 cd ${SETTE_DIR} 757 . ./prepare_job.sh input_ORCA2_LIM3.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} 758 cd ${SETTE_DIR} 759 . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG} 760 761 cd ${SETTE_DIR} 762 export TEST_NAME="REPRO_4_8" 763 . ./prepare_exe_dir.sh 764 JOB_FILE=${EXE_DIR}/run_job.sh 765 NPROC=32 766 if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi 767 cd ${EXE_DIR} 768 set_namelist namelist_cfg nn_it000 1 769 set_namelist namelist_cfg nn_itend 75 770 set_namelist namelist_cfg ln_clobber .true. 771 set_namelist namelist_cfg ln_read_cfg .true. 772 set_namelist namelist_cfg ln_linssh .false. 773 set_namelist namelist_cfg ln_hpg_sco .true. 774 set_namelist namelist_cfg nn_fwb 0 722 775 set_namelist namelist_cfg jpni 4 723 set_namelist namelist_cfg jpnj 4724 set_namelist namelist_cfg jpnij 16725 # set_namelist namelist_cfg nn_solv 2726 if [ ${USING_MPMD} == "yes" ] ; then727 set_xio_using_server iodef.xml true728 else729 set_xio_using_server iodef.xml false730 fi731 cd ${SETTE_DIR}732 . ./prepare_job.sh input_ORCA2_LIM3.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS}733 cd ${SETTE_DIR}734 . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}735 736 cd ${SETTE_DIR}737 export TEST_NAME="REPRO_2_8"738 . ./prepare_exe_dir.sh739 JOB_FILE=${EXE_DIR}/run_job.sh740 NPROC=16741 if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi742 cd ${EXE_DIR}743 set_namelist namelist_cfg nn_it000 1744 set_namelist namelist_cfg nn_itend 75745 set_namelist namelist_cfg ln_clobber .true.746 set_namelist namelist_cfg nn_fwb 0747 set_namelist namelist_cfg jpni 2748 776 set_namelist namelist_cfg jpnj 8 749 set_namelist namelist_cfg jpnij 16 750 # set_namelist namelist_cfg nn_solv 2 777 set_namelist namelist_cfg jpnij 32 751 778 if [ ${USING_MPMD} == "yes" ] ; then 752 779 set_xio_using_server iodef.xml true … … 782 809 set_namelist namelist_cfg ln_ctl .false. 783 810 set_namelist namelist_cfg ln_clobber .true. 811 set_namelist namelist_cfg ln_read_cfg .true. 812 set_namelist namelist_cfg ln_linssh .false. 784 813 set_namelist namelist_cfg jpni 8 785 814 set_namelist namelist_cfg jpnj 4 … … 802 831 set_namelist namelist_cfg ln_ctl .false. 803 832 set_namelist namelist_cfg ln_clobber .true. 833 set_namelist namelist_cfg ln_read_cfg .true. 834 set_namelist namelist_cfg ln_linssh .false. 804 835 set_namelist namelist_cfg jpni 8 805 836 set_namelist namelist_cfg jpnj 4 … … 843 874 set_namelist namelist_cfg ln_ctl .false. 844 875 set_namelist namelist_cfg ln_clobber .true. 876 set_namelist namelist_cfg ln_read_cfg .true. 877 set_namelist namelist_cfg ln_linssh .false. 845 878 set_namelist namelist_cfg jpni 8 846 879 set_namelist namelist_cfg jpnj 4 … … 867 900 set_namelist namelist_cfg ln_ctl .false. 868 901 set_namelist namelist_cfg ln_clobber .true. 902 set_namelist namelist_cfg ln_read_cfg .true. 903 set_namelist namelist_cfg ln_linssh .false. 869 904 set_namelist namelist_cfg jpni 4 870 905 set_namelist namelist_cfg jpnj 8 … … 894 929 JOB_FILE=${EXE_DIR}/run_job.sh 895 930 NPROC=32 896 \rm $JOB_FILE931 if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi 897 932 cd ${EXE_DIR} 898 933 set_namelist namelist_cfg cn_exp \"SAS\" … … 902 937 set_namelist namelist_cfg ln_ctl .false. 903 938 set_namelist namelist_cfg ln_clobber .true. 939 set_namelist namelist_cfg ln_read_cfg .true. 940 set_namelist namelist_cfg ln_linssh .true. 904 941 set_namelist namelist_cfg nn_fwb 0 905 942 set_namelist namelist_cfg jpni 8 … … 923 960 set_namelist namelist_cfg ln_ctl .false. 924 961 set_namelist namelist_cfg ln_clobber .true. 962 set_namelist namelist_cfg ln_read_cfg .true. 963 set_namelist namelist_cfg ln_linssh .true. 925 964 set_namelist namelist_cfg nn_fwb 0 926 965 set_namelist namelist_cfg jpni 8 … … 928 967 set_namelist namelist_cfg jpnij 32 929 968 set_namelist namelist_cfg nn_rstctl 2 930 set_namelist namelist_cfg cn_ocerst_in \"SAS_00000050_restart\" 969 set_namelist namelist_cfg cn_ocerst_in \"SAS_00000050_restart_ice\" 970 if [ ${USING_MPMD} == "yes" ] ; then 971 set_xio_using_server iodef.xml true 972 else 973 set_xio_using_server iodef.xml false 974 fi 931 975 for (( i=1; i<=$NPROC; i++)) ; do 932 976 L_NPROC=$(( $i - 1 )) 933 977 L_NPROC=`printf "%04d\n" ${L_NPROC}` 934 ln -sf ../LONG/SAS_00000050_restart_ ${L_NPROC}.nc .978 ln -sf ../LONG/SAS_00000050_restart_ice_${L_NPROC}.nc . 935 979 done 936 if [ ${USING_MPMD} == "yes" ] ; then937 set_xio_using_server iodef.xml true938 else939 set_xio_using_server iodef.xml false940 fi941 980 cd ${SETTE_DIR} 942 981 . ./prepare_job.sh input_SAS.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} … … 945 984 fi 946 985 947 if [ ${config} -eq 12 ] ; then948 ## Reproducibility tests for ORCA2_SAS_LIM949 export TEST_NAME="REPRO_8_4"950 cd ${CONFIG_DIR}951 . ./makenemo -m ${CMP_NAM} -n SAS_32 -r ORCA2_SAS_LIM -j 8 add_key "key_mpp_rep" del_key ${DEL_KEYS}952 cd ${SETTE_DIR}953 . ./param.cfg954 . ./all_functions.sh955 . ./prepare_exe_dir.sh956 JOB_FILE=${EXE_DIR}/run_job.sh957 NPROC=32958 \rm ${JOB_FILE}959 cd ${EXE_DIR}960 set_namelist namelist_cfg cn_exp \"SAS\"961 set_namelist namelist_cfg nn_it000 51962 set_namelist namelist_cfg nn_itend 100963 set_namelist namelist_cfg ln_ctl .false.964 set_namelist namelist_cfg ln_clobber .true.965 set_namelist namelist_cfg nn_fwb 0966 set_namelist namelist_cfg jpni 8967 set_namelist namelist_cfg jpnj 4968 set_namelist namelist_cfg jpnij 32969 if [ ${USING_MPMD} == "yes" ] ; then970 set_xio_using_server iodef.xml true971 else972 set_xio_using_server iodef.xml false973 fi974 cd ${SETTE_DIR}975 . ./prepare_job.sh input_SAS.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS}976 cd ${SETTE_DIR}977 . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}978 cd ${SETTE_DIR}979 export TEST_NAME="REPRO_4_8"980 . ./prepare_exe_dir.sh981 cd ${EXE_DIR}982 set_namelist namelist_cfg cn_exp \"SAS\"983 set_namelist namelist_cfg nn_it000 51984 set_namelist namelist_cfg nn_itend 100985 set_namelist namelist_cfg ln_ctl .false.986 set_namelist namelist_cfg ln_clobber .true.987 set_namelist namelist_cfg nn_fwb 0988 set_namelist namelist_cfg jpni 4989 set_namelist namelist_cfg jpnj 8990 set_namelist namelist_cfg jpnij 32991 if [ ${USING_MPMD} == "yes" ] ; then992 set_xio_using_server iodef.xml true993 else994 set_xio_using_server iodef.xml false995 fi996 cd ${SETTE_DIR}997 . ./prepare_job.sh input_SAS.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS}998 cd ${SETTE_DIR}999 . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}1000 fi1001 986 # TESTS FOR ISOMIP CONFIGURATION 1002 987 if [ ${config} -eq 13 ] ; then … … 1004 989 export TEST_NAME="LONG" 1005 990 cd ${CONFIG_DIR} 1006 . ./makenemo -m ${CMP_NAM} -n ISOMIP_LONG - uISOMIP -j 8 del_key ${DEL_KEYS}991 . ./makenemo -m ${CMP_NAM} -n ISOMIP_LONG -r ISOMIP -j 8 del_key ${DEL_KEYS} 1007 992 cd ${SETTE_DIR} 1008 993 . ./param.cfg … … 1018 1003 set_namelist namelist_cfg nn_stock 48 1019 1004 set_namelist namelist_cfg ln_clobber .true. 1020 set_namelist namelist_cfg nn_fwb 0 1021 # set_namelist namelist_cfg nn_solv 2 1005 set_namelist namelist_cfg ln_read_cfg .true. 1006 set_namelist namelist_cfg ln_linssh .true. 1007 set_namelist namelist_cfg nn_fwb 0 1022 1008 set_namelist namelist_cfg jpni 2 1023 1009 set_namelist namelist_cfg jpnj 2 … … 1042 1028 set_namelist namelist_cfg nn_rstctl 2 1043 1029 set_namelist namelist_cfg ln_clobber .true. 1044 set_namelist namelist_cfg nn_fwb 0 1045 # set_namelist namelist_cfg nn_solv 2 1030 set_namelist namelist_cfg ln_read_cfg .true. 1031 set_namelist namelist_cfg ln_linssh .true. 1032 set_namelist namelist_cfg nn_fwb 0 1046 1033 set_namelist namelist_cfg jpni 2 1047 1034 set_namelist namelist_cfg jpnj 2 … … 1072 1059 export TEST_NAME="REPRO_1_4" 1073 1060 cd ${CONFIG_DIR} 1074 . ./makenemo -m ${CMP_NAM} -n ISOMIP_4 - uISOMIP -j 8 add_key "key_mpp_rep" del_key ${DEL_KEYS}1061 . ./makenemo -m ${CMP_NAM} -n ISOMIP_4 -r ISOMIP -j 8 add_key "key_mpp_rep" del_key ${DEL_KEYS} 1075 1062 cd ${SETTE_DIR} 1076 1063 . ./param.cfg … … 1084 1071 set_namelist namelist_cfg nn_it000 1 1085 1072 set_namelist namelist_cfg nn_itend 48 1086 set_namelist namelist_cfg nn_fwb 01087 set_namelist namelist_cfg nn_bench 01088 set_namelist namelist_cfg ln_ ctl .false.1089 set_namelist namelist_cfg ln_ clobber.true.1090 # set_namelist namelist_cfg nn_solv 2 1073 set_namelist namelist_cfg ln_ctl .false. 1074 set_namelist namelist_cfg ln_clobber .true. 1075 set_namelist namelist_cfg ln_read_cfg .true. 1076 set_namelist namelist_cfg ln_linssh .true. 1077 set_namelist namelist_cfg nn_fwb 0 1091 1078 set_namelist namelist_cfg jpni 1 1092 1079 set_namelist namelist_cfg jpnj 4 … … 1112 1099 set_namelist namelist_cfg nn_it000 1 1113 1100 set_namelist namelist_cfg nn_itend 48 1114 set_namelist namelist_cfg nn_fwb 0 1115 set_namelist namelist_cfg ln_ctl .false. 1116 set_namelist namelist_cfg ln_clobber .true. 1117 # set_namelist namelist_cfg nn_solv 2 1101 set_namelist namelist_cfg ln_ctl .false. 1102 set_namelist namelist_cfg ln_clobber .true. 1103 set_namelist namelist_cfg ln_read_cfg .true. 1104 set_namelist namelist_cfg ln_linssh .true. 1105 set_namelist namelist_cfg nn_fwb 0 1118 1106 set_namelist namelist_cfg jpni 2 1119 1107 set_namelist namelist_cfg jpnj 2 … … 1137 1125 export TEST_NAME="REPRO_4_4" 1138 1126 cd ${CONFIG_DIR} 1139 . ./makenemo -m ${CMP_NAM} -n ORCA2_LIM _OBS -r ORCA2_LIM-j 8 add_key "key_mpp_rep key_asminc" del_key ${DEL_KEYS}1127 . ./makenemo -m ${CMP_NAM} -n ORCA2_LIM3_OBS -r ORCA2_LIM3 -j 8 add_key "key_mpp_rep key_asminc" del_key ${DEL_KEYS} 1140 1128 cd ${SETTE_DIR} 1141 1129 . ./param.cfg … … 1151 1139 set_namelist namelist_cfg ln_ctl .false. 1152 1140 set_namelist namelist_cfg ln_clobber .true. 1141 set_namelist namelist_cfg ln_read_cfg .true. 1142 set_namelist namelist_cfg ln_linssh .false. 1153 1143 set_namelist namelist_cfg jpni 4 1154 1144 set_namelist namelist_cfg jpnj 4 … … 1188 1178 set_namelist namelist_cfg ln_ctl .false. 1189 1179 set_namelist namelist_cfg ln_clobber .true. 1180 set_namelist namelist_cfg ln_read_cfg .true. 1181 set_namelist namelist_cfg ln_linssh .false. 1190 1182 set_namelist namelist_cfg jpni 2 1191 1183 set_namelist namelist_cfg jpnj 8 … … 1231 1223 set_namelist namelist_cfg ln_ctl .false. 1232 1224 set_namelist namelist_cfg ln_clobber .true. 1225 set_namelist namelist_cfg ln_read_cfg .true. 1226 set_namelist namelist_cfg ln_linssh .true. 1233 1227 set_namelist namelist_cfg nn_fwb 0 1234 1228 set_namelist namelist_cfg jpni 1 1235 1229 set_namelist namelist_cfg jpnj 2 1236 1230 set_namelist namelist_cfg jpnij 2 1237 #1238 1231 set_namelist 1_namelist_cfg nn_it000 1 1239 1232 set_namelist 1_namelist_cfg nn_itend 150 1240 1233 set_namelist 1_namelist_cfg ln_ctl .false. 1241 1234 set_namelist 1_namelist_cfg ln_clobber .true. 1242 1235 set_namelist 1_namelist_cfg ln_read_cfg .true. 1236 set_namelist 1_namelist_cfg ln_linssh .false. 1243 1237 if [ ${USING_MPMD} == "yes" ] ; then 1244 1238 set_xio_using_server iodef.xml true … … 1271 1265 set_namelist namelist_cfg ln_ctl .false. 1272 1266 set_namelist namelist_cfg ln_clobber .true. 1267 set_namelist namelist_cfg ln_read_cfg .true. 1268 set_namelist namelist_cfg ln_linssh .true. 1273 1269 set_namelist namelist_cfg nn_fwb 0 1274 1270 set_namelist namelist_cfg jpni 2 … … 1304 1300 set_namelist namelist_cfg ln_ctl .false. 1305 1301 set_namelist namelist_cfg ln_clobber .true. 1302 set_namelist namelist_cfg ln_read_cfg .true. 1303 set_namelist namelist_cfg ln_linssh .true. 1306 1304 set_namelist namelist_cfg nn_fwb 0 1307 1305 set_namelist namelist_cfg jpni 2 … … 1339 1337 set_namelist namelist_cfg nn_stock 75 1340 1338 set_namelist namelist_cfg ln_clobber .true. 1339 set_namelist namelist_cfg ln_read_cfg .true. 1340 set_namelist namelist_cfg ln_linssh .true. 1341 1341 set_namelist namelist_cfg nn_fwb 0 1342 1342 set_namelist namelist_cfg jpni 2 … … 1351 1351 set_namelist 1_namelist_cfg ln_ctl .false. 1352 1352 set_namelist 1_namelist_cfg ln_clobber .true. 1353 set_namelist 1_namelist_cfg ln_read_cfg .true. 1354 set_namelist 1_namelist_cfg ln_linssh .false. 1353 1355 # 1354 1356 if [ ${USING_MPMD} == "yes" ] ; then … … 1371 1373 set_namelist namelist_cfg nn_rstctl 2 1372 1374 set_namelist namelist_cfg ln_clobber .true. 1375 set_namelist namelist_cfg ln_read_cfg .true. 1376 set_namelist namelist_cfg ln_linssh .true. 1373 1377 set_namelist namelist_cfg nn_fwb 0 1374 1378 set_namelist namelist_cfg jpni 2 … … 1384 1388 set_namelist 1_namelist_cfg nn_rstctl 2 1385 1389 set_namelist 1_namelist_cfg ln_clobber .true. 1390 set_namelist 1_namelist_cfg ln_read_cfg .true. 1391 set_namelist 1_namelist_cfg ln_linssh .false. 1386 1392 set_namelist namelist_cfg cn_ocerst_in \"O2LP_LONG_00000075_restart\" 1387 1393 set_namelist namelist_ice_cfg cn_icerst_in \"O2LP_LONG_00000075_restart_ice\" … … 1424 1430 set_namelist namelist_cfg ln_ctl .false. 1425 1431 set_namelist namelist_cfg ln_clobber .true. 1432 set_namelist namelist_cfg ln_read_cfg .true. 1433 set_namelist namelist_cfg ln_linssh .false. 1426 1434 set_namelist namelist_cfg nn_fwb 0 1427 1435 set_namelist namelist_cfg jpni 4 1428 1436 set_namelist namelist_cfg jpnj 4 1429 1437 set_namelist namelist_cfg jpnij 16 1430 # set_namelist namelist_cfg nn_solv 21431 #1432 1438 set_namelist 1_namelist_cfg nn_it000 1 1433 1439 set_namelist 1_namelist_cfg nn_itend 150 1434 1440 set_namelist 1_namelist_cfg ln_ctl .false. 1435 1441 set_namelist 1_namelist_cfg ln_clobber .true. 1442 set_namelist 1_namelist_cfg ln_read_cfg .true. 1443 set_namelist 1_namelist_cfg ln_linssh .true. 1436 1444 1437 1445 if [ ${USING_MPMD} == "yes" ] ; then … … 1456 1464 set_namelist namelist_cfg ln_ctl .false. 1457 1465 set_namelist namelist_cfg ln_clobber .true. 1466 set_namelist namelist_cfg ln_read_cfg .true. 1467 set_namelist namelist_cfg ln_linssh .false. 1458 1468 set_namelist namelist_cfg nn_fwb 0 1459 1469 set_namelist namelist_cfg jpni 2 1460 1470 set_namelist namelist_cfg jpnj 8 1461 1471 set_namelist namelist_cfg jpnij 16 1462 # set_namelist namelist_cfg nn_solv 21463 #1464 1472 set_namelist 1_namelist_cfg nn_it000 1 1465 1473 set_namelist 1_namelist_cfg nn_itend 150 1466 1474 set_namelist 1_namelist_cfg ln_ctl .false. 1467 1475 set_namelist 1_namelist_cfg ln_clobber .true. 1476 set_namelist 1_namelist_cfg ln_read_cfg .true. 1477 set_namelist 1_namelist_cfg ln_linssh .true. 1468 1478 1469 1479 if [ ${USING_MPMD} == "yes" ] ; then -
branches/2016/dev_CNRS_2016/NEMOGCM/SETTE/sette_rpt
r6140 r7277 415 415 set dorv = `ls -1rtd ./WORCA2LIM3_16/{$mach}/* | tail -1l ` 416 416 set dorv = $dorv:t 417 set f1o = ./WORCA2LIM3_16/{$mach}/{$dorv}/REPRO_ 2_8/ocean.output418 set f1s = ./WORCA2LIM3_16/{$mach}/{$dorv}/REPRO_ 2_8/solver.stat419 set f2o = ./WORCA2LIM3_16/{$mach}/{$dorv}/REPRO_ 4_4/ocean.output420 set f2s = ./WORCA2LIM3_16/{$mach}/{$dorv}/REPRO_ 4_4/solver.stat417 set f1o = ./WORCA2LIM3_16/{$mach}/{$dorv}/REPRO_4_8/ocean.output 418 set f1s = ./WORCA2LIM3_16/{$mach}/{$dorv}/REPRO_4_8/solver.stat 419 set f2o = ./WORCA2LIM3_16/{$mach}/{$dorv}/REPRO_8_4/ocean.output 420 set f2s = ./WORCA2LIM3_16/{$mach}/{$dorv}/REPRO_8_4/solver.stat 421 421 422 422 cmp -s $f1s $f2s -
branches/2016/dev_CNRS_2016/NEMOGCM/TOOLS/COMPILE/Fadd_keys.sh
r4990 r7277 44 44 # :: 45 45 # 46 # $ ./Fadd_keys.sh ORCA2_LIM add_key "key_mpp_ mpi key_nproci=1 key_nprocj=10"46 # $ ./Fadd_keys.sh ORCA2_LIM add_key "key_mpp_rep" 47 47 # 48 48 # … … 65 65 echo "Adding keys in : ${NEW_CONF}" 66 66 for i in ${list_add_key} ; do 67 if [ "$(echo ${i} | grep -c key_nproc )" -ne 0 ] ; then 68 sed -e "s/key_nproc[ij]=.[0-9]* //" ${CONFIG_DIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm > ${CONFIG_DIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm.tmp 69 mv ${CONFIG_DIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm.tmp ${CONFIG_DIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm 70 echo " " 71 sed -e "s/$/ ${i}/" ${CONFIG_DIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm > ${CONFIG_DIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm.tmp 72 mv ${CONFIG_DIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm.tmp ${CONFIG_DIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm 73 elif [ "$(cat ${CONFIG_DIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm | grep -c "$i" )" -ne 0 ] ; then 74 echo "key $i already present in cpp_${NEW_CONF}.fcm" 67 if [ "$(cat ${CONFIG_DIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm | grep -c "$i" )" -ne 0 ] ; then 68 echo "key $i already present in cpp_${NEW_CONF}.fcm" 75 69 else 76 sed -e "s/$/ ${i}/" ${CONFIG_DIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm > ${CONFIG_DIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm.tmp77 mv ${CONFIG_DIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm.tmp ${CONFIG_DIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm78 echo "added key $i in ${NEW_CONF}"70 sed -e "s/$/ ${i}/" ${CONFIG_DIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm > ${CONFIG_DIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm.tmp 71 mv ${CONFIG_DIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm.tmp ${CONFIG_DIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm 72 echo "added key $i in ${NEW_CONF}" 79 73 fi 80 74 done -
branches/2016/dev_CNRS_2016/NEMOGCM/TOOLS/COMPILE/Fcheck_archfile.sh
r4162 r7277 166 166 167 167 #- do we need xios library? 168 if [ "$2" != "nocpp" ] 168 #- 2 cases: 169 #- in CONFIG directory looking for key_iomput 170 if [ "$1" == "arch_nemo.fcm" ] 169 171 then 170 use_iom=$( sed -e "s/#.*$//" ${COMPIL_DIR}/$2 | grep -c key_iomput ) 172 if [ "$2" != "nocpp" ] 173 then 174 use_iom=$( sed -e "s/#.*$//" ${COMPIL_DIR}/$2 | grep -c key_iomput ) 175 else 176 use_iom=0 177 fi 178 have_lxios=$( sed -e "s/#.*$//" ${COMPIL_DIR}/$1 | grep -c "\-lxios" ) 179 if [[ ( $use_iom -eq 0 ) && ( $have_lxios -ge 1 ) ]] 180 then 181 sed -e "s/-lxios//g" ${COMPIL_DIR}/$1 > ${COMPIL_DIR}/tmp$$ 182 mv -f ${COMPIL_DIR}/tmp$$ ${COMPIL_DIR}/$1 183 fi 184 #- in TOOLS directory looking for USE xios 171 185 else 172 use_iom= 0173 fi 174 have_lxios=$( sed -e "s/#.*$//" ${COMPIL_DIR}/$1 | grep -c "\-lxios" ) 175 if [[ ( $use_iom -eq 0 ) && ( $have_lxios -ge 1 ) ]] 176 then 177 sed -e "s/-lxios//g" ${COMPIL_DIR}/$1 > ${COMPIL_DIR}/tmp$$178 mv -f ${COMPIL_DIR}/tmp$$ ${COMPIL_DIR}/$1186 use_iom=$( egrep --exclude-dir=.svn -r USE ${NEW_CONF}/src/* | grep -c xios ) 187 have_lxios=$( sed -e "s/#.*$//" ${COMPIL_DIR}/$1 | grep -c "\-lxios" ) 188 if [[ ( $use_iom -eq 0 ) || ( $have_lxios != 1 ) ]] 189 then 190 sed -e "s/-lxios//g" ${COMPIL_DIR}/$1 > ${COMPIL_DIR}/tmp$$ 191 mv -f ${COMPIL_DIR}/tmp$$ ${COMPIL_DIR}/$1 192 fi 179 193 fi 180 194 -
branches/2016/dev_CNRS_2016/NEMOGCM/TOOLS/COMPILE/bld_tools.cfg
r4865 r7277 29 29 bld::excl_dep inc::netcdf.inc 30 30 bld::excl_dep use::netcdf 31 bld::excl_dep use::xios 31 32 bld::excl_dep h::netcdf.inc 32 33 bld::excl_dep h::mpif.h -
branches/2016/dev_CNRS_2016/NEMOGCM/TOOLS/COMPILE/tools.txt
r2281 r7277 1 REBUILD1 DOMAINcfg
Note: See TracChangeset
for help on using the changeset viewer.