source: trunk/LMDZ.MARS/libf/phymars/comm_wrf.F90 @ 2740

Last change on this file since 2740 was 2616, checked in by romain.vande, 3 years ago

LMDZ_MARS RV : Open_MP;
Put all the "save" variables as "!$OMP THREADPRIVATE" in phymars.
The code can now be tested, see README for more info

File size: 2.1 KB
RevLine 
[1236]1module comm_wrf
2
3!!
4!! This module is useful to output fields in WRF style
[1590]5!! -- useful for diagnostics that are not already in modules
[1236]6!!
7
8  REAL,SAVE,ALLOCATABLE :: comm_HR_SW(:,:)
9  REAL,SAVE,ALLOCATABLE :: comm_HR_LW(:,:)
10  REAL,SAVE,ALLOCATABLE :: comm_SWDOWNZ(:)
11  REAL,SAVE,ALLOCATABLE :: comm_TAU_DUST(:)
12  REAL,SAVE,ALLOCATABLE :: comm_RDUST(:,:)
13  REAL,SAVE,ALLOCATABLE :: comm_QSURFDUST(:)
14  REAL,SAVE,ALLOCATABLE :: comm_MTOT(:)
15  REAL,SAVE,ALLOCATABLE :: comm_ICETOT(:)
16  REAL,SAVE,ALLOCATABLE :: comm_VMR_ICE(:,:)
17  REAL,SAVE,ALLOCATABLE :: comm_TAU_ICE(:)
18  REAL,SAVE,ALLOCATABLE :: comm_RICE(:,:)
19
[2616]20!$OMP THREADPRIVATE(comm_HR_LW,comm_HR_SW,comm_ICETOT,comm_MTOT,comm_QSURFDUST)
21!$OMP THREADPRIVATE(comm_RDUST,comm_RICE,comm_SWDOWNZ,comm_TAU_DUST,comm_TAU_ICE)
22!$OMP THREADPRIVATE(comm_VMR_ICE)
23
[1236]24contains
25
26  subroutine allocate_comm_wrf(ngrid,nlayer)
27  implicit none
28  integer,intent(in) :: ngrid ! number of atmospheric columns
29  integer,intent(in) :: nlayer ! number of atmospheric layers
[1590]30  if (.not.allocated(comm_HR_SW)) allocate(comm_HR_SW(ngrid,nlayer))
31  if (.not.allocated(comm_HR_LW)) allocate(comm_HR_LW(ngrid,nlayer))
32  if (.not.allocated(comm_SWDOWNZ)) allocate(comm_SWDOWNZ(ngrid))
33  if (.not.allocated(comm_TAU_DUST)) allocate(comm_TAU_DUST(ngrid))
34  if (.not.allocated(comm_RDUST)) allocate(comm_RDUST(ngrid,nlayer))
35  if (.not.allocated(comm_QSURFDUST)) allocate(comm_QSURFDUST(ngrid))
36  if (.not.allocated(comm_MTOT)) allocate(comm_MTOT(ngrid))
37  if (.not.allocated(comm_ICETOT)) allocate(comm_ICETOT(ngrid))
38  if (.not.allocated(comm_VMR_ICE)) allocate(comm_VMR_ICE(ngrid,nlayer))
39  if (.not.allocated(comm_TAU_ICE)) allocate(comm_TAU_ICE(ngrid))
40  if (.not.allocated(comm_RICE)) allocate(comm_RICE(ngrid,nlayer))
[1236]41  end subroutine allocate_comm_wrf
42
43  subroutine deallocate_comm_wrf
44  implicit none
45  deallocate(comm_HR_SW)
46  deallocate(comm_HR_LW)
47  deallocate(comm_SWDOWNZ)
48  deallocate(comm_TAU_DUST)
49  deallocate(comm_RDUST)
50  deallocate(comm_QSURFDUST)
51  deallocate(comm_MTOT)
52  deallocate(comm_ICETOT)
53  deallocate(comm_VMR_ICE)
54  deallocate(comm_TAU_ICE)
55  deallocate(comm_RICE)
56  end subroutine deallocate_comm_wrf
57
58end module comm_wrf
59
Note: See TracBrowser for help on using the repository browser.