Changeset 13311 for NEMO/branches/UKMO
- Timestamp:
- 2020-07-16T15:27:24+02:00 (4 years ago)
- Location:
- NEMO/branches/UKMO/NEMO_4.0.1_NGMS_couple_pkg/src/OCE
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
NEMO/branches/UKMO/NEMO_4.0.1_NGMS_couple_pkg/src/OCE/LBC/lib_mpp.F90
r11913 r13311 686 686 ! leave other components deadlocked. 687 687 688 CALL oasis_abort(nproc,"mppstop","NEMO initiated abort") 688 ! RSRH No! 689 IF(ll_abort) THEN 690 !CALL mpi_abort( MPI_COMM_WORLD ) 691 CALL oasis_abort(nproc,"mppstop","NEMO initiated abort") 692 ELSE 693 CALL mppsync 694 CALL mpi_finalize( info ) 695 ENDIF 696 IF( ll_abort ) STOP 123 689 697 690 698 -
NEMO/branches/UKMO/NEMO_4.0.1_NGMS_couple_pkg/src/OCE/SBC/cpl_oasis3.F90
r11914 r13311 95 95 CONTAINS 96 96 97 SUBROUTINE cpl_init( cd_modname, kl_comm ) 97 SUBROUTINE cpl_init( cd_modname, kl_comm ) 98 98 99 !!------------------------------------------------------------------- 99 100 !! *** ROUTINE cpl_init *** … … 104 105 !! ** Method : OASIS3 MPI communication 105 106 !!-------------------------------------------------------------------- 107 USE sbc_oce , ONLY : ln_cpl 106 108 CHARACTER(len = *), INTENT(in ) :: cd_modname ! model name as set in namcouple file 107 109 INTEGER , INTENT( out) :: kl_comm ! local communicator of the model … … 114 116 ! 1st Initialize the OASIS system for the application 115 117 !------------------------------------------------------------------ 116 CALL oasis_init_comp ( ncomp_id, TRIM(cd_modname), nerror )118 CALL oasis_init_comp ( ncomp_id, TRIM(cd_modname), nerror, ln_cpl ) 117 119 IF ( nerror /= OASIS_Ok ) & 118 120 CALL oasis_abort (ncomp_id, 'cpl_init', 'Failure in oasis_init_comp') … … 530 532 !!---------------------------------------------------------------------- 531 533 ! 532 DEALLOCATE( exfld ) 534 IF (ALLOCATED(exfld)) DEALLOCATE( exfld ) 535 533 536 IF (nstop == 0) THEN 534 537 CALL oasis_terminate( nerror ) … … 545 548 !!---------------------------------------------------------------------- 546 549 547 SUBROUTINE oasis_init_comp(k1,cd1,k2 )550 SUBROUTINE oasis_init_comp(k1,cd1,k2,l1) 548 551 CHARACTER(*), INTENT(in ) :: cd1 549 552 INTEGER , INTENT( out) :: k1,k2 … … 554 557 SUBROUTINE oasis_abort(k1,cd1,cd2) 555 558 INTEGER , INTENT(in ) :: k1 556 CHARACTER(*), INTENT(in ) :: cd1,cd2 559 CHARACTER(*), INTENT(in ) :: cd1,cd2 560 LOGICAL , OPTIONAL, INTENT(in ) :: l1 557 561 WRITE(numout,*) 'oasis_abort: Error you sould not be there...', cd1, cd2 558 562 END SUBROUTINE oasis_abort -
NEMO/branches/UKMO/NEMO_4.0.1_NGMS_couple_pkg/src/OCE/SBC/sbccpl.F90
r11914 r13311 466 466 ! ! ------------------------- ! 467 467 srcv(jpr_rnf )%clname = 'O_Runoff' 468 IF( TRIM( sn_rcv_rnf%cldes ) == 'coupled' ) THEN 469 srcv(jpr_rnf)%laction = .TRUE. 470 l_rnfcpl = .TRUE. ! -> no need to read runoffs in sbcrnf 471 ln_rnf = nn_components /= jp_iam_sas ! -> force to go through sbcrnf if not sas 472 IF(lwp) WRITE(numout,*) 473 IF(lwp) WRITE(numout,*) ' runoffs received from oasis -> force ln_rnf = ', ln_rnf 474 ENDIF 468 IF (ln_cpl) THEN ! Don't perform this code if coupling is not active! 469 IF( TRIM( sn_rcv_rnf%cldes ) == 'coupled' ) THEN 470 srcv(jpr_rnf)%laction = .TRUE. 471 l_rnfcpl = .TRUE. ! -> no need to read runoffs in sbcrnf 472 ln_rnf = nn_components /= jp_iam_sas ! -> force to go through sbcrnf if not sas 473 IF(lwp) WRITE(numout,*) 474 IF(lwp) WRITE(numout,*) ' runoffs received from oasis -> force ln_rnf = ', ln_rnf 475 ENDIF 476 ENDIF 475 477 ! 476 478 srcv(jpr_cal)%clname = 'OCalving' ; IF( TRIM( sn_rcv_cal%cldes) == 'coupled' ) srcv(jpr_cal)%laction = .TRUE. … … 543 545 ! ! ------------------------- ! 544 546 srcv(jpr_co2 )%clname = 'O_AtmCO2' 545 IF( TRIM(sn_rcv_co2%cldes ) == 'coupled' ) THEN 546 srcv(jpr_co2 )%laction = .TRUE. 547 l_co2cpl = .TRUE. 548 IF(lwp) WRITE(numout,*) 549 IF(lwp) WRITE(numout,*) ' Atmospheric pco2 received from oasis ' 550 IF(lwp) WRITE(numout,*) 547 IF (ln_cpl) THEN ! Not needed if we're not coupling 548 IF( TRIM(sn_rcv_co2%cldes ) == 'coupled' ) THEN 549 srcv(jpr_co2 )%laction = .TRUE. 550 l_co2cpl = .TRUE. 551 IF(lwp) WRITE(numout,*) 552 IF(lwp) WRITE(numout,*) ' Atmospheric pco2 received from oasis ' 553 IF(lwp) WRITE(numout,*) 554 ENDIF 551 555 ENDIF 552 556 ! … … 1032 1036 ! ================================ ! 1033 1037 1034 CALL cpl_define(jprcv, jpsnd, nn_cplmodel) 1038 ! If ln_cpl is false, clearly we don't want to call cpl_dfine! 1039 if (ln_cpl) CALL cpl_define(jprcv, jpsnd, nn_cplmodel) 1035 1040 1036 1041 IF (ln_usecplmask) THEN -
NEMO/branches/UKMO/NEMO_4.0.1_NGMS_couple_pkg/src/OCE/nemogcm.F90
r11913 r13311 41 41 !! nemo_alloc : dynamical allocation 42 42 !!---------------------------------------------------------------------- 43 USE mod_oasis ! RSRH temp 43 44 USE step_oce ! module used in the ocean time stepping module (step.F90) 44 45 USE phycst ! physical constant (par_cst routine) … … 130 131 !! Madec, 2008, internal report, IPSL. 131 132 !!---------------------------------------------------------------------- 132 INTEGER :: istp ! time step index133 INTEGER :: istp, nerror ! time step index 133 134 REAL(wp):: zstptiming ! elapsed time for 1 time step 134 135 !!---------------------------------------------------------------------- … … 200 201 ENDIF 201 202 202 IF (lk_oasis) THEN 203 CALL sbc_cpl_snd( istp ) ! Coupling to atmos 204 ENDIF 203 ! RSRH. You can compile with OASIS but not want to do any 204 ! coupling. We need to cater for that properly! 205 IF (ln_cpl) CALL sbc_cpl_snd( istp ) ! Coupling to atmos 206 205 207 CALL stp ( istp ) 206 208 istp = istp + 1 … … 239 241 IF( ln_timing ) CALL timing_finalize 240 242 ! 243 write(numout,*) "RSRH calling nemo_closefile " , lk_oasis; flush(numout) 241 244 CALL nemo_closefile 245 write(numout,*) "RSRH done closefiles " , lk_oasis; flush(numout) 242 246 ! 243 247 #if defined key_iomput 244 CALL xios_finalize ! end mpp communications with xios 245 IF( lk_oasis ) CALL cpl_finalize ! end coupling and mpp communications with OASIS 248 CALL xios_finalize() ! end mpp communications with xios 249 250 IF (lk_oasis) CALL oasis_terminate(nerror) 251 CALL mppstop ! RSRH temp for development 252 !IF( lk_oasis ) CALL cpl_finalize() ! end coupling and mpp communications with OASIS 246 253 #else 247 IF ( lk_oasis ) THEN ; CALL cpl_finalize ! end coupling and mpp communications with OASIS 248 ELSEIF( lk_mpp ) THEN ; CALL mppstop ! end mpp communications 254 IF ( lk_oasis ) THEN 255 CALL cpl_finalize() ! end coupling and mpp communications with OASIS 256 ELSEIF( lk_mpp ) THEN 257 CALL mppstop ! end mpp communications 249 258 ENDIF 250 259 #endif 251 260 ! 252 261 IF(lwm) THEN 253 IF( nstop == 0 ) THEN ; STOP 0 254 ELSE ; STOP 123 262 IF( nstop == 0 ) THEN 263 STOP 0 264 ELSE 265 STOP 123 255 266 ENDIF 256 267 ENDIF … … 265 276 !! ** Purpose : initialization of the NEMO GCM 266 277 !!---------------------------------------------------------------------- 267 INTEGER :: ios, ilocal_comm 278 INTEGER :: ios, ilocal_comm, nerror, ncomp_id, llmpi_init, ierr ! local integers 268 279 !! 269 280 NAMELIST/namctl/ ln_ctl , sn_cfctl, nn_print, nn_ictls, nn_ictle, & … … 281 292 ! 282 293 #if defined key_iomput 283 IF( Agrif_Root() ) THEN 284 IF( lk_oasis ) THEN 285 CALL cpl_init( "toyoce", ilocal_comm ) ! nemo local communicator given by oasis 286 CALL xios_initialize( "not used" , local_comm =ilocal_comm ) ! send nemo communicator to xios 287 ELSE 288 CALL xios_initialize( "for_xios_mpi_id", return_comm=ilocal_comm ) ! nemo local communicator given by xios 289 ENDIF 294 ! IF( Agrif_Root() ) THEN 295 ! IF( lk_oasis ) THEN 296 ! CALL cpl_init( "toyoce", ilocal_comm ) ! nemo local communicator given by oasis 297 ! CALL xios_initialize( "not used" , local_comm =ilocal_comm ) ! send nemo communicator to xios 298 ! ELSE 299 ! CALL xios_initialize( "for_xios_mpi_id", return_comm=ilocal_comm ) ! nemo local communicator given by xios 300 ! ENDIF 301 ! ENDIF 302 ! RSRH simplify initialisaton for test 303 IF( lk_oasis ) THEN 304 CALL mpi_init(nerror) 305 CALL oasis_init_comp ( ncomp_id, "toyoce", nerror, .FALSE. ) 306 ! CALL cpl_init( "toyoce", ilocal_comm ) 307 CALL oasis_get_localcomm ( ilocal_comm , nerror ) 308 CALL xios_initialize( "toyoce", local_comm =ilocal_comm ) 290 309 ENDIF 291 310 CALL mpp_start( ilocal_comm ) … … 330 349 lwp = (narea == 1) .OR. ln_ctl ! control of all listing output print 331 350 ! 351 WRITE(numout,*) "RSRH NEMO start local com=",ilocal_comm ; flush(numout) 352 WRITE(numout,*) "RSRH NEMO my rank=",mpprank ; flush(numout) 332 353 IF(lwp) THEN ! open listing units 333 354 ! … … 335 356 & CALL ctl_opn( numout, 'ocean.output', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, -1, .FALSE., narea ) 336 357 ! 358 359 WRITE(numout,*) "RSRH NEMO start local com=",ilocal_comm ; flush(numout) 360 WRITE(numout,*) "RSRH NEMO my rank=",mpprank ; flush(numout) 361 337 362 WRITE(numout,*) 338 363 WRITE(numout,*) ' CNRS - NERC - Met OFFICE - MERCATOR-ocean - CMCC' … … 625 650 ! 626 651 CALL iom_close ! close all input/output files managed by iom_* 652 653 write(numout,*) "RSRH after iom_close";flush(numout) 627 654 ! 628 655 IF( numstp /= -1 ) CLOSE( numstp ) ! time-step file … … 640 667 IF( numdct_salt /= -1 ) CLOSE( numdct_salt ) ! salt transports 641 668 ! 642 numout = 6 ! redefine numout in case it is used after this point...669 ! numout = 6 ! redefine numout in case it is used after this point... 643 670 ! 644 671 END SUBROUTINE nemo_closefile
Note: See TracChangeset
for help on using the changeset viewer.