Changeset 2326


Ignore:
Timestamp:
Jul 10, 2015, 2:24:29 PM (9 years ago)
Author:
Ehouarn Millour
Message:

Further code reorganization: adding "phy_common", a directory which should contain routines common (wrt structural nature of the underlying code/grid) to all LMDZ-related physics packages.
EM

Location:
LMDZ5/trunk
Files:
1 added
10 deleted
6 edited
10 moved

Legend:

Unmodified
Added
Removed
  • LMDZ5/trunk/bld.cfg

    r2242 r2326  
    3232src::misc    %SRC_PATH/misc
    3333src::dyn3d_common   %DYN_COMMON
     34src::phy_common %PHY_COMMON
    3435src::cosp    %COSP
    3536src::ext_src %EXT_SRC
  • LMDZ5/trunk/create_make_gcm

    r2239 r2326  
    5454echo "PHYS  = "
    5555echo 'LIBPHY = $(LIBO)/libphy$(PHYS).a'
     56echo 'LIBPHY_COMMON= $(LIBO)/libphy_common.a'
    5657echo 'LIBDYN_PHY = $(LIBO)/libdynlmdz_phy$(PHYS).a'
    5758echo 'DIRMAIN=dyn$(DIM)d$(FLAG_PARA)'
     
    6465echo 'L_FILTRE   = -l$(FILTRE)'
    6566echo 'L_DYN_PHY = -ldynlmdz_phy$(PHYS) '
    66 echo 'L_PHY = -lphy$(PHYS) '
     67echo 'L_PHY = -lphy$(PHYS) -lphy_common'
    6768echo 'L_MISC    = -lmisc'
    6869echo 'L_ADJNT    ='
     
    9293echo
    9394#echo 'main : chimie $(DYN) misc phys $(OPTION_DEP) '
    94 echo 'main : $(DYN) misc phys dyn_phy $(OPTION_DEP) '
     95echo 'main : $(DYN) misc phys phy_common dyn_phy $(OPTION_DEP) '
    9596echo '  cd $(LIBO) ; $(RANLIB) lib*.a ; cd $(GCM) ;\'
    9697echo '  cd $(LOCAL_DIR); \'
     
    99100echo
    100101echo 'phys : $(LIBPHY)'
     102echo 'phy_common : $(LIBPHY_COMMON)'
    101103echo 'dyn3d : $(LIBO)/libdyn$(DIM)d$(FLAG_PARA).a $(LIBO)/lib$(FILTRE).a $(LIBO)/libdyn3d_common.a'
    102104echo 'dyn2d : $(LIBO)/libdyn2d.a'
  • LMDZ5/trunk/libf/phydev/iophy.F90

    r2311 r2326  
    4646                                is_sequential, is_south_pole
    4747  USE mod_grid_phy_lmdz, only: nbp_lon, nbp_lat, klon_glo
     48  USE print_control_mod, ONLY: lunout, prt_level
     49  USE mod_grid_phy_lmdz, ONLY: nbp_lon, nbp_lat
    4850#ifdef CPP_IOIPSL
    4951  USE ioipsl, only: flio_dom_set
     
    5355#endif
    5456  implicit none
    55   include 'dimensions.h'
    56   include 'iniprint.h'
    5757    real,dimension(klon),intent(in) :: rlon
    5858    real,dimension(klon),intent(in) :: rlat
     
    7777   
    7878!$OMP MASTER 
    79     ALLOCATE(io_lat(jjm+1-1/(iim*jjm)))
     79    ALLOCATE(io_lat(nbp_lat))
    8080    io_lat(1)=rlat_glo(1)
    81     io_lat(jjm+1-1/(iim*jjm))=rlat_glo(klon_glo)
    82     IF ((iim*jjm) > 1) then
    83       DO i=2,jjm
    84         io_lat(i)=rlat_glo(2+(i-2)*iim)
     81    io_lat(nbp_lat)=rlat_glo(klon_glo)
     82    IF ((nbp_lon*nbp_lat) > 1) then
     83      DO i=2,nbp_lat-1
     84        io_lat(i)=rlat_glo(2+(i-2)*nbp_lon)
    8585      ENDDO
    8686    ENDIF
    8787
    88     ALLOCATE(io_lon(iim))
    89     io_lon(:)=rlon_glo(2-1/(iim*jjm):iim+1-1/(iim*jjm))
     88    ALLOCATE(io_lon(nbp_lon))
     89    IF ((nbp_lon*nbp_lat) > 1) THEN
     90      io_lon(:)=rlon_glo(2:nbp_lon+1)
     91    ELSE
     92      io_lon(1)=rlon_glo(1)
     93    ENDIF
    9094!! (I) dtnb   : total number of domains
    9195!! (I) dnb    : domain number
     
    103107!!              These names are case insensitive.
    104108    ddid=(/ 1,2 /)
    105     dsg=(/ iim, jjm+1-1/(iim*jjm) /)
    106     dsl=(/ iim, jj_nb /)
     109    dsg=(/ nbp_lon, nbp_lat /)
     110    dsl=(/ nbp_lon, jj_nb /)
    107111    dpf=(/ 1,jj_begin /)
    108     dpl=(/ iim, jj_end /)
     112    dpl=(/ nbp_lon, jj_end /)
    109113    dhs=(/ ii_begin-1,0 /)
    110114    if (mpi_rank==mpi_size-1) then
    111115      dhe=(/0,0/)
    112116    else
    113       dhe=(/ iim-ii_end,0 /) 
     117      dhe=(/ nbp_lon-ii_end,0 /) 
    114118    endif
    115119   
     
    155159  USE mod_phys_lmdz_para, only: is_sequential, jj_begin, jj_end, jj_nb
    156160  use ioipsl, only: histbeg
     161  USE print_control_mod, ONLY: prt_level, lunout
     162  USE mod_grid_phy_lmdz, ONLY: nbp_lon
    157163  implicit none
    158   include 'dimensions.h'
    159164   
    160165    character*(*), intent(IN) :: name
     
    167172!$OMP MASTER   
    168173    if (is_sequential) then
    169       call histbeg(name,iim,io_lon, jj_nb,io_lat(jj_begin:jj_end), &
    170                    1,iim,1,jj_nb,itau0, zjulian, dtime, nhori, nid_day)
     174      call histbeg(name,nbp_lon,io_lon, jj_nb,io_lat(jj_begin:jj_end), &
     175                   1,nbp_lon,1,jj_nb,itau0, zjulian, dtime, nhori, nid_day)
    171176    else
    172       call histbeg(name,iim,io_lon, jj_nb,io_lat(jj_begin:jj_end), &
    173                    1,iim,1,jj_nb,itau0, zjulian, dtime, nhori, nid_day,phys_domain_id)
     177      call histbeg(name,nbp_lon,io_lon, jj_nb,io_lat(jj_begin:jj_end), &
     178                   1,nbp_lon,1,jj_nb,itau0, zjulian, dtime, nhori, nid_day,phys_domain_id)
    174179    endif
    175180!$OMP END MASTER
     
    186191  use wxios, only: wxios_add_file
    187192  IMPLICIT NONE
    188   include 'dimensions.h'
    189193   
    190194    character*(*), INTENT(IN) :: name
     
    219223                                jj_nb, klon_mpi
    220224  USE ioipsl, only: histwrite
     225  USE mod_grid_phy_lmdz, ONLY: nbp_lon
    221226  implicit none
    222   include 'dimensions.h'
    223227   
    224228    integer,intent(in) :: nid
     
    229233    REAL,dimension(klon_mpi) :: buffer_omp
    230234    INTEGER, allocatable, dimension(:) :: index2d
    231     REAL :: Field2d(iim,jj_nb)
     235    REAL :: Field2d(nbp_lon,jj_nb)
    232236
    233237    integer :: ip
     
    240244    CALL grid1Dto2D_mpi(buffer_omp,Field2d)
    241245    if(.NOT.lpoint) THEN
    242      ALLOCATE(index2d(iim*jj_nb))
    243      ALLOCATE(fieldok(iim*jj_nb))
    244      CALL histwrite(nid,name,itau,Field2d,iim*jj_nb,index2d)
     246     ALLOCATE(index2d(nbp_lon*jj_nb))
     247     ALLOCATE(fieldok(nbp_lon*jj_nb))
     248     CALL histwrite(nid,name,itau,Field2d,nbp_lon*jj_nb,index2d)
    245249    else
    246250     ALLOCATE(fieldok(npstn))
     
    278282                                jj_nb, klon_mpi
    279283  USE ioipsl, only: histwrite
     284  USE mod_grid_phy_lmdz, ONLY: nbp_lon
    280285  implicit none
    281   include 'dimensions.h'
    282286   
    283287    integer,intent(in) :: nid
     
    287291    real,dimension(:,:),intent(in) :: field  ! --> field(klon,:)
    288292    REAL,dimension(klon_mpi,size(field,2)) :: buffer_omp
    289     REAL :: Field3d(iim,jj_nb,size(field,2))
     293    REAL :: Field3d(nbp_lon,jj_nb,size(field,2))
    290294    INTEGER :: ip, n, nlev
    291295    INTEGER, ALLOCATABLE, dimension(:) :: index3d
     
    299303    CALL grid1Dto2D_mpi(buffer_omp,field3d)
    300304    if(.NOT.lpoint) THEN
    301      ALLOCATE(index3d(iim*jj_nb*nlev))
    302      ALLOCATE(fieldok(iim*jj_nb,nlev))
    303      CALL histwrite(nid,name,itau,Field3d,iim*jj_nb*nlev,index3d)
     305     ALLOCATE(index3d(nbp_lon*jj_nb*nlev))
     306     ALLOCATE(fieldok(nbp_lon*jj_nb,nlev))
     307     CALL histwrite(nid,name,itau,Field3d,nbp_lon*jj_nb*nlev,index3d)
    304308    else
    305309      nlev=size(field,2)
     
    341345                                jj_nb, klon_mpi
    342346  USE xios, only: xios_send_field
    343 
    344 
     347  USE print_control_mod, ONLY: prt_level, lunout
     348  USE mod_grid_phy_lmdz, ONLY: nbp_lon
    345349  IMPLICIT NONE
    346   INCLUDE 'dimensions.h'
    347   INCLUDE 'iniprint.h'
    348350
    349351    CHARACTER(LEN=*), INTENT(IN) :: field_name
     
    351353     
    352354    REAL,DIMENSION(klon_mpi) :: buffer_omp
    353     REAL :: Field2d(iim,jj_nb)
     355    REAL :: Field2d(nbp_lon,jj_nb)
    354356
    355357    IF (prt_level >= 10) WRITE(lunout,*)'Begin histrwrite2d_xios ',trim(field_name)
     
    377379                                jj_nb, klon_mpi
    378380  USE xios, only: xios_send_field
    379 
     381  USE print_control_mod, ONLY: prt_level,lunout
     382  USE mod_grid_phy_lmdz, ONLY: nbp_lon
    380383
    381384  IMPLICIT NONE
    382   INCLUDE 'dimensions.h'
    383   INCLUDE 'iniprint.h'
    384385
    385386    CHARACTER(LEN=*), INTENT(IN) :: field_name
     
    387388
    388389    REAL,DIMENSION(klon_mpi,SIZE(field,2)) :: buffer_omp
    389     REAL :: Field3d(iim,jj_nb,SIZE(field,2))
     390    REAL :: Field3d(nbp_lon,jj_nb,SIZE(field,2))
    390391    INTEGER :: ip, n, nlev
    391392
  • LMDZ5/trunk/libf/phydev/physiq.F90

    r2320 r2326  
    1818      USE mod_phys_lmdz_para, only : jj_nb
    1919      USE phys_state_var_mod, only : phys_state_var_init
     20      USE mod_grid_phy_lmdz, ONLY: nbp_lon,nbp_lat
    2021
    2122#ifdef CPP_XIOS
     
    2627
    2728      IMPLICIT none
    28 #include "dimensions.h"
    29 
    30       integer,parameter :: jjmp1=jjm+1-1/jjm
    31       integer,parameter :: iip1=iim+1
    3229!
    3330! Routine argument:
     
    5552      real,intent(out) :: d_qx(klon,klev,nqtot) ! physics tendency on tracers
    5653      real,intent(out) :: d_ps(klon) ! physics tendency on surface pressure
    57       real,intent(in) :: dudyn(iim+1,jjmp1,klev) ! Not used
     54      real,intent(in) :: dudyn(nbp_lon+1,nbp_lat,klev) ! Not used
    5855
    5956integer,save :: itau=0 ! counter to count number of calls to physics
     
    114111  ! define variables which will be written in "histins.nc" file
    115112  call histdef(nid_hist,'temperature','Atmospheric temperature','K', &
    116                iim,jj_nb,nhori,klev,1,klev,zvertid,32, &
     113               nbp_lon,jj_nb,nhori,klev,1,klev,zvertid,32, &
    117114               'inst(X)',t_ops,t_wrt)
    118115  call histdef(nid_hist,'u','Eastward Zonal Wind','m/s', &
    119                iim,jj_nb,nhori,klev,1,klev,zvertid,32, &
     116               nbp_lon,jj_nb,nhori,klev,1,klev,zvertid,32, &
    120117               'inst(X)',t_ops,t_wrt)
    121118  call histdef(nid_hist,'v','Northward Meridional Wind','m/s', &
    122                iim,jj_nb,nhori,klev,1,klev,zvertid,32, &
     119               nbp_lon,jj_nb,nhori,klev,1,klev,zvertid,32, &
    123120               'inst(X)',t_ops,t_wrt)
    124121  call histdef(nid_hist,'ps','Surface Pressure','Pa', &
    125                iim,jj_nb,nhori,1,1,1,zvertid,32, &
     122               nbp_lon,jj_nb,nhori,1,1,1,zvertid,32, &
    126123               'inst(X)',t_ops,t_wrt)
    127124  ! end definition sequence
  • LMDZ5/trunk/makelmdz

    r2269 r2326  
    296296then
    297297   #We'll use some physics
    298    src_dirs="$src_dirs phy$physique"
     298   src_dirs="$src_dirs phy_common phy$physique"
    299299   LIBPHY='$(LIBO)/libphy'"$physique"'.a'
    300    lib_phy='-lphy'"$physique"
     300   LIBPHY_COMMON='$(LIBO)/libphy_common.a'
     301   lib_phy='-lphy'"$physique"' -lphy_common'
    301302   CPP_KEY="$CPP_KEY CPP_PHYS"
    302303   if [[ $phys_root == "lmd" ]]
     
    690691"PHYS=$physique" \
    691692LIBPHY=${LIBPHY} \
     693LIBPHY_COMMON=${LIBPHY_COMMON} \
    692694LIBDYN_PHYS=${LIBDYN_PHYS} \
    693695DIM=$dimc \
     
    721723"PHYS=$physique" \
    722724LIBPHY=${LIBPHY} \
     725LIBPHY_COMMON=${LIBPHY_COMMON} \
    723726LIBDYN_PHYS=${LIBDYN_PHYS} \
    724727DIM=$dimc \
  • LMDZ5/trunk/makelmdz_fcm

    r2266 r2326  
    4343DYN_PHYS_PATH=$LMDGCM/.void_dir
    4444DYN_PHYS_SUB_PATH=$LMDGCM/.void_dir
     45PHY_COMMON_PATH=$LMDGCM/.void_dir
    4546RRTM_PATH=$LMDGCM/.void_dir
    4647SISVAT_PATH=$LMDGCM/.void_dir
     
    252253   CPP_KEY="$CPP_KEY CPP_EARTH"
    253254   fi
     255   # set physics common utilities path
     256   PHY_COMMON_PATH="${LIBFGCM}/phy_common"
    254257   # set the dyn/phys interface path
    255258   DYN_PHYS_PATH="${LIBFGCM}/dynlonlat_phylonlat"
     
    557560echo "%DYN           $DYN"           >> $config_fcm
    558561echo "%DYN_COMMON    $DYN_COMMON_PATH" >> $config_fcm
     562echo "%PHY_COMMON    $PHY_COMMON_PATH" >> $config_fcm
    559563echo "%FILTRE        $FILTRE_PATH"   >> $config_fcm
    560564echo "%PHYS          phy${physique}" >> $config_fcm
Note: See TracChangeset for help on using the changeset viewer.