Changeset 14219 for NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/src/OCE/SBC/cpl_oasis3.F90
- Timestamp:
- 2020-12-18T18:52:57+01:00 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/src/OCE/SBC/cpl_oasis3.F90
r14072 r14219 14 14 !! 3.6 ! 2014-11 (S. Masson) OASIS3-MCT 15 15 !!---------------------------------------------------------------------- 16 16 17 17 !!---------------------------------------------------------------------- 18 18 !! 'key_oasis3' coupled Ocean/Atmosphere via OASIS3-MCT … … 63 63 #endif 64 64 65 INTEGER :: nrcv ! total number of fields received 66 INTEGER :: nsnd ! total number of fields sent 65 INTEGER :: nrcv ! total number of fields received 66 INTEGER :: nsnd ! total number of fields sent 67 67 INTEGER :: ncplmodel ! Maximum number of models to/from which NEMO is potentialy sending/receiving data 68 INTEGER, PUBLIC, PARAMETER :: nmaxfld=6 2! Maximum number of coupling fields68 INTEGER, PUBLIC, PARAMETER :: nmaxfld=60 ! Maximum number of coupling fields 69 69 INTEGER, PUBLIC, PARAMETER :: nmaxcat=5 ! Maximum number of coupling fields 70 70 INTEGER, PUBLIC, PARAMETER :: nmaxcpl=5 ! Maximum number of coupling fields 71 71 72 72 TYPE, PUBLIC :: FLD_CPL !: Type for coupling field information 73 73 LOGICAL :: laction ! To be coupled or not 74 CHARACTER(len = 8) :: clname ! Name of the coupling field 75 CHARACTER(len = 1) :: clgrid ! Grid type 74 CHARACTER(len = 8) :: clname ! Name of the coupling field 75 CHARACTER(len = 1) :: clgrid ! Grid type 76 76 REAL(wp) :: nsgn ! Control of the sign change 77 77 INTEGER, DIMENSION(nmaxcat,nmaxcpl) :: nid ! Id of the field (no more than 9 categories and 9 extrena models) … … 98 98 !! exchange between AGCM, OGCM and COUPLER. (OASIS3 software) 99 99 !! 100 !! ** Method : OASIS3 MPI communication 100 !! ** Method : OASIS3 MPI communication 101 101 !!-------------------------------------------------------------------- 102 102 CHARACTER(len = *), INTENT(in ) :: cd_modname ! model name as set in namcouple file … … 132 132 !! exchange between AGCM, OGCM and COUPLER. (OASIS3 software) 133 133 !! 134 !! ** Method : OASIS3 MPI communication 134 !! ** Method : OASIS3 MPI communication 135 135 !!-------------------------------------------------------------------- 136 136 INTEGER, INTENT(in) :: krcv, ksnd ! Number of received and sent coupling fields … … 180 180 ! 181 181 ! ----------------------------------------------------------------- 182 ! ... Define the partition, excluding halos as we don't want them to be "seen" by oasis 182 ! ... Define the partition, excluding halos as we don't want them to be "seen" by oasis 183 183 ! ----------------------------------------------------------------- 184 184 185 185 paral(1) = 2 ! box partitioning 186 paral(2) = Ni0glo * mjg0(nn_hls) + mig0(nn_hls) ! NEMO lower left corner global offset, without halos 186 paral(2) = Ni0glo * mjg0(nn_hls) + mig0(nn_hls) ! NEMO lower left corner global offset, without halos 187 187 paral(3) = Ni_0 ! local extent in i, excluding halos 188 188 paral(4) = Nj_0 ! local extent in j, excluding halos 189 189 paral(5) = Ni0glo ! global extent in x, excluding halos 190 190 191 191 IF( sn_cfctl%l_oasout ) THEN 192 192 WRITE(numout,*) ' multiexchg: paral (1:5)', paral … … 195 195 WRITE(numout,*) ' multiexchg: Njs0, Nje0, njmpp =', Njs0, Nje0, njmpp 196 196 ENDIF 197 197 198 198 CALL oasis_def_partition ( id_part, paral, nerror, Ni0glo*Nj0glo ) ! global number of points, excluding halos 199 199 ! 200 ! ... Announce send variables. 200 ! ... Announce send variables. 201 201 ! 202 202 ssnd(:)%ncplmodel = kcplmodel … … 210 210 RETURN 211 211 ENDIF 212 212 213 213 DO jc = 1, ssnd(ji)%nct 214 214 DO jm = 1, kcplmodel … … 225 225 ENDIF 226 226 #if defined key_agrif 227 IF( agrif_fixed() /= 0 ) THEN 227 IF( agrif_fixed() /= 0 ) THEN 228 228 zclname=TRIM(Agrif_CFixed())//'_'//TRIM(zclname) 229 229 ENDIF … … 243 243 END DO 244 244 ! 245 ! ... Announce received variables. 245 ! ... Announce received variables. 246 246 ! 247 247 srcv(:)%ncplmodel = kcplmodel 248 248 ! 249 249 DO ji = 1, krcv 250 IF( srcv(ji)%laction ) THEN 251 250 IF( srcv(ji)%laction ) THEN 251 252 252 IF( srcv(ji)%nct > nmaxcat ) THEN 253 253 CALL oasis_abort ( ncomp_id, 'cpl_define', 'Number of categories of '// & … … 255 255 RETURN 256 256 ENDIF 257 257 258 258 DO jc = 1, srcv(ji)%nct 259 259 DO jm = 1, kcplmodel 260 260 261 261 IF( srcv(ji)%nct .GT. 1 ) THEN 262 262 WRITE(cli2,'(i2.2)') jc … … 270 270 ENDIF 271 271 #if defined key_agrif 272 IF( agrif_fixed() /= 0 ) THEN 272 IF( agrif_fixed() /= 0 ) THEN 273 273 zclname=TRIM(Agrif_CFixed())//'_'//TRIM(zclname) 274 274 ENDIF … … 288 288 ENDIF 289 289 END DO 290 290 291 291 !------------------------------------------------------------------ 292 292 ! End of definition phase 293 293 !------------------------------------------------------------------ 294 ! 294 ! 295 295 #if defined key_agrif 296 296 IF( agrif_fixed() == Agrif_Nb_Fine_Grids() ) THEN … … 303 303 ! 304 304 END SUBROUTINE cpl_define 305 306 305 306 307 307 SUBROUTINE cpl_snd( kid, kstep, pdata, kinfo ) 308 308 !!--------------------------------------------------------------------- … … 324 324 DO jc = 1, ssnd(kid)%nct 325 325 DO jm = 1, ssnd(kid)%ncplmodel 326 326 327 327 IF( ssnd(kid)%nid(jc,jm) /= -1 ) THEN ! exclude halos from data sent to oasis 328 328 CALL oasis_put ( ssnd(kid)%nid(jc,jm), kstep, pdata(Nis0:Nie0, Njs0:Nje0,jc), kinfo ) 329 330 IF ( sn_cfctl%l_oasout ) THEN 329 330 IF ( sn_cfctl%l_oasout ) THEN 331 331 IF ( kinfo == OASIS_Sent .OR. kinfo == OASIS_ToRest .OR. & 332 332 & kinfo == OASIS_SentOut .OR. kinfo == OASIS_ToRestOut ) THEN … … 342 342 ENDIF 343 343 ENDIF 344 344 345 345 ENDIF 346 346 347 347 ENDDO 348 348 ENDDO … … 379 379 IF( srcv(kid)%nid(jc,jm) /= -1 ) THEN 380 380 381 CALL oasis_get ( srcv(kid)%nid(jc,jm), kstep, exfld, kinfo ) 382 381 CALL oasis_get ( srcv(kid)%nid(jc,jm), kstep, exfld, kinfo ) 382 383 383 llaction = kinfo == OASIS_Recvd .OR. kinfo == OASIS_FromRest .OR. & 384 384 & kinfo == OASIS_RecvOut .OR. kinfo == OASIS_FromRestOut 385 385 386 386 IF ( sn_cfctl%l_oasout ) & 387 387 & WRITE(numout,*) "llaction, kinfo, kstep, ivarid: " , llaction, kinfo, kstep, srcv(kid)%nid(jc,jm) 388 388 389 389 IF( llaction ) THEN ! data received from oasis do not include halos 390 390 391 391 kinfo = OASIS_Rcv 392 IF( ll_1st ) THEN 392 IF( ll_1st ) THEN 393 393 pdata(Nis0:Nie0,Njs0:Nje0,jc) = exfld(:,:) * pmask(Nis0:Nie0,Njs0:Nje0,jm) 394 394 ll_1st = .FALSE. … … 397 397 & + exfld(:,:) * pmask(Nis0:Nie0,Njs0:Nje0,jm) 398 398 ENDIF 399 400 IF ( sn_cfctl%l_oasout ) THEN 399 400 IF ( sn_cfctl%l_oasout ) THEN 401 401 WRITE(numout,*) '****************' 402 402 WRITE(numout,*) 'oasis_get: Incoming ', srcv(kid)%clname … … 409 409 WRITE(numout,*) '****************' 410 410 ENDIF 411 411 412 412 ENDIF 413 413 414 414 ENDIF 415 415 416 416 ENDDO 417 417 418 418 !--- we must call lbc_lnk to fill the halos that where not received. 419 419 IF( .NOT. ll_1st ) THEN 420 CALL lbc_lnk( 'cpl_oasis3', pdata(:,:,jc), srcv(kid)%clgrid, srcv(kid)%nsgn ) 420 CALL lbc_lnk( 'cpl_oasis3', pdata(:,:,jc), srcv(kid)%clgrid, srcv(kid)%nsgn ) 421 421 ENDIF 422 422 423 423 ENDDO 424 424 ! … … 426 426 427 427 428 INTEGER FUNCTION cpl_freq( cdfieldname ) 428 INTEGER FUNCTION cpl_freq( cdfieldname ) 429 429 !!--------------------------------------------------------------------- 430 430 !! *** ROUTINE cpl_freq *** … … 491 491 DEALLOCATE( exfld ) 492 492 IF(nstop == 0) THEN 493 CALL oasis_terminate( nerror ) 493 CALL oasis_terminate( nerror ) 494 494 ELSE 495 495 CALL oasis_abort( ncomp_id, "cpl_finalize", "NEMO ABORT STOP" ) 496 ENDIF 496 ENDIF 497 497 ! 498 498 END SUBROUTINE cpl_finalize … … 544 544 WRITE(numout,*) 'oasis_enddef: Error you sould not be there...' 545 545 END SUBROUTINE oasis_enddef 546 546 547 547 SUBROUTINE oasis_put(k1,k2,p1,k3) 548 548 REAL(wp), DIMENSION(:,:), INTENT(in ) :: p1 … … 574 574 WRITE(numout,*) 'oasis_terminate: Error you sould not be there...' 575 575 END SUBROUTINE oasis_terminate 576 576 577 577 #endif 578 578
Note: See TracChangeset
for help on using the changeset viewer.