Changeset 7129
- Timestamp:
- 2016-10-27T13:01:25+02:00 (8 years ago)
- Location:
- branches/UKMO/r5936_hadgem3_mct/NEMOGCM/NEMO/OPA_SRC
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/UKMO/r5936_hadgem3_mct/NEMOGCM/NEMO/OPA_SRC/DIA/diadimg.F90
r7127 r7129 124 124 125 125 CASE DEFAULT 126 IF(lwp) WRITE(numout,*) ' E R R O R : bad cd_type in dia_wri_dimg ' 127 STOP 'dia_wri_dimg' 128 126 WRITE(numout,*) ' E R R O R : bad cd_type in dia_wri_dimg ' 127 CALL ctl_stop( 'STOP', 'dia_wri_dimg :bad cd_type in dia_wri_dimg ' ) 129 128 END SELECT 130 129 -
branches/UKMO/r5936_hadgem3_mct/NEMOGCM/NEMO/OPA_SRC/LBC/lib_mpp.F90
r7127 r7129 62 62 USE lbcnfd ! north fold treatment 63 63 USE in_out_manager ! I/O manager 64 USE mod_oasis ! coupling routines 64 65 65 66 IMPLICIT NONE … … 2023 2024 !!---------------------------------------------------------------------- 2024 2025 ! 2026 #if defined key_oasis3 || defined key_oasis3mct 2027 ! If we're trying to shut down cleanly then we need to consider the fact 2028 ! that this could be part of an MPMD configuration - we don't want to 2029 ! leave other components deadlocked. 2030 CALL oasis_abort(nproc,"mppstop","NEMO initiated abort") 2031 #else 2025 2032 CALL mppsync 2026 2033 CALL mpi_finalize( info ) 2034 #endif 2027 2035 ! 2028 2036 END SUBROUTINE mppstop -
branches/UKMO/r5936_hadgem3_mct/NEMOGCM/NEMO/OPA_SRC/SBC/cpl_oasis3.F90
r7127 r7129 25 25 !! cpl_finalize : finalize the coupled mode communication 26 26 !!---------------------------------------------------------------------- 27 #if defined key_oasis3 27 #if defined key_oasis3 || defined key_oasis3mct 28 28 USE mod_oasis ! OASIS3-MCT module 29 29 #endif … … 32 32 USE in_out_manager ! I/O manager 33 33 USE lbclnk ! ocean lateral boundary conditions (or mpp link) 34 35 #if defined key_cpl_rootexchg 36 USE lib_mpp, only : mppsync 37 USE lib_mpp, only : mppscatter,mppgather 38 #endif 34 39 35 40 IMPLICIT NONE … … 42 47 PUBLIC cpl_freq 43 48 PUBLIC cpl_finalize 49 #if defined key_mpp_mpi 50 INCLUDE 'mpif.h' 51 #endif 52 53 INTEGER, PARAMETER :: localRoot = 0 54 LOGICAL :: commRank ! true for ranks doing OASIS communication 55 #if defined key_cpl_rootexchg 56 LOGICAL :: rootexchg =.true. ! logical switch 57 #else 58 LOGICAL :: rootexchg =.false. ! logical switch 59 #endif 44 60 45 61 INTEGER, PUBLIC :: OASIS_Rcv = 1 !: return code if received field … … 47 63 INTEGER :: ncomp_id ! id returned by oasis_init_comp 48 64 INTEGER :: nerror ! return error code 49 #if ! defined key_oasis3 65 #if ! defined key_oasis3 && ! defined key_oasis3mct 50 66 ! OASIS Variables not used. defined only for compilation purpose 51 67 INTEGER :: OASIS_Out = -1 … … 83 99 84 100 REAL(wp), DIMENSION(:,:), ALLOCATABLE :: exfld ! Temporary buffer for receiving 101 REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: tbuf ! Temporary buffer for sending / receiving 102 INTEGER, PUBLIC :: localComm 85 103 86 104 !!---------------------------------------------------------------------- … … 121 139 IF ( nerror /= OASIS_Ok ) & 122 140 CALL oasis_abort (ncomp_id, 'cpl_init','Failure in oasis_get_localcomm' ) 141 localComm = kl_comm 123 142 ! 124 143 END SUBROUTINE cpl_init … … 149 168 IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~~~~~~' 150 169 IF(lwp) WRITE(numout,*) 170 171 commRank = .false. 172 IF ( rootexchg ) THEN 173 IF ( nproc == localRoot ) commRank = .true. 174 ELSE 175 commRank = .true. 176 ENDIF 151 177 152 178 ncplmodel = kcplmodel … … 172 198 ishape(:,2) = (/ 1, nlej-nldj+1 /) 173 199 ! 174 ! ... Allocate memory for data exchange175 !176 ALLOCATE(exfld(nlei-nldi+1, nlej-nldj+1), stat = nerror)177 IF( nerror > 0 ) THEN178 CALL oasis_abort ( ncomp_id, 'cpl_define', 'Failure in allocating exfld') ; RETURN179 ENDIF180 200 ! 181 201 ! ----------------------------------------------------------------- 182 202 ! ... Define the partition 183 203 ! ----------------------------------------------------------------- 204 205 IF ( rootexchg ) THEN 206 207 paral(1) = 2 ! box partitioning 208 paral(2) = 0 ! NEMO lower left corner global offset 209 paral(3) = jpiglo ! local extent in i 210 paral(4) = jpjglo ! local extent in j 211 paral(5) = jpiglo ! global extent in x 212 213 ELSE 184 214 185 215 paral(1) = 2 ! box partitioning … … 196 226 ENDIF 197 227 198 CALL oasis_def_partition ( id_part, paral, nerror ) 228 ENDIF 229 IF ( commRank ) CALL oasis_def_partition ( id_part, paral, nerror ) 230 231 ! ... Allocate memory for data exchange 232 ! 233 ALLOCATE(exfld(paral(3), paral(4)), stat = nerror) 234 IF( nerror > 0 ) THEN 235 CALL oasis_abort ( ncomp_id, 'cpl_define', 'Failure in allocating exfld') ; RETURN 236 ENDIF 237 IF ( rootexchg ) THEN 238 ! Should possibly use one of the work arrays for tbuf really 239 ALLOCATE(tbuf(jpi, jpj, jpnij), stat = nerror) 240 IF( nerror > 0 ) THEN 241 CALL oasis_abort ( ncomp_id, 'cpl_define', 'Failure in allocating tbuf') ; RETURN 242 ENDIF 243 ENDIF 244 ! 245 IF (commRank ) THEN 199 246 ! 200 247 ! ... Announce send variables. … … 288 335 ENDIF 289 336 END DO 337 ! 338 ENDIF ! commRank=true 290 339 291 340 !------------------------------------------------------------------ … … 293 342 !------------------------------------------------------------------ 294 343 295 CALL oasis_enddef(nerror) 296 IF( nerror /= OASIS_Ok ) CALL oasis_abort ( ncomp_id, 'cpl_define', 'Failure in oasis_enddef') 344 IF ( commRank ) THEN 345 CALL oasis_enddef(nerror) 346 IF( nerror /= OASIS_Ok ) CALL oasis_abort ( ncomp_id, 'cpl_define', 'Failure in oasis_enddef') 347 ENDIF 297 348 ! 298 349 END SUBROUTINE cpl_define … … 311 362 REAL(wp), DIMENSION(:,:,:), INTENT(in ) :: pdata 312 363 !! 313 INTEGER :: j c,jm ! local loop index364 INTEGER :: jn,jc,jm ! local loop index 314 365 !!-------------------------------------------------------------------- 315 366 ! … … 320 371 321 372 IF( ssnd(kid)%nid(jc,jm) /= -1 ) THEN 322 CALL oasis_put ( ssnd(kid)%nid(jc,jm), kstep, pdata(nldi:nlei, nldj:nlej,jc), kinfo ) 373 IF ( rootexchg ) THEN 374 ! 375 ! collect data on the local root process 376 ! 377 CALL mppgather (pdata(:,:,jc),localRoot,tbuf) 378 CALL mppsync 379 380 IF ( nproc == localRoot ) THEN 381 DO jn = 1, jpnij 382 exfld(nimppt(jn)-1+nldit(jn):nimppt(jn)+nleit(jn)-1,njmppt(jn)-1+nldjt(jn):njmppt(jn)+nlejt(jn)-1)= & 383 tbuf(nldit(jn):nleit(jn),nldjt(jn):nlejt(jn),jn) 384 ENDDO 385 ! snd data to OASIS3 386 CALL oasis_put ( ssnd(kid)%nid(jc,jm), kstep, exfld, kinfo ) 387 ENDIF 388 ELSE 389 ! snd data to OASIS3 390 CALL oasis_put ( ssnd(kid)%nid(jc,jm), kstep, pdata(nldi:nlei, nldj:nlej,jc), kinfo ) 391 ENDIF 323 392 324 393 IF ( ln_ctl ) THEN … … 358 427 INTEGER , INTENT( out) :: kinfo ! OASIS3 info argument 359 428 !! 360 INTEGER :: j c,jm ! local loop index429 INTEGER :: jn,jc,jm ! local loop index 361 430 LOGICAL :: llaction, llfisrt 362 431 !!-------------------------------------------------------------------- … … 372 441 373 442 IF( srcv(kid)%nid(jc,jm) /= -1 ) THEN 374 375 CALL oasis_get ( srcv(kid)%nid(jc,jm), kstep, exfld, kinfo ) 443 ! 444 ! receive data from OASIS3 445 ! 446 IF ( commRank ) CALL oasis_get ( srcv(kid)%nid(jc,jm), kstep, exfld, kinfo ) 447 IF ( rootexchg ) CALL MPI_BCAST ( kinfo, 1, MPI_INTEGER, localRoot, localComm, nerror ) 376 448 377 449 llaction = kinfo == OASIS_Recvd .OR. kinfo == OASIS_FromRest .OR. & … … 384 456 kinfo = OASIS_Rcv 385 457 IF( llfisrt ) THEN 386 pdata(nldi:nlei,nldj:nlej,jc) = exfld(:,:) * pmask(nldi:nlei,nldj:nlej,jm) 458 IF ( rootexchg ) THEN 459 ! distribute data to processes 460 ! 461 IF ( nproc == localRoot ) THEN 462 DO jn = 1, jpnij 463 tbuf(nldit(jn):nleit(jn),nldjt(jn):nlejt(jn),jn)= & 464 exfld(nimppt(jn)-1+nldit(jn):nimppt(jn)+nleit(jn)-1,njmppt(jn)-1+nldjt(jn):njmppt(jn)+nlejt(jn)-1) 465 ! NOTE: we are missing combining this with pmask (see else below) 466 ENDDO 467 ENDIF 468 CALL mppscatter(tbuf,localRoot,pdata(:,:,jc)) 469 CALL mppsync 470 ELSE 471 pdata(nldi:nlei, nldj:nlej, jc) = exfld(:,:) * pmask(nldi:nlei,nldj:nlej,jm) 472 ENDIF 387 473 llfisrt = .FALSE. 388 474 ELSE … … 462 548 #if defined key_oa3mct_v3 463 549 CALL oasis_get_freqs(id, mop, 1, itmp, info) 464 #else 550 #endif 551 #if defined key_oasis3 465 552 CALL oasis_get_freqs(id, 1, itmp, info) 466 553 #endif 467 554 cpl_freq = itmp(1) 555 #if defined key_oasis3mct 556 cpl_freq = namflddti( id ) 557 #endif 468 558 ENDIF 469 559 ! … … 481 571 ! 482 572 DEALLOCATE( exfld ) 573 IF ( rootexchg ) DEALLOCATE ( tbuf ) 483 574 IF (nstop == 0) THEN 484 575 CALL oasis_terminate( nerror ) … … 489 580 END SUBROUTINE cpl_finalize 490 581 491 #if ! defined key_oasis3 582 #if ! defined key_oasis3 && ! defined key_oasis3mct 492 583 493 584 !!---------------------------------------------------------------------- -
branches/UKMO/r5936_hadgem3_mct/NEMOGCM/NEMO/OPA_SRC/SBC/sbc_oce.F90
r7127 r7129 35 35 LOGICAL , PUBLIC :: ln_blk_core !: CORE bulk formulation 36 36 LOGICAL , PUBLIC :: ln_blk_mfs !: MFS bulk formulation 37 #if defined key_oasis3 37 #if defined key_oasis3 || defined key_oasis3mct 38 38 LOGICAL , PUBLIC :: lk_oasis = .TRUE. !: OASIS used 39 39 #else -
branches/UKMO/r5936_hadgem3_mct/NEMOGCM/NEMO/OPA_SRC/SBC/sbccpl.F90
r7127 r7129 41 41 USE timing ! Timing 42 42 USE lbclnk ! ocean lateral boundary conditions (or mpp link) 43 #if defined key_oasis3 || defined key_oasis3mct 44 USE mod_oasis ! OASIS3-MCT module 45 #endif 43 46 USE eosbn2 44 47 USE sbcrnf , ONLY : l_rnfcpl -
branches/UKMO/r5936_hadgem3_mct/NEMOGCM/NEMO/OPA_SRC/step.F90
r7127 r7129 329 329 CALL ctl_stop( 'step: indic < 0' ) 330 330 CALL dia_wri_state( 'output.abort', kstp ) 331 CALL ctl_stop('STOP','NEMO failure in stp') 331 332 ENDIF 332 333 IF( kstp == nit000 ) THEN
Note: See TracChangeset
for help on using the changeset viewer.