Changeset 1528 for trunk/NEMO/OPA_SRC/OBC/obcdta.F90
- Timestamp:
- 2009-07-23T16:38:47+02:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/NEMO/OPA_SRC/OBC/obcdta.F90
r1241 r1528 9 9 !!------------------------------------------------------------------------------ 10 10 !! obc_dta : read u, v, t, s data along each open boundary 11 !! obc_dta_psi : read psi data along each open boundary (rigid lid only)12 11 !!------------------------------------------------------------------------------ 13 12 !! * Modules used … … 23 22 USE ioipsl ! now only for ymds2ju function 24 23 USE iom ! 25 USE obccli ! used when dynspg_rl26 24 27 25 IMPLICIT NONE … … 120 118 121 119 !!--------------------------------------------------------------------------- 122 IF( lk_dynspg_rl ) THEN123 CALL obc_dta_psi( kt ) ! update bsf data at open boundaries124 IF ( nobc_dta == 1 .AND. kt == nit000 ) CALL ctl_stop( 'obcdta : time-variable psi boundary data not allowed yet' )125 ENDIF126 120 127 121 ! 0. initialisation : … … 505 499 END SUBROUTINE obc_dta_chktime 506 500 507 # if defined key_dynspg_rl508 !!-----------------------------------------------------------------------------509 !! Rigid-lid510 !!-----------------------------------------------------------------------------511 512 SUBROUTINE obc_dta_psi ( kt )513 !!-----------------------------------------------------------------------------514 !! *** SUBROUTINE obc_dta_psi ***515 !!516 !! ** Purpose :517 !! Update the climatological streamfunction OBC at each time step.518 !! Depends on the user's configuration. Here data are read only once519 !! at the beginning of the run.520 !!521 !! ** Method :522 !! 1. initialization523 !! kbsfstart: number of time steps over which increase bsf524 !! during initialization. This is provided for a smooth start525 !! in cases where the transport is large (like on the Antarctic526 !! continent). also note that when kbfstart=1, the transport527 !! increases a lot in one time step and the precision usually528 !! required for the solver may not be enough.529 !! 2. set the time evolution of the climatological barotropic streamfunction530 !! along the isolated coastlines ( gcbic(jnic) ).531 !! 3. set the climatological barotropic streamfunction at the boundary.532 !!533 !! The last two steps are done only at first step (nit000) or if kt <= kbfstart534 !!535 !! History :536 !! ! 97-08 (G. Madec, J.M. Molines)537 !! 8.5 ! 02-10 (C. Talandier, A-M. Treguier) Free surface, F90538 !!----------------------------------------------------------------------------539 !! * Arguments540 INTEGER, INTENT( in ) :: kt ! ocean time-step index541 542 !! * Local declarations543 INTEGER :: ji, jj, jnic, jip ! dummy loop indices544 INTEGER :: inum = 11 ! temporary logical unit545 INTEGER :: ip, ii, ij, iii, ijj546 INTEGER :: kbsfstart547 REAL(wp) :: zsver1, zsver2, zsver3, z2dtr, zcoef548 !!----------------------------------------------------------------------------549 550 ! 1. initialisation551 ! -----------------552 kbsfstart = 1553 zsver1 = bsfic0(1)554 zsver2 = zsver1555 IF( kt <= kbsfstart ) THEN556 zcoef = float(kt)/float(kbsfstart)557 ELSE558 zcoef = 1.559 END IF560 bsfic(1) = zsver1*zcoef561 IF( lwp .AND. ( kt <= kbsfstart ) ) THEN562 IF(lwp) WRITE(numout,*)' '563 IF(lwp) WRITE(numout,*)'obcdta: spinup phase in obc_dta_psi routine'564 IF(lwp) WRITE(numout,*)'~~~~~~ it=',kt,' OBC: spinup coef: ', &565 zcoef, ' and transport: ',bsfic(1)566 END IF567 568 zsver2 = bsfic(1)-bsfic(2)569 zsver3 = bsfic(2)570 571 ! 2. Right hand side of the barotropic elliptic equation (isolated coastlines)572 ! ----------------------------------------------------------------------------573 574 IF( ( neuler == 0 ) .AND. ( kt == nit000 ) ) THEN575 z2dtr = 1./rdt576 ELSE577 z2dtr = 1./2./rdt578 END IF579 ! ... bsfb(ii,ij) should be constant but due to the Asselin filter it580 ! ... converges asymptotically towards bsfic(jnic)581 ! ... However, bsfb(ii,ij) is constant along the same coastlines582 ! ... ---> can be improved using an extra array for storing bsficb (before)583 IF( nbobc > 1 ) THEN584 DO jnic = 1,nbobc - 1585 gcbic(jnic) = 0.586 ip=mnic(0,jnic)587 DO jip = 1,ip588 ii = miic(jip,0,jnic)589 ij = mjic(jip,0,jnic)590 IF( ii >= nldi+ nimpp - 1 .AND. ii <= nlei+ nimpp - 1 .AND. &591 ij >= nldj+ njmpp - 1 .AND. ij <= nlej+ njmpp - 1 ) THEN592 iii=ii-nimpp+1593 ijj=ij-njmpp+1594 gcbic(jnic) = ( bsfic(jnic) - bsfb(iii,ijj) ) * z2dtr595 END IF596 END DO597 END DO598 END IF599 600 IF( lk_mpp ) CALL mpp_isl( gcbic, 3 )601 602 ! 3. Update the climatological barotropic function at the boundary603 ! ----------------------------------------------------------------604 605 IF( lpeastobc ) THEN606 607 IF( kt == nit000 .OR. kt <= kbsfstart ) THEN608 OPEN(inum,file='obceastbsf.dta')609 READ(inum,*)610 READ(inum,*)611 READ(inum,*)612 READ(inum,*)613 READ(inum,*)614 READ(inum,*) (bfoe(jj),jj=jpjed, jpjef)615 CLOSE(inum)616 END IF617 DO jj=jpjed, jpjefm1618 bfoe(jj)=bfoe(jj)*zcoef619 END DO620 621 END IF622 623 IF( lpwestobc) THEN624 625 IF( kt == nit000 .OR. kt <= kbsfstart ) THEN626 OPEN(inum,file='obcwestbsf.dta')627 READ(inum,*)628 READ(inum,*)629 READ(inum,*)630 READ(inum,*)631 READ(inum,*)632 READ(inum,*) (bfow(jj),jj=jpjwd, jpjwf)633 CLOSE(inum)634 END IF635 DO jj=jpjwd, jpjwfm1636 bfow(jj)=bfow(jj)*zcoef637 END DO638 639 END IF640 641 IF( lpsouthobc) THEN642 643 IF( kt == nit000.OR.kt <= kbsfstart ) THEN644 OPEN(inum,file='obcsouthbsf.dta')645 READ(inum,*)646 READ(inum,*)647 READ(inum,*)648 READ(inum,*)649 READ(inum,*)650 READ(inum,*) (bfos(jj),jj=jpisd, jpisf)651 CLOSE(inum)652 END IF653 DO ji=jpisd, jpisfm1654 bfos(ji)=bfos(ji)*zcoef655 END DO656 657 END IF658 659 IF( lpnorthobc) THEN660 IF( kt == nit000.OR.kt <= kbsfstart ) THEN661 OPEN(inum,file='obcnorthbsf.dta')662 READ(inum,*)663 READ(inum,*)664 READ(inum,*)665 READ(inum,*)666 READ(inum,*)667 READ(inum,*) (bfon(jj),jj=jpind, jpinf)668 CLOSE(inum)669 END IF670 DO ji=jpind, jpinfm1671 bfon(ji)=bfon(ji)*zcoef672 END DO673 674 END IF675 END SUBROUTINE obc_dta_psi676 677 #else678 !!-----------------------------------------------------------------------------679 !! 'key_dynspg_rl not defined ( dynspg_flt or dynspg_exp or dynspg_ts )680 !!-----------------------------------------------------------------------------681 SUBROUTINE obc_dta_psi ( kt ) ! Empty routine682 !! * Arguments683 INTEGER,INTENT(in) :: kt684 WRITE(*,*) 'obc_dta_psi: You should not have seen this print! error?', kt685 STOP686 END SUBROUTINE obc_dta_psi687 # endif688 501 689 502 #if defined key_dynspg_ts || defined key_dynspg_exp
Note: See TracChangeset
for help on using the changeset viewer.