Ignore:
Timestamp:
May 6, 2015, 12:14:12 PM (10 years ago)
Author:
ymipsl
Message:

Reorganize geometry and grid modules. Prepare physics for unstructutured grid support. Simplify initialization of physics from dynamic.
Compiled only with dynd3dmem, but not tested for moment.

YM

Location:
dynamico_lmdz/aquaplanet/LMDZ5/libf
Files:
4 added
2 deleted
34 edited

Legend:

Unmodified
Added
Removed
  • dynamico_lmdz/aquaplanet/LMDZ5/libf/dyn3dmem/gcm.F

    r3822 r3825  
    1313      USE parallel_lmdz
    1414      USE infotrac
    15 #ifdef CPP_PHYS
    16       USE mod_interface_dyn_phys, ONLY: init_interface_dyn_phys
    17 #endif
    1815      USE mod_hallo
    1916      USE Bands
     
    2825#endif
    2926
    30 #ifdef CPP_PHYS
    31 !      USE mod_grid_phy_lmdz
    32 !      USE mod_phys_lmdz_para, ONLY : klon_mpi_para_nb
    33 !      USE dimphy
    34 !      USE comgeomphy
    35 #endif
    3627      IMPLICIT NONE
    3728
     
    160151      call Read_Distrib
    161152
    162 #ifdef CPP_PHYS
    163         CALL Init_Phys_lmdz(iim,jjp1,llm,mpi_size,distrib_phys,
    164      &                      COMM_LMDZ)
     153!#ifdef CPP_PHYS
     154!        CALL Init_Phys_lmdz(iim,jjp1,llm,mpi_size,distrib_phys,
     155!     &                      COMM_LMDZ)
    165156!#endif
    166157!      CALL set_bands
    167158!#ifdef CPP_PHYS
    168       CALL Init_interface_dyn_phys
    169 #endif
     159!      CALL Init_interface_dyn_phys
     160!#endif
    170161      CALL barrier
    171162
     
    429420! Physics:
    430421#ifdef CPP_PHYS
    431          CALL iniphysiq(iim,jjm,llm,daysec,day_ini,dtphys/nsplit_phys,
     422         CALL iniphysiq(iim,jjm, distrib_phys(mpi_rank), comm_lmdz, llm, daysec, day_ini, dtphys/nsplit_phys,
    432423     &                rlatu,rlatv,rlonu,rlonv,aire,cu,cv,rad,g,r,cpp,
    433424     &                iflag_phys)
  • dynamico_lmdz/aquaplanet/LMDZ5/libf/dynlonlat_phylonlat/phylmd/iniphysiq.F90

    r3822 r3825  
    33
    44
    5 SUBROUTINE iniphysiq(ii,jj,nlayer,punjours, pdayref,ptimestep,         &
     5SUBROUTINE iniphysiq(ii, jj, nbp, communicator, nlayer,punjours, pdayref,ptimestep,         &
    66                     rlatu,rlatv,rlonu,rlonv,aire,cu,cv,               &
    77                     prad,pg,pr,pcpp,iflag_phys)
     8 
    89  USE dimphy, ONLY: klev ! number of atmospheric levels
    9   USE mod_grid_phy_lmdz, ONLY: klon_glo ! number of atmospheric columns
    10                                         ! (on full grid)
     10  USE mod_grid_phy_lmdz, ONLY: klon_glo,  & ! number of atmospheric columns (on full grid)
     11                               regular_lonlat  ! regular longitude-latitude grid type
    1112  USE mod_phys_lmdz_para, ONLY: klon_omp, & ! number of columns (on local omp grid)
    1213                                klon_omp_begin, & ! start index of local omp subgrid
    1314                                klon_omp_end, & ! end index of local omp subgrid
    1415                                klon_mpi_begin ! start indes of columns (on local mpi grid)
    15   USE comgeomphy, ONLY: initcomgeomphy, &
    16                         initcomgeomphy_vert, &
    17                         initcomgeomphy_horiz,&
    18                         airephy, & ! physics grid area (m2)
    19                         cuphy, & ! cu coeff. (u_covariant = cu * u)
    20                         cvphy, & ! cv coeff. (v_covariant = cv * v)
    21                         rlond, & ! longitudes
    22                         rlatd ! latitudes
     16  USE geometry_mod, ONLY : init_geometry
     17  USE vertical_layers_mod, ONLY : init_vertical_layers
    2318  USE misc_mod, ONLY: debug
    2419  USE infotrac, ONLY: nqtot,nqo,nbtr,tname,ttext,type_trac,&
     
    2924  USE infotrac_phy, ONLY: init_infotrac_phy
    3025  USE phyaqua_mod, ONLY: iniaqua
     26  USE physics_distribution_mod, ONLY : init_physics_distribution
     27  USE regular_lonlat_mod, ONLY : init_regular_lonlat, east, west, north, south, north_east, north_west, south_west, south_east
     28  USE mod_interface_dyn_phys, ONLY :  init_interface_dyn_phys
    3129  IMPLICIT NONE
    3230
     
    5149  INTEGER, INTENT (IN) :: ii ! number of atmospheric columns along longitudes
    5250  INTEGER, INTENT (IN) :: jj ! number of atompsheric columns along latitudes
     51  INTEGER, INTENT (IN) :: nbp ! number of physics points (local)
     52  INTEGER, INTENT (IN) :: communicator ! mpi communicator
    5353  REAL, INTENT (IN) :: rlatu(jj+1) ! latitudes of the physics grid
    5454  REAL, INTENT (IN) :: rlatv(jj) ! latitude boundaries of the physics grid
     
    6363
    6464  INTEGER :: ibegin, iend, offset
    65   INTEGER :: i,j
     65  INTEGER :: i,j,k
    6666  CHARACTER (LEN=20) :: modname = 'iniphysiq'
    6767  CHARACTER (LEN=80) :: abort_message
    6868  REAL :: total_area_phy, total_area_dyn
    6969
     70  REAL,ALLOCATABLE :: boundslon_reg(:,:)
     71  REAL,ALLOCATABLE :: boundslat_reg(:,:)
    7072
    7173  ! global array, on full physics grid:
     74  REAL,ALLOCATABLE :: latfi_glo(:)
     75  REAL,ALLOCATABLE :: lonfi_glo(:)
     76  REAL,ALLOCATABLE :: cufi_glo(:)
     77  REAL,ALLOCATABLE :: cvfi_glo(:)
     78  REAL,ALLOCATABLE :: airefi_glo(:)
     79  REAL,ALLOCATABLE :: boundslonfi_glo(:,:)
     80  REAL,ALLOCATABLE :: boundslatfi_glo(:,:)
    7281  REAL,ALLOCATABLE :: latfi(:)
    7382  REAL,ALLOCATABLE :: lonfi(:)
     
    7584  REAL,ALLOCATABLE :: cvfi(:)
    7685  REAL,ALLOCATABLE :: airefi(:)
    77 
    78   IF (nlayer/=klev) THEN
    79     WRITE (lunout, *) 'STOP in ', trim(modname)
    80     WRITE (lunout, *) 'Problem with dimensions :'
    81     WRITE (lunout, *) 'nlayer     = ', nlayer
    82     WRITE (lunout, *) 'klev   = ', klev
    83     abort_message = ''
    84     CALL abort_gcm(modname, abort_message, 1)
    85   END IF
    86 
    87   !call init_phys_lmdz(ii,jj+1,llm,1,(/(jj-1)*ii+2/))
     86  REAL,ALLOCATABLE :: boundslonfi(:,:)
     87  REAL,ALLOCATABLE :: boundslatfi(:,:)
     88
     89  CALL init_physics_distribution(regular_lonlat, 4, nbp, ii, jj+1, nlayer, communicator)
     90  CALL init_interface_dyn_phys
     91
     92
     93!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
     94! init regular longitude-latitude grid
     95
     96  ALLOCATE(boundslon_reg(ii,2))
     97  ALLOCATE(boundslat_reg(jj+1,2))
     98 
     99  DO i=1,ii
     100   boundslon_reg(i,east)=rlonu(i)
     101   boundslon_reg(i,west)=rlonu(i+1)
     102  ENDDO
     103
     104  boundslat_reg(1,north)= PI/2
     105  boundslat_reg(1,south)= rlatv(1)
     106  DO j=2,jj
     107   boundslat_reg(i,north)=rlatv(j-1)
     108   boundslat_reg(i,south)=rlatv(j)
     109  ENDDO
     110  boundslat_reg(jj+1,north)= rlatv(jj)
     111  boundslat_reg(jj+1,south)= -PI/2
     112 
     113  CALL init_regular_lonlat(ii,jj+1, rlonv(1:ii), rlatu, boundslon_reg, boundslat_reg)
     114 
     115!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    88116 
    89117  ! Generate global arrays on full physics grid
     118  ALLOCATE(latfi_glo(klon_glo),lonfi_glo(klon_glo),cufi_glo(klon_glo),cvfi_glo(klon_glo))
     119  ALLOCATE(airefi_glo(klon_glo))
     120  ALLOCATE(boundslonfi_glo(klon_glo,4))
     121  ALLOCATE(boundslatfi_glo(klon_glo,4))
     122 
    90123  ALLOCATE(latfi(klon_glo),lonfi(klon_glo),cufi(klon_glo),cvfi(klon_glo))
    91124  ALLOCATE(airefi(klon_glo))
     125  ALLOCATE(boundslonfi(klon_glo,4))
     126  ALLOCATE(boundslatfi(klon_glo,4))
    92127
    93128  IF (klon_glo>1) THEN ! general case
    94129    ! North pole
    95     latfi(1)=rlatu(1)
    96     lonfi(1)=0.
    97     cufi(1) = cu(1)
    98     cvfi(1) = cv(1)
     130    latfi_glo(1)=rlatu(1)
     131    lonfi_glo(1)=0.
     132    cufi_glo(1) = cu(1)
     133    cvfi_glo(1) = cv(1)
     134    boundslonfi_glo(1,north_east)=0
     135    boundslatfi_glo(1,north_east)=PI/2
     136    boundslonfi_glo(1,north_west)=2*PI
     137    boundslatfi_glo(1,north_west)=PI/2
     138    boundslonfi_glo(1,south_west)=2*PI
     139    boundslatfi_glo(1,south_west)=rlatv(1)
     140    boundslonfi_glo(1,south_east)=0
     141    boundslatfi_glo(1,south_east)=rlatv(1)
    99142    DO j=2,jj
    100143      DO i=1,ii
    101         latfi((j-2)*ii+1+i)= rlatu(j)
    102         lonfi((j-2)*ii+1+i)= rlonv(i)
    103         cufi((j-2)*ii+1+i) = cu((j-1)*ii+1+i)
    104         cvfi((j-2)*ii+1+i) = cv((j-1)*ii+1+i)
     144        k=(j-2)*ii+1+i
     145        latfi_glo(k)= rlatu(j)
     146        lonfi_glo(k)= rlonv(i)
     147        cufi_glo(k) = cu((j-1)*ii+1+i)
     148        cvfi_glo(k) = cv((j-1)*ii+1+i)
     149        boundslonfi_glo(k,north_east)=rlonu(i)
     150        boundslatfi_glo(k,north_east)=rlatv(j-1)
     151        boundslonfi_glo(k,north_west)=rlonu(i+1)
     152        boundslatfi_glo(k,north_west)=rlatv(j-1)
     153        boundslonfi_glo(k,south_west)=rlonu(i+1)
     154        boundslatfi_glo(k,south_west)=rlatv(j)
     155        boundslonfi_glo(k,south_east)=rlonu(i)
     156        boundslatfi_glo(k,south_east)=rlatv(j)
    105157      ENDDO
    106158    ENDDO
    107159    ! South pole
    108     latfi(klon_glo)= rlatu(jj+1)
    109     lonfi(klon_glo)= 0.
    110     cufi(klon_glo) = cu((ii+1)*jj+1)
    111     cvfi(klon_glo) = cv((ii+1)*jj-ii)
     160    latfi_glo(klon_glo)= rlatu(jj+1)
     161    lonfi_glo(klon_glo)= 0.
     162    cufi_glo(klon_glo) = cu((ii+1)*jj+1)
     163    cvfi_glo(klon_glo) = cv((ii+1)*jj-ii)
     164    boundslonfi_glo(klon_glo,north_east)=0
     165    boundslatfi_glo(klon_glo,north_east)=rlatv(jj)
     166    boundslonfi_glo(klon_glo,north_west)=2*PI
     167    boundslatfi_glo(klon_glo,north_west)=rlatv(jj)
     168    boundslonfi_glo(klon_glo,south_west)=2*PI
     169    boundslatfi_glo(klon_glo,south_west)=-PI/2
     170    boundslonfi_glo(klon_glo,south_east)=rlonu(0)
     171    boundslatfi_glo(klon_glo,south_east)=-Pi/2
    112172
    113173    ! build airefi(), mesh area on physics grid
    114     CALL gr_dyn_fi(1,ii+1,jj+1,klon_glo,aire,airefi)
     174    CALL gr_dyn_fi(1,ii+1,jj+1,klon_glo,aire,airefi_glo)
    115175    ! Poles are single points on physics grid
    116     airefi(1)=sum(aire(1:ii,1))
    117     airefi(klon_glo)=sum(aire(1:ii,jj+1))
     176    airefi_glo(1)=sum(aire(1:ii,1))
     177    airefi_glo(klon_glo)=sum(aire(1:ii,jj+1))
    118178
    119179    ! Sanity check: do total planet area match between physics and dynamics?
    120180    total_area_dyn=sum(aire(1:ii,1:jj+1))
    121     total_area_phy=sum(airefi(1:klon_glo))
     181    total_area_phy=sum(airefi_glo(1:klon_glo))
    122182    IF (total_area_dyn/=total_area_phy) THEN
    123183      WRITE (lunout, *) 'iniphysiq: planet total surface discrepancy !!!'
     
    132192  ELSE ! klon_glo==1, running the 1D model
    133193    ! just copy over input values
    134     latfi(1)=rlatu(1)
    135     lonfi(1)=rlonv(1)
    136     cufi(1)=cu(1)
    137     cvfi(1)=cv(1)
    138     airefi(1)=aire(1,1)
     194    latfi_glo(1)=rlatu(1)
     195    lonfi_glo(1)=rlonv(1)
     196    cufi_glo(1)=cu(1)
     197    cvfi_glo(1)=cv(1)
     198    airefi_glo(1)=aire(1,1)
     199    boundslonfi_glo(1,north_east)=rlonu(1)
     200    boundslatfi_glo(1,north_east)=PI/2
     201    boundslonfi_glo(1,north_west)=rlonu(2)
     202    boundslatfi_glo(1,north_west)=PI/2
     203    boundslonfi_glo(1,south_west)=rlonu(2)
     204    boundslatfi_glo(1,south_west)=rlatv(1)
     205    boundslonfi_glo(1,south_east)=rlonu(1)
     206    boundslatfi_glo(1,south_east)=rlatv(1)
    139207  ENDIF ! of IF (klon_glo>1)
    140208
    141209!$OMP PARALLEL DEFAULT(SHARED) COPYIN(/temps/)
    142210  ! Now generate local lon/lat/cu/cv/area arrays
    143   CALL initcomgeomphy(klon_omp)
     211
    144212
    145213  offset = klon_mpi_begin - 1
    146   airephy(1:klon_omp) = airefi(offset+klon_omp_begin:offset+klon_omp_end)
    147   cuphy(1:klon_omp) = cufi(offset+klon_omp_begin:offset+klon_omp_end)
    148   cvphy(1:klon_omp) = cvfi(offset+klon_omp_begin:offset+klon_omp_end)
    149   rlond(1:klon_omp) = lonfi(offset+klon_omp_begin:offset+klon_omp_end)
    150   rlatd(1:klon_omp) = latfi(offset+klon_omp_begin:offset+klon_omp_end)
     214  airefi(1:klon_omp) = airefi_glo(offset+klon_omp_begin:offset+klon_omp_end)
     215  cufi(1:klon_omp) = cufi_glo(offset+klon_omp_begin:offset+klon_omp_end)
     216  cvfi(1:klon_omp) = cvfi_glo(offset+klon_omp_begin:offset+klon_omp_end)
     217  lonfi(1:klon_omp) = lonfi_glo(offset+klon_omp_begin:offset+klon_omp_end)
     218  latfi(1:klon_omp) = latfi_glo(offset+klon_omp_begin:offset+klon_omp_end)
     219  boundslonfi(1:klon_omp,:) = boundslonfi_glo(offset+klon_omp_begin:offset+klon_omp_end,:)
     220  boundslatfi(1:klon_omp,:) = boundslatfi_glo(offset+klon_omp_begin:offset+klon_omp_end,:)
    151221
    152222  ! copy over global grid longitudes and latitudes
    153   CALL initcomgeomphy_horiz(iim,jjm,rlonu,rlonv,rlatu,rlatv)
     223  CALL init_geometry(lonfi, latfi, boundslonfi, boundslatfi, airefi, cufi, cvfi)
     224
    154225 
    155226  ! copy over preff , ap(), bp(), etc
    156   CALL initcomgeomphy_vert(nlayer,preff,ap,bp,presnivs,pseudoalt)
    157 
    158 !    ! suphel => initialize some physical constants (orbital parameters,
    159 !    !           geoid, gravity, thermodynamical constants, etc.) in the
    160 !    !           physics
    161 !  CALL suphel
     227  CALL init_vertical_layers(nlayer,preff,ap,bp,presnivs,pseudoalt)
    162228
    163229  ! Initialize tracer names, numbers, etc. for physics
     
    179245!!$OMP PARALLEL
    180246  IF (iflag_phys>=100) THEN
    181     CALL iniaqua(klon_omp, rlatd, rlond, iflag_phys)
     247    CALL iniaqua(klon_omp, iflag_phys)
    182248  END IF
    183249!$OMP END PARALLEL
  • dynamico_lmdz/aquaplanet/LMDZ5/libf/phylmd/add_phys_tend.F90

    r3817 r3825  
    1818use phys_state_var_mod
    1919USE inifis_mod, ONLY: prt_level
     20USE geometry_mod, ONLY : lon_degrees, lat_degrees
    2021IMPLICIT none
    2122  include "YOMCST.h"
     
    106107         i=jadrs(j)
    107108         if(prt_level.ge.debug_level) THEN
    108           print*,'PLANTAGE POUR LE POINT i rlon rlat =',i,rlon(i),rlat(i),text
     109          print*,'PLANTAGE POUR LE POINT i lon lat =',i,lon_degrees(i),lat_degrees(i),text
    109110          print*,'l    T     dT       Q     dQ    '
    110111          DO k = 1, klev
     
    124125        i=jqadrs(j)
    125126          if(prt_level.ge.debug_level) THEN
    126            print*,'WARNING  : EAU POUR LE POINT i rlon rlat =',i,rlon(i),rlat(i),text
     127           print*,'WARNING  : EAU POUR LE POINT i lon lat =',i,lon_degrees(i),lat_degrees(i),text
    127128           print*,'l    T     dT       Q     dQ    '
    128129           DO k = 1, klev
     
    205206         k=kadrs(j)
    206207         if(prt_level.ge.debug_level) THEN
    207           print*,'PLANTAGE2 POUR LE POINT i itap rlon rlat txt jbad zdt t',i,itap,rlon(i),rlat(i),text,jbad, &
     208          print*,'PLANTAGE2 POUR LE POINT i itap lon lat txt jbad zdt t',i,itap,lon_degrees(i),lat_degrees(i),text,jbad, &
    208209       &        zdt(i,k),t_seri(i,k)-zdt(i,k)
    209210!!!       if(prt_level.ge.10.and.itap.GE.229.and.i.EQ.3027) THEN
     
    222223         k=kqadrs(j)
    223224         if(prt_level.ge.debug_level) THEN
    224           print*,'WARNING  : EAU2 POUR LE POINT i itap rlon rlat txt jqbad zdq q zdql ql',i,itap,rlon(i),rlat(i),text,jqbad,&
     225          print*,'WARNING  : EAU2 POUR LE POINT i itap lon lat txt jqbad zdq q zdql ql',i,itap,lon_degrees(i), lat_degrees(i), text,jqbad,&
    225226       &        zdq(i,k), q_seri(i,k)-zdq(i,k), zdql(i,k), ql_seri(i,k)-zdql(i,k)
    226227!!!       if(prt_level.ge.10.and.itap.GE.229.and.i.EQ.3027) THEN
  • dynamico_lmdz/aquaplanet/LMDZ5/libf/phylmd/calcul_divers.h

    r3809 r3825  
    88         DO i=1, klon
    99            IF(pctsrf(i,is_ter).GT.0.) THEN
    10                paire_ter(i)=airephy(i)*pctsrf(i,is_ter)
     10               paire_ter(i)=cell_area(i)*pctsrf(i,is_ter)
    1111            ENDIF
    1212         ENDDO
  • dynamico_lmdz/aquaplanet/LMDZ5/libf/phylmd/carbon_cycle_mod.F90

    r3817 r3825  
    8686
    8787    USE dimphy
    88     USE comgeomphy
     88    USE geometry_mod, ONLY : cell_area
    8989    USE mod_phys_lmdz_transfert_para
    9090    USE infotrac_phy
     
    289289! 5) Calculate total area of the earth surface
    290290! --------------------------------------------
    291     CALL reduce_sum(SUM(airephy),airetot)
     291    CALL reduce_sum(SUM(cell_area),airetot)
    292292    CALL bcast(airetot)
    293293
     
    308308    USE phys_cal_mod, ONLY : mth_cur, mth_len
    309309    USE phys_cal_mod, ONLY : day_cur
    310     USE comgeomphy
    311310    USE indice_sol_mod
    312311    USE inifis_mod, ONLY: lunout
     312    USE geometry_mod, ONLY : cell_area
    313313
    314314    IMPLICIT NONE
     
    443443
    444444          ! Calculate a global mean value of delta CO2 flux
    445           fco2_tmp(1:klon) = fco2_tmp(1:klon) * airephy(1:klon)
     445          fco2_tmp(1:klon) = fco2_tmp(1:klon) * cell_area(1:klon)
    446446          CALL reduce_sum(SUM(fco2_tmp),sumtmp)
    447447          CALL bcast(sumtmp)
  • dynamico_lmdz/aquaplanet/LMDZ5/libf/phylmd/comgeomphy.F90

    r3816 r3825  
    11module comgeomphy
    2    real,save,allocatable :: airephy(:)
    3    real,save,allocatable :: cuphy(:)
    4    real,save,allocatable :: cvphy(:)
    5    real,save,allocatable :: rlatd(:)
    6    real,save,allocatable :: rlond(:)
    7 !$OMP THREADPRIVATE(airephy,cuphy,cvphy,rlatd,rlond)
     2!   real,save,allocatable :: airephy(:) => transfered in geometry_mod (area)
     3!   real,save,allocatable :: cuphy(:) => transfered in regular_lonlat_mod : dlon_reg
     4!   real,save,allocatable :: cvphy(:) => transfered in regular_lonlat_mod : dlat_reg
     5!   real,save,allocatable :: rlatd(:) => transfered in geometry_mod (longitude)
     6!   real,save,allocatable :: rlond(:) => transfered in geometry_mod (latitude)
     7!!$OMP THREADPRIVATE(airephy,rlatd,rlond)
    88   ! general (over global grid) latitudes and longitudes:
    99   ! useful for outputs
    10    real,save,allocatable :: rlonv(:) ! longitudes (rad)
    11    real,save,allocatable :: rlonu(:) ! longitude boundaries (rad)
    12    real,save,allocatable :: rlatu(:) ! latitudes (rad)
    13    real,save,allocatable :: rlatv(:) ! latitude boundaries (rad)
    14 !$OMP THREADPRIVATE(rlonv,rlonu,rlatu,rlatv)
     10!   real,save,allocatable :: rlonv(:) ! longitudes (rad)           => transfered in regular_lonlat_mod
     11!   real,save,allocatable :: rlonu(:) ! longitude boundaries (rad) => transfered in regular_lonlat_mod
     12!   real,save,allocatable :: rlatu(:) ! latitudes (rad)            => transfered in regular_lonlat_mod
     13!   real,save,allocatable :: rlatv(:) ! latitude boundaries (rad)  => transfered in regular_lonlat_mod
     14!!$OMP THREADPRIVATE(rlonv,rlonu,rlatu,rlatv)
    1515
    1616   ! vertical grid
    17    real,save :: preff  ! reference surface pressure (Pa)
    18    real,save,allocatable :: ap(:)
    19    real,save,allocatable :: bp(:)
    20    real,save,allocatable :: presnivs(:)
    21    real,save,allocatable :: pseudoalt(:)
    22 !$OMP THREADPRIVATE(preff,ap,bp,presnivs,pseudoalt)
     17!   real,save :: preff  ! reference surface pressure (Pa)
     18!   real,save,allocatable :: ap(:)        => transfered in vertical_mod
     19!   real,save,allocatable :: bp(:)        => transfered in vertical_mod
     20!   real,save,allocatable :: presnivs(:)  => transfered in vertical_mod
     21!   real,save,allocatable :: pseudoalt(:) => transfered in vertical_mod
     22!!$OMP THREADPRIVATE(preff,ap,bp,presnivs,pseudoalt)
    2323
    2424contains
     
    2828    integer,intent(in) :: klon_omp ! number of columns (on local omp grid)
    2929 
    30     allocate(airephy(klon_omp))
    31     allocate(cuphy(klon_omp))
    32     allocate(cvphy(klon_omp))
    33     allocate(rlatd(klon_omp))
    34     allocate(rlond(klon_omp))
     30!    allocate(airephy(klon_omp))
     31!    allocate(rlatd(klon_omp))
     32!    allocate(rlond(klon_omp))
    3533
    3634  end subroutine InitComgeomphy
    3735 
    38   subroutine initcomgeomphy_horiz(iim,jjm,rlonu_dyn,rlonv_dyn,&
    39                                   rlatu_dyn,rlatv_dyn)
     36  subroutine initcomgeomphy_horiz(iim,jjm)
    4037    IMPLICIT NONE
    4138    integer,intent(in) :: iim
    4239    integer,intent(in) :: jjm
    43     real,intent(in) :: rlonu_dyn(iim+1) ! dyn grid boundaries (rad)
    44     real,intent(in) :: rlonv_dyn(iim+1) ! dyn grid longitudes (rad)
    45     real,intent(in) :: rlatu_dyn(jjm+1) ! dyn grid latitudes (rad)
    46     real,intent(in) :: rlatv_dyn(jjm)  ! dyn grid boundaries (rad)
    4740   
    48     allocate(rlonu(iim+1))
    49     allocate(rlonv(iim+1))
    50     allocate(rlatu(jjm+1))
    51     allocate(rlatv(jjm))
    52    
    53     rlonu(:)=rlonu_dyn(:)
    54     rlonv(:)=rlonv_dyn(:)
    55     rlatu(:)=rlatu_dyn(:)
    56     rlatv(:)=rlatv_dyn(:)
    57    
     41   
    5842  end subroutine initcomgeomphy_horiz
    5943 
     
    6852    real,intent(in) :: pseudoalt_dyn(nlayer) ! pseudo-altitude of atm. layers (km)
    6953 
    70     allocate(ap(nlayer+1))
    71     allocate(bp(nlayer+1))
    72     allocate(presnivs(nlayer))
    73     allocate(pseudoalt(nlayer))
    74  
    75     preff=preff_dyn
    76     ap(:)=ap_dyn(:)
    77     bp(:)=bp_dyn(:)
    78     presnivs(:)=presnivs_dyn(:)
    79     pseudoalt(:)=pseudoalt_dyn(:)
     54!    allocate(ap(nlayer+1))
     55!    allocate(bp(nlayer+1))
     56!    allocate(presnivs(nlayer))
     57!    allocate(pseudoalt(nlayer))
     58! 
     59!    preff=preff_dyn
     60!    ap(:)=ap_dyn(:)
     61!    bp(:)=bp_dyn(:)
     62!    presnivs(:)=presnivs_dyn(:)
     63!    pseudoalt(:)=pseudoalt_dyn(:)
    8064
    8165  end subroutine initcomgeomphy_vert
  • dynamico_lmdz/aquaplanet/LMDZ5/libf/phylmd/cpl_mod.F90

    r3819 r3825  
    294294! are stored in this module.
    295295    USE surface_data
    296     USE phys_state_var_mod, ONLY : rlon, rlat
     296    USE geometry_mod, ONLY : lon_degrees, lat_degrees
    297297    USE carbon_cycle_mod, ONLY : carbon_cycle_cpl
    298298    USE indice_sol_mod
     
    365365
    366366! Transform the longitudes and latitudes on 2D arrays
    367           CALL gather_omp(rlon,rlon_mpi)
    368           CALL gather_omp(rlat,rlat_mpi)
     367          CALL gather_omp(lon_degrees,rlon_mpi)
     368          CALL gather_omp(lat_degrees,rlat_mpi)
    369369!$OMP MASTER
    370370          CALL Grid1DTo2D_mpi(rlon_mpi,tmp_lon)
  • dynamico_lmdz/aquaplanet/LMDZ5/libf/phylmd/hgardfou.F90

    r3818 r3825  
    66  USE indice_sol_mod
    77  USE inifis_mod, ONLY: lunout
     8  USE geometry_mod, ONLY : lon_degrees, lat_degrees
    89  IMPLICIT NONE
    910  ! ======================================================================
     
    3031    firstcall = .FALSE.
    3132    ! DO i = 1, klon
    32     ! WRITE(lunout,*)'i=',i,'rlon=',rlon(i),'rlat=',rlat(i)
     33    ! WRITE(lunout,*)'i=',i,'lon=',lon_degrees(i),'lat=',lat_degrees(i)
    3334    ! ENDDO
    3435
     
    5556      DO i = 1, jbad
    5657        WRITE (lunout, *) 'i,k,temperature,lon,lat,pourc ter,lic,oce,sic =', &
    57           jadrs(i), k, zt(jadrs(i)), rlon(jadrs(i)), rlat(jadrs(i)), &
     58          jadrs(i), k, zt(jadrs(i)), lon_degrees(jadrs(i)), lat_degrees(jadrs(i)), &
    5859          (pctsrf(jadrs(i),nsrf), nsrf=1, nbsrf)
    5960      END DO
     
    7576      DO i = 1, jbad
    7677        WRITE (lunout, *) 'i,k,temperature,lon,lat,pourc ter,lic,oce,sic =', &
    77           jadrs(i), k, zt(jadrs(i)), rlon(jadrs(i)), rlat(jadrs(i)), &
     78          jadrs(i), k, zt(jadrs(i)), lon_degrees(jadrs(i)), lat_degrees(jadrs(i)), &
    7879          (pctsrf(jadrs(i),nsrf), nsrf=1, nbsrf)
    7980      END DO
     
    101102        WRITE (lunout, *) &
    102103          'i,nsrf,temperature,lon,lat,pourc ter,lic,oce,sic =', jadrs(i), &
    103           nsrf, zt(jadrs(i)), rlon(jadrs(i)), rlat(jadrs(i)), &
     104          nsrf, zt(jadrs(i)), lon_degrees(jadrs(i)), lat_degrees(jadrs(i)), &
    104105          pctsrf(jadrs(i), nsrf)
    105106      END DO
     
    122123        WRITE (lunout, *) &
    123124          'i,nsrf,temperature,lon,lat,pourc ter,lic,oce,sic =', jadrs(i), &
    124           nsrf, zt(jadrs(i)), rlon(jadrs(i)), rlat(jadrs(i)), &
     125          nsrf, zt(jadrs(i)), lon_degrees(jadrs(i)), lat_degrees(jadrs(i)), &
    125126          pctsrf(jadrs(i), nsrf)
    126127      END DO
  • dynamico_lmdz/aquaplanet/LMDZ5/libf/phylmd/ini_histday_seri.h

    r3819 r3825  
    1313         CALL ymds2ju(annee_ref, 1, idayref, 0.0, zjulian)
    1414!
    15          CALL grid1dTo2d_glo(rlon,zx_lon)
     15         CALL grid1dTo2d_glo(lon_degrees,zx_lon)
    1616         DO i = 1, nbp_lon
    17             zx_lon(i,1) = rlon(i+1)
    18             zx_lon(i,jjmp1) = rlon(i+1)
     17            zx_lon(i,1) = lon_degrees(i+1)
     18            zx_lon(i,jjmp1) = lon_degrees(i+1)
    1919         ENDDO
    2020         DO ll=1,klev
    2121            znivsig(ll)=REAL(ll)
    2222         ENDDO
    23          CALL grid1dTo2d_glo(rlat,zx_lat)
     23         CALL grid1dTo2d_glo(lat_degrees,zx_lat)
    2424!
    2525         imin_debut=1
  • dynamico_lmdz/aquaplanet/LMDZ5/libf/phylmd/ini_paramLMDZ_phy.h

    r3819 r3825  
    11!IM    Implemente en modes sequentiel et parallele
    22
    3        CALL gather(rlat,rlat_glo)
     3       CALL gather(lat_degrees,rlat_glo)
    44       CALL bcast(rlat_glo)
    5        CALL gather(rlon,rlon_glo)
     5       CALL gather(lon_degrees,rlon_glo)
    66       CALL bcast(rlon_glo)
    77
  • dynamico_lmdz/aquaplanet/LMDZ5/libf/phylmd/init_be.F90

    r3814 r3825  
    55
    66  USE dimphy
    7   USE comgeomphy
    87  USE infotrac_phy, ONLY : nbtr
    98  USE indice_sol_mod
     9  USE geometry_mod, ONLY : longitude, latitude
    1010   
    1111  IMPLICIT NONE
     
    114114
    115115  DO i = 1,klon
    116      qcos=sin(glt)*sin(rlatd(i))
     116     qcos=sin(glt)*sin(latitude(i))
    117117!!jyg
    118118!!     qcos=qcos+cos(glt)*cos(rlatd(i))*cos(rlond(i)+glg)
    119      qcos=qcos+cos(glt)*cos(rlatd(i))*cos(rlond(i)-glg)
     119     qcos=qcos+cos(glt)*cos(latitude(i))*cos(longitude(i)-glg)
    120120!!jyg end
    121121     IF ( qcos .LT. -1.) qcos = -1.
  • dynamico_lmdz/aquaplanet/LMDZ5/libf/phylmd/lsc_scav.F90

    r3818 r3825  
    1010  USE traclmdz_mod
    1111  USE infotrac_phy,ONLY : nbtr
    12   USE comgeomphy
    1312  USE iophy
    1413  IMPLICIT NONE
  • dynamico_lmdz/aquaplanet/LMDZ5/libf/phylmd/mod_grid_phy_lmdz.F90

    r3814 r3825  
    1 !
    2 !$Id $
    3 !
    41MODULE mod_grid_phy_lmdz
    52
     
    85             grid2dTo1d_glo_igen, grid2dTo1d_glo_rgen, grid2dTo1d_glo_lgen
    96 
     7  INTEGER,PARAMETER :: unstructured=0
     8  INTEGER,PARAMETER :: regular_lonlat=1
     9
     10  INTEGER,SAVE :: grid_type
     11  INTEGER,SAVE :: nvertex
    1012  INTEGER,SAVE :: nbp_lon  ! == iim
    1113  INTEGER,SAVE :: nbp_lat  ! == jjmp1
    1214  INTEGER,SAVE :: nbp_lev  ! == llm
    1315  INTEGER,SAVE :: klon_glo
     16
    1417
    1518  INTERFACE grid1dTo2d_glo
     
    3235
    3336
    34   SUBROUTINE Init_grid_phy_lmdz(iim,jjp1,llm)
     37  SUBROUTINE init_grid_phy_lmdz(grid_type_,nvertex_,nbp_lon_,nbp_lat_,nbp_lev_)
    3538  IMPLICIT NONE
    36   INTEGER, INTENT(in) :: iim
    37   INTEGER, INTENT(in) :: jjp1
    38   INTEGER, INTENT(in) :: llm
    39  
    40     nbp_lon=iim
    41     nbp_lat=jjp1
    42     nbp_lev=llm
    43     klon_glo=(iim*jjp1)-2*(iim-1)
    44  
    45   END SUBROUTINE Init_grid_phy_lmdz
     39  INTEGER,INTENT(IN)  :: grid_type_
     40  INTEGER,INTENT(IN)  :: nvertex_
     41  INTEGER, INTENT(IN) :: nbp_lon_
     42  INTEGER, INTENT(IN) :: nbp_lat_
     43  INTEGER, INTENT(IN) :: nbp_lev_
     44 
     45    grid_type = grid_type_
     46    nvertex   = nvertex_
     47    nbp_lon   = nbp_lon_
     48    nbp_lat   = nbp_lat_
     49    nbp_lev   = nbp_lev_
     50    klon_glo  = (nbp_lon*nbp_lat)-2*(nbp_lon-1)
     51 
     52  END SUBROUTINE init_grid_phy_lmdz
    4653 
    4754 
  • dynamico_lmdz/aquaplanet/LMDZ5/libf/phylmd/mod_phys_lmdz_mpi_data.F90

    r3817 r3825  
    1 !
    2 !$Header$
    3 !
    41MODULE mod_phys_lmdz_mpi_data
    52 
     
    4643CONTAINS
    4744 
    48   SUBROUTINE Init_phys_lmdz_mpi_data(iim,jjp1,nb_proc,distrib,communicator)
     45  SUBROUTINE init_phys_lmdz_mpi_data(nbp, nbp_lon, nbp_lat, communicator)
    4946  IMPLICIT NONE
    5047#ifdef CPP_MPI
    5148    INCLUDE 'mpif.h'
    5249#endif
    53     INTEGER,INTENT(in) :: iim
    54     INTEGER,INTENT(in) :: jjp1
    55     INTEGER,INTENT(in) :: nb_proc
    56     INTEGER,INTENT(in) :: distrib(0:nb_proc-1)
    57     INTEGER,INTENT(in) :: communicator
    58    
     50    INTEGER,INTENT(IN) :: nbp
     51    INTEGER,INTENT(IN) :: nbp_lon
     52    INTEGER,INTENT(IN) :: nbp_lat
     53    INTEGER,INTENT(IN) :: communicator
     54   
     55    INTEGER,ALLOCATABLE :: distrib(:)
    5956    INTEGER :: ierr
    6057    INTEGER :: klon_glo
     
    6764#endif
    6865   
    69     if (iim.eq.1) then
     66    if (nbp_lon.eq.1) then
    7067       klon_glo=1
    7168    else
    72        klon_glo=iim*(jjp1-2)+2
     69       klon_glo=nbp_lon*(nbp_lat-2)+2
    7370    endif
    7471   
     
    8582      mpi_rank=0
    8683    ENDIF
    87    
     84
     85    ALLOCATE(distrib(0:mpi_size-1))
     86
     87    IF (is_using_mpi) THEN   
     88#ifdef CPP_MPI
     89    CALL MPI_ALLGATHER(nbp,1,MPI_REAL8,distrib,1,MPI_REAL_LMDZ,COMM_LMDZ_PHY)
     90#endif
     91    ELSE
     92     distrib(:)=nbp
     93    ENDIF
     94   
     95       
    8896    IF (mpi_rank == 0) THEN
    8997      mpi_master = 0
     
    119127 
    120128     
    121     klon_mpi_para_nb(0:mpi_size-1)=distrib(0:nb_proc-1)
     129    klon_mpi_para_nb(0:mpi_size-1)=distrib(0:mpi_size-1)
    122130
    123131    DO i=0,mpi_size-1
     
    136144        ij_para_begin(i) = 1
    137145      ELSE
    138         ij_para_begin(i) = klon_mpi_para_begin(i)+iim-1
     146        ij_para_begin(i) = klon_mpi_para_begin(i)+nbp_lon-1
    139147      ENDIF
    140148
    141       jj_para_begin(i) = (ij_para_begin(i)-1)/iim + 1
    142       ii_para_begin(i) = MOD(ij_para_begin(i)-1,iim) + 1
     149      jj_para_begin(i) = (ij_para_begin(i)-1)/nbp_lon + 1
     150      ii_para_begin(i) = MOD(ij_para_begin(i)-1,nbp_lon) + 1
    143151
    144152     
    145       ij_para_end(i) = klon_mpi_para_end(i)+iim-1
    146       jj_para_end(i) = (ij_para_end(i)-1)/iim + 1
    147       ii_para_end(i) = MOD(ij_para_end(i)-1,iim) + 1
     153      ij_para_end(i) = klon_mpi_para_end(i)+nbp_lon-1
     154      jj_para_end(i) = (ij_para_end(i)-1)/nbp_lon + 1
     155      ii_para_end(i) = MOD(ij_para_end(i)-1,nbp_lon) + 1
    148156
    149157
  • dynamico_lmdz/aquaplanet/LMDZ5/libf/phylmd/mod_phys_lmdz_para.F90

    r3817 r3825  
    1616CONTAINS
    1717
    18   SUBROUTINE Init_phys_lmdz_para(iim,jjp1,nb_proc,distrib,communicator)
     18  SUBROUTINE Init_phys_lmdz_para(nbp, nbp_lon, nbp_lat, communicator)
    1919  IMPLICIT NONE
    20     INTEGER,INTENT(in) :: iim
    21     INTEGER,INTENT(in) :: jjp1
    22     INTEGER,INTENT(in) :: nb_proc
    23     INTEGER,INTENT(in) :: distrib(0:nb_proc-1)
    24     INTEGER,INTENT(in) :: communicator
     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,communicator)
     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)
  • dynamico_lmdz/aquaplanet/LMDZ5/libf/phylmd/phyaqua_mod.F90

    r3818 r3825  
    55CONTAINS
    66
    7   SUBROUTINE iniaqua(nlon, latfi, lonfi, iflag_phys)
     7  SUBROUTINE iniaqua(nlon, iflag_phys)
    88
    99    ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
     
    1919    ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    2020
    21     USE comgeomphy, ONLY: rlatd, rlond
    2221    USE dimphy, ONLY: klon
     22    USE geometry_mod, ONLY : latitude
    2323    USE surface_data, ONLY: type_ocean, ok_veget
    2424    USE pbl_surface_mod, ONLY: pbl_surface_init
    2525    USE fonte_neige_mod, ONLY: fonte_neige_init
    2626    USE phys_state_var_mod
    27     !USE control_phy_mod, ONLY: dayref, nday, iphysiq
    2827    USE inifis_mod, ONLY: dayref, nday, iphysiq, dtphys, &
    2928                          daysec, day_ini,day_end
    3029    USE indice_sol_mod
    31     !USE temps_phy_mod
    32     !USE comconst_phy_mod
    3330    USE nrtype, ONLY: pi
    3431    USE ioipsl
    3532    IMPLICIT NONE
    3633
    37     ! #include "dimphy.h"
    38     ! #include "YOMCST.h"
    39 !    include "comconst.h"
    4034    include "clesphys.h"
    4135    include "dimsoil.h"
    42 !    include "temps.h"
    4336
    4437    INTEGER, INTENT (IN) :: nlon, iflag_phys
    45     ! IM ajout latfi, lonfi
    46     REAL, INTENT (IN) :: lonfi(nlon), latfi(nlon)
    4738
    4839    INTEGER type_profil, type_aqua
     
    6354    INTEGER it, unit, i, k, itap
    6455
    65     REAL airefi, zcufi, zcvfi
    66 
    6756    REAL rugos, albedo
    6857    REAL tsurf
     
    7059    REAL qsol_f
    7160    REAL rugsrel(nlon)
    72     ! real zmea(nlon),zstd(nlon),zsig(nlon)
    73     ! real zgam(nlon),zthe(nlon),zpic(nlon),zval(nlon)
    74     ! real rlon(nlon),rlat(nlon)
    7561    LOGICAL alb_ocean
    76     ! integer demih_pas
    7762
    7863    CHARACTER *80 ans, file_forctl, file_fordat, file_start
     
    123108    INTEGER l, ierr, aslun
    124109
    125     REAL longitude, latitude
    126110    REAL paire
    127111
    128     DATA latitude, longitude/48., 0./
    129112
    130113    ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
     
    154137    time = 0.
    155138
    156     ! IM ajout latfi, lonfi
    157     rlatd = latfi
    158     rlond = lonfi
    159     rlat = rlatd*180./pi
    160     rlon = rlond*180./pi
    161 
    162139    ! -----------------------------------------------------------------------
    163140    ! initialisations de la physique
     
    166143    day_ini = dayref
    167144    day_end = day_ini + nday
    168     airefi = 1.
    169     zcufi = 1.
    170     zcvfi = 1.
     145
    171146    !$OMP MASTER
    172147    nbapp_rad_omp = 24
     
    266241    END DO
    267242    ! IM calcul profil sst
    268     CALL profil_sst(nlon, rlatd, type_profil, phy_sst)
     243    CALL profil_sst(nlon, latitude, type_profil, phy_sst)
    269244
    270245    CALL writelim(klon, phy_nat, phy_alb, phy_sst, phy_bil, phy_rug, phy_ice, &
  • dynamico_lmdz/aquaplanet/LMDZ5/libf/phylmd/phyetat0.F90

    r3818 r3825  
    99  USE pbl_surface_mod,  ONLY : pbl_surface_init
    1010  USE surface_data,     ONLY : type_ocean, version_ocean
     11  USE geometry_mod,         ONLY : lon_degrees, lat_degrees
    1112  USE phys_state_var_mod, ONLY : ancien_ok, clwcon, detr_therm, dtime, &
    1213       qsol, fevap, z0m, z0h, agesno, &
     
    1415       falb_dir, falb_dif, &
    1516       ftsol, pbl_tke, pctsrf, q_ancien, radpas, radsol, rain_fall, ratqs, &
    16        rlat, rlon, rnebcon, rugoro, sig1, snow_fall, solaire_etat0, sollw, sollwdown, &
     17       rnebcon, rugoro, sig1, snow_fall, solaire_etat0, sollw, sollwdown, &
    1718       solsw, t_ancien, u_ancien, v_ancien, w01, wake_cstar, wake_deltaq, &
    1819       wake_deltat, wake_delta_pbl_TKE, delta_tsurf, wake_fip, wake_pe, &
     
    135136  clesphy0(8)=tab_cntrl( 12 )
    136137
    137   ! Lecture des latitudes (coordonnees):
    138 
    139   CALL get_field("latitude", rlat)
    140 
    141   ! Lecture des longitudes (coordonnees):
    142 
    143   CALL get_field("longitude", rlon)
    144138
    145139  ! Lecture du masque terre mer
     
    845839  ! Initialize module ocean_cpl_mod for the case of coupled ocean
    846840  IF ( type_ocean == 'couple' ) THEN
    847      CALL ocean_cpl_init(dtime, rlon, rlat)
    848   ENDIF
    849 
    850   CALL init_iophy_new(rlat, rlon)
     841     CALL ocean_cpl_init(dtime, lon_degrees, lat_degrees)
     842  ENDIF
     843
     844  CALL init_iophy_new(lon_degrees, lat_degrees)
    851845
    852846  ! Initilialize module fonte_neige_mod     
  • dynamico_lmdz/aquaplanet/LMDZ5/libf/phylmd/phyredem.F90

    r3816 r3825  
    99  USE pbl_surface_mod,  ONLY : pbl_surface_final
    1010  USE phys_state_var_mod
     11  USE geometry_mod, ONLY : lon_degrees, lat_degrees
    1112  USE iostart
    1213  USE traclmdz_mod, ONLY : traclmdz_to_restart
     
    9394
    9495  CALL put_field("longitude", &
    95        "Longitudes de la grille physique", rlon)
    96 
    97   CALL put_field("latitude", "Latitudes de la grille physique", rlat)
     96       "Longitudes de la grille physique", lon_degrees)
     97
     98  CALL put_field("latitude", "Latitudes de la grille physique", lat_degrees)
    9899
    99100  ! PB ajout du masque terre/mer
  • dynamico_lmdz/aquaplanet/LMDZ5/libf/phylmd/phys_output_mod.F90

    r3819 r3825  
    4747    USE mod_grid_phy_lmdz, only: klon_glo
    4848    !USE temps_phy_mod
    49     USE comgeomphy, ONLY: ap,bp,presnivs,preff
     49    USE vertical_layers_mod,ONLY: ap,bp,presnivs,preff
    5050    !Use comvert_phy_mod
    5151    USE inifis_mod, ONLY: day_ini, itau_phy, start_time, annee_ref, day_ref
  • dynamico_lmdz/aquaplanet/LMDZ5/libf/phylmd/phys_output_write_mod.F90

    r3819 r3825  
    235235    USE indice_sol_mod, only: nbsrf
    236236    USE infotrac_phy, only: nqtot, nqo, type_trac
    237     USE comgeomphy, only: airephy
     237    USE geometry_mod, ONLY : cell_area
    238238    USE surface_data, only: type_ocean, version_ocean, ok_veget, ok_snow
    239239!    USE aero_mod, only: naero_spc
     
    320320!!! Champs 1D !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    321321       CALL histwrite_phy(o_phis, pphis)
    322        CALL histwrite_phy(o_aire, airephy)
     322       CALL histwrite_phy(o_aire, cell_area)
    323323
    324324       IF (vars_defined) THEN
  • dynamico_lmdz/aquaplanet/LMDZ5/libf/phylmd/phys_state_var_mod.F90

    r3817 r3825  
    2020!$OMP THREADPRIVATE(dtime, solaire_etat0)
    2121
    22       REAL, ALLOCATABLE, SAVE :: rlat(:), rlon(:), pctsrf(:,:)
    23 !$OMP THREADPRIVATE(rlat, rlon, pctsrf)
     22      REAL, ALLOCATABLE, SAVE ::  pctsrf(:,:)
     23!$OMP THREADPRIVATE(pctsrf)
     24
    2425      REAL, ALLOCATABLE, SAVE :: ftsol(:,:)
    2526!$OMP THREADPRIVATE(ftsol)
     
    418419
    419420include "clesphys.h"
    420       ALLOCATE(rlat(klon), rlon(klon))
    421421      ALLOCATE(pctsrf(klon,nbsrf))
    422422      ALLOCATE(ftsol(klon,nbsrf))
     
    593593include "clesphys.h"
    594594
    595       deallocate(rlat, rlon, pctsrf, ftsol, falb1, falb2)
     595      deallocate(pctsrf, ftsol, falb1, falb2)
    596596      deallocate(qsol,fevap,z0m,z0h,agesno)
    597597      deallocate(rain_fall, snow_fall, solsw, sollw, radsol)
  • dynamico_lmdz/aquaplanet/LMDZ5/libf/phylmd/physiq.F90

    r3819 r3825  
    77     u,v,t,qx, &
    88     flxmass_w, &
    9      d_u, d_v, d_t, d_qx, d_ps &
    10      , dudyn)
     9     d_u, d_v, d_t, d_qx, d_ps)
    1110
    1211  USE ioipsl, only: histbeg, histvert, histdef, histend, histsync, &
    1312       histwrite, ju2ymds, ymds2ju, getin
    14   USE comgeomphy, ONLY: airephy
     13  USE geometry_mod, ONLY: cell_area
    1514  USE phys_cal_mod, only: year_len, mth_len, days_elapsed, jh_1jan, year_cur, &
    1615       mth_cur, phys_cal_update
     
    3332  USE phys_output_ctrlout_mod
    3433  USE iophy
     34  USE geometry_mod, ONLY : lon_degrees, lat_degrees
    3535  use open_climoz_m, only: open_climoz ! ozone climatology from a file
    3636  use regr_pr_av_m, only: regr_pr_av
     
    681681!  PARAMETER(imp1jmp1=(iim+1)*jjmp1) ! => (imp1jmp1=(nbp_lon+1)*(nbp_lat-1/(nbp_lat-1)))
    682682  !ym A voir plus tard
    683   REAL zx_tmp((nbp_lon+1)*(nbp_lat-1/(nbp_lat-1)))
    684   REAL airedyn(nbp_lon+1,nbp_lat-1/(nbp_lat-1))
    685   REAL padyn(nbp_lon+1,nbp_lat-1/(nbp_lat-1),klev+1)
    686   REAL dudyn(nbp_lon+1,nbp_lat-1/(nbp_lat-1),klev)
    687   REAL rlatdyn(nbp_lon+1,nbp_lat-1/(nbp_lat-1))
     683!  REAL zx_tmp((nbp_lon+1)*(nbp_lat-1/(nbp_lat-1)))
    688684  !IM 190504 END
    689685  LOGICAL ok_msk
     
    12641260     ok_sync_omp=.false.
    12651261     CALL getin('ok_sync',ok_sync_omp)
    1266      call phys_output_open(rlon,rlat,nCFMIP,tabijGCM, &
     1262     call phys_output_open(lon_degrees,lat_degrees,nCFMIP,tabijGCM, &
    12671263          iGCM,jGCM,lonGCM,latGCM, &
    12681264          jjmp1,nlevSTD,clevSTD,rlevSTD, dtime,ok_veget, &
     
    13181314             rg, &
    13191315             ra, &
    1320              airephy, &
    1321              rlat, &
    1322              rlon, &
     1316             cell_area, &
     1317             lat_degrees, &
     1318             lon_degrees, &
    13231319             presnivs, &
    13241320             calday, &
     
    15261522  IF (ip_ebil_phy.ge.1) THEN
    15271523     ztit='after dynamic'
    1528      CALL diagetpq(airephy,ztit,ip_ebil_phy,1,1,dtime &
     1524     CALL diagetpq(cell_area,ztit,ip_ebil_phy,1,1,dtime &
    15291525          , t_seri,q_seri,ql_seri,qs_seri,u_seri,v_seri,paprs,pplay &
    15301526          , d_h_vcol, d_qt, d_qw, d_ql, d_qs, d_ec)
     
    15331529     !     est egale a la variation de la physique au pas de temps precedent.
    15341530     !     Donc la somme de ces 2 variations devrait etre nulle.
    1535      call diagphy(airephy,ztit,ip_ebil_phy &
     1531     call diagphy(cell_area,ztit,ip_ebil_phy &
    15361532          , zero_v, zero_v, zero_v, zero_v, zero_v &
    15371533          , zero_v, zero_v, zero_v, ztsol &
     
    16751671        zzz=real(90) ! could be revisited
    16761672     ENDIF
    1677      wo(:,:,1)=ozonecm(rlat, paprs,read_climoz,rjour=zzz)
     1673     wo(:,:,1)=ozonecm(lat_degrees, paprs,read_climoz,rjour=zzz)
    16781674  ENDIF
    16791675  !
     
    17301726  IF (ip_ebil_phy.ge.2) THEN
    17311727     ztit='after reevap'
    1732      CALL diagetpq(airephy,ztit,ip_ebil_phy,2,1,dtime &
     1728     CALL diagetpq(cell_area,ztit,ip_ebil_phy,2,1,dtime &
    17331729          , t_seri,q_seri,ql_seri,qs_seri,u_seri,v_seri,paprs,pplay &
    17341730          , d_h_vcol, d_qt, d_qw, d_ql, d_qs, d_ec)
    1735      call diagphy(airephy,ztit,ip_ebil_phy &
     1731     call diagphy(cell_area,ztit,ip_ebil_phy &
    17361732          , zero_v, zero_v, zero_v, zero_v, zero_v &
    17371733          , zero_v, zero_v, zero_v, ztsol &
     
    17771773  ! non nul aux poles.
    17781774  IF (abs(solarlong0-1000.)<1.e-4) then
    1779      call zenang_an(cycle_diurne,jH_cur,rlat,rlon,rmu0,fract)
     1775     call zenang_an(cycle_diurne,jH_cur,lat_degrees,lon_degrees,rmu0,fract)
    17801776  ELSE
    17811777     !  Avec ou sans cycle diurne
    17821778     IF (cycle_diurne) THEN
    17831779        zdtime=dtime*REAL(radpas) ! pas de temps du rayonnement (s)
    1784         CALL zenang(zlongi,jH_cur,zdtime,rlat,rlon,rmu0,fract)
     1780        CALL zenang(zlongi,jH_cur,zdtime,lat_degrees,lon_degrees,rmu0,fract)
    17851781     ELSE
    1786         CALL angle(zlongi, rlat, fract, rmu0)
     1782        CALL angle(zlongi, lat_degrees, fract, rmu0)
    17871783     ENDIF
    17881784  ENDIF
     
    18541850          dtime,     date0,     itap,    days_elapsed+1, &
    18551851          debut,     lafin, &
    1856           rlon,      rlat,      rugoro,  rmu0,      &
     1852          lon_degrees,      lat_degrees,      rugoro,  rmu0,      &
    18571853          zsig,      sollwdown, pphi,    cldt,      &
    18581854          rain_fall, snow_fall, solsw,   sollw,     &
     
    19741970     IF (ip_ebil_phy.ge.2) THEN
    19751971        ztit='after surface_main'
    1976         CALL diagetpq(airephy,ztit,ip_ebil_phy,2,2,dtime &
     1972        CALL diagetpq(cell_area,ztit,ip_ebil_phy,2,2,dtime &
    19771973             , t_seri,q_seri,ql_seri,qs_seri,u_seri,v_seri,paprs,pplay &
    19781974             , d_h_vcol, d_qt, d_qw, d_ql, d_qs, d_ec)
    1979         call diagphy(airephy,ztit,ip_ebil_phy &
     1975        call diagphy(cell_area,ztit,ip_ebil_phy &
    19801976             , zero_v, zero_v, zero_v, zero_v, sens &
    19811977             , evap  , zero_v, zero_v, ztsol &
     
    20242020  ENDDO
    20252021  IF (check) THEN
    2026      za = qcheck(klon,klev,paprs,q_seri,ql_seri,airephy)
     2022     za = qcheck(klon,klev,paprs,q_seri,ql_seri,cell_area)
    20272023     WRITE(lunout,*) "avantcon=", za
    20282024  ENDIF
     
    20442040  DO k = 1, klev
    20452041     DO i = 1, klon
    2046         omega(i,k) = RG*flxmass_w(i,k) / airephy(i)
     2042        omega(i,k) = RG*flxmass_w(i,k) / cell_area(i)
    20472043     END DO
    20482044  END DO
     
    23772373  IF (ip_ebil_phy.ge.2) THEN
    23782374     ztit='after convect'
    2379      CALL diagetpq(airephy,ztit,ip_ebil_phy,2,2,dtime &
     2375     CALL diagetpq(cell_area,ztit,ip_ebil_phy,2,2,dtime &
    23802376          , t_seri,q_seri,ql_seri,qs_seri,u_seri,v_seri,paprs,pplay &
    23812377          , d_h_vcol, d_qt, d_qw, d_ql, d_qs, d_ec)
    2382      call diagphy(airephy,ztit,ip_ebil_phy &
     2378     call diagphy(cell_area,ztit,ip_ebil_phy &
    23832379          , zero_v, zero_v, zero_v, zero_v, zero_v &
    23842380          , zero_v, rain_con, snow_con, ztsol &
     
    23882384  !
    23892385  IF (check) THEN
    2390      za = qcheck(klon,klev,paprs,q_seri,ql_seri,airephy)
     2386     za = qcheck(klon,klev,paprs,q_seri,ql_seri,cell_area)
    23912387     WRITE(lunout,*)"aprescon=", za
    23922388     zx_t = 0.0
    23932389     za = 0.0
    23942390     DO i = 1, klon
    2395         za = za + airephy(i)/REAL(klon)
     2391        za = za + cell_area(i)/REAL(klon)
    23962392        zx_t = zx_t + (rain_con(i)+ &
    2397              snow_con(i))*airephy(i)/REAL(klon)
     2393             snow_con(i))*cell_area(i)/REAL(klon)
    23982394     ENDDO
    23992395     zx_t = zx_t/za*dtime
     
    25422538  IF (ip_ebil_phy.ge.2) THEN
    25432539     ztit='after wake'
    2544      CALL diagetpq(airephy,ztit,ip_ebil_phy,2,2,dtime &
     2540     CALL diagetpq(cell_area,ztit,ip_ebil_phy,2,2,dtime &
    25452541          , t_seri,q_seri,ql_seri,qs_seri,u_seri,v_seri,paprs,pplay &
    25462542          , d_h_vcol, d_qt, d_qw, d_ql, d_qs, d_ec)
    2547      call diagphy(airephy,ztit,ip_ebil_phy &
     2543     call diagphy(cell_area,ztit,ip_ebil_phy &
    25482544          , zero_v, zero_v, zero_v, zero_v, zero_v &
    25492545          , zero_v, zero_v, zero_v, ztsol &
     
    26352631             ,ztv,zpspsk,ztla,zthl &
    26362632             !cc nrlmd le 10/04/2012
    2637              ,pbl_tke_input,pctsrf,omega,airephy &
     2633             ,pbl_tke_input,pctsrf,omega,cell_area &
    26382634             ,zlcl_th,fraca0,w0,w_conv,therm_tke_max0,env_tke_max0 &
    26392635             ,n2,s2,ale_bl_stat &
     
    28582854  IF (ip_ebil_phy.ge.2) THEN
    28592855     ztit='after dry_adjust'
    2860      CALL diagetpq(airephy,ztit,ip_ebil_phy,2,2,dtime &
     2856     CALL diagetpq(cell_area,ztit,ip_ebil_phy,2,2,dtime &
    28612857          , t_seri,q_seri,ql_seri,qs_seri,u_seri,v_seri,paprs,pplay &
    28622858          , d_h_vcol, d_qt, d_qw, d_ql, d_qs, d_ec)
    2863      call diagphy(airephy,ztit,ip_ebil_phy &
     2859     call diagphy(cell_area,ztit,ip_ebil_phy &
    28642860          , zero_v, zero_v, zero_v, zero_v, zero_v &
    28652861          , zero_v, zero_v, zero_v, ztsol &
     
    29112907  ENDDO
    29122908  IF (check) THEN
    2913      za = qcheck(klon,klev,paprs,q_seri,ql_seri,airephy)
     2909     za = qcheck(klon,klev,paprs,q_seri,ql_seri,cell_area)
    29142910     WRITE(lunout,*)"apresilp=", za
    29152911     zx_t = 0.0
    29162912     za = 0.0
    29172913     DO i = 1, klon
    2918         za = za + airephy(i)/REAL(klon)
     2914        za = za + cell_area(i)/REAL(klon)
    29192915        zx_t = zx_t + (rain_lsc(i) &
    2920              + snow_lsc(i))*airephy(i)/REAL(klon)
     2916             + snow_lsc(i))*cell_area(i)/REAL(klon)
    29212917     ENDDO
    29222918     zx_t = zx_t/za*dtime
     
    29262922  IF (ip_ebil_phy.ge.2) THEN
    29272923     ztit='after fisrt'
    2928      CALL diagetpq(airephy,ztit,ip_ebil_phy,2,2,dtime &
     2924     CALL diagetpq(cell_area,ztit,ip_ebil_phy,2,2,dtime &
    29292925          , t_seri,q_seri,ql_seri,qs_seri,u_seri,v_seri,paprs,pplay &
    29302926          , d_h_vcol, d_qt, d_qw, d_ql, d_qs, d_ec)
    2931      call diagphy(airephy,ztit,ip_ebil_phy &
     2927     call diagphy(cell_area,ztit,ip_ebil_phy &
    29322928          , zero_v, zero_v, zero_v, zero_v, zero_v &
    29332929          , zero_v, rain_lsc, snow_lsc, ztsol &
     
    31703166  IF (ip_ebil_phy.ge.2) THEN
    31713167     ztit="after diagcld"
    3172      CALL diagetpq(airephy,ztit,ip_ebil_phy,2,2,dtime &
     3168     CALL diagetpq(cell_area,ztit,ip_ebil_phy,2,2,dtime &
    31733169          , t_seri,q_seri,ql_seri,qs_seri,u_seri,v_seri,paprs,pplay &
    31743170          , d_h_vcol, d_qt, d_qw, d_ql, d_qs, d_ec)
    3175      call diagphy(airephy,ztit,ip_ebil_phy &
     3171     call diagphy(cell_area,ztit,ip_ebil_phy &
    31763172          , zero_v, zero_v, zero_v, zero_v, zero_v &
    31773173          , zero_v, zero_v, zero_v, ztsol &
     
    32393235        CALL AEROSOL_METEO_CALC( &
    32403236             calday,pdtphys,pplay,paprs,t,pmflxr,pmflxs, &
    3241              prfl,psfl,pctsrf,airephy,rlat,rlon,u10m,v10m)
     3237             prfl,psfl,pctsrf,cell_area,lat_degrees,lon_degrees,u10m,v10m)
    32423238     END IF
    32433239
     
    32483244          jH_cur, &
    32493245          pctsrf(1,1), &
    3250           rlat, &
    3251           rlon, &
    3252           airephy, &
     3246          lat_degrees, &
     3247          lon_degrees, &
     3248          cell_area, &
    32533249          paprs, &
    32543250          pplay, &
     
    33603356        DO i=1,klon
    33613357           !
    3362            if (rlon(i).ge.lon1_beta.AND.rlon(i).le.lon2_beta.AND. &
    3363                 rlat(i).le.lat1_beta.AND.rlat(i).ge.lat2_beta) THEN
     3358           if (lon_degrees(i).ge.lon1_beta.AND.lat_degrees(i).le.lon2_beta.AND. &
     3359                lat_degrees(i).le.lat1_beta.AND.lat_degrees(i).ge.lat2_beta) THEN
    33643360              if (pplay(i,k).GE.pfree) THEN
    33653361                 beta(i,k) = beta_pbl
     
    35823578  IF (ip_ebil_phy.ge.2) THEN
    35833579     ztit='after rad'
    3584      CALL diagetpq(airephy,ztit,ip_ebil_phy,2,2,dtime &
     3580     CALL diagetpq(cell_area,ztit,ip_ebil_phy,2,2,dtime &
    35853581          , t_seri,q_seri,ql_seri,qs_seri,u_seri,v_seri,paprs,pplay &
    35863582          , d_h_vcol, d_qt, d_qw, d_ql, d_qs, d_ec)
    3587      call diagphy(airephy,ztit,ip_ebil_phy &
     3583     call diagphy(cell_area,ztit,ip_ebil_phy &
    35883584          , topsw, toplw, solsw, sollw, zero_v &
    35893585          , zero_v, zero_v, zero_v, ztsol &
     
    36813677
    36823678        CALL lift_noro_strato(klon,klev,dtime,paprs,pplay, &
    3683              rlat,zmea,zstd,zpic,zgam,zthe,zpic,zval, &
     3679             lat_degrees,zmea,zstd,zpic,zgam,zthe,zpic,zval, &
    36843680             igwd,idx,itest, &
    36853681             t_seri, u_seri, v_seri, &
     
    36893685     ELSE
    36903686        CALL lift_noro(klon,klev,dtime,paprs,pplay, &
    3691              rlat,zmea,zstd,zpic, &
     3687             lat_degrees,zmea,zstd,zpic, &
    36923688             itest, &
    36933689             t_seri, u_seri, v_seri, &
     
    37073703
    37083704     CALL hines_gwd(klon,klev,dtime,paprs,pplay, &
    3709           rlat,t_seri,u_seri,v_seri, &
     3705          lat_degrees,t_seri,u_seri,v_seri, &
    37103706          zustrhi,zvstrhi, &
    37113707          d_t_hin, d_u_hin, d_v_hin)
     
    37513747     CALL aaam_bud (27,klon,klev,jD_cur-jD_ref,jH_cur, &
    37523748          ra,rg,romega, &
    3753           rlat,rlon,pphis, &
     3749          lat_degrees,lon_degrees,pphis, &
    37543750          zustrdr,zustrli,zustrph, &
    37553751          zvstrdr,zvstrli,zvstrph, &
     
    37613757  IF (ip_ebil_phy.ge.2) THEN
    37623758     ztit='after orography'
    3763      CALL diagetpq(airephy,ztit,ip_ebil_phy,2,2,dtime &
     3759     CALL diagetpq(cell_area,ztit,ip_ebil_phy,2,2,dtime &
    37643760          , t_seri,q_seri,ql_seri,qs_seri,u_seri,v_seri,paprs,pplay &
    37653761          , d_h_vcol, d_qt, d_qw, d_ql, d_qs, d_ec)
    3766      call diagphy(airephy,ztit,ip_ebil_phy &
     3762     call diagphy(cell_area,ztit,ip_ebil_phy &
    37673763          , zero_v, zero_v, zero_v, zero_v, zero_v &
    37683764          , zero_v, zero_v, zero_v, ztsol &
     
    37983794             ok_mensuelCOSP,ok_journeCOSP,ok_hfCOSP, &
    37993795             ecrit_mth,ecrit_day,ecrit_hf, ok_all_xml, &
    3800              klon,klev,rlon,rlat,presnivs,overlap, &
     3796             klon,klev,lon_degrees,lat_degrees,presnivs,overlap, &
    38013797             fract,ref_liq,ref_ice, &
    38023798             pctsrf(:,is_ter)+pctsrf(:,is_lic), &
     
    38423838       zustar,   zu10m,     zv10m, &
    38433839       wstar(:,is_ave),    ale_bl,         ale_wake, &
    3844        rlat,     rlon, &
     3840       lat_degrees,     lon_degrees, &
    38453841       frac_impa,frac_nucl, beta_prec_fisrt,beta_prec, &
    38463842       presnivs, pphis,     pphi,     albsol1, &
     
    38633859          print*,'Attention on met a 0 les thermiques pour phystoke'
    38643860     call phystokenc ( &
    3865           nlon,klev,pdtphys,rlon,rlat, &
     3861          nlon,klev,pdtphys,lon_degrees,lat_degrees, &
    38663862          t,pmfu, pmfd, pen_u, pde_u, pen_d, pde_d, &
    38673863          fm_therm,entr_therm, &
    38683864          cdragh,coefh(1:klon,1:klev,is_ave),u1,v1,ftsol,pctsrf, &
    38693865          frac_impa, frac_nucl, &
    3870           pphis,airephy,dtime,itap, &
     3866          pphis,cell_area,dtime,itap, &
    38713867          qx(:,:,ivap),da,phi,mp,upwd,dnwd)
    38723868
     
    39083904  IF (ip_ebil_phy.ge.1) THEN
    39093905     ztit='after physic'
    3910      CALL diagetpq(airephy,ztit,ip_ebil_phy,1,1,dtime &
     3906     CALL diagetpq(cell_area,ztit,ip_ebil_phy,1,1,dtime &
    39113907          , t_seri,q_seri,ql_seri,qs_seri,u_seri,v_seri,paprs,pplay &
    39123908          , d_h_vcol, d_qt, d_qw, d_ql, d_qs, d_ec)
     
    39163912     !     Donc la somme de ces 2 variations devrait etre nulle.
    39173913
    3918      call diagphy(airephy,ztit,ip_ebil_phy &
     3914     call diagphy(cell_area,ztit,ip_ebil_phy &
    39193915          , topsw, toplw, solsw, sollw, sens &
    39203916          , evap, rain_fall, snow_fall, ztsol &
     
    39643960          paprs, &
    39653961          q_seri, &
    3966           airephy, &
     3962          cell_area, &
    39673963          pphi, &
    39683964          pphis, &
  • dynamico_lmdz/aquaplanet/LMDZ5/libf/phylmd/print_debug_phys.F90

    r3809 r3825  
    44use phys_local_var_mod
    55use phys_state_var_mod
     6use geometry_mod, ONLY : lon_degrees, lat_degrees
    67IMPLICIT NONE
    78integer i,debug_lev
     
    1415print*,'l    u, v, T, q, ql'
    1516DO k = 1, klev
    16    write(*,'(i3,2f8.4,3f14.4,2e14.2)') k,rlon(i),rlat(i),u_seri(i,k),v_seri(i,k),t_seri(i,k),q_seri(i,k),ql_seri(i,k)
     17   write(*,'(i3,2f8.4,3f14.4,2e14.2)') k,lon_degrees(i),lat_degrees(i),u_seri(i,k),v_seri(i,k),t_seri(i,k),q_seri(i,k),ql_seri(i,k)
    1718ENDDO
    1819
  • dynamico_lmdz/aquaplanet/LMDZ5/libf/phylmd/radlwsw_m.F90

    r3817 r3825  
    769769      ENDDO
    770770!----- Fin des mises a zero des tableaux output de RECMWF -------------------             
    771 !        GEMU(1:klon)=sin(rlatd(1:klon))
     771!        GEMU(1:klon)=sin(latitude(1:klon))
    772772! On met les donnees dans l'ordre des niveaux arpege
    773773         paprs_i(:,1)=paprs(:,klev+1)
  • dynamico_lmdz/aquaplanet/LMDZ5/libf/phylmd/regr_lat_time_climoz_m.F90

    r3819 r3825  
    7373    use netcdf, only: nf90_get_att, nf90_get_var, nf90_noerr, nf90_nowrite
    7474    use assert_m, only: assert
    75     !use comconst_phy_mod, only : pi
    76     !use comgeom2_phy_mod, only : rlatv
    77     use comgeomphy, only: rlatv
     75    use regular_lonlat_mod, only : boundslat_reg, south
    7876    use nrtype, only: pi
    7977    integer, intent(in):: read_climoz ! read ozone climatology
     
    293291            "Found 12 months in ozone climatologies, assuming periodicity..."
    294292       o3_regr_lat(nbp_lat:1:-1, :, 1:12, :) = regr1_step_av(o3_in, &
    295             xs=sin(lat_in_edg), xt=sin((/- pi / 2, rlatv(nbp_lat-1:1:-1), pi / 2/)))
     293            xs=sin(lat_in_edg), xt=sin((/- pi / 2, boundslat_reg(nbp_lat-1:1:-1,south), pi / 2/)))
    296294       ! (invert order of indices in "o3_regr_lat" because "rlatu" is
    297295       ! in descending order)
     
    304302       print *, "Using 14 months in ozone climatologies..."
    305303       o3_regr_lat(nbp_lat:1:-1, :, :, :) = regr1_step_av(o3_in, &
    306             xs=sin(lat_in_edg), xt=sin((/- pi / 2, rlatv(nbp_lat-1:1:-1), pi / 2/)))
     304            xs=sin(lat_in_edg), xt=sin((/- pi / 2, boundslat_reg(nbp_lat-1:1:-1,south), pi / 2/)))
    307305       ! (invert order of indices in "o3_regr_lat" because "rlatu" is
    308306       ! in descending order)
     
    334332         nf95_put_att, nf95_enddef, nf95_copy_att, nf95_put_var
    335333    use netcdf, only: nf90_clobber, nf90_float, nf90_global
    336     !use comconst_phy_mod, only : pi
    337     !use comgeom2_phy_mod, only : rlatu
    338334    use nrtype, only: pi
    339     use comgeomphy, only: rlatu
     335    use regular_lonlat_mod, only : lat_reg
    340336    integer, intent(in):: ncid_in, n_plev
    341337    integer, intent(out):: ncid_out, varid_plev, varid_time
     
    421417
    422418    ! Write one of the coordinate variables:
    423     call nf95_put_var(ncid_out, varid_rlatu, rlatu(nbp_lat:1:-1) / pi * 180.)
     419    call nf95_put_var(ncid_out, varid_rlatu, lat_reg(nbp_lat:1:-1) / pi * 180.)
    424420    ! (convert from rad to degrees and sort in ascending order)
    425421
  • dynamico_lmdz/aquaplanet/LMDZ5/libf/phylmd/regr_lat_time_coefoz_m.F90

    r3819 r3825  
    4949    !use comconst_phy_mod, only : pi
    5050    use nrtype, only: pi
    51     use comgeomphy, only: rlatv
     51    use regular_lonlat_mod, only: boundslat_reg, south
    5252    ! Variables local to the procedure:
    5353
     
    211211       ! equivalent to weighting by cosine of latitude:
    212212       v_regr_lat(nbp_lat:1:-1, :, 1:12) = regr1_step_av(o3_par_in, &
    213             xs=sin(lat_in_edg), xt=sin((/- pi / 2, rlatv(nbp_lat-1:1:-1), pi / 2/)))
     213            xs=sin(lat_in_edg), xt=sin((/- pi / 2, boundslat_reg(nbp_lat-1:1:-1,south), pi / 2/)))
    214214       ! (invert order of indices in "v_regr_lat" because "rlatu" is
    215215       ! in descending order)
     
    251251    !use comconst_phy_mod, only : pi
    252252    use nrtype, only: pi
    253     use comgeomphy, only: rlatu
    254 
     253    use regular_lonlat_mod, only : lat_reg
    255254    integer, intent(in):: ncid_in, varid_in(:), n_plev
    256255    character(len=*), intent(in):: name_out(:) ! of NetCDF variables
     
    326325
    327326    ! Write one of the coordinate variables:
    328     call nf95_put_var(ncid_out, varid_rlatu, rlatu(nbp_lat:1:-1) / pi * 180.)
     327    call nf95_put_var(ncid_out, varid_rlatu, lat_reg(nbp_lat:1:-1) / pi * 180.)
    329328    ! (convert from rad to degrees and sort in ascending order)
    330329
  • dynamico_lmdz/aquaplanet/LMDZ5/libf/phylmd/surf_land_bucket_mod.F90

    r3809 r3825  
    2424    USE cpl_mod
    2525    USE dimphy
    26     USE comgeomphy
     26    USE geometry_mod, ONLY : latitude
    2727    USE mod_grid_phy_lmdz
    2828    USE mod_phys_lmdz_para
     
    9999    CALL calbeta(dtime, is_ter, knon, snow, qsol, beta, capsol, dif_grnd)
    100100    if (type_veget=='betaclim') then
    101        CALL calbeta_clim(knon,jour,rlatd(knindex(1:knon)),beta)
     101       CALL calbeta_clim(knon,jour,latitude(knindex(1:knon)),beta)
    102102    endif
    103103       
  • dynamico_lmdz/aquaplanet/LMDZ5/libf/phylmd/surf_land_orchidee_mod.F90

    r3818 r3825  
    1616  USE cpl_mod,      ONLY : cpl_send_land_fields
    1717  USE surface_data, ONLY : type_ocean
    18   USE comgeomphy,   ONLY : cuphy, cvphy
     18  USE geometry_mod, ONLY : dx, dy
    1919  USE mod_grid_phy_lmdz
    2020  USE mod_phys_lmdz_para
     
    328328       DO igrid = 1, knon
    329329          ij = knindex(igrid)
    330           resolution(igrid,1) = cuphy(ij)
    331           resolution(igrid,2) = cvphy(ij)
     330          resolution(igrid,1) = dx(ij)
     331          resolution(igrid,2) = dy(ij)
    332332       ENDDO
    333333     
  • dynamico_lmdz/aquaplanet/LMDZ5/libf/phylmd/thermcellV0_main.F90

    r3818 r3825  
    1313
    1414      USE dimphy
    15       USE comgeomphy , ONLY:rlond,rlatd
    1615      USE inifis_mod, ONLY: lunout, prt_level
    1716      IMPLICIT NONE
  • dynamico_lmdz/aquaplanet/LMDZ5/libf/phylmd/thermcell_main.F90

    r3818 r3825  
    2323      USE dimphy
    2424      USE ioipsl
    25       USE comgeomphy , ONLY:rlond,rlatd
    2625      USE indice_sol_mod
    2726      USE inifis_mod, ONLY: lunout, prt_level
  • dynamico_lmdz/aquaplanet/LMDZ5/libf/phylmd/tracinca_mod.F90

    r3818 r3825  
    4444    USE infotrac_phy
    4545    USE vampir
    46     USE comgeomphy
     46    USE geometry_mod, ONLY : cell_area
    4747    !USE control_phy_mod
    4848    USE inifis_mod, ONLY: config_inca
     
    144144         pplay,pdel,prfl,pmflxr,psfl,    &
    145145         pmflxs,zpmfu,itop_con,ibas_con,  &
    146          pphi,airephy,nstep,rneb,t_seri, &     
     146         pphi,cell_area,nstep,rneb,t_seri, &     
    147147         rh,tau_aero,piz_aero,cg_aero,   &
    148148         rfname,ccm,lafin, config_inca)
     
    161161         pplay,      & !pmid
    162162         pdel,       & !pdel
    163          airephy,    &
     163         cell_area,    &
    164164         pctsrf(1,1),& !oro
    165165         ftsol,      & !tsurf
  • dynamico_lmdz/aquaplanet/LMDZ5/libf/phylmd/write_histday_seri.h

    r3819 r3825  
    2020      ok_msk=.FALSE.
    2121      msk(1:klon)=pctsrf(1:klon,is_ter)
    22       CALL moyglo_pondaire(klon, zx_tmp_fi2d, airephy,  &
     22      CALL moyglo_pondaire(klon, zx_tmp_fi2d, cell_area,  &
    2323           ok_msk, msk, moyglo)
    2424      zx_tmp_fi2d(1:klon)=moyglo
     
    2929!
    3030      ok_msk=.FALSE.
    31       CALL moyglo_pondaire(klon, bils, airephy,  &
     31      CALL moyglo_pondaire(klon, bils, cell_area,  &
    3232           ok_msk, msk, moyglo)
    3333      zx_tmp_fi2d(1:klon)=moyglo
     
    4545!
    4646      CALL moyglo_pondaima(klon, klev, zx_tmp_fi3d,  &
    47            airephy, paprs, moyglo)
     47           cell_area, paprs, moyglo)
    4848      zx_tmp_fi2d(1:klon)=moyglo
    4949!
     
    6565!ym!
    6666!ym      CALL moyglo_pondaima(klon, klev, zx_tmp_fi3d,  &
    67 !ym           airephy, paprs, moyglo)
     67!ym           cell_area, paprs, moyglo)
    6868!ym      zx_tmp_fi2d(1:klon)=moyglo
    6969!ym!
     
    7979!ym!
    8080!ym      ok_msk=.FALSE.
    81 !ym      CALL moyglo_pondaire(klon, zx_tmp_fi2d, airephy,  &
     81!ym      CALL moyglo_pondaire(klon, zx_tmp_fi2d, cell_area,  &
    8282!ym           ok_msk, msk, moyglo)
    8383!ym      zx_tmp_fi2d(1:klon)=moyglo
     
    9090!ym!
    9191!ym!IM 190504 BEG
    92 !ym      CALL gr_fi_dyn(1,klon,nbp_lon+1,jjm+1,airephy,airedyn)
     92!ym      CALL gr_fi_dyn(1,klon,nbp_lon+1,jjm+1,cell_area,airedyn)
    9393!ym      CALL gr_fi_dyn(klev+1,klon,nbp_lon+1,jjm+1,paprs,padyn)
    9494!ym      CALL gr_fi_dyn(1,klon,nbp_lon+1,jjm+1,rlat,rlatdyn)
     
    126126!ym!
    127127!ym
    128 !ym      CALL gr_fi_dyn(1,klon,nbp_lon+1,jjm+1,airephy,airedyn)
     128!ym      CALL gr_fi_dyn(1,klon,nbp_lon+1,jjm+1,cell_area,airedyn)
    129129!#endif     
    130130     
    131       CALL grid1dTo2d_glo(airephy,zx_tmp_2d)
     131      CALL grid1dTo2d_glo(cell_area,zx_tmp_2d)
    132132      airetot=0.
    133133!     DO j = 1, jjmp1
     
    145145      airetot=0.
    146146      DO i=1, klon
    147        airetot=airetot+airephy(i)
     147       airetot=airetot+cell_area(i)
    148148      ENDDO
    149149!     IF(itap.EQ.1) PRINT*,'airetotphy=',airetot
     
    172172!
    173173      CALL moyglo_pondmass(klon, klev, t_seri, &
    174            airephy, paprs, moyglo)
     174           cell_area, paprs, moyglo)
    175175      zx_tmp_fi2d(1:klon)=moyglo
    176176!
     
    180180!
    181181      ok_msk=.FALSE.
    182       CALL moyglo_pondaire(klon, paprs(:,1), airephy,  &
     182      CALL moyglo_pondaire(klon, paprs(:,1), cell_area,  &
    183183           ok_msk, msk, moyglo)
    184184      zx_tmp_fi2d(1:klon)=moyglo
     
    189189!
    190190      ok_msk=.FALSE.
    191       CALL moyglo_pondaire(klon, evap, airephy,  &
     191      CALL moyglo_pondaire(klon, evap, cell_area,  &
    192192           ok_msk, msk, moyglo)
    193193      zx_tmp_fi2d(1:klon)=moyglo
     
    203203!     ok_msk=.TRUE.
    204204!     msk(1:klon)=pctsrf(1:klon,is_ter)
    205 !     CALL moyglo_pondaire(klon, zx_tmp_fi2d, airephy,
     205!     CALL moyglo_pondaire(klon, zx_tmp_fi2d, cell_area,
    206206!    .                     ok_msk, msk, moyglo)
    207207!     zx_tmp_fi2d(1:klon)=moyglo
     
    219219!     ok_msk=.TRUE.
    220220!     msk(1:klon)=pctsrf(1:klon,is_ter)
    221 !     CALL moyglo_pondaire(klon, zx_tmp_fi2d, airephy,
     221!     CALL moyglo_pondaire(klon, zx_tmp_fi2d, cell_area,
    222222!    .     ok_msk, msk, moyglo)
    223223!     zx_tmp_fi2d(1:klon)=moyglo
     
    233233      ok_msk=.TRUE.
    234234      msk(1:klon)=pctsrf(1:klon,is_oce)
    235       CALL moyglo_pondaire(klon, zx_tmp_fi2d, airephy,  &
     235      CALL moyglo_pondaire(klon, zx_tmp_fi2d, cell_area,  &
    236236           ok_msk, msk, moyglo)
    237237      zx_tmp_fi2d(1:klon)=moyglo
  • dynamico_lmdz/aquaplanet/LMDZ5/libf/phylmd/write_histrac.h

    r3809 r3825  
    88     
    99     CALL histwrite_phy(nid_tra,.FALSE.,"phis",itau_w,pphis)
    10      CALL histwrite_phy(nid_tra,.FALSE.,"aire",itau_w,airephy)
     10     CALL histwrite_phy(nid_tra,.FALSE.,"aire",itau_w,cell_area)
    1111     CALL histwrite_phy(nid_tra,.FALSE.,"zmasse",itau_w,zmasse)
    1212! RomP >>>
  • dynamico_lmdz/aquaplanet/LMDZ5/libf/phylmd/write_paramLMDZ_phy.h

    r3809 r3825  
    22! calcul moyennes globales
    33!
    4        zx_tmp_fi2d=bils*airephy
    5        CALL global_mean(zx_tmp_fi2d,airephy,.TRUE.,gbils)
    6        zx_tmp_fi2d=evap*airephy
    7        CALL global_mean(zx_tmp_fi2d,airephy,.TRUE.,gevap)
    8        zx_tmp_fi2d(:)=fevap(:, is_ter)*airephy(:)
    9        CALL global_mean(zx_tmp_fi2d,airephy,.TRUE.,gevapt)
    10        zx_tmp_fi2d=zxfluxlat*airephy
    11        CALL global_mean(zx_tmp_fi2d,airephy,.TRUE.,glat)
    12        zx_tmp_fi2d=(topsw0-toplw0)*airephy
    13        CALL global_mean(zx_tmp_fi2d,airephy,.TRUE.,gnet0)
    14        zx_tmp_fi2d=(topsw-toplw)*airephy
    15        CALL global_mean(zx_tmp_fi2d,airephy,.TRUE.,gnet)
    16        zx_tmp_fi2d=(rain_fall+snow_fall)*airephy
    17        CALL global_mean(zx_tmp_fi2d,airephy,.TRUE.,grain)
    18        zx_tmp_fi2d=zxtsol*airephy
    19        CALL global_mean(zx_tmp_fi2d,airephy,.TRUE.,gtsol)
    20        zx_tmp_fi2d=zt2m*airephy
    21        CALL global_mean(zx_tmp_fi2d,airephy,.TRUE.,gt2m)
    22        zx_tmp_fi2d=prw*airephy
    23        CALL global_mean(zx_tmp_fi2d,airephy,.TRUE.,gprw)
     4       zx_tmp_fi2d=bils*cell_area
     5       CALL global_mean(zx_tmp_fi2d,cell_area,.TRUE.,gbils)
     6       zx_tmp_fi2d=evap*cell_area
     7       CALL global_mean(zx_tmp_fi2d,cell_area,.TRUE.,gevap)
     8       zx_tmp_fi2d(:)=fevap(:, is_ter)*cell_area(:)
     9       CALL global_mean(zx_tmp_fi2d,cell_area,.TRUE.,gevapt)
     10       zx_tmp_fi2d=zxfluxlat*cell_area
     11       CALL global_mean(zx_tmp_fi2d,cell_area,.TRUE.,glat)
     12       zx_tmp_fi2d=(topsw0-toplw0)*cell_area
     13       CALL global_mean(zx_tmp_fi2d,cell_area,.TRUE.,gnet0)
     14       zx_tmp_fi2d=(topsw-toplw)*cell_area
     15       CALL global_mean(zx_tmp_fi2d,cell_area,.TRUE.,gnet)
     16       zx_tmp_fi2d=(rain_fall+snow_fall)*cell_area
     17       CALL global_mean(zx_tmp_fi2d,cell_area,.TRUE.,grain)
     18       zx_tmp_fi2d=zxtsol*cell_area
     19       CALL global_mean(zx_tmp_fi2d,cell_area,.TRUE.,gtsol)
     20       zx_tmp_fi2d=zt2m*cell_area
     21       CALL global_mean(zx_tmp_fi2d,cell_area,.TRUE.,gt2m)
     22       zx_tmp_fi2d=prw*cell_area
     23       CALL global_mean(zx_tmp_fi2d,cell_area,.TRUE.,gprw)
    2424!
    2525!$OMP MASTER
Note: See TracChangeset for help on using the changeset viewer.