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

Changeset 9242 for branches


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

Fixed receiving of up to 2000 rivers.

Location:
branches/UKMO/dev_r5518_new_runoff_coupling/NEMOGCM/NEMO/OPA_SRC
Files:
1 added
1 deleted
4 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      !!--------------------------------------------------------------------- 
  • branches/UKMO/dev_r5518_new_runoff_coupling/NEMOGCM/NEMO/OPA_SRC/SBC/sbccpl.F90

    r8212 r9242  
    4343   USE eosbn2 
    4444   USE sbcrnf   , ONLY : l_rnfcpl 
     45   USE cpl_rnf_1d, ONLY : cpl_rnf_1D_rcv      ! Coupled runoff using 1D array 
    4546#if defined key_cpl_carbon_cycle 
    4647   USE p4zflx, ONLY : oce_co2 
     
    865866      DO jn = 1, jprcv                                          ! received fields sent by the atmosphere 
    866867         IF( srcv(jn)%laction )   CALL cpl_rcv( jn, isec, frcv(jn)%z3, xcplmask(:,:,1:nn_cplmodel), nrcvinfo(jn) ) 
    867       END DO 
    868        
    869       CALL runoff_rcv( isec)       
     868      END DO      
    870869 
    871870      !                                                      ! ========================= ! 
     
    10721071         ! 
    10731072         !                                                        ! runoffs and calving (added in emp) 
    1074          IF( srcv(jpr_rnf)%laction )     rnf(:,:) = frcv(jpr_rnf)%z3(:,:,1) 
     1073         IF( srcv(jpr_rnf)%laction )     rnf(:,:) = frcv(jpr_rnf)%z3(:,:,1)                
     1074         CALL cpl_rnf_1d_rcv( isec) 
    10751075         IF( srcv(jpr_cal)%laction )     zemp(:,:) = zemp(:,:) - frcv(jpr_cal)%z3(:,:,1) 
    10761076          
     
    13311331    
    13321332 
    1333    SUBROUTINE sbc_cpl_ice_flx( p_frld, palbi, psst, pist ) 
     1333   SUBROUTINE sbc_cpl_ice_flx( kt, p_frld, palbi, psst, pist ) 
    13341334      !!---------------------------------------------------------------------- 
    13351335      !!             ***  ROUTINE sbc_cpl_ice_flx  *** 
     
    13711371      !!                   sprecip             solid precipitation over the ocean   
    13721372      !!---------------------------------------------------------------------- 
     1373      INTEGER, INTENT(in)           ::   kt          ! ocean model time step index 
    13731374      REAL(wp), INTENT(in   ), DIMENSION(:,:)   ::   p_frld     ! lead fraction                [0 to 1] 
    13741375      ! optional arguments, used only in 'mixed oce-ice' case 
     
    13841385      !!---------------------------------------------------------------------- 
    13851386      ! 
     1387      INTEGER  ::   isec                   ! number of seconds since nit000 (assuming rdttra did not change since nit000) 
    13861388      IF( nn_timing == 1 )  CALL timing_start('sbc_cpl_ice_flx') 
    13871389      ! 
     
    14321434         CALL iom_put( 'calving_cea', frcv(jpr_cal)%z3(:,:,1) ) 
    14331435      ENDIF 
     1436      isec = ( kt - nit000 ) * NINT( rdttra(1) )  
     1437      CALL cpl_rnf_1d_rcv( isec) 
    14341438 
    14351439      IF( ln_mixcpl ) THEN 
  • branches/UKMO/dev_r5518_new_runoff_coupling/NEMOGCM/NEMO/OPA_SRC/SBC/sbcice_cice.F90

    r8163 r9242  
    139139            CALL cice_sbc_force(kt) 
    140140         ELSE IF ( ksbc == jp_purecpl ) THEN 
    141             CALL sbc_cpl_ice_flx( 1.0-fr_i  ) 
     141            CALL sbc_cpl_ice_flx( kt, 1.0-fr_i  ) 
    142142         ENDIF 
    143143 
  • branches/UKMO/dev_r5518_new_runoff_coupling/NEMOGCM/NEMO/OPA_SRC/nemogcm.F90

    r9156 r9242  
    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         ! Runoff in coupled models      (cpl_rnf_init routine) 
     55   USE cpl_rnf_1d, ONLY : cpl_rnf_1d_init      ! Coupled runoff 1D array 
    5656   USE istate          ! initial state setting          (istate_init routine) 
    5757   USE ldfdyn          ! lateral viscosity setting      (ldfdyn_init routine) 
     
    398398      IF( lk_bdy .AND. lk_tide )   & 
    399399         &                  CALL bdytide_init   ! Open boundaries initialisation of tidal harmonic forcing 
    400                             CALL cpl_rnf_init   ! Runoff in coupled model 
     400                            CALL cpl_rnf_1d_init   ! Coupled runoff using 1D array 
    401401 
    402402                            CALL dyn_nept_init  ! simplified form of Neptune effect 
Note: See TracChangeset for help on using the changeset viewer.