Ignore:
Timestamp:
Aug 21, 2015, 5:13:46 PM (9 years ago)
Author:
Ehouarn Millour
Message:

Physics/dynamics separation:

  • remove all references to dimensions.h from physics. nbp_lon (==iim) , nbp_lat (==jjm+1) and nbp_lev (==llm) from mod_grid_phy_lmdz should be used instead.
  • added module regular_lonlat_mod in phy_common to store information about the global (lon-lat) grid cell boundaries and centers.

EM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • LMDZ5/trunk/libf/phylmd/oasis.F90

    r2311 r2346  
    100100#endif
    101101    USE print_control_mod, ONLY: lunout
    102 
    103     INCLUDE "dimensions.h"
     102    USE mod_grid_phy_lmdz, ONLY nbp_lon, nbp_lat
    104103
    105104! Local variables
     
    228227!************************************************************************************
    229228    ig_paral(1) = 1                            ! apple partition for //
    230     ig_paral(2) = (jj_begin-1)*iim+ii_begin-1  ! offset
    231     ig_paral(3) = (jj_end*iim+ii_end) - (jj_begin*iim+ii_begin) + 1
    232 
    233     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
    234233    WRITE(lunout,*) mpi_rank,'ig_paral--->',ig_paral(2),ig_paral(3)
    235234   
     
    248247
    249248    il_var_actual_shape(1) = 1
    250     il_var_actual_shape(2) = iim
     249    il_var_actual_shape(2) = nbp_lon
    251250    il_var_actual_shape(3) = 1
    252     il_var_actual_shape(4) = jjm+1
     251    il_var_actual_shape(4) = nbp_lat
    253252   
    254253    il_var_type = PRISM_Real
     
    320319!
    321320    USE print_control_mod, ONLY: lunout
    322     INCLUDE "dimensions.h"
     321    USE mod_grid_phy_lmdz, ONLY nbp_lon, nbp_lat
    323322! Input arguments
    324323!************************************************************************************
     
    327326! Output arguments
    328327!************************************************************************************
    329     REAL, DIMENSION(iim, jj_nb,maxrecv), INTENT(OUT) :: tab_get
     328    REAL, DIMENSION(nbp_lon, jj_nb,maxrecv), INTENT(OUT) :: tab_get
    330329
    331330! Local variables
     
    335334    CHARACTER (len = 20)          :: modname = 'fromcpl'
    336335    CHARACTER (len = 80)          :: abort_message
    337     REAL, DIMENSION(iim*jj_nb)    :: field
     336    REAL, DIMENSION(nbp_lon*jj_nb)    :: field
    338337
    339338!************************************************************************************
     
    344343    istart=ii_begin
    345344    IF (is_south_pole) THEN
    346        iend=(jj_end-jj_begin)*iim+iim
     345       iend=(jj_end-jj_begin)*nbp_lon+nbp_lon
    347346    ELSE
    348        iend=(jj_end-jj_begin)*iim+ii_end
     347       iend=(jj_end-jj_begin)*nbp_lon+ii_end
    349348    ENDIF
    350349   
     
    353352          field(:) = -99999.
    354353          CALL prism_get_proto(inforecv(i)%nid, ktime, field(istart:iend), ierror)
    355           tab_get(:,:,i) = RESHAPE(field(:),(/iim,jj_nb/))
     354          tab_get(:,:,i) = RESHAPE(field(:),(/nbp_lon,jj_nb/))
    356355       
    357356          IF (ierror .NE. PRISM_Ok .AND. ierror.NE.PRISM_Recvd .AND. &
     
    382381!
    383382    USE print_control_mod, ONLY: lunout
    384     INCLUDE "dimensions.h"
     383    USE mod_grid_phy_lmdz, ONLY nbp_lon, nbp_lat
    385384! Input arguments
    386385!************************************************************************************
    387386    INTEGER, INTENT(IN)                              :: ktime
    388387    LOGICAL, INTENT(IN)                              :: last
    389     REAL, DIMENSION(iim, jj_nb, maxsend), INTENT(IN) :: tab_put
     388    REAL, DIMENSION(nbp_lon, jj_nb, maxsend), INTENT(IN) :: tab_put
    390389
    391390! Local variables
     
    395394    INTEGER                          :: wstart,wend
    396395    INTEGER                          :: ierror, i
    397     REAL, DIMENSION(iim*jj_nb)       :: field
     396    REAL, DIMENSION(nbp_lon*jj_nb)       :: field
    398397    CHARACTER (len = 20),PARAMETER   :: modname = 'intocpl'
    399398    CHARACTER (len = 80)             :: abort_message
     
    410409    istart=ii_begin
    411410    IF (is_south_pole) THEN
    412        iend=(jj_end-jj_begin)*iim+iim
     411       iend=(jj_end-jj_begin)*nbp_lon+nbp_lon
    413412    ELSE
    414        iend=(jj_end-jj_begin)*iim+ii_end
     413       iend=(jj_end-jj_begin)*nbp_lon+ii_end
    415414    ENDIF
    416415   
     
    418417       wstart=istart
    419418       wend=iend
    420        IF (is_north_pole) wstart=istart+iim-1
    421        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
    422421       
    423422       DO i = 1, maxsend
    424423          IF (infosend(i)%action) THEN
    425              field = RESHAPE(tab_put(:,:,i),(/iim*jj_nb/))
     424             field = RESHAPE(tab_put(:,:,i),(/nbp_lon*jj_nb/))
    426425             CALL writefield_phy(infosend(i)%name,field(wstart:wend),1)
    427426          END IF
     
    435434    DO i = 1, maxsend
    436435      IF (infosend(i)%action .AND. infosend(i)%nid .NE. -1 ) THEN
    437           field = RESHAPE(tab_put(:,:,i),(/iim*jj_nb/))
     436          field = RESHAPE(tab_put(:,:,i),(/nbp_lon*jj_nb/))
    438437          CALL prism_put_proto(infosend(i)%nid, ktime, field(istart:iend), ierror)
    439438         
Note: See TracChangeset for help on using the changeset viewer.