Changeset 1543 for trunk/LMDZ.GENERIC


Ignore:
Timestamp:
Apr 22, 2016, 9:02:11 AM (9 years ago)
Author:
emillour
Message:

All models: Further adaptations to keep up with changes in LMDZ5 concerning
physics/dynamics separation:

  • dyn3d:
  • adapted gcm.F so that all physics initializations are now done in iniphysiq.
  • dyn3dpar:
  • adapted gcm.F so that all physics initializations are now done in iniphysiq.
  • updated calfis_p.F to follow up with changes.
  • copied over updated "bands.F90" from LMDZ5.
  • dynphy_lonlat:
  • calfis_p.F90, mod_interface_dyn_phys.F90, follow up of changes in phy_common/mod_* routines
  • phy_common:
  • added "geometry_mod.F90" to store information about the grid (replaces phy*/comgeomphy.F90) and give variables friendlier names: rlond => longitude , rlatd => latitude, airephy => cell_area, cuphy => dx , cvphy => dy
  • added "physics_distribution_mod.F90"
  • updated "mod_grid_phy_lmdz.F90", "mod_phys_lmdz_mpi_data.F90", "mod_phys_lmdz_para.F90", "mod_phys_lmdz_mpi_transfert.F90", "mod_grid_phy_lmdz.F90", "mod_phys_lmdz_omp_data.F90", "mod_phys_lmdz_omp_transfert.F90", "write_field_phy.F90" and "ioipsl_getin_p_mod.F90" to LMDZ5 versions.
  • phy[venus/titan/mars/std]:
  • removed "init_phys_lmdz.F90", "comgeomphy.F90"; adapted routines to use geometry_mod (longitude, latitude, cell_area, etc.)

EM

