Changeset 3294 for trunk/NEMOGCM/NEMO/OPA_SRC/nemogcm.F90
- Timestamp:
- 2012-01-28T17:44:18+01:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/NEMOGCM/NEMO/OPA_SRC/nemogcm.F90
r2715 r3294 27 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 !! 4.0 ! 2011-01 (A. R. Porter, STFC Daresbury) dynamical allocation 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 30 31 !!---------------------------------------------------------------------- 31 32 … … 46 47 USE domain ! domain initialization (dom_init routine) 47 48 USE obcini ! open boundary cond. initialization (obc_ini routine) 48 USE bdyini ! unstructured open boundary cond. initialization (bdy_init routine) 49 USE bdyini ! open boundary cond. initialization (bdy_init routine) 50 USE bdydta ! open boundary cond. initialization (bdy_dta_init routine) 51 USE bdytides ! open boundary cond. initialization (tide_init routine) 49 52 USE istate ! initial state setting (istate_init routine) 50 53 USE ldfdyn ! lateral viscosity setting (ldfdyn_init routine) … … 53 56 USE phycst ! physical constant (par_cst routine) 54 57 USE trdmod ! momentum/tracers trends (trd_mod_init routine) 55 USE asminc ! assimilation increments (asm_inc_init routine)56 58 USE asmtrj ! writing out state trajectory 57 USE sshwzv ! vertical velocity used in asm58 59 USE diaptr ! poleward transports (dia_ptr_init routine) 60 USE diadct ! sections transports (dia_dct_init routine) 59 61 USE diaobs ! Observation diagnostics (dia_obs_init routine) 60 62 USE step ! NEMO time-stepping (stp routine) … … 171 173 ENDIF 172 174 ! 175 #if defined key_agrif 176 CALL Agrif_ParentGrid_To_ChildGrid() 177 IF( lk_diaobs ) CALL dia_obs_wri 178 IF( nn_timing == 1 ) CALL timing_finalize 179 CALL Agrif_ChildGrid_To_ParentGrid() 180 #endif 181 IF( nn_timing == 1 ) CALL timing_finalize 182 ! 173 183 CALL nemo_closefile 174 184 #if defined key_oasis3 || defined key_oasis4 … … 192 202 !! 193 203 NAMELIST/namctl/ ln_ctl , nn_print, nn_ictls, nn_ictle, & 194 & nn_isplt, nn_jsplt, nn_jctls, nn_jctle, nn_bench 204 & nn_isplt, nn_jsplt, nn_jctls, nn_jctle, & 205 & nn_bench, nn_timing 195 206 !!---------------------------------------------------------------------- 196 207 ! … … 245 256 IF( Agrif_Root() ) THEN 246 257 jpi = ( jpiglo-2*jpreci + (jpni-1) ) / jpni + 2*jpreci ! first dim. 258 #if defined key_nemocice_decomp 259 jpj = ( jpjglo+1-2*jprecj + (jpnj-1) ) / jpnj + 2*jprecj ! second dim. 260 #else 247 261 jpj = ( jpjglo-2*jprecj + (jpnj-1) ) / jpnj + 2*jprecj ! second dim. 262 #endif 248 263 jpk = jpkdta ! third dim 249 264 jpim1 = jpi-1 ! inner domain indices … … 258 273 ! 259 274 WRITE(numout,*) 260 WRITE(numout,*) ' CNRS - NERC - Met OFFICE - MERCATOR-ocean'275 WRITE(numout,*) ' CNRS - NERC - Met OFFICE - MERCATOR-ocean - INGV - CMCC' 261 276 WRITE(numout,*) ' NEMO team' 262 277 WRITE(numout,*) ' Ocean General Circulation Model' 263 WRITE(numout,*) ' version 3. 3 (2010) '278 WRITE(numout,*) ' version 3.4 (2011) ' 264 279 WRITE(numout,*) 265 280 WRITE(numout,*) … … 286 301 ENDIF 287 302 ! 303 IF( nn_timing == 1 ) CALL timing_init 304 ! 288 305 ! ! General initialization 289 306 CALL phy_cst ! Physical constants … … 292 309 CALL dom_init ! Domain 293 310 311 IF( ln_nnogather ) CALL nemo_northcomms ! Initialise the northfold neighbour lists (must be done after the masks are defined) 312 294 313 IF( ln_ctl ) CALL prt_ctl_init ! Print control 295 314 296 315 IF( lk_obc ) CALL obc_init ! Open boundaries 297 IF( lk_bdy ) CALL bdy_init ! Unstructured open boundaries 316 IF( lk_bdy ) CALL bdy_init ! Open boundaries initialisation 317 IF( lk_bdy ) CALL bdy_dta_init ! Open boundaries initialisation of external data arrays 318 IF( lk_bdy ) CALL tide_init ! Open boundaries initialisation of tidal harmonic forcing 319 320 CALL flush(numout) 321 CALL dyn_nept_init ! simplified form of Neptune effect 322 CALL flush(numout) 298 323 299 324 CALL istate_init ! ocean initial state (Dynamics and tracers) … … 320 345 CALL tra_bbc_init ! bottom heat flux 321 346 IF( lk_trabbl ) CALL tra_bbl_init ! advective (and/or diffusive) bottom boundary layer scheme 322 IF( l k_tradmp ) CALL tra_dmp_init ! internal damping trends347 IF( ln_tradmp ) CALL tra_dmp_init ! internal damping trends 323 348 CALL tra_adv_init ! horizontal & vertical advection 324 349 CALL tra_ldf_init ! lateral mixing … … 341 366 #endif 342 367 ! ! Diagnostics 368 IF( lk_floats ) CALL flo_init ! drifting Floats 343 369 CALL iom_init ! iom_put initialization 344 IF( lk_floats ) CALL flo_init ! drifting Floats345 370 IF( lk_diaar5 ) CALL dia_ar5_init ! ar5 diag 346 371 CALL dia_ptr_init ! Poleward TRansports initialization 372 IF( lk_diadct ) CALL dia_dct_init ! Sections tranports 347 373 CALL dia_hsb_init ! heat content, salt content and volume budgets 348 374 CALL trd_mod_init ! Mixed-layer/Vorticity/Integral constraints trends … … 394 420 ! 395 421 IF( ln_ctl ) THEN ! sub-domain area indices for the control prints 396 IF( lk_mpp ) THEN422 IF( lk_mpp .AND. jpnij > 1 ) THEN 397 423 isplt = jpni ; jsplt = jpnj ; ijsplt = jpni*jpnj ! the domain is forced to the real split domain 398 424 ELSE … … 456 482 CALL iom_close ! close all input/output files managed by iom_* 457 483 ! 458 IF( numstp /= -1 ) CLOSE( numstp ) ! time-step file 459 IF( numsol /= -1 ) CLOSE( numsol ) ! solver file 460 IF( numnam /= -1 ) CLOSE( numnam ) ! oce namelist 461 IF( numnam_ice /= -1 ) CLOSE( numnam_ice ) ! ice namelist 462 IF( numevo_ice /= -1 ) CLOSE( numevo_ice ) ! ice variables (temp. evolution) 463 IF( numout /= 6 ) CLOSE( numout ) ! standard model output file 484 IF( numstp /= -1 ) CLOSE( numstp ) ! time-step file 485 IF( numsol /= -1 ) CLOSE( numsol ) ! solver file 486 IF( numnam /= -1 ) CLOSE( numnam ) ! oce namelist 487 IF( numnam_ice /= -1 ) CLOSE( numnam_ice ) ! ice namelist 488 IF( numevo_ice /= -1 ) CLOSE( numevo_ice ) ! ice variables (temp. evolution) 489 IF( numout /= 6 ) CLOSE( numout ) ! standard model output file 490 IF( numdct_vol /= -1 ) CLOSE( numdct_vol ) ! volume transports 491 IF( numdct_heat /= -1 ) CLOSE( numdct_heat ) ! heat transports 492 IF( numdct_salt /= -1 ) CLOSE( numdct_salt ) ! salt transports 493 464 494 ! 465 495 numout = 6 ! redefine numout in case it is used after this point... … … 481 511 USE ldftra_oce, ONLY: ldftra_oce_alloc 482 512 USE trc_oce , ONLY: trc_oce_alloc 483 USE wrk_nemo , ONLY: wrk_alloc484 513 ! 485 514 INTEGER :: ierr … … 495 524 ierr = ierr + lib_mpp_alloc (numout) ! mpp exchanges 496 525 ierr = ierr + trc_oce_alloc () ! shared TRC / TRA arrays 497 !498 ierr = ierr + wrk_alloc(numout, lwp) ! workspace499 526 ! 500 527 IF( lk_mpp ) CALL mpp_sum( ierr ) … … 617 644 END SUBROUTINE factorise 618 645 646 #if defined key_mpp_mpi 647 SUBROUTINE nemo_northcomms 648 !!====================================================================== 649 !! *** ROUTINE nemo_northcomms *** 650 !! nemo_northcomms : Setup for north fold exchanges with explicit peer to peer messaging 651 !!===================================================================== 652 !!---------------------------------------------------------------------- 653 !! 654 !! ** Purpose : Initialization of the northern neighbours lists. 655 !!---------------------------------------------------------------------- 656 !! 1.0 ! 2011-10 (A. C. Coward, NOCS & J. Donners, PRACE) 657 !!---------------------------------------------------------------------- 658 659 INTEGER :: ji, jj, jk, ij, jtyp ! dummy loop indices 660 INTEGER :: ijpj ! number of rows involved in north-fold exchange 661 INTEGER :: northcomms_alloc ! allocate return status 662 REAL(wp), ALLOCATABLE, DIMENSION ( :,: ) :: znnbrs ! workspace 663 LOGICAL, ALLOCATABLE, DIMENSION ( : ) :: lrankset ! workspace 664 665 IF(lwp) WRITE(numout,*) 666 IF(lwp) WRITE(numout,*) 'nemo_northcomms : Initialization of the northern neighbours lists' 667 IF(lwp) WRITE(numout,*) '~~~~~~~~~~' 668 669 !!---------------------------------------------------------------------- 670 ALLOCATE( znnbrs(jpi,jpj), stat = northcomms_alloc ) 671 ALLOCATE( lrankset(jpnij), stat = northcomms_alloc ) 672 IF( northcomms_alloc /= 0 ) THEN 673 WRITE(numout,cform_war) 674 WRITE(numout,*) 'northcomms_alloc : failed to allocate arrays' 675 CALL ctl_stop( 'STOP', 'nemo_northcomms : unable to allocate temporary arrays' ) 676 ENDIF 677 nsndto = 0 678 isendto = -1 679 ijpj = 4 680 ! 681 ! This routine has been called because ln_nnogather has been set true ( nammpp ) 682 ! However, these first few exchanges have to use the mpi_allgather method to 683 ! establish the neighbour lists to use in subsequent peer to peer exchanges. 684 ! Consequently, set l_north_nogather to be false here and set it true only after 685 ! the lists have been established. 686 ! 687 l_north_nogather = .FALSE. 688 ! 689 ! Exchange and store ranks on northern rows 690 691 DO jtyp = 1,4 692 693 lrankset = .FALSE. 694 znnbrs = narea 695 SELECT CASE (jtyp) 696 CASE(1) 697 CALL lbc_lnk( znnbrs, 'T', 1. ) ! Type 1: T,W-points 698 CASE(2) 699 CALL lbc_lnk( znnbrs, 'U', 1. ) ! Type 2: U-point 700 CASE(3) 701 CALL lbc_lnk( znnbrs, 'V', 1. ) ! Type 3: V-point 702 CASE(4) 703 CALL lbc_lnk( znnbrs, 'F', 1. ) ! Type 4: F-point 704 END SELECT 705 706 IF ( njmppt(narea) .EQ. MAXVAL( njmppt ) ) THEN 707 DO jj = nlcj-ijpj+1, nlcj 708 ij = jj - nlcj + ijpj 709 DO ji = 1,jpi 710 IF ( INT(znnbrs(ji,jj)) .NE. 0 .AND. INT(znnbrs(ji,jj)) .NE. narea ) & 711 & lrankset(INT(znnbrs(ji,jj))) = .true. 712 END DO 713 END DO 714 715 DO jj = 1,jpnij 716 IF ( lrankset(jj) ) THEN 717 nsndto(jtyp) = nsndto(jtyp) + 1 718 IF ( nsndto(jtyp) .GT. jpmaxngh ) THEN 719 CALL ctl_stop( ' Too many neighbours in nemo_northcomms ', & 720 & ' jpmaxngh will need to be increased ') 721 ENDIF 722 isendto(nsndto(jtyp),jtyp) = jj-1 ! narea converted to MPI rank 723 ENDIF 724 END DO 725 ENDIF 726 727 END DO 728 729 ! 730 ! Type 5: I-point 731 ! 732 ! ICE point exchanges may involve some averaging. The neighbours list is 733 ! built up using two exchanges to ensure that the whole stencil is covered. 734 ! lrankset should not be reset between these 'J' and 'K' point exchanges 735 736 jtyp = 5 737 lrankset = .FALSE. 738 znnbrs = narea 739 CALL lbc_lnk( znnbrs, 'J', 1. ) ! first ice U-V point 740 741 IF ( njmppt(narea) .EQ. MAXVAL( njmppt ) ) THEN 742 DO jj = nlcj-ijpj+1, nlcj 743 ij = jj - nlcj + ijpj 744 DO ji = 1,jpi 745 IF ( INT(znnbrs(ji,jj)) .NE. 0 .AND. INT(znnbrs(ji,jj)) .NE. narea ) & 746 & lrankset(INT(znnbrs(ji,jj))) = .true. 747 END DO 748 END DO 749 ENDIF 750 751 znnbrs = narea 752 CALL lbc_lnk( znnbrs, 'K', 1. ) ! second ice U-V point 753 754 IF ( njmppt(narea) .EQ. MAXVAL( njmppt )) THEN 755 DO jj = nlcj-ijpj+1, nlcj 756 ij = jj - nlcj + ijpj 757 DO ji = 1,jpi 758 IF ( INT(znnbrs(ji,jj)) .NE. 0 .AND. INT(znnbrs(ji,jj)) .NE. narea ) & 759 & lrankset( INT(znnbrs(ji,jj))) = .true. 760 END DO 761 END DO 762 763 DO jj = 1,jpnij 764 IF ( lrankset(jj) ) THEN 765 nsndto(jtyp) = nsndto(jtyp) + 1 766 IF ( nsndto(jtyp) .GT. jpmaxngh ) THEN 767 CALL ctl_stop( ' Too many neighbours in nemo_northcomms ', & 768 & ' jpmaxngh will need to be increased ') 769 ENDIF 770 isendto(nsndto(jtyp),jtyp) = jj-1 ! narea converted to MPI rank 771 ENDIF 772 END DO 773 ! 774 ! For northern row areas, set l_north_nogather so that all subsequent exchanges 775 ! can use peer to peer communications at the north fold 776 ! 777 l_north_nogather = .TRUE. 778 ! 779 ENDIF 780 DEALLOCATE( znnbrs ) 781 DEALLOCATE( lrankset ) 782 783 END SUBROUTINE nemo_northcomms 784 #else 785 SUBROUTINE nemo_northcomms ! Dummy routine 786 WRITE(*,*) 'nemo_northcomms: You should not have seen this print! error?' 787 END SUBROUTINE nemo_northcomms 788 #endif 619 789 !!====================================================================== 620 790 END MODULE nemogcm
Note: See TracChangeset
for help on using the changeset viewer.