Changeset 7646 for trunk/NEMOGCM/NEMO/SAS_SRC
- Timestamp:
- 2017-02-06T10:25:03+01:00 (7 years ago)
- Location:
- trunk/NEMOGCM/NEMO/SAS_SRC
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/NEMOGCM/NEMO/SAS_SRC/daymod.F90
r6140 r7646 268 268 269 269 ! since we no longer call rst_opn, need to define nitrst here, used by ice restart routine 270 IF( kt == nit000 ) nitrst = nitend 270 IF( kt == nit000 ) THEN 271 nitrst = nitend 272 lrst_oce = .FALSE. ! init restart ocean (done in rst_opn when not SAS) 273 ENDIF 274 271 275 IF( MOD( kt - 1, nstock ) == 0 ) THEN 272 276 ! we use kt - 1 and not kt - nit000 to keep the same periodicity from the beginning of the experiment -
trunk/NEMOGCM/NEMO/SAS_SRC/diawri.F90
r6140 r7646 36 36 USE lbclnk ! ocean lateral boundary conditions (or mpp link) 37 37 USE in_out_manager ! I/O manager 38 USE diaar5, ONLY : lk_diaar539 38 USE iom 40 39 USE ioipsl -
trunk/NEMOGCM/NEMO/SAS_SRC/nemogcm.F90
r6165 r7646 2 2 !!====================================================================== 3 3 !! *** MODULE nemogcm *** 4 !! Ocean system : NEMO GCM (ocean dynamics, on-line tracers, biochemistry and sea-ice)4 !! StandAlone Surface module : surface fluxes + sea-ice + iceberg floats 5 5 !!====================================================================== 6 !! History : OPA ! 1990-10 (C. Levy, G. Madec) Original code 7 !! 7.0 ! 1991-11 (M. Imbard, C. Levy, G. Madec) 8 !! 7.1 ! 1993-03 (M. Imbard, C. Levy, G. Madec, O. Marti, M. Guyon, A. Lazar, 9 !! P. Delecluse, C. Perigaud, G. Caniaux, B. Colot, C. Maes) release 7.1 10 !! - ! 1992-06 (L.Terray) coupling implementation 11 !! - ! 1993-11 (M.A. Filiberti) IGLOO sea-ice 12 !! 8.0 ! 1996-03 (M. Imbard, C. Levy, G. Madec, O. Marti, M. Guyon, A. Lazar, 13 !! P. Delecluse, L.Terray, M.A. Filiberti, J. Vialar, A.M. Treguier, M. Levy) release 8.0 14 !! 8.1 ! 1997-06 (M. Imbard, G. Madec) 15 !! 8.2 ! 1999-11 (M. Imbard, H. Goosse) LIM sea-ice model 16 !! ! 1999-12 (V. Thierry, A-M. Treguier, M. Imbard, M-A. Foujols) OPEN-MP 17 !! ! 2000-07 (J-M Molines, M. Imbard) Open Boundary Conditions (CLIPPER) 18 !! NEMO 1.0 ! 2002-08 (G. Madec) F90: Free form and modules 19 !! - ! 2004-06 (R. Redler, NEC CCRLE, Germany) add OASIS[3/4] coupled interfaces 20 !! - ! 2004-08 (C. Talandier) New trends organization 21 !! - ! 2005-06 (C. Ethe) Add the 1D configuration possibility 22 !! - ! 2005-11 (V. Garnier) Surface pressure gradient organization 23 !! - ! 2006-03 (L. Debreu, C. Mazauric) Agrif implementation 24 !! - ! 2006-04 (G. Madec, R. Benshila) Step reorganization 25 !! - ! 2007-07 (J. Chanut, A. Sellar) Unstructured open boundaries (BDY) 26 !! 3.2 ! 2009-08 (S. Masson) open/write in the listing file in mpp 27 !! 3.3 ! 2010-05 (K. Mogensen, A. Weaver, M. Martin, D. Lea) Assimilation interface 28 !! - ! 2010-10 (C. Ethe, G. Madec) reorganisation of initialisation phase 29 !! 3.3.1! 2011-01 (A. R. Porter, STFC Daresbury) dynamical allocation 30 !! 3.4 ! 2011-11 (C. Harris) decomposition changes for running with CICE 6 !! History : 3.6 ! 2011-11 (S. Alderson, G. Madec) original code 7 !! - ! 2013-06 (I. Epicoco, S. Mocavero, CMCC) nemo_northcomms: setup avoiding MPI communication 8 !! - ! 2014-12 (G. Madec) remove KPP scheme and cross-land advection (cla) 9 !! 4.0 ! 2016-10 (G. Madec, S. Flavoni) domain configuration / user defined interface 31 10 !!---------------------------------------------------------------------- 32 11 33 12 !!---------------------------------------------------------------------- 34 !! nemo_gcm 35 !! nemo_init 36 !! nemo_ctl : initialisation of the contol print37 !! nemo_closefile 38 !! nemo_alloc 39 !! nemo_partition 40 !! factorise 13 !! nemo_gcm : solve ocean dynamics, tracer, biogeochemistry and/or sea-ice 14 !! nemo_init : initialization of the NEMO system 15 !! nemo_ctl : initialisation of the contol print 16 !! nemo_closefile: close remaining open files 17 !! nemo_alloc : dynamical allocation 18 !! nemo_partition: calculate MPP domain decomposition 19 !! factorise : calculate the factors of the no. of MPI processes 41 20 !!---------------------------------------------------------------------- 42 USE step_oce ! module used in the ocean time stepping module 43 USE sbc_oce ! surface boundary condition: ocean 44 USE domcfg ! domain configuration (dom_cfg routine) 45 USE daymod ! calendar 46 USE mppini ! shared/distributed memory setting (mpp_init routine) 47 USE domain ! domain initialization (dom_init routine) 48 USE phycst ! physical constant (par_cst routine) 49 USE step ! NEMO time-stepping (stp routine) 50 USE lib_mpp ! distributed memory computing 51 #if defined key_nosignedzero 52 USE lib_fortran ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined) 53 #endif 21 USE step_oce ! module used in the ocean time stepping module 22 USE sbc_oce ! surface boundary condition: ocean 23 USE phycst ! physical constant (par_cst routine) 24 USE domain ! domain initialization (dom_init & dom_cfg routines) 25 USE usrdef_nam ! user defined configuration 26 USE daymod ! calendar 27 USE step ! NEMO time-stepping (stp routine) 28 USE cpl_oasis3 ! 29 USE sbcssm ! 30 USE icbini ! handle bergs, initialisation 31 USE icbstp ! handle bergs, calving, themodynamics and transport 32 USE bdyini ! open boundary cond. setting (bdy_init routine). clem: mandatory for LIM3 33 USE bdydta ! open boundary cond. setting (bdy_dta_init routine). clem: mandatory for LIM3 34 ! 35 USE lib_mpp ! distributed memory computing 36 USE mppini ! shared/distributed memory setting (mpp_init routine) 37 USE lbcnfd , ONLY: isendto, nsndto, nfsloop, nfeloop ! Setup of north fold exchanges 38 USE lib_fortran ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined) 54 39 #if defined key_iomput 55 USE xios 56 #endif 57 USE cpl_oasis3 58 USE sbcssm 59 USE lbcnfd, ONLY: isendto, nsndto, nfsloop, nfeloop ! Setup of north fold exchanges 60 USE icbstp ! handle bergs, calving, themodynamics and transport 61 #if defined key_bdy 62 USE bdyini ! open boundary cond. setting (bdy_init routine). clem: mandatory for LIM3 63 USE bdydta ! open boundary cond. setting (bdy_dta_init routine). clem: mandatory for LIM3 64 #endif 65 USE bdy_par 40 USE xios ! xIOserver 41 #endif 66 42 67 43 IMPLICIT NONE … … 74 50 75 51 !!---------------------------------------------------------------------- 76 !! NEMO/OPA 4.0 , NEMO Consortium (201 1)52 !! NEMO/OPA 4.0 , NEMO Consortium (2016) 77 53 !! $Id$ 78 54 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) … … 84 60 !! *** ROUTINE nemo_gcm *** 85 61 !! 86 !! ** Purpose : NEMO solves the primitive equations on an orthogonal 62 !! ** Purpose : NEMO solves the primitive equations on an orthogonal 87 63 !! curvilinear mesh on the sphere. 88 64 !! … … 94 70 !! Madec, 2008, internal report, IPSL. 95 71 !!---------------------------------------------------------------------- 96 INTEGER :: istp 72 INTEGER :: istp ! time step index 97 73 !!---------------------------------------------------------------------- 98 74 ! 99 75 #if defined key_agrif 100 101 #endif 102 76 CALL Agrif_Init_Grids() ! AGRIF: set the meshes 77 #endif 78 ! 103 79 ! !-----------------------! 104 80 CALL nemo_init !== Initialisations ==! … … 113 89 CALL Agrif_Declare_Var_lim2 ! " " " " " LIM 114 90 # endif 91 # if defined key_lim3 92 CALL Agrif_Declare_Var_lim3 ! " " " " " LIM3 93 # endif 115 94 #endif 116 95 ! check that all process are still there... If some process have an error, … … 124 103 ! !-----------------------! 125 104 istp = nit000 126 105 #if defined key_agrif 106 CALL Agrif_Regrid() 107 #endif 108 127 109 DO WHILE ( istp <= nitend .AND. nstop == 0 ) 128 110 #if defined key_agrif 129 CALL Agrif_Step( stp )! AGRIF: time stepping111 CALL stp ! AGRIF: time stepping 130 112 #else 131 CALL stp( istp ) ! standard time stepping 113 IF ( .NOT. ln_diurnal_only ) THEN 114 CALL stp( istp ) ! standard time stepping 115 ELSE 116 CALL stp_diurnal( istp ) ! time step only the diurnal SST 117 ENDIF 132 118 #endif 133 119 istp = istp + 1 134 120 IF( lk_mpp ) CALL mpp_max( nstop ) 135 END DO121 END DO 136 122 ! 137 123 IF( ln_icebergs ) CALL icb_end( nitend ) … … 140 126 ! !== finalize the run ==! 141 127 ! !------------------------! 142 IF(lwp) WRITE(numout,cform_aaa) ! Flag AAAAAAA143 ! 144 IF( nstop /= 0 .AND. lwp ) THEN ! error print128 IF(lwp) WRITE(numout,cform_aaa) ! Flag AAAAAAA 129 ! 130 IF( nstop /= 0 .AND. lwp ) THEN ! error print 145 131 WRITE(numout,cform_err) 146 WRITE(numout,*) nstop, ' error have been found' 132 WRITE(numout,*) nstop, ' error have been found' 147 133 ENDIF 148 134 ! 149 135 #if defined key_agrif 150 CALL Agrif_ParentGrid_To_ChildGrid() 136 IF( .NOT. Agrif_Root() ) THEN 137 CALL Agrif_ParentGrid_To_ChildGrid() 138 IF( nn_timing == 1 ) CALL timing_finalize 139 CALL Agrif_ChildGrid_To_ParentGrid() 140 ENDIF 141 #endif 151 142 IF( nn_timing == 1 ) CALL timing_finalize 152 CALL Agrif_ChildGrid_To_ParentGrid()153 #endif154 IF( nn_timing == 1 ) CALL timing_finalize155 143 ! 156 144 CALL nemo_closefile 157 145 ! 158 146 #if defined key_iomput 159 CALL xios_finalize ! end mpp communications with xios160 IF( lk_oasis ) CALL cpl_finalize! end coupling and mpp communications with OASIS147 CALL xios_finalize ! end mpp communications with xios 148 IF( lk_oasis ) CALL cpl_finalize ! end coupling and mpp communications with OASIS 161 149 #else 162 150 IF( lk_oasis ) THEN 163 CALL cpl_finalize ! end coupling and mpp communications with OASIS151 CALL cpl_finalize ! end coupling and mpp communications with OASIS 164 152 ELSE 165 IF( lk_mpp ) CALL mppstop ! end mpp communications153 IF( lk_mpp ) CALL mppstop ! end mpp communications 166 154 ENDIF 167 155 #endif … … 176 164 !! ** Purpose : initialization of the NEMO GCM 177 165 !!---------------------------------------------------------------------- 178 INTEGER :: ji ! dummy loop indices 179 INTEGER :: ilocal_comm ! local integer 180 INTEGER :: ios 181 CHARACTER(len=80), DIMENSION(16) :: cltxt 182 CHARACTER(len=80) :: clname 183 ! 184 NAMELIST/namctl/ ln_ctl , nn_print, nn_ictls, nn_ictle, & 185 & nn_isplt, nn_jsplt, nn_jctls, nn_jctle, & 186 & nn_bench, nn_timing, nn_diacfl 187 NAMELIST/namcfg/ cp_cfg, cp_cfz, jp_cfg, jpidta, jpjdta, jpkdta, jpiglo, jpjglo, & 188 & jpizoom, jpjzoom, jperio, ln_use_jattr 189 !!---------------------------------------------------------------------- 190 ! 191 cltxt = '' 166 INTEGER :: ji ! dummy loop indices 167 INTEGER :: ilocal_comm ! local integer 168 INTEGER :: ios, inum ! - - 169 CHARACTER(len=120), DIMENSION(30) :: cltxt, cltxt2, clnam 170 CHARACTER(len=80) :: clname 171 ! 172 NAMELIST/namctl/ ln_ctl , nn_print, nn_ictls, nn_ictle, & 173 & nn_isplt , nn_jsplt, nn_jctls, nn_jctle, & 174 & nn_timing, nn_diacfl 175 NAMELIST/namcfg/ ln_read_cfg, cn_domcfg, ln_write_cfg, cn_domcfg_out, ln_use_jattr 176 !!---------------------------------------------------------------------- 177 ! 178 cltxt = '' 179 cltxt2 = '' 180 clnam = '' 181 cxios_context = 'nemo' 192 182 ! 193 183 ! ! Open reference namelist and configuration namelist files … … 204 194 ENDIF 205 195 ! 206 REWIND( numnam_ref ) ! Namelist namctl in reference namelist : Control prints & Benchmark196 REWIND( numnam_ref ) ! Namelist namctl in reference namelist : Control prints 207 197 READ ( numnam_ref, namctl, IOSTAT = ios, ERR = 901 ) 208 198 901 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namctl in reference namelist', .TRUE. ) 209 210 REWIND( numnam_cfg ) ! Namelist namctl in confguration namelist : Control prints & Benchmark199 ! 200 REWIND( numnam_cfg ) ! Namelist namctl in confguration namelist 211 201 READ ( numnam_cfg, namctl, IOSTAT = ios, ERR = 902 ) 212 202 902 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namctl in configuration namelist', .TRUE. ) 213 214 ! 215 REWIND( numnam_ref ) ! Namelist namcfg in reference namelist : Control prints & Benchmark 203 ! 204 REWIND( numnam_ref ) ! Namelist namcfg in reference namelist : Control prints 216 205 READ ( numnam_ref, namcfg, IOSTAT = ios, ERR = 903 ) 217 206 903 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namcfg in reference namelist', .TRUE. ) … … 221 210 904 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namcfg in configuration namelist', .TRUE. ) 222 211 223 ! Force values for AGRIF zoom (cf. agrif_user.F90) 212 ! !--------------------------! 213 ! ! Set global domain size ! (control print return in cltxt2) 214 ! !--------------------------! 215 IF( ln_read_cfg ) THEN ! Read sizes in domain configuration file 216 CALL domain_cfg ( cltxt2, cn_cfg, nn_cfg, jpiglo, jpjglo, jpkglo, jperio ) 217 ! 218 ELSE ! user-defined namelist 219 CALL usr_def_nam( cltxt2, clnam, cn_cfg, nn_cfg, jpiglo, jpjglo, jpkglo, jperio ) 220 ENDIF 221 ! 222 jpk = jpkglo 223 ! 224 224 #if defined key_agrif 225 IF( .NOT. Agrif_Root() ) THEN 226 jpiglo = nbcellsx + 2 + 2*nbghostcells 227 jpjglo = nbcellsy + 2 + 2*nbghostcells 228 jpi = ( jpiglo-2*jpreci + (jpni-1+0) ) / jpni + 2*jpreci 229 jpj = ( jpjglo-2*jprecj + (jpnj-1+0) ) / jpnj + 2*jprecj 230 jpidta = jpiglo 231 jpjdta = jpjglo 232 jpizoom = 1 233 jpjzoom = 1 234 nperio = 0 235 jperio = 0 236 ln_use_jattr = .false. 237 ENDIF 225 IF( .NOT. Agrif_Root() ) THEN ! AGRIF children: specific setting (cf. agrif_user.F90) 226 jpiglo = nbcellsx + 2 + 2*nbghostcells 227 jpjglo = nbcellsy + 2 + 2*nbghostcells 228 jpi = ( jpiglo-2*jpreci + (jpni-1+0) ) / jpni + 2*jpreci 229 jpj = ( jpjglo-2*jprecj + (jpnj-1+0) ) / jpnj + 2*jprecj 230 nperio = 0 231 jperio = 0 232 ln_use_jattr = .false. 233 ENDIF 238 234 #endif 239 235 ! … … 249 245 CALL xios_initialize( "not used",local_comm=ilocal_comm ) ! send nemo communicator to xios 250 246 ELSE 251 CALL xios_initialize( "for_xios_mpi_id",return_comm=ilocal_comm ) 247 CALL xios_initialize( "for_xios_mpi_id",return_comm=ilocal_comm ) ! nemo local communicator given by xios 252 248 ENDIF 253 249 ENDIF … … 264 260 ENDIF 265 261 #endif 262 266 263 narea = narea + 1 ! mynode return the rank of proc (0 --> jpnij -1 ) 267 264 … … 269 266 lwp = (narea == 1) .OR. ln_ctl ! control of all listing output print 270 267 271 IF(lwm) THEN 272 ! write merged namelists from earlier to output namelist now that the 273 ! file has been opened in call to mynode. nammpp has already been 274 ! written in mynode (if lk_mpp_mpi) 268 IF(lwm) THEN ! write merged namelists from earlier to output namelist 269 ! ! now that the file has been opened in call to mynode. 270 ! ! NB: nammpp has already been written in mynode (if lk_mpp_mpi) 275 271 WRITE( numond, namctl ) 276 272 WRITE( numond, namcfg ) 277 ENDIF 278 279 ! If dimensions of processor grid weren't specified in the namelist file 273 IF( .NOT.ln_read_cfg ) THEN 274 DO ji = 1, SIZE(clnam) 275 IF( TRIM(clnam(ji)) /= '' ) WRITE(numond, * ) clnam(ji) ! namusr_def print 276 END DO 277 ENDIF 278 ENDIF 279 280 ! If dimensions of processor grid weren't specified in the namelist file 280 281 ! then we calculate them here now that we have our communicator size 281 IF( (jpni < 1) .OR. (jpnj < 1) )THEN282 IF( jpni < 1 .OR. jpnj < 1 ) THEN 282 283 #if defined key_mpp_mpi 283 IF( Agrif_Root() ) CALL nemo_partition(mppsize)284 IF( Agrif_Root() ) CALL nemo_partition( mppsize ) 284 285 #else 285 286 jpni = 1 … … 287 288 jpnij = jpni*jpnj 288 289 #endif 289 END IF 290 291 ! Calculate domain dimensions given calculated jpni and jpnj 292 ! This used to be done in par_oce.F90 when they were parameters rather 293 ! than variables 294 IF( Agrif_Root() ) THEN 290 ENDIF 291 292 IF( Agrif_Root() ) THEN ! AGRIF mother: specific setting from jpni and jpnj 295 293 #if defined key_nemocice_decomp 296 jpi = ( nx_global+2-2*jpreci + (jpni-1) ) / jpni + 2*jpreci ! first dim.297 jpj = ( ny_global+2-2*jprecj + (jpnj-1) ) / jpnj + 2*jprecj ! second dim.294 jpi = ( nx_global+2-2*jpreci + (jpni-1) ) / jpni + 2*jpreci ! first dim. 295 jpj = ( ny_global+2-2*jprecj + (jpnj-1) ) / jpnj + 2*jprecj ! second dim. 298 296 #else 299 jpi = ( jpiglo-2*jpreci + (jpni-1) ) / jpni + 2*jpreci ! first dim. 300 jpj = ( jpjglo-2*jprecj + (jpnj-1) ) / jpnj + 2*jprecj ! second dim. 301 #endif 302 ENDIF 303 jpk = jpkdta ! third dim 304 jpim1 = jpi-1 ! inner domain indices 305 jpjm1 = jpj-1 ! " " 306 jpkm1 = jpk-1 ! " " 307 jpij = jpi*jpj ! jpi x j 297 jpi = ( jpiglo -2*jpreci + (jpni-1) ) / jpni + 2*jpreci ! first dim. 298 jpj = ( jpjglo -2*jprecj + (jpnj-1) ) / jpnj + 2*jprecj ! second dim. 299 #endif 300 ENDIF 301 302 #if defined key_agrif 303 ! simple trick to use same vertical grid as parent but different number of levels: 304 ! Save maximum number of levels in jpkglo, then define all vertical grids with this number. 305 ! Suppress once vertical online interpolation is ok 306 IF(.NOT.Agrif_Root()) jpkglo = Agrif_Parent( jpkglo ) 307 #endif 308 jpim1 = jpi-1 ! inner domain indices 309 jpjm1 = jpj-1 ! " " 310 jpkm1 = jpk-1 ! " " 311 jpij = jpi*jpj ! jpi x j 308 312 309 313 IF(lwp) THEN ! open listing units … … 319 323 WRITE(numout,*) ' NEMO team' 320 324 WRITE(numout,*) ' Ocean General Circulation Model' 321 WRITE(numout,*) ' version 3. 6 (2015) '325 WRITE(numout,*) ' version 3.7 (2016) ' 322 326 WRITE(numout,*) ' StandAlone Surface version (SAS) ' 323 327 WRITE(numout,*) 324 328 WRITE(numout,*) 325 DO ji = 1, SIZE(cltxt) 326 IF( TRIM(cltxt (ji)) /= '' ) WRITE(numout,*) cltxt(ji)! control print of mynode329 DO ji = 1, SIZE(cltxt) 330 IF( TRIM(cltxt (ji)) /= '' ) WRITE(numout,*) cltxt(ji) ! control print of mynode 327 331 END DO 328 WRITE(numout,cform_aaa) ! Flag AAAAAAA 332 WRITE(numout,*) 333 WRITE(numout,*) 334 DO ji = 1, SIZE(cltxt2) 335 IF( TRIM(cltxt2(ji)) /= '' ) WRITE(numout,*) cltxt2(ji) ! control print of domain size 336 END DO 329 337 ! 330 ENDIF 331 332 ! Now we know the dimensions of the grid and numout has been set we can 333 ! allocate arrays 338 WRITE(numout,cform_aaa) ! Flag AAAAAAA 339 ! 340 ENDIF 341 342 ! Now we know the dimensions of the grid and numout has been set: we can allocate arrays 334 343 CALL nemo_alloc() 335 336 344 ! !-------------------------------! 337 345 ! ! NEMO general initialization ! 338 346 ! !-------------------------------! 339 347 340 CALL nemo_ctl ! Control prints & Benchmark348 CALL nemo_ctl ! Control prints 341 349 342 350 ! ! Domain decomposition … … 350 358 CALL phy_cst ! Physical constants 351 359 CALL eos_init ! Equation of state 352 CALL dom_cfg ! Domain configuration353 360 CALL dom_init ! Domain 354 361 355 IF( ln_nnogather )CALL nemo_northcomms ! Initialise the northfold neighbour lists (must be done after the masks are defined)356 357 IF( ln_ctl )CALL prt_ctl_init ! Print control362 IF( ln_nnogather ) CALL nemo_northcomms ! Initialise the northfold neighbour lists (must be done after the masks are defined) 363 364 IF( ln_ctl ) CALL prt_ctl_init ! Print control 358 365 CALL day_init ! model calendar (using both namelist and restart infos) 359 366 360 367 CALL sbc_init ! Forcings : surface module 361 368 362 369 ! ==> clem: open boundaries init. is mandatory for LIM3 because ice BDY is not decoupled from 363 370 ! the environment of ocean BDY. Therefore bdy is called in both OPA and SAS modules. 364 371 ! This is not clean and should be changed in the future. 365 IF( lk_bdy ) CALL bdy_init 366 IF( lk_bdy ) CALL bdy_dta_init 372 CALL bdy_init 367 373 ! ==> 374 CALL icb_init( rdt, nit000) ! initialise icebergs instance 368 375 369 376 IF(lwp) WRITE(numout,*) 'Euler time step switch is ', neuler … … 383 390 IF(lwp) THEN ! control print 384 391 WRITE(numout,*) 385 WRITE(numout,*) 'nemo_ctl: Control prints & Benchmark'392 WRITE(numout,*) 'nemo_ctl: Control prints' 386 393 WRITE(numout,*) '~~~~~~~ ' 387 394 WRITE(numout,*) ' Namelist namctl' … … 394 401 WRITE(numout,*) ' number of proc. following i nn_isplt = ', nn_isplt 395 402 WRITE(numout,*) ' number of proc. following j nn_jsplt = ', nn_jsplt 396 WRITE(numout,*) ' benchmark parameter (0/1) nn_bench = ', nn_bench403 WRITE(numout,*) ' timing activated (0/1) nn_timing = ', nn_timing 397 404 ENDIF 398 405 ! … … 404 411 isplt = nn_isplt 405 412 jsplt = nn_jsplt 406 nbench = nn_bench407 413 408 414 IF(lwp) THEN ! control print … … 411 417 WRITE(numout,*) '~~~~~~~ ' 412 418 WRITE(numout,*) ' Namelist namcfg' 413 WRITE(numout,*) ' configuration name cp_cfg = ', TRIM(cp_cfg) 414 WRITE(numout,*) ' configuration zoom name cp_cfz = ', TRIM(cp_cfz) 415 WRITE(numout,*) ' configuration resolution jp_cfg = ', jp_cfg 416 WRITE(numout,*) ' 1st lateral dimension ( >= jpi ) jpidta = ', jpidta 417 WRITE(numout,*) ' 2nd " " ( >= jpj ) jpjdta = ', jpjdta 418 WRITE(numout,*) ' 3nd " " jpkdta = ', jpkdta 419 WRITE(numout,*) ' 1st dimension of global domain in i jpiglo = ', jpiglo 420 WRITE(numout,*) ' 2nd - - in j jpjglo = ', jpjglo 421 WRITE(numout,*) ' left bottom i index of the zoom (in data domain) jpizoom = ', jpizoom 422 WRITE(numout,*) ' left bottom j index of the zoom (in data domain) jpizoom = ', jpjzoom 423 WRITE(numout,*) ' lateral cond. type (between 0 and 6) jperio = ', jperio 424 WRITE(numout,*) ' use file attribute if exists as i/p j-start ln_use_jattr = ', ln_use_jattr 419 WRITE(numout,*) ' read domain configuration files ln_read_cfg = ', ln_read_cfg 420 WRITE(numout,*) ' filename to be read cn_domcfg = ', TRIM(cn_domcfg) 421 WRITE(numout,*) ' write configuration definition files ln_write_cfg = ', ln_write_cfg 422 WRITE(numout,*) ' filename to be written cn_domcfg_out = ', TRIM(cn_domcfg_out) 423 WRITE(numout,*) ' use file attribute if exists as i/p j-start ln_use_jattr = ', ln_use_jattr 425 424 ENDIF 426 425 ! ! Parameter control … … 441 440 ! ! indices used for the SUM control 442 441 IF( nictls+nictle+njctls+njctle == 0 ) THEN ! print control done over the default area 443 lsp_area = .FALSE. 442 lsp_area = .FALSE. 444 443 ELSE ! print control done over a specific area 445 444 lsp_area = .TRUE. … … 463 462 ENDIF 464 463 ! 465 IF( nbench == 1 ) THEN ! Benchmark466 SELECT CASE ( cp_cfg )467 CASE ( 'gyre' ) ; CALL ctl_warn( ' The Benchmark is activated ' )468 CASE DEFAULT ; CALL ctl_stop( ' The Benchmark is based on the GYRE configuration:', &469 & ' cp_cfg="gyre" in namelist &namcfg or set nbench = 0' )470 END SELECT471 ENDIF472 !473 464 IF( 1_wp /= SIGN(1._wp,-0._wp) ) CALL ctl_stop( 'nemo_ctl: The intrinsec SIGN function follows ', & 474 465 & 'f2003 standard. ' , & … … 514 505 USE diawri , ONLY: dia_wri_alloc 515 506 USE dom_oce , ONLY: dom_oce_alloc 516 #if defined key_bdy 517 USE bdy_oce , ONLY: bdy_oce_alloc 507 USE bdy_oce , ONLY: ln_bdy, bdy_oce_alloc 518 508 USE oce ! clem: mandatory for LIM3 because needed for bdy arrays 519 #else 520 USE oce , ONLY : sshn, sshb, snwice_mass, snwice_mass_b, snwice_fmass 521 #endif 522 ! 523 INTEGER :: ierr,ierr1,ierr2,ierr3,ierr4,ierr5,ierr6,ierr7,ierr8 524 INTEGER :: jpm 509 ! 510 INTEGER :: ierr 525 511 !!---------------------------------------------------------------------- 526 512 ! 527 513 ierr = dia_wri_alloc () 528 514 ierr = ierr + dom_oce_alloc () ! ocean domain 529 #if defined key_bdy515 ierr = ierr + oce_alloc () ! (tsn...) needed for agrif and/or lim3 and bdy 530 516 ierr = ierr + bdy_oce_alloc () ! bdy masks (incl. initialization) 531 ierr = ierr + oce_alloc () ! (tsn...)532 #endif533 534 #if ! defined key_bdy535 ALLOCATE( snwice_mass(jpi,jpj) , snwice_mass_b(jpi,jpj), &536 & snwice_fmass(jpi,jpj) , STAT= ierr1 )537 !538 ! lim code currently uses surface temperature and salinity in tsn array for initialisation539 ! and ub, vb arrays in ice dynamics, so allocate enough of arrays to use540 ! clem: should not be needed. To be checked out541 jpm = MAX(jp_tem, jp_sal)542 ALLOCATE( tsn(jpi,jpj,1,jpm) , STAT=ierr2 )543 ALLOCATE( ub(jpi,jpj,1) , STAT=ierr3 )544 ALLOCATE( vb(jpi,jpj,1) , STAT=ierr4 )545 ALLOCATE( tsb(jpi,jpj,1,jpm) , STAT=ierr5 )546 ALLOCATE( sshn(jpi,jpj) , STAT=ierr6 )547 ALLOCATE( un(jpi,jpj,1) , STAT=ierr7 )548 ALLOCATE( vn(jpi,jpj,1) , STAT=ierr8 )549 ierr = ierr + ierr1 + ierr2 + ierr3 + ierr4 + ierr5 + ierr6 + ierr7 + ierr8550 #endif551 517 ! 552 518 IF( lk_mpp ) CALL mpp_sum( ierr ) … … 564 530 !! ** Method : 565 531 !!---------------------------------------------------------------------- 566 INTEGER, INTENT(in) :: num_pes! The number of MPI processes we have532 INTEGER, INTENT(in) :: num_pes ! The number of MPI processes we have 567 533 ! 568 534 INTEGER, PARAMETER :: nfactmax = 20 … … 608 574 !! 609 575 !! ** Purpose : return the prime factors of n. 610 !! knfax factors are returned in array kfax which is of 576 !! knfax factors are returned in array kfax which is of 611 577 !! maximum dimension kmaxfax. 612 578 !! ** Method : … … 618 584 INTEGER :: ifac, jl, inu 619 585 INTEGER, PARAMETER :: ntest = 14 620 INTEGER :: ilfax(ntest) 586 INTEGER, DIMENSION(ntest) :: ilfax 587 !!---------------------------------------------------------------------- 621 588 ! 622 589 ! lfax contains the set of allowed factors. 623 data (ilfax(jl),jl=1,ntest) / 16384, 8192, 4096, 2048, 1024, 512, 256, & 624 & 128, 64, 32, 16, 8, 4, 2 / 625 !!---------------------------------------------------------------------- 626 590 ilfax(:) = (/(2**jl,jl=ntest,1,-1)/) 591 ! 627 592 ! Clear the error flag and initialise output vars 628 kerr = 0629 kfax = 1593 kerr = 0 594 kfax = 1 630 595 knfax = 0 631 596 ! 632 597 ! Find the factors of n. 633 598 IF( kn == 1 ) GOTO 20 … … 637 602 ! l points to the allowed factor list. 638 603 ! ifac holds the current factor. 639 604 ! 640 605 inu = kn 641 606 knfax = 0 642 607 ! 643 608 DO jl = ntest, 1, -1 644 609 ! … … 664 629 ! 665 630 END DO 666 631 ! 667 632 20 CONTINUE ! Label 20 is the exit point from the factor search loop. 668 633 ! … … 670 635 671 636 #if defined key_mpp_mpi 637 672 638 SUBROUTINE nemo_northcomms 673 !! ======================================================================639 !!---------------------------------------------------------------------- 674 640 !! *** ROUTINE nemo_northcomms *** 675 !! nemo_northcomms : Setup for north fold exchanges with explicit 676 !! point-to-point messaging 677 !!===================================================================== 678 !!---------------------------------------------------------------------- 679 !! 680 !! ** Purpose : Initialization of the northern neighbours lists. 641 !! ** Purpose : Setup for north fold exchanges with explicit 642 !! point-to-point messaging 643 !! 644 !! ** Method : Initialization of the northern neighbours lists. 681 645 !!---------------------------------------------------------------------- 682 646 !! 1.0 ! 2011-10 (A. C. Coward, NOCS & J. Donners, PRACE) 683 647 !! 2.0 ! 2013-06 Setup avoiding MPI communication (I. Epicoco, S. Mocavero, CMCC) 684 648 !!---------------------------------------------------------------------- 685 686 649 INTEGER :: sxM, dxM, sxT, dxT, jn 687 650 INTEGER :: njmppmax 688 651 !!---------------------------------------------------------------------- 652 ! 689 653 njmppmax = MAXVAL( njmppt ) 690 654 ! 691 655 !initializes the north-fold communication variables 692 656 isendto(:) = 0 693 nsndto = 0694 657 nsndto = 0 658 ! 695 659 !if I am a process in the north 696 660 IF ( njmpp == njmppmax ) THEN … … 721 685 nsndto = nsndto + 1 722 686 isendto(nsndto) = jn 723 END 687 ENDIF 724 688 END DO 725 689 nfsloop = 1 … … 745 709 END SUBROUTINE nemo_northcomms 746 710 #endif 711 747 712 !!====================================================================== 748 713 END MODULE nemogcm -
trunk/NEMOGCM/NEMO/SAS_SRC/sbcssm.F90
r6140 r7646 39 39 LOGICAL :: ln_3d_uve !: specify whether input velocity data is 3D 40 40 LOGICAL :: ln_read_frq !: specify whether we must read frq or not 41 LOGICAL :: l_sasread !: Ice intilisation: read a file (.TRUE.) or anaytical initilaistion in namelist &namsbc_sas 41 42 LOGICAL :: l_initdone = .false. 42 43 INTEGER :: nfld_3d … … 81 82 ! 82 83 IF( nn_timing == 1 ) CALL timing_start( 'sbc_ssm') 83 84 IF( nfld_3d > 0 ) CALL fld_read( kt, 1, sf_ssm_3d ) !== read data at kt time step ==! 85 IF( nfld_2d > 0 ) CALL fld_read( kt, 1, sf_ssm_2d ) !== read data at kt time step ==! 86 ! 87 IF( ln_3d_uve ) THEN 88 ssu_m(:,:) = sf_ssm_3d(jf_usp)%fnow(:,:,1) * umask(:,:,1) ! u-velocity 89 ssv_m(:,:) = sf_ssm_3d(jf_vsp)%fnow(:,:,1) * vmask(:,:,1) ! v-velocity 90 IF( .NOT.ln_linssh ) e3t_m(:,:) = sf_ssm_3d(jf_e3t)%fnow(:,:,1) * tmask(:,:,1) ! v-velocity 84 85 IF ( l_sasread ) THEN 86 IF( nfld_3d > 0 ) CALL fld_read( kt, 1, sf_ssm_3d ) !== read data at kt time step ==! 87 IF( nfld_2d > 0 ) CALL fld_read( kt, 1, sf_ssm_2d ) !== read data at kt time step ==! 88 ! 89 IF( ln_3d_uve ) THEN 90 IF( .NOT. ln_linssh ) e3t_m(:,:) = sf_ssm_3d(jf_e3t)%fnow(:,:,1) * tmask(:,:,1) ! v-velocity 91 ssu_m(:,:) = sf_ssm_3d(jf_usp)%fnow(:,:,1) * umask(:,:,1) ! u-velocity 92 ssv_m(:,:) = sf_ssm_3d(jf_vsp)%fnow(:,:,1) * vmask(:,:,1) ! v-velocity 93 ELSE 94 IF( .NOT. ln_linssh ) e3t_m(:,:) = sf_ssm_2d(jf_e3t)%fnow(:,:,1) * tmask(:,:,1) ! v-velocity 95 ssu_m(:,:) = sf_ssm_2d(jf_usp)%fnow(:,:,1) * umask(:,:,1) ! u-velocity 96 ssv_m(:,:) = sf_ssm_2d(jf_vsp)%fnow(:,:,1) * vmask(:,:,1) ! v-velocity 97 ENDIF 98 ! 99 sst_m(:,:) = sf_ssm_2d(jf_tem)%fnow(:,:,1) * tmask(:,:,1) ! temperature 100 sss_m(:,:) = sf_ssm_2d(jf_sal)%fnow(:,:,1) * tmask(:,:,1) ! salinity 101 ssh_m(:,:) = sf_ssm_2d(jf_ssh)%fnow(:,:,1) * tmask(:,:,1) ! sea surface height 102 IF( ln_read_frq ) THEN 103 frq_m(:,:) = sf_ssm_2d(jf_frq)%fnow(:,:,1) * tmask(:,:,1) ! solar penetration 104 ELSE 105 frq_m(:,:) = 1._wp 106 ENDIF 91 107 ELSE 92 ss u_m(:,:) = sf_ssm_2d(jf_usp)%fnow(:,:,1) * umask(:,:,1) ! u-velocity93 ss v_m(:,:) = sf_ssm_2d(jf_vsp)%fnow(:,:,1) * vmask(:,:,1) ! v-velocity94 IF( .NOT.ln_linssh ) e3t_m(:,:) = sf_ssm_2d(jf_e3t)%fnow(:,:,1) * tmask(:,:,1) ! v-velocity95 ENDIF96 !97 sst_m(:,:) = sf_ssm_2d(jf_tem)%fnow(:,:,1) * tmask(:,:,1) ! temperature98 sss_m(:,:) = sf_ssm_2d(jf_sal)%fnow(:,:,1) * tmask(:,:,1) ! salinity99 ssh_m(:,:) = sf_ssm_2d(jf_ssh)%fnow(:,:,1) * tmask(:,:,1) ! sea surface height100 IF( ln_read_frq ) frq_m(:,:) = sf_ssm_2d(jf_frq)%fnow(:,:,1) * tmask(:,:,1) ! sea surface height101 !108 sst_m(:,:) = 0._wp 109 sss_m(:,:) = 0._wp 110 ssu_m(:,:) = 0._wp 111 ssv_m(:,:) = 0._wp 112 ssh_m(:,:) = 0._wp 113 e3t_m(:,:) = e3t_0(:,:,1) !clem: necessary at least for sas2D 114 frq_m(:,:) = 1._wp ! - - 115 sshn (:,:) = 0._wp ! - - 116 ENDIF 117 102 118 IF ( nn_ice == 1 ) THEN 103 119 tsn(:,:,1,jp_tem) = sst_m(:,:) … … 108 124 ub (:,:,1) = ssu_m(:,:) 109 125 vb (:,:,1) = ssv_m(:,:) 110 126 111 127 IF(ln_ctl) THEN ! print control 112 128 CALL prt_ctl(tab2d_1=sst_m, clinfo1=' sst_m - : ', mask1=tmask, ovlap=1 ) … … 155 171 TYPE(FLD_N) :: sn_ssh, sn_e3t, sn_frq 156 172 ! 157 NAMELIST/namsbc_sas/ cn_dir, ln_3d_uve, ln_read_frq, sn_tem, sn_sal, sn_usp, sn_vsp, sn_ssh, sn_e3t, sn_frq173 NAMELIST/namsbc_sas/l_sasread, cn_dir, ln_3d_uve, ln_read_frq, sn_tem, sn_sal, sn_usp, sn_vsp, sn_ssh, sn_e3t, sn_frq 158 174 !!---------------------------------------------------------------------- 159 175 … … 176 192 WRITE(numout,*) '~~~~~~~~~~~ ' 177 193 WRITE(numout,*) ' Namelist namsbc_sas' 194 WRITE(numout,*) ' Initialisation using an input file = ',l_sasread 178 195 WRITE(numout,*) ' Are we supplying a 3D u,v and e3 field ln_3d_uve = ', ln_3d_uve 179 196 WRITE(numout,*) ' Are we reading frq (fraction of qsr absorbed in the 1st T level) ln_read_frq = ', ln_read_frq … … 204 221 nn_closea = 0 205 222 ENDIF 223 IF (l_sasread) THEN 206 224 ! 207 225 !! following code is a bit messy, but distinguishes between when u,v are 3d arrays and … … 285 303 IF( nfld_2d > 0 ) DEALLOCATE( slf_2d, STAT=ierr ) 286 304 305 ENDIF 306 287 307 CALL sbc_ssm( nit000 ) ! need to define ss?_m arrays used in limistate 288 308 IF( .NOT. ln_read_frq ) frq_m(:,:) = 1. -
trunk/NEMOGCM/NEMO/SAS_SRC/step.F90
r6140 r7646 23 23 USE eosbn2 ! equation of state (eos_bn2 routine) 24 24 USE diawri ! Standard run outputs (dia_wri routine) 25 USE bdy_par ! clem: mandatory for LIM3 26 #if defined key_bdy 25 USE bdy_oce , ONLY: ln_bdy 27 26 USE bdydta ! clem: mandatory for LIM3 28 #endif29 27 USE stpctl ! time stepping control (stp_ctl routine) 30 28 ! … … 38 36 #endif 39 37 38 #if defined key_agrif 39 USE agrif_oce, ONLY: lk_agrif_debug !clem 40 #endif 41 40 42 IMPLICIT NONE 41 43 PRIVATE … … 70 72 #if defined key_agrif 71 73 kstp = nit000 + Agrif_Nb_Step() 74 IF ( lk_agrif_debug ) THEN 75 IF ( Agrif_Root() .and. lwp) Write(*,*) '---' 76 IF (lwp) Write(*,*) 'Grid Number',Agrif_Fixed(),' time step ',kstp, 'int tstep',Agrif_NbStepint() 77 ENDIF 78 79 IF ( kstp == (nit000 + 1) ) lk_agrif_fstep = .FALSE. 80 72 81 # if defined key_iomput 73 82 IF( Agrif_Nbstepint() == 0 ) CALL iom_swap( cxios_context ) 74 83 # endif 75 84 #endif 85 indic = 0 ! although indic is not changed in stp_ctl 86 ! need to keep the same interface 76 87 IF( kstp == nit000 ) CALL iom_init( cxios_context ) ! iom_put initialization (must be done after nemo_init for AGRIF+XIOS+OASIS) 77 88 IF( kstp /= nit000 ) CALL day( kstp ) ! Calendar (day was already called at nit000 in day_init) … … 82 93 ! From SAS: ocean bdy data are wrong (but we do not care) and ice bdy data are OK. 83 94 ! This is not clean and should be changed in the future. 84 #if defined key_bdy 85 IF( lk_bdy ) CALL bdy_dta ( kstp, time_offset=+1 ) ! update dynamic & tracer data at open boundaries 86 #endif 95 IF( ln_bdy ) CALL bdy_dta ( kstp, time_offset=+1 ) ! update dynamic & tracer data at open boundaries 87 96 ! ==> 88 97 CALL sbc ( kstp ) ! Sea Boundary Condition (including sea-ice) … … 90 99 CALL dia_wri( kstp ) ! ocean model: outputs 91 100 92 indic = 0 ! although indic is not changed in stp_ctl 93 ! need to keep the same interface 101 #if defined key_agrif 102 !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 103 ! AGRIF 104 !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 105 CALL Agrif_Integrate_ChildGrids( stp ) 106 #endif 107 108 !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 109 ! Control 110 !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 94 111 CALL stp_ctl( kstp, indic ) 112 IF( indic < 0 ) THEN 113 CALL ctl_stop( 'step: indic < 0' ) 114 CALL dia_wri_state( 'output.abort', kstp ) 115 ENDIF 116 IF( kstp == nit000 ) CALL iom_close( numror ) ! close input ocean restart file (clem: not sure...) 117 95 118 !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 96 119 ! Coupled mode
Note: See TracChangeset
for help on using the changeset viewer.