Changeset 1395


Ignore:
Timestamp:
Mar 12, 2015, 12:45:17 PM (10 years ago)
Author:
emillour
Message:

All GCMS:
Some cleanup and tidying on the dynamics/physics interface.
Essentially affects the "iniphysiq" routine in all physics packages.
EM

Location:
trunk
Files:
13 edited
2 moved

Legend:

Unmodified
Added
Removed
  • trunk/DOC/chantiers/commit_importants.log

    r1391 r1395  
    14921492- leapfrog_p.F: add INCA specific stuff to keep up with current LMDZ5
    14931493- conf_gcm.F90: transformed to free form from conf_gcm.F
     1494
     1495**********************
     1496**** commit_v1395 ****
     1497**********************
     1498Ehouarn: some cleanup and tydying on the dynamics/physics interface.
     1499Essentially affects the "iniphysiq" routine in all physics packages.
  • trunk/LMDZ.COMMON/libf/dyn3d/gcm.F

    r1391 r1395  
    3838! Ehouarn: the following are needed with (parallel) physics:
    3939#ifdef CPP_PHYS
    40       USE dimphy
    41       USE comgeomphy
     40!      USE dimphy
     41!      USE comgeomphy, ONLY: initcomgeomphy
    4242#endif
    4343#ifdef INCA
     
    127127      LOGICAL first
    128128
    129       LOGICAL call_iniphys
    130       data call_iniphys/.true./
     129!      LOGICAL call_iniphys
     130!      data call_iniphys/.true./
    131131
    132132c+jld variables test conservation energie
     
    153153c    variables pour l'initialisation de la physique :
    154154c    ------------------------------------------------
    155       INTEGER ngridmx
    156       PARAMETER( ngridmx = 2+(jjm-1)*iim - 1/jjm   )
    157       REAL zcufi(ngridmx),zcvfi(ngridmx)
    158       REAL latfi(ngridmx),lonfi(ngridmx)
    159       REAL airefi(ngridmx)
    160       SAVE latfi, lonfi, airefi
     155!      INTEGER ngridmx
     156!      PARAMETER( ngridmx = 2+(jjm-1)*iim - 1/jjm   )
     157!      REAL zcufi(ngridmx),zcvfi(ngridmx)
     158!      REAL latfi(ngridmx),lonfi(ngridmx)
     159!      REAL airefi(ngridmx)
     160!      SAVE latfi, lonfi, airefi
    161161
    162162c-----------------------------------------------------------------------
     
    201201#ifdef CPP_PHYS
    202202      CALL init_phys_lmdz(iim,jjp1,llm,1,(/(jjm-1)*iim+2/))
    203       call initcomgeomphy
     203!      call initcomgeomphy ! now done in iniphysiq
    204204#endif
    205205!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
     
    457457c   -------------------------------
    458458
    459       IF (call_iniphys.and.(iflag_phys==1.or.iflag_phys>=100)) THEN
    460          latfi(1)=rlatu(1)
    461          lonfi(1)=0.
    462          zcufi(1) = cu(1)
    463          zcvfi(1) = cv(1)
    464          DO j=2,jjm
    465             DO i=1,iim
    466                latfi((j-2)*iim+1+i)= rlatu(j)
    467                lonfi((j-2)*iim+1+i)= rlonv(i)
    468                zcufi((j-2)*iim+1+i) = cu((j-1)*iip1+i)
    469                zcvfi((j-2)*iim+1+i) = cv((j-1)*iip1+i)
    470             ENDDO
    471          ENDDO
    472          latfi(ngridmx)= rlatu(jjp1)
    473          lonfi(ngridmx)= 0.
    474          zcufi(ngridmx) = cu(ip1jm+1)
    475          zcvfi(ngridmx) = cv(ip1jm-iim)
     459      IF ((iflag_phys==1).or.(iflag_phys>=100)) THEN
     460!      IF (call_iniphys.and.(iflag_phys==1.or.iflag_phys>=100)) THEN
     461!         latfi(1)=rlatu(1)
     462!         lonfi(1)=0.
     463!         zcufi(1) = cu(1)
     464!         zcvfi(1) = cv(1)
     465!         DO j=2,jjm
     466!            DO i=1,iim
     467!               latfi((j-2)*iim+1+i)= rlatu(j)
     468!               lonfi((j-2)*iim+1+i)= rlonv(i)
     469!               zcufi((j-2)*iim+1+i) = cu((j-1)*iip1+i)
     470!               zcvfi((j-2)*iim+1+i) = cv((j-1)*iip1+i)
     471!            ENDDO
     472!         ENDDO
     473!         latfi(ngridmx)= rlatu(jjp1)
     474!         lonfi(ngridmx)= 0.
     475!         zcufi(ngridmx) = cu(ip1jm+1)
     476!         zcvfi(ngridmx) = cv(ip1jm-iim)
    476477
    477478         ! build airefi(), mesh area on physics grid
    478          CALL gr_dyn_fi(1,iip1,jjp1,ngridmx,aire,airefi)
     479!         CALL gr_dyn_fi(1,iip1,jjp1,ngridmx,aire,airefi)
    479480         ! Poles are single points on physics grid
    480          airefi(1)=airefi(1)*iim
    481          airefi(ngridmx)=airefi(ngridmx)*iim
     481!         airefi(1)=airefi(1)*iim
     482!         airefi(ngridmx)=airefi(ngridmx)*iim
    482483
    483484! Initialisation de la physique: pose probleme quand on tourne
     
    485486! Il faut une cle CPP_PHYS
    486487#ifdef CPP_PHYS
    487          CALL iniphysiq(ngridmx,llm,daysec,day_ini,dtphys/nsplit_phys,
    488      &                latfi,lonfi,airefi,zcufi,zcvfi,rad,g,r,cpp,
     488!         CALL iniphysiq(ngridmx,llm,daysec,day_ini,dtphys/nsplit_phys,
     489!     &                latfi,lonfi,airefi,zcufi,zcvfi,rad,g,r,cpp,
     490!     &                iflag_phys)
     491         CALL iniphysiq(iim,jjm,llm,daysec,day_ini,dtphys/nsplit_phys,
     492     &                rlatu,rlonv,aire,cu,cv,rad,g,r,cpp,
    489493     &                iflag_phys)
    490494#endif
    491          call_iniphys=.false.
    492       ENDIF ! of IF (call_iniphys.and.(iflag_phys.eq.1))
     495!         call_iniphys=.false.
     496      ENDIF ! of IF ((iflag_phys==1).or.(iflag_phys>=100))
    493497
    494498c  numero de stockage pour les fichiers de redemarrage:
  • trunk/LMDZ.COMMON/libf/dyn3dpar/gcm.F

    r1391 r1395  
    3434#ifdef CPP_PHYS
    3535      USE mod_grid_phy_lmdz
    36       USE mod_phys_lmdz_para, ONLY : klon_mpi_para_nb
     36!      USE mod_phys_lmdz_para, ONLY : klon_mpi_para_nb
    3737      USE mod_phys_lmdz_omp_data, ONLY: klon_omp
    3838      USE dimphy
     
    123123
    124124
    125       LOGICAL call_iniphys
    126       data call_iniphys/.true./
     125!      LOGICAL call_iniphys
     126!      data call_iniphys/.true./
    127127
    128128c      REAL alpha(ip1jmp1,llm),beta(ip1jmp1,llm)
     
    150150c    variables pour l'initialisation de la physique :
    151151c    ------------------------------------------------
    152       INTEGER ngridmx
    153       PARAMETER( ngridmx = 2+(jjm-1)*iim - 1/jjm   )
    154       REAL zcufi(ngridmx),zcvfi(ngridmx)
    155       REAL latfi(ngridmx),lonfi(ngridmx)
    156       REAL airefi(ngridmx)
    157       SAVE latfi, lonfi, airefi
     152!      INTEGER ngridmx
     153!      PARAMETER( ngridmx = 2+(jjm-1)*iim - 1/jjm   )
     154!      REAL zcufi(ngridmx),zcvfi(ngridmx)
     155!      REAL latfi(ngridmx),lonfi(ngridmx)
     156!      REAL airefi(ngridmx)
     157!      SAVE latfi, lonfi, airefi
    158158     
    159159      INTEGER :: ierr
     
    198198#ifdef CPP_PHYS
    199199        CALL init_phys_lmdz(iim,jjp1,llm,mpi_size,distrib_phys)
    200 #endif
     200!#endif
     201!      CALL set_bands
     202!#ifdef CPP_PHYS
     203      CALL Init_interface_dyn_phys
     204#endif
     205      CALL barrier
     206
    201207      CALL set_bands
    202 #ifdef CPP_PHYS
    203       CALL Init_interface_dyn_phys
    204 #endif
    205       CALL barrier
    206 
    207208      if (mpi_rank==0) call WriteBands
    208209      call SetDistrib(jj_Nb_Caldyn)
     
    213214
    214215#ifdef CPP_PHYS
    215 c$OMP PARALLEL
    216       call initcomgeomphy
    217 c$OMP END PARALLEL
     216!c$OMP PARALLEL
     217!      call initcomgeomphy
     218!c$OMP END PARALLEL
    218219#endif
    219220
     
    467468c   -------------------------------
    468469
    469       IF (call_iniphys.and.(iflag_phys==1.or.iflag_phys>=100)) THEN
    470          latfi(1)=rlatu(1)
    471          lonfi(1)=0.
    472          zcufi(1) = cu(1)
    473          zcvfi(1) = cv(1)
    474          DO j=2,jjm
    475             DO i=1,iim
    476                latfi((j-2)*iim+1+i)= rlatu(j)
    477                lonfi((j-2)*iim+1+i)= rlonv(i)
    478                zcufi((j-2)*iim+1+i) = cu((j-1)*iip1+i)
    479                zcvfi((j-2)*iim+1+i) = cv((j-1)*iip1+i)
    480             ENDDO
    481          ENDDO
    482          latfi(ngridmx)= rlatu(jjp1)
    483          lonfi(ngridmx)= 0.
    484          zcufi(ngridmx) = cu(ip1jm+1)
    485          zcvfi(ngridmx) = cv(ip1jm-iim)
     470      IF ((iflag_phys==1).or.(iflag_phys>=100)) THEN
     471!         latfi(1)=rlatu(1)
     472!         lonfi(1)=0.
     473!         zcufi(1) = cu(1)
     474!         zcvfi(1) = cv(1)
     475!         DO j=2,jjm
     476!            DO i=1,iim
     477!               latfi((j-2)*iim+1+i)= rlatu(j)
     478!               lonfi((j-2)*iim+1+i)= rlonv(i)
     479!               zcufi((j-2)*iim+1+i) = cu((j-1)*iip1+i)
     480!               zcvfi((j-2)*iim+1+i) = cv((j-1)*iip1+i)
     481!            ENDDO
     482!         ENDDO
     483!         latfi(ngridmx)= rlatu(jjp1)
     484!         lonfi(ngridmx)= 0.
     485!         zcufi(ngridmx) = cu(ip1jm+1)
     486!         zcvfi(ngridmx) = cv(ip1jm-iim)
    486487
    487488         ! build airefi(), mesh area on physics grid
    488          CALL gr_dyn_fi(1,iip1,jjp1,ngridmx,aire,airefi)
     489!         CALL gr_dyn_fi(1,iip1,jjp1,ngridmx,aire,airefi)
    489490         ! Poles are single points on physics grid
    490          airefi(1)=airefi(1)*iim
    491          airefi(ngridmx)=airefi(ngridmx)*iim
     491!         airefi(1)=airefi(1)*iim
     492!         airefi(ngridmx)=airefi(ngridmx)*iim
    492493
    493494! Physics
    494495#ifdef CPP_PHYS
    495          CALL iniphysiq(ngridmx,llm,daysec,day_ini,dtphys/nsplit_phys,
    496      &                latfi,lonfi,airefi,zcufi,zcvfi,rad,g,r,cpp,
     496!         CALL iniphysiq(ngridmx,llm,daysec,day_ini,dtphys/nsplit_phys,
     497!     &                latfi,lonfi,airefi,zcufi,zcvfi,rad,g,r,cpp,
     498!     &                iflag_phys)
     499         CALL iniphysiq(iim,jjm,llm,daysec,day_ini,dtphys/nsplit_phys,
     500     &                rlatu,rlonv,aire,cu,cv,rad,g,r,cpp,
    497501     &                iflag_phys)
    498502#endif
    499          call_iniphys=.false.
     503!         call_iniphys=.false.
    500504      ENDIF ! of IF (call_iniphys.and.(iflag_phys==1.or.iflag_phys>=100))
    501505
  • trunk/LMDZ.COMMON/libf/dyn3dpar/mod_interface_dyn_phys.F90

    r776 r1395  
    1212 
    1313  SUBROUTINE Init_interface_dyn_phys
    14     USE mod_phys_lmdz_mpi_data
     14    USE mod_phys_lmdz_mpi_data, ONLY: klon_mpi, is_north_pole, is_south_pole, &
     15                                      ii_begin, jj_begin, ii_end, jj_end
    1516    IMPLICIT NONE
    1617    include 'dimensions.h'   
  • trunk/LMDZ.GENERIC/libf/dyn3d/gcm.F

    r1216 r1395  
    55      use control_mod, only: nday, day_step, iperiod, iphysiq,
    66     &                       iconser, ecritphy, idissip
    7       use comgeomphy, only: initcomgeomphy
     7!      use comgeomphy, only: initcomgeomphy
    88      IMPLICIT NONE
    99
     
    159159c    variables pour l'initialisation de la physique :
    160160c    ------------------------------------------------
    161       INTEGER ngridmx
    162       PARAMETER( ngridmx = 2+(jjm-1)*iim - 1/jjm   )
    163       REAL zcufi(ngridmx),zcvfi(ngridmx)
    164       REAL latfi(ngridmx),lonfi(ngridmx)
    165       REAL airefi(ngridmx)
    166       SAVE latfi, lonfi, airefi
    167       INTEGER i,j
     161!      INTEGER ngridmx
     162!      PARAMETER( ngridmx = 2+(jjm-1)*iim - 1/jjm   )
     163!      REAL zcufi(ngridmx),zcvfi(ngridmx)
     164!      REAL latfi(ngridmx),lonfi(ngridmx)
     165!      REAL airefi(ngridmx)
     166!      SAVE latfi, lonfi, airefi
     167!      INTEGER i,j
    168168
    169169c-----------------------------------------------------------------------
     
    183183!#ifdef CPP_PHYS
    184184      CALL init_phys_lmdz(iim,jjp1,llm,1,(/(jjm-1)*iim+2/))
    185       call initcomgeomphy
     185!      call initcomgeomphy ! now done in iniphysiq
    186186!#endif
    187187!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
     
    231231
    232232!      IF (call_iniphys.and.(iflag_phys==1.or.iflag_phys>=100)) THEN
    233          latfi(1)=rlatu(1)
    234          lonfi(1)=0.
    235          zcufi(1) = cu(1)
    236          zcvfi(1) = cv(1)
    237          DO j=2,jjm
    238             DO i=1,iim
    239                latfi((j-2)*iim+1+i)= rlatu(j)
    240                lonfi((j-2)*iim+1+i)= rlonv(i)
    241                zcufi((j-2)*iim+1+i) = cu((j-1)*iip1+i)
    242                zcvfi((j-2)*iim+1+i) = cv((j-1)*iip1+i)
    243             ENDDO
    244          ENDDO
    245          latfi(ngridmx)= rlatu(jjp1)
    246          lonfi(ngridmx)= 0.
    247          zcufi(ngridmx) = cu(ip1jm+1)
    248          zcvfi(ngridmx) = cv(ip1jm-iim)
    249 
    250          ! build airefi(), mesh area on physics grid
    251          CALL gr_dyn_fi(1,iip1,jjp1,ngridmx,aire,airefi)
    252          ! Poles are single points on physics grid
    253          airefi(1)=airefi(1)*iim
    254          airefi(ngridmx)=airefi(ngridmx)*iim
     233!         latfi(1)=rlatu(1)
     234!         lonfi(1)=0.
     235!         zcufi(1) = cu(1)
     236!         zcvfi(1) = cv(1)
     237!         DO j=2,jjm
     238!            DO i=1,iim
     239!               latfi((j-2)*iim+1+i)= rlatu(j)
     240!               lonfi((j-2)*iim+1+i)= rlonv(i)
     241!               zcufi((j-2)*iim+1+i) = cu((j-1)*iip1+i)
     242!               zcvfi((j-2)*iim+1+i) = cv((j-1)*iip1+i)
     243!            ENDDO
     244!         ENDDO
     245!         latfi(ngridmx)= rlatu(jjp1)
     246!         lonfi(ngridmx)= 0.
     247!         zcufi(ngridmx) = cu(ip1jm+1)
     248!         zcvfi(ngridmx) = cv(ip1jm-iim)
     249!
     250!         ! build airefi(), mesh area on physics grid
     251!         CALL gr_dyn_fi(1,iip1,jjp1,ngridmx,aire,airefi)
     252!         ! Poles are single points on physics grid
     253!         airefi(1)=airefi(1)*iim
     254!         airefi(ngridmx)=airefi(ngridmx)*iim
    255255
    256256! Initialisation de la physique: pose probleme quand on tourne
     
    258258! Il faut une cle CPP_PHYS
    259259!#ifdef CPP_PHYS
    260 !         CALL iniphysiq(ngridmx,llm,daysec,day_ini,dtphys/nsplit_phys,
    261          CALL iniphysiq(ngridmx,llm,daysec,day_ini,dtphys,
    262      &                latfi,lonfi,airefi,zcufi,zcvfi,rad,g,r,cpp,
     260!         CALL iniphysiq(iim,jjm,llm,daysec,day_ini,dtphys/nsplit_phys,
     261         CALL iniphysiq(iim,jjm,llm,daysec,day_ini,dtphys,
     262     &                rlatu,rlonv,aire,cu,cv,rad,g,r,cpp,
    263263     &                1)
    264264!     &                iflag_phys)
  • trunk/LMDZ.GENERIC/libf/phystd/iniphysiq.F90

    r1315 r1395  
    1 subroutine iniphysiq(ngrid,nlayer, punjours, pdayref,ptimestep,          &
    2                      plat,plon,parea,pcu,pcv,                            &
     1subroutine iniphysiq(ii,jj,nlayer,punjours, pdayref,ptimestep,           &
     2                     rlatu,rlonv,aire,cu,cv,                             &
    33                     prad,pg,pr,pcpp,iflag_phys)
    44
     
    1010                               klon_omp_end, & ! end index of local omp subgrid
    1111                               klon_mpi_begin ! start indes of columns (on local mpi grid)
    12 use comgeomphy, only : airephy, & ! physics grid area (m2)
     12
     13use comgeomphy, only : initcomgeomphy, &
     14                       airephy, & ! physics grid area (m2)
    1315                       cuphy, & ! cu coeff. (u_covariant = cu * u)
    1416                       cvphy, & ! cv coeff. (v_covariant = cv * v)
     
    2123include "dimensions.h"
    2224include "comvert.h"
     25include "iniprint.h"
    2326
    2427real,intent(in) :: prad ! radius of the planet (m)
     
    2730real,intent(in) :: pcpp ! specific heat Cp
    2831real,intent(in) :: punjours ! length (in s) of a standard day
    29 integer,intent(in) :: ngrid ! number of horizontal grid points in the physics (full grid)
     32!integer,intent(in) :: ngrid ! number of horizontal grid points in the physics (full grid)
    3033integer,intent(in) :: nlayer ! number of atmospheric layers
    31 real,intent(in) :: plat(ngrid) ! latitudes of the physics grid
    32 real,intent(in) :: plon(ngrid) ! longitudes of the physics grid
    33 real,intent(in) :: parea(klon_glo) ! area (m2)
    34 real,intent(in) :: pcu(klon_glo) ! cu coeff. (u_covariant = cu * u)
    35 real,intent(in) :: pcv(klon_glo) ! cv coeff. (v_covariant = cv * v)
     34integer,intent(in) :: ii ! number of atmospheric coulumns along longitudes
     35integer,intent(in) :: jj  ! number of atompsheric columns along latitudes
     36real,intent(in) :: rlatu(jj+1) ! latitudes of the dynamics U grid
     37real,intent(in) :: rlonv(ii+1) ! longitudes of the dynamics V grid
     38real,intent(in) :: aire(ii+1,jj+1) ! area of the dynamics grid (m2)
     39real,intent(in) :: cu((ii+1)*(jj+1)) ! cu coeff. (u_covariant = cu * u)
     40real,intent(in) :: cv((ii+1)*jj) ! cv coeff. (v_covariant = cv * v)
    3641integer,intent(in) :: pdayref ! reference day of for the simulation
    3742real,intent(in) :: ptimestep !physics time step (s)
     
    3944
    4045integer :: ibegin,iend,offset
     46integer :: i,j
    4147character(len=20) :: modname='iniphysiq'
    4248character(len=80) :: abort_message
     49real :: total_area_phy, total_area_dyn
     50
     51
     52! global array, on full physics grid:
     53real,allocatable :: latfi(:)
     54real,allocatable :: lonfi(:)
     55real,allocatable :: cufi(:)
     56real,allocatable :: cvfi(:)
     57real,allocatable :: airefi(:)
    4358
    4459IF (nlayer.NE.klev) THEN
     
    5166ENDIF
    5267
    53 IF (ngrid.NE.klon_glo) THEN
    54   write(*,*) 'STOP in ',trim(modname)
    55   write(*,*) 'Problem with dimensions :'
    56   write(*,*) 'ngrid     = ',ngrid
    57   write(*,*) 'klon   = ',klon_glo
    58   abort_message = ''
    59   CALL abort_gcm (modname,abort_message,1)
     68!IF (ngrid.NE.klon_glo) THEN
     69!  write(*,*) 'STOP in ',trim(modname)
     70!  write(*,*) 'Problem with dimensions :'
     71!  write(*,*) 'ngrid     = ',ngrid
     72!  write(*,*) 'klon   = ',klon_glo
     73!  abort_message = ''
     74!  CALL abort_gcm (modname,abort_message,1)
     75!ENDIF
     76
     77!call init_phys_lmdz(iim,jjm+1,llm,1,(/(jjm-1)*iim+2/))
     78
     79! Generate global arrays on full physics grid
     80allocate(latfi(klon_glo),lonfi(klon_glo),cufi(klon_glo),cvfi(klon_glo))
     81latfi(1)=rlatu(1)
     82lonfi(1)=0.
     83cufi(1) = cu(1)
     84cvfi(1) = cv(1)
     85DO j=2,jj
     86  DO i=1,ii
     87    latfi((j-2)*ii+1+i)= rlatu(j)
     88    lonfi((j-2)*ii+1+i)= rlonv(i)
     89    cufi((j-2)*ii+1+i) = cu((j-1)*ii+1+i)
     90    cvfi((j-2)*ii+1+i) = cv((j-1)*ii+1+i)
     91  ENDDO
     92ENDDO
     93latfi(klon_glo)= rlatu(jj+1)
     94lonfi(klon_glo)= 0.
     95cufi(klon_glo) = cu((ii+1)*jj+1)
     96cvfi(klon_glo) = cv((ii+1)*jj-ii)
     97
     98! build airefi(), mesh area on physics grid
     99allocate(airefi(klon_glo))
     100CALL gr_dyn_fi(1,ii+1,jj+1,klon_glo,aire,airefi)
     101! Poles are single points on physics grid
     102airefi(1)=sum(aire(1:ii,1))
     103airefi(klon_glo)=sum(aire(1:ii,jj+1))
     104
     105! Sanity check: do total planet area match between physics and dynamics?
     106total_area_dyn=sum(aire(1:ii,1:jj+1))
     107total_area_phy=sum(airefi(1:klon_glo))
     108IF (total_area_dyn/=total_area_phy) THEN
     109  WRITE (lunout, *) 'iniphysiq: planet total surface discrepancy !!!'
     110  WRITE (lunout, *) '     in the dynamics total_area_dyn=', total_area_dyn
     111  WRITE (lunout, *) '  but in the physics total_area_phy=', total_area_phy
     112  IF (abs(total_area_dyn-total_area_phy)>0.00001*total_area_dyn) THEN
     113    ! stop here if the relative difference is more than 0.001%
     114    abort_message = 'planet total surface discrepancy'
     115    CALL abort_gcm(modname, abort_message, 1)
     116  ENDIF
    60117ENDIF
    61118
    62 !$OMP PARALLEL PRIVATE(ibegin,iend) &
    63         !$OMP SHARED(parea,pcu,pcv,plon,plat)
    64      
     119
     120!$OMP PARALLEL
     121! Now generate local lon/lat/cu/cv/area arrays
     122call initcomgeomphy
     123
     124!!!!$OMP PARALLEL PRIVATE(ibegin,iend) &
     125!!!     !$OMP SHARED(airefi,cufi,cvfi,lonfi,latfi)
     126
    65127offset=klon_mpi_begin-1
    66 airephy(1:klon_omp)=parea(offset+klon_omp_begin:offset+klon_omp_end)
    67 cuphy(1:klon_omp)=pcu(offset+klon_omp_begin:offset+klon_omp_end)
    68 cvphy(1:klon_omp)=pcv(offset+klon_omp_begin:offset+klon_omp_end)
    69 rlond(1:klon_omp)=plon(offset+klon_omp_begin:offset+klon_omp_end)
    70 rlatd(1:klon_omp)=plat(offset+klon_omp_begin:offset+klon_omp_end)
     128airephy(1:klon_omp)=airefi(offset+klon_omp_begin:offset+klon_omp_end)
     129cuphy(1:klon_omp)=cufi(offset+klon_omp_begin:offset+klon_omp_end)
     130cvphy(1:klon_omp)=cvfi(offset+klon_omp_begin:offset+klon_omp_end)
     131rlond(1:klon_omp)=lonfi(offset+klon_omp_begin:offset+klon_omp_end)
     132rlatd(1:klon_omp)=latfi(offset+klon_omp_begin:offset+klon_omp_end)
    71133
    72134! copy over preff , ap() and bp()
  • trunk/LMDZ.GENERIC/libf/phystd/newstart.F

    r1370 r1395  
    466466      CALL gr_dyn_fi(1,iip1,jjp1,ngridmx,aire,airefi)
    467467      ! Poles are single points on physics grid
    468       airefi(1)=airefi(1)*iim
    469       airefi(ngridmx)=airefi(ngridmx)*iim
     468      airefi(1)=sum(aire(1:iim,1))
     469      airefi(ngridmx)=sum(aire(1:iim,jjm+1))
    470470
    471471! also initialize various physics flags/settings which might be needed
  • trunk/LMDZ.MARS/README

    r1382 r1395  
    21612161== 04/03/2015 == FF+EM
    21622162- Some cleanup in iniorbit.F
     2163
     2164== 12/03/2015 == EM
     2165- Some cleanup in the dynamics/physics interface.
  • trunk/LMDZ.MARS/libf/dyn3d/gcm.F

    r1130 r1395  
    55     &                       nday_r, idissip, iconser, ecritstart,
    66     &                       ecritphy
    7       use comgeomphy, only: initcomgeomphy
     7!      use comgeomphy, only: initcomgeomphy
    88      IMPLICIT NONE
    99
     
    143143c    variables pour l'initialisation de la physique :
    144144c    ------------------------------------------------
    145       INTEGER ngridmx
    146       PARAMETER( ngridmx = 2+(jjm-1)*iim - 1/jjm   )
    147       REAL zcufi(ngridmx),zcvfi(ngridmx)
    148       REAL latfi(ngridmx),lonfi(ngridmx)
    149       REAL airefi(ngridmx)
    150       SAVE latfi, lonfi, airefi
    151       INTEGER i,j
     145!      INTEGER ngridmx
     146!      PARAMETER( ngridmx = 2+(jjm-1)*iim - 1/jjm   )
     147!      REAL zcufi(ngridmx),zcvfi(ngridmx)
     148!      REAL latfi(ngridmx),lonfi(ngridmx)
     149!      REAL airefi(ngridmx)
     150!      SAVE latfi, lonfi, airefi
     151!      INTEGER i,j
    152152
    153153c-----------------------------------------------------------------------
     
    168168!#ifdef CPP_PHYS
    169169      CALL init_phys_lmdz(iim,jjp1,llm,1,(/(jjm-1)*iim+2/))
    170       call initcomgeomphy
     170!      call initcomgeomphy ! now done in iniphysiq
    171171!#endif
    172172!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
     
    227227
    228228!      IF (call_iniphys.and.(iflag_phys==1.or.iflag_phys>=100)) THEN
    229          latfi(1)=rlatu(1)
    230          lonfi(1)=0.
    231          zcufi(1) = cu(1)
    232          zcvfi(1) = cv(1)
    233          DO j=2,jjm
    234             DO i=1,iim
    235                latfi((j-2)*iim+1+i)= rlatu(j)
    236                lonfi((j-2)*iim+1+i)= rlonv(i)
    237                zcufi((j-2)*iim+1+i) = cu((j-1)*iip1+i)
    238                zcvfi((j-2)*iim+1+i) = cv((j-1)*iip1+i)
    239             ENDDO
    240          ENDDO
    241          latfi(ngridmx)= rlatu(jjp1)
    242          lonfi(ngridmx)= 0.
    243          zcufi(ngridmx) = cu(ip1jm+1)
    244          zcvfi(ngridmx) = cv(ip1jm-iim)
    245 
    246          ! build airefi(), mesh area on physics grid
    247          CALL gr_dyn_fi(1,iip1,jjp1,ngridmx,aire,airefi)
    248          ! Poles are single points on physics grid
    249          airefi(1)=airefi(1)*iim
    250          airefi(ngridmx)=airefi(ngridmx)*iim
     229!         latfi(1)=rlatu(1)
     230!         lonfi(1)=0.
     231!         zcufi(1) = cu(1)
     232!         zcvfi(1) = cv(1)
     233!         DO j=2,jjm
     234!            DO i=1,iim
     235!               latfi((j-2)*iim+1+i)= rlatu(j)
     236!               lonfi((j-2)*iim+1+i)= rlonv(i)
     237!               zcufi((j-2)*iim+1+i) = cu((j-1)*iip1+i)
     238!               zcvfi((j-2)*iim+1+i) = cv((j-1)*iip1+i)
     239!            ENDDO
     240!         ENDDO
     241!         latfi(ngridmx)= rlatu(jjp1)
     242!         lonfi(ngridmx)= 0.
     243!         zcufi(ngridmx) = cu(ip1jm+1)
     244!         zcvfi(ngridmx) = cv(ip1jm-iim)
     245!
     246!         ! build airefi(), mesh area on physics grid
     247!         CALL gr_dyn_fi(1,iip1,jjp1,ngridmx,aire,airefi)
     248!         ! Poles are single points on physics grid
     249!         airefi(1)=airefi(1)*iim
     250!         airefi(ngridmx)=airefi(ngridmx)*iim
    251251
    252252! Initialisation de la physique: pose probleme quand on tourne
     
    254254! Il faut une cle CPP_PHYS
    255255!#ifdef CPP_PHYS
    256 !         CALL iniphysiq(ngridmx,llm,daysec,day_ini,dtphys/nsplit_phys,
    257          CALL iniphysiq(ngridmx,llm,daysec,day_ini,dtphys,
    258      &                latfi,lonfi,airefi,zcufi,zcvfi,rad,g,r,cpp,
     256!         CALL iniphysiq(iim,jjm,llm,daysec,day_ini,dtphys/nsplit_phys,
     257         CALL iniphysiq(iim,jjm,llm,daysec,day_ini,dtphys,
     258     &                rlatu,rlonv,aire,cu,cv,rad,g,r,cpp,
    259259     &                1)
    260260!     &                iflag_phys)
  • trunk/LMDZ.MARS/libf/phymars/iniphysiq.F90

    r1257 r1395  
    1 subroutine iniphysiq(ngrid,nlayer, punjours, pdayref,ptimestep,          &
    2                      plat,plon,parea,pcu,pcv,                            &
     1subroutine iniphysiq(ii,jj,nlayer,punjours, pdayref,ptimestep,           &
     2                     rlatu,rlonv,aire,cu,cv,                             &
    33                     prad,pg,pr,pcpp,iflag_phys)
    44
     
    1010                               klon_omp_end, & ! end index of local omp subgrid
    1111                               klon_mpi_begin ! start indes of columns (on local mpi grid)
    12 use comgeomphy, only : airephy, & ! physics grid area (m2)
     12
     13use comgeomphy, only : initcomgeomphy, &
     14                       airephy, & ! physics grid area (m2)
    1315                       cuphy, & ! cu coeff. (u_covariant = cu * u)
    1416                       cvphy, & ! cv coeff. (v_covariant = cv * v)
     
    2022implicit none
    2123
     24include "iniprint.h"
     25
    2226real,intent(in) :: prad ! radius of the planet (m)
    2327real,intent(in) :: pg ! gravitational acceleration (m/s2)
     
    2529real,intent(in) :: pcpp ! specific heat Cp
    2630real,intent(in) :: punjours ! length (in s) of a standard day
    27 integer,intent(in) :: ngrid ! number of horizontal grid points in the physics (full grid)
     31!integer,intent(in) :: ngrid ! number of horizontal grid points in the physics (full grid)
    2832integer,intent(in) :: nlayer ! number of atmospheric layers
    29 real,intent(in) :: plat(ngrid) ! latitudes of the physics grid
    30 real,intent(in) :: plon(ngrid) ! longitudes of the physics grid
    31 real,intent(in) :: parea(klon_glo) ! area (m2)
    32 real,intent(in) :: pcu(klon_glo) ! cu coeff. (u_covariant = cu * u)
    33 real,intent(in) :: pcv(klon_glo) ! cv coeff. (v_covariant = cv * v)
     33integer,intent(in) :: ii ! number of atmospheric coulumns along longitudes
     34integer,intent(in) :: jj  ! number of atompsheric columns along latitudes
     35real,intent(in) :: rlatu(jj+1) ! latitudes of the dynamics U grid
     36real,intent(in) :: rlonv(ii+1) ! longitudes of the dynamics V grid
     37real,intent(in) :: aire(ii+1,jj+1) ! area of the dynamics grid (m2)
     38real,intent(in) :: cu((ii+1)*(jj+1)) ! cu coeff. (u_covariant = cu * u)
     39real,intent(in) :: cv((ii+1)*jj) ! cv coeff. (v_covariant = cv * v)
    3440integer,intent(in) :: pdayref ! reference day of for the simulation
    3541real,intent(in) :: ptimestep !physics time step (s)
     
    3743
    3844integer :: ibegin,iend,offset
     45integer :: i,j
    3946character(len=20) :: modname='iniphysiq'
    4047character(len=80) :: abort_message
     48real :: total_area_phy, total_area_dyn
     49
     50
     51! global array, on full physics grid:
     52real,allocatable :: latfi(:)
     53real,allocatable :: lonfi(:)
     54real,allocatable :: cufi(:)
     55real,allocatable :: cvfi(:)
     56real,allocatable :: airefi(:)
    4157
    4258IF (nlayer.NE.klev) THEN
     
    4965ENDIF
    5066
    51 IF (ngrid.NE.klon_glo) THEN
    52   write(*,*) 'STOP in ',trim(modname)
    53   write(*,*) 'Problem with dimensions :'
    54   write(*,*) 'ngrid     = ',ngrid
    55   write(*,*) 'klon   = ',klon_glo
    56   abort_message = ''
    57   CALL abort_gcm (modname,abort_message,1)
     67!IF (ngrid.NE.klon_glo) THEN
     68!  write(*,*) 'STOP in ',trim(modname)
     69!  write(*,*) 'Problem with dimensions :'
     70!  write(*,*) 'ngrid     = ',ngrid
     71!  write(*,*) 'klon   = ',klon_glo
     72!  abort_message = ''
     73!  CALL abort_gcm (modname,abort_message,1)
     74!ENDIF
     75
     76! Generate global arrays on full physics grid
     77allocate(latfi(klon_glo),lonfi(klon_glo),cufi(klon_glo),cvfi(klon_glo))
     78latfi(1)=rlatu(1)
     79lonfi(1)=0.
     80cufi(1) = cu(1)
     81cvfi(1) = cv(1)
     82DO j=2,jj
     83  DO i=1,ii
     84    latfi((j-2)*ii+1+i)= rlatu(j)
     85    lonfi((j-2)*ii+1+i)= rlonv(i)
     86    cufi((j-2)*ii+1+i) = cu((j-1)*ii+1+i)
     87    cvfi((j-2)*ii+1+i) = cv((j-1)*ii+1+i)
     88  ENDDO
     89ENDDO
     90latfi(klon_glo)= rlatu(jj+1)
     91lonfi(klon_glo)= 0.
     92cufi(klon_glo) = cu((ii+1)*jj+1)
     93cvfi(klon_glo) = cv((ii+1)*jj-ii)
     94
     95! build airefi(), mesh area on physics grid
     96allocate(airefi(klon_glo))
     97CALL gr_dyn_fi(1,ii+1,jj+1,klon_glo,aire,airefi)
     98! Poles are single points on physics grid
     99airefi(1)=sum(aire(1:ii,1))
     100airefi(klon_glo)=sum(aire(1:ii,jj+1))
     101
     102! Sanity check: do total planet area match between physics and dynamics?
     103total_area_dyn=sum(aire(1:ii,1:jj+1))
     104total_area_phy=sum(airefi(1:klon_glo))
     105IF (total_area_dyn/=total_area_phy) THEN
     106  WRITE (lunout, *) 'iniphysiq: planet total surface discrepancy !!!'
     107  WRITE (lunout, *) '     in the dynamics total_area_dyn=', total_area_dyn
     108  WRITE (lunout, *) '  but in the physics total_area_phy=', total_area_phy
     109  IF (abs(total_area_dyn-total_area_phy)>0.00001*total_area_dyn) THEN
     110    ! stop here if the relative difference is more than 0.001%
     111    abort_message = 'planet total surface discrepancy'
     112    CALL abort_gcm(modname, abort_message, 1)
     113  ENDIF
    58114ENDIF
    59115
    60 !$OMP PARALLEL PRIVATE(ibegin,iend)
    61 !$OMP+         SHARED(parea,pcu,pcv,plon,plat)
     116
     117
     118!$OMP PARALLEL
     119! Now generate local lon/lat/cu/cv/area arrays
     120call initcomgeomphy
     121
     122!!!!$OMP PARALLEL PRIVATE(ibegin,iend)
     123!!!$OMP+         SHARED(parea,pcu,pcv,plon,plat)
    62124     
    63125offset=klon_mpi_begin-1
    64 airephy(1:klon_omp)=parea(offset+klon_omp_begin:offset+klon_omp_end)
    65 cuphy(1:klon_omp)=pcu(offset+klon_omp_begin:offset+klon_omp_end)
    66 cvphy(1:klon_omp)=pcv(offset+klon_omp_begin:offset+klon_omp_end)
    67 rlond(1:klon_omp)=plon(offset+klon_omp_begin:offset+klon_omp_end)
    68 rlatd(1:klon_omp)=plat(offset+klon_omp_begin:offset+klon_omp_end)
     126airephy(1:klon_omp)=airefi(offset+klon_omp_begin:offset+klon_omp_end)
     127cuphy(1:klon_omp)=cufi(offset+klon_omp_begin:offset+klon_omp_end)
     128cvphy(1:klon_omp)=cvfi(offset+klon_omp_begin:offset+klon_omp_end)
     129rlond(1:klon_omp)=lonfi(offset+klon_omp_begin:offset+klon_omp_end)
     130rlatd(1:klon_omp)=latfi(offset+klon_omp_begin:offset+klon_omp_end)
    69131
    70132! copy some fundamental parameters to physics
  • trunk/LMDZ.MARS/libf/phymars/newstart.F

    r1390 r1395  
    366366      CALL gr_dyn_fi(1,iip1,jjp1,ngridmx,aire,airefi)
    367367      ! Poles are single points on physics grid
    368       airefi(1)=airefi(1)*iim
    369       airefi(ngridmx)=airefi(ngridmx)*iim
     368      airefi(1)=sum(aire(1:iim,1))
     369      airefi(ngridmx)=sum(aire(1:iim,jjm+1))
    370370
    371371! also initialize various physics flags/settings which might be needed
  • trunk/LMDZ.TITAN/libf/phytitan/iniphysiq.F90

    r1394 r1395  
    1 !
    2 ! $Header: /home/cvsroot/LMDZ4/libf/phylmd/iniphysiq.F,v 1.1.1.1 2004/05/19 12:53:08 lmdzadmin Exp $
    3 !
    4 c
    5 c
    6       SUBROUTINE iniphysiq(ngrid,nlayer,
    7      $           punjours,
    8      $           pdayref,ptimestep,
    9      $           plat,plon,parea,pcu,pcv,
    10      $           prad,pg,pr,pcpp,iflag_phys)
    111
    12 c
    13 c=======================================================================
    14 c
    15 c   subject:
    16 c   --------
    17 c
    18 c   Initialisation for the physical parametrisations of the LMD
    19 c   martian atmospheric general circulation modele.
    20 c
    21 c   author: Frederic Hourdin 15 / 10 /93
    22 c   -------
    23 c
    24 c   arguments:
    25 c   ----------
    26 c
    27 c   input:
    28 c   ------
    29 c
    30 c    ngrid                 Size of the horizontal grid.
    31 c                          All internal loops are performed on that grid.
    32 c    nlayer                Number of vertical layers.
    33 c    pdayref               Day of reference for the simulation
    34 c    firstcall             True at the first call
    35 c    lastcall              True at the last call
    36 c    pday                  Number of days counted from the North. Spring
    37 c                          equinoxe.
    38 c
    39 c=======================================================================
    40 c
    41 c-----------------------------------------------------------------------
    42 c   declarations:
    43 c   -------------
    44  
    45       USE dimphy, only : klev
    46       USE mod_grid_phy_lmdz, only : klon_glo
    47       USE mod_phys_lmdz_para, only : klon_omp,klon_omp_begin,
    48      &                               klon_omp_end,klon_mpi_begin
    49       USE comgeomphy, only : airephy,cuphy,cvphy,rlond,rlatd
    50       IMPLICIT NONE
    51 #include "iniprint.h"
     2! $Id: iniphysiq.F90 2225 2015-03-11 14:55:23Z emillour $
    523
    53       REAL,INTENT(IN) :: prad ! radius of the planet (m)
    54       REAL,INTENT(IN) :: pg ! gravitational acceleration (m/s2)
    55       REAL,INTENT(IN) :: pr ! ! reduced gas constant R/mu
    56       REAL,INTENT(IN) :: pcpp ! specific heat Cp
    57       REAL,INTENT(IN) :: punjours ! length (in s) of a standard day
    58       INTEGER,INTENT(IN) :: ngrid ! number of horizontal grid points in the physics
    59       INTEGER,INTENT(IN) :: nlayer ! number of atmospheric layers
    60       REAL,INTENT(IN) :: plat(ngrid) ! latitudes of the physics grid
    61       REAL,INTENT(IN) :: plon(ngrid) ! longitudes of the physics grid
    62       REAL,INTENT(IN) :: parea(klon_glo) ! area (m2)
    63       REAL,INTENT(IN) :: pcu(klon_glo) ! cu coeff. (u_covariant = cu * u)
    64       REAL,INTENT(IN) :: pcv(klon_glo) ! cv coeff. (v_covariant = cv * v)
    65       INTEGER,INTENT(IN) :: pdayref ! reference day of for the simulation
    66       REAL,INTENT(IN) :: ptimestep !physics time step (s)
    67       INTEGER,INTENT(IN) :: iflag_phys ! type of physics to be called
    684
    69       INTEGER :: ibegin,iend,offset
    70       CHARACTER (LEN=20) :: modname='iniphysiq'
    71       CHARACTER (LEN=80) :: abort_message
    72  
    73       IF (nlayer.NE.klev) THEN
    74          write(lunout,*) 'STOP in ',trim(modname)
    75          write(lunout,*) 'Problem with dimensions :'
    76          write(lunout,*) 'nlayer     = ',nlayer
    77          write(lunout,*) 'klev   = ',klev
    78          abort_message = ''
    79          CALL abort_gcm (modname,abort_message,1)
     5SUBROUTINE iniphysiq(iim,jjm,nlayer,punjours, pdayref,ptimestep,         &
     6                     rlatu,rlonv,aire,cu,cv,                             &
     7                     prad,pg,pr,pcpp,iflag_phys)
     8  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)
     11  USE mod_phys_lmdz_para, ONLY: klon_omp, & ! number of columns (on local omp grid)
     12                                klon_omp_begin, & ! start index of local omp subgrid
     13                                klon_omp_end, & ! end index of local omp subgrid
     14                                klon_mpi_begin ! start indes of columns (on local mpi grid)
     15  USE comgeomphy, ONLY: initcomgeomphy, &
     16                        airephy, & ! physics grid area (m2)
     17                        cuphy, & ! cu coeff. (u_covariant = cu * u)
     18                        cvphy, & ! cv coeff. (v_covariant = cv * v)
     19                        rlond, & ! longitudes
     20                        rlatd ! latitudes
     21  IMPLICIT NONE
     22
     23  ! =======================================================================
     24  ! Initialisation of the physical constants and some positional and
     25  ! geometrical arrays for the physics
     26  ! =======================================================================
     27
     28  include "YOMCST.h"
     29  include "iniprint.h"
     30
     31  REAL, INTENT (IN) :: prad ! radius of the planet (m)
     32  REAL, INTENT (IN) :: pg ! gravitational acceleration (m/s2)
     33  REAL, INTENT (IN) :: pr ! ! reduced gas constant R/mu
     34  REAL, INTENT (IN) :: pcpp ! specific heat Cp
     35  REAL, INTENT (IN) :: punjours ! length (in s) of a standard day
     36  INTEGER, INTENT (IN) :: nlayer ! number of atmospheric layers
     37  INTEGER, INTENT (IN) :: iim ! number of atmospheric columns along longitudes
     38  INTEGER, INTENT (IN) :: jjm ! number of atompsheric columns along latitudes
     39  REAL, INTENT (IN) :: rlatu(jjm+1) ! latitudes of the physics grid
     40  REAL, INTENT (IN) :: rlonv(iim+1) ! longitudes of the physics grid
     41  REAL, INTENT (IN) :: aire(iim+1,jjm+1) ! area of the dynamics grid (m2)
     42  REAL, INTENT (IN) :: cu((iim+1)*(jjm+1)) ! cu coeff. (u_covariant = cu * u)
     43  REAL, INTENT (IN) :: cv((iim+1)*jjm) ! cv coeff. (v_covariant = cv * v)
     44  INTEGER, INTENT (IN) :: pdayref ! reference day of for the simulation
     45  REAL, INTENT (IN) :: ptimestep !physics time step (s)
     46  INTEGER, INTENT (IN) :: iflag_phys ! type of physics to be called
     47
     48  INTEGER :: ibegin, iend, offset
     49  INTEGER :: i,j
     50  CHARACTER (LEN=20) :: modname = 'iniphysiq'
     51  CHARACTER (LEN=80) :: abort_message
     52  REAL :: total_area_phy, total_area_dyn
     53
     54
     55  ! global array, on full physics grid:
     56  REAL,ALLOCATABLE :: latfi(:)
     57  REAL,ALLOCATABLE :: lonfi(:)
     58  REAL,ALLOCATABLE :: cufi(:)
     59  REAL,ALLOCATABLE :: cvfi(:)
     60  REAL,ALLOCATABLE :: airefi(:)
     61
     62  IF (nlayer/=klev) THEN
     63    WRITE (lunout, *) 'STOP in ', trim(modname)
     64    WRITE (lunout, *) 'Problem with dimensions :'
     65    WRITE (lunout, *) 'nlayer     = ', nlayer
     66    WRITE (lunout, *) 'klev   = ', klev
     67    abort_message = ''
     68    CALL abort_gcm(modname, abort_message, 1)
     69  END IF
     70
     71  !call init_phys_lmdz(iim,jjm+1,llm,1,(/(jjm-1)*iim+2/))
     72 
     73  ! Generate global arrays on full physics grid
     74  ALLOCATE(latfi(klon_glo),lonfi(klon_glo),cufi(klon_glo),cvfi(klon_glo))
     75  ALLOCATE(airefi(klon_glo))
     76
     77  IF (klon_glo>1) THEN ! general case
     78    ! North pole
     79    latfi(1)=rlatu(1)
     80    lonfi(1)=0.
     81    cufi(1) = cu(1)
     82    cvfi(1) = cv(1)
     83    DO j=2,jjm
     84      DO i=1,iim
     85        latfi((j-2)*iim+1+i)= rlatu(j)
     86        lonfi((j-2)*iim+1+i)= rlonv(i)
     87        cufi((j-2)*iim+1+i) = cu((j-1)*iim+1+i)
     88        cvfi((j-2)*iim+1+i) = cv((j-1)*iim+1+i)
     89      ENDDO
     90    ENDDO
     91    ! South pole
     92    latfi(klon_glo)= rlatu(jjm+1)
     93    lonfi(klon_glo)= 0.
     94    cufi(klon_glo) = cu((iim+1)*jjm+1)
     95    cvfi(klon_glo) = cv((iim+1)*jjm-iim)
     96
     97    ! build airefi(), mesh area on physics grid
     98    CALL gr_dyn_fi(1,iim+1,jjm+1,klon_glo,aire,airefi)
     99    ! Poles are single points on physics grid
     100    airefi(1)=sum(aire(1:iim,1))
     101    airefi(klon_glo)=sum(aire(1:iim,jjm+1))
     102
     103    ! Sanity check: do total planet area match between physics and dynamics?
     104    total_area_dyn=sum(aire(1:iim,1:jjm+1))
     105    total_area_phy=sum(airefi(1:klon_glo))
     106    IF (total_area_dyn/=total_area_phy) THEN
     107      WRITE (lunout, *) 'iniphysiq: planet total surface discrepancy !!!'
     108      WRITE (lunout, *) '     in the dynamics total_area_dyn=', total_area_dyn
     109      WRITE (lunout, *) '  but in the physics total_area_phy=', total_area_phy
     110      IF (abs(total_area_dyn-total_area_phy)>0.00001*total_area_dyn) THEN
     111        ! stop here if the relative difference is more than 0.001%
     112        abort_message = 'planet total surface discrepancy'
     113        CALL abort_gcm(modname, abort_message, 1)
    80114      ENDIF
     115    ENDIF
     116  ELSE ! klon_glo==1, running the 1D model
     117    ! just copy over input values
     118    latfi(1)=rlatu(1)
     119    lonfi(1)=rlonv(1)
     120    cufi(1)=cu(1)
     121    cvfi(1)=cv(1)
     122    airefi(1)=aire(1,1)
     123  ENDIF ! of IF (klon_glo>1)
    81124
    82       IF (ngrid.NE.klon_glo) THEN
    83          write(lunout,*) 'STOP in ',trim(modname)
    84          write(lunout,*) 'Problem with dimensions :'
    85          write(lunout,*) 'ngrid     = ',ngrid
    86          write(lunout,*) 'klon   = ',klon_glo
    87          abort_message = ''
    88          CALL abort_gcm (modname,abort_message,1)
    89       ENDIF
     125!$OMP PARALLEL
     126  ! Now generate local lon/lat/cu/cv/area arrays
     127  CALL initcomgeomphy
    90128
    91 c$OMP PARALLEL PRIVATE(ibegin,iend)
    92 c$OMP+         SHARED(parea,pcu,pcv,plon,plat)
    93      
    94       offset=klon_mpi_begin-1
    95       airephy(1:klon_omp)=parea(offset+klon_omp_begin:
    96      &                          offset+klon_omp_end)
    97       cuphy(1:klon_omp)=pcu(offset+klon_omp_begin:offset+klon_omp_end)
    98       cvphy(1:klon_omp)=pcv(offset+klon_omp_begin:offset+klon_omp_end)
    99       rlond(1:klon_omp)=plon(offset+klon_omp_begin:offset+klon_omp_end)
    100       rlatd(1:klon_omp)=plat(offset+klon_omp_begin:offset+klon_omp_end)
     129  offset = klon_mpi_begin - 1
     130  airephy(1:klon_omp) = airefi(offset+klon_omp_begin:offset+klon_omp_end)
     131  cuphy(1:klon_omp) = cufi(offset+klon_omp_begin:offset+klon_omp_end)
     132  cvphy(1:klon_omp) = cvfi(offset+klon_omp_begin:offset+klon_omp_end)
     133  rlond(1:klon_omp) = lonfi(offset+klon_omp_begin:offset+klon_omp_end)
     134  rlatd(1:klon_omp) = latfi(offset+klon_omp_begin:offset+klon_omp_end)
    101135
    102       call suphec
     136  ! Initialize some physical constants
     137  call suphec
    103138
    104 c$OMP END PARALLEL
     139!$OMP END PARALLEL
    105140
    106 c     print*,'ATTENTION !!! TRAVAILLER SUR INIPHYSIQ'
    107 c     print*,'CONTROLE DES LATITUDES, LONGITUDES, PARAMETRES ...'
     141  ! check that physical constants set in 'suphec' are coherent
     142  ! with values set in the dynamics:
     143  IF (rday/=punjours) THEN
     144    WRITE (lunout, *) 'iniphysiq: length of day discrepancy!!!'
     145    WRITE (lunout, *) '  in the dynamics punjours=', punjours
     146    WRITE (lunout, *) '   but in the physics RDAY=', rday
     147    IF (abs(rday-punjours)>0.01*punjour) THEN
     148        ! stop here if the relative difference is more than 1%
     149      abort_message = 'length of day discrepancy'
     150      CALL abort_gcm(modname, abort_message, 1)
     151    END IF
     152  END IF
    108153
    109 c      print*,'agagagagagagagagaga'
    110 c      print*,'klon_mpi_begin =', klon_mpi_begin
    111 c      print*,'klon_mpi_end =', klon_mpi_end
    112 c      print*,'klon_mpi =', klon_mpi
    113 c      print*,'klon_mpi_para_nb =', klon_mpi_para_nb
    114 c      print*,'klon_mpi_para_begin =', klon_mpi_para_begin
    115 c      print*,'klon_mpi_para_end  =', klon_mpi_para_end
    116 c      print*,'mpi_rank =', mpi_rank
    117 c      print*,'mpi_size =', mpi_size
    118 c      print*,'mpi_root =', mpi_root
    119 c      print*,'klon_glo =', klon_glo
    120 c      print*,'is_mpi_root =',is_mpi_root
    121 c      print*,'is_omp_root =',is_omp_root
     154  IF (rg/=pg) THEN
     155    WRITE (lunout, *) 'iniphysiq: gravity discrepancy !!!'
     156    WRITE (lunout, *) '     in the dynamics pg=', pg
     157    WRITE (lunout, *) '  but in the physics RG=', rg
     158    IF (abs(rg-pg)>0.01*pg) THEN
     159        ! stop here if the relative difference is more than 1%
     160      abort_message = 'gravity discrepancy'
     161      CALL abort_gcm(modname, abort_message, 1)
     162    END IF
     163  END IF
     164  IF (ra/=prad) THEN
     165    WRITE (lunout, *) 'iniphysiq: planet radius discrepancy !!!'
     166    WRITE (lunout, *) '   in the dynamics prad=', prad
     167    WRITE (lunout, *) '  but in the physics RA=', ra
     168    IF (abs(ra-prad)>0.01*prad) THEN
     169        ! stop here if the relative difference is more than 1%
     170      abort_message = 'planet radius discrepancy'
     171      CALL abort_gcm(modname, abort_message, 1)
     172    END IF
     173  END IF
     174  IF (rd/=pr) THEN
     175    WRITE (lunout, *) 'iniphysiq: reduced gas constant discrepancy !!!'
     176    WRITE (lunout, *) '     in the dynamics pr=', pr
     177    WRITE (lunout, *) '  but in the physics RD=', rd
     178    IF (abs(rd-pr)>0.01*pr) THEN
     179        ! stop here if the relative difference is more than 1%
     180      abort_message = 'reduced gas constant discrepancy'
     181      CALL abort_gcm(modname, abort_message, 1)
     182    END IF
     183  END IF
     184  IF (rcpd/=pcpp) THEN
     185    WRITE (lunout, *) 'iniphysiq: specific heat discrepancy !!!'
     186    WRITE (lunout, *) '     in the dynamics pcpp=', pcpp
     187    WRITE (lunout, *) '  but in the physics RCPD=', rcpd
     188    IF (abs(rcpd-pcpp)>0.01*pcpp) THEN
     189        ! stop here if the relative difference is more than 1%
     190      abort_message = 'specific heat discrepancy'
     191      CALL abort_gcm(modname, abort_message, 1)
     192    END IF
     193  END IF
    122194
    123 ! pas d'inifis ici...
    124 ! est-ce que cursor est utile ? Voir avec Aymeric
    125 !      cursor = klon_mpi_begin
    126 !      print*, "CURSOR !!!!", mpi_rank, cursor
    127 
    128       RETURN
    129       END
     195END SUBROUTINE iniphysiq
  • trunk/LMDZ.TITAN/libf/phytitan/rcm1d.F

    r1300 r1395  
    205205      phisfi(1)=0.E+0
    206206
    207       CALL iniphysiq(1,llm,daysec,day0,dtphys,
    208      .            lati,long,area,cufi,cvfi,rad,g,r,cpp)
     207      CALL iniphysiq(1,1,llm,daysec,day0,dtphys,
     208     .            lati,long,area,cufi,cvfi,rad,g,r,cpp,1)
    209209
    210210c   Initialisation pour prendre en compte les vents en 1-D
  • trunk/LMDZ.VENUS/libf/phyvenus/iniphysiq.F90

    r1394 r1395  
    1 !
    2 ! $Header: /home/cvsroot/LMDZ4/libf/phylmd/iniphysiq.F,v 1.1.1.1 2004/05/19 12:53:08 lmdzadmin Exp $
    3 !
    4 c
    5 c
    6       SUBROUTINE iniphysiq(ngrid,nlayer,
    7      $           punjours,
    8      $           pdayref,ptimestep,
    9      $           plat,plon,parea,pcu,pcv,
    10      $           prad,pg,pr,pcpp,iflag_phys)
    111
    12 c
    13 c=======================================================================
    14 c
    15 c   subject:
    16 c   --------
    17 c
    18 c   Initialisation for the physical parametrisations of the LMD
    19 c   martian atmospheric general circulation modele.
    20 c
    21 c   author: Frederic Hourdin 15 / 10 /93
    22 c   -------
    23 c
    24 c   arguments:
    25 c   ----------
    26 c
    27 c   input:
    28 c   ------
    29 c
    30 c    ngrid                 Size of the horizontal grid.
    31 c                          All internal loops are performed on that grid.
    32 c    nlayer                Number of vertical layers.
    33 c    pdayref               Day of reference for the simulation
    34 c    firstcall             True at the first call
    35 c    lastcall              True at the last call
    36 c    pday                  Number of days counted from the North. Spring
    37 c                          equinoxe.
    38 c
    39 c=======================================================================
    40 c
    41 c-----------------------------------------------------------------------
    42 c   declarations:
    43 c   -------------
    44  
    45       USE dimphy, only : klev
    46       USE mod_grid_phy_lmdz, only : klon_glo
    47       USE mod_phys_lmdz_para, only : klon_omp,klon_omp_begin,
    48      &                               klon_omp_end,klon_mpi_begin
    49       USE comgeomphy, only : airephy,cuphy,cvphy,rlond,rlatd
    50       IMPLICIT NONE
    51 #include "iniprint.h"
     2! $Id: iniphysiq.F90 2225 2015-03-11 14:55:23Z emillour $
    523
    53       REAL,INTENT(IN) :: prad ! radius of the planet (m)
    54       REAL,INTENT(IN) :: pg ! gravitational acceleration (m/s2)
    55       REAL,INTENT(IN) :: pr ! ! reduced gas constant R/mu
    56       REAL,INTENT(IN) :: pcpp ! specific heat Cp
    57       REAL,INTENT(IN) :: punjours ! length (in s) of a standard day
    58       INTEGER,INTENT(IN) :: ngrid ! number of horizontal grid points in the physics
    59       INTEGER,INTENT(IN) :: nlayer ! number of atmospheric layers
    60       REAL,INTENT(IN) :: plat(ngrid) ! latitudes of the physics grid
    61       REAL,INTENT(IN) :: plon(ngrid) ! longitudes of the physics grid
    62       REAL,INTENT(IN) :: parea(klon_glo) ! area (m2)
    63       REAL,INTENT(IN) :: pcu(klon_glo) ! cu coeff. (u_covariant = cu * u)
    64       REAL,INTENT(IN) :: pcv(klon_glo) ! cv coeff. (v_covariant = cv * v)
    65       INTEGER,INTENT(IN) :: pdayref ! reference day of for the simulation
    66       REAL,INTENT(IN) :: ptimestep !physics time step (s)
    67       INTEGER,INTENT(IN) :: iflag_phys ! type of physics to be called
    684
    69       INTEGER :: ibegin,iend,offset
    70       CHARACTER (LEN=20) :: modname='iniphysiq'
    71       CHARACTER (LEN=80) :: abort_message
    72  
    73       IF (nlayer.NE.klev) THEN
    74          write(lunout,*) 'STOP in ',trim(modname)
    75          write(lunout,*) 'Problem with dimensions :'
    76          write(lunout,*) 'nlayer     = ',nlayer
    77          write(lunout,*) 'klev   = ',klev
    78          abort_message = ''
    79          CALL abort_gcm (modname,abort_message,1)
     5SUBROUTINE iniphysiq(iim,jjm,nlayer,punjours, pdayref,ptimestep,         &
     6                     rlatu,rlonv,aire,cu,cv,                             &
     7                     prad,pg,pr,pcpp,iflag_phys)
     8  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)
     11  USE mod_phys_lmdz_para, ONLY: klon_omp, & ! number of columns (on local omp grid)
     12                                klon_omp_begin, & ! start index of local omp subgrid
     13                                klon_omp_end, & ! end index of local omp subgrid
     14                                klon_mpi_begin ! start indes of columns (on local mpi grid)
     15  USE comgeomphy, ONLY: initcomgeomphy, &
     16                        airephy, & ! physics grid area (m2)
     17                        cuphy, & ! cu coeff. (u_covariant = cu * u)
     18                        cvphy, & ! cv coeff. (v_covariant = cv * v)
     19                        rlond, & ! longitudes
     20                        rlatd ! latitudes
     21  IMPLICIT NONE
     22
     23  ! =======================================================================
     24  ! Initialisation of the physical constants and some positional and
     25  ! geometrical arrays for the physics
     26  ! =======================================================================
     27
     28  include "YOMCST.h"
     29  include "iniprint.h"
     30
     31  REAL, INTENT (IN) :: prad ! radius of the planet (m)
     32  REAL, INTENT (IN) :: pg ! gravitational acceleration (m/s2)
     33  REAL, INTENT (IN) :: pr ! ! reduced gas constant R/mu
     34  REAL, INTENT (IN) :: pcpp ! specific heat Cp
     35  REAL, INTENT (IN) :: punjours ! length (in s) of a standard day
     36  INTEGER, INTENT (IN) :: nlayer ! number of atmospheric layers
     37  INTEGER, INTENT (IN) :: iim ! number of atmospheric columns along longitudes
     38  INTEGER, INTENT (IN) :: jjm ! number of atompsheric columns along latitudes
     39  REAL, INTENT (IN) :: rlatu(jjm+1) ! latitudes of the physics grid
     40  REAL, INTENT (IN) :: rlonv(iim+1) ! longitudes of the physics grid
     41  REAL, INTENT (IN) :: aire(iim+1,jjm+1) ! area of the dynamics grid (m2)
     42  REAL, INTENT (IN) :: cu((iim+1)*(jjm+1)) ! cu coeff. (u_covariant = cu * u)
     43  REAL, INTENT (IN) :: cv((iim+1)*jjm) ! cv coeff. (v_covariant = cv * v)
     44  INTEGER, INTENT (IN) :: pdayref ! reference day of for the simulation
     45  REAL, INTENT (IN) :: ptimestep !physics time step (s)
     46  INTEGER, INTENT (IN) :: iflag_phys ! type of physics to be called
     47
     48  INTEGER :: ibegin, iend, offset
     49  INTEGER :: i,j
     50  CHARACTER (LEN=20) :: modname = 'iniphysiq'
     51  CHARACTER (LEN=80) :: abort_message
     52  REAL :: total_area_phy, total_area_dyn
     53
     54
     55  ! global array, on full physics grid:
     56  REAL,ALLOCATABLE :: latfi(:)
     57  REAL,ALLOCATABLE :: lonfi(:)
     58  REAL,ALLOCATABLE :: cufi(:)
     59  REAL,ALLOCATABLE :: cvfi(:)
     60  REAL,ALLOCATABLE :: airefi(:)
     61
     62  IF (nlayer/=klev) THEN
     63    WRITE (lunout, *) 'STOP in ', trim(modname)
     64    WRITE (lunout, *) 'Problem with dimensions :'
     65    WRITE (lunout, *) 'nlayer     = ', nlayer
     66    WRITE (lunout, *) 'klev   = ', klev
     67    abort_message = ''
     68    CALL abort_gcm(modname, abort_message, 1)
     69  END IF
     70
     71  !call init_phys_lmdz(iim,jjm+1,llm,1,(/(jjm-1)*iim+2/))
     72 
     73  ! Generate global arrays on full physics grid
     74  ALLOCATE(latfi(klon_glo),lonfi(klon_glo),cufi(klon_glo),cvfi(klon_glo))
     75  ALLOCATE(airefi(klon_glo))
     76
     77  IF (klon_glo>1) THEN ! general case
     78    ! North pole
     79    latfi(1)=rlatu(1)
     80    lonfi(1)=0.
     81    cufi(1) = cu(1)
     82    cvfi(1) = cv(1)
     83    DO j=2,jjm
     84      DO i=1,iim
     85        latfi((j-2)*iim+1+i)= rlatu(j)
     86        lonfi((j-2)*iim+1+i)= rlonv(i)
     87        cufi((j-2)*iim+1+i) = cu((j-1)*iim+1+i)
     88        cvfi((j-2)*iim+1+i) = cv((j-1)*iim+1+i)
     89      ENDDO
     90    ENDDO
     91    ! South pole
     92    latfi(klon_glo)= rlatu(jjm+1)
     93    lonfi(klon_glo)= 0.
     94    cufi(klon_glo) = cu((iim+1)*jjm+1)
     95    cvfi(klon_glo) = cv((iim+1)*jjm-iim)
     96
     97    ! build airefi(), mesh area on physics grid
     98    CALL gr_dyn_fi(1,iim+1,jjm+1,klon_glo,aire,airefi)
     99    ! Poles are single points on physics grid
     100    airefi(1)=sum(aire(1:iim,1))
     101    airefi(klon_glo)=sum(aire(1:iim,jjm+1))
     102
     103    ! Sanity check: do total planet area match between physics and dynamics?
     104    total_area_dyn=sum(aire(1:iim,1:jjm+1))
     105    total_area_phy=sum(airefi(1:klon_glo))
     106    IF (total_area_dyn/=total_area_phy) THEN
     107      WRITE (lunout, *) 'iniphysiq: planet total surface discrepancy !!!'
     108      WRITE (lunout, *) '     in the dynamics total_area_dyn=', total_area_dyn
     109      WRITE (lunout, *) '  but in the physics total_area_phy=', total_area_phy
     110      IF (abs(total_area_dyn-total_area_phy)>0.00001*total_area_dyn) THEN
     111        ! stop here if the relative difference is more than 0.001%
     112        abort_message = 'planet total surface discrepancy'
     113        CALL abort_gcm(modname, abort_message, 1)
    80114      ENDIF
     115    ENDIF
     116  ELSE ! klon_glo==1, running the 1D model
     117    ! just copy over input values
     118    latfi(1)=rlatu(1)
     119    lonfi(1)=rlonv(1)
     120    cufi(1)=cu(1)
     121    cvfi(1)=cv(1)
     122    airefi(1)=aire(1,1)
     123  ENDIF ! of IF (klon_glo>1)
    81124
    82       IF (ngrid.NE.klon_glo) THEN
    83          write(lunout,*) 'STOP in ',trim(modname)
    84          write(lunout,*) 'Problem with dimensions :'
    85          write(lunout,*) 'ngrid     = ',ngrid
    86          write(lunout,*) 'klon   = ',klon_glo
    87          abort_message = ''
    88          CALL abort_gcm (modname,abort_message,1)
    89       ENDIF
     125!$OMP PARALLEL
     126  ! Now generate local lon/lat/cu/cv/area arrays
     127  CALL initcomgeomphy
    90128
    91 c$OMP PARALLEL PRIVATE(ibegin,iend)
    92 c$OMP+         SHARED(parea,pcu,pcv,plon,plat)
    93      
    94       offset=klon_mpi_begin-1
    95       airephy(1:klon_omp)=parea(offset+klon_omp_begin:
    96      &                          offset+klon_omp_end)
    97       cuphy(1:klon_omp)=pcu(offset+klon_omp_begin:offset+klon_omp_end)
    98       cvphy(1:klon_omp)=pcv(offset+klon_omp_begin:offset+klon_omp_end)
    99       rlond(1:klon_omp)=plon(offset+klon_omp_begin:offset+klon_omp_end)
    100       rlatd(1:klon_omp)=plat(offset+klon_omp_begin:offset+klon_omp_end)
     129  offset = klon_mpi_begin - 1
     130  airephy(1:klon_omp) = airefi(offset+klon_omp_begin:offset+klon_omp_end)
     131  cuphy(1:klon_omp) = cufi(offset+klon_omp_begin:offset+klon_omp_end)
     132  cvphy(1:klon_omp) = cvfi(offset+klon_omp_begin:offset+klon_omp_end)
     133  rlond(1:klon_omp) = lonfi(offset+klon_omp_begin:offset+klon_omp_end)
     134  rlatd(1:klon_omp) = latfi(offset+klon_omp_begin:offset+klon_omp_end)
    101135
    102       call suphec
     136  ! Initialize some physical constants
     137  call suphec
    103138
    104 c$OMP END PARALLEL
     139!$OMP END PARALLEL
    105140
    106 c     print*,'ATTENTION !!! TRAVAILLER SUR INIPHYSIQ'
    107 c     print*,'CONTROLE DES LATITUDES, LONGITUDES, PARAMETRES ...'
     141  ! check that physical constants set in 'suphec' are coherent
     142  ! with values set in the dynamics:
     143  IF (rday/=punjours) THEN
     144    WRITE (lunout, *) 'iniphysiq: length of day discrepancy!!!'
     145    WRITE (lunout, *) '  in the dynamics punjours=', punjours
     146    WRITE (lunout, *) '   but in the physics RDAY=', rday
     147    IF (abs(rday-punjours)>0.01*punjour) THEN
     148        ! stop here if the relative difference is more than 1%
     149      abort_message = 'length of day discrepancy'
     150      CALL abort_gcm(modname, abort_message, 1)
     151    END IF
     152  END IF
    108153
    109 c      print*,'agagagagagagagagaga'
    110 c      print*,'klon_mpi_begin =', klon_mpi_begin
    111 c      print*,'klon_mpi_end =', klon_mpi_end
    112 c      print*,'klon_mpi =', klon_mpi
    113 c      print*,'klon_mpi_para_nb =', klon_mpi_para_nb
    114 c      print*,'klon_mpi_para_begin =', klon_mpi_para_begin
    115 c      print*,'klon_mpi_para_end  =', klon_mpi_para_end
    116 c      print*,'mpi_rank =', mpi_rank
    117 c      print*,'mpi_size =', mpi_size
    118 c      print*,'mpi_root =', mpi_root
    119 c      print*,'klon_glo =', klon_glo
    120 c      print*,'is_mpi_root =',is_mpi_root
    121 c      print*,'is_omp_root =',is_omp_root
     154  IF (rg/=pg) THEN
     155    WRITE (lunout, *) 'iniphysiq: gravity discrepancy !!!'
     156    WRITE (lunout, *) '     in the dynamics pg=', pg
     157    WRITE (lunout, *) '  but in the physics RG=', rg
     158    IF (abs(rg-pg)>0.01*pg) THEN
     159        ! stop here if the relative difference is more than 1%
     160      abort_message = 'gravity discrepancy'
     161      CALL abort_gcm(modname, abort_message, 1)
     162    END IF
     163  END IF
     164  IF (ra/=prad) THEN
     165    WRITE (lunout, *) 'iniphysiq: planet radius discrepancy !!!'
     166    WRITE (lunout, *) '   in the dynamics prad=', prad
     167    WRITE (lunout, *) '  but in the physics RA=', ra
     168    IF (abs(ra-prad)>0.01*prad) THEN
     169        ! stop here if the relative difference is more than 1%
     170      abort_message = 'planet radius discrepancy'
     171      CALL abort_gcm(modname, abort_message, 1)
     172    END IF
     173  END IF
     174  IF (rd/=pr) THEN
     175    WRITE (lunout, *) 'iniphysiq: reduced gas constant discrepancy !!!'
     176    WRITE (lunout, *) '     in the dynamics pr=', pr
     177    WRITE (lunout, *) '  but in the physics RD=', rd
     178    IF (abs(rd-pr)>0.01*pr) THEN
     179        ! stop here if the relative difference is more than 1%
     180      abort_message = 'reduced gas constant discrepancy'
     181      CALL abort_gcm(modname, abort_message, 1)
     182    END IF
     183  END IF
     184  IF (rcpd/=pcpp) THEN
     185    WRITE (lunout, *) 'iniphysiq: specific heat discrepancy !!!'
     186    WRITE (lunout, *) '     in the dynamics pcpp=', pcpp
     187    WRITE (lunout, *) '  but in the physics RCPD=', rcpd
     188    IF (abs(rcpd-pcpp)>0.01*pcpp) THEN
     189        ! stop here if the relative difference is more than 1%
     190      abort_message = 'specific heat discrepancy'
     191      CALL abort_gcm(modname, abort_message, 1)
     192    END IF
     193  END IF
    122194
    123 ! pas d'inifis ici...
    124 ! est-ce que cursor est utile ? Voir avec Aymeric
    125 !      cursor = klon_mpi_begin
    126 !      print*, "CURSOR !!!!", mpi_rank, cursor
    127 
    128       RETURN
    129       END
     195END SUBROUTINE iniphysiq
  • trunk/LMDZ.VENUS/libf/phyvenus/rcm1d.F

    r1305 r1395  
    213213      phisfi(1)=0.E+0
    214214
    215       CALL iniphysiq(1,llm,daysec,day0,dtphys,
    216      .            lati,long,area,cufi,cvfi,rad,g,r,cpp)
     215      CALL iniphysiq(1,1,llm,daysec,day0,dtphys,
     216     .            lati,long,area,cufi,cvfi,rad,g,r,cpp,1)
    217217
    218218c   Initialisation pour prendre en compte les vents en 1-D
Note: See TracChangeset for help on using the changeset viewer.