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

Changeset 11452 for branches/UKMO


Ignore:
Timestamp:
2019-08-19T13:28:30+02:00 (5 years ago)
Author:
jcastill
Message:

Changes as in the original branch, plus one bug fix in oce.F90, plus changes to run with the branch but in uncoupled mode - although this is not complete yet

Location:
branches/UKMO/r6232_new_runoff_coupling/NEMOGCM/NEMO/OPA_SRC/SBC
Files:
1 added
3 edited

Legend:

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

    r11448 r11452  
    2424   !!   cpl_finalize : finalize the coupled mode communication 
    2525   !!---------------------------------------------------------------------- 
    26 #if defined key_oasis3 
     26#if defined key_oasis3 || defined key_oasis3mct 
    2727   USE mod_oasis                    ! OASIS3-MCT module 
    2828#endif 
     
    4646   INTEGER                    ::   ncomp_id          ! id returned by oasis_init_comp 
    4747   INTEGER                    ::   nerror            ! return error code 
    48 #if ! defined key_oasis3 
     48#if ! defined key_oasis3 && ! defined key_oasis3mct 
    4949   ! OASIS Variables not used. defined only for compilation purpose 
    5050   INTEGER                    ::   OASIS_Out         = -1 
     
    6969   INTEGER, PUBLIC, PARAMETER ::   nmaxcpl=5    ! Maximum number of coupling fields 
    7070    
     71   INTEGER, PUBLIC            ::   nn_cpl_river=0 ! Maximum number of rivers being passed through the coupler 
     72   INTEGER, PUBLIC            ::   runoff_id      ! OASIS coupling id used in oasis_get command 
     73 
    7174   TYPE, PUBLIC ::   FLD_CPL               !: Type for coupling field information 
    7275      LOGICAL               ::   laction   ! To be coupled or not 
     
    136139      INTEGER, INTENT(in) ::   kcplmodel      ! Maximum number of models to/from which NEMO is potentialy sending/receiving data 
    137140      ! 
    138       INTEGER :: id_part 
     141      INTEGER :: id_part        ! Partition for all 2D model fields to be coupled 
     142      INTEGER :: id_part_rnf_1d ! Partition for river runoff using 1D array 
    139143      INTEGER :: paral(5)       ! OASIS3 box partition 
    140144      INTEGER :: ishape(2,2)    ! shape of arrays passed to PSMILe 
     
    198202      CALL oasis_def_partition ( id_part, paral, nerror ) 
    199203      ! 
     204      ! Another partition is needed for river runoff when using 1D array 
     205      paral(1) = 0                                              ! serial partitioning 
     206      paral(2) = 0    
     207      paral(3) = nn_cpl_river                                       ! size of array to couple 
     208      paral(4) = 0 
     209      paral(5) = 0 
     210 
     211      CALL oasis_def_partition ( id_part_rnf_1d, paral, nerror, nn_cpl_river ) 
    200212      ! ... Announce send variables.  
    201213      ! 
     
    289301      END DO 
    290302       
     303      ! Define coupled river runoff using 1D array 
     304      CALL oasis_def_var (runoff_id, 'runoffo', id_part_rnf_1d, (/ 1, 0 /),   & 
     305                     &                OASIS_In           , (/ 1, nn_cpl_river /) , OASIS_REAL, nerror ) 
     306      IF ( nerror /= OASIS_Ok ) THEN 
     307          WRITE(numout,*) 'Failed to define transient runoffo' 
     308          CALL oasis_abort ( runoff_id, 'cpl_define', 'Failure in oasis_def_var' ) 
     309      ENDIF 
     310 
    291311      !------------------------------------------------------------------ 
    292312      ! End of definition phase 
     
    514534   END SUBROUTINE oasis_get_localcomm 
    515535 
    516    SUBROUTINE oasis_def_partition(k1,k2,k3) 
    517       INTEGER     , INTENT(  out) ::  k1,k3 
    518       INTEGER     , INTENT(in   ) ::  k2(5) 
     536   SUBROUTINE oasis_def_partition(k1,k2,k3,k4) 
     537      INTEGER          , INTENT(  out) ::  k1,k3 
     538      INTEGER          , INTENT(in   ) ::  k2(5) 
     539      INTEGER, OPTIONAL, INTENT(in   ) ::  k4 
    519540      k1 = k2(1) ; k3 = k2(5) 
    520541      WRITE(numout,*) 'oasis_def_partition: Error you sould not be there...' 
  • branches/UKMO/r6232_new_runoff_coupling/NEMOGCM/NEMO/OPA_SRC/SBC/sbccpl.F90

    r11448 r11452  
    4343   USE eosbn2 
    4444   USE sbcrnf   , ONLY : l_rnfcpl 
     45   USE cpl_rnf_1d      ! Coupled runoff using 1D array 
    4546#if defined key_cpl_carbon_cycle 
    4647   USE p4zflx, ONLY : oce_co2 
     
    401402      !                                                      ! ------------------------- ! 
    402403      srcv(jpr_rnf   )%clname = 'O_Runoff' 
    403       IF( TRIM( sn_rcv_rnf%cldes ) == 'coupled' ) THEN 
     404      IF( TRIM( sn_rcv_rnf%cldes ) == 'coupled' .OR. TRIM( sn_rcv_rnf%cldes ) == 'coupled1d' ) THEN 
    404405         srcv(jpr_rnf)%laction = .TRUE. 
    405406         l_rnfcpl              = .TRUE.                      ! -> no need to read runoffs in sbcrnf 
     
    407408         IF(lwp) WRITE(numout,*) 
    408409         IF(lwp) WRITE(numout,*) '   runoffs received from oasis -> force ln_rnf = ', ln_rnf 
     410         ! Written here like this to allow merging with other branches (river mask) 
     411         IF( TRIM( sn_rcv_rnf%cldes ) == 'coupled' ) THEN 
     412           srcv(jpr_rnf)%laction = .TRUE. 
     413         ELSE 
     414           srcv(jpr_rnf)%laction = .FALSE. 
     415         ENDIF 
    409416      ENDIF 
    410417      ! 
     
    761768         ENDIF 
    762769      ENDIF 
     770 
     771      ! Initialise 1D river outflow scheme 
     772      nn_cpl_river = 1 
     773      IF ( TRIM( sn_rcv_rnf%cldes ) == 'coupled1d' ) CALL cpl_rnf_1d_init   ! Coupled runoff using 1D array 
    763774 
    764775      ! 
     
    10721083         ! 
    10731084         !                                                        ! runoffs and calving (added in emp) 
    1074          IF( srcv(jpr_rnf)%laction )     rnf(:,:) = frcv(jpr_rnf)%z3(:,:,1) 
     1085         IF( srcv(jpr_rnf)%laction )     rnf(:,:) = frcv(jpr_rnf)%z3(:,:,1)                
     1086         IF ( TRIM( sn_rcv_rnf%cldes ) == 'coupled1d' ) CALL cpl_rnf_1d_rcv( isec) 
    10751087         IF( srcv(jpr_cal)%laction )     zemp(:,:) = zemp(:,:) - frcv(jpr_cal)%z3(:,:,1) 
    10761088          
     
    13311343    
    13321344 
    1333    SUBROUTINE sbc_cpl_ice_flx( p_frld, palbi, psst, pist ) 
     1345   SUBROUTINE sbc_cpl_ice_flx( kt, p_frld, palbi, psst, pist ) 
    13341346      !!---------------------------------------------------------------------- 
    13351347      !!             ***  ROUTINE sbc_cpl_ice_flx  *** 
     
    13711383      !!                   sprecip             solid precipitation over the ocean   
    13721384      !!---------------------------------------------------------------------- 
     1385      INTEGER, INTENT(in)           ::   kt          ! ocean model time step index 
    13731386      REAL(wp), INTENT(in   ), DIMENSION(:,:)   ::   p_frld     ! lead fraction                [0 to 1] 
    13741387      ! optional arguments, used only in 'mixed oce-ice' case 
     
    13841397      !!---------------------------------------------------------------------- 
    13851398      ! 
     1399      INTEGER  ::   isec                   ! number of seconds since nit000 (assuming rdttra did not change since nit000) 
     1400 
    13861401      IF( nn_timing == 1 )  CALL timing_start('sbc_cpl_ice_flx') 
    13871402      ! 
     
    14321447         CALL iom_put( 'calving_cea', frcv(jpr_cal)%z3(:,:,1) ) 
    14331448      ENDIF 
     1449      isec = ( kt - nit000 ) * NINT( rdttra(1) ) 
     1450      CALL cpl_rnf_1d_rcv( isec) 
    14341451 
    14351452      IF( ln_mixcpl ) THEN 
  • branches/UKMO/r6232_new_runoff_coupling/NEMOGCM/NEMO/OPA_SRC/SBC/sbcice_cice.F90

    r11448 r11452  
    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 
Note: See TracChangeset for help on using the changeset viewer.