Changeset 411 for trunk/NEMO
- Timestamp:
- 2006-03-20T17:58:37+01:00 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/NEMO/OPA_SRC/DOM/domzgr.F90
r392 r411 380 380 ! EEL R5 configuration with east and west open boundaries. 381 381 ! Two rows of zeroes are needed at the south and north for OBCs 382 ! This is for compatibility with the rigid lid option. 382 383 383 384 IF( cp_cfg == "eel" .AND. jp_cfg == 5 ) THEN … … 389 390 ELSEIF( ntopo == 1 ) THEN ! read in file ! 390 391 ! ! =============== ! 391 392 clname = 'bathy_level.nc' ! Level bathymetry392 IF( lk_zco ) THEN 393 clname = 'bathy_level.nc' ! Level bathymetry 393 394 #if defined key_agrif 394 if ( .NOT. Agrif_Root() ) then395 clname = TRIM(Agrif_CFixed())//'_'//TRIM(clname)396 endif395 IF( .NOT. Agrif_Root() ) THEN 396 clname = TRIM(Agrif_CFixed())//'_'//TRIM(clname) 397 ENDIF 397 398 #endif 398 INQUIRE( FILE=clname, EXIST=llbon ) 399 IF( llbon ) THEN 400 IF(lwp) WRITE(numout,*) 401 IF(lwp) WRITE(numout,*) ' read level bathymetry in ', clname 402 IF(lwp) WRITE(numout,*) 403 itime = 1 404 ipi = jpidta 405 ipj = jpjdta 406 ipk = 1 407 zdt = rdt 408 CALL flinopen( clname, 1, jpidta, 1, jpjdta, .FALSE., & 409 ipi, ipj, ipk, zlamt, zphit, zdept, itime, istep, zdate0, zdt, inum ) 410 CALL flinget( inum, 'Bathy_level', jpidta, jpjdta, 1, & 411 itime, 1, 1, 1, jpidta, 1, jpjdta, zdta(:,:) ) 412 idta(:,:) = zdta(:,:) 413 CALL flinclo( inum ) 414 415 ELSE 416 IF(lwp) WRITE(numout,cform_err) 417 IF(lwp) WRITE(numout,*)' zgr_bat : unable to read the file', clname 418 nstop = nstop + 1 419 ENDIF 420 421 clname = 'bathy_meter.nc' ! meter bathymetry 399 INQUIRE( FILE=clname, EXIST=llbon ) 400 IF( llbon ) THEN 401 IF(lwp) WRITE(numout,*) 402 IF(lwp) WRITE(numout,*) ' read level bathymetry in ', clname 403 IF(lwp) WRITE(numout,*) 404 itime = 1 405 ipi = jpidta 406 ipj = jpjdta 407 ipk = 1 408 zdt = rdt 409 CALL flinopen( clname, 1, jpidta, 1, jpjdta, .FALSE., & 410 ipi, ipj, ipk, zlamt, zphit, zdept, itime, istep, zdate0, zdt, inum ) 411 CALL flinget( inum, 'Bathy_level', jpidta, jpjdta, 1, & 412 itime, 1, 1, 1, jpidta, 1, jpjdta, zdta(:,:) ) 413 idta(:,:) = zdta(:,:) 414 CALL flinclo( inum ) 415 416 ELSE 417 IF(lwp) WRITE(numout,cform_err) 418 IF(lwp) WRITE(numout,*)' zgr_bat : unable to read the file', clname 419 nstop = nstop + 1 420 ENDIF 421 422 ELSEIF( lk_zps ) THEN 423 clname = 'bathy_meter.nc' ! meter bathymetry 422 424 #if defined key_agrif 423 if ( .NOT. Agrif_Root() ) then424 clname = TRIM(Agrif_CFixed())//'_'//TRIM(clname)425 endif425 IF( .NOT. Agrif_Root() ) THEN 426 clname = TRIM(Agrif_CFixed())//'_'//TRIM(clname) 427 ENDIF 426 428 #endif 427 INQUIRE( FILE=clname, EXIST=llbon ) 428 IF( llbon ) THEN 429 IF(lwp) WRITE(numout,*) 430 IF(lwp) WRITE(numout,*) ' read meter bathymetry in ', clname 431 IF(lwp) WRITE(numout,*) 432 itime = 1 433 ipi = jpidta 434 ipj = jpjdta 435 ipk = 1 436 zdt = rdt 437 CALL flinopen( clname, 1, jpidta, 1, jpjdta, .FALSE., & 438 ipi, ipj, ipk, zlamt, zphit, zdept, itime, istep, zdate0, zdt, inum ) 439 CALL flinget( inum, 'Bathymetry', jpidta, jpjdta, 1, & 440 itime, 1, 1, 1, jpidta, 1, jpjdta, zdta(:,:) ) 441 CALL flinclo( inum ) 442 ELSE 443 IF( lk_zps .OR. lk_sco ) THEN 429 INQUIRE( FILE=clname, EXIST=llbon ) 430 IF( llbon ) THEN 431 IF(lwp) WRITE(numout,*) 432 IF(lwp) WRITE(numout,*) ' read meter bathymetry in ', clname 433 IF(lwp) WRITE(numout,*) 434 itime = 1 435 ipi = jpidta 436 ipj = jpjdta 437 ipk = 1 438 zdt = rdt 439 CALL flinopen( clname, 1, jpidta, 1, jpjdta, .FALSE., & 440 ipi, ipj, ipk, zlamt, zphit, zdept, itime, istep, zdate0, zdt, inum ) 441 CALL flinget( inum, 'Bathymetry', jpidta, jpjdta, 1, & 442 itime, 1, 1, 1, jpidta, 1, jpjdta, zdta(:,:) ) 443 CALL flinclo( inum ) 444 ELSE 444 445 IF(lwp) WRITE(numout,cform_err) 445 446 IF(lwp) WRITE(numout,*)' zgr_bat : unable to read the file', clname 446 447 nstop = nstop + 1 447 ELSE448 zdta(:,:) = 0.e0449 IF(lwp) WRITE(numout,*)' zgr_bat : bathy_meter not found, but not used, bathy array set to zero'450 448 ENDIF 451 449 ENDIF … … 605 603 IF( .NOT. lk_cfg_1d ) THEN 606 604 607 ! Suppress isolated ocean grid points 608 609 IF(lwp) WRITE(numout,*) 610 IF(lwp) WRITE(numout,*)' suppress isolated ocean grid points' 611 IF(lwp) WRITE(numout,*)' -----------------------------------' 612 613 icompt = 0 614 615 DO jl = 1, 2 616 617 IF( nperio == 1 .OR. nperio == 4 .OR. nperio == 6 ) THEN 605 ! Suppress isolated ocean grid points 606 607 IF(lwp) WRITE(numout,*) 608 IF(lwp) WRITE(numout,*)' suppress isolated ocean grid points' 609 IF(lwp) WRITE(numout,*)' -----------------------------------' 610 611 icompt = 0 612 613 DO jl = 1, 2 614 615 IF( nperio == 1 .OR. nperio == 4 .OR. nperio == 6 ) THEN 616 mbathy( 1 ,:) = mbathy(jpim1,:) 617 mbathy(jpi,:) = mbathy( 2 ,:) 618 ENDIF 619 DO jj = 2, jpjm1 620 DO ji = 2, jpim1 621 ibtest = MAX( mbathy(ji-1,jj), mbathy(ji+1,jj), & 622 mbathy(ji,jj-1),mbathy(ji,jj+1) ) 623 IF( ibtest < mbathy(ji,jj) ) THEN 624 IF(lwp) WRITE(numout,*) ' the number of ocean level at ', & 625 'grid-point (i,j) = ',ji,jj,' is changed from ', & 626 mbathy(ji,jj),' to ', ibtest 627 mbathy(ji,jj) = ibtest 628 icompt = icompt + 1 629 ENDIF 630 END DO 631 END DO 632 633 END DO 634 IF( icompt == 0 ) THEN 635 IF(lwp) WRITE(numout,*)' no isolated ocean grid points' 636 ELSE 637 IF(lwp) WRITE(numout,*)' ',icompt,' ocean grid points suppressed' 638 ENDIF 639 IF( lk_mpp ) THEN 640 zbathy(:,:) = FLOAT( mbathy(:,:) ) 641 CALL lbc_lnk( zbathy, 'T', 1. ) 642 mbathy(:,:) = INT( zbathy(:,:) ) 643 ENDIF 644 645 ! 3.2 East-west cyclic boundary conditions 646 647 IF( nperio == 0 ) THEN 648 IF(lwp) WRITE(numout,*) ' mbathy set to 0 along east and west', & 649 ' boundary: nperio = ', nperio 650 IF( lk_mpp ) THEN 651 IF( nbondi == -1 .OR. nbondi == 2 ) THEN 652 IF( jperio /= 1 ) mbathy(1,:) = 0 653 ENDIF 654 IF( nbondi == 1 .OR. nbondi == 2 ) THEN 655 IF( jperio /= 1 ) mbathy(nlci,:) = 0 656 ENDIF 657 ELSE 658 mbathy( 1 ,:) = 0 659 mbathy(jpi,:) = 0 660 ENDIF 661 ELSEIF( nperio == 1 .OR. nperio == 4 .OR. nperio == 6 ) THEN 662 IF(lwp) WRITE(numout,*)' east-west cyclic boundary conditions', & 663 ' on mbathy: nperio = ', nperio 618 664 mbathy( 1 ,:) = mbathy(jpim1,:) 619 665 mbathy(jpi,:) = mbathy( 2 ,:) 620 ENDIF 621 DO jj = 2, jpjm1 622 DO ji = 2, jpim1 623 ibtest = MAX( mbathy(ji-1,jj), mbathy(ji+1,jj), & 624 mbathy(ji,jj-1),mbathy(ji,jj+1) ) 625 IF( ibtest < mbathy(ji,jj) ) THEN 626 IF(lwp) WRITE(numout,*) ' the number of ocean level at ', & 627 'grid-point (i,j) = ',ji,jj,' is changed from ', & 628 mbathy(ji,jj),' to ', ibtest 629 mbathy(ji,jj) = ibtest 630 icompt = icompt + 1 631 ENDIF 632 END DO 633 END DO 634 635 END DO 636 IF( icompt == 0 ) THEN 637 IF(lwp) WRITE(numout,*)' no isolated ocean grid points' 638 ELSE 639 IF(lwp) WRITE(numout,*)' ',icompt,' ocean grid points suppressed' 640 ENDIF 641 IF( lk_mpp ) THEN 642 zbathy(:,:) = FLOAT( mbathy(:,:) ) 643 CALL lbc_lnk( zbathy, 'T', 1. ) 644 mbathy(:,:) = INT( zbathy(:,:) ) 645 ENDIF 646 647 ! 3.2 East-west cyclic boundary conditions 648 649 IF( nperio == 0 ) THEN 650 IF(lwp) WRITE(numout,*) ' mbathy set to 0 along east and west', & 651 ' boundary: nperio = ', nperio 652 IF( lk_mpp ) THEN 653 IF( nbondi == -1 .OR. nbondi == 2 ) THEN 654 IF( jperio /= 1 ) mbathy(1,:) = 0 666 ELSEIF( nperio == 2 ) THEN 667 IF(lwp) WRITE(numout,*) ' equatorial boundary conditions', & 668 ' on mbathy: nperio = ', nperio 669 ELSE 670 IF(lwp) WRITE(numout,*) ' e r r o r' 671 IF(lwp) WRITE(numout,*) ' parameter , nperio = ', nperio 672 ! STOP 'dom_mba' 673 ENDIF 674 675 ! Set to zero mbathy over islands if necessary (lk_isl=F) 676 IF( .NOT. lk_isl ) THEN ! No island 677 IF(lwp) WRITE(numout,*) 678 IF(lwp) WRITE(numout,*) ' mbathy set to 0 over islands' 679 IF(lwp) WRITE(numout,*) ' ----------------------------' 680 681 mbathy(:,:) = MAX( 0, mbathy(:,:) ) 682 683 ! Boundary condition on mbathy 684 IF( .NOT.lk_mpp ) THEN 685 686 !!bug ??? y reflechir! 687 ! ... mono- or macro-tasking: T-point, >0, 2D array, no slab 688 689 zbathy(:,:) = FLOAT( mbathy(:,:) ) 690 CALL lbc_lnk( zbathy, 'T', 1. ) 691 mbathy(:,:) = INT( zbathy(:,:) ) 655 692 ENDIF 656 IF( nbondi == 1 .OR. nbondi == 2 ) THEN 657 IF( jperio /= 1 ) mbathy(nlci,:) = 0 658 ENDIF 659 ELSE 660 mbathy( 1 ,:) = 0 661 mbathy(jpi,:) = 0 662 ENDIF 663 ELSEIF( nperio == 1 .OR. nperio == 4 .OR. nperio == 6 ) THEN 664 IF(lwp) WRITE(numout,*)' east-west cyclic boundary conditions', & 665 ' on mbathy: nperio = ', nperio 666 mbathy( 1 ,:) = mbathy(jpim1,:) 667 mbathy(jpi,:) = mbathy( 2 ,:) 668 ELSEIF( nperio == 2 ) THEN 669 IF(lwp) WRITE(numout,*) ' equatorial boundary conditions', & 670 ' on mbathy: nperio = ', nperio 671 ELSE 672 IF(lwp) WRITE(numout,*) ' e r r o r' 673 IF(lwp) WRITE(numout,*) ' parameter , nperio = ', nperio 674 ! STOP 'dom_mba' 675 ENDIF 676 677 ! Set to zero mbathy over islands if necessary (lk_isl=F) 678 IF( .NOT. lk_isl ) THEN ! No island 679 IF(lwp) WRITE(numout,*) 680 IF(lwp) WRITE(numout,*) ' mbathy set to 0 over islands' 681 IF(lwp) WRITE(numout,*) ' ----------------------------' 682 683 mbathy(:,:) = MAX( 0, mbathy(:,:) ) 684 685 ! Boundary condition on mbathy 686 IF( .NOT.lk_mpp ) THEN 687 688 !!bug ??? y reflechir! 689 ! ... mono- or macro-tasking: T-point, >0, 2D array, no slab 690 691 zbathy(:,:) = FLOAT( mbathy(:,:) ) 692 CALL lbc_lnk( zbathy, 'T', 1. ) 693 mbathy(:,:) = INT( zbathy(:,:) ) 694 ENDIF 695 696 ENDIF 693 694 ENDIF 697 695 698 696 ENDIF
Note: See TracChangeset
for help on using the changeset viewer.