New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
Changeset 15261 for NEMO/branches/UKMO/NEMO_4.0.1_NGMS_couple_stage3/src/OCE/nemogcm.F90 – NEMO

Ignore:
Timestamp:
2021-09-15T13:10:27+02:00 (3 years ago)
Author:
frrh
Message:

Update with latest changes to ensure NEMO will run satnd alone AND
in coupled mode from the same suite, subject to appropriate
cpp key and other adjusted settings.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/UKMO/NEMO_4.0.1_NGMS_couple_stage3/src/OCE/nemogcm.F90

    r13443 r15261  
    4141   !!   nemo_alloc    : dynamical allocation 
    4242   !!---------------------------------------------------------------------- 
    43    USE mod_oasis ! RSRH temp 
     43#if defined key_oasis3 
     44   USE mod_oasis      ! For coupling 
     45#endif 
    4446   USE step_oce       ! module used in the ocean time stepping module (step.F90) 
    4547   USE phycst         ! physical constant                  (par_cst routine) 
     
    156158 
    157159      IF(lwp) WRITE(numout,cform_aaa)   ! Flag AAAAAAA 
     160      WRITE(numout,*)"RSRH at time stepping" ; flush(numout) 
     161 
    158162 
    159163      !                            !-----------------------! 
     
    235239      !                            !==  finalize the run  ==! 
    236240      !                            !------------------------! 
     241      WRITE(numout,*)"RSRH at finalize" ; flush(numout) 
    237242      IF(lwp) WRITE(numout,cform_aaa)        ! Flag AAAAAAA 
    238243      ! 
     
    246251      write(numout,*) "RSRH calling nemo_closefile " , lk_oasis; flush(numout) 
    247252      CALL nemo_closefile 
    248       write(numout,*) "RSRH done closefiles " , lk_oasis; flush(numout) 
    249253      ! 
    250254#if defined key_iomput 
    251255      CALL xios_finalize()  ! end mpp communications with xios 
    252256 
    253       IF (lk_oasis)  CALL oasis_terminate(nerror) 
    254       CALL mppstop ! RSRH temp for development 
    255       !IF( lk_oasis     )            CALL cpl_finalize()   ! end coupling and mpp communications with OASIS 
     257#if defined key_oasis3 
     258      IF (lk_oasis)  THEN 
     259         CALL oasis_terminate(nerror) 
     260         CALL mppstop      ! end mpp communications 
     261      ELSEIF( lk_mpp   ) THEN 
     262         CALL mppstop ! RSRH temp for development 
     263      ENDIF 
     264#endif 
     265 
    256266#else 
     267      ! RSRH It's unclear if the following will work  
     268      ! since we never compile w/o key_iomput 
    257269      IF    ( lk_oasis ) THEN    
    258270          CALL cpl_finalize()   ! end coupling and mpp communications with OASIS 
     
    294306      !                             !-------------------------------------------------! 
    295307      ! 
     308 
    296309#if defined key_iomput 
    297 !      IF( Agrif_Root() ) THEN 
    298 !         IF( lk_oasis ) THEN 
    299 !            CALL cpl_init( "toyoce", ilocal_comm )                     ! nemo local communicator given by oasis 
    300 !            CALL xios_initialize( "not used"       , local_comm =ilocal_comm )   ! send nemo communicator to xios 
    301 !         ELSE 
    302 !            CALL xios_initialize( "for_xios_mpi_id", return_comm=ilocal_comm )   ! nemo local communicator given by xios 
    303 !         ENDIF 
    304 !      ENDIF 
    305 ! RSRH simplify initialisaton for test 
     310      IF( Agrif_Root() ) THEN 
     311        IF(.not.lk_oasis) THEN 
     312          CALL xios_initialize( "for_xios_mpi_id", return_comm=ilocal_comm )   ! nemo local communicator given by xios 
     313        ENDIF 
     314      ENDIF  
     315 
     316#if defined key_oasis3 
    306317      IF( lk_oasis ) THEN 
    307318          CALL mpi_init(nerror) 
    308319          CALL oasis_init_comp ( ncomp_id, "toyoce", nerror, .TRUE. ) 
    309 !          CALL cpl_init( "toyoce", ilocal_comm )  
    310320          CALL oasis_get_localcomm ( ilocal_comm , nerror ) 
    311321          CALL xios_initialize( "toyoce", local_comm =ilocal_comm ) 
    312322      ENDIF 
     323#endif 
     324 
    313325      CALL mpp_start( ilocal_comm ) 
    314 #else 
    315       IF( lk_oasis ) THEN 
    316          IF( Agrif_Root() ) THEN 
    317             CALL cpl_init( "toyoce", ilocal_comm )                      ! nemo local communicator given by oasis 
    318          ENDIF 
    319          CALL mpp_start( ilocal_comm ) 
    320       ELSE 
    321          CALL mpp_start( ) 
    322       ENDIF 
    323 #endif 
     326#endif 
     327 
    324328      ! 
    325329      narea = mpprank + 1               ! mpprank: the rank of proc (0 --> mppsize -1 ) 
     
    352356      lwp = (narea == 1) .OR. ln_ctl    ! control of all listing output print 
    353357      ! 
    354 WRITE(numout,*) "RSRH NEMO start local com=",ilocal_comm ; flush(numout)  
    355 WRITE(numout,*) "RSRH NEMO my rank=",mpprank ; flush(numout)  
    356358      IF(lwp) THEN                      ! open listing units 
    357359         ! 
     
    359361            &            CALL ctl_opn( numout, 'ocean.output', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, -1, .FALSE., narea ) 
    360362         ! 
    361  
    362 WRITE(numout,*) "RSRH NEMO start local com=",ilocal_comm ; flush(numout)  
    363 WRITE(numout,*) "RSRH NEMO my rank=",mpprank ; flush(numout)  
    364363 
    365364         WRITE(numout,*) 
     
    654653      CALL iom_close                                 ! close all input/output files managed by iom_* 
    655654 
    656 write(numout,*) "RSRH after iom_close";flush(numout) 
    657655      ! 
    658656      IF( numstp          /= -1 )   CLOSE( numstp          )   ! time-step file 
Note: See TracChangeset for help on using the changeset viewer.