Ignore:
Timestamp:
Dec 14, 2015, 11:43:09 AM (8 years ago)
Author:
Laurent Fairhead
Message:

Merged trunk changes r2298:2396 into testing branch

Location:
LMDZ5/branches/testing
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • LMDZ5/branches/testing

  • LMDZ5/branches/testing/libf/phylmd/oasis.F90

    r2056 r2408  
    9999    USE wxios, ONLY : wxios_context_init
    100100#endif
    101 
    102 
    103     INCLUDE "dimensions.h"
    104     INCLUDE "iniprint.h"
     101    USE print_control_mod, ONLY: lunout
     102    USE mod_grid_phy_lmdz, ONLY: nbp_lon, nbp_lat
    105103
    106104! Local variables
     
    218216       IF (ierror .NE. PRISM_Ok) THEN
    219217          abort_message=' Probleme init dans prism_init_comp '
    220           CALL abort_gcm(modname,abort_message,1)
     218          CALL abort_physic(modname,abort_message,1)
    221219       ELSE
    222220          WRITE(lunout,*) 'inicma : init psmile ok '
     
    229227!************************************************************************************
    230228    ig_paral(1) = 1                            ! apple partition for //
    231     ig_paral(2) = (jj_begin-1)*iim+ii_begin-1  ! offset
    232     ig_paral(3) = (jj_end*iim+ii_end) - (jj_begin*iim+ii_begin) + 1
    233 
    234     IF (mpi_rank==mpi_size-1) ig_paral(3)=ig_paral(3)+iim-1
     229    ig_paral(2) = (jj_begin-1)*nbp_lon+ii_begin-1  ! offset
     230    ig_paral(3) = (jj_end*nbp_lon+ii_end) - (jj_begin*nbp_lon+ii_begin) + 1
     231
     232    IF (mpi_rank==mpi_size-1) ig_paral(3)=ig_paral(3)+nbp_lon-1
    235233    WRITE(lunout,*) mpi_rank,'ig_paral--->',ig_paral(2),ig_paral(3)
    236234   
     
    240238    IF (ierror .NE. PRISM_Ok) THEN
    241239       abort_message=' Probleme dans prism_def_partition '
    242        CALL abort_gcm(modname,abort_message,1)
     240       CALL abort_physic(modname,abort_message,1)
    243241    ELSE
    244242       WRITE(lunout,*) 'inicma : decomposition domaine psmile ok '
     
    249247
    250248    il_var_actual_shape(1) = 1
    251     il_var_actual_shape(2) = iim
     249    il_var_actual_shape(2) = nbp_lon
    252250    il_var_actual_shape(3) = 1
    253     il_var_actual_shape(4) = jjm+1
     251    il_var_actual_shape(4) = nbp_lat
    254252   
    255253    il_var_type = PRISM_Real
     
    268266                  inforecv(jf)%name
    269267             abort_message=' Problem in call to prism_def_var_proto for fields to receive'
    270              CALL abort_gcm(modname,abort_message,1)
     268             CALL abort_physic(modname,abort_message,1)
    271269          ENDIF
    272270       ENDIF
     
    286284                  infosend(jf)%name
    287285             abort_message=' Problem in call to prism_def_var_proto for fields to send'
    288              CALL abort_gcm(modname,abort_message,1)
     286             CALL abort_physic(modname,abort_message,1)
    289287          ENDIF
    290288       ENDIF
     
    297295    IF (ierror .NE. PRISM_Ok) THEN
    298296       abort_message=' Problem in call to prism_endef_proto'
    299        CALL abort_gcm(modname,abort_message,1)
     297       CALL abort_physic(modname,abort_message,1)
    300298    ELSE
    301299       WRITE(lunout,*) 'inicma : endef psmile ok '
     
    320318!======================================================================
    321319!
    322     INCLUDE "dimensions.h"
    323     INCLUDE "iniprint.h"
     320    USE print_control_mod, ONLY: lunout
     321    USE mod_grid_phy_lmdz, ONLY: nbp_lon, nbp_lat
    324322! Input arguments
    325323!************************************************************************************
     
    328326! Output arguments
    329327!************************************************************************************
    330     REAL, DIMENSION(iim, jj_nb,maxrecv), INTENT(OUT) :: tab_get
     328    REAL, DIMENSION(nbp_lon, jj_nb,maxrecv), INTENT(OUT) :: tab_get
    331329
    332330! Local variables
     
    336334    CHARACTER (len = 20)          :: modname = 'fromcpl'
    337335    CHARACTER (len = 80)          :: abort_message
    338     REAL, DIMENSION(iim*jj_nb)    :: field
     336    REAL, DIMENSION(nbp_lon*jj_nb)    :: field
    339337
    340338!************************************************************************************
     
    345343    istart=ii_begin
    346344    IF (is_south_pole) THEN
    347        iend=(jj_end-jj_begin)*iim+iim
     345       iend=(jj_end-jj_begin)*nbp_lon+nbp_lon
    348346    ELSE
    349        iend=(jj_end-jj_begin)*iim+ii_end
     347       iend=(jj_end-jj_begin)*nbp_lon+ii_end
    350348    ENDIF
    351349   
     
    354352          field(:) = -99999.
    355353          CALL prism_get_proto(inforecv(i)%nid, ktime, field(istart:iend), ierror)
    356           tab_get(:,:,i) = RESHAPE(field(:),(/iim,jj_nb/))
     354          tab_get(:,:,i) = RESHAPE(field(:),(/nbp_lon,jj_nb/))
    357355       
    358356          IF (ierror .NE. PRISM_Ok .AND. ierror.NE.PRISM_Recvd .AND. &
     
    362360              WRITE (lunout,*)  'Error with receiving filed : ', inforecv(i)%name, ktime   
    363361              abort_message=' Problem in prism_get_proto '
    364               CALL abort_gcm(modname,abort_message,1)
     362              CALL abort_physic(modname,abort_message,1)
    365363          ENDIF
    366364      ENDIF
     
    382380!
    383381!
    384     INCLUDE "dimensions.h"
    385     INCLUDE "iniprint.h"
     382    USE print_control_mod, ONLY: lunout
     383    USE mod_grid_phy_lmdz, ONLY: nbp_lon, nbp_lat
    386384! Input arguments
    387385!************************************************************************************
    388386    INTEGER, INTENT(IN)                              :: ktime
    389387    LOGICAL, INTENT(IN)                              :: last
    390     REAL, DIMENSION(iim, jj_nb, maxsend), INTENT(IN) :: tab_put
     388    REAL, DIMENSION(nbp_lon, jj_nb, maxsend), INTENT(IN) :: tab_put
    391389
    392390! Local variables
     
    396394    INTEGER                          :: wstart,wend
    397395    INTEGER                          :: ierror, i
    398     REAL, DIMENSION(iim*jj_nb)       :: field
     396    REAL, DIMENSION(nbp_lon*jj_nb)       :: field
    399397    CHARACTER (len = 20),PARAMETER   :: modname = 'intocpl'
    400398    CHARACTER (len = 80)             :: abort_message
     
    411409    istart=ii_begin
    412410    IF (is_south_pole) THEN
    413        iend=(jj_end-jj_begin)*iim+iim
     411       iend=(jj_end-jj_begin)*nbp_lon+nbp_lon
    414412    ELSE
    415        iend=(jj_end-jj_begin)*iim+ii_end
     413       iend=(jj_end-jj_begin)*nbp_lon+ii_end
    416414    ENDIF
    417415   
     
    419417       wstart=istart
    420418       wend=iend
    421        IF (is_north_pole) wstart=istart+iim-1
    422        IF (is_south_pole) wend=iend-iim+1
     419       IF (is_north_pole) wstart=istart+nbp_lon-1
     420       IF (is_south_pole) wend=iend-nbp_lon+1
    423421       
    424422       DO i = 1, maxsend
    425423          IF (infosend(i)%action) THEN
    426              field = RESHAPE(tab_put(:,:,i),(/iim*jj_nb/))
     424             field = RESHAPE(tab_put(:,:,i),(/nbp_lon*jj_nb/))
    427425             CALL writefield_phy(infosend(i)%name,field(wstart:wend),1)
    428426          END IF
     
    436434    DO i = 1, maxsend
    437435      IF (infosend(i)%action .AND. infosend(i)%nid .NE. -1 ) THEN
    438           field = RESHAPE(tab_put(:,:,i),(/iim*jj_nb/))
     436          field = RESHAPE(tab_put(:,:,i),(/nbp_lon*jj_nb/))
    439437          CALL prism_put_proto(infosend(i)%nid, ktime, field(istart:iend), ierror)
    440438         
     
    444442              WRITE (lunout,*) 'Error with sending field :', infosend(i)%name, ktime   
    445443              abort_message=' Problem in prism_put_proto '
    446               CALL abort_gcm(modname,abort_message,1)
     444              CALL abort_physic(modname,abort_message,1)
    447445          ENDIF
    448446      ENDIF
     
    459457          IF (ierror .NE. PRISM_Ok) THEN
    460458             abort_message=' Problem in prism_terminate_proto '
    461              CALL abort_gcm(modname,abort_message,1)
     459             CALL abort_physic(modname,abort_message,1)
    462460          ENDIF
    463461       ENDIF
Note: See TracChangeset for help on using the changeset viewer.