source: codes/icosagcm/branches/SATURN_DYNAMICO/LMDZ.COMMON/libf/phystd/iniphysiq.F90 @ 227

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

Last LMDZ version (1315) with OpenMP directives and other stuff

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