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 3832 – NEMO

Changeset 3832


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

fix to river code, see ticket 1064

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/OPA_SRC/SBC/sbcrnf.F90

    r3811 r3832  
    9595      INTEGER, INTENT(in) ::   kt          ! ocean time step 
    9696      ! 
    97       INTEGER  ::   ji, jj   ! dummy loop indices 
     97      INTEGER  ::   ji, jj    ! dummy loop indices 
     98      INTEGER  ::   z_err = 0 ! dummy integer for error handling 
    9899      !!---------------------------------------------------------------------- 
    99100      ! 
     
    140141            IF( ln_rnf_sal )   rnf_tsc(:,:,jp_sal) = ( sf_s_rnf(1)%fnow(:,:,1) ) * rnf(:,:) * r1_rau0 
    141142            !                                                           ! else use S=0 for runoffs (done one for all in the init) 
    142             ! 
    143             IF( ln_rnf_tem .OR. ln_rnf_sal ) THEN                 ! runoffs as outflow: use ocean SST and SSS 
    144                WHERE( rnf(:,:) < 0._wp )                                 ! example baltic model when flow is out of domain 
    145                   rnf_tsc(:,:,jp_tem) = sst_m(:,:) * rnf(:,:) * r1_rau0 
    146                   rnf_tsc(:,:,jp_sal) = sss_m(:,:) * rnf(:,:) * r1_rau0 
    147                END WHERE 
    148             ENDIF 
     143            IF ( ANY( rnf(:,:) < 0._wp ) ) z_err=1 
     144            IF(lk_mpp) CALL mpp_sum(z_err) 
     145            IF( z_err > 0 ) CALL ctl_stop( 'sbc_rnf : negative runnoff values exist' ) 
    149146            ! 
    150147            CALL iom_put( "runoffs", rnf )         ! output runoffs arrays 
     
    338335            IF(lwp) WRITE(numout,*) '          runoffs depth read in a file' 
    339336            rn_dep_file = TRIM( cn_dir )//TRIM( sn_dep_rnf%clname ) 
     337            IF( .NOT. sn_dep_rnf%ln_clim ) THEN   ;   WRITE(rn_dep_file, '(a,"_y",i4)' ) TRIM( rn_dep_file ), nyear    ! add year  
     338               IF( sn_dep_rnf%cltype == 'monthly' )   WRITE(rn_dep_file, '(a,"m",i2)'  ) TRIM( rn_dep_file ), nmonth   ! add month  
     339            ENDIF  
    340340            CALL iom_open ( rn_dep_file, inum )                           ! open file 
    341341            CALL iom_get  ( inum, jpdom_data, sn_dep_rnf%clvar, h_rnf )   ! read the river mouth array 
     
    352352                  ELSEIF( h_rnf(ji,jj) == -999._wp ) THEN   ;  nk_rnf(ji,jj) = mbkt(ji,jj) 
    353353                  ELSE 
    354                      CALL ctl_stop( 'runoff depth not positive, and not -999 or -1, rnf value in file fort.999'  ) 
    355                      WRITE(999,*) 'ji, jj, rnf(ji,jj) :', ji, jj, rnf(ji,jj) 
     354                     CALL ctl_stop( 'sbc_rnf_init: runoff depth not positive, and not -999 or -1, rnf value in file fort.999'  ) 
     355                     WRITE(999,*) 'ji, jj, h_rnf(ji,jj) :', ji, jj, h_rnf(ji,jj) 
    356356                  ENDIF 
    357357               END DO 
Note: See TracChangeset for help on using the changeset viewer.