Ignore:
Timestamp:
Mar 5, 2013, 4:01:03 PM (12 years ago)
Author:
slebonnois
Message:

SL: Important commit ! Adaptation of Venus physics to parallel computation / template for arch on the LMD servers using ifort / documentation for 1D column physics and for parallel computations

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.VENUS/libf/phyvenus/iniphysiq.F

    r841 r892  
    4343c   -------------
    4444 
    45       use dimphy
    46       USE comgeomphy
     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
    4750      IMPLICIT NONE
    48 #include "dimensions.h"
     51#include "iniprint.h"
    4952
    50       REAL prad,pg,pr,pcpp,punjours
     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)
    5167      INTEGER,INTENT(IN) :: iflag_phys ! type of physics to be called
    52       INTEGER ngrid,nlayer
    53       REAL plat(ngrid),plon(ngrid),parea(klon),pcu(klon),pcv(klon)
    54       INTEGER pdayref
    55  
    56       REAL ptimestep
     68
     69      INTEGER :: ibegin,iend,offset
     70      CHARACTER (LEN=20) :: modname='iniphysiq'
     71      CHARACTER (LEN=80) :: abort_message
    5772 
    5873      IF (nlayer.NE.klev) THEN
    59          PRINT*,'STOP in inifis'
    60          PRINT*,'Probleme de dimensions :'
    61          PRINT*,'nlayer     = ',nlayer
    62          PRINT*,'klev   = ',klev
    63          STOP
     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)
    6480      ENDIF
    6581
    66       IF (ngrid.NE.klon) THEN
    67          PRINT*,'STOP in inifis'
    68          PRINT*,'Probleme de dimensions :'
    69          PRINT*,'ngrid     = ',ngrid
    70          PRINT*,'klon   = ',klon
    71          STOP
     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)
    7289      ENDIF
    7390
    74       airephy=parea
    75       cuphy=pcu
    76       cvphy=pcv
    77       rlond = plon
    78       rlatd = plat
     91c$OMP PARALLEL PRIVATE(ibegin,iend)
     92c$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)
    79101
    80102      call suphec
     103
     104c$OMP END PARALLEL
     105
    81106c     print*,'ATTENTION !!! TRAVAILLER SUR INIPHYSIQ'
    82107c     print*,'CONTROLE DES LATITUDES, LONGITUDES, PARAMETRES ...'
    83108
     109c      print*,'agagagagagagagagaga'
     110c      print*,'klon_mpi_begin =', klon_mpi_begin
     111c      print*,'klon_mpi_end =', klon_mpi_end
     112c      print*,'klon_mpi =', klon_mpi
     113c      print*,'klon_mpi_para_nb =', klon_mpi_para_nb
     114c      print*,'klon_mpi_para_begin =', klon_mpi_para_begin
     115c      print*,'klon_mpi_para_end  =', klon_mpi_para_end
     116c      print*,'mpi_rank =', mpi_rank
     117c      print*,'mpi_size =', mpi_size
     118c      print*,'mpi_root =', mpi_root
     119c      print*,'klon_glo =', klon_glo
     120c      print*,'is_mpi_root =',is_mpi_root
     121c      print*,'is_omp_root =',is_omp_root
     122
     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
    84127
    85128      RETURN
Note: See TracChangeset for help on using the changeset viewer.