New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
Changeset 3831 – NEMO

Changeset 3831


Ignore:
Timestamp:
2013-03-06T17:21:23+01:00 (11 years ago)
Author:
rfurner
Message:

fix to river code, see ticket 1064

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/NEMOGCM/NEMO/OPA_SRC/SBC/sbcrnf.F90

    r3682 r3831  
    9797      INTEGER, INTENT(in) ::   kt          ! ocean time step 
    9898      !! 
    99       INTEGER  ::   ji, jj   ! dummy loop indices 
     99      INTEGER  ::   ji, jj    ! dummy loop indices 
     100      INTEGER  ::   z_err = 0 ! dummy integer for error handling 
    100101      !!---------------------------------------------------------------------- 
    101102      ! 
     
    143144            !                                                           ! else use S=0 for runoffs (done one for all in the init) 
    144145            ! 
    145             IF( ln_rnf_tem .OR. ln_rnf_sal ) THEN                 ! runoffs as outflow: use ocean SST and SSS 
    146                WHERE( rnf(:,:) < 0._wp )                                 ! example baltic model when flow is out of domain 
    147                   rnf_tsc(:,:,jp_tem) = sst_m(:,:) * rnf(:,:) * r1_rau0 
    148                   rnf_tsc(:,:,jp_sal) = sss_m(:,:) * rnf(:,:) * r1_rau0 
    149                END WHERE 
    150             ENDIF 
     146            IF ( ANY( rnf(:,:) < 0._wp ) ) z_err=1 
     147            IF( lk_mpp) CALL mpp_sum(z_err) 
     148            IF ( z_err > 0 ) CALL ctl_stop( 'sbc_rnf : negative runnoff values exist' ) 
    151149            ! 
    152150            CALL iom_put( "runoffs", rnf )         ! output runoffs arrays 
     
    342340            IF(lwp) WRITE(numout,*) '          runoffs depth read in a file' 
    343341            rn_dep_file = TRIM( cn_dir )//TRIM( sn_dep_rnf%clname ) 
     342            IF( .NOT. sn_dep_rnf%ln_clim ) THEN   ;   WRITE(rn_dep_file, '(a,"_y",i4)' ) TRIM( rn_dep_file ), nyear    ! add year  
     343               IF( sn_dep_rnf%cltype == 'monthly' )   WRITE(rn_dep_file, '(a,"m",i2)'  ) TRIM( rn_dep_file ), nmonth   ! add month  
     344            ENDIF  
    344345            CALL iom_open ( rn_dep_file, inum )                           ! open file 
    345346            CALL iom_get  ( inum, jpdom_data, sn_dep_rnf%clvar, h_rnf )   ! read the river mouth array 
     
    356357                  ELSEIF( h_rnf(ji,jj) == -999._wp ) THEN   ;  nk_rnf(ji,jj) = mbkt(ji,jj) 
    357358                  ELSE 
    358                      CALL ctl_stop( 'runoff depth not positive, and not -999 or -1, rnf value in file fort.999'  ) 
    359                      WRITE(999,*) 'ji, jj, rnf(ji,jj) :', ji, jj, rnf(ji,jj) 
     359                     CALL ctl_stop( 'sbc_rnf_init: runoff depth not positive, and not -999 or -1, rnf value in file fort.999'  ) 
     360                     WRITE(999,*) 'ji, jj, h_rnf(ji,jj) :', ji, jj, h_rnf(ji,jj) 
    360361                  ENDIF 
    361362               END DO 
Note: See TracChangeset for help on using the changeset viewer.