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/r6232_new_runoff_coupling/NEMOGCM/NEMO/OPA_SRC/SBC/cpl_oasis3.F90 – NEMO

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

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