Changeset 13298


Ignore:
Timestamp:
2020-07-13T12:12:33+02:00 (3 weeks ago)
Author:
dancopsey
Message:

Improve error message when there is a zero river area for one of the rivers.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/UKMO/dev_r5518_GO6_fix_zemp_ice_10681/NEMOGCM/NEMO/OPA_SRC/SBC/cpl_rnf_1d.F90

    r10269 r13298  
    6161      INTEGER                                   ::   max_river 
    6262      REAL(wp), POINTER, DIMENSION(:,:)         ::   river_number        ! 2D array containing the river outflow numbers 
     63      REAL(wp)                                  ::   min_river_area      ! Mininum river area used for debugging 
     64      INTEGER                                   ::   min_river_number    ! Number of minimum river area used for debugging 
    6365       
    6466      NAMELIST/nam_cpl_rnf_1d/file_riv_number, nn_cpl_river, ln_print_river_info 
     
    117119      ALLOCATE( rivers%river_area_c( nn_cpl_river ) ) 
    118120      rivers%river_area_c(:) = CMPLX( 0.e0, 0.e0, wp ) 
    119       DO ii = nldi, nlei       
    120         DO jj = nldj, nlej 
     121      DO ii = 1, jpi       
     122        DO jj = 1, jpj 
    121123          IF ( tmask_i(ii,jj) > 0.5 ) THEN  ! This makes sure we are not at a duplicated point (at north fold or east-west cyclic point) 
    122124            IF ( rivers%river_number(ii,jj) > 0 .AND. rivers%river_number(ii,jj) <= nn_cpl_river ) THEN 
     
    139141      IF ( ln_print_river_info ) THEN 
    140142        WRITE(numout,*) 'Area of rivers 1 to 10 are ',rivers%river_area(1:10) 
     143      END IF 
     144 
     145      IF ( MINVAL(rivers%river_area(1:nn_cpl_river)) <= 0 ) THEN 
     146         min_river_area=9E15 
     147         min_river_number=0 
     148         DO rr = 1, nn_cpl_river 
     149            IF ( rivers%river_area(rr) < min_river_area ) THEN 
     150               min_river_area = rivers%river_area(rr) 
     151               min_river_number = rr 
     152            END IF 
     153         END DO 
     154         WRITE(numout,*) 'Minimum river area = ',min_river_area 
     155         WRITE(numout,*) 'First river number with minimum area = ',min_river_number 
     156         CALL ctl_stop( 'There is at least one river with a river outflow area of zero. Please check your file_riv_number file that all the allocated river numbers are at ocean points as defined by the bathymetry file.') 
    141157      END IF 
    142158       
Note: See TracChangeset for help on using the changeset viewer.