Ignore:
Timestamp:
Oct 30, 2023, 5:37:00 PM (7 months ago)
Author:
Laurent Fairhead
Message:

Merge of ACC branch with 4740 revision from trunk

Location:
LMDZ6/branches/Portage_acc
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • LMDZ6/branches/Portage_acc

  • LMDZ6/branches/Portage_acc/libf/phylmd/oasis.F90

    r4446 r4743  
    2424  USE mod_prism_get_proto
    2525  USE mod_prism_put_proto
    26 #endif
    27 #ifdef CPP_CPLOCNINCA
    28   USE incaoasis, ONLY : inforcv
    2926#endif
    3027#endif
     
    7774  INTEGER, PARAMETER :: idr_curenz = 7
    7875  INTEGER, PARAMETER :: idr_oceco2 = 8
    79 
     76  ! bulk salinity of the surface layer of the ocean, in ppt
    8077  INTEGER, PARAMETER :: idr_sss = 9
    81   ! bulk salinity of the surface layer of the ocean, in ppt
    82 
    83   INTEGER, PARAMETER :: maxrecv    = 9  ! Maximum number of fields to receive
    84  
    85 #ifdef CPP_CPLOCNINCA
    86   INTEGER, PARAMETER :: idr_ocedms = 1
    87   INTEGER, PARAMETER :: maxrcv = 1
    88 #endif
     78  INTEGER, PARAMETER :: idr_ocedms = 10
     79
     80  INTEGER, PARAMETER :: maxrecv      = 10     ! Maximum number of fields to receive
     81  INTEGER, PARAMETER :: maxrecv_phys = 9      ! Maximum number of fields to receive in physiq (without fields received in INCA model )
     82                                              ! will be changed in next version - INCA fields will be received in LMDZ (like for ORCHIDEE fields)
     83                                              ! and then send by routine in INCA model
     84 
    8985
    9086  TYPE, PUBLIC ::   FLD_CPL            ! Type for coupling field information
     
    117113    USE surface_data, ONLY : version_ocean
    118114    USE carbon_cycle_mod, ONLY : carbon_cycle_cpl
    119 #ifdef CPP_XIOS
    120115    USE wxios, ONLY : wxios_context_init
    121     USE xios 
    122 #endif
     116    USE chemistry_cycle_mod, ONLY : dms_cycle_cpl
     117    USE lmdz_xios 
    123118    USE print_control_mod, ONLY: lunout
    124119    USE mod_grid_phy_lmdz, ONLY: nbp_lon, nbp_lat, grid_type, unstructured, regular_lonlat
     
    141136    CHARACTER (len = 80)               :: abort_message
    142137    LOGICAL, SAVE                      :: cpl_current_omp
     138    INTEGER, DIMENSION(klon_mpi)       :: ind_cell_glo_mpi
    143139
    144140!*    1. Initializations
     
    175171    cpl_current = cpl_current_omp
    176172    WRITE(lunout,*) 'Couple ocean currents, cpl_current = ',cpl_current
     173
     174!************************************************************************************
     175! Gather global index to be used for oasis decomposition
     176!************************************************************************************
     177    CALL gather_omp(ind_cell_glo,ind_cell_glo_mpi)
    177178
    178179!************************************************************************************
     
    261262       inforecv(idr_oceco2)%action = .TRUE. ; inforecv(idr_oceco2)%name = 'SICO2FLX'
    262263   ENDIF
    263 #ifdef CPP_CPLOCNINCA
    264        inforcv(idr_ocedms)%action = .TRUE. ; inforcv(idr_ocedms)%name = 'SIDMSFLX'
    265 #endif
     264   IF (dms_cycle_cpl) THEN
     265      inforecv(idr_ocedms)%action = .TRUE. ; inforecv(idr_ocedms)%name = 'SIDMSFLX'
     266   ENDIF
     267 
    266268
    267269!************************************************************************************
     
    291293
    292294      DO jf=1, klon_mpi_para_nb(mpi_rank)
    293         ig_paral(2+jf) = ind_cell_glo(jf)
     295        ig_paral(2+jf) = ind_cell_glo_mpi(jf)
    294296      ENDDO
    295297
     
    349351    END DO
    350352
    351 ! Now, if also coupling CPL with INCA, initialize here fields to be exchanged.
    352 #ifdef CPP_CPLOCNINCA
    353     DO jf=1,maxrcv
    354        IF (inforcv(jf)%action) THEN
    355           CALL prism_def_var_proto(inforcv(jf)%nid, inforcv(jf)%name, il_part_id, &
    356                il_var_nodims, PRISM_In, il_var_actual_shape, il_var_type, &
    357                ierror)
    358           IF (ierror .NE. PRISM_Ok) THEN
    359              WRITE(lunout,*) 'inicma : Problem with prism_def_var_proto for field : ',&
    360                   inforcv(jf)%name
    361              abort_message=' Problem in call to prism_def_var_proto for fields to receive'
    362              CALL abort_physic(modname,abort_message,1)
    363           ENDIF
    364        ENDIF
    365     END DO
     353
     354#ifdef INCA
     355    IF (dms_cycle_cpl) THEN
     356       CALL init_inca_oasis(inforecv(idr_ocedms))
     357    ENDIF
    366358#endif
    367359 
     
    387379! End definition
    388380!************************************************************************************
    389 #ifdef CPP_XIOS
    390     CALL xios_oasis_enddef()
    391 #endif
     381
     382    IF (using_xios) CALL xios_oasis_enddef()
     383
    392384    CALL prism_enddef_proto(ierror)
    393385    IF (ierror .NE. PRISM_Ok) THEN
     
    398390    ENDIF
    399391
    400 #ifdef CPP_XIOS
    401 !    CALL wxios_context_init()
    402 #endif
    403 
    404392!$OMP END MASTER
    405393   
     
    424412! Output arguments
    425413!************************************************************************************
    426     REAL, DIMENSION(nbp_lon, jj_nb,maxrecv), INTENT(OUT) :: tab_get
     414    REAL, DIMENSION(nbp_lon, jj_nb,maxrecv_phys), INTENT(OUT) :: tab_get
    427415
    428416! Local variables
     
    446434    ENDIF
    447435   
    448     DO i = 1, maxrecv
     436    DO i = 1, maxrecv_phys
    449437      IF (inforecv(i)%action .AND. inforecv(i)%nid .NE. -1) THEN
    450438          field(:) = -99999.
Note: See TracChangeset for help on using the changeset viewer.