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 9242 for branches/UKMO/dev_r5518_new_runoff_coupling/NEMOGCM/NEMO/OPA_SRC/SBC/cpl_oasis3.F90 – NEMO

Ignore:
Timestamp:
2018-01-16T15:42:45+01:00 (6 years ago)
Author:
dancopsey
Message:

Fixed receiving of up to 2000 rivers.

File:
1 edited

Legend:

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

    r9156 r9242  
    3838   PUBLIC   cpl_define 
    3939   PUBLIC   cpl_snd 
    40    PUBLIC   runoff_rcv 
    4140   PUBLIC   cpl_rcv 
    4241   PUBLIC   cpl_freq 
     
    6968   INTEGER, PUBLIC, PARAMETER ::   nmaxcat=5    ! Maximum number of coupling fields 
    7069   INTEGER, PUBLIC, PARAMETER ::   nmaxcpl=5    ! Maximum number of coupling fields 
    71    INTEGER, PUBLIC, PARAMETER ::   n_rivers=2000  ! Total number of rivers whose runoff is passed from the atmosphere 
     70   INTEGER, PUBLIC, PARAMETER ::   n_rivers=2000  ! Total number of rivers in coupled runoff using 1D array 
    7271    
    73    INTEGER :: runoff_id 
     72   INTEGER, PUBLIC :: runoff_id 
    7473    
    7574   TYPE, PUBLIC ::   FLD_CPL               !: Type for coupling field information 
     
    141140      ! 
    142141      INTEGER :: id_part        ! Partition for all 2D model fields to be coupled 
    143       INTEGER :: id_part_r      ! Partition for river runoff 
     142      INTEGER :: id_part_rnf_1d ! Partition for river runoff using 1D array 
    144143      INTEGER :: paral(5)       ! OASIS3 box partition 
    145144      INTEGER :: ishape(2,2)    ! shape of arrays passed to PSMILe 
     
    203202      CALL oasis_def_partition ( id_part, paral, nerror ) 
    204203      ! 
    205       ! Another partition is needed for river runoff 
     204      ! Another partition is needed for river runoff when using 1D array 
    206205       
    207206      paral(1) = 0                                              ! serial partitioning 
     
    211210      paral(5) = 0 
    212211       
    213       CALL oasis_def_partition ( id_part_r, paral, nerror, n_rivers ) 
     212      CALL oasis_def_partition ( id_part_rnf_1d, paral, nerror, n_rivers ) 
    214213       
    215214      ! ... Announce send variables.  
     
    304303      END DO 
    305304       
    306       ! Define river runoff 
    307       CALL oasis_def_var (runoff_id, 'runoffo', id_part_r   , (/ 1, 0 /),   & 
     305      ! Define coupled river runoff using 1D array  
     306      CALL oasis_def_var (runoff_id, 'runoffo', id_part_rnf_1d   , (/ 1, 0 /),   & 
    308307                     &                OASIS_In           , (/ 1, n_rivers /) , OASIS_REAL, nerror ) 
    309308      IF ( nerror /= OASIS_Ok ) THEN 
     
    439438   END SUBROUTINE cpl_rcv 
    440439    
    441    SUBROUTINE runoff_rcv( kstep) 
    442        
    443       INTEGER                   , INTENT(in   ) ::   kstep     ! ocean time-step in seconds 
    444        
    445       INTEGER  ::   kinfo                  ! OASIS3 info argument     
    446       REAL(wp) ::   runoff(n_rivers)             ! River runoff. One value per river. 
    447     
    448       ! Get the river runoff sent by the atmosphere 
    449       CALL oasis_get ( runoff_id, kstep, runoff, kinfo ) 
    450       ! IF ( narea == 1 ) THEN 
    451          WRITE(numout,*)' narea = ', narea 
    452          WRITE(numout,*)' kstep = ', kstep 
    453          WRITE(numout,*)' River runoff = ', runoff 
    454          WRITE(numout,*)' kinfo = ', kinfo 
    455          WRITE(numout,*)'-------' 
    456       ! ENDIF 
    457     
    458     
    459    END SUBROUTINE runoff_rcv 
    460  
    461  
    462440   INTEGER FUNCTION cpl_freq( cdfieldname )   
    463441      !!--------------------------------------------------------------------- 
Note: See TracChangeset for help on using the changeset viewer.