Changeset 3764
- Timestamp:
- 2013-01-23T15:33:04+01:00 (11 years ago)
- Location:
- branches/2012/dev_MERGE_2012
- Files:
-
- 1 added
- 1 deleted
- 61 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2012/dev_MERGE_2012/DOC/TexFiles/Biblio/Biblio.bib
r3680 r3764 1412 1412 } 1413 1413 1414 @ ARTICLE{Hunke2008,1414 @TECHREPORT{Hunke2008, 1415 1415 author = {E.C. Hunke and W.H. Lipscomb}, 1416 1416 title = {CICE: the Los Alamos sea ice model documentation and software user's manual, 1417 1417 Version 4.0}, 1418 institution = { Los Alamos National Laboratory, N.M.}, 1418 1419 publisher = {LA-CC-06-012, Los Alamos National Laboratory, N.M.}, 1419 1420 year = {2008} -
branches/2012/dev_MERGE_2012/DOC/TexFiles/Chapters/Chap_CFG.tex
r3294 r3764 31 31 32 32 % ================================================================ 33 % 1D model functionality33 % 1D model configuration 34 34 % ================================================================ 35 35 \section{Water column model: 1D model (C1D) (\key{c1d})} … … 48 48 49 49 The methodology is based on the use of the zoom functionality over the smallest possible 50 domain : a 3 x3 domain centred on the grid point of interest (see \S\ref{MISC_zoom}),50 domain : a 3x3 domain centred on the grid point of interest (see \S\ref{MISC_zoom}), 51 51 with some extra routines. There is no need to define a new mesh, bathymetry, 52 52 initial state or forcing, since the 1D model will use those of the configuration it is a zoom of. 53 The chosen grid point is set in par\_oce.F90module by setting the \jp{jpizoom} and \jp{jpjzoom}53 The chosen grid point is set in \mdl{par\_oce} module by setting the \jp{jpizoom} and \jp{jpjzoom} 54 54 parameters to the indices of the location of the chosen grid point. 55 55 56 The 1D model has some specifies. First, all the horizontal derivatives are assumed to be zero. 57 Therefore a simplified \rou{step} routine is used (\rou{step\_c1d}) in which both lateral tendancy 58 terms and lateral physics are not called, and the vertical velocity is zero (so far, no attempt at 59 introducing a Ekman pumping velocity has been made). 60 Second, the two components of the velocity are moved on a $T$-point. 61 This requires a specific treatment of the Coriolis term (see \rou{dyncor\_c1d}) and of the 62 dynamic time stepping (\rou{dynnxt\_c1d}). 63 All the relevant modules can be found in the NEMOGCM/NEMO/OPA\_SRC/C1D directory of 56 The 1D model has some specifies. First, all the horizontal derivatives are assumed to be zero, and 57 second, the two components of the velocity are moved on a $T$-point. 58 Therefore, defining \key{c1d} changes five main things in the code behaviour: 59 \begin{description} 60 \item[(1)] the lateral boundary condition routine (\rou{lbc\_lnk}) set the value of the central column 61 of the 3x3 domain is imposed over the whole domain ; 62 \item[(3)] a call to \rou{lbc\_lnk} is systematically done when reading input data ($i.e.$ in \mdl{iom}) ; 63 \item[(3)] a simplified \rou{stp} routine is used (\rou{stp\_c1d}, see \mdl{step\_c1d} module) in which 64 both lateral tendancy terms and lateral physics are not called ; 65 \item[(4)] the vertical velocity is zero (so far, no attempt at introducing a Ekman pumping velocity 66 has been made) ; 67 \item[(5)] a simplified treatment of the Coriolis term is performed as $U$- and $V$-points are the same 68 (see \mdl{dyncor\_c1d}). 69 \end{description} 70 All the relevant \textit{\_c1d} modules can be found in the NEMOGCM/NEMO/OPA\_SRC/C1D directory of 64 71 the \NEMO distribution. 65 72 … … 206 213 % ------------------------------------------------------------------------------------------------------------- 207 214 \section{GYRE family: double gyre basin (\key{gyre})} 208 \label{ MISC_config_gyre}215 \label{CFG_gyre} 209 216 210 217 The GYRE configuration \citep{Levy_al_OM10} have been built to simulated -
branches/2012/dev_MERGE_2012/DOC/TexFiles/Chapters/Chap_DIA.tex
r3680 r3764 1018 1018 In addition, a series of diagnostics has been added in the \mdl{diaar5}. 1019 1019 They corresponds to outputs that are required for AR5 simulations 1020 (see Section \ref{ MISC_steric} below for one of them).1020 (see Section \ref{DIA_steric} below for one of them). 1021 1021 Activating those outputs requires to define the \key{diaar5} CPP key. 1022 1022 \\ -
branches/2012/dev_MERGE_2012/DOC/TexFiles/Chapters/Chap_DOM.tex
r3680 r3764 499 499 Hybridation of the three main coordinates are available: $s-z$ or $s-zps$ coordinate 500 500 (Fig.~\ref{Fig_z_zps_s_sps}d and \ref{Fig_z_zps_s_sps}e). When using the variable 501 volume option \key{vvl} )($i.e.$ non-linear free surface), the coordinate follow the501 volume option \key{vvl} ($i.e.$ non-linear free surface), the coordinate follow the 502 502 time-variation of the free surface so that the transformation is time dependent: 503 503 $z(i,j,k,t)$ (Fig.~\ref{Fig_z_zps_s_sps}f). This option can be used with full step -
branches/2012/dev_MERGE_2012/DOC/TexFiles/Chapters/Chap_DYN.tex
r3294 r3764 127 127 This is of paramount importance. Replacing $T$ by the number $1$ in the tracer equation and summing 128 128 over the water column must lead to the sea surface height equation otherwise tracer content 129 will not be conserved \ ref{Griffies_al_MWR01, LeclairMadec2009}.129 will not be conserved \citep{Griffies_al_MWR01, Leclair_Madec_OM09}. 130 130 131 131 The vertical velocity is computed by an upward integration of the horizontal … … 189 189 the relative vorticity term and horizontal kinetic energy for the planetary vorticity 190 190 term (MIX scheme) ; or conserving both the potential enstrophy of horizontally non-divergent 191 flow and horizontal kinetic energy (EEN scheme) (see Appendix~\ref{Apdx_C_vor _zad}). In the191 flow and horizontal kinetic energy (EEN scheme) (see Appendix~\ref{Apdx_C_vorEEN}). In the 192 192 case of ENS, ENE or MIX schemes the land sea mask may be slightly modified to ensure the 193 193 consistency of vorticity term with analytical equations (\textit{ln\_dynvor\_con}=true). … … 331 331 This EEN scheme in fact combines the conservation properties of the ENS and ENE schemes. 332 332 It conserves both total energy and potential enstrophy in the limit of horizontally 333 nondivergent flow ($i.e.$ $\chi$=$0$) (see Appendix~\ref{Apdx_C_vor _zad}).333 nondivergent flow ($i.e.$ $\chi$=$0$) (see Appendix~\ref{Apdx_C_vorEEN}). 334 334 Applied to a realistic ocean configuration, it has been shown that it leads to a significant 335 335 reduction of the noise in the vertical velocity field \citep{Le_Sommer_al_OM09}. … … 938 938 is the \textit{before} velocity in time, except for the pure vertical component 939 939 that appears when a tensor of rotation is used. This latter term is solved 940 implicitly together with the vertical diffusion term (see \S\ref{ DOM_nxt})940 implicitly together with the vertical diffusion term (see \S\ref{STP}) 941 941 942 942 At the lateral boundaries either free slip, no slip or partial slip boundary … … 1066 1066 scheme (\np{ln\_zdfexp}=true) using a time splitting technique 1067 1067 (\np{nn\_zdfexp} $>$ 1) or $(b)$ a backward (or implicit) time differencing scheme 1068 (\np{ln\_zdfexp}=false) (see \S\ref{ DOM_nxt}). Note that namelist variables1068 (\np{ln\_zdfexp}=false) (see \S\ref{STP}). Note that namelist variables 1069 1069 \np{ln\_zdfexp} and \np{nn\_zdfexp} apply to both tracers and dynamics. 1070 1070 -
branches/2012/dev_MERGE_2012/DOC/TexFiles/Chapters/Chap_TRA.tex
r3308 r3764 264 264 transport) rather than TVD. The TVD scheme is implemented in the \mdl{traadv\_tvd} module. 265 265 266 For stability reasons (see \S\ref{ DOM_nxt}),266 For stability reasons (see \S\ref{STP}), 267 267 $\tau _u^{cen2}$ is evaluated in (\ref{Eq_tra_adv_tvd}) using the \textit{now} tracer while $\tau _u^{ups}$ 268 268 is evaluated using the \textit{before} tracer. In other words, the advective part of … … 337 337 \np{ln\_traadv\_ubs}=true. 338 338 339 For stability reasons (see \S\ref{ DOM_nxt}),339 For stability reasons (see \S\ref{STP}), 340 340 the first term in \eqref{Eq_tra_adv_ubs} (which corresponds to a second order centred scheme) 341 341 is evaluated using the \textit{now} tracer (centred in time) while the … … 451 451 except for the pure vertical component that appears when a rotation tensor 452 452 is used. This latter term is solved implicitly together with the 453 vertical diffusion term (see \S\ref{ DOM_nxt}).453 vertical diffusion term (see \S\ref{STP}). 454 454 455 455 % ------------------------------------------------------------------------------------------------------------- -
branches/2012/dev_MERGE_2012/DOC/TexFiles/Chapters/Chap_ZDF.tex
r3294 r3764 120 120 \end{equation} 121 121 122 is computed from the wind stress vector $|\tau|$ and the reference den dity $ \rho_o$.122 is computed from the wind stress vector $|\tau|$ and the reference density $ \rho_o$. 123 123 The final $h_{e}$ is further constrained by the adjustable bounds \np{rn\_mldmin} and \np{rn\_mldmax}. 124 124 Once $h_{e}$ is computed, the vertical eddy coefficients within $h_{e}$ are set to … … 1188 1188 \includegraphics[width=0.90\textwidth]{./TexFiles/Figures/Fig_ZDF_M2_K1_tmx.pdf} 1189 1189 \caption{ \label{Fig_ZDF_M2_K1_tmx} 1190 (a) M2 and (b) K 2internal wave drag energy from \citet{Carrere_Lyard_GRL03} ($W/m^2$). }1190 (a) M2 and (b) K1 internal wave drag energy from \citet{Carrere_Lyard_GRL03} ($W/m^2$). } 1191 1191 \end{center} \end{figure} 1192 1192 %>>>>>>>>>>>>>>>>>>>>>>>>>>>> … … 1205 1205 1206 1206 When \np{ln\_tmx\_itf}=true, the two key parameters $q$ and $F(z)$ are adjusted following 1207 the parameterisation developed by \ ref{Koch-Larrouy_al_GRL07}:1207 the parameterisation developed by \citet{Koch-Larrouy_al_GRL07}: 1208 1208 1209 1209 First, the Indonesian archipelago is a complex geographic region … … 1219 1219 Second, the vertical structure function, $F(z)$, is no more associated 1220 1220 with a bottom intensification of the mixing, but with a maximum of 1221 energy available within the thermocline. \ ref{Koch-Larrouy_al_GRL07}1221 energy available within the thermocline. \citet{Koch-Larrouy_al_GRL07} 1222 1222 have suggested that the vertical distribution of the energy dissipation 1223 1223 proportional to $N^2$ below the core of the thermocline and to $N$ above. … … 1236 1236 and vertical distributions of the mixing are adequately prescribed 1237 1237 \citep{Koch-Larrouy_al_GRL07, Koch-Larrouy_al_OD08a, Koch-Larrouy_al_OD08b}. 1238 Note also that such a parameterisation has a s ugnificant impact on the behaviour1238 Note also that such a parameterisation has a significant impact on the behaviour 1239 1239 of global coupled GCMs \citep{Koch-Larrouy_al_CD10}. 1240 1240 -
branches/2012/dev_MERGE_2012/DOC/TexFiles/Namelist/namasm
r3294 r3764 3 3 !----------------------------------------------------------------------- 4 4 ln_bkgwri = .false. ! Logical switch for writing out background state 5 ln_trjwri = .false. ! Logical switch for writing out state trajectory6 5 ln_trainc = .false. ! Logical switch for applying tracer increments 7 6 ln_dyninc = .false. ! Logical switch for applying velocity increments … … 14 13 nitiaufin = 15 ! Timestep of end of IAU interval in [0,nitend-nit000-1] 15 14 niaufn = 0 ! Type of IAU weighting function 16 nittrjfrq = 0 ! Frequency of trajectory output for 4D-VAR17 15 ln_salfix = .false. ! Logical switch for ensuring that the sa > salfixmin 18 16 salfixmin = -9999 ! Minimum salinity after applying the increments -
branches/2012/dev_MERGE_2012/DOC/TexFiles/Namelist/namdyn_vor
r3294 r3764 2 2 &namdyn_vor ! option of physics/algorithm (not control by CPP keys) 3 3 !----------------------------------------------------------------------- 4 ln_dynvor_ene = .false. ! en strophyconserving scheme5 ln_dynvor_ens = .false. ! en ergy conserving scheme4 ln_dynvor_ene = .false. ! energy conserving scheme 5 ln_dynvor_ens = .false. ! enstrophy conserving scheme 6 6 ln_dynvor_mix = .false. ! mixed scheme 7 7 ln_dynvor_een = .true. ! energy & enstrophy scheme -
branches/2012/dev_MERGE_2012/NEMOGCM/CONFIG/AMM12/EXP00/namelist
r3697 r3764 3 3 !! namelists 2 - Domain (namzgr, namzgr_sco, namdom, namtsd) 4 4 !! 3 - Surface boundary (namsbc, namsbc_ana, namsbc_flx, namsbc_clio, namsbc_core 5 !! namsbc_cpl, namtra_qsr, namsbc_rnf, 5 !! namsbc_cpl, namtra_qsr, namsbc_rnf, 6 6 !! namsbc_apr, namsbc_ssr, namsbc_alb) 7 7 !! 4 - lateral boundary (namlbc, namcla, namobc, namagrif, nambdy, nambdy_tide) … … 25 25 !----------------------------------------------------------------------- 26 26 nn_no = 0 ! job number (no more used...) 27 cn_exp = "AMM12" ! experience name 27 cn_exp = "AMM12" ! experience name 28 28 nn_it000 = 1 ! first time step 29 29 nn_itend = 2880 ! last time step (std 1 day = 288) … … 52 52 !! namzgr_sco s-coordinate or hybrid z-s-coordinate 53 53 !! namdom space and time domain (bathymetry, mesh, timestep) 54 !! namtsd data: temperature & salinity 54 !! namtsd data: temperature & salinity 55 55 !!====================================================================== 56 56 ! … … 107 107 / 108 108 !----------------------------------------------------------------------- 109 &namtsd ! data : Temperature & Salinity 109 &namtsd ! data : Temperature & Salinity 110 110 !----------------------------------------------------------------------- 111 111 ! ! file name ! frequency (hours) ! variable ! time interp. ! clim !'yearly' or ! weights ! rotation ! … … 142 142 ln_ana = .false ! analytical formulation (T => fill namsbc_ana ) 143 143 ln_flx = .true. ! flux formulation (T => fill namsbc_flx ) 144 ln_blk_clio = .false. ! CLIO bulk formulation (T => fill namsbc_clio) 145 ln_blk_core = .false. ! CORE bulk formulation (T => fill namsbc_core) 144 ln_blk_clio = .false. ! CLIO bulk formulation (T => fill namsbc_clio) 145 ln_blk_core = .false. ! CORE bulk formulation (T => fill namsbc_core) 146 146 ln_blk_mfs = .false. ! MFS bulk formulation (T => fill namsbc_mfs ) 147 147 ln_cpl = .false. ! Coupled formulation (T => fill namsbc_cpl ) … … 156 156 ln_rnf = .true. ! runoffs (T => fill namsbc_rnf) 157 157 ln_ssr = .false. ! Sea Surface Restoring on T and/or S (T => fill namsbc_ssr) 158 nn_fwb = 0 ! FreshWater Budget: =0 unchecked 159 ! =1 global mean of e-p-r set to zero at each time step 158 nn_fwb = 0 ! FreshWater Budget: =0 unchecked 159 ! =1 global mean of e-p-r set to zero at each time step 160 160 ! =2 annual global mean of e-p-r set to zero 161 161 ! =3 global emp set to zero and spread out over erp area … … 185 185 sn_emp = 'amm12_flx' , 3 , 'sowafldo' , .true. , .false. , 'daily' , '' , '' 186 186 cn_dir = './fluxes/' ! root directory for the location of the flux files 187 / 187 / 188 188 !----------------------------------------------------------------------- 189 189 &namsbc_clio ! namsbc_clio CLIO bulk formulae … … 242 242 ! ! ! categories ! reference ! orientation ! grids ! 243 243 ! send 244 sn_snd_temp = 'weighted oce and ice' , 'no' , '' , '' , '' 245 sn_snd_alb = 'weighted ice' , 'no' , '' , '' , '' 246 sn_snd_thick = 'none' , 'no' , '' , '' , '' 247 sn_snd_crt = 'none' , 'no' , 'spherical' , 'eastward-northward' , 'T' 248 sn_snd_co2 = 'coupled' , 'no' , '' , '' , '' 244 sn_snd_temp = 'weighted oce and ice' , 'no' , '' , '' , '' 245 sn_snd_alb = 'weighted ice' , 'no' , '' , '' , '' 246 sn_snd_thick = 'none' , 'no' , '' , '' , '' 247 sn_snd_crt = 'none' , 'no' , 'spherical' , 'eastward-northward' , 'T' 248 sn_snd_co2 = 'coupled' , 'no' , '' , '' , '' 249 249 ! receive 250 sn_rcv_w10m = 'none' , 'no' , '' , '' , '' 251 sn_rcv_taumod = 'coupled' , 'no' , '' , '' , '' 252 sn_rcv_tau = 'oce only' , 'no' , 'cartesian' , 'eastward-northward', 'U,V' 253 sn_rcv_dqnsdt = 'coupled' , 'no' , '' , '' , '' 254 sn_rcv_qsr = 'oce and ice' , 'no' , '' , '' , '' 255 sn_rcv_qns = 'oce and ice' , 'no' , '' , '' , '' 256 sn_rcv_emp = 'conservative' , 'no' , '' , '' , '' 257 sn_rcv_rnf = 'coupled' , 'no' , '' , '' , '' 258 sn_rcv_cal = 'coupled' , 'no' , '' , '' , '' 259 sn_rcv_co2 = 'coupled' , 'no' , '' , '' , '' 250 sn_rcv_w10m = 'none' , 'no' , '' , '' , '' 251 sn_rcv_taumod = 'coupled' , 'no' , '' , '' , '' 252 sn_rcv_tau = 'oce only' , 'no' , 'cartesian' , 'eastward-northward', 'U,V' 253 sn_rcv_dqnsdt = 'coupled' , 'no' , '' , '' , '' 254 sn_rcv_qsr = 'oce and ice' , 'no' , '' , '' , '' 255 sn_rcv_qns = 'oce and ice' , 'no' , '' , '' , '' 256 sn_rcv_emp = 'conservative' , 'no' , '' , '' , '' 257 sn_rcv_rnf = 'coupled' , 'no' , '' , '' , '' 258 sn_rcv_cal = 'coupled' , 'no' , '' , '' , '' 259 sn_rcv_co2 = 'coupled' , 'no' , '' , '' , '' 260 260 / 261 261 !----------------------------------------------------------------------- … … 323 323 ln_sssr_bnd = .true. ! flag to bound erp term (associated with nn_sssr=2) 324 324 rn_sssr_bnd = 4.e0 ! ABS(Max/Min) value of the damping erp term [mm/day] 325 / 325 / 326 326 !----------------------------------------------------------------------- 327 327 &namsbc_alb ! albedo parameters 328 328 !----------------------------------------------------------------------- 329 rn_cloud = 0.06 ! cloud correction to snow and ice albedo 329 rn_cloud = 0.06 ! cloud correction to snow and ice albedo 330 330 rn_albice = 0.53 ! albedo of melting ice in the arctic and antarctic 331 331 rn_alphd = 0.80 ! coefficients for linear interpolation used to 332 rn_alphc = 0.65 ! compute albedo between two extremes values 332 rn_alphc = 0.65 ! compute albedo between two extremes values 333 333 rn_alphdi = 0.72 ! (Pyane, 1972) 334 334 / … … 370 370 !! namcla cross land advection 371 371 !! namobc open boundaries parameters ("key_obc") 372 !! namagrif agrif nested grid ( read by child model only ) ("key_agrif") 372 !! namagrif agrif nested grid ( read by child model only ) ("key_agrif") 373 373 !! nambdy Unstructured open boundaries ("key_bdy") 374 374 !! namtide Tidal forcing at open boundaries ("key_bdy_tides") … … 392 392 ln_obc_clim = .false. ! climatological obc data files (T) or not (F) 393 393 ln_vol_cst = .true. ! impose the total volume conservation (T) or not (F) 394 ln_obc_fla = .false. ! Flather open boundary condition 394 ln_obc_fla = .false. ! Flather open boundary condition 395 395 nn_obcdta = 1 ! = 0 the obc data are equal to the initial state 396 396 ! = 1 the obc data are read in 'obc.dta' files … … 439 439 &nambdy ! unstructured open boundaries ("key_bdy") 440 440 !----------------------------------------------------------------------- 441 nb_bdy = 1 ! number of open boundary sets 441 nb_bdy = 1 ! number of open boundary sets 442 442 ln_coords_file = .true. ! =T : read bdy coordinates from file 443 443 cn_coords_file = 'coordinates.bdy.nc' ! bdy coordinates files … … 475 475 / 476 476 !----------------------------------------------------------------------- 477 &nambdy_tide ! tidal forcing at open boundaries 477 &nambdy_tide ! tidal forcing at open boundaries 478 478 !----------------------------------------------------------------------- 479 479 filtide = 'bdydta/amm12_bdytide_' ! file name root of tidal forcing files … … 483 483 !!====================================================================== 484 484 !! nambfr bottom friction 485 !! nambbc bottom temperature boundary condition 485 !! nambbc bottom temperature boundary condition 486 486 !! nambbl bottom boundary layer scheme ("key_trabbl") 487 487 !!====================================================================== … … 505 505 !----------------------------------------------------------------------- 506 506 ln_trabbc = .false. ! Apply a geothermal heating at the ocean bottom 507 nn_geoflx = 2 ! geothermal heat flux: = 0 no flux 507 nn_geoflx = 2 ! geothermal heat flux: = 0 no flux 508 508 ! = 1 constant flux 509 ! = 2 variable flux (read in geothermal_heating.nc in mW/m2) 509 ! = 2 variable flux (read in geothermal_heating.nc in mW/m2) 510 510 rn_geoflx_cst = 86.4e-3 ! Constant value of geothermal heat flux [W/m2] 511 511 / … … 525 525 !! namtra_adv advection scheme 526 526 !! namtra_ldf lateral diffusion scheme 527 !! namtra_dmp T & S newtonian damping 527 !! namtra_dmp T & S newtonian damping 528 528 !!====================================================================== 529 529 ! … … 539 539 / 540 540 !----------------------------------------------------------------------- 541 &namtra_adv ! advection scheme for tracer 542 !----------------------------------------------------------------------- 543 ln_traadv_cen2 = .false. ! 2nd order centered scheme 544 ln_traadv_tvd = .true. ! TVD scheme 545 ln_traadv_muscl = .false. ! MUSCL scheme 546 ln_traadv_muscl2 = .false. ! MUSCL2 scheme + cen2 at boundaries 547 ln_traadv_ubs = .false. ! UBS scheme 548 ln_traadv_qck = .false. ! QUICKEST scheme 541 &namtra_adv ! advection scheme for tracer 542 !----------------------------------------------------------------------- 543 ln_traadv_cen2 = .false. ! 2nd order centered scheme 544 ln_traadv_tvd = .true. ! TVD scheme 545 ln_traadv_muscl = .false. ! MUSCL scheme 546 ln_traadv_muscl2 = .false. ! MUSCL2 scheme + cen2 at boundaries 547 ln_traadv_ubs = .false. ! UBS scheme 548 ln_traadv_qck = .false. ! QUICKEST scheme 549 549 ln_traadv_msc_ups= .false. ! use upstream scheme within muscl 550 550 / … … 574 574 / 575 575 !----------------------------------------------------------------------- 576 &namtra_dmp ! tracer: T & S newtonian damping 576 &namtra_dmp ! tracer: T & S newtonian damping 577 577 !----------------------------------------------------------------------- 578 578 ln_tradmp = .false. ! add a damping termn (T) or not (F) … … 602 602 &namdyn_adv ! formulation of the momentum advection 603 603 !----------------------------------------------------------------------- 604 ln_dynadv_vec = .true. ! vector form (T) or flux form (F) 604 ln_dynadv_vec = .true. ! vector form (T) or flux form (F) 605 605 ln_dynadv_cen2= .false. ! flux form - 2nd order centered scheme 606 ln_dynadv_ubs = .false. ! flux form - 3rd order UBS scheme 607 / 606 ln_dynadv_ubs = .false. ! flux form - 3rd order UBS scheme 607 / 608 608 !----------------------------------------------------------------------- 609 609 &namdyn_vor ! option of physics/algorithm (not control by CPP keys) 610 610 !----------------------------------------------------------------------- 611 ln_dynvor_ene = .false. ! en strophyconserving scheme612 ln_dynvor_ens = .false. ! en ergy conserving scheme613 ln_dynvor_mix = .false. ! mixed scheme 614 ln_dynvor_een = .true. ! energy & enstrophy scheme 611 ln_dynvor_ene = .false. ! energy conserving scheme 612 ln_dynvor_ens = .false. ! enstrophy conserving scheme 613 ln_dynvor_mix = .false. ! mixed scheme 614 ln_dynvor_een = .true. ! energy & enstrophy scheme 615 615 / 616 616 !----------------------------------------------------------------------- 617 617 &namdyn_hpg ! Hydrostatic pressure gradient option 618 618 !----------------------------------------------------------------------- 619 ln_hpg_zco = .false. ! z-coordinate - full steps 619 ln_hpg_zco = .false. ! z-coordinate - full steps 620 620 ln_hpg_zps = .false. ! z-coordinate - partial steps (interpolation) 621 621 ln_hpg_sco = .false. ! s-coordinate (standard jacobian formulation) … … 635 635 &namdyn_ldf ! lateral diffusion on momentum 636 636 !----------------------------------------------------------------------- 637 ! ! Type of the operator : 638 ln_dynldf_lap = .true. ! laplacian operator 637 ! ! Type of the operator : 638 ln_dynldf_lap = .true. ! laplacian operator 639 639 ln_dynldf_bilap = .true. ! bilaplacian operator 640 640 ! Direction of action : 641 ln_dynldf_level = .false. ! iso-level 641 ln_dynldf_level = .false. ! iso-level 642 642 ln_dynldf_hor = .true. ! horizontal (geopotential) (require "key_ldfslp" in s-coord.) 643 643 ln_dynldf_iso = .false. ! iso-neutral (require "key_ldfslp") 644 ! Coefficient 644 ! Coefficient 645 645 rn_ahm_0_lap = 60.0 ! horizontal laplacian eddy viscosity [m2/s] 646 646 rn_ahmb_0 = 0.0 ! background eddy viscosity for ldf_iso [m2/s] … … 718 718 &namzdf_kpp ! K-Profile Parameterization dependent vertical mixing ("key_zdfkpp", and optionally: 719 719 !------------------------------------------------------------------------ "key_kppcustom" or "key_kpplktb") 720 ln_kpprimix = .true. ! shear instability mixing 720 ln_kpprimix = .true. ! shear instability mixing 721 721 rn_difmiw = 1.0e-04 ! constant internal wave viscosity [m2/s] 722 722 rn_difsiw = 0.1e-04 ! constant internal wave diffusivity [m2/s] 723 723 rn_riinfty = 0.8 ! local Richardson Number limit for shear instability 724 724 rn_difri = 0.0050 ! maximum shear mixing at Rig = 0 [m2/s] 725 rn_bvsqcon = -0.01e-07 ! Brunt-Vaisala squared for maximum convection [1/s2] 726 rn_difcon = 1. ! maximum mixing in interior convection [m2/s] 725 rn_bvsqcon = -0.01e-07 ! Brunt-Vaisala squared for maximum convection [1/s2] 726 rn_difcon = 1. ! maximum mixing in interior convection [m2/s] 727 727 nn_avb = 0 ! horizontal averaged (=1) or not (=0) on avt and amv 728 728 nn_ave = 1 ! constant (=0) or profile (=1) background on avt … … 758 758 rn_n2min = 1.e-8 ! threshold of the Brunt-Vaisala frequency (s-1) 759 759 rn_tfe = 0.333 ! tidal dissipation efficiency 760 rn_me = 0.2 ! mixing efficiency 760 rn_me = 0.2 ! mixing efficiency 761 761 ln_tmx_itf = .FALSE. ! ITF specific parameterisation 762 762 rn_tfe_itf = 1. ! ITF tidal dissipation efficiency … … 768 768 !! nammpp Massively Parallel Processing ("key_mpp_mpi) 769 769 !! namctl Control prints & Benchmark 770 !! namsol elliptic solver / island / free surface 771 !!====================================================================== 772 ! 773 !----------------------------------------------------------------------- 774 &namsol ! elliptic solver / island / free surface 770 !! namsol elliptic solver / island / free surface 771 !!====================================================================== 772 ! 773 !----------------------------------------------------------------------- 774 &namsol ! elliptic solver / island / free surface 775 775 !----------------------------------------------------------------------- 776 776 nn_solv = 1 ! elliptic solver: =1 preconditioned conjugate gradient (pcg) … … 818 818 !! namflo float parameters ("key_float") 819 819 !! namptr Poleward Transport Diagnostics 820 !! namhsb Heat and salt budgets 820 !! namhsb Heat and salt budgets 821 821 !!====================================================================== 822 822 ! … … 856 856 jpnnewflo = 0 ! number of floats for the restart 857 857 ln_rstflo = .false. ! float restart (T) or not (F) 858 nn_writefl = 75 ! frequency of writing in float output file 859 nn_stockfl = 5475 ! frequency of creation of the float restart file 858 nn_writefl = 75 ! frequency of writing in float output file 859 nn_stockfl = 5475 ! frequency of creation of the float restart file 860 860 ln_argo = .false. ! Argo type floats (stay at the surface each 10 days) 861 861 ln_flork4 = .false. ! trajectories computed with a 4th order Runge-Kutta (T) … … 869 869 ln_diaptr = .false. ! Poleward heat and salt transport (T) or not (F) 870 870 ln_diaznl = .false. ! Add zonal means and meridional stream functions 871 ln_subbas = .false. ! Atlantic/Pacific/Indian basins computation (T) or not 871 ln_subbas = .false. ! Atlantic/Pacific/Indian basins computation (T) or not 872 872 ! (orca configuration only, need input basins mask file named "subbasins.nc" 873 873 ln_ptrcomp = .false. ! Add decomposition : overturning … … 876 876 / 877 877 !----------------------------------------------------------------------- 878 &namhsb ! Heat and salt budgets 878 &namhsb ! Heat and salt budgets 879 879 !----------------------------------------------------------------------- 880 880 ln_diahsb = .false. ! check the heat and salt budgets (T) or not (F) … … 908 908 &namobs ! observation usage switch ('key_diaobs') 909 909 !----------------------------------------------------------------------- 910 ln_t3d = .false. ! Logical switch for T profile observations 911 ln_s3d = .false. ! Logical switch for S profile observations 912 ln_ena = .false. ! Logical switch for ENACT insitu data set 913 ! ! ln_cor Logical switch for Coriolis insitu data set 914 ln_profb = .false. ! Logical switch for feedback insitu data set 915 ln_sla = .false. ! Logical switch for SLA observations 916 917 ln_sladt = .false. ! Logical switch for AVISO SLA data 918 919 ln_slafb = .false. ! Logical switch for feedback SLA data 920 ! ln_ssh Logical switch for SSH observations 910 ln_t3d = .false. ! Logical switch for T profile observations 911 ln_s3d = .false. ! Logical switch for S profile observations 912 ln_ena = .false. ! Logical switch for ENACT insitu data set 913 ! ! ln_cor Logical switch for Coriolis insitu data set 914 ln_profb = .false. ! Logical switch for feedback insitu data set 915 ln_sla = .false. ! Logical switch for SLA observations 916 917 ln_sladt = .false. ! Logical switch for AVISO SLA data 918 919 ln_slafb = .false. ! Logical switch for feedback SLA data 920 ! ln_ssh Logical switch for SSH observations 921 921 922 922 ln_sst = .true. ! Logical switch for SST observations … … 924 924 ln_ghrsst = .false. ! ln_ghrsst Logical switch for GHRSST observations 925 925 926 ln_sstfb = .false. ! Logical switch for feedback SST data 927 ! ln_sss Logical switch for SSS observations 928 ! ln_seaice Logical switch for Sea Ice observations 929 ! ln_vel3d Logical switch for velocity observations 930 ! ln_velavcur Logical switch for velocity daily av. cur. 931 ! ln_velhrcur Logical switch for velocity high freq. cur. 932 ! ln_velavadcp Logical switch for velocity daily av. ADCP 926 ln_sstfb = .false. ! Logical switch for feedback SST data 927 ! ln_sss Logical switch for SSS observations 928 ! ln_seaice Logical switch for Sea Ice observations 929 ! ln_vel3d Logical switch for velocity observations 930 ! ln_velavcur Logical switch for velocity daily av. cur. 931 ! ln_velhrcur Logical switch for velocity high freq. cur. 932 ! ln_velavadcp Logical switch for velocity daily av. ADCP 933 933 ! ln_velhradcp Logical switch for velocity high freq. ADCP 934 ! ln_velfb Logical switch for feedback velocity data 935 ! ln_grid_global Global distribtion of observations 936 ! ln_grid_search_lookup Logical switch for obs grid search w/lookup table 937 ! grid_search_file Grid search lookup file header 938 ! enactfiles ENACT input observation file names 939 ! coriofiles Coriolis input observation file name 940 ! ! profbfiles: Profile feedback input observation file name 934 ! ln_velfb Logical switch for feedback velocity data 935 ! ln_grid_global Global distribtion of observations 936 ! ln_grid_search_lookup Logical switch for obs grid search w/lookup table 937 ! grid_search_file Grid search lookup file header 938 ! enactfiles ENACT input observation file names 939 ! coriofiles Coriolis input observation file name 940 ! ! profbfiles: Profile feedback input observation file name 941 941 profbfiles = 'profiles_01.nc' 942 ! ln_profb_enatim Enact feedback input time setting switch 942 ! ln_profb_enatim Enact feedback input time setting switch 943 943 ! slafilesact Active SLA input observation file name 944 ! slafilespas Passive SLA input observation file name 945 ! ! slafbfiles: Feedback SLA input observation file name 944 ! slafilespas Passive SLA input observation file name 945 ! ! slafbfiles: Feedback SLA input observation file name 946 946 slafbfiles = 'sla_01.nc' 947 ! sstfiles GHRSST input observation file name 948 ! ! sstfbfiles: Feedback SST input observation file name 947 ! sstfiles GHRSST input observation file name 948 ! ! sstfbfiles: Feedback SST input observation file name 949 949 sstfbfiles = 'sst_01.nc' 'sst_02.nc' 'sst_03.nc' 'sst_04.nc' 'sst_05.nc' 950 ! seaicefiles Sea Ice input observation file name 951 ! velavcurfiles Vel. cur. daily av. input file name 952 ! velhvcurfiles Vel. cur. high freq. input file name 953 ! velavadcpfiles Vel. ADCP daily av. input file name 954 ! velhvadcpfiles Vel. ADCP high freq. input file name 955 ! velfbfiles Vel. feedback input observation file name 956 ! dobsini Initial date in window YYYYMMDD.HHMMSS 957 ! dobsend Final date in window YYYYMMDD.HHMMSS 958 ! n1dint Type of vertical interpolation method 959 ! n2dint Type of horizontal interpolation method 960 ! ln_nea Rejection of observations near land switch 961 nmsshc = 0 ! MSSH correction scheme 962 ! mdtcorr MDT correction 963 ! mdtcutoff MDT cutoff for computed correction 964 ln_altbias = .false. ! Logical switch for alt bias 965 ln_ignmis = .true. ! Logical switch for ignoring missing files 966 ! endailyavtypes ENACT daily average types 950 ! seaicefiles Sea Ice input observation file name 951 ! velavcurfiles Vel. cur. daily av. input file name 952 ! velhvcurfiles Vel. cur. high freq. input file name 953 ! velavadcpfiles Vel. ADCP daily av. input file name 954 ! velhvadcpfiles Vel. ADCP high freq. input file name 955 ! velfbfiles Vel. feedback input observation file name 956 ! dobsini Initial date in window YYYYMMDD.HHMMSS 957 ! dobsend Final date in window YYYYMMDD.HHMMSS 958 ! n1dint Type of vertical interpolation method 959 ! n2dint Type of horizontal interpolation method 960 ! ln_nea Rejection of observations near land switch 961 nmsshc = 0 ! MSSH correction scheme 962 ! mdtcorr MDT correction 963 ! mdtcutoff MDT cutoff for computed correction 964 ln_altbias = .false. ! Logical switch for alt bias 965 ln_ignmis = .true. ! Logical switch for ignoring missing files 966 ! endailyavtypes ENACT daily average types 967 967 ln_grid_global = .true. 968 968 ln_grid_search_lookup = .false. 969 / 969 / 970 970 !----------------------------------------------------------------------- 971 971 &nam_asminc ! assimilation increments ('key_asminc') 972 972 !----------------------------------------------------------------------- 973 ln_bkgwri = .false. ! Logical switch for writing out background state 974 ln_trjwri = .false. ! Logical switch for writing out state trajectory 973 ln_bkgwri = .false. ! Logical switch for writing out background state 975 974 ln_trainc = .false. ! Logical switch for applying tracer increments 976 975 ln_dyninc = .false. ! Logical switch for applying velocity increments 977 ln_sshinc = .false. ! Logical switch for applying SSH increments 976 ln_sshinc = .false. ! Logical switch for applying SSH increments 978 977 ln_asmdin = .false. ! Logical switch for Direct Initialization (DI) 979 978 ln_asmiau = .false. ! Logical switch for Incremental Analysis Updating (IAU) … … 983 982 nitiaufin = 15 ! Timestep of end of IAU interval in [0,nitend-nit000-1] 984 983 niaufn = 0 ! Type of IAU weighting function 985 nittrjfrq = 0 ! Frequency of trajectory output for 4D-VAR986 984 ln_salfix = .false. ! Logical switch for ensuring that the sa > salfixmin 987 985 salfixmin = -9999 ! Minimum salinity after applying the increments -
branches/2012/dev_MERGE_2012/NEMOGCM/CONFIG/GYRE/EXP00/namelist
r3680 r3764 3 3 !! namelists 2 - Domain (namzgr, namzgr_sco, namdom, namtsd) 4 4 !! 3 - Surface boundary (namsbc, namsbc_ana, namsbc_flx, namsbc_clio, namsbc_core 5 !! namsbc_cpl, namtra_qsr, namsbc_rnf, 5 !! namsbc_cpl, namtra_qsr, namsbc_rnf, 6 6 !! namsbc_apr, namsbc_ssr, namsbc_alb) 7 7 !! 4 - lateral boundary (namlbc, namcla, namobc, namagrif, nambdy, nambdy_tide) … … 25 25 !----------------------------------------------------------------------- 26 26 nn_no = 0 ! job number (no more used...) 27 cn_exp = "GYRE" ! experience name 27 cn_exp = "GYRE" ! experience name 28 28 nn_it000 = 1 ! first time step 29 29 nn_itend = 4320 ! last time step … … 52 52 !! namzgr_sco s-coordinate or hybrid z-s-coordinate 53 53 !! namdom space and time domain (bathymetry, mesh, timestep) 54 !! namtsd data: temperature & salinity 54 !! namtsd data: temperature & salinity 55 55 !!====================================================================== 56 56 ! … … 107 107 / 108 108 !----------------------------------------------------------------------- 109 &namtsd ! data : Temperature & Salinity 109 &namtsd ! data : Temperature & Salinity 110 110 !----------------------------------------------------------------------- 111 111 ! ! file name ! frequency (hours) ! variable ! time interp. ! clim !'yearly' or ! weights ! rotation ! … … 138 138 &namsbc ! Surface Boundary Condition (surface module) 139 139 !----------------------------------------------------------------------- 140 nn_fsbc = 1 ! frequency of surface boundary condition computation 140 nn_fsbc = 1 ! frequency of surface boundary condition computation 141 141 ! (also = the frequency of sea-ice model call) 142 ln_ana = .true. ! analytical formulation (T => fill namsbc_ana ) 142 ln_ana = .true. ! analytical formulation (T => fill namsbc_ana ) 143 143 ln_flx = .false. ! flux formulation (T => fill namsbc_flx ) 144 ln_blk_clio = .false. ! CLIO bulk formulation (T => fill namsbc_clio) 145 ln_blk_core = .false. ! CORE bulk formulation (T => fill namsbc_core) 144 ln_blk_clio = .false. ! CLIO bulk formulation (T => fill namsbc_clio) 145 ln_blk_core = .false. ! CORE bulk formulation (T => fill namsbc_core) 146 146 ln_blk_mfs = .false. ! MFS bulk formulation (T => fill namsbc_mfs ) 147 147 ln_cpl = .false. ! Coupled formulation (T => fill namsbc_cpl ) … … 156 156 ln_rnf = .false. ! runoffs (T => fill namsbc_rnf) 157 157 ln_ssr = .false. ! Sea Surface Restoring on T and/or S (T => fill namsbc_ssr) 158 nn_fwb = 0 ! FreshWater Budget: =0 unchecked 159 ! =1 global mean of e-p-r set to zero at each time step 158 nn_fwb = 0 ! FreshWater Budget: =0 unchecked 159 ! =1 global mean of e-p-r set to zero at each time step 160 160 ! =2 annual global mean of e-p-r set to zero 161 161 ! =3 global emp set to zero and spread out over erp area … … 186 186 187 187 cn_dir = './' ! root directory for the location of the flux files 188 / 188 / 189 189 !----------------------------------------------------------------------- 190 190 &namsbc_clio ! namsbc_clio CLIO bulk formulae … … 243 243 ! ! ! categories ! reference ! orientation ! grids ! 244 244 ! send 245 sn_snd_temp = 'weighted oce and ice' , 'no' , '' , '' , '' 246 sn_snd_alb = 'weighted ice' , 'no' , '' , '' , '' 247 sn_snd_thick = 'none' , 'no' , '' , '' , '' 248 sn_snd_crt = 'none' , 'no' , 'spherical' , 'eastward-northward' , 'T' 249 sn_snd_co2 = 'coupled' , 'no' , '' , '' , '' 245 sn_snd_temp = 'weighted oce and ice' , 'no' , '' , '' , '' 246 sn_snd_alb = 'weighted ice' , 'no' , '' , '' , '' 247 sn_snd_thick = 'none' , 'no' , '' , '' , '' 248 sn_snd_crt = 'none' , 'no' , 'spherical' , 'eastward-northward' , 'T' 249 sn_snd_co2 = 'coupled' , 'no' , '' , '' , '' 250 250 ! receive 251 sn_rcv_w10m = 'none' , 'no' , '' , '' , '' 252 sn_rcv_taumod = 'coupled' , 'no' , '' , '' , '' 253 sn_rcv_tau = 'oce only' , 'no' , 'cartesian' , 'eastward-northward', 'U,V' 254 sn_rcv_dqnsdt = 'coupled' , 'no' , '' , '' , '' 255 sn_rcv_qsr = 'oce and ice' , 'no' , '' , '' , '' 256 sn_rcv_qns = 'oce and ice' , 'no' , '' , '' , '' 257 sn_rcv_emp = 'conservative' , 'no' , '' , '' , '' 258 sn_rcv_rnf = 'coupled' , 'no' , '' , '' , '' 259 sn_rcv_cal = 'coupled' , 'no' , '' , '' , '' 260 sn_rcv_co2 = 'coupled' , 'no' , '' , '' , '' 251 sn_rcv_w10m = 'none' , 'no' , '' , '' , '' 252 sn_rcv_taumod = 'coupled' , 'no' , '' , '' , '' 253 sn_rcv_tau = 'oce only' , 'no' , 'cartesian' , 'eastward-northward', 'U,V' 254 sn_rcv_dqnsdt = 'coupled' , 'no' , '' , '' , '' 255 sn_rcv_qsr = 'oce and ice' , 'no' , '' , '' , '' 256 sn_rcv_qns = 'oce and ice' , 'no' , '' , '' , '' 257 sn_rcv_emp = 'conservative' , 'no' , '' , '' , '' 258 sn_rcv_rnf = 'coupled' , 'no' , '' , '' , '' 259 sn_rcv_cal = 'coupled' , 'no' , '' , '' , '' 260 sn_rcv_co2 = 'coupled' , 'no' , '' , '' , '' 261 261 / 262 262 !----------------------------------------------------------------------- … … 266 266 ! ! ! (if <0 months) ! name ! (logical) ! (T/F) ! 'monthly' ! filename ! pairing ! 267 267 sn_chl ='chlorophyll', -1 , 'CHLA' , .true. , .true. , 'yearly' , '' , '' 268 268 269 269 cn_dir = './' ! root directory for the location of the runoff files 270 270 ln_traqsr = .true. ! Light penetration (T) or not (F) … … 315 315 sn_sst = 'sst_data' , 24 , 'sst' , .false. , .false., 'yearly' , '' , '' 316 316 sn_sss = 'sss_data' , -1 , 'sss' , .true. , .true. , 'yearly' , '' , '' 317 317 318 318 cn_dir = './' ! root directory for the location of the runoff files 319 319 nn_sstr = 0 ! add a retroaction term in the surface heat flux (=1) or not (=0) … … 324 324 ln_sssr_bnd = .false. ! flag to bound erp term (associated with nn_sssr=2) 325 325 rn_sssr_bnd = 4.e0 ! ABS(Max/Min) value of the damping erp term [mm/day] 326 / 326 / 327 327 !----------------------------------------------------------------------- 328 328 &namsbc_alb ! albedo parameters 329 329 !----------------------------------------------------------------------- 330 rn_cloud = 0.06 ! cloud correction to snow and ice albedo 330 rn_cloud = 0.06 ! cloud correction to snow and ice albedo 331 331 rn_albice = 0.53 ! albedo of melting ice in the arctic and antarctic 332 332 rn_alphd = 0.80 ! coefficients for linear interpolation used to 333 rn_alphc = 0.65 ! compute albedo between two extremes values 333 rn_alphc = 0.65 ! compute albedo between two extremes values 334 334 rn_alphdi = 0.72 ! (Pyane, 1972) 335 335 / … … 375 375 !! namcla cross land advection 376 376 !! namobc open boundaries parameters ("key_obc") 377 !! namagrif agrif nested grid ( read by child model only ) ("key_agrif") 377 !! namagrif agrif nested grid ( read by child model only ) ("key_agrif") 378 378 !! nambdy Unstructured open boundaries ("key_bdy") 379 379 !! namtide Tidal forcing at open boundaries ("key_bdy_tides") … … 397 397 ln_obc_clim = .false. ! climatological obc data files (T) or not (F) 398 398 ln_vol_cst = .true. ! impose the total volume conservation (T) or not (F) 399 ln_obc_fla = .false. ! Flather open boundary condition 399 ln_obc_fla = .false. ! Flather open boundary condition 400 400 nn_obcdta = 1 ! = 0 the obc data are equal to the initial state 401 401 ! = 1 the obc data are read in 'obc.dta' files … … 446 446 &nambdy ! unstructured open boundaries ("key_bdy") 447 447 !----------------------------------------------------------------------- 448 nb_bdy = 1 ! number of open boundary sets 448 nb_bdy = 1 ! number of open boundary sets 449 449 ln_coords_file = .true. ! =T : read bdy coordinates from file 450 450 cn_coords_file = 'coordinates.bdy.nc' ! bdy coordinates files … … 482 482 / 483 483 !----------------------------------------------------------------------- 484 &nambdy_tide ! tidal forcing at open boundaries 484 &nambdy_tide ! tidal forcing at open boundaries 485 485 !----------------------------------------------------------------------- 486 486 filtide = 'bdydta/amm12_bdytide_' ! file name root of tidal forcing files … … 521 521 !!====================================================================== 522 522 !! nambfr bottom friction 523 !! nambbc bottom temperature boundary condition 523 !! nambbc bottom temperature boundary condition 524 524 !! nambbl bottom boundary layer scheme ("key_trabbl") 525 525 !!====================================================================== … … 541 541 !----------------------------------------------------------------------- 542 542 ln_trabbc = .false. ! Apply a geothermal heating at the ocean bottom 543 nn_geoflx = 0 ! geothermal heat flux: = 0 no flux 543 nn_geoflx = 0 ! geothermal heat flux: = 0 no flux 544 544 ! = 1 constant flux 545 ! = 2 variable flux (read in geothermal_heating.nc in mW/m2) 545 ! = 2 variable flux (read in geothermal_heating.nc in mW/m2) 546 546 rn_geoflx_cst = 86.4e-3 ! Constant value of geothermal heat flux [W/m2] 547 547 / … … 561 561 !! namtra_adv advection scheme 562 562 !! namtra_ldf lateral diffusion scheme 563 !! namtra_dmp T & S newtonian damping 563 !! namtra_dmp T & S newtonian damping 564 564 !!====================================================================== 565 565 ! … … 575 575 / 576 576 !----------------------------------------------------------------------- 577 &namtra_adv ! advection scheme for tracer 578 !----------------------------------------------------------------------- 579 ln_traadv_cen2 = .false. ! 2nd order centered scheme 580 ln_traadv_tvd = .true. ! TVD scheme 581 ln_traadv_muscl = .false. ! MUSCL scheme 582 ln_traadv_muscl2 = .false. ! MUSCL2 scheme + cen2 at boundaries 583 ln_traadv_ubs = .false. ! UBS scheme 584 ln_traadv_qck = .false. ! QUICKEST scheme 577 &namtra_adv ! advection scheme for tracer 578 !----------------------------------------------------------------------- 579 ln_traadv_cen2 = .false. ! 2nd order centered scheme 580 ln_traadv_tvd = .true. ! TVD scheme 581 ln_traadv_muscl = .false. ! MUSCL scheme 582 ln_traadv_muscl2 = .false. ! MUSCL2 scheme + cen2 at boundaries 583 ln_traadv_ubs = .false. ! UBS scheme 584 ln_traadv_qck = .false. ! QUICKEST scheme 585 585 ln_traadv_msc_ups= .false. ! use upstream scheme within muscl 586 586 / … … 610 610 / 611 611 !----------------------------------------------------------------------- 612 &namtra_dmp ! tracer: T & S newtonian damping 612 &namtra_dmp ! tracer: T & S newtonian damping 613 613 !----------------------------------------------------------------------- 614 614 ln_tradmp = .false. ! add a damping termn (T) or not (F) … … 638 638 &namdyn_adv ! formulation of the momentum advection 639 639 !----------------------------------------------------------------------- 640 ln_dynadv_vec = .true. ! vector form (T) or flux form (F) 640 ln_dynadv_vec = .true. ! vector form (T) or flux form (F) 641 641 ln_dynadv_cen2= .false. ! flux form - 2nd order centered scheme 642 ln_dynadv_ubs = .false. ! flux form - 3rd order UBS scheme 643 / 642 ln_dynadv_ubs = .false. ! flux form - 3rd order UBS scheme 643 / 644 644 !----------------------------------------------------------------------- 645 645 &namdyn_vor ! option of physics/algorithm (not control by CPP keys) 646 646 !----------------------------------------------------------------------- 647 ln_dynvor_ene = .true. ! en strophyconserving scheme648 ln_dynvor_ens = .false. ! en ergy conserving scheme649 ln_dynvor_mix = .false. ! mixed scheme 650 ln_dynvor_een = .false. ! energy & enstrophy scheme 647 ln_dynvor_ene = .true. ! energy conserving scheme 648 ln_dynvor_ens = .false. ! enstrophy conserving scheme 649 ln_dynvor_mix = .false. ! mixed scheme 650 ln_dynvor_een = .false. ! energy & enstrophy scheme 651 651 / 652 652 !----------------------------------------------------------------------- 653 653 &namdyn_hpg ! Hydrostatic pressure gradient option 654 654 !----------------------------------------------------------------------- 655 ln_hpg_zco = .true. ! z-coordinate - full steps 655 ln_hpg_zco = .true. ! z-coordinate - full steps 656 656 ln_hpg_zps = .false. ! z-coordinate - partial steps (interpolation) 657 657 ln_hpg_sco = .false. ! s-coordinate (standard jacobian formulation) … … 671 671 &namdyn_ldf ! lateral diffusion on momentum 672 672 !----------------------------------------------------------------------- 673 ! ! Type of the operator : 674 ln_dynldf_lap = .true. ! laplacian operator 675 ln_dynldf_bilap = .false. ! bilaplacian operator 676 ! ! Direction of action : 677 ln_dynldf_level = .false. ! iso-level 673 ! ! Type of the operator : 674 ln_dynldf_lap = .true. ! laplacian operator 675 ln_dynldf_bilap = .false. ! bilaplacian operator 676 ! ! Direction of action : 677 ln_dynldf_level = .false. ! iso-level 678 678 ln_dynldf_hor = .true. ! horizontal (geopotential) (require "key_ldfslp" in s-coord.) 679 679 ln_dynldf_iso = .false. ! iso-neutral (require "key_ldfslp") … … 754 754 &namzdf_kpp ! K-Profile Parameterization dependent vertical mixing ("key_zdfkpp", and optionally: 755 755 !------------------------------------------------------------------------ "key_kppcustom" or "key_kpplktb") 756 ln_kpprimix = .true. ! shear instability mixing 756 ln_kpprimix = .true. ! shear instability mixing 757 757 rn_difmiw = 1.0e-04 ! constant internal wave viscosity [m2/s] 758 758 rn_difsiw = 0.1e-04 ! constant internal wave diffusivity [m2/s] 759 759 rn_riinfty = 0.8 ! local Richardson Number limit for shear instability 760 760 rn_difri = 0.0050 ! maximum shear mixing at Rig = 0 [m2/s] 761 rn_bvsqcon = -0.01e-07 ! Brunt-Vaisala squared for maximum convection [1/s2] 762 rn_difcon = 1. ! maximum mixing in interior convection [m2/s] 761 rn_bvsqcon = -0.01e-07 ! Brunt-Vaisala squared for maximum convection [1/s2] 762 rn_difcon = 1. ! maximum mixing in interior convection [m2/s] 763 763 nn_avb = 0 ! horizontal averaged (=1) or not (=0) on avt and amv 764 764 nn_ave = 1 ! constant (=0) or profile (=1) background on avt … … 794 794 rn_n2min = 1.e-8 ! threshold of the Brunt-Vaisala frequency (s-1) 795 795 rn_tfe = 0.333 ! tidal dissipation efficiency 796 rn_me = 0.2 ! mixing efficiency 796 rn_me = 0.2 ! mixing efficiency 797 797 ln_tmx_itf = .false. ! ITF specific parameterisation 798 798 rn_tfe_itf = 1. ! ITF tidal dissipation efficiency … … 804 804 !! nammpp Massively Parallel Processing ("key_mpp_mpi) 805 805 !! namctl Control prints & Benchmark 806 !! namsol elliptic solver / island / free surface 807 !!====================================================================== 808 ! 809 !----------------------------------------------------------------------- 810 &namsol ! elliptic solver / island / free surface 806 !! namsol elliptic solver / island / free surface 807 !!====================================================================== 808 ! 809 !----------------------------------------------------------------------- 810 &namsol ! elliptic solver / island / free surface 811 811 !----------------------------------------------------------------------- 812 812 nn_solv = 2 ! elliptic solver: =1 preconditioned conjugate gradient (pcg) … … 827 827 nn_buffer = 0 ! size in bytes of exported buffer ('B' case), 0 no exportation 828 828 ln_nnogather= .false. ! activate code to avoid mpi_allgather use at the northfold 829 jpni = 0 ! jpni number of processors following i (set automatically if < 1) 830 jpnj = 0 ! jpnj number of processors following j (set automatically if < 1) 831 jpnij = 0 ! jpnij number of local domains (set automatically if < 1) 829 jpni = 0 ! jpni number of processors following i (set automatically if < 1) 830 jpnj = 0 ! jpnj number of processors following j (set automatically if < 1) 831 jpnij = 0 ! jpnij number of local domains (set automatically if < 1) 832 832 / 833 833 !----------------------------------------------------------------------- … … 854 854 !! namflo float parameters ("key_float") 855 855 !! namptr Poleward Transport Diagnostics 856 !! namhsb Heat and salt budgets 856 !! namhsb Heat and salt budgets 857 857 !!====================================================================== 858 858 ! … … 899 899 ln_diaptr = .false. ! Poleward heat and salt transport (T) or not (F) 900 900 ln_diaznl = .true. ! Add zonal means and meridional stream functions 901 ln_subbas = .true. ! Atlantic/Pacific/Indian basins computation (T) or not 901 ln_subbas = .true. ! Atlantic/Pacific/Indian basins computation (T) or not 902 902 ! (orca configuration only, need input basins mask file named "subbasins.nc" 903 903 ln_ptrcomp = .true. ! Add decomposition : overturning … … 906 906 / 907 907 !----------------------------------------------------------------------- 908 &namhsb ! Heat and salt budgets 908 &namhsb ! Heat and salt budgets 909 909 !----------------------------------------------------------------------- 910 910 ln_diahsb = .false. ! check the heat and salt budgets (T) or not (F) … … 918 918 ! -1 : debug all section 919 919 ! 0 < n : debug section number n 920 / 920 / 921 921 922 922 !!====================================================================== … … 930 930 &namobs ! observation usage switch ('key_diaobs') 931 931 !----------------------------------------------------------------------- 932 ln_t3d = .false. ! Logical switch for T profile observations 933 ln_s3d = .false. ! Logical switch for S profile observations 934 ln_ena = .false. ! Logical switch for ENACT insitu data set 935 ! ! ln_cor Logical switch for Coriolis insitu data set 936 ln_profb = .false. ! Logical switch for feedback insitu data set 937 ln_sla = .false. ! Logical switch for SLA observations 938 939 ln_sladt = .false. ! Logical switch for AVISO SLA data 940 941 ln_slafb = .false. ! Logical switch for feedback SLA data 942 ! ln_ssh Logical switch for SSH observations 932 ln_t3d = .false. ! Logical switch for T profile observations 933 ln_s3d = .false. ! Logical switch for S profile observations 934 ln_ena = .false. ! Logical switch for ENACT insitu data set 935 ! ! ln_cor Logical switch for Coriolis insitu data set 936 ln_profb = .false. ! Logical switch for feedback insitu data set 937 ln_sla = .false. ! Logical switch for SLA observations 938 939 ln_sladt = .false. ! Logical switch for AVISO SLA data 940 941 ln_slafb = .false. ! Logical switch for feedback SLA data 942 ! ln_ssh Logical switch for SSH observations 943 943 944 944 ln_sst = .true. ! Logical switch for SST observations … … 946 946 ln_ghrsst = .false. ! ln_ghrsst Logical switch for GHRSST observations 947 947 948 ln_sstfb = .false. ! Logical switch for feedback SST data 949 ! ln_sss Logical switch for SSS observations 950 ! ln_seaice Logical switch for Sea Ice observations 951 ! ln_vel3d Logical switch for velocity observations 952 ! ln_velavcur Logical switch for velocity daily av. cur. 953 ! ln_velhrcur Logical switch for velocity high freq. cur. 954 ! ln_velavadcp Logical switch for velocity daily av. ADCP 948 ln_sstfb = .false. ! Logical switch for feedback SST data 949 ! ln_sss Logical switch for SSS observations 950 ! ln_seaice Logical switch for Sea Ice observations 951 ! ln_vel3d Logical switch for velocity observations 952 ! ln_velavcur Logical switch for velocity daily av. cur. 953 ! ln_velhrcur Logical switch for velocity high freq. cur. 954 ! ln_velavadcp Logical switch for velocity daily av. ADCP 955 955 ! ln_velhradcp Logical switch for velocity high freq. ADCP 956 ! ln_velfb Logical switch for feedback velocity data 957 ! ln_grid_global Global distribtion of observations 958 ! ln_grid_search_lookup Logical switch for obs grid search w/lookup table 959 ! grid_search_file Grid search lookup file header 960 ! enactfiles ENACT input observation file names 961 ! coriofiles Coriolis input observation file name 962 ! ! profbfiles: Profile feedback input observation file name 956 ! ln_velfb Logical switch for feedback velocity data 957 ! ln_grid_global Global distribtion of observations 958 ! ln_grid_search_lookup Logical switch for obs grid search w/lookup table 959 ! grid_search_file Grid search lookup file header 960 ! enactfiles ENACT input observation file names 961 ! coriofiles Coriolis input observation file name 962 ! ! profbfiles: Profile feedback input observation file name 963 963 profbfiles = 'profiles_01.nc' 964 ! ln_profb_enatim Enact feedback input time setting switch 964 ! ln_profb_enatim Enact feedback input time setting switch 965 965 ! slafilesact Active SLA input observation file name 966 ! slafilespas Passive SLA input observation file name 967 ! ! slafbfiles: Feedback SLA input observation file name 966 ! slafilespas Passive SLA input observation file name 967 ! ! slafbfiles: Feedback SLA input observation file name 968 968 slafbfiles = 'sla_01.nc' 969 ! sstfiles GHRSST input observation file name 970 ! ! sstfbfiles: Feedback SST input observation file name 969 ! sstfiles GHRSST input observation file name 970 ! ! sstfbfiles: Feedback SST input observation file name 971 971 sstfbfiles = 'sst_01.nc' 'sst_02.nc' 'sst_03.nc' 'sst_04.nc' 'sst_05.nc' 972 ! seaicefiles Sea Ice input observation file name 973 ! velavcurfiles Vel. cur. daily av. input file name 974 ! velhvcurfiles Vel. cur. high freq. input file name 975 ! velavadcpfiles Vel. ADCP daily av. input file name 976 ! velhvadcpfiles Vel. ADCP high freq. input file name 977 ! velfbfiles Vel. feedback input observation file name 978 ! dobsini Initial date in window YYYYMMDD.HHMMSS 979 ! dobsend Final date in window YYYYMMDD.HHMMSS 980 ! n1dint Type of vertical interpolation method 981 ! n2dint Type of horizontal interpolation method 982 ! ln_nea Rejection of observations near land switch 983 nmsshc = 0 ! MSSH correction scheme 984 ! mdtcorr MDT correction 985 ! mdtcutoff MDT cutoff for computed correction 986 ln_altbias = .false. ! Logical switch for alt bias 987 ln_ignmis = .true. ! Logical switch for ignoring missing files 988 ! endailyavtypes ENACT daily average types 972 ! seaicefiles Sea Ice input observation file name 973 ! velavcurfiles Vel. cur. daily av. input file name 974 ! velhvcurfiles Vel. cur. high freq. input file name 975 ! velavadcpfiles Vel. ADCP daily av. input file name 976 ! velhvadcpfiles Vel. ADCP high freq. input file name 977 ! velfbfiles Vel. feedback input observation file name 978 ! dobsini Initial date in window YYYYMMDD.HHMMSS 979 ! dobsend Final date in window YYYYMMDD.HHMMSS 980 ! n1dint Type of vertical interpolation method 981 ! n2dint Type of horizontal interpolation method 982 ! ln_nea Rejection of observations near land switch 983 nmsshc = 0 ! MSSH correction scheme 984 ! mdtcorr MDT correction 985 ! mdtcutoff MDT cutoff for computed correction 986 ln_altbias = .false. ! Logical switch for alt bias 987 ln_ignmis = .true. ! Logical switch for ignoring missing files 988 ! endailyavtypes ENACT daily average types 989 989 ln_grid_global = .true. 990 990 ln_grid_search_lookup = .false. 991 / 991 / 992 992 !----------------------------------------------------------------------- 993 993 &nam_asminc ! assimilation increments ('key_asminc') 994 994 !----------------------------------------------------------------------- 995 ln_bkgwri = .false. ! Logical switch for writing out background state 996 ln_trjwri = .false. ! Logical switch for writing out state trajectory 995 ln_bkgwri = .false. ! Logical switch for writing out background state 997 996 ln_trainc = .false. ! Logical switch for applying tracer increments 998 997 ln_dyninc = .false. ! Logical switch for applying velocity increments 999 ln_sshinc = .false. ! Logical switch for applying SSH increments 998 ln_sshinc = .false. ! Logical switch for applying SSH increments 1000 999 ln_asmdin = .false. ! Logical switch for Direct Initialization (DI) 1001 1000 ln_asmiau = .false. ! Logical switch for Incremental Analysis Updating (IAU) … … 1005 1004 nitiaufin = 15 ! Timestep of end of IAU interval in [0,nitend-nit000-1] 1006 1005 niaufn = 0 ! Type of IAU weighting function 1007 nittrjfrq = 0 ! Frequency of trajectory output for 4D-VAR1008 1006 ln_salfix = .false. ! Logical switch for ensuring that the sa > salfixmin 1009 1007 salfixmin = -9999 ! Minimum salinity after applying the increments -
branches/2012/dev_MERGE_2012/NEMOGCM/CONFIG/GYRE_BFM/EXP00/namelist
r3744 r3764 935 935 !----------------------------------------------------------------------- 936 936 ln_bkgwri = .false. ! Logical switch for writing out background state 937 ln_trjwri = .false. ! Logical switch for writing out state trajectory938 937 ln_trainc = .false. ! Logical switch for applying tracer increments 939 938 ln_dyninc = .false. ! Logical switch for applying velocity increments … … 946 945 nitiaufin = 15 ! Timestep of end of IAU interval in [0,nitend-nit000-1] 947 946 niaufn = 0 ! Type of IAU weighting function 948 nittrjfrq = 0 ! Frequency of trajectory output for 4D-VAR949 947 ln_salfix = .false. ! Logical switch for ensuring that the sa > salfixmin 950 948 salfixmin = -9999 ! Minimum salinity after applying the increments -
branches/2012/dev_MERGE_2012/NEMOGCM/CONFIG/ORCA2_LIM/EXP00/1_namelist
r3680 r3764 592 592 &namdyn_vor ! option of physics/algorithm (not control by CPP keys) 593 593 !----------------------------------------------------------------------- 594 ln_dynvor_ene = .false. ! en strophyconserving scheme595 ln_dynvor_ens = .false. ! en ergy conserving scheme594 ln_dynvor_ene = .false. ! energy conserving scheme 595 ln_dynvor_ens = .false. ! enstrophy conserving scheme 596 596 ln_dynvor_mix = .false. ! mixed scheme 597 597 ln_dynvor_een = .true. ! energy & enstrophy scheme … … 930 930 !----------------------------------------------------------------------- 931 931 ln_bkgwri = .false. ! Logical switch for writing out background state 932 ln_trjwri = .false. ! Logical switch for writing out state trajectory933 932 ln_trainc = .false. ! Logical switch for applying tracer increments 934 933 ln_dyninc = .false. ! Logical switch for applying velocity increments … … 941 940 nitiaufin = 15 ! Timestep of end of IAU interval in [0,nitend-nit000-1] 942 941 niaufn = 0 ! Type of IAU weighting function 943 nittrjfrq = 0 ! Frequency of trajectory output for 4D-VAR944 942 ln_salfix = .false. ! Logical switch for ensuring that the sa > salfixmin 945 943 salfixmin = -9999 ! Minimum salinity after applying the increments -
branches/2012/dev_MERGE_2012/NEMOGCM/CONFIG/ORCA2_LIM/EXP00/namelist
r3680 r3764 3 3 !! namelists 2 - Domain (namzgr, namzgr_sco, namdom, namtsd) 4 4 !! 3 - Surface boundary (namsbc, namsbc_ana, namsbc_flx, namsbc_clio, namsbc_core 5 !! namsbc_cpl, namtra_qsr, namsbc_rnf, 5 !! namsbc_cpl, namtra_qsr, namsbc_rnf, 6 6 !! namsbc_apr, namsbc_ssr, namsbc_alb) 7 7 !! 4 - lateral boundary (namlbc, namcla, namobc, namagrif, nambdy, nambdy_tide) … … 25 25 !----------------------------------------------------------------------- 26 26 nn_no = 0 ! job number (no more used...) 27 cn_exp = "ORCA2" ! experience name 27 cn_exp = "ORCA2" ! experience name 28 28 nn_it000 = 1 ! first time step 29 29 nn_itend = 5475 ! last time step (std 5475) … … 52 52 !! namzgr_sco s-coordinate or hybrid z-s-coordinate 53 53 !! namdom space and time domain (bathymetry, mesh, timestep) 54 !! namtsd data: temperature & salinity 54 !! namtsd data: temperature & salinity 55 55 !!====================================================================== 56 56 ! … … 107 107 / 108 108 !----------------------------------------------------------------------- 109 &namtsd ! data : Temperature & Salinity 109 &namtsd ! data : Temperature & Salinity 110 110 !----------------------------------------------------------------------- 111 111 ! ! file name ! frequency (hours) ! variable ! time interp. ! clim !'yearly' or ! weights ! rotation ! … … 138 138 &namsbc ! Surface Boundary Condition (surface module) 139 139 !----------------------------------------------------------------------- 140 nn_fsbc = 5 ! frequency of surface boundary condition computation 140 nn_fsbc = 5 ! frequency of surface boundary condition computation 141 141 ! (also = the frequency of sea-ice model call) 142 ln_ana = .false. ! analytical formulation (T => fill namsbc_ana ) 142 ln_ana = .false. ! analytical formulation (T => fill namsbc_ana ) 143 143 ln_flx = .false. ! flux formulation (T => fill namsbc_flx ) 144 ln_blk_clio = .false. ! CLIO bulk formulation (T => fill namsbc_clio) 145 ln_blk_core = .true. ! CORE bulk formulation (T => fill namsbc_core) 144 ln_blk_clio = .false. ! CLIO bulk formulation (T => fill namsbc_clio) 145 ln_blk_core = .true. ! CORE bulk formulation (T => fill namsbc_core) 146 146 ln_blk_mfs = .false. ! MFS bulk formulation (T => fill namsbc_mfs ) 147 147 ln_cpl = .false. ! Coupled formulation (T => fill namsbc_cpl ) … … 156 156 ln_rnf = .true. ! runoffs (T => fill namsbc_rnf) 157 157 ln_ssr = .true. ! Sea Surface Restoring on T and/or S (T => fill namsbc_ssr) 158 nn_fwb = 3 ! FreshWater Budget: =0 unchecked 159 ! =1 global mean of e-p-r set to zero at each time step 158 nn_fwb = 3 ! FreshWater Budget: =0 unchecked 159 ! =1 global mean of e-p-r set to zero at each time step 160 160 ! =2 annual global mean of e-p-r set to zero 161 161 ! =3 global emp set to zero and spread out over erp area … … 186 186 187 187 cn_dir = './' ! root directory for the location of the flux files 188 / 188 / 189 189 !----------------------------------------------------------------------- 190 190 &namsbc_clio ! namsbc_clio CLIO bulk formulae … … 243 243 ! ! ! categories ! reference ! orientation ! grids ! 244 244 ! send 245 sn_snd_temp = 'weighted oce and ice' , 'no' , '' , '' , '' 246 sn_snd_alb = 'weighted ice' , 'no' , '' , '' , '' 247 sn_snd_thick = 'none' , 'no' , '' , '' , '' 248 sn_snd_crt = 'none' , 'no' , 'spherical' , 'eastward-northward' , 'T' 249 sn_snd_co2 = 'coupled' , 'no' , '' , '' , '' 245 sn_snd_temp = 'weighted oce and ice' , 'no' , '' , '' , '' 246 sn_snd_alb = 'weighted ice' , 'no' , '' , '' , '' 247 sn_snd_thick = 'none' , 'no' , '' , '' , '' 248 sn_snd_crt = 'none' , 'no' , 'spherical' , 'eastward-northward' , 'T' 249 sn_snd_co2 = 'coupled' , 'no' , '' , '' , '' 250 250 ! receive 251 sn_rcv_w10m = 'none' , 'no' , '' , '' , '' 252 sn_rcv_taumod = 'coupled' , 'no' , '' , '' , '' 253 sn_rcv_tau = 'oce only' , 'no' , 'cartesian' , 'eastward-northward', 'U,V' 254 sn_rcv_dqnsdt = 'coupled' , 'no' , '' , '' , '' 255 sn_rcv_qsr = 'oce and ice' , 'no' , '' , '' , '' 256 sn_rcv_qns = 'oce and ice' , 'no' , '' , '' , '' 257 sn_rcv_emp = 'conservative' , 'no' , '' , '' , '' 258 sn_rcv_rnf = 'coupled' , 'no' , '' , '' , '' 259 sn_rcv_cal = 'coupled' , 'no' , '' , '' , '' 260 sn_rcv_co2 = 'coupled' , 'no' , '' , '' , '' 251 sn_rcv_w10m = 'none' , 'no' , '' , '' , '' 252 sn_rcv_taumod = 'coupled' , 'no' , '' , '' , '' 253 sn_rcv_tau = 'oce only' , 'no' , 'cartesian' , 'eastward-northward', 'U,V' 254 sn_rcv_dqnsdt = 'coupled' , 'no' , '' , '' , '' 255 sn_rcv_qsr = 'oce and ice' , 'no' , '' , '' , '' 256 sn_rcv_qns = 'oce and ice' , 'no' , '' , '' , '' 257 sn_rcv_emp = 'conservative' , 'no' , '' , '' , '' 258 sn_rcv_rnf = 'coupled' , 'no' , '' , '' , '' 259 sn_rcv_cal = 'coupled' , 'no' , '' , '' , '' 260 sn_rcv_co2 = 'coupled' , 'no' , '' , '' , '' 261 261 / 262 262 !----------------------------------------------------------------------- … … 318 318 cn_dir = './' ! root directory for the location of the runoff files 319 319 nn_sstr = 0 ! add a retroaction term in the surface heat flux (=1) or not (=0) 320 nn_sssr = 2 ! add a damping term in the surface freshwater flux (=2) 320 nn_sssr = 2 ! add a damping term in the surface freshwater flux (=2) 321 321 ! or to SSS only (=1) or no damping term (=0) 322 322 rn_dqdt = -40. ! magnitude of the retroaction on temperature [W/m2/K] … … 324 324 ln_sssr_bnd = .true. ! flag to bound erp term (associated with nn_sssr=2) 325 325 rn_sssr_bnd = 4.e0 ! ABS(Max/Min) value of the damping erp term [mm/day] 326 / 326 / 327 327 !----------------------------------------------------------------------- 328 328 &namsbc_alb ! albedo parameters 329 329 !----------------------------------------------------------------------- 330 rn_cloud = 0.06 ! cloud correction to snow and ice albedo 330 rn_cloud = 0.06 ! cloud correction to snow and ice albedo 331 331 rn_albice = 0.53 ! albedo of melting ice in the arctic and antarctic 332 332 rn_alphd = 0.80 ! coefficients for linear interpolation used to 333 rn_alphc = 0.65 ! compute albedo between two extremes values 333 rn_alphc = 0.65 ! compute albedo between two extremes values 334 334 rn_alphdi = 0.72 ! (Pyane, 1972) 335 335 / … … 375 375 !! namcla cross land advection 376 376 !! namobc open boundaries parameters ("key_obc") 377 !! namagrif agrif nested grid ( read by child model only ) ("key_agrif") 377 !! namagrif agrif nested grid ( read by child model only ) ("key_agrif") 378 378 !! nambdy Unstructured open boundaries ("key_bdy") 379 379 !! namtide Tidal forcing at open boundaries ("key_bdy_tides") … … 397 397 ln_obc_clim = .false. ! climatological obc data files (T) or not (F) 398 398 ln_vol_cst = .true. ! impose the total volume conservation (T) or not (F) 399 ln_obc_fla = .false. ! Flather open boundary condition 399 ln_obc_fla = .false. ! Flather open boundary condition 400 400 nn_obcdta = 1 ! = 0 the obc data are equal to the initial state 401 401 ! = 1 the obc data are read in 'obc.dta' files … … 441 441 &nambdy ! unstructured open boundaries ("key_bdy") 442 442 !----------------------------------------------------------------------- 443 nb_bdy = 1 ! number of open boundary sets 443 nb_bdy = 1 ! number of open boundary sets 444 444 ln_coords_file = .true. ! =T : read bdy coordinates from file 445 445 cn_coords_file = 'coordinates.bdy.nc' ! bdy coordinates files … … 477 477 / 478 478 !----------------------------------------------------------------------- 479 &nambdy_tide ! tidal forcing at open boundaries 479 &nambdy_tide ! tidal forcing at open boundaries 480 480 !----------------------------------------------------------------------- 481 481 filtide = 'bdydta/amm12_bdytide_' ! file name root of tidal forcing files … … 516 516 !!====================================================================== 517 517 !! nambfr bottom friction 518 !! nambbc bottom temperature boundary condition 518 !! nambbc bottom temperature boundary condition 519 519 !! nambbl bottom boundary layer scheme ("key_trabbl") 520 520 !!====================================================================== … … 536 536 !----------------------------------------------------------------------- 537 537 ln_trabbc = .true. ! Apply a geothermal heating at the ocean bottom 538 nn_geoflx = 2 ! geothermal heat flux: = 0 no flux 538 nn_geoflx = 2 ! geothermal heat flux: = 0 no flux 539 539 ! = 1 constant flux 540 ! = 2 variable flux (read in geothermal_heating.nc in mW/m2) 540 ! = 2 variable flux (read in geothermal_heating.nc in mW/m2) 541 541 rn_geoflx_cst = 86.4e-3 ! Constant value of geothermal heat flux [W/m2] 542 542 / … … 556 556 !! namtra_adv advection scheme 557 557 !! namtra_ldf lateral diffusion scheme 558 !! namtra_dmp T & S newtonian damping 558 !! namtra_dmp T & S newtonian damping 559 559 !!====================================================================== 560 560 ! … … 570 570 / 571 571 !----------------------------------------------------------------------- 572 &namtra_adv ! advection scheme for tracer 573 !----------------------------------------------------------------------- 574 ln_traadv_cen2 = .false. ! 2nd order centered scheme 575 ln_traadv_tvd = .true. ! TVD scheme 576 ln_traadv_muscl = .false. ! MUSCL scheme 577 ln_traadv_muscl2 = .false. ! MUSCL2 scheme + cen2 at boundaries 578 ln_traadv_ubs = .false. ! UBS scheme 579 ln_traadv_qck = .false. ! QUICKEST scheme 572 &namtra_adv ! advection scheme for tracer 573 !----------------------------------------------------------------------- 574 ln_traadv_cen2 = .false. ! 2nd order centered scheme 575 ln_traadv_tvd = .true. ! TVD scheme 576 ln_traadv_muscl = .false. ! MUSCL scheme 577 ln_traadv_muscl2 = .false. ! MUSCL2 scheme + cen2 at boundaries 578 ln_traadv_ubs = .false. ! UBS scheme 579 ln_traadv_qck = .false. ! QUICKEST scheme 580 580 ln_traadv_msc_ups= .false. ! use upstream scheme within muscl 581 581 / … … 605 605 / 606 606 !----------------------------------------------------------------------- 607 &namtra_dmp ! tracer: T & S newtonian damping 607 &namtra_dmp ! tracer: T & S newtonian damping 608 608 !----------------------------------------------------------------------- 609 609 ln_tradmp = .true. ! add a damping termn (T) or not (F) … … 633 633 &namdyn_adv ! formulation of the momentum advection 634 634 !----------------------------------------------------------------------- 635 ln_dynadv_vec = .true. ! vector form (T) or flux form (F) 635 ln_dynadv_vec = .true. ! vector form (T) or flux form (F) 636 636 ln_dynadv_cen2= .false. ! flux form - 2nd order centered scheme 637 ln_dynadv_ubs = .false. ! flux form - 3rd order UBS scheme 638 / 637 ln_dynadv_ubs = .false. ! flux form - 3rd order UBS scheme 638 / 639 639 !----------------------------------------------------------------------- 640 640 &namdyn_vor ! option of physics/algorithm (not control by CPP keys) 641 641 !----------------------------------------------------------------------- 642 ln_dynvor_ene = .false. ! enstrophy conserving scheme 643 ln_dynvor_ens = .false. ! energy conserving scheme 644 ln_dynvor_mix = .false. ! mixed scheme 645 ln_dynvor_een = .true. ! energy & enstrophy scheme 642 ln_dynvor_ene = .false. ! enstrophy conserving scheme 643 ln_dynvor_ens = .false. ! energy conserving scheme 644 ln_dynvor_mix = .false. ! mixed scheme 645 ln_dynvor_een = .true. ! energy & enstrophy scheme 646 646 / 647 647 !----------------------------------------------------------------------- 648 648 &namdyn_hpg ! Hydrostatic pressure gradient option 649 649 !----------------------------------------------------------------------- 650 ln_hpg_zco = .false. ! z-coordinate - full steps 650 ln_hpg_zco = .false. ! z-coordinate - full steps 651 651 ln_hpg_zps = .true. ! z-coordinate - partial steps (interpolation) 652 652 ln_hpg_sco = .false. ! s-coordinate (standard jacobian formulation) … … 666 666 &namdyn_ldf ! lateral diffusion on momentum 667 667 !----------------------------------------------------------------------- 668 ! ! Type of the operator : 669 ln_dynldf_lap = .true. ! laplacian operator 670 ln_dynldf_bilap = .false. ! bilaplacian operator 671 ! ! Direction of action : 672 ln_dynldf_level = .false. ! iso-level 668 ! ! Type of the operator : 669 ln_dynldf_lap = .true. ! laplacian operator 670 ln_dynldf_bilap = .false. ! bilaplacian operator 671 ! ! Direction of action : 672 ln_dynldf_level = .false. ! iso-level 673 673 ln_dynldf_hor = .true. ! horizontal (geopotential) (require "key_ldfslp" in s-coord.) 674 674 ln_dynldf_iso = .false. ! iso-neutral (require "key_ldfslp") … … 676 676 rn_ahm_0_lap = 40000. ! horizontal laplacian eddy viscosity [m2/s] 677 677 rn_ahmb_0 = 0. ! background eddy viscosity for ldf_iso [m2/s] 678 rn_ahm_0_blp = 0. ! horizontal bilaplacian eddy viscosity [m4/s] 678 rn_ahm_0_blp = 0. ! horizontal bilaplacian eddy viscosity [m4/s] 679 679 / 680 680 … … 749 749 &namzdf_kpp ! K-Profile Parameterization dependent vertical mixing ("key_zdfkpp", and optionally: 750 750 !------------------------------------------------------------------------ "key_kppcustom" or "key_kpplktb") 751 ln_kpprimix = .true. ! shear instability mixing 751 ln_kpprimix = .true. ! shear instability mixing 752 752 rn_difmiw = 1.0e-04 ! constant internal wave viscosity [m2/s] 753 753 rn_difsiw = 0.1e-04 ! constant internal wave diffusivity [m2/s] 754 754 rn_riinfty = 0.8 ! local Richardson Number limit for shear instability 755 755 rn_difri = 0.0050 ! maximum shear mixing at Rig = 0 [m2/s] 756 rn_bvsqcon = -0.01e-07 ! Brunt-Vaisala squared for maximum convection [1/s2] 757 rn_difcon = 1. ! maximum mixing in interior convection [m2/s] 756 rn_bvsqcon = -0.01e-07 ! Brunt-Vaisala squared for maximum convection [1/s2] 757 rn_difcon = 1. ! maximum mixing in interior convection [m2/s] 758 758 nn_avb = 0 ! horizontal averaged (=1) or not (=0) on avt and amv 759 759 nn_ave = 1 ! constant (=0) or profile (=1) background on avt … … 789 789 rn_n2min = 1.e-8 ! threshold of the Brunt-Vaisala frequency (s-1) 790 790 rn_tfe = 0.333 ! tidal dissipation efficiency 791 rn_me = 0.2 ! mixing efficiency 791 rn_me = 0.2 ! mixing efficiency 792 792 ln_tmx_itf = .true. ! ITF specific parameterisation 793 793 rn_tfe_itf = 1. ! ITF tidal dissipation efficiency … … 799 799 !! nammpp Massively Parallel Processing ("key_mpp_mpi) 800 800 !! namctl Control prints & Benchmark 801 !! namsol elliptic solver / island / free surface 802 !!====================================================================== 803 ! 804 !----------------------------------------------------------------------- 805 &namsol ! elliptic solver / island / free surface 801 !! namsol elliptic solver / island / free surface 802 !!====================================================================== 803 ! 804 !----------------------------------------------------------------------- 805 &namsol ! elliptic solver / island / free surface 806 806 !----------------------------------------------------------------------- 807 807 nn_solv = 1 ! elliptic solver: =1 preconditioned conjugate gradient (pcg) … … 849 849 !! namflo float parameters ("key_float") 850 850 !! namptr Poleward Transport Diagnostics 851 !! namhsb Heat and salt budgets 851 !! namhsb Heat and salt budgets 852 852 !!====================================================================== 853 853 ! … … 881 881 jpnnewflo = 0 ! number of floats for the restart 882 882 ln_rstflo = .false. ! float restart (T) or not (F) 883 nn_writefl = 75 ! frequency of writing in float output file 884 nn_stockfl = 5475 ! frequency of creation of the float restart file 883 nn_writefl = 75 ! frequency of writing in float output file 884 nn_stockfl = 5475 ! frequency of creation of the float restart file 885 885 ln_argo = .false. ! Argo type floats (stay at the surface each 10 days) 886 886 ln_flork4 = .false. ! trajectories computed with a 4th order Runge-Kutta (T) … … 894 894 ln_diaptr = .false. ! Poleward heat and salt transport (T) or not (F) 895 895 ln_diaznl = .true. ! Add zonal means and meridional stream functions 896 ln_subbas = .true. ! Atlantic/Pacific/Indian basins computation (T) or not 896 ln_subbas = .true. ! Atlantic/Pacific/Indian basins computation (T) or not 897 897 ! (orca configuration only, need input basins mask file named "subbasins.nc" 898 898 ln_ptrcomp = .true. ! Add decomposition : overturning … … 901 901 / 902 902 !----------------------------------------------------------------------- 903 &namhsb ! Heat and salt budgets 903 &namhsb ! Heat and salt budgets 904 904 !----------------------------------------------------------------------- 905 905 ln_diahsb = .false. ! check the heat and salt budgets (T) or not (F) … … 934 934 &namobs ! observation usage switch ('key_diaobs') 935 935 !----------------------------------------------------------------------- 936 ln_t3d = .false. ! Logical switch for T profile observations 937 ln_s3d = .false. ! Logical switch for S profile observations 938 ln_ena = .false. ! Logical switch for ENACT insitu data set 939 ! ! ln_cor Logical switch for Coriolis insitu data set 940 ln_profb = .false. ! Logical switch for feedback insitu data set 941 ln_sla = .false. ! Logical switch for SLA observations 942 943 ln_sladt = .false. ! Logical switch for AVISO SLA data 944 945 ln_slafb = .false. ! Logical switch for feedback SLA data 946 ! ln_ssh Logical switch for SSH observations 936 ln_t3d = .false. ! Logical switch for T profile observations 937 ln_s3d = .false. ! Logical switch for S profile observations 938 ln_ena = .false. ! Logical switch for ENACT insitu data set 939 ! ! ln_cor Logical switch for Coriolis insitu data set 940 ln_profb = .false. ! Logical switch for feedback insitu data set 941 ln_sla = .false. ! Logical switch for SLA observations 942 943 ln_sladt = .false. ! Logical switch for AVISO SLA data 944 945 ln_slafb = .false. ! Logical switch for feedback SLA data 946 ! ln_ssh Logical switch for SSH observations 947 947 948 948 ln_sst = .true. ! Logical switch for SST observations … … 950 950 ln_ghrsst = .false. ! ln_ghrsst Logical switch for GHRSST observations 951 951 952 ln_sstfb = .false. ! Logical switch for feedback SST data 953 ! ln_sss Logical switch for SSS observations 954 ! ln_seaice Logical switch for Sea Ice observations 955 ! ln_vel3d Logical switch for velocity observations 956 ! ln_velavcur Logical switch for velocity daily av. cur. 957 ! ln_velhrcur Logical switch for velocity high freq. cur. 958 ! ln_velavadcp Logical switch for velocity daily av. ADCP 952 ln_sstfb = .false. ! Logical switch for feedback SST data 953 ! ln_sss Logical switch for SSS observations 954 ! ln_seaice Logical switch for Sea Ice observations 955 ! ln_vel3d Logical switch for velocity observations 956 ! ln_velavcur Logical switch for velocity daily av. cur. 957 ! ln_velhrcur Logical switch for velocity high freq. cur. 958 ! ln_velavadcp Logical switch for velocity daily av. ADCP 959 959 ! ln_velhradcp Logical switch for velocity high freq. ADCP 960 ! ln_velfb Logical switch for feedback velocity data 961 ! ln_grid_global Global distribtion of observations 962 ! ln_grid_search_lookup Logical switch for obs grid search w/lookup table 963 ! grid_search_file Grid search lookup file header 964 ! enactfiles ENACT input observation file names 965 ! coriofiles Coriolis input observation file name 966 ! ! profbfiles: Profile feedback input observation file name 960 ! ln_velfb Logical switch for feedback velocity data 961 ! ln_grid_global Global distribtion of observations 962 ! ln_grid_search_lookup Logical switch for obs grid search w/lookup table 963 ! grid_search_file Grid search lookup file header 964 ! enactfiles ENACT input observation file names 965 ! coriofiles Coriolis input observation file name 966 ! ! profbfiles: Profile feedback input observation file name 967 967 profbfiles = 'profiles_01.nc' 968 ! ln_profb_enatim Enact feedback input time setting switch 968 ! ln_profb_enatim Enact feedback input time setting switch 969 969 ! slafilesact Active SLA input observation file name 970 ! slafilespas Passive SLA input observation file name 971 ! ! slafbfiles: Feedback SLA input observation file name 970 ! slafilespas Passive SLA input observation file name 971 ! ! slafbfiles: Feedback SLA input observation file name 972 972 slafbfiles = 'sla_01.nc' 973 ! sstfiles GHRSST input observation file name 974 ! ! sstfbfiles: Feedback SST input observation file name 973 ! sstfiles GHRSST input observation file name 974 ! ! sstfbfiles: Feedback SST input observation file name 975 975 sstfbfiles = 'sst_01.nc' 'sst_02.nc' 'sst_03.nc' 'sst_04.nc' 'sst_05.nc' 976 ! seaicefiles Sea Ice input observation file name 977 ! velavcurfiles Vel. cur. daily av. input file name 978 ! velhvcurfiles Vel. cur. high freq. input file name 979 ! velavadcpfiles Vel. ADCP daily av. input file name 980 ! velhvadcpfiles Vel. ADCP high freq. input file name 981 ! velfbfiles Vel. feedback input observation file name 982 ! dobsini Initial date in window YYYYMMDD.HHMMSS 983 ! dobsend Final date in window YYYYMMDD.HHMMSS 984 ! n1dint Type of vertical interpolation method 985 ! n2dint Type of horizontal interpolation method 986 ! ln_nea Rejection of observations near land switch 987 nmsshc = 0 ! MSSH correction scheme 988 ! mdtcorr MDT correction 989 ! mdtcutoff MDT cutoff for computed correction 990 ln_altbias = .false. ! Logical switch for alt bias 991 ln_ignmis = .true. ! Logical switch for ignoring missing files 992 ! endailyavtypes ENACT daily average types 976 ! seaicefiles Sea Ice input observation file name 977 ! velavcurfiles Vel. cur. daily av. input file name 978 ! velhvcurfiles Vel. cur. high freq. input file name 979 ! velavadcpfiles Vel. ADCP daily av. input file name 980 ! velhvadcpfiles Vel. ADCP high freq. input file name 981 ! velfbfiles Vel. feedback input observation file name 982 ! dobsini Initial date in window YYYYMMDD.HHMMSS 983 ! dobsend Final date in window YYYYMMDD.HHMMSS 984 ! n1dint Type of vertical interpolation method 985 ! n2dint Type of horizontal interpolation method 986 ! ln_nea Rejection of observations near land switch 987 nmsshc = 0 ! MSSH correction scheme 988 ! mdtcorr MDT correction 989 ! mdtcutoff MDT cutoff for computed correction 990 ln_altbias = .false. ! Logical switch for alt bias 991 ln_ignmis = .true. ! Logical switch for ignoring missing files 992 ! endailyavtypes ENACT daily average types 993 993 ln_grid_global = .true. 994 994 ln_grid_search_lookup = .false. 995 / 995 / 996 996 !----------------------------------------------------------------------- 997 997 &nam_asminc ! assimilation increments ('key_asminc') 998 998 !----------------------------------------------------------------------- 999 ln_bkgwri = .false. ! Logical switch for writing out background state 1000 ln_trjwri = .false. ! Logical switch for writing out state trajectory 999 ln_bkgwri = .false. ! Logical switch for writing out background state 1001 1000 ln_trainc = .false. ! Logical switch for applying tracer increments 1002 1001 ln_dyninc = .false. ! Logical switch for applying velocity increments 1003 ln_sshinc = .false. ! Logical switch for applying SSH increments 1002 ln_sshinc = .false. ! Logical switch for applying SSH increments 1004 1003 ln_asmdin = .false. ! Logical switch for Direct Initialization (DI) 1005 1004 ln_asmiau = .false. ! Logical switch for Incremental Analysis Updating (IAU) … … 1009 1008 nitiaufin = 15 ! Timestep of end of IAU interval in [0,nitend-nit000-1] 1010 1009 niaufn = 0 ! Type of IAU weighting function 1011 nittrjfrq = 0 ! Frequency of trajectory output for 4D-VAR1012 1010 ln_salfix = .false. ! Logical switch for ensuring that the sa > salfixmin 1013 1011 salfixmin = -9999 ! Minimum salinity after applying the increments -
branches/2012/dev_MERGE_2012/NEMOGCM/CONFIG/ORCA2_LIM_CFC_C14b/EXP00/1_namelist
r3567 r3764 882 882 !----------------------------------------------------------------------- 883 883 ln_bkgwri = .false. ! Logical switch for writing out background state 884 ln_trjwri = .false. ! Logical switch for writing out state trajectory885 884 ln_trainc = .false. ! Logical switch for applying tracer increments 886 885 ln_dyninc = .false. ! Logical switch for applying velocity increments … … 893 892 nitiaufin = 15 ! Timestep of end of IAU interval in [0,nitend-nit000-1] 894 893 niaufn = 0 ! Type of IAU weighting function 895 nittrjfrq = 0 ! Frequency of trajectory output for 4D-VAR896 894 ln_salfix = .false. ! Logical switch for ensuring that the sa > salfixmin 897 895 salfixmin = -9999 ! Minimum salinity after applying the increments -
branches/2012/dev_MERGE_2012/NEMOGCM/CONFIG/ORCA2_LIM_CFC_C14b/EXP00/namelist
r3657 r3764 945 945 !----------------------------------------------------------------------- 946 946 ln_bkgwri = .false. ! Logical switch for writing out background state 947 ln_trjwri = .false. ! Logical switch for writing out state trajectory948 947 ln_trainc = .false. ! Logical switch for applying tracer increments 949 948 ln_dyninc = .false. ! Logical switch for applying velocity increments … … 956 955 nitiaufin = 15 ! Timestep of end of IAU interval in [0,nitend-nit000-1] 957 956 niaufn = 0 ! Type of IAU weighting function 958 nittrjfrq = 0 ! Frequency of trajectory output for 4D-VAR959 957 ln_salfix = .false. ! Logical switch for ensuring that the sa > salfixmin 960 958 salfixmin = -9999 ! Minimum salinity after applying the increments -
branches/2012/dev_MERGE_2012/NEMOGCM/CONFIG/ORCA2_OFF_PISCES/EXP00/namelist
r3688 r3764 616 616 &namdyn_vor ! option of physics/algorithm (not control by CPP keys) 617 617 !----------------------------------------------------------------------- 618 ln_dynvor_ene = .false. ! en strophyconserving scheme619 ln_dynvor_ens = .false. ! en ergy conserving scheme618 ln_dynvor_ene = .false. ! energy conserving scheme 619 ln_dynvor_ens = .false. ! enstrophy conserving scheme 620 620 ln_dynvor_mix = .false. ! mixed scheme 621 621 ln_dynvor_een = .true. ! energy & enstrophy scheme … … 990 990 !----------------------------------------------------------------------- 991 991 ln_bkgwri = .false. ! Logical switch for writing out background state 992 ln_trjwri = .false. ! Logical switch for writing out state trajectory993 992 ln_trainc = .false. ! Logical switch for applying tracer increments 994 993 ln_dyninc = .false. ! Logical switch for applying velocity increments … … 1001 1000 nitiaufin = 15 ! Timestep of end of IAU interval in [0,nitend-nit000-1] 1002 1001 niaufn = 0 ! Type of IAU weighting function 1003 nittrjfrq = 0 ! Frequency of trajectory output for 4D-VAR1004 1002 ln_salfix = .false. ! Logical switch for ensuring that the sa > salfixmin 1005 1003 salfixmin = -9999 ! Minimum salinity after applying the increments -
branches/2012/dev_MERGE_2012/NEMOGCM/CONFIG/ORCA2_SAS_LIM/EXP00/1_namelist
r3331 r3764 895 895 !----------------------------------------------------------------------- 896 896 ln_bkgwri = .false. ! Logical switch for writing out background state 897 ln_trjwri = .false. ! Logical switch for writing out state trajectory898 897 ln_trainc = .false. ! Logical switch for applying tracer increments 899 898 ln_dyninc = .false. ! Logical switch for applying velocity increments … … 906 905 nitiaufin = 15 ! Timestep of end of IAU interval in [0,nitend-nit000-1] 907 906 niaufn = 0 ! Type of IAU weighting function 908 nittrjfrq = 0 ! Frequency of trajectory output for 4D-VAR909 907 ln_salfix = .false. ! Logical switch for ensuring that the sa > salfixmin 910 908 salfixmin = -9999 ! Minimum salinity after applying the increments -
branches/2012/dev_MERGE_2012/NEMOGCM/CONFIG/ORCA2_SAS_LIM/EXP00/namelist
r3614 r3764 994 994 !----------------------------------------------------------------------- 995 995 ln_bkgwri = .false. ! Logical switch for writing out background state 996 ln_trjwri = .false. ! Logical switch for writing out state trajectory997 996 ln_trainc = .false. ! Logical switch for applying tracer increments 998 997 ln_dyninc = .false. ! Logical switch for applying velocity increments … … 1005 1004 nitiaufin = 15 ! Timestep of end of IAU interval in [0,nitend-nit000-1] 1006 1005 niaufn = 0 ! Type of IAU weighting function 1007 nittrjfrq = 0 ! Frequency of trajectory output for 4D-VAR1008 1006 ln_salfix = .false. ! Logical switch for ensuring that the sa > salfixmin 1009 1007 salfixmin = -9999 ! Minimum salinity after applying the increments -
branches/2012/dev_MERGE_2012/NEMOGCM/CONFIG/makenemo
r3742 r3764 2 2 #set -x 3 3 set -o posix 4 #set -u 4 #set -u 5 5 #set -e 6 6 #+ … … 29 29 # 30 30 # - to choose MYCONFIG 31 # - to choose compiler options 31 # - to choose compiler options 32 32 # - to create the CONFIG/MYCONFIG/WORK directory 33 33 # - to compile this configuration … … 38 38 # 39 39 # - NEW_CONF : configuration to be created 40 # - REF_CONF : reference configuration to build the new one 41 # - CMP_NAM : compiler name 42 # - NBR_PRC : number of processes used to compile 40 # - REF_CONF : reference configuration to build the new one 41 # - CMP_NAM : compiler name 42 # - NBR_PRC : number of processes used to compile 43 43 # - NEM_SUBDIR : NEMO subdirectory used (specified) 44 44 # 45 45 # Locally defined : 46 46 # 47 # - TAB : NEMO subdirectory used (read) 47 # - TAB : NEMO subdirectory used (read) 48 48 # - MAIN_DIR : self explaining 49 # - CONFIG_DIR : " " " 50 # - MODELES_DIR : " " " 51 # - TOOLS_DIR : " " " 49 # - CONFIG_DIR : " " " 50 # - MODELES_DIR : " " " 51 # - TOOLS_DIR : " " " 52 52 # - NEMO_DIR : " " " 53 53 # … … 134 134 echo "makenemo -n MY_CONFIG -d \"OPA_SRC LIM_SRC_2\""; 135 135 echo ""; 136 echo "Available configurations :"; cat ${CONFIG_DIR}/cfg.txt; 136 echo "Available configurations :"; cat ${CONFIG_DIR}/cfg.txt; 137 137 echo ""; 138 138 echo "Example to remove bad configuration "; … … 190 190 ;; 191 191 *) 192 echo " \"$1\" BAD OPTION" 192 echo " \"$1\" BAD OPTION" 193 193 exit 194 194 ;; 195 195 196 196 esac 197 197 shift … … 216 216 #- Check if the tool or the compiler exist or list it 217 217 if [ "${NEW_CONF}" == help ] ; then 218 echo "Available configurations :" 218 echo "Available configurations :" 219 219 cat ${CONFIG_DIR}/cfg.txt 220 220 exit … … 228 228 #- Choose a default configuration if needed --- 229 229 #- ORCA2_LIM or last one used --- 230 . ${COMPIL_DIR}/Fcheck_config.sh cfg.txt ${NEW_CONF} || exit 230 . ${COMPIL_DIR}/Fcheck_config.sh cfg.txt ${NEW_CONF} || exit 231 231 232 232 … … 235 235 echo "You are installing a new configuration" 236 236 ind=0 237 . ${COMPIL_DIR}/Fread_dir.sh OPA_SRC YES 238 . ${COMPIL_DIR}/Fread_dir.sh LIM_SRC_2 YES 239 . ${COMPIL_DIR}/Fread_dir.sh LIM_SRC_3 NO 240 . ${COMPIL_DIR}/Fread_dir.sh TOP_SRC NO 241 . ${COMPIL_DIR}/Fread_dir.sh NST_SRC YES 242 . ${COMPIL_DIR}/Fread_dir.sh OFF_SRC NO 237 . ${COMPIL_DIR}/Fread_dir.sh OPA_SRC YES 238 . ${COMPIL_DIR}/Fread_dir.sh LIM_SRC_2 YES 239 . ${COMPIL_DIR}/Fread_dir.sh LIM_SRC_3 NO 240 . ${COMPIL_DIR}/Fread_dir.sh TOP_SRC NO 241 . ${COMPIL_DIR}/Fread_dir.sh NST_SRC YES 242 . ${COMPIL_DIR}/Fread_dir.sh OFF_SRC NO 243 243 REF_CONF=ORCA2_LIM 244 244 elif [ ${#NEM_SUBDIR} -gt 0 ] && [ ${#REF_CONF} -eq 0 ]; then … … 248 248 elif [ ${#NEM_SUBDIR} -eq 0 ] && [ ${#REF_CONF} -gt 0 ]; then 249 249 echo "You are installing a new configuration based on ${REF_CONF}" 250 . ${COMPIL_DIR}/Fcopy_dir.sh ${REF_CONF} 250 . ${COMPIL_DIR}/Fcopy_dir.sh ${REF_CONF} 251 251 fi 252 252 NEW_CONF=${x_n} … … 272 272 #- We add or remove keys 273 273 if [ ${#list_add_key} -ne 0 ] ; then 274 . ${COMPIL_DIR}/Fadd_keys.sh ${NEW_CONF} add_key ${list_add_key} 274 . ${COMPIL_DIR}/Fadd_keys.sh ${NEW_CONF} add_key ${list_add_key} 275 275 fi 276 276 -
branches/2012/dev_MERGE_2012/NEMOGCM/EXTERNAL/fcm/lib/Fcm/CfgLine.pm
r2281 r3764 205 205 206 206 for my $i (0 .. $#fields) { 207 next if lc ($fields[$i]) eq lc ($all_fields[$i] );207 next if lc ($fields[$i]) eq lc ($all_fields[$i] || ''); 208 208 $return = 0; 209 209 last; -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/LIM_SRC_2/dom_ice_2.F90
r2715 r3764 32 32 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: tms , tmu !: temperature and velocity points masks 33 33 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) :: wght !: weight of the 4 neighbours to compute averages 34 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: tmv !: y-velocity mask used for evp rheology 34 35 35 36 # if defined key_lim2_vp37 36 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) :: akappa , bkappa !: first and third group of metric coefficients 38 37 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:,:,:) :: alambd !: second group of metric coefficients 39 # else 40 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: tmv , tmf !: y-velocity and F-points masks 38 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: tmf !: F-points masks 41 39 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: tmi !: ice mask: =1 if ice thick > 0 42 # endif43 40 !!---------------------------------------------------------------------- 44 41 CONTAINS -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/LIM_SRC_2/limtrp_2.F90
r3680 r3764 31 31 USE agrif_lim2_interp ! nesting 32 32 # endif 33 USE lib_fortran ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined) 33 34 34 35 IMPLICIT NONE -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/LIM_SRC_2/limwri_2.F90
r3625 r3764 105 105 !! 106 106 INTEGER :: ji, jj, jf ! dummy loop indices 107 CHARACTER(len = 40) :: clhstnam, clop107 CHARACTER(len = 80) :: clhstnam, clop 108 108 REAL(wp) :: zsto, zjulian, zout, & ! temporary scalars 109 109 & zindh, zinda, zindb, ztmu … … 161 161 zcmo(ji,jj,5) = sist (ji,jj) 162 162 zcmo(ji,jj,6) = fbif (ji,jj) 163 IF (lk_lim2_vp) THEN 163 164 zcmo(ji,jj,7) = zindb * ( u_ice(ji,jj ) * tmu(ji,jj ) + u_ice(ji+1,jj ) * tmu(ji+1,jj ) & 164 165 + u_ice(ji,jj+1) * tmu(ji,jj+1) + u_ice(ji+1,jj+1) * tmu(ji+1,jj+1) ) & … … 168 169 + v_ice(ji,jj+1) * tmu(ji,jj+1) + v_ice(ji+1,jj+1) * tmu(ji+1,jj+1) ) & 169 170 / ztmu 171 ELSE 172 173 zcmo(ji,jj,7) = zindb * ( u_ice(ji,jj ) * tmu(ji,jj) & 174 & + u_ice(ji-1,jj) * tmu(ji-1,jj) ) & 175 & / 2.0 176 zcmo(ji,jj,8) = zindb * ( v_ice(ji,jj ) * tmv(ji,jj) & 177 & + v_ice(ji,jj-1) * tmv(ji,jj-1) ) & 178 & / 2.0 179 180 ENDIF 170 181 zcmo(ji,jj,9) = sst_m(ji,jj) 171 182 zcmo(ji,jj,10) = sss_m(ji,jj) … … 187 198 niter = niter + 1 188 199 DO jf = 1 , noumef 189 DO jj = 1 , jpj 190 DO ji = 1 , jpi 191 zfield(ji,jj) = zcmo(ji,jj,jf) * cmulti(jf) + cadd(jf) 192 END DO 193 END DO 194 195 IF( jf == 7 .OR. jf == 8 .OR. jf == 15 .OR. jf == 16 ) THEN 200 zfield(:,:) = zcmo(:,:,jf) * cmulti(jf) + cadd(jf) * tmask(:,:,1) 201 SELECT CASE ( jf ) 202 CASE ( 7, 8, 15, 16, 20, 21 ) ! velocity or stress fields (vectors) 196 203 CALL lbc_lnk( zfield, 'T', -1. ) 197 ELSE204 CASE DEFAULT ! scalar fields 198 205 CALL lbc_lnk( zfield, 'T', 1. ) 199 END IF200 206 END SELECT 207 201 208 IF( nc(jf) == 1 ) CALL histwrite( nice, nam(jf), niter, zfield, ndim, ndex51 ) 202 209 203 210 END DO 204 211 205 212 IF( ( nn_fsbc * niter ) >= nitend ) CALL histclo( nice ) 206 213 … … 209 216 END SUBROUTINE lim_wri_2 210 217 211 # endif218 #endif 212 219 213 220 SUBROUTINE lim_wri_init_2 -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/LIM_SRC_2/limwri_dimg_2.h90
r3625 r3764 20 20 INTEGER , SAVE :: nmoyice !: counter for averaging 21 21 INTEGER , SAVE :: nwf !: number of fields to write on disk 22 INTEGER , SAVE, DIMENSION(:), ALLOCATABLE :: nsubindex !: subindex to be saved22 INTEGER, SAVE,DIMENSION (:), ALLOCATABLE :: nsubindex !: subindex to be saved 23 23 INTEGER , SAVE :: nice, nhorid, ndim, niter, ndepid 24 24 REAL(wp), SAVE, DIMENSION(:,:,:), ALLOCATABLE :: rcmoy … … 30 30 REAL(wp), DIMENSION(1) :: zdept 31 31 REAL(wp) :: zsto, zsec, zjulian,zout 32 REAL(wp) :: zindh,zinda,zindb, ztmu 33 REAL(wp), DIMENSION(jpi,jpj,jpnoumax) :: zcmo !ARPDBGWORK 34 REAL(wp), DIMENSION(jpi,jpj) :: zfield 32 REAL(wp) :: zindh, zinda, zindb, ztmu 33 REAL(wp), POINTER, DIMENSION(:,:) :: zfield 35 34 36 35 #if ! defined key_diainstant … … 45 44 IF( lk_mpp ) CALL mpp_sum ( ialloc ) 46 45 IF( ialloc /= 0 ) CALL ctl_warn('lim_wri_2 (limwri_dimg_2.h90) : failed to allocate arrays') 47 rcmoy(:,:,:) = 0._wp48 46 ENDIF 49 47 50 IF( kt == nit000 ) THEN 48 CALL wrk_alloc( jpi, jpj, zfield ) 49 50 IF ( kt == nit000 ) THEN 51 51 ! 52 52 CALL lim_wri_init_2 … … 55 55 ii = 0 56 56 57 IF (lwp ) THEN57 IF (lwp ) THEN 58 58 WRITE(numout,*) 'lim_wri_2 : Write ice outputs in dimg' 59 59 WRITE(numout,*) '~~~~~~~~' … … 79 79 END DO 80 80 81 rcmoy(:,:,:) = 0.0_wp 81 82 zsto = rdt_ice 82 83 zout = nwrite * rdt_ice / nn_fsbc … … 89 90 90 91 #if ! defined key_diainstant 91 !-- calculs des valeurs instantanees92 !-- Compute mean values 92 93 93 94 zcmo(:,:, 1:jpnoumax ) = 0.e0 94 95 DO jj = 2 , jpjm1 95 DO ji = 2 , jpim1 ! NO vector opt.96 DO ji = 2 , jpim1 96 97 zindh = MAX( zzero , SIGN( zone , hicif(ji,jj) * (1.0 - frld(ji,jj) ) - 0.10 ) ) 97 98 zinda = MAX( zzero , SIGN( zone , ( 1.0 - frld(ji,jj) ) - 0.10 ) ) 98 99 zindb = zindh * zinda 99 ztmu = MAX( 0.5 * zone , ( tmu(ji,jj) + tmu(ji+1,jj) + tmu(ji,jj+1) + tmu(ji+1,jj+1) ) )100 100 zcmo(ji,jj,1) = hsnif (ji,jj) 101 101 zcmo(ji,jj,2) = hicif (ji,jj) … … 104 104 zcmo(ji,jj,5) = sist (ji,jj) 105 105 zcmo(ji,jj,6) = fbif (ji,jj) 106 zcmo(ji,jj,7) = zindb * ( u_ice(ji,jj ) * tmu(ji,jj ) + u_ice(ji+1,jj ) * tmu(ji+1,jj ) & 106 IF (lk_lim2_vp) THEN 107 ztmu = MAX( 0.5 * zone , ( tmu(ji,jj) + tmu(ji+1,jj) + tmu(ji,jj+1) + tmu(ji+1,jj+1) ) ) 108 zcmo(ji,jj,7) = zindb * ( u_ice(ji,jj ) * tmu(ji,jj ) + u_ice(ji+1,jj ) * tmu(ji+1,jj ) & 107 109 & + u_ice(ji,jj+1) * tmu(ji,jj+1) + u_ice(ji+1,jj+1) * tmu(ji+1,jj+1) ) & 108 110 / ztmu 109 111 110 zcmo(ji,jj,8) = zindb * ( v_ice(ji,jj ) * tmu(ji,jj ) + v_ice(ji+1,jj ) * tmu(ji+1,jj ) &112 zcmo(ji,jj,8) = zindb * ( v_ice(ji,jj ) * tmu(ji,jj ) + v_ice(ji+1,jj ) * tmu(ji+1,jj ) & 111 113 & + v_ice(ji,jj+1) * tmu(ji,jj+1) + v_ice(ji+1,jj+1) * tmu(ji+1,jj+1) ) & 112 114 / ztmu 115 ELSE 116 zcmo(ji,jj,7) = zindb * ( u_ice(ji,jj ) * tmu(ji,jj) + u_ice(ji-1,jj) * tmu(ji-1,jj) )/ 2.0 117 zcmo(ji,jj,8) = zindb * ( v_ice(ji,jj ) * tmv(ji,jj) + v_ice(ji,jj-1) * tmv(ji,jj-1) )/ 2.0 118 ENDIF 119 113 120 zcmo(ji,jj,9) = sst_m(ji,jj) 114 121 zcmo(ji,jj,10) = sss_m(ji,jj) … … 136 143 ! case of instantaneaous output rcmoy(:,:, 1:jpnoumax ) = 0.e0 137 144 DO jj = 2 , jpjm1 138 DO ji = 2 , jpim1 ! NO vector opt.145 DO ji = 2 , jpim1 139 146 zindh = MAX( zzero , SIGN( zone , hicif(ji,jj) * (1.0 - frld(ji,jj) ) - 0.10 ) ) 140 147 zinda = MAX( zzero , SIGN( zone , ( 1.0 - frld(ji,jj) ) - 0.10 ) ) 141 148 zindb = zindh * zinda 142 ztmu = MAX( 0.5 * zone , ( tmu(ji,jj) + tmu(ji+1,jj) + tmu(ji,jj+1) + tmu(ji+1,jj+1) ) )143 149 rcmoy(ji,jj,1) = hsnif (ji,jj) 144 150 rcmoy(ji,jj,2) = hicif (ji,jj) … … 147 153 rcmoy(ji,jj,5) = sist (ji,jj) 148 154 rcmoy(ji,jj,6) = fbif (ji,jj) 149 rcmoy(ji,jj,7) = zindb * ( u_ice(ji,jj ) * tmu(ji,jj ) + u_ice(ji+1,jj ) * tmu(ji+1,jj ) & 150 & + u_ice(ji,jj+1) * tmu(ji,jj+1) + u_ice(ji+1,jj+1) * tmu(ji+1,jj+1) ) & 151 / ztmu 152 153 rcmoy(ji,jj,8) = zindb * ( v_ice(ji,jj ) * tmu(ji,jj ) + v_ice(ji+1,jj ) * tmu(ji+1,jj ) & 154 & + v_ice(ji,jj+1) * tmu(ji,jj+1) + v_ice(ji+1,jj+1) * tmu(ji+1,jj+1) ) & 155 / ztmu 155 IF (lk_lim2_vp) THEN 156 ztmu = MAX( 0.5 * zone , ( tmu(ji,jj) + tmu(ji+1,jj) + tmu(ji,jj+1) + tmu(ji+1,jj+1) ) ) 157 rcmoy(ji,jj,7) = zindb * ( u_ice(ji,jj ) * tmu(ji,jj ) + u_ice(ji+1,jj ) * tmu(ji+1,jj ) & 158 & + u_ice(ji,jj+1) * tmu(ji,jj+1) + u_ice(ji+1,jj+1) * tmu(ji+1,jj+1) ) & 159 / ztmu 160 161 rcmoy(ji,jj,8) = zindb * ( v_ice(ji,jj ) * tmu(ji,jj ) + v_ice(ji+1,jj ) * tmu(ji+1,jj ) & 162 & + v_ice(ji,jj+1) * tmu(ji,jj+1) + v_ice(ji+1,jj+1) * tmu(ji+1,jj+1) ) & 163 / ztmu 164 ELSE 165 rcmoy(ji,jj,7) = zindb * ( u_ice(ji,jj ) * tmu(ji,jj) + u_ice(ji-1,jj) * tmu(ji-1,jj) )/ 2.0 166 rcmoy(ji,jj,8) = zindb * ( v_ice(ji,jj ) * tmv(ji,jj) + v_ice(ji,jj-1) * tmv(ji,jj-1) )/ 2.0 167 ENDIF 156 168 rcmoy(ji,jj,9) = sst_m(ji,jj) 157 169 rcmoy(ji,jj,10) = sss_m(ji,jj) … … 176 188 zfield(:,:) = (rcmoy(:,:,jf) * cmulti(jf) + cadd(jf)) * tmask(:,:,1) 177 189 178 IF ( jf == 7 .OR. jf == 8 .OR. jf == 15 .OR. jf == 16 ) THEN 190 SELECT CASE (jf) 191 CASE ( 7, 8, 15, 16 ) ! velocity or stress fields (vectors) 179 192 CALL lbc_lnk( zfield, 'T', -1. ) 180 ELSE193 CASE DEFAULT ! scalar fields 181 194 CALL lbc_lnk( zfield, 'T', 1. ) 182 END IF195 END SELECT 183 196 rcmoy(:,:,jf) = zfield(:,:) 184 197 END DO … … 200 213 nmoyice = 0 201 214 END IF ! MOD(kt+nn_fsbc-1-nit000+1, nwrite == 0 ) ! 215 CALL wrk_dealloc( jpi,jpj, zfield ) 202 216 203 217 END SUBROUTINE lim_wri_2 -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/LIM_SRC_3/limadv.F90
r3625 r3764 24 24 USE wrk_nemo ! work arrays 25 25 USE lib_fortran ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined) 26 USE lib_fortran ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined) 26 27 27 28 IMPLICIT NONE -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/LIM_SRC_3/limitd_me.F90
r3625 r3764 29 29 USE prtctl ! Print control 30 30 USE lib_fortran ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined) 31 USE lib_fortran ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined) 31 32 32 33 IMPLICIT NONE -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/LIM_SRC_3/limitd_th.F90
r3625 r3764 34 34 USE wrk_nemo ! work arrays 35 35 USE lib_fortran ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined) 36 USE lib_fortran ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined) 36 37 37 38 IMPLICIT NONE -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/LIM_SRC_3/limwri_dimg.h90
r3625 r3764 15 15 !!------------------------------------------------------------------- 16 16 USE diawri, ONLY : dia_wri_dimg 17 USE lib_fortran ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined) 18 17 19 REAL(wp),DIMENSION(1) :: zdept 18 20 -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/OFF_SRC/nemogcm.F90
r3750 r3764 45 45 USE prtctl ! Print control (prt_ctl_init routine) 46 46 USE timing ! Timing 47 USE lib_fortran ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined) 47 48 48 49 IMPLICIT NONE … … 342 343 & 'Compile with key_iomput enabled' ) 343 344 ! 345 IF( 1_wp /= SIGN(1._wp,-0._wp) ) CALL ctl_stop( 'nemo_ctl: The intrinsec SIGN function follows ', & 346 & 'f2003 standard. ' , & 347 & 'Compile with key_nosignedzero enabled' ) 348 ! 344 349 END SUBROUTINE nemo_ctl 345 350 -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/OPA_SRC/ASM/asminc.F90
r3294 r3764 10 10 !! NEMO 3.3 ! 2010-05 (D. Lea) Update to work with NEMO v3.2 11 11 !! - ! 2010-05 (D. Lea) add calc_month_len routine based on day_init 12 !! 3.4 ! 2012-10 (A. Weaver and K. Mogensen) Fix for direct initialization 12 13 !!---------------------------------------------------------------------- 13 14 … … 20 21 !! dyn_asm_inc : Apply the dynamic (u and v) increments 21 22 !! ssh_asm_inc : Apply the SSH increment 23 !! seaice_asm_inc : Apply the seaice increment 22 24 !!---------------------------------------------------------------------- 23 25 USE wrk_nemo ! Memory Allocation … … 25 27 USE dom_oce ! Ocean space and time domain 26 28 USE oce ! Dynamics and active tracers defined in memory 27 USE divcur ! Horizontal divergence and relative vorticity28 29 USE ldfdyn_oce ! ocean dynamics: lateral physics 29 30 USE eosbn2 ! Equation of state - in situ and potential density … … 33 34 USE c1d ! 1D initialization 34 35 USE in_out_manager ! I/O manager 35 USE lib_mpp ! MPP library 36 USE lib_mpp ! MPP library 37 #if defined key_lim3 38 USE ice ! LIM3 39 #endif 40 #if defined key_lim2 41 USE ice_2 ! LIM2 42 #endif 43 USE sbc_oce ! Surface boundary condition variables. 44 USE domvvl 36 45 37 46 IMPLICIT NONE … … 43 52 PUBLIC dyn_asm_inc !: Apply the dynamic (u and v) increments 44 53 PUBLIC ssh_asm_inc !: Apply the SSH increment 54 PUBLIC seaice_asm_inc !: Apply the seaice increment 45 55 46 56 #if defined key_asminc … … 50 60 #endif 51 61 LOGICAL, PUBLIC :: ln_bkgwri = .FALSE. !: No output of the background state fields 52 LOGICAL, PUBLIC :: ln_trjwri = .FALSE. !: No output of the state trajectory fields53 62 LOGICAL, PUBLIC :: ln_asmiau = .FALSE. !: No applying forcing with an assimilation increment 54 63 LOGICAL, PUBLIC :: ln_asmdin = .FALSE. !: No direct initialization … … 56 65 LOGICAL, PUBLIC :: ln_dyninc = .FALSE. !: No dynamics (u and v) assimilation increments 57 66 LOGICAL, PUBLIC :: ln_sshinc = .FALSE. !: No sea surface height assimilation increment 67 LOGICAL, PUBLIC :: ln_seaiceinc = .FALSE. !: No sea ice concentration increment 58 68 LOGICAL, PUBLIC :: ln_salfix = .FALSE. !: Apply minimum salinity check 69 LOGICAL, PUBLIC :: ln_temnofreeze = .FALSE. !: Don't allow the temperature to drop below freezing 59 70 INTEGER, PUBLIC :: nn_divdmp = 0 !: Apply divergence damping filter nn_divdmp times 60 71 … … 78 89 79 90 REAL(wp), DIMENSION(:,:), ALLOCATABLE :: ssh_bkg, ssh_bkginc ! Background sea surface height and its increment 91 REAL(wp), DIMENSION(:,:), ALLOCATABLE :: seaice_bkginc ! Increment to the background sea ice conc 80 92 81 93 !! * Substitutions … … 125 137 REAL(wp), POINTER, DIMENSION(:,:) :: hdiv 126 138 !! 127 NAMELIST/nam_asminc/ ln_bkgwri, ln_trjwri,&139 NAMELIST/nam_asminc/ ln_bkgwri, & 128 140 & ln_trainc, ln_dyninc, ln_sshinc, & 129 141 & ln_asmdin, ln_asmiau, & 130 142 & nitbkg, nitdin, nitiaustr, nitiaufin, niaufn, & 131 & nittrjfrq,ln_salfix, salfixmin, &143 & ln_salfix, salfixmin, & 132 144 & nn_divdmp 133 145 !!---------------------------------------------------------------------- … … 139 151 ! Set default values 140 152 ln_bkgwri = .FALSE. 141 ln_trjwri = .FALSE.142 153 ln_trainc = .FALSE. 143 154 ln_dyninc = .FALSE. 144 155 ln_sshinc = .FALSE. 156 ln_seaiceinc = .FALSE. 145 157 ln_asmdin = .FALSE. 146 158 ln_asmiau = .TRUE. 147 159 ln_salfix = .FALSE. 160 ln_temnofreeze = .FALSE. 148 161 salfixmin = -9999 149 162 nitbkg = 0 … … 152 165 nitiaufin = 150 ! = 10 days with ORCA2 153 166 niaufn = 0 154 nittrjfrq = 1155 167 156 168 REWIND ( numnam ) … … 164 176 WRITE(numout,*) ' Namelist namasm : set assimilation increment parameters' 165 177 WRITE(numout,*) ' Logical switch for writing out background state ln_bkgwri = ', ln_bkgwri 166 WRITE(numout,*) ' Logical switch for writing out state trajectory ln_trjwri = ', ln_trjwri167 178 WRITE(numout,*) ' Logical switch for applying tracer increments ln_trainc = ', ln_trainc 168 179 WRITE(numout,*) ' Logical switch for applying velocity increments ln_dyninc = ', ln_dyninc 169 180 WRITE(numout,*) ' Logical switch for applying SSH increments ln_sshinc = ', ln_sshinc 170 181 WRITE(numout,*) ' Logical switch for Direct Initialization (DI) ln_asmdin = ', ln_asmdin 182 WRITE(numout,*) ' Logical switch for applying sea ice increments ln_seaiceinc = ', ln_seaiceinc 171 183 WRITE(numout,*) ' Logical switch for Incremental Analysis Updating (IAU) ln_asmiau = ', ln_asmiau 172 184 WRITE(numout,*) ' Timestep of background in [0,nitend-nit000-1] nitbkg = ', nitbkg … … 175 187 WRITE(numout,*) ' Timestep of end of IAU interval in [0,nitend-nit000-1] nitiaufin = ', nitiaufin 176 188 WRITE(numout,*) ' Type of IAU weighting function niaufn = ', niaufn 177 WRITE(numout,*) ' Frequency of trajectory output for 4D-VAR nittrjfrq = ', nittrjfrq178 189 WRITE(numout,*) ' Logical switch for ensuring that the sa > salfixmin ln_salfix = ', ln_salfix 179 190 WRITE(numout,*) ' Minimum salinity after applying the increments salfixmin = ', salfixmin … … 213 224 WRITE(numout,*) ' nitiaustr_r = ', nitiaustr_r 214 225 WRITE(numout,*) ' nitiaufin_r = ', nitiaufin_r 215 WRITE(numout,*) ' nittrjfrq = ', nittrjfrq216 226 WRITE(numout,*) 217 227 WRITE(numout,*) ' Dates referenced to current cycle:' … … 235 245 236 246 IF ( ( ( .NOT. ln_asmdin ).AND.( .NOT. ln_asmiau ) ) & 237 .AND.( ( ln_trainc ).OR.( ln_dyninc ).OR.( ln_sshinc ) )) &238 & CALL ctl_stop( ' One or more of ln_trainc, ln_dyninc and ln_sshinc is set to .true.', &247 .AND.( ( ln_trainc ).OR.( ln_dyninc ).OR.( ln_sshinc ) .OR. ( ln_seaiceinc) )) & 248 & CALL ctl_stop( ' One or more of ln_trainc, ln_dyninc, ln_sshinc and ln_seaiceinc is set to .true.', & 239 249 & ' but ln_asmdin and ln_asmiau are both set to .false. :', & 240 250 & ' Inconsistent options') … … 248 258 & ' Type IAU weighting function is invalid') 249 259 250 IF ( ( .NOT. ln_trainc ).AND.( .NOT. ln_dyninc ).AND.( .NOT. ln_sshinc ) &260 IF ( ( .NOT. ln_trainc ).AND.( .NOT. ln_dyninc ).AND.( .NOT. ln_sshinc ).AND.( .NOT. ln_seaiceinc ) & 251 261 & ) & 252 & CALL ctl_warn( ' ln_trainc, ln_dyninc and ln_sshinc are set to .false. :', &262 & CALL ctl_warn( ' ln_trainc, ln_dyninc, ln_sshinc and ln_seaiceinc are set to .false. :', & 253 263 & ' The assimilation increments are not applied') 254 264 … … 353 363 ALLOCATE( v_bkginc(jpi,jpj,jpk) ) 354 364 ALLOCATE( ssh_bkginc(jpi,jpj) ) 365 ALLOCATE( seaice_bkginc(jpi,jpj)) 355 366 #if defined key_asminc 356 367 ALLOCATE( ssh_iau(jpi,jpj) ) … … 361 372 v_bkginc(:,:,:) = 0.0 362 373 ssh_bkginc(:,:) = 0.0 374 seaice_bkginc(:,:) = 0.0 363 375 #if defined key_asminc 364 376 ssh_iau(:,:) = 0.0 365 377 #endif 366 IF ( ( ln_trainc ).OR.( ln_dyninc ).OR.( ln_sshinc ) ) THEN378 IF ( ( ln_trainc ).OR.( ln_dyninc ).OR.( ln_sshinc ).OR.( ln_seaiceinc ) ) THEN 367 379 368 380 !-------------------------------------------------------------------- … … 429 441 ENDIF 430 442 443 IF ( ln_seaiceinc ) THEN 444 CALL iom_get( inum, jpdom_autoglo, 'bckinseaice', seaice_bkginc, 1 ) 445 ! Apply the masks 446 seaice_bkginc(:,:) = seaice_bkginc(:,:) * tmask(:,:,1) 447 ! Set missing increments to 0.0 rather than 1e+20 448 ! to allow for differences in masks 449 WHERE( ABS( seaice_bkginc(:,:) ) > 1.0e+10 ) seaice_bkginc(:,:) = 0.0 450 ENDIF 451 431 452 CALL iom_close( inum ) 432 453 … … 437 458 !----------------------------------------------------------------------- 438 459 439 440 460 IF ( ln_dyninc .AND. nn_divdmp > 0 ) THEN 441 461 442 CALL wrk_alloc(jpi,jpj,hdiv) 443 444 DO jt = 1, nn_divdmp 445 446 DO jk = 1, jpkm1 447 448 hdiv(:,:) = 0._wp 449 450 DO jj = 2, jpjm1 451 DO ji = fs_2, fs_jpim1 ! vector opt. 452 hdiv(ji,jj) = & 453 ( e2u(ji ,jj)*fse3u(ji ,jj,jk) * u_bkginc(ji ,jj,jk) & 454 - e2u(ji-1,jj)*fse3u(ji-1,jj,jk) * u_bkginc(ji-1,jj,jk) & 455 + e1v(ji,jj )*fse3v(ji,jj ,jk) * v_bkginc(ji,jj ,jk) & 456 - e1v(ji,jj-1)*fse3v(ji,jj-1,jk) * v_bkginc(ji,jj-1,jk) ) & 457 / ( e1t(ji,jj) * e2t(ji,jj) * fse3t(ji,jj,jk) ) 462 CALL wrk_alloc(jpi,jpj,hdiv) 463 464 DO jt = 1, nn_divdmp 465 466 DO jk = 1, jpkm1 467 468 hdiv(:,:) = 0._wp 469 470 DO jj = 2, jpjm1 471 DO ji = fs_2, fs_jpim1 ! vector opt. 472 hdiv(ji,jj) = & 473 ( e2u(ji ,jj ) * fse3u(ji ,jj ,jk) * u_bkginc(ji ,jj ,jk) & 474 - e2u(ji-1,jj ) * fse3u(ji-1,jj ,jk) * u_bkginc(ji-1,jj ,jk) & 475 + e1v(ji ,jj ) * fse3v(ji ,jj ,jk) * v_bkginc(ji ,jj ,jk) & 476 - e1v(ji ,jj-1) * fse3v(ji ,jj-1,jk) * v_bkginc(ji ,jj-1,jk) ) & 477 / ( e1t(ji,jj) * e2t(ji,jj) * fse3t(ji,jj,jk) ) 478 END DO 458 479 END DO 480 481 CALL lbc_lnk( hdiv, 'T', 1. ) ! lateral boundary cond. (no sign change) 482 483 DO jj = 2, jpjm1 484 DO ji = fs_2, fs_jpim1 ! vector opt. 485 u_bkginc(ji,jj,jk) = u_bkginc(ji,jj,jk) + 0.2_wp * ( e1t(ji+1,jj)*e2t(ji+1,jj) * hdiv(ji+1,jj) & 486 - e1t(ji ,jj)*e2t(ji ,jj) * hdiv(ji ,jj) ) & 487 / e1u(ji,jj) * umask(ji,jj,jk) 488 v_bkginc(ji,jj,jk) = v_bkginc(ji,jj,jk) + 0.2_wp * ( e1t(ji,jj+1)*e2t(ji,jj+1) * hdiv(ji,jj+1) & 489 - e1t(ji,jj )*e2t(ji,jj ) * hdiv(ji,jj ) ) & 490 / e2v(ji,jj) * vmask(ji,jj,jk) 491 END DO 492 END DO 493 459 494 END DO 460 495 461 CALL lbc_lnk( hdiv, 'T', 1. ) ! lateral boundary cond. (no sign change) 462 463 DO jj = 2, jpjm1 464 DO ji = fs_2, fs_jpim1 ! vector opt. 465 u_bkginc(ji,jj,jk) = u_bkginc(ji,jj,jk) + 0.2 * ( e1t(ji+1,jj)*e2t(ji+1,jj) * hdiv(ji+1,jj) & 466 - e1t(ji ,jj)*e2t(ji ,jj) * hdiv(ji ,jj) ) & 467 / e1u(ji,jj) * umask(ji,jj,jk) 468 v_bkginc(ji,jj,jk) = v_bkginc(ji,jj,jk) + 0.2 * ( e1t(ji,jj+1)*e2t(ji,jj+1) * hdiv(ji,jj+1) & 469 - e1t(ji,jj )*e2t(ji,jj ) * hdiv(ji,jj ) ) & 470 / e2v(ji,jj) * vmask(ji,jj,jk) 471 END DO 472 END DO 473 474 END DO 475 476 END DO 477 478 CALL wrk_dealloc(jpi,jpj,hdiv) 496 END DO 497 498 CALL wrk_dealloc(jpi,jpj,hdiv) 479 499 480 500 ENDIF … … 506 526 CALL iom_open( c_asmdin, inum ) 507 527 508 CALL iom_get( inum, ' zdate', zdate_bkg )528 CALL iom_get( inum, 'rdastp', zdate_bkg ) 509 529 510 530 IF(lwp) THEN … … 662 682 INTEGER :: it 663 683 REAL(wp) :: zincwgt ! IAU weight for current time step 664 !!---------------------------------------------------------------------- 684 REAL (wp), DIMENSION(jpi,jpj,jpk) :: fzptnz ! 3d freezing point values 685 !!---------------------------------------------------------------------- 686 687 ! freezing point calculation taken from oc_fz_pt (but calculated for all depths) 688 ! used to prevent the applied increments taking the temperature below the local freezing point 689 690 #if defined key_cice 691 fzptnz(:,:,:) = -1.8_wp 692 #else 693 DO jk = 1, jpk 694 DO jj = 1, jpj 695 DO ji = 1, jpk 696 fzptnz (ji,jj,jk) = ( -0.0575_wp + 1.710523e-3_wp * SQRT( tsn(ji,jj,jk,jp_sal) ) & 697 - 2.154996e-4_wp * tsn(ji,jj,jk,jp_sal) ) * tsn(ji,jj,jk,jp_sal) & 698 - 7.53e-4_wp * fsdepw(ji,jj,jk) ! (pressure in dbar) 699 END DO 700 END DO 701 END DO 702 #endif 665 703 666 704 IF ( ln_asmiau ) THEN … … 684 722 ! Update the tracer tendencies 685 723 DO jk = 1, jpkm1 686 tsa(:,:,jk,jp_tem) = tsa(:,:,jk,jp_tem) + t_bkginc(:,:,jk) * zincwgt 687 tsa(:,:,jk,jp_sal) = tsa(:,:,jk,jp_sal) + s_bkginc(:,:,jk) * zincwgt 724 IF (ln_temnofreeze) THEN 725 ! Do not apply negative increments if the temperature will fall below freezing 726 WHERE(t_bkginc(:,:,jk) > 0.0_wp .OR. & 727 & tsn(:,:,jk,jp_tem) + tsa(:,:,jk,jp_tem) + t_bkginc(:,:,jk) * wgtiau(it) > fzptnz(:,:,jk) ) 728 tsa(:,:,jk,jp_tem) = tsa(:,:,jk,jp_tem) + t_bkginc(:,:,jk) * zincwgt 729 END WHERE 730 ELSE 731 tsa(:,:,jk,jp_tem) = tsa(:,:,jk,jp_tem) + t_bkginc(:,:,jk) * zincwgt 732 ENDIF 733 IF (ln_salfix) THEN 734 ! Do not apply negative increments if the salinity will fall below a specified 735 ! minimum value salfixmin 736 WHERE(s_bkginc(:,:,jk) > 0.0_wp .OR. & 737 & tsn(:,:,jk,jp_sal) + tsa(:,:,jk,jp_sal) + s_bkginc(:,:,jk) * wgtiau(it) > salfixmin ) 738 tsa(:,:,jk,jp_sal) = tsa(:,:,jk,jp_sal) + s_bkginc(:,:,jk) * zincwgt 739 END WHERE 740 ELSE 741 tsa(:,:,jk,jp_sal) = tsa(:,:,jk,jp_sal) + s_bkginc(:,:,jk) * zincwgt 742 ENDIF 688 743 END DO 689 690 ! Salinity fix691 IF (ln_salfix) THEN692 DO jk = 1, jpkm1693 DO jj = 1, jpj694 DO ji= 1, jpi695 tsa(ji,jj,jk,jp_sal) = MAX( tsa(ji,jj,jk,jp_sal), salfixmin )696 END DO697 END DO698 END DO699 ENDIF700 744 701 745 ENDIF … … 718 762 719 763 ! Initialize the now fields with the background + increment 720 tsn(:,:,:,jp_tem) = t_bkg(:,:,:) + t_bkginc(:,:,:) 721 tsn(:,:,:,jp_sal) = s_bkg(:,:,:) + s_bkginc(:,:,:) 722 723 ! Optional salinity fix 764 IF (ln_temnofreeze) THEN 765 ! Do not apply negative increments if the temperature will fall below freezing 766 WHERE(t_bkginc(:,:,:) > 0.0_wp .OR. & 767 & tsn(:,:,:,jp_tem) + t_bkginc(:,:,:) > fzptnz(:,:,:) ) 768 tsn(:,:,:,jp_tem) = t_bkg(:,:,:) + t_bkginc(:,:,:) 769 END WHERE 770 ELSE 771 tsn(:,:,:,jp_tem) = t_bkg(:,:,:) + t_bkginc(:,:,:) 772 ENDIF 724 773 IF (ln_salfix) THEN 725 DO jk = 1, jpkm1 726 DO jj = 1, jpj 727 DO ji= 1, jpi 728 tsn(ji,jj,jk,jp_sal) = MAX( tsn(ji,jj,jk,jp_sal), salfixmin ) 729 END DO 730 END DO 731 END DO 774 ! Do not apply negative increments if the salinity will fall below a specified 775 ! minimum value salfixmin 776 WHERE(s_bkginc(:,:,:) > 0.0_wp .OR. & 777 & tsn(:,:,:,jp_sal) + s_bkginc(:,:,:) > salfixmin ) 778 tsn(:,:,:,jp_sal) = s_bkg(:,:,:) + s_bkginc(:,:,:) 779 END WHERE 780 ELSE 781 tsn(:,:,:,jp_sal) = s_bkg(:,:,:) + s_bkginc(:,:,:) 732 782 ENDIF 733 783 734 tsb(:,:,:,:) = tsn(:,:,:,:) 784 tsb(:,:,:,:) = tsn(:,:,:,:) ! Update before fields 735 785 736 786 CALL eos( tsb, rhd, rhop ) ! Before potential and in situ densities 737 787 738 788 IF( ln_zps .AND. .NOT. lk_c1d ) & 739 & CALL zps_hde( nit000, jpts, tsb, 740 & gtsu, gtsv, rhd, 789 & CALL zps_hde( nit000, jpts, tsb, & ! Partial steps: before horizontal derivative 790 & gtsu, gtsv, rhd, & ! of T, S, rd at the bottom ocean level 741 791 & gru , grv ) 792 793 #if defined key_zdfkpp 794 CALL eos( tsn, rhd ) ! Compute rhd 795 #endif 742 796 743 797 DEALLOCATE( t_bkginc ) … … 748 802 ! 749 803 ENDIF 804 ! Perhaps the following call should be in step 805 IF ( ln_seaiceinc ) CALL seaice_asm_inc ( kt ) ! apply sea ice concentration increment 750 806 ! 751 807 END SUBROUTINE tra_asm_inc … … 817 873 vb(:,:,:) = vn(:,:,:) 818 874 819 CALL div_cur( kt ) ! Compute divergence and curl for now fields820 821 rotb (:,:,:) = rotn (:,:,:) ! Update before fields822 hdivb(:,:,:) = hdivn(:,:,:)823 824 875 DEALLOCATE( u_bkg ) 825 876 DEALLOCATE( v_bkg ) … … 846 897 ! 847 898 INTEGER :: it 899 INTEGER :: jk 848 900 REAL(wp) :: zincwgt ! IAU weight for current time step 849 901 !!---------------------------------------------------------------------- … … 891 943 sshn(:,:) = ssh_bkg(:,:) + ssh_bkginc(:,:) 892 944 893 sshb(:,:) = sshn(:,:) ! Update before fields 945 ! Update before fields 946 sshb(:,:) = sshn(:,:) 947 948 IF( lk_vvl ) THEN 949 DO jk = 1, jpk 950 fse3t_b(:,:,jk) = fse3t_n(:,:,jk) 951 END DO 952 ENDIF 894 953 895 954 DEALLOCATE( ssh_bkg ) … … 902 961 END SUBROUTINE ssh_asm_inc 903 962 963 SUBROUTINE seaice_asm_inc( kt, kindic ) 964 !!---------------------------------------------------------------------- 965 !! *** ROUTINE seaice_asm_inc *** 966 !! 967 !! ** Purpose : Apply the sea ice assimilation increment. 968 !! 969 !! ** Method : Direct initialization or Incremental Analysis Updating. 970 !! 971 !! ** Action : 972 !! 973 !! History : 974 !! ! 07-2011 (D. Lea) Initial version based on ssh_asm_inc 975 !!---------------------------------------------------------------------- 976 977 IMPLICIT NONE 978 979 !! * Arguments 980 INTEGER, INTENT(IN) :: kt ! Current time step 981 INTEGER, OPTIONAL, INTENT(IN) :: kindic ! flag for disabling the deallocation 982 983 !! * Local declarations 984 INTEGER :: it 985 REAL(wp) :: zincwgt ! IAU weight for current time step 986 987 #if defined key_lim3 || defined key_lim2 988 REAL(wp), DIMENSION(jpi,jpj) :: zofrld, zohicif, zseaicendg, zhicifinc ! LIM 989 REAL(wp) :: zhicifmin=0.5_wp ! ice minimum depth in metres 990 991 #endif 992 993 994 IF ( ln_asmiau ) THEN 995 996 !-------------------------------------------------------------------- 997 ! Incremental Analysis Updating 998 !-------------------------------------------------------------------- 999 1000 IF ( ( kt >= nitiaustr_r ).AND.( kt <= nitiaufin_r ) ) THEN 1001 1002 it = kt - nit000 + 1 1003 zincwgt = wgtiau(it) ! IAU weight for the current time step 1004 ! note this is not a tendency so should not be divided by rdt (as with the tracer and other increments) 1005 1006 IF(lwp) THEN 1007 WRITE(numout,*) 1008 WRITE(numout,*) 'seaice_asm_inc : sea ice conc IAU at time step = ', & 1009 & kt,' with IAU weight = ', wgtiau(it) 1010 WRITE(numout,*) '~~~~~~~~~~~~' 1011 ENDIF 1012 1013 #if defined key_lim3 || defined key_lim2 1014 1015 zofrld(:,:)=frld(:,:) 1016 zohicif(:,:)=hicif(:,:) 1017 1018 frld = MIN( MAX( frld(:,:) - seaice_bkginc(:,:) * zincwgt, 0.0_wp), 1.0_wp) 1019 pfrld = MIN( MAX( pfrld(:,:) - seaice_bkginc(:,:) * zincwgt, 0.0_wp), 1.0_wp) 1020 fr_i(:,:) = 1.0_wp - frld(:,:) ! adjust ice fraction 1021 1022 zseaicendg(:,:)=zofrld(:,:) - frld(:,:) ! find out actual sea ice nudge applied 1023 1024 ! Nudge sea ice depth to bring it up to a required minimum depth 1025 1026 WHERE( zseaicendg(:,:) > 0.0_wp .AND. hicif(:,:) < zhicifmin ) 1027 zhicifinc(:,:) = (zhicifmin - hicif(:,:)) * zincwgt 1028 ELSEWHERE 1029 zhicifinc(:,:) = 0.0_wp 1030 END WHERE 1031 1032 ! nudge ice depth 1033 hicif(:,:)=hicif(:,:) + zhicifinc(:,:) 1034 phicif(:,:)=phicif(:,:) + zhicifinc(:,:) 1035 1036 ! seaice salinity balancing (to add) 1037 1038 #endif 1039 1040 #if defined key_cice 1041 1042 ! Pass ice increment tendency into CICE 1043 ndaice_da(:,:) = seaice_bkginc(:,:) * zincwgt / rdt 1044 1045 #endif 1046 1047 IF ( kt == nitiaufin_r ) THEN 1048 DEALLOCATE( seaice_bkginc ) 1049 ENDIF 1050 1051 ELSE 1052 1053 #if defined key_cice 1054 1055 ! Zero ice increment tendency into CICE 1056 ndaice_da(:,:) = 0.0_wp 1057 1058 #endif 1059 1060 ENDIF 1061 1062 ELSEIF ( ln_asmdin ) THEN 1063 1064 !-------------------------------------------------------------------- 1065 ! Direct Initialization 1066 !-------------------------------------------------------------------- 1067 1068 IF ( kt == nitdin_r ) THEN 1069 1070 neuler = 0 ! Force Euler forward step 1071 1072 #if defined key_lim3 || defined key_lim2 1073 1074 zofrld(:,:)=frld(:,:) 1075 zohicif(:,:)=hicif(:,:) 1076 1077 ! Initialize the now fields the background + increment 1078 1079 frld(:,:) = MIN( MAX( frld(:,:) - seaice_bkginc(:,:), 0.0_wp), 1.0_wp) 1080 pfrld(:,:) = frld(:,:) 1081 fr_i(:,:) = 1.0_wp - frld(:,:) ! adjust ice fraction 1082 1083 zseaicendg(:,:)=zofrld(:,:) - frld(:,:) ! find out actual sea ice nudge applied 1084 1085 ! Nudge sea ice depth to bring it up to a required minimum depth 1086 1087 WHERE( zseaicendg(:,:) > 0.0_wp .AND. hicif(:,:) < zhicifmin ) 1088 zhicifinc(:,:) = (zhicifmin - hicif(:,:)) * zincwgt 1089 ELSEWHERE 1090 zhicifinc(:,:) = 0.0_wp 1091 END WHERE 1092 1093 ! nudge ice depth 1094 hicif(:,:)=hicif(:,:) + zhicifinc(:,:) 1095 phicif(:,:)=phicif(:,:) 1096 1097 ! seaice salinity balancing (to add) 1098 1099 #endif 1100 1101 #if defined key_cice 1102 1103 ! Pass ice increment tendency into CICE - is this correct? 1104 ndaice_da(:,:) = seaice_bkginc(:,:) / rdt 1105 1106 #endif 1107 IF ( .NOT. PRESENT(kindic) ) THEN 1108 DEALLOCATE( seaice_bkginc ) 1109 END IF 1110 1111 ELSE 1112 1113 #if defined key_cice 1114 1115 ! Zero ice increment tendency into CICE 1116 ndaice_da(:,:) = 0.0_wp 1117 1118 #endif 1119 1120 ENDIF 1121 1122 !#if defined key_lim3 || defined key_lim2 || defined key_cice 1123 ! 1124 ! IF (ln_seaicebal ) THEN 1125 ! !! balancing salinity increments 1126 ! !! simple case from limflx.F90 (doesn't include a mass flux) 1127 ! !! assumption is that as ice concentration is reduced or increased 1128 ! !! the snow and ice depths remain constant 1129 ! !! note that snow is being created where ice concentration is being increased 1130 ! !! - could be more sophisticated and 1131 ! !! not do this (but would need to alter h_snow) 1132 ! 1133 ! usave(:,:,:)=sb(:,:,:) ! use array as a temporary store 1134 ! 1135 ! DO jj = 1, jpj 1136 ! DO ji = 1, jpi 1137 ! ! calculate change in ice and snow mass per unit area 1138 ! ! positive values imply adding salt to the ocean (results from ice formation) 1139 ! ! fwf : ice formation and melting 1140 ! 1141 ! zfons = ( -nfresh_da(ji,jj)*soce + nfsalt_da(ji,jj) )*rdt 1142 ! 1143 ! ! change salinity down to mixed layer depth 1144 ! mld=hmld_kara(ji,jj) 1145 ! 1146 ! ! prevent small mld 1147 ! ! less than 10m can cause salinity instability 1148 ! IF (mld < 10) mld=10 1149 ! 1150 ! ! set to bottom of a level 1151 ! DO jk = jpk-1, 2, -1 1152 ! IF ((mld > gdepw(ji,jj,jk)) .and. (mld < gdepw(ji,jj,jk+1))) THEN 1153 ! mld=gdepw(ji,jj,jk+1) 1154 ! jkmax=jk 1155 ! ENDIF 1156 ! ENDDO 1157 ! 1158 ! ! avoid applying salinity balancing in shallow water or on land 1159 ! ! 1160 ! 1161 ! ! dsal_ocn (psu kg m^-2) / (kg m^-3 * m) 1162 ! 1163 ! dsal_ocn=0.0_wp 1164 ! sal_thresh=5.0_wp ! minimum salinity threshold for salinity balancing 1165 ! 1166 ! if (tmask(ji,jj,1) > 0 .AND. tmask(ji,jj,jkmax) > 0 ) & 1167 ! dsal_ocn = zfons / (rhop(ji,jj,1) * mld) 1168 ! 1169 ! ! put increments in for levels in the mixed layer 1170 ! ! but prevent salinity below a threshold value 1171 ! 1172 ! DO jk = 1, jkmax 1173 ! 1174 ! IF (dsal_ocn > 0.0_wp .or. sb(ji,jj,jk)+dsal_ocn > sal_thresh) THEN 1175 ! sb(ji,jj,jk) = sb(ji,jj,jk) + dsal_ocn 1176 ! sn(ji,jj,jk) = sn(ji,jj,jk) + dsal_ocn 1177 ! ENDIF 1178 ! 1179 ! ENDDO 1180 ! 1181 ! ! ! salt exchanges at the ice/ocean interface 1182 ! ! zpmess = zfons / rdt_ice ! rdt_ice is ice timestep 1183 ! ! 1184 ! !! Adjust fsalt. A +ve fsalt means adding salt to ocean 1185 ! !! fsalt(ji,jj) = fsalt(ji,jj) + zpmess ! adjust fsalt 1186 ! !! 1187 ! !! emps(ji,jj) = emps(ji,jj) + zpmess ! or adjust emps (see icestp1d) 1188 ! !! ! E-P (kg m-2 s-2) 1189 ! ! emp(ji,jj) = emp(ji,jj) + zpmess ! E-P (kg m-2 s-2) 1190 ! ENDDO !ji 1191 ! ENDDO !jj! 1192 ! 1193 ! ENDIF !ln_seaicebal 1194 ! 1195 !#endif 1196 1197 1198 ENDIF 1199 1200 END SUBROUTINE seaice_asm_inc 904 1201 !!====================================================================== 905 1202 END MODULE asminc -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/OPA_SRC/DIA/diahth.F90
r3294 r3764 313 313 ! surface boundary condition 314 314 IF( lk_vvl ) THEN ; zthick(:,:) = 0._wp ; htc3(:,:) = 0._wp 315 ELSE ; zthick(:,:) = sshn(:,:) ; htc3(:,:) = tsn(:,:, jk,jp_tem) * sshn(:,:) * tmask(:,:,jk)315 ELSE ; zthick(:,:) = sshn(:,:) ; htc3(:,:) = tsn(:,:,1,jp_tem) * sshn(:,:) * tmask(:,:,1) 316 316 ENDIF 317 317 ! integration down to ilevel -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/OPA_SRC/DIA/diaptr.F90
r3610 r3764 455 455 NAMELIST/namptr/ ln_diaptr, ln_diaznl, ln_subbas, ln_ptrcomp, nn_fptr, nn_fwri 456 456 !!---------------------------------------------------------------------- 457 IF( nn_timing == 1 ) CALL timing_start('dia_ptr_init')458 457 459 458 REWIND( numnam ) ! Read Namelist namptr : poleward transport parameters … … 474 473 475 474 IF( ln_diaptr) THEN 475 476 IF( nn_timing == 1 ) CALL timing_start('dia_ptr_init') 476 477 477 478 IF( ln_subbas ) THEN ; nptr = 5 ! Global, Atlantic, Pacific, Indian, Indo-Pacific … … 528 529 nidom_ptr = FLIO_DOM_NONE 529 530 #endif 531 IF( nn_timing == 1 ) CALL timing_stop('dia_ptr_init') 532 ! 530 533 ENDIF 531 !532 IF( nn_timing == 1 ) CALL timing_stop('dia_ptr_init')533 534 ! 534 535 END SUBROUTINE dia_ptr_init -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/OPA_SRC/DIA/diawri_dimg.h90
r3625 r3764 165 165 fsel(:,:,6 ) = fsel(:,:,6 ) + sshn(:,:) 166 166 fsel(:,:,7 ) = fsel(:,:,7 ) + qsr(:,:) 167 fsel(:,:,8 ) = fsel(:,:,8 ) + qrp (:,:) 168 fsel(:,:,9 ) = fsel(:,:,9 ) + erp (:,:) 167 IF( ln_ssr ) THEN 168 IF( nn_sstr /= 0 ) fsel(:,:,8 ) = fsel(:,:,8 ) + qrp (:,:) 169 IF( nn_sssr /= 0 ) fsel(:,:,9 ) = fsel(:,:,9 ) + erp (:,:) 170 ENDIF 169 171 fsel(:,:,10) = fsel(:,:,10) + hmld(:,:) 170 172 fsel(:,:,11) = fsel(:,:,11) + hmlp(:,:) … … 234 236 fsel(:,:,6 ) = sshn(:,:) 235 237 fsel(:,:,7 ) = qsr (:,:) * tmask(:,:,1) 236 fsel(:,:,8 ) = qrp (:,:) * tmask(:,:,1) 237 fsel(:,:,9 ) = erp (:,:) * tmask(:,:,1) 238 IF( ln_ssr ) THEN 239 IF( nn_sstr /= 0 ) fsel(:,:,8 ) = qrp (:,:) * tmask(:,:,1) 240 IF( nn_sssr /= 0 ) fsel(:,:,9 ) = erp (:,:) * tmask(:,:,1) 241 ENDIF 238 242 fsel(:,:,10) = hmld(:,:) * tmask(:,:,1) 239 243 fsel(:,:,11) = hmlp(:,:) * tmask(:,:,1) -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/OPA_SRC/DOM/daymod.F90
r3680 r3764 2 2 !!====================================================================== 3 3 !! *** MODULE daymod *** 4 !! Ocean : calendar 4 !! Ocean : calendar 5 5 !!===================================================================== 6 6 !! History : OPA ! 1994-09 (M. Pontaud M. Imbard) Original code 7 7 !! ! 1997-03 (O. Marti) 8 !! ! 1997-05 (G. Madec) 8 !! ! 1997-05 (G. Madec) 9 9 !! ! 1997-08 (M. Imbard) 10 10 !! NEMO 1.0 ! 2003-09 (G. Madec) F90 + nyear, nmonth, nday 11 11 !! ! 2004-01 (A.M. Treguier) new calculation based on adatrj 12 12 !! ! 2006-08 (G. Madec) surface module major update 13 !!---------------------------------------------------------------------- 13 !!---------------------------------------------------------------------- 14 14 15 15 !!---------------------------------------------------------------------- 16 16 !! day : calendar 17 !! 17 !! 18 18 !! ------------------------------- 19 19 !! ----------- WARNING ----------- … … 24 24 !! ----------- WARNING ----------- 25 25 !! ------------------------------- 26 !! 26 !! 27 27 !!---------------------------------------------------------------------- 28 28 USE dom_oce ! ocean space and time domain 29 29 USE phycst ! physical constants 30 30 USE in_out_manager ! I/O manager 31 USE iom ! 31 USE iom ! 32 32 USE ioipsl, ONLY : ymds2ju ! for calendar 33 33 USE prtctl ! Print control … … 41 41 PUBLIC day ! called by step.F90 42 42 PUBLIC day_init ! called by istate.F90 43 44 INTEGER :: nsecd, nsecd05, ndt, ndt05 43 PUBLIC day_mth ! Needed by TAM 44 45 INTEGER, PUBLIC :: nsecd, nsecd05, ndt, ndt05 ! (PUBLIC for TAM) 45 46 46 47 !!---------------------------------------------------------------------- … … 54 55 !!---------------------------------------------------------------------- 55 56 !! *** ROUTINE day_init *** 56 !! 57 !! ** Purpose : Initialization of the calendar values to their values 1 time step before nit000 57 !! 58 !! ** Purpose : Initialization of the calendar values to their values 1 time step before nit000 58 59 !! because day will be called at the beginning of step 59 60 !! … … 81 82 ndt05 = NINT(0.5 * rdttra(1)) 82 83 83 IF( .NOT. lk_offline ) CALL day_rst( nit000, 'READ' ) 84 IF( .NOT. lk_offline ) CALL day_rst( nit000, 'READ' ) 84 85 85 86 ! set the calandar from ndastp (read in restart file and namelist) … … 87 88 nyear = ndastp / 10000 88 89 nmonth = ( ndastp - (nyear * 10000) ) / 100 89 nday = ndastp - (nyear * 10000) - ( nmonth * 100 ) 90 nday = ndastp - (nyear * 10000) - ( nmonth * 100 ) 90 91 91 92 CALL ymds2ju( nyear, nmonth, nday, 0.0, fjulday ) ! we assume that we start run at 00:00 … … 95 96 nsec1jan000 = 0 96 97 CALL day_mth 97 98 98 99 IF ( nday == 0 ) THEN ! for ex if ndastp = ndate0 - 1 99 nmonth = nmonth - 1 100 nmonth = nmonth - 1 100 101 nday = nmonth_len(nmonth) 101 102 ENDIF … … 106 107 IF( nleapy == 1 ) CALL day_mth 107 108 ENDIF 108 109 109 110 ! day since january 1st 110 111 nday_year = nday + SUM( nmonth_len(1:nmonth - 1) ) 111 112 112 !compute number of days between last monday and today 113 !compute number of days between last monday and today 113 114 CALL ymds2ju( 1900, 01, 01, 0.0, zjul ) ! compute julian day value of 01.01.1900 (our reference that was a Monday) 114 inbday = NINT(fjulday - zjul) ! compute nb day between 01.01.1900 and current day 115 idweek = MOD(inbday, 7) ! compute nb day between last monday and current day 115 inbday = NINT(fjulday - zjul) ! compute nb day between 01.01.1900 and current day 116 idweek = MOD(inbday, 7) ! compute nb day between last monday and current day 116 117 117 118 ! number of seconds since the beginning of current year/month/week/day at the middle of the time-step … … 135 136 !!---------------------------------------------------------------------- 136 137 !! *** ROUTINE day_init *** 137 !! 138 !! 138 139 !! ** Purpose : calendar values related to the months 139 140 !! … … 147 148 148 149 ! length of the month of the current year (from nleapy, read in namelist) 149 IF ( nleapy < 2 ) THEN 150 IF ( nleapy < 2 ) THEN 150 151 nmonth_len(:) = (/ 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31 /) 151 152 nyear_len(:) = 365 … … 167 168 ! time since Jan 1st 0 1 2 ... 11 12 13 168 169 ! ---------*--|--*--|--*--| ... |--*--|--*--|--*--|-------------------------------------- 169 ! <---> <---> <---> ... <---> <---> <---> 170 ! <---> <---> <---> ... <---> <---> <---> 170 171 ! month number 0 1 2 ... 11 12 13 171 172 ! … … 180 181 nmonth_end(jm) = nmonth_end(jm-1) + nsecd * nmonth_len(jm) 181 182 END DO 182 ! 183 END SUBROUTINE 183 ! 184 END SUBROUTINE 184 185 185 186 … … 187 188 !!---------------------------------------------------------------------- 188 189 !! *** ROUTINE day *** 189 !! 190 !! 190 191 !! ** Purpose : Compute the date with a day iteration IF necessary. 191 192 !! … … 199 200 !! - adatrj : date in days since the beginning of the run 200 201 !! - nsec_year : current time of the year (in second since 00h, jan 1st) 201 !!---------------------------------------------------------------------- 202 !!---------------------------------------------------------------------- 202 203 INTEGER, INTENT(in) :: kt ! ocean time-step indices 203 204 ! … … 210 211 zprec = 0.1 / rday 211 212 ! ! New time-step 212 nsec_year = nsec_year + ndt 213 nsec_month = nsec_month + ndt 213 nsec_year = nsec_year + ndt 214 nsec_month = nsec_month + ndt 214 215 nsec_week = nsec_week + ndt 215 nsec_day = nsec_day + ndt 216 nsec_day = nsec_day + ndt 216 217 adatrj = adatrj + rdttra(1) / rday 217 218 fjulday = fjulday + rdttra(1) / rday 218 219 IF( ABS(fjulday - REAL(NINT(fjulday),wp)) < zprec ) fjulday = REAL(NINT(fjulday),wp) ! avoid truncation error 219 220 IF( ABS(adatrj - REAL(NINT(adatrj ),wp)) < zprec ) adatrj = REAL(NINT(adatrj ),wp) ! avoid truncation error 220 221 221 222 IF( nsec_day > nsecd ) THEN ! New day 222 223 ! … … 251 252 252 253 IF( nsec_week > 7*nsecd ) nsec_week = ndt05 ! New week 253 254 254 255 IF(ln_ctl) THEN 255 256 WRITE(charout,FMT="('kt =', I4,' d/m/y =',I2,I2,I4)") kt, nday, nmonth, nyear … … 268 269 !!--------------------------------------------------------------------- 269 270 !! *** ROUTINE ts_rst *** 270 !! 271 !! 271 272 !! ** Purpose : Read or write calendar in restart file: 272 !! 273 !! 273 274 !! WRITE(READ) mode: 274 !! kt : number of time step since the begining of the experiment at the 275 !! kt : number of time step since the begining of the experiment at the 275 276 !! end of the current(previous) run 276 !! adatrj(0) : number of elapsed days since the begining of the experiment at the 277 !! adatrj(0) : number of elapsed days since the begining of the experiment at the 277 278 !! end of the current(previous) run (REAL -> keep fractions of day) 278 279 !! ndastp : date at the end of the current(previous) run (coded as yyyymmdd integer) 279 !! 280 !! 280 281 !! According to namelist parameter nrstdt, 281 282 !! nrstdt = 0 no control on the date (nit000 is arbitrary). … … 295 296 REAL(wp) :: zkt, zndastp 296 297 !!---------------------------------------------------------------------- 297 298 298 299 IF( TRIM(cdrw) == 'READ' ) THEN 299 300 … … 312 313 WRITE(numout,*) 313 314 ENDIF 314 ! Control of date 315 IF( nit000 - NINT( zkt ) /= 1 .AND. nrstdt /= 0 ) & 316 & CALL ctl_stop( ' ===>>>> : problem with nit000 for the restart', & 315 ! Control of date 316 IF( nit000 - NINT( zkt ) /= 1 .AND. nrstdt /= 0 ) & 317 & CALL ctl_stop( ' ===>>>> : problem with nit000 for the restart', & 317 318 & ' verify the restart file or rerun with nrstdt = 0 (namelist)' ) 318 319 ! define ndastp and adatrj 319 IF ( nrstdt == 2 ) THEN 320 IF ( nrstdt == 2 ) THEN 320 321 ! read the parameters correspondting to nit000 - 1 (last time step of previous run) 321 322 CALL iom_get( numror, 'ndastp', zndastp ) 322 323 ndastp = NINT( zndastp ) 323 324 CALL iom_get( numror, 'adatrj', adatrj ) 324 ELSE 325 ELSE 325 326 ! parameters correspondting to nit000 - 1 (as we start the step loop with a call to day) 326 327 ndastp = ndate0 - 1 ! ndate0 read in the namelist in dom_nam, we assume that we start run at 00:00 327 adatrj = ( REAL( nit000-1, wp ) * rdttra(1) ) / rday 328 ! note this is wrong if time step has changed during run 328 adatrj = ( REAL( nit000-1, wp ) * rdttra(1) ) / rday 329 ! note this is wrong if time step has changed during run 329 330 ENDIF 330 331 ELSE 331 332 ! parameters correspondting to nit000 - 1 (as we start the step loop with a call to day) 332 333 ndastp = ndate0 - 1 ! ndate0 read in the namelist in dom_nam, we assume that we start run at 00:00 333 adatrj = ( REAL( nit000-1, wp ) * rdttra(1) ) / rday 334 adatrj = ( REAL( nit000-1, wp ) * rdttra(1) ) / rday 334 335 ENDIF 335 336 IF( ABS(adatrj - REAL(NINT(adatrj),wp)) < 0.1 / rday ) adatrj = REAL(NINT(adatrj),wp) ! avoid truncation error … … 347 348 IF(lwp) WRITE(numout,*) 348 349 IF(lwp) WRITE(numout,*) 'rst_write : write oce restart file kt =', kt 349 IF(lwp) WRITE(numout,*) '~~~~~~~' 350 IF(lwp) WRITE(numout,*) '~~~~~~~' 350 351 ENDIF 351 352 ! calendar control 352 CALL iom_rstput( kt, nitrst, numrow, 'kt' , REAL( kt , wp) ) ! time-step 353 CALL iom_rstput( kt, nitrst, numrow, 'kt' , REAL( kt , wp) ) ! time-step 353 354 CALL iom_rstput( kt, nitrst, numrow, 'ndastp' , REAL( ndastp, wp) ) ! date 354 355 CALL iom_rstput( kt, nitrst, numrow, 'adatrj' , adatrj ) ! number of elapsed days since -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/OPA_SRC/DOM/domain.F90
r3680 r3764 68 68 !! - 1D configuration, move Coriolis, u and v at T-point 69 69 !!---------------------------------------------------------------------- 70 INTEGER :: jk 71 INTEGER :: iconf = 0 ! temporaryintegers72 !!---------------------------------------------------------------------- 73 ! 74 IF( nn_timing == 1 ) CALL timing_start('dom_init')70 INTEGER :: jk ! dummy loop argument 71 INTEGER :: iconf = 0 ! local integers 72 !!---------------------------------------------------------------------- 73 ! 74 IF( nn_timing == 1 ) CALL timing_start('dom_init') 75 75 ! 76 76 IF(lwp) THEN … … 88 88 IF( lk_vvl ) CALL dom_vvl ! Vertical variable mesh 89 89 ! 90 IF( lk_c1d ) THEN ! 1D configuration 91 CALL cor_c1d ! Coriolis set at T-point 92 umask(:,:,:) = tmask(:,:,:) ! U, V moved at T-point 93 vmask(:,:,:) = tmask(:,:,:) 94 END IF 95 ! 96 hu(:,:) = 0.e0 ! Ocean depth at U- and V-points 97 hv(:,:) = 0.e0 90 IF( lk_c1d ) CALL cor_c1d ! 1D configuration: Coriolis set at T-point 91 ! 92 hu(:,:) = 0._wp ! Ocean depth at U- and V-points 93 hv(:,:) = 0._wp 98 94 DO jk = 1, jpk 99 95 hu(:,:) = hu(:,:) + fse3u(:,:,jk) * umask(:,:,jk) … … 101 97 END DO 102 98 ! ! Inverse of the local depth 103 hur(:,:) = 1. / ( hu(:,:) + 1.e0- umask(:,:,1) ) * umask(:,:,1)104 hvr(:,:) = 1. / ( hv(:,:) + 1.e0- vmask(:,:,1) ) * vmask(:,:,1)99 hur(:,:) = 1._wp / ( hu(:,:) + 1._wp - umask(:,:,1) ) * umask(:,:,1) 100 hvr(:,:) = 1._wp / ( hv(:,:) + 1._wp - vmask(:,:,1) ) * vmask(:,:,1) 105 101 106 102 CALL dom_stp ! time step … … 108 104 IF( .NOT.ln_rstart ) CALL dom_ctl ! Domain control 109 105 ! 110 IF( nn_timing == 1 ) CALL timing_stop('dom_init')106 IF( nn_timing == 1 ) CALL timing_stop('dom_init') 111 107 ! 112 108 END SUBROUTINE dom_init … … 294 290 CALL mpp_maxloc( e2t(:,:), tmask(:,:,1), ze2max, iima2,ijma2 ) 295 291 ELSE 296 ze1min = MINVAL( e1t(:,:), mask = tmask(:,:,1) == 1. e0)297 ze2min = MINVAL( e2t(:,:), mask = tmask(:,:,1) == 1. e0)298 ze1max = MAXVAL( e1t(:,:), mask = tmask(:,:,1) == 1. e0)299 ze2max = MAXVAL( e2t(:,:), mask = tmask(:,:,1) == 1. e0)300 301 iloc = MINLOC( e1t(:,:), mask = tmask(:,:,1) == 1. e0)292 ze1min = MINVAL( e1t(:,:), mask = tmask(:,:,1) == 1._wp ) 293 ze2min = MINVAL( e2t(:,:), mask = tmask(:,:,1) == 1._wp ) 294 ze1max = MAXVAL( e1t(:,:), mask = tmask(:,:,1) == 1._wp ) 295 ze2max = MAXVAL( e2t(:,:), mask = tmask(:,:,1) == 1._wp ) 296 297 iloc = MINLOC( e1t(:,:), mask = tmask(:,:,1) == 1._wp ) 302 298 iimi1 = iloc(1) + nimpp - 1 303 299 ijmi1 = iloc(2) + njmpp - 1 304 iloc = MINLOC( e2t(:,:), mask = tmask(:,:,1) == 1. e0)300 iloc = MINLOC( e2t(:,:), mask = tmask(:,:,1) == 1._wp ) 305 301 iimi2 = iloc(1) + nimpp - 1 306 302 ijmi2 = iloc(2) + njmpp - 1 307 iloc = MAXLOC( e1t(:,:), mask = tmask(:,:,1) == 1. e0)303 iloc = MAXLOC( e1t(:,:), mask = tmask(:,:,1) == 1._wp ) 308 304 iima1 = iloc(1) + nimpp - 1 309 305 ijma1 = iloc(2) + njmpp - 1 310 iloc = MAXLOC( e2t(:,:), mask = tmask(:,:,1) == 1. e0)306 iloc = MAXLOC( e2t(:,:), mask = tmask(:,:,1) == 1._wp ) 311 307 iima2 = iloc(1) + nimpp - 1 312 308 ijma2 = iloc(2) + njmpp - 1 -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/OPA_SRC/DOM/domzgr.F90
r3702 r3764 16 16 !! 3.3 ! 2010-11 (G. Madec) add mbk. arrays associated to the deepest ocean level 17 17 !! 3.4 ! 2012-08 (J. Siddorn) added Siddorn and Furner stretching function 18 !! 3.4 ! 2012-12 (R. Bourdalle-Badie and G. Reffray) modify C1D case 18 19 !!---------------------------------------------------------------------- 19 20 … … 40 41 USE lbclnk ! ocean lateral boundary conditions (or mpp link) 41 42 USE lib_mpp ! distributed memory computing library 42 USE wrk_nemo ! Memory allocation43 USE timing ! Timing43 USE wrk_nemo ! Memory allocation 44 USE timing ! Timing 44 45 45 46 IMPLICIT NONE … … 84 85 !! *** ROUTINE dom_zgr *** 85 86 !! 86 !! ** Purpose : set the depth of model levels and the resulting87 !! vertical scale factors.87 !! ** Purpose : set the depth of model levels and the resulting 88 !! vertical scale factors. 88 89 !! 89 90 !! ** Method : - reference 1D vertical coordinate (gdep._0, e3._0) … … 97 98 !! ** Action : define gdep., e3., mbathy and bathy 98 99 !!---------------------------------------------------------------------- 99 INTEGER :: ioptio = 0 ! temporaryinteger100 INTEGER :: ioptio, ibat ! local integer 100 101 ! 101 102 NAMELIST/namzgr/ ln_zco, ln_zps, ln_sco 102 103 !!---------------------------------------------------------------------- 103 104 ! 104 IF( nn_timing == 1 ) CALL timing_start('dom_zgr')105 IF( nn_timing == 1 ) CALL timing_start('dom_zgr') 105 106 ! 106 107 REWIND( numnam ) ! Read Namelist namzgr : vertical coordinate' … … 118 119 119 120 ioptio = 0 ! Check Vertical coordinate options 120 IF( ln_zco )ioptio = ioptio + 1121 IF( ln_zps )ioptio = ioptio + 1122 IF( ln_sco )ioptio = ioptio + 1121 IF( ln_zco ) ioptio = ioptio + 1 122 IF( ln_zps ) ioptio = ioptio + 1 123 IF( ln_sco ) ioptio = ioptio + 1 123 124 IF( ioptio /= 1 ) CALL ctl_stop( ' none or several vertical coordinate options used' ) 124 125 ! … … 127 128 CALL zgr_z ! Reference z-coordinate system (always called) 128 129 CALL zgr_bat ! Bathymetry fields (levels and meters) 130 IF( lk_c1d ) CALL lbc_lnk( bathy , 'T', 1._wp ) ! 1D config.: same bathy value over the 3x3 domain 129 131 IF( ln_zco ) CALL zgr_zco ! z-coordinate 130 132 IF( ln_zps ) CALL zgr_zps ! Partial step z-coordinate … … 134 136 ! ----------------------------------- 135 137 IF( lzoom ) CALL zgr_bat_zoom ! correct mbathy in case of zoom subdomain 136 IF( .NOT.lk_c1d ) CALL zgr_bat_ctl ! check bathymetry (mbathy) and suppress iso ated ocean points138 IF( .NOT.lk_c1d ) CALL zgr_bat_ctl ! check bathymetry (mbathy) and suppress isolated ocean points 137 139 CALL zgr_bot_level ! deepest ocean level for t-, u- and v-points 138 140 ! 139 ! 140 141 IF( lk_c1d ) THEN ! 1D config.: same mbathy value over the 3x3 domain 142 ibat = mbathy(2,2) 143 mbathy(:,:) = ibat 144 END IF 145 ! 141 146 IF( nprint == 1 .AND. lwp ) THEN 142 147 WRITE(numout,*) ' MIN val mbathy ', MINVAL( mbathy(:,:) ), ' MAX ', MAXVAL( mbathy(:,:) ) … … 478 483 END DO 479 484 END DO 480 IF(lwp) WRITE(numout,*) 485 IF(lwp) WRITE(numout,*) 481 486 IF(lwp) WRITE(numout,*) ' orca_r2: Gibraltar strait open at i=',ii0,' j=',ij0 482 487 ! … … 742 747 ! 743 748 mbkt(:,:) = MAX( mbathy(:,:) , 1 ) ! bottom k-index of T-level (=1 over land) 749 744 750 ! ! bottom k-index of W-level = mbkt+1 745 751 DO jj = 1, jpjm1 ! bottom k-index of u- (v-) level … … 1220 1226 END DO 1221 1227 ! 1222 ! Apply lateral boundary condition CAUTION: ke ptthe value when the lbc field is zero1228 ! Apply lateral boundary condition CAUTION: keep the value when the lbc field is zero 1223 1229 ztmp(:,:) = zenv(:,:) ; CALL lbc_lnk( zenv, 'T', 1._wp ) 1224 1230 DO jj = 1, nlcj … … 1231 1237 ! ! ================ ! 1232 1238 ! 1233 ! ! envelop bathymetry saved in hbatt 1239 ! Fill ghost rows with appropriate values to avoid undefined e3 values with some mpp decompositions 1240 DO ji = nlci+1, jpi 1241 zenv(ji,1:nlcj) = zenv(nlci,1:nlcj) 1242 END DO 1243 ! 1244 DO jj = nlcj+1, jpj 1245 zenv(:,jj) = zenv(:,nlcj) 1246 END DO 1247 ! 1248 ! Envelope bathymetry saved in hbatt 1234 1249 hbatt(:,:) = zenv(:,:) 1235 1250 IF( MINVAL( gphit(:,:) ) * MAXVAL( gphit(:,:) ) <= 0._wp ) THEN -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/OPA_SRC/DOM/istate.F90
r3680 r3764 41 41 USE dynspg_exp ! pressure gradient schemes 42 42 USE dynspg_ts ! pressure gradient schemes 43 USE sol_oce ! ocean solver variables 43 44 USE lib_mpp ! MPP library 44 45 USE restart ! restart … … 106 107 hdivb(:,:,:) = 0._wp ; hdivn(:,:,:) = 0._wp 107 108 ! 108 ! ! define e3u_b, e3v_b from e3t_b initialized in domzgr109 CALL dom_vvl_2( nit000, fse3u_b(:,:,:), fse3v_b(:,:,:) )110 !111 109 IF( cp_cfg == 'eel' ) THEN 112 110 CALL istate_eel ! EEL configuration : start from pre-defined U,V T-S fields … … 133 131 ENDDO 134 132 ENDIF 133 ! ! define e3u_b, e3v_b from e3t_b initialized in domzgr 134 CALL dom_vvl_2( nit000, fse3u_b(:,:,:), fse3v_b(:,:,:) ) 135 135 ! 136 136 ENDIF … … 138 138 IF( lk_agrif ) THEN ! read free surface arrays in restart file 139 139 IF( ln_rstart ) THEN 140 IF( lk_dynspg_flt ) CALL flt_rst( nit000, 'READ' ) ! read or initialize the following fields 141 ! ! gcx, gcxb for agrif_opa_init 142 ENDIF ! explicit case not coded yet with AGRIF 140 IF( lk_dynspg_flt ) THEN ! read or initialize the following fields 141 ! ! gcx, gcxb for agrif_opa_init 142 IF( sol_oce_alloc() > 0 ) CALL ctl_stop('agrif sol_oce_alloc: allocation of arrays failed') 143 CALL flt_rst( nit000, 'READ' ) 144 ENDIF 145 ENDIF ! explicit case not coded yet with AGRIF 143 146 ENDIF 144 147 ! -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/OPA_SRC/DYN/dynhpg.F90
r3632 r3764 11 11 !! 8.5 ! 2002-08 (A. Bozec) hpg_zps: Original code 12 12 !! NEMO 1.0 ! 2005-10 (A. Beckmann, B.W. An) various s-coordinate options 13 !! ! Original code for hpg_ctl, hpg_hel hpg_wdj, hpg_djc, hpg_rot 13 !! ! Original code for hpg_ctl, hpg_hel hpg_wdj, hpg_djc, hpg_rot 14 14 !! - ! 2005-11 (G. Madec) style & small optimisation 15 15 !! 3.3 ! 2010-10 (C. Ethe, G. Madec) reorganisation of initialisation phase … … 31 31 USE dom_oce ! ocean space and time domain 32 32 USE phycst ! physical constants 33 USE trdmod ! ocean dynamics trends 33 USE trdmod ! ocean dynamics trends 34 34 USE trdmod_oce ! ocean variables trends 35 35 USE in_out_manager ! I/O manager 36 36 USE prtctl ! Print control 37 USE lbclnk ! lateral boundary condition 37 USE lbclnk ! lateral boundary condition 38 38 USE lib_mpp ! MPP library 39 39 USE wrk_nemo ! Memory Allocation … … 46 46 PUBLIC dyn_hpg_init ! routine called by opa module 47 47 48 ! !!* Namelist namdyn_hpg : hydrostatic pressure gradient 48 ! !!* Namelist namdyn_hpg : hydrostatic pressure gradient 49 49 LOGICAL , PUBLIC :: ln_hpg_zco = .TRUE. !: z-coordinate - full steps 50 50 LOGICAL , PUBLIC :: ln_hpg_zps = .FALSE. !: z-coordinate - partial steps (interpolation) … … 54 54 LOGICAL , PUBLIC :: ln_dynhpg_imp = .FALSE. !: semi-implicite hpg flag 55 55 56 INTEGER :: nhpg = 0 ! = 0 to 7, type of pressure gradient scheme used ! (deduced from ln_hpg_... flags)56 INTEGER , PUBLIC :: nhpg = 0 ! = 0 to 7, type of pressure gradient scheme used ! (deduced from ln_hpg_... flags) (PUBLIC for TAM) 57 57 58 58 !! * Substitutions … … 70 70 !! *** ROUTINE dyn_hpg *** 71 71 !! 72 !! ** Method : Call the hydrostatic pressure gradient routine 72 !! ** Method : Call the hydrostatic pressure gradient routine 73 73 !! using the scheme defined in the namelist 74 !! 74 !! 75 75 !! ** Action : - Update (ua,va) with the now hydrastatic pressure trend 76 76 !! - Save the trend (l_trddyn=T) … … 84 84 IF( l_trddyn ) THEN ! Temporary saving of ua and va trends (l_trddyn) 85 85 CALL wrk_alloc( jpi,jpj,jpk, ztrdu, ztrdv ) 86 ztrdu(:,:,:) = ua(:,:,:) 87 ztrdv(:,:,:) = va(:,:,:) 88 ENDIF 86 ztrdu(:,:,:) = ua(:,:,:) 87 ztrdv(:,:,:) = va(:,:,:) 88 ENDIF 89 89 ! 90 90 SELECT CASE ( nhpg ) ! Hydrostatic pressure gradient computation … … 101 101 CALL trd_mod( ztrdu, ztrdv, jpdyn_trd_hpg, 'DYN', kt ) 102 102 CALL wrk_dealloc( jpi,jpj,jpk, ztrdu, ztrdv ) 103 ENDIF 103 ENDIF 104 104 ! 105 105 IF(ln_ctl) CALL prt_ctl( tab3d_1=ua, clinfo1=' hpg - Ua: ', mask1=umask, & … … 161 161 ! 162 162 ! ! Consistency check 163 ioptio = 0 163 ioptio = 0 164 164 IF( ln_hpg_zco ) ioptio = ioptio + 1 165 165 IF( ln_hpg_zps ) ioptio = ioptio + 1 … … 185 185 !! ua = ua - 1/e1u * zhpi 186 186 !! va = va - 1/e2v * zhpj 187 !! 187 !! 188 188 !! ** Action : - Update (ua,va) with the now hydrastatic pressure trend 189 189 !!---------------------------------------------------------------------- … … 192 192 INTEGER :: ji, jj, jk ! dummy loop indices 193 193 REAL(wp) :: zcoef0, zcoef1 ! temporary scalars 194 REAL(wp), POINTER, DIMENSION(:,:,:) :: zhpi, zhpj 195 !!---------------------------------------------------------------------- 196 ! 194 REAL(wp), POINTER, DIMENSION(:,:,:) :: zhpi, zhpj 195 !!---------------------------------------------------------------------- 196 ! 197 197 CALL wrk_alloc( jpi,jpj,jpk, zhpi, zhpj ) 198 198 ! … … 202 202 IF(lwp) WRITE(numout,*) '~~~~~~~~~~~ z-coordinate case ' 203 203 ENDIF 204 205 zcoef0 = - grav * 0.5_wp ! Local constant initialization 204 205 zcoef0 = - grav * 0.5_wp ! Local constant initialization 206 206 207 207 ! Surface value … … 247 247 !!--------------------------------------------------------------------- 248 248 !! *** ROUTINE hpg_zps *** 249 !! 249 !! 250 250 !! ** Method : z-coordinate plus partial steps case. blahblah... 251 !! 251 !! 252 252 !! ** Action : - Update (ua,va) with the now hydrastatic pressure trend 253 !!---------------------------------------------------------------------- 253 !!---------------------------------------------------------------------- 254 254 INTEGER, INTENT(in) :: kt ! ocean time-step index 255 255 !! … … 257 257 INTEGER :: iku, ikv ! temporary integers 258 258 REAL(wp) :: zcoef0, zcoef1, zcoef2, zcoef3 ! temporary scalars 259 REAL(wp), POINTER, DIMENSION(:,:,:) :: zhpi, zhpj 259 REAL(wp), POINTER, DIMENSION(:,:,:) :: zhpi, zhpj 260 260 !!---------------------------------------------------------------------- 261 261 ! … … 363 363 INTEGER :: ji, jj, jk ! dummy loop indices 364 364 REAL(wp) :: zcoef0, zuap, zvap, znad ! temporary scalars 365 REAL(wp), POINTER, DIMENSION(:,:,:) :: zhpi, zhpj 365 REAL(wp), POINTER, DIMENSION(:,:,:) :: zhpi, zhpj 366 366 !!---------------------------------------------------------------------- 367 367 ! … … 383 383 ! Surface value 384 384 DO jj = 2, jpjm1 385 DO ji = fs_2, fs_jpim1 ! vector opt. 385 DO ji = fs_2, fs_jpim1 ! vector opt. 386 386 ! hydrostatic pressure gradient along s-surfaces 387 387 zhpi(ji,jj,1) = zcoef0 / e1u(ji,jj) * ( fse3w(ji+1,jj ,1) * ( znad + rhd(ji+1,jj ,1) ) & … … 397 397 ua(ji,jj,1) = ua(ji,jj,1) + zhpi(ji,jj,1) + zuap 398 398 va(ji,jj,1) = va(ji,jj,1) + zhpj(ji,jj,1) + zvap 399 END DO 400 END DO 401 399 END DO 400 END DO 401 402 402 ! interior value (2=<jk=<jpkm1) 403 DO jk = 2, jpkm1 404 DO jj = 2, jpjm1 405 DO ji = fs_2, fs_jpim1 ! vector opt. 403 DO jk = 2, jpkm1 404 DO jj = 2, jpjm1 405 DO ji = fs_2, fs_jpim1 ! vector opt. 406 406 ! hydrostatic pressure gradient along s-surfaces 407 zhpi(ji,jj,jk) = zhpi(ji,jj,jk-1) + zcoef0 / e1u(ji,jj) & 408 & * ( fse3w(ji+1,jj,jk) * ( rhd(ji+1,jj,jk) + rhd(ji+1,jj,jk-1) + 2*znad ) & 407 zhpi(ji,jj,jk) = zhpi(ji,jj,jk-1) + zcoef0 / e1u(ji,jj) & 408 & * ( fse3w(ji+1,jj,jk) * ( rhd(ji+1,jj,jk) + rhd(ji+1,jj,jk-1) + 2*znad ) & 409 409 & - fse3w(ji ,jj,jk) * ( rhd(ji ,jj,jk) + rhd(ji ,jj,jk-1) + 2*znad ) ) 410 410 zhpj(ji,jj,jk) = zhpj(ji,jj,jk-1) + zcoef0 / e2v(ji,jj) & … … 432 432 !! 433 433 !! ** Method : Density Jacobian with Cubic polynomial scheme 434 !! 434 !! 435 435 !! Reference: Shchepetkin and McWilliams, J. Geophys. Res., 108(C3), 3090, 2003 436 436 !!---------------------------------------------------------------------- … … 441 441 REAL(wp) :: z1_10, cffu, cffx ! " " 442 442 REAL(wp) :: z1_12, cffv, cffy ! " " 443 REAL(wp), POINTER, DIMENSION(:,:,:) :: zhpi, zhpj 443 REAL(wp), POINTER, DIMENSION(:,:,:) :: zhpi, zhpj 444 444 REAL(wp), POINTER, DIMENSION(:,:,:) :: dzx, dzy, dzz, dzu, dzv, dzw 445 445 REAL(wp), POINTER, DIMENSION(:,:,:) :: drhox, drhoy, drhoz, drhou, drhov, drhow … … 447 447 !!---------------------------------------------------------------------- 448 448 ! 449 CALL wrk_alloc( jpi, jpj, jpk, dzx , dzy , dzz , dzu , dzv , dzw ) 450 CALL wrk_alloc( jpi, jpj, jpk, drhox, drhoy, drhoz, drhou, drhov, drhow ) 451 CALL wrk_alloc( jpi, jpj, jpk, rho_i, rho_j, rho_k, zhpi, zhpj ) 449 CALL wrk_alloc( jpi, jpj, jpk, dzx , dzy , dzz , dzu , dzv , dzw ) 450 CALL wrk_alloc( jpi, jpj, jpk, drhox, drhoy, drhoz, drhou, drhov, drhow ) 451 CALL wrk_alloc( jpi, jpj, jpk, rho_i, rho_j, rho_k, zhpi, zhpj ) 452 452 ! 453 453 … … 497 497 cffu = 2._wp * drhox(ji+1,jj ,jk) * drhox(ji,jj,jk ) 498 498 cffx = 2._wp * dzx (ji+1,jj ,jk) * dzx (ji,jj,jk ) 499 499 500 500 cffv = 2._wp * drhoy(ji ,jj+1,jk) * drhoy(ji,jj,jk ) 501 501 cffy = 2._wp * dzy (ji ,jj+1,jk) * dzy (ji,jj,jk ) … … 568 568 & + 0.5_wp * ( rhd(ji,jj,2) - rhd(ji,jj,1) ) & 569 569 & * ( fse3w (ji,jj,1) - fsde3w(ji,jj,1) ) & 570 & / ( fsde3w(ji,jj,2) - fsde3w(ji,jj,1) ) ) 570 & / ( fsde3w(ji,jj,2) - fsde3w(ji,jj,1) ) ) 571 571 END DO 572 572 END DO … … 631 631 ! ---------------- 632 632 DO jk = 2, jpkm1 633 DO jj = 2, jpjm1 633 DO jj = 2, jpjm1 634 634 DO ji = fs_2, fs_jpim1 ! vector opt. 635 635 ! hydrostatic pressure gradient along s-surfaces … … 647 647 END DO 648 648 ! 649 CALL wrk_dealloc( jpi, jpj, jpk, dzx , dzy , dzz , dzu , dzv , dzw ) 650 CALL wrk_dealloc( jpi, jpj, jpk, drhox, drhoy, drhoz, drhou, drhov, drhow ) 651 CALL wrk_dealloc( jpi, jpj, jpk, rho_i, rho_j, rho_k, zhpi, zhpj ) 649 CALL wrk_dealloc( jpi, jpj, jpk, dzx , dzy , dzz , dzu , dzv , dzw ) 650 CALL wrk_dealloc( jpi, jpj, jpk, drhox, drhoy, drhoz, drhou, drhov, drhow ) 651 CALL wrk_dealloc( jpi, jpj, jpk, rho_i, rho_j, rho_k, zhpi, zhpj ) 652 652 ! 653 653 END SUBROUTINE hpg_djc … … 676 676 INTEGER :: jk1, jis, jid, jjs, jjd 677 677 REAL(wp) :: zuijk, zvijk, zpwes, zpwed, zpnss, zpnsd, zdeps 678 REAL(wp) :: zrhdt1 678 REAL(wp) :: zrhdt1 679 679 REAL(wp) :: zdpdx1, zdpdx2, zdpdy1, zdpdy2 680 REAL(wp), POINTER, DIMENSION(:,:,:) :: zdept, zrhh 680 REAL(wp), POINTER, DIMENSION(:,:,:) :: zdept, zrhh 681 681 REAL(wp), POINTER, DIMENSION(:,:,:) :: zhpi, zu, zv, fsp, xsp, asp, bsp, csp, dsp 682 682 !!---------------------------------------------------------------------- 683 683 ! 684 CALL wrk_alloc( jpi,jpj,jpk, zhpi, zu, zv, fsp, xsp, asp, bsp, csp, dsp ) 685 CALL wrk_alloc( jpi,jpj,jpk, zdept, zrhh ) 684 CALL wrk_alloc( jpi,jpj,jpk, zhpi, zu, zv, fsp, xsp, asp, bsp, csp, dsp ) 685 CALL wrk_alloc( jpi,jpj,jpk, zdept, zrhh ) 686 686 ! 687 687 IF( kt == nit000 ) THEN … … 693 693 !!---------------------------------------------------------------------- 694 694 ! Local constant initialization 695 zcoef0 = - grav 695 zcoef0 = - grav 696 696 znad = 0.0_wp 697 697 IF( lk_vvl ) znad = 1._wp … … 700 700 zhpi(:,:,:) = 0._wp 701 701 zrhh(:,:,:) = rhd(:,:,:) 702 702 703 703 ! Preparing vertical density profile "zrhh(:,:,:)" for hybrid-sco coordinate 704 704 DO jj = 1, jpj 705 DO ji = 1, jpi 705 DO ji = 1, jpi 706 706 jk = mbathy(ji,jj) 707 707 IF( jk <= 0 ) THEN; zrhh(ji,jj,:) = 0._wp … … 711 711 zrhh(ji,jj,jkk) = interp1(fsde3w(ji,jj,jkk), fsde3w(ji,jj,jkk-1), & 712 712 fsde3w(ji,jj,jkk-2), rhd(ji,jj,jkk-1), rhd(ji,jj,jkk-2)) 713 END DO 713 END DO 714 714 ENDIF 715 715 END DO … … 728 728 xsp(:,:,:) = zdept(:,:,:) 729 729 730 ! Construct the vertical density profile with the 730 ! Construct the vertical density profile with the 731 731 ! constrained cubic spline interpolation 732 732 ! rho(z) = asp + bsp*z + csp*z^2 + dsp*z^3 733 CALL cspline(fsp,xsp,asp,bsp,csp,dsp,polynomial_type) 733 CALL cspline(fsp,xsp,asp,bsp,csp,dsp,polynomial_type) 734 734 735 735 ! Integrate the hydrostatic pressure "zhpi(:,:,:)" at "T(ji,jj,1)" 736 736 DO jj = 2, jpj 737 DO ji = 2, jpi 737 DO ji = 2, jpi 738 738 zrhdt1 = zrhh(ji,jj,1) - interp3(zdept(ji,jj,1),asp(ji,jj,1), & 739 739 bsp(ji,jj,1), csp(ji,jj,1), & … … 741 741 742 742 ! assuming linear profile across the top half surface layer 743 zhpi(ji,jj,1) = 0.5_wp * fse3w(ji,jj,1) * zrhdt1 743 zhpi(ji,jj,1) = 0.5_wp * fse3w(ji,jj,1) * zrhdt1 744 744 END DO 745 745 END DO 746 746 747 747 ! Calculate the pressure "zhpi(:,:,:)" at "T(ji,jj,2:jpkm1)" 748 DO jk = 2, jpkm1 749 DO jj = 2, jpj 748 DO jk = 2, jpkm1 749 DO jj = 2, jpj 750 750 DO ji = 2, jpi 751 751 zhpi(ji,jj,jk) = zhpi(ji,jj,jk-1) + & … … 758 758 759 759 ! Z coordinate of U(ji,jj,1:jpkm1) and V(ji,jj,1:jpkm1) 760 DO jj = 2, jpjm1 761 DO ji = 2, jpim1 760 DO jj = 2, jpjm1 761 DO ji = 2, jpim1 762 762 zu(ji,jj,1) = - ( fse3u(ji,jj,1) - sshu_n(ji,jj) * znad) 763 763 zv(ji,jj,1) = - ( fse3v(ji,jj,1) - sshv_n(ji,jj) * znad) … … 765 765 END DO 766 766 767 DO jk = 2, jpkm1 768 DO jj = 2, jpjm1 769 DO ji = 2, jpim1 767 DO jk = 2, jpkm1 768 DO jj = 2, jpjm1 769 DO ji = 2, jpim1 770 770 zu(ji,jj,jk) = zu(ji,jj,jk-1)- fse3u(ji,jj,jk) 771 771 zv(ji,jj,jk) = zv(ji,jj,jk-1)- fse3v(ji,jj,jk) … … 773 773 END DO 774 774 END DO 775 776 DO jk = 1, jpkm1 777 DO jj = 2, jpjm1 778 DO ji = 2, jpim1 775 776 DO jk = 1, jpkm1 777 DO jj = 2, jpjm1 778 DO ji = 2, jpim1 779 779 zu(ji,jj,jk) = zu(ji,jj,jk) + 0.5_wp * fse3u(ji,jj,jk) 780 780 zv(ji,jj,jk) = zv(ji,jj,jk) + 0.5_wp * fse3v(ji,jj,jk) … … 795 795 796 796 797 DO jk = 1, jpkm1 798 DO jj = 2, jpjm1 799 DO ji = 2, jpim1 797 DO jk = 1, jpkm1 798 DO jj = 2, jpjm1 799 DO ji = 2, jpim1 800 800 zpwes = 0._wp; zpwed = 0._wp 801 801 zpnss = 0._wp; zpnsd = 0._wp … … 812 812 813 813 ! integrate the pressure on the shallow side 814 jk1 = jk 814 jk1 = jk 815 815 DO WHILE ( -zdept(jis,jj,jk1) > zuijk ) 816 816 IF( jk1 == mbku(ji,jj) ) THEN … … 819 819 ENDIF 820 820 zdeps = MIN(zdept(jis,jj,jk1+1), -zuijk) 821 zpwes = zpwes + & 821 zpwes = zpwes + & 822 822 integ_spline(zdept(jis,jj,jk1), zdeps, & 823 823 asp(jis,jj,jk1), bsp(jis,jj,jk1), & … … 825 825 jk1 = jk1 + 1 826 826 END DO 827 827 828 828 ! integrate the pressure on the deep side 829 jk1 = jk 829 jk1 = jk 830 830 DO WHILE ( -zdept(jid,jj,jk1) < zuijk ) 831 831 IF( jk1 == 1 ) THEN … … 838 838 ENDIF 839 839 zdeps = MAX(zdept(jid,jj,jk1-1), -zuijk) 840 zpwed = zpwed + & 840 zpwed = zpwed + & 841 841 integ_spline(zdeps, zdept(jid,jj,jk1), & 842 842 asp(jid,jj,jk1-1), bsp(jid,jj,jk1-1), & … … 844 844 jk1 = jk1 - 1 845 845 END DO 846 846 847 847 ! update the momentum trends in u direction 848 848 849 849 zdpdx1 = zcoef0 / e1u(ji,jj) * (zhpi(ji+1,jj,jk) - zhpi(ji,jj,jk)) 850 850 IF( lk_vvl ) THEN 851 zdpdx2 = zcoef0 / e1u(ji,jj) * & 852 ( REAL(jis-jid, wp) * (zpwes + zpwed) + (sshn(ji+1,jj)-sshn(ji,jj)) ) 851 zdpdx2 = zcoef0 / e1u(ji,jj) * & 852 ( REAL(jis-jid, wp) * (zpwes + zpwed) + (sshn(ji+1,jj)-sshn(ji,jj)) ) 853 853 ELSE 854 zdpdx2 = zcoef0 / e1u(ji,jj) * REAL(jis-jid, wp) * (zpwes + zpwed) 854 zdpdx2 = zcoef0 / e1u(ji,jj) * REAL(jis-jid, wp) * (zpwes + zpwed) 855 855 ENDIF 856 856 … … 858 858 & umask(ji,jj,jk) * tmask(ji,jj,jk) * tmask(ji+1,jj,jk) 859 859 ENDIF 860 860 861 861 !!!!! for v equation 862 862 IF( jk <= mbkv(ji,jj) ) THEN … … 868 868 869 869 ! integrate the pressure on the shallow side 870 jk1 = jk 870 jk1 = jk 871 871 DO WHILE ( -zdept(ji,jjs,jk1) > zvijk ) 872 872 IF( jk1 == mbkv(ji,jj) ) THEN … … 875 875 ENDIF 876 876 zdeps = MIN(zdept(ji,jjs,jk1+1), -zvijk) 877 zpnss = zpnss + & 877 zpnss = zpnss + & 878 878 integ_spline(zdept(ji,jjs,jk1), zdeps, & 879 879 asp(ji,jjs,jk1), bsp(ji,jjs,jk1), & … … 881 881 jk1 = jk1 + 1 882 882 END DO 883 883 884 884 ! integrate the pressure on the deep side 885 jk1 = jk 885 jk1 = jk 886 886 DO WHILE ( -zdept(ji,jjd,jk1) < zvijk ) 887 887 IF( jk1 == 1 ) THEN … … 894 894 ENDIF 895 895 zdeps = MAX(zdept(ji,jjd,jk1-1), -zvijk) 896 zpnsd = zpnsd + & 896 zpnsd = zpnsd + & 897 897 integ_spline(zdeps, zdept(ji,jjd,jk1), & 898 898 asp(ji,jjd,jk1-1), bsp(ji,jjd,jk1-1), & … … 900 900 jk1 = jk1 - 1 901 901 END DO 902 902 903 903 904 904 ! update the momentum trends in v direction … … 907 907 IF( lk_vvl ) THEN 908 908 zdpdy2 = zcoef0 / e2v(ji,jj) * & 909 ( REAL(jjs-jjd, wp) * (zpnss + zpnsd) + (sshn(ji,jj+1)-sshn(ji,jj)) ) 909 ( REAL(jjs-jjd, wp) * (zpnss + zpnsd) + (sshn(ji,jj+1)-sshn(ji,jj)) ) 910 910 ELSE 911 zdpdy2 = zcoef0 / e2v(ji,jj) * REAL(jjs-jjd, wp) * (zpnss + zpnsd ) 911 zdpdy2 = zcoef0 / e2v(ji,jj) * REAL(jjs-jjd, wp) * (zpnss + zpnsd ) 912 912 ENDIF 913 913 … … 916 916 ENDIF 917 917 918 918 919 919 END DO 920 920 END DO 921 921 END DO 922 922 ! 923 CALL wrk_dealloc( jpi,jpj,jpk, zhpi, zu, zv, fsp, xsp, asp, bsp, csp, dsp ) 924 CALL wrk_dealloc( jpi,jpj,jpk, zdept, zrhh ) 923 CALL wrk_dealloc( jpi,jpj,jpk, zhpi, zu, zv, fsp, xsp, asp, bsp, csp, dsp ) 924 CALL wrk_dealloc( jpi,jpj,jpk, zdept, zrhh ) 925 925 ! 926 926 END SUBROUTINE hpg_prj … … 929 929 !!---------------------------------------------------------------------- 930 930 !! *** ROUTINE cspline *** 931 !! 931 !! 932 932 !! ** Purpose : constrained cubic spline interpolation 933 !! 934 !! ** Method : f(x) = asp + bsp*x + csp*x^2 + dsp*x^3 933 !! 934 !! ** Method : f(x) = asp + bsp*x + csp*x^2 + dsp*x^3 935 935 !! Reference: CJC Kruger, Constrained Cubic Spline Interpoltation 936 936 !! … … 938 938 IMPLICIT NONE 939 939 REAL(wp), DIMENSION(:,:,:), INTENT(in) :: fsp, xsp ! value and coordinate 940 REAL(wp), DIMENSION(:,:,:), INTENT(out) :: asp, bsp, csp, dsp ! coefficients of 940 REAL(wp), DIMENSION(:,:,:), INTENT(out) :: asp, bsp, csp, dsp ! coefficients of 941 941 ! the interpoated function 942 INTEGER, INTENT(in) :: polynomial_type ! 1: cubic spline 942 INTEGER, INTENT(in) :: polynomial_type ! 1: cubic spline 943 943 ! 2: Linear 944 944 945 ! Local Variables 945 ! Local Variables 946 946 INTEGER :: ji, jj, jk ! dummy loop indices 947 947 INTEGER :: jpi, jpj, jpkm1 … … 955 955 jpkm1 = size(fsp,3) - 1 956 956 957 957 958 958 IF (polynomial_type == 1) THEN ! Constrained Cubic Spline 959 959 DO ji = 1, jpi 960 960 DO jj = 1, jpj 961 !!Fritsch&Butland's method, 1984 (preferred, but more computation) 961 !!Fritsch&Butland's method, 1984 (preferred, but more computation) 962 962 ! DO jk = 2, jpkm1-1 963 ! zdxtmp1 = xsp(ji,jj,jk) - xsp(ji,jj,jk-1) 964 ! zdxtmp2 = xsp(ji,jj,jk+1) - xsp(ji,jj,jk) 963 ! zdxtmp1 = xsp(ji,jj,jk) - xsp(ji,jj,jk-1) 964 ! zdxtmp2 = xsp(ji,jj,jk+1) - xsp(ji,jj,jk) 965 965 ! zdf1 = ( fsp(ji,jj,jk) - fsp(ji,jj,jk-1) ) / zdxtmp1 966 966 ! zdf2 = ( fsp(ji,jj,jk+1) - fsp(ji,jj,jk) ) / zdxtmp2 967 967 ! 968 968 ! zalpha = ( zdxtmp1 + 2._wp * zdxtmp2 ) / ( zdxtmp1 + zdxtmp2 ) / 3._wp 969 ! 969 ! 970 970 ! IF(zdf1 * zdf2 <= 0._wp) THEN 971 971 ! zdf(jk) = 0._wp … … 974 974 ! ENDIF 975 975 ! END DO 976 976 977 977 !!Simply geometric average 978 978 DO jk = 2, jpkm1-1 979 979 zdf1 = (fsp(ji,jj,jk) - fsp(ji,jj,jk-1)) / (xsp(ji,jj,jk) - xsp(ji,jj,jk-1)) 980 980 zdf2 = (fsp(ji,jj,jk+1) - fsp(ji,jj,jk)) / (xsp(ji,jj,jk+1) - xsp(ji,jj,jk)) 981 981 982 982 IF(zdf1 * zdf2 <= 0._wp) THEN 983 983 zdf(jk) = 0._wp … … 986 986 ENDIF 987 987 END DO 988 988 989 989 zdf(1) = 1.5_wp * ( fsp(ji,jj,2) - fsp(ji,jj,1) ) / & 990 990 & ( xsp(ji,jj,2) - xsp(ji,jj,1) ) - 0.5_wp * zdf(2) … … 992 992 & ( xsp(ji,jj,jpkm1) - xsp(ji,jj,jpkm1-1) ) - & 993 993 & 0.5_wp * zdf(jpkm1 - 1) 994 994 995 995 DO jk = 1, jpkm1 - 1 996 zdxtmp = xsp(ji,jj,jk+1) - xsp(ji,jj,jk) 996 zdxtmp = xsp(ji,jj,jk+1) - xsp(ji,jj,jk) 997 997 ztmp1 = (zdf(jk+1) + 2._wp * zdf(jk)) / zdxtmp 998 998 ztmp2 = 6._wp * (fsp(ji,jj,jk+1) - fsp(ji,jj,jk)) / zdxtmp / zdxtmp 999 zddf1 = -2._wp * ztmp1 + ztmp2 999 zddf1 = -2._wp * ztmp1 + ztmp2 1000 1000 ztmp1 = (2._wp * zdf(jk+1) + zdf(jk)) / zdxtmp 1001 zddf2 = 2._wp * ztmp1 - ztmp2 1002 1001 zddf2 = 2._wp * ztmp1 - ztmp2 1002 1003 1003 dsp(ji,jj,jk) = (zddf2 - zddf1) / 6._wp / zdxtmp 1004 1004 csp(ji,jj,jk) = ( xsp(ji,jj,jk+1) * zddf1 - xsp(ji,jj,jk)*zddf2 ) / 2._wp / zdxtmp 1005 bsp(ji,jj,jk) = ( fsp(ji,jj,jk+1) - fsp(ji,jj,jk) ) / zdxtmp - & 1005 bsp(ji,jj,jk) = ( fsp(ji,jj,jk+1) - fsp(ji,jj,jk) ) / zdxtmp - & 1006 1006 & csp(ji,jj,jk) * ( xsp(ji,jj,jk+1) + xsp(ji,jj,jk) ) - & 1007 1007 & dsp(ji,jj,jk) * ((xsp(ji,jj,jk+1) + xsp(ji,jj,jk))**2 - & … … 1013 1013 END DO 1014 1014 END DO 1015 1015 1016 1016 ELSE IF (polynomial_type == 2) THEN ! Linear 1017 1017 DO ji = 1, jpi 1018 1018 DO jj = 1, jpj 1019 1019 DO jk = 1, jpkm1-1 1020 zdxtmp =xsp(ji,jj,jk+1) - xsp(ji,jj,jk) 1020 zdxtmp =xsp(ji,jj,jk+1) - xsp(ji,jj,jk) 1021 1021 ztmp1 = fsp(ji,jj,jk+1) - fsp(ji,jj,jk) 1022 1022 1023 1023 dsp(ji,jj,jk) = 0._wp 1024 1024 csp(ji,jj,jk) = 0._wp … … 1033 1033 ENDIF 1034 1034 1035 1035 1036 1036 END SUBROUTINE cspline 1037 1037 1038 1038 1039 FUNCTION interp1(x, xl, xr, fl, fr) RESULT(f) 1039 FUNCTION interp1(x, xl, xr, fl, fr) RESULT(f) 1040 1040 !!---------------------------------------------------------------------- 1041 1041 !! *** ROUTINE interp1 *** 1042 !! 1042 !! 1043 1043 !! ** Purpose : 1-d linear interpolation 1044 !! 1045 !! ** Method : 1044 !! 1045 !! ** Method : 1046 1046 !! interpolation is straight forward 1047 !! extrapolation is also permitted (no value limit) 1047 !! extrapolation is also permitted (no value limit) 1048 1048 !! 1049 1049 !!---------------------------------------------------------------------- 1050 1050 IMPLICIT NONE 1051 REAL(wp), INTENT(in) :: x, xl, xr, fl, fr 1051 REAL(wp), INTENT(in) :: x, xl, xr, fl, fr 1052 1052 REAL(wp) :: f ! result of the interpolation (extrapolation) 1053 1053 REAL(wp) :: zdeltx … … 1060 1060 f = ( (x - xl ) * fr - ( x - xr ) * fl ) / zdeltx 1061 1061 ENDIF 1062 1062 1063 1063 END FUNCTION interp1 1064 1064 1065 FUNCTION interp2(x, a, b, c, d) RESULT(f) 1065 FUNCTION interp2(x, a, b, c, d) RESULT(f) 1066 1066 !!---------------------------------------------------------------------- 1067 1067 !! *** ROUTINE interp1 *** 1068 !! 1068 !! 1069 1069 !! ** Purpose : 1-d constrained cubic spline interpolation 1070 !! 1070 !! 1071 1071 !! ** Method : cubic spline interpolation 1072 1072 !! 1073 1073 !!---------------------------------------------------------------------- 1074 1074 IMPLICIT NONE 1075 REAL(wp), INTENT(in) :: x, a, b, c, d 1075 REAL(wp), INTENT(in) :: x, a, b, c, d 1076 1076 REAL(wp) :: f ! value from the interpolation 1077 1077 !!---------------------------------------------------------------------- 1078 1078 1079 f = a + x* ( b + x * ( c + d * x ) ) 1079 f = a + x* ( b + x * ( c + d * x ) ) 1080 1080 1081 1081 END FUNCTION interp2 1082 1082 1083 1083 1084 FUNCTION interp3(x, a, b, c, d) RESULT(f) 1084 FUNCTION interp3(x, a, b, c, d) RESULT(f) 1085 1085 !!---------------------------------------------------------------------- 1086 1086 !! *** ROUTINE interp1 *** 1087 !! 1087 !! 1088 1088 !! ** Purpose : Calculate the first order of deriavtive of 1089 1089 !! a cubic spline function y=a+b*x+c*x^2+d*x^3 1090 !! 1090 !! 1091 1091 !! ** Method : f=dy/dx=b+2*c*x+3*d*x^2 1092 1092 !! 1093 1093 !!---------------------------------------------------------------------- 1094 1094 IMPLICIT NONE 1095 REAL(wp), INTENT(in) :: x, a, b, c, d 1095 REAL(wp), INTENT(in) :: x, a, b, c, d 1096 1096 REAL(wp) :: f ! value from the interpolation 1097 1097 !!---------------------------------------------------------------------- … … 1101 1101 END FUNCTION interp3 1102 1102 1103 1104 FUNCTION integ_spline(xl, xr, a, b, c, d) RESULT(f) 1103 1104 FUNCTION integ_spline(xl, xr, a, b, c, d) RESULT(f) 1105 1105 !!---------------------------------------------------------------------- 1106 1106 !! *** ROUTINE interp1 *** 1107 !! 1107 !! 1108 1108 !! ** Purpose : 1-d constrained cubic spline integration 1109 !! 1110 !! ** Method : integrate polynomial a+bx+cx^2+dx^3 from xl to xr 1109 !! 1110 !! ** Method : integrate polynomial a+bx+cx^2+dx^3 from xl to xr 1111 1111 !! 1112 1112 !!---------------------------------------------------------------------- 1113 1113 IMPLICIT NONE 1114 REAL(wp), INTENT(in) :: xl, xr, a, b, c, d 1115 REAL(wp) :: za1, za2, za3 1114 REAL(wp), INTENT(in) :: xl, xr, a, b, c, d 1115 REAL(wp) :: za1, za2, za3 1116 1116 REAL(wp) :: f ! integration result 1117 1117 !!---------------------------------------------------------------------- 1118 1118 1119 za1 = 0.5_wp * b 1120 za2 = c / 3.0_wp 1121 za3 = 0.25_wp * d 1119 za1 = 0.5_wp * b 1120 za2 = c / 3.0_wp 1121 za3 = 0.25_wp * d 1122 1122 1123 1123 f = xr * ( a + xr * ( za1 + xr * ( za2 + za3 * xr ) ) ) - & -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/OPA_SRC/DYN/dynnxt.F90
r3294 r3764 156 156 # if defined key_obc 157 157 ! !* OBC open boundaries 158 CALL obc_dyn( kt )158 IF( lk_obc ) CALL obc_dyn( kt ) 159 159 ! 160 160 IF( .NOT. lk_dynspg_flt ) THEN … … 163 163 ! sshn_b (= after ssha_b) for time-splitting case (lk_dynspg_ts=T) 164 164 ! - Correct the barotropic velocities 165 CALL obc_dyn_bt( kt )165 IF( lk_obc ) CALL obc_dyn_bt( kt ) 166 166 ! 167 167 !!gm ERROR - potential BUG: sshn should not be modified at this stage !! ssh_nxt not alrady called 168 168 CALL lbc_lnk( sshn, 'T', 1. ) ! Boundary conditions on sshn 169 169 ! 170 IF( l n_vol_cst ) CALL obc_vol( kt )170 IF( lk_obc .AND. ln_vol_cst ) CALL obc_vol( kt ) 171 171 ! 172 172 IF(ln_ctl) CALL prt_ctl( tab2d_1=sshn, clinfo1=' ssh : ', mask1=tmask ) … … 175 175 # elif defined key_bdy 176 176 ! !* BDY open boundaries 177 IF( lk_ dynspg_exp ) CALL bdy_dyn( kt )178 IF( lk_ dynspg_ts )CALL bdy_dyn( kt, dyn3d_only=.true. )177 IF( lk_bdy .AND. lk_dynspg_exp ) CALL bdy_dyn( kt ) 178 IF( lk_bdy .AND. lk_dynspg_ts ) CALL bdy_dyn( kt, dyn3d_only=.true. ) 179 179 180 180 !!$ Do we need a call to bdy_vol here?? … … 248 248 DO jk = 1, jpkm1 ! Leap-Frog - Asselin filter and swap: 249 249 DO jj = 1, jpj ! applied on thickness weighted velocity 250 DO ji = 1, jpi m1! ---------------------------250 DO ji = 1, jpi ! --------------------------- 251 251 zue3a = ua(ji,jj,jk) * fse3u_a(ji,jj,jk) 252 252 zve3a = va(ji,jj,jk) * fse3v_a(ji,jj,jk) … … 268 268 fse3u_b(:,:,1:jpkm1) = ze3u_f(:,:,1:jpkm1) ! e3u_b <-- filtered scale factor 269 269 fse3v_b(:,:,1:jpkm1) = ze3v_f(:,:,1:jpkm1) 270 CALL lbc_lnk( ub, 'U', -1. ) ! lateral boundary conditions271 CALL lbc_lnk( vb, 'V', -1. )272 270 ENDIF 273 271 ! -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/OPA_SRC/DYN/dynspg_flt.F90
r3680 r3764 187 187 188 188 #if defined key_obc 189 CALL obc_dyn( kt )! Update velocities on each open boundary with the radiation algorithm190 CALL obc_vol( kt )! Correction of the barotropic componant velocity to control the volume of the system189 IF( lk_obc ) CALL obc_dyn( kt ) ! Update velocities on each open boundary with the radiation algorithm 190 IF( lk_obc ) CALL obc_vol( kt ) ! Correction of the barotropic componant velocity to control the volume of the system 191 191 #endif 192 192 #if defined key_bdy 193 CALL bdy_dyn( kt )! Update velocities on each open boundary194 CALL bdy_vol( kt )! Correction of the barotropic component velocity to control the volume of the system193 IF( lk_bdy ) CALL bdy_dyn( kt ) ! Update velocities on each open boundary 194 IF( lk_bdy ) CALL bdy_vol( kt ) ! Correction of the barotropic component velocity to control the volume of the system 195 195 #endif 196 196 #if defined key_agrif -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/OPA_SRC/DYN/sshwzv.F90
r3680 r3764 181 181 #if defined key_bdy 182 182 ssha(:,:) = ssha(:,:) * bdytmask(:,:) 183 CALL lbc_lnk( ssha, 'T', 1. ) ! absolutly compulsory !! (jmm) 184 #endif 185 183 CALL lbc_lnk( ssha, 'T', 1. ) ! absolutly compulsory !! (jmm) 184 #endif 185 #if defined key_asminc 186 ! ! Include the IAU weighted SSH increment 187 IF( lk_asminc .AND. ln_sshinc .AND. ln_asmiau ) THEN 188 CALL ssh_asm_inc( kt ) 189 ssha(:,:) = ssha(:,:) + z2dt * ssh_iau(:,:) 190 ENDIF 191 #endif 186 192 ! ! Sea Surface Height at u-,v- and f-points (vvl case only) 187 193 IF( lk_vvl ) THEN ! (required only in key_vvl case) … … 198 204 CALL lbc_lnk( sshu_a, 'U', 1. ) ; CALL lbc_lnk( sshv_a, 'V', 1. ) ! Boundaries conditions 199 205 ENDIF 200 201 #if defined key_asminc202 ! ! Include the IAU weighted SSH increment203 IF( lk_asminc .AND. ln_sshinc .AND. ln_asmiau ) THEN204 CALL ssh_asm_inc( kt )205 ssha(:,:) = ssha(:,:) + z2dt * ssh_iau(:,:)206 ENDIF207 #endif208 206 209 207 ! !------------------------------! -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/OPA_SRC/IOM/iom.F90
r3737 r3764 4 4 !! Input/Output manager : Library to read input files 5 5 !!==================================================================== 6 !! History : 9.0 ! 05 12 (J. Belier) Original code 7 !! 9.0 ! 06 02 (S. Masson) Adaptation to NEMO 8 !! " ! 07 07 (D. Storkey) Changes to iom_gettime 6 !! History : 2.0 ! 2005-12 (J. Belier) Original code 7 !! 2.0 ! 2006-02 (S. Masson) Adaptation to NEMO 8 !! 3.0 ! 2007-07 (D. Storkey) Changes to iom_gettime 9 !! 3.4 ! 2012-12 (R. Bourdalle-Badie and G. Reffray) add C1D case 9 10 !!-------------------------------------------------------------------- 10 !!gm caution add !DIR nec: improved performance to be checked as well as no result changes11 11 12 12 !!-------------------------------------------------------------------- … … 19 19 !!-------------------------------------------------------------------- 20 20 USE dom_oce ! ocean space and time domain 21 USE c1d ! 1D vertical configuration 21 22 USE flo_oce ! floats module declarations 22 23 USE lbclnk ! lateal boundary condition / mpp exchanges … … 761 762 ENDIF 762 763 764 ! C1D case : always call lbc_lnk to replicate the central value over the whole 3X3 domain 765 IF( lk_c1d .AND. PRESENT(pv_r2d) ) CALL lbc_lnk( pv_r2d,'Z',1. ) 766 IF( lk_c1d .AND. PRESENT(pv_r3d) ) CALL lbc_lnk( pv_r3d,'Z',1. ) 767 763 768 !--- Apply scale_factor and offset 764 769 zscf = iom_file(kiomid)%scf(idvar) ! scale factor -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/OPA_SRC/LBC/lbclnk.F90
r3680 r3764 10 10 !! and lbc_obc_lnk' routine to optimize 11 11 !! the BDY/OBC communications 12 !!---------------------------------------------------------------------- 13 #if defined key_mpp_mpi 12 !! 3.4 ! 2012-12 (R. Bourdalle-Badie and G. Reffray) add a C1D case 13 !!---------------------------------------------------------------------- 14 #if defined key_mpp_mpi 14 15 !!---------------------------------------------------------------------- 15 16 !! 'key_mpp_mpi' MPI massively parallel processing library … … 93 94 CONTAINS 94 95 96 # if defined key_c1d 97 !!---------------------------------------------------------------------- 98 !! 'key_c1d' 1D configuration 99 !!---------------------------------------------------------------------- 100 101 SUBROUTINE lbc_lnk_3d_gather( pt3d1, cd_type1, pt3d2, cd_type2, psgn ) 102 !!--------------------------------------------------------------------- 103 !! *** ROUTINE lbc_lnk_3d_gather *** 104 !! 105 !! ** Purpose : set lateral boundary conditions on two 3D arrays (C1D case) 106 !! 107 !! ** Method : call lbc_lnk_3d on pt3d1 and pt3d2 108 !!---------------------------------------------------------------------- 109 CHARACTER(len=1) , INTENT(in ) :: cd_type1, cd_type2 ! nature of pt3d grid-points 110 REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(inout) :: pt3d1 , pt3d2 ! 3D array on which the lbc is applied 111 REAL(wp) , INTENT(in ) :: psgn ! control of the sign 112 !!---------------------------------------------------------------------- 113 ! 114 CALL lbc_lnk_3d( pt3d1, cd_type1, psgn) 115 CALL lbc_lnk_3d( pt3d2, cd_type2, psgn) 116 ! 117 END SUBROUTINE lbc_lnk_3d_gather 118 119 120 SUBROUTINE lbc_lnk_3d( pt3d, cd_type, psgn, cd_mpp, pval ) 121 !!--------------------------------------------------------------------- 122 !! *** ROUTINE lbc_lnk_3d *** 123 !! 124 !! ** Purpose : set lateral boundary conditions on a 3D array (C1D case) 125 !! 126 !! ** Method : 1D case, the central water column is set everywhere 127 !!---------------------------------------------------------------------- 128 CHARACTER(len=1) , INTENT(in ) :: cd_type ! nature of pt3d grid-points 129 REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(inout) :: pt3d ! 3D array on which the lbc is applied 130 REAL(wp) , INTENT(in ) :: psgn ! control of the sign 131 CHARACTER(len=3) , INTENT(in ), OPTIONAL :: cd_mpp ! MPP only (here do nothing) 132 REAL(wp) , INTENT(in ), OPTIONAL :: pval ! background value (for closed boundaries) 133 ! 134 INTEGER :: jk ! dummy loop index 135 REAL(wp) :: ztab ! local scalar 136 !!---------------------------------------------------------------------- 137 ! 138 DO jk = 1, jpk 139 ztab = pt3d(2,2,jk) 140 pt3d(:,:,jk) = ztab 141 END DO 142 ! 143 END SUBROUTINE lbc_lnk_3d 144 145 146 SUBROUTINE lbc_lnk_2d( pt2d, cd_type, psgn, cd_mpp, pval ) 147 !!--------------------------------------------------------------------- 148 !! *** ROUTINE lbc_lnk_2d *** 149 !! 150 !! ** Purpose : set lateral boundary conditions on a 2D array (non mpp case) 151 !! 152 !! ** Method : 1D case, the central water column is set everywhere 153 !!---------------------------------------------------------------------- 154 CHARACTER(len=1) , INTENT(in ) :: cd_type ! nature of pt3d grid-points 155 REAL(wp), DIMENSION(jpi,jpj), INTENT(inout) :: pt2d ! 2D array on which the lbc is applied 156 REAL(wp) , INTENT(in ) :: psgn ! control of the sign 157 CHARACTER(len=3) , INTENT(in ), OPTIONAL :: cd_mpp ! MPP only (here do nothing) 158 REAL(wp) , INTENT(in ), OPTIONAL :: pval ! background value (for closed boundaries) 159 ! 160 REAL(wp) :: ztab ! local scalar 161 !!---------------------------------------------------------------------- 162 ! 163 ztab = pt2d(2,2) 164 pt2d(:,:) = ztab 165 ! 166 END SUBROUTINE lbc_lnk_2d 167 168 #else 169 !!---------------------------------------------------------------------- 170 !! Default option 3D shared memory computing 171 !!---------------------------------------------------------------------- 172 95 173 SUBROUTINE lbc_lnk_3d_gather( pt3d1, cd_type1, pt3d2, cd_type2, psgn ) 96 174 !!--------------------------------------------------------------------- … … 138 216 139 217 IF( PRESENT( pval ) ) THEN ; zland = pval ! set land value (zero by default) 140 ELSE ; zland = 0. e0218 ELSE ; zland = 0._wp 141 219 ENDIF 142 220 … … 261 339 262 340 IF( PRESENT( pval ) ) THEN ; zland = pval ! set land value (zero by default) 263 ELSE ; zland = 0. e0341 ELSE ; zland = 0._wp 264 342 ENDIF 265 343 -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/OPA_SRC/LBC/lib_mpp.F90
r3680 r3764 17 17 !! - ! 2008 (R. Benshila) add mpp_ini_ice 18 18 !! 3.2 ! 2009 (R. Benshila) SHMEM suppression, north fold in lbc_nfd 19 !! 3.2 ! 2009 (O. Marti) add mpp_ini_znl 19 !! 3.2 ! 2009 (O. Marti) add mpp_ini_znl 20 20 !! 4.0 ! 2011 (G. Madec) move ctl_ routines from in_out_manager 21 21 !! 3.5 ! 2012 (S.Mocavero, I. Epicoco) Add 'mpp_lnk_bdy_3d', 'mpp_lnk_obc_3d', … … 30 30 !! get_unit : give the index of an unused logical unit 31 31 !!---------------------------------------------------------------------- 32 #if defined key_mpp_mpi 32 #if defined key_mpp_mpi 33 33 !!---------------------------------------------------------------------- 34 34 !! 'key_mpp_mpi' MPI massively parallel processing library … … 55 55 !! mpp_lbc_north_e : variant of mpp_lbc_north for extra outer halo 56 56 !!---------------------------------------------------------------------- 57 USE dom_oce ! ocean space and time domain 57 USE dom_oce ! ocean space and time domain 58 58 USE lbcnfd ! north fold treatment 59 59 USE in_out_manager ! I/O manager … … 61 61 IMPLICIT NONE 62 62 PRIVATE 63 63 64 64 PUBLIC ctl_stop, ctl_warn, get_unit, ctl_opn 65 65 PUBLIC mynode, mppstop, mppsync, mpp_comm_free … … 70 70 PUBLIC mppobc, mpp_ini_ice, mpp_ini_znl 71 71 PUBLIC mppsize 72 PUBLIC mppsend, mpprecv ! needed by ICB routines72 PUBLIC mppsend, mpprecv ! needed by TAM and ICB routines 73 73 PUBLIC lib_mpp_alloc ! Called in nemogcm.F90 74 74 PUBLIC mpp_lnk_bdy_2d, mpp_lnk_bdy_3d … … 90 90 END INTERFACE 91 91 INTERFACE mpp_lbc_north 92 MODULE PROCEDURE mpp_lbc_north_3d, mpp_lbc_north_2d 92 MODULE PROCEDURE mpp_lbc_north_3d, mpp_lbc_north_2d 93 93 END INTERFACE 94 94 INTERFACE mpp_minloc … … 98 98 MODULE PROCEDURE mpp_maxloc2d ,mpp_maxloc3d 99 99 END INTERFACE 100 100 101 101 !! ========================= !! 102 102 !! MPI variable definition !! … … 105 105 INCLUDE 'mpif.h' 106 106 !$AGRIF_END_DO_NOT_TREAT 107 107 108 108 LOGICAL, PUBLIC, PARAMETER :: lk_mpp = .TRUE. !: mpp flag 109 109 110 110 INTEGER, PARAMETER :: nprocmax = 2**10 ! maximun dimension (required to be a power of 2) 111 111 112 112 INTEGER :: mppsize ! number of process 113 113 INTEGER :: mpprank ! process number [ 0 - size-1 ] … … 132 132 INTEGER :: ndim_rank_znl ! number of processors on the same zonal average 133 133 INTEGER, DIMENSION(:), ALLOCATABLE, SAVE :: nrank_znl ! dimension ndim_rank_znl, number of the procs into the same znl domain 134 135 ! North fold condition in mpp_mpi with jpni > 1 136 INTEGER :: ngrp_world ! group ID for the world processors137 INTEGER :: ngrp_opa ! group ID for the opa processors138 INTEGER :: ngrp_north ! group ID for the northern processors (to be fold)139 INTEGER :: ncomm_north ! communicator made by the processors belonging to ngrp_north140 INTEGER :: ndim_rank_north ! number of 'sea' processor in the northern line (can be /= jpni !)141 INTEGER :: njmppmax ! value of njmpp for the processors of the northern line142 INTEGER :: north_root ! number (in the comm_opa) of proc 0 in the northern comm143 INTEGER, DIMENSION(:), ALLOCATABLE, SAVE :: nrank_north ! dimension ndim_rank_north134 135 ! North fold condition in mpp_mpi with jpni > 1 (PUBLIC for TAM) 136 INTEGER, PUBLIC :: ngrp_world ! group ID for the world processors 137 INTEGER, PUBLIC :: ngrp_opa ! group ID for the opa processors 138 INTEGER, PUBLIC :: ngrp_north ! group ID for the northern processors (to be fold) 139 INTEGER, PUBLIC :: ncomm_north ! communicator made by the processors belonging to ngrp_north 140 INTEGER, PUBLIC :: ndim_rank_north ! number of 'sea' processor in the northern line (can be /= jpni !) 141 INTEGER, PUBLIC :: njmppmax ! value of njmpp for the processors of the northern line 142 INTEGER, PUBLIC :: north_root ! number (in the comm_opa) of proc 0 in the northern comm 143 INTEGER, DIMENSION(:), ALLOCATABLE, SAVE, PUBLIC :: nrank_north ! dimension ndim_rank_north 144 144 145 145 ! Type of send : standard, buffered, immediate 146 CHARACTER(len=1) 147 LOGICAL , PUBLIC:: l_isend = .FALSE. ! isend use indicator (T if cn_mpi_send='I')148 INTEGER :: nn_buffer = 0 ! size of the buffer in case of mpi_bsend149 146 CHARACTER(len=1), PUBLIC :: cn_mpi_send = 'S' ! type od mpi send/recieve (S=standard, B=bsend, I=isend) 147 LOGICAL, PUBLIC :: l_isend = .FALSE. ! isend use indicator (T if cn_mpi_send='I') 148 INTEGER, PUBLIC :: nn_buffer = 0 ! size of the buffer in case of mpi_bsend 149 150 150 REAL(wp), DIMENSION(:), ALLOCATABLE, SAVE :: tampon ! buffer in case of bsend 151 151 … … 177 177 ! North fold arrays used to minimise the use of allgather operations. Set in nemo_northcomms (nemogcm) so need to be public 178 178 INTEGER, PUBLIC, PARAMETER :: jpmaxngh = 8 ! Assumed maximum number of active neighbours 179 INTEGER, PUBLIC, PARAMETER :: jptyps = 5 ! Number of different neighbour lists to be used for northfold exchanges 179 INTEGER, PUBLIC, PARAMETER :: jptyps = 5 ! Number of different neighbour lists to be used for northfold exchanges 180 180 INTEGER, PUBLIC, DIMENSION (jpmaxngh,jptyps) :: isendto 181 181 INTEGER, PUBLIC, DIMENSION (jptyps) :: nsndto … … 228 228 !!---------------------------------------------------------------------- 229 229 !! *** routine mynode *** 230 !! 230 !! 231 231 !! ** Purpose : Find processor unit 232 232 !!---------------------------------------------------------------------- 233 CHARACTER(len=*),DIMENSION(:), INTENT( out) :: ldtxt 234 INTEGER , INTENT(in ) :: kumnam ! namelist logical unit 235 INTEGER , INTENT(inout) :: kstop ! stop indicator 233 CHARACTER(len=*),DIMENSION(:), INTENT( out) :: ldtxt 234 INTEGER , INTENT(in ) :: kumnam ! namelist logical unit 235 INTEGER , INTENT(inout) :: kstop ! stop indicator 236 236 INTEGER, OPTIONAL , INTENT(in ) :: localComm 237 237 ! … … 257 257 #if defined key_agrif 258 258 IF( .NOT. Agrif_Root() ) THEN 259 jpni = Agrif_Parent(jpni ) 259 jpni = Agrif_Parent(jpni ) 260 260 jpnj = Agrif_Parent(jpnj ) 261 261 jpnij = Agrif_Parent(jpnij) … … 281 281 CALL mpi_initialized ( mpi_was_called, code ) 282 282 IF( code /= MPI_SUCCESS ) THEN 283 DO ji = 1, SIZE(ldtxt) 283 DO ji = 1, SIZE(ldtxt) 284 284 IF( TRIM(ldtxt(ji)) /= '' ) WRITE(*,*) ldtxt(ji) ! control print of mynode 285 END DO 285 END DO 286 286 WRITE(*, cform_err) 287 287 WRITE(*, *) 'lib_mpp: Error in routine mpi_initialized' … … 296 296 CASE ( 'B' ) ! Buffer mpi send (blocking) 297 297 WRITE(ldtxt(ii),*) ' Buffer blocking mpi send (bsend)' ; ii = ii + 1 298 IF( Agrif_Root() ) CALL mpi_init_opa( ldtxt, ii, ierr ) 298 IF( Agrif_Root() ) CALL mpi_init_opa( ldtxt, ii, ierr ) 299 299 CASE ( 'I' ) ! Immediate mpi send (non-blocking send) 300 300 WRITE(ldtxt(ii),*) ' Immediate non-blocking send (isend)' ; ii = ii + 1 … … 329 329 ENDIF 330 330 331 IF( PRESENT(localComm) ) THEN 331 IF( PRESENT(localComm) ) THEN 332 332 IF( Agrif_Root() ) THEN 333 333 mpi_comm_opa = localComm … … 336 336 CALL mpi_comm_dup( mpi_comm_world, mpi_comm_opa, code) 337 337 IF( code /= MPI_SUCCESS ) THEN 338 DO ji = 1, SIZE(ldtxt) 338 DO ji = 1, SIZE(ldtxt) 339 339 IF( TRIM(ldtxt(ji)) /= '' ) WRITE(*,*) ldtxt(ji) ! control print of mynode 340 340 END DO … … 343 343 CALL mpi_abort( mpi_comm_world, code, ierr ) 344 344 ENDIF 345 ENDIF 345 ENDIF 346 346 347 347 CALL mpi_comm_rank( mpi_comm_opa, mpprank, ierr ) 348 348 CALL mpi_comm_size( mpi_comm_opa, mppsize, ierr ) 349 349 mynode = mpprank 350 ! 350 ! 351 351 CALL MPI_OP_CREATE(DDPDD_MPI, .TRUE., MPI_SUMDD, ierr) 352 352 ! … … 721 721 !! ** Purpose : Message passing manadgement 722 722 !! 723 !! ** Method : Use mppsend and mpprecv function for passing mask 723 !! ** Method : Use mppsend and mpprecv function for passing mask 724 724 !! between processors following neighboring subdomains. 725 725 !! domain parameters … … 728 728 !! nbondi : mark for "east-west local boundary" 729 729 !! nbondj : mark for "north-south local boundary" 730 !! noea : number for local neighboring processors 730 !! noea : number for local neighboring processors 731 731 !! nowe : number for local neighboring processors 732 732 !! noso : number for local neighboring processors … … 741 741 REAL(wp) , INTENT(in ) :: psgn ! =-1 the sign change across the north fold boundary 742 742 ! ! = 1. , the sign is kept 743 CHARACTER(len=3), OPTIONAL , INTENT(in ) :: cd_mpp ! fill the overlap area only 743 CHARACTER(len=3), OPTIONAL , INTENT(in ) :: cd_mpp ! fill the overlap area only 744 744 REAL(wp) , OPTIONAL , INTENT(in ) :: pval ! background value (used at closed boundaries) 745 745 !! … … 762 762 DO jk = 1, jpk 763 763 DO jj = nlcj+1, jpj ! added line(s) (inner only) 764 ptab(nldi :nlei , jj ,jk) = ptab(nldi:nlei, nlej,jk) 764 ptab(nldi :nlei , jj ,jk) = ptab(nldi:nlei, nlej,jk) 765 765 ptab(1 :nldi-1, jj ,jk) = ptab(nldi , nlej,jk) 766 766 ptab(nlei+1:nlci , jj ,jk) = ptab( nlei, nlej,jk) … … 773 773 END DO 774 774 ! 775 ELSE ! standard close or cyclic treatment 775 ELSE ! standard close or cyclic treatment 776 776 ! 777 777 ! ! East-West boundaries … … 792 792 ! 2. East and west directions exchange 793 793 ! ------------------------------------ 794 ! we play with the neigbours AND the row number because of the periodicity 794 ! we play with the neigbours AND the row number because of the periodicity 795 795 ! 796 796 SELECT CASE ( nbondi ) ! Read Dirichlet lateral conditions … … 801 801 t3we(:,jl,:,1) = ptab(iihom +jl,:,:) 802 802 END DO 803 END SELECT 803 END SELECT 804 804 ! 805 805 ! ! Migrations 806 806 imigr = jpreci * jpj * jpk 807 807 ! 808 SELECT CASE ( nbondi ) 808 SELECT CASE ( nbondi ) 809 809 CASE ( -1 ) 810 810 CALL mppsend( 2, t3we(1,1,1,1), imigr, noea, ml_req1 ) … … 832 832 ptab(iihom+jl,:,:) = t3ew(:,jl,:,2) 833 833 END DO 834 CASE ( 0 ) 834 CASE ( 0 ) 835 835 DO jl = 1, jpreci 836 836 ptab(jl ,:,:) = t3we(:,jl,:,2) … … 859 859 imigr = jprecj * jpi * jpk 860 860 ! 861 SELECT CASE ( nbondj ) 861 SELECT CASE ( nbondj ) 862 862 CASE ( -1 ) 863 863 CALL mppsend( 4, t3sn(1,1,1,1), imigr, nono, ml_req1 ) … … 871 871 IF(l_isend) CALL mpi_wait(ml_req1, ml_stat, ml_err) 872 872 IF(l_isend) CALL mpi_wait(ml_req2, ml_stat, ml_err) 873 CASE ( 1 ) 873 CASE ( 1 ) 874 874 CALL mppsend( 3, t3ns(1,1,1,1), imigr, noso, ml_req1 ) 875 875 CALL mpprecv( 4, t3sn(1,1,1,2), imigr, noso ) … … 885 885 ptab(:,ijhom+jl,:) = t3ns(:,jl,:,2) 886 886 END DO 887 CASE ( 0 ) 887 CASE ( 0 ) 888 888 DO jl = 1, jprecj 889 889 ptab(:,jl ,:) = t3sn(:,jl,:,2) … … 915 915 !!---------------------------------------------------------------------- 916 916 !! *** routine mpp_lnk_2d *** 917 !! 917 !! 918 918 !! ** Purpose : Message passing manadgement for 2d array 919 919 !! 920 !! ** Method : Use mppsend and mpprecv function for passing mask 920 !! ** Method : Use mppsend and mpprecv function for passing mask 921 921 !! between processors following neighboring subdomains. 922 922 !! domain parameters … … 925 925 !! nbondi : mark for "east-west local boundary" 926 926 !! nbondj : mark for "north-south local boundary" 927 !! noea : number for local neighboring processors 927 !! noea : number for local neighboring processors 928 928 !! nowe : number for local neighboring processors 929 929 !! noso : number for local neighboring processors … … 936 936 REAL(wp) , INTENT(in ) :: psgn ! =-1 the sign change across the north fold boundary 937 937 ! ! = 1. , the sign is kept 938 CHARACTER(len=3), OPTIONAL , INTENT(in ) :: cd_mpp ! fill the overlap area only 938 CHARACTER(len=3), OPTIONAL , INTENT(in ) :: cd_mpp ! fill the overlap area only 939 939 REAL(wp) , OPTIONAL , INTENT(in ) :: pval ! background value (used at closed boundaries) 940 940 !! … … 957 957 ! WARNING pt2d is defined only between nld and nle 958 958 DO jj = nlcj+1, jpj ! added line(s) (inner only) 959 pt2d(nldi :nlei , jj ) = pt2d(nldi:nlei, nlej) 959 pt2d(nldi :nlei , jj ) = pt2d(nldi:nlei, nlej) 960 960 pt2d(1 :nldi-1, jj ) = pt2d(nldi , nlej) 961 961 pt2d(nlei+1:nlci , jj ) = pt2d( nlei, nlej) … … 967 967 END DO 968 968 ! 969 ELSE ! standard close or cyclic treatment 969 ELSE ! standard close or cyclic treatment 970 970 ! 971 971 ! ! East-West boundaries … … 986 986 ! 2. East and west directions exchange 987 987 ! ------------------------------------ 988 ! we play with the neigbours AND the row number because of the periodicity 988 ! we play with the neigbours AND the row number because of the periodicity 989 989 ! 990 990 SELECT CASE ( nbondi ) ! Read Dirichlet lateral conditions … … 1084 1084 pt2d(:,ijhom+jl) = t2ns(:,jl,2) 1085 1085 END DO 1086 CASE ( 1 ) 1086 CASE ( 1 ) 1087 1087 DO jl = 1, jprecj 1088 1088 pt2d(:,jl ) = t2sn(:,jl,2) … … 1112 1112 !! ** Purpose : Message passing manadgement for two 3D arrays 1113 1113 !! 1114 !! ** Method : Use mppsend and mpprecv function for passing mask 1114 !! ** Method : Use mppsend and mpprecv function for passing mask 1115 1115 !! between processors following neighboring subdomains. 1116 1116 !! domain parameters … … 1119 1119 !! nbondi : mark for "east-west local boundary" 1120 1120 !! nbondj : mark for "north-south local boundary" 1121 !! noea : number for local neighboring processors 1121 !! noea : number for local neighboring processors 1122 1122 !! nowe : number for local neighboring processors 1123 1123 !! noso : number for local neighboring processors … … 1127 1127 !! 1128 1128 !!---------------------------------------------------------------------- 1129 REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(inout) :: ptab1 ! first and second 3D array on which 1129 REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(inout) :: ptab1 ! first and second 3D array on which 1130 1130 REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(inout) :: ptab2 ! the boundary condition is applied 1131 CHARACTER(len=1) , INTENT(in ) :: cd_type1 ! nature of ptab1 and ptab2 arrays 1131 CHARACTER(len=1) , INTENT(in ) :: cd_type1 ! nature of ptab1 and ptab2 arrays 1132 1132 CHARACTER(len=1) , INTENT(in ) :: cd_type2 ! i.e. grid-points = T , U , V , F or W points 1133 1133 REAL(wp) , INTENT(in ) :: psgn ! =-1 the sign change across the north fold boundary … … 1155 1155 ENDIF 1156 1156 1157 1157 1158 1158 ! ! North-South boundaries 1159 1159 IF( .NOT. cd_type1 == 'F' ) ptab1(:, 1 :jprecj,:) = 0.e0 ! south except at F-point … … 1165 1165 ! 2. East and west directions exchange 1166 1166 ! ------------------------------------ 1167 ! we play with the neigbours AND the row number because of the periodicity 1167 ! we play with the neigbours AND the row number because of the periodicity 1168 1168 ! 1169 1169 SELECT CASE ( nbondi ) ! Read Dirichlet lateral conditions … … 1181 1181 imigr = jpreci * jpj * jpk *2 1182 1182 ! 1183 SELECT CASE ( nbondi ) 1183 SELECT CASE ( nbondi ) 1184 1184 CASE ( -1 ) 1185 1185 CALL mppsend( 2, t4we(1,1,1,1,1), imigr, noea, ml_req1 ) … … 1208 1208 ptab2(iihom+jl,:,:) = t4ew(:,jl,:,2,2) 1209 1209 END DO 1210 CASE ( 0 ) 1210 CASE ( 0 ) 1211 1211 DO jl = 1, jpreci 1212 1212 ptab1(jl ,:,:) = t4we(:,jl,:,1,2) … … 1240 1240 imigr = jprecj * jpi * jpk * 2 1241 1241 ! 1242 SELECT CASE ( nbondj ) 1242 SELECT CASE ( nbondj ) 1243 1243 CASE ( -1 ) 1244 1244 CALL mppsend( 4, t4sn(1,1,1,1,1), imigr, nono, ml_req1 ) … … 1252 1252 IF(l_isend) CALL mpi_wait(ml_req1, ml_stat, ml_err) 1253 1253 IF(l_isend) CALL mpi_wait(ml_req2, ml_stat, ml_err) 1254 CASE ( 1 ) 1254 CASE ( 1 ) 1255 1255 CALL mppsend( 3, t4ns(1,1,1,1,1), imigr, noso, ml_req1 ) 1256 1256 CALL mpprecv( 4, t4sn(1,1,1,1,2), imigr, noso ) … … 1267 1267 ptab2(:,ijhom+jl,:) = t4ns(:,jl,:,2,2) 1268 1268 END DO 1269 CASE ( 0 ) 1269 CASE ( 0 ) 1270 1270 DO jl = 1, jprecj 1271 1271 ptab1(:,jl ,:) = t4sn(:,jl,:,1,2) … … 1287 1287 ! 1288 1288 SELECT CASE ( jpni ) 1289 CASE ( 1 ) 1289 CASE ( 1 ) 1290 1290 CALL lbc_nfd ( ptab1, cd_type1, psgn ) ! only for northern procs. 1291 1291 CALL lbc_nfd ( ptab2, cd_type2, psgn ) … … 1293 1293 CALL mpp_lbc_north( ptab1, cd_type1, psgn ) ! for all northern procs. 1294 1294 CALL mpp_lbc_north (ptab2, cd_type2, psgn) 1295 END SELECT 1295 END SELECT 1296 1296 ! 1297 1297 ENDIF … … 1303 1303 !!---------------------------------------------------------------------- 1304 1304 !! *** routine mpp_lnk_2d_e *** 1305 !! 1305 !! 1306 1306 !! ** Purpose : Message passing manadgement for 2d array (with halo) 1307 1307 !! 1308 !! ** Method : Use mppsend and mpprecv function for passing mask 1308 !! ** Method : Use mppsend and mpprecv function for passing mask 1309 1309 !! between processors following neighboring subdomains. 1310 1310 !! domain parameters … … 1315 1315 !! nbondi : mark for "east-west local boundary" 1316 1316 !! nbondj : mark for "north-south local boundary" 1317 !! noea : number for local neighboring processors 1317 !! noea : number for local neighboring processors 1318 1318 !! nowe : number for local neighboring processors 1319 1319 !! noso : number for local neighboring processors … … 1351 1351 IF( .NOT. cd_type == 'F' ) pt2d(:, 1-jprj : jprecj ) = 0.e0 ! south except at F-point 1352 1352 pt2d(:,nlcj-jprecj+1:jpj+jprj) = 0.e0 ! north 1353 1353 1354 1354 ! ! East-West boundaries 1355 1355 ! !* Cyclic east-west … … 1371 1371 CASE ( 1 ) ; CALL lbc_nfd ( pt2d(1:jpi,1:jpj+jprj), cd_type, psgn, pr2dj=jprj ) 1372 1372 CASE DEFAULT ; CALL mpp_lbc_north_e( pt2d , cd_type, psgn ) 1373 END SELECT 1373 END SELECT 1374 1374 ! 1375 1375 ENDIF … … 1377 1377 ! 2. East and west directions exchange 1378 1378 ! ------------------------------------ 1379 ! we play with the neigbours AND the row number because of the periodicity 1379 ! we play with the neigbours AND the row number because of the periodicity 1380 1380 ! 1381 1381 SELECT CASE ( nbondi ) ! Read Dirichlet lateral conditions … … 1463 1463 ! 1464 1464 ! ! Write Dirichlet lateral conditions 1465 ijhom = nlcj - jprecj 1465 ijhom = nlcj - jprecj 1466 1466 ! 1467 1467 SELECT CASE ( nbondj ) … … 1475 1475 pt2d(:,ijhom+jl ) = r2dns(:,jl,2) 1476 1476 END DO 1477 CASE ( 1 ) 1477 CASE ( 1 ) 1478 1478 DO jl = 1, iprecj 1479 1479 pt2d(:,jl-jprj) = r2dsn(:,jl,2) … … 1487 1487 !!---------------------------------------------------------------------- 1488 1488 !! *** routine mppsend *** 1489 !! 1489 !! 1490 1490 !! ** Purpose : Send messag passing array 1491 1491 !! … … 1523 1523 INTEGER , INTENT(in ) :: kbytes ! suze of the array pmess 1524 1524 INTEGER , INTENT(in ) :: ktyp ! Tag of the recevied message 1525 INTEGER, OPTIONAL, INTENT(in) :: ksource ! source process number 1525 INTEGER, OPTIONAL, INTENT(in) :: ksource ! source process number 1526 1526 !! 1527 1527 INTEGER :: istatus(mpi_status_size) … … 1531 1531 ! 1532 1532 1533 ! If a specific process number has been passed to the receive call, 1533 ! If a specific process number has been passed to the receive call, 1534 1534 ! use that one. Default is to use mpi_any_source 1535 1535 use_source=mpi_any_source … … 1546 1546 !!---------------------------------------------------------------------- 1547 1547 !! *** routine mppgather *** 1548 !! 1549 !! ** Purpose : Transfert between a local subdomain array and a work 1548 !! 1549 !! ** Purpose : Transfert between a local subdomain array and a work 1550 1550 !! array which is distributed following the vertical level. 1551 1551 !! … … 1560 1560 itaille = jpi * jpj 1561 1561 CALL mpi_gather( ptab, itaille, mpi_double_precision, pio, itaille , & 1562 & mpi_double_precision, kp , mpi_comm_opa, ierror ) 1562 & mpi_double_precision, kp , mpi_comm_opa, ierror ) 1563 1563 ! 1564 1564 END SUBROUTINE mppgather … … 1569 1569 !! *** routine mppscatter *** 1570 1570 !! 1571 !! ** Purpose : Transfert between awork array which is distributed 1571 !! ** Purpose : Transfert between awork array which is distributed 1572 1572 !! following the vertical level and the local subdomain array. 1573 1573 !! … … 1591 1591 !!---------------------------------------------------------------------- 1592 1592 !! *** routine mppmax_a_int *** 1593 !! 1593 !! 1594 1594 !! ** Purpose : Find maximum value in an integer layout array 1595 1595 !! … … 1597 1597 INTEGER , INTENT(in ) :: kdim ! size of array 1598 1598 INTEGER , INTENT(inout), DIMENSION(kdim) :: ktab ! input array 1599 INTEGER , INTENT(in ), OPTIONAL :: kcom ! 1599 INTEGER , INTENT(in ), OPTIONAL :: kcom ! 1600 1600 !! 1601 1601 INTEGER :: ierror, localcomm ! temporary integer … … 1622 1622 INTEGER, INTENT(inout) :: ktab ! ??? 1623 1623 INTEGER, INTENT(in ), OPTIONAL :: kcom ! ??? 1624 !! 1624 !! 1625 1625 INTEGER :: ierror, iwork, localcomm ! temporary integer 1626 1626 !!---------------------------------------------------------------------- 1627 1627 ! 1628 localcomm = mpi_comm_opa 1628 localcomm = mpi_comm_opa 1629 1629 IF( PRESENT(kcom) ) localcomm = kcom 1630 1630 ! … … 1639 1639 !!---------------------------------------------------------------------- 1640 1640 !! *** routine mppmin_a_int *** 1641 !! 1641 !! 1642 1642 !! ** Purpose : Find minimum value in an integer layout array 1643 1643 !! … … 1687 1687 !!---------------------------------------------------------------------- 1688 1688 !! *** routine mppsum_a_int *** 1689 !! 1689 !! 1690 1690 !! ** Purpose : Global integer sum, 1D array case 1691 1691 !! … … 1708 1708 !!---------------------------------------------------------------------- 1709 1709 !! *** routine mppsum_int *** 1710 !! 1710 !! 1711 1711 !! ** Purpose : Global integer sum 1712 1712 !! 1713 1713 !!---------------------------------------------------------------------- 1714 1714 INTEGER, INTENT(inout) :: ktab 1715 !! 1715 !! 1716 1716 INTEGER :: ierror, iwork 1717 1717 !!---------------------------------------------------------------------- … … 1727 1727 !!---------------------------------------------------------------------- 1728 1728 !! *** routine mppmax_a_real *** 1729 !! 1729 !! 1730 1730 !! ** Purpose : Maximum 1731 1731 !! … … 1751 1751 !!---------------------------------------------------------------------- 1752 1752 !! *** routine mppmax_real *** 1753 !! 1753 !! 1754 1754 !! ** Purpose : Maximum 1755 1755 !! … … 1762 1762 !!---------------------------------------------------------------------- 1763 1763 ! 1764 localcomm = mpi_comm_opa 1764 localcomm = mpi_comm_opa 1765 1765 IF( PRESENT(kcom) ) localcomm = kcom 1766 1766 ! … … 1774 1774 !!---------------------------------------------------------------------- 1775 1775 !! *** routine mppmin_a_real *** 1776 !! 1776 !! 1777 1777 !! ** Purpose : Minimum of REAL, array case 1778 1778 !! … … 1786 1786 !!----------------------------------------------------------------------- 1787 1787 ! 1788 localcomm = mpi_comm_opa 1788 localcomm = mpi_comm_opa 1789 1789 IF( PRESENT(kcom) ) localcomm = kcom 1790 1790 ! … … 1798 1798 !!---------------------------------------------------------------------- 1799 1799 !! *** routine mppmin_real *** 1800 !! 1800 !! 1801 1801 !! ** Purpose : minimum of REAL, scalar case 1802 1802 !! 1803 1803 !!----------------------------------------------------------------------- 1804 REAL(wp), INTENT(inout) :: ptab ! 1804 REAL(wp), INTENT(inout) :: ptab ! 1805 1805 INTEGER , INTENT(in ), OPTIONAL :: kcom 1806 1806 !! … … 1810 1810 !!----------------------------------------------------------------------- 1811 1811 ! 1812 localcomm = mpi_comm_opa 1812 localcomm = mpi_comm_opa 1813 1813 IF( PRESENT(kcom) ) localcomm = kcom 1814 1814 ! … … 1822 1822 !!---------------------------------------------------------------------- 1823 1823 !! *** routine mppsum_a_real *** 1824 !! 1824 !! 1825 1825 !! ** Purpose : global sum, REAL ARRAY argument case 1826 1826 !! … … 1831 1831 !! 1832 1832 INTEGER :: ierror ! temporary integer 1833 INTEGER :: localcomm 1834 REAL(wp), DIMENSION(kdim) :: zwork ! temporary workspace 1833 INTEGER :: localcomm 1834 REAL(wp), DIMENSION(kdim) :: zwork ! temporary workspace 1835 1835 !!----------------------------------------------------------------------- 1836 1836 ! 1837 localcomm = mpi_comm_opa 1837 localcomm = mpi_comm_opa 1838 1838 IF( PRESENT(kcom) ) localcomm = kcom 1839 1839 ! … … 1847 1847 !!---------------------------------------------------------------------- 1848 1848 !! *** routine mppsum_real *** 1849 !! 1849 !! 1850 1850 !! ** Purpose : global sum, SCALAR argument case 1851 1851 !! … … 1854 1854 INTEGER , INTENT(in ), OPTIONAL :: kcom 1855 1855 !! 1856 INTEGER :: ierror, localcomm 1856 INTEGER :: ierror, localcomm 1857 1857 REAL(wp) :: zwork 1858 1858 !!----------------------------------------------------------------------- 1859 1859 ! 1860 localcomm = mpi_comm_opa 1860 localcomm = mpi_comm_opa 1861 1861 IF( PRESENT(kcom) ) localcomm = kcom 1862 1862 ! … … 1891 1891 1892 1892 END SUBROUTINE mppsum_realdd 1893 1894 1893 1894 1895 1895 SUBROUTINE mppsum_a_realdd( ytab, kdim, kcom ) 1896 1896 !!---------------------------------------------------------------------- … … 1918 1918 1919 1919 END SUBROUTINE mppsum_a_realdd 1920 1920 1921 1921 SUBROUTINE mpp_minloc2d( ptab, pmask, pmin, ki,kj ) 1922 1922 !!------------------------------------------------------------------------ … … 2013 2013 REAL(wp) , INTENT( out) :: pmax ! Global maximum of ptab 2014 2014 INTEGER , INTENT( out) :: ki, kj ! index of maximum in global frame 2015 !! 2015 !! 2016 2016 INTEGER :: ierror 2017 2017 INTEGER, DIMENSION (2) :: ilocs … … 2052 2052 REAL(wp) , INTENT( out) :: pmax ! Global maximum of ptab 2053 2053 INTEGER , INTENT( out) :: ki, kj, kk ! index of maximum in global frame 2054 !! 2054 !! 2055 2055 REAL(wp) :: zmax ! local maximum 2056 2056 REAL(wp), DIMENSION(2,1) :: zain, zaout … … 2082 2082 !!---------------------------------------------------------------------- 2083 2083 !! *** routine mppsync *** 2084 !! 2084 !! 2085 2085 !! ** Purpose : Massively parallel processors, synchroneous 2086 2086 !! … … 2097 2097 !!---------------------------------------------------------------------- 2098 2098 !! *** routine mppstop *** 2099 !! 2099 !! 2100 2100 !! ** purpose : Stop massively parallel processors method 2101 2101 !! … … 2113 2113 !!---------------------------------------------------------------------- 2114 2114 !! *** routine mppobc *** 2115 !! 2115 !! 2116 2116 !! ** Purpose : Message passing manadgement for open boundary 2117 2117 !! conditions array … … 2124 2124 !! nbondi : mark for "east-west local boundary" 2125 2125 !! nbondj : mark for "north-south local boundary" 2126 !! noea : number for local neighboring processors 2126 !! noea : number for local neighboring processors 2127 2127 !! nowe : number for local neighboring processors 2128 2128 !! noso : number for local neighboring processors … … 2307 2307 ! 2308 2308 END SUBROUTINE mppobc 2309 2309 2310 2310 2311 2311 SUBROUTINE mpp_comm_free( kcom ) … … 2366 2366 kice = 0 2367 2367 DO jjproc = 1, jpnij 2368 IF( jjproc == narea .AND. pindic .GT. 0 ) kice(jjproc) = 1 2368 IF( jjproc == narea .AND. pindic .GT. 0 ) kice(jjproc) = 1 2369 2369 END DO 2370 2370 ! 2371 2371 zwork = 0 2372 2372 CALL MPI_ALLREDUCE( kice, zwork, jpnij, mpi_integer, mpi_sum, mpi_comm_opa, ierr ) 2373 ndim_rank_ice = SUM( zwork ) 2373 ndim_rank_ice = SUM( zwork ) 2374 2374 2375 2375 ! Allocate the right size to nrank_north … … 2377 2377 ALLOCATE( nrank_ice(ndim_rank_ice) ) 2378 2378 ! 2379 ii = 0 2379 ii = 0 2380 2380 nrank_ice = 0 2381 2381 DO jjproc = 1, jpnij 2382 2382 IF( zwork(jjproc) == 1) THEN 2383 2383 ii = ii + 1 2384 nrank_ice(ii) = jjproc -1 2384 nrank_ice(ii) = jjproc -1 2385 2385 ENDIF 2386 2386 END DO … … 2464 2464 IF (ALLOCATED (nrank_znl)) DEALLOCATE(nrank_znl) 2465 2465 ALLOCATE(nrank_znl(ndim_rank_znl)) 2466 ii = 0 2466 ii = 0 2467 2467 nrank_znl (:) = 0 2468 2468 DO jproc=1,jpnij 2469 2469 IF ( kwork(jproc) == njmpp) THEN 2470 2470 ii = ii + 1 2471 nrank_znl(ii) = jproc -1 2471 nrank_znl(ii) = jproc -1 2472 2472 ENDIF 2473 2473 END DO … … 2493 2493 2494 2494 ! Determines if processor if the first (starting from i=1) on the row 2495 IF ( jpni == 1 ) THEN 2495 IF ( jpni == 1 ) THEN 2496 2496 l_znl_root = .TRUE. 2497 2497 ELSE … … 2511 2511 !! *** routine mpp_ini_north *** 2512 2512 !! 2513 !! ** Purpose : Initialize special communicator for north folding 2513 !! ** Purpose : Initialize special communicator for north folding 2514 2514 !! condition together with global variables needed in the mpp folding 2515 2515 !! … … 2572 2572 !! *** routine mpp_lbc_north_3d *** 2573 2573 !! 2574 !! ** Purpose : Ensure proper north fold horizontal bondary condition 2574 !! ** Purpose : Ensure proper north fold horizontal bondary condition 2575 2575 !! in mpp configuration in case of jpn1 > 1 2576 2576 !! 2577 2577 !! ** Method : North fold condition and mpp with more than one proc 2578 !! in i-direction require a specific treatment. We gather 2578 !! in i-direction require a specific treatment. We gather 2579 2579 !! the 4 northern lines of the global domain on 1 processor 2580 2580 !! and apply lbc north-fold on this sub array. Then we … … 2585 2585 CHARACTER(len=1) , INTENT(in ) :: cd_type ! nature of pt3d grid-points 2586 2586 ! ! = T , U , V , F or W gridpoints 2587 REAL(wp) , INTENT(in ) :: psgn ! = -1. the sign change across the north fold 2587 REAL(wp) , INTENT(in ) :: psgn ! = -1. the sign change across the north fold 2588 2588 !! ! = 1. , the sign is kept 2589 2589 INTEGER :: ji, jj, jr … … 2594 2594 INTEGER, DIMENSION(MPI_STATUS_SIZE) :: ml_stat ! for mpi_isend when avoiding mpi_allgather 2595 2595 !!---------------------------------------------------------------------- 2596 ! 2596 ! 2597 2597 ijpj = 4 2598 2598 ityp = -1 … … 2609 2609 IF ( l_north_nogather ) THEN 2610 2610 ! 2611 ! Avoid the use of mpi_allgather by exchanging only with the processes already identified 2611 ! Avoid the use of mpi_allgather by exchanging only with the processes already identified 2612 2612 ! (in nemo_northcomms) as being involved in this process' northern boundary exchange 2613 2613 ! … … 2634 2634 ityp = 5 2635 2635 CASE DEFAULT 2636 ityp = -1 ! Set a default value for unsupported types which 2636 ityp = -1 ! Set a default value for unsupported types which 2637 2637 ! will cause a fallback to the mpi_allgather method 2638 2638 END SELECT … … 2683 2683 ! The ztab array has been either: 2684 2684 ! a. Fully populated by the mpi_allgather operation or 2685 ! b. Had the active points for this domain and northern neighbours populated 2685 ! b. Had the active points for this domain and northern neighbours populated 2686 2686 ! by peer to peer exchanges 2687 ! Either way the array may be folded by lbc_nfd and the result for the span of 2687 ! Either way the array may be folded by lbc_nfd and the result for the span of 2688 2688 ! this domain will be identical. 2689 2689 ! … … 2704 2704 !! *** routine mpp_lbc_north_2d *** 2705 2705 !! 2706 !! ** Purpose : Ensure proper north fold horizontal bondary condition 2706 !! ** Purpose : Ensure proper north fold horizontal bondary condition 2707 2707 !! in mpp configuration in case of jpn1 > 1 (for 2d array ) 2708 2708 !! 2709 2709 !! ** Method : North fold condition and mpp with more than one proc 2710 !! in i-direction require a specific treatment. We gather 2710 !! in i-direction require a specific treatment. We gather 2711 2711 !! the 4 northern lines of the global domain on 1 processor 2712 2712 !! and apply lbc north-fold on this sub array. Then we … … 2717 2717 CHARACTER(len=1) , INTENT(in ) :: cd_type ! nature of pt3d grid-points 2718 2718 ! ! = T , U , V , F or W gridpoints 2719 REAL(wp) , INTENT(in ) :: psgn ! = -1. the sign change across the north fold 2719 REAL(wp) , INTENT(in ) :: psgn ! = -1. the sign change across the north fold 2720 2720 !! ! = 1. , the sign is kept 2721 2721 INTEGER :: ji, jj, jr … … 2741 2741 IF ( l_north_nogather ) THEN 2742 2742 ! 2743 ! Avoid the use of mpi_allgather by exchanging only with the processes already identified 2743 ! Avoid the use of mpi_allgather by exchanging only with the processes already identified 2744 2744 ! (in nemo_northcomms) as being involved in this process' northern boundary exchange 2745 2745 ! … … 2766 2766 ityp = 5 2767 2767 CASE DEFAULT 2768 ityp = -1 ! Set a default value for unsupported types which 2768 ityp = -1 ! Set a default value for unsupported types which 2769 2769 ! will cause a fallback to the mpi_allgather method 2770 2770 END SELECT … … 2816 2816 ! The ztab array has been either: 2817 2817 ! a. Fully populated by the mpi_allgather operation or 2818 ! b. Had the active points for this domain and northern neighbours populated 2818 ! b. Had the active points for this domain and northern neighbours populated 2819 2819 ! by peer to peer exchanges 2820 ! Either way the array may be folded by lbc_nfd and the result for the span of 2820 ! Either way the array may be folded by lbc_nfd and the result for the span of 2821 2821 ! this domain will be identical. 2822 2822 ! … … 2838 2838 !! *** routine mpp_lbc_north_2d *** 2839 2839 !! 2840 !! ** Purpose : Ensure proper north fold horizontal bondary condition 2841 !! in mpp configuration in case of jpn1 > 1 and for 2d 2840 !! ** Purpose : Ensure proper north fold horizontal bondary condition 2841 !! in mpp configuration in case of jpn1 > 1 and for 2d 2842 2842 !! array with outer extra halo 2843 2843 !! 2844 2844 !! ** Method : North fold condition and mpp with more than one proc 2845 !! in i-direction require a specific treatment. We gather 2846 !! the 4+2*jpr2dj northern lines of the global domain on 1 2847 !! processor and apply lbc north-fold on this sub array. 2845 !! in i-direction require a specific treatment. We gather 2846 !! the 4+2*jpr2dj northern lines of the global domain on 1 2847 !! processor and apply lbc north-fold on this sub array. 2848 2848 !! Then we scatter the north fold array back to the processors. 2849 2849 !! … … 2852 2852 CHARACTER(len=1) , INTENT(in ) :: cd_type ! nature of pt3d grid-points 2853 2853 ! ! = T , U , V , F or W -points 2854 REAL(wp) , INTENT(in ) :: psgn ! = -1. the sign change across the 2854 REAL(wp) , INTENT(in ) :: psgn ! = -1. the sign change across the 2855 2855 !! ! north fold, = 1. otherwise 2856 2856 INTEGER :: ji, jj, jr … … 2895 2895 !! Scatter back to pt2d 2896 2896 DO jj = nlcj - ijpj + 1 , nlcj +jpr2dj 2897 ij = ij +1 2897 ij = ij +1 2898 2898 DO ji= 1, nlci 2899 2899 pt2d(ji,jj) = ztab_e(ji+nimpp-1,ij) … … 3339 3339 !! ** Method :: define buffer size in namelist, if 0 no buffer attachment 3340 3340 !! but classical mpi_init 3341 !! 3342 !! History :: 01/11 :: IDRIS initial version for IBM only 3341 !! 3342 !! History :: 01/11 :: IDRIS initial version for IBM only 3343 3343 !! 08/04 :: R. Benshila, generalisation 3344 3344 !!--------------------------------------------------------------------- 3345 CHARACTER(len=*),DIMENSION(:), INTENT( out) :: ldtxt 3345 CHARACTER(len=*),DIMENSION(:), INTENT( out) :: ldtxt 3346 3346 INTEGER , INTENT(inout) :: ksft 3347 3347 INTEGER , INTENT( out) :: code … … 3352 3352 CALL mpi_initialized( mpi_was_called, code ) ! MPI initialization 3353 3353 IF ( code /= MPI_SUCCESS ) THEN 3354 DO ji = 1, SIZE(ldtxt) 3354 DO ji = 1, SIZE(ldtxt) 3355 3355 IF( TRIM(ldtxt(ji)) /= '' ) WRITE(*,*) ldtxt(ji) ! control print of mynode 3356 END DO 3356 END DO 3357 3357 WRITE(*, cform_err) 3358 3358 WRITE(*, *) ' lib_mpp: Error in routine mpi_initialized' … … 3364 3364 CALL mpi_comm_dup( mpi_comm_world, mpi_comm_opa, code ) 3365 3365 IF ( code /= MPI_SUCCESS ) THEN 3366 DO ji = 1, SIZE(ldtxt) 3366 DO ji = 1, SIZE(ldtxt) 3367 3367 IF( TRIM(ldtxt(ji)) /= '' ) WRITE(*,*) ldtxt(ji) ! control print of mynode 3368 3368 END DO … … 3377 3377 ! Buffer allocation and attachment 3378 3378 ALLOCATE( tampon(nn_buffer), stat = ierr ) 3379 IF( ierr /= 0 ) THEN 3380 DO ji = 1, SIZE(ldtxt) 3379 IF( ierr /= 0 ) THEN 3380 DO ji = 1, SIZE(ldtxt) 3381 3381 IF( TRIM(ldtxt(ji)) /= '' ) WRITE(*,*) ldtxt(ji) ! control print of mynode 3382 3382 END DO … … 3457 3457 FUNCTION mynode( ldtxt, kumnam, kstop, localComm ) RESULT (function_value) 3458 3458 INTEGER, OPTIONAL , INTENT(in ) :: localComm 3459 CHARACTER(len=*),DIMENSION(:) :: ldtxt 3459 CHARACTER(len=*),DIMENSION(:) :: ldtxt 3460 3460 INTEGER :: kumnam, kstop 3461 3461 IF( PRESENT( localComm ) .OR. .NOT.PRESENT( localComm ) ) function_value = 0 … … 3469 3469 REAL , DIMENSION(:) :: parr 3470 3470 INTEGER :: kdim 3471 INTEGER, OPTIONAL :: kcom 3471 INTEGER, OPTIONAL :: kcom 3472 3472 WRITE(*,*) 'mpp_sum_as: You should not have seen this print! error?', kdim, parr(1), kcom 3473 3473 END SUBROUTINE mpp_sum_as … … 3476 3476 REAL , DIMENSION(:,:) :: parr 3477 3477 INTEGER :: kdim 3478 INTEGER, OPTIONAL :: kcom 3478 INTEGER, OPTIONAL :: kcom 3479 3479 WRITE(*,*) 'mpp_sum_a2s: You should not have seen this print! error?', kdim, parr(1,1), kcom 3480 3480 END SUBROUTINE mpp_sum_a2s … … 3483 3483 INTEGER, DIMENSION(:) :: karr 3484 3484 INTEGER :: kdim 3485 INTEGER, OPTIONAL :: kcom 3485 INTEGER, OPTIONAL :: kcom 3486 3486 WRITE(*,*) 'mpp_sum_ai: You should not have seen this print! error?', kdim, karr(1), kcom 3487 3487 END SUBROUTINE mpp_sum_ai … … 3489 3489 SUBROUTINE mpp_sum_s( psca, kcom ) ! Dummy routine 3490 3490 REAL :: psca 3491 INTEGER, OPTIONAL :: kcom 3491 INTEGER, OPTIONAL :: kcom 3492 3492 WRITE(*,*) 'mpp_sum_s: You should not have seen this print! error?', psca, kcom 3493 3493 END SUBROUTINE mpp_sum_s … … 3495 3495 SUBROUTINE mpp_sum_i( kint, kcom ) ! Dummy routine 3496 3496 integer :: kint 3497 INTEGER, OPTIONAL :: kcom 3497 INTEGER, OPTIONAL :: kcom 3498 3498 WRITE(*,*) 'mpp_sum_i: You should not have seen this print! error?', kint, kcom 3499 3499 END SUBROUTINE mpp_sum_i … … 3504 3504 WRITE(*,*) 'mppsum_realdd: You should not have seen this print! error?', ytab 3505 3505 END SUBROUTINE mppsum_realdd 3506 3506 3507 3507 SUBROUTINE mppsum_a_realdd( ytab, kdim, kcom ) 3508 3508 INTEGER , INTENT( in ) :: kdim ! size of ytab … … 3515 3515 REAL , DIMENSION(:) :: parr 3516 3516 INTEGER :: kdim 3517 INTEGER, OPTIONAL :: kcom 3517 INTEGER, OPTIONAL :: kcom 3518 3518 WRITE(*,*) 'mppmax_a_real: You should not have seen this print! error?', kdim, parr(1), kcom 3519 3519 END SUBROUTINE mppmax_a_real … … 3521 3521 SUBROUTINE mppmax_real( psca, kcom ) 3522 3522 REAL :: psca 3523 INTEGER, OPTIONAL :: kcom 3523 INTEGER, OPTIONAL :: kcom 3524 3524 WRITE(*,*) 'mppmax_real: You should not have seen this print! error?', psca, kcom 3525 3525 END SUBROUTINE mppmax_real … … 3528 3528 REAL , DIMENSION(:) :: parr 3529 3529 INTEGER :: kdim 3530 INTEGER, OPTIONAL :: kcom 3530 INTEGER, OPTIONAL :: kcom 3531 3531 WRITE(*,*) 'mppmin_a_real: You should not have seen this print! error?', kdim, parr(1), kcom 3532 3532 END SUBROUTINE mppmin_a_real … … 3534 3534 SUBROUTINE mppmin_real( psca, kcom ) 3535 3535 REAL :: psca 3536 INTEGER, OPTIONAL :: kcom 3536 INTEGER, OPTIONAL :: kcom 3537 3537 WRITE(*,*) 'mppmin_real: You should not have seen this print! error?', psca, kcom 3538 3538 END SUBROUTINE mppmin_real … … 3541 3541 INTEGER, DIMENSION(:) :: karr 3542 3542 INTEGER :: kdim 3543 INTEGER, OPTIONAL :: kcom 3543 INTEGER, OPTIONAL :: kcom 3544 3544 WRITE(*,*) 'mppmax_a_int: You should not have seen this print! error?', kdim, karr(1), kcom 3545 3545 END SUBROUTINE mppmax_a_int … … 3547 3547 SUBROUTINE mppmax_int( kint, kcom) 3548 3548 INTEGER :: kint 3549 INTEGER, OPTIONAL :: kcom 3549 INTEGER, OPTIONAL :: kcom 3550 3550 WRITE(*,*) 'mppmax_int: You should not have seen this print! error?', kint, kcom 3551 3551 END SUBROUTINE mppmax_int … … 3554 3554 INTEGER, DIMENSION(:) :: karr 3555 3555 INTEGER :: kdim 3556 INTEGER, OPTIONAL :: kcom 3556 INTEGER, OPTIONAL :: kcom 3557 3557 WRITE(*,*) 'mppmin_a_int: You should not have seen this print! error?', kdim, karr(1), kcom 3558 3558 END SUBROUTINE mppmin_a_int … … 3560 3560 SUBROUTINE mppmin_int( kint, kcom ) 3561 3561 INTEGER :: kint 3562 INTEGER, OPTIONAL :: kcom 3562 INTEGER, OPTIONAL :: kcom 3563 3563 WRITE(*,*) 'mppmin_int: You should not have seen this print! error?', kint, kcom 3564 3564 END SUBROUTINE mppmin_int … … 3647 3647 !! *** ROUTINE stop_opa *** 3648 3648 !! 3649 !! ** Purpose : print in ocean.outpput file a error message and 3649 !! ** Purpose : print in ocean.outpput file a error message and 3650 3650 !! increment the error number (nstop) by one. 3651 3651 !!---------------------------------------------------------------------- … … 3654 3654 !!---------------------------------------------------------------------- 3655 3655 ! 3656 nstop = nstop + 1 3656 nstop = nstop + 1 3657 3657 IF(lwp) THEN 3658 3658 WRITE(numout,cform_err) … … 3686 3686 !! *** ROUTINE stop_warn *** 3687 3687 !! 3688 !! ** Purpose : print in ocean.outpput file a error message and 3688 !! ** Purpose : print in ocean.outpput file a error message and 3689 3689 !! increment the warning number (nwarn) by one. 3690 3690 !!---------------------------------------------------------------------- … … 3692 3692 CHARACTER(len=*), INTENT(in), OPTIONAL :: cd6, cd7, cd8, cd9, cd10 3693 3693 !!---------------------------------------------------------------------- 3694 ! 3695 nwarn = nwarn + 1 3694 ! 3695 nwarn = nwarn + 1 3696 3696 IF(lwp) THEN 3697 3697 WRITE(numout,cform_war) … … 3779 3779 STOP 'ctl_opn bad opening' 3780 3780 ENDIF 3781 3781 3782 3782 END SUBROUTINE ctl_opn 3783 3783 … … 3789 3789 !! ** Purpose : return the index of an unused logical unit 3790 3790 !!---------------------------------------------------------------------- 3791 LOGICAL :: llopn 3791 LOGICAL :: llopn 3792 3792 !!---------------------------------------------------------------------- 3793 3793 ! -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/OPA_SRC/OBC/obcdta.F90
r3294 r3764 121 121 ALLOCATE( ltemsk(jpj,jpk) , luemsk(jpj,jpk) , lvemsk(jpj,jpk) , & 122 122 & ltwmsk(jpj,jpk) , luwmsk(jpj,jpk) , lvwmsk(jpj,jpk) , & 123 & ltnmsk(jp j,jpk) , lunmsk(jpj,jpk) , lvnmsk(jpj,jpk) , &124 & ltsmsk(jp j,jpk) , lusmsk(jpj,jpk) , lvsmsk(jpj,jpk) , STAT=ierr(2) )123 & ltnmsk(jpi,jpk) , lunmsk(jpi,jpk) , lvnmsk(jpi,jpk) , & 124 & ltsmsk(jpi,jpk) , lusmsk(jpi,jpk) , lvsmsk(jpi,jpk) , STAT=ierr(2) ) 125 125 126 126 obc_dta_alloc = MAXVAL( ierr ) -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/OPA_SRC/SBC/fldread.F90
r3680 r3764 854 854 IF( LEN( TRIM(sdf_n(jf)%wname) ) > 0 ) sdf(jf)%wgtname = TRIM( cdir )//TRIM( sdf_n(jf)%wname ) 855 855 sdf(jf)%vcomp = sdf_n(jf)%vcomp 856 sdf(jf)%rotn = . FALSE.856 sdf(jf)%rotn = .TRUE. 857 857 END DO 858 858 -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/OPA_SRC/SBC/sbcdcy.F90
r3651 r3764 105 105 rcc(:,:) = zconvrad * glamt(:,:) - rpi 106 106 ! time of midday 107 rtmd(:,:) = 0.5 - glamt(:,:) / 360.108 rtmd(:,:) = MOD( (rtmd(:,:) + 1. ), 1.)107 rtmd(:,:) = 0.5_wp - glamt(:,:) / 360._wp 108 rtmd(:,:) = MOD( (rtmd(:,:) + 1._wp) , 1._wp) 109 109 ENDIF 110 110 … … 121 121 zdsws = REAL(11 + nday_year, wp) 122 122 ! declination of the earths orbit 123 zdecrad = (-23.5 * zconvrad) * COS( zdsws * ztwopi / REAL(nyear_len(1),wp) )123 zdecrad = (-23.5_wp * zconvrad) * COS( zdsws * ztwopi / REAL(nyear_len(1),wp) ) 124 124 ! Compute A and B needed to compute the time integral of the diurnal cycle 125 125 … … 138 138 DO jj = 1, jpj 139 139 DO ji = 1, jpi 140 IF ( ABS(rab(ji,jj)) < 1 ) THEN ! day duration is less than 24h140 IF ( ABS(rab(ji,jj)) < 1._wp ) THEN ! day duration is less than 24h 141 141 ! When is it night? 142 142 ztx = zinvtwopi * (ACOS(rab(ji,jj)) - rcc(ji,jj)) 143 143 ztest = -rbb(ji,jj) * SIN( rcc(ji,jj) + ztwopi * ztx ) 144 144 ! is it dawn or dusk? 145 IF ( ztest > 0 ) THEN145 IF ( ztest > 0._wp ) THEN 146 146 rdawn(ji,jj) = ztx 147 147 rdusk(ji,jj) = rtmd(ji,jj) + ( rtmd(ji,jj) - rdawn(ji,jj) ) … … 151 151 ENDIF 152 152 ELSE 153 rdawn(ji,jj) = rtmd(ji,jj) + 0.5 153 rdawn(ji,jj) = rtmd(ji,jj) + 0.5_wp 154 154 rdusk(ji,jj) = rdawn(ji,jj) 155 155 ENDIF … … 158 158 rdawn(:,:) = MOD( (rdawn(:,:) + 1._wp), 1._wp ) 159 159 rdusk(:,:) = MOD( (rdusk(:,:) + 1._wp), 1._wp ) 160 ! 2.2 Compute the scalling function: 161 ! S* = the inverse of the time integral of the diurnal cycle from dawm to dusk 160 ! 2.2 Compute the scaling function: 161 ! S* = the inverse of the time integral of the diurnal cycle from dawn to dusk 162 ! Avoid possible infinite scaling factor, associated with very short daylight 163 ! periods, by ignoring periods less than 1/1000th of a day (ticket #1040) 162 164 DO jj = 1, jpj 163 165 DO ji = 1, jpi 164 IF ( ABS(rab(ji,jj)) < 1 ) THEN ! day duration is less than 24h 166 IF ( ABS(rab(ji,jj)) < 1._wp ) THEN ! day duration is less than 24h 167 rscal(ji,jj) = 0.0_wp 165 168 IF ( rdawn(ji,jj) < rdusk(ji,jj) ) THEN ! day time in one part 166 rscal(ji,jj) = fintegral(rdawn(ji,jj), rdusk(ji,jj), raa(ji,jj), rbb(ji,jj), rcc(ji,jj)) 167 rscal(ji,jj) = 1. / rscal(ji,jj) 169 IF( (rdusk(ji,jj) - rdawn(ji,jj) ) .ge. 0.001_wp ) THEN 170 rscal(ji,jj) = fintegral(rdawn(ji,jj), rdusk(ji,jj), raa(ji,jj), rbb(ji,jj), rcc(ji,jj)) 171 rscal(ji,jj) = 1._wp / rscal(ji,jj) 172 ENDIF 168 173 ELSE ! day time in two parts 169 rscal(ji,jj) = fintegral(0., rdusk(ji,jj), raa(ji,jj), rbb(ji,jj), rcc(ji,jj)) & 170 & + fintegral(rdawn(ji,jj), 1., raa(ji,jj), rbb(ji,jj), rcc(ji,jj)) 171 rscal(ji,jj) = 1. / rscal(ji,jj) 174 IF( (rdusk(ji,jj) + (1._wp - rdawn(ji,jj)) ) .ge. 0.001_wp ) THEN 175 rscal(ji,jj) = fintegral(0._wp, rdusk(ji,jj), raa(ji,jj), rbb(ji,jj), rcc(ji,jj)) & 176 & + fintegral(rdawn(ji,jj), 1._wp, raa(ji,jj), rbb(ji,jj), rcc(ji,jj)) 177 rscal(ji,jj) = 1. / rscal(ji,jj) 178 ENDIF 172 179 ENDIF 173 180 ELSE 174 181 IF ( raa(ji,jj) > rbb(ji,jj) ) THEN ! 24h day 175 rscal(ji,jj) = fintegral(0. , 1., raa(ji,jj), rbb(ji,jj), rcc(ji,jj))176 rscal(ji,jj) = 1. / rscal(ji,jj)182 rscal(ji,jj) = fintegral(0._wp, 1._wp, raa(ji,jj), rbb(ji,jj), rcc(ji,jj)) 183 rscal(ji,jj) = 1._wp / rscal(ji,jj) 177 184 ELSE ! No day 178 rscal(ji,jj) = 0. e0185 rscal(ji,jj) = 0.0_wp 179 186 ENDIF 180 187 ENDIF … … 193 200 DO ji = 1, jpi 194 201 ztmpm = 0.0 195 IF( ABS(rab(ji,jj)) < 1 ) THEN ! day duration is less than 24h202 IF( ABS(rab(ji,jj)) < 1. ) THEN ! day duration is less than 24h 196 203 ! 197 204 IF( rdawn(ji,jj) < rdusk(ji,jj) ) THEN ! day time in one part … … 227 234 ! 228 235 ELSE ! No day 229 zqsrout(ji,jj) = 0. e0236 zqsrout(ji,jj) = 0.0_wp 230 237 imask_night(ji,jj) = 1 231 238 ENDIF -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/OPA_SRC/SBC/sbcmod.F90
r3740 r3764 218 218 IF( nsbc == 6 ) WRITE(numout,*) ' MFS Bulk formulation' 219 219 ENDIF 220 221 !!---------------------------------------------------------------------- 222 !! Other SBC modules to initialise come here 223 !!---------------------------------------------------------------------- 224 225 CALL sbc_ssm_init 226 227 IF( nn_ice == 4 ) CALL cice_sbc_init (nsbc) 228 ! 229 !!---------------------------------------------------------------------- 220 ! 221 IF( ln_ssr ) CALL sbc_ssr_init ! Sea-Surface Restoring initialisation 222 ! 223 IF( nn_ice == 4 ) CALL cice_sbc_init( nsbc ) ! CICE initialisation 224 ! 230 225 END SUBROUTINE sbc_init 231 226 … … 397 392 END SUBROUTINE sbc 398 393 394 399 395 SUBROUTINE sbc_final 400 396 !!--------------------------------------------------------------------- 401 397 !! *** ROUTINE sbc_final *** 398 !! 399 !! ** Purpose : Finalize CICE (if used) 402 400 !!--------------------------------------------------------------------- 403 404 !----------------------------------------------------------------- 405 ! Finalize CICE (if used) 406 !----------------------------------------------------------------- 407 401 ! 408 402 IF( nn_ice == 4 ) CALL cice_sbc_final 409 403 ! -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/OPA_SRC/SBC/sbcrnf.F90
r3680 r3764 6 6 !! History : OPA ! 2000-11 (R. Hordoir, E. Durand) NetCDF FORMAT 7 7 !! NEMO 1.0 ! 2002-09 (G. Madec) F90: Free form and module 8 !! 3.0 ! 2006-07 (G. Madec) Surface module 8 !! 3.0 ! 2006-07 (G. Madec) Surface module 9 9 !! 3.2 ! 2009-04 (B. Lemaire) Introduce iom_put 10 10 !! 3.3 ! 2010-10 (R. Furner, G. Madec) runoff distributed over ocean levels … … 31 31 PUBLIC sbc_rnf_div ! routine called in sshwzv module 32 32 PUBLIC sbc_rnf_alloc ! routine call in sbcmod module 33 33 PUBLIC sbc_rnf_init ! (PUBLIC for TAM) 34 34 ! !!* namsbc_rnf namelist * 35 35 CHARACTER(len=100), PUBLIC :: cn_dir = './' !: Root directory for location of ssr files 36 36 LOGICAL , PUBLIC :: ln_rnf_depth = .false. !: depth river runoffs attribute specified in a file 37 LOGICAL , PUBLIC :: ln_rnf_tem = .false. !: temperature river runoffs attribute specified in a file 38 LOGICAL , PUBLIC :: ln_rnf_sal = .false. !: salinity river runoffs attribute specified in a file 37 LOGICAL , PUBLIC :: ln_rnf_tem = .false. !: temperature river runoffs attribute specified in a file 38 LOGICAL , PUBLIC :: ln_rnf_sal = .false. !: salinity river runoffs attribute specified in a file 39 39 LOGICAL , PUBLIC :: ln_rnf_emp = .false. !: runoffs into a file to be read or already into precipitation 40 40 TYPE(FLD_N) , PUBLIC :: sn_rnf !: information about the runoff file to be read 41 41 TYPE(FLD_N) , PUBLIC :: sn_cnf !: information about the runoff mouth file to be read 42 TYPE(FLD_N) :: sn_s_rnf !: information about the salinities of runoff file to be read 43 TYPE(FLD_N) :: sn_t_rnf !: information about the temperatures of runoff file to be read 42 TYPE(FLD_N) :: sn_s_rnf !: information about the salinities of runoff file to be read 43 TYPE(FLD_N) :: sn_t_rnf !: information about the temperatures of runoff file to be read 44 44 TYPE(FLD_N) :: sn_dep_rnf !: information about the depth which river inflow affects 45 45 LOGICAL , PUBLIC :: ln_rnf_mouth = .false. !: specific treatment in mouths vicinity … … 53 53 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: h_rnf !: depth of runoff in m 54 54 INTEGER, PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: nk_rnf !: depth of runoff in model levels 55 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: rnf_tsc_b, rnf_tsc !: before and now T & S runoff contents [K.m/s & PSU.m/s] 56 55 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: rnf_tsc_b, rnf_tsc !: before and now T & S runoff contents [K.m/s & PSU.m/s] 57 56 58 57 TYPE(FLD), PUBLIC, ALLOCATABLE, DIMENSION(:) :: sf_rnf ! structure: river runoff (file information, fields read) … … 85 84 !!---------------------------------------------------------------------- 86 85 !! *** ROUTINE sbc_rnf *** 87 !! 86 !! 88 87 !! ** Purpose : Introduce a climatological run off forcing 89 88 !! 90 !! ** Method : Set each river mouth with a monthly climatology 89 !! ** Method : Set each river mouth with a monthly climatology 91 90 !! provided from different data. 92 91 !! CAUTION : upward water flux, runoff forced to be < 0 … … 98 97 INTEGER :: ji, jj ! dummy loop indices 99 98 !!---------------------------------------------------------------------- 100 ! 99 ! 101 100 IF( kt == nit000 ) CALL sbc_rnf_init ! Read namelist and allocate structures 102 101 … … 113 112 ! !-------------------! 114 113 ! 115 CALL fld_read ( kt, nn_fsbc, sf_rnf ) ! Read Runoffs data and provide it at kt 114 CALL fld_read ( kt, nn_fsbc, sf_rnf ) ! Read Runoffs data and provide it at kt 116 115 IF( ln_rnf_tem ) CALL fld_read ( kt, nn_fsbc, sf_t_rnf ) ! idem for runoffs temperature if required 117 116 IF( ln_rnf_sal ) CALL fld_read ( kt, nn_fsbc, sf_s_rnf ) ! idem for runoffs salinity if required … … 132 131 IF( ln_rnf_tem ) THEN ! use runoffs temperature data 133 132 rnf_tsc(:,:,jp_tem) = ( sf_t_rnf(1)%fnow(:,:,1) ) * rnf(:,:) * r1_rau0 134 WHERE( sf_t_rnf(1)%fnow(:,:,1) == -999 ) ! if missing data value use SST as runoffs temperature 133 WHERE( sf_t_rnf(1)%fnow(:,:,1) == -999 ) ! if missing data value use SST as runoffs temperature 135 134 rnf_tsc(:,:,jp_tem) = sst_m(:,:) * rnf(:,:) * r1_rau0 136 135 END WHERE 137 136 ELSE ! use SST as runoffs temperature 138 137 rnf_tsc(:,:,jp_tem) = sst_m(:,:) * rnf(:,:) * r1_rau0 139 ENDIF 140 ! ! use runoffs salinity data 138 ENDIF 139 ! ! use runoffs salinity data 141 140 IF( ln_rnf_sal ) rnf_tsc(:,:,jp_sal) = ( sf_s_rnf(1)%fnow(:,:,1) ) * rnf(:,:) * r1_rau0 142 141 ! ! else use S=0 for runoffs (done one for all in the init) 143 142 ! 144 143 IF( ln_rnf_tem .OR. ln_rnf_sal ) THEN ! runoffs as outflow: use ocean SST and SSS 145 WHERE( rnf(:,:) < 0._wp ) ! example baltic model when flow is out of domain 144 WHERE( rnf(:,:) < 0._wp ) ! example baltic model when flow is out of domain 146 145 rnf_tsc(:,:,jp_tem) = sst_m(:,:) * rnf(:,:) * r1_rau0 147 146 rnf_tsc(:,:,jp_sal) = sss_m(:,:) * rnf(:,:) * r1_rau0 … … 157 156 ! ! ---------------------------------------- ! 158 157 IF( ln_rstart .AND. & !* Restart: read in restart file 159 & iom_varid( numror, 'rnf_b', ldstop = .FALSE. ) > 0 ) THEN 158 & iom_varid( numror, 'rnf_b', ldstop = .FALSE. ) > 0 ) THEN 160 159 IF(lwp) WRITE(numout,*) ' nit000-1 runoff forcing fields red in the restart file' 161 160 CALL iom_get( numror, jpdom_autoglo, 'rnf_b', rnf_b ) ! before runoff … … 164 163 ELSE !* no restart: set from nit000 values 165 164 IF(lwp) WRITE(numout,*) ' nit000-1 runoff forcing fields set to nit000' 166 rnf_b (:,: ) = rnf (:,: ) 167 rnf_tsc_b(:,:,:) = rnf_tsc(:,:,:) 165 rnf_b (:,: ) = rnf (:,: ) 166 rnf_tsc_b(:,:,:) = rnf_tsc(:,:,:) 168 167 ENDIF 169 168 ENDIF … … 186 185 !!---------------------------------------------------------------------- 187 186 !! *** ROUTINE sbc_rnf *** 188 !! 187 !! 189 188 !! ** Purpose : update the horizontal divergence with the runoff inflow 190 189 !! 191 !! ** Method : 192 !! CAUTION : rnf is positive (inflow) decreasing the 190 !! ** Method : 191 !! CAUTION : rnf is positive (inflow) decreasing the 193 192 !! divergence and expressed in m/s 194 193 !! … … 204 203 ! 205 204 IF( ln_rnf_depth ) THEN !== runoff distributed over several levels ==! 206 IF( lk_vvl ) THEN ! variable volume case 205 IF( lk_vvl ) THEN ! variable volume case 207 206 DO jj = 1, jpj ! update the depth over which runoffs are distributed 208 207 DO ji = 1, jpi 209 h_rnf(ji,jj) = 0._wp 208 h_rnf(ji,jj) = 0._wp 210 209 DO jk = 1, nk_rnf(ji,jj) ! recalculates h_rnf to be the depth in metres 211 h_rnf(ji,jj) = h_rnf(ji,jj) + fse3t(ji,jj,jk) ! to the bottom of the relevant grid box 212 END DO 210 h_rnf(ji,jj) = h_rnf(ji,jj) + fse3t(ji,jj,jk) ! to the bottom of the relevant grid box 211 END DO 213 212 ! ! apply the runoff input flow 214 213 DO jk = 1, nk_rnf(ji,jj) … … 246 245 !! ** Action : - read parameters 247 246 !!---------------------------------------------------------------------- 248 CHARACTER(len=32) :: rn_dep_file ! runoff file name 247 CHARACTER(len=32) :: rn_dep_file ! runoff file name 249 248 INTEGER :: ji, jj, jk ! dummy loop indices 250 249 INTEGER :: ierror, inum ! temporary integer 251 250 ! 252 251 NAMELIST/namsbc_rnf/ cn_dir, ln_rnf_emp, ln_rnf_depth, ln_rnf_tem, ln_rnf_sal, & 253 & sn_rnf, sn_cnf , sn_s_rnf , sn_t_rnf , sn_dep_rnf, & 254 & ln_rnf_mouth , rn_hrnf , rn_avt_rnf, rn_rfact 252 & sn_rnf, sn_cnf , sn_s_rnf , sn_t_rnf , sn_dep_rnf, & 253 & ln_rnf_mouth , rn_hrnf , rn_avt_rnf, rn_rfact 255 254 !!---------------------------------------------------------------------- 256 255 ! … … 264 263 sn_cnf = FLD_N( 'runoffs', 0 , 'sorunoff' , .FALSE. , .true. , 'yearly' , '' , '' ) 265 264 266 sn_s_rnf = FLD_N( 'runoffs', 24. , 'rosaline' , .TRUE. , .true. , 'yearly' , '' , '' ) 267 sn_t_rnf = FLD_N( 'runoffs', 24. , 'rotemper' , .TRUE. , .true. , 'yearly' , '' , '' ) 268 sn_dep_rnf = FLD_N( 'runoffs', 0. , 'rodepth' , .FALSE. , .true. , 'yearly' , '' , '' ) 265 sn_s_rnf = FLD_N( 'runoffs', 24. , 'rosaline' , .TRUE. , .true. , 'yearly' , '' , '' ) 266 sn_t_rnf = FLD_N( 'runoffs', 24. , 'rotemper' , .TRUE. , .true. , 'yearly' , '' , '' ) 267 sn_dep_rnf = FLD_N( 'runoffs', 0. , 'rodepth' , .FALSE. , .true. , 'yearly' , '' , '' ) 269 268 ! 270 269 REWIND ( numnam ) ! Read Namelist namsbc_rnf … … 281 280 WRITE(numout,*) ' river mouth additional Kz rn_avt_rnf = ', rn_avt_rnf 282 281 WRITE(numout,*) ' depth of river mouth additional mixing rn_hrnf = ', rn_hrnf 283 WRITE(numout,*) ' multiplicative factor for runoff rn_rfact = ', rn_rfact 282 WRITE(numout,*) ' multiplicative factor for runoff rn_rfact = ', rn_rfact 284 283 ENDIF 285 284 ! … … 294 293 IF(lwp) WRITE(numout,*) ' runoffs directly provided in the precipitations' 295 294 IF( ln_rnf_depth .OR. ln_rnf_tem .OR. ln_rnf_sal ) THEN 296 CALL ctl_warn( 'runoffs already included in precipitations, so runoff (T,S, depth) attributes will not be used' ) 295 CALL ctl_warn( 'runoffs already included in precipitations, so runoff (T,S, depth) attributes will not be used' ) 297 296 ln_rnf_depth = .FALSE. ; ln_rnf_tem = .FALSE. ; ln_rnf_sal = .FALSE. 298 297 ENDIF … … 320 319 ALLOCATE( sf_t_rnf(1)%fnow(jpi,jpj,1) ) 321 320 IF( sn_t_rnf%ln_tint ) ALLOCATE( sf_t_rnf(1)%fdta(jpi,jpj,1,2) ) 322 CALL fld_fill (sf_t_rnf, (/ sn_t_rnf /), cn_dir, 'sbc_rnf_init', 'read runoff temperature data', 'namsbc_rnf' ) 321 CALL fld_fill (sf_t_rnf, (/ sn_t_rnf /), cn_dir, 'sbc_rnf_init', 'read runoff temperature data', 'namsbc_rnf' ) 323 322 ENDIF 324 323 ! … … 332 331 ALLOCATE( sf_s_rnf(1)%fnow(jpi,jpj,1) ) 333 332 IF( sn_s_rnf%ln_tint ) ALLOCATE( sf_s_rnf(1)%fdta(jpi,jpj,1,2) ) 334 CALL fld_fill (sf_s_rnf, (/ sn_s_rnf /), cn_dir, 'sbc_rnf_init', 'read runoff salinity data', 'namsbc_rnf' ) 335 ENDIF 336 ! 337 IF( ln_rnf_depth ) THEN ! depth of runoffs set from a file 333 CALL fld_fill (sf_s_rnf, (/ sn_s_rnf /), cn_dir, 'sbc_rnf_init', 'read runoff salinity data', 'namsbc_rnf' ) 334 ENDIF 335 ! 336 IF( ln_rnf_depth ) THEN ! depth of runoffs set from a file 338 337 IF(lwp) WRITE(numout,*) 339 338 IF(lwp) WRITE(numout,*) ' runoffs depth read in a file' 340 rn_dep_file = TRIM( cn_dir )//TRIM( sn_dep_rnf%clname ) 341 CALL iom_open ( rn_dep_file, inum ) ! open file 342 CALL iom_get ( inum, jpdom_data, sn_dep_rnf%clvar, h_rnf ) ! read the river mouth array 343 CALL iom_close( inum ) ! close file 339 rn_dep_file = TRIM( cn_dir )//TRIM( sn_dep_rnf%clname ) 340 CALL iom_open ( rn_dep_file, inum ) ! open file 341 CALL iom_get ( inum, jpdom_data, sn_dep_rnf%clvar, h_rnf ) ! read the river mouth array 342 CALL iom_close( inum ) ! close file 344 343 ! 345 344 nk_rnf(:,:) = 0 ! set the number of level over which river runoffs are applied 346 DO jj = 1, jpj 347 DO ji = 1, jpi 348 IF( h_rnf(ji,jj) > 0._wp ) THEN 349 jk = 2 350 DO WHILE ( jk /= mbkt(ji,jj) .AND. fsdept(ji,jj,jk) < h_rnf(ji,jj) ) ; jk = jk + 1 ; END DO 351 nk_rnf(ji,jj) = jk 352 ELSEIF( h_rnf(ji,jj) == -1 ) THEN ; nk_rnf(ji,jj) = 1353 ELSEIF( h_rnf(ji,jj) == -999 ) THEN ; nk_rnf(ji,jj) = mbkt(ji,jj)354 ELSE IF( h_rnf(ji,jj) /= 0 ) THEN355 CALL ctl_stop( 'runoff depth not positive, and not -999 or -1, rnf value in file fort.999' ) 356 WRITE(999,*) 'ji, jj, rnf(ji,jj) :', ji, jj, rnf(ji,jj) 357 ENDIF 358 END DO 359 END DO 360 DO jj = 1, jpj ! set the associated depth 361 DO ji = 1, jpi 345 DO jj = 1, jpj 346 DO ji = 1, jpi 347 IF( h_rnf(ji,jj) > 0._wp ) THEN 348 jk = 2 349 DO WHILE ( jk /= mbkt(ji,jj) .AND. fsdept(ji,jj,jk) < h_rnf(ji,jj) ) ; jk = jk + 1 ; END DO 350 nk_rnf(ji,jj) = jk 351 ELSEIF( h_rnf(ji,jj) == -1._wp ) THEN ; nk_rnf(ji,jj) = 1 352 ELSEIF( h_rnf(ji,jj) == -999._wp ) THEN ; nk_rnf(ji,jj) = mbkt(ji,jj) 353 ELSE 354 CALL ctl_stop( 'runoff depth not positive, and not -999 or -1, rnf value in file fort.999' ) 355 WRITE(999,*) 'ji, jj, rnf(ji,jj) :', ji, jj, rnf(ji,jj) 356 ENDIF 357 END DO 358 END DO 359 DO jj = 1, jpj ! set the associated depth 360 DO ji = 1, jpi 362 361 h_rnf(ji,jj) = 0._wp 363 DO jk = 1, nk_rnf(ji,jj) 364 h_rnf(ji,jj) = h_rnf(ji,jj) + fse3t(ji,jj,jk) 362 DO jk = 1, nk_rnf(ji,jj) 363 h_rnf(ji,jj) = h_rnf(ji,jj) + fse3t(ji,jj,jk) 365 364 END DO 366 365 END DO 367 366 END DO 368 ELSE ! runoffs applied at the surface 369 nk_rnf(:,:) = 1 367 ELSE ! runoffs applied at the surface 368 nk_rnf(:,:) = 1 370 369 h_rnf (:,:) = fse3t(:,:,1) 371 ENDIF 372 ! 370 ENDIF 371 ! 373 372 ENDIF 374 373 ! … … 386 385 ! 387 386 IF ( ln_rnf_depth ) CALL ctl_warn( 'sbc_rnf_init: increased mixing turned on but effects may already', & 388 & 'be spread through depth by ln_rnf_depth' ) 387 & 'be spread through depth by ln_rnf_depth' ) 389 388 ! 390 389 nkrnf = 0 ! Number of level over which Kz increase … … 406 405 IF(lwp) WRITE(numout,*) 407 406 IF(lwp) WRITE(numout,*) ' No specific treatment at river mouths' 408 rnfmsk (:,:) = 0._wp 407 rnfmsk (:,:) = 0._wp 409 408 rnfmsk_z(:) = 0._wp 410 409 nkrnf = 0 … … 417 416 !!---------------------------------------------------------------------- 418 417 !! *** ROUTINE rnf_mouth *** 419 !! 418 !! 420 419 !! ** Purpose : define the river mouths mask 421 420 !! 422 421 !! ** Method : read the river mouth mask (=0/1) in the river runoff 423 !! climatological file. Defined a given vertical structure. 424 !! CAUTION, the vertical structure is hard coded on the 422 !! climatological file. Defined a given vertical structure. 423 !! CAUTION, the vertical structure is hard coded on the 425 424 !! first 5 levels. 426 425 !! This fields can be used to: 427 !! - set an upstream advection scheme 426 !! - set an upstream advection scheme 428 427 !! (ln_rnf_mouth=T and ln_traadv_cen2=T) 429 !! - increase vertical on the top nn_krnf vertical levels 428 !! - increase vertical on the top nn_krnf vertical levels 430 429 !! at river runoff input grid point (nn_krnf>=2, see step.F90) 431 430 !! - set to zero SSS restoring flux at river mouth grid points … … 437 436 CHARACTER(len=140) :: cl_rnfile ! runoff file name 438 437 !!---------------------------------------------------------------------- 439 ! 438 ! 440 439 IF(lwp) WRITE(numout,*) 441 440 IF(lwp) WRITE(numout,*) 'rnf_mouth : river mouth mask' … … 454 453 IF( nn_closea == 1 ) CALL clo_rnf( rnfmsk ) ! closed sea inflow set as ruver mouth 455 454 ! 456 rnfmsk_z(:) = 0._wp ! vertical structure 455 rnfmsk_z(:) = 0._wp ! vertical structure 457 456 rnfmsk_z(1) = 1.0 458 457 rnfmsk_z(2) = 1.0 ! ********** … … 460 459 rnfmsk_z(4) = 0.25 ! ********** 461 460 rnfmsk_z(5) = 0.125 462 ! 461 ! 463 462 END SUBROUTINE rnf_mouth 464 463 465 464 !!====================================================================== 466 465 END MODULE sbcrnf -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/OPA_SRC/SBC/sbcssr.F90
r3625 r3764 27 27 PRIVATE 28 28 29 PUBLIC sbc_ssr ! routine called in sbcmod 29 PUBLIC sbc_ssr ! routine called in sbcmod 30 PUBLIC sbc_ssr_init ! routine called in sbcmod 30 31 31 32 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: erp !: evaporation damping [kg/m2/s] … … 83 84 IF( nn_timing == 1 ) CALL timing_start('sbc_ssr') 84 85 ! 85 ! ! -------------------- !86 IF( kt == nit000 ) THEN ! First call kt=nit000 !87 ! ! -------------------- !88 ! !* set file information89 cn_dir = './' ! directory in which the model is executed90 ! ... default values (NB: frequency positive => hours, negative => months)91 ! ! file ! frequency ! variable ! time intep ! clim ! 'yearly' or ! weights ! rotation !92 ! ! name ! (hours) ! name ! (T/F) ! (T/F) ! 'monthly' ! filename ! pairs !93 sn_sst = FLD_N( 'sst' , 24 , 'sst' , .false. , .false. , 'yearly' , '' , '' )94 sn_sss = FLD_N( 'sss' , -1 , 'sss' , .true. , .false. , 'yearly' , '' , '' )95 96 REWIND ( numnam ) !* read in namlist namflx97 READ( numnam, namsbc_ssr )98 99 IF(lwp) THEN !* control print100 WRITE(numout,*)101 WRITE(numout,*) 'sbc_ssr : SST and/or SSS damping term '102 WRITE(numout,*) '~~~~~~~ '103 WRITE(numout,*) ' Namelist namsbc_ssr :'104 WRITE(numout,*) ' SST restoring term (Yes=1) nn_sstr = ', nn_sstr105 WRITE(numout,*) ' SSS damping term (Yes=1, salt flux) nn_sssr = ', nn_sssr106 WRITE(numout,*) ' (Yes=2, volume flux) '107 WRITE(numout,*) ' dQ/dT (restoring magnitude on SST) rn_dqdt = ', rn_dqdt, ' W/m2/K'108 WRITE(numout,*) ' dE/dS (restoring magnitude on SST) rn_deds = ', rn_deds, ' mm/day'109 WRITE(numout,*) ' flag to bound erp term ln_sssr_bnd = ', ln_sssr_bnd110 WRITE(numout,*) ' ABS(Max./Min.) erp threshold rn_sssr_bnd = ', rn_sssr_bnd, ' mm/day'111 ENDIF112 113 ! Allocate erp and qrp array114 ALLOCATE( qrp(jpi,jpj), erp(jpi,jpj), STAT=ierror )115 IF( ierror > 0 ) CALL ctl_stop( 'STOP', 'sbc_ssr: unable to allocate erp and qrp array' )116 117 IF( nn_sstr == 1 ) THEN !* set sf_sst structure & allocate arrays118 !119 ALLOCATE( sf_sst(1), STAT=ierror )120 IF( ierror > 0 ) CALL ctl_stop( 'STOP', 'sbc_ssr: unable to allocate sf_sst structure' )121 ALLOCATE( sf_sst(1)%fnow(jpi,jpj,1), STAT=ierror )122 IF( ierror > 0 ) CALL ctl_stop( 'STOP', 'sbc_ssr: unable to allocate sf_sst now array' )123 !124 ! fill sf_sst with sn_sst and control print125 CALL fld_fill( sf_sst, (/ sn_sst /), cn_dir, 'sbc_ssr', 'SST restoring term toward SST data', 'namsbc_ssr' )126 IF( sf_sst(1)%ln_tint ) ALLOCATE( sf_sst(1)%fdta(jpi,jpj,1,2), STAT=ierror )127 IF( ierror > 0 ) CALL ctl_stop( 'STOP', 'sbc_ssr: unable to allocate sf_sst data array' )128 !129 ENDIF130 !131 IF( nn_sssr >= 1 ) THEN ! set sf_sss structure & allocate arrays132 !133 ALLOCATE( sf_sss(1), STAT=ierror )134 IF( ierror > 0 ) CALL ctl_stop( 'STOP', 'sbc_ssr: unable to allocate sf_sss structure' )135 ALLOCATE( sf_sss(1)%fnow(jpi,jpj,1), STAT=ierror )136 IF( ierror > 0 ) CALL ctl_stop( 'STOP', 'sbc_ssr: unable to allocate sf_sss now array' )137 !138 ! fill sf_sss with sn_sss and control print139 CALL fld_fill( sf_sss, (/ sn_sss /), cn_dir, 'sbc_ssr', 'SSS restoring term toward SSS data', 'namsbc_ssr' )140 IF( sf_sss(1)%ln_tint ) ALLOCATE( sf_sss(1)%fdta(jpi,jpj,1,2), STAT=ierror )141 IF( ierror > 0 ) CALL ctl_stop( 'STOP', 'sbc_ssr: unable to allocate sf_sss data array' )142 !143 ENDIF144 !145 ! Initialize qrp and erp if no restoring146 IF( nn_sstr /= 1 ) qrp(:,:) = 0.e0147 IF( nn_sssr /= 1 .OR. nn_sssr /= 2 ) erp(:,:) = 0.e0148 ENDIF149 150 86 IF( nn_sstr + nn_sssr /= 0 ) THEN 151 87 ! … … 207 143 ! 208 144 END SUBROUTINE sbc_ssr 145 146 147 SUBROUTINE sbc_ssr_init 148 !!--------------------------------------------------------------------- 149 !! *** ROUTINE sbc_ssr_init *** 150 !! 151 !! ** Purpose : initialisation of surface damping term 152 !! 153 !! ** Method : - Read namelist namsbc_ssr 154 !! - Read observed SST and/or SSS if required 155 !!--------------------------------------------------------------------- 156 INTEGER :: ji, jj ! dummy loop indices 157 REAL(wp) :: zerp ! local scalar for evaporation damping 158 REAL(wp) :: zqrp ! local scalar for heat flux damping 159 REAL(wp) :: zsrp ! local scalar for unit conversion of rn_deds factor 160 REAL(wp) :: zerp_bnd ! local scalar for unit conversion of rn_epr_max factor 161 INTEGER :: ierror ! return error code 162 !! 163 CHARACTER(len=100) :: cn_dir ! Root directory for location of ssr files 164 TYPE(FLD_N) :: sn_sst, sn_sss ! informations about the fields to be read 165 NAMELIST/namsbc_ssr/ cn_dir, nn_sstr, nn_sssr, rn_dqdt, rn_deds, sn_sst, sn_sss, ln_sssr_bnd, rn_sssr_bnd 166 !!---------------------------------------------------------------------- 167 ! 168 ! !* set file information 169 cn_dir = './' ! directory in which the model is executed 170 ! ... default values (NB: frequency positive => hours, negative => months) 171 ! ! file ! frequency ! variable ! time intep ! clim ! 'yearly' or ! weights ! rotation ! 172 ! ! name ! (hours) ! name ! (T/F) ! (T/F) ! 'monthly' ! filename ! pairs ! 173 sn_sst = FLD_N( 'sst' , 24 , 'sst' , .false. , .false. , 'yearly' , '' , '' ) 174 sn_sss = FLD_N( 'sss' , -1 , 'sss' , .true. , .false. , 'yearly' , '' , '' ) 175 176 REWIND( numnam ) !* read in namlist namflx 177 READ ( numnam, namsbc_ssr ) 178 179 IF(lwp) THEN !* control print 180 WRITE(numout,*) 181 WRITE(numout,*) 'sbc_ssr : SST and/or SSS damping term ' 182 WRITE(numout,*) '~~~~~~~ ' 183 WRITE(numout,*) ' Namelist namsbc_ssr :' 184 WRITE(numout,*) ' SST restoring term (Yes=1) nn_sstr = ', nn_sstr 185 WRITE(numout,*) ' SSS damping term (Yes=1, salt flux) nn_sssr = ', nn_sssr 186 WRITE(numout,*) ' (Yes=2, volume flux) ' 187 WRITE(numout,*) ' dQ/dT (restoring magnitude on SST) rn_dqdt = ', rn_dqdt, ' W/m2/K' 188 WRITE(numout,*) ' dE/dS (restoring magnitude on SST) rn_deds = ', rn_deds, ' mm/day' 189 WRITE(numout,*) ' flag to bound erp term ln_sssr_bnd = ', ln_sssr_bnd 190 WRITE(numout,*) ' ABS(Max./Min.) erp threshold rn_sssr_bnd = ', rn_sssr_bnd, ' mm/day' 191 ENDIF 192 ! 193 ! !* Allocate erp and qrp array 194 ALLOCATE( qrp(jpi,jpj), erp(jpi,jpj), STAT=ierror ) 195 IF( ierror > 0 ) CALL ctl_stop( 'STOP', 'sbc_ssr: unable to allocate erp and qrp array' ) 196 ! 197 IF( nn_sstr == 1 ) THEN !* set sf_sst structure & allocate arrays 198 ! 199 ALLOCATE( sf_sst(1), STAT=ierror ) 200 IF( ierror > 0 ) CALL ctl_stop( 'STOP', 'sbc_ssr: unable to allocate sf_sst structure' ) 201 ALLOCATE( sf_sst(1)%fnow(jpi,jpj,1), STAT=ierror ) 202 IF( ierror > 0 ) CALL ctl_stop( 'STOP', 'sbc_ssr: unable to allocate sf_sst now array' ) 203 ! 204 ! fill sf_sst with sn_sst and control print 205 CALL fld_fill( sf_sst, (/ sn_sst /), cn_dir, 'sbc_ssr', 'SST restoring term toward SST data', 'namsbc_ssr' ) 206 IF( sf_sst(1)%ln_tint ) ALLOCATE( sf_sst(1)%fdta(jpi,jpj,1,2), STAT=ierror ) 207 IF( ierror > 0 ) CALL ctl_stop( 'STOP', 'sbc_ssr: unable to allocate sf_sst data array' ) 208 ! 209 ENDIF 210 ! 211 IF( nn_sssr >= 1 ) THEN !* set sf_sss structure & allocate arrays 212 ! 213 ALLOCATE( sf_sss(1), STAT=ierror ) 214 IF( ierror > 0 ) CALL ctl_stop( 'STOP', 'sbc_ssr: unable to allocate sf_sss structure' ) 215 ALLOCATE( sf_sss(1)%fnow(jpi,jpj,1), STAT=ierror ) 216 IF( ierror > 0 ) CALL ctl_stop( 'STOP', 'sbc_ssr: unable to allocate sf_sss now array' ) 217 ! 218 ! fill sf_sss with sn_sss and control print 219 CALL fld_fill( sf_sss, (/ sn_sss /), cn_dir, 'sbc_ssr', 'SSS restoring term toward SSS data', 'namsbc_ssr' ) 220 IF( sf_sss(1)%ln_tint ) ALLOCATE( sf_sss(1)%fdta(jpi,jpj,1,2), STAT=ierror ) 221 IF( ierror > 0 ) CALL ctl_stop( 'STOP', 'sbc_ssr: unable to allocate sf_sss data array' ) 222 ! 223 ENDIF 224 ! 225 ! !* Initialize qrp and erp if no restoring 226 IF( nn_sstr /= 1 ) qrp(:,:) = 0._wp 227 IF( nn_sssr /= 1 .OR. nn_sssr /= 2 ) erp(:,:) = 0._wp 228 ! 229 END SUBROUTINE sbc_ssr_init 209 230 210 231 !!====================================================================== -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/OPA_SRC/SOL/solver.F90
r3294 r3764 83 83 84 84 ! ! allocate solver arrays 85 IF( sol_oce_alloc() /= 0 ) CALL ctl_stop( 'STOP', 'solver_init : unable to allocate sol_oce arrays' ) 85 IF( .NOT. lk_agrif .OR. .NOT. ln_rstart) THEN 86 IF( sol_oce_alloc() /= 0 ) CALL ctl_stop( 'STOP', 'solver_init : unable to allocate sol_oce arrays' ) 87 ENDIF 86 88 87 89 SELECT CASE( nn_solv ) !* parameter check -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/OPA_SRC/TRA/trabbl.F90
r3294 r3764 8 8 !! NEMO 1.0 ! 2002-08 (G. Madec) free form + modules 9 9 !! - ! 2004-01 (A. de Miranda, G. Madec, J.M. Molines ) add advective bbl 10 !! 3.3 ! 2009-11 (G. Madec) merge trabbl and trabbl_adv + style + optimization 11 !! - ! 2010-04 (G. Madec) Campin & Goosse advective bbl 10 !! 3.3 ! 2009-11 (G. Madec) merge trabbl and trabbl_adv + style + optimization 11 !! - ! 2010-04 (G. Madec) Campin & Goosse advective bbl 12 12 !! - ! 2010-06 (C. Ethe, G. Madec) merge TRA-TRC 13 13 !! - ! 2010-11 (G. Madec) add mbk. arrays associated to the deepest ocean level … … 30 30 USE trdmod_oce ! trends: ocean variables 31 31 USE trdtra ! trends: active tracers 32 USE iom ! IOM server 32 USE iom ! IOM server 33 33 USE in_out_manager ! I/O manager 34 34 USE lbclnk ! ocean lateral boundary conditions … … 49 49 LOGICAL, PUBLIC, PARAMETER :: lk_trabbl = .TRUE. !: bottom boundary layer flag 50 50 51 ! !!* Namelist nambbl * 51 ! !!* Namelist nambbl * 52 52 INTEGER , PUBLIC :: nn_bbl_ldf = 0 !: =1 : diffusive bbl or not (=0) 53 53 INTEGER , PUBLIC :: nn_bbl_adv = 0 !: =1/2 : advective bbl or not (=0) … … 58 58 59 59 LOGICAL , PUBLIC :: l_bbl !: flag to compute bbl diffu. flux coef and transport 60 60 61 61 REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:), PUBLIC :: utr_bbl , vtr_bbl ! u- (v-) transport in the bottom boundary layer 62 62 REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:), PUBLIC :: ahu_bbl , ahv_bbl ! masked diffusive bbl coeff. at u & v-pts 63 63 64 INTEGER , ALLOCATABLE, SAVE, DIMENSION(:,:) :: mbku_d , mbkv_d ! vertical index of the "lower" bottom ocean U/V-level65 INTEGER , ALLOCATABLE, SAVE, DIMENSION(:,:) :: mgrhu , mgrhv ! = +/-1, sign of grad(H) in u-(v-)direction66 REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) :: ahu_bbl_0, ahv_bbl_0 ! diffusive bbl flux coefficients at u and v-points67 REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) :: e3u_bbl_0, e3v_bbl_0 ! thichness of the bbl (e3) at u and v-points68 REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) :: r1_e1e2t ! inverse of the cell surface at t-point [1/m2]64 INTEGER , ALLOCATABLE, SAVE, DIMENSION(:,:), PUBLIC :: mbku_d , mbkv_d ! vertical index of the "lower" bottom ocean U/V-level (PUBLIC for TAM) 65 INTEGER , ALLOCATABLE, SAVE, DIMENSION(:,:), PUBLIC :: mgrhu , mgrhv ! = +/-1, sign of grad(H) in u-(v-)direction (PUBLIC for TAM) 66 REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) :: ahu_bbl_0, ahv_bbl_0 ! diffusive bbl flux coefficients at u and v-points 67 REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:), PUBLIC :: e3u_bbl_0, e3v_bbl_0 ! thichness of the bbl (e3) at u and v-points (PUBLIC for TAM) 68 REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:), PUBLIC :: r1_e1e2t ! inverse of the cell surface at t-point [1/m2] (PUBLIC for TAM) 69 69 70 70 !! * Substitutions … … 95 95 !!---------------------------------------------------------------------- 96 96 !! *** ROUTINE bbl *** 97 !! 98 !! ** Purpose : Compute the before tracer (t & s) trend associated 97 !! 98 !! ** Purpose : Compute the before tracer (t & s) trend associated 99 99 !! with the bottom boundary layer and add it to the general 100 100 !! trend of tracer equations. … … 103 103 !! diffusive and/or advective contribution to the tracer trend 104 104 !! is added to the general tracer trend 105 !!---------------------------------------------------------------------- 106 INTEGER, INTENT( in ) :: kt ! ocean time-step 105 !!---------------------------------------------------------------------- 106 INTEGER, INTENT( in ) :: kt ! ocean time-step 107 107 !! 108 108 REAL(wp), POINTER, DIMENSION(:,:,:) :: ztrdt, ztrds … … 112 112 ! 113 113 IF( l_trdtra ) THEN !* Save ta and sa trends 114 CALL wrk_alloc( jpi, jpj, jpk, ztrdt, ztrds ) 115 ztrdt(:,:,:) = tsa(:,:,:,jp_tem) 114 CALL wrk_alloc( jpi, jpj, jpk, ztrdt, ztrds ) 115 ztrdt(:,:,:) = tsa(:,:,:,jp_tem) 116 116 ztrds(:,:,:) = tsa(:,:,:,jp_sal) 117 117 ENDIF 118 118 119 119 IF( l_bbl ) CALL bbl( kt, nit000, 'TRA' ) !* bbl coef. and transport (only if not already done in trcbbl) 120 120 121 121 IF( nn_bbl_ldf == 1 ) THEN !* Diffusive bbl 122 122 ! … … 125 125 CALL prt_ctl( tab3d_1=tsa(:,:,:,jp_tem), clinfo1=' bbl_ldf - Ta: ', mask1=tmask, & 126 126 & tab3d_2=tsa(:,:,:,jp_sal), clinfo2= ' Sa: ', mask2=tmask, clinfo3='tra' ) 127 ! lateral boundary conditions ; just need for outputs 127 ! lateral boundary conditions ; just need for outputs 128 128 CALL lbc_lnk( ahu_bbl, 'U', 1. ) ; CALL lbc_lnk( ahv_bbl, 'V', 1. ) 129 CALL iom_put( "ahu_bbl", ahu_bbl ) ! bbl diffusive flux i-coef 129 CALL iom_put( "ahu_bbl", ahu_bbl ) ! bbl diffusive flux i-coef 130 130 CALL iom_put( "ahv_bbl", ahv_bbl ) ! bbl diffusive flux j-coef 131 131 ! … … 138 138 CALL prt_ctl( tab3d_1=tsa(:,:,:,jp_tem), clinfo1=' bbl_adv - Ta: ', mask1=tmask, & 139 139 & tab3d_2=tsa(:,:,:,jp_sal), clinfo2= ' Sa: ', mask2=tmask, clinfo3='tra' ) 140 ! lateral boundary conditions ; just need for outputs 140 ! lateral boundary conditions ; just need for outputs 141 141 CALL lbc_lnk( utr_bbl, 'U', 1. ) ; CALL lbc_lnk( vtr_bbl, 'V', 1. ) 142 CALL iom_put( "uoce_bbl", utr_bbl ) ! bbl i-transport 142 CALL iom_put( "uoce_bbl", utr_bbl ) ! bbl i-transport 143 143 CALL iom_put( "voce_bbl", vtr_bbl ) ! bbl j-transport 144 144 ! … … 150 150 CALL trd_tra( kt, 'TRA', jp_tem, jptra_trd_bbl, ztrdt ) 151 151 CALL trd_tra( kt, 'TRA', jp_sal, jptra_trd_bbl, ztrds ) 152 CALL wrk_dealloc( jpi, jpj, jpk, ztrdt, ztrds ) 152 CALL wrk_dealloc( jpi, jpj, jpk, ztrdt, ztrds ) 153 153 ENDIF 154 154 ! … … 161 161 !!---------------------------------------------------------------------- 162 162 !! *** ROUTINE tra_bbl_dif *** 163 !! 163 !! 164 164 !! ** Purpose : Computes the bottom boundary horizontal and vertical 165 !! advection terms. 166 !! 167 !! ** Method : 165 !! advection terms. 166 !! 167 !! ** Method : 168 168 !! * diffusive bbl (nn_bbl_ldf=1) : 169 169 !! When the product grad( rho) * grad(h) < 0 (where grad is an … … 179 179 !! References : Beckmann, A., and R. Doscher, 1997, J. Phys.Oceanogr., 581-591. 180 180 !! Campin, J.-M., and H. Goosse, 1999, Tellus, 412-430. 181 !!---------------------------------------------------------------------- 181 !!---------------------------------------------------------------------- 182 182 ! 183 183 INTEGER , INTENT(in ) :: kjpt ! number of tracers 184 184 REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(in ) :: ptb ! before and now tracer fields 185 REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(inout) :: pta ! tracer trend 185 REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(inout) :: pta ! tracer trend 186 186 ! 187 187 INTEGER :: ji, jj, jn ! dummy loop indices … … 202 202 #else 203 203 DO jj = 1, jpj 204 DO ji = 1, jpi 204 DO ji = 1, jpi 205 205 #endif 206 206 ik = mbkt(ji,jj) ! bottom T-level index … … 233 233 ! 234 234 END SUBROUTINE tra_bbl_dif 235 235 236 236 237 237 SUBROUTINE tra_bbl_adv( ptb, pta, kjpt ) … … 239 239 !! *** ROUTINE trc_bbl *** 240 240 !! 241 !! ** Purpose : Compute the before passive tracer trend associated 241 !! ** Purpose : Compute the before passive tracer trend associated 242 242 !! with the bottom boundary layer and add it to the general trend 243 243 !! of tracer equations. 244 244 !! ** Method : advective bbl (nn_bbl_adv = 1 or 2) : 245 245 !! nn_bbl_adv = 1 use of the ocean near bottom velocity as bbl velocity 246 !! nn_bbl_adv = 2 follow Campin and Goosse (1999) implentation i.e. 247 !! transport proportional to the along-slope density gradient 246 !! nn_bbl_adv = 2 follow Campin and Goosse (1999) implentation i.e. 247 !! transport proportional to the along-slope density gradient 248 248 !! 249 249 !! References : Beckmann, A., and R. Doscher, 1997, J. Phys.Oceanogr., 581-591. 250 250 !! Campin, J.-M., and H. Goosse, 1999, Tellus, 412-430. 251 !!---------------------------------------------------------------------- 251 !!---------------------------------------------------------------------- 252 252 INTEGER , INTENT(in ) :: kjpt ! number of tracers 253 253 REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(in ) :: ptb ! before and now tracer fields 254 REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(inout) :: pta ! tracer trend 254 REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(inout) :: pta ! tracer trend 255 255 ! 256 256 INTEGER :: ji, jj, jk, jn ! dummy loop indices … … 264 264 ! ! =========== 265 265 DO jn = 1, kjpt ! tracer loop 266 ! ! =========== 266 ! ! =========== 267 267 # if defined key_vectopt_loop 268 268 DO jj = 1, 1 … … 282 282 ztra = zu_bbl * ( ptb(iid,jj,ikus,jn) - ptb(iis,jj,ikus,jn) ) * zbtr 283 283 pta(iis,jj,ikus,jn) = pta(iis,jj,ikus,jn) + ztra 284 ! 284 ! 285 285 DO jk = ikus, ikud-1 ! down-slope upper to down T-point (deep column) 286 286 zbtr = r1_e1e2t(iid,jj) / fse3t(iid,jj,jk) … … 288 288 pta(iid,jj,jk,jn) = pta(iid,jj,jk,jn) + ztra 289 289 END DO 290 ! 290 ! 291 291 zbtr = r1_e1e2t(iid,jj) / fse3t(iid,jj,ikud) 292 292 ztra = zu_bbl * ( ptb(iis,jj,ikus,jn) - ptb(iid,jj,ikud,jn) ) * zbtr … … 299 299 ikvd = mbkv_d(ji,jj) ; ikvs = mbkv(ji,jj) 300 300 zv_bbl = ABS( vtr_bbl(ji,jj) ) 301 ! 301 ! 302 302 ! up -slope T-point (shelf bottom point) 303 303 zbtr = r1_e1e2t(ji,ijs) / fse3t(ji,ijs,ikvs) 304 304 ztra = zv_bbl * ( ptb(ji,ijd,ikvs,jn) - ptb(ji,ijs,ikvs,jn) ) * zbtr 305 305 pta(ji,ijs,ikvs,jn) = pta(ji,ijs,ikvs,jn) + ztra 306 ! 306 ! 307 307 DO jk = ikvs, ikvd-1 ! down-slope upper to down T-point (deep column) 308 308 zbtr = r1_e1e2t(ji,ijd) / fse3t(ji,ijd,jk) … … 330 330 !!---------------------------------------------------------------------- 331 331 !! *** ROUTINE bbl *** 332 !! 332 !! 333 333 !! ** Purpose : Computes the bottom boundary horizontal and vertical 334 !! advection terms. 335 !! 336 !! ** Method : 334 !! advection terms. 335 !! 336 !! ** Method : 337 337 !! * diffusive bbl (nn_bbl_ldf=1) : 338 338 !! When the product grad( rho) * grad(h) < 0 (where grad is an … … 353 353 !! References : Beckmann, A., and R. Doscher, 1997, J. Phys.Oceanogr., 581-591. 354 354 !! Campin, J.-M., and H. Goosse, 1999, Tellus, 412-430. 355 !!---------------------------------------------------------------------- 355 !!---------------------------------------------------------------------- 356 356 ! 357 357 INTEGER , INTENT(in ) :: kt ! ocean time-step index … … 399 399 - 0.121555e-07 ) * pfh 400 400 !!---------------------------------------------------------------------- 401 401 402 402 ! 403 403 IF( nn_timing == 1 ) CALL timing_start( 'bbl') 404 404 ! 405 CALL wrk_alloc( jpi, jpj, zub, zvb, ztb, zsb, zdep ) 406 ! 407 405 CALL wrk_alloc( jpi, jpj, zub, zvb, ztb, zsb, zdep ) 406 ! 407 408 408 IF( kt == kit000 ) THEN 409 409 IF(lwp) WRITE(numout,*) … … 411 411 IF(lwp) WRITE(numout,*) '~~~~~~~~~~' 412 412 ENDIF 413 413 414 414 ! !* bottom temperature, salinity, velocity and depth 415 415 #if defined key_vectopt_loop … … 426 426 ! 427 427 zub(ji,jj) = un(ji,jj,mbku(ji,jj)) ! bottom velocity 428 zvb(ji,jj) = vn(ji,jj,mbkv(ji,jj)) 428 zvb(ji,jj) = vn(ji,jj,mbkv(ji,jj)) 429 429 END DO 430 430 END DO 431 431 432 432 ! !-------------------! 433 433 IF( nn_bbl_ldf == 1 ) THEN ! diffusive bbl ! 434 434 ! !-------------------! 435 435 DO jj = 1, jpjm1 ! (criteria for non zero flux: grad(rho).grad(h) < 0 ) 436 DO ji = 1, jpim1 437 ! ! i-direction 436 DO ji = 1, jpim1 437 ! ! i-direction 438 438 zt = 0.5 * ( ztb (ji,jj) + ztb (ji+1,jj) ) ! T, S anomalie, and depth 439 439 zs = 0.5 * ( zsb (ji,jj) + zsb (ji+1,jj) ) - 35.0 … … 442 442 zgdrho = ( fsalbt( zt, zs, zh ) * ( ztb(ji+1,jj) - ztb(ji,jj) ) & 443 443 & - ( zsb(ji+1,jj) - zsb(ji,jj) ) ) * umask(ji,jj,1) 444 ! 444 ! 445 445 zsign = SIGN( 0.5, - zgdrho * REAL( mgrhu(ji,jj) ) ) ! sign of ( i-gradient * i-slope ) 446 446 ahu_bbl(ji,jj) = ( 0.5 - zsign ) * ahu_bbl_0(ji,jj) ! masked diffusive flux coeff. 447 447 ! 448 ! ! j-direction 448 ! ! j-direction 449 449 zt = 0.5 * ( ztb (ji,jj+1) + ztb (ji,jj) ) ! T, S anomalie, and depth 450 450 zs = 0.5 * ( zsb (ji,jj+1) + zsb (ji,jj) ) - 35.0 … … 453 453 zgdrho = ( fsalbt( zt, zs, zh ) * ( ztb(ji,jj+1) - ztb(ji,jj) ) & 454 454 & - ( zsb(ji,jj+1) - zsb(ji,jj) ) ) * vmask(ji,jj,1) 455 ! 455 ! 456 456 zsign = SIGN( 0.5, -zgdrho * REAL( mgrhv(ji,jj) ) ) ! sign of ( j-gradient * j-slope ) 457 457 ahv_bbl(ji,jj) = ( 0.5 - zsign ) * ahv_bbl_0(ji,jj) … … 475 475 zh = 0.5 * ( zdep(ji,jj) + zdep(ji+1,jj) ) 476 476 ! ! masked bbl i-gradient of density 477 zgdrho = ( fsalbt( zt, zs, zh ) * ( ztb(ji+1,jj) - ztb(ji,jj) ) & 477 zgdrho = ( fsalbt( zt, zs, zh ) * ( ztb(ji+1,jj) - ztb(ji,jj) ) & 478 478 & - ( zsb(ji+1,jj) - zsb(ji,jj) ) ) * umask(ji,jj,1) 479 ! 479 ! 480 480 zsign = SIGN( 0.5, - zgdrho * REAL( mgrhu(ji,jj) ) ) ! sign of i-gradient * i-slope 481 481 zsigna= SIGN( 0.5, zub(ji,jj) * REAL( mgrhu(ji,jj) ) ) ! sign of u * i-slope … … 489 489 zh = 0.5 * ( zdep(ji,jj+1) + zdep(ji,jj) ) 490 490 ! ! masked bbl j-gradient of density 491 zgdrho = ( fsalbt( zt, zs, zh ) * ( ztb(ji,jj+1) - ztb(ji,jj) ) & 491 zgdrho = ( fsalbt( zt, zs, zh ) * ( ztb(ji,jj+1) - ztb(ji,jj) ) & 492 492 & - ( zsb(ji,jj+1) - zsb(ji,jj) ) ) * vmask(ji,jj,1) 493 493 zsign = SIGN( 0.5, - zgdrho * REAL( mgrhv(ji,jj) ) ) ! sign of j-gradient * j-slope … … 513 513 zh = 0.5 * ( zdep(ji,jj) + zdep(ji+1,jj) ) 514 514 zgdrho = fsbeta( zt, zs, zh ) & 515 & * ( fsalbt( zt, zs, zh ) * ( ztb(iid,jj) - ztb(iis,jj) ) & 515 & * ( fsalbt( zt, zs, zh ) * ( ztb(iid,jj) - ztb(iis,jj) ) & 516 516 & - ( zsb(iid,jj) - zsb(iis,jj) ) ) * umask(ji,jj,1) 517 517 zgdrho = MAX( 0.e0, zgdrho ) ! only if shelf is denser than deep … … 530 530 zh = 0.5 * ( zdep(ji,jj) + zdep(ji,jj+1) ) 531 531 zgdrho = fsbeta( zt, zs, zh ) & 532 & * ( fsalbt( zt, zs, zh ) * ( ztb(ji,ijd) - ztb(ji,ijs) ) & 532 & * ( fsalbt( zt, zs, zh ) * ( ztb(ji,ijd) - ztb(ji,ijs) ) & 533 533 & - ( zsb(ji,ijd) - zsb(ji,ijs) ) ) * vmask(ji,jj,1) 534 534 zgdrho = MAX( 0.e0, zgdrho ) ! only if shelf is denser than deep … … 542 542 ENDIF 543 543 ! 544 CALL wrk_dealloc( jpi, jpj, zub, zvb, ztb, zsb, zdep ) 544 CALL wrk_dealloc( jpi, jpj, zub, zvb, ztb, zsb, zdep ) 545 545 ! 546 546 IF( nn_timing == 1 ) CALL timing_stop( 'bbl') … … 567 567 IF( nn_timing == 1 ) CALL timing_start( 'tra_bbl_init') 568 568 ! 569 CALL wrk_alloc( jpi, jpj, zmbk ) 569 CALL wrk_alloc( jpi, jpj, zmbk ) 570 570 ! 571 571 … … 588 588 ! ! allocate trabbl arrays 589 589 IF( tra_bbl_alloc() /= 0 ) CALL ctl_stop( 'STOP', 'tra_bbl_init : unable to allocate arrays' ) 590 590 591 591 IF( nn_bbl_adv == 1 ) WRITE(numout,*) ' * Advective BBL using upper velocity' 592 592 IF( nn_bbl_adv == 2 ) WRITE(numout,*) ' * Advective BBL using velocity = F( delta rho)' … … 597 597 ! !* inverse of surface of T-cells 598 598 r1_e1e2t(:,:) = 1._wp / ( e1t(:,:) * e2t(:,:) ) 599 599 600 600 ! !* vertical index of "deep" bottom u- and v-points 601 601 DO jj = 1, jpjm1 ! (the "shelf" bottom k-indices are mbku and mbkv) … … 605 605 END DO 606 606 END DO 607 ! converte into REAL to use lbc_lnk ; impose a min value of 1 as a zero can be set in lbclnk 607 ! converte into REAL to use lbc_lnk ; impose a min value of 1 as a zero can be set in lbclnk 608 608 zmbk(:,:) = REAL( mbku_d(:,:), wp ) ; CALL lbc_lnk(zmbk,'U',1.) ; mbku_d(:,:) = MAX( INT( zmbk(:,:) ), 1 ) 609 609 zmbk(:,:) = REAL( mbkv_d(:,:), wp ) ; CALL lbc_lnk(zmbk,'V',1.) ; mbkv_d(:,:) = MAX( INT( zmbk(:,:) ), 1 ) … … 611 611 !* sign of grad(H) at u- and v-points 612 612 mgrhu(jpi,:) = 0. ; mgrhu(:,jpj) = 0. ; mgrhv(jpi,:) = 0. ; mgrhv(:,jpj) = 0. 613 DO jj = 1, jpjm1 613 DO jj = 1, jpjm1 614 614 DO ji = 1, jpim1 615 615 mgrhu(ji,jj) = INT( SIGN( 1.e0, fsdept_0(ji+1,jj,mbkt(ji+1,jj)) - fsdept_0(ji,jj,mbkt(ji,jj)) ) ) … … 618 618 END DO 619 619 620 DO jj = 1, jpjm1 !* bbl thickness at u- (v-) point 620 DO jj = 1, jpjm1 !* bbl thickness at u- (v-) point 621 621 DO ji = 1, jpim1 ! minimum of top & bottom e3u_0 (e3v_0) 622 e3u_bbl_0(ji,jj) = MIN( fse3u_0(ji,jj,mbkt(ji+1,jj )), fse3u_0(ji,jj,mbkt(ji,jj)) ) 623 e3v_bbl_0(ji,jj) = MIN( fse3v_0(ji,jj,mbkt(ji ,jj+1)), fse3v_0(ji,jj,mbkt(ji,jj)) ) 624 END DO 622 e3u_bbl_0(ji,jj) = MIN( fse3u_0(ji,jj,mbkt(ji+1,jj )), fse3u_0(ji,jj,mbkt(ji,jj)) ) 623 e3v_bbl_0(ji,jj) = MIN( fse3v_0(ji,jj,mbkt(ji ,jj+1)), fse3v_0(ji,jj,mbkt(ji,jj)) ) 624 END DO 625 625 END DO 626 626 CALL lbc_lnk( e3u_bbl_0, 'U', 1. ) ; CALL lbc_lnk( e3v_bbl_0, 'V', 1. ) ! lateral boundary conditions 627 627 628 ! !* masked diffusive flux coefficients 628 ! !* masked diffusive flux coefficients 629 629 ahu_bbl_0(:,:) = rn_ahtbbl * e2u(:,:) * e3u_bbl_0(:,:) / e1u(:,:) * umask(:,:,1) 630 630 ahv_bbl_0(:,:) = rn_ahtbbl * e1v(:,:) * e3v_bbl_0(:,:) / e2v(:,:) * vmask(:,:,1) … … 636 636 CASE ( 2 ) ! ORCA_R2 637 637 ij0 = 102 ; ij1 = 102 ! Gibraltar enhancement of BBL 638 ii0 = 139 ; ii1 = 140 638 ii0 = 139 ; ii1 = 140 639 639 ahu_bbl_0(mi0(ii0):mi1(ii1),mj0(ij0):mj1(ij1)) = 4.e0*ahu_bbl_0(mi0(ii0):mi1(ii1),mj0(ij0):mj1(ij1)) 640 640 ahv_bbl_0(mi0(ii0):mi1(ii1),mj0(ij0):mj1(ij1)) = 4.e0*ahv_bbl_0(mi0(ii0):mi1(ii1),mj0(ij0):mj1(ij1)) … … 647 647 CASE ( 4 ) ! ORCA_R4 648 648 ij0 = 52 ; ij1 = 52 ! Gibraltar enhancement of BBL 649 ii0 = 70 ; ii1 = 71 649 ii0 = 70 ; ii1 = 71 650 650 ahu_bbl_0(mi0(ii0):mi1(ii1),mj0(ij0):mj1(ij1)) = 4.e0*ahu_bbl_0(mi0(ii0):mi1(ii1),mj0(ij0):mj1(ij1)) 651 651 ahv_bbl_0(mi0(ii0):mi1(ii1),mj0(ij0):mj1(ij1)) = 4.e0*ahv_bbl_0(mi0(ii0):mi1(ii1),mj0(ij0):mj1(ij1)) … … 654 654 ENDIF 655 655 ! 656 CALL wrk_dealloc( jpi, jpj, zmbk ) 656 CALL wrk_dealloc( jpi, jpj, zmbk ) 657 657 ! 658 658 IF( nn_timing == 1 ) CALL timing_stop( 'tra_bbl_init') -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/OPA_SRC/TRA/trasbc.F90
r3680 r3764 209 209 !---------------------------------------- 210 210 ! 211 zfact = 0.5e0 212 213 ! Effect on (t,s) due to river runoff (dilution effect automatically applied via vertical tracer advection) 214 IF( ln_rnf ) THEN 211 IF( ln_rnf ) THEN ! input of heat and salt due to river runoff 212 zfact = 0.5_wp 215 213 DO jj = 2, jpj 216 214 DO ji = fs_2, fs_jpim1 217 zdep = 1. / h_rnf(ji,jj) 218 zdep = zfact * zdep 219 IF ( rnf(ji,jj) /= 0._wp ) THEN 215 IF( rnf(ji,jj) /= 0._wp ) THEN 216 zdep = zfact / h_rnf(ji,jj) 220 217 DO jk = 1, nk_rnf(ji,jj) 221 218 tsa(ji,jj,jk,jp_tem) = tsa(ji,jj,jk,jp_tem) & … … 227 224 END DO 228 225 END DO 229 ENDIF 230 !!gm It should be useless 231 CALL lbc_lnk( tsa(:,:,:,jp_tem), 'T', 1. ) ; CALL lbc_lnk( tsa(:,:,:,jp_sal), 'T', 1. ) 232 226 ENDIF 227 233 228 IF( l_trdtra ) THEN ! save the horizontal diffusive trends for further diagnostics 234 229 ztrdt(:,:,:) = tsa(:,:,:,jp_tem) - ztrdt(:,:,:) -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfbfr.F90
r3633 r3764 18 18 !!---------------------------------------------------------------------- 19 19 USE oce ! ocean dynamics and tracers variables 20 USE dom_oce ! ocean space and time domain variables 20 USE dom_oce ! ocean space and time domain variables 21 21 USE zdf_oce ! ocean vertical physics variables 22 22 USE in_out_manager ! I/O manager … … 35 35 36 36 ! !!* Namelist nambfr: bottom friction namelist * 37 INTEGER :: nn_bfr = 0 ! = 0/1/2/3 type of bottom friction38 REAL(wp) :: rn_bfri1 = 4.0e-4_wp ! bottom drag coefficient (linear case)39 REAL(wp) :: rn_bfri2 = 1.0e-3_wp ! bottom drag coefficient (non linear case)40 REAL(wp) :: rn_bfeb2 = 2.5e-3_wp ! background bottom turbulent kinetic energy [m2/s2]41 REAL(wp) :: rn_bfrien = 30._wp ! local factor to enhance coefficient bfri42 LOGICAL :: ln_bfr2d = .false. ! logical switch for 2D enhancement43 LOGICAL :: ln_loglayer = .false. ! switch for log layer bfr coeff.44 REAL(wp) :: rn_bfrz0 = 0.003_wp ! bottom roughness for loglayer bfr coeff45 LOGICAL , PUBLIC :: ln_bfrimp = .false. !switch for implicit bottom friction46 REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) :: bfrcoef2d ! 2D bottom drag coefficient37 INTEGER , PUBLIC :: nn_bfr = 0 ! = 0/1/2/3 type of bottom friction (PUBLIC for TAM) 38 REAL(wp), PUBLIC :: rn_bfri1 = 4.0e-4_wp ! bottom drag coefficient (linear case) (PUBLIC for TAM) 39 REAL(wp), PUBLIC :: rn_bfri2 = 1.0e-3_wp ! bottom drag coefficient (non linear case) (PUBLIC for TAM) 40 REAL(wp), PUBLIC :: rn_bfeb2 = 2.5e-3_wp ! background bottom turbulent kinetic energy [m2/s2] (PUBLIC for TAM) 41 REAL(wp), PUBLIC :: rn_bfrien = 30._wp ! local factor to enhance coefficient bfri (PUBLIC for TAM) 42 LOGICAL , PUBLIC :: ln_bfr2d = .false. ! logical switch for 2D enhancement (PUBLIC for TAM) 43 LOGICAL , PUBLIC :: ln_loglayer = .false. ! switch for log layer bfr coeff. (PUBLIC for TAM) 44 REAL(wp), PUBLIC :: rn_bfrz0 = 0.003_wp ! bottom roughness for loglayer bfr coeff (PUBLIC for TAM) 45 LOGICAL , PUBLIC :: ln_bfrimp = .false. ! logical switch for implicit bottom friction 46 REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:), PUBLIC :: bfrcoef2d ! 2D bottom drag coefficient (PUBLIC for TAM) 47 47 48 48 !! * Substitutions … … 70 70 !!---------------------------------------------------------------------- 71 71 !! *** ROUTINE zdf_bfr *** 72 !! 72 !! 73 73 !! ** Purpose : compute the bottom friction coefficient. 74 74 !! 75 !! ** Method : Calculate and store part of the momentum trend due 76 !! to bottom friction following the chosen friction type 75 !! ** Method : Calculate and store part of the momentum trend due 76 !! to bottom friction following the chosen friction type 77 77 !! (free-slip, linear, or quadratic). The component 78 78 !! calculated here is multiplied by the bottom velocity in … … 124 124 DO ji = 2, jpim1 125 125 # endif 126 ikbu = mbku(ji,jj) ! ocean bottom level at u- and v-points 126 ikbu = mbku(ji,jj) ! ocean bottom level at u- and v-points 127 127 ikbv = mbkv(ji,jj) ! (deepest ocean u- and v-points) 128 128 ! … … 135 135 zecv = SQRT( vn(ji,jj,ikbv) * vn(ji,jj,ikbv) + zuv*zuv + rn_bfeb2 ) 136 136 ! 137 bfrua(ji,jj) = - 0.5_wp * ( bfrcoef2d(ji,jj) + bfrcoef2d(ji+1,jj ) ) * zecu 137 bfrua(ji,jj) = - 0.5_wp * ( bfrcoef2d(ji,jj) + bfrcoef2d(ji+1,jj ) ) * zecu 138 138 bfrva(ji,jj) = - 0.5_wp * ( bfrcoef2d(ji,jj) + bfrcoef2d(ji ,jj+1) ) * zecv 139 139 END DO … … 156 156 !!---------------------------------------------------------------------- 157 157 !! *** ROUTINE zdf_bfr_init *** 158 !! 158 !! 159 159 !! ** Purpose : Initialization of the bottom friction 160 160 !! … … 217 217 bfrcoef2d(:,:) = rn_bfri1 ! initialize bfrcoef2d to the namelist variable 218 218 ! 219 IF(ln_bfr2d) THEN 219 IF(ln_bfr2d) THEN 220 220 ! bfr_coef is a coefficient in [0,1] giving the mask where to apply the bfr enhancement 221 221 CALL iom_open('bfr_coef.nc',inum) … … 238 238 239 239 ! 240 IF(ln_bfr2d) THEN 240 IF(ln_bfr2d) THEN 241 241 ! bfr_coef is a coefficient in [0,1] giving the mask where to apply the bfr enhancement 242 242 CALL iom_open('bfr_coef.nc',inum) -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfkpp.F90
r3625 r3764 247 247 #if defined key_zdfddm 248 248 REAL(wp) :: zrrau, zds, zavdds, zavddt,zinr ! double diffusion mixing 249 REAL(wp), POINTER, DIMENSION(:,:) :: zdifs250 REAL(wp), POINTER, DIMENSION(:) :: za2s, za3s, zkmps249 REAL(wp), POINTER, DIMENSION(:,:) :: zdifs 250 REAL(wp), POINTER, DIMENSION(:) :: za2s, za3s, zkmps 251 251 REAL(wp) :: zkm1s 252 REAL(wp), POINTER, DIMENSION(:,:) :: zblcs252 REAL(wp), POINTER, DIMENSION(:,:) :: zblcs 253 253 REAL(wp), POINTER, DIMENSION(:,:,:) :: zdiffus 254 254 #endif … … 266 266 CALL wrk_alloc( jpi,4, zdepw, zdift, zvisc ) 267 267 CALL wrk_alloc( jpi,jpj, zBo, zBosol, zustar ) 268 CALL wrk_alloc( jpi,jpk, zmask, zblcm, zblct , zblcs)268 CALL wrk_alloc( jpi,jpk, zmask, zblcm, zblct ) 269 269 #if defined key_zdfddm 270 270 CALL wrk_alloc( jpi,4, zdifs ) … … 1081 1081 zdiffut(ji,jj,jk) = zdiffut(ji,jj,jk) * tmask(ji,jj,jk) 1082 1082 #if defined key_zdfddm 1083 zdiffus(ji,jj,jk) = ( 1.0 - zmask(ji,jk) ) 1083 zdiffus(ji,jj,jk) = ( 1.0 - zmask(ji,jk) ) * avs (ji,jj,jk) & ! interior diffusivities 1084 1084 & + zflag * zblcs(ji,jk ) & ! boundary layer diffusivities 1085 1085 & + zmask(ji,jk) * ( 1.0 - zflag ) * zkmps(ji ) ! diffusivity enhancement at W_level near zhbl 1086 1087 1086 zdiffus(ji,jj,jk) = zdiffus(ji,jj,jk) * tmask(ji,jj,jk) 1088 1087 #endif … … 1212 1211 CALL wrk_dealloc( jpi,4, zdepw, zdift, zvisc ) 1213 1212 CALL wrk_dealloc( jpi,jpj, zBo, zBosol, zustar ) 1214 CALL wrk_dealloc( jpi,jpk, zmask, zblcm, zblct , zblcs)1213 CALL wrk_dealloc( jpi,jpk, zmask, zblcm, zblct ) 1215 1214 #if defined key_zdfddm 1216 1215 CALL wrk_dealloc( jpi,4, zdifs ) -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/OPA_SRC/lib_fortran.F90
r3632 r3764 8 8 9 9 !!---------------------------------------------------------------------- 10 !! glob_sum : generic interface for global masked summation over 10 !! glob_sum : generic interface for global masked summation over 11 11 !! the interior domain for 1 or 2 2D or 3D arrays 12 !! it works only for T points 12 !! it works only for T points 13 13 !! SIGN : generic interface for SIGN to overwrite f95 behaviour 14 14 !! of intrinsinc sign function … … 29 29 30 30 INTERFACE glob_sum 31 MODULE PROCEDURE glob_sum_2d, glob_sum_3d,glob_sum_2d_a, glob_sum_3d_a 31 MODULE PROCEDURE glob_sum_1d, glob_sum_2d, glob_sum_3d, & 32 & glob_sum_2d_a, glob_sum_3d_a 32 33 END INTERFACE 33 34 34 #if defined key_nosignedzero 35 #if defined key_nosignedzero 35 36 INTERFACE SIGN 36 37 MODULE PROCEDURE SIGN_SCALAR, SIGN_ARRAY_1D, SIGN_ARRAY_2D, SIGN_ARRAY_3D, & 37 & SIGN_ARRAY_1D_A, SIGN_ARRAY_2D_A, SIGN_ARRAY_3D_A, & 38 & SIGN_ARRAY_1D_B, SIGN_ARRAY_2D_B, SIGN_ARRAY_3D_B 38 & SIGN_ARRAY_1D_A, SIGN_ARRAY_2D_A, SIGN_ARRAY_3D_A, & 39 & SIGN_ARRAY_1D_B, SIGN_ARRAY_2D_B, SIGN_ARRAY_3D_B 39 40 END INTERFACE 40 41 #endif … … 42 43 !!---------------------------------------------------------------------- 43 44 !! NEMO/OPA 3.3 , NEMO Consortium (2010) 44 !! $Id$ 45 !! $Id$ 45 46 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 46 47 !!---------------------------------------------------------------------- 47 CONTAINS 48 CONTAINS 48 49 49 50 #if ! defined key_mpp_rep 50 51 FUNCTION glob_sum_2d( ptab ) 51 FUNCTION glob_sum_1d( ptab, kdim ) 52 !!----------------------------------------------------------------------- 53 !! *** FUNCTION glob_sum_1D *** 54 !! 55 !! ** Purpose : perform a masked sum on the inner global domain of a 1D array 56 !!----------------------------------------------------------------------- 57 INTEGER :: kdim 58 REAL(wp), INTENT(in), DIMENSION(kdim) :: ptab ! input 1D array 59 REAL(wp) :: glob_sum_1d ! global sum 60 !!----------------------------------------------------------------------- 61 ! 62 glob_sum_1d = SUM( ptab(:) ) 63 IF( lk_mpp ) CALL mpp_sum( glob_sum_1d ) 64 ! 65 END FUNCTION glob_sum_1d 66 67 FUNCTION glob_sum_2d( ptab ) 52 68 !!----------------------------------------------------------------------- 53 69 !! *** FUNCTION glob_sum_2D *** … … 63 79 ! 64 80 END FUNCTION glob_sum_2d 65 66 67 FUNCTION glob_sum_3d( ptab ) 81 82 83 FUNCTION glob_sum_3d( ptab ) 68 84 !!----------------------------------------------------------------------- 69 85 !! *** FUNCTION glob_sum_3D *** … … 86 102 87 103 88 FUNCTION glob_sum_2d_a( ptab1, ptab2 ) 104 FUNCTION glob_sum_2d_a( ptab1, ptab2 ) 89 105 !!----------------------------------------------------------------------- 90 106 !! *** FUNCTION glob_sum_2D _a *** … … 95 111 REAL(wp) , DIMENSION(2) :: glob_sum_2d_a ! global masked sum 96 112 !!----------------------------------------------------------------------- 97 ! 113 ! 98 114 glob_sum_2d_a(1) = SUM( ptab1(:,:)*tmask_i(:,:) ) 99 115 glob_sum_2d_a(2) = SUM( ptab2(:,:)*tmask_i(:,:) ) … … 101 117 ! 102 118 END FUNCTION glob_sum_2d_a 103 104 105 FUNCTION glob_sum_3d_a( ptab1, ptab2 ) 119 120 121 FUNCTION glob_sum_3d_a( ptab1, ptab2 ) 106 122 !!----------------------------------------------------------------------- 107 123 !! *** FUNCTION glob_sum_3D_a *** … … 124 140 END FUNCTION glob_sum_3d_a 125 141 126 #else 142 #else 127 143 !!---------------------------------------------------------------------- 128 144 !! 'key_mpp_rep' MPP reproducibility 129 145 !!---------------------------------------------------------------------- 130 131 FUNCTION glob_sum_2d( ptab ) 146 147 FUNCTION glob_sum_1d( ptab, kdim ) 148 !!---------------------------------------------------------------------- 149 !! *** FUNCTION glob_sum_1d *** 150 !! 151 !! ** Purpose : perform a sum in calling DDPDD routine 152 !!---------------------------------------------------------------------- 153 INTEGER , INTENT(in) :: kdim 154 REAL(wp), INTENT(in), DIMENSION(kdim) :: ptab 155 REAL(wp) :: glob_sum_1d ! global sum 156 !! 157 COMPLEX(wp):: ctmp 158 REAL(wp) :: ztmp 159 INTEGER :: ji ! dummy loop indices 160 !!----------------------------------------------------------------------- 161 ! 162 ztmp = 0.e0 163 ctmp = CMPLX( 0.e0, 0.e0, wp ) 164 DO ji = 1, kdim 165 ztmp = ptab(ji) 166 CALL DDPDD( CMPLX( ztmp, 0.e0, wp ), ctmp ) 167 END DO 168 IF( lk_mpp ) CALL mpp_sum( ctmp ) ! sum over the global domain 169 glob_sum_1d = REAL(ctmp,wp) 170 ! 171 END FUNCTION glob_sum_1d 172 173 FUNCTION glob_sum_2d( ptab ) 132 174 !!---------------------------------------------------------------------- 133 175 !! *** FUNCTION glob_sum_2d *** … … 154 196 glob_sum_2d = REAL(ctmp,wp) 155 197 ! 156 END FUNCTION glob_sum_2d 157 158 159 FUNCTION glob_sum_3d( ptab ) 198 END FUNCTION glob_sum_2d 199 200 201 FUNCTION glob_sum_3d( ptab ) 160 202 !!---------------------------------------------------------------------- 161 203 !! *** FUNCTION glob_sum_3d *** … … 179 221 CALL DDPDD( CMPLX( ztmp, 0.e0, wp ), ctmp ) 180 222 END DO 181 END DO 223 END DO 182 224 END DO 183 225 IF( lk_mpp ) CALL mpp_sum( ctmp ) ! sum over the global domain 184 226 glob_sum_3d = REAL(ctmp,wp) 185 227 ! 186 END FUNCTION glob_sum_3d 187 188 189 FUNCTION glob_sum_2d_a( ptab1, ptab2 ) 228 END FUNCTION glob_sum_3d 229 230 231 FUNCTION glob_sum_2d_a( ptab1, ptab2 ) 190 232 !!---------------------------------------------------------------------- 191 233 !! *** FUNCTION glob_sum_2d_a *** … … 214 256 glob_sum_2d_a = REAL(ctmp,wp) 215 257 ! 216 END FUNCTION glob_sum_2d_a 217 218 219 FUNCTION glob_sum_3d_a( ptab1, ptab2 ) 258 END FUNCTION glob_sum_2d_a 259 260 261 FUNCTION glob_sum_3d_a( ptab1, ptab2 ) 220 262 !!---------------------------------------------------------------------- 221 263 !! *** FUNCTION glob_sum_3d_a *** … … 241 283 CALL DDPDD( CMPLX( ztmp, 0.e0, wp ), ctmp ) 242 284 END DO 243 END DO 285 END DO 244 286 END DO 245 287 IF( lk_mpp ) CALL mpp_sum( ctmp ) ! sum over the global domain 246 288 glob_sum_3d_a = REAL(ctmp,wp) 247 289 ! 248 END FUNCTION glob_sum_3d_a 290 END FUNCTION glob_sum_3d_a 249 291 250 292 #endif … … 253 295 !!---------------------------------------------------------------------- 254 296 !! *** ROUTINE DDPDD *** 255 !! 297 !! 256 298 !! ** Purpose : Add a scalar element to a sum 257 !! 258 !! 259 !! ** Method : The code uses the compensated summation with doublet 299 !! 300 !! 301 !! ** Method : The code uses the compensated summation with doublet 260 302 !! (sum,error) emulated useing complex numbers. ydda is the 261 !! scalar to add to the summ yddb 262 !! 263 !! ** Action : This does only work for MPI. 303 !! scalar to add to the summ yddb 304 !! 305 !! ** Action : This does only work for MPI. 264 306 !! 265 307 !! References : Using Acurate Arithmetics to Improve Numerical 266 308 !! Reproducibility and Sability in Parallel Applications 267 !! Yun HE and Chris H. Q. DING, Journal of Supercomputing 18, 259-277, 2001 309 !! Yun HE and Chris H. Q. DING, Journal of Supercomputing 18, 259-277, 2001 268 310 !!---------------------------------------------------------------------- 269 311 COMPLEX(wp), INTENT(in ) :: ydda … … 288 330 !! 'key_nosignedzero' F90 SIGN 289 331 !!---------------------------------------------------------------------- 290 332 291 333 FUNCTION SIGN_SCALAR( pa, pb ) 292 334 !!----------------------------------------------------------------------- … … 304 346 305 347 306 FUNCTION SIGN_ARRAY_1D( pa, pb ) 348 FUNCTION SIGN_ARRAY_1D( pa, pb ) 307 349 !!----------------------------------------------------------------------- 308 350 !! *** FUNCTION SIGN_ARRAY_1D *** … … 319 361 320 362 321 FUNCTION SIGN_ARRAY_2D(pa,pb) 363 FUNCTION SIGN_ARRAY_2D(pa,pb) 322 364 !!----------------------------------------------------------------------- 323 365 !! *** FUNCTION SIGN_ARRAY_2D *** … … 333 375 END FUNCTION SIGN_ARRAY_2D 334 376 335 FUNCTION SIGN_ARRAY_3D(pa,pb) 377 FUNCTION SIGN_ARRAY_3D(pa,pb) 336 378 !!----------------------------------------------------------------------- 337 379 !! *** FUNCTION SIGN_ARRAY_3D *** … … 348 390 349 391 350 FUNCTION SIGN_ARRAY_1D_A(pa,pb) 392 FUNCTION SIGN_ARRAY_1D_A(pa,pb) 351 393 !!----------------------------------------------------------------------- 352 394 !! *** FUNCTION SIGN_ARRAY_1D_A *** … … 363 405 364 406 365 FUNCTION SIGN_ARRAY_2D_A(pa,pb) 407 FUNCTION SIGN_ARRAY_2D_A(pa,pb) 366 408 !!----------------------------------------------------------------------- 367 409 !! *** FUNCTION SIGN_ARRAY_2D_A *** … … 378 420 379 421 380 FUNCTION SIGN_ARRAY_3D_A(pa,pb) 422 FUNCTION SIGN_ARRAY_3D_A(pa,pb) 381 423 !!----------------------------------------------------------------------- 382 424 !! *** FUNCTION SIGN_ARRAY_3D_A *** … … 393 435 394 436 395 FUNCTION SIGN_ARRAY_1D_B(pa,pb) 437 FUNCTION SIGN_ARRAY_1D_B(pa,pb) 396 438 !!----------------------------------------------------------------------- 397 439 !! *** FUNCTION SIGN_ARRAY_1D_B *** … … 408 450 409 451 410 FUNCTION SIGN_ARRAY_2D_B(pa,pb) 452 FUNCTION SIGN_ARRAY_2D_B(pa,pb) 411 453 !!----------------------------------------------------------------------- 412 454 !! *** FUNCTION SIGN_ARRAY_2D_B *** … … 423 465 424 466 425 FUNCTION SIGN_ARRAY_3D_B(pa,pb) 467 FUNCTION SIGN_ARRAY_3D_B(pa,pb) 426 468 !!----------------------------------------------------------------------- 427 469 !! *** FUNCTION SIGN_ARRAY_3D_B *** -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/OPA_SRC/nemogcm.F90
r3701 r3764 6 6 !! History : OPA ! 1990-10 (C. Levy, G. Madec) Original code 7 7 !! 7.0 ! 1991-11 (M. Imbard, C. Levy, G. Madec) 8 !! 7.1 ! 1993-03 (M. Imbard, C. Levy, G. Madec, O. Marti, M. Guyon, A. Lazar, 9 !! P. Delecluse, C. Perigaud, G. Caniaux, B. Colot, C. Maes) release 7.1 8 !! 7.1 ! 1993-03 (M. Imbard, C. Levy, G. Madec, O. Marti, M. Guyon, A. Lazar, 9 !! P. Delecluse, C. Perigaud, G. Caniaux, B. Colot, C. Maes) release 7.1 10 10 !! - ! 1992-06 (L.Terray) coupling implementation 11 !! - ! 1993-11 (M.A. Filiberti) IGLOO sea-ice 12 !! 8.0 ! 1996-03 (M. Imbard, C. Levy, G. Madec, O. Marti, M. Guyon, A. Lazar, 11 !! - ! 1993-11 (M.A. Filiberti) IGLOO sea-ice 12 !! 8.0 ! 1996-03 (M. Imbard, C. Levy, G. Madec, O. Marti, M. Guyon, A. Lazar, 13 13 !! P. Delecluse, L.Terray, M.A. Filiberti, J. Vialar, A.M. Treguier, M. Levy) release 8.0 14 14 !! 8.1 ! 1997-06 (M. Imbard, G. Madec) 15 !! 8.2 ! 1999-11 (M. Imbard, H. Goosse) LIM sea-ice model 16 !! ! 1999-12 (V. Thierry, A-M. Treguier, M. Imbard, M-A. Foujols) OPEN-MP 15 !! 8.2 ! 1999-11 (M. Imbard, H. Goosse) LIM sea-ice model 16 !! ! 1999-12 (V. Thierry, A-M. Treguier, M. Imbard, M-A. Foujols) OPEN-MP 17 17 !! ! 2000-07 (J-M Molines, M. Imbard) Open Boundary Conditions (CLIPPER) 18 18 !! NEMO 1.0 ! 2002-08 (G. Madec) F90: Free form and modules … … 25 25 !! - ! 2007-07 (J. Chanut, A. Sellar) Unstructured open boundaries (BDY) 26 26 !! 3.2 ! 2009-08 (S. Masson) open/write in the listing file in mpp 27 !! 3.3 ! 2010-05 (K. Mogensen, A. Weaver, M. Martin, D. Lea) Assimilation interface 27 !! 3.3 ! 2010-05 (K. Mogensen, A. Weaver, M. Martin, D. Lea) Assimilation interface 28 28 !! - ! 2010-10 (C. Ethe, G. Madec) reorganisation of initialisation phase 29 29 !! 3.3.1! 2011-01 (A. R. Porter, STFC Daresbury) dynamical allocation … … 34 34 !! nemo_gcm : solve ocean dynamics, tracer, biogeochemistry and/or sea-ice 35 35 !! nemo_init : initialization of the NEMO system 36 !! nemo_ctl : initialisation of the contol print 36 !! nemo_ctl : initialisation of the contol print 37 37 !! nemo_closefile : close remaining open files 38 38 !! nemo_alloc : dynamical allocation … … 64 64 USE diadct ! sections transports (dia_dct_init routine) 65 65 USE diaobs ! Observation diagnostics (dia_obs_init routine) 66 USE lib_fortran ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined) 66 67 USE step ! NEMO time-stepping (stp routine) 67 68 USE icbini ! handle bergs, initialisation … … 83 84 USE sbctide, ONLY: lk_tide 84 85 85 86 86 IMPLICIT NONE 87 87 PRIVATE … … 89 89 PUBLIC nemo_gcm ! called by model.F90 90 90 PUBLIC nemo_init ! needed by AGRIF 91 PUBLIC nemo_alloc ! needed by TAM 91 92 92 93 CHARACTER(lc) :: cform_aaa="( /, 'AAAAAAAA', / ) " ! flag for output listing … … 103 104 !! *** ROUTINE nemo_gcm *** 104 105 !! 105 !! ** Purpose : NEMO solves the primitive equations on an orthogonal 106 !! ** Purpose : NEMO solves the primitive equations on an orthogonal 106 107 !! curvilinear mesh on the sphere. 107 108 !! … … 151 152 IF( lk_asminc ) THEN 152 153 IF( ln_bkgwri ) CALL asm_bkg_wri( nit000 - 1 ) ! Output background fields 153 IF( ln_trjwri ) CALL asm_trj_wri( nit000 - 1 ) ! Output trajectory fields154 154 IF( ln_asmdin ) THEN ! Direct initialization 155 155 IF( ln_trainc ) CALL tra_asm_inc( nit000 - 1 ) ! Tracers 156 IF( ln_dyninc ) THEN 157 CALL dyn_asm_inc( nit000 - 1 ) ! Dynamics 158 IF ( ln_asmdin ) CALL ssh_wzv ( nit000 - 1 ) ! update vertical velocity 159 ENDIF 156 IF( ln_dyninc ) CALL dyn_asm_inc( nit000 - 1 ) ! Dynamics 160 157 IF( ln_sshinc ) CALL ssh_asm_inc( nit000 - 1 ) ! SSH 161 158 ENDIF 162 159 ENDIF 163 160 164 161 DO WHILE ( istp <= nitend .AND. nstop == 0 ) 165 162 #if defined key_agrif … … 176 173 ! 177 174 IF( ln_icebergs ) CALL icb_end( nitend ) 178 175 179 176 ! !------------------------! 180 177 ! !== finalize the run ==! … … 184 181 IF( nstop /= 0 .AND. lwp ) THEN ! error print 185 182 WRITE(numout,cform_err) 186 WRITE(numout,*) nstop, ' error have been found' 183 WRITE(numout,*) nstop, ' error have been found' 187 184 ENDIF 188 185 ! … … 261 258 lwp = (narea == 1) .OR. ln_ctl ! control of all listing output print 262 259 263 ! If dimensions of processor grid weren't specified in the namelist file 260 ! If dimensions of processor grid weren't specified in the namelist file 264 261 ! then we calculate them here now that we have our communicator size 265 262 IF( (jpni < 1) .OR. (jpnj < 1) )THEN … … 302 299 WRITE(numout,*) 303 300 WRITE(numout,*) 304 DO ji = 1, SIZE(cltxt) 301 DO ji = 1, SIZE(cltxt) 305 302 IF( TRIM(cltxt(ji)) /= '' ) WRITE(numout,*) cltxt(ji) ! control print of mynode 306 303 END DO … … 309 306 ENDIF 310 307 311 ! Now we know the dimensions of the grid and numout has been set we can 308 ! Now we know the dimensions of the grid and numout has been set we can 312 309 ! allocate arrays 313 310 CALL nemo_alloc() … … 336 333 IF( ln_ctl ) CALL prt_ctl_init ! Print control 337 334 338 IF( lk_obc ) CALL obc_init ! Open boundaries 335 IF( lk_obc ) CALL obc_init ! Open boundaries 339 336 340 337 CALL istate_init ! ocean initial state (Dynamics and tracers) … … 349 346 350 347 ! ! Ocean physics 351 CALL sbc_init ! Forcings : surface module 348 CALL sbc_init ! Forcings : surface module 352 349 ! ! Vertical physics 353 350 CALL zdf_init ! namelist read … … 358 355 IF( lk_zdfkpp ) CALL zdf_kpp_init ! KPP closure scheme 359 356 IF( lk_zdftmx ) CALL zdf_tmx_init ! tidal vertical mixing 360 IF( lk_zdfddm .AND. .NOT. lk_zdfkpp ) & 357 IF( lk_zdfddm .AND. .NOT. lk_zdfkpp ) & 361 358 & CALL zdf_ddm_init ! double diffusive mixing 362 359 ! ! Lateral physics … … 381 378 CALL dyn_zdf_init ! vertical diffusion 382 379 CALL dyn_spg_init ! surface pressure gradient 383 380 384 381 ! ! Misc. options 385 382 IF( nn_cla == 1 ) CALL cla_init ! Cross Land Advection … … 401 398 CALL dia_obs_init ! Initialize observational data 402 399 CALL dia_obs( nit000 - 1 ) ! Observation operator for restart 403 ENDIF 400 ENDIF 404 401 ! ! Assimilation increments 405 402 IF( lk_asminc ) CALL asm_inc_init ! Initialize assimilation increments … … 413 410 !! *** ROUTINE nemo_ctl *** 414 411 !! 415 !! ** Purpose : control print setting 412 !! ** Purpose : control print setting 416 413 !! 417 414 !! ** Method : - print namctl information and check some consistencies … … 460 457 ! ! indices used for the SUM control 461 458 IF( nictls+nictle+njctls+njctle == 0 ) THEN ! print control done over the default area 462 lsp_area = .FALSE. 459 lsp_area = .FALSE. 463 460 ELSE ! print control done over a specific area 464 461 lsp_area = .TRUE. … … 482 479 ENDIF 483 480 ! 484 IF( nbench == 1 ) THEN ! Benchmark 481 IF( nbench == 1 ) THEN ! Benchmark 485 482 SELECT CASE ( cp_cfg ) 486 483 CASE ( 'gyre' ) ; CALL ctl_warn( ' The Benchmark is activated ' ) … … 493 490 & 'with the IOM Input/Output manager. ' , & 494 491 & 'Compile with key_iomput enabled' ) 492 ! 493 IF( 1_wp /= SIGN(1._wp,-0._wp) ) CALL ctl_stop( 'nemo_ctl: The intrinsec SIGN function follows ', & 494 & 'f2003 standard. ' , & 495 & 'Compile with key_nosignedzero enabled' ) 495 496 ! 496 497 END SUBROUTINE nemo_ctl … … 544 545 !!---------------------------------------------------------------------- 545 546 ! 546 ierr = oce_alloc () ! ocean 547 ierr = oce_alloc () ! ocean 547 548 ierr = ierr + dia_wri_alloc () 548 549 ierr = ierr + dom_oce_alloc () ! ocean domain … … 568 569 !! *** ROUTINE nemo_partition *** 569 570 !! 570 !! ** Purpose : 571 !! ** Purpose : 571 572 !! 572 573 !! ** Method : … … 616 617 !! 617 618 !! ** Purpose : return the prime factors of n. 618 !! knfax factors are returned in array kfax which is of 619 !! knfax factors are returned in array kfax which is of 619 620 !! maximum dimension kmaxfax. 620 621 !! ** Method : … … 684 685 !!===================================================================== 685 686 !!---------------------------------------------------------------------- 686 !! 687 !! 687 688 !! ** Purpose : Initialization of the northern neighbours lists. 688 689 !!---------------------------------------------------------------------- 689 !! 1.0 ! 2011-10 (A. C. Coward, NOCS & J. Donners, PRACE) 690 !! 1.0 ! 2011-10 (A. C. Coward, NOCS & J. Donners, PRACE) 690 691 !!---------------------------------------------------------------------- 691 692 … … 769 770 jtyp = 5 770 771 lrankset = .FALSE. 771 znnbrs = narea 772 znnbrs = narea 772 773 CALL lbc_lnk( znnbrs, 'J', 1. ) ! first ice U-V point 773 774 … … 782 783 ENDIF 783 784 784 znnbrs = narea 785 znnbrs = narea 785 786 CALL lbc_lnk( znnbrs, 'K', 1. ) ! second ice U-V point 786 787 … … 805 806 END DO 806 807 ! 807 ! For northern row areas, set l_north_nogather so that all subsequent exchanges 808 ! For northern row areas, set l_north_nogather so that all subsequent exchanges 808 809 ! can use peer to peer communications at the north fold 809 810 ! -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/OPA_SRC/step.F90
r3701 r3764 29 29 !! stp : OPA system time-stepping 30 30 !!---------------------------------------------------------------------- 31 USE step_oce ! time stepping definition modules 31 USE step_oce ! time stepping definition modules 32 32 #if defined key_top 33 33 USE trcstp ! passive tracer time-stepping (trc_stp routine) … … 62 62 !!---------------------------------------------------------------------- 63 63 !! *** ROUTINE stp *** 64 !! 64 !! 65 65 !! ** Purpose : - Time stepping of OPA (momentum and active tracer eqs.) 66 66 !! - Time stepping of LIM (dynamic and thermodynamic eqs.) 67 67 !! - Tme stepping of TRC (passive tracer eqs.) 68 !! 69 !! ** Method : -1- Update forcings and data 70 !! -2- Update ocean physics 71 !! -3- Compute the t and s trends 72 !! -4- Update t and s 68 !! 69 !! ** Method : -1- Update forcings and data 70 !! -2- Update ocean physics 71 !! -3- Compute the t and s trends 72 !! -4- Update t and s 73 73 !! -5- Compute the momentum trends 74 74 !! -6- Update the horizontal velocity … … 86 86 # if defined key_iomput 87 87 IF( Agrif_Nbstepint() == 0 ) CALL iom_swap 88 # endif 89 #endif 88 # endif 89 #endif 90 90 indic = 0 ! reset to no error condition 91 91 IF( kstp /= nit000 ) CALL day( kstp ) ! Calendar (day was already called at nit000 in day_init) … … 113 113 CALL bn2( tsn, rn2 ) ! now Brunt-Vaisala frequency 114 114 ! 115 ! VERTICAL PHYSICS 115 ! VERTICAL PHYSICS 116 116 CALL zdf_bfr( kstp ) ! bottom friction 117 117 118 118 ! ! Vertical eddy viscosity and diffusivity coefficients 119 119 IF( lk_zdfric ) CALL zdf_ric( kstp ) ! Richardson number dependent Kz … … 135 135 IF( lk_zdfddm .AND. .NOT. lk_zdfkpp ) & 136 136 & CALL zdf_ddm( kstp ) ! double diffusive mixing 137 137 138 138 CALL zdf_mxl( kstp ) ! mixed layer depth 139 139 … … 142 142 IF( lrst_oce .AND. lk_zdfgls ) CALL gls_rst( kstp, 'WRITE' ) 143 143 ! 144 ! LATERAL PHYSICS 144 ! LATERAL PHYSICS 145 145 ! 146 146 IF( lk_ldfslp ) THEN ! slope of lateral mixing … … 211 211 IF( ln_zps ) CALL zps_hde( kstp, jpts, tsa, gtsu, gtsv, & ! zps: time filtered hor. derivative 212 212 & rhd, gru , grv ) ! of t, s, rd at the last ocean level 213 213 214 214 ELSE ! centered hpg (eos then time stepping) 215 215 CALL eos ( tsn, rhd, rhop ) ! now in situ density for hpg computation … … 218 218 IF( ln_zdfnpc ) CALL tra_npc( kstp ) ! update after fields by non-penetrative convection 219 219 CALL tra_nxt( kstp ) ! tracer fields at next time step 220 ENDIF 220 ENDIF 221 221 222 222 !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> … … 228 228 IF( ln_asmiau .AND. & 229 229 & ln_dyninc ) CALL dyn_asm_inc( kstp ) ! apply dynamics assimilation increment 230 IF( ln_bkgwri ) CALL asm_bkg_wri( kstp ) ! output background fields 230 231 IF( ln_neptsimp ) CALL dyn_nept_cor( kstp ) ! subtract Neptune velocities (simplified) 231 232 IF( lk_bdy ) CALL bdy_dyn3d_dmp(kstp ) ! bdy damping trends … … 238 239 #endif 239 240 CALL dyn_hpg( kstp ) ! horizontal gradient of Hydrostatic pressure 240 CALL dyn_bfr( kstp ) ! bottom friction 241 CALL dyn_bfr( kstp ) ! bottom friction 241 242 CALL dyn_zdf( kstp ) ! vertical diffusion 242 243 CALL dyn_spg( kstp, indic ) ! surface pressure gradient … … 263 264 ! Trends (ua, va, tsa used as workspace) 264 265 !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 265 IF( nstop == 0 ) THEN 266 IF( lk_trddyn ) CALL trd_dwr( kstp ) ! trends: dynamics 266 IF( nstop == 0 ) THEN 267 IF( lk_trddyn ) CALL trd_dwr( kstp ) ! trends: dynamics 267 268 IF( lk_trdtra ) CALL trd_twr( kstp ) ! trends: active tracers 268 IF( lk_trdmld ) CALL trd_mld( kstp ) ! trends: Mixed-layer 269 IF( lk_trdmld ) CALL trd_mld( kstp ) ! trends: Mixed-layer 269 270 IF( lk_trdvor ) CALL trd_vor( kstp ) ! trends: vorticity budget 270 271 ENDIF -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/OPA_SRC/step_oce.F90
r3680 r3764 7 7 !!---------------------------------------------------------------------- 8 8 USE oce ! ocean dynamics and tracers variables 9 USE dom_oce ! ocean space and time domain variables 9 USE dom_oce ! ocean space and time domain variables 10 10 USE zdf_oce ! ocean vertical physics variables 11 11 USE ldftra_oce ! ocean tracer - trends … … 84 84 USE trdmld_rst ! restart for mixed-layer trends 85 85 USE trdmod_oce ! ocean momentum/tracers trends 86 USE trdmod ! momentum/tracers trends 86 USE trdmod ! momentum/tracers trends 87 87 USE trdvor ! vorticity budget (trd_vor routine) 88 88 USE diaptr ! poleward transports (dia_ptr routine) … … 98 98 USE asminc ! assimilation increments (tra_asm_inc routine) 99 99 ! (dyn_asm_inc routine) 100 100 USE asmbkg 101 101 USE stpctl ! time stepping control (stp_ctl routine) 102 102 USE prtctl ! Print control (prt_ctl routine) … … 104 104 USE diaobs ! Observation operator 105 105 106 USE timing ! Timing 106 USE timing ! Timing 107 107 108 108 #if defined key_agrif -
branches/2012/dev_MERGE_2012/NEMOGCM/SETTE/iodef_sette.xml
r3715 r3764 67 67 </context> 68 68 69 70 69 <context id="xios"> 71 70
Note: See TracChangeset
for help on using the changeset viewer.