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 9313 for branches/UKMO – NEMO

Changeset 9313 for branches/UKMO


Ignore:
Timestamp:
2018-02-08T15:41:43+01:00 (6 years ago)
Author:
dancopsey
Message:

Changed number of rivers to be nn_cpl_river which is fed in from the nam_cpl_rnf_1d namelist. Made new scheme turn on and off by setting sn_rcv_rnf%cldes = 'coupled1d'

Location:
branches/UKMO/dev_r5518_new_runoff_coupling/NEMOGCM/NEMO/OPA_SRC
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/UKMO/dev_r5518_new_runoff_coupling/NEMOGCM/NEMO/OPA_SRC/SBC/cpl_oasis3.F90

    r9242 r9313  
    3131   USE in_out_manager               ! I/O manager 
    3232   USE lbclnk                       ! ocean lateral boundary conditions (or mpp link) 
     33   USE cpl_rnf_1d, ONLY: nn_cpl_river, runoff_id   ! Variables used in 1D river outflow 
    3334 
    3435   IMPLICIT NONE 
     
    6869   INTEGER, PUBLIC, PARAMETER ::   nmaxcat=5    ! Maximum number of coupling fields 
    6970   INTEGER, PUBLIC, PARAMETER ::   nmaxcpl=5    ! Maximum number of coupling fields 
    70    INTEGER, PUBLIC, PARAMETER ::   n_rivers=2000  ! Total number of rivers in coupled runoff using 1D array 
    71     
    72    INTEGER, PUBLIC :: runoff_id 
     71    
     72    
    7373    
    7474   TYPE, PUBLIC ::   FLD_CPL               !: Type for coupling field information 
     
    206206      paral(1) = 0                                              ! serial partitioning 
    207207      paral(2) = 0    
    208       paral(3) = n_rivers                                       ! size of array to couple 
     208      paral(3) = nn_cpl_river                                       ! size of array to couple 
    209209      paral(4) = 0 
    210210      paral(5) = 0 
    211211       
    212       CALL oasis_def_partition ( id_part_rnf_1d, paral, nerror, n_rivers ) 
     212      CALL oasis_def_partition ( id_part_rnf_1d, paral, nerror, nn_cpl_river ) 
    213213       
    214214      ! ... Announce send variables.  
     
    305305      ! Define coupled river runoff using 1D array  
    306306      CALL oasis_def_var (runoff_id, 'runoffo', id_part_rnf_1d   , (/ 1, 0 /),   & 
    307                      &                OASIS_In           , (/ 1, n_rivers /) , OASIS_REAL, nerror ) 
     307                     &                OASIS_In           , (/ 1, nn_cpl_river /) , OASIS_REAL, nerror ) 
    308308      IF ( nerror /= OASIS_Ok ) THEN 
    309309          WRITE(numout,*) 'Failed to define transient runoffo' 
  • branches/UKMO/dev_r5518_new_runoff_coupling/NEMOGCM/NEMO/OPA_SRC/SBC/cpl_rnf_1d.F90

    r9264 r9313  
    2222   USE dom_oce         ! Domain sizes (for grid box area e1e2t) 
    2323   USE sbc_oce         ! Surface boundary condition: ocean fields 
    24    USE cpl_oasis3      ! Coupling information (for n_rivers and runoff_id) 
    2524    
    2625   IMPLICIT NONE 
     
    3635    
    3736   TYPE(RIVERS_DATA), PUBLIC, TARGET :: rivers  !: River data 
     37    
     38   INTEGER, PUBLIC            :: nn_cpl_river   ! Maximum number of rivers being passed through the coupler 
     39   INTEGER, PUBLIC            :: runoff_id      ! OASIS coupling id used in oasis_get command 
    3840    
    3941CONTAINS 
     
    5759      REAL(wp), POINTER, DIMENSION(:,:)         ::   river_number        ! 2D array containing the river outflow numbers 
    5860       
    59       NAMELIST/nam_cpl_rnf_1d/file_riv_number 
     61      NAMELIST/nam_cpl_rnf_1d/file_riv_number, nn_cpl_river 
    6062      !!---------------------------------------------------------------------- 
    6163 
     
    114116       
    115117      ! Get the area of each river outflow 
    116       ALLOCATE( rivers%river_area( n_rivers ) ) 
     118      ALLOCATE( rivers%river_area( nn_cpl_river ) ) 
    117119      rivers%river_area(:) = 0.0 
    118120      DO ii = 1, jpi 
    119121        DO jj = 1, jpj 
    120           IF ( rivers%river_number(ii,jj) > 0 .AND. rivers%river_number(ii,jj) <= n_rivers ) THEN 
     122          IF ( rivers%river_number(ii,jj) > 0 .AND. rivers%river_number(ii,jj) <= nn_cpl_river ) THEN 
    121123            rivers%river_area(rivers%river_number(ii,jj)) = rivers%river_area(rivers%river_number(ii,jj)) + e1e2t(ii,jj) 
    122124          END IF 
     
    125127       
    126128      ! Use mpp_sum to add together river areas on other processors 
    127       CALL mpp_sum( rivers%river_area, n_rivers ) 
     129      CALL mpp_sum( rivers%river_area, nn_cpl_river ) 
    128130      WRITE(numout,*) 'Area of river number 1 is ',rivers%river_area(1) 
    129131      WRITE(numout,*) 'Area of river number 10 is ',rivers%river_area(10) 
     
    147149       
    148150      INTEGER  ::   kinfo                  ! OASIS3 info argument     
    149       REAL(wp) ::   runoff_1d(n_rivers)    ! River runoff. One value per river. 
     151      REAL(wp) ::   runoff_1d(nn_cpl_river)    ! River runoff. One value per river. 
    150152      INTEGER  ::   ii, jj                 ! Loop indices 
    151153      LOGICAL  ::   llaction               ! Has the get worked? 
     
    180182        DO ii = 1, jpi 
    181183          DO jj = 1, jpj 
    182             IF ( rivers%river_number(ii,jj) > 0 .AND. rivers%river_number(ii,jj) <= n_rivers ) THEN 
     184            IF ( rivers%river_number(ii,jj) > 0 .AND. rivers%river_number(ii,jj) <= nn_cpl_river ) THEN 
    183185              rnf(ii,jj) = runoff_1d(rivers%river_number(ii,jj)) / rivers%river_area(rivers%river_number(ii,jj)) 
    184186            ELSE 
  • branches/UKMO/dev_r5518_new_runoff_coupling/NEMOGCM/NEMO/OPA_SRC/SBC/sbccpl.F90

    r9264 r9313  
    4343   USE eosbn2 
    4444   USE sbcrnf   , ONLY : l_rnfcpl 
    45    USE cpl_rnf_1d, ONLY : cpl_rnf_1D_rcv      ! Coupled runoff using 1D array 
     45   USE cpl_rnf_1d      ! Coupled runoff using 1D array 
    4646#if defined key_cpl_carbon_cycle 
    4747   USE p4zflx, ONLY : oce_co2 
     
    762762         ENDIF 
    763763      ENDIF 
     764       
     765      ! Initialise 1D river outflow scheme 
     766      nn_cpl_river = 1 
     767      IF ( TRIM( sn_rcv_rnf%cldes ) == 'coupled1d' ) CALL cpl_rnf_1d_init   ! Coupled runoff using 1D array 
    764768 
    765769      ! 
     
    10721076         !                                                        ! runoffs and calving (added in emp) 
    10731077         IF( srcv(jpr_rnf)%laction )     rnf(:,:) = frcv(jpr_rnf)%z3(:,:,1)                
    1074          CALL cpl_rnf_1d_rcv( isec) 
     1078         IF ( TRIM( sn_rcv_rnf%cldes ) == 'coupled1d' )         CALL cpl_rnf_1d_rcv( isec) 
    10751079         IF( srcv(jpr_cal)%laction )     zemp(:,:) = zemp(:,:) - frcv(jpr_cal)%z3(:,:,1) 
    10761080          
  • branches/UKMO/dev_r5518_new_runoff_coupling/NEMOGCM/NEMO/OPA_SRC/nemogcm.F90

    r9242 r9313  
    5353   USE bdydta          ! open boundary cond. setting   (bdy_dta_init routine) 
    5454   USE bdytides        ! open boundary cond. setting   (bdytide_init routine) 
    55    USE cpl_rnf_1d, ONLY : cpl_rnf_1d_init      ! Coupled runoff 1D array 
    5655   USE istate          ! initial state setting          (istate_init routine) 
    5756   USE ldfdyn          ! lateral viscosity setting      (ldfdyn_init routine) 
     
    398397      IF( lk_bdy .AND. lk_tide )   & 
    399398         &                  CALL bdytide_init   ! Open boundaries initialisation of tidal harmonic forcing 
    400                             CALL cpl_rnf_1d_init   ! Coupled runoff using 1D array 
    401399 
    402400                            CALL dyn_nept_init  ! simplified form of Neptune effect 
Note: See TracChangeset for help on using the changeset viewer.