source: LMDZ6/trunk/libf/phy_common/mod_phys_lmdz_para.F90 @ 3449

Last change on this file since 3449 was 3435, checked in by Laurent Fairhead, 6 years ago

"Historic" :-) commit merging the physics branch used for DYNAMICO with the LMDZ trunk.
The same physics branch can now be used seamlessly with the traditional lon-lat LMDZ
dynamical core and DYNAMICO.
Testing consisted in running a lon-lat LMDZ bucket simulation with the NPv6.1 physics package
with the original trunk sources and the merged sources. Tests were succesful in the sense that
numeric continuity was preserved in the restart files from both simulation. Further tests
included running both versions of the physics codes for one year in a LMDZOR setting in which
the restart files also came out identical.

Caution:

  • as the physics package now manages unstructured grids, grid information needs to be transmitted

to the surface scheme ORCHIDEE. This means that the interface defined in surf_land_orchidee_mod.F90
is only compatible with ORCHIDEE version orchidee2.1 and later versions. If previous versions of
ORCHIDEE need to be used, the CPP key ORCHIDEE_NOUNSTRUCT needs to be set at compilation time.
This is done automatically if makelmdz/makelmdz_fcm are called with the veget orchidee2.0 switch

  • due to a limitation in XIOS, the time at which limit conditions will be read in by DYNAMICO will be

delayed by one physic timestep with respect to the time it is read in by the lon-lat model. This is caused
by the line

IF (MOD(itime-1, lmt_pas) == 0 .OR. (jour_lu /= jour .AND. grid_type /= unstructured)) THEN ! time to read

in limit_read_mod.F90

Work still needed on COSP integration and XML files for DYNAMICO

EM, YM, LF

  • Property copyright set to
    Name of program: LMDZ
    Creation date: 1984
    Version: LMDZ5
    License: CeCILL version 2
    Holder: Laboratoire de m\'et\'eorologie dynamique, CNRS, UMR 8539
    See the license file in the root directory
  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 2.8 KB
Line 
1!
2! $Id: mod_phys_lmdz_para.F90 3435 2019-01-22 15:21:59Z oboucher $
3!
4MODULE mod_phys_lmdz_para
5  USE mod_phys_lmdz_transfert_para
6  USE mod_phys_lmdz_mpi_data
7  USE mod_phys_lmdz_omp_data
8   
9  INTEGER,SAVE :: klon_loc
10  LOGICAL,SAVE :: is_sequential
11  LOGICAL,SAVE :: is_parallel
12  LOGICAL,SAVE :: is_master
13
14 
15!$OMP THREADPRIVATE(klon_loc,is_master)
16 
17CONTAINS
18
19  SUBROUTINE Init_phys_lmdz_para(nbp,nbp_lon,nbp_lat,communicator)
20  IMPLICIT NONE
21    INTEGER,INTENT(in) :: nbp
22    INTEGER,INTENT(in) :: nbp_lon
23    INTEGER,INTENT(in) :: nbp_lat
24    INTEGER,INTENT(in) :: communicator
25
26    CALL Init_phys_lmdz_mpi_data(nbp,nbp_lon,nbp_lat,communicator)
27!$OMP PARALLEL
28    CALL Init_phys_lmdz_omp_data(klon_mpi)
29    klon_loc=klon_omp
30    IF (is_mpi_root .AND. is_omp_root) THEN
31       is_master=.TRUE.
32     ELSE
33       is_master=.FALSE.
34     ENDIF
35     CALL Test_transfert
36!$OMP END PARALLEL   
37     IF (is_using_mpi .OR. is_using_omp) THEN
38       is_sequential=.FALSE.
39       is_parallel=.TRUE.
40     ELSE
41       is_sequential=.TRUE.
42       is_parallel=.FALSE.
43     ENDIF
44
45
46     
47  END SUBROUTINE Init_phys_lmdz_para
48
49  SUBROUTINE Test_transfert
50  USE mod_grid_phy_lmdz
51  USE print_control_mod, ONLY: lunout
52  IMPLICIT NONE
53!    INCLUDE "iniprint.h"
54 
55    REAL :: Test_Field1d_glo(klon_glo,nbp_lev)
56    REAL :: tmp1d_glo(klon_glo,nbp_lev)
57    REAL :: Test_Field2d_glo(nbp_lon,nbp_lat,nbp_lev)
58    REAL :: tmp2d_glo(nbp_lon,nbp_lat,nbp_lev)
59    REAL :: Test_Field1d_loc(klon_loc,nbp_lev)
60    REAL :: Test_Field2d_loc(nbp_lon,jj_nb,nbp_lev)
61    REAL :: CheckSum
62   
63    INTEGER :: i,l
64 
65    Test_Field1d_glo = 0.
66    Test_Field2d_glo = 0.
67    Test_Field1d_loc = 0.
68    Test_Field2d_loc = 0.
69 
70    IF (is_mpi_root) THEN
71!$OMP MASTER
72      DO l=1,nbp_lev
73        DO i=1,klon_glo
74!          Test_Field1d_glo(i,l)=MOD(i,10)+10*(l-1)
75           Test_Field1d_glo(i,l)=1
76        ENDDO
77      ENDDO
78!$OMP END MASTER 
79    ENDIF
80 
81    CALL Scatter(Test_Field1d_glo,Test_Field1d_loc)
82    CALL Gather(Test_Field1d_loc,tmp1d_glo)
83 
84    IF (is_mpi_root) THEN
85!$OMP MASTER 
86      Checksum=sum(Test_Field1d_glo-tmp1d_glo)
87      WRITE(lunout,*) "------> Checksum =",Checksum," MUST BE 0"
88!$OMP END MASTER
89    ENDIF
90   
91    CALL grid1dTo2d_glo(Test_Field1d_glo,Test_Field2d_glo)
92    CALL scatter2D(Test_Field2d_glo,Test_Field1d_loc)
93    CALL gather2d(Test_Field1d_loc,Test_Field2d_glo)
94    CALL grid2dTo1d_glo(Test_Field2d_glo,tmp1d_glo)
95
96    IF (is_mpi_root) THEN
97!$OMP MASTER 
98      Checksum=sum(Test_Field1d_glo-tmp1d_glo)
99      WRITE(lunout,*) "------> Checksum =",Checksum," MUST BE 0"
100!$OMP END MASTER
101    ENDIF
102
103    CALL bcast(Test_Field1d_glo)
104    CALL reduce_sum(Test_Field1d_glo,tmp1d_glo)
105
106    IF (is_mpi_root) THEN
107!$OMP MASTER 
108      Checksum=sum(Test_Field1d_glo*omp_size*mpi_size-tmp1d_glo)
109      WRITE(lunout,*) "------> Checksum =",Checksum," MUST BE 0"
110!$OMP END MASTER
111    ENDIF
112   
113     
114   END SUBROUTINE Test_transfert
115 
116END MODULE mod_phys_lmdz_para
117   
Note: See TracBrowser for help on using the repository browser.