Location:
trunk/LMDZ.GENERIC
Files:
5 added
2 deleted
24 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.GENERIC/README

    r1542 r1543  
    12031203   comgeomphy.F90 instead
    12041204
    1205 
     1205== 22/04/2016 ==
     1206- Updates and cleanup wrt dynamics/physics separation:
     1207  Removed init_phys_lmdz.F90 and comgeomphy.F90 from phystd;
     1208  comgeomphy is replaced by geometry_mod (located in phy_common).
     1209  Added physics_distribution_mod.F90 in phy_common and
     1210  mod_interface_dyn_phys.F90 in dynphy_lonlat.
     1211  Added nrtype.F90 (contains math const. like PI, etc.) in "misc"
     1212
  • trunk/LMDZ.GENERIC/libf/dyn3d/gcm.F

    r1523 r1543  
    66     &                       iconser, ecritphy, idissip
    77!      use comgeomphy, only: initcomgeomphy
     8      USE mod_const_mpi, ONLY: COMM_LMDZ
    89      use filtreg_mod, only: inifilr
    910      USE comvert_mod, ONLY: ap,bp
     
    155156      REAL dtetaecdt(ip1jmp1,llm)
    156157      REAL vcont(ip1jm,llm),ucont(ip1jmp1,llm)
    157       REAL vnat(ip1jm,llm),unat(ip1jmp1,llm)
    158158
    159159c-----------------------------------------------------------------------
     
    177177c-----------------------------------------------------------------------
    178178      CALL defrun_new( 99, .TRUE. )
    179 
    180 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    181 ! FH 2008/05/02
    182 ! A nettoyer. On ne veut qu'une ou deux routines d'interface
    183 ! dynamique -> physique pour l'initialisation
    184 !#ifdef CPP_PHYS
    185       CALL init_phys_lmdz(iim,jjp1,llm,1,(/(jjm-1)*iim+2/))
    186 !      call initcomgeomphy ! now done in iniphysiq
    187 !#endif
    188 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    189179
    190180! Initialize tracers
     
    260250!#ifdef CPP_PHYS
    261251!         CALL iniphysiq(iim,jjm,llm,daysec,day_ini,dtphys/nsplit_phys,
    262          CALL iniphysiq(iim,jjm,llm,daysec,day_ini,dtphys,
     252         CALL iniphysiq(iim,jjm,llm,
     253     &                  (jjm-1)*iim+2,comm_lmdz,
     254     &                  daysec,day_ini,dtphys,
    263255     &                  rlatu,rlatv,rlonu,rlonv,
    264256     &                  aire,cu,cv,rad,g,r,cpp,
  • trunk/LMDZ.GENERIC/libf/dynphy_lonlat/phystd/iniphysiq_mod.F90

    r1542 r1543  
    33CONTAINS
    44
    5 subroutine iniphysiq(ii,jj,nlayer,punjours, pdayref,ptimestep,           &
    6                rlatudyn,rlatvdyn,rlonudyn,rlonvdyn,airedyn,cudyn,cvdyn,  &
     5subroutine iniphysiq(ii,jj,nlayer, &
     6                     nbp, communicator, &
     7                     punjours, pdayref,ptimestep, &
     8                     rlatudyn,rlatvdyn,rlonudyn,rlonvdyn, &
     9                     airedyn,cudyn,cvdyn, &
    710                     prad,pg,pr,pcpp,iflag_phys)
    811
    9 use dimphy, only : klev ! number of atmospheric levels
    10 use mod_grid_phy_lmdz, only : klon_glo ! number of atmospheric columns
    11                                        ! (on full grid)
     12use dimphy, only : init_dimphy
     13use mod_grid_phy_lmdz, only : klon_glo, & ! number of atmospheric columns (on full grid)
     14                              regular_lonlat  ! regular longitude-latitude grid type
    1215use mod_phys_lmdz_para, only : klon_omp, & ! number of columns (on local omp grid)
    1316                               klon_omp_begin, & ! start index of local omp subgrid
     
    1518                               klon_mpi_begin ! start indes of columns (on local mpi grid)
    1619use control_mod, only: nday
    17 use comgeomphy, only : initcomgeomphy, &
    18                        cell_area, & ! physics grid area (m2)
    19                        dx, & ! cu coeff. (u_covariant = cu * u)
    20                        dy, & ! cv coeff. (v_covariant = cv * v)
    21                        longitude, & ! longitudes (rad)
    22                        latitude ! latitudes (rad)
     20use geometry_mod, only: init_geometry, &
     21                        cell_area, & ! physics grid area (m2)
     22                        longitude, & ! longitudes (rad)
     23                        latitude ! latitudes (rad)
     24!use comgeomphy, only : initcomgeomphy, &
     25!                       cell_area, & ! physics grid area (m2)
     26!                       dx, & ! cu coeff. (u_covariant = cu * u)
     27!                       dy, & ! cv coeff. (v_covariant = cv * v)
     28!                       longitude, & ! longitudes (rad)
     29!                       latitude ! latitudes (rad)
    2330use surf_heat_transp_mod, only: ini_surf_heat_transp
    2431use infotrac, only : nqtot ! number of advected tracers
     
    2633USE comvert_mod, ONLY: ap,bp,preff
    2734use inifis_mod, only: inifis
     35use physics_distribution_mod, only: init_physics_distribution
    2836use regular_lonlat_mod, only: init_regular_lonlat, &
    2937                              east, west, north, south, &
    3038                              north_east, north_west, &
    3139                              south_west, south_east
     40use mod_interface_dyn_phys, only: init_interface_dyn_phys
    3241use ioipsl_getin_p_mod, only: getin_p
    3342
     
    4756integer,intent(in) :: ii ! number of atmospheric coulumns along longitudes
    4857integer,intent(in) :: jj  ! number of atompsheric columns along latitudes
     58integer,intent(in) :: nbp ! number of physics columns for this MPI process
     59integer,intent(in) :: communicator ! MPI communicator
    4960real,intent(in) :: rlatudyn(jj+1) ! latitudes of the physics grid
    5061real,intent(in) :: rlatvdyn(jj) ! latitude boundaries of the physics grid
     
    5970
    6071integer :: ibegin,iend,offset
    61 integer :: i,j
     72integer :: i,j,k
    6273character(len=20) :: modname='iniphysiq'
    6374character(len=80) :: abort_message
     
    7182
    7283! global array, on full physics grid:
    73 real,allocatable :: latfi(:)
    74 real,allocatable :: lonfi(:)
    75 real,allocatable :: cufi(:)
    76 real,allocatable :: cvfi(:)
    77 real,allocatable :: airefi(:)
     84real,allocatable :: latfi_glo(:)
     85real,allocatable :: lonfi_glo(:)
     86real,allocatable :: cufi_glo(:)
     87real,allocatable :: cvfi_glo(:)
     88real,allocatable :: airefi_glo(:)
     89real,allocatable :: boundslonfi_glo(:,:)
     90real,allocatable :: boundslatfi_glo(:,:)
     91
     92! local arrays, on given MPI/OpenMP domain:
     93real,allocatable,save :: latfi(:)
     94real,allocatable,save :: lonfi(:)
     95real,allocatable,save :: cufi(:)
     96real,allocatable,save :: cvfi(:)
     97real,allocatable,save :: airefi(:)
     98real,allocatable,save :: boundslonfi(:,:)
     99real,allocatable,save :: boundslatfi(:,:)
     100!$OMP THREADPRIVATE (latfi,lonfi,cufi,cvfi,airefi,boundslonfi,boundslatfi)
    78101
    79102pi=2.*asin(1.0)
    80103
    81 IF (nlayer.NE.klev) THEN
    82   write(*,*) 'STOP in ',trim(modname)
    83   write(*,*) 'Problem with dimensions :'
    84   write(*,*) 'nlayer     = ',nlayer
    85   write(*,*) 'klev   = ',klev
    86   abort_message = ''
    87   CALL abort_gcm (modname,abort_message,1)
    88 ENDIF
    89 
    90 !IF (ngrid.NE.klon_glo) THEN
    91 !  write(*,*) 'STOP in ',trim(modname)
    92 !  write(*,*) 'Problem with dimensions :'
    93 !  write(*,*) 'ngrid     = ',ngrid
    94 !  write(*,*) 'klon   = ',klon_glo
    95 !  abort_message = ''
    96 !  CALL abort_gcm (modname,abort_message,1)
    97 !ENDIF
    98 
    99 !call init_phys_lmdz(iim,jjm+1,llm,1,(/(jjm-1)*iim+2/))
     104! Initialize Physics distibution and parameters and interface with dynamics
     105CALL init_physics_distribution(regular_lonlat,4, &
     106                                 nbp,ii,jj+1,nlayer,communicator)
     107CALL init_interface_dyn_phys
    100108
    101109! init regular global longitude-latitude grid points and boundaries
     
    122130
    123131! Generate global arrays on full physics grid
    124 allocate(latfi(klon_glo),lonfi(klon_glo),cufi(klon_glo),cvfi(klon_glo))
    125 latfi(1)=rlatudyn(1)
    126 lonfi(1)=0.
    127 cufi(1) = cudyn(1)
    128 cvfi(1) = cvdyn(1)
     132allocate(latfi_glo(klon_glo),lonfi_glo(klon_glo))
     133allocate(cufi_glo(klon_glo),cvfi_glo(klon_glo))
     134allocate(airefi_glo(klon_glo))
     135allocate(boundslonfi_glo(klon_glo,4))
     136allocate(boundslatfi_glo(klon_glo,4))
     137
     138! North pole
     139latfi_glo(1)=rlatudyn(1)
     140lonfi_glo(1)=0.
     141cufi_glo(1) = cudyn(1)
     142cvfi_glo(1) = cvdyn(1)
     143boundslonfi_glo(1,north_east)=0
     144boundslatfi_glo(1,north_east)=PI/2
     145boundslonfi_glo(1,north_west)=2*PI
     146boundslatfi_glo(1,north_west)=PI/2
     147boundslonfi_glo(1,south_west)=2*PI
     148boundslatfi_glo(1,south_west)=rlatvdyn(1)
     149boundslonfi_glo(1,south_east)=0
     150boundslatfi_glo(1,south_east)=rlatvdyn(1)
    129151DO j=2,jj
    130152  DO i=1,ii
    131     latfi((j-2)*ii+1+i)= rlatudyn(j)
    132     lonfi((j-2)*ii+1+i)= rlonvdyn(i)
    133     cufi((j-2)*ii+1+i) = cudyn((j-1)*(ii+1)+i)
    134     cvfi((j-2)*ii+1+i) = cvdyn((j-1)*(ii+1)+i)
     153    k=(j-2)*ii+1+i
     154    latfi_glo((j-2)*ii+1+i)= rlatudyn(j)
     155    lonfi_glo((j-2)*ii+1+i)= rlonvdyn(i)
     156    cufi_glo((j-2)*ii+1+i) = cudyn((j-1)*(ii+1)+i)
     157    cvfi_glo((j-2)*ii+1+i) = cvdyn((j-1)*(ii+1)+i)
     158    boundslonfi_glo(k,north_east)=rlonudyn(i)
     159    boundslatfi_glo(k,north_east)=rlatvdyn(j-1)
     160    boundslonfi_glo(k,north_west)=rlonudyn(i+1)
     161    boundslatfi_glo(k,north_west)=rlatvdyn(j-1)
     162    boundslonfi_glo(k,south_west)=rlonudyn(i+1)
     163    boundslatfi_glo(k,south_west)=rlatvdyn(j)
     164    boundslonfi_glo(k,south_east)=rlonudyn(i)
     165    boundslatfi_glo(k,south_east)=rlatvdyn(j)
    135166  ENDDO
    136167ENDDO
    137 latfi(klon_glo)= rlatudyn(jj+1)
    138 lonfi(klon_glo)= 0.
    139 cufi(klon_glo) = cudyn((ii+1)*jj+1)
    140 cvfi(klon_glo) = cvdyn((ii+1)*jj-ii)
     168! South pole
     169latfi_glo(klon_glo)= rlatudyn(jj+1)
     170lonfi_glo(klon_glo)= 0.
     171cufi_glo(klon_glo) = cudyn((ii+1)*jj+1)
     172cvfi_glo(klon_glo) = cvdyn((ii+1)*jj-ii)
     173boundslonfi_glo(klon_glo,north_east)= 0
     174boundslatfi_glo(klon_glo,north_east)= rlatvdyn(jj)
     175boundslonfi_glo(klon_glo,north_west)= 2*PI
     176boundslatfi_glo(klon_glo,north_west)= rlatvdyn(jj)
     177boundslonfi_glo(klon_glo,south_west)= 2*PI
     178boundslatfi_glo(klon_glo,south_west)= -PI/2
     179boundslonfi_glo(klon_glo,south_east)= 0
     180boundslatfi_glo(klon_glo,south_east)= -Pi/2
    141181
    142182! build airefi(), mesh area on physics grid
    143 allocate(airefi(klon_glo))
    144 CALL gr_dyn_fi(1,ii+1,jj+1,klon_glo,airedyn,airefi)
     183CALL gr_dyn_fi(1,ii+1,jj+1,klon_glo,airedyn,airefi_glo)
    145184! Poles are single points on physics grid
    146 airefi(1)=sum(airedyn(1:ii,1))
    147 airefi(klon_glo)=sum(airedyn(1:ii,jj+1))
     185airefi_glo(1)=sum(airedyn(1:ii,1))
     186airefi_glo(klon_glo)=sum(airedyn(1:ii,jj+1))
    148187
    149188! Sanity check: do total planet area match between physics and dynamics?
    150189total_area_dyn=sum(airedyn(1:ii,1:jj+1))
    151 total_area_phy=sum(airefi(1:klon_glo))
     190total_area_phy=sum(airefi_glo(1:klon_glo))
    152191IF (total_area_dyn/=total_area_phy) THEN
    153192  WRITE (lunout, *) 'iniphysiq: planet total surface discrepancy !!!'
     
    164203!$OMP PARALLEL
    165204! Now generate local lon/lat/cu/cv/area arrays
    166 call initcomgeomphy
    167 
    168 !!!!$OMP PARALLEL PRIVATE(ibegin,iend) &
    169 !!!     !$OMP SHARED(airefi,cufi,cvfi,lonfi,latfi)
     205allocate(latfi(klon_omp),lonfi(klon_omp),cufi(klon_omp),cvfi(klon_omp))
     206allocate(airefi(klon_omp))
     207allocate(boundslonfi(klon_omp,4))
     208allocate(boundslatfi(klon_omp,4))
     209!call initcomgeomphy
    170210
    171211offset=klon_mpi_begin-1
    172 cell_area(1:klon_omp)=airefi(offset+klon_omp_begin:offset+klon_omp_end)
    173 dx(1:klon_omp)=cufi(offset+klon_omp_begin:offset+klon_omp_end)
    174 dy(1:klon_omp)=cvfi(offset+klon_omp_begin:offset+klon_omp_end)
    175 longitude(1:klon_omp)=lonfi(offset+klon_omp_begin:offset+klon_omp_end)
    176 latitude(1:klon_omp)=latfi(offset+klon_omp_begin:offset+klon_omp_end)
     212airefi(1:klon_omp)=airefi_glo(offset+klon_omp_begin:offset+klon_omp_end)
     213cufi(1:klon_omp)=cufi_glo(offset+klon_omp_begin:offset+klon_omp_end)
     214cvfi(1:klon_omp)=cvfi_glo(offset+klon_omp_begin:offset+klon_omp_end)
     215lonfi(1:klon_omp)=lonfi_glo(offset+klon_omp_begin:offset+klon_omp_end)
     216latfi(1:klon_omp)=latfi_glo(offset+klon_omp_begin:offset+klon_omp_end)
     217boundslonfi(1:klon_omp,:)=boundslonfi_glo(offset+klon_omp_begin:offset+klon_omp_end,:)
     218boundslatfi(1:klon_omp,:)=boundslatfi_glo(offset+klon_omp_begin:offset+klon_omp_end,:)
     219
     220! copy over local grid longitudes and latitudes
     221CALL init_geometry(klon_omp,lonfi,latfi,boundslonfi,boundslatfi, &
     222                   airefi,cufi,cvfi)
     223
     224call init_dimphy(klon_omp,nlayer) ! Initialize dimphy module
    177225
    178226! copy over preff , ap() and bp()
  • trunk/LMDZ.GENERIC/libf/dynphy_lonlat/phystd/newstart.F

    r1524 r1543  
    1515c=======================================================================
    1616
     17      use mod_phys_lmdz_para, only: is_parallel, is_sequential,
     18     &                              is_mpi_root, is_omp_root,
     19     &                              is_master
    1720      use infotrac, only: infotrac_init, nqtot, tname
    1821      USE tracer_h, ONLY: igcm_co2_ice, igcm_h2o_vap, igcm_h2o_ice
     
    2023      USE surfdat_h, ONLY: phisfi, albedodat,
    2124     &                     zmea, zstd, zsig, zgam, zthe
    22       USE comgeomfi_h, ONLY: lati, long, area
    2325      use datafile_mod, only: datadir, surfdir
    2426      use ioipsl_getin_p_mod, only: getin_p
     
    2628      use phyredem, only: physdem0, physdem1
    2729      use iostart, only: open_startphy
    28       use comgeomphy, only: initcomgeomphy
    2930      use slab_ice_h, only:noceanmx
    3031      use filtreg_mod, only: inifilr
     32      USE mod_const_mpi, ONLY: COMM_LMDZ
    3133      USE comvert_mod, ONLY: ap,bp,aps,bps,pa,preff
    3234      USE comconst_mod, ONLY: lllm,daysec,dtvr,dtphys,cpp,kappa,
    33      .                  rad,omeg,g,r,pi
     35     .                        rad,omeg,g,r,pi
    3436      USE serre_mod, ONLY: alphax
    3537      USE temps_mod, ONLY: day_ini
    3638      USE ener_mod, ONLY: etot0,ptot0,ztot0,stot0,ang0
    37       use inifis_mod, only: inifis
     39      use iniphysiq_mod, only: iniphysiq
    3840      implicit none
    3941
    40 #include "dimensions.h"
    41 !#include "dimphys.h"
     42      include "dimensions.h"
    4243      integer, parameter :: ngridmx = (2+(jjm-1)*iim - 1/jjm)
    43 !#include "planete.h"
    44 #include "paramet.h"
    45 #include "comgeom2.h"
    46 !#include "control.h"
    47 #include "comdissnew.h"
    48 #include "netcdf.inc"
    49 !#include "advtrac.h"
     44      include "paramet.h"
     45      include "comgeom2.h"
     46      include "comdissnew.h"
     47      include "netcdf.inc"
     48
    5049c=======================================================================
    5150c   Declarations
     
    5453c Variables dimension du fichier "start_archive"
    5554c------------------------------------
    56       CHARACTER relief*3
     55      CHARACTER        relief*3
    5756
    5857
     
    9493c variable physique
    9594c------------------
    96       REAL tsurf(ngridmx)       ! surface temperature
    97       REAL tsoil(ngridmx,nsoilmx) ! soil temperature
    98 !      REAL co2ice(ngridmx)     ! CO2 ice layer
    99       REAL emis(ngridmx)        ! surface emissivity
     95      REAL tsurf(ngridmx)        ! surface temperature
     96      REAL,ALLOCATABLE :: tsoil(:,:) ! soil temperature
     97!      REAL co2ice(ngridmx)        ! CO2 ice layer
     98      REAL emis(ngridmx)        ! surface emissivity
    10099      real emisread             ! added by RW
    101100      REAL,ALLOCATABLE :: qsurf(:,:)
     
    103102!      REAL rnaturfi(ngridmx)
    104103      real alb(iip1,jjp1),albfi(ngridmx) ! albedos
    105       real ith(iip1,jjp1,nsoilmx),ithfi(ngridmx,nsoilmx) ! thermal inertia (3D)
     104      real,ALLOCATABLE :: ith(:,:,:),ithfi(:,:) ! thermal inertia (3D)
    106105      real surfith(iip1,jjp1),surfithfi(ngridmx) ! surface thermal inertia (2D)
    107106      REAL latfi(ngridmx),lonfi(ngridmx),airefi(ngridmx)
     
    113112
    114113      REAL rnat(ngridmx)
    115       REAL tslab(ngridmx,nsoilmx) ! slab ocean temperature
     114      REAL,ALLOCATABLE :: tslab(:,:) ! slab ocean temperature
    116115      REAL pctsrf_sic(ngridmx) ! sea ice cover
    117116      REAL tsea_ice(ngridmx) ! temperature sea_ice
     
    145144      character*80      fichnom
    146145      character*250  filestring
    147       integer Lmodif,iq,thermo
     146      integer Lmodif,iq
    148147      character modif*20
    149148      real z_reel(iip1,jjp1)
     
    155154      real val, val2, val3, val4 ! to store temporary variables
    156155      real :: iceith=2000 ! thermal inertia of subterranean ice
    157       integer iref,jref
    158156
    159157      INTEGER :: itau
    160158     
    161       INTEGER :: nq,numvanle
    162159      character(len=20) :: txt ! to store some text
    163160      character(len=50) :: surfacefile ! "surface.nc" (or equivalent file)
     
    166163      real :: profile(llm+1) ! to store an atmospheric profile + surface value
    167164
    168 !     added by RW for test
    169       real pmean, phi0
    170 
    171165!     added by BC for equilibrium temperature startup
    172166      real teque
     
    193187                  ! make deliberate choice of these values elsewhere.
    194188
     189      planet_type="generic"
     190
    195191! initialize "serial/parallel" related stuff
    196       CALL init_phys_lmdz(iim,jjp1,llm,1,(/(jjm-1)*iim+2/))
    197       call initcomgeomphy
     192! (required because we call tabfi() below, before calling iniphysiq)
     193      is_sequential=.true.
     194      is_parallel=.false.
     195      is_mpi_root=.true.
     196      is_omp_root=.true.
     197      is_master=.true.
     198     
    198199! Load tracer number and names:
    199 !      call iniadvtrac(nqtot,numvanle)
    200200      call infotrac_init
    201201! allocate arrays
     
    203203      allocate(qsurf(ngridmx,nqtot))
    204204     
    205       planet_type="generic"
    206 
     205! get value of nsoilmx and allocate corresponding arrays
     206      nsoilmx=18 ! default value
     207      call getin_p("nsoilmx",nsoilmx)
     208     
     209      allocate(tsoil(ngridmx,nsoilmx))
     210      allocate(ith(iip1,jjp1,nsoilmx),ithfi(ngridmx,nsoilmx))
     211      allocate(tslab(ngridmx,nsoilmx))
     212     
    207213c=======================================================================
    208214c   Choice of the start file(s) to use
     
    284290      IF (.not. ALLOCATED(zgam)) ALLOCATE(zgam(ngridmx))
    285291      IF (.not. ALLOCATED(zthe)) ALLOCATE(zthe(ngridmx))
    286       ! ALLOCATE ARRAYS in comsoil_h (if not already done)
    287       IF (.not.ALLOCATED(layer))
    288      . ALLOCATE(layer(nsoilmx))
    289       IF (.not.ALLOCATED(mlayer))
    290      . ALLOCATE(mlayer(0:nsoilmx-1))
    291       IF (.not.ALLOCATED(inertiedat))
    292      . ALLOCATE(inertiedat(ngridmx,nsoilmx))
    293       ! ALLOCATE ARRAYS IN comgeomfi_h (done in inifis usually)
    294       IF (.not. ALLOCATED(lati)) ALLOCATE(lati(ngridmx))
    295       IF (.not. ALLOCATED(long)) ALLOCATE(long(ngridmx))
    296       IF (.not. ALLOCATED(area)) ALLOCATE(area(ngridmx))
    297292
    298293c-----------------------------------------------------------------------
     
    337332          write(*,*) i,tab_cntrl(i)
    338333        enddo
    339        
     334       
    340335        ! Lmodif set to 0 to disable modifications possibility in phyeta0                           
    341336        write(*,*) 'Reading file START'
     
    355350        do i=1,ngridmx
    356351          albfi(i) = albedodat(i)
    357           do j=1,nsoilmx
     352          do j=1,nsoilmx
    358353           ithfi(i,j) = inertiedat(i,j)
    359           enddo
     354          enddo
    360355        ! build a surfithfi(:) using 1st layer of ithfi(:), which might
    361356        ! be needed later on if reinitializing soil thermal inertia
     
    371366      endif
    372367c-----------------------------------------------------------------------
    373 c               Initialisation des constantes dynamique
     368c                Initialisation des constantes dynamique
    374369c-----------------------------------------------------------------------
    375370
     
    451446      idum=0
    452447
    453 c Initialisation coordonnees /aires
    454 c -------------------------------
    455 ! Note: rlatu(:) and rlonv(:) are commons defined in "comgeom.h"
    456 !       rlatu() and rlonv() are given in radians
    457       latfi(1)=rlatu(1)
    458       lonfi(1)=0.
    459       DO j=2,jjm
    460          DO i=1,iim
    461             latfi((j-2)*iim+1+i)=rlatu(j)
    462             lonfi((j-2)*iim+1+i)=rlonv(i)
    463          ENDDO
    464       ENDDO
    465       latfi(ngridmx)=rlatu(jjp1)
    466       lonfi(ngridmx)=0.
    467        
    468       ! build airefi(), mesh area on physics grid
    469       CALL gr_dyn_fi(1,iip1,jjp1,ngridmx,aire,airefi)
    470       ! Poles are single points on physics grid
    471       airefi(1)=sum(aire(1:iim,1))
    472       airefi(ngridmx)=sum(aire(1:iim,jjm+1))
    473 
    474 ! also initialize various physics flags/settings which might be needed
    475 !    (for instance initracer needs to know about some flags, and/or
    476 !      'datafile' path may be changed by user)
    477       call inifis(ngridmx,llm,nqtot,day_ini,daysec,dtphys,
    478      &                latfi,lonfi,airefi,rad,g,r,cpp)
     448! Initialize the physics
     449         CALL iniphysiq(iim,jjm,llm,
     450     &                  (jjm-1)*iim+2,comm_lmdz,
     451     &                  daysec,day_ini,dtphys,
     452     &                  rlatu,rlatv,rlonu,rlonv,
     453     &                  aire,cu,cv,rad,g,r,cpp,
     454     &                  1)
    479455
    480456c=======================================================================
     
    560536     &   rnat,pctsrf_sic,tslab,tsea_ice,sea_ice)
    561537        write(*,*) "OK, read start_archive file"
    562         ! copy soil thermal inertia
    563         ithfi(:,:)=inertiedat(:,:)
    564        
     538        ! copy soil thermal inertia
     539        ithfi(:,:)=inertiedat(:,:)
     540       
    565541        ierr= NF_CLOSE(nid)
    566542
     
    727703          DO j=1,jjp1
    728704             DO i=1,iip1
    729                 alb(i,j) = alb_bb       ! albedo
    730                 do isoil=1,nsoilmx
    731                   ith(i,j,isoil) = ith_bb       ! thermal inertia
    732                 enddo
     705                alb(i,j) = alb_bb        ! albedo
     706                do isoil=1,nsoilmx
     707                  ith(i,j,isoil) = ith_bb        ! thermal inertia
     708                enddo
    733709             END DO
    734710          END DO
     
    867843         if (yes.eq.'y') then
    868844           write(*,*) 'Value?'
    869                 read(*,*,iostat=ierr) psea
     845                read(*,*,iostat=ierr) psea
    870846             DO i=1,iip1
    871847               DO j=1,jjp1
     
    874850                  ENDDO
    875851               ENDDO
    876                 write(*,*) 'psea=',psea
     852                write(*,*) 'psea=',psea
    877853          else
    878854            write(*,*) 'no'
     
    14671443!       ----------------------------------------------------------------------
    14681444
    1469         else if (trim(modif) .eq. 'therm_ini_s') then
     1445        else if (trim(modif) .eq. 'therm_ini_s') then
    14701446!          write(*,*)"surfithfi(1):",surfithfi(1)
    1471           do isoil=1,nsoilmx
    1472             inertiedat(1:ngridmx,isoil)=surfithfi(1:ngridmx)
    1473           enddo
     1447          do isoil=1,nsoilmx
     1448            inertiedat(1:ngridmx,isoil)=surfithfi(1:ngridmx)
     1449          enddo
    14741450          write(*,*)'OK: Soil thermal inertia has been reset to referenc
    14751451     &e surface values'
    1476 !         write(*,*)"inertiedat(1,1):",inertiedat(1,1)
    1477           ithfi(:,:)=inertiedat(:,:)
    1478         ! recast ithfi() onto ith()
    1479         call gr_fi_dyn(nsoilmx,ngridmx,iip1,jjp1,ithfi,ith)
     1452!          write(*,*)"inertiedat(1,1):",inertiedat(1,1)
     1453          ithfi(:,:)=inertiedat(:,:)
     1454        ! recast ithfi() onto ith()
     1455        call gr_fi_dyn(nsoilmx,ngridmx,iip1,jjp1,ithfi,ith)
    14801456! Check:
    14811457!         do i=1,iip1
     
    14851461!             enddo
    14861462!           enddo
    1487 !        enddo
     1463!        enddo
    14881464
    14891465
     
    16601636
    16611637c=======================================================================
    1662 c       Formats
     1638c        Formats
    16631639c=======================================================================
    16641640
  • trunk/LMDZ.GENERIC/libf/dynphy_lonlat/phystd/start2archive.F

    r1478 r1543  
    2121      use infotrac, only: infotrac_init, nqtot, tname
    2222      USE comsoil_h
    23       USE comgeomfi_h, ONLY: lati, long, area
     23     
     24!      USE comgeomfi_h, ONLY: lati, long, area
    2425!      use control_mod
    25       use comgeomphy, only: initcomgeomphy
     26!      use comgeomphy, only: initcomgeomphy
    2627      use slab_ice_h, only: noceanmx
    2728! to use  'getin'
    2829      USE ioipsl_getincom
    2930      USE planete_mod, only: year_day
     31      USE mod_const_mpi, ONLY: COMM_LMDZ
    3032      USE control_mod, only: planet_type
    3133      USE callkeys_mod, ONLY: ok_slab_ocean
    3234      use filtreg_mod, only: inifilr
    3335      USE comvert_mod, ONLY: ap,bp
    34       USE comconst_mod, ONLY: cpp,g
     36      USE comconst_mod, ONLY: daysec,dtphys,rad,g,r,cpp
    3537      USE logic_mod, ONLY: grireg
    3638      USE temps_mod, ONLY: day_ini
     39      USE iniphysiq_mod, ONLY: iniphysiq
    3740      implicit none
    3841
    39 #include "dimensions.h"
     42      include "dimensions.h"
    4043      integer, parameter :: ngridmx = (2+(jjm-1)*iim - 1/jjm)
    41 #include "paramet.h"
    42 #include "comdissip.h"
    43 #include "comgeom.h"
     44      include "paramet.h"
     45      include "comdissip.h"
     46      include "comgeom.h"
    4447!#include "control.h"
    4548
     
    4750!#include "planete.h"
    4851!#include"advtrac.h"
    49 #include "netcdf.inc"
     52      include "netcdf.inc"
    5053c-----------------------------------------------------------------------
    5154c   Declarations
     
    6871c Variable Physiques (grille physique)
    6972c ------------------------------------
    70       REAL tsurf(ngridmx)       ! Surface temperature
    71       REAL tsoil(ngridmx,nsoilmx) ! Soil temperature
    72       REAL co2ice(ngridmx)      ! CO2 ice layer
     73      REAL tsurf(ngridmx)        ! Surface temperature
     74      REAL,ALLOCATABLE :: tsoil(:,:) ! Soil temperature
     75      REAL co2ice(ngridmx)        ! CO2 ice layer
    7376      REAL q2(ngridmx,llm+1)
    7477      REAL,ALLOCATABLE :: qsurf(:,:)
     
    9396      REAL T(ip1jmp1,llm),us(ip1jmp1,llm),vs(ip1jmp1,llm)
    9497      REAL tsurfS(ip1jmp1)
    95       REAL tsoilS(ip1jmp1,nsoilmx)
    96       REAL ithS(ip1jmp1,nsoilmx) ! Soil Thermal Inertia
     98      REAL,ALLOCATABLE :: tsoilS(:,:)
     99      REAL,ALLOCATABLE :: ithS(:,:) ! Soil Thermal Inertia
    97100      REAL co2iceS(ip1jmp1)
    98101      REAL q2S(ip1jmp1,llm+1)
     
    144147      grireg   = .TRUE.
    145148
    146 ! initialize "serial/parallel" related stuff
    147       CALL init_phys_lmdz(iim,jjp1,llm,1,(/(jjm-1)*iim+2/))
    148       call initcomgeomphy
    149 
    150       ! ALLOCATE ARRAYS IN comgeomfi_h (usually done in inifis)
    151       ! this must be here for start2archive to work
    152       IF (.not. ALLOCATED(lati)) ALLOCATE(lati(ngridmx))
    153       IF (.not. ALLOCATED(long)) ALLOCATE(long(ngridmx))
    154       IF (.not. ALLOCATED(area)) ALLOCATE(area(ngridmx))
    155 
    156149      planet_type="generic"
    157150
     
    160153c=======================================================================
    161154! Load tracer number and names:
    162 !      call iniadvtrac(nqtot,numvanle)
    163155      call infotrac_init
    164156
     
    168160      allocate(qsurfS(ip1jmp1,nqtot))
    169161! other array allocations:
    170       call ini_comsoil_h(ngridmx)
     162!      call ini_comsoil_h(ngridmx) ! done via iniphysiq
    171163
    172164      fichnom = 'start.nc'
     
    198190
    199191      ierr = NF_CLOSE(nid1)
     192
     193! Get value of the "subsurface_layers" dimension from physics start file
     194      fichnom = 'startfi.nc'
     195      ierr = NF_OPEN (fichnom, NF_NOWRITE,nid1)
     196       IF (ierr.NE.NF_NOERR) THEN
     197         write(6,*)' Pb d''ouverture du fichier'//trim(fichnom)
     198        CALL ABORT
     199       ENDIF
     200      ierr = NF_INQ_DIMID(nid1,"subsurface_layers",varid)
     201      IF (ierr .NE. NF_NOERR) THEN
     202       PRINT*, "start2archive: No subsurface_layers dimension!!"
     203       CALL abort
     204      ENDIF
     205      ierr = NF_INQ_DIMLEN(nid1,varid,nsoilmx)
     206      IF (ierr .NE. NF_NOERR) THEN
     207       PRINT*, "start2archive: Failed reading subsurface_layers value!!"
     208       CALL abort
     209      ENDIF
     210      ierr = NF_CLOSE(nid1)
    200211     
     212      ! allocate arrays of nsoilmx size
     213      allocate(tsoil(ngridmx,nsoilmx))
     214      allocate(tsoilS(ip1jmp1,nsoilmx))
     215      allocate(ithS(ip1jmp1,nsoilmx))
     216
     217c-----------------------------------------------------------------------
     218c   Initialisations
     219c-----------------------------------------------------------------------
     220
     221      CALL defrun_new(99, .FALSE. )
     222      call iniconst
     223      call inigeom
     224      call inifilr
     225
     226! Initialize the physics
     227         CALL iniphysiq(iim,jjm,llm,
     228     &                  (jjm-1)*iim+2,comm_lmdz,
     229     &                  daysec,day_ini,dtphys,
     230     &                  rlatu,rlatv,rlonu,rlonv,
     231     &                  aire,cu,cv,rad,g,r,cpp,
     232     &                  1)
    201233
    202234      fichnom = 'startfi.nc'
     
    256288c *****************************************************************
    257289
    258 c-----------------------------------------------------------------------
    259 c   Initialisations
    260 c-----------------------------------------------------------------------
    261 
    262       CALL defrun_new(99, .FALSE. )
    263       call iniconst
    264       call inigeom
    265       call inifilr
    266290      CALL pression(ip1jmp1, ap, bp, ps, p3d)
    267291      call exner_hyb(ip1jmp1, ps, p3d, beta, pks, pk, pkf)
  • trunk/LMDZ.GENERIC/libf/phy_common/ioipsl_getin_p_mod.F90

    r1521 r1543  
    1212USE mod_phys_lmdz_mpi_data, ONLY :  is_mpi_root
    1313USE mod_phys_lmdz_omp_data, ONLY :  is_omp_root
    14 use mod_phys_lmdz_para, only : bcast
     14USE mod_phys_lmdz_transfert_para, ONLY : bcast
    1515!-
    1616IMPLICIT NONE
  • trunk/LMDZ.GENERIC/libf/phy_common/mod_grid_phy_lmdz.F90

    r1521 r1543  
    11!
    2 !$Header$
     2!$Id $
    33!
    44MODULE mod_grid_phy_lmdz
     
    77  PRIVATE :: grid1dTo2d_glo_igen, grid1dTo2d_glo_rgen, grid1dTo2d_glo_lgen, &
    88             grid2dTo1d_glo_igen, grid2dTo1d_glo_rgen, grid2dTo1d_glo_lgen
    9 
     9 
     10  INTEGER,PARAMETER :: unstructured=0
     11  INTEGER,PARAMETER :: regular_lonlat=1
     12
     13  INTEGER,SAVE :: grid_type
     14  INTEGER,SAVE :: nvertex
    1015  INTEGER,SAVE :: nbp_lon  ! == iim
    11   INTEGER,SAVE :: nbp_lat  ! == jjmp1
     16  INTEGER,SAVE :: nbp_lat  ! == jjmp1 (or == 1 if running 1D model)
    1217  INTEGER,SAVE :: nbp_lev  ! == llm
    13   INTEGER,SAVE :: klon_glo
    14 !$OMP THREADPRIVATE(nbp_lon,nbp_lat,nbp_lev,klon_glo)
     18  INTEGER,SAVE :: klon_glo ! total number of atmospheric columns
    1519
    1620  INTERFACE grid1dTo2d_glo
     
    3337
    3438
    35   SUBROUTINE init_grid_phy_lmdz(iim,jjp1,llm)
     39  SUBROUTINE init_grid_phy_lmdz(grid_type_,nvertex_,nbp_lon_,nbp_lat_,nbp_lev_)
    3640  IMPLICIT NONE
    37   INTEGER, INTENT(in) :: iim
    38   INTEGER, INTENT(in) :: jjp1
    39   INTEGER, INTENT(in) :: llm
    40  
    41     nbp_lon=iim
    42     nbp_lat=jjp1
    43     nbp_lev=llm
    44     klon_glo=(iim*jjp1)-2*(iim-1)
    45  
    46   ! Ehouarn: handle 1D case:
    47   if ((iim.eq.1).and.(jjp1.eq.2)) then
    48     nbp_lat=1
    49     klon_glo=1
    50   endif
     41  INTEGER,INTENT(IN)  :: grid_type_
     42  INTEGER,INTENT(IN)  :: nvertex_
     43  INTEGER, INTENT(IN) :: nbp_lon_
     44  INTEGER, INTENT(IN) :: nbp_lat_
     45  INTEGER, INTENT(IN) :: nbp_lev_
     46 
     47    grid_type = grid_type_
     48    nvertex   = nvertex_
     49    nbp_lon   = nbp_lon_
     50    nbp_lat   = nbp_lat_
     51    nbp_lev   = nbp_lev_
     52   
     53    IF (nbp_lon*nbp_lat==1) THEN
     54      klon_glo=1
     55    ELSE   
     56      klon_glo=(nbp_lon*nbp_lat)-2*(nbp_lon-1)
     57    ENDIF
    5158 
    5259  END SUBROUTINE init_grid_phy_lmdz
     
    284291
    285292!----------------------------------------------------------------
    286 fonctions generiques (privees)
     293Generic (private) fonctions
    287294!----------------------------------------------------------------
     295 
    288296  SUBROUTINE grid1dTo2d_glo_igen(VarIn,VarOut,dimsize)
     297
    289298    IMPLICIT NONE
    290299
     
    321330
    322331  SUBROUTINE grid1dTo2d_glo_rgen(VarIn,VarOut,dimsize)
     332
    323333    IMPLICIT NONE
    324334
     
    354364
    355365  SUBROUTINE grid1dTo2d_glo_lgen(VarIn,VarOut,dimsize)
     366
    356367    IMPLICIT NONE
    357368   
     
    387398 
    388399  SUBROUTINE grid2dTo1d_glo_igen(VarIn,VarOut,dimsize)
     400
    389401    IMPLICIT NONE
    390402
     
    409421 
    410422  SUBROUTINE grid2dTo1d_glo_rgen(VarIn,VarOut,dimsize)
     423
    411424    IMPLICIT NONE
    412425
     
    431444   
    432445  SUBROUTINE grid2dTo1d_glo_lgen(VarIn,VarOut,dimsize)
     446
    433447    IMPLICIT NONE
    434448
  • trunk/LMDZ.GENERIC/libf/phy_common/mod_phys_lmdz_mpi_data.F90

    r1521 r1543  
    33!
    44MODULE mod_phys_lmdz_mpi_data
    5   USE mod_const_mpi, only: MPI_REAL_LMDZ, COMM_LMDZ
     5!  USE mod_const_mpi
    66 
    77  INTEGER,SAVE :: ii_begin
     
    1616  INTEGER,SAVE :: klon_mpi_end
    1717  INTEGER,SAVE :: klon_mpi
    18 !!$OMP THREADPRIVATE(ii_begin,ii_end,jj_begin,jj_end,jj_nb,ij_begin,&
    19 !       !$OMP ij_end,ij_nb,klon_mpi_begin,klon_mpi_end,klon_mpi)
    2018 
    2119  INTEGER,SAVE,ALLOCATABLE,DIMENSION(:) :: jj_para_nb
     
    3331  INTEGER,SAVE,ALLOCATABLE,DIMENSION(:) :: klon_mpi_para_begin
    3432  INTEGER,SAVE,ALLOCATABLE,DIMENSION(:) :: klon_mpi_para_end
    35 !!$OMP THREADPRIVATE(jj_para_nb,jj_para_begin,jj_para_end,ii_para_begin,ii_para_end,&
    36 !       !$OMP ij_para_nb,ij_para_begin,ij_para_end,klon_mpi_para_nb,klon_mpi_para_begin,&
    37 !       !$OMP klon_mpi_para_end)
    3833
    3934 
    4035  INTEGER,SAVE :: mpi_rank
    4136  INTEGER,SAVE :: mpi_size
    42   INTEGER,SAVE :: mpi_root
     37  INTEGER,SAVE :: mpi_master
     38!  INTEGER,SAVE :: mpi_root
    4339  LOGICAL,SAVE :: is_mpi_root
    4440  LOGICAL,SAVE :: is_using_mpi
    45 !!$OMP THREADPRIVATE(mpi_rank,mpi_size,mpi_root,is_mpi_root,is_using_mpi)
    4641 
    4742 
     
    4944  LOGICAL,SAVE :: is_south_pole
    5045  INTEGER,SAVE :: COMM_LMDZ_PHY
    51 !!$OMP THREADPRIVATE(is_north_pole,is_south_pole,COMM_LMDZ_PHY)
     46  INTEGER,SAVE :: MPI_REAL_LMDZ   ! MPI_REAL8
    5247
    5348CONTAINS
    5449 
    55   SUBROUTINE Init_phys_lmdz_mpi_data(iim,jjp1,nb_proc,distrib)
    56   USE mod_const_mpi, ONLY : COMM_LMDZ
     50!  SUBROUTINE Init_phys_lmdz_mpi_data(iim,jjp1,nb_proc,distrib)
     51  SUBROUTINE init_phys_lmdz_mpi_data(nbp, nbp_lon, nbp_lat, communicator)
     52!  USE mod_const_mpi, ONLY : COMM_LMDZ
    5753  IMPLICIT NONE
    58     INTEGER,INTENT(in) :: iim
    59     INTEGER,INTENT(in) :: jjp1
    60     INTEGER,INTENT(in) :: nb_proc
    61     INTEGER,INTENT(in) :: distrib(0:nb_proc-1)
    62    
     54#ifdef CPP_MPI
     55    INCLUDE 'mpif.h'
     56#endif
     57    INTEGER,INTENT(in) :: nbp
     58    INTEGER,INTENT(in) :: nbp_lon
     59    INTEGER,INTENT(in) :: nbp_lat
     60    INTEGER,INTENT(in) :: communicator
     61   
     62    INTEGER,ALLOCATABLE :: distrib(:)
    6363    INTEGER :: ierr
    6464    INTEGER :: klon_glo
     
    7171#endif
    7272   
    73     if (iim.eq.1) then
     73    if ((nbp_lon.eq.1).and.(nbp_lat.eq.1)) then ! running 1D column model
    7474       klon_glo=1
    7575    else
    76        klon_glo=iim*(jjp1-2)+2
     76    ! The usual global physics grid: 1 point for each pole and nbp_lon points
     77    ! for all other latitudes
     78       klon_glo=nbp_lon*(nbp_lat-2)+2
    7779    endif
    7880   
    79     COMM_LMDZ_PHY=COMM_LMDZ
     81    COMM_LMDZ_PHY=communicator
    8082
    8183    IF (is_using_mpi) THEN   
    8284#ifdef CPP_MPI
     85      MPI_REAL_LMDZ=MPI_REAL8
    8386      CALL MPI_COMM_SIZE(COMM_LMDZ_PHY,mpi_size,ierr)   
    8487      CALL MPI_COMM_RANK(COMM_LMDZ_PHY,mpi_rank,ierr)
     
    8992    ENDIF
    9093   
     94    ALLOCATE(distrib(0:mpi_size-1))
     95
     96    IF (is_using_mpi) THEN   
     97#ifdef CPP_MPI
     98    CALL MPI_ALLGATHER(nbp,1,MPI_INTEGER,distrib,1,MPI_INTEGER,COMM_LMDZ_PHY,ierr)
     99#endif
     100    ELSE
     101     distrib(:)=nbp
     102    ENDIF
     103
     104
    91105    IF (mpi_rank == 0) THEN
    92       mpi_root = 0
     106      mpi_master = 0
    93107      is_mpi_root = .true.
    94108    ENDIF
     
    122136 
    123137     
    124     klon_mpi_para_nb(0:mpi_size-1)=distrib(0:nb_proc-1)
     138    klon_mpi_para_nb(0:mpi_size-1)=distrib(0:mpi_size-1)
    125139
    126140    DO i=0,mpi_size-1
     
    139153        ij_para_begin(i) = 1
    140154      ELSE
    141         ij_para_begin(i) = klon_mpi_para_begin(i)+iim-1
     155        ij_para_begin(i) = klon_mpi_para_begin(i)+nbp_lon-1
    142156      ENDIF
    143157
    144       jj_para_begin(i) = (ij_para_begin(i)-1)/iim + 1
    145       ii_para_begin(i) = MOD(ij_para_begin(i)-1,iim) + 1
     158      jj_para_begin(i) = (ij_para_begin(i)-1)/nbp_lon + 1
     159      ii_para_begin(i) = MOD(ij_para_begin(i)-1,nbp_lon) + 1
    146160
    147161     
    148       ij_para_end(i) = klon_mpi_para_end(i)+iim-1
    149       jj_para_end(i) = (ij_para_end(i)-1)/iim + 1
    150       ii_para_end(i) = MOD(ij_para_end(i)-1,iim) + 1
    151 
    152       ! Ehouarn: handle 1D case:
    153       if (klon_glo.eq.1) then
    154         klon_mpi_para_end(i) = 1
    155         klon_mpi_para_nb(i) = 1
    156         ij_para_end(i) = 1
    157         jj_para_end(i) = 1
    158         ii_para_end(i) = 1
    159       endif
     162      ij_para_end(i) = klon_mpi_para_end(i)+nbp_lon-1
     163      jj_para_end(i) = (ij_para_end(i)-1)/nbp_lon + 1
     164      ii_para_end(i) = MOD(ij_para_end(i)-1,nbp_lon) + 1
     165
    160166
    161167      ij_para_nb(i) = ij_para_end(i)-ij_para_begin(i)+1
     
    181187
    182188  SUBROUTINE print_module_data
     189!  USE print_control_mod, ONLY: lunout
    183190  IMPLICIT NONE
    184 !  INCLUDE "iniprint.h"
    185  
    186     WRITE(*,*) 'ii_begin =', ii_begin
    187     WRITE(*,*) 'ii_end =', ii_end
    188     WRITE(*,*) 'jj_begin =',jj_begin
    189     WRITE(*,*) 'jj_end =', jj_end
    190     WRITE(*,*) 'jj_nb =', jj_nb
    191     WRITE(*,*) 'ij_begin =', ij_begin
    192     WRITE(*,*) 'ij_end =', ij_end
    193     WRITE(*,*) 'ij_nb =', ij_nb
    194     WRITE(*,*) 'klon_mpi_begin =', klon_mpi_begin
    195     WRITE(*,*) 'klon_mpi_end =', klon_mpi_end
    196     WRITE(*,*) 'klon_mpi =', klon_mpi
    197     WRITE(*,*) 'jj_para_nb =', jj_para_nb
    198     WRITE(*,*) 'jj_para_begin =', jj_para_begin
    199     WRITE(*,*) 'jj_para_end =', jj_para_end
    200     WRITE(*,*) 'ii_para_begin =', ii_para_begin
    201     WRITE(*,*) 'ii_para_end =', ii_para_end
    202     WRITE(*,*) 'ij_para_nb =', ij_para_nb
    203     WRITE(*,*) 'ij_para_begin =', ij_para_begin
    204     WRITE(*,*) 'ij_para_end =', ij_para_end
    205     WRITE(*,*) 'klon_mpi_para_nb =', klon_mpi_para_nb
    206     WRITE(*,*) 'klon_mpi_para_begin =', klon_mpi_para_begin
    207     WRITE(*,*) 'klon_mpi_para_end  =', klon_mpi_para_end
    208     WRITE(*,*) 'mpi_rank =', mpi_rank
    209     WRITE(*,*) 'mpi_size =', mpi_size
    210     WRITE(*,*) 'mpi_root =', mpi_root
    211     WRITE(*,*) 'is_mpi_root =', is_mpi_root
    212     WRITE(*,*) 'is_north_pole =', is_north_pole
    213     WRITE(*,*) 'is_south_pole =', is_south_pole
    214     WRITE(*,*) 'COMM_LMDZ_PHY =', COMM_LMDZ_PHY
     191  INCLUDE "iniprint.h"
     192 
     193    WRITE(lunout,*) 'ii_begin =', ii_begin
     194    WRITE(lunout,*) 'ii_end =', ii_end
     195    WRITE(lunout,*) 'jj_begin =',jj_begin
     196    WRITE(lunout,*) 'jj_end =', jj_end
     197    WRITE(lunout,*) 'jj_nb =', jj_nb
     198    WRITE(lunout,*) 'ij_begin =', ij_begin
     199    WRITE(lunout,*) 'ij_end =', ij_end
     200    WRITE(lunout,*) 'ij_nb =', ij_nb
     201    WRITE(lunout,*) 'klon_mpi_begin =', klon_mpi_begin
     202    WRITE(lunout,*) 'klon_mpi_end =', klon_mpi_end
     203    WRITE(lunout,*) 'klon_mpi =', klon_mpi
     204    WRITE(lunout,*) 'jj_para_nb =', jj_para_nb
     205    WRITE(lunout,*) 'jj_para_begin =', jj_para_begin
     206    WRITE(lunout,*) 'jj_para_end =', jj_para_end
     207    WRITE(lunout,*) 'ii_para_begin =', ii_para_begin
     208    WRITE(lunout,*) 'ii_para_end =', ii_para_end
     209    WRITE(lunout,*) 'ij_para_nb =', ij_para_nb
     210    WRITE(lunout,*) 'ij_para_begin =', ij_para_begin
     211    WRITE(lunout,*) 'ij_para_end =', ij_para_end
     212    WRITE(lunout,*) 'klon_mpi_para_nb =', klon_mpi_para_nb
     213    WRITE(lunout,*) 'klon_mpi_para_begin =', klon_mpi_para_begin
     214    WRITE(lunout,*) 'klon_mpi_para_end  =', klon_mpi_para_end
     215    WRITE(lunout,*) 'mpi_rank =', mpi_rank
     216    WRITE(lunout,*) 'mpi_size =', mpi_size
     217    WRITE(lunout,*) 'mpi_master =', mpi_master
     218    WRITE(lunout,*) 'is_mpi_root =', is_mpi_root
     219    WRITE(lunout,*) 'is_north_pole =', is_north_pole
     220    WRITE(lunout,*) 'is_south_pole =', is_south_pole
     221    WRITE(lunout,*) 'COMM_LMDZ_PHY =', COMM_LMDZ_PHY
    215222 
    216223  END SUBROUTINE print_module_data
  • trunk/LMDZ.GENERIC/libf/phy_common/mod_phys_lmdz_mpi_transfert.F90

    r1521 r1543  
    99                     bcast_mpi_i,bcast_mpi_i1,bcast_mpi_i2,bcast_mpi_i3,bcast_mpi_i4, &
    1010                     bcast_mpi_r,bcast_mpi_r1,bcast_mpi_r2,bcast_mpi_r3,bcast_mpi_r4, &
    11                      bcast_mpi_l,bcast_mpi_l1,bcast_mpi_l2,bcast_mpi_l3,bcast_mpi_l4
     11                     bcast_mpi_l,bcast_mpi_l1,bcast_mpi_l2,bcast_mpi_l3,bcast_mpi_l4
    1212  END INTERFACE
    1313
     
    1515    MODULE PROCEDURE scatter_mpi_i,scatter_mpi_i1,scatter_mpi_i2,scatter_mpi_i3, &
    1616                     scatter_mpi_r,scatter_mpi_r1,scatter_mpi_r2,scatter_mpi_r3, &
    17                      scatter_mpi_l,scatter_mpi_l1,scatter_mpi_l2,scatter_mpi_l3
     17                     scatter_mpi_l,scatter_mpi_l1,scatter_mpi_l2,scatter_mpi_l3
    1818  END INTERFACE
    1919
     
    2222    MODULE PROCEDURE gather_mpi_i,gather_mpi_i1,gather_mpi_i2,gather_mpi_i3, &
    2323                     gather_mpi_r,gather_mpi_r1,gather_mpi_r2,gather_mpi_r3, &
    24                      gather_mpi_l,gather_mpi_l1,gather_mpi_l2,gather_mpi_l3 
     24                     gather_mpi_l,gather_mpi_l1,gather_mpi_l2,gather_mpi_l3 
    2525  END INTERFACE
    2626 
     
    2828    MODULE PROCEDURE scatter2D_mpi_i,scatter2D_mpi_i1,scatter2D_mpi_i2,scatter2D_mpi_i3, &
    2929                     scatter2D_mpi_r,scatter2D_mpi_r1,scatter2D_mpi_r2,scatter2D_mpi_r3, &
    30                      scatter2D_mpi_l,scatter2D_mpi_l1,scatter2D_mpi_l2,scatter2D_mpi_l3
     30                     scatter2D_mpi_l,scatter2D_mpi_l1,scatter2D_mpi_l2,scatter2D_mpi_l3
    3131  END INTERFACE
    3232
     
    3434    MODULE PROCEDURE gather2D_mpi_i,gather2D_mpi_i1,gather2D_mpi_i2,gather2D_mpi_i3, &
    3535                     gather2D_mpi_r,gather2D_mpi_r1,gather2D_mpi_r2,gather2D_mpi_r3, &
    36                      gather2D_mpi_l,gather2D_mpi_l1,gather2D_mpi_l2,gather2D_mpi_l3
     36                     gather2D_mpi_l,gather2D_mpi_l1,gather2D_mpi_l2,gather2D_mpi_l3
    3737  END INTERFACE
    3838 
     
    4545    MODULE PROCEDURE grid1dTo2d_mpi_i,grid1dTo2d_mpi_i1,grid1dTo2d_mpi_i2,grid1dTo2d_mpi_i3, &
    4646                     grid1dTo2d_mpi_r,grid1dTo2d_mpi_r1,grid1dTo2d_mpi_r2,grid1dTo2d_mpi_r3, &
    47                      grid1dTo2d_mpi_l,grid1dTo2d_mpi_l1,grid1dTo2d_mpi_l2,grid1dTo2d_mpi_l3
     47                     grid1dTo2d_mpi_l,grid1dTo2d_mpi_l1,grid1dTo2d_mpi_l2,grid1dTo2d_mpi_l3
    4848 END INTERFACE
    4949
     
    5151    MODULE PROCEDURE grid2dTo1d_mpi_i,grid2dTo1d_mpi_i1,grid2dTo1d_mpi_i2,grid2dTo1d_mpi_i3, &
    5252                     grid2dTo1d_mpi_r,grid2dTo1d_mpi_r1,grid2dTo1d_mpi_r2,grid2dTo1d_mpi_r3, &
    53                      grid2dTo1d_mpi_l,grid2dTo1d_mpi_l1,grid2dTo1d_mpi_l2,grid2dTo1d_mpi_l3
     53                     grid2dTo1d_mpi_l,grid2dTo1d_mpi_l1,grid2dTo1d_mpi_l2,grid2dTo1d_mpi_l3
    5454 END INTERFACE
    5555   
     
    514514
    515515  SUBROUTINE scatter2D_mpi_i(VarIn, VarOut)
    516     USE mod_grid_phy_lmdz, only: klon_glo, grid2dTo1d_glo
     516    USE mod_grid_phy_lmdz
    517517    IMPLICIT NONE
    518518 
     
    528528
    529529  SUBROUTINE scatter2D_mpi_i1(VarIn, VarOut)
    530     USE mod_grid_phy_lmdz, only: klon_glo, grid2dTo1d_glo
     530    USE mod_grid_phy_lmdz
    531531    IMPLICIT NONE
    532532 
     
    541541
    542542  SUBROUTINE scatter2D_mpi_i2(VarIn, VarOut)
    543     USE mod_grid_phy_lmdz, only: klon_glo, grid2dTo1d_glo
     543    USE mod_grid_phy_lmdz
    544544    IMPLICIT NONE
    545545 
     
    555555 
    556556  SUBROUTINE scatter2D_mpi_i3(VarIn, VarOut)
    557     USE mod_grid_phy_lmdz, only: klon_glo, grid2dTo1d_glo
     557    USE mod_grid_phy_lmdz
    558558    IMPLICIT NONE
    559559 
     
    570570
    571571  SUBROUTINE scatter2D_mpi_r(VarIn, VarOut)
    572     USE mod_grid_phy_lmdz, only: klon_glo, grid2dTo1d_glo
     572    USE mod_grid_phy_lmdz
    573573    IMPLICIT NONE
    574574 
     
    585585
    586586  SUBROUTINE scatter2D_mpi_r1(VarIn, VarOut)
    587     USE mod_grid_phy_lmdz, only: klon_glo, grid2dTo1d_glo
     587    USE mod_grid_phy_lmdz
    588588    IMPLICIT NONE
    589589    REAL,INTENT(IN),DIMENSION(:,:,:) :: VarIn
     
    599599
    600600  SUBROUTINE scatter2D_mpi_r2(VarIn, VarOut)
    601     USE mod_grid_phy_lmdz, only: klon_glo, grid2dTo1d_glo
     601    USE mod_grid_phy_lmdz
    602602    IMPLICIT NONE
    603603 
     
    613613 
    614614  SUBROUTINE scatter2D_mpi_r3(VarIn, VarOut)
    615     USE mod_grid_phy_lmdz, only: klon_glo, grid2dTo1d_glo
     615    USE mod_grid_phy_lmdz
    616616    IMPLICIT NONE
    617617 
     
    628628 
    629629  SUBROUTINE scatter2D_mpi_l(VarIn, VarOut)
    630     USE mod_grid_phy_lmdz, only: klon_glo, grid2dTo1d_glo
     630    USE mod_grid_phy_lmdz
    631631    IMPLICIT NONE
    632632 
     
    643643
    644644  SUBROUTINE scatter2D_mpi_l1(VarIn, VarOut)
    645     USE mod_grid_phy_lmdz, only: klon_glo, grid2dTo1d_glo
     645    USE mod_grid_phy_lmdz
    646646    IMPLICIT NONE
    647647 
     
    658658
    659659  SUBROUTINE scatter2D_mpi_l2(VarIn, VarOut)
    660     USE mod_grid_phy_lmdz, only: klon_glo, grid2dTo1d_glo
     660    USE mod_grid_phy_lmdz
    661661    IMPLICIT NONE
    662662 
     
    672672 
    673673  SUBROUTINE scatter2D_mpi_l3(VarIn, VarOut)
    674     USE mod_grid_phy_lmdz, only: klon_glo, grid2dTo1d_glo
     674    USE mod_grid_phy_lmdz
    675675    IMPLICIT NONE
    676676 
     
    691691
    692692  SUBROUTINE gather2D_mpi_i(VarIn, VarOut)
    693     USE mod_grid_phy_lmdz, only: klon_glo, grid1dTo2d_glo
     693    USE mod_grid_phy_lmdz
    694694    IMPLICIT NONE
    695695 
     
    705705
    706706  SUBROUTINE gather2D_mpi_i1(VarIn, VarOut)
    707     USE mod_grid_phy_lmdz, only: klon_glo, grid1dTo2d_glo
     707    USE mod_grid_phy_lmdz
    708708    IMPLICIT NONE
    709709 
     
    719719
    720720  SUBROUTINE gather2D_mpi_i2(VarIn, VarOut)
    721     USE mod_grid_phy_lmdz, only: klon_glo, grid1dTo2d_glo
     721    USE mod_grid_phy_lmdz
    722722    IMPLICIT NONE
    723723 
     
    733733 
    734734  SUBROUTINE gather2D_mpi_i3(VarIn, VarOut)
    735     USE mod_grid_phy_lmdz, only: klon_glo, grid1dTo2d_glo
     735    USE mod_grid_phy_lmdz
    736736    IMPLICIT NONE
    737737 
     
    749749
    750750  SUBROUTINE gather2D_mpi_r(VarIn, VarOut)
    751     USE mod_grid_phy_lmdz, only: klon_glo, grid1dTo2d_glo
     751    USE mod_grid_phy_lmdz
    752752    IMPLICIT NONE
    753753 
     
    763763
    764764  SUBROUTINE gather2D_mpi_r1(VarIn, VarOut)
    765     USE mod_grid_phy_lmdz, only: klon_glo, grid1dTo2d_glo
     765    USE mod_grid_phy_lmdz
    766766    IMPLICIT NONE
    767767 
     
    777777
    778778  SUBROUTINE gather2D_mpi_r2(VarIn, VarOut)
    779     USE mod_grid_phy_lmdz, only: klon_glo, grid1dTo2d_glo
     779    USE mod_grid_phy_lmdz
    780780    IMPLICIT NONE
    781781 
     
    791791 
    792792  SUBROUTINE gather2D_mpi_r3(VarIn, VarOut)
    793     USE mod_grid_phy_lmdz, only: klon_glo, grid1dTo2d_glo
     793    USE mod_grid_phy_lmdz
    794794    IMPLICIT NONE
    795795 
     
    807807 
    808808  SUBROUTINE gather2D_mpi_l(VarIn, VarOut)
    809     USE mod_grid_phy_lmdz, only: klon_glo, grid1dTo2d_glo
     809    USE mod_grid_phy_lmdz
    810810    IMPLICIT NONE
    811811 
     
    821821
    822822  SUBROUTINE gather2D_mpi_l1(VarIn, VarOut)
    823     USE mod_grid_phy_lmdz, only: klon_glo, grid1dTo2d_glo
     823    USE mod_grid_phy_lmdz
    824824    IMPLICIT NONE
    825825 
     
    835835
    836836  SUBROUTINE gather2D_mpi_l2(VarIn, VarOut)
    837     USE mod_grid_phy_lmdz, only: klon_glo, grid1dTo2d_glo
     837    USE mod_grid_phy_lmdz
    838838    IMPLICIT NONE
    839839 
     
    849849 
    850850  SUBROUTINE gather2D_mpi_l3(VarIn, VarOut)
    851     USE mod_grid_phy_lmdz, only: klon_glo, grid1dTo2d_glo
     851    USE mod_grid_phy_lmdz
    852852    IMPLICIT NONE
    853853 
     
    12361236
    12371237  SUBROUTINE bcast_mpi_cgen(var,nb)
    1238     USE mod_phys_lmdz_mpi_data , mpi_root_x=>mpi_root
     1238    USE mod_phys_lmdz_mpi_data
    12391239    IMPLICIT NONE
    12401240   
     
    12501250   
    12511251#ifdef CPP_MPI
    1252     CALL MPI_BCAST(Var,nb,MPI_CHARACTER,mpi_root_x,COMM_LMDZ_PHY,ierr)
     1252    CALL MPI_BCAST(Var,nb,MPI_CHARACTER,mpi_master,COMM_LMDZ_PHY,ierr)
    12531253#endif
    12541254       
     
    12581258     
    12591259  SUBROUTINE bcast_mpi_igen(var,nb)
    1260     USE mod_phys_lmdz_mpi_data , mpi_root_x=>mpi_root
    1261     IMPLICIT NONE
    1262    
     1260    USE mod_phys_lmdz_mpi_data
     1261    IMPLICIT NONE
     1262   
     1263    INTEGER,INTENT(IN) :: nb
    12631264    INTEGER,DIMENSION(nb),INTENT(INOUT) :: Var
    1264     INTEGER,INTENT(IN) :: nb
    12651265   
    12661266#ifdef CPP_MPI
     
    12721272
    12731273#ifdef CPP_MPI
    1274     CALL MPI_BCAST(Var,nb,MPI_INTEGER,mpi_root_x,COMM_LMDZ_PHY,ierr)
     1274    CALL MPI_BCAST(Var,nb,MPI_INTEGER,mpi_master,COMM_LMDZ_PHY,ierr)
    12751275#endif
    12761276       
     
    12811281 
    12821282  SUBROUTINE bcast_mpi_rgen(var,nb)
    1283     USE mod_phys_lmdz_mpi_data , mpi_root_x=>mpi_root
    1284     IMPLICIT NONE
    1285    
     1283    USE mod_phys_lmdz_mpi_data
     1284    IMPLICIT NONE
     1285   
     1286    INTEGER,INTENT(IN) :: nb
    12861287    REAL,DIMENSION(nb),INTENT(INOUT) :: Var
     1288   
     1289#ifdef CPP_MPI
     1290    INCLUDE 'mpif.h'
     1291#endif
     1292    INTEGER :: ierr
     1293
     1294    IF (.not.is_using_mpi) RETURN
     1295
     1296#ifdef CPP_MPI
     1297    CALL MPI_BCAST(Var,nb,MPI_REAL_LMDZ,mpi_master,COMM_LMDZ_PHY,ierr)
     1298#endif
     1299   
     1300  END SUBROUTINE bcast_mpi_rgen
     1301 
     1302
     1303
     1304
     1305  SUBROUTINE bcast_mpi_lgen(var,nb)
     1306    USE mod_phys_lmdz_mpi_data
     1307    IMPLICIT NONE
     1308   
    12871309    INTEGER,INTENT(IN) :: nb
     1310    LOGICAL,DIMENSION(nb),INTENT(INOUT) :: Var
    12881311   
    12891312#ifdef CPP_MPI
     
    12951318
    12961319#ifdef CPP_MPI
    1297     CALL MPI_BCAST(Var,nb,MPI_REAL_LMDZ,mpi_root_x,COMM_LMDZ_PHY,ierr)
    1298 #endif
    1299    
    1300   END SUBROUTINE bcast_mpi_rgen
    1301  
    1302 
    1303 
    1304 
    1305   SUBROUTINE bcast_mpi_lgen(var,nb)
    1306     USE mod_phys_lmdz_mpi_data ,  mpi_root_x=>mpi_root
    1307     IMPLICIT NONE
    1308    
    1309     LOGICAL,DIMENSION(nb),INTENT(INOUT) :: Var
    1310     INTEGER,INTENT(IN) :: nb
    1311    
    1312 #ifdef CPP_MPI
    1313     INCLUDE 'mpif.h'
    1314 #endif
    1315     INTEGER :: ierr
    1316 
    1317     IF (.not.is_using_mpi) RETURN
    1318 
    1319 #ifdef CPP_MPI
    1320     CALL MPI_BCAST(Var,nb,MPI_LOGICAL,mpi_root_x,COMM_LMDZ_PHY,ierr)
    1321     if (ierr.ne.MPI_SUCCESS) then
    1322       write(*,*) "bcast_mpi error: ierr=",ierr
    1323       stop
    1324     endif
     1320    CALL MPI_BCAST(Var,nb,MPI_LOGICAL,mpi_master,COMM_LMDZ_PHY,ierr)
    13251321#endif
    13261322
     
    13301326
    13311327  SUBROUTINE scatter_mpi_igen(VarIn, VarOut, dimsize)
    1332     USE mod_phys_lmdz_mpi_data , mpi_root_x=>mpi_root
     1328    USE mod_phys_lmdz_mpi_data
    13331329    USE mod_grid_phy_lmdz
    13341330    IMPLICIT NONE
     
    13691365#ifdef CPP_MPI
    13701366    CALL MPI_SCATTERV(VarTmp,counts,displs,MPI_INTEGER,VarOut,klon_mpi*dimsize,   &
    1371                       MPI_INTEGER,mpi_root_x, COMM_LMDZ_PHY,ierr)
     1367                      MPI_INTEGER,mpi_master, COMM_LMDZ_PHY,ierr)
    13721368#endif
    13731369
     
    13751371
    13761372  SUBROUTINE scatter_mpi_rgen(VarIn, VarOut, dimsize)
    1377     USE mod_phys_lmdz_mpi_data , mpi_root_x=>mpi_root
     1373    USE mod_phys_lmdz_mpi_data
    13781374    USE mod_grid_phy_lmdz
    13791375    IMPLICIT NONE
     
    14131409#ifdef CPP_MPI
    14141410    CALL MPI_SCATTERV(VarTmp,counts,displs,MPI_REAL_LMDZ,VarOut,klon_mpi*dimsize,   &
    1415                       MPI_REAL_LMDZ,mpi_root_x, COMM_LMDZ_PHY,ierr)
     1411                      MPI_REAL_LMDZ,mpi_master, COMM_LMDZ_PHY,ierr)
    14161412
    14171413#endif
     
    14211417 
    14221418  SUBROUTINE scatter_mpi_lgen(VarIn, VarOut, dimsize)
    1423     USE mod_phys_lmdz_mpi_data , mpi_root_x=>mpi_root
     1419    USE mod_phys_lmdz_mpi_data
    14241420    USE mod_grid_phy_lmdz
    14251421    IMPLICIT NONE
     
    14591455#ifdef CPP_MPI
    14601456    CALL MPI_SCATTERV(VarTmp,counts,displs,MPI_LOGICAL,VarOut,klon_mpi*dimsize,   &
    1461                       MPI_LOGICAL,mpi_root_x, COMM_LMDZ_PHY,ierr)
     1457                      MPI_LOGICAL,mpi_master, COMM_LMDZ_PHY,ierr)
    14621458#endif
    14631459
     
    14681464
    14691465  SUBROUTINE gather_mpi_igen(VarIn, VarOut, dimsize)
    1470     USE mod_phys_lmdz_mpi_data , mpi_root_x=>mpi_root
     1466    USE mod_phys_lmdz_mpi_data
    14711467    USE mod_grid_phy_lmdz
    14721468    IMPLICIT NONE
     
    14971493        displs(rank)=Index-1
    14981494        counts(rank)=nb*dimsize
    1499         Index=Index+nb*dimsize
     1495        Index=Index+nb*dimsize
    15001496      ENDDO
    15011497     
     
    15041500#ifdef CPP_MPI
    15051501    CALL MPI_GATHERV(VarIn,klon_mpi*dimsize,MPI_INTEGER,VarTmp,counts,displs,   &
    1506                      MPI_INTEGER,mpi_root_x, COMM_LMDZ_PHY,ierr)
    1507 #endif
    1508 
    1509                          
     1502                     MPI_INTEGER,mpi_master, COMM_LMDZ_PHY,ierr)
     1503#endif
     1504
     1505                         
    15101506    IF (is_mpi_root) THEN
    15111507      Index=1
     
    15141510        DO i=1,dimsize
    15151511          VarOut(klon_mpi_para_begin(rank):klon_mpi_para_end(rank),i)=VarTmp(Index:Index+nb-1)
    1516           Index=Index+nb
     1512          Index=Index+nb
    15171513        ENDDO
    15181514      ENDDO
     
    15221518
    15231519  SUBROUTINE gather_mpi_rgen(VarIn, VarOut, dimsize)
    1524     USE mod_phys_lmdz_mpi_data , mpi_root_x=>mpi_root
     1520    USE mod_phys_lmdz_mpi_data
    15251521    USE mod_grid_phy_lmdz
    15261522    IMPLICIT NONE
     
    15461542        displs(rank)=Index-1
    15471543        counts(rank)=nb*dimsize
    1548         Index=Index+nb*dimsize
     1544        Index=Index+nb*dimsize
    15491545      ENDDO
    15501546    ENDIF
     
    15571553#ifdef CPP_MPI
    15581554    CALL MPI_GATHERV(VarIn,klon_mpi*dimsize,MPI_REAL_LMDZ,VarTmp,counts,displs,   &
    1559                       MPI_REAL_LMDZ,mpi_root_x, COMM_LMDZ_PHY,ierr)
    1560 #endif
    1561                          
     1555                      MPI_REAL_LMDZ,mpi_master, COMM_LMDZ_PHY,ierr)
     1556#endif
     1557                         
    15621558    IF (is_mpi_root) THEN
    15631559      Index=1
     
    15661562        DO i=1,dimsize
    15671563          VarOut(klon_mpi_para_begin(rank):klon_mpi_para_end(rank),i)=VarTmp(Index:Index+nb-1)
    1568           Index=Index+nb
     1564          Index=Index+nb
    15691565        ENDDO
    15701566      ENDDO
     
    15741570
    15751571  SUBROUTINE gather_mpi_lgen(VarIn, VarOut, dimsize)
    1576     USE mod_phys_lmdz_mpi_data , mpi_root_x=>mpi_root
     1572    USE mod_phys_lmdz_mpi_data
    15771573    USE mod_grid_phy_lmdz
    15781574    IMPLICIT NONE
     
    16031599        displs(rank)=Index-1
    16041600        counts(rank)=nb*dimsize
    1605         Index=Index+nb*dimsize
     1601        Index=Index+nb*dimsize
    16061602      ENDDO
    16071603    ENDIF
     
    16101606#ifdef CPP_MPI
    16111607    CALL MPI_GATHERV(VarIn,klon_mpi*dimsize,MPI_LOGICAL,VarTmp,counts,displs,   &
    1612                       MPI_LOGICAL,mpi_root_x, COMM_LMDZ_PHY,ierr)
    1613 #endif
    1614                          
     1608                      MPI_LOGICAL,mpi_master, COMM_LMDZ_PHY,ierr)
     1609#endif
     1610                         
    16151611    IF (is_mpi_root) THEN
    16161612      Index=1
     
    16191615        DO i=1,dimsize
    16201616          VarOut(klon_mpi_para_begin(rank):klon_mpi_para_end(rank),i)=VarTmp(Index:Index+nb-1)
    1621           Index=Index+nb
     1617          Index=Index+nb
    16221618        ENDDO
    16231619      ENDDO
     
    16291625
    16301626  SUBROUTINE reduce_sum_mpi_igen(VarIn,VarOut,nb)
    1631     USE mod_phys_lmdz_mpi_data , mpi_root_x=>mpi_root
     1627    USE mod_phys_lmdz_mpi_data
    16321628    USE mod_grid_phy_lmdz
    16331629    IMPLICIT NONE
     
    16371633#endif
    16381634   
     1635    INTEGER,INTENT(IN) :: nb
    16391636    INTEGER,DIMENSION(nb),INTENT(IN) :: VarIn
    16401637    INTEGER,DIMENSION(nb),INTENT(OUT) :: VarOut   
    1641     INTEGER,INTENT(IN) :: nb
    16421638    INTEGER :: ierr
    16431639   
     
    16491645
    16501646#ifdef CPP_MPI
    1651     CALL MPI_REDUCE(VarIn,VarOut,nb,MPI_INTEGER,MPI_SUM,mpi_root_x,COMM_LMDZ_PHY,ierr)
     1647    CALL MPI_REDUCE(VarIn,VarOut,nb,MPI_INTEGER,MPI_SUM,mpi_master,COMM_LMDZ_PHY,ierr)
    16521648#endif
    16531649           
     
    16551651 
    16561652  SUBROUTINE reduce_sum_mpi_rgen(VarIn,VarOut,nb)
    1657     USE mod_phys_lmdz_mpi_data , mpi_root_x=>mpi_root
     1653    USE mod_phys_lmdz_mpi_data
    16581654    USE mod_grid_phy_lmdz
    16591655
     
    16641660#endif
    16651661   
     1662    INTEGER,INTENT(IN) :: nb
    16661663    REAL,DIMENSION(nb),INTENT(IN) :: VarIn
    16671664    REAL,DIMENSION(nb),INTENT(OUT) :: VarOut   
    1668     INTEGER,INTENT(IN) :: nb
    16691665    INTEGER :: ierr
    16701666 
     
    16751671   
    16761672#ifdef CPP_MPI
    1677     CALL MPI_REDUCE(VarIn,VarOut,nb,MPI_REAL_LMDZ,MPI_SUM,mpi_root_x,COMM_LMDZ_PHY,ierr)
     1673    CALL MPI_REDUCE(VarIn,VarOut,nb,MPI_REAL_LMDZ,MPI_SUM,mpi_master,COMM_LMDZ_PHY,ierr)
    16781674#endif
    16791675       
     
    17111707        DO ij=1,nbp_lon
    17121708         VarOut(ij,i)=VarIn(1,i)
    1713         ENDDO
     1709        ENDDO
    17141710      ENDDO
    17151711    ENDIF
     
    17191715        DO ij=nbp_lon*(jj_nb-1)+1,nbp_lon*jj_nb
    17201716         VarOut(ij,i)=VarIn(klon_mpi,i)
    1721         ENDDO
     1717        ENDDO
    17221718      ENDDO
    17231719    ENDIF
     
    17551751        DO ij=1,nbp_lon
    17561752         VarOut(ij,i)=VarIn(1,i)
    1757         ENDDO
     1753        ENDDO
    17581754      ENDDO
    17591755    ENDIF
     
    17631759        DO ij=nbp_lon*(jj_nb-1)+1,nbp_lon*jj_nb
    17641760         VarOut(ij,i)=VarIn(klon_mpi,i)
    1765         ENDDO
     1761        ENDDO
    17661762      ENDDO
    17671763    ENDIF
     
    18001796        DO ij=1,nbp_lon
    18011797         VarOut(ij,i)=VarIn(1,i)
    1802         ENDDO
     1798        ENDDO
    18031799      ENDDO
    18041800    ENDIF
     
    18081804        DO ij=nbp_lon*(jj_nb-1)+1,nbp_lon*jj_nb
    18091805         VarOut(ij,i)=VarIn(klon_mpi,i)
    1810         ENDDO
     1806        ENDDO
    18111807      ENDDO
    18121808    ENDIF
     
    19051901
    19061902END MODULE mod_phys_lmdz_mpi_transfert
     1903
  • trunk/LMDZ.GENERIC/libf/phy_common/mod_phys_lmdz_omp_data.F90

    r1521 r1543  
    11!
    2 !$Id: mod_phys_lmdz_omp_data.F90 1575 2011-09-21 13:57:48Z jghattas $
     2!$Id: mod_phys_lmdz_omp_data.F90 2326 2015-07-10 12:24:29Z emillour $
    33!
    44MODULE mod_phys_lmdz_omp_data
     
    9191  SUBROUTINE Print_module_data
    9292  IMPLICIT NONE
    93 !  INCLUDE "iniprint.h"
     93  INCLUDE "iniprint.h"
    9494
    9595!$OMP CRITICAL 
    96   WRITE(*,*)'--------> TASK ',omp_rank
    97   WRITE(*,*)'omp_size =',omp_size
    98   WRITE(*,*)'omp_rank =',omp_rank
    99   WRITE(*,*)'is_omp_root =',is_omp_root
    100   WRITE(*,*)'klon_omp_para_nb =',klon_omp_para_nb
    101   WRITE(*,*)'klon_omp_para_begin =',klon_omp_para_begin
    102   WRITE(*,*)'klon_omp_para_end =',klon_omp_para_end   
    103   WRITE(*,*)'klon_omp =',klon_omp
    104   WRITE(*,*)'klon_omp_begin =',klon_omp_begin
    105   WRITE(*,*)'klon_omp_end =',klon_omp_end   
     96  WRITE(lunout,*)'--------> TASK ',omp_rank
     97  WRITE(lunout,*)'omp_size =',omp_size
     98  WRITE(lunout,*)'omp_rank =',omp_rank
     99  WRITE(lunout,*)'is_omp_root =',is_omp_root
     100  WRITE(lunout,*)'klon_omp_para_nb =',klon_omp_para_nb
     101  WRITE(lunout,*)'klon_omp_para_begin =',klon_omp_para_begin
     102  WRITE(lunout,*)'klon_omp_para_end =',klon_omp_para_end   
     103  WRITE(lunout,*)'klon_omp =',klon_omp
     104  WRITE(lunout,*)'klon_omp_begin =',klon_omp_begin
     105  WRITE(lunout,*)'klon_omp_end =',klon_omp_end   
    106106!$OMP END CRITICAL
    107107
  • trunk/LMDZ.GENERIC/libf/phy_common/mod_phys_lmdz_omp_transfert.F90

    r1521 r1543  
    2525                     bcast_omp_i,bcast_omp_i1,bcast_omp_i2,bcast_omp_i3,bcast_omp_i4, &
    2626                     bcast_omp_r,bcast_omp_r1,bcast_omp_r2,bcast_omp_r3,bcast_omp_r4, &
    27                      bcast_omp_l,bcast_omp_l1,bcast_omp_l2,bcast_omp_l3,bcast_omp_l4
     27                     bcast_omp_l,bcast_omp_l1,bcast_omp_l2,bcast_omp_l3,bcast_omp_l4
    2828  END INTERFACE
    2929
     
    3131    MODULE PROCEDURE scatter_omp_i,scatter_omp_i1,scatter_omp_i2,scatter_omp_i3, &
    3232                     scatter_omp_r,scatter_omp_r1,scatter_omp_r2,scatter_omp_r3, &
    33                      scatter_omp_l,scatter_omp_l1,scatter_omp_l2,scatter_omp_l3
     33                     scatter_omp_l,scatter_omp_l1,scatter_omp_l2,scatter_omp_l3
    3434  END INTERFACE
    3535
     
    3838    MODULE PROCEDURE gather_omp_i,gather_omp_i1,gather_omp_i2,gather_omp_i3, &
    3939                     gather_omp_r,gather_omp_r1,gather_omp_r2,gather_omp_r3, &
    40                      gather_omp_l,gather_omp_l1,gather_omp_l2,gather_omp_l3 
     40                     gather_omp_l,gather_omp_l1,gather_omp_l2,gather_omp_l3 
    4141  END INTERFACE
    4242 
     
    4848
    4949
    50   PUBLIC bcast_omp,scatter_omp,gather_omp,reduce_sum_omp
     50  PUBLIC bcast_omp,scatter_omp,gather_omp,reduce_sum_omp, omp_barrier
    5151
    5252CONTAINS
    5353
     54  SUBROUTINE omp_barrier
     55  IMPLICIT NONE
     56
     57!$OMP BARRIER
     58
     59  END SUBROUTINE omp_barrier
     60 
    5461  SUBROUTINE check_buffer_i(buff_size)
    5562  IMPLICIT NONE
     
    733740  IMPLICIT NONE
    734741   
     742    INTEGER,INTENT(IN) :: Nb
    735743    INTEGER,DIMENSION(Nb),INTENT(INOUT) :: Var
    736744    INTEGER,DIMENSION(Nb),INTENT(INOUT) :: Buff
    737     INTEGER,INTENT(IN) :: Nb
    738745
    739746    INTEGER :: i
     
    757764  IMPLICIT NONE
    758765   
     766    INTEGER,INTENT(IN) :: Nb
    759767    REAL,DIMENSION(Nb),INTENT(INOUT) :: Var
    760768    REAL,DIMENSION(Nb),INTENT(INOUT) :: Buff
    761     INTEGER,INTENT(IN) :: Nb
    762769
    763770    INTEGER :: i
     
    780787  IMPLICIT NONE
    781788   
     789    INTEGER,INTENT(IN) :: Nb
    782790    LOGICAL,DIMENSION(Nb),INTENT(INOUT) :: Var
    783791    LOGICAL,DIMENSION(Nb),INTENT(INOUT) :: Buff
    784     INTEGER,INTENT(IN) :: Nb
    785792 
    786793    INTEGER :: i
     
    802809
    803810  SUBROUTINE scatter_omp_igen(VarIn,VarOut,dimsize,Buff)
    804     USE mod_phys_lmdz_omp_data, only: klon_omp, klon_omp_begin
     811    USE mod_phys_lmdz_omp_data
    805812    USE mod_phys_lmdz_mpi_data, ONLY : klon_mpi
    806813    IMPLICIT NONE
     
    833840
    834841  SUBROUTINE scatter_omp_rgen(VarIn,VarOut,dimsize,Buff)
    835   USE mod_phys_lmdz_omp_data, only: klon_omp, klon_omp_begin
     842  USE mod_phys_lmdz_omp_data
    836843  USE mod_phys_lmdz_mpi_data, ONLY : klon_mpi
    837844  IMPLICIT NONE
     
    864871
    865872  SUBROUTINE scatter_omp_lgen(VarIn,VarOut,dimsize,Buff)
    866   USE mod_phys_lmdz_omp_data, only: klon_omp, klon_omp_begin
     873  USE mod_phys_lmdz_omp_data
    867874  USE mod_phys_lmdz_mpi_data, ONLY : klon_mpi
    868875  IMPLICIT NONE
     
    898905
    899906  SUBROUTINE gather_omp_igen(VarIn,VarOut,dimsize,Buff)
    900   USE mod_phys_lmdz_omp_data, only: klon_omp, klon_omp_begin
     907  USE mod_phys_lmdz_omp_data
    901908  USE mod_phys_lmdz_mpi_data, ONLY : klon_mpi
    902909  IMPLICIT NONE
     
    930937
    931938  SUBROUTINE gather_omp_rgen(VarIn,VarOut,dimsize,Buff)
    932   USE mod_phys_lmdz_omp_data, only: klon_omp, klon_omp_begin
     939  USE mod_phys_lmdz_omp_data
    933940  USE mod_phys_lmdz_mpi_data, ONLY : klon_mpi
    934941  IMPLICIT NONE
     
    962969
    963970  SUBROUTINE gather_omp_lgen(VarIn,VarOut,dimsize,Buff)
    964   USE mod_phys_lmdz_omp_data, only: klon_omp, klon_omp_begin
     971  USE mod_phys_lmdz_omp_data
    965972  USE mod_phys_lmdz_mpi_data, ONLY : klon_mpi
    966973  IMPLICIT NONE
  • trunk/LMDZ.GENERIC/libf/phy_common/mod_phys_lmdz_para.F90

    r1521 r1543  
    1313 
    1414!$OMP THREADPRIVATE(klon_loc,is_master)
    15 !$OMP THREADPRIVATE(is_sequential,is_parallel)
    1615 
    1716CONTAINS
    1817
    19   SUBROUTINE Init_phys_lmdz_para(iim,jjp1,nb_proc,distrib)
     18  SUBROUTINE Init_phys_lmdz_para(nbp,nbp_lon,nbp_lat,communicator)
    2019  IMPLICIT NONE
    21     INTEGER,INTENT(in) :: iim
    22     INTEGER,INTENT(in) :: jjp1
    23     INTEGER,INTENT(in) :: nb_proc
    24     INTEGER,INTENT(in) :: distrib(0:nb_proc-1)
     20    INTEGER,INTENT(in) :: nbp
     21    INTEGER,INTENT(in) :: nbp_lon
     22    INTEGER,INTENT(in) :: nbp_lat
     23    INTEGER,INTENT(in) :: communicator
    2524
    26     CALL Init_phys_lmdz_mpi_data(iim,jjp1,nb_proc,distrib)
     25    CALL Init_phys_lmdz_mpi_data(nbp,nbp_lon,nbp_lat,communicator)
    2726!$OMP PARALLEL
    2827    CALL Init_phys_lmdz_omp_data(klon_mpi)
     
    4645
    4746  SUBROUTINE Test_transfert
    48   USE mod_grid_phy_lmdz, only: klon_glo, nbp_lev, nbp_lon, nbp_lat, &
    49                                grid1dTo2d_glo, grid2dTo1d_glo
     47  USE mod_grid_phy_lmdz
    5048  IMPLICIT NONE
    51 !    INCLUDE "iniprint.h"
     49    INCLUDE "iniprint.h"
    5250 
    5351    REAL :: Test_Field1d_glo(klon_glo,nbp_lev)
     
    8381!$OMP MASTER 
    8482      Checksum=sum(Test_Field1d_glo-tmp1d_glo)
    85       WRITE(*,*) "------> Checksum =",Checksum," MUST BE 0"
     83      WRITE(lunout,*) "------> Checksum =",Checksum," MUST BE 0"
    8684!$OMP END MASTER
    8785    ENDIF
     
    9593!$OMP MASTER 
    9694      Checksum=sum(Test_Field1d_glo-tmp1d_glo)
    97       WRITE(*,*) "------> Checksum =",Checksum," MUST BE 0"
     95      WRITE(lunout,*) "------> Checksum =",Checksum," MUST BE 0"
    9896!$OMP END MASTER
    9997    ENDIF
     
    105103!$OMP MASTER 
    106104      Checksum=sum(Test_Field1d_glo*omp_size*mpi_size-tmp1d_glo)
    107       WRITE(*,*) "------> Checksum =",Checksum," MUST BE 0"
     105      WRITE(lunout,*) "------> Checksum =",Checksum," MUST BE 0"
    108106!$OMP END MASTER
    109107    ENDIF
  • trunk/LMDZ.GENERIC/libf/phystd/condense_co2.F90

    r1542 r1543  
    1111      use aerosol_mod, only : iaero_co2
    1212      USE surfdat_h, only: emisice, emissiv
    13       USE comgeomphy, only: latitude ! in radians
     13      USE geometry_mod, only: latitude ! in radians
    1414      USE tracer_h, only: noms, rho_co2
    1515      use comcstfi_mod, only: g, r, cpp
  • trunk/LMDZ.GENERIC/libf/phystd/dyn1d/rcm1d.F

    r1542 r1543  
    33! to use  'getin'
    44      use ioipsl_getincom, only: getin
     5      use dimphy, only : init_dimphy
     6      use mod_grid_phy_lmdz, only : regular_lonlat
    57      use infotrac, only: nqtot, tname
    68      use surfdat_h, only: albedodat, phisfi, dryness, watercaptag,
     
    911     &                     dtemisice
    1012      use comdiurn_h, only: sinlat, coslat, sinlon, coslon
    11 !      use comsaison_h
    1213      use comsoil_h, only: nsoilmx, layer, mlayer, inertiedat, volcapa
    1314      use phyredem, only: physdem0,physdem1
    14       use comgeomphy, only: initcomgeomphy, cell_area
     15      use geometry_mod, only: init_geometry
    1516      use slab_ice_h, only: noceanmx
    1617      use planete_mod, only: apoastr,periastr,year_day,peri_day,
     
    2728      use regular_lonlat_mod, only: init_regular_lonlat
    2829      use planete_mod, only: ini_planete_mod
     30      use physics_distribution_mod, only: init_physics_distribution
     31      use regular_lonlat_mod, only: init_regular_lonlat
     32      use mod_interface_dyn_phys, only: init_interface_dyn_phys
    2933      use inifis_mod, only: inifis
    3034      implicit none
     
    133137      character*20,allocatable :: nametrac(:)   ! name of the tracer (no need for adv trac common)
    134138
    135       real :: latitude(1), longitude(1)
     139      real :: latitude(1), longitude(1), cell_area(1)
    136140
    137141c=======================================================================
     
    140144! initialize "serial/parallel" related stuff
    141145!      CALL init_phys_lmdz(iim,jjm+1,llm,1,(/(jjm-1)*iim+2/))
    142       CALL init_phys_lmdz(1,1,llm,1,(/1/))
    143       call initcomgeomphy
     146!      CALL init_phys_lmdz(1,1,llm,1,(/1/))
     147!      call initcomgeomphy
    144148
    145149      !! those are defined in surfdat_h.F90
     
    490494
    491495      ! initializations, as with iniphysiq.F90 for the 3D GCM
     496      call init_physics_distribution(regular_lonlat,4,
     497     &                               1,1,1,nlayer,1)
     498      call init_interface_dyn_phys
    492499      CALL init_regular_lonlat(1,1,longitude,latitude,
    493500     &                   (/0.,0./),(/0.,0./))
    494      
     501      call init_geometry(1,longitude,latitude,
     502     &                   (/0.,0.,0.,0./),(/0.,0.,0.,0./),
     503     &                   cell_area)
     504      call init_dimphy(1,nlayer) ! Initialize dimphy module
    495505      call ini_planete_mod(nlayer,preff,ap,bp)
    496506
  • trunk/LMDZ.GENERIC/libf/phystd/hydrol.F90

    r1542 r1543  
    1010  USE surfdat_h
    1111  use comdiurn_h
    12   USE comgeomphy, only: cell_area
     12  USE geometry_mod, only: cell_area
    1313  USE tracer_h
    1414  use slab_ice_h
  • trunk/LMDZ.GENERIC/libf/phystd/phyredem.F90

    r1542 r1543  
    1010! create physics restart file and write time-independent variables
    1111  use comsoil_h, only: volcapa, mlayer
    12   use comgeomphy, only: cell_area
     12  use geometry_mod, only: cell_area
    1313  use surfdat_h, only: zmea, zstd, zsig, zgam, zthe, &
    1414                       emisice, emissiv,             &
  • trunk/LMDZ.GENERIC/libf/phystd/physiq.F90

    r1542 r1543  
    1919      use comsaison_h, only: mu0, fract, dist_star, declin, right_ascen
    2020      use comsoil_h, only: nsoilmx, layer, mlayer, inertiedat
    21       use comgeomphy, only: latitude, longitude, cell_area
     21      use geometry_mod, only: latitude, longitude, cell_area
    2222      USE comgeomfi_h, only: totarea, totarea_planet
    2323      USE tracer_h, only: noms, mmol, radius, rho_q, qext, &
  • trunk/LMDZ.GENERIC/libf/phystd/rings.F90

    r1542 r1543  
    55
    66    use comdiurn_h, only: sinlat, sinlon, coslat, coslon
    7     use comgeomphy, only: latitude ! (rad)
     7    use geometry_mod, only: latitude ! (rad)
    88 
    99    implicit none   
  • trunk/LMDZ.GENERIC/libf/phystd/soil.F

    r1542 r1543  
    88      use time_phylmdz_mod, only: daysec
    99      use planete_mod, only: year_day
    10       use comgeomphy, only: longitude, latitude ! in radians
     10      use geometry_mod, only: longitude, latitude ! in radians
    1111
    1212      implicit none
  • trunk/LMDZ.GENERIC/libf/phystd/surface_nature.F

    r1542 r1543  
    44      USE surfdat_h
    55      USE comsoil_h
    6       USE comgeomphy, ONLY: cell_area
     6      USE geometry_mod, ONLY: cell_area
    77      USE tracer_h
    88
  • trunk/LMDZ.GENERIC/libf/phystd/writediagfi.F

    r1542 r1543  
    4040!=================================================================
    4141      use surfdat_h, only: phisfi
    42       use comgeomphy, only: cell_area
     42      use geometry_mod, only: cell_area
    4343      use time_phylmdz_mod, only: ecritphy, day_step, iphysiq, day_ini
    4444      USE mod_phys_lmdz_para, only : is_parallel, is_mpi_root,
  • trunk/LMDZ.GENERIC/libf/phystd/writediagsoil.F90

    r1542 r1543  
    1313
    1414use comsoil_h, only: nsoilmx, inertiedat
    15 use comgeomphy, only: cell_area
     15use geometry_mod, only: cell_area
    1616use time_phylmdz_mod, only: ecritphy, day_step, iphysiq
    1717use mod_phys_lmdz_para, only : is_mpi_root, is_master, gather
  • trunk/LMDZ.GENERIC/libf/phystd/writediagspecIR.F

    r1542 r1543  
    4343! Addition by RW (2010) to allow OLR to be saved in .nc format
    4444      use radinc_h, only : L_NSPECTI
    45       use comgeomphy, only: cell_area
     45      use geometry_mod, only: cell_area
    4646      use mod_phys_lmdz_para, only : is_mpi_root, is_master, gather
    4747      use mod_grid_phy_lmdz, only : klon_glo, Grid1Dto2D_glo,
  • trunk/LMDZ.GENERIC/libf/phystd/writediagspecVI.F

    r1542 r1543  
    4343! Addition by RW (2010) to allow OSR to be saved in .nc format
    4444      use radinc_h, only : L_NSPECTV
    45       use comgeomphy, only: cell_area
     45      use geometry_mod, only: cell_area
    4646      use mod_phys_lmdz_para, only : is_mpi_root, is_master, gather
    4747      use mod_grid_phy_lmdz, only : klon_glo, Grid1Dto2D_glo,
Note: See TracChangeset for help on using the changeset viewer.