source: trunk/LMDZ.GENERIC/libf/phystd/iniphysiq.F90 @ 1351

Last change on this file since 1351 was 1315, checked in by milmd, 10 years ago

LMDZ.GENERIC. OpenMP directives added in generic physic. When running in pure OpenMP or hybrid OpenMP/MPI, may have some bugs with condense_cloud and wstats routines.

File size: 3.3 KB
Line 
1subroutine iniphysiq(ngrid,nlayer, punjours, pdayref,ptimestep,          &
2                     plat,plon,parea,pcu,pcv,                            &
3                     prad,pg,pr,pcpp,iflag_phys)
4
5use dimphy, only : klev ! number of atmospheric levels
6use mod_grid_phy_lmdz, only : klon_glo ! number of atmospheric columns
7                                       ! (on full grid)
8use mod_phys_lmdz_para, only : klon_omp, & ! number of columns (on local omp grid)
9                               klon_omp_begin, & ! start index of local omp subgrid
10                               klon_omp_end, & ! end index of local omp subgrid
11                               klon_mpi_begin ! start indes of columns (on local mpi grid)
12use comgeomphy, only : airephy, & ! physics grid area (m2)
13                       cuphy, & ! cu coeff. (u_covariant = cu * u)
14                       cvphy, & ! cv coeff. (v_covariant = cv * v)
15                       rlond, & ! longitudes
16                       rlatd ! latitudes
17use infotrac, only : nqtot ! number of advected tracers
18use planete_mod, only: ini_planete_mod
19
20implicit none
21include "dimensions.h"
22include "comvert.h"
23
24real,intent(in) :: prad ! radius of the planet (m)
25real,intent(in) :: pg ! gravitational acceleration (m/s2)
26real,intent(in) :: pr ! ! reduced gas constant R/mu
27real,intent(in) :: pcpp ! specific heat Cp
28real,intent(in) :: punjours ! length (in s) of a standard day
29integer,intent(in) :: ngrid ! number of horizontal grid points in the physics (full grid)
30integer,intent(in) :: nlayer ! number of atmospheric layers
31real,intent(in) :: plat(ngrid) ! latitudes of the physics grid
32real,intent(in) :: plon(ngrid) ! longitudes of the physics grid
33real,intent(in) :: parea(klon_glo) ! area (m2)
34real,intent(in) :: pcu(klon_glo) ! cu coeff. (u_covariant = cu * u)
35real,intent(in) :: pcv(klon_glo) ! cv coeff. (v_covariant = cv * v)
36integer,intent(in) :: pdayref ! reference day of for the simulation
37real,intent(in) :: ptimestep !physics time step (s)
38integer,intent(in) :: iflag_phys ! type of physics to be called
39
40integer :: ibegin,iend,offset
41character(len=20) :: modname='iniphysiq'
42character(len=80) :: abort_message
43
44IF (nlayer.NE.klev) THEN
45  write(*,*) 'STOP in ',trim(modname)
46  write(*,*) 'Problem with dimensions :'
47  write(*,*) 'nlayer     = ',nlayer
48  write(*,*) 'klev   = ',klev
49  abort_message = ''
50  CALL abort_gcm (modname,abort_message,1)
51ENDIF
52
53IF (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)
60ENDIF
61
62!$OMP PARALLEL PRIVATE(ibegin,iend) &
63        !$OMP SHARED(parea,pcu,pcv,plon,plat)
64     
65offset=klon_mpi_begin-1
66airephy(1:klon_omp)=parea(offset+klon_omp_begin:offset+klon_omp_end)
67cuphy(1:klon_omp)=pcu(offset+klon_omp_begin:offset+klon_omp_end)
68cvphy(1:klon_omp)=pcv(offset+klon_omp_begin:offset+klon_omp_end)
69rlond(1:klon_omp)=plon(offset+klon_omp_begin:offset+klon_omp_end)
70rlatd(1:klon_omp)=plat(offset+klon_omp_begin:offset+klon_omp_end)
71
72! copy over preff , ap() and bp()
73call ini_planete_mod(nlayer,preff,ap,bp)
74
75! copy some fundamental parameters to physics
76! and do some initializations
77call inifis(klon_omp,nlayer,nqtot,pdayref,punjours,ptimestep, &
78            rlatd,rlond,airephy,prad,pg,pr,pcpp)
79
80!$OMP END PARALLEL
81
82
83end subroutine iniphysiq
Note: See TracBrowser for help on using the repository browser.