Changeset 1601
- Timestamp:
- 2009-08-11T12:09:19+02:00 (15 years ago)
- Location:
- trunk/NEMO/OPA_SRC
- Files:
-
- 60 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/NEMO/OPA_SRC/BDY/bdytides.F90
r1462 r1601 72 72 INTEGER :: itide ! dummy loop index 73 73 !! 74 NAMELIST/nam tide/ln_tide_date, filtide, tide_cpt, tide_speed74 NAMELIST/nambdy_tide/ln_tide_date, filtide, tide_cpt, tide_speed 75 75 !!---------------------------------------------------------------------- 76 76 … … 79 79 IF(lwp) WRITE(numout,*) '~~~~~~~~~' 80 80 81 ! Namelist nam tide : tidal harmonic forcing at open boundaries81 ! Namelist nambdy_tide : tidal harmonic forcing at open boundaries 82 82 ln_tide_date = .false. 83 83 filtide(:) = '' … … 85 85 tide_cpt(:) = '' 86 86 REWIND( numnam ) ! Read namelist parameters 87 READ ( numnam, nam tide )87 READ ( numnam, nambdy_tide ) 88 88 ! ! Count number of components specified 89 89 ntide = jptides_max … … 118 118 ! ! Parameter control and print 119 119 IF( ntide < 1 ) THEN 120 CALL ctl_stop( ' Did not find any tidal components in namelist nam tide' )120 CALL ctl_stop( ' Did not find any tidal components in namelist nambdy_tide' ) 121 121 ELSE 122 IF(lwp) WRITE(numout,*) ' Namelist nam tide : tidal harmonic forcing at open boundaries'122 IF(lwp) WRITE(numout,*) ' Namelist nambdy_tide : tidal harmonic forcing at open boundaries' 123 123 IF(lwp) WRITE(numout,*) ' tidal components specified ', ntide 124 124 IF(lwp) WRITE(numout,*) ' ', tide_cpt(1:ntide) -
trunk/NEMO/OPA_SRC/DIA/diagap.F90
r1334 r1601 4 4 !! Ocean diagnostics : computation of model-data tracer gap 5 5 !!====================================================================== 6 !! History : OPA ! 1991-10 (G. Madec) Original code 7 !! 7.0 ! 1992-07 (M. Imbard) Add variance and mpp staff 8 !! NEMO 1.0 ! 2002-07 (G. Madec) Free form, F90 9 !!---------------------------------------------------------------------- 6 10 #if defined key_diagap 7 11 !!---------------------------------------------------------------------- … … 10 14 !! dia_gap : model and data level mean temperature and salinity 11 15 !!---------------------------------------------------------------------- 12 !! * Modules used13 16 USE oce ! ocean dynamics and tracers 14 17 USE dom_oce ! ocean space and time domain … … 23 26 PRIVATE 24 27 25 !! * Routine accessibility 26 PUBLIC dia_gap ! called in step.F90 module 27 28 !! * Shared module variables 28 PUBLIC dia_gap ! called in step.F90 module 29 29 30 LOGICAL, PUBLIC, PARAMETER :: lk_diagap = .TRUE. !: model-data diagnostics flag 30 31 31 !! * Module variables 32 INTEGER :: & 33 ngap , & ! time step frequency 34 nprg ! switch for control print 35 ! netcdf files and index common 36 INTEGER :: & 37 nhoridg, ndepidg, & 38 ndex(1) 39 REAL(wp) :: & 40 vol ! total ocean volume 41 REAL(wp), DIMENSION(jpk) :: & 42 volk , volkr, & ! level ocean volume and its inverse 43 tdtag, sdtag, & ! level mean data temperature & salinity 44 tmodg, smodg ! level mean model temperature & salinity 32 ! !!* Namelist namgap : model-data gap 33 INTEGER :: nn_gap = 15 ! time step frequency 34 INTEGER :: nn_prg = 15 ! switch for control print 35 36 INTEGER :: nhoridg, ndepidg, ndex(1) ! netcdf files and index common 37 38 REAL(wp) :: vol ! total ocean volume 39 40 REAL(wp), DIMENSION(jpk) :: volk , volkr ! level ocean volume and its inverse 41 REAL(wp), DIMENSION(jpk) :: tdtag, sdtag ! level mean data temperature & salinity 42 REAL(wp), DIMENSION(jpk) :: tmodg, smodg ! level mean model temperature & salinity 45 43 46 44 !! * Substitutions 47 45 # include "domzgr_substitute.h90" 48 46 !!---------------------------------------------------------------------- 49 !! OPA 9.0 , LOCEAN-IPSL (2005)47 !! NEMO/OPA 3.2 , LOCEAN-IPSL (2009) 50 48 !! $Id$ 51 !! This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt49 !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 52 50 !!---------------------------------------------------------------------- 53 51 … … 59 57 !! 60 58 !! ** Purpose : Compute model and data level mean T and S profiles 61 !! and output it in numgap (NetCDF or direct access file) 62 !! 63 !! ** Method : 64 !! tracers (model) : tn, sn 65 !! tracers (data) : t_dta, s_dta 66 !! difference between model and data tracers 67 !! variance between model and data tracers 59 !! and output it in numgap (NetCDF or direct access file) 60 !! 61 !! ** Method : tracers (model) : tn, sn 62 !! tracers (data) : t_dta, s_dta 63 !! difference between model and data tracers 64 !! variance between model and data tracers 68 65 !! 69 66 !! ** Action : output in file numgap 70 !!71 !! History :72 !! 6.0 ! 91-10 (G. Madec) Original code73 !! 7.0 ! 92-07 (M. Imbard) Add variance and mpp staff74 !! 8.5 ! 02-07 (G. Madec) Free form, F9075 67 !!---------------------------------------------------------------------- 76 !! * Modules used77 68 USE ioipsl 78 79 !! * Arguments 69 !! 80 70 INTEGER, INTENT(in) :: kt ! ocean time-step index 81 82 !! * local declarations 71 !! 83 72 INTEGER :: ji, jj, jk ! dummy loop indices 84 73 INTEGER :: it, itmod ! time step indices … … 89 78 REAL(wp), DIMENSION(jpi) :: zfoo 90 79 REAL(wp), DIMENSION(jpj) :: zloo 91 92 NAMELIST/namgap/ n gap, nprg80 !! 81 NAMELIST/namgap/ nn_gap, nn_prg 93 82 !!---------------------------------------------------------------------- 94 95 83 96 84 ! 0. initialization 97 85 ! ----------------- 98 99 86 zdt = rdt 100 87 IF( nacc == 1 ) zdt = rdtmin 101 88 102 89 IF( kt == nit000 ) THEN 103 104 90 IF(lwp) WRITE(numout,*) 105 91 IF(lwp) WRITE(numout,*) 'dia_gap : level mean model-data gap' 106 92 IF(lwp) WRITE(numout,*) '~~~~~~~' 107 93 108 ! Read diagap parameters in namelist namgap 109 ngap = 15 110 nprg = 15 111 112 REWIND( numnam ) 94 REWIND( numnam ) ! Read diagap parameters in namelist namgap 113 95 READ( numnam, namgap ) 114 96 115 IF(lwp) WRITE(numout,*) ' time step frequency for gap n gap = ',ngap116 IF(lwp) WRITE(numout,*) ' switch for control print gap n prg = ',nprg97 IF(lwp) WRITE(numout,*) ' time step frequency for gap nn_gap = ',nn_gap 98 IF(lwp) WRITE(numout,*) ' switch for control print gap nn_prg = ',nn_prg 117 99 118 100 ! horizontal slab volume (tmask_i to take into account only interior ocean domain) … … 152 134 153 135 ! Define frequency of output and means 154 zsto = n gap * zdt136 zsto = nn_gap * zdt 155 137 IF( ln_mskland ) THEN ; clop = "ave(only(x))" ! put 1.e+20 on land (very expensive!!) 156 138 ELSE ; clop = "ave(x)" ! no use of the mask value (require less cpu time) 157 139 ENDIF 158 zout = n gap * zdt140 zout = nn_gap * zdt 159 141 zmax = FLOAT( nitend - nit000 + 1 ) * zdt 160 142 zfoo(1:jpi) = 0.e0 … … 166 148 zjulian = zjulian - adatrj ! set calendar origin to the beginning of the experiment 167 149 168 CALL dia_nam( clhstnam, n gap, 'diagap' )150 CALL dia_nam( clhstnam, nn_gap, 'diagap' ) 169 151 IF(lwp) WRITE(numout,*) 'Name of diagap NETCDF file ', clhstnam 170 152 ! Horizontal grid : zphi() … … 200 182 itmod = kt - nit000 + 1 ! define time axis 201 183 it = kt 202 IF( MOD( itmod, n gap ) == 0 ) THEN184 IF( MOD( itmod, nn_gap ) == 0 ) THEN 203 185 204 186 ! initialization … … 223 205 END DO 224 206 225 226 207 ! 2. Basin averaged 227 208 ! ----------------- 228 229 209 DO jk = 1, jpkm1 230 210 tdtag(jpk) = tdtag(jpk) + tdtag(jk) * volk(jk) / vol … … 240 220 ! 3. Averaged output in file numgap 241 221 ! ----------------------------====== 242 243 IF( MOD( itmod, nprg ) == 0 ) THEN 222 IF( MOD( itmod, nn_prg ) == 0 ) THEN 244 223 IF(lwp) THEN 245 224 WRITE(numout,*) 'dia_gap: time step = ', kt, 'model - data' 246 225 WRITE(numout,9300) 247 248 226 DO jk = 1, jpk 249 227 WRITE(numout,9310) tdtag(jk), tmodg(jk), tdtag(jk) - tmodg(jk), jk, fsdept(1,1,jk), & 250 228 & sdtag(jk), smodg(jk), sdtag(jk) - smodg(jk) 251 229 END DO 252 230 ENDIF … … 269 247 270 248 ! Closing numgap file 271 272 249 IF( kt == nitend ) THEN 273 250 CALL histclo( numgap ) ! Netcdf file 274 251 ENDIF 275 252 ! 276 253 END SUBROUTINE dia_gap 277 254 -
trunk/NEMO/OPA_SRC/DOM/closea.F90
r1146 r1601 32 32 PUBLIC clo_bat ! routine called in domzgr module 33 33 34 !!* Namelist namclo : closed seas and lakes35 INTEGER, PUBLIC :: nclosea = 0 !: = 0 no closed sea or lake36 ! ! = 1 closed sea or lake in the domain37 38 34 INTEGER, PUBLIC, PARAMETER :: jpncs = 4 !: number of closed sea 39 35 INTEGER, PUBLIC, DIMENSION(jpncs) :: ncstt !: Type of closed sea -
trunk/NEMO/OPA_SRC/DOM/dom_oce.F90
r1577 r1601 1 1 MODULE dom_oce 2 !! ----------------------------------------------------------------------2 !!====================================================================== 3 3 !! *** MODULE dom_oce *** 4 4 !! 5 5 !! ** Purpose : Define in memory all the ocean space domain variables 6 !!---------------------------------------------------------------------- 7 !! History : 8 !! 9.0 ! 05-10 (A. Beckmann, G. Madec) reactivate s-coordinate 9 !!---------------------------------------------------------------------- 10 !! OPA 9.0 , LOCEAN-IPSL (2006) 6 !!====================================================================== 7 !! History : 1.0 ! 2005-10 (A. Beckmann, G. Madec) reactivate s-coordinate 8 !!---------------------------------------------------------------------- 9 !! NEMO/OPA 3.2 , LOCEAN-IPSL (2009) 11 10 !! $Id$ 12 !! This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt 13 !!---------------------------------------------------------------------- 14 !! * Modules used 11 !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 12 !!---------------------------------------------------------------------- 15 13 USE par_oce ! ocean parameters 16 14 … … 20 18 21 19 !!---------------------------------------------------------------------- 20 !! time & space domain namelist 21 !! ---------------------------- 22 ! !!* Namelist namdom : time & space domain * 23 INTEGER , PUBLIC :: nn_bathy = 0 !: = 0/1 ,compute/read the bathymetry file 24 REAL(wp), PUBLIC :: rn_e3zps_min = 5.0_wp !: miminum thickness for partial steps (meters) 25 REAL(wp), PUBLIC :: rn_e3zps_rat = 0.1_wp !: minimum thickness ration for partial steps 26 INTEGER , PUBLIC :: nn_msh = 0 !: = 1 create a mesh-mask file 27 INTEGER , PUBLIC :: nn_acc = 0 !: = 0/1 use of the acceleration of convergence technique 28 REAL(wp), PUBLIC :: rn_atfp = 0.1_wp !: asselin time filter parameter 29 REAL(wp), PUBLIC :: rn_rdt = 3600._wp !: time step for the dynamics (and tracer if nacc=0) 30 REAL(wp), PUBLIC :: rn_rdtmin = 3600._wp !: minimum time step on tracers 31 REAL(wp), PUBLIC :: rn_rdtmax = 3600._wp !: maximum time step on tracers 32 REAL(wp), PUBLIC :: rn_rdth = 800._wp !: depth variation of tracer step 33 INTEGER , PUBLIC :: nn_baro = 64 !: number of barotropic time steps (key_dynspg_ts) 34 INTEGER , PUBLIC :: nn_closea = 0 !: =0 suppress closed sea/lake from the ORCA domain or not (=1) 35 36 ! ! old non-DOCTOR names still used in the model 37 INTEGER , PUBLIC :: ntopo !: = 0/1 ,compute/read the bathymetry file 38 REAL(wp), PUBLIC :: e3zps_min !: miminum thickness for partial steps (meters) 39 REAL(wp), PUBLIC :: e3zps_rat !: minimum thickness ration for partial steps 40 INTEGER , PUBLIC :: nmsh !: = 1 create a mesh-mask file 41 INTEGER , PUBLIC :: nacc !: = 0/1 use of the acceleration of convergence technique 42 REAL(wp), PUBLIC :: atfp !: asselin time filter parameter 43 REAL(wp), PUBLIC :: rdt !: time step for the dynamics (and tracer if nacc=0) 44 REAL(wp), PUBLIC :: rdtmin !: minimum time step on tracers 45 REAL(wp), PUBLIC :: rdtmax !: maximum time step on tracers 46 REAL(wp), PUBLIC :: rdth !: depth variation of tracer step 47 INTEGER , PUBLIC :: nclosea !: =0 suppress closed sea/lake from the ORCA domain or not (=1) 48 49 50 ! !!! associated variables 51 INTEGER , PUBLIC :: neuler = 0 !: restart euler forward option (0=Euler) 52 REAL(wp), PUBLIC :: atfp1 !: asselin time filter coeff. (atfp1= 1-2*atfp) 53 REAL(wp), PUBLIC, DIMENSION(jpk) :: rdttra !: vertical profile of tracer time step 54 55 ! !!* Namelist namcla : cross land advection 56 INTEGER, PUBLIC :: nn_cla = 0 !: =1 cross land advection for exchanges through some straits (ORCA2) 57 58 ! ! old non-DOCTOR names still used in the model 59 INTEGER, PUBLIC :: n_cla = 0 !: =1 cross land advection for exchanges through some straits (ORCA2) 60 61 !!---------------------------------------------------------------------- 22 62 !! space domain parameters 23 63 !! ----------------------- 24 LOGICAL, PUBLIC :: & !: 25 lzoom = .FALSE. , & !: zoom flag 26 lzoom_e = .FALSE. , & !: East zoom type flag 27 lzoom_w = .FALSE. , & !: West zoom type flag 28 lzoom_s = .FALSE. , & !: South zoom type flag 29 lzoom_n = .FALSE. , & !: North zoom type flag 30 lzoom_arct = .FALSE. , & !: ORCA arctic zoom flag 31 lzoom_anta = .FALSE. !: ORCA antarctic zoom flag 32 33 INTEGER, PUBLIC :: & !!: namdom : space domain (bathymetry, mesh) 34 ntopo = 0 , & !: = 0/1 ,compute/read the bathymetry file 35 nmsh = 0 !: = 1 create a mesh-mask file 36 37 INTEGER, PUBLIC :: & !: 38 ! domain parameters linked to mpp 39 nperio, & !: type of lateral boundary condition 40 nimpp, njmpp, & !: i- & j-indexes for mpp-subdomain left bottom 41 nreci, nrecj, & !: overlap region in i and j 42 nproc, & !: number for local processor 43 narea, & !: number for local area 44 nbondi, nbondj, & !: mark of i- and j-direction local boundaries 45 npolj, & !: north fold mark (0, 3 or 4) 46 nlci, nlcj, & !: i- & j-dimensions of the local subdomain 47 nldi, nlei, & !: first and last indoor i- and j-indexes 48 nldj, nlej, & !: 49 noea, nowe, & !: index of the local neighboring processors in 50 noso, nono, & !: east, west, south and north directions 51 npne, npnw, & !: index of north east and north west processor 52 npse, npsw, & !: index of south east and south west processor 53 nbne, nbnw, & !: logical of north east & north west processor 54 nbse, nbsw, & !: logical of south east & south west processor 55 nidom !: ??? 56 57 INTEGER, PUBLIC, DIMENSION(jpi) :: & !: 58 mig !: local ==> global domain i-indice 59 INTEGER, PUBLIC, DIMENSION(jpj) :: & !: 60 mjg !: local ==> global domain j-indice 61 INTEGER, PUBLIC, DIMENSION( jpidta ) :: & !: !!bug ==> other solution? 62 mi0, mi1 !: global ==> local domain i-indice 63 ! ! (mi0=1 and mi1=0 if the global indice is not in the local domain) 64 INTEGER, PUBLIC, DIMENSION( jpjdta ) :: & !: 65 mj0, mj1 !: global ==> local domain j-indice 66 ! ! (mi0=1 and mi1=0 if the global indice is not in the local domain) 67 68 INTEGER, PUBLIC, DIMENSION(jpnij) :: & !: 69 nimppt, njmppt, & !: i-, j-indexes for each processor 70 ibonit, ibonjt, & !: i-, j- processor neighbour existence 71 nlcit , nlcjt, & !: dimensions of every subdomain 72 nldit , nldjt, & !: first, last indoor index for each i-domain 73 nleit , nlejt !: first, last indoor index for each j-domain 64 LOGICAL, PUBLIC :: lzoom = .FALSE. !: zoom flag 65 LOGICAL, PUBLIC :: lzoom_e = .FALSE. !: East zoom type flag 66 LOGICAL, PUBLIC :: lzoom_w = .FALSE. !: West zoom type flag 67 LOGICAL, PUBLIC :: lzoom_s = .FALSE. !: South zoom type flag 68 LOGICAL, PUBLIC :: lzoom_n = .FALSE. !: North zoom type flag 69 LOGICAL, PUBLIC :: lzoom_arct = .FALSE. !: ORCA arctic zoom flag 70 LOGICAL, PUBLIC :: lzoom_anta = .FALSE. !: ORCA antarctic zoom flag 71 72 ! !!! domain parameters linked to mpp 73 INTEGER, PUBLIC :: nperio !: type of lateral boundary condition 74 INTEGER, PUBLIC :: nimpp, njmpp !: i- & j-indexes for mpp-subdomain left bottom 75 INTEGER, PUBLIC :: nreci, nrecj !: overlap region in i and j 76 INTEGER, PUBLIC :: nproc !: number for local processor 77 INTEGER, PUBLIC :: narea !: number for local area 78 INTEGER, PUBLIC :: nbondi, nbondj !: mark of i- and j-direction local boundaries 79 INTEGER, PUBLIC :: npolj !: north fold mark (0, 3 or 4) 80 INTEGER, PUBLIC :: nlci, nldi, nlei !: i-dimensions of the local subdomain and its first and last indoor indices 81 INTEGER, PUBLIC :: nlcj, nldj, nlej !: i-dimensions of the local subdomain and its first and last indoor indices 82 INTEGER, PUBLIC :: noea, nowe !: index of the local neighboring processors in 83 INTEGER, PUBLIC :: noso, nono !: east, west, south and north directions 84 INTEGER, PUBLIC :: npne, npnw !: index of north east and north west processor 85 INTEGER, PUBLIC :: npse, npsw !: index of south east and south west processor 86 INTEGER, PUBLIC :: nbne, nbnw !: logical of north east & north west processor 87 INTEGER, PUBLIC :: nbse, nbsw !: logical of south east & south west processor 88 INTEGER, PUBLIC :: nidom !: ??? 89 90 INTEGER, PUBLIC, DIMENSION(jpi) :: mig !: local ==> global domain i-index 91 INTEGER, PUBLIC, DIMENSION(jpj) :: mjg !: local ==> global domain j-index 92 INTEGER, PUBLIC, DIMENSION(jpidta) :: mi0, mi1 !: global ==> local domain i-index !!bug ==> other solution? 93 ! ! (mi0=1 and mi1=0 if the global index is not in the local domain) 94 INTEGER, PUBLIC, DIMENSION(jpjdta) :: mj0, mj1 !: global ==> local domain j-index !!bug ==> other solution? 95 ! ! (mi0=1 and mi1=0 if the global index is not in the local domain) 96 INTEGER, PUBLIC, DIMENSION(jpnij) :: nimppt, njmppt !: i-, j-indexes for each processor 97 INTEGER, PUBLIC, DIMENSION(jpnij) :: ibonit, ibonjt !: i-, j- processor neighbour existence 98 INTEGER, PUBLIC, DIMENSION(jpnij) :: nlcit , nlcjt !: dimensions of every subdomain 99 INTEGER, PUBLIC, DIMENSION(jpnij) :: nldit , nldjt !: first, last indoor index for each i-domain 100 INTEGER, PUBLIC, DIMENSION(jpnij) :: nleit , nlejt !: first, last indoor index for each j-domain 74 101 75 102 !!---------------------------------------------------------------------- 76 103 !! horizontal curvilinear coordinate and scale factors 77 104 !! --------------------------------------------------------------------- 78 79 REAL(wp), PUBLIC, DIMENSION(jpi,jpj) :: & !: 80 glamt, glamu, & !: longitude of t-, u-, v- and f-points (degre) 81 glamv, glamf, & !: 82 gphit, gphiu, & !: latitude of t-, u-, v- and f-points (degre) 83 gphiv, gphif, & !: 84 e1t, e2t, & !: horizontal scale factors at t-point (m) 85 e1u, e2u, & !: horizontal scale factors at u-point (m) 86 e1v, e2v, & !: horizontal scale factors at v-point (m) 87 e1f, e2f, & !: horizontal scale factors at f-point (m) 88 ff !: coriolis factor (2.*omega*sin(yphi) ) (s-1) 105 REAL(wp), PUBLIC, DIMENSION(jpi,jpj) :: glamt, glamu !: longitude of t-, u-, v- and f-points (degre) 106 REAL(wp), PUBLIC, DIMENSION(jpi,jpj) :: glamv, glamf !: 107 REAL(wp), PUBLIC, DIMENSION(jpi,jpj) :: gphit, gphiu !: latitude of t-, u-, v- and f-points (degre) 108 REAL(wp), PUBLIC, DIMENSION(jpi,jpj) :: gphiv, gphif !: 109 REAL(wp), PUBLIC, DIMENSION(jpi,jpj) :: e1t, e2t !: horizontal scale factors at t-point (m) 110 REAL(wp), PUBLIC, DIMENSION(jpi,jpj) :: e1u, e2u !: horizontal scale factors at u-point (m) 111 REAL(wp), PUBLIC, DIMENSION(jpi,jpj) :: e1v, e2v !: horizontal scale factors at v-point (m) 112 REAL(wp), PUBLIC, DIMENSION(jpi,jpj) :: e1f, e2f !: horizontal scale factors at f-point (m) 113 REAL(wp), PUBLIC, DIMENSION(jpi,jpj) :: ff !: coriolis factor (2.*omega*sin(yphi) ) (s-1) 89 114 90 115 !!---------------------------------------------------------------------- 91 116 !! vertical coordinate and scale factors 92 117 !! -------------------------------------- 93 94 LOGICAL, PUBLIC :: & !!: namzgr : vertical coordinate 95 ln_zco = .TRUE. , & !: z-coordinate - full step 96 ln_zps = .FALSE. , & !: z-coordinate - partial step 97 ln_sco = .FALSE. !: s-coordinate or hybrid z-s coordinate 98 118 ! !!* Namelist namzgr : vertical coordinate * 119 LOGICAL, PUBLIC :: ln_zco = .TRUE. !: z-coordinate - full step 120 LOGICAL, PUBLIC :: ln_zps = .FALSE. !: z-coordinate - partial step 121 LOGICAL, PUBLIC :: ln_sco = .FALSE. !: s-coordinate or hybrid z-s coordinate 99 122 #if defined key_zco 100 123 LOGICAL, PUBLIC, PARAMETER :: lk_zco = .TRUE. !: z-coordinate flag (1D arrays) … … 104 127 !! All coordinates 105 128 !! --------------- 106 REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) :: & !: 107 gdep3w , & !: depth of T-points (sum of e3w) (m) 108 gdept , gdepw , & !: analytical depth at T-W points (m) 109 e3v , e3f , & !: analytical vertical scale factors at V--F 110 e3t , e3u , & !: T--U points (m) 111 e3vw , & !: analytical vertical scale factors at VW-- 112 e3w , e3uw !: W--UW points (m) 129 REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) :: gdep3w !: depth of T-points (sum of e3w) (m) 130 REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) :: gdept , gdepw !: analytical depth at T-W points (m) 131 REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) :: e3v , e3f !: analytical vertical scale factors at V--F 132 REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) :: e3t , e3u !: T--U points (m) 133 REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) :: e3vw !: analytical vertical scale factors at VW-- 134 REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) :: e3w , e3uw !: W--UW points (m) 113 135 #endif 114 136 #if defined key_vvl 115 137 LOGICAL, PUBLIC, PARAMETER :: lk_vvl = .TRUE. !: variable grid flag 138 116 139 !! All coordinates 117 140 !! --------------- … … 125 148 LOGICAL, PUBLIC, PARAMETER :: lk_vvl = .FALSE. !: fixed grid flag 126 149 #endif 127 REAL(wp), PUBLIC, DIMENSION(jpi,jpj) :: & !: 128 hur, hvr, & !: inverse of u and v-points ocean depth (1/m) 129 hu , hv, & !: depth at u- and v-points (meters) 130 hu_0 , hv_0 !: refernce depth at u- and v-points (meters) 131 132 INTEGER, PUBLIC :: nla10 !: deepest W level Above ~10m (nlb10 - 1) 133 INTEGER, PUBLIC :: nlb10 !: shallowest W level Bellow ~10m (nla10 + 1) 150 REAL(wp), PUBLIC, DIMENSION(jpi,jpj) :: hur , hvr !: inverse of u and v-points ocean depth (1/m) 151 REAL(wp), PUBLIC, DIMENSION(jpi,jpj) :: hu , hv !: depth at u- and v-points (meters) 152 REAL(wp), PUBLIC, DIMENSION(jpi,jpj) :: hu_0 , hv_0 !: refernce depth at u- and v-points (meters) 153 154 INTEGER, PUBLIC :: nla10 !: deepest W level Above ~10m (nlb10 - 1) 155 INTEGER, PUBLIC :: nlb10 !: shallowest W level Bellow ~10m (nla10 + 1) 134 156 135 157 !! z-coordinate with full steps (also used in the other cases as reference z-coordinate) 136 158 !! =-----------------====------ 137 REAL(wp), PUBLIC, DIMENSION(jpk) :: & !: 138 gdept_0, gdepw_0, & !: reference depth of t- and w-points (m) 139 e3t_0 , e3w_0 !: reference vertical scale factors at T- and W-pts (m) 140 141 !! z-coordinate with partial steps 142 !! =-----------------=======------ 143 REAL(wp), PUBLIC :: & !!: * namelist namdom * 144 e3zps_min = 5.0_wp, & !: miminum thickness for partial steps (meters) 145 e3zps_rat = 0.1_wp !: minimum thickness ration for partial steps 146 147 REAL(wp), PUBLIC, DIMENSION(jpi,jpj) :: & !: 148 hdept, hdepw, e3tp, e3wp !: bottom depth and thickness at T and W points 159 REAL(wp), PUBLIC, DIMENSION(jpk) :: gdept_0, gdepw_0 !: reference depth of t- and w-points (m) 160 REAL(wp), PUBLIC, DIMENSION(jpk) :: e3t_0 , e3w_0 !: reference vertical scale factors at T- and W-pts (m) 161 REAL(wp), PUBLIC, DIMENSION(jpi,jpj) :: hdept , hdepw !: ocean bottom depth at T and W points 162 REAL(wp), PUBLIC, DIMENSION(jpi,jpj) :: e3tp , e3wp !: ocean bottom level thickness at T and W points 149 163 150 164 !! s-coordinate and hybrid z-s-coordinate 151 165 !! =----------------======--------------- 152 REAL(wp), PUBLIC, DIMENSION(jpk) :: & !: 153 gsigt, gsigw , & !: model level depth coefficient at t-, w-levels (analytic) 154 gsi3w , & !: model level depth coefficient at w-level (sum of gsigw) 155 esigt, esigw !: vertical scale factor coef. at t-, w-levels 156 157 REAL(wp), PUBLIC, DIMENSION(jpi,jpj) :: & !: 158 hbatv , hbatf , & !: ocean depth at the vertical of V--F 159 hbatt , hbatu , & !: T--U points (m) 160 scosrf, scobot, & !: ocean surface and bottom topographies (if deviating from coordinate surfaces in HYBRID) 161 hifv , hiff , & !: interface depth between stretching at V--F 162 hift , hifu !: and quasi-uniform spacing T--U points (m) 166 REAL(wp), PUBLIC, DIMENSION(jpk) :: gsigt, gsigw !: model level depth coefficient at t-, w-levels (analytic) 167 REAL(wp), PUBLIC, DIMENSION(jpk) :: gsi3w !: model level depth coefficient at w-level (sum of gsigw) 168 REAL(wp), PUBLIC, DIMENSION(jpk) :: esigt, esigw !: vertical scale factor coef. at t-, w-levels 169 170 REAL(wp), PUBLIC, DIMENSION(jpi,jpj) :: hbatv , hbatf !: ocean depth at the vertical of V--F 171 REAL(wp), PUBLIC, DIMENSION(jpi,jpj) :: hbatt , hbatu !: T--U points (m) 172 REAL(wp), PUBLIC, DIMENSION(jpi,jpj) :: scosrf, scobot !: ocean surface and bottom topographies 173 ! ! (if deviating from coordinate surfaces in HYBRID) 174 REAL(wp), PUBLIC, DIMENSION(jpi,jpj) :: hifv , hiff !: interface depth between stretching at V--F 175 REAL(wp), PUBLIC, DIMENSION(jpi,jpj) :: hift , hifu !: and quasi-uniform spacing T--U points (m) 163 176 164 177 !!---------------------------------------------------------------------- 165 178 !! masks, bathymetry 166 179 !! ----------------- 167 168 INTEGER , PUBLIC, DIMENSION(jpi,jpj) :: & !: 169 mbathy !: number of ocean level (=0, 1, ... , jpk-1) 170 171 REAL(wp), PUBLIC, DIMENSION(jpi,jpj) :: & !: 172 bathy , & !: ocean depth (meters) 173 tmask_i, & !: interior domain T-point mask 174 bmask !: land/ocean mask of barotropic stream function 175 176 REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) :: & !: 177 tmask, umask, & !: land/ocean mask at T-, U-, V- and F-points 178 vmask, fmask !: 179 180 REAL(wp), PUBLIC, DIMENSION(jpiglo) :: & !: 181 tpol, fpol !: north fold mask (nperio= 3 or 4) 180 INTEGER , PUBLIC, DIMENSION(jpi,jpj) :: mbathy !: number of ocean level (=0, 1, ... , jpk-1) 181 REAL(wp), PUBLIC, DIMENSION(jpi,jpj) :: bathy !: ocean depth (meters) 182 REAL(wp), PUBLIC, DIMENSION(jpi,jpj) :: tmask_i !: interior domain T-point mask 183 REAL(wp), PUBLIC, DIMENSION(jpi,jpj) :: bmask !: land/ocean mask of barotropic stream function 184 185 REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) :: tmask, umask, vmask, fmask !: land/ocean mask at T-, U-, V- and F-points 186 187 REAL(wp), PUBLIC, DIMENSION(jpiglo) :: tpol, fpol !: north fold mask (nperio= 3 or 4) 182 188 183 189 #if defined key_noslip_accurate 184 INTEGER, PUBLIC, DIMENSION(4,jpk) :: & !: 185 npcoa !: ??? 186 INTEGER, PUBLIC, DIMENSION(2*(jpi+jpj),4,jpk) :: & !: 187 nicoa, & !: ??? 188 njcoa !: ??? 190 INTEGER, PUBLIC, DIMENSION (4,jpk) :: npcoa !: ??? 191 INTEGER, PUBLIC, DIMENSION(2*(jpi+jpj),4,jpk) :: nicoa, njcoa !: ??? 189 192 #endif 190 193 … … 198 201 #endif 199 202 200 201 !!---------------------------------------------------------------------- 202 !! time domain 203 !!---------------------------------------------------------------------- 204 INTEGER, PUBLIC :: & !!: * Namelist * ??? 205 nacc = 0 , & !: = 0/1 use of the acceleration of convergence technique 206 neuler , & !: restart euler forward option (0=Euler) 207 nn_baro = 64 !: number of barotropic time steps (key_dynspg_ts) 208 209 REAL(wp), PUBLIC :: & !!: * Namelist ??? * 210 rdt = 3600._wp , & !: time step for the dynamics (and tracer if nacc=0) 211 rdtmin = 3600._wp , & !: minimum time step on tracers 212 rdtmax = 3600._wp , & !: maximum time step on tracers 213 rdth = 800._wp , & !: depth variation of tracer step 214 atfp = 0.1_wp , & !: asselin time filter parameter 215 atfp1 !: asselin time filter coeff. (atfp1= 1-2*atfp) 216 217 REAL(wp), PUBLIC, DIMENSION(jpk) :: & !: 218 rdttra !: vertical profile of tracer time step 219 220 !!---------------------------------------------------------------------- 221 !! cross land advection 222 !!---------------------------------------------------------------------- 223 224 INTEGER, PUBLIC :: & !!: namelist ??? 225 n_cla !: flag (0/1) for cross land advection to 226 ! ! parameterize exchanges through straits 227 203 !!====================================================================== 228 204 END MODULE dom_oce -
trunk/NEMO/OPA_SRC/DOM/domain.F90
r1488 r1601 5 5 !!============================================================================== 6 6 !! History : OPA ! 1990-10 (C. Levy - G. Madec) Original code 7 !! ! 1991-11 (G. Madec)8 7 !! ! 1992-01 (M. Imbard) insert time step initialization 9 8 !! ! 1996-06 (G. Madec) generalized vertical coordinate … … 23 22 USE sbc_oce ! surface boundary condition: ocean 24 23 USE phycst ! physical constants 24 USE closea ! closed seas 25 25 USE in_out_manager ! I/O manager 26 26 USE lib_mpp ! distributed memory computing library … … 31 31 USE dommsk ! domain: set the mask system 32 32 USE domwri ! domain: write the meshmask file 33 USE closea ! closed sea or lake (dom_clo routine)34 33 USE domvvl ! variable volume 35 34 … … 54 53 !! 55 54 !! ** Purpose : Domain initialization. Call the routines that are 56 !! required to create the arrays which define the space and time57 !! domain of the ocean model.55 !! required to create the arrays which define the space 56 !! and time domain of the ocean model. 58 57 !! 59 !! ** Method : 60 !! - dom_msk: compute the masks from the bathymetry file 61 !! - dom_hgr: compute or read the horizontal grid-point position and 62 !! scale factors, and the coriolis factor 63 !! - dom_zgr: define the vertical coordinate system and the bathymetry 64 !! - dom_stp: defined the model time step 65 !! - dom_wri: create the meshmask file if nmsh=1 58 !! ** Method : - dom_msk: compute the masks from the bathymetry file 59 !! - dom_hgr: compute or read the horizontal grid-point position 60 !! and scale factors, and the coriolis factor 61 !! - dom_zgr: define the vertical coordinate and the bathymetry 62 !! - dom_stp: defined the model time step 63 !! - dom_wri: create the meshmask file if nmsh=1 66 64 !!---------------------------------------------------------------------- 67 65 INTEGER :: jk ! dummy loop argument 68 66 INTEGER :: iconf = 0 ! temporary integers 69 67 !!---------------------------------------------------------------------- 70 68 ! 71 69 IF(lwp) THEN 72 70 WRITE(numout,*) … … 74 72 WRITE(numout,*) '~~~~~~~~' 75 73 ENDIF 76 77 CALL dom_nam ! read namelist ( namrun, namdom, namcla ) 78 79 CALL dom_clo ! Closed seas and lake 80 81 CALL dom_hgr ! Horizontal mesh 82 83 CALL dom_zgr ! Vertical mesh and bathymetry 84 85 CALL dom_msk ! Masks 86 87 IF( lk_vvl ) CALL dom_vvl ! Vertical variable mesh 88 89 ! Local depth or Inverse of the local depth of the water column at u- and v-points 90 ! ------------------------------ 91 ! Ocean depth at U- and V-points 92 hu(:,:) = 0.e0 74 ! 75 CALL dom_nam ! read namelist ( namrun, namdom, namcla ) 76 CALL dom_clo ! Closed seas and lake 77 CALL dom_hgr ! Horizontal mesh 78 CALL dom_zgr ! Vertical mesh and bathymetry 79 CALL dom_msk ! Masks 80 IF( lk_vvl ) CALL dom_vvl ! Vertical variable mesh 81 ! 82 hu(:,:) = 0.e0 ! Ocean depth at U- and V-points 93 83 hv(:,:) = 0.e0 94 84 DO jk = 1, jpk … … 96 86 hv(:,:) = hv(:,:) + fse3v(:,:,jk) * vmask(:,:,jk) 97 87 END DO 98 ! Inverse of the local depth 99 hur(:,:) = fse3u(:,:,1) ! Lower bound : thickness of the first model level 100 hvr(:,:) = fse3v(:,:,1) 101 DO jk = 2, jpk ! Sum of the vertical scale factors 102 hur(:,:) = hur(:,:) + fse3u(:,:,jk) * umask(:,:,jk) 103 hvr(:,:) = hvr(:,:) + fse3v(:,:,jk) * vmask(:,:,jk) 104 END DO 105 ! Compute and mask the inverse of the local depth 106 hur(:,:) = 1. / hur(:,:) * umask(:,:,1) 107 hvr(:,:) = 1. / hvr(:,:) * vmask(:,:,1) 108 109 CALL dom_stp ! Time step 110 111 IF( nmsh /= 0 ) CALL dom_wri ! Create a domain file 112 113 IF( .NOT.ln_rstart ) CALL dom_ctl ! Domain control 88 ! ! Inverse of the local depth 89 hur(:,:) = 1. / ( hu(:,:) + 1.e0 - umask(:,:,1) ) * umask(:,:,1) 90 hvr(:,:) = 1. / ( hv(:,:) + 1.e0 - vmask(:,:,1) ) * vmask(:,:,1) 91 92 CALL dom_stp ! time step 93 IF( nmsh /= 0 ) CALL dom_wri ! Create a domain file 94 IF( .NOT.ln_rstart ) CALL dom_ctl ! Domain control 114 95 ! 115 96 END SUBROUTINE dom_init … … 127 108 !!---------------------------------------------------------------------- 128 109 USE ioipsl 129 NAMELIST/namrun/ no , cexper, cn_ocerst_in, cn_ocerst_out, ln_rstart, nrstdt, & 130 & nit000, nitend, ndate0 , nleapy , ninist , nstock, & 131 & nwrite, ln_dimgnnn, ln_mskland, ln_clobber, nn_chunksz 132 133 NAMELIST/namdom/ ntopo , e3zps_min, e3zps_rat, nmsh , & 134 & nacc , atfp , rdt , rdtmin , & 135 & rdtmax, rdth , nn_baro , nclosea 136 NAMELIST/namcla/ n_cla 137 !!---------------------------------------------------------------------- 138 139 IF(lwp) THEN 110 NAMELIST/namrun/ nn_no , cn_exp , cn_ocerst_in, cn_ocerst_out, ln_rstart , nn_rstctl, & 111 & nn_it000, nn_itend , nn_date0 , nn_leapy , nn_istate , nn_stock , & 112 & nn_write, ln_dimgnnn, ln_mskland , ln_clobber , nn_chunksz 113 NAMELIST/namdom/ nn_bathy , rn_e3zps_min, rn_e3zps_rat, nn_msh , & 114 & nn_acc , rn_atfp , rn_rdt , rn_rdtmin, & 115 & rn_rdtmax, rn_rdth , nn_baro , nn_closea 116 NAMELIST/namcla/ nn_cla 117 !!---------------------------------------------------------------------- 118 119 REWIND( numnam ) ! Namelist namrun : parameters of the run 120 READ ( numnam, namrun ) 121 ! 122 IF(lwp) THEN ! control print 140 123 WRITE(numout,*) 141 124 WRITE(numout,*) 'dom_nam : domain initialization through namelist read' 142 125 WRITE(numout,*) '~~~~~~~ ' 143 ENDIF 144 145 REWIND( numnam ) ! Namelist namrun : parameters of the run 146 READ ( numnam, namrun ) 147 IF(lwp) THEN 148 WRITE(numout,*) ' Namelist namrun' 149 WRITE(numout,*) ' job number no = ', no 150 WRITE(numout,*) ' experiment name for output cexper = ', cexper 151 WRITE(numout,*) ' restart logical ln_rstart = ', ln_rstart 152 WRITE(numout,*) ' control of time step nrstdt = ', nrstdt 153 WRITE(numout,*) ' number of the first time step nit000 = ', nit000 154 WRITE(numout,*) ' number of the last time step nitend = ', nitend 155 WRITE(numout,*) ' initial calendar date aammjj ndate0 = ', ndate0 156 WRITE(numout,*) ' leap year calendar (0/1) nleapy = ', nleapy 157 WRITE(numout,*) ' initial state output ninist = ', ninist 158 WRITE(numout,*) ' frequency of restart file nstock = ', nstock 159 WRITE(numout,*) ' frequency of output file nwrite = ', nwrite 160 WRITE(numout,*) ' multi file dimgout ln_dimgnnn = ', ln_dimgnnn 161 WRITE(numout,*) ' mask land points ln_mskland = ', ln_mskland 162 WRITE(numout,*) ' overwrite an existing file ln_clobber = ', ln_clobber 163 WRITE(numout,*) ' NetCDF chunksize (bytes) nn_chunksz = ', nn_chunksz 164 ENDIF 165 166 ! ... Control of output frequency 126 WRITE(numout,*) ' Namelist namrun' 127 WRITE(numout,*) ' job number nn_no = ', nn_no 128 WRITE(numout,*) ' experiment name for output cn_exp = ', cn_exp 129 WRITE(numout,*) ' restart logical ln_rstart = ', ln_rstart 130 WRITE(numout,*) ' control of time step nn_rstdt = ', nn_rstctl 131 WRITE(numout,*) ' number of the first time step nn_it000 = ', nn_it000 132 WRITE(numout,*) ' number of the last time step nn_itend = ', nn_itend 133 WRITE(numout,*) ' initial calendar date aammjj nn_date0 = ', nn_date0 134 WRITE(numout,*) ' leap year calendar (0/1) nn_leapy = ', nn_leapy 135 WRITE(numout,*) ' initial state output nn_istate = ', nn_istate 136 WRITE(numout,*) ' frequency of restart file nn_stock = ', nn_stock 137 WRITE(numout,*) ' frequency of output file nn_write = ', nn_write 138 WRITE(numout,*) ' multi file dimgout ln_dimgnnn = ', ln_dimgnnn 139 WRITE(numout,*) ' mask land points ln_mskland = ', ln_mskland 140 WRITE(numout,*) ' overwrite an existing file ln_clobber = ', ln_clobber 141 WRITE(numout,*) ' NetCDF chunksize (bytes) nn_chunksz = ', nn_chunksz 142 ENDIF 143 144 no = nn_no ! conversion DOCTOR names into model names (this should disappear soon) 145 cexper = cn_exp 146 nrstdt = nn_rstctl 147 nit000 = nn_it000 148 nitend = nn_itend 149 ndate0 = nn_date0 150 nleapy = nn_leapy 151 ninist = nn_istate 152 nstock = nn_stock 153 nwrite = nn_write 154 155 156 ! ! control of output frequency 167 157 IF ( nstock == 0 .OR. nstock > nitend ) THEN 168 WRITE(ctmp1,*) ' 158 WRITE(ctmp1,*) 'nstock = ', nstock, ' it is forced to ', nitend 169 159 CALL ctl_warn( ctmp1 ) 170 160 nstock = nitend 171 161 ENDIF 172 162 IF ( nwrite == 0 ) THEN 173 WRITE(ctmp1,*) ' 163 WRITE(ctmp1,*) 'nwrite = ', nwrite, ' it is forced to ', nitend 174 164 CALL ctl_warn( ctmp1 ) 175 165 nwrite = nitend … … 177 167 178 168 #if defined key_agrif 179 if ( Agrif_Root() ) then169 IF( Agrif_Root() ) THEN 180 170 #endif 181 SELECT CASE ( nleapy ) ! Choose calendar for IOIPSL171 SELECT CASE ( nleapy ) ! Choose calendar for IOIPSL 182 172 CASE ( 1 ) 183 173 CALL ioconf_calendar('gregorian') 184 IF(lwp) WRITE(numout,*) ' 174 IF(lwp) WRITE(numout,*) ' The IOIPSL calendar is "gregorian", i.e. leap year' 185 175 CASE ( 0 ) 186 176 CALL ioconf_calendar('noleap') 187 IF(lwp) WRITE(numout,*) ' 177 IF(lwp) WRITE(numout,*) ' The IOIPSL calendar is "noleap", i.e. no leap year' 188 178 CASE ( 30 ) 189 179 CALL ioconf_calendar('360d') 190 IF(lwp) WRITE(numout,*) ' 180 IF(lwp) WRITE(numout,*) ' The IOIPSL calendar is "360d", i.e. 360 days in a year' 191 181 END SELECT 192 182 #if defined key_agrif 193 endif183 ENDIF 194 184 #endif 195 185 196 SELECT CASE ( nleapy ) ! year=raajj*days day=rjjhh*hours hour=rhhmm*minutes etc ...186 SELECT CASE ( nleapy ) ! year=raajj*days day=rjjhh*hours hour=rhhmm*minutes etc ... 197 187 CASE ( 1 ) 198 188 raajj = 365.25 … … 210 200 IF(lwp) THEN 211 201 WRITE(numout,*) 212 WRITE(numout,*) ' 213 WRITE(numout,*) ' 214 WRITE(numout,*) ' 215 ENDIF 216 217 REWIND( numnam ) ! Namelist namdom : space/time domain (bathymetry, mesh, timestep)202 WRITE(numout,*) ' nb of days per year raajj = ', raajj,' days' 203 WRITE(numout,*) ' nb of seconds per year raass = ', raass, ' s' 204 WRITE(numout,*) ' nb of seconds per month rmoss = ', rmoss, ' s' 205 ENDIF 206 207 REWIND( numnam ) ! Namelist namdom : space & time domain (bathymetry, mesh, timestep) 218 208 READ ( numnam, namdom ) 219 209 220 210 IF(lwp) THEN 221 211 WRITE(numout,*) 222 WRITE(numout,*) ' Namelist namdom' 223 WRITE(numout,*) ' flag read/compute bathymetry ntopo = ', ntopo 224 WRITE(numout,*) ' minimum thickness of partial e3zps_min = ', e3zps_min, ' (m)' 225 WRITE(numout,*) ' step level e3zps_rat = ', e3zps_rat 226 WRITE(numout,*) ' flag write mesh/mask file(s) nmsh = ', nmsh 227 WRITE(numout,*) ' = 0 no file created ' 228 WRITE(numout,*) ' = 1 mesh_mask ' 229 WRITE(numout,*) ' = 2 mesh and mask ' 230 WRITE(numout,*) ' = 3 mesh_hgr, msh_zgr and mask ' 231 WRITE(numout,*) ' acceleration of converge nacc = ', nacc 232 WRITE(numout,*) ' asselin time filter parameter atfp = ', atfp 233 WRITE(numout,*) ' time step rdt = ', rdt 234 WRITE(numout,*) ' minimum time step on tracers rdtmin = ', rdtmin 235 WRITE(numout,*) ' maximum time step on tracers rdtmax = ', rdtmax 236 WRITE(numout,*) ' depth variation tracer step rdth = ', rdth 237 WRITE(numout,*) ' number of barotropic time step nn_baro = ', nn_baro 238 ENDIF 239 240 n_cla = 0 241 REWIND( numnam ) ! Namelist cross land advection 212 WRITE(numout,*) ' Namelist namdom : space & time domain' 213 WRITE(numout,*) ' flag read/compute bathymetry nn_bathy = ', nn_bathy 214 WRITE(numout,*) ' minimum thickness of partial rn_e3zps_min = ', rn_e3zps_min, ' (m)' 215 WRITE(numout,*) ' step level rn_e3zps_rat = ', rn_e3zps_rat 216 WRITE(numout,*) ' create mesh/mask file(s) nn_msh = ', nn_msh 217 WRITE(numout,*) ' = 0 no file created ' 218 WRITE(numout,*) ' = 1 mesh_mask ' 219 WRITE(numout,*) ' = 2 mesh and mask ' 220 WRITE(numout,*) ' = 3 mesh_hgr, msh_zgr and mask ' 221 WRITE(numout,*) ' ocean time step rn_rdt = ', rn_rdt 222 WRITE(numout,*) ' asselin time filter parameter rn_atfp = ', rn_atfp 223 WRITE(numout,*) ' time-splitting: nb of sub time-step nn_baro = ', nn_baro 224 WRITE(numout,*) ' acceleration of converge nn_acc = ', nn_acc 225 WRITE(numout,*) ' nn_acc=1: surface tracer rdt rn_rdtmin = ', rn_rdtmin 226 WRITE(numout,*) ' bottom tracer rdt rdtmax = ', rn_rdtmax 227 WRITE(numout,*) ' depth of transition rn_rdth = ', rn_rdth 228 WRITE(numout,*) ' suppression of closed seas (=0) nn_closea = ', nn_closea 229 ENDIF 230 231 ntopo = nn_bathy ! conversion DOCTOR names into model names (this should disappear soon) 232 e3zps_min = rn_e3zps_min 233 e3zps_rat = rn_e3zps_rat 234 nmsh = nn_msh 235 nacc = nn_acc 236 atfp = rn_atfp 237 rdt = rn_rdt 238 rdtmin = rn_rdtmin 239 rdtmax = rn_rdtmin 240 rdth = rn_rdth 241 nclosea = nn_closea 242 243 REWIND( numnam ) ! Namelist cross land advection 242 244 READ ( numnam, namcla ) 243 245 IF(lwp) THEN 244 246 WRITE(numout,*) 245 WRITE(numout,*) ' Namelist namcla' 246 WRITE(numout,*) ' cross land advection n_cla = ',n_cla 247 ENDIF 247 WRITE(numout,*) ' Namelist namcla' 248 WRITE(numout,*) ' cross land advection nn_cla = ', nn_cla 249 ENDIF 250 251 n_cla = nn_cla ! conversion DOCTOR names into model names (this should disappear soon) 248 252 249 253 IF( nbit_cmp == 1 .AND. n_cla /= 0 ) CALL ctl_stop( ' Reproductibility tests (nbit_cmp=1) require n_cla = 0' ) … … 261 265 !!---------------------------------------------------------------------- 262 266 INTEGER :: iimi1, ijmi1, iimi2, ijmi2, iima1, ijma1, iima2, ijma2 263 INTEGER, DIMENSION(2) :: iloc 267 INTEGER, DIMENSION(2) :: iloc ! 264 268 REAL(wp) :: ze1min, ze1max, ze2min, ze2max 265 269 !!---------------------------------------------------------------------- 266 267 IF(lwp)WRITE(numout,*) 268 IF(lwp)WRITE(numout,*) 'dom_ctl : extrema of the masked scale factors' 269 IF(lwp)WRITE(numout,*) '~~~~~~~' 270 271 IF (lk_mpp) THEN 270 ! 271 IF(lk_mpp) THEN 272 272 CALL mpp_minloc( e1t(:,:), tmask(:,:,1), ze1min, iimi1,ijmi1 ) 273 273 CALL mpp_minloc( e2t(:,:), tmask(:,:,1), ze2min, iimi2,ijmi2 ) … … 293 293 ijma2 = iloc(2) + njmpp - 1 294 294 ENDIF 295 296 IF(lwp) THEN 295 IF(lwp) THEN 296 WRITE(numout,*) 297 WRITE(numout,*) 'dom_ctl : extrema of the masked scale factors' 298 WRITE(numout,*) '~~~~~~~' 297 299 WRITE(numout,"(14x,'e1t maxi: ',1f10.2,' at i = ',i5,' j= ',i5)") ze1max, iima1, ijma1 298 300 WRITE(numout,"(14x,'e1t mini: ',1f10.2,' at i = ',i5,' j= ',i5)") ze1min, iimi1, ijmi1 -
trunk/NEMO/OPA_SRC/DOM/dommsk.F90
r1566 r1601 36 36 PUBLIC dom_msk ! routine called by inidom.F90 37 37 38 REAL(wp) :: shlat = 2. ! type of lateral boundary condition on velocity (namelist namlbc) 38 ! !!* Namelist namlbc : lateral boundary condition * 39 REAL(wp) :: rn_shlat = 2. ! type of lateral boundary condition on velocity 39 40 40 41 !! * Substitutions … … 77 78 !! 78 79 !! The lateral friction is set through the value of fmask along 79 !! the coast and topography. This value is defined by shlat, a80 !! the coast and topography. This value is defined by rn_shlat, a 80 81 !! namelist parameter: 81 !! shlat = 0, free slip (no shear along the coast)82 !! shlat = 2, no slip (specified zero velocity at the coast)83 !! 0 < shlat < 2, partial slip | non-linear velocity profile84 !! 2 < shlat, strong slip | in the lateral boundary layer82 !! rn_shlat = 0, free slip (no shear along the coast) 83 !! rn_shlat = 2, no slip (specified zero velocity at the coast) 84 !! 0 < rn_shlat < 2, partial slip | non-linear velocity profile 85 !! 2 < rn_shlat, strong slip | in the lateral boundary layer 85 86 !! 86 87 !! N.B. If nperio not equal to 0, the land/ocean mask arrays … … 106 107 !! vmask : land/ocean mask at v-point (=0. or 1.) 107 108 !! fmask : land/ocean mask at f-point (=0. or 1.) 108 !! = shlat along lateral boundaries109 !! =rn_shlat along lateral boundaries 109 110 !! bmask : land/ocean mask at barotropic stream 110 111 !! function point (=0. or 1.) and set to 0 along lateral boundaries … … 114 115 INTEGER :: iif, iil, ii0, ii1, ii 115 116 INTEGER :: ijf, ijl, ij0, ij1 116 INTEGER , DIMENSION(jpi,jpj) :: imsk117 INTEGER , DIMENSION(jpi,jpj) :: imsk 117 118 REAL(wp), DIMENSION(jpi,jpj) :: zwf 118 119 NAMELIST/namlbc/ shlat119 !! 120 NAMELIST/namlbc/ rn_shlat 120 121 !!--------------------------------------------------------------------- 121 122 … … 128 129 WRITE(numout,*) '~~~~~~' 129 130 WRITE(numout,*) ' Namelist namlbc' 130 WRITE(numout,*) ' lateral momentum boundary cond. shlat = ',shlat131 ENDIF 132 133 IF ( shlat == 0. ) THEN ; IF(lwp) WRITE(numout,*) 'ocean lateral free-slip '134 ELSEIF ( shlat == 2. ) THEN ; IF(lwp) WRITE(numout,*) 'ocean lateral no-slip '135 ELSEIF ( 0. < shlat .AND. shlat < 2. ) THEN ; IF(lwp) WRITE(numout,*) 'ocean lateral partial-slip '136 ELSEIF ( 2. < shlat ) THEN ; IF(lwp) WRITE(numout,*) 'ocean lateral strong-slip '137 138 WRITE(ctmp1,*) ' shlat is negative = ',shlat139 131 WRITE(numout,*) ' lateral momentum boundary cond. rn_shlat = ',rn_shlat 132 ENDIF 133 134 IF ( rn_shlat == 0. ) THEN ; IF(lwp) WRITE(numout,*) ' ocean lateral free-slip ' 135 ELSEIF ( rn_shlat == 2. ) THEN ; IF(lwp) WRITE(numout,*) ' ocean lateral no-slip ' 136 ELSEIF ( 0. < rn_shlat .AND. rn_shlat < 2. ) THEN ; IF(lwp) WRITE(numout,*) ' ocean lateral partial-slip ' 137 ELSEIF ( 2. < rn_shlat ) THEN ; IF(lwp) WRITE(numout,*) ' ocean lateral strong-slip ' 138 ELSE 139 WRITE(ctmp1,*) ' rn_shlat is negative = ', rn_shlat 140 CALL ctl_stop( ctmp1 ) 140 141 ENDIF 141 142 … … 148 149 DO jj = 1, jpj 149 150 DO ji = 1, jpi 150 IF( REAL( mbathy(ji,jj) - jk ) +.1 >= 0.e0 ) tmask(ji,jj,jk) = 1.e0151 IF( REAL( mbathy(ji,jj) - jk ) +.1 >= 0.e0 ) tmask(ji,jj,jk) = 1.e0 151 152 END DO 152 153 END DO … … 155 156 !!gm ???? 156 157 #if defined key_zdfkpp 157 IF( cp_cfg == 'orca' ) THEN 158 IF( jp_cfg == 2 ) THEN 159 ! land point on Bab el Mandeb zonal section 158 IF( cp_cfg == 'orca' ) THEN 159 IF( jp_cfg == 2 ) THEN ! land point on Bab el Mandeb zonal section 160 160 ij0 = 87 ; ij1 = 88 161 161 ii0 = 160 ; ii1 = 161 … … 283 283 DO ji = fs_2, fs_jpim1 ! vector opt. 284 284 IF( fmask(ji,jj,jk) == 0. ) THEN 285 fmask(ji,jj,jk) = shlat * MIN( 1., MAX( zwf(ji+1,jj), zwf(ji,jj+1), &286 & zwf(ji-1,jj), zwf(ji,jj-1) ) )285 fmask(ji,jj,jk) = rn_shlat * MIN( 1., MAX( zwf(ji+1,jj), zwf(ji,jj+1), & 286 & zwf(ji-1,jj), zwf(ji,jj-1) ) ) 287 287 ENDIF 288 288 END DO … … 290 290 DO jj = 2, jpjm1 291 291 IF( fmask(1,jj,jk) == 0. ) THEN 292 fmask(1 ,jj,jk) = shlat * MIN( 1., MAX( zwf(2,jj), zwf(1,jj+1), zwf(1,jj-1) ) )292 fmask(1 ,jj,jk) = rn_shlat * MIN( 1., MAX( zwf(2,jj), zwf(1,jj+1), zwf(1,jj-1) ) ) 293 293 ENDIF 294 294 IF( fmask(jpi,jj,jk) == 0. ) THEN 295 fmask(jpi,jj,jk) = shlat * MIN( 1., MAX( zwf(jpi,jj+1), zwf(jpim1,jj), zwf(jpi,jj-1) ) )295 fmask(jpi,jj,jk) = rn_shlat * MIN( 1., MAX( zwf(jpi,jj+1), zwf(jpim1,jj), zwf(jpi,jj-1) ) ) 296 296 ENDIF 297 297 END DO 298 298 DO ji = 2, jpim1 299 299 IF( fmask(ji,1,jk) == 0. ) THEN 300 fmask(ji, 1 ,jk) = shlat * MIN( 1., MAX( zwf(ji+1,1), zwf(ji,2), zwf(ji-1,1) ) )300 fmask(ji, 1 ,jk) = rn_shlat * MIN( 1., MAX( zwf(ji+1,1), zwf(ji,2), zwf(ji-1,1) ) ) 301 301 ENDIF 302 302 IF( fmask(ji,jpj,jk) == 0. ) THEN 303 fmask(ji,jpj,jk) = shlat * MIN( 1., MAX( zwf(ji+1,jpj), zwf(ji-1,jpj), zwf(ji,jpjm1) ) )303 fmask(ji,jpj,jk) = rn_shlat * MIN( 1., MAX( zwf(ji+1,jpj), zwf(ji-1,jpj), zwf(ji,jpjm1) ) ) 304 304 ENDIF 305 305 END DO -
trunk/NEMO/OPA_SRC/DOM/domzgr.F90
r1577 r1601 42 42 43 43 !!gm DOCTOR name for the namelist parameter... 44 ! !!! ** Namelist nam_zgr_sco ** 45 REAL(wp) :: sbot_min = 300. ! minimum depth of s-bottom surface (>0) (m) 46 REAL(wp) :: sbot_max = 5250. ! maximum depth of s-bottom surface (= ocean depth) (>0) (m) 47 REAL(wp) :: theta = 6.0 ! surface control parameter (0<=theta<=20) 48 REAL(wp) :: thetb = 0.75 ! bottom control parameter (0<=thetb<= 1) 49 REAL(wp) :: r_max = 0.15 ! maximum cut-off r-value allowed (0<r_max<1) 44 ! !!! ** Namelist namzgr_sco ** 45 REAL(wp) :: rn_sbot_min = 300. ! minimum depth of s-bottom surface (>0) (m) 46 REAL(wp) :: rn_sbot_max = 5250. ! maximum depth of s-bottom surface (= ocean depth) (>0) (m) 47 REAL(wp) :: rn_theta = 6.0 ! surface control parameter (0<=rn_theta<=20) 48 REAL(wp) :: rn_thetb = 0.75 ! bottom control parameter (0<=rn_thetb<= 1) 49 REAL(wp) :: rn_rmax = 0.15 ! maximum cut-off r-value allowed (0<rn_rmax<1) 50 LOGICAL :: ln_s_sigma = .false. ! use hybrid s-sigma -coordinate & stretching function fssig1 (ln_sco=T) 51 REAL(wp) :: rn_bb = 0.8 ! stretching parameter for song and haidvogel stretching 52 ! ! ( rn_bb=0; top only, rn_bb =1; top and bottom) 53 REAL(wp) :: rn_hc = 150. ! Critical depth for s-sigma coordinates 50 54 51 55 !! * Substitutions … … 79 83 INTEGER :: ioptio = 0 ! temporary integer 80 84 !! 81 NAMELIST/nam _zgr/ ln_zco, ln_zps, ln_sco82 !!---------------------------------------------------------------------- 83 84 REWIND ( numnam ) ! Read Namelist nam _zgr : vertical coordinate'85 READ ( numnam, nam _zgr )85 NAMELIST/namzgr/ ln_zco, ln_zps, ln_sco 86 !!---------------------------------------------------------------------- 87 88 REWIND ( numnam ) ! Read Namelist namzgr : vertical coordinate' 89 READ ( numnam, namzgr ) 86 90 87 91 IF(lwp) THEN ! Control print … … 89 93 WRITE(numout,*) 'dom_zgr : vertical coordinate' 90 94 WRITE(numout,*) '~~~~~~~' 91 WRITE(numout,*) ' Namelist nam _zgr : set vertical coordinate'95 WRITE(numout,*) ' Namelist namzgr : set vertical coordinate' 92 96 WRITE(numout,*) ' z-coordinate - full steps ln_zco = ', ln_zco 93 97 WRITE(numout,*) ' z-coordinate - partial steps ln_zps = ', ln_zps … … 232 236 ENDIF 233 237 238 !!gm BUG in s-coordinate this does not work! 234 239 ! deepest/shallowest W level Above/Bellow ~10m 235 240 zrefdep = 10. - ( 0.1*MINVAL(e3w_0) ) ! ref. depth with tolerance (10% of minimum layer thickness) 236 241 nlb10 = MINLOC( gdepw_0, mask = gdepw_0 > zrefdep, dim = 1 ) ! shallowest W level Bellow ~10m 237 242 nla10 = nlb10 - 1 ! deepest W level Above ~10m 243 !!gm end bug 238 244 239 245 IF(lwp) THEN ! control print … … 1001 1007 !!---------------------------------------------------------------------- 1002 1008 ! 1003 pf = ( TANH( theta * ( -(pk-0.5) / REAL(jpkm1) +thetb ) ) &1004 & - TANH( thetb *theta ) ) &1005 & * ( COSH( theta ) &1006 & + COSH( theta * ( 2.e0 *thetb - 1.e0 ) ) ) &1007 & / ( 2.e0 * SINH( theta ) )1009 pf = ( TANH( rn_theta * ( -(pk-0.5) / REAL(jpkm1) + rn_thetb ) ) & 1010 & - TANH( rn_thetb * rn_theta ) ) & 1011 & * ( COSH( rn_theta ) & 1012 & + COSH( rn_theta * ( 2.e0 * rn_thetb - 1.e0 ) ) ) & 1013 & / ( 2.e0 * SINH( rn_theta ) ) 1008 1014 ! 1009 1015 END FUNCTION fssig 1010 1016 1011 1017 1012 FUNCTION fssig1( pk1, bb ) RESULT( pf1 )1018 FUNCTION fssig1( pk1, pbb ) RESULT( pf1 ) 1013 1019 !!---------------------------------------------------------------------- 1014 1020 !! *** ROUTINE eos_init *** … … 1024 1030 !!---------------------------------------------------------------------- 1025 1031 REAL(wp), INTENT(in ) :: pk1 ! continuous "k" coordinate 1026 REAL(wp), INTENT(in ) :: bb! Stretching coefficient1032 REAL(wp), INTENT(in ) :: pbb ! Stretching coefficient 1027 1033 REAL(wp) :: pf1 ! sigma value 1028 1034 !!---------------------------------------------------------------------- 1029 1035 ! 1030 IF ( theta == 0 ) then ! uniform sigma1036 IF ( rn_theta == 0 ) then ! uniform sigma 1031 1037 pf1 = -(pk1-0.5) / REAL( jpkm1 ) 1032 1038 ELSE ! stretched sigma 1033 pf1 = (1.0- bb) * (sinh( theta*(-(pk1-0.5)/REAL(jpkm1)) ) ) / sinh(theta) + &1034 & bb * ( (tanh( theta*( (-(pk1-0.5)/REAL(jpkm1)) + 0.5) ) - tanh(0.5*theta) ) / &1035 & (2*tanh(0.5* theta) ) )1039 pf1 = (1.0-pbb) * (sinh( rn_theta*(-(pk1-0.5)/REAL(jpkm1)) ) ) / sinh(rn_theta) + & 1040 & pbb * ( (tanh( rn_theta*( (-(pk1-0.5)/REAL(jpkm1)) + 0.5) ) - tanh(0.5*rn_theta) ) / & 1041 & (2*tanh(0.5*rn_theta) ) ) 1036 1042 ENDIF 1037 1043 ! … … 1077 1083 REAL(wp), DIMENSION(jpi,jpj) :: zri , zrj , zhbat ! - - 1078 1084 !! 1079 LOGICAL :: ln_s_sigma = .false. !use hybrid s_sigma coordinates & stretching function fssig1,used with ln_sco = .true.1080 REAL(wp) :: bb = 0.8 ! stretching parameter for song and haidvogel stretching, bb=0; top only, bb =1; top and bottom1081 REAL(wp) :: hc = 150 ! Critical depth for s-sigma coordinates1082 1085 !!gm never do that !!!! ==> Pb at compilation phase on several computer 1083 1086 REAL(wp), DIMENSION(jpi,jpj,jpk) :: gsigw3 = 0.0d0 … … 1093 1096 !!gm end 1094 1097 !! 1095 NAMELIST/nam _zgr_sco/ sbot_max, sbot_min, theta, thetb, r_max, ln_s_sigma, bb,hc1096 !!---------------------------------------------------------------------- 1097 1098 REWIND( numnam ) ! Read Namelist nam _zgr_sco : sigma-stretching parameters1099 READ ( numnam, nam _zgr_sco )1098 NAMELIST/namzgr_sco/ rn_sbot_max, rn_sbot_min, rn_theta, rn_thetb, rn_rmax, ln_s_sigma, rn_bb, rn_hc 1099 !!---------------------------------------------------------------------- 1100 1101 REWIND( numnam ) ! Read Namelist namzgr_sco : sigma-stretching parameters 1102 READ ( numnam, namzgr_sco ) 1100 1103 1101 1104 IF(lwp) THEN ! control print … … 1103 1106 WRITE(numout,*) 'dom:zgr_sco : s-coordinate or hybrid z-s-coordinate' 1104 1107 WRITE(numout,*) '~~~~~~~~~~~' 1105 WRITE(numout,*) ' Namelist nam_zgr_sco' 1106 WRITE(numout,*) ' sigma-stretching coeffs ' 1107 WRITE(numout,*) ' maximum depth of s-bottom surface (>0) sbot_max = ' ,sbot_max 1108 WRITE(numout,*) ' minimum depth of s-bottom surface (>0) sbot_min = ' ,sbot_min 1109 WRITE(numout,*) ' surface control parameter (0<=theta<=20) theta = ', theta 1110 WRITE(numout,*) ' bottom control parameter (0<=thetb<= 1) thetb = ', thetb 1111 WRITE(numout,*) ' maximum cut-off r-value allowed r_max = ' , r_max 1112 WRITE(numout,*) ' Critical depth hc = ', hc 1113 WRITE(numout,*) ' Hybrid s-sigma-coordinate ln_s_sigma = ', ln_s_sigma 1114 ENDIF 1115 1116 hift(:,:) = sbot_min ! set the minimum depth for the s-coordinate 1117 hifu(:,:) = sbot_min 1118 hifv(:,:) = sbot_min 1119 hiff(:,:) = sbot_min 1108 WRITE(numout,*) ' Namelist namzgr_sco' 1109 WRITE(numout,*) ' sigma-stretching coeffs ' 1110 WRITE(numout,*) ' maximum depth of s-bottom surface (>0) rn_sbot_max = ' ,rn_sbot_max 1111 WRITE(numout,*) ' minimum depth of s-bottom surface (>0) rn_sbot_min = ' ,rn_sbot_min 1112 WRITE(numout,*) ' surface control parameter (0<=rn_theta<=20) rn_theta = ', rn_theta 1113 WRITE(numout,*) ' bottom control parameter (0<=rn_thetb<= 1) rn_thetb = ', rn_thetb 1114 WRITE(numout,*) ' maximum cut-off r-value allowed rn_rmax = ', rn_rmax 1115 WRITE(numout,*) ' Hybrid s-sigma-coordinate ln_s_sigma = ', ln_s_sigma 1116 WRITE(numout,*) ' stretching parameter (song and haidvogel) rn_bb = ', rn_bb 1117 WRITE(numout,*) ' Critical depth rn_hc = ', rn_hc 1118 ENDIF 1119 1120 hift(:,:) = rn_sbot_min ! set the minimum depth for the s-coordinate 1121 hifu(:,:) = rn_sbot_min 1122 hifv(:,:) = rn_sbot_min 1123 hiff(:,:) = rn_sbot_min 1120 1124 1121 1125 ! ! set maximum ocean depth 1122 bathy(:,:) = MIN( sbot_max, bathy(:,:) )1126 bathy(:,:) = MIN( rn_sbot_max, bathy(:,:) ) 1123 1127 1124 1128 DO jj = 1, jpj 1125 1129 DO ji = 1, jpi 1126 1130 IF (bathy(ji,jj) .gt. 0.0) THEN 1127 bathy(ji,jj) = MAX( sbot_min, bathy(ji,jj) )1131 bathy(ji,jj) = MAX( rn_sbot_min, bathy(ji,jj) ) 1128 1132 ENDIF 1129 1133 END DO … … 1139 1143 DO jj = 1, jpj 1140 1144 DO ji = 1, jpi 1141 zenv(ji,jj) = MAX( bathy(ji,jj), sbot_min )1145 zenv(ji,jj) = MAX( bathy(ji,jj), rn_sbot_min ) 1142 1146 END DO 1143 1147 END DO … … 1145 1149 zrmax = 1.e0 1146 1150 ! ! ================ ! 1147 DO WHILE ( jl <= 10000 .AND. zrmax > r _max ) ! Iterative loop !1151 DO WHILE ( jl <= 10000 .AND. zrmax > rn_rmax ) ! Iterative loop ! 1148 1152 ! ! ================ ! 1149 1153 jl = jl + 1 … … 1157 1161 zrj(ji,jj) = ABS( zenv(ji ,ijp1) - zenv(ji,jj) ) / ( zenv(ji ,ijp1) + zenv(ji,jj) ) 1158 1162 zrmax = MAX( zrmax, zri(ji,jj), zrj(ji,jj) ) 1159 IF( zri(ji,jj) > r _max ) zmsk(ji ,jj ) = 1.01160 IF( zri(ji,jj) > r _max ) zmsk(iip1,jj ) = 1.01161 IF( zrj(ji,jj) > r _max ) zmsk(ji ,jj ) = 1.01162 IF( zrj(ji,jj) > r _max ) zmsk(ji ,ijp1) = 1.01163 IF( zri(ji,jj) > rn_rmax ) zmsk(ji ,jj ) = 1.0 1164 IF( zri(ji,jj) > rn_rmax ) zmsk(iip1,jj ) = 1.0 1165 IF( zrj(ji,jj) > rn_rmax ) zmsk(ji ,jj ) = 1.0 1166 IF( zrj(ji,jj) > rn_rmax ) zmsk(ji ,ijp1) = 1.0 1163 1167 END DO 1164 1168 END DO … … 1218 1222 DO ji = 1, jpi 1219 1223 ztaper = EXP( -(gphit(ji,jj)/8)**2 ) 1220 hbatt(ji,jj) = sbot_max * ztaper + hbatt(ji,jj) * (1.-ztaper)1224 hbatt(ji,jj) = rn_sbot_max * ztaper + hbatt(ji,jj) * (1.-ztaper) 1221 1225 END DO 1222 1226 END DO … … 1239 1243 IF(lwp) THEN 1240 1244 WRITE(numout,*) 1241 WRITE(numout,*) ' zgr_sco: minimum depth of the envelop topography set to : ', sbot_min1242 ENDIF 1243 hbatu(:,:) = sbot_min1244 hbatv(:,:) = sbot_min1245 hbatf(:,:) = sbot_min1245 WRITE(numout,*) ' zgr_sco: minimum depth of the envelop topography set to : ', rn_sbot_min 1246 ENDIF 1247 hbatu(:,:) = rn_sbot_min 1248 hbatv(:,:) = rn_sbot_min 1249 hbatf(:,:) = rn_sbot_min 1246 1250 DO jj = 1, jpjm1 1247 1251 DO ji = 1, jpim1 … … 1259 1263 DO ji = 1, jpi 1260 1264 IF( hbatu(ji,jj) == 0.e0 ) THEN 1261 IF( zhbat(ji,jj) == 0.e0 ) hbatu(ji,jj) = sbot_min1265 IF( zhbat(ji,jj) == 0.e0 ) hbatu(ji,jj) = rn_sbot_min 1262 1266 IF( zhbat(ji,jj) /= 0.e0 ) hbatu(ji,jj) = zhbat(ji,jj) 1263 1267 ENDIF … … 1268 1272 DO ji = 1, jpi 1269 1273 IF( hbatv(ji,jj) == 0.e0 ) THEN 1270 IF( zhbat(ji,jj) == 0.e0 ) hbatv(ji,jj) = sbot_min1274 IF( zhbat(ji,jj) == 0.e0 ) hbatv(ji,jj) = rn_sbot_min 1271 1275 IF( zhbat(ji,jj) /= 0.e0 ) hbatv(ji,jj) = zhbat(ji,jj) 1272 1276 ENDIF … … 1277 1281 DO ji = 1, jpi 1278 1282 IF( hbatf(ji,jj) == 0.e0 ) THEN 1279 IF( zhbat(ji,jj) == 0.e0 ) hbatf(ji,jj) = sbot_min1283 IF( zhbat(ji,jj) == 0.e0 ) hbatf(ji,jj) = rn_sbot_min 1280 1284 IF( zhbat(ji,jj) /= 0.e0 ) hbatf(ji,jj) = zhbat(ji,jj) 1281 1285 ENDIF … … 1307 1311 ! non-dimensional "sigma" for model level depth at w- and t-levels 1308 1312 1309 IF ( ln_s_sigma ) THEN !Song and Haidvogel style stretched sigma for depths below hc, with uniform sigma in shallower waters1310 1311 DO ji =1,jpi1312 DO jj=1,jpj1313 1314 IF (hbatt(ji,jj).GT. hc) THEN !deep water, stretched sigma1313 IF( ln_s_sigma ) THEN ! Song and Haidvogel style stretched sigma for depths 1314 ! ! below rn_hc, with uniform sigma in shallower waters 1315 DO ji = 1, jpi 1316 DO jj = 1, jpj 1317 1318 IF (hbatt(ji,jj).GT.rn_hc) THEN !deep water, stretched sigma 1315 1319 DO jk = 1, jpk 1316 gsigw3(ji,jj,jk) = -fssig1( REAL(jk,wp)-0.5_wp, bb )1317 gsigt3(ji,jj,jk) = -fssig1( REAL(jk,wp) , bb )1320 gsigw3(ji,jj,jk) = -fssig1( REAL(jk,wp)-0.5_wp, rn_bb ) 1321 gsigt3(ji,jj,jk) = -fssig1( REAL(jk,wp) , rn_bb ) 1318 1322 END DO 1319 1323 ELSE ! shallow water, uniform sigma … … 1342 1346 zcoeft = ( REAL(jk,wp) - 0.5 ) / REAL(jpkm1,wp) 1343 1347 zcoefw = ( REAL(jk,wp) - 1.0 ) / REAL(jpkm1,wp) 1344 gdept (ji,jj,jk) = (scosrf(ji,jj)+(hbatt(ji,jj)- hc)*gsigt3(ji,jj,jk)+hc*zcoeft)1345 gdepw (ji,jj,jk) = (scosrf(ji,jj)+(hbatt(ji,jj)- hc)*gsigw3(ji,jj,jk)+hc*zcoefw)1346 gdep3w(ji,jj,jk) = (scosrf(ji,jj)+(hbatt(ji,jj)- hc)*gsi3w3(ji,jj,jk)+hc*zcoefw)1348 gdept (ji,jj,jk) = (scosrf(ji,jj)+(hbatt(ji,jj)-rn_hc)*gsigt3(ji,jj,jk)+rn_hc*zcoeft) 1349 gdepw (ji,jj,jk) = (scosrf(ji,jj)+(hbatt(ji,jj)-rn_hc)*gsigw3(ji,jj,jk)+rn_hc*zcoefw) 1350 gdep3w(ji,jj,jk) = (scosrf(ji,jj)+(hbatt(ji,jj)-rn_hc)*gsi3w3(ji,jj,jk)+rn_hc*zcoefw) 1347 1351 END DO 1348 1352 … … 1367 1371 ( hbatt(ji,jj)+hbatt(ji,jj+1) ) 1368 1372 1369 e3t(ji,jj,jk)=((hbatt(ji,jj)- hc)*esigt3(ji,jj,jk) +hc/FLOAT(jpkm1))1370 e3u(ji,jj,jk)=((hbatu(ji,jj)- hc)*esigtu3(ji,jj,jk) +hc/FLOAT(jpkm1))1371 e3v(ji,jj,jk)=((hbatv(ji,jj)- hc)*esigtv3(ji,jj,jk) +hc/FLOAT(jpkm1))1372 e3f(ji,jj,jk)=((hbatf(ji,jj)- hc)*esigtf3(ji,jj,jk) +hc/FLOAT(jpkm1))1373 e3t(ji,jj,jk)=((hbatt(ji,jj)-rn_hc)*esigt3(ji,jj,jk) + rn_hc/FLOAT(jpkm1)) 1374 e3u(ji,jj,jk)=((hbatu(ji,jj)-rn_hc)*esigtu3(ji,jj,jk) + rn_hc/FLOAT(jpkm1)) 1375 e3v(ji,jj,jk)=((hbatv(ji,jj)-rn_hc)*esigtv3(ji,jj,jk) + rn_hc/FLOAT(jpkm1)) 1376 e3f(ji,jj,jk)=((hbatf(ji,jj)-rn_hc)*esigtf3(ji,jj,jk) + rn_hc/FLOAT(jpkm1)) 1373 1377 ! 1374 e3w (ji,jj,jk)=((hbatt(ji,jj)- hc)*esigw3(ji,jj,jk) +hc/FLOAT(jpkm1))1375 e3uw(ji,jj,jk)=((hbatu(ji,jj)- hc)*esigwu3(ji,jj,jk) +hc/FLOAT(jpkm1))1376 e3vw(ji,jj,jk)=((hbatv(ji,jj)- hc)*esigwv3(ji,jj,jk) +hc/FLOAT(jpkm1))1378 e3w (ji,jj,jk)=((hbatt(ji,jj)-rn_hc)*esigw3(ji,jj,jk) + rn_hc/FLOAT(jpkm1)) 1379 e3uw(ji,jj,jk)=((hbatu(ji,jj)-rn_hc)*esigwu3(ji,jj,jk) + rn_hc/FLOAT(jpkm1)) 1380 e3vw(ji,jj,jk)=((hbatv(ji,jj)-rn_hc)*esigwv3(ji,jj,jk) + rn_hc/FLOAT(jpkm1)) 1377 1381 END DO 1378 1382 -
trunk/NEMO/OPA_SRC/DYN/dynadv.F90
r1152 r1601 86 86 INTEGER :: ioptio 87 87 88 NAMELIST/nam _dynadv/ ln_dynadv_vec, ln_dynadv_cen2 , ln_dynadv_ubs88 NAMELIST/namdyn_adv/ ln_dynadv_vec, ln_dynadv_cen2 , ln_dynadv_ubs 89 89 !!---------------------------------------------------------------------- 90 90 91 REWIND ( numnam ) ! Read Namelist nam _dynadv : momentum advection scheme92 READ ( numnam, nam _dynadv )91 REWIND ( numnam ) ! Read Namelist namdyn_adv : momentum advection scheme 92 READ ( numnam, namdyn_adv ) 93 93 94 94 IF(lwp) THEN ! Namelist print … … 96 96 WRITE(numout,*) 'dyn_adv_ctl : choice/control of the momentum advection scheme' 97 97 WRITE(numout,*) '~~~~~~~~~~~' 98 WRITE(numout,*) ' Namelist nam _dynadv : chose a advection formulation & scheme for momentum'98 WRITE(numout,*) ' Namelist namdyn_adv : chose a advection formulation & scheme for momentum' 99 99 WRITE(numout,*) ' Vector/flux form (T/F) ln_dynadv_vec = ', ln_dynadv_vec 100 100 WRITE(numout,*) ' 2nd order centred advection scheme ln_dynadv_cen2 = ', ln_dynadv_cen2 … … 108 108 IF( lk_esopa ) ioptio = 1 109 109 110 IF( ioptio /= 1 ) CALL ctl_stop( 'Choose ONE advection scheme in namelist nam _dynadv' )110 IF( ioptio /= 1 ) CALL ctl_stop( 'Choose ONE advection scheme in namelist namdyn_adv' ) 111 111 112 112 ! ! Set nadv -
trunk/NEMO/OPA_SRC/DYN/dynhpg.F90
r1152 r1601 41 41 PUBLIC dyn_hpg ! routine called by step module 42 42 43 !!* Namelist nam_dynhpg : Choice of horizontal pressure gradient computation 44 LOGICAL :: ln_hpg_zco = .TRUE. ! z-coordinate - full steps 45 LOGICAL :: ln_hpg_zps = .FALSE. ! z-coordinate - partial steps (interpolation) 46 LOGICAL :: ln_hpg_sco = .FALSE. ! s-coordinate (standard jacobian formulation) 47 LOGICAL :: ln_hpg_hel = .FALSE. ! s-coordinate (helsinki modification) 48 LOGICAL :: ln_hpg_wdj = .FALSE. ! s-coordinate (weighted density jacobian) 49 LOGICAL :: ln_hpg_djc = .FALSE. ! s-coordinate (Density Jacobian with Cubic polynomial) 50 LOGICAL :: ln_hpg_rot = .FALSE. ! s-coordinate (ROTated axes scheme) 51 REAL(wp) :: gamm = 0.e0 ! weighting coefficient 52 53 INTEGER :: nhpg = 0 ! = 0 to 6, type of pressure gradient scheme used 54 ! ! (deduced from ln_hpg_... flags) 43 ! !!* Namelist namdyn_hpg : hydrostatic pressure gradient 44 LOGICAL , PUBLIC :: ln_hpg_zco = .TRUE. !: z-coordinate - full steps 45 LOGICAL , PUBLIC :: ln_hpg_zps = .FALSE. !: z-coordinate - partial steps (interpolation) 46 LOGICAL , PUBLIC :: ln_hpg_sco = .FALSE. !: s-coordinate (standard jacobian formulation) 47 LOGICAL , PUBLIC :: ln_hpg_hel = .FALSE. !: s-coordinate (helsinki modification) 48 LOGICAL , PUBLIC :: ln_hpg_wdj = .FALSE. !: s-coordinate (weighted density jacobian) 49 LOGICAL , PUBLIC :: ln_hpg_djc = .FALSE. !: s-coordinate (Density Jacobian with Cubic polynomial) 50 LOGICAL , PUBLIC :: ln_hpg_rot = .FALSE. !: s-coordinate (ROTated axes scheme) 51 REAL(wp), PUBLIC :: rn_gamma = 0.e0 !: weighting coefficient 52 LOGICAL , PUBLIC :: ln_dynhpg_imp = .FALSE. !: semi-implicite hpg flag 53 INTEGER , PUBLIC :: nn_dynhpg_rst = 0 !: add dynhpg implicit variables in restart ot not 54 55 INTEGER :: nhpg = 0 ! = 0 to 6, type of pressure gradient scheme used ! (deduced from ln_hpg_... flags) 55 56 56 57 !! * Substitutions … … 116 117 !! computation and consistency control 117 118 !! 118 !! ** Action : Read the namelist namdyn hpg and check the consistency119 !! ** Action : Read the namelist namdyn_hpg and check the consistency 119 120 !! with the type of vertical coordinate used (zco, zps, sco) 120 121 !!---------------------------------------------------------------------- 121 122 INTEGER :: ioptio = 0 ! temporary integer 122 123 NAMELIST/nam_dynhpg/ ln_hpg_zco, ln_hpg_zps, ln_hpg_sco, ln_hpg_hel, & 124 & ln_hpg_wdj, ln_hpg_djc, ln_hpg_rot, gamm 125 !!---------------------------------------------------------------------- 126 127 REWIND ( numnam ) ! Read Namelist nam_dynhpg : pressure gradient calculation options 128 READ ( numnam, nam_dynhpg ) 123 !! 124 ! NAMELIST/namdyn_hpg/ ln_hpg_zco , ln_hpg_zps , ln_hpg_sco, ln_hpg_hel, & 125 ! & ln_hpg_wdj , ln_hpg_djc , ln_hpg_rot, rn_gamma , & 126 ! & ln_dynhpg_imp, nn_dynhpg_rst 127 !!---------------------------------------------------------------------- 128 129 ! REWIND ( numnam ) ! Namelist namdyn_hpg : already read in opa.F90 module 130 ! READ ( numnam, namdyn_hpg ) 129 131 130 132 IF(lwp) THEN ! Control print 131 133 WRITE(numout,*) 132 WRITE(numout,*) 'dyn:hpg_ctl : hydrostatic pressure gradient control' 133 WRITE(numout,*) '~~~~~~~~~~~' 134 WRITE(numout,*) ' Namelist nam_dynhpg : choice of hpg scheme' 135 WRITE(numout,*) ' z-coord. - full steps ln_hpg_zco = ', ln_hpg_zco 136 WRITE(numout,*) ' z-coord. - partial steps (interpolation) ln_hpg_zps = ', ln_hpg_zps 137 WRITE(numout,*) ' s-coord. (standard jacobian formulation) ln_hpg_sco = ', ln_hpg_sco 138 WRITE(numout,*) ' s-coord. (helsinki modification) ln_hpg_hel = ', ln_hpg_hel 139 WRITE(numout,*) ' s-coord. (weighted density jacobian) ln_hpg_wdj = ', ln_hpg_wdj 140 WRITE(numout,*) ' s-coord. (Density Jacobian: Cubic polynomial) ln_hpg_djc = ', ln_hpg_djc 141 WRITE(numout,*) ' s-coord. (ROTated axes scheme) ln_hpg_rot = ', ln_hpg_rot 142 WRITE(numout,*) ' weighting coeff. (wdj scheme) gamm = ', gamm 134 WRITE(numout,*) 'dyn_hpg : hydrostatic pressure gradient' 135 WRITE(numout,*) '~~~~~~~' 136 WRITE(numout,*) ' Namelist namdyn_hpg : choice of hpg scheme' 137 WRITE(numout,*) ' z-coord. - full steps ln_hpg_zco = ', ln_hpg_zco 138 WRITE(numout,*) ' z-coord. - partial steps (interpolation) ln_hpg_zps = ', ln_hpg_zps 139 WRITE(numout,*) ' s-coord. (standard jacobian formulation) ln_hpg_sco = ', ln_hpg_sco 140 WRITE(numout,*) ' s-coord. (helsinki modification) ln_hpg_hel = ', ln_hpg_hel 141 WRITE(numout,*) ' s-coord. (weighted density jacobian) ln_hpg_wdj = ', ln_hpg_wdj 142 WRITE(numout,*) ' s-coord. (Density Jacobian: Cubic polynomial) ln_hpg_djc = ', ln_hpg_djc 143 WRITE(numout,*) ' s-coord. (ROTated axes scheme) ln_hpg_rot = ', ln_hpg_rot 144 WRITE(numout,*) ' weighting coeff. (wdj scheme) rn_gamma = ', rn_gamma 145 WRITE(numout,*) ' time stepping: centered (F) or semi-implicit (T) ln_dynhpg_imp = ', ln_dynhpg_imp 146 WRITE(numout,*) ' add in restart dynhpg semi-implicit variable nn_dynhpg_rst = ', nn_dynhpg_rst 143 147 ENDIF 148 149 IF( .NOT. ln_dynhpg_imp ) nn_dynhpg_rst = 0 ! force no adding dynhpg implicit variables in restart 144 150 145 151 IF( lk_vvl .AND. .NOT. ln_hpg_sco ) THEN … … 517 523 !! 518 524 !! ** Method : Weighted Density Jacobian (wdj) scheme (song 1998) 519 !! The weighting coefficients from the namelist parameter gamm520 !! (alpha=0.5- gamm ; beta=1-alpha=0.5+gamm)525 !! The weighting coefficients from the namelist parameter rn_gamma 526 !! (alpha=0.5-rn_gamma ; beta=1-alpha=0.5+rn_gamma 521 527 !! 522 528 !! Reference : Song, Mon. Wea. Rev., 126, 3213-3230, 1998. … … 540 546 ! Local constant initialization 541 547 zcoef0 = - grav * 0.5 542 zalph = 0.5 - gamm ! weighting coefficients (alpha=0.5-gamm)543 zbeta = 0.5 + gamm ! (beta =1-alpha=0.5+gamm)548 zalph = 0.5 - rn_gamma ! weighting coefficients (alpha=0.5-rn_gamma 549 zbeta = 0.5 + rn_gamma ! (beta =1-alpha=0.5+rn_gamma 544 550 545 551 ! Surface value (no ponderation) -
trunk/NEMO/OPA_SRC/DYN/dynspg_flt.F90
r1556 r1601 18 18 !! 'key_dynspg_flt' filtered free surface 19 19 !!---------------------------------------------------------------------- 20 !! dyn_spg_flt : update the momentum trend with the surface pressure 21 !! gradient in the filtered free surface case with 22 !! vector optimization 20 !! dyn_spg_flt : update the momentum trend with the surface pressure gradient in the filtered free surface case 23 21 !! flt_rst : read/write the time-splitting restart fields in the ocean restart file 24 22 !!---------------------------------------------------------------------- … … 31 29 USE phycst ! physical constants 32 30 USE domvvl ! variable volume 31 USE solmat ! matrix construction for elliptic solvers 33 32 USE solver ! solver initialization 34 33 USE solpcg ! preconditionned conjugate gradient solver … … 44 43 USE lbclnk ! ocean lateral boundary conditions (or mpp link) 45 44 USE prtctl ! Print control 46 USE solmat ! matrix construction for elliptic solvers47 45 USE agrif_opa_interp 48 46 USE iom … … 76 74 !! ** Method : Filtered free surface formulation. The surface 77 75 !! pressure gradient is given by: 78 !! spgu = 1/rau0 d/dx(ps) = 1/e1u di( sshn + rnubtda )79 !! spgv = 1/rau0 d/dy(ps) = 1/e2v dj( sshn + rnubtda )76 !! spgu = 1/rau0 d/dx(ps) = 1/e1u di( sshn + btda ) 77 !! spgv = 1/rau0 d/dy(ps) = 1/e2v dj( sshn + btda ) 80 78 !! where sshn is the free surface elevation and btda is the after 81 79 !! time derivative of the free surface elevation … … 106 104 USE oce, ONLY : zvb => sa ! ta used as workspace 107 105 !! 108 INTEGER, INTENT( in ):: kt ! ocean time-step index109 INTEGER, INTENT( out) :: kindic ! solver convergence flag (<0 if not converge)106 INTEGER, INTENT(in ) :: kt ! ocean time-step index 107 INTEGER, INTENT( out) :: kindic ! solver convergence flag (<0 if not converge) 110 108 !! 111 INTEGER :: ji, jj, jk 112 REAL(wp) :: z2dt, z2dtg, zraur , znugdt! temporary scalars113 REAL(wp) :: z nurau, zgcb, zbtd ! " "114 REAL(wp) :: ztdgu, ztdgv ! " "109 INTEGER :: ji, jj, jk ! dummy loop indices 110 REAL(wp) :: z2dt, z2dtg, zraur ! temporary scalars 111 REAL(wp) :: zgcb, zbtd ! - - 112 REAL(wp) :: ztdgu, ztdgv ! - - 115 113 !!---------------------------------------------------------------------- 116 114 ! … … 127 125 ! read filtered free surface arrays in restart file 128 126 ! when using agrif, sshn, gcx have to be read in istate 129 IF (.NOT. lk_agrif) CALL flt_rst( nit000, 'READ' )! read or initialize the following fields:127 IF(.NOT. lk_agrif) CALL flt_rst( nit000, 'READ' ) ! read or initialize the following fields: 130 128 ! ! gcx, gcxb 131 129 ENDIF 132 130 133 131 ! Local constant initialization 134 z2dt = 2. * rdt ! time step: leap-frog135 IF( neuler == 0 .AND. kt == nit000 ) z2dt = rdt! time step: Euler if restart from rest136 IF( neuler == 0 .AND. kt == nit000+1 ) CALL sol_mat(kt)132 z2dt = 2. * rdt ! time step: leap-frog 133 IF( neuler == 0 .AND. kt == nit000 ) z2dt = rdt ! time step: Euler if restart from rest 134 IF( neuler == 0 .AND. kt == nit000+1 ) CALL sol_mat( kt ) 137 135 z2dtg = grav * z2dt 138 136 zraur = 1. / rauw 139 znugdt = rnu * grav * z2dt140 znurau = znugdt * zraur141 137 142 138 !! Explicit physics with thickness weighted updates … … 237 233 END DO 238 234 END DO 239 240 ! Boundary conditions on (spgu,spgv) 241 CALL lbc_lnk( spgu, 'U', -1. ) 235 CALL lbc_lnk( spgu, 'U', -1. ) ! lateral boundary conditions 242 236 CALL lbc_lnk( spgv, 'V', -1. ) 243 237 … … 245 239 246 240 ! Right hand side of the elliptic equation and first guess 247 ! -------------------------------------------------------- ---241 ! -------------------------------------------------------- 248 242 DO jj = 2, jpjm1 249 243 DO ji = fs_2, fs_jpim1 ! vector opt. … … 259 253 END DO 260 254 ! applied the lateral boundary conditions 261 IF( n solv == 2 .AND. MAX( jpr2di, jpr2dj ) > 0 )CALL lbc_lnk_e( gcb, c_solver_pt, 1. )255 IF( nn_solv == 2 .AND. MAX( jpr2di, jpr2dj ) > 0 ) CALL lbc_lnk_e( gcb, c_solver_pt, 1. ) 262 256 263 257 #if defined key_agrif … … 265 259 ! add contribution of gradient of after barotropic transport divergence 266 260 IF( nbondi == -1 .OR. nbondi == 2 ) gcb(3 ,:) = & 267 & gcb(3 ,:) - z nugdt* z2dt * laplacu(2 ,:) * gcdprc(3 ,:) * hu(2 ,:) * e2u(2 ,:)261 & gcb(3 ,:) - z2dtg * z2dt * laplacu(2 ,:) * gcdprc(3 ,:) * hu(2 ,:) * e2u(2 ,:) 268 262 IF( nbondi == 1 .OR. nbondi == 2 ) gcb(nlci-2,:) = & 269 & gcb(nlci-2,:) + z nugdt* z2dt * laplacu(nlci-2,:) * gcdprc(nlci-2,:) * hu(nlci-2,:) * e2u(nlci-2,:)263 & gcb(nlci-2,:) + z2dtg * z2dt * laplacu(nlci-2,:) * gcdprc(nlci-2,:) * hu(nlci-2,:) * e2u(nlci-2,:) 270 264 IF( nbondj == -1 .OR. nbondj == 2 ) gcb(: ,3) = & 271 & gcb(:,3 ) - z nugdt* z2dt * laplacv(:,2 ) * gcdprc(:,3 ) * hv(:,2 ) * e1v(:,2 )265 & gcb(:,3 ) - z2dtg * z2dt * laplacv(:,2 ) * gcdprc(:,3 ) * hv(:,2 ) * e1v(:,2 ) 272 266 IF( nbondj == 1 .OR. nbondj == 2 ) gcb(:,nlcj-2) = & 273 & gcb(:,nlcj-2) + z nugdt* z2dt * laplacv(:,nlcj-2) * gcdprc(:,nlcj-2) * hv(:,nlcj-2) * e1v(:,nlcj-2)267 & gcb(:,nlcj-2) + z2dtg * z2dt * laplacv(:,nlcj-2) * gcdprc(:,nlcj-2) * hv(:,nlcj-2) * e1v(:,nlcj-2) 274 268 ENDIF 275 269 #endif … … 298 292 kindic = 0 299 293 IF( ncut == 0 ) THEN 300 IF( nsolv == 1 ) THEN ! diagonal preconditioned conjuguate gradient 301 CALL sol_pcg( kindic ) 302 ELSEIF( nsolv == 2 ) THEN ! successive-over-relaxation 303 CALL sol_sor( kindic ) 304 ELSE ! e r r o r in nsolv namelist parameter 305 WRITE(ctmp1,*) ' ~~~~~~~~~~~ not = ', nsolv 306 CALL ctl_stop( ' dyn_spg_flt : e r r o r, nsolv = 1 or 2', ctmp1 ) 294 IF ( nn_solv == 1 ) THEN ; CALL sol_pcg( kindic ) ! diagonal preconditioned conjuguate gradient 295 ELSEIF( nn_solv == 2 ) THEN ; CALL sol_sor( kindic ) ! successive-over-relaxation 307 296 ENDIF 308 297 ENDIF … … 313 302 DO ji = fs_2, fs_jpim1 ! vector opt. 314 303 ! trend of Transport divergence gradient 315 ztdgu = z nugdt* (gcx(ji+1,jj ) - gcx(ji,jj) ) / e1u(ji,jj)316 ztdgv = z nugdt* (gcx(ji ,jj+1) - gcx(ji,jj) ) / e2v(ji,jj)304 ztdgu = z2dtg * (gcx(ji+1,jj ) - gcx(ji,jj) ) / e1u(ji,jj) 305 ztdgv = z2dtg * (gcx(ji ,jj+1) - gcx(ji,jj) ) / e2v(ji,jj) 317 306 ! multiplied by z2dt 318 307 #if defined key_obc … … 336 325 IF( .NOT. Agrif_Root() ) THEN 337 326 ! caution : grad D (fine) = grad D (coarse) at coarse/fine interface 338 IF( nbondi == -1 .OR. nbondi == 2 ) spgu(2 ,:) = z nugdt* z2dt * laplacu(2 ,:) * umask(2 ,:,1)339 IF( nbondi == 1 .OR. nbondi == 2 ) spgu(nlci-2,:) = z nugdt* z2dt * laplacu(nlci-2,:) * umask(nlci-2,:,1)340 IF( nbondj == -1 .OR. nbondj == 2 ) spgv(:,2 ) = z nugdt* z2dt * laplacv(:,2 ) * vmask(: ,2,1)341 IF( nbondj == 1 .OR. nbondj == 2 ) spgv(:,nlcj-2) = z nugdt* z2dt * laplacv(:,nlcj-2) * vmask(:,nlcj-2,1)327 IF( nbondi == -1 .OR. nbondi == 2 ) spgu(2 ,:) = z2dtg * z2dt * laplacu(2 ,:) * umask(2 ,:,1) 328 IF( nbondi == 1 .OR. nbondi == 2 ) spgu(nlci-2,:) = z2dtg * z2dt * laplacu(nlci-2,:) * umask(nlci-2,:,1) 329 IF( nbondj == -1 .OR. nbondj == 2 ) spgv(:,2 ) = z2dtg * z2dt * laplacv(:,2 ) * vmask(: ,2,1) 330 IF( nbondj == 1 .OR. nbondj == 2 ) spgv(:,nlcj-2) = z2dtg * z2dt * laplacv(:,nlcj-2) * vmask(:,nlcj-2,1) 342 331 ENDIF 343 332 #endif -
trunk/NEMO/OPA_SRC/DYN/dynvor.F90
r1516 r1601 38 38 PUBLIC dyn_vor ! routine called by step.F90 39 39 40 ! !!* Namelist nam _dynvor: vorticity term40 ! !!* Namelist namdyn_vor: vorticity term 41 41 LOGICAL, PUBLIC :: ln_dynvor_ene = .FALSE. !: energy conserving scheme 42 42 LOGICAL, PUBLIC :: ln_dynvor_ens = .TRUE. !: enstrophy conserving scheme … … 645 645 !!---------------------------------------------------------------------- 646 646 INTEGER :: ioptio ! temporary integer 647 NAMELIST/nam _dynvor/ ln_dynvor_ens, ln_dynvor_ene, ln_dynvor_mix, ln_dynvor_een648 !!---------------------------------------------------------------------- 649 650 REWIND ( numnam ) ! Read Namelist nam _dynvor : Vorticity scheme options651 READ ( numnam, nam _dynvor )647 NAMELIST/namdyn_vor/ ln_dynvor_ens, ln_dynvor_ene, ln_dynvor_mix, ln_dynvor_een 648 !!---------------------------------------------------------------------- 649 650 REWIND ( numnam ) ! Read Namelist namdyn_vor : Vorticity scheme options 651 READ ( numnam, namdyn_vor ) 652 652 653 653 IF(lwp) THEN ! Namelist print … … 655 655 WRITE(numout,*) 'dyn:vor_ctl : vorticity term : read namelist and control the consistency' 656 656 WRITE(numout,*) '~~~~~~~~~~~' 657 WRITE(numout,*) ' Namelist nam _dynvor : oice of the vorticity term scheme'657 WRITE(numout,*) ' Namelist namdyn_vor : oice of the vorticity term scheme' 658 658 WRITE(numout,*) ' energy conserving scheme ln_dynvor_ene = ', ln_dynvor_ene 659 659 WRITE(numout,*) ' enstrophy conserving scheme ln_dynvor_ens = ', ln_dynvor_ens -
trunk/NEMO/OPA_SRC/FLO/flo_oce.F90
r1152 r1601 2 2 !!====================================================================== 3 3 !! *** MODULE flo_oce *** 4 !! 5 !! ** Purpose : - Define in memory all floats parameters and variables 6 !! 7 !! History : 8 !! 8.0 ! 99-10 (CLIPPER projet) 9 !! 9.0 ! 02-11 (G. Madec, A. Bozec) F90: Free form and module 4 !! lagrangian floats : define in memory all floats parameters and variables 10 5 !!====================================================================== 11 !! OPA 9.0 , LOCEAN-IPSL (2005) 12 !! $Id$ 13 !! This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt 6 !! History : OPA ! 1999-10 (CLIPPER projet) 7 !! NEMO 1.0 ! 2002-11 (G. Madec, A. Bozec) F90: Free form and module 14 8 !!---------------------------------------------------------------------- 15 9 #if defined key_floats || defined key_esopa … … 17 11 !! 'key_floats' drifting floats 18 12 !!---------------------------------------------------------------------- 19 !! * Modules used20 13 USE par_oce ! ocean parameters 21 14 22 15 IMPLICIT NONE 16 PUBLIC 23 17 24 18 LOGICAL, PUBLIC, PARAMETER :: lk_floats = .TRUE. !: float flag … … 26 20 !! float parameters 27 21 !! ---------------- 28 INTEGER, PARAMETER :: & 29 jpnfl = 23 , & ! total number of floats during the run 30 jpnnewflo = 0 , & ! number of floats added in a new run 31 jpnrstflo = jpnfl-jpnnewflo ! number of floats for the restart 22 INTEGER, PUBLIC, PARAMETER :: jpnfl = 23 , !: total number of floats during the run 23 INTEGER, PUBLIC, PARAMETER :: jpnnewflo = 0 , !: number of floats added in a new run 24 INTEGER, PUBLIC, PARAMETER :: jpnrstflo = jpnfl - jpnnewflo !: number of floats for the restart 32 25 33 26 !! float variables 34 27 !! --------------- 35 INTEGER, DIMENSION(jpnfl) :: & 36 nisobfl, & ! 0 for a isobar float 37 ! ! 1 for a float following the w velocity 38 ngrpfl ! number to identify searcher group 28 INTEGER, PUBLIC, DIMENSION(jpnfl) :: nisobfl !: =0 for a isobar float , =1 for a float following the w velocity 29 INTEGER, PUBLIC, DIMENSION(jpnfl) :: ngrpfl !: number to identify searcher group 39 30 40 REAL(wp), DIMENSION(jpnfl) :: & 41 flxx, & ! longitude of float (decimal degree) 42 flyy, & ! latitude of float (decimal degree) 43 flzz, & ! depth of float (m, positive) 44 tpifl, & ! index of float position on zonal axe 45 tpjfl, & ! index of float position on meridien axe 46 tpkfl ! index of float position on z axe 31 REAL(wp), PUBLIC, DIMENSION(jpnfl) :: flxx , flyy , flzz !: longitude, latitude, depth of float (decimal degree, m >0) 32 REAL(wp), PUBLIC, DIMENSION(jpnfl) :: tpifl, tpjfl, tpkfl !: (i,j,k) indices of float position 33 34 REAL(wp), PUBLIC, DIMENSION(jpi, jpj, jpk) :: wb !: vertical velocity at previous time step (m s-1). 47 35 48 REAL(wp), DIMENSION(jpi, jpj, jpk) :: & 49 wb ! vertical velocity at previous time step (m s-1). 50 51 ! floats unit 52 53 LOGICAL :: & !!! * namelist namflo * 54 ln_rstflo = .FALSE. , & ! T/F float restart 55 ln_argo = .FALSE. , & ! T/F argo type floats 56 ln_flork4 = .FALSE. ! T/F 4th order Runge-Kutta 57 INTEGER :: & !!! * namelist namflo * 58 nwritefl, & ! frequency of float output file 59 nstockfl ! frequency of float restart file 36 ! !!! * namelist namflo : langrangian floats * 37 LOGICAL, PUBLIC :: ln_rstflo = .FALSE. !: T/F float restart 38 LOGICAL, PUBLIC :: ln_argo = .FALSE. !: T/F argo type floats 39 LOGICAL, PUBLIC :: ln_flork4 = .FALSE. !: T/F 4th order Runge-Kutta 40 INTEGER, PUBLIC :: nn_writefl = 150 !: frequency of float output file 41 INTEGER, PUBLIC :: nn_stockfl = 450 !: frequency of float restart file 60 42 61 43 #else … … 66 48 #endif 67 49 50 !!---------------------------------------------------------------------- 51 !! NEMO/OPA 3.2 , LOCEAN-IPSL (2009) 52 !! $Id$ 53 !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 68 54 !!====================================================================== 69 55 END MODULE flo_oce -
trunk/NEMO/OPA_SRC/FLO/floats.F90
r1152 r1601 4 4 !! Ocean floats : floats 5 5 !!====================================================================== 6 !! History : OPA ! (CLIPPER) original Code 7 !! NEMO 1.0 ! 2002-06 (A. Bozec) F90, Free form and module 8 !!---------------------------------------------------------------------- 6 9 #if defined key_floats || defined key_esopa 7 10 !!---------------------------------------------------------------------- … … 11 14 !! flo_init : initialization of float trajectories computation 12 15 !!---------------------------------------------------------------------- 13 !! * Modules used14 16 USE flo_oce ! floats variables 15 17 USE lib_mpp ! distributed memory computing … … 22 24 PRIVATE 23 25 24 !! * Routine accessibility25 PUBLIC flo_stp ! routine called by step.F90 26 PUBLIC flo_stp ! routine called by step.F90 27 26 28 !!---------------------------------------------------------------------- 27 !! OPA 9.0 , LOCEAN-IPSL (2005)29 !! NEMO/OPA 3.2 , LOCEAN-IPSL (2009) 28 30 !! $Id$ 29 !! This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt31 !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 30 32 !!---------------------------------------------------------------------- 31 33 … … 42 44 !! algorithm by default and with a 4th order Runge-Kutta scheme 43 45 !! if ln_flork4 =T 44 !!45 !! History :46 !! 8.5 ! 02-06 (A. Bozec, G. Madec ) F90: Free form and module47 46 !!---------------------------------------------------------------------- 48 !! * arguments49 47 INTEGER, INTENT( in ) :: kt ! ocean time step 50 48 !!---------------------------------------------------------------------- 51 49 ! 52 50 IF( kt == nit000 ) THEN 53 51 IF(lwp) WRITE(numout,*) … … 59 57 CALL flo_dom ! compute/read initial position of floats 60 58 61 ! Initialisation of wb for computation of floats trajectories at the first time step 62 wb(:,:,:) = wn(:,:,:) 59 wb(:,:,:) = wn(:,:,:) ! set wb for computation of floats trajectories at the first time step 63 60 ENDIF 64 65 IF( ln_flork4 ) THEN 66 CALL flo_4rk( kt ) ! Trajectories using a 4th order Runge Kutta scheme 67 ELSE 68 CALL flo_blk( kt ) ! Trajectories using Blanke' algorithme 61 ! 62 IF( ln_flork4 ) THEN ; CALL flo_4rk( kt ) ! Trajectories using a 4th order Runge Kutta scheme 63 ELSE ; CALL flo_blk( kt ) ! Trajectories using Blanke' algorithme 69 64 ENDIF 70 65 ! 71 66 IF( lk_mpp ) CALL mppsync ! synchronization of all the processor 72 73 74 ! Writing and restart 75 76 ! trajectories file 77 IF( kt == nit000 .OR. MOD( kt, nwritefl ) == 0 ) CALL flo_wri( kt ) 78 ! restart file 79 IF( kt == nitend .OR. MOD( kt, nstockfl ) == 0 ) CALL flo_wri( kt ) 80 81 ! Save the old vertical velocity field 82 wb(:,:,:) = wn(:,:,:) 83 67 ! 68 IF( kt == nit000 .OR. MOD( kt, nn_writefl ) == 0 ) CALL flo_wri( kt ) ! trajectories file 69 IF( kt == nitend .OR. MOD( kt, nn_stockfl ) == 0 ) CALL flo_wri( kt ) ! restart file 70 ! 71 wb(:,:,:) = wn(:,:,:) ! Save the old vertical velocity field 72 ! 84 73 END SUBROUTINE flo_stp 85 74 … … 90 79 !! 91 80 !! ** Purpose : Read the namelist of floats 92 !!93 !! History :94 !! 8.0 ! (CLIPPER) original Code95 !! 8.5 ! 02-06 (A. Bozec) F90, Free form and module96 81 !!---------------------------------------------------------------------- 97 !! * Modules used98 82 USE ioipsl 99 100 !! * Local declarations 101 NAMELIST/namflo/ ln_rstflo, nwritefl, nstockfl, ln_argo, ln_flork4 83 !! 84 NAMELIST/namflo/ ln_rstflo, nn_writefl, nn_stockfl, ln_argo, ln_flork4 102 85 !!--------------------------------------------------------------------- 103 ! Namelist namflo : floats 104 105 ! default values 106 ln_rstflo = .FALSE. 107 nwritefl = 150 108 nstockfl = 450 109 110 ! lecture of namflo 111 REWIND( numnam ) 86 ! 87 REWIND( numnam ) ! Namelist namflo : floats 112 88 READ ( numnam, namflo ) 113 114 IF(lwp) THEN 115 WRITE(numout,*) ' '89 ! 90 IF(lwp) THEN ! control print 91 WRITE(numout,*) 116 92 WRITE(numout,*) ' Namelist floats :' 117 93 WRITE(numout,*) ' restart ln_rstflo = ', ln_rstflo 118 WRITE(numout,*) ' frequency of float output file n writefl = ', nwritefl119 WRITE(numout,*) ' frequency of float restart file n stockfl = ', nstockfl94 WRITE(numout,*) ' frequency of float output file nn_writefl = ', nn_writefl 95 WRITE(numout,*) ' frequency of float restart file nn_stockfl = ', nn_stockfl 120 96 WRITE(numout,*) ' Argo type floats ln_argo = ', ln_argo 121 97 WRITE(numout,*) ' Computation of T trajectories ln_flork4 = ', ln_flork4 122 WRITE(numout,*) ' '123 98 ENDIF 124 99 ! 125 100 END SUBROUTINE flo_init 126 101 -
trunk/NEMO/OPA_SRC/FLO/flowri.F90
r1581 r1601 2 2 !!====================================================================== 3 3 !! *** MODULE flowri *** 4 !! 4 !! lagrangian floats : outputs 5 5 !!====================================================================== 6 !! History : OPA ! 1999-09 (Y. Drillet) Original code 7 !! ! 2000-06 (J.-M. Molines) Profiling floats for CLS 8 !! NEMO 1.0 ! 2002-11 (G. Madec, A. Bozec) F90: Free form and module 9 !!---------------------------------------------------------------------- 10 6 11 #if defined key_floats || defined key_esopa 7 12 !!---------------------------------------------------------------------- … … 10 15 !! flowri : write trajectories of floats in file 11 16 !!---------------------------------------------------------------------- 12 !! * Modules used13 17 USE flo_oce ! ocean drifting floats 14 18 USE oce ! ocean dynamics and tracers … … 19 23 20 24 IMPLICIT NONE 21 22 !! * Accessibility23 25 PRIVATE 24 PUBLIC flo_wri ! routine called by floats.F90 25 26 !! * Module variables 27 INTEGER :: jfl! number of floats26 27 PUBLIC flo_wri ! routine called by floats.F90 28 29 INTEGER :: jfl ! number of floats 28 30 29 31 !! * Substitutions 30 32 # include "domzgr_substitute.h90" 31 33 !!---------------------------------------------------------------------- 32 !! OPA 9.0 , LOCEAN-IPSL (2005)34 !! NEMO/OPA 3.2 , LOCEAN-IPSL (2009) 33 35 !! $Id$ 34 !! This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt36 !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 35 37 !!---------------------------------------------------------------------- 36 38 … … 38 40 39 41 SUBROUTINE flo_wri( kt ) 40 !!------------------------------------------------------------------- --42 !!------------------------------------------------------------------- 41 43 !! *** ROUTINE flo_wri *** 42 44 !! … … 44 46 !! and the temperature and salinity at this position 45 47 !! 46 !! ** Method : The frequency is nwritefl 47 !! 48 !! History : 49 !! 8.0 ! 99-09 (Y. Drillet) Original code 50 !! ! 00-06 (J.-M. Molines) Profiling floats for CLS 51 !! 8.5 ! 02-10 (A. Bozec) F90: Free form and module 48 !! ** Method : The frequency is nn_writefl 52 49 !!---------------------------------------------------------------------- 53 !! * Arguments 54 INTEGER :: kt ! time step 55 56 !! * Local declarations 50 INTEGER :: kt ! time step 51 !! 57 52 CHARACTER (len=21) :: clname 58 INTEGER :: inum ! temporary logical unit for restart file 59 INTEGER :: & 60 iafl,ibfl,icfl,ia1fl,ib1fl,ic1fl,jfl,irecflo, & 61 iafloc,ibfloc,ia1floc,ib1floc, & 62 iafln, ibfln 53 INTEGER :: inum ! temporary logical unit for restart file 54 INTEGER :: iafl, ibfl, icfl, ia1fl, ib1fl, ic1fl, jfl, irecflo, & 55 INTEGER :: iafloc, ibfloc, ia1floc, ib1floc, iafln, ibfln 63 56 INTEGER :: ic, jc , jpn 64 57 INTEGER, DIMENSION ( jpnij ) :: iproc … … 69 62 !!--------------------------------------------------------------------- 70 63 71 IF( kt == nit000 .OR. MOD( kt,n writefl)== 0 ) THEN64 IF( kt == nit000 .OR. MOD( kt,nn_writefl)== 0 ) THEN 72 65 73 66 ! header of output floats file … … 84 77 85 78 IF( kt == nit000 ) THEN 86 irecflo = NINT( (nitend-nit000) / FLOAT(n writefl) )87 IF(lwp) WRITE(numflo)cexper,no,irecflo,jpnfl,n writefl79 irecflo = NINT( (nitend-nit000) / FLOAT(nn_writefl) ) 80 IF(lwp) WRITE(numflo)cexper,no,irecflo,jpnfl,nn_writefl 88 81 ENDIF 89 82 zdtj = rdt / 86400. !!bug use of 86400 instead of the phycst parameter … … 246 239 ENDIF 247 240 248 IF( (MOD(kt,n stockfl) == 0) .OR. ( kt == nitend ) ) THEN241 IF( (MOD(kt,nn_stockfl) == 0) .OR. ( kt == nitend ) ) THEN 249 242 ! Writing the restart file 250 243 IF(lwp) THEN -
trunk/NEMO/OPA_SRC/IOM/in_out_manager.F90
r1581 r1601 29 29 !! namrun namelist parameters 30 30 !!---------------------------------------------------------------------- 31 CHARACTER(len=16) :: c exper= "exp0" !: experiment name used for output filename31 CHARACTER(len=16) :: cn_exp = "exp0" !: experiment name used for output filename 32 32 CHARACTER(len=32) :: cn_ocerst_in = "restart" !: suffix of ocean restart name (input) 33 33 CHARACTER(len=32) :: cn_ocerst_out = "restart" !: suffix of ocean restart name (output) 34 34 LOGICAL :: ln_rstart = .FALSE. !: start from (F) rest or (T) a restart file 35 INTEGER :: n o= 0 !: job number36 INTEGER :: n rstdt= 0 !: control of the time step (0, 1 or 2)35 INTEGER :: nn_no = 0 !: job number 36 INTEGER :: nn_rstctl = 0 !: control of the time step (0, 1 or 2) 37 37 INTEGER :: nn_rstssh = 0 !: hand made initilization of ssh or not (1/0) 38 INTEGER :: nit000 = 1 !: index of the first time step 39 INTEGER :: nitend = 10 !: index of the last time step 40 INTEGER :: ndate0 = 961115 !: initial calendar date aammjj 41 INTEGER :: nleapy = 0 !: Leap year calendar flag (0/1 or 30) 42 INTEGER :: ninist = 0 !: initial state output flag (0/1) 38 INTEGER :: nn_it000 = 1 !: index of the first time step 39 INTEGER :: nn_itend = 10 !: index of the last time step 40 INTEGER :: nn_date0 = 961115 !: initial calendar date aammjj 41 INTEGER :: nn_leapy = 0 !: Leap year calendar flag (0/1 or 30) 42 INTEGER :: nn_istate = 0 !: initial state output flag (0/1) 43 INTEGER :: nn_write = 10 !: model standard output frequency 44 INTEGER :: nn_stock = 10 !: restart file frequency 43 45 LOGICAL :: ln_dimgnnn = .FALSE. !: type of dimgout. (F): 1 file for all proc 44 46 !: (T): 1 file per proc … … 46 48 LOGICAL :: ln_clobber = .FALSE. !: clobber (overwrite) an existing file 47 49 INTEGER :: nn_chunksz = 0 !: chunksize (bytes) for NetCDF file (working only with iom_nf90 routines) 50 51 !! conversion of DOCTOR norm namelist name into model name 52 !! (this should disappear in a near futur) 53 54 CHARACTER(len=16) :: cexper !: experiment name used for output filename 55 INTEGER :: no !: job number 56 INTEGER :: nrstdt !: control of the time step (0, 1 or 2) 57 INTEGER :: nit000 !: index of the first time step 58 INTEGER :: nitend !: index of the last time step 59 INTEGER :: ndate0 !: initial calendar date aammjj 60 INTEGER :: nleapy !: Leap year calendar flag (0/1 or 30) 61 INTEGER :: ninist !: initial state output flag (0/1) 62 INTEGER :: nwrite !: model standard output frequency 63 INTEGER :: nstock !: restart file frequency 64 48 65 !!---------------------------------------------------------------------- 49 66 !! was in restart but moved here because of the OFF line... better solution should be found... 50 67 !!---------------------------------------------------------------------- 51 68 INTEGER :: nitrst !: time step at which restart file should be written 69 52 70 !!---------------------------------------------------------------------- 53 71 !! output monitoring 54 72 !!---------------------------------------------------------------------- 55 73 LOGICAL :: ln_ctl = .FALSE. !: run control for debugging 56 INTEGER :: nstock = 10 !: restart file frequency 57 INTEGER :: nprint = 0 !: level of print (0 no print) 58 INTEGER :: nwrite = 10 !: restart file frequency 59 INTEGER :: nictls = 0 !: Start i indice for the SUM control 60 INTEGER :: nictle = 0 !: End i indice for the SUM control 61 INTEGER :: njctls = 0 !: Start j indice for the SUM control 62 INTEGER :: njctle = 0 !: End j indice for the SUM control 63 INTEGER :: isplt = 1 !: number of processors following i 64 INTEGER :: jsplt = 1 !: number of processors following j 74 INTEGER :: nn_print = 0 !: level of print (0 no print) 75 INTEGER :: nn_ictls = 0 !: Start i indice for the SUM control 76 INTEGER :: nn_ictle = 0 !: End i indice for the SUM control 77 INTEGER :: nn_jctls = 0 !: Start j indice for the SUM control 78 INTEGER :: nn_jctle = 0 !: End j indice for the SUM control 79 INTEGER :: nn_isplt = 1 !: number of processors following i 80 INTEGER :: nn_jsplt = 1 !: number of processors following j 81 INTEGER :: nn_bench = 0 !: benchmark parameter (0/1) 82 INTEGER :: nn_bit_cmp = 0 !: bit reproducibility (0/1) 83 84 ! !: OLD namelist names 85 INTEGER :: nprint, nictls, nictle, njctls, njctle, isplt, jsplt, nbench, nbit_cmp 86 65 87 INTEGER :: ijsplt = 1 !: nb of local domain = nb of processors 66 INTEGER :: nbench = 0 !: benchmark parameter (0/1) 67 INTEGER :: nbit_cmp = 0 !: bit reproducibility (0/1) 88 68 89 !!---------------------------------------------------------------------- 69 90 !! logical units … … 84 105 !! Run control 85 106 !!---------------------------------------------------------------------- 86 87 107 INTEGER :: nstop = 0 !: error flag (=number of reason for a premature stop run) 88 108 INTEGER :: nwarn = 0 !: warning flag (=number of warning found during the run) -
trunk/NEMO/OPA_SRC/LDF/ldfdyn.F90
r1152 r1601 4 4 !! Ocean physics: lateral viscosity coefficient 5 5 !!===================================================================== 6 !! History : OPA ! 1997-07 (G. Madec) multi dimensional coefficients 7 !! NEMO 1.0 ! 2002-09 (G. Madec) F90: Free form and module 8 !!---------------------------------------------------------------------- 6 9 7 10 !!---------------------------------------------------------------------- … … 11 14 !! ldf_dyn_c1d : 1D eddy viscosity coefficient initialization 12 15 !!---------------------------------------------------------------------- 13 !! * Modules used14 16 USE oce ! ocean dynamics and tracers 15 17 USE dom_oce ! ocean space and time domain … … 17 19 USE phycst ! physical constants 18 20 USE ldfslp ! ??? 21 USE ioipsl 19 22 USE in_out_manager ! I/O manager 20 23 USE lib_mpp ! distribued memory computing library … … 24 27 PRIVATE 25 28 26 !! * Routine accessibility 27 PUBLIC ldf_dyn_init ! called by opa.F90 29 PUBLIC ldf_dyn_init ! called by opa.F90 28 30 29 31 INTERFACE ldf_zpf … … 34 36 # include "domzgr_substitute.h90" 35 37 !!---------------------------------------------------------------------- 36 !! OPA 9.0 , LOCEAN-IPSL (2005)38 !! NEMO/OPA 3.2 , LOCEAN-IPSL (2009) 37 39 !! $Id$ 38 !! This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt40 !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 39 41 !!---------------------------------------------------------------------- 40 42 … … 48 50 !! 49 51 !! ** Method : 50 !! Eddy viscosity coefficients: 51 !! default option : constant coef. ahm0 (namelist) 52 !! 'key_dynldf_c1d': depth dependent coef. defined in 53 !! in ldf_dyn_c1d routine 54 !! 'key_dynldf_c2d': latitude and longitude dependent coef. 55 !! defined in ldf_dyn_c2d routine 56 !! 'key_dynldf_c3d': latitude, longitude, depth dependent coef. 57 !! defined in ldf_dyn_c3d routine 52 !! - default option : ahm = constant coef. = rn_ahm_0 (namelist) 53 !! - 'key_dynldf_c1d': ahm = F(depth) see ldf_dyn_c1d.h90 54 !! - 'key_dynldf_c2d': ahm = F(latitude,longitude) see ldf_dyn_c2d.h90 55 !! - 'key_dynldf_c3d': ahm = F(latitude,longitude,depth) see ldf_dyn_c3d.h90 56 !! 58 57 !! N.B. User defined include files. By default, 3d and 2d coef. 59 58 !! are set to a constant value given in the namelist and the 1d … … 61 60 !! profile. 62 61 !! 63 !! Reference : 64 !! Madec, G. and M. Imbard, 1996, A global ocean mesh to overcome 65 !! the North Pole singularity, Climate Dynamics, 12, 381-388. 66 !! 67 !! History : 68 !! ! 07-97 (G. Madec) from inimix.F split in 2 routines 69 !! ! 08-97 (G. Madec) multi dimensional coefficients 70 !! 8.5 ! 02-09 (G. Madec) F90: Free form and module 71 !!---------------------------------------------------------------------- 72 !! * Modules used 73 USE ioipsl 74 75 !! * Local declarations 62 !! Reference : Madec, G. and M. Imbard, 1996: Climate Dynamics, 12, 381-388. 63 !!---------------------------------------------------------------------- 76 64 INTEGER :: ioptio ! ??? 77 65 LOGICAL :: ll_print = .FALSE. ! Logical flag for printing viscosity coef. 78 79 80 NAMELIST/nam_dynldf/ ln_dynldf_lap , ln_dynldf_bilap, & 81 & ln_dynldf_level, ln_dynldf_hor, ln_dynldf_iso, & 82 & ahm0, ahmb0 83 !!---------------------------------------------------------------------- 84 85 86 ! Define the lateral physics parameters 87 ! ====================================== 88 89 ! Read Namelist nam_dynldf : Lateral physics 90 REWIND( numnam ) 91 READ ( numnam, nam_dynldf ) 92 93 ! Parameter print 94 IF(lwp) THEN 66 !! 67 NAMELIST/namdyn_ldf/ ln_dynldf_lap , ln_dynldf_bilap, & 68 & ln_dynldf_level, ln_dynldf_hor , ln_dynldf_iso, & 69 & rn_ahm_0 , rn_ahmb_0 70 !!---------------------------------------------------------------------- 71 72 REWIND( numnam ) ! Read Namelist namdyn_ldf : Lateral physics 73 READ ( numnam, namdyn_ldf ) 74 75 IF(lwp) THEN ! Parameter print 95 76 WRITE(numout,*) 96 77 WRITE(numout,*) 'ldf_dyn : lateral momentum physics' 97 78 WRITE(numout,*) '~~~~~~~' 98 WRITE(numout,*) ' Namelist nam_dynldf : set lateral mixing parameters' 99 WRITE(numout,*) ' laplacian operator ln_dynldf_lap = ', ln_dynldf_lap 100 WRITE(numout,*) ' bilaplacian operator ln_dynldf_bilap = ', ln_dynldf_bilap 101 WRITE(numout,*) ' iso-level ln_dynldf_level = ', ln_dynldf_level 102 WRITE(numout,*) ' horizontal (geopotential) ln_dynldf_hor = ', ln_dynldf_hor 103 WRITE(numout,*) ' iso-neutral ln_dynldf_iso = ', ln_dynldf_iso 104 WRITE(numout,*) ' horizontal eddy viscosity ahm0 = ', ahm0 105 WRITE(numout,*) ' background viscosity ahmb0 = ', ahmb0 106 ENDIF 79 WRITE(numout,*) ' Namelist nam_dynldf : set lateral mixing parameters' 80 WRITE(numout,*) ' laplacian operator ln_dynldf_lap = ', ln_dynldf_lap 81 WRITE(numout,*) ' bilaplacian operator ln_dynldf_bilap = ', ln_dynldf_bilap 82 WRITE(numout,*) ' iso-level ln_dynldf_level = ', ln_dynldf_level 83 WRITE(numout,*) ' horizontal (geopotential) ln_dynldf_hor = ', ln_dynldf_hor 84 WRITE(numout,*) ' iso-neutral ln_dynldf_iso = ', ln_dynldf_iso 85 WRITE(numout,*) ' horizontal eddy viscosity rn_ahm_0 = ', rn_ahm_0 86 WRITE(numout,*) ' background viscosity rn_ahmb_0 = ', rn_ahmb_0 87 ENDIF 88 89 ahm0 = rn_ahm_0 ! OLD namelist variables defined from DOCTOR namelist variables 90 ahmb0 = rn_ahmb_0 107 91 108 92 ! ... check of lateral diffusive operator on tracers … … 112 96 ioptio = 0 113 97 #if defined key_dynldf_c3d 114 IF(lwp) WRITE(numout,*) ' 98 IF(lwp) WRITE(numout,*) ' momentum mixing coef. = F( latitude, longitude, depth)' 115 99 ioptio = ioptio+1 116 100 #endif 117 101 #if defined key_dynldf_c2d 118 IF(lwp) WRITE(numout,*) ' 102 IF(lwp) WRITE(numout,*) ' momentum mixing coef. = F( latitude, longitude)' 119 103 ioptio = ioptio+1 120 104 #endif 121 105 #if defined key_dynldf_c1d 122 IF(lwp) WRITE(numout,*) ' 106 IF(lwp) WRITE(numout,*) ' momentum mixing coef. = F( depth )' 123 107 ioptio = ioptio+1 124 IF( ln_sco ) CALL ctl_stop( ' 108 IF( ln_sco ) CALL ctl_stop( 'key_dynldf_c1d cannot be used in s-coordinate (ln_sco)' ) 125 109 #endif 126 110 IF( ioptio == 0 ) THEN 127 IF(lwp) WRITE(numout,*) ' 111 IF(lwp) WRITE(numout,*) ' momentum mixing coef. = constant (default option)' 128 112 ELSEIF( ioptio > 1 ) THEN 129 CALL ctl_stop( ' use only one of the following keys:', & 130 & ' key_dynldf_c3d, key_dynldf_c2d, key_dynldf_c1d' ) 113 CALL ctl_stop( 'use only one of the following keys: key_dynldf_c3d, key_dynldf_c2d, key_dynldf_c1d' ) 131 114 ENDIF 132 115 133 116 134 117 IF( ln_dynldf_bilap ) THEN 135 IF(lwp) WRITE(numout,*) ' biharmonic momentum diffusion' 136 IF( ahm0 > 0 .AND. .NOT. lk_esopa ) & 137 & CALL ctl_stop( 'The horizontal viscosity coef. ahm0 must be negative' ) 118 IF(lwp) WRITE(numout,*) ' biharmonic momentum diffusion' 119 IF( ahm0 > 0 .AND. .NOT. lk_esopa ) CALL ctl_stop( 'The horizontal viscosity coef. ahm0 must be negative' ) 138 120 ELSE 139 IF(lwp) WRITE(numout,*) ' harmonic momentum diff. (default)' 140 IF( ahm0 < 0 .AND. .NOT. lk_esopa ) & 141 & CALL ctl_stop( ' The horizontal viscosity coef. ahm0 must be positive' ) 121 IF(lwp) WRITE(numout,*) ' harmonic momentum diff. (default)' 122 IF( ahm0 < 0 .AND. .NOT. lk_esopa ) CALL ctl_stop( 'The horizontal viscosity coef. ahm0 must be positive' ) 142 123 ENDIF 143 124 … … 145 126 ! Lateral eddy viscosity 146 127 ! ====================== 147 148 128 #if defined key_dynldf_c3d 149 129 CALL ldf_dyn_c3d( ll_print ) ! ahm = 3D coef. = F( longitude, latitude, depth ) … … 159 139 IF(lwp) WRITE(numout,*) ' ahm1 = ahm2 = ahm0 = ',ahm0 160 140 #endif 161 141 ! 162 142 END SUBROUTINE ldf_dyn_init 163 143 … … 178 158 !! 179 159 !! ** Method : 1D eddy viscosity coefficients ( depth ) 180 !! 181 !!---------------------------------------------------------------------- 182 !! * Arguments 183 LOGICAL , INTENT (in ) :: ld_print ! If true, output arrays on numout 184 REAL(wp), INTENT (in ) :: & 185 pdam, & ! depth of the inflection point 186 pwam, & ! width of inflection 187 pbot ! battom value (0<pbot<= 1) 188 REAL(wp), INTENT (in ), DIMENSION(jpk) :: & 189 pdep ! depth of the gridpoint (T, U, V, F) 190 REAL(wp), INTENT (inout), DIMENSION(jpk) :: & 191 pah ! adimensional vertical profile 192 193 !! * Local variables 160 !!---------------------------------------------------------------------- 161 LOGICAL , INTENT(in ) :: ld_print ! If true, output arrays on numout 162 REAL(wp), INTENT(in ) :: pdam ! depth of the inflection point 163 REAL(wp), INTENT(in ) :: pwam ! width of inflection 164 REAL(wp), INTENT(in ) :: pbot ! bottom value (0<pbot<= 1) 165 REAL(wp), INTENT(in ), DIMENSION(jpk) :: pdep ! depth of the gridpoint (T, U, V, F) 166 REAL(wp), INTENT(inout), DIMENSION(jpk) :: pah ! adimensional vertical profile 167 !! 194 168 INTEGER :: jk ! dummy loop indices 195 169 REAL(wp) :: zm00, zm01, zmhb, zmhs ! temporary scalars … … 205 179 END DO 206 180 207 ! Control print 208 IF(lwp .AND. ld_print ) THEN 181 IF(lwp .AND. ld_print ) THEN ! Control print 209 182 WRITE(numout,*) 210 183 WRITE(numout,*) ' ahm profile : ' … … 215 188 END DO 216 189 ENDIF 217 190 ! 218 191 END SUBROUTINE ldf_zpf_1d 219 192 … … 226 199 !! 227 200 !! ** Method : 1D eddy viscosity coefficients ( depth ) 228 !! 229 !!---------------------------------------------------------------------- 230 !! * Arguments 231 LOGICAL , INTENT (in ) :: ld_print ! If true, output arrays on numout 232 REAL(wp), INTENT (in ) :: & 233 pdam, & ! depth of the inflection point 234 pwam, & ! width of inflection 235 pbot ! battom value (0<pbot<= 1) 236 REAL(wp), INTENT (in ), DIMENSION(jpk) :: & 237 pdep ! depth of the gridpoint (T, U, V, F) 238 REAL(wp), INTENT (inout), DIMENSION(jpi,jpj,jpk) :: & 239 pah ! adimensional vertical profile 240 241 !! * Local variables 201 !!---------------------------------------------------------------------- 202 LOGICAL , INTENT(in ) :: ld_print ! If true, output arrays on numout 203 REAL(wp), INTENT(in ) :: pdam ! depth of the inflection point 204 REAL(wp), INTENT(in ) :: pwam ! width of inflection 205 REAL(wp), INTENT(in ) :: pbot ! bottom value (0<pbot<= 1) 206 REAL(wp), INTENT(in ), DIMENSION (jpk) :: pdep ! depth of the gridpoint (T, U, V, F) 207 REAL(wp), INTENT(inout), DIMENSION(jpi,jpj,jpk) :: pah ! adimensional vertical profile 208 !! 242 209 INTEGER :: jk ! dummy loop indices 243 210 REAL(wp) :: zm00, zm01, zmhb, zmhs, zcf ! temporary scalars … … 254 221 END DO 255 222 256 ! Control print 257 IF(lwp .AND. ld_print ) THEN 223 IF(lwp .AND. ld_print ) THEN ! Control print 258 224 WRITE(numout,*) 259 225 WRITE(numout,*) ' ahm profile : ' … … 264 230 END DO 265 231 ENDIF 266 232 ! 267 233 END SUBROUTINE ldf_zpf_1d_3d 268 234 … … 275 241 !! 276 242 !! ** Method : 3D for partial step or s-coordinate 277 !! 278 !!---------------------------------------------------------------------- 279 !! * Arguments 280 LOGICAL , INTENT (in ) :: ld_print ! If true, output arrays on numout 281 REAL(wp), INTENT (in ) :: & 282 pdam, & ! depth of the inflection point 283 pwam, & ! width of inflection 284 pbot ! reduction factor (surface value / bottom value) 285 REAL(wp), INTENT (in ), DIMENSION(jpi,jpj,jpk) :: & 286 pdep ! dep of the gridpoint (T, U, V, F) 287 REAL(wp), INTENT (inout), DIMENSION(jpi,jpj,jpk) :: & 288 pah ! adimensional vertical profile 289 290 !! * Local variables 243 !!---------------------------------------------------------------------- 244 LOGICAL , INTENT(in ) :: ld_print ! If true, output arrays on numout 245 REAL(wp), INTENT(in ) :: pdam ! depth of the inflection point 246 REAL(wp), INTENT(in ) :: pwam ! width of inflection 247 REAL(wp), INTENT(in ) :: pbot ! bottom value (0<pbot<= 1) 248 REAL(wp), INTENT(in ), DIMENSION(jpi,jpj,jpk) :: pdep ! dep of the gridpoint (T, U, V, F) 249 REAL(wp), INTENT(inout), DIMENSION(jpi,jpj,jpk) :: pah ! adimensional vertical profile 250 !! 291 251 INTEGER :: jk ! dummy loop indices 292 252 REAL(wp) :: zm00, zm01, zmhb, zmhs ! temporary scalars … … 302 262 END DO 303 263 304 ! Control print 305 IF(lwp .AND. ld_print ) THEN 264 IF(lwp .AND. ld_print ) THEN ! Control print 306 265 WRITE(numout,*) 307 266 WRITE(numout,*) ' ahm profile : ' … … 312 271 END DO 313 272 ENDIF 314 273 ! 315 274 END SUBROUTINE ldf_zpf_3d 275 316 276 !!====================================================================== 317 277 END MODULE ldfdyn -
trunk/NEMO/OPA_SRC/LDF/ldfdyn_oce.F90
r1152 r1601 4 4 !! Ocean physics: lateral momentum mixing coefficient defined in memory 5 5 !!====================================================================== 6 !! 7 !! ** Purpose : 8 !! - Define in memory lateral momentum mixing coefficients 9 !! 10 !! History : 11 !! 8.5 ! 02-11 (G. Madec) F90: Free form and module 6 !! History : 1.0 ! 2002-11 (G. Madec) F90: Free form and module 12 7 !!---------------------------------------------------------------------- 13 !! OPA 9.0 , LOCEAN-IPSL (2005)14 !! $Id$15 !! This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt16 !!----------------------------------------------------------------------17 !! * Modules used18 8 USE par_oce ! ocean parameters 19 9 … … 21 11 PUBLIC 22 12 23 !!---------------------------------------------------------------------- 24 !! Lateral eddy viscosity coefficients (dynamics) 25 !!---------------------------------------------------------------------- 13 ! !!* Namelist namdyn_ldf : lateral mixing * 14 LOGICAL , PUBLIC :: ln_dynldf_lap = .TRUE. !: laplacian operator 15 LOGICAL , PUBLIC :: ln_dynldf_bilap = .FALSE. !: bilaplacian operator 16 LOGICAL , PUBLIC :: ln_dynldf_level = .FALSE. !: iso-level direction 17 LOGICAL , PUBLIC :: ln_dynldf_hor = .TRUE. !: horizontal (geopotential) direction 18 LOGICAL , PUBLIC :: ln_dynldf_iso = .FALSE. !: iso-neutral direction 19 REAL(wp), PUBLIC :: rn_ahm_0 = 40000._wp !: lateral eddy viscosity (m2/s) 20 REAL(wp), PUBLIC :: rn_ahmb_0 = 0._wp !: lateral background eddy viscosity (m2/s) 26 21 27 LOGICAL :: & !!! ** lateral mixing namelist (nam_dynldf) ** 28 ln_dynldf_lap = .TRUE. , & ! laplacian operator 29 ln_dynldf_bilap = .FALSE. , & ! bilaplacian operator 30 ln_dynldf_level = .FALSE. , & ! iso-level direction 31 ln_dynldf_hor = .TRUE. , & ! horizontal (geopotential) direction 32 ln_dynldf_iso = .FALSE. ! iso-neutral direction 33 34 REAL(wp) :: & !!! ** lateral mixing namelist (nam_dynldf) ** 35 ahm0 = 40000._wp , & ! lateral eddy viscosity (m2/s) 36 ahmb0 = 0._wp ! lateral background eddy viscosity (m2/s) 22 REAL(wp), PUBLIC :: ahm0, ahmb0 ! OLD namelist names 37 23 38 24 #if defined key_dynldf_c3d 39 REAL(wp), DIMENSION(jpi,jpj,jpk) :: &! ** 3D coefficients **25 REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) :: ahm1, ahm2, ahm3, ahm4 ! ** 3D coefficients ** 40 26 #elif defined key_dynldf_c2d 41 REAL(wp), DIMENSION(jpi,jpj) :: &! ** 2D coefficients **27 REAL(wp), PUBLIC, DIMENSION(jpi,jpj) :: ahm1, ahm2, ahm3, ahm4 ! ** 2D coefficients ** 42 28 #elif defined key_dynldf_c1d 43 REAL(wp), DIMENSION(jpk) :: &! ** 2D coefficients **29 REAL(wp), PUBLIC, DIMENSION(jpk) :: ahm1, ahm2, ahm3, ahm4 ! ** 2D coefficients ** 44 30 #else 45 REAL(wp) :: &! ** 0D coefficients **31 REAL(wp), PUBLIC :: ahm1, ahm2, ahm3, ahm4 ! ** 0D coefficients ** 46 32 #endif 47 ahm1, ahm2, ahm3, ahm4 ! ????48 33 49 34 !!---------------------------------------------------------------------- 35 !! NEMO/OPA 3.2 , LOCEAN-IPSL (2009) 36 !! $Id$ 37 !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 38 !!====================================================================== 50 39 END MODULE ldfdyn_oce -
trunk/NEMO/OPA_SRC/LDF/ldftra.F90
r1152 r1601 4 4 !! Ocean physics: lateral diffusivity coefficient 5 5 !!===================================================================== 6 !! History : 7 !! ! 07-97 (G. Madec) from inimix.F split in 2 routines8 !! ! 08-97 (G. Madec) multi dimensional coefficients9 !! 8.5 ! 02-09 (G. Madec) F90: Free form and module10 !! 9.0 ! 05-11 (G. Madec) 6 !! History : ! 1997-07 (G. Madec) from inimix.F split in 2 routines 7 !! NEMO 1.0 ! 2002-09 (G. Madec) F90: Free form and module 8 !! 2.0 ! 2005-11 (G. Madec) 9 !!---------------------------------------------------------------------- 10 11 11 !!---------------------------------------------------------------------- 12 12 !! ldf_tra_init : initialization, namelist read, and parameters control … … 15 15 !! ldf_tra_c1d : 1D eddy viscosity coefficient initialization 16 16 !!---------------------------------------------------------------------- 17 !! * Modules used18 17 USE oce ! ocean dynamics and tracers 19 18 USE dom_oce ! ocean space and time domain … … 22 21 USE ldfslp ! ??? 23 22 USE in_out_manager ! I/O manager 23 USE ioipsl 24 24 USE lib_mpp ! distribued memory computing library 25 25 USE lbclnk ! ocean lateral boundary conditions (or mpp link) … … 28 28 PRIVATE 29 29 30 !! * Routine accessibility 31 PUBLIC ldf_tra_init ! called by opa.F90 30 PUBLIC ldf_tra_init ! called by opa.F90 32 31 33 32 !! * Substitutions 34 33 # include "domzgr_substitute.h90" 35 34 # include "vectopt_loop_substitute.h90" 36 !!---------------------------------------------------------------------- -----------37 !! OPA 9.0 , LOCEAN-IPSL (2005)35 !!---------------------------------------------------------------------- 36 !! NEMO/OPA 3.2 , LOCEAN-IPSL (2009) 38 37 !! $Id$ 39 !! This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt40 !!---------------------------------------------------------------------- -----------38 !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 39 !!---------------------------------------------------------------------- 41 40 42 41 CONTAINS … … 62 61 !! coefficients are initialized to a hyperbolic tangent vertical 63 62 !! profile. 64 !!65 63 !!---------------------------------------------------------------------- 66 USE ioipsl 67 68 INTEGER :: ioptio ! ??? 64 INTEGER :: ioptio ! temporary integer 69 65 LOGICAL :: ll_print = .FALSE. ! =T print eddy coef. in numout 70 71 NAMELIST/nam _traldf/ ln_traldf_lap , ln_traldf_bilap,&72 & ln_traldf_level, ln_traldf_hor , ln_traldf_iso, &73 & aht0, ahtb0, aeiv066 !! 67 NAMELIST/namtra_ldf/ ln_traldf_lap , ln_traldf_bilap, & 68 & ln_traldf_level, ln_traldf_hor , ln_traldf_iso, & 69 & rn_aht_0 , rn_ahtb_0 , rn_aeiv_0 74 70 !!---------------------------------------------------------------------- 75 71 … … 77 73 ! ============================================= 78 74 79 ! Read Namelist nam_traldf : Lateral physics on tracers 80 REWIND( numnam ) 81 READ ( numnam, nam_traldf ) 75 REWIND( numnam ) ! Read Namelist namtra_ldf : Lateral physics on tracers 76 READ ( numnam, namtra_ldf ) 82 77 83 IF(lwp) THEN 78 IF(lwp) THEN ! control print 84 79 WRITE(numout,*) 85 80 WRITE(numout,*) 'ldf_tra_init : lateral tracer physics' 86 81 WRITE(numout,*) '~~~~~~~~~~~~ ' 87 WRITE(numout,*) ' Namelist nam_traldf : lateral mixing coefficients'88 WRITE(numout,*) ' laplacian operatorln_traldf_lap = ', ln_traldf_lap89 WRITE(numout,*) ' bilaplacian operatorln_traldf_bilap = ', ln_traldf_bilap90 WRITE(numout,*) ' lateral eddy diffusivity aht0 = ', aht091 WRITE(numout,*) ' background hor. diffusivity ahtb0 = ', ahtb092 WRITE(numout,*) ' eddy induced velocity coef. aeiv0 = ', aeiv082 WRITE(numout,*) ' Namelist namtra_ldf : lateral mixing coefficients' 83 WRITE(numout,*) ' laplacian operator ln_traldf_lap = ', ln_traldf_lap 84 WRITE(numout,*) ' bilaplacian operator ln_traldf_bilap = ', ln_traldf_bilap 85 WRITE(numout,*) ' lateral eddy diffusivity rn_aht_0 = ', rn_aht_0 86 WRITE(numout,*) ' background hor. diffusivity rn_ahtb_0 = ', rn_ahtb_0 87 WRITE(numout,*) ' eddy induced velocity coef. rn_aeiv_0 = ', rn_aeiv_0 93 88 WRITE(numout,*) 94 89 ENDIF 95 90 96 ! Parameter control 91 ! ! convert DOCTOR namelist names into OLD names 92 aht0 = rn_aht_0 93 ahtb0 = rn_ahtb_0 94 aeiv0 = rn_aeiv_0 95 96 ! ! Parameter control 97 97 98 98 ! ... Check consistency for type and direction : … … 112 112 IF(lwp) WRITE(numout,*) ' tracer mixing coef. = F( depth )' 113 113 ioptio = ioptio + 1 114 IF( .NOT. ln_zco ) & 115 & CALL ctl_stop( ' key_traldf_c1d can only be used in z-coordinate - full step' ) 114 IF( .NOT. ln_zco ) CALL ctl_stop( 'key_traldf_c1d can only be used in z-coordinate - full step' ) 116 115 #endif 117 116 IF( ioptio == 0 ) THEN … … 124 123 IF( ln_traldf_bilap ) THEN 125 124 IF(lwp) WRITE(numout,*) ' biharmonic tracer diffusion' 126 IF( aht0 > 0 .AND. .NOT. lk_esopa ) & 127 & CALL ctl_stop( ' The horizontal diffusivity coef. aht0 must be negative' ) 125 IF( aht0 > 0 .AND. .NOT. lk_esopa ) CALL ctl_stop( 'The horizontal diffusivity coef. aht0 must be negative' ) 128 126 ELSE 129 127 IF(lwp) WRITE(numout,*) ' harmonic tracer diffusion (default)' 130 IF( aht0 < 0 .AND. .NOT. lk_esopa ) & 131 & CALL ctl_stop(' The horizontal diffusivity coef. aht0 must be positive' ) 128 IF( aht0 < 0 .AND. .NOT. lk_esopa ) CALL ctl_stop('The horizontal diffusivity coef. aht0 must be positive' ) 132 129 ENDIF 133 130 … … 135 132 ! Lateral eddy diffusivity and eddy induced velocity coefficients 136 133 ! ================================================================ 137 138 134 #if defined key_traldf_c3d 139 135 CALL ldf_tra_c3d( ll_print ) ! aht = 3D coef. = F( longitude, latitude, depth ) … … 145 141 ! Constant coefficients 146 142 IF(lwp)WRITE(numout,*) 147 IF(lwp)WRITE(numout,*) ' 143 IF(lwp)WRITE(numout,*) ' constant eddy diffusivity coef. ahtu = ahtv = ahtw = aht0 = ', aht0 148 144 IF( lk_traldf_eiv ) THEN 149 145 IF(lwp)WRITE(numout,*) 150 IF(lwp)WRITE(numout,*) ' 146 IF(lwp)WRITE(numout,*) ' constant eddy induced velocity coef. aeiu = aeiv = aeiw = aeiv0 = ', aeiv0 151 147 ENDIF 152 148 #endif 153 149 ! 154 150 END SUBROUTINE ldf_tra_init 155 151 -
trunk/NEMO/OPA_SRC/LDF/ldftra_oce.F90
r1152 r1601 4 4 !! Ocean physics : lateral tracer mixing coefficient defined in memory 5 5 !!===================================================================== 6 !! 7 !! ** Purpose : - Define in memory lateral tracer mixing coefficients 8 !! 9 !! History : 10 !! 9.0 ! 02-11 (G. Madec) Original code (from common.h) 6 !! History : 9.0 ! 02-11 (G. Madec) Original code 11 7 !!---------------------------------------------------------------------- 12 !! OPA 9.0 , LOCEAN-IPSL (2005)13 !! $Id$14 !! This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt15 !!----------------------------------------------------------------------16 !! * Modules used17 8 USE par_oce ! ocean parameters 18 9 … … 23 14 !! Lateral eddy diffusivity coefficients (tracers) 24 15 !!---------------------------------------------------------------------- 16 ! !!* Namelist namtra_ldf : lateral mixing * 17 LOGICAL , PUBLIC :: ln_traldf_lap = .TRUE. !: laplacian operator 18 LOGICAL , PUBLIC :: ln_traldf_bilap = .FALSE. !: bilaplacian operator 19 LOGICAL , PUBLIC :: ln_traldf_level = .FALSE. !: iso-level direction 20 LOGICAL , PUBLIC :: ln_traldf_hor = .FALSE. !: horizontal (geopotential) direction 21 LOGICAL , PUBLIC :: ln_traldf_iso = .TRUE. !: iso-neutral direction 22 REAL(wp), PUBLIC :: rn_aht_0 = 2000._wp !: lateral eddy diffusivity (m2/s) 23 REAL(wp), PUBLIC :: rn_ahtb_0 = 0._wp !: lateral background eddy diffusivity (m2/s) 24 REAL(wp), PUBLIC :: rn_aeiv_0 = 2000._wp !: eddy induced velocity coefficient (m2/s) 25 25 26 LOGICAL , PUBLIC :: & !!: ** lateral mixing namelist (nam_traldf) ** 27 ln_traldf_lap = .TRUE. , & !: laplacian operator 28 ln_traldf_bilap = .FALSE. , & !: bilaplacian operator 29 ln_traldf_level = .FALSE. , & !: iso-level direction 30 ln_traldf_hor = .FALSE. , & !: horizontal (geopotential) direction 31 ln_traldf_iso = .TRUE. !: iso-neutral direction 32 33 REAL(wp), PUBLIC :: & !!: ** lateral mixing namelist (namldf) ** 34 aht0 = 2000._wp , & !: lateral eddy diffusivity (m2/s) 35 ahtb0 = 0._wp , & !: lateral background eddy diffusivity (m2/s) 36 aeiv0 = 2000._wp !: eddy induced velocity coefficient (m2/s) 26 REAL(wp), PUBLIC :: aht0, ahtb0, aeiv0 !!: OLD namelist names 37 27 38 28 #if defined key_traldf_c3d 39 REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) :: & !: ** 3D coefficients **29 REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) :: ahtt, ahtu, ahtv, ahtw !: ** 3D coefficients ** at T-, U-, V-, W-points 40 30 #elif defined key_traldf_c2d 41 REAL(wp), PUBLIC, DIMENSION(jpi,jpj) :: & !: ** 2D coefficients **31 REAL(wp), PUBLIC, DIMENSION(jpi,jpj) :: ahtt, ahtu, ahtv, ahtw !: ** 2D coefficients ** at T-, U-, V-, W-points 42 32 #elif defined key_traldf_c1d 43 REAL(wp), PUBLIC, DIMENSION(jpk) :: & !: ** 1D coefficients **33 REAL(wp), PUBLIC, DIMENSION(jpk) :: ahtt, ahtu, ahtv, ahtw !: ** 1D coefficients ** at T-, U-, V-, W-points 44 34 #else 45 REAL(wp), PUBLIC :: & !: ** 0D coefficients **35 REAL(wp), PUBLIC :: ahtt, ahtu, ahtv, ahtw !: ** 0D coefficients ** at T-, U-, V-, W-points 46 36 #endif 47 ahtt, ahtu, ahtv, ahtw !: T-, U-, V-, W-points coefficients48 37 49 38 … … 55 44 56 45 # if defined key_traldf_c3d 57 REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) :: & !: ** 3D coefficients **46 REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) :: aeiu, aeiv, aeiw !: ** 3D coefficients ** at U-, V-, W-points [m2/s] 58 47 # elif defined key_traldf_c2d 59 REAL(wp), PUBLIC, DIMENSION(jpi,jpj) :: & !: ** 2D coefficients **48 REAL(wp), PUBLIC, DIMENSION(jpi,jpj) :: aeiu, aeiv, aeiw !: ** 2D coefficients ** at U-, V-, W-points [m2/s] 60 49 # elif defined key_traldf_c1d 61 REAL(wp), PUBLIC, DIMENSION(jpk) :: & !: ** 1D coefficients **50 REAL(wp), PUBLIC, DIMENSION(jpk) :: aeiu, aeiv, aeiw !: ** 1D coefficients ** at U-, V-, W-points [m2/s] 62 51 # else 63 REAL(wp), PUBLIC :: & !: ** 0D coefficients **52 REAL(wp), PUBLIC :: aeiu, aeiv, aeiw !: ** 0D coefficients ** at U-, V-, W-points [m2/s] 64 53 # endif 65 aeiu, aeiv, aeiw !: U-, V-, W-points induced velocity coef. (m2/s)66 67 54 # if defined key_diaeiv 68 REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) :: & !: 69 u_eiv, v_eiv, w_eiv !: The three component of the eddy induced velocity (m/s) 55 REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) :: u_eiv, v_eiv, w_eiv !: eddy induced velocity [m/s] 70 56 # endif 71 57 … … 75 61 !!---------------------------------------------------------------------- 76 62 LOGICAL , PUBLIC, PARAMETER :: lk_traldf_eiv = .FALSE. !: eddy induced velocity flag 77 REAL(wp), PUBLIC :: aeiu, aeiv, aeiw63 REAL(wp), PUBLIC :: aeiu, aeiv, aeiw !: eddy induced coef. (not used) 78 64 #endif 79 65 80 66 !!---------------------------------------------------------------------- 67 !! NEMO/OPA 3.2 , LOCEAN-IPSL (2009) 68 !! $Id$ 69 !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 70 !!===================================================================== 81 71 END MODULE ldftra_oce -
trunk/NEMO/OPA_SRC/OBC/obc_oce.F90
r1528 r1601 4 4 !! Open Boundary Cond. : define related variables 5 5 !!============================================================================== 6 !! OPA 9.0 , LOCEAN-IPSL (2005)7 !! $Id$8 !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt)9 !!----------------------------------------------------------------------10 6 !!---------------------------------------------------------------------- 11 7 !! 'key_obc' : Open Boundary Condition … … 29 25 !! open boundary variables 30 26 !!---------------------------------------------------------------------- 31 !! 27 ! 28 ! !!* Namelist namobc: open boundary condition * 29 INTEGER :: nn_nbobc = 2 !: number of open boundaries ( 1=< nbobc =< 4 ) 30 INTEGER :: nn_obcdta = 0 !: = 0 use the initial state as obc data 31 ! ! = 1 read obc data in obcxxx.dta files 32 CHARACTER(len=20) :: cn_obcdta = 'annual' !: set to annual if obc datafile hold 1 year of data 33 ! ! set to monthly if obc datafile hold 1 month of data 34 LOGICAL :: ln_obc_clim = .true. !: obc data files are climatological 35 LOGICAL :: ln_obc_fla = .false. !: Flather open boundary condition not used 36 LOGICAL :: ln_vol_cst = .true. !: Conservation of the whole volume 37 REAL(wp) :: rn_dpein = 1. !: damping time scale for inflow at East open boundary 38 REAL(wp) :: rn_dpwin = 1. !: " " at West open boundary 39 REAL(wp) :: rn_dpsin = 1. !: " " at South open boundary 40 REAL(wp) :: rn_dpnin = 1. !: " " at North open boundary 41 REAL(wp) :: rn_dpeob = 15. !: damping time scale for the climatology at East open boundary 42 REAL(wp) :: rn_dpwob = 15. !: " " at West open boundary 43 REAL(wp) :: rn_dpsob = 15. !: " " at South open boundary 44 REAL(wp) :: rn_dpnob = 15. !: " " at North open boundary 45 REAL(wp) :: rn_volemp = 1. !: = 0 the total volume will have the variability of the 46 ! ! surface Flux E-P else (volemp = 1) the volume will be constant 47 ! ! = 1 the volume will be constant during all the integration. 48 49 ! !!! OLD non-DOCTOR name of namelist variables 50 INTEGER :: nbobc !: number of open boundaries ( 1=< nbobc =< 4 ) 51 INTEGER :: nobc_dta !: = 0 use the initial state as obc data 52 REAL(wp) :: rdpein !: damping time scale for inflow at East open boundary 53 REAL(wp) :: rdpwin !: " " at West open boundary 54 REAL(wp) :: rdpsin !: " " at South open boundary 55 REAL(wp) :: rdpnin !: " " at North open boundary 56 REAL(wp) :: rdpeob !: damping time scale for the climatology at East open boundary 57 REAL(wp) :: rdpwob !: " " at West open boundary 58 REAL(wp) :: rdpsob !: " " at South open boundary 59 REAL(wp) :: rdpnob !: " " at North open boundary 60 REAL(wp) :: volemp !: = 0 the total volume will have the variability of the 61 CHARACTER(len=20) :: cffile 62 63 32 64 !!General variables for open boundaries: 33 65 !!-------------------------------------- 34 INTEGER :: & !: * namelist ??? *35 nbobc = 2 , & !: number of open boundaries ( 1=< nbobc =< 4 )36 nobc_dta = 0 !: = 0 use the initial state as obc data37 ! ! = 1 read obc data in obcxxx.dta files38 39 LOGICAL :: ln_obc_clim = .true. !: obc data files are climatological40 LOGICAL :: ln_obc_fla = .false. !: Flather open boundary condition not used41 LOGICAL :: ln_vol_cst = .true. !: Conservation of the whole volume42 43 REAL(wp) :: & !!: open boundary namelist (namobc)44 rdpein = 1. , & !: damping time scale for inflow at East open boundary45 rdpwin = 1. , & !: " " at West open boundary46 rdpsin = 1. , & !: " " at South open boundary47 rdpnin = 1. , & !: " " at North open boundary48 rdpeob = 15. , & !: damping time scale for the climatology at East open boundary49 rdpwob = 15. , & !: " " at West open boundary50 rdpsob = 15. , & !: " " at South open boundary51 rdpnob = 15. , & !: " " at North open boundary52 volemp = 1. !: = 0 the total volume will have the variability of the53 ! surface Flux E-P else (volemp = 1) the volume will be constant54 ! = 1 the volume will be constant during all the integration.55 56 66 LOGICAL :: & !: 57 67 lfbceast, lfbcwest, & !: logical flag for a fixed East and West open boundaries … … 60 70 ! ! scale are set to 0 in the namelist, for both inflow and outflow). 61 71 62 REAL(wp), PUBLIC :: & !: 63 obcsurftot !: Total lateral surface of open boundaries 72 REAL(wp), PUBLIC :: obcsurftot !: Total lateral surface of open boundaries 64 73 65 74 REAL(wp), PUBLIC, DIMENSION(jpi,jpj) :: & !: … … 79 88 INTEGER :: nje1m2, nje0m1 !: do loop index in mpp case for jpjefm1-1,jpjed 80 89 81 REAL(wp), DIMENSION(jpj) :: & !:82 bsfeob !: now barotropic stream fuction computed at the OBC. The corres-83 ! ! ponding bsfn will be computed by the forward time step in dynspg.84 85 REAL(wp), DIMENSION(jpj,3,3) :: & !:86 bebnd !: east boundary barotropic streamfunction over 3 rows87 ! ! and 3 time step (now, before, and before before)88 89 90 REAL(wp), DIMENSION(jpjed:jpjef) :: & !: 90 bfoe, & !: now climatology of the east boundary barotropic stream function91 91 sshfoe, & !: now climatology of the east boundary sea surface height 92 92 ubtfoe,vbtfoe !: now climatology of the east boundary barotropic transport … … 98 98 ! ! in the obcdyn.F90 routine 99 99 100 REAL(wp), DIMENSION(jpjed:jpjef,jpj) :: & !: 101 sshfoe_b !: east boundary ssh correction averaged over the barotropic loop 102 !: (if Flather's algoritm applied at open boundary) 100 REAL(wp), DIMENSION(jpjed:jpjef,jpj) :: sshfoe_b !: east boundary ssh correction averaged over the barotropic loop 101 ! ! (if Flather's algoritm applied at open boundary) 103 102 104 103 !!------------------------------- 105 104 !! Arrays for radiative East OBC: 106 105 !!------------------------------- 107 REAL(wp), DIMENSION(jpj,jpk,3,3) :: & !: 108 uebnd, vebnd !: baroclinic u & v component of the velocity over 3 rows 109 ! and 3 time step (now, before, and before before) 110 111 REAL(wp), DIMENSION(jpj,jpk,2,2) :: & !: 112 tebnd, sebnd !: East boundary temperature and salinity over 2 rows 113 ! and 2 time step (now and before) 114 115 REAL(wp), DIMENSION(jpj,jpk) :: & !: 116 u_cxebnd, v_cxebnd !: Zonal component of the phase speed ratio computed with 117 ! radiation of u and v velocity (respectively) at the 118 ! east open boundary (u_cxebnd = cx rdt ) 119 120 REAL(wp), DIMENSION(jpj,jpk) :: & !: 121 uemsk, vemsk, temsk !: 2D mask for the East OB 106 REAL(wp), DIMENSION(jpj,jpk,3,3) :: uebnd, vebnd !: baroclinic u & v component of the velocity over 3 rows 107 ! ! and 3 time step (now, before, and before before) 108 REAL(wp), DIMENSION(jpj,jpk,2,2) :: tebnd, sebnd !: East boundary temperature and salinity over 2 rows 109 ! ! and 2 time step (now and before) 110 REAL(wp), DIMENSION(jpj,jpk) :: u_cxebnd, v_cxebnd !: Zonal component of the phase speed ratio computed with 111 ! ! radiation of u and v velocity (respectively) at the 112 ! ! east open boundary (u_cxebnd = cx rdt ) 113 REAL(wp), DIMENSION(jpj,jpk) :: uemsk, vemsk, temsk !: 2D mask for the East OB 122 114 123 115 ! Note that those arrays are optimized for mpp case … … 133 125 INTEGER :: njw1m2, njw0m1 !: do loop index in mpp case for jpjwfm2,jpjwd 134 126 135 REAL(wp), DIMENSION(jpj) :: & !:136 bsfwob !: now barotropic stream fuction computed at the OBC. The corres-137 ! ! ponding bsfn will be computed by the forward time step in dynspg.138 139 REAL(wp), DIMENSION(jpj,3,3) :: & !:140 bwbnd !: West boundary barotropic streamfunction over141 ! ! 3 rows and 3 time step (now, before, and before before)142 143 127 REAL(wp), DIMENSION(jpjwd:jpjwf) :: & !: 144 bfow, & !: now climatology of the west boundary barotropic stream function145 128 sshfow, & !: now climatology of the west boundary sea surface height 146 129 ubtfow,vbtfow !: now climatology of the west boundary barotropic transport … … 152 135 ! ! in the obcdyn.F90 routine 153 136 154 REAL(wp), DIMENSION(jpjwd:jpjwf,jpj) :: & !: 155 sshfow_b !: west boundary ssh correction averaged over the barotropic loop 156 !: (if Flather's algoritm applied at open boundary) 137 REAL(wp), DIMENSION(jpjwd:jpjwf,jpj) :: sshfow_b !: west boundary ssh correction averaged over the barotropic loop 138 ! ! (if Flather's algoritm applied at open boundary) 157 139 158 140 !!------------------------------- 159 141 !! Arrays for radiative West OBC 160 142 !!------------------------------- 161 REAL(wp), DIMENSION(jpj,jpk,3,3) :: & !: 162 uwbnd, vwbnd !: baroclinic u & v components of the velocity over 3 rows 163 ! ! and 3 time step (now, before, and before before) 164 165 REAL(wp), DIMENSION(jpj,jpk,2,2) :: & !: 166 twbnd, swbnd !: west boundary temperature and salinity over 2 rows and 167 ! ! 2 time step (now and before) 168 169 REAL(wp), DIMENSION(jpj,jpk) :: & !: 170 u_cxwbnd, v_cxwbnd !: Zonal component of the phase speed ratio computed with 171 ! ! radiation of zonal and meridional velocity (respectively) 172 ! ! at the west open boundary (u_cxwbnd = cx rdt ) 173 174 REAL(wp), DIMENSION(jpj,jpk) :: & !: 175 uwmsk, vwmsk, twmsk !: 2D mask for the West OB 143 REAL(wp), DIMENSION(jpj,jpk,3,3) :: uwbnd, vwbnd !: baroclinic u & v components of the velocity over 3 rows 144 ! ! and 3 time step (now, before, and before before) 145 REAL(wp), DIMENSION(jpj,jpk,2,2) :: twbnd, swbnd !: west boundary temperature and salinity over 2 rows and 146 ! ! 2 time step (now and before) 147 REAL(wp), DIMENSION(jpj,jpk) :: u_cxwbnd, v_cxwbnd !: Zonal component of the phase speed ratio computed with 148 ! ! radiation of zonal and meridional velocity (respectively) 149 ! ! at the west open boundary (u_cxwbnd = cx rdt ) 150 REAL(wp), DIMENSION(jpj,jpk) :: uwmsk, vwmsk, twmsk !: 2D mask for the West OB 176 151 177 152 ! Note that those arrays are optimized for mpp case … … 188 163 INTEGER :: njn0m1, njn1m1 !: do loop index in mpp case for jpnob-1 189 164 190 REAL(wp), DIMENSION(jpi) :: & !:191 bsfnob !: now barotropic stream fuction computed at the OBC. The corres-192 ! ! ponding bsfn will be computed by the forward time step in dynspg.193 194 REAL(wp), DIMENSION(jpi,3,3) :: & !:195 bnbnd !: north boundary barotropic streamfunction over196 ! ! 3 rows and 3 time step (now, before, and before before)197 198 165 REAL(wp), DIMENSION(jpind:jpinf) :: & !: 199 bfon, & !: now climatology of the north boundary barotropic stream function200 166 sshfon, & !: now climatology of the north boundary sea surface height 201 167 ubtfon,vbtfon !: now climatology of the north boundary barotropic transport … … 207 173 ! ! in yhe obcdyn.F90 routine 208 174 209 REAL(wp), DIMENSION(jpind:jpinf,jpj) :: & !: 210 sshfon_b !: north boundary ssh correction averaged over the barotropic loop 211 !: (if Flather's algoritm applied at open boundary) 175 REAL(wp), DIMENSION(jpind:jpinf,jpj) :: sshfon_b !: north boundary ssh correction averaged over the barotropic loop 176 ! ! (if Flather's algoritm applied at open boundary) 212 177 213 178 !!-------------------------------- 214 179 !! Arrays for radiative North OBC 215 180 !!-------------------------------- 216 !! 217 REAL(wp), DIMENSION(jpi,jpk,3,3) :: & !: 218 unbnd, vnbnd !: baroclinic u & v components of the velocity over 3 219 ! ! rows and 3 time step (now, before, and before before) 220 221 REAL(wp), DIMENSION(jpi,jpk,2,2) :: & !: 222 tnbnd, snbnd !: north boundary temperature and salinity over 223 ! ! 2 rows and 2 time step (now and before) 224 225 REAL(wp), DIMENSION(jpi,jpk) :: & !: 226 u_cynbnd, v_cynbnd !: Meridional component of the phase speed ratio compu- 227 ! ! ted with radiation of zonal and meridional velocity 228 ! ! (respectively) at the north OB (u_cynbnd = cx rdt ) 229 230 REAL(wp), DIMENSION(jpi,jpk) :: & !: 231 unmsk, vnmsk, tnmsk !: 2D mask for the North OB 181 REAL(wp), DIMENSION(jpi,jpk,3,3) :: unbnd, vnbnd !: baroclinic u & v components of the velocity over 3 182 ! ! rows and 3 time step (now, before, and before before) 183 REAL(wp), DIMENSION(jpi,jpk,2,2) :: tnbnd, snbnd !: north boundary temperature and salinity over 184 ! ! 2 rows and 2 time step (now and before) 185 REAL(wp), DIMENSION(jpi,jpk) :: u_cynbnd, v_cynbnd !: Meridional component of the phase speed ratio compu- 186 ! ! ted with radiation of zonal and meridional velocity 187 ! ! (respectively) at the north OB (u_cynbnd = cx rdt ) 188 REAL(wp), DIMENSION(jpi,jpk) :: unmsk, vnmsk, tnmsk !: 2D mask for the North OB 232 189 233 190 ! Note that those arrays are optimized for mpp case … … 243 200 INTEGER :: njs0p1, njs1p1 !: do loop index in mpp case for jpsob+1 244 201 245 REAL(wp), DIMENSION(jpi) :: & !:246 bsfsob !: now barotropic stream fuction computed at the OBC.The corres-247 ! ! ponding bsfn will be computed by the forward time step in dynspg.248 REAL(wp), DIMENSION(jpi,3,3) :: & !:249 bsbnd !: south boundary barotropic stream function over250 ! ! 3 rows and 3 time step (now, before, and before before)251 252 202 REAL(wp), DIMENSION(jpisd:jpisf) :: & !: 253 bfos, & !: now climatology of the south boundary barotropic stream function254 203 sshfos, & !: now climatology of the south boundary sea surface height 255 204 ubtfos,vbtfos !: now climatology of the south boundary barotropic transport … … 261 210 ! ! in the obcdyn.F90 routine 262 211 263 REAL(wp), DIMENSION(jpisd:jpisf,jpj) :: & !: 264 sshfos_b !: south boundary ssh correction averaged over the barotropic loop 265 !: (if Flather's algoritm applied at open boundary) 266 267 !!-------------------------------- 268 !! Arrays for radiative South OBC 269 !!-------------------------------- 270 !! computed by the forward time step in dynspg. 271 REAL(wp), DIMENSION(jpi,jpk,3,3) :: & !: 272 usbnd, vsbnd !: baroclinic u & v components of the velocity over 3 273 ! ! rows and 3 time step (now, before, and before before) 274 275 REAL(wp), DIMENSION(jpi,jpk,2,2) :: & !: 276 tsbnd, ssbnd !: south boundary temperature and salinity over 277 ! ! 2 rows and 2 time step (now and before) 278 279 REAL(wp), DIMENSION(jpi,jpk) :: & !: 280 u_cysbnd, v_cysbnd !: Meridional component of the phase speed ratio compu- 281 ! ! ted with radiation of zonal and meridional velocity 282 ! ! (repsectively) at the south OB (u_cynbnd = cx rdt ) 283 284 REAL(wp), DIMENSION(jpi,jpk) :: & !: 285 usmsk, vsmsk, tsmsk !: 2D mask for the South OB 286 287 CHARACTER ( len=20 ) :: cffile 212 REAL(wp), DIMENSION(jpisd:jpisf,jpj) :: sshfos_b !: south boundary ssh correction averaged over the barotropic loop 213 ! ! (if Flather's algoritm applied at open boundary) 214 215 !!-------------------------------- 216 !! Arrays for radiative South OBC (computed by the forward time step in dynspg) 217 !!-------------------------------- 218 REAL(wp), DIMENSION(jpi,jpk,3,3) :: usbnd, vsbnd !: baroclinic u & v components of the velocity over 3 219 ! ! rows and 3 time step (now, before, and before before) 220 REAL(wp), DIMENSION(jpi,jpk,2,2) :: tsbnd, ssbnd !: south boundary temperature and salinity over 221 ! ! 2 rows and 2 time step (now and before) 222 REAL(wp), DIMENSION(jpi,jpk) :: u_cysbnd, v_cysbnd !: Meridional component of the phase speed ratio 223 ! ! computed with radiation of zonal and meridional velocity 224 ! ! (repsectively) at the south OB (u_cynbnd = cx rdt ) 225 REAL(wp), DIMENSION(jpi,jpk) :: usmsk, vsmsk, tsmsk !: 2D mask for the South OB 288 226 289 227 #else … … 293 231 #endif 294 232 233 !!---------------------------------------------------------------------- 234 !! NEMO/OPA 3.2 , LOCEAN-IPSL (2009) 235 !! $Id$ 236 !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 295 237 !!====================================================================== 296 238 END MODULE obc_oce -
trunk/NEMO/OPA_SRC/OBC/obcini.F90
r1528 r1601 1 1 MODULE obcini 2 !!====================================================================== ===========2 !!====================================================================== 3 3 !! *** MODULE obcini *** 4 4 !! OBC initial state : Open boundary initial state 5 !!================================================================================= 5 !!====================================================================== 6 !! History : 8.0 ! 97-07 (J.M. Molines, G. Madec) Original code 7 !! NEMO 1.0 ! 02-11 (C. Talandier, A-M. Treguier) Free surface, F90 8 !! 2.0 ! 05-11 (V. Garnier) Surface pressure gradient organization 9 !!---------------------------------------------------------------------- 6 10 #if defined key_obc 7 !!---------------------------------------------------------------------- -----------8 !! 'key_obc' 9 !!---------------------------------------------------------------------- -----------11 !!---------------------------------------------------------------------- 12 !! 'key_obc' Open Boundary Conditions 13 !!---------------------------------------------------------------------- 10 14 !! obc_init : initialization for the open boundary condition 11 !!--------------------------------------------------------------------------------- 12 !! * Modules used 15 !!---------------------------------------------------------------------- 13 16 USE oce ! ocean dynamics and tracers variables 14 17 USE dom_oce ! ocean space and time domain variables … … 23 26 PRIVATE 24 27 25 !! * Routine accessibility 26 PUBLIC obc_init ! routine called by opa.F90 28 PUBLIC obc_init ! routine called by opa.F90 27 29 28 30 !! * Substitutions 29 31 # include "obc_vectopt_loop_substitute.h90" 30 !!---------------------------------------------------------------------- -----------31 !! 32 !!---------------------------------------------------------------------- 33 !! NEMO/OPA 9.0 , LOCEAN-IPSL (2005) 32 34 !! $Id$ 33 !! This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt34 !!---------------------------------------------------------------------- -----------35 !! software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 36 !!---------------------------------------------------------------------- 35 37 36 38 CONTAINS … … 41 43 !! 42 44 !! ** Purpose : Initialization of the dynamics and tracer fields at 43 !! the open boundaries.45 !! the open boundaries. 44 46 !! 45 47 !! ** Method : initialization of open boundary variables … … 51 53 !! 52 54 !! ** Input : restart.obc file, restart file for open boundaries 55 !!---------------------------------------------------------------------- 56 USE obcrst, ONLY : obc_rst_read ! Make obc_rst_read routine available 53 57 !! 54 !! History :55 !! 8.0 ! 97-07 (G. Madec) Original code56 !! ! 97-11 (J.M. Molines)57 !! 8.5 ! 02-11 (C. Talandier, A-M. Treguier) Free surface, F9058 !! 9.0 ! 05-11 (V. Garnier) Surface pressure gradient organization59 !!----------------------------------------------------------------------60 !! * Modules used61 USE obcrst, ONLY : obc_rst_read ! Make obc_rst_read routine available62 63 !! * Local declarations64 58 INTEGER :: ji, jj, istop , inumfbc 65 59 INTEGER, DIMENSION(4) :: icorner 66 REAL(wp) :: zbsic1, zbsic2, zbsic367 60 REAL(wp), DIMENSION(2) :: ztestmask 68 69 NAMELIST/namobc/ rdpein, rdpwin, rdpnin, rdpsin, & 70 & rdpeob, rdpwob, rdpnob, rdpsob, & 71 & zbsic1, zbsic2, zbsic3, & 72 & volemp, nobc_dta, cffile, & 61 !! 62 NAMELIST/namobc/ rn_dpein, rn_dpwin, rn_dpnin, rn_dpsin, & 63 & rn_dpeob, rn_dpwob, rn_dpnob, rn_dpsob, & 64 & rn_volemp, nn_obcdta, cn_obcdta, rn_volemp & 73 65 & ln_obc_clim, ln_vol_cst, ln_obc_fla 74 66 !!---------------------------------------------------------------------- 75 67 76 IF(lwp) WRITE(numout,*) 77 IF(lwp) WRITE(numout,*) 'obc_init : initialization of open boundaries' 78 IF(lwp) WRITE(numout,*) '~~~~~~~~' 79 80 81 ! 0. read namelist parameters 82 ! --------------------------- 83 ! default values already set except: 84 zbsic1 = 0.e0 85 zbsic2 = 0.e0 86 zbsic3 = 0.e0 87 88 ! Namelist namobc : open boundaries 89 REWIND( numnam ) 68 REWIND( numnam ) ! Namelist namobc : open boundaries 90 69 READ ( numnam, namobc ) 91 70 92 ! By security we set rdpxin and rdpxob respectively 93 ! to 1. and 15. if the corresponding OBC is not activated 94 IF( .NOT.lp_obc_east ) THEN ; rdpein = 1. ; rdpeob = 15. ; END IF 95 IF( .NOT.lp_obc_west ) THEN ; rdpwin = 1. ; rdpwob = 15. ; END IF 96 IF( .NOT.lp_obc_north ) THEN ; rdpnin = 1. ; rdpnob = 15. ; END IF 97 IF( .NOT.lp_obc_south ) THEN ; rdpsin = 1. ; rdpsob = 15. ; END IF 71 ! convert DOCTOR namelist name into the OLD names 72 nbobc = nn_nbobc 73 nobc_dta = nn_obcdta 74 cffile = cn_obcdta 75 rdpein = rn_dpein 76 rdpwin = rn_dpwin 77 rdpsin = rn_dpsin 78 rdpnin = rn_dpnin 79 rdpeob = rn_dpeob 80 rdpwob = rn_dpwob 81 rdpsob = rn_dpsob 82 rdpnob = rn_dpnob 83 volemp = rn_volemp 84 85 86 87 ! By security we set rdpxin and rdpxob respectively to 1. and 15. if the corresponding OBC is not activated 88 IF( .NOT.lp_obc_east ) THEN ; rdpein = 1. ; rdpeob = 15. ; END IF 89 IF( .NOT.lp_obc_west ) THEN ; rdpwin = 1. ; rdpwob = 15. ; END IF 90 IF( .NOT.lp_obc_north ) THEN ; rdpnin = 1. ; rdpnob = 15. ; END IF 91 IF( .NOT.lp_obc_south ) THEN ; rdpsin = 1. ; rdpsob = 15. ; END IF 98 92 99 93 ! number of open boudaries and open boundary indicators … … 104 98 IF( lp_obc_south ) nbobc = nbobc + 1 105 99 106 IF(lwp) WRITE(numout,*) ' Number of open boundaries nbobc = ',nbobc107 100 IF(lwp) WRITE(numout,*) 108 IF( nbobc /= 0 .AND. jperio /= 0 ) & 109 & CALL ctl_stop( ' Cyclic or symmetric, and open boundary condition are not compatible' ) 101 IF(lwp) WRITE(numout,*) 'obc_init : initialization of open boundaries' 102 IF(lwp) WRITE(numout,*) '~~~~~~~~' 103 IF(lwp) WRITE(numout,*) ' Number of open boundaries nn_nbobc = ', nn_nbobc 104 IF(lwp) WRITE(numout,*) 110 105 111 106 ! control prints 112 IF(lwp) WRITE(numout,*) ' namobc' 107 IF(lwp) WRITE(numout,*) ' Namelist namobc' 108 IF(lwp) WRITE(numout,*) ' data in file (=1) or initial state used (=0) nn_obcdta = ', nn_obcdta 109 IF(lwp) WRITE(numout,*) ' climatology (true) or not ln_obc_clim = ', ln_obc_clim 110 IF(lwp) WRITE(numout,*) ' vol_cst (true) or not: ln_vol_cst = ', ln_vol_cst 113 111 IF(lwp) WRITE(numout,*) ' ' 114 IF(lwp) WRITE(numout,*) ' data in file (=1) or nobc_dta = ', nobc_dta 115 IF(lwp) WRITE(numout,*) ' initial state used (=0) ' 116 IF(lwp) WRITE(numout,*) ' climatology (true) or not:', ln_obc_clim 117 IF(lwp) WRITE(numout,*) ' vol_cst (true) or not:', ln_vol_cst 118 IF(lwp) THEN 119 IF ( lk_dynspg_flt ) WRITE(numout,*) ' dynspg_flt T ==> vol_cst forced to T' 120 ENDIF 121 IF(lwp) WRITE(numout,*) ' ' 122 IF(lwp) WRITE(numout,*) ' WARNING ' 123 IF(lwp) WRITE(numout,*) ' Flather"s algorithm is applied with explicit free surface scheme ' 124 IF(lwp) WRITE(numout,*) ' or with free surface time-splitting scheme ' 125 IF(lwp) WRITE(numout,*) ' Nor radiation neither relaxation is allowed with explicit free surface scheme: ' 126 IF(lwp) WRITE(numout,*) ' Radiation and/or relaxation is allowed with free surface time-splitting scheme ' 127 IF(lwp) WRITE(numout,*) ' depending of the choice of rdpXin = rdpXob = 0. for open boundaries ' 128 IF(lwp) WRITE(numout,*) ' ' 129 IF(lwp) WRITE(numout,*) ' For the filtered free surface case, ' 130 IF(lwp) WRITE(numout,*) ' radiation, relaxation or presciption of data can be applied ' 112 IF(lwp) WRITE(numout,*) ' WARNING ' 113 IF(lwp) WRITE(numout,*) ' Flather"s algorithm is applied with explicit free surface scheme ' 114 IF(lwp) WRITE(numout,*) ' or with free surface time-splitting scheme ' 115 IF(lwp) WRITE(numout,*) ' Nor radiation neither relaxation is allowed with explicit free surface scheme: ' 116 IF(lwp) WRITE(numout,*) ' Radiation and/or relaxation is allowed with free surface time-splitting scheme ' 117 IF(lwp) WRITE(numout,*) ' depending of the choice of rdpXin = rdpXob = 0. for open boundaries ' 118 IF(lwp) WRITE(numout,*) 119 IF(lwp) WRITE(numout,*) ' For the filtered free surface case, ' 120 IF(lwp) WRITE(numout,*) ' radiation, relaxation or presciption of data can be applied ' 121 IF(lwp) WRITE(numout,*) 131 122 132 123 IF( lwp.AND.lp_obc_east ) THEN 133 WRITE(numout,*) ' 134 WRITE(numout,*) ' i index jpieob= ', jpieob135 WRITE(numout,*) ' damping time scale (days) rdpeob = ', rdpeob136 WRITE(numout,*) ' damping time scale (days) rdpein = ', rdpein124 WRITE(numout,*) ' East open boundary :' 125 WRITE(numout,*) ' i index jpieob = ', jpieob 126 WRITE(numout,*) ' damping time scale (days) rn_dpeob = ', rn_dpeob 127 WRITE(numout,*) ' damping time scale (days) rn_dpein = ', rn_dpein 137 128 ENDIF 138 129 139 130 IF( lwp.AND.lp_obc_west ) THEN 140 WRITE(numout,*) ' 141 WRITE(numout,*) ' i index jpiwob= ', jpiwob142 WRITE(numout,*) ' damping time scale (days) rdpwob = ', rdpwob143 WRITE(numout,*) ' damping time scale (days) rdpwin = ', rdpwin131 WRITE(numout,*) ' West open boundary :' 132 WRITE(numout,*) ' i index jpiwob = ', jpiwob 133 WRITE(numout,*) ' damping time scale (days) rn_dpwob = ', rn_dpwob 134 WRITE(numout,*) ' damping time scale (days) rn_dpwin = ', rn_dpwin 144 135 ENDIF 145 136 146 137 IF( lwp.AND.lp_obc_north ) THEN 147 WRITE(numout,*) ' 148 WRITE(numout,*) ' j index jpjnob= ', jpjnob149 WRITE(numout,*) ' damping time scale (days) rdpnob = ', rdpnob150 WRITE(numout,*) ' damping time scale (days) rdpnin = ', rdpnin138 WRITE(numout,*) ' North open boundary :' 139 WRITE(numout,*) ' j index jpjnob = ', jpjnob 140 WRITE(numout,*) ' damping time scale (days) rn_dpnob = ', rn_dpnob 141 WRITE(numout,*) ' damping time scale (days) rn_dpnin = ', rn_dpnin 151 142 ENDIF 152 143 153 144 IF( lwp.AND.lp_obc_south ) THEN 154 WRITE(numout,*) ' South open boundary :' 155 WRITE(numout,*) ' j index jpjsob = ', jpjsob 156 WRITE(numout,*) ' damping time scale (days) rdpsob = ', rdpsob 157 WRITE(numout,*) ' damping time scale (days) rdpsin = ', rdpsin 158 WRITE(numout,*) ' ' 159 ENDIF 145 WRITE(numout,*) ' South open boundary :' 146 WRITE(numout,*) ' j index jpjsob = ', jpjsob 147 WRITE(numout,*) ' damping time scale (days) rn_dpsob = ', rn_dpsob 148 WRITE(numout,*) ' damping time scale (days) rn_dpsin = ', rn_dpsin 149 WRITE(numout,*) 150 ENDIF 151 152 IF( nbobc /= 0 .AND. jperio /= 0 ) & 153 & CALL ctl_stop( ' Cyclic or symmetric, and open boundary condition are not compatible' ) 160 154 161 155 ! 1. Initialisation of constants 162 156 ! ------------------------------ 163 164 157 ! ... convert rdp$ob in seconds 165 158 ! Fixed Bdy flag inbound outbound 166 lfbceast = .FALSE. ; rdpein = rdpein * rday ;rdpeob = rdpeob * rday167 lfbcwest = .FALSE. ; rdpwin = rdpwin * rday ;rdpwob = rdpwob * rday168 lfbcnorth = .FALSE. ; rdpnin = rdpnin * rday ;rdpnob = rdpnob * rday169 lfbcsouth = .FALSE. ; rdpsin = rdpsin * rday ;rdpsob = rdpsob * rday159 lfbceast = .FALSE. ; rdpein = rdpein * rday ; rdpeob = rdpeob * rday 160 lfbcwest = .FALSE. ; rdpwin = rdpwin * rday ; rdpwob = rdpwob * rday 161 lfbcnorth = .FALSE. ; rdpnin = rdpnin * rday ; rdpnob = rdpnob * rday 162 lfbcsouth = .FALSE. ; rdpsin = rdpsin * rday ; rdpsob = rdpsob * rday 170 163 inumfbc = 0 171 164 ! ... look for Fixed Boundaries (rdp = 0 ) … … 175 168 IF( lp_obc_east ) THEN 176 169 IF( (rdpein+rdpeob) == 0 ) THEN 177 lfbceast = .TRUE. ; rdpein = 1e-3 ;rdpeob = 1e-3170 lfbceast = .TRUE. ; rdpein = 1e-3 ; rdpeob = 1e-3 178 171 inumfbc = inumfbc+1 179 172 ELSEIF ( (rdpein*rdpeob) == 0 ) THEN 180 CALL ctl_stop( 'obc_init : r dpein & rdpeob must be both zero or non zero' )173 CALL ctl_stop( 'obc_init : rn_dpein & rn_dpeob must be both zero or non zero' ) 181 174 END IF 182 175 END IF … … 184 177 IF( lp_obc_west ) THEN 185 178 IF( (rdpwin + rdpwob) == 0 ) THEN 186 lfbcwest = .TRUE. ; rdpwin = 1e-3 ;rdpwob = 1e-3179 lfbcwest = .TRUE. ; rdpwin = 1e-3 ; rdpwob = 1e-3 187 180 inumfbc = inumfbc+1 188 181 ELSEIF ( (rdpwin*rdpwob) == 0 ) THEN 189 CALL ctl_stop( 'obc_init : r dpwin & rdpwob must be both zero or non zero' )182 CALL ctl_stop( 'obc_init : rn_dpwin & rn_dpwob must be both zero or non zero' ) 190 183 END IF 191 184 END IF 192 185 IF( lp_obc_north ) THEN 193 186 IF( (rdpnin + rdpnob) == 0 ) THEN 194 lfbcnorth = .TRUE. ; rdpnin = 1e-3 ;rdpnob = 1e-3187 lfbcnorth = .TRUE. ; rdpnin = 1e-3 ; rdpnob = 1e-3 195 188 inumfbc = inumfbc+1 196 189 ELSEIF ( (rdpnin*rdpnob) == 0 ) THEN 197 CALL ctl_stop( 'obc_init : r dpnin & rdpnob must be both zero or non zero' )190 CALL ctl_stop( 'obc_init : rn_dpnin & rn_dpnob must be both zero or non zero' ) 198 191 END IF 199 192 END IF 200 193 IF( lp_obc_south ) THEN 201 194 IF( (rdpsin + rdpsob) == 0 ) THEN 202 lfbcsouth = .TRUE. ; rdpsin = 1e-3 ;rdpsob = 1e-3195 lfbcsouth = .TRUE. ; rdpsin = 1e-3 ; rdpsob = 1e-3 203 196 inumfbc = inumfbc+1 204 197 ELSEIF ( (rdpsin*rdpsob) == 0 ) THEN 205 CALL ctl_stop( 'obc_init : r dpsin & rdpsob must be both zero or non zero' )198 CALL ctl_stop( 'obc_init : rn_dpsin & rn_dpsob must be both zero or non zero' ) 206 199 END IF 207 200 END IF … … 315 308 316 309 ! ... initilization to zero 317 uemsk(:,:) = 0.e0 ; vemsk(:,:) = 0.e0 ;temsk(:,:) = 0.e0310 uemsk(:,:) = 0.e0 ; vemsk(:,:) = 0.e0 ; temsk(:,:) = 0.e0 318 311 319 312 ! ... set 2D mask on East OBC, Vopt … … 333 326 334 327 ! ... initilization to zero 335 uwmsk(:,:) = 0.e0 ; vwmsk(:,:) = 0.e0 ;twmsk(:,:) = 0.e0328 uwmsk(:,:) = 0.e0 ; vwmsk(:,:) = 0.e0 ; twmsk(:,:) = 0.e0 336 329 337 330 ! ... set 2D mask on West OBC, Vopt … … 350 343 351 344 ! ... initilization to zero 352 unmsk(:,:) = 0.e0 ; vnmsk(:,:) = 0.e0 ;tnmsk(:,:) = 0.e0345 unmsk(:,:) = 0.e0 ; vnmsk(:,:) = 0.e0 ; tnmsk(:,:) = 0.e0 353 346 354 347 ! ... set 2D mask on North OBC, Vopt … … 368 361 369 362 ! ... initilization to zero 370 usmsk(:,:) = 0.e0 ; vsmsk(:,:) = 0.e0 ;tsmsk(:,:) = 0.e0363 usmsk(:,:) = 0.e0 ; vsmsk(:,:) = 0.e0 ; tsmsk(:,:) = 0.e0 371 364 372 365 ! ... set 2D mask on South OBC, Vopt -
trunk/NEMO/OPA_SRC/SBC/albedo.F90
r1463 r1601 4 4 !! Ocean forcing: bulk thermohaline forcing of the ocean (or ice) 5 5 !!===================================================================== 6 !! History : 8.0 ! 01-04 (LIM 1.0) 7 !! 8.5 ! 03-07 (C. Ethe, G. Madec) Optimization (old name:shine) 8 !! 9.0 ! 04-11 (C. Talandier) add albedo_init 9 !! - ! 01-06 (M. Vancoppenolle) LIM 3.0 10 !! - ! 06-08 (G. Madec) cleaning for surface module 6 !! History : 8.0 ! 2001-04 (LIM 1.0) 7 !! NEMO 1.0 ! 2003-07 (C. Ethe, G. Madec) Optimization (old name:shine) 8 !! - ! 2004-11 (C. Talandier) add albedo_init 9 !! - ! 2001-06 (M. Vancoppenolle) LIM 3.0 10 !! - ! 2006-08 (G. Madec) cleaning for surface module 11 !!---------------------------------------------------------------------- 12 11 13 !!---------------------------------------------------------------------- 12 14 !! albedo_ice : albedo for ice (clear and overcast skies) … … 20 22 PRIVATE 21 23 22 PUBLIC albedo_ice ! routine called sbcice_lim.F9023 PUBLIC albedo_oce ! routine called by ???24 PUBLIC albedo_ice ! routine called sbcice_lim.F90 25 PUBLIC albedo_oce ! routine called by ??? 24 26 25 27 INTEGER :: albd_init = 0 !: control flag for initialization … … 31 33 REAL(wp) :: rmue = 0.40 ! cosine of local solar altitude 32 34 33 !!* namelist namalb 34 REAL(wp) :: & 35 cgren = 0.06 , & ! cloudiness effect on snow or ice albedo (Grenfell & Perovich, 1984) 35 ! !!* namelist namsbc_alb 36 REAL(wp) :: rn_cloud = 0.06 ! cloudiness effect on snow or ice albedo (Grenfell & Perovich, 1984) 36 37 #if defined key_lim3 37 albice = 0.53 , &! albedo of melting ice in the arctic and antarctic (Shine & Hendersson-Sellers)38 REAL(wp) :: rn_albice = 0.53 ! albedo of melting ice in the arctic and antarctic (Shine & Hendersson-Sellers) 38 39 #else 39 albice = 0.50 , &! albedo of melting ice in the arctic and antarctic (Shine & Hendersson-Sellers)40 REAL(wp) :: rn_albice = 0.50 ! albedo of melting ice in the arctic and antarctic (Shine & Hendersson-Sellers) 40 41 #endif 41 alphd = 0.80 , &! coefficients for linear interpolation used to compute42 alphdi = 0.72 , &! albedo between two extremes values (Pyane, 1972)43 alphc = 0.6544 45 !!---------------------------------------------------------------------- 46 !! OPA 9.0 , LOCEAN-IPSL (2006)42 REAL(wp) :: rn_alphd = 0.80 ! coefficients for linear interpolation used to compute 43 REAL(wp) :: rn_alphdi = 0.72 ! albedo between two extremes values (Pyane, 1972) 44 REAL(wp) :: rn_alphc = 0.65 ! 45 46 !!---------------------------------------------------------------------- 47 !! NEMO/OPA 9.0 , LOCEAN-IPSL (2009) 47 48 !! $Id$ 48 49 !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) … … 82 83 !! 83 84 LOGICAL , DIMENSION(jpi,jpj,SIZE(pt_ice,3)) :: llmask 84 REAL(wp), DIMENSION(jpi,jpj,SIZE(pt_ice,3)) :: zalbfz ! = alphdi for freezing ice ; =albice for melting ice85 REAL(wp), DIMENSION(jpi,jpj,SIZE(pt_ice,3)) :: zalbfz ! = rn_alphdi for freezing ice ; = rn_albice for melting ice 85 86 REAL(wp), DIMENSION(jpi,jpj,SIZE(pt_ice,3)) :: zficeth ! function of ice thickness 86 87 !!--------------------------------------------------------------------- … … 95 96 llmask = ( ph_snw == 0.e0 ) .AND. ( pt_ice >= rt0_ice ) 96 97 ! ice free of snow and melts 97 WHERE( llmask ) 98 zalbfz = albice 99 ELSEWHERE 100 zalbfz = alphdi 98 WHERE( llmask ) ; zalbfz = rn_albice 99 ELSEWHERE ; zalbfz = rn_alphdi 101 100 END WHERE 102 101 … … 131 130 ! ! freezing snow 132 131 zihsc1 = 1.0 - MAX( zzero , SIGN( zone , - ( ph_snw(ji,jj,jl) - c1 ) ) ) 133 zalbpsnf = ( 1.0 - zihsc1 ) * ( zficeth(ji,jj,jl) &134 & + ph_snw(ji,jj,jl) * ( alphd - zficeth(ji,jj,jl) ) / c1 ) &135 & + zihsc1 * alphd132 zalbpsnf = ( 1.0 - zihsc1 ) * ( zficeth(ji,jj,jl) & 133 & + ph_snw(ji,jj,jl) * ( rn_alphd - zficeth(ji,jj,jl) ) / c1 ) & 134 & + zihsc1 * rn_alphd 136 135 ! ! melting snow 137 136 zihsc2 = MAX( zzero , SIGN( zone , ph_snw(ji,jj,jl) - c2 ) ) 138 zalbpsnm = ( 1.0 - zihsc2 ) * ( albice + ph_snw(ji,jj,jl) * ( alphc - albice ) / c2 )&139 & + zihsc2 * alphc137 zalbpsnm = ( 1.0 - zihsc2 ) * ( rn_albice + ph_snw(ji,jj,jl) * ( rn_alphc - rn_albice ) / c2 ) & 138 & + zihsc2 * rn_alphc 140 139 ! 141 140 zitmlsn = MAX( zzero , SIGN( zone , pt_ice(ji,jj,jl) - rt0_snow ) ) … … 154 153 ! Albedo of snow-ice for overcast sky. 155 154 !---------------------------------------------- 156 pa_ice_os(:,:,:) = pa_ice_cs(:,:,:) + cgren! Oberhuber correction155 pa_ice_os(:,:,:) = pa_ice_cs(:,:,:) + rn_cloud ! Oberhuber correction 157 156 ! 158 157 END SUBROUTINE albedo_ice … … 186 185 !! ** Purpose : initializations for the albedo parameters 187 186 !! 188 !! ** Method : Read the namelist namalb 189 !!---------------------------------------------------------------------- 190 NAMELIST/namalb/ cgren, albice, alphd, alphdi, alphc 191 !!---------------------------------------------------------------------- 192 193 ! set the initialization flag to 1 194 albd_init = 1 ! indicate that the initialization has been done 195 196 ! Read Namelist namalb : albedo parameters 197 REWIND( numnam ) 198 READ ( numnam, namalb ) 199 200 IF(lwp) THEN ! Control print 187 !! ** Method : Read the namelist namsbc_alb 188 !!---------------------------------------------------------------------- 189 NAMELIST/namsbc_alb/ rn_cloud, rn_albice, rn_alphd, rn_alphdi, rn_alphc 190 !!---------------------------------------------------------------------- 191 ! 192 albd_init = 1 ! indicate that the initialization has been done 193 ! 194 REWIND( numnam ) ! Read Namelist namsbc_alb : albedo parameters 195 READ ( numnam, namsbc_alb ) 196 ! 197 IF(lwp) THEN ! Control print 201 198 WRITE(numout,*) 202 WRITE(numout,*) 'albedo_init : set albedo parameters from namelist namalb' 203 WRITE(numout,*) '~~~~~~~~~~~' 204 WRITE(numout,*) ' correction for snow and ice albedo cgren = ', cgren 205 WRITE(numout,*) ' albedo of melting ice in the arctic and antarctic albice = ', albice 206 WRITE(numout,*) ' coefficients for linear alphd = ', alphd 207 WRITE(numout,*) ' interpolation used to compute albedo alphdi = ', alphdi 208 WRITE(numout,*) ' between two extremes values (Pyane, 1972) alphc = ', alphc 199 WRITE(numout,*) 'albedo : set albedo parameters' 200 WRITE(numout,*) '~~~~~~~' 201 WRITE(numout,*) ' Namelist namsbc_alb : albedo ' 202 WRITE(numout,*) ' correction for snow and ice albedo rn_cloud = ', rn_cloud 203 WRITE(numout,*) ' albedo of melting ice in the arctic and antarctic rn_albice = ', rn_albice 204 WRITE(numout,*) ' coefficients for linear rn_alphd = ', rn_alphd 205 WRITE(numout,*) ' interpolation used to compute albedo rn_alphdi = ', rn_alphdi 206 WRITE(numout,*) ' between two extremes values (Pyane, 1972) rn_alphc = ', rn_alphc 209 207 ENDIF 210 208 ! -
trunk/NEMO/OPA_SRC/SBC/sbcblk_core.F90
r1482 r1601 54 54 TYPE(FLD), ALLOCATABLE, DIMENSION(:) :: sf ! structure of input fields (file informations, fields read) 55 55 56 ! ! *CORE bulk parameters56 ! !!! CORE bulk parameters 57 57 REAL(wp), PARAMETER :: rhoa = 1.22 ! air density 58 58 REAL(wp), PARAMETER :: cpa = 1000.5 ! specific heat of air … … 62 62 REAL(wp), PARAMETER :: Cice = 1.63e-3 ! transfer coefficient over ice 63 63 64 LOGICAL :: ln_2m = .FALSE. !: logical flag for height of air temp. and hum 65 REAL(wp) :: alpha_precip=1. !: multiplication factor for precipitation 64 ! !!* Namelist namsbc_core : CORE bulk parameters 65 LOGICAL :: ln_2m = .FALSE. ! logical flag for height of air temp. and hum 66 REAL(wp) :: rn_pfac = 1. ! multiplication factor for precipitation 66 67 67 68 !! * Substitutions … … 115 116 TYPE(FLD_N) :: sn_wndi, sn_wndj, sn_humi, sn_qsr ! informations about the fields to be read 116 117 TYPE(FLD_N) :: sn_qlw , sn_tair, sn_prec, sn_snow ! " " 117 NAMELIST/namsbc_core/ cn_dir, ln_2m, alpha_precip, sn_wndi, sn_wndj, sn_humi, sn_qsr, &118 & sn_qlw , sn_tair, sn_prec, sn_snow118 NAMELIST/namsbc_core/ cn_dir, ln_2m, rn_pfac, sn_wndi, sn_wndj, sn_humi, sn_qsr, & 119 & sn_qlw , sn_tair, sn_prec, sn_snow 119 120 !!--------------------------------------------------------------------- 120 121 … … 124 125 ! set file information (default values) 125 126 cn_dir = './' ! directory in which the model is executed 126 127 ! 127 128 ! (NB: frequency positive => hours, negative => months) 128 129 ! ! file ! frequency ! variable ! time intep ! clim ! 'yearly' or ! weights ! rotation ! … … 136 137 sn_prec = FLD_N( 'precip' , -1. , 'precip' , .true. , .false. , 'yearly' , '' , '' ) 137 138 sn_snow = FLD_N( 'snow' , -1. , 'snow' , .true. , .false. , 'yearly' , '' , '' ) 138 139 ! 139 140 REWIND( numnam ) ! ... read in namlist namsbc_core 140 141 READ ( numnam, namsbc_core ) 141 142 ! 142 143 ! store namelist information in an array 143 144 slf_i(jp_wndi) = sn_wndi ; slf_i(jp_wndj) = sn_wndj … … 145 146 slf_i(jp_tair) = sn_tair ; slf_i(jp_humi) = sn_humi 146 147 slf_i(jp_prec) = sn_prec ; slf_i(jp_snow) = sn_snow 147 148 ! 148 149 ! set sf structure 149 150 ALLOCATE( sf(jpfld), STAT=ierror ) … … 151 152 CALL ctl_stop( 'sbc_blk_core: unable to allocate sf structure' ) ; RETURN 152 153 ENDIF 153 154 154 DO ifpr= 1, jpfld 155 155 ALLOCATE( sf(ifpr)%fnow(jpi,jpj) ) 156 156 ALLOCATE( sf(ifpr)%fdta(jpi,jpj,2) ) 157 157 END DO 158 158 ! 159 159 ! fill sf with slf_i and control print 160 160 CALL fld_fill( sf, slf_i, cn_dir, 'sbc_blk_core', 'flux formulattion for ocean surface boundary condition', 'namsbc_core' ) 161 161 ! 162 162 ENDIF 163 164 163 165 164 CALL fld_read( kt, nn_fsbc, sf ) ! input fields provided at the current time-step … … 327 326 qns(:,:) = zqlw(:,:) - zqsb(:,:) - zqla(:,:) ! Downward Non Solar flux 328 327 !CDIR COLLAPSE 329 emp (:,:) = zevap(:,:) - sf(jp_prec)%fnow(:,:) * alpha_precip* tmask(:,:,1)328 emp (:,:) = zevap(:,:) - sf(jp_prec)%fnow(:,:) * rn_pfac * tmask(:,:,1) 330 329 !CDIR COLLAPSE 331 330 emps(:,:) = emp(:,:) … … 533 532 534 533 !CDIR COLLAPSE 535 p_tpr(:,:) = sf(jp_prec)%fnow(:,:) * alpha_precip! total precipitation [kg/m2/s]536 !CDIR COLLAPSE 537 p_spr(:,:) = sf(jp_snow)%fnow(:,:) * alpha_precip! solid precipitation [kg/m2/s]538 CALL iom_put( 'snowpre', p_spr ) 534 p_tpr(:,:) = sf(jp_prec)%fnow(:,:) * rn_pfac ! total precipitation [kg/m2/s] 535 !CDIR COLLAPSE 536 p_spr(:,:) = sf(jp_snow)%fnow(:,:) * rn_pfac ! solid precipitation [kg/m2/s] 537 CALL iom_put( 'snowpre', p_spr ) ! Snow precipitation 539 538 ! 540 539 IF(ln_ctl) THEN -
trunk/NEMO/OPA_SRC/SBC/sbcmod.F90
r1482 r1601 115 115 WRITE(numout,*) ' Sea Surface Restoring on SST and/or SSS ln_ssr = ', ln_ssr 116 116 WRITE(numout,*) ' FreshWater Budget control (=0/1/2) nn_fwb = ', nn_fwb 117 WRITE(numout,*) ' closed sea (=0/1) (set in namdom) n closea = ', nclosea117 WRITE(numout,*) ' closed sea (=0/1) (set in namdom) nn_closea = ', nn_closea 118 118 ENDIF 119 119 -
trunk/NEMO/OPA_SRC/SBC/sbcrnf.F90
r1540 r1601 37 37 REAL(wp) , PUBLIC :: rn_hrnf = 0.e0 !: runoffs, depth over which enhanced vertical mixing is used 38 38 REAL(wp) , PUBLIC :: rn_avt_rnf = 0.e0 !: runoffs, value of the additional vertical mixing coef. [m2/s] 39 REAL(wp) , PUBLIC :: rn_ mul_rnf= 1.e0 !: multiplicative factor for runoff39 REAL(wp) , PUBLIC :: rn_rfact = 1.e0 !: multiplicative factor for runoff 40 40 41 41 INTEGER , PUBLIC :: nkrnf = 0 !: number of levels over which Kz is increased at river mouths … … 103 103 104 104 IF( MOD( kt-1, nn_fsbc ) == 0 ) THEN 105 emp (:,:) = emp (:,:) - rn_ mul_rnf* ABS( sf_rnf(1)%fnow(:,:) )106 emps(:,:) = emps(:,:) - rn_ mul_rnf* ABS( sf_rnf(1)%fnow(:,:) )105 emp (:,:) = emp (:,:) - rn_rfact * ABS( sf_rnf(1)%fnow(:,:) ) 106 emps(:,:) = emps(:,:) - rn_rfact * ABS( sf_rnf(1)%fnow(:,:) ) 107 107 CALL iom_put( "runoffs", sf_rnf(1)%fnow ) ! runoffs 108 108 ENDIF … … 126 126 !! 127 127 NAMELIST/namsbc_rnf/ cn_dir, ln_rnf_emp, sn_rnf, sn_cnf, ln_rnf_mouth, & 128 & rn_hrnf, rn_avt_rnf, rn_ mul_rnf128 & rn_hrnf, rn_avt_rnf, rn_rfact 129 129 !!---------------------------------------------------------------------- 130 130 … … 152 152 WRITE(numout,*) ' river mouth additional Kz rn_avt_rnf = ', rn_avt_rnf 153 153 WRITE(numout,*) ' depth of river mouth additional mixing rn_hrnf = ', rn_hrnf 154 WRITE(numout,*) ' multiplicative factor for runoff rn_ mul_rnf = ', rn_mul_rnf154 WRITE(numout,*) ' multiplicative factor for runoff rn_rfact = ', rn_rfact 155 155 ENDIF 156 156 … … 228 228 !! rnfmsk_z vertical structure 229 229 !!---------------------------------------------------------------------- 230 USE closea, ONLY : nclosea, clo_rnf ! closed sea flag,rnfmsk update routine230 USE closea, ONLY : clo_rnf ! rnfmsk update routine 231 231 ! 232 232 INTEGER :: inum ! temporary integers -
trunk/NEMO/OPA_SRC/SBC/sbcssr.F90
r1573 r1601 32 32 REAL(wp), PUBLIC, DIMENSION(jpi,jpj) :: qrp !: heat flux damping [w/m2] 33 33 34 ! !!* Namelist namsbc_ssr * 35 INTEGER, PUBLIC :: nn_sstr, nn_sssr ! SST/SSS restoring indicator 36 REAL(wp) :: dqdt, deds ! restoring factor on SST and SSS 37 LOGICAL :: ln_sssr_bnd ! flag to bound erp term 38 REAL(wp) :: rn_sssr_bnd ! ABS(Max./Min.) value of erp term [mm/day] 34 ! !!* Namelist namsbc_ssr * 35 INTEGER, PUBLIC :: nn_sstr = 0 ! SST/SSS restoring indicator 36 INTEGER, PUBLIC :: nn_sssr = 0 ! SST/SSS restoring indicator 37 REAL(wp) :: rn_dqdt = -40.e0 ! restoring factor on SST and SSS 38 REAL(wp) :: rn_deds = -27.70 ! restoring factor on SST and SSS 39 LOGICAL :: ln_sssr_bnd = .false. ! flag to bound erp term 40 REAL(wp) :: rn_sssr_bnd = 0.e0 ! ABS(Max./Min.) value of erp term [mm/day] 39 41 40 42 REAL(wp) , ALLOCATABLE, DIMENSION(:) :: buffer ! Temporary buffer for exchange … … 71 73 REAL(wp) :: zerp ! local scalar for evaporation damping 72 74 REAL(wp) :: zqrp ! local scalar for heat flux damping 73 REAL(wp) :: zsrp ! local scalar for unit conversion of deds factor75 REAL(wp) :: zsrp ! local scalar for unit conversion of rn_deds factor 74 76 REAL(wp) :: zerp_bnd ! local scalar for unit conversion of rn_epr_max factor 75 77 INTEGER :: ierror ! return error code … … 77 79 CHARACTER(len=100) :: cn_dir ! Root directory for location of ssr files 78 80 TYPE(FLD_N) :: sn_sst, sn_sss ! informations about the fields to be read 79 NAMELIST/namsbc_ssr/ cn_dir, nn_sstr, nn_sssr, dqdt,deds, sn_sst, sn_sss, ln_sssr_bnd, rn_sssr_bnd81 NAMELIST/namsbc_ssr/ cn_dir, nn_sstr, nn_sssr, rn_dqdt, rn_deds, sn_sst, sn_sss, ln_sssr_bnd, rn_sssr_bnd 80 82 !!---------------------------------------------------------------------- 81 83 ! … … 83 85 IF( kt == nit000 ) THEN ! First call kt=nit000 ! 84 86 ! ! -------------------- ! 85 nn_sstr = 0 !* set file information 86 nn_sssr = 0 87 dqdt = -40.e0 88 deds = -27.70 87 ! !* set file information 89 88 cn_dir = './' ! directory in which the model is executed 90 89 ! ... default values (NB: frequency positive => hours, negative => months) … … 101 100 WRITE(numout,*) 'sbc_ssr : SST and/or SSS damping term ' 102 101 WRITE(numout,*) '~~~~~~~ ' 103 WRITE(numout,*) ' SST restoring term (Yes=1) nn_sstr = ', nn_sstr 104 WRITE(numout,*) ' SSS damping term (Yes=1, salt flux) nn_sssr = ', nn_sssr 105 WRITE(numout,*) ' (Yes=2, volume flux) ' 106 WRITE(numout,*) ' dQ/dT (restoring magnitude on SST) dqdt = ', dqdt, ' W/m2/K' 107 WRITE(numout,*) ' dE/dS (restoring magnitude on SST) deds = ', deds, ' mm/day' 108 WRITE(numout,*) ' flag to bound erp term ln_sssr_bnd = ', ln_sssr_bnd 109 WRITE(numout,*) ' ABS(Max./Min.) erp threshold rn_sssr_bnd = ', rn_sssr_bnd, ' mm/day' 102 WRITE(numout,*) ' Namelist namsbc_ssr :' 103 WRITE(numout,*) ' SST restoring term (Yes=1) nn_sstr = ', nn_sstr 104 WRITE(numout,*) ' SSS damping term (Yes=1, salt flux) nn_sssr = ', nn_sssr 105 WRITE(numout,*) ' (Yes=2, volume flux) ' 106 WRITE(numout,*) ' dQ/dT (restoring magnitude on SST) rn_dqdt = ', rn_dqdt, ' W/m2/K' 107 WRITE(numout,*) ' dE/dS (restoring magnitude on SST) rn_deds = ', rn_deds, ' mm/day' 108 WRITE(numout,*) ' flag to bound erp term ln_sssr_bnd = ', ln_sssr_bnd 109 WRITE(numout,*) ' ABS(Max./Min.) erp threshold rn_sssr_bnd = ', rn_sssr_bnd, ' mm/day' 110 110 ENDIF 111 111 … … 154 154 DO jj = 1, jpj 155 155 DO ji = 1, jpi 156 zqrp = dqdt * ( sst_m(ji,jj) - sf_sst(1)%fnow(ji,jj) )156 zqrp = rn_dqdt * ( sst_m(ji,jj) - sf_sst(1)%fnow(ji,jj) ) 157 157 qns(ji,jj) = qns(ji,jj) + zqrp 158 158 qrp(ji,jj) = zqrp … … 163 163 ! 164 164 IF( nn_sssr == 1 ) THEN !* Salinity damping term (salt flux, emps only) 165 zsrp = deds / rday! from [mm/day] to [kg/m2/s]165 zsrp = rn_deds / rday ! from [mm/day] to [kg/m2/s] 166 166 !CDIR COLLAPSE 167 167 DO jj = 1, jpj … … 175 175 END DO 176 176 CALL iom_put( "erp", erp ) ! freshwater flux damping 177 ! 177 178 ELSEIF( nn_sssr == 2 ) THEN !* Salinity damping term (volume flux, emp and emps) 178 zsrp = deds / rday! from [mm/day] to [kg/m2/s]179 zsrp = rn_deds / rday ! from [mm/day] to [kg/m2/s] 179 180 zerp_bnd = rn_sssr_bnd / rday ! - - 180 181 !CDIR COLLAPSE -
trunk/NEMO/OPA_SRC/SOL/sol_oce.F90
r1556 r1601 2 2 !!====================================================================== 3 3 !! *** MODULE sol_oce *** 4 !! Ocean solver : solver variables defined in memory 5 !!===================================================================== 6 !! 7 !! ** Purpose : Define in memory solver variables 8 !! 9 !! History : 10 !! 9.0 ! 02-11 (G. Madec) F90: Free form and module 4 !! Ocean solver : elliptic solver variables defined in memory 5 !!====================================================================== 6 !! History : 1.0 ! 02-11 (G. Madec) F90: Free form and module 11 7 !!---------------------------------------------------------------------- 12 !! OPA 9.0 , LOCEAN-IPSL (2005)13 !! $Id$14 !! This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt15 !!----------------------------------------------------------------------16 !! * Modules used17 8 USE par_oce ! ocean parameters 18 9 … … 20 11 PRIVATE 21 12 22 !!---------------------------- 23 !! elliptic solver: SOR or PCG 24 !! --------------------------- 25 INTEGER , PUBLIC :: & !!: namsol elliptic solver / free surface 26 nsolv = 1 , & !: = 1/2 type of elliptic solver 27 nsol_arp = 0 , & !: = 0/1 absolute/relative precision convergence test 28 nmin = 300 , & !: minimum of iterations for the SOR solver 29 nmax = 800 , & !: maximum of iterations for the SOR solver 30 nmod = 10 !: frequency of test for the SOR solver 31 32 REAL(wp), PUBLIC :: & !!: namsol elliptic solver / free surface 33 eps = 1.e-6_wp , & !: absolute precision of the solver 34 resmax = 1.e-14_wp , & !: absolute precision for the SOR solver 35 sor = 1.92_wp , & !: optimal coefficient for the SOR solver 36 rnu = 1.0_wp !: strength of the additional force used in free surface 13 ! !!* Namelist namsol : elliptic solver * 14 INTEGER , PUBLIC :: nn_solv = 1 !: = 1/2 type of elliptic solver 15 INTEGER , PUBLIC :: nn_sol_arp = 0 !: = 0/1 absolute/relative precision convergence test 16 INTEGER , PUBLIC :: nn_nmin = 300 !: minimum of iterations for the SOR solver 17 INTEGER , PUBLIC :: nn_nmax = 800 !: maximum of iterations for the SOR solver 18 INTEGER , PUBLIC :: nn_nmod = 10 !: frequency of test for the SOR solver 19 REAL(wp), PUBLIC :: rn_eps = 1.e-6_wp !: absolute precision of the solver 20 REAL(wp), PUBLIC :: rn_resmax = 1.e-14_wp !: absolute precision for the SOR solver 21 REAL(wp), PUBLIC :: rn_sor = 1.92_wp !: optimal coefficient for the SOR solver 22 REAL(wp), PUBLIC :: rn_nu = 1.0_wp !: strength of the additional force used in free surface 37 23 38 CHARACTER(len=1), PUBLIC :: & !: 39 c_solver_pt = 'T' !: nature of grid-points T (S) for free surface case 24 CHARACTER(len=1), PUBLIC :: c_solver_pt = 'T' !: nature of grid-points T (S) for free surface case 40 25 41 INTEGER , PUBLIC :: & !: 42 ncut, & !: indicator of solver convergence 43 niter !: number of iteration done by the solver 26 INTEGER , PUBLIC :: ncut !: indicator of solver convergence 27 INTEGER , PUBLIC :: niter !: number of iteration done by the solver 44 28 45 REAL(wp), PUBLIC :: & !:46 epsr, & !: relative precision for SOR & PCG solvers47 rnorme, res, & !: intermediate modulus,solver residu48 alph, &!: coefficient =(gcr,gcr)/(gcx,gccd)49 beta, &!: coefficient =(rn+1,rn+1)/(rn,rn)50 radd, &!: coefficient =(gccd,gcdes)51 rr!: coefficient =(rn,rn)29 REAL(wp), PUBLIC :: eps, epsr !: relative precision for SOR & PCG solvers 30 REAL(wp), PUBLIC :: rnorme !: intermediate modulus 31 REAL(wp), PUBLIC :: res !: solver residu 32 REAL(wp), PUBLIC :: alph !: coefficient =(gcr,gcr)/(gcx,gccd) 33 REAL(wp), PUBLIC :: beta !: coefficient =(rn+1,rn+1)/(rn,rn) 34 REAL(wp), PUBLIC :: radd !: coefficient =(gccd,gcdes) 35 REAL(wp), PUBLIC :: rr !: coefficient =(rn,rn) 52 36 53 REAL(wp), PUBLIC, DIMENSION(1-jpr2di:jpi+jpr2di,1-jpr2dj:jpj+jpr2dj,4) :: & !: 54 gcp !: barotropic matrix extra-diagonal elements 55 56 REAL(wp), PUBLIC, DIMENSION(1-jpr2di:jpi+jpr2di,1-jpr2dj:jpj+jpr2dj) :: & !: 57 gcx, gcxb, & !: now, before solution of the elliptic equation 58 gcdprc, & !: inverse diagonal preconditioning matrix 59 gcdmat, & !: diagonal preconditioning matrix 60 gcb, & !: second member of the barotropic linear system 61 gcr, & !: residu =b-a.x 62 gcdes, & !: vector descente 63 gccd !: vector such that ca.gccd=a.d (ca-1=gcdprc) 37 REAL(wp), PUBLIC, DIMENSION(1-jpr2di:jpi+jpr2di,1-jpr2dj:jpj+jpr2dj,4) :: gcp !: matrix extra-diagonal elements 38 REAL(wp), PUBLIC, DIMENSION(1-jpr2di:jpi+jpr2di,1-jpr2dj:jpj+jpr2dj) :: gcx !: now solution of the elliptic eq. 39 REAL(wp), PUBLIC, DIMENSION(1-jpr2di:jpi+jpr2di,1-jpr2dj:jpj+jpr2dj) :: gcxb !: before solution of the elliptic eq. 40 REAL(wp), PUBLIC, DIMENSION(1-jpr2di:jpi+jpr2di,1-jpr2dj:jpj+jpr2dj) :: gcdprc !: inverse diagonal preconditioning matrix 41 REAL(wp), PUBLIC, DIMENSION(1-jpr2di:jpi+jpr2di,1-jpr2dj:jpj+jpr2dj) :: gcdmat !: diagonal preconditioning matrix 42 REAL(wp), PUBLIC, DIMENSION(1-jpr2di:jpi+jpr2di,1-jpr2dj:jpj+jpr2dj) :: gcb !: second member of the elliptic eq. 43 REAL(wp), PUBLIC, DIMENSION(1-jpr2di:jpi+jpr2di,1-jpr2dj:jpj+jpr2dj) :: gcr !: residu =b-a.x 44 REAL(wp), PUBLIC, DIMENSION(1-jpr2di:jpi+jpr2di,1-jpr2dj:jpj+jpr2dj) :: gcdes !: vector descente 45 REAL(wp), PUBLIC, DIMENSION(1-jpr2di:jpi+jpr2di,1-jpr2dj:jpj+jpr2dj) :: gccd !: gccd= gcdprc^-1.a.d 64 46 65 47 #if defined key_agrif … … 68 50 69 51 !!---------------------------------------------------------------------- 52 !! NEMO/OPA 3.2 , LOCEAN-IPSL (2009) 53 !! $Id$ 54 !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 55 !!---------------------------------------------------------------------- 70 56 END MODULE sol_oce -
trunk/NEMO/OPA_SRC/SOL/solmat.F90
r1566 r1601 4 4 !! solver : construction of the matrix 5 5 !!====================================================================== 6 !! History : 1.0 ! 88-04 (G. Madec) Original code 7 !! ! 93-03 (M. Guyon) symetrical conditions 8 !! ! 93-06 (M. Guyon) suppress pointers 9 !! ! 96-05 (G. Madec) merge sor and pcg formulations 10 !! ! 96-11 (A. Weaver) correction to preconditioning 11 !! 8.5 ! 02-08 (G. Madec) F90: Free form 12 !! ! 02-11 (C. Talandier, A-M. Treguier) Free surface & Open boundaries 13 !! 9.0 ! 05-09 (R. Benshila) add sol_exd for extra outer halo 14 !! 9.0 ! 05-11 (V. Garnier) Surface pressure gradient organization 15 !! 9.0 ! 06-07 (S. Masson) distributed restart using iom 16 !!---------------------------------------------------------------------- 17 18 !!---------------------------------------------------------------------- 19 !! sol_mat : Construction of the matrix of used by the elliptic solvers 20 !! fetsch : 21 !! fetmat : 22 !! fetstr : 23 !!---------------------------------------------------------------------- 24 !! * Modules used 6 !! History : 1.0 ! 1988-04 (G. Madec) Original code 7 !! ! 1993-03 (M. Guyon) symetrical conditions 8 !! ! 1993-06 (M. Guyon) suppress pointers 9 !! ! 1996-05 (G. Madec) merge sor and pcg formulations 10 !! ! 1996-11 (A. Weaver) correction to preconditioning 11 !! NEMO 1.0 ! 1902-08 (G. Madec) F90: Free form 12 !! - ! 1902-11 (C. Talandier, A-M. Treguier) Free surface & Open boundaries 13 !! 2.0 ! 2005-09 (R. Benshila) add sol_exd for extra outer halo 14 !! - ! 2005-11 (V. Garnier) Surface pressure gradient organization 15 !! 3.2 ! 2009-06 (S. Masson) distributed restart using iom 16 !! - ! 2009-07 (R. Benshila) suppression of rigid-lid option 17 !!---------------------------------------------------------------------- 18 19 !!---------------------------------------------------------------------- 20 !! sol_mat : Construction of the matrix of used by the elliptic solvers 21 !! sol_exd : 22 !!---------------------------------------------------------------------- 25 23 USE oce ! ocean dynamics and active tracers 26 24 USE dom_oce ! ocean space and time domain … … 35 33 PRIVATE 36 34 37 !! * Routine accessibility38 PUBLIC sol_mat ! routine called by inisol.F90 39 !!---------------------------------------------------------------------- 40 !! OPA 9.0 , LOCEAN-IPSL (2005)35 PUBLIC sol_mat ! routine called by inisol.F90 36 37 !!---------------------------------------------------------------------- 38 !! NEMO/OPA 3.2 , LOCEAN-IPSL (2009) 41 39 !! $Id$ 42 40 !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) … … 50 48 !! 51 49 !! ** Purpose : Construction of the matrix of used by the elliptic 52 !! solvers (either sor or pcg methods). 53 !! 54 !! ** Method : 55 !! lk_dynspg_flt=T: free surface formulation 56 !! The matrix is built for the divergence of the transport system 57 !! a diagonal preconditioning matrix is also defined. 50 !! solvers (either sor or pcg methods). 51 !! 52 !! ** Method : The matrix is built for the divergence of the transport 53 !! system. a diagonal preconditioning matrix is also defined. 58 54 !! 59 55 !! ** Action : - gcp : extra-diagonal elements of the matrix … … 61 57 !! - gcdprc : inverse of the preconditioning matrix 62 58 !!---------------------------------------------------------------------- 63 !! * Arguments64 59 INTEGER, INTENT(in) :: kt 65 66 !! * Local declarations 60 !! 67 61 INTEGER :: ji, jj ! dummy loop indices 68 62 REAL(wp) :: zcoefs, zcoefw, zcoefe, zcoefn ! temporary scalars … … 73 67 ! 1. Construction of the matrix 74 68 ! ----------------------------- 75 76 ! initialize to zero 77 zcoef = 0.e0 69 zcoef = 0.e0 ! initialize to zero 78 70 gcp(:,:,1) = 0.e0 79 71 gcp(:,:,2) = 0.e0 80 72 gcp(:,:,3) = 0.e0 81 73 gcp(:,:,4) = 0.e0 82 74 ! 83 75 gcdprc(:,:) = 0.e0 84 76 gcdmat(:,:) = 0.e0 85 86 IF( neuler == 0 .AND. kt == nit000 ) THEN 87 z2dt = rdt 88 ELSE 89 z2dt = 2. * rdt 77 ! 78 IF( neuler == 0 .AND. kt == nit000 ) THEN ; z2dt = rdt 79 ELSE ; z2dt = 2. * rdt 90 80 ENDIF 91 81 92 82 #if defined key_dynspg_flt && ! defined key_obc 93 !!cr IF( lk_dynspg_flt .AND. .NOT.lk_obc ) THEN !bug missing lk_dynspg_flt_atsk 94 95 ! defined the coefficients for free surface elliptic system 96 97 DO jj = 2, jpjm1 83 84 DO jj = 2, jpjm1 ! matrix of free surface elliptic system 98 85 DO ji = 2, jpim1 99 zcoef = z2dt * z2dt * grav * rnu *bmask(ji,jj)86 zcoef = z2dt * z2dt * grav * bmask(ji,jj) 100 87 zcoefs = -zcoef * hv(ji ,jj-1) * e1v(ji ,jj-1) / e2v(ji ,jj-1) ! south coefficient 101 88 zcoefw = -zcoef * hu(ji-1,jj ) * e2u(ji-1,jj ) / e1u(ji-1,jj ) ! west coefficient … … 112 99 113 100 # elif defined key_dynspg_flt && defined key_obc 114 !!cr ELSEIF( lk_dynspg_flt .AND. lk_obc ) THEN !bug missing lk_dynspg_flt_atsk 115 116 ! defined gcdmat in the case of open boundaries 117 118 DO jj = 2, jpjm1 101 102 DO jj = 2, jpjm1 ! matrix of free surface elliptic system with open boundaries 119 103 DO ji = 2, jpim1 120 zcoef = z2dt * z2dt * grav * rnu *bmask(ji,jj)121 ! south coefficient104 zcoef = z2dt * z2dt * grav * bmask(ji,jj) 105 ! ! south coefficient 122 106 IF( lp_obc_south .AND. ( jj == njs0p1 ) ) THEN 123 107 zcoefs = -zcoef * hv(ji,jj-1) * e1v(ji,jj-1)/e2v(ji,jj-1)*(1.-vsmsk(ji,1)) … … 126 110 END IF 127 111 gcp(ji,jj,1) = zcoefs 128 129 ! west coefficient112 ! 113 ! ! west coefficient 130 114 IF( lp_obc_west .AND. ( ji == niw0p1 ) ) THEN 131 115 zcoefw = -zcoef * hu(ji-1,jj) * e2u(ji-1,jj)/e1u(ji-1,jj)*(1.-uwmsk(jj,1)) … … 134 118 END IF 135 119 gcp(ji,jj,2) = zcoefw 136 137 ! east coefficient120 ! 121 ! ! east coefficient 138 122 IF( lp_obc_east .AND. ( ji == nie0 ) ) THEN 139 123 zcoefe = -zcoef * hu(ji,jj) * e2u(ji,jj)/e1u(ji,jj)*(1.-uemsk(jj,1)) … … 142 126 END IF 143 127 gcp(ji,jj,3) = zcoefe 144 145 ! north coefficient128 ! 129 ! ! north coefficient 146 130 IF( lp_obc_north .AND. ( jj == njn0 ) ) THEN 147 131 zcoefn = -zcoef * hv(ji,jj) * e1v(ji,jj)/e2v(ji,jj)*(1.-vnmsk(ji,1)) … … 150 134 END IF 151 135 gcp(ji,jj,4) = zcoefn 152 153 ! diagonal coefficient154 gcdmat(ji,jj) = e1t(ji,jj)*e2t(ji,jj)*bmask(ji,jj) &155 136 ! 137 ! ! diagonal coefficient 138 gcdmat(ji,jj) = e1t(ji,jj)*e2t(ji,jj)*bmask(ji,jj) & 139 & - zcoefs -zcoefw -zcoefe -zcoefn 156 140 END DO 157 141 END DO 158 159 # else 160 !!cr ELSE 161 162 ! defined the coefficients for bsf elliptic system 163 164 DO jj = 2, jpjm1 165 DO ji = 2, jpim1 166 zcoefs = -hur(ji ,jj ) * e1u(ji ,jj ) / e2u(ji ,jj ) * bmask(ji,jj) ! south coefficient 167 zcoefw = -hvr(ji ,jj ) * e2v(ji ,jj ) / e1v(ji ,jj ) * bmask(ji,jj) ! west coefficient 168 zcoefe = -hvr(ji+1,jj ) * e2v(ji+1,jj ) / e1v(ji+1,jj ) * bmask(ji,jj) ! east coefficient 169 zcoefn = -hur(ji ,jj+1) * e1u(ji ,jj+1) / e2u(ji ,jj+1) * bmask(ji,jj) ! north coefficient 170 gcp(ji,jj,1) = zcoefs 171 gcp(ji,jj,2) = zcoefw 172 gcp(ji,jj,3) = zcoefe 173 gcp(ji,jj,4) = zcoefn 174 gcdmat(ji,jj) = -zcoefs -zcoefw -zcoefe -zcoefn ! diagonal coefficient 142 #endif 143 144 #if defined key_agrif 145 IF( .NOT.AGRIF_ROOT() ) THEN 146 ! 147 IF( nbondi == -1 .OR. nbondi == 2 ) bmask(2 ,: ) = 0.e0 148 IF( nbondi == 1 .OR. nbondi == 2 ) bmask(nlci-1,: ) = 0.e0 149 IF( nbondj == -1 .OR. nbondj == 2 ) bmask(: ,2 ) = 0.e0 150 IF( nbondj == 1 .OR. nbondj == 2 ) bmask(: ,nlcj-1) = 0.e0 151 ! 152 DO jj = 2, jpjm1 153 DO ji = 2, jpim1 154 zcoef = z2dt * z2dt * grav * bmask(ji,jj) 155 ! south coefficient 156 IF( ( nbondj == -1 .OR. nbondj == 2 ) .AND. ( jj == 3 ) ) THEN 157 zcoefs = -zcoef * hv(ji,jj-1) * e1v(ji,jj-1)/e2v(ji,jj-1)*(1.-vmask(ji,jj-1,1)) 158 ELSE 159 zcoefs = -zcoef * hv(ji,jj-1) * e1v(ji,jj-1)/e2v(ji,jj-1) 160 END IF 161 gcp(ji,jj,1) = zcoefs 162 ! 163 ! west coefficient 164 IF( ( nbondi == -1 .OR. nbondi == 2 ) .AND. ( ji == 3 ) ) THEN 165 zcoefw = -zcoef * hu(ji-1,jj) * e2u(ji-1,jj)/e1u(ji-1,jj)*(1.-umask(ji-1,jj,1)) 166 ELSE 167 zcoefw = -zcoef * hu(ji-1,jj) * e2u(ji-1,jj)/e1u(ji-1,jj) 168 END IF 169 gcp(ji,jj,2) = zcoefw 170 ! 171 ! east coefficient 172 IF( ( nbondi == 1 .OR. nbondi == 2 ) .AND. ( ji == nlci-2 ) ) THEN 173 zcoefe = -zcoef * hu(ji,jj) * e2u(ji,jj)/e1u(ji,jj)*(1.-umask(ji,jj,1)) 174 ELSE 175 zcoefe = -zcoef * hu(ji,jj) * e2u(ji,jj)/e1u(ji,jj) 176 END IF 177 gcp(ji,jj,3) = zcoefe 178 ! 179 ! north coefficient 180 IF( ( nbondj == 1 .OR. nbondj == 2 ) .AND. ( jj == nlcj-2 ) ) THEN 181 zcoefn = -zcoef * hv(ji,jj) * e1v(ji,jj)/e2v(ji,jj)*(1.-vmask(ji,jj,1)) 182 ELSE 183 zcoefn = -zcoef * hv(ji,jj) * e1v(ji,jj)/e2v(ji,jj) 184 END IF 185 gcp(ji,jj,4) = zcoefn 186 ! 187 ! diagonal coefficient 188 gcdmat(ji,jj) = e1t(ji,jj)*e2t(ji,jj)*bmask(ji,jj) & 189 & - zcoefs -zcoefw -zcoefe -zcoefn 190 END DO 175 191 END DO 176 END DO 177 178 !!cr ENDIF 179 #endif 180 #if defined key_agrif 181 IF (.NOT.AGRIF_ROOT()) THEN 182 183 IF ( (nbondi == -1) .OR. (nbondi == 2) ) bmask(2,:)=0. 184 IF ( (nbondi == 1) .OR. (nbondi == 2) ) bmask(nlci-1,:)=0. 185 IF ( (nbondj == -1) .OR. (nbondj == 2) ) bmask(:,2)=0. 186 IF ( (nbondj == 1) .OR. (nbondj == 2) ) bmask(:,nlcj-1)=0. 187 188 DO jj = 2, jpjm1 189 DO ji = 2, jpim1 190 zcoef = z2dt * z2dt * grav * rnu * bmask(ji,jj) 191 ! south coefficient 192 IF( ((nbondj == -1) .OR. (nbondj == 2)) .AND. ( jj == 3 ) ) THEN 193 zcoefs = -zcoef * hv(ji,jj-1) * e1v(ji,jj-1)/e2v(ji,jj-1)*(1.-vmask(ji,jj-1,1)) 194 ELSE 195 zcoefs = -zcoef * hv(ji,jj-1) * e1v(ji,jj-1)/e2v(ji,jj-1) 196 END IF 197 gcp(ji,jj,1) = zcoefs 198 199 ! west coefficient 200 IF( ( (nbondi == -1) .OR. (nbondi == 2) ) .AND. ( ji == 3 ) ) THEN 201 zcoefw = -zcoef * hu(ji-1,jj) * e2u(ji-1,jj)/e1u(ji-1,jj)*(1.-umask(ji-1,jj,1)) 202 ELSE 203 zcoefw = -zcoef * hu(ji-1,jj) * e2u(ji-1,jj)/e1u(ji-1,jj) 204 END IF 205 gcp(ji,jj,2) = zcoefw 206 207 ! east coefficient 208 IF( ((nbondi == 1) .OR. (nbondi == 2)) .AND. ( ji == nlci-2 ) ) THEN 209 zcoefe = -zcoef * hu(ji,jj) * e2u(ji,jj)/e1u(ji,jj)*(1.-umask(ji,jj,1)) 210 ELSE 211 zcoefe = -zcoef * hu(ji,jj) * e2u(ji,jj)/e1u(ji,jj) 212 END IF 213 gcp(ji,jj,3) = zcoefe 214 215 ! north coefficient 216 IF( ((nbondj == 1) .OR. (nbondj == 2)) .AND. ( jj == nlcj-2 ) ) THEN 217 zcoefn = -zcoef * hv(ji,jj) * e1v(ji,jj)/e2v(ji,jj)*(1.-vmask(ji,jj,1)) 218 ELSE 219 zcoefn = -zcoef * hv(ji,jj) * e1v(ji,jj)/e2v(ji,jj) 220 END IF 221 gcp(ji,jj,4) = zcoefn 222 223 ! diagonal coefficient 224 gcdmat(ji,jj) = e1t(ji,jj)*e2t(ji,jj)*bmask(ji,jj) & 225 - zcoefs -zcoefw -zcoefe -zcoefn 226 END DO 227 END DO 228 229 ENDIF 192 ! 193 ENDIF 230 194 #endif 231 195 … … 244 208 ! the diagonal coefficient of the southern grid points must be modify to 245 209 ! account for the existence of the south symmetric bassin. 246 247 !!cr IF( .NOT.lk_dynspg_flt ) THEN !bug missing lk_dynspg_flt_atsk248 #if ! defined key_dynspg_flt249 IF( nperio == 2 ) THEN250 DO ji = 1, jpi251 IF( bmask(ji,2) /= 0.e0 ) THEN252 zcoefs = - hur(ji,2)*e1u(ji,2)/e2u(ji,2)253 gcdmat(ji,2) = gcdmat(ji,2) - zcoefs254 ENDIF255 END DO256 ENDIF257 !!cr ENDIF258 #endif259 210 260 211 ! North fold boundary condition … … 276 227 gcp(:,:,3) = gcp(:,:,3) * gcdprc(:,:) 277 228 gcp(:,:,4) = gcp(:,:,4) * gcdprc(:,:) 278 IF( n solv == 2 ) gccd(:,:) =sor * gcp(:,:,2)279 280 IF( n solv == 2 .AND. MAX( jpr2di, jpr2dj ) > 0) THEN229 IF( nn_solv == 2 ) gccd(:,:) = rn_sor * gcp(:,:,2) 230 231 IF( nn_solv == 2 .AND. MAX( jpr2di, jpr2dj ) > 0) THEN 281 232 CALL lbc_lnk_e( gcp (:,:,1), c_solver_pt, 1. ) ! lateral boundary conditions 282 233 CALL lbc_lnk_e( gcp (:,:,2), c_solver_pt, 1. ) ! lateral boundary conditions … … 308 259 !! the total area strictly above the pivot point, 309 260 !! and on the semi-row of the pivot point 310 !! 311 !! History : 312 !! 9.0 ! 05-09 (R. Benshila) original routine 313 !!---------------------------------------------------------------------- 314 !! * Arguments 315 CHARACTER(len=1) , INTENT( in ) :: & 316 cd_type ! define the nature of pt2d array grid-points 317 ! ! = T , U , V , F , W 318 ! ! = S : T-point, north fold treatment 319 ! ! = G : F-point, north fold treatment 320 ! ! = I : sea-ice velocity at F-point with index shift 321 REAL(wp), DIMENSION(1-jpr2di:jpi+jpr2di,1-jpr2dj:jpj+jpr2dj,4), INTENT( inout ) :: & 322 pt3d ! 2D array on which the boundary condition is applied 323 324 !! * Local variables 325 INTEGER :: ji, jk ! dummy loop indices 326 INTEGER :: iloc ! temporary integers 327 REAL(wp), DIMENSION(1-jpr2di:jpi+jpr2di,1-jpr2dj:jpj+jpr2dj,4) :: & 328 ztab ! 2D array on which the boundary condition is applied 261 !!---------------------------------------------------------------------- 262 CHARACTER(len=1) , INTENT( in ) :: cd_type ! define the nature of pt2d array grid-points 263 ! ! = T , U , V , F , W 264 ! ! = S : T-point, north fold treatment 265 ! ! = G : F-point, north fold treatment 266 ! ! = I : sea-ice velocity at F-point with index shift 267 REAL(wp), DIMENSION(1-jpr2di:jpi+jpr2di,1-jpr2dj:jpj+jpr2dj,4), INTENT(inout) :: pt3d ! 2D field to be treated 268 !! 269 INTEGER :: ji, jk ! dummy loop indices 270 INTEGER :: iloc ! temporary integers 271 REAL(wp), DIMENSION(1-jpr2di:jpi+jpr2di,1-jpr2dj:jpj+jpr2dj,4) :: ztab ! 2D workspace 329 272 !!---------------------------------------------------------------------- 330 273 331 274 ztab = pt3d 332 275 333 ! north fold treatment 334 ! ----------------------- 335 336 SELECT CASE ( npolj ) 337 338 CASE ( 3 , 4 ) ! T pivot 276 SELECT CASE ( npolj ) ! north fold type 277 ! 278 CASE ( 3 , 4 ) !== T pivot ==! 339 279 iloc = jpiglo/2 +1 340 341 SELECT CASE ( cd_type ) 342 343 CASE ( 'T', 'S', 'U', 'W' ) 344 DO jk =1, 4 345 DO ji = 1-jpr2di, nlci+jpr2di 346 pt3d(ji,nlcj:nlcj+jpr2dj,jk) = ztab(ji,nlcj:nlcj+jpr2dj,jk+3-2*MOD(jk+3,4)) 347 ENDDO 348 ENDDO 349 350 DO jk =1, 4 351 DO ji = nlci+jpr2di, 1-jpr2di, -1 352 IF( ( ji .LT. mi0(iloc) .AND. mi0(iloc) /= 1 ) & 353 & .OR. ( mi0(iloc) == jpi+1 ) ) EXIT 280 ! 281 SELECT CASE ( cd_type ) 282 ! 283 CASE ( 'T', 'S', 'U', 'W' ) 284 DO jk = 1, 4 285 DO ji = 1-jpr2di, nlci+jpr2di 286 pt3d(ji,nlcj:nlcj+jpr2dj,jk) = ztab(ji,nlcj:nlcj+jpr2dj,jk+3-2*MOD(jk+3,4)) 287 END DO 288 END DO 289 DO jk =1, 4 290 DO ji = nlci+jpr2di, 1-jpr2di, -1 291 IF( ( ji .LT. mi0(iloc) .AND. mi0(iloc) /= 1 ) & 292 & .OR. ( mi0(iloc) == jpi+1 ) ) EXIT 354 293 pt3d(ji,nlcj-1,jk) = ztab(ji,nlcj-1,jk+3-2*MOD(jk+3,4)) 355 ENDDO 356 ENDDO 357 358 CASE ( 'F' ,'G' , 'I', 'V' ) 359 DO jk =1, 4 360 DO ji = 1-jpr2di, nlci+jpr2di 361 pt3d(ji,nlcj-1:nlcj+jpr2dj,jk) = ztab(ji,nlcj-1:nlcj+jpr2dj,jk+3-2*MOD(jk+3,4)) 362 ENDDO 363 ENDDO 364 365 END SELECT ! cd_type 366 367 CASE ( 5 , 6 ) ! F pivot 368 iloc=jpiglo/2 369 370 SELECT CASE (cd_type ) 371 372 CASE ( 'T' ,'S', 'U', 'W') 373 DO jk =1, 4 374 DO ji = 1-jpr2di, nlci+jpr2di 375 pt3d(ji,nlcj:nlcj+jpr2dj,jk) = ztab(ji,nlcj:nlcj+jpr2dj,jk+3-2*MOD(jk+3,4)) 376 ENDDO 377 ENDDO 378 379 CASE ( 'F' ,'G' , 'I', 'V' ) 380 DO jk =1, 4 381 DO ji = 1-jpr2di, nlci+jpr2di 382 pt3d(ji,nlcj:nlcj+jpr2dj,jk) = ztab(ji,nlcj:nlcj+jpr2dj,jk+3-2*MOD(jk+3,4)) 383 ENDDO 384 ENDDO 385 DO jk =1, 4 386 DO ji = nlci+jpr2di, 1-jpr2di, -1 387 IF ( ( ji .LT. mi0(iloc) .AND. mi0(iloc) /= 1 ) & 388 & .OR. ( mi0(iloc) == jpi+1 ) ) EXIT 294 END DO 295 END DO 296 ! 297 CASE ( 'F' ,'G' , 'I', 'V' ) 298 DO jk =1, 4 299 DO ji = 1-jpr2di, nlci+jpr2di 300 pt3d(ji,nlcj-1:nlcj+jpr2dj,jk) = ztab(ji,nlcj-1:nlcj+jpr2dj,jk+3-2*MOD(jk+3,4)) 301 END DO 302 END DO 303 ! 304 END SELECT ! cd_type 305 ! 306 CASE ( 5 , 6 ) !== F pivot ==! 307 iloc=jpiglo/2 308 ! 309 SELECT CASE (cd_type ) 310 ! 311 CASE ( 'T' ,'S', 'U', 'W') 312 DO jk =1, 4 313 DO ji = 1-jpr2di, nlci+jpr2di 314 pt3d(ji,nlcj:nlcj+jpr2dj,jk) = ztab(ji,nlcj:nlcj+jpr2dj,jk+3-2*MOD(jk+3,4)) 315 END DO 316 END DO 317 ! 318 CASE ( 'F' ,'G' , 'I', 'V' ) 319 DO jk =1, 4 320 DO ji = 1-jpr2di, nlci+jpr2di 321 pt3d(ji,nlcj:nlcj+jpr2dj,jk) = ztab(ji,nlcj:nlcj+jpr2dj,jk+3-2*MOD(jk+3,4)) 322 END DO 323 END DO 324 DO jk =1, 4 325 DO ji = nlci+jpr2di, 1-jpr2di, -1 326 IF( ( ji .LT. mi0(iloc) .AND. mi0(iloc) /= 1 ) .OR. ( mi0(iloc) == jpi+1 ) ) EXIT 389 327 pt3d(ji,nlcj-1,jk) = ztab(ji,nlcj-1,jk+3-2*MOD(jk+3,4)) 390 ENDDO391 ENDDO392 393 394 395 328 END DO 329 END DO 330 ! 331 END SELECT ! cd_type 332 ! 333 END SELECT ! npolj 396 334 ! 397 335 END SUBROUTINE sol_exd -
trunk/NEMO/OPA_SRC/SOL/solpcg.F90
r1528 r1601 8 8 !! sol_pcg : preconditionned conjugate gradient solver 9 9 !!---------------------------------------------------------------------- 10 !! * Modules used11 10 USE oce ! ocean dynamics and tracers variables 12 11 USE dom_oce ! ocean space and time domain variables … … 19 18 PRIVATE 20 19 21 !! * Routine accessibility 22 PUBLIC sol_pcg ! ??? 20 PUBLIC sol_pcg ! 23 21 24 22 !! * Substitutions 25 23 # include "vectopt_loop_substitute.h90" 26 24 !!---------------------------------------------------------------------- 27 !!---------------------------------------------------------------------- 28 !! OPA 9.0 , LOCEAN-IPSL (2005) 25 !! NEMO/OPA 3.2 , LOCEAN-IPSL (2009) 29 26 !! $Id$ 30 !! This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt27 !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 31 28 !!---------------------------------------------------------------------- 32 29 CONTAINS … … 85 82 !! ! 08-01 (R. Benshila) mpp optimization 86 83 !!---------------------------------------------------------------------- 87 !! * Arguments88 84 INTEGER, INTENT( inout ) :: kindic ! solver indicator, < 0 if the conver- 89 85 ! ! gence is not reached: the model is 90 86 ! ! stopped in step 91 87 ! ! set to zero before the call of solpcg 92 93 !! * Local declarations 88 !! 94 89 INTEGER :: ji, jj, jn ! dummy loop indices 95 90 REAL(wp) :: zgcad ! temporary scalars … … 151 146 152 147 ! !================ 153 DO jn = 1, n max! Iterative loop148 DO jn = 1, nn_nmax ! Iterative loop 154 149 ! !================ 155 150 … … 177 172 178 173 ! test of convergence 179 IF( rnorme < epsr .OR. jn == n max ) THEN174 IF( rnorme < epsr .OR. jn == nn_nmax ) THEN 180 175 res = SQRT( rnorme ) 181 176 niter = jn … … 200 195 201 196 ! indicator of non-convergence or explosion 202 IF( jn == n max .OR. SQRT(epsr)/eps > 1.e+20 ) kindic = -2197 IF( jn == nn_nmax .OR. SQRT(epsr)/eps > 1.e+20 ) kindic = -2 203 198 IF( ncut == 999 ) GOTO 999 204 199 -
trunk/NEMO/OPA_SRC/SOL/solsor.F90
r1528 r1601 4 4 !! Ocean solver : Successive Over-Relaxation solver 5 5 !!===================================================================== 6 !! History : OPA ! 1990-10 (G. Madec) Original code 7 !! 7.1 ! 1993-04 (G. Madec) time filter 8 !! ! 1996-05 (G. Madec) merge sor and pcg formulations 9 !! ! 1996-11 (A. Weaver) correction to preconditioning 10 !! NEMO 1.0 ! 2003-04 (C. Deltel, G. Madec) Red-Black SOR in free form 11 !! 2.0 ! 2005-09 (R. Benshila, G. Madec) MPI optimization 12 !!---------------------------------------------------------------------- 6 13 7 14 !!---------------------------------------------------------------------- 8 15 !! sol_sor : Red-Black Successive Over-Relaxation solver 9 16 !!---------------------------------------------------------------------- 10 !! * Modules used11 17 USE oce ! ocean dynamics and tracers variables 12 18 USE dom_oce ! ocean space and time domain variables … … 20 26 PRIVATE 21 27 22 !! * Routine accessibility 23 PUBLIC sol_sor ! ??? 28 PUBLIC sol_sor ! 24 29 25 30 !!---------------------------------------------------------------------- 26 !! OPA 9.0 , LOCEAN-IPSL (2005)31 !! NEMO/OPA 3.2 , LOCEAN-IPSL (2009) 27 32 !! $Id$ 28 !! This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt33 !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 29 34 !!---------------------------------------------------------------------- 30 35 … … 49 54 !! conditions only when the inside domain is reached. 50 55 !! 51 !! References : 52 !! Madec et al. 1988, Ocean Modelling, issue 78, 1-6. 53 !! Beare and Stevens 1997 Ann. Geophysicae 15, 1369-1377 56 !! References : Madec et al. 1988, Ocean Modelling, issue 78, 1-6. 57 !! Beare and Stevens 1997 Ann. Geophysicae 15, 1369-1377 58 !!---------------------------------------------------------------------- 59 INTEGER, INTENT(inout) :: kindic ! solver indicator, < 0 if the convergence is not reached: 60 ! ! the model is stopped in step (set to zero before the call of solsor) 54 61 !! 55 !! History :56 !! ! 90-10 (G. Madec) Original code57 !! ! 91-11 (G. Madec)58 !! 7.1 ! 93-04 (G. Madec) time filter59 !! ! 96-05 (G. Madec) merge sor and pcg formulations60 !! ! 96-11 (A. Weaver) correction to preconditioning61 !! 9.0 ! 03-04 (C. Deltel, G. Madec) Red-Black SOR in free form62 !! 9.0 ! 05-09 (R. Benshila, G. Madec) MPI optimization63 !!----------------------------------------------------------------------64 !! * Arguments65 INTEGER, INTENT( inout ) :: kindic ! solver indicator, < 0 if the conver-66 ! ! gence is not reached: the model is67 ! ! stopped in step68 ! ! set to zero before the call of solsor69 !! * Local declarations70 62 INTEGER :: ji, jj, jn ! dummy loop indices 71 63 INTEGER :: ishift, icount 64 INTEGER :: ijmppodd, ijmppeven, ijpr2d 72 65 REAL(wp) :: ztmp, zres, zres2 73 74 INTEGER :: ijmppodd, ijmppeven75 INTEGER :: ijpr2d76 66 !!---------------------------------------------------------------------- 77 67 78 ijmppeven = MOD( nimpp+njmpp+jpr2di+jpr2dj,2)79 ijmppodd = MOD( nimpp+njmpp+jpr2di+jpr2dj+1,2)80 ijpr2d = MAX(jpr2di,jpr2dj)68 ijmppeven = MOD( nimpp+njmpp+jpr2di+jpr2dj , 2 ) 69 ijmppodd = MOD( nimpp+njmpp+jpr2di+jpr2dj+1 , 2 ) 70 ijpr2d = MAX( jpr2di , jpr2dj ) 81 71 icount = 0 82 72 ! ! ============== 83 DO jn = 1, n max! Iterative loop73 DO jn = 1, nn_nmax ! Iterative loop 84 74 ! ! ============== 85 75 86 ! applied the lateral boundary conditions 87 IF( MOD(icount,ijpr2d+1) == 0 ) CALL lbc_lnk_e( gcx, c_solver_pt, 1. ) 76 IF( MOD(icount,ijpr2d+1) == 0 ) CALL lbc_lnk_e( gcx, c_solver_pt, 1. ) ! lateral boundary conditions 88 77 89 78 ! Residus … … 103 92 gcr(ji,jj) = zres * gcdmat(ji,jj) * zres 104 93 ! Guess update 105 gcx(ji,jj) = sor * ztmp + (1-sor) * gcx(ji,jj)94 gcx(ji,jj) = rn_sor * ztmp + (1-rn_sor) * gcx(ji,jj) 106 95 END DO 107 96 END DO 108 97 icount = icount + 1 109 98 110 ! applied the lateral boundary conditions 111 IF( MOD(icount,ijpr2d+1) == 0 ) CALL lbc_lnk_e( gcx, c_solver_pt, 1. ) 99 IF( MOD(icount,ijpr2d+1) == 0 ) CALL lbc_lnk_e( gcx, c_solver_pt, 1. ) ! lateral boundary conditions 112 100 113 101 ! Guess red update … … 124 112 gcr(ji,jj) = zres * gcdmat(ji,jj) * zres 125 113 ! Guess update 126 gcx(ji,jj) = sor * ztmp + (1-sor) * gcx(ji,jj)114 gcx(ji,jj) = rn_sor * ztmp + (1-rn_sor) * gcx(ji,jj) 127 115 END DO 128 116 END DO … … 130 118 131 119 ! test of convergence 132 IF ( jn > n min .AND. MOD( jn-nmin, nmod ) == 0 ) then120 IF ( jn > nn_nmin .AND. MOD( jn-nn_nmin, nn_nmod ) == 0 ) THEN 133 121 134 SELECT CASE ( n sol_arp )122 SELECT CASE ( nn_sol_arp ) 135 123 CASE ( 0 ) ! absolute precision (maximum value of the residual) 136 124 zres2 = MAXVAL( gcr(2:nlci-1,2:nlcj-1) ) 137 125 IF( lk_mpp ) CALL mpp_max( zres2 ) ! max over the global domain 138 126 ! test of convergence 139 IF( zres2 < r esmax .OR. jn ==nmax ) THEN127 IF( zres2 < rn_resmax .OR. jn == nn_nmax ) THEN 140 128 res = SQRT( zres2 ) 141 129 niter = jn … … 146 134 IF( lk_mpp ) CALL mpp_sum( rnorme ) ! sum over the global domain 147 135 ! test of convergence 148 IF( rnorme < epsr .OR. jn == n max ) THEN136 IF( rnorme < epsr .OR. jn == nn_nmax ) THEN 149 137 res = SQRT( rnorme ) 150 138 niter = jn … … 160 148 ENDIF 161 149 ! indicator of non-convergence or explosion 162 IF( jn == n max .OR. SQRT(epsr)/eps > 1.e+20 ) kindic = -2150 IF( jn == nn_nmax .OR. SQRT(epsr)/eps > 1.e+20 ) kindic = -2 163 151 IF( ncut == 999 ) GOTO 999 164 152 … … 169 157 999 CONTINUE 170 158 171 172 159 ! Output in gcx 173 160 ! ------------- 174 175 161 CALL lbc_lnk_e( gcx, c_solver_pt, 1. ) ! boundary conditions 176 177 162 ! 178 163 END SUBROUTINE sol_sor 179 164 -
trunk/NEMO/OPA_SRC/SOL/solver.F90
r1581 r1601 4 4 !! Ocean solver : initialization of ocean solver 5 5 !!===================================================================== 6 6 !! History : OPA ! 1990-10 (G. Madec) Original code 7 !! ! 1993-02 (O. Marti) 8 !! ! 1997-02 (G. Madec) local depth inverse computation 9 !! ! 1998-10 (G. Roullet, G. Madec) free surface 10 !! NEMO 1.0 ! 2003-07 (G. Madec) free form, F90 11 !! 3.2 ! 2009-07 (R. Benshila) suppression of rigid-lid & FETI solver 12 !!---------------------------------------------------------------------- 13 #if defined key_dynspg_flt || defined key_esopa 14 !!---------------------------------------------------------------------- 15 !! 'key_dynspg_flt' filtered free surface 7 16 !!---------------------------------------------------------------------- 8 17 !! solver_init: solver initialization 9 18 !!---------------------------------------------------------------------- 10 !! * Modules used11 19 USE oce ! ocean dynamics and tracers variables 12 20 USE dom_oce ! ocean space and time domain variables 13 21 USE zdf_oce ! ocean vertical physics variables 14 22 USE sol_oce ! solver variables 15 USE solmat ! ??? 23 USE dynspg_oce ! choice/control of key cpp for surface pressure gradient 24 USE solmat ! matrix of the solver 16 25 USE obc_oce ! Lateral open boundary condition 17 26 USE in_out_manager ! I/O manager 18 27 USE lbclnk ! ocean lateral boundary conditions (or mpp link) 19 28 USE lib_mpp 20 USE dynspg_oce ! choice/control of key cpp for surface pressure gradient21 29 22 30 IMPLICIT NONE 23 31 24 32 !!---------------------------------------------------------------------- 25 !! OPA 9.0 , LOCEAN-IPSL (2005)33 !! NEMO/OPA 9.0 , LOCEAN-IPSL (2009) 26 34 !! $Id$ 27 !! This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt35 !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 28 36 !!---------------------------------------------------------------------- 29 37 … … 34 42 !! *** ROUTINE solver_init *** 35 43 !! 36 !! ** Purpose : Initialization for the solver of the elliptic equation: 37 !! * lk_dynspg_flt = T : transport divergence system. 44 !! ** Purpose : Initialization of the elliptic solver 38 45 !! 39 !! ** Method : 40 !! - Compute the local depth of the water column at u- and v-point 41 !! The local depth of the water column is computed by summing 42 !! the vertical scale factors. For its inverse, the thickness of 43 !! the first model level is imposed as lower bound. The inverse of 44 !! this depth is THEN taken and masked, so that the inverse of the 45 !! local depth is zero when the local depth is zero. 46 !! ** Method : a solver is required when using the filtered free 47 !! surface. 46 48 !! 47 !! ** Action : - hur, hvr : masked inverse of the local depth at 48 !! u- and v-point. 49 !! - hu, hv : masked local depth at u- and v- points 50 !! - c_solver_pt : nature of the gridpoint at which the 51 !! solver is applied 52 !! References : 53 !! Jensen, 1986: adv. phys. oceanogr. num. mod.,ed. o brien,87-110. 54 !! Madec & Marti, 1990: internal rep. LODYC, 90/03., 29pp. 49 !! ** Action : - c_solver_pt : nature of the gridpoint at which the solver is applied 55 50 !! 56 !! History : 57 !! ! 90-10 (G. Madec) Original code 58 !! ! 93-02 (O. Marti) 59 !! ! 97-02 (G. Madec) local depth inverse computation 60 !! ! 98-10 (G. Roullet, G. Madec) free surface 61 !! 9.0 ! 03-07 (G. Madec) free form, F90 62 !! " ! 05-11 (V. Garnier) Surface pressure gradient organization 51 !! References : Jensen, 1986: Adv. Phys. Oceanogr. Num. Mod.,Ed. O Brien,87-110. 63 52 !!---------------------------------------------------------------------- 64 !! * Arguments65 53 INTEGER, INTENT(in) :: kt 66 67 NAMELIST/namsol/ n solv, nsol_arp, nmin, nmax, nmod, eps, resmax, sor, rnu54 !! 55 NAMELIST/namsol/ nn_solv, nn_sol_arp, nn_nmin, nn_nmax, nn_nmod, rn_eps, rn_resmax, rn_sor 68 56 !!---------------------------------------------------------------------- 69 57 70 IF(lwp) THEN 58 IF(lwp) THEN !* open elliptic solver statistics file (only on the printing processors) 59 CALL ctl_opn( numsol, 'solver.stat', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp, narea ) 60 ENDIF 61 62 REWIND( numnam ) !* Namelist namsol : elliptic solver / free surface 63 READ ( numnam, namsol ) 64 65 IF(lwp) THEN !* Control print 71 66 WRITE(numout,*) 72 67 WRITE(numout,*) 'solver_init : solver to compute the surface pressure gradient' 73 68 WRITE(numout,*) '~~~~~~~~~~~' 74 75 ! open elliptic solver statistics file 76 CALL ctl_opn( numsol, 'solver.stat', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp, narea ) 77 ENDIF 78 79 80 ! 0. Define the solver parameters 81 ! ---------------------------- 82 ! Namelist namsol : elliptic solver / free surface 83 REWIND( numnam ) 84 READ ( numnam, namsol ) 85 86 ! 0. Parameter control and print 87 ! --------------------------- 88 89 ! Control print 90 IF(lwp) WRITE(numout,*) ' Namelist namsol : set solver parameters' 91 92 IF(lwp) THEN 93 WRITE(numout,*) ' type of elliptic solver nsolv = ', nsolv 94 WRITE(numout,*) ' absolute/relative (0/1) precision nsol_arp = ', nsol_arp 95 WRITE(numout,*) ' minimum iterations for solver nmin = ', nmin 96 WRITE(numout,*) ' maximum iterations for solver nmax = ', nmax 97 WRITE(numout,*) ' frequency for test nmod = ', nmod 98 WRITE(numout,*) ' absolute precision of solver eps = ', eps 99 WRITE(numout,*) ' absolute precision for SOR solver resmax = ', resmax 100 WRITE(numout,*) ' optimal coefficient of sor sor = ', sor 101 WRITE(numout,*) ' free surface parameter rnu = ', rnu 69 WRITE(numout,*) ' Namelist namsol : set solver parameters' 70 WRITE(numout,*) ' type of elliptic solver nn_solv = ', nn_solv 71 WRITE(numout,*) ' absolute/relative (0/1) precision nn_sol_arp = ', nn_sol_arp 72 WRITE(numout,*) ' minimum iterations for solver nn_nmin = ', nn_nmin 73 WRITE(numout,*) ' maximum iterations for solver nn_nmax = ', nn_nmax 74 WRITE(numout,*) ' frequency for test nn_nmod = ', nn_nmod 75 WRITE(numout,*) ' absolute precision of solver rn_eps = ', rn_eps 76 WRITE(numout,*) ' absolute precision for SOR solver rn_resmax = ', rn_resmax 77 WRITE(numout,*) ' optimal coefficient of sor rn_sor = ', rn_sor 102 78 WRITE(numout,*) 103 79 ENDIF 80 eps = rn_eps 104 81 105 IF( lk_dynspg_flt ) THEN 106 IF(lwp) WRITE(numout,*) 107 IF(lwp) WRITE(numout,*) ' free surface formulation' 108 ELSE 109 CALL ctl_stop( ' Choose only one surface pressure gradient calculation: filtered ', & 110 & ' Should not call this routine if dynspg_exp or dynspg_ts has been chosen' ) 111 ENDIF 112 113 SELECT CASE ( nsolv ) 114 115 CASE ( 1 ) ! preconditioned conjugate gradient solver 116 IF(lwp) WRITE(numout,*) ' a preconditioned conjugate gradient solver is used' 117 IF( jpr2di /= 0 .AND. jpr2dj /= 0 ) & 118 CALL ctl_stop( ' jpr2di and jpr2dj should be equal to zero' ) 119 120 CASE ( 2 ) ! successive-over-relaxation solver 121 IF(lwp) WRITE(numout,*) ' a successive-over-relaxation solver with extra outer halo is used' 122 IF(lwp) WRITE(numout,*) ' with jpr2di =', jpr2di, ' and jpr2dj =', jpr2dj 82 SELECT CASE( nn_solv ) !* parameter check 83 ! 84 CASE ( 1 ) ! preconditioned conjugate gradient solver 85 IF(lwp) WRITE(numout,*) ' a preconditioned conjugate gradient solver is used' 86 IF( jpr2di /= 0 .AND. jpr2dj /= 0 ) CALL ctl_stop( ' jpr2di and jpr2dj should be equal to zero' ) 87 ! 88 CASE ( 2 ) ! successive-over-relaxation solver 89 IF(lwp) WRITE(numout,*) ' a successive-over-relaxation solver with extra outer halo is used' 90 IF(lwp) WRITE(numout,*) ' with jpr2di =', jpr2di, ' and jpr2dj =', jpr2dj 123 91 IF( .NOT. lk_mpp .AND. jpr2di /= 0 .AND. jpr2dj /= 0 ) THEN 124 CALL ctl_stop( ' 125 & ' In this case thisalgorithm should be used only with the key_mpp_... option' )92 CALL ctl_stop( 'jpr2di and jpr2dj are not equal to zero', & 93 & 'In this case the algorithm should be used only with the key_mpp_... option' ) 126 94 ELSE 127 95 IF( ( ( jperio == 1 .OR. jperio == 4 .OR. jperio == 6 ) .OR. ( jpni /= 1 ) ) & 128 & .AND. ( jpr2di /= jpr2dj ) ) CALL ctl_stop( 'jpr2di should be equal to jpr2dj' )96 & .AND. ( jpr2di /= jpr2dj ) ) CALL ctl_stop( 'jpr2di should be equal to jpr2dj' ) 129 97 ENDIF 130 131 CASE DEFAULT 132 WRITE(ctmp1,*) ' bad flag value for n solv = ', nsolv98 ! 99 CASE DEFAULT ! error in parameter 100 WRITE(ctmp1,*) ' bad flag value for nn_solv = ', nn_solv 133 101 CALL ctl_stop( ctmp1 ) 134 135 102 END SELECT 136 137 IF( nbit_cmp == 1 ) THEN 138 IF( n solv /= 2 ) THEN139 CALL ctl_stop( ' Reproductibility tests (nbit_cmp=1) require the SOR solver: n solv = 2' )103 ! 104 IF( nbit_cmp == 1 ) THEN ! reproductibility test SOR required 105 IF( nn_solv /= 2 ) THEN 106 CALL ctl_stop( ' Reproductibility tests (nbit_cmp=1) require the SOR solver: nn_solv = 2' ) 140 107 ELSE IF( MAX( jpr2di, jpr2dj ) > 0 ) THEN 141 108 CALL ctl_stop( ' Reproductibility tests (nbit_cmp=1) require jpr2di = jpr2dj = 0' ) … … 143 110 END IF 144 111 145 ! Grid-point at which the solver is applied 146 ! ----------------------------------------- 147 148 IF( lk_mpp ) THEN 149 c_solver_pt = 'S' ! S=T with special staff ??? which one? 150 ELSE 151 c_solver_pt = 'T' 112 ! !* Grid-point at which the solver is applied 113 !!gm c_solver_pt should be removed: nomore bsf, only T-point is used 114 IF( lk_mpp ) THEN ; c_solver_pt = 'S' ! S=T with special staff ??? which one? 115 ELSE ; c_solver_pt = 'T' 152 116 ENDIF 153 117 154 ! Construction of the elliptic system matrix 155 ! ------------------------------------------ 156 157 CALL sol_mat( kt ) 118 CALL sol_mat( kt ) !* Construction of the elliptic system matrix 158 119 ! 159 120 END SUBROUTINE solver_init 121 #endif 160 122 161 123 !!====================================================================== -
trunk/NEMO/OPA_SRC/TRA/traadv.F90
r1482 r1601 31 31 PUBLIC tra_adv ! routine called by step module 32 32 33 ! !* Namelist nam_traadv33 ! !!* Namelist namtra_adv * 34 34 LOGICAL, PUBLIC :: ln_traadv_cen2 = .TRUE. ! 2nd order centered scheme flag 35 35 LOGICAL, PUBLIC :: ln_traadv_tvd = .FALSE. ! TVD scheme flag … … 136 136 INTEGER :: ioptio 137 137 138 NAMELIST/nam _traadv/ ln_traadv_cen2 , ln_traadv_tvd, &138 NAMELIST/namtra_adv/ ln_traadv_cen2 , ln_traadv_tvd, & 139 139 & ln_traadv_muscl, ln_traadv_muscl2, & 140 140 & ln_traadv_ubs , ln_traadv_qck 141 141 !!---------------------------------------------------------------------- 142 142 143 REWIND ( numnam ) ! Read Namelist nam _traadv : tracer advection scheme144 READ ( numnam, nam _traadv )143 REWIND ( numnam ) ! Read Namelist namtra_adv : tracer advection scheme 144 READ ( numnam, namtra_adv ) 145 145 146 146 IF(lwp) THEN ! Namelist print … … 148 148 WRITE(numout,*) 'tra_adv_ctl : choice/control of the tracer advection scheme' 149 149 WRITE(numout,*) '~~~~~~~~~~~' 150 WRITE(numout,*) ' Namelist nam_traadv : chose a advection scheme for tracers'151 WRITE(numout,*) ' 152 WRITE(numout,*) ' 153 WRITE(numout,*) ' 154 WRITE(numout,*) ' 155 WRITE(numout,*) ' 156 WRITE(numout,*) ' 150 WRITE(numout,*) ' Namelist namtra_adv : chose a advection scheme for tracers' 151 WRITE(numout,*) ' 2nd order advection scheme ln_traadv_cen2 = ', ln_traadv_cen2 152 WRITE(numout,*) ' TVD advection scheme ln_traadv_tvd = ', ln_traadv_tvd 153 WRITE(numout,*) ' MUSCL advection scheme ln_traadv_muscl = ', ln_traadv_muscl 154 WRITE(numout,*) ' MUSCL2 advection scheme ln_traadv_muscl2 = ', ln_traadv_muscl2 155 WRITE(numout,*) ' UBS advection scheme ln_traadv_ubs = ', ln_traadv_ubs 156 WRITE(numout,*) ' QUICKEST advection scheme ln_traadv_qck = ', ln_traadv_qck 157 157 ENDIF 158 158 … … 166 166 IF( lk_esopa ) ioptio = 1 167 167 168 IF( ioptio /= 1 ) CALL ctl_stop( 'Choose ONE advection scheme in namelist nam _traadv' )168 IF( ioptio /= 1 ) CALL ctl_stop( 'Choose ONE advection scheme in namelist namtra_adv' ) 169 169 170 170 IF( n_cla == 1 .AND. .NOT. ln_traadv_cen2 ) & -
trunk/NEMO/OPA_SRC/TRA/trabbc.F90
r1152 r1601 15 15 !! tra_bbc_init : initialization of geothermal heat flux trend 16 16 !!---------------------------------------------------------------------- 17 !! * Modules used18 17 USE oce ! ocean dynamics and active tracers 19 18 USE dom_oce ! ocean space and time domain … … 32 31 LOGICAL, PUBLIC, PARAMETER :: lk_trabbc = .TRUE. !: bbc flag 33 32 34 ! !* Namelist nambbc: bottom boundary condition35 INTEGER :: n geo_flux= 1 ! Geothermal flux (0:no flux, 1:constant flux, 2:read in file )36 REAL(wp) :: ngeo_flux_const = 86.4e-3 ! Constant value of geothermal heat flux33 ! !!* Namelist nambbc: bottom boundary condition * 34 INTEGER :: nn_geoflx = 1 ! Geothermal flux (0:no flux, 1:constant flux, 2:read in file ) 35 REAL(wp) :: rn_geoflx_cst = 86.4e-3 ! Constant value of geothermal heat flux 37 36 38 37 INTEGER , DIMENSION(jpi,jpj) :: nbotlevt ! ocean bottom level index at T-pt … … 42 41 # include "domzgr_substitute.h90" 43 42 !!---------------------------------------------------------------------- 44 !! OPA 9.0 , LOCEAN-IPSL (2006)43 !! NEMO/OPA 3.2 , LOCEAN-IPSL (2009) 45 44 !! $Id$ 46 45 !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) … … 54 53 !! 55 54 !! ** Purpose : Compute the bottom boundary contition on temperature 56 !! associated with geothermal heating and add it to the general57 !! trend of temperature equations.55 !! associated with geothermal heating and add it to the 56 !! general trend of temperature equations. 58 57 !! 59 58 !! ** Method : The geothermal heat flux set to its constant value of 60 !! 86.4 mW/m2 (Stein and Stein 1992, Huang 1999).59 !! 86.4 mW/m2 (Stein and Stein 1992, Huang 1999). 61 60 !! The temperature trend associated to this heat flux through the 62 61 !! ocean bottom can be computed once and is added to the temperature … … 69 68 !! 70 69 !! References : Stein, C. A., and S. Stein, 1992, Nature, 359, 123-129. 70 !! Emile-Geay and Madec, 2009, Ocean Science. 71 71 !!---------------------------------------------------------------------- 72 72 USE oce, ONLY : ztrdt => ua ! use ua as 3D workspace … … 75 75 INTEGER, INTENT( in ) :: kt ! ocean time-step index 76 76 !! 77 #if defined key_vectopt_loop 78 INTEGER :: ji ! dummy loop indices 79 #else 80 INTEGER :: ji, jj ! dummy loop indices 81 #endif 77 INTEGER :: ji, jj ! dummy loop indices 82 78 REAL(wp) :: zqgh_trd ! geothermal heat flux trend 83 79 !!---------------------------------------------------------------------- … … 92 88 ! Add the geothermal heat flux trend on temperature 93 89 94 SELECT CASE ( n geo_flux )90 SELECT CASE ( nn_geoflx ) 95 91 ! 96 92 CASE ( 1:2 ) ! geothermal heat flux 97 93 #if defined key_vectopt_loop 98 DO ji = jpi+2, jpij-jpi-1 ! vector opt. (forced unrolling) 99 zqgh_trd = ro0cpr * qgh_trd0(ji,1) / fse3t(ji,1,nbotlevt(ji,1) ) 100 ta(ji,1,nbotlevt(ji,1)) = ta(ji,1,nbotlevt(ji,1)) + zqgh_trd 101 END DO 94 DO jj = 1, 1 95 DO ji = jpi+2, jpij-jpi-1 ! vector opt. (forced unrolling) 102 96 #else 103 97 DO jj = 2, jpjm1 104 98 DO ji = 2, jpim1 99 #endif 105 100 zqgh_trd = ro0cpr * qgh_trd0(ji,jj) / fse3t(ji,jj,nbotlevt(ji,jj)) 106 101 ta(ji,jj,nbotlevt(ji,jj)) = ta(ji,jj,nbotlevt(ji,jj)) + zqgh_trd 107 102 END DO 108 103 END DO 109 #endif110 104 END SELECT 111 105 … … 115 109 ENDIF 116 110 ! 117 IF(ln_ctl) CALL prt_ctl( tab3d_1=ta, clinfo1=' bbc - Ta: ', mask1=tmask, clinfo3='tra-ta')111 IF(ln_ctl) CALL prt_ctl( tab3d_1=ta, clinfo1=' bbc - Ta: ', mask1=tmask, clinfo3='tra-ta' ) 118 112 ! 119 113 END SUBROUTINE tra_bbc … … 124 118 !! *** ROUTINE tra_bbc_init *** 125 119 !! 126 !! ** Purpose : Compute once for all the trend associated with geo -127 !! thermalheating that will be applied at each time step at the128 !! bottomocean level120 !! ** Purpose : Compute once for all the trend associated with geothermal 121 !! heating that will be applied at each time step at the 122 !! last ocean level 129 123 !! 130 124 !! ** Method : Read the nambbc namelist and check the parameters. 131 !! called at the first time step (nit000)132 125 !! 133 126 !! ** Input : - Namlist nambbc … … 141 134 INTEGER :: ji, jj ! dummy loop indices 142 135 INTEGER :: inum ! temporary logical unit 143 144 NAMELIST/nambbc/n geo_flux, ngeo_flux_const136 !! 137 NAMELIST/nambbc/nn_geoflx, rn_geoflx_cst 145 138 !!---------------------------------------------------------------------- 146 139 … … 148 141 READ ( numnam, nambbc ) 149 142 150 !! Control print151 IF(lwp)WRITE(numout,*)152 IF(lwp) WRITE(numout,*) 'tra_bbc : tempearture Bottom Boundary Condition (bbc)'153 IF(lwp) WRITE(numout,*) '~~~~~~~ Geothermal heatflux'154 IF(lwp) WRITE(numout,*) 'Namelist nambbc : set bbc parameters'155 IF(lwp) WRITE(numout,*)156 IF(lwp) WRITE(numout,*) ' Geothermal flux ngeo_flux = ', ngeo_flux157 IF(lwp) WRITE(numout,*) ' Constant geothermal flux ngeo_flux_const = ', ngeo_flux_const158 IF(lwp) WRITE(numout,*)143 IF(lwp) THEN ! Control print 144 WRITE(numout,*) 145 WRITE(numout,*) 'tra_bbc : temperature Bottom Boundary Condition (bbc), Geothermal heatflux' 146 WRITE(numout,*) '~~~~~~~ ' 147 WRITE(numout,*) ' Namelist nambbc : set bbc parameters' 148 WRITE(numout,*) ' Geothermal flux nn_geoflx = ', nn_geoflx 149 WRITE(numout,*) ' Constant geothermal flux rn_geoflx_cst = ', rn_geoflx_cst 150 WRITE(numout,*) 151 ENDIF 159 152 160 153 ! ! level of the ocean bottom at T-point … … 165 158 END DO 166 159 167 SELECT CASE ( n geo_flux ) ! initialization of geothermal heat flux160 SELECT CASE ( nn_geoflx ) ! initialization of geothermal heat flux 168 161 ! 169 162 CASE ( 0 ) ! no geothermal heat flux 170 IF(lwp) WRITE(numout,*) 171 IF(lwp) WRITE(numout,*) ' *** no geothermal heat flux' 163 IF(lwp) WRITE(numout,*) ' *** no geothermal heat flux' 172 164 ! 173 165 CASE ( 1 ) ! constant flux 174 IF(lwp) WRITE(numout,*) ' *** constant heat flux = ', ngeo_flux_const 175 qgh_trd0(:,:) = ngeo_flux_const 166 IF(lwp) WRITE(numout,*) ' *** constant heat flux = ', rn_geoflx_cst 176 167 ! 177 CASE ( 2 ) ! variable geothermal heat flux 178 ! read the geothermal fluxes in mW/m2 168 qgh_trd0(:,:) = rn_geoflx_cst 179 169 ! 180 IF(lwp) WRITE(numout,*) ' *** variable geothermal heat flux' 170 CASE ( 2 ) ! variable geothermal heat flux : read the geothermal fluxes in mW/m2 171 IF(lwp) WRITE(numout,*) ' *** variable geothermal heat flux' 181 172 CALL iom_open ( 'geothermal_heating.nc', inum ) 182 CALL iom_get ( inum, jpdom_data, 'heatflow', qgh_trd0 )183 CALL iom_close (inum)173 CALL iom_get ( inum, jpdom_data, 'heatflow', qgh_trd0 ) 174 CALL iom_close( inum ) 184 175 ! 185 176 qgh_trd0(:,:) = qgh_trd0(:,:) * 1.e-3 ! conversion in W/m2 186 177 ! 187 178 CASE DEFAULT 188 WRITE(ctmp1,*) ' bad flag value for n geo_flux = ', ngeo_flux179 WRITE(ctmp1,*) ' bad flag value for nn_geoflx = ', nn_geoflx 189 180 CALL ctl_stop( ctmp1 ) 190 181 ! 191 182 END SELECT 192 193 183 ! 194 184 END SUBROUTINE tra_bbc_init 195 185 -
trunk/NEMO/OPA_SRC/TRA/trabbl.F90
r1152 r1601 35 35 36 36 !!* Namelist nambbl: bottom boundary layer 37 REAL(wp), PUBLIC :: atrbbl = 1.e+3 !: lateral coeff. for bottom boundary layer scheme (m2/s)37 REAL(wp), PUBLIC :: rn_ahtbbl = 1.e+3 !: lateral coeff. for bottom boundary layer scheme (m2/s) 38 38 39 39 # if defined key_trabbl_dif … … 108 108 INTEGER, INTENT( in ) :: kt ! ocean time-step 109 109 !! 110 INTEGER :: ji, jj 110 INTEGER :: ji, jj ! dummy loop indices 111 111 INTEGER :: ik 112 INTEGER :: ii0, ii1, ij0, ij1 112 INTEGER :: ii0, ii1, ij0, ij1 ! temporary integers 113 113 INTEGER :: iku1, iku2, ikv1,ikv2 ! temporary intergers 114 114 REAL(wp) :: ze3u, ze3v ! temporary scalars 115 115 INTEGER :: iku, ikv 116 REAL(wp) :: & 117 zsign, zt, zs, zh, zalbet, & ! temporary scalars 118 zgdrho, zbtr, zta, zsa 119 REAL(wp), DIMENSION(jpi,jpj) :: & 120 zki, zkj, zkw, zkx, zky, zkz, & ! 2D workspace arrays 121 ztnb, zsnb, zdep, & 122 ztbb, zsbb, zahu, zahv 116 REAL(wp) :: zsign, zt, zs, zh, zalbet ! temporary scalars 117 REAL(wp) :: zgdrho, zbtr, zta, zsa 118 REAL(wp), DIMENSION(jpi,jpj) :: zki, zkj, zkw, zkx, zky, zkz ! 2D workspace 119 REAL(wp), DIMENSION(jpi,jpj) :: ztnb, zsnb, zdep, ztbb, zsbb, zahu, zahv 120 !! 123 121 REAL(wp) :: fsalbt, pft, pfs, pfh ! statement function 124 122 !!---------------------------------------------------------------------- … … 132 130 fsalbt( pft, pfs, pfh ) = & 133 131 ( ( ( -0.255019e-07 * pft + 0.298357e-05 ) * pft & 134 135 136 132 & - 0.203814e-03 ) * pft & 133 & + 0.170907e-01 ) * pft & 134 & + 0.665157e-01 & 137 135 +(-0.678662e-05 * pfs - 0.846960e-04 * pft + 0.378110e-02 ) * pfs & 138 136 + ( ( - 0.302285e-13 * pfh & 139 140 141 142 143 137 & - 0.251520e-11 * pfs & 138 & + 0.512857e-12 * pft * pft ) * pfh & 139 & - 0.164759e-06 * pfs & 140 & +( 0.791325e-08 * pft - 0.933746e-06 ) * pft & 141 & + 0.380374e-04 ) * pfh 144 142 !!---------------------------------------------------------------------- 145 143 … … 155 153 ! mbathy= number of w-level, minimum value=1 (cf dommsk.F) 156 154 # if defined key_vectopt_loop 157 jj =1158 DO ji = 1, jpij ! vector opt. (forced unrolling)155 DO jj = 1, 1 156 DO ji = 1, jpij ! vector opt. (forced unrolling) 159 157 # else 160 158 DO jj = 1, jpj … … 167 165 zsbb(ji,jj) = sb(ji,jj,ik) * tmask(ji,jj,1) 168 166 zdep(ji,jj) = fsdept(ji,jj,ik) ! depth of the ocean bottom T-level 169 # if ! defined key_vectopt_loop 170 END DO 171 # endif 167 END DO 172 168 END DO 173 169 174 170 IF( ln_zps ) THEN ! partial steps correction 175 171 # if defined key_vectopt_loop 176 jj =1177 DO ji = 1, jpij-jpi ! vector opt. (forced unrolling)172 DO jj = 1, 1 173 DO ji = 1, jpij-jpi ! vector opt. (forced unrolling) 178 174 # else 179 175 DO jj = 1, jpjm1 … … 186 182 ze3u = MIN( fse3u(ji,jj,iku1), fse3u(ji,jj,iku2) ) 187 183 ze3v = MIN( fse3v(ji,jj,ikv1), fse3v(ji,jj,ikv2) ) 188 zahu(ji,jj) = atrbbl * e2u(ji,jj) * ze3u / e1u(ji,jj) * umask(ji,jj,1) 189 zahv(ji,jj) = atrbbl * e1v(ji,jj) * ze3v / e2v(ji,jj) * vmask(ji,jj,1) 190 # if ! defined key_vectopt_loop 184 zahu(ji,jj) = rn_ahtbbl * e2u(ji,jj) * ze3u / e1u(ji,jj) * umask(ji,jj,1) 185 zahv(ji,jj) = rn_ahtbbl * e1v(ji,jj) * ze3v / e2v(ji,jj) * vmask(ji,jj,1) 191 186 END DO 192 # endif193 187 END DO 194 188 ELSE ! z-coordinate - full steps or s-coordinate 195 189 # if defined key_vectopt_loop 196 jj =1197 DO ji = 1, jpij-jpi ! vector opt. (forced unrolling)190 DO jj = 1, 1 191 DO ji = 1, jpij-jpi ! vector opt. (forced unrolling) 198 192 # else 199 193 DO jj = 1, jpjm1 … … 202 196 iku = mbku(ji,jj) 203 197 ikv = mbkv(ji,jj) 204 zahu(ji,jj) = atrbbl * e2u(ji,jj) * fse3u(ji,jj,iku) / e1u(ji,jj) * umask(ji,jj,1) 205 zahv(ji,jj) = atrbbl * e1v(ji,jj) * fse3v(ji,jj,ikv) / e2v(ji,jj) * vmask(ji,jj,1) 206 # if ! defined key_vectopt_loop 198 zahu(ji,jj) = rn_ahtbbl * e2u(ji,jj) * fse3u(ji,jj,iku) / e1u(ji,jj) * umask(ji,jj,1) 199 zahv(ji,jj) = rn_ahtbbl * e1v(ji,jj) * fse3v(ji,jj,ikv) / e2v(ji,jj) * vmask(ji,jj,1) 207 200 END DO 208 # endif209 201 END DO 210 202 ENDIF … … 215 207 ! multiplied by the slope of the ocean bottom 216 208 217 SELECT CASE ( neos ) 218 219 CASE ( 0 ) ! Jackett and McDougall (1994) formulation 220 221 # if defined key_vectopt_loop 222 jj = 1 223 DO ji = 1, jpij-jpi ! vector opt. (forced unrolling) 224 # else 225 DO jj = 1, jpjm1 226 DO ji = 1, jpim1 227 # endif 228 ! temperature, salinity anomalie and depth 229 zt = 0.5 * ( ztnb(ji,jj) + ztnb(ji+1,jj) ) 230 zs = 0.5 * ( zsnb(ji,jj) + zsnb(ji+1,jj) ) - 35.0 231 zh = 0.5 * ( zdep(ji,jj) + zdep(ji+1,jj) ) 232 ! masked ratio alpha/beta 233 zalbet = fsalbt( zt, zs, zh )*umask(ji,jj,1) 234 ! local density gradient along i-bathymetric slope 235 zgdrho = zalbet * ( ztnb(ji+1,jj) - ztnb(ji,jj) ) & 236 - ( zsnb(ji+1,jj) - zsnb(ji,jj) ) 237 ! sign of local i-gradient of density multiplied by the i-slope 238 zsign = SIGN( 0.5, - zgdrho * ( zdep(ji+1,jj) - zdep(ji,jj) ) ) 239 zki(ji,jj) = ( 0.5 - zsign ) * zahu(ji,jj) 240 # if ! defined key_vectopt_loop 241 END DO 242 # endif 243 END DO 244 245 # if defined key_vectopt_loop 246 jj = 1 247 DO ji = 1, jpij-jpi ! vector opt. (forced unrolling) 248 # else 249 DO jj = 1, jpjm1 250 DO ji = 1, jpim1 251 # endif 252 ! temperature, salinity anomalie and depth 253 zt = 0.5 * ( ztnb(ji,jj+1) + ztnb(ji,jj) ) 254 zs = 0.5 * ( zsnb(ji,jj+1) + zsnb(ji,jj) ) - 35.0 255 zh = 0.5 * ( zdep(ji,jj+1) + zdep(ji,jj) ) 256 ! masked ratio alpha/beta 257 zalbet = fsalbt( zt, zs, zh )*vmask(ji,jj,1) 258 ! local density gradient along j-bathymetric slope 259 zgdrho = zalbet * ( ztnb(ji,jj+1) - ztnb(ji,jj) ) & 260 - ( zsnb(ji,jj+1) - zsnb(ji,jj) ) 261 ! sign of local j-gradient of density multiplied by the j-slope 262 zsign = sign( 0.5, -zgdrho * ( zdep(ji,jj+1) - zdep(ji,jj) ) ) 263 zkj(ji,jj) = ( 0.5 - zsign ) * zahv(ji,jj) 264 # if ! defined key_vectopt_loop 265 END DO 266 # endif 267 END DO 268 269 CASE ( 1 ) ! Linear formulation function of temperature only 270 ! 271 # if defined key_vectopt_loop 272 jj = 1 273 DO ji = 1, jpij-jpi ! vector opt. (forced unrolling) 274 # else 275 DO jj = 1, jpjm1 276 DO ji = 1, jpim1 277 # endif 278 ! local 'density/temperature' gradient along i-bathymetric slope 279 zgdrho = ztnb(ji+1,jj) - ztnb(ji,jj) 280 ! sign of local i-gradient of density multiplied by the i-slope 281 zsign = SIGN( 0.5, - zgdrho * ( zdep(ji+1,jj) - zdep(ji,jj) ) ) 282 zki(ji,jj) = ( 0.5 - zsign ) * zahu(ji,jj) 283 # if ! defined key_vectopt_loop 284 END DO 285 # endif 286 END DO 287 288 # if defined key_vectopt_loop 289 jj = 1 290 DO ji = 1, jpij-jpi ! vector opt. (forced unrolling) 291 # else 292 DO jj = 1, jpjm1 293 DO ji = 1, jpim1 294 # endif 295 ! local density gradient along j-bathymetric slope 296 zgdrho = ztnb(ji,jj+1) - ztnb(ji,jj) 297 ! sign of local j-gradient of density multiplied by the j-slope 298 zsign = sign( 0.5, -zgdrho * ( zdep(ji,jj+1) - zdep(ji,jj) ) ) 299 zkj(ji,jj) = ( 0.5 - zsign ) * zahv(ji,jj) 300 # if ! defined key_vectopt_loop 301 END DO 302 # endif 303 END DO 304 305 CASE ( 2 ) ! Linear formulation function of temperature and salinity 306 307 # if defined key_vectopt_loop 308 jj = 1 309 DO ji = 1, jpij-jpi ! vector opt. (forced unrolling) 310 # else 311 DO jj = 1, jpjm1 312 DO ji = 1, jpim1 209 SELECT CASE ( nn_eos ) 210 ! 211 CASE ( 0 ) !== Jackett and McDougall (1994) formulation ==! 212 # if defined key_vectopt_loop 213 DO jj = 1, 1 214 DO ji = 1, jpij-jpi ! vector opt. (forced unrolling) 215 # else 216 DO jj = 1, jpjm1 217 DO ji = 1, jpim1 218 # endif 219 ! temperature, salinity anomalie and depth 220 zt = 0.5 * ( ztnb(ji,jj) + ztnb(ji+1,jj) ) 221 zs = 0.5 * ( zsnb(ji,jj) + zsnb(ji+1,jj) ) - 35.0 222 zh = 0.5 * ( zdep(ji,jj) + zdep(ji+1,jj) ) 223 ! masked ratio alpha/beta 224 zalbet = fsalbt( zt, zs, zh )*umask(ji,jj,1) 225 ! local density gradient along i-bathymetric slope 226 zgdrho = zalbet * ( ztnb(ji+1,jj) - ztnb(ji,jj) ) & 227 - ( zsnb(ji+1,jj) - zsnb(ji,jj) ) 228 ! sign of local i-gradient of density multiplied by the i-slope 229 zsign = SIGN( 0.5, - zgdrho * ( zdep(ji+1,jj) - zdep(ji,jj) ) ) 230 zki(ji,jj) = ( 0.5 - zsign ) * zahu(ji,jj) 231 ! 232 ! temperature, salinity anomalie and depth 233 zt = 0.5 * ( ztnb(ji,jj+1) + ztnb(ji,jj) ) 234 zs = 0.5 * ( zsnb(ji,jj+1) + zsnb(ji,jj) ) - 35.0 235 zh = 0.5 * ( zdep(ji,jj+1) + zdep(ji,jj) ) 236 ! masked ratio alpha/beta 237 zalbet = fsalbt( zt, zs, zh )*vmask(ji,jj,1) 238 ! local density gradient along j-bathymetric slope 239 zgdrho = zalbet * ( ztnb(ji,jj+1) - ztnb(ji,jj) ) & 240 - ( zsnb(ji,jj+1) - zsnb(ji,jj) ) 241 ! sign of local j-gradient of density multiplied by the j-slope 242 zsign = sign( 0.5, -zgdrho * ( zdep(ji,jj+1) - zdep(ji,jj) ) ) 243 zkj(ji,jj) = ( 0.5 - zsign ) * zahv(ji,jj) 244 END DO 245 END DO 246 ! 247 CASE ( 1 ) !== Linear formulation function of temperature only ==! 248 # if defined key_vectopt_loop 249 DO jj = 1, 1 250 DO ji = 1, jpij-jpi ! vector opt. (forced unrolling) 251 # else 252 DO jj = 1, jpjm1 253 DO ji = 1, jpim1 254 # endif 255 ! local 'density/temperature' gradient along i-bathymetric slope 256 zgdrho = ztnb(ji+1,jj) - ztnb(ji,jj) 257 ! sign of local i-gradient of density multiplied by the i-slope 258 zsign = SIGN( 0.5, - zgdrho * ( zdep(ji+1,jj) - zdep(ji,jj) ) ) 259 zki(ji,jj) = ( 0.5 - zsign ) * zahu(ji,jj) 260 ! 261 ! local density gradient along j-bathymetric slope 262 zgdrho = ztnb(ji,jj+1) - ztnb(ji,jj) 263 ! sign of local j-gradient of density multiplied by the j-slope 264 zsign = sign( 0.5, -zgdrho * ( zdep(ji,jj+1) - zdep(ji,jj) ) ) 265 zkj(ji,jj) = ( 0.5 - zsign ) * zahv(ji,jj) 266 END DO 267 END DO 268 ! 269 CASE ( 2 ) !== Linear formulation function of temperature and salinity ==! 270 # if defined key_vectopt_loop 271 DO jj = 1, 1 272 DO ji = 1, jpij-jpi ! vector opt. (forced unrolling) 273 # else 274 DO jj = 1, jpjm1 275 DO ji = 1, jpim1 313 276 # endif 314 ! local density gradient along i-bathymetric slope 315 zgdrho = - ( rbeta*( zsnb(ji+1,jj) - zsnb(ji,jj) ) & 316 - ralpha*( ztnb(ji+1,jj) - ztnb(ji,jj) ) ) 317 ! sign of local i-gradient of density multiplied by the i-slope 318 zsign = SIGN( 0.5, - zgdrho * ( zdep(ji+1,jj) - zdep(ji,jj) ) ) 319 zki(ji,jj) = ( 0.5 - zsign ) * zahu(ji,jj) 320 # if ! defined key_vectopt_loop 321 END DO 322 # endif 323 END DO 324 325 # if defined key_vectopt_loop 326 jj = 1 327 DO ji = 1, jpij-jpi ! vector opt. (forced unrolling) 328 # else 329 DO jj = 1, jpjm1 330 DO ji = 1, jpim1 331 # endif 332 ! local density gradient along j-bathymetric slope 333 zgdrho = - ( rbeta*( zsnb(ji,jj+1) - zsnb(ji,jj) ) & 334 - ralpha*( ztnb(ji,jj+1) - ztnb(ji,jj) ) ) 335 ! sign of local j-gradient of density multiplied by the j-slope 336 zsign = sign( 0.5, -zgdrho * ( zdep(ji,jj+1) - zdep(ji,jj) ) ) 337 zkj(ji,jj) = ( 0.5 - zsign ) * zahv(ji,jj) 338 # if ! defined key_vectopt_loop 339 END DO 340 # endif 341 END DO 342 343 CASE DEFAULT 344 345 WRITE(ctmp1,*) ' bad flag value for neos = ', neos 346 CALL ctl_stop(ctmp1) 347 277 ! local density gradient along i-bathymetric slope 278 zgdrho = - ( rn_beta *( zsnb(ji+1,jj) - zsnb(ji,jj) ) & 279 & - rn_alpha*( ztnb(ji+1,jj) - ztnb(ji,jj) ) ) 280 ! sign of local i-gradient of density multiplied by the i-slope 281 zsign = SIGN( 0.5, - zgdrho * ( zdep(ji+1,jj) - zdep(ji,jj) ) ) 282 zki(ji,jj) = ( 0.5 - zsign ) * zahu(ji,jj) 283 ! 284 ! local density gradient along j-bathymetric slope 285 zgdrho = - ( rn_beta *( zsnb(ji,jj+1) - zsnb(ji,jj) ) & 286 & - rn_alpha*( ztnb(ji,jj+1) - ztnb(ji,jj) ) ) 287 ! sign of local j-gradient of density multiplied by the j-slope 288 zsign = sign( 0.5, -zgdrho * ( zdep(ji,jj+1) - zdep(ji,jj) ) ) 289 zkj(ji,jj) = ( 0.5 - zsign ) * zahv(ji,jj) 290 END DO 291 END DO 292 ! 348 293 END SELECT 349 294 … … 403 348 ! second derivative (divergence) and add to the general tracer trend 404 349 # if defined key_vectopt_loop 405 jj =1406 DO ji = jpi+2, jpij-jpi-1 ! vector opt. (forced unrolling)350 DO jj = 1, 1 351 DO ji = jpi+2, jpij-jpi-1 ! vector opt. (forced unrolling) 407 352 # else 408 353 DO jj = 2, jpjm1 … … 417 362 ta(ji,jj,ik) = ta(ji,jj,ik) + zta 418 363 sa(ji,jj,ik) = sa(ji,jj,ik) + zsa 419 # if ! defined key_vectopt_loop 420 END DO 421 # endif 364 END DO 422 365 END DO 423 366 … … 460 403 REAL(wp), DIMENSION(jpi,jpj) :: zmbk 461 404 462 NAMELIST/nambbl/ atrbbl405 NAMELIST/nambbl/ rn_ahtbbl 463 406 !!---------------------------------------------------------------------- 464 407 … … 470 413 WRITE(numout,*) 'tra_bbl_init : ' 471 414 WRITE(numout,*) '~~~~~~~~~~~~' 472 IF (lk_trabbl_dif ) WRITE(numout,*) ' * Diffusive Bottom Boundary Layer'415 IF( lk_trabbl_dif ) WRITE(numout,*) ' * Diffusive Bottom Boundary Layer' 473 416 IF( lk_trabbl_adv ) WRITE(numout,*) ' * Advective Bottom Boundary Layer' 474 417 WRITE(numout,*) ' Namelist nambbl : set bbl parameters' 475 WRITE(numout,*) ' bottom boundary layer coef. atrbbl = ', atrbbl418 WRITE(numout,*) ' bottom boundary layer coef. rn_ahtbbl = ', rn_ahtbbl 476 419 ENDIF 477 420 -
trunk/NEMO/OPA_SRC/TRA/trabbl_adv.h90
r1482 r1601 101 101 102 102 #if defined key_vectopt_loop 103 jj =1104 DO ji = 1, jpij ! vector opt. (forced unrolling)103 DO jj = 1, 1 104 DO ji = 1, jpij ! vector opt. (forced unrolling) 105 105 #else 106 106 DO jj = 1, jpj … … 116 116 zunb(ji,jj) = un(ji,jj,mbku(ji,jj)) 117 117 zvnb(ji,jj) = vn(ji,jj,mbkv(ji,jj)) 118 #if ! defined key_vectopt_loop 119 END DO 120 #endif 118 END DO 121 119 END DO 122 120 … … 127 125 ! multiplied by the slope of the ocean bottom 128 126 129 SELECT CASE ( n eos )127 SELECT CASE ( nn_eos ) 130 128 ! 131 129 CASE ( 0 ) ! Jackett and McDougall (1994) formulation 132 ! 133 DO jj = 1, jpjm1 134 DO ji = 1, fs_jpim1 ! vector opt. 135 ! ... temperature, salinity anomalie and depth 136 zt = 0.5 * ( ztnb(ji,jj) + ztnb(ji+1,jj) ) 137 zs = 0.5 * ( zsnb(ji,jj) + zsnb(ji+1,jj) ) - 35.0 138 zh = 0.5 * ( zdep(ji,jj) + zdep(ji+1,jj) ) 139 ! ... masked ratio alpha/beta 140 zalbet = fsalbt( zt, zs, zh ) * umask(ji,jj,1) 141 ! ... local density gradient along i-bathymetric slope 142 zgdrho = zalbet * ( ztnb(ji+1,jj) - ztnb(ji,jj) ) & 143 & - ( zsnb(ji+1,jj) - zsnb(ji,jj) ) 144 zgdrho = zgdrho * umask(ji,jj,1) 145 ! ... sign of local i-gradient of density multiplied by the i-slope 146 zsign = SIGN( 0.5, -zgdrho * ( zdep(ji+1,jj) - zdep(ji,jj) ) ) 147 zsigna= SIGN( 0.5, zunb(ji,jj) * ( zdep(ji+1,jj) - zdep(ji,jj) ) ) 148 zalphax(ji,jj)=( 0.5 + zsigna ) * ( 0.5 - zsign ) * umask(ji,jj,1) 149 END DO 150 END DO 151 ! 152 DO jj = 1, jpjm1 153 DO ji = 1, fs_jpim1 ! vector opt. 154 ! ... temperature, salinity anomalie and depth 155 zt = 0.5 * ( ztnb(ji,jj+1) + ztnb(ji,jj) ) 156 zs = 0.5 * ( zsnb(ji,jj+1) + zsnb(ji,jj) ) - 35.0 157 zh = 0.5 * ( zdep(ji,jj+1) + zdep(ji,jj) ) 158 ! ... masked ratio alpha/beta 159 zalbet = fsalbt( zt, zs, zh ) * vmask(ji,jj,1) 160 ! ... local density gradient along j-bathymetric slope 161 zgdrho = zalbet * ( ztnb(ji,jj+1) - ztnb(ji,jj) ) & 162 & - ( zsnb(ji,jj+1) - zsnb(ji,jj) ) 163 zgdrho = zgdrho*vmask(ji,jj,1) 164 ! ... sign of local j-gradient of density multiplied by the j-slope 165 zsign = SIGN( 0.5, -zgdrho * ( zdep(ji,jj+1) - zdep(ji,jj) ) ) 166 zsigna= SIGN( 0.5, zvnb(ji,jj) * ( zdep(ji,jj+1) - zdep(ji,jj) ) ) 167 zalphay(ji,jj)=( 0.5 + zsigna ) * ( 0.5 - zsign ) * vmask(ji,jj,1) 168 END DO 169 END DO 170 ! 130 ! 131 DO jj = 1, jpjm1 132 DO ji = 1, fs_jpim1 ! vector opt. 133 ! ... temperature, salinity anomalie and depth 134 zt = 0.5 * ( ztnb(ji,jj) + ztnb(ji+1,jj) ) 135 zs = 0.5 * ( zsnb(ji,jj) + zsnb(ji+1,jj) ) - 35.0 136 zh = 0.5 * ( zdep(ji,jj) + zdep(ji+1,jj) ) 137 ! ... masked ratio alpha/beta 138 zalbet = fsalbt( zt, zs, zh ) * umask(ji,jj,1) 139 ! ... local density gradient along i-bathymetric slope 140 zgdrho = zalbet * ( ztnb(ji+1,jj) - ztnb(ji,jj) ) & 141 & - ( zsnb(ji+1,jj) - zsnb(ji,jj) ) 142 zgdrho = zgdrho * umask(ji,jj,1) 143 ! ... sign of local i-gradient of density multiplied by the i-slope 144 zsign = SIGN( 0.5, -zgdrho * ( zdep(ji+1,jj) - zdep(ji,jj) ) ) 145 zsigna= SIGN( 0.5, zunb(ji,jj) * ( zdep(ji+1,jj) - zdep(ji,jj) ) ) 146 zalphax(ji,jj)=( 0.5 + zsigna ) * ( 0.5 - zsign ) * umask(ji,jj,1) 147 ! 148 ! ... temperature, salinity anomalie and depth 149 zt = 0.5 * ( ztnb(ji,jj+1) + ztnb(ji,jj) ) 150 zs = 0.5 * ( zsnb(ji,jj+1) + zsnb(ji,jj) ) - 35.0 151 zh = 0.5 * ( zdep(ji,jj+1) + zdep(ji,jj) ) 152 ! ... masked ratio alpha/beta 153 zalbet = fsalbt( zt, zs, zh ) * vmask(ji,jj,1) 154 ! ... local density gradient along j-bathymetric slope 155 zgdrho = zalbet * ( ztnb(ji,jj+1) - ztnb(ji,jj) ) & 156 & - ( zsnb(ji,jj+1) - zsnb(ji,jj) ) 157 zgdrho = zgdrho*vmask(ji,jj,1) 158 ! ... sign of local j-gradient of density multiplied by the j-slope 159 zsign = SIGN( 0.5, -zgdrho * ( zdep(ji,jj+1) - zdep(ji,jj) ) ) 160 zsigna= SIGN( 0.5, zvnb(ji,jj) * ( zdep(ji,jj+1) - zdep(ji,jj) ) ) 161 zalphay(ji,jj)=( 0.5 + zsigna ) * ( 0.5 - zsign ) * vmask(ji,jj,1) 162 END DO 163 END DO 164 ! 171 165 CASE ( 1 ) ! Linear formulation function of temperature only 172 !173 DO jj = 1, jpjm1174 DO ji = 1, fs_jpim1 ! vector opt.175 ! local 'density/temperature' gradient along i-bathymetric slope176 zgdrho = ( ztnb(ji+1,jj) - ztnb(ji,jj) )177 ! sign of local i-gradient of density multiplied by the i-slope178 zsign = SIGN( 0.5, - zgdrho * ( zdep(ji+1,jj) - zdep(ji,jj) ) )179 zsigna= SIGN( 0.5, zunb(ji,jj) * ( zdep(ji+1,jj) - zdep(ji,jj) ) )180 zalphax(ji,jj)=( 0.5 + zsigna ) * ( 0.5 - zsign ) * umask(ji,jj,1)181 182 ! local density gradient along j-bathymetric slope183 zgdrho = ( ztnb(ji,jj+1) - ztnb(ji,jj) )184 ! sign of local j-gradient of density multiplied by the j-slope185 zsign = SIGN( 0.5, -zgdrho * ( zdep(ji,jj+1) - zdep(ji,jj) ) )186 zsigna= SIGN( 0.5, zvnb(ji,jj) * ( zdep(ji,jj+1) - zdep(ji,jj) ) )187 zalphay(ji,jj)=( 0.5 + zsigna ) * ( 0.5 - zsign ) * vmask(ji,jj,1)188 END DO189 END DO190 !166 ! 167 DO jj = 1, jpjm1 168 DO ji = 1, fs_jpim1 ! vector opt. 169 ! local 'density/temperature' gradient along i-bathymetric slope 170 zgdrho = ( ztnb(ji+1,jj) - ztnb(ji,jj) ) 171 ! sign of local i-gradient of density multiplied by the i-slope 172 zsign = SIGN( 0.5, - zgdrho * ( zdep(ji+1,jj) - zdep(ji,jj) ) ) 173 zsigna= SIGN( 0.5, zunb(ji,jj) * ( zdep(ji+1,jj) - zdep(ji,jj) ) ) 174 zalphax(ji,jj)=( 0.5 + zsigna ) * ( 0.5 - zsign ) * umask(ji,jj,1) 175 ! 176 ! local density gradient along j-bathymetric slope 177 zgdrho = ( ztnb(ji,jj+1) - ztnb(ji,jj) ) 178 ! sign of local j-gradient of density multiplied by the j-slope 179 zsign = SIGN( 0.5, -zgdrho * ( zdep(ji,jj+1) - zdep(ji,jj) ) ) 180 zsigna= SIGN( 0.5, zvnb(ji,jj) * ( zdep(ji,jj+1) - zdep(ji,jj) ) ) 181 zalphay(ji,jj)=( 0.5 + zsigna ) * ( 0.5 - zsign ) * vmask(ji,jj,1) 182 END DO 183 END DO 184 ! 191 185 CASE ( 2 ) ! Linear formulation function of temperature and salinity 192 ! 193 DO jj = 1, jpjm1 194 DO ji = 1, fs_jpim1 ! vector opt. 195 ! local density gradient along i-bathymetric slope 196 zgdrho = - ( rbeta*( zsnb(ji+1,jj) - zsnb(ji,jj) ) & 197 & - ralpha*( ztnb(ji+1,jj) - ztnb(ji,jj) ) ) 198 ! sign of local i-gradient of density multiplied by the i-slope 199 zsign = SIGN( 0.5, - zgdrho * ( zdep(ji+1,jj) - zdep(ji,jj) ) ) 200 zsigna= SIGN( 0.5, zunb(ji,jj) * ( zdep(ji+1,jj) - zdep(ji,jj) ) ) 201 zalphax(ji,jj) = ( 0.5 + zsigna ) * ( 0.5 - zsign ) * umask(ji,jj,1) 202 203 ! local density gradient along j-bathymetric slope 204 zgdrho = - ( rbeta*( zsnb(ji,jj+1) - zsnb(ji,jj) ) & 205 - ralpha*( ztnb(ji,jj+1) - ztnb(ji,jj) ) ) 206 ! sign of local j-gradient of density multiplied by the j-slope 207 zsign = SIGN( 0.5, - zgdrho * ( zdep(ji,jj+1) - zdep(ji,jj) ) ) 208 zsigna= SIGN( 0.5, zvnb(ji,jj) * ( zdep(ji,jj+1) - zdep(ji,jj) ) ) 209 zalphay(ji,jj) = ( 0.5 + zsigna ) * ( 0.5 - zsign ) * vmask(ji,jj,1) 210 END DO 211 END DO 212 ! 213 CASE DEFAULT 214 WRITE(ctmp1,*) ' bad flag value for neos = ', neos 215 CALL ctl_stop( ctmp1 ) 186 ! 187 DO jj = 1, jpjm1 188 DO ji = 1, fs_jpim1 ! vector opt. 189 ! local density gradient along i-bathymetric slope 190 zgdrho = - ( rn_beta *( zsnb(ji+1,jj) - zsnb(ji,jj) ) & 191 & - rn_alpha*( ztnb(ji+1,jj) - ztnb(ji,jj) ) ) 192 ! sign of local i-gradient of density multiplied by the i-slope 193 zsign = SIGN( 0.5, - zgdrho * ( zdep(ji+1,jj) - zdep(ji,jj) ) ) 194 zsigna= SIGN( 0.5, zunb(ji,jj) * ( zdep(ji+1,jj) - zdep(ji,jj) ) ) 195 zalphax(ji,jj) = ( 0.5 + zsigna ) * ( 0.5 - zsign ) * umask(ji,jj,1) 196 ! 197 ! local density gradient along j-bathymetric slope 198 zgdrho = - ( rn_beta *( zsnb(ji,jj+1) - zsnb(ji,jj) ) & 199 & - rn_alpha*( ztnb(ji,jj+1) - ztnb(ji,jj) ) ) 200 ! sign of local j-gradient of density multiplied by the j-slope 201 zsign = SIGN( 0.5, - zgdrho * ( zdep(ji,jj+1) - zdep(ji,jj) ) ) 202 zsigna= SIGN( 0.5, zvnb(ji,jj) * ( zdep(ji,jj+1) - zdep(ji,jj) ) ) 203 zalphay(ji,jj) = ( 0.5 + zsigna ) * ( 0.5 - zsign ) * vmask(ji,jj,1) 204 END DO 205 END DO 216 206 ! 217 207 END SELECT … … 231 221 232 222 # if defined key_vectopt_loop 233 jj =1234 DO ji = 1, jpij-jpi ! vector opt. (forced unrolling)223 DO jj = 1, 1 224 DO ji = 1, jpij-jpi ! vector opt. (forced unrolling) 235 225 # else 236 226 DO jj = 1, jpjm1 … … 250 240 v_bbl(ji,jj,ikv) = zalphay(ji,jj) * vn(ji,jj,ikv) * ze3v / fse3v(ji,jj,ikv) 251 241 ENDIF 252 # if ! defined key_vectopt_loop 253 END DO 254 # endif 242 END DO 255 243 END DO 256 244 … … 261 249 262 250 #if defined key_vectopt_loop 263 jj =1264 DO ji = 1, jpij ! vector opt. (forced unrolling)251 DO jj = 1, 1 252 DO ji = 1, jpij ! vector opt. (forced unrolling) 265 253 #else 266 254 DO jj = 1, jpj … … 273 261 v_bbl(ji,jj,ikv) = zalphay(ji,jj) * vn(ji,jj,ikv) 274 262 ENDIF 275 #if ! defined key_vectopt_loop 276 END DO 277 #endif 263 END DO 278 264 END DO 279 265 280 266 ENDIF 281 267 282 268 283 269 ! 5. Along sigma advective trend … … 286 272 287 273 # if defined key_vectopt_loop 288 jj =1289 DO ji = 1, jpij-jpi ! vector opt. (forced unrolling)274 DO jj = 1, 1 275 DO ji = 1, jpij-jpi ! vector opt. (forced unrolling) 290 276 # else 291 277 DO jj = 1, jpjm1 … … 310 296 zwz(ji,jj) = ( ( zfvj + ABS( zfvj ) ) * zsbb(ji ,jj ) & 311 297 & +( zfvj - ABS( zfvj ) ) * zsbb(ji ,jj+1) ) * 0.5 312 #if ! defined key_vectopt_loop 313 END DO 314 #endif 315 END DO 316 # if defined key_vectopt_loop 317 jj = 1 318 DO ji = jpi+2, jpij-jpi-1 ! vector opt. (forced unrolling) 298 END DO 299 END DO 300 # if defined key_vectopt_loop 301 DO jj = 1, 1 302 DO ji = jpi+2, jpij-jpi-1 ! vector opt. (forced unrolling) 319 303 # else 320 304 DO jj = 2, jpjm1 … … 332 316 ta(ji,jj,ik) = ta(ji,jj,ik) + zta 333 317 sa(ji,jj,ik) = sa(ji,jj,ik) + zsa 334 #if ! defined key_vectopt_loop 335 END DO 336 #endif 318 END DO 337 319 END DO 338 320 … … 365 347 366 348 IF( ln_zps ) THEN 367 368 # if defined key_vectopt_loop 369 jj =1370 DO ji = 1, jpij-jpi ! vector opt. (forced unrolling)349 350 # if defined key_vectopt_loop 351 DO jj = 1, 1 352 DO ji = 1, jpij-jpi ! vector opt. (forced unrolling) 371 353 # else 372 354 DO jj = 1, jpjm1 … … 381 363 ze3u = MIN( fse3u(ji,jj,iku1), fse3u(ji,jj,iku2) ) 382 364 ze3v = MIN( fse3v(ji,jj,ikv1), fse3v(ji,jj,ikv2) ) 383 365 384 366 zwu(ji,jj) = zalphax(ji,jj) * e2u(ji,jj) * ze3u 385 367 zwv(ji,jj) = zalphay(ji,jj) * e1v(ji,jj) * ze3v 386 #if ! defined key_vectopt_loop 387 END DO 388 #endif 368 END DO 389 369 END DO 390 370 ! 391 371 ELSE 392 393 # if defined key_vectopt_loop 394 jj =1395 DO ji = 1, jpij-jpi ! vector opt. (forced unrolling)372 ! 373 # if defined key_vectopt_loop 374 DO jj = 1, 1 375 DO ji = 1, jpij-jpi ! vector opt. (forced unrolling) 396 376 # else 397 377 DO jj = 1, jpjm1 … … 402 382 zwu(ji,jj) = zalphax(ji,jj) * e2u(ji,jj) * fse3u(ji,jj,iku) 403 383 zwv(ji,jj) = zalphay(ji,jj) * e1v(ji,jj) * fse3v(ji,jj,ikv) 404 #if ! defined key_vectopt_loop 405 END DO 406 #endif 407 END DO 408 384 END DO 385 END DO 386 ! 409 387 ENDIF 410 388 411 389 412 390 # if defined key_vectopt_loop 413 jj =1414 DO ji = jpi+2, jpij-jpi-1 ! vector opt. (forced unrolling)391 DO jj = 1, 1 392 DO ji = jpi+2, jpij-jpi-1 ! vector opt. (forced unrolling) 415 393 # else 416 394 DO jj = 2, jpjm1 … … 426 404 & ) / zbt 427 405 428 # if ! defined key_vectopt_loop 429 END DO 430 # endif 431 END DO 406 END DO 407 END DO 432 408 433 409 ! 7. compute additional vertical velocity to be used in t boxes … … 442 418 END DO 443 419 END DO 444 445 ! Boundary condition on w_bbl (unchanged sign) 446 CALL lbc_lnk( w_bbl, 'W', 1. ) 420 CALL lbc_lnk( w_bbl, 'W', 1. ) ! Boundary condition on w_bbl (unchanged sign) 447 421 448 422 CALL iom_put( "uoce_bbl", u_bbl ) ! bbl i-current -
trunk/NEMO/OPA_SRC/TRA/tradmp.F90
r1438 r1601 4 4 !! Ocean physics: internal restoring trend on active tracers (T and S) 5 5 !!====================================================================== 6 !! History : 5.0 ! 91-03 (O. Marti, G. Madec) Original code 7 !! ! 92-06 (M. Imbard) doctor norme 8 !! ! 96-01 (G. Madec) statement function for e3 9 !! ! 97-05 (G. Madec) macro-tasked on jk-slab 10 !! ! 98-07 (M. Imbard, G. Madec) ORCA version 11 !! 7.0 ! 01-02 (M. Imbard) cofdis, Original code 12 !! 8.1 ! 01-02 (G. Madec, E. Durand) cleaning 13 !! 8.5 ! 02-08 (G. Madec, E. Durand) free form + modules 6 !! History : OPA ! 1991-03 (O. Marti, G. Madec) Original code 7 !! ! 1992-06 (M. Imbard) doctor norme 8 !! ! 1996-01 (G. Madec) statement function for e3 9 !! ! 1997-05 (G. Madec) macro-tasked on jk-slab 10 !! ! 1998-07 (M. Imbard, G. Madec) ORCA version 11 !! 7.0 ! 2001-02 (M. Imbard) cofdis, Original code 12 !! 8.1 ! 2001-02 (G. Madec, E. Durand) cleaning 13 !! NEMO 1.0 ! 2002-08 (G. Madec, E. Durand) free form + modules 14 !! 3.2 ! 2009-08 (G. Madec, C. Talandier) DOCTOR norm for namelist parameter 14 15 !!---------------------------------------------------------------------- 15 16 #if defined key_tradmp || defined key_esopa 16 17 !!---------------------------------------------------------------------- 17 18 !! key_tradmp internal damping 18 !!----------------------------------------------------------------------19 19 !!---------------------------------------------------------------------- 20 20 !! tra_dmp : update the tracer trend with the internal damping … … 29 29 USE trdmod_oce ! ocean variables trends 30 30 USE zdf_oce ! ocean vertical physics 31 USE in_out_manager ! I/O manager32 31 USE phycst ! Define parameters for the routines 33 32 USE dtatem ! temperature data 34 33 USE dtasal ! salinity data 35 34 USE zdfmxl ! mixed layer depth 35 USE in_out_manager ! I/O manager 36 36 USE lib_mpp ! distribued memory computing 37 37 USE prtctl ! Print control … … 40 40 PRIVATE 41 41 42 PUBLIC tra_dmp! routine called by step.F9042 PUBLIC tra_dmp ! routine called by step.F90 43 43 44 44 #if ! defined key_agrif … … 49 49 REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) :: resto !: restoring coeff. on T and S (s-1) 50 50 51 ! !* newtonian damping namelist (mandmp)52 INTEGER :: n dmp = -1! = 0/-1/'latitude' for damping over T and S53 INTEGER :: n dmpf = 2 ! = 1 create a damping.coeff NetCDF file54 INTEGER :: nmldmp = 0 ! = 0/1/2 flag for damping in the mixed layer55 REAL(wp) :: sdmp = 50. ! surface time scale for internal damping (days)56 REAL(wp) :: bdmp = 360. ! bottom time scale for internal damping (days)57 REAL(wp) :: hdmp = 800. ! depth of transition between sdmp and bdmp (meters)51 ! !!* Namelist namtra_dmp : T & S newtonian damping * 52 INTEGER :: nn_hdmp = -1 ! = 0/-1/'latitude' for damping over T and S 53 INTEGER :: nn_zdmp = 0 ! = 0/1/2 flag for damping in the mixed layer 54 REAL(wp) :: rn_surf = 50. ! surface time scale for internal damping [days] 55 REAL(wp) :: rn_bot = 360. ! bottom time scale for internal damping [days] 56 REAL(wp) :: rn_dep = 800. ! depth of transition between rn_surf and rn_bot [meters] 57 INTEGER :: nn_file = 2 ! = 1 create a damping.coeff NetCDF file 58 58 59 59 !! * Substitutions … … 61 61 # include "vectopt_loop_substitute.h90" 62 62 !!---------------------------------------------------------------------- 63 !! OPA 9.0 , LOCEAN-IPSL (2006)63 !! NEMO/OPA 3.2 , LOCEAN-IPSL (2009) 64 64 !! $Id$ 65 65 !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) … … 84 84 !! below the well mixed layer (nlmdmp=2) 85 85 !! 86 !! ** Action : - update the tracer trends (ta,sa) with the newtonian 87 !! damping trends. 88 !! - save the trends in (ttrd,strd) ('key_trdtra') 86 !! ** Action : - (ta,sa) tracer trends updated with the damping trend 89 87 !!---------------------------------------------------------------------- 90 88 USE oce, ONLY : ztrdt => ua ! use ua as 3D workspace 91 89 USE oce, ONLY : ztrds => va ! use va as 3D workspace 92 90 !! 93 INTEGER, INTENT( in ) :: kt ! ocean time-step index 94 !! 95 INTEGER :: ji, jj, jk ! dummy loop indices 96 REAL(wp) :: ztest, zta, zsa ! temporary scalars 91 INTEGER, INTENT(in) :: kt ! ocean time-step index 92 !! 93 INTEGER :: ji, jj, jk ! dummy loop indices 97 94 !!---------------------------------------------------------------------- 98 95 … … 104 101 ENDIF 105 102 106 ! 1. Newtonian damping trends on tracer fields 107 ! -------------------------------------------- 108 ! compute the newtonian damping trends depending on nmldmp 109 110 SELECT CASE ( nmldmp ) 103 SELECT CASE ( nn_zdmp ) 111 104 ! 112 CASE( 0 ) ! newtonian damping throughout the water column105 CASE( 0 ) !== newtonian damping throughout the water column ==! 113 106 DO jk = 1, jpkm1 114 107 DO jj = 2, jpjm1 115 108 DO ji = fs_2, fs_jpim1 ! vector opt. 116 zta = resto(ji,jj,jk) * ( t_dta(ji,jj,jk) - tb(ji,jj,jk) ) 117 zsa = resto(ji,jj,jk) * ( s_dta(ji,jj,jk) - sb(ji,jj,jk) ) 118 ! add the trends to the general tracer trends 119 ta(ji,jj,jk) = ta(ji,jj,jk) + zta 120 sa(ji,jj,jk) = sa(ji,jj,jk) + zsa 121 ! save the salinity trend (used in flx to close the salt budget) 109 ta(ji,jj,jk) = ta(ji,jj,jk) + resto(ji,jj,jk) * ( t_dta(ji,jj,jk) - tb(ji,jj,jk) ) 110 sa(ji,jj,jk) = sa(ji,jj,jk) + resto(ji,jj,jk) * ( s_dta(ji,jj,jk) - sb(ji,jj,jk) ) 122 111 END DO 123 112 END DO 124 113 END DO 125 114 ! 126 CASE ( 1 ) ! no damping in the turbocline (avt > 5 cm2/s)115 CASE ( 1 ) !== no damping in the turbocline (avt > 5 cm2/s) ==! 127 116 DO jk = 1, jpkm1 128 117 DO jj = 2, jpjm1 129 118 DO ji = fs_2, fs_jpim1 ! vector opt. 130 ztest = avt(ji,jj,jk) - 5.e-4 131 IF( ztest < 0. ) THEN 132 zta = resto(ji,jj,jk) * ( t_dta(ji,jj,jk) - tb(ji,jj,jk) ) 133 zsa = resto(ji,jj,jk) * ( s_dta(ji,jj,jk) - sb(ji,jj,jk) ) 134 ELSE 135 zta = 0.e0 136 zsa = 0.e0 119 IF( avt(ji,jj,jk) <= 5.e-4 ) THEN 120 ta(ji,jj,jk) = ta(ji,jj,jk) + resto(ji,jj,jk) * ( t_dta(ji,jj,jk) - tb(ji,jj,jk) ) 121 sa(ji,jj,jk) = sa(ji,jj,jk) + resto(ji,jj,jk) * ( s_dta(ji,jj,jk) - sb(ji,jj,jk) ) 137 122 ENDIF 138 ! add the trends to the general tracer trends139 ta(ji,jj,jk) = ta(ji,jj,jk) + zta140 sa(ji,jj,jk) = sa(ji,jj,jk) + zsa141 ! save the salinity trend (used in flx to close the salt budget)142 123 END DO 143 124 END DO 144 125 END DO 145 126 ! 146 CASE ( 2 ) ! no damping in the mixed layer127 CASE ( 2 ) !== no damping in the mixed layer ==! 147 128 DO jk = 1, jpkm1 148 129 DO jj = 2, jpjm1 149 130 DO ji = fs_2, fs_jpim1 ! vector opt. 150 131 IF( fsdept(ji,jj,jk) >= hmlp (ji,jj) ) THEN 151 zta = resto(ji,jj,jk) * ( t_dta(ji,jj,jk) - tb(ji,jj,jk) ) 152 zsa = resto(ji,jj,jk) * ( s_dta(ji,jj,jk) - sb(ji,jj,jk) ) 153 ELSE 154 zta = 0.e0 155 zsa = 0.e0 132 ta(ji,jj,jk) = ta(ji,jj,jk) + resto(ji,jj,jk) * ( t_dta(ji,jj,jk) - tb(ji,jj,jk) ) 133 sa(ji,jj,jk) = sa(ji,jj,jk) + resto(ji,jj,jk) * ( s_dta(ji,jj,jk) - sb(ji,jj,jk) ) 156 134 ENDIF 157 ! add the trends to the general tracer trends158 ta(ji,jj,jk) = ta(ji,jj,jk) + zta159 sa(ji,jj,jk) = sa(ji,jj,jk) + zsa160 ! save the salinity trend (used in flx to close the salt budget)161 135 END DO 162 136 END DO … … 165 139 END SELECT 166 140 167 IF( l_trdtra ) THEN ! save the damping tracer trends fordiagnostic141 IF( l_trdtra ) THEN ! trend diagnostic 168 142 ztrdt(:,:,:) = ta(:,:,:) - ztrdt(:,:,:) 169 143 ztrds(:,:,:) = sa(:,:,:) - ztrds(:,:,:) 170 CALL trd_mod( ztrdt, ztrds, jptra_trd_dmp, 'TRA', kt)144 CALL trd_mod( ztrdt, ztrds, jptra_trd_dmp, 'TRA', kt ) 171 145 ENDIF 172 ! 146 ! ! Control print 173 147 IF(ln_ctl) CALL prt_ctl( tab3d_1=ta, clinfo1=' dmp - Ta: ', mask1=tmask, & 174 148 & tab3d_2=sa, clinfo2= ' Sa: ', mask2=tmask, clinfo3='tra' ) … … 184 158 !! 185 159 !! ** Method : read the nammbf namelist and check the parameters 186 !! called by tra_dmp at the first timestep (nit000) 187 !!---------------------------------------------------------------------- 188 NAMELIST/namtdp/ ndmp, ndmpf, nmldmp, sdmp, bdmp, hdmp 189 !!---------------------------------------------------------------------- 190 191 REWIND ( numnam ) ! Read Namelist namtdp : temperature and salinity damping term 192 READ ( numnam, namtdp ) 193 IF( lzoom ) nmldmp = 0 ! restoring to climatology at closed north or south boundaries 160 !!---------------------------------------------------------------------- 161 NAMELIST/namtra_dmp/ nn_hdmp, nn_zdmp, rn_surf, rn_bot, rn_dep, nn_file 162 !!---------------------------------------------------------------------- 163 164 REWIND ( numnam ) ! Read Namelist namtra_dmp : temperature and salinity damping term 165 READ ( numnam, namtra_dmp ) 166 IF( lzoom ) nn_zdmp = 0 ! restoring to climatology at closed north or south boundaries 194 167 195 168 IF(lwp) THEN ! Namelist print … … 197 170 WRITE(numout,*) 'tra_dmp : T and S newtonian damping' 198 171 WRITE(numout,*) '~~~~~~~' 199 WRITE(numout,*) ' Namelist namtdp : set damping parameter'200 WRITE(numout,*) ' T and S damping option ndmp = ', ndmp201 WRITE(numout,*) ' create a damping.coeff file ndmpf = ', ndmpf202 WRITE(numout,*) ' mixed layer damping option nmldmp = ', nmldmp, '(zoom: forced to 0)'203 WRITE(numout,*) ' surface time scale (days) sdmp = ', sdmp204 WRITE(numout,*) ' bottom time scale (days) bdmp = ', bdmp205 WRITE(numout,*) ' depth of transition (meters) hdmp = ', hdmp172 WRITE(numout,*) ' Namelist namtra_dmp : set damping parameter' 173 WRITE(numout,*) ' T and S damping option nn_hdmp = ', nn_hdmp 174 WRITE(numout,*) ' mixed layer damping option nn_zdmp = ', nn_zdmp, '(zoom: forced to 0)' 175 WRITE(numout,*) ' surface time scale (days) rn_surf = ', rn_surf 176 WRITE(numout,*) ' bottom time scale (days) rn_bot = ', rn_bot 177 WRITE(numout,*) ' depth of transition (meters) rn_dep = ', rn_dep 178 WRITE(numout,*) ' create a damping.coeff file nn_file = ', nn_file 206 179 ENDIF 207 180 208 SELECT CASE ( n dmp )209 CASE ( -1 ) ; IF(lwp) WRITE(numout,*) ' 210 CASE ( 1:90 ) ; IF(lwp) WRITE(numout,*) ' tracer damping poleward of', ndmp, ' degrees'181 SELECT CASE ( nn_hdmp ) 182 CASE ( -1 ) ; IF(lwp) WRITE(numout,*) ' tracer damping in the Med & Red seas only' 183 CASE ( 1:90 ) ; IF(lwp) WRITE(numout,*) ' tracer damping poleward of', nn_hdmp, ' degrees' 211 184 CASE DEFAULT 212 WRITE(ctmp1,*) ' bad flag value for n dmp = ', ndmp185 WRITE(ctmp1,*) ' bad flag value for nn_hdmp = ', nn_hdmp 213 186 CALL ctl_stop(ctmp1) 214 187 END SELECT 215 188 216 SELECT CASE ( n mldmp )217 CASE ( 0 ) ; IF(lwp) WRITE(numout,*) ' 218 CASE ( 1 ) ; IF(lwp) WRITE(numout,*) ' 219 CASE ( 2 ) ; IF(lwp) WRITE(numout,*) ' 189 SELECT CASE ( nn_zdmp ) 190 CASE ( 0 ) ; IF(lwp) WRITE(numout,*) ' tracer damping throughout the water column' 191 CASE ( 1 ) ; IF(lwp) WRITE(numout,*) ' no tracer damping in the turbocline (avt > 5 cm2/s)' 192 CASE ( 2 ) ; IF(lwp) WRITE(numout,*) ' no tracer damping in the mixed layer' 220 193 CASE DEFAULT 221 WRITE(ctmp1,*) ' bad flag value for nmldmp = ', nmldmp194 WRITE(ctmp1,*) 'bad flag value for nn_zdmp = ', nn_zdmp 222 195 CALL ctl_stop(ctmp1) 223 196 END SELECT … … 241 214 !! 242 215 !! ** Method : - set along closed boundary due to zoom a damping over 243 !! 6 points with a max time scale of 5 days.216 !! 6 points with a max time scale of 5 days. 244 217 !! - ORCA arctic/antarctic zoom: set the damping along 245 !! south/north boundary over a latitude strip.218 !! south/north boundary over a latitude strip. 246 219 !! 247 220 !! ** Action : - resto, the damping coeff. for T and S … … 270 243 END DO 271 244 272 273 IF( lzoom_arct .AND. lzoom_anta ) THEN 274 ! 275 ! ==================================================== 276 ! ORCA configuration : arctic zoom or antarctic zoom 277 ! ==================================================== 278 245 ! ! ==================================================== 246 IF( lzoom_arct .AND. lzoom_anta ) THEN ! ORCA configuration : arctic zoom or antarctic zoom 247 ! ! ==================================================== 279 248 IF(lwp) WRITE(numout,*) 280 249 IF(lwp .AND. lzoom_arct ) WRITE(numout,*) ' dtacof_zoom : ORCA Arctic zoom' 281 250 IF(lwp .AND. lzoom_arct ) WRITE(numout,*) ' dtacof_zoom : ORCA Antarctic zoom' 282 251 IF(lwp) WRITE(numout,*) 283 284 ! ... Initialization : 285 ! zlat0 : latitude strip where resto decreases 286 ! zlat1 : resto = 1 before zlat1 287 ! zlat2 : resto decreases from 1 to 0 between zlat1 and zlat2 252 ! 253 ! ! Initialization : 288 254 resto(:,:,:) = 0.e0 289 zlat0 = 10. 290 zlat1 = 30. 291 zlat2 = zlat1 + zlat0 292 293 ! ... Compute arrays resto ; value for internal damping : 5 days 294 DO jk = 2, jpkm1 255 zlat0 = 10. ! zlat0 : latitude strip where resto decreases 256 zlat1 = 30. ! zlat1 : resto = 1 before zlat1 257 zlat2 = zlat1 + zlat0 ! zlat2 : resto decreases from 1 to 0 between zlat1 and zlat2 258 259 DO jk = 2, jpkm1 ! Compute arrays resto ; value for internal damping : 5 days 295 260 DO jj = 1, jpj 296 261 DO ji = 1, jpi 297 262 zlat = ABS( gphit(ji,jj) ) 298 IF ( zlat1 <= zlat .AND. zlat <= zlat2 ) THEN 299 resto(ji,jj,jk) = 0.5 * ( 1./(5.*rday) ) * & 300 ( 1. - cos(rpi*(zlat2-zlat)/zlat0) ) 301 ELSE IF ( zlat < zlat1 ) THEN 263 IF( zlat1 <= zlat .AND. zlat <= zlat2 ) THEN 264 resto(ji,jj,jk) = 0.5 * ( 1./(5.*rday) ) * ( 1. - cos(rpi*(zlat2-zlat)/zlat0) ) 265 ELSEIF( zlat < zlat1 ) THEN 302 266 resto(ji,jj,jk) = 1./(5.*rday) 303 267 ENDIF … … 307 271 ! 308 272 ENDIF 309 310 ! ... Mask resto array 273 ! ! Mask resto array 311 274 resto(:,:,:) = resto(:,:,:) * tmask(:,:,:) 312 275 ! … … 321 284 !! 322 285 !! ** Method : Arrays defining the damping are computed for each grid 323 !! point for temperature and salinity (resto)324 !! Damping depends on distance to coast, depth and latitude286 !! point for temperature and salinity (resto) 287 !! Damping depends on distance to coast, depth and latitude 325 288 !! 326 289 !! ** Action : - resto, the damping coeff. for T and S … … 330 293 !! 331 294 INTEGER :: ji, jj, jk ! dummy loop indices 332 INTEGER :: ii0, ii1, ij0, ij1 ! " "295 INTEGER :: ii0, ii1, ij0, ij1 ! - - 333 296 INTEGER :: inum0 ! logical unit for file restoring damping term 334 297 INTEGER :: icot ! logical unit for file distance to the coast 335 298 REAL(wp) :: zinfl, zlon ! temporary scalars 336 REAL(wp) :: zlat, zlat0, zlat1, zlat2 ! " "337 REAL(wp) :: zsdmp, zbdmp ! " "299 REAL(wp) :: zlat, zlat0, zlat1, zlat2 ! - - 300 REAL(wp) :: zsdmp, zbdmp ! - - 338 301 REAL(wp), DIMENSION(jpk) :: zhfac 339 302 REAL(wp), DIMENSION(jpi,jpj) :: zmrs … … 350 313 351 314 ! ... Initialization : 352 ! zdct() : distant to the coastline353 ! resto() : array of restoring coeff. on T and S354 355 315 resto(:,:,:) = 0.e0 356 316 357 IF ( ndmp > 0 ) THEN 358 359 ! ------------------------------------ 360 ! Damping poleward of 'ndmp' degrees 361 ! ------------------------------------ 362 317 ! !-----------------------------------------! 318 IF( nn_hdmp > 0 ) THEN ! Damping poleward of 'nn_hdmp' degrees ! 319 ! !-----------------------------------------! 363 320 IF(lwp) WRITE(numout,*) 364 IF(lwp) WRITE(numout,*) ' Damping poleward of ', ndmp,' deg.' 365 IF(lwp) WRITE(numout,*) 366 367 ! ... Distance to coast (zdct) 368 369 IF(lwp) WRITE(numout,*) 370 IF(lwp) WRITE(numout,*) ' dtacof : distance to coast file' 321 IF(lwp) WRITE(numout,*) ' Damping poleward of ', nn_hdmp,' deg.' 322 ! 371 323 CALL iom_open ( 'dist.coast.nc', icot, ldstop = .FALSE. ) 372 IF( icot > 0 ) THEN373 CALL iom_get ( icot, jpdom_data, 'Tcoast', zdct )374 CALL iom_ close (icot)375 ELSE376 ! ... Compute and save the distance-to-coast array(output in zdct)324 ! 325 IF( icot > 0 ) THEN ! distance-to-coast read in file 326 CALL iom_get ( icot, jpdom_data, 'Tcoast', zdct ) 327 CALL iom_close( icot ) 328 ELSE ! distance-to-coast computed and saved in file (output in zdct) 377 329 CALL cofdis( zdct ) 378 330 ENDIF 379 331 380 ! ... Compute arrays resto 381 ! zinfl : distance of influence for damping term 382 ! zlat0 : latitude strip where resto decreases 383 ! zlat1 : resto = 0 between -zlat1 and zlat1 384 ! zlat2 : resto increases from 0 to 1 between |zlat1| and |zlat2| 385 ! and resto = 1 between |zlat2| and 90 deg. 386 zinfl = 1000.e3 387 zlat0 = 10 388 zlat1 = ndmp 389 zlat2 = zlat1 + zlat0 332 ! ! Compute arrays resto 333 zinfl = 1000.e3 ! distance of influence for damping term 334 zlat0 = 10. ! latitude strip where resto decreases 335 zlat1 = REAL( nn_hdmp ) ! resto = 0 between -zlat1 and zlat1 336 zlat2 = zlat1 + zlat0 ! resto increases from 0 to 1 between |zlat1| and |zlat2| 390 337 391 338 DO jj = 1, jpj … … 400 347 END DO 401 348 402 ! ... North Indian ocean (20N/30N x 45E/100E) : resto=0 403 IF ( ndmp == 20 ) THEN 349 IF ( nn_hdmp == 20 ) THEN ! North Indian ocean (20N/30N x 45E/100E) : resto=0 404 350 DO jj = 1, jpj 405 351 DO ji = 1, jpi 406 352 zlat = gphit(ji,jj) 407 353 zlon = MOD( glamt(ji,jj), 360. ) 408 IF ( zlat1 < zlat .AND. zlat < zlat2 .AND. & 409 45. < zlon .AND. zlon < 100. ) THEN 410 resto(ji,jj,1) = 0. 354 IF ( zlat1 < zlat .AND. zlat < zlat2 .AND. 45. < zlon .AND. zlon < 100. ) THEN 355 resto(ji,jj,1) = 0.e0 411 356 ENDIF 412 357 END DO … … 414 359 ENDIF 415 360 416 zsdmp = 1./( sdmp* rday)417 zbdmp = 1./( bdmp* rday)361 zsdmp = 1./(rn_surf * rday) 362 zbdmp = 1./(rn_bot * rday) 418 363 DO jk = 2, jpkm1 419 364 DO jj = 1, jpj … … 423 368 resto(ji,jj,jk) = resto(ji,jj,1) * 0.5 * ( 1. - COS( rpi*zdct(ji,jj,jk)/zinfl) ) 424 369 ! ... Vertical variation from zsdmp (sea surface) to zbdmp (bottom) 425 resto(ji,jj,jk) = resto(ji,jj,jk) * ( zbdmp + (zsdmp-zbdmp)*EXP(-fsdept(ji,jj,jk)/ hdmp) )370 resto(ji,jj,jk) = resto(ji,jj,jk) * ( zbdmp + (zsdmp-zbdmp)*EXP(-fsdept(ji,jj,jk)/rn_dep) ) 426 371 END DO 427 372 END DO … … 431 376 432 377 433 IF( cp_cfg == "orca" .AND. ( n dmp > 0 .OR. ndmp == -1 ) ) THEN378 IF( cp_cfg == "orca" .AND. ( nn_hdmp > 0 .OR. nn_hdmp == -1 ) ) THEN 434 379 435 380 ! ! ========================= … … 520 465 zmrs( ji , mj0(ij0):mj1(ij1) ) = 0.1 * ABS( FLOAT(ji - mi1(ii1)) ) 521 466 END DO 522 zsdmp = 1./( sdmp* rday)523 zbdmp = 1./( bdmp* rday)467 zsdmp = 1./(rn_surf * rday) 468 zbdmp = 1./(rn_bot * rday) 524 469 DO jk = 1, jpk 525 zhfac (jk) = ( zbdmp + (zsdmp-zbdmp) * EXP(-fsdept(1,1,jk)/ hdmp) )470 zhfac (jk) = ( zbdmp + (zsdmp-zbdmp) * EXP(-fsdept(1,1,jk)/rn_dep) ) 526 471 END DO 527 472 ! ! ======================== … … 540 485 resto(:,:, 1 ) = 0.e0 541 486 resto(:,:,jpk) = 0.e0 542 543 ELSE 544 ! ------------ 545 ! No damping 546 ! ------------ 547 CALL ctl_stop( 'Choose a correct value of ndmp or DO NOT defined key_tradmp' ) 487 ! !--------------------! 488 ELSE ! No damping ! 489 ! !--------------------! 490 CALL ctl_stop( 'Choose a correct value of nn_hdmp or DO NOT defined key_tradmp' ) 548 491 ENDIF 549 492 550 ! ---------------------------- 551 ! Create Print damping array 552 ! ---------------------------- 553 554 ! ndmpf : = 1 create a damping.coeff NetCDF file 555 556 IF( ndmpf == 1 ) THEN 493 ! !--------------------------------! 494 IF( nn_file == 1 ) THEN ! save damping coef. in a file ! 495 ! !--------------------------------! 557 496 IF(lwp) WRITE(numout,*) ' create damping.coeff.nc file' 558 497 CALL iom_open ( 'damping.coeff', inum0, ldwrt = .TRUE., kiolib = jprstlib ) -
trunk/NEMO/OPA_SRC/TRA/traldf.F90
r1152 r1601 113 113 !! ** Purpose : Choice of the operator for the lateral tracer diffusion 114 114 !! 115 !! ** Method : set nldf from the nam _traldf logicals115 !! ** Method : set nldf from the namtra_ldf logicals 116 116 !! nldf == -1 ESOPA test: ALL operators are used 117 117 !! nldf == 0 laplacian operator … … 122 122 INTEGER :: ioptio, ierr ! temporary integers 123 123 ! 124 ! NAMELIST/nam _traldf/ ln_traldf_lap , ln_traldf_bilap,&125 ! & ln_traldf_level, ln_traldf_hor , ln_traldf_iso, &126 ! & aht0, ahtb0, aeiv0124 ! NAMELIST/namtra_ldf/ ln_traldf_lap , ln_traldf_bilap, & 125 ! & ln_traldf_level, ln_traldf_hor , ln_traldf_iso, & 126 ! & rn_aht_0 , rn_ahtb_0 , rn_aeiv_0 127 127 !!---------------------------------------------------------------------- 128 128 … … 130 130 ! =============================================== 131 131 132 ! Namelist nam_traldf already read in ldftra module 133 ! ! Read Namelist nam_traldf : Lateral physics on tracers 134 ! REWIND( numnam ) 135 ! READ ( numnam, nam_traldf ) 132 ! REWIND( numnam ) ! Namelist namtra_ldf already read in ldftra module 133 ! READ ( numnam, namtra_ldf ) 136 134 137 135 IF(lwp) THEN ! Namelist print … … 139 137 WRITE(numout,*) 'tra:ldf_ctl : lateral tracer diffusive operator' 140 138 WRITE(numout,*) '~~~~~~~~~~~' 141 WRITE(numout,*) ' Namelist nam_traldf : set lateral mixing parameters (type, direction, coefficients)'142 WRITE(numout,*) ' 143 WRITE(numout,*) ' 144 WRITE(numout,*) ' 145 WRITE(numout,*) ' 146 WRITE(numout,*) ' 139 WRITE(numout,*) ' Namelist namtra_ldf : set lateral mixing parameters (type, direction, coefficients)' 140 WRITE(numout,*) ' laplacian operator ln_traldf_lap = ', ln_traldf_lap 141 WRITE(numout,*) ' bilaplacian operator ln_traldf_bilap = ', ln_traldf_bilap 142 WRITE(numout,*) ' iso-level ln_traldf_level = ', ln_traldf_level 143 WRITE(numout,*) ' horizontal (geopotential) ln_traldf_hor = ', ln_traldf_hor 144 WRITE(numout,*) ' iso-neutral ln_traldf_iso = ', ln_traldf_iso 147 145 ENDIF 148 146 -
trunk/NEMO/OPA_SRC/TRA/tranxt.F90
r1438 r1601 26 26 USE zdf_oce ! ??? 27 27 USE domvvl ! variable volume 28 USE dynspg_oce ! surface pressure gradient variables 28 USE dynspg_oce ! surface pressure gradient variables 29 USE dynhpg ! hydrostatic pressure gradient 29 30 USE trdmod_oce ! ocean variables trends 30 31 USE trdmod ! ocean active tracers trends -
trunk/NEMO/OPA_SRC/TRA/traqsr.F90
r1460 r1601 33 33 PUBLIC tra_qsr ! routine called by step.F90 (ln_traqsr=T) 34 34 35 ! !!* Namelist nam qsr: penetrative solar radiation35 ! !!* Namelist namtra_qsr: penetrative solar radiation 36 36 LOGICAL , PUBLIC :: ln_traqsr = .TRUE. !: light absorption (qsr) flag 37 37 LOGICAL , PUBLIC :: ln_qsr_rgb = .FALSE. !: Red-Green-Blue light absorption flag … … 220 220 !! ** Method : The profile of solar radiation within the ocean is set 221 221 !! from two length scale of penetration (rn_si0,rn_si1) and a ratio 222 !! (rn_abs). These parameters are read in the nam qsr namelist. The222 !! (rn_abs). These parameters are read in the namtra_qsr namelist. The 223 223 !! default values correspond to clear water (type I in Jerlov' 224 224 !! (1968) classification. … … 240 240 CHARACTER(len=100) :: cn_dir ! Root directory for location of ssr files 241 241 TYPE(FLD_N) :: sn_chl ! informations about the chlorofyl field to be read 242 NAMELIST/nam qsr/ sn_chl, cn_dir, ln_traqsr, ln_qsr_rgb, ln_qsr_2bd, ln_qsr_bio, &243 & nn_chldta, rn_abs, rn_si0, rn_si1, rn_si2242 NAMELIST/namtra_qsr/ sn_chl, cn_dir, ln_traqsr, ln_qsr_rgb, ln_qsr_2bd, ln_qsr_bio, & 243 & nn_chldta, rn_abs, rn_si0, rn_si1, rn_si2 244 244 !!---------------------------------------------------------------------- 245 245 … … 250 250 sn_chl = FLD_N( 'chlorophyll' , -1 , 'CHLA' , .true. , .true. , 'yearly' , '' , '' ) 251 251 ! 252 REWIND( numnam ) ! Read Namelist nam qsr : ratio and length of penetration253 READ ( numnam, nam qsr )252 REWIND( numnam ) ! Read Namelist namtra_qsr : ratio and length of penetration 253 READ ( numnam, namtra_qsr ) 254 254 ! 255 255 IF(lwp) THEN ! control print … … 257 257 WRITE(numout,*) 'tra_qsr_init : penetration of the surface solar radiation' 258 258 WRITE(numout,*) '~~~~~~~~~~~~' 259 WRITE(numout,*) ' Namelist namqsr : set the parameter of penetration'260 WRITE(numout,*) ' 261 WRITE(numout,*) ' 262 WRITE(numout,*) ' 263 WRITE(numout,*) ' 264 WRITE(numout,*) ' 265 WRITE(numout,*) ' 266 WRITE(numout,*) ' 267 WRITE(numout,*) ' 268 WRITE(numout,*) ' 259 WRITE(numout,*) ' Namelist namtra_qsr : set the parameter of penetration' 260 WRITE(numout,*) ' Light penetration (T) or not (F) ln_traqsr = ', ln_traqsr 261 WRITE(numout,*) ' RGB (Red-Green-Blue) light penetration ln_qsr_rgb = ', ln_qsr_rgb 262 WRITE(numout,*) ' 2 band light penetration ln_qsr_2bd = ', ln_qsr_2bd 263 WRITE(numout,*) ' bio-model light penetration ln_qsr_bio = ', ln_qsr_bio 264 WRITE(numout,*) ' RGB : Chl data (=1) or cst value (=0) nn_chldta = ', nn_chldta 265 WRITE(numout,*) ' RGB & 2 bands: fraction of light (rn_si1) rn_abs = ', rn_abs 266 WRITE(numout,*) ' RGB & 2 bands: shortess depth of extinction rn_si0 = ', rn_si0 267 WRITE(numout,*) ' 2 bands: longest depth of extinction rn_si1 = ', rn_si1 268 WRITE(numout,*) ' 3 bands: longest depth of extinction rn_si2 = ', rn_si2 269 269 ENDIF 270 270 271 271 IF( ln_traqsr ) THEN ! control consistency 272 272 ! 273 IF( .NOT. lk_qsr_bio ) THEN 273 IF( .NOT.lk_qsr_bio .AND. ln_qsr_bio ) THEN 274 CALL ctl_warn( 'No bio model : force ln_qsr_bio = FALSE ' ) 274 275 ln_qsr_bio = .FALSE. 275 CALL ctl_warn( 'No bio model ; force bio-model light penetration ln_qsr_bio = FALSE ' )276 276 ENDIF 277 277 ! … … 286 286 ln_qsr_2bd = .FALSE. 287 287 ln_qsr_bio = .FALSE. 288 CALL ctl_warn( ' Choose ONE type of light penetration in namelist nam qsr', &288 CALL ctl_warn( ' Choose ONE type of light penetration in namelist namtra_qsr', & 289 289 & ' otherwise, we force the model to run with RGB light penetration' ) 290 290 ENDIF … … 335 335 ! ! fill sf_chl with sn_chl and control print 336 336 CALL fld_fill( sf_chl, (/ sn_chl /), cn_dir, 'tra_qsr_init', & 337 & 'Solar penetration function of read chlorophyll', 'nam qsr' )337 & 'Solar penetration function of read chlorophyll', 'namtra_qsr' ) 338 338 ! 339 339 ELSE !* constant Chl : compute once for all the distribution of light (etot3) -
trunk/NEMO/OPA_SRC/TRD/trdicp.F90
r1152 r1601 60 60 !! 61 61 !! ** Purpose : verify the basin averaged properties of tracers and/or 62 !! momentum equations at every time step frequency n trd.62 !! momentum equations at every time step frequency nn_trd. 63 63 !!---------------------------------------------------------------------- 64 64 REAL(wp), DIMENSION(jpi,jpj), INTENT(inout) :: ptrd2dx ! Temperature or U trend … … 186 186 !! 187 187 !! ** Purpose : verify the basin averaged properties of tracers and/or 188 !! momentum equations at every time step frequency n trd.188 !! momentum equations at every time step frequency nn_trd. 189 189 !!---------------------------------------------------------------------- 190 190 REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(inout) :: ptrd3dx ! Temperature or U trend … … 386 386 ! ------------------- 387 387 388 IF( MOD(kt,n trd) == 0 .OR. kt == nit000 .OR. kt == nitend ) THEN388 IF( MOD(kt,nn_trd) == 0 .OR. kt == nit000 .OR. kt == nitend ) THEN 389 389 390 390 ! I.1 Conversion potential energy - kinetic energy … … 588 588 ! ----------------- 589 589 590 IF( MOD(kt,n trd) == 0 .OR. kt == nit000 .OR. kt == nitend ) THEN590 IF( MOD(kt,nn_trd) == 0 .OR. kt == nit000 .OR. kt == nitend ) THEN 591 591 592 592 ! I.1 Sums over the global domain -
trunk/NEMO/OPA_SRC/TRD/trdicp_oce.F90
r1152 r1601 14 14 PUBLIC 15 15 16 !! * Shared module variables17 16 #if defined key_trdtra && defined key_trddyn || defined key_esopa 18 17 LOGICAL, PARAMETER :: lk_trdtra = .TRUE. !: tracers trend flag … … 29 28 #endif 30 29 31 !! Tracers trends diagnostics parameters 32 !!--------------------------------------------------------------------- 33 INTEGER, PARAMETER :: & !: => tracer trends indexes <= 34 jpicpt_xad = 1, & !: x- horizontal advection 35 jpicpt_yad = 2, & !: y- horizontal advection 36 jpicpt_zad = 3, & !: z- vertical advection 37 jpicpt_ldf = 4, & !: lateral diffusion 38 jpicpt_zdf = 5, & !: vertical diffusion (Kz) 39 jpicpt_bbc = 6, & !: Bottom Boundary Condition (geoth. flux) 40 jpicpt_bbl = 7, & !: Bottom Boundary Layer (diffusive/convective) 41 jpicpt_npc = 8, & !: static instability mixing 42 jpicpt_dmp = 9, & !: damping 43 jpicpt_qsr = 10, & !: penetrative solar radiation 44 jpicpt_nsr = 11, & !: non solar radiation 45 jpicpt_zl1 = 12 !: first level vertical flux 30 ! !!! => tracer trends indexes <= 31 INTEGER, PARAMETER :: jpicpt_xad = 1 !: x- horizontal advection 32 INTEGER, PARAMETER :: jpicpt_yad = 2 !: y- horizontal advection 33 INTEGER, PARAMETER :: jpicpt_zad = 3 !: z- vertical advection 34 INTEGER, PARAMETER :: jpicpt_ldf = 4 !: lateral diffusion 35 INTEGER, PARAMETER :: jpicpt_zdf = 5 !: vertical diffusion (Kz) 36 INTEGER, PARAMETER :: jpicpt_bbc = 6 !: Bottom Boundary Condition (geoth. flux) 37 INTEGER, PARAMETER :: jpicpt_bbl = 7 !: Bottom Boundary Layer (diffusive/convective) 38 INTEGER, PARAMETER :: jpicpt_npc = 8 !: static instability mixing 39 INTEGER, PARAMETER :: jpicpt_dmp = 9 !: damping 40 INTEGER, PARAMETER :: jpicpt_qsr = 10 !: penetrative solar radiation 41 INTEGER, PARAMETER :: jpicpt_nsr = 11 !: non solar radiation 42 INTEGER, PARAMETER :: jpicpt_zl1 = 12 !: first level vertical flux 46 43 47 INTEGER, PARAMETER :: & !:=> Total tracer trends indexes <=48 jptot_tra = 12!: change it when adding/removing one indice above44 ! !!! => Total tracer trends indexes <= 45 INTEGER, PARAMETER :: jptot_tra = 12 !: change it when adding/removing one indice above 49 46 50 !! Momentum trends diagnostics parameters 51 !!--------------------------------------------------------------------- 52 INTEGER, PARAMETER :: & !: => dynamic trends indexes <= 53 jpicpd_hpg = 1, & !: hydrostatic pressure gradient 54 jpicpd_keg = 2, & !: kinetic energy gradient 55 jpicpd_rvo = 3, & !: relative vorticity 56 jpicpd_pvo = 4, & !: planetary vorticity 57 jpicpd_ldf = 5, & !: lateral diffusion 58 jpicpd_had = 6, & !: horizontal advection 59 jpicpd_zad = 7, & !: vertical advection 60 jpicpd_zdf = 8, & !: vertical diffusion 61 jpicpd_spg = 9, & !: surface pressure gradient 62 jpicpd_dat = 10, & !: damping term 63 jpicpd_swf = 11, & !: surface wind forcing 64 jpicpd_bfr = 12 !: bottom friction 47 ! !!! => dynamic trends indexes <= 48 INTEGER, PARAMETER :: jpicpd_hpg = 1 !: hydrostatic pressure gradient 49 INTEGER, PARAMETER :: jpicpd_keg = 2 !: kinetic energy gradient 50 INTEGER, PARAMETER :: jpicpd_rvo = 3 !: relative vorticity 51 INTEGER, PARAMETER :: jpicpd_pvo = 4 !: planetary vorticity 52 INTEGER, PARAMETER :: jpicpd_ldf = 5 !: lateral diffusion 53 INTEGER, PARAMETER :: jpicpd_had = 6 !: horizontal advection 54 INTEGER, PARAMETER :: jpicpd_zad = 7 !: vertical advection 55 INTEGER, PARAMETER :: jpicpd_zdf = 8 !: vertical diffusion 56 INTEGER, PARAMETER :: jpicpd_spg = 9 !: surface pressure gradient 57 INTEGER, PARAMETER :: jpicpd_dat = 10 !: damping term 58 INTEGER, PARAMETER :: jpicpd_swf = 11 !: surface wind forcing 59 INTEGER, PARAMETER :: jpicpd_bfr = 12 !: bottom friction 65 60 66 INTEGER, PARAMETER :: & !:=> Total dynamic trends indexes <=67 jptot_dyn = 12!: change it when adding/removing one indice above61 ! !!! => Total dynamic trends indexes <= 62 INTEGER, PARAMETER :: jptot_dyn = 12 !: change it when adding/removing one indice above 68 63 69 64 #if defined key_trdtra || defined key_trddyn || defined key_esopa … … 89 84 #endif 90 85 !!---------------------------------------------------------------------- 91 !! OPA 9.0 , LOCEAN-IPSL (2005)86 !! NEMO/OPA 3.2 , LOCEAN-IPSL (2009) 92 87 !! $Id$ 93 88 !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) -
trunk/NEMO/OPA_SRC/TRD/trdmld.F90
r1581 r1601 75 75 !! The control surface can be either a mixed layer depth (time varying) 76 76 !! or a fixed surface (jk level or bowl). 77 !! Choose control surface with n ctls in namelist NAMTRD :78 !! n ctls = 0 : use mixed layer with density criterion79 !! n ctls = 1 : read index from file 'ctlsurf_idx'80 !! n ctls > 1 : use fixed level surface jk = nctls77 !! Choose control surface with nn_ctls in namelist NAMTRD : 78 !! nn_ctls = 0 : use mixed layer with density criterion 79 !! nn_ctls = 1 : read index from file 'ctlsurf_idx' 80 !! nn_ctls > 1 : use fixed level surface jk = nn_ctls 81 81 !! Note: in the remainder of the routine, the volume between the 82 82 !! surface and the control surface is called "mixed-layer" … … 100 100 101 101 ! ... Set nmld(ji,jj) = index of first T point below control surf. or outside mixed-layer 102 IF( n ctls == 0 ) THEN ! * control surface = mixed-layer with density criterion102 IF( nn_ctls == 0 ) THEN ! * control surface = mixed-layer with density criterion 103 103 nmld(:,:) = nmln(:,:) ! array nmln computed in zdfmxl.F90 104 ELSE IF( n ctls == 1 ) THEN ! * control surface = read index from file104 ELSE IF( nn_ctls == 1 ) THEN ! * control surface = read index from file 105 105 nmld(:,:) = nbol(:,:) 106 ELSE IF( n ctls >= 2 ) THEN ! * control surface = model level107 n ctls = MIN( nctls, jpktrd - 1 )108 nmld(:,:) = n ctls + 1106 ELSE IF( nn_ctls >= 2 ) THEN ! * control surface = model level 107 nn_ctls = MIN( nn_ctls, jpktrd - 1 ) 108 nmld(:,:) = nn_ctls + 1 109 109 ENDIF 110 110 … … 193 193 !! 1) to explain the difference between initial and final 194 194 !! mixed-layer T & S (where initial and final relate to the 195 !! current analysis window, defined by n trd in the namelist)195 !! current analysis window, defined by nn_trd in the namelist) 196 196 !! 2) to explain the difference between the current and previous 197 197 !! TIME-AVERAGED mixed-layer T & S (where time-averaging is … … 199 199 !! 200 200 !! ** Consistency check : 201 !! If the control surface is fixed ( n ctls > 1 ), the residual term (dh/dt201 !! If the control surface is fixed ( nn_ctls > 1 ), the residual term (dh/dt 202 202 !! entrainment) should be zero, at machine accuracy. Note that in the case 203 203 !! of time-averaged mixed-layer fields, this residual WILL NOT BE ZERO 204 204 !! over the first two analysis windows (except if restart). 205 !! N.B. For ORCA2_LIM, use e.g. n trd=5, ucf=1., nctls=8205 !! N.B. For ORCA2_LIM, use e.g. nn_trd=5, rn_ucf=1., nn_ctls=8 206 206 !! for checking residuals. 207 207 !! On a NEC-SX5 computer, this typically leads to: … … 351 351 ! 352 352 ! o---[--o-----o-----o-----o--]-[--o-----o-----o-----o-----o--]---o-----o--> time steps 353 ! ntrd 2*ntrd etc.353 ! nn_trd 2*nn_trd etc. 354 354 ! 1 2 3 4 =5 e.g. =10 355 355 ! … … 386 386 ! N.B. It may be useful to check IOIPSL time averaging with : 387 387 ! tmltrd (:,:,:) = 1. ; smltrd (:,:,:) = 1. 388 tmltrd(:,:,:) = tmltrd(:,:,:) * ucf ! (actually needed for 1:jpltrd-1, but trdmld(:,:,jpltrd)389 smltrd(:,:,:) = smltrd(:,:,:) * ucf ! is no longer used, and is reset to 0. at next time step)388 tmltrd(:,:,:) = tmltrd(:,:,:) * rn_ucf ! (actually needed for 1:jpltrd-1, but trdmld(:,:,jpltrd) 389 smltrd(:,:,:) = smltrd(:,:,:) * rn_ucf ! is no longer used, and is reset to 0. at next time step) 390 390 391 391 ! define time axis … … 393 393 itmod = kt - nit000 + 1 394 394 395 MODULO_NTRD : IF( MOD( itmod, n trd ) == 0 ) THEN ! nitend MUST be multiple of ntrd395 MODULO_NTRD : IF( MOD( itmod, nn_trd ) == 0 ) THEN ! nitend MUST be multiple of nn_trd 396 396 ! 397 397 ztmltot (:,:) = 0.e0 ; zsmltot (:,:) = 0.e0 ! reset arrays to zero … … 519 519 520 520 ! ... temperature ... ... salinity ... 521 ztmltot (:,:) = ztmltot(:,:) * ucf/zfn ; zsmltot (:,:) = zsmltot(:,:) *ucf/zfn522 ztmlres (:,:) = ztmlres(:,:) * ucf/zfn ; zsmlres (:,:) = zsmlres(:,:) *ucf/zfn523 ztmlatf (:,:) = ztmlatf(:,:) * ucf/zfn ; zsmlatf (:,:) = zsmlatf(:,:) *ucf/zfn521 ztmltot (:,:) = ztmltot(:,:) * rn_ucf/zfn ; zsmltot (:,:) = zsmltot(:,:) * rn_ucf/zfn 522 ztmlres (:,:) = ztmlres(:,:) * rn_ucf/zfn ; zsmlres (:,:) = zsmlres(:,:) * rn_ucf/zfn 523 ztmlatf (:,:) = ztmlatf(:,:) * rn_ucf/zfn ; zsmlatf (:,:) = zsmlatf(:,:) * rn_ucf/zfn 524 524 525 525 tml_sum (:,:) = tml_sum (:,:) / (2*zfn) ; sml_sum (:,:) = sml_sum (:,:) / (2*zfn) 526 ztmltot2(:,:) = ztmltot2(:,:) * ucf/zfn2 ; zsmltot2(:,:) = zsmltot2(:,:) *ucf/zfn2527 ztmltrd2(:,:,:) = ztmltrd2(:,:,:)* ucf/zfn2 ; zsmltrd2(:,:,:) = zsmltrd2(:,:,:)*ucf/zfn2528 ztmlatf2(:,:) = ztmlatf2(:,:) * ucf/zfn2 ; zsmlatf2(:,:) = zsmlatf2(:,:) *ucf/zfn2529 ztmlres2(:,:) = ztmlres2(:,:) * ucf/zfn2 ; zsmlres2(:,:) = zsmlres2(:,:) *ucf/zfn2526 ztmltot2(:,:) = ztmltot2(:,:) * rn_ucf/zfn2 ; zsmltot2(:,:) = zsmltot2(:,:) * rn_ucf/zfn2 527 ztmltrd2(:,:,:) = ztmltrd2(:,:,:)* rn_ucf/zfn2 ; zsmltrd2(:,:,:) = zsmltrd2(:,:,:)* rn_ucf/zfn2 528 ztmlatf2(:,:) = ztmlatf2(:,:) * rn_ucf/zfn2 ; zsmlatf2(:,:) = zsmlatf2(:,:) * rn_ucf/zfn2 529 ztmlres2(:,:) = ztmlres2(:,:) * rn_ucf/zfn2 ; zsmlres2(:,:) = zsmlres2(:,:) * rn_ucf/zfn2 530 530 531 531 rmld_sum(:,:) = rmld_sum(:,:) / (2*zfn) ! similar to tml_sum and sml_sum … … 578 578 #if defined key_dimgout 579 579 580 IF( MOD( itmod, n trd ) == 0 ) THEN580 IF( MOD( itmod, nn_trd ) == 0 ) THEN 581 581 iyear = ndastp/10000 582 582 imon = (ndastp-iyear*10000)/100 583 583 iday = ndastp - imon*100 - iyear*10000 584 584 WRITE(clname,9000) TRIM(cexper),'MLDiags',iyear,imon,iday 585 WRITE(clmode,'(f5.1,a)') n trd*rdt/86400.,' days average'585 WRITE(clmode,'(f5.1,a)') nn_trd*rdt/86400.,' days average' 586 586 cltext = TRIM(cexper)//' mld diags'//TRIM(clmode) 587 587 CALL dia_wri_dimg (clname, cltext, smltrd, jpltrd, '2') … … 595 595 ! ---------------------------------- 596 596 597 IF( lwp .AND. MOD( itmod , n trd ) == 0 ) THEN597 IF( lwp .AND. MOD( itmod , nn_trd ) == 0 ) THEN 598 598 WRITE(numout,*) ' ' 599 599 WRITE(numout,*) 'trd_mld : write trends in the NetCDF file :' … … 685 685 #endif 686 686 687 IF( MOD( itmod, n trd ) == 0 ) THEN687 IF( MOD( itmod, nn_trd ) == 0 ) THEN 688 688 ! 689 689 ! III.5 Reset cumulative arrays to zero … … 744 744 ! ------------------------------------------------- 745 745 746 IF( ( lk_trdmld ) .AND. ( MOD( nitend, n trd ) /= 0 ) ) THEN746 IF( ( lk_trdmld ) .AND. ( MOD( nitend, nn_trd ) /= 0 ) ) THEN 747 747 WRITE(numout,cform_err) 748 748 WRITE(numout,*) ' Your nitend parameter, nitend = ', nitend 749 749 WRITE(numout,*) ' is no multiple of the trends diagnostics frequency ' 750 WRITE(numout,*) ' you defined, n trd = ', ntrd750 WRITE(numout,*) ' you defined, nn_trd = ', nn_trd 751 751 WRITE(numout,*) ' This will not allow you to restart from this simulation. ' 752 752 WRITE(numout,*) ' You should reconsider this choice. ' … … 797 797 ! ---------------------------------------------- 798 798 799 IF( n ctls == 1 ) THEN799 IF( nn_ctls == 1 ) THEN 800 800 CALL ctl_opn( numbol, 'ctlsurf_idx', 'OLD', 'UNFORMATTED', 'SEQUENTIAL', -1, numout, lwp ) 801 801 READ ( numbol ) nbol … … 811 811 #else 812 812 ! clmxl = legend root for netCDF output 813 IF( n ctls == 0 ) THEN ! control surface = mixed-layer with density criterion813 IF( nn_ctls == 0 ) THEN ! control surface = mixed-layer with density criterion 814 814 clmxl = 'Mixed Layer ' ! (array nmln computed in zdfmxl.F90) 815 ELSE IF( n ctls == 1 ) THEN ! control surface = read index from file815 ELSE IF( nn_ctls == 1 ) THEN ! control surface = read index from file 816 816 clmxl = ' Bowl ' 817 ELSE IF( n ctls >= 2 ) THEN ! control surface = model level818 WRITE(clmxl,'(A10,I2,1X)') 'Levels 1 -', n ctls817 ELSE IF( nn_ctls >= 2 ) THEN ! control surface = model level 818 WRITE(clmxl,'(A10,I2,1X)') 'Levels 1 -', nn_ctls 819 819 END IF 820 820 … … 828 828 CALL ctl_stop( 'trd_mld : this was never checked. Comment this line to proceed...' ) 829 829 END IF 830 zsto = n trd * rdt830 zsto = nn_trd * rdt 831 831 clop = "inst("//TRIM(clop)//")" 832 832 # else … … 834 834 zsto = rdt ! inst. diags : we use IOIPSL time averaging 835 835 ELSE 836 zsto = n trd * rdt ! mean diags : we DO NOT use any IOIPSL time averaging836 zsto = nn_trd * rdt ! mean diags : we DO NOT use any IOIPSL time averaging 837 837 END IF 838 838 clop = "ave("//TRIM(clop)//")" 839 839 # endif 840 zout = n trd * rdt840 zout = nn_trd * rdt 841 841 842 842 IF(lwp) WRITE (numout,*) ' netCDF initialization' … … 870 870 871 871 !-- Create a NetCDF file and enter the define mode 872 CALL dia_nam( clhstnam, n trd, 'trends' )872 CALL dia_nam( clhstnam, nn_trd, 'trends' ) 873 873 IF(lwp) WRITE(numout,*) ' Name of NETCDF file ', clhstnam 874 874 CALL histbeg( clhstnam, jpi, glamt, jpj, gphit, & … … 880 880 881 881 !-- Define physical units 882 IF( ucf == 1. ) THEN 883 cltu = "degC/s" ; clsu = "p.s.u./s" 884 ELSEIF ( ucf == 3600.*24.) THEN 885 cltu = "degC/day" ; clsu = "p.s.u./day" 886 ELSE 887 cltu = "unknown?" ; clsu = "unknown?" 888 END IF 882 IF ( rn_ucf == 1. ) THEN ; cltu = "degC/s" ; clsu = "p.s.u./s" 883 ELSEIF ( rn_ucf == 3600.*24.) THEN ; cltu = "degC/day" ; clsu = "p.s.u./day" 884 ELSE ; cltu = "unknown?" ; clsu = "unknown?" 885 END IF 886 889 887 890 888 !-- Define miscellaneous T and S mixed-layer variables -
trunk/NEMO/OPA_SRC/TRD/trdmod.F90
r1229 r1601 80 80 !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 81 81 82 IF( ( mod(kt,n trd) == 0 .OR. kt == nit000 .OR. kt == nitend) ) THEN82 IF( ( mod(kt,nn_trd) == 0 .OR. kt == nit000 .OR. kt == nitend) ) THEN 83 83 ! 84 84 IF( lk_trdtra .AND. ctype == 'TRA' ) THEN ! active tracer trends … … 281 281 USE in_out_manager ! I/O manager 282 282 283 NAMELIST/namtrd/ n trd, nctls, cn_trdrst_in, cn_trdrst_out, ln_trdmld_restart,ucf, ln_trdmld_instant283 NAMELIST/namtrd/ nn_trd, nn_ctls, cn_trdrst_in, cn_trdrst_out, ln_trdmld_restart, rn_ucf, ln_trdmld_instant 284 284 !!---------------------------------------------------------------------- 285 285 … … 292 292 WRITE(numout,*) ' trd_mod_init : Momentum/Tracers trends' 293 293 WRITE(numout,*) ' ~~~~~~~~~~~~~' 294 WRITE(numout,*) ' 295 WRITE(numout,*) ' * frequency of trends diagnostics ntrd = ', ntrd296 WRITE(numout,*) ' * control surface type nctls = ', nctls297 WRITE(numout,*) ' *restart for ML diagnostics ln_trdmld_restart = ', ln_trdmld_restart298 WRITE(numout,*) ' *instantaneous or mean ML T/S ln_trdmld_instant = ', ln_trdmld_instant299 WRITE(numout,*) ' * unit conversion factor ucf = ',ucf294 WRITE(numout,*) ' Namelist namtrd : set trends parameters' 295 WRITE(numout,*) ' frequency of trends diagnostics nn_trd = ', nn_trd 296 WRITE(numout,*) ' control surface type nn_ctls = ', nn_ctls 297 WRITE(numout,*) ' restart for ML diagnostics ln_trdmld_restart = ', ln_trdmld_restart 298 WRITE(numout,*) ' instantaneous or mean ML T/S ln_trdmld_instant = ', ln_trdmld_instant 299 WRITE(numout,*) ' unit conversion factor rn_ucf = ', rn_ucf 300 300 ENDIF 301 301 ENDIF -
trunk/NEMO/OPA_SRC/TRD/trdmod_oce.F90
r1229 r1601 13 13 PUBLIC 14 14 15 ! !* Namelist namtrd: diagnostics on dynamics/tracer trends16 INTEGER , PUBLIC :: n trd = 10!: time step frequency dynamics and tracers trends17 INTEGER , PUBLIC :: n ctls = 0!: control surface type for trends vertical integration18 REAL(wp), PUBLIC :: ucf = 1.!: unit conversion factor (for netCDF trends outputs)15 ! !!* Namelist namtrd: diagnostics on dynamics/tracer trends * 16 INTEGER , PUBLIC :: nn_trd = 10 !: time step frequency dynamics and tracers trends 17 INTEGER , PUBLIC :: nn_ctls = 0 !: control surface type for trends vertical integration 18 REAL(wp), PUBLIC :: rn_ucf = 1. !: unit conversion factor (for netCDF trends outputs) 19 19 !: =1. (=86400.) for degC/s (degC/day) and psu/s (psu/day) 20 20 CHARACTER(len=32) :: cn_trdrst_in = "restart_mld" !: suffix of ocean restart name (input) … … 23 23 LOGICAL , PUBLIC :: ln_trdmld_restart = .FALSE. !: flag to restart mixed-layer diagnostics 24 24 25 !!* Control parameters26 25 # if defined key_trdtra || defined key_trdmld 27 26 LOGICAL , PUBLIC :: l_trdtra = .TRUE. !: tracers trend flag … … 35 34 # endif 36 35 37 ! !*Active tracers trends indexes36 ! !!! Active tracers trends indexes 38 37 INTEGER, PUBLIC, PARAMETER :: jptra_trd_xad = 1 !: x- horizontal advection 39 38 INTEGER, PUBLIC, PARAMETER :: jptra_trd_yad = 2 !: y- horizontal advection … … 49 48 INTEGER, PUBLIC, PARAMETER :: jptra_trd_atf = 12 !: Asselin correction 50 49 51 ! !*Momentum trends indexes50 ! !!! Momentum trends indexes 52 51 INTEGER, PUBLIC, PARAMETER :: jpdyn_trd_hpg = 1 !: hydrostatic pressure gradient 53 52 INTEGER, PUBLIC, PARAMETER :: jpdyn_trd_keg = 2 !: kinetic energy gradient … … 64 63 65 64 !!---------------------------------------------------------------------- 66 !! OPA 9.0 , LOCEAN-IPSL (2006)65 !! NEMO/OPA 3.2 , LOCEAN-IPSL (2009) 67 66 !! $Id$ 68 67 !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) -
trunk/NEMO/OPA_SRC/TRD/trdvor.F90
r1334 r1601 409 409 itmod = kt - nit000 + 1 410 410 411 IF( MOD( it, n trd ) == 0 ) THEN411 IF( MOD( it, nn_trd ) == 0 ) THEN 412 412 413 413 ! III.1 compute total trend … … 456 456 IF( kt >= nit000+1 ) THEN 457 457 458 IF( lwp .AND. MOD( itmod, n trd ) == 0 ) THEN458 IF( lwp .AND. MOD( itmod, nn_trd ) == 0 ) THEN 459 459 WRITE(numout,*) '' 460 460 WRITE(numout,*) 'trd_vor : write trends in the NetCDF file at kt = ', kt … … 483 483 ENDIF 484 484 ! 485 IF( MOD( it, n trd ) == 0 ) rotot(:,:)=0485 IF( MOD( it, nn_trd ) == 0 ) rotot(:,:)=0 486 486 ! 487 487 IF( kt == nitend ) CALL histclo( nidvor ) … … 551 551 clop = "ave("//TRIM(clop)//")" 552 552 #endif 553 zout = n trd*rdt553 zout = nn_trd*rdt 554 554 555 555 IF(lwp) WRITE(numout,*) ' netCDF initialization' … … 566 566 ! II.3 Define the T grid trend file (nidvor) 567 567 ! --------------------------------- 568 CALL dia_nam( clhstnam, n trd, 'vort' ) ! filename568 CALL dia_nam( clhstnam, nn_trd, 'vort' ) ! filename 569 569 IF(lwp) WRITE(numout,*) ' Name of NETCDF file ', clhstnam 570 570 CALL histbeg( clhstnam, jpi, glamf, jpj, gphif,1, jpi, & ! Horizontal grid : glamt and gphit -
trunk/NEMO/OPA_SRC/ZDF/zdf_oce.F90
r1546 r1601 18 18 #endif 19 19 20 ! !!* namelist nam _zdf: vertical diffusion *20 ! !!* namelist namzdf: vertical diffusion * 21 21 REAL(wp), PUBLIC :: rn_avm0 = 1.e-4_wp !: vertical eddy viscosity (m2/s) 22 22 REAL(wp), PUBLIC :: rn_avt0 = 1.e-5_wp !: vertical eddy diffusivity (m2/s) -
trunk/NEMO/OPA_SRC/ZDF/zdfbfr.F90
r1152 r1601 4 4 !! Ocean physics: Bottom friction 5 5 !!====================================================================== 6 !! History : 8.0 ! 1997-06 (G. Madec, A.-M. Treguier) Original code 7 !! NEMO 1.0 ! 2002-06 (G. Madec) F90: Free form and module 8 !!---------------------------------------------------------------------- 6 9 7 10 !!---------------------------------------------------------------------- 8 !! zdf_bfr : update momentum Kz at the ocean bottom due to the 9 !! type of bottom friction chosen 10 !! zdf_bfr_init : read in namelist and control the bottom friction 11 !! parameters. 11 !! zdf_bfr : update momentum Kz at the ocean bottom due to the type of bottom friction chosen 12 !! zdf_bfr_init : read in namelist and control the bottom friction parameters. 12 13 !!---------------------------------------------------------------------- 13 !! * Modules used14 14 USE oce ! ocean dynamics and tracers variables 15 15 USE dom_oce ! ocean space and time domain variables … … 22 22 PRIVATE 23 23 24 !! * Routine accessibility 25 PUBLIC zdf_bfr ! called by step.F90 24 PUBLIC zdf_bfr ! called by step.F90 26 25 27 !! * Module variables 28 INTEGER :: & !!! ** bottom friction namelist (nambfr) ** 29 nbotfr = 0 ! = 0/1/2/3 type of bottom friction 30 REAL(wp) :: & !!! ** bottom friction namelist (nambfr) ** 31 bfri1 = 4.0e-4_wp, & ! bottom drag coefficient (linear case) 32 bfri2 = 1.0e-3_wp, & ! bottom drag coefficient (non linear case) 33 bfeb2 = 2.5e-3_wp ! background bottom turbulent kinetic energy (m2/s2) 26 ! !!* Namelist nambfr: bottom friction namelist * 27 INTEGER :: nn_bfr = 0 ! = 0/1/2/3 type of bottom friction 28 REAL(wp) :: rn_bfri1 = 4.0e-4_wp ! bottom drag coefficient (linear case) 29 REAL(wp) :: rn_bfri2 = 1.0e-3_wp ! bottom drag coefficient (non linear case) 30 REAL(wp) :: rn_bfeb2 = 2.5e-3_wp ! background bottom turbulent kinetic energy [m2/s2] 34 31 35 32 !! * Substitutions 36 33 # include "domzgr_substitute.h90" 37 34 !!---------------------------------------------------------------------- 38 !! OPA 9.0 , LOCEAN-IPSL (2005)35 !! NEMO/OPA 3.2 , LOCEAN-IPSL (2009) 39 36 !! $Id$ 40 !! This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt37 !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 41 38 !!---------------------------------------------------------------------- 42 39 … … 48 45 !! 49 46 !! ** Purpose : Applied the bottom friction through a specification of 50 !! Kz at the ocean bottom.47 !! Kz at the ocean bottom. 51 48 !! 52 49 !! ** Method : Update the value of avmu and avmv at the ocean bottom 53 50 !! level following the chosen friction type (no-slip, free-slip, 54 51 !! linear, or quadratic) 52 !!---------------------------------------------------------------------- 53 INTEGER, INTENT( in ) :: kt ! ocean time-step index 55 54 !! 56 !! History :57 !! 8.0 ! 97-06 (G. Madec, A.-M. Treguier) Original code58 !! 8.5 ! 02-06 (G. Madec) F90: Free form and module55 INTEGER :: ji, jj ! dummy loop indexes 56 INTEGER :: ikbu, ikbv, ikbum1, ikbvm1 ! temporary integers 57 REAL(wp) :: zvu, zuv, zecu, zecv ! temporary scalars 59 58 !!---------------------------------------------------------------------- 60 !! * Arguments61 INTEGER, INTENT( in ) :: kt ! ocean time-step index62 63 !! * Local declarations64 INTEGER :: &65 ji, jj, & ! dummy loop indexes66 ikbu, ikbv, & ! temporary integers67 ikbum1, ikbvm1 !68 REAL(wp) :: &69 zvu, zuv, zecu, zecv ! temporary scalars70 !!----------------------------------------------------------------------71 72 59 73 60 IF( kt == nit000 ) CALL zdf_bfr_init 74 61 75 76 ! Compute avmu, avmv at the ocean bottom 77 ! -------------------------------------- 78 79 SELECT CASE (nbotfr) 80 81 CASE( 0 ) ! no-slip boundary condition 62 ! ! -------------------------------------- 63 SELECT CASE (nn_bfr) ! Compute avmu, avmv at the ocean bottom 64 ! ! -------------------------------------- 65 ! 66 CASE( 0 ) !== no-slip boundary condition ==! 82 67 # if defined key_vectopt_loop 83 jj =184 DO ji = jpi+2, jpij-jpi-1 ! vector opt. (forced unrolling)68 DO jj = 1, 1 69 DO ji = jpi+2, jpij-jpi-1 ! vector opt. (forced unrolling) 85 70 # else 86 71 DO jj = 2, jpjm1 … … 93 78 avmu(ji,jj,ikbu) = 2. * avmu(ji,jj,ikbum1) 94 79 avmv(ji,jj,ikbv) = 2. * avmv(ji,jj,ikbvm1) 95 # if ! defined key_vectopt_loop96 80 END DO 97 # endif98 81 END DO 99 82 100 CASE( 1 ) ! linear botton friction83 CASE( 1 ) !== linear botton friction ==! 101 84 # if defined key_vectopt_loop 102 jj =1103 DO ji = jpi+2, jpij-jpi-1 ! vector opt. (forced unrolling)85 DO jj = 1, 1 86 DO ji = jpi+2, jpij-jpi-1 ! vector opt. (forced unrolling) 104 87 # else 105 88 DO jj = 2, jpjm1 … … 108 91 ikbu = MIN( mbathy(ji+1,jj), mbathy(ji,jj) ) 109 92 ikbv = MIN( mbathy(ji,jj+1), mbathy(ji,jj) ) 110 avmu(ji,jj,ikbu) = bfri1 * fse3uw(ji,jj,ikbu) 111 avmv(ji,jj,ikbv) = bfri1 * fse3vw(ji,jj,ikbv) 112 # if ! defined key_vectopt_loop 93 avmu(ji,jj,ikbu) = rn_bfri1 * fse3uw(ji,jj,ikbu) 94 avmv(ji,jj,ikbv) = rn_bfri1 * fse3vw(ji,jj,ikbv) 113 95 END DO 114 # endif115 96 END DO 116 97 117 CASE( 2 ) ! quadratic botton friction98 CASE( 2 ) !== quadratic botton friction ==! 118 99 # if defined key_vectopt_loop 119 jj =1100 DO jj = 1, 1 120 101 !CDIR NOVERRCHK 121 DO ji = jpi+2, jpij-jpi-1 ! vector opt. (forced unrolling)102 DO ji = jpi+2, jpij-jpi-1 ! vector opt. (forced unrolling) 122 103 # else 123 104 !CDIR NOVERRCHK … … 137 118 + un(ji,jj+1,ikbvm1) + un(ji-1,jj+1,ikbvm1) ) 138 119 139 zecu = SQRT( un(ji,jj,ikbum1) * un(ji,jj,ikbum1) + zvu*zvu + bfeb2 )140 zecv = SQRT( vn(ji,jj,ikbvm1) * vn(ji,jj,ikbvm1) + zuv*zuv + bfeb2 )120 zecu = SQRT( un(ji,jj,ikbum1) * un(ji,jj,ikbum1) + zvu*zvu + rn_bfeb2 ) 121 zecv = SQRT( vn(ji,jj,ikbvm1) * vn(ji,jj,ikbvm1) + zuv*zuv + rn_bfeb2 ) 141 122 142 avmu(ji,jj,ikbu) = bfri2 * zecu * fse3uw(ji,jj,ikbu) 143 avmv(ji,jj,ikbv) = bfri2 * zecv * fse3vw(ji,jj,ikbv) 144 # if ! defined key_vectopt_loop 123 avmu(ji,jj,ikbu) = rn_bfri2 * zecu * fse3uw(ji,jj,ikbu) 124 avmv(ji,jj,ikbv) = rn_bfri2 * zecv * fse3vw(ji,jj,ikbv) 145 125 END DO 146 # endif147 126 END DO 148 127 149 CASE( 3 ) ! free-slip boundary condition128 CASE( 3 ) !== free-slip boundary condition ==! 150 129 # if defined key_vectopt_loop 151 jj =1152 DO ji = jpi+2, jpij-jpi-1 ! vector opt. (forced unrolling)130 DO jj = 1, 1 131 DO ji = jpi+2, jpij-jpi-1 ! vector opt. (forced unrolling) 153 132 # else 154 133 DO jj = 2, jpjm1 … … 159 138 avmu(ji,jj,ikbu) = 0.e0 160 139 avmv(ji,jj,ikbv) = 0.e0 161 # if ! defined key_vectopt_loop162 140 END DO 163 # endif164 141 END DO 142 ! 143 END SELECT 144 CALL lbc_lnk( avmu, 'U', 1. ) ; CALL lbc_lnk( avmv, 'V', 1. ) ! Lateral boundary condition (unchanged sign) 165 145 166 END SELECT 167 168 ! Lateral boundary condition on (avmu,avmv) (unchanged sign) 169 ! ------------------------------=========== 170 CALL lbc_lnk( avmu, 'U', 1. ) 171 CALL lbc_lnk( avmv, 'V', 1. ) 172 173 IF(ln_ctl) THEN 174 CALL prt_ctl(tab3d_1=avmu, clinfo1=' bfr - u: ', mask1=umask, & 175 & tab3d_2=avmv, clinfo2= ' v: ', mask2=vmask,ovlap=1, kdim=jpk) 176 ENDIF 177 146 IF(ln_ctl) CALL prt_ctl( tab3d_1=avmu, clinfo1=' bfr - u: ', mask1=umask, & 147 & tab3d_2=avmv, clinfo2= ' v: ', mask2=vmask,ovlap=1, kdim=jpk ) 148 ! 178 149 END SUBROUTINE zdf_bfr 179 150 … … 186 157 !! 187 158 !! ** Method : Read the nammbf namelist and check their consistency 188 !! called at the first timestep (nit000)189 !!190 !! History :191 !! 9.0 ! 02-06 (G. Madec) Original code192 159 !!---------------------------------------------------------------------- 193 !! * Local declarations 194 NAMELIST/nambfr/ nbotfr, bfri1, bfri2, bfeb2 160 NAMELIST/nambfr/ nn_bfr, rn_bfri1, rn_bfri2, rn_bfeb2 195 161 !!---------------------------------------------------------------------- 196 162 197 ! Read Namelist nambfr : bottom momentum boundary condition 198 ! -------------------- 199 REWIND ( numnam ) 200 READ ( numnam, nambfr ) 163 REWIND( numnam ) ! Read Namelist nambfr : bottom momentum boundary condition 164 READ ( numnam, nambfr ) 201 165 202 203 ! Parameter control and print 204 ! --------------------------- 205 IF(lwp) WRITE(numout,*) 166 IF(lwp) WRITE(numout,*) ! Parameter print 206 167 IF(lwp) WRITE(numout,*) 'zdf_bfr : momentum bottom friction' 207 168 IF(lwp) WRITE(numout,*) '~~~~~~~' 208 IF(lwp) WRITE(numout,*) ' 169 IF(lwp) WRITE(numout,*) ' Namelist nambfr : set bottom friction parameters' 209 170 210 SELECT CASE (n botfr)211 171 SELECT CASE (nn_bfr) ! Parameter control 172 ! 212 173 CASE( 0 ) 213 IF(lwp) WRITE(numout,*) ' 214 174 IF(lwp) WRITE(numout,*) ' no-slip ' 175 ! 215 176 CASE( 1 ) 216 IF(lwp) WRITE(numout,*) ' linear botton friction'217 IF(lwp) WRITE(numout,*) ' friction coef. bfri1 = ',bfri1218 177 IF(lwp) WRITE(numout,*) ' linear botton friction nn_bfr = ', nn_bfr 178 IF(lwp) WRITE(numout,*) ' friction coef. rn_bfri1 = ', rn_bfri1 179 ! 219 180 CASE( 2 ) 220 IF(lwp) WRITE(numout,*) ' quadratic botton friction'221 IF(lwp) WRITE(numout,*) ' friction coef. bfri2 = ',bfri2222 IF(lwp) WRITE(numout,*) ' background tke bfeb2 = ',bfeb2223 181 IF(lwp) WRITE(numout,*) ' quadratic botton friction nn_bfr = ', nn_bfr 182 IF(lwp) WRITE(numout,*) ' friction coef. rn_bfri2 = ', rn_bfri2 183 IF(lwp) WRITE(numout,*) ' background KE rn_bfeb2 = ', rn_bfeb2 184 ! 224 185 CASE( 3 ) 225 IF(lwp) WRITE(numout,*) ' 226 186 IF(lwp) WRITE(numout,*) ' free-slip ' 187 ! 227 188 CASE DEFAULT 228 WRITE(ctmp1,*) ' bad flag value for nbotfr = ', nbotfr189 WRITE(ctmp1,*) 'bad flag value for nn_bfr = ', nn_bfr 229 190 CALL ctl_stop( ctmp1 ) 230 191 ! 231 192 END SELECT 232 193 ! 233 194 END SUBROUTINE zdf_bfr_init 234 195 -
trunk/NEMO/OPA_SRC/ZDF/zdfddm.F90
r1537 r1601 4 4 !! Ocean physics : double diffusion mixing parameterization 5 5 !!====================================================================== 6 !! History : OPA ! 2000-08 (G. Madec) double diffusive mixing 7 !! NEMO 1.0 ! 2002-06 (G. Madec) F90: Free form and module 8 !!---------------------------------------------------------------------- 6 9 #if defined key_zdfddm || defined key_esopa 7 10 !!---------------------------------------------------------------------- … … 28 31 REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) :: rrau !: heat/salt buoyancy flux ratio 29 32 30 ! !!* Namelist nam _ddm : double diffusive mixing *33 ! !!* Namelist namzdf_ddm : double diffusive mixing * 31 34 REAL(wp) :: rn_avts = 1.e-4_wp ! maximum value of avs for salt fingering 32 35 REAL(wp) :: rn_hsbfr = 1.6_wp ! heat/salt buoyancy flux ratio … … 47 50 !! 48 51 !! ** Purpose : Add to the vertical eddy diffusivity coefficient the 49 !! effect of salt fingering and diffusive convection.52 !! effect of salt fingering and diffusive convection. 50 53 !! 51 54 !! ** Method : Diapycnal mixing is increased in case of double … … 70 73 !! avmu, avmv are required to remain at least above avt and avs. 71 74 !! 72 !! ** Action : avt, avs : update vertical eddy diffusivity coef. 73 !! for temperature and salinity 74 !! 75 !! References : 76 !! Merryfield et al., JPO, 29, 1124-1142, 1999. 77 !! History : 78 !! ! 00-08 (G. Madec) double diffusive mixing 79 !! 8.5 ! 02-06 (G. Madec) F90: Free form and module 80 !!---------------------------------------------------------------------- 81 !! * Arguments 82 INTEGER, INTENT( in ) :: kt ! ocean time-step indexocean time step 83 84 !! * Local declarations 85 INTEGER :: ji, jj , jk ! dummy loop indices 86 REAL(wp), DIMENSION(jpi,jpj) :: & 87 zmsks, zmskf, & ! temporary workspace 88 zmskd1, zmskd2, zmskd3 ! " " 89 REAL(wp) :: & 90 zinr, zrr, & ! temporary scalars 91 zavft, zavfs, & ! " " 92 zavdt, zavds ! " " 93 !!---------------------------------------------------------------------- 94 75 !! ** Action : avt, avs : updated vertical eddy diffusivity coef. for T & S 76 !! 77 !! References : Merryfield et al., JPO, 29, 1124-1142, 1999. 78 !!---------------------------------------------------------------------- 79 INTEGER, INTENT(in) :: kt ! ocean time-step indexocean time step 80 !! 81 INTEGER :: ji, jj , jk ! dummy loop indices 82 REAL(wp) :: zinr, zrr ! temporary scalars 83 REAL(wp) :: zavft, zavfs ! - - 84 REAL(wp) :: zavdt, zavds ! - - 85 REAL(wp), DIMENSION(jpi,jpj) :: zmsks, zmskf, zmskd1, zmskd2, zmskd3 ! 2D workspace 86 !!---------------------------------------------------------------------- 95 87 96 88 IF ( kt == nit000 ) CALL zdf_ddm_init ! Initialization (first time-step only) 97 89 98 99 ! Compute avs100 ! -----------101 90 ! ! =============== 102 91 DO jk = 2, jpkm1 ! Horizontal slab … … 104 93 ! Define the mask 105 94 ! --------------- 106 ! only retains positive value of rrau 107 rrau(:,:,jk) = MAX( 1.e-20, rrau(:,:,jk) ) 108 109 ! indicators: 110 DO jj = 1, jpj 95 rrau(:,:,jk) = MAX( 1.e-20, rrau(:,:,jk) ) ! only retains positive value of rrau 96 97 DO jj = 1, jpj ! indicators: 111 98 DO ji = 1, jpi 112 99 ! stability indicator: msks=1 if rn2>0; 0 elsewhere … … 158 145 zrr = rrau(ji,jj,jk)/rn_hsbfr 159 146 zrr = zrr * zrr 160 zavfs = rn_avts / ( 1 + zrr*zrr*zrr ) * zmsks(ji,jj) * zmskf(ji,jj)147 zavfs = rn_avts / ( 1 + zrr*zrr*zrr ) * zmsks(ji,jj) * zmskf(ji,jj) 161 148 zavft = 0.7 * zavfs * zinr 162 149 ! diffusive layering 163 zavdt = 1.3635e-6 * EXP(4.6*EXP(-0.54*(zinr-1.) ) ) & 164 * zmsks(ji,jj) * zmskd1(ji,jj) 165 zavds = zavdt * zmsks(ji,jj) & 166 * ( (1.85 * rrau(ji,jj,jk) - 0.85 ) * zmskd3(ji,jj) & 167 + 0.15 * rrau(ji,jj,jk) * zmskd2(ji,jj) ) 150 zavdt = 1.3635e-6 * EXP( 4.6 * EXP( -0.54*(zinr-1.) ) ) * zmsks(ji,jj) * zmskd1(ji,jj) 151 zavds = zavdt * zmsks(ji,jj) * ( (1.85 * rrau(ji,jj,jk) - 0.85 ) * zmskd3(ji,jj) & 152 & + 0.15 * rrau(ji,jj,jk) * zmskd2(ji,jj) ) 168 153 ! add to the eddy viscosity coef. previously computed 169 154 avs (ji,jj,jk) = avt(ji,jj,jk) + zavfs + zavds … … 180 165 DO ji = 1, fs_jpim1 ! vector opt. 181 166 avmu(ji,jj,jk) = MAX( avmu(ji,jj,jk), & 182 avt(ji,jj,jk), avt(ji+1,jj,jk), & 183 avs(ji,jj,jk), avs(ji+1,jj,jk) ) & 184 * umask(ji,jj,jk) 167 & avt(ji,jj,jk), avt(ji+1,jj,jk), & 168 & avs(ji,jj,jk), avs(ji+1,jj,jk) ) * umask(ji,jj,jk) 185 169 avmv(ji,jj,jk) = MAX( avmv(ji,jj,jk), & 186 avt(ji,jj,jk), avt(ji,jj+1,jk), & 187 avs(ji,jj,jk), avs(ji,jj+1,jk) ) & 188 * vmask(ji,jj,jk) 170 & avt(ji,jj,jk), avt(ji,jj+1,jk), & 171 & avs(ji,jj,jk), avs(ji,jj+1,jk) ) * vmask(ji,jj,jk) 189 172 END DO 190 173 END DO … … 192 175 END DO ! End of slab 193 176 ! ! =============== 194 195 ! Lateral boundary conditions on ( avt, avs, avmu, avmv ) (unchanged sign) 196 ! -------------------------------======================== 197 CALL lbc_lnk( avt , 'W', 1. ) 177 ! 178 CALL lbc_lnk( avt , 'W', 1. ) ! Lateral boundary conditions (unchanged sign) 198 179 CALL lbc_lnk( avs , 'W', 1. ) 199 180 CALL lbc_lnk( avm , 'W', 1. ) … … 206 187 & tab3d_2=avmv, clinfo2= ' v: ', mask2=vmask, ovlap=1, kdim=jpk) 207 188 ENDIF 208 189 ! 209 190 END SUBROUTINE zdf_ddm 210 191 … … 216 197 !! ** Purpose : Initialization of double diffusion mixing scheme 217 198 !! 218 !! ** Method : Read the nam _ddm namelist and check the parameter values199 !! ** Method : Read the namzdf_ddm namelist and check the parameter values 219 200 !! called by zdf_ddm at the first timestep (nit000) 220 !! 221 !! History : 8.5 ! 02-08 (G. Madec) Original code 222 !!---------------------------------------------------------------------- 223 NAMELIST/nam_ddm/ rn_avts, rn_hsbfr 224 !!---------------------------------------------------------------------- 225 ! 226 REWIND ( numnam ) ! Read Namelist nam_ddm : double diffusion mixing scheme 227 READ ( numnam, nam_ddm ) 201 !!---------------------------------------------------------------------- 202 NAMELIST/namzdf_ddm/ rn_avts, rn_hsbfr 203 !!---------------------------------------------------------------------- 204 ! 205 REWIND ( numnam ) ! Read Namelist namzdf_ddm : double diffusion mixing scheme 206 READ ( numnam, namzdf_ddm ) 228 207 ! 229 208 IF(lwp) THEN ! Parameter print … … 231 210 WRITE(numout,*) 'zdf_ddm : double diffusive mixing' 232 211 WRITE(numout,*) '~~~~~~~' 233 WRITE(numout,*) ' Namelist nam _ddm : set dd mixing parameter'212 WRITE(numout,*) ' Namelist namzdf_ddm : set dd mixing parameter' 234 213 WRITE(numout,*) ' maximum avs for dd mixing rn_avts = ', rn_avts 235 214 WRITE(numout,*) ' heat/salt buoyancy flux ratio rn_hsbfr = ', rn_hsbfr -
trunk/NEMO/OPA_SRC/ZDF/zdfini.F90
r1559 r1601 54 54 INTEGER :: ioptio ! temporary scalar 55 55 !! 56 NAMELIST/nam _zdf/ rn_avm0, rn_avt0, nn_avb, nn_havtb, ln_zdfexp, nn_zdfexp, &56 NAMELIST/namzdf/ rn_avm0, rn_avt0, nn_avb, nn_havtb, ln_zdfexp, nn_zdfexp, & 57 57 & ln_zdfevd, nn_evdm, rn_avevd, ln_zdfnpc, nn_npc, nn_npcp 58 58 !!---------------------------------------------------------------------- 59 59 60 REWIND( numnam ) !* Read nam _zdf namelist : vertical mixing parameters61 READ ( numnam, nam _zdf )60 REWIND( numnam ) !* Read namzdf namelist : vertical mixing parameters 61 READ ( numnam, namzdf ) 62 62 63 63 IF(lwp) THEN !* Parameter print … … 65 65 WRITE(numout,*) 'zdf_init: vertical physics' 66 66 WRITE(numout,*) '~~~~~~~~' 67 WRITE(numout,*) ' Namelist nam _zdf : set vertical mixing mixing parameters'67 WRITE(numout,*) ' Namelist namzdf : set vertical mixing mixing parameters' 68 68 WRITE(numout,*) ' vertical eddy viscosity rn_avm0 = ', rn_avm0 69 69 WRITE(numout,*) ' vertical eddy diffusivity rn_avt0 = ', rn_avt0 -
trunk/NEMO/OPA_SRC/ZDF/zdfkpp.F90
r1537 r1601 38 38 LOGICAL , PUBLIC, PARAMETER :: lk_zdfkpp = .TRUE. !: KPP vertical mixing flag 39 39 40 REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) :: ghats !: non-local scalar mixing term (gamma/<ws>o) 41 REAL(wp), PUBLIC, DIMENSION(jpi,jpj) :: & 42 wt0 , & !: surface temperature flux for non local flux 43 ws0 , & !: surface salinity flux for non local flux 44 hkpp !: boundary layer depht 45 46 ! !!* Namelist nam_zdfkpp * 40 REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) :: ghats !: non-local scalar mixing term (gamma/<ws>o) 41 REAL(wp), PUBLIC, DIMENSION(jpi,jpj) :: wt0 !: surface temperature flux for non local flux 42 REAL(wp), PUBLIC, DIMENSION(jpi,jpj) :: ws0 !: surface salinity flux for non local flux 43 REAL(wp), PUBLIC, DIMENSION(jpi,jpj) :: hkpp !: boundary layer depht 44 45 ! !!* Namelist namzdf_kpp * 47 46 REAL(wp) :: rn_difmiw = 1.2e-04_wp ! constant internal wave viscosity (m2/s) 48 47 REAL(wp) :: rn_difsiw = 1.2e-05_wp ! constant internal wave diffusivity (m2/s) … … 59 58 difsdc = 1.5e-06_wp ! maximum diffusive convection mixing 60 59 #endif 61 LOGICAL :: & 62 ln_kpprimix = .TRUE. ! Shear instability mixing 60 LOGICAL :: ln_kpprimix = .TRUE. ! Shear instability mixing 63 61 64 62 REAL(wp) :: & !!! ** General constants ** … … 92 90 93 91 #if ! defined key_kppcustom 94 REAL(wp), DIMENSION(jpk,jpk) :: & 95 del ! array for reference mean values of vertical integration 92 REAL(wp), DIMENSION(jpk,jpk) :: del ! array for reference mean values of vertical integration 96 93 #endif 97 94 … … 103 100 njlktbm1 = njlktb - 1 ! 104 101 105 REAL(wp), DIMENSION(nilktb,njlktb) :: & 106 wmlktb , & ! lookup table for the turbulent vertical velocity scale for momentum 107 wslktb ! lookup table for the turbulent vertical velocity scale for tracers 102 REAL(wp), DIMENSION(nilktb,njlktb) :: wmlktb ! lookup table for the turbulent vertical velocity scale for momentum 103 REAL(wp), DIMENSION(nilktb,njlktb) :: wslktb ! lookup table for the turbulent vertical velocity scale for tracers 108 104 109 105 REAL(wp) :: & … … 115 111 deustar ! delta ustar in lookup table 116 112 #endif 117 REAL(wp), DIMENSION(jpk) :: & !!! attenuation coef 118 ratt 119 !! already defines in module traqsr, but only if the solar radiation penetration is considered 113 REAL(wp), DIMENSION(jpk) :: ratt ! attenuation coef (already defines in module traqsr, 114 ! ! but only if the solar radiation penetration is considered) 120 115 REAL(wp) :: & !!! * penetrative solar radiation coefficient * 121 116 rabs = 0.58_wp , & ! fraction associated with xsi1 … … 135 130 buof , & ! buoyancy forcing 136 131 mols ! moning-Obukhov length scale 137 REAL(wp), PUBLIC, DIMENSION(jpi,jpj) :: & 138 ekdp ! Ekman depth 139 #endif 140 141 INTEGER :: & ! 142 jip = 62 , jjp = 111 132 REAL(wp), PUBLIC, DIMENSION(jpi,jpj) :: ekdp ! Ekman depth 133 #endif 134 135 INTEGER :: jip = 62 , jjp = 111 143 136 144 137 !! * Substitutions … … 147 140 # include "zdfddm_substitute.h90" 148 141 !!---------------------------------------------------------------------- 149 !! OPA 9.0 , LOCEAN-IPSL (2005)142 !! NEMO/OPA 3.2 , LOCEAN-IPSL (2009) 150 143 !! $Id$ 151 144 !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) … … 419 412 DO jj = 2, jpjm1 420 413 DO ji = fs_2, fs_jpim1 421 IF( n eos < 1) THEN414 IF( nn_eos < 1) THEN 422 415 zt = tn(ji,jj,1) 423 416 zs = sn(ji,jj,1) - 35.0 … … 454 447 ELSE 455 448 zrhos = rhop(ji,jj,1) + rau0 * ( 1. - tmask(ji,jj,1) ) 456 zthermal = r alpha / ( rcp * zrhos + epsln )457 zhalin = r beta * sn(ji,jj,1) * rcs449 zthermal = rn_alpha / ( rcp * zrhos + epsln ) 450 zhalin = rn_beta * sn(ji,jj,1) * rcs 458 451 ENDIF 459 452 ! Radiative surface buoyancy force … … 468 461 ENDDO 469 462 470 zflageos = 0.5 + SIGN( 0.5, n eos - 1. )463 zflageos = 0.5 + SIGN( 0.5, nn_eos - 1. ) 471 464 ! Compute surface buoyancy forcing, Monin Obukhov and Ekman depths 472 465 !------------------------------------------------------------------ … … 597 590 ! potential density of water(ztref,zsref at level jk): 598 591 ! compute volumic mass pure water at atm pressure 599 IF ( n eos < 1 ) THEN592 IF ( nn_eos < 1 ) THEN 600 593 zr1= ( ( ( ( 6.536332e-9*zt-1.120083e-6 )*zt+1.001685e-4)*zt & 601 594 & -9.095290e-3 )*zt+6.793952e-2 )*zt+999.842594 … … 1345 1338 ll_kpplktb ! Lookup table for turbul. velocity scales 1346 1339 !! 1347 NAMELIST/nam _kpp/ ln_kpprimix, rn_difmiw, rn_difsiw, rn_riinfty, rn_difri, rn_bvsqcon, rn_difcon, nn_ave1340 NAMELIST/namzdf_kpp/ ln_kpprimix, rn_difmiw, rn_difsiw, rn_riinfty, rn_difri, rn_bvsqcon, rn_difcon, nn_ave 1348 1341 !!---------------------------------------------------------------------- 1349 1342 1350 1343 REWIND ( numnam ) ! Read Namelist namkpp : K-Profile Parameterisation 1351 READ ( numnam, nam _kpp )1344 READ ( numnam, namzdf_kpp ) 1352 1345 1353 1346 IF(lwp) THEN ! Control print … … 1355 1348 WRITE(numout,*) 'zdf_kpp_init : K-Profile Parameterisation' 1356 1349 WRITE(numout,*) '~~~~~~~~~~~~' 1357 WRITE(numout,*) ' Namelist nam _kpp : set tke mixing parameters'1350 WRITE(numout,*) ' Namelist namzdf_kpp : set tke mixing parameters' 1358 1351 WRITE(numout,*) ' Shear instability mixing ln_kpprimix = ', ln_kpprimix 1359 1352 WRITE(numout,*) ' max. internal wave viscosity rn_difmiw = ', rn_difmiw -
trunk/NEMO/OPA_SRC/ZDF/zdfric.F90
r1537 r1601 5 5 !! Richardson number dependent formulation 6 6 !!====================================================================== 7 !! History : OPA ! 1987-09 (P. Andrich) Original code 8 !! 4.0 ! 1991-11 (G. Madec) 9 !! 7.0 ! 1996-01 (G. Madec) complet rewriting of multitasking suppression of common work arrays 10 !! 8.0 ! 1997-06 (G. Madec) complete rewriting of zdfmix 11 !! NEMO 1.0 ! 2002-06 (G. Madec) F90: Free form and module 12 !!---------------------------------------------------------------------- 7 13 #if defined key_zdfric || defined key_esopa 8 14 !!---------------------------------------------------------------------- … … 26 32 LOGICAL, PUBLIC, PARAMETER :: lk_zdfric = .TRUE. !: Richardson vertical mixing flag 27 33 28 ! !!* Namelist nam _ric : Richardson number dependent Kz *29 INTEGER :: nn_ric = 2! coefficient of the parameterization34 ! !!* Namelist namzdf_ric : Richardson number dependent Kz * 35 INTEGER :: nn_ric = 2 ! coefficient of the parameterization 30 36 REAL(wp) :: rn_avmri = 100.e-4_wp ! maximum value of the vertical eddy viscosity 31 37 REAL(wp) :: rn_alp = 5._wp ! coefficient of the parameterization … … 47 53 !! 48 54 !! ** Purpose : Compute the before eddy viscosity and diffusivity as 49 !! a function of the local richardson number.55 !! a function of the local richardson number. 50 56 !! 51 57 !! ** Method : Local richardson number dependent formulation of the 52 !! vertical eddy viscosity and diffusivity coefficients. the eddy53 !! coefficients are given by:54 !! avm = avm0 + avmb55 !! avt = avm0 / (1 + rn_alp*ri)56 !! withri = N^2 / dz(u)**257 !! = e3w**2 * rn2/[ mi( dk(ub) )+mj( dk(vb) ) ]58 !! avm0= rn_avmri / (1 + rn_alp*ri)**nn_ric59 !! Where ri is the before local Richardson number, rn_avmri the maximum60 !! value reaches by the vertical eddy coefficients, avmb and avtb61 !! the background (or minimum) values of these coefficients for62 !! momemtum and tracers,and rn_alp, nn_ric are adjustable parameters.63 !! typical values used are : avm0=1.e-2 m2/s, avmb=1.e-6 m2/s58 !! vertical eddy viscosity and diffusivity coefficients. 59 !! The eddy coefficients are given by: 60 !! avm = avm0 + avmb 61 !! avt = avm0 / (1 + rn_alp*ri) 62 !! with ri = N^2 / dz(u)**2 63 !! = e3w**2 * rn2/[ mi( dk(ub) )+mj( dk(vb) ) ] 64 !! avm0= rn_avmri / (1 + rn_alp*ri)**nn_ric 65 !! Where ri is the before local Richardson number, 66 !! rn_avmri is the maximum value reaches by avm and avt 67 !! avmb and avtb are the background (or minimum) values 68 !! and rn_alp, nn_ric are adjustable parameters. 69 !! Typical values used are : avm0=1.e-2 m2/s, avmb=1.e-6 m2/s 64 70 !! avtb=1.e-7 m2/s, rn_alp=5. and nn_ric=2. 65 !! this formulation needs ri>=0 : ri is set to zero if dz(rau)<0.66 71 !! a numerical threshold is impose on the vertical shear (1.e-20) 67 72 !! N.B. the mask are required for implicit scheme, and surface 68 !! and bottom value already set in inimix.F 69 !! 70 !! References : 71 !! pacanowski & philander 1981, j. phys. oceanogr., 1441-1451. 72 !! History : 73 !! ! 87-09 (P. Andrich) Original code 74 !! ! 91-11 (G. Madec) 75 !! ! 93-03 (M. Guyon) symetrical conditions 76 !! ! 96-01 (G. Madec) complet rewriting of multitasking 77 !! suppression of common work arrays 78 !! ! 97-06 (G. Madec) complete rewriting of zdfmix 79 !! 8.5 ! 02-06 (G. Madec) F90: Free form and module 73 !! and bottom value already set in zdfini.F90 74 !! 75 !! References : Pacanowski & Philander 1981, JPO, 1441-1451. 80 76 !!---------------------------------------------------------------------- 81 77 INTEGER, INTENT( in ) :: kt ! ocean time-step indexocean time step … … 93 89 ! Richardson number (put in zwx(ji,jj)) 94 90 ! ----------------- 95 ! minimum value set to zero96 91 DO jj = 2, jpjm1 97 92 DO ji = 2, jpim1 98 93 zcoef = 0.5 / fse3w(ji,jj,jk) 99 ! shear of horizontal velocity94 ! ! shear of horizontal velocity 100 95 zdku = zcoef * ( ub(ji-1,jj,jk-1) + ub(ji,jj,jk-1) & 101 96 & -ub(ji-1,jj,jk ) - ub(ji,jj,jk ) ) 102 97 zdkv = zcoef * ( vb(ji,jj-1,jk-1) + vb(ji,jj,jk-1) & 103 98 & -vb(ji,jj-1,jk ) - vb(ji,jj,jk ) ) 104 ! richardson number (minimum value set to zero)99 ! ! richardson number (minimum value set to zero) 105 100 zri = rn2(ji,jj,jk) / ( zdku*zdku + zdkv*zdkv + 1.e-20 ) 106 101 zwx(ji,jj) = MAX( zri, 0.e0 ) 107 102 END DO 108 103 END DO 109 110 ! Boundary condition on zwx (sign unchanged) 111 CALL lbc_lnk( zwx, 'W', 1. ) 104 CALL lbc_lnk( zwx, 'W', 1. ) ! Boundary condition (sign unchanged) 112 105 113 106 114 107 ! Vertical eddy viscosity and diffusivity coefficients 115 108 ! ------------------------------------------------------- 116 ! Eddy viscosity coefficients117 109 z05alp = 0.5 * rn_alp 118 DO jj = 1, jpjm1 110 DO jj = 1, jpjm1 ! Eddy viscosity coefficients (avm) 119 111 DO ji = 1, jpim1 120 112 avmu(ji,jj,jk) = umask(ji,jj,jk) & … … 124 116 END DO 125 117 END DO 126 127 ! Eddy diffusivity coefficients 128 DO jj = 2, jpjm1 118 DO jj = 2, jpjm1 ! Eddy diffusivity coefficients (avt) 129 119 DO ji = 2, jpim1 130 120 avt(ji,jj,jk) = tmric(ji,jj,jk) / ( 1. + rn_alp * zwx(ji,jj) ) & … … 132 122 & + avmv(ji,jj,jk) + avmv( ji ,jj-1,jk) ) & 133 123 & + avtb(jk) * tmask(ji,jj,jk) 134 END DO 135 END DO 136 137 ! Add the background coefficient on eddy viscosity 138 DO jj = 2, jpjm1 139 DO ji = 2, jpim1 124 ! ! Add the background coefficient on eddy viscosity 140 125 avmu(ji,jj,jk) = avmu(ji,jj,jk) + avmb(jk) * umask(ji,jj,jk) 141 126 avmv(ji,jj,jk) = avmv(ji,jj,jk) + avmb(jk) * vmask(ji,jj,jk) … … 145 130 END DO ! End of slab 146 131 ! ! =============== 147 148 ! Boundary conditions on (avt,avmu,avmv) (unchanged sign) 149 ! -----------------------=============== 150 CALL lbc_lnk( avt , 'W', 1. ) 151 CALL lbc_lnk( avmu, 'U', 1. ) 152 CALL lbc_lnk( avmv, 'V', 1. ) 153 132 ! 133 CALL lbc_lnk( avt , 'W', 1. ) ! Boundary conditions (unchanged sign) 134 CALL lbc_lnk( avmu, 'U', 1. ) ; CALL lbc_lnk( avmv, 'V', 1. ) 135 ! 154 136 END SUBROUTINE zdf_ric 155 137 … … 162 144 !! viscosity coef. for the Richardson number dependent formulation. 163 145 !! 164 !! ** Method : Read the nam ric namelist and check the parameter values165 !! 166 !! ** input : Namelist nam ric146 !! ** Method : Read the namzdf_ric namelist and check the parameter values 147 !! 148 !! ** input : Namelist namzdf_ric 167 149 !! 168 150 !! ** Action : increase by 1 the nstop flag is setting problem encounter 169 !!170 !! history :171 !! 8.5 ! 02-06 (G. Madec) original code172 151 !!---------------------------------------------------------------------- 173 152 INTEGER :: ji, jj, jk ! dummy loop indices 174 153 !! 175 NAMELIST/nam _ric/ rn_avmri, rn_alp, nn_ric176 !!---------------------------------------------------------------------- 177 178 REWIND ( numnam ) ! Read Namelist nam_ric : richardson number dependent Kz179 READ ( numnam, nam_ric )180 181 IF(lwp) THEN 154 NAMELIST/namzdf_ric/ rn_avmri, rn_alp, nn_ric 155 !!---------------------------------------------------------------------- 156 ! 157 REWIND( numnam ) ! Read Namelist namzdf_ric : richardson number dependent Kz 158 READ ( numnam, namzdf_ric ) 159 ! 160 IF(lwp) THEN ! Control print 182 161 WRITE(numout,*) 183 162 WRITE(numout,*) 'zdf_ric : Ri depend vertical mixing scheme' 184 163 WRITE(numout,*) '~~~~~~~' 185 WRITE(numout,*) ' Namelist nam ric : set Kz(Ri) parameters'164 WRITE(numout,*) ' Namelist namzdf_ric : set Kz(Ri) parameters' 186 165 WRITE(numout,*) ' maximum vertical viscosity rn_avmri = ', rn_avmri 187 166 WRITE(numout,*) ' coefficient rn_alp = ', rn_alp 188 167 WRITE(numout,*) ' coefficient nn_ric = ', nn_ric 189 168 ENDIF 190 191 ! weighting mean array tmric for 4 T-points which accounts for coastal boundary conditions. 192 DO jk = 1, jpk 193 DO jj = 2, jpj 169 ! 170 DO jk = 1, jpk ! weighting mean array tmric for 4 T-points which accounts for coastal boundary conditions. 171 DO jj = 2, jpj 194 172 DO ji = 2, jpi 195 173 tmric(ji,jj,jk) = tmask(ji,jj,jk) & 196 197 174 & / MAX( 1., umask(ji-1,jj ,jk) + umask(ji,jj,jk) & 175 & + vmask(ji ,jj-1,jk) + vmask(ji,jj,jk) ) 198 176 END DO 199 177 END DO 200 178 END DO 201 179 tmric(:,1,:) = 0.e0 202 203 ! Initialization of vertical eddy coef. to the background value 204 DO jk = 1, jpk 180 ! 181 DO jk = 1, jpk ! Initialization of vertical eddy coef. to the background value 205 182 avt (:,:,jk) = avtb(jk) * tmask(:,:,jk) 206 183 avmu(:,:,jk) = avmb(jk) * umask(:,:,jk) 207 184 avmv(:,:,jk) = avmb(jk) * vmask(:,:,jk) 208 185 END DO 209 186 ! 210 187 END SUBROUTINE zdf_ric_init 211 188 -
trunk/NEMO/OPA_SRC/ZDF/zdftke.F90
r1537 r1601 63 63 #endif 64 64 65 ! !!! ** Namelist nam _tke **65 ! !!! ** Namelist namzdf_tke ** 66 66 LOGICAL :: ln_mxl0 = .FALSE. ! mixing length scale surface value as function of wind stress or not 67 67 INTEGER :: nn_mxl = 2 ! type of mixing length (=0/1/2/3) … … 616 616 !! viscosity when using a tke turbulent closure scheme 617 617 !! 618 !! ** Method : Read the nam _tke namelist and check the parameters618 !! ** Method : Read the namzdf_tke namelist and check the parameters 619 619 !! called at the first timestep (nit000) 620 620 !! 621 !! ** input : Namlist nam _tke621 !! ** input : Namlist namzdf_tke 622 622 !! 623 623 !! ** Action : Increase by 1 the nstop flag is setting problem encounter … … 625 625 INTEGER :: ji, jj, jk ! dummy loop indices 626 626 !! 627 NAMELIST/nam _tke/ rn_ediff, rn_ediss , rn_ebb, rn_emin, &628 & rn_emin0, rn_bshear, nn_mxl, ln_mxl0, &629 & rn_lmin , rn_lmin0 , nn_pdl, nn_etau, &630 & nn_htau , rn_efr , ln_lc , rn_lc631 !!---------------------------------------------------------------------- 632 633 REWIND ( numnam ) !* Read Namelist nam _tke : Turbulente Kinetic Energy634 READ ( numnam, nam _tke )627 NAMELIST/namzdf_tke/ rn_ediff, rn_ediss , rn_ebb, rn_emin, & 628 & rn_emin0, rn_bshear, nn_mxl, ln_mxl0, & 629 & rn_lmin , rn_lmin0 , nn_pdl, nn_etau, & 630 & nn_htau , rn_efr , ln_lc , rn_lc 631 !!---------------------------------------------------------------------- 632 633 REWIND ( numnam ) !* Read Namelist namzdf_tke : Turbulente Kinetic Energy 634 READ ( numnam, namzdf_tke ) 635 635 636 636 ri_cri = 2. / ( 2. + rn_ediss / rn_ediff ) ! resulting critical Richardson number … … 640 640 WRITE(numout,*) 'zdf_tke : tke turbulent closure scheme - initialisation' 641 641 WRITE(numout,*) '~~~~~~~~' 642 WRITE(numout,*) ' Namelist nam_tke : set tke mixing parameters'643 WRITE(numout,*) ' coef. to compute avtrn_ediff = ', rn_ediff644 WRITE(numout,*) ' Kolmogoroff dissipation coef.rn_ediss = ', rn_ediss645 WRITE(numout,*) ' tke surface input coef.rn_ebb = ', rn_ebb646 WRITE(numout,*) ' minimum value of tkern_emin = ', rn_emin647 WRITE(numout,*) ' surface minimum value of tkern_emin0 = ', rn_emin0648 WRITE(numout,*) ' background shear (>0)rn_bshear= ', rn_bshear649 WRITE(numout,*) ' mixing length typenn_mxl = ', nn_mxl650 WRITE(numout,*) ' prandl number flagnn_pdl = ', nn_pdl651 WRITE(numout,*) ' surface mixing length = F(stress) or notln_mxl0 = ', ln_mxl0652 WRITE(numout,*) ' surface mixing length minimum valuern_lmin0 = ', rn_lmin0653 WRITE(numout,*) ' interior mixing length minimum valuern_lmin0 = ', rn_lmin0654 WRITE(numout,*) ' test param. to add tke induced by windnn_etau = ', nn_etau655 WRITE(numout,*) ' flag for computation of exp. tke profilenn_htau = ', nn_htau656 WRITE(numout,*) ' % of rn_emin0 which pene. the thermoclinern_efr = ', rn_efr657 WRITE(numout,*) ' flag to take into acc. Langmuir circ.ln_lc = ', ln_lc658 WRITE(numout,*) ' coef to compute verticla velocity of LCrn_lc = ', rn_lc642 WRITE(numout,*) ' Namelist namzdf_tke : set tke mixing parameters' 643 WRITE(numout,*) ' coef. to compute avt rn_ediff = ', rn_ediff 644 WRITE(numout,*) ' Kolmogoroff dissipation coef. rn_ediss = ', rn_ediss 645 WRITE(numout,*) ' tke surface input coef. rn_ebb = ', rn_ebb 646 WRITE(numout,*) ' minimum value of tke rn_emin = ', rn_emin 647 WRITE(numout,*) ' surface minimum value of tke rn_emin0 = ', rn_emin0 648 WRITE(numout,*) ' background shear (>0) rn_bshear= ', rn_bshear 649 WRITE(numout,*) ' mixing length type nn_mxl = ', nn_mxl 650 WRITE(numout,*) ' prandl number flag nn_pdl = ', nn_pdl 651 WRITE(numout,*) ' surface mixing length = F(stress) or not ln_mxl0 = ', ln_mxl0 652 WRITE(numout,*) ' surface mixing length minimum value rn_lmin0 = ', rn_lmin0 653 WRITE(numout,*) ' interior mixing length minimum value rn_lmin0 = ', rn_lmin0 654 WRITE(numout,*) ' test param. to add tke induced by wind nn_etau = ', nn_etau 655 WRITE(numout,*) ' flag for computation of exp. tke profile nn_htau = ', nn_htau 656 WRITE(numout,*) ' % of rn_emin0 which pene. the thermocline rn_efr = ', rn_efr 657 WRITE(numout,*) ' flag to take into acc. Langmuir circ. ln_lc = ', ln_lc 658 WRITE(numout,*) ' coef to compute verticla velocity of LC rn_lc = ', rn_lc 659 659 WRITE(numout,*) 660 WRITE(numout,*) ' critical Richardson nb with your choice of coefs.= ', ri_cri660 WRITE(numout,*) ' critical Richardson nb with your parameters ri_cri = ', ri_cri 661 661 ENDIF 662 662 … … 671 671 ! !* depth of penetration of surface tke 672 672 IF( nn_etau /= 0 ) THEN 673 SELECT CASE( nn_htau ) ! Choice of the depth of penetration673 SELECT CASE( nn_htau ) ! Choice of the depth of penetration 674 674 CASE( 0 ) ! constant depth penetration (here 10 meters) 675 675 htau(:,:) = 10.e0 … … 760 760 ! ! ------------------- 761 761 IF(lwp) WRITE(numout,*) '---- tke-rst ----' 762 CALL iom_rstput( kt, nitrst, numrow, 'en' , en 763 CALL iom_rstput( kt, nitrst, numrow, 'avt' , avt 764 CALL iom_rstput( kt, nitrst, numrow, 'avm' , avm 765 CALL iom_rstput( kt, nitrst, numrow, 'avmu' , avmu 766 CALL iom_rstput( kt, nitrst, numrow, 'avmv' , avmv 767 CALL iom_rstput( kt, nitrst, numrow, 'dissl', dissl 762 CALL iom_rstput( kt, nitrst, numrow, 'en' , en ) 763 CALL iom_rstput( kt, nitrst, numrow, 'avt' , avt ) 764 CALL iom_rstput( kt, nitrst, numrow, 'avm' , avm ) 765 CALL iom_rstput( kt, nitrst, numrow, 'avmu' , avmu ) 766 CALL iom_rstput( kt, nitrst, numrow, 'avmv' , avmv ) 767 CALL iom_rstput( kt, nitrst, numrow, 'dissl', dissl ) 768 768 ! 769 769 ENDIF -
trunk/NEMO/OPA_SRC/ZDF/zdftke_old.F90
r1537 r1601 65 65 #endif 66 66 67 ! !!! ** Namelist nam _tke **67 ! !!! ** Namelist namzdf_tke ** 68 68 LOGICAL :: ln_rstke = .FALSE. ! =T restart with tke from a run without tke 69 69 LOGICAL :: ln_mxl0 = .FALSE. ! mixing length scale surface value as function of wind stress or not … … 710 710 !! viscosity when using a tke turbulent closure scheme 711 711 !! 712 !! ** Method : Read the nam _tke namelist and check the parameters712 !! ** Method : Read the namzdf_tke namelist and check the parameters 713 713 !! called at the first timestep (nit000) 714 714 !! 715 !! ** input : Namlist nam _tke715 !! ** input : Namlist namzdf_tke 716 716 !! 717 717 !! ** Action : Increase by 1 the nstop flag is setting problem encounter … … 727 727 # endif 728 728 !! 729 NAMELIST/nam _tke/ ln_rstke, rn_ediff, rn_ediss, rn_ebb , rn_efave, rn_emin, &730 & rn_emin0, rn_cri , nn_itke , nn_mxl , nn_pdl , nn_ave , &731 & ln_mxl0 , rn_lmin , rn_lmin0, nn_etau, &732 & nn_htau , rn_efr , ln_lc , rn_lc729 NAMELIST/namzdf_tke/ ln_rstke, rn_ediff, rn_ediss, rn_ebb , rn_efave, rn_emin, & 730 & rn_emin0, rn_cri , nn_itke , nn_mxl , nn_pdl , nn_ave , & 731 & ln_mxl0 , rn_lmin , rn_lmin0, nn_etau, & 732 & nn_htau , rn_efr , ln_lc , rn_lc 733 733 !!---------------------------------------------------------------------- 734 734 735 ! Read Namelist nam _tke : Turbulente Kinetic Energy735 ! Read Namelist namzdf_tke : Turbulente Kinetic Energy 736 736 ! -------------------- 737 737 REWIND ( numnam ) 738 READ ( numnam, nam _tke )738 READ ( numnam, namzdf_tke ) 739 739 740 740 ! Compute boost associated with the Richardson critic … … 752 752 WRITE(numout,*) 'zdf_tke_init : tke turbulent closure scheme (old scheme)' 753 753 WRITE(numout,*) '~~~~~~~~~~~~' 754 WRITE(numout,*) ' Namelist nam _tke : set tke mixing parameters'754 WRITE(numout,*) ' Namelist namzdf_tke : set tke mixing parameters' 755 755 WRITE(numout,*) ' restart with tke from no tke ln_rstke = ', ln_rstke 756 756 WRITE(numout,*) ' coef. to compute avt rn_ediff = ', rn_ediff -
trunk/NEMO/OPA_SRC/ZDF/zdftmx.F90
r1546 r1601 31 31 LOGICAL, PUBLIC, PARAMETER :: lk_zdftmx = .TRUE. !: tidal mixing flag 32 32 33 ! !!* Namelist nam tmx : tidal mixing *33 ! !!* Namelist namzdf_tmx : tidal mixing * 34 34 REAL(wp) :: rn_htmx = 500. ! vertical decay scale for turbulence (meters) 35 35 REAL(wp) :: rn_n2min = 1.e-8 ! threshold of the Brunt-Vaisala frequency (s-1) … … 88 88 !! Koch-Larrouy et al. 2007, GRL. 89 89 !!---------------------------------------------------------------------- 90 USE oce, zav_tide => ua! use ua as workspace90 USE oce, zav_tide => ua ! use ua as workspace 91 91 !! 92 92 INTEGER, INTENT(in) :: kt ! ocean time-step … … 329 329 REAL(wp), DIMENSION(jpi,jpj,jpk) :: zpc ! power consumption 330 330 !! 331 NAMELIST/nam _tmx/ rn_htmx, rn_n2min, rn_tfe, rn_me, ln_tmx_itf, rn_tfe_itf332 !!---------------------------------------------------------------------- 333 334 REWIND ( numnam )! Read Namelist namtmx : Tidal Mixing335 READ ( numnam, nam_tmx )331 NAMELIST/namzdf_tmx/ rn_htmx, rn_n2min, rn_tfe, rn_me, ln_tmx_itf, rn_tfe_itf 332 !!---------------------------------------------------------------------- 333 334 REWIND( numnam ) ! Read Namelist namtmx : Tidal Mixing 335 READ ( numnam, namzdf_tmx ) 336 336 337 337 IF(lwp) THEN ! Control print … … 339 339 WRITE(numout,*) 'zdf_tmx_init : tidal mixing' 340 340 WRITE(numout,*) '~~~~~~~~~~~~' 341 WRITE(numout,*) ' Namelist nam tmx : set tidal mixing parameters'341 WRITE(numout,*) ' Namelist namzdf_tmx : set tidal mixing parameters' 342 342 WRITE(numout,*) ' Vertical decay scale for turbulence = ', rn_htmx 343 343 WRITE(numout,*) ' Brunt-Vaisala frequency threshold = ', rn_n2min -
trunk/NEMO/OPA_SRC/eosbn2.F90
r1559 r1601 9 9 !! 6.0 ! 1994-08 (G. Madec) Add Jackett & McDougall eos 10 10 !! 7.0 ! 1996-01 (G. Madec) statement function for e3 11 !! 8.1 ! 1997-07 (G. Madec) introduction of neos, OPA8.112 11 !! 8.1 ! 1997-07 (G. Madec) density instead of volumic mass 13 12 !! - ! 1999-02 (G. Madec, N. Grima) semi-implicit pressure gradient … … 51 50 PUBLIC tfreez ! called by sbcice_... modules 52 51 53 ! !!* Namelist (nameos) * 54 INTEGER , PUBLIC :: neos = 0 !: = 0/1/2 type of eq. of state and Brunt-Vaisala frequ. 55 REAL(wp), PUBLIC :: ralpha = 2.0e-4 !: thermal expension coeff. (linear equation of state) 56 REAL(wp), PUBLIC :: rbeta = 7.7e-4 !: saline expension coeff. (linear equation of state) 52 ! !!* Namelist (nameos) * 53 INTEGER , PUBLIC :: nn_eos = 0 !: = 0/1/2 type of eq. of state and Brunt-Vaisala frequ. 54 REAL(wp), PUBLIC :: rn_alpha = 2.0e-4 !: thermal expension coeff. (linear equation of state) 55 REAL(wp), PUBLIC :: rn_beta = 7.7e-4 !: saline expension coeff. (linear equation of state) 56 57 57 REAL(wp), PUBLIC :: ralpbet !: alpha / beta ratio 58 58 … … 74 74 !! ** Purpose : Compute the in situ density (ratio rho/rau0) from 75 75 !! potential temperature and salinity using an equation of state 76 !! defined through the namelist parameter n eos.76 !! defined through the namelist parameter nn_eos. 77 77 !! 78 78 !! ** Method : 3 cases: 79 !! n eos = 0 : Jackett and McDougall (1994) equation of state.79 !! nn_eos = 0 : Jackett and McDougall (1994) equation of state. 80 80 !! the in situ density is computed directly as a function of 81 81 !! potential temperature relative to the surface (the opa t … … 92 92 !! Check value: rho = 1060.93298 kg/m**3 for p=10000 dbar, 93 93 !! t = 40 deg celcius, s=40 psu 94 !! n eos = 1 : linear equation of state function of temperature only95 !! prd(t) = 0.0285 - r alpha * t96 !! n eos = 2 : linear equation of state function of temperature and94 !! nn_eos = 1 : linear equation of state function of temperature only 95 !! prd(t) = 0.0285 - rn_alpha * t 96 !! nn_eos = 2 : linear equation of state function of temperature and 97 97 !! salinity 98 !! prd(t,s) = r beta * s - ralpha * tn - 1.98 !! prd(t,s) = rn_beta * s - rn_alpha * tn - 1. 99 99 !! Note that no boundary condition problem occurs in this routine 100 100 !! as (ptem,psal) are defined over the whole domain. … … 118 118 !!---------------------------------------------------------------------- 119 119 120 SELECT CASE( n eos )120 SELECT CASE( nn_eos ) 121 121 ! 122 122 CASE( 0 ) !== Jackett and McDougall (1994) formulation ==! … … 169 169 CASE( 1 ) !== Linear formulation function of temperature only ==! 170 170 DO jk = 1, jpkm1 171 prd(:,:,jk) = ( 0.0285 - r alpha * ptem(:,:,jk) ) * tmask(:,:,jk)171 prd(:,:,jk) = ( 0.0285 - rn_alpha * ptem(:,:,jk) ) * tmask(:,:,jk) 172 172 END DO 173 173 ! 174 174 CASE( 2 ) !== Linear formulation function of temperature and salinity ==! 175 175 DO jk = 1, jpkm1 176 prd(:,:,jk) = ( rbeta * psal(:,:,jk) - ralpha * ptem(:,:,jk) ) * tmask(:,:,jk) 177 END DO 178 ! 179 CASE DEFAULT 180 WRITE(ctmp1,*) ' bad flag value for neos = ', neos 181 CALL ctl_stop( ctmp1 ) 176 prd(:,:,jk) = ( rn_beta * psal(:,:,jk) - rn_alpha * ptem(:,:,jk) ) * tmask(:,:,jk) 177 END DO 182 178 ! 183 179 END SELECT … … 195 191 !! potential volumic mass (Kg/m3) from potential temperature and 196 192 !! salinity fields using an equation of state defined through the 197 !! namelist parameter n eos.193 !! namelist parameter nn_eos. 198 194 !! 199 195 !! ** Method : 200 !! n eos = 0 : Jackett and McDougall (1994) equation of state.196 !! nn_eos = 0 : Jackett and McDougall (1994) equation of state. 201 197 !! the in situ density is computed directly as a function of 202 198 !! potential temperature relative to the surface (the opa t … … 216 212 !! t = 40 deg celcius, s=40 psu 217 213 !! 218 !! n eos = 1 : linear equation of state function of temperature only219 !! prd(t) = ( rho(t) - rau0 ) / rau0 = 0.028 - r alpha * t214 !! nn_eos = 1 : linear equation of state function of temperature only 215 !! prd(t) = ( rho(t) - rau0 ) / rau0 = 0.028 - rn_alpha * t 220 216 !! rhop(t,s) = rho(t,s) 221 217 !! 222 !! n eos = 2 : linear equation of state function of temperature and218 !! nn_eos = 2 : linear equation of state function of temperature and 223 219 !! salinity 224 220 !! prd(t,s) = ( rho(t,s) - rau0 ) / rau0 225 !! = r beta * s - ralpha * tn - 1.221 !! = rn_beta * s - rn_alpha * tn - 1. 226 222 !! rhop(t,s) = rho(t,s) 227 223 !! Note that no boundary condition problem occurs in this routine … … 245 241 !!---------------------------------------------------------------------- 246 242 247 SELECT CASE ( n eos )243 SELECT CASE ( nn_eos ) 248 244 ! 249 245 CASE( 0 ) !== Jackett and McDougall (1994) formulation ==! … … 299 295 CASE( 1 ) !== Linear formulation = F( temperature ) ==! 300 296 DO jk = 1, jpkm1 301 prd (:,:,jk) = ( 0.0285 - r alpha * ptem(:,:,jk) ) * tmask(:,:,jk)297 prd (:,:,jk) = ( 0.0285 - rn_alpha * ptem(:,:,jk) ) * tmask(:,:,jk) 302 298 prhop(:,:,jk) = ( 1.e0 + prd (:,:,jk) ) * rau0 * tmask(:,:,jk) 303 299 END DO … … 305 301 CASE( 2 ) !== Linear formulation = F( temperature , salinity ) ==! 306 302 DO jk = 1, jpkm1 307 prd (:,:,jk) = ( r beta * psal(:,:,jk) - ralpha * ptem(:,:,jk) ) * tmask(:,:,jk)303 prd (:,:,jk) = ( rn_beta * psal(:,:,jk) - rn_alpha * ptem(:,:,jk) ) * tmask(:,:,jk) 308 304 prhop(:,:,jk) = ( 1.e0 + prd (:,:,jk) ) * rau0 * tmask(:,:,jk) 309 305 END DO 310 !311 CASE DEFAULT312 WRITE(ctmp1,*) ' bad flag value for neos = ', neos313 CALL ctl_stop( ctmp1 )314 306 ! 315 307 END SELECT … … 326 318 !! ** Purpose : Compute the in situ density (ratio rho/rau0) from 327 319 !! potential temperature and salinity using an equation of state 328 !! defined through the namelist parameter n eos. * 2D field case320 !! defined through the namelist parameter nn_eos. * 2D field case 329 321 !! 330 322 !! ** Method : 331 !! n eos = 0 : Jackett and McDougall (1994) equation of state.323 !! nn_eos = 0 : Jackett and McDougall (1994) equation of state. 332 324 !! the in situ density is computed directly as a function of 333 325 !! potential temperature relative to the surface (the opa t … … 344 336 !! Check value: rho = 1060.93298 kg/m**3 for p=10000 dbar, 345 337 !! t = 40 deg celcius, s=40 psu 346 !! n eos = 1 : linear equation of state function of temperature only347 !! prd(t) = 0.0285 - r alpha * t348 !! n eos = 2 : linear equation of state function of temperature and338 !! nn_eos = 1 : linear equation of state function of temperature only 339 !! prd(t) = 0.0285 - rn_alpha * t 340 !! nn_eos = 2 : linear equation of state function of temperature and 349 341 !! salinity 350 !! prd(t,s) = r beta * s - ralpha * tn - 1.342 !! prd(t,s) = rn_beta * s - rn_alpha * tn - 1. 351 343 !! Note that no boundary condition problem occurs in this routine 352 344 !! as (ptem,psal) are defined over the whole domain. … … 369 361 prd(:,:) = 0.e0 370 362 371 SELECT CASE( n eos )363 SELECT CASE( nn_eos ) 372 364 ! 373 365 CASE( 0 ) !== Jackett and McDougall (1994) formulation ==! … … 424 416 DO jj = 1, jpjm1 425 417 DO ji = 1, fs_jpim1 ! vector opt. 426 prd(ji,jj) = ( 0.0285 - r alpha * ptem(ji,jj) ) * tmask(ji,jj,1)418 prd(ji,jj) = ( 0.0285 - rn_alpha * ptem(ji,jj) ) * tmask(ji,jj,1) 427 419 END DO 428 420 END DO … … 431 423 DO jj = 1, jpjm1 432 424 DO ji = 1, fs_jpim1 ! vector opt. 433 prd(ji,jj) = ( rbeta * psal(ji,jj) - ralpha * ptem(ji,jj) ) * tmask(ji,jj,1) 434 END DO 435 END DO 436 ! 437 CASE DEFAULT 438 WRITE(ctmp1,*) ' bad flag value for neos = ', neos 439 CALL ctl_stop( ctmp1 ) 425 prd(ji,jj) = ( rn_beta * psal(ji,jj) - rn_alpha * ptem(ji,jj) ) * tmask(ji,jj,1) 426 END DO 427 END DO 440 428 ! 441 429 END SELECT … … 454 442 !! 455 443 !! ** Method : 456 !! * n eos = 0 : UNESCO sea water properties444 !! * nn_eos = 0 : UNESCO sea water properties 457 445 !! The brunt-vaisala frequency is computed using the polynomial 458 446 !! polynomial expression of McDougall (1987): … … 461 449 !! computed and used in zdfddm module : 462 450 !! Rrau = alpha/beta * ( dk[ t ] / dk[ s ] ) 463 !! * n eos = 1 : linear equation of state (temperature only)464 !! N^2 = grav * r alpha * dk[ t ]/e3w465 !! * n eos = 2 : linear equation of state (temperature & salinity)466 !! N^2 = grav * (r alpha * dk[ t ] - rbeta * dk[ s ] ) / e3w451 !! * nn_eos = 1 : linear equation of state (temperature only) 452 !! N^2 = grav * rn_alpha * dk[ t ]/e3w 453 !! * nn_eos = 2 : linear equation of state (temperature & salinity) 454 !! N^2 = grav * (rn_alpha * dk[ t ] - rn_beta * dk[ s ] ) / e3w 467 455 !! The use of potential density to compute N^2 introduces e r r o r 468 456 !! in the sign of N^2 at great depths. We recommand the use of 469 !! n eos = 0, except for academical studies.457 !! nn_eos = 0, except for academical studies. 470 458 !! Macro-tasked on horizontal slab (jk-loop) 471 459 !! N.B. N^2 is set to zero at the first level (JK=1) in inidtr … … 490 478 ! -------------------------- 491 479 ! 492 SELECT CASE( n eos )480 SELECT CASE( nn_eos ) 493 481 ! 494 482 CASE( 0 ) !== Jackett and McDougall (1994) formulation ==! … … 541 529 CASE( 1 ) !== Linear formulation = F( temperature ) ==! 542 530 DO jk = 2, jpkm1 543 pn2(:,:,jk) = grav * r alpha * ( ptem(:,:,jk-1) - ptem(:,:,jk) ) / fse3w(:,:,jk) * tmask(:,:,jk)531 pn2(:,:,jk) = grav * rn_alpha * ( ptem(:,:,jk-1) - ptem(:,:,jk) ) / fse3w(:,:,jk) * tmask(:,:,jk) 544 532 END DO 545 533 ! 546 534 CASE( 2 ) !== Linear formulation = F( temperature , salinity ) ==! 547 535 DO jk = 2, jpkm1 548 pn2(:,:,jk) = grav * ( r alpha * ( ptem(:,:,jk-1) - ptem(:,:,jk) ) &549 & - r beta * ( psal(:,:,jk-1) - psal(:,:,jk) ) ) &536 pn2(:,:,jk) = grav * ( rn_alpha * ( ptem(:,:,jk-1) - ptem(:,:,jk) ) & 537 & - rn_beta * ( psal(:,:,jk-1) - psal(:,:,jk) ) ) & 550 538 & / fse3w(:,:,jk) * tmask(:,:,jk) 551 539 END DO … … 561 549 END DO 562 550 #endif 563 !564 CASE DEFAULT565 WRITE(ctmp1,*) ' bad flag value for neos = ', neos566 CALL ctl_stop( ctmp1 )567 !568 551 END SELECT 569 552 … … 606 589 !! ** Method : Read the namelist nameos and control the parameters 607 590 !!---------------------------------------------------------------------- 608 NAMELIST/nameos/ n eos, ralpha, rbeta591 NAMELIST/nameos/ nn_eos, rn_alpha, rn_beta 609 592 !!---------------------------------------------------------------------- 610 593 ! … … 617 600 WRITE(numout,*) '~~~~~~~~' 618 601 WRITE(numout,*) ' Namelist nameos : set eos parameters' 619 WRITE(numout,*) ' flag for eq. of state and N^2 n eos = ', neos620 WRITE(numout,*) ' thermal exp. coef. (linear) r alpha = ', ralpha621 WRITE(numout,*) ' saline exp. coef. (linear) r beta = ', rbeta602 WRITE(numout,*) ' flag for eq. of state and N^2 nn_eos = ', nn_eos 603 WRITE(numout,*) ' thermal exp. coef. (linear) rn_alpha = ', rn_alpha 604 WRITE(numout,*) ' saline exp. coef. (linear) rn_beta = ', rn_beta 622 605 ENDIF 623 606 ! 624 SELECT CASE( n eos )625 ! 626 CASE( 0 ) !== Jackett and McDougall (1994) formulation ==!607 SELECT CASE( nn_eos ) ! check option 608 ! 609 CASE( 0 ) !== Jackett and McDougall (1994) formulation ==! 627 610 IF(lwp) WRITE(numout,*) 628 611 IF(lwp) WRITE(numout,*) ' use of Jackett & McDougall (1994) equation of state and' 629 612 IF(lwp) WRITE(numout,*) ' McDougall (1987) Brunt-Vaisala frequency' 630 613 ! 631 CASE( 1 ) !== Linear formulation = F( temperature ) ==!614 CASE( 1 ) !== Linear formulation = F( temperature ) ==! 632 615 IF(lwp) WRITE(numout,*) 633 IF(lwp) WRITE(numout,*) ' use of linear eos rho(T) = rau0 * ( 1.0285 - r alpha * T )'616 IF(lwp) WRITE(numout,*) ' use of linear eos rho(T) = rau0 * ( 1.0285 - rn_alpha * T )' 634 617 IF( lk_zdfddm ) CALL ctl_stop( ' double diffusive mixing parameterization requires', & 635 618 & ' that T and S are used as state variables' ) 636 619 ! 637 CASE( 2 ) !== Linear formulation = F( temperature , salinity ) ==!638 ralpbet = r alpha / rbeta620 CASE( 2 ) !== Linear formulation = F( temperature , salinity ) ==! 621 ralpbet = rn_alpha / rn_beta 639 622 IF(lwp) WRITE(numout,*) 640 IF(lwp) WRITE(numout,*) ' use of linear eos rho(T,S) = rau0 * ( r beta * S - ralpha * T )'641 ! 642 CASE DEFAULT !== ERROR in neos ==!643 WRITE(ctmp1,*) ' bad flag value for n eos = ', neos623 IF(lwp) WRITE(numout,*) ' use of linear eos rho(T,S) = rau0 * ( rn_beta * S - rn_alpha * T )' 624 ! 625 CASE DEFAULT !== ERROR in nn_eos ==! 626 WRITE(ctmp1,*) ' bad flag value for nn_eos = ', nn_eos 644 627 CALL ctl_stop( ctmp1 ) 645 628 ! -
trunk/NEMO/OPA_SRC/lib_cray.f90
r1152 r1601 4 4 ! check their existence 5 5 ! 6 ! sdot7 6 ! wheneq 8 ! saxpy 9 ! isrchne 10 !!---------------------------------------------------------------------- 11 !! OPA 9.0 , LOCEAN-IPSL (2005) 12 !! $Id$ 13 !! This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt 14 !!---------------------------------------------------------------------- 15 !--------------------------------------------------------- 16 FUNCTION sdot( I, X, J, Y, K ) 17 DIMENSION X(1), Y(1) 18 SDOT = 0. 19 DO N = 1, I 20 SDOT = SDOT + X(1+(N-1)*J) * Y(1+(N-1)*K) 21 END DO 22 END FUNCTION sdot 23 !--------------------------------------------------------- 7 !!---------------------------------------------------------------------- 8 !! OPA 9.0 , LOCEAN-IPSL (2005) 9 !! $Id$ 10 !! This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt 11 !!---------------------------------------------------------------------- 24 12 SUBROUTINE wheneq ( i, x, j, t, ind, nn ) 25 13 IMPLICIT NONE … … 41 29 42 30 END SUBROUTINE wheneq 43 !---------------------------------------------------------44 SUBROUTINE saxpy( I, A, X, J, Y, K )45 DIMENSION X(1),Y(1)46 DO N = 1, I47 Y(1+(N-1)*K)=A*X(1+(N-1)*J)+Y(1+(N-1)*K)48 END DO49 END SUBROUTINE saxpy50 !---------------------------------------------------------51 FUNCTION isrchne( K, X, I, B )52 DIMENSION X(1)53 DO N = 1, K54 IF( X(1+(N-1)*I) /= B ) THEN55 ISRCHNE = N56 RETURN57 ELSE58 ISRCHNE = N + 159 ENDIF60 END DO61 END FUNCTION isrchne -
trunk/NEMO/OPA_SRC/lib_mpp.F90
r1579 r1601 139 139 140 140 ! Type of send : standard, buffered, immediate 141 CHARACTER(len=1) :: c _mpi_send = 'S' ! type od mpi send/recieve (S=standard, B=bsend, I=isend)142 LOGICAL :: l_isend = .FALSE. ! isend use indicator (T if c _mpi_send='I')141 CHARACTER(len=1) :: cn_mpi_send = 'S' ! type od mpi send/recieve (S=standard, B=bsend, I=isend) 142 LOGICAL :: l_isend = .FALSE. ! isend use indicator (T if cn_mpi_send='I') 143 143 INTEGER :: nn_buffer = 0 ! size of the buffer in case of mpi_bsend 144 144 … … 177 177 LOGICAL :: mpi_was_called 178 178 179 NAMELIST/nam _mpp/ c_mpi_send, nn_buffer179 NAMELIST/nammpp/ cn_mpi_send, nn_buffer 180 180 !!---------------------------------------------------------------------- 181 181 ! … … 183 183 WRITE(ldtxt(2),*) 'mynode : mpi initialisation' 184 184 WRITE(ldtxt(3),*) '~~~~~~ ' 185 WRITE(ldtxt(4),*)186 185 ! 187 186 REWIND( numnam ) ! Namelist namrun : parameters of the run 188 READ ( numnam, nam _mpp )187 READ ( numnam, nammpp ) 189 188 ! ! control print 190 WRITE(ldtxt(5),*) ' Namelist nam_mpp' 191 WRITE(ldtxt(6),*) ' mpi send type c_mpi_send = ', c_mpi_send 189 WRITE(ldtxt(4),*) ' Namelist nammpp' 190 WRITE(ldtxt(5),*) ' mpi send type cn_mpi_send = ', cn_mpi_send 191 WRITE(ldtxt(6),*) ' size in bytes of exported buffer nn_buffer = ', nn_buffer 192 192 193 193 #if defined key_agrif … … 205 205 IF( PRESENT(localComm) .and. mpi_was_called ) THEN 206 206 mpi_comm_opa = localComm 207 SELECT CASE ( c _mpi_send )207 SELECT CASE ( cn_mpi_send ) 208 208 CASE ( 'S' ) ! Standard mpi send (blocking) 209 209 WRITE(ldtxt(7),*) ' Standard blocking mpi send (send)' … … 216 216 CASE DEFAULT 217 217 WRITE(ldtxt(7),cform_err) 218 WRITE(ldtxt(8),*) ' bad value for c _mpi_send = ', c_mpi_send218 WRITE(ldtxt(8),*) ' bad value for cn_mpi_send = ', cn_mpi_send 219 219 nstop = nstop + 1 220 220 END SELECT … … 225 225 ELSE 226 226 #endif 227 SELECT CASE ( c _mpi_send )227 SELECT CASE ( cn_mpi_send ) 228 228 CASE ( 'S' ) ! Standard mpi send (blocking) 229 229 WRITE(ldtxt(7),*) ' Standard blocking mpi send (send)' … … 238 238 CASE DEFAULT 239 239 WRITE(ldtxt(7),cform_err) 240 WRITE(ldtxt(8),*) ' bad value for c _mpi_send = ', c_mpi_send240 WRITE(ldtxt(8),*) ' bad value for cn_mpi_send = ', cn_mpi_send 241 241 nstop = nstop + 1 242 242 END SELECT … … 254 254 #if defined key_agrif 255 255 ELSE 256 SELECT CASE ( c _mpi_send )256 SELECT CASE ( cn_mpi_send ) 257 257 CASE ( 'S' ) ! Standard mpi send (blocking) 258 258 WRITE(ldtxt(7),*) ' Standard blocking mpi send (send)' … … 264 264 CASE DEFAULT 265 265 WRITE(ldtxt(7),cform_err) 266 WRITE(ldtxt(8),*) ' bad value for c _mpi_send = ', c_mpi_send266 WRITE(ldtxt(8),*) ' bad value for cn_mpi_send = ', cn_mpi_send 267 267 nstop = nstop + 1 268 268 END SELECT … … 1044 1044 !!---------------------------------------------------------------------- 1045 1045 ! 1046 SELECT CASE ( c _mpi_send )1046 SELECT CASE ( cn_mpi_send ) 1047 1047 CASE ( 'S' ) ! Standard mpi send (blocking) 1048 1048 CALL mpi_send ( pmess, kbytes, mpi_double_precision, kdest , ktyp, mpi_comm_opa , iflag ) -
trunk/NEMO/OPA_SRC/mppini_2.h90
r1581 r1601 39 39 !! 9.0 ! 04-01 (G. Madec, J.M Molines) F90 : free form , north fold jpni > 1 40 40 !!---------------------------------------------------------------------- 41 !! * Modules used42 41 USE in_out_manager ! I/O Manager 43 42 USE iom 44 45 !! Local variables 43 !! 46 44 INTEGER :: ji, jj, jn, jproc, jarea ! dummy loop indices 47 45 INTEGER :: inum ! temporary logical unit … … 71 69 72 70 ! read namelist for ln_zco 73 NAMELIST/nam _zgr/ ln_zco, ln_zps, ln_sco71 NAMELIST/namzgr/ ln_zco, ln_zps, ln_sco 74 72 75 73 !!---------------------------------------------------------------------- … … 78 76 !! This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt 79 77 !!---------------------------------------------------------------------- 80 ! Read Namelist nam_zgr : vertical coordinate' 81 ! --------------------- 82 REWIND ( numnam ) 83 READ ( numnam, nam_zgr ) 78 79 REWIND ( numnam ) ! Read Namelist namzgr : vertical coordinate' 80 READ ( numnam, namzgr ) 84 81 85 82 IF(lwp)WRITE(numout,*) -
trunk/NEMO/OPA_SRC/oce.F90
r1528 r1601 13 13 PRIVATE 14 14 15 !! Physics and algorithm flags16 !! ---------------------------17 15 LOGICAL, PUBLIC :: l_traldf_rot = .FALSE. !: rotated laplacian operator for lateral diffusion 18 LOGICAL, PUBLIC :: ln_dynhpg_imp = .FALSE. !: semi-implicite hpg flag19 INTEGER, PUBLIC :: nn_dynhpg_rst = 0 !: add dynhpg implicit variables in restart ot not20 16 21 17 !! dynamics and tracer fields ! before ! now ! after ! the after trends becomes the fields -
trunk/NEMO/OPA_SRC/opa.F90
r1598 r1601 47 47 USE istate ! initial state setting (istate_init routine) 48 48 USE eosbn2 ! equation of state (eos_init routine) 49 USE dynhpg ! hydrostatic pressure gradient 49 50 USE ldfdyn ! lateral viscosity setting (ldfdyn_init routine) 50 51 USE ldftra ! lateral diffusivity setting (ldftra_init routine) … … 176 177 INTEGER :: ji ! local loop indices 177 178 !! 178 NAMELIST/namctl/ ln_ctl , nprint, nictls, nictle, &179 & isplt , jsplt , njctls, njctle, nbench, nbit_cmp179 NAMELIST/namctl/ ln_ctl , nn_print, nn_ictls, nn_ictle, & 180 & nn_isplt, nn_jsplt, nn_jctls, nn_jctle, nn_bench, nn_bit_cmp 180 181 !!---------------------------------------------------------------------- 181 182 ! … … 283 284 !! - Read in namilist namflg logical flags 284 285 !!---------------------------------------------------------------------- 285 NAMELIST/namflg/ ln_dynhpg_imp, nn_dynhpg_rst 286 !!---------------------------------------------------------------------- 287 288 IF(lwp) THEN ! Parameter print 286 NAMELIST/namdyn_hpg/ ln_hpg_zco , ln_hpg_zps , ln_hpg_sco, ln_hpg_hel, & 287 & ln_hpg_wdj , ln_hpg_djc , ln_hpg_rot, rn_gamma , & 288 & ln_dynhpg_imp, nn_dynhpg_rst 289 !!---------------------------------------------------------------------- 290 291 IF(lwp) THEN ! Parameter print 289 292 WRITE(numout,*) 290 293 WRITE(numout,*) 'opa_flg: Control prints & Benchmark' 291 294 WRITE(numout,*) '~~~~~~~ ' 292 295 WRITE(numout,*) ' Namelist namctl' 293 WRITE(numout,*) ' run control (for debugging) ln_ctl = ', ln_ctl 294 WRITE(numout,*) ' level of print nprint = ', nprint 295 WRITE(numout,*) ' Start i indice for SUM control nictls = ', nictls 296 WRITE(numout,*) ' End i indice for SUM control nictle = ', nictle 297 WRITE(numout,*) ' Start j indice for SUM control njctls = ', njctls 298 WRITE(numout,*) ' End j indice for SUM control njctle = ', njctle 299 WRITE(numout,*) ' number of proc. following i isplt = ', isplt 300 WRITE(numout,*) ' number of proc. following j jsplt = ', jsplt 301 WRITE(numout,*) ' benchmark parameter (0/1) nbench = ', nbench 302 WRITE(numout,*) ' bit comparison mode (0/1) nbit_cmp = ', nbit_cmp 303 ENDIF 296 WRITE(numout,*) ' run control (for debugging) ln_ctl = ', ln_ctl 297 WRITE(numout,*) ' level of print nn_print = ', nn_print 298 WRITE(numout,*) ' Start i indice for SUM control nn_ictls = ', nn_ictls 299 WRITE(numout,*) ' End i indice for SUM control nn_ictle = ', nn_ictle 300 WRITE(numout,*) ' Start j indice for SUM control nn_jctls = ', nn_jctls 301 WRITE(numout,*) ' End j indice for SUM control nn_jctle = ', nn_jctle 302 WRITE(numout,*) ' number of proc. following i nn_isplt = ', nn_isplt 303 WRITE(numout,*) ' number of proc. following j nn_jsplt = ', nn_jsplt 304 WRITE(numout,*) ' benchmark parameter (0/1) nn_bench = ', nn_bench 305 WRITE(numout,*) ' bit comparison mode (0/1) nn_bit_cmp = ', nn_bit_cmp 306 ENDIF 307 308 nprint = nn_print ! convert DOCTOR namelist names into OLD names 309 nictls = nn_ictls 310 nictle = nn_ictle 311 njctls = nn_jctls 312 njctle = nn_jctle 313 isplt = nn_isplt 314 jsplt = nn_jsplt 315 nbench = nn_bench 316 nbit_cmp = nn_bit_cmp 304 317 305 318 ! ! Parameter control … … 355 368 ENDIF 356 369 357 358 REWIND( numnam ) ! Read Namelist namflg : algorithm FLaG 359 READ ( numnam, namflg ) 360 361 IF(lwp) THEN ! Parameter print 362 WRITE(numout,*) 363 WRITE(numout,*) 'opa_flg : Hydrostatic pressure gradient algorithm' 364 WRITE(numout,*) '~~~~~~~' 365 WRITE(numout,*) ' Namelist namflg : hydrostatic pressure gradient time stepping' 366 WRITE(numout,*) ' centered (F) or semi-implicit (T) ln_dynhpg_imp = ', ln_dynhpg_imp 367 WRITE(numout,*) ' ensure restartability (=1) or not (=0) nn_dynhpg_rst = ', nn_dynhpg_rst 368 ENDIF 369 ! 370 IF( .NOT. ln_dynhpg_imp ) nn_dynhpg_rst = 0 ! force no adding dynhpg implicit variables in restart 370 REWIND( numnam ) ! Read Namelist namdyn_hpg : ln_dynhpg_imp must be read at the initialisation phase 371 READ ( numnam, namdyn_hpg ) 371 372 ! 372 373 END SUBROUTINE opa_flg
Note: See TracChangeset
for help on using the changeset viewer.