Ignore:
Timestamp:
Nov 21, 2019, 4:43:45 PM (5 years ago)
Author:
lguez
Message:

Merge revisions 3427:3600 of trunk into branch Ocean_skin

Location:
LMDZ6/branches/Ocean_skin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • LMDZ6/branches/Ocean_skin

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

    r3102 r3605  
    104104#ifdef CPP_XIOS
    105105    USE wxios, ONLY : wxios_context_init
     106    USE xios 
    106107#endif
    107108    USE print_control_mod, ONLY: lunout
    108     USE mod_grid_phy_lmdz, ONLY: nbp_lon, nbp_lat
     109    USE mod_grid_phy_lmdz, ONLY: nbp_lon, nbp_lat, grid_type, unstructured, regular_lonlat
     110    USE geometry_mod, ONLY: ind_cell_glo                   
     111    USE mod_phys_lmdz_mpi_data, ONLY: klon_mpi_para_nb
     112   
     113
    109114
    110115! Local variables
     
    113118    INTEGER                            :: ierror, il_commlocal
    114119    INTEGER                            :: il_part_id
    115     INTEGER, DIMENSION(3)              :: ig_paral
     120    INTEGER, ALLOCATABLE               :: ig_paral(:)
    116121    INTEGER, DIMENSION(2)              :: il_var_nodims
    117122    INTEGER, DIMENSION(4)              :: il_var_actual_shape
     
    136141! Define the model name
    137142!
    138     clmodnam = 'LMDZ'       ! as in $NBMODEL in Cpl/Nam/namcouple.tmp
     143    IF (grid_type==unstructured) THEN
     144        clmodnam = 'icosa'                 ! as in $NBMODEL in Cpl/Nam/namcouple.tmp
     145    ELSE IF (grid_type==regular_lonlat) THEN
     146        clmodnam = 'LMDZ'                  ! as in $NBMODEL in Cpl/Nam/namcouple.tmp
     147    ELSE
     148        abort_message='Pb : type of grid unknown'
     149        CALL abort_physic(modname,abort_message,1)
     150    ENDIF
    139151
    140152
     
    236248! Domain decomposition
    237249!************************************************************************************
    238     ig_paral(1) = 1                            ! apple partition for //
    239     ig_paral(2) = (jj_begin-1)*nbp_lon+ii_begin-1  ! offset
    240     ig_paral(3) = (jj_end*nbp_lon+ii_end) - (jj_begin*nbp_lon+ii_begin) + 1
    241 
    242     IF (mpi_rank==mpi_size-1) ig_paral(3)=ig_paral(3)+nbp_lon-1
     250    IF (grid_type==unstructured) THEN
     251
     252      ALLOCATE( ig_paral(klon_mpi_para_nb(mpi_rank) + 2) )
     253
     254      ig_paral(1) = 4                                      ! points partition for //
     255      ig_paral(2) = klon_mpi_para_nb(mpi_rank)             ! nb of local cells
     256
     257      DO jf=1, klon_mpi_para_nb(mpi_rank)
     258        ig_paral(2+jf) = ind_cell_glo(jf)
     259      ENDDO
     260
     261    ELSE IF (grid_type==regular_lonlat) THEN
     262
     263      ALLOCATE( ig_paral(3) )
     264
     265      ig_paral(1) = 1                            ! apple partition for //
     266      ig_paral(2) = (jj_begin-1)*nbp_lon+ii_begin-1  ! offset
     267      ig_paral(3) = (jj_end*nbp_lon+ii_end) - (jj_begin*nbp_lon+ii_begin) + 1
     268
     269      IF (mpi_rank==mpi_size-1) ig_paral(3)=ig_paral(3)+nbp_lon-1
     270    ELSE
     271      abort_message='Pb : type of grid unknown'
     272      CALL abort_physic(modname,abort_message,1)
     273    ENDIF
     274
     275
    243276    WRITE(lunout,*) mpi_rank,'ig_paral--->',ig_paral(2),ig_paral(3)
    244277   
     
    253286    ENDIF
    254287
    255     il_var_nodims(1) = 2
    256     il_var_nodims(2) = 1
    257 
    258     il_var_actual_shape(1) = 1
    259     il_var_actual_shape(2) = nbp_lon
    260     il_var_actual_shape(3) = 1
    261     il_var_actual_shape(4) = nbp_lat
     288    il_var_nodims(1) = 2                        ! rank of field array (1d or 2d)
     289    il_var_nodims(2) = 1                        ! always 1 in current oasis version" doc oasis3mct p18
     290
     291    il_var_actual_shape(1) = 1                  ! min of 1st dimension (always 1)
     292    il_var_actual_shape(2) = nbp_lon            ! max of 1st dimension
     293    il_var_actual_shape(3) = 1                  ! min of 2nd dimension (always 1)
     294    il_var_actual_shape(4) = nbp_lat            ! max of 2nd dimension
    262295   
    263296    il_var_type = PRISM_Real
     
    302335! End definition
    303336!************************************************************************************
     337#ifdef CPP_XIOS
     338    CALL xios_oasis_enddef()
     339#endif
    304340    CALL prism_enddef_proto(ierror)
    305341    IF (ierror .NE. PRISM_Ok) THEN
     
    311347
    312348#ifdef CPP_XIOS
    313     CALL wxios_context_init()
     349!    CALL wxios_context_init()
    314350#endif
    315351
Note: See TracChangeset for help on using the changeset viewer